From: Andrea Cuccaro Date: Tue, 14 Jan 2020 15:28:16 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.3 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=5eb6a0f7b754275dc8ccfd381bfde23cb16fe207;p=motion2.git Built motion from commit (unavailable).|2.4.3 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 7ed8224..e4fd26a 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.3", "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-01-14T15:11:56.253Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.3", "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-01-14T15:21:04.646Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 2e122b4..89dfbad 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.3", "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-01-14T15:11:56.253Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.3", "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-01-14T15:21:04.646Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index c8132fb..cc788d0 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 _0x55ca=['sequelize','exports','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x44e220,_0x4874ca){var _0x5cd381=function(_0x5abff2){while(--_0x5abff2){_0x44e220['push'](_0x44e220['shift']());}};_0x5cd381(++_0x4874ca);}(_0x55ca,0x126));var _0xa55c=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0x55ca[_0xbced40];return _0x230f2e;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5edc58){return this['getDataValue'](_0xa55c('0x2'));}},'action':{'type':Sequelize[_0xa55c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa55c('0x4'),_0xa55c('0x5'),_0xa55c('0x6'),_0xa55c('0x7'),_0xa55c('0x8'),_0xa55c('0x9'),_0xa55c('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xa55c('0xb')},'data1':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xa55c('0x3')](0x1000),'comment':_0xa55c('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data5':{'type':Sequelize[_0xa55c('0x3')](0x1000)},'data6':{'type':Sequelize[_0xa55c('0x3')]},'data7':{'type':Sequelize[_0xa55c('0xd')]}}; \ No newline at end of file +var _0x70e0=['TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x14f149,_0x1ea5b9){var _0x71618a=function(_0x505ab6){while(--_0x505ab6){_0x14f149['push'](_0x14f149['shift']());}};_0x71618a(++_0x1ea5b9);}(_0x70e0,0x17b));var _0x070e=function(_0x1ecba4,_0x229069){_0x1ecba4=_0x1ecba4-0x0;var _0x46d6df=_0x70e0[_0x1ecba4];return _0x46d6df;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')],'get':function(_0x4d95bb){return this['getDataValue'](_0x070e('0x3'));}},'action':{'type':Sequelize[_0x070e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x070e('0x5'),_0x070e('0x6'),'motionbar',_0x070e('0x7'),'urlForward',_0x070e('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x070e('0x9')},'data1':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xa')},'data2':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xb')},'data3':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x070e('0x4')]},'data7':{'type':Sequelize[_0x070e('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index e2a4b6e..1202994 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 _0x0c10=['end','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x2e7c5b,_0x2e37f4){var _0x3ad5fd=function(_0x46e52f){while(--_0x46e52f){_0x2e7c5b['push'](_0x2e7c5b['shift']());}};_0x3ad5fd(++_0x2e37f4);}(_0x0c10,0x14f));var _0x00c1=function(_0x53bde7,_0xe2ca44){_0x53bde7=_0x53bde7-0x0;var _0x52d7f1=_0x0c10[_0x53bde7];return _0x52d7f1;};'use strict';var pdf=require(_0x00c1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x00c1('0x1'));var zipdir=require(_0x00c1('0x2'));var jsonpatch=require(_0x00c1('0x3'));var rp=require(_0x00c1('0x4'));var moment=require(_0x00c1('0x5'));var BPromise=require(_0x00c1('0x6'));var Mustache=require(_0x00c1('0x7'));var util=require(_0x00c1('0x8'));var path=require(_0x00c1('0x9'));var sox=require(_0x00c1('0xa'));var csv=require(_0x00c1('0xb'));var ejs=require(_0x00c1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x00c1('0xd'));var crypto=require('crypto');var jsforce=require(_0x00c1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x00c1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x00c1('0xf'));var authService=require(_0x00c1('0x10'));var qs=require(_0x00c1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00c1('0x12'))(_0x00c1('0x13'));var utils=require(_0x00c1('0x14'));var config=require(_0x00c1('0x15'));var db=require(_0x00c1('0x16'))['db'];function respondWithStatusCode(_0x54648e,_0x7d4b1b){_0x7d4b1b=_0x7d4b1b||0xcc;return function(_0x4b7755){if(_0x4b7755){return _0x54648e[_0x00c1('0x17')](_0x7d4b1b);}return _0x54648e[_0x00c1('0x18')](_0x7d4b1b)[_0x00c1('0x19')]();};}function respondWithResult(_0x155115,_0x44c108){_0x44c108=_0x44c108||0xc8;return function(_0x2e6c6f){if(_0x2e6c6f){return _0x155115['status'](_0x44c108)['json'](_0x2e6c6f);}};}function respondWithFilteredResult(_0x562d0a,_0x55dd23){return function(_0x179114){if(_0x179114){var _0x5b49e3=_0x179114[_0x00c1('0x1a')],_0x58c8d4=_0x55dd23['offset'],_0x2b3258=_0x55dd23[_0x00c1('0x1b')]+_0x55dd23['limit'],_0x15a0b9;if(_0x2b3258>=_0x5b49e3){_0x2b3258=_0x5b49e3;_0x15a0b9=0xc8;}else{_0x15a0b9=0xce;}_0x562d0a[_0x00c1('0x18')](_0x15a0b9);return _0x562d0a[_0x00c1('0x1c')](_0x00c1('0x1d'),_0x58c8d4+'-'+_0x2b3258+'/'+_0x5b49e3)[_0x00c1('0x1e')](_0x179114);}return null;};}function patchUpdates(_0x35220f){return function(_0x223643){try{jsonpatch[_0x00c1('0x1f')](_0x223643,_0x35220f,!![]);}catch(_0x38da4b){return BPromise[_0x00c1('0x20')](_0x38da4b);}return _0x223643['save']();};}function saveUpdates(_0xa191f,_0x280edd){return function(_0x2e8b5a){if(_0x2e8b5a){return _0x2e8b5a[_0x00c1('0x21')](_0xa191f)[_0x00c1('0x22')](function(_0x4c8e73){return _0x4c8e73;});}return null;};}function removeEntity(_0x5f0a19,_0x508c94){return function(_0x56db28){if(_0x56db28){return _0x56db28[_0x00c1('0x23')]()['then'](function(){_0x5f0a19[_0x00c1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1487a9,_0x3316f5){return function(_0x189e68){if(!_0x189e68){_0x1487a9[_0x00c1('0x17')](0x194);}return _0x189e68;};}function handleError(_0x11bab4,_0x3541b3){_0x3541b3=_0x3541b3||0x1f4;return function(_0x55279e){logger[_0x00c1('0x24')](_0x55279e[_0x00c1('0x25')]);if(_0x55279e[_0x00c1('0x26')]){delete _0x55279e[_0x00c1('0x26')];}_0x11bab4[_0x00c1('0x18')](_0x3541b3)[_0x00c1('0x27')](_0x55279e);};}exports[_0x00c1('0x21')]=function(_0x6e00e,_0xb13a7e){if(_0x6e00e[_0x00c1('0x28')]['id']){delete _0x6e00e[_0x00c1('0x28')]['id'];}return db[_0x00c1('0x29')][_0x00c1('0x2a')]({'where':{'id':_0x6e00e[_0x00c1('0x2b')]['id']}})[_0x00c1('0x22')](handleEntityNotFound(_0xb13a7e,null))['then'](saveUpdates(_0x6e00e[_0x00c1('0x28')],null))[_0x00c1('0x22')](respondWithResult(_0xb13a7e,null))[_0x00c1('0x2c')](handleError(_0xb13a7e,null));};exports[_0x00c1('0x23')]=function(_0x206f1f,_0xf0058b){return db['Action']['find']({'where':{'id':_0x206f1f[_0x00c1('0x2b')]['id']}})[_0x00c1('0x22')](handleEntityNotFound(_0xf0058b,null))[_0x00c1('0x22')](removeEntity(_0xf0058b,null))[_0x00c1('0x2c')](handleError(_0xf0058b,null));}; \ No newline at end of file +var _0x1aa5=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Action','catch','find','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x46eb55,_0x3cbe36){var _0x2a98af=function(_0x52c26f){while(--_0x52c26f){_0x46eb55['push'](_0x46eb55['shift']());}};_0x2a98af(++_0x3cbe36);}(_0x1aa5,0x12b));var _0x51aa=function(_0x43bf30,_0x3dc0f9){_0x43bf30=_0x43bf30-0x0;var _0x258fe8=_0x1aa5[_0x43bf30];return _0x258fe8;};'use strict';var pdf=require(_0x51aa('0x0'));var emlformat=require(_0x51aa('0x1'));var rimraf=require(_0x51aa('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51aa('0x3'));var rp=require(_0x51aa('0x4'));var moment=require(_0x51aa('0x5'));var BPromise=require(_0x51aa('0x6'));var Mustache=require(_0x51aa('0x7'));var util=require(_0x51aa('0x8'));var path=require(_0x51aa('0x9'));var sox=require(_0x51aa('0xa'));var csv=require(_0x51aa('0xb'));var ejs=require(_0x51aa('0xc'));var fs=require('fs');var _=require(_0x51aa('0xd'));var squel=require(_0x51aa('0xe'));var crypto=require(_0x51aa('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x51aa('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51aa('0x11'));var authService=require(_0x51aa('0x12'));var qs=require(_0x51aa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x51aa('0x14'));var config=require('../../config/environment');var db=require(_0x51aa('0x15'))['db'];function respondWithStatusCode(_0x3965d4,_0x1b4934){_0x1b4934=_0x1b4934||0xcc;return function(_0x2fc50a){if(_0x2fc50a){return _0x3965d4[_0x51aa('0x16')](_0x1b4934);}return _0x3965d4[_0x51aa('0x17')](_0x1b4934)['end']();};}function respondWithResult(_0xbc5d5c,_0x58a61c){_0x58a61c=_0x58a61c||0xc8;return function(_0xb64193){if(_0xb64193){return _0xbc5d5c[_0x51aa('0x17')](_0x58a61c)[_0x51aa('0x18')](_0xb64193);}};}function respondWithFilteredResult(_0x1f11af,_0x2e2a09){return function(_0x1818ce){if(_0x1818ce){var _0xae8a06=_0x1818ce[_0x51aa('0x19')],_0x59c24f=_0x2e2a09[_0x51aa('0x1a')],_0x596892=_0x2e2a09[_0x51aa('0x1a')]+_0x2e2a09[_0x51aa('0x1b')],_0x4c8c63;if(_0x596892>=_0xae8a06){_0x596892=_0xae8a06;_0x4c8c63=0xc8;}else{_0x4c8c63=0xce;}_0x1f11af[_0x51aa('0x17')](_0x4c8c63);return _0x1f11af[_0x51aa('0x1c')](_0x51aa('0x1d'),_0x59c24f+'-'+_0x596892+'/'+_0xae8a06)[_0x51aa('0x18')](_0x1818ce);}return null;};}function patchUpdates(_0x46cd61){return function(_0x307aa0){try{jsonpatch['apply'](_0x307aa0,_0x46cd61,!![]);}catch(_0x3d7990){return BPromise[_0x51aa('0x1e')](_0x3d7990);}return _0x307aa0[_0x51aa('0x1f')]();};}function saveUpdates(_0x90067,_0x3090ce){return function(_0x5c1156){if(_0x5c1156){return _0x5c1156[_0x51aa('0x20')](_0x90067)[_0x51aa('0x21')](function(_0x2b0901){return _0x2b0901;});}return null;};}function removeEntity(_0x4e970a,_0x559387){return function(_0xc731dd){if(_0xc731dd){return _0xc731dd[_0x51aa('0x22')]()[_0x51aa('0x21')](function(){_0x4e970a[_0x51aa('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1135df,_0xf88b65){return function(_0x2c158a){if(!_0x2c158a){_0x1135df[_0x51aa('0x16')](0x194);}return _0x2c158a;};}function handleError(_0x4f079a,_0x34193f){_0x34193f=_0x34193f||0x1f4;return function(_0x2a95b1){logger[_0x51aa('0x23')](_0x2a95b1[_0x51aa('0x24')]);if(_0x2a95b1[_0x51aa('0x25')]){delete _0x2a95b1[_0x51aa('0x25')];}_0x4f079a[_0x51aa('0x17')](_0x34193f)[_0x51aa('0x26')](_0x2a95b1);};}exports['update']=function(_0xe01371,_0x56d1fc){if(_0xe01371[_0x51aa('0x27')]['id']){delete _0xe01371[_0x51aa('0x27')]['id'];}return db[_0x51aa('0x28')]['find']({'where':{'id':_0xe01371['params']['id']}})[_0x51aa('0x21')](handleEntityNotFound(_0x56d1fc,null))[_0x51aa('0x21')](saveUpdates(_0xe01371['body'],null))['then'](respondWithResult(_0x56d1fc,null))[_0x51aa('0x29')](handleError(_0x56d1fc,null));};exports['destroy']=function(_0x40c12d,_0x479cc3){return db[_0x51aa('0x28')][_0x51aa('0x2a')]({'where':{'id':_0x40c12d[_0x51aa('0x2b')]['id']}})[_0x51aa('0x21')](handleEntityNotFound(_0x479cc3,null))['then'](removeEntity(_0x479cc3,null))['catch'](handleError(_0x479cc3,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 43eb96b..35f293d 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 _0xfec4=['moment','request-promise','../../config/environment','./action.attributes','exports','Action','util','../../config/logger','api'];(function(_0x5cd78c,_0x3ffe90){var _0x38b45c=function(_0x243236){while(--_0x243236){_0x5cd78c['push'](_0x5cd78c['shift']());}};_0x38b45c(++_0x3ffe90);}(_0xfec4,0x138));var _0x4fec=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xfec4[_0xd2d54];return _0x78b113;};'use strict';var _=require('lodash');var util=require(_0x4fec('0x0'));var logger=require(_0x4fec('0x1'))(_0x4fec('0x2'));var moment=require(_0x4fec('0x3'));var BPromise=require('bluebird');var rp=require(_0x4fec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4fec('0x5'));var attributes=require(_0x4fec('0x6'));module[_0x4fec('0x7')]=function(_0x4a90e1,_0x4b6a3f){return _0x4a90e1['define'](_0x4fec('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf12d=['moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0xf12d,0x10e));var _0xdf12=function(_0x29859f,_0x5e6722){_0x29859f=_0x29859f-0x0;var _0x218dc4=_0xf12d[_0x29859f];return _0x218dc4;};'use strict';var _=require(_0xdf12('0x0'));var util=require('util');var logger=require(_0xdf12('0x1'))(_0xdf12('0x2'));var moment=require(_0xdf12('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf12('0x4'));var fs=require('fs');var path=require(_0xdf12('0x5'));var rimraf=require(_0xdf12('0x6'));var config=require(_0xdf12('0x7'));var attributes=require(_0xdf12('0x8'));module[_0xdf12('0x9')]=function(_0x26c2ba,_0x24ed6a){return _0x26c2ba[_0xdf12('0xa')](_0xdf12('0xb'),attributes,{'tableName':_0xdf12('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c5f6245..21f17eb 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 _0xf2ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1683cf,_0x20b3cb){var _0x1159ad=function(_0x241e90){while(--_0x241e90){_0x1683cf['push'](_0x1683cf['shift']());}};_0x1159ad(++_0x20b3cb);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x26cc16,_0x4c174f){_0x26cc16=_0x26cc16-0x0;var _0x345e3e=_0xf2ca[_0x26cc16];return _0x345e3e;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){return client[_0xaf2c('0xc')](_0x1f9531,_0x37fedd)['then'](function(_0x439ca3){logger['info'](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x58351f,'request\x20sent',JSON['stringify'](_0x439ca3));if(_0x439ca3[_0xaf2c('0x11')]){if(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x12')]===0x1f4){logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3['error']['message']);return _0x4a7397(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);return _0x3c0421(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}else{logger[_0xaf2c('0x14')](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));_0x3c0421(_0x439ca3[_0xaf2c('0x15')][_0xaf2c('0x13')]);}})[_0xaf2c('0x16')](function(_0x705d09){logger['error'](_0xaf2c('0xd'),_0x58351f,_0x705d09);_0x4a7397(_0x705d09);});});} \ No newline at end of file +var _0xf8b2=['code','Action,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error'];(function(_0x421607,_0x4493aa){var _0xbf830b=function(_0x254eb2){while(--_0x254eb2){_0x421607['push'](_0x421607['shift']());}};_0xbf830b(++_0x4493aa);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x341c1f,_0x3a51bb){_0x341c1f=_0x341c1f-0x0;var _0x43e13e=_0xf8b2[_0x341c1f];return _0x43e13e;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('Action,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('Action,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 20a824f..e8b60f3 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 _0x8d37=['isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x53c07c,_0x19081a){var _0x4299d8=function(_0x4d67a8){while(--_0x4d67a8){_0x53c07c['push'](_0x53c07c['shift']());}};_0x4299d8(++_0x19081a);}(_0x8d37,0x1d5));var _0x78d3=function(_0x5501e2,_0xc10798){_0x5501e2=_0x5501e2-0x0;var _0x1c6373=_0x8d37[_0x5501e2];return _0x1c6373;};'use strict';var multer=require(_0x78d3('0x0'));var util=require(_0x78d3('0x1'));var path=require(_0x78d3('0x2'));var timeout=require(_0x78d3('0x3'));var express=require(_0x78d3('0x4'));var router=express['Router']();var auth=require(_0x78d3('0x5'));var interaction=require(_0x78d3('0x6'));var config=require(_0x78d3('0x7'));var controller=require(_0x78d3('0x8'));router[_0x78d3('0x9')](_0x78d3('0xa'),auth[_0x78d3('0xb')](),controller[_0x78d3('0xc')]);router['delete'](_0x78d3('0xa'),auth[_0x78d3('0xb')](),controller[_0x78d3('0xd')]);module[_0x78d3('0xe')]=router; \ No newline at end of file +var _0x98e5=['../../components/auth/service','../../components/interaction/service','./action.controller','isAuthenticated','delete','/:id','destroy','exports','connect-timeout','express'];(function(_0x1df0b0,_0x309e16){var _0x43c412=function(_0x5131ca){while(--_0x5131ca){_0x1df0b0['push'](_0x1df0b0['shift']());}};_0x43c412(++_0x309e16);}(_0x98e5,0x8a));var _0x598e=function(_0x47c9b1,_0x119667){_0x47c9b1=_0x47c9b1-0x0;var _0x314445=_0x98e5[_0x47c9b1];return _0x314445;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x598e('0x0'));var express=require(_0x598e('0x1'));var router=express['Router']();var auth=require(_0x598e('0x2'));var interaction=require(_0x598e('0x3'));var config=require('../../config/environment');var controller=require(_0x598e('0x4'));router['put']('/:id',auth[_0x598e('0x5')](),controller['update']);router[_0x598e('0x6')](_0x598e('0x7'),auth[_0x598e('0x5')](),controller[_0x598e('0x8')]);module[_0x598e('0x9')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2188a14..96d1d5f 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 _0x1348=['sequelize','exports','STRING','TEXT'];(function(_0x48cd15,_0x19e2e3){var _0x3d876d=function(_0x43dacd){while(--_0x43dacd){_0x48cd15['push'](_0x48cd15['shift']());}};_0x3d876d(++_0x19e2e3);}(_0x1348,0x198));var _0x8134=function(_0x327c89,_0x4fda79){_0x327c89=_0x327c89-0x0;var _0x2827b0=_0x1348[_0x327c89];return _0x2827b0;};'use strict';var Sequelize=require(_0x8134('0x0'));module[_0x8134('0x1')]={'name':{'type':Sequelize[_0x8134('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x8134('0x2')]},'table':{'type':Sequelize[_0x8134('0x2')]},'conditions':{'type':Sequelize[_0x8134('0x3')]},'joins':{'type':Sequelize[_0x8134('0x3')]}}; \ No newline at end of file +var _0x966d=['TEXT','sequelize','exports','STRING'];(function(_0x4005e4,_0x1e51b3){var _0x5a43ce=function(_0x438b3a){while(--_0x438b3a){_0x4005e4['push'](_0x4005e4['shift']());}};_0x5a43ce(++_0x1e51b3);}(_0x966d,0x121));var _0xd966=function(_0x15281b,_0x2d9769){_0x15281b=_0x15281b-0x0;var _0x24fd7c=_0x966d[_0x15281b];return _0x24fd7c;};'use strict';var Sequelize=require(_0xd966('0x0'));module[_0xd966('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd966('0x2')]},'parent':{'type':Sequelize[_0xd966('0x2')]},'table':{'type':Sequelize[_0xd966('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd966('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 20b78b5..e15f4b3 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 _0x09cc=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','toString','sequelize','cross_join','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','keyBy','%s.%s\x20=\x20%s.%s','clone','debug','QueryTypes','SELECT','ValidationErrorItem','No\x20available\x20data','fullPath','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','join','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','run','runReport','COUNT(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','AnalyticCustomReport','findAll','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x09cc,0x106));var _0xc09c=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x09cc[_0x318840];return _0x223da4;};'use strict';var pdf=require(_0xc09c('0x0'));var emlformat=require(_0xc09c('0x1'));var rimraf=require(_0xc09c('0x2'));var zipdir=require(_0xc09c('0x3'));var jsonpatch=require(_0xc09c('0x4'));var rp=require('request-promise');var moment=require(_0xc09c('0x5'));var BPromise=require(_0xc09c('0x6'));var Mustache=require(_0xc09c('0x7'));var util=require(_0xc09c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc09c('0x9'));var ejs=require(_0xc09c('0xa'));var fs=require('fs');var _=require(_0xc09c('0xb'));var squel=require(_0xc09c('0xc'));var crypto=require(_0xc09c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc09c('0xe'));var toCsv=require(_0xc09c('0x9'));var querystring=require(_0xc09c('0xf'));var Papa=require(_0xc09c('0x10'));var Redis=require(_0xc09c('0x11'));var authService=require(_0xc09c('0x12'));var qs=require(_0xc09c('0x13'));var hardwareService=require(_0xc09c('0x14'));var logger=require(_0xc09c('0x15'))(_0xc09c('0x16'));var utils=require(_0xc09c('0x17'));var config=require(_0xc09c('0x18'));var db=require(_0xc09c('0x19'))['db'];function respondWithStatusCode(_0x424378,_0x325834){_0x325834=_0x325834||0xcc;return function(_0x11a9e9){if(_0x11a9e9){return _0x424378[_0xc09c('0x1a')](_0x325834);}return _0x424378[_0xc09c('0x1b')](_0x325834)[_0xc09c('0x1c')]();};}function respondWithResult(_0x213695,_0x5e299c){_0x5e299c=_0x5e299c||0xc8;return function(_0x3df44d){if(_0x3df44d){return _0x213695[_0xc09c('0x1b')](_0x5e299c)[_0xc09c('0x1d')](_0x3df44d);}};}function respondWithFilteredResult(_0x21577e,_0x16a4c7){return function(_0x51b812){if(_0x51b812){var _0x4f36d8=_0x51b812[_0xc09c('0x1e')],_0x1de527=_0x16a4c7[_0xc09c('0x1f')],_0x4d3b56=_0x16a4c7[_0xc09c('0x1f')]+_0x16a4c7['limit'],_0x392ba3;if(_0x4d3b56>=_0x4f36d8){_0x4d3b56=_0x4f36d8;_0x392ba3=0xc8;}else{_0x392ba3=0xce;}_0x21577e[_0xc09c('0x1b')](_0x392ba3);return _0x21577e['set'](_0xc09c('0x20'),_0x1de527+'-'+_0x4d3b56+'/'+_0x4f36d8)[_0xc09c('0x1d')](_0x51b812);}return null;};}function patchUpdates(_0x32c655){return function(_0xb68b6d){try{jsonpatch[_0xc09c('0x21')](_0xb68b6d,_0x32c655,!![]);}catch(_0x2b8217){return BPromise['reject'](_0x2b8217);}return _0xb68b6d[_0xc09c('0x22')]();};}function saveUpdates(_0x39b8f7,_0x1f53cd){return function(_0x2d62d2){if(_0x2d62d2){return _0x2d62d2[_0xc09c('0x23')](_0x39b8f7)[_0xc09c('0x24')](function(_0x4335be){return _0x4335be;});}return null;};}function removeEntity(_0x105173,_0x210351){return function(_0x1f819c){if(_0x1f819c){return _0x1f819c[_0xc09c('0x25')]()[_0xc09c('0x24')](function(){var _0x51da29=_0x1f819c[_0xc09c('0x26')]({'plain':!![]});var _0xb7b634=_0xc09c('0x27');return db[_0xc09c('0x28')][_0xc09c('0x25')]({'where':{'type':_0xb7b634,'resourceId':_0x51da29['id']}})['then'](function(){return _0x1f819c;});})[_0xc09c('0x24')](function(){_0x105173[_0xc09c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54c369,_0x567c1e){return function(_0x48f527){if(!_0x48f527){_0x54c369[_0xc09c('0x1a')](0x194);}return _0x48f527;};}function handleError(_0x2b4596,_0x32a803){_0x32a803=_0x32a803||0x1f4;return function(_0x34ab53){logger[_0xc09c('0x29')](_0x34ab53['stack']);if(_0x34ab53['name']){delete _0x34ab53[_0xc09c('0x2a')];}_0x2b4596['status'](_0x32a803)[_0xc09c('0x2b')](_0x34ab53);};}exports[_0xc09c('0x2c')]=function(_0x58a910,_0x1121e7){var _0x27af4e={},_0x9dad88={},_0x17c424={'count':0x0,'rows':[]};var _0x4e0610=db['AnalyticCustomReport']['rawAttributes'];_0x9dad88[_0xc09c('0x2d')]=_[_0xc09c('0x2e')](_0x4e0610);_0x9dad88[_0xc09c('0x2f')]=_[_0xc09c('0x2e')](_0x58a910[_0xc09c('0x2f')]);_0x9dad88[_0xc09c('0x30')]=_[_0xc09c('0x31')](_0x9dad88[_0xc09c('0x2d')],_0x9dad88[_0xc09c('0x2f')]);_0x27af4e['attributes']=_[_0xc09c('0x31')](_0x9dad88['model'],qs[_0xc09c('0x32')](_0x58a910[_0xc09c('0x2f')][_0xc09c('0x32')]));_0x27af4e[_0xc09c('0x33')]=_0x27af4e[_0xc09c('0x33')][_0xc09c('0x34')]?_0x27af4e[_0xc09c('0x33')]:_0x9dad88[_0xc09c('0x2d')];if(!_0x58a910['query'][_0xc09c('0x35')](_0xc09c('0x36'))){_0x27af4e[_0xc09c('0x37')]=qs['limit'](_0x58a910[_0xc09c('0x2f')][_0xc09c('0x37')]);_0x27af4e[_0xc09c('0x1f')]=qs[_0xc09c('0x1f')](_0x58a910[_0xc09c('0x2f')][_0xc09c('0x1f')]);}_0x27af4e['order']=qs['sort'](_0x58a910[_0xc09c('0x2f')][_0xc09c('0x38')]);_0x27af4e[_0xc09c('0x39')]=qs[_0xc09c('0x30')](_[_0xc09c('0x3a')](_0x58a910[_0xc09c('0x2f')],_0x9dad88['filters']));if(_0x58a910['query'][_0xc09c('0x3b')]){_0x27af4e[_0xc09c('0x39')]=_[_0xc09c('0x3c')](_0x27af4e['where'],{'$or':_[_0xc09c('0x3d')](_0x4e0610,function(_0x3d2bd2){if(_0x3d2bd2[_0xc09c('0x3e')]['key']!==_0xc09c('0x3f')){var _0x7de931={};_0x7de931[_0x3d2bd2[_0xc09c('0x40')]]={'$like':'%'+_0x58a910[_0xc09c('0x2f')]['filter']+'%'};return _0x7de931;}})});}_0x27af4e=_['merge']({},_0x27af4e,_0x58a910[_0xc09c('0x41')]);var _0x46c5b6={'where':_0x27af4e[_0xc09c('0x39')]};return db['AnalyticCustomReport'][_0xc09c('0x1e')](_0x46c5b6)[_0xc09c('0x24')](function(_0x19e874){_0x17c424['count']=_0x19e874;if(_0x58a910[_0xc09c('0x2f')]['includeAll']){_0x27af4e[_0xc09c('0x42')]=[{'all':!![]}];}return db[_0xc09c('0x43')][_0xc09c('0x44')](_0x27af4e);})[_0xc09c('0x24')](function(_0x49522d){_0x17c424['rows']=_0x49522d;return _0x17c424;})['then'](respondWithFilteredResult(_0x1121e7,_0x27af4e))[_0xc09c('0x45')](handleError(_0x1121e7,null));};exports[_0xc09c('0x46')]=function(_0x517c66,_0x5e2035){var _0x31d1ea={'raw':![],'where':{'id':_0x517c66[_0xc09c('0x47')]['id']}},_0x23ac74={};_0x23ac74[_0xc09c('0x2d')]=_[_0xc09c('0x2e')](db[_0xc09c('0x43')][_0xc09c('0x48')]);_0x23ac74[_0xc09c('0x2f')]=_[_0xc09c('0x2e')](_0x517c66[_0xc09c('0x2f')]);_0x23ac74[_0xc09c('0x30')]=_['intersection'](_0x23ac74['model'],_0x23ac74[_0xc09c('0x2f')]);_0x31d1ea[_0xc09c('0x33')]=_['intersection'](_0x23ac74['model'],qs[_0xc09c('0x32')](_0x517c66[_0xc09c('0x2f')][_0xc09c('0x32')]));_0x31d1ea[_0xc09c('0x33')]=_0x31d1ea[_0xc09c('0x33')]['length']?_0x31d1ea[_0xc09c('0x33')]:_0x23ac74[_0xc09c('0x2d')];if(_0x517c66[_0xc09c('0x2f')][_0xc09c('0x49')]){_0x31d1ea[_0xc09c('0x42')]=[{'all':!![]}];}_0x31d1ea=_['merge']({},_0x31d1ea,_0x517c66['options']);return db[_0xc09c('0x43')][_0xc09c('0x4a')](_0x31d1ea)['then'](handleEntityNotFound(_0x5e2035,null))[_0xc09c('0x24')](respondWithResult(_0x5e2035,null))[_0xc09c('0x45')](handleError(_0x5e2035,null));};exports[_0xc09c('0x4b')]=function(_0x2e4a65,_0x1084da){return db['AnalyticCustomReport'][_0xc09c('0x4b')](_0x2e4a65[_0xc09c('0x4c')],{})['then'](function(_0x5bce9e){var _0x4dcfd2=_0x2e4a65[_0xc09c('0x4d')]['get']({'plain':!![]});if(!_0x4dcfd2)throw new Error(_0xc09c('0x4e'));if(_0x4dcfd2[_0xc09c('0x4f')]==='user'){var _0xfdf796=_0x5bce9e['get']({'plain':!![]});var _0x959c96=_0xc09c('0x50');return db[_0xc09c('0x51')][_0xc09c('0x4a')]({'where':{'name':_0x959c96,'userProfileId':_0x4dcfd2[_0xc09c('0x52')]},'raw':!![]})[_0xc09c('0x24')](function(_0x4ca6a9){if(_0x4ca6a9&&_0x4ca6a9[_0xc09c('0x53')]===0x0){return db[_0xc09c('0x28')][_0xc09c('0x4b')]({'name':_0xfdf796[_0xc09c('0x2a')],'resourceId':_0xfdf796['id'],'type':'CustomReports','sectionId':_0x4ca6a9['id']},{})[_0xc09c('0x24')](function(){return _0x5bce9e;});}else{return _0x5bce9e;}})[_0xc09c('0x45')](function(_0x59a689){logger[_0xc09c('0x29')](_0xc09c('0x54'),_0x59a689);throw _0x59a689;});}return _0x5bce9e;})[_0xc09c('0x24')](respondWithResult(_0x1084da,0xc9))[_0xc09c('0x45')](handleError(_0x1084da,null));};exports[_0xc09c('0x23')]=function(_0x451322,_0x56924b){if(_0x451322[_0xc09c('0x4c')]['id']){delete _0x451322['body']['id'];}return db[_0xc09c('0x43')]['find']({'where':{'id':_0x451322[_0xc09c('0x47')]['id']}})[_0xc09c('0x24')](handleEntityNotFound(_0x56924b,null))[_0xc09c('0x24')](saveUpdates(_0x451322[_0xc09c('0x4c')],null))[_0xc09c('0x24')](respondWithResult(_0x56924b,null))['catch'](handleError(_0x56924b,null));};exports[_0xc09c('0x25')]=function(_0xfe62db,_0x5f5ba4){return db['AnalyticCustomReport'][_0xc09c('0x4a')]({'where':{'id':_0xfe62db[_0xc09c('0x47')]['id']}})[_0xc09c('0x24')](handleEntityNotFound(_0x5f5ba4,null))[_0xc09c('0x24')](removeEntity(_0x5f5ba4,null))[_0xc09c('0x45')](handleError(_0x5f5ba4,null));};exports[_0xc09c('0x55')]=function(_0x514626,_0x3e878){var _0x321d5b=0xa;var _0x511d9a=['join',_0xc09c('0x56'),_0xc09c('0x57'),'cross_join'];var _0x5afee6={'SUM':_0xc09c('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc09c('0x59'),'MAX':_0xc09c('0x5a'),'MIN':_0xc09c('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc09c('0x5c'),'GROUP_CONCAT ASC':_0xc09c('0x5d'),'GROUP_CONCAT DESC':_0xc09c('0x5e')};var _0x36693a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xc09c('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x556960=function(_0x5514ec){return!_['includes']([_0xc09c('0x60'),_0xc09c('0x61'),_0xc09c('0x62'),_0xc09c('0x63')],_0x5514ec);};var _0x22202c=function(_0x1f93e6){if(!_0x1f93e6||!_0x1f93e6['rules'][_0xc09c('0x34')]){return'';}for(var _0x513bc9='(',_0x49d055=0x0;_0x49d055<_0x1f93e6[_0xc09c('0x64')][_0xc09c('0x34')];_0x49d055+=0x1){_0x49d055>0x0&&(_0x513bc9+='\x20'+_0x1f93e6[_0xc09c('0x65')]+'\x20');_0x513bc9+=_0x1f93e6['rules'][_0x49d055]['group']?_0x22202c(_0x1f93e6[_0xc09c('0x64')][_0x49d055]['group']):_0x1f93e6[_0xc09c('0x64')][_0x49d055][_0xc09c('0x40')]+'\x20'+_0x1f93e6[_0xc09c('0x64')][_0x49d055][_0xc09c('0x66')]+(_0x556960(_0x1f93e6[_0xc09c('0x64')][_0x49d055][_0xc09c('0x66')])?'\x20'+_0x1f93e6[_0xc09c('0x64')][_0x49d055][_0xc09c('0x67')]:'');}return _0x513bc9+')';};var _0x5b2aff={'where':{'id':_0x514626[_0xc09c('0x47')]['id']}},_0x48aac4,_0x29880e,_0x1d472b,_0x41f60c,_0x4f5e2b;_0x5b2aff=_[_0xc09c('0x3c')]({},_0x5b2aff,_0x514626[_0xc09c('0x41')]);return db[_0xc09c('0x43')]['find'](_0x5b2aff)['then'](function(_0x2600c0){if(_0x2600c0){_0x48aac4=_0x2600c0;return _0x2600c0[_0xc09c('0x68')]();}return null;})[_0xc09c('0x24')](function(_0x537689){if(_0x537689){if(!_0x537689[_0xc09c('0x34')]){throw new db[(_0xc09c('0x69'))]['ValidationErrorItem'](_0xc09c('0x6a'),0x193);}_0x29880e=_0x537689;return db[_0xc09c('0x6b')][_0xc09c('0x44')]({'raw':!![]});}return null;})[_0xc09c('0x24')](function(_0x49491e){if(_0x49491e){_0x1d472b=_['keyBy'](_0x49491e,'id');var _0x534637;var _0x183b78=squel['select']();_0x183b78[_0xc09c('0x6c')](_0x48aac4[_0xc09c('0x6d')]);for(var _0x401f1c=0x0;_0x401f1c<_0x29880e[_0xc09c('0x34')];_0x401f1c+=0x1){_0x534637=_0x29880e[_0x401f1c]['MetricId']?_0x1d472b[_0x29880e[_0x401f1c][_0xc09c('0x6e')]][_0xc09c('0x6f')]:_0x29880e[_0x401f1c][_0xc09c('0x40')];_0x534637=_0x29880e[_0x401f1c][_0xc09c('0x70')]?_[_0xc09c('0x71')](_0x5afee6[_0x29880e[_0x401f1c]['function']],'%s',_0x534637):_0x534637;_0x534637=_0x29880e[_0x401f1c][_0xc09c('0x72')]?_['replace'](_0x36693a[_0x29880e[_0x401f1c][_0xc09c('0x72')]],'%s',_0x534637):_0x534637;if(_0x29880e[_0x401f1c][_0xc09c('0x73')]){_0x183b78[_0xc09c('0x74')](_0x534637);}_0x29880e[_0x401f1c]['orderBy']&&_0x183b78['order'](_0x534637,_0x29880e[_0x401f1c][_0xc09c('0x75')]===_0xc09c('0x76')?![]:!![]);_0x183b78[_0xc09c('0x40')](_0x534637,_0x29880e[_0x401f1c][_0xc09c('0x77')]||_0x534637);}if(_0x48aac4['joins']){_0x48aac4[_0xc09c('0x78')]=JSON[_0xc09c('0x79')](_0x48aac4[_0xc09c('0x78')]);for(var _0x21800b=0x0;_0x21800b<_0x48aac4['joins'][_0xc09c('0x34')];_0x21800b+=0x1){if(_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x3e')]&&_[_0xc09c('0x7a')](_0x511d9a,_0x48aac4[_0xc09c('0x78')][_0x21800b]['type'])&&_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x7b')]&&_0x48aac4['joins'][_0x21800b][_0xc09c('0x7c')]&&_0x48aac4[_0xc09c('0x78')][_0x21800b]['foreignKey']){_0x183b78[_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x3e')]](_0x48aac4['joins'][_0x21800b][_0xc09c('0x7c')],null,util[_0xc09c('0x72')]('%s.%s\x20=\x20%s.%s',_0x48aac4[_0xc09c('0x6d')],_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x7b')],_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x7c')],_0x48aac4[_0xc09c('0x78')][_0x21800b][_0xc09c('0x7d')]));}}}if(_0x48aac4['conditions']){_0x48aac4[_0xc09c('0x7e')]=JSON['parse'](_0x48aac4['conditions']);_0x183b78['where'](_0x22202c(_0x48aac4[_0xc09c('0x7e')][_0xc09c('0x74')]));}_0x4f5e2b=_0x183b78['clone']();_0x183b78[_0xc09c('0x37')](_0x321d5b);_0x183b78[_0xc09c('0x1f')](0x0);logger['debug'](_0xc09c('0x7f'),_0x183b78[_0xc09c('0x80')]());return db[_0xc09c('0x81')]['query'](_0x183b78[_0xc09c('0x80')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xc09c('0x24')](respondWithResult(_0x3e878,null))[_0xc09c('0x45')](handleError(_0x3e878,null));};function runReport(_0x4e0550,_0x4786a5,_0x23711e){var _0x5979ed=_0x4786a5[_0xc09c('0x2a')];var _0x1bfaf3=0xa;var _0x21ea4d=['join',_0xc09c('0x56'),'right_join',_0xc09c('0x82')];var _0x18a992={'SUM':_0xc09c('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc09c('0x59'),'MAX':'MAX(%s)','MIN':_0xc09c('0x5b'),'AVG':_0xc09c('0x83'),'GROUP_CONCAT':_0xc09c('0x5c'),'GROUP_CONCAT ASC':_0xc09c('0x5d'),'GROUP_CONCAT DESC':_0xc09c('0x5e')};var _0x3851bf={'SEC_TO_TIME':_0xc09c('0x84'),'DATE':_0xc09c('0x85'),'HOUR':_0xc09c('0x86'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc09c('0x87')};var _0x4f1d95=function(_0x3deb79){return!_[_0xc09c('0x7a')](['IS\x20NULL',_0xc09c('0x61'),_0xc09c('0x62'),_0xc09c('0x63')],_0x3deb79);};var _0x5181e8=function(_0x175828){if(!_0x175828||!_0x175828['rules'][_0xc09c('0x34')]){return'';}for(var _0x406e41='(',_0x3dc4f2=0x0;_0x3dc4f2<_0x175828[_0xc09c('0x64')][_0xc09c('0x34')];_0x3dc4f2+=0x1){_0x3dc4f2>0x0&&(_0x406e41+='\x20'+_0x175828['operator']+'\x20');_0x406e41+=_0x175828['rules'][_0x3dc4f2][_0xc09c('0x74')]?_0x5181e8(_0x175828[_0xc09c('0x64')][_0x3dc4f2]['group']):_0x175828['rules'][_0x3dc4f2][_0xc09c('0x40')]+'\x20'+_0x175828[_0xc09c('0x64')][_0x3dc4f2]['condition']+(_0x4f1d95(_0x175828['rules'][_0x3dc4f2][_0xc09c('0x66')])?'\x20'+_0x175828[_0xc09c('0x64')][_0x3dc4f2][_0xc09c('0x67')]:'');}return _0x406e41+')';};var _0x568da9={'where':{'id':_0x4e0550['id']}},_0x409fb9,_0x85ba5c,_0x4260b2,_0x136da1,_0x54546e;_0x568da9=_[_0xc09c('0x3c')]({},_0x568da9,_0x23711e);return db[_0xc09c('0x43')][_0xc09c('0x4a')](_0x568da9)[_0xc09c('0x24')](function(_0x13a406){if(_0x13a406){_0x409fb9=_0x13a406;return _0x13a406[_0xc09c('0x68')]();}return null;})[_0xc09c('0x24')](function(_0x2c6f7b){if(_0x2c6f7b){if(!_0x2c6f7b['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xc09c('0x6a'),0x193);}_0x85ba5c=_0x2c6f7b;return db['AnalyticMetric'][_0xc09c('0x44')]({'raw':!![]});}return null;})[_0xc09c('0x24')](function(_0x4c72bd){if(_0x4c72bd){_0x4260b2=_[_0xc09c('0x88')](_0x4c72bd,'id');var _0x5ec21f;var _0x15f8bc=squel['select']();_0x15f8bc[_0xc09c('0x6c')](_0x409fb9['table']);for(var _0x4f3a27=0x0;_0x4f3a27<_0x85ba5c[_0xc09c('0x34')];_0x4f3a27+=0x1){_0x5ec21f=_0x85ba5c[_0x4f3a27]['MetricId']?_0x4260b2[_0x85ba5c[_0x4f3a27]['MetricId']]['metric']:_0x85ba5c[_0x4f3a27]['field'];_0x5ec21f=_0x85ba5c[_0x4f3a27][_0xc09c('0x70')]?_[_0xc09c('0x71')](_0x18a992[_0x85ba5c[_0x4f3a27]['function']],'%s',_0x5ec21f):_0x5ec21f;_0x5ec21f=_0x85ba5c[_0x4f3a27][_0xc09c('0x72')]?_['replace'](_0x3851bf[_0x85ba5c[_0x4f3a27][_0xc09c('0x72')]],'%s',_0x5ec21f):_0x5ec21f;if(_0x85ba5c[_0x4f3a27][_0xc09c('0x73')]){_0x15f8bc[_0xc09c('0x74')](_0x5ec21f);}_0x85ba5c[_0x4f3a27][_0xc09c('0x75')]&&_0x15f8bc['order'](_0x5ec21f,_0x85ba5c[_0x4f3a27][_0xc09c('0x75')]===_0xc09c('0x76')?![]:!![]);_0x15f8bc[_0xc09c('0x40')](_0x5ec21f,_0x85ba5c[_0x4f3a27][_0xc09c('0x77')]||_0x5ec21f);}if(_0x409fb9[_0xc09c('0x78')]){_0x409fb9[_0xc09c('0x78')]=JSON['parse'](_0x409fb9[_0xc09c('0x78')]);for(var _0x29fbf3=0x0;_0x29fbf3<_0x409fb9[_0xc09c('0x78')]['length'];_0x29fbf3+=0x1){if(_0x409fb9[_0xc09c('0x78')][_0x29fbf3]['type']&&_['includes'](_0x21ea4d,_0x409fb9['joins'][_0x29fbf3][_0xc09c('0x3e')])&&_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x7b')]&&_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x7c')]&&_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x7d')]){_0x15f8bc[_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x3e')]](_0x409fb9[_0xc09c('0x78')][_0x29fbf3]['foreignTable'],null,util['format'](_0xc09c('0x89'),_0x409fb9[_0xc09c('0x6d')],_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x7b')],_0x409fb9[_0xc09c('0x78')][_0x29fbf3][_0xc09c('0x7c')],_0x409fb9[_0xc09c('0x78')][_0x29fbf3]['foreignKey']));}}}if(_0x409fb9[_0xc09c('0x7e')]){_0x409fb9['conditions']=JSON[_0xc09c('0x79')](_0x409fb9[_0xc09c('0x7e')]);_0x15f8bc['where'](_0x5181e8(_0x409fb9['conditions'][_0xc09c('0x74')]));}_0x54546e=_0x15f8bc[_0xc09c('0x8a')]();_0x15f8bc['limit'](_0x1bfaf3);_0x15f8bc[_0xc09c('0x1f')](0x0);logger[_0xc09c('0x8b')](_0xc09c('0x7f'),_0x15f8bc['toString']());return db[_0xc09c('0x81')][_0xc09c('0x2f')](_0x15f8bc[_0xc09c('0x80')](),{'type':db['sequelize'][_0xc09c('0x8c')][_0xc09c('0x8d')]});}})[_0xc09c('0x24')](function(_0xaa53e7){if(!_0xaa53e7[_0xc09c('0x34')]){throw new db[(_0xc09c('0x69'))][(_0xc09c('0x8e'))](_0xc09c('0x8f'),0xcc);}if(_0x4786a5['output']==='web'){return null;}var _0x41caaf=_[_0xc09c('0x3c')](_0x4786a5,{'name':_0x4786a5[_0xc09c('0x90')]||_0x4786a5[_0xc09c('0x2a')]||_0x409fb9[_0xc09c('0x2a')],'basename':_0x5979ed,'savename':util['format']('%s-%s.%s',_0x4786a5['name']||_0x409fb9[_0xc09c('0x2a')],require(_0xc09c('0x91'))[_0xc09c('0x92')](0x4),_0x4786a5[_0xc09c('0x93')]||_0xc09c('0x94')),'reportId':_0x409fb9['id'],'reportType':_0xc09c('0x95')});return db[_0xc09c('0x96')][_0xc09c('0x4b')](_0x41caaf,{'raw':!![]});})[_0xc09c('0x24')](function(_0x4618df){if(_0x409fb9[_0xc09c('0x6d')]===_0xc09c('0x97')){_0x54546e['where'](_0x409fb9[_0xc09c('0x6d')]+_0xc09c('0x98'),_0x4786a5[_0xc09c('0x99')],_0x4786a5[_0xc09c('0x9a')]);}else{_0x54546e['where'](_0x409fb9[_0xc09c('0x6d')]+_0xc09c('0x9b'),_0x4786a5[_0xc09c('0x99')],_0x4786a5[_0xc09c('0x9a')]);}if(_0x4618df){logger[_0xc09c('0x9c')](_0xc09c('0x9d'),_0x54546e[_0xc09c('0x80')]());require(_0xc09c('0x9e'))['fork'](path[_0xc09c('0x9f')](__dirname,_0xc09c('0xa0'),_0x4618df['output']),[_0x4618df['id'],_0x54546e[_0xc09c('0x80')](),path[_0xc09c('0x9f')](__dirname,_0xc09c('0xa1'),_0x4618df[_0xc09c('0xa2')]),_0x5979ed]);return _0x4618df;}else{var _0x9f81a9=squel[_0xc09c('0xa3')]();_0x9f81a9['from']('('+_0x54546e['toString']()+')',_0xc09c('0xa4'));_0x9f81a9[_0xc09c('0x40')](_0xc09c('0xa5'),_0xc09c('0x1e'));_0x54546e[_0xc09c('0x37')](_0x4786a5[_0xc09c('0x37')]||_0x1bfaf3);_0x54546e[_0xc09c('0x1f')](_0x4786a5[_0xc09c('0x1f')]||0x0);return db['sequelize'][_0xc09c('0x2f')](_0x9f81a9[_0xc09c('0x80')](),{'type':db[_0xc09c('0x81')]['QueryTypes'][_0xc09c('0x8d')]})[_0xc09c('0x24')](function(_0x2123f0){if(!_0x2123f0['length']){_0x136da1=0x0;}else{_0x136da1=_0x2123f0[0x0][_0xc09c('0x1e')]||0x0;}return db[_0xc09c('0x81')]['query'](_0x54546e[_0xc09c('0x80')](),{'type':db[_0xc09c('0x81')][_0xc09c('0x8c')][_0xc09c('0x8d')]});})[_0xc09c('0x24')](function(_0x4e0a86){return{'rows':_0x4e0a86||[],'count':_0x136da1};});}});}exports[_0xc09c('0xa6')]=function(_0x5c3625,_0x222bca){return runReport(_0x5c3625['params'],_0x5c3625['query'],_0x5c3625[_0xc09c('0x41')])[_0xc09c('0x24')](respondWithResult(_0x222bca,null))[_0xc09c('0x45')](handleError(_0x222bca,null));};exports[_0xc09c('0xa7')]=runReport;exports[_0xc09c('0x2f')]=function(_0x3f586b,_0x3db7c6){var _0x115e44=0xa;var _0x5e432c=[_0xc09c('0x9f'),_0xc09c('0x56'),_0xc09c('0x57'),_0xc09c('0x82')];var _0x51f45a={'SUM':'SUM(%s)','COUNT':_0xc09c('0xa8'),'COUNT DISTINCT':_0xc09c('0x59'),'MAX':_0xc09c('0x5a'),'MIN':_0xc09c('0x5b'),'AVG':_0xc09c('0x83'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc09c('0x5e')};var _0x36c48a={'SEC_TO_TIME':_0xc09c('0x84'),'DATE':_0xc09c('0x85'),'HOUR':'HOUR(%s)','ROUND':_0xc09c('0x5f'),'UNIX_TIMESTAMP':_0xc09c('0x87')};var _0x277e6d=function(_0x1548ca){return!_[_0xc09c('0x7a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc09c('0x62'),'IS\x20NOT\x20EMPTY'],_0x1548ca);};var _0x51d346=function(_0x53275e){if(!_0x53275e||!_0x53275e[_0xc09c('0x64')][_0xc09c('0x34')]){return'';}for(var _0x436132='(',_0x2700f6=0x0;_0x2700f6<_0x53275e[_0xc09c('0x64')][_0xc09c('0x34')];_0x2700f6+=0x1){_0x2700f6>0x0&&(_0x436132+='\x20'+_0x53275e[_0xc09c('0x65')]+'\x20');_0x436132+=_0x53275e[_0xc09c('0x64')][_0x2700f6]['group']?_0x51d346(_0x53275e[_0xc09c('0x64')][_0x2700f6]['group']):_0x53275e[_0xc09c('0x64')][_0x2700f6]['field']+'\x20'+_0x53275e[_0xc09c('0x64')][_0x2700f6][_0xc09c('0x66')]+(_0x277e6d(_0x53275e[_0xc09c('0x64')][_0x2700f6][_0xc09c('0x66')])?'\x20'+_0x53275e[_0xc09c('0x64')][_0x2700f6][_0xc09c('0x67')]:'');}return _0x436132+')';};var _0x3ea8bb={'where':{'id':_0x3f586b[_0xc09c('0x47')]['id']}},_0x3fe957,_0x4ecd36,_0x21a1e0,_0x237b7d,_0x2dbb03;_0x3ea8bb=_[_0xc09c('0x3c')]({},_0x3ea8bb,_0x3f586b[_0xc09c('0x41')]);return db[_0xc09c('0x43')][_0xc09c('0x4a')](_0x3ea8bb)['then'](function(_0x5695e4){if(_0x5695e4){_0x3fe957=_0x5695e4;return _0x5695e4[_0xc09c('0x68')]();}return null;})[_0xc09c('0x24')](function(_0x40a756){if(_0x40a756){if(!_0x40a756[_0xc09c('0x34')]){throw new db[(_0xc09c('0x69'))][(_0xc09c('0x8e'))](_0xc09c('0x6a'),0x193);}_0x4ecd36=_0x40a756;return db[_0xc09c('0x6b')][_0xc09c('0x44')]({'raw':!![]});}return null;})[_0xc09c('0x24')](function(_0x369dd6){if(_0x369dd6){_0x21a1e0=_['keyBy'](_0x369dd6,'id');var _0x409118;var _0x279cbb=squel[_0xc09c('0xa3')]();_0x279cbb['from'](_0x3fe957['table']);for(var _0x393684=0x0;_0x393684<_0x4ecd36[_0xc09c('0x34')];_0x393684+=0x1){_0x409118=_0x4ecd36[_0x393684][_0xc09c('0x6e')]?_0x21a1e0[_0x4ecd36[_0x393684]['MetricId']]['metric']:_0x4ecd36[_0x393684][_0xc09c('0x40')];_0x409118=_0x4ecd36[_0x393684][_0xc09c('0x70')]?_['replace'](_0x51f45a[_0x4ecd36[_0x393684][_0xc09c('0x70')]],'%s',_0x409118):_0x409118;_0x409118=_0x4ecd36[_0x393684][_0xc09c('0x72')]?_[_0xc09c('0x71')](_0x36c48a[_0x4ecd36[_0x393684][_0xc09c('0x72')]],'%s',_0x409118):_0x409118;if(_0x4ecd36[_0x393684][_0xc09c('0x73')]){_0x279cbb[_0xc09c('0x74')](_0x409118);}_0x4ecd36[_0x393684][_0xc09c('0x75')]&&_0x279cbb['order'](_0x409118,_0x4ecd36[_0x393684][_0xc09c('0x75')]===_0xc09c('0x76')?![]:!![]);_0x279cbb[_0xc09c('0x40')](_0x409118,_0x4ecd36[_0x393684][_0xc09c('0x77')]||_0x409118);}if(_0x3fe957[_0xc09c('0x78')]){_0x3fe957[_0xc09c('0x78')]=JSON[_0xc09c('0x79')](_0x3fe957['joins']);for(var _0x5e673e=0x0;_0x5e673e<_0x3fe957[_0xc09c('0x78')]['length'];_0x5e673e+=0x1){if(_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x3e')]&&_[_0xc09c('0x7a')](_0x5e432c,_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x3e')])&&_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7b')]&&_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7c')]&&_0x3fe957[_0xc09c('0x78')][_0x5e673e]['foreignKey']){_0x279cbb[_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x3e')]](_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7c')],null,util[_0xc09c('0x72')](_0xc09c('0x89'),_0x3fe957[_0xc09c('0x6d')],_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7b')],_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7c')],_0x3fe957[_0xc09c('0x78')][_0x5e673e][_0xc09c('0x7d')]));}}}if(_0x3fe957[_0xc09c('0x7e')]){_0x3fe957[_0xc09c('0x7e')]=JSON[_0xc09c('0x79')](_0x3fe957[_0xc09c('0x7e')]);_0x279cbb[_0xc09c('0x39')](_0x51d346(_0x3fe957[_0xc09c('0x7e')][_0xc09c('0x74')]));}_0x2dbb03=_0x279cbb[_0xc09c('0x8a')]();_0x279cbb[_0xc09c('0x37')](_0x115e44);_0x279cbb[_0xc09c('0x1f')](0x0);logger[_0xc09c('0x8b')]('Limited\x20Query:',_0x279cbb[_0xc09c('0x80')]());return db[_0xc09c('0x81')][_0xc09c('0x2f')](_0x279cbb[_0xc09c('0x80')](),{'type':db['sequelize'][_0xc09c('0x8c')][_0xc09c('0x8d')]});}})[_0xc09c('0x24')](function(){return{'sql':_0x2dbb03[_0xc09c('0x80')]()};})[_0xc09c('0x24')](respondWithResult(_0x3db7c6,null))['catch'](handleError(_0x3db7c6,null));}; \ No newline at end of file +var _0x9657=['length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','params','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','preview','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','Sequelize','metric','DESC','clone','sequelize','No\x20available\x20data','output','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../files/reports','savename','countTable','COUNT(*)','AnalyticMetric','findAll','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x511aa6,_0xae9c67){var _0x559a9d=function(_0x3c2ce5){while(--_0x3c2ce5){_0x511aa6['push'](_0x511aa6['shift']());}};_0x559a9d(++_0xae9c67);}(_0x9657,0x110));var _0x7965=function(_0x10ea35,_0x37735b){_0x10ea35=_0x10ea35-0x0;var _0x26b197=_0x9657[_0x10ea35];return _0x26b197;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7965('0x0'));var rimraf=require(_0x7965('0x1'));var zipdir=require(_0x7965('0x2'));var jsonpatch=require(_0x7965('0x3'));var rp=require('request-promise');var moment=require(_0x7965('0x4'));var BPromise=require(_0x7965('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7965('0x6'));var csv=require(_0x7965('0x7'));var ejs=require(_0x7965('0x8'));var fs=require('fs');var _=require(_0x7965('0x9'));var squel=require(_0x7965('0xa'));var crypto=require(_0x7965('0xb'));var jsforce=require(_0x7965('0xc'));var deskjs=require(_0x7965('0xd'));var toCsv=require(_0x7965('0x7'));var querystring=require(_0x7965('0xe'));var Papa=require(_0x7965('0xf'));var Redis=require(_0x7965('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7965('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7965('0x12'))(_0x7965('0x13'));var utils=require(_0x7965('0x14'));var config=require(_0x7965('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a550c,_0x30122e){_0x30122e=_0x30122e||0xcc;return function(_0x48fa){if(_0x48fa){return _0x3a550c['sendStatus'](_0x30122e);}return _0x3a550c[_0x7965('0x16')](_0x30122e)[_0x7965('0x17')]();};}function respondWithResult(_0xa91f3d,_0x5d72ee){_0x5d72ee=_0x5d72ee||0xc8;return function(_0x28d0b9){if(_0x28d0b9){return _0xa91f3d['status'](_0x5d72ee)[_0x7965('0x18')](_0x28d0b9);}};}function respondWithFilteredResult(_0x413b2e,_0x2da4fc){return function(_0x1c0057){if(_0x1c0057){var _0x27edbc=_0x1c0057['count'],_0x2339c7=_0x2da4fc[_0x7965('0x19')],_0x2cafe8=_0x2da4fc[_0x7965('0x19')]+_0x2da4fc[_0x7965('0x1a')],_0x17cf8d;if(_0x2cafe8>=_0x27edbc){_0x2cafe8=_0x27edbc;_0x17cf8d=0xc8;}else{_0x17cf8d=0xce;}_0x413b2e['status'](_0x17cf8d);return _0x413b2e['set'](_0x7965('0x1b'),_0x2339c7+'-'+_0x2cafe8+'/'+_0x27edbc)['json'](_0x1c0057);}return null;};}function patchUpdates(_0xa5c0a0){return function(_0x188d37){try{jsonpatch[_0x7965('0x1c')](_0x188d37,_0xa5c0a0,!![]);}catch(_0x5d900c){return BPromise[_0x7965('0x1d')](_0x5d900c);}return _0x188d37[_0x7965('0x1e')]();};}function saveUpdates(_0xa0c014,_0x39c739){return function(_0x5a7f3f){if(_0x5a7f3f){return _0x5a7f3f[_0x7965('0x1f')](_0xa0c014)[_0x7965('0x20')](function(_0x25c4ed){return _0x25c4ed;});}return null;};}function removeEntity(_0x4e8010,_0x6ec616){return function(_0x17e708){if(_0x17e708){return _0x17e708[_0x7965('0x21')]()['then'](function(){var _0xc7016d=_0x17e708[_0x7965('0x22')]({'plain':!![]});var _0x1c2124=_0x7965('0x23');return db['UserProfileResource'][_0x7965('0x21')]({'where':{'type':_0x1c2124,'resourceId':_0xc7016d['id']}})['then'](function(){return _0x17e708;});})[_0x7965('0x20')](function(){_0x4e8010[_0x7965('0x16')](0xcc)[_0x7965('0x17')]();});}};}function handleEntityNotFound(_0x517c45,_0x3d4e41){return function(_0x36d169){if(!_0x36d169){_0x517c45['sendStatus'](0x194);}return _0x36d169;};}function handleError(_0x372c8f,_0x1424b9){_0x1424b9=_0x1424b9||0x1f4;return function(_0x31c013){logger[_0x7965('0x24')](_0x31c013[_0x7965('0x25')]);if(_0x31c013[_0x7965('0x26')]){delete _0x31c013[_0x7965('0x26')];}_0x372c8f[_0x7965('0x16')](_0x1424b9)[_0x7965('0x27')](_0x31c013);};}exports[_0x7965('0x28')]=function(_0xe0aecd,_0xf7c17d){var _0xb58b9c={},_0x129c18={},_0x10b95e={'count':0x0,'rows':[]};var _0x45486f=db[_0x7965('0x29')][_0x7965('0x2a')];_0x129c18[_0x7965('0x2b')]=_[_0x7965('0x2c')](_0x45486f);_0x129c18[_0x7965('0x2d')]=_[_0x7965('0x2c')](_0xe0aecd[_0x7965('0x2d')]);_0x129c18[_0x7965('0x2e')]=_[_0x7965('0x2f')](_0x129c18[_0x7965('0x2b')],_0x129c18[_0x7965('0x2d')]);_0xb58b9c[_0x7965('0x30')]=_[_0x7965('0x2f')](_0x129c18[_0x7965('0x2b')],qs[_0x7965('0x31')](_0xe0aecd['query'][_0x7965('0x31')]));_0xb58b9c[_0x7965('0x30')]=_0xb58b9c['attributes'][_0x7965('0x32')]?_0xb58b9c[_0x7965('0x30')]:_0x129c18['model'];if(!_0xe0aecd[_0x7965('0x2d')][_0x7965('0x33')](_0x7965('0x34'))){_0xb58b9c['limit']=qs[_0x7965('0x1a')](_0xe0aecd[_0x7965('0x2d')][_0x7965('0x1a')]);_0xb58b9c[_0x7965('0x19')]=qs['offset'](_0xe0aecd[_0x7965('0x2d')][_0x7965('0x19')]);}_0xb58b9c['order']=qs[_0x7965('0x35')](_0xe0aecd['query']['sort']);_0xb58b9c['where']=qs[_0x7965('0x2e')](_[_0x7965('0x36')](_0xe0aecd[_0x7965('0x2d')],_0x129c18[_0x7965('0x2e')]));if(_0xe0aecd[_0x7965('0x2d')][_0x7965('0x37')]){_0xb58b9c[_0x7965('0x38')]=_[_0x7965('0x39')](_0xb58b9c[_0x7965('0x38')],{'$or':_[_0x7965('0x3a')](_0x45486f,function(_0x3c790e){if(_0x3c790e[_0x7965('0x3b')][_0x7965('0x3c')]!==_0x7965('0x3d')){var _0x16da18={};_0x16da18[_0x3c790e[_0x7965('0x3e')]]={'$like':'%'+_0xe0aecd[_0x7965('0x2d')]['filter']+'%'};return _0x16da18;}})});}_0xb58b9c=_['merge']({},_0xb58b9c,_0xe0aecd[_0x7965('0x3f')]);var _0x468479={'where':_0xb58b9c[_0x7965('0x38')]};return db['AnalyticCustomReport'][_0x7965('0x40')](_0x468479)[_0x7965('0x20')](function(_0x33624b){_0x10b95e[_0x7965('0x40')]=_0x33624b;if(_0xe0aecd[_0x7965('0x2d')][_0x7965('0x41')]){_0xb58b9c[_0x7965('0x42')]=[{'all':!![]}];}return db[_0x7965('0x29')]['findAll'](_0xb58b9c);})[_0x7965('0x20')](function(_0x3f182c){_0x10b95e[_0x7965('0x43')]=_0x3f182c;return _0x10b95e;})['then'](respondWithFilteredResult(_0xf7c17d,_0xb58b9c))['catch'](handleError(_0xf7c17d,null));};exports[_0x7965('0x44')]=function(_0x1436bf,_0x1da303){var _0x3e6c9b={'raw':![],'where':{'id':_0x1436bf[_0x7965('0x45')]['id']}},_0x448c65={};_0x448c65[_0x7965('0x2b')]=_[_0x7965('0x2c')](db['AnalyticCustomReport']['rawAttributes']);_0x448c65[_0x7965('0x2d')]=_[_0x7965('0x2c')](_0x1436bf[_0x7965('0x2d')]);_0x448c65['filters']=_[_0x7965('0x2f')](_0x448c65[_0x7965('0x2b')],_0x448c65[_0x7965('0x2d')]);_0x3e6c9b[_0x7965('0x30')]=_[_0x7965('0x2f')](_0x448c65[_0x7965('0x2b')],qs[_0x7965('0x31')](_0x1436bf[_0x7965('0x2d')]['fields']));_0x3e6c9b[_0x7965('0x30')]=_0x3e6c9b[_0x7965('0x30')][_0x7965('0x32')]?_0x3e6c9b['attributes']:_0x448c65[_0x7965('0x2b')];if(_0x1436bf['query'][_0x7965('0x41')]){_0x3e6c9b[_0x7965('0x42')]=[{'all':!![]}];}_0x3e6c9b=_['merge']({},_0x3e6c9b,_0x1436bf[_0x7965('0x3f')]);return db['AnalyticCustomReport'][_0x7965('0x46')](_0x3e6c9b)[_0x7965('0x20')](handleEntityNotFound(_0x1da303,null))[_0x7965('0x20')](respondWithResult(_0x1da303,null))[_0x7965('0x47')](handleError(_0x1da303,null));};exports[_0x7965('0x48')]=function(_0x5ca6a2,_0x2891c6){return db[_0x7965('0x29')][_0x7965('0x48')](_0x5ca6a2[_0x7965('0x49')],{})[_0x7965('0x20')](function(_0x5c4e79){var _0x4ad867=_0x5ca6a2[_0x7965('0x4a')]['get']({'plain':!![]});if(!_0x4ad867)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ad867[_0x7965('0x4b')]===_0x7965('0x4a')){var _0x58a539=_0x5c4e79[_0x7965('0x22')]({'plain':!![]});var _0x48f2ec=_0x7965('0x4c');return db[_0x7965('0x4d')]['find']({'where':{'name':_0x48f2ec,'userProfileId':_0x4ad867[_0x7965('0x4e')]},'raw':!![]})['then'](function(_0x1fffb1){if(_0x1fffb1&&_0x1fffb1[_0x7965('0x4f')]===0x0){return db[_0x7965('0x50')][_0x7965('0x48')]({'name':_0x58a539[_0x7965('0x26')],'resourceId':_0x58a539['id'],'type':_0x7965('0x23'),'sectionId':_0x1fffb1['id']},{})[_0x7965('0x20')](function(){return _0x5c4e79;});}else{return _0x5c4e79;}})['catch'](function(_0x36b6){logger[_0x7965('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b6);throw _0x36b6;});}return _0x5c4e79;})[_0x7965('0x20')](respondWithResult(_0x2891c6,0xc9))[_0x7965('0x47')](handleError(_0x2891c6,null));};exports[_0x7965('0x1f')]=function(_0x5cf3ab,_0xe8de9c){if(_0x5cf3ab[_0x7965('0x49')]['id']){delete _0x5cf3ab['body']['id'];}return db[_0x7965('0x29')][_0x7965('0x46')]({'where':{'id':_0x5cf3ab['params']['id']}})['then'](handleEntityNotFound(_0xe8de9c,null))[_0x7965('0x20')](saveUpdates(_0x5cf3ab[_0x7965('0x49')],null))[_0x7965('0x20')](respondWithResult(_0xe8de9c,null))[_0x7965('0x47')](handleError(_0xe8de9c,null));};exports[_0x7965('0x21')]=function(_0x3691ef,_0x24a4e8){return db[_0x7965('0x29')][_0x7965('0x46')]({'where':{'id':_0x3691ef[_0x7965('0x45')]['id']}})[_0x7965('0x20')](handleEntityNotFound(_0x24a4e8,null))[_0x7965('0x20')](removeEntity(_0x24a4e8,null))['catch'](handleError(_0x24a4e8,null));};exports[_0x7965('0x51')]=function(_0x1e3e31,_0x5c2bc0){var _0x5091dc=0xa;var _0x5eb716=['join',_0x7965('0x52'),_0x7965('0x53'),_0x7965('0x54')];var _0x372d45={'SUM':_0x7965('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7965('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7965('0x57'),'GROUP_CONCAT ASC':_0x7965('0x58'),'GROUP_CONCAT DESC':_0x7965('0x59')};var _0x58863d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7965('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7965('0x5b')};var _0x173ed7=function(_0xbe63e8){return!_[_0x7965('0x5c')]([_0x7965('0x5d'),'IS\x20NOT\x20NULL',_0x7965('0x5e'),_0x7965('0x5f')],_0xbe63e8);};var _0x18fa2c=function(_0x52b535){if(!_0x52b535||!_0x52b535[_0x7965('0x60')]['length']){return'';}for(var _0x5c04d9='(',_0x376b07=0x0;_0x376b07<_0x52b535[_0x7965('0x60')][_0x7965('0x32')];_0x376b07+=0x1){_0x376b07>0x0&&(_0x5c04d9+='\x20'+_0x52b535[_0x7965('0x61')]+'\x20');_0x5c04d9+=_0x52b535['rules'][_0x376b07][_0x7965('0x62')]?_0x18fa2c(_0x52b535['rules'][_0x376b07]['group']):_0x52b535[_0x7965('0x60')][_0x376b07]['field']+'\x20'+_0x52b535[_0x7965('0x60')][_0x376b07][_0x7965('0x63')]+(_0x173ed7(_0x52b535[_0x7965('0x60')][_0x376b07]['condition'])?'\x20'+_0x52b535['rules'][_0x376b07][_0x7965('0x64')]:'');}return _0x5c04d9+')';};var _0x521f18={'where':{'id':_0x1e3e31[_0x7965('0x45')]['id']}},_0x36a0b2,_0x40b91b,_0xde6c32,_0x2e6247,_0x5294ee;_0x521f18=_[_0x7965('0x39')]({},_0x521f18,_0x1e3e31['options']);return db['AnalyticCustomReport'][_0x7965('0x46')](_0x521f18)[_0x7965('0x20')](function(_0x263f77){if(_0x263f77){_0x36a0b2=_0x263f77;return _0x263f77[_0x7965('0x65')]();}return null;})['then'](function(_0x436fc1){if(_0x436fc1){if(!_0x436fc1['length']){throw new db['Sequelize'][(_0x7965('0x66'))](_0x7965('0x67'),0x193);}_0x40b91b=_0x436fc1;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4c278a){if(_0x4c278a){_0xde6c32=_[_0x7965('0x68')](_0x4c278a,'id');var _0x142f6b;var _0x48f231=squel[_0x7965('0x69')]();_0x48f231[_0x7965('0x6a')](_0x36a0b2[_0x7965('0x6b')]);for(var _0x305a3b=0x0;_0x305a3b<_0x40b91b['length'];_0x305a3b+=0x1){_0x142f6b=_0x40b91b[_0x305a3b]['MetricId']?_0xde6c32[_0x40b91b[_0x305a3b][_0x7965('0x6c')]]['metric']:_0x40b91b[_0x305a3b][_0x7965('0x3e')];_0x142f6b=_0x40b91b[_0x305a3b][_0x7965('0x6d')]?_[_0x7965('0x6e')](_0x372d45[_0x40b91b[_0x305a3b][_0x7965('0x6d')]],'%s',_0x142f6b):_0x142f6b;_0x142f6b=_0x40b91b[_0x305a3b][_0x7965('0x6f')]?_[_0x7965('0x6e')](_0x58863d[_0x40b91b[_0x305a3b][_0x7965('0x6f')]],'%s',_0x142f6b):_0x142f6b;if(_0x40b91b[_0x305a3b][_0x7965('0x70')]){_0x48f231[_0x7965('0x62')](_0x142f6b);}_0x40b91b[_0x305a3b][_0x7965('0x71')]&&_0x48f231[_0x7965('0x72')](_0x142f6b,_0x40b91b[_0x305a3b][_0x7965('0x71')]==='DESC'?![]:!![]);_0x48f231[_0x7965('0x3e')](_0x142f6b,_0x40b91b[_0x305a3b][_0x7965('0x73')]||_0x142f6b);}if(_0x36a0b2['joins']){_0x36a0b2[_0x7965('0x74')]=JSON['parse'](_0x36a0b2['joins']);for(var _0x4408ee=0x0;_0x4408ee<_0x36a0b2[_0x7965('0x74')][_0x7965('0x32')];_0x4408ee+=0x1){if(_0x36a0b2[_0x7965('0x74')][_0x4408ee][_0x7965('0x3b')]&&_['includes'](_0x5eb716,_0x36a0b2[_0x7965('0x74')][_0x4408ee][_0x7965('0x3b')])&&_0x36a0b2[_0x7965('0x74')][_0x4408ee][_0x7965('0x75')]&&_0x36a0b2[_0x7965('0x74')][_0x4408ee][_0x7965('0x76')]&&_0x36a0b2['joins'][_0x4408ee][_0x7965('0x77')]){_0x48f231[_0x36a0b2[_0x7965('0x74')][_0x4408ee]['type']](_0x36a0b2[_0x7965('0x74')][_0x4408ee][_0x7965('0x76')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x36a0b2[_0x7965('0x6b')],_0x36a0b2['joins'][_0x4408ee][_0x7965('0x75')],_0x36a0b2['joins'][_0x4408ee][_0x7965('0x76')],_0x36a0b2[_0x7965('0x74')][_0x4408ee]['foreignKey']));}}}if(_0x36a0b2[_0x7965('0x78')]){_0x36a0b2[_0x7965('0x78')]=JSON[_0x7965('0x79')](_0x36a0b2[_0x7965('0x78')]);_0x48f231[_0x7965('0x38')](_0x18fa2c(_0x36a0b2[_0x7965('0x78')]['group']));}_0x5294ee=_0x48f231['clone']();_0x48f231[_0x7965('0x1a')](_0x5091dc);_0x48f231[_0x7965('0x19')](0x0);logger[_0x7965('0x7a')](_0x7965('0x7b'),_0x48f231['toString']());return db['sequelize']['query'](_0x48f231[_0x7965('0x7c')](),{'type':db['sequelize'][_0x7965('0x7d')][_0x7965('0x7e')]});}})['then'](respondWithResult(_0x5c2bc0,null))[_0x7965('0x47')](handleError(_0x5c2bc0,null));};function runReport(_0x5b9819,_0x390169,_0x428c9c){var _0x248c02=_0x390169[_0x7965('0x26')];var _0x56416b=0xa;var _0xf51304=[_0x7965('0x7f'),_0x7965('0x52'),_0x7965('0x53'),'cross_join'];var _0x3f5f66={'SUM':_0x7965('0x55'),'COUNT':_0x7965('0x80'),'COUNT DISTINCT':_0x7965('0x81'),'MAX':_0x7965('0x82'),'MIN':'MIN(%s)','AVG':_0x7965('0x83'),'GROUP_CONCAT':_0x7965('0x57'),'GROUP_CONCAT ASC':_0x7965('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d62ed={'SEC_TO_TIME':_0x7965('0x84'),'DATE':_0x7965('0x85'),'HOUR':_0x7965('0x5a'),'ROUND':_0x7965('0x86'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4a58ec=function(_0x5e2b30){return!_['includes']([_0x7965('0x5d'),_0x7965('0x87'),_0x7965('0x5e'),_0x7965('0x5f')],_0x5e2b30);};var _0x33044d=function(_0x48157f){if(!_0x48157f||!_0x48157f[_0x7965('0x60')][_0x7965('0x32')]){return'';}for(var _0x14e92c='(',_0xdc0014=0x0;_0xdc0014<_0x48157f[_0x7965('0x60')][_0x7965('0x32')];_0xdc0014+=0x1){_0xdc0014>0x0&&(_0x14e92c+='\x20'+_0x48157f['operator']+'\x20');_0x14e92c+=_0x48157f[_0x7965('0x60')][_0xdc0014][_0x7965('0x62')]?_0x33044d(_0x48157f[_0x7965('0x60')][_0xdc0014]['group']):_0x48157f[_0x7965('0x60')][_0xdc0014]['field']+'\x20'+_0x48157f[_0x7965('0x60')][_0xdc0014][_0x7965('0x63')]+(_0x4a58ec(_0x48157f[_0x7965('0x60')][_0xdc0014][_0x7965('0x63')])?'\x20'+_0x48157f[_0x7965('0x60')][_0xdc0014][_0x7965('0x64')]:'');}return _0x14e92c+')';};var _0x28d03d={'where':{'id':_0x5b9819['id']}},_0xd0a399,_0x1f33fb,_0x4a5d6f,_0x47a1f0,_0x4bd921;_0x28d03d=_[_0x7965('0x39')]({},_0x28d03d,_0x428c9c);return db[_0x7965('0x29')][_0x7965('0x46')](_0x28d03d)[_0x7965('0x20')](function(_0xefa5f){if(_0xefa5f){_0xd0a399=_0xefa5f;return _0xefa5f['getFields']();}return null;})[_0x7965('0x20')](function(_0x535435){if(_0x535435){if(!_0x535435[_0x7965('0x32')]){throw new db[(_0x7965('0x88'))][(_0x7965('0x66'))](_0x7965('0x67'),0x193);}_0x1f33fb=_0x535435;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7965('0x20')](function(_0x18f737){if(_0x18f737){_0x4a5d6f=_['keyBy'](_0x18f737,'id');var _0x16179d;var _0x56d027=squel[_0x7965('0x69')]();_0x56d027[_0x7965('0x6a')](_0xd0a399[_0x7965('0x6b')]);for(var _0x5f4989=0x0;_0x5f4989<_0x1f33fb['length'];_0x5f4989+=0x1){_0x16179d=_0x1f33fb[_0x5f4989][_0x7965('0x6c')]?_0x4a5d6f[_0x1f33fb[_0x5f4989][_0x7965('0x6c')]][_0x7965('0x89')]:_0x1f33fb[_0x5f4989][_0x7965('0x3e')];_0x16179d=_0x1f33fb[_0x5f4989][_0x7965('0x6d')]?_[_0x7965('0x6e')](_0x3f5f66[_0x1f33fb[_0x5f4989][_0x7965('0x6d')]],'%s',_0x16179d):_0x16179d;_0x16179d=_0x1f33fb[_0x5f4989][_0x7965('0x6f')]?_[_0x7965('0x6e')](_0x3d62ed[_0x1f33fb[_0x5f4989]['format']],'%s',_0x16179d):_0x16179d;if(_0x1f33fb[_0x5f4989][_0x7965('0x70')]){_0x56d027[_0x7965('0x62')](_0x16179d);}_0x1f33fb[_0x5f4989][_0x7965('0x71')]&&_0x56d027[_0x7965('0x72')](_0x16179d,_0x1f33fb[_0x5f4989]['orderBy']===_0x7965('0x8a')?![]:!![]);_0x56d027[_0x7965('0x3e')](_0x16179d,_0x1f33fb[_0x5f4989][_0x7965('0x73')]||_0x16179d);}if(_0xd0a399['joins']){_0xd0a399['joins']=JSON[_0x7965('0x79')](_0xd0a399['joins']);for(var _0x85ac69=0x0;_0x85ac69<_0xd0a399[_0x7965('0x74')][_0x7965('0x32')];_0x85ac69+=0x1){if(_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x3b')]&&_[_0x7965('0x5c')](_0xf51304,_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x3b')])&&_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x75')]&&_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x76')]&&_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x77')]){_0x56d027[_0xd0a399['joins'][_0x85ac69][_0x7965('0x3b')]](_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x76')],null,util['format']('%s.%s\x20=\x20%s.%s',_0xd0a399['table'],_0xd0a399['joins'][_0x85ac69][_0x7965('0x75')],_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x76')],_0xd0a399[_0x7965('0x74')][_0x85ac69][_0x7965('0x77')]));}}}if(_0xd0a399['conditions']){_0xd0a399['conditions']=JSON[_0x7965('0x79')](_0xd0a399[_0x7965('0x78')]);_0x56d027[_0x7965('0x38')](_0x33044d(_0xd0a399[_0x7965('0x78')][_0x7965('0x62')]));}_0x4bd921=_0x56d027[_0x7965('0x8b')]();_0x56d027[_0x7965('0x1a')](_0x56416b);_0x56d027[_0x7965('0x19')](0x0);logger['debug'](_0x7965('0x7b'),_0x56d027['toString']());return db[_0x7965('0x8c')][_0x7965('0x2d')](_0x56d027[_0x7965('0x7c')](),{'type':db[_0x7965('0x8c')]['QueryTypes'][_0x7965('0x7e')]});}})[_0x7965('0x20')](function(_0x1e16b4){if(!_0x1e16b4[_0x7965('0x32')]){throw new db[(_0x7965('0x88'))][(_0x7965('0x66'))](_0x7965('0x8d'),0xcc);}if(_0x390169[_0x7965('0x8e')]===_0x7965('0x8f')){return null;}var _0x2b5fc4=_[_0x7965('0x39')](_0x390169,{'name':_0x390169['fullPath']||_0x390169[_0x7965('0x26')]||_0xd0a399[_0x7965('0x26')],'basename':_0x248c02,'savename':util[_0x7965('0x6f')](_0x7965('0x90'),_0x390169[_0x7965('0x26')]||_0xd0a399[_0x7965('0x26')],require('randomstring')[_0x7965('0x91')](0x4),_0x390169['output']||_0x7965('0x92')),'reportId':_0xd0a399['id'],'reportType':_0x7965('0x93')});return db[_0x7965('0x94')][_0x7965('0x48')](_0x2b5fc4,{'raw':!![]});})['then'](function(_0x378476){if(_0xd0a399['table']===_0x7965('0x95')){_0x4bd921[_0x7965('0x38')](_0xd0a399['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x390169[_0x7965('0x96')],_0x390169[_0x7965('0x97')]);}else{_0x4bd921[_0x7965('0x38')](_0xd0a399['table']+_0x7965('0x98'),_0x390169[_0x7965('0x96')],_0x390169[_0x7965('0x97')]);}if(_0x378476){logger['info']('Run\x20Query:',_0x4bd921[_0x7965('0x7c')]());require('child_process')[_0x7965('0x99')](path[_0x7965('0x7f')](__dirname,'../../components/export/',_0x378476['output']),[_0x378476['id'],_0x4bd921[_0x7965('0x7c')](),path[_0x7965('0x7f')](__dirname,_0x7965('0x9a'),_0x378476[_0x7965('0x9b')]),_0x248c02]);return _0x378476;}else{var _0x560809=squel[_0x7965('0x69')]();_0x560809[_0x7965('0x6a')]('('+_0x4bd921['toString']()+')',_0x7965('0x9c'));_0x560809[_0x7965('0x3e')](_0x7965('0x9d'),_0x7965('0x40'));_0x4bd921[_0x7965('0x1a')](_0x390169['limit']||_0x56416b);_0x4bd921['offset'](_0x390169[_0x7965('0x19')]||0x0);return db['sequelize'][_0x7965('0x2d')](_0x560809[_0x7965('0x7c')](),{'type':db[_0x7965('0x8c')][_0x7965('0x7d')][_0x7965('0x7e')]})[_0x7965('0x20')](function(_0x6f1e2f){if(!_0x6f1e2f['length']){_0x47a1f0=0x0;}else{_0x47a1f0=_0x6f1e2f[0x0][_0x7965('0x40')]||0x0;}return db[_0x7965('0x8c')][_0x7965('0x2d')](_0x4bd921['toString'](),{'type':db[_0x7965('0x8c')]['QueryTypes'][_0x7965('0x7e')]});})['then'](function(_0xcbbc76){return{'rows':_0xcbbc76||[],'count':_0x47a1f0};});}});}exports['run']=function(_0x36b2fb,_0x3a6929){return runReport(_0x36b2fb[_0x7965('0x45')],_0x36b2fb[_0x7965('0x2d')],_0x36b2fb[_0x7965('0x3f')])[_0x7965('0x20')](respondWithResult(_0x3a6929,null))[_0x7965('0x47')](handleError(_0x3a6929,null));};exports['runReport']=runReport;exports[_0x7965('0x2d')]=function(_0x57cc77,_0x180b90){var _0x2f8fdd=0xa;var _0x3fd4f=[_0x7965('0x7f'),_0x7965('0x52'),'right_join',_0x7965('0x54')];var _0x86b45={'SUM':'SUM(%s)','COUNT':_0x7965('0x80'),'COUNT DISTINCT':_0x7965('0x81'),'MAX':_0x7965('0x82'),'MIN':_0x7965('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7965('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7965('0x59')};var _0x3ce0cf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7965('0x5a'),'ROUND':_0x7965('0x86'),'UNIX_TIMESTAMP':_0x7965('0x5b')};var _0xed61b5=function(_0x378555){return!_[_0x7965('0x5c')]([_0x7965('0x5d'),'IS\x20NOT\x20NULL',_0x7965('0x5e'),_0x7965('0x5f')],_0x378555);};var _0x24d0bd=function(_0x11c37b){if(!_0x11c37b||!_0x11c37b[_0x7965('0x60')][_0x7965('0x32')]){return'';}for(var _0x29de29='(',_0x4abe54=0x0;_0x4abe54<_0x11c37b[_0x7965('0x60')][_0x7965('0x32')];_0x4abe54+=0x1){_0x4abe54>0x0&&(_0x29de29+='\x20'+_0x11c37b['operator']+'\x20');_0x29de29+=_0x11c37b[_0x7965('0x60')][_0x4abe54][_0x7965('0x62')]?_0x24d0bd(_0x11c37b[_0x7965('0x60')][_0x4abe54][_0x7965('0x62')]):_0x11c37b['rules'][_0x4abe54][_0x7965('0x3e')]+'\x20'+_0x11c37b[_0x7965('0x60')][_0x4abe54][_0x7965('0x63')]+(_0xed61b5(_0x11c37b[_0x7965('0x60')][_0x4abe54][_0x7965('0x63')])?'\x20'+_0x11c37b[_0x7965('0x60')][_0x4abe54][_0x7965('0x64')]:'');}return _0x29de29+')';};var _0x3b9f84={'where':{'id':_0x57cc77['params']['id']}},_0x155d70,_0x140c34,_0x36b733,_0x7a8fbb,_0x281660;_0x3b9f84=_[_0x7965('0x39')]({},_0x3b9f84,_0x57cc77['options']);return db['AnalyticCustomReport'][_0x7965('0x46')](_0x3b9f84)[_0x7965('0x20')](function(_0x3b9073){if(_0x3b9073){_0x155d70=_0x3b9073;return _0x3b9073['getFields']();}return null;})[_0x7965('0x20')](function(_0x2fc8d5){if(_0x2fc8d5){if(!_0x2fc8d5[_0x7965('0x32')]){throw new db[(_0x7965('0x88'))][(_0x7965('0x66'))](_0x7965('0x67'),0x193);}_0x140c34=_0x2fc8d5;return db[_0x7965('0x9e')][_0x7965('0x9f')]({'raw':!![]});}return null;})[_0x7965('0x20')](function(_0x56d048){if(_0x56d048){_0x36b733=_[_0x7965('0x68')](_0x56d048,'id');var _0x7d433f;var _0x4879a0=squel[_0x7965('0x69')]();_0x4879a0['from'](_0x155d70[_0x7965('0x6b')]);for(var _0x3a946b=0x0;_0x3a946b<_0x140c34[_0x7965('0x32')];_0x3a946b+=0x1){_0x7d433f=_0x140c34[_0x3a946b][_0x7965('0x6c')]?_0x36b733[_0x140c34[_0x3a946b]['MetricId']][_0x7965('0x89')]:_0x140c34[_0x3a946b][_0x7965('0x3e')];_0x7d433f=_0x140c34[_0x3a946b][_0x7965('0x6d')]?_['replace'](_0x86b45[_0x140c34[_0x3a946b][_0x7965('0x6d')]],'%s',_0x7d433f):_0x7d433f;_0x7d433f=_0x140c34[_0x3a946b][_0x7965('0x6f')]?_[_0x7965('0x6e')](_0x3ce0cf[_0x140c34[_0x3a946b][_0x7965('0x6f')]],'%s',_0x7d433f):_0x7d433f;if(_0x140c34[_0x3a946b][_0x7965('0x70')]){_0x4879a0[_0x7965('0x62')](_0x7d433f);}_0x140c34[_0x3a946b][_0x7965('0x71')]&&_0x4879a0[_0x7965('0x72')](_0x7d433f,_0x140c34[_0x3a946b][_0x7965('0x71')]==='DESC'?![]:!![]);_0x4879a0[_0x7965('0x3e')](_0x7d433f,_0x140c34[_0x3a946b]['alias']||_0x7d433f);}if(_0x155d70[_0x7965('0x74')]){_0x155d70['joins']=JSON[_0x7965('0x79')](_0x155d70[_0x7965('0x74')]);for(var _0x331db8=0x0;_0x331db8<_0x155d70[_0x7965('0x74')][_0x7965('0x32')];_0x331db8+=0x1){if(_0x155d70[_0x7965('0x74')][_0x331db8]['type']&&_[_0x7965('0x5c')](_0x3fd4f,_0x155d70[_0x7965('0x74')][_0x331db8][_0x7965('0x3b')])&&_0x155d70[_0x7965('0x74')][_0x331db8][_0x7965('0x75')]&&_0x155d70[_0x7965('0x74')][_0x331db8][_0x7965('0x76')]&&_0x155d70[_0x7965('0x74')][_0x331db8][_0x7965('0x77')]){_0x4879a0[_0x155d70['joins'][_0x331db8][_0x7965('0x3b')]](_0x155d70[_0x7965('0x74')][_0x331db8][_0x7965('0x76')],null,util[_0x7965('0x6f')](_0x7965('0xa0'),_0x155d70[_0x7965('0x6b')],_0x155d70[_0x7965('0x74')][_0x331db8]['parentKey'],_0x155d70[_0x7965('0x74')][_0x331db8]['foreignTable'],_0x155d70[_0x7965('0x74')][_0x331db8]['foreignKey']));}}}if(_0x155d70[_0x7965('0x78')]){_0x155d70[_0x7965('0x78')]=JSON[_0x7965('0x79')](_0x155d70[_0x7965('0x78')]);_0x4879a0[_0x7965('0x38')](_0x24d0bd(_0x155d70[_0x7965('0x78')]['group']));}_0x281660=_0x4879a0[_0x7965('0x8b')]();_0x4879a0[_0x7965('0x1a')](_0x2f8fdd);_0x4879a0[_0x7965('0x19')](0x0);logger[_0x7965('0x7a')](_0x7965('0x7b'),_0x4879a0[_0x7965('0x7c')]());return db[_0x7965('0x8c')][_0x7965('0x2d')](_0x4879a0['toString'](),{'type':db['sequelize'][_0x7965('0x7d')]['SELECT']});}})[_0x7965('0x20')](function(){return{'sql':_0x281660[_0x7965('0x7c')]()};})[_0x7965('0x20')](respondWithResult(_0x180b90,null))[_0x7965('0x47')](handleError(_0x180b90,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 444728e..821e81a 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 _0x0ba5=['define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x254081,_0x133020){var _0x15e822=function(_0x5835ea){while(--_0x5835ea){_0x254081['push'](_0x254081['shift']());}};_0x15e822(++_0x133020);}(_0x0ba5,0x1d6));var _0x50ba=function(_0xc7a0cb,_0x389964){_0xc7a0cb=_0xc7a0cb-0x0;var _0x10ce8e=_0x0ba5[_0xc7a0cb];return _0x10ce8e;};'use strict';var _=require(_0x50ba('0x0'));var util=require(_0x50ba('0x1'));var logger=require('../../config/logger')(_0x50ba('0x2'));var moment=require(_0x50ba('0x3'));var BPromise=require(_0x50ba('0x4'));var rp=require(_0x50ba('0x5'));var fs=require('fs');var path=require(_0x50ba('0x6'));var rimraf=require(_0x50ba('0x7'));var config=require(_0x50ba('0x8'));var attributes=require(_0x50ba('0x9'));module[_0x50ba('0xa')]=function(_0x568572,_0x215cc6){return _0x568572[_0x50ba('0xb')](_0x50ba('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d1e=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','moment'];(function(_0x2c475b,_0x477707){var _0x2db119=function(_0x368e1a){while(--_0x368e1a){_0x2c475b['push'](_0x2c475b['shift']());}};_0x2db119(++_0x477707);}(_0x0d1e,0x19c));var _0xe0d1=function(_0x794828,_0x58083f){_0x794828=_0x794828-0x0;var _0x559b60=_0x0d1e[_0x794828];return _0x559b60;};'use strict';var _=require(_0xe0d1('0x0'));var util=require(_0xe0d1('0x1'));var logger=require(_0xe0d1('0x2'))('api');var moment=require(_0xe0d1('0x3'));var BPromise=require(_0xe0d1('0x4'));var rp=require(_0xe0d1('0x5'));var fs=require('fs');var path=require(_0xe0d1('0x6'));var rimraf=require(_0xe0d1('0x7'));var config=require(_0xe0d1('0x8'));var attributes=require(_0xe0d1('0x9'));module[_0xe0d1('0xa')]=function(_0x4d8665,_0x44c4d1){return _0x4d8665[_0xe0d1('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0xe0d1('0xc'),'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 50068fc..0fdcc93 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x351188,_0x55daa8){var _0x3c2ce5=function(_0x483af4){while(--_0x483af4){_0x351188['push'](_0x351188['shift']());}};_0x3c2ce5(++_0x55daa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x597a35,_0x5c3093){var _0x2bf4a8=function(_0x40ff0f){while(--_0x40ff0f){_0x597a35['push'](_0x597a35['shift']());}};_0x2bf4a8(++_0x5c3093);}(_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);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d444c0d..b450ec8 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 _0x0abf=['exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','delete','destroy'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x0abf,0xe8));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf0ab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf0ab('0x4'));var controller=require(_0xf0ab('0x5'));router[_0xf0ab('0x6')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x8')]);router[_0xf0ab('0x6')](_0xf0ab('0x9'),auth['isAuthenticated'](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x6')](_0xf0ab('0xb'),auth[_0xf0ab('0x7')](),controller['preview']);router[_0xf0ab('0x6')](_0xf0ab('0xc'),auth[_0xf0ab('0x7')](),controller['run']);router['get'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller['update']);router[_0xf0ab('0x12')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x13')]);module[_0xf0ab('0x14')]=router; \ No newline at end of file +var _0x1a37=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a37,0xb4));var _0x71a3=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x1a37[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var auth=require(_0x71a3('0x6'));var interaction=require(_0x71a3('0x7'));var config=require(_0x71a3('0x8'));var controller=require(_0x71a3('0x9'));router['get']('/',auth[_0x71a3('0xa')](),controller['index']);router[_0x71a3('0xb')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xd')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x71a3('0xb')](_0x71a3('0xe'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xf')]);router[_0x71a3('0xb')](_0x71a3('0x10'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x71a3('0x12')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x13')]);router[_0x71a3('0x14')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x15')]);module[_0x71a3('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index f6db675..d635e9a 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 _0x3007=['STRING','TEXT','sequelize'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x3007,0x18b));var _0x7300=function(_0x442e45,_0x52719d){_0x442e45=_0x442e45-0x0;var _0x26ebda=_0x3007[_0x442e45];return _0x26ebda;};'use strict';var Sequelize=require(_0x7300('0x0'));module['exports']={'name':{'type':Sequelize[_0x7300('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7300('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7300('0x2')]},'joins':{'type':Sequelize[_0x7300('0x2')]}}; \ No newline at end of file +var _0x5510=['TEXT','sequelize','exports','STRING'];(function(_0x230995,_0x1c9ef0){var _0x5edbf3=function(_0x26536b){while(--_0x26536b){_0x230995['push'](_0x230995['shift']());}};_0x5edbf3(++_0x1c9ef0);}(_0x5510,0x175));var _0x0551=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x5510[_0x5471ec];return _0x121d4c;};'use strict';var Sequelize=require(_0x0551('0x0'));module[_0x0551('0x1')]={'name':{'type':Sequelize[_0x0551('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0551('0x2')]},'parent':{'type':Sequelize[_0x0551('0x2')]},'table':{'type':Sequelize[_0x0551('0x2')]},'conditions':{'type':Sequelize[_0x0551('0x3')]},'joins':{'type':Sequelize[_0x0551('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b8a7329..20d37bf 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 _0x3dd3=['rules','group','value','params','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','MetricId','function','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','includes','condition','getFields','select','metric','replace','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NULL','keyBy','order','alias','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','DefaultReports','error','stack','name','send','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x3dd3,0x18c));var _0x33dd=function(_0x35787d,_0x2d5962){_0x35787d=_0x35787d-0x0;var _0x2f5b24=_0x3dd3[_0x35787d];return _0x2f5b24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x33dd('0x0'));var rimraf=require(_0x33dd('0x1'));var zipdir=require(_0x33dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33dd('0x3'));var moment=require(_0x33dd('0x4'));var BPromise=require(_0x33dd('0x5'));var Mustache=require(_0x33dd('0x6'));var util=require(_0x33dd('0x7'));var path=require(_0x33dd('0x8'));var sox=require(_0x33dd('0x9'));var csv=require(_0x33dd('0xa'));var ejs=require(_0x33dd('0xb'));var fs=require('fs');var _=require(_0x33dd('0xc'));var squel=require(_0x33dd('0xd'));var crypto=require('crypto');var jsforce=require(_0x33dd('0xe'));var deskjs=require(_0x33dd('0xf'));var toCsv=require(_0x33dd('0xa'));var querystring=require(_0x33dd('0x10'));var Papa=require(_0x33dd('0x11'));var Redis=require(_0x33dd('0x12'));var authService=require(_0x33dd('0x13'));var qs=require(_0x33dd('0x14'));var hardwareService=require(_0x33dd('0x15'));var logger=require(_0x33dd('0x16'))(_0x33dd('0x17'));var utils=require(_0x33dd('0x18'));var config=require(_0x33dd('0x19'));var db=require(_0x33dd('0x1a'))['db'];function respondWithStatusCode(_0x2df186,_0x380e8d){_0x380e8d=_0x380e8d||0xcc;return function(_0x3c036a){if(_0x3c036a){return _0x2df186[_0x33dd('0x1b')](_0x380e8d);}return _0x2df186[_0x33dd('0x1c')](_0x380e8d)[_0x33dd('0x1d')]();};}function respondWithResult(_0x15546b,_0x1e4f60){_0x1e4f60=_0x1e4f60||0xc8;return function(_0x4dcdcb){if(_0x4dcdcb){return _0x15546b[_0x33dd('0x1c')](_0x1e4f60)[_0x33dd('0x1e')](_0x4dcdcb);}};}function respondWithFilteredResult(_0x287b00,_0x347129){return function(_0x52caaa){if(_0x52caaa){var _0x3be05c=_0x52caaa[_0x33dd('0x1f')],_0x23ef62=_0x347129[_0x33dd('0x20')],_0x41edc9=_0x347129['offset']+_0x347129[_0x33dd('0x21')],_0x288c89;if(_0x41edc9>=_0x3be05c){_0x41edc9=_0x3be05c;_0x288c89=0xc8;}else{_0x288c89=0xce;}_0x287b00[_0x33dd('0x1c')](_0x288c89);return _0x287b00[_0x33dd('0x22')](_0x33dd('0x23'),_0x23ef62+'-'+_0x41edc9+'/'+_0x3be05c)[_0x33dd('0x1e')](_0x52caaa);}return null;};}function patchUpdates(_0x424ae5){return function(_0x495b12){try{jsonpatch[_0x33dd('0x24')](_0x495b12,_0x424ae5,!![]);}catch(_0xe81c0e){return BPromise['reject'](_0xe81c0e);}return _0x495b12[_0x33dd('0x25')]();};}function saveUpdates(_0x28b905,_0x1a15ef){return function(_0x107416){if(_0x107416){return _0x107416[_0x33dd('0x26')](_0x28b905)[_0x33dd('0x27')](function(_0x2109ad){return _0x2109ad;});}return null;};}function removeEntity(_0x146cb0,_0x12f497){return function(_0x44df52){if(_0x44df52){return _0x44df52[_0x33dd('0x28')]()[_0x33dd('0x27')](function(){var _0x44f7e9=_0x44df52[_0x33dd('0x29')]({'plain':!![]});var _0x34f3f0=_0x33dd('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x34f3f0,'resourceId':_0x44f7e9['id']}})[_0x33dd('0x27')](function(){return _0x44df52;});})['then'](function(){_0x146cb0[_0x33dd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd926,_0x3e8e29){return function(_0x18ad7e){if(!_0x18ad7e){_0x2dd926[_0x33dd('0x1b')](0x194);}return _0x18ad7e;};}function handleError(_0x204b13,_0x4f1ac5){_0x4f1ac5=_0x4f1ac5||0x1f4;return function(_0x5f5aa1){logger[_0x33dd('0x2b')](_0x5f5aa1[_0x33dd('0x2c')]);if(_0x5f5aa1[_0x33dd('0x2d')]){delete _0x5f5aa1[_0x33dd('0x2d')];}_0x204b13[_0x33dd('0x1c')](_0x4f1ac5)[_0x33dd('0x2e')](_0x5f5aa1);};}exports['index']=function(_0x277642,_0x1187dc){var _0x200eab={},_0x2a6de3={},_0x44809b={'count':0x0,'rows':[]};var _0x2b148f=db[_0x33dd('0x2f')][_0x33dd('0x30')];_0x2a6de3[_0x33dd('0x31')]=_[_0x33dd('0x32')](_0x2b148f);_0x2a6de3[_0x33dd('0x33')]=_[_0x33dd('0x32')](_0x277642[_0x33dd('0x33')]);_0x2a6de3[_0x33dd('0x34')]=_[_0x33dd('0x35')](_0x2a6de3[_0x33dd('0x31')],_0x2a6de3[_0x33dd('0x33')]);_0x200eab[_0x33dd('0x36')]=_[_0x33dd('0x35')](_0x2a6de3[_0x33dd('0x31')],qs[_0x33dd('0x37')](_0x277642['query']['fields']));_0x200eab[_0x33dd('0x36')]=_0x200eab[_0x33dd('0x36')][_0x33dd('0x38')]?_0x200eab[_0x33dd('0x36')]:_0x2a6de3[_0x33dd('0x31')];if(!_0x277642[_0x33dd('0x33')]['hasOwnProperty'](_0x33dd('0x39'))){_0x200eab[_0x33dd('0x21')]=qs[_0x33dd('0x21')](_0x277642[_0x33dd('0x33')][_0x33dd('0x21')]);_0x200eab[_0x33dd('0x20')]=qs[_0x33dd('0x20')](_0x277642['query'][_0x33dd('0x20')]);}_0x200eab['order']=qs[_0x33dd('0x3a')](_0x277642[_0x33dd('0x33')][_0x33dd('0x3a')]);_0x200eab[_0x33dd('0x3b')]=qs['filters'](_['pick'](_0x277642[_0x33dd('0x33')],_0x2a6de3['filters']));if(_0x277642[_0x33dd('0x33')][_0x33dd('0x3c')]){_0x200eab[_0x33dd('0x3b')]=_[_0x33dd('0x3d')](_0x200eab[_0x33dd('0x3b')],{'$or':_['map'](_0x2b148f,function(_0x2f10d2){if(_0x2f10d2[_0x33dd('0x3e')][_0x33dd('0x3f')]!==_0x33dd('0x40')){var _0x472fb4={};_0x472fb4[_0x2f10d2[_0x33dd('0x41')]]={'$like':'%'+_0x277642[_0x33dd('0x33')]['filter']+'%'};return _0x472fb4;}})});}_0x200eab=_[_0x33dd('0x3d')]({},_0x200eab,_0x277642[_0x33dd('0x42')]);var _0x19b99a={'where':_0x200eab['where']};return db[_0x33dd('0x2f')][_0x33dd('0x1f')](_0x19b99a)[_0x33dd('0x27')](function(_0x2b4861){_0x44809b[_0x33dd('0x1f')]=_0x2b4861;if(_0x277642[_0x33dd('0x33')][_0x33dd('0x43')]){_0x200eab['include']=[{'all':!![]}];}return db[_0x33dd('0x2f')][_0x33dd('0x44')](_0x200eab);})[_0x33dd('0x27')](function(_0x5b4d55){_0x44809b[_0x33dd('0x45')]=_0x5b4d55;return _0x44809b;})['then'](respondWithFilteredResult(_0x1187dc,_0x200eab))[_0x33dd('0x46')](handleError(_0x1187dc,null));};exports[_0x33dd('0x47')]=function(_0x4e9517,_0x14aae4){var _0x3deb70={'raw':!![],'where':{'id':_0x4e9517['params']['id']}},_0x4f5dcc={};_0x4f5dcc[_0x33dd('0x31')]=_['keys'](db[_0x33dd('0x2f')][_0x33dd('0x30')]);_0x4f5dcc['query']=_[_0x33dd('0x32')](_0x4e9517[_0x33dd('0x33')]);_0x4f5dcc['filters']=_[_0x33dd('0x35')](_0x4f5dcc[_0x33dd('0x31')],_0x4f5dcc[_0x33dd('0x33')]);_0x3deb70[_0x33dd('0x36')]=_[_0x33dd('0x35')](_0x4f5dcc[_0x33dd('0x31')],qs['fields'](_0x4e9517[_0x33dd('0x33')][_0x33dd('0x37')]));_0x3deb70[_0x33dd('0x36')]=_0x3deb70[_0x33dd('0x36')][_0x33dd('0x38')]?_0x3deb70[_0x33dd('0x36')]:_0x4f5dcc[_0x33dd('0x31')];if(_0x4e9517[_0x33dd('0x33')][_0x33dd('0x43')]){_0x3deb70[_0x33dd('0x48')]=[{'all':!![]}];}_0x3deb70=_[_0x33dd('0x3d')]({},_0x3deb70,_0x4e9517[_0x33dd('0x42')]);return db['AnalyticDefaultReport'][_0x33dd('0x49')](_0x3deb70)[_0x33dd('0x27')](handleEntityNotFound(_0x14aae4,null))[_0x33dd('0x27')](respondWithResult(_0x14aae4,null))[_0x33dd('0x46')](handleError(_0x14aae4,null));};exports[_0x33dd('0x4a')]=function(_0x3700ca,_0x338579){return db[_0x33dd('0x2f')]['create'](_0x3700ca[_0x33dd('0x4b')],{})[_0x33dd('0x27')](function(_0x3c3bc4){var _0x3ecd16=_0x3700ca[_0x33dd('0x4c')][_0x33dd('0x29')]({'plain':!![]});if(!_0x3ecd16)throw new Error(_0x33dd('0x4d'));if(_0x3ecd16['role']===_0x33dd('0x4c')){var _0x564610=_0x3c3bc4[_0x33dd('0x29')]({'plain':!![]});var _0x2dee69=_0x33dd('0x4e');return db[_0x33dd('0x4f')][_0x33dd('0x49')]({'where':{'name':_0x2dee69,'userProfileId':_0x3ecd16['userProfileId']},'raw':!![]})[_0x33dd('0x27')](function(_0x4059ed){if(_0x4059ed&&_0x4059ed[_0x33dd('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x564610['name'],'resourceId':_0x564610['id'],'type':_0x33dd('0x2a'),'sectionId':_0x4059ed['id']},{})['then'](function(){return _0x3c3bc4;});}else{return _0x3c3bc4;}})['catch'](function(_0x27fab7){logger[_0x33dd('0x2b')](_0x33dd('0x51'),_0x27fab7);throw _0x27fab7;});}return _0x3c3bc4;})[_0x33dd('0x27')](respondWithResult(_0x338579,0xc9))[_0x33dd('0x46')](handleError(_0x338579,null));};exports['update']=function(_0x215a91,_0x28631c){if(_0x215a91[_0x33dd('0x4b')]['id']){delete _0x215a91[_0x33dd('0x4b')]['id'];}return db[_0x33dd('0x2f')]['find']({'where':{'id':_0x215a91['params']['id']}})['then'](handleEntityNotFound(_0x28631c,null))[_0x33dd('0x27')](saveUpdates(_0x215a91['body'],null))[_0x33dd('0x27')](respondWithResult(_0x28631c,null))['catch'](handleError(_0x28631c,null));};exports['destroy']=function(_0x2e4dae,_0x12ffcb){return db[_0x33dd('0x2f')][_0x33dd('0x49')]({'where':{'id':_0x2e4dae['params']['id']}})[_0x33dd('0x27')](handleEntityNotFound(_0x12ffcb,null))[_0x33dd('0x27')](removeEntity(_0x12ffcb,null))[_0x33dd('0x46')](handleError(_0x12ffcb,null));};exports[_0x33dd('0x52')]=function(_0x1c2d3a,_0x356f1a){var _0x1caee3=0xa;var _0x3685ac=['join',_0x33dd('0x53'),'right_join',_0x33dd('0x54')];var _0x18ce5f={'SUM':_0x33dd('0x55'),'COUNT':_0x33dd('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x33dd('0x57'),'MIN':'MIN(%s)','AVG':_0x33dd('0x58'),'GROUP_CONCAT':_0x33dd('0x59'),'GROUP_CONCAT ASC':_0x33dd('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ae490={'SEC_TO_TIME':_0x33dd('0x5b'),'DATE':_0x33dd('0x5c'),'HOUR':_0x33dd('0x5d'),'ROUND':_0x33dd('0x5e'),'UNIX_TIMESTAMP':_0x33dd('0x5f')};var _0x58db56=function(_0xe9a803){return!_['includes'](['IS\x20NULL',_0x33dd('0x60'),_0x33dd('0x61'),_0x33dd('0x62')],_0xe9a803);};var _0x36ac37=function(_0x177266){if(!_0x177266||!_0x177266[_0x33dd('0x63')][_0x33dd('0x38')]){return'';}for(var _0x5beeff='(',_0xc5d808=0x0;_0xc5d808<_0x177266[_0x33dd('0x63')][_0x33dd('0x38')];_0xc5d808+=0x1){_0xc5d808>0x0&&(_0x5beeff+='\x20'+_0x177266['operator']+'\x20');_0x5beeff+=_0x177266[_0x33dd('0x63')][_0xc5d808][_0x33dd('0x64')]?_0x36ac37(_0x177266[_0x33dd('0x63')][_0xc5d808][_0x33dd('0x64')]):_0x177266[_0x33dd('0x63')][_0xc5d808]['field']+'\x20'+_0x177266[_0x33dd('0x63')][_0xc5d808]['condition']+(_0x58db56(_0x177266[_0x33dd('0x63')][_0xc5d808]['condition'])?'\x20'+_0x177266['rules'][_0xc5d808][_0x33dd('0x65')]:'');}return _0x5beeff+')';};var _0x4464f0={'where':{'id':_0x1c2d3a[_0x33dd('0x66')]['id']}},_0x18f62a,_0x1308e6,_0x2c0a08,_0x23c418,_0x149af3;_0x4464f0=_[_0x33dd('0x3d')]({},_0x4464f0,_0x1c2d3a[_0x33dd('0x42')]);return db['AnalyticDefaultReport'][_0x33dd('0x49')](_0x4464f0)[_0x33dd('0x27')](function(_0x33049d){if(_0x33049d){_0x18f62a=_0x33049d;return _0x33049d['getFields']();}return null;})[_0x33dd('0x27')](function(_0x469c40){if(_0x469c40){if(!_0x469c40[_0x33dd('0x38')]){throw new db[(_0x33dd('0x67'))][(_0x33dd('0x68'))](_0x33dd('0x69'),0x193);}_0x1308e6=_0x469c40;return db[_0x33dd('0x6a')][_0x33dd('0x44')]({'raw':!![]});}return null;})[_0x33dd('0x27')](function(_0x192cba){if(_0x192cba){_0x2c0a08=_['keyBy'](_0x192cba,'id');var _0x4a2e32;var _0x43daec=squel['select']();_0x43daec[_0x33dd('0x6b')](_0x18f62a['table']);for(var _0x1e77f1=0x0;_0x1e77f1<_0x1308e6[_0x33dd('0x38')];_0x1e77f1+=0x1){_0x4a2e32=_0x1308e6[_0x1e77f1][_0x33dd('0x6c')]?_0x2c0a08[_0x1308e6[_0x1e77f1][_0x33dd('0x6c')]]['metric']:_0x1308e6[_0x1e77f1][_0x33dd('0x41')];_0x4a2e32=_0x1308e6[_0x1e77f1][_0x33dd('0x6d')]?_['replace'](_0x18ce5f[_0x1308e6[_0x1e77f1][_0x33dd('0x6d')]],'%s',_0x4a2e32):_0x4a2e32;_0x4a2e32=_0x1308e6[_0x1e77f1]['format']?_['replace'](_0x5ae490[_0x1308e6[_0x1e77f1][_0x33dd('0x6e')]],'%s',_0x4a2e32):_0x4a2e32;if(_0x1308e6[_0x1e77f1][_0x33dd('0x6f')]){_0x43daec[_0x33dd('0x64')](_0x4a2e32);}_0x1308e6[_0x1e77f1][_0x33dd('0x70')]&&_0x43daec['order'](_0x4a2e32,_0x1308e6[_0x1e77f1][_0x33dd('0x70')]==='DESC'?![]:!![]);_0x43daec[_0x33dd('0x41')](_0x4a2e32,_0x1308e6[_0x1e77f1]['alias']||_0x4a2e32);}if(_0x18f62a[_0x33dd('0x71')]){_0x18f62a[_0x33dd('0x71')]=JSON[_0x33dd('0x72')](_0x18f62a[_0x33dd('0x71')]);for(var _0x3248ff=0x0;_0x3248ff<_0x18f62a[_0x33dd('0x71')][_0x33dd('0x38')];_0x3248ff+=0x1){if(_0x18f62a[_0x33dd('0x71')][_0x3248ff][_0x33dd('0x3e')]&&_['includes'](_0x3685ac,_0x18f62a[_0x33dd('0x71')][_0x3248ff]['type'])&&_0x18f62a[_0x33dd('0x71')][_0x3248ff][_0x33dd('0x73')]&&_0x18f62a[_0x33dd('0x71')][_0x3248ff][_0x33dd('0x74')]&&_0x18f62a[_0x33dd('0x71')][_0x3248ff][_0x33dd('0x75')]){_0x43daec[_0x18f62a[_0x33dd('0x71')][_0x3248ff]['type']](_0x18f62a[_0x33dd('0x71')][_0x3248ff]['foreignTable'],null,util[_0x33dd('0x6e')](_0x33dd('0x76'),_0x18f62a[_0x33dd('0x77')],_0x18f62a[_0x33dd('0x71')][_0x3248ff]['parentKey'],_0x18f62a[_0x33dd('0x71')][_0x3248ff]['foreignTable'],_0x18f62a['joins'][_0x3248ff][_0x33dd('0x75')]));}}}if(_0x18f62a[_0x33dd('0x78')]){_0x18f62a[_0x33dd('0x78')]=JSON[_0x33dd('0x72')](_0x18f62a[_0x33dd('0x78')]);_0x43daec['where'](_0x36ac37(_0x18f62a['conditions'][_0x33dd('0x64')]));}_0x149af3=_0x43daec[_0x33dd('0x79')]();_0x43daec['limit'](_0x1caee3);_0x43daec['offset'](0x0);logger[_0x33dd('0x7a')](_0x33dd('0x7b'),_0x43daec[_0x33dd('0x7c')]());return db[_0x33dd('0x7d')]['query'](_0x43daec['toString'](),{'type':db[_0x33dd('0x7d')][_0x33dd('0x7e')]['SELECT']});}})[_0x33dd('0x27')](respondWithResult(_0x356f1a,null))[_0x33dd('0x46')](handleError(_0x356f1a,null));};function runReport(_0x2edf76,_0x5eeffc,_0x302144){var _0x55feac=_0x5eeffc[_0x33dd('0x2d')];var _0x49791f=0xa;var _0x27d13e=[_0x33dd('0x7f'),'left_join',_0x33dd('0x80'),_0x33dd('0x54')];var _0xe9cab2={'SUM':_0x33dd('0x55'),'COUNT':_0x33dd('0x56'),'COUNT DISTINCT':_0x33dd('0x81'),'MAX':_0x33dd('0x57'),'MIN':_0x33dd('0x82'),'AVG':_0x33dd('0x58'),'GROUP_CONCAT':_0x33dd('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33dd('0x83')};var _0x20c579={'SEC_TO_TIME':_0x33dd('0x5b'),'DATE':_0x33dd('0x5c'),'HOUR':_0x33dd('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x50452c=function(_0x1b8513){return!_[_0x33dd('0x84')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x33dd('0x62')],_0x1b8513);};var _0x2fd2df=function(_0x266a84){if(!_0x266a84||!_0x266a84[_0x33dd('0x63')]['length']){return'';}for(var _0x209e9c='(',_0x16af22=0x0;_0x16af22<_0x266a84[_0x33dd('0x63')]['length'];_0x16af22+=0x1){_0x16af22>0x0&&(_0x209e9c+='\x20'+_0x266a84['operator']+'\x20');_0x209e9c+=_0x266a84[_0x33dd('0x63')][_0x16af22][_0x33dd('0x64')]?_0x2fd2df(_0x266a84[_0x33dd('0x63')][_0x16af22][_0x33dd('0x64')]):_0x266a84[_0x33dd('0x63')][_0x16af22][_0x33dd('0x41')]+'\x20'+_0x266a84[_0x33dd('0x63')][_0x16af22][_0x33dd('0x85')]+(_0x50452c(_0x266a84[_0x33dd('0x63')][_0x16af22][_0x33dd('0x85')])?'\x20'+_0x266a84['rules'][_0x16af22]['value']:'');}return _0x209e9c+')';};var _0x313eb8={'where':{'id':_0x2edf76['id']}},_0x266379,_0x22ca40,_0x1afe99,_0x1d5c9c,_0x17ac8d;_0x313eb8=_[_0x33dd('0x3d')]({},_0x313eb8,_0x302144);return db['AnalyticDefaultReport'][_0x33dd('0x49')](_0x313eb8)[_0x33dd('0x27')](function(_0x3efbf1){if(_0x3efbf1){_0x266379=_0x3efbf1;return _0x3efbf1[_0x33dd('0x86')]();}return null;})[_0x33dd('0x27')](function(_0x16fc84){if(_0x16fc84){if(!_0x16fc84[_0x33dd('0x38')]){throw new db[(_0x33dd('0x67'))][(_0x33dd('0x68'))](_0x33dd('0x69'),0x193);}_0x22ca40=_0x16fc84;return db['AnalyticMetric'][_0x33dd('0x44')]({'raw':!![]});}return null;})[_0x33dd('0x27')](function(_0x5ec748){if(_0x5ec748){_0x1afe99=_['keyBy'](_0x5ec748,'id');var _0x51b624;var _0x380990=squel[_0x33dd('0x87')]();_0x380990['from'](_0x266379[_0x33dd('0x77')]);for(var _0x577f1a=0x0;_0x577f1a<_0x22ca40[_0x33dd('0x38')];_0x577f1a+=0x1){_0x51b624=_0x22ca40[_0x577f1a]['MetricId']?_0x1afe99[_0x22ca40[_0x577f1a][_0x33dd('0x6c')]][_0x33dd('0x88')]:_0x22ca40[_0x577f1a][_0x33dd('0x41')];_0x51b624=_0x22ca40[_0x577f1a][_0x33dd('0x6d')]?_[_0x33dd('0x89')](_0xe9cab2[_0x22ca40[_0x577f1a][_0x33dd('0x6d')]],'%s',_0x51b624):_0x51b624;_0x51b624=_0x22ca40[_0x577f1a][_0x33dd('0x6e')]?_[_0x33dd('0x89')](_0x20c579[_0x22ca40[_0x577f1a][_0x33dd('0x6e')]],'%s',_0x51b624):_0x51b624;if(_0x22ca40[_0x577f1a][_0x33dd('0x6f')]){_0x380990[_0x33dd('0x64')](_0x51b624);}_0x22ca40[_0x577f1a]['orderBy']&&_0x380990['order'](_0x51b624,_0x22ca40[_0x577f1a][_0x33dd('0x70')]==='DESC'?![]:!![]);_0x380990[_0x33dd('0x41')](_0x51b624,_0x22ca40[_0x577f1a]['alias']||_0x51b624);}if(_0x266379['joins']){_0x266379[_0x33dd('0x71')]=JSON['parse'](_0x266379[_0x33dd('0x71')]);for(var _0x1729e8=0x0;_0x1729e8<_0x266379[_0x33dd('0x71')][_0x33dd('0x38')];_0x1729e8+=0x1){if(_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x3e')]&&_[_0x33dd('0x84')](_0x27d13e,_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x3e')])&&_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x73')]&&_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x74')]&&_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x75')]){_0x380990[_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x3e')]](_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x74')],null,util['format'](_0x33dd('0x76'),_0x266379[_0x33dd('0x77')],_0x266379['joins'][_0x1729e8]['parentKey'],_0x266379[_0x33dd('0x71')][_0x1729e8][_0x33dd('0x74')],_0x266379['joins'][_0x1729e8][_0x33dd('0x75')]));}}}if(_0x266379[_0x33dd('0x78')]){_0x266379[_0x33dd('0x78')]=JSON[_0x33dd('0x72')](_0x266379['conditions']);_0x380990[_0x33dd('0x3b')](_0x2fd2df(_0x266379[_0x33dd('0x78')][_0x33dd('0x64')]));}_0x17ac8d=_0x380990[_0x33dd('0x79')]();_0x380990[_0x33dd('0x21')](_0x49791f);_0x380990[_0x33dd('0x20')](0x0);logger['debug'](_0x33dd('0x7b'),_0x380990[_0x33dd('0x7c')]());return db['sequelize'][_0x33dd('0x33')](_0x380990[_0x33dd('0x7c')](),{'type':db[_0x33dd('0x7d')]['QueryTypes']['SELECT']});}})[_0x33dd('0x27')](function(_0x4e9156){if(!_0x4e9156['length']){throw new db[(_0x33dd('0x67'))][(_0x33dd('0x68'))](_0x33dd('0x8a'),0xcc);}if(_0x5eeffc[_0x33dd('0x8b')]===_0x33dd('0x8c')){return null;}var _0x42ae44=_[_0x33dd('0x3d')](_0x5eeffc,{'name':_0x5eeffc[_0x33dd('0x8d')]||_0x5eeffc[_0x33dd('0x2d')]||_0x266379[_0x33dd('0x2d')],'basename':_0x55feac,'savename':util[_0x33dd('0x6e')](_0x33dd('0x8e'),_0x5eeffc[_0x33dd('0x2d')]||_0x266379[_0x33dd('0x2d')],require(_0x33dd('0x8f'))[_0x33dd('0x90')](0x4),_0x5eeffc[_0x33dd('0x8b')]||_0x33dd('0x91')),'reportId':_0x266379['id'],'reportType':_0x33dd('0x92')});return db['AnalyticExtractedReport'][_0x33dd('0x4a')](_0x42ae44,{'raw':!![]});})[_0x33dd('0x27')](function(_0x47a7c8){if(_0x266379[_0x33dd('0x77')]==='cdr'){_0x17ac8d[_0x33dd('0x3b')](_0x266379[_0x33dd('0x77')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5eeffc[_0x33dd('0x93')],_0x5eeffc[_0x33dd('0x94')]);}else{_0x17ac8d[_0x33dd('0x3b')](_0x266379[_0x33dd('0x77')]+_0x33dd('0x95'),_0x5eeffc['startDate'],_0x5eeffc[_0x33dd('0x94')]);}if(_0x47a7c8){logger[_0x33dd('0x96')](_0x33dd('0x97'),_0x17ac8d['toString']());require(_0x33dd('0x98'))[_0x33dd('0x99')](path[_0x33dd('0x7f')](__dirname,'../../components/export/',_0x47a7c8[_0x33dd('0x8b')]),[_0x47a7c8['id'],_0x17ac8d[_0x33dd('0x7c')](),path[_0x33dd('0x7f')](__dirname,_0x33dd('0x9a'),_0x47a7c8[_0x33dd('0x9b')]),_0x55feac]);return _0x47a7c8;}else{var _0x180f89=squel[_0x33dd('0x87')]();_0x180f89[_0x33dd('0x6b')]('('+_0x17ac8d[_0x33dd('0x7c')]()+')',_0x33dd('0x9c'));_0x180f89[_0x33dd('0x41')](_0x33dd('0x9d'),_0x33dd('0x1f'));_0x17ac8d['limit'](_0x5eeffc[_0x33dd('0x21')]||_0x49791f);_0x17ac8d['offset'](_0x5eeffc[_0x33dd('0x20')]||0x0);return db[_0x33dd('0x7d')][_0x33dd('0x33')](_0x180f89[_0x33dd('0x7c')](),{'type':db[_0x33dd('0x7d')]['QueryTypes'][_0x33dd('0x9e')]})['then'](function(_0x548204){if(!_0x548204[_0x33dd('0x38')]){_0x1d5c9c=0x0;}else{_0x1d5c9c=_0x548204[0x0][_0x33dd('0x1f')]||0x0;}return db[_0x33dd('0x7d')][_0x33dd('0x33')](_0x17ac8d[_0x33dd('0x7c')](),{'type':db[_0x33dd('0x7d')][_0x33dd('0x7e')][_0x33dd('0x9e')]});})[_0x33dd('0x27')](function(_0x4473a5){return{'rows':_0x4473a5||[],'count':_0x1d5c9c};});}});}exports[_0x33dd('0x9f')]=function(_0x21d8ee,_0x1f3668){return runReport(_0x21d8ee[_0x33dd('0x66')],_0x21d8ee[_0x33dd('0x33')],_0x21d8ee[_0x33dd('0x42')])[_0x33dd('0x27')](respondWithResult(_0x1f3668,null))[_0x33dd('0x46')](handleError(_0x1f3668,null));};exports[_0x33dd('0xa0')]=runReport;exports['query']=function(_0x3905f1,_0x51dd56){var _0x3b9c02=0xa;var _0x3c9e56=[_0x33dd('0x7f'),_0x33dd('0x53'),'right_join',_0x33dd('0x54')];var _0x1d2c94={'SUM':_0x33dd('0x55'),'COUNT':_0x33dd('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x33dd('0x82'),'AVG':_0x33dd('0x58'),'GROUP_CONCAT':_0x33dd('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x33dd('0x83')};var _0x190b8e={'SEC_TO_TIME':_0x33dd('0x5b'),'DATE':_0x33dd('0x5c'),'HOUR':_0x33dd('0x5d'),'ROUND':_0x33dd('0x5e'),'UNIX_TIMESTAMP':_0x33dd('0x5f')};var _0xd4f957=function(_0x1aa397){return!_[_0x33dd('0x84')]([_0x33dd('0xa1'),'IS\x20NOT\x20NULL',_0x33dd('0x61'),_0x33dd('0x62')],_0x1aa397);};var _0x167b06=function(_0x48a361){if(!_0x48a361||!_0x48a361['rules'][_0x33dd('0x38')]){return'';}for(var _0xd77641='(',_0x543403=0x0;_0x543403<_0x48a361[_0x33dd('0x63')][_0x33dd('0x38')];_0x543403+=0x1){_0x543403>0x0&&(_0xd77641+='\x20'+_0x48a361['operator']+'\x20');_0xd77641+=_0x48a361[_0x33dd('0x63')][_0x543403]['group']?_0x167b06(_0x48a361[_0x33dd('0x63')][_0x543403][_0x33dd('0x64')]):_0x48a361[_0x33dd('0x63')][_0x543403]['field']+'\x20'+_0x48a361[_0x33dd('0x63')][_0x543403][_0x33dd('0x85')]+(_0xd4f957(_0x48a361[_0x33dd('0x63')][_0x543403][_0x33dd('0x85')])?'\x20'+_0x48a361[_0x33dd('0x63')][_0x543403][_0x33dd('0x65')]:'');}return _0xd77641+')';};var _0x121d60={'where':{'id':_0x3905f1[_0x33dd('0x66')]['id']}},_0x25076b,_0x5d4bbf,_0x1fbb57,_0xcc15ff,_0x584402;_0x121d60=_[_0x33dd('0x3d')]({},_0x121d60,_0x3905f1[_0x33dd('0x42')]);return db['AnalyticDefaultReport'][_0x33dd('0x49')](_0x121d60)[_0x33dd('0x27')](function(_0x4d5500){if(_0x4d5500){_0x25076b=_0x4d5500;return _0x4d5500[_0x33dd('0x86')]();}return null;})[_0x33dd('0x27')](function(_0xbb3578){if(_0xbb3578){if(!_0xbb3578['length']){throw new db[(_0x33dd('0x67'))]['ValidationErrorItem'](_0x33dd('0x69'),0x193);}_0x5d4bbf=_0xbb3578;return db[_0x33dd('0x6a')][_0x33dd('0x44')]({'raw':!![]});}return null;})['then'](function(_0x2c2fdd){if(_0x2c2fdd){_0x1fbb57=_[_0x33dd('0xa2')](_0x2c2fdd,'id');var _0x13a7b1;var _0x359703=squel[_0x33dd('0x87')]();_0x359703[_0x33dd('0x6b')](_0x25076b[_0x33dd('0x77')]);for(var _0x33ae9f=0x0;_0x33ae9f<_0x5d4bbf[_0x33dd('0x38')];_0x33ae9f+=0x1){_0x13a7b1=_0x5d4bbf[_0x33ae9f][_0x33dd('0x6c')]?_0x1fbb57[_0x5d4bbf[_0x33ae9f]['MetricId']][_0x33dd('0x88')]:_0x5d4bbf[_0x33ae9f][_0x33dd('0x41')];_0x13a7b1=_0x5d4bbf[_0x33ae9f]['function']?_['replace'](_0x1d2c94[_0x5d4bbf[_0x33ae9f][_0x33dd('0x6d')]],'%s',_0x13a7b1):_0x13a7b1;_0x13a7b1=_0x5d4bbf[_0x33ae9f][_0x33dd('0x6e')]?_[_0x33dd('0x89')](_0x190b8e[_0x5d4bbf[_0x33ae9f][_0x33dd('0x6e')]],'%s',_0x13a7b1):_0x13a7b1;if(_0x5d4bbf[_0x33ae9f][_0x33dd('0x6f')]){_0x359703['group'](_0x13a7b1);}_0x5d4bbf[_0x33ae9f][_0x33dd('0x70')]&&_0x359703[_0x33dd('0xa3')](_0x13a7b1,_0x5d4bbf[_0x33ae9f]['orderBy']==='DESC'?![]:!![]);_0x359703[_0x33dd('0x41')](_0x13a7b1,_0x5d4bbf[_0x33ae9f][_0x33dd('0xa4')]||_0x13a7b1);}if(_0x25076b[_0x33dd('0x71')]){_0x25076b[_0x33dd('0x71')]=JSON['parse'](_0x25076b[_0x33dd('0x71')]);for(var _0x17959f=0x0;_0x17959f<_0x25076b[_0x33dd('0x71')][_0x33dd('0x38')];_0x17959f+=0x1){if(_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x3e')]&&_['includes'](_0x3c9e56,_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x3e')])&&_0x25076b[_0x33dd('0x71')][_0x17959f]['parentKey']&&_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x74')]&&_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x75')]){_0x359703[_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x3e')]](_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x74')],null,util[_0x33dd('0x6e')]('%s.%s\x20=\x20%s.%s',_0x25076b[_0x33dd('0x77')],_0x25076b['joins'][_0x17959f]['parentKey'],_0x25076b[_0x33dd('0x71')][_0x17959f][_0x33dd('0x74')],_0x25076b[_0x33dd('0x71')][_0x17959f]['foreignKey']));}}}if(_0x25076b[_0x33dd('0x78')]){_0x25076b[_0x33dd('0x78')]=JSON[_0x33dd('0x72')](_0x25076b[_0x33dd('0x78')]);_0x359703[_0x33dd('0x3b')](_0x167b06(_0x25076b[_0x33dd('0x78')][_0x33dd('0x64')]));}_0x584402=_0x359703[_0x33dd('0x79')]();_0x359703[_0x33dd('0x21')](_0x3b9c02);_0x359703['offset'](0x0);logger[_0x33dd('0x7a')](_0x33dd('0x7b'),_0x359703[_0x33dd('0x7c')]());return db[_0x33dd('0x7d')]['query'](_0x359703['toString'](),{'type':db['sequelize'][_0x33dd('0x7e')][_0x33dd('0x9e')]});}})[_0x33dd('0x27')](function(){return{'sql':_0x584402['toString']()};})[_0x33dd('0x27')](respondWithResult(_0x51dd56,null))[_0x33dd('0x46')](handleError(_0x51dd56,null));}; \ No newline at end of file +var _0x003e=['UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticDefaultReport','rawAttributes','keys','query','filters','attributes','intersection','model','length','sort','where','merge','map','key','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','get','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','orderBy','order','DESC','alias','joins','type','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','from','groupBy','parentKey','toString','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','parse','clone','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','DefaultReports'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x003e,0x79));var _0xe003=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x003e[_0x38b14f];return _0x22a324;};'use strict';var pdf=require(_0xe003('0x0'));var emlformat=require(_0xe003('0x1'));var rimraf=require(_0xe003('0x2'));var zipdir=require(_0xe003('0x3'));var jsonpatch=require(_0xe003('0x4'));var rp=require(_0xe003('0x5'));var moment=require(_0xe003('0x6'));var BPromise=require(_0xe003('0x7'));var Mustache=require('mustache');var util=require(_0xe003('0x8'));var path=require('path');var sox=require(_0xe003('0x9'));var csv=require(_0xe003('0xa'));var ejs=require(_0xe003('0xb'));var fs=require('fs');var _=require(_0xe003('0xc'));var squel=require('squel');var crypto=require(_0xe003('0xd'));var jsforce=require(_0xe003('0xe'));var deskjs=require(_0xe003('0xf'));var toCsv=require(_0xe003('0xa'));var querystring=require(_0xe003('0x10'));var Papa=require(_0xe003('0x11'));var Redis=require(_0xe003('0x12'));var authService=require(_0xe003('0x13'));var qs=require(_0xe003('0x14'));var hardwareService=require(_0xe003('0x15'));var logger=require(_0xe003('0x16'))(_0xe003('0x17'));var utils=require(_0xe003('0x18'));var config=require(_0xe003('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cc467,_0x463299){_0x463299=_0x463299||0xcc;return function(_0x31771e){if(_0x31771e){return _0x3cc467['sendStatus'](_0x463299);}return _0x3cc467[_0xe003('0x1a')](_0x463299)[_0xe003('0x1b')]();};}function respondWithResult(_0xde20db,_0x2da581){_0x2da581=_0x2da581||0xc8;return function(_0x4a2115){if(_0x4a2115){return _0xde20db[_0xe003('0x1a')](_0x2da581)[_0xe003('0x1c')](_0x4a2115);}};}function respondWithFilteredResult(_0x453ec4,_0x3e9ea2){return function(_0x5b22ea){if(_0x5b22ea){var _0x4a6e26=_0x5b22ea[_0xe003('0x1d')],_0x2df692=_0x3e9ea2[_0xe003('0x1e')],_0x10a2a8=_0x3e9ea2['offset']+_0x3e9ea2[_0xe003('0x1f')],_0x5bc324;if(_0x10a2a8>=_0x4a6e26){_0x10a2a8=_0x4a6e26;_0x5bc324=0xc8;}else{_0x5bc324=0xce;}_0x453ec4[_0xe003('0x1a')](_0x5bc324);return _0x453ec4['set'](_0xe003('0x20'),_0x2df692+'-'+_0x10a2a8+'/'+_0x4a6e26)[_0xe003('0x1c')](_0x5b22ea);}return null;};}function patchUpdates(_0x59e6f5){return function(_0x1043a6){try{jsonpatch[_0xe003('0x21')](_0x1043a6,_0x59e6f5,!![]);}catch(_0x196fcd){return BPromise[_0xe003('0x22')](_0x196fcd);}return _0x1043a6[_0xe003('0x23')]();};}function saveUpdates(_0x5f0f12,_0x243ede){return function(_0x20d612){if(_0x20d612){return _0x20d612[_0xe003('0x24')](_0x5f0f12)[_0xe003('0x25')](function(_0x58f65b){return _0x58f65b;});}return null;};}function removeEntity(_0x18bd39,_0x5a2f07){return function(_0x1cdc7b){if(_0x1cdc7b){return _0x1cdc7b[_0xe003('0x26')]()[_0xe003('0x25')](function(){var _0xd1f0c4=_0x1cdc7b['get']({'plain':!![]});var _0xea3223=_0xe003('0x27');return db[_0xe003('0x28')][_0xe003('0x26')]({'where':{'type':_0xea3223,'resourceId':_0xd1f0c4['id']}})[_0xe003('0x25')](function(){return _0x1cdc7b;});})[_0xe003('0x25')](function(){_0x18bd39[_0xe003('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21152f,_0x520582){return function(_0x346d00){if(!_0x346d00){_0x21152f[_0xe003('0x29')](0x194);}return _0x346d00;};}function handleError(_0x4a8b40,_0x1d09c4){_0x1d09c4=_0x1d09c4||0x1f4;return function(_0x500e49){logger[_0xe003('0x2a')](_0x500e49[_0xe003('0x2b')]);if(_0x500e49[_0xe003('0x2c')]){delete _0x500e49[_0xe003('0x2c')];}_0x4a8b40[_0xe003('0x1a')](_0x1d09c4)[_0xe003('0x2d')](_0x500e49);};}exports[_0xe003('0x2e')]=function(_0x23e9fb,_0x2d24ba){var _0x40057c={},_0x5b5603={},_0x14302d={'count':0x0,'rows':[]};var _0x5069e7=db[_0xe003('0x2f')][_0xe003('0x30')];_0x5b5603['model']=_[_0xe003('0x31')](_0x5069e7);_0x5b5603[_0xe003('0x32')]=_['keys'](_0x23e9fb[_0xe003('0x32')]);_0x5b5603[_0xe003('0x33')]=_['intersection'](_0x5b5603['model'],_0x5b5603[_0xe003('0x32')]);_0x40057c[_0xe003('0x34')]=_[_0xe003('0x35')](_0x5b5603[_0xe003('0x36')],qs['fields'](_0x23e9fb[_0xe003('0x32')]['fields']));_0x40057c[_0xe003('0x34')]=_0x40057c[_0xe003('0x34')][_0xe003('0x37')]?_0x40057c[_0xe003('0x34')]:_0x5b5603[_0xe003('0x36')];if(!_0x23e9fb['query']['hasOwnProperty']('nolimit')){_0x40057c[_0xe003('0x1f')]=qs[_0xe003('0x1f')](_0x23e9fb[_0xe003('0x32')][_0xe003('0x1f')]);_0x40057c['offset']=qs[_0xe003('0x1e')](_0x23e9fb[_0xe003('0x32')]['offset']);}_0x40057c['order']=qs[_0xe003('0x38')](_0x23e9fb[_0xe003('0x32')][_0xe003('0x38')]);_0x40057c[_0xe003('0x39')]=qs[_0xe003('0x33')](_['pick'](_0x23e9fb['query'],_0x5b5603[_0xe003('0x33')]));if(_0x23e9fb[_0xe003('0x32')]['filter']){_0x40057c['where']=_[_0xe003('0x3a')](_0x40057c[_0xe003('0x39')],{'$or':_[_0xe003('0x3b')](_0x5069e7,function(_0x501ba1){if(_0x501ba1['type'][_0xe003('0x3c')]!=='VIRTUAL'){var _0x3223cc={};_0x3223cc[_0x501ba1['field']]={'$like':'%'+_0x23e9fb[_0xe003('0x32')][_0xe003('0x3d')]+'%'};return _0x3223cc;}})});}_0x40057c=_[_0xe003('0x3a')]({},_0x40057c,_0x23e9fb[_0xe003('0x3e')]);var _0x11d53a={'where':_0x40057c[_0xe003('0x39')]};return db['AnalyticDefaultReport'][_0xe003('0x1d')](_0x11d53a)[_0xe003('0x25')](function(_0x2fa27d){_0x14302d[_0xe003('0x1d')]=_0x2fa27d;if(_0x23e9fb[_0xe003('0x32')][_0xe003('0x3f')]){_0x40057c['include']=[{'all':!![]}];}return db[_0xe003('0x2f')][_0xe003('0x40')](_0x40057c);})[_0xe003('0x25')](function(_0x46914d){_0x14302d[_0xe003('0x41')]=_0x46914d;return _0x14302d;})['then'](respondWithFilteredResult(_0x2d24ba,_0x40057c))[_0xe003('0x42')](handleError(_0x2d24ba,null));};exports[_0xe003('0x43')]=function(_0x47d938,_0x39222a){var _0x1af7f8={'raw':!![],'where':{'id':_0x47d938[_0xe003('0x44')]['id']}},_0x3a033f={};_0x3a033f[_0xe003('0x36')]=_['keys'](db[_0xe003('0x2f')][_0xe003('0x30')]);_0x3a033f['query']=_[_0xe003('0x31')](_0x47d938['query']);_0x3a033f[_0xe003('0x33')]=_['intersection'](_0x3a033f['model'],_0x3a033f['query']);_0x1af7f8[_0xe003('0x34')]=_[_0xe003('0x35')](_0x3a033f[_0xe003('0x36')],qs['fields'](_0x47d938[_0xe003('0x32')]['fields']));_0x1af7f8['attributes']=_0x1af7f8[_0xe003('0x34')]['length']?_0x1af7f8[_0xe003('0x34')]:_0x3a033f[_0xe003('0x36')];if(_0x47d938[_0xe003('0x32')]['includeAll']){_0x1af7f8[_0xe003('0x45')]=[{'all':!![]}];}_0x1af7f8=_['merge']({},_0x1af7f8,_0x47d938[_0xe003('0x3e')]);return db['AnalyticDefaultReport'][_0xe003('0x46')](_0x1af7f8)['then'](handleEntityNotFound(_0x39222a,null))['then'](respondWithResult(_0x39222a,null))[_0xe003('0x42')](handleError(_0x39222a,null));};exports[_0xe003('0x47')]=function(_0x1dc311,_0x1d1342){return db[_0xe003('0x2f')]['create'](_0x1dc311['body'],{})['then'](function(_0x1093a1){var _0x10893d=_0x1dc311[_0xe003('0x48')][_0xe003('0x49')]({'plain':!![]});if(!_0x10893d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10893d[_0xe003('0x4a')]===_0xe003('0x48')){var _0x3a96de=_0x1093a1[_0xe003('0x49')]({'plain':!![]});var _0x4bc727=_0xe003('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x4bc727,'userProfileId':_0x10893d[_0xe003('0x4c')]},'raw':!![]})['then'](function(_0x2aca63){if(_0x2aca63&&_0x2aca63[_0xe003('0x4d')]===0x0){return db[_0xe003('0x28')][_0xe003('0x47')]({'name':_0x3a96de[_0xe003('0x2c')],'resourceId':_0x3a96de['id'],'type':_0xe003('0x27'),'sectionId':_0x2aca63['id']},{})[_0xe003('0x25')](function(){return _0x1093a1;});}else{return _0x1093a1;}})[_0xe003('0x42')](function(_0x334a91){logger[_0xe003('0x2a')](_0xe003('0x4e'),_0x334a91);throw _0x334a91;});}return _0x1093a1;})['then'](respondWithResult(_0x1d1342,0xc9))[_0xe003('0x42')](handleError(_0x1d1342,null));};exports[_0xe003('0x24')]=function(_0x256037,_0x223c80){if(_0x256037['body']['id']){delete _0x256037[_0xe003('0x4f')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x256037['params']['id']}})[_0xe003('0x25')](handleEntityNotFound(_0x223c80,null))['then'](saveUpdates(_0x256037[_0xe003('0x4f')],null))[_0xe003('0x25')](respondWithResult(_0x223c80,null))[_0xe003('0x42')](handleError(_0x223c80,null));};exports['destroy']=function(_0x34e6ad,_0x1bd1b0){return db[_0xe003('0x2f')][_0xe003('0x46')]({'where':{'id':_0x34e6ad['params']['id']}})['then'](handleEntityNotFound(_0x1bd1b0,null))[_0xe003('0x25')](removeEntity(_0x1bd1b0,null))[_0xe003('0x42')](handleError(_0x1bd1b0,null));};exports['preview']=function(_0x2be7e9,_0x2e4946){var _0x5669f6=0xa;var _0x20ef3a=['join',_0xe003('0x50'),_0xe003('0x51'),_0xe003('0x52')];var _0x19606d={'SUM':_0xe003('0x53'),'COUNT':_0xe003('0x54'),'COUNT DISTINCT':_0xe003('0x55'),'MAX':_0xe003('0x56'),'MIN':_0xe003('0x57'),'AVG':_0xe003('0x58'),'GROUP_CONCAT':_0xe003('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe003('0x5a')};var _0x551a5b={'SEC_TO_TIME':_0xe003('0x5b'),'DATE':_0xe003('0x5c'),'HOUR':_0xe003('0x5d'),'ROUND':_0xe003('0x5e'),'UNIX_TIMESTAMP':_0xe003('0x5f')};var _0x2d3d80=function(_0x30d0b7){return!_[_0xe003('0x60')]([_0xe003('0x61'),_0xe003('0x62'),'IS\x20EMPTY',_0xe003('0x63')],_0x30d0b7);};var _0x4eeef4=function(_0x521c31){if(!_0x521c31||!_0x521c31['rules'][_0xe003('0x37')]){return'';}for(var _0x15446d='(',_0x5aea33=0x0;_0x5aea33<_0x521c31[_0xe003('0x64')][_0xe003('0x37')];_0x5aea33+=0x1){_0x5aea33>0x0&&(_0x15446d+='\x20'+_0x521c31[_0xe003('0x65')]+'\x20');_0x15446d+=_0x521c31[_0xe003('0x64')][_0x5aea33][_0xe003('0x66')]?_0x4eeef4(_0x521c31[_0xe003('0x64')][_0x5aea33][_0xe003('0x66')]):_0x521c31[_0xe003('0x64')][_0x5aea33][_0xe003('0x67')]+'\x20'+_0x521c31[_0xe003('0x64')][_0x5aea33][_0xe003('0x68')]+(_0x2d3d80(_0x521c31[_0xe003('0x64')][_0x5aea33][_0xe003('0x68')])?'\x20'+_0x521c31['rules'][_0x5aea33][_0xe003('0x69')]:'');}return _0x15446d+')';};var _0x3813ea={'where':{'id':_0x2be7e9['params']['id']}},_0x737882,_0x212df5,_0x552f52,_0xa23c8f,_0xb87e1f;_0x3813ea=_[_0xe003('0x3a')]({},_0x3813ea,_0x2be7e9['options']);return db[_0xe003('0x2f')][_0xe003('0x46')](_0x3813ea)[_0xe003('0x25')](function(_0x499d40){if(_0x499d40){_0x737882=_0x499d40;return _0x499d40[_0xe003('0x6a')]();}return null;})['then'](function(_0x10b67c){if(_0x10b67c){if(!_0x10b67c['length']){throw new db[(_0xe003('0x6b'))][(_0xe003('0x6c'))](_0xe003('0x6d'),0x193);}_0x212df5=_0x10b67c;return db[_0xe003('0x6e')][_0xe003('0x40')]({'raw':!![]});}return null;})['then'](function(_0x1cd842){if(_0x1cd842){_0x552f52=_[_0xe003('0x6f')](_0x1cd842,'id');var _0x5d0498;var _0x3ffecd=squel[_0xe003('0x70')]();_0x3ffecd['from'](_0x737882[_0xe003('0x71')]);for(var _0x1b71b9=0x0;_0x1b71b9<_0x212df5[_0xe003('0x37')];_0x1b71b9+=0x1){_0x5d0498=_0x212df5[_0x1b71b9][_0xe003('0x72')]?_0x552f52[_0x212df5[_0x1b71b9]['MetricId']][_0xe003('0x73')]:_0x212df5[_0x1b71b9]['field'];_0x5d0498=_0x212df5[_0x1b71b9][_0xe003('0x74')]?_['replace'](_0x19606d[_0x212df5[_0x1b71b9]['function']],'%s',_0x5d0498):_0x5d0498;_0x5d0498=_0x212df5[_0x1b71b9][_0xe003('0x75')]?_[_0xe003('0x76')](_0x551a5b[_0x212df5[_0x1b71b9]['format']],'%s',_0x5d0498):_0x5d0498;if(_0x212df5[_0x1b71b9]['groupBy']){_0x3ffecd['group'](_0x5d0498);}_0x212df5[_0x1b71b9][_0xe003('0x77')]&&_0x3ffecd[_0xe003('0x78')](_0x5d0498,_0x212df5[_0x1b71b9][_0xe003('0x77')]===_0xe003('0x79')?![]:!![]);_0x3ffecd[_0xe003('0x67')](_0x5d0498,_0x212df5[_0x1b71b9][_0xe003('0x7a')]||_0x5d0498);}if(_0x737882[_0xe003('0x7b')]){_0x737882[_0xe003('0x7b')]=JSON['parse'](_0x737882[_0xe003('0x7b')]);for(var _0x532cb3=0x0;_0x532cb3<_0x737882[_0xe003('0x7b')][_0xe003('0x37')];_0x532cb3+=0x1){if(_0x737882['joins'][_0x532cb3][_0xe003('0x7c')]&&_[_0xe003('0x60')](_0x20ef3a,_0x737882[_0xe003('0x7b')][_0x532cb3][_0xe003('0x7c')])&&_0x737882[_0xe003('0x7b')][_0x532cb3]['parentKey']&&_0x737882[_0xe003('0x7b')][_0x532cb3][_0xe003('0x7d')]&&_0x737882['joins'][_0x532cb3]['foreignKey']){_0x3ffecd[_0x737882[_0xe003('0x7b')][_0x532cb3][_0xe003('0x7c')]](_0x737882[_0xe003('0x7b')][_0x532cb3]['foreignTable'],null,util[_0xe003('0x75')](_0xe003('0x7e'),_0x737882[_0xe003('0x71')],_0x737882['joins'][_0x532cb3]['parentKey'],_0x737882['joins'][_0x532cb3][_0xe003('0x7d')],_0x737882[_0xe003('0x7b')][_0x532cb3][_0xe003('0x7f')]));}}}if(_0x737882[_0xe003('0x80')]){_0x737882[_0xe003('0x80')]=JSON['parse'](_0x737882[_0xe003('0x80')]);_0x3ffecd[_0xe003('0x39')](_0x4eeef4(_0x737882[_0xe003('0x80')][_0xe003('0x66')]));}_0xb87e1f=_0x3ffecd['clone']();_0x3ffecd[_0xe003('0x1f')](_0x5669f6);_0x3ffecd[_0xe003('0x1e')](0x0);logger[_0xe003('0x81')](_0xe003('0x82'),_0x3ffecd['toString']());return db[_0xe003('0x83')][_0xe003('0x32')](_0x3ffecd['toString'](),{'type':db[_0xe003('0x83')][_0xe003('0x84')][_0xe003('0x85')]});}})[_0xe003('0x25')](respondWithResult(_0x2e4946,null))['catch'](handleError(_0x2e4946,null));};function runReport(_0x7e9257,_0x18541b,_0x60785b){var _0x51e845=_0x18541b[_0xe003('0x2c')];var _0x47f262=0xa;var _0x23bd94=[_0xe003('0x86'),_0xe003('0x50'),_0xe003('0x51'),_0xe003('0x52')];var _0x5a3a6c={'SUM':_0xe003('0x53'),'COUNT':_0xe003('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe003('0x57'),'AVG':_0xe003('0x58'),'GROUP_CONCAT':_0xe003('0x59'),'GROUP_CONCAT ASC':_0xe003('0x87'),'GROUP_CONCAT DESC':_0xe003('0x5a')};var _0x2b6fef={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe003('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xe003('0x5e'),'UNIX_TIMESTAMP':_0xe003('0x5f')};var _0x371f6c=function(_0x5376a5){return!_[_0xe003('0x60')]([_0xe003('0x61'),_0xe003('0x62'),_0xe003('0x88'),_0xe003('0x63')],_0x5376a5);};var _0x4bf6ab=function(_0x2a5cef){if(!_0x2a5cef||!_0x2a5cef[_0xe003('0x64')][_0xe003('0x37')]){return'';}for(var _0x4886db='(',_0x1eb69c=0x0;_0x1eb69c<_0x2a5cef[_0xe003('0x64')][_0xe003('0x37')];_0x1eb69c+=0x1){_0x1eb69c>0x0&&(_0x4886db+='\x20'+_0x2a5cef[_0xe003('0x65')]+'\x20');_0x4886db+=_0x2a5cef[_0xe003('0x64')][_0x1eb69c]['group']?_0x4bf6ab(_0x2a5cef[_0xe003('0x64')][_0x1eb69c][_0xe003('0x66')]):_0x2a5cef[_0xe003('0x64')][_0x1eb69c][_0xe003('0x67')]+'\x20'+_0x2a5cef[_0xe003('0x64')][_0x1eb69c][_0xe003('0x68')]+(_0x371f6c(_0x2a5cef['rules'][_0x1eb69c][_0xe003('0x68')])?'\x20'+_0x2a5cef[_0xe003('0x64')][_0x1eb69c][_0xe003('0x69')]:'');}return _0x4886db+')';};var _0x383dad={'where':{'id':_0x7e9257['id']}},_0x3b1484,_0x3cede4,_0x1e7e73,_0x48fb28,_0x130b9c;_0x383dad=_[_0xe003('0x3a')]({},_0x383dad,_0x60785b);return db[_0xe003('0x2f')][_0xe003('0x46')](_0x383dad)[_0xe003('0x25')](function(_0xd31c0d){if(_0xd31c0d){_0x3b1484=_0xd31c0d;return _0xd31c0d[_0xe003('0x6a')]();}return null;})[_0xe003('0x25')](function(_0x4a41ec){if(_0x4a41ec){if(!_0x4a41ec[_0xe003('0x37')]){throw new db[(_0xe003('0x6b'))][(_0xe003('0x6c'))](_0xe003('0x6d'),0x193);}_0x3cede4=_0x4a41ec;return db[_0xe003('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xe003('0x25')](function(_0x440283){if(_0x440283){_0x1e7e73=_[_0xe003('0x6f')](_0x440283,'id');var _0x3122ef;var _0x1e28ba=squel[_0xe003('0x70')]();_0x1e28ba[_0xe003('0x89')](_0x3b1484['table']);for(var _0x422fc6=0x0;_0x422fc6<_0x3cede4['length'];_0x422fc6+=0x1){_0x3122ef=_0x3cede4[_0x422fc6][_0xe003('0x72')]?_0x1e7e73[_0x3cede4[_0x422fc6][_0xe003('0x72')]][_0xe003('0x73')]:_0x3cede4[_0x422fc6][_0xe003('0x67')];_0x3122ef=_0x3cede4[_0x422fc6][_0xe003('0x74')]?_[_0xe003('0x76')](_0x5a3a6c[_0x3cede4[_0x422fc6][_0xe003('0x74')]],'%s',_0x3122ef):_0x3122ef;_0x3122ef=_0x3cede4[_0x422fc6][_0xe003('0x75')]?_[_0xe003('0x76')](_0x2b6fef[_0x3cede4[_0x422fc6]['format']],'%s',_0x3122ef):_0x3122ef;if(_0x3cede4[_0x422fc6][_0xe003('0x8a')]){_0x1e28ba[_0xe003('0x66')](_0x3122ef);}_0x3cede4[_0x422fc6][_0xe003('0x77')]&&_0x1e28ba[_0xe003('0x78')](_0x3122ef,_0x3cede4[_0x422fc6]['orderBy']===_0xe003('0x79')?![]:!![]);_0x1e28ba[_0xe003('0x67')](_0x3122ef,_0x3cede4[_0x422fc6]['alias']||_0x3122ef);}if(_0x3b1484[_0xe003('0x7b')]){_0x3b1484[_0xe003('0x7b')]=JSON['parse'](_0x3b1484[_0xe003('0x7b')]);for(var _0x5dfa02=0x0;_0x5dfa02<_0x3b1484[_0xe003('0x7b')]['length'];_0x5dfa02+=0x1){if(_0x3b1484[_0xe003('0x7b')][_0x5dfa02][_0xe003('0x7c')]&&_['includes'](_0x23bd94,_0x3b1484['joins'][_0x5dfa02]['type'])&&_0x3b1484['joins'][_0x5dfa02]['parentKey']&&_0x3b1484['joins'][_0x5dfa02][_0xe003('0x7d')]&&_0x3b1484[_0xe003('0x7b')][_0x5dfa02]['foreignKey']){_0x1e28ba[_0x3b1484[_0xe003('0x7b')][_0x5dfa02][_0xe003('0x7c')]](_0x3b1484[_0xe003('0x7b')][_0x5dfa02]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1484[_0xe003('0x71')],_0x3b1484[_0xe003('0x7b')][_0x5dfa02][_0xe003('0x8b')],_0x3b1484['joins'][_0x5dfa02][_0xe003('0x7d')],_0x3b1484[_0xe003('0x7b')][_0x5dfa02][_0xe003('0x7f')]));}}}if(_0x3b1484[_0xe003('0x80')]){_0x3b1484['conditions']=JSON['parse'](_0x3b1484['conditions']);_0x1e28ba[_0xe003('0x39')](_0x4bf6ab(_0x3b1484[_0xe003('0x80')][_0xe003('0x66')]));}_0x130b9c=_0x1e28ba['clone']();_0x1e28ba[_0xe003('0x1f')](_0x47f262);_0x1e28ba[_0xe003('0x1e')](0x0);logger[_0xe003('0x81')]('Limited\x20Query:',_0x1e28ba[_0xe003('0x8c')]());return db[_0xe003('0x83')][_0xe003('0x32')](_0x1e28ba['toString'](),{'type':db[_0xe003('0x83')][_0xe003('0x84')][_0xe003('0x85')]});}})[_0xe003('0x25')](function(_0x2cee5f){if(!_0x2cee5f['length']){throw new db['Sequelize'][(_0xe003('0x6c'))](_0xe003('0x8d'),0xcc);}if(_0x18541b[_0xe003('0x8e')]===_0xe003('0x8f')){return null;}var _0x988298=_['merge'](_0x18541b,{'name':_0x18541b['fullPath']||_0x18541b[_0xe003('0x2c')]||_0x3b1484[_0xe003('0x2c')],'basename':_0x51e845,'savename':util[_0xe003('0x75')](_0xe003('0x90'),_0x18541b[_0xe003('0x2c')]||_0x3b1484[_0xe003('0x2c')],require(_0xe003('0x91'))[_0xe003('0x92')](0x4),_0x18541b[_0xe003('0x8e')]||'csv'),'reportId':_0x3b1484['id'],'reportType':_0xe003('0x93')});return db[_0xe003('0x94')][_0xe003('0x47')](_0x988298,{'raw':!![]});})[_0xe003('0x25')](function(_0x422121){if(_0x3b1484[_0xe003('0x71')]===_0xe003('0x95')){_0x130b9c['where'](_0x3b1484[_0xe003('0x71')]+_0xe003('0x96'),_0x18541b[_0xe003('0x97')],_0x18541b[_0xe003('0x98')]);}else{_0x130b9c[_0xe003('0x39')](_0x3b1484[_0xe003('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x18541b[_0xe003('0x97')],_0x18541b[_0xe003('0x98')]);}if(_0x422121){logger['info'](_0xe003('0x99'),_0x130b9c['toString']());require('child_process')[_0xe003('0x9a')](path[_0xe003('0x86')](__dirname,'../../components/export/',_0x422121[_0xe003('0x8e')]),[_0x422121['id'],_0x130b9c[_0xe003('0x8c')](),path[_0xe003('0x86')](__dirname,_0xe003('0x9b'),_0x422121[_0xe003('0x9c')]),_0x51e845]);return _0x422121;}else{var _0xbba85b=squel['select']();_0xbba85b[_0xe003('0x89')]('('+_0x130b9c[_0xe003('0x8c')]()+')',_0xe003('0x9d'));_0xbba85b['field'](_0xe003('0x9e'),_0xe003('0x1d'));_0x130b9c[_0xe003('0x1f')](_0x18541b[_0xe003('0x1f')]||_0x47f262);_0x130b9c[_0xe003('0x1e')](_0x18541b[_0xe003('0x1e')]||0x0);return db[_0xe003('0x83')][_0xe003('0x32')](_0xbba85b[_0xe003('0x8c')](),{'type':db['sequelize'][_0xe003('0x84')][_0xe003('0x85')]})[_0xe003('0x25')](function(_0x3ffd37){if(!_0x3ffd37[_0xe003('0x37')]){_0x48fb28=0x0;}else{_0x48fb28=_0x3ffd37[0x0][_0xe003('0x1d')]||0x0;}return db[_0xe003('0x83')]['query'](_0x130b9c['toString'](),{'type':db['sequelize'][_0xe003('0x84')][_0xe003('0x85')]});})[_0xe003('0x25')](function(_0x2669d9){return{'rows':_0x2669d9||[],'count':_0x48fb28};});}});}exports['run']=function(_0x521e07,_0x5cc5a1){return runReport(_0x521e07[_0xe003('0x44')],_0x521e07[_0xe003('0x32')],_0x521e07[_0xe003('0x3e')])[_0xe003('0x25')](respondWithResult(_0x5cc5a1,null))[_0xe003('0x42')](handleError(_0x5cc5a1,null));};exports['runReport']=runReport;exports[_0xe003('0x32')]=function(_0x3d306f,_0x2ae3d6){var _0x4c41b3=0xa;var _0x2401d9=['join',_0xe003('0x50'),_0xe003('0x51'),'cross_join'];var _0x8f1eac={'SUM':_0xe003('0x53'),'COUNT':_0xe003('0x54'),'COUNT DISTINCT':_0xe003('0x55'),'MAX':_0xe003('0x56'),'MIN':_0xe003('0x57'),'AVG':_0xe003('0x58'),'GROUP_CONCAT':_0xe003('0x59'),'GROUP_CONCAT ASC':_0xe003('0x87'),'GROUP_CONCAT DESC':_0xe003('0x5a')};var _0x6b7b76={'SEC_TO_TIME':_0xe003('0x5b'),'DATE':_0xe003('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xe003('0x5e'),'UNIX_TIMESTAMP':_0xe003('0x5f')};var _0x2cda45=function(_0x4ea193){return!_[_0xe003('0x60')](['IS\x20NULL',_0xe003('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4ea193);};var _0x4d8f6b=function(_0x585774){if(!_0x585774||!_0x585774[_0xe003('0x64')][_0xe003('0x37')]){return'';}for(var _0x244b46='(',_0x2eb66a=0x0;_0x2eb66a<_0x585774['rules'][_0xe003('0x37')];_0x2eb66a+=0x1){_0x2eb66a>0x0&&(_0x244b46+='\x20'+_0x585774['operator']+'\x20');_0x244b46+=_0x585774[_0xe003('0x64')][_0x2eb66a][_0xe003('0x66')]?_0x4d8f6b(_0x585774[_0xe003('0x64')][_0x2eb66a][_0xe003('0x66')]):_0x585774[_0xe003('0x64')][_0x2eb66a][_0xe003('0x67')]+'\x20'+_0x585774[_0xe003('0x64')][_0x2eb66a][_0xe003('0x68')]+(_0x2cda45(_0x585774[_0xe003('0x64')][_0x2eb66a][_0xe003('0x68')])?'\x20'+_0x585774['rules'][_0x2eb66a][_0xe003('0x69')]:'');}return _0x244b46+')';};var _0x33ed8a={'where':{'id':_0x3d306f[_0xe003('0x44')]['id']}},_0x733154,_0x51069f,_0x14afa9,_0x48c96c,_0x30be8a;_0x33ed8a=_[_0xe003('0x3a')]({},_0x33ed8a,_0x3d306f[_0xe003('0x3e')]);return db[_0xe003('0x2f')]['find'](_0x33ed8a)['then'](function(_0x3ee1f1){if(_0x3ee1f1){_0x733154=_0x3ee1f1;return _0x3ee1f1[_0xe003('0x6a')]();}return null;})[_0xe003('0x25')](function(_0x2abb28){if(_0x2abb28){if(!_0x2abb28['length']){throw new db['Sequelize'][(_0xe003('0x6c'))](_0xe003('0x6d'),0x193);}_0x51069f=_0x2abb28;return db[_0xe003('0x6e')][_0xe003('0x40')]({'raw':!![]});}return null;})[_0xe003('0x25')](function(_0x382d15){if(_0x382d15){_0x14afa9=_[_0xe003('0x6f')](_0x382d15,'id');var _0x3a3f1;var _0x36d753=squel[_0xe003('0x70')]();_0x36d753[_0xe003('0x89')](_0x733154[_0xe003('0x71')]);for(var _0x12f73c=0x0;_0x12f73c<_0x51069f[_0xe003('0x37')];_0x12f73c+=0x1){_0x3a3f1=_0x51069f[_0x12f73c]['MetricId']?_0x14afa9[_0x51069f[_0x12f73c][_0xe003('0x72')]][_0xe003('0x73')]:_0x51069f[_0x12f73c]['field'];_0x3a3f1=_0x51069f[_0x12f73c][_0xe003('0x74')]?_['replace'](_0x8f1eac[_0x51069f[_0x12f73c][_0xe003('0x74')]],'%s',_0x3a3f1):_0x3a3f1;_0x3a3f1=_0x51069f[_0x12f73c][_0xe003('0x75')]?_[_0xe003('0x76')](_0x6b7b76[_0x51069f[_0x12f73c]['format']],'%s',_0x3a3f1):_0x3a3f1;if(_0x51069f[_0x12f73c][_0xe003('0x8a')]){_0x36d753[_0xe003('0x66')](_0x3a3f1);}_0x51069f[_0x12f73c][_0xe003('0x77')]&&_0x36d753[_0xe003('0x78')](_0x3a3f1,_0x51069f[_0x12f73c][_0xe003('0x77')]===_0xe003('0x79')?![]:!![]);_0x36d753[_0xe003('0x67')](_0x3a3f1,_0x51069f[_0x12f73c][_0xe003('0x7a')]||_0x3a3f1);}if(_0x733154['joins']){_0x733154['joins']=JSON['parse'](_0x733154[_0xe003('0x7b')]);for(var _0x46f35d=0x0;_0x46f35d<_0x733154[_0xe003('0x7b')][_0xe003('0x37')];_0x46f35d+=0x1){if(_0x733154[_0xe003('0x7b')][_0x46f35d][_0xe003('0x7c')]&&_['includes'](_0x2401d9,_0x733154[_0xe003('0x7b')][_0x46f35d]['type'])&&_0x733154[_0xe003('0x7b')][_0x46f35d][_0xe003('0x8b')]&&_0x733154[_0xe003('0x7b')][_0x46f35d]['foreignTable']&&_0x733154[_0xe003('0x7b')][_0x46f35d][_0xe003('0x7f')]){_0x36d753[_0x733154[_0xe003('0x7b')][_0x46f35d]['type']](_0x733154[_0xe003('0x7b')][_0x46f35d]['foreignTable'],null,util[_0xe003('0x75')](_0xe003('0x7e'),_0x733154[_0xe003('0x71')],_0x733154[_0xe003('0x7b')][_0x46f35d]['parentKey'],_0x733154['joins'][_0x46f35d][_0xe003('0x7d')],_0x733154[_0xe003('0x7b')][_0x46f35d][_0xe003('0x7f')]));}}}if(_0x733154[_0xe003('0x80')]){_0x733154[_0xe003('0x80')]=JSON[_0xe003('0x9f')](_0x733154['conditions']);_0x36d753[_0xe003('0x39')](_0x4d8f6b(_0x733154[_0xe003('0x80')][_0xe003('0x66')]));}_0x30be8a=_0x36d753[_0xe003('0xa0')]();_0x36d753[_0xe003('0x1f')](_0x4c41b3);_0x36d753[_0xe003('0x1e')](0x0);logger[_0xe003('0x81')](_0xe003('0x82'),_0x36d753[_0xe003('0x8c')]());return db[_0xe003('0x83')][_0xe003('0x32')](_0x36d753[_0xe003('0x8c')](),{'type':db['sequelize'][_0xe003('0x84')][_0xe003('0x85')]});}})['then'](function(){return{'sql':_0x30be8a[_0xe003('0x8c')]()};})[_0xe003('0x25')](respondWithResult(_0x2ae3d6,null))['catch'](handleError(_0x2ae3d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 45435c2..9cc40f2 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 _0x2ae9=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x2ae9,0xf4));var _0x92ae=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x2ae9[_0x1a13b1];return _0x395e05;};'use strict';var _=require(_0x92ae('0x0'));var util=require('util');var logger=require(_0x92ae('0x1'))('api');var moment=require(_0x92ae('0x2'));var BPromise=require(_0x92ae('0x3'));var rp=require(_0x92ae('0x4'));var fs=require('fs');var path=require(_0x92ae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x92ae('0x6')]=function(_0x23ec9f,_0x314329){return _0x23ec9f[_0x92ae('0x7')](_0x92ae('0x8'),attributes,{'tableName':_0x92ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55db=['moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api'];(function(_0x9de147,_0x2967b3){var _0x5f099e=function(_0x2c49c7){while(--_0x2c49c7){_0x9de147['push'](_0x9de147['shift']());}};_0x5f099e(++_0x2967b3);}(_0x55db,0xf9));var _0xb55d=function(_0xf31be7,_0x4f7537){_0xf31be7=_0xf31be7-0x0;var _0x24b07e=_0x55db[_0xf31be7];return _0x24b07e;};'use strict';var _=require(_0xb55d('0x0'));var util=require(_0xb55d('0x1'));var logger=require('../../config/logger')(_0xb55d('0x2'));var moment=require(_0xb55d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb55d('0x4'));var rimraf=require(_0xb55d('0x5'));var config=require(_0xb55d('0x6'));var attributes=require(_0xb55d('0x7'));module[_0xb55d('0x8')]=function(_0x1f922d,_0x5c5d85){return _0x1f922d[_0xb55d('0x9')](_0xb55d('0xa'),attributes,{'tableName':_0xb55d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 0dca685..c907685 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 _0xf4eb=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x387bd5,_0x2b26e2){var _0x52d738=function(_0x52273d){while(--_0x52273d){_0x387bd5['push'](_0x387bd5['shift']());}};_0x52d738(++_0x2b26e2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x42652b,_0x3aa378){_0x42652b=_0x42652b-0x0;var _0x3d6577=_0xf4eb[_0x42652b];return _0x3d6577;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x0713=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x33aa12,_0x124178){var _0xed2764=function(_0x29d98a){while(--_0x29d98a){_0x33aa12['push'](_0x33aa12['shift']());}};_0xed2764(++_0x124178);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b58bdf7..faceef2 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 _0x0bec=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2ed450,_0x1bfa44){var _0x56f5b9=function(_0x16325d){while(--_0x16325d){_0x2ed450['push'](_0x2ed450['shift']());}};_0x56f5b9(++_0x1bfa44);}(_0x0bec,0x1ae));var _0xc0be=function(_0x56c8e3,_0x1e9a3a){_0x56c8e3=_0x56c8e3-0x0;var _0x439212=_0x0bec[_0x56c8e3];return _0x439212;};'use strict';var multer=require('multer');var util=require(_0xc0be('0x0'));var path=require(_0xc0be('0x1'));var timeout=require(_0xc0be('0x2'));var express=require(_0xc0be('0x3'));var router=express[_0xc0be('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc0be('0x5'));var config=require(_0xc0be('0x6'));var controller=require(_0xc0be('0x7'));router[_0xc0be('0x8')]('/',auth[_0xc0be('0x9')](),controller[_0xc0be('0xa')]);router[_0xc0be('0x8')](_0xc0be('0xb'),auth[_0xc0be('0x9')](),controller[_0xc0be('0xc')]);router[_0xc0be('0x8')](_0xc0be('0xd'),auth[_0xc0be('0x9')](),controller[_0xc0be('0xe')]);router[_0xc0be('0x8')](_0xc0be('0xf'),auth[_0xc0be('0x9')](),controller['run']);router[_0xc0be('0x8')]('/:id/query',auth[_0xc0be('0x9')](),controller[_0xc0be('0x10')]);router[_0xc0be('0x11')]('/',auth[_0xc0be('0x9')](),controller[_0xc0be('0x12')]);router[_0xc0be('0x13')](_0xc0be('0xb'),auth[_0xc0be('0x9')](),controller[_0xc0be('0x14')]);router[_0xc0be('0x15')](_0xc0be('0xb'),auth['isAuthenticated'](),controller[_0xc0be('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1683=['query','post','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','/:id/query'];(function(_0x3c4a62,_0x4ec45d){var _0x5a384b=function(_0x86cf91){while(--_0x86cf91){_0x3c4a62['push'](_0x3c4a62['shift']());}};_0x5a384b(++_0x4ec45d);}(_0x1683,0x167));var _0x3168=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1683[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require(_0x3168('0x0'));var path=require(_0x3168('0x1'));var timeout=require(_0x3168('0x2'));var express=require(_0x3168('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3168('0x4'));var config=require(_0x3168('0x5'));var controller=require(_0x3168('0x6'));router[_0x3168('0x7')]('/',auth[_0x3168('0x8')](),controller['index']);router[_0x3168('0x7')](_0x3168('0x9'),auth['isAuthenticated'](),controller[_0x3168('0xa')]);router[_0x3168('0x7')](_0x3168('0xb'),auth['isAuthenticated'](),controller[_0x3168('0xc')]);router['get']('/:id/run',auth[_0x3168('0x8')](),controller[_0x3168('0xd')]);router[_0x3168('0x7')](_0x3168('0xe'),auth['isAuthenticated'](),controller[_0x3168('0xf')]);router[_0x3168('0x10')]('/',auth[_0x3168('0x8')](),controller[_0x3168('0x11')]);router[_0x3168('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3168('0x13')]);router['delete']('/:id',auth[_0x3168('0x8')](),controller[_0x3168('0x14')]);module[_0x3168('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 047b2bb..d714fc5 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 _0xd844=['manual','scheduled','UNSIGNED','sequelize','exports','ENUM','csv','xlsx','STRING','DATE','Loading'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0xd844,0x9d));var _0x4d84=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd844[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x4d84('0x0'));var moment=require('moment');module[_0x4d84('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x4d84('0x2')](_0x4d84('0x3'),'pdf',_0x4d84('0x4')),'allowNull':![],'defaultValue':_0x4d84('0x3')},'savename':{'type':Sequelize[_0x4d84('0x5')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4d84('0x6')]},'status':{'type':Sequelize[_0x4d84('0x5')],'defaultValue':_0x4d84('0x7')},'type':{'type':Sequelize[_0x4d84('0x2')](_0x4d84('0x8'),_0x4d84('0x9')),'allowNull':![],'defaultValue':_0x4d84('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4d84('0xa')]},'reportType':{'type':Sequelize[_0x4d84('0x5')]}}; \ No newline at end of file +var _0x9b63=['scheduled','manual','INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','ENUM'];(function(_0x5463d1,_0x46bd6e){var _0x25a341=function(_0x26dc5e){while(--_0x26dc5e){_0x5463d1['push'](_0x5463d1['shift']());}};_0x25a341(++_0x46bd6e);}(_0x9b63,0x12f));var _0x39b6=function(_0x175f27,_0x1d61b3){_0x175f27=_0x175f27-0x0;var _0x1b0f31=_0x9b63[_0x175f27];return _0x1b0f31;};'use strict';var Sequelize=require(_0x39b6('0x0'));var moment=require(_0x39b6('0x1'));module[_0x39b6('0x2')]={'name':{'type':Sequelize[_0x39b6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x39b6('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x39b6('0x4'),_0x39b6('0x5'),_0x39b6('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x39b6('0x7')]},'endDate':{'type':Sequelize[_0x39b6('0x7')]},'status':{'type':Sequelize[_0x39b6('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x39b6('0x8')]('manual',_0x39b6('0x9')),'allowNull':![],'defaultValue':_0x39b6('0xa')},'reportId':{'type':Sequelize[_0x39b6('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x39b6('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index cc23a66..7c8055d 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 _0x9f89=['basename','output','toLowerCase','html-pdf','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/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','then','destroy','ExtractedReports','stack','name','send','index','AnalyticExtractedReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','key','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','savename','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','download','join','format','%s.%s'];(function(_0x383064,_0x1d1f10){var _0x11b3fa=function(_0x4d614f){while(--_0x4d614f){_0x383064['push'](_0x383064['shift']());}};_0x11b3fa(++_0x1d1f10);}(_0x9f89,0xc3));var _0x99f8=function(_0x5845fa,_0x376839){_0x5845fa=_0x5845fa-0x0;var _0x3abd60=_0x9f89[_0x5845fa];return _0x3abd60;};'use strict';var pdf=require(_0x99f8('0x0'));var emlformat=require(_0x99f8('0x1'));var rimraf=require(_0x99f8('0x2'));var zipdir=require(_0x99f8('0x3'));var jsonpatch=require(_0x99f8('0x4'));var rp=require(_0x99f8('0x5'));var moment=require(_0x99f8('0x6'));var BPromise=require(_0x99f8('0x7'));var Mustache=require(_0x99f8('0x8'));var util=require(_0x99f8('0x9'));var path=require(_0x99f8('0xa'));var sox=require(_0x99f8('0xb'));var csv=require(_0x99f8('0xc'));var ejs=require(_0x99f8('0xd'));var fs=require('fs');var _=require(_0x99f8('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99f8('0xf'));var deskjs=require(_0x99f8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x99f8('0x11'));var Papa=require(_0x99f8('0x12'));var Redis=require(_0x99f8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x99f8('0x14'));var hardwareService=require(_0x99f8('0x15'));var logger=require(_0x99f8('0x16'))(_0x99f8('0x17'));var utils=require(_0x99f8('0x18'));var config=require(_0x99f8('0x19'));var db=require(_0x99f8('0x1a'))['db'];function respondWithStatusCode(_0x253424,_0x3fc2b3){_0x3fc2b3=_0x3fc2b3||0xcc;return function(_0x3599a0){if(_0x3599a0){return _0x253424[_0x99f8('0x1b')](_0x3fc2b3);}return _0x253424[_0x99f8('0x1c')](_0x3fc2b3)[_0x99f8('0x1d')]();};}function respondWithResult(_0x2b8054,_0x3199fe){_0x3199fe=_0x3199fe||0xc8;return function(_0x2afc70){if(_0x2afc70){return _0x2b8054[_0x99f8('0x1c')](_0x3199fe)['json'](_0x2afc70);}};}function respondWithFilteredResult(_0x18a014,_0x1f9fad){return function(_0x57af49){if(_0x57af49){var _0x386f29=_0x57af49[_0x99f8('0x1e')],_0x2b1870=_0x1f9fad[_0x99f8('0x1f')],_0x18fee7=_0x1f9fad['offset']+_0x1f9fad[_0x99f8('0x20')],_0x39f2c4;if(_0x18fee7>=_0x386f29){_0x18fee7=_0x386f29;_0x39f2c4=0xc8;}else{_0x39f2c4=0xce;}_0x18a014[_0x99f8('0x1c')](_0x39f2c4);return _0x18a014[_0x99f8('0x21')](_0x99f8('0x22'),_0x2b1870+'-'+_0x18fee7+'/'+_0x386f29)[_0x99f8('0x23')](_0x57af49);}return null;};}function patchUpdates(_0x448fe3){return function(_0x5f1048){try{jsonpatch[_0x99f8('0x24')](_0x5f1048,_0x448fe3,!![]);}catch(_0x3f8384){return BPromise[_0x99f8('0x25')](_0x3f8384);}return _0x5f1048['save']();};}function saveUpdates(_0x1863a1,_0x3bf5aa){return function(_0x901cb7){if(_0x901cb7){return _0x901cb7[_0x99f8('0x26')](_0x1863a1)[_0x99f8('0x27')](function(_0x3a038a){return _0x3a038a;});}return null;};}function removeEntity(_0x54435a,_0x4c6888){return function(_0x53c021){if(_0x53c021){return _0x53c021[_0x99f8('0x28')]()[_0x99f8('0x27')](function(){var _0x4a7b31=_0x53c021['get']({'plain':!![]});var _0x25a09d=_0x99f8('0x29');return db['UserProfileResource'][_0x99f8('0x28')]({'where':{'type':_0x25a09d,'resourceId':_0x4a7b31['id']}})[_0x99f8('0x27')](function(){return _0x53c021;});})[_0x99f8('0x27')](function(){_0x54435a[_0x99f8('0x1c')](0xcc)[_0x99f8('0x1d')]();});}};}function handleEntityNotFound(_0x5ad8b0,_0x5d1598){return function(_0x3ce8f0){if(!_0x3ce8f0){_0x5ad8b0[_0x99f8('0x1b')](0x194);}return _0x3ce8f0;};}function handleError(_0x56452d,_0x3cb66e){_0x3cb66e=_0x3cb66e||0x1f4;return function(_0x52e139){logger['error'](_0x52e139[_0x99f8('0x2a')]);if(_0x52e139[_0x99f8('0x2b')]){delete _0x52e139[_0x99f8('0x2b')];}_0x56452d[_0x99f8('0x1c')](_0x3cb66e)[_0x99f8('0x2c')](_0x52e139);};}exports[_0x99f8('0x2d')]=function(_0x1a5b78,_0x53d926){var _0x5bf6a4={},_0x3457a5={},_0x371922={'count':0x0,'rows':[]};var _0x166d06=db[_0x99f8('0x2e')][_0x99f8('0x2f')];_0x3457a5['model']=_[_0x99f8('0x30')](_0x166d06);_0x3457a5['query']=_['keys'](_0x1a5b78[_0x99f8('0x31')]);_0x3457a5[_0x99f8('0x32')]=_['intersection'](_0x3457a5[_0x99f8('0x33')],_0x3457a5[_0x99f8('0x31')]);_0x5bf6a4[_0x99f8('0x34')]=_[_0x99f8('0x35')](_0x3457a5[_0x99f8('0x33')],qs[_0x99f8('0x36')](_0x1a5b78['query'][_0x99f8('0x36')]));_0x5bf6a4['attributes']=_0x5bf6a4[_0x99f8('0x34')]['length']?_0x5bf6a4['attributes']:_0x3457a5[_0x99f8('0x33')];if(!_0x1a5b78[_0x99f8('0x31')]['hasOwnProperty'](_0x99f8('0x37'))){_0x5bf6a4[_0x99f8('0x20')]=qs[_0x99f8('0x20')](_0x1a5b78[_0x99f8('0x31')][_0x99f8('0x20')]);_0x5bf6a4[_0x99f8('0x1f')]=qs[_0x99f8('0x1f')](_0x1a5b78[_0x99f8('0x31')][_0x99f8('0x1f')]);}_0x5bf6a4[_0x99f8('0x38')]=qs['sort'](_0x1a5b78[_0x99f8('0x31')][_0x99f8('0x39')]);_0x5bf6a4[_0x99f8('0x3a')]=qs[_0x99f8('0x32')](_[_0x99f8('0x3b')](_0x1a5b78[_0x99f8('0x31')],_0x3457a5[_0x99f8('0x32')]));if(_0x1a5b78[_0x99f8('0x31')][_0x99f8('0x3c')]){_0x5bf6a4[_0x99f8('0x3a')]=_[_0x99f8('0x3d')](_0x5bf6a4[_0x99f8('0x3a')],{'$or':_['map'](_0x166d06,function(_0x25ea33){if(_0x25ea33['type'][_0x99f8('0x3e')]!=='VIRTUAL'){var _0x38a037={};_0x38a037[_0x25ea33['field']]={'$like':'%'+_0x1a5b78[_0x99f8('0x31')][_0x99f8('0x3c')]+'%'};return _0x38a037;}})});}_0x5bf6a4=_['merge']({},_0x5bf6a4,_0x1a5b78[_0x99f8('0x3f')]);var _0x39dd01={'where':_0x5bf6a4[_0x99f8('0x3a')]};return db[_0x99f8('0x2e')]['count'](_0x39dd01)[_0x99f8('0x27')](function(_0x2c2428){_0x371922[_0x99f8('0x1e')]=_0x2c2428;if(_0x1a5b78[_0x99f8('0x31')]['includeAll']){_0x5bf6a4[_0x99f8('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x99f8('0x41')](_0x5bf6a4);})[_0x99f8('0x27')](function(_0x341af6){_0x371922[_0x99f8('0x42')]=_0x341af6;return _0x371922;})['then'](respondWithFilteredResult(_0x53d926,_0x5bf6a4))['catch'](handleError(_0x53d926,null));};exports[_0x99f8('0x43')]=function(_0x4c6dc0,_0x356651){var _0x5e801c={'raw':!![],'where':{'id':_0x4c6dc0[_0x99f8('0x44')]['id']}},_0x572dd5={};_0x572dd5[_0x99f8('0x33')]=_[_0x99f8('0x30')](db[_0x99f8('0x2e')][_0x99f8('0x2f')]);_0x572dd5[_0x99f8('0x31')]=_[_0x99f8('0x30')](_0x4c6dc0['query']);_0x572dd5[_0x99f8('0x32')]=_[_0x99f8('0x35')](_0x572dd5[_0x99f8('0x33')],_0x572dd5[_0x99f8('0x31')]);_0x5e801c[_0x99f8('0x34')]=_[_0x99f8('0x35')](_0x572dd5[_0x99f8('0x33')],qs['fields'](_0x4c6dc0[_0x99f8('0x31')]['fields']));_0x5e801c[_0x99f8('0x34')]=_0x5e801c[_0x99f8('0x34')][_0x99f8('0x45')]?_0x5e801c[_0x99f8('0x34')]:_0x572dd5[_0x99f8('0x33')];if(_0x4c6dc0[_0x99f8('0x31')][_0x99f8('0x46')]){_0x5e801c[_0x99f8('0x40')]=[{'all':!![]}];}_0x5e801c=_[_0x99f8('0x3d')]({},_0x5e801c,_0x4c6dc0[_0x99f8('0x3f')]);return db[_0x99f8('0x2e')][_0x99f8('0x47')](_0x5e801c)['then'](handleEntityNotFound(_0x356651,null))[_0x99f8('0x27')](respondWithResult(_0x356651,null))[_0x99f8('0x48')](handleError(_0x356651,null));};exports[_0x99f8('0x49')]=function(_0x1f837f,_0x5453ed){return db[_0x99f8('0x2e')][_0x99f8('0x49')](_0x1f837f[_0x99f8('0x4a')],{})[_0x99f8('0x27')](function(_0x422714){var _0x3b96d2=_0x1f837f[_0x99f8('0x4b')][_0x99f8('0x4c')]({'plain':!![]});if(!_0x3b96d2)throw new Error(_0x99f8('0x4d'));if(_0x3b96d2[_0x99f8('0x4e')]===_0x99f8('0x4b')){var _0x1fa3e0=_0x422714['get']({'plain':!![]});var _0x5969cb='ExtractedReports';return db[_0x99f8('0x4f')]['find']({'where':{'name':_0x5969cb,'userProfileId':_0x3b96d2[_0x99f8('0x50')]},'raw':!![]})[_0x99f8('0x27')](function(_0x59414e){if(_0x59414e&&_0x59414e['autoAssociation']===0x0){return db[_0x99f8('0x51')]['create']({'name':_0x1fa3e0[_0x99f8('0x2b')],'resourceId':_0x1fa3e0['id'],'type':_0x59414e[_0x99f8('0x2b')],'sectionId':_0x59414e['id']},{})[_0x99f8('0x27')](function(){return _0x422714;});}else{return _0x422714;}})['catch'](function(_0x1f8ef0){logger[_0x99f8('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f8ef0);throw _0x1f8ef0;});}return _0x422714;})['then'](respondWithResult(_0x5453ed,0xc9))['catch'](handleError(_0x5453ed,null));};exports['update']=function(_0x578bf5,_0x5579e4){if(_0x578bf5[_0x99f8('0x4a')]['id']){delete _0x578bf5[_0x99f8('0x4a')]['id'];}return db[_0x99f8('0x2e')][_0x99f8('0x47')]({'where':{'id':_0x578bf5['params']['id']}})[_0x99f8('0x27')](handleEntityNotFound(_0x5579e4,null))[_0x99f8('0x27')](saveUpdates(_0x578bf5['body'],null))['then'](respondWithResult(_0x5579e4,null))[_0x99f8('0x48')](handleError(_0x5579e4,null));};exports[_0x99f8('0x28')]=function(_0x14477a,_0x383fd0){return db[_0x99f8('0x2e')]['find']({'where':{'id':_0x14477a[_0x99f8('0x44')]['id']}})['then'](handleEntityNotFound(_0x383fd0,null))['then'](removeEntity(_0x383fd0,null))[_0x99f8('0x48')](handleError(_0x383fd0,null));};exports['download']=function(_0x5bf6d1,_0x1cb6e0,_0x2e6fd9){return db[_0x99f8('0x2e')]['find']({'where':{'id':_0x5bf6d1[_0x99f8('0x44')]['id']},'attributes':[_0x99f8('0x2b'),'basename',_0x99f8('0x53'),'output'],'raw':!![]})[_0x99f8('0x27')](handleEntityNotFound(_0x1cb6e0,null))[_0x99f8('0x27')](function(_0xcd338f){if(_0xcd338f){if(!fs[_0x99f8('0x54')](path['join'](config[_0x99f8('0x55')],_0x99f8('0x56'),_0xcd338f[_0x99f8('0x53')]))){throw new db['Sequelize'][(_0x99f8('0x57'))](_0x99f8('0x58'));}if(_0x5bf6d1[_0x99f8('0x31')]['exists']){return _0x1cb6e0[_0x99f8('0x1b')](0xc8);}return _0x1cb6e0[_0x99f8('0x59')](path[_0x99f8('0x5a')](config[_0x99f8('0x55')],'server/files/reports',_0xcd338f[_0x99f8('0x53')]),util[_0x99f8('0x5b')](_0x99f8('0x5c'),_0xcd338f[_0x99f8('0x5d')]||_0xcd338f[_0x99f8('0x2b')],_0xcd338f[_0x99f8('0x5e')][_0x99f8('0x5f')]()));}})[_0x99f8('0x48')](handleError(_0x1cb6e0,null));}; \ No newline at end of file +var _0xacc1=['status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','params','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','download','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','basename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus'];(function(_0x38c986,_0x395a66){var _0x481915=function(_0x256dad){while(--_0x256dad){_0x38c986['push'](_0x38c986['shift']());}};_0x481915(++_0x395a66);}(_0xacc1,0xa5));var _0x1acc=function(_0x63b6d3,_0x13c87d){_0x63b6d3=_0x63b6d3-0x0;var _0x41a70c=_0xacc1[_0x63b6d3];return _0x41a70c;};'use strict';var pdf=require(_0x1acc('0x0'));var emlformat=require(_0x1acc('0x1'));var rimraf=require(_0x1acc('0x2'));var zipdir=require(_0x1acc('0x3'));var jsonpatch=require(_0x1acc('0x4'));var rp=require(_0x1acc('0x5'));var moment=require(_0x1acc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1acc('0x7'));var util=require(_0x1acc('0x8'));var path=require(_0x1acc('0x9'));var sox=require(_0x1acc('0xa'));var csv=require('to-csv');var ejs=require(_0x1acc('0xb'));var fs=require('fs');var _=require(_0x1acc('0xc'));var squel=require(_0x1acc('0xd'));var crypto=require(_0x1acc('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1acc('0xf'));var querystring=require('querystring');var Papa=require(_0x1acc('0x10'));var Redis=require(_0x1acc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1acc('0x12'));var hardwareService=require(_0x1acc('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1acc('0x14'));var db=require(_0x1acc('0x15'))['db'];function respondWithStatusCode(_0x3787fc,_0x58dc83){_0x58dc83=_0x58dc83||0xcc;return function(_0x4157f7){if(_0x4157f7){return _0x3787fc[_0x1acc('0x16')](_0x58dc83);}return _0x3787fc[_0x1acc('0x17')](_0x58dc83)[_0x1acc('0x18')]();};}function respondWithResult(_0x28d55b,_0x5cbe3c){_0x5cbe3c=_0x5cbe3c||0xc8;return function(_0x1f43d1){if(_0x1f43d1){return _0x28d55b[_0x1acc('0x17')](_0x5cbe3c)['json'](_0x1f43d1);}};}function respondWithFilteredResult(_0x5b25b4,_0x1d0000){return function(_0x401983){if(_0x401983){var _0x8fa97a=_0x401983[_0x1acc('0x19')],_0x5234c6=_0x1d0000[_0x1acc('0x1a')],_0x13c715=_0x1d0000[_0x1acc('0x1a')]+_0x1d0000[_0x1acc('0x1b')],_0x30f2fe;if(_0x13c715>=_0x8fa97a){_0x13c715=_0x8fa97a;_0x30f2fe=0xc8;}else{_0x30f2fe=0xce;}_0x5b25b4[_0x1acc('0x17')](_0x30f2fe);return _0x5b25b4[_0x1acc('0x1c')](_0x1acc('0x1d'),_0x5234c6+'-'+_0x13c715+'/'+_0x8fa97a)['json'](_0x401983);}return null;};}function patchUpdates(_0x4c6af9){return function(_0x464b89){try{jsonpatch[_0x1acc('0x1e')](_0x464b89,_0x4c6af9,!![]);}catch(_0x574626){return BPromise['reject'](_0x574626);}return _0x464b89[_0x1acc('0x1f')]();};}function saveUpdates(_0x3dc743,_0x16cf8e){return function(_0x533109){if(_0x533109){return _0x533109[_0x1acc('0x20')](_0x3dc743)[_0x1acc('0x21')](function(_0x24eb41){return _0x24eb41;});}return null;};}function removeEntity(_0x5000f0,_0x359b5f){return function(_0x5681e7){if(_0x5681e7){return _0x5681e7[_0x1acc('0x22')]()[_0x1acc('0x21')](function(){var _0x461350=_0x5681e7[_0x1acc('0x23')]({'plain':!![]});var _0x5dd4e7=_0x1acc('0x24');return db[_0x1acc('0x25')][_0x1acc('0x22')]({'where':{'type':_0x5dd4e7,'resourceId':_0x461350['id']}})[_0x1acc('0x21')](function(){return _0x5681e7;});})[_0x1acc('0x21')](function(){_0x5000f0[_0x1acc('0x17')](0xcc)[_0x1acc('0x18')]();});}};}function handleEntityNotFound(_0x53533c,_0x1ed3cd){return function(_0x2d5a5f){if(!_0x2d5a5f){_0x53533c[_0x1acc('0x16')](0x194);}return _0x2d5a5f;};}function handleError(_0x3296db,_0xc5a46a){_0xc5a46a=_0xc5a46a||0x1f4;return function(_0x35ad1a){logger['error'](_0x35ad1a[_0x1acc('0x26')]);if(_0x35ad1a[_0x1acc('0x27')]){delete _0x35ad1a[_0x1acc('0x27')];}_0x3296db[_0x1acc('0x17')](_0xc5a46a)[_0x1acc('0x28')](_0x35ad1a);};}exports[_0x1acc('0x29')]=function(_0x3e04fe,_0x1f6508){var _0xd187e={},_0xcec9e1={},_0x1ee6c1={'count':0x0,'rows':[]};var _0x106ecf=db[_0x1acc('0x2a')][_0x1acc('0x2b')];_0xcec9e1[_0x1acc('0x2c')]=_['keys'](_0x106ecf);_0xcec9e1[_0x1acc('0x2d')]=_[_0x1acc('0x2e')](_0x3e04fe[_0x1acc('0x2d')]);_0xcec9e1['filters']=_[_0x1acc('0x2f')](_0xcec9e1[_0x1acc('0x2c')],_0xcec9e1[_0x1acc('0x2d')]);_0xd187e[_0x1acc('0x30')]=_[_0x1acc('0x2f')](_0xcec9e1[_0x1acc('0x2c')],qs['fields'](_0x3e04fe[_0x1acc('0x2d')]['fields']));_0xd187e['attributes']=_0xd187e[_0x1acc('0x30')][_0x1acc('0x31')]?_0xd187e[_0x1acc('0x30')]:_0xcec9e1[_0x1acc('0x2c')];if(!_0x3e04fe[_0x1acc('0x2d')][_0x1acc('0x32')](_0x1acc('0x33'))){_0xd187e['limit']=qs[_0x1acc('0x1b')](_0x3e04fe[_0x1acc('0x2d')][_0x1acc('0x1b')]);_0xd187e[_0x1acc('0x1a')]=qs[_0x1acc('0x1a')](_0x3e04fe[_0x1acc('0x2d')][_0x1acc('0x1a')]);}_0xd187e[_0x1acc('0x34')]=qs[_0x1acc('0x35')](_0x3e04fe[_0x1acc('0x2d')][_0x1acc('0x35')]);_0xd187e[_0x1acc('0x36')]=qs[_0x1acc('0x37')](_[_0x1acc('0x38')](_0x3e04fe[_0x1acc('0x2d')],_0xcec9e1['filters']));if(_0x3e04fe['query'][_0x1acc('0x39')]){_0xd187e['where']=_[_0x1acc('0x3a')](_0xd187e[_0x1acc('0x36')],{'$or':_[_0x1acc('0x3b')](_0x106ecf,function(_0x1b0da8){if(_0x1b0da8[_0x1acc('0x3c')][_0x1acc('0x3d')]!=='VIRTUAL'){var _0x2908de={};_0x2908de[_0x1b0da8[_0x1acc('0x3e')]]={'$like':'%'+_0x3e04fe['query'][_0x1acc('0x39')]+'%'};return _0x2908de;}})});}_0xd187e=_[_0x1acc('0x3a')]({},_0xd187e,_0x3e04fe[_0x1acc('0x3f')]);var _0x3566bb={'where':_0xd187e[_0x1acc('0x36')]};return db[_0x1acc('0x2a')][_0x1acc('0x19')](_0x3566bb)[_0x1acc('0x21')](function(_0x2ddd10){_0x1ee6c1[_0x1acc('0x19')]=_0x2ddd10;if(_0x3e04fe[_0x1acc('0x2d')][_0x1acc('0x40')]){_0xd187e['include']=[{'all':!![]}];}return db[_0x1acc('0x2a')][_0x1acc('0x41')](_0xd187e);})[_0x1acc('0x21')](function(_0x1d776f){_0x1ee6c1[_0x1acc('0x42')]=_0x1d776f;return _0x1ee6c1;})[_0x1acc('0x21')](respondWithFilteredResult(_0x1f6508,_0xd187e))[_0x1acc('0x43')](handleError(_0x1f6508,null));};exports[_0x1acc('0x44')]=function(_0x42a121,_0x5164be){var _0x5eb315={'raw':!![],'where':{'id':_0x42a121[_0x1acc('0x45')]['id']}},_0x49f411={};_0x49f411[_0x1acc('0x2c')]=_[_0x1acc('0x2e')](db['AnalyticExtractedReport'][_0x1acc('0x2b')]);_0x49f411[_0x1acc('0x2d')]=_[_0x1acc('0x2e')](_0x42a121['query']);_0x49f411[_0x1acc('0x37')]=_['intersection'](_0x49f411[_0x1acc('0x2c')],_0x49f411['query']);_0x5eb315[_0x1acc('0x30')]=_[_0x1acc('0x2f')](_0x49f411[_0x1acc('0x2c')],qs['fields'](_0x42a121['query']['fields']));_0x5eb315[_0x1acc('0x30')]=_0x5eb315[_0x1acc('0x30')][_0x1acc('0x31')]?_0x5eb315[_0x1acc('0x30')]:_0x49f411['model'];if(_0x42a121[_0x1acc('0x2d')][_0x1acc('0x40')]){_0x5eb315[_0x1acc('0x46')]=[{'all':!![]}];}_0x5eb315=_['merge']({},_0x5eb315,_0x42a121['options']);return db[_0x1acc('0x2a')][_0x1acc('0x47')](_0x5eb315)['then'](handleEntityNotFound(_0x5164be,null))[_0x1acc('0x21')](respondWithResult(_0x5164be,null))[_0x1acc('0x43')](handleError(_0x5164be,null));};exports[_0x1acc('0x48')]=function(_0x9b3cc0,_0x2f365f){return db[_0x1acc('0x2a')][_0x1acc('0x48')](_0x9b3cc0[_0x1acc('0x49')],{})[_0x1acc('0x21')](function(_0x41d2e3){var _0x574009=_0x9b3cc0[_0x1acc('0x4a')][_0x1acc('0x23')]({'plain':!![]});if(!_0x574009)throw new Error(_0x1acc('0x4b'));if(_0x574009[_0x1acc('0x4c')]===_0x1acc('0x4a')){var _0x341cd5=_0x41d2e3[_0x1acc('0x23')]({'plain':!![]});var _0x141a92=_0x1acc('0x24');return db[_0x1acc('0x4d')]['find']({'where':{'name':_0x141a92,'userProfileId':_0x574009[_0x1acc('0x4e')]},'raw':!![]})['then'](function(_0x4c7e76){if(_0x4c7e76&&_0x4c7e76[_0x1acc('0x4f')]===0x0){return db[_0x1acc('0x25')][_0x1acc('0x48')]({'name':_0x341cd5['name'],'resourceId':_0x341cd5['id'],'type':_0x4c7e76[_0x1acc('0x27')],'sectionId':_0x4c7e76['id']},{})[_0x1acc('0x21')](function(){return _0x41d2e3;});}else{return _0x41d2e3;}})['catch'](function(_0x576122){logger['error'](_0x1acc('0x50'),_0x576122);throw _0x576122;});}return _0x41d2e3;})[_0x1acc('0x21')](respondWithResult(_0x2f365f,0xc9))['catch'](handleError(_0x2f365f,null));};exports[_0x1acc('0x20')]=function(_0x52c6af,_0x327c14){if(_0x52c6af[_0x1acc('0x49')]['id']){delete _0x52c6af[_0x1acc('0x49')]['id'];}return db[_0x1acc('0x2a')]['find']({'where':{'id':_0x52c6af['params']['id']}})[_0x1acc('0x21')](handleEntityNotFound(_0x327c14,null))['then'](saveUpdates(_0x52c6af[_0x1acc('0x49')],null))[_0x1acc('0x21')](respondWithResult(_0x327c14,null))[_0x1acc('0x43')](handleError(_0x327c14,null));};exports[_0x1acc('0x22')]=function(_0xe7c1f5,_0x2267f2){return db[_0x1acc('0x2a')]['find']({'where':{'id':_0xe7c1f5[_0x1acc('0x45')]['id']}})[_0x1acc('0x21')](handleEntityNotFound(_0x2267f2,null))['then'](removeEntity(_0x2267f2,null))[_0x1acc('0x43')](handleError(_0x2267f2,null));};exports[_0x1acc('0x51')]=function(_0x15f654,_0x4ba542,_0x54b2fe){return db['AnalyticExtractedReport'][_0x1acc('0x47')]({'where':{'id':_0x15f654[_0x1acc('0x45')]['id']},'attributes':['name','basename',_0x1acc('0x52'),_0x1acc('0x53')],'raw':!![]})[_0x1acc('0x21')](handleEntityNotFound(_0x4ba542,null))[_0x1acc('0x21')](function(_0xe2c65b){if(_0xe2c65b){if(!fs[_0x1acc('0x54')](path['join'](config['root'],_0x1acc('0x55'),_0xe2c65b[_0x1acc('0x52')]))){throw new db[(_0x1acc('0x56'))][(_0x1acc('0x57'))](_0x1acc('0x58'));}if(_0x15f654[_0x1acc('0x2d')][_0x1acc('0x59')]){return _0x4ba542['sendStatus'](0xc8);}return _0x4ba542[_0x1acc('0x51')](path['join'](config[_0x1acc('0x5a')],'server/files/reports',_0xe2c65b['savename']),util[_0x1acc('0x5b')](_0x1acc('0x5c'),_0xe2c65b[_0x1acc('0x5d')]||_0xe2c65b['name'],_0xe2c65b[_0x1acc('0x53')]['toLowerCase']()));}})[_0x1acc('0x43')](handleError(_0x4ba542,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b62c48c..f54f5dd 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 _0xf006=['bluebird','path','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','../../config/logger','api'];(function(_0x4617b1,_0x2ad6fe){var _0x8c788d=function(_0x49d899){while(--_0x49d899){_0x4617b1['push'](_0x4617b1['shift']());}};_0x8c788d(++_0x2ad6fe);}(_0xf006,0x146));var _0x6f00=function(_0x3f546a,_0x352d20){_0x3f546a=_0x3f546a-0x0;var _0x4bd264=_0xf006[_0x3f546a];return _0x4bd264;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('AnalyticExtractedReport',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x32bd61,_0x46bacf){var _0x4eaf93=function(_0x434359){while(--_0x434359){_0x32bd61['push'](_0x32bd61['shift']());}};_0x4eaf93(++_0x46bacf);}(_0x1cb9,0x14e));var _0x91cb=function(_0x353d5e,_0x33ad9e){_0x353d5e=_0x353d5e-0x0;var _0x266fae=_0x1cb9[_0x353d5e];return _0x266fae;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('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 ee4199a..859a71f 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 _0x9062=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment'];(function(_0xf23c02,_0x1c997e){var _0x292dd9=function(_0x1a525f){while(--_0x1a525f){_0xf23c02['push'](_0xf23c02['shift']());}};_0x292dd9(++_0x1c997e);}(_0x9062,0x1b6));var _0x2906=function(_0x231ce0,_0x185e39){_0x231ce0=_0x231ce0-0x0;var _0x3efe64=_0x9062[_0x231ce0];return _0x3efe64;};'use strict';var _=require('lodash');var util=require(_0x2906('0x0'));var moment=require(_0x2906('0x1'));var BPromise=require(_0x2906('0x2'));var rs=require(_0x2906('0x3'));var fs=require('fs');var Redis=require(_0x2906('0x4'));var db=require(_0x2906('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2906('0x6'));var config=require('../../config/environment');var jayson=require(_0x2906('0x7'));var client=jayson['client'][_0x2906('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x862205,_0xa3ba72,_0x5b4dea){return new BPromise(function(_0x156f6c,_0x224c50){return client[_0x2906('0x9')](_0x862205,_0x5b4dea)[_0x2906('0xa')](function(_0x4295c7){logger[_0x2906('0xb')](_0x2906('0xc'),_0xa3ba72,_0x2906('0xd'));logger['debug'](_0x2906('0xe'),_0xa3ba72,'request\x20sent',JSON[_0x2906('0xf')](_0x4295c7));if(_0x4295c7['error']){if(_0x4295c7[_0x2906('0x10')][_0x2906('0x11')]===0x1f4){logger['error'](_0x2906('0xc'),_0xa3ba72,_0x4295c7[_0x2906('0x10')][_0x2906('0x12')]);return _0x224c50(_0x4295c7[_0x2906('0x10')][_0x2906('0x12')]);}logger[_0x2906('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xa3ba72,_0x4295c7[_0x2906('0x10')][_0x2906('0x12')]);return _0x156f6c(_0x4295c7[_0x2906('0x10')][_0x2906('0x12')]);}else{logger[_0x2906('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xa3ba72,_0x2906('0xd'));_0x156f6c(_0x4295c7['result'][_0x2906('0x12')]);}})[_0x2906('0x13')](function(_0x37cfa1){logger[_0x2906('0x10')](_0x2906('0xc'),_0xa3ba72,_0x37cfa1);_0x224c50(_0x37cfa1);});});} \ No newline at end of file +var _0xc3b9=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','info','result'];(function(_0x1e028c,_0x2bd5b0){var _0x336831=function(_0x506de1){while(--_0x506de1){_0x1e028c['push'](_0x1e028c['shift']());}};_0x336831(++_0x2bd5b0);}(_0xc3b9,0x14a));var _0x9c3b=function(_0x3f097c,_0x32f99f){_0x3f097c=_0x3f097c-0x0;var _0x524678=_0xc3b9[_0x3f097c];return _0x524678;};'use strict';var _=require('lodash');var util=require(_0x9c3b('0x0'));var moment=require(_0x9c3b('0x1'));var BPromise=require('bluebird');var rs=require(_0x9c3b('0x2'));var fs=require('fs');var Redis=require(_0x9c3b('0x3'));var db=require(_0x9c3b('0x4'))['db'];var utils=require(_0x9c3b('0x5'));var logger=require(_0x9c3b('0x6'))(_0x9c3b('0x7'));var config=require(_0x9c3b('0x8'));var jayson=require(_0x9c3b('0x9'));var client=jayson[_0x9c3b('0xa')][_0x9c3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x321f9d,_0x2802a7,_0x10ac3c){return new BPromise(function(_0x2bf97f,_0x518c51){return client[_0x9c3b('0xc')](_0x321f9d,_0x10ac3c)[_0x9c3b('0xd')](function(_0x393f7c){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2802a7,'request\x20sent');logger['debug'](_0x9c3b('0xe'),_0x2802a7,_0x9c3b('0xf'),JSON['stringify'](_0x393f7c));if(_0x393f7c[_0x9c3b('0x10')]){if(_0x393f7c['error'][_0x9c3b('0x11')]===0x1f4){logger[_0x9c3b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2802a7,_0x393f7c[_0x9c3b('0x10')][_0x9c3b('0x12')]);return _0x518c51(_0x393f7c['error'][_0x9c3b('0x12')]);}logger['error'](_0x9c3b('0x13'),_0x2802a7,_0x393f7c['error']['message']);return _0x2bf97f(_0x393f7c[_0x9c3b('0x10')]['message']);}else{logger[_0x9c3b('0x14')](_0x9c3b('0x13'),_0x2802a7,_0x9c3b('0xf'));_0x2bf97f(_0x393f7c[_0x9c3b('0x15')]['message']);}})['catch'](function(_0x5a42cf){logger[_0x9c3b('0x10')](_0x9c3b('0x13'),_0x2802a7,_0x5a42cf);_0x518c51(_0x5a42cf);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2aaf61b..1eb5436 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 _0xbe38=['../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xbe38,0x1a4));var _0x8be3=function(_0x3b10df,_0x46d3ec){_0x3b10df=_0x3b10df-0x0;var _0x50501e=_0xbe38[_0x3b10df];return _0x50501e;};'use strict';var multer=require(_0x8be3('0x0'));var util=require('util');var path=require(_0x8be3('0x1'));var timeout=require(_0x8be3('0x2'));var express=require(_0x8be3('0x3'));var router=express[_0x8be3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8be3('0x5'));var config=require('../../config/environment');var controller=require(_0x8be3('0x6'));router[_0x8be3('0x7')]('/',auth[_0x8be3('0x8')](),controller[_0x8be3('0x9')]);router[_0x8be3('0x7')](_0x8be3('0xa'),auth[_0x8be3('0x8')](),controller[_0x8be3('0xb')]);router['get'](_0x8be3('0xc'),auth[_0x8be3('0x8')](),controller[_0x8be3('0xd')]);router['post']('/',auth[_0x8be3('0x8')](),controller[_0x8be3('0xe')]);router['put'](_0x8be3('0xa'),auth[_0x8be3('0x8')](),controller['update']);router['delete']('/:id',auth[_0x8be3('0x8')](),controller[_0x8be3('0xf')]);module[_0x8be3('0x10')]=router; \ No newline at end of file +var _0x4cac=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1b78fd,_0x14e7aa){var _0x25ee7b=function(_0x10834d){while(--_0x10834d){_0x1b78fd['push'](_0x1b78fd['shift']());}};_0x25ee7b(++_0x14e7aa);}(_0x4cac,0x162));var _0xc4ca=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4cac[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc4ca('0x0'));var util=require(_0xc4ca('0x1'));var path=require('path');var timeout=require(_0xc4ca('0x2'));var express=require(_0xc4ca('0x3'));var router=express['Router']();var auth=require(_0xc4ca('0x4'));var interaction=require(_0xc4ca('0x5'));var config=require(_0xc4ca('0x6'));var controller=require(_0xc4ca('0x7'));router[_0xc4ca('0x8')]('/',auth[_0xc4ca('0x9')](),controller[_0xc4ca('0xa')]);router[_0xc4ca('0x8')](_0xc4ca('0xb'),auth[_0xc4ca('0x9')](),controller[_0xc4ca('0xc')]);router[_0xc4ca('0x8')](_0xc4ca('0xd'),auth[_0xc4ca('0x9')](),controller[_0xc4ca('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc4ca('0xf')]);router['put'](_0xc4ca('0xb'),auth['isAuthenticated'](),controller[_0xc4ca('0x10')]);router['delete']('/:id',auth[_0xc4ca('0x9')](),controller[_0xc4ca('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4258aec..8f087a9 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 _0x2fd2=['BOOLEAN','exports','STRING'];(function(_0x5f35cf,_0x2cad3d){var _0x1fa6f7=function(_0x3509dc){while(--_0x3509dc){_0x5f35cf['push'](_0x5f35cf['shift']());}};_0x1fa6f7(++_0x2cad3d);}(_0x2fd2,0xa6));var _0x22fd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2fd2[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x22fd('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x22fd('0x1')]},'function':{'type':Sequelize[_0x22fd('0x1')]},'format':{'type':Sequelize[_0x22fd('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x22fd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x240f=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1721a9,_0x119ace){var _0x13637f=function(_0x4f60cd){while(--_0x4f60cd){_0x1721a9['push'](_0x1721a9['shift']());}};_0x13637f(++_0x119ace);}(_0x240f,0x1a8));var _0xf240=function(_0x291b25,_0x176374){_0x291b25=_0x291b25-0x0;var _0x5f72dd=_0x240f[_0x291b25];return _0x5f72dd;};'use strict';var Sequelize=require(_0xf240('0x0'));module[_0xf240('0x1')]={'field':{'type':Sequelize[_0xf240('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf240('0x3')]},'groupBy':{'type':Sequelize[_0xf240('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf240('0x3')]},'custom':{'type':Sequelize[_0xf240('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index c0e4270..394bb38 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 _0x2015=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','catch','show','params','find','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x3e7b8f,_0x132ade){var _0x1d2812=function(_0x116646){while(--_0x116646){_0x3e7b8f['push'](_0x3e7b8f['shift']());}};_0x1d2812(++_0x132ade);}(_0x2015,0x193));var _0x5201=function(_0x421e16,_0x426402){_0x421e16=_0x421e16-0x0;var _0x21dd8e=_0x2015[_0x421e16];return _0x21dd8e;};'use strict';var pdf=require(_0x5201('0x0'));var emlformat=require(_0x5201('0x1'));var rimraf=require(_0x5201('0x2'));var zipdir=require(_0x5201('0x3'));var jsonpatch=require(_0x5201('0x4'));var rp=require(_0x5201('0x5'));var moment=require(_0x5201('0x6'));var BPromise=require(_0x5201('0x7'));var Mustache=require('mustache');var util=require(_0x5201('0x8'));var path=require(_0x5201('0x9'));var sox=require(_0x5201('0xa'));var csv=require(_0x5201('0xb'));var ejs=require(_0x5201('0xc'));var fs=require('fs');var _=require(_0x5201('0xd'));var squel=require(_0x5201('0xe'));var crypto=require(_0x5201('0xf'));var jsforce=require(_0x5201('0x10'));var deskjs=require(_0x5201('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5201('0x12'));var Papa=require(_0x5201('0x13'));var Redis=require('ioredis');var authService=require(_0x5201('0x14'));var qs=require(_0x5201('0x15'));var hardwareService=require(_0x5201('0x16'));var logger=require('../../config/logger')(_0x5201('0x17'));var utils=require(_0x5201('0x18'));var config=require(_0x5201('0x19'));var db=require(_0x5201('0x1a'))['db'];function respondWithStatusCode(_0x2cfa0a,_0x26677a){_0x26677a=_0x26677a||0xcc;return function(_0x2038a9){if(_0x2038a9){return _0x2cfa0a[_0x5201('0x1b')](_0x26677a);}return _0x2cfa0a[_0x5201('0x1c')](_0x26677a)[_0x5201('0x1d')]();};}function respondWithResult(_0x341ea8,_0x6629bc){_0x6629bc=_0x6629bc||0xc8;return function(_0x491252){if(_0x491252){return _0x341ea8[_0x5201('0x1c')](_0x6629bc)[_0x5201('0x1e')](_0x491252);}};}function respondWithFilteredResult(_0x578325,_0x55562c){return function(_0x395a97){if(_0x395a97){var _0x364fb7=_0x395a97[_0x5201('0x1f')],_0x224f98=_0x55562c['offset'],_0x5b3184=_0x55562c[_0x5201('0x20')]+_0x55562c['limit'],_0x4c6d67;if(_0x5b3184>=_0x364fb7){_0x5b3184=_0x364fb7;_0x4c6d67=0xc8;}else{_0x4c6d67=0xce;}_0x578325[_0x5201('0x1c')](_0x4c6d67);return _0x578325['set'](_0x5201('0x21'),_0x224f98+'-'+_0x5b3184+'/'+_0x364fb7)[_0x5201('0x1e')](_0x395a97);}return null;};}function patchUpdates(_0x2c230a){return function(_0x23d13e){try{jsonpatch['apply'](_0x23d13e,_0x2c230a,!![]);}catch(_0x510942){return BPromise[_0x5201('0x22')](_0x510942);}return _0x23d13e[_0x5201('0x23')]();};}function saveUpdates(_0x468317,_0x54a901){return function(_0xd028ab){if(_0xd028ab){return _0xd028ab[_0x5201('0x24')](_0x468317)[_0x5201('0x25')](function(_0x446bee){return _0x446bee;});}return null;};}function removeEntity(_0xb6f07d,_0x51f0f4){return function(_0x15fade){if(_0x15fade){return _0x15fade[_0x5201('0x26')]()[_0x5201('0x25')](function(){_0xb6f07d[_0x5201('0x1c')](0xcc)[_0x5201('0x1d')]();});}};}function handleEntityNotFound(_0x6d5e04,_0x10e9c2){return function(_0x4d4142){if(!_0x4d4142){_0x6d5e04[_0x5201('0x1b')](0x194);}return _0x4d4142;};}function handleError(_0x428ce9,_0x338bf1){_0x338bf1=_0x338bf1||0x1f4;return function(_0x9c8dc5){logger[_0x5201('0x27')](_0x9c8dc5[_0x5201('0x28')]);if(_0x9c8dc5[_0x5201('0x29')]){delete _0x9c8dc5[_0x5201('0x29')];}_0x428ce9[_0x5201('0x1c')](_0x338bf1)[_0x5201('0x2a')](_0x9c8dc5);};}exports['index']=function(_0xff15b7,_0x14e5fc){var _0x48404e={},_0x4c82ff={},_0x5bc174={'count':0x0,'rows':[]};var _0x4edc6a=db[_0x5201('0x2b')][_0x5201('0x2c')];_0x4c82ff[_0x5201('0x2d')]=_['keys'](_0x4edc6a);_0x4c82ff['query']=_[_0x5201('0x2e')](_0xff15b7[_0x5201('0x2f')]);_0x4c82ff[_0x5201('0x30')]=_[_0x5201('0x31')](_0x4c82ff['model'],_0x4c82ff[_0x5201('0x2f')]);_0x48404e[_0x5201('0x32')]=_[_0x5201('0x31')](_0x4c82ff[_0x5201('0x2d')],qs[_0x5201('0x33')](_0xff15b7['query']['fields']));_0x48404e[_0x5201('0x32')]=_0x48404e[_0x5201('0x32')][_0x5201('0x34')]?_0x48404e[_0x5201('0x32')]:_0x4c82ff[_0x5201('0x2d')];if(!_0xff15b7[_0x5201('0x2f')][_0x5201('0x35')]('nolimit')){_0x48404e[_0x5201('0x36')]=qs[_0x5201('0x36')](_0xff15b7[_0x5201('0x2f')]['limit']);_0x48404e[_0x5201('0x20')]=qs[_0x5201('0x20')](_0xff15b7[_0x5201('0x2f')][_0x5201('0x20')]);}_0x48404e[_0x5201('0x37')]=qs[_0x5201('0x38')](_0xff15b7[_0x5201('0x2f')][_0x5201('0x38')]);_0x48404e[_0x5201('0x39')]=qs[_0x5201('0x30')](_[_0x5201('0x3a')](_0xff15b7[_0x5201('0x2f')],_0x4c82ff['filters']));if(_0xff15b7['query'][_0x5201('0x3b')]){_0x48404e[_0x5201('0x39')]=_[_0x5201('0x3c')](_0x48404e[_0x5201('0x39')],{'$or':_[_0x5201('0x3d')](_0x4edc6a,function(_0x1528b3){if(_0x1528b3[_0x5201('0x3e')]['key']!==_0x5201('0x3f')){var _0x111501={};_0x111501[_0x1528b3[_0x5201('0x40')]]={'$like':'%'+_0xff15b7['query'][_0x5201('0x3b')]+'%'};return _0x111501;}})});}_0x48404e=_[_0x5201('0x3c')]({},_0x48404e,_0xff15b7[_0x5201('0x41')]);var _0x5aba14={'where':_0x48404e[_0x5201('0x39')]};return db[_0x5201('0x2b')]['count'](_0x5aba14)['then'](function(_0x452717){_0x5bc174[_0x5201('0x1f')]=_0x452717;if(_0xff15b7[_0x5201('0x2f')][_0x5201('0x42')]){_0x48404e[_0x5201('0x43')]=[{'all':!![]}];}return db[_0x5201('0x2b')]['findAll'](_0x48404e);})[_0x5201('0x25')](function(_0x5989bc){_0x5bc174['rows']=_0x5989bc;return _0x5bc174;})[_0x5201('0x25')](respondWithFilteredResult(_0x14e5fc,_0x48404e))[_0x5201('0x44')](handleError(_0x14e5fc,null));};exports[_0x5201('0x45')]=function(_0x3e673f,_0x78c3d9){var _0x50a4ec={'raw':![],'where':{'id':_0x3e673f[_0x5201('0x46')]['id']}},_0x21d83a={};_0x21d83a[_0x5201('0x2d')]=_[_0x5201('0x2e')](db[_0x5201('0x2b')][_0x5201('0x2c')]);_0x21d83a[_0x5201('0x2f')]=_['keys'](_0x3e673f['query']);_0x21d83a[_0x5201('0x30')]=_[_0x5201('0x31')](_0x21d83a[_0x5201('0x2d')],_0x21d83a[_0x5201('0x2f')]);_0x50a4ec[_0x5201('0x32')]=_['intersection'](_0x21d83a['model'],qs[_0x5201('0x33')](_0x3e673f[_0x5201('0x2f')][_0x5201('0x33')]));_0x50a4ec[_0x5201('0x32')]=_0x50a4ec[_0x5201('0x32')][_0x5201('0x34')]?_0x50a4ec[_0x5201('0x32')]:_0x21d83a[_0x5201('0x2d')];if(_0x3e673f[_0x5201('0x2f')][_0x5201('0x42')]){_0x50a4ec[_0x5201('0x43')]=[{'all':!![]}];}_0x50a4ec=_['merge']({},_0x50a4ec,_0x3e673f['options']);return db[_0x5201('0x2b')][_0x5201('0x47')](_0x50a4ec)[_0x5201('0x25')](handleEntityNotFound(_0x78c3d9,null))[_0x5201('0x25')](respondWithResult(_0x78c3d9,null))[_0x5201('0x44')](handleError(_0x78c3d9,null));};exports['create']=function(_0x56c1b6,_0x2d0071){return db[_0x5201('0x2b')][_0x5201('0x48')](_0x56c1b6[_0x5201('0x49')],{})[_0x5201('0x25')](respondWithResult(_0x2d0071,0xc9))[_0x5201('0x44')](handleError(_0x2d0071,null));};exports['bulkCreate']=function(_0x5669f1,_0x5a3d95){return db[_0x5201('0x2b')]['bulkCreate'](_0x5669f1[_0x5201('0x49')],{'raw':![],'individualHooks':!![]})[_0x5201('0x25')](respondWithResult(_0x5a3d95,0xc9))[_0x5201('0x44')](handleError(_0x5a3d95,null));};exports[_0x5201('0x24')]=function(_0x304ad7,_0x57286a){if(_0x304ad7[_0x5201('0x49')]['id']){delete _0x304ad7[_0x5201('0x49')]['id'];}return db[_0x5201('0x2b')][_0x5201('0x47')]({'where':{'id':_0x304ad7[_0x5201('0x46')]['id']}})[_0x5201('0x25')](handleEntityNotFound(_0x57286a,null))[_0x5201('0x25')](saveUpdates(_0x304ad7[_0x5201('0x49')],null))[_0x5201('0x25')](respondWithResult(_0x57286a,null))[_0x5201('0x44')](handleError(_0x57286a,null));};exports['destroy']=function(_0x12bc51,_0x4f79b4){return db[_0x5201('0x2b')][_0x5201('0x47')]({'where':{'id':_0x12bc51['params']['id']}})[_0x5201('0x25')](handleEntityNotFound(_0x4f79b4,null))[_0x5201('0x25')](removeEntity(_0x4f79b4,null))['catch'](handleError(_0x4f79b4,null));};exports[_0x5201('0x4a')]=function(_0x50410f,_0xb926b3){return db[_0x5201('0x2b')][_0x5201('0x26')]({'where':{'id':_0x50410f[_0x5201('0x2f')][_0x5201('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xb926b3,0xcc))[_0x5201('0x44')](handleError(_0xb926b3,null));};exports[_0x5201('0x4c')]=function(_0x2788a8,_0x40e635,_0x257467){return db[_0x5201('0x4d')][_0x5201('0x4e')]({'where':{'id':_0x2788a8[_0x5201('0x46')]['id']}})[_0x5201('0x25')](handleEntityNotFound(_0x40e635,null))[_0x5201('0x25')](function(_0x43bf92){if(_0x43bf92){return db[_0x5201('0x4f')]['transaction'](function(_0x468c0d){return db[_0x5201('0x2b')][_0x5201('0x26')]({'where':{'CustomReportId':_0x2788a8[_0x5201('0x46')]['id']},'transaction':_0x468c0d})[_0x5201('0x25')](function(_0x19e1db){var _0x532be1=_[_0x5201('0x3d')](_0x2788a8[_0x5201('0x49')],function(_0x3887ee){delete _0x3887ee['id'];_0x3887ee[_0x5201('0x50')]=_0x2788a8[_0x5201('0x46')]['id'];return _0x3887ee;});return db[_0x5201('0x2b')][_0x5201('0x51')](_0x532be1,{'transaction':_0x468c0d});});})['then'](function(){return db['AnalyticFieldReport'][_0x5201('0x52')]({'where':{'CustomReportId':_0x2788a8[_0x5201('0x46')]['id']}});});}})[_0x5201('0x25')](respondWithResult(_0x40e635,null))[_0x5201('0x44')](handleError(_0x40e635,null));}; \ No newline at end of file +var _0x36fe=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','map','type','key','field','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4a3d94,_0x5cb549){var _0x313664=function(_0x52a94b){while(--_0x52a94b){_0x4a3d94['push'](_0x4a3d94['shift']());}};_0x313664(++_0x5cb549);}(_0x36fe,0x127));var _0xe36f=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0x36fe[_0x834bb6];return _0xa35d00;};'use strict';var pdf=require(_0xe36f('0x0'));var emlformat=require(_0xe36f('0x1'));var rimraf=require(_0xe36f('0x2'));var zipdir=require(_0xe36f('0x3'));var jsonpatch=require(_0xe36f('0x4'));var rp=require(_0xe36f('0x5'));var moment=require(_0xe36f('0x6'));var BPromise=require(_0xe36f('0x7'));var Mustache=require(_0xe36f('0x8'));var util=require(_0xe36f('0x9'));var path=require(_0xe36f('0xa'));var sox=require('sox');var csv=require(_0xe36f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe36f('0xc'));var squel=require(_0xe36f('0xd'));var crypto=require('crypto');var jsforce=require(_0xe36f('0xe'));var deskjs=require(_0xe36f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe36f('0x10'));var Papa=require(_0xe36f('0x11'));var Redis=require(_0xe36f('0x12'));var authService=require(_0xe36f('0x13'));var qs=require(_0xe36f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe36f('0x15'))('api');var utils=require(_0xe36f('0x16'));var config=require(_0xe36f('0x17'));var db=require(_0xe36f('0x18'))['db'];function respondWithStatusCode(_0x4c42cc,_0x187f4e){_0x187f4e=_0x187f4e||0xcc;return function(_0x3caacb){if(_0x3caacb){return _0x4c42cc['sendStatus'](_0x187f4e);}return _0x4c42cc[_0xe36f('0x19')](_0x187f4e)[_0xe36f('0x1a')]();};}function respondWithResult(_0x3d0bf1,_0xa180c6){_0xa180c6=_0xa180c6||0xc8;return function(_0x5f2407){if(_0x5f2407){return _0x3d0bf1[_0xe36f('0x19')](_0xa180c6)[_0xe36f('0x1b')](_0x5f2407);}};}function respondWithFilteredResult(_0xd3436c,_0x5e0ffd){return function(_0x2fcef3){if(_0x2fcef3){var _0x3ffb15=_0x2fcef3[_0xe36f('0x1c')],_0x511de8=_0x5e0ffd[_0xe36f('0x1d')],_0x1834a3=_0x5e0ffd[_0xe36f('0x1d')]+_0x5e0ffd[_0xe36f('0x1e')],_0x20f91b;if(_0x1834a3>=_0x3ffb15){_0x1834a3=_0x3ffb15;_0x20f91b=0xc8;}else{_0x20f91b=0xce;}_0xd3436c['status'](_0x20f91b);return _0xd3436c['set']('Content-Range',_0x511de8+'-'+_0x1834a3+'/'+_0x3ffb15)['json'](_0x2fcef3);}return null;};}function patchUpdates(_0x1c47de){return function(_0x2d6409){try{jsonpatch[_0xe36f('0x1f')](_0x2d6409,_0x1c47de,!![]);}catch(_0x464164){return BPromise['reject'](_0x464164);}return _0x2d6409['save']();};}function saveUpdates(_0x1a85fe,_0x24c235){return function(_0x1502bf){if(_0x1502bf){return _0x1502bf[_0xe36f('0x20')](_0x1a85fe)[_0xe36f('0x21')](function(_0x5c09ad){return _0x5c09ad;});}return null;};}function removeEntity(_0x360fa5,_0x576542){return function(_0x1fda7b){if(_0x1fda7b){return _0x1fda7b[_0xe36f('0x22')]()[_0xe36f('0x21')](function(){_0x360fa5['status'](0xcc)[_0xe36f('0x1a')]();});}};}function handleEntityNotFound(_0xd00e9b,_0x5d8e84){return function(_0xfd3899){if(!_0xfd3899){_0xd00e9b[_0xe36f('0x23')](0x194);}return _0xfd3899;};}function handleError(_0x45a92b,_0x534a2f){_0x534a2f=_0x534a2f||0x1f4;return function(_0x5527e2){logger[_0xe36f('0x24')](_0x5527e2[_0xe36f('0x25')]);if(_0x5527e2['name']){delete _0x5527e2[_0xe36f('0x26')];}_0x45a92b['status'](_0x534a2f)[_0xe36f('0x27')](_0x5527e2);};}exports[_0xe36f('0x28')]=function(_0x196183,_0x35b5fd){var _0x221d59={},_0x2b0d08={},_0x403c8a={'count':0x0,'rows':[]};var _0x40cdd8=db['AnalyticFieldReport'][_0xe36f('0x29')];_0x2b0d08['model']=_[_0xe36f('0x2a')](_0x40cdd8);_0x2b0d08[_0xe36f('0x2b')]=_[_0xe36f('0x2a')](_0x196183[_0xe36f('0x2b')]);_0x2b0d08[_0xe36f('0x2c')]=_['intersection'](_0x2b0d08[_0xe36f('0x2d')],_0x2b0d08[_0xe36f('0x2b')]);_0x221d59[_0xe36f('0x2e')]=_[_0xe36f('0x2f')](_0x2b0d08[_0xe36f('0x2d')],qs[_0xe36f('0x30')](_0x196183['query']['fields']));_0x221d59[_0xe36f('0x2e')]=_0x221d59[_0xe36f('0x2e')][_0xe36f('0x31')]?_0x221d59['attributes']:_0x2b0d08[_0xe36f('0x2d')];if(!_0x196183['query'][_0xe36f('0x32')]('nolimit')){_0x221d59[_0xe36f('0x1e')]=qs['limit'](_0x196183[_0xe36f('0x2b')]['limit']);_0x221d59[_0xe36f('0x1d')]=qs['offset'](_0x196183[_0xe36f('0x2b')][_0xe36f('0x1d')]);}_0x221d59['order']=qs[_0xe36f('0x33')](_0x196183[_0xe36f('0x2b')][_0xe36f('0x33')]);_0x221d59[_0xe36f('0x34')]=qs[_0xe36f('0x2c')](_['pick'](_0x196183['query'],_0x2b0d08[_0xe36f('0x2c')]));if(_0x196183[_0xe36f('0x2b')][_0xe36f('0x35')]){_0x221d59['where']=_[_0xe36f('0x36')](_0x221d59['where'],{'$or':_[_0xe36f('0x37')](_0x40cdd8,function(_0xd08927){if(_0xd08927[_0xe36f('0x38')][_0xe36f('0x39')]!=='VIRTUAL'){var _0x4d80a8={};_0x4d80a8[_0xd08927[_0xe36f('0x3a')]]={'$like':'%'+_0x196183['query'][_0xe36f('0x35')]+'%'};return _0x4d80a8;}})});}_0x221d59=_[_0xe36f('0x36')]({},_0x221d59,_0x196183[_0xe36f('0x3b')]);var _0x203f45={'where':_0x221d59[_0xe36f('0x34')]};return db[_0xe36f('0x3c')][_0xe36f('0x1c')](_0x203f45)['then'](function(_0x2de2d7){_0x403c8a[_0xe36f('0x1c')]=_0x2de2d7;if(_0x196183[_0xe36f('0x2b')][_0xe36f('0x3d')]){_0x221d59[_0xe36f('0x3e')]=[{'all':!![]}];}return db[_0xe36f('0x3c')][_0xe36f('0x3f')](_0x221d59);})['then'](function(_0x2e7dbd){_0x403c8a[_0xe36f('0x40')]=_0x2e7dbd;return _0x403c8a;})[_0xe36f('0x21')](respondWithFilteredResult(_0x35b5fd,_0x221d59))['catch'](handleError(_0x35b5fd,null));};exports[_0xe36f('0x41')]=function(_0x573385,_0x26b4af){var _0x49e20b={'raw':![],'where':{'id':_0x573385[_0xe36f('0x42')]['id']}},_0x193d3c={};_0x193d3c['model']=_[_0xe36f('0x2a')](db['AnalyticFieldReport'][_0xe36f('0x29')]);_0x193d3c['query']=_[_0xe36f('0x2a')](_0x573385[_0xe36f('0x2b')]);_0x193d3c['filters']=_[_0xe36f('0x2f')](_0x193d3c[_0xe36f('0x2d')],_0x193d3c[_0xe36f('0x2b')]);_0x49e20b[_0xe36f('0x2e')]=_[_0xe36f('0x2f')](_0x193d3c[_0xe36f('0x2d')],qs[_0xe36f('0x30')](_0x573385['query'][_0xe36f('0x30')]));_0x49e20b[_0xe36f('0x2e')]=_0x49e20b['attributes']['length']?_0x49e20b['attributes']:_0x193d3c[_0xe36f('0x2d')];if(_0x573385['query']['includeAll']){_0x49e20b[_0xe36f('0x3e')]=[{'all':!![]}];}_0x49e20b=_[_0xe36f('0x36')]({},_0x49e20b,_0x573385[_0xe36f('0x3b')]);return db['AnalyticFieldReport'][_0xe36f('0x43')](_0x49e20b)[_0xe36f('0x21')](handleEntityNotFound(_0x26b4af,null))[_0xe36f('0x21')](respondWithResult(_0x26b4af,null))[_0xe36f('0x44')](handleError(_0x26b4af,null));};exports['create']=function(_0x20f1c2,_0x323d14){return db[_0xe36f('0x3c')][_0xe36f('0x45')](_0x20f1c2[_0xe36f('0x46')],{})[_0xe36f('0x21')](respondWithResult(_0x323d14,0xc9))['catch'](handleError(_0x323d14,null));};exports[_0xe36f('0x47')]=function(_0x4d5dd4,_0x178a64){return db[_0xe36f('0x3c')][_0xe36f('0x47')](_0x4d5dd4[_0xe36f('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x178a64,0xc9))['catch'](handleError(_0x178a64,null));};exports[_0xe36f('0x20')]=function(_0x17969d,_0x1edbcf){if(_0x17969d[_0xe36f('0x46')]['id']){delete _0x17969d[_0xe36f('0x46')]['id'];}return db['AnalyticFieldReport'][_0xe36f('0x43')]({'where':{'id':_0x17969d[_0xe36f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1edbcf,null))[_0xe36f('0x21')](saveUpdates(_0x17969d[_0xe36f('0x46')],null))[_0xe36f('0x21')](respondWithResult(_0x1edbcf,null))[_0xe36f('0x44')](handleError(_0x1edbcf,null));};exports[_0xe36f('0x22')]=function(_0x177b1b,_0x35ae6d){return db[_0xe36f('0x3c')][_0xe36f('0x43')]({'where':{'id':_0x177b1b['params']['id']}})[_0xe36f('0x21')](handleEntityNotFound(_0x35ae6d,null))['then'](removeEntity(_0x35ae6d,null))['catch'](handleError(_0x35ae6d,null));};exports['bulkDestroy']=function(_0x160754,_0x273311){return db[_0xe36f('0x3c')]['destroy']({'where':{'id':_0x160754[_0xe36f('0x2b')][_0xe36f('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x273311,0xcc))[_0xe36f('0x44')](handleError(_0x273311,null));};exports[_0xe36f('0x49')]=function(_0x1c6376,_0x4d6985,_0xbf0dcc){return db[_0xe36f('0x4a')][_0xe36f('0x4b')]({'where':{'id':_0x1c6376[_0xe36f('0x42')]['id']}})[_0xe36f('0x21')](handleEntityNotFound(_0x4d6985,null))['then'](function(_0x32d658){if(_0x32d658){return db[_0xe36f('0x4c')][_0xe36f('0x4d')](function(_0x3bd1e4){return db[_0xe36f('0x3c')][_0xe36f('0x22')]({'where':{'CustomReportId':_0x1c6376[_0xe36f('0x42')]['id']},'transaction':_0x3bd1e4})[_0xe36f('0x21')](function(_0x46466b){var _0xdaec1d=_[_0xe36f('0x37')](_0x1c6376[_0xe36f('0x46')],function(_0x146de6){delete _0x146de6['id'];_0x146de6[_0xe36f('0x4e')]=_0x1c6376[_0xe36f('0x42')]['id'];return _0x146de6;});return db['AnalyticFieldReport'][_0xe36f('0x47')](_0xdaec1d,{'transaction':_0x3bd1e4});});})['then'](function(){return db[_0xe36f('0x3c')][_0xe36f('0x3f')]({'where':{'CustomReportId':_0x1c6376['params']['id']}});});}})[_0xe36f('0x21')](respondWithResult(_0x4d6985,null))[_0xe36f('0x44')](handleError(_0x4d6985,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index cb4cda1..f97c958 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 _0x8039=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x240676,_0x498ab2){var _0x53586e=function(_0x11f604){while(--_0x11f604){_0x240676['push'](_0x240676['shift']());}};_0x53586e(++_0x498ab2);}(_0x8039,0x150));var _0x9803=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0x8039[_0x5ee3d3];return _0x4b272f;};'use strict';var _=require(_0x9803('0x0'));var util=require('util');var logger=require(_0x9803('0x1'))(_0x9803('0x2'));var moment=require('moment');var BPromise=require(_0x9803('0x3'));var rp=require(_0x9803('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9803('0x5'));var attributes=require(_0x9803('0x6'));module[_0x9803('0x7')]=function(_0x112abf,_0x31621d){return _0x112abf[_0x9803('0x8')](_0x9803('0x9'),attributes,{'tableName':_0x9803('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc0c=['define','AnalyticFieldReport','analytics_report_fields','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x56f4bc,_0x2ee500){var _0x572206=function(_0x334833){while(--_0x334833){_0x56f4bc['push'](_0x56f4bc['shift']());}};_0x572206(++_0x2ee500);}(_0xfc0c,0x123));var _0xcfc0=function(_0x4769c6,_0x3086e8){_0x4769c6=_0x4769c6-0x0;var _0x4bc451=_0xfc0c[_0x4769c6];return _0x4bc451;};'use strict';var _=require('lodash');var util=require(_0xcfc0('0x0'));var logger=require('../../config/logger')(_0xcfc0('0x1'));var moment=require(_0xcfc0('0x2'));var BPromise=require(_0xcfc0('0x3'));var rp=require(_0xcfc0('0x4'));var fs=require('fs');var path=require(_0xcfc0('0x5'));var rimraf=require(_0xcfc0('0x6'));var config=require(_0xcfc0('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xcfc0('0x8')]=function(_0x395133,_0x461976){return _0x395133[_0xcfc0('0x9')](_0xcfc0('0xa'),attributes,{'tableName':_0xcfc0('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 6596275..6b15981 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 _0x3fa4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','randomstring'];(function(_0x598408,_0x5e6f74){var _0x560720=function(_0x56a96d){while(--_0x56a96d){_0x598408['push'](_0x598408['shift']());}};_0x560720(++_0x5e6f74);}(_0x3fa4,0xf0));var _0x43fa=function(_0x5a3826,_0x14ce75){_0x5a3826=_0x5a3826-0x0;var _0x1968f3=_0x3fa4[_0x5a3826];return _0x1968f3;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43fa('0x1'));var fs=require('fs');var Redis=require(_0x43fa('0x2'));var db=require(_0x43fa('0x3'))['db'];var utils=require(_0x43fa('0x4'));var logger=require(_0x43fa('0x5'))(_0x43fa('0x6'));var config=require(_0x43fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x8')][_0x43fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df71c,_0x584209,_0x3dc891){return new BPromise(function(_0x46adc7,_0x1dc401){return client['request'](_0x6df71c,_0x3dc891)[_0x43fa('0xa')](function(_0x36d40d){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x584209,_0x43fa('0xb'));logger[_0x43fa('0xc')](_0x43fa('0xd'),_0x584209,_0x43fa('0xb'),JSON[_0x43fa('0xe')](_0x36d40d));if(_0x36d40d['error']){if(_0x36d40d[_0x43fa('0xf')][_0x43fa('0x10')]===0x1f4){logger[_0x43fa('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x584209,_0x36d40d[_0x43fa('0xf')][_0x43fa('0x11')]);return _0x1dc401(_0x36d40d[_0x43fa('0xf')]['message']);}logger[_0x43fa('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x584209,_0x36d40d['error']['message']);return _0x46adc7(_0x36d40d[_0x43fa('0xf')]['message']);}else{logger[_0x43fa('0x12')](_0x43fa('0x13'),_0x584209,'request\x20sent');_0x46adc7(_0x36d40d[_0x43fa('0x14')][_0x43fa('0x11')]);}})[_0x43fa('0x15')](function(_0x2439d4){logger[_0x43fa('0xf')](_0x43fa('0x13'),_0x584209,_0x2439d4);_0x1dc401(_0x2439d4);});});} \ No newline at end of file +var _0x0048=['../../config/environment','http','request','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x532e33,_0x23fb71){var _0x5e271b=function(_0x227ad3){while(--_0x227ad3){_0x532e33['push'](_0x532e33['shift']());}};_0x5e271b(++_0x23fb71);}(_0x0048,0x129));var _0x8004=function(_0x305c93,_0x3421dc){_0x305c93=_0x305c93-0x0;var _0x5bae39=_0x0048[_0x305c93];return _0x5bae39;};'use strict';var _=require('lodash');var util=require(_0x8004('0x0'));var moment=require(_0x8004('0x1'));var BPromise=require('bluebird');var rs=require(_0x8004('0x2'));var fs=require('fs');var Redis=require(_0x8004('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8004('0x4'));var logger=require(_0x8004('0x5'))(_0x8004('0x6'));var config=require(_0x8004('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8004('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38871a,_0xe44b28,_0x59218a){return new BPromise(function(_0x3c7e57,_0x3560a1){return client[_0x8004('0x9')](_0x38871a,_0x59218a)['then'](function(_0x4de153){logger['info'](_0x8004('0xa'),_0xe44b28,'request\x20sent');logger['debug'](_0x8004('0xb'),_0xe44b28,_0x8004('0xc'),JSON['stringify'](_0x4de153));if(_0x4de153['error']){if(_0x4de153[_0x8004('0xd')][_0x8004('0xe')]===0x1f4){logger[_0x8004('0xd')](_0x8004('0xa'),_0xe44b28,_0x4de153[_0x8004('0xd')][_0x8004('0xf')]);return _0x3560a1(_0x4de153[_0x8004('0xd')]['message']);}logger[_0x8004('0xd')](_0x8004('0xa'),_0xe44b28,_0x4de153[_0x8004('0xd')][_0x8004('0xf')]);return _0x3c7e57(_0x4de153[_0x8004('0xd')][_0x8004('0xf')]);}else{logger[_0x8004('0x10')](_0x8004('0xa'),_0xe44b28,_0x8004('0xc'));_0x3c7e57(_0x4de153[_0x8004('0x11')][_0x8004('0xf')]);}})[_0x8004('0x12')](function(_0x122265){logger[_0x8004('0xd')](_0x8004('0xa'),_0xe44b28,_0x122265);_0x3560a1(_0x122265);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e34a3c2..351ea98 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 _0xb7e7=['/create_many','bulkCreate','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','multer','path','express','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','/:id','isAuthenticated','post','create'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x9')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x9')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xf')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0x10')]);router[_0x7b7e('0x11')](_0x7b7e('0x12'),auth['isAuthenticated'](),controller[_0x7b7e('0x13')]);router[_0x7b7e('0x11')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe205=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','post','bulkCreate','/:id/create_many','addFields','put','/:id','update','delete','bulkDestroy','exports','multer'];(function(_0x402eff,_0x2525f2){var _0x2eb371=function(_0x15e9b3){while(--_0x15e9b3){_0x402eff['push'](_0x402eff['shift']());}};_0x2eb371(++_0x2525f2);}(_0xe205,0xa7));var _0x5e20=function(_0x572aa0,_0x4b9e53){_0x572aa0=_0x572aa0-0x0;var _0x217068=_0xe205[_0x572aa0];return _0x217068;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var auth=require(_0x5e20('0x6'));var interaction=require(_0x5e20('0x7'));var config=require(_0x5e20('0x8'));var controller=require('./analyticFieldReport.controller');router[_0x5e20('0x9')]('/',auth[_0x5e20('0xa')](),controller[_0x5e20('0xb')]);router[_0x5e20('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5e20('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5e20('0xd')]);router[_0x5e20('0xe')]('/create_many',auth[_0x5e20('0xa')](),controller[_0x5e20('0xf')]);router[_0x5e20('0xe')](_0x5e20('0x10'),auth['isAuthenticated'](),controller[_0x5e20('0x11')]);router[_0x5e20('0x12')](_0x5e20('0x13'),auth[_0x5e20('0xa')](),controller[_0x5e20('0x14')]);router[_0x5e20('0x15')]('/destroy_many',auth[_0x5e20('0xa')](),controller[_0x5e20('0x16')]);router[_0x5e20('0x15')]('/:id',auth[_0x5e20('0xa')](),controller['destroy']);module[_0x5e20('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index c8da4e6..b7030a6 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 _0xfdb5=['STRING','TEXT','sequelize','exports'];(function(_0x2af9fc,_0x2c80f0){var _0x4bf1f9=function(_0x14f798){while(--_0x14f798){_0x2af9fc['push'](_0x2af9fc['shift']());}};_0x4bf1f9(++_0x2c80f0);}(_0xfdb5,0x146));var _0x5fdb=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xfdb5[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x5fdb('0x0'));module[_0x5fdb('0x1')]={'name':{'type':Sequelize[_0x5fdb('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x5fdb('0x2')]},'metric':{'type':Sequelize[_0x5fdb('0x3')]},'description':{'type':Sequelize[_0x5fdb('0x2')]}}; \ No newline at end of file +var _0x33f0=['name','TEXT','sequelize','exports','STRING'];(function(_0xa96436,_0x656eb1){var _0x310513=function(_0xff021c){while(--_0xff021c){_0xa96436['push'](_0xa96436['shift']());}};_0x310513(++_0x656eb1);}(_0x33f0,0xe8));var _0x033f=function(_0x205e03,_0x53fa5c){_0x205e03=_0x205e03-0x0;var _0x381fd1=_0x33f0[_0x205e03];return _0x381fd1;};'use strict';var Sequelize=require(_0x033f('0x0'));module[_0x033f('0x1')]={'name':{'type':Sequelize[_0x033f('0x2')],'allowNull':![],'unique':_0x033f('0x3')},'table':{'type':Sequelize[_0x033f('0x2')]},'metric':{'type':Sequelize[_0x033f('0x4')]},'description':{'type':Sequelize[_0x033f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 2707a38..2b87d86 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 _0x25f6=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','set','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Metrics','UserProfileSection','userProfileId','autoAssociation','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto'];(function(_0x5da230,_0x574a8e){var _0x2a4b26=function(_0x384a1f){while(--_0x384a1f){_0x5da230['push'](_0x5da230['shift']());}};_0x2a4b26(++_0x574a8e);}(_0x25f6,0x1e9));var _0x625f=function(_0x5876fc,_0x431a54){_0x5876fc=_0x5876fc-0x0;var _0x279a56=_0x25f6[_0x5876fc];return _0x279a56;};'use strict';var pdf=require(_0x625f('0x0'));var emlformat=require(_0x625f('0x1'));var rimraf=require(_0x625f('0x2'));var zipdir=require(_0x625f('0x3'));var jsonpatch=require(_0x625f('0x4'));var rp=require(_0x625f('0x5'));var moment=require(_0x625f('0x6'));var BPromise=require(_0x625f('0x7'));var Mustache=require(_0x625f('0x8'));var util=require(_0x625f('0x9'));var path=require(_0x625f('0xa'));var sox=require(_0x625f('0xb'));var csv=require(_0x625f('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x625f('0xd'));var squel=require('squel');var crypto=require(_0x625f('0xe'));var jsforce=require(_0x625f('0xf'));var deskjs=require(_0x625f('0x10'));var toCsv=require(_0x625f('0xc'));var querystring=require('querystring');var Papa=require(_0x625f('0x11'));var Redis=require(_0x625f('0x12'));var authService=require(_0x625f('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x625f('0x14'));var logger=require(_0x625f('0x15'))(_0x625f('0x16'));var utils=require('../../config/utils');var config=require(_0x625f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130cfe,_0x454de3){_0x454de3=_0x454de3||0xcc;return function(_0x28a989){if(_0x28a989){return _0x130cfe[_0x625f('0x18')](_0x454de3);}return _0x130cfe[_0x625f('0x19')](_0x454de3)[_0x625f('0x1a')]();};}function respondWithResult(_0x49e986,_0x5e8efe){_0x5e8efe=_0x5e8efe||0xc8;return function(_0x269b10){if(_0x269b10){return _0x49e986[_0x625f('0x19')](_0x5e8efe)['json'](_0x269b10);}};}function respondWithFilteredResult(_0x25a42b,_0x43bd5b){return function(_0x147d6b){if(_0x147d6b){var _0x42654d=_0x147d6b[_0x625f('0x1b')],_0x463c19=_0x43bd5b[_0x625f('0x1c')],_0x5ea45d=_0x43bd5b['offset']+_0x43bd5b['limit'],_0x59539d;if(_0x5ea45d>=_0x42654d){_0x5ea45d=_0x42654d;_0x59539d=0xc8;}else{_0x59539d=0xce;}_0x25a42b[_0x625f('0x19')](_0x59539d);return _0x25a42b[_0x625f('0x1d')]('Content-Range',_0x463c19+'-'+_0x5ea45d+'/'+_0x42654d)[_0x625f('0x1e')](_0x147d6b);}return null;};}function patchUpdates(_0x1ecaf3){return function(_0x5c7b9f){try{jsonpatch[_0x625f('0x1f')](_0x5c7b9f,_0x1ecaf3,!![]);}catch(_0x490d1d){return BPromise[_0x625f('0x20')](_0x490d1d);}return _0x5c7b9f[_0x625f('0x21')]();};}function saveUpdates(_0x1cc344,_0x40ac04){return function(_0x4e1d4d){if(_0x4e1d4d){return _0x4e1d4d['update'](_0x1cc344)[_0x625f('0x22')](function(_0x563d1d){return _0x563d1d;});}return null;};}function removeEntity(_0xdc7a73,_0x5a00a1){return function(_0x1b5a52){if(_0x1b5a52){return _0x1b5a52[_0x625f('0x23')]()[_0x625f('0x22')](function(){var _0x1ee29b=_0x1b5a52[_0x625f('0x24')]({'plain':!![]});var _0x218e03='Metrics';return db[_0x625f('0x25')][_0x625f('0x23')]({'where':{'type':_0x218e03,'resourceId':_0x1ee29b['id']}})[_0x625f('0x22')](function(){return _0x1b5a52;});})[_0x625f('0x22')](function(){_0xdc7a73[_0x625f('0x19')](0xcc)[_0x625f('0x1a')]();});}};}function handleEntityNotFound(_0x1bc442,_0x2b6f5e){return function(_0x59352f){if(!_0x59352f){_0x1bc442['sendStatus'](0x194);}return _0x59352f;};}function handleError(_0x15b88f,_0x33287d){_0x33287d=_0x33287d||0x1f4;return function(_0x5cd33f){logger[_0x625f('0x26')](_0x5cd33f[_0x625f('0x27')]);if(_0x5cd33f[_0x625f('0x28')]){delete _0x5cd33f[_0x625f('0x28')];}_0x15b88f[_0x625f('0x19')](_0x33287d)[_0x625f('0x29')](_0x5cd33f);};}exports[_0x625f('0x2a')]=function(_0x225d0e,_0x355560){var _0xf4f21e={},_0x3ab8b6={},_0x12f5e2={'count':0x0,'rows':[]};var _0x254266=db[_0x625f('0x2b')][_0x625f('0x2c')];_0x3ab8b6[_0x625f('0x2d')]=_[_0x625f('0x2e')](_0x254266);_0x3ab8b6[_0x625f('0x2f')]=_[_0x625f('0x2e')](_0x225d0e['query']);_0x3ab8b6[_0x625f('0x30')]=_[_0x625f('0x31')](_0x3ab8b6['model'],_0x3ab8b6[_0x625f('0x2f')]);_0xf4f21e[_0x625f('0x32')]=_['intersection'](_0x3ab8b6['model'],qs[_0x625f('0x33')](_0x225d0e[_0x625f('0x2f')][_0x625f('0x33')]));_0xf4f21e[_0x625f('0x32')]=_0xf4f21e[_0x625f('0x32')][_0x625f('0x34')]?_0xf4f21e[_0x625f('0x32')]:_0x3ab8b6[_0x625f('0x2d')];if(!_0x225d0e['query'][_0x625f('0x35')](_0x625f('0x36'))){_0xf4f21e[_0x625f('0x37')]=qs[_0x625f('0x37')](_0x225d0e[_0x625f('0x2f')][_0x625f('0x37')]);_0xf4f21e['offset']=qs[_0x625f('0x1c')](_0x225d0e[_0x625f('0x2f')][_0x625f('0x1c')]);}_0xf4f21e[_0x625f('0x38')]=qs['sort'](_0x225d0e[_0x625f('0x2f')][_0x625f('0x39')]);_0xf4f21e['where']=qs[_0x625f('0x30')](_['pick'](_0x225d0e['query'],_0x3ab8b6[_0x625f('0x30')]));if(_0x225d0e[_0x625f('0x2f')]['filter']){_0xf4f21e[_0x625f('0x3a')]=_[_0x625f('0x3b')](_0xf4f21e[_0x625f('0x3a')],{'$or':_[_0x625f('0x3c')](_0x254266,function(_0x25ed1f){if(_0x25ed1f[_0x625f('0x3d')][_0x625f('0x3e')]!==_0x625f('0x3f')){var _0x121be9={};_0x121be9[_0x25ed1f[_0x625f('0x40')]]={'$like':'%'+_0x225d0e[_0x625f('0x2f')][_0x625f('0x41')]+'%'};return _0x121be9;}})});}_0xf4f21e=_[_0x625f('0x3b')]({},_0xf4f21e,_0x225d0e[_0x625f('0x42')]);var _0x2205d9={'where':_0xf4f21e[_0x625f('0x3a')]};return db[_0x625f('0x2b')][_0x625f('0x1b')](_0x2205d9)['then'](function(_0x2a9169){_0x12f5e2[_0x625f('0x1b')]=_0x2a9169;if(_0x225d0e[_0x625f('0x2f')][_0x625f('0x43')]){_0xf4f21e[_0x625f('0x44')]=[{'all':!![]}];}return db[_0x625f('0x2b')][_0x625f('0x45')](_0xf4f21e);})[_0x625f('0x22')](function(_0x465504){_0x12f5e2[_0x625f('0x46')]=_0x465504;return _0x12f5e2;})[_0x625f('0x22')](respondWithFilteredResult(_0x355560,_0xf4f21e))[_0x625f('0x47')](handleError(_0x355560,null));};exports[_0x625f('0x48')]=function(_0x40cd03,_0x15d075){var _0x139105={'raw':!![],'where':{'id':_0x40cd03[_0x625f('0x49')]['id']}},_0x212894={};_0x212894[_0x625f('0x2d')]=_[_0x625f('0x2e')](db[_0x625f('0x2b')][_0x625f('0x2c')]);_0x212894[_0x625f('0x2f')]=_[_0x625f('0x2e')](_0x40cd03[_0x625f('0x2f')]);_0x212894[_0x625f('0x30')]=_[_0x625f('0x31')](_0x212894[_0x625f('0x2d')],_0x212894[_0x625f('0x2f')]);_0x139105[_0x625f('0x32')]=_[_0x625f('0x31')](_0x212894[_0x625f('0x2d')],qs[_0x625f('0x33')](_0x40cd03[_0x625f('0x2f')][_0x625f('0x33')]));_0x139105[_0x625f('0x32')]=_0x139105[_0x625f('0x32')]['length']?_0x139105['attributes']:_0x212894[_0x625f('0x2d')];if(_0x40cd03[_0x625f('0x2f')]['includeAll']){_0x139105['include']=[{'all':!![]}];}_0x139105=_[_0x625f('0x3b')]({},_0x139105,_0x40cd03[_0x625f('0x42')]);return db[_0x625f('0x2b')][_0x625f('0x4a')](_0x139105)[_0x625f('0x22')](handleEntityNotFound(_0x15d075,null))['then'](respondWithResult(_0x15d075,null))['catch'](handleError(_0x15d075,null));};exports[_0x625f('0x4b')]=function(_0x492e94,_0x41f704){return db['AnalyticMetric']['create'](_0x492e94[_0x625f('0x4c')],{})[_0x625f('0x22')](function(_0x5ed736){var _0x5d7c30=_0x492e94['user'][_0x625f('0x24')]({'plain':!![]});if(!_0x5d7c30)throw new Error(_0x625f('0x4d'));if(_0x5d7c30['role']===_0x625f('0x4e')){var _0x3b461c=_0x5ed736[_0x625f('0x24')]({'plain':!![]});var _0x25e2df=_0x625f('0x4f');return db[_0x625f('0x50')][_0x625f('0x4a')]({'where':{'name':_0x25e2df,'userProfileId':_0x5d7c30[_0x625f('0x51')]},'raw':!![]})[_0x625f('0x22')](function(_0x208151){if(_0x208151&&_0x208151[_0x625f('0x52')]===0x0){return db[_0x625f('0x25')][_0x625f('0x4b')]({'name':_0x3b461c[_0x625f('0x28')],'resourceId':_0x3b461c['id'],'type':_0x208151[_0x625f('0x28')],'sectionId':_0x208151['id']},{})['then'](function(){return _0x5ed736;});}else{return _0x5ed736;}})[_0x625f('0x47')](function(_0x3d30d8){logger[_0x625f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d30d8);throw _0x3d30d8;});}return _0x5ed736;})[_0x625f('0x22')](respondWithResult(_0x41f704,0xc9))[_0x625f('0x47')](handleError(_0x41f704,null));};exports[_0x625f('0x53')]=function(_0x3e224f,_0x425348){if(_0x3e224f['body']['id']){delete _0x3e224f[_0x625f('0x4c')]['id'];}return db[_0x625f('0x2b')][_0x625f('0x4a')]({'where':{'id':_0x3e224f[_0x625f('0x49')]['id']}})['then'](handleEntityNotFound(_0x425348,null))[_0x625f('0x22')](saveUpdates(_0x3e224f['body'],null))[_0x625f('0x22')](respondWithResult(_0x425348,null))['catch'](handleError(_0x425348,null));};exports['destroy']=function(_0x596d37,_0x12e1a6){return db[_0x625f('0x2b')][_0x625f('0x4a')]({'where':{'id':_0x596d37[_0x625f('0x49')]['id']}})[_0x625f('0x22')](handleEntityNotFound(_0x12e1a6,null))[_0x625f('0x22')](removeEntity(_0x12e1a6,null))[_0x625f('0x47')](handleError(_0x12e1a6,null));}; \ No newline at end of file +var _0xa855=['limit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa855,0x70));var _0x5a85=function(_0x52ed18,_0x722adb){_0x52ed18=_0x52ed18-0x0;var _0x5d0a9e=_0xa855[_0x52ed18];return _0x5d0a9e;};'use strict';var pdf=require(_0x5a85('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5a85('0x1'));var zipdir=require(_0x5a85('0x2'));var jsonpatch=require(_0x5a85('0x3'));var rp=require(_0x5a85('0x4'));var moment=require(_0x5a85('0x5'));var BPromise=require(_0x5a85('0x6'));var Mustache=require(_0x5a85('0x7'));var util=require(_0x5a85('0x8'));var path=require(_0x5a85('0x9'));var sox=require(_0x5a85('0xa'));var csv=require(_0x5a85('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5a85('0xc'));var squel=require(_0x5a85('0xd'));var crypto=require(_0x5a85('0xe'));var jsforce=require(_0x5a85('0xf'));var deskjs=require(_0x5a85('0x10'));var toCsv=require(_0x5a85('0xb'));var querystring=require(_0x5a85('0x11'));var Papa=require('papaparse');var Redis=require(_0x5a85('0x12'));var authService=require(_0x5a85('0x13'));var qs=require(_0x5a85('0x14'));var hardwareService=require(_0x5a85('0x15'));var logger=require(_0x5a85('0x16'))(_0x5a85('0x17'));var utils=require('../../config/utils');var config=require(_0x5a85('0x18'));var db=require(_0x5a85('0x19'))['db'];function respondWithStatusCode(_0x351751,_0x179e63){_0x179e63=_0x179e63||0xcc;return function(_0x38b6ed){if(_0x38b6ed){return _0x351751[_0x5a85('0x1a')](_0x179e63);}return _0x351751[_0x5a85('0x1b')](_0x179e63)[_0x5a85('0x1c')]();};}function respondWithResult(_0x398892,_0x29658b){_0x29658b=_0x29658b||0xc8;return function(_0x599ac3){if(_0x599ac3){return _0x398892['status'](_0x29658b)['json'](_0x599ac3);}};}function respondWithFilteredResult(_0x13c3cb,_0x201f23){return function(_0x5c3969){if(_0x5c3969){var _0x5d2c27=_0x5c3969[_0x5a85('0x1d')],_0x26305c=_0x201f23[_0x5a85('0x1e')],_0x291790=_0x201f23['offset']+_0x201f23['limit'],_0x4fe4f0;if(_0x291790>=_0x5d2c27){_0x291790=_0x5d2c27;_0x4fe4f0=0xc8;}else{_0x4fe4f0=0xce;}_0x13c3cb['status'](_0x4fe4f0);return _0x13c3cb[_0x5a85('0x1f')](_0x5a85('0x20'),_0x26305c+'-'+_0x291790+'/'+_0x5d2c27)[_0x5a85('0x21')](_0x5c3969);}return null;};}function patchUpdates(_0x389894){return function(_0x15190e){try{jsonpatch[_0x5a85('0x22')](_0x15190e,_0x389894,!![]);}catch(_0x290b33){return BPromise[_0x5a85('0x23')](_0x290b33);}return _0x15190e[_0x5a85('0x24')]();};}function saveUpdates(_0x3dd105,_0x298c4b){return function(_0x5c5719){if(_0x5c5719){return _0x5c5719[_0x5a85('0x25')](_0x3dd105)[_0x5a85('0x26')](function(_0x29b1d5){return _0x29b1d5;});}return null;};}function removeEntity(_0x4c6110,_0x398c92){return function(_0x24f7e3){if(_0x24f7e3){return _0x24f7e3[_0x5a85('0x27')]()['then'](function(){var _0x396a0b=_0x24f7e3[_0x5a85('0x28')]({'plain':!![]});var _0x2dc966='Metrics';return db[_0x5a85('0x29')][_0x5a85('0x27')]({'where':{'type':_0x2dc966,'resourceId':_0x396a0b['id']}})['then'](function(){return _0x24f7e3;});})[_0x5a85('0x26')](function(){_0x4c6110['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5077c6,_0x107924){return function(_0x14ab27){if(!_0x14ab27){_0x5077c6[_0x5a85('0x1a')](0x194);}return _0x14ab27;};}function handleError(_0x3e71e5,_0x286ec2){_0x286ec2=_0x286ec2||0x1f4;return function(_0x4e0387){logger['error'](_0x4e0387[_0x5a85('0x2a')]);if(_0x4e0387[_0x5a85('0x2b')]){delete _0x4e0387['name'];}_0x3e71e5[_0x5a85('0x1b')](_0x286ec2)[_0x5a85('0x2c')](_0x4e0387);};}exports[_0x5a85('0x2d')]=function(_0x3310f4,_0x4a3429){var _0x4c88e4={},_0x50ffc1={},_0x2436e8={'count':0x0,'rows':[]};var _0x4407c7=db[_0x5a85('0x2e')][_0x5a85('0x2f')];_0x50ffc1[_0x5a85('0x30')]=_[_0x5a85('0x31')](_0x4407c7);_0x50ffc1[_0x5a85('0x32')]=_[_0x5a85('0x31')](_0x3310f4[_0x5a85('0x32')]);_0x50ffc1[_0x5a85('0x33')]=_[_0x5a85('0x34')](_0x50ffc1[_0x5a85('0x30')],_0x50ffc1[_0x5a85('0x32')]);_0x4c88e4[_0x5a85('0x35')]=_['intersection'](_0x50ffc1[_0x5a85('0x30')],qs[_0x5a85('0x36')](_0x3310f4[_0x5a85('0x32')][_0x5a85('0x36')]));_0x4c88e4[_0x5a85('0x35')]=_0x4c88e4[_0x5a85('0x35')][_0x5a85('0x37')]?_0x4c88e4[_0x5a85('0x35')]:_0x50ffc1[_0x5a85('0x30')];if(!_0x3310f4[_0x5a85('0x32')][_0x5a85('0x38')](_0x5a85('0x39'))){_0x4c88e4[_0x5a85('0x3a')]=qs[_0x5a85('0x3a')](_0x3310f4[_0x5a85('0x32')][_0x5a85('0x3a')]);_0x4c88e4[_0x5a85('0x1e')]=qs[_0x5a85('0x1e')](_0x3310f4[_0x5a85('0x32')][_0x5a85('0x1e')]);}_0x4c88e4[_0x5a85('0x3b')]=qs[_0x5a85('0x3c')](_0x3310f4[_0x5a85('0x32')][_0x5a85('0x3c')]);_0x4c88e4[_0x5a85('0x3d')]=qs['filters'](_[_0x5a85('0x3e')](_0x3310f4[_0x5a85('0x32')],_0x50ffc1['filters']));if(_0x3310f4['query'][_0x5a85('0x3f')]){_0x4c88e4[_0x5a85('0x3d')]=_['merge'](_0x4c88e4[_0x5a85('0x3d')],{'$or':_['map'](_0x4407c7,function(_0x2f1605){if(_0x2f1605[_0x5a85('0x40')]['key']!==_0x5a85('0x41')){var _0x4ddd4c={};_0x4ddd4c[_0x2f1605['field']]={'$like':'%'+_0x3310f4[_0x5a85('0x32')][_0x5a85('0x3f')]+'%'};return _0x4ddd4c;}})});}_0x4c88e4=_[_0x5a85('0x42')]({},_0x4c88e4,_0x3310f4['options']);var _0x586989={'where':_0x4c88e4['where']};return db[_0x5a85('0x2e')]['count'](_0x586989)[_0x5a85('0x26')](function(_0xa764c1){_0x2436e8[_0x5a85('0x1d')]=_0xa764c1;if(_0x3310f4['query'][_0x5a85('0x43')]){_0x4c88e4[_0x5a85('0x44')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x5a85('0x45')](_0x4c88e4);})[_0x5a85('0x26')](function(_0xecf455){_0x2436e8['rows']=_0xecf455;return _0x2436e8;})[_0x5a85('0x26')](respondWithFilteredResult(_0x4a3429,_0x4c88e4))[_0x5a85('0x46')](handleError(_0x4a3429,null));};exports[_0x5a85('0x47')]=function(_0x46225b,_0x43674b){var _0x51bd97={'raw':!![],'where':{'id':_0x46225b[_0x5a85('0x48')]['id']}},_0x2627e0={};_0x2627e0[_0x5a85('0x30')]=_[_0x5a85('0x31')](db['AnalyticMetric'][_0x5a85('0x2f')]);_0x2627e0['query']=_[_0x5a85('0x31')](_0x46225b[_0x5a85('0x32')]);_0x2627e0[_0x5a85('0x33')]=_[_0x5a85('0x34')](_0x2627e0[_0x5a85('0x30')],_0x2627e0[_0x5a85('0x32')]);_0x51bd97[_0x5a85('0x35')]=_['intersection'](_0x2627e0['model'],qs[_0x5a85('0x36')](_0x46225b[_0x5a85('0x32')]['fields']));_0x51bd97[_0x5a85('0x35')]=_0x51bd97['attributes']['length']?_0x51bd97[_0x5a85('0x35')]:_0x2627e0[_0x5a85('0x30')];if(_0x46225b[_0x5a85('0x32')][_0x5a85('0x43')]){_0x51bd97[_0x5a85('0x44')]=[{'all':!![]}];}_0x51bd97=_[_0x5a85('0x42')]({},_0x51bd97,_0x46225b[_0x5a85('0x49')]);return db[_0x5a85('0x2e')][_0x5a85('0x4a')](_0x51bd97)[_0x5a85('0x26')](handleEntityNotFound(_0x43674b,null))[_0x5a85('0x26')](respondWithResult(_0x43674b,null))[_0x5a85('0x46')](handleError(_0x43674b,null));};exports[_0x5a85('0x4b')]=function(_0x93b341,_0x2fd097){return db[_0x5a85('0x2e')][_0x5a85('0x4b')](_0x93b341[_0x5a85('0x4c')],{})[_0x5a85('0x26')](function(_0x2478d5){var _0x566478=_0x93b341[_0x5a85('0x4d')][_0x5a85('0x28')]({'plain':!![]});if(!_0x566478)throw new Error(_0x5a85('0x4e'));if(_0x566478[_0x5a85('0x4f')]===_0x5a85('0x4d')){var _0x1e5fdb=_0x2478d5[_0x5a85('0x28')]({'plain':!![]});var _0x3e8b7a='Metrics';return db[_0x5a85('0x50')][_0x5a85('0x4a')]({'where':{'name':_0x3e8b7a,'userProfileId':_0x566478[_0x5a85('0x51')]},'raw':!![]})[_0x5a85('0x26')](function(_0xc3da79){if(_0xc3da79&&_0xc3da79[_0x5a85('0x52')]===0x0){return db[_0x5a85('0x29')][_0x5a85('0x4b')]({'name':_0x1e5fdb[_0x5a85('0x2b')],'resourceId':_0x1e5fdb['id'],'type':_0xc3da79[_0x5a85('0x2b')],'sectionId':_0xc3da79['id']},{})[_0x5a85('0x26')](function(){return _0x2478d5;});}else{return _0x2478d5;}})[_0x5a85('0x46')](function(_0x23dfdb){logger[_0x5a85('0x53')](_0x5a85('0x54'),_0x23dfdb);throw _0x23dfdb;});}return _0x2478d5;})[_0x5a85('0x26')](respondWithResult(_0x2fd097,0xc9))['catch'](handleError(_0x2fd097,null));};exports['update']=function(_0x5489cb,_0x49df07){if(_0x5489cb['body']['id']){delete _0x5489cb[_0x5a85('0x4c')]['id'];}return db[_0x5a85('0x2e')]['find']({'where':{'id':_0x5489cb[_0x5a85('0x48')]['id']}})[_0x5a85('0x26')](handleEntityNotFound(_0x49df07,null))[_0x5a85('0x26')](saveUpdates(_0x5489cb[_0x5a85('0x4c')],null))[_0x5a85('0x26')](respondWithResult(_0x49df07,null))[_0x5a85('0x46')](handleError(_0x49df07,null));};exports[_0x5a85('0x27')]=function(_0xd245df,_0x5adde0){return db['AnalyticMetric']['find']({'where':{'id':_0xd245df[_0x5a85('0x48')]['id']}})[_0x5a85('0x26')](handleEntityNotFound(_0x5adde0,null))[_0x5a85('0x26')](removeEntity(_0x5adde0,null))[_0x5a85('0x46')](handleError(_0x5adde0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index dd55287..af764eb 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 _0x8124=['analytics_metrics','lodash','util','api','moment','bluebird','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x8124,0x79));var _0x4812=function(_0x2aaba4,_0x55b81c){_0x2aaba4=_0x2aaba4-0x0;var _0x263e18=_0x8124[_0x2aaba4];return _0x263e18;};'use strict';var _=require(_0x4812('0x0'));var util=require(_0x4812('0x1'));var logger=require('../../config/logger')(_0x4812('0x2'));var moment=require(_0x4812('0x3'));var BPromise=require(_0x4812('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4812('0x5'));var rimraf=require('rimraf');var config=require(_0x4812('0x6'));var attributes=require(_0x4812('0x7'));module[_0x4812('0x8')]=function(_0x2cc296,_0x233b94){return _0x2cc296[_0x4812('0x9')](_0x4812('0xa'),attributes,{'tableName':_0x4812('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3456=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','moment','bluebird','request-promise','path','./analyticMetric.attributes'];(function(_0x404edf,_0xf35591){var _0xeee5a2=function(_0x37e992){while(--_0x37e992){_0x404edf['push'](_0x404edf['shift']());}};_0xeee5a2(++_0xf35591);}(_0x3456,0x67));var _0x6345=function(_0x3ed091,_0x3491d4){_0x3ed091=_0x3ed091-0x0;var _0x49f07c=_0x3456[_0x3ed091];return _0x49f07c;};'use strict';var _=require(_0x6345('0x0'));var util=require(_0x6345('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6345('0x2'));var BPromise=require(_0x6345('0x3'));var rp=require(_0x6345('0x4'));var fs=require('fs');var path=require(_0x6345('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6345('0x6'));module[_0x6345('0x7')]=function(_0x167ca3,_0xbd45eb){return _0x167ca3[_0x6345('0x8')](_0x6345('0x9'),attributes,{'tableName':_0x6345('0xa'),'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 aef6c86..befde5f 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 _0x05b0=['client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b0,0x188));var _0x005b=function(_0x1b81ff,_0x3f0979){_0x1b81ff=_0x1b81ff-0x0;var _0x2c3cb7=_0x05b0[_0x1b81ff];return _0x2c3cb7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x005b('0x0'));var BPromise=require(_0x005b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x005b('0x2'));var db=require(_0x005b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x005b('0x4'))(_0x005b('0x5'));var config=require('../../config/environment');var jayson=require(_0x005b('0x6'));var client=jayson[_0x005b('0x7')][_0x005b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98e71c,_0x224c8d,_0x35998d){return new BPromise(function(_0x263bc9,_0x5cff7f){return client[_0x005b('0x9')](_0x98e71c,_0x35998d)[_0x005b('0xa')](function(_0x4c5552){logger['info'](_0x005b('0xb'),_0x224c8d,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x224c8d,_0x005b('0xc'),JSON[_0x005b('0xd')](_0x4c5552));if(_0x4c5552['error']){if(_0x4c5552[_0x005b('0xe')][_0x005b('0xf')]===0x1f4){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0x4c5552[_0x005b('0xe')][_0x005b('0x10')]);return _0x5cff7f(_0x4c5552[_0x005b('0xe')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x224c8d,_0x4c5552[_0x005b('0xe')]['message']);return _0x263bc9(_0x4c5552[_0x005b('0xe')]['message']);}else{logger[_0x005b('0x11')](_0x005b('0xb'),_0x224c8d,_0x005b('0xc'));_0x263bc9(_0x4c5552[_0x005b('0x12')][_0x005b('0x10')]);}})['catch'](function(_0xa3c3fb){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0xa3c3fb);_0x5cff7f(_0xa3c3fb);});});} \ No newline at end of file +var _0x894f=['jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x503a05,_0x798fa9){var _0x290137=function(_0xd00302){while(--_0xd00302){_0x503a05['push'](_0x503a05['shift']());}};_0x290137(++_0x798fa9);}(_0x894f,0x14d));var _0xf894=function(_0x3b1744,_0x4336b3){_0x3b1744=_0x3b1744-0x0;var _0xd796e7=_0x894f[_0x3b1744];return _0xd796e7;};'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')]('AnalyticMetric,\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']('AnalyticMetric,\x20%s,\x20%s',_0x371f86,_0x1865be);_0x3d8f21(_0x1865be);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index bcff96c..8a365a4 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 _0x160f=['get','index','show','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x4059cf,_0x46458e){var _0x181ef1=function(_0x10a1bc){while(--_0x10a1bc){_0x4059cf['push'](_0x4059cf['shift']());}};_0x181ef1(++_0x46458e);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var timeout=require(_0xf160('0x3'));var express=require('express');var router=express[_0xf160('0x4')]();var auth=require(_0xf160('0x5'));var interaction=require(_0xf160('0x6'));var config=require(_0xf160('0x7'));var controller=require(_0xf160('0x8'));router[_0xf160('0x9')]('/',auth['isAuthenticated'](),controller[_0xf160('0xa')]);router[_0xf160('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf160('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf160('0xc')](_0xf160('0xd'),auth[_0xf160('0xe')](),controller[_0xf160('0xf')]);router['delete']('/:id',auth[_0xf160('0xe')](),controller[_0xf160('0x10')]);module[_0xf160('0x11')]=router; \ No newline at end of file +var _0xb8a0=['update','delete','destroy','exports','path','connect-timeout','Router','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x17a429,_0x1fe5c4){var _0x394b17=function(_0x41b279){while(--_0x41b279){_0x17a429['push'](_0x17a429['shift']());}};_0x394b17(++_0x1fe5c4);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x4c0ba3,_0x2c006d){_0x4c0ba3=_0x4c0ba3-0x0;var _0x25d7bf=_0xb8a0[_0x4c0ba3];return _0x25d7bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b8a('0x0'));var timeout=require(_0x0b8a('0x1'));var express=require('express');var router=express[_0x0b8a('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x0b8a('0x3')]('/',auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x5')]);router[_0x0b8a('0x3')](_0x0b8a('0x6'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x7')]);router[_0x0b8a('0x8')]('/',auth[_0x0b8a('0x4')](),controller[_0x0b8a('0x9')]);router[_0x0b8a('0xa')](_0x0b8a('0x6'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0xb')]);router[_0x0b8a('0xc')](_0x0b8a('0x6'),auth[_0x0b8a('0x4')](),controller[_0x0b8a('0xd')]);module[_0x0b8a('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d6b4847..6836818 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 _0x5ab3=['sequelize'];(function(_0x37c942,_0x12f39b){var _0x17185c=function(_0x2b925a){while(--_0x2b925a){_0x37c942['push'](_0x37c942['shift']());}};_0x17185c(++_0x12f39b);}(_0x5ab3,0x16f));var _0x35ab=function(_0x26f03e,_0x2d3ae4){_0x26f03e=_0x26f03e-0x0;var _0x32394a=_0x5ab3[_0x26f03e];return _0x32394a;};'use strict';var Sequelize=require(_0x35ab('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xe96d=['exports','TEXT'];(function(_0x45d88e,_0xa850d6){var _0x46d38c=function(_0x326079){while(--_0x326079){_0x45d88e['push'](_0x45d88e['shift']());}};_0x46d38c(++_0xa850d6);}(_0xe96d,0x188));var _0xde96=function(_0xb00858,_0x12416f){_0xb00858=_0xb00858-0x0;var _0x4ad783=_0xe96d[_0xb00858];return _0x4ad783;};'use strict';var Sequelize=require('sequelize');module[_0xde96('0x0')]={'tree':{'type':Sequelize[_0xde96('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a1602ad..e237a78 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 _0x985b=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','key','VIRTUAL','field','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','params','rawAttributes','length','merge','create','body','update','find','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x209c0b,_0x249bd9){var _0xb5b30b=function(_0x50c37b){while(--_0x50c37b){_0x209c0b['push'](_0x209c0b['shift']());}};_0xb5b30b(++_0x249bd9);}(_0x985b,0xd4));var _0xb985=function(_0x5b3afe,_0x418d4f){_0x5b3afe=_0x5b3afe-0x0;var _0x3141af=_0x985b[_0x5b3afe];return _0x3141af;};'use strict';var pdf=require(_0xb985('0x0'));var emlformat=require(_0xb985('0x1'));var rimraf=require(_0xb985('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb985('0x3'));var rp=require(_0xb985('0x4'));var moment=require(_0xb985('0x5'));var BPromise=require(_0xb985('0x6'));var Mustache=require(_0xb985('0x7'));var util=require(_0xb985('0x8'));var path=require(_0xb985('0x9'));var sox=require(_0xb985('0xa'));var csv=require(_0xb985('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb985('0xc'));var squel=require(_0xb985('0xd'));var crypto=require(_0xb985('0xe'));var jsforce=require(_0xb985('0xf'));var deskjs=require(_0xb985('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb985('0x11'));var Papa=require('papaparse');var Redis=require(_0xb985('0x12'));var authService=require(_0xb985('0x13'));var qs=require(_0xb985('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb985('0x15'))(_0xb985('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb985('0x17'))['db'];function respondWithStatusCode(_0x490b82,_0x1a9ebe){_0x1a9ebe=_0x1a9ebe||0xcc;return function(_0x5e22bd){if(_0x5e22bd){return _0x490b82[_0xb985('0x18')](_0x1a9ebe);}return _0x490b82[_0xb985('0x19')](_0x1a9ebe)[_0xb985('0x1a')]();};}function respondWithResult(_0x4d61f7,_0x31ce94){_0x31ce94=_0x31ce94||0xc8;return function(_0x85992){if(_0x85992){return _0x4d61f7[_0xb985('0x19')](_0x31ce94)[_0xb985('0x1b')](_0x85992);}};}function respondWithFilteredResult(_0x4d7920,_0x3ab029){return function(_0x454898){if(_0x454898){var _0x3e4fbb=_0x454898[_0xb985('0x1c')],_0x240706=_0x3ab029[_0xb985('0x1d')],_0x4f1936=_0x3ab029['offset']+_0x3ab029[_0xb985('0x1e')],_0x46ae24;if(_0x4f1936>=_0x3e4fbb){_0x4f1936=_0x3e4fbb;_0x46ae24=0xc8;}else{_0x46ae24=0xce;}_0x4d7920[_0xb985('0x19')](_0x46ae24);return _0x4d7920[_0xb985('0x1f')](_0xb985('0x20'),_0x240706+'-'+_0x4f1936+'/'+_0x3e4fbb)[_0xb985('0x1b')](_0x454898);}return null;};}function patchUpdates(_0x1be5bd){return function(_0x4492bb){try{jsonpatch[_0xb985('0x21')](_0x4492bb,_0x1be5bd,!![]);}catch(_0x528b85){return BPromise[_0xb985('0x22')](_0x528b85);}return _0x4492bb[_0xb985('0x23')]();};}function saveUpdates(_0x508cfd,_0x305060){return function(_0xe0210d){if(_0xe0210d){return _0xe0210d['update'](_0x508cfd)[_0xb985('0x24')](function(_0x1708aa){return _0x1708aa;});}return null;};}function removeEntity(_0x443db5,_0x4ca6a1){return function(_0x1efbb1){if(_0x1efbb1){return _0x1efbb1['destroy']()[_0xb985('0x24')](function(){_0x443db5[_0xb985('0x19')](0xcc)[_0xb985('0x1a')]();});}};}function handleEntityNotFound(_0xb3c34,_0x5a2233){return function(_0x4f237f){if(!_0x4f237f){_0xb3c34[_0xb985('0x18')](0x194);}return _0x4f237f;};}function handleError(_0x48d2eb,_0x19ca48){_0x19ca48=_0x19ca48||0x1f4;return function(_0x3d494f){logger[_0xb985('0x25')](_0x3d494f[_0xb985('0x26')]);if(_0x3d494f['name']){delete _0x3d494f[_0xb985('0x27')];}_0x48d2eb['status'](_0x19ca48)[_0xb985('0x28')](_0x3d494f);};}exports[_0xb985('0x29')]=function(_0x49a980,_0x5edb85){var _0x1d8ca5={},_0x3c139d={},_0x57b36d={'count':0x0,'rows':[]};var _0x332f85=db['AnalyticTreeReport']['rawAttributes'];_0x3c139d[_0xb985('0x2a')]=_[_0xb985('0x2b')](_0x332f85);_0x3c139d[_0xb985('0x2c')]=_[_0xb985('0x2b')](_0x49a980['query']);_0x3c139d[_0xb985('0x2d')]=_[_0xb985('0x2e')](_0x3c139d[_0xb985('0x2a')],_0x3c139d['query']);_0x1d8ca5[_0xb985('0x2f')]=_[_0xb985('0x2e')](_0x3c139d[_0xb985('0x2a')],qs['fields'](_0x49a980[_0xb985('0x2c')][_0xb985('0x30')]));_0x1d8ca5[_0xb985('0x2f')]=_0x1d8ca5[_0xb985('0x2f')]['length']?_0x1d8ca5[_0xb985('0x2f')]:_0x3c139d[_0xb985('0x2a')];if(!_0x49a980['query'][_0xb985('0x31')](_0xb985('0x32'))){_0x1d8ca5[_0xb985('0x1e')]=qs['limit'](_0x49a980['query'][_0xb985('0x1e')]);_0x1d8ca5[_0xb985('0x1d')]=qs['offset'](_0x49a980['query'][_0xb985('0x1d')]);}_0x1d8ca5[_0xb985('0x33')]=qs[_0xb985('0x34')](_0x49a980[_0xb985('0x2c')][_0xb985('0x34')]);_0x1d8ca5['where']=qs['filters'](_[_0xb985('0x35')](_0x49a980['query'],_0x3c139d['filters']));if(_0x49a980['query'][_0xb985('0x36')]){_0x1d8ca5[_0xb985('0x37')]=_['merge'](_0x1d8ca5[_0xb985('0x37')],{'$or':_['map'](_0x332f85,function(_0x33c6e5){if(_0x33c6e5['type'][_0xb985('0x38')]!==_0xb985('0x39')){var _0x1b0d83={};_0x1b0d83[_0x33c6e5[_0xb985('0x3a')]]={'$like':'%'+_0x49a980[_0xb985('0x2c')]['filter']+'%'};return _0x1b0d83;}})});}_0x1d8ca5=_['merge']({},_0x1d8ca5,_0x49a980[_0xb985('0x3b')]);var _0x3785a9={'where':_0x1d8ca5['where']};return db['AnalyticTreeReport'][_0xb985('0x1c')](_0x3785a9)['then'](function(_0x377d5a){_0x57b36d[_0xb985('0x1c')]=_0x377d5a;if(_0x49a980[_0xb985('0x2c')][_0xb985('0x3c')]){_0x1d8ca5[_0xb985('0x3d')]=[{'all':!![]}];}return db[_0xb985('0x3e')][_0xb985('0x3f')](_0x1d8ca5);})['then'](function(_0x25d793){_0x57b36d[_0xb985('0x40')]=_0x25d793;return _0x57b36d;})[_0xb985('0x24')](respondWithFilteredResult(_0x5edb85,_0x1d8ca5))[_0xb985('0x41')](handleError(_0x5edb85,null));};exports[_0xb985('0x42')]=function(_0x2ccb54,_0x1fbfd8){var _0x1497af={'raw':!![],'where':{'id':_0x2ccb54[_0xb985('0x43')]['id']}},_0x5d5e6e={};_0x5d5e6e['model']=_[_0xb985('0x2b')](db[_0xb985('0x3e')][_0xb985('0x44')]);_0x5d5e6e['query']=_[_0xb985('0x2b')](_0x2ccb54[_0xb985('0x2c')]);_0x5d5e6e['filters']=_[_0xb985('0x2e')](_0x5d5e6e[_0xb985('0x2a')],_0x5d5e6e[_0xb985('0x2c')]);_0x1497af['attributes']=_['intersection'](_0x5d5e6e[_0xb985('0x2a')],qs[_0xb985('0x30')](_0x2ccb54[_0xb985('0x2c')][_0xb985('0x30')]));_0x1497af[_0xb985('0x2f')]=_0x1497af[_0xb985('0x2f')][_0xb985('0x45')]?_0x1497af[_0xb985('0x2f')]:_0x5d5e6e[_0xb985('0x2a')];if(_0x2ccb54[_0xb985('0x2c')][_0xb985('0x3c')]){_0x1497af[_0xb985('0x3d')]=[{'all':!![]}];}_0x1497af=_[_0xb985('0x46')]({},_0x1497af,_0x2ccb54[_0xb985('0x3b')]);return db[_0xb985('0x3e')]['find'](_0x1497af)[_0xb985('0x24')](handleEntityNotFound(_0x1fbfd8,null))['then'](respondWithResult(_0x1fbfd8,null))[_0xb985('0x41')](handleError(_0x1fbfd8,null));};exports['create']=function(_0x5c92c,_0x89b6a2){return db[_0xb985('0x3e')][_0xb985('0x47')](_0x5c92c[_0xb985('0x48')],{})[_0xb985('0x24')](respondWithResult(_0x89b6a2,0xc9))['catch'](handleError(_0x89b6a2,null));};exports[_0xb985('0x49')]=function(_0x2f3385,_0x1209b4){if(_0x2f3385['body']['id']){delete _0x2f3385['body']['id'];}return db['AnalyticTreeReport'][_0xb985('0x4a')]({'where':{'id':_0x2f3385[_0xb985('0x43')]['id']}})['then'](handleEntityNotFound(_0x1209b4,null))['then'](saveUpdates(_0x2f3385[_0xb985('0x48')],null))[_0xb985('0x24')](respondWithResult(_0x1209b4,null))['catch'](handleError(_0x1209b4,null));};exports[_0xb985('0x4b')]=function(_0x424ece,_0xb01724){return db['AnalyticTreeReport']['find']({'where':{'id':_0x424ece['params']['id']}})[_0xb985('0x24')](handleEntityNotFound(_0xb01724,null))[_0xb985('0x24')](removeEntity(_0xb01724,null))['catch'](handleError(_0xb01724,null));}; \ No newline at end of file +var _0x6e0a=['index','rawAttributes','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','options','includeAll','include','AnalyticTreeReport','findAll','catch','show','params','merge','find','create','body','html-pdf','rimraf','request-promise','moment','util','path','sox','ejs','squel','crypto','jsforce','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x6e0a,0x12c));var _0xa6e0=function(_0x29e7fb,_0x5b2ff3){_0x29e7fb=_0x29e7fb-0x0;var _0x171dad=_0x6e0a[_0x29e7fb];return _0x171dad;};'use strict';var pdf=require(_0xa6e0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa6e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa6e0('0x2'));var moment=require(_0xa6e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6e0('0x4'));var path=require(_0xa6e0('0x5'));var sox=require(_0xa6e0('0x6'));var csv=require('to-csv');var ejs=require(_0xa6e0('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa6e0('0x8'));var crypto=require(_0xa6e0('0x9'));var jsforce=require(_0xa6e0('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6e0('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa6e0('0xc'));var logger=require(_0xa6e0('0xd'))(_0xa6e0('0xe'));var utils=require('../../config/utils');var config=require(_0xa6e0('0xf'));var db=require(_0xa6e0('0x10'))['db'];function respondWithStatusCode(_0xe2634a,_0x17d9ee){_0x17d9ee=_0x17d9ee||0xcc;return function(_0x8f5790){if(_0x8f5790){return _0xe2634a['sendStatus'](_0x17d9ee);}return _0xe2634a[_0xa6e0('0x11')](_0x17d9ee)[_0xa6e0('0x12')]();};}function respondWithResult(_0x373bd1,_0x29ab0c){_0x29ab0c=_0x29ab0c||0xc8;return function(_0x3e1f79){if(_0x3e1f79){return _0x373bd1[_0xa6e0('0x11')](_0x29ab0c)[_0xa6e0('0x13')](_0x3e1f79);}};}function respondWithFilteredResult(_0x494d73,_0x1da8bc){return function(_0x4a4790){if(_0x4a4790){var _0x2ead1f=_0x4a4790[_0xa6e0('0x14')],_0x1b7f72=_0x1da8bc[_0xa6e0('0x15')],_0x5534d8=_0x1da8bc[_0xa6e0('0x15')]+_0x1da8bc[_0xa6e0('0x16')],_0x9ee05d;if(_0x5534d8>=_0x2ead1f){_0x5534d8=_0x2ead1f;_0x9ee05d=0xc8;}else{_0x9ee05d=0xce;}_0x494d73['status'](_0x9ee05d);return _0x494d73[_0xa6e0('0x17')](_0xa6e0('0x18'),_0x1b7f72+'-'+_0x5534d8+'/'+_0x2ead1f)['json'](_0x4a4790);}return null;};}function patchUpdates(_0x98bad9){return function(_0x5bf47c){try{jsonpatch[_0xa6e0('0x19')](_0x5bf47c,_0x98bad9,!![]);}catch(_0x511528){return BPromise[_0xa6e0('0x1a')](_0x511528);}return _0x5bf47c[_0xa6e0('0x1b')]();};}function saveUpdates(_0x467cbf,_0x2dbf0c){return function(_0x14e9a3){if(_0x14e9a3){return _0x14e9a3[_0xa6e0('0x1c')](_0x467cbf)[_0xa6e0('0x1d')](function(_0x273194){return _0x273194;});}return null;};}function removeEntity(_0x2973ec,_0xdbd7d0){return function(_0x31ee35){if(_0x31ee35){return _0x31ee35[_0xa6e0('0x1e')]()['then'](function(){_0x2973ec[_0xa6e0('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f69f,_0x18f368){return function(_0x568757){if(!_0x568757){_0x22f69f[_0xa6e0('0x1f')](0x194);}return _0x568757;};}function handleError(_0x57de18,_0x17a782){_0x17a782=_0x17a782||0x1f4;return function(_0x344f20){logger[_0xa6e0('0x20')](_0x344f20[_0xa6e0('0x21')]);if(_0x344f20['name']){delete _0x344f20['name'];}_0x57de18[_0xa6e0('0x11')](_0x17a782)[_0xa6e0('0x22')](_0x344f20);};}exports[_0xa6e0('0x23')]=function(_0x3d4e23,_0x32b61a){var _0x4ee3cd={},_0x414e7d={},_0x225127={'count':0x0,'rows':[]};var _0x394002=db['AnalyticTreeReport'][_0xa6e0('0x24')];_0x414e7d[_0xa6e0('0x25')]=_[_0xa6e0('0x26')](_0x394002);_0x414e7d['query']=_['keys'](_0x3d4e23['query']);_0x414e7d[_0xa6e0('0x27')]=_[_0xa6e0('0x28')](_0x414e7d['model'],_0x414e7d['query']);_0x4ee3cd[_0xa6e0('0x29')]=_[_0xa6e0('0x28')](_0x414e7d[_0xa6e0('0x25')],qs[_0xa6e0('0x2a')](_0x3d4e23['query'][_0xa6e0('0x2a')]));_0x4ee3cd[_0xa6e0('0x29')]=_0x4ee3cd[_0xa6e0('0x29')][_0xa6e0('0x2b')]?_0x4ee3cd['attributes']:_0x414e7d[_0xa6e0('0x25')];if(!_0x3d4e23[_0xa6e0('0x2c')][_0xa6e0('0x2d')](_0xa6e0('0x2e'))){_0x4ee3cd[_0xa6e0('0x16')]=qs[_0xa6e0('0x16')](_0x3d4e23[_0xa6e0('0x2c')][_0xa6e0('0x16')]);_0x4ee3cd[_0xa6e0('0x15')]=qs[_0xa6e0('0x15')](_0x3d4e23[_0xa6e0('0x2c')][_0xa6e0('0x15')]);}_0x4ee3cd[_0xa6e0('0x2f')]=qs['sort'](_0x3d4e23['query'][_0xa6e0('0x30')]);_0x4ee3cd[_0xa6e0('0x31')]=qs[_0xa6e0('0x27')](_[_0xa6e0('0x32')](_0x3d4e23[_0xa6e0('0x2c')],_0x414e7d['filters']));if(_0x3d4e23[_0xa6e0('0x2c')][_0xa6e0('0x33')]){_0x4ee3cd['where']=_['merge'](_0x4ee3cd[_0xa6e0('0x31')],{'$or':_['map'](_0x394002,function(_0x5b885a){if(_0x5b885a[_0xa6e0('0x34')]['key']!==_0xa6e0('0x35')){var _0x3e33a8={};_0x3e33a8[_0x5b885a[_0xa6e0('0x36')]]={'$like':'%'+_0x3d4e23[_0xa6e0('0x2c')]['filter']+'%'};return _0x3e33a8;}})});}_0x4ee3cd=_['merge']({},_0x4ee3cd,_0x3d4e23[_0xa6e0('0x37')]);var _0x558041={'where':_0x4ee3cd[_0xa6e0('0x31')]};return db['AnalyticTreeReport'][_0xa6e0('0x14')](_0x558041)[_0xa6e0('0x1d')](function(_0x2540bc){_0x225127[_0xa6e0('0x14')]=_0x2540bc;if(_0x3d4e23['query'][_0xa6e0('0x38')]){_0x4ee3cd[_0xa6e0('0x39')]=[{'all':!![]}];}return db[_0xa6e0('0x3a')][_0xa6e0('0x3b')](_0x4ee3cd);})[_0xa6e0('0x1d')](function(_0x123779){_0x225127['rows']=_0x123779;return _0x225127;})[_0xa6e0('0x1d')](respondWithFilteredResult(_0x32b61a,_0x4ee3cd))[_0xa6e0('0x3c')](handleError(_0x32b61a,null));};exports[_0xa6e0('0x3d')]=function(_0x114e19,_0x18fadf){var _0x1c7822={'raw':!![],'where':{'id':_0x114e19[_0xa6e0('0x3e')]['id']}},_0x24a4b1={};_0x24a4b1['model']=_[_0xa6e0('0x26')](db[_0xa6e0('0x3a')][_0xa6e0('0x24')]);_0x24a4b1[_0xa6e0('0x2c')]=_[_0xa6e0('0x26')](_0x114e19[_0xa6e0('0x2c')]);_0x24a4b1[_0xa6e0('0x27')]=_[_0xa6e0('0x28')](_0x24a4b1[_0xa6e0('0x25')],_0x24a4b1[_0xa6e0('0x2c')]);_0x1c7822[_0xa6e0('0x29')]=_[_0xa6e0('0x28')](_0x24a4b1[_0xa6e0('0x25')],qs['fields'](_0x114e19[_0xa6e0('0x2c')][_0xa6e0('0x2a')]));_0x1c7822['attributes']=_0x1c7822[_0xa6e0('0x29')][_0xa6e0('0x2b')]?_0x1c7822[_0xa6e0('0x29')]:_0x24a4b1[_0xa6e0('0x25')];if(_0x114e19[_0xa6e0('0x2c')][_0xa6e0('0x38')]){_0x1c7822[_0xa6e0('0x39')]=[{'all':!![]}];}_0x1c7822=_[_0xa6e0('0x3f')]({},_0x1c7822,_0x114e19[_0xa6e0('0x37')]);return db[_0xa6e0('0x3a')][_0xa6e0('0x40')](_0x1c7822)[_0xa6e0('0x1d')](handleEntityNotFound(_0x18fadf,null))[_0xa6e0('0x1d')](respondWithResult(_0x18fadf,null))[_0xa6e0('0x3c')](handleError(_0x18fadf,null));};exports[_0xa6e0('0x41')]=function(_0x581973,_0x42ffaf){return db[_0xa6e0('0x3a')]['create'](_0x581973[_0xa6e0('0x42')],{})[_0xa6e0('0x1d')](respondWithResult(_0x42ffaf,0xc9))[_0xa6e0('0x3c')](handleError(_0x42ffaf,null));};exports[_0xa6e0('0x1c')]=function(_0x4109a5,_0x4a8f9a){if(_0x4109a5[_0xa6e0('0x42')]['id']){delete _0x4109a5[_0xa6e0('0x42')]['id'];}return db[_0xa6e0('0x3a')][_0xa6e0('0x40')]({'where':{'id':_0x4109a5[_0xa6e0('0x3e')]['id']}})[_0xa6e0('0x1d')](handleEntityNotFound(_0x4a8f9a,null))['then'](saveUpdates(_0x4109a5[_0xa6e0('0x42')],null))['then'](respondWithResult(_0x4a8f9a,null))[_0xa6e0('0x3c')](handleError(_0x4a8f9a,null));};exports[_0xa6e0('0x1e')]=function(_0xd77657,_0x57f326){return db[_0xa6e0('0x3a')]['find']({'where':{'id':_0xd77657['params']['id']}})[_0xa6e0('0x1d')](handleEntityNotFound(_0x57f326,null))[_0xa6e0('0x1d')](removeEntity(_0x57f326,null))['catch'](handleError(_0x57f326,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d0cd2f7..9a35775 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 _0x31c7=['analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1b3c4c,_0x5c0bef){var _0x22bc2e=function(_0x16bca0){while(--_0x16bca0){_0x1b3c4c['push'](_0x1b3c4c['shift']());}};_0x22bc2e(++_0x5c0bef);}(_0x31c7,0xd2));var _0x731c=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x31c7[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x731c('0x0'));var logger=require(_0x731c('0x1'))(_0x731c('0x2'));var moment=require(_0x731c('0x3'));var BPromise=require(_0x731c('0x4'));var rp=require(_0x731c('0x5'));var fs=require('fs');var path=require(_0x731c('0x6'));var rimraf=require(_0x731c('0x7'));var config=require(_0x731c('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x731c('0x9')]=function(_0x54af0f,_0xe5ac65){return _0x54af0f['define']('AnalyticTreeReport',attributes,{'tableName':_0x731c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f75=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x225c3c,_0x5272f5){var _0x11b69a=function(_0x17f414){while(--_0x17f414){_0x225c3c['push'](_0x225c3c['shift']());}};_0x11b69a(++_0x5272f5);}(_0x6f75,0xf5));var _0x56f7=function(_0x14fcad,_0x437e1d){_0x14fcad=_0x14fcad-0x0;var _0x29556d=_0x6f75[_0x14fcad];return _0x29556d;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require(_0x56f7('0x7'));var rimraf=require(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var attributes=require(_0x56f7('0xa'));module[_0x56f7('0xb')]=function(_0x3d601f,_0x3bf44c){return _0x3d601f['define'](_0x56f7('0xc'),attributes,{'tableName':_0x56f7('0xd'),'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 fe4fd67..72b9ade 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 _0xe041=['debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x34c78b,_0xf5e8f3){var _0x197a27=function(_0x2b5720){while(--_0x2b5720){_0x34c78b['push'](_0x34c78b['shift']());}};_0x197a27(++_0xf5e8f3);}(_0xe041,0xb8));var _0x1e04=function(_0x31dcbc,_0x1709ad){_0x31dcbc=_0x31dcbc-0x0;var _0x2f6427=_0xe041[_0x31dcbc];return _0x2f6427;};'use strict';var _=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var moment=require(_0x1e04('0x2'));var BPromise=require(_0x1e04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e04('0x4'));var db=require(_0x1e04('0x5'))['db'];var utils=require(_0x1e04('0x6'));var logger=require('../../config/logger')(_0x1e04('0x7'));var config=require('../../config/environment');var jayson=require(_0x1e04('0x8'));var client=jayson[_0x1e04('0x9')][_0x1e04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210b41,_0x2a0835,_0x597c07){return new BPromise(function(_0x43b81f,_0x2c8e69){return client['request'](_0x210b41,_0x597c07)[_0x1e04('0xb')](function(_0x2aad9b){logger[_0x1e04('0xc')](_0x1e04('0xd'),_0x2a0835,'request\x20sent');logger[_0x1e04('0xe')](_0x1e04('0xf'),_0x2a0835,_0x1e04('0x10'),JSON[_0x1e04('0x11')](_0x2aad9b));if(_0x2aad9b[_0x1e04('0x12')]){if(_0x2aad9b[_0x1e04('0x12')][_0x1e04('0x13')]===0x1f4){logger[_0x1e04('0x12')](_0x1e04('0xd'),_0x2a0835,_0x2aad9b[_0x1e04('0x12')][_0x1e04('0x14')]);return _0x2c8e69(_0x2aad9b[_0x1e04('0x12')][_0x1e04('0x14')]);}logger[_0x1e04('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2a0835,_0x2aad9b[_0x1e04('0x12')][_0x1e04('0x14')]);return _0x43b81f(_0x2aad9b[_0x1e04('0x12')]['message']);}else{logger[_0x1e04('0xc')](_0x1e04('0xd'),_0x2a0835,_0x1e04('0x10'));_0x43b81f(_0x2aad9b[_0x1e04('0x15')]['message']);}})['catch'](function(_0x3ffa22){logger['error'](_0x1e04('0xd'),_0x2a0835,_0x3ffa22);_0x2c8e69(_0x3ffa22);});});} \ No newline at end of file +var _0x89b5=['AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3abb36,_0x3b0a7c){var _0x30c840=function(_0x1814af){while(--_0x1814af){_0x3abb36['push'](_0x3abb36['shift']());}};_0x30c840(++_0x3b0a7c);}(_0x89b5,0x1e2));var _0x589b=function(_0x512c98,_0x308b91){_0x512c98=_0x512c98-0x0;var _0xc1b60d=_0x89b5[_0x512c98];return _0xc1b60d;};'use strict';var _=require(_0x589b('0x0'));var util=require('util');var moment=require(_0x589b('0x1'));var BPromise=require(_0x589b('0x2'));var rs=require(_0x589b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x589b('0x4'));var logger=require('../../config/logger')(_0x589b('0x5'));var config=require(_0x589b('0x6'));var jayson=require(_0x589b('0x7'));var client=jayson[_0x589b('0x8')][_0x589b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42eae8,_0x420298,_0x5d76d8){return new BPromise(function(_0x1dbe0e,_0x257bfe){return client['request'](_0x42eae8,_0x5d76d8)[_0x589b('0xa')](function(_0x18004f){logger[_0x589b('0xb')](_0x589b('0xc'),_0x420298,_0x589b('0xd'));logger[_0x589b('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x420298,_0x589b('0xd'),JSON['stringify'](_0x18004f));if(_0x18004f[_0x589b('0xf')]){if(_0x18004f[_0x589b('0xf')][_0x589b('0x10')]===0x1f4){logger[_0x589b('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x420298,_0x18004f['error'][_0x589b('0x11')]);return _0x257bfe(_0x18004f[_0x589b('0xf')][_0x589b('0x11')]);}logger[_0x589b('0xf')](_0x589b('0xc'),_0x420298,_0x18004f[_0x589b('0xf')]['message']);return _0x1dbe0e(_0x18004f[_0x589b('0xf')][_0x589b('0x11')]);}else{logger[_0x589b('0xb')](_0x589b('0xc'),_0x420298,_0x589b('0xd'));_0x1dbe0e(_0x18004f[_0x589b('0x12')][_0x589b('0x11')]);}})['catch'](function(_0xab4bb6){logger[_0x589b('0xf')](_0x589b('0xc'),_0x420298,_0xab4bb6);_0x257bfe(_0xab4bb6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 92f20d1..8bb1013 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 _0xb4df=['/:id','post','create','destroy','exports','multer','util','express','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x34db07,_0x9fda7e){var _0xe20be4=function(_0x10ff62){while(--_0x10ff62){_0x34db07['push'](_0x34db07['shift']());}};_0xe20be4(++_0x9fda7e);}(_0xb4df,0xc9));var _0xfb4d=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb4df[_0x369151];return _0x4292d5;};'use strict';var multer=require(_0xfb4d('0x0'));var util=require(_0xfb4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfb4d('0x2'));var router=express[_0xfb4d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb4d('0x4'));var controller=require(_0xfb4d('0x5'));router[_0xfb4d('0x6')]('/',auth[_0xfb4d('0x7')](),controller[_0xfb4d('0x8')]);router[_0xfb4d('0x6')](_0xfb4d('0x9'),auth[_0xfb4d('0x7')](),controller['show']);router[_0xfb4d('0xa')]('/',auth[_0xfb4d('0x7')](),controller[_0xfb4d('0xb')]);router['put'](_0xfb4d('0x9'),auth[_0xfb4d('0x7')](),controller['update']);router['delete'](_0xfb4d('0x9'),auth[_0xfb4d('0x7')](),controller[_0xfb4d('0xc')]);module[_0xfb4d('0xd')]=router; \ No newline at end of file +var _0xa7d4=['/:id','show','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x2c3919,_0x46d781){var _0x11f383=function(_0x17611c){while(--_0x17611c){_0x2c3919['push'](_0x2c3919['shift']());}};_0x11f383(++_0x46d781);}(_0xa7d4,0x65));var _0x4a7d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa7d4[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4a7d('0x0'));var util=require(_0x4a7d('0x1'));var path=require(_0x4a7d('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a7d('0x3'));var router=express[_0x4a7d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4a7d('0x5'));var config=require(_0x4a7d('0x6'));var controller=require(_0x4a7d('0x7'));router[_0x4a7d('0x8')]('/',auth[_0x4a7d('0x9')](),controller[_0x4a7d('0xa')]);router['get'](_0x4a7d('0xb'),auth[_0x4a7d('0x9')](),controller[_0x4a7d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4a7d('0xd')]('/:id',auth[_0x4a7d('0x9')](),controller[_0x4a7d('0xe')]);router['delete'](_0x4a7d('0xb'),auth[_0x4a7d('0x9')](),controller['destroy']);module[_0x4a7d('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 2a643f1..55d9514 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 _0xd005=['sequelize','exports','STRING'];(function(_0x18e108,_0x13a6ea){var _0x213ce3=function(_0x4bde26){while(--_0x4bde26){_0x18e108['push'](_0x18e108['shift']());}};_0x213ce3(++_0x13a6ea);}(_0xd005,0xe7));var _0x5d00=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd005[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x5d00('0x0'));module[_0x5d00('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x5d00('0x2')]},'type':{'type':Sequelize[_0x5d00('0x2')]}}; \ No newline at end of file +var _0xabe9=['exports','STRING'];(function(_0x47f60f,_0x4758b5){var _0x4da73e=function(_0x127cd6){while(--_0x127cd6){_0x47f60f['push'](_0x47f60f['shift']());}};_0x4da73e(++_0x4758b5);}(_0xabe9,0xfc));var _0x9abe=function(_0xa9df9e,_0x4e8009){_0xa9df9e=_0xa9df9e-0x0;var _0x4d2605=_0xabe9[_0xa9df9e];return _0x4d2605;};'use strict';var Sequelize=require('sequelize');module[_0x9abe('0x0')]={'name':{'type':Sequelize[_0x9abe('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9abe('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6754812..b979569 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 _0x7e27=['join','root','server/files/attachments/','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','apply','reject','save','then','destroy','end','error','stack','send','index','Attachment','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','update','body','create','name','originalname','basename','filename','file','mimetype','download','findOne'];(function(_0x2df8f0,_0x3c96e8){var _0x3986c2=function(_0x2b99a4){while(--_0x2b99a4){_0x2df8f0['push'](_0x2df8f0['shift']());}};_0x3986c2(++_0x3c96e8);}(_0x7e27,0x15b));var _0x77e2=function(_0x3e9515,_0x2c2679){_0x3e9515=_0x3e9515-0x0;var _0x510acf=_0x7e27[_0x3e9515];return _0x510acf;};'use strict';var pdf=require(_0x77e2('0x0'));var emlformat=require(_0x77e2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77e2('0x2'));var rp=require(_0x77e2('0x3'));var moment=require(_0x77e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77e2('0x5'));var util=require(_0x77e2('0x6'));var path=require(_0x77e2('0x7'));var sox=require(_0x77e2('0x8'));var csv=require(_0x77e2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77e2('0xa'));var squel=require(_0x77e2('0xb'));var crypto=require(_0x77e2('0xc'));var jsforce=require(_0x77e2('0xd'));var deskjs=require(_0x77e2('0xe'));var toCsv=require(_0x77e2('0x9'));var querystring=require(_0x77e2('0xf'));var Papa=require(_0x77e2('0x10'));var Redis=require('ioredis');var authService=require(_0x77e2('0x11'));var qs=require(_0x77e2('0x12'));var hardwareService=require(_0x77e2('0x13'));var logger=require(_0x77e2('0x14'))('api');var utils=require(_0x77e2('0x15'));var config=require(_0x77e2('0x16'));var db=require(_0x77e2('0x17'))['db'];function respondWithStatusCode(_0x3a3aee,_0x5ec5b4){_0x5ec5b4=_0x5ec5b4||0xcc;return function(_0x558e4f){if(_0x558e4f){return _0x3a3aee[_0x77e2('0x18')](_0x5ec5b4);}return _0x3a3aee[_0x77e2('0x19')](_0x5ec5b4)['end']();};}function respondWithResult(_0x2669f7,_0x13e99b){_0x13e99b=_0x13e99b||0xc8;return function(_0x3154b3){if(_0x3154b3){return _0x2669f7[_0x77e2('0x19')](_0x13e99b)[_0x77e2('0x1a')](_0x3154b3);}};}function respondWithFilteredResult(_0x3fdc48,_0x29db65){return function(_0x4642c){if(_0x4642c){var _0x635bcc=_0x4642c['count'],_0x1f8915=_0x29db65['offset'],_0x29d9a9=_0x29db65['offset']+_0x29db65[_0x77e2('0x1b')],_0x525c22;if(_0x29d9a9>=_0x635bcc){_0x29d9a9=_0x635bcc;_0x525c22=0xc8;}else{_0x525c22=0xce;}_0x3fdc48[_0x77e2('0x19')](_0x525c22);return _0x3fdc48[_0x77e2('0x1c')]('Content-Range',_0x1f8915+'-'+_0x29d9a9+'/'+_0x635bcc)[_0x77e2('0x1a')](_0x4642c);}return null;};}function patchUpdates(_0x1c2fb7){return function(_0x23455c){try{jsonpatch[_0x77e2('0x1d')](_0x23455c,_0x1c2fb7,!![]);}catch(_0x1926a8){return BPromise[_0x77e2('0x1e')](_0x1926a8);}return _0x23455c[_0x77e2('0x1f')]();};}function saveUpdates(_0x3d16ee,_0x3fdd83){return function(_0x559d7c){if(_0x559d7c){return _0x559d7c['update'](_0x3d16ee)[_0x77e2('0x20')](function(_0x1173a9){return _0x1173a9;});}return null;};}function removeEntity(_0xa66483,_0xbfaba5){return function(_0x516b3f){if(_0x516b3f){return _0x516b3f[_0x77e2('0x21')]()[_0x77e2('0x20')](function(){_0xa66483[_0x77e2('0x19')](0xcc)[_0x77e2('0x22')]();});}};}function handleEntityNotFound(_0x34f812,_0x2875dd){return function(_0x43c9c3){if(!_0x43c9c3){_0x34f812[_0x77e2('0x18')](0x194);}return _0x43c9c3;};}function handleError(_0x7808ca,_0x1c40f9){_0x1c40f9=_0x1c40f9||0x1f4;return function(_0x5d2dcf){logger[_0x77e2('0x23')](_0x5d2dcf[_0x77e2('0x24')]);if(_0x5d2dcf['name']){delete _0x5d2dcf['name'];}_0x7808ca[_0x77e2('0x19')](_0x1c40f9)[_0x77e2('0x25')](_0x5d2dcf);};}exports[_0x77e2('0x26')]=function(_0x42abbf,_0x2d8cd5){var _0x280ab8={},_0x7e0b8d={},_0x54465a={'count':0x0,'rows':[]};var _0x39a985=db[_0x77e2('0x27')]['rawAttributes'];_0x7e0b8d[_0x77e2('0x28')]=_[_0x77e2('0x29')](_0x39a985);_0x7e0b8d[_0x77e2('0x2a')]=_[_0x77e2('0x29')](_0x42abbf[_0x77e2('0x2a')]);_0x7e0b8d[_0x77e2('0x2b')]=_[_0x77e2('0x2c')](_0x7e0b8d[_0x77e2('0x28')],_0x7e0b8d['query']);_0x280ab8[_0x77e2('0x2d')]=_[_0x77e2('0x2c')](_0x7e0b8d[_0x77e2('0x28')],qs[_0x77e2('0x2e')](_0x42abbf[_0x77e2('0x2a')]['fields']));_0x280ab8[_0x77e2('0x2d')]=_0x280ab8['attributes'][_0x77e2('0x2f')]?_0x280ab8[_0x77e2('0x2d')]:_0x7e0b8d[_0x77e2('0x28')];if(!_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x30')](_0x77e2('0x31'))){_0x280ab8['limit']=qs['limit'](_0x42abbf['query'][_0x77e2('0x1b')]);_0x280ab8['offset']=qs[_0x77e2('0x32')](_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x32')]);}_0x280ab8['order']=qs[_0x77e2('0x33')](_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x33')]);_0x280ab8['where']=qs[_0x77e2('0x2b')](_[_0x77e2('0x34')](_0x42abbf[_0x77e2('0x2a')],_0x7e0b8d['filters']));if(_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x35')]){_0x280ab8[_0x77e2('0x36')]=_['merge'](_0x280ab8[_0x77e2('0x36')],{'$or':_[_0x77e2('0x37')](_0x39a985,function(_0x5ea533){if(_0x5ea533[_0x77e2('0x38')][_0x77e2('0x39')]!==_0x77e2('0x3a')){var _0x4f5a22={};_0x4f5a22[_0x5ea533[_0x77e2('0x3b')]]={'$like':'%'+_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x35')]+'%'};return _0x4f5a22;}})});}_0x280ab8=_[_0x77e2('0x3c')]({},_0x280ab8,_0x42abbf[_0x77e2('0x3d')]);var _0x2ef74c={'where':_0x280ab8['where']};return db['Attachment'][_0x77e2('0x3e')](_0x2ef74c)[_0x77e2('0x20')](function(_0x248508){_0x54465a[_0x77e2('0x3e')]=_0x248508;if(_0x42abbf[_0x77e2('0x2a')][_0x77e2('0x3f')]){_0x280ab8[_0x77e2('0x40')]=[{'all':!![]}];}return db[_0x77e2('0x27')][_0x77e2('0x41')](_0x280ab8);})[_0x77e2('0x20')](function(_0x52751d){_0x54465a[_0x77e2('0x42')]=_0x52751d;return _0x54465a;})['then'](respondWithFilteredResult(_0x2d8cd5,_0x280ab8))[_0x77e2('0x43')](handleError(_0x2d8cd5,null));};exports[_0x77e2('0x44')]=function(_0xb40add,_0x388d87){var _0x2d4988={'raw':!![],'where':{'id':_0xb40add[_0x77e2('0x45')]['id']}},_0x2f9d83={};_0x2f9d83['model']=_[_0x77e2('0x29')](db[_0x77e2('0x27')][_0x77e2('0x46')]);_0x2f9d83[_0x77e2('0x2a')]=_[_0x77e2('0x29')](_0xb40add['query']);_0x2f9d83[_0x77e2('0x2b')]=_[_0x77e2('0x2c')](_0x2f9d83[_0x77e2('0x28')],_0x2f9d83[_0x77e2('0x2a')]);_0x2d4988['attributes']=_[_0x77e2('0x2c')](_0x2f9d83[_0x77e2('0x28')],qs[_0x77e2('0x2e')](_0xb40add[_0x77e2('0x2a')][_0x77e2('0x2e')]));_0x2d4988[_0x77e2('0x2d')]=_0x2d4988['attributes'][_0x77e2('0x2f')]?_0x2d4988[_0x77e2('0x2d')]:_0x2f9d83[_0x77e2('0x28')];if(_0xb40add[_0x77e2('0x2a')][_0x77e2('0x3f')]){_0x2d4988[_0x77e2('0x40')]=[{'all':!![]}];}_0x2d4988=_[_0x77e2('0x3c')]({},_0x2d4988,_0xb40add[_0x77e2('0x3d')]);return db[_0x77e2('0x27')][_0x77e2('0x47')](_0x2d4988)['then'](handleEntityNotFound(_0x388d87,null))[_0x77e2('0x20')](respondWithResult(_0x388d87,null))[_0x77e2('0x43')](handleError(_0x388d87,null));};exports[_0x77e2('0x48')]=function(_0x5ab029,_0x247909){if(_0x5ab029[_0x77e2('0x49')]['id']){delete _0x5ab029[_0x77e2('0x49')]['id'];}return db[_0x77e2('0x27')]['find']({'where':{'id':_0x5ab029[_0x77e2('0x45')]['id']}})[_0x77e2('0x20')](handleEntityNotFound(_0x247909,null))[_0x77e2('0x20')](saveUpdates(_0x5ab029[_0x77e2('0x49')],null))[_0x77e2('0x20')](respondWithResult(_0x247909,null))['catch'](handleError(_0x247909,null));};exports[_0x77e2('0x21')]=function(_0x4e2102,_0x142ea3){return db[_0x77e2('0x27')][_0x77e2('0x47')]({'where':{'id':_0x4e2102['params']['id']}})[_0x77e2('0x20')](handleEntityNotFound(_0x142ea3,null))[_0x77e2('0x20')](removeEntity(_0x142ea3,null))['catch'](handleError(_0x142ea3,null));};exports[_0x77e2('0x4a')]=function(_0x3778f6,_0x323746,_0x3916b8){_0x3778f6[_0x77e2('0x49')][_0x77e2('0x4b')]=_0x3778f6['file'][_0x77e2('0x4c')];_0x3778f6[_0x77e2('0x49')][_0x77e2('0x4d')]=_0x3778f6['file'][_0x77e2('0x4e')];_0x3778f6['body'][_0x77e2('0x38')]=_0x3778f6[_0x77e2('0x4f')][_0x77e2('0x50')];return db['Attachment'][_0x77e2('0x4a')](_0x3778f6['body'])[_0x77e2('0x20')](respondWithResult(_0x323746,0xc9))[_0x77e2('0x43')](handleError(_0x323746,null));};exports[_0x77e2('0x51')]=function(_0x295841,_0x2fa62c,_0x145de0){return db[_0x77e2('0x27')][_0x77e2('0x52')]({'where':{'id':_0x295841[_0x77e2('0x45')]['id']},'raw':!![]})[_0x77e2('0x20')](handleEntityNotFound(_0x2fa62c,null))[_0x77e2('0x20')](function(_0x8eee2){if(_0x8eee2){return _0x2fa62c['download'](path[_0x77e2('0x53')](config[_0x77e2('0x54')],_0x77e2('0x55'),_0x8eee2[_0x77e2('0x4d')]));}})[_0x77e2('0x43')](handleError(_0x2fa62c,null));}; \ No newline at end of file +var _0x41a1=['stack','name','send','index','Attachment','rawAttributes','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge','map','type','field','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','create','basename','file','filename','mimetype','download','findOne','join','root','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error'];(function(_0x3b3c32,_0x186407){var _0x17ae88=function(_0x10cb92){while(--_0x10cb92){_0x3b3c32['push'](_0x3b3c32['shift']());}};_0x17ae88(++_0x186407);}(_0x41a1,0x162));var _0x141a=function(_0x2e9fd9,_0x1bf169){_0x2e9fd9=_0x2e9fd9-0x0;var _0x47dec7=_0x41a1[_0x2e9fd9];return _0x47dec7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x141a('0x0'));var rimraf=require(_0x141a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x141a('0x2'));var moment=require(_0x141a('0x3'));var BPromise=require(_0x141a('0x4'));var Mustache=require(_0x141a('0x5'));var util=require(_0x141a('0x6'));var path=require(_0x141a('0x7'));var sox=require(_0x141a('0x8'));var csv=require(_0x141a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x141a('0xa'));var squel=require(_0x141a('0xb'));var crypto=require(_0x141a('0xc'));var jsforce=require(_0x141a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x141a('0x9'));var querystring=require(_0x141a('0xe'));var Papa=require('papaparse');var Redis=require(_0x141a('0xf'));var authService=require(_0x141a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x141a('0x11'));var logger=require('../../config/logger')(_0x141a('0x12'));var utils=require('../../config/utils');var config=require(_0x141a('0x13'));var db=require(_0x141a('0x14'))['db'];function respondWithStatusCode(_0x4bd8e8,_0x3c58e6){_0x3c58e6=_0x3c58e6||0xcc;return function(_0x1a2f99){if(_0x1a2f99){return _0x4bd8e8['sendStatus'](_0x3c58e6);}return _0x4bd8e8[_0x141a('0x15')](_0x3c58e6)[_0x141a('0x16')]();};}function respondWithResult(_0x2061fc,_0x18f62a){_0x18f62a=_0x18f62a||0xc8;return function(_0x4511e8){if(_0x4511e8){return _0x2061fc['status'](_0x18f62a)[_0x141a('0x17')](_0x4511e8);}};}function respondWithFilteredResult(_0x2488e7,_0xeda99b){return function(_0x4d3b3c){if(_0x4d3b3c){var _0x1f5768=_0x4d3b3c[_0x141a('0x18')],_0x5ab950=_0xeda99b['offset'],_0x3efccd=_0xeda99b[_0x141a('0x19')]+_0xeda99b[_0x141a('0x1a')],_0x2951a4;if(_0x3efccd>=_0x1f5768){_0x3efccd=_0x1f5768;_0x2951a4=0xc8;}else{_0x2951a4=0xce;}_0x2488e7[_0x141a('0x15')](_0x2951a4);return _0x2488e7[_0x141a('0x1b')](_0x141a('0x1c'),_0x5ab950+'-'+_0x3efccd+'/'+_0x1f5768)[_0x141a('0x17')](_0x4d3b3c);}return null;};}function patchUpdates(_0x5e18ae){return function(_0x479cc4){try{jsonpatch[_0x141a('0x1d')](_0x479cc4,_0x5e18ae,!![]);}catch(_0xe86ed5){return BPromise[_0x141a('0x1e')](_0xe86ed5);}return _0x479cc4[_0x141a('0x1f')]();};}function saveUpdates(_0x1cde13,_0x5aa711){return function(_0x1a1641){if(_0x1a1641){return _0x1a1641[_0x141a('0x20')](_0x1cde13)['then'](function(_0x21797b){return _0x21797b;});}return null;};}function removeEntity(_0x23706b,_0x43d575){return function(_0x501e02){if(_0x501e02){return _0x501e02['destroy']()[_0x141a('0x21')](function(){_0x23706b[_0x141a('0x15')](0xcc)[_0x141a('0x16')]();});}};}function handleEntityNotFound(_0x250fa8,_0x380f9b){return function(_0x3db037){if(!_0x3db037){_0x250fa8[_0x141a('0x22')](0x194);}return _0x3db037;};}function handleError(_0x285ccb,_0x5569b0){_0x5569b0=_0x5569b0||0x1f4;return function(_0x4fcc90){logger[_0x141a('0x23')](_0x4fcc90[_0x141a('0x24')]);if(_0x4fcc90['name']){delete _0x4fcc90[_0x141a('0x25')];}_0x285ccb['status'](_0x5569b0)[_0x141a('0x26')](_0x4fcc90);};}exports[_0x141a('0x27')]=function(_0x1983d4,_0x559e43){var _0x567c03={},_0x1a13eb={},_0x2437b6={'count':0x0,'rows':[]};var _0x2306d0=db[_0x141a('0x28')][_0x141a('0x29')];_0x1a13eb[_0x141a('0x2a')]=_['keys'](_0x2306d0);_0x1a13eb[_0x141a('0x2b')]=_[_0x141a('0x2c')](_0x1983d4[_0x141a('0x2b')]);_0x1a13eb['filters']=_[_0x141a('0x2d')](_0x1a13eb[_0x141a('0x2a')],_0x1a13eb[_0x141a('0x2b')]);_0x567c03[_0x141a('0x2e')]=_[_0x141a('0x2d')](_0x1a13eb[_0x141a('0x2a')],qs[_0x141a('0x2f')](_0x1983d4[_0x141a('0x2b')][_0x141a('0x2f')]));_0x567c03[_0x141a('0x2e')]=_0x567c03['attributes']['length']?_0x567c03[_0x141a('0x2e')]:_0x1a13eb[_0x141a('0x2a')];if(!_0x1983d4[_0x141a('0x2b')]['hasOwnProperty']('nolimit')){_0x567c03['limit']=qs[_0x141a('0x1a')](_0x1983d4['query'][_0x141a('0x1a')]);_0x567c03[_0x141a('0x19')]=qs[_0x141a('0x19')](_0x1983d4[_0x141a('0x2b')]['offset']);}_0x567c03[_0x141a('0x30')]=qs[_0x141a('0x31')](_0x1983d4[_0x141a('0x2b')][_0x141a('0x31')]);_0x567c03[_0x141a('0x32')]=qs[_0x141a('0x33')](_[_0x141a('0x34')](_0x1983d4[_0x141a('0x2b')],_0x1a13eb[_0x141a('0x33')]));if(_0x1983d4['query'][_0x141a('0x35')]){_0x567c03[_0x141a('0x32')]=_[_0x141a('0x36')](_0x567c03['where'],{'$or':_[_0x141a('0x37')](_0x2306d0,function(_0x3e0816){if(_0x3e0816[_0x141a('0x38')]['key']!=='VIRTUAL'){var _0x5bb420={};_0x5bb420[_0x3e0816[_0x141a('0x39')]]={'$like':'%'+_0x1983d4[_0x141a('0x2b')][_0x141a('0x35')]+'%'};return _0x5bb420;}})});}_0x567c03=_[_0x141a('0x36')]({},_0x567c03,_0x1983d4[_0x141a('0x3a')]);var _0x4eea6b={'where':_0x567c03[_0x141a('0x32')]};return db[_0x141a('0x28')][_0x141a('0x18')](_0x4eea6b)[_0x141a('0x21')](function(_0xc9e61c){_0x2437b6['count']=_0xc9e61c;if(_0x1983d4['query'][_0x141a('0x3b')]){_0x567c03[_0x141a('0x3c')]=[{'all':!![]}];}return db[_0x141a('0x28')][_0x141a('0x3d')](_0x567c03);})[_0x141a('0x21')](function(_0x459677){_0x2437b6[_0x141a('0x3e')]=_0x459677;return _0x2437b6;})[_0x141a('0x21')](respondWithFilteredResult(_0x559e43,_0x567c03))[_0x141a('0x3f')](handleError(_0x559e43,null));};exports[_0x141a('0x40')]=function(_0x4b4c03,_0x377b7c){var _0x5f3b00={'raw':!![],'where':{'id':_0x4b4c03[_0x141a('0x41')]['id']}},_0x239720={};_0x239720['model']=_[_0x141a('0x2c')](db['Attachment'][_0x141a('0x29')]);_0x239720[_0x141a('0x2b')]=_[_0x141a('0x2c')](_0x4b4c03['query']);_0x239720['filters']=_[_0x141a('0x2d')](_0x239720['model'],_0x239720['query']);_0x5f3b00['attributes']=_[_0x141a('0x2d')](_0x239720[_0x141a('0x2a')],qs['fields'](_0x4b4c03[_0x141a('0x2b')]['fields']));_0x5f3b00[_0x141a('0x2e')]=_0x5f3b00[_0x141a('0x2e')]['length']?_0x5f3b00['attributes']:_0x239720[_0x141a('0x2a')];if(_0x4b4c03[_0x141a('0x2b')][_0x141a('0x3b')]){_0x5f3b00[_0x141a('0x3c')]=[{'all':!![]}];}_0x5f3b00=_[_0x141a('0x36')]({},_0x5f3b00,_0x4b4c03[_0x141a('0x3a')]);return db[_0x141a('0x28')][_0x141a('0x42')](_0x5f3b00)['then'](handleEntityNotFound(_0x377b7c,null))[_0x141a('0x21')](respondWithResult(_0x377b7c,null))[_0x141a('0x3f')](handleError(_0x377b7c,null));};exports['update']=function(_0x1efa6a,_0x4822d9){if(_0x1efa6a['body']['id']){delete _0x1efa6a[_0x141a('0x43')]['id'];}return db[_0x141a('0x28')][_0x141a('0x42')]({'where':{'id':_0x1efa6a[_0x141a('0x41')]['id']}})['then'](handleEntityNotFound(_0x4822d9,null))['then'](saveUpdates(_0x1efa6a[_0x141a('0x43')],null))[_0x141a('0x21')](respondWithResult(_0x4822d9,null))[_0x141a('0x3f')](handleError(_0x4822d9,null));};exports[_0x141a('0x44')]=function(_0x4e54f1,_0x1940a8){return db[_0x141a('0x28')]['find']({'where':{'id':_0x4e54f1[_0x141a('0x41')]['id']}})[_0x141a('0x21')](handleEntityNotFound(_0x1940a8,null))[_0x141a('0x21')](removeEntity(_0x1940a8,null))['catch'](handleError(_0x1940a8,null));};exports[_0x141a('0x45')]=function(_0x4ceab1,_0x23c2f0,_0x56ce49){_0x4ceab1[_0x141a('0x43')][_0x141a('0x25')]=_0x4ceab1['file']['originalname'];_0x4ceab1[_0x141a('0x43')][_0x141a('0x46')]=_0x4ceab1[_0x141a('0x47')][_0x141a('0x48')];_0x4ceab1[_0x141a('0x43')][_0x141a('0x38')]=_0x4ceab1['file'][_0x141a('0x49')];return db[_0x141a('0x28')][_0x141a('0x45')](_0x4ceab1[_0x141a('0x43')])[_0x141a('0x21')](respondWithResult(_0x23c2f0,0xc9))[_0x141a('0x3f')](handleError(_0x23c2f0,null));};exports[_0x141a('0x4a')]=function(_0x4384a8,_0x5bc7ba,_0x470742){return db['Attachment'][_0x141a('0x4b')]({'where':{'id':_0x4384a8['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5bc7ba,null))[_0x141a('0x21')](function(_0x553264){if(_0x553264){return _0x5bc7ba[_0x141a('0x4a')](path[_0x141a('0x4c')](config[_0x141a('0x4d')],'server/files/attachments/',_0x553264[_0x141a('0x46')]));}})[_0x141a('0x3f')](handleError(_0x5bc7ba,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6c806ab..4ab4900 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 _0x76a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Attachment','lodash','util','../../config/logger','api'];(function(_0x36f7d7,_0x143fee){var _0x1399f2=function(_0x525b25){while(--_0x525b25){_0x36f7d7['push'](_0x36f7d7['shift']());}};_0x1399f2(++_0x143fee);}(_0x76a3,0xf8));var _0x376a=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x76a3[_0x35bd6c];return _0x2f421d;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var logger=require(_0x376a('0x2'))(_0x376a('0x3'));var moment=require(_0x376a('0x4'));var BPromise=require(_0x376a('0x5'));var rp=require(_0x376a('0x6'));var fs=require('fs');var path=require(_0x376a('0x7'));var rimraf=require(_0x376a('0x8'));var config=require(_0x376a('0x9'));var attributes=require('./attachment.attributes');module['exports']=function(_0x19ea68,_0x22904c){return _0x19ea68[_0x376a('0xa')](_0x376a('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01d3=['api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','../../config/logger'];(function(_0x2ada99,_0x4ea2aa){var _0x5447e5=function(_0x1d25eb){while(--_0x1d25eb){_0x2ada99['push'](_0x2ada99['shift']());}};_0x5447e5(++_0x4ea2aa);}(_0x01d3,0xdb));var _0x301d=function(_0x3799b2,_0x3728da){_0x3799b2=_0x3799b2-0x0;var _0x1d7571=_0x01d3[_0x3799b2];return _0x1d7571;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x301d('0x0'))(_0x301d('0x1'));var moment=require(_0x301d('0x2'));var BPromise=require('bluebird');var rp=require(_0x301d('0x3'));var fs=require('fs');var path=require(_0x301d('0x4'));var rimraf=require(_0x301d('0x5'));var config=require(_0x301d('0x6'));var attributes=require(_0x301d('0x7'));module['exports']=function(_0x44f428,_0x3b1992){return _0x44f428[_0x301d('0x8')](_0x301d('0x9'),attributes,{'tableName':_0x301d('0xa'),'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 e79d532..925c140 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 _0x35fc=['message','result','CreateAttachment','create','body','options','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x35fc,0xde));var _0xc35f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x35fc[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xc35f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc35f('0x1'));var rs=require(_0xc35f('0x2'));var fs=require('fs');var Redis=require(_0xc35f('0x3'));var db=require(_0xc35f('0x4'))['db'];var utils=require(_0xc35f('0x5'));var logger=require(_0xc35f('0x6'))(_0xc35f('0x7'));var config=require(_0xc35f('0x8'));var jayson=require(_0xc35f('0x9'));var client=jayson[_0xc35f('0xa')][_0xc35f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ee6ff,_0x459b4a,_0x205511){return new BPromise(function(_0x381e63,_0x403537){return client[_0xc35f('0xc')](_0x4ee6ff,_0x205511)[_0xc35f('0xd')](function(_0x3a8053){logger[_0xc35f('0xe')](_0xc35f('0xf'),_0x459b4a,_0xc35f('0x10'));logger[_0xc35f('0x11')](_0xc35f('0x12'),_0x459b4a,_0xc35f('0x10'),JSON[_0xc35f('0x13')](_0x3a8053));if(_0x3a8053[_0xc35f('0x14')]){if(_0x3a8053['error']['code']===0x1f4){logger[_0xc35f('0x14')](_0xc35f('0xf'),_0x459b4a,_0x3a8053[_0xc35f('0x14')][_0xc35f('0x15')]);return _0x403537(_0x3a8053['error'][_0xc35f('0x15')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x459b4a,_0x3a8053[_0xc35f('0x14')]['message']);return _0x381e63(_0x3a8053['error'][_0xc35f('0x15')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x459b4a,'request\x20sent');_0x381e63(_0x3a8053[_0xc35f('0x16')]['message']);}})['catch'](function(_0x58018b){logger[_0xc35f('0x14')]('Attachment,\x20%s,\x20%s',_0x459b4a,_0x58018b);_0x403537(_0x58018b);});});}exports[_0xc35f('0x17')]=function(_0x436ce4){var _0x1d51c9=this;return new Promise(function(_0x4c68d2,_0x3f5442){return db['Attachment'][_0xc35f('0x18')](_0x436ce4[_0xc35f('0x19')],{'raw':_0x436ce4[_0xc35f('0x1a')]?_0x436ce4[_0xc35f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc35f('0xd')](function(_0x3dcc6d){logger['info'](_0xc35f('0x17'),_0x436ce4);logger[_0xc35f('0x11')]('CreateAttachment',_0x436ce4,JSON[_0xc35f('0x13')](_0x3dcc6d));_0x4c68d2(_0x3dcc6d);})['catch'](function(_0x55c152){logger[_0xc35f('0x14')](_0xc35f('0x17'),_0x55c152[_0xc35f('0x15')],_0x436ce4);_0x3f5442(_0x1d51c9[_0xc35f('0x14')](0x1f4,_0x55c152[_0xc35f('0x15')]));});});}; \ No newline at end of file +var _0x8fdb=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x448c80,_0x1ee1ca){var _0x438521=function(_0x117cb3){while(--_0x117cb3){_0x448c80['push'](_0x448c80['shift']());}};_0x438521(++_0x1ee1ca);}(_0x8fdb,0xe9));var _0xb8fd=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x8fdb[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xb8fd('0x0'));var util=require(_0xb8fd('0x1'));var moment=require(_0xb8fd('0x2'));var BPromise=require(_0xb8fd('0x3'));var rs=require(_0xb8fd('0x4'));var fs=require('fs');var Redis=require(_0xb8fd('0x5'));var db=require(_0xb8fd('0x6'))['db'];var utils=require(_0xb8fd('0x7'));var logger=require(_0xb8fd('0x8'))('rpc');var config=require(_0xb8fd('0x9'));var jayson=require(_0xb8fd('0xa'));var client=jayson[_0xb8fd('0xb')][_0xb8fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5534c7,_0x1f610f,_0xb12c5e){return new BPromise(function(_0xead34f,_0x282339){return client[_0xb8fd('0xd')](_0x5534c7,_0xb12c5e)[_0xb8fd('0xe')](function(_0x50b30d){logger['info'](_0xb8fd('0xf'),_0x1f610f,_0xb8fd('0x10'));logger[_0xb8fd('0x11')](_0xb8fd('0x12'),_0x1f610f,_0xb8fd('0x10'),JSON[_0xb8fd('0x13')](_0x50b30d));if(_0x50b30d['error']){if(_0x50b30d[_0xb8fd('0x14')][_0xb8fd('0x15')]===0x1f4){logger[_0xb8fd('0x14')](_0xb8fd('0xf'),_0x1f610f,_0x50b30d[_0xb8fd('0x14')][_0xb8fd('0x16')]);return _0x282339(_0x50b30d[_0xb8fd('0x14')]['message']);}logger[_0xb8fd('0x14')]('Attachment,\x20%s,\x20%s',_0x1f610f,_0x50b30d['error'][_0xb8fd('0x16')]);return _0xead34f(_0x50b30d['error']['message']);}else{logger[_0xb8fd('0x17')](_0xb8fd('0xf'),_0x1f610f,_0xb8fd('0x10'));_0xead34f(_0x50b30d[_0xb8fd('0x18')][_0xb8fd('0x16')]);}})[_0xb8fd('0x19')](function(_0x442b25){logger[_0xb8fd('0x14')](_0xb8fd('0xf'),_0x1f610f,_0x442b25);_0x282339(_0x442b25);});});}exports['CreateAttachment']=function(_0x2386b1){var _0x3abf56=this;return new Promise(function(_0x140d08,_0x40b02d){return db[_0xb8fd('0x1a')][_0xb8fd('0x1b')](_0x2386b1['body'],{'raw':_0x2386b1[_0xb8fd('0x1c')]?_0x2386b1[_0xb8fd('0x1c')][_0xb8fd('0x1d')]===undefined?!![]:![]:!![]})[_0xb8fd('0xe')](function(_0x537d4d){logger['info'](_0xb8fd('0x1e'),_0x2386b1);logger[_0xb8fd('0x11')](_0xb8fd('0x1e'),_0x2386b1,JSON[_0xb8fd('0x13')](_0x537d4d));_0x140d08(_0x537d4d);})['catch'](function(_0x25a57f){logger['error'](_0xb8fd('0x1e'),_0x25a57f[_0xb8fd('0x16')],_0x2386b1);_0x40b02d(_0x3abf56[_0xb8fd('0x14')](0x1f4,_0x25a57f[_0xb8fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 0653ca0..12d0c6d 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 _0x85b5=['originalname','replace','single','file','create','put','update','multer','util','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','root','server/files/attachments/','format','now'];(function(_0x14b5dc,_0x18585e){var _0x1bec32=function(_0x46bbb8){while(--_0x46bbb8){_0x14b5dc['push'](_0x14b5dc['shift']());}};_0x1bec32(++_0x18585e);}(_0x85b5,0x7f));var _0x585b=function(_0xe4cfe8,_0x37b1f5){_0xe4cfe8=_0xe4cfe8-0x0;var _0x502759=_0x85b5[_0xe4cfe8];return _0x502759;};'use strict';var multer=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var path=require('path');var timeout=require(_0x585b('0x2'));var express=require('express');var router=express[_0x585b('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x585b('0x4'));var controller=require('./attachment.controller');router[_0x585b('0x5')]('/',auth[_0x585b('0x6')](),controller[_0x585b('0x7')]);router['get'](_0x585b('0x8'),auth['isAuthenticated'](),controller[_0x585b('0x9')]);router[_0x585b('0x5')](_0x585b('0xa'),auth[_0x585b('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x585b('0xb')]({'destination':function(_0x7974e6,_0x430c16,_0x4d86cc){_0x4d86cc(null,path[_0x585b('0xc')](config[_0x585b('0xd')],_0x585b('0xe')));},'filename':function(_0x5dda1f,_0x133d83,_0x4d63c3){_0x4d63c3(null,util[_0x585b('0xf')]('%s-%s',Date[_0x585b('0x10')](),_0x133d83[_0x585b('0x11')][_0x585b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x585b('0x13')](_0x585b('0x14')),controller[_0x585b('0x15')]);router[_0x585b('0x16')](_0x585b('0x8'),auth[_0x585b('0x6')](),controller[_0x585b('0x17')]);router['delete'](_0x585b('0x8'),auth[_0x585b('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7b05=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','show','diskStorage','root','server/files/attachments/','format','now','originalname','replace','file','create','put','/:id','update'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x7b05,0x91));var _0x57b0=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x7b05[_0x5dee2a];return _0x31e98e;};'use strict';var multer=require(_0x57b0('0x0'));var util=require(_0x57b0('0x1'));var path=require(_0x57b0('0x2'));var timeout=require(_0x57b0('0x3'));var express=require('express');var router=express[_0x57b0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x57b0('0x5'));var config=require(_0x57b0('0x6'));var controller=require(_0x57b0('0x7'));router[_0x57b0('0x8')]('/',auth[_0x57b0('0x9')](),controller['index']);router[_0x57b0('0x8')]('/:id',auth[_0x57b0('0x9')](),controller[_0x57b0('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x57b0('0xb')]({'destination':function(_0x3faabd,_0x58b35b,_0x51034a){_0x51034a(null,path['join'](config[_0x57b0('0xc')],_0x57b0('0xd')));},'filename':function(_0x38b019,_0x2e9979,_0x23c081){_0x23c081(null,util[_0x57b0('0xe')]('%s-%s',Date[_0x57b0('0xf')](),_0x2e9979[_0x57b0('0x10')][_0x57b0('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single'](_0x57b0('0x12')),controller[_0x57b0('0x13')]);router[_0x57b0('0x14')](_0x57b0('0x15'),auth['isAuthenticated'](),controller[_0x57b0('0x16')]);router['delete'](_0x57b0('0x15'),auth[_0x57b0('0x9')](),controller['destroy']);module[_0x57b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5a2c3aa..6ab2805 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 _0x624c=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','../../config/utils','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','allowedLoginAttempts','then','User','find','map','emails','admin','user','agent','disabled','blockDuration','blocked','add'];(function(_0x2d3040,_0x129c56){var _0x4c85b6=function(_0x26bfae){while(--_0x26bfae){_0x2d3040['push'](_0x2d3040['shift']());}};_0x4c85b6(++_0x129c56);}(_0x624c,0x1ee));var _0xc624=function(_0x36b535,_0x2fb432){_0x36b535=_0x36b535-0x0;var _0xd347ec=_0x624c[_0x36b535];return _0xd347ec;};'use strict';var _=require('lodash');var passport=require(_0xc624('0x0'));var GoogleStrategy=require(_0xc624('0x1'))[_0xc624('0x2')];var moment=require(_0xc624('0x3'));var db=require(_0xc624('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xc624('0x5'))['signToken'];var utils=require(_0xc624('0x6'));exports['login']=passport[_0xc624('0x7')](_0xc624('0x8'),{'failureRedirect':_0xc624('0x9'),'scope':[_0xc624('0xa'),_0xc624('0xb')],'session':![]});exports[_0xc624('0xc')]=passport[_0xc624('0x7')]('google',{'failureRedirect':_0xc624('0x9'),'session':![]});passport[_0xc624('0xd')](new GoogleStrategy({'clientID':config[_0xc624('0x8')]?config['google'][_0xc624('0xe')]:'id','clientSecret':config[_0xc624('0x8')]?config['google'][_0xc624('0xf')]:_0xc624('0x10'),'callbackURL':config[_0xc624('0x8')]?config[_0xc624('0x8')][_0xc624('0x11')]:''},function(_0x558b51,_0x42760a,_0x25e874,_0xef673c){var _0x1a0f3d,_0x49c1e3;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc624('0x12'),'blockDuration'],'raw':!![]})[_0xc624('0x13')](function(_0x5c236e){_0x1a0f3d=_0x5c236e;return db[_0xc624('0x14')][_0xc624('0x15')]({'where':{'email':_[_0xc624('0x16')](_0x25e874[_0xc624('0x17')],'value'),'role':{'$or':[_0xc624('0x18'),_0xc624('0x19'),_0xc624('0x1a')]}}});})['then'](function(_0x190458){_0x49c1e3=_0x190458;if(_0x49c1e3){if(_0x49c1e3[_0xc624('0x1b')]){return _0xef673c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1a0f3d[_0xc624('0x1c')]>0x0){if(_0x49c1e3[_0xc624('0x1d')]){if(moment(_0x49c1e3['blockedAt'])[_0xc624('0x1e')](_0x1a0f3d['blockDuration'],'minutes')>moment()){return _0xef673c(_0xc624('0x1f'));}else{return utils[_0xc624('0x20')](_0x49c1e3,0x0,![],null)[_0xc624('0x13')](function(){return utils[_0xc624('0x21')](_0x49c1e3);})[_0xc624('0x13')](function(){return _0xef673c(null,_0x49c1e3);});}}else{return utils['getLicense'](_0x49c1e3)[_0xc624('0x13')](function(){return _0xef673c(null,_0x49c1e3);});}}else{return utils[_0xc624('0x21')](_0x49c1e3)[_0xc624('0x13')](function(){return _0xef673c(null,_0x49c1e3);});}}return _0xef673c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc624('0x22')](function(_0x5f0ac3){_0xef673c(_0x5f0ac3);});})); \ No newline at end of file +var _0xfc17=['../../config/utils','login','google','/login','profile','email','callback','authenticate','use','secret','callbackURL','Setting','findOne','then','User','find','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x30678c,_0x4759a5){_0x30678c=_0x30678c-0x0;var _0x34bd35=_0xfc17[_0x30678c];return _0x34bd35;};'use strict';var _=require(_0x7fc1('0x0'));var passport=require(_0x7fc1('0x1'));var GoogleStrategy=require(_0x7fc1('0x2'))[_0x7fc1('0x3')];var moment=require('moment');var db=require(_0x7fc1('0x4'))['db'];var config=require(_0x7fc1('0x5'));var signToken=require(_0x7fc1('0x6'))[_0x7fc1('0x7')];var utils=require(_0x7fc1('0x8'));exports[_0x7fc1('0x9')]=passport['authenticate'](_0x7fc1('0xa'),{'failureRedirect':_0x7fc1('0xb'),'scope':[_0x7fc1('0xc'),_0x7fc1('0xd')],'session':![]});exports[_0x7fc1('0xe')]=passport[_0x7fc1('0xf')](_0x7fc1('0xa'),{'failureRedirect':'/login','session':![]});passport[_0x7fc1('0x10')](new GoogleStrategy({'clientID':config[_0x7fc1('0xa')]?config[_0x7fc1('0xa')]['clientID']:'id','clientSecret':config[_0x7fc1('0xa')]?config['google']['clientSecret']:_0x7fc1('0x11'),'callbackURL':config[_0x7fc1('0xa')]?config[_0x7fc1('0xa')][_0x7fc1('0x12')]:''},function(_0x417ef4,_0x20ed58,_0x53277f,_0x3a7c8e){var _0x902325,_0x3e4fea;return db[_0x7fc1('0x13')][_0x7fc1('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x7fc1('0x15')](function(_0x178dc2){_0x902325=_0x178dc2;return db[_0x7fc1('0x16')][_0x7fc1('0x17')]({'where':{'email':_[_0x7fc1('0x18')](_0x53277f[_0x7fc1('0x19')],_0x7fc1('0x1a')),'role':{'$or':[_0x7fc1('0x1b'),_0x7fc1('0x1c'),_0x7fc1('0x1d')]}}});})['then'](function(_0x419170){_0x3e4fea=_0x419170;if(_0x3e4fea){if(_0x3e4fea['disabled']){return _0x3a7c8e(_0x7fc1('0x1e'));}else if(_0x902325[_0x7fc1('0x1f')]>0x0){if(_0x3e4fea['blocked']){if(moment(_0x3e4fea[_0x7fc1('0x20')])[_0x7fc1('0x21')](_0x902325['blockDuration'],_0x7fc1('0x22'))>moment()){return _0x3a7c8e(_0x7fc1('0x1e'));}else{return utils[_0x7fc1('0x23')](_0x3e4fea,0x0,![],null)[_0x7fc1('0x15')](function(){return utils[_0x7fc1('0x24')](_0x3e4fea);})[_0x7fc1('0x15')](function(){return _0x3a7c8e(null,_0x3e4fea);});}}else{return utils[_0x7fc1('0x24')](_0x3e4fea)[_0x7fc1('0x15')](function(){return _0x3a7c8e(null,_0x3e4fea);});}}else{return utils[_0x7fc1('0x24')](_0x3e4fea)[_0x7fc1('0x15')](function(){return _0x3a7c8e(null,_0x3e4fea);});}}return _0x3a7c8e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x2390b8){_0x3a7c8e(_0x2390b8);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 05e7b2f..3ed0cff 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 _0x39b0=['callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','get'];(function(_0x5242e0,_0x359cd5){var _0x4f3b92=function(_0xafcf53){while(--_0xafcf53){_0x5242e0['push'](_0x5242e0['shift']());}};_0x4f3b92(++_0x359cd5);}(_0x39b0,0x181));var _0x039b=function(_0x28234a,_0x281983){_0x28234a=_0x28234a-0x0;var _0x2c0398=_0x39b0[_0x28234a];return _0x2c0398;};'use strict';var express=require(_0x039b('0x0'));var passport=require(_0x039b('0x1'));var router=express[_0x039b('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x039b('0x3'));var authService=require('../../components/auth/service');router[_0x039b('0x4')]('/',controller['login']);router[_0x039b('0x4')]('/callback',controller[_0x039b('0x5')],authService[_0x039b('0x6')],userController[_0x039b('0x7')],authService[_0x039b('0x8')]);module[_0x039b('0x9')]=router; \ No newline at end of file +var _0x19f2=['setTokenCookie','exports','express','passport','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x19f2,0x120));var _0x219f=function(_0x5ec3e2,_0x5294df){_0x5ec3e2=_0x5ec3e2-0x0;var _0x152654=_0x19f2[_0x5ec3e2];return _0x152654;};'use strict';var express=require(_0x219f('0x0'));var passport=require(_0x219f('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x219f('0x2'));var authService=require(_0x219f('0x3'));router[_0x219f('0x4')]('/',controller[_0x219f('0x5')]);router[_0x219f('0x4')](_0x219f('0x6'),controller[_0x219f('0x7')],authService[_0x219f('0x8')],userController[_0x219f('0x5')],authService[_0x219f('0x9')]);module[_0x219f('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 8bd9b38..1c1ceb8 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 _0xc164=['allowedLoginAttempts','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','service','host','port','secure','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','status','test','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','client','Setting','findOne'];(function(_0x4dad2f,_0x22bf99){var _0x292c4c=function(_0x36498f){while(--_0x36498f){_0x4dad2f['push'](_0x4dad2f['shift']());}};_0x292c4c(++_0x22bf99);}(_0xc164,0x1d1));var _0x4c16=function(_0x3ab425,_0x578258){_0x3ab425=_0x3ab425-0x0;var _0x192a59=_0xc164[_0x3ab425];return _0x192a59;};'use strict';var util=require(_0x4c16('0x0'));var passport=require(_0x4c16('0x1'));var LocalStrategy=require(_0x4c16('0x2'))[_0x4c16('0x3')];var jayson=require(_0x4c16('0x4'));var _=require(_0x4c16('0x5'));var rs=require(_0x4c16('0x6'));var moment=require(_0x4c16('0x7'));var db=require(_0x4c16('0x8'))['db'];var signToken=require(_0x4c16('0x9'))[_0x4c16('0xa')];var utils=require(_0x4c16('0xb'));var client=jayson[_0x4c16('0xc')]['http']({'port':0x232b});function localAuthenticate(_0x47790e,_0x5814cc,_0x1127d5,_0x1f0849){var _0x1aa291,_0x21dcb5;return db[_0x4c16('0xd')][_0x4c16('0xe')]({'where':{'id':0x1},'attributes':[_0x4c16('0xf'),'blockDuration'],'raw':!![]})[_0x4c16('0x10')](function(_0x27ab0d){_0x1aa291=_0x27ab0d;return _0x47790e[_0x4c16('0xe')]({'attributes':['id',_0x4c16('0x11'),_0x4c16('0x12'),'salt',_0x4c16('0x13'),_0x4c16('0x14'),_0x4c16('0x15'),_0x4c16('0x16'),_0x4c16('0x17')],'where':{'name':_0x5814cc,'role':{'$or':[_0x4c16('0x18'),_0x4c16('0x19'),_0x4c16('0x1a')]}}});})[_0x4c16('0x10')](function(_0x1dc471){if(!_0x1dc471||_0x1dc471&&_0x1dc471[_0x4c16('0x11')]!==_0x5814cc){throw new Error(_0x4c16('0x1b'));}else{_0x21dcb5=_0x1dc471;return _0x21dcb5;}})[_0x4c16('0x10')](function(){_0x21dcb5[_0x4c16('0x1c')](_0x1127d5,function(_0x4b9102,_0x62e751){var _0x8cd9c2=_0x21dcb5[_0x4c16('0x17')]+0x1;if(_0x4b9102){return _0x1f0849(_0x4b9102);}else if(!_0x62e751){if(_0x21dcb5[_0x4c16('0x14')]){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}else if(_0x1aa291[_0x4c16('0xf')]>0x0){if(_0x21dcb5[_0x4c16('0x15')]){if(_0x1aa291[_0x4c16('0x1d')]>0x0){if(moment(_0x21dcb5[_0x4c16('0x16')])[_0x4c16('0x1e')](_0x1aa291[_0x4c16('0x1d')],_0x4c16('0x1f'))>moment()){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}else{return utils[_0x4c16('0x20')](_0x21dcb5,_0x8cd9c2,![],null)['then'](function(){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});});}}else{return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}}else{if(_0x8cd9c2>=_0x1aa291[_0x4c16('0xf')]){return utils[_0x4c16('0x20')](_0x21dcb5,0x0,!![],moment())[_0x4c16('0x10')](function(){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});});}else{return utils['clearBlockUser'](_0x21dcb5,_0x8cd9c2,![],null)[_0x4c16('0x10')](function(){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});});}}}else{return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}}else{if(_0x21dcb5['disabled']){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}else if(_0x1aa291['allowedLoginAttempts']>0x0){if(_0x21dcb5[_0x4c16('0x15')]){if(_0x1aa291[_0x4c16('0x1d')]>0x0){if(moment(_0x21dcb5['blockedAt'])['add'](_0x1aa291[_0x4c16('0x1d')],'minutes')>moment()){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}else{return utils[_0x4c16('0x20')](_0x21dcb5,0x0,![],null)[_0x4c16('0x10')](function(){return utils[_0x4c16('0x21')](_0x21dcb5);})[_0x4c16('0x10')](function(){return _0x1f0849(null,_0x21dcb5);});}}else{return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}}else{return utils[_0x4c16('0x20')](_0x21dcb5,0x0,![],null)[_0x4c16('0x10')](function(){return utils[_0x4c16('0x21')](_0x21dcb5);})[_0x4c16('0x10')](function(){return _0x1f0849(null,_0x21dcb5);})[_0x4c16('0x22')](function(_0x30f18a){return _0x1f0849(null,![],_0x30f18a);});}}else{if(_0x21dcb5['blocked']){return _0x1f0849(null,![],{'message':_0x4c16('0x1b')});}else{return utils[_0x4c16('0x21')](_0x21dcb5)[_0x4c16('0x10')](function(){return _0x1f0849(null,_0x21dcb5);});}}}});})['catch'](function(_0x3123bf){return _0x1f0849(null,![],_0x3123bf);});}function sendServiceMail(_0x2eaced){return db['MailAccount'][_0x4c16('0x23')]({'where':{'service':!![]},'attributes':['id',_0x4c16('0x11'),_0x4c16('0x24')],'include':[{'model':db['MailServerOut'],'as':_0x4c16('0x25')}]})[_0x4c16('0x10')](function(_0x504efe){if(!_0x504efe){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x25b0dd={'tls':{'rejectUnauthorized':![]}};if(_0x504efe[_0x4c16('0x25')][_0x4c16('0x26')]){_0x25b0dd['service']=_0x504efe[_0x4c16('0x25')][_0x4c16('0x26')];}else{_0x25b0dd['host']=_0x504efe[_0x4c16('0x25')][_0x4c16('0x27')];_0x25b0dd['port']=_0x504efe[_0x4c16('0x25')][_0x4c16('0x28')];_0x25b0dd['secure']=_0x504efe[_0x4c16('0x25')][_0x4c16('0x29')];}if(_0x504efe['Smtp']['authentication']){_0x25b0dd[_0x4c16('0x2a')]={'user':_0x504efe['Smtp'][_0x4c16('0x19')],'pass':_0x504efe['Smtp']['pass']};}var _0x5b2843={'account':_0x25b0dd,'message':_[_0x4c16('0x2b')]({'from':util[_0x4c16('0x2c')](_0x4c16('0x2d'),_0x504efe[_0x4c16('0x11')],_0x504efe[_0x4c16('0x24')]||_0x504efe['Smtp']['user'])},_0x2eaced)};return client['request'](_0x4c16('0x2e'),_0x5b2843);})['then'](function(_0x59c420){if(_0x59c420[_0x4c16('0x2f')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x59c420[_0x4c16('0x2f')][_0x4c16('0x30')]||JSON[_0x4c16('0x31')](_0x59c420[_0x4c16('0x2f')])));}return!![];});}function handleError(_0x35eea5,_0x33926a,_0x1a3465){return _0x35eea5[_0x4c16('0x32')](_0x33926a||0x1f4)['send']({'message':_0x1a3465?_0x1a3465[_0x4c16('0x30')]||_0x1a3465:''});}function checkPasswordPattern(_0x14b984,_0x1feb07,_0x21d6b0){if(_0x21d6b0){var _0x3399a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3399a4[_0x4c16('0x33')](_0x1feb07)){return _0x14b984;}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 _0x14b984;}}exports[_0x4c16('0x34')]=function(_0x3c94a5,_0x49a90b,_0x39b6f2){passport[_0x4c16('0x1c')](_0x4c16('0x35'),function(_0x9ce709,_0x4f35ad,_0x54b797){var _0x54cc9f=_0x9ce709||_0x54b797;if(_0x54cc9f){return handleError(_0x49a90b,0x191,_0x54cc9f);}if(!_0x4f35ad){return handleError(_0x49a90b,0x194,{'message':_0x4c16('0x36')});}else{var _0x3d9be2=signToken(_0x4f35ad['id'],_0x4f35ad[_0x4c16('0x13')]);_0x49a90b[_0x4c16('0x37')]({'id':_0x4f35ad['id'],'token':_0x3d9be2,'statusCall':'','isAlreadyLogged':_0x4f35ad[_0x4c16('0x38')]});}})(_0x3c94a5,_0x49a90b,_0x39b6f2);};exports[_0x4c16('0x39')]=function(_0x3a90e1,_0x2ed0f3,_0x331865){if(!_0x3a90e1[_0x4c16('0x3a')]['email']){return handleError(_0x2ed0f3,0x1f4,{'message':_0x4c16('0x3b')});}var _0x2eef11=rs[_0x4c16('0x3c')]();_0x3a90e1[_0x4c16('0x3a')][_0x4c16('0x24')]=_0x3a90e1[_0x4c16('0x3a')][_0x4c16('0x24')][_0x4c16('0x3d')]()['toLowerCase']();var _0x372ace;return db[_0x4c16('0xd')][_0x4c16('0xe')]({'where':{'id':0x1},'attributes':[_0x4c16('0xf'),'blockDuration'],'raw':!![]})[_0x4c16('0x10')](function(_0x47985b){_0x372ace=_0x47985b;return db[_0x4c16('0x3e')][_0x4c16('0x23')]({'where':{'email':_0x3a90e1[_0x4c16('0x3a')]['email']}});})[_0x4c16('0x10')](function(_0x5c2620){if(!_0x5c2620){throw new Error(_0x4c16('0x3f'));}if(_0x5c2620[_0x4c16('0x14')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5c2620[_0x4c16('0x15')]){if(moment(_0x5c2620[_0x4c16('0x16')])[_0x4c16('0x1e')](_0x372ace[_0x4c16('0x1d')],_0x4c16('0x1f'))>moment()){throw new Error(_0x4c16('0x40'));}else{_0x5c2620[_0x4c16('0x15')]=![];_0x5c2620['blockedAt']=null;}}_0x5c2620[_0x4c16('0x41')]=_0x2eef11;_0x5c2620['resetPasswordExpires']=Date[_0x4c16('0x42')]()+0x36ee80;return _0x5c2620[_0x4c16('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x3a90e1['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4c16('0x44')+_0x4c16('0x45')+'http://'+_0x3a90e1[_0x4c16('0x46')][_0x4c16('0x27')]+_0x4c16('0x47')+_0x2eef11+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x4c16('0x10')](function(){_0x2ed0f3[_0x4c16('0x32')](0xc8)[_0x4c16('0x48')]({'message':_0x4c16('0x49')});})['catch'](function(_0x190ad9){return handleError(_0x2ed0f3,0x1f4,_0x190ad9);});};exports[_0x4c16('0x4a')]=function(_0x1dcfdc,_0xc03b2c,_0x390e66){var _0x1f4309;return db[_0x4c16('0x3e')]['find']({'where':{'resetPasswordToken':_0x1dcfdc[_0x4c16('0x4b')][_0x4c16('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x4c16('0x42')]()}}})[_0x4c16('0x10')](function(_0x3fb68e){_0x1f4309=_0x3fb68e;if(!_0x1f4309){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x4c16('0xe')]({'attributes':['id',_0x4c16('0x4d')]});})[_0x4c16('0x10')](function(_0xeb2683){return checkPasswordPattern(_0xeb2683,_0x1dcfdc[_0x4c16('0x3a')][_0x4c16('0x12')],_0xeb2683[_0x4c16('0x4d')]);})['then'](function(){_0x1f4309[_0x4c16('0x12')]=_0x1dcfdc[_0x4c16('0x3a')][_0x4c16('0x12')];_0x1f4309[_0x4c16('0x41')]=null;_0x1f4309['resetPasswordExpires']=null;return _0x1f4309[_0x4c16('0x43')]();})['then'](function(){_0xc03b2c[_0x4c16('0x32')](0xc8)['send']({'message':_0x4c16('0x4e')});})[_0x4c16('0x22')](function(_0x43e9fe){return handleError(_0xc03b2c,0x1f4,_0x43e9fe);});};passport[_0x4c16('0x4f')](new LocalStrategy({'usernameField':_0x4c16('0x11'),'passwordField':_0x4c16('0x12')},function(_0xe8fb5e,_0x2aaddc,_0x51e4da){return localAuthenticate(db['User'],_0xe8fb5e,_0x2aaddc,_0x51e4da);})); \ No newline at end of file +var _0xaa4d=['This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','Email\x20parameter\x20is\x20missing','body','trim','User'];(function(_0x4b9ea9,_0x20b5d7){var _0x381015=function(_0x950f0a){while(--_0x950f0a){_0x4b9ea9['push'](_0x4b9ea9['shift']());}};_0x381015(++_0x20b5d7);}(_0xaa4d,0xab));var _0xdaa4=function(_0x209603,_0x351b88){_0x209603=_0x209603-0x0;var _0x3e06d4=_0xaa4d[_0x209603];return _0x3e06d4;};'use strict';var util=require(_0xdaa4('0x0'));var passport=require(_0xdaa4('0x1'));var LocalStrategy=require(_0xdaa4('0x2'))[_0xdaa4('0x3')];var jayson=require(_0xdaa4('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var signToken=require(_0xdaa4('0x5'))['signToken'];var utils=require(_0xdaa4('0x6'));var client=jayson[_0xdaa4('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x196b7f,_0x4350c4,_0x228f23,_0x4527b8){var _0x387dfe,_0x88b0bd;return db[_0xdaa4('0x8')][_0xdaa4('0x9')]({'where':{'id':0x1},'attributes':[_0xdaa4('0xa'),_0xdaa4('0xb')],'raw':!![]})[_0xdaa4('0xc')](function(_0x583171){_0x387dfe=_0x583171;return _0x196b7f['findOne']({'attributes':['id',_0xdaa4('0xd'),_0xdaa4('0xe'),_0xdaa4('0xf'),_0xdaa4('0x10'),_0xdaa4('0x11'),'blocked',_0xdaa4('0x12'),_0xdaa4('0x13')],'where':{'name':_0x4350c4,'role':{'$or':[_0xdaa4('0x14'),_0xdaa4('0x15'),'agent']}}});})[_0xdaa4('0xc')](function(_0x12bc9f){if(!_0x12bc9f||_0x12bc9f&&_0x12bc9f[_0xdaa4('0xd')]!==_0x4350c4){throw new Error(_0xdaa4('0x16'));}else{_0x88b0bd=_0x12bc9f;return _0x88b0bd;}})[_0xdaa4('0xc')](function(){_0x88b0bd[_0xdaa4('0x17')](_0x228f23,function(_0x495753,_0x307b8c){var _0x380b7b=_0x88b0bd['loginAttempts']+0x1;if(_0x495753){return _0x4527b8(_0x495753);}else if(!_0x307b8c){if(_0x88b0bd[_0xdaa4('0x11')]){return _0x4527b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x387dfe[_0xdaa4('0xa')]>0x0){if(_0x88b0bd[_0xdaa4('0x18')]){if(_0x387dfe['blockDuration']>0x0){if(moment(_0x88b0bd['blockedAt'])[_0xdaa4('0x19')](_0x387dfe['blockDuration'],_0xdaa4('0x1a'))>moment()){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}else{return utils[_0xdaa4('0x1b')](_0x88b0bd,_0x380b7b,![],null)['then'](function(){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});});}}else{return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}}else{if(_0x380b7b>=_0x387dfe[_0xdaa4('0xa')]){return utils['clearBlockUser'](_0x88b0bd,0x0,!![],moment())[_0xdaa4('0xc')](function(){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});});}else{return utils[_0xdaa4('0x1b')](_0x88b0bd,_0x380b7b,![],null)[_0xdaa4('0xc')](function(){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});});}}}else{return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}}else{if(_0x88b0bd[_0xdaa4('0x11')]){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}else if(_0x387dfe['allowedLoginAttempts']>0x0){if(_0x88b0bd[_0xdaa4('0x18')]){if(_0x387dfe[_0xdaa4('0xb')]>0x0){if(moment(_0x88b0bd['blockedAt'])[_0xdaa4('0x19')](_0x387dfe[_0xdaa4('0xb')],_0xdaa4('0x1a'))>moment()){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}else{return utils[_0xdaa4('0x1b')](_0x88b0bd,0x0,![],null)[_0xdaa4('0xc')](function(){return utils[_0xdaa4('0x1c')](_0x88b0bd);})[_0xdaa4('0xc')](function(){return _0x4527b8(null,_0x88b0bd);});}}else{return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}}else{return utils[_0xdaa4('0x1b')](_0x88b0bd,0x0,![],null)[_0xdaa4('0xc')](function(){return utils[_0xdaa4('0x1c')](_0x88b0bd);})[_0xdaa4('0xc')](function(){return _0x4527b8(null,_0x88b0bd);})['catch'](function(_0x2a90c1){return _0x4527b8(null,![],_0x2a90c1);});}}else{if(_0x88b0bd['blocked']){return _0x4527b8(null,![],{'message':_0xdaa4('0x16')});}else{return utils['getLicense'](_0x88b0bd)[_0xdaa4('0xc')](function(){return _0x4527b8(null,_0x88b0bd);});}}}});})[_0xdaa4('0x1d')](function(_0x5fead3){return _0x4527b8(null,![],_0x5fead3);});}function sendServiceMail(_0xaac52f){return db[_0xdaa4('0x1e')][_0xdaa4('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xdaa4('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xdaa4('0x21')}]})[_0xdaa4('0xc')](function(_0x1bbff0){if(!_0x1bbff0){throw new Error(_0xdaa4('0x22'));}var _0x30ff8a={'tls':{'rejectUnauthorized':![]}};if(_0x1bbff0[_0xdaa4('0x21')][_0xdaa4('0x23')]){_0x30ff8a[_0xdaa4('0x23')]=_0x1bbff0[_0xdaa4('0x21')][_0xdaa4('0x23')];}else{_0x30ff8a[_0xdaa4('0x24')]=_0x1bbff0[_0xdaa4('0x21')]['host'];_0x30ff8a['port']=_0x1bbff0[_0xdaa4('0x21')][_0xdaa4('0x25')];_0x30ff8a[_0xdaa4('0x26')]=_0x1bbff0['Smtp']['secure'];}if(_0x1bbff0[_0xdaa4('0x21')]['authentication']){_0x30ff8a['auth']={'user':_0x1bbff0['Smtp'][_0xdaa4('0x15')],'pass':_0x1bbff0[_0xdaa4('0x21')]['pass']};}var _0x27f252={'account':_0x30ff8a,'message':_[_0xdaa4('0x27')]({'from':util[_0xdaa4('0x28')]('\x22%s\x22\x20<%s>',_0x1bbff0['name'],_0x1bbff0[_0xdaa4('0x20')]||_0x1bbff0[_0xdaa4('0x21')][_0xdaa4('0x15')])},_0xaac52f)};return client[_0xdaa4('0x29')](_0xdaa4('0x2a'),_0x27f252);})[_0xdaa4('0xc')](function(_0x3db8de){if(_0x3db8de[_0xdaa4('0x2b')]){throw new Error(util['format'](_0xdaa4('0x2c'),_0x3db8de[_0xdaa4('0x2b')][_0xdaa4('0x2d')]||JSON[_0xdaa4('0x2e')](_0x3db8de[_0xdaa4('0x2b')])));}return!![];});}function handleError(_0x29070b,_0x3585d4,_0x381a6){return _0x29070b[_0xdaa4('0x2f')](_0x3585d4||0x1f4)[_0xdaa4('0x30')]({'message':_0x381a6?_0x381a6[_0xdaa4('0x2d')]||_0x381a6:''});}function checkPasswordPattern(_0x9cc466,_0x299bea,_0x37a441){if(_0x37a441){var _0x5b9b93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b9b93[_0xdaa4('0x31')](_0x299bea)){return _0x9cc466;}else{throw new Error(_0xdaa4('0x32'));}}else{return _0x9cc466;}}exports[_0xdaa4('0x33')]=function(_0x22eba7,_0x4e1866,_0x1f3335){passport['authenticate'](_0xdaa4('0x34'),function(_0x269445,_0x28bb3b,_0x2939b3){var _0x408979=_0x269445||_0x2939b3;if(_0x408979){return handleError(_0x4e1866,0x191,_0x408979);}if(!_0x28bb3b){return handleError(_0x4e1866,0x194,{'message':_0xdaa4('0x35')});}else{var _0x262f92=signToken(_0x28bb3b['id'],_0x28bb3b[_0xdaa4('0x10')]);_0x4e1866[_0xdaa4('0x36')]({'id':_0x28bb3b['id'],'token':_0x262f92,'statusCall':'','isAlreadyLogged':_0x28bb3b[_0xdaa4('0x37')]});}})(_0x22eba7,_0x4e1866,_0x1f3335);};exports['forgot']=function(_0x44c671,_0x554690,_0x27a42b){if(!_0x44c671['body']['email']){return handleError(_0x554690,0x1f4,{'message':_0xdaa4('0x38')});}var _0x6cda97=rs['generate']();_0x44c671[_0xdaa4('0x39')][_0xdaa4('0x20')]=_0x44c671['body'][_0xdaa4('0x20')][_0xdaa4('0x3a')]()['toLowerCase']();var _0x22db30;return db[_0xdaa4('0x8')][_0xdaa4('0x9')]({'where':{'id':0x1},'attributes':[_0xdaa4('0xa'),_0xdaa4('0xb')],'raw':!![]})[_0xdaa4('0xc')](function(_0x22dbb1){_0x22db30=_0x22dbb1;return db[_0xdaa4('0x3b')][_0xdaa4('0x1f')]({'where':{'email':_0x44c671[_0xdaa4('0x39')]['email']}});})[_0xdaa4('0xc')](function(_0x2731ed){if(!_0x2731ed){throw new Error(_0xdaa4('0x3c'));}if(_0x2731ed['disabled']){throw new Error(_0xdaa4('0x3d'));}if(_0x2731ed[_0xdaa4('0x18')]){if(moment(_0x2731ed[_0xdaa4('0x12')])[_0xdaa4('0x19')](_0x22db30['blockDuration'],_0xdaa4('0x1a'))>moment()){throw new Error(_0xdaa4('0x3e'));}else{_0x2731ed['blocked']=![];_0x2731ed['blockedAt']=null;}}_0x2731ed[_0xdaa4('0x3f')]=_0x6cda97;_0x2731ed[_0xdaa4('0x40')]=Date[_0xdaa4('0x41')]()+0x36ee80;return _0x2731ed['save']();})['then'](function(){return sendServiceMail({'to':_0x44c671['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xdaa4('0x42')+_0xdaa4('0x43')+_0x44c671['headers']['host']+_0xdaa4('0x44')+_0x6cda97+'\x0a\x0a'+_0xdaa4('0x45')});})[_0xdaa4('0xc')](function(){_0x554690['status'](0xc8)[_0xdaa4('0x30')]({'message':_0xdaa4('0x46')});})[_0xdaa4('0x1d')](function(_0xa9624a){return handleError(_0x554690,0x1f4,_0xa9624a);});};exports[_0xdaa4('0x47')]=function(_0x1fea4e,_0x45e6c3,_0x487b05){var _0x32fc47;return db['User'][_0xdaa4('0x1f')]({'where':{'resetPasswordToken':_0x1fea4e['params'][_0xdaa4('0x48')],'resetPasswordExpires':{'$gt':Date[_0xdaa4('0x41')]()}}})[_0xdaa4('0xc')](function(_0x2ccb7f){_0x32fc47=_0x2ccb7f;if(!_0x32fc47){throw new Error(_0xdaa4('0x49'));}return db[_0xdaa4('0x8')][_0xdaa4('0x9')]({'attributes':['id',_0xdaa4('0x4a')]});})[_0xdaa4('0xc')](function(_0x560290){return checkPasswordPattern(_0x560290,_0x1fea4e[_0xdaa4('0x39')]['password'],_0x560290[_0xdaa4('0x4a')]);})['then'](function(){_0x32fc47[_0xdaa4('0xe')]=_0x1fea4e['body'][_0xdaa4('0xe')];_0x32fc47[_0xdaa4('0x3f')]=null;_0x32fc47[_0xdaa4('0x40')]=null;return _0x32fc47[_0xdaa4('0x4b')]();})[_0xdaa4('0xc')](function(){_0x45e6c3[_0xdaa4('0x2f')](0xc8)[_0xdaa4('0x30')]({'message':_0xdaa4('0x4c')});})[_0xdaa4('0x1d')](function(_0x534ded){return handleError(_0x45e6c3,0x1f4,_0x534ded);});};passport['use'](new LocalStrategy({'usernameField':_0xdaa4('0xd'),'passwordField':_0xdaa4('0xe')},function(_0x37238b,_0x249bf8,_0x3f71aa){return localAuthenticate(db[_0xdaa4('0x3b')],_0x37238b,_0x249bf8,_0x3f71aa);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f814372..4459615 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 _0xfa19=['forgot','post','reset','exports','express','Router'];(function(_0x21b054,_0xe2e144){var _0x5ae4b9=function(_0x2928ab){while(--_0x2928ab){_0x21b054['push'](_0x21b054['shift']());}};_0x5ae4b9(++_0xe2e144);}(_0xfa19,0x1d2));var _0x9fa1=function(_0x147f37,_0x3ec880){_0x147f37=_0x147f37-0x0;var _0x341007=_0xfa19[_0x147f37];return _0x341007;};'use strict';var express=require(_0x9fa1('0x0'));var router=express[_0x9fa1('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post']('/forgot',controller[_0x9fa1('0x2')]);router[_0x9fa1('0x3')]('/reset/:token',controller[_0x9fa1('0x4')]);module[_0x9fa1('0x5')]=router; \ No newline at end of file +var _0xdd98=['post','login','/forgot','/reset/:token','reset','exports','express','Router'];(function(_0x32650a,_0x195e89){var _0x5f034c=function(_0x2ea6be){while(--_0x2ea6be){_0x32650a['push'](_0x32650a['shift']());}};_0x5f034c(++_0x195e89);}(_0xdd98,0x156));var _0x8dd9=function(_0x569f9a,_0x58cc03){_0x569f9a=_0x569f9a-0x0;var _0x33cafb=_0xdd98[_0x569f9a];return _0x33cafb;};'use strict';var express=require(_0x8dd9('0x0'));var router=express[_0x8dd9('0x1')]();var controller=require('./authLocal.controller');router[_0x8dd9('0x2')]('/',controller[_0x8dd9('0x3')]);router['post'](_0x8dd9('0x4'),controller['forgot']);router[_0x8dd9('0x2')](_0x8dd9('0x5'),controller[_0x8dd9('0x6')]);module[_0x8dd9('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 0f9c771..a9a23ca 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 _0xbc87=['sequelize','STRING','BOOLEAN'];(function(_0xf54084,_0x561894){var _0x5cf05b=function(_0x91ba27){while(--_0x91ba27){_0xf54084['push'](_0xf54084['shift']());}};_0x5cf05b(++_0x561894);}(_0xbc87,0x144));var _0x7bc8=function(_0x1f3dcc,_0x39e9f9){_0x1f3dcc=_0x1f3dcc-0x0;var _0xf990ba=_0xbc87[_0x1f3dcc];return _0xf990ba;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7bc8('0x1')]},'description':{'type':Sequelize[_0x7bc8('0x1')]},'status':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x1ebd=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1f01d0,_0x53e39c){var _0x2156e9=function(_0x2a01c7){while(--_0x2a01c7){_0x1f01d0['push'](_0x1f01d0['shift']());}};_0x2156e9(++_0x53e39c);}(_0x1ebd,0x64));var _0xd1eb=function(_0x1004ab,_0x4684e3){_0x1004ab=_0x1004ab-0x0;var _0x59aa34=_0x1ebd[_0x1004ab];return _0x59aa34;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd1eb('0x2')]},'status':{'type':Sequelize[_0xd1eb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd1eb('0x4')],'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 a92eece..a2979b2 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 _0xdf71=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','Automation','rawAttributes','query','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','merge','map','key','VIRTUAL','field','where','includeAll','include','findAll','catch','params','keys','fields','options','create','body','find','addConditions','Condition','ids','omit','getConditions','hasOwnProperty','addActions','Action','getActions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x135de8,_0x45fe61){var _0x42f51c=function(_0x35e2f3){while(--_0x35e2f3){_0x135de8['push'](_0x135de8['shift']());}};_0x42f51c(++_0x45fe61);}(_0xdf71,0x1d2));var _0x1df7=function(_0x144c51,_0x9327f0){_0x144c51=_0x144c51-0x0;var _0x24653f=_0xdf71[_0x144c51];return _0x24653f;};'use strict';var pdf=require(_0x1df7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1df7('0x1'));var zipdir=require(_0x1df7('0x2'));var jsonpatch=require(_0x1df7('0x3'));var rp=require(_0x1df7('0x4'));var moment=require(_0x1df7('0x5'));var BPromise=require(_0x1df7('0x6'));var Mustache=require(_0x1df7('0x7'));var util=require('util');var path=require(_0x1df7('0x8'));var sox=require(_0x1df7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1df7('0xa'));var squel=require(_0x1df7('0xb'));var crypto=require('crypto');var jsforce=require(_0x1df7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1df7('0xd'));var querystring=require(_0x1df7('0xe'));var Papa=require(_0x1df7('0xf'));var Redis=require(_0x1df7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1df7('0x11'));var hardwareService=require(_0x1df7('0x12'));var logger=require(_0x1df7('0x13'))(_0x1df7('0x14'));var utils=require(_0x1df7('0x15'));var config=require(_0x1df7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3744d0,_0x533620){_0x533620=_0x533620||0xcc;return function(_0x91d932){if(_0x91d932){return _0x3744d0[_0x1df7('0x17')](_0x533620);}return _0x3744d0[_0x1df7('0x18')](_0x533620)[_0x1df7('0x19')]();};}function respondWithResult(_0x2b6935,_0x535756){_0x535756=_0x535756||0xc8;return function(_0x20b8cf){if(_0x20b8cf){return _0x2b6935[_0x1df7('0x18')](_0x535756)[_0x1df7('0x1a')](_0x20b8cf);}};}function respondWithFilteredResult(_0x57f931,_0x5b21f5){return function(_0x8cfd99){if(_0x8cfd99){var _0x5734dd=_0x8cfd99[_0x1df7('0x1b')],_0x10dd13=_0x5b21f5[_0x1df7('0x1c')],_0x543af6=_0x5b21f5[_0x1df7('0x1c')]+_0x5b21f5[_0x1df7('0x1d')],_0x191046;if(_0x543af6>=_0x5734dd){_0x543af6=_0x5734dd;_0x191046=0xc8;}else{_0x191046=0xce;}_0x57f931['status'](_0x191046);return _0x57f931[_0x1df7('0x1e')](_0x1df7('0x1f'),_0x10dd13+'-'+_0x543af6+'/'+_0x5734dd)[_0x1df7('0x1a')](_0x8cfd99);}return null;};}function patchUpdates(_0x15bfad){return function(_0x5af91){try{jsonpatch[_0x1df7('0x20')](_0x5af91,_0x15bfad,!![]);}catch(_0x5cc02f){return BPromise['reject'](_0x5cc02f);}return _0x5af91[_0x1df7('0x21')]();};}function saveUpdates(_0x33cb39,_0x195ec2){return function(_0x1f8851){if(_0x1f8851){return _0x1f8851[_0x1df7('0x22')](_0x33cb39)[_0x1df7('0x23')](function(_0x56c6ce){return _0x56c6ce;});}return null;};}function removeEntity(_0x1ade09,_0x2758af){return function(_0xb3c4cc){if(_0xb3c4cc){return _0xb3c4cc[_0x1df7('0x24')]()[_0x1df7('0x23')](function(){_0x1ade09[_0x1df7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c48ae,_0x387d3f){return function(_0x1d134a){if(!_0x1d134a){_0x5c48ae[_0x1df7('0x17')](0x194);}return _0x1d134a;};}function handleError(_0x104952,_0x1d3618){_0x1d3618=_0x1d3618||0x1f4;return function(_0x1f96ae){logger['error'](_0x1f96ae[_0x1df7('0x25')]);if(_0x1f96ae[_0x1df7('0x26')]){delete _0x1f96ae[_0x1df7('0x26')];}_0x104952[_0x1df7('0x18')](_0x1d3618)[_0x1df7('0x27')](_0x1f96ae);};}exports[_0x1df7('0x28')]=function(_0xce818f,_0x4fa7bf){var _0x3fda08={},_0x242575={},_0x1a6ebe={'count':0x0,'rows':[]};var _0x23d328=db[_0x1df7('0x29')][_0x1df7('0x2a')];_0x242575['model']=_['keys'](_0x23d328);_0x242575[_0x1df7('0x2b')]=_['keys'](_0xce818f[_0x1df7('0x2b')]);_0x242575[_0x1df7('0x2c')]=_[_0x1df7('0x2d')](_0x242575['model'],_0x242575[_0x1df7('0x2b')]);_0x3fda08['attributes']=_[_0x1df7('0x2d')](_0x242575[_0x1df7('0x2e')],qs['fields'](_0xce818f[_0x1df7('0x2b')]['fields']));_0x3fda08[_0x1df7('0x2f')]=_0x3fda08['attributes'][_0x1df7('0x30')]?_0x3fda08[_0x1df7('0x2f')]:_0x242575[_0x1df7('0x2e')];if(!_0xce818f[_0x1df7('0x2b')]['hasOwnProperty'](_0x1df7('0x31'))){_0x3fda08[_0x1df7('0x1d')]=qs[_0x1df7('0x1d')](_0xce818f[_0x1df7('0x2b')][_0x1df7('0x1d')]);_0x3fda08['offset']=qs[_0x1df7('0x1c')](_0xce818f['query']['offset']);}_0x3fda08[_0x1df7('0x32')]=qs[_0x1df7('0x33')](_0xce818f[_0x1df7('0x2b')][_0x1df7('0x33')]);_0x3fda08['where']=qs['filters'](_[_0x1df7('0x34')](_0xce818f[_0x1df7('0x2b')],_0x242575['filters']));if(_0xce818f['query'][_0x1df7('0x35')]){_0x3fda08['where']=_[_0x1df7('0x36')](_0x3fda08['where'],{'$or':_[_0x1df7('0x37')](_0x23d328,function(_0x2713fd){if(_0x2713fd['type'][_0x1df7('0x38')]!==_0x1df7('0x39')){var _0xd75d63={};_0xd75d63[_0x2713fd[_0x1df7('0x3a')]]={'$like':'%'+_0xce818f['query'][_0x1df7('0x35')]+'%'};return _0xd75d63;}})});}_0x3fda08=_['merge']({},_0x3fda08,_0xce818f['options']);var _0x537fbe={'where':_0x3fda08[_0x1df7('0x3b')]};return db['Automation'][_0x1df7('0x1b')](_0x537fbe)[_0x1df7('0x23')](function(_0x53e62d){_0x1a6ebe[_0x1df7('0x1b')]=_0x53e62d;if(_0xce818f['query'][_0x1df7('0x3c')]){_0x3fda08[_0x1df7('0x3d')]=[{'all':!![]}];}return db[_0x1df7('0x29')][_0x1df7('0x3e')](_0x3fda08);})[_0x1df7('0x23')](function(_0x4e6c05){_0x1a6ebe['rows']=_0x4e6c05;return _0x1a6ebe;})[_0x1df7('0x23')](respondWithFilteredResult(_0x4fa7bf,_0x3fda08))[_0x1df7('0x3f')](handleError(_0x4fa7bf,null));};exports['show']=function(_0x41aab6,_0x2c3a04){var _0x124c7a={'raw':![],'where':{'id':_0x41aab6[_0x1df7('0x40')]['id']}},_0x32f80f={};_0x32f80f[_0x1df7('0x2e')]=_[_0x1df7('0x41')](db[_0x1df7('0x29')][_0x1df7('0x2a')]);_0x32f80f[_0x1df7('0x2b')]=_[_0x1df7('0x41')](_0x41aab6[_0x1df7('0x2b')]);_0x32f80f['filters']=_['intersection'](_0x32f80f['model'],_0x32f80f[_0x1df7('0x2b')]);_0x124c7a[_0x1df7('0x2f')]=_[_0x1df7('0x2d')](_0x32f80f[_0x1df7('0x2e')],qs[_0x1df7('0x42')](_0x41aab6['query']['fields']));_0x124c7a[_0x1df7('0x2f')]=_0x124c7a[_0x1df7('0x2f')][_0x1df7('0x30')]?_0x124c7a[_0x1df7('0x2f')]:_0x32f80f['model'];if(_0x41aab6[_0x1df7('0x2b')][_0x1df7('0x3c')]){_0x124c7a[_0x1df7('0x3d')]=[{'all':!![]}];}_0x124c7a=_['merge']({},_0x124c7a,_0x41aab6[_0x1df7('0x43')]);return db[_0x1df7('0x29')]['find'](_0x124c7a)['then'](handleEntityNotFound(_0x2c3a04,null))[_0x1df7('0x23')](respondWithResult(_0x2c3a04,null))['catch'](handleError(_0x2c3a04,null));};exports[_0x1df7('0x44')]=function(_0x2c11f5,_0x48c15e){return db[_0x1df7('0x29')]['create'](_0x2c11f5[_0x1df7('0x45')],{})[_0x1df7('0x23')](respondWithResult(_0x48c15e,0xc9))['catch'](handleError(_0x48c15e,null));};exports[_0x1df7('0x22')]=function(_0x3d546f,_0xf74688){if(_0x3d546f[_0x1df7('0x45')]['id']){delete _0x3d546f[_0x1df7('0x45')]['id'];}return db[_0x1df7('0x29')][_0x1df7('0x46')]({'where':{'id':_0x3d546f[_0x1df7('0x40')]['id']}})[_0x1df7('0x23')](handleEntityNotFound(_0xf74688,null))[_0x1df7('0x23')](saveUpdates(_0x3d546f[_0x1df7('0x45')],null))[_0x1df7('0x23')](respondWithResult(_0xf74688,null))[_0x1df7('0x3f')](handleError(_0xf74688,null));};exports[_0x1df7('0x24')]=function(_0x2f1f7a,_0xb1fbf0){return db[_0x1df7('0x29')][_0x1df7('0x46')]({'where':{'id':_0x2f1f7a[_0x1df7('0x40')]['id']}})['then'](handleEntityNotFound(_0xb1fbf0,null))['then'](removeEntity(_0xb1fbf0,null))[_0x1df7('0x3f')](handleError(_0xb1fbf0,null));};exports[_0x1df7('0x47')]=function(_0x1be253,_0x9428f,_0x1fc284){return db[_0x1df7('0x48')][_0x1df7('0x46')]({'where':{'id':_0x1be253[_0x1df7('0x40')]['id']}})['then'](handleEntityNotFound(_0x9428f,null))[_0x1df7('0x23')](function(_0x4fc583){if(_0x4fc583){return _0x4fc583[_0x1df7('0x47')](_0x1be253[_0x1df7('0x45')][_0x1df7('0x49')],_[_0x1df7('0x4a')](_0x1be253['body'],['ids','id'])||{});}})[_0x1df7('0x23')](respondWithResult(_0x9428f,null))[_0x1df7('0x3f')](handleError(_0x9428f,null));};exports['getConditions']=function(_0x53e28d,_0x5e57cb,_0x1079b8){var _0x1a8984={};var _0x5017c2={};var _0x1c1c01;var _0x15c4d1;return db[_0x1df7('0x29')]['findOne']({'where':{'id':_0x53e28d[_0x1df7('0x40')]['id']}})[_0x1df7('0x23')](handleEntityNotFound(_0x5e57cb,null))[_0x1df7('0x23')](function(_0x2c7a55){if(_0x2c7a55){_0x1c1c01=_0x2c7a55;_0x5017c2[_0x1df7('0x2e')]=_[_0x1df7('0x41')](db['Condition'][_0x1df7('0x2a')]);_0x5017c2['query']=_[_0x1df7('0x41')](_0x53e28d[_0x1df7('0x2b')]);_0x5017c2[_0x1df7('0x2c')]=_[_0x1df7('0x2d')](_0x5017c2[_0x1df7('0x2e')],_0x5017c2[_0x1df7('0x2b')]);_0x1a8984[_0x1df7('0x2f')]=_[_0x1df7('0x2d')](_0x5017c2['model'],qs[_0x1df7('0x42')](_0x53e28d[_0x1df7('0x2b')][_0x1df7('0x42')]));_0x1a8984['attributes']=_0x1a8984[_0x1df7('0x2f')][_0x1df7('0x30')]?_0x1a8984[_0x1df7('0x2f')]:_0x5017c2[_0x1df7('0x2e')];_0x1a8984['order']=qs['sort'](_0x53e28d[_0x1df7('0x2b')][_0x1df7('0x33')]);_0x1a8984[_0x1df7('0x3b')]=qs[_0x1df7('0x2c')](_[_0x1df7('0x34')](_0x53e28d[_0x1df7('0x2b')],_0x5017c2[_0x1df7('0x2c')]));if(_0x53e28d[_0x1df7('0x2b')][_0x1df7('0x35')]){_0x1a8984['where']=_[_0x1df7('0x36')](_0x1a8984[_0x1df7('0x3b')],{'$or':_[_0x1df7('0x37')](_0x1a8984[_0x1df7('0x2f')],function(_0x1060a9){var _0xc86631={};_0xc86631[_0x1060a9]={'$like':'%'+_0x53e28d[_0x1df7('0x2b')][_0x1df7('0x35')]+'%'};return _0xc86631;})});}_0x1a8984=_[_0x1df7('0x36')]({},_0x1a8984,_0x53e28d[_0x1df7('0x43')]);return _0x1c1c01[_0x1df7('0x4b')](_0x1a8984);}})[_0x1df7('0x23')](function(_0x30afb4){if(_0x30afb4){_0x15c4d1=_0x30afb4[_0x1df7('0x30')];if(!_0x53e28d[_0x1df7('0x2b')][_0x1df7('0x4c')](_0x1df7('0x31'))){_0x1a8984[_0x1df7('0x1d')]=qs[_0x1df7('0x1d')](_0x53e28d['query']['limit']);_0x1a8984[_0x1df7('0x1c')]=qs[_0x1df7('0x1c')](_0x53e28d['query'][_0x1df7('0x1c')]);}return _0x1c1c01[_0x1df7('0x4b')](_0x1a8984);}})[_0x1df7('0x23')](function(_0x76c281){if(_0x76c281){return _0x76c281?{'count':_0x15c4d1,'rows':_0x76c281}:null;}})[_0x1df7('0x23')](respondWithResult(_0x5e57cb,null))[_0x1df7('0x3f')](handleError(_0x5e57cb,null));};exports[_0x1df7('0x4d')]=function(_0xb3ea87,_0x45ecc6,_0xaa38fc){return db[_0x1df7('0x4e')]['find']({'where':{'id':_0xb3ea87[_0x1df7('0x40')]['id']}})[_0x1df7('0x23')](handleEntityNotFound(_0x45ecc6,null))[_0x1df7('0x23')](function(_0xb99189){if(_0xb99189){return _0xb99189['addActions'](_0xb3ea87[_0x1df7('0x45')][_0x1df7('0x49')],_[_0x1df7('0x4a')](_0xb3ea87[_0x1df7('0x45')],['ids','id'])||{});}})[_0x1df7('0x23')](respondWithResult(_0x45ecc6,null))[_0x1df7('0x3f')](handleError(_0x45ecc6,null));};exports[_0x1df7('0x4f')]=function(_0x233445,_0xfa099c,_0x4e9fbd){var _0x22058d={};var _0x904bc6={};var _0x4254b4;var _0x150ef0;return db[_0x1df7('0x29')][_0x1df7('0x50')]({'where':{'id':_0x233445[_0x1df7('0x40')]['id']}})[_0x1df7('0x23')](handleEntityNotFound(_0xfa099c,null))['then'](function(_0xfa397d){if(_0xfa397d){_0x4254b4=_0xfa397d;_0x904bc6[_0x1df7('0x2e')]=_[_0x1df7('0x41')](db[_0x1df7('0x4e')][_0x1df7('0x2a')]);_0x904bc6[_0x1df7('0x2b')]=_[_0x1df7('0x41')](_0x233445[_0x1df7('0x2b')]);_0x904bc6['filters']=_['intersection'](_0x904bc6[_0x1df7('0x2e')],_0x904bc6[_0x1df7('0x2b')]);_0x22058d['attributes']=_[_0x1df7('0x2d')](_0x904bc6['model'],qs['fields'](_0x233445[_0x1df7('0x2b')][_0x1df7('0x42')]));_0x22058d['attributes']=_0x22058d[_0x1df7('0x2f')][_0x1df7('0x30')]?_0x22058d['attributes']:_0x904bc6[_0x1df7('0x2e')];_0x22058d['order']=qs[_0x1df7('0x33')](_0x233445[_0x1df7('0x2b')][_0x1df7('0x33')]);_0x22058d[_0x1df7('0x3b')]=qs[_0x1df7('0x2c')](_['pick'](_0x233445[_0x1df7('0x2b')],_0x904bc6[_0x1df7('0x2c')]));if(_0x233445[_0x1df7('0x2b')]['filter']){_0x22058d[_0x1df7('0x3b')]=_['merge'](_0x22058d['where'],{'$or':_[_0x1df7('0x37')](_0x22058d['attributes'],function(_0x3b4b9b){var _0x49c722={};_0x49c722[_0x3b4b9b]={'$like':'%'+_0x233445[_0x1df7('0x2b')]['filter']+'%'};return _0x49c722;})});}_0x22058d=_[_0x1df7('0x36')]({},_0x22058d,_0x233445['options']);return _0x4254b4[_0x1df7('0x4f')](_0x22058d);}})[_0x1df7('0x23')](function(_0x3a2491){if(_0x3a2491){_0x150ef0=_0x3a2491[_0x1df7('0x30')];if(!_0x233445[_0x1df7('0x2b')][_0x1df7('0x4c')](_0x1df7('0x31'))){_0x22058d[_0x1df7('0x1d')]=qs[_0x1df7('0x1d')](_0x233445[_0x1df7('0x2b')][_0x1df7('0x1d')]);_0x22058d['offset']=qs[_0x1df7('0x1c')](_0x233445['query'][_0x1df7('0x1c')]);}return _0x4254b4['getActions'](_0x22058d);}})['then'](function(_0x24b268){if(_0x24b268){return _0x24b268?{'count':_0x150ef0,'rows':_0x24b268}:null;}})[_0x1df7('0x23')](respondWithResult(_0xfa099c,null))[_0x1df7('0x3f')](handleError(_0xfa099c,null));}; \ No newline at end of file +var _0x512b=['find','create','body','destroy','addConditions','Condition','ids','omit','findOne','filters','order','getConditions','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','save','update','then','end','error','stack','name','send','index','Automation','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','key','VIRTUAL','field','include','findAll','rows','catch','show','params','length','includeAll','options'];(function(_0x4aa1f6,_0x16495f){var _0x4abc07=function(_0x2ab497){while(--_0x2ab497){_0x4aa1f6['push'](_0x4aa1f6['shift']());}};_0x4abc07(++_0x16495f);}(_0x512b,0x15b));var _0xb512=function(_0x967100,_0x55f89a){_0x967100=_0x967100-0x0;var _0xe140e2=_0x512b[_0x967100];return _0xe140e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb512('0x0'));var rimraf=require(_0xb512('0x1'));var zipdir=require(_0xb512('0x2'));var jsonpatch=require(_0xb512('0x3'));var rp=require(_0xb512('0x4'));var moment=require(_0xb512('0x5'));var BPromise=require(_0xb512('0x6'));var Mustache=require(_0xb512('0x7'));var util=require(_0xb512('0x8'));var path=require('path');var sox=require(_0xb512('0x9'));var csv=require(_0xb512('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb512('0xb'));var squel=require('squel');var crypto=require(_0xb512('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb512('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb512('0xe'));var Papa=require('papaparse');var Redis=require(_0xb512('0xf'));var authService=require(_0xb512('0x10'));var qs=require(_0xb512('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb512('0x12'))(_0xb512('0x13'));var utils=require(_0xb512('0x14'));var config=require(_0xb512('0x15'));var db=require(_0xb512('0x16'))['db'];function respondWithStatusCode(_0x37ac4b,_0xb4805c){_0xb4805c=_0xb4805c||0xcc;return function(_0x38b36a){if(_0x38b36a){return _0x37ac4b[_0xb512('0x17')](_0xb4805c);}return _0x37ac4b[_0xb512('0x18')](_0xb4805c)['end']();};}function respondWithResult(_0x52f27c,_0x490d62){_0x490d62=_0x490d62||0xc8;return function(_0x2f9de4){if(_0x2f9de4){return _0x52f27c[_0xb512('0x18')](_0x490d62)[_0xb512('0x19')](_0x2f9de4);}};}function respondWithFilteredResult(_0x1aef5b,_0x4f559b){return function(_0x35a237){if(_0x35a237){var _0x110c67=_0x35a237[_0xb512('0x1a')],_0x56f6b4=_0x4f559b[_0xb512('0x1b')],_0x2e5704=_0x4f559b[_0xb512('0x1b')]+_0x4f559b['limit'],_0x1b8991;if(_0x2e5704>=_0x110c67){_0x2e5704=_0x110c67;_0x1b8991=0xc8;}else{_0x1b8991=0xce;}_0x1aef5b['status'](_0x1b8991);return _0x1aef5b[_0xb512('0x1c')]('Content-Range',_0x56f6b4+'-'+_0x2e5704+'/'+_0x110c67)[_0xb512('0x19')](_0x35a237);}return null;};}function patchUpdates(_0x49b894){return function(_0x43f011){try{jsonpatch[_0xb512('0x1d')](_0x43f011,_0x49b894,!![]);}catch(_0x4df28d){return BPromise['reject'](_0x4df28d);}return _0x43f011[_0xb512('0x1e')]();};}function saveUpdates(_0x53ff3a,_0x19f007){return function(_0x19bddd){if(_0x19bddd){return _0x19bddd[_0xb512('0x1f')](_0x53ff3a)['then'](function(_0x2cafbc){return _0x2cafbc;});}return null;};}function removeEntity(_0x5c2616,_0x2747f3){return function(_0x225e39){if(_0x225e39){return _0x225e39['destroy']()[_0xb512('0x20')](function(){_0x5c2616[_0xb512('0x18')](0xcc)[_0xb512('0x21')]();});}};}function handleEntityNotFound(_0x5315ab,_0x17e92a){return function(_0x144fc9){if(!_0x144fc9){_0x5315ab['sendStatus'](0x194);}return _0x144fc9;};}function handleError(_0x5390c7,_0x575f4d){_0x575f4d=_0x575f4d||0x1f4;return function(_0x1998cd){logger[_0xb512('0x22')](_0x1998cd[_0xb512('0x23')]);if(_0x1998cd[_0xb512('0x24')]){delete _0x1998cd[_0xb512('0x24')];}_0x5390c7[_0xb512('0x18')](_0x575f4d)[_0xb512('0x25')](_0x1998cd);};}exports[_0xb512('0x26')]=function(_0x572de4,_0x158e86){var _0x8d84c0={},_0x48fdb9={},_0x310cbf={'count':0x0,'rows':[]};var _0xc12697=db[_0xb512('0x27')][_0xb512('0x28')];_0x48fdb9[_0xb512('0x29')]=_[_0xb512('0x2a')](_0xc12697);_0x48fdb9['query']=_[_0xb512('0x2a')](_0x572de4[_0xb512('0x2b')]);_0x48fdb9['filters']=_[_0xb512('0x2c')](_0x48fdb9[_0xb512('0x29')],_0x48fdb9[_0xb512('0x2b')]);_0x8d84c0[_0xb512('0x2d')]=_['intersection'](_0x48fdb9[_0xb512('0x29')],qs['fields'](_0x572de4[_0xb512('0x2b')][_0xb512('0x2e')]));_0x8d84c0[_0xb512('0x2d')]=_0x8d84c0[_0xb512('0x2d')]['length']?_0x8d84c0['attributes']:_0x48fdb9[_0xb512('0x29')];if(!_0x572de4[_0xb512('0x2b')][_0xb512('0x2f')](_0xb512('0x30'))){_0x8d84c0['limit']=qs[_0xb512('0x31')](_0x572de4[_0xb512('0x2b')][_0xb512('0x31')]);_0x8d84c0['offset']=qs['offset'](_0x572de4['query']['offset']);}_0x8d84c0['order']=qs[_0xb512('0x32')](_0x572de4[_0xb512('0x2b')][_0xb512('0x32')]);_0x8d84c0['where']=qs['filters'](_[_0xb512('0x33')](_0x572de4[_0xb512('0x2b')],_0x48fdb9['filters']));if(_0x572de4[_0xb512('0x2b')][_0xb512('0x34')]){_0x8d84c0[_0xb512('0x35')]=_[_0xb512('0x36')](_0x8d84c0[_0xb512('0x35')],{'$or':_[_0xb512('0x37')](_0xc12697,function(_0xbe780b){if(_0xbe780b['type'][_0xb512('0x38')]!==_0xb512('0x39')){var _0x236367={};_0x236367[_0xbe780b[_0xb512('0x3a')]]={'$like':'%'+_0x572de4[_0xb512('0x2b')][_0xb512('0x34')]+'%'};return _0x236367;}})});}_0x8d84c0=_[_0xb512('0x36')]({},_0x8d84c0,_0x572de4['options']);var _0x41f9ee={'where':_0x8d84c0['where']};return db[_0xb512('0x27')]['count'](_0x41f9ee)[_0xb512('0x20')](function(_0x31ee86){_0x310cbf[_0xb512('0x1a')]=_0x31ee86;if(_0x572de4[_0xb512('0x2b')]['includeAll']){_0x8d84c0[_0xb512('0x3b')]=[{'all':!![]}];}return db[_0xb512('0x27')][_0xb512('0x3c')](_0x8d84c0);})[_0xb512('0x20')](function(_0x43646c){_0x310cbf[_0xb512('0x3d')]=_0x43646c;return _0x310cbf;})[_0xb512('0x20')](respondWithFilteredResult(_0x158e86,_0x8d84c0))[_0xb512('0x3e')](handleError(_0x158e86,null));};exports[_0xb512('0x3f')]=function(_0x563ce0,_0x2f6b1c){var _0x436016={'raw':![],'where':{'id':_0x563ce0[_0xb512('0x40')]['id']}},_0x29fb6c={};_0x29fb6c[_0xb512('0x29')]=_[_0xb512('0x2a')](db[_0xb512('0x27')][_0xb512('0x28')]);_0x29fb6c['query']=_[_0xb512('0x2a')](_0x563ce0[_0xb512('0x2b')]);_0x29fb6c['filters']=_[_0xb512('0x2c')](_0x29fb6c[_0xb512('0x29')],_0x29fb6c[_0xb512('0x2b')]);_0x436016[_0xb512('0x2d')]=_[_0xb512('0x2c')](_0x29fb6c[_0xb512('0x29')],qs[_0xb512('0x2e')](_0x563ce0[_0xb512('0x2b')][_0xb512('0x2e')]));_0x436016['attributes']=_0x436016[_0xb512('0x2d')][_0xb512('0x41')]?_0x436016['attributes']:_0x29fb6c[_0xb512('0x29')];if(_0x563ce0[_0xb512('0x2b')][_0xb512('0x42')]){_0x436016[_0xb512('0x3b')]=[{'all':!![]}];}_0x436016=_[_0xb512('0x36')]({},_0x436016,_0x563ce0[_0xb512('0x43')]);return db[_0xb512('0x27')][_0xb512('0x44')](_0x436016)['then'](handleEntityNotFound(_0x2f6b1c,null))[_0xb512('0x20')](respondWithResult(_0x2f6b1c,null))[_0xb512('0x3e')](handleError(_0x2f6b1c,null));};exports[_0xb512('0x45')]=function(_0x21da37,_0x17487d){return db[_0xb512('0x27')][_0xb512('0x45')](_0x21da37[_0xb512('0x46')],{})[_0xb512('0x20')](respondWithResult(_0x17487d,0xc9))[_0xb512('0x3e')](handleError(_0x17487d,null));};exports[_0xb512('0x1f')]=function(_0x5e23fc,_0x41c0c2){if(_0x5e23fc['body']['id']){delete _0x5e23fc[_0xb512('0x46')]['id'];}return db['Automation'][_0xb512('0x44')]({'where':{'id':_0x5e23fc[_0xb512('0x40')]['id']}})[_0xb512('0x20')](handleEntityNotFound(_0x41c0c2,null))[_0xb512('0x20')](saveUpdates(_0x5e23fc[_0xb512('0x46')],null))[_0xb512('0x20')](respondWithResult(_0x41c0c2,null))[_0xb512('0x3e')](handleError(_0x41c0c2,null));};exports[_0xb512('0x47')]=function(_0x596436,_0x597487){return db[_0xb512('0x27')]['find']({'where':{'id':_0x596436[_0xb512('0x40')]['id']}})[_0xb512('0x20')](handleEntityNotFound(_0x597487,null))['then'](removeEntity(_0x597487,null))['catch'](handleError(_0x597487,null));};exports[_0xb512('0x48')]=function(_0x3a01c2,_0xf057fc,_0x438769){return db[_0xb512('0x49')]['find']({'where':{'id':_0x3a01c2[_0xb512('0x40')]['id']}})[_0xb512('0x20')](handleEntityNotFound(_0xf057fc,null))[_0xb512('0x20')](function(_0x2eb12c){if(_0x2eb12c){return _0x2eb12c['addConditions'](_0x3a01c2[_0xb512('0x46')][_0xb512('0x4a')],_[_0xb512('0x4b')](_0x3a01c2[_0xb512('0x46')],[_0xb512('0x4a'),'id'])||{});}})[_0xb512('0x20')](respondWithResult(_0xf057fc,null))[_0xb512('0x3e')](handleError(_0xf057fc,null));};exports['getConditions']=function(_0x4de4d1,_0x29e0d9,_0x6b8215){var _0xf746d7={};var _0x55675f={};var _0x233962;var _0x3693d8;return db[_0xb512('0x27')][_0xb512('0x4c')]({'where':{'id':_0x4de4d1[_0xb512('0x40')]['id']}})['then'](handleEntityNotFound(_0x29e0d9,null))[_0xb512('0x20')](function(_0x7af381){if(_0x7af381){_0x233962=_0x7af381;_0x55675f[_0xb512('0x29')]=_['keys'](db[_0xb512('0x49')][_0xb512('0x28')]);_0x55675f[_0xb512('0x2b')]=_['keys'](_0x4de4d1[_0xb512('0x2b')]);_0x55675f[_0xb512('0x4d')]=_[_0xb512('0x2c')](_0x55675f[_0xb512('0x29')],_0x55675f[_0xb512('0x2b')]);_0xf746d7[_0xb512('0x2d')]=_['intersection'](_0x55675f[_0xb512('0x29')],qs['fields'](_0x4de4d1[_0xb512('0x2b')]['fields']));_0xf746d7['attributes']=_0xf746d7[_0xb512('0x2d')][_0xb512('0x41')]?_0xf746d7[_0xb512('0x2d')]:_0x55675f[_0xb512('0x29')];_0xf746d7[_0xb512('0x4e')]=qs[_0xb512('0x32')](_0x4de4d1[_0xb512('0x2b')]['sort']);_0xf746d7['where']=qs[_0xb512('0x4d')](_['pick'](_0x4de4d1[_0xb512('0x2b')],_0x55675f[_0xb512('0x4d')]));if(_0x4de4d1[_0xb512('0x2b')]['filter']){_0xf746d7[_0xb512('0x35')]=_[_0xb512('0x36')](_0xf746d7[_0xb512('0x35')],{'$or':_[_0xb512('0x37')](_0xf746d7['attributes'],function(_0x578c85){var _0x458e4e={};_0x458e4e[_0x578c85]={'$like':'%'+_0x4de4d1['query'][_0xb512('0x34')]+'%'};return _0x458e4e;})});}_0xf746d7=_[_0xb512('0x36')]({},_0xf746d7,_0x4de4d1['options']);return _0x233962[_0xb512('0x4f')](_0xf746d7);}})[_0xb512('0x20')](function(_0x1feb1d){if(_0x1feb1d){_0x3693d8=_0x1feb1d[_0xb512('0x41')];if(!_0x4de4d1[_0xb512('0x2b')][_0xb512('0x2f')](_0xb512('0x30'))){_0xf746d7[_0xb512('0x31')]=qs[_0xb512('0x31')](_0x4de4d1['query'][_0xb512('0x31')]);_0xf746d7[_0xb512('0x1b')]=qs['offset'](_0x4de4d1[_0xb512('0x2b')]['offset']);}return _0x233962[_0xb512('0x4f')](_0xf746d7);}})[_0xb512('0x20')](function(_0x5d7c54){if(_0x5d7c54){return _0x5d7c54?{'count':_0x3693d8,'rows':_0x5d7c54}:null;}})[_0xb512('0x20')](respondWithResult(_0x29e0d9,null))['catch'](handleError(_0x29e0d9,null));};exports[_0xb512('0x50')]=function(_0x1498cf,_0x538197,_0x445e9e){return db['Action'][_0xb512('0x44')]({'where':{'id':_0x1498cf['params']['id']}})[_0xb512('0x20')](handleEntityNotFound(_0x538197,null))['then'](function(_0x261869){if(_0x261869){return _0x261869['addActions'](_0x1498cf[_0xb512('0x46')]['ids'],_[_0xb512('0x4b')](_0x1498cf[_0xb512('0x46')],['ids','id'])||{});}})[_0xb512('0x20')](respondWithResult(_0x538197,null))[_0xb512('0x3e')](handleError(_0x538197,null));};exports[_0xb512('0x51')]=function(_0x3ac191,_0x47fd25,_0x3c6e4f){var _0x458628={};var _0x2af387={};var _0x1c9e46;var _0xc8f898;return db[_0xb512('0x27')][_0xb512('0x4c')]({'where':{'id':_0x3ac191['params']['id']}})[_0xb512('0x20')](handleEntityNotFound(_0x47fd25,null))[_0xb512('0x20')](function(_0x238747){if(_0x238747){_0x1c9e46=_0x238747;_0x2af387[_0xb512('0x29')]=_['keys'](db[_0xb512('0x52')]['rawAttributes']);_0x2af387[_0xb512('0x2b')]=_[_0xb512('0x2a')](_0x3ac191[_0xb512('0x2b')]);_0x2af387['filters']=_[_0xb512('0x2c')](_0x2af387[_0xb512('0x29')],_0x2af387[_0xb512('0x2b')]);_0x458628[_0xb512('0x2d')]=_[_0xb512('0x2c')](_0x2af387[_0xb512('0x29')],qs[_0xb512('0x2e')](_0x3ac191[_0xb512('0x2b')][_0xb512('0x2e')]));_0x458628[_0xb512('0x2d')]=_0x458628[_0xb512('0x2d')]['length']?_0x458628[_0xb512('0x2d')]:_0x2af387[_0xb512('0x29')];_0x458628['order']=qs[_0xb512('0x32')](_0x3ac191[_0xb512('0x2b')][_0xb512('0x32')]);_0x458628[_0xb512('0x35')]=qs[_0xb512('0x4d')](_[_0xb512('0x33')](_0x3ac191[_0xb512('0x2b')],_0x2af387[_0xb512('0x4d')]));if(_0x3ac191[_0xb512('0x2b')][_0xb512('0x34')]){_0x458628[_0xb512('0x35')]=_[_0xb512('0x36')](_0x458628[_0xb512('0x35')],{'$or':_['map'](_0x458628[_0xb512('0x2d')],function(_0x4ede3c){var _0x2c4a67={};_0x2c4a67[_0x4ede3c]={'$like':'%'+_0x3ac191[_0xb512('0x2b')]['filter']+'%'};return _0x2c4a67;})});}_0x458628=_['merge']({},_0x458628,_0x3ac191[_0xb512('0x43')]);return _0x1c9e46[_0xb512('0x51')](_0x458628);}})[_0xb512('0x20')](function(_0xe377c4){if(_0xe377c4){_0xc8f898=_0xe377c4[_0xb512('0x41')];if(!_0x3ac191['query'][_0xb512('0x2f')]('nolimit')){_0x458628['limit']=qs['limit'](_0x3ac191[_0xb512('0x2b')]['limit']);_0x458628[_0xb512('0x1b')]=qs[_0xb512('0x1b')](_0x3ac191[_0xb512('0x2b')][_0xb512('0x1b')]);}return _0x1c9e46[_0xb512('0x51')](_0x458628);}})[_0xb512('0x20')](function(_0x1bc759){if(_0x1bc759){return _0x1bc759?{'count':_0xc8f898,'rows':_0x1bc759}:null;}})[_0xb512('0x20')](respondWithResult(_0x47fd25,null))[_0xb512('0x3e')](handleError(_0x47fd25,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b63d7ee..3bd7ff0 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 _0x6647=['path','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fed3d,_0x3b4164){var _0x3492c4=function(_0x2edf59){while(--_0x2edf59){_0x1fed3d['push'](_0x1fed3d['shift']());}};_0x3492c4(++_0x3b4164);}(_0x6647,0x165));var _0x7664=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6647[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7664('0x0'));var logger=require(_0x7664('0x1'))(_0x7664('0x2'));var moment=require(_0x7664('0x3'));var BPromise=require(_0x7664('0x4'));var rp=require(_0x7664('0x5'));var fs=require('fs');var path=require(_0x7664('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x7664('0x7')]=function(_0x550eb7,_0x29b827){return _0x550eb7[_0x7664('0x8')](_0x7664('0x9'),attributes,{'tableName':_0x7664('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cce=['request-promise','path','../../config/environment','./automation.attributes','exports','tools_automations','lodash','util','../../config/logger','moment'];(function(_0x188676,_0x351c38){var _0x1e7edf=function(_0x5a1255){while(--_0x5a1255){_0x188676['push'](_0x188676['shift']());}};_0x1e7edf(++_0x351c38);}(_0x2cce,0x88));var _0xe2cc=function(_0x6485c3,_0x212116){_0x6485c3=_0x6485c3-0x0;var _0x4285f6=_0x2cce[_0x6485c3];return _0x4285f6;};'use strict';var _=require(_0xe2cc('0x0'));var util=require(_0xe2cc('0x1'));var logger=require(_0xe2cc('0x2'))('api');var moment=require(_0xe2cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xe2cc('0x4'));var fs=require('fs');var path=require(_0xe2cc('0x5'));var rimraf=require('rimraf');var config=require(_0xe2cc('0x6'));var attributes=require(_0xe2cc('0x7'));module[_0xe2cc('0x8')]=function(_0x17c2d4,_0x3356e7){return _0x17c2d4['define']('Automation',attributes,{'tableName':_0xe2cc('0x9'),'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 98f9367..e93e766 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 _0x980e=['../../config/utils','../../config/logger','jayson/promise','request','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','ioredis'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe980('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe980('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe980('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe980('0x3'));var logger=require(_0xe980('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe980('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5825c1,_0xc47bdf,_0x27cc8c){return new BPromise(function(_0x3683df,_0x2d76d0){return client[_0xe980('0x6')](_0x5825c1,_0x27cc8c)['then'](function(_0xf9f019){logger[_0xe980('0x7')](_0xe980('0x8'),_0xc47bdf,'request\x20sent');logger[_0xe980('0x9')](_0xe980('0xa'),_0xc47bdf,_0xe980('0xb'),JSON[_0xe980('0xc')](_0xf9f019));if(_0xf9f019[_0xe980('0xd')]){if(_0xf9f019['error']['code']===0x1f4){logger['error'](_0xe980('0x8'),_0xc47bdf,_0xf9f019[_0xe980('0xd')]['message']);return _0x2d76d0(_0xf9f019['error'][_0xe980('0xe')]);}logger[_0xe980('0xd')](_0xe980('0x8'),_0xc47bdf,_0xf9f019[_0xe980('0xd')][_0xe980('0xe')]);return _0x3683df(_0xf9f019[_0xe980('0xd')][_0xe980('0xe')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0xc47bdf,'request\x20sent');_0x3683df(_0xf9f019[_0xe980('0xf')][_0xe980('0xe')]);}})[_0xe980('0x10')](function(_0x406418){logger[_0xe980('0xd')]('Automation,\x20%s,\x20%s',_0xc47bdf,_0x406418);_0x2d76d0(_0x406418);});});} \ No newline at end of file +var _0xf319=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x51d245,_0x5f2dcf){var _0x4079af=function(_0x57fab3){while(--_0x57fab3){_0x51d245['push'](_0x51d245['shift']());}};_0x4079af(++_0x5f2dcf);}(_0xf319,0xe8));var _0x9f31=function(_0x11cbd6,_0xd320e){_0x11cbd6=_0x11cbd6-0x0;var _0x5997be=_0xf319[_0x11cbd6];return _0x5997be;};'use strict';var _=require(_0x9f31('0x0'));var util=require(_0x9f31('0x1'));var moment=require(_0x9f31('0x2'));var BPromise=require(_0x9f31('0x3'));var rs=require(_0x9f31('0x4'));var fs=require('fs');var Redis=require(_0x9f31('0x5'));var db=require(_0x9f31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f31('0x7'))(_0x9f31('0x8'));var config=require(_0x9f31('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9f31('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9c3007,_0x5597df,_0x2ac86b){return new BPromise(function(_0xb3c0c7,_0x2dd3a9){return client[_0x9f31('0xb')](_0x9c3007,_0x2ac86b)[_0x9f31('0xc')](function(_0x50c270){logger[_0x9f31('0xd')](_0x9f31('0xe'),_0x5597df,_0x9f31('0xf'));logger[_0x9f31('0x10')](_0x9f31('0x11'),_0x5597df,_0x9f31('0xf'),JSON[_0x9f31('0x12')](_0x50c270));if(_0x50c270[_0x9f31('0x13')]){if(_0x50c270[_0x9f31('0x13')][_0x9f31('0x14')]===0x1f4){logger[_0x9f31('0x13')](_0x9f31('0xe'),_0x5597df,_0x50c270[_0x9f31('0x13')][_0x9f31('0x15')]);return _0x2dd3a9(_0x50c270['error'][_0x9f31('0x15')]);}logger[_0x9f31('0x13')](_0x9f31('0xe'),_0x5597df,_0x50c270['error'][_0x9f31('0x15')]);return _0xb3c0c7(_0x50c270[_0x9f31('0x13')][_0x9f31('0x15')]);}else{logger[_0x9f31('0xd')](_0x9f31('0xe'),_0x5597df,_0x9f31('0xf'));_0xb3c0c7(_0x50c270[_0x9f31('0x16')][_0x9f31('0x15')]);}})['catch'](function(_0x28ce0a){logger[_0x9f31('0x13')](_0x9f31('0xe'),_0x5597df,_0x28ce0a);_0x2dd3a9(_0x28ce0a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0b27d83..8b6c02e 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 _0xa8c9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util'];(function(_0x1eea20,_0x3095a8){var _0x45db8e=function(_0x4c7d23){while(--_0x4c7d23){_0x1eea20['push'](_0x1eea20['shift']());}};_0x45db8e(++_0x3095a8);}(_0xa8c9,0x16a));var _0x9a8c=function(_0x790dcc,_0x580bbb){_0x790dcc=_0x790dcc-0x0;var _0x53cd99=_0xa8c9[_0x790dcc];return _0x53cd99;};'use strict';var multer=require(_0x9a8c('0x0'));var util=require(_0x9a8c('0x1'));var path=require('path');var timeout=require(_0x9a8c('0x2'));var express=require(_0x9a8c('0x3'));var router=express[_0x9a8c('0x4')]();var auth=require(_0x9a8c('0x5'));var interaction=require(_0x9a8c('0x6'));var config=require(_0x9a8c('0x7'));var controller=require(_0x9a8c('0x8'));router[_0x9a8c('0x9')]('/',auth[_0x9a8c('0xa')](),controller[_0x9a8c('0xb')]);router[_0x9a8c('0x9')](_0x9a8c('0xc'),auth[_0x9a8c('0xa')](),controller[_0x9a8c('0xd')]);router[_0x9a8c('0x9')](_0x9a8c('0xe'),auth['isAuthenticated'](),controller[_0x9a8c('0xf')]);router[_0x9a8c('0x9')](_0x9a8c('0x10'),auth[_0x9a8c('0xa')](),controller[_0x9a8c('0x11')]);router[_0x9a8c('0x12')]('/',auth[_0x9a8c('0xa')](),controller['create']);router[_0x9a8c('0x12')](_0x9a8c('0xe'),auth['isAuthenticated'](),controller[_0x9a8c('0x13')]);router[_0x9a8c('0x12')](_0x9a8c('0x10'),auth[_0x9a8c('0xa')](),controller[_0x9a8c('0x14')]);router[_0x9a8c('0x15')](_0x9a8c('0xc'),auth[_0x9a8c('0xa')](),controller[_0x9a8c('0x16')]);router[_0x9a8c('0x17')](_0x9a8c('0xc'),auth[_0x9a8c('0xa')](),controller[_0x9a8c('0x18')]);module[_0x9a8c('0x19')]=router; \ No newline at end of file +var _0x2d05=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','/:id/conditions','addActions','put','exports','multer','util','path','connect-timeout'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x2d05,0x152));var _0x52d0=function(_0xcc3ab6,_0x16558d){_0xcc3ab6=_0xcc3ab6-0x0;var _0x181f2b=_0x2d05[_0xcc3ab6];return _0x181f2b;};'use strict';var multer=require(_0x52d0('0x0'));var util=require(_0x52d0('0x1'));var path=require(_0x52d0('0x2'));var timeout=require(_0x52d0('0x3'));var express=require(_0x52d0('0x4'));var router=express[_0x52d0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x52d0('0x6'));var config=require(_0x52d0('0x7'));var controller=require('./automation.controller');router[_0x52d0('0x8')]('/',auth[_0x52d0('0x9')](),controller['index']);router[_0x52d0('0x8')](_0x52d0('0xa'),auth[_0x52d0('0x9')](),controller[_0x52d0('0xb')]);router[_0x52d0('0x8')]('/:id/conditions',auth[_0x52d0('0x9')](),controller[_0x52d0('0xc')]);router[_0x52d0('0x8')](_0x52d0('0xd'),auth['isAuthenticated'](),controller['getActions']);router[_0x52d0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52d0('0xe')](_0x52d0('0xf'),auth['isAuthenticated'](),controller['addConditions']);router[_0x52d0('0xe')]('/:id/actions',auth[_0x52d0('0x9')](),controller[_0x52d0('0x10')]);router[_0x52d0('0x11')]('/:id',auth[_0x52d0('0x9')](),controller['update']);router['delete'](_0x52d0('0xa'),auth[_0x52d0('0x9')](),controller['destroy']);module[_0x52d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 2af9183..bb4f38c 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 _0xa65f=['Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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)'];(function(_0x2a2dc1,_0x468f87){var _0x1c0f3d=function(_0x1a636e){while(--_0x1a636e){_0x2a2dc1['push'](_0x2a2dc1['shift']());}};_0x1c0f3d(++_0x468f87);}(_0xa65f,0x14b));var _0xfa65=function(_0x4068df,_0x1880c6){_0x4068df=_0x4068df-0x0;var _0x47a6b7=_0xa65f[_0x4068df];return _0x47a6b7;};'use strict';var Sequelize=require('sequelize');module[_0xfa65('0x0')]={'name':{'type':Sequelize[_0xfa65('0x1')],'unique':_0xfa65('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfa65('0x3')](_0xfa65('0x4')),'allowNull':![],'defaultValue':_0xfa65('0x4')},'description':{'type':Sequelize[_0xfa65('0x1')]},'active':{'type':Sequelize[_0xfa65('0x5')],'defaultValue':0x0,'comment':_0xfa65('0x6')},'limitCalls':{'type':Sequelize[_0xfa65('0x7')](0x4)[_0xfa65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfa65('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfa65('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfa65('0x7')](0x3)[_0xfa65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa65('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfa65('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfa65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xfa65('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa65('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfa65('0x7')](0x5)[_0xfa65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfa65('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xfa65('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfa65('0x7')](0x5)[_0xfa65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xfa65('0x7')](0x3)[_0xfa65('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfa65('0xd')},'dialTimezone':{'type':Sequelize[_0xfa65('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xfa65('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xfa65('0x3')](_0xfa65('0xf'),_0xfa65('0x10'),_0xfa65('0x11')),'defaultValue':_0xfa65('0xf')},'dialAMDActive':{'type':Sequelize[_0xfa65('0x5')],'defaultValue':0x0,'comment':_0xfa65('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfa65('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfa65('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xfa65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfa65('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfa65('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfa65('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfa65('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfa65('0x7')](0x5)[_0xfa65('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfa65('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfa65('0x7')](0x9)[_0xfa65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa65('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xfa65('0x1a'),_0xfa65('0x1b')),'defaultValue':_0xfa65('0x1a')},'dialPrefix':{'type':Sequelize[_0xfa65('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xfa65('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa65('0x1c')},'dialCutDigit':{'type':Sequelize[_0xfa65('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa65('0x1d')}}; \ No newline at end of file +var _0x4d0d=['exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4d0d,0x1a3));var _0xd4d0=function(_0x34781f,_0x3b4c3f){_0x34781f=_0x34781f-0x0;var _0x54fd53=_0x4d0d[_0x34781f];return _0x54fd53;};'use strict';var Sequelize=require(_0xd4d0('0x0'));module[_0xd4d0('0x1')]={'name':{'type':Sequelize[_0xd4d0('0x2')],'unique':_0xd4d0('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd4d0('0x4')](_0xd4d0('0x5')),'allowNull':![],'defaultValue':_0xd4d0('0x5')},'description':{'type':Sequelize[_0xd4d0('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd4d0('0x6')](0x4)[_0xd4d0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd4d0('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd4d0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd4d0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd4d0('0x6')](0x3)[_0xd4d0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd4d0('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4d0('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd4d0('0x6')](0x5)[_0xd4d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4d0('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd4d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4d0('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd4d0('0x6')](0x3)[_0xd4d0('0x7')],'defaultValue':0x3,'comment':_0xd4d0('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd4d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd4d0('0x6')](0x3)[_0xd4d0('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd4d0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd4d0('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xd4d0('0x4')](_0xd4d0('0xe'),_0xd4d0('0xf'),_0xd4d0('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd4d0('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd4d0('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd4d0('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xd4d0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd4d0('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd4d0('0x6')](0x9)[_0xd4d0('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd4d0('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd4d0('0x6')](0x9)[_0xd4d0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd4d0('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xd4d0('0x6')](0x9)[_0xd4d0('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd4d0('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd4d0('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd4d0('0x6')](0x9)[_0xd4d0('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd4d0('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd4d0('0x6')](0x5)[_0xd4d0('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd4d0('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd4d0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd4d0('0x19'),'ASC'),'defaultValue':_0xd4d0('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd4d0('0x6')](0x3)[_0xd4d0('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd4d0('0x1a')},'dialCutDigit':{'type':Sequelize[_0xd4d0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd4d0('0x1b')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 6aca6b2..fe586e4 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 _0x9f24=['update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Campaign','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','field','merge','options','count','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_hopper','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','spread','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f24,0x64));var _0x49f2=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x9f24[_0x1d6a82];return _0x5834ac;};'use strict';var pdf=require(_0x49f2('0x0'));var emlformat=require(_0x49f2('0x1'));var rimraf=require(_0x49f2('0x2'));var zipdir=require(_0x49f2('0x3'));var jsonpatch=require(_0x49f2('0x4'));var rp=require('request-promise');var moment=require(_0x49f2('0x5'));var BPromise=require(_0x49f2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49f2('0x7'));var sox=require(_0x49f2('0x8'));var csv=require(_0x49f2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x49f2('0xa'));var squel=require(_0x49f2('0xb'));var crypto=require('crypto');var jsforce=require(_0x49f2('0xc'));var deskjs=require(_0x49f2('0xd'));var toCsv=require(_0x49f2('0x9'));var querystring=require(_0x49f2('0xe'));var Papa=require(_0x49f2('0xf'));var Redis=require(_0x49f2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x49f2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49f2('0x12'))(_0x49f2('0x13'));var utils=require(_0x49f2('0x14'));var config=require(_0x49f2('0x15'));var db=require(_0x49f2('0x16'))['db'];function respondWithStatusCode(_0x52abdc,_0x48077b){_0x48077b=_0x48077b||0xcc;return function(_0x40fb30){if(_0x40fb30){return _0x52abdc[_0x49f2('0x17')](_0x48077b);}return _0x52abdc[_0x49f2('0x18')](_0x48077b)[_0x49f2('0x19')]();};}function respondWithResult(_0x22b22c,_0x5062ca){_0x5062ca=_0x5062ca||0xc8;return function(_0xe98101){if(_0xe98101){return _0x22b22c[_0x49f2('0x18')](_0x5062ca)[_0x49f2('0x1a')](_0xe98101);}};}function respondWithFilteredResult(_0x16554c,_0x3502c9){return function(_0x2e3295){if(_0x2e3295){var _0x32a082=_0x2e3295['count'],_0x15cc50=_0x3502c9[_0x49f2('0x1b')],_0xa61048=_0x3502c9[_0x49f2('0x1b')]+_0x3502c9[_0x49f2('0x1c')],_0x32d1d5;if(_0xa61048>=_0x32a082){_0xa61048=_0x32a082;_0x32d1d5=0xc8;}else{_0x32d1d5=0xce;}_0x16554c[_0x49f2('0x18')](_0x32d1d5);return _0x16554c[_0x49f2('0x1d')](_0x49f2('0x1e'),_0x15cc50+'-'+_0xa61048+'/'+_0x32a082)['json'](_0x2e3295);}return null;};}function patchUpdates(_0x1e03dc){return function(_0x273d14){try{jsonpatch['apply'](_0x273d14,_0x1e03dc,!![]);}catch(_0x3fbb7b){return BPromise[_0x49f2('0x1f')](_0x3fbb7b);}return _0x273d14['save']();};}function saveUpdates(_0x2576d2,_0x2d03e9){return function(_0xc3ff8f){if(_0xc3ff8f){return _0xc3ff8f[_0x49f2('0x20')](_0x2576d2)[_0x49f2('0x21')](function(_0xf42af0){return _0xf42af0;});}return null;};}function removeEntity(_0x2e4c11,_0x2d4d7c){return function(_0x587019){if(_0x587019){return _0x587019['destroy']()[_0x49f2('0x21')](function(){var _0x7f94c3=_0x587019[_0x49f2('0x22')]({'plain':!![]});var _0xb1b7c2='IvrCampaigns';return db[_0x49f2('0x23')][_0x49f2('0x24')]({'where':{'type':_0xb1b7c2,'resourceId':_0x7f94c3['id']}})[_0x49f2('0x21')](function(){return _0x587019;});})[_0x49f2('0x21')](function(){_0x2e4c11[_0x49f2('0x18')](0xcc)[_0x49f2('0x19')]();});}};}function handleEntityNotFound(_0x1f2f62,_0x49504d){return function(_0x16084e){if(!_0x16084e){_0x1f2f62[_0x49f2('0x17')](0x194);}return _0x16084e;};}function handleError(_0xe23ba3,_0x418511){_0x418511=_0x418511||0x1f4;return function(_0x26557a){logger[_0x49f2('0x25')](_0x26557a[_0x49f2('0x26')]);if(_0x26557a[_0x49f2('0x27')]){delete _0x26557a[_0x49f2('0x27')];}_0xe23ba3[_0x49f2('0x18')](_0x418511)[_0x49f2('0x28')](_0x26557a);};}exports[_0x49f2('0x29')]=function(_0x3ffe2a,_0x3dcba9){var _0x5cc155={},_0x5de05a={},_0x498112={'count':0x0,'rows':[]};var _0xa6a52e=db[_0x49f2('0x2a')][_0x49f2('0x2b')];_0x5de05a[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](_0xa6a52e);_0x5de05a[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x3ffe2a[_0x49f2('0x2e')]);_0x5de05a[_0x49f2('0x2f')]=_['intersection'](_0x5de05a[_0x49f2('0x2c')],_0x5de05a['query']);_0x5cc155['attributes']=_['intersection'](_0x5de05a[_0x49f2('0x2c')],qs[_0x49f2('0x30')](_0x3ffe2a[_0x49f2('0x2e')][_0x49f2('0x30')]));_0x5cc155['attributes']=_0x5cc155[_0x49f2('0x31')][_0x49f2('0x32')]?_0x5cc155['attributes']:_0x5de05a['model'];if(!_0x3ffe2a['query'][_0x49f2('0x33')](_0x49f2('0x34'))){_0x5cc155[_0x49f2('0x1c')]=qs[_0x49f2('0x1c')](_0x3ffe2a[_0x49f2('0x2e')][_0x49f2('0x1c')]);_0x5cc155[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x3ffe2a['query'][_0x49f2('0x1b')]);}_0x5cc155[_0x49f2('0x35')]=qs['sort'](_0x3ffe2a[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x5cc155[_0x49f2('0x37')]=qs[_0x49f2('0x2f')](_['pick'](_0x3ffe2a['query'],_0x5de05a[_0x49f2('0x2f')]));if(_0x3ffe2a[_0x49f2('0x2e')][_0x49f2('0x38')]){_0x5cc155[_0x49f2('0x37')]=_['merge'](_0x5cc155[_0x49f2('0x37')],{'$or':_[_0x49f2('0x39')](_0xa6a52e,function(_0x4dbdc3){if(_0x4dbdc3[_0x49f2('0x3a')][_0x49f2('0x3b')]!=='VIRTUAL'){var _0x4ae5c4={};_0x4ae5c4[_0x4dbdc3[_0x49f2('0x3c')]]={'$like':'%'+_0x3ffe2a[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x4ae5c4;}})});}_0x5cc155=_[_0x49f2('0x3d')]({},_0x5cc155,_0x3ffe2a[_0x49f2('0x3e')]);var _0x37f6e1={'where':_0x5cc155[_0x49f2('0x37')]};return db[_0x49f2('0x2a')][_0x49f2('0x3f')](_0x37f6e1)[_0x49f2('0x21')](function(_0x3748df){_0x498112[_0x49f2('0x3f')]=_0x3748df;if(_0x3ffe2a['query'][_0x49f2('0x40')]){_0x5cc155['include']=[{'all':!![]}];}return db[_0x49f2('0x2a')][_0x49f2('0x41')](_0x5cc155);})[_0x49f2('0x21')](function(_0x1dc3d5){_0x498112[_0x49f2('0x42')]=_0x1dc3d5;return _0x498112;})[_0x49f2('0x21')](respondWithFilteredResult(_0x3dcba9,_0x5cc155))[_0x49f2('0x43')](handleError(_0x3dcba9,null));};exports[_0x49f2('0x44')]=function(_0x3f6f87,_0x5f2cb4){var _0x5e8adc={'raw':![],'where':{'id':_0x3f6f87[_0x49f2('0x45')]['id']}},_0xfdc1fa={};_0xfdc1fa[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db[_0x49f2('0x2a')][_0x49f2('0x2b')]);_0xfdc1fa[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x3f6f87[_0x49f2('0x2e')]);_0xfdc1fa[_0x49f2('0x2f')]=_['intersection'](_0xfdc1fa[_0x49f2('0x2c')],_0xfdc1fa['query']);_0x5e8adc['attributes']=_[_0x49f2('0x46')](_0xfdc1fa[_0x49f2('0x2c')],qs[_0x49f2('0x30')](_0x3f6f87['query'][_0x49f2('0x30')]));_0x5e8adc[_0x49f2('0x31')]=_0x5e8adc[_0x49f2('0x31')][_0x49f2('0x32')]?_0x5e8adc[_0x49f2('0x31')]:_0xfdc1fa[_0x49f2('0x2c')];if(_0x3f6f87[_0x49f2('0x2e')][_0x49f2('0x40')]){_0x5e8adc[_0x49f2('0x47')]=[{'all':!![]}];}_0x5e8adc=_[_0x49f2('0x3d')]({},_0x5e8adc,_0x3f6f87[_0x49f2('0x3e')]);return db['Campaign'][_0x49f2('0x48')](_0x5e8adc)['then'](handleEntityNotFound(_0x5f2cb4,null))[_0x49f2('0x21')](respondWithResult(_0x5f2cb4,null))[_0x49f2('0x43')](handleError(_0x5f2cb4,null));};exports[_0x49f2('0x49')]=function(_0x2e7660,_0x4ef52b){return db['Campaign'][_0x49f2('0x49')](_0x2e7660[_0x49f2('0x4a')],{})['then'](function(_0x3e4bb2){var _0x26349a=_0x2e7660[_0x49f2('0x4b')][_0x49f2('0x22')]({'plain':!![]});if(!_0x26349a)throw new Error(_0x49f2('0x4c'));if(_0x26349a[_0x49f2('0x4d')]===_0x49f2('0x4b')){var _0xc9ad46=_0x3e4bb2[_0x49f2('0x22')]({'plain':!![]});var _0x5e5f17=_0x49f2('0x4e');return db[_0x49f2('0x4f')]['find']({'where':{'name':_0x5e5f17,'userProfileId':_0x26349a[_0x49f2('0x50')]},'raw':!![]})[_0x49f2('0x21')](function(_0x3d656a){if(_0x3d656a&&_0x3d656a['autoAssociation']===0x0){return db[_0x49f2('0x23')][_0x49f2('0x49')]({'name':_0xc9ad46[_0x49f2('0x27')],'resourceId':_0xc9ad46['id'],'type':_0x3d656a['name'],'sectionId':_0x3d656a['id']},{})[_0x49f2('0x21')](function(){return _0x3e4bb2;});}else{return _0x3e4bb2;}})[_0x49f2('0x43')](function(_0x3e0e56){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e0e56);throw _0x3e0e56;});}return _0x3e4bb2;})[_0x49f2('0x21')](respondWithResult(_0x4ef52b,0xc9))[_0x49f2('0x43')](handleError(_0x4ef52b,null));};exports[_0x49f2('0x51')]=function(_0x447099,_0x423807){var _0x19602c={'raw':![],'where':{'id':_0x447099[_0x49f2('0x45')]['id']}},_0x43c5c3={};_0x43c5c3[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db[_0x49f2('0x2a')][_0x49f2('0x2b')]);_0x19602c[_0x49f2('0x31')]=_[_0x49f2('0x46')](_0x43c5c3['model'],qs[_0x49f2('0x30')](_0x447099[_0x49f2('0x2e')][_0x49f2('0x30')]));_0x19602c[_0x49f2('0x31')]=_0x19602c['attributes'][_0x49f2('0x32')]?_0x19602c[_0x49f2('0x31')]:_0x43c5c3[_0x49f2('0x2c')];if(_0x447099[_0x49f2('0x2e')][_0x49f2('0x40')]){_0x19602c[_0x49f2('0x47')]=[{'all':!![]}];}_0x19602c=_[_0x49f2('0x3d')]({},_0x19602c,_0x447099[_0x49f2('0x3e')]);return db[_0x49f2('0x2a')][_0x49f2('0x48')](_0x19602c)[_0x49f2('0x21')](handleEntityNotFound(_0x423807,null))['then'](function(_0xcff724){if(_0xcff724){var _0x2d453c=_0xcff724['get']({'plain':!![]});_0x2d453c=qs[_0x49f2('0x52')](_0x2d453c,['id','createdAt','updatedAt']);_0x447099['body']=_[_0x49f2('0x52')](_0x447099[_0x49f2('0x4a')],['id',_0x49f2('0x53'),_0x49f2('0x54')]);return db[_0x49f2('0x2a')][_0x49f2('0x49')](_[_0x49f2('0x3d')](_0x2d453c,_0x447099[_0x49f2('0x4a')]),{'include':_0x447099[_0x49f2('0x2e')][_0x49f2('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x58d840){var _0x341aca=_0x447099[_0x49f2('0x4b')][_0x49f2('0x22')]({'plain':!![]});if(!_0x341aca)throw new Error(_0x49f2('0x4c'));if(_0x341aca['role']===_0x49f2('0x4b')){var _0x3a4c24=_0x58d840[_0x49f2('0x22')]({'plain':!![]});var _0x37304a=_0x49f2('0x4e');return db[_0x49f2('0x4f')]['find']({'where':{'name':_0x37304a,'userProfileId':_0x341aca[_0x49f2('0x50')]},'raw':!![]})['then'](function(_0xc8f80d){if(_0xc8f80d&&_0xc8f80d['autoAssociation']===0x0){return db[_0x49f2('0x23')][_0x49f2('0x49')]({'name':_0x3a4c24[_0x49f2('0x27')],'resourceId':_0x3a4c24['id'],'type':_0xc8f80d[_0x49f2('0x27')],'sectionId':_0xc8f80d['id']},{})[_0x49f2('0x21')](function(){return _0x58d840;});}else{return _0x58d840;}})['catch'](function(_0x383b3f){logger[_0x49f2('0x25')](_0x49f2('0x55'),_0x383b3f);throw _0x383b3f;});}return _0x58d840;});}})['then'](respondWithResult(_0x423807,0xc9))[_0x49f2('0x43')](handleError(_0x423807,null));};exports[_0x49f2('0x20')]=function(_0x47defc,_0x4f5520){if(_0x47defc[_0x49f2('0x4a')]['id']){delete _0x47defc['body']['id'];}return db[_0x49f2('0x2a')][_0x49f2('0x48')]({'where':{'id':_0x47defc['params']['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x4f5520,null))[_0x49f2('0x21')](saveUpdates(_0x47defc[_0x49f2('0x4a')],null))[_0x49f2('0x21')](respondWithResult(_0x4f5520,null))[_0x49f2('0x43')](handleError(_0x4f5520,null));};exports['destroy']=function(_0x13adb0,_0x5f00ad){return db['Campaign']['find']({'where':{'id':_0x13adb0[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x5f00ad,null))['then'](removeEntity(_0x5f00ad,null))[_0x49f2('0x43')](handleError(_0x5f00ad,null));};exports[_0x49f2('0x56')]=function(_0x269c3d,_0x4e076b,_0x4235ac){var _0x327ae3={'raw':!![],'where':{}};var _0x220043={};var _0x29c111={'count':0x0,'rows':[]};return db[_0x49f2('0x2a')][_0x49f2('0x57')]({'where':{'id':_0x269c3d[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x4e076b,null))[_0x49f2('0x21')](function(_0x1c2b84){if(_0x1c2b84){_0x220043[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db[_0x49f2('0x58')][_0x49f2('0x2b')]);_0x220043[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x269c3d[_0x49f2('0x2e')]);_0x220043[_0x49f2('0x2f')]=_[_0x49f2('0x46')](_0x220043[_0x49f2('0x2c')],_0x220043['query']);_0x327ae3[_0x49f2('0x31')]=_[_0x49f2('0x46')](_0x220043[_0x49f2('0x2c')],qs[_0x49f2('0x30')](_0x269c3d['query'][_0x49f2('0x30')]));_0x327ae3[_0x49f2('0x31')]=_0x327ae3[_0x49f2('0x31')]['length']?_0x327ae3[_0x49f2('0x31')]:_0x220043[_0x49f2('0x2c')];if(!_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x33')](_0x49f2('0x34'))){_0x327ae3[_0x49f2('0x1c')]=qs[_0x49f2('0x1c')](_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x1c')]);_0x327ae3[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x1b')]);}_0x327ae3['order']=qs['sort'](_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x327ae3[_0x49f2('0x37')]=qs[_0x49f2('0x2f')](_[_0x49f2('0x59')](_0x269c3d['query'],_0x220043[_0x49f2('0x2f')]));_0x327ae3[_0x49f2('0x37')][_0x49f2('0x5a')]=_0x1c2b84['id'];if(_0x269c3d['query'][_0x49f2('0x38')]){_0x327ae3[_0x49f2('0x37')]=_[_0x49f2('0x3d')](_0x327ae3[_0x49f2('0x37')],{'$or':_[_0x49f2('0x39')](_0x327ae3[_0x49f2('0x31')],function(_0x2f2311){var _0x326b1c={};_0x326b1c[_0x2f2311]={'$like':'%'+_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x326b1c;})});}_0x327ae3=_['merge']({},_0x327ae3,_0x269c3d[_0x49f2('0x3e')]);return db['CmHopper']['count']({'where':_0x327ae3['where']})[_0x49f2('0x21')](function(_0x31ec51){_0x29c111[_0x49f2('0x3f')]=_0x31ec51;if(_0x269c3d[_0x49f2('0x2e')][_0x49f2('0x40')]){_0x327ae3[_0x49f2('0x47')]=[{'all':!![]}];}return db[_0x49f2('0x58')]['findAll'](_0x327ae3);})[_0x49f2('0x21')](function(_0x50dfc1){_0x29c111[_0x49f2('0x42')]=_0x50dfc1;return _0x29c111;});}})[_0x49f2('0x21')](respondWithFilteredResult(_0x4e076b,_0x327ae3))[_0x49f2('0x43')](handleError(_0x4e076b,null));};exports[_0x49f2('0x5b')]=function(_0x4e1a9e,_0x5bccde,_0x4776a6){var _0x46b89d={'raw':!![],'where':{}};var _0x3e57e9={};var _0x1f12dd={'count':0x0,'rows':[]};return db[_0x49f2('0x2a')]['findOne']({'where':{'id':_0x4e1a9e[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x5bccde,null))[_0x49f2('0x21')](function(_0x5e36a6){if(_0x5e36a6){_0x3e57e9[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db['CmHopperHistory'][_0x49f2('0x2b')]);_0x3e57e9[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x4e1a9e[_0x49f2('0x2e')]);_0x3e57e9[_0x49f2('0x2f')]=_[_0x49f2('0x46')](_0x3e57e9[_0x49f2('0x2c')],_0x3e57e9['query']);_0x46b89d['attributes']=_[_0x49f2('0x46')](_0x3e57e9['model'],qs['fields'](_0x4e1a9e['query']['fields']));_0x46b89d[_0x49f2('0x31')]=_0x46b89d[_0x49f2('0x31')]['length']?_0x46b89d[_0x49f2('0x31')]:_0x3e57e9[_0x49f2('0x2c')];if(!_0x4e1a9e[_0x49f2('0x2e')][_0x49f2('0x33')](_0x49f2('0x34'))){_0x46b89d['limit']=qs['limit'](_0x4e1a9e[_0x49f2('0x2e')]['limit']);_0x46b89d[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x4e1a9e[_0x49f2('0x2e')][_0x49f2('0x1b')]);}_0x46b89d[_0x49f2('0x35')]=qs[_0x49f2('0x36')](_0x4e1a9e[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x46b89d['where']=qs[_0x49f2('0x2f')](_['pick'](_0x4e1a9e[_0x49f2('0x2e')],_0x3e57e9[_0x49f2('0x2f')]));_0x46b89d['where'][_0x49f2('0x5a')]=_0x5e36a6['id'];if(_0x4e1a9e[_0x49f2('0x2e')][_0x49f2('0x38')]){_0x46b89d['where']=_[_0x49f2('0x3d')](_0x46b89d['where'],{'$or':_[_0x49f2('0x39')](_0x46b89d[_0x49f2('0x31')],function(_0x13c15c){var _0x90fb64={};_0x90fb64[_0x13c15c]={'$like':'%'+_0x4e1a9e[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x90fb64;})});}_0x46b89d=_[_0x49f2('0x3d')]({},_0x46b89d,_0x4e1a9e[_0x49f2('0x3e')]);return db[_0x49f2('0x5c')][_0x49f2('0x3f')]({'where':_0x46b89d[_0x49f2('0x37')]})['then'](function(_0x33b341){_0x1f12dd[_0x49f2('0x3f')]=_0x33b341;if(_0x4e1a9e['query'][_0x49f2('0x40')]){_0x46b89d['include']=[{'all':!![]}];}return db[_0x49f2('0x5c')][_0x49f2('0x41')](_0x46b89d);})[_0x49f2('0x21')](function(_0x56c422){_0x1f12dd['rows']=_0x56c422;return _0x1f12dd;});}})[_0x49f2('0x21')](respondWithFilteredResult(_0x5bccde,_0x46b89d))['catch'](handleError(_0x5bccde,null));};exports['getHopperFinals']=function(_0x334ac4,_0x15ee7c,_0x129db5){var _0x40c825={'raw':!![],'where':{}};var _0x540e5c={};var _0x40cf48={'count':0x0,'rows':[]};return db[_0x49f2('0x2a')][_0x49f2('0x57')]({'where':{'id':_0x334ac4['params']['id']}})['then'](handleEntityNotFound(_0x15ee7c,null))['then'](function(_0x155424){if(_0x155424){_0x540e5c[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db[_0x49f2('0x5d')][_0x49f2('0x2b')]);_0x540e5c[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x334ac4[_0x49f2('0x2e')]);_0x540e5c[_0x49f2('0x2f')]=_[_0x49f2('0x46')](_0x540e5c[_0x49f2('0x2c')],_0x540e5c[_0x49f2('0x2e')]);_0x40c825[_0x49f2('0x31')]=_['intersection'](_0x540e5c[_0x49f2('0x2c')],qs['fields'](_0x334ac4['query']['fields']));_0x40c825['attributes']=_0x40c825[_0x49f2('0x31')][_0x49f2('0x32')]?_0x40c825[_0x49f2('0x31')]:_0x540e5c[_0x49f2('0x2c')];if(!_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x33')]('nolimit')){_0x40c825[_0x49f2('0x1c')]=qs['limit'](_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x1c')]);_0x40c825[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x1b')]);}_0x40c825[_0x49f2('0x35')]=qs[_0x49f2('0x36')](_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x40c825['where']=qs[_0x49f2('0x2f')](_[_0x49f2('0x59')](_0x334ac4[_0x49f2('0x2e')],_0x540e5c['filters']));_0x40c825[_0x49f2('0x37')][_0x49f2('0x5a')]=_0x155424['id'];if(_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x38')]){_0x40c825['where']=_[_0x49f2('0x3d')](_0x40c825[_0x49f2('0x37')],{'$or':_[_0x49f2('0x39')](_0x40c825[_0x49f2('0x31')],function(_0x10adde){var _0x15a304={};_0x15a304[_0x10adde]={'$like':'%'+_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x15a304;})});}_0x40c825=_[_0x49f2('0x3d')]({},_0x40c825,_0x334ac4['options']);return db[_0x49f2('0x5d')][_0x49f2('0x3f')]({'where':_0x40c825['where']})[_0x49f2('0x21')](function(_0x27625a){_0x40cf48['count']=_0x27625a;if(_0x334ac4[_0x49f2('0x2e')][_0x49f2('0x40')]){_0x40c825['include']=[{'all':!![]}];}return db[_0x49f2('0x5d')][_0x49f2('0x41')](_0x40c825);})['then'](function(_0x43848a){_0x40cf48[_0x49f2('0x42')]=_0x43848a;return _0x40cf48;});}})['then'](respondWithFilteredResult(_0x15ee7c,_0x40c825))[_0x49f2('0x43')](handleError(_0x15ee7c,null));};exports[_0x49f2('0x5e')]=function(_0x3bfdd9,_0x412946,_0x4fadd0){var _0x5a22fe={'raw':!![],'where':{}};var _0x372053={};var _0x17940d={'count':0x0,'rows':[]};return db['Campaign'][_0x49f2('0x57')]({'where':{'id':_0x3bfdd9[_0x49f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x412946,null))[_0x49f2('0x21')](function(_0x3af587){if(_0x3af587){_0x372053[_0x49f2('0x2c')]=_[_0x49f2('0x2d')](db[_0x49f2('0x5f')][_0x49f2('0x2b')]);_0x372053[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x3bfdd9[_0x49f2('0x2e')]);_0x372053['filters']=_[_0x49f2('0x46')](_0x372053[_0x49f2('0x2c')],_0x372053[_0x49f2('0x2e')]);_0x5a22fe[_0x49f2('0x31')]=_[_0x49f2('0x46')](_0x372053[_0x49f2('0x2c')],qs[_0x49f2('0x30')](_0x3bfdd9['query'][_0x49f2('0x30')]));_0x5a22fe[_0x49f2('0x31')]=_0x5a22fe[_0x49f2('0x31')][_0x49f2('0x32')]?_0x5a22fe['attributes']:_0x372053['model'];if(!_0x3bfdd9['query']['hasOwnProperty'](_0x49f2('0x34'))){_0x5a22fe[_0x49f2('0x1c')]=qs[_0x49f2('0x1c')](_0x3bfdd9[_0x49f2('0x2e')]['limit']);_0x5a22fe[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x3bfdd9[_0x49f2('0x2e')]['offset']);}_0x5a22fe[_0x49f2('0x35')]=qs[_0x49f2('0x36')](_0x3bfdd9[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x5a22fe['where']=qs[_0x49f2('0x2f')](_[_0x49f2('0x59')](_0x3bfdd9[_0x49f2('0x2e')],_0x372053[_0x49f2('0x2f')]));_0x5a22fe[_0x49f2('0x37')][_0x49f2('0x5a')]=_0x3af587['id'];if(_0x3bfdd9[_0x49f2('0x2e')][_0x49f2('0x38')]){_0x5a22fe[_0x49f2('0x37')]=_[_0x49f2('0x3d')](_0x5a22fe[_0x49f2('0x37')],{'$or':_[_0x49f2('0x39')](_0x5a22fe[_0x49f2('0x31')],function(_0x2e6b5a){var _0x52cbb8={};_0x52cbb8[_0x2e6b5a]={'$like':'%'+_0x3bfdd9[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x52cbb8;})});}_0x5a22fe=_[_0x49f2('0x3d')]({},_0x5a22fe,_0x3bfdd9['options']);return db[_0x49f2('0x5f')][_0x49f2('0x3f')]({'where':_0x5a22fe[_0x49f2('0x37')]})[_0x49f2('0x21')](function(_0x4261fe){_0x17940d['count']=_0x4261fe;if(_0x3bfdd9['query']['includeAll']){_0x5a22fe[_0x49f2('0x47')]=[{'all':!![]}];}return db[_0x49f2('0x5f')][_0x49f2('0x41')](_0x5a22fe);})[_0x49f2('0x21')](function(_0x13f8c9){_0x17940d[_0x49f2('0x42')]=_0x13f8c9;return _0x17940d;});}})['then'](respondWithFilteredResult(_0x412946,_0x5a22fe))[_0x49f2('0x43')](handleError(_0x412946,null));};exports[_0x49f2('0x60')]=function(_0x5c8fd4,_0x1dec39,_0x1c581f){var _0x151b71={};var _0x4d2dde={};var _0x4e4907;var _0x3822ff;return db[_0x49f2('0x2a')][_0x49f2('0x57')]({'where':{'id':_0x5c8fd4[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x1dec39,null))[_0x49f2('0x21')](function(_0x3bb5f8){if(_0x3bb5f8){_0x4e4907=_0x3bb5f8;_0x4d2dde['model']=_[_0x49f2('0x2d')](db[_0x49f2('0x61')][_0x49f2('0x2b')]);_0x4d2dde[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x5c8fd4[_0x49f2('0x2e')]);_0x4d2dde[_0x49f2('0x2f')]=_[_0x49f2('0x46')](_0x4d2dde[_0x49f2('0x2c')],_0x4d2dde['query']);_0x151b71[_0x49f2('0x31')]=_[_0x49f2('0x46')](_0x4d2dde['model'],qs[_0x49f2('0x30')](_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x30')]));_0x151b71[_0x49f2('0x31')]=_0x151b71['attributes'][_0x49f2('0x32')]?_0x151b71[_0x49f2('0x31')]:_0x4d2dde[_0x49f2('0x2c')];_0x151b71['order']=qs[_0x49f2('0x36')](_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x151b71[_0x49f2('0x37')]=qs[_0x49f2('0x2f')](_[_0x49f2('0x59')](_0x5c8fd4[_0x49f2('0x2e')],_0x4d2dde['filters']));if(_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x38')]){_0x151b71[_0x49f2('0x37')]=_['merge'](_0x151b71[_0x49f2('0x37')],{'$or':_['map'](_0x151b71['attributes'],function(_0x4a7c0d){var _0x41bc5b={};_0x41bc5b[_0x4a7c0d]={'$like':'%'+_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0x41bc5b;})});}_0x151b71=_[_0x49f2('0x3d')]({},_0x151b71,_0x5c8fd4['options']);return _0x4e4907['getLists'](_0x151b71);}})[_0x49f2('0x21')](function(_0x529105){if(_0x529105){_0x3822ff=_0x529105[_0x49f2('0x32')];if(!_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x33')](_0x49f2('0x34'))){_0x151b71['limit']=qs[_0x49f2('0x1c')](_0x5c8fd4['query']['limit']);_0x151b71[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x5c8fd4[_0x49f2('0x2e')][_0x49f2('0x1b')]);}return _0x4e4907[_0x49f2('0x60')](_0x151b71);}})['then'](function(_0x54615a){if(_0x54615a){return _0x54615a?{'count':_0x3822ff,'rows':_0x54615a}:null;}})[_0x49f2('0x21')](respondWithResult(_0x1dec39,null))['catch'](handleError(_0x1dec39,null));};exports['addLists']=function(_0x1f3d75,_0xf2f1d8,_0x54f2ee){var _0x923020,_0x13cc1c;return db[_0x49f2('0x2a')]['find']({'where':{'id':_0x1f3d75['params']['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0xf2f1d8,null))['then'](function(_0x5c6230){if(_0x5c6230){_0x13cc1c=_0x5c6230;return _0x5c6230[_0x49f2('0x62')](_0x1f3d75[_0x49f2('0x4a')][_0x49f2('0x63')],_[_0x49f2('0x52')](_0x1f3d75[_0x49f2('0x4a')],[_0x49f2('0x63'),'id'])||{});}return null;})['spread'](function(_0x599723){var _0x20c6be;_0x923020=_0x599723||[];var _0x1ad817=[];if(_0x599723){for(var _0x170233=0x0;_0x170233<_0x599723[_0x49f2('0x32')];_0x170233+=0x1){var _0x20e78f=_0x599723[_0x170233][_0x49f2('0x22')]({'plain':!![]});_0x13cc1c[_0x49f2('0x64')]=_0x1f3d75['body']['dialCheckDuplicateType']?_0x1f3d75[_0x49f2('0x4a')][_0x49f2('0x64')]:_0x13cc1c[_0x49f2('0x64')];switch(_0x13cc1c[_0x49f2('0x64')]){case _0x49f2('0x65'):_0x20c6be=squel['insert']()[_0x49f2('0x66')]('cm_hopper')[_0x49f2('0x67')]([_0x49f2('0x68'),_0x49f2('0x69'),_0x49f2('0x6a'),_0x49f2('0x6b'),'CampaignId',_0x49f2('0x53'),'updatedAt'],squel[_0x49f2('0x6c')]()[_0x49f2('0x3c')](_0x49f2('0x68'),'phone')['field'](_0x49f2('0x6d'),'scheduledAt')[_0x49f2('0x3c')]('id','ContactId')['field'](_0x20e78f[_0x49f2('0x6e')][_0x49f2('0x6f')](),_0x49f2('0x6b'))[_0x49f2('0x3c')](_0x1f3d75[_0x49f2('0x45')]['id'][_0x49f2('0x6f')](),_0x49f2('0x5a'))['field'](_0x49f2('0x6d'),_0x49f2('0x53'))['field']('NOW()',_0x49f2('0x54'))[_0x49f2('0x70')](_0x49f2('0x71'))[_0x49f2('0x37')](_0x49f2('0x72'))['where'](_0x49f2('0x73'),_0x20e78f[_0x49f2('0x6e')][_0x49f2('0x6f')]())[_0x49f2('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0x49f2('0x37')](_0x49f2('0x74'),squel['select']()[_0x49f2('0x3c')](_0x49f2('0x75'))[_0x49f2('0x70')]('cm_hopper_final')[_0x49f2('0x37')]('CampaignId\x20=\x20?',_0x1f3d75[_0x49f2('0x45')]['id'][_0x49f2('0x6f')]()))['where'](_0x49f2('0x74'),squel[_0x49f2('0x6c')]()[_0x49f2('0x3c')](_0x49f2('0x76'))[_0x49f2('0x70')]('cm_hopper')[_0x49f2('0x37')](_0x49f2('0x77'),_0x1f3d75[_0x49f2('0x45')]['id'][_0x49f2('0x6f')]())))[_0x49f2('0x6f')]();break;case _0x49f2('0x78'):_0x20c6be=squel[_0x49f2('0x79')]()[_0x49f2('0x66')](_0x49f2('0x7a'))[_0x49f2('0x67')]([_0x49f2('0x68'),_0x49f2('0x69'),'ContactId','ListId',_0x49f2('0x5a'),_0x49f2('0x53'),'updatedAt'],squel['select']()[_0x49f2('0x3c')](_0x49f2('0x68'),'phone')[_0x49f2('0x3c')](_0x49f2('0x6d'),_0x49f2('0x69'))[_0x49f2('0x3c')]('id',_0x49f2('0x6a'))[_0x49f2('0x3c')](_0x20e78f[_0x49f2('0x6e')][_0x49f2('0x6f')](),_0x49f2('0x6b'))[_0x49f2('0x3c')](_0x1f3d75['params']['id']['toString'](),_0x49f2('0x5a'))[_0x49f2('0x3c')]('NOW()',_0x49f2('0x53'))[_0x49f2('0x3c')](_0x49f2('0x6d'),'updatedAt')[_0x49f2('0x70')]('cm_contacts')[_0x49f2('0x37')](_0x49f2('0x72'))[_0x49f2('0x37')](_0x49f2('0x73'),_0x20e78f['CmListId'][_0x49f2('0x6f')]())['where'](_0x49f2('0x7b'))[_0x49f2('0x37')](_0x49f2('0x74'),squel[_0x49f2('0x6c')]()[_0x49f2('0x3c')]('COALESCE(phone,\x27\x27)')[_0x49f2('0x70')]('cm_hopper')[_0x49f2('0x37')](_0x49f2('0x77'),_0x1f3d75['params']['id']['toString']())))[_0x49f2('0x6f')]();break;default:_0x20c6be=squel[_0x49f2('0x79')]()[_0x49f2('0x66')]('cm_hopper')[_0x49f2('0x67')](['phone',_0x49f2('0x69'),_0x49f2('0x6a'),'ListId',_0x49f2('0x5a'),_0x49f2('0x53'),_0x49f2('0x54')],squel[_0x49f2('0x6c')]()[_0x49f2('0x3c')](_0x49f2('0x68'),_0x49f2('0x68'))[_0x49f2('0x3c')](_0x49f2('0x6d'),_0x49f2('0x69'))[_0x49f2('0x3c')]('id',_0x49f2('0x6a'))[_0x49f2('0x3c')](_0x20e78f[_0x49f2('0x6e')][_0x49f2('0x6f')](),_0x49f2('0x6b'))[_0x49f2('0x3c')](_0x1f3d75['params']['id'][_0x49f2('0x6f')](),_0x49f2('0x5a'))[_0x49f2('0x3c')]('NOW()',_0x49f2('0x53'))[_0x49f2('0x3c')](_0x49f2('0x6d'),_0x49f2('0x54'))[_0x49f2('0x70')]('cm_contacts')[_0x49f2('0x37')]('deletedAt\x20IS\x20NULL')[_0x49f2('0x37')](_0x49f2('0x73'),_0x20e78f[_0x49f2('0x6e')][_0x49f2('0x6f')]())[_0x49f2('0x37')](_0x49f2('0x7b')))[_0x49f2('0x6f')]();}_0x1ad817[_0x49f2('0x7c')](db['sequelize'][_0x49f2('0x2e')](_0x20c6be));}return BPromise[_0x49f2('0x7d')](_0x1ad817);}})['then'](function(){return _0x923020;})['then'](respondWithResult(_0xf2f1d8,null))[_0x49f2('0x43')](handleError(_0xf2f1d8,null));};exports[_0x49f2('0x7e')]=function(_0x26bbd3,_0x32e42d,_0x344047){return db['Campaign'][_0x49f2('0x48')]({'where':{'id':_0x26bbd3[_0x49f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x32e42d,null))[_0x49f2('0x21')](function(_0x276372){if(_0x276372){return _0x276372[_0x49f2('0x7e')](_0x26bbd3[_0x49f2('0x2e')][_0x49f2('0x63')]);}})[_0x49f2('0x21')](function(_0x3f3eb6){if(_0x3f3eb6){return db[_0x49f2('0x58')]['destroy']({'where':{'ListId':_0x26bbd3[_0x49f2('0x2e')]['ids'],'CampaignId':_0x26bbd3[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](function(){return _0x3f3eb6;});}})['then'](respondWithStatusCode(_0x32e42d,null))['catch'](handleError(_0x32e42d,null));};exports[_0x49f2('0x7f')]=function(_0x15854d,_0x475676,_0x3cfd7c){var _0x3adb86={'raw':!![],'where':{}};var _0x344c80={};var _0x30bf2c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x15854d[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x475676,null))[_0x49f2('0x21')](function(_0x3f2ea2){if(_0x3f2ea2){_0x344c80['model']=_[_0x49f2('0x2d')](db[_0x49f2('0x61')]['rawAttributes']);_0x344c80[_0x49f2('0x2e')]=_[_0x49f2('0x2d')](_0x15854d[_0x49f2('0x2e')]);_0x344c80['filters']=_[_0x49f2('0x46')](_0x344c80[_0x49f2('0x2c')],_0x344c80['query']);_0x3adb86[_0x49f2('0x31')]=_[_0x49f2('0x46')](_0x344c80['model'],qs[_0x49f2('0x30')](_0x15854d[_0x49f2('0x2e')][_0x49f2('0x30')]));_0x3adb86[_0x49f2('0x31')]=_0x3adb86['attributes'][_0x49f2('0x32')]?_0x3adb86[_0x49f2('0x31')]:_0x344c80['model'];if(!_0x15854d[_0x49f2('0x2e')][_0x49f2('0x33')](_0x49f2('0x34'))){_0x3adb86['limit']=qs[_0x49f2('0x1c')](_0x15854d[_0x49f2('0x2e')][_0x49f2('0x1c')]);_0x3adb86[_0x49f2('0x1b')]=qs[_0x49f2('0x1b')](_0x15854d[_0x49f2('0x2e')]['offset']);}_0x3adb86['order']=qs[_0x49f2('0x36')](_0x15854d[_0x49f2('0x2e')][_0x49f2('0x36')]);_0x3adb86[_0x49f2('0x37')]=qs['filters'](_[_0x49f2('0x59')](_0x15854d['query'],_0x344c80['filters']));_0x3adb86[_0x49f2('0x37')][_0x49f2('0x5a')]=_0x3f2ea2['id'];if(_0x15854d['query']['filter']){_0x3adb86[_0x49f2('0x37')]=_['merge'](_0x3adb86[_0x49f2('0x37')],{'$or':_['map'](_0x3adb86[_0x49f2('0x31')],function(_0x3d4a92){var _0xee4455={};_0xee4455[_0x3d4a92]={'$like':'%'+_0x15854d[_0x49f2('0x2e')][_0x49f2('0x38')]+'%'};return _0xee4455;})});}_0x3adb86=_['merge']({},_0x3adb86,_0x15854d[_0x49f2('0x3e')]);return db[_0x49f2('0x61')]['count']({'where':_0x3adb86[_0x49f2('0x37')]})[_0x49f2('0x21')](function(_0x4afc89){_0x30bf2c[_0x49f2('0x3f')]=_0x4afc89;if(_0x15854d[_0x49f2('0x2e')][_0x49f2('0x40')]){_0x3adb86['include']=[{'all':!![]}];}return db[_0x49f2('0x61')][_0x49f2('0x41')](_0x3adb86);})[_0x49f2('0x21')](function(_0x23e012){_0x30bf2c[_0x49f2('0x42')]=_0x23e012;return _0x30bf2c;});}})[_0x49f2('0x21')](respondWithFilteredResult(_0x475676,_0x3adb86))[_0x49f2('0x43')](handleError(_0x475676,null));};exports[_0x49f2('0x80')]=function(_0x13218d,_0x377314,_0x2769b1){var _0x90944d,_0x17bc0b;return db[_0x49f2('0x2a')][_0x49f2('0x48')]({'where':{'id':_0x13218d['params']['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x377314,null))['then'](function(_0x39e572){if(_0x39e572){_0x17bc0b=_0x39e572;return _0x39e572['addBlackLists'](_0x13218d[_0x49f2('0x4a')][_0x49f2('0x63')],_[_0x49f2('0x52')](_0x13218d[_0x49f2('0x4a')],['ids','id'])||{});}return null;})[_0x49f2('0x81')](function(_0x35124a){var _0x517f81;_0x90944d=_0x35124a||[];var _0x134d3e=[];if(_0x35124a){for(var _0x5aa521=0x0;_0x5aa521<_0x35124a[_0x49f2('0x32')];_0x5aa521+=0x1){var _0x49d9c4=_0x35124a[_0x5aa521][_0x49f2('0x22')]({'plain':!![]});_0x517f81=squel[_0x49f2('0x79')]()[_0x49f2('0x66')]('cm_hopper_black')[_0x49f2('0x67')]([_0x49f2('0x68'),'ContactId','ListId','CampaignId',_0x49f2('0x53'),_0x49f2('0x54')],squel[_0x49f2('0x6c')]()[_0x49f2('0x3c')]('phone',_0x49f2('0x68'))[_0x49f2('0x3c')]('id','ContactId')[_0x49f2('0x3c')](_0x49d9c4[_0x49f2('0x6e')][_0x49f2('0x6f')](),'ListId')[_0x49f2('0x3c')](_0x13218d['params']['id'][_0x49f2('0x6f')](),_0x49f2('0x5a'))['field'](_0x49f2('0x6d'),_0x49f2('0x53'))[_0x49f2('0x3c')](_0x49f2('0x6d'),_0x49f2('0x54'))[_0x49f2('0x70')](_0x49f2('0x71'))[_0x49f2('0x37')](_0x49f2('0x72'))['where'](_0x49f2('0x73'),_0x49d9c4['CmListId'][_0x49f2('0x6f')]())[_0x49f2('0x37')](_0x49f2('0x7b')))[_0x49f2('0x6f')]();_0x134d3e[_0x49f2('0x7c')](db[_0x49f2('0x82')]['query'](_0x517f81));}return BPromise['all'](_0x134d3e);}})[_0x49f2('0x21')](function(){return _0x90944d;})[_0x49f2('0x21')](respondWithResult(_0x377314,null))['catch'](handleError(_0x377314,null));};exports[_0x49f2('0x83')]=function(_0x4c6620,_0x4de9e1,_0x3af19a){return db['Campaign']['find']({'where':{'id':_0x4c6620[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](handleEntityNotFound(_0x4de9e1,null))['then'](function(_0x1ccd89){if(_0x1ccd89){return _0x1ccd89[_0x49f2('0x83')](_0x4c6620[_0x49f2('0x2e')][_0x49f2('0x63')]);}})[_0x49f2('0x21')](function(_0xaa1649){if(_0xaa1649){return db[_0x49f2('0x5f')]['destroy']({'where':{'ListId':_0x4c6620[_0x49f2('0x2e')][_0x49f2('0x63')],'CampaignId':_0x4c6620[_0x49f2('0x45')]['id']}})[_0x49f2('0x21')](function(){return _0xaa1649;});}})[_0x49f2('0x21')](respondWithStatusCode(_0x4de9e1,null))[_0x49f2('0x43')](handleError(_0x4de9e1,null));}; \ No newline at end of file +var _0x1002=['updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','hasOwnProperty','sort','CampaignId','map','CmHopper','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','phone','NOW()','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_contacts','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','keys','query','intersection','model','attributes','fields','length','order','where','filters','pick','filter','key','VIRTUAL','field','merge','options','count','includeAll','include','rows','catch','show','params','find','create','user','role','IvrCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x1002,0xb9));var _0x2100=function(_0x37ccf7,_0x4bf7f6){_0x37ccf7=_0x37ccf7-0x0;var _0x2f547=_0x1002[_0x37ccf7];return _0x2f547;};'use strict';var pdf=require(_0x2100('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2100('0x1'));var jsonpatch=require(_0x2100('0x2'));var rp=require(_0x2100('0x3'));var moment=require('moment');var BPromise=require(_0x2100('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2100('0x5'));var sox=require(_0x2100('0x6'));var csv=require(_0x2100('0x7'));var ejs=require(_0x2100('0x8'));var fs=require('fs');var _=require(_0x2100('0x9'));var squel=require('squel');var crypto=require(_0x2100('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2100('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2100('0xc'));var Papa=require(_0x2100('0xd'));var Redis=require(_0x2100('0xe'));var authService=require(_0x2100('0xf'));var qs=require(_0x2100('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2100('0x11'))(_0x2100('0x12'));var utils=require('../../config/utils');var config=require(_0x2100('0x13'));var db=require(_0x2100('0x14'))['db'];function respondWithStatusCode(_0x1db910,_0x253ad6){_0x253ad6=_0x253ad6||0xcc;return function(_0x57ef56){if(_0x57ef56){return _0x1db910[_0x2100('0x15')](_0x253ad6);}return _0x1db910['status'](_0x253ad6)[_0x2100('0x16')]();};}function respondWithResult(_0x9e9ba2,_0x2c3e7c){_0x2c3e7c=_0x2c3e7c||0xc8;return function(_0x2ece34){if(_0x2ece34){return _0x9e9ba2[_0x2100('0x17')](_0x2c3e7c)[_0x2100('0x18')](_0x2ece34);}};}function respondWithFilteredResult(_0x10f196,_0x12682e){return function(_0x423fdd){if(_0x423fdd){var _0x26e649=_0x423fdd['count'],_0x4aec12=_0x12682e[_0x2100('0x19')],_0x5d4140=_0x12682e[_0x2100('0x19')]+_0x12682e[_0x2100('0x1a')],_0x5496ff;if(_0x5d4140>=_0x26e649){_0x5d4140=_0x26e649;_0x5496ff=0xc8;}else{_0x5496ff=0xce;}_0x10f196['status'](_0x5496ff);return _0x10f196['set']('Content-Range',_0x4aec12+'-'+_0x5d4140+'/'+_0x26e649)[_0x2100('0x18')](_0x423fdd);}return null;};}function patchUpdates(_0x3e3830){return function(_0x41c128){try{jsonpatch[_0x2100('0x1b')](_0x41c128,_0x3e3830,!![]);}catch(_0x44d97a){return BPromise['reject'](_0x44d97a);}return _0x41c128[_0x2100('0x1c')]();};}function saveUpdates(_0x5b6c13,_0x577904){return function(_0x1d2e73){if(_0x1d2e73){return _0x1d2e73[_0x2100('0x1d')](_0x5b6c13)[_0x2100('0x1e')](function(_0x56fb30){return _0x56fb30;});}return null;};}function removeEntity(_0x4cd43b,_0xefe273){return function(_0x25ec7d){if(_0x25ec7d){return _0x25ec7d[_0x2100('0x1f')]()[_0x2100('0x1e')](function(){var _0xb2f1b1=_0x25ec7d[_0x2100('0x20')]({'plain':!![]});var _0x39f2eb='IvrCampaigns';return db[_0x2100('0x21')]['destroy']({'where':{'type':_0x39f2eb,'resourceId':_0xb2f1b1['id']}})['then'](function(){return _0x25ec7d;});})[_0x2100('0x1e')](function(){_0x4cd43b[_0x2100('0x17')](0xcc)[_0x2100('0x16')]();});}};}function handleEntityNotFound(_0x5a8eb8,_0x357e07){return function(_0x5c51af){if(!_0x5c51af){_0x5a8eb8[_0x2100('0x15')](0x194);}return _0x5c51af;};}function handleError(_0x20ac57,_0x47b2c8){_0x47b2c8=_0x47b2c8||0x1f4;return function(_0x5113a0){logger[_0x2100('0x22')](_0x5113a0[_0x2100('0x23')]);if(_0x5113a0['name']){delete _0x5113a0[_0x2100('0x24')];}_0x20ac57[_0x2100('0x17')](_0x47b2c8)[_0x2100('0x25')](_0x5113a0);};}exports[_0x2100('0x26')]=function(_0x1b2e57,_0x4fcc1e){var _0xc938ee={},_0x1eff62={},_0x3303f9={'count':0x0,'rows':[]};var _0x55a8e4=db[_0x2100('0x27')][_0x2100('0x28')];_0x1eff62['model']=_[_0x2100('0x29')](_0x55a8e4);_0x1eff62[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x1b2e57[_0x2100('0x2a')]);_0x1eff62['filters']=_[_0x2100('0x2b')](_0x1eff62[_0x2100('0x2c')],_0x1eff62[_0x2100('0x2a')]);_0xc938ee[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x1eff62[_0x2100('0x2c')],qs[_0x2100('0x2e')](_0x1b2e57[_0x2100('0x2a')]['fields']));_0xc938ee['attributes']=_0xc938ee[_0x2100('0x2d')][_0x2100('0x2f')]?_0xc938ee['attributes']:_0x1eff62[_0x2100('0x2c')];if(!_0x1b2e57[_0x2100('0x2a')]['hasOwnProperty']('nolimit')){_0xc938ee[_0x2100('0x1a')]=qs[_0x2100('0x1a')](_0x1b2e57[_0x2100('0x2a')][_0x2100('0x1a')]);_0xc938ee['offset']=qs['offset'](_0x1b2e57[_0x2100('0x2a')][_0x2100('0x19')]);}_0xc938ee[_0x2100('0x30')]=qs['sort'](_0x1b2e57[_0x2100('0x2a')]['sort']);_0xc938ee[_0x2100('0x31')]=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x1b2e57[_0x2100('0x2a')],_0x1eff62[_0x2100('0x32')]));if(_0x1b2e57['query'][_0x2100('0x34')]){_0xc938ee['where']=_['merge'](_0xc938ee[_0x2100('0x31')],{'$or':_['map'](_0x55a8e4,function(_0x5e844e){if(_0x5e844e['type'][_0x2100('0x35')]!==_0x2100('0x36')){var _0x1bee86={};_0x1bee86[_0x5e844e[_0x2100('0x37')]]={'$like':'%'+_0x1b2e57[_0x2100('0x2a')][_0x2100('0x34')]+'%'};return _0x1bee86;}})});}_0xc938ee=_[_0x2100('0x38')]({},_0xc938ee,_0x1b2e57[_0x2100('0x39')]);var _0xb8ff2a={'where':_0xc938ee[_0x2100('0x31')]};return db['Campaign'][_0x2100('0x3a')](_0xb8ff2a)['then'](function(_0x169dc8){_0x3303f9[_0x2100('0x3a')]=_0x169dc8;if(_0x1b2e57['query'][_0x2100('0x3b')]){_0xc938ee[_0x2100('0x3c')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0xc938ee);})['then'](function(_0x1b6412){_0x3303f9[_0x2100('0x3d')]=_0x1b6412;return _0x3303f9;})[_0x2100('0x1e')](respondWithFilteredResult(_0x4fcc1e,_0xc938ee))[_0x2100('0x3e')](handleError(_0x4fcc1e,null));};exports[_0x2100('0x3f')]=function(_0x27de88,_0x93676a){var _0x467839={'raw':![],'where':{'id':_0x27de88[_0x2100('0x40')]['id']}},_0x36d785={};_0x36d785[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x27')][_0x2100('0x28')]);_0x36d785[_0x2100('0x2a')]=_['keys'](_0x27de88[_0x2100('0x2a')]);_0x36d785[_0x2100('0x32')]=_[_0x2100('0x2b')](_0x36d785[_0x2100('0x2c')],_0x36d785[_0x2100('0x2a')]);_0x467839[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x36d785[_0x2100('0x2c')],qs['fields'](_0x27de88[_0x2100('0x2a')][_0x2100('0x2e')]));_0x467839[_0x2100('0x2d')]=_0x467839[_0x2100('0x2d')][_0x2100('0x2f')]?_0x467839[_0x2100('0x2d')]:_0x36d785['model'];if(_0x27de88[_0x2100('0x2a')][_0x2100('0x3b')]){_0x467839[_0x2100('0x3c')]=[{'all':!![]}];}_0x467839=_[_0x2100('0x38')]({},_0x467839,_0x27de88[_0x2100('0x39')]);return db['Campaign'][_0x2100('0x41')](_0x467839)[_0x2100('0x1e')](handleEntityNotFound(_0x93676a,null))['then'](respondWithResult(_0x93676a,null))[_0x2100('0x3e')](handleError(_0x93676a,null));};exports[_0x2100('0x42')]=function(_0x537fb0,_0x216f06){return db['Campaign'][_0x2100('0x42')](_0x537fb0['body'],{})[_0x2100('0x1e')](function(_0x40dbb4){var _0x2479db=_0x537fb0[_0x2100('0x43')][_0x2100('0x20')]({'plain':!![]});if(!_0x2479db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2479db[_0x2100('0x44')]===_0x2100('0x43')){var _0x2ef861=_0x40dbb4['get']({'plain':!![]});var _0x3e21de=_0x2100('0x45');return db[_0x2100('0x46')][_0x2100('0x41')]({'where':{'name':_0x3e21de,'userProfileId':_0x2479db['userProfileId']},'raw':!![]})[_0x2100('0x1e')](function(_0x108150){if(_0x108150&&_0x108150[_0x2100('0x47')]===0x0){return db[_0x2100('0x21')][_0x2100('0x42')]({'name':_0x2ef861[_0x2100('0x24')],'resourceId':_0x2ef861['id'],'type':_0x108150['name'],'sectionId':_0x108150['id']},{})[_0x2100('0x1e')](function(){return _0x40dbb4;});}else{return _0x40dbb4;}})['catch'](function(_0x18ed77){logger[_0x2100('0x22')](_0x2100('0x48'),_0x18ed77);throw _0x18ed77;});}return _0x40dbb4;})[_0x2100('0x1e')](respondWithResult(_0x216f06,0xc9))[_0x2100('0x3e')](handleError(_0x216f06,null));};exports[_0x2100('0x49')]=function(_0x9e7a,_0x17e806){var _0x3215ba={'raw':![],'where':{'id':_0x9e7a['params']['id']}},_0x22bda2={};_0x22bda2[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x27')]['rawAttributes']);_0x3215ba['attributes']=_[_0x2100('0x2b')](_0x22bda2[_0x2100('0x2c')],qs[_0x2100('0x2e')](_0x9e7a[_0x2100('0x2a')][_0x2100('0x2e')]));_0x3215ba[_0x2100('0x2d')]=_0x3215ba[_0x2100('0x2d')][_0x2100('0x2f')]?_0x3215ba[_0x2100('0x2d')]:_0x22bda2[_0x2100('0x2c')];if(_0x9e7a['query'][_0x2100('0x3b')]){_0x3215ba[_0x2100('0x3c')]=[{'all':!![]}];}_0x3215ba=_[_0x2100('0x38')]({},_0x3215ba,_0x9e7a[_0x2100('0x39')]);return db[_0x2100('0x27')][_0x2100('0x41')](_0x3215ba)['then'](handleEntityNotFound(_0x17e806,null))[_0x2100('0x1e')](function(_0xb0d290){if(_0xb0d290){var _0x5a738f=_0xb0d290[_0x2100('0x20')]({'plain':!![]});_0x5a738f=qs[_0x2100('0x4a')](_0x5a738f,['id',_0x2100('0x4b'),'updatedAt']);_0x9e7a['body']=_[_0x2100('0x4a')](_0x9e7a[_0x2100('0x4c')],['id','createdAt',_0x2100('0x4d')]);return db[_0x2100('0x27')]['create'](_[_0x2100('0x38')](_0x5a738f,_0x9e7a['body']),{'include':_0x9e7a[_0x2100('0x2a')][_0x2100('0x3b')]?[{'all':!![]}]:undefined})['then'](function(_0x5d15dd){var _0x48be63=_0x9e7a[_0x2100('0x43')]['get']({'plain':!![]});if(!_0x48be63)throw new Error(_0x2100('0x4e'));if(_0x48be63['role']===_0x2100('0x43')){var _0x44de02=_0x5d15dd[_0x2100('0x20')]({'plain':!![]});var _0x5ef306=_0x2100('0x45');return db[_0x2100('0x46')][_0x2100('0x41')]({'where':{'name':_0x5ef306,'userProfileId':_0x48be63['userProfileId']},'raw':!![]})[_0x2100('0x1e')](function(_0x5cee3b){if(_0x5cee3b&&_0x5cee3b[_0x2100('0x47')]===0x0){return db[_0x2100('0x21')][_0x2100('0x42')]({'name':_0x44de02[_0x2100('0x24')],'resourceId':_0x44de02['id'],'type':_0x5cee3b['name'],'sectionId':_0x5cee3b['id']},{})['then'](function(){return _0x5d15dd;});}else{return _0x5d15dd;}})[_0x2100('0x3e')](function(_0x5ce8ce){logger[_0x2100('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ce8ce);throw _0x5ce8ce;});}return _0x5d15dd;});}})[_0x2100('0x1e')](respondWithResult(_0x17e806,0xc9))[_0x2100('0x3e')](handleError(_0x17e806,null));};exports[_0x2100('0x1d')]=function(_0xc0e383,_0x3702e5){if(_0xc0e383[_0x2100('0x4c')]['id']){delete _0xc0e383[_0x2100('0x4c')]['id'];}return db['Campaign'][_0x2100('0x41')]({'where':{'id':_0xc0e383[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x3702e5,null))[_0x2100('0x1e')](saveUpdates(_0xc0e383[_0x2100('0x4c')],null))[_0x2100('0x1e')](respondWithResult(_0x3702e5,null))[_0x2100('0x3e')](handleError(_0x3702e5,null));};exports[_0x2100('0x1f')]=function(_0x535978,_0x59f9be){return db['Campaign']['find']({'where':{'id':_0x535978['params']['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x59f9be,null))[_0x2100('0x1e')](removeEntity(_0x59f9be,null))[_0x2100('0x3e')](handleError(_0x59f9be,null));};exports[_0x2100('0x4f')]=function(_0x30e693,_0x366656,_0x531f5e){var _0x340967={'raw':!![],'where':{}};var _0x49278e={};var _0x1d5579={'count':0x0,'rows':[]};return db['Campaign'][_0x2100('0x50')]({'where':{'id':_0x30e693[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x366656,null))[_0x2100('0x1e')](function(_0x3123a4){if(_0x3123a4){_0x49278e['model']=_['keys'](db['CmHopper'][_0x2100('0x28')]);_0x49278e[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x30e693[_0x2100('0x2a')]);_0x49278e['filters']=_[_0x2100('0x2b')](_0x49278e['model'],_0x49278e[_0x2100('0x2a')]);_0x340967[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x49278e[_0x2100('0x2c')],qs['fields'](_0x30e693['query'][_0x2100('0x2e')]));_0x340967[_0x2100('0x2d')]=_0x340967[_0x2100('0x2d')][_0x2100('0x2f')]?_0x340967[_0x2100('0x2d')]:_0x49278e[_0x2100('0x2c')];if(!_0x30e693[_0x2100('0x2a')][_0x2100('0x51')]('nolimit')){_0x340967['limit']=qs[_0x2100('0x1a')](_0x30e693['query'][_0x2100('0x1a')]);_0x340967[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x30e693[_0x2100('0x2a')]['offset']);}_0x340967['order']=qs[_0x2100('0x52')](_0x30e693['query']['sort']);_0x340967[_0x2100('0x31')]=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x30e693[_0x2100('0x2a')],_0x49278e[_0x2100('0x32')]));_0x340967[_0x2100('0x31')][_0x2100('0x53')]=_0x3123a4['id'];if(_0x30e693[_0x2100('0x2a')]['filter']){_0x340967['where']=_[_0x2100('0x38')](_0x340967[_0x2100('0x31')],{'$or':_[_0x2100('0x54')](_0x340967[_0x2100('0x2d')],function(_0x567a20){var _0x5b86c7={};_0x5b86c7[_0x567a20]={'$like':'%'+_0x30e693['query']['filter']+'%'};return _0x5b86c7;})});}_0x340967=_[_0x2100('0x38')]({},_0x340967,_0x30e693[_0x2100('0x39')]);return db[_0x2100('0x55')][_0x2100('0x3a')]({'where':_0x340967[_0x2100('0x31')]})[_0x2100('0x1e')](function(_0x315119){_0x1d5579[_0x2100('0x3a')]=_0x315119;if(_0x30e693[_0x2100('0x2a')][_0x2100('0x3b')]){_0x340967['include']=[{'all':!![]}];}return db[_0x2100('0x55')]['findAll'](_0x340967);})['then'](function(_0x1cd9cc){_0x1d5579[_0x2100('0x3d')]=_0x1cd9cc;return _0x1d5579;});}})[_0x2100('0x1e')](respondWithFilteredResult(_0x366656,_0x340967))[_0x2100('0x3e')](handleError(_0x366656,null));};exports[_0x2100('0x56')]=function(_0x46b019,_0x4d5e13,_0x434a94){var _0x59b412={'raw':!![],'where':{}};var _0xd57f3f={};var _0x1dc2a={'count':0x0,'rows':[]};return db[_0x2100('0x27')][_0x2100('0x50')]({'where':{'id':_0x46b019['params']['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x4d5e13,null))['then'](function(_0x5cf544){if(_0x5cf544){_0xd57f3f[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x57')][_0x2100('0x28')]);_0xd57f3f[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x46b019[_0x2100('0x2a')]);_0xd57f3f['filters']=_[_0x2100('0x2b')](_0xd57f3f[_0x2100('0x2c')],_0xd57f3f[_0x2100('0x2a')]);_0x59b412['attributes']=_[_0x2100('0x2b')](_0xd57f3f[_0x2100('0x2c')],qs['fields'](_0x46b019[_0x2100('0x2a')][_0x2100('0x2e')]));_0x59b412[_0x2100('0x2d')]=_0x59b412[_0x2100('0x2d')][_0x2100('0x2f')]?_0x59b412[_0x2100('0x2d')]:_0xd57f3f[_0x2100('0x2c')];if(!_0x46b019[_0x2100('0x2a')][_0x2100('0x51')]('nolimit')){_0x59b412[_0x2100('0x1a')]=qs[_0x2100('0x1a')](_0x46b019[_0x2100('0x2a')][_0x2100('0x1a')]);_0x59b412[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x46b019[_0x2100('0x2a')][_0x2100('0x19')]);}_0x59b412[_0x2100('0x30')]=qs[_0x2100('0x52')](_0x46b019['query'][_0x2100('0x52')]);_0x59b412[_0x2100('0x31')]=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x46b019['query'],_0xd57f3f[_0x2100('0x32')]));_0x59b412[_0x2100('0x31')][_0x2100('0x53')]=_0x5cf544['id'];if(_0x46b019['query'][_0x2100('0x34')]){_0x59b412['where']=_[_0x2100('0x38')](_0x59b412[_0x2100('0x31')],{'$or':_[_0x2100('0x54')](_0x59b412[_0x2100('0x2d')],function(_0x33c2b4){var _0x3fff5c={};_0x3fff5c[_0x33c2b4]={'$like':'%'+_0x46b019[_0x2100('0x2a')][_0x2100('0x34')]+'%'};return _0x3fff5c;})});}_0x59b412=_[_0x2100('0x38')]({},_0x59b412,_0x46b019[_0x2100('0x39')]);return db[_0x2100('0x57')][_0x2100('0x3a')]({'where':_0x59b412[_0x2100('0x31')]})[_0x2100('0x1e')](function(_0x5a2e29){_0x1dc2a[_0x2100('0x3a')]=_0x5a2e29;if(_0x46b019[_0x2100('0x2a')][_0x2100('0x3b')]){_0x59b412[_0x2100('0x3c')]=[{'all':!![]}];}return db[_0x2100('0x57')][_0x2100('0x58')](_0x59b412);})['then'](function(_0x477b7e){_0x1dc2a['rows']=_0x477b7e;return _0x1dc2a;});}})['then'](respondWithFilteredResult(_0x4d5e13,_0x59b412))[_0x2100('0x3e')](handleError(_0x4d5e13,null));};exports[_0x2100('0x59')]=function(_0x3fccad,_0x35a8ca,_0x1b1644){var _0x180615={'raw':!![],'where':{}};var _0x104e1e={};var _0x4ba981={'count':0x0,'rows':[]};return db['Campaign'][_0x2100('0x50')]({'where':{'id':_0x3fccad[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x35a8ca,null))[_0x2100('0x1e')](function(_0x1a75bd){if(_0x1a75bd){_0x104e1e[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x5a')][_0x2100('0x28')]);_0x104e1e[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x3fccad[_0x2100('0x2a')]);_0x104e1e['filters']=_['intersection'](_0x104e1e[_0x2100('0x2c')],_0x104e1e[_0x2100('0x2a')]);_0x180615[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x104e1e[_0x2100('0x2c')],qs[_0x2100('0x2e')](_0x3fccad[_0x2100('0x2a')][_0x2100('0x2e')]));_0x180615['attributes']=_0x180615['attributes'][_0x2100('0x2f')]?_0x180615[_0x2100('0x2d')]:_0x104e1e[_0x2100('0x2c')];if(!_0x3fccad[_0x2100('0x2a')][_0x2100('0x51')](_0x2100('0x5b'))){_0x180615[_0x2100('0x1a')]=qs[_0x2100('0x1a')](_0x3fccad['query'][_0x2100('0x1a')]);_0x180615[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x3fccad['query'][_0x2100('0x19')]);}_0x180615[_0x2100('0x30')]=qs[_0x2100('0x52')](_0x3fccad[_0x2100('0x2a')][_0x2100('0x52')]);_0x180615[_0x2100('0x31')]=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x3fccad[_0x2100('0x2a')],_0x104e1e[_0x2100('0x32')]));_0x180615[_0x2100('0x31')][_0x2100('0x53')]=_0x1a75bd['id'];if(_0x3fccad[_0x2100('0x2a')]['filter']){_0x180615[_0x2100('0x31')]=_[_0x2100('0x38')](_0x180615[_0x2100('0x31')],{'$or':_[_0x2100('0x54')](_0x180615[_0x2100('0x2d')],function(_0x587e77){var _0x2eaf12={};_0x2eaf12[_0x587e77]={'$like':'%'+_0x3fccad['query'][_0x2100('0x34')]+'%'};return _0x2eaf12;})});}_0x180615=_['merge']({},_0x180615,_0x3fccad[_0x2100('0x39')]);return db[_0x2100('0x5a')][_0x2100('0x3a')]({'where':_0x180615[_0x2100('0x31')]})[_0x2100('0x1e')](function(_0x1770a3){_0x4ba981[_0x2100('0x3a')]=_0x1770a3;if(_0x3fccad[_0x2100('0x2a')][_0x2100('0x3b')]){_0x180615[_0x2100('0x3c')]=[{'all':!![]}];}return db[_0x2100('0x5a')][_0x2100('0x58')](_0x180615);})[_0x2100('0x1e')](function(_0x443cb6){_0x4ba981[_0x2100('0x3d')]=_0x443cb6;return _0x4ba981;});}})[_0x2100('0x1e')](respondWithFilteredResult(_0x35a8ca,_0x180615))['catch'](handleError(_0x35a8ca,null));};exports[_0x2100('0x5c')]=function(_0x1e7115,_0x59157a,_0x4ccb91){var _0x56fc88={'raw':!![],'where':{}};var _0x3bbd80={};var _0x24e65c={'count':0x0,'rows':[]};return db[_0x2100('0x27')]['findOne']({'where':{'id':_0x1e7115[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x59157a,null))['then'](function(_0x520b59){if(_0x520b59){_0x3bbd80[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x5d')][_0x2100('0x28')]);_0x3bbd80[_0x2100('0x2a')]=_['keys'](_0x1e7115[_0x2100('0x2a')]);_0x3bbd80[_0x2100('0x32')]=_[_0x2100('0x2b')](_0x3bbd80[_0x2100('0x2c')],_0x3bbd80[_0x2100('0x2a')]);_0x56fc88[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x3bbd80[_0x2100('0x2c')],qs[_0x2100('0x2e')](_0x1e7115[_0x2100('0x2a')]['fields']));_0x56fc88[_0x2100('0x2d')]=_0x56fc88[_0x2100('0x2d')][_0x2100('0x2f')]?_0x56fc88[_0x2100('0x2d')]:_0x3bbd80[_0x2100('0x2c')];if(!_0x1e7115[_0x2100('0x2a')]['hasOwnProperty'](_0x2100('0x5b'))){_0x56fc88['limit']=qs[_0x2100('0x1a')](_0x1e7115['query'][_0x2100('0x1a')]);_0x56fc88[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x1e7115[_0x2100('0x2a')][_0x2100('0x19')]);}_0x56fc88['order']=qs[_0x2100('0x52')](_0x1e7115[_0x2100('0x2a')][_0x2100('0x52')]);_0x56fc88[_0x2100('0x31')]=qs['filters'](_[_0x2100('0x33')](_0x1e7115['query'],_0x3bbd80[_0x2100('0x32')]));_0x56fc88[_0x2100('0x31')]['CampaignId']=_0x520b59['id'];if(_0x1e7115['query']['filter']){_0x56fc88[_0x2100('0x31')]=_[_0x2100('0x38')](_0x56fc88[_0x2100('0x31')],{'$or':_[_0x2100('0x54')](_0x56fc88[_0x2100('0x2d')],function(_0x525f8f){var _0x4e5b72={};_0x4e5b72[_0x525f8f]={'$like':'%'+_0x1e7115[_0x2100('0x2a')][_0x2100('0x34')]+'%'};return _0x4e5b72;})});}_0x56fc88=_[_0x2100('0x38')]({},_0x56fc88,_0x1e7115[_0x2100('0x39')]);return db[_0x2100('0x5d')]['count']({'where':_0x56fc88[_0x2100('0x31')]})[_0x2100('0x1e')](function(_0x4d55fb){_0x24e65c[_0x2100('0x3a')]=_0x4d55fb;if(_0x1e7115[_0x2100('0x2a')]['includeAll']){_0x56fc88[_0x2100('0x3c')]=[{'all':!![]}];}return db[_0x2100('0x5d')]['findAll'](_0x56fc88);})[_0x2100('0x1e')](function(_0x43e351){_0x24e65c[_0x2100('0x3d')]=_0x43e351;return _0x24e65c;});}})[_0x2100('0x1e')](respondWithFilteredResult(_0x59157a,_0x56fc88))[_0x2100('0x3e')](handleError(_0x59157a,null));};exports[_0x2100('0x5e')]=function(_0x30cdbf,_0x28fe63,_0xe4afc3){var _0x7abff4={};var _0x3e4148={};var _0x1150d3;var _0x15783a;return db[_0x2100('0x27')][_0x2100('0x50')]({'where':{'id':_0x30cdbf[_0x2100('0x40')]['id']}})['then'](handleEntityNotFound(_0x28fe63,null))['then'](function(_0x3a0e0d){if(_0x3a0e0d){_0x1150d3=_0x3a0e0d;_0x3e4148[_0x2100('0x2c')]=_[_0x2100('0x29')](db['CmList'][_0x2100('0x28')]);_0x3e4148[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x30cdbf['query']);_0x3e4148['filters']=_[_0x2100('0x2b')](_0x3e4148[_0x2100('0x2c')],_0x3e4148[_0x2100('0x2a')]);_0x7abff4[_0x2100('0x2d')]=_[_0x2100('0x2b')](_0x3e4148['model'],qs['fields'](_0x30cdbf[_0x2100('0x2a')][_0x2100('0x2e')]));_0x7abff4[_0x2100('0x2d')]=_0x7abff4[_0x2100('0x2d')][_0x2100('0x2f')]?_0x7abff4[_0x2100('0x2d')]:_0x3e4148['model'];_0x7abff4[_0x2100('0x30')]=qs[_0x2100('0x52')](_0x30cdbf[_0x2100('0x2a')][_0x2100('0x52')]);_0x7abff4[_0x2100('0x31')]=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x30cdbf['query'],_0x3e4148['filters']));if(_0x30cdbf[_0x2100('0x2a')]['filter']){_0x7abff4[_0x2100('0x31')]=_[_0x2100('0x38')](_0x7abff4['where'],{'$or':_[_0x2100('0x54')](_0x7abff4[_0x2100('0x2d')],function(_0x4ad2aa){var _0x12c0a8={};_0x12c0a8[_0x4ad2aa]={'$like':'%'+_0x30cdbf[_0x2100('0x2a')]['filter']+'%'};return _0x12c0a8;})});}_0x7abff4=_['merge']({},_0x7abff4,_0x30cdbf[_0x2100('0x39')]);return _0x1150d3['getLists'](_0x7abff4);}})['then'](function(_0x236812){if(_0x236812){_0x15783a=_0x236812[_0x2100('0x2f')];if(!_0x30cdbf[_0x2100('0x2a')][_0x2100('0x51')](_0x2100('0x5b'))){_0x7abff4[_0x2100('0x1a')]=qs[_0x2100('0x1a')](_0x30cdbf[_0x2100('0x2a')][_0x2100('0x1a')]);_0x7abff4[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x30cdbf[_0x2100('0x2a')][_0x2100('0x19')]);}return _0x1150d3[_0x2100('0x5e')](_0x7abff4);}})[_0x2100('0x1e')](function(_0x4faa76){if(_0x4faa76){return _0x4faa76?{'count':_0x15783a,'rows':_0x4faa76}:null;}})['then'](respondWithResult(_0x28fe63,null))[_0x2100('0x3e')](handleError(_0x28fe63,null));};exports['addLists']=function(_0x5b8ad5,_0x4edceb,_0x349a63){var _0x4f39e8,_0x4017ec;return db[_0x2100('0x27')][_0x2100('0x41')]({'where':{'id':_0x5b8ad5[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x4edceb,null))[_0x2100('0x1e')](function(_0x63b07a){if(_0x63b07a){_0x4017ec=_0x63b07a;return _0x63b07a[_0x2100('0x5f')](_0x5b8ad5[_0x2100('0x4c')][_0x2100('0x60')],_[_0x2100('0x4a')](_0x5b8ad5['body'],[_0x2100('0x60'),'id'])||{});}return null;})[_0x2100('0x61')](function(_0xd16b5f){var _0x2638c0;_0x4f39e8=_0xd16b5f||[];var _0x513cbd=[];if(_0xd16b5f){for(var _0x308fae=0x0;_0x308fae<_0xd16b5f[_0x2100('0x2f')];_0x308fae+=0x1){var _0x4577b4=_0xd16b5f[_0x308fae][_0x2100('0x20')]({'plain':!![]});_0x4017ec['dialCheckDuplicateType']=_0x5b8ad5[_0x2100('0x4c')][_0x2100('0x62')]?_0x5b8ad5[_0x2100('0x4c')][_0x2100('0x62')]:_0x4017ec['dialCheckDuplicateType'];switch(_0x4017ec['dialCheckDuplicateType']){case _0x2100('0x63'):_0x2638c0=squel[_0x2100('0x64')]()[_0x2100('0x65')](_0x2100('0x66'))[_0x2100('0x67')](['phone',_0x2100('0x68'),'ContactId',_0x2100('0x69'),'CampaignId',_0x2100('0x4b'),'updatedAt'],squel[_0x2100('0x6a')]()['field']('phone',_0x2100('0x6b'))[_0x2100('0x37')](_0x2100('0x6c'),'scheduledAt')[_0x2100('0x37')]('id',_0x2100('0x6d'))[_0x2100('0x37')](_0x4577b4[_0x2100('0x6e')]['toString'](),_0x2100('0x69'))[_0x2100('0x37')](_0x5b8ad5['params']['id'][_0x2100('0x6f')](),_0x2100('0x53'))[_0x2100('0x37')]('NOW()','createdAt')[_0x2100('0x37')](_0x2100('0x6c'),'updatedAt')[_0x2100('0x70')]('cm_contacts')[_0x2100('0x31')](_0x2100('0x71'))['where'](_0x2100('0x72'),_0x4577b4[_0x2100('0x6e')][_0x2100('0x6f')]())['where'](_0x2100('0x73'))[_0x2100('0x31')](_0x2100('0x74'),squel['select']()[_0x2100('0x37')](_0x2100('0x75'))[_0x2100('0x70')](_0x2100('0x76'))[_0x2100('0x31')](_0x2100('0x77'),_0x5b8ad5[_0x2100('0x40')]['id'][_0x2100('0x6f')]()))['where'](_0x2100('0x74'),squel[_0x2100('0x6a')]()['field'](_0x2100('0x78'))['from'](_0x2100('0x66'))[_0x2100('0x31')](_0x2100('0x77'),_0x5b8ad5[_0x2100('0x40')]['id'][_0x2100('0x6f')]())))[_0x2100('0x6f')]();break;case'onlyIfOpen':_0x2638c0=squel[_0x2100('0x64')]()['into']('cm_hopper')[_0x2100('0x67')]([_0x2100('0x6b'),'scheduledAt',_0x2100('0x6d'),_0x2100('0x69'),_0x2100('0x53'),'createdAt','updatedAt'],squel[_0x2100('0x6a')]()[_0x2100('0x37')](_0x2100('0x6b'),_0x2100('0x6b'))[_0x2100('0x37')](_0x2100('0x6c'),_0x2100('0x68'))[_0x2100('0x37')]('id','ContactId')[_0x2100('0x37')](_0x4577b4[_0x2100('0x6e')][_0x2100('0x6f')](),'ListId')[_0x2100('0x37')](_0x5b8ad5[_0x2100('0x40')]['id']['toString'](),_0x2100('0x53'))['field'](_0x2100('0x6c'),_0x2100('0x4b'))['field'](_0x2100('0x6c'),_0x2100('0x4d'))[_0x2100('0x70')](_0x2100('0x79'))[_0x2100('0x31')](_0x2100('0x71'))[_0x2100('0x31')]('ListId\x20=\x20?',_0x4577b4[_0x2100('0x6e')][_0x2100('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2100('0x31')](_0x2100('0x74'),squel[_0x2100('0x6a')]()[_0x2100('0x37')](_0x2100('0x78'))[_0x2100('0x70')](_0x2100('0x66'))[_0x2100('0x31')](_0x2100('0x77'),_0x5b8ad5['params']['id'][_0x2100('0x6f')]())))['toString']();break;default:_0x2638c0=squel['insert']()[_0x2100('0x65')](_0x2100('0x66'))['fromQuery']([_0x2100('0x6b'),'scheduledAt',_0x2100('0x6d'),_0x2100('0x69'),_0x2100('0x53'),_0x2100('0x4b'),_0x2100('0x4d')],squel[_0x2100('0x6a')]()[_0x2100('0x37')](_0x2100('0x6b'),_0x2100('0x6b'))['field'](_0x2100('0x6c'),_0x2100('0x68'))[_0x2100('0x37')]('id',_0x2100('0x6d'))[_0x2100('0x37')](_0x4577b4['CmListId']['toString'](),_0x2100('0x69'))['field'](_0x5b8ad5['params']['id']['toString'](),'CampaignId')[_0x2100('0x37')](_0x2100('0x6c'),'createdAt')[_0x2100('0x37')](_0x2100('0x6c'),_0x2100('0x4d'))[_0x2100('0x70')](_0x2100('0x79'))['where']('deletedAt\x20IS\x20NULL')[_0x2100('0x31')](_0x2100('0x72'),_0x4577b4[_0x2100('0x6e')][_0x2100('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2100('0x6f')]();}_0x513cbd[_0x2100('0x7a')](db[_0x2100('0x7b')][_0x2100('0x2a')](_0x2638c0));}return BPromise[_0x2100('0x7c')](_0x513cbd);}})['then'](function(){return _0x4f39e8;})[_0x2100('0x1e')](respondWithResult(_0x4edceb,null))[_0x2100('0x3e')](handleError(_0x4edceb,null));};exports[_0x2100('0x7d')]=function(_0x5f3802,_0x127dd3,_0x53199e){return db[_0x2100('0x27')][_0x2100('0x41')]({'where':{'id':_0x5f3802[_0x2100('0x40')]['id']}})['then'](handleEntityNotFound(_0x127dd3,null))[_0x2100('0x1e')](function(_0x17ef01){if(_0x17ef01){return _0x17ef01[_0x2100('0x7d')](_0x5f3802[_0x2100('0x2a')][_0x2100('0x60')]);}})[_0x2100('0x1e')](function(_0x2018ab){if(_0x2018ab){return db[_0x2100('0x55')][_0x2100('0x1f')]({'where':{'ListId':_0x5f3802[_0x2100('0x2a')][_0x2100('0x60')],'CampaignId':_0x5f3802[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](function(){return _0x2018ab;});}})[_0x2100('0x1e')](respondWithStatusCode(_0x127dd3,null))[_0x2100('0x3e')](handleError(_0x127dd3,null));};exports[_0x2100('0x7e')]=function(_0x11568c,_0x2c47f2,_0x20a123){var _0x36b68={'raw':!![],'where':{}};var _0x4d6a9e={};var _0xd4acc2={'count':0x0,'rows':[]};return db[_0x2100('0x27')]['findOne']({'where':{'id':_0x11568c['params']['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x2c47f2,null))[_0x2100('0x1e')](function(_0x5145f1){if(_0x5145f1){_0x4d6a9e[_0x2100('0x2c')]=_[_0x2100('0x29')](db[_0x2100('0x7f')]['rawAttributes']);_0x4d6a9e[_0x2100('0x2a')]=_[_0x2100('0x29')](_0x11568c[_0x2100('0x2a')]);_0x4d6a9e['filters']=_[_0x2100('0x2b')](_0x4d6a9e['model'],_0x4d6a9e[_0x2100('0x2a')]);_0x36b68['attributes']=_[_0x2100('0x2b')](_0x4d6a9e['model'],qs['fields'](_0x11568c[_0x2100('0x2a')][_0x2100('0x2e')]));_0x36b68[_0x2100('0x2d')]=_0x36b68['attributes'][_0x2100('0x2f')]?_0x36b68[_0x2100('0x2d')]:_0x4d6a9e[_0x2100('0x2c')];if(!_0x11568c[_0x2100('0x2a')]['hasOwnProperty'](_0x2100('0x5b'))){_0x36b68[_0x2100('0x1a')]=qs['limit'](_0x11568c[_0x2100('0x2a')][_0x2100('0x1a')]);_0x36b68[_0x2100('0x19')]=qs[_0x2100('0x19')](_0x11568c[_0x2100('0x2a')]['offset']);}_0x36b68[_0x2100('0x30')]=qs[_0x2100('0x52')](_0x11568c[_0x2100('0x2a')][_0x2100('0x52')]);_0x36b68['where']=qs[_0x2100('0x32')](_[_0x2100('0x33')](_0x11568c[_0x2100('0x2a')],_0x4d6a9e[_0x2100('0x32')]));_0x36b68[_0x2100('0x31')]['CampaignId']=_0x5145f1['id'];if(_0x11568c[_0x2100('0x2a')]['filter']){_0x36b68[_0x2100('0x31')]=_[_0x2100('0x38')](_0x36b68[_0x2100('0x31')],{'$or':_[_0x2100('0x54')](_0x36b68[_0x2100('0x2d')],function(_0x40e2f0){var _0x17852f={};_0x17852f[_0x40e2f0]={'$like':'%'+_0x11568c[_0x2100('0x2a')]['filter']+'%'};return _0x17852f;})});}_0x36b68=_[_0x2100('0x38')]({},_0x36b68,_0x11568c['options']);return db[_0x2100('0x7f')][_0x2100('0x3a')]({'where':_0x36b68[_0x2100('0x31')]})[_0x2100('0x1e')](function(_0x3ad743){_0xd4acc2[_0x2100('0x3a')]=_0x3ad743;if(_0x11568c[_0x2100('0x2a')][_0x2100('0x3b')]){_0x36b68[_0x2100('0x3c')]=[{'all':!![]}];}return db[_0x2100('0x7f')][_0x2100('0x58')](_0x36b68);})[_0x2100('0x1e')](function(_0x1b490d){_0xd4acc2[_0x2100('0x3d')]=_0x1b490d;return _0xd4acc2;});}})['then'](respondWithFilteredResult(_0x2c47f2,_0x36b68))[_0x2100('0x3e')](handleError(_0x2c47f2,null));};exports['addBlackLists']=function(_0x4cd62d,_0x1364e1,_0x5e3537){var _0x398d0e,_0x28fdec;return db[_0x2100('0x27')]['find']({'where':{'id':_0x4cd62d[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x1364e1,null))[_0x2100('0x1e')](function(_0x909dc0){if(_0x909dc0){_0x28fdec=_0x909dc0;return _0x909dc0[_0x2100('0x80')](_0x4cd62d[_0x2100('0x4c')][_0x2100('0x60')],_[_0x2100('0x4a')](_0x4cd62d[_0x2100('0x4c')],[_0x2100('0x60'),'id'])||{});}return null;})[_0x2100('0x61')](function(_0xa9c50e){var _0x45f456;_0x398d0e=_0xa9c50e||[];var _0x3cda4f=[];if(_0xa9c50e){for(var _0x3ddd47=0x0;_0x3ddd47<_0xa9c50e[_0x2100('0x2f')];_0x3ddd47+=0x1){var _0x87b736=_0xa9c50e[_0x3ddd47][_0x2100('0x20')]({'plain':!![]});_0x45f456=squel[_0x2100('0x64')]()['into'](_0x2100('0x81'))[_0x2100('0x67')]([_0x2100('0x6b'),_0x2100('0x6d'),'ListId',_0x2100('0x53'),_0x2100('0x4b'),_0x2100('0x4d')],squel[_0x2100('0x6a')]()[_0x2100('0x37')](_0x2100('0x6b'),_0x2100('0x6b'))[_0x2100('0x37')]('id',_0x2100('0x6d'))['field'](_0x87b736['CmListId']['toString'](),_0x2100('0x69'))['field'](_0x4cd62d[_0x2100('0x40')]['id']['toString'](),'CampaignId')[_0x2100('0x37')](_0x2100('0x6c'),_0x2100('0x4b'))['field']('NOW()',_0x2100('0x4d'))[_0x2100('0x70')](_0x2100('0x79'))[_0x2100('0x31')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x87b736[_0x2100('0x6e')]['toString']())['where'](_0x2100('0x73')))[_0x2100('0x6f')]();_0x3cda4f['push'](db[_0x2100('0x7b')][_0x2100('0x2a')](_0x45f456));}return BPromise[_0x2100('0x7c')](_0x3cda4f);}})[_0x2100('0x1e')](function(){return _0x398d0e;})[_0x2100('0x1e')](respondWithResult(_0x1364e1,null))[_0x2100('0x3e')](handleError(_0x1364e1,null));};exports[_0x2100('0x82')]=function(_0x142084,_0x3099e9,_0x21d5d9){return db[_0x2100('0x27')][_0x2100('0x41')]({'where':{'id':_0x142084[_0x2100('0x40')]['id']}})[_0x2100('0x1e')](handleEntityNotFound(_0x3099e9,null))[_0x2100('0x1e')](function(_0x3f6d52){if(_0x3f6d52){return _0x3f6d52[_0x2100('0x82')](_0x142084['query'][_0x2100('0x60')]);}})['then'](function(_0x5b3c4f){if(_0x5b3c4f){return db[_0x2100('0x5d')][_0x2100('0x1f')]({'where':{'ListId':_0x142084[_0x2100('0x2a')]['ids'],'CampaignId':_0x142084[_0x2100('0x40')]['id']}})['then'](function(){return _0x5b3c4f;});}})['then'](respondWithStatusCode(_0x3099e9,null))[_0x2100('0x3e')](handleError(_0x3099e9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index ec238dc..abb7436 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 _0xeb0d=['exports','define','lodash','api','moment','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x32d48e,_0x7b3be5){var _0x55c34f=function(_0x260ce9){while(--_0x260ce9){_0x32d48e['push'](_0x32d48e['shift']());}};_0x55c34f(++_0x7b3be5);}(_0xeb0d,0x192));var _0xdeb0=function(_0x41ce8e,_0x35b433){_0x41ce8e=_0x41ce8e-0x0;var _0x2aa1d2=_0xeb0d[_0x41ce8e];return _0x2aa1d2;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdeb0('0x1'));var moment=require(_0xdeb0('0x2'));var BPromise=require(_0xdeb0('0x3'));var rp=require(_0xdeb0('0x4'));var fs=require('fs');var path=require(_0xdeb0('0x5'));var rimraf=require(_0xdeb0('0x6'));var config=require('../../config/environment');var attributes=require(_0xdeb0('0x7'));module[_0xdeb0('0x8')]=function(_0x4508e5,_0x2a381f){return _0x4508e5[_0xdeb0('0x9')]('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14b3=['moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','../../config/logger','api'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x14b3,0x7a));var _0x314b=function(_0x1cc12d,_0x1325df){_0x1cc12d=_0x1cc12d-0x0;var _0x46395c=_0x14b3[_0x1cc12d];return _0x46395c;};'use strict';var _=require(_0x314b('0x0'));var util=require(_0x314b('0x1'));var logger=require(_0x314b('0x2'))(_0x314b('0x3'));var moment=require(_0x314b('0x4'));var BPromise=require('bluebird');var rp=require(_0x314b('0x5'));var fs=require('fs');var path=require(_0x314b('0x6'));var rimraf=require(_0x314b('0x7'));var config=require(_0x314b('0x8'));var attributes=require(_0x314b('0x9'));module[_0x314b('0xa')]=function(_0x4027dd,_0x3de3a1){return _0x4027dd[_0x314b('0xb')](_0x314b('0xc'),attributes,{'tableName':_0x314b('0xd'),'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 e507a4d..2bd7747 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 _0xb423=['info','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x33174b,_0xfadb28){var _0x19f662=function(_0x102025){while(--_0x102025){_0x33174b['push'](_0x33174b['shift']());}};_0x19f662(++_0xfadb28);}(_0xb423,0xad));var _0x3b42=function(_0x11abc1,_0x19d0df){_0x11abc1=_0x11abc1-0x0;var _0x181cf3=_0xb423[_0x11abc1];return _0x181cf3;};'use strict';var _=require(_0x3b42('0x0'));var util=require(_0x3b42('0x1'));var moment=require(_0x3b42('0x2'));var BPromise=require(_0x3b42('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b42('0x4'));var db=require(_0x3b42('0x5'))['db'];var utils=require(_0x3b42('0x6'));var logger=require(_0x3b42('0x7'))('rpc');var config=require(_0x3b42('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3b42('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6af084,_0x2c2a41,_0x53f3fb){return new BPromise(function(_0x597d32,_0xdda222){return client[_0x3b42('0xa')](_0x6af084,_0x53f3fb)[_0x3b42('0xb')](function(_0x3be47f){logger['info'](_0x3b42('0xc'),_0x2c2a41,_0x3b42('0xd'));logger[_0x3b42('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2c2a41,_0x3b42('0xd'),JSON[_0x3b42('0xf')](_0x3be47f));if(_0x3be47f['error']){if(_0x3be47f['error'][_0x3b42('0x10')]===0x1f4){logger[_0x3b42('0x11')]('Campaign,\x20%s,\x20%s',_0x2c2a41,_0x3be47f[_0x3b42('0x11')][_0x3b42('0x12')]);return _0xdda222(_0x3be47f[_0x3b42('0x11')][_0x3b42('0x12')]);}logger[_0x3b42('0x11')](_0x3b42('0xc'),_0x2c2a41,_0x3be47f[_0x3b42('0x11')][_0x3b42('0x12')]);return _0x597d32(_0x3be47f['error']['message']);}else{logger[_0x3b42('0x13')](_0x3b42('0xc'),_0x2c2a41,_0x3b42('0xd'));_0x597d32(_0x3be47f['result'][_0x3b42('0x12')]);}})[_0x3b42('0x14')](function(_0x247108){logger[_0x3b42('0x11')](_0x3b42('0xc'),_0x2c2a41,_0x247108);_0xdda222(_0x247108);});});}exports[_0x3b42('0x15')]=function(_0x35b2da){var _0x36c739=this;return new Promise(function(_0x4e03de,_0x4671ee){return db[_0x3b42('0x16')][_0x3b42('0x17')]({'raw':_0x35b2da[_0x3b42('0x18')]?_0x35b2da[_0x3b42('0x18')][_0x3b42('0x19')]===undefined?!![]:![]:!![],'where':_0x35b2da[_0x3b42('0x18')]?_0x35b2da[_0x3b42('0x18')][_0x3b42('0x1a')]||null:null,'attributes':_0x35b2da[_0x3b42('0x18')]?_0x35b2da['options'][_0x3b42('0x1b')]||null:null,'limit':_0x35b2da[_0x3b42('0x18')]?_0x35b2da[_0x3b42('0x18')][_0x3b42('0x1c')]||null:null,'include':_0x35b2da[_0x3b42('0x18')]?_0x35b2da[_0x3b42('0x18')][_0x3b42('0x1d')]?_[_0x3b42('0x1e')](_0x35b2da[_0x3b42('0x18')][_0x3b42('0x1d')],function(_0x2b3df3){return{'model':db[_0x2b3df3[_0x3b42('0x1f')]],'as':_0x2b3df3['as'],'attributes':_0x2b3df3[_0x3b42('0x1b')],'include':_0x2b3df3[_0x3b42('0x1d')]?_[_0x3b42('0x1e')](_0x2b3df3[_0x3b42('0x1d')],function(_0x1a6b14){return{'model':db[_0x1a6b14[_0x3b42('0x1f')]],'as':_0x1a6b14['as'],'attributes':_0x1a6b14[_0x3b42('0x1b')],'include':_0x1a6b14[_0x3b42('0x1d')]?_['map'](_0x1a6b14['include'],function(_0x510071){return{'model':db[_0x510071['model']],'as':_0x510071['as'],'attributes':_0x510071[_0x3b42('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3b42('0xb')](function(_0x16bbbe){logger[_0x3b42('0x13')](_0x3b42('0x15'),_0x35b2da);logger[_0x3b42('0xe')]('GetCampaign',_0x35b2da,JSON['stringify'](_0x16bbbe));_0x4e03de(_0x16bbbe);})[_0x3b42('0x14')](function(_0x2c61b2){logger[_0x3b42('0x11')](_0x3b42('0x15'),_0x2c61b2[_0x3b42('0x12')],_0x35b2da);_0x4671ee(_0x36c739[_0x3b42('0x11')](0x1f4,_0x2c61b2['message']));});});}; \ No newline at end of file +var _0x86c0=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','GetCampaign','options','where','attributes','include','map','model','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86c0,0xc3));var _0x086c=function(_0x13cdd0,_0x3a3ca7){_0x13cdd0=_0x13cdd0-0x0;var _0x2fcc49=_0x86c0[_0x13cdd0];return _0x2fcc49;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x086c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x086c('0x2'));var db=require(_0x086c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x086c('0x4'))(_0x086c('0x5'));var config=require(_0x086c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x7')][_0x086c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x149bfe,_0x1ad788,_0x2be6e1){return new BPromise(function(_0x5e3d83,_0x2c249f){return client[_0x086c('0x9')](_0x149bfe,_0x2be6e1)[_0x086c('0xa')](function(_0x1648e1){logger[_0x086c('0xb')](_0x086c('0xc'),_0x1ad788,'request\x20sent');logger[_0x086c('0xd')](_0x086c('0xe'),_0x1ad788,_0x086c('0xf'),JSON['stringify'](_0x1648e1));if(_0x1648e1['error']){if(_0x1648e1['error'][_0x086c('0x10')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0xc'),_0x1ad788,_0x1648e1['error']['message']);return _0x2c249f(_0x1648e1[_0x086c('0x11')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x1ad788,_0x1648e1['error']['message']);return _0x5e3d83(_0x1648e1[_0x086c('0x11')][_0x086c('0x12')]);}else{logger[_0x086c('0xb')]('Campaign,\x20%s,\x20%s',_0x1ad788,_0x086c('0xf'));_0x5e3d83(_0x1648e1['result'][_0x086c('0x12')]);}})[_0x086c('0x13')](function(_0x5ce048){logger[_0x086c('0x11')]('Campaign,\x20%s,\x20%s',_0x1ad788,_0x5ce048);_0x2c249f(_0x5ce048);});});}exports[_0x086c('0x14')]=function(_0x4373c){var _0x3b81f3=this;return new Promise(function(_0x24cd1a,_0x344b94){return db['Campaign']['findAll']({'raw':_0x4373c[_0x086c('0x15')]?_0x4373c[_0x086c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4373c[_0x086c('0x15')]?_0x4373c[_0x086c('0x15')][_0x086c('0x16')]||null:null,'attributes':_0x4373c['options']?_0x4373c[_0x086c('0x15')][_0x086c('0x17')]||null:null,'limit':_0x4373c[_0x086c('0x15')]?_0x4373c[_0x086c('0x15')]['limit']||null:null,'include':_0x4373c[_0x086c('0x15')]?_0x4373c[_0x086c('0x15')][_0x086c('0x18')]?_[_0x086c('0x19')](_0x4373c['options']['include'],function(_0x5e9cca){return{'model':db[_0x5e9cca[_0x086c('0x1a')]],'as':_0x5e9cca['as'],'attributes':_0x5e9cca['attributes'],'include':_0x5e9cca[_0x086c('0x18')]?_[_0x086c('0x19')](_0x5e9cca[_0x086c('0x18')],function(_0x2d2483){return{'model':db[_0x2d2483[_0x086c('0x1a')]],'as':_0x2d2483['as'],'attributes':_0x2d2483[_0x086c('0x17')],'include':_0x2d2483[_0x086c('0x18')]?_['map'](_0x2d2483[_0x086c('0x18')],function(_0x2a51ed){return{'model':db[_0x2a51ed[_0x086c('0x1a')]],'as':_0x2a51ed['as'],'attributes':_0x2a51ed[_0x086c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x086c('0xa')](function(_0x5bc5eb){logger['info'](_0x086c('0x14'),_0x4373c);logger[_0x086c('0xd')](_0x086c('0x14'),_0x4373c,JSON[_0x086c('0x1b')](_0x5bc5eb));_0x24cd1a(_0x5bc5eb);})[_0x086c('0x13')](function(_0x20f130){logger[_0x086c('0x11')](_0x086c('0x14'),_0x20f130['message'],_0x4373c);_0x344b94(_0x3b81f3['error'](0x1f4,_0x20f130[_0x086c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index f4cc70c..28980da 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 _0x3c9b=['/:id/blacklists','addBlackLists','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','post','/:id/clone','clone'];(function(_0x3073ac,_0x29dc2b){var _0x31d3bd=function(_0x163b3b){while(--_0x163b3b){_0x3073ac['push'](_0x3073ac['shift']());}};_0x31d3bd(++_0x29dc2b);}(_0x3c9b,0x163));var _0xb3c9=function(_0x2a4f87,_0x35e581){_0x2a4f87=_0x2a4f87-0x0;var _0x2f88ec=_0x3c9b[_0x2a4f87];return _0x2f88ec;};'use strict';var multer=require(_0xb3c9('0x0'));var util=require(_0xb3c9('0x1'));var path=require('path');var timeout=require(_0xb3c9('0x2'));var express=require(_0xb3c9('0x3'));var router=express['Router']();var auth=require(_0xb3c9('0x4'));var interaction=require(_0xb3c9('0x5'));var config=require('../../config/environment');var controller=require(_0xb3c9('0x6'));router[_0xb3c9('0x7')]('/',auth['isAuthenticated'](),controller[_0xb3c9('0x8')]);router['get'](_0xb3c9('0x9'),auth[_0xb3c9('0xa')](),controller[_0xb3c9('0xb')]);router[_0xb3c9('0x7')]('/:id/hoppers',auth[_0xb3c9('0xa')](),controller[_0xb3c9('0xc')]);router['get'](_0xb3c9('0xd'),auth[_0xb3c9('0xa')](),controller['getHopperHistories']);router[_0xb3c9('0x7')](_0xb3c9('0xe'),auth[_0xb3c9('0xa')](),controller[_0xb3c9('0xf')]);router[_0xb3c9('0x7')](_0xb3c9('0x10'),auth['isAuthenticated'](),controller[_0xb3c9('0x11')]);router[_0xb3c9('0x7')](_0xb3c9('0x12'),auth[_0xb3c9('0xa')](),controller['getLists']);router[_0xb3c9('0x7')]('/:id/blacklists',auth[_0xb3c9('0xa')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb3c9('0x13')](_0xb3c9('0x14'),auth[_0xb3c9('0xa')](),controller[_0xb3c9('0x15')]);router[_0xb3c9('0x13')](_0xb3c9('0x12'),auth[_0xb3c9('0xa')](),controller['addLists']);router[_0xb3c9('0x13')](_0xb3c9('0x16'),auth[_0xb3c9('0xa')](),controller[_0xb3c9('0x17')]);router['put']('/:id',auth[_0xb3c9('0xa')](),controller[_0xb3c9('0x18')]);router[_0xb3c9('0x19')](_0xb3c9('0x9'),auth[_0xb3c9('0xa')](),controller[_0xb3c9('0x1a')]);router[_0xb3c9('0x19')](_0xb3c9('0x12'),auth['isAuthenticated'](),controller[_0xb3c9('0x1b')]);router[_0xb3c9('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xb3c9('0x1c')]=router; \ No newline at end of file +var _0xa903=['update','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xa903,0x12f));var _0x3a90=function(_0x45ba5f,_0x45ff18){_0x45ba5f=_0x45ba5f-0x0;var _0x2ae6be=_0xa903[_0x45ba5f];return _0x2ae6be;};'use strict';var multer=require(_0x3a90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a90('0x1'));var express=require(_0x3a90('0x2'));var router=express[_0x3a90('0x3')]();var auth=require(_0x3a90('0x4'));var interaction=require(_0x3a90('0x5'));var config=require(_0x3a90('0x6'));var controller=require(_0x3a90('0x7'));router[_0x3a90('0x8')]('/',auth[_0x3a90('0x9')](),controller[_0x3a90('0xa')]);router[_0x3a90('0x8')]('/:id',auth[_0x3a90('0x9')](),controller[_0x3a90('0xb')]);router[_0x3a90('0x8')](_0x3a90('0xc'),auth['isAuthenticated'](),controller[_0x3a90('0xd')]);router[_0x3a90('0x8')](_0x3a90('0xe'),auth[_0x3a90('0x9')](),controller[_0x3a90('0xf')]);router[_0x3a90('0x8')](_0x3a90('0x10'),auth[_0x3a90('0x9')](),controller[_0x3a90('0x11')]);router[_0x3a90('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x3a90('0x12')]);router['get'](_0x3a90('0x13'),auth['isAuthenticated'](),controller[_0x3a90('0x14')]);router['get']('/:id/blacklists',auth[_0x3a90('0x9')](),controller[_0x3a90('0x15')]);router[_0x3a90('0x16')]('/',auth[_0x3a90('0x9')](),controller[_0x3a90('0x17')]);router['post'](_0x3a90('0x18'),auth[_0x3a90('0x9')](),controller[_0x3a90('0x19')]);router[_0x3a90('0x16')]('/:id/lists',auth[_0x3a90('0x9')](),controller[_0x3a90('0x1a')]);router['post']('/:id/blacklists',auth[_0x3a90('0x9')](),controller[_0x3a90('0x1b')]);router[_0x3a90('0x1c')](_0x3a90('0x1d'),auth[_0x3a90('0x9')](),controller[_0x3a90('0x1e')]);router['delete']('/:id',auth[_0x3a90('0x9')](),controller[_0x3a90('0x1f')]);router[_0x3a90('0x20')](_0x3a90('0x13'),auth['isAuthenticated'](),controller[_0x3a90('0x21')]);router[_0x3a90('0x20')](_0x3a90('0x22'),auth[_0x3a90('0x9')](),controller[_0x3a90('0x23')]);module[_0x3a90('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e48da55..d31a4c8 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 _0xa633=['key','sequelize','exports','STRING','VIRTUAL'];(function(_0x48481d,_0x5ab9b3){var _0x549099=function(_0x3ca32a){while(--_0x3ca32a){_0x48481d['push'](_0x48481d['shift']());}};_0x549099(++_0x5ab9b3);}(_0xa633,0x128));var _0x3a63=function(_0x46446e,_0x429e49){_0x46446e=_0x46446e-0x0;var _0x477429=_0xa633[_0x46446e];return _0x477429;};'use strict';var Sequelize=require(_0x3a63('0x0'));module[_0x3a63('0x1')]={'key':{'type':Sequelize[_0x3a63('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x3a63('0x2')]},'name':{'type':Sequelize[_0x3a63('0x3')],'get':function(){return this['getDataValue'](_0x3a63('0x4'));}}}; \ No newline at end of file +var _0x33fd=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x44737a,_0x451f6b){var _0x1972ba=function(_0xb57a5d){while(--_0xb57a5d){_0x44737a['push'](_0x44737a['shift']());}};_0x1972ba(++_0x451f6b);}(_0x33fd,0x175));var _0xd33f=function(_0x400520,_0x5bf201){_0x400520=_0x400520-0x0;var _0x25a0aa=_0x33fd[_0x400520];return _0x25a0aa;};'use strict';var Sequelize=require(_0xd33f('0x0'));module[_0xd33f('0x1')]={'key':{'type':Sequelize[_0xd33f('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd33f('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xd33f('0x2')]},'name':{'type':Sequelize[_0xd33f('0x4')],'get':function(){return this[_0xd33f('0x5')](_0xd33f('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8201f4b..6641a78 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 _0xd34f=['end','sendStatus','error','stack','name','send','index','CannedAnswer','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','key','VIRTUAL','field','options','includeAll','findAll','rows','rawAttributes','find','update','body','params','destroy','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','status','json','count','offset','limit','set','Content-Range','reject','save','then','get','CannedAnswers','UserProfileResource'];(function(_0x1945a2,_0x1ba540){var _0x3124ba=function(_0x540423){while(--_0x540423){_0x1945a2['push'](_0x1945a2['shift']());}};_0x3124ba(++_0x1ba540);}(_0xd34f,0xdd));var _0xfd34=function(_0x5d80e7,_0x57d877){_0x5d80e7=_0x5d80e7-0x0;var _0x5dea17=_0xd34f[_0x5d80e7];return _0x5dea17;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfd34('0x0'));var rimraf=require(_0xfd34('0x1'));var zipdir=require(_0xfd34('0x2'));var jsonpatch=require(_0xfd34('0x3'));var rp=require(_0xfd34('0x4'));var moment=require(_0xfd34('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd34('0x6'));var path=require(_0xfd34('0x7'));var sox=require(_0xfd34('0x8'));var csv=require('to-csv');var ejs=require(_0xfd34('0x9'));var fs=require('fs');var _=require(_0xfd34('0xa'));var squel=require(_0xfd34('0xb'));var crypto=require(_0xfd34('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfd34('0xd'));var toCsv=require(_0xfd34('0xe'));var querystring=require(_0xfd34('0xf'));var Papa=require(_0xfd34('0x10'));var Redis=require(_0xfd34('0x11'));var authService=require(_0xfd34('0x12'));var qs=require(_0xfd34('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfd34('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ceed0,_0x2a9e39){_0x2a9e39=_0x2a9e39||0xcc;return function(_0x25b93c){if(_0x25b93c){return _0x5ceed0['sendStatus'](_0x2a9e39);}return _0x5ceed0[_0xfd34('0x15')](_0x2a9e39)['end']();};}function respondWithResult(_0xdda8e5,_0x1f245a){_0x1f245a=_0x1f245a||0xc8;return function(_0x5dd5d4){if(_0x5dd5d4){return _0xdda8e5[_0xfd34('0x15')](_0x1f245a)[_0xfd34('0x16')](_0x5dd5d4);}};}function respondWithFilteredResult(_0x1aeb91,_0x1a2007){return function(_0x2c428b){if(_0x2c428b){var _0x442c20=_0x2c428b[_0xfd34('0x17')],_0x51c119=_0x1a2007['offset'],_0x2f3c70=_0x1a2007[_0xfd34('0x18')]+_0x1a2007[_0xfd34('0x19')],_0x51ee05;if(_0x2f3c70>=_0x442c20){_0x2f3c70=_0x442c20;_0x51ee05=0xc8;}else{_0x51ee05=0xce;}_0x1aeb91[_0xfd34('0x15')](_0x51ee05);return _0x1aeb91[_0xfd34('0x1a')](_0xfd34('0x1b'),_0x51c119+'-'+_0x2f3c70+'/'+_0x442c20)[_0xfd34('0x16')](_0x2c428b);}return null;};}function patchUpdates(_0x1f53cf){return function(_0x316357){try{jsonpatch['apply'](_0x316357,_0x1f53cf,!![]);}catch(_0x1f6498){return BPromise[_0xfd34('0x1c')](_0x1f6498);}return _0x316357[_0xfd34('0x1d')]();};}function saveUpdates(_0x120923,_0x546f97){return function(_0x256b70){if(_0x256b70){return _0x256b70['update'](_0x120923)['then'](function(_0x2ccf3f){return _0x2ccf3f;});}return null;};}function removeEntity(_0x187c52,_0xac2cce){return function(_0x27c0ff){if(_0x27c0ff){return _0x27c0ff['destroy']()[_0xfd34('0x1e')](function(){var _0x19ede1=_0x27c0ff[_0xfd34('0x1f')]({'plain':!![]});var _0x157c86=_0xfd34('0x20');return db[_0xfd34('0x21')]['destroy']({'where':{'type':_0x157c86,'resourceId':_0x19ede1['id']}})['then'](function(){return _0x27c0ff;});})[_0xfd34('0x1e')](function(){_0x187c52[_0xfd34('0x15')](0xcc)[_0xfd34('0x22')]();});}};}function handleEntityNotFound(_0xe425e4,_0x2a464a){return function(_0x1579ed){if(!_0x1579ed){_0xe425e4[_0xfd34('0x23')](0x194);}return _0x1579ed;};}function handleError(_0x176451,_0xec2b74){_0xec2b74=_0xec2b74||0x1f4;return function(_0x5459d9){logger[_0xfd34('0x24')](_0x5459d9[_0xfd34('0x25')]);if(_0x5459d9[_0xfd34('0x26')]){delete _0x5459d9[_0xfd34('0x26')];}_0x176451[_0xfd34('0x15')](_0xec2b74)[_0xfd34('0x27')](_0x5459d9);};}exports[_0xfd34('0x28')]=function(_0x34fd5d,_0x57dbbd){var _0x179b41={},_0x1229ec={},_0x11f14d={'count':0x0,'rows':[]};var _0x21bf50=db[_0xfd34('0x29')]['rawAttributes'];_0x1229ec[_0xfd34('0x2a')]=_['keys'](_0x21bf50);_0x1229ec[_0xfd34('0x2b')]=_[_0xfd34('0x2c')](_0x34fd5d[_0xfd34('0x2b')]);_0x1229ec[_0xfd34('0x2d')]=_[_0xfd34('0x2e')](_0x1229ec[_0xfd34('0x2a')],_0x1229ec['query']);_0x179b41['attributes']=_[_0xfd34('0x2e')](_0x1229ec[_0xfd34('0x2a')],qs['fields'](_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x2f')]));_0x179b41[_0xfd34('0x30')]=_0x179b41[_0xfd34('0x30')][_0xfd34('0x31')]?_0x179b41['attributes']:_0x1229ec[_0xfd34('0x2a')];if(!_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x32')](_0xfd34('0x33'))){_0x179b41[_0xfd34('0x19')]=qs[_0xfd34('0x19')](_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x19')]);_0x179b41[_0xfd34('0x18')]=qs[_0xfd34('0x18')](_0x34fd5d['query'][_0xfd34('0x18')]);}_0x179b41[_0xfd34('0x34')]=qs[_0xfd34('0x35')](_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x35')]);_0x179b41['where']=qs[_0xfd34('0x2d')](_[_0xfd34('0x36')](_0x34fd5d[_0xfd34('0x2b')],_0x1229ec[_0xfd34('0x2d')]));if(_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x37')]){_0x179b41['where']=_[_0xfd34('0x38')](_0x179b41[_0xfd34('0x39')],{'$or':_['map'](_0x21bf50,function(_0x215d5e){if(_0x215d5e['type'][_0xfd34('0x3a')]!==_0xfd34('0x3b')){var _0xed553={};_0xed553[_0x215d5e[_0xfd34('0x3c')]]={'$like':'%'+_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x37')]+'%'};return _0xed553;}})});}_0x179b41=_[_0xfd34('0x38')]({},_0x179b41,_0x34fd5d[_0xfd34('0x3d')]);var _0x1d5d3c={'where':_0x179b41[_0xfd34('0x39')]};return db[_0xfd34('0x29')]['count'](_0x1d5d3c)['then'](function(_0x251c14){_0x11f14d[_0xfd34('0x17')]=_0x251c14;if(_0x34fd5d[_0xfd34('0x2b')][_0xfd34('0x3e')]){_0x179b41['include']=[{'all':!![]}];}return db[_0xfd34('0x29')][_0xfd34('0x3f')](_0x179b41);})['then'](function(_0x3b91ac){_0x11f14d[_0xfd34('0x40')]=_0x3b91ac;return _0x11f14d;})[_0xfd34('0x1e')](respondWithFilteredResult(_0x57dbbd,_0x179b41))['catch'](handleError(_0x57dbbd,null));};exports['show']=function(_0x3fc4c9,_0x54fab6){var _0x230b07={'raw':!![],'where':{'id':_0x3fc4c9['params']['id']}},_0x1246e8={};_0x1246e8['model']=_[_0xfd34('0x2c')](db['CannedAnswer'][_0xfd34('0x41')]);_0x1246e8[_0xfd34('0x2b')]=_[_0xfd34('0x2c')](_0x3fc4c9['query']);_0x1246e8[_0xfd34('0x2d')]=_[_0xfd34('0x2e')](_0x1246e8[_0xfd34('0x2a')],_0x1246e8[_0xfd34('0x2b')]);_0x230b07['attributes']=_['intersection'](_0x1246e8['model'],qs['fields'](_0x3fc4c9[_0xfd34('0x2b')][_0xfd34('0x2f')]));_0x230b07['attributes']=_0x230b07[_0xfd34('0x30')][_0xfd34('0x31')]?_0x230b07[_0xfd34('0x30')]:_0x1246e8[_0xfd34('0x2a')];if(_0x3fc4c9[_0xfd34('0x2b')][_0xfd34('0x3e')]){_0x230b07['include']=[{'all':!![]}];}_0x230b07=_[_0xfd34('0x38')]({},_0x230b07,_0x3fc4c9['options']);return db[_0xfd34('0x29')][_0xfd34('0x42')](_0x230b07)['then'](handleEntityNotFound(_0x54fab6,null))[_0xfd34('0x1e')](respondWithResult(_0x54fab6,null))['catch'](handleError(_0x54fab6,null));};exports[_0xfd34('0x43')]=function(_0x27a25a,_0x4de0d4){if(_0x27a25a['body']['id']){delete _0x27a25a[_0xfd34('0x44')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x27a25a[_0xfd34('0x45')]['id']}})[_0xfd34('0x1e')](handleEntityNotFound(_0x4de0d4,null))[_0xfd34('0x1e')](saveUpdates(_0x27a25a[_0xfd34('0x44')],null))['then'](respondWithResult(_0x4de0d4,null))['catch'](handleError(_0x4de0d4,null));};exports[_0xfd34('0x46')]=function(_0x17f024,_0x3fb94e){return db[_0xfd34('0x29')][_0xfd34('0x42')]({'where':{'id':_0x17f024[_0xfd34('0x45')]['id']}})[_0xfd34('0x1e')](handleEntityNotFound(_0x3fb94e,null))[_0xfd34('0x1e')](removeEntity(_0x3fb94e,null))[_0xfd34('0x47')](handleError(_0x3fb94e,null));};exports['create']=function(_0x8ab53,_0x26f14f){var _0x334fd0={'key':_0x8ab53[_0xfd34('0x44')][_0xfd34('0x3a')]};if(_0x8ab53[_0xfd34('0x44')][_0xfd34('0x48')]){_0x334fd0[_0xfd34('0x48')]=_0x8ab53[_0xfd34('0x44')]['MailAccountId'];}else if(_0x8ab53[_0xfd34('0x44')][_0xfd34('0x49')]){_0x334fd0[_0xfd34('0x49')]=_0x8ab53[_0xfd34('0x44')][_0xfd34('0x49')];}else if(_0x8ab53['body']['OpenchannelAccountId']){_0x334fd0[_0xfd34('0x4a')]=_0x8ab53['body']['OpenchannelAccountId'];}else if(_0x8ab53[_0xfd34('0x44')][_0xfd34('0x4b')]){_0x334fd0['ChatWebsiteId']=_0x8ab53[_0xfd34('0x44')][_0xfd34('0x4b')];}return db[_0xfd34('0x29')][_0xfd34('0x42')]({'where':_0x334fd0})[_0xfd34('0x1e')](function(_0x4a5693){if(_0x4a5693){throw new db[(_0xfd34('0x4c'))]['ValidationError'](_0xfd34('0x4d'));}return db[_0xfd34('0x29')][_0xfd34('0x4e')](_0x8ab53[_0xfd34('0x44')]);})['then'](function(_0x5aee89){var _0x3de1f7=_0x8ab53[_0xfd34('0x4f')][_0xfd34('0x1f')]({'plain':!![]});if(!_0x3de1f7)throw new Error(_0xfd34('0x50'));if(_0x3de1f7[_0xfd34('0x51')]===_0xfd34('0x4f')){var _0x5b53fe=_0x5aee89[_0xfd34('0x1f')]({'plain':!![]});return db['UserProfileSection'][_0xfd34('0x42')]({'where':{'name':_0xfd34('0x20'),'userProfileId':_0x3de1f7[_0xfd34('0x52')]},'raw':!![]})[_0xfd34('0x1e')](function(_0x9a982d){if(_0x9a982d&&_0x9a982d[_0xfd34('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b53fe['name'],'resourceId':_0x5b53fe['id'],'type':_0x9a982d[_0xfd34('0x26')],'sectionId':_0x9a982d['id']},{})[_0xfd34('0x1e')](function(){return _0x5aee89;});}else{return _0x5aee89;}})[_0xfd34('0x47')](function(_0x481358){logger['error'](_0xfd34('0x54'),_0x481358);throw _0x481358;});}return _0x5aee89;})[_0xfd34('0x1e')](respondWithResult(_0x26f14f,0xc9))[_0xfd34('0x47')](handleError(_0x26f14f,null));}; \ No newline at end of file +var _0xe2a6=['where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','status','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','index','CannedAnswer','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort'];(function(_0x18fa01,_0x816ebf){var _0x21dc03=function(_0x3a1aaf){while(--_0x3a1aaf){_0x18fa01['push'](_0x18fa01['shift']());}};_0x21dc03(++_0x816ebf);}(_0xe2a6,0x121));var _0x6e2a=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xe2a6[_0x259d17];return _0x407535;};'use strict';var pdf=require(_0x6e2a('0x0'));var emlformat=require(_0x6e2a('0x1'));var rimraf=require(_0x6e2a('0x2'));var zipdir=require(_0x6e2a('0x3'));var jsonpatch=require(_0x6e2a('0x4'));var rp=require('request-promise');var moment=require(_0x6e2a('0x5'));var BPromise=require(_0x6e2a('0x6'));var Mustache=require(_0x6e2a('0x7'));var util=require(_0x6e2a('0x8'));var path=require(_0x6e2a('0x9'));var sox=require('sox');var csv=require(_0x6e2a('0xa'));var ejs=require(_0x6e2a('0xb'));var fs=require('fs');var _=require(_0x6e2a('0xc'));var squel=require(_0x6e2a('0xd'));var crypto=require(_0x6e2a('0xe'));var jsforce=require(_0x6e2a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6e2a('0xa'));var querystring=require('querystring');var Papa=require(_0x6e2a('0x10'));var Redis=require(_0x6e2a('0x11'));var authService=require(_0x6e2a('0x12'));var qs=require(_0x6e2a('0x13'));var hardwareService=require(_0x6e2a('0x14'));var logger=require('../../config/logger')(_0x6e2a('0x15'));var utils=require(_0x6e2a('0x16'));var config=require('../../config/environment');var db=require(_0x6e2a('0x17'))['db'];function respondWithStatusCode(_0x119868,_0x3b6645){_0x3b6645=_0x3b6645||0xcc;return function(_0x5bb053){if(_0x5bb053){return _0x119868[_0x6e2a('0x18')](_0x3b6645);}return _0x119868['status'](_0x3b6645)[_0x6e2a('0x19')]();};}function respondWithResult(_0x46ba56,_0x470534){_0x470534=_0x470534||0xc8;return function(_0x502540){if(_0x502540){return _0x46ba56['status'](_0x470534)[_0x6e2a('0x1a')](_0x502540);}};}function respondWithFilteredResult(_0x865816,_0x137be1){return function(_0x32524a){if(_0x32524a){var _0x293d9b=_0x32524a[_0x6e2a('0x1b')],_0x1ce976=_0x137be1['offset'],_0x2bbe29=_0x137be1['offset']+_0x137be1['limit'],_0x2ce604;if(_0x2bbe29>=_0x293d9b){_0x2bbe29=_0x293d9b;_0x2ce604=0xc8;}else{_0x2ce604=0xce;}_0x865816[_0x6e2a('0x1c')](_0x2ce604);return _0x865816['set']('Content-Range',_0x1ce976+'-'+_0x2bbe29+'/'+_0x293d9b)[_0x6e2a('0x1a')](_0x32524a);}return null;};}function patchUpdates(_0x175989){return function(_0x50bb9c){try{jsonpatch[_0x6e2a('0x1d')](_0x50bb9c,_0x175989,!![]);}catch(_0x3ec586){return BPromise['reject'](_0x3ec586);}return _0x50bb9c[_0x6e2a('0x1e')]();};}function saveUpdates(_0x5dfb18,_0x591e33){return function(_0x3a1017){if(_0x3a1017){return _0x3a1017[_0x6e2a('0x1f')](_0x5dfb18)[_0x6e2a('0x20')](function(_0xee49c8){return _0xee49c8;});}return null;};}function removeEntity(_0x5b51c5,_0x5912dc){return function(_0x3f081c){if(_0x3f081c){return _0x3f081c[_0x6e2a('0x21')]()[_0x6e2a('0x20')](function(){var _0x267b2b=_0x3f081c[_0x6e2a('0x22')]({'plain':!![]});var _0x58d764=_0x6e2a('0x23');return db[_0x6e2a('0x24')][_0x6e2a('0x21')]({'where':{'type':_0x58d764,'resourceId':_0x267b2b['id']}})[_0x6e2a('0x20')](function(){return _0x3f081c;});})[_0x6e2a('0x20')](function(){_0x5b51c5['status'](0xcc)[_0x6e2a('0x19')]();});}};}function handleEntityNotFound(_0x19852e,_0x48b72e){return function(_0x1c3a2b){if(!_0x1c3a2b){_0x19852e[_0x6e2a('0x18')](0x194);}return _0x1c3a2b;};}function handleError(_0x2a99e5,_0x4fdb81){_0x4fdb81=_0x4fdb81||0x1f4;return function(_0x626e96){logger['error'](_0x626e96[_0x6e2a('0x25')]);if(_0x626e96[_0x6e2a('0x26')]){delete _0x626e96[_0x6e2a('0x26')];}_0x2a99e5[_0x6e2a('0x1c')](_0x4fdb81)['send'](_0x626e96);};}exports[_0x6e2a('0x27')]=function(_0x1ca439,_0x35b1b9){var _0x2a3cb6={},_0xab622c={},_0x169d75={'count':0x0,'rows':[]};var _0x5e95dd=db[_0x6e2a('0x28')]['rawAttributes'];_0xab622c[_0x6e2a('0x29')]=_[_0x6e2a('0x2a')](_0x5e95dd);_0xab622c[_0x6e2a('0x2b')]=_[_0x6e2a('0x2a')](_0x1ca439['query']);_0xab622c[_0x6e2a('0x2c')]=_[_0x6e2a('0x2d')](_0xab622c[_0x6e2a('0x29')],_0xab622c['query']);_0x2a3cb6[_0x6e2a('0x2e')]=_['intersection'](_0xab622c[_0x6e2a('0x29')],qs[_0x6e2a('0x2f')](_0x1ca439[_0x6e2a('0x2b')][_0x6e2a('0x2f')]));_0x2a3cb6[_0x6e2a('0x2e')]=_0x2a3cb6[_0x6e2a('0x2e')][_0x6e2a('0x30')]?_0x2a3cb6['attributes']:_0xab622c['model'];if(!_0x1ca439[_0x6e2a('0x2b')][_0x6e2a('0x31')](_0x6e2a('0x32'))){_0x2a3cb6[_0x6e2a('0x33')]=qs[_0x6e2a('0x33')](_0x1ca439[_0x6e2a('0x2b')]['limit']);_0x2a3cb6[_0x6e2a('0x34')]=qs[_0x6e2a('0x34')](_0x1ca439[_0x6e2a('0x2b')][_0x6e2a('0x34')]);}_0x2a3cb6[_0x6e2a('0x35')]=qs[_0x6e2a('0x36')](_0x1ca439['query'][_0x6e2a('0x36')]);_0x2a3cb6[_0x6e2a('0x37')]=qs[_0x6e2a('0x2c')](_[_0x6e2a('0x38')](_0x1ca439['query'],_0xab622c[_0x6e2a('0x2c')]));if(_0x1ca439[_0x6e2a('0x2b')][_0x6e2a('0x39')]){_0x2a3cb6['where']=_[_0x6e2a('0x3a')](_0x2a3cb6[_0x6e2a('0x37')],{'$or':_['map'](_0x5e95dd,function(_0x20a980){if(_0x20a980[_0x6e2a('0x3b')][_0x6e2a('0x3c')]!==_0x6e2a('0x3d')){var _0x55b604={};_0x55b604[_0x20a980[_0x6e2a('0x3e')]]={'$like':'%'+_0x1ca439[_0x6e2a('0x2b')]['filter']+'%'};return _0x55b604;}})});}_0x2a3cb6=_['merge']({},_0x2a3cb6,_0x1ca439[_0x6e2a('0x3f')]);var _0x2f2a82={'where':_0x2a3cb6[_0x6e2a('0x37')]};return db[_0x6e2a('0x28')][_0x6e2a('0x1b')](_0x2f2a82)[_0x6e2a('0x20')](function(_0x4266ca){_0x169d75['count']=_0x4266ca;if(_0x1ca439['query'][_0x6e2a('0x40')]){_0x2a3cb6[_0x6e2a('0x41')]=[{'all':!![]}];}return db[_0x6e2a('0x28')][_0x6e2a('0x42')](_0x2a3cb6);})[_0x6e2a('0x20')](function(_0x58841b){_0x169d75[_0x6e2a('0x43')]=_0x58841b;return _0x169d75;})[_0x6e2a('0x20')](respondWithFilteredResult(_0x35b1b9,_0x2a3cb6))[_0x6e2a('0x44')](handleError(_0x35b1b9,null));};exports[_0x6e2a('0x45')]=function(_0x26f197,_0x48713c){var _0x19a74c={'raw':!![],'where':{'id':_0x26f197[_0x6e2a('0x46')]['id']}},_0x539284={};_0x539284[_0x6e2a('0x29')]=_[_0x6e2a('0x2a')](db[_0x6e2a('0x28')][_0x6e2a('0x47')]);_0x539284[_0x6e2a('0x2b')]=_[_0x6e2a('0x2a')](_0x26f197[_0x6e2a('0x2b')]);_0x539284[_0x6e2a('0x2c')]=_[_0x6e2a('0x2d')](_0x539284['model'],_0x539284[_0x6e2a('0x2b')]);_0x19a74c[_0x6e2a('0x2e')]=_[_0x6e2a('0x2d')](_0x539284[_0x6e2a('0x29')],qs[_0x6e2a('0x2f')](_0x26f197[_0x6e2a('0x2b')]['fields']));_0x19a74c[_0x6e2a('0x2e')]=_0x19a74c[_0x6e2a('0x2e')][_0x6e2a('0x30')]?_0x19a74c[_0x6e2a('0x2e')]:_0x539284[_0x6e2a('0x29')];if(_0x26f197[_0x6e2a('0x2b')][_0x6e2a('0x40')]){_0x19a74c[_0x6e2a('0x41')]=[{'all':!![]}];}_0x19a74c=_[_0x6e2a('0x3a')]({},_0x19a74c,_0x26f197['options']);return db[_0x6e2a('0x28')]['find'](_0x19a74c)[_0x6e2a('0x20')](handleEntityNotFound(_0x48713c,null))[_0x6e2a('0x20')](respondWithResult(_0x48713c,null))[_0x6e2a('0x44')](handleError(_0x48713c,null));};exports[_0x6e2a('0x1f')]=function(_0x1dc122,_0x4c17d5){if(_0x1dc122[_0x6e2a('0x48')]['id']){delete _0x1dc122[_0x6e2a('0x48')]['id'];}return db[_0x6e2a('0x28')][_0x6e2a('0x49')]({'where':{'id':_0x1dc122[_0x6e2a('0x46')]['id']}})[_0x6e2a('0x20')](handleEntityNotFound(_0x4c17d5,null))[_0x6e2a('0x20')](saveUpdates(_0x1dc122[_0x6e2a('0x48')],null))['then'](respondWithResult(_0x4c17d5,null))[_0x6e2a('0x44')](handleError(_0x4c17d5,null));};exports['destroy']=function(_0x3f1b7e,_0x1d127b){return db[_0x6e2a('0x28')]['find']({'where':{'id':_0x3f1b7e[_0x6e2a('0x46')]['id']}})[_0x6e2a('0x20')](handleEntityNotFound(_0x1d127b,null))[_0x6e2a('0x20')](removeEntity(_0x1d127b,null))[_0x6e2a('0x44')](handleError(_0x1d127b,null));};exports[_0x6e2a('0x4a')]=function(_0x226767,_0x5551d5){var _0x205b9e={'key':_0x226767[_0x6e2a('0x48')][_0x6e2a('0x3c')]};if(_0x226767[_0x6e2a('0x48')]['MailAccountId']){_0x205b9e[_0x6e2a('0x4b')]=_0x226767['body'][_0x6e2a('0x4b')];}else if(_0x226767[_0x6e2a('0x48')][_0x6e2a('0x4c')]){_0x205b9e['SmsAccountId']=_0x226767['body'][_0x6e2a('0x4c')];}else if(_0x226767[_0x6e2a('0x48')]['OpenchannelAccountId']){_0x205b9e[_0x6e2a('0x4d')]=_0x226767['body'][_0x6e2a('0x4d')];}else if(_0x226767[_0x6e2a('0x48')]['ChatWebsiteId']){_0x205b9e[_0x6e2a('0x4e')]=_0x226767[_0x6e2a('0x48')][_0x6e2a('0x4e')];}return db[_0x6e2a('0x28')][_0x6e2a('0x49')]({'where':_0x205b9e})['then'](function(_0x49883a){if(_0x49883a){throw new db[(_0x6e2a('0x4f'))][(_0x6e2a('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x6e2a('0x28')][_0x6e2a('0x4a')](_0x226767[_0x6e2a('0x48')]);})[_0x6e2a('0x20')](function(_0x449ab2){var _0x5133dd=_0x226767['user']['get']({'plain':!![]});if(!_0x5133dd)throw new Error(_0x6e2a('0x51'));if(_0x5133dd[_0x6e2a('0x52')]===_0x6e2a('0x53')){var _0x287e81=_0x449ab2[_0x6e2a('0x22')]({'plain':!![]});return db[_0x6e2a('0x54')][_0x6e2a('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x5133dd['userProfileId']},'raw':!![]})['then'](function(_0x46d7ec){if(_0x46d7ec&&_0x46d7ec[_0x6e2a('0x55')]===0x0){return db[_0x6e2a('0x24')][_0x6e2a('0x4a')]({'name':_0x287e81['name'],'resourceId':_0x287e81['id'],'type':_0x46d7ec[_0x6e2a('0x26')],'sectionId':_0x46d7ec['id']},{})[_0x6e2a('0x20')](function(){return _0x449ab2;});}else{return _0x449ab2;}})['catch'](function(_0x1e4b20){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e4b20);throw _0x1e4b20;});}return _0x449ab2;})[_0x6e2a('0x20')](respondWithResult(_0x5551d5,0xc9))['catch'](handleError(_0x5551d5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ac13daa..99f2482 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 _0xb7dc=['api','request-promise','path','../../config/environment','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2e368a,_0x331e64){var _0xbe1265=function(_0x3a07b0){while(--_0x3a07b0){_0x2e368a['push'](_0x2e368a['shift']());}};_0xbe1265(++_0x331e64);}(_0xb7dc,0xf9));var _0xcb7d=function(_0x3e6962,_0x42199e){_0x3e6962=_0x3e6962-0x0;var _0x37608a=_0xb7dc[_0x3e6962];return _0x37608a;};'use strict';var _=require(_0xcb7d('0x0'));var util=require(_0xcb7d('0x1'));var logger=require(_0xcb7d('0x2'))(_0xcb7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb7d('0x4'));var fs=require('fs');var path=require(_0xcb7d('0x5'));var rimraf=require('rimraf');var config=require(_0xcb7d('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xcb7d('0x7')]=function(_0x4807a0,_0x163cdf){return _0x4807a0[_0xcb7d('0x8')](_0xcb7d('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb7d('0xa'),'collate':_0xcb7d('0xb')});}; \ No newline at end of file +var _0x9365=['path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16f3e3,_0x14015f){var _0x4908e9=function(_0x5d0399){while(--_0x5d0399){_0x16f3e3['push'](_0x16f3e3['shift']());}};_0x4908e9(++_0x14015f);}(_0x9365,0xda));var _0x5936=function(_0x28b1e5,_0x48d3a9){_0x28b1e5=_0x28b1e5-0x0;var _0x5cc014=_0x9365[_0x28b1e5];return _0x5cc014;};'use strict';var _=require(_0x5936('0x0'));var util=require(_0x5936('0x1'));var logger=require(_0x5936('0x2'))(_0x5936('0x3'));var moment=require(_0x5936('0x4'));var BPromise=require(_0x5936('0x5'));var rp=require(_0x5936('0x6'));var fs=require('fs');var path=require(_0x5936('0x7'));var rimraf=require(_0x5936('0x8'));var config=require('../../config/environment');var attributes=require(_0x5936('0x9'));module[_0x5936('0xa')]=function(_0x19a97b,_0x17364e){return _0x19a97b[_0x5936('0xb')](_0x5936('0xc'),attributes,{'tableName':_0x5936('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5936('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ed80790..40bafa1 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 _0x9ed0=['debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CannedAnswer,\x20%s,\x20%s','request\x20sent'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x9ed0,0xaf));var _0x09ed=function(_0x513eca,_0x593007){_0x513eca=_0x513eca-0x0;var _0x2c4e0b=_0x9ed0[_0x513eca];return _0x2c4e0b;};'use strict';var _=require('lodash');var util=require(_0x09ed('0x0'));var moment=require('moment');var BPromise=require(_0x09ed('0x1'));var rs=require(_0x09ed('0x2'));var fs=require('fs');var Redis=require(_0x09ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09ed('0x4'));var logger=require(_0x09ed('0x5'))(_0x09ed('0x6'));var config=require(_0x09ed('0x7'));var jayson=require(_0x09ed('0x8'));var client=jayson[_0x09ed('0x9')][_0x09ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x869930,_0x37774f,_0xd17a93){return new BPromise(function(_0xf2a883,_0x377995){return client['request'](_0x869930,_0xd17a93)[_0x09ed('0xb')](function(_0x22f90f){logger['info'](_0x09ed('0xc'),_0x37774f,_0x09ed('0xd'));logger[_0x09ed('0xe')](_0x09ed('0xf'),_0x37774f,_0x09ed('0xd'),JSON[_0x09ed('0x10')](_0x22f90f));if(_0x22f90f[_0x09ed('0x11')]){if(_0x22f90f[_0x09ed('0x11')][_0x09ed('0x12')]===0x1f4){logger[_0x09ed('0x11')](_0x09ed('0xc'),_0x37774f,_0x22f90f['error'][_0x09ed('0x13')]);return _0x377995(_0x22f90f[_0x09ed('0x11')][_0x09ed('0x13')]);}logger[_0x09ed('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x37774f,_0x22f90f[_0x09ed('0x11')][_0x09ed('0x13')]);return _0xf2a883(_0x22f90f[_0x09ed('0x11')][_0x09ed('0x13')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x37774f,_0x09ed('0xd'));_0xf2a883(_0x22f90f['result'][_0x09ed('0x13')]);}})[_0x09ed('0x14')](function(_0x5e81c1){logger[_0x09ed('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x37774f,_0x5e81c1);_0x377995(_0x5e81c1);});});} \ No newline at end of file +var _0xabd2=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xabd2,0x9b));var _0x2abd=function(_0x1c12d,_0x5d7c18){_0x1c12d=_0x1c12d-0x0;var _0x5b3cc6=_0xabd2[_0x1c12d];return _0x5b3cc6;};'use strict';var _=require('lodash');var util=require(_0x2abd('0x0'));var moment=require(_0x2abd('0x1'));var BPromise=require(_0x2abd('0x2'));var rs=require(_0x2abd('0x3'));var fs=require('fs');var Redis=require(_0x2abd('0x4'));var db=require(_0x2abd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2abd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2abd('0x7')][_0x2abd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b7af,_0x1d4a4e,_0x1410f0){return new BPromise(function(_0x265103,_0x2d4391){return client[_0x2abd('0x9')](_0x29b7af,_0x1410f0)[_0x2abd('0xa')](function(_0x4a9ba0){logger[_0x2abd('0xb')](_0x2abd('0xc'),_0x1d4a4e,_0x2abd('0xd'));logger[_0x2abd('0xe')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x1d4a4e,'request\x20sent',JSON[_0x2abd('0xf')](_0x4a9ba0));if(_0x4a9ba0['error']){if(_0x4a9ba0[_0x2abd('0x10')][_0x2abd('0x11')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x1d4a4e,_0x4a9ba0['error'][_0x2abd('0x12')]);return _0x2d4391(_0x4a9ba0[_0x2abd('0x10')][_0x2abd('0x12')]);}logger[_0x2abd('0x10')](_0x2abd('0xc'),_0x1d4a4e,_0x4a9ba0[_0x2abd('0x10')][_0x2abd('0x12')]);return _0x265103(_0x4a9ba0[_0x2abd('0x10')][_0x2abd('0x12')]);}else{logger[_0x2abd('0xb')](_0x2abd('0xc'),_0x1d4a4e,_0x2abd('0xd'));_0x265103(_0x4a9ba0[_0x2abd('0x13')][_0x2abd('0x12')]);}})[_0x2abd('0x14')](function(_0x248699){logger[_0x2abd('0x10')](_0x2abd('0xc'),_0x1d4a4e,_0x248699);_0x2d4391(_0x248699);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index f560cc5..47f1a1d 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 _0x4fce=['show','post','create','put','/:id','update','exports','connect-timeout','express','Router','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x5145ba,_0x3c6ae0){var _0x4d3d20=function(_0x591593){while(--_0x591593){_0x5145ba['push'](_0x5145ba['shift']());}};_0x4d3d20(++_0x3c6ae0);}(_0x4fce,0x1e7));var _0xe4fc=function(_0xf394d3,_0x4271dc){_0xf394d3=_0xf394d3-0x0;var _0x51462b=_0x4fce[_0xf394d3];return _0x51462b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe4fc('0x0'));var express=require(_0xe4fc('0x1'));var router=express[_0xe4fc('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe4fc('0x3'));var controller=require(_0xe4fc('0x4'));router[_0xe4fc('0x5')]('/',auth[_0xe4fc('0x6')](),controller[_0xe4fc('0x7')]);router[_0xe4fc('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xe4fc('0x8')]);router[_0xe4fc('0x9')]('/',auth[_0xe4fc('0x6')](),controller[_0xe4fc('0xa')]);router[_0xe4fc('0xb')](_0xe4fc('0xc'),auth['isAuthenticated'](),controller[_0xe4fc('0xd')]);router['delete'](_0xe4fc('0xc'),auth[_0xe4fc('0x6')](),controller['destroy']);module[_0xe4fc('0xe')]=router; \ No newline at end of file +var _0xbf7f=['create','put','/:id','update','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post'];(function(_0x2ebf56,_0x45b68f){var _0x1d6a94=function(_0x46f2d9){while(--_0x46f2d9){_0x2ebf56['push'](_0x2ebf56['shift']());}};_0x1d6a94(++_0x45b68f);}(_0xbf7f,0x1b5));var _0xfbf7=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xbf7f[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xfbf7('0x0'));var util=require(_0xfbf7('0x1'));var path=require(_0xfbf7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfbf7('0x3')]();var auth=require(_0xfbf7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbf7('0x5'));var controller=require(_0xfbf7('0x6'));router[_0xfbf7('0x7')]('/',auth[_0xfbf7('0x8')](),controller[_0xfbf7('0x9')]);router[_0xfbf7('0x7')]('/:id',auth[_0xfbf7('0x8')](),controller['show']);router[_0xfbf7('0xa')]('/',auth[_0xfbf7('0x8')](),controller[_0xfbf7('0xb')]);router[_0xfbf7('0xc')](_0xfbf7('0xd'),auth[_0xfbf7('0x8')](),controller[_0xfbf7('0xe')]);router['delete'](_0xfbf7('0xd'),auth[_0xfbf7('0x8')](),controller['destroy']);module[_0xfbf7('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 5b60edb..dd6a19c 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 _0x1855=['INTEGER','sequelize','STRING'];(function(_0x4f4aeb,_0x1bd8ec){var _0x5a2f2a=function(_0x2ff6c0){while(--_0x2ff6c0){_0x4f4aeb['push'](_0x4f4aeb['shift']());}};_0x5a2f2a(++_0x1bd8ec);}(_0x1855,0xe8));var _0x5185=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x1855[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0x5185('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5185('0x1')]},'dst':{'type':Sequelize[_0x5185('0x1')]},'dcontext':{'type':Sequelize[_0x5185('0x1')]},'channel':{'type':Sequelize[_0x5185('0x1')]},'dstchannel':{'type':Sequelize[_0x5185('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5185('0x1')]},'duration':{'type':Sequelize[_0x5185('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5185('0x1')]},'amaflags':{'type':Sequelize[_0x5185('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5185('0x1')]},'userfield':{'type':Sequelize[_0x5185('0x1')]},'uniqueid':{'type':Sequelize[_0x5185('0x1')]},'linkedid':{'type':Sequelize[_0x5185('0x1')]},'sequence':{'type':Sequelize[_0x5185('0x1')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5185('0x1')]},'tag':{'type':Sequelize[_0x5185('0x1')]}}; \ No newline at end of file +var _0x66dd=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x55a14b,_0x2d18a1){var _0x508738=function(_0x2072b9){while(--_0x2072b9){_0x55a14b['push'](_0x55a14b['shift']());}};_0x508738(++_0x2d18a1);}(_0x66dd,0x105));var _0xd66d=function(_0x35d8b5,_0x256eea){_0x35d8b5=_0x35d8b5-0x0;var _0x17f0c9=_0x66dd[_0x35d8b5];return _0x17f0c9;};'use strict';var Sequelize=require(_0xd66d('0x0'));module[_0xd66d('0x1')]={'calldate':{'type':Sequelize[_0xd66d('0x2')],'allowNull':![],'defaultValue':_0xd66d('0x3')},'clid':{'type':Sequelize[_0xd66d('0x4')]},'src':{'type':Sequelize[_0xd66d('0x4')]},'dst':{'type':Sequelize[_0xd66d('0x4')]},'dcontext':{'type':Sequelize[_0xd66d('0x4')]},'channel':{'type':Sequelize[_0xd66d('0x4')]},'dstchannel':{'type':Sequelize[_0xd66d('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd66d('0x4')]},'duration':{'type':Sequelize[_0xd66d('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd66d('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd66d('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd66d('0x4')]},'userfield':{'type':Sequelize[_0xd66d('0x4')]},'uniqueid':{'type':Sequelize[_0xd66d('0x4')]},'linkedid':{'type':Sequelize[_0xd66d('0x4')]},'sequence':{'type':Sequelize[_0xd66d('0x4')]},'peeraccount':{'type':Sequelize[_0xd66d('0x4')]},'type':{'type':Sequelize[_0xd66d('0x4')]},'tag':{'type':Sequelize[_0xd66d('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a8eb337..be1e1ab 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 _0x9285=['status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','Cdr','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','key','field','options','count','include','findAll','rows','catch','params','includeAll','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x55b780,_0x5d51e2){var _0x4d8e8e=function(_0x9f82b){while(--_0x9f82b){_0x55b780['push'](_0x55b780['shift']());}};_0x4d8e8e(++_0x5d51e2);}(_0x9285,0x197));var _0x5928=function(_0x24bd54,_0x40804a){_0x24bd54=_0x24bd54-0x0;var _0x5e3ae6=_0x9285[_0x24bd54];return _0x5e3ae6;};'use strict';var pdf=require(_0x5928('0x0'));var emlformat=require(_0x5928('0x1'));var rimraf=require(_0x5928('0x2'));var zipdir=require(_0x5928('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5928('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5928('0x5'));var util=require(_0x5928('0x6'));var path=require(_0x5928('0x7'));var sox=require(_0x5928('0x8'));var csv=require(_0x5928('0x9'));var ejs=require(_0x5928('0xa'));var fs=require('fs');var _=require(_0x5928('0xb'));var squel=require(_0x5928('0xc'));var crypto=require('crypto');var jsforce=require(_0x5928('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5928('0xe'));var Papa=require(_0x5928('0xf'));var Redis=require(_0x5928('0x10'));var authService=require(_0x5928('0x11'));var qs=require(_0x5928('0x12'));var hardwareService=require(_0x5928('0x13'));var logger=require(_0x5928('0x14'))(_0x5928('0x15'));var utils=require(_0x5928('0x16'));var config=require(_0x5928('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fa726,_0xdcc5ad){_0xdcc5ad=_0xdcc5ad||0xcc;return function(_0x556a1e){if(_0x556a1e){return _0x4fa726[_0x5928('0x18')](_0xdcc5ad);}return _0x4fa726[_0x5928('0x19')](_0xdcc5ad)[_0x5928('0x1a')]();};}function respondWithResult(_0x5181cf,_0x48b59a){_0x48b59a=_0x48b59a||0xc8;return function(_0x5942b3){if(_0x5942b3){return _0x5181cf[_0x5928('0x19')](_0x48b59a)[_0x5928('0x1b')](_0x5942b3);}};}function respondWithFilteredResult(_0x5443a4,_0x303f41){return function(_0x156362){if(_0x156362){var _0x4164d2=_0x156362['count'],_0x15475a=_0x303f41[_0x5928('0x1c')],_0x1a2100=_0x303f41['offset']+_0x303f41[_0x5928('0x1d')],_0x2e88a8;if(_0x1a2100>=_0x4164d2){_0x1a2100=_0x4164d2;_0x2e88a8=0xc8;}else{_0x2e88a8=0xce;}_0x5443a4[_0x5928('0x19')](_0x2e88a8);return _0x5443a4[_0x5928('0x1e')](_0x5928('0x1f'),_0x15475a+'-'+_0x1a2100+'/'+_0x4164d2)[_0x5928('0x1b')](_0x156362);}return null;};}function patchUpdates(_0x16421c){return function(_0x1980a9){try{jsonpatch[_0x5928('0x20')](_0x1980a9,_0x16421c,!![]);}catch(_0x3e7287){return BPromise[_0x5928('0x21')](_0x3e7287);}return _0x1980a9['save']();};}function saveUpdates(_0x544f1b,_0x3184f9){return function(_0x1e7e96){if(_0x1e7e96){return _0x1e7e96[_0x5928('0x22')](_0x544f1b)[_0x5928('0x23')](function(_0x3251a7){return _0x3251a7;});}return null;};}function removeEntity(_0x5144f1,_0x1307bd){return function(_0x1725c1){if(_0x1725c1){return _0x1725c1['destroy']()[_0x5928('0x23')](function(){_0x5144f1[_0x5928('0x19')](0xcc)[_0x5928('0x1a')]();});}};}function handleEntityNotFound(_0x2ece3b,_0x5a7179){return function(_0x39d508){if(!_0x39d508){_0x2ece3b[_0x5928('0x18')](0x194);}return _0x39d508;};}function handleError(_0x571a9c,_0x3427c4){_0x3427c4=_0x3427c4||0x1f4;return function(_0x2267ea){logger[_0x5928('0x24')](_0x2267ea[_0x5928('0x25')]);if(_0x2267ea['name']){delete _0x2267ea[_0x5928('0x26')];}_0x571a9c[_0x5928('0x19')](_0x3427c4)[_0x5928('0x27')](_0x2267ea);};}exports['index']=function(_0x5a42cd,_0x4f6cfc){var _0x1c7a9d={},_0x496a65={},_0x5c1b3d={'count':0x0,'rows':[]};var _0x4c5dfe=db[_0x5928('0x28')][_0x5928('0x29')];_0x496a65[_0x5928('0x2a')]=_['keys'](_0x4c5dfe);_0x496a65[_0x5928('0x2b')]=_[_0x5928('0x2c')](_0x5a42cd[_0x5928('0x2b')]);_0x496a65[_0x5928('0x2d')]=_[_0x5928('0x2e')](_0x496a65[_0x5928('0x2a')],_0x496a65[_0x5928('0x2b')]);_0x1c7a9d[_0x5928('0x2f')]=_['intersection'](_0x496a65[_0x5928('0x2a')],qs[_0x5928('0x30')](_0x5a42cd['query'][_0x5928('0x30')]));_0x1c7a9d['attributes']=_0x1c7a9d[_0x5928('0x2f')][_0x5928('0x31')]?_0x1c7a9d[_0x5928('0x2f')]:_0x496a65[_0x5928('0x2a')];if(!_0x5a42cd[_0x5928('0x2b')]['hasOwnProperty'](_0x5928('0x32'))){_0x1c7a9d['limit']=qs[_0x5928('0x1d')](_0x5a42cd[_0x5928('0x2b')]['limit']);_0x1c7a9d[_0x5928('0x1c')]=qs['offset'](_0x5a42cd['query'][_0x5928('0x1c')]);}_0x1c7a9d[_0x5928('0x33')]=qs[_0x5928('0x34')](_0x5a42cd['query'][_0x5928('0x34')]);_0x1c7a9d[_0x5928('0x35')]=qs['filters'](_['pick'](_0x5a42cd[_0x5928('0x2b')],_0x496a65[_0x5928('0x2d')]));if(_0x5a42cd[_0x5928('0x2b')][_0x5928('0x36')]){_0x1c7a9d['where']=_[_0x5928('0x37')](_0x1c7a9d['where'],{'$or':_[_0x5928('0x38')](_0x4c5dfe,function(_0x405ce9){if(_0x405ce9['type'][_0x5928('0x39')]!=='VIRTUAL'){var _0x29725e={};_0x29725e[_0x405ce9[_0x5928('0x3a')]]={'$like':'%'+_0x5a42cd['query'][_0x5928('0x36')]+'%'};return _0x29725e;}})});}_0x1c7a9d=_['merge']({},_0x1c7a9d,_0x5a42cd[_0x5928('0x3b')]);var _0x19eda0={'where':_0x1c7a9d['where']};return db[_0x5928('0x28')]['count'](_0x19eda0)['then'](function(_0x3414a4){_0x5c1b3d[_0x5928('0x3c')]=_0x3414a4;if(_0x5a42cd[_0x5928('0x2b')]['includeAll']){_0x1c7a9d[_0x5928('0x3d')]=[{'all':!![]}];}return db[_0x5928('0x28')][_0x5928('0x3e')](_0x1c7a9d);})['then'](function(_0x4d87a7){_0x5c1b3d[_0x5928('0x3f')]=_0x4d87a7;return _0x5c1b3d;})[_0x5928('0x23')](respondWithFilteredResult(_0x4f6cfc,_0x1c7a9d))[_0x5928('0x40')](handleError(_0x4f6cfc,null));};exports['show']=function(_0x4abe21,_0x518ee3){var _0x3b057f={'raw':!![],'where':{'id':_0x4abe21[_0x5928('0x41')]['id']}},_0x2ac764={};_0x2ac764['model']=_[_0x5928('0x2c')](db[_0x5928('0x28')][_0x5928('0x29')]);_0x2ac764['query']=_[_0x5928('0x2c')](_0x4abe21[_0x5928('0x2b')]);_0x2ac764[_0x5928('0x2d')]=_[_0x5928('0x2e')](_0x2ac764[_0x5928('0x2a')],_0x2ac764['query']);_0x3b057f[_0x5928('0x2f')]=_[_0x5928('0x2e')](_0x2ac764[_0x5928('0x2a')],qs['fields'](_0x4abe21[_0x5928('0x2b')]['fields']));_0x3b057f[_0x5928('0x2f')]=_0x3b057f[_0x5928('0x2f')]['length']?_0x3b057f[_0x5928('0x2f')]:_0x2ac764[_0x5928('0x2a')];if(_0x4abe21['query'][_0x5928('0x42')]){_0x3b057f['include']=[{'all':!![]}];}_0x3b057f=_[_0x5928('0x37')]({},_0x3b057f,_0x4abe21['options']);return db[_0x5928('0x28')]['find'](_0x3b057f)[_0x5928('0x23')](handleEntityNotFound(_0x518ee3,null))[_0x5928('0x23')](respondWithResult(_0x518ee3,null))['catch'](handleError(_0x518ee3,null));};exports['create']=function(_0x173dd9,_0x4e2ebc){return db[_0x5928('0x28')][_0x5928('0x43')](_0x173dd9[_0x5928('0x44')],{})[_0x5928('0x23')](respondWithResult(_0x4e2ebc,0xc9))[_0x5928('0x40')](handleError(_0x4e2ebc,null));};exports[_0x5928('0x22')]=function(_0x51154e,_0x3bdc5d){if(_0x51154e[_0x5928('0x44')]['id']){delete _0x51154e[_0x5928('0x44')]['id'];}return db[_0x5928('0x28')][_0x5928('0x45')]({'where':{'id':_0x51154e[_0x5928('0x41')]['id']}})['then'](handleEntityNotFound(_0x3bdc5d,null))[_0x5928('0x23')](saveUpdates(_0x51154e[_0x5928('0x44')],null))[_0x5928('0x23')](respondWithResult(_0x3bdc5d,null))[_0x5928('0x40')](handleError(_0x3bdc5d,null));};exports[_0x5928('0x46')]=function(_0x5e6388,_0x2729f0){return db['Cdr'][_0x5928('0x45')]({'where':{'id':_0x5e6388[_0x5928('0x41')]['id']}})['then'](handleEntityNotFound(_0x2729f0,null))[_0x5928('0x23')](removeEntity(_0x2729f0,null))[_0x5928('0x40')](handleError(_0x2729f0,null));};exports[_0x5928('0x47')]=function(_0x3d36bd,_0x286c16){return db[_0x5928('0x28')]['describe']()[_0x5928('0x23')](respondWithResult(_0x286c16,null))[_0x5928('0x40')](handleError(_0x286c16,null));}; \ No newline at end of file +var _0xd124=['offset','limit','set','Content-Range','apply','destroy','error','stack','name','index','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','Cdr','then','count','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','length','options','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0xd124,0x1da));var _0x4d12=function(_0x2bb224,_0x5924e7){_0x2bb224=_0x2bb224-0x0;var _0x226008=_0xd124[_0x2bb224];return _0x226008;};'use strict';var pdf=require(_0x4d12('0x0'));var emlformat=require(_0x4d12('0x1'));var rimraf=require(_0x4d12('0x2'));var zipdir=require(_0x4d12('0x3'));var jsonpatch=require(_0x4d12('0x4'));var rp=require('request-promise');var moment=require(_0x4d12('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d12('0x6'));var util=require(_0x4d12('0x7'));var path=require(_0x4d12('0x8'));var sox=require('sox');var csv=require(_0x4d12('0x9'));var ejs=require(_0x4d12('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4d12('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d12('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4d12('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d12('0xe'))(_0x4d12('0xf'));var utils=require(_0x4d12('0x10'));var config=require(_0x4d12('0x11'));var db=require(_0x4d12('0x12'))['db'];function respondWithStatusCode(_0x2160d1,_0x1745d0){_0x1745d0=_0x1745d0||0xcc;return function(_0x3b081e){if(_0x3b081e){return _0x2160d1[_0x4d12('0x13')](_0x1745d0);}return _0x2160d1[_0x4d12('0x14')](_0x1745d0)[_0x4d12('0x15')]();};}function respondWithResult(_0x105fa8,_0x536251){_0x536251=_0x536251||0xc8;return function(_0x3c2910){if(_0x3c2910){return _0x105fa8[_0x4d12('0x14')](_0x536251)[_0x4d12('0x16')](_0x3c2910);}};}function respondWithFilteredResult(_0x3fa4fb,_0x29b3cf){return function(_0x42188d){if(_0x42188d){var _0x2dc545=_0x42188d['count'],_0x1657d4=_0x29b3cf['offset'],_0x162efd=_0x29b3cf[_0x4d12('0x17')]+_0x29b3cf[_0x4d12('0x18')],_0x3929a0;if(_0x162efd>=_0x2dc545){_0x162efd=_0x2dc545;_0x3929a0=0xc8;}else{_0x3929a0=0xce;}_0x3fa4fb[_0x4d12('0x14')](_0x3929a0);return _0x3fa4fb[_0x4d12('0x19')](_0x4d12('0x1a'),_0x1657d4+'-'+_0x162efd+'/'+_0x2dc545)['json'](_0x42188d);}return null;};}function patchUpdates(_0x1a7323){return function(_0x4830dc){try{jsonpatch[_0x4d12('0x1b')](_0x4830dc,_0x1a7323,!![]);}catch(_0x582ae8){return BPromise['reject'](_0x582ae8);}return _0x4830dc['save']();};}function saveUpdates(_0x41cd29,_0x1504b1){return function(_0x47c03c){if(_0x47c03c){return _0x47c03c['update'](_0x41cd29)['then'](function(_0x4a74c5){return _0x4a74c5;});}return null;};}function removeEntity(_0x2b8d6f,_0x2aa920){return function(_0x3a50ab){if(_0x3a50ab){return _0x3a50ab[_0x4d12('0x1c')]()['then'](function(){_0x2b8d6f[_0x4d12('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9696,_0x6b262c){return function(_0x248027){if(!_0x248027){_0x5c9696[_0x4d12('0x13')](0x194);}return _0x248027;};}function handleError(_0x1b32ca,_0x170f0d){_0x170f0d=_0x170f0d||0x1f4;return function(_0x530daa){logger[_0x4d12('0x1d')](_0x530daa[_0x4d12('0x1e')]);if(_0x530daa[_0x4d12('0x1f')]){delete _0x530daa[_0x4d12('0x1f')];}_0x1b32ca['status'](_0x170f0d)['send'](_0x530daa);};}exports[_0x4d12('0x20')]=function(_0x46cd1f,_0x2b551a){var _0x208320={},_0x407dbc={},_0x97c692={'count':0x0,'rows':[]};var _0x5478fa=db['Cdr']['rawAttributes'];_0x407dbc[_0x4d12('0x21')]=_[_0x4d12('0x22')](_0x5478fa);_0x407dbc[_0x4d12('0x23')]=_['keys'](_0x46cd1f[_0x4d12('0x23')]);_0x407dbc[_0x4d12('0x24')]=_['intersection'](_0x407dbc[_0x4d12('0x21')],_0x407dbc[_0x4d12('0x23')]);_0x208320[_0x4d12('0x25')]=_['intersection'](_0x407dbc[_0x4d12('0x21')],qs[_0x4d12('0x26')](_0x46cd1f['query']['fields']));_0x208320['attributes']=_0x208320[_0x4d12('0x25')]['length']?_0x208320[_0x4d12('0x25')]:_0x407dbc['model'];if(!_0x46cd1f[_0x4d12('0x23')][_0x4d12('0x27')](_0x4d12('0x28'))){_0x208320['limit']=qs['limit'](_0x46cd1f[_0x4d12('0x23')][_0x4d12('0x18')]);_0x208320[_0x4d12('0x17')]=qs[_0x4d12('0x17')](_0x46cd1f[_0x4d12('0x23')]['offset']);}_0x208320[_0x4d12('0x29')]=qs['sort'](_0x46cd1f[_0x4d12('0x23')][_0x4d12('0x2a')]);_0x208320[_0x4d12('0x2b')]=qs[_0x4d12('0x24')](_[_0x4d12('0x2c')](_0x46cd1f['query'],_0x407dbc['filters']));if(_0x46cd1f[_0x4d12('0x23')][_0x4d12('0x2d')]){_0x208320['where']=_[_0x4d12('0x2e')](_0x208320['where'],{'$or':_[_0x4d12('0x2f')](_0x5478fa,function(_0x543d5c){if(_0x543d5c[_0x4d12('0x30')][_0x4d12('0x31')]!==_0x4d12('0x32')){var _0x194944={};_0x194944[_0x543d5c[_0x4d12('0x33')]]={'$like':'%'+_0x46cd1f['query'][_0x4d12('0x2d')]+'%'};return _0x194944;}})});}_0x208320=_[_0x4d12('0x2e')]({},_0x208320,_0x46cd1f['options']);var _0x3b96bd={'where':_0x208320[_0x4d12('0x2b')]};return db[_0x4d12('0x34')]['count'](_0x3b96bd)[_0x4d12('0x35')](function(_0x4966ed){_0x97c692[_0x4d12('0x36')]=_0x4966ed;if(_0x46cd1f[_0x4d12('0x23')][_0x4d12('0x37')]){_0x208320[_0x4d12('0x38')]=[{'all':!![]}];}return db['Cdr'][_0x4d12('0x39')](_0x208320);})[_0x4d12('0x35')](function(_0x58dca3){_0x97c692[_0x4d12('0x3a')]=_0x58dca3;return _0x97c692;})['then'](respondWithFilteredResult(_0x2b551a,_0x208320))[_0x4d12('0x3b')](handleError(_0x2b551a,null));};exports[_0x4d12('0x3c')]=function(_0x177d80,_0x107415){var _0x40b814={'raw':!![],'where':{'id':_0x177d80['params']['id']}},_0x4bdeed={};_0x4bdeed[_0x4d12('0x21')]=_[_0x4d12('0x22')](db[_0x4d12('0x34')][_0x4d12('0x3d')]);_0x4bdeed[_0x4d12('0x23')]=_[_0x4d12('0x22')](_0x177d80[_0x4d12('0x23')]);_0x4bdeed['filters']=_[_0x4d12('0x3e')](_0x4bdeed['model'],_0x4bdeed[_0x4d12('0x23')]);_0x40b814[_0x4d12('0x25')]=_['intersection'](_0x4bdeed[_0x4d12('0x21')],qs[_0x4d12('0x26')](_0x177d80[_0x4d12('0x23')][_0x4d12('0x26')]));_0x40b814[_0x4d12('0x25')]=_0x40b814[_0x4d12('0x25')][_0x4d12('0x3f')]?_0x40b814['attributes']:_0x4bdeed[_0x4d12('0x21')];if(_0x177d80['query'][_0x4d12('0x37')]){_0x40b814['include']=[{'all':!![]}];}_0x40b814=_['merge']({},_0x40b814,_0x177d80[_0x4d12('0x40')]);return db[_0x4d12('0x34')][_0x4d12('0x41')](_0x40b814)['then'](handleEntityNotFound(_0x107415,null))[_0x4d12('0x35')](respondWithResult(_0x107415,null))[_0x4d12('0x3b')](handleError(_0x107415,null));};exports[_0x4d12('0x42')]=function(_0x97987,_0x1d37f7){return db[_0x4d12('0x34')][_0x4d12('0x42')](_0x97987[_0x4d12('0x43')],{})[_0x4d12('0x35')](respondWithResult(_0x1d37f7,0xc9))['catch'](handleError(_0x1d37f7,null));};exports[_0x4d12('0x44')]=function(_0x154179,_0x597d2b){if(_0x154179[_0x4d12('0x43')]['id']){delete _0x154179[_0x4d12('0x43')]['id'];}return db['Cdr']['find']({'where':{'id':_0x154179[_0x4d12('0x45')]['id']}})[_0x4d12('0x35')](handleEntityNotFound(_0x597d2b,null))[_0x4d12('0x35')](saveUpdates(_0x154179[_0x4d12('0x43')],null))[_0x4d12('0x35')](respondWithResult(_0x597d2b,null))['catch'](handleError(_0x597d2b,null));};exports[_0x4d12('0x1c')]=function(_0x43943f,_0x36c381){return db['Cdr']['find']({'where':{'id':_0x43943f['params']['id']}})[_0x4d12('0x35')](handleEntityNotFound(_0x36c381,null))[_0x4d12('0x35')](removeEntity(_0x36c381,null))[_0x4d12('0x3b')](handleError(_0x36c381,null));};exports[_0x4d12('0x46')]=function(_0x364a47,_0xb2cbf4){return db[_0x4d12('0x34')][_0x4d12('0x46')]()['then'](respondWithResult(_0xb2cbf4,null))[_0x4d12('0x3b')](handleError(_0xb2cbf4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 54baa43..9ab014e 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 _0xcabe=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x118477,_0x1377a2){var _0x4f9580=function(_0x715c09){while(--_0x715c09){_0x118477['push'](_0x118477['shift']());}};_0x4f9580(++_0x1377a2);}(_0xcabe,0x123));var _0xecab=function(_0x1c449a,_0x1322d3){_0x1c449a=_0x1c449a-0x0;var _0x4e53e7=_0xcabe[_0x1c449a];return _0x4e53e7;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xecab('0x1'));var moment=require(_0xecab('0x2'));var BPromise=require(_0xecab('0x3'));var rp=require(_0xecab('0x4'));var fs=require('fs');var path=require(_0xecab('0x5'));var rimraf=require(_0xecab('0x6'));var config=require(_0xecab('0x7'));var attributes=require(_0xecab('0x8'));module[_0xecab('0x9')]=function(_0x5d8af4,_0x594796){return _0x5d8af4[_0xecab('0xa')](_0xecab('0xb'),attributes,{'tableName':_0xecab('0xc'),'paranoid':![],'indexes':[{'name':_0xecab('0xd'),'fields':[_0xecab('0xd')]},{'name':_0xecab('0xe'),'fields':['calldate']},{'name':_0xecab('0xf'),'fields':[_0xecab('0xf')]},{'name':_0xecab('0x10'),'fields':['dst']},{'name':_0xecab('0x11'),'fields':[_0xecab('0x11')]},{'name':'uniqueid','fields':[_0xecab('0x12')]}],'timestamps':![]});}; \ No newline at end of file +var _0xeba7=['define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3cad1a,_0x4a92c5){var _0x4b768d=function(_0x2b9e6f){while(--_0x2b9e6f){_0x3cad1a['push'](_0x3cad1a['shift']());}};_0x4b768d(++_0x4a92c5);}(_0xeba7,0xbd));var _0x7eba=function(_0xfc4f41,_0x1fb6dd){_0xfc4f41=_0xfc4f41-0x0;var _0x2a384d=_0xeba7[_0xfc4f41];return _0x2a384d;};'use strict';var _=require(_0x7eba('0x0'));var util=require('util');var logger=require(_0x7eba('0x1'))(_0x7eba('0x2'));var moment=require(_0x7eba('0x3'));var BPromise=require('bluebird');var rp=require(_0x7eba('0x4'));var fs=require('fs');var path=require(_0x7eba('0x5'));var rimraf=require(_0x7eba('0x6'));var config=require(_0x7eba('0x7'));var attributes=require('./cdr.attributes');module[_0x7eba('0x8')]=function(_0x55c584,_0x1451e6){return _0x55c584[_0x7eba('0x9')](_0x7eba('0xa'),attributes,{'tableName':_0x7eba('0xb'),'paranoid':![],'indexes':[{'name':_0x7eba('0xc'),'fields':[_0x7eba('0xc')]},{'name':_0x7eba('0xd'),'fields':[_0x7eba('0xd')]},{'name':_0x7eba('0xe'),'fields':[_0x7eba('0xe')]},{'name':_0x7eba('0xf'),'fields':[_0x7eba('0xf')]},{'name':'src','fields':[_0x7eba('0x10')]},{'name':'uniqueid','fields':[_0x7eba('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index e83c5ef..7fc6408 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 _0x3176=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x3176,0x11c));var _0x6317=function(_0x5e4728,_0x412551){_0x5e4728=_0x5e4728-0x0;var _0x5d4011=_0x3176[_0x5e4728];return _0x5d4011;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var moment=require(_0x6317('0x2'));var BPromise=require(_0x6317('0x3'));var rs=require(_0x6317('0x4'));var fs=require('fs');var Redis=require(_0x6317('0x5'));var db=require(_0x6317('0x6'))['db'];var utils=require(_0x6317('0x7'));var logger=require('../../config/logger')(_0x6317('0x8'));var config=require(_0x6317('0x9'));var jayson=require(_0x6317('0xa'));var client=jayson[_0x6317('0xb')][_0x6317('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdb43e7,_0x3082a5,_0x294080){return new BPromise(function(_0x27accd,_0x10112a){return client['request'](_0xdb43e7,_0x294080)[_0x6317('0xd')](function(_0x4278ac){logger[_0x6317('0xe')](_0x6317('0xf'),_0x3082a5,_0x6317('0x10'));logger['debug'](_0x6317('0x11'),_0x3082a5,_0x6317('0x10'),JSON[_0x6317('0x12')](_0x4278ac));if(_0x4278ac[_0x6317('0x13')]){if(_0x4278ac[_0x6317('0x13')]['code']===0x1f4){logger[_0x6317('0x13')]('Cdr,\x20%s,\x20%s',_0x3082a5,_0x4278ac[_0x6317('0x13')][_0x6317('0x14')]);return _0x10112a(_0x4278ac[_0x6317('0x13')][_0x6317('0x14')]);}logger[_0x6317('0x13')](_0x6317('0xf'),_0x3082a5,_0x4278ac[_0x6317('0x13')][_0x6317('0x14')]);return _0x27accd(_0x4278ac['error'][_0x6317('0x14')]);}else{logger[_0x6317('0xe')](_0x6317('0xf'),_0x3082a5,_0x6317('0x10'));_0x27accd(_0x4278ac[_0x6317('0x15')]['message']);}})['catch'](function(_0x5b8712){logger[_0x6317('0x13')](_0x6317('0xf'),_0x3082a5,_0x5b8712);_0x10112a(_0x5b8712);});});} \ No newline at end of file +var _0xc479=['info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then'];(function(_0xdd501d,_0x2bcf96){var _0x1eef8b=function(_0x47355b){while(--_0x47355b){_0xdd501d['push'](_0xdd501d['shift']());}};_0x1eef8b(++_0x2bcf96);}(_0xc479,0x11b));var _0x9c47=function(_0x96a3e,_0x166ff0){_0x96a3e=_0x96a3e-0x0;var _0x44e17a=_0xc479[_0x96a3e];return _0x44e17a;};'use strict';var _=require(_0x9c47('0x0'));var util=require(_0x9c47('0x1'));var moment=require('moment');var BPromise=require(_0x9c47('0x2'));var rs=require(_0x9c47('0x3'));var fs=require('fs');var Redis=require(_0x9c47('0x4'));var db=require(_0x9c47('0x5'))['db'];var utils=require(_0x9c47('0x6'));var logger=require(_0x9c47('0x7'))(_0x9c47('0x8'));var config=require(_0x9c47('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x512e96,_0x3bb697,_0x4f799b){return new BPromise(function(_0x5b3f88,_0x16a1eb){return client['request'](_0x512e96,_0x4f799b)[_0x9c47('0xa')](function(_0x111826){logger[_0x9c47('0xb')](_0x9c47('0xc'),_0x3bb697,_0x9c47('0xd'));logger[_0x9c47('0xe')](_0x9c47('0xf'),_0x3bb697,_0x9c47('0xd'),JSON[_0x9c47('0x10')](_0x111826));if(_0x111826['error']){if(_0x111826['error']['code']===0x1f4){logger[_0x9c47('0x11')](_0x9c47('0xc'),_0x3bb697,_0x111826[_0x9c47('0x11')][_0x9c47('0x12')]);return _0x16a1eb(_0x111826['error'][_0x9c47('0x12')]);}logger['error'](_0x9c47('0xc'),_0x3bb697,_0x111826[_0x9c47('0x11')]['message']);return _0x5b3f88(_0x111826[_0x9c47('0x11')][_0x9c47('0x12')]);}else{logger[_0x9c47('0xb')](_0x9c47('0xc'),_0x3bb697,_0x9c47('0xd'));_0x5b3f88(_0x111826[_0x9c47('0x13')][_0x9c47('0x12')]);}})[_0x9c47('0x14')](function(_0x38eb13){logger[_0x9c47('0x11')]('Cdr,\x20%s,\x20%s',_0x3bb697,_0x38eb13);_0x16a1eb(_0x38eb13);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3a1b164..35afea4 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 _0xde50=['express','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','delete','util','path','connect-timeout'];(function(_0x34338e,_0x5aae07){var _0x11dc1b=function(_0x51c635){while(--_0x51c635){_0x34338e['push'](_0x34338e['shift']());}};_0x11dc1b(++_0x5aae07);}(_0xde50,0x15c));var _0x0de5=function(_0x2a764a,_0x33f35f){_0x2a764a=_0x2a764a-0x0;var _0x13cad7=_0xde50[_0x2a764a];return _0x13cad7;};'use strict';var multer=require('multer');var util=require(_0x0de5('0x0'));var path=require(_0x0de5('0x1'));var timeout=require(_0x0de5('0x2'));var express=require(_0x0de5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0de5('0x4'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0x0de5('0x5')]('/',auth[_0x0de5('0x6')](),controller[_0x0de5('0x7')]);router[_0x0de5('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0de5('0x5')](_0x0de5('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0de5('0x9')]('/',auth[_0x0de5('0x6')](),controller[_0x0de5('0xa')]);router[_0x0de5('0xb')](_0x0de5('0x8'),auth[_0x0de5('0x6')](),controller['update']);router[_0x0de5('0xc')](_0x0de5('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa23f=['/:id','show','post','update','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./cdr.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x3d3f42,_0x52aaa5){var _0x48d1e8=function(_0xb67f3c){while(--_0xb67f3c){_0x3d3f42['push'](_0x3d3f42['shift']());}};_0x48d1e8(++_0x52aaa5);}(_0xa23f,0x7c));var _0xfa23=function(_0x57dbf4,_0x41c106){_0x57dbf4=_0x57dbf4-0x0;var _0x19cd05=_0xa23f[_0x57dbf4];return _0x19cd05;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var auth=require(_0xfa23('0x4'));var interaction=require(_0xfa23('0x5'));var config=require('../../config/environment');var controller=require(_0xfa23('0x6'));router['get']('/',auth[_0xfa23('0x7')](),controller[_0xfa23('0x8')]);router[_0xfa23('0x9')](_0xfa23('0xa'),auth['isAuthenticated'](),controller[_0xfa23('0xb')]);router['get'](_0xfa23('0xc'),auth[_0xfa23('0x7')](),controller[_0xfa23('0xd')]);router[_0xfa23('0xe')]('/',auth[_0xfa23('0x7')](),controller['create']);router['put'](_0xfa23('0xc'),auth['isAuthenticated'](),controller[_0xfa23('0xf')]);router['delete'](_0xfa23('0xc'),auth[_0xfa23('0x7')](),controller[_0xfa23('0x10')]);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 4902eee..0332ae6 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 _0x4137=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1c8783,_0x213d93){var _0x472cb0=function(_0x2b7904){while(--_0x2b7904){_0x1c8783['push'](_0x1c8783['shift']());}};_0x472cb0(++_0x213d93);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'priority':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7413('0x3')],'allowNull':![],'defaultValue':_0x7413('0x4')},'appdata':{'type':Sequelize[_0x7413('0x5')]()},'description':{'type':Sequelize[_0x7413('0x3')]},'interval':{'type':Sequelize[_0x7413('0x3')],'defaultValue':_0x7413('0x6')}}; \ No newline at end of file +var _0x7a02=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x19aad4,_0x55c538){var _0x55b572=function(_0x3581e7){while(--_0x3581e7){_0x19aad4['push'](_0x19aad4['shift']());}};_0x55b572(++_0x55c538);}(_0x7a02,0x1ba));var _0x27a0=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x7a02[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require('sequelize');module[_0x27a0('0x0')]={'priority':{'type':Sequelize[_0x27a0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x27a0('0x2')],'allowNull':![],'defaultValue':_0x27a0('0x3')},'appdata':{'type':Sequelize[_0x27a0('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x27a0('0x2')],'defaultValue':_0x27a0('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 96104bf..41b2359 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 _0x852e=['filters','intersection','attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query'];(function(_0x25a648,_0x5c0608){var _0x3db307=function(_0x22d832){while(--_0x22d832){_0x25a648['push'](_0x25a648['shift']());}};_0x3db307(++_0x5c0608);}(_0x852e,0x1a2));var _0xe852=function(_0x113b78,_0x3f59f1){_0x113b78=_0x113b78-0x0;var _0x1e3e7d=_0x852e[_0x113b78];return _0x1e3e7d;};'use strict';var pdf=require(_0xe852('0x0'));var emlformat=require(_0xe852('0x1'));var rimraf=require(_0xe852('0x2'));var zipdir=require(_0xe852('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe852('0x4'));var moment=require(_0xe852('0x5'));var BPromise=require(_0xe852('0x6'));var Mustache=require(_0xe852('0x7'));var util=require(_0xe852('0x8'));var path=require('path');var sox=require(_0xe852('0x9'));var csv=require('to-csv');var ejs=require(_0xe852('0xa'));var fs=require('fs');var _=require(_0xe852('0xb'));var squel=require(_0xe852('0xc'));var crypto=require(_0xe852('0xd'));var jsforce=require(_0xe852('0xe'));var deskjs=require(_0xe852('0xf'));var toCsv=require(_0xe852('0x10'));var querystring=require('querystring');var Papa=require(_0xe852('0x11'));var Redis=require(_0xe852('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe852('0x13'));var hardwareService=require(_0xe852('0x14'));var logger=require('../../config/logger')(_0xe852('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e0525,_0x5cd114){_0x5cd114=_0x5cd114||0xcc;return function(_0x4deab4){if(_0x4deab4){return _0x4e0525[_0xe852('0x16')](_0x5cd114);}return _0x4e0525[_0xe852('0x17')](_0x5cd114)[_0xe852('0x18')]();};}function respondWithResult(_0x4841cc,_0x18bf63){_0x18bf63=_0x18bf63||0xc8;return function(_0x4a5800){if(_0x4a5800){return _0x4841cc['status'](_0x18bf63)[_0xe852('0x19')](_0x4a5800);}};}function respondWithFilteredResult(_0x5f0f32,_0x178c28){return function(_0x2c20e7){if(_0x2c20e7){var _0x3888dc=_0x2c20e7['count'],_0x373390=_0x178c28[_0xe852('0x1a')],_0x564a4f=_0x178c28['offset']+_0x178c28[_0xe852('0x1b')],_0x6dbc0c;if(_0x564a4f>=_0x3888dc){_0x564a4f=_0x3888dc;_0x6dbc0c=0xc8;}else{_0x6dbc0c=0xce;}_0x5f0f32['status'](_0x6dbc0c);return _0x5f0f32[_0xe852('0x1c')](_0xe852('0x1d'),_0x373390+'-'+_0x564a4f+'/'+_0x3888dc)[_0xe852('0x19')](_0x2c20e7);}return null;};}function patchUpdates(_0x1e2c47){return function(_0x1b0341){try{jsonpatch[_0xe852('0x1e')](_0x1b0341,_0x1e2c47,!![]);}catch(_0x187bf4){return BPromise[_0xe852('0x1f')](_0x187bf4);}return _0x1b0341[_0xe852('0x20')]();};}function saveUpdates(_0x4ebdd2,_0x2aa15d){return function(_0x4eda62){if(_0x4eda62){return _0x4eda62[_0xe852('0x21')](_0x4ebdd2)[_0xe852('0x22')](function(_0x2a9e98){return _0x2a9e98;});}return null;};}function removeEntity(_0x527bea,_0x181de9){return function(_0x28c2ac){if(_0x28c2ac){return _0x28c2ac[_0xe852('0x23')]()[_0xe852('0x22')](function(){_0x527bea[_0xe852('0x17')](0xcc)[_0xe852('0x18')]();});}};}function handleEntityNotFound(_0x5728b7,_0x451160){return function(_0x54c935){if(!_0x54c935){_0x5728b7[_0xe852('0x16')](0x194);}return _0x54c935;};}function handleError(_0x3f7794,_0x3064fc){_0x3064fc=_0x3064fc||0x1f4;return function(_0x53541c){logger[_0xe852('0x24')](_0x53541c[_0xe852('0x25')]);if(_0x53541c[_0xe852('0x26')]){delete _0x53541c['name'];}_0x3f7794[_0xe852('0x17')](_0x3064fc)[_0xe852('0x27')](_0x53541c);};}exports[_0xe852('0x28')]=function(_0x47c15d,_0x204829){var _0x209fb4={'raw':!![],'where':{'id':_0x47c15d[_0xe852('0x29')]['id']}},_0x1d7286={};_0x1d7286[_0xe852('0x2a')]=_[_0xe852('0x2b')](db['ChatApplication'][_0xe852('0x2c')]);_0x1d7286[_0xe852('0x2d')]=_[_0xe852('0x2b')](_0x47c15d[_0xe852('0x2d')]);_0x1d7286[_0xe852('0x2e')]=_[_0xe852('0x2f')](_0x1d7286[_0xe852('0x2a')],_0x1d7286['query']);_0x209fb4[_0xe852('0x30')]=_[_0xe852('0x2f')](_0x1d7286['model'],qs[_0xe852('0x31')](_0x47c15d[_0xe852('0x2d')][_0xe852('0x31')]));_0x209fb4[_0xe852('0x30')]=_0x209fb4[_0xe852('0x30')][_0xe852('0x32')]?_0x209fb4[_0xe852('0x30')]:_0x1d7286[_0xe852('0x2a')];if(_0x47c15d[_0xe852('0x2d')][_0xe852('0x33')]){_0x209fb4['include']=[{'all':!![]}];}_0x209fb4=_[_0xe852('0x34')]({},_0x209fb4,_0x47c15d[_0xe852('0x35')]);return db[_0xe852('0x36')][_0xe852('0x37')](_0x209fb4)[_0xe852('0x22')](handleEntityNotFound(_0x204829,null))[_0xe852('0x22')](respondWithResult(_0x204829,null))[_0xe852('0x38')](handleError(_0x204829,null));};exports[_0xe852('0x21')]=function(_0xa13db1,_0x3aa910){if(_0xa13db1[_0xe852('0x39')]['id']){delete _0xa13db1[_0xe852('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0xa13db1[_0xe852('0x29')]['id']}})[_0xe852('0x22')](handleEntityNotFound(_0x3aa910,null))[_0xe852('0x22')](saveUpdates(_0xa13db1['body'],null))[_0xe852('0x22')](respondWithResult(_0x3aa910,null))['catch'](handleError(_0x3aa910,null));};exports[_0xe852('0x23')]=function(_0x248407,_0x7f983a){return db[_0xe852('0x36')][_0xe852('0x37')]({'where':{'id':_0x248407[_0xe852('0x29')]['id']}})[_0xe852('0x22')](handleEntityNotFound(_0x7f983a,null))['then'](removeEntity(_0x7f983a,null))[_0xe852('0x38')](handleError(_0x7f983a,null));}; \ No newline at end of file +var _0xafd3=['keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','ChatApplication','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','show','params','model'];(function(_0x457585,_0x47e33a){var _0x1f96e1=function(_0x5be312){while(--_0x5be312){_0x457585['push'](_0x457585['shift']());}};_0x1f96e1(++_0x47e33a);}(_0xafd3,0x197));var _0x3afd=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xafd3[_0x5e2cb4];return _0x282902;};'use strict';var pdf=require(_0x3afd('0x0'));var emlformat=require(_0x3afd('0x1'));var rimraf=require(_0x3afd('0x2'));var zipdir=require(_0x3afd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3afd('0x4'));var moment=require('moment');var BPromise=require(_0x3afd('0x5'));var Mustache=require(_0x3afd('0x6'));var util=require(_0x3afd('0x7'));var path=require(_0x3afd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3afd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3afd('0xa'));var crypto=require(_0x3afd('0xb'));var jsforce=require(_0x3afd('0xc'));var deskjs=require(_0x3afd('0xd'));var toCsv=require(_0x3afd('0xe'));var querystring=require(_0x3afd('0xf'));var Papa=require(_0x3afd('0x10'));var Redis=require(_0x3afd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3afd('0x12'));var hardwareService=require(_0x3afd('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3afd('0x14'));var db=require(_0x3afd('0x15'))['db'];function respondWithStatusCode(_0x2fc503,_0x5497ed){_0x5497ed=_0x5497ed||0xcc;return function(_0x22df61){if(_0x22df61){return _0x2fc503['sendStatus'](_0x5497ed);}return _0x2fc503[_0x3afd('0x16')](_0x5497ed)[_0x3afd('0x17')]();};}function respondWithResult(_0x591f2a,_0x2898f1){_0x2898f1=_0x2898f1||0xc8;return function(_0x467526){if(_0x467526){return _0x591f2a[_0x3afd('0x16')](_0x2898f1)[_0x3afd('0x18')](_0x467526);}};}function respondWithFilteredResult(_0x1892ec,_0x5b1726){return function(_0x2314b3){if(_0x2314b3){var _0x38a44c=_0x2314b3[_0x3afd('0x19')],_0x373e37=_0x5b1726['offset'],_0x10140a=_0x5b1726[_0x3afd('0x1a')]+_0x5b1726['limit'],_0x55c2dd;if(_0x10140a>=_0x38a44c){_0x10140a=_0x38a44c;_0x55c2dd=0xc8;}else{_0x55c2dd=0xce;}_0x1892ec[_0x3afd('0x16')](_0x55c2dd);return _0x1892ec[_0x3afd('0x1b')](_0x3afd('0x1c'),_0x373e37+'-'+_0x10140a+'/'+_0x38a44c)[_0x3afd('0x18')](_0x2314b3);}return null;};}function patchUpdates(_0x2a84c2){return function(_0x353840){try{jsonpatch[_0x3afd('0x1d')](_0x353840,_0x2a84c2,!![]);}catch(_0x5de993){return BPromise[_0x3afd('0x1e')](_0x5de993);}return _0x353840[_0x3afd('0x1f')]();};}function saveUpdates(_0x5600ce,_0x574ee2){return function(_0x433b23){if(_0x433b23){return _0x433b23[_0x3afd('0x20')](_0x5600ce)[_0x3afd('0x21')](function(_0xdcdac1){return _0xdcdac1;});}return null;};}function removeEntity(_0x448cd7,_0x279c6c){return function(_0x200a42){if(_0x200a42){return _0x200a42[_0x3afd('0x22')]()[_0x3afd('0x21')](function(){_0x448cd7[_0x3afd('0x16')](0xcc)[_0x3afd('0x17')]();});}};}function handleEntityNotFound(_0x3a3487,_0x5f22ee){return function(_0x2995de){if(!_0x2995de){_0x3a3487['sendStatus'](0x194);}return _0x2995de;};}function handleError(_0x46ccfb,_0x37826e){_0x37826e=_0x37826e||0x1f4;return function(_0x508ada){logger[_0x3afd('0x23')](_0x508ada[_0x3afd('0x24')]);if(_0x508ada['name']){delete _0x508ada['name'];}_0x46ccfb[_0x3afd('0x16')](_0x37826e)[_0x3afd('0x25')](_0x508ada);};}exports[_0x3afd('0x26')]=function(_0x47df70,_0x175808){var _0x407934={'raw':!![],'where':{'id':_0x47df70[_0x3afd('0x27')]['id']}},_0x2ab89f={};_0x2ab89f[_0x3afd('0x28')]=_[_0x3afd('0x29')](db['ChatApplication'][_0x3afd('0x2a')]);_0x2ab89f[_0x3afd('0x2b')]=_['keys'](_0x47df70[_0x3afd('0x2b')]);_0x2ab89f[_0x3afd('0x2c')]=_['intersection'](_0x2ab89f[_0x3afd('0x28')],_0x2ab89f['query']);_0x407934['attributes']=_[_0x3afd('0x2d')](_0x2ab89f[_0x3afd('0x28')],qs[_0x3afd('0x2e')](_0x47df70['query']['fields']));_0x407934[_0x3afd('0x2f')]=_0x407934['attributes'][_0x3afd('0x30')]?_0x407934['attributes']:_0x2ab89f['model'];if(_0x47df70[_0x3afd('0x2b')][_0x3afd('0x31')]){_0x407934[_0x3afd('0x32')]=[{'all':!![]}];}_0x407934=_[_0x3afd('0x33')]({},_0x407934,_0x47df70['options']);return db[_0x3afd('0x34')][_0x3afd('0x35')](_0x407934)[_0x3afd('0x21')](handleEntityNotFound(_0x175808,null))[_0x3afd('0x21')](respondWithResult(_0x175808,null))[_0x3afd('0x36')](handleError(_0x175808,null));};exports['update']=function(_0x45643f,_0x177772){if(_0x45643f['body']['id']){delete _0x45643f[_0x3afd('0x37')]['id'];}return db[_0x3afd('0x34')]['find']({'where':{'id':_0x45643f[_0x3afd('0x27')]['id']}})[_0x3afd('0x21')](handleEntityNotFound(_0x177772,null))[_0x3afd('0x21')](saveUpdates(_0x45643f[_0x3afd('0x37')],null))[_0x3afd('0x21')](respondWithResult(_0x177772,null))['catch'](handleError(_0x177772,null));};exports['destroy']=function(_0x562487,_0x196bd8){return db[_0x3afd('0x34')][_0x3afd('0x35')]({'where':{'id':_0x562487[_0x3afd('0x27')]['id']}})['then'](handleEntityNotFound(_0x196bd8,null))['then'](removeEntity(_0x196bd8,null))[_0x3afd('0x36')](handleError(_0x196bd8,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 281b074..d3e9cef 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 _0x3660=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2fba0c,_0x2cf2c0){var _0x263a96=function(_0x895beb){while(--_0x895beb){_0x2fba0c['push'](_0x2fba0c['shift']());}};_0x263a96(++_0x2cf2c0);}(_0x3660,0x91));var _0x0366=function(_0x2e879b,_0x3566a7){_0x2e879b=_0x2e879b-0x0;var _0x44c34b=_0x3660[_0x2e879b];return _0x44c34b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0366('0x0'))(_0x0366('0x1'));var moment=require(_0x0366('0x2'));var BPromise=require(_0x0366('0x3'));var rp=require(_0x0366('0x4'));var fs=require('fs');var path=require(_0x0366('0x5'));var rimraf=require(_0x0366('0x6'));var config=require(_0x0366('0x7'));var attributes=require(_0x0366('0x8'));module[_0x0366('0x9')]=function(_0x34c6c4,_0x5de9ab){return _0x34c6c4[_0x0366('0xa')](_0x0366('0xb'),attributes,{'tableName':_0x0366('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0366('0xd'),'collate':_0x0366('0xe')});}; \ No newline at end of file +var _0xcd79=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xcd79,0xf1));var _0x9cd7=function(_0x4b4860,_0x1ebbd0){_0x4b4860=_0x4b4860-0x0;var _0x196037=_0xcd79[_0x4b4860];return _0x196037;};'use strict';var _=require(_0x9cd7('0x0'));var util=require('util');var logger=require(_0x9cd7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cd7('0x2'));var rp=require(_0x9cd7('0x3'));var fs=require('fs');var path=require(_0x9cd7('0x4'));var rimraf=require('rimraf');var config=require(_0x9cd7('0x5'));var attributes=require('./chatApplication.attributes');module[_0x9cd7('0x6')]=function(_0x3ca0db,_0x15e973){return _0x3ca0db[_0x9cd7('0x7')](_0x9cd7('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9cd7('0x9'),'collate':_0x9cd7('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a4db9b3..85c3e02 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 _0x0314=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3f969a,_0x3cd782){var _0x3b39b7=function(_0x484413){while(--_0x484413){_0x3f969a['push'](_0x3f969a['shift']());}};_0x3b39b7(++_0x3cd782);}(_0x0314,0x15c));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4031('0x0'));var util=require(_0x4031('0x1'));var moment=require(_0x4031('0x2'));var BPromise=require('bluebird');var rs=require(_0x4031('0x3'));var fs=require('fs');var Redis=require(_0x4031('0x4'));var db=require(_0x4031('0x5'))['db'];var utils=require(_0x4031('0x6'));var logger=require(_0x4031('0x7'))(_0x4031('0x8'));var config=require(_0x4031('0x9'));var jayson=require(_0x4031('0xa'));var client=jayson[_0x4031('0xb')][_0x4031('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x529b39,_0xfbb59b,_0x5b0bfe){return new BPromise(function(_0x9824ef,_0x1d0262){return client['request'](_0x529b39,_0x5b0bfe)['then'](function(_0x49d46e){logger['info'](_0x4031('0xd'),_0xfbb59b,_0x4031('0xe'));logger[_0x4031('0xf')](_0x4031('0x10'),_0xfbb59b,'request\x20sent',JSON[_0x4031('0x11')](_0x49d46e));if(_0x49d46e[_0x4031('0x12')]){if(_0x49d46e[_0x4031('0x12')]['code']===0x1f4){logger[_0x4031('0x12')](_0x4031('0xd'),_0xfbb59b,_0x49d46e[_0x4031('0x12')][_0x4031('0x13')]);return _0x1d0262(_0x49d46e[_0x4031('0x12')][_0x4031('0x13')]);}logger[_0x4031('0x12')]('ChatApplication,\x20%s,\x20%s',_0xfbb59b,_0x49d46e['error'][_0x4031('0x13')]);return _0x9824ef(_0x49d46e['error'][_0x4031('0x13')]);}else{logger[_0x4031('0x14')](_0x4031('0xd'),_0xfbb59b,_0x4031('0xe'));_0x9824ef(_0x49d46e[_0x4031('0x15')][_0x4031('0x13')]);}})[_0x4031('0x16')](function(_0x21e9e0){logger[_0x4031('0x12')](_0x4031('0xd'),_0xfbb59b,_0x21e9e0);_0x1d0262(_0x21e9e0);});});} \ No newline at end of file +var _0x8b72=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x37833b,_0x3c29e){var _0x4a818c=function(_0x4d6259){while(--_0x4d6259){_0x37833b['push'](_0x37833b['shift']());}};_0x4a818c(++_0x3c29e);}(_0x8b72,0x1c7));var _0x28b7=function(_0x409248,_0x7dacd5){_0x409248=_0x409248-0x0;var _0xa6880b=_0x8b72[_0x409248];return _0xa6880b;};'use strict';var _=require(_0x28b7('0x0'));var util=require(_0x28b7('0x1'));var moment=require(_0x28b7('0x2'));var BPromise=require(_0x28b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x28b7('0x5'))(_0x28b7('0x6'));var config=require(_0x28b7('0x7'));var jayson=require(_0x28b7('0x8'));var client=jayson['client'][_0x28b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c1ac9,_0x3dd08b,_0x508bc8){return new BPromise(function(_0x29d946,_0x12a4c0){return client[_0x28b7('0xa')](_0x2c1ac9,_0x508bc8)['then'](function(_0x3be166){logger['info'](_0x28b7('0xb'),_0x3dd08b,_0x28b7('0xc'));logger['debug'](_0x28b7('0xd'),_0x3dd08b,_0x28b7('0xc'),JSON[_0x28b7('0xe')](_0x3be166));if(_0x3be166['error']){if(_0x3be166[_0x28b7('0xf')][_0x28b7('0x10')]===0x1f4){logger[_0x28b7('0xf')]('ChatApplication,\x20%s,\x20%s',_0x3dd08b,_0x3be166[_0x28b7('0xf')]['message']);return _0x12a4c0(_0x3be166[_0x28b7('0xf')]['message']);}logger[_0x28b7('0xf')](_0x28b7('0xb'),_0x3dd08b,_0x3be166[_0x28b7('0xf')][_0x28b7('0x11')]);return _0x29d946(_0x3be166[_0x28b7('0xf')]['message']);}else{logger[_0x28b7('0x12')]('ChatApplication,\x20%s,\x20%s',_0x3dd08b,_0x28b7('0xc'));_0x29d946(_0x3be166[_0x28b7('0x13')][_0x28b7('0x11')]);}})['catch'](function(_0x1bd652){logger[_0x28b7('0xf')]('ChatApplication,\x20%s,\x20%s',_0x3dd08b,_0x1bd652);_0x12a4c0(_0x1bd652);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index da5f6b2..ad2dbdb 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 _0x9436=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','show','delete','isAuthenticated','destroy'];(function(_0x43218c,_0x2112e4){var _0x5d6a69=function(_0x13187b){while(--_0x13187b){_0x43218c['push'](_0x43218c['shift']());}};_0x5d6a69(++_0x2112e4);}(_0x9436,0x16c));var _0x6943=function(_0x5803d4,_0x54a45a){_0x5803d4=_0x5803d4-0x0;var _0x1e4d78=_0x9436[_0x5803d4];return _0x1e4d78;};'use strict';var multer=require(_0x6943('0x0'));var util=require(_0x6943('0x1'));var path=require(_0x6943('0x2'));var timeout=require(_0x6943('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6943('0x4'));var interaction=require(_0x6943('0x5'));var config=require('../../config/environment');var controller=require(_0x6943('0x6'));router[_0x6943('0x7')](_0x6943('0x8'),auth['isAuthenticated'](),controller[_0x6943('0x9')]);router['put'](_0x6943('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6943('0xa')](_0x6943('0x8'),auth[_0x6943('0xb')](),controller[_0x6943('0xc')]);module['exports']=router; \ No newline at end of file +var _0xf078=['update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','put'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf078,0x1be));var _0x8f07=function(_0x4f0dba,_0x54ed18){_0x4f0dba=_0x4f0dba-0x0;var _0x2ff63b=_0xf078[_0x4f0dba];return _0x2ff63b;};'use strict';var multer=require(_0x8f07('0x0'));var util=require('util');var path=require(_0x8f07('0x1'));var timeout=require(_0x8f07('0x2'));var express=require(_0x8f07('0x3'));var router=express[_0x8f07('0x4')]();var auth=require(_0x8f07('0x5'));var interaction=require(_0x8f07('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x8f07('0x7')](_0x8f07('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x8f07('0x9')](_0x8f07('0x8'),auth['isAuthenticated'](),controller[_0x8f07('0xa')]);router['delete'](_0x8f07('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x8f07('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 9ee11b2..253eafc 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 _0x3efd=['BOOLEAN','sequelize','exports','STRING'];(function(_0x56c880,_0x1f6dab){var _0x57f803=function(_0x2bff9a){while(--_0x2bff9a){_0x56c880['push'](_0x56c880['shift']());}};_0x57f803(++_0x1f6dab);}(_0x3efd,0x1a9));var _0xd3ef=function(_0x573c87,_0x52e7c5){_0x573c87=_0x573c87-0x0;var _0x4a4ac5=_0x3efd[_0x573c87];return _0x4a4ac5;};'use strict';var Sequelize=require(_0xd3ef('0x0'));module[_0xd3ef('0x1')]={'name':{'type':Sequelize[_0xd3ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd3ef('0x2')]},'write':{'type':Sequelize[_0xd3ef('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc7e8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc7e8,0x11a));var _0x8c7e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xc7e8[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x8c7e('0x0'));module[_0x8c7e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8c7e('0x2')]},'write':{'type':Sequelize[_0x8c7e('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 7231710..875b2bc 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 _0x1ae3=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','stack','name','send','index','rawAttributes','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','options','ChatGroup','includeAll','findAll','rows','catch','show','keys','include','find','create','update','body','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1ee799,_0x835559){var _0x1df95d=function(_0x2b95d7){while(--_0x2b95d7){_0x1ee799['push'](_0x1ee799['shift']());}};_0x1df95d(++_0x835559);}(_0x1ae3,0x139));var _0x31ae=function(_0x52bff1,_0x36f48f){_0x52bff1=_0x52bff1-0x0;var _0x7d406e=_0x1ae3[_0x52bff1];return _0x7d406e;};'use strict';var pdf=require(_0x31ae('0x0'));var emlformat=require(_0x31ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x31ae('0x2'));var jsonpatch=require(_0x31ae('0x3'));var rp=require(_0x31ae('0x4'));var moment=require(_0x31ae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31ae('0x6'));var util=require(_0x31ae('0x7'));var path=require(_0x31ae('0x8'));var sox=require(_0x31ae('0x9'));var csv=require(_0x31ae('0xa'));var ejs=require(_0x31ae('0xb'));var fs=require('fs');var _=require(_0x31ae('0xc'));var squel=require(_0x31ae('0xd'));var crypto=require(_0x31ae('0xe'));var jsforce=require(_0x31ae('0xf'));var deskjs=require(_0x31ae('0x10'));var toCsv=require(_0x31ae('0xa'));var querystring=require(_0x31ae('0x11'));var Papa=require(_0x31ae('0x12'));var Redis=require(_0x31ae('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x31ae('0x14'));var hardwareService=require(_0x31ae('0x15'));var logger=require(_0x31ae('0x16'))('api');var utils=require(_0x31ae('0x17'));var config=require(_0x31ae('0x18'));var db=require('../../mysqldb')['db'];config[_0x31ae('0x19')]=_['defaults'](config[_0x31ae('0x19')],{'host':_0x31ae('0x1a'),'port':0x18eb});var socket=require(_0x31ae('0x1b'))(new Redis(config['redis']));require(_0x31ae('0x1c'))[_0x31ae('0x1d')](socket);var jayson=require(_0x31ae('0x1e'));var client=jayson[_0x31ae('0x1f')][_0x31ae('0x20')]({'port':0x232a});function checkPasswordPattern(_0x273c94,_0x48963a,_0x331134){if(_0x331134){var _0x11abd4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11abd4[_0x31ae('0x21')](_0x48963a)){return _0x273c94;}else{throw new Error(_0x31ae('0x22'));}}else{return _0x273c94;}}function respondWithRpcPromise(_0x1fc2cf,_0x2449ea,_0x25be89,_0x379c51){return new BPromise(function(_0x5aa824,_0xcd30cc){var _0x58d574=_0x379c51||client;return _0x58d574[_0x31ae('0x23')](_0x1fc2cf,_0x25be89)[_0x31ae('0x24')](function(_0x4716f7){logger[_0x31ae('0x25')](_0x31ae('0x26'),_0x2449ea,_0x31ae('0x27'));logger[_0x31ae('0x28')](_0x31ae('0x29'),_0x2449ea,_0x31ae('0x27'),JSON[_0x31ae('0x2a')](_0x4716f7));if(_0x4716f7[_0x31ae('0x2b')]){if(_0x4716f7[_0x31ae('0x2b')]['code']===0x1f4){logger[_0x31ae('0x2b')](_0x31ae('0x26'),_0x2449ea,_0x4716f7[_0x31ae('0x2b')][_0x31ae('0x2c')]);return _0xcd30cc(_0x4716f7['error'][_0x31ae('0x2c')]);}logger[_0x31ae('0x2b')]('ChatGroup,\x20%s,\x20%s',_0x2449ea,_0x4716f7[_0x31ae('0x2b')]['message']);return _0x5aa824(_0x4716f7[_0x31ae('0x2b')]['message']);}else{logger['info'](_0x31ae('0x26'),_0x2449ea,_0x31ae('0x27'));_0x5aa824(_0x4716f7[_0x31ae('0x2d')]['message']);}})['catch'](function(_0x4c0246){logger[_0x31ae('0x2b')]('ChatGroup,\x20%s,\x20%s',_0x2449ea,_0x4c0246);_0xcd30cc(_0x4c0246);});});}function respondWithStatusCode(_0x43ca3d,_0x2b5230){_0x2b5230=_0x2b5230||0xcc;return function(_0xf49658){if(_0xf49658){return _0x43ca3d[_0x31ae('0x2e')](_0x2b5230);}return _0x43ca3d[_0x31ae('0x2f')](_0x2b5230)[_0x31ae('0x30')]();};}function respondWithResult(_0x225172,_0x16ea63){_0x16ea63=_0x16ea63||0xc8;return function(_0x54676f){if(_0x54676f){return _0x225172[_0x31ae('0x2f')](_0x16ea63)[_0x31ae('0x31')](_0x54676f);}};}function respondWithFilteredResult(_0x1681ab,_0x2000aa){return function(_0x5e4a09){if(_0x5e4a09){var _0x14f472=_0x5e4a09[_0x31ae('0x32')],_0x418d59=_0x2000aa[_0x31ae('0x33')],_0x28f439=_0x2000aa[_0x31ae('0x33')]+_0x2000aa['limit'],_0x2c278b;if(_0x28f439>=_0x14f472){_0x28f439=_0x14f472;_0x2c278b=0xc8;}else{_0x2c278b=0xce;}_0x1681ab['status'](_0x2c278b);return _0x1681ab[_0x31ae('0x34')]('Content-Range',_0x418d59+'-'+_0x28f439+'/'+_0x14f472)[_0x31ae('0x31')](_0x5e4a09);}return null;};}function patchUpdates(_0x3d7e2e){return function(_0x523e4e){try{jsonpatch[_0x31ae('0x35')](_0x523e4e,_0x3d7e2e,!![]);}catch(_0x207e57){return BPromise[_0x31ae('0x36')](_0x207e57);}return _0x523e4e[_0x31ae('0x37')]();};}function saveUpdates(_0x4811d9,_0x21466d){return function(_0x130ee9){if(_0x130ee9){return _0x130ee9['update'](_0x4811d9)['then'](function(_0x50b12e){return _0x50b12e;});}return null;};}function removeEntity(_0x46ffb1,_0x3553e0){return function(_0x81bb53){if(_0x81bb53){return _0x81bb53[_0x31ae('0x38')]()[_0x31ae('0x24')](function(){_0x46ffb1['status'](0xcc)[_0x31ae('0x30')]();});}};}function handleEntityNotFound(_0x15063b,_0xd52a41){return function(_0x3506e0){if(!_0x3506e0){_0x15063b[_0x31ae('0x2e')](0x194);}return _0x3506e0;};}function handleError(_0x3d6c3c,_0x358e99){_0x358e99=_0x358e99||0x1f4;return function(_0x39c3b6){logger[_0x31ae('0x2b')](_0x39c3b6[_0x31ae('0x39')]);if(_0x39c3b6[_0x31ae('0x3a')]){delete _0x39c3b6[_0x31ae('0x3a')];}_0x3d6c3c['status'](_0x358e99)[_0x31ae('0x3b')](_0x39c3b6);};}exports[_0x31ae('0x3c')]=function(_0x4edd82,_0x4403bd){var _0x457dac={},_0x4a26b7={},_0x35cf5e={'count':0x0,'rows':[]};var _0x185d16=db['ChatGroup'][_0x31ae('0x3d')];_0x4a26b7['model']=_['keys'](_0x185d16);_0x4a26b7[_0x31ae('0x3e')]=_['keys'](_0x4edd82[_0x31ae('0x3e')]);_0x4a26b7['filters']=_['intersection'](_0x4a26b7[_0x31ae('0x3f')],_0x4a26b7[_0x31ae('0x3e')]);_0x457dac[_0x31ae('0x40')]=_[_0x31ae('0x41')](_0x4a26b7['model'],qs[_0x31ae('0x42')](_0x4edd82[_0x31ae('0x3e')][_0x31ae('0x42')]));_0x457dac[_0x31ae('0x40')]=_0x457dac[_0x31ae('0x40')][_0x31ae('0x43')]?_0x457dac['attributes']:_0x4a26b7['model'];if(!_0x4edd82[_0x31ae('0x3e')][_0x31ae('0x44')]('nolimit')){_0x457dac[_0x31ae('0x45')]=qs[_0x31ae('0x45')](_0x4edd82[_0x31ae('0x3e')][_0x31ae('0x45')]);_0x457dac[_0x31ae('0x33')]=qs[_0x31ae('0x33')](_0x4edd82['query'][_0x31ae('0x33')]);}_0x457dac[_0x31ae('0x46')]=qs[_0x31ae('0x47')](_0x4edd82['query'][_0x31ae('0x47')]);_0x457dac[_0x31ae('0x48')]=qs['filters'](_[_0x31ae('0x49')](_0x4edd82[_0x31ae('0x3e')],_0x4a26b7[_0x31ae('0x4a')]));if(_0x4edd82['query'][_0x31ae('0x4b')]){_0x457dac[_0x31ae('0x48')]=_[_0x31ae('0x4c')](_0x457dac['where'],{'$or':_[_0x31ae('0x4d')](_0x185d16,function(_0x382d6c){if(_0x382d6c[_0x31ae('0x4e')]['key']!==_0x31ae('0x4f')){var _0x124359={};_0x124359[_0x382d6c['field']]={'$like':'%'+_0x4edd82[_0x31ae('0x3e')][_0x31ae('0x4b')]+'%'};return _0x124359;}})});}_0x457dac=_[_0x31ae('0x4c')]({},_0x457dac,_0x4edd82[_0x31ae('0x50')]);var _0x344e52={'where':_0x457dac[_0x31ae('0x48')]};return db[_0x31ae('0x51')][_0x31ae('0x32')](_0x344e52)[_0x31ae('0x24')](function(_0x30f7f6){_0x35cf5e[_0x31ae('0x32')]=_0x30f7f6;if(_0x4edd82['query'][_0x31ae('0x52')]){_0x457dac['include']=[{'all':!![]}];}return db[_0x31ae('0x51')][_0x31ae('0x53')](_0x457dac);})[_0x31ae('0x24')](function(_0x23ebcb){_0x35cf5e[_0x31ae('0x54')]=_0x23ebcb;return _0x35cf5e;})[_0x31ae('0x24')](respondWithFilteredResult(_0x4403bd,_0x457dac))[_0x31ae('0x55')](handleError(_0x4403bd,null));};exports[_0x31ae('0x56')]=function(_0x2094a9,_0x454a4d){var _0x27c296={'raw':!![],'where':{'id':_0x2094a9['params']['id']}},_0x11f221={};_0x11f221[_0x31ae('0x3f')]=_[_0x31ae('0x57')](db[_0x31ae('0x51')][_0x31ae('0x3d')]);_0x11f221[_0x31ae('0x3e')]=_[_0x31ae('0x57')](_0x2094a9[_0x31ae('0x3e')]);_0x11f221[_0x31ae('0x4a')]=_[_0x31ae('0x41')](_0x11f221[_0x31ae('0x3f')],_0x11f221['query']);_0x27c296[_0x31ae('0x40')]=_['intersection'](_0x11f221[_0x31ae('0x3f')],qs['fields'](_0x2094a9[_0x31ae('0x3e')]['fields']));_0x27c296[_0x31ae('0x40')]=_0x27c296[_0x31ae('0x40')][_0x31ae('0x43')]?_0x27c296[_0x31ae('0x40')]:_0x11f221[_0x31ae('0x3f')];if(_0x2094a9[_0x31ae('0x3e')][_0x31ae('0x52')]){_0x27c296[_0x31ae('0x58')]=[{'all':!![]}];}_0x27c296=_['merge']({},_0x27c296,_0x2094a9[_0x31ae('0x50')]);return db[_0x31ae('0x51')][_0x31ae('0x59')](_0x27c296)[_0x31ae('0x24')](handleEntityNotFound(_0x454a4d,null))[_0x31ae('0x24')](respondWithResult(_0x454a4d,null))[_0x31ae('0x55')](handleError(_0x454a4d,null));};exports[_0x31ae('0x5a')]=function(_0x43cf96,_0x780eae){return db[_0x31ae('0x51')]['create'](_0x43cf96['body'],{})[_0x31ae('0x24')](respondWithResult(_0x780eae,0xc9))[_0x31ae('0x55')](handleError(_0x780eae,null));};exports[_0x31ae('0x5b')]=function(_0x4c5433,_0x1d10a0){if(_0x4c5433[_0x31ae('0x5c')]['id']){delete _0x4c5433[_0x31ae('0x5c')]['id'];}return db[_0x31ae('0x51')][_0x31ae('0x59')]({'where':{'id':_0x4c5433[_0x31ae('0x5d')]['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0x1d10a0,null))[_0x31ae('0x24')](saveUpdates(_0x4c5433['body'],null))['then'](respondWithResult(_0x1d10a0,null))['catch'](handleError(_0x1d10a0,null));};exports['destroy']=function(_0xb54643,_0x579f2a){return db[_0x31ae('0x51')][_0x31ae('0x59')]({'where':{'id':_0xb54643[_0x31ae('0x5d')]['id']}})['then'](handleEntityNotFound(_0x579f2a,null))[_0x31ae('0x24')](removeEntity(_0x579f2a,null))[_0x31ae('0x55')](handleError(_0x579f2a,null));};exports[_0x31ae('0x5e')]=function(_0x374a62,_0x583d3b){return db['ChatGroup'][_0x31ae('0x5e')]()['then'](respondWithResult(_0x583d3b,null))['catch'](handleError(_0x583d3b,null));};exports[_0x31ae('0x5f')]=function(_0x4cb76c,_0x2e473d,_0xbbb55a){return db[_0x31ae('0x60')][_0x31ae('0x32')]({'where':{'ChatGroupId':_0x4cb76c[_0x31ae('0x5d')]['id'],'ToId':_0x4cb76c[_0x31ae('0x61')]['id'],'read':![]}})[_0x31ae('0x24')](function(_0x41034d){return{'id':_['toInteger'](_0x4cb76c[_0x31ae('0x5d')]['id']),'count':_0x41034d};})[_0x31ae('0x24')](respondWithResult(_0x2e473d,null))[_0x31ae('0x55')](handleError(_0x2e473d,null));};exports[_0x31ae('0x62')]=function(_0x2e3027,_0x35490e,_0x4a94fd){return db[_0x31ae('0x51')][_0x31ae('0x59')]({'where':{'id':_0x2e3027[_0x31ae('0x5d')]['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0x35490e,null))[_0x31ae('0x24')](function(_0x4c1f20){if(_0x4c1f20){return _0x4c1f20[_0x31ae('0x62')](_0x2e3027[_0x31ae('0x5c')][_0x31ae('0x63')],_[_0x31ae('0x64')](_0x2e3027['body'],['ids','id'])||{});}})[_0x31ae('0x24')](respondWithResult(_0x35490e,null))[_0x31ae('0x55')](handleError(_0x35490e,null));};exports[_0x31ae('0x65')]=function(_0x19e141,_0x14508c,_0x2d2d25){var _0x21f72c={};var _0x4255c6={};var _0x2295c0;var _0xb3bba1;return db['ChatGroup'][_0x31ae('0x66')]({'where':{'id':_0x19e141[_0x31ae('0x5d')]['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0x14508c,null))[_0x31ae('0x24')](function(_0x92dc8a){if(_0x92dc8a){_0x2295c0=_0x92dc8a;_0x4255c6['model']=_[_0x31ae('0x57')](db[_0x31ae('0x67')]['rawAttributes']);_0x4255c6[_0x31ae('0x3e')]=_[_0x31ae('0x57')](_0x19e141['query']);_0x4255c6['filters']=_[_0x31ae('0x41')](_0x4255c6[_0x31ae('0x3f')],_0x4255c6[_0x31ae('0x3e')]);_0x21f72c['attributes']=_[_0x31ae('0x41')](_0x4255c6[_0x31ae('0x3f')],qs[_0x31ae('0x42')](_0x19e141[_0x31ae('0x3e')][_0x31ae('0x42')]));_0x21f72c[_0x31ae('0x40')]=_0x21f72c[_0x31ae('0x40')][_0x31ae('0x43')]?_0x21f72c['attributes']:_0x4255c6['model'];_0x21f72c['order']=qs[_0x31ae('0x47')](_0x19e141[_0x31ae('0x3e')][_0x31ae('0x47')]);_0x21f72c[_0x31ae('0x48')]=qs[_0x31ae('0x4a')](_['pick'](_0x19e141[_0x31ae('0x3e')],_0x4255c6[_0x31ae('0x4a')]));if(_0x19e141['query'][_0x31ae('0x4b')]){_0x21f72c['where']=_[_0x31ae('0x4c')](_0x21f72c[_0x31ae('0x48')],{'$or':_[_0x31ae('0x4d')](_0x21f72c[_0x31ae('0x40')],function(_0x7e7cb1){var _0x5e3d68={};_0x5e3d68[_0x7e7cb1]={'$like':'%'+_0x19e141[_0x31ae('0x3e')][_0x31ae('0x4b')]+'%'};return _0x5e3d68;})});}_0x21f72c=_[_0x31ae('0x4c')]({},_0x21f72c,_0x19e141[_0x31ae('0x50')]);return _0x2295c0[_0x31ae('0x65')](_0x21f72c);}})[_0x31ae('0x24')](function(_0x381b39){if(_0x381b39){_0xb3bba1=_0x381b39[_0x31ae('0x43')];if(!_0x19e141[_0x31ae('0x3e')][_0x31ae('0x44')](_0x31ae('0x68'))){_0x21f72c[_0x31ae('0x45')]=qs[_0x31ae('0x45')](_0x19e141['query'][_0x31ae('0x45')]);_0x21f72c[_0x31ae('0x33')]=qs[_0x31ae('0x33')](_0x19e141['query'][_0x31ae('0x33')]);}return _0x2295c0[_0x31ae('0x65')](_0x21f72c);}})[_0x31ae('0x24')](function(_0x53af00){if(_0x53af00){return _0x53af00?{'count':_0xb3bba1,'rows':_0x53af00}:null;}})[_0x31ae('0x24')](respondWithResult(_0x14508c,null))[_0x31ae('0x55')](handleError(_0x14508c,null));};exports['removeMembers']=function(_0x4080f9,_0x1af6a1,_0x5a97c3){return db[_0x31ae('0x51')][_0x31ae('0x59')]({'where':{'id':_0x4080f9[_0x31ae('0x5d')]['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0x1af6a1,null))['then'](function(_0x637e54){if(_0x637e54){return _0x637e54[_0x31ae('0x69')](_0x4080f9[_0x31ae('0x3e')]['ids']);}})[_0x31ae('0x24')](respondWithStatusCode(_0x1af6a1,null))[_0x31ae('0x55')](handleError(_0x1af6a1,null));};exports[_0x31ae('0x6a')]=function(_0x4cd239,_0xdc98a7,_0x12b861){if(_0x4cd239[_0x31ae('0x5c')]['id']){delete _0x4cd239['body']['id'];}return db[_0x31ae('0x51')][_0x31ae('0x59')]({'where':{'id':_0x4cd239[_0x31ae('0x5d')]['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0xdc98a7,null))[_0x31ae('0x24')](function(_0x14cc11){if(_0x14cc11){_0x4cd239['body']['ChatGroupId']=_0x14cc11['id'];return db[_0x31ae('0x60')][_0x31ae('0x5a')](_0x4cd239[_0x31ae('0x5c')]);}})[_0x31ae('0x24')](respondWithResult(_0xdc98a7,null))[_0x31ae('0x55')](handleError(_0xdc98a7,null));};exports['getMessages']=function(_0x22d231,_0xd3449,_0x40d9ce){var _0x17dcb1={};var _0x426121={};var _0x42c4cd;var _0x46d50f;return db[_0x31ae('0x51')][_0x31ae('0x66')]({'where':{'id':_0x22d231['params']['id']}})[_0x31ae('0x24')](handleEntityNotFound(_0xd3449,null))[_0x31ae('0x24')](function(_0x38fbfb){if(_0x38fbfb){_0x42c4cd=_0x38fbfb;_0x426121['model']=_[_0x31ae('0x57')](db[_0x31ae('0x60')][_0x31ae('0x3d')]);_0x426121[_0x31ae('0x3e')]=_[_0x31ae('0x57')](_0x22d231['query']);_0x426121[_0x31ae('0x4a')]=_['intersection'](_0x426121['model'],_0x426121['query']);_0x17dcb1[_0x31ae('0x40')]=_[_0x31ae('0x41')](_0x426121[_0x31ae('0x3f')],qs[_0x31ae('0x42')](_0x22d231[_0x31ae('0x3e')]['fields']));_0x17dcb1['attributes']=_0x17dcb1[_0x31ae('0x40')][_0x31ae('0x43')]?_0x17dcb1[_0x31ae('0x40')]:_0x426121[_0x31ae('0x3f')];_0x17dcb1[_0x31ae('0x46')]=qs[_0x31ae('0x47')](_0x22d231[_0x31ae('0x3e')][_0x31ae('0x47')]);_0x17dcb1[_0x31ae('0x48')]=qs['filters'](_[_0x31ae('0x49')](_0x22d231['query'],_0x426121[_0x31ae('0x4a')]));if(_0x22d231['query'][_0x31ae('0x4b')]){_0x17dcb1[_0x31ae('0x48')]=_[_0x31ae('0x4c')](_0x17dcb1[_0x31ae('0x48')],{'$or':_[_0x31ae('0x4d')](_0x17dcb1[_0x31ae('0x40')],function(_0x232031){var _0x45a540={};_0x45a540[_0x232031]={'$like':'%'+_0x22d231['query'][_0x31ae('0x4b')]+'%'};return _0x45a540;})});}if(_0x22d231[_0x31ae('0x3e')][_0x31ae('0x6b')]){var _0x1f3134=_0x22d231['query'][_0x31ae('0x6b')]['split'](',');var _0x232b34={};_0x232b34[_0x1f3134[0x0]]={'$gte':moment(_0x1f3134[0x1])[_0x31ae('0x6c')](_0x31ae('0x6d'))};_0x17dcb1[_0x31ae('0x48')]=_[_0x31ae('0x4c')](_0x17dcb1[_0x31ae('0x48')],_0x232b34);}_0x17dcb1=_['merge']({},_0x17dcb1,_0x22d231[_0x31ae('0x50')]);return _0x42c4cd[_0x31ae('0x6e')](_0x17dcb1);}})['then'](function(_0xaf7712){if(_0xaf7712){_0x46d50f=_0xaf7712[_0x31ae('0x43')];if(!_0x22d231[_0x31ae('0x3e')]['hasOwnProperty'](_0x31ae('0x68'))){_0x17dcb1[_0x31ae('0x45')]=qs['limit'](_0x22d231[_0x31ae('0x3e')][_0x31ae('0x45')]);_0x17dcb1['offset']=qs[_0x31ae('0x33')](_0x22d231['query'][_0x31ae('0x33')]);}return _0x42c4cd[_0x31ae('0x6e')](_0x17dcb1);}})[_0x31ae('0x24')](function(_0x46e508){if(_0x46e508){return _0x46e508?{'count':_0x46d50f,'rows':_0x46e508}:null;}})[_0x31ae('0x24')](respondWithResult(_0xd3449,null))[_0x31ae('0x55')](handleError(_0xd3449,null));}; \ No newline at end of file +var _0x136c=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','VIRTUAL','field','options','ChatGroup','includeAll','include','findAll','rows','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','User','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','jayson/promise','client','http','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','ChatGroup,\x20%s,\x20%s','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','stack','name','index','rawAttributes','model','keys'];(function(_0x566666,_0x184095){var _0x35f7fb=function(_0x3abf96){while(--_0x3abf96){_0x566666['push'](_0x566666['shift']());}};_0x35f7fb(++_0x184095);}(_0x136c,0x1d2));var _0xc136=function(_0x2442ee,_0x27cb98){_0x2442ee=_0x2442ee-0x0;var _0x427cee=_0x136c[_0x2442ee];return _0x427cee;};'use strict';var pdf=require(_0xc136('0x0'));var emlformat=require(_0xc136('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc136('0x2'));var jsonpatch=require(_0xc136('0x3'));var rp=require(_0xc136('0x4'));var moment=require(_0xc136('0x5'));var BPromise=require(_0xc136('0x6'));var Mustache=require(_0xc136('0x7'));var util=require(_0xc136('0x8'));var path=require(_0xc136('0x9'));var sox=require(_0xc136('0xa'));var csv=require('to-csv');var ejs=require(_0xc136('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc136('0xc'));var crypto=require(_0xc136('0xd'));var jsforce=require(_0xc136('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc136('0xf'));var querystring=require('querystring');var Papa=require(_0xc136('0x10'));var Redis=require(_0xc136('0x11'));var authService=require(_0xc136('0x12'));var qs=require(_0xc136('0x13'));var hardwareService=require(_0xc136('0x14'));var logger=require(_0xc136('0x15'))(_0xc136('0x16'));var utils=require(_0xc136('0x17'));var config=require(_0xc136('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc136('0x19')](config['redis'],{'host':_0xc136('0x1a'),'port':0x18eb});var socket=require(_0xc136('0x1b'))(new Redis(config[_0xc136('0x1c')]));require('./chatGroup.socket')['register'](socket);var jayson=require(_0xc136('0x1d'));var client=jayson[_0xc136('0x1e')][_0xc136('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x5ecabc,_0x524b86,_0x2e28ba){if(_0x2e28ba){var _0x16e87f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16e87f['test'](_0x524b86)){return _0x5ecabc;}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 _0x5ecabc;}}function respondWithRpcPromise(_0x55a6c9,_0x3524ef,_0x3daf55,_0x192b3f){return new BPromise(function(_0x155929,_0x2b7e5a){var _0x1ccf5f=_0x192b3f||client;return _0x1ccf5f['request'](_0x55a6c9,_0x3daf55)['then'](function(_0x4d56cb){logger[_0xc136('0x20')]('ChatGroup,\x20%s,\x20%s',_0x3524ef,_0xc136('0x21'));logger[_0xc136('0x22')](_0xc136('0x23'),_0x3524ef,_0xc136('0x21'),JSON['stringify'](_0x4d56cb));if(_0x4d56cb[_0xc136('0x24')]){if(_0x4d56cb[_0xc136('0x24')]['code']===0x1f4){logger[_0xc136('0x24')]('ChatGroup,\x20%s,\x20%s',_0x3524ef,_0x4d56cb['error'][_0xc136('0x25')]);return _0x2b7e5a(_0x4d56cb[_0xc136('0x24')]['message']);}logger[_0xc136('0x24')](_0xc136('0x26'),_0x3524ef,_0x4d56cb[_0xc136('0x24')][_0xc136('0x25')]);return _0x155929(_0x4d56cb['error'][_0xc136('0x25')]);}else{logger[_0xc136('0x20')]('ChatGroup,\x20%s,\x20%s',_0x3524ef,_0xc136('0x21'));_0x155929(_0x4d56cb['result'][_0xc136('0x25')]);}})[_0xc136('0x27')](function(_0x4a9dad){logger['error'](_0xc136('0x26'),_0x3524ef,_0x4a9dad);_0x2b7e5a(_0x4a9dad);});});}function respondWithStatusCode(_0x10bda3,_0x549a60){_0x549a60=_0x549a60||0xcc;return function(_0x45e5c8){if(_0x45e5c8){return _0x10bda3[_0xc136('0x28')](_0x549a60);}return _0x10bda3[_0xc136('0x29')](_0x549a60)[_0xc136('0x2a')]();};}function respondWithResult(_0x1317b3,_0x1c1057){_0x1c1057=_0x1c1057||0xc8;return function(_0xa3e411){if(_0xa3e411){return _0x1317b3['status'](_0x1c1057)[_0xc136('0x2b')](_0xa3e411);}};}function respondWithFilteredResult(_0x1e023a,_0x1ad50f){return function(_0x1b5a23){if(_0x1b5a23){var _0x2bd5df=_0x1b5a23[_0xc136('0x2c')],_0x562ccd=_0x1ad50f['offset'],_0x309f54=_0x1ad50f[_0xc136('0x2d')]+_0x1ad50f[_0xc136('0x2e')],_0x1cba1e;if(_0x309f54>=_0x2bd5df){_0x309f54=_0x2bd5df;_0x1cba1e=0xc8;}else{_0x1cba1e=0xce;}_0x1e023a[_0xc136('0x29')](_0x1cba1e);return _0x1e023a['set'](_0xc136('0x2f'),_0x562ccd+'-'+_0x309f54+'/'+_0x2bd5df)['json'](_0x1b5a23);}return null;};}function patchUpdates(_0x4e5e09){return function(_0x1a29a5){try{jsonpatch[_0xc136('0x30')](_0x1a29a5,_0x4e5e09,!![]);}catch(_0x3f5b49){return BPromise['reject'](_0x3f5b49);}return _0x1a29a5[_0xc136('0x31')]();};}function saveUpdates(_0x2ace68,_0x4dc72d){return function(_0x9f52c){if(_0x9f52c){return _0x9f52c[_0xc136('0x32')](_0x2ace68)['then'](function(_0x1747e5){return _0x1747e5;});}return null;};}function removeEntity(_0x26d97f,_0x39e82b){return function(_0x420093){if(_0x420093){return _0x420093[_0xc136('0x33')]()[_0xc136('0x34')](function(){_0x26d97f[_0xc136('0x29')](0xcc)[_0xc136('0x2a')]();});}};}function handleEntityNotFound(_0x27fc88,_0x1469aa){return function(_0x22c9b0){if(!_0x22c9b0){_0x27fc88[_0xc136('0x28')](0x194);}return _0x22c9b0;};}function handleError(_0x4f0419,_0x20d05a){_0x20d05a=_0x20d05a||0x1f4;return function(_0x441041){logger[_0xc136('0x24')](_0x441041[_0xc136('0x35')]);if(_0x441041[_0xc136('0x36')]){delete _0x441041[_0xc136('0x36')];}_0x4f0419[_0xc136('0x29')](_0x20d05a)['send'](_0x441041);};}exports[_0xc136('0x37')]=function(_0x33c54c,_0x33e35e){var _0x1d6a38={},_0x1bdfce={},_0x1cea20={'count':0x0,'rows':[]};var _0x208b39=db['ChatGroup'][_0xc136('0x38')];_0x1bdfce[_0xc136('0x39')]=_[_0xc136('0x3a')](_0x208b39);_0x1bdfce[_0xc136('0x3b')]=_[_0xc136('0x3a')](_0x33c54c['query']);_0x1bdfce[_0xc136('0x3c')]=_[_0xc136('0x3d')](_0x1bdfce['model'],_0x1bdfce[_0xc136('0x3b')]);_0x1d6a38[_0xc136('0x3e')]=_[_0xc136('0x3d')](_0x1bdfce[_0xc136('0x39')],qs[_0xc136('0x3f')](_0x33c54c['query']['fields']));_0x1d6a38[_0xc136('0x3e')]=_0x1d6a38['attributes'][_0xc136('0x40')]?_0x1d6a38[_0xc136('0x3e')]:_0x1bdfce[_0xc136('0x39')];if(!_0x33c54c[_0xc136('0x3b')][_0xc136('0x41')](_0xc136('0x42'))){_0x1d6a38[_0xc136('0x2e')]=qs['limit'](_0x33c54c['query'][_0xc136('0x2e')]);_0x1d6a38['offset']=qs[_0xc136('0x2d')](_0x33c54c[_0xc136('0x3b')]['offset']);}_0x1d6a38[_0xc136('0x43')]=qs[_0xc136('0x44')](_0x33c54c['query']['sort']);_0x1d6a38['where']=qs[_0xc136('0x3c')](_[_0xc136('0x45')](_0x33c54c['query'],_0x1bdfce[_0xc136('0x3c')]));if(_0x33c54c[_0xc136('0x3b')][_0xc136('0x46')]){_0x1d6a38['where']=_[_0xc136('0x47')](_0x1d6a38[_0xc136('0x48')],{'$or':_[_0xc136('0x49')](_0x208b39,function(_0xb4a2ec){if(_0xb4a2ec[_0xc136('0x4a')]['key']!==_0xc136('0x4b')){var _0x3d7ab4={};_0x3d7ab4[_0xb4a2ec[_0xc136('0x4c')]]={'$like':'%'+_0x33c54c[_0xc136('0x3b')][_0xc136('0x46')]+'%'};return _0x3d7ab4;}})});}_0x1d6a38=_[_0xc136('0x47')]({},_0x1d6a38,_0x33c54c[_0xc136('0x4d')]);var _0x2e1ab3={'where':_0x1d6a38[_0xc136('0x48')]};return db[_0xc136('0x4e')][_0xc136('0x2c')](_0x2e1ab3)[_0xc136('0x34')](function(_0x156719){_0x1cea20[_0xc136('0x2c')]=_0x156719;if(_0x33c54c[_0xc136('0x3b')][_0xc136('0x4f')]){_0x1d6a38[_0xc136('0x50')]=[{'all':!![]}];}return db[_0xc136('0x4e')][_0xc136('0x51')](_0x1d6a38);})[_0xc136('0x34')](function(_0x5ad386){_0x1cea20[_0xc136('0x52')]=_0x5ad386;return _0x1cea20;})[_0xc136('0x34')](respondWithFilteredResult(_0x33e35e,_0x1d6a38))[_0xc136('0x27')](handleError(_0x33e35e,null));};exports['show']=function(_0x4ed2aa,_0x34193c){var _0x24f258={'raw':!![],'where':{'id':_0x4ed2aa[_0xc136('0x53')]['id']}},_0x14ea52={};_0x14ea52[_0xc136('0x39')]=_['keys'](db[_0xc136('0x4e')][_0xc136('0x38')]);_0x14ea52[_0xc136('0x3b')]=_[_0xc136('0x3a')](_0x4ed2aa[_0xc136('0x3b')]);_0x14ea52[_0xc136('0x3c')]=_[_0xc136('0x3d')](_0x14ea52['model'],_0x14ea52[_0xc136('0x3b')]);_0x24f258[_0xc136('0x3e')]=_[_0xc136('0x3d')](_0x14ea52[_0xc136('0x39')],qs['fields'](_0x4ed2aa['query'][_0xc136('0x3f')]));_0x24f258[_0xc136('0x3e')]=_0x24f258['attributes'][_0xc136('0x40')]?_0x24f258[_0xc136('0x3e')]:_0x14ea52[_0xc136('0x39')];if(_0x4ed2aa[_0xc136('0x3b')][_0xc136('0x4f')]){_0x24f258[_0xc136('0x50')]=[{'all':!![]}];}_0x24f258=_[_0xc136('0x47')]({},_0x24f258,_0x4ed2aa[_0xc136('0x4d')]);return db[_0xc136('0x4e')][_0xc136('0x54')](_0x24f258)['then'](handleEntityNotFound(_0x34193c,null))['then'](respondWithResult(_0x34193c,null))[_0xc136('0x27')](handleError(_0x34193c,null));};exports[_0xc136('0x55')]=function(_0x38168,_0x1779a4){return db[_0xc136('0x4e')][_0xc136('0x55')](_0x38168[_0xc136('0x56')],{})[_0xc136('0x34')](respondWithResult(_0x1779a4,0xc9))['catch'](handleError(_0x1779a4,null));};exports['update']=function(_0x56f636,_0x5cc9ce){if(_0x56f636[_0xc136('0x56')]['id']){delete _0x56f636['body']['id'];}return db['ChatGroup'][_0xc136('0x54')]({'where':{'id':_0x56f636['params']['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x5cc9ce,null))[_0xc136('0x34')](saveUpdates(_0x56f636['body'],null))[_0xc136('0x34')](respondWithResult(_0x5cc9ce,null))[_0xc136('0x27')](handleError(_0x5cc9ce,null));};exports[_0xc136('0x33')]=function(_0x4f6ded,_0x5f31d4){return db[_0xc136('0x4e')][_0xc136('0x54')]({'where':{'id':_0x4f6ded[_0xc136('0x53')]['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x5f31d4,null))[_0xc136('0x34')](removeEntity(_0x5f31d4,null))[_0xc136('0x27')](handleError(_0x5f31d4,null));};exports[_0xc136('0x57')]=function(_0x992410,_0x1790c6){return db[_0xc136('0x4e')][_0xc136('0x57')]()[_0xc136('0x34')](respondWithResult(_0x1790c6,null))[_0xc136('0x27')](handleError(_0x1790c6,null));};exports[_0xc136('0x58')]=function(_0x159547,_0x45d87e,_0x108db4){return db[_0xc136('0x59')][_0xc136('0x2c')]({'where':{'ChatGroupId':_0x159547[_0xc136('0x53')]['id'],'ToId':_0x159547[_0xc136('0x5a')]['id'],'read':![]}})['then'](function(_0x4f9a61){return{'id':_[_0xc136('0x5b')](_0x159547[_0xc136('0x53')]['id']),'count':_0x4f9a61};})[_0xc136('0x34')](respondWithResult(_0x45d87e,null))[_0xc136('0x27')](handleError(_0x45d87e,null));};exports[_0xc136('0x5c')]=function(_0x41fa22,_0x38058e,_0x81a7a0){return db[_0xc136('0x4e')][_0xc136('0x54')]({'where':{'id':_0x41fa22[_0xc136('0x53')]['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x38058e,null))[_0xc136('0x34')](function(_0x501c43){if(_0x501c43){return _0x501c43[_0xc136('0x5c')](_0x41fa22['body']['ids'],_[_0xc136('0x5d')](_0x41fa22['body'],['ids','id'])||{});}})[_0xc136('0x34')](respondWithResult(_0x38058e,null))[_0xc136('0x27')](handleError(_0x38058e,null));};exports[_0xc136('0x5e')]=function(_0x5c17b4,_0x11ced0,_0x4532d2){var _0x144970={};var _0x3a49ca={};var _0x4ff6ed;var _0x5f08da;return db['ChatGroup']['findOne']({'where':{'id':_0x5c17b4[_0xc136('0x53')]['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x11ced0,null))[_0xc136('0x34')](function(_0x1e83c0){if(_0x1e83c0){_0x4ff6ed=_0x1e83c0;_0x3a49ca['model']=_['keys'](db[_0xc136('0x5f')][_0xc136('0x38')]);_0x3a49ca[_0xc136('0x3b')]=_[_0xc136('0x3a')](_0x5c17b4[_0xc136('0x3b')]);_0x3a49ca['filters']=_[_0xc136('0x3d')](_0x3a49ca[_0xc136('0x39')],_0x3a49ca[_0xc136('0x3b')]);_0x144970['attributes']=_[_0xc136('0x3d')](_0x3a49ca['model'],qs[_0xc136('0x3f')](_0x5c17b4['query'][_0xc136('0x3f')]));_0x144970[_0xc136('0x3e')]=_0x144970[_0xc136('0x3e')][_0xc136('0x40')]?_0x144970[_0xc136('0x3e')]:_0x3a49ca[_0xc136('0x39')];_0x144970[_0xc136('0x43')]=qs[_0xc136('0x44')](_0x5c17b4[_0xc136('0x3b')][_0xc136('0x44')]);_0x144970[_0xc136('0x48')]=qs['filters'](_[_0xc136('0x45')](_0x5c17b4[_0xc136('0x3b')],_0x3a49ca[_0xc136('0x3c')]));if(_0x5c17b4[_0xc136('0x3b')][_0xc136('0x46')]){_0x144970[_0xc136('0x48')]=_[_0xc136('0x47')](_0x144970[_0xc136('0x48')],{'$or':_[_0xc136('0x49')](_0x144970['attributes'],function(_0x2035dd){var _0x143297={};_0x143297[_0x2035dd]={'$like':'%'+_0x5c17b4[_0xc136('0x3b')][_0xc136('0x46')]+'%'};return _0x143297;})});}_0x144970=_[_0xc136('0x47')]({},_0x144970,_0x5c17b4[_0xc136('0x4d')]);return _0x4ff6ed['getMembers'](_0x144970);}})['then'](function(_0x1c97ff){if(_0x1c97ff){_0x5f08da=_0x1c97ff['length'];if(!_0x5c17b4[_0xc136('0x3b')][_0xc136('0x41')](_0xc136('0x42'))){_0x144970['limit']=qs['limit'](_0x5c17b4['query'][_0xc136('0x2e')]);_0x144970[_0xc136('0x2d')]=qs[_0xc136('0x2d')](_0x5c17b4[_0xc136('0x3b')][_0xc136('0x2d')]);}return _0x4ff6ed[_0xc136('0x5e')](_0x144970);}})[_0xc136('0x34')](function(_0x51432b){if(_0x51432b){return _0x51432b?{'count':_0x5f08da,'rows':_0x51432b}:null;}})[_0xc136('0x34')](respondWithResult(_0x11ced0,null))[_0xc136('0x27')](handleError(_0x11ced0,null));};exports[_0xc136('0x60')]=function(_0x1417d0,_0x467da0,_0xc8c294){return db[_0xc136('0x4e')][_0xc136('0x54')]({'where':{'id':_0x1417d0[_0xc136('0x53')]['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x467da0,null))['then'](function(_0x5c834c){if(_0x5c834c){return _0x5c834c[_0xc136('0x60')](_0x1417d0[_0xc136('0x3b')][_0xc136('0x61')]);}})['then'](respondWithStatusCode(_0x467da0,null))['catch'](handleError(_0x467da0,null));};exports[_0xc136('0x62')]=function(_0x17d241,_0x2c3bce,_0xa9ddfb){if(_0x17d241[_0xc136('0x56')]['id']){delete _0x17d241[_0xc136('0x56')]['id'];}return db[_0xc136('0x4e')][_0xc136('0x54')]({'where':{'id':_0x17d241[_0xc136('0x53')]['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x2c3bce,null))['then'](function(_0x2922f3){if(_0x2922f3){_0x17d241[_0xc136('0x56')][_0xc136('0x63')]=_0x2922f3['id'];return db['ChatInternalMessage'][_0xc136('0x55')](_0x17d241['body']);}})['then'](respondWithResult(_0x2c3bce,null))[_0xc136('0x27')](handleError(_0x2c3bce,null));};exports[_0xc136('0x64')]=function(_0x2476e9,_0x4b5e03,_0x30f850){var _0x25a0a7={};var _0x11b545={};var _0xd7b9ae;var _0x1eb35c;return db['ChatGroup']['findOne']({'where':{'id':_0x2476e9['params']['id']}})[_0xc136('0x34')](handleEntityNotFound(_0x4b5e03,null))[_0xc136('0x34')](function(_0x59d320){if(_0x59d320){_0xd7b9ae=_0x59d320;_0x11b545[_0xc136('0x39')]=_['keys'](db[_0xc136('0x59')][_0xc136('0x38')]);_0x11b545[_0xc136('0x3b')]=_[_0xc136('0x3a')](_0x2476e9[_0xc136('0x3b')]);_0x11b545['filters']=_['intersection'](_0x11b545[_0xc136('0x39')],_0x11b545[_0xc136('0x3b')]);_0x25a0a7['attributes']=_[_0xc136('0x3d')](_0x11b545[_0xc136('0x39')],qs['fields'](_0x2476e9[_0xc136('0x3b')]['fields']));_0x25a0a7[_0xc136('0x3e')]=_0x25a0a7[_0xc136('0x3e')][_0xc136('0x40')]?_0x25a0a7[_0xc136('0x3e')]:_0x11b545['model'];_0x25a0a7[_0xc136('0x43')]=qs[_0xc136('0x44')](_0x2476e9['query'][_0xc136('0x44')]);_0x25a0a7['where']=qs['filters'](_['pick'](_0x2476e9['query'],_0x11b545[_0xc136('0x3c')]));if(_0x2476e9[_0xc136('0x3b')]['filter']){_0x25a0a7[_0xc136('0x48')]=_[_0xc136('0x47')](_0x25a0a7[_0xc136('0x48')],{'$or':_[_0xc136('0x49')](_0x25a0a7[_0xc136('0x3e')],function(_0xaa2d40){var _0x2a9e0b={};_0x2a9e0b[_0xaa2d40]={'$like':'%'+_0x2476e9['query'][_0xc136('0x46')]+'%'};return _0x2a9e0b;})});}if(_0x2476e9[_0xc136('0x3b')][_0xc136('0x65')]){var _0x259c4c=_0x2476e9[_0xc136('0x3b')][_0xc136('0x65')][_0xc136('0x66')](',');var _0x1b2404={};_0x1b2404[_0x259c4c[0x0]]={'$gte':moment(_0x259c4c[0x1])[_0xc136('0x67')](_0xc136('0x68'))};_0x25a0a7[_0xc136('0x48')]=_[_0xc136('0x47')](_0x25a0a7[_0xc136('0x48')],_0x1b2404);}_0x25a0a7=_[_0xc136('0x47')]({},_0x25a0a7,_0x2476e9[_0xc136('0x4d')]);return _0xd7b9ae[_0xc136('0x64')](_0x25a0a7);}})[_0xc136('0x34')](function(_0x3bf32f){if(_0x3bf32f){_0x1eb35c=_0x3bf32f['length'];if(!_0x2476e9[_0xc136('0x3b')][_0xc136('0x41')](_0xc136('0x42'))){_0x25a0a7['limit']=qs[_0xc136('0x2e')](_0x2476e9['query']['limit']);_0x25a0a7[_0xc136('0x2d')]=qs[_0xc136('0x2d')](_0x2476e9[_0xc136('0x3b')]['offset']);}return _0xd7b9ae[_0xc136('0x64')](_0x25a0a7);}})['then'](function(_0x33933d){if(_0x33933d){return _0x33933d?{'count':_0x1eb35c,'rows':_0x33933d}:null;}})[_0xc136('0x34')](respondWithResult(_0x4b5e03,null))[_0xc136('0x27')](handleError(_0x4b5e03,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 983b3cd..ca65468 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 _0x7662=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0x7662,0x172));var _0x2766=function(_0x28529c,_0x326fd3){_0x28529c=_0x28529c-0x0;var _0x5cebb4=_0x7662[_0x28529c];return _0x5cebb4;};'use strict';var EventEmitter=require(_0x2766('0x0'));var ChatGroup=require(_0x2766('0x1'))['db'][_0x2766('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2766('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2766('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd06f2b){return function(_0x3e5c3d,_0x3a0a69,_0x273ad2){ChatGroupEvents[_0x2766('0x5')](_0xd06f2b+':'+_0x3e5c3d['id'],_0x3e5c3d);ChatGroupEvents[_0x2766('0x5')](_0xd06f2b,_0x3e5c3d);_0x273ad2(null);};}for(var e in events){if(events[_0x2766('0x6')](e)){var event=events[e];ChatGroup[_0x2766('0x7')](e,emitEvent(event));}}module[_0x2766('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x597b=['remove','emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3f4515,_0x104de0){var _0x4ee4fd=function(_0x5a2eec){while(--_0x5a2eec){_0x3f4515['push'](_0x3f4515['shift']());}};_0x4ee4fd(++_0x104de0);}(_0x597b,0x13a));var _0xb597=function(_0x446a49,_0x11d18b){_0x446a49=_0x446a49-0x0;var _0x413eb1=_0x597b[_0x446a49];return _0x413eb1;};'use strict';var EventEmitter=require(_0xb597('0x0'));var ChatGroup=require(_0xb597('0x1'))['db'][_0xb597('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb597('0x3')](0x0);var events={'afterCreate':_0xb597('0x4'),'afterUpdate':_0xb597('0x5'),'afterDestroy':_0xb597('0x6')};function emitEvent(_0x64cec4){return function(_0x55bc42,_0x282d1c,_0x515b89){ChatGroupEvents[_0xb597('0x7')](_0x64cec4+':'+_0x55bc42['id'],_0x55bc42);ChatGroupEvents[_0xb597('0x7')](_0x64cec4,_0x55bc42);_0x515b89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xb597('0x8')](e,emitEvent(event));}}module[_0xb597('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 53b4a19..47dde86 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 _0x5c62=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','api'];(function(_0x62ff29,_0x5b5d4c){var _0x63583b=function(_0x3de158){while(--_0x3de158){_0x62ff29['push'](_0x62ff29['shift']());}};_0x63583b(++_0x5b5d4c);}(_0x5c62,0x6c));var _0x25c6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c62[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x25c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25c6('0x1'));var moment=require(_0x25c6('0x2'));var BPromise=require(_0x25c6('0x3'));var rp=require(_0x25c6('0x4'));var fs=require('fs');var path=require(_0x25c6('0x5'));var rimraf=require(_0x25c6('0x6'));var config=require(_0x25c6('0x7'));var attributes=require('./chatGroup.attributes');module[_0x25c6('0x8')]=function(_0x184400,_0x304f3e){return _0x184400[_0x25c6('0x9')](_0x25c6('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fa1=['moment','request-promise','path','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash','../../config/logger','api'];(function(_0x396e90,_0x4c7718){var _0xaf7e4c=function(_0x2a96bc){while(--_0x2a96bc){_0x396e90['push'](_0x396e90['shift']());}};_0xaf7e4c(++_0x4c7718);}(_0x6fa1,0x147));var _0x16fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6fa1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x16fa('0x0'));var util=require('util');var logger=require(_0x16fa('0x1'))(_0x16fa('0x2'));var moment=require(_0x16fa('0x3'));var BPromise=require('bluebird');var rp=require(_0x16fa('0x4'));var fs=require('fs');var path=require(_0x16fa('0x5'));var rimraf=require(_0x16fa('0x6'));var config=require('../../config/environment');var attributes=require(_0x16fa('0x7'));module[_0x16fa('0x8')]=function(_0x269df2,_0x4b635d){return _0x269df2[_0x16fa('0x9')]('ChatGroup',attributes,{'tableName':_0x16fa('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 d33fe69..6c69c96 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 _0xc3b5=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xcab854,_0x113252){_0xcab854=_0xcab854-0x0;var _0x168f13=_0xc3b5[_0xcab854];return _0x168f13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});config[_0x5c3b('0xa')]=_[_0x5c3b('0xb')](config[_0x5c3b('0xa')],{'host':_0x5c3b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c3b('0xa')]));require(_0x5c3b('0xd'))[_0x5c3b('0xe')](socket);function respondWithRpcPromise(_0x20e71,_0x4ddddd,_0x20dd86){return new BPromise(function(_0x22eaf0,_0x30ceca){return client[_0x5c3b('0xf')](_0x20e71,_0x20dd86)[_0x5c3b('0x10')](function(_0x5b9f7e){logger[_0x5c3b('0x11')](_0x5c3b('0x12'),_0x4ddddd,'request\x20sent');logger[_0x5c3b('0x13')](_0x5c3b('0x14'),_0x4ddddd,'request\x20sent',JSON[_0x5c3b('0x15')](_0x5b9f7e));if(_0x5b9f7e[_0x5c3b('0x16')]){if(_0x5b9f7e[_0x5c3b('0x16')][_0x5c3b('0x17')]===0x1f4){logger[_0x5c3b('0x16')](_0x5c3b('0x12'),_0x4ddddd,_0x5b9f7e[_0x5c3b('0x16')]['message']);return _0x30ceca(_0x5b9f7e[_0x5c3b('0x16')]['message']);}logger['error'](_0x5c3b('0x12'),_0x4ddddd,_0x5b9f7e[_0x5c3b('0x16')][_0x5c3b('0x18')]);return _0x22eaf0(_0x5b9f7e['error'][_0x5c3b('0x18')]);}else{logger[_0x5c3b('0x11')](_0x5c3b('0x12'),_0x4ddddd,'request\x20sent');_0x22eaf0(_0x5b9f7e[_0x5c3b('0x19')][_0x5c3b('0x18')]);}})['catch'](function(_0x3973bc){logger[_0x5c3b('0x16')](_0x5c3b('0x12'),_0x4ddddd,_0x3973bc);_0x30ceca(_0x3973bc);});});} \ No newline at end of file +var _0x8d0e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x2c8db1,_0x502dd0){var _0x3d7c23=function(_0x269239){while(--_0x269239){_0x2c8db1['push'](_0x2c8db1['shift']());}};_0x3d7c23(++_0x502dd0);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x18787d,_0x4f0130){_0x18787d=_0x18787d-0x0;var _0x32b144=_0x8d0e[_0x18787d];return _0x32b144;};'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});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 0004599..51e0a8c 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 _0x4d9e=['removeListener','register','length','chatGroup:','./chatGroup.events','update','emit'];(function(_0x4e69f7,_0x4266f5){var _0x3f5476=function(_0x111f6e){while(--_0x111f6e){_0x4e69f7['push'](_0x4e69f7['shift']());}};_0x3f5476(++_0x4266f5);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x2250cf,_0x1af8b9){_0x2250cf=_0x2250cf-0x0;var _0x1bec8c=_0x4d9e[_0x2250cf];return _0x1bec8c;};'use strict';var ChatGroupEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatGroupEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatGroupEvents['on'](_0x54a63a,_0x36316f);}}; \ No newline at end of file +var _0x5d31=['save','remove','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x427399,_0x4f2316){var _0xed8c67=function(_0x302cf5){while(--_0x302cf5){_0x427399['push'](_0x427399['shift']());}};_0xed8c67(++_0x4f2316);}(_0x5d31,0xb7));var _0x15d3=function(_0x35f18a,_0x4e66d3){_0x35f18a=_0x35f18a-0x0;var _0x52d4e0=_0x5d31[_0x35f18a];return _0x52d4e0;};'use strict';var ChatGroupEvents=require(_0x15d3('0x0'));var events=[_0x15d3('0x1'),_0x15d3('0x2'),'update'];function createListener(_0x3aaddc,_0x3a3511){return function(_0x4eecbd){_0x3a3511[_0x15d3('0x3')](_0x3aaddc,_0x4eecbd);};}function removeListener(_0x526c77,_0x4f54e9){return function(){ChatGroupEvents[_0x15d3('0x4')](_0x526c77,_0x4f54e9);};}exports[_0x15d3('0x5')]=function(_0x4177c1){for(var _0x378cb7=0x0,_0x1f7128=events[_0x15d3('0x6')];_0x378cb7<_0x1f7128;_0x378cb7++){var _0x5ab85a=events[_0x378cb7];var _0x169a5e=createListener(_0x15d3('0x7')+_0x5ab85a,_0x4177c1);ChatGroupEvents['on'](_0x5ab85a,_0x169a5e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2d809f0..06defb7 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 _0xbb98=['post','create','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMessages'];(function(_0x5152e6,_0x3a7f4f){var _0x4e045a=function(_0x64057a){while(--_0x64057a){_0x5152e6['push'](_0x5152e6['shift']());}};_0x4e045a(++_0x3a7f4f);}(_0xbb98,0xe3));var _0x8bb9=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xbb98[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require('multer');var util=require(_0x8bb9('0x0'));var path=require(_0x8bb9('0x1'));var timeout=require(_0x8bb9('0x2'));var express=require('express');var router=express[_0x8bb9('0x3')]();var auth=require(_0x8bb9('0x4'));var interaction=require(_0x8bb9('0x5'));var config=require(_0x8bb9('0x6'));var controller=require(_0x8bb9('0x7'));router[_0x8bb9('0x8')]('/',auth[_0x8bb9('0x9')](),controller['index']);router[_0x8bb9('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8bb9('0xa'),auth['isAuthenticated'](),controller[_0x8bb9('0xb')]);router['get'](_0x8bb9('0xc'),auth[_0x8bb9('0x9')](),controller[_0x8bb9('0xd')]);router[_0x8bb9('0x8')](_0x8bb9('0xe'),auth[_0x8bb9('0x9')](),controller['getMembers']);router[_0x8bb9('0x8')]('/:id/messages',auth[_0x8bb9('0x9')](),controller[_0x8bb9('0xf')]);router[_0x8bb9('0x10')]('/',auth[_0x8bb9('0x9')](),controller[_0x8bb9('0x11')]);router[_0x8bb9('0x10')](_0x8bb9('0xe'),auth[_0x8bb9('0x9')](),controller[_0x8bb9('0x12')]);router[_0x8bb9('0x10')](_0x8bb9('0x13'),auth['isAuthenticated'](),controller[_0x8bb9('0x14')]);router[_0x8bb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x8bb9('0x16')]);router[_0x8bb9('0x17')]('/:id',auth[_0x8bb9('0x9')](),controller[_0x8bb9('0x18')]);router['delete']('/:id/members',auth[_0x8bb9('0x9')](),controller[_0x8bb9('0x19')]);module[_0x8bb9('0x1a')]=router; \ No newline at end of file +var _0xa7a1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xa7a1,0x108));var _0x1a7a=function(_0x100d63,_0x2dfabc){_0x100d63=_0x100d63-0x0;var _0x3e4ed9=_0xa7a1[_0x100d63];return _0x3e4ed9;};'use strict';var multer=require(_0x1a7a('0x0'));var util=require(_0x1a7a('0x1'));var path=require(_0x1a7a('0x2'));var timeout=require(_0x1a7a('0x3'));var express=require(_0x1a7a('0x4'));var router=express[_0x1a7a('0x5')]();var auth=require(_0x1a7a('0x6'));var interaction=require(_0x1a7a('0x7'));var config=require(_0x1a7a('0x8'));var controller=require(_0x1a7a('0x9'));router[_0x1a7a('0xa')]('/',auth[_0x1a7a('0xb')](),controller[_0x1a7a('0xc')]);router[_0x1a7a('0xa')](_0x1a7a('0xd'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x1a7a('0xb')](),controller[_0x1a7a('0xe')]);router[_0x1a7a('0xa')](_0x1a7a('0xf'),auth[_0x1a7a('0xb')](),controller['getUnread']);router[_0x1a7a('0xa')](_0x1a7a('0x10'),auth['isAuthenticated'](),controller[_0x1a7a('0x11')]);router[_0x1a7a('0xa')](_0x1a7a('0x12'),auth[_0x1a7a('0xb')](),controller[_0x1a7a('0x13')]);router[_0x1a7a('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0x1a7a('0x15')]);router[_0x1a7a('0x14')](_0x1a7a('0x12'),auth[_0x1a7a('0xb')](),controller[_0x1a7a('0x16')]);router[_0x1a7a('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1a7a('0x18')]('/:id',auth[_0x1a7a('0xb')](),controller['destroy']);router[_0x1a7a('0x18')](_0x1a7a('0x10'),auth[_0x1a7a('0xb')](),controller[_0x1a7a('0x19')]);module[_0x1a7a('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 2659fe9..c49b11d 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 _0x3266=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3266,0x6a));var _0x6326=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3266[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'closed':{'type':Sequelize[_0x6326('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6326('0x3')]},'ratingType':{'type':Sequelize[_0x6326('0x4')](_0x6326('0x5'),_0x6326('0x6')),'defaultValue':_0x6326('0x5')},'ratingMessage':{'type':Sequelize[_0x6326('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6326('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6326('0x8')]},'note':{'type':Sequelize[_0x6326('0x8')]},'browserName':{'type':Sequelize[_0x6326('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6326('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6326('0x8')]},'deviceVendor':{'type':Sequelize[_0x6326('0x8')]},'deviceType':{'type':Sequelize[_0x6326('0x8')]},'referer':{'type':Sequelize[_0x6326('0x8')]},'customerIp':{'type':Sequelize[_0x6326('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x6326('0x9'))},'read1stAt':{'type':Sequelize[_0x6326('0xa')]},'lastMsgAt':{'type':Sequelize[_0x6326('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x6326('0x4')]('in',_0x6326('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6326('0x8')]}}; \ No newline at end of file +var _0x1339=['STRING','long','out','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x1339,0x1ed));var _0x9133=function(_0x3bc97a,_0x692993){_0x3bc97a=_0x3bc97a-0x0;var _0x20b1d7=_0x1339[_0x3bc97a];return _0x20b1d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x9133('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9133('0x1')]},'ratingType':{'type':Sequelize[_0x9133('0x2')](_0x9133('0x3'),_0x9133('0x4')),'defaultValue':_0x9133('0x3')},'ratingMessage':{'type':Sequelize[_0x9133('0x5')]},'pathTranscript':{'type':Sequelize[_0x9133('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9133('0x6')]},'disposition':{'type':Sequelize[_0x9133('0x7')]},'note':{'type':Sequelize[_0x9133('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x9133('0x7')]},'osName':{'type':Sequelize[_0x9133('0x7')]},'osVersion':{'type':Sequelize[_0x9133('0x7')]},'deviceModel':{'type':Sequelize[_0x9133('0x7')]},'deviceVendor':{'type':Sequelize[_0x9133('0x7')]},'deviceType':{'type':Sequelize[_0x9133('0x7')]},'referer':{'type':Sequelize[_0x9133('0x7')]},'customerIp':{'type':Sequelize[_0x9133('0x7')]},'formData':{'type':Sequelize[_0x9133('0x5')](_0x9133('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9133('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x9133('0x2')]('in',_0x9133('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9133('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index e381ea2..41252d3 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 _0x5db3=['where','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','me.direction\x20=\x20\x27in\x27','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','expr','advancedFilter','createdAt','value','dateStart','startOf','day','format','utc','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20IN\x20?','LIKE','c.lastName','\x20<\x20?','map','isNil','ChatWebsiteId','$gte','parse','filter','replace','isNumeric','i.id\x20LIKE\x20?','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','read','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','%s\x20=\x200','toString','sequelize','keyBy','a.key','Account.key','Contact.firstName','Contact.email','c.phone','c.fax','Contact.fax','groupBy','ChatInteractionId','all','rows','params','rawAttributes','includeAll','include','merge','options','find','create','body','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','ValidationError','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','ChatWebsite','CmContact','%s%d','agentAlias','UserId','System','customer','agentIdentifier','website_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','auth','user','pass','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','hasOwnProperty','setTags','spread','chatInteractionTags:save','removeTags','unix','server','files','tmp','Contact','lastName','Account','Owner','get','10px','30px','%s\x20#%d','Chat','N.A.','closedAt','osName','referer','customerIp','existsSync','pipe','createWriteStream','direction','out','firstName','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','./chatInteraction.socket','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','info','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','closed','unreadMessages','ChatMessage','Users','TagIds','Tags','split','forEach','push','catch','index','ChatInteraction','keys','query','filters','intersection','attributes','model','fields','length','nolimit','sort'];(function(_0xb880b7,_0x279a54){var _0x49aa41=function(_0x31daf1){while(--_0x31daf1){_0xb880b7['push'](_0xb880b7['shift']());}};_0x49aa41(++_0x279a54);}(_0x5db3,0x1d6));var _0x35db=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x5db3[_0x2e0443];return _0x52d450;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x35db('0x0'));var rimraf=require(_0x35db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35db('0x2'));var rp=require(_0x35db('0x3'));var moment=require(_0x35db('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x35db('0x5'));var csv=require(_0x35db('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x35db('0x7'));var squel=require(_0x35db('0x8'));var crypto=require('crypto');var jsforce=require(_0x35db('0x9'));var deskjs=require(_0x35db('0xa'));var toCsv=require('to-csv');var querystring=require(_0x35db('0xb'));var Papa=require(_0x35db('0xc'));var Redis=require('ioredis');var authService=require(_0x35db('0xd'));var qs=require(_0x35db('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x35db('0xf'));var db=require('../../mysqldb')['db'];config[_0x35db('0x10')]=_[_0x35db('0x11')](config[_0x35db('0x10')],{'host':_0x35db('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35db('0x10')]));require(_0x35db('0x13'))[_0x35db('0x14')](socket);var jayson=require('jayson/promise');var client=jayson[_0x35db('0x15')][_0x35db('0x16')]({'port':0x232b});var client9004=jayson[_0x35db('0x15')][_0x35db('0x16')]({'port':0x232c});function checkPasswordPattern(_0x399629,_0x239860,_0x1f8e9f){if(_0x1f8e9f){var _0x181a7b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x181a7b['test'](_0x239860)){return _0x399629;}else{throw new Error(_0x35db('0x17'));}}else{return _0x399629;}}function respondWithRpcPromise(_0x1741d3,_0x57a860,_0x3ef926,_0x1a5a08){return new BPromise(function(_0x1f7c0e,_0x104eea){var _0x12060f=_0x1a5a08||client;return _0x12060f[_0x35db('0x18')](_0x1741d3,_0x3ef926)['then'](function(_0x324303){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x57a860,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x57a860,_0x35db('0x19'),JSON['stringify'](_0x324303));if(_0x324303[_0x35db('0x1a')]){if(_0x324303[_0x35db('0x1a')][_0x35db('0x1b')]===0x1f4){logger[_0x35db('0x1a')](_0x35db('0x1c'),_0x57a860,_0x324303[_0x35db('0x1a')][_0x35db('0x1d')]);return _0x104eea(_0x324303[_0x35db('0x1a')][_0x35db('0x1d')]);}logger[_0x35db('0x1a')](_0x35db('0x1c'),_0x57a860,_0x324303[_0x35db('0x1a')][_0x35db('0x1d')]);return _0x1f7c0e(_0x324303[_0x35db('0x1a')][_0x35db('0x1d')]);}else{logger[_0x35db('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x57a860,_0x35db('0x19'));_0x1f7c0e(_0x324303['result'][_0x35db('0x1d')]);}})['catch'](function(_0x4104b0){logger[_0x35db('0x1a')](_0x35db('0x1c'),_0x57a860,_0x4104b0);_0x104eea(_0x4104b0);});});}function respondWithStatusCode(_0x152fa3,_0x343448){_0x343448=_0x343448||0xcc;return function(_0x3d30ee){if(_0x3d30ee){return _0x152fa3[_0x35db('0x1f')](_0x343448);}return _0x152fa3[_0x35db('0x20')](_0x343448)[_0x35db('0x21')]();};}function respondWithResult(_0xdaa702,_0x4b60a8){_0x4b60a8=_0x4b60a8||0xc8;return function(_0x55bbbb){if(_0x55bbbb){return _0xdaa702[_0x35db('0x20')](_0x4b60a8)[_0x35db('0x22')](_0x55bbbb);}};}function respondWithFilteredResult(_0x4c2a52,_0x452079){return function(_0x14de43){if(_0x14de43){var _0xa74cef=_0x14de43[_0x35db('0x23')],_0x4f4b0d=_0x452079[_0x35db('0x24')],_0x3d5359=_0x452079[_0x35db('0x24')]+_0x452079[_0x35db('0x25')],_0x4d46f6;if(_0x3d5359>=_0xa74cef){_0x3d5359=_0xa74cef;_0x4d46f6=0xc8;}else{_0x4d46f6=0xce;}_0x4c2a52[_0x35db('0x20')](_0x4d46f6);return _0x4c2a52[_0x35db('0x26')](_0x35db('0x27'),_0x4f4b0d+'-'+_0x3d5359+'/'+_0xa74cef)['json'](_0x14de43);}return null;};}function patchUpdates(_0x54cbc8){return function(_0x383189){try{jsonpatch[_0x35db('0x28')](_0x383189,_0x54cbc8,!![]);}catch(_0x588126){return BPromise[_0x35db('0x29')](_0x588126);}return _0x383189['save']();};}function saveUpdates(_0x171406,_0x35d866){return function(_0x5e0a1e){if(_0x5e0a1e){return _0x5e0a1e[_0x35db('0x2a')](_0x171406)[_0x35db('0x2b')](function(_0x21daa1){return _0x21daa1;});}return null;};}function removeEntity(_0x1cdd85,_0x2d3478){return function(_0x5860bd){if(_0x5860bd){return _0x5860bd[_0x35db('0x2c')]()[_0x35db('0x2b')](function(){_0x1cdd85[_0x35db('0x20')](0xcc)[_0x35db('0x21')]();});}};}function handleEntityNotFound(_0x393070,_0xbc1659){return function(_0x4a1db5){if(!_0x4a1db5){_0x393070[_0x35db('0x1f')](0x194);}return _0x4a1db5;};}function handleError(_0x344efc,_0xb3810e){_0xb3810e=_0xb3810e||0x1f4;return function(_0x44d8e7){logger['error'](_0x44d8e7[_0x35db('0x2d')]);if(_0x44d8e7['name']){delete _0x44d8e7[_0x35db('0x2e')];}_0x344efc['status'](_0xb3810e)[_0x35db('0x2f')](_0x44d8e7);};}function getInteractionUnreadMessages(_0x1a39f2){return new BPromise(function(_0x4916d4,_0x522f41){try{if(_0x1a39f2[_0x35db('0x30')]){_0x1a39f2[_0x35db('0x31')]=0x0;_0x4916d4(_0x1a39f2);}else{return db[_0x35db('0x32')][_0x35db('0x23')]({'where':{'ChatInteractionId':_0x1a39f2['id'],'direction':'in','read':![]}})['then'](function(_0x292ea1){_0x1a39f2[_0x35db('0x31')]=_0x292ea1;_0x4916d4(_0x1a39f2);});}}catch(_0x5b005a){_0x522f41(_0x5b005a);}});}function getInteractionUsers(_0x285186,_0x218b22){return new BPromise(function(_0xcd870d,_0x1e2b9b){try{if(_0x218b22[_0x285186['id']]){_0x285186[_0x35db('0x33')]=_['map'](_0x218b22[_0x285186['id']],function(_0x69fe2a){return{'id':_0x69fe2a['id']};});}}catch(_0x5ec00c){_0x1e2b9b(_0x5ec00c);}_0xcd870d(_0x285186);});}function getInteractionTags(_0x199fca,_0x37bf1d){return new BPromise(function(_0x159f76,_0x4123db){try{if(_0x199fca[_0x35db('0x34')]){_0x199fca[_0x35db('0x35')]=[];_0x199fca[_0x35db('0x34')][_0x35db('0x36')](',')[_0x35db('0x37')](function(_0x5a782){_0x199fca['Tags'][_0x35db('0x38')](_0x37bf1d[_0x5a782]);});}delete _0x199fca[_0x35db('0x34')];}catch(_0x2e379e){_0x4123db(_0x2e379e);}_0x159f76(_0x199fca);});}function updateChatInteraction(_0x2e615f,_0x4a4288,_0x3a7525){return new BPromise(function(_0x520ee8,_0x3cf119){return getInteractionUnreadMessages(_0x2e615f)['then'](function(_0x1adef4){return getInteractionUsers(_0x1adef4,_0x3a7525);})[_0x35db('0x2b')](function(_0x1f03e8){return getInteractionTags(_0x1f03e8,_0x4a4288);})[_0x35db('0x2b')](function(_0x5cdecf){_0x520ee8(_0x5cdecf);})[_0x35db('0x39')](function(_0x3e896b){_0x3cf119(_0x3e896b);});});}exports[_0x35db('0x3a')]=function(_0x4c38c1,_0x39fe56){var _0x3a75dd={},_0x56c672={},_0x15636e={'count':0x0,'rows':[]};var _0x5021cd=db[_0x35db('0x3b')]['rawAttributes'];_0x56c672['model']=_[_0x35db('0x3c')](_0x5021cd);_0x56c672[_0x35db('0x3d')]=_[_0x35db('0x3c')](_0x4c38c1[_0x35db('0x3d')]);_0x56c672[_0x35db('0x3e')]=_[_0x35db('0x3f')](_0x56c672['model'],_0x56c672['query']);_0x3a75dd[_0x35db('0x40')]=_[_0x35db('0x3f')](_0x56c672[_0x35db('0x41')],qs[_0x35db('0x42')](_0x4c38c1[_0x35db('0x3d')][_0x35db('0x42')]));_0x3a75dd[_0x35db('0x40')]=_0x3a75dd['attributes'][_0x35db('0x43')]?_0x3a75dd[_0x35db('0x40')]:_0x56c672[_0x35db('0x41')];if(!_0x4c38c1['query']['hasOwnProperty'](_0x35db('0x44'))){_0x3a75dd[_0x35db('0x25')]=qs['limit'](_0x4c38c1['query'][_0x35db('0x25')]);_0x3a75dd[_0x35db('0x24')]=qs[_0x35db('0x24')](_0x4c38c1[_0x35db('0x3d')][_0x35db('0x24')]);}_0x3a75dd['order']=qs['sort'](_0x4c38c1[_0x35db('0x3d')][_0x35db('0x45')]);_0x3a75dd[_0x35db('0x46')]=qs['filters'](_[_0x35db('0x47')](_0x4c38c1['query'],_0x56c672[_0x35db('0x3e')]));var _0x150020=[];var _0x3ad4c7=squel[_0x35db('0x48')]()[_0x35db('0x49')]('id')['field'](_0x35db('0x2e'))[_0x35db('0x49')](_0x35db('0x4a'))[_0x35db('0x4b')](_0x35db('0x4c'));var _0x3747a4=squel['select']()[_0x35db('0x49')](_0x35db('0x4d'))[_0x35db('0x4b')](_0x35db('0x4e'),'me')[_0x35db('0x46')]('me.ChatInteractionId\x20=\x20i.id')[_0x35db('0x46')](_0x35db('0x4f'))[_0x35db('0x46')]('me.read\x20=\x20false');var _0x5adc66=squel['select']()[_0x35db('0x49')]('u.id')[_0x35db('0x49')](_0x35db('0x50'))['from'](_0x35db('0x51'),'ui')[_0x35db('0x52')](_0x35db('0x53'),'u',_0x35db('0x54'));var _0x1ae871=squel[_0x35db('0x48')]()[_0x35db('0x4b')]('chat_interactions','i')[_0x35db('0x52')](_0x35db('0x55'),'c',_0x35db('0x56'))[_0x35db('0x52')](_0x35db('0x53'),'o',_0x35db('0x57'))['left_join'](_0x35db('0x58'),'a',_0x35db('0x59'))[_0x35db('0x52')]('chat_messages','me',_0x35db('0x5a'));var _0x52daa6=squel[_0x35db('0x5b')]();if(_0x4c38c1[_0x35db('0x3d')][_0x35db('0x5c')]){var _0x3cade7=JSON['parse'](_0x4c38c1[_0x35db('0x3d')][_0x35db('0x5c')]);_[_0x35db('0x3c')](_0x3cade7)[_0x35db('0x37')](function(_0x1c5062){var _0x1cd127=_0x3cade7[_0x1c5062];if(_0x1c5062===_0x35db('0x5d')){var _0x6b134c=moment(_0x1cd127[_0x35db('0x5e')][_0x35db('0x5f')])[_0x35db('0x60')](_0x35db('0x61'))['utc']()[_0x35db('0x62')]();var _0x40dd4a=moment(_0x40dd4a)[_0x35db('0x63')]()['endOf'](_0x35db('0x61'))[_0x35db('0x62')]();_0x52daa6[_0x35db('0x64')](_0x35db('0x65'),_0x6b134c,_0x40dd4a);}else{if(_[_0x35db('0x66')](_0x1cd127['condition'])){_0x1cd127['condition'][_0x35db('0x37')](function(_0x517085){switch(_0x1cd127[_0x35db('0x67')]['value']){case'IS':if(_0x1c5062!==_0x35db('0x68')&&_0x1c5062!==_0x35db('0x69')){if(_[_0x35db('0x66')](_0x1cd127[_0x35db('0x5e')])&&_0x1cd127[_0x35db('0x5e')][_0x35db('0x43')]>0x1){_0x52daa6[_0x35db('0x64')](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+'\x20IN\x20?',_0x1cd127['value']);}else{_0x52daa6[_0x35db('0x64')](_0x1cd127['tableAlias']+'.'+_0x1c5062+_0x35db('0x6b'),_0x1cd127[_0x35db('0x5e')][0x0]);}}break;case'=':_0x52daa6['and'](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x6b'),_0x1cd127[_0x35db('0x5e')]);break;case'LIKE':if(_0x1c5062===_0x35db('0x6c')){_0x52daa6[_0x35db('0x64')](_0x35db('0x6d')+'\x20LIKE\x20?','%'+_0x1cd127[_0x35db('0x5e')]+'%');_0x52daa6['or']('c.lastName'+_0x35db('0x6e'),'%'+_0x1cd127[_0x35db('0x5e')]+'%');_0x52daa6['or'](_0x35db('0x6f')+'\x20LIKE\x20?','%'+_0x1cd127['value']+'%');}else{_0x52daa6[_0x35db('0x64')](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x6e'),'%'+_0x1cd127[_0x35db('0x5e')]+'%');}break;case'>':_0x52daa6[_0x35db('0x64')](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x70'),_0x1cd127[_0x35db('0x5e')]);break;case'<':_0x52daa6[_0x35db('0x64')](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+'\x20<\x20?',_0x1cd127[_0x35db('0x5e')]);break;}});}else{switch(_0x1cd127[_0x35db('0x67')][_0x35db('0x5e')]){case'IS':if(_0x1c5062!==_0x35db('0x68')&&_0x1c5062!=='Messages.count'){if(_['isArray'](_0x1cd127[_0x35db('0x5e')])&&_0x1cd127[_0x35db('0x5e')]['length']>0x1){_0x52daa6['and'](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x71'),_0x1cd127[_0x35db('0x5e')]);}else{_0x52daa6[_0x35db('0x64')](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x6b'),_0x1cd127[_0x35db('0x5e')][0x0]);}}break;case'=':_0x52daa6[_0x35db('0x64')](_0x1cd127['tableAlias']+'.'+_0x1c5062+'\x20=\x20?',_0x1cd127['value']);break;case _0x35db('0x72'):if(_0x1c5062===_0x35db('0x6c')){_0x52daa6[_0x35db('0x64')]('c.firstName'+_0x35db('0x6e'),'%'+_0x1cd127[_0x35db('0x5e')]+'%');_0x52daa6['or'](_0x35db('0x73')+_0x35db('0x6e'),'%'+_0x1cd127[_0x35db('0x5e')]+'%');_0x52daa6['or']('c.email'+_0x35db('0x6e'),'%'+_0x1cd127[_0x35db('0x5e')]+'%');}else{_0x52daa6['and'](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+'\x20LIKE\x20?','%'+_0x1cd127[_0x35db('0x5e')]+'%');}break;case'>':_0x52daa6['and'](_0x1cd127['tableAlias']+'.'+_0x1c5062+'\x20>\x20?',_0x1cd127[_0x35db('0x5e')]);break;case'<':_0x52daa6['and'](_0x1cd127[_0x35db('0x6a')]+'.'+_0x1c5062+_0x35db('0x74'),_0x1cd127[_0x35db('0x5e')]);break;}}}});}else{var _0xe29eeb=_(Object[_0x35db('0x3c')](_0x4c38c1['query']))[_0x35db('0x75')](function(_0x4813a4){return _0x5021cd['hasOwnProperty'](_0x4813a4)?_0x4813a4:undefined;})['filter'](function(_0x1ed138){return!_[_0x35db('0x76')](_0x1ed138);})[_0x35db('0x5e')]();if(!_['isEmpty'](_0xe29eeb)){_0xe29eeb[_0x35db('0x37')](function(_0x2d5d8b){if(_0x2d5d8b===_0x35db('0x77')){_0x1ae871[_0x35db('0x46')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x4c38c1[_0x35db('0x3d')][_0x2d5d8b]));}else if(_0x2d5d8b===_0x35db('0x5d')){var _0x1a8da6=JSON['parse'](_0x4c38c1[_0x35db('0x3d')][_0x2d5d8b])[_0x35db('0x78')];var _0x2d5ba1=JSON[_0x35db('0x79')](_0x4c38c1['query'][_0x2d5d8b])['$lte'];_0x1ae871['where'](_0x35db('0x65'),_0x1a8da6,_0x2d5ba1);}else{if(_0x4c38c1[_0x35db('0x3d')][_0x2d5d8b]==='null'){_0x1ae871['where']('i.'+_0x2d5d8b+'\x20IS\x20NULL');}else{_0x1ae871[_0x35db('0x46')]('i.'+_0x2d5d8b+_0x35db('0x6b'),_0x4c38c1['query'][_0x2d5d8b]);}}});}if(_0x4c38c1['query']['filter']){var _0x3ca4a4=_0x4c38c1[_0x35db('0x3d')][_0x35db('0x7a')][_0x35db('0x7b')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x35db('0x7c')](_0x3ca4a4)){_0x52daa6['or'](_0x35db('0x7d'),_0x3ca4a4+'%');}else{var _0x236206=[];_0x3ca4a4[_0x35db('0x36')]('\x20')['forEach'](function(_0x362663){_0x236206[_0x35db('0x38')]('+'+_0x362663['toString']());});var _0x5234ea=_0x236206[_0x35db('0x7e')]('\x20');_0x52daa6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x5234ea)['or'](_0x35db('0x7f'),_0x3ca4a4+'%');}}}_0x1ae871[_0x35db('0x46')](_0x52daa6);if(_0x3a75dd[_0x35db('0x80')]){_0x3a75dd[_0x35db('0x80')][_0x35db('0x37')](function(_0x443976){_0x1ae871[_0x35db('0x80')]('i.'+_0x443976[0x0],_0x443976[0x1]===_0x35db('0x81')?![]:!![]);});}_0x1ae871[_0x35db('0x82')](_0x35db('0x83'));var _0x25dfeb={'type':db[_0x35db('0x84')][_0x35db('0x85')][_0x35db('0x86')],'raw':!![]};var _0x5b7329=_0x1ae871[_0x35db('0x87')]()[_0x35db('0x49')](_0x35db('0x4d'));if(!_0x4c38c1[_0x35db('0x3d')][_0x35db('0x5c')]){if(_0x4c38c1['query'][_0x35db('0x88')]){if(_0x4c38c1['query'][_0x35db('0x88')]==0x1){_0x5b7329[_0x35db('0x46')](util[_0x35db('0x62')]('%s\x20=\x200',_0x3747a4['toString']()));_0x1ae871[_0x35db('0x89')](_0x35db('0x8a'));}else{_0x5b7329[_0x35db('0x46')](util[_0x35db('0x62')](_0x35db('0x8b'),_0x3747a4['toString']()));_0x1ae871[_0x35db('0x89')](_0x35db('0x8c'));}}if(_0x4c38c1['query'][_0x35db('0x8d')]){var _0x1dfdaf=_[_0x35db('0x66')](_0x4c38c1['query'][_0x35db('0x8d')])?_0x4c38c1[_0x35db('0x3d')][_0x35db('0x8d')]:new Array(_0x4c38c1[_0x35db('0x3d')][_0x35db('0x8d')]);var _0x2355ec=squel[_0x35db('0x5b')]();_0x1dfdaf[_0x35db('0x37')](function(_0x23dc01){_0x2355ec['or'](_0x35db('0x8e'),'%,'+_0x23dc01+',%');});_0x1ae871['having'](_0x2355ec);_0x5b7329[_0x35db('0x52')](_0x35db('0x8f'),'it',_0x35db('0x90'));_0x5b7329[_0x35db('0x52')](_0x35db('0x4c'),'t',_0x35db('0x91'));_0x5b7329[_0x35db('0x46')]('t.id\x20IN\x20?',_0x1dfdaf);}}else{var _0x3cade7=JSON[_0x35db('0x79')](_0x4c38c1['query'][_0x35db('0x5c')]);_[_0x35db('0x3c')](_0x3cade7)[_0x35db('0x37')](function(_0x115330){var _0x3380a2=_0x3cade7[_0x115330];if(_0x115330==='TagId'){var _0x4b7e56=_0x3380a2[_0x35db('0x5e')];var _0x3e8a93=squel[_0x35db('0x5b')]();_0x4b7e56[_0x35db('0x37')](function(_0x1115c1){_0x3e8a93['or'](_0x35db('0x8e'),'%,'+_0x1115c1+',%');});_0x1ae871[_0x35db('0x89')](_0x3e8a93);_0x5b7329[_0x35db('0x52')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x5b7329[_0x35db('0x52')](_0x35db('0x4c'),'t',_0x35db('0x91'));_0x5b7329['where'](_0x35db('0x92'),_0x4b7e56);}else if(_0x115330===_0x35db('0x69')){if(_0x3380a2[_0x35db('0x5e')][_0x35db('0x43')]===0x1){if(_0x3380a2[_0x35db('0x5e')][0x0]===0x1){_0x5b7329[_0x35db('0x46')](util['format'](_0x35db('0x93'),_0x3747a4[_0x35db('0x94')]()));_0x1ae871[_0x35db('0x89')]('`Messages.count`\x20=\x200');}else{_0x5b7329[_0x35db('0x46')](util[_0x35db('0x62')]('%s\x20>\x200',_0x3747a4[_0x35db('0x94')]()));_0x1ae871[_0x35db('0x89')]('`Messages.count`\x20>\x200');}}}});}db[_0x35db('0x95')][_0x35db('0x3d')](_0x5b7329[_0x35db('0x94')](),_0x25dfeb)[_0x35db('0x2b')](function(_0x80f87){_0x15636e[_0x35db('0x23')]=_0x80f87[_0x35db('0x43')];if(_0x15636e['count']===0x0)return[];return db['sequelize'][_0x35db('0x3d')](_0x3ad4c7['toString'](),_0x25dfeb)[_0x35db('0x2b')](function(_0x2d6086){_0x150020=_[_0x35db('0x96')](_0x2d6086,'id');_0x25dfeb=_['merge'](_0x25dfeb,{'model':db[_0x35db('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ae871[_0x35db('0x49')](_0x35db('0x97'),_0x35db('0x98'));_0x1ae871[_0x35db('0x49')]('i.*');_0x1ae871['field'](_0x35db('0x6d'),_0x35db('0x99'));_0x1ae871[_0x35db('0x49')](_0x35db('0x73'),'Contact.lastName');_0x1ae871[_0x35db('0x49')](_0x35db('0x6f'),_0x35db('0x9a'));_0x1ae871['field'](_0x35db('0x9b'),'Contact.phone');_0x1ae871[_0x35db('0x49')]('c.mobile','Contact.mobile');_0x1ae871['field'](_0x35db('0x9c'),_0x35db('0x9d'));_0x1ae871['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x35db('0x34'));_0x1ae871[_0x35db('0x52')]('chat_interaction_has_tags','it',_0x35db('0x90'));_0x1ae871['left_join'](_0x35db('0x4c'),'t',_0x35db('0x91'));_0x1ae871[_0x35db('0x25')](_0x3a75dd[_0x35db('0x25')]);_0x1ae871['offset'](_0x3a75dd['offset']);return db[_0x35db('0x95')][_0x35db('0x3d')](_0x1ae871['toString'](),_0x25dfeb);})[_0x35db('0x2b')](function(_0x3c0304){_0x5adc66[_0x35db('0x46')]('ui.ChatInteractionId\x20IN\x20?',_[_0x35db('0x75')](_0x3c0304,'id'));return db[_0x35db('0x95')][_0x35db('0x3d')](_0x5adc66['toString'](),_0x25dfeb)[_0x35db('0x2b')](function(_0x2e19ca){var _0x5f5b01=_[_0x35db('0x9e')](_0x2e19ca,_0x35db('0x9f'));var _0x1248cf=[];_0x3c0304['forEach'](function(_0x558a4b){_0x1248cf[_0x35db('0x38')](updateChatInteraction(_0x558a4b,_0x150020,_0x5f5b01));});return BPromise[_0x35db('0xa0')](_0x1248cf);});});})[_0x35db('0x2b')](function(_0x40823d){_0x15636e[_0x35db('0xa1')]=_0x40823d;return _0x15636e;})[_0x35db('0x2b')](respondWithFilteredResult(_0x39fe56,_0x3a75dd))['catch'](handleError(_0x39fe56,null));};exports['show']=function(_0x12b378,_0x30bf00){var _0x33fe9d={'raw':![],'where':{'id':_0x12b378[_0x35db('0xa2')]['id']}},_0x530e44={};_0x530e44[_0x35db('0x41')]=_['keys'](db[_0x35db('0x3b')][_0x35db('0xa3')]);_0x530e44[_0x35db('0x3d')]=_['keys'](_0x12b378['query']);_0x530e44[_0x35db('0x3e')]=_[_0x35db('0x3f')](_0x530e44[_0x35db('0x41')],_0x530e44[_0x35db('0x3d')]);_0x33fe9d[_0x35db('0x40')]=_[_0x35db('0x3f')](_0x530e44['model'],qs[_0x35db('0x42')](_0x12b378['query'][_0x35db('0x42')]));_0x33fe9d[_0x35db('0x40')]=_0x33fe9d[_0x35db('0x40')][_0x35db('0x43')]?_0x33fe9d[_0x35db('0x40')]:_0x530e44[_0x35db('0x41')];if(_0x12b378[_0x35db('0x3d')][_0x35db('0xa4')]){_0x33fe9d[_0x35db('0xa5')]=[{'all':!![]}];}_0x33fe9d=_[_0x35db('0xa6')]({},_0x33fe9d,_0x12b378[_0x35db('0xa7')]);return db['ChatInteraction'][_0x35db('0xa8')](_0x33fe9d)[_0x35db('0x2b')](handleEntityNotFound(_0x30bf00,null))[_0x35db('0x2b')](respondWithResult(_0x30bf00,null))['catch'](handleError(_0x30bf00,null));};exports[_0x35db('0xa9')]=function(_0x494475,_0x13d45c){return db[_0x35db('0x3b')][_0x35db('0xa9')](_0x494475['body'],{})[_0x35db('0x2b')](respondWithResult(_0x13d45c,0xc9))[_0x35db('0x39')](handleError(_0x13d45c,null));};exports[_0x35db('0x2a')]=function(_0x1dfbfa,_0x1db9a6){if(_0x1dfbfa[_0x35db('0xaa')]['id']){delete _0x1dfbfa['body']['id'];}return db[_0x35db('0x3b')][_0x35db('0xa8')]({'where':{'id':_0x1dfbfa[_0x35db('0xa2')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x1db9a6,null))[_0x35db('0x2b')](saveUpdates(_0x1dfbfa['body'],null))['then'](respondWithResult(_0x1db9a6,null))[_0x35db('0x39')](handleError(_0x1db9a6,null));};exports['destroy']=function(_0x303bd6,_0xb29767){return db[_0x35db('0x3b')][_0x35db('0xa8')]({'where':{'id':_0x303bd6[_0x35db('0xa2')]['id']}})['then'](handleEntityNotFound(_0xb29767,null))[_0x35db('0x2b')](removeEntity(_0xb29767,null))[_0x35db('0x39')](handleError(_0xb29767,null));};exports['describe']=function(_0x2f1f93,_0x127032){return db[_0x35db('0x3b')][_0x35db('0xab')]()[_0x35db('0x2b')](respondWithResult(_0x127032,null))[_0x35db('0x39')](handleError(_0x127032,null));};exports[_0x35db('0xac')]=function(_0x10e708,_0x34b670){if(_0x10e708[_0x35db('0xaa')]['id']){delete _0x10e708[_0x35db('0xaa')]['id'];}return db[_0x35db('0x3b')][_0x35db('0xa8')]({'where':{'id':_0x10e708[_0x35db('0xa2')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x34b670,null))[_0x35db('0x2b')](saveUpdates(_0x10e708['body'],null))[_0x35db('0x2b')](respondWithResult(_0x34b670,null))[_0x35db('0x39')](handleError(_0x34b670,null));};exports[_0x35db('0xad')]=function(_0x2c09cc,_0x49ce22,_0x4a65aa){if(_0x2c09cc[_0x35db('0xaa')]['id']){delete _0x2c09cc['body']['id'];}return db[_0x35db('0x3b')]['find']({'where':{'id':_0x2c09cc['params']['id']}})[_0x35db('0x2b')](function(_0x70de7b){if(!_0x70de7b){logger['error'](_0x35db('0xae'),'abandon',0x194,'entity\x20not\x20found');_0x49ce22[_0x35db('0x1f')](0x194);}else{if(_0x70de7b['UserId']){throw new db[(_0x35db('0x84'))][(_0x35db('0xaf'))](_0x35db('0xb0'));}}return _0x70de7b;})[_0x35db('0x2b')](function(_0x2e95ad){if(_0x2e95ad){return _0x2e95ad[_0x35db('0x2a')]({'closed':_0x2c09cc[_0x35db('0xaa')]['closed'],'disposition':_0x2c09cc[_0x35db('0xaa')][_0x35db('0xb1')]})['then'](function(_0x163bf8){return _0x163bf8;});}})[_0x35db('0x2b')](function(_0x50d03d){return respondWithRpcPromise(_0x35db('0xb2'),_0x35db('0xad'),_0x2c09cc[_0x35db('0xaa')],client9004);})['then'](respondWithResult(_0x49ce22,null))[_0x35db('0x39')](handleError(_0x49ce22,null));};exports[_0x35db('0xb3')]=function(_0x3aa8e4,_0x4bf814,_0x405413){_0x3aa8e4['body'][_0x35db('0x2e')]=_0x3aa8e4[_0x35db('0xb4')][_0x35db('0xb5')];_0x3aa8e4[_0x35db('0xaa')][_0x35db('0xb6')]=_0x3aa8e4[_0x35db('0xb4')][_0x35db('0xb7')];_0x3aa8e4[_0x35db('0xaa')][_0x35db('0xb8')]=_0x3aa8e4[_0x35db('0xb4')][_0x35db('0xb9')];return db[_0x35db('0xba')][_0x35db('0xa9')](_0x3aa8e4[_0x35db('0xaa')])['then'](respondWithResult(_0x4bf814,0xc9))[_0x35db('0x39')](handleError(_0x4bf814,null));};exports[_0x35db('0xbb')]=function(_0xe11523,_0x4c6d9a,_0x4fcf44){return db[_0x35db('0x3b')][_0x35db('0xbc')]({'where':{'id':_0xe11523[_0x35db('0xa2')]['id']},'raw':!![]})[_0x35db('0x2b')](handleEntityNotFound(_0x4c6d9a,null))[_0x35db('0x2b')](function(_0x4d0126){if(_0x4d0126){if(_0x4d0126[_0x35db('0x30')]){return _0x4c6d9a[_0x35db('0x20')](0x193)[_0x35db('0x22')]({'status':0x193,'message':_0x35db('0xbd')});}return db[_0x35db('0xba')][_0x35db('0xbc')]({'where':{'id':_0xe11523['query'][_0x35db('0xbe')]},'raw':!![]})['then'](handleEntityNotFound(_0x4c6d9a,null));}})['then'](function(_0x206b8a){if(_0x206b8a){return _0x4c6d9a[_0x35db('0xbf')](path[_0x35db('0x7e')](config[_0x35db('0xc0')],_0x35db('0xc1'),_0x206b8a[_0x35db('0xb6')]));}})['catch'](handleError(_0x4c6d9a,null));};exports[_0x35db('0xc2')]=function(_0x51fd3f,_0x17dc9b){var _0x57fe43=null;var _0x5e8bd1=null;var _0x47bd8f=null;var _0x294568=null;if(_0x51fd3f[_0x35db('0xaa')]['id']){delete _0x51fd3f[_0x35db('0xaa')]['id'];}if(_0x51fd3f['body'][_0x35db('0xc3')]){_0x294568=path[_0x35db('0x7e')](config['root'],_0x35db('0xc4'),util[_0x35db('0x62')]('transcript-%s.txt',Date['now']()));_0x51fd3f[_0x35db('0xaa')][_0x35db('0xc5')]=_0x294568;}return db[_0x35db('0x3b')][_0x35db('0xa8')]({'where':{'id':_0x51fd3f[_0x35db('0xa2')]['id']},'include':[{'model':db[_0x35db('0x32')],'as':_0x35db('0xc6'),'include':[{'model':db[_0x35db('0xc7')],'as':'User'}]}]})[_0x35db('0x2b')](handleEntityNotFound(_0x17dc9b,null))[_0x35db('0x2b')](saveUpdates(_0x51fd3f[_0x35db('0xaa')],null))[_0x35db('0x2b')](function(_0x4333be){if(_0x4333be){_0x57fe43=_0x4333be;return db[_0x35db('0xc8')]['find']({'where':{'id':_0x57fe43[_0x35db('0x77')]}});}})[_0x35db('0x2b')](function(_0xd9ba75){if(_0xd9ba75){_0x47bd8f=_0xd9ba75;return db[_0x35db('0xc9')]['find']({'where':{'id':_0x57fe43[_0x35db('0x6c')]}});}})[_0x35db('0x2b')](function(_0x52aed1){if(_0x52aed1){_0x5e8bd1=_0x52aed1;if(_0x294568){var _0x177a82=null;for(var _0x24b328=0x1;_0x24b328<_0x57fe43[_0x35db('0xc6')]['length'];++_0x24b328){_0x177a82=_0x57fe43[_0x35db('0xc6')][_0x24b328];var _0x56e726=_0x177a82['UserId']?util[_0x35db('0x62')](_0x35db('0xca'),_0x47bd8f[_0x35db('0xcb')],_0x177a82[_0x35db('0xcc')]):_0x35db('0xcd');var _0x5428a9=_0x51fd3f[_0x35db('0xaa')][_0x35db('0xce')]||util[_0x35db('0x62')](_0x35db('0xca'),'Visitor',_0x177a82['ContactId']);switch(_0x47bd8f[_0x35db('0xcf')]){case _0x35db('0xd0'):_0x56e726=_0x177a82[_0x35db('0xcc')]?util['format'](_0x35db('0xca'),_0x47bd8f['agentAlias'],_0x177a82['UserId']):_0x35db('0xcd');break;case'agent_alias':_0x56e726=_0x177a82[_0x35db('0xcc')]?_0x177a82[_0x35db('0xc7')][_0x35db('0xd1')]||_0x177a82['User'][_0x35db('0xd2')]:_0x35db('0xcd');break;case'agent_fullname':_0x56e726=_0x177a82[_0x35db('0xcc')]?_0x177a82[_0x35db('0xc7')][_0x35db('0xd2')]:_0x35db('0xcd');break;default:_0x56e726=_0x177a82[_0x35db('0xcc')]?util['format'](_0x35db('0xca'),_0x47bd8f['agentAlias'],_0x177a82[_0x35db('0xcc')]):_0x35db('0xcd');}var _0x1c9ec4=util[_0x35db('0x62')](_0x35db('0xd3'),moment(_0x177a82[_0x35db('0x5d')])[_0x35db('0x62')](_0x35db('0xd4')),_0x177a82['direction']==='in'?_0x5428a9:_0x56e726,_0x177a82[_0x35db('0xaa')]);if(!_0x177a82[_0x35db('0xd5')]){fs['appendFileSync'](_0x294568,_0x1c9ec4);}}return db[_0x35db('0xd6')][_0x35db('0xbc')]({'where':{'service':!![]},'include':[{'model':db[_0x35db('0xd7')],'as':'Smtp','raw':!![]}]});}}})[_0x35db('0x2b')](function(_0x3de83c){if(_0x3de83c&&_0x3de83c[_0x35db('0xd8')]&&_0x51fd3f[_0x35db('0xaa')]){var _0x30a47e={'tls':{'rejectUnauthorized':![]}};if(_0x3de83c['Smtp'][_0x35db('0xd9')]){_0x30a47e[_0x35db('0xd9')]=_0x3de83c[_0x35db('0xd8')][_0x35db('0xd9')];}else{_0x30a47e['host']=_0x3de83c[_0x35db('0xd8')][_0x35db('0xda')];_0x30a47e[_0x35db('0xdb')]=_0x3de83c[_0x35db('0xd8')]['port'];_0x30a47e['secure']=_0x3de83c[_0x35db('0xd8')]['secure'];}if(_0x3de83c['Smtp']['authentication']){_0x30a47e[_0x35db('0xdc')]={'user':_0x3de83c['Smtp'][_0x35db('0xdd')],'pass':_0x3de83c[_0x35db('0xd8')][_0x35db('0xde')]};}return respondWithRpcPromise('SendMail',_0x35db('0xdf'),{'account':_0x30a47e,'message':{'from':util[_0x35db('0x62')](_0x35db('0xe0'),_0x3de83c[_0x35db('0x2e')],_0x3de83c[_0x35db('0xe1')]||_0x3de83c['Smtp'][_0x35db('0xdd')]),'to':_0x51fd3f[_0x35db('0xaa')][_0x35db('0xc3')],'subject':_0x35db('0xe2'),'text':util[_0x35db('0x62')](_0x35db('0xe3'),_0x51fd3f[_0x35db('0xaa')][_0x35db('0xc3')]),'attachments':[{'path':_0x294568}]}})['then'](function(){return _0x57fe43;})['catch'](function(_0x14ad62){console[_0x35db('0x1a')](_0x14ad62);});}else{return _0x57fe43;}})[_0x35db('0x2b')](respondWithStatusCode(_0x17dc9b,0xc8))[_0x35db('0x39')](handleError(_0x17dc9b,null));};exports[_0x35db('0xe4')]=function(_0x2b8486,_0x5a5f32,_0x54f6c1){return db[_0x35db('0x32')][_0x35db('0xa8')]({'where':{'id':_0x2b8486['params']['id']}})['then'](handleEntityNotFound(_0x5a5f32,null))[_0x35db('0x2b')](function(_0x15fd51){if(_0x15fd51){return _0x15fd51[_0x35db('0xe4')](_0x2b8486['body']['ids'],_[_0x35db('0xe5')](_0x2b8486[_0x35db('0xaa')],[_0x35db('0xe6'),'id'])||{});}})[_0x35db('0x2b')](respondWithResult(_0x5a5f32,null))[_0x35db('0x39')](handleError(_0x5a5f32,null));};exports['getMessages']=function(_0x4438cf,_0x501c70,_0x1c6efe){var _0x4df42c={'raw':![],'where':{}};var _0xa76986={};var _0xcc8fa5={'count':0x0,'rows':[]};return db[_0x35db('0x3b')][_0x35db('0xbc')]({'where':{'id':_0x4438cf[_0x35db('0xa2')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x501c70,null))[_0x35db('0x2b')](function(_0x293ab8){if(_0x293ab8){_0xa76986[_0x35db('0x41')]=_['keys'](db[_0x35db('0x32')]['rawAttributes']);_0xa76986[_0x35db('0x3d')]=_['keys'](_0x4438cf[_0x35db('0x3d')]);_0xa76986[_0x35db('0x3e')]=_[_0x35db('0x3f')](_0xa76986[_0x35db('0x41')],_0xa76986[_0x35db('0x3d')]);_0x4df42c['attributes']=_['intersection'](_0xa76986['model'],qs[_0x35db('0x42')](_0x4438cf['query'][_0x35db('0x42')]));_0x4df42c[_0x35db('0x40')]=_0x4df42c['attributes'][_0x35db('0x43')]?_0x4df42c[_0x35db('0x40')]:_0xa76986['model'];if(!_0x4438cf[_0x35db('0x3d')]['hasOwnProperty'](_0x35db('0x44'))){_0x4df42c['limit']=qs['limit'](_0x4438cf[_0x35db('0x3d')][_0x35db('0x25')]);_0x4df42c[_0x35db('0x24')]=qs[_0x35db('0x24')](_0x4438cf[_0x35db('0x3d')]['offset']);}_0x4df42c[_0x35db('0x80')]=qs[_0x35db('0x45')](_0x4438cf[_0x35db('0x3d')]['sort']);_0x4df42c[_0x35db('0x46')]=qs[_0x35db('0x3e')](_[_0x35db('0x47')](_0x4438cf[_0x35db('0x3d')],_0xa76986[_0x35db('0x3e')]));_0x4df42c['where'][_0x35db('0x9f')]=_0x293ab8['id'];if(_0x4438cf[_0x35db('0x3d')][_0x35db('0x7a')]){_0x4df42c[_0x35db('0x46')]=_['merge'](_0x4df42c[_0x35db('0x46')],{'$or':_[_0x35db('0x75')](_0x4df42c[_0x35db('0x40')],function(_0x35f83b){var _0x144279={};_0x144279[_0x35f83b]={'$like':'%'+_0x4438cf[_0x35db('0x3d')][_0x35db('0x7a')]+'%'};return _0x144279;})});}if(_0x4438cf[_0x35db('0x3d')][_0x35db('0x78')]){var _0x682e1b=_0x4438cf[_0x35db('0x3d')][_0x35db('0x78')][_0x35db('0x36')](',');var _0x277072={};_0x277072[_0x682e1b[0x0]]={'$gte':moment(_0x682e1b[0x1])[_0x35db('0x62')](_0x35db('0xe7'))};_0x4df42c[_0x35db('0x46')]=_['merge'](_0x4df42c[_0x35db('0x46')],_0x277072);}_0x4df42c=_['merge']({},_0x4df42c,_0x4438cf['options']);return db[_0x35db('0x32')][_0x35db('0x23')]({'where':_0x4df42c[_0x35db('0x46')]})['then'](function(_0x25c5f2){_0xcc8fa5[_0x35db('0x23')]=_0x25c5f2;if(_0x4438cf[_0x35db('0x3d')][_0x35db('0xa4')]){_0x4df42c['include']=[{'all':!![]}];}return db[_0x35db('0x32')][_0x35db('0xe8')](_0x4df42c);})['then'](function(_0x3572c4){_0xcc8fa5[_0x35db('0xa1')]=_0x3572c4;return _0xcc8fa5;});}})[_0x35db('0x2b')](respondWithFilteredResult(_0x501c70,_0x4df42c))[_0x35db('0x39')](handleError(_0x501c70,null));};exports[_0x35db('0xe9')]=function(_0x24cb25,_0x2b5b1c,_0x3f9e9f){var _0x5de9f5={'where':{}},_0x2fb2f5={},_0x36716e={'count':0x0,'rows':[]};return db[_0x35db('0x3b')][_0x35db('0xbc')]({'where':{'id':_0x24cb25['params']['id']}})['then'](handleEntityNotFound(_0x2b5b1c,null))[_0x35db('0x2b')](function(_0x591004){if(_0x591004){_0x2fb2f5['model']=_[_0x35db('0x3c')](db[_0x35db('0x32')]['rawAttributes']);_0x2fb2f5['query']=_[_0x35db('0x3c')](_0x24cb25[_0x35db('0x3d')]);_0x2fb2f5[_0x35db('0x3e')]=_[_0x35db('0x3f')](_0x2fb2f5[_0x35db('0x41')],_0x2fb2f5[_0x35db('0x3d')]);_0x5de9f5[_0x35db('0x40')]=_['intersection'](_0x2fb2f5['model'],qs[_0x35db('0x42')](_0x24cb25['query']['fields']));_0x5de9f5[_0x35db('0x40')]=_0x5de9f5[_0x35db('0x40')][_0x35db('0x43')]?_0x5de9f5['attributes']:_0x2fb2f5[_0x35db('0x41')];if(!_0x24cb25['query'][_0x35db('0xea')](_0x35db('0x44'))){_0x5de9f5[_0x35db('0x25')]=qs[_0x35db('0x25')](_0x24cb25[_0x35db('0x3d')][_0x35db('0x25')]);_0x5de9f5[_0x35db('0x24')]=qs['offset'](_0x24cb25[_0x35db('0x3d')][_0x35db('0x24')]);}_0x5de9f5[_0x35db('0x80')]=qs[_0x35db('0x45')](_0x24cb25[_0x35db('0x3d')][_0x35db('0x45')]);_0x5de9f5[_0x35db('0x46')]=qs['filters'](_[_0x35db('0x47')](_0x24cb25['query'],_0x2fb2f5[_0x35db('0x3e')]));_0x5de9f5[_0x35db('0x46')][_0x35db('0x9f')]=_0x591004['id'];if(_0x24cb25['query']['filter']){_0x5de9f5[_0x35db('0x46')]=_[_0x35db('0xa6')](_0x5de9f5[_0x35db('0x46')],{'$or':_[_0x35db('0x75')](_0x5de9f5[_0x35db('0x40')],function(_0xaf9b08){var _0x1d595a={};_0x1d595a[_0xaf9b08]={'$like':'%'+_0x24cb25[_0x35db('0x3d')]['filter']+'%'};return _0x1d595a;})});}_0x5de9f5[_0x35db('0x46')]['secret']=![];if(_0x24cb25['query']['id']){_0x5de9f5[_0x35db('0x46')]['id']={'$gt':_0x24cb25[_0x35db('0x3d')]['id']};}_0x5de9f5=_['merge']({},_0x5de9f5,_0x24cb25['options']);return db['ChatMessage']['count']({'where':_0x5de9f5[_0x35db('0x46')]})['then'](function(_0x3d6091){_0x36716e[_0x35db('0x23')]=_0x3d6091;_0x5de9f5[_0x35db('0xa5')]=[];if(_0x24cb25[_0x35db('0x3d')]['includeAgent']){_0x5de9f5[_0x35db('0xa5')][_0x35db('0x38')]({'model':db[_0x35db('0xc7')],'as':_0x35db('0xc7'),'attributes':['id','fullname','alias']});}if(_0x24cb25[_0x35db('0x3d')]['includeAll']){_0x5de9f5[_0x35db('0xa5')]=[{'all':!![]}];}return db[_0x35db('0x32')]['findAll'](_0x5de9f5);})[_0x35db('0x2b')](function(_0x2094d6){_0x36716e['rows']=_0x2094d6;return _0x36716e;});}})[_0x35db('0x2b')](respondWithFilteredResult(_0x2b5b1c,_0x5de9f5))[_0x35db('0x39')](handleError(_0x2b5b1c,null));};exports['addTags']=function(_0x36f3f8,_0x2d970e,_0x111001){return db['ChatInteraction'][_0x35db('0xa8')]({'where':{'id':_0x36f3f8[_0x35db('0xa2')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x2d970e,null))[_0x35db('0x2b')](function(_0x3168f5){if(_0x3168f5){return _0x3168f5[_0x35db('0xeb')](_0x36f3f8[_0x35db('0xaa')][_0x35db('0xe6')],_[_0x35db('0xe5')](_0x36f3f8[_0x35db('0xaa')],[_0x35db('0xe6'),'id'])||{})[_0x35db('0xec')](function(){return db['Tag'][_0x35db('0xe8')]({'attributes':['id','name',_0x35db('0x4a')],'where':{'id':_0x36f3f8[_0x35db('0xaa')]['ids']}});})[_0x35db('0x2b')](function(_0x14fec0){socket['emit'](_0x35db('0xed'),{'id':Number(_0x36f3f8[_0x35db('0xa2')]['id']),'tags':_0x14fec0||[]});return{'id':Number(_0x36f3f8[_0x35db('0xa2')]['id']),'tags':_0x14fec0||[]};});}})[_0x35db('0x2b')](respondWithResult(_0x2d970e,null))['catch'](handleError(_0x2d970e,null));};exports[_0x35db('0xee')]=function(_0x5991fa,_0x34cdb2,_0x40960a){return db[_0x35db('0x3b')][_0x35db('0xa8')]({'where':{'id':_0x5991fa[_0x35db('0xa2')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x34cdb2,null))[_0x35db('0x2b')](function(_0x1afef4){if(_0x1afef4){return _0x1afef4[_0x35db('0xee')](_0x5991fa[_0x35db('0x3d')][_0x35db('0xe6')]);}})[_0x35db('0x2b')](respondWithStatusCode(_0x34cdb2,null))[_0x35db('0x39')](handleError(_0x34cdb2,null));};exports[_0x35db('0xbf')]=function(_0x5b8148,_0x7ace4){var _0x246aa6=moment()[_0x35db('0xef')]()[_0x35db('0x94')]();var _0x10e234=path['join'](config['root'],_0x35db('0xf0'),_0x35db('0xf1'),_0x35db('0xf2'));var _0x3b44a6=path[_0x35db('0x7e')](config[_0x35db('0xc0')],_0x35db('0xf0'),_0x35db('0xf1'),'attachments');var _0x5b945d=path[_0x35db('0x7e')](_0x10e234,_0x246aa6);var _0x12a389=util[_0x35db('0x62')]('transcript-%d-%s.zip',_0x5b8148['params']['id'],_0x246aa6);var _0x10f325=path['join'](_0x10e234,_0x12a389);var _0x28e408=![];return db[_0x35db('0x3b')]['find']({'where':{'id':_0x5b8148[_0x35db('0xa2')]['id']},'include':[{'model':db[_0x35db('0x32')],'as':_0x35db('0xc6'),'attributes':['id',_0x35db('0xaa'),'createdAt','direction',_0x35db('0xd5')],'include':[{'model':db[_0x35db('0xc7')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db[_0x35db('0xc9')],'as':_0x35db('0xf3'),'attributes':['id','firstName',_0x35db('0xf4')],'raw':!![]},{'model':db[_0x35db('0xba')],'as':_0x35db('0xba'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x35db('0xf5'),'attributes':['id',_0x35db('0x2e')]},{'model':db[_0x35db('0xc7')],'as':_0x35db('0xf6'),'attributes':['id','fullname']}]})[_0x35db('0x2b')](handleEntityNotFound(_0x7ace4,null))[_0x35db('0x2b')](function(_0x23826e){if(_0x23826e){var _0xea427=_0x23826e[_0x35db('0xf7')]({'plain':!![]});_0x28e408=!![];var _0x21d7c0={'format':'A4','border':_0x35db('0xf8'),'header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x35db('0xf9'),'contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x35db('0x62')](_0x35db('0xfa'),_0x35db('0xfb'),_0xea427['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};fs['mkdirSync'](_0x5b945d);var _0x22b7f7={'channel':_0x35db('0xfb'),'account':_0xea427[_0x35db('0xf5')]['name'],'agent':_0xea427['Owner']?_0xea427[_0x35db('0xf6')][_0x35db('0xd2')]:_0x35db('0xfc'),'createdAt':moment(_0xea427[_0x35db('0x5d')])[_0x35db('0x62')]('YYYY-MM-DD\x20HH:mm:ss')[_0x35db('0x94')](),'closedAt':_0xea427[_0x35db('0x30')]?moment(_0xea427[_0x35db('0xfd')])[_0x35db('0x62')](_0x35db('0xe7'))['toString']():'','disposition':_0xea427[_0x35db('0xb1')],'chatInfo':{'browser':_0xea427['browserName'],'os':_0xea427[_0x35db('0xfe')],'referer':_0xea427[_0x35db('0xff')],'customerIp':_0xea427[_0x35db('0x100')]},'messages':_(_0xea427[_0x35db('0xc6')])['tail']()[_0x35db('0x7a')]({'secret':![]})[_0x35db('0x75')](function(_0x404297){if(_0x404297[_0x35db('0xba')]){var _0x876d3f=path[_0x35db('0x7e')](_0x3b44a6,_0x404297[_0x35db('0xba')]['basename']);if(fs[_0x35db('0x101')](_0x876d3f)){fs['createReadStream'](_0x876d3f)[_0x35db('0x102')](fs[_0x35db('0x103')](path[_0x35db('0x7e')](_0x5b945d,_0x404297[_0x35db('0xba')][_0x35db('0xb6')])));}}return{'date':moment(_0x404297[_0x35db('0x5d')])[_0x35db('0x62')](_0x35db('0xe7'))[_0x35db('0x94')](),'sender':_0x404297[_0x35db('0x104')]===_0x35db('0x105')?_0x404297[_0x35db('0xc7')]?_0x404297[_0x35db('0xc7')][_0x35db('0xd2')]:_0x35db('0xcd'):_0x404297[_0x35db('0xf3')][_0x35db('0x106')]+(_0x404297[_0x35db('0xf3')][_0x35db('0xf4')]?'\x20'+_0x404297[_0x35db('0xf3')][_0x35db('0xf4')]:''),'body':_0x404297[_0x35db('0xba')]?_0x404297[_0x35db('0xba')][_0x35db('0xb6')]:_0x404297['body'],'direction':_0x404297[_0x35db('0x104')]===_0x35db('0x105')?'A':'C','secret':_0x404297[_0x35db('0xd5')],'attachment':_0x404297[_0x35db('0xba')]};})[_0x35db('0x5e')]()};return ejs['renderFile'](path['join'](config[_0x35db('0xc0')],'server','views',_0x35db('0x107')),{'interaction':_0x22b7f7})[_0x35db('0x2b')](function(_0x1013ac){return new BPromise(function(_0x31f4a8,_0x2496df){pdf[_0x35db('0xa9')](_0x1013ac,_0x21d7c0)[_0x35db('0x108')](path['join'](_0x5b945d,_0x35db('0x109')+_0xea427['id']+'-'+_0x246aa6+_0x35db('0x10a')),function(_0x4d2b64,_0x270c02){if(_0x4d2b64)return _0x2496df(_0x4d2b64);_0x31f4a8(_0x270c02);});});});}})['then'](function(){if(_0x28e408){return new BPromise(function(_0x5d6f79,_0xbf9333){zipdir(_0x5b945d,{'saveTo':_0x10f325},function(_0x4d767f,_0x1fba7c){if(_0x4d767f)return _0xbf9333(_0x4d767f);return _0x5d6f79(_0x1fba7c);});})['then'](function(){return new BPromise(function(_0x322d91,_0x3e6d89){rimraf(_0x5b945d,function(_0xf26f05){if(_0xf26f05)_0x3e6d89(_0xf26f05);return _0x322d91();});});})[_0x35db('0x2b')](function(){return _0x7ace4[_0x35db('0xbf')](_0x10f325,_0x12a389,function(_0x431c87){if(_0x431c87){console[_0x35db('0x10b')](_0x35db('0x10c'),_0x431c87);}else{fs[_0x35db('0x10d')](_0x10f325);}});});}else{return _0x7ace4[_0x35db('0x1f')](0xc8);}})['catch'](handleError(_0x7ace4,null));}; \ No newline at end of file +var _0xf500=['me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','expr','advancedFilter','parse','value','dateStart','startOf','day','utc','format','and','isArray','condition','TagId','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','length','ContactId','c.lastName','hasOwnProperty','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','read','%s\x20=\x200','`Messages.count`\x20=\x200','having','tag','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%s\x20>\x200','`Messages.count`\x20>\x200','sequelize','keyBy','merge','ChatInteraction','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','rows','show','options','find','create','body','update','params','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','type','mimetype','Attachment','findOne','Unauthorized','attachId','download','root','server/files/attachments/','close','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','CmContact','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','website_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','includeAll','include','findAll','includeAgent','addTags','setTags','Tag','color','emit','chatInteractionTags:save','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Chat','YYYY-MM-DD','Account','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','customerIp','existsSync','createReadStream','pipe','createWriteStream','direction','out','Contact','lastName','views','toFile','transcript-','log','err','unlinkSync','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','test','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','then','destroy','stack','name','ChatMessage','Users','map','Tags','TagIds','split','forEach','push','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','field','from','tools_tags','select','COUNT(*)','chat_messages','me.ChatInteractionId\x20=\x20i.id'];(function(_0x497c0d,_0x519183){var _0x634c59=function(_0x3b7cd6){while(--_0x3b7cd6){_0x497c0d['push'](_0x497c0d['shift']());}};_0x634c59(++_0x519183);}(_0xf500,0xca));var _0x0f50=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xf500[_0x5c2e3e];return _0x53f64a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0f50('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f50('0x1'));var moment=require(_0x0f50('0x2'));var BPromise=require(_0x0f50('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f50('0x4'));var sox=require(_0x0f50('0x5'));var csv=require(_0x0f50('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0f50('0x7'));var squel=require('squel');var crypto=require(_0x0f50('0x8'));var jsforce=require(_0x0f50('0x9'));var deskjs=require(_0x0f50('0xa'));var toCsv=require(_0x0f50('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f50('0xb'));var authService=require(_0x0f50('0xc'));var qs=require(_0x0f50('0xd'));var hardwareService=require(_0x0f50('0xe'));var logger=require('../../config/logger')(_0x0f50('0xf'));var utils=require(_0x0f50('0x10'));var config=require(_0x0f50('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0f50('0x12')](config[_0x0f50('0x13')],{'host':_0x0f50('0x14'),'port':0x18eb});var socket=require(_0x0f50('0x15'))(new Redis(config[_0x0f50('0x13')]));require(_0x0f50('0x16'))['register'](socket);var jayson=require(_0x0f50('0x17'));var client=jayson[_0x0f50('0x18')][_0x0f50('0x19')]({'port':0x232b});var client9004=jayson[_0x0f50('0x18')][_0x0f50('0x19')]({'port':0x232c});function checkPasswordPattern(_0x355348,_0x36a09e,_0x8b90c4){if(_0x8b90c4){var _0xf2aed0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf2aed0[_0x0f50('0x1a')](_0x36a09e)){return _0x355348;}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 _0x355348;}}function respondWithRpcPromise(_0x209049,_0x58017e,_0x9ac645,_0x15bdd9){return new BPromise(function(_0x47a5eb,_0x36a382){var _0x2e45f0=_0x15bdd9||client;return _0x2e45f0[_0x0f50('0x1b')](_0x209049,_0x9ac645)['then'](function(_0x3330d9){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x58017e,_0x0f50('0x1c'));logger[_0x0f50('0x1d')](_0x0f50('0x1e'),_0x58017e,'request\x20sent',JSON[_0x0f50('0x1f')](_0x3330d9));if(_0x3330d9['error']){if(_0x3330d9[_0x0f50('0x20')][_0x0f50('0x21')]===0x1f4){logger[_0x0f50('0x20')](_0x0f50('0x22'),_0x58017e,_0x3330d9[_0x0f50('0x20')][_0x0f50('0x23')]);return _0x36a382(_0x3330d9['error']['message']);}logger[_0x0f50('0x20')](_0x0f50('0x22'),_0x58017e,_0x3330d9[_0x0f50('0x20')][_0x0f50('0x23')]);return _0x47a5eb(_0x3330d9[_0x0f50('0x20')][_0x0f50('0x23')]);}else{logger[_0x0f50('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x58017e,_0x0f50('0x1c'));_0x47a5eb(_0x3330d9[_0x0f50('0x25')]['message']);}})[_0x0f50('0x26')](function(_0x4c894a){logger[_0x0f50('0x20')](_0x0f50('0x22'),_0x58017e,_0x4c894a);_0x36a382(_0x4c894a);});});}function respondWithStatusCode(_0x4d2bff,_0x236de9){_0x236de9=_0x236de9||0xcc;return function(_0x14b668){if(_0x14b668){return _0x4d2bff[_0x0f50('0x27')](_0x236de9);}return _0x4d2bff['status'](_0x236de9)[_0x0f50('0x28')]();};}function respondWithResult(_0x3e4be0,_0x26e7a0){_0x26e7a0=_0x26e7a0||0xc8;return function(_0x5f15bb){if(_0x5f15bb){return _0x3e4be0['status'](_0x26e7a0)[_0x0f50('0x29')](_0x5f15bb);}};}function respondWithFilteredResult(_0x5e2e16,_0x403f47){return function(_0xbb3a24){if(_0xbb3a24){var _0x58d33c=_0xbb3a24[_0x0f50('0x2a')],_0x2e8a9f=_0x403f47[_0x0f50('0x2b')],_0x2a3545=_0x403f47['offset']+_0x403f47[_0x0f50('0x2c')],_0x189a14;if(_0x2a3545>=_0x58d33c){_0x2a3545=_0x58d33c;_0x189a14=0xc8;}else{_0x189a14=0xce;}_0x5e2e16[_0x0f50('0x2d')](_0x189a14);return _0x5e2e16[_0x0f50('0x2e')](_0x0f50('0x2f'),_0x2e8a9f+'-'+_0x2a3545+'/'+_0x58d33c)[_0x0f50('0x29')](_0xbb3a24);}return null;};}function patchUpdates(_0x33d3bf){return function(_0x2ae32a){try{jsonpatch[_0x0f50('0x30')](_0x2ae32a,_0x33d3bf,!![]);}catch(_0x4db484){return BPromise['reject'](_0x4db484);}return _0x2ae32a[_0x0f50('0x31')]();};}function saveUpdates(_0xe81ed1,_0x552c2b){return function(_0x587968){if(_0x587968){return _0x587968['update'](_0xe81ed1)[_0x0f50('0x32')](function(_0xfe2c0a){return _0xfe2c0a;});}return null;};}function removeEntity(_0x5ae5b6,_0x4642d4){return function(_0x324167){if(_0x324167){return _0x324167[_0x0f50('0x33')]()[_0x0f50('0x32')](function(){_0x5ae5b6[_0x0f50('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167797,_0x507c9d){return function(_0x34730c){if(!_0x34730c){_0x167797['sendStatus'](0x194);}return _0x34730c;};}function handleError(_0x774f60,_0xc3da22){_0xc3da22=_0xc3da22||0x1f4;return function(_0x17b41d){logger[_0x0f50('0x20')](_0x17b41d[_0x0f50('0x34')]);if(_0x17b41d['name']){delete _0x17b41d[_0x0f50('0x35')];}_0x774f60[_0x0f50('0x2d')](_0xc3da22)['send'](_0x17b41d);};}function getInteractionUnreadMessages(_0x3aa476){return new BPromise(function(_0x375b02,_0x1ee77c){try{if(_0x3aa476['closed']){_0x3aa476['unreadMessages']=0x0;_0x375b02(_0x3aa476);}else{return db[_0x0f50('0x36')]['count']({'where':{'ChatInteractionId':_0x3aa476['id'],'direction':'in','read':![]}})[_0x0f50('0x32')](function(_0x34e0a2){_0x3aa476['unreadMessages']=_0x34e0a2;_0x375b02(_0x3aa476);});}}catch(_0x574623){_0x1ee77c(_0x574623);}});}function getInteractionUsers(_0x360a3d,_0x4089a5){return new BPromise(function(_0x3436f0,_0x3dd207){try{if(_0x4089a5[_0x360a3d['id']]){_0x360a3d[_0x0f50('0x37')]=_[_0x0f50('0x38')](_0x4089a5[_0x360a3d['id']],function(_0x489a73){return{'id':_0x489a73['id']};});}}catch(_0x46e21c){_0x3dd207(_0x46e21c);}_0x3436f0(_0x360a3d);});}function getInteractionTags(_0x19d184,_0x3d22bf){return new BPromise(function(_0x547aa4,_0x54b191){try{if(_0x19d184['TagIds']){_0x19d184[_0x0f50('0x39')]=[];_0x19d184[_0x0f50('0x3a')][_0x0f50('0x3b')](',')[_0x0f50('0x3c')](function(_0x2499e0){_0x19d184[_0x0f50('0x39')][_0x0f50('0x3d')](_0x3d22bf[_0x2499e0]);});}delete _0x19d184[_0x0f50('0x3a')];}catch(_0x16a370){_0x54b191(_0x16a370);}_0x547aa4(_0x19d184);});}function updateChatInteraction(_0x14772c,_0x1202c6,_0xeffd31){return new BPromise(function(_0x24cd55,_0x24ca47){return getInteractionUnreadMessages(_0x14772c)['then'](function(_0x50d9b4){return getInteractionUsers(_0x50d9b4,_0xeffd31);})['then'](function(_0xbf5da7){return getInteractionTags(_0xbf5da7,_0x1202c6);})[_0x0f50('0x32')](function(_0x268a82){_0x24cd55(_0x268a82);})[_0x0f50('0x26')](function(_0x3ce0ee){_0x24ca47(_0x3ce0ee);});});}exports['index']=function(_0x41e03c,_0x768fca){var _0x320416={},_0x491245={},_0x13f2ba={'count':0x0,'rows':[]};var _0x479535=db['ChatInteraction'][_0x0f50('0x3e')];_0x491245[_0x0f50('0x3f')]=_[_0x0f50('0x40')](_0x479535);_0x491245[_0x0f50('0x41')]=_[_0x0f50('0x40')](_0x41e03c[_0x0f50('0x41')]);_0x491245['filters']=_[_0x0f50('0x42')](_0x491245[_0x0f50('0x3f')],_0x491245[_0x0f50('0x41')]);_0x320416[_0x0f50('0x43')]=_[_0x0f50('0x42')](_0x491245[_0x0f50('0x3f')],qs[_0x0f50('0x44')](_0x41e03c[_0x0f50('0x41')][_0x0f50('0x44')]));_0x320416[_0x0f50('0x43')]=_0x320416[_0x0f50('0x43')]['length']?_0x320416[_0x0f50('0x43')]:_0x491245[_0x0f50('0x3f')];if(!_0x41e03c['query']['hasOwnProperty'](_0x0f50('0x45'))){_0x320416[_0x0f50('0x2c')]=qs[_0x0f50('0x2c')](_0x41e03c[_0x0f50('0x41')]['limit']);_0x320416[_0x0f50('0x2b')]=qs[_0x0f50('0x2b')](_0x41e03c[_0x0f50('0x41')]['offset']);}_0x320416[_0x0f50('0x46')]=qs[_0x0f50('0x47')](_0x41e03c[_0x0f50('0x41')][_0x0f50('0x47')]);_0x320416[_0x0f50('0x48')]=qs[_0x0f50('0x49')](_['pick'](_0x41e03c['query'],_0x491245[_0x0f50('0x49')]));var _0x1ce2e0=[];var _0x378bb1=squel['select']()[_0x0f50('0x4a')]('id')[_0x0f50('0x4a')](_0x0f50('0x35'))[_0x0f50('0x4a')]('color')[_0x0f50('0x4b')](_0x0f50('0x4c'));var _0x365718=squel[_0x0f50('0x4d')]()[_0x0f50('0x4a')](_0x0f50('0x4e'))['from'](_0x0f50('0x4f'),'me')[_0x0f50('0x48')](_0x0f50('0x50'))[_0x0f50('0x48')](_0x0f50('0x51'))[_0x0f50('0x48')](_0x0f50('0x52'));var _0x3edbfd=squel['select']()['field'](_0x0f50('0x53'))[_0x0f50('0x4a')](_0x0f50('0x54'))['from']('user_has_chat_interactions','ui')[_0x0f50('0x55')](_0x0f50('0x56'),'u',_0x0f50('0x57'));var _0x3f07e0=squel[_0x0f50('0x4d')]()[_0x0f50('0x4b')](_0x0f50('0x58'),'i')[_0x0f50('0x55')](_0x0f50('0x59'),'c',_0x0f50('0x5a'))[_0x0f50('0x55')]('users','o','o.id\x20=\x20i.UserId')[_0x0f50('0x55')](_0x0f50('0x5b'),'a',_0x0f50('0x5c'))[_0x0f50('0x55')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id');var _0x1ae323=squel[_0x0f50('0x5d')]();if(_0x41e03c[_0x0f50('0x41')][_0x0f50('0x5e')]){var _0x20286b=JSON[_0x0f50('0x5f')](_0x41e03c[_0x0f50('0x41')][_0x0f50('0x5e')]);_[_0x0f50('0x40')](_0x20286b)[_0x0f50('0x3c')](function(_0x44a77b){var _0x3a243d=_0x20286b[_0x44a77b];if(_0x44a77b==='createdAt'){var _0x5a7bf1=moment(_0x3a243d[_0x0f50('0x60')][_0x0f50('0x61')])[_0x0f50('0x62')](_0x0f50('0x63'))[_0x0f50('0x64')]()['format']();var _0x109e31=moment(_0x109e31)[_0x0f50('0x64')]()['endOf'](_0x0f50('0x63'))[_0x0f50('0x65')]();_0x1ae323[_0x0f50('0x66')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a7bf1,_0x109e31);}else{if(_[_0x0f50('0x67')](_0x3a243d[_0x0f50('0x68')])){_0x3a243d[_0x0f50('0x68')][_0x0f50('0x3c')](function(_0x334538){switch(_0x3a243d['condition'][_0x0f50('0x60')]){case'IS':if(_0x44a77b!==_0x0f50('0x69')&&_0x44a77b!=='Messages.count'){if(_[_0x0f50('0x67')](_0x3a243d[_0x0f50('0x60')])&&_0x3a243d[_0x0f50('0x60')]['length']>0x1){_0x1ae323['and'](_0x3a243d['tableAlias']+'.'+_0x44a77b+_0x0f50('0x6a'),_0x3a243d[_0x0f50('0x60')]);}else{_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+'\x20=\x20?',_0x3a243d['value'][0x0]);}}break;case'=':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x6c'),_0x3a243d[_0x0f50('0x60')]);break;case _0x0f50('0x6d'):if(_0x44a77b==='ContactId'){_0x1ae323['and'](_0x0f50('0x6e')+_0x0f50('0x6f'),'%'+_0x3a243d[_0x0f50('0x60')]+'%');_0x1ae323['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x3a243d[_0x0f50('0x60')]+'%');_0x1ae323['or'](_0x0f50('0x70')+_0x0f50('0x6f'),'%'+_0x3a243d[_0x0f50('0x60')]+'%');}else{_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x6f'),'%'+_0x3a243d['value']+'%');}break;case'>':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x71'),_0x3a243d['value']);break;case'<':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x72'),_0x3a243d['value']);break;}});}else{switch(_0x3a243d[_0x0f50('0x68')]['value']){case'IS':if(_0x44a77b!==_0x0f50('0x69')&&_0x44a77b!==_0x0f50('0x73')){if(_[_0x0f50('0x67')](_0x3a243d[_0x0f50('0x60')])&&_0x3a243d['value'][_0x0f50('0x74')]>0x1){_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x6a'),_0x3a243d['value']);}else{_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+'\x20=\x20?',_0x3a243d[_0x0f50('0x60')][0x0]);}}break;case'=':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x6c'),_0x3a243d[_0x0f50('0x60')]);break;case'LIKE':if(_0x44a77b===_0x0f50('0x75')){_0x1ae323[_0x0f50('0x66')](_0x0f50('0x6e')+'\x20LIKE\x20?','%'+_0x3a243d[_0x0f50('0x60')]+'%');_0x1ae323['or'](_0x0f50('0x76')+_0x0f50('0x6f'),'%'+_0x3a243d[_0x0f50('0x60')]+'%');_0x1ae323['or'](_0x0f50('0x70')+_0x0f50('0x6f'),'%'+_0x3a243d['value']+'%');}else{_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x6f'),'%'+_0x3a243d[_0x0f50('0x60')]+'%');}break;case'>':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x71'),_0x3a243d[_0x0f50('0x60')]);break;case'<':_0x1ae323[_0x0f50('0x66')](_0x3a243d[_0x0f50('0x6b')]+'.'+_0x44a77b+_0x0f50('0x72'),_0x3a243d[_0x0f50('0x60')]);break;}}}});}else{var _0x22ce7c=_(Object[_0x0f50('0x40')](_0x41e03c[_0x0f50('0x41')]))[_0x0f50('0x38')](function(_0x3e0d24){return _0x479535[_0x0f50('0x77')](_0x3e0d24)?_0x3e0d24:undefined;})[_0x0f50('0x78')](function(_0x39f58e){return!_[_0x0f50('0x79')](_0x39f58e);})['value']();if(!_['isEmpty'](_0x22ce7c)){_0x22ce7c['forEach'](function(_0x935f82){if(_0x935f82===_0x0f50('0x7a')){_0x3f07e0[_0x0f50('0x48')](_0x0f50('0x7b'),[]['concat'](_0x41e03c[_0x0f50('0x41')][_0x935f82]));}else if(_0x935f82===_0x0f50('0x7c')){var _0x1ce885=JSON[_0x0f50('0x5f')](_0x41e03c[_0x0f50('0x41')][_0x935f82])[_0x0f50('0x7d')];var _0x4ac98f=JSON[_0x0f50('0x5f')](_0x41e03c['query'][_0x935f82])[_0x0f50('0x7e')];_0x3f07e0['where'](_0x0f50('0x7f'),_0x1ce885,_0x4ac98f);}else{if(_0x41e03c['query'][_0x935f82]===_0x0f50('0x80')){_0x3f07e0[_0x0f50('0x48')]('i.'+_0x935f82+'\x20IS\x20NULL');}else{_0x3f07e0[_0x0f50('0x48')]('i.'+_0x935f82+'\x20=\x20?',_0x41e03c[_0x0f50('0x41')][_0x935f82]);}}});}if(_0x41e03c[_0x0f50('0x41')][_0x0f50('0x78')]){var _0x28b1ca=_0x41e03c[_0x0f50('0x41')][_0x0f50('0x78')][_0x0f50('0x81')]('\x5c','\x5c\x5c')[_0x0f50('0x81')]('\x27\x27',_0x0f50('0x82'));if(qs[_0x0f50('0x83')](_0x28b1ca)){_0x1ae323['or'](_0x0f50('0x84'),_0x28b1ca+'%');}else{var _0x1663d8=[];_0x28b1ca['split']('\x20')[_0x0f50('0x3c')](function(_0x2a3170){_0x1663d8[_0x0f50('0x3d')]('+'+_0x2a3170[_0x0f50('0x85')]());});var _0x412a5f=_0x1663d8[_0x0f50('0x86')]('\x20');_0x1ae323['or'](_0x0f50('0x87'),_0x412a5f)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x28b1ca+'%');}}}_0x3f07e0[_0x0f50('0x48')](_0x1ae323);if(_0x320416[_0x0f50('0x46')]){_0x320416['order'][_0x0f50('0x3c')](function(_0x34e22e){_0x3f07e0[_0x0f50('0x46')]('i.'+_0x34e22e[0x0],_0x34e22e[0x1]==='DESC'?![]:!![]);});}_0x3f07e0['group'](_0x0f50('0x88'));var _0x3ef654={'type':db['Sequelize'][_0x0f50('0x89')][_0x0f50('0x8a')],'raw':!![]};var _0x281600=_0x3f07e0['clone']()['field'](_0x0f50('0x4e'));if(!_0x41e03c[_0x0f50('0x41')][_0x0f50('0x5e')]){if(_0x41e03c[_0x0f50('0x41')]['read']){if(_0x41e03c[_0x0f50('0x41')][_0x0f50('0x8b')]==0x1){_0x281600[_0x0f50('0x48')](util[_0x0f50('0x65')](_0x0f50('0x8c'),_0x365718[_0x0f50('0x85')]()));_0x3f07e0['having'](_0x0f50('0x8d'));}else{_0x281600['where'](util[_0x0f50('0x65')]('%s\x20>\x200',_0x365718[_0x0f50('0x85')]()));_0x3f07e0[_0x0f50('0x8e')]('`Messages.count`\x20>\x200');}}if(_0x41e03c[_0x0f50('0x41')][_0x0f50('0x8f')]){var _0x1815b4=_[_0x0f50('0x67')](_0x41e03c[_0x0f50('0x41')][_0x0f50('0x8f')])?_0x41e03c[_0x0f50('0x41')][_0x0f50('0x8f')]:new Array(_0x41e03c[_0x0f50('0x41')]['tag']);var _0x491dc1=squel[_0x0f50('0x5d')]();_0x1815b4[_0x0f50('0x3c')](function(_0x4128d1){_0x491dc1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4128d1+',%');});_0x3f07e0[_0x0f50('0x8e')](_0x491dc1);_0x281600[_0x0f50('0x55')](_0x0f50('0x90'),'it',_0x0f50('0x91'));_0x281600[_0x0f50('0x55')]('tools_tags','t',_0x0f50('0x92'));_0x281600[_0x0f50('0x48')]('t.id\x20IN\x20?',_0x1815b4);}}else{var _0x20286b=JSON[_0x0f50('0x5f')](_0x41e03c[_0x0f50('0x41')][_0x0f50('0x5e')]);_['keys'](_0x20286b)[_0x0f50('0x3c')](function(_0x56c0ad){var _0x436f8a=_0x20286b[_0x56c0ad];if(_0x56c0ad===_0x0f50('0x69')){var _0x4b5787=_0x436f8a[_0x0f50('0x60')];var _0x1ed660=squel['expr']();_0x4b5787['forEach'](function(_0xf6b4b8){_0x1ed660['or'](_0x0f50('0x93'),'%,'+_0xf6b4b8+',%');});_0x3f07e0[_0x0f50('0x8e')](_0x1ed660);_0x281600[_0x0f50('0x55')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x281600[_0x0f50('0x55')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x281600[_0x0f50('0x48')]('t.id\x20IN\x20?',_0x4b5787);}else if(_0x56c0ad===_0x0f50('0x73')){if(_0x436f8a['value'][_0x0f50('0x74')]===0x1){if(_0x436f8a[_0x0f50('0x60')][0x0]===0x1){_0x281600[_0x0f50('0x48')](util[_0x0f50('0x65')](_0x0f50('0x8c'),_0x365718['toString']()));_0x3f07e0[_0x0f50('0x8e')](_0x0f50('0x8d'));}else{_0x281600[_0x0f50('0x48')](util['format'](_0x0f50('0x94'),_0x365718['toString']()));_0x3f07e0[_0x0f50('0x8e')](_0x0f50('0x95'));}}}});}db[_0x0f50('0x96')][_0x0f50('0x41')](_0x281600[_0x0f50('0x85')](),_0x3ef654)[_0x0f50('0x32')](function(_0x422267){_0x13f2ba[_0x0f50('0x2a')]=_0x422267[_0x0f50('0x74')];if(_0x13f2ba[_0x0f50('0x2a')]===0x0)return[];return db[_0x0f50('0x96')][_0x0f50('0x41')](_0x378bb1['toString'](),_0x3ef654)['then'](function(_0x26dbae){_0x1ce2e0=_[_0x0f50('0x97')](_0x26dbae,'id');_0x3ef654=_[_0x0f50('0x98')](_0x3ef654,{'model':db[_0x0f50('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3f07e0[_0x0f50('0x4a')](_0x0f50('0x9a'),_0x0f50('0x9b'));_0x3f07e0[_0x0f50('0x4a')](_0x0f50('0x9c'));_0x3f07e0[_0x0f50('0x4a')]('c.firstName',_0x0f50('0x9d'));_0x3f07e0[_0x0f50('0x4a')]('c.lastName',_0x0f50('0x9e'));_0x3f07e0[_0x0f50('0x4a')](_0x0f50('0x70'),_0x0f50('0x9f'));_0x3f07e0[_0x0f50('0x4a')](_0x0f50('0xa0'),_0x0f50('0xa1'));_0x3f07e0['field'](_0x0f50('0xa2'),_0x0f50('0xa3'));_0x3f07e0[_0x0f50('0x4a')]('c.fax','Contact.fax');_0x3f07e0['field'](_0x0f50('0xa4'),_0x0f50('0x3a'));_0x3f07e0[_0x0f50('0x55')](_0x0f50('0x90'),'it','it.ChatInteractionId\x20=\x20i.id');_0x3f07e0['left_join'](_0x0f50('0x4c'),'t',_0x0f50('0x92'));_0x3f07e0[_0x0f50('0x2c')](_0x320416['limit']);_0x3f07e0[_0x0f50('0x2b')](_0x320416[_0x0f50('0x2b')]);return db[_0x0f50('0x96')][_0x0f50('0x41')](_0x3f07e0[_0x0f50('0x85')](),_0x3ef654);})[_0x0f50('0x32')](function(_0x3bf315){_0x3edbfd[_0x0f50('0x48')]('ui.ChatInteractionId\x20IN\x20?',_[_0x0f50('0x38')](_0x3bf315,'id'));return db[_0x0f50('0x96')][_0x0f50('0x41')](_0x3edbfd[_0x0f50('0x85')](),_0x3ef654)[_0x0f50('0x32')](function(_0x343243){var _0xb5076e=_[_0x0f50('0xa5')](_0x343243,_0x0f50('0xa6'));var _0x284f75=[];_0x3bf315[_0x0f50('0x3c')](function(_0xc95cdd){_0x284f75['push'](updateChatInteraction(_0xc95cdd,_0x1ce2e0,_0xb5076e));});return BPromise[_0x0f50('0xa7')](_0x284f75);});});})['then'](function(_0x179cda){_0x13f2ba[_0x0f50('0xa8')]=_0x179cda;return _0x13f2ba;})[_0x0f50('0x32')](respondWithFilteredResult(_0x768fca,_0x320416))[_0x0f50('0x26')](handleError(_0x768fca,null));};exports[_0x0f50('0xa9')]=function(_0x2a3b25,_0x19baae){var _0x53288e={'raw':![],'where':{'id':_0x2a3b25['params']['id']}},_0x359835={};_0x359835['model']=_[_0x0f50('0x40')](db['ChatInteraction'][_0x0f50('0x3e')]);_0x359835[_0x0f50('0x41')]=_['keys'](_0x2a3b25['query']);_0x359835[_0x0f50('0x49')]=_[_0x0f50('0x42')](_0x359835[_0x0f50('0x3f')],_0x359835['query']);_0x53288e[_0x0f50('0x43')]=_['intersection'](_0x359835['model'],qs[_0x0f50('0x44')](_0x2a3b25[_0x0f50('0x41')][_0x0f50('0x44')]));_0x53288e['attributes']=_0x53288e[_0x0f50('0x43')][_0x0f50('0x74')]?_0x53288e['attributes']:_0x359835[_0x0f50('0x3f')];if(_0x2a3b25[_0x0f50('0x41')]['includeAll']){_0x53288e['include']=[{'all':!![]}];}_0x53288e=_[_0x0f50('0x98')]({},_0x53288e,_0x2a3b25[_0x0f50('0xaa')]);return db[_0x0f50('0x99')][_0x0f50('0xab')](_0x53288e)[_0x0f50('0x32')](handleEntityNotFound(_0x19baae,null))['then'](respondWithResult(_0x19baae,null))[_0x0f50('0x26')](handleError(_0x19baae,null));};exports[_0x0f50('0xac')]=function(_0x1b7cea,_0x37fb8b){return db['ChatInteraction']['create'](_0x1b7cea[_0x0f50('0xad')],{})[_0x0f50('0x32')](respondWithResult(_0x37fb8b,0xc9))['catch'](handleError(_0x37fb8b,null));};exports[_0x0f50('0xae')]=function(_0x2f51f7,_0x40efd3){if(_0x2f51f7[_0x0f50('0xad')]['id']){delete _0x2f51f7[_0x0f50('0xad')]['id'];}return db[_0x0f50('0x99')]['find']({'where':{'id':_0x2f51f7[_0x0f50('0xaf')]['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0x40efd3,null))[_0x0f50('0x32')](saveUpdates(_0x2f51f7[_0x0f50('0xad')],null))['then'](respondWithResult(_0x40efd3,null))['catch'](handleError(_0x40efd3,null));};exports[_0x0f50('0x33')]=function(_0x24b103,_0x25b9ad){return db[_0x0f50('0x99')]['find']({'where':{'id':_0x24b103[_0x0f50('0xaf')]['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0x25b9ad,null))['then'](removeEntity(_0x25b9ad,null))[_0x0f50('0x26')](handleError(_0x25b9ad,null));};exports[_0x0f50('0xb0')]=function(_0x25c75a,_0x44b5dc){return db[_0x0f50('0x99')][_0x0f50('0xb0')]()[_0x0f50('0x32')](respondWithResult(_0x44b5dc,null))['catch'](handleError(_0x44b5dc,null));};exports[_0x0f50('0xb1')]=function(_0x6c9d22,_0x763628){if(_0x6c9d22[_0x0f50('0xad')]['id']){delete _0x6c9d22[_0x0f50('0xad')]['id'];}return db[_0x0f50('0x99')][_0x0f50('0xab')]({'where':{'id':_0x6c9d22[_0x0f50('0xaf')]['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0x763628,null))[_0x0f50('0x32')](saveUpdates(_0x6c9d22['body'],null))[_0x0f50('0x32')](respondWithResult(_0x763628,null))['catch'](handleError(_0x763628,null));};exports['abandon']=function(_0x2ac259,_0x382a96,_0x6b2192){if(_0x2ac259['body']['id']){delete _0x2ac259[_0x0f50('0xad')]['id'];}return db[_0x0f50('0x99')]['find']({'where':{'id':_0x2ac259[_0x0f50('0xaf')]['id']}})['then'](function(_0x5bd199){if(!_0x5bd199){logger['error'](_0x0f50('0xb2'),_0x0f50('0xb3'),0x194,_0x0f50('0xb4'));_0x382a96['sendStatus'](0x194);}else{if(_0x5bd199['UserId']){throw new db['Sequelize'][(_0x0f50('0xb5'))](_0x0f50('0xb6'));}}return _0x5bd199;})[_0x0f50('0x32')](function(_0x2688fc){if(_0x2688fc){return _0x2688fc[_0x0f50('0xae')]({'closed':_0x2ac259[_0x0f50('0xad')][_0x0f50('0xb7')],'disposition':_0x2ac259[_0x0f50('0xad')][_0x0f50('0xb8')]})[_0x0f50('0x32')](function(_0x3aa618){return _0x3aa618;});}})[_0x0f50('0x32')](function(_0xb4435a){return respondWithRpcPromise(_0x0f50('0xb9'),_0x0f50('0xb3'),_0x2ac259[_0x0f50('0xad')],client9004);})[_0x0f50('0x32')](respondWithResult(_0x382a96,null))[_0x0f50('0x26')](handleError(_0x382a96,null));};exports[_0x0f50('0xba')]=function(_0x5d36d6,_0x4d6fc7,_0x456e92){_0x5d36d6[_0x0f50('0xad')][_0x0f50('0x35')]=_0x5d36d6['file'][_0x0f50('0xbb')];_0x5d36d6[_0x0f50('0xad')][_0x0f50('0xbc')]=_0x5d36d6['file']['filename'];_0x5d36d6[_0x0f50('0xad')][_0x0f50('0xbd')]=_0x5d36d6['file'][_0x0f50('0xbe')];return db[_0x0f50('0xbf')][_0x0f50('0xac')](_0x5d36d6[_0x0f50('0xad')])[_0x0f50('0x32')](respondWithResult(_0x4d6fc7,0xc9))[_0x0f50('0x26')](handleError(_0x4d6fc7,null));};exports['attachmentDownload']=function(_0x16b1e5,_0x121a98,_0x5576f8){return db[_0x0f50('0x99')][_0x0f50('0xc0')]({'where':{'id':_0x16b1e5['params']['id']},'raw':!![]})[_0x0f50('0x32')](handleEntityNotFound(_0x121a98,null))[_0x0f50('0x32')](function(_0xd5ff3b){if(_0xd5ff3b){if(_0xd5ff3b[_0x0f50('0xb7')]){return _0x121a98[_0x0f50('0x2d')](0x193)[_0x0f50('0x29')]({'status':0x193,'message':_0x0f50('0xc1')});}return db[_0x0f50('0xbf')]['findOne']({'where':{'id':_0x16b1e5['query'][_0x0f50('0xc2')]},'raw':!![]})[_0x0f50('0x32')](handleEntityNotFound(_0x121a98,null));}})[_0x0f50('0x32')](function(_0x8cbe71){if(_0x8cbe71){return _0x121a98[_0x0f50('0xc3')](path[_0x0f50('0x86')](config[_0x0f50('0xc4')],_0x0f50('0xc5'),_0x8cbe71[_0x0f50('0xbc')]));}})[_0x0f50('0x26')](handleError(_0x121a98,null));};exports[_0x0f50('0xc6')]=function(_0x48e2ab,_0x11166f){var _0x37dbb7=null;var _0x47235f=null;var _0x246c78=null;var _0x5622c8=null;if(_0x48e2ab[_0x0f50('0xad')]['id']){delete _0x48e2ab[_0x0f50('0xad')]['id'];}if(_0x48e2ab[_0x0f50('0xad')]['mailTranscript']){_0x5622c8=path['join'](config[_0x0f50('0xc4')],_0x0f50('0xc7'),util[_0x0f50('0x65')](_0x0f50('0xc8'),Date[_0x0f50('0xc9')]()));_0x48e2ab[_0x0f50('0xad')][_0x0f50('0xca')]=_0x5622c8;}return db['ChatInteraction'][_0x0f50('0xab')]({'where':{'id':_0x48e2ab[_0x0f50('0xaf')]['id']},'include':[{'model':db[_0x0f50('0x36')],'as':'Messages','include':[{'model':db[_0x0f50('0xcb')],'as':_0x0f50('0xcb')}]}]})[_0x0f50('0x32')](handleEntityNotFound(_0x11166f,null))[_0x0f50('0x32')](saveUpdates(_0x48e2ab[_0x0f50('0xad')],null))[_0x0f50('0x32')](function(_0x134749){if(_0x134749){_0x37dbb7=_0x134749;return db[_0x0f50('0xcc')]['find']({'where':{'id':_0x37dbb7[_0x0f50('0x7a')]}});}})[_0x0f50('0x32')](function(_0x58a63c){if(_0x58a63c){_0x246c78=_0x58a63c;return db[_0x0f50('0xcd')][_0x0f50('0xab')]({'where':{'id':_0x37dbb7['ContactId']}});}})['then'](function(_0x39b919){if(_0x39b919){_0x47235f=_0x39b919;if(_0x5622c8){var _0x387eca=null;for(var _0x526aa4=0x1;_0x526aa4<_0x37dbb7[_0x0f50('0xce')][_0x0f50('0x74')];++_0x526aa4){_0x387eca=_0x37dbb7[_0x0f50('0xce')][_0x526aa4];var _0x2060ad=_0x387eca['UserId']?util[_0x0f50('0x65')](_0x0f50('0xcf'),_0x246c78[_0x0f50('0xd0')],_0x387eca[_0x0f50('0xd1')]):_0x0f50('0xd2');var _0x4ca4ca=_0x48e2ab[_0x0f50('0xad')][_0x0f50('0xd3')]||util[_0x0f50('0x65')](_0x0f50('0xcf'),_0x0f50('0xd4'),_0x387eca[_0x0f50('0x75')]);switch(_0x246c78['agentIdentifier']){case _0x0f50('0xd5'):_0x2060ad=_0x387eca[_0x0f50('0xd1')]?util['format'](_0x0f50('0xcf'),_0x246c78[_0x0f50('0xd0')],_0x387eca[_0x0f50('0xd1')]):'System';break;case'agent_alias':_0x2060ad=_0x387eca[_0x0f50('0xd1')]?_0x387eca[_0x0f50('0xcb')][_0x0f50('0xd6')]||_0x387eca[_0x0f50('0xcb')][_0x0f50('0xd7')]:'System';break;case'agent_fullname':_0x2060ad=_0x387eca[_0x0f50('0xd1')]?_0x387eca[_0x0f50('0xcb')]['fullname']:_0x0f50('0xd2');break;default:_0x2060ad=_0x387eca['UserId']?util[_0x0f50('0x65')](_0x0f50('0xcf'),_0x246c78[_0x0f50('0xd0')],_0x387eca[_0x0f50('0xd1')]):_0x0f50('0xd2');}var _0x449a5e=util[_0x0f50('0x65')](_0x0f50('0xd8'),moment(_0x387eca['createdAt'])[_0x0f50('0x65')](_0x0f50('0xd9')),_0x387eca['direction']==='in'?_0x4ca4ca:_0x2060ad,_0x387eca[_0x0f50('0xad')]);if(!_0x387eca[_0x0f50('0xda')]){fs[_0x0f50('0xdb')](_0x5622c8,_0x449a5e);}}return db[_0x0f50('0xdc')][_0x0f50('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0x0f50('0xdd')],'as':_0x0f50('0xde'),'raw':!![]}]});}}})[_0x0f50('0x32')](function(_0x3cbdd9){if(_0x3cbdd9&&_0x3cbdd9[_0x0f50('0xde')]&&_0x48e2ab[_0x0f50('0xad')]){var _0x1ae441={'tls':{'rejectUnauthorized':![]}};if(_0x3cbdd9['Smtp'][_0x0f50('0xdf')]){_0x1ae441['service']=_0x3cbdd9[_0x0f50('0xde')]['service'];}else{_0x1ae441[_0x0f50('0xe0')]=_0x3cbdd9[_0x0f50('0xde')]['host'];_0x1ae441[_0x0f50('0xe1')]=_0x3cbdd9['Smtp'][_0x0f50('0xe1')];_0x1ae441['secure']=_0x3cbdd9[_0x0f50('0xde')]['secure'];}if(_0x3cbdd9[_0x0f50('0xde')]['authentication']){_0x1ae441['auth']={'user':_0x3cbdd9[_0x0f50('0xde')][_0x0f50('0xe2')],'pass':_0x3cbdd9[_0x0f50('0xde')]['pass']};}return respondWithRpcPromise(_0x0f50('0xe3'),_0x0f50('0xe4'),{'account':_0x1ae441,'message':{'from':util[_0x0f50('0x65')](_0x0f50('0xe5'),_0x3cbdd9[_0x0f50('0x35')],_0x3cbdd9[_0x0f50('0xe6')]||_0x3cbdd9[_0x0f50('0xde')]['user']),'to':_0x48e2ab['body']['mailTranscript'],'subject':_0x0f50('0xe7'),'text':util['format'](_0x0f50('0xe8'),_0x48e2ab[_0x0f50('0xad')]['mailTranscript']),'attachments':[{'path':_0x5622c8}]}})[_0x0f50('0x32')](function(){return _0x37dbb7;})[_0x0f50('0x26')](function(_0x3ef904){console[_0x0f50('0x20')](_0x3ef904);});}else{return _0x37dbb7;}})[_0x0f50('0x32')](respondWithStatusCode(_0x11166f,0xc8))[_0x0f50('0x26')](handleError(_0x11166f,null));};exports[_0x0f50('0xe9')]=function(_0x40faec,_0x4773d0,_0x289984){return db['ChatMessage'][_0x0f50('0xab')]({'where':{'id':_0x40faec[_0x0f50('0xaf')]['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0x4773d0,null))[_0x0f50('0x32')](function(_0x5beae7){if(_0x5beae7){return _0x5beae7[_0x0f50('0xe9')](_0x40faec[_0x0f50('0xad')][_0x0f50('0xea')],_[_0x0f50('0xeb')](_0x40faec['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4773d0,null))[_0x0f50('0x26')](handleError(_0x4773d0,null));};exports['getMessages']=function(_0x20f73f,_0xd0b4af,_0x579113){var _0x1e3300={'raw':![],'where':{}};var _0xd0f6b9={};var _0x48975a={'count':0x0,'rows':[]};return db[_0x0f50('0x99')][_0x0f50('0xc0')]({'where':{'id':_0x20f73f[_0x0f50('0xaf')]['id']}})['then'](handleEntityNotFound(_0xd0b4af,null))[_0x0f50('0x32')](function(_0x204af0){if(_0x204af0){_0xd0f6b9[_0x0f50('0x3f')]=_[_0x0f50('0x40')](db['ChatMessage'][_0x0f50('0x3e')]);_0xd0f6b9[_0x0f50('0x41')]=_[_0x0f50('0x40')](_0x20f73f[_0x0f50('0x41')]);_0xd0f6b9[_0x0f50('0x49')]=_[_0x0f50('0x42')](_0xd0f6b9[_0x0f50('0x3f')],_0xd0f6b9[_0x0f50('0x41')]);_0x1e3300[_0x0f50('0x43')]=_[_0x0f50('0x42')](_0xd0f6b9[_0x0f50('0x3f')],qs[_0x0f50('0x44')](_0x20f73f[_0x0f50('0x41')][_0x0f50('0x44')]));_0x1e3300[_0x0f50('0x43')]=_0x1e3300[_0x0f50('0x43')][_0x0f50('0x74')]?_0x1e3300[_0x0f50('0x43')]:_0xd0f6b9[_0x0f50('0x3f')];if(!_0x20f73f[_0x0f50('0x41')][_0x0f50('0x77')](_0x0f50('0x45'))){_0x1e3300[_0x0f50('0x2c')]=qs[_0x0f50('0x2c')](_0x20f73f['query'][_0x0f50('0x2c')]);_0x1e3300[_0x0f50('0x2b')]=qs['offset'](_0x20f73f[_0x0f50('0x41')][_0x0f50('0x2b')]);}_0x1e3300[_0x0f50('0x46')]=qs[_0x0f50('0x47')](_0x20f73f['query'][_0x0f50('0x47')]);_0x1e3300[_0x0f50('0x48')]=qs[_0x0f50('0x49')](_[_0x0f50('0xec')](_0x20f73f[_0x0f50('0x41')],_0xd0f6b9['filters']));_0x1e3300[_0x0f50('0x48')]['ChatInteractionId']=_0x204af0['id'];if(_0x20f73f[_0x0f50('0x41')]['filter']){_0x1e3300[_0x0f50('0x48')]=_[_0x0f50('0x98')](_0x1e3300[_0x0f50('0x48')],{'$or':_[_0x0f50('0x38')](_0x1e3300[_0x0f50('0x43')],function(_0x5114fe){var _0x12445c={};_0x12445c[_0x5114fe]={'$like':'%'+_0x20f73f[_0x0f50('0x41')][_0x0f50('0x78')]+'%'};return _0x12445c;})});}if(_0x20f73f[_0x0f50('0x41')][_0x0f50('0x7d')]){var _0x40e592=_0x20f73f['query'][_0x0f50('0x7d')]['split'](',');var _0x12628d={};_0x12628d[_0x40e592[0x0]]={'$gte':moment(_0x40e592[0x1])[_0x0f50('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1e3300[_0x0f50('0x48')]=_['merge'](_0x1e3300[_0x0f50('0x48')],_0x12628d);}_0x1e3300=_[_0x0f50('0x98')]({},_0x1e3300,_0x20f73f[_0x0f50('0xaa')]);return db[_0x0f50('0x36')][_0x0f50('0x2a')]({'where':_0x1e3300['where']})[_0x0f50('0x32')](function(_0x1c33f6){_0x48975a[_0x0f50('0x2a')]=_0x1c33f6;if(_0x20f73f[_0x0f50('0x41')][_0x0f50('0xed')]){_0x1e3300[_0x0f50('0xee')]=[{'all':!![]}];}return db[_0x0f50('0x36')][_0x0f50('0xef')](_0x1e3300);})[_0x0f50('0x32')](function(_0x4dec77){_0x48975a[_0x0f50('0xa8')]=_0x4dec77;return _0x48975a;});}})[_0x0f50('0x32')](respondWithFilteredResult(_0xd0b4af,_0x1e3300))[_0x0f50('0x26')](handleError(_0xd0b4af,null));};exports['getMyMessages']=function(_0x5234a7,_0xa700c7,_0x5b7ddc){var _0x2144f7={'where':{}},_0x4f75e4={},_0x876315={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0f50('0xc0')]({'where':{'id':_0x5234a7[_0x0f50('0xaf')]['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0xa700c7,null))['then'](function(_0x371a37){if(_0x371a37){_0x4f75e4[_0x0f50('0x3f')]=_['keys'](db[_0x0f50('0x36')][_0x0f50('0x3e')]);_0x4f75e4[_0x0f50('0x41')]=_[_0x0f50('0x40')](_0x5234a7['query']);_0x4f75e4[_0x0f50('0x49')]=_[_0x0f50('0x42')](_0x4f75e4['model'],_0x4f75e4[_0x0f50('0x41')]);_0x2144f7[_0x0f50('0x43')]=_[_0x0f50('0x42')](_0x4f75e4[_0x0f50('0x3f')],qs['fields'](_0x5234a7['query'][_0x0f50('0x44')]));_0x2144f7[_0x0f50('0x43')]=_0x2144f7[_0x0f50('0x43')][_0x0f50('0x74')]?_0x2144f7[_0x0f50('0x43')]:_0x4f75e4[_0x0f50('0x3f')];if(!_0x5234a7[_0x0f50('0x41')][_0x0f50('0x77')]('nolimit')){_0x2144f7[_0x0f50('0x2c')]=qs[_0x0f50('0x2c')](_0x5234a7['query'][_0x0f50('0x2c')]);_0x2144f7['offset']=qs['offset'](_0x5234a7[_0x0f50('0x41')]['offset']);}_0x2144f7['order']=qs['sort'](_0x5234a7['query'][_0x0f50('0x47')]);_0x2144f7['where']=qs[_0x0f50('0x49')](_[_0x0f50('0xec')](_0x5234a7[_0x0f50('0x41')],_0x4f75e4[_0x0f50('0x49')]));_0x2144f7['where'][_0x0f50('0xa6')]=_0x371a37['id'];if(_0x5234a7[_0x0f50('0x41')]['filter']){_0x2144f7['where']=_[_0x0f50('0x98')](_0x2144f7[_0x0f50('0x48')],{'$or':_[_0x0f50('0x38')](_0x2144f7['attributes'],function(_0x24f457){var _0x1e72ed={};_0x1e72ed[_0x24f457]={'$like':'%'+_0x5234a7[_0x0f50('0x41')][_0x0f50('0x78')]+'%'};return _0x1e72ed;})});}_0x2144f7[_0x0f50('0x48')][_0x0f50('0xda')]=![];if(_0x5234a7[_0x0f50('0x41')]['id']){_0x2144f7['where']['id']={'$gt':_0x5234a7[_0x0f50('0x41')]['id']};}_0x2144f7=_[_0x0f50('0x98')]({},_0x2144f7,_0x5234a7[_0x0f50('0xaa')]);return db[_0x0f50('0x36')]['count']({'where':_0x2144f7[_0x0f50('0x48')]})[_0x0f50('0x32')](function(_0x84a0f8){_0x876315[_0x0f50('0x2a')]=_0x84a0f8;_0x2144f7[_0x0f50('0xee')]=[];if(_0x5234a7[_0x0f50('0x41')][_0x0f50('0xf0')]){_0x2144f7[_0x0f50('0xee')][_0x0f50('0x3d')]({'model':db[_0x0f50('0xcb')],'as':_0x0f50('0xcb'),'attributes':['id',_0x0f50('0xd7'),_0x0f50('0xd6')]});}if(_0x5234a7[_0x0f50('0x41')][_0x0f50('0xed')]){_0x2144f7[_0x0f50('0xee')]=[{'all':!![]}];}return db[_0x0f50('0x36')][_0x0f50('0xef')](_0x2144f7);})[_0x0f50('0x32')](function(_0x4338b4){_0x876315[_0x0f50('0xa8')]=_0x4338b4;return _0x876315;});}})[_0x0f50('0x32')](respondWithFilteredResult(_0xa700c7,_0x2144f7))[_0x0f50('0x26')](handleError(_0xa700c7,null));};exports[_0x0f50('0xf1')]=function(_0x4e3e8a,_0x586ede,_0x577675){return db[_0x0f50('0x99')][_0x0f50('0xab')]({'where':{'id':_0x4e3e8a['params']['id']}})['then'](handleEntityNotFound(_0x586ede,null))['then'](function(_0x475a54){if(_0x475a54){return _0x475a54[_0x0f50('0xf2')](_0x4e3e8a[_0x0f50('0xad')][_0x0f50('0xea')],_[_0x0f50('0xeb')](_0x4e3e8a['body'],['ids','id'])||{})['spread'](function(){return db[_0x0f50('0xf3')]['findAll']({'attributes':['id',_0x0f50('0x35'),_0x0f50('0xf4')],'where':{'id':_0x4e3e8a['body'][_0x0f50('0xea')]}});})[_0x0f50('0x32')](function(_0x5ab6f0){socket[_0x0f50('0xf5')](_0x0f50('0xf6'),{'id':Number(_0x4e3e8a[_0x0f50('0xaf')]['id']),'tags':_0x5ab6f0||[]});return{'id':Number(_0x4e3e8a[_0x0f50('0xaf')]['id']),'tags':_0x5ab6f0||[]};});}})['then'](respondWithResult(_0x586ede,null))[_0x0f50('0x26')](handleError(_0x586ede,null));};exports['removeTags']=function(_0x18c761,_0x43bea1,_0x486a61){return db[_0x0f50('0x99')][_0x0f50('0xab')]({'where':{'id':_0x18c761['params']['id']}})[_0x0f50('0x32')](handleEntityNotFound(_0x43bea1,null))['then'](function(_0x2d2229){if(_0x2d2229){return _0x2d2229['removeTags'](_0x18c761['query']['ids']);}})[_0x0f50('0x32')](respondWithStatusCode(_0x43bea1,null))[_0x0f50('0x26')](handleError(_0x43bea1,null));};exports['download']=function(_0x53e9ab,_0x26d0e0){var _0x1d5b6d=moment()[_0x0f50('0xf7')]()['toString']();var _0x122b76=path[_0x0f50('0x86')](config['root'],'server','files',_0x0f50('0xf8'));var _0x11d97a=path[_0x0f50('0x86')](config[_0x0f50('0xc4')],_0x0f50('0xf9'),_0x0f50('0xfa'),_0x0f50('0xfb'));var _0x19f58a=path['join'](_0x122b76,_0x1d5b6d);var _0x3728f8=util[_0x0f50('0x65')](_0x0f50('0xfc'),_0x53e9ab['params']['id'],_0x1d5b6d);var _0x19965d=path['join'](_0x122b76,_0x3728f8);var _0x52d35e=![];return db[_0x0f50('0x99')][_0x0f50('0xab')]({'where':{'id':_0x53e9ab[_0x0f50('0xaf')]['id']},'include':[{'model':db[_0x0f50('0x36')],'as':_0x0f50('0xce'),'attributes':['id','body','createdAt','direction',_0x0f50('0xda')],'include':[{'model':db[_0x0f50('0xcb')],'as':'User','attributes':['id',_0x0f50('0xd7')],'raw':!![]},{'model':db['CmContact'],'as':'Contact','attributes':['id',_0x0f50('0xfd'),'lastName'],'raw':!![]},{'model':db[_0x0f50('0xbf')],'as':_0x0f50('0xbf'),'raw':!![]}]},{'model':db[_0x0f50('0xcc')],'as':'Account','attributes':['id','name']},{'model':db['User'],'as':'Owner','attributes':['id',_0x0f50('0xd7')]}]})[_0x0f50('0x32')](handleEntityNotFound(_0x26d0e0,null))['then'](function(_0x1519a8){if(_0x1519a8){var _0x303827=_0x1519a8[_0x0f50('0xfe')]({'plain':!![]});_0x52d35e=!![];var _0x2047f7={'format':'A4','border':_0x0f50('0xff'),'header':{'height':'40px','contents':{'first':_0x0f50('0x100')}},'footer':{'height':_0x0f50('0x101'),'contents':{'default':util[_0x0f50('0x65')](_0x0f50('0x102'),util[_0x0f50('0x65')]('%s\x20#%d',_0x0f50('0x103'),_0x303827['id']),moment()[_0x0f50('0x65')](_0x0f50('0x104'))[_0x0f50('0x85')]())}}};fs['mkdirSync'](_0x19f58a);var _0x4a6745={'channel':_0x0f50('0x103'),'account':_0x303827[_0x0f50('0x105')]['name'],'agent':_0x303827['Owner']?_0x303827[_0x0f50('0x106')]['fullname']:_0x0f50('0x107'),'createdAt':moment(_0x303827[_0x0f50('0x7c')])[_0x0f50('0x65')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0f50('0x85')](),'closedAt':_0x303827[_0x0f50('0xb7')]?moment(_0x303827[_0x0f50('0x108')])[_0x0f50('0x65')](_0x0f50('0x109'))['toString']():'','disposition':_0x303827[_0x0f50('0xb8')],'chatInfo':{'browser':_0x303827[_0x0f50('0x10a')],'os':_0x303827[_0x0f50('0x10b')],'referer':_0x303827['referer'],'customerIp':_0x303827[_0x0f50('0x10c')]},'messages':_(_0x303827[_0x0f50('0xce')])['tail']()[_0x0f50('0x78')]({'secret':![]})['map'](function(_0x5a0839){if(_0x5a0839[_0x0f50('0xbf')]){var _0x397db0=path[_0x0f50('0x86')](_0x11d97a,_0x5a0839['Attachment'][_0x0f50('0xbc')]);if(fs[_0x0f50('0x10d')](_0x397db0)){fs[_0x0f50('0x10e')](_0x397db0)[_0x0f50('0x10f')](fs[_0x0f50('0x110')](path[_0x0f50('0x86')](_0x19f58a,_0x5a0839[_0x0f50('0xbf')][_0x0f50('0xbc')])));}}return{'date':moment(_0x5a0839[_0x0f50('0x7c')])[_0x0f50('0x65')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0f50('0x85')](),'sender':_0x5a0839[_0x0f50('0x111')]===_0x0f50('0x112')?_0x5a0839[_0x0f50('0xcb')]?_0x5a0839[_0x0f50('0xcb')][_0x0f50('0xd7')]:_0x0f50('0xd2'):_0x5a0839[_0x0f50('0x113')]['firstName']+(_0x5a0839['Contact'][_0x0f50('0x114')]?'\x20'+_0x5a0839['Contact'][_0x0f50('0x114')]:''),'body':_0x5a0839['Attachment']?_0x5a0839[_0x0f50('0xbf')][_0x0f50('0xbc')]:_0x5a0839[_0x0f50('0xad')],'direction':_0x5a0839['direction']===_0x0f50('0x112')?'A':'C','secret':_0x5a0839['secret'],'attachment':_0x5a0839[_0x0f50('0xbf')]};})['value']()};return ejs['renderFile'](path[_0x0f50('0x86')](config[_0x0f50('0xc4')],_0x0f50('0xf9'),_0x0f50('0x115'),'downloadInteraction.html'),{'interaction':_0x4a6745})['then'](function(_0x1e39c6){return new BPromise(function(_0x5293b5,_0x4f483d){pdf[_0x0f50('0xac')](_0x1e39c6,_0x2047f7)[_0x0f50('0x116')](path[_0x0f50('0x86')](_0x19f58a,_0x0f50('0x117')+_0x303827['id']+'-'+_0x1d5b6d+'.pdf'),function(_0x3aea61,_0x2f9d79){if(_0x3aea61)return _0x4f483d(_0x3aea61);_0x5293b5(_0x2f9d79);});});});}})[_0x0f50('0x32')](function(){if(_0x52d35e){return new BPromise(function(_0xef3301,_0x3617d7){zipdir(_0x19f58a,{'saveTo':_0x19965d},function(_0x5f0c5b,_0x390cae){if(_0x5f0c5b)return _0x3617d7(_0x5f0c5b);return _0xef3301(_0x390cae);});})[_0x0f50('0x32')](function(){return new BPromise(function(_0x456d76,_0xa97cbc){rimraf(_0x19f58a,function(_0x5b31e0){if(_0x5b31e0)_0xa97cbc(_0x5b31e0);return _0x456d76();});});})[_0x0f50('0x32')](function(){return _0x26d0e0['download'](_0x19965d,_0x3728f8,function(_0x2b9c86){if(_0x2b9c86){console[_0x0f50('0x118')](_0x0f50('0x119'),_0x2b9c86);}else{fs[_0x0f50('0x11a')](_0x19965d);}});});}else{return _0x26d0e0['sendStatus'](0xc8);}})[_0x0f50('0x26')](handleError(_0x26d0e0,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f67e812..0c95ec5 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 _0x30a0=['save','update','getUsers','setDataValue','Users','findAll','unreadMessages','length','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners'];(function(_0x2ac3dd,_0x3bc187){var _0x487a05=function(_0x40bce1){while(--_0x40bce1){_0x2ac3dd['push'](_0x2ac3dd['shift']());}};_0x487a05(++_0x3bc187);}(_0x30a0,0xb0));var _0x030a=function(_0x4a02cf,_0x5ff8b9){_0x4a02cf=_0x4a02cf-0x0;var _0xb1a83f=_0x30a0[_0x4a02cf];return _0xb1a83f;};'use strict';var EventEmitter=require(_0x030a('0x0'));var ChatInteraction=require(_0x030a('0x1'))['db'][_0x030a('0x2')];var ChatMessage=require(_0x030a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x030a('0x3')](0x0);var events={'afterCreate':_0x030a('0x4'),'afterUpdate':_0x030a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4babca){return function(_0x561733,_0x115408,_0x56bbb8){_0x561733[_0x030a('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xe26406){_0x561733[_0x030a('0x7')](_0x030a('0x8'),_0xe26406['map'](function(_0x37c920){return{'id':_0x37c920['id']};}));return ChatMessage[_0x030a('0x9')]({'where':{'ChatInteractionId':_0x561733['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2dc85b){_0x561733[_0x030a('0x7')](_0x030a('0xa'),_0x2dc85b[_0x030a('0xb')]);ChatInteractionEvents['emit'](_0x4babca+':'+_0x561733['id'],_0x561733);ChatInteractionEvents['emit'](_0x4babca,_0x561733);_0x56bbb8(null);})[_0x030a('0xc')](_0x56bbb8(null));};}for(var e in events){if(events[_0x030a('0xd')](e)){var event=events[e];ChatInteraction[_0x030a('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xb597=['ChatMessage','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction'];(function(_0x3517a0,_0x428c1d){var _0x320be2=function(_0x21e33f){while(--_0x21e33f){_0x3517a0['push'](_0x3517a0['shift']());}};_0x320be2(++_0x428c1d);}(_0xb597,0x1a0));var _0x7b59=function(_0x478caa,_0x18fa89){_0x478caa=_0x478caa-0x0;var _0x3cd54e=_0xb597[_0x478caa];return _0x3cd54e;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x7b59('0x0'))['db'][_0x7b59('0x1')];var ChatMessage=require(_0x7b59('0x0'))['db'][_0x7b59('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b59('0x3'),'afterUpdate':_0x7b59('0x4'),'afterDestroy':_0x7b59('0x5')};function emitEvent(_0x2bfed4){return function(_0x503b18,_0x29ce9e,_0xb90c54){_0x503b18[_0x7b59('0x6')]({'attributes':['id'],'raw':!![]})[_0x7b59('0x7')](function(_0x196219){_0x503b18['setDataValue'](_0x7b59('0x8'),_0x196219[_0x7b59('0x9')](function(_0x51f29f){return{'id':_0x51f29f['id']};}));return ChatMessage[_0x7b59('0xa')]({'where':{'ChatInteractionId':_0x503b18['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b59('0x7')](function(_0x33af9f){_0x503b18[_0x7b59('0xb')](_0x7b59('0xc'),_0x33af9f[_0x7b59('0xd')]);ChatInteractionEvents[_0x7b59('0xe')](_0x2bfed4+':'+_0x503b18['id'],_0x503b18);ChatInteractionEvents[_0x7b59('0xe')](_0x2bfed4,_0x503b18);_0xb90c54(null);})[_0x7b59('0xf')](_0xb90c54(null));};}for(var e in events){if(events[_0x7b59('0x10')](e)){var event=events[e];ChatInteraction[_0x7b59('0x11')](e,emitEvent(event));}}module[_0x7b59('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d928d2e..7cbb3c6 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 _0xd8b0=['request-promise','path','rimraf','../../config/environment','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird'];(function(_0x3a465a,_0x3e8001){var _0x1ed244=function(_0x1349e9){while(--_0x1349e9){_0x3a465a['push'](_0x3a465a['shift']());}};_0x1ed244(++_0x3e8001);}(_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 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('./chatInteraction.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatInteraction',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x284169,_0x58e4e2,_0x129310){if(_0x284169[_0x0d8b('0x9')](_0x0d8b('0xa'))){_0x284169[_0x0d8b('0xb')]=moment()[_0x0d8b('0xc')](_0x0d8b('0xd'));}_0x129310(null,_0x284169);}},'charset':_0x0d8b('0xe'),'collate':_0x0d8b('0xf')});}; \ No newline at end of file +var _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x414d77,_0x1f72bf){var _0x3fc41c=function(_0x32313e){while(--_0x32313e){_0x414d77['push'](_0x414d77['shift']());}};_0x3fc41c(++_0x1f72bf);}(_0x757a,0xde));var _0xa757=function(_0x57a3d8,_0x28197c){_0x57a3d8=_0x57a3d8-0x0;var _0x3e9a81=_0x757a[_0x57a3d8];return _0x3e9a81;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a23b6b9..6bb1314 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 _0x73f0=['stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','ChatInteraction','update','options','where','attributes','limit','UpdateChatInteraction','debug','find','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./chatInteraction.socket','register','request','then','request\x20sent'];(function(_0x377c26,_0xb31a5a){var _0x581944=function(_0x209e61){while(--_0x209e61){_0x377c26['push'](_0x377c26['shift']());}};_0x581944(++_0xb31a5a);}(_0x73f0,0xe3));var _0x073f=function(_0x3d889c,_0x38b195){_0x3d889c=_0x3d889c-0x0;var _0x3e9559=_0x73f0[_0x3d889c];return _0x3e9559;};'use strict';var _=require(_0x073f('0x0'));var util=require('util');var moment=require(_0x073f('0x1'));var BPromise=require(_0x073f('0x2'));var rs=require(_0x073f('0x3'));var fs=require('fs');var Redis=require(_0x073f('0x4'));var db=require(_0x073f('0x5'))['db'];var utils=require(_0x073f('0x6'));var logger=require(_0x073f('0x7'))(_0x073f('0x8'));var config=require(_0x073f('0x9'));var jayson=require(_0x073f('0xa'));var client=jayson['client'][_0x073f('0xb')]({'port':0x232a});config[_0x073f('0xc')]=_[_0x073f('0xd')](config[_0x073f('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x073f('0xc')]));require(_0x073f('0xe'))[_0x073f('0xf')](socket);function respondWithRpcPromise(_0x425b1f,_0x42dbad,_0x57e509){return new BPromise(function(_0x4a2476,_0x232d64){return client[_0x073f('0x10')](_0x425b1f,_0x57e509)[_0x073f('0x11')](function(_0xb1e813){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x42dbad,_0x073f('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x42dbad,_0x073f('0x12'),JSON[_0x073f('0x13')](_0xb1e813));if(_0xb1e813[_0x073f('0x14')]){if(_0xb1e813[_0x073f('0x14')][_0x073f('0x15')]===0x1f4){logger[_0x073f('0x14')](_0x073f('0x16'),_0x42dbad,_0xb1e813[_0x073f('0x14')][_0x073f('0x17')]);return _0x232d64(_0xb1e813[_0x073f('0x14')]['message']);}logger[_0x073f('0x14')](_0x073f('0x16'),_0x42dbad,_0xb1e813[_0x073f('0x14')][_0x073f('0x17')]);return _0x4a2476(_0xb1e813[_0x073f('0x14')][_0x073f('0x17')]);}else{logger[_0x073f('0x18')](_0x073f('0x16'),_0x42dbad,_0x073f('0x12'));_0x4a2476(_0xb1e813[_0x073f('0x19')]['message']);}})[_0x073f('0x1a')](function(_0xee598e){logger[_0x073f('0x14')](_0x073f('0x16'),_0x42dbad,_0xee598e);_0x232d64(_0xee598e);});});}exports['UpdateChatInteraction']=function(_0x4554a5){var _0x7d1315=this;return new Promise(function(_0x4ad96c,_0x44b85b){return db[_0x073f('0x1b')][_0x073f('0x1c')](_0x4554a5['body'],{'raw':_0x4554a5[_0x073f('0x1d')]?_0x4554a5[_0x073f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4554a5['options']?_0x4554a5[_0x073f('0x1d')][_0x073f('0x1e')]||null:null,'attributes':_0x4554a5['options']?_0x4554a5[_0x073f('0x1d')][_0x073f('0x1f')]||null:null,'limit':_0x4554a5[_0x073f('0x1d')]?_0x4554a5[_0x073f('0x1d')][_0x073f('0x20')]||null:null})['then'](function(_0x5b4b81){logger['info'](_0x073f('0x21'),_0x4554a5);logger[_0x073f('0x22')](_0x073f('0x21'),_0x4554a5,JSON[_0x073f('0x13')](_0x5b4b81));_0x4ad96c(_0x5b4b81);})[_0x073f('0x1a')](function(_0x1fae3c){logger['error'](_0x073f('0x21'),_0x1fae3c[_0x073f('0x17')],_0x4554a5);_0x44b85b(_0x7d1315[_0x073f('0x14')](0x1f4,_0x1fae3c[_0x073f('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x36e070){return new Promise(function(_0x15075b,_0x5ab146){return db[_0x073f('0x1b')][_0x073f('0x23')]({'where':_0x36e070['options']?_0x36e070[_0x073f('0x1d')]['where']||null:null})['then'](function(_0x2189ae){if(_0x2189ae){return _0x2189ae['addTags'](_0x36e070[_0x073f('0x24')][_0x073f('0x25')],_[_0x073f('0x26')](_0x36e070[_0x073f('0x24')],[_0x073f('0x25'),'id'])||{});}})[_0x073f('0x27')](function(_0x41722d){logger[_0x073f('0x18')](_0x073f('0x28'),_0x36e070);logger[_0x073f('0x22')](_0x073f('0x28'),_0x36e070,JSON['stringify'](_0x41722d));_0x15075b(_0x41722d);})[_0x073f('0x1a')](function(_0x80e39f){logger['error']('AddTags',_0x80e39f[_0x073f('0x17')],_0x36e070);_0x5ab146(_this['error'](0x1f4,_0x80e39f[_0x073f('0x17')]));});});}; \ No newline at end of file +var _0x51a3=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f6aff,_0x4b2133){var _0x91b04=function(_0x74911b){while(--_0x74911b){_0x1f6aff['push'](_0x1f6aff['shift']());}};_0x91b04(++_0x4b2133);}(_0x51a3,0x1e5));var _0x351a=function(_0x352d57,_0x59e9ac){_0x352d57=_0x352d57-0x0;var _0x40c00d=_0x51a3[_0x352d57];return _0x40c00d;};'use strict';var _=require(_0x351a('0x0'));var util=require(_0x351a('0x1'));var moment=require(_0x351a('0x2'));var BPromise=require(_0x351a('0x3'));var rs=require(_0x351a('0x4'));var fs=require('fs');var Redis=require(_0x351a('0x5'));var db=require(_0x351a('0x6'))['db'];var utils=require(_0x351a('0x7'));var logger=require(_0x351a('0x8'))(_0x351a('0x9'));var config=require(_0x351a('0xa'));var jayson=require(_0x351a('0xb'));var client=jayson[_0x351a('0xc')][_0x351a('0xd')]({'port':0x232a});config[_0x351a('0xe')]=_[_0x351a('0xf')](config['redis'],{'host':_0x351a('0x10'),'port':0x18eb});var socket=require(_0x351a('0x11'))(new Redis(config[_0x351a('0xe')]));require(_0x351a('0x12'))['register'](socket);function respondWithRpcPromise(_0x38916c,_0x3179a4,_0x54729d){return new BPromise(function(_0x22181f,_0xe98121){return client['request'](_0x38916c,_0x54729d)[_0x351a('0x13')](function(_0x4b65c4){logger[_0x351a('0x14')](_0x351a('0x15'),_0x3179a4,_0x351a('0x16'));logger[_0x351a('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3179a4,_0x351a('0x16'),JSON[_0x351a('0x18')](_0x4b65c4));if(_0x4b65c4[_0x351a('0x19')]){if(_0x4b65c4[_0x351a('0x19')][_0x351a('0x1a')]===0x1f4){logger[_0x351a('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x3179a4,_0x4b65c4[_0x351a('0x19')]['message']);return _0xe98121(_0x4b65c4[_0x351a('0x19')][_0x351a('0x1b')]);}logger[_0x351a('0x19')](_0x351a('0x15'),_0x3179a4,_0x4b65c4[_0x351a('0x19')][_0x351a('0x1b')]);return _0x22181f(_0x4b65c4[_0x351a('0x19')][_0x351a('0x1b')]);}else{logger[_0x351a('0x14')](_0x351a('0x15'),_0x3179a4,_0x351a('0x16'));_0x22181f(_0x4b65c4[_0x351a('0x1c')]['message']);}})[_0x351a('0x1d')](function(_0x45f91d){logger[_0x351a('0x19')](_0x351a('0x15'),_0x3179a4,_0x45f91d);_0xe98121(_0x45f91d);});});}exports[_0x351a('0x1e')]=function(_0x59c36d){var _0x2aa9b6=this;return new Promise(function(_0x3b2f45,_0x136a6e){return db[_0x351a('0x1f')][_0x351a('0x20')](_0x59c36d[_0x351a('0x21')],{'raw':_0x59c36d[_0x351a('0x22')]?_0x59c36d[_0x351a('0x22')][_0x351a('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c36d[_0x351a('0x22')]?_0x59c36d[_0x351a('0x22')][_0x351a('0x24')]||null:null,'attributes':_0x59c36d['options']?_0x59c36d['options'][_0x351a('0x25')]||null:null,'limit':_0x59c36d['options']?_0x59c36d[_0x351a('0x22')][_0x351a('0x26')]||null:null})[_0x351a('0x13')](function(_0x211f5c){logger[_0x351a('0x14')](_0x351a('0x1e'),_0x59c36d);logger[_0x351a('0x17')]('UpdateChatInteraction',_0x59c36d,JSON[_0x351a('0x18')](_0x211f5c));_0x3b2f45(_0x211f5c);})[_0x351a('0x1d')](function(_0x31a0e9){logger[_0x351a('0x19')](_0x351a('0x1e'),_0x31a0e9[_0x351a('0x1b')],_0x59c36d);_0x136a6e(_0x2aa9b6[_0x351a('0x19')](0x1f4,_0x31a0e9['message']));});});};exports[_0x351a('0x27')]=function(_0x3dfba0){return new Promise(function(_0x1331fc,_0xd9b85d){return db[_0x351a('0x1f')][_0x351a('0x28')]({'where':_0x3dfba0[_0x351a('0x22')]?_0x3dfba0['options']['where']||null:null})['then'](function(_0xd886c9){if(_0xd886c9){return _0xd886c9['addTags'](_0x3dfba0[_0x351a('0x21')][_0x351a('0x29')],_[_0x351a('0x2a')](_0x3dfba0[_0x351a('0x21')],[_0x351a('0x29'),'id'])||{});}})[_0x351a('0x2b')](function(_0x4ced76){logger[_0x351a('0x14')](_0x351a('0x2c'),_0x3dfba0);logger[_0x351a('0x17')](_0x351a('0x2c'),_0x3dfba0,JSON[_0x351a('0x18')](_0x4ced76));_0x1331fc(_0x4ced76);})[_0x351a('0x1d')](function(_0x4e89f7){logger['error'](_0x351a('0x2c'),_0x4e89f7[_0x351a('0x1b')],_0x3dfba0);_0xd9b85d(_this['error'](0x1f4,_0x4e89f7[_0x351a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8c45712..1644b7a 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 _0x3e49=['save','update','length','chatInteraction:','./chatInteraction.events'];(function(_0x1f88f0,_0x2dc0ac){var _0x3684f5=function(_0x2f5efd){while(--_0x2f5efd){_0x1f88f0['push'](_0x1f88f0['shift']());}};_0x3684f5(++_0x2dc0ac);}(_0x3e49,0x90));var _0x93e4=function(_0x3f2338,_0x49ef69){_0x3f2338=_0x3f2338-0x0;var _0x2b9a82=_0x3e49[_0x3f2338];return _0x2b9a82;};'use strict';var ChatInteractionEvents=require(_0x93e4('0x0'));var events=[_0x93e4('0x1'),'remove',_0x93e4('0x2')];function createListener(_0x34fa92,_0x3d7e7e){return function(_0x2143f4){_0x3d7e7e['emit'](_0x34fa92,_0x2143f4);};}function removeListener(_0x67b90b,_0x18e4f9){return function(){ChatInteractionEvents['removeListener'](_0x67b90b,_0x18e4f9);};}exports['register']=function(_0x47cee3){for(var _0x303c73=0x0,_0x2c620d=events[_0x93e4('0x3')];_0x303c73<_0x2c620d;_0x303c73++){var _0x3edabd=events[_0x303c73];var _0x112c54=createListener(_0x93e4('0x4')+_0x3edabd,_0x47cee3);ChatInteractionEvents['on'](_0x3edabd,_0x112c54);}}; \ No newline at end of file +var _0xaf32=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xaf32,0x1ce));var _0x2af3=function(_0x21c0de,_0x4a9720){_0x21c0de=_0x21c0de-0x0;var _0x32229e=_0xaf32[_0x21c0de];return _0x32229e;};'use strict';var ChatInteractionEvents=require(_0x2af3('0x0'));var events=[_0x2af3('0x1'),'remove',_0x2af3('0x2')];function createListener(_0x401944,_0x5e715e){return function(_0x162519){_0x5e715e[_0x2af3('0x3')](_0x401944,_0x162519);};}function removeListener(_0x4d03a0,_0x332325){return function(){ChatInteractionEvents[_0x2af3('0x4')](_0x4d03a0,_0x332325);};}exports[_0x2af3('0x5')]=function(_0x52571c){for(var _0x17f804=0x0,_0x19fa3e=events[_0x2af3('0x6')];_0x17f804<_0x19fa3e;_0x17f804++){var _0x3b4bfa=events[_0x17f804];var _0x4ea700=createListener(_0x2af3('0x7')+_0x3b4bfa,_0x52571c);ChatInteractionEvents['on'](_0x3b4bfa,_0x4ea700);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 278623a..53374c5 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 _0x1c9a=['/:id','chatinteraction:destroy','destroy','/:id/tags','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1c9a,0x98));var _0xa1c9=function(_0x1acfb4,_0x2d1993){_0x1acfb4=_0x1acfb4-0x0;var _0x554f2f=_0x1c9a[_0x1acfb4];return _0x554f2f;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/describe',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0xa')](),controller[_0xa1c9('0xb')]);router[_0xa1c9('0x7')](_0xa1c9('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xa1c9('0xd')]);router[_0xa1c9('0x7')](_0xa1c9('0xe'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);router[_0xa1c9('0x7')](_0xa1c9('0x10'),auth[_0xa1c9('0xa')](),controller[_0xa1c9('0x11')]);router[_0xa1c9('0x7')]('/:id/download',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x12')]);router[_0xa1c9('0x13')]('/',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x335dda,_0x4b2fa5,_0x2cba13){_0x2cba13(null,path[_0xa1c9('0x15')](config[_0xa1c9('0x16')],_0xa1c9('0x17')));},'filename':function(_0x44ab5b,_0x3b51f5,_0x1f6d26){_0x1f6d26(null,util[_0xa1c9('0x18')]('%s-%s',Date[_0xa1c9('0x19')](),_0x3b51f5[_0xa1c9('0x1a')][_0xa1c9('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa1c9('0x1c'),upload['single'](_0xa1c9('0x1d')),controller[_0xa1c9('0x1e')]);router[_0xa1c9('0x13')]('/:id/messages',auth[_0xa1c9('0xa')](),controller[_0xa1c9('0x1f')]);router[_0xa1c9('0x13')]('/:id/tags',auth[_0xa1c9('0x8')](),interaction[_0xa1c9('0x20')]('chat',_0xa1c9('0x21')),controller[_0xa1c9('0x22')]);router[_0xa1c9('0x23')]('/:id',auth[_0xa1c9('0x8')](),interaction[_0xa1c9('0x20')](_0xa1c9('0x24'),_0xa1c9('0x25')),controller[_0xa1c9('0x26')]);router['put']('/:id/custom_update',controller[_0xa1c9('0x27')]);router['put'](_0xa1c9('0x28'),auth[_0xa1c9('0xa')](),controller[_0xa1c9('0x29')]);router[_0xa1c9('0x23')](_0xa1c9('0x2a'),controller['close']);router[_0xa1c9('0x2b')](_0xa1c9('0x2c'),auth[_0xa1c9('0x8')](),interaction['tracked'](_0xa1c9('0x24'),_0xa1c9('0x2d')),controller[_0xa1c9('0x2e')]);router['delete'](_0xa1c9('0x2f'),auth[_0xa1c9('0x8')](),controller['removeTags']);module[_0xa1c9('0x30')]=router; \ No newline at end of file +var _0x9348=['server/files/attachments/','format','%s-%s','now','/:id/attachment_upload','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','join','root'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x9348,0x10d));var _0x8934=function(_0x378d98,_0x1aa485){_0x378d98=_0x378d98-0x0;var _0x369370=_0x9348[_0x378d98];return _0x369370;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var auth=require(_0x8934('0x5'));var interaction=require(_0x8934('0x6'));var config=require('../../config/environment');var controller=require(_0x8934('0x7'));router[_0x8934('0x8')]('/',auth[_0x8934('0x9')](),controller[_0x8934('0xa')]);router[_0x8934('0x8')](_0x8934('0xb'),auth['isAuthenticated'](),controller[_0x8934('0xc')]);router[_0x8934('0x8')](_0x8934('0xd'),auth['isChatInteractionAuthorized'](),controller['show']);router['get']('/:id/attachment_download',auth[_0x8934('0xe')](),controller['attachmentDownload']);router[_0x8934('0x8')](_0x8934('0xf'),auth[_0x8934('0x9')](),controller[_0x8934('0x10')]);router[_0x8934('0x8')](_0x8934('0x11'),auth[_0x8934('0xe')](),controller[_0x8934('0x12')]);router['get'](_0x8934('0x13'),auth[_0x8934('0x9')](),controller[_0x8934('0x14')]);router[_0x8934('0x15')]('/',auth[_0x8934('0x9')](),controller[_0x8934('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x254720,_0x38230a,_0xdfc97c){_0xdfc97c(null,path[_0x8934('0x17')](config[_0x8934('0x18')],_0x8934('0x19')));},'filename':function(_0x2a5b04,_0x357cf8,_0x52de6a){_0x52de6a(null,util[_0x8934('0x1a')](_0x8934('0x1b'),Date[_0x8934('0x1c')](),_0x357cf8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x8934('0x1d'),upload['single'](_0x8934('0x1e')),controller[_0x8934('0x1f')]);router[_0x8934('0x15')](_0x8934('0xf'),auth[_0x8934('0xe')](),controller['addMessage']);router[_0x8934('0x15')]('/:id/tags',auth[_0x8934('0x9')](),interaction[_0x8934('0x20')](_0x8934('0x21'),_0x8934('0x22')),controller[_0x8934('0x23')]);router[_0x8934('0x24')](_0x8934('0xd'),auth['isAuthenticated'](),interaction[_0x8934('0x20')](_0x8934('0x21'),_0x8934('0x25')),controller[_0x8934('0x26')]);router[_0x8934('0x24')]('/:id/custom_update',controller[_0x8934('0x27')]);router[_0x8934('0x24')](_0x8934('0x28'),auth['isChatInteractionAuthorized'](),controller[_0x8934('0x29')]);router['put'](_0x8934('0x2a'),controller[_0x8934('0x2b')]);router[_0x8934('0x2c')]('/:id',auth[_0x8934('0x9')](),interaction[_0x8934('0x20')](_0x8934('0x21'),_0x8934('0x2d')),controller['destroy']);router[_0x8934('0x2c')](_0x8934('0x2e'),auth[_0x8934('0x9')](),controller[_0x8934('0x2f')]);module[_0x8934('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 5d2eca1..a72c8e2 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 _0x17a7=['BOOLEAN','INTEGER','medium'];(function(_0x306dda,_0x2af0b9){var _0x31caee=function(_0x456ff2){while(--_0x456ff2){_0x306dda['push'](_0x306dda['shift']());}};_0x31caee(++_0x2af0b9);}(_0x17a7,0xc2));var _0x717a=function(_0x31ef07,_0x51bb3a){_0x31ef07=_0x31ef07-0x0;var _0x1fbb02=_0x17a7[_0x31ef07];return _0x1fbb02;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x717a('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x717a('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x717a('0x2')]}}; \ No newline at end of file +var _0xbff5=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0xbff5,0x1bc));var _0x5bff=function(_0x2e4d44,_0x46939f){_0x2e4d44=_0x2e4d44-0x0;var _0x21787f=_0xbff5[_0x2e4d44];return _0x21787f;};'use strict';var Sequelize=require(_0x5bff('0x0'));module[_0x5bff('0x1')]={'body':{'type':Sequelize[_0x5bff('0x2')](_0x5bff('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5bff('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5bff('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index cfc5057..900aa7c 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 _0xd4ea=['UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','key','VIRTUAL','field','options','include','ChatInternalMessage','findAll','rows','catch','params','create','body','find','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0xd4ea,0x1cf));var _0xad4e=function(_0x480a3a,_0x5c20e6){_0x480a3a=_0x480a3a-0x0;var _0x33966d=_0xd4ea[_0x480a3a];return _0x33966d;};'use strict';var pdf=require(_0xad4e('0x0'));var emlformat=require(_0xad4e('0x1'));var rimraf=require(_0xad4e('0x2'));var zipdir=require(_0xad4e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad4e('0x4'));var Mustache=require(_0xad4e('0x5'));var util=require(_0xad4e('0x6'));var path=require(_0xad4e('0x7'));var sox=require(_0xad4e('0x8'));var csv=require(_0xad4e('0x9'));var ejs=require(_0xad4e('0xa'));var fs=require('fs');var _=require(_0xad4e('0xb'));var squel=require(_0xad4e('0xc'));var crypto=require('crypto');var jsforce=require(_0xad4e('0xd'));var deskjs=require(_0xad4e('0xe'));var toCsv=require(_0xad4e('0x9'));var querystring=require('querystring');var Papa=require(_0xad4e('0xf'));var Redis=require(_0xad4e('0x10'));var authService=require(_0xad4e('0x11'));var qs=require(_0xad4e('0x12'));var hardwareService=require(_0xad4e('0x13'));var logger=require(_0xad4e('0x14'))(_0xad4e('0x15'));var utils=require(_0xad4e('0x16'));var config=require(_0xad4e('0x17'));var db=require(_0xad4e('0x18'))['db'];config['redis']=_['defaults'](config[_0xad4e('0x19')],{'host':_0xad4e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad4e('0x19')]));require(_0xad4e('0x1b'))[_0xad4e('0x1c')](socket);function respondWithStatusCode(_0x174dce,_0x2e92e3){_0x2e92e3=_0x2e92e3||0xcc;return function(_0x56b3d4){if(_0x56b3d4){return _0x174dce[_0xad4e('0x1d')](_0x2e92e3);}return _0x174dce[_0xad4e('0x1e')](_0x2e92e3)[_0xad4e('0x1f')]();};}function respondWithResult(_0x251866,_0x3a10a0){_0x3a10a0=_0x3a10a0||0xc8;return function(_0x1770b){if(_0x1770b){return _0x251866[_0xad4e('0x1e')](_0x3a10a0)[_0xad4e('0x20')](_0x1770b);}};}function respondWithFilteredResult(_0x3a3b9d,_0x50efe0){return function(_0x23b464){if(_0x23b464){var _0x5a75bb=_0x23b464[_0xad4e('0x21')],_0x1c612b=_0x50efe0[_0xad4e('0x22')],_0x1487b4=_0x50efe0[_0xad4e('0x22')]+_0x50efe0['limit'],_0x12c000;if(_0x1487b4>=_0x5a75bb){_0x1487b4=_0x5a75bb;_0x12c000=0xc8;}else{_0x12c000=0xce;}_0x3a3b9d[_0xad4e('0x1e')](_0x12c000);return _0x3a3b9d[_0xad4e('0x23')](_0xad4e('0x24'),_0x1c612b+'-'+_0x1487b4+'/'+_0x5a75bb)['json'](_0x23b464);}return null;};}function patchUpdates(_0x6be4f4){return function(_0x44af68){try{jsonpatch[_0xad4e('0x25')](_0x44af68,_0x6be4f4,!![]);}catch(_0x1b69ee){return BPromise[_0xad4e('0x26')](_0x1b69ee);}return _0x44af68[_0xad4e('0x27')]();};}function saveUpdates(_0x4c60dd,_0x520c98){return function(_0xad8f4){if(_0xad8f4){return _0xad8f4[_0xad4e('0x28')](_0x4c60dd)[_0xad4e('0x29')](function(_0x3a72a9){return _0x3a72a9;});}return null;};}function removeEntity(_0x452ed0,_0x3d6cb6){return function(_0x300e50){if(_0x300e50){return _0x300e50[_0xad4e('0x2a')]()[_0xad4e('0x29')](function(){_0x452ed0[_0xad4e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bab4d,_0x4ff4e3){return function(_0x481fd1){if(!_0x481fd1){_0x3bab4d[_0xad4e('0x1d')](0x194);}return _0x481fd1;};}function handleError(_0x4b9726,_0x2b9ddc){_0x2b9ddc=_0x2b9ddc||0x1f4;return function(_0x589fca){logger[_0xad4e('0x2b')](_0x589fca['stack']);if(_0x589fca[_0xad4e('0x2c')]){delete _0x589fca[_0xad4e('0x2c')];}_0x4b9726['status'](_0x2b9ddc)[_0xad4e('0x2d')](_0x589fca);};}exports[_0xad4e('0x2e')]=function(_0x69f4c8,_0x35c492){var _0x775305={},_0x21c37b={},_0x2b22f8={'count':0x0,'rows':[]};var _0x578910=db['ChatInternalMessage'][_0xad4e('0x2f')];_0x21c37b[_0xad4e('0x30')]=_[_0xad4e('0x31')](_0x578910);_0x21c37b[_0xad4e('0x32')]=_[_0xad4e('0x31')](_0x69f4c8['query']);_0x21c37b['filters']=_[_0xad4e('0x33')](_0x21c37b[_0xad4e('0x30')],_0x21c37b[_0xad4e('0x32')]);_0x775305[_0xad4e('0x34')]=_[_0xad4e('0x33')](_0x21c37b[_0xad4e('0x30')],qs[_0xad4e('0x35')](_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x35')]));_0x775305[_0xad4e('0x34')]=_0x775305[_0xad4e('0x34')][_0xad4e('0x36')]?_0x775305[_0xad4e('0x34')]:_0x21c37b['model'];if(!_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x37')](_0xad4e('0x38'))){_0x775305[_0xad4e('0x39')]=qs[_0xad4e('0x39')](_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x39')]);_0x775305[_0xad4e('0x22')]=qs['offset'](_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x22')]);}_0x775305['order']=qs[_0xad4e('0x3a')](_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x3a')]);_0x775305[_0xad4e('0x3b')]=qs['filters'](_[_0xad4e('0x3c')](_0x69f4c8['query'],_0x21c37b[_0xad4e('0x3d')]));if(_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x3e')]){_0x775305[_0xad4e('0x3b')]=_[_0xad4e('0x3f')](_0x775305[_0xad4e('0x3b')],{'$or':_['map'](_0x578910,function(_0x47511f){if(_0x47511f['type'][_0xad4e('0x40')]!==_0xad4e('0x41')){var _0x69f9d5={};_0x69f9d5[_0x47511f[_0xad4e('0x42')]]={'$like':'%'+_0x69f4c8[_0xad4e('0x32')][_0xad4e('0x3e')]+'%'};return _0x69f9d5;}})});}_0x775305=_[_0xad4e('0x3f')]({},_0x775305,_0x69f4c8[_0xad4e('0x43')]);var _0x57447c={'where':_0x775305[_0xad4e('0x3b')]};return db['ChatInternalMessage'][_0xad4e('0x21')](_0x57447c)[_0xad4e('0x29')](function(_0x389749){_0x2b22f8[_0xad4e('0x21')]=_0x389749;if(_0x69f4c8[_0xad4e('0x32')]['includeAll']){_0x775305[_0xad4e('0x44')]=[{'all':!![]}];}return db[_0xad4e('0x45')][_0xad4e('0x46')](_0x775305);})['then'](function(_0x83344c){_0x2b22f8[_0xad4e('0x47')]=_0x83344c;return _0x2b22f8;})['then'](respondWithFilteredResult(_0x35c492,_0x775305))[_0xad4e('0x48')](handleError(_0x35c492,null));};exports['show']=function(_0x3cb107,_0x23c26e){var _0x3fcc95={'raw':!![],'where':{'id':_0x3cb107[_0xad4e('0x49')]['id']}},_0x357d8a={};_0x357d8a['model']=_[_0xad4e('0x31')](db[_0xad4e('0x45')]['rawAttributes']);_0x357d8a[_0xad4e('0x32')]=_['keys'](_0x3cb107['query']);_0x357d8a['filters']=_[_0xad4e('0x33')](_0x357d8a[_0xad4e('0x30')],_0x357d8a[_0xad4e('0x32')]);_0x3fcc95['attributes']=_[_0xad4e('0x33')](_0x357d8a[_0xad4e('0x30')],qs[_0xad4e('0x35')](_0x3cb107[_0xad4e('0x32')][_0xad4e('0x35')]));_0x3fcc95[_0xad4e('0x34')]=_0x3fcc95[_0xad4e('0x34')]['length']?_0x3fcc95['attributes']:_0x357d8a[_0xad4e('0x30')];if(_0x3cb107[_0xad4e('0x32')]['includeAll']){_0x3fcc95[_0xad4e('0x44')]=[{'all':!![]}];}_0x3fcc95=_[_0xad4e('0x3f')]({},_0x3fcc95,_0x3cb107['options']);return db[_0xad4e('0x45')]['find'](_0x3fcc95)[_0xad4e('0x29')](handleEntityNotFound(_0x23c26e,null))['then'](respondWithResult(_0x23c26e,null))[_0xad4e('0x48')](handleError(_0x23c26e,null));};exports['create']=function(_0x5ed8a3,_0x47fe88){return db[_0xad4e('0x45')][_0xad4e('0x4a')](_0x5ed8a3[_0xad4e('0x4b')],{})['then'](respondWithResult(_0x47fe88,0xc9))[_0xad4e('0x48')](handleError(_0x47fe88,null));};exports['update']=function(_0x47c018,_0x3c2cce){if(_0x47c018[_0xad4e('0x4b')]['id']){delete _0x47c018['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x47c018[_0xad4e('0x49')]['id']}})[_0xad4e('0x29')](handleEntityNotFound(_0x3c2cce,null))[_0xad4e('0x29')](saveUpdates(_0x47c018[_0xad4e('0x4b')],null))[_0xad4e('0x29')](respondWithResult(_0x3c2cce,null))[_0xad4e('0x48')](handleError(_0x3c2cce,null));};exports[_0xad4e('0x2a')]=function(_0x1f1788,_0x3641a0){return db[_0xad4e('0x45')][_0xad4e('0x4c')]({'where':{'id':_0x1f1788['params']['id']}})[_0xad4e('0x29')](handleEntityNotFound(_0x3641a0,null))['then'](removeEntity(_0x3641a0,null))['catch'](handleError(_0x3641a0,null));};exports[_0xad4e('0x4d')]=function(_0x4e0a0c,_0x291312){return db['ChatInternalMessage'][_0xad4e('0x4d')]()[_0xad4e('0x29')](respondWithResult(_0x291312,null))['catch'](handleError(_0x291312,null));};function wrapUser(_0x853cf4){return function(_0x28383c){var _0x24074c=_0x853cf4['get']({'plain':!![]});_0x24074c[_0xad4e('0x4e')]=[];if(_0x28383c){_0x24074c['lastMessageAt']=_0x28383c['createdAt'];_0x24074c['lastMessage']=_0x28383c;}else{_0x24074c[_0xad4e('0x4f')]=moment(0x0)[_0xad4e('0x50')](_0xad4e('0x51'));_0x24074c[_0xad4e('0x52')]={};}return _0x24074c;};}exports[_0xad4e('0x53')]=function(_0x1573f3,_0x18c441,_0xabd4a9){var _0x5dfbb3=[];return db[_0xad4e('0x54')][_0xad4e('0x46')]({'where':{'role':[_0xad4e('0x55'),_0xad4e('0x56'),_0xad4e('0x57')]},'attributes':['id',_0xad4e('0x58'),_0xad4e('0x2c'),'role',_0xad4e('0x59'),_0xad4e('0x5a'),_0xad4e('0x5b'),_0xad4e('0x5c'),_0xad4e('0x5d'),_0xad4e('0x5e')],'order':qs[_0xad4e('0x3a')](_0xad4e('0x5f')),'include':[{'model':db[_0xad4e('0x60')],'as':_0xad4e('0x61'),'attributes':['id',_0xad4e('0x2c'),_0xad4e('0x62')],'through':{'attributes':[]}}]})[_0xad4e('0x29')](function(_0x1d39e5){if(_0x1d39e5){var _0x10eddf=_0x1573f3[_0xad4e('0x57')][_0xad4e('0x63')]({'plain':!![]});if(!_0x10eddf)throw new Error(_0xad4e('0x64'));if(_0x10eddf[_0xad4e('0x65')]===_0xad4e('0x57')){return db[_0xad4e('0x66')]['find']({'where':{'name':_0xad4e('0x67'),'userProfileId':_0x10eddf['userProfileId']},'raw':!![]})[_0xad4e('0x29')](function(_0x5f26f7){if(_0x5f26f7){if(_0x5f26f7[_0xad4e('0x68')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5f26f7['id']},'raw':!![]})[_0xad4e('0x29')](function(_0x246b53){var _0x422663=[];if(_[_0xad4e('0x69')](_0x246b53)){_0x422663=_[_0xad4e('0x3e')](_0x1d39e5,function(_0x5d1b69){if(_0x5d1b69[_0xad4e('0x65')]!==_0xad4e('0x55')){return _0x5d1b69;}});return _0x422663;}else{for(var _0x111bd8=0x0;_0x111bd8<_0x1d39e5[_0xad4e('0x36')];_0x111bd8++){var _0x48b149=_0x1d39e5[_0x111bd8];if(_0x48b149['role']===_0xad4e('0x55')){var _0x4611f6=_[_0xad4e('0x4c')](_0x246b53,function(_0x61a2e4){return _0x61a2e4[_0xad4e('0x6a')]===_0x48b149['id'];});if(_0x4611f6)_0x422663[_0xad4e('0x6b')](_0x48b149);}else{_0x422663['push'](_0x48b149);}}return _0x422663;}});}else{return _0x1d39e5;}}else{var _0x2d6d82=_[_0xad4e('0x3e')](_0x1d39e5,function(_0x133a0c){if(_0x133a0c['role']!=='agent'){return _0x133a0c;}});return _0x2d6d82;}});}else{return _0x1d39e5;}}})[_0xad4e('0x29')](function(_0x536f48){var _0x2c1caf=[];if(_0x536f48){_0x5dfbb3=_0x536f48;for(var _0x12033a=0x0;_0x12033a<_0x536f48['length'];_0x12033a+=0x1){_0x5dfbb3[_0x12033a][_0xad4e('0x4e')]=[];_0x2c1caf[_0xad4e('0x6b')](db[_0xad4e('0x45')][_0xad4e('0x4c')]({'where':{'FromId':[_0x1573f3[_0xad4e('0x57')]['id'],_0x536f48[_0x12033a]['id']],'ToId':[_0x1573f3[_0xad4e('0x57')]['id'],_0x536f48[_0x12033a]['id']],'ChatGroupId':null},'attributes':['id',_0xad4e('0x6c'),_0xad4e('0x6d'),_0xad4e('0x6e'),_0xad4e('0x6f'),'body'],'order':qs[_0xad4e('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xad4e('0x29')](wrapUser(_0x536f48[_0x12033a])));}return BPromise[_0xad4e('0x70')](_0x2c1caf);}return[];})['then'](function(_0x4cf838){return{'rows':_0x4cf838,'count':_0x4cf838[_0xad4e('0x36')]};})[_0xad4e('0x29')](respondWithResult(_0x18c441,null))[_0xad4e('0x48')](handleError(_0x18c441,null));}; \ No newline at end of file +var _0x75f6=['role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','createdAt','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','get','lastMessageAt','format','lastMessage','getUsers','User','agent','user','fullname'];(function(_0x3726b3,_0x1d9f2e){var _0x3d040f=function(_0x1ba1d1){while(--_0x1ba1d1){_0x3726b3['push'](_0x3726b3['shift']());}};_0x3d040f(++_0x1d9f2e);}(_0x75f6,0xe8));var _0x675f=function(_0x1db399,_0x39fafe){_0x1db399=_0x1db399-0x0;var _0x543a57=_0x75f6[_0x1db399];return _0x543a57;};'use strict';var pdf=require(_0x675f('0x0'));var emlformat=require(_0x675f('0x1'));var rimraf=require(_0x675f('0x2'));var zipdir=require(_0x675f('0x3'));var jsonpatch=require(_0x675f('0x4'));var rp=require(_0x675f('0x5'));var moment=require('moment');var BPromise=require(_0x675f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x675f('0x7'));var sox=require(_0x675f('0x8'));var csv=require(_0x675f('0x9'));var ejs=require(_0x675f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x675f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x675f('0xc'));var toCsv=require(_0x675f('0x9'));var querystring=require(_0x675f('0xd'));var Papa=require(_0x675f('0xe'));var Redis=require(_0x675f('0xf'));var authService=require(_0x675f('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x675f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x675f('0x12'));var config=require(_0x675f('0x13'));var db=require(_0x675f('0x14'))['db'];config[_0x675f('0x15')]=_[_0x675f('0x16')](config[_0x675f('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x675f('0x17'))(new Redis(config[_0x675f('0x15')]));require(_0x675f('0x18'))[_0x675f('0x19')](socket);function respondWithStatusCode(_0x23fa9f,_0x422401){_0x422401=_0x422401||0xcc;return function(_0x38c46b){if(_0x38c46b){return _0x23fa9f[_0x675f('0x1a')](_0x422401);}return _0x23fa9f[_0x675f('0x1b')](_0x422401)[_0x675f('0x1c')]();};}function respondWithResult(_0x58dd1e,_0x1ac567){_0x1ac567=_0x1ac567||0xc8;return function(_0x3140dd){if(_0x3140dd){return _0x58dd1e[_0x675f('0x1b')](_0x1ac567)['json'](_0x3140dd);}};}function respondWithFilteredResult(_0x25d334,_0x1b2a13){return function(_0x5ee11d){if(_0x5ee11d){var _0x404e10=_0x5ee11d[_0x675f('0x1d')],_0x41a1ad=_0x1b2a13['offset'],_0x4b4d8a=_0x1b2a13[_0x675f('0x1e')]+_0x1b2a13[_0x675f('0x1f')],_0x2210f2;if(_0x4b4d8a>=_0x404e10){_0x4b4d8a=_0x404e10;_0x2210f2=0xc8;}else{_0x2210f2=0xce;}_0x25d334['status'](_0x2210f2);return _0x25d334[_0x675f('0x20')]('Content-Range',_0x41a1ad+'-'+_0x4b4d8a+'/'+_0x404e10)['json'](_0x5ee11d);}return null;};}function patchUpdates(_0x2c6597){return function(_0x3cfe9b){try{jsonpatch[_0x675f('0x21')](_0x3cfe9b,_0x2c6597,!![]);}catch(_0x458921){return BPromise[_0x675f('0x22')](_0x458921);}return _0x3cfe9b['save']();};}function saveUpdates(_0x2dcbb2,_0x420579){return function(_0x2e13ab){if(_0x2e13ab){return _0x2e13ab[_0x675f('0x23')](_0x2dcbb2)[_0x675f('0x24')](function(_0x460c7c){return _0x460c7c;});}return null;};}function removeEntity(_0x53bf2f,_0x3b2a4d){return function(_0x1d2566){if(_0x1d2566){return _0x1d2566['destroy']()['then'](function(){_0x53bf2f['status'](0xcc)[_0x675f('0x1c')]();});}};}function handleEntityNotFound(_0x5616c8,_0x2b1fd9){return function(_0x32aa1c){if(!_0x32aa1c){_0x5616c8[_0x675f('0x1a')](0x194);}return _0x32aa1c;};}function handleError(_0x5c656d,_0x1fa3a0){_0x1fa3a0=_0x1fa3a0||0x1f4;return function(_0x4bd691){logger[_0x675f('0x25')](_0x4bd691[_0x675f('0x26')]);if(_0x4bd691[_0x675f('0x27')]){delete _0x4bd691[_0x675f('0x27')];}_0x5c656d[_0x675f('0x1b')](_0x1fa3a0)[_0x675f('0x28')](_0x4bd691);};}exports[_0x675f('0x29')]=function(_0x52bac5,_0x39aaa){var _0x59a131={},_0x4625e1={},_0x582326={'count':0x0,'rows':[]};var _0x48428e=db[_0x675f('0x2a')][_0x675f('0x2b')];_0x4625e1[_0x675f('0x2c')]=_['keys'](_0x48428e);_0x4625e1[_0x675f('0x2d')]=_[_0x675f('0x2e')](_0x52bac5[_0x675f('0x2d')]);_0x4625e1['filters']=_['intersection'](_0x4625e1['model'],_0x4625e1['query']);_0x59a131[_0x675f('0x2f')]=_[_0x675f('0x30')](_0x4625e1['model'],qs[_0x675f('0x31')](_0x52bac5['query'][_0x675f('0x31')]));_0x59a131[_0x675f('0x2f')]=_0x59a131[_0x675f('0x2f')][_0x675f('0x32')]?_0x59a131[_0x675f('0x2f')]:_0x4625e1['model'];if(!_0x52bac5[_0x675f('0x2d')][_0x675f('0x33')]('nolimit')){_0x59a131[_0x675f('0x1f')]=qs[_0x675f('0x1f')](_0x52bac5['query'][_0x675f('0x1f')]);_0x59a131[_0x675f('0x1e')]=qs[_0x675f('0x1e')](_0x52bac5[_0x675f('0x2d')][_0x675f('0x1e')]);}_0x59a131['order']=qs[_0x675f('0x34')](_0x52bac5[_0x675f('0x2d')][_0x675f('0x34')]);_0x59a131[_0x675f('0x35')]=qs['filters'](_[_0x675f('0x36')](_0x52bac5[_0x675f('0x2d')],_0x4625e1[_0x675f('0x37')]));if(_0x52bac5['query'][_0x675f('0x38')]){_0x59a131[_0x675f('0x35')]=_['merge'](_0x59a131[_0x675f('0x35')],{'$or':_[_0x675f('0x39')](_0x48428e,function(_0x39c551){if(_0x39c551[_0x675f('0x3a')]['key']!==_0x675f('0x3b')){var _0x37266c={};_0x37266c[_0x39c551[_0x675f('0x3c')]]={'$like':'%'+_0x52bac5[_0x675f('0x2d')][_0x675f('0x38')]+'%'};return _0x37266c;}})});}_0x59a131=_['merge']({},_0x59a131,_0x52bac5[_0x675f('0x3d')]);var _0x18bb4a={'where':_0x59a131[_0x675f('0x35')]};return db[_0x675f('0x2a')]['count'](_0x18bb4a)['then'](function(_0x3da5e7){_0x582326[_0x675f('0x1d')]=_0x3da5e7;if(_0x52bac5[_0x675f('0x2d')][_0x675f('0x3e')]){_0x59a131[_0x675f('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x675f('0x40')](_0x59a131);})[_0x675f('0x24')](function(_0x4f4810){_0x582326[_0x675f('0x41')]=_0x4f4810;return _0x582326;})['then'](respondWithFilteredResult(_0x39aaa,_0x59a131))[_0x675f('0x42')](handleError(_0x39aaa,null));};exports[_0x675f('0x43')]=function(_0x3f3324,_0x599f51){var _0x3bb91e={'raw':!![],'where':{'id':_0x3f3324[_0x675f('0x44')]['id']}},_0x2136b6={};_0x2136b6[_0x675f('0x2c')]=_[_0x675f('0x2e')](db[_0x675f('0x2a')][_0x675f('0x2b')]);_0x2136b6[_0x675f('0x2d')]=_[_0x675f('0x2e')](_0x3f3324[_0x675f('0x2d')]);_0x2136b6[_0x675f('0x37')]=_[_0x675f('0x30')](_0x2136b6[_0x675f('0x2c')],_0x2136b6[_0x675f('0x2d')]);_0x3bb91e['attributes']=_[_0x675f('0x30')](_0x2136b6['model'],qs[_0x675f('0x31')](_0x3f3324[_0x675f('0x2d')]['fields']));_0x3bb91e[_0x675f('0x2f')]=_0x3bb91e['attributes'][_0x675f('0x32')]?_0x3bb91e[_0x675f('0x2f')]:_0x2136b6['model'];if(_0x3f3324['query']['includeAll']){_0x3bb91e['include']=[{'all':!![]}];}_0x3bb91e=_['merge']({},_0x3bb91e,_0x3f3324[_0x675f('0x3d')]);return db[_0x675f('0x2a')][_0x675f('0x45')](_0x3bb91e)[_0x675f('0x24')](handleEntityNotFound(_0x599f51,null))[_0x675f('0x24')](respondWithResult(_0x599f51,null))[_0x675f('0x42')](handleError(_0x599f51,null));};exports['create']=function(_0x1270fe,_0x1f6c18){return db[_0x675f('0x2a')][_0x675f('0x46')](_0x1270fe[_0x675f('0x47')],{})[_0x675f('0x24')](respondWithResult(_0x1f6c18,0xc9))[_0x675f('0x42')](handleError(_0x1f6c18,null));};exports[_0x675f('0x23')]=function(_0x9d121,_0x12066a){if(_0x9d121[_0x675f('0x47')]['id']){delete _0x9d121[_0x675f('0x47')]['id'];}return db[_0x675f('0x2a')][_0x675f('0x45')]({'where':{'id':_0x9d121[_0x675f('0x44')]['id']}})[_0x675f('0x24')](handleEntityNotFound(_0x12066a,null))[_0x675f('0x24')](saveUpdates(_0x9d121[_0x675f('0x47')],null))[_0x675f('0x24')](respondWithResult(_0x12066a,null))[_0x675f('0x42')](handleError(_0x12066a,null));};exports[_0x675f('0x48')]=function(_0x3cb936,_0x63ff42){return db['ChatInternalMessage'][_0x675f('0x45')]({'where':{'id':_0x3cb936['params']['id']}})['then'](handleEntityNotFound(_0x63ff42,null))[_0x675f('0x24')](removeEntity(_0x63ff42,null))[_0x675f('0x42')](handleError(_0x63ff42,null));};exports['describe']=function(_0x73b150,_0xb77dc2){return db[_0x675f('0x2a')][_0x675f('0x49')]()['then'](respondWithResult(_0xb77dc2,null))[_0x675f('0x42')](handleError(_0xb77dc2,null));};function wrapUser(_0x39c541){return function(_0x370e0b){var _0x475eb4=_0x39c541[_0x675f('0x4a')]({'plain':!![]});_0x475eb4['messages']=[];if(_0x370e0b){_0x475eb4[_0x675f('0x4b')]=_0x370e0b['createdAt'];_0x475eb4['lastMessage']=_0x370e0b;}else{_0x475eb4['lastMessageAt']=moment(0x0)[_0x675f('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x475eb4[_0x675f('0x4d')]={};}return _0x475eb4;};}exports[_0x675f('0x4e')]=function(_0x44e496,_0x13782e,_0x216124){var _0x6db852=[];return db[_0x675f('0x4f')][_0x675f('0x40')]({'where':{'role':[_0x675f('0x50'),'admin',_0x675f('0x51')]},'attributes':['id',_0x675f('0x52'),_0x675f('0x27'),_0x675f('0x53'),_0x675f('0x54'),_0x675f('0x55'),_0x675f('0x56'),_0x675f('0x57'),'allowmessenger',_0x675f('0x58')],'order':qs[_0x675f('0x34')]('-online'),'include':[{'model':db[_0x675f('0x59')],'as':'VoiceQueues','attributes':['id',_0x675f('0x27'),_0x675f('0x3a')],'through':{'attributes':[]}}]})[_0x675f('0x24')](function(_0x113f76){if(_0x113f76){var _0x3beab5=_0x44e496[_0x675f('0x51')]['get']({'plain':!![]});if(!_0x3beab5)throw new Error(_0x675f('0x5a'));if(_0x3beab5[_0x675f('0x53')]===_0x675f('0x51')){return db[_0x675f('0x5b')][_0x675f('0x45')]({'where':{'name':_0x675f('0x5c'),'userProfileId':_0x3beab5['userProfileId']},'raw':!![]})[_0x675f('0x24')](function(_0x2c91c3){if(_0x2c91c3){if(_0x2c91c3[_0x675f('0x5d')]===0x0){return db[_0x675f('0x5e')][_0x675f('0x40')]({'where':{'sectionId':_0x2c91c3['id']},'raw':!![]})[_0x675f('0x24')](function(_0xd097fc){var _0x2c3d8d=[];if(_[_0x675f('0x5f')](_0xd097fc)){_0x2c3d8d=_[_0x675f('0x38')](_0x113f76,function(_0x22f52a){if(_0x22f52a[_0x675f('0x53')]!==_0x675f('0x50')){return _0x22f52a;}});return _0x2c3d8d;}else{for(var _0x22b08d=0x0;_0x22b08d<_0x113f76[_0x675f('0x32')];_0x22b08d++){var _0x39341d=_0x113f76[_0x22b08d];if(_0x39341d[_0x675f('0x53')]===_0x675f('0x50')){var _0x262d30=_['find'](_0xd097fc,function(_0x229e31){return _0x229e31[_0x675f('0x60')]===_0x39341d['id'];});if(_0x262d30)_0x2c3d8d[_0x675f('0x61')](_0x39341d);}else{_0x2c3d8d[_0x675f('0x61')](_0x39341d);}}return _0x2c3d8d;}});}else{return _0x113f76;}}else{var _0x247617=_['filter'](_0x113f76,function(_0x22cffe){if(_0x22cffe[_0x675f('0x53')]!=='agent'){return _0x22cffe;}});return _0x247617;}});}else{return _0x113f76;}}})['then'](function(_0x36f03c){var _0x1cc0b7=[];if(_0x36f03c){_0x6db852=_0x36f03c;for(var _0x31767b=0x0;_0x31767b<_0x36f03c[_0x675f('0x32')];_0x31767b+=0x1){_0x6db852[_0x31767b][_0x675f('0x62')]=[];_0x1cc0b7[_0x675f('0x61')](db[_0x675f('0x2a')]['find']({'where':{'FromId':[_0x44e496[_0x675f('0x51')]['id'],_0x36f03c[_0x31767b]['id']],'ToId':[_0x44e496[_0x675f('0x51')]['id'],_0x36f03c[_0x31767b]['id']],'ChatGroupId':null},'attributes':['id',_0x675f('0x63'),_0x675f('0x64'),_0x675f('0x65'),_0x675f('0x66'),_0x675f('0x47')],'order':qs['sort'](_0x675f('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x36f03c[_0x31767b])));}return BPromise[_0x675f('0x68')](_0x1cc0b7);}return[];})[_0x675f('0x24')](function(_0xf5a372){return{'rows':_0xf5a372,'count':_0xf5a372[_0x675f('0x32')]};})[_0x675f('0x24')](respondWithResult(_0x13782e,null))[_0x675f('0x42')](handleError(_0x13782e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 73ad591..0d60f2d 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 _0x780f=['save','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x527c54,_0xaa5895){var _0x1987fa=function(_0x1f312b){while(--_0x1f312b){_0x527c54['push'](_0x527c54['shift']());}};_0x1987fa(++_0xaa5895);}(_0x780f,0x6c));var _0xf780=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x780f[_0x1d80be];return _0xf9a4f3;};'use strict';var EventEmitter=require(_0xf780('0x0'));var ChatInternalMessage=require(_0xf780('0x1'))['db'][_0xf780('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf780('0x3')](0x0);var events={'afterCreate':_0xf780('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ab244){return function(_0x26ed87,_0x1a22c0,_0x100bb2){ChatInternalMessageEvents['emit'](_0x4ab244+':'+_0x26ed87['id'],_0x26ed87);ChatInternalMessageEvents[_0xf780('0x5')](_0x4ab244,_0x26ed87);_0x100bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xf780('0x6')](e,emitEvent(event));}}module[_0xf780('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x9434=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4b4018,_0xe3965){var _0x3e1304=function(_0x38cf2f){while(--_0x38cf2f){_0x4b4018['push'](_0x4b4018['shift']());}};_0x3e1304(++_0xe3965);}(_0x9434,0x168));var _0x4943=function(_0x569ede,_0x18c670){_0x569ede=_0x569ede-0x0;var _0x11f2a2=_0x9434[_0x569ede];return _0x11f2a2;};'use strict';var EventEmitter=require(_0x4943('0x0'));var ChatInternalMessage=require(_0x4943('0x1'))['db'][_0x4943('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4943('0x3')](0x0);var events={'afterCreate':_0x4943('0x4'),'afterUpdate':_0x4943('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159f9){return function(_0xda4cba,_0x5117c7,_0x2ce3d9){ChatInternalMessageEvents[_0x4943('0x6')](_0x1159f9+':'+_0xda4cba['id'],_0xda4cba);ChatInternalMessageEvents['emit'](_0x1159f9,_0xda4cba);_0x2ce3d9(null);};}for(var e in events){if(events[_0x4943('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 38307ef..6cc4a24 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 _0x89ce=['chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x44f81b,_0x53a13b){var _0x35cd03=function(_0x2a129e){while(--_0x2a129e){_0x44f81b['push'](_0x44f81b['shift']());}};_0x35cd03(++_0x53a13b);}(_0x89ce,0x1af));var _0xe89c=function(_0x5812e4,_0x269ed8){_0x5812e4=_0x5812e4-0x0;var _0x48714d=_0x89ce[_0x5812e4];return _0x48714d;};'use strict';var _=require(_0xe89c('0x0'));var util=require(_0xe89c('0x1'));var logger=require(_0xe89c('0x2'))(_0xe89c('0x3'));var moment=require(_0xe89c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe89c('0x5'));var fs=require('fs');var path=require(_0xe89c('0x6'));var rimraf=require(_0xe89c('0x7'));var config=require(_0xe89c('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xe89c('0x9')]=function(_0x52adc1,_0x237787){return _0x52adc1[_0xe89c('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xe89c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe89c('0xc')});}; \ No newline at end of file +var _0xb96f=['moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0xd97a89,_0x3b2fdd){var _0x2968c2=function(_0x1752dc){while(--_0x1752dc){_0xd97a89['push'](_0xd97a89['shift']());}};_0x2968c2(++_0x3b2fdd);}(_0xb96f,0x97));var _0xfb96=function(_0x4f1a15,_0x1fc6b9){_0x4f1a15=_0x4f1a15-0x0;var _0x51ec1a=_0xb96f[_0x4f1a15];return _0x51ec1a;};'use strict';var _=require(_0xfb96('0x0'));var util=require('util');var logger=require(_0xfb96('0x1'))(_0xfb96('0x2'));var moment=require(_0xfb96('0x3'));var BPromise=require(_0xfb96('0x4'));var rp=require(_0xfb96('0x5'));var fs=require('fs');var path=require(_0xfb96('0x6'));var rimraf=require(_0xfb96('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb96('0x8'));module[_0xfb96('0x9')]=function(_0x34ad9e,_0x18c87a){return _0x34ad9e[_0xfb96('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xfb96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb96('0xc'),'collate':_0xfb96('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 5f82bb3..9183c55 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 _0x11d2=['../../config/logger','rpc','client','http','redis','defaults','localhost','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4fb473,_0x2e94b2){var _0xbcac62=function(_0x4a1efe){while(--_0x4a1efe){_0x4fb473['push'](_0x4fb473['shift']());}};_0xbcac62(++_0x2e94b2);}(_0x11d2,0x1c4));var _0x211d=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x11d2[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var moment=require(_0x211d('0x2'));var BPromise=require(_0x211d('0x3'));var rs=require(_0x211d('0x4'));var fs=require('fs');var Redis=require(_0x211d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x211d('0x6'));var logger=require(_0x211d('0x7'))(_0x211d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x211d('0x9')][_0x211d('0xa')]({'port':0x232a});config[_0x211d('0xb')]=_[_0x211d('0xc')](config[_0x211d('0xb')],{'host':_0x211d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x211d('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x428218,_0x296137,_0x11a8e3){return new BPromise(function(_0x16ced8,_0x4ad503){return client[_0x211d('0xe')](_0x428218,_0x11a8e3)[_0x211d('0xf')](function(_0x2906db){logger[_0x211d('0x10')](_0x211d('0x11'),_0x296137,_0x211d('0x12'));logger[_0x211d('0x13')](_0x211d('0x14'),_0x296137,_0x211d('0x12'),JSON[_0x211d('0x15')](_0x2906db));if(_0x2906db['error']){if(_0x2906db[_0x211d('0x16')][_0x211d('0x17')]===0x1f4){logger[_0x211d('0x16')](_0x211d('0x11'),_0x296137,_0x2906db[_0x211d('0x16')][_0x211d('0x18')]);return _0x4ad503(_0x2906db['error'][_0x211d('0x18')]);}logger[_0x211d('0x16')](_0x211d('0x11'),_0x296137,_0x2906db['error'][_0x211d('0x18')]);return _0x16ced8(_0x2906db[_0x211d('0x16')][_0x211d('0x18')]);}else{logger[_0x211d('0x10')](_0x211d('0x11'),_0x296137,_0x211d('0x12'));_0x16ced8(_0x2906db[_0x211d('0x19')]['message']);}})[_0x211d('0x1a')](function(_0x40f1ef){logger[_0x211d('0x16')](_0x211d('0x11'),_0x296137,_0x40f1ef);_0x4ad503(_0x40f1ef);});});} \ No newline at end of file +var _0x8b5b=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1be55f,_0x387868){var _0x4d915e=function(_0x2bf0e5){while(--_0x2bf0e5){_0x1be55f['push'](_0x1be55f['shift']());}};_0x4d915e(++_0x387868);}(_0x8b5b,0x137));var _0xb8b5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8b5b[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb8b5('0x0'));var BPromise=require(_0xb8b5('0x1'));var rs=require(_0xb8b5('0x2'));var fs=require('fs');var Redis=require(_0xb8b5('0x3'));var db=require(_0xb8b5('0x4'))['db'];var utils=require(_0xb8b5('0x5'));var logger=require(_0xb8b5('0x6'))(_0xb8b5('0x7'));var config=require(_0xb8b5('0x8'));var jayson=require(_0xb8b5('0x9'));var client=jayson[_0xb8b5('0xa')][_0xb8b5('0xb')]({'port':0x232a});config['redis']=_[_0xb8b5('0xc')](config[_0xb8b5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8b5('0xe'))(new Redis(config['redis']));require(_0xb8b5('0xf'))[_0xb8b5('0x10')](socket);function respondWithRpcPromise(_0x2e70b5,_0x39efb0,_0xe5de0a){return new BPromise(function(_0x506664,_0xd0d982){return client['request'](_0x2e70b5,_0xe5de0a)[_0xb8b5('0x11')](function(_0x1d9b1e){logger[_0xb8b5('0x12')](_0xb8b5('0x13'),_0x39efb0,_0xb8b5('0x14'));logger[_0xb8b5('0x15')](_0xb8b5('0x16'),_0x39efb0,_0xb8b5('0x14'),JSON[_0xb8b5('0x17')](_0x1d9b1e));if(_0x1d9b1e[_0xb8b5('0x18')]){if(_0x1d9b1e[_0xb8b5('0x18')][_0xb8b5('0x19')]===0x1f4){logger[_0xb8b5('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x39efb0,_0x1d9b1e[_0xb8b5('0x18')][_0xb8b5('0x1a')]);return _0xd0d982(_0x1d9b1e['error'][_0xb8b5('0x1a')]);}logger[_0xb8b5('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x39efb0,_0x1d9b1e[_0xb8b5('0x18')][_0xb8b5('0x1a')]);return _0x506664(_0x1d9b1e[_0xb8b5('0x18')][_0xb8b5('0x1a')]);}else{logger[_0xb8b5('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x39efb0,_0xb8b5('0x14'));_0x506664(_0x1d9b1e[_0xb8b5('0x1b')][_0xb8b5('0x1a')]);}})[_0xb8b5('0x1c')](function(_0x14aa52){logger[_0xb8b5('0x18')](_0xb8b5('0x13'),_0x39efb0,_0x14aa52);_0xd0d982(_0x14aa52);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 35b5e1c..dbef6f6 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 _0x790d=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x790d,0xb7));var _0xd790=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0x790d[_0x59eacf];return _0x5d74f2;};'use strict';var ChatInternalMessageEvents=require(_0xd790('0x0'));var events=[_0xd790('0x1'),_0xd790('0x2'),_0xd790('0x3')];function createListener(_0x3c973b,_0x46599c){return function(_0x79bd8f){_0x46599c[_0xd790('0x4')](_0x3c973b,_0x79bd8f);};}function removeListener(_0x400268,_0x1066c7){return function(){ChatInternalMessageEvents[_0xd790('0x5')](_0x400268,_0x1066c7);};}exports['register']=function(_0x3fa213){for(var _0x9f7a9c=0x0,_0x521c1c=events['length'];_0x9f7a9c<_0x521c1c;_0x9f7a9c++){var _0x2e1a61=events[_0x9f7a9c];var _0x583334=createListener(_0xd790('0x6')+_0x2e1a61,_0x3fa213);ChatInternalMessageEvents['on'](_0x2e1a61,_0x583334);}}; \ No newline at end of file +var _0xb0dd=['length','chatInternalMessage:','save','remove','update','emit','removeListener'];(function(_0x33810e,_0xe36a85){var _0x3bd8df=function(_0x1eb2b1){while(--_0x1eb2b1){_0x33810e['push'](_0x33810e['shift']());}};_0x3bd8df(++_0xe36a85);}(_0xb0dd,0x1ad));var _0xdb0d=function(_0x4fff36,_0xc62d1a){_0x4fff36=_0x4fff36-0x0;var _0xcc84b7=_0xb0dd[_0x4fff36];return _0xcc84b7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xdb0d('0x0'),_0xdb0d('0x1'),_0xdb0d('0x2')];function createListener(_0xef0de4,_0x1cc62e){return function(_0x4c8bdb){_0x1cc62e[_0xdb0d('0x3')](_0xef0de4,_0x4c8bdb);};}function removeListener(_0x36e2cf,_0x1e02ca){return function(){ChatInternalMessageEvents[_0xdb0d('0x4')](_0x36e2cf,_0x1e02ca);};}exports['register']=function(_0x589ab5){for(var _0x28f1a3=0x0,_0x744b8c=events[_0xdb0d('0x5')];_0x28f1a3<_0x744b8c;_0x28f1a3++){var _0x1e7d8d=events[_0x28f1a3];var _0x5ead79=createListener(_0xdb0d('0x6')+_0x1e7d8d,_0x589ab5);ChatInternalMessageEvents['on'](_0x1e7d8d,_0x5ead79);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b772a50..3767a82 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 _0xb3f9=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','express','../../components/auth/service'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x4e9343,_0x102660){_0x4e9343=_0x4e9343-0x0;var _0x12a1a1=_0xb3f9[_0x4e9343];return _0x12a1a1;};'use strict';var multer=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b3f('0x2'));var router=express['Router']();var auth=require(_0x9b3f('0x3'));var interaction=require(_0x9b3f('0x4'));var config=require(_0x9b3f('0x5'));var controller=require(_0x9b3f('0x6'));router[_0x9b3f('0x7')]('/',auth[_0x9b3f('0x8')](),controller['index']);router['get'](_0x9b3f('0x9'),auth[_0x9b3f('0x8')](),controller['describe']);router[_0x9b3f('0x7')]('/users',auth['isAuthenticated'](),controller['getUsers']);router[_0x9b3f('0x7')]('/:id',auth[_0x9b3f('0x8')](),controller[_0x9b3f('0xa')]);router[_0x9b3f('0xb')]('/',auth[_0x9b3f('0x8')](),controller[_0x9b3f('0xc')]);router['put'](_0x9b3f('0xd'),controller[_0x9b3f('0xe')]);router[_0x9b3f('0xf')](_0x9b3f('0xd'),auth[_0x9b3f('0x8')](),controller[_0x9b3f('0x10')]);module[_0x9b3f('0x11')]=router; \ No newline at end of file +var _0xf8af=['get','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x59812d,_0xa2b868){var _0xfd4b45=function(_0x779ed3){while(--_0x779ed3){_0x59812d['push'](_0x59812d['shift']());}};_0xfd4b45(++_0xa2b868);}(_0xf8af,0x8b));var _0xff8a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf8af[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xff8a('0x0'));var util=require('util');var path=require(_0xff8a('0x1'));var timeout=require(_0xff8a('0x2'));var express=require(_0xff8a('0x3'));var router=express[_0xff8a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xff8a('0x5'));var config=require(_0xff8a('0x6'));var controller=require(_0xff8a('0x7'));router[_0xff8a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff8a('0x8')]('/describe',auth[_0xff8a('0x9')](),controller[_0xff8a('0xa')]);router[_0xff8a('0x8')](_0xff8a('0xb'),auth[_0xff8a('0x9')](),controller[_0xff8a('0xc')]);router[_0xff8a('0x8')](_0xff8a('0xd'),auth[_0xff8a('0x9')](),controller[_0xff8a('0xe')]);router[_0xff8a('0xf')]('/',auth['isAuthenticated'](),controller[_0xff8a('0x10')]);router[_0xff8a('0x11')](_0xff8a('0xd'),controller['update']);router[_0xff8a('0x12')](_0xff8a('0xd'),auth[_0xff8a('0x9')](),controller[_0xff8a('0x13')]);module[_0xff8a('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 1556997..070f6ba 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 _0x141c=['out','DATE','sequelize','BOOLEAN','ENUM'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0x141c,0x10b));var _0xc141=function(_0x38b5ba,_0x4cb2ac){_0x38b5ba=_0x38b5ba-0x0;var _0x1a3829=_0x141c[_0x38b5ba];return _0x1a3829;};'use strict';var Sequelize=require(_0xc141('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc141('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc141('0x2')]('in','out'),'defaultValue':_0xc141('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc141('0x4')]}}; \ No newline at end of file +var _0x7445=['out','exports','BOOLEAN','ENUM'];(function(_0x2f75e1,_0x555c65){var _0x5b1802=function(_0x1858ff){while(--_0x1858ff){_0x2f75e1['push'](_0x2f75e1['shift']());}};_0x5b1802(++_0x555c65);}(_0x7445,0x181));var _0x5744=function(_0x209f9c,_0x4ea385){_0x209f9c=_0x209f9c-0x0;var _0x13c1ef=_0x7445[_0x209f9c];return _0x13c1ef;};'use strict';var Sequelize=require('sequelize');module[_0x5744('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x5744('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5744('0x2')]('in',_0x5744('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0768368..b262a13 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 _0x3212=['SIP/%s','event','EventManager','acceptmessage','parse','formData','agent','info','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','count','offset','status','set','reject','save','update','destroy','stack','name','send','index','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','where','filter','merge','map','key','VIRTUAL','field','ChatMessage','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','chat-interactions','chat','read','readAt','format','UserId','user','Contact','get','ChatInteraction','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','role','acceptMessage','interface'];(function(_0x6f0460,_0x2526f4){var _0x6dcdb6=function(_0x5d5244){while(--_0x5d5244){_0x6f0460['push'](_0x6f0460['shift']());}};_0x6dcdb6(++_0x2526f4);}(_0x3212,0x1d1));var _0x2321=function(_0x8a84a1,_0x1e0920){_0x8a84a1=_0x8a84a1-0x0;var _0x4be3d6=_0x3212[_0x8a84a1];return _0x4be3d6;};'use strict';var pdf=require(_0x2321('0x0'));var emlformat=require(_0x2321('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2321('0x2'));var jsonpatch=require(_0x2321('0x3'));var rp=require(_0x2321('0x4'));var moment=require('moment');var BPromise=require(_0x2321('0x5'));var Mustache=require(_0x2321('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2321('0x7'));var csv=require(_0x2321('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2321('0x9'));var squel=require(_0x2321('0xa'));var crypto=require(_0x2321('0xb'));var jsforce=require(_0x2321('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2321('0x8'));var querystring=require(_0x2321('0xd'));var Papa=require(_0x2321('0xe'));var Redis=require(_0x2321('0xf'));var authService=require(_0x2321('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2321('0x11'))(_0x2321('0x12'));var utils=require(_0x2321('0x13'));var config=require(_0x2321('0x14'));var db=require('../../mysqldb')['db'];config[_0x2321('0x15')]=_[_0x2321('0x16')](config['redis'],{'host':_0x2321('0x17'),'port':0x18eb});var socket=require(_0x2321('0x18'))(new Redis(config[_0x2321('0x15')]));require(_0x2321('0x19'))[_0x2321('0x1a')](socket);var jayson=require(_0x2321('0x1b'));var client=jayson[_0x2321('0x1c')][_0x2321('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x2321('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x353b7c,_0x2d48ae,_0x436d7f){if(_0x436d7f){var _0x217f8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x217f8b['test'](_0x2d48ae)){return _0x353b7c;}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 _0x353b7c;}}function respondWithRpcPromise(_0x25253e,_0x5426d5,_0x157578,_0x9a0281){return new BPromise(function(_0x23bc82,_0x32f863){var _0x552b6f=_0x9a0281||client;return _0x552b6f[_0x2321('0x1e')](_0x25253e,_0x157578)[_0x2321('0x1f')](function(_0x5b79d3){logger['info'](_0x2321('0x20'),_0x5426d5,_0x2321('0x21'));logger['debug'](_0x2321('0x22'),_0x5426d5,_0x2321('0x21'),JSON[_0x2321('0x23')](_0x5b79d3));if(_0x5b79d3[_0x2321('0x24')]){if(_0x5b79d3[_0x2321('0x24')][_0x2321('0x25')]===0x1f4){logger[_0x2321('0x24')](_0x2321('0x20'),_0x5426d5,_0x5b79d3[_0x2321('0x24')]['message']);return _0x32f863(_0x5b79d3[_0x2321('0x24')][_0x2321('0x26')]);}logger[_0x2321('0x24')](_0x2321('0x20'),_0x5426d5,_0x5b79d3[_0x2321('0x24')][_0x2321('0x26')]);return _0x23bc82(_0x5b79d3[_0x2321('0x24')][_0x2321('0x26')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5426d5,_0x2321('0x21'));_0x23bc82(_0x5b79d3['result']['message']);}})['catch'](function(_0x1b6e6f){logger[_0x2321('0x24')](_0x2321('0x20'),_0x5426d5,_0x1b6e6f);_0x32f863(_0x1b6e6f);});});}function respondWithStatusCode(_0x3dd2b0,_0x2a7dbc){_0x2a7dbc=_0x2a7dbc||0xcc;return function(_0x4ed52f){if(_0x4ed52f){return _0x3dd2b0[_0x2321('0x27')](_0x2a7dbc);}return _0x3dd2b0['status'](_0x2a7dbc)[_0x2321('0x28')]();};}function respondWithResult(_0x1ed7cb,_0x20c69c){_0x20c69c=_0x20c69c||0xc8;return function(_0x6c7624){if(_0x6c7624){return _0x1ed7cb['status'](_0x20c69c)[_0x2321('0x29')](_0x6c7624);}};}function respondWithFilteredResult(_0x4e3022,_0x434755){return function(_0x4d74a3){if(_0x4d74a3){var _0x42e294=_0x4d74a3[_0x2321('0x2a')],_0xe47ebf=_0x434755[_0x2321('0x2b')],_0xb7278=_0x434755['offset']+_0x434755['limit'],_0x4b8172;if(_0xb7278>=_0x42e294){_0xb7278=_0x42e294;_0x4b8172=0xc8;}else{_0x4b8172=0xce;}_0x4e3022[_0x2321('0x2c')](_0x4b8172);return _0x4e3022[_0x2321('0x2d')]('Content-Range',_0xe47ebf+'-'+_0xb7278+'/'+_0x42e294)[_0x2321('0x29')](_0x4d74a3);}return null;};}function patchUpdates(_0xd224dd){return function(_0x50ce87){try{jsonpatch['apply'](_0x50ce87,_0xd224dd,!![]);}catch(_0x3654a0){return BPromise[_0x2321('0x2e')](_0x3654a0);}return _0x50ce87[_0x2321('0x2f')]();};}function saveUpdates(_0x2e4fc8,_0x46817f){return function(_0x4cc275){if(_0x4cc275){return _0x4cc275[_0x2321('0x30')](_0x2e4fc8)['then'](function(_0x40140a){return _0x40140a;});}return null;};}function removeEntity(_0x2b429b,_0x40a772){return function(_0x87f17d){if(_0x87f17d){return _0x87f17d[_0x2321('0x31')]()[_0x2321('0x1f')](function(){_0x2b429b['status'](0xcc)[_0x2321('0x28')]();});}};}function handleEntityNotFound(_0x2d7009,_0x1a1b67){return function(_0x2311e6){if(!_0x2311e6){_0x2d7009[_0x2321('0x27')](0x194);}return _0x2311e6;};}function handleError(_0x3fff14,_0x4303c3){_0x4303c3=_0x4303c3||0x1f4;return function(_0x50607e){logger[_0x2321('0x24')](_0x50607e[_0x2321('0x32')]);if(_0x50607e['name']){delete _0x50607e[_0x2321('0x33')];}_0x3fff14[_0x2321('0x2c')](_0x4303c3)[_0x2321('0x34')](_0x50607e);};}exports[_0x2321('0x35')]=function(_0x8ad36c,_0x49562e){var _0x2c1f3d={},_0x18e153={},_0x368ece={'count':0x0,'rows':[]};var _0xf7e766=db['ChatMessage']['rawAttributes'];_0x18e153['model']=_[_0x2321('0x36')](_0xf7e766);_0x18e153[_0x2321('0x37')]=_[_0x2321('0x36')](_0x8ad36c[_0x2321('0x37')]);_0x18e153[_0x2321('0x38')]=_['intersection'](_0x18e153['model'],_0x18e153[_0x2321('0x37')]);_0x2c1f3d[_0x2321('0x39')]=_[_0x2321('0x3a')](_0x18e153[_0x2321('0x3b')],qs[_0x2321('0x3c')](_0x8ad36c['query']['fields']));_0x2c1f3d[_0x2321('0x39')]=_0x2c1f3d[_0x2321('0x39')][_0x2321('0x3d')]?_0x2c1f3d[_0x2321('0x39')]:_0x18e153[_0x2321('0x3b')];if(!_0x8ad36c['query'][_0x2321('0x3e')](_0x2321('0x3f'))){_0x2c1f3d[_0x2321('0x40')]=qs[_0x2321('0x40')](_0x8ad36c['query'][_0x2321('0x40')]);_0x2c1f3d[_0x2321('0x2b')]=qs[_0x2321('0x2b')](_0x8ad36c[_0x2321('0x37')]['offset']);}_0x2c1f3d['order']=qs['sort'](_0x8ad36c[_0x2321('0x37')]['sort']);_0x2c1f3d[_0x2321('0x41')]=qs[_0x2321('0x38')](_['pick'](_0x8ad36c['query'],_0x18e153['filters']));if(_0x8ad36c[_0x2321('0x37')][_0x2321('0x42')]){_0x2c1f3d[_0x2321('0x41')]=_[_0x2321('0x43')](_0x2c1f3d[_0x2321('0x41')],{'$or':_[_0x2321('0x44')](_0xf7e766,function(_0x258229){if(_0x258229['type'][_0x2321('0x45')]!==_0x2321('0x46')){var _0x2253ec={};_0x2253ec[_0x258229[_0x2321('0x47')]]={'$like':'%'+_0x8ad36c['query'][_0x2321('0x42')]+'%'};return _0x2253ec;}})});}_0x2c1f3d=_[_0x2321('0x43')]({},_0x2c1f3d,_0x8ad36c['options']);var _0x1cebad={'where':_0x2c1f3d[_0x2321('0x41')]};return db[_0x2321('0x48')]['count'](_0x1cebad)['then'](function(_0x1ddf2f){_0x368ece[_0x2321('0x2a')]=_0x1ddf2f;if(_0x8ad36c[_0x2321('0x37')][_0x2321('0x49')]){_0x2c1f3d[_0x2321('0x4a')]=[{'all':!![]}];}return db[_0x2321('0x48')][_0x2321('0x4b')](_0x2c1f3d);})[_0x2321('0x1f')](function(_0x23f307){_0x368ece[_0x2321('0x4c')]=_0x23f307;return _0x368ece;})[_0x2321('0x1f')](respondWithFilteredResult(_0x49562e,_0x2c1f3d))['catch'](handleError(_0x49562e,null));};exports['show']=function(_0x2db2d5,_0x3c2c36){var _0x5750b5={'raw':!![],'where':{'id':_0x2db2d5[_0x2321('0x4d')]['id']}},_0x127c91={};_0x127c91[_0x2321('0x3b')]=_['keys'](db['ChatMessage'][_0x2321('0x4e')]);_0x127c91['query']=_['keys'](_0x2db2d5['query']);_0x127c91['filters']=_[_0x2321('0x3a')](_0x127c91[_0x2321('0x3b')],_0x127c91[_0x2321('0x37')]);_0x5750b5['attributes']=_[_0x2321('0x3a')](_0x127c91['model'],qs[_0x2321('0x3c')](_0x2db2d5[_0x2321('0x37')][_0x2321('0x3c')]));_0x5750b5[_0x2321('0x39')]=_0x5750b5[_0x2321('0x39')][_0x2321('0x3d')]?_0x5750b5[_0x2321('0x39')]:_0x127c91[_0x2321('0x3b')];if(_0x2db2d5['query'][_0x2321('0x49')]){_0x5750b5[_0x2321('0x4a')]=[{'all':!![]}];}_0x5750b5=_[_0x2321('0x43')]({},_0x5750b5,_0x2db2d5['options']);return db[_0x2321('0x48')][_0x2321('0x4f')](_0x5750b5)[_0x2321('0x1f')](handleEntityNotFound(_0x3c2c36,null))[_0x2321('0x1f')](respondWithResult(_0x3c2c36,null))[_0x2321('0x50')](handleError(_0x3c2c36,null));};exports[_0x2321('0x51')]=function(_0x35dc5f,_0x339770){return db[_0x2321('0x48')][_0x2321('0x51')](_0x35dc5f[_0x2321('0x52')],{})[_0x2321('0x1f')](respondWithResult(_0x339770,0xc9))[_0x2321('0x50')](handleError(_0x339770,null));};exports['update']=function(_0x529ba3,_0x132ea0){if(_0x529ba3[_0x2321('0x52')]['id']){delete _0x529ba3[_0x2321('0x52')]['id'];}return db['ChatMessage'][_0x2321('0x4f')]({'where':{'id':_0x529ba3[_0x2321('0x4d')]['id']}})[_0x2321('0x1f')](handleEntityNotFound(_0x132ea0,null))[_0x2321('0x1f')](saveUpdates(_0x529ba3['body'],null))[_0x2321('0x1f')](respondWithResult(_0x132ea0,null))[_0x2321('0x50')](handleError(_0x132ea0,null));};exports['destroy']=function(_0x414c30,_0x325756){return db[_0x2321('0x48')][_0x2321('0x4f')]({'where':{'id':_0x414c30[_0x2321('0x4d')]['id']}})[_0x2321('0x1f')](handleEntityNotFound(_0x325756,null))[_0x2321('0x1f')](removeEntity(_0x325756,null))[_0x2321('0x50')](handleError(_0x325756,null));};exports['describe']=function(_0x29c7e9,_0x43ab01){return db['ChatMessage'][_0x2321('0x53')]()[_0x2321('0x1f')](respondWithResult(_0x43ab01,null))[_0x2321('0x50')](handleError(_0x43ab01,null));};var interaction_log=require(_0x2321('0x11'))(_0x2321('0x54'));exports['accept']=function(_0x38ad8a,_0x2e772a,_0x547ba8){var _0x4c5088={'channel':_0x2321('0x55')};if(_0x38ad8a[_0x2321('0x52')]['id']){delete _0x38ad8a[_0x2321('0x52')]['id'];}_0x38ad8a[_0x2321('0x52')][_0x2321('0x56')]=!![];_0x38ad8a[_0x2321('0x52')][_0x2321('0x57')]=moment()[_0x2321('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x38ad8a[_0x2321('0x52')][_0x2321('0x59')]=_0x38ad8a['body'][_0x2321('0x59')]||_0x38ad8a[_0x2321('0x5a')]['id'];return db[_0x2321('0x48')][_0x2321('0x4f')]({'where':{'id':_0x38ad8a[_0x2321('0x4d')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x2321('0x5b')}]})['then'](handleEntityNotFound(_0x2e772a,null))['then'](saveUpdates(_0x38ad8a[_0x2321('0x52')],null))[_0x2321('0x1f')](function(_0x451858){if(_0x451858){_0x4c5088['message']=_0x451858[_0x2321('0x5c')]({'plain':!![]});return db[_0x2321('0x5d')][_0x2321('0x4f')]({'where':{'id':_0x451858[_0x2321('0x5e')]}});}return null;})[_0x2321('0x1f')](handleEntityNotFound(_0x2e772a,null))[_0x2321('0x1f')](function(_0x3da07e){if(_0x3da07e){return _0x3da07e['update']({'UserId':_0x38ad8a['body'][_0x2321('0x59')],'read1stAt':_['isNil'](_0x3da07e['read1stAt'])?moment()[_0x2321('0x58')](_0x2321('0x5f')):undefined});}return null;})[_0x2321('0x1f')](function(_0xbfdf70){if(_0xbfdf70){_0x4c5088[_0x2321('0x60')]=_0xbfdf70[_0x2321('0x5c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38ad8a['user']['id'],_0x38ad8a[_0x2321('0x5a')]['name'],_0x38ad8a[_0x2321('0x5a')][_0x2321('0x61')],_0x4c5088[_0x2321('0x60')]['id'],_0x38ad8a[_0x2321('0x52')]?JSON['stringify'](_0x38ad8a[_0x2321('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0x2321('0x62'),_0x4c5088);}return null;})['then'](function(_0x5505f0){if(_0x5505f0){if(_0x38ad8a[_0x2321('0x52')]['manual']){_0x4c5088[_0x2321('0x26')][_0x2321('0x63')]=util[_0x2321('0x58')](_0x2321('0x64'),_0x38ad8a['user'][_0x2321('0x33')]);_0x4c5088[_0x2321('0x26')]['channel']=_0x4c5088['channel'];_0x4c5088[_0x2321('0x26')][_0x2321('0x65')]='accept';return respondWithRpcPromise(_0x2321('0x66'),_0x2321('0x66'),{'event':_0x2321('0x67'),'message':_[_0x2321('0x43')](_0x4c5088[_0x2321('0x26')],JSON[_0x2321('0x68')](_0x4c5088[_0x2321('0x60')][_0x2321('0x69')]))},client9002)['then'](function(){return _0x4c5088;});}return _0x4c5088;}return null;})['then'](respondWithResult(_0x2e772a,null))['catch'](handleError(_0x2e772a,null));};var interaction_log=require('../../config/logger')(_0x2321('0x54'));exports[_0x2321('0x2e')]=function(_0x4de733,_0xff9ff9,_0xb9fc84){var _0x38f01e={'agent':{},'channel':_0x2321('0x55')};if(_0x4de733['body']['id']){delete _0x4de733['body']['id'];}_0x4de733[_0x2321('0x52')]['UserId']=_0x4de733[_0x2321('0x52')][_0x2321('0x59')]||_0x4de733[_0x2321('0x5a')]['id'];_0x38f01e[_0x2321('0x6a')]['id']=_0x4de733['body'][_0x2321('0x59')];return db[_0x2321('0x48')][_0x2321('0x4f')]({'where':{'id':_0x4de733[_0x2321('0x4d')]['id'],'UserId':null}})[_0x2321('0x1f')](handleEntityNotFound(_0xff9ff9,null))[_0x2321('0x1f')](function(_0x4f5760){if(_0x4f5760){_0x38f01e[_0x2321('0x26')]=_0x4f5760[_0x2321('0x5c')]({'plain':!![]});return db[_0x2321('0x5d')][_0x2321('0x4f')]({'where':{'id':_0x4f5760[_0x2321('0x5e')]}});}return null;})[_0x2321('0x1f')](handleEntityNotFound(_0xff9ff9,null))['then'](function(_0x367f17){if(_0x367f17){_0x38f01e[_0x2321('0x60')]=_0x367f17[_0x2321('0x5c')]({'plain':!![]});interaction_log[_0x2321('0x6b')](_0x2321('0x6c'),_0x4de733[_0x2321('0x5a')]['id'],_0x4de733[_0x2321('0x5a')][_0x2321('0x33')],_0x4de733[_0x2321('0x5a')][_0x2321('0x61')],_0x38f01e[_0x2321('0x60')]['id'],_0x4de733['body']?JSON[_0x2321('0x23')](_0x4de733[_0x2321('0x52')]):'null');return respondWithRpcPromise(_0x2321('0x6d'),_0x2321('0x6e'),_0x38f01e);}return null;})['then'](function(_0x53b91c){if(_0x53b91c){_0x53b91c[_0x2321('0x26')]['interface']=util[_0x2321('0x58')](_0x2321('0x64'),_0x4de733[_0x2321('0x5a')][_0x2321('0x33')]);_0x53b91c[_0x2321('0x26')][_0x2321('0x6f')]=_0x38f01e[_0x2321('0x6f')];_0x53b91c[_0x2321('0x26')][_0x2321('0x65')]=_0x2321('0x2e');respondWithRpcPromise(_0x2321('0x66'),_0x2321('0x66'),{'event':_0x2321('0x70'),'message':_0x53b91c[_0x2321('0x26')]},client9002);return _0x38f01e;}return null;})[_0x2321('0x1f')](respondWithResult(_0xff9ff9,null))[_0x2321('0x50')](handleError(_0xff9ff9,null));}; \ No newline at end of file +var _0x8392=['status','end','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','ChatMessage','model','keys','filters','query','attributes','intersection','fields','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','accept','chat','readAt','format','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus'];(function(_0x40ca11,_0x28a4be){var _0x1e1544=function(_0x3e1985){while(--_0x3e1985){_0x40ca11['push'](_0x40ca11['shift']());}};_0x1e1544(++_0x28a4be);}(_0x8392,0x142));var _0x2839=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8392[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x2839('0x0'));var emlformat=require(_0x2839('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2839('0x2'));var jsonpatch=require(_0x2839('0x3'));var rp=require('request-promise');var moment=require(_0x2839('0x4'));var BPromise=require(_0x2839('0x5'));var Mustache=require(_0x2839('0x6'));var util=require(_0x2839('0x7'));var path=require(_0x2839('0x8'));var sox=require(_0x2839('0x9'));var csv=require(_0x2839('0xa'));var ejs=require(_0x2839('0xb'));var fs=require('fs');var _=require(_0x2839('0xc'));var squel=require(_0x2839('0xd'));var crypto=require(_0x2839('0xe'));var jsforce=require(_0x2839('0xf'));var deskjs=require(_0x2839('0x10'));var toCsv=require(_0x2839('0xa'));var querystring=require(_0x2839('0x11'));var Papa=require('papaparse');var Redis=require(_0x2839('0x12'));var authService=require(_0x2839('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2839('0x14'))('api');var utils=require(_0x2839('0x15'));var config=require(_0x2839('0x16'));var db=require(_0x2839('0x17'))['db'];config['redis']=_['defaults'](config[_0x2839('0x18')],{'host':_0x2839('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2839('0x18')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2839('0x1a'));var client=jayson[_0x2839('0x1b')][_0x2839('0x1c')]({'port':0x232c});var client9002=jayson[_0x2839('0x1b')][_0x2839('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5b744a,_0x23606b,_0x24926c){if(_0x24926c){var _0x41374a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41374a[_0x2839('0x1d')](_0x23606b)){return _0x5b744a;}else{throw new Error(_0x2839('0x1e'));}}else{return _0x5b744a;}}function respondWithRpcPromise(_0x2282ad,_0x34f60f,_0x27a718,_0x50525e){return new BPromise(function(_0x117b5c,_0x22993a){var _0x4001bc=_0x50525e||client;return _0x4001bc[_0x2839('0x1f')](_0x2282ad,_0x27a718)[_0x2839('0x20')](function(_0x1868e8){logger['info'](_0x2839('0x21'),_0x34f60f,'request\x20sent');logger[_0x2839('0x22')](_0x2839('0x23'),_0x34f60f,_0x2839('0x24'),JSON[_0x2839('0x25')](_0x1868e8));if(_0x1868e8[_0x2839('0x26')]){if(_0x1868e8[_0x2839('0x26')][_0x2839('0x27')]===0x1f4){logger[_0x2839('0x26')]('ChatMessage,\x20%s,\x20%s',_0x34f60f,_0x1868e8['error'][_0x2839('0x28')]);return _0x22993a(_0x1868e8[_0x2839('0x26')][_0x2839('0x28')]);}logger[_0x2839('0x26')](_0x2839('0x21'),_0x34f60f,_0x1868e8[_0x2839('0x26')][_0x2839('0x28')]);return _0x117b5c(_0x1868e8['error'][_0x2839('0x28')]);}else{logger[_0x2839('0x29')](_0x2839('0x21'),_0x34f60f,_0x2839('0x24'));_0x117b5c(_0x1868e8['result'][_0x2839('0x28')]);}})[_0x2839('0x2a')](function(_0x412130){logger['error'](_0x2839('0x21'),_0x34f60f,_0x412130);_0x22993a(_0x412130);});});}function respondWithStatusCode(_0x16cd62,_0x366305){_0x366305=_0x366305||0xcc;return function(_0x53eb0d){if(_0x53eb0d){return _0x16cd62[_0x2839('0x2b')](_0x366305);}return _0x16cd62[_0x2839('0x2c')](_0x366305)[_0x2839('0x2d')]();};}function respondWithResult(_0x35ffd6,_0x47873e){_0x47873e=_0x47873e||0xc8;return function(_0x5a8721){if(_0x5a8721){return _0x35ffd6['status'](_0x47873e)['json'](_0x5a8721);}};}function respondWithFilteredResult(_0xc19072,_0x38ce55){return function(_0x1ddfda){if(_0x1ddfda){var _0x4f2b6e=_0x1ddfda[_0x2839('0x2e')],_0xae470a=_0x38ce55[_0x2839('0x2f')],_0x34753b=_0x38ce55[_0x2839('0x2f')]+_0x38ce55[_0x2839('0x30')],_0x2c139e;if(_0x34753b>=_0x4f2b6e){_0x34753b=_0x4f2b6e;_0x2c139e=0xc8;}else{_0x2c139e=0xce;}_0xc19072[_0x2839('0x2c')](_0x2c139e);return _0xc19072[_0x2839('0x31')](_0x2839('0x32'),_0xae470a+'-'+_0x34753b+'/'+_0x4f2b6e)['json'](_0x1ddfda);}return null;};}function patchUpdates(_0x4a30b1){return function(_0x3ad7f5){try{jsonpatch[_0x2839('0x33')](_0x3ad7f5,_0x4a30b1,!![]);}catch(_0xdd4be3){return BPromise['reject'](_0xdd4be3);}return _0x3ad7f5['save']();};}function saveUpdates(_0x38d919,_0x1cea97){return function(_0x3ade19){if(_0x3ade19){return _0x3ade19[_0x2839('0x34')](_0x38d919)[_0x2839('0x20')](function(_0x4c37ea){return _0x4c37ea;});}return null;};}function removeEntity(_0x429eff,_0x222666){return function(_0x4a2a31){if(_0x4a2a31){return _0x4a2a31[_0x2839('0x35')]()['then'](function(){_0x429eff[_0x2839('0x2c')](0xcc)[_0x2839('0x2d')]();});}};}function handleEntityNotFound(_0xd6becc,_0x422695){return function(_0x32b632){if(!_0x32b632){_0xd6becc[_0x2839('0x2b')](0x194);}return _0x32b632;};}function handleError(_0x388d10,_0x9f8c47){_0x9f8c47=_0x9f8c47||0x1f4;return function(_0x35ed9a){logger['error'](_0x35ed9a[_0x2839('0x36')]);if(_0x35ed9a[_0x2839('0x37')]){delete _0x35ed9a[_0x2839('0x37')];}_0x388d10[_0x2839('0x2c')](_0x9f8c47)[_0x2839('0x38')](_0x35ed9a);};}exports[_0x2839('0x39')]=function(_0x3248ed,_0x3e1dec){var _0x3e09b3={},_0x2e1338={},_0x3c89c1={'count':0x0,'rows':[]};var _0xcc96bb=db[_0x2839('0x3a')]['rawAttributes'];_0x2e1338[_0x2839('0x3b')]=_[_0x2839('0x3c')](_0xcc96bb);_0x2e1338['query']=_['keys'](_0x3248ed['query']);_0x2e1338[_0x2839('0x3d')]=_['intersection'](_0x2e1338[_0x2839('0x3b')],_0x2e1338[_0x2839('0x3e')]);_0x3e09b3[_0x2839('0x3f')]=_[_0x2839('0x40')](_0x2e1338[_0x2839('0x3b')],qs[_0x2839('0x41')](_0x3248ed[_0x2839('0x3e')][_0x2839('0x41')]));_0x3e09b3[_0x2839('0x3f')]=_0x3e09b3[_0x2839('0x3f')]['length']?_0x3e09b3['attributes']:_0x2e1338[_0x2839('0x3b')];if(!_0x3248ed[_0x2839('0x3e')]['hasOwnProperty']('nolimit')){_0x3e09b3[_0x2839('0x30')]=qs[_0x2839('0x30')](_0x3248ed[_0x2839('0x3e')][_0x2839('0x30')]);_0x3e09b3[_0x2839('0x2f')]=qs[_0x2839('0x2f')](_0x3248ed[_0x2839('0x3e')]['offset']);}_0x3e09b3[_0x2839('0x42')]=qs[_0x2839('0x43')](_0x3248ed['query'][_0x2839('0x43')]);_0x3e09b3[_0x2839('0x44')]=qs['filters'](_[_0x2839('0x45')](_0x3248ed['query'],_0x2e1338['filters']));if(_0x3248ed[_0x2839('0x3e')]['filter']){_0x3e09b3[_0x2839('0x44')]=_[_0x2839('0x46')](_0x3e09b3[_0x2839('0x44')],{'$or':_[_0x2839('0x47')](_0xcc96bb,function(_0x2bc4ac){if(_0x2bc4ac['type'][_0x2839('0x48')]!==_0x2839('0x49')){var _0x3e8748={};_0x3e8748[_0x2bc4ac[_0x2839('0x4a')]]={'$like':'%'+_0x3248ed[_0x2839('0x3e')][_0x2839('0x4b')]+'%'};return _0x3e8748;}})});}_0x3e09b3=_[_0x2839('0x46')]({},_0x3e09b3,_0x3248ed[_0x2839('0x4c')]);var _0xaae996={'where':_0x3e09b3[_0x2839('0x44')]};return db[_0x2839('0x3a')][_0x2839('0x2e')](_0xaae996)[_0x2839('0x20')](function(_0xa9aba9){_0x3c89c1['count']=_0xa9aba9;if(_0x3248ed[_0x2839('0x3e')][_0x2839('0x4d')]){_0x3e09b3[_0x2839('0x4e')]=[{'all':!![]}];}return db[_0x2839('0x3a')]['findAll'](_0x3e09b3);})[_0x2839('0x20')](function(_0x4c8323){_0x3c89c1[_0x2839('0x4f')]=_0x4c8323;return _0x3c89c1;})['then'](respondWithFilteredResult(_0x3e1dec,_0x3e09b3))[_0x2839('0x2a')](handleError(_0x3e1dec,null));};exports[_0x2839('0x50')]=function(_0x9cf62f,_0x367f28){var _0xc73eaf={'raw':!![],'where':{'id':_0x9cf62f[_0x2839('0x51')]['id']}},_0x34fa04={};_0x34fa04[_0x2839('0x3b')]=_['keys'](db['ChatMessage'][_0x2839('0x52')]);_0x34fa04[_0x2839('0x3e')]=_['keys'](_0x9cf62f[_0x2839('0x3e')]);_0x34fa04[_0x2839('0x3d')]=_[_0x2839('0x40')](_0x34fa04['model'],_0x34fa04[_0x2839('0x3e')]);_0xc73eaf[_0x2839('0x3f')]=_[_0x2839('0x40')](_0x34fa04[_0x2839('0x3b')],qs[_0x2839('0x41')](_0x9cf62f['query'][_0x2839('0x41')]));_0xc73eaf[_0x2839('0x3f')]=_0xc73eaf['attributes']['length']?_0xc73eaf[_0x2839('0x3f')]:_0x34fa04[_0x2839('0x3b')];if(_0x9cf62f[_0x2839('0x3e')][_0x2839('0x4d')]){_0xc73eaf['include']=[{'all':!![]}];}_0xc73eaf=_[_0x2839('0x46')]({},_0xc73eaf,_0x9cf62f[_0x2839('0x4c')]);return db[_0x2839('0x3a')][_0x2839('0x53')](_0xc73eaf)[_0x2839('0x20')](handleEntityNotFound(_0x367f28,null))[_0x2839('0x20')](respondWithResult(_0x367f28,null))[_0x2839('0x2a')](handleError(_0x367f28,null));};exports['create']=function(_0x19fa76,_0x19ecee){return db[_0x2839('0x3a')][_0x2839('0x54')](_0x19fa76[_0x2839('0x55')],{})[_0x2839('0x20')](respondWithResult(_0x19ecee,0xc9))[_0x2839('0x2a')](handleError(_0x19ecee,null));};exports[_0x2839('0x34')]=function(_0x19c02e,_0x47319e){if(_0x19c02e[_0x2839('0x55')]['id']){delete _0x19c02e[_0x2839('0x55')]['id'];}return db['ChatMessage'][_0x2839('0x53')]({'where':{'id':_0x19c02e['params']['id']}})[_0x2839('0x20')](handleEntityNotFound(_0x47319e,null))['then'](saveUpdates(_0x19c02e[_0x2839('0x55')],null))[_0x2839('0x20')](respondWithResult(_0x47319e,null))[_0x2839('0x2a')](handleError(_0x47319e,null));};exports[_0x2839('0x35')]=function(_0x509c98,_0x4fd023){return db['ChatMessage'][_0x2839('0x53')]({'where':{'id':_0x509c98[_0x2839('0x51')]['id']}})[_0x2839('0x20')](handleEntityNotFound(_0x4fd023,null))[_0x2839('0x20')](removeEntity(_0x4fd023,null))[_0x2839('0x2a')](handleError(_0x4fd023,null));};exports[_0x2839('0x56')]=function(_0x256e5e,_0x27b4eb){return db[_0x2839('0x3a')][_0x2839('0x56')]()[_0x2839('0x20')](respondWithResult(_0x27b4eb,null))[_0x2839('0x2a')](handleError(_0x27b4eb,null));};var interaction_log=require(_0x2839('0x14'))(_0x2839('0x57'));exports[_0x2839('0x58')]=function(_0x4035ce,_0x2d295b,_0x3ad047){var _0xe2c23e={'channel':_0x2839('0x59')};if(_0x4035ce[_0x2839('0x55')]['id']){delete _0x4035ce[_0x2839('0x55')]['id'];}_0x4035ce[_0x2839('0x55')]['read']=!![];_0x4035ce[_0x2839('0x55')][_0x2839('0x5a')]=moment()[_0x2839('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4035ce['body'][_0x2839('0x5c')]=_0x4035ce['body'][_0x2839('0x5c')]||_0x4035ce['user']['id'];return db[_0x2839('0x3a')][_0x2839('0x53')]({'where':{'id':_0x4035ce[_0x2839('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x2839('0x5d')],'as':_0x2839('0x5e')}]})[_0x2839('0x20')](handleEntityNotFound(_0x2d295b,null))[_0x2839('0x20')](saveUpdates(_0x4035ce[_0x2839('0x55')],null))[_0x2839('0x20')](function(_0x460350){if(_0x460350){_0xe2c23e[_0x2839('0x28')]=_0x460350[_0x2839('0x5f')]({'plain':!![]});return db[_0x2839('0x60')][_0x2839('0x53')]({'where':{'id':_0x460350[_0x2839('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x2d295b,null))[_0x2839('0x20')](function(_0x431e22){if(_0x431e22){return _0x431e22[_0x2839('0x34')]({'UserId':_0x4035ce[_0x2839('0x55')][_0x2839('0x5c')],'read1stAt':_[_0x2839('0x62')](_0x431e22['read1stAt'])?moment()[_0x2839('0x5b')](_0x2839('0x63')):undefined});}return null;})[_0x2839('0x20')](function(_0x4e90e2){if(_0x4e90e2){_0xe2c23e[_0x2839('0x64')]=_0x4e90e2[_0x2839('0x5f')]({'plain':!![]});interaction_log[_0x2839('0x29')](_0x2839('0x65'),_0x4035ce[_0x2839('0x66')]['id'],_0x4035ce[_0x2839('0x66')][_0x2839('0x37')],_0x4035ce[_0x2839('0x66')][_0x2839('0x67')],_0xe2c23e[_0x2839('0x64')]['id'],_0x4035ce['body']?JSON[_0x2839('0x25')](_0x4035ce[_0x2839('0x55')]):_0x2839('0x68'));return respondWithRpcPromise(_0x2839('0x69'),_0x2839('0x6a'),_0xe2c23e);}return null;})[_0x2839('0x20')](function(_0x35d767){if(_0x35d767){if(_0x4035ce[_0x2839('0x55')][_0x2839('0x6b')]){_0xe2c23e[_0x2839('0x28')][_0x2839('0x6c')]=util[_0x2839('0x5b')](_0x2839('0x6d'),_0x4035ce[_0x2839('0x66')][_0x2839('0x37')]);_0xe2c23e[_0x2839('0x28')][_0x2839('0x6e')]=_0xe2c23e[_0x2839('0x6e')];_0xe2c23e[_0x2839('0x28')][_0x2839('0x6f')]=_0x2839('0x58');return respondWithRpcPromise(_0x2839('0x70'),_0x2839('0x70'),{'event':_0x2839('0x71'),'message':_[_0x2839('0x46')](_0xe2c23e[_0x2839('0x28')],JSON[_0x2839('0x72')](_0xe2c23e[_0x2839('0x64')][_0x2839('0x73')]))},client9002)[_0x2839('0x20')](function(){return _0xe2c23e;});}return _0xe2c23e;}return null;})['then'](respondWithResult(_0x2d295b,null))[_0x2839('0x2a')](handleError(_0x2d295b,null));};var interaction_log=require('../../config/logger')(_0x2839('0x57'));exports[_0x2839('0x74')]=function(_0xf389a1,_0x272e6c,_0x2ab008){var _0x18e996={'agent':{},'channel':_0x2839('0x59')};if(_0xf389a1[_0x2839('0x55')]['id']){delete _0xf389a1['body']['id'];}_0xf389a1[_0x2839('0x55')][_0x2839('0x5c')]=_0xf389a1[_0x2839('0x55')][_0x2839('0x5c')]||_0xf389a1['user']['id'];_0x18e996[_0x2839('0x75')]['id']=_0xf389a1[_0x2839('0x55')][_0x2839('0x5c')];return db[_0x2839('0x3a')][_0x2839('0x53')]({'where':{'id':_0xf389a1['params']['id'],'UserId':null}})[_0x2839('0x20')](handleEntityNotFound(_0x272e6c,null))[_0x2839('0x20')](function(_0x4beabf){if(_0x4beabf){_0x18e996['message']=_0x4beabf[_0x2839('0x5f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4beabf[_0x2839('0x61')]}});}return null;})[_0x2839('0x20')](handleEntityNotFound(_0x272e6c,null))[_0x2839('0x20')](function(_0x47fd8b){if(_0x47fd8b){_0x18e996[_0x2839('0x64')]=_0x47fd8b[_0x2839('0x5f')]({'plain':!![]});interaction_log[_0x2839('0x29')](_0x2839('0x76'),_0xf389a1[_0x2839('0x66')]['id'],_0xf389a1[_0x2839('0x66')][_0x2839('0x37')],_0xf389a1[_0x2839('0x66')][_0x2839('0x67')],_0x18e996[_0x2839('0x64')]['id'],_0xf389a1[_0x2839('0x55')]?JSON['stringify'](_0xf389a1[_0x2839('0x55')]):'null');return respondWithRpcPromise(_0x2839('0x77'),_0x2839('0x78'),_0x18e996);}return null;})[_0x2839('0x20')](function(_0x1e8311){if(_0x1e8311){_0x1e8311[_0x2839('0x28')][_0x2839('0x6c')]=util[_0x2839('0x5b')](_0x2839('0x6d'),_0xf389a1[_0x2839('0x66')][_0x2839('0x37')]);_0x1e8311[_0x2839('0x28')][_0x2839('0x6e')]=_0x18e996[_0x2839('0x6e')];_0x1e8311[_0x2839('0x28')]['event']=_0x2839('0x74');respondWithRpcPromise('EventManager',_0x2839('0x70'),{'event':_0x2839('0x79'),'message':_0x1e8311[_0x2839('0x28')]},client9002);return _0x18e996;}return null;})['then'](respondWithResult(_0x272e6c,null))[_0x2839('0x2a')](handleError(_0x272e6c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f53689c..9eed6cf 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 _0x4e5c=['remove','emit','hasOwnProperty','hook','exports','events','ChatMessage','save','update'];(function(_0x443c8e,_0xd13440){var _0xab483a=function(_0x3d387e){while(--_0x3d387e){_0x443c8e['push'](_0x443c8e['shift']());}};_0xab483a(++_0xd13440);}(_0x4e5c,0x149));var _0xc4e5=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4e5c[_0x6cf19c];return _0xce14f3;};'use strict';var EventEmitter=require(_0xc4e5('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc4e5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4e5('0x2'),'afterUpdate':_0xc4e5('0x3'),'afterDestroy':_0xc4e5('0x4')};function emitEvent(_0x4d3c82){return function(_0x4cd665,_0x4ecd96,_0x2897d3){ChatMessageEvents[_0xc4e5('0x5')](_0x4d3c82+':'+_0x4cd665['id'],_0x4cd665);ChatMessageEvents[_0xc4e5('0x5')](_0x4d3c82,_0x4cd665);_0x2897d3(null);};}for(var e in events){if(events[_0xc4e5('0x6')](e)){var event=events[e];ChatMessage[_0xc4e5('0x7')](e,emitEvent(event));}}module[_0xc4e5('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xefe2=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xefe2,0xd9));var _0x2efe=function(_0x11d8f0,_0xc92c4c){_0x11d8f0=_0x11d8f0-0x0;var _0x26ffaf=_0xefe2[_0x11d8f0];return _0x26ffaf;};'use strict';var EventEmitter=require(_0x2efe('0x0'));var ChatMessage=require(_0x2efe('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2efe('0x2')](0x0);var events={'afterCreate':_0x2efe('0x3'),'afterUpdate':'update','afterDestroy':_0x2efe('0x4')};function emitEvent(_0x5afd9b){return function(_0x470efc,_0x4553a6,_0x2d3c97){ChatMessageEvents[_0x2efe('0x5')](_0x5afd9b+':'+_0x470efc['id'],_0x470efc);ChatMessageEvents[_0x2efe('0x5')](_0x5afd9b,_0x470efc);_0x2d3c97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2efe('0x6')](e,emitEvent(event));}}module[_0x2efe('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 a6cb12d..712fe32 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 _0x2f89=['ChatInteractionId','then','catch','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','ChatInteraction','findOne'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x2f89,0x1a6));var _0x92f8=function(_0x543f32,_0x238989){_0x543f32=_0x543f32-0x0;var _0x1f692a=_0x2f89[_0x543f32];return _0x1f692a;};'use strict';var _=require('lodash');var util=require(_0x92f8('0x0'));var logger=require(_0x92f8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x92f8('0x2'));var rp=require(_0x92f8('0x3'));var fs=require('fs');var path=require(_0x92f8('0x4'));var rimraf=require(_0x92f8('0x5'));var config=require('../../config/environment');var attributes=require(_0x92f8('0x6'));module['exports']=function(_0x38c5d4,_0x332c60){return _0x38c5d4[_0x92f8('0x7')](_0x92f8('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x92f8('0x9'),'fields':['body'],'type':_0x92f8('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32bf07,_0x11ff15,_0x5dc9d6){var _0x38f956=_0x38c5d4[_0x92f8('0xb')];var _0x5e3066=_0x32bf07[_0x92f8('0xc')]({'plain':!![]});if(_0x5e3066[_0x92f8('0xd')][_0x92f8('0xe')]()==='in'||_0x5e3066[_0x92f8('0xd')]['toLowerCase']()==='out'&&!_0x5e3066[_0x92f8('0xf')]&&!_['isNil'](_0x5e3066['UserId'])){_0x38f956[_0x92f8('0x10')][_0x92f8('0x11')]({'where':{'id':_0x5e3066[_0x92f8('0x12')]}})[_0x92f8('0x13')](function(_0x44729a){if(_0x44729a){_0x44729a['update']({'lastMsgAt':_0x5e3066['createdAt'],'lastMsgDirection':_0x5e3066['direction'][_0x92f8('0xe')]()});}})[_0x92f8('0x14')](function(_0x2fa1aa){console['error'](_0x2fa1aa);});}_0x5dc9d6();}},'charset':'utf8mb4','collate':_0x92f8('0x15')});}; \ No newline at end of file +var _0xf0b7=['models','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT'];(function(_0x1e182d,_0x4f35c2){var _0x5627c6=function(_0x12b34c){while(--_0x12b34c){_0x1e182d['push'](_0x1e182d['shift']());}};_0x5627c6(++_0x4f35c2);}(_0xf0b7,0xe2));var _0x7f0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0b7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f0b('0x0'));var util=require(_0x7f0b('0x1'));var logger=require(_0x7f0b('0x2'))('api');var moment=require(_0x7f0b('0x3'));var BPromise=require('bluebird');var rp=require(_0x7f0b('0x4'));var fs=require('fs');var path=require(_0x7f0b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f0b('0x6'));module[_0x7f0b('0x7')]=function(_0x30eb4c,_0x4eeda1){return _0x30eb4c[_0x7f0b('0x8')](_0x7f0b('0x9'),attributes,{'tableName':_0x7f0b('0xa'),'paranoid':![],'indexes':[{'name':_0x7f0b('0xb'),'fields':[_0x7f0b('0xc')],'type':_0x7f0b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59bce5,_0xbfa1ab,_0x222369){var _0x47512a=_0x30eb4c[_0x7f0b('0xe')];var _0x5791ce=_0x59bce5[_0x7f0b('0xf')]({'plain':!![]});if(_0x5791ce['direction'][_0x7f0b('0x10')]()==='in'||_0x5791ce[_0x7f0b('0x11')]['toLowerCase']()===_0x7f0b('0x12')&&!_0x5791ce[_0x7f0b('0x13')]&&!_[_0x7f0b('0x14')](_0x5791ce[_0x7f0b('0x15')])){_0x47512a[_0x7f0b('0x16')]['findOne']({'where':{'id':_0x5791ce[_0x7f0b('0x17')]}})[_0x7f0b('0x18')](function(_0x582bb8){if(_0x582bb8){_0x582bb8[_0x7f0b('0x19')]({'lastMsgAt':_0x5791ce[_0x7f0b('0x1a')],'lastMsgDirection':_0x5791ce[_0x7f0b('0x11')]['toLowerCase']()});}})[_0x7f0b('0x1b')](function(_0x4c6fa2){console[_0x7f0b('0x1c')](_0x4c6fa2);});}_0x222369();}},'charset':'utf8mb4','collate':_0x7f0b('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 5994f66..5428e54 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 _0x0664=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','moment','randomstring'];(function(_0x3e3c3f,_0x35aa98){var _0x4e4661=function(_0x75624b){while(--_0x75624b){_0x3e3c3f['push'](_0x3e3c3f['shift']());}};_0x4e4661(++_0x35aa98);}(_0x0664,0xe4));var _0x4066=function(_0x2f9793,_0x36e0a3){_0x2f9793=_0x2f9793-0x0;var _0x1451f2=_0x0664[_0x2f9793];return _0x1451f2;};'use strict';var _=require(_0x4066('0x0'));var util=require('util');var moment=require(_0x4066('0x1'));var BPromise=require('bluebird');var rs=require(_0x4066('0x2'));var fs=require('fs');var Redis=require(_0x4066('0x3'));var db=require(_0x4066('0x4'))['db'];var utils=require(_0x4066('0x5'));var logger=require(_0x4066('0x6'))('rpc');var config=require(_0x4066('0x7'));var jayson=require(_0x4066('0x8'));var client=jayson[_0x4066('0x9')][_0x4066('0xa')]({'port':0x232a});config[_0x4066('0xb')]=_[_0x4066('0xc')](config[_0x4066('0xb')],{'host':_0x4066('0xd'),'port':0x18eb});var socket=require(_0x4066('0xe'))(new Redis(config['redis']));require(_0x4066('0xf'))['register'](socket);function respondWithRpcPromise(_0x36af7e,_0x412412,_0x54aba3){return new BPromise(function(_0x3ad879,_0x5d9739){return client[_0x4066('0x10')](_0x36af7e,_0x54aba3)[_0x4066('0x11')](function(_0x208fa3){logger[_0x4066('0x12')](_0x4066('0x13'),_0x412412,_0x4066('0x14'));logger[_0x4066('0x15')](_0x4066('0x16'),_0x412412,_0x4066('0x14'),JSON['stringify'](_0x208fa3));if(_0x208fa3[_0x4066('0x17')]){if(_0x208fa3[_0x4066('0x17')][_0x4066('0x18')]===0x1f4){logger[_0x4066('0x17')](_0x4066('0x13'),_0x412412,_0x208fa3[_0x4066('0x17')][_0x4066('0x19')]);return _0x5d9739(_0x208fa3[_0x4066('0x17')]['message']);}logger[_0x4066('0x17')]('ChatMessage,\x20%s,\x20%s',_0x412412,_0x208fa3[_0x4066('0x17')]['message']);return _0x3ad879(_0x208fa3['error'][_0x4066('0x19')]);}else{logger[_0x4066('0x12')]('ChatMessage,\x20%s,\x20%s',_0x412412,_0x4066('0x14'));_0x3ad879(_0x208fa3[_0x4066('0x1a')]['message']);}})[_0x4066('0x1b')](function(_0x9eed72){logger[_0x4066('0x17')]('ChatMessage,\x20%s,\x20%s',_0x412412,_0x9eed72);_0x5d9739(_0x9eed72);});});}exports['CreateChatMessage']=function(_0x22aef5){var _0xd82ba8=this;return new Promise(function(_0x4a29da,_0x43ca0c){return db[_0x4066('0x1c')][_0x4066('0x1d')](_0x22aef5[_0x4066('0x1e')],{'raw':_0x22aef5[_0x4066('0x1f')]?_0x22aef5[_0x4066('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4066('0x11')](function(_0x4c094d){logger[_0x4066('0x12')](_0x4066('0x20'),_0x22aef5);logger[_0x4066('0x15')](_0x4066('0x20'),_0x22aef5,JSON['stringify'](_0x4c094d));_0x4a29da(_0x4c094d);})[_0x4066('0x1b')](function(_0x1d298d){logger[_0x4066('0x17')](_0x4066('0x20'),_0x1d298d[_0x4066('0x19')],_0x22aef5);_0x43ca0c(_0xd82ba8[_0x4066('0x17')](0x1f4,_0x1d298d[_0x4066('0x19')]));});});}; \ No newline at end of file +var _0x0606=['request','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','CreateChatMessage','ChatMessage','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x527a13,_0x33ec5c){var _0xb0c4e2=function(_0x32a186){while(--_0x32a186){_0x527a13['push'](_0x527a13['shift']());}};_0xb0c4e2(++_0x33ec5c);}(_0x0606,0xd5));var _0x6060=function(_0x3fac49,_0x4dc476){_0x3fac49=_0x3fac49-0x0;var _0x54b385=_0x0606[_0x3fac49];return _0x54b385;};'use strict';var _=require(_0x6060('0x0'));var util=require(_0x6060('0x1'));var moment=require(_0x6060('0x2'));var BPromise=require(_0x6060('0x3'));var rs=require(_0x6060('0x4'));var fs=require('fs');var Redis=require(_0x6060('0x5'));var db=require(_0x6060('0x6'))['db'];var utils=require(_0x6060('0x7'));var logger=require(_0x6060('0x8'))(_0x6060('0x9'));var config=require('../../config/environment');var jayson=require(_0x6060('0xa'));var client=jayson[_0x6060('0xb')][_0x6060('0xc')]({'port':0x232a});config[_0x6060('0xd')]=_[_0x6060('0xe')](config[_0x6060('0xd')],{'host':_0x6060('0xf'),'port':0x18eb});var socket=require(_0x6060('0x10'))(new Redis(config[_0x6060('0xd')]));require('./chatMessage.socket')[_0x6060('0x11')](socket);function respondWithRpcPromise(_0x912294,_0x5c9de1,_0x238217){return new BPromise(function(_0x4f4c94,_0x4f9308){return client[_0x6060('0x12')](_0x912294,_0x238217)['then'](function(_0x4bb83b){logger[_0x6060('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5c9de1,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c9de1,_0x6060('0x14'),JSON[_0x6060('0x15')](_0x4bb83b));if(_0x4bb83b[_0x6060('0x16')]){if(_0x4bb83b[_0x6060('0x16')][_0x6060('0x17')]===0x1f4){logger[_0x6060('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5c9de1,_0x4bb83b[_0x6060('0x16')][_0x6060('0x18')]);return _0x4f9308(_0x4bb83b[_0x6060('0x16')][_0x6060('0x18')]);}logger[_0x6060('0x16')](_0x6060('0x19'),_0x5c9de1,_0x4bb83b[_0x6060('0x16')][_0x6060('0x18')]);return _0x4f4c94(_0x4bb83b[_0x6060('0x16')][_0x6060('0x18')]);}else{logger[_0x6060('0x13')](_0x6060('0x19'),_0x5c9de1,_0x6060('0x14'));_0x4f4c94(_0x4bb83b[_0x6060('0x1a')][_0x6060('0x18')]);}})[_0x6060('0x1b')](function(_0x16d925){logger[_0x6060('0x16')](_0x6060('0x19'),_0x5c9de1,_0x16d925);_0x4f9308(_0x16d925);});});}exports[_0x6060('0x1c')]=function(_0x93c3ef){var _0x8aa485=this;return new Promise(function(_0x4155e2,_0x4003d1){return db[_0x6060('0x1d')]['create'](_0x93c3ef[_0x6060('0x1e')],{'raw':_0x93c3ef['options']?_0x93c3ef[_0x6060('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x6060('0x20')](function(_0x40c6a9){logger[_0x6060('0x13')](_0x6060('0x1c'),_0x93c3ef);logger['debug'](_0x6060('0x1c'),_0x93c3ef,JSON[_0x6060('0x15')](_0x40c6a9));_0x4155e2(_0x40c6a9);})['catch'](function(_0x5e88fb){logger[_0x6060('0x16')](_0x6060('0x1c'),_0x5e88fb[_0x6060('0x18')],_0x93c3ef);_0x4003d1(_0x8aa485[_0x6060('0x16')](0x1f4,_0x5e88fb[_0x6060('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 393a519..33dfa93 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['removeListener','register','length','chatMessage:','save','remove','update','emit'];(function(_0x31e0cb,_0x5097b4){var _0x9f4bd8=function(_0x469faf){while(--_0x469faf){_0x31e0cb['push'](_0x31e0cb['shift']());}};_0x9f4bd8(++_0x5097b4);}(_0xedd9,0xfc));var _0x9edd=function(_0x5ecbad,_0x119365){_0x5ecbad=_0x5ecbad-0x0;var _0x45d67e=_0xedd9[_0x5ecbad];return _0x45d67e;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x008c=['./chatMessage.events','save','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x2ee630,_0x5f0584){var _0x2cb7b1=function(_0x80e25a){while(--_0x80e25a){_0x2ee630['push'](_0x2ee630['shift']());}};_0x2cb7b1(++_0x5f0584);}(_0x008c,0x188));var _0xc008=function(_0x132edb,_0x54e052){_0x132edb=_0x132edb-0x0;var _0x294aab=_0x008c[_0x132edb];return _0x294aab;};'use strict';var ChatMessageEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatMessageEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatMessageEvents['on'](_0x428fa9,_0x5aa09b);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 92cd9b6..7619f12 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 _0x2cc4=['show','post','tracked','chat','chatmessage:create','create','/:id/accept','accept','put','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2cc4,0xdd));var _0x42cc=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x2cc4[_0x2ae8ce];return _0x4bf686;};'use strict';var multer=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var path=require(_0x42cc('0x2'));var timeout=require(_0x42cc('0x3'));var express=require(_0x42cc('0x4'));var router=express['Router']();var auth=require(_0x42cc('0x5'));var interaction=require(_0x42cc('0x6'));var config=require('../../config/environment');var controller=require(_0x42cc('0x7'));router[_0x42cc('0x8')]('/',auth[_0x42cc('0x9')](),controller[_0x42cc('0xa')]);router[_0x42cc('0x8')]('/describe',auth[_0x42cc('0x9')](),controller[_0x42cc('0xb')]);router[_0x42cc('0x8')](_0x42cc('0xc'),auth[_0x42cc('0x9')](),controller[_0x42cc('0xd')]);router[_0x42cc('0xe')]('/',auth[_0x42cc('0x9')](),interaction[_0x42cc('0xf')](_0x42cc('0x10'),_0x42cc('0x11')),controller[_0x42cc('0x12')]);router['put']('/:id',controller['update']);router['put'](_0x42cc('0x13'),auth[_0x42cc('0x9')](),controller[_0x42cc('0x14')]);router[_0x42cc('0x15')]('/:id/reject',auth[_0x42cc('0x9')](),controller[_0x42cc('0x16')]);router[_0x42cc('0x17')](_0x42cc('0xc'),auth[_0x42cc('0x9')](),controller[_0x42cc('0x18')]);module[_0x42cc('0x19')]=router; \ No newline at end of file +var _0xb7ba=['/:id/reject','reject','exports','multer','util','connect-timeout','express','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','create','update','put','/:id/accept','accept'];(function(_0x635d14,_0xa00e4e){var _0x20295e=function(_0x15dfe1){while(--_0x15dfe1){_0x635d14['push'](_0x635d14['shift']());}};_0x20295e(++_0xa00e4e);}(_0xb7ba,0xd5));var _0xab7b=function(_0x47dd05,_0x4aa69a){_0x47dd05=_0x47dd05-0x0;var _0x1ac7c7=_0xb7ba[_0x47dd05];return _0x1ac7c7;};'use strict';var multer=require(_0xab7b('0x0'));var util=require(_0xab7b('0x1'));var path=require('path');var timeout=require(_0xab7b('0x2'));var express=require(_0xab7b('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('./chatMessage.controller');router[_0xab7b('0x4')]('/',auth[_0xab7b('0x5')](),controller['index']);router[_0xab7b('0x4')](_0xab7b('0x6'),auth[_0xab7b('0x5')](),controller[_0xab7b('0x7')]);router[_0xab7b('0x4')](_0xab7b('0x8'),auth['isAuthenticated'](),controller[_0xab7b('0x9')]);router[_0xab7b('0xa')]('/',auth['isAuthenticated'](),interaction[_0xab7b('0xb')](_0xab7b('0xc'),'chatmessage:create'),controller[_0xab7b('0xd')]);router['put'](_0xab7b('0x8'),controller[_0xab7b('0xe')]);router[_0xab7b('0xf')](_0xab7b('0x10'),auth[_0xab7b('0x5')](),controller[_0xab7b('0x11')]);router['put'](_0xab7b('0x12'),auth['isAuthenticated'](),controller[_0xab7b('0x13')]);router['delete'](_0xab7b('0x8'),auth[_0xab7b('0x5')](),controller['destroy']);module[_0xab7b('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 62e3e0e..980576c 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 _0xe163=['exports','TEXT','medium','sequelize'];(function(_0xe49860,_0x24f476){var _0xda4f9=function(_0x9ec76f){while(--_0x9ec76f){_0xe49860['push'](_0xe49860['shift']());}};_0xda4f9(++_0x24f476);}(_0xe163,0x13b));var _0x3e16=function(_0xd9c851,_0x4ebae0){_0xd9c851=_0xd9c851-0x0;var _0x1921c0=_0xe163[_0xd9c851];return _0x1921c0;};'use strict';var Sequelize=require(_0x3e16('0x0'));module[_0x3e16('0x1')]={'body':{'type':Sequelize[_0x3e16('0x2')](_0x3e16('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x2011=['exports','TEXT','medium','sequelize'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x2011,0x73));var _0x1201=function(_0x2a9e41,_0x56d2b6){_0x2a9e41=_0x2a9e41-0x0;var _0x1b9d08=_0x2011[_0x2a9e41];return _0x1b9d08;};'use strict';var Sequelize=require(_0x1201('0x0'));module[_0x1201('0x1')]={'body':{'type':Sequelize[_0x1201('0x2')](_0x1201('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c3db20f..e6b91d8 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 _0x38b3=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','map','key','VIRTUAL','field','options','ChatOfflineMessage','includeAll','findAll','rows','show','merge','catch','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x47c25f,_0x819e39){var _0x477ce3=function(_0x1736b4){while(--_0x1736b4){_0x47c25f['push'](_0x47c25f['shift']());}};_0x477ce3(++_0x819e39);}(_0x38b3,0xda));var _0x338b=function(_0x4256e2,_0xedbf89){_0x4256e2=_0x4256e2-0x0;var _0x1b1915=_0x38b3[_0x4256e2];return _0x1b1915;};'use strict';var pdf=require(_0x338b('0x0'));var emlformat=require(_0x338b('0x1'));var rimraf=require(_0x338b('0x2'));var zipdir=require(_0x338b('0x3'));var jsonpatch=require(_0x338b('0x4'));var rp=require(_0x338b('0x5'));var moment=require(_0x338b('0x6'));var BPromise=require(_0x338b('0x7'));var Mustache=require(_0x338b('0x8'));var util=require(_0x338b('0x9'));var path=require(_0x338b('0xa'));var sox=require(_0x338b('0xb'));var csv=require(_0x338b('0xc'));var ejs=require(_0x338b('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x338b('0xe'));var crypto=require(_0x338b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x338b('0x10'));var toCsv=require(_0x338b('0xc'));var querystring=require('querystring');var Papa=require(_0x338b('0x11'));var Redis=require(_0x338b('0x12'));var authService=require(_0x338b('0x13'));var qs=require(_0x338b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x338b('0x15'))(_0x338b('0x16'));var utils=require('../../config/utils');var config=require(_0x338b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56383f,_0x583522){_0x583522=_0x583522||0xcc;return function(_0x5bfe66){if(_0x5bfe66){return _0x56383f[_0x338b('0x18')](_0x583522);}return _0x56383f['status'](_0x583522)['end']();};}function respondWithResult(_0x244138,_0x185e8a){_0x185e8a=_0x185e8a||0xc8;return function(_0x68d9a0){if(_0x68d9a0){return _0x244138['status'](_0x185e8a)[_0x338b('0x19')](_0x68d9a0);}};}function respondWithFilteredResult(_0xaaaa0a,_0x176cf3){return function(_0x2acd34){if(_0x2acd34){var _0x149fd4=_0x2acd34[_0x338b('0x1a')],_0x11d30f=_0x176cf3[_0x338b('0x1b')],_0x3d945f=_0x176cf3[_0x338b('0x1b')]+_0x176cf3[_0x338b('0x1c')],_0x1ab892;if(_0x3d945f>=_0x149fd4){_0x3d945f=_0x149fd4;_0x1ab892=0xc8;}else{_0x1ab892=0xce;}_0xaaaa0a[_0x338b('0x1d')](_0x1ab892);return _0xaaaa0a[_0x338b('0x1e')](_0x338b('0x1f'),_0x11d30f+'-'+_0x3d945f+'/'+_0x149fd4)[_0x338b('0x19')](_0x2acd34);}return null;};}function patchUpdates(_0x331f46){return function(_0x4a1343){try{jsonpatch['apply'](_0x4a1343,_0x331f46,!![]);}catch(_0x5212fc){return BPromise[_0x338b('0x20')](_0x5212fc);}return _0x4a1343[_0x338b('0x21')]();};}function saveUpdates(_0x155166,_0x11d730){return function(_0x44c20b){if(_0x44c20b){return _0x44c20b[_0x338b('0x22')](_0x155166)[_0x338b('0x23')](function(_0x59e0a9){return _0x59e0a9;});}return null;};}function removeEntity(_0x47b95f,_0x4fd8e2){return function(_0x3bee42){if(_0x3bee42){return _0x3bee42[_0x338b('0x24')]()[_0x338b('0x23')](function(){_0x47b95f[_0x338b('0x1d')](0xcc)[_0x338b('0x25')]();});}};}function handleEntityNotFound(_0x2d087f,_0x5d7a77){return function(_0x2ac8bc){if(!_0x2ac8bc){_0x2d087f[_0x338b('0x18')](0x194);}return _0x2ac8bc;};}function handleError(_0x26da5f,_0x20affe){_0x20affe=_0x20affe||0x1f4;return function(_0x43d660){logger[_0x338b('0x26')](_0x43d660[_0x338b('0x27')]);if(_0x43d660['name']){delete _0x43d660[_0x338b('0x28')];}_0x26da5f['status'](_0x20affe)[_0x338b('0x29')](_0x43d660);};}exports[_0x338b('0x2a')]=function(_0x582ad0,_0x380cc3){var _0x52fb51={},_0x595cf0={},_0x712883={'count':0x0,'rows':[]};var _0xe30ce3=db['ChatOfflineMessage'][_0x338b('0x2b')];_0x595cf0['model']=_[_0x338b('0x2c')](_0xe30ce3);_0x595cf0['query']=_[_0x338b('0x2c')](_0x582ad0['query']);_0x595cf0['filters']=_['intersection'](_0x595cf0[_0x338b('0x2d')],_0x595cf0[_0x338b('0x2e')]);_0x52fb51[_0x338b('0x2f')]=_[_0x338b('0x30')](_0x595cf0['model'],qs[_0x338b('0x31')](_0x582ad0[_0x338b('0x2e')][_0x338b('0x31')]));_0x52fb51[_0x338b('0x2f')]=_0x52fb51['attributes'][_0x338b('0x32')]?_0x52fb51[_0x338b('0x2f')]:_0x595cf0[_0x338b('0x2d')];if(!_0x582ad0[_0x338b('0x2e')][_0x338b('0x33')](_0x338b('0x34'))){_0x52fb51[_0x338b('0x1c')]=qs[_0x338b('0x1c')](_0x582ad0[_0x338b('0x2e')][_0x338b('0x1c')]);_0x52fb51['offset']=qs[_0x338b('0x1b')](_0x582ad0['query'][_0x338b('0x1b')]);}_0x52fb51['order']=qs[_0x338b('0x35')](_0x582ad0[_0x338b('0x2e')][_0x338b('0x35')]);_0x52fb51[_0x338b('0x36')]=qs['filters'](_[_0x338b('0x37')](_0x582ad0[_0x338b('0x2e')],_0x595cf0[_0x338b('0x38')]));if(_0x582ad0[_0x338b('0x2e')][_0x338b('0x39')]){_0x52fb51['where']=_['merge'](_0x52fb51[_0x338b('0x36')],{'$or':_[_0x338b('0x3a')](_0xe30ce3,function(_0x2f19c6){if(_0x2f19c6['type'][_0x338b('0x3b')]!==_0x338b('0x3c')){var _0x212e8d={};_0x212e8d[_0x2f19c6[_0x338b('0x3d')]]={'$like':'%'+_0x582ad0['query'][_0x338b('0x39')]+'%'};return _0x212e8d;}})});}_0x52fb51=_['merge']({},_0x52fb51,_0x582ad0[_0x338b('0x3e')]);var _0x38cbd6={'where':_0x52fb51[_0x338b('0x36')]};return db[_0x338b('0x3f')][_0x338b('0x1a')](_0x38cbd6)[_0x338b('0x23')](function(_0x27467c){_0x712883[_0x338b('0x1a')]=_0x27467c;if(_0x582ad0[_0x338b('0x2e')][_0x338b('0x40')]){_0x52fb51['include']=[{'all':!![]}];}return db[_0x338b('0x3f')][_0x338b('0x41')](_0x52fb51);})[_0x338b('0x23')](function(_0x21c5ef){_0x712883[_0x338b('0x42')]=_0x21c5ef;return _0x712883;})[_0x338b('0x23')](respondWithFilteredResult(_0x380cc3,_0x52fb51))['catch'](handleError(_0x380cc3,null));};exports[_0x338b('0x43')]=function(_0x39a988,_0x5d9751){var _0x3a8975={'raw':!![],'where':{'id':_0x39a988['params']['id']}},_0x56fcec={};_0x56fcec[_0x338b('0x2d')]=_[_0x338b('0x2c')](db[_0x338b('0x3f')][_0x338b('0x2b')]);_0x56fcec[_0x338b('0x2e')]=_[_0x338b('0x2c')](_0x39a988[_0x338b('0x2e')]);_0x56fcec['filters']=_[_0x338b('0x30')](_0x56fcec[_0x338b('0x2d')],_0x56fcec[_0x338b('0x2e')]);_0x3a8975[_0x338b('0x2f')]=_[_0x338b('0x30')](_0x56fcec[_0x338b('0x2d')],qs[_0x338b('0x31')](_0x39a988['query'][_0x338b('0x31')]));_0x3a8975[_0x338b('0x2f')]=_0x3a8975[_0x338b('0x2f')][_0x338b('0x32')]?_0x3a8975[_0x338b('0x2f')]:_0x56fcec[_0x338b('0x2d')];if(_0x39a988[_0x338b('0x2e')][_0x338b('0x40')]){_0x3a8975['include']=[{'all':!![]}];}_0x3a8975=_[_0x338b('0x44')]({},_0x3a8975,_0x39a988[_0x338b('0x3e')]);return db[_0x338b('0x3f')]['find'](_0x3a8975)[_0x338b('0x23')](handleEntityNotFound(_0x5d9751,null))[_0x338b('0x23')](respondWithResult(_0x5d9751,null))[_0x338b('0x45')](handleError(_0x5d9751,null));};exports[_0x338b('0x46')]=function(_0x37c8b7,_0x3a7eac){return db[_0x338b('0x3f')][_0x338b('0x46')](_0x37c8b7[_0x338b('0x47')],{})[_0x338b('0x23')](respondWithResult(_0x3a7eac,0xc9))[_0x338b('0x45')](handleError(_0x3a7eac,null));};exports['update']=function(_0x5230fd,_0x4d7f3e){if(_0x5230fd[_0x338b('0x47')]['id']){delete _0x5230fd[_0x338b('0x47')]['id'];}return db[_0x338b('0x3f')][_0x338b('0x48')]({'where':{'id':_0x5230fd[_0x338b('0x49')]['id']}})[_0x338b('0x23')](handleEntityNotFound(_0x4d7f3e,null))[_0x338b('0x23')](saveUpdates(_0x5230fd[_0x338b('0x47')],null))[_0x338b('0x23')](respondWithResult(_0x4d7f3e,null))['catch'](handleError(_0x4d7f3e,null));};exports['destroy']=function(_0x4f2050,_0x4bf012){return db[_0x338b('0x3f')][_0x338b('0x48')]({'where':{'id':_0x4f2050[_0x338b('0x49')]['id']}})[_0x338b('0x23')](handleEntityNotFound(_0x4bf012,null))['then'](removeEntity(_0x4bf012,null))[_0x338b('0x45')](handleError(_0x4bf012,null));};exports[_0x338b('0x4a')]=function(_0x3d4fc9,_0x34f3fa){return db[_0x338b('0x3f')]['describe']()[_0x338b('0x23')](respondWithResult(_0x34f3fa,null))[_0x338b('0x45')](handleError(_0x34f3fa,null));}; \ No newline at end of file +var _0xa042=['nolimit','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','model','keys','query','filters','intersection','attributes','fields'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xa042,0xaa));var _0x2a04=function(_0x211003,_0x3b322b){_0x211003=_0x211003-0x0;var _0x4b57e4=_0xa042[_0x211003];return _0x4b57e4;};'use strict';var pdf=require(_0x2a04('0x0'));var emlformat=require(_0x2a04('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2a04('0x2'));var jsonpatch=require(_0x2a04('0x3'));var rp=require('request-promise');var moment=require(_0x2a04('0x4'));var BPromise=require(_0x2a04('0x5'));var Mustache=require(_0x2a04('0x6'));var util=require(_0x2a04('0x7'));var path=require('path');var sox=require(_0x2a04('0x8'));var csv=require(_0x2a04('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a04('0xa'));var squel=require(_0x2a04('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2a04('0xc'));var toCsv=require(_0x2a04('0x9'));var querystring=require(_0x2a04('0xd'));var Papa=require(_0x2a04('0xe'));var Redis=require(_0x2a04('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2a04('0x10'));var hardwareService=require(_0x2a04('0x11'));var logger=require(_0x2a04('0x12'))(_0x2a04('0x13'));var utils=require(_0x2a04('0x14'));var config=require('../../config/environment');var db=require(_0x2a04('0x15'))['db'];function respondWithStatusCode(_0x27d2bc,_0x574aae){_0x574aae=_0x574aae||0xcc;return function(_0x49fa89){if(_0x49fa89){return _0x27d2bc[_0x2a04('0x16')](_0x574aae);}return _0x27d2bc[_0x2a04('0x17')](_0x574aae)[_0x2a04('0x18')]();};}function respondWithResult(_0x32f78b,_0x48bc0b){_0x48bc0b=_0x48bc0b||0xc8;return function(_0x589ba9){if(_0x589ba9){return _0x32f78b[_0x2a04('0x17')](_0x48bc0b)[_0x2a04('0x19')](_0x589ba9);}};}function respondWithFilteredResult(_0x46cf0d,_0x4b3d6d){return function(_0x1dd21d){if(_0x1dd21d){var _0x2a0a7c=_0x1dd21d[_0x2a04('0x1a')],_0x1bc504=_0x4b3d6d[_0x2a04('0x1b')],_0x2a5442=_0x4b3d6d[_0x2a04('0x1b')]+_0x4b3d6d[_0x2a04('0x1c')],_0x15988a;if(_0x2a5442>=_0x2a0a7c){_0x2a5442=_0x2a0a7c;_0x15988a=0xc8;}else{_0x15988a=0xce;}_0x46cf0d[_0x2a04('0x17')](_0x15988a);return _0x46cf0d[_0x2a04('0x1d')](_0x2a04('0x1e'),_0x1bc504+'-'+_0x2a5442+'/'+_0x2a0a7c)[_0x2a04('0x19')](_0x1dd21d);}return null;};}function patchUpdates(_0xb5f69b){return function(_0x45b8df){try{jsonpatch[_0x2a04('0x1f')](_0x45b8df,_0xb5f69b,!![]);}catch(_0x4c7786){return BPromise[_0x2a04('0x20')](_0x4c7786);}return _0x45b8df['save']();};}function saveUpdates(_0x829908,_0x79b688){return function(_0x32bb1d){if(_0x32bb1d){return _0x32bb1d[_0x2a04('0x21')](_0x829908)[_0x2a04('0x22')](function(_0x3d0148){return _0x3d0148;});}return null;};}function removeEntity(_0x4ecf34,_0x4f27f5){return function(_0x5f4383){if(_0x5f4383){return _0x5f4383[_0x2a04('0x23')]()['then'](function(){_0x4ecf34[_0x2a04('0x17')](0xcc)[_0x2a04('0x18')]();});}};}function handleEntityNotFound(_0x3868d7,_0x2ba846){return function(_0x23fdd9){if(!_0x23fdd9){_0x3868d7[_0x2a04('0x16')](0x194);}return _0x23fdd9;};}function handleError(_0x440f65,_0x2312ae){_0x2312ae=_0x2312ae||0x1f4;return function(_0x18b9a9){logger[_0x2a04('0x24')](_0x18b9a9[_0x2a04('0x25')]);if(_0x18b9a9[_0x2a04('0x26')]){delete _0x18b9a9[_0x2a04('0x26')];}_0x440f65['status'](_0x2312ae)[_0x2a04('0x27')](_0x18b9a9);};}exports[_0x2a04('0x28')]=function(_0x50d6c0,_0x5b54fd){var _0x245a72={},_0x30fda1={},_0x21f970={'count':0x0,'rows':[]};var _0x4d9aa3=db[_0x2a04('0x29')]['rawAttributes'];_0x30fda1[_0x2a04('0x2a')]=_[_0x2a04('0x2b')](_0x4d9aa3);_0x30fda1[_0x2a04('0x2c')]=_[_0x2a04('0x2b')](_0x50d6c0[_0x2a04('0x2c')]);_0x30fda1[_0x2a04('0x2d')]=_[_0x2a04('0x2e')](_0x30fda1['model'],_0x30fda1[_0x2a04('0x2c')]);_0x245a72[_0x2a04('0x2f')]=_['intersection'](_0x30fda1[_0x2a04('0x2a')],qs['fields'](_0x50d6c0[_0x2a04('0x2c')][_0x2a04('0x30')]));_0x245a72['attributes']=_0x245a72[_0x2a04('0x2f')]['length']?_0x245a72[_0x2a04('0x2f')]:_0x30fda1[_0x2a04('0x2a')];if(!_0x50d6c0['query']['hasOwnProperty'](_0x2a04('0x31'))){_0x245a72[_0x2a04('0x1c')]=qs[_0x2a04('0x1c')](_0x50d6c0[_0x2a04('0x2c')][_0x2a04('0x1c')]);_0x245a72[_0x2a04('0x1b')]=qs[_0x2a04('0x1b')](_0x50d6c0[_0x2a04('0x2c')][_0x2a04('0x1b')]);}_0x245a72['order']=qs[_0x2a04('0x32')](_0x50d6c0['query'][_0x2a04('0x32')]);_0x245a72['where']=qs[_0x2a04('0x2d')](_[_0x2a04('0x33')](_0x50d6c0[_0x2a04('0x2c')],_0x30fda1[_0x2a04('0x2d')]));if(_0x50d6c0['query'][_0x2a04('0x34')]){_0x245a72['where']=_['merge'](_0x245a72[_0x2a04('0x35')],{'$or':_[_0x2a04('0x36')](_0x4d9aa3,function(_0x1b6927){if(_0x1b6927[_0x2a04('0x37')][_0x2a04('0x38')]!==_0x2a04('0x39')){var _0x3c49f6={};_0x3c49f6[_0x1b6927[_0x2a04('0x3a')]]={'$like':'%'+_0x50d6c0[_0x2a04('0x2c')][_0x2a04('0x34')]+'%'};return _0x3c49f6;}})});}_0x245a72=_[_0x2a04('0x3b')]({},_0x245a72,_0x50d6c0[_0x2a04('0x3c')]);var _0xe0a45d={'where':_0x245a72[_0x2a04('0x35')]};return db['ChatOfflineMessage'][_0x2a04('0x1a')](_0xe0a45d)['then'](function(_0x579fc1){_0x21f970['count']=_0x579fc1;if(_0x50d6c0[_0x2a04('0x2c')][_0x2a04('0x3d')]){_0x245a72[_0x2a04('0x3e')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x2a04('0x3f')](_0x245a72);})['then'](function(_0xac55ae){_0x21f970[_0x2a04('0x40')]=_0xac55ae;return _0x21f970;})['then'](respondWithFilteredResult(_0x5b54fd,_0x245a72))[_0x2a04('0x41')](handleError(_0x5b54fd,null));};exports[_0x2a04('0x42')]=function(_0x24a402,_0x5a3930){var _0x594e3b={'raw':!![],'where':{'id':_0x24a402['params']['id']}},_0x545ea8={};_0x545ea8[_0x2a04('0x2a')]=_[_0x2a04('0x2b')](db[_0x2a04('0x29')]['rawAttributes']);_0x545ea8['query']=_[_0x2a04('0x2b')](_0x24a402['query']);_0x545ea8['filters']=_[_0x2a04('0x2e')](_0x545ea8[_0x2a04('0x2a')],_0x545ea8[_0x2a04('0x2c')]);_0x594e3b[_0x2a04('0x2f')]=_[_0x2a04('0x2e')](_0x545ea8['model'],qs[_0x2a04('0x30')](_0x24a402[_0x2a04('0x2c')][_0x2a04('0x30')]));_0x594e3b[_0x2a04('0x2f')]=_0x594e3b[_0x2a04('0x2f')][_0x2a04('0x43')]?_0x594e3b[_0x2a04('0x2f')]:_0x545ea8[_0x2a04('0x2a')];if(_0x24a402['query'][_0x2a04('0x3d')]){_0x594e3b[_0x2a04('0x3e')]=[{'all':!![]}];}_0x594e3b=_['merge']({},_0x594e3b,_0x24a402[_0x2a04('0x3c')]);return db[_0x2a04('0x29')]['find'](_0x594e3b)[_0x2a04('0x22')](handleEntityNotFound(_0x5a3930,null))[_0x2a04('0x22')](respondWithResult(_0x5a3930,null))[_0x2a04('0x41')](handleError(_0x5a3930,null));};exports['create']=function(_0x544cad,_0x59c010){return db[_0x2a04('0x29')][_0x2a04('0x44')](_0x544cad['body'],{})['then'](respondWithResult(_0x59c010,0xc9))[_0x2a04('0x41')](handleError(_0x59c010,null));};exports['update']=function(_0x129537,_0x3a7d00){if(_0x129537['body']['id']){delete _0x129537[_0x2a04('0x45')]['id'];}return db['ChatOfflineMessage'][_0x2a04('0x46')]({'where':{'id':_0x129537[_0x2a04('0x47')]['id']}})[_0x2a04('0x22')](handleEntityNotFound(_0x3a7d00,null))[_0x2a04('0x22')](saveUpdates(_0x129537[_0x2a04('0x45')],null))[_0x2a04('0x22')](respondWithResult(_0x3a7d00,null))[_0x2a04('0x41')](handleError(_0x3a7d00,null));};exports[_0x2a04('0x23')]=function(_0x519ec8,_0x2802d4){return db[_0x2a04('0x29')][_0x2a04('0x46')]({'where':{'id':_0x519ec8['params']['id']}})[_0x2a04('0x22')](handleEntityNotFound(_0x2802d4,null))[_0x2a04('0x22')](removeEntity(_0x2802d4,null))[_0x2a04('0x41')](handleError(_0x2802d4,null));};exports[_0x2a04('0x48')]=function(_0x35cce0,_0x10800e){return db[_0x2a04('0x29')]['describe']()[_0x2a04('0x22')](respondWithResult(_0x10800e,null))[_0x2a04('0x41')](handleError(_0x10800e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 97a1046..ea46f32 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 _0xbd75=['util','api','bluebird','request-promise','path','rimraf','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x441dfb,_0x94dcc3){var _0x465d59=function(_0x53cb47){while(--_0x53cb47){_0x441dfb['push'](_0x441dfb['shift']());}};_0x465d59(++_0x94dcc3);}(_0xbd75,0x190));var _0x5bd7=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xbd75[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0x5bd7('0x0'));var logger=require('../../config/logger')(_0x5bd7('0x1'));var moment=require('moment');var BPromise=require(_0x5bd7('0x2'));var rp=require(_0x5bd7('0x3'));var fs=require('fs');var path=require(_0x5bd7('0x4'));var rimraf=require(_0x5bd7('0x5'));var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x3d6ea6,_0x35850b){return _0x3d6ea6[_0x5bd7('0x6')](_0x5bd7('0x7'),attributes,{'tableName':_0x5bd7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5bd7('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x307d=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatOfflineMessage.attributes','exports'];(function(_0x18d466,_0x26a30a){var _0x368767=function(_0x1402d1){while(--_0x1402d1){_0x18d466['push'](_0x18d466['shift']());}};_0x368767(++_0x26a30a);}(_0x307d,0x163));var _0xd307=function(_0x3c6a0d,_0x4f2f75){_0x3c6a0d=_0x3c6a0d-0x0;var _0x11b3f0=_0x307d[_0x3c6a0d];return _0x11b3f0;};'use strict';var _=require('lodash');var util=require(_0xd307('0x0'));var logger=require(_0xd307('0x1'))(_0xd307('0x2'));var moment=require(_0xd307('0x3'));var BPromise=require(_0xd307('0x4'));var rp=require(_0xd307('0x5'));var fs=require('fs');var path=require(_0xd307('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd307('0x7'));module[_0xd307('0x8')]=function(_0x2ca87b,_0x3e36dc){return _0x2ca87b[_0xd307('0x9')](_0xd307('0xa'),attributes,{'tableName':_0xd307('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd307('0xc'),'collate':_0xd307('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6712eb8..dc5e3c8 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 _0x15e9=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x15e9,0xb3));var _0x915e=function(_0x37ba22,_0x57750a){_0x37ba22=_0x37ba22-0x0;var _0x5b78bb=_0x15e9[_0x37ba22];return _0x5b78bb;};'use strict';var _=require(_0x915e('0x0'));var util=require(_0x915e('0x1'));var moment=require(_0x915e('0x2'));var BPromise=require(_0x915e('0x3'));var rs=require(_0x915e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x915e('0x5'));var logger=require(_0x915e('0x6'))(_0x915e('0x7'));var config=require(_0x915e('0x8'));var jayson=require(_0x915e('0x9'));var client=jayson[_0x915e('0xa')][_0x915e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x256411,_0x273884,_0x43fb6f){return new BPromise(function(_0x562dcc,_0x599ef6){return client[_0x915e('0xc')](_0x256411,_0x43fb6f)['then'](function(_0xe18f65){logger['info'](_0x915e('0xd'),_0x273884,'request\x20sent');logger['debug'](_0x915e('0xe'),_0x273884,_0x915e('0xf'),JSON['stringify'](_0xe18f65));if(_0xe18f65[_0x915e('0x10')]){if(_0xe18f65['error'][_0x915e('0x11')]===0x1f4){logger[_0x915e('0x10')](_0x915e('0xd'),_0x273884,_0xe18f65[_0x915e('0x10')][_0x915e('0x12')]);return _0x599ef6(_0xe18f65['error'][_0x915e('0x12')]);}logger['error'](_0x915e('0xd'),_0x273884,_0xe18f65[_0x915e('0x10')]['message']);return _0x562dcc(_0xe18f65[_0x915e('0x10')][_0x915e('0x12')]);}else{logger[_0x915e('0x13')](_0x915e('0xd'),_0x273884,_0x915e('0xf'));_0x562dcc(_0xe18f65[_0x915e('0x14')]['message']);}})[_0x915e('0x15')](function(_0x437c00){logger[_0x915e('0x10')](_0x915e('0xd'),_0x273884,_0x437c00);_0x599ef6(_0x437c00);});});} \ No newline at end of file +var _0x28cf=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x5d3e52,_0x2de2f6){var _0xdcd7fa=function(_0xee1a0){while(--_0xee1a0){_0x5d3e52['push'](_0x5d3e52['shift']());}};_0xdcd7fa(++_0x2de2f6);}(_0x28cf,0x164));var _0xf28c=function(_0xb51db3,_0x4c09b6){_0xb51db3=_0xb51db3-0x0;var _0x54ca89=_0x28cf[_0xb51db3];return _0x54ca89;};'use strict';var _=require(_0xf28c('0x0'));var util=require(_0xf28c('0x1'));var moment=require(_0xf28c('0x2'));var BPromise=require(_0xf28c('0x3'));var rs=require(_0xf28c('0x4'));var fs=require('fs');var Redis=require(_0xf28c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf28c('0x6'));var logger=require(_0xf28c('0x7'))(_0xf28c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf28c('0x9'));var client=jayson[_0xf28c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462a96,_0x3f597c,_0x4edce3){return new BPromise(function(_0x447f78,_0x11a3ec){return client[_0xf28c('0xb')](_0x462a96,_0x4edce3)['then'](function(_0x3b0cf8){logger[_0xf28c('0xc')](_0xf28c('0xd'),_0x3f597c,_0xf28c('0xe'));logger[_0xf28c('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3f597c,_0xf28c('0xe'),JSON[_0xf28c('0x10')](_0x3b0cf8));if(_0x3b0cf8[_0xf28c('0x11')]){if(_0x3b0cf8['error']['code']===0x1f4){logger[_0xf28c('0x11')](_0xf28c('0xd'),_0x3f597c,_0x3b0cf8[_0xf28c('0x11')]['message']);return _0x11a3ec(_0x3b0cf8[_0xf28c('0x11')][_0xf28c('0x12')]);}logger[_0xf28c('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3f597c,_0x3b0cf8[_0xf28c('0x11')][_0xf28c('0x12')]);return _0x447f78(_0x3b0cf8[_0xf28c('0x11')][_0xf28c('0x12')]);}else{logger['info'](_0xf28c('0xd'),_0x3f597c,'request\x20sent');_0x447f78(_0x3b0cf8[_0xf28c('0x13')][_0xf28c('0x12')]);}})[_0xf28c('0x14')](function(_0x1ccebb){logger[_0xf28c('0x11')](_0xf28c('0xd'),_0x3f597c,_0x1ccebb);_0x11a3ec(_0x1ccebb);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c19278b..0f6fa77 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 _0x8d53=['describe','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0x8d53,0x1c2));var _0x38d5=function(_0x2d1f3d,_0x4f80d7){_0x2d1f3d=_0x2d1f3d-0x0;var _0x5bf52c=_0x8d53[_0x2d1f3d];return _0x5bf52c;};'use strict';var multer=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var path=require('path');var timeout=require(_0x38d5('0x2'));var express=require(_0x38d5('0x3'));var router=express[_0x38d5('0x4')]();var auth=require(_0x38d5('0x5'));var interaction=require(_0x38d5('0x6'));var config=require(_0x38d5('0x7'));var controller=require(_0x38d5('0x8'));router[_0x38d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x38d5('0xa')]);router[_0x38d5('0x9')](_0x38d5('0xb'),auth['isAuthenticated'](),controller[_0x38d5('0xc')]);router[_0x38d5('0x9')](_0x38d5('0xd'),auth[_0x38d5('0xe')](),controller[_0x38d5('0xf')]);router['post']('/',auth[_0x38d5('0xe')](),controller[_0x38d5('0x10')]);router['put'](_0x38d5('0xd'),auth[_0x38d5('0xe')](),controller[_0x38d5('0x11')]);router[_0x38d5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x38d5('0x13')]);module[_0x38d5('0x14')]=router; \ No newline at end of file +var _0x0a12=['update','delete','destroy','exports','util','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x5af5a8,_0x10ce33){var _0x414545=function(_0xb57b5c){while(--_0xb57b5c){_0x5af5a8['push'](_0x5af5a8['shift']());}};_0x414545(++_0x10ce33);}(_0x0a12,0xb8));var _0x20a1=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x0a12[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require('multer');var util=require(_0x20a1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20a1('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x20a1('0x2'));var config=require(_0x20a1('0x3'));var controller=require(_0x20a1('0x4'));router[_0x20a1('0x5')]('/',auth[_0x20a1('0x6')](),controller[_0x20a1('0x7')]);router[_0x20a1('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x20a1('0x8')]);router['get']('/:id',auth[_0x20a1('0x6')](),controller[_0x20a1('0x9')]);router[_0x20a1('0xa')]('/',auth[_0x20a1('0x6')](),controller[_0x20a1('0xb')]);router[_0x20a1('0xc')](_0x20a1('0xd'),auth['isAuthenticated'](),controller[_0x20a1('0xe')]);router[_0x20a1('0xf')](_0x20a1('0xd'),auth[_0x20a1('0x6')](),controller[_0x20a1('0x10')]);module[_0x20a1('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index b59a355..67131a5 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 _0xd954=['exports','STRING','mouseOver','INTEGER'];(function(_0x374a23,_0x395566){var _0x3e4078=function(_0x58b1c8){while(--_0x58b1c8){_0x374a23['push'](_0x374a23['shift']());}};_0x3e4078(++_0x395566);}(_0xd954,0x7c));var _0x4d95=function(_0x263afc,_0x41913f){_0x263afc=_0x263afc-0x0;var _0x5956eb=_0xd954[_0x263afc];return _0x5956eb;};'use strict';var Sequelize=require('sequelize');module[_0x4d95('0x0')]={'name':{'type':Sequelize[_0x4d95('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4d95('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4d95('0x3')]}}; \ No newline at end of file +var _0xe62e=['timeout','sequelize','exports','STRING','ENUM'];(function(_0x4da6bb,_0x15086b){var _0x192169=function(_0x2f4c11){while(--_0x2f4c11){_0x4da6bb['push'](_0x4da6bb['shift']());}};_0x192169(++_0x15086b);}(_0xe62e,0x173));var _0xee62=function(_0x565569,_0x5c0375){_0x565569=_0x565569-0x0;var _0x1ac5da=_0xe62e[_0x565569];return _0x1ac5da;};'use strict';var Sequelize=require(_0xee62('0x0'));module[_0xee62('0x1')]={'name':{'type':Sequelize[_0xee62('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xee62('0x3')]('mouseOver',_0xee62('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xee62('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index fb4f635..d3cfb92 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 _0x472f=['length','merge','options','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','end','error','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields'];(function(_0x354a4f,_0x2558cc){var _0x14efb2=function(_0x39d8b1){while(--_0x39d8b1){_0x354a4f['push'](_0x354a4f['shift']());}};_0x14efb2(++_0x2558cc);}(_0x472f,0x16d));var _0xf472=function(_0x568628,_0x41be96){_0x568628=_0x568628-0x0;var _0x571ae7=_0x472f[_0x568628];return _0x571ae7;};'use strict';var pdf=require(_0xf472('0x0'));var emlformat=require(_0xf472('0x1'));var rimraf=require(_0xf472('0x2'));var zipdir=require(_0xf472('0x3'));var jsonpatch=require(_0xf472('0x4'));var rp=require(_0xf472('0x5'));var moment=require(_0xf472('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf472('0x7'));var csv=require(_0xf472('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf472('0x9'));var crypto=require(_0xf472('0xa'));var jsforce=require(_0xf472('0xb'));var deskjs=require(_0xf472('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf472('0xd'));var Papa=require(_0xf472('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf472('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xf472('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fe8f9,_0x23eeea){_0x23eeea=_0x23eeea||0xcc;return function(_0x3d8328){if(_0x3d8328){return _0x4fe8f9[_0xf472('0x11')](_0x23eeea);}return _0x4fe8f9[_0xf472('0x12')](_0x23eeea)['end']();};}function respondWithResult(_0x1254df,_0x13ca74){_0x13ca74=_0x13ca74||0xc8;return function(_0x151da2){if(_0x151da2){return _0x1254df[_0xf472('0x12')](_0x13ca74)[_0xf472('0x13')](_0x151da2);}};}function respondWithFilteredResult(_0x1b8093,_0x23daf7){return function(_0x5a5586){if(_0x5a5586){var _0x4fc515=_0x5a5586[_0xf472('0x14')],_0x3815e1=_0x23daf7[_0xf472('0x15')],_0x1de524=_0x23daf7[_0xf472('0x15')]+_0x23daf7[_0xf472('0x16')],_0x2522e0;if(_0x1de524>=_0x4fc515){_0x1de524=_0x4fc515;_0x2522e0=0xc8;}else{_0x2522e0=0xce;}_0x1b8093['status'](_0x2522e0);return _0x1b8093['set'](_0xf472('0x17'),_0x3815e1+'-'+_0x1de524+'/'+_0x4fc515)[_0xf472('0x13')](_0x5a5586);}return null;};}function patchUpdates(_0x5705e0){return function(_0x29e0db){try{jsonpatch[_0xf472('0x18')](_0x29e0db,_0x5705e0,!![]);}catch(_0x16020f){return BPromise[_0xf472('0x19')](_0x16020f);}return _0x29e0db[_0xf472('0x1a')]();};}function saveUpdates(_0x50c8f4,_0x40c0f7){return function(_0x3b6749){if(_0x3b6749){return _0x3b6749[_0xf472('0x1b')](_0x50c8f4)[_0xf472('0x1c')](function(_0x40f10f){return _0x40f10f;});}return null;};}function removeEntity(_0x8474dc,_0x53a3a9){return function(_0x39bf58){if(_0x39bf58){return _0x39bf58['destroy']()[_0xf472('0x1c')](function(){_0x8474dc[_0xf472('0x12')](0xcc)[_0xf472('0x1d')]();});}};}function handleEntityNotFound(_0xcd6e7d,_0x152382){return function(_0x59c2fa){if(!_0x59c2fa){_0xcd6e7d['sendStatus'](0x194);}return _0x59c2fa;};}function handleError(_0x14fbc8,_0x5e5ea6){_0x5e5ea6=_0x5e5ea6||0x1f4;return function(_0x5bab60){logger[_0xf472('0x1e')](_0x5bab60['stack']);if(_0x5bab60[_0xf472('0x1f')]){delete _0x5bab60['name'];}_0x14fbc8[_0xf472('0x12')](_0x5e5ea6)[_0xf472('0x20')](_0x5bab60);};}exports['show']=function(_0xc70517,_0x480959){var _0x3a18be={'raw':!![],'where':{'id':_0xc70517[_0xf472('0x21')]['id']}},_0x15623a={};_0x15623a[_0xf472('0x22')]=_['keys'](db[_0xf472('0x23')][_0xf472('0x24')]);_0x15623a[_0xf472('0x25')]=_[_0xf472('0x26')](_0xc70517[_0xf472('0x25')]);_0x15623a[_0xf472('0x27')]=_[_0xf472('0x28')](_0x15623a[_0xf472('0x22')],_0x15623a['query']);_0x3a18be[_0xf472('0x29')]=_[_0xf472('0x28')](_0x15623a[_0xf472('0x22')],qs[_0xf472('0x2a')](_0xc70517[_0xf472('0x25')]['fields']));_0x3a18be[_0xf472('0x29')]=_0x3a18be['attributes'][_0xf472('0x2b')]?_0x3a18be[_0xf472('0x29')]:_0x15623a[_0xf472('0x22')];if(_0xc70517[_0xf472('0x25')]['includeAll']){_0x3a18be['include']=[{'all':!![]}];}_0x3a18be=_[_0xf472('0x2c')]({},_0x3a18be,_0xc70517[_0xf472('0x2d')]);return db[_0xf472('0x23')][_0xf472('0x2e')](_0x3a18be)[_0xf472('0x1c')](handleEntityNotFound(_0x480959,null))['then'](respondWithResult(_0x480959,null))[_0xf472('0x2f')](handleError(_0x480959,null));};exports[_0xf472('0x30')]=function(_0x404e91,_0x3dd5ec){return db[_0xf472('0x23')][_0xf472('0x30')](_0x404e91[_0xf472('0x31')],{})[_0xf472('0x1c')](respondWithResult(_0x3dd5ec,0xc9))[_0xf472('0x2f')](handleError(_0x3dd5ec,null));};exports[_0xf472('0x1b')]=function(_0x3899ba,_0x283c59){if(_0x3899ba['body']['id']){delete _0x3899ba[_0xf472('0x31')]['id'];}return db[_0xf472('0x23')][_0xf472('0x2e')]({'where':{'id':_0x3899ba[_0xf472('0x21')]['id']}})[_0xf472('0x1c')](handleEntityNotFound(_0x283c59,null))['then'](saveUpdates(_0x3899ba[_0xf472('0x31')],null))['then'](respondWithResult(_0x283c59,null))[_0xf472('0x2f')](handleError(_0x283c59,null));};exports[_0xf472('0x32')]=function(_0x1a95bf,_0x5da5ad){return db[_0xf472('0x23')][_0xf472('0x2e')]({'where':{'id':_0x1a95bf[_0xf472('0x21')]['id']}})['then'](handleEntityNotFound(_0x5da5ad,null))[_0xf472('0x1c')](removeEntity(_0x5da5ad,null))['catch'](handleError(_0x5da5ad,null));}; \ No newline at end of file +var _0x55e9=['includeAll','include','options','find','catch','create','body','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','fields'];(function(_0x210494,_0x540734){var _0x1add29=function(_0x3c4459){while(--_0x3c4459){_0x210494['push'](_0x210494['shift']());}};_0x1add29(++_0x540734);}(_0x55e9,0x6d));var _0x955e=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0x55e9[_0x146dd7];return _0x2af0bb;};'use strict';var pdf=require(_0x955e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x955e('0x1'));var jsonpatch=require(_0x955e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x955e('0x3'));var Mustache=require(_0x955e('0x4'));var util=require(_0x955e('0x5'));var path=require(_0x955e('0x6'));var sox=require(_0x955e('0x7'));var csv=require(_0x955e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x955e('0x9'));var squel=require(_0x955e('0xa'));var crypto=require(_0x955e('0xb'));var jsforce=require(_0x955e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x955e('0x8'));var querystring=require('querystring');var Papa=require(_0x955e('0xd'));var Redis=require(_0x955e('0xe'));var authService=require(_0x955e('0xf'));var qs=require(_0x955e('0x10'));var hardwareService=require(_0x955e('0x11'));var logger=require('../../config/logger')(_0x955e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x146d95,_0x6353eb){_0x6353eb=_0x6353eb||0xcc;return function(_0x2b6901){if(_0x2b6901){return _0x146d95['sendStatus'](_0x6353eb);}return _0x146d95[_0x955e('0x13')](_0x6353eb)[_0x955e('0x14')]();};}function respondWithResult(_0x452ba1,_0x4b97fc){_0x4b97fc=_0x4b97fc||0xc8;return function(_0xb39cf9){if(_0xb39cf9){return _0x452ba1['status'](_0x4b97fc)[_0x955e('0x15')](_0xb39cf9);}};}function respondWithFilteredResult(_0x5a3d45,_0x43e2f8){return function(_0x31251a){if(_0x31251a){var _0x5165a3=_0x31251a[_0x955e('0x16')],_0x187a19=_0x43e2f8[_0x955e('0x17')],_0x30eef5=_0x43e2f8[_0x955e('0x17')]+_0x43e2f8[_0x955e('0x18')],_0xb25c5d;if(_0x30eef5>=_0x5165a3){_0x30eef5=_0x5165a3;_0xb25c5d=0xc8;}else{_0xb25c5d=0xce;}_0x5a3d45[_0x955e('0x13')](_0xb25c5d);return _0x5a3d45[_0x955e('0x19')]('Content-Range',_0x187a19+'-'+_0x30eef5+'/'+_0x5165a3)[_0x955e('0x15')](_0x31251a);}return null;};}function patchUpdates(_0x2dc95a){return function(_0x56dfea){try{jsonpatch[_0x955e('0x1a')](_0x56dfea,_0x2dc95a,!![]);}catch(_0x283e4b){return BPromise['reject'](_0x283e4b);}return _0x56dfea[_0x955e('0x1b')]();};}function saveUpdates(_0xbfcfe2,_0x367513){return function(_0x131759){if(_0x131759){return _0x131759[_0x955e('0x1c')](_0xbfcfe2)[_0x955e('0x1d')](function(_0x1e701e){return _0x1e701e;});}return null;};}function removeEntity(_0x311b5b,_0x51ee9c){return function(_0x4ee5ad){if(_0x4ee5ad){return _0x4ee5ad[_0x955e('0x1e')]()['then'](function(){_0x311b5b[_0x955e('0x13')](0xcc)[_0x955e('0x14')]();});}};}function handleEntityNotFound(_0x3d7242,_0x490226){return function(_0x73c70d){if(!_0x73c70d){_0x3d7242[_0x955e('0x1f')](0x194);}return _0x73c70d;};}function handleError(_0x5203f5,_0x294831){_0x294831=_0x294831||0x1f4;return function(_0x11c77c){logger[_0x955e('0x20')](_0x11c77c['stack']);if(_0x11c77c['name']){delete _0x11c77c[_0x955e('0x21')];}_0x5203f5[_0x955e('0x13')](_0x294831)['send'](_0x11c77c);};}exports[_0x955e('0x22')]=function(_0xf4398b,_0x1d9886){var _0x47c4a6={'raw':!![],'where':{'id':_0xf4398b[_0x955e('0x23')]['id']}},_0x23ccb9={};_0x23ccb9['model']=_[_0x955e('0x24')](db[_0x955e('0x25')][_0x955e('0x26')]);_0x23ccb9[_0x955e('0x27')]=_[_0x955e('0x24')](_0xf4398b[_0x955e('0x27')]);_0x23ccb9[_0x955e('0x28')]=_['intersection'](_0x23ccb9[_0x955e('0x29')],_0x23ccb9[_0x955e('0x27')]);_0x47c4a6[_0x955e('0x2a')]=_['intersection'](_0x23ccb9[_0x955e('0x29')],qs[_0x955e('0x2b')](_0xf4398b[_0x955e('0x27')][_0x955e('0x2b')]));_0x47c4a6['attributes']=_0x47c4a6[_0x955e('0x2a')]['length']?_0x47c4a6['attributes']:_0x23ccb9[_0x955e('0x29')];if(_0xf4398b[_0x955e('0x27')][_0x955e('0x2c')]){_0x47c4a6[_0x955e('0x2d')]=[{'all':!![]}];}_0x47c4a6=_['merge']({},_0x47c4a6,_0xf4398b[_0x955e('0x2e')]);return db[_0x955e('0x25')][_0x955e('0x2f')](_0x47c4a6)[_0x955e('0x1d')](handleEntityNotFound(_0x1d9886,null))[_0x955e('0x1d')](respondWithResult(_0x1d9886,null))[_0x955e('0x30')](handleError(_0x1d9886,null));};exports[_0x955e('0x31')]=function(_0x37fe9c,_0x1e6e17){return db['ChatProactiveAction'][_0x955e('0x31')](_0x37fe9c['body'],{})['then'](respondWithResult(_0x1e6e17,0xc9))[_0x955e('0x30')](handleError(_0x1e6e17,null));};exports[_0x955e('0x1c')]=function(_0x24ba32,_0x5dd668){if(_0x24ba32[_0x955e('0x32')]['id']){delete _0x24ba32[_0x955e('0x32')]['id'];}return db[_0x955e('0x25')][_0x955e('0x2f')]({'where':{'id':_0x24ba32['params']['id']}})[_0x955e('0x1d')](handleEntityNotFound(_0x5dd668,null))['then'](saveUpdates(_0x24ba32[_0x955e('0x32')],null))[_0x955e('0x1d')](respondWithResult(_0x5dd668,null))[_0x955e('0x30')](handleError(_0x5dd668,null));};exports[_0x955e('0x1e')]=function(_0x3d911e,_0x9c5c37){return db[_0x955e('0x25')][_0x955e('0x2f')]({'where':{'id':_0x3d911e[_0x955e('0x23')]['id']}})[_0x955e('0x1d')](handleEntityNotFound(_0x9c5c37,null))['then'](removeEntity(_0x9c5c37,null))[_0x955e('0x30')](handleError(_0x9c5c37,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c8f2ad8..94c6dcb 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 _0x28f4=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util'];(function(_0x2f9be1,_0x37c18c){var _0x599b4d=function(_0x111d45){while(--_0x111d45){_0x2f9be1['push'](_0x2f9be1['shift']());}};_0x599b4d(++_0x37c18c);}(_0x28f4,0x136));var _0x428f=function(_0xe4b413,_0xc42f3e){_0xe4b413=_0xe4b413-0x0;var _0x3d1a58=_0x28f4[_0xe4b413];return _0x3d1a58;};'use strict';var _=require(_0x428f('0x0'));var util=require(_0x428f('0x1'));var logger=require(_0x428f('0x2'))('api');var moment=require(_0x428f('0x3'));var BPromise=require(_0x428f('0x4'));var rp=require(_0x428f('0x5'));var fs=require('fs');var path=require(_0x428f('0x6'));var rimraf=require(_0x428f('0x7'));var config=require(_0x428f('0x8'));var attributes=require(_0x428f('0x9'));module[_0x428f('0xa')]=function(_0x4e00ac,_0xb67027){return _0x4e00ac['define'](_0x428f('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4389=['api','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x4389,0xae));var _0x9438=function(_0x54fc15,_0x5d8d7d){_0x54fc15=_0x54fc15-0x0;var _0x4e49ca=_0x4389[_0x54fc15];return _0x4e49ca;};'use strict';var _=require(_0x9438('0x0'));var util=require('util');var logger=require(_0x9438('0x1'))(_0x9438('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9438('0x3'));var fs=require('fs');var path=require(_0x9438('0x4'));var rimraf=require(_0x9438('0x5'));var config=require(_0x9438('0x6'));var attributes=require(_0x9438('0x7'));module[_0x9438('0x8')]=function(_0x33a9c0,_0x5605d1){return _0x33a9c0[_0x9438('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x9438('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 884eb02..7b57bb9 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38321a,_0x20ec4e){var _0x28e6ce=function(_0x1b1a86){while(--_0x1b1a86){_0x38321a['push'](_0x38321a['shift']());}};_0x28e6ce(++_0x20ec4e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x31b982,_0x17fc46){var _0x858376=function(_0x58a39b){while(--_0x58a39b){_0x31b982['push'](_0x31b982['shift']());}};_0x858376(++_0x17fc46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index dea008e..fed7e5c 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 _0x0b70=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create','/:id','update','delete','destroy','exports'];(function(_0x5a637d,_0x122ff6){var _0x10102a=function(_0x444b6a){while(--_0x444b6a){_0x5a637d['push'](_0x5a637d['shift']());}};_0x10102a(++_0x122ff6);}(_0x0b70,0x159));var _0x00b7=function(_0x3bb96e,_0xdc7992){_0x3bb96e=_0x3bb96e-0x0;var _0x1a6739=_0x0b70[_0x3bb96e];return _0x1a6739;};'use strict';var multer=require('multer');var util=require(_0x00b7('0x0'));var path=require('path');var timeout=require(_0x00b7('0x1'));var express=require(_0x00b7('0x2'));var router=express['Router']();var auth=require(_0x00b7('0x3'));var interaction=require(_0x00b7('0x4'));var config=require(_0x00b7('0x5'));var controller=require('./chatProactiveAction.controller');router[_0x00b7('0x6')]('/:id',auth[_0x00b7('0x7')](),controller['show']);router[_0x00b7('0x8')]('/',auth['isAuthenticated'](),controller[_0x00b7('0x9')]);router['put'](_0x00b7('0xa'),auth[_0x00b7('0x7')](),controller[_0x00b7('0xb')]);router[_0x00b7('0xc')]('/:id',auth[_0x00b7('0x7')](),controller[_0x00b7('0xd')]);module[_0x00b7('0xe')]=router; \ No newline at end of file +var _0x6947=['get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./chatProactiveAction.controller'];(function(_0xaa8b63,_0x3a6a0c){var _0x5baf89=function(_0x245576){while(--_0x245576){_0xaa8b63['push'](_0xaa8b63['shift']());}};_0x5baf89(++_0x3a6a0c);}(_0x6947,0x72));var _0x7694=function(_0x3d3c1b,_0x3c8104){_0x3d3c1b=_0x3d3c1b-0x0;var _0x3df45e=_0x6947[_0x3d3c1b];return _0x3df45e;};'use strict';var multer=require('multer');var util=require(_0x7694('0x0'));var path=require('path');var timeout=require(_0x7694('0x1'));var express=require(_0x7694('0x2'));var router=express[_0x7694('0x3')]();var auth=require(_0x7694('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7694('0x5'));router[_0x7694('0x6')](_0x7694('0x7'),auth[_0x7694('0x8')](),controller[_0x7694('0x9')]);router[_0x7694('0xa')]('/',auth['isAuthenticated'](),controller[_0x7694('0xb')]);router['put'](_0x7694('0x7'),auth[_0x7694('0x8')](),controller['update']);router[_0x7694('0xc')](_0x7694('0x7'),auth[_0x7694('0x8')](),controller[_0x7694('0xd')]);module[_0x7694('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index ec5efee..7fe9675 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 _0x06cf=['STRING','INTEGER','exports'];(function(_0x363dee,_0x4d1a44){var _0x31ae44=function(_0x1a3727){while(--_0x1a3727){_0x363dee['push'](_0x363dee['shift']());}};_0x31ae44(++_0x4d1a44);}(_0x06cf,0xc2));var _0xf06c=function(_0x5d60b2,_0x16df51){_0x5d60b2=_0x5d60b2-0x0;var _0x2cb7bc=_0x06cf[_0x5d60b2];return _0x2cb7bc;};'use strict';var Sequelize=require('sequelize');module[_0xf06c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf06c('0x1')]},'timeout':{'type':Sequelize[_0xf06c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x1237=['name','INTEGER','ENUM','sequelize','STRING'];(function(_0x631129,_0x4df278){var _0x234b2a=function(_0x34aca8){while(--_0x34aca8){_0x631129['push'](_0x631129['shift']());}};_0x234b2a(++_0x4df278);}(_0x1237,0x71));var _0x7123=function(_0x425df3,_0x22a189){_0x425df3=_0x425df3-0x0;var _0x4e6926=_0x1237[_0x425df3];return _0x4e6926;};'use strict';var Sequelize=require(_0x7123('0x0'));module['exports']={'name':{'type':Sequelize[_0x7123('0x1')],'unique':_0x7123('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7123('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7123('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 161fb7e..2a472e8 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 _0x10dd=['findAll','rows','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','chatPause','createdAt','getTeams','Team','order','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','ids','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','all','compact','value','removeTeams','addAgents','spread','removeAgents','userChatQueue:remove','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filters','map','type','key','VIRTUAL','field','filter','merge','ChatQueue','count','includeAll','include'];(function(_0x44786e,_0x5370f4){var _0x2aacd5=function(_0xe5bfdf){while(--_0xe5bfdf){_0x44786e['push'](_0x44786e['shift']());}};_0x2aacd5(++_0x5370f4);}(_0x10dd,0xda));var _0xd10d=function(_0x578334,_0x24462f){_0x578334=_0x578334-0x0;var _0x3dd454=_0x10dd[_0x578334];return _0x3dd454;};'use strict';var pdf=require(_0xd10d('0x0'));var emlformat=require(_0xd10d('0x1'));var rimraf=require(_0xd10d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd10d('0x3'));var rp=require(_0xd10d('0x4'));var moment=require(_0xd10d('0x5'));var BPromise=require(_0xd10d('0x6'));var Mustache=require(_0xd10d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd10d('0x8'));var csv=require(_0xd10d('0x9'));var ejs=require(_0xd10d('0xa'));var fs=require('fs');var _=require(_0xd10d('0xb'));var squel=require(_0xd10d('0xc'));var crypto=require('crypto');var jsforce=require(_0xd10d('0xd'));var deskjs=require(_0xd10d('0xe'));var toCsv=require(_0xd10d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd10d('0xf'));var authService=require(_0xd10d('0x10'));var qs=require(_0xd10d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd10d('0x12'))(_0xd10d('0x13'));var utils=require(_0xd10d('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd10d('0x15')]=_[_0xd10d('0x16')](config[_0xd10d('0x15')],{'host':_0xd10d('0x17'),'port':0x18eb});var socket=require(_0xd10d('0x18'))(new Redis(config[_0xd10d('0x15')]));require(_0xd10d('0x19'))[_0xd10d('0x1a')](socket);var jayson=require(_0xd10d('0x1b'));var client=jayson[_0xd10d('0x1c')][_0xd10d('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1691d5,_0x4769dc,_0x4c83a0){if(_0x4c83a0){var _0x3fbfbc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fbfbc[_0xd10d('0x1e')](_0x4769dc)){return _0x1691d5;}else{throw new Error(_0xd10d('0x1f'));}}else{return _0x1691d5;}}function respondWithRpcPromise(_0x5afedd,_0x33ae48,_0x2e90c9,_0x45cb48){return new BPromise(function(_0x194a5e,_0x16bbb0){var _0x1d4fd6=_0x45cb48||client;return _0x1d4fd6[_0xd10d('0x20')](_0x5afedd,_0x2e90c9)[_0xd10d('0x21')](function(_0x37d2d5){logger[_0xd10d('0x22')](_0xd10d('0x23'),_0x33ae48,_0xd10d('0x24'));logger[_0xd10d('0x25')](_0xd10d('0x26'),_0x33ae48,_0xd10d('0x24'),JSON['stringify'](_0x37d2d5));if(_0x37d2d5[_0xd10d('0x27')]){if(_0x37d2d5[_0xd10d('0x27')][_0xd10d('0x28')]===0x1f4){logger[_0xd10d('0x27')](_0xd10d('0x23'),_0x33ae48,_0x37d2d5[_0xd10d('0x27')][_0xd10d('0x29')]);return _0x16bbb0(_0x37d2d5[_0xd10d('0x27')][_0xd10d('0x29')]);}logger[_0xd10d('0x27')](_0xd10d('0x23'),_0x33ae48,_0x37d2d5[_0xd10d('0x27')][_0xd10d('0x29')]);return _0x194a5e(_0x37d2d5[_0xd10d('0x27')]['message']);}else{logger[_0xd10d('0x22')](_0xd10d('0x23'),_0x33ae48,'request\x20sent');_0x194a5e(_0x37d2d5[_0xd10d('0x2a')]['message']);}})[_0xd10d('0x2b')](function(_0x2f9c8b){logger[_0xd10d('0x27')]('ChatQueue,\x20%s,\x20%s',_0x33ae48,_0x2f9c8b);_0x16bbb0(_0x2f9c8b);});});}function respondWithStatusCode(_0x505d56,_0x515d8e){_0x515d8e=_0x515d8e||0xcc;return function(_0x31c752){if(_0x31c752){return _0x505d56['sendStatus'](_0x515d8e);}return _0x505d56[_0xd10d('0x2c')](_0x515d8e)[_0xd10d('0x2d')]();};}function respondWithResult(_0x1d4ed1,_0x457fb5){_0x457fb5=_0x457fb5||0xc8;return function(_0x2cfc72){if(_0x2cfc72){return _0x1d4ed1[_0xd10d('0x2c')](_0x457fb5)[_0xd10d('0x2e')](_0x2cfc72);}};}function respondWithFilteredResult(_0x8e3eb0,_0x3f2604){return function(_0x4f21ed){if(_0x4f21ed){var _0x15d78f=_0x4f21ed['count'],_0x437e11=_0x3f2604[_0xd10d('0x2f')],_0x3f8fdf=_0x3f2604[_0xd10d('0x2f')]+_0x3f2604['limit'],_0x43a9c8;if(_0x3f8fdf>=_0x15d78f){_0x3f8fdf=_0x15d78f;_0x43a9c8=0xc8;}else{_0x43a9c8=0xce;}_0x8e3eb0[_0xd10d('0x2c')](_0x43a9c8);return _0x8e3eb0[_0xd10d('0x30')](_0xd10d('0x31'),_0x437e11+'-'+_0x3f8fdf+'/'+_0x15d78f)['json'](_0x4f21ed);}return null;};}function patchUpdates(_0x1d7393){return function(_0x144d1a){try{jsonpatch[_0xd10d('0x32')](_0x144d1a,_0x1d7393,!![]);}catch(_0x18dcb7){return BPromise[_0xd10d('0x33')](_0x18dcb7);}return _0x144d1a[_0xd10d('0x34')]();};}function saveUpdates(_0x18631f,_0x4aff11){return function(_0x459388){if(_0x459388){return _0x459388[_0xd10d('0x35')](_0x18631f)[_0xd10d('0x21')](function(_0x50fbb3){return _0x50fbb3;});}return null;};}function removeEntity(_0x29e155,_0x2f2dc9){return function(_0x26f02c){if(_0x26f02c){return _0x26f02c[_0xd10d('0x36')]()[_0xd10d('0x21')](function(){var _0x33168d=_0x26f02c[_0xd10d('0x37')]({'plain':!![]});var _0x27cc63=_0xd10d('0x38');return db[_0xd10d('0x39')][_0xd10d('0x36')]({'where':{'type':_0x27cc63,'resourceId':_0x33168d['id']}})[_0xd10d('0x21')](function(){return _0x26f02c;});})[_0xd10d('0x21')](function(){_0x29e155[_0xd10d('0x2c')](0xcc)[_0xd10d('0x2d')]();});}};}function handleEntityNotFound(_0x3e0146,_0x3b142b){return function(_0x260f7c){if(!_0x260f7c){_0x3e0146[_0xd10d('0x3a')](0x194);}return _0x260f7c;};}function handleError(_0xfd8ec5,_0x4b87eb){_0x4b87eb=_0x4b87eb||0x1f4;return function(_0x1017bd){logger[_0xd10d('0x27')](_0x1017bd[_0xd10d('0x3b')]);if(_0x1017bd[_0xd10d('0x3c')]){delete _0x1017bd[_0xd10d('0x3c')];}_0xfd8ec5[_0xd10d('0x2c')](_0x4b87eb)[_0xd10d('0x3d')](_0x1017bd);};}exports['index']=function(_0x1061fd,_0x99088f){var _0x2dbcca={},_0x58ac4b={},_0x31ad9d={'count':0x0,'rows':[]};var _0x42f11a=db['ChatQueue']['rawAttributes'];_0x58ac4b['model']=_[_0xd10d('0x3e')](_0x42f11a);_0x58ac4b[_0xd10d('0x3f')]=_[_0xd10d('0x3e')](_0x1061fd[_0xd10d('0x3f')]);_0x58ac4b['filters']=_['intersection'](_0x58ac4b[_0xd10d('0x40')],_0x58ac4b[_0xd10d('0x3f')]);_0x2dbcca[_0xd10d('0x41')]=_[_0xd10d('0x42')](_0x58ac4b['model'],qs[_0xd10d('0x43')](_0x1061fd['query'][_0xd10d('0x43')]));_0x2dbcca[_0xd10d('0x41')]=_0x2dbcca[_0xd10d('0x41')][_0xd10d('0x44')]?_0x2dbcca[_0xd10d('0x41')]:_0x58ac4b[_0xd10d('0x40')];if(!_0x1061fd[_0xd10d('0x3f')][_0xd10d('0x45')]('nolimit')){_0x2dbcca[_0xd10d('0x46')]=qs[_0xd10d('0x46')](_0x1061fd[_0xd10d('0x3f')]['limit']);_0x2dbcca[_0xd10d('0x2f')]=qs['offset'](_0x1061fd[_0xd10d('0x3f')][_0xd10d('0x2f')]);}_0x2dbcca['order']=qs[_0xd10d('0x47')](_0x1061fd[_0xd10d('0x3f')][_0xd10d('0x47')]);_0x2dbcca[_0xd10d('0x48')]=qs['filters'](_[_0xd10d('0x49')](_0x1061fd[_0xd10d('0x3f')],_0x58ac4b[_0xd10d('0x4a')]));if(_0x1061fd[_0xd10d('0x3f')]['filter']){_0x2dbcca[_0xd10d('0x48')]=_['merge'](_0x2dbcca[_0xd10d('0x48')],{'$or':_[_0xd10d('0x4b')](_0x42f11a,function(_0x1c41dd){if(_0x1c41dd[_0xd10d('0x4c')][_0xd10d('0x4d')]!==_0xd10d('0x4e')){var _0x2a8e42={};_0x2a8e42[_0x1c41dd[_0xd10d('0x4f')]]={'$like':'%'+_0x1061fd[_0xd10d('0x3f')][_0xd10d('0x50')]+'%'};return _0x2a8e42;}})});}_0x2dbcca=_[_0xd10d('0x51')]({},_0x2dbcca,_0x1061fd['options']);var _0x5c37c2={'where':_0x2dbcca[_0xd10d('0x48')]};return db[_0xd10d('0x52')][_0xd10d('0x53')](_0x5c37c2)[_0xd10d('0x21')](function(_0x47a803){_0x31ad9d[_0xd10d('0x53')]=_0x47a803;if(_0x1061fd['query'][_0xd10d('0x54')]){_0x2dbcca[_0xd10d('0x55')]=[{'all':!![]}];}return db[_0xd10d('0x52')][_0xd10d('0x56')](_0x2dbcca);})['then'](function(_0x1781cb){_0x31ad9d[_0xd10d('0x57')]=_0x1781cb;return _0x31ad9d;})[_0xd10d('0x21')](respondWithFilteredResult(_0x99088f,_0x2dbcca))['catch'](handleError(_0x99088f,null));};exports[_0xd10d('0x58')]=function(_0x85bbe6,_0x31b647){var _0x346fd9={'raw':!![],'where':{'id':_0x85bbe6[_0xd10d('0x59')]['id']}},_0x1f7c98={};_0x1f7c98[_0xd10d('0x40')]=_[_0xd10d('0x3e')](db[_0xd10d('0x52')][_0xd10d('0x5a')]);_0x1f7c98[_0xd10d('0x3f')]=_[_0xd10d('0x3e')](_0x85bbe6['query']);_0x1f7c98[_0xd10d('0x4a')]=_[_0xd10d('0x42')](_0x1f7c98['model'],_0x1f7c98['query']);_0x346fd9[_0xd10d('0x41')]=_[_0xd10d('0x42')](_0x1f7c98[_0xd10d('0x40')],qs[_0xd10d('0x43')](_0x85bbe6['query']['fields']));_0x346fd9[_0xd10d('0x41')]=_0x346fd9[_0xd10d('0x41')][_0xd10d('0x44')]?_0x346fd9[_0xd10d('0x41')]:_0x1f7c98['model'];if(_0x85bbe6[_0xd10d('0x3f')][_0xd10d('0x54')]){_0x346fd9[_0xd10d('0x55')]=[{'all':!![]}];}_0x346fd9=_['merge']({},_0x346fd9,_0x85bbe6[_0xd10d('0x5b')]);return db[_0xd10d('0x52')]['find'](_0x346fd9)['then'](handleEntityNotFound(_0x31b647,null))['then'](respondWithResult(_0x31b647,null))[_0xd10d('0x2b')](handleError(_0x31b647,null));};exports[_0xd10d('0x5c')]=function(_0x3a19ba,_0x1952f4){return db[_0xd10d('0x52')][_0xd10d('0x5c')](_0x3a19ba[_0xd10d('0x5d')],{})[_0xd10d('0x21')](function(_0x4355ec){var _0x304234=_0x3a19ba[_0xd10d('0x5e')]['get']({'plain':!![]});if(!_0x304234)throw new Error(_0xd10d('0x5f'));if(_0x304234[_0xd10d('0x60')]===_0xd10d('0x5e')){var _0x4adb3a=_0x4355ec[_0xd10d('0x37')]({'plain':!![]});var _0x1b7720=_0xd10d('0x38');return db[_0xd10d('0x61')][_0xd10d('0x62')]({'where':{'name':_0x1b7720,'userProfileId':_0x304234[_0xd10d('0x63')]},'raw':!![]})[_0xd10d('0x21')](function(_0x4e2e3e){if(_0x4e2e3e&&_0x4e2e3e[_0xd10d('0x64')]===0x0){return db[_0xd10d('0x39')][_0xd10d('0x5c')]({'name':_0x4adb3a[_0xd10d('0x3c')],'resourceId':_0x4adb3a['id'],'type':_0x4e2e3e[_0xd10d('0x3c')],'sectionId':_0x4e2e3e['id']},{})['then'](function(){return _0x4355ec;});}else{return _0x4355ec;}})[_0xd10d('0x2b')](function(_0x525ec8){logger[_0xd10d('0x27')](_0xd10d('0x65'),_0x525ec8);throw _0x525ec8;});}return _0x4355ec;})[_0xd10d('0x21')](respondWithResult(_0x1952f4,0xc9))['catch'](handleError(_0x1952f4,null));};exports['update']=function(_0x79a1bc,_0x5b6b63){if(_0x79a1bc[_0xd10d('0x5d')]['id']){delete _0x79a1bc[_0xd10d('0x5d')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x79a1bc[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](handleEntityNotFound(_0x5b6b63,null))[_0xd10d('0x21')](saveUpdates(_0x79a1bc['body'],null))['then'](respondWithResult(_0x5b6b63,null))[_0xd10d('0x2b')](handleError(_0x5b6b63,null));};exports[_0xd10d('0x36')]=function(_0x9fbc6d,_0x356ac3){return db[_0xd10d('0x52')]['find']({'where':{'id':_0x9fbc6d[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](handleEntityNotFound(_0x356ac3,null))['then'](removeEntity(_0x356ac3,null))[_0xd10d('0x2b')](handleError(_0x356ac3,null));};exports[_0xd10d('0x66')]=function(_0x3dc65f,_0x53312f){return db[_0xd10d('0x52')][_0xd10d('0x66')]()[_0xd10d('0x21')](respondWithResult(_0x53312f,null))[_0xd10d('0x2b')](handleError(_0x53312f,null));};exports[_0xd10d('0x67')]=function(_0x20137d,_0x4e4f22,_0x9f17fb){var _0x1ece84={'raw':!![],'where':{}},_0x20e1c6={},_0x2a07f7;return db[_0xd10d('0x52')][_0xd10d('0x68')]({'where':{'id':_0x20137d['params']['id']}})[_0xd10d('0x21')](handleEntityNotFound(_0x4e4f22,null))['then'](function(_0x4a073d){if(_0x4a073d){_0x2a07f7=_0x4a073d[_0xd10d('0x37')]({'plain':!![]});_0x20e1c6[_0xd10d('0x40')]=_['keys'](db[_0xd10d('0x69')]['rawAttributes']);_0x20e1c6[_0xd10d('0x3f')]=_[_0xd10d('0x3e')](_0x20137d[_0xd10d('0x3f')]);_0x20e1c6[_0xd10d('0x4a')]=_[_0xd10d('0x42')](_0x20e1c6['model'],_0x20e1c6[_0xd10d('0x3f')]);_0x1ece84[_0xd10d('0x41')]=_[_0xd10d('0x42')](_0x20e1c6[_0xd10d('0x40')],qs[_0xd10d('0x43')](_0x20137d['query'][_0xd10d('0x43')]));_0x1ece84[_0xd10d('0x41')]=_0x1ece84[_0xd10d('0x41')]['length']?_0x1ece84[_0xd10d('0x41')]:_0x20e1c6[_0xd10d('0x40')];if(!_0x20137d[_0xd10d('0x3f')]['hasOwnProperty'](_0xd10d('0x6a'))){_0x1ece84[_0xd10d('0x46')]=qs[_0xd10d('0x46')](_0x20137d[_0xd10d('0x3f')]['limit']);_0x1ece84['offset']=qs['offset'](_0x20137d[_0xd10d('0x3f')]['offset']);}_0x1ece84['order']=qs[_0xd10d('0x47')](_0x20137d[_0xd10d('0x3f')][_0xd10d('0x47')]);_0x1ece84['where']=qs[_0xd10d('0x4a')](_[_0xd10d('0x49')](_0x20137d[_0xd10d('0x3f')],_0x20e1c6[_0xd10d('0x4a')]));_0x1ece84[_0xd10d('0x48')]['ChatQueueId']=_0x4a073d['id'];if(_0x20137d[_0xd10d('0x3f')][_0xd10d('0x50')]){_0x1ece84['where']=_[_0xd10d('0x51')](_0x1ece84[_0xd10d('0x48')],{'$or':_[_0xd10d('0x4b')](_0x1ece84[_0xd10d('0x41')],function(_0x44ac49){var _0x8217f9={};_0x8217f9[_0x44ac49]={'$like':'%'+_0x20137d[_0xd10d('0x3f')][_0xd10d('0x50')]+'%'};return _0x8217f9;})});}_0x1ece84=_['merge']({},_0x1ece84,_0x20137d['options']);return db[_0xd10d('0x69')][_0xd10d('0x56')](_0x1ece84);}})[_0xd10d('0x21')](function(_0x349ec1){if(_0x349ec1){return db[_0xd10d('0x6b')][_0xd10d('0x6c')]({'where':{'id':_[_0xd10d('0x4b')](_0x349ec1,_0xd10d('0x6d')),'role':_0xd10d('0x6e')},'attributes':['id','name','chatPause',_0xd10d('0x6f'),'createdAt']});}})[_0xd10d('0x21')](function(_0x2046b0){if(_0x2046b0){return{'count':_0x2046b0['count'],'rows':_[_0xd10d('0x4b')](_0x2046b0[_0xd10d('0x57')],function(_0x4dec1c){return{'membername':_0x4dec1c[_0xd10d('0x3c')],'UserId':_0x4dec1c['id'],'queue_name':_0x2a07f7['name'],'ChatQueueId':_0x2a07f7['id'],'interface':util[_0xd10d('0x70')](_0xd10d('0x71'),'SIP',_0x4dec1c[_0xd10d('0x3c')]),'penalty':0x0,'paused':_0x4dec1c[_0xd10d('0x72')],'createdAt':_0x4dec1c[_0xd10d('0x73')],'updatedAt':_0x4dec1c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd10d('0x21')](respondWithFilteredResult(_0x4e4f22,_0x1ece84))['catch'](handleError(_0x4e4f22,null));};exports[_0xd10d('0x74')]=function(_0x1bf1a3,_0x1bb756,_0x1b25dc){var _0x1c06ba={};var _0x570292={};var _0xf502f4;var _0x121d7c;return db[_0xd10d('0x52')][_0xd10d('0x68')]({'where':{'id':_0x1bf1a3[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](handleEntityNotFound(_0x1bb756,null))['then'](function(_0x26b194){if(_0x26b194){_0xf502f4=_0x26b194;_0x570292['model']=_[_0xd10d('0x3e')](db[_0xd10d('0x75')][_0xd10d('0x5a')]);_0x570292[_0xd10d('0x3f')]=_[_0xd10d('0x3e')](_0x1bf1a3[_0xd10d('0x3f')]);_0x570292[_0xd10d('0x4a')]=_[_0xd10d('0x42')](_0x570292['model'],_0x570292[_0xd10d('0x3f')]);_0x1c06ba[_0xd10d('0x41')]=_[_0xd10d('0x42')](_0x570292['model'],qs['fields'](_0x1bf1a3[_0xd10d('0x3f')]['fields']));_0x1c06ba[_0xd10d('0x41')]=_0x1c06ba[_0xd10d('0x41')][_0xd10d('0x44')]?_0x1c06ba[_0xd10d('0x41')]:_0x570292['model'];_0x1c06ba[_0xd10d('0x76')]=qs[_0xd10d('0x47')](_0x1bf1a3[_0xd10d('0x3f')][_0xd10d('0x47')]);_0x1c06ba['where']=qs['filters'](_[_0xd10d('0x49')](_0x1bf1a3[_0xd10d('0x3f')],_0x570292[_0xd10d('0x4a')]));if(_0x1bf1a3[_0xd10d('0x3f')][_0xd10d('0x50')]){_0x1c06ba[_0xd10d('0x48')]=_[_0xd10d('0x51')](_0x1c06ba[_0xd10d('0x48')],{'$or':_[_0xd10d('0x4b')](_0x1c06ba[_0xd10d('0x41')],function(_0x339a0e){var _0x926212={};_0x926212[_0x339a0e]={'$like':'%'+_0x1bf1a3['query'][_0xd10d('0x50')]+'%'};return _0x926212;})});}_0x1c06ba=_[_0xd10d('0x51')]({},_0x1c06ba,_0x1bf1a3[_0xd10d('0x5b')]);return _0xf502f4[_0xd10d('0x74')](_0x1c06ba);}})[_0xd10d('0x21')](function(_0x2548ce){if(_0x2548ce){_0x121d7c=_0x2548ce[_0xd10d('0x44')];if(!_0x1bf1a3['query'][_0xd10d('0x45')](_0xd10d('0x6a'))){_0x1c06ba[_0xd10d('0x46')]=qs[_0xd10d('0x46')](_0x1bf1a3[_0xd10d('0x3f')]['limit']);_0x1c06ba['offset']=qs[_0xd10d('0x2f')](_0x1bf1a3[_0xd10d('0x3f')]['offset']);}return _0xf502f4['getTeams'](_0x1c06ba);}})['then'](function(_0xbfbd9){if(_0xbfbd9){return _0xbfbd9?{'count':_0x121d7c,'rows':_0xbfbd9}:null;}})[_0xd10d('0x21')](respondWithResult(_0x1bb756,null))[_0xd10d('0x2b')](handleError(_0x1bb756,null));};exports[_0xd10d('0x77')]=function(_0x572efd,_0x55e1e2,_0x559268){var _0x2c10f9=_0x572efd['body']['teams'];return db[_0xd10d('0x75')]['findAll']({'where':{'id':_['map'](_0x2c10f9,'id')},'attributes':['id'],'include':[{'model':db[_0xd10d('0x6b')],'as':'Agents','attributes':['id',_0xd10d('0x3c'),_0xd10d('0x78'),_0xd10d('0x79'),_0xd10d('0x7a')],'raw':!![]}]})[_0xd10d('0x21')](function(_0x4030a4){if(_0x4030a4){var _0x2ac8b4=_[_0xd10d('0x7b')](_0x4030a4,function(_0x2b4ee7){var _0x133383=_0x2b4ee7[_0xd10d('0x37')]({'plain':!![]});return _0x133383[_0xd10d('0x7c')];});return db[_0xd10d('0x52')][_0xd10d('0x62')]({'where':{'id':_0x572efd[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](function(_0x815f09){return db[_0xd10d('0x7d')][_0xd10d('0x7e')](function(_0x5b7d0c){return _0x815f09[_0xd10d('0x77')](_[_0xd10d('0x4b')](_0x2c10f9,'id'),{'transaction':_0x5b7d0c})[_0xd10d('0x21')](function(){return BPromise[_0xd10d('0x7f')](_0x2ac8b4,function(_0x24c77c){return db[_0xd10d('0x69')][_0xd10d('0x80')]({'where':{'UserId':_0x24c77c['id'],'ChatQueueId':_0x572efd['params']['id']},'transaction':_0x5b7d0c});});})[_0xd10d('0x21')](function(){_0x2ac8b4[_0xd10d('0x81')](function(_0x51dc78){socket[_0xd10d('0x82')](_0xd10d('0x83'),{'UserId':_0x51dc78['id'],'ChatQueueId':_0x815f09['id']});});});});});}})[_0xd10d('0x21')](respondWithStatusCode(_0x55e1e2,null))[_0xd10d('0x2b')](handleError(_0x55e1e2,null));};exports['removeTeams']=function(_0x4c5f1c,_0x2fe58e,_0x2af9cb){return db[_0xd10d('0x75')][_0xd10d('0x56')]({'where':{'id':_0x4c5f1c[_0xd10d('0x3f')][_0xd10d('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd10d('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2fe58e,null))[_0xd10d('0x21')](function(_0x5e6c69){var _0x199671=_[_0xd10d('0x4b')](_0x5e6c69,'id');var _0x52b6f7=[];var _0xbfe2fe=[];var _0xc7413d=squel[_0xd10d('0x85')]();_0xc7413d[_0xd10d('0x4f')](_0xd10d('0x86'))['from'](_0xd10d('0x87'),'tq')[_0xd10d('0x88')](_0xd10d('0x89'),'ut',_0xd10d('0x8a'))[_0xd10d('0x48')]('ChatQueueId\x20=\x20?',_0x4c5f1c[_0xd10d('0x59')]['id']);for(var _0x40c777=0x0;_0x40c777<_0x5e6c69['length'];_0x40c777+=0x1){let _0xf8becb=_0x5e6c69[_0x40c777];for(var _0x11a15b=0x0;_0x11a15b<_0xf8becb[_0xd10d('0x7c')][_0xd10d('0x44')];_0x11a15b+=0x1){let _0x19cf42=_0xf8becb[_0xd10d('0x7c')][_0x11a15b];var _0xf48701=_0xc7413d[_0xd10d('0x8b')]();_0xf48701['where'](_0xd10d('0x8c'),_0x19cf42['id']);_0xbfe2fe[_0xd10d('0x8d')](db[_0xd10d('0x7d')][_0xd10d('0x3f')](_0xf48701['toString'](),{'type':db[_0xd10d('0x7d')][_0xd10d('0x8e')]['SELECT']})[_0xd10d('0x21')](function(_0x3e97a3){if(_0x3e97a3[_0xd10d('0x44')]===0x1){return _0x19cf42['id'];}else{var _0x589ec9=_['every'](_[_0xd10d('0x4b')](_0x3e97a3,_0xd10d('0x8f')),function(_0xcbfe6){return _['includes'](_0x199671,_0xcbfe6);});if(_0x589ec9){return _0x19cf42['id'];}}}));}}return BPromise[_0xd10d('0x90')](_0xbfe2fe)[_0xd10d('0x21')](function(_0x1503dc){_0x52b6f7=_(_0x52b6f7)['union'](_0x1503dc)[_0xd10d('0x91')]()[_0xd10d('0x92')]();return db[_0xd10d('0x52')][_0xd10d('0x62')]({'where':{'id':_0x4c5f1c[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](function(_0xe220a6){return db[_0xd10d('0x7d')]['transaction'](function(_0x1d1b71){return _0xe220a6[_0xd10d('0x93')](_0x4c5f1c[_0xd10d('0x3f')][_0xd10d('0x84')],{'transaction':_0x1d1b71})[_0xd10d('0x21')](function(){if(!_['isEmpty'](_0x52b6f7)){return _0xe220a6['removeAgents'](_0x52b6f7,{'transaction':_0x1d1b71});}})[_0xd10d('0x21')](function(){_0x52b6f7[_0xd10d('0x81')](function(_0x161f1a){socket[_0xd10d('0x82')]('userChatQueue:remove',{'UserId':_0x161f1a,'ChatQueueId':_0xe220a6['id']});});});});});});})[_0xd10d('0x21')](respondWithStatusCode(_0x2fe58e,null))[_0xd10d('0x2b')](handleError(_0x2fe58e,null));};exports['addAgents']=function(_0x212eca,_0x3f3a9a,_0x51d00f){return db['ChatQueue'][_0xd10d('0x62')]({'where':{'id':_0x212eca[_0xd10d('0x59')]['id']}})['then'](handleEntityNotFound(_0x3f3a9a,null))[_0xd10d('0x21')](function(_0x164a5f){if(_0x164a5f){return _0x164a5f[_0xd10d('0x94')](_0x212eca[_0xd10d('0x5d')][_0xd10d('0x84')],_['omit'](_0x212eca[_0xd10d('0x5d')],[_0xd10d('0x84'),'id'])||{})[_0xd10d('0x95')](function(_0xd57308){for(var _0x385167=0x0;_0x385167<_0x212eca[_0xd10d('0x5d')]['ids']['length'];_0x385167+=0x1){socket[_0xd10d('0x82')](_0xd10d('0x83'),{'UserId':_0x212eca['body'][_0xd10d('0x84')][_0x385167],'ChatQueueId':_0x212eca[_0xd10d('0x59')]['id']});}return _0xd57308;});}})[_0xd10d('0x21')](respondWithResult(_0x3f3a9a,null))[_0xd10d('0x2b')](handleError(_0x3f3a9a,null));};exports[_0xd10d('0x96')]=function(_0x31f8d0,_0x2496ce,_0x29a466){return db[_0xd10d('0x52')]['find']({'where':{'id':_0x31f8d0['params']['id']}})['then'](handleEntityNotFound(_0x2496ce,null))[_0xd10d('0x21')](function(_0x401191){if(_0x401191){return _0x401191[_0xd10d('0x96')](_0x31f8d0['query'][_0xd10d('0x84')])[_0xd10d('0x21')](function(){if(_['isArray'](_0x31f8d0[_0xd10d('0x3f')]['ids'])){for(var _0x48b44f=0x0;_0x48b44f<_0x31f8d0[_0xd10d('0x3f')][_0xd10d('0x84')][_0xd10d('0x44')];_0x48b44f+=0x1){socket[_0xd10d('0x82')](_0xd10d('0x97'),{'UserId':Number(_0x31f8d0[_0xd10d('0x3f')][_0xd10d('0x84')][_0x48b44f]),'ChatQueueId':Number(_0x31f8d0[_0xd10d('0x59')]['id'])});}}else{socket['emit'](_0xd10d('0x97'),{'UserId':Number(_0x31f8d0['query'][_0xd10d('0x84')]),'ChatQueueId':Number(_0x31f8d0[_0xd10d('0x59')]['id'])});}});}})[_0xd10d('0x21')](respondWithStatusCode(_0x2496ce,null))['catch'](handleError(_0x2496ce,null));};exports['getAgents']=function(_0x1c8188,_0x718dd6,_0x559f45){var _0x5806d2={};var _0x2d9042={};var _0x4eed82;var _0x531b5a;return db[_0xd10d('0x52')][_0xd10d('0x68')]({'where':{'id':_0x1c8188[_0xd10d('0x59')]['id']}})[_0xd10d('0x21')](handleEntityNotFound(_0x718dd6,null))[_0xd10d('0x21')](function(_0x4f335a){if(_0x4f335a){_0x4eed82=_0x4f335a;_0x2d9042[_0xd10d('0x40')]=_[_0xd10d('0x3e')](db[_0xd10d('0x6b')][_0xd10d('0x5a')]);_0x2d9042['query']=_['keys'](_0x1c8188[_0xd10d('0x3f')]);_0x2d9042['filters']=_[_0xd10d('0x42')](_0x2d9042['model'],_0x2d9042['query']);_0x5806d2[_0xd10d('0x41')]=_[_0xd10d('0x42')](_0x2d9042['model'],qs['fields'](_0x1c8188[_0xd10d('0x3f')]['fields']));_0x5806d2[_0xd10d('0x41')]=_0x5806d2[_0xd10d('0x41')]['length']?_0x5806d2[_0xd10d('0x41')]:_0x2d9042['model'];_0x5806d2[_0xd10d('0x76')]=qs[_0xd10d('0x47')](_0x1c8188['query']['sort']);_0x5806d2[_0xd10d('0x48')]=qs[_0xd10d('0x4a')](_[_0xd10d('0x49')](_0x1c8188[_0xd10d('0x3f')],_0x2d9042[_0xd10d('0x4a')]));if(_0x1c8188[_0xd10d('0x3f')][_0xd10d('0x50')]){_0x5806d2[_0xd10d('0x48')]=_[_0xd10d('0x51')](_0x5806d2[_0xd10d('0x48')],{'$or':_[_0xd10d('0x4b')](_0x5806d2['attributes'],function(_0x4e015d){var _0x1d648a={};_0x1d648a[_0x4e015d]={'$like':'%'+_0x1c8188['query']['filter']+'%'};return _0x1d648a;})});}_0x5806d2=_['merge']({},_0x5806d2,_0x1c8188[_0xd10d('0x5b')]);return _0x4eed82['getAgents'](_0x5806d2);}})[_0xd10d('0x21')](function(_0x39b03c){if(_0x39b03c){_0x531b5a=_0x39b03c[_0xd10d('0x44')];if(!_0x1c8188[_0xd10d('0x3f')][_0xd10d('0x45')]('nolimit')){_0x5806d2[_0xd10d('0x46')]=qs[_0xd10d('0x46')](_0x1c8188[_0xd10d('0x3f')][_0xd10d('0x46')]);_0x5806d2[_0xd10d('0x2f')]=qs['offset'](_0x1c8188[_0xd10d('0x3f')][_0xd10d('0x2f')]);}return _0x4eed82['getAgents'](_0x5806d2);}})['then'](function(_0x358937){if(_0x358937){return _0x358937?{'count':_0x531b5a,'rows':_0x358937}:null;}})[_0xd10d('0x21')](respondWithResult(_0x718dd6,null))[_0xd10d('0x2b')](handleError(_0x718dd6,null));}; \ No newline at end of file +var _0x02f6=['select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','addAgents','omit','removeAgents','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','end','status','count','offset','limit','set','Content-Range','json','update','then','destroy','ChatQueues','UserProfileResource','sendStatus','send','index','ChatQueue','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','rows','params','fields','find','create','user','get','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','findAll','findAndCountAll','UserId','chatPause','createdAt','SIP','updatedAt','getTeams','Team','addTeams','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','User','Agents'];(function(_0x1afb2d,_0x220057){var _0x4b0b99=function(_0x26aacc){while(--_0x26aacc){_0x1afb2d['push'](_0x1afb2d['shift']());}};_0x4b0b99(++_0x220057);}(_0x02f6,0xb3));var _0x602f=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x02f6[_0x251e8c];return _0x1e0c1d;};'use strict';var pdf=require(_0x602f('0x0'));var emlformat=require(_0x602f('0x1'));var rimraf=require(_0x602f('0x2'));var zipdir=require(_0x602f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x602f('0x4'));var moment=require(_0x602f('0x5'));var BPromise=require(_0x602f('0x6'));var Mustache=require('mustache');var util=require(_0x602f('0x7'));var path=require(_0x602f('0x8'));var sox=require(_0x602f('0x9'));var csv=require('to-csv');var ejs=require(_0x602f('0xa'));var fs=require('fs');var _=require(_0x602f('0xb'));var squel=require(_0x602f('0xc'));var crypto=require(_0x602f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x602f('0xe'));var toCsv=require(_0x602f('0xf'));var querystring=require(_0x602f('0x10'));var Papa=require(_0x602f('0x11'));var Redis=require(_0x602f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x602f('0x13'));var hardwareService=require(_0x602f('0x14'));var logger=require(_0x602f('0x15'))(_0x602f('0x16'));var utils=require(_0x602f('0x17'));var config=require(_0x602f('0x18'));var db=require(_0x602f('0x19'))['db'];config[_0x602f('0x1a')]=_[_0x602f('0x1b')](config[_0x602f('0x1a')],{'host':_0x602f('0x1c'),'port':0x18eb});var socket=require(_0x602f('0x1d'))(new Redis(config[_0x602f('0x1a')]));require(_0x602f('0x1e'))[_0x602f('0x1f')](socket);var jayson=require(_0x602f('0x20'));var client=jayson[_0x602f('0x21')][_0x602f('0x22')]({'port':0x232a});function checkPasswordPattern(_0x33e544,_0x3e4c51,_0x40cacb){if(_0x40cacb){var _0x12b99e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12b99e[_0x602f('0x23')](_0x3e4c51)){return _0x33e544;}else{throw new Error(_0x602f('0x24'));}}else{return _0x33e544;}}function respondWithRpcPromise(_0x26cf75,_0x58152d,_0x5eba3f,_0x44415d){return new BPromise(function(_0x292c1a,_0x4a3d03){var _0x12865a=_0x44415d||client;return _0x12865a[_0x602f('0x25')](_0x26cf75,_0x5eba3f)['then'](function(_0x8aa6a2){logger['info'](_0x602f('0x26'),_0x58152d,_0x602f('0x27'));logger[_0x602f('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x58152d,_0x602f('0x27'),JSON[_0x602f('0x29')](_0x8aa6a2));if(_0x8aa6a2[_0x602f('0x2a')]){if(_0x8aa6a2[_0x602f('0x2a')][_0x602f('0x2b')]===0x1f4){logger[_0x602f('0x2a')](_0x602f('0x26'),_0x58152d,_0x8aa6a2[_0x602f('0x2a')][_0x602f('0x2c')]);return _0x4a3d03(_0x8aa6a2[_0x602f('0x2a')][_0x602f('0x2c')]);}logger[_0x602f('0x2a')](_0x602f('0x26'),_0x58152d,_0x8aa6a2['error'][_0x602f('0x2c')]);return _0x292c1a(_0x8aa6a2[_0x602f('0x2a')][_0x602f('0x2c')]);}else{logger[_0x602f('0x2d')](_0x602f('0x26'),_0x58152d,_0x602f('0x27'));_0x292c1a(_0x8aa6a2['result']['message']);}})[_0x602f('0x2e')](function(_0x11da31){logger[_0x602f('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x58152d,_0x11da31);_0x4a3d03(_0x11da31);});});}function respondWithStatusCode(_0x2f48fa,_0x528dbe){_0x528dbe=_0x528dbe||0xcc;return function(_0x4aa4b1){if(_0x4aa4b1){return _0x2f48fa['sendStatus'](_0x528dbe);}return _0x2f48fa['status'](_0x528dbe)[_0x602f('0x2f')]();};}function respondWithResult(_0x59b45c,_0x3a4731){_0x3a4731=_0x3a4731||0xc8;return function(_0xff4716){if(_0xff4716){return _0x59b45c[_0x602f('0x30')](_0x3a4731)['json'](_0xff4716);}};}function respondWithFilteredResult(_0x36343b,_0x7e4315){return function(_0x3d27eb){if(_0x3d27eb){var _0x25903b=_0x3d27eb[_0x602f('0x31')],_0x41c7e4=_0x7e4315[_0x602f('0x32')],_0x18ccd5=_0x7e4315[_0x602f('0x32')]+_0x7e4315[_0x602f('0x33')],_0x92d606;if(_0x18ccd5>=_0x25903b){_0x18ccd5=_0x25903b;_0x92d606=0xc8;}else{_0x92d606=0xce;}_0x36343b[_0x602f('0x30')](_0x92d606);return _0x36343b[_0x602f('0x34')](_0x602f('0x35'),_0x41c7e4+'-'+_0x18ccd5+'/'+_0x25903b)[_0x602f('0x36')](_0x3d27eb);}return null;};}function patchUpdates(_0x3121b7){return function(_0x4b68be){try{jsonpatch['apply'](_0x4b68be,_0x3121b7,!![]);}catch(_0x5e1ada){return BPromise['reject'](_0x5e1ada);}return _0x4b68be['save']();};}function saveUpdates(_0x47113d,_0x5d9718){return function(_0x43d4ba){if(_0x43d4ba){return _0x43d4ba[_0x602f('0x37')](_0x47113d)[_0x602f('0x38')](function(_0xc044a2){return _0xc044a2;});}return null;};}function removeEntity(_0x5885d7,_0x4849){return function(_0x152f50){if(_0x152f50){return _0x152f50[_0x602f('0x39')]()[_0x602f('0x38')](function(){var _0x48ca82=_0x152f50['get']({'plain':!![]});var _0x6a1053=_0x602f('0x3a');return db[_0x602f('0x3b')][_0x602f('0x39')]({'where':{'type':_0x6a1053,'resourceId':_0x48ca82['id']}})['then'](function(){return _0x152f50;});})['then'](function(){_0x5885d7['status'](0xcc)[_0x602f('0x2f')]();});}};}function handleEntityNotFound(_0x482806,_0x5fc029){return function(_0x4e5b03){if(!_0x4e5b03){_0x482806[_0x602f('0x3c')](0x194);}return _0x4e5b03;};}function handleError(_0x4816c9,_0x27eb21){_0x27eb21=_0x27eb21||0x1f4;return function(_0x10306d){logger[_0x602f('0x2a')](_0x10306d['stack']);if(_0x10306d['name']){delete _0x10306d['name'];}_0x4816c9[_0x602f('0x30')](_0x27eb21)[_0x602f('0x3d')](_0x10306d);};}exports[_0x602f('0x3e')]=function(_0x2fc92b,_0x3c930d){var _0x2cd9f0={},_0x32f6c4={},_0x5ac10f={'count':0x0,'rows':[]};var _0x5801ce=db[_0x602f('0x3f')][_0x602f('0x40')];_0x32f6c4[_0x602f('0x41')]=_[_0x602f('0x42')](_0x5801ce);_0x32f6c4[_0x602f('0x43')]=_[_0x602f('0x42')](_0x2fc92b[_0x602f('0x43')]);_0x32f6c4['filters']=_[_0x602f('0x44')](_0x32f6c4[_0x602f('0x41')],_0x32f6c4[_0x602f('0x43')]);_0x2cd9f0[_0x602f('0x45')]=_[_0x602f('0x44')](_0x32f6c4['model'],qs['fields'](_0x2fc92b[_0x602f('0x43')]['fields']));_0x2cd9f0[_0x602f('0x45')]=_0x2cd9f0[_0x602f('0x45')][_0x602f('0x46')]?_0x2cd9f0[_0x602f('0x45')]:_0x32f6c4[_0x602f('0x41')];if(!_0x2fc92b[_0x602f('0x43')][_0x602f('0x47')](_0x602f('0x48'))){_0x2cd9f0[_0x602f('0x33')]=qs[_0x602f('0x33')](_0x2fc92b[_0x602f('0x43')][_0x602f('0x33')]);_0x2cd9f0[_0x602f('0x32')]=qs[_0x602f('0x32')](_0x2fc92b['query'][_0x602f('0x32')]);}_0x2cd9f0[_0x602f('0x49')]=qs[_0x602f('0x4a')](_0x2fc92b[_0x602f('0x43')]['sort']);_0x2cd9f0[_0x602f('0x4b')]=qs['filters'](_['pick'](_0x2fc92b[_0x602f('0x43')],_0x32f6c4[_0x602f('0x4c')]));if(_0x2fc92b[_0x602f('0x43')][_0x602f('0x4d')]){_0x2cd9f0['where']=_['merge'](_0x2cd9f0[_0x602f('0x4b')],{'$or':_[_0x602f('0x4e')](_0x5801ce,function(_0x181798){if(_0x181798[_0x602f('0x4f')][_0x602f('0x50')]!==_0x602f('0x51')){var _0x3322f9={};_0x3322f9[_0x181798[_0x602f('0x52')]]={'$like':'%'+_0x2fc92b[_0x602f('0x43')][_0x602f('0x4d')]+'%'};return _0x3322f9;}})});}_0x2cd9f0=_[_0x602f('0x53')]({},_0x2cd9f0,_0x2fc92b[_0x602f('0x54')]);var _0x4993ee={'where':_0x2cd9f0[_0x602f('0x4b')]};return db[_0x602f('0x3f')][_0x602f('0x31')](_0x4993ee)[_0x602f('0x38')](function(_0x48a373){_0x5ac10f[_0x602f('0x31')]=_0x48a373;if(_0x2fc92b['query'][_0x602f('0x55')]){_0x2cd9f0[_0x602f('0x56')]=[{'all':!![]}];}return db[_0x602f('0x3f')]['findAll'](_0x2cd9f0);})['then'](function(_0x1a3c2d){_0x5ac10f[_0x602f('0x57')]=_0x1a3c2d;return _0x5ac10f;})[_0x602f('0x38')](respondWithFilteredResult(_0x3c930d,_0x2cd9f0))['catch'](handleError(_0x3c930d,null));};exports['show']=function(_0x11b148,_0x198688){var _0x5e0bac={'raw':!![],'where':{'id':_0x11b148[_0x602f('0x58')]['id']}},_0xbed458={};_0xbed458['model']=_[_0x602f('0x42')](db[_0x602f('0x3f')][_0x602f('0x40')]);_0xbed458[_0x602f('0x43')]=_[_0x602f('0x42')](_0x11b148[_0x602f('0x43')]);_0xbed458['filters']=_[_0x602f('0x44')](_0xbed458[_0x602f('0x41')],_0xbed458[_0x602f('0x43')]);_0x5e0bac[_0x602f('0x45')]=_[_0x602f('0x44')](_0xbed458['model'],qs['fields'](_0x11b148[_0x602f('0x43')][_0x602f('0x59')]));_0x5e0bac[_0x602f('0x45')]=_0x5e0bac['attributes'][_0x602f('0x46')]?_0x5e0bac[_0x602f('0x45')]:_0xbed458['model'];if(_0x11b148[_0x602f('0x43')][_0x602f('0x55')]){_0x5e0bac[_0x602f('0x56')]=[{'all':!![]}];}_0x5e0bac=_['merge']({},_0x5e0bac,_0x11b148[_0x602f('0x54')]);return db[_0x602f('0x3f')][_0x602f('0x5a')](_0x5e0bac)[_0x602f('0x38')](handleEntityNotFound(_0x198688,null))['then'](respondWithResult(_0x198688,null))[_0x602f('0x2e')](handleError(_0x198688,null));};exports[_0x602f('0x5b')]=function(_0x5881fa,_0x2e7674){return db[_0x602f('0x3f')][_0x602f('0x5b')](_0x5881fa['body'],{})[_0x602f('0x38')](function(_0x1f58a3){var _0x537ab4=_0x5881fa[_0x602f('0x5c')][_0x602f('0x5d')]({'plain':!![]});if(!_0x537ab4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x537ab4[_0x602f('0x5e')]===_0x602f('0x5c')){var _0x5970b0=_0x1f58a3[_0x602f('0x5d')]({'plain':!![]});var _0xdf0483=_0x602f('0x3a');return db[_0x602f('0x5f')][_0x602f('0x5a')]({'where':{'name':_0xdf0483,'userProfileId':_0x537ab4['userProfileId']},'raw':!![]})[_0x602f('0x38')](function(_0x51a56a){if(_0x51a56a&&_0x51a56a[_0x602f('0x60')]===0x0){return db[_0x602f('0x3b')]['create']({'name':_0x5970b0[_0x602f('0x61')],'resourceId':_0x5970b0['id'],'type':_0x51a56a[_0x602f('0x61')],'sectionId':_0x51a56a['id']},{})[_0x602f('0x38')](function(){return _0x1f58a3;});}else{return _0x1f58a3;}})[_0x602f('0x2e')](function(_0x12c289){logger['error'](_0x602f('0x62'),_0x12c289);throw _0x12c289;});}return _0x1f58a3;})[_0x602f('0x38')](respondWithResult(_0x2e7674,0xc9))[_0x602f('0x2e')](handleError(_0x2e7674,null));};exports[_0x602f('0x37')]=function(_0x3b9884,_0x4eccf0){if(_0x3b9884[_0x602f('0x63')]['id']){delete _0x3b9884[_0x602f('0x63')]['id'];}return db[_0x602f('0x3f')][_0x602f('0x5a')]({'where':{'id':_0x3b9884[_0x602f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4eccf0,null))[_0x602f('0x38')](saveUpdates(_0x3b9884['body'],null))['then'](respondWithResult(_0x4eccf0,null))[_0x602f('0x2e')](handleError(_0x4eccf0,null));};exports[_0x602f('0x39')]=function(_0x4720dc,_0x3469d1){return db['ChatQueue'][_0x602f('0x5a')]({'where':{'id':_0x4720dc[_0x602f('0x58')]['id']}})[_0x602f('0x38')](handleEntityNotFound(_0x3469d1,null))[_0x602f('0x38')](removeEntity(_0x3469d1,null))['catch'](handleError(_0x3469d1,null));};exports['describe']=function(_0x95c0f2,_0x36e603){return db[_0x602f('0x3f')][_0x602f('0x64')]()[_0x602f('0x38')](respondWithResult(_0x36e603,null))['catch'](handleError(_0x36e603,null));};exports[_0x602f('0x65')]=function(_0x3f296c,_0x597696,_0x4b4cb8){var _0x3de9fb={'raw':!![],'where':{}},_0x663ca5={},_0xd2a5d7;return db[_0x602f('0x3f')][_0x602f('0x66')]({'where':{'id':_0x3f296c[_0x602f('0x58')]['id']}})[_0x602f('0x38')](handleEntityNotFound(_0x597696,null))[_0x602f('0x38')](function(_0x5a9dfb){if(_0x5a9dfb){_0xd2a5d7=_0x5a9dfb['get']({'plain':!![]});_0x663ca5['model']=_['keys'](db[_0x602f('0x67')][_0x602f('0x40')]);_0x663ca5[_0x602f('0x43')]=_['keys'](_0x3f296c[_0x602f('0x43')]);_0x663ca5['filters']=_[_0x602f('0x44')](_0x663ca5[_0x602f('0x41')],_0x663ca5[_0x602f('0x43')]);_0x3de9fb['attributes']=_[_0x602f('0x44')](_0x663ca5[_0x602f('0x41')],qs[_0x602f('0x59')](_0x3f296c[_0x602f('0x43')][_0x602f('0x59')]));_0x3de9fb[_0x602f('0x45')]=_0x3de9fb[_0x602f('0x45')][_0x602f('0x46')]?_0x3de9fb['attributes']:_0x663ca5['model'];if(!_0x3f296c[_0x602f('0x43')][_0x602f('0x47')](_0x602f('0x48'))){_0x3de9fb[_0x602f('0x33')]=qs[_0x602f('0x33')](_0x3f296c[_0x602f('0x43')][_0x602f('0x33')]);_0x3de9fb[_0x602f('0x32')]=qs[_0x602f('0x32')](_0x3f296c[_0x602f('0x43')][_0x602f('0x32')]);}_0x3de9fb[_0x602f('0x49')]=qs[_0x602f('0x4a')](_0x3f296c[_0x602f('0x43')][_0x602f('0x4a')]);_0x3de9fb[_0x602f('0x4b')]=qs[_0x602f('0x4c')](_[_0x602f('0x68')](_0x3f296c[_0x602f('0x43')],_0x663ca5[_0x602f('0x4c')]));_0x3de9fb[_0x602f('0x4b')][_0x602f('0x69')]=_0x5a9dfb['id'];if(_0x3f296c[_0x602f('0x43')][_0x602f('0x4d')]){_0x3de9fb[_0x602f('0x4b')]=_['merge'](_0x3de9fb[_0x602f('0x4b')],{'$or':_[_0x602f('0x4e')](_0x3de9fb[_0x602f('0x45')],function(_0x310dfc){var _0x38a186={};_0x38a186[_0x310dfc]={'$like':'%'+_0x3f296c[_0x602f('0x43')]['filter']+'%'};return _0x38a186;})});}_0x3de9fb=_[_0x602f('0x53')]({},_0x3de9fb,_0x3f296c[_0x602f('0x54')]);return db[_0x602f('0x67')][_0x602f('0x6a')](_0x3de9fb);}})['then'](function(_0x13e290){if(_0x13e290){return db['User'][_0x602f('0x6b')]({'where':{'id':_[_0x602f('0x4e')](_0x13e290,_0x602f('0x6c')),'role':'agent'},'attributes':['id',_0x602f('0x61'),_0x602f('0x6d'),'updatedAt',_0x602f('0x6e')]});}})[_0x602f('0x38')](function(_0x412791){if(_0x412791){return{'count':_0x412791['count'],'rows':_[_0x602f('0x4e')](_0x412791['rows'],function(_0x523e42){return{'membername':_0x523e42['name'],'UserId':_0x523e42['id'],'queue_name':_0xd2a5d7['name'],'ChatQueueId':_0xd2a5d7['id'],'interface':util['format']('%s/%s',_0x602f('0x6f'),_0x523e42['name']),'penalty':0x0,'paused':_0x523e42[_0x602f('0x6d')],'createdAt':_0x523e42[_0x602f('0x6e')],'updatedAt':_0x523e42[_0x602f('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x602f('0x38')](respondWithFilteredResult(_0x597696,_0x3de9fb))[_0x602f('0x2e')](handleError(_0x597696,null));};exports[_0x602f('0x71')]=function(_0x43689c,_0x587555,_0x1e89aa){var _0x55a4fd={};var _0x2d1131={};var _0x4a2c16;var _0x337f2f;return db[_0x602f('0x3f')][_0x602f('0x66')]({'where':{'id':_0x43689c[_0x602f('0x58')]['id']}})['then'](handleEntityNotFound(_0x587555,null))[_0x602f('0x38')](function(_0x36e3ea){if(_0x36e3ea){_0x4a2c16=_0x36e3ea;_0x2d1131[_0x602f('0x41')]=_[_0x602f('0x42')](db[_0x602f('0x72')][_0x602f('0x40')]);_0x2d1131[_0x602f('0x43')]=_['keys'](_0x43689c[_0x602f('0x43')]);_0x2d1131[_0x602f('0x4c')]=_[_0x602f('0x44')](_0x2d1131['model'],_0x2d1131[_0x602f('0x43')]);_0x55a4fd[_0x602f('0x45')]=_[_0x602f('0x44')](_0x2d1131[_0x602f('0x41')],qs[_0x602f('0x59')](_0x43689c[_0x602f('0x43')]['fields']));_0x55a4fd[_0x602f('0x45')]=_0x55a4fd[_0x602f('0x45')][_0x602f('0x46')]?_0x55a4fd[_0x602f('0x45')]:_0x2d1131[_0x602f('0x41')];_0x55a4fd[_0x602f('0x49')]=qs['sort'](_0x43689c[_0x602f('0x43')][_0x602f('0x4a')]);_0x55a4fd[_0x602f('0x4b')]=qs[_0x602f('0x4c')](_[_0x602f('0x68')](_0x43689c['query'],_0x2d1131[_0x602f('0x4c')]));if(_0x43689c[_0x602f('0x43')][_0x602f('0x4d')]){_0x55a4fd[_0x602f('0x4b')]=_[_0x602f('0x53')](_0x55a4fd[_0x602f('0x4b')],{'$or':_['map'](_0x55a4fd[_0x602f('0x45')],function(_0x50e5dd){var _0x12e4a3={};_0x12e4a3[_0x50e5dd]={'$like':'%'+_0x43689c[_0x602f('0x43')][_0x602f('0x4d')]+'%'};return _0x12e4a3;})});}_0x55a4fd=_[_0x602f('0x53')]({},_0x55a4fd,_0x43689c[_0x602f('0x54')]);return _0x4a2c16[_0x602f('0x71')](_0x55a4fd);}})[_0x602f('0x38')](function(_0x3bca13){if(_0x3bca13){_0x337f2f=_0x3bca13['length'];if(!_0x43689c[_0x602f('0x43')][_0x602f('0x47')](_0x602f('0x48'))){_0x55a4fd[_0x602f('0x33')]=qs[_0x602f('0x33')](_0x43689c[_0x602f('0x43')]['limit']);_0x55a4fd[_0x602f('0x32')]=qs[_0x602f('0x32')](_0x43689c[_0x602f('0x43')][_0x602f('0x32')]);}return _0x4a2c16['getTeams'](_0x55a4fd);}})[_0x602f('0x38')](function(_0x1a834f){if(_0x1a834f){return _0x1a834f?{'count':_0x337f2f,'rows':_0x1a834f}:null;}})[_0x602f('0x38')](respondWithResult(_0x587555,null))[_0x602f('0x2e')](handleError(_0x587555,null));};exports[_0x602f('0x73')]=function(_0x5a6518,_0x297c14,_0xd0ad75){var _0x10a65f=_0x5a6518[_0x602f('0x63')]['teams'];return db[_0x602f('0x72')]['findAll']({'where':{'id':_['map'](_0x10a65f,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x602f('0x61'),_0x602f('0x74'),_0x602f('0x75'),_0x602f('0x76')],'raw':!![]}]})[_0x602f('0x38')](function(_0x39c4e0){if(_0x39c4e0){var _0x117034=_[_0x602f('0x77')](_0x39c4e0,function(_0x8b329e){var _0x373e83=_0x8b329e[_0x602f('0x5d')]({'plain':!![]});return _0x373e83['Agents'];});return db['ChatQueue'][_0x602f('0x5a')]({'where':{'id':_0x5a6518['params']['id']}})['then'](function(_0x5af97b){return db['sequelize'][_0x602f('0x78')](function(_0x272120){return _0x5af97b[_0x602f('0x73')](_[_0x602f('0x4e')](_0x10a65f,'id'),{'transaction':_0x272120})['then'](function(){return BPromise[_0x602f('0x79')](_0x117034,function(_0x56a9cd){return db[_0x602f('0x67')][_0x602f('0x7a')]({'where':{'UserId':_0x56a9cd['id'],'ChatQueueId':_0x5a6518[_0x602f('0x58')]['id']},'transaction':_0x272120});});})[_0x602f('0x38')](function(){_0x117034[_0x602f('0x7b')](function(_0x475543){socket[_0x602f('0x7c')]('userChatQueue:save',{'UserId':_0x475543['id'],'ChatQueueId':_0x5af97b['id']});});});});});}})[_0x602f('0x38')](respondWithStatusCode(_0x297c14,null))[_0x602f('0x2e')](handleError(_0x297c14,null));};exports[_0x602f('0x7d')]=function(_0x4ad49d,_0x2a3709,_0x36af7b){return db[_0x602f('0x72')]['findAll']({'where':{'id':_0x4ad49d['query'][_0x602f('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x602f('0x7f')],'as':_0x602f('0x80'),'attributes':['id'],'raw':!![]}]})[_0x602f('0x38')](handleEntityNotFound(_0x2a3709,null))[_0x602f('0x38')](function(_0x1bd0ea){var _0x543420=_['map'](_0x1bd0ea,'id');var _0x1ced2f=[];var _0x513d20=[];var _0x13763a=squel[_0x602f('0x81')]();_0x13763a[_0x602f('0x52')](_0x602f('0x82'))[_0x602f('0x83')](_0x602f('0x84'),'tq')[_0x602f('0x85')](_0x602f('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x602f('0x87'),_0x4ad49d[_0x602f('0x58')]['id']);for(var _0x1c9807=0x0;_0x1c9807<_0x1bd0ea[_0x602f('0x46')];_0x1c9807+=0x1){let _0x296f5d=_0x1bd0ea[_0x1c9807];for(var _0x54c0df=0x0;_0x54c0df<_0x296f5d['Agents'][_0x602f('0x46')];_0x54c0df+=0x1){let _0x16f711=_0x296f5d['Agents'][_0x54c0df];var _0x35ae6a=_0x13763a[_0x602f('0x88')]();_0x35ae6a['where'](_0x602f('0x89'),_0x16f711['id']);_0x513d20['push'](db[_0x602f('0x8a')][_0x602f('0x43')](_0x35ae6a[_0x602f('0x8b')](),{'type':db[_0x602f('0x8a')][_0x602f('0x8c')][_0x602f('0x8d')]})[_0x602f('0x38')](function(_0x37d394){if(_0x37d394[_0x602f('0x46')]===0x1){return _0x16f711['id'];}else{var _0x5bb788=_[_0x602f('0x8e')](_[_0x602f('0x4e')](_0x37d394,_0x602f('0x8f')),function(_0x3d893f){return _[_0x602f('0x90')](_0x543420,_0x3d893f);});if(_0x5bb788){return _0x16f711['id'];}}}));}}return BPromise[_0x602f('0x91')](_0x513d20)[_0x602f('0x38')](function(_0x3939b8){_0x1ced2f=_(_0x1ced2f)[_0x602f('0x92')](_0x3939b8)['compact']()[_0x602f('0x93')]();return db[_0x602f('0x3f')][_0x602f('0x5a')]({'where':{'id':_0x4ad49d[_0x602f('0x58')]['id']}})[_0x602f('0x38')](function(_0x3af74b){return db[_0x602f('0x8a')]['transaction'](function(_0x4f11d8){return _0x3af74b['removeTeams'](_0x4ad49d[_0x602f('0x43')]['ids'],{'transaction':_0x4f11d8})[_0x602f('0x38')](function(){if(!_[_0x602f('0x94')](_0x1ced2f)){return _0x3af74b['removeAgents'](_0x1ced2f,{'transaction':_0x4f11d8});}})['then'](function(){_0x1ced2f[_0x602f('0x7b')](function(_0x484a5a){socket['emit']('userChatQueue:remove',{'UserId':_0x484a5a,'ChatQueueId':_0x3af74b['id']});});});});});});})['then'](respondWithStatusCode(_0x2a3709,null))['catch'](handleError(_0x2a3709,null));};exports['addAgents']=function(_0x151822,_0x3c0562,_0x2ffc37){return db['ChatQueue']['find']({'where':{'id':_0x151822['params']['id']}})[_0x602f('0x38')](handleEntityNotFound(_0x3c0562,null))[_0x602f('0x38')](function(_0x4befef){if(_0x4befef){return _0x4befef[_0x602f('0x95')](_0x151822[_0x602f('0x63')]['ids'],_[_0x602f('0x96')](_0x151822['body'],[_0x602f('0x7e'),'id'])||{})['spread'](function(_0x9da039){for(var _0x20181e=0x0;_0x20181e<_0x151822[_0x602f('0x63')][_0x602f('0x7e')][_0x602f('0x46')];_0x20181e+=0x1){socket[_0x602f('0x7c')]('userChatQueue:save',{'UserId':_0x151822[_0x602f('0x63')][_0x602f('0x7e')][_0x20181e],'ChatQueueId':_0x151822['params']['id']});}return _0x9da039;});}})['then'](respondWithResult(_0x3c0562,null))['catch'](handleError(_0x3c0562,null));};exports[_0x602f('0x97')]=function(_0x4dc758,_0x413c0a,_0x7f800b){return db[_0x602f('0x3f')][_0x602f('0x5a')]({'where':{'id':_0x4dc758[_0x602f('0x58')]['id']}})[_0x602f('0x38')](handleEntityNotFound(_0x413c0a,null))['then'](function(_0x2b6328){if(_0x2b6328){return _0x2b6328['removeAgents'](_0x4dc758[_0x602f('0x43')][_0x602f('0x7e')])['then'](function(){if(_['isArray'](_0x4dc758[_0x602f('0x43')]['ids'])){for(var _0x40b0a0=0x0;_0x40b0a0<_0x4dc758[_0x602f('0x43')]['ids'][_0x602f('0x46')];_0x40b0a0+=0x1){socket['emit'](_0x602f('0x98'),{'UserId':Number(_0x4dc758[_0x602f('0x43')][_0x602f('0x7e')][_0x40b0a0]),'ChatQueueId':Number(_0x4dc758[_0x602f('0x58')]['id'])});}}else{socket['emit'](_0x602f('0x98'),{'UserId':Number(_0x4dc758[_0x602f('0x43')]['ids']),'ChatQueueId':Number(_0x4dc758[_0x602f('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x413c0a,null))[_0x602f('0x2e')](handleError(_0x413c0a,null));};exports[_0x602f('0x99')]=function(_0xb3ea4a,_0x13c5ba,_0x546f98){var _0x38d3d0={};var _0x548910={};var _0x60cb90;var _0x53ccee;return db[_0x602f('0x3f')][_0x602f('0x66')]({'where':{'id':_0xb3ea4a[_0x602f('0x58')]['id']}})['then'](handleEntityNotFound(_0x13c5ba,null))['then'](function(_0x5a9421){if(_0x5a9421){_0x60cb90=_0x5a9421;_0x548910[_0x602f('0x41')]=_['keys'](db[_0x602f('0x7f')]['rawAttributes']);_0x548910['query']=_[_0x602f('0x42')](_0xb3ea4a[_0x602f('0x43')]);_0x548910[_0x602f('0x4c')]=_[_0x602f('0x44')](_0x548910[_0x602f('0x41')],_0x548910[_0x602f('0x43')]);_0x38d3d0[_0x602f('0x45')]=_['intersection'](_0x548910[_0x602f('0x41')],qs[_0x602f('0x59')](_0xb3ea4a['query'][_0x602f('0x59')]));_0x38d3d0[_0x602f('0x45')]=_0x38d3d0[_0x602f('0x45')][_0x602f('0x46')]?_0x38d3d0[_0x602f('0x45')]:_0x548910[_0x602f('0x41')];_0x38d3d0[_0x602f('0x49')]=qs[_0x602f('0x4a')](_0xb3ea4a[_0x602f('0x43')][_0x602f('0x4a')]);_0x38d3d0[_0x602f('0x4b')]=qs['filters'](_[_0x602f('0x68')](_0xb3ea4a[_0x602f('0x43')],_0x548910[_0x602f('0x4c')]));if(_0xb3ea4a['query'][_0x602f('0x4d')]){_0x38d3d0[_0x602f('0x4b')]=_['merge'](_0x38d3d0['where'],{'$or':_[_0x602f('0x4e')](_0x38d3d0[_0x602f('0x45')],function(_0x4ac21d){var _0x17d31c={};_0x17d31c[_0x4ac21d]={'$like':'%'+_0xb3ea4a['query'][_0x602f('0x4d')]+'%'};return _0x17d31c;})});}_0x38d3d0=_[_0x602f('0x53')]({},_0x38d3d0,_0xb3ea4a['options']);return _0x60cb90[_0x602f('0x99')](_0x38d3d0);}})['then'](function(_0x37dc94){if(_0x37dc94){_0x53ccee=_0x37dc94[_0x602f('0x46')];if(!_0xb3ea4a[_0x602f('0x43')]['hasOwnProperty'](_0x602f('0x48'))){_0x38d3d0[_0x602f('0x33')]=qs[_0x602f('0x33')](_0xb3ea4a[_0x602f('0x43')][_0x602f('0x33')]);_0x38d3d0['offset']=qs['offset'](_0xb3ea4a['query'][_0x602f('0x32')]);}return _0x60cb90['getAgents'](_0x38d3d0);}})['then'](function(_0x4692dc){if(_0x4692dc){return _0x4692dc?{'count':_0x53ccee,'rows':_0x4692dc}:null;}})[_0x602f('0x38')](respondWithResult(_0x13c5ba,null))[_0x602f('0x2e')](handleError(_0x13c5ba,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 592742e..70cd5f1 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 _0xd547=['hook','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x20ae13,_0x2a0c8e){var _0x533fd5=function(_0x3bb746){while(--_0x3bb746){_0x20ae13['push'](_0x20ae13['shift']());}};_0x533fd5(++_0x2a0c8e);}(_0xd547,0x1c1));var _0x7d54=function(_0x3df1e9,_0x3cd30e){_0x3df1e9=_0x3df1e9-0x0;var _0xd6b371=_0xd547[_0x3df1e9];return _0xd6b371;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x7d54('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7d54('0x1')](0x0);var events={'afterCreate':_0x7d54('0x2'),'afterUpdate':_0x7d54('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ab00b){return function(_0x21c23f,_0x5d21c1,_0x22ea09){ChatQueueEvents['emit'](_0x4ab00b+':'+_0x21c23f['id'],_0x21c23f);ChatQueueEvents[_0x7d54('0x4')](_0x4ab00b,_0x21c23f);_0x22ea09(null);};}for(var e in events){if(events[_0x7d54('0x5')](e)){var event=events[e];ChatQueue[_0x7d54('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x8cc8=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatQueue'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0x8cc8,0x177));var _0x88cc=function(_0x42c440,_0x28ee66){_0x42c440=_0x42c440-0x0;var _0x4a9172=_0x8cc8[_0x42c440];return _0x4a9172;};'use strict';var EventEmitter=require(_0x88cc('0x0'));var ChatQueue=require(_0x88cc('0x1'))['db'][_0x88cc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x88cc('0x3')](0x0);var events={'afterCreate':_0x88cc('0x4'),'afterUpdate':_0x88cc('0x5'),'afterDestroy':_0x88cc('0x6')};function emitEvent(_0x41ec3a){return function(_0x407cb0,_0xce4dc7,_0x1c943a){ChatQueueEvents[_0x88cc('0x7')](_0x41ec3a+':'+_0x407cb0['id'],_0x407cb0);ChatQueueEvents[_0x88cc('0x7')](_0x41ec3a,_0x407cb0);_0x1c943a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x88cc('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1d53cdf..acaa155 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 _0x33d2=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x444ca7,_0x34ce00){var _0x24a6ae=function(_0x67b5d6){while(--_0x67b5d6){_0x444ca7['push'](_0x444ca7['shift']());}};_0x24a6ae(++_0x34ce00);}(_0x33d2,0x7f));var _0x233d=function(_0x3e9b06,_0x417393){_0x3e9b06=_0x3e9b06-0x0;var _0x442af8=_0x33d2[_0x3e9b06];return _0x442af8;};'use strict';var _=require(_0x233d('0x0'));var util=require(_0x233d('0x1'));var logger=require(_0x233d('0x2'))('api');var moment=require(_0x233d('0x3'));var BPromise=require(_0x233d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x233d('0x5'));var rimraf=require(_0x233d('0x6'));var config=require(_0x233d('0x7'));var attributes=require(_0x233d('0x8'));module[_0x233d('0x9')]=function(_0x3f311b,_0x15ba43){return _0x3f311b[_0x233d('0xa')]('ChatQueue',attributes,{'tableName':_0x233d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac7f=['ChatQueue','chat_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac7f,0x1e2));var _0xfac7=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xac7f[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xfac7('0x0'));var util=require('util');var logger=require(_0xfac7('0x1'))(_0xfac7('0x2'));var moment=require(_0xfac7('0x3'));var BPromise=require('bluebird');var rp=require(_0xfac7('0x4'));var fs=require('fs');var path=require(_0xfac7('0x5'));var rimraf=require(_0xfac7('0x6'));var config=require(_0xfac7('0x7'));var attributes=require(_0xfac7('0x8'));module[_0xfac7('0x9')]=function(_0x523494,_0x31c831){return _0x523494['define'](_0xfac7('0xa'),attributes,{'tableName':_0xfac7('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 86393b2..feaae0c 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 _0xda78=['request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','ChatQueue','findAll','raw','options','where','attributes','limit','map','include','model','then','GetChatQueue','ShowChatQueue','find','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register'];(function(_0x23a48b,_0x5a0d95){var _0x500de4=function(_0x292961){while(--_0x292961){_0x23a48b['push'](_0x23a48b['shift']());}};_0x500de4(++_0x5a0d95);}(_0xda78,0x178));var _0x8da7=function(_0x2836ef,_0x27d12d){_0x2836ef=_0x2836ef-0x0;var _0x40b686=_0xda78[_0x2836ef];return _0x40b686;};'use strict';var _=require(_0x8da7('0x0'));var util=require('util');var moment=require(_0x8da7('0x1'));var BPromise=require('bluebird');var rs=require(_0x8da7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8da7('0x3'));var logger=require(_0x8da7('0x4'))(_0x8da7('0x5'));var config=require(_0x8da7('0x6'));var jayson=require(_0x8da7('0x7'));var client=jayson[_0x8da7('0x8')][_0x8da7('0x9')]({'port':0x232a});config[_0x8da7('0xa')]=_[_0x8da7('0xb')](config[_0x8da7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8da7('0xc'))[_0x8da7('0xd')](socket);function respondWithRpcPromise(_0x11aad6,_0x2d37a7,_0x212df5){return new BPromise(function(_0x5b2126,_0x2899c4){return client[_0x8da7('0xe')](_0x11aad6,_0x212df5)['then'](function(_0x5e1a1b){logger[_0x8da7('0xf')]('ChatQueue,\x20%s,\x20%s',_0x2d37a7,_0x8da7('0x10'));logger[_0x8da7('0x11')](_0x8da7('0x12'),_0x2d37a7,_0x8da7('0x10'),JSON[_0x8da7('0x13')](_0x5e1a1b));if(_0x5e1a1b['error']){if(_0x5e1a1b[_0x8da7('0x14')][_0x8da7('0x15')]===0x1f4){logger['error'](_0x8da7('0x16'),_0x2d37a7,_0x5e1a1b['error'][_0x8da7('0x17')]);return _0x2899c4(_0x5e1a1b[_0x8da7('0x14')][_0x8da7('0x17')]);}logger[_0x8da7('0x14')]('ChatQueue,\x20%s,\x20%s',_0x2d37a7,_0x5e1a1b['error']['message']);return _0x5b2126(_0x5e1a1b[_0x8da7('0x14')][_0x8da7('0x17')]);}else{logger['info'](_0x8da7('0x16'),_0x2d37a7,_0x8da7('0x10'));_0x5b2126(_0x5e1a1b['result'][_0x8da7('0x17')]);}})[_0x8da7('0x18')](function(_0x2505d1){logger['error'](_0x8da7('0x16'),_0x2d37a7,_0x2505d1);_0x2899c4(_0x2505d1);});});}exports['GetChatQueue']=function(_0x1591a6){var _0x125bb9=this;return new Promise(function(_0x24e788,_0x1ed906){return db[_0x8da7('0x19')][_0x8da7('0x1a')]({'raw':_0x1591a6['options']?_0x1591a6['options'][_0x8da7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1591a6[_0x8da7('0x1c')]?_0x1591a6[_0x8da7('0x1c')][_0x8da7('0x1d')]||null:null,'attributes':_0x1591a6['options']?_0x1591a6[_0x8da7('0x1c')][_0x8da7('0x1e')]||null:null,'limit':_0x1591a6['options']?_0x1591a6['options'][_0x8da7('0x1f')]||null:null,'include':_0x1591a6['options']?_0x1591a6[_0x8da7('0x1c')]['include']?_[_0x8da7('0x20')](_0x1591a6[_0x8da7('0x1c')][_0x8da7('0x21')],function(_0x249864){return{'model':db[_0x249864[_0x8da7('0x22')]],'as':_0x249864['as'],'attributes':_0x249864[_0x8da7('0x1e')],'include':_0x249864[_0x8da7('0x21')]?_[_0x8da7('0x20')](_0x249864['include'],function(_0x3b9467){return{'model':db[_0x3b9467['model']],'as':_0x3b9467['as'],'attributes':_0x3b9467['attributes'],'include':_0x3b9467[_0x8da7('0x21')]?_[_0x8da7('0x20')](_0x3b9467[_0x8da7('0x21')],function(_0x290d99){return{'model':db[_0x290d99[_0x8da7('0x22')]],'as':_0x290d99['as'],'attributes':_0x290d99[_0x8da7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8da7('0x23')](function(_0x480a4d){logger[_0x8da7('0xf')](_0x8da7('0x24'),_0x1591a6);logger[_0x8da7('0x11')]('GetChatQueue',_0x1591a6,JSON[_0x8da7('0x13')](_0x480a4d));_0x24e788(_0x480a4d);})['catch'](function(_0x11c259){logger[_0x8da7('0x14')](_0x8da7('0x24'),_0x11c259['message'],_0x1591a6);_0x1ed906(_0x125bb9[_0x8da7('0x14')](0x1f4,_0x11c259[_0x8da7('0x17')]));});});};exports[_0x8da7('0x25')]=function(_0x1101a9){var _0x5463ab=this;return new Promise(function(_0x1e2bd1,_0x428668){return db['ChatQueue'][_0x8da7('0x26')]({'raw':_0x1101a9['options']?_0x1101a9[_0x8da7('0x1c')][_0x8da7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1101a9[_0x8da7('0x1c')]?_0x1101a9['options'][_0x8da7('0x1d')]||null:null,'attributes':_0x1101a9[_0x8da7('0x1c')]?_0x1101a9[_0x8da7('0x1c')][_0x8da7('0x1e')]||null:null,'include':_0x1101a9[_0x8da7('0x1c')]?_0x1101a9[_0x8da7('0x1c')]['include']?_['map'](_0x1101a9[_0x8da7('0x1c')][_0x8da7('0x21')],function(_0x51a58c){return{'model':db[_0x51a58c[_0x8da7('0x22')]],'as':_0x51a58c['as'],'attributes':_0x51a58c[_0x8da7('0x1e')],'include':_0x51a58c[_0x8da7('0x21')]?_[_0x8da7('0x20')](_0x51a58c['include'],function(_0x13bbae){return{'model':db[_0x13bbae[_0x8da7('0x22')]],'as':_0x13bbae['as'],'attributes':_0x13bbae[_0x8da7('0x1e')],'include':_0x13bbae[_0x8da7('0x21')]?_[_0x8da7('0x20')](_0x13bbae[_0x8da7('0x21')],function(_0x2eacb1){return{'model':db[_0x2eacb1[_0x8da7('0x22')]],'as':_0x2eacb1['as'],'attributes':_0x2eacb1[_0x8da7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8da7('0x23')](function(_0x24ca64){logger[_0x8da7('0xf')](_0x8da7('0x25'),_0x1101a9);logger[_0x8da7('0x11')]('ShowChatQueue',_0x1101a9,JSON[_0x8da7('0x13')](_0x24ca64));_0x1e2bd1(_0x24ca64);})[_0x8da7('0x18')](function(_0x54871d){logger['error'](_0x8da7('0x25'),_0x54871d[_0x8da7('0x17')],_0x1101a9);_0x428668(_0x5463ab[_0x8da7('0x14')](0x1f4,_0x54871d[_0x8da7('0x17')]));});});}; \ No newline at end of file +var _0x0fd7=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','stringify','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','localhost','./chatQueue.socket','register','request'];(function(_0x34d27a,_0x5404f6){var _0x5e4427=function(_0x14fb64){while(--_0x14fb64){_0x34d27a['push'](_0x34d27a['shift']());}};_0x5e4427(++_0x5404f6);}(_0x0fd7,0x1c5));var _0x70fd=function(_0x51abe3,_0x20df44){_0x51abe3=_0x51abe3-0x0;var _0x3aba00=_0x0fd7[_0x51abe3];return _0x3aba00;};'use strict';var _=require(_0x70fd('0x0'));var util=require(_0x70fd('0x1'));var moment=require(_0x70fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x70fd('0x3'));var fs=require('fs');var Redis=require(_0x70fd('0x4'));var db=require(_0x70fd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x70fd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70fd('0x7'));var client=jayson[_0x70fd('0x8')][_0x70fd('0x9')]({'port':0x232a});config[_0x70fd('0xa')]=_['defaults'](config[_0x70fd('0xa')],{'host':_0x70fd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70fd('0xa')]));require(_0x70fd('0xc'))[_0x70fd('0xd')](socket);function respondWithRpcPromise(_0x50233d,_0xff09c3,_0x3f4dad){return new BPromise(function(_0x2baa7a,_0x3a28fe){return client[_0x70fd('0xe')](_0x50233d,_0x3f4dad)['then'](function(_0x1fca0a){logger[_0x70fd('0xf')](_0x70fd('0x10'),_0xff09c3,_0x70fd('0x11'));logger[_0x70fd('0x12')](_0x70fd('0x13'),_0xff09c3,_0x70fd('0x11'),JSON['stringify'](_0x1fca0a));if(_0x1fca0a[_0x70fd('0x14')]){if(_0x1fca0a[_0x70fd('0x14')]['code']===0x1f4){logger[_0x70fd('0x14')](_0x70fd('0x10'),_0xff09c3,_0x1fca0a[_0x70fd('0x14')][_0x70fd('0x15')]);return _0x3a28fe(_0x1fca0a[_0x70fd('0x14')]['message']);}logger['error'](_0x70fd('0x10'),_0xff09c3,_0x1fca0a['error'][_0x70fd('0x15')]);return _0x2baa7a(_0x1fca0a[_0x70fd('0x14')]['message']);}else{logger[_0x70fd('0xf')](_0x70fd('0x10'),_0xff09c3,_0x70fd('0x11'));_0x2baa7a(_0x1fca0a[_0x70fd('0x16')][_0x70fd('0x15')]);}})[_0x70fd('0x17')](function(_0x2565ed){logger[_0x70fd('0x14')](_0x70fd('0x10'),_0xff09c3,_0x2565ed);_0x3a28fe(_0x2565ed);});});}exports[_0x70fd('0x18')]=function(_0x4f1208){var _0x5d6c2b=this;return new Promise(function(_0xa4bd48,_0x10b1a2){return db[_0x70fd('0x19')][_0x70fd('0x1a')]({'raw':_0x4f1208[_0x70fd('0x1b')]?_0x4f1208[_0x70fd('0x1b')][_0x70fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f1208[_0x70fd('0x1b')]?_0x4f1208[_0x70fd('0x1b')][_0x70fd('0x1d')]||null:null,'attributes':_0x4f1208[_0x70fd('0x1b')]?_0x4f1208[_0x70fd('0x1b')]['attributes']||null:null,'limit':_0x4f1208['options']?_0x4f1208[_0x70fd('0x1b')][_0x70fd('0x1e')]||null:null,'include':_0x4f1208['options']?_0x4f1208[_0x70fd('0x1b')][_0x70fd('0x1f')]?_[_0x70fd('0x20')](_0x4f1208[_0x70fd('0x1b')][_0x70fd('0x1f')],function(_0x591dbf){return{'model':db[_0x591dbf['model']],'as':_0x591dbf['as'],'attributes':_0x591dbf[_0x70fd('0x21')],'include':_0x591dbf[_0x70fd('0x1f')]?_['map'](_0x591dbf[_0x70fd('0x1f')],function(_0x418108){return{'model':db[_0x418108['model']],'as':_0x418108['as'],'attributes':_0x418108[_0x70fd('0x21')],'include':_0x418108[_0x70fd('0x1f')]?_[_0x70fd('0x20')](_0x418108[_0x70fd('0x1f')],function(_0x222560){return{'model':db[_0x222560[_0x70fd('0x22')]],'as':_0x222560['as'],'attributes':_0x222560['attributes']};}):[]};}):[]};}):[]:[]})[_0x70fd('0x23')](function(_0x55422){logger[_0x70fd('0xf')](_0x70fd('0x18'),_0x4f1208);logger[_0x70fd('0x12')](_0x70fd('0x18'),_0x4f1208,JSON[_0x70fd('0x24')](_0x55422));_0xa4bd48(_0x55422);})[_0x70fd('0x17')](function(_0x2edea3){logger['error']('GetChatQueue',_0x2edea3[_0x70fd('0x15')],_0x4f1208);_0x10b1a2(_0x5d6c2b[_0x70fd('0x14')](0x1f4,_0x2edea3[_0x70fd('0x15')]));});});};exports[_0x70fd('0x25')]=function(_0x2d7813){var _0x28b895=this;return new Promise(function(_0x4c198c,_0x3a71bb){return db[_0x70fd('0x19')][_0x70fd('0x26')]({'raw':_0x2d7813[_0x70fd('0x1b')]?_0x2d7813[_0x70fd('0x1b')][_0x70fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d7813[_0x70fd('0x1b')]?_0x2d7813[_0x70fd('0x1b')][_0x70fd('0x1d')]||null:null,'attributes':_0x2d7813['options']?_0x2d7813[_0x70fd('0x1b')][_0x70fd('0x21')]||null:null,'include':_0x2d7813['options']?_0x2d7813[_0x70fd('0x1b')][_0x70fd('0x1f')]?_[_0x70fd('0x20')](_0x2d7813[_0x70fd('0x1b')][_0x70fd('0x1f')],function(_0x2cf685){return{'model':db[_0x2cf685[_0x70fd('0x22')]],'as':_0x2cf685['as'],'attributes':_0x2cf685['attributes'],'include':_0x2cf685[_0x70fd('0x1f')]?_[_0x70fd('0x20')](_0x2cf685[_0x70fd('0x1f')],function(_0x7dd563){return{'model':db[_0x7dd563[_0x70fd('0x22')]],'as':_0x7dd563['as'],'attributes':_0x7dd563['attributes'],'include':_0x7dd563[_0x70fd('0x1f')]?_[_0x70fd('0x20')](_0x7dd563[_0x70fd('0x1f')],function(_0x10fc6e){return{'model':db[_0x10fc6e['model']],'as':_0x10fc6e['as'],'attributes':_0x10fc6e[_0x70fd('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ae04){logger[_0x70fd('0xf')](_0x70fd('0x25'),_0x2d7813);logger[_0x70fd('0x12')](_0x70fd('0x25'),_0x2d7813,JSON[_0x70fd('0x24')](_0x44ae04));_0x4c198c(_0x44ae04);})[_0x70fd('0x17')](function(_0x5440c8){logger['error'](_0x70fd('0x25'),_0x5440c8[_0x70fd('0x15')],_0x2d7813);_0x3a71bb(_0x28b895[_0x70fd('0x14')](0x1f4,_0x5440c8[_0x70fd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 420794c..602bd88 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index a572701..e8fc0b6 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 _0xf6e5=['getTeams','/:id/users','getAgents','post','addTeams','update','delete','removeTeams','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','getMembers','/:id/teams'];(function(_0x4aefc9,_0x27bfdc){var _0x1537a4=function(_0x3836a6){while(--_0x3836a6){_0x4aefc9['push'](_0x4aefc9['shift']());}};_0x1537a4(++_0x27bfdc);}(_0xf6e5,0xaa));var _0x5f6e=function(_0x373edb,_0x5a0d92){_0x373edb=_0x373edb-0x0;var _0x140151=_0xf6e5[_0x373edb];return _0x140151;};'use strict';var multer=require(_0x5f6e('0x0'));var util=require(_0x5f6e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f6e('0x2'));var router=express[_0x5f6e('0x3')]();var auth=require(_0x5f6e('0x4'));var interaction=require(_0x5f6e('0x5'));var config=require(_0x5f6e('0x6'));var controller=require('./chatQueue.controller');router[_0x5f6e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5f6e('0x8'),auth[_0x5f6e('0x9')](),controller[_0x5f6e('0xa')]);router[_0x5f6e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5f6e('0xb')]);router[_0x5f6e('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x5f6e('0xc')]);router['get'](_0x5f6e('0xd'),auth[_0x5f6e('0x9')](),controller[_0x5f6e('0xe')]);router[_0x5f6e('0x7')](_0x5f6e('0xf'),auth[_0x5f6e('0x9')](),controller[_0x5f6e('0x10')]);router[_0x5f6e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f6e('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5f6e('0x12')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x5f6e('0x9')](),controller[_0x5f6e('0x13')]);router[_0x5f6e('0x14')]('/:id',auth[_0x5f6e('0x9')](),controller['destroy']);router[_0x5f6e('0x14')](_0x5f6e('0xd'),auth[_0x5f6e('0x9')](),controller[_0x5f6e('0x15')]);router[_0x5f6e('0x14')](_0x5f6e('0xf'),auth[_0x5f6e('0x9')](),controller['removeAgents']);module[_0x5f6e('0x16')]=router; \ No newline at end of file +var _0x661a=['create','addTeams','put','update','/:id','destroy','delete','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x661a,0x175));var _0xa661=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x661a[_0x466e57];return _0x34df42;};'use strict';var multer=require(_0xa661('0x0'));var util=require(_0xa661('0x1'));var path=require(_0xa661('0x2'));var timeout=require('connect-timeout');var express=require(_0xa661('0x3'));var router=express[_0xa661('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa661('0x5'));var config=require('../../config/environment');var controller=require(_0xa661('0x6'));router[_0xa661('0x7')]('/',auth[_0xa661('0x8')](),controller[_0xa661('0x9')]);router[_0xa661('0x7')](_0xa661('0xa'),auth[_0xa661('0x8')](),controller[_0xa661('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa661('0xc')]);router[_0xa661('0x7')]('/:id/members',auth[_0xa661('0x8')](),controller[_0xa661('0xd')]);router['get'](_0xa661('0xe'),auth['isAuthenticated'](),controller[_0xa661('0xf')]);router[_0xa661('0x7')](_0xa661('0x10'),auth[_0xa661('0x8')](),controller[_0xa661('0x11')]);router[_0xa661('0x12')]('/',auth[_0xa661('0x8')](),controller[_0xa661('0x13')]);router['post'](_0xa661('0xe'),auth[_0xa661('0x8')](),controller[_0xa661('0x14')]);router[_0xa661('0x12')](_0xa661('0x10'),auth[_0xa661('0x8')](),controller['addAgents']);router[_0xa661('0x15')]('/:id',auth[_0xa661('0x8')](),controller[_0xa661('0x16')]);router['delete'](_0xa661('0x17'),auth[_0xa661('0x8')](),controller[_0xa661('0x18')]);router[_0xa661('0x19')](_0xa661('0xe'),auth[_0xa661('0x8')](),controller['removeTeams']);router[_0xa661('0x19')](_0xa661('0x10'),auth[_0xa661('0x8')](),controller[_0xa661('0x1a')]);module[_0xa661('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b6a436b..6601121 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 _0xebfa=['DATE','moment','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebfa,0x1c9));var _0xaebf=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xebfa[_0x125ff8];return _0x2d9ef;};'use strict';var moment=require(_0xaebf('0x0'));var Sequelize=require('sequelize');module[_0xaebf('0x1')]={'uniqueid':{'type':Sequelize[_0xaebf('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xaebf('0x3')]},'leaveAt':{'type':Sequelize[_0xaebf('0x3')]},'acceptAt':{'type':Sequelize[_0xaebf('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf341=['exports','STRING','DATE','moment','sequelize'];(function(_0x4f39b6,_0x2c2392){var _0x14b2ed=function(_0x2b968f){while(--_0x2b968f){_0x4f39b6['push'](_0x4f39b6['shift']());}};_0x14b2ed(++_0x2c2392);}(_0xf341,0x8a));var _0x1f34=function(_0x25067d,_0x4d5324){_0x25067d=_0x25067d-0x0;var _0x2dfc56=_0xf341[_0x25067d];return _0x2dfc56;};'use strict';var moment=require(_0x1f34('0x0'));var Sequelize=require(_0x1f34('0x1'));module[_0x1f34('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1f34('0x3')]},'joinAt':{'type':Sequelize[_0x1f34('0x4')]},'leaveAt':{'type':Sequelize[_0x1f34('0x4')]},'acceptAt':{'type':Sequelize[_0x1f34('0x4')]},'exitAt':{'type':Sequelize[_0x1f34('0x4')]},'reason':{'type':Sequelize[_0x1f34('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2bd2726..d482259 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 _0x6df6=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','update','then','end','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','key','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','options','create','body','find','destroy','describe','html-pdf','rimraf'];(function(_0x3d855e,_0x16f1d7){var _0x495b16=function(_0x30cbaf){while(--_0x30cbaf){_0x3d855e['push'](_0x3d855e['shift']());}};_0x495b16(++_0x16f1d7);}(_0x6df6,0x16b));var _0x66df=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x6df6[_0x15b399];return _0x199f2d;};'use strict';var pdf=require(_0x66df('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66df('0x1'));var zipdir=require(_0x66df('0x2'));var jsonpatch=require(_0x66df('0x3'));var rp=require(_0x66df('0x4'));var moment=require(_0x66df('0x5'));var BPromise=require(_0x66df('0x6'));var Mustache=require(_0x66df('0x7'));var util=require(_0x66df('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x66df('0x9'));var ejs=require(_0x66df('0xa'));var fs=require('fs');var _=require(_0x66df('0xb'));var squel=require(_0x66df('0xc'));var crypto=require(_0x66df('0xd'));var jsforce=require(_0x66df('0xe'));var deskjs=require(_0x66df('0xf'));var toCsv=require(_0x66df('0x9'));var querystring=require('querystring');var Papa=require(_0x66df('0x10'));var Redis=require(_0x66df('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x66df('0x12'));var hardwareService=require(_0x66df('0x13'));var logger=require(_0x66df('0x14'))('api');var utils=require(_0x66df('0x15'));var config=require('../../config/environment');var db=require(_0x66df('0x16'))['db'];function respondWithStatusCode(_0x349f8f,_0x118d52){_0x118d52=_0x118d52||0xcc;return function(_0x6ceecc){if(_0x6ceecc){return _0x349f8f[_0x66df('0x17')](_0x118d52);}return _0x349f8f[_0x66df('0x18')](_0x118d52)['end']();};}function respondWithResult(_0x47509e,_0x266007){_0x266007=_0x266007||0xc8;return function(_0x491037){if(_0x491037){return _0x47509e['status'](_0x266007)['json'](_0x491037);}};}function respondWithFilteredResult(_0x1d2943,_0x5e810b){return function(_0x1f491c){if(_0x1f491c){var _0x5a5bd2=_0x1f491c[_0x66df('0x19')],_0x306423=_0x5e810b['offset'],_0x22e2e9=_0x5e810b[_0x66df('0x1a')]+_0x5e810b[_0x66df('0x1b')],_0x5d5379;if(_0x22e2e9>=_0x5a5bd2){_0x22e2e9=_0x5a5bd2;_0x5d5379=0xc8;}else{_0x5d5379=0xce;}_0x1d2943['status'](_0x5d5379);return _0x1d2943['set'](_0x66df('0x1c'),_0x306423+'-'+_0x22e2e9+'/'+_0x5a5bd2)[_0x66df('0x1d')](_0x1f491c);}return null;};}function patchUpdates(_0x50145f){return function(_0x4253c7){try{jsonpatch[_0x66df('0x1e')](_0x4253c7,_0x50145f,!![]);}catch(_0x235e59){return BPromise['reject'](_0x235e59);}return _0x4253c7[_0x66df('0x1f')]();};}function saveUpdates(_0x3e280f,_0x26525f){return function(_0x170d52){if(_0x170d52){return _0x170d52[_0x66df('0x20')](_0x3e280f)[_0x66df('0x21')](function(_0x11bc3b){return _0x11bc3b;});}return null;};}function removeEntity(_0x58c4b2,_0x2318d7){return function(_0xd4ffea){if(_0xd4ffea){return _0xd4ffea['destroy']()[_0x66df('0x21')](function(){_0x58c4b2['status'](0xcc)[_0x66df('0x22')]();});}};}function handleEntityNotFound(_0x2d7797,_0x8e0ee0){return function(_0x3b6791){if(!_0x3b6791){_0x2d7797['sendStatus'](0x194);}return _0x3b6791;};}function handleError(_0x5f0949,_0x1bd49e){_0x1bd49e=_0x1bd49e||0x1f4;return function(_0x34a027){logger['error'](_0x34a027[_0x66df('0x23')]);if(_0x34a027[_0x66df('0x24')]){delete _0x34a027[_0x66df('0x24')];}_0x5f0949[_0x66df('0x18')](_0x1bd49e)[_0x66df('0x25')](_0x34a027);};}exports[_0x66df('0x26')]=function(_0xfccce3,_0x3ba7d8){var _0x49b36a={},_0x1769f8={},_0x4dada7={'count':0x0,'rows':[]};var _0x2941d9=db[_0x66df('0x27')][_0x66df('0x28')];_0x1769f8[_0x66df('0x29')]=_[_0x66df('0x2a')](_0x2941d9);_0x1769f8[_0x66df('0x2b')]=_[_0x66df('0x2a')](_0xfccce3[_0x66df('0x2b')]);_0x1769f8[_0x66df('0x2c')]=_[_0x66df('0x2d')](_0x1769f8[_0x66df('0x29')],_0x1769f8[_0x66df('0x2b')]);_0x49b36a[_0x66df('0x2e')]=_[_0x66df('0x2d')](_0x1769f8[_0x66df('0x29')],qs[_0x66df('0x2f')](_0xfccce3['query'][_0x66df('0x2f')]));_0x49b36a[_0x66df('0x2e')]=_0x49b36a[_0x66df('0x2e')]['length']?_0x49b36a[_0x66df('0x2e')]:_0x1769f8[_0x66df('0x29')];if(!_0xfccce3[_0x66df('0x2b')][_0x66df('0x30')](_0x66df('0x31'))){_0x49b36a['limit']=qs[_0x66df('0x1b')](_0xfccce3[_0x66df('0x2b')][_0x66df('0x1b')]);_0x49b36a['offset']=qs['offset'](_0xfccce3[_0x66df('0x2b')][_0x66df('0x1a')]);}_0x49b36a[_0x66df('0x32')]=qs[_0x66df('0x33')](_0xfccce3[_0x66df('0x2b')][_0x66df('0x33')]);_0x49b36a['where']=qs['filters'](_[_0x66df('0x34')](_0xfccce3[_0x66df('0x2b')],_0x1769f8['filters']));if(_0xfccce3[_0x66df('0x2b')]['filter']){_0x49b36a[_0x66df('0x35')]=_[_0x66df('0x36')](_0x49b36a[_0x66df('0x35')],{'$or':_[_0x66df('0x37')](_0x2941d9,function(_0x5bf019){if(_0x5bf019['type'][_0x66df('0x38')]!==_0x66df('0x39')){var _0x5d41be={};_0x5d41be[_0x5bf019['field']]={'$like':'%'+_0xfccce3[_0x66df('0x2b')][_0x66df('0x3a')]+'%'};return _0x5d41be;}})});}_0x49b36a=_[_0x66df('0x36')]({},_0x49b36a,_0xfccce3['options']);var _0x1f5727={'where':_0x49b36a[_0x66df('0x35')]};return db['ChatQueueReport'][_0x66df('0x19')](_0x1f5727)['then'](function(_0x430f53){_0x4dada7[_0x66df('0x19')]=_0x430f53;if(_0xfccce3[_0x66df('0x2b')][_0x66df('0x3b')]){_0x49b36a['include']=[{'all':!![]}];}return db[_0x66df('0x27')][_0x66df('0x3c')](_0x49b36a);})[_0x66df('0x21')](function(_0x14b2da){_0x4dada7[_0x66df('0x3d')]=_0x14b2da;return _0x4dada7;})[_0x66df('0x21')](respondWithFilteredResult(_0x3ba7d8,_0x49b36a))[_0x66df('0x3e')](handleError(_0x3ba7d8,null));};exports[_0x66df('0x3f')]=function(_0xed12f4,_0x56c488){var _0x33cc5e={'raw':!![],'where':{'id':_0xed12f4[_0x66df('0x40')]['id']}},_0xab0901={};_0xab0901['model']=_['keys'](db[_0x66df('0x27')][_0x66df('0x28')]);_0xab0901[_0x66df('0x2b')]=_[_0x66df('0x2a')](_0xed12f4[_0x66df('0x2b')]);_0xab0901['filters']=_[_0x66df('0x2d')](_0xab0901[_0x66df('0x29')],_0xab0901[_0x66df('0x2b')]);_0x33cc5e[_0x66df('0x2e')]=_[_0x66df('0x2d')](_0xab0901['model'],qs[_0x66df('0x2f')](_0xed12f4[_0x66df('0x2b')][_0x66df('0x2f')]));_0x33cc5e['attributes']=_0x33cc5e[_0x66df('0x2e')][_0x66df('0x41')]?_0x33cc5e[_0x66df('0x2e')]:_0xab0901[_0x66df('0x29')];if(_0xed12f4['query'][_0x66df('0x3b')]){_0x33cc5e[_0x66df('0x42')]=[{'all':!![]}];}_0x33cc5e=_[_0x66df('0x36')]({},_0x33cc5e,_0xed12f4[_0x66df('0x43')]);return db[_0x66df('0x27')]['find'](_0x33cc5e)[_0x66df('0x21')](handleEntityNotFound(_0x56c488,null))[_0x66df('0x21')](respondWithResult(_0x56c488,null))[_0x66df('0x3e')](handleError(_0x56c488,null));};exports[_0x66df('0x44')]=function(_0x26e1e5,_0x4bf173){return db['ChatQueueReport'][_0x66df('0x44')](_0x26e1e5[_0x66df('0x45')],{})[_0x66df('0x21')](respondWithResult(_0x4bf173,0xc9))[_0x66df('0x3e')](handleError(_0x4bf173,null));};exports[_0x66df('0x20')]=function(_0x10db38,_0x4e1707){if(_0x10db38['body']['id']){delete _0x10db38[_0x66df('0x45')]['id'];}return db[_0x66df('0x27')][_0x66df('0x46')]({'where':{'id':_0x10db38['params']['id']}})[_0x66df('0x21')](handleEntityNotFound(_0x4e1707,null))[_0x66df('0x21')](saveUpdates(_0x10db38[_0x66df('0x45')],null))['then'](respondWithResult(_0x4e1707,null))[_0x66df('0x3e')](handleError(_0x4e1707,null));};exports[_0x66df('0x47')]=function(_0x2ba6c6,_0xb508d){return db[_0x66df('0x27')]['find']({'where':{'id':_0x2ba6c6[_0x66df('0x40')]['id']}})[_0x66df('0x21')](handleEntityNotFound(_0xb508d,null))[_0x66df('0x21')](removeEntity(_0xb508d,null))[_0x66df('0x3e')](handleError(_0xb508d,null));};exports['describe']=function(_0x22cd67,_0x304361){return db[_0x66df('0x27')][_0x66df('0x48')]()[_0x66df('0x21')](respondWithResult(_0x304361,null))[_0x66df('0x3e')](handleError(_0x304361,null));}; \ No newline at end of file +var _0xf79d=['count','offset','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','key','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','json'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf79d,0x78));var _0xdf79=function(_0x109ad3,_0x3c86da){_0x109ad3=_0x109ad3-0x0;var _0x5ed7fa=_0xf79d[_0x109ad3];return _0x5ed7fa;};'use strict';var pdf=require(_0xdf79('0x0'));var emlformat=require(_0xdf79('0x1'));var rimraf=require(_0xdf79('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf79('0x3'));var rp=require(_0xdf79('0x4'));var moment=require(_0xdf79('0x5'));var BPromise=require(_0xdf79('0x6'));var Mustache=require(_0xdf79('0x7'));var util=require(_0xdf79('0x8'));var path=require(_0xdf79('0x9'));var sox=require(_0xdf79('0xa'));var csv=require(_0xdf79('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdf79('0xc'));var crypto=require('crypto');var jsforce=require(_0xdf79('0xd'));var deskjs=require(_0xdf79('0xe'));var toCsv=require(_0xdf79('0xb'));var querystring=require(_0xdf79('0xf'));var Papa=require(_0xdf79('0x10'));var Redis=require(_0xdf79('0x11'));var authService=require(_0xdf79('0x12'));var qs=require(_0xdf79('0x13'));var hardwareService=require(_0xdf79('0x14'));var logger=require(_0xdf79('0x15'))(_0xdf79('0x16'));var utils=require('../../config/utils');var config=require(_0xdf79('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12fbf4,_0x1faf47){_0x1faf47=_0x1faf47||0xcc;return function(_0x1125dc){if(_0x1125dc){return _0x12fbf4['sendStatus'](_0x1faf47);}return _0x12fbf4[_0xdf79('0x18')](_0x1faf47)['end']();};}function respondWithResult(_0x4d8ce9,_0x387dbc){_0x387dbc=_0x387dbc||0xc8;return function(_0xba738f){if(_0xba738f){return _0x4d8ce9[_0xdf79('0x18')](_0x387dbc)[_0xdf79('0x19')](_0xba738f);}};}function respondWithFilteredResult(_0x3c9691,_0x4ecfdb){return function(_0x1a9936){if(_0x1a9936){var _0x36a1fe=_0x1a9936[_0xdf79('0x1a')],_0x12072b=_0x4ecfdb[_0xdf79('0x1b')],_0x2628ab=_0x4ecfdb['offset']+_0x4ecfdb['limit'],_0x54209b;if(_0x2628ab>=_0x36a1fe){_0x2628ab=_0x36a1fe;_0x54209b=0xc8;}else{_0x54209b=0xce;}_0x3c9691[_0xdf79('0x18')](_0x54209b);return _0x3c9691[_0xdf79('0x1c')](_0xdf79('0x1d'),_0x12072b+'-'+_0x2628ab+'/'+_0x36a1fe)['json'](_0x1a9936);}return null;};}function patchUpdates(_0x2b699a){return function(_0x26504b){try{jsonpatch[_0xdf79('0x1e')](_0x26504b,_0x2b699a,!![]);}catch(_0x1be2d5){return BPromise[_0xdf79('0x1f')](_0x1be2d5);}return _0x26504b[_0xdf79('0x20')]();};}function saveUpdates(_0x2d8828,_0x3c71bc){return function(_0x33ccaa){if(_0x33ccaa){return _0x33ccaa['update'](_0x2d8828)[_0xdf79('0x21')](function(_0x389ce1){return _0x389ce1;});}return null;};}function removeEntity(_0x34c2d8,_0x2a57cd){return function(_0x2dab7d){if(_0x2dab7d){return _0x2dab7d['destroy']()[_0xdf79('0x21')](function(){_0x34c2d8['status'](0xcc)[_0xdf79('0x22')]();});}};}function handleEntityNotFound(_0x517490,_0x357df3){return function(_0xe7b27a){if(!_0xe7b27a){_0x517490['sendStatus'](0x194);}return _0xe7b27a;};}function handleError(_0x266e95,_0xf67b1a){_0xf67b1a=_0xf67b1a||0x1f4;return function(_0x523481){logger[_0xdf79('0x23')](_0x523481[_0xdf79('0x24')]);if(_0x523481['name']){delete _0x523481[_0xdf79('0x25')];}_0x266e95[_0xdf79('0x18')](_0xf67b1a)[_0xdf79('0x26')](_0x523481);};}exports[_0xdf79('0x27')]=function(_0x557661,_0x45828b){var _0x3c172f={},_0x129cef={},_0x30110a={'count':0x0,'rows':[]};var _0xa83f5=db[_0xdf79('0x28')][_0xdf79('0x29')];_0x129cef[_0xdf79('0x2a')]=_[_0xdf79('0x2b')](_0xa83f5);_0x129cef['query']=_[_0xdf79('0x2b')](_0x557661[_0xdf79('0x2c')]);_0x129cef['filters']=_[_0xdf79('0x2d')](_0x129cef[_0xdf79('0x2a')],_0x129cef[_0xdf79('0x2c')]);_0x3c172f[_0xdf79('0x2e')]=_['intersection'](_0x129cef[_0xdf79('0x2a')],qs[_0xdf79('0x2f')](_0x557661['query']['fields']));_0x3c172f[_0xdf79('0x2e')]=_0x3c172f['attributes'][_0xdf79('0x30')]?_0x3c172f['attributes']:_0x129cef[_0xdf79('0x2a')];if(!_0x557661['query'][_0xdf79('0x31')](_0xdf79('0x32'))){_0x3c172f[_0xdf79('0x33')]=qs['limit'](_0x557661[_0xdf79('0x2c')]['limit']);_0x3c172f[_0xdf79('0x1b')]=qs['offset'](_0x557661[_0xdf79('0x2c')][_0xdf79('0x1b')]);}_0x3c172f[_0xdf79('0x34')]=qs[_0xdf79('0x35')](_0x557661[_0xdf79('0x2c')]['sort']);_0x3c172f[_0xdf79('0x36')]=qs[_0xdf79('0x37')](_[_0xdf79('0x38')](_0x557661[_0xdf79('0x2c')],_0x129cef['filters']));if(_0x557661[_0xdf79('0x2c')][_0xdf79('0x39')]){_0x3c172f[_0xdf79('0x36')]=_['merge'](_0x3c172f[_0xdf79('0x36')],{'$or':_['map'](_0xa83f5,function(_0x671f82){if(_0x671f82[_0xdf79('0x3a')][_0xdf79('0x3b')]!==_0xdf79('0x3c')){var _0x1175b4={};_0x1175b4[_0x671f82['field']]={'$like':'%'+_0x557661[_0xdf79('0x2c')]['filter']+'%'};return _0x1175b4;}})});}_0x3c172f=_[_0xdf79('0x3d')]({},_0x3c172f,_0x557661[_0xdf79('0x3e')]);var _0xf2532f={'where':_0x3c172f[_0xdf79('0x36')]};return db['ChatQueueReport'][_0xdf79('0x1a')](_0xf2532f)['then'](function(_0x54021d){_0x30110a[_0xdf79('0x1a')]=_0x54021d;if(_0x557661['query'][_0xdf79('0x3f')]){_0x3c172f[_0xdf79('0x40')]=[{'all':!![]}];}return db[_0xdf79('0x28')][_0xdf79('0x41')](_0x3c172f);})[_0xdf79('0x21')](function(_0x509cda){_0x30110a['rows']=_0x509cda;return _0x30110a;})['then'](respondWithFilteredResult(_0x45828b,_0x3c172f))[_0xdf79('0x42')](handleError(_0x45828b,null));};exports[_0xdf79('0x43')]=function(_0x491353,_0x1a72ee){var _0x454357={'raw':!![],'where':{'id':_0x491353[_0xdf79('0x44')]['id']}},_0x2b5803={};_0x2b5803[_0xdf79('0x2a')]=_['keys'](db[_0xdf79('0x28')][_0xdf79('0x29')]);_0x2b5803[_0xdf79('0x2c')]=_['keys'](_0x491353[_0xdf79('0x2c')]);_0x2b5803[_0xdf79('0x37')]=_['intersection'](_0x2b5803['model'],_0x2b5803[_0xdf79('0x2c')]);_0x454357[_0xdf79('0x2e')]=_[_0xdf79('0x2d')](_0x2b5803['model'],qs[_0xdf79('0x2f')](_0x491353[_0xdf79('0x2c')][_0xdf79('0x2f')]));_0x454357[_0xdf79('0x2e')]=_0x454357[_0xdf79('0x2e')]['length']?_0x454357['attributes']:_0x2b5803[_0xdf79('0x2a')];if(_0x491353[_0xdf79('0x2c')][_0xdf79('0x3f')]){_0x454357[_0xdf79('0x40')]=[{'all':!![]}];}_0x454357=_[_0xdf79('0x3d')]({},_0x454357,_0x491353[_0xdf79('0x3e')]);return db[_0xdf79('0x28')][_0xdf79('0x45')](_0x454357)[_0xdf79('0x21')](handleEntityNotFound(_0x1a72ee,null))[_0xdf79('0x21')](respondWithResult(_0x1a72ee,null))['catch'](handleError(_0x1a72ee,null));};exports[_0xdf79('0x46')]=function(_0xbfa89e,_0x3df555){return db[_0xdf79('0x28')][_0xdf79('0x46')](_0xbfa89e[_0xdf79('0x47')],{})[_0xdf79('0x21')](respondWithResult(_0x3df555,0xc9))[_0xdf79('0x42')](handleError(_0x3df555,null));};exports['update']=function(_0x44d016,_0x5642a8){if(_0x44d016[_0xdf79('0x47')]['id']){delete _0x44d016[_0xdf79('0x47')]['id'];}return db[_0xdf79('0x28')][_0xdf79('0x45')]({'where':{'id':_0x44d016[_0xdf79('0x44')]['id']}})[_0xdf79('0x21')](handleEntityNotFound(_0x5642a8,null))[_0xdf79('0x21')](saveUpdates(_0x44d016[_0xdf79('0x47')],null))[_0xdf79('0x21')](respondWithResult(_0x5642a8,null))[_0xdf79('0x42')](handleError(_0x5642a8,null));};exports['destroy']=function(_0x815426,_0x4264b9){return db[_0xdf79('0x28')][_0xdf79('0x45')]({'where':{'id':_0x815426[_0xdf79('0x44')]['id']}})[_0xdf79('0x21')](handleEntityNotFound(_0x4264b9,null))[_0xdf79('0x21')](removeEntity(_0x4264b9,null))[_0xdf79('0x42')](handleError(_0x4264b9,null));};exports[_0xdf79('0x48')]=function(_0x30b0b6,_0x19e993){return db[_0xdf79('0x28')]['describe']()['then'](respondWithResult(_0x19e993,null))[_0xdf79('0x42')](handleError(_0x19e993,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 83b3261..1217fef 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 _0xb37e=['../../config/environment','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','api','request-promise','path','rimraf'];(function(_0x3a3434,_0x3d6cd2){var _0x39e96f=function(_0x2f3053){while(--_0x2f3053){_0x3a3434['push'](_0x3a3434['shift']());}};_0x39e96f(++_0x3d6cd2);}(_0xb37e,0x19d));var _0xeb37=function(_0x8eb139,_0x2c9156){_0x8eb139=_0x8eb139-0x0;var _0x5e4bf7=_0xb37e[_0x8eb139];return _0x5e4bf7;};'use strict';var _=require(_0xeb37('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeb37('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb37('0x2'));var fs=require('fs');var path=require(_0xeb37('0x3'));var rimraf=require(_0xeb37('0x4'));var config=require(_0xeb37('0x5'));var attributes=require('./chatQueueReport.attributes');module[_0xeb37('0x6')]=function(_0x2b5d31,_0x49e8ae){return _0x2b5d31[_0xeb37('0x7')](_0xeb37('0x8'),attributes,{'tableName':_0xeb37('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeb37('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc55b=['bluebird','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api'];(function(_0x36c3f7,_0x4e13c8){var _0xa37210=function(_0x561a05){while(--_0x561a05){_0x36c3f7['push'](_0x36c3f7['shift']());}};_0xa37210(++_0x4e13c8);}(_0xc55b,0xa7));var _0xbc55=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc55b[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xbc55('0x0'));var logger=require(_0xbc55('0x1'))(_0xbc55('0x2'));var moment=require('moment');var BPromise=require(_0xbc55('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(_0xbc55('0x4'));module[_0xbc55('0x5')]=function(_0x1ab755,_0x2701e9){return _0x1ab755[_0xbc55('0x6')](_0xbc55('0x7'),attributes,{'tableName':_0xbc55('0x8'),'paranoid':![],'indexes':[{'name':_0xbc55('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0b450b6..eea59d9 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 _0x0165=['rpc','../../config/environment','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','body','raw','then','CreateChatQueueReport','debug','options','where','attributes','UpdateChatQueueReport','moment','ioredis','../../config/logger'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x0165,0x11f));var _0x5016=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0165[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5016('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5016('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5016('0x2'))(_0x5016('0x3'));var config=require(_0x5016('0x4'));var jayson=require(_0x5016('0x5'));var client=jayson[_0x5016('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38b3a4,_0x3adc2e,_0x24bd26){return new BPromise(function(_0x53ce04,_0x3e9176){return client[_0x5016('0x7')](_0x38b3a4,_0x24bd26)['then'](function(_0xebd184){logger[_0x5016('0x8')](_0x5016('0x9'),_0x3adc2e,_0x5016('0xa'));logger['debug'](_0x5016('0xb'),_0x3adc2e,_0x5016('0xa'),JSON[_0x5016('0xc')](_0xebd184));if(_0xebd184[_0x5016('0xd')]){if(_0xebd184['error'][_0x5016('0xe')]===0x1f4){logger['error'](_0x5016('0x9'),_0x3adc2e,_0xebd184[_0x5016('0xd')][_0x5016('0xf')]);return _0x3e9176(_0xebd184['error'][_0x5016('0xf')]);}logger[_0x5016('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3adc2e,_0xebd184[_0x5016('0xd')][_0x5016('0xf')]);return _0x53ce04(_0xebd184['error'][_0x5016('0xf')]);}else{logger[_0x5016('0x8')](_0x5016('0x9'),_0x3adc2e,'request\x20sent');_0x53ce04(_0xebd184[_0x5016('0x10')]['message']);}})[_0x5016('0x11')](function(_0x1f000f){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3adc2e,_0x1f000f);_0x3e9176(_0x1f000f);});});}exports['CreateChatQueueReport']=function(_0x1365dd){var _0x5ac89d=this;return new Promise(function(_0x12a896,_0x652324){return db[_0x5016('0x12')][_0x5016('0x13')](_0x1365dd[_0x5016('0x14')],{'raw':_0x1365dd['options']?_0x1365dd['options'][_0x5016('0x15')]===undefined?!![]:![]:!![]})[_0x5016('0x16')](function(_0x3035c7){logger[_0x5016('0x8')](_0x5016('0x17'),_0x1365dd);logger[_0x5016('0x18')](_0x5016('0x17'),_0x1365dd,JSON['stringify'](_0x3035c7));_0x12a896(_0x3035c7);})[_0x5016('0x11')](function(_0x50c020){logger[_0x5016('0xd')]('CreateChatQueueReport',_0x50c020[_0x5016('0xf')],_0x1365dd);_0x652324(_0x5ac89d['error'](0x1f4,_0x50c020[_0x5016('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x5adcbc){var _0x56ff57=this;return new Promise(function(_0x1f1110,_0x265312){return db[_0x5016('0x12')]['update'](_0x5adcbc['body'],{'raw':_0x5adcbc[_0x5016('0x19')]?_0x5adcbc[_0x5016('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5adcbc[_0x5016('0x19')]?_0x5adcbc[_0x5016('0x19')][_0x5016('0x1a')]||null:null,'attributes':_0x5adcbc[_0x5016('0x19')]?_0x5adcbc[_0x5016('0x19')][_0x5016('0x1b')]||null:null,'limit':_0x5adcbc[_0x5016('0x19')]?_0x5adcbc[_0x5016('0x19')]['limit']||null:null})['then'](function(_0x34ebd1){logger[_0x5016('0x8')](_0x5016('0x1c'),_0x5adcbc);logger['debug']('UpdateChatQueueReport',_0x5adcbc,JSON[_0x5016('0xc')](_0x34ebd1));_0x1f1110(_0x34ebd1);})['catch'](function(_0x1f1f41){logger[_0x5016('0xd')]('UpdateChatQueueReport',_0x1f1f41[_0x5016('0xf')],_0x5adcbc);_0x265312(_0x56ff57[_0x5016('0xd')](0x1f4,_0x1f1f41[_0x5016('0xf')]));});});}; \ No newline at end of file +var _0x4daa=['../../config/logger','jayson/promise','client','request','then','request\x20sent','debug','error','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','body','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x55d893,_0x325ebe){var _0x52d152=function(_0x5e6314){while(--_0x5e6314){_0x55d893['push'](_0x55d893['shift']());}};_0x52d152(++_0x325ebe);}(_0x4daa,0x1ca));var _0xa4da=function(_0x591e11,_0x363e09){_0x591e11=_0x591e11-0x0;var _0x23a0a=_0x4daa[_0x591e11];return _0x23a0a;};'use strict';var _=require(_0xa4da('0x0'));var util=require(_0xa4da('0x1'));var moment=require('moment');var BPromise=require(_0xa4da('0x2'));var rs=require(_0xa4da('0x3'));var fs=require('fs');var Redis=require(_0xa4da('0x4'));var db=require(_0xa4da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4da('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa4da('0x7'));var client=jayson[_0xa4da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e7666,_0x322ec1,_0x1508af){return new BPromise(function(_0x4eb9b4,_0x289e9c){return client[_0xa4da('0x9')](_0x5e7666,_0x1508af)[_0xa4da('0xa')](function(_0x48b8d5){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x322ec1,_0xa4da('0xb'));logger[_0xa4da('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x322ec1,'request\x20sent',JSON['stringify'](_0x48b8d5));if(_0x48b8d5['error']){if(_0x48b8d5[_0xa4da('0xd')]['code']===0x1f4){logger[_0xa4da('0xd')](_0xa4da('0xe'),_0x322ec1,_0x48b8d5['error'][_0xa4da('0xf')]);return _0x289e9c(_0x48b8d5[_0xa4da('0xd')][_0xa4da('0xf')]);}logger['error'](_0xa4da('0xe'),_0x322ec1,_0x48b8d5[_0xa4da('0xd')][_0xa4da('0xf')]);return _0x4eb9b4(_0x48b8d5[_0xa4da('0xd')][_0xa4da('0xf')]);}else{logger[_0xa4da('0x10')](_0xa4da('0xe'),_0x322ec1,_0xa4da('0xb'));_0x4eb9b4(_0x48b8d5[_0xa4da('0x11')]['message']);}})[_0xa4da('0x12')](function(_0x19438a){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x322ec1,_0x19438a);_0x289e9c(_0x19438a);});});}exports['CreateChatQueueReport']=function(_0x593ceb){var _0x172629=this;return new Promise(function(_0x991f93,_0x53bffa){return db[_0xa4da('0x13')][_0xa4da('0x14')](_0x593ceb['body'],{'raw':_0x593ceb[_0xa4da('0x15')]?_0x593ceb[_0xa4da('0x15')][_0xa4da('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x42897c){logger[_0xa4da('0x10')]('CreateChatQueueReport',_0x593ceb);logger[_0xa4da('0xc')](_0xa4da('0x17'),_0x593ceb,JSON[_0xa4da('0x18')](_0x42897c));_0x991f93(_0x42897c);})[_0xa4da('0x12')](function(_0x2dd656){logger['error'](_0xa4da('0x17'),_0x2dd656[_0xa4da('0xf')],_0x593ceb);_0x53bffa(_0x172629[_0xa4da('0xd')](0x1f4,_0x2dd656[_0xa4da('0xf')]));});});};exports[_0xa4da('0x19')]=function(_0x7c3b51){var _0x290694=this;return new Promise(function(_0x5b4bf9,_0x22461d){return db['ChatQueueReport'][_0xa4da('0x1a')](_0x7c3b51[_0xa4da('0x1b')],{'raw':_0x7c3b51[_0xa4da('0x15')]?_0x7c3b51['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7c3b51[_0xa4da('0x15')]?_0x7c3b51[_0xa4da('0x15')]['where']||null:null,'attributes':_0x7c3b51[_0xa4da('0x15')]?_0x7c3b51[_0xa4da('0x15')]['attributes']||null:null,'limit':_0x7c3b51[_0xa4da('0x15')]?_0x7c3b51[_0xa4da('0x15')][_0xa4da('0x1c')]||null:null})[_0xa4da('0xa')](function(_0x2bcd32){logger[_0xa4da('0x10')](_0xa4da('0x19'),_0x7c3b51);logger['debug'](_0xa4da('0x19'),_0x7c3b51,JSON[_0xa4da('0x18')](_0x2bcd32));_0x5b4bf9(_0x2bcd32);})[_0xa4da('0x12')](function(_0x5e8df3){logger[_0xa4da('0xd')](_0xa4da('0x19'),_0x5e8df3[_0xa4da('0xf')],_0x7c3b51);_0x22461d(_0x290694[_0xa4da('0xd')](0x1f4,_0x5e8df3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 067a7e3..93d3543 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 _0x6802=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0xd60e4,_0x13204b){var _0x41e8e2=function(_0x3eda13){while(--_0x3eda13){_0xd60e4['push'](_0xd60e4['shift']());}};_0x41e8e2(++_0x13204b);}(_0x6802,0x161));var _0x2680=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6802[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x2680('0x0'));var util=require(_0x2680('0x1'));var path=require(_0x2680('0x2'));var timeout=require(_0x2680('0x3'));var express=require(_0x2680('0x4'));var router=express[_0x2680('0x5')]();var auth=require(_0x2680('0x6'));var interaction=require(_0x2680('0x7'));var config=require(_0x2680('0x8'));var controller=require(_0x2680('0x9'));router[_0x2680('0xa')]('/',auth[_0x2680('0xb')](),controller[_0x2680('0xc')]);router['get'](_0x2680('0xd'),auth['isAuthenticated'](),controller[_0x2680('0xe')]);router[_0x2680('0xa')](_0x2680('0xf'),auth[_0x2680('0xb')](),controller['show']);router[_0x2680('0x10')]('/',auth[_0x2680('0xb')](),controller[_0x2680('0x11')]);router[_0x2680('0x12')](_0x2680('0xf'),auth[_0x2680('0xb')](),controller[_0x2680('0x13')]);router[_0x2680('0x14')]('/:id',auth[_0x2680('0xb')](),controller[_0x2680('0x15')]);module['exports']=router; \ No newline at end of file +var _0x875f=['exports','multer','connect-timeout','Router','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x43e277,_0x4687d3){var _0x47dc9f=function(_0x2b946c){while(--_0x2b946c){_0x43e277['push'](_0x43e277['shift']());}};_0x47dc9f(++_0x4687d3);}(_0x875f,0x6a));var _0xf875=function(_0x55bdd4,_0xbbe031){_0x55bdd4=_0x55bdd4-0x0;var _0x182a7e=_0x875f[_0x55bdd4];return _0x182a7e;};'use strict';var multer=require(_0xf875('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf875('0x1'));var express=require('express');var router=express[_0xf875('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf875('0x3'));router[_0xf875('0x4')]('/',auth['isAuthenticated'](),controller[_0xf875('0x5')]);router['get'](_0xf875('0x6'),auth[_0xf875('0x7')](),controller['describe']);router[_0xf875('0x4')]('/:id',auth[_0xf875('0x7')](),controller[_0xf875('0x8')]);router['post']('/',auth[_0xf875('0x7')](),controller['create']);router[_0xf875('0x9')](_0xf875('0xa'),auth[_0xf875('0x7')](),controller[_0xf875('0xb')]);router[_0xf875('0xc')](_0xf875('0xa'),auth[_0xf875('0x7')](),controller[_0xf875('0xd')]);module[_0xf875('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 73128a9..f3f3522 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 _0x2f86=['queue','STRING','account'];(function(_0x418e85,_0x5446aa){var _0x539ed6=function(_0x444ae4){while(--_0x444ae4){_0x418e85['push'](_0x418e85['shift']());}};_0x539ed6(++_0x5446aa);}(_0x2f86,0x70));var _0x62f8=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x2f86[_0x17928f];return _0x500b63;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x62f8('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x62f8('0x1'),'agent',_0x62f8('0x2')),'allowNull':![],'defaultValue':_0x62f8('0x2')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb21f=['queue','DATE','NOW','moment','ENUM','account','agent'];(function(_0x3ddded,_0x2fcd26){var _0x4df199=function(_0x37aacb){while(--_0x37aacb){_0x3ddded['push'](_0x3ddded['shift']());}};_0x4df199(++_0x2fcd26);}(_0xb21f,0x145));var _0xfb21=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xb21f[_0x1e4360];return _0x31e6b4;};'use strict';var moment=require(_0xfb21('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfb21('0x1')](_0xfb21('0x2'),_0xfb21('0x3'),'queue'),'allowNull':![],'defaultValue':_0xfb21('0x4')},'transferredAt':{'type':Sequelize[_0xfb21('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xfb21('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d44a926..6dd9233 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 _0xb4c7=['mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x58eaef,_0x450a57){_0x58eaef=_0x58eaef-0x0;var _0x441bb7=_0xb4c7[_0x58eaef];return _0x441bb7;};'use strict';var pdf=require(_0x7b4c('0x0'));var emlformat=require(_0x7b4c('0x1'));var rimraf=require(_0x7b4c('0x2'));var zipdir=require(_0x7b4c('0x3'));var jsonpatch=require(_0x7b4c('0x4'));var rp=require('request-promise');var moment=require(_0x7b4c('0x5'));var BPromise=require(_0x7b4c('0x6'));var Mustache=require(_0x7b4c('0x7'));var util=require(_0x7b4c('0x8'));var path=require(_0x7b4c('0x9'));var sox=require('sox');var csv=require(_0x7b4c('0xa'));var ejs=require(_0x7b4c('0xb'));var fs=require('fs');var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xa'));var querystring=require(_0x7b4c('0xf'));var Papa=require(_0x7b4c('0x10'));var Redis=require(_0x7b4c('0x11'));var authService=require(_0x7b4c('0x12'));var qs=require(_0x7b4c('0x13'));var hardwareService=require(_0x7b4c('0x14'));var logger=require(_0x7b4c('0x15'))(_0x7b4c('0x16'));var utils=require(_0x7b4c('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24dd7d,_0x18342b){_0x18342b=_0x18342b||0xcc;return function(_0x38656b){if(_0x38656b){return _0x24dd7d[_0x7b4c('0x18')](_0x18342b);}return _0x24dd7d[_0x7b4c('0x19')](_0x18342b)[_0x7b4c('0x1a')]();};}function respondWithResult(_0x3ea0da,_0x40c830){_0x40c830=_0x40c830||0xc8;return function(_0x25b90b){if(_0x25b90b){return _0x3ea0da[_0x7b4c('0x19')](_0x40c830)['json'](_0x25b90b);}};}function respondWithFilteredResult(_0x2edb77,_0x3d8362){return function(_0xdc71cd){if(_0xdc71cd){var _0x2a0e2f=_0xdc71cd[_0x7b4c('0x1b')],_0xa0a812=_0x3d8362['offset'],_0x2471b3=_0x3d8362[_0x7b4c('0x1c')]+_0x3d8362[_0x7b4c('0x1d')],_0x1642e1;if(_0x2471b3>=_0x2a0e2f){_0x2471b3=_0x2a0e2f;_0x1642e1=0xc8;}else{_0x1642e1=0xce;}_0x2edb77[_0x7b4c('0x19')](_0x1642e1);return _0x2edb77[_0x7b4c('0x1e')]('Content-Range',_0xa0a812+'-'+_0x2471b3+'/'+_0x2a0e2f)[_0x7b4c('0x1f')](_0xdc71cd);}return null;};}function patchUpdates(_0x3d314d){return function(_0x32110e){try{jsonpatch[_0x7b4c('0x20')](_0x32110e,_0x3d314d,!![]);}catch(_0x2d4c72){return BPromise[_0x7b4c('0x21')](_0x2d4c72);}return _0x32110e[_0x7b4c('0x22')]();};}function saveUpdates(_0x445281,_0x3556d8){return function(_0x55e3df){if(_0x55e3df){return _0x55e3df[_0x7b4c('0x23')](_0x445281)[_0x7b4c('0x24')](function(_0x11996d){return _0x11996d;});}return null;};}function removeEntity(_0xabeffb,_0x148a79){return function(_0x168ac9){if(_0x168ac9){return _0x168ac9[_0x7b4c('0x25')]()[_0x7b4c('0x24')](function(){_0xabeffb[_0x7b4c('0x19')](0xcc)[_0x7b4c('0x1a')]();});}};}function handleEntityNotFound(_0x5eec1e,_0x45438c){return function(_0x4350c9){if(!_0x4350c9){_0x5eec1e[_0x7b4c('0x18')](0x194);}return _0x4350c9;};}function handleError(_0x3157b8,_0x3124e7){_0x3124e7=_0x3124e7||0x1f4;return function(_0x2bdc4d){logger[_0x7b4c('0x26')](_0x2bdc4d[_0x7b4c('0x27')]);if(_0x2bdc4d[_0x7b4c('0x28')]){delete _0x2bdc4d[_0x7b4c('0x28')];}_0x3157b8[_0x7b4c('0x19')](_0x3124e7)[_0x7b4c('0x29')](_0x2bdc4d);};}exports[_0x7b4c('0x2a')]=function(_0x501f75,_0x27f361){var _0x3ab614={},_0x1fe0f5={},_0x3671c4={'count':0x0,'rows':[]};var _0x207c2f=db[_0x7b4c('0x2b')][_0x7b4c('0x2c')];_0x1fe0f5[_0x7b4c('0x2d')]=_[_0x7b4c('0x2e')](_0x207c2f);_0x1fe0f5[_0x7b4c('0x2f')]=_[_0x7b4c('0x2e')](_0x501f75[_0x7b4c('0x2f')]);_0x1fe0f5[_0x7b4c('0x30')]=_[_0x7b4c('0x31')](_0x1fe0f5[_0x7b4c('0x2d')],_0x1fe0f5[_0x7b4c('0x2f')]);_0x3ab614[_0x7b4c('0x32')]=_[_0x7b4c('0x31')](_0x1fe0f5[_0x7b4c('0x2d')],qs['fields'](_0x501f75['query']['fields']));_0x3ab614[_0x7b4c('0x32')]=_0x3ab614[_0x7b4c('0x32')][_0x7b4c('0x33')]?_0x3ab614[_0x7b4c('0x32')]:_0x1fe0f5['model'];if(!_0x501f75[_0x7b4c('0x2f')][_0x7b4c('0x34')]('nolimit')){_0x3ab614[_0x7b4c('0x1d')]=qs['limit'](_0x501f75[_0x7b4c('0x2f')][_0x7b4c('0x1d')]);_0x3ab614[_0x7b4c('0x1c')]=qs['offset'](_0x501f75[_0x7b4c('0x2f')][_0x7b4c('0x1c')]);}_0x3ab614['order']=qs[_0x7b4c('0x35')](_0x501f75[_0x7b4c('0x2f')][_0x7b4c('0x35')]);_0x3ab614[_0x7b4c('0x36')]=qs['filters'](_['pick'](_0x501f75[_0x7b4c('0x2f')],_0x1fe0f5[_0x7b4c('0x30')]));if(_0x501f75['query'][_0x7b4c('0x37')]){_0x3ab614['where']=_['merge'](_0x3ab614[_0x7b4c('0x36')],{'$or':_[_0x7b4c('0x38')](_0x207c2f,function(_0x39d69a){if(_0x39d69a[_0x7b4c('0x39')]['key']!==_0x7b4c('0x3a')){var _0x166189={};_0x166189[_0x39d69a[_0x7b4c('0x3b')]]={'$like':'%'+_0x501f75[_0x7b4c('0x2f')][_0x7b4c('0x37')]+'%'};return _0x166189;}})});}_0x3ab614=_[_0x7b4c('0x3c')]({},_0x3ab614,_0x501f75[_0x7b4c('0x3d')]);var _0x4c23cc={'where':_0x3ab614['where']};return db[_0x7b4c('0x2b')][_0x7b4c('0x1b')](_0x4c23cc)[_0x7b4c('0x24')](function(_0x123a3a){_0x3671c4[_0x7b4c('0x1b')]=_0x123a3a;if(_0x501f75['query'][_0x7b4c('0x3e')]){_0x3ab614[_0x7b4c('0x3f')]=[{'all':!![]}];}return db[_0x7b4c('0x2b')][_0x7b4c('0x40')](_0x3ab614);})[_0x7b4c('0x24')](function(_0x25659d){_0x3671c4[_0x7b4c('0x41')]=_0x25659d;return _0x3671c4;})[_0x7b4c('0x24')](respondWithFilteredResult(_0x27f361,_0x3ab614))[_0x7b4c('0x42')](handleError(_0x27f361,null));};exports['show']=function(_0x2a4085,_0x562838){var _0x2a3a74={'raw':!![],'where':{'id':_0x2a4085[_0x7b4c('0x43')]['id']}},_0x4dc71f={};_0x4dc71f[_0x7b4c('0x2d')]=_['keys'](db['ChatTransferReport'][_0x7b4c('0x2c')]);_0x4dc71f[_0x7b4c('0x2f')]=_[_0x7b4c('0x2e')](_0x2a4085[_0x7b4c('0x2f')]);_0x4dc71f['filters']=_[_0x7b4c('0x31')](_0x4dc71f[_0x7b4c('0x2d')],_0x4dc71f[_0x7b4c('0x2f')]);_0x2a3a74['attributes']=_[_0x7b4c('0x31')](_0x4dc71f['model'],qs['fields'](_0x2a4085[_0x7b4c('0x2f')]['fields']));_0x2a3a74[_0x7b4c('0x32')]=_0x2a3a74[_0x7b4c('0x32')][_0x7b4c('0x33')]?_0x2a3a74[_0x7b4c('0x32')]:_0x4dc71f[_0x7b4c('0x2d')];if(_0x2a4085[_0x7b4c('0x2f')][_0x7b4c('0x3e')]){_0x2a3a74[_0x7b4c('0x3f')]=[{'all':!![]}];}_0x2a3a74=_[_0x7b4c('0x3c')]({},_0x2a3a74,_0x2a4085['options']);return db[_0x7b4c('0x2b')]['find'](_0x2a3a74)['then'](handleEntityNotFound(_0x562838,null))[_0x7b4c('0x24')](respondWithResult(_0x562838,null))[_0x7b4c('0x42')](handleError(_0x562838,null));};exports['create']=function(_0x529fde,_0x255cca){return db[_0x7b4c('0x2b')][_0x7b4c('0x44')](_0x529fde[_0x7b4c('0x45')],{})[_0x7b4c('0x24')](respondWithResult(_0x255cca,0xc9))[_0x7b4c('0x42')](handleError(_0x255cca,null));};exports[_0x7b4c('0x23')]=function(_0x1cf7c7,_0x57ad8c){if(_0x1cf7c7[_0x7b4c('0x45')]['id']){delete _0x1cf7c7[_0x7b4c('0x45')]['id'];}return db[_0x7b4c('0x2b')][_0x7b4c('0x46')]({'where':{'id':_0x1cf7c7[_0x7b4c('0x43')]['id']}})[_0x7b4c('0x24')](handleEntityNotFound(_0x57ad8c,null))[_0x7b4c('0x24')](saveUpdates(_0x1cf7c7[_0x7b4c('0x45')],null))[_0x7b4c('0x24')](respondWithResult(_0x57ad8c,null))['catch'](handleError(_0x57ad8c,null));};exports['destroy']=function(_0x1884a4,_0x3f6aaa){return db[_0x7b4c('0x2b')]['find']({'where':{'id':_0x1884a4[_0x7b4c('0x43')]['id']}})[_0x7b4c('0x24')](handleEntityNotFound(_0x3f6aaa,null))['then'](removeEntity(_0x3f6aaa,null))[_0x7b4c('0x42')](handleError(_0x3f6aaa,null));};exports['describe']=function(_0x19d8dd,_0x528472){return db[_0x7b4c('0x2b')]['describe']()[_0x7b4c('0x24')](respondWithResult(_0x528472,null))[_0x7b4c('0x42')](handleError(_0x528472,null));}; \ No newline at end of file +var _0x4819=['moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatTransferReport','model','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x498396,_0x395c9a){var _0x1b0fbd=function(_0x1c511e){while(--_0x1c511e){_0x498396['push'](_0x498396['shift']());}};_0x1b0fbd(++_0x395c9a);}(_0x4819,0xcd));var _0x9481=function(_0x11ad65,_0x352d3c){_0x11ad65=_0x11ad65-0x0;var _0x35590c=_0x4819[_0x11ad65];return _0x35590c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9481('0x0'));var rimraf=require(_0x9481('0x1'));var zipdir=require(_0x9481('0x2'));var jsonpatch=require(_0x9481('0x3'));var rp=require(_0x9481('0x4'));var moment=require(_0x9481('0x5'));var BPromise=require(_0x9481('0x6'));var Mustache=require(_0x9481('0x7'));var util=require(_0x9481('0x8'));var path=require(_0x9481('0x9'));var sox=require('sox');var csv=require(_0x9481('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xa'));var querystring=require('querystring');var Papa=require(_0x9481('0xf'));var Redis=require('ioredis');var authService=require(_0x9481('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9481('0x11'));var logger=require(_0x9481('0x12'))(_0x9481('0x13'));var utils=require(_0x9481('0x14'));var config=require(_0x9481('0x15'));var db=require(_0x9481('0x16'))['db'];function respondWithStatusCode(_0xa38c93,_0xe410c3){_0xe410c3=_0xe410c3||0xcc;return function(_0xed8e9){if(_0xed8e9){return _0xa38c93['sendStatus'](_0xe410c3);}return _0xa38c93['status'](_0xe410c3)[_0x9481('0x17')]();};}function respondWithResult(_0x150276,_0x2f0032){_0x2f0032=_0x2f0032||0xc8;return function(_0x28fcb6){if(_0x28fcb6){return _0x150276[_0x9481('0x18')](_0x2f0032)[_0x9481('0x19')](_0x28fcb6);}};}function respondWithFilteredResult(_0x3fb97f,_0x495b30){return function(_0x4220f1){if(_0x4220f1){var _0x7a7ee=_0x4220f1[_0x9481('0x1a')],_0x5b1fe6=_0x495b30[_0x9481('0x1b')],_0x2266d5=_0x495b30[_0x9481('0x1b')]+_0x495b30[_0x9481('0x1c')],_0x518150;if(_0x2266d5>=_0x7a7ee){_0x2266d5=_0x7a7ee;_0x518150=0xc8;}else{_0x518150=0xce;}_0x3fb97f['status'](_0x518150);return _0x3fb97f['set'](_0x9481('0x1d'),_0x5b1fe6+'-'+_0x2266d5+'/'+_0x7a7ee)['json'](_0x4220f1);}return null;};}function patchUpdates(_0x4d0da7){return function(_0x26671c){try{jsonpatch[_0x9481('0x1e')](_0x26671c,_0x4d0da7,!![]);}catch(_0x18c6f5){return BPromise[_0x9481('0x1f')](_0x18c6f5);}return _0x26671c[_0x9481('0x20')]();};}function saveUpdates(_0x3dc33f,_0x55a1bd){return function(_0x2cf1aa){if(_0x2cf1aa){return _0x2cf1aa[_0x9481('0x21')](_0x3dc33f)[_0x9481('0x22')](function(_0x615e02){return _0x615e02;});}return null;};}function removeEntity(_0xb5cd2c,_0x56da97){return function(_0x215dd7){if(_0x215dd7){return _0x215dd7[_0x9481('0x23')]()['then'](function(){_0xb5cd2c[_0x9481('0x18')](0xcc)[_0x9481('0x17')]();});}};}function handleEntityNotFound(_0x352b3a,_0x1809d2){return function(_0x2dc02e){if(!_0x2dc02e){_0x352b3a['sendStatus'](0x194);}return _0x2dc02e;};}function handleError(_0x91e3d9,_0x22f0b5){_0x22f0b5=_0x22f0b5||0x1f4;return function(_0x56c889){logger['error'](_0x56c889[_0x9481('0x24')]);if(_0x56c889[_0x9481('0x25')]){delete _0x56c889['name'];}_0x91e3d9[_0x9481('0x18')](_0x22f0b5)[_0x9481('0x26')](_0x56c889);};}exports[_0x9481('0x27')]=function(_0x28ae1b,_0x5a1300){var _0x14f03e={},_0x3ca064={},_0x3c2585={'count':0x0,'rows':[]};var _0x587706=db[_0x9481('0x28')]['rawAttributes'];_0x3ca064[_0x9481('0x29')]=_[_0x9481('0x2a')](_0x587706);_0x3ca064[_0x9481('0x2b')]=_[_0x9481('0x2a')](_0x28ae1b[_0x9481('0x2b')]);_0x3ca064['filters']=_[_0x9481('0x2c')](_0x3ca064[_0x9481('0x29')],_0x3ca064[_0x9481('0x2b')]);_0x14f03e['attributes']=_['intersection'](_0x3ca064[_0x9481('0x29')],qs[_0x9481('0x2d')](_0x28ae1b[_0x9481('0x2b')][_0x9481('0x2d')]));_0x14f03e['attributes']=_0x14f03e['attributes']['length']?_0x14f03e[_0x9481('0x2e')]:_0x3ca064['model'];if(!_0x28ae1b[_0x9481('0x2b')]['hasOwnProperty'](_0x9481('0x2f'))){_0x14f03e[_0x9481('0x1c')]=qs[_0x9481('0x1c')](_0x28ae1b[_0x9481('0x2b')][_0x9481('0x1c')]);_0x14f03e['offset']=qs[_0x9481('0x1b')](_0x28ae1b[_0x9481('0x2b')][_0x9481('0x1b')]);}_0x14f03e['order']=qs[_0x9481('0x30')](_0x28ae1b[_0x9481('0x2b')][_0x9481('0x30')]);_0x14f03e[_0x9481('0x31')]=qs[_0x9481('0x32')](_[_0x9481('0x33')](_0x28ae1b['query'],_0x3ca064[_0x9481('0x32')]));if(_0x28ae1b['query'][_0x9481('0x34')]){_0x14f03e[_0x9481('0x31')]=_[_0x9481('0x35')](_0x14f03e[_0x9481('0x31')],{'$or':_[_0x9481('0x36')](_0x587706,function(_0x2face9){if(_0x2face9['type'][_0x9481('0x37')]!==_0x9481('0x38')){var _0x4ed991={};_0x4ed991[_0x2face9['field']]={'$like':'%'+_0x28ae1b[_0x9481('0x2b')]['filter']+'%'};return _0x4ed991;}})});}_0x14f03e=_[_0x9481('0x35')]({},_0x14f03e,_0x28ae1b[_0x9481('0x39')]);var _0x2c2a1e={'where':_0x14f03e[_0x9481('0x31')]};return db['ChatTransferReport'][_0x9481('0x1a')](_0x2c2a1e)['then'](function(_0x62b05b){_0x3c2585['count']=_0x62b05b;if(_0x28ae1b[_0x9481('0x2b')]['includeAll']){_0x14f03e[_0x9481('0x3a')]=[{'all':!![]}];}return db[_0x9481('0x28')][_0x9481('0x3b')](_0x14f03e);})[_0x9481('0x22')](function(_0x97dc3e){_0x3c2585[_0x9481('0x3c')]=_0x97dc3e;return _0x3c2585;})[_0x9481('0x22')](respondWithFilteredResult(_0x5a1300,_0x14f03e))['catch'](handleError(_0x5a1300,null));};exports[_0x9481('0x3d')]=function(_0x3857e8,_0x406e4a){var _0x30168b={'raw':!![],'where':{'id':_0x3857e8[_0x9481('0x3e')]['id']}},_0x3f1b6f={};_0x3f1b6f[_0x9481('0x29')]=_['keys'](db[_0x9481('0x28')][_0x9481('0x3f')]);_0x3f1b6f['query']=_[_0x9481('0x2a')](_0x3857e8[_0x9481('0x2b')]);_0x3f1b6f[_0x9481('0x32')]=_[_0x9481('0x2c')](_0x3f1b6f[_0x9481('0x29')],_0x3f1b6f['query']);_0x30168b[_0x9481('0x2e')]=_['intersection'](_0x3f1b6f[_0x9481('0x29')],qs[_0x9481('0x2d')](_0x3857e8['query']['fields']));_0x30168b[_0x9481('0x2e')]=_0x30168b[_0x9481('0x2e')][_0x9481('0x40')]?_0x30168b['attributes']:_0x3f1b6f[_0x9481('0x29')];if(_0x3857e8[_0x9481('0x2b')]['includeAll']){_0x30168b['include']=[{'all':!![]}];}_0x30168b=_[_0x9481('0x35')]({},_0x30168b,_0x3857e8['options']);return db[_0x9481('0x28')][_0x9481('0x41')](_0x30168b)[_0x9481('0x22')](handleEntityNotFound(_0x406e4a,null))[_0x9481('0x22')](respondWithResult(_0x406e4a,null))[_0x9481('0x42')](handleError(_0x406e4a,null));};exports['create']=function(_0xc1fcfc,_0xc1bb0e){return db['ChatTransferReport'][_0x9481('0x43')](_0xc1fcfc[_0x9481('0x44')],{})[_0x9481('0x22')](respondWithResult(_0xc1bb0e,0xc9))[_0x9481('0x42')](handleError(_0xc1bb0e,null));};exports[_0x9481('0x21')]=function(_0x3929a8,_0x3a1bee){if(_0x3929a8[_0x9481('0x44')]['id']){delete _0x3929a8[_0x9481('0x44')]['id'];}return db['ChatTransferReport'][_0x9481('0x41')]({'where':{'id':_0x3929a8['params']['id']}})['then'](handleEntityNotFound(_0x3a1bee,null))[_0x9481('0x22')](saveUpdates(_0x3929a8['body'],null))[_0x9481('0x22')](respondWithResult(_0x3a1bee,null))[_0x9481('0x42')](handleError(_0x3a1bee,null));};exports['destroy']=function(_0x277e2a,_0x1044a2){return db[_0x9481('0x28')][_0x9481('0x41')]({'where':{'id':_0x277e2a[_0x9481('0x3e')]['id']}})[_0x9481('0x22')](handleEntityNotFound(_0x1044a2,null))['then'](removeEntity(_0x1044a2,null))['catch'](handleError(_0x1044a2,null));};exports[_0x9481('0x45')]=function(_0x44d7e0,_0x728c42){return db[_0x9481('0x28')][_0x9481('0x45')]()[_0x9481('0x22')](respondWithResult(_0x728c42,null))[_0x9481('0x42')](handleError(_0x728c42,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 14961b1..af7136f 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 _0x56dc=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4c9526,_0x47e121){var _0x1e0e51=function(_0x2514bb){while(--_0x2514bb){_0x4c9526['push'](_0x4c9526['shift']());}};_0x1e0e51(++_0x47e121);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var util=require('util');var logger=require(_0xc56d('0x1'))(_0xc56d('0x2'));var moment=require(_0xc56d('0x3'));var BPromise=require(_0xc56d('0x4'));var rp=require(_0xc56d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc56d('0x6'));var config=require(_0xc56d('0x7'));var attributes=require(_0xc56d('0x8'));module[_0xc56d('0x9')]=function(_0x3eb4ed,_0x3e68f4){return _0x3eb4ed['define'](_0xc56d('0xa'),attributes,{'tableName':_0xc56d('0xb'),'paranoid':![],'indexes':[{'name':_0xc56d('0xc'),'fields':[_0xc56d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80ed=['request-promise','path','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x246d13,_0x3291fb){var _0x3a42c9=function(_0x3da035){while(--_0x3da035){_0x246d13['push'](_0x246d13['shift']());}};_0x3a42c9(++_0x3291fb);}(_0x80ed,0x11c));var _0xd80e=function(_0x373f77,_0x42f692){_0x373f77=_0x373f77-0x0;var _0xcc9cb8=_0x80ed[_0x373f77];return _0xcc9cb8;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[{'name':_0xd80e('0xb'),'fields':[_0xd80e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index cf15873..48c963c 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 _0x4e34=['error','code','message','ChatTransferReport,\x20%s,\x20%s','request\x20sent','catch','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4e34,0x19e));var _0x44e3=function(_0x22d8df,_0x2e84b9){_0x22d8df=_0x22d8df-0x0;var _0x5a6306=_0x4e34[_0x22d8df];return _0x5a6306;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44e3('0x0'));var BPromise=require(_0x44e3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44e3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x44e3('0x3'))(_0x44e3('0x4'));var config=require(_0x44e3('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44e3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x19e7de,_0x163879,_0x1ca56e){return new BPromise(function(_0x37b7d4,_0x196941){return client[_0x44e3('0x7')](_0x19e7de,_0x1ca56e)['then'](function(_0xf7e448){logger[_0x44e3('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x163879,'request\x20sent');logger[_0x44e3('0x9')](_0x44e3('0xa'),_0x163879,'request\x20sent',JSON['stringify'](_0xf7e448));if(_0xf7e448[_0x44e3('0xb')]){if(_0xf7e448[_0x44e3('0xb')][_0x44e3('0xc')]===0x1f4){logger[_0x44e3('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x163879,_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);return _0x196941(_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);}logger[_0x44e3('0xb')](_0x44e3('0xe'),_0x163879,_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);return _0x37b7d4(_0xf7e448['error'][_0x44e3('0xd')]);}else{logger['info'](_0x44e3('0xe'),_0x163879,_0x44e3('0xf'));_0x37b7d4(_0xf7e448['result'][_0x44e3('0xd')]);}})[_0x44e3('0x10')](function(_0x103eb0){logger[_0x44e3('0xb')](_0x44e3('0xe'),_0x163879,_0x103eb0);_0x196941(_0x103eb0);});});} \ No newline at end of file +var _0x94cc=['util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x136e17,_0x4cc300){var _0x5099c9=function(_0xbbbb80){while(--_0xbbbb80){_0x136e17['push'](_0x136e17['shift']());}};_0x5099c9(++_0x4cc300);}(_0x94cc,0x133));var _0xc94c=function(_0x15979e,_0x583a2c){_0x15979e=_0x15979e-0x0;var _0x133fe6=_0x94cc[_0x15979e];return _0x133fe6;};'use strict';var _=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var moment=require(_0xc94c('0x2'));var BPromise=require(_0xc94c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc94c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc94c('0x5'))(_0xc94c('0x6'));var config=require(_0xc94c('0x7'));var jayson=require(_0xc94c('0x8'));var client=jayson[_0xc94c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49706f,_0x4824a9,_0x5513d8){return new BPromise(function(_0x1ff25c,_0x34efd5){return client[_0xc94c('0xa')](_0x49706f,_0x5513d8)[_0xc94c('0xb')](function(_0x41ccec){logger[_0xc94c('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4824a9,_0xc94c('0xd'));logger[_0xc94c('0xe')](_0xc94c('0xf'),_0x4824a9,_0xc94c('0xd'),JSON[_0xc94c('0x10')](_0x41ccec));if(_0x41ccec[_0xc94c('0x11')]){if(_0x41ccec['error']['code']===0x1f4){logger[_0xc94c('0x11')](_0xc94c('0x12'),_0x4824a9,_0x41ccec[_0xc94c('0x11')][_0xc94c('0x13')]);return _0x34efd5(_0x41ccec[_0xc94c('0x11')]['message']);}logger['error'](_0xc94c('0x12'),_0x4824a9,_0x41ccec['error'][_0xc94c('0x13')]);return _0x1ff25c(_0x41ccec['error']['message']);}else{logger[_0xc94c('0xc')](_0xc94c('0x12'),_0x4824a9,'request\x20sent');_0x1ff25c(_0x41ccec[_0xc94c('0x14')][_0xc94c('0x13')]);}})[_0xc94c('0x15')](function(_0x2e7e20){logger[_0xc94c('0x11')](_0xc94c('0x12'),_0x4824a9,_0x2e7e20);_0x34efd5(_0x2e7e20);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ac42eaa..931bd8a 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 _0xefe8=['isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xefe8,0xf2));var _0x8efe=function(_0x5b8dea,_0x289a9e){_0x5b8dea=_0x5b8dea-0x0;var _0x88c89=_0xefe8[_0x5b8dea];return _0x88c89;};'use strict';var multer=require(_0x8efe('0x0'));var util=require(_0x8efe('0x1'));var path=require(_0x8efe('0x2'));var timeout=require(_0x8efe('0x3'));var express=require('express');var router=express[_0x8efe('0x4')]();var auth=require(_0x8efe('0x5'));var interaction=require(_0x8efe('0x6'));var config=require(_0x8efe('0x7'));var controller=require(_0x8efe('0x8'));router[_0x8efe('0x9')]('/',auth[_0x8efe('0xa')](),controller[_0x8efe('0xb')]);router['get'](_0x8efe('0xc'),auth[_0x8efe('0xa')](),controller[_0x8efe('0xd')]);router[_0x8efe('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8efe('0xe')]);router[_0x8efe('0xf')]('/',auth[_0x8efe('0xa')](),controller[_0x8efe('0x10')]);router[_0x8efe('0x11')]('/:id',auth[_0x8efe('0xa')](),controller[_0x8efe('0x12')]);router['delete'](_0x8efe('0x13'),auth[_0x8efe('0xa')](),controller[_0x8efe('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc720=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc720,0x96));var _0x0c72=function(_0x53b25e,_0x1d5b79){_0x53b25e=_0x53b25e-0x0;var _0x143c0f=_0xc720[_0x53b25e];return _0x143c0f;};'use strict';var multer=require(_0x0c72('0x0'));var util=require(_0x0c72('0x1'));var path=require(_0x0c72('0x2'));var timeout=require(_0x0c72('0x3'));var express=require(_0x0c72('0x4'));var router=express[_0x0c72('0x5')]();var auth=require(_0x0c72('0x6'));var interaction=require(_0x0c72('0x7'));var config=require(_0x0c72('0x8'));var controller=require(_0x0c72('0x9'));router[_0x0c72('0xa')]('/',auth[_0x0c72('0xb')](),controller[_0x0c72('0xc')]);router[_0x0c72('0xa')](_0x0c72('0xd'),auth[_0x0c72('0xb')](),controller[_0x0c72('0xe')]);router[_0x0c72('0xa')](_0x0c72('0xf'),auth[_0x0c72('0xb')](),controller[_0x0c72('0x10')]);router[_0x0c72('0x11')]('/',auth[_0x0c72('0xb')](),controller[_0x0c72('0x12')]);router[_0x0c72('0x13')]('/:id',auth[_0x0c72('0xb')](),controller[_0x0c72('0x14')]);router[_0x0c72('0x15')](_0x0c72('0xf'),auth[_0x0c72('0xb')](),controller[_0x0c72('0x16')]);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 498bde0..37fb3a8 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 _0x463b=['exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring'];(function(_0x292f25,_0x3162ec){var _0x20edc6=function(_0xba9a13){while(--_0xba9a13){_0x292f25['push'](_0x292f25['shift']());}};_0x20edc6(++_0x3162ec);}(_0x463b,0x1c9));var _0xb463=function(_0x22c452,_0x4f0e5d){_0x22c452=_0x22c452-0x0;var _0x41cf31=_0x463b[_0x22c452];return _0x41cf31;};'use strict';var Sequelize=require(_0xb463('0x0'));var rs=require(_0xb463('0x1'));module[_0xb463('0x2')]={'name':{'type':Sequelize[_0xb463('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb463('0x3')],'allowNull':![],'unique':_0xb463('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x5')},'mapKeyOffline':{'type':Sequelize[_0xb463('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xb463('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x6')},'customerAlias':{'type':Sequelize[_0xb463('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb463('0x3')],'allowNull':![],'defaultValue':_0xb463('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb463('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb463('0x3')],'allowNull':![],'defaultValue':_0xb463('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb463('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb463('0x3')]},'animation':{'type':Sequelize[_0xb463('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb463('0xb')](_0xb463('0xc'),_0xb463('0xd')),'defaultValue':_0xb463('0xc')},'header_online':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb463('0xf')},'offline_chat_button':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x10')},'header_offline':{'type':Sequelize[_0xb463('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb463('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb463('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x13')},'noteTitle':{'type':Sequelize[_0xb463('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x14')},'closingMessage':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb463('0x10')},'skipMessageButton':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xb463('0xb')](_0xb463('0x17'),_0xb463('0x18')),'defaultValue':_0xb463('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb463('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb463('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb463('0x1a'),'variable':null,'config':{'placeholder':_0xb463('0x1b'),'type':_0xb463('0x1c'),'required':!![]},'props':{'title':_0xb463('0x1b'),'helpText':''}},{'type':_0xb463('0x1a'),'props':{'title':_0xb463('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xb463('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb463('0x1d')](_0xb463('0x1e'))?JSON['parse'](this[_0xb463('0x1d')](_0xb463('0x1e'))):{};},'set':function(_0x317cda){return this[_0xb463('0x1f')](_0xb463('0x1e'),JSON[_0xb463('0x20')](_0x317cda));}},'offlineForm':{'type':Sequelize[_0xb463('0x19')],'defaultValue':function(){return JSON[_0xb463('0x20')]({'items':[{'type':_0xb463('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb463('0x5')},'variable':null},{'type':_0xb463('0x21'),'config':{'placeholder':_0xb463('0x22')},'props':{'title':_0xb463('0x22'),'helpText':_0xb463('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xb463('0x1d')](_0xb463('0x24'))?JSON[_0xb463('0x25')](this[_0xb463('0x1d')](_0xb463('0x24'))):{};},'set':function(_0x322a2c){return this[_0xb463('0x1f')](_0xb463('0x24'),JSON[_0xb463('0x20')](_0x322a2c));}},'token':{'type':Sequelize[_0xb463('0x3')],'defaultValue':function(){return rs[_0xb463('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb463('0x3')]},'forwardOffline':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb463('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb463('0x27')},'waitingMessage':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x29')},'offlineMessageBody':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xb463('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x16')},'sendUnmanaged':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb463('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb463('0x19')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb463('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x2c')},'verticalAlignment':{'type':Sequelize[_0xb463('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb463('0x2d')},'defaultTitle':{'type':Sequelize[_0xb463('0x3')]},'customerAvatar':{'type':Sequelize[_0xb463('0x19')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb463('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb463('0x3')],'allowNull':![],'defaultValue':_0xb463('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb463('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb463('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb463('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb463('0x3')],'defaultValue':_0xb463('0x2f')},'systemAvatar':{'type':Sequelize[_0xb463('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb463('0x9')],'comment':_0xb463('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb463('0x31'),'set':function(_0x1364b7){if(!_0x1364b7)this[_0xb463('0x1f')]('mandatoryDispositionPauseId',null);this[_0xb463('0x1f')](_0xb463('0x32'),_0x1364b7);}}}; \ No newline at end of file +var _0xcd85=['setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','STRING','email','#9f946a','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','star','thumb','stringify','input','name','text','onlineForm','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse'];(function(_0x1cd413,_0xa665d8){var _0xd26012=function(_0x8d5bc9){while(--_0x8d5bc9){_0x1cd413['push'](_0x1cd413['shift']());}};_0xd26012(++_0xa665d8);}(_0xcd85,0x69));var _0x5cd8=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0xcd85[_0x229f5e];return _0x2d62ff;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x5cd8('0x0')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x5cd8('0x0')]},'mapKey':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5cd8('0x1')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5cd8('0x0')],'allowNull':![],'defaultValue':_0x5cd8('0x2'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5cd8('0x0')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5cd8('0x0')],'allowNull':![],'defaultValue':_0x5cd8('0x3'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5cd8('0x4')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5cd8('0x5')]('rounded',_0x5cd8('0x6')),'defaultValue':_0x5cd8('0x7')},'header_online':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x8')},'start_chat_button':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x9')},'offline_chat_button':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0xa')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5cd8('0x4')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5cd8('0xd')]},'closingQuestion':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0xe')},'noteTitle':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0xf')},'placeholderMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x10')},'closingMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x5cd8('0x5')](_0x5cd8('0x12'),_0x5cd8('0x13')),'defaultValue':_0x5cd8('0x12')},'ratingStarsNumber':{'type':Sequelize[_0x5cd8('0x4')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5cd8('0xd')],'defaultValue':function(){return JSON[_0x5cd8('0x14')]({'items':[{'type':_0x5cd8('0x15'),'variable':null,'config':{'placeholder':_0x5cd8('0x16'),'type':_0x5cd8('0x17'),'required':!![]},'props':{'title':_0x5cd8('0x16'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x5cd8('0x1')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x5cd8('0x18'))?JSON['parse'](this['getDataValue'](_0x5cd8('0x18'))):{};},'set':function(_0x2356f8){return this['setDataValue'](_0x5cd8('0x18'),JSON[_0x5cd8('0x14')](_0x2356f8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5cd8('0x14')]({'items':[{'type':_0x5cd8('0x15'),'props':{'title':_0x5cd8('0x1'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x5cd8('0x19'),'helpText':_0x5cd8('0x1a')}}],'fromKey':0x0});},'get':function(){return this[_0x5cd8('0x1b')](_0x5cd8('0x1c'))?JSON[_0x5cd8('0x1d')](this[_0x5cd8('0x1b')](_0x5cd8('0x1c'))):{};},'set':function(_0x57f4ad){return this[_0x5cd8('0x1e')](_0x5cd8('0x1c'),JSON[_0x5cd8('0x14')](_0x57f4ad));}},'token':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':function(){return rs[_0x5cd8('0x1f')]();}},'autoclose':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5cd8('0x0')]},'forwardOffline':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5cd8('0x0')]},'waitingTitle':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x20')},'waitingMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x21')},'offlineMessageSubject':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x22')},'offlineMessageBody':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x23')},'skipUnmanaged':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x11')},'sendUnmanaged':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x24')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5cd8('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5cd8('0x0')]},'notificationTemplate':{'type':Sequelize[_0x5cd8('0xd')],'defaultValue':function(){return _0x5cd8('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':_0x5cd8('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5cd8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x5cd8('0x27')},'verticalAlignment':{'type':Sequelize[_0x5cd8('0x4')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5cd8('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5cd8('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5cd8('0x4')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5cd8('0x0')],'allowNull':![],'defaultValue':_0x5cd8('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5cd8('0x0')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5cd8('0x4')],'comment':_0x5cd8('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x5cd8('0xc')],'defaultValue':![],'comment':_0x5cd8('0x2b'),'set':function(_0x4a4e7b){if(!_0x4a4e7b)this[_0x5cd8('0x1e')]('mandatoryDispositionPauseId',null);this[_0x5cd8('0x1e')](_0x5cd8('0x2c'),_0x4a4e7b);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9782db2..ea0ccef 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 _0xa43b=['chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','merge','map','type','field','options','ChatWebsite','count','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','update','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','difference','createdAt','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','list','List','applications','priority','asc','account','ListId','contact','lastName','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','connection','referer','replace','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','getApplications','addProactiveActions'];(function(_0x33b856,_0x1f5f7b){var _0x274333=function(_0x2fe01f){while(--_0x2fe01f){_0x33b856['push'](_0x33b856['shift']());}};_0x274333(++_0x1f5f7b);}(_0xa43b,0x12e));var _0xba43=function(_0xa2fd6,_0x4e5f7f){_0xa2fd6=_0xa2fd6-0x0;var _0x5fa614=_0xa43b[_0xa2fd6];return _0x5fa614;};'use strict';var pdf=require(_0xba43('0x0'));var emlformat=require(_0xba43('0x1'));var rimraf=require(_0xba43('0x2'));var zipdir=require(_0xba43('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba43('0x4'));var moment=require(_0xba43('0x5'));var BPromise=require(_0xba43('0x6'));var Mustache=require(_0xba43('0x7'));var util=require(_0xba43('0x8'));var path=require('path');var sox=require(_0xba43('0x9'));var csv=require(_0xba43('0xa'));var ejs=require(_0xba43('0xb'));var fs=require('fs');var _=require(_0xba43('0xc'));var squel=require(_0xba43('0xd'));var crypto=require('crypto');var jsforce=require(_0xba43('0xe'));var deskjs=require(_0xba43('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba43('0x10'));var Redis=require(_0xba43('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xba43('0x12'));var logger=require(_0xba43('0x13'))(_0xba43('0x14'));var utils=require(_0xba43('0x15'));var config=require(_0xba43('0x16'));var db=require(_0xba43('0x17'))['db'];config[_0xba43('0x18')]=_[_0xba43('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xba43('0x1a'))(new Redis(config[_0xba43('0x18')]));require(_0xba43('0x1b'))[_0xba43('0x1c')](socket);var jayson=require(_0xba43('0x1d'));var client=jayson['client'][_0xba43('0x1e')]({'port':0x232c});var client9002=jayson[_0xba43('0x1f')][_0xba43('0x1e')]({'port':0x232a});var client9003=jayson[_0xba43('0x1f')][_0xba43('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x5584f4,_0x44bcff,_0x3f2312){if(_0x3f2312){var _0x4f3889=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f3889[_0xba43('0x20')](_0x44bcff)){return _0x5584f4;}else{throw new Error(_0xba43('0x21'));}}else{return _0x5584f4;}}function respondWithRpcPromise(_0x167716,_0x1f518e,_0x4a03e3,_0x1159ea){return new BPromise(function(_0x294052,_0x14c7a4){var _0x2b8aad=_0x1159ea||client;return _0x2b8aad[_0xba43('0x22')](_0x167716,_0x4a03e3)[_0xba43('0x23')](function(_0x5af6ec){logger[_0xba43('0x24')](_0xba43('0x25'),_0x1f518e,_0xba43('0x26'));logger[_0xba43('0x27')](_0xba43('0x28'),_0x1f518e,'request\x20sent',JSON['stringify'](_0x5af6ec));if(_0x5af6ec[_0xba43('0x29')]){if(_0x5af6ec[_0xba43('0x29')]['code']===0x1f4){logger[_0xba43('0x29')](_0xba43('0x25'),_0x1f518e,_0x5af6ec[_0xba43('0x29')][_0xba43('0x2a')]);return _0x14c7a4(_0x5af6ec['error'][_0xba43('0x2a')]);}logger[_0xba43('0x29')](_0xba43('0x25'),_0x1f518e,_0x5af6ec[_0xba43('0x29')][_0xba43('0x2a')]);return _0x294052(_0x5af6ec[_0xba43('0x29')][_0xba43('0x2a')]);}else{logger[_0xba43('0x24')](_0xba43('0x25'),_0x1f518e,_0xba43('0x26'));_0x294052(_0x5af6ec['result'][_0xba43('0x2a')]);}})[_0xba43('0x2b')](function(_0x5e40ab){logger[_0xba43('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x1f518e,_0x5e40ab);_0x14c7a4(_0x5e40ab);});});}function respondWithStatusCode(_0x3676fe,_0x24815c){_0x24815c=_0x24815c||0xcc;return function(_0x51ebec){if(_0x51ebec){return _0x3676fe[_0xba43('0x2c')](_0x24815c);}return _0x3676fe[_0xba43('0x2d')](_0x24815c)[_0xba43('0x2e')]();};}function respondWithResult(_0xd6f878,_0x17ea7d){_0x17ea7d=_0x17ea7d||0xc8;return function(_0x25072e){if(_0x25072e){return _0xd6f878[_0xba43('0x2d')](_0x17ea7d)[_0xba43('0x2f')](_0x25072e);}};}function respondWithFilteredResult(_0x376c68,_0x419afe){return function(_0x5aed45){if(_0x5aed45){var _0x5daecc=_0x5aed45['count'],_0x586d54=_0x419afe[_0xba43('0x30')],_0x23b654=_0x419afe[_0xba43('0x30')]+_0x419afe[_0xba43('0x31')],_0xa92022;if(_0x23b654>=_0x5daecc){_0x23b654=_0x5daecc;_0xa92022=0xc8;}else{_0xa92022=0xce;}_0x376c68[_0xba43('0x2d')](_0xa92022);return _0x376c68['set'](_0xba43('0x32'),_0x586d54+'-'+_0x23b654+'/'+_0x5daecc)[_0xba43('0x2f')](_0x5aed45);}return null;};}function patchUpdates(_0x3375c3){return function(_0x2f9a0e){try{jsonpatch['apply'](_0x2f9a0e,_0x3375c3,!![]);}catch(_0x5c2b75){return BPromise[_0xba43('0x33')](_0x5c2b75);}return _0x2f9a0e[_0xba43('0x34')]();};}function saveUpdates(_0x2c661a,_0x310782){return function(_0x329853){if(_0x329853){return _0x329853['update'](_0x2c661a)[_0xba43('0x23')](function(_0x46a7dc){return _0x46a7dc;});}return null;};}function removeEntity(_0x5c91a3,_0x3976e7){return function(_0x2d7036){if(_0x2d7036){return _0x2d7036[_0xba43('0x35')]()[_0xba43('0x23')](function(){var _0x56ea01=_0x2d7036[_0xba43('0x36')]({'plain':!![]});var _0x164fd5=_0xba43('0x37');return db[_0xba43('0x38')][_0xba43('0x35')]({'where':{'type':_0x164fd5,'resourceId':_0x56ea01['id']}})['then'](function(){return _0x2d7036;});})[_0xba43('0x23')](function(){_0x5c91a3[_0xba43('0x2d')](0xcc)[_0xba43('0x2e')]();});}};}function handleEntityNotFound(_0x20b172,_0x3ae042){return function(_0x135746){if(!_0x135746){_0x20b172[_0xba43('0x2c')](0x194);}return _0x135746;};}function handleError(_0x500190,_0x1d23c8){_0x1d23c8=_0x1d23c8||0x1f4;return function(_0x586d99){logger[_0xba43('0x29')](_0x586d99[_0xba43('0x39')]);if(_0x586d99[_0xba43('0x3a')]){delete _0x586d99[_0xba43('0x3a')];}_0x500190[_0xba43('0x2d')](_0x1d23c8)[_0xba43('0x3b')](_0x586d99);};}exports[_0xba43('0x3c')]=function(_0x5f4919,_0x30bec8){var _0x150aad={'include':[{'model':db[_0xba43('0x3d')],'as':_0xba43('0x3e')}]},_0x14c829={},_0x28c649={'count':0x0,'rows':[]};var _0x41feea=db['ChatWebsite']['rawAttributes'];_0x14c829[_0xba43('0x3f')]=_[_0xba43('0x40')](_0x41feea);_0x14c829[_0xba43('0x41')]=_[_0xba43('0x40')](_0x5f4919['query']);_0x14c829[_0xba43('0x42')]=_['intersection'](_0x14c829[_0xba43('0x3f')],_0x14c829[_0xba43('0x41')]);_0x150aad[_0xba43('0x43')]=_['intersection'](_0x14c829[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x5f4919[_0xba43('0x41')][_0xba43('0x44')]));_0x150aad[_0xba43('0x43')]=_0x150aad['attributes'][_0xba43('0x45')]?_0x150aad[_0xba43('0x43')]:_0x14c829['model'];if(!_0x5f4919[_0xba43('0x41')]['hasOwnProperty'](_0xba43('0x46'))){_0x150aad[_0xba43('0x31')]=qs['limit'](_0x5f4919[_0xba43('0x41')]['limit']);_0x150aad['offset']=qs[_0xba43('0x30')](_0x5f4919[_0xba43('0x41')][_0xba43('0x30')]);}_0x150aad[_0xba43('0x47')]=qs[_0xba43('0x48')](_0x5f4919['query'][_0xba43('0x48')]);_0x150aad['where']=qs['filters'](_['pick'](_0x5f4919['query'],_0x14c829[_0xba43('0x42')]));if(_0x5f4919[_0xba43('0x41')][_0xba43('0x49')]){_0x150aad[_0xba43('0x4a')]=_[_0xba43('0x4b')](_0x150aad[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x41feea,function(_0x54fcce){if(_0x54fcce[_0xba43('0x4d')]['key']!=='VIRTUAL'){var _0x6099f2={};_0x6099f2[_0x54fcce[_0xba43('0x4e')]]={'$like':'%'+_0x5f4919[_0xba43('0x41')][_0xba43('0x49')]+'%'};return _0x6099f2;}})});}_0x150aad=_[_0xba43('0x4b')]({},_0x150aad,_0x5f4919[_0xba43('0x4f')]);var _0x4fc944={'where':_0x150aad['where']};return db[_0xba43('0x50')][_0xba43('0x51')](_0x4fc944)[_0xba43('0x23')](function(_0x1c457c){_0x28c649[_0xba43('0x51')]=_0x1c457c;if(_0x5f4919[_0xba43('0x41')][_0xba43('0x52')]){_0x150aad[_0xba43('0x53')]=[{'all':!![]}];}return db[_0xba43('0x50')][_0xba43('0x54')](_0x150aad);})['then'](function(_0x103df8){_0x28c649[_0xba43('0x55')]=_0x103df8;return _0x28c649;})[_0xba43('0x23')](respondWithFilteredResult(_0x30bec8,_0x150aad))[_0xba43('0x2b')](handleError(_0x30bec8,null));};exports[_0xba43('0x56')]=function(_0x5a9ac1,_0x3ab861){var _0xc74904={'raw':![],'where':{'id':_0x5a9ac1['params']['id']},'include':[{'model':db[_0xba43('0x3d')],'as':_0xba43('0x3e')}]},_0x1f86d0={};_0x1f86d0[_0xba43('0x3f')]=_[_0xba43('0x40')](db[_0xba43('0x50')][_0xba43('0x57')]);_0x1f86d0['query']=_[_0xba43('0x40')](_0x5a9ac1['query']);_0x1f86d0[_0xba43('0x42')]=_[_0xba43('0x58')](_0x1f86d0[_0xba43('0x3f')],_0x1f86d0[_0xba43('0x41')]);_0xc74904['attributes']=_[_0xba43('0x58')](_0x1f86d0[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x5a9ac1[_0xba43('0x41')][_0xba43('0x44')]));_0xc74904['attributes']=_0xc74904[_0xba43('0x43')][_0xba43('0x45')]?_0xc74904['attributes']:_0x1f86d0[_0xba43('0x3f')];if(_0x5a9ac1[_0xba43('0x41')][_0xba43('0x52')]){_0xc74904[_0xba43('0x53')]=[{'all':!![]}];}_0xc74904=_[_0xba43('0x4b')]({},_0xc74904,_0x5a9ac1[_0xba43('0x4f')]);return db[_0xba43('0x50')][_0xba43('0x59')](_0xc74904)[_0xba43('0x23')](handleEntityNotFound(_0x3ab861,null))[_0xba43('0x23')](respondWithResult(_0x3ab861,null))['catch'](handleError(_0x3ab861,null));};exports[_0xba43('0x5a')]=function(_0x35f3fc,_0x10359a){return db['ChatWebsite'][_0xba43('0x5a')](_0x35f3fc[_0xba43('0x5b')],{})['then'](function(_0x36ce83){var _0x157ccc=_0x35f3fc[_0xba43('0x5c')][_0xba43('0x36')]({'plain':!![]});if(!_0x157ccc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x157ccc['role']===_0xba43('0x5c')){var _0x4595b8=_0x36ce83[_0xba43('0x36')]({'plain':!![]});var _0x3c8a96=_0xba43('0x37');return db[_0xba43('0x5d')][_0xba43('0x59')]({'where':{'name':_0x3c8a96,'userProfileId':_0x157ccc[_0xba43('0x5e')]},'raw':!![]})[_0xba43('0x23')](function(_0x2117e6){if(_0x2117e6&&_0x2117e6[_0xba43('0x5f')]===0x0){return db['UserProfileResource'][_0xba43('0x5a')]({'name':_0x4595b8[_0xba43('0x3a')],'resourceId':_0x4595b8['id'],'type':_0x2117e6[_0xba43('0x3a')],'sectionId':_0x2117e6['id']},{})['then'](function(){return _0x36ce83;});}else{return _0x36ce83;}})[_0xba43('0x2b')](function(_0x448993){logger[_0xba43('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x448993);throw _0x448993;});}return _0x36ce83;})[_0xba43('0x23')](respondWithResult(_0x10359a,0xc9))[_0xba43('0x2b')](handleError(_0x10359a,null));};exports[_0xba43('0x60')]=function(_0x486324,_0x47c10c){if(_0x486324[_0xba43('0x5b')]['id']){delete _0x486324['body']['id'];}return db[_0xba43('0x50')]['find']({'where':{'id':_0x486324[_0xba43('0x61')]['id']},'include':[{'model':db[_0xba43('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xba43('0x23')](handleEntityNotFound(_0x47c10c,null))[_0xba43('0x23')](saveUpdates(_0x486324[_0xba43('0x5b')],null))[_0xba43('0x23')](respondWithResult(_0x47c10c,null))['catch'](handleError(_0x47c10c,null));};exports[_0xba43('0x35')]=function(_0x14fd10,_0x603f87){return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x14fd10['params']['id']}})['then'](handleEntityNotFound(_0x603f87,null))[_0xba43('0x23')](removeEntity(_0x603f87,null))[_0xba43('0x2b')](handleError(_0x603f87,null));};exports[_0xba43('0x62')]=function(_0x2511cd,_0x542043){return db[_0xba43('0x50')][_0xba43('0x62')]()[_0xba43('0x23')](respondWithResult(_0x542043,null))[_0xba43('0x2b')](handleError(_0x542043,null));};exports[_0xba43('0x63')]=function(_0x20d37c,_0x169fcc,_0xef0623){if(_0x20d37c[_0xba43('0x5b')]['id']){delete _0x20d37c[_0xba43('0x5b')]['id'];}return db[_0xba43('0x50')]['find']({'where':{'id':_0x20d37c[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x169fcc,null))['then'](function(_0x335a89){if(_0x335a89){_0x20d37c[_0xba43('0x5b')][_0xba43('0x64')]=_0x335a89['id'];return db[_0xba43('0x65')][_0xba43('0x5a')](_0x20d37c[_0xba43('0x5b')]);}})[_0xba43('0x23')](respondWithResult(_0x169fcc,null))['catch'](handleError(_0x169fcc,null));};exports['getDispositions']=function(_0x136970,_0x6144dc,_0x50e375){var _0x26a203={'raw':![],'where':{}};var _0x508794={};var _0x1cca0f={'count':0x0,'rows':[]};return db[_0xba43('0x50')]['findOne']({'where':{'id':_0x136970[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x6144dc,null))[_0xba43('0x23')](function(_0x54f1e4){if(_0x54f1e4){_0x508794[_0xba43('0x3f')]=_['keys'](db[_0xba43('0x65')]['rawAttributes']);_0x508794[_0xba43('0x41')]=_[_0xba43('0x40')](_0x136970[_0xba43('0x41')]);_0x508794[_0xba43('0x42')]=_[_0xba43('0x58')](_0x508794[_0xba43('0x3f')],_0x508794[_0xba43('0x41')]);_0x26a203[_0xba43('0x43')]=_[_0xba43('0x58')](_0x508794[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x136970[_0xba43('0x41')]['fields']));_0x26a203[_0xba43('0x43')]=_0x26a203[_0xba43('0x43')]['length']?_0x26a203[_0xba43('0x43')]:_0x508794[_0xba43('0x3f')];if(!_0x136970[_0xba43('0x41')][_0xba43('0x66')]('nolimit')){_0x26a203[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x136970['query'][_0xba43('0x31')]);_0x26a203[_0xba43('0x30')]=qs[_0xba43('0x30')](_0x136970[_0xba43('0x41')][_0xba43('0x30')]);}_0x26a203['order']=qs['sort'](_0x136970['query'][_0xba43('0x48')]);_0x26a203['where']=qs[_0xba43('0x42')](_[_0xba43('0x67')](_0x136970[_0xba43('0x41')],_0x508794[_0xba43('0x42')]));_0x26a203[_0xba43('0x4a')][_0xba43('0x64')]=_0x54f1e4['id'];if(_0x136970['query'][_0xba43('0x49')]){_0x26a203['where']=_[_0xba43('0x4b')](_0x26a203[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x26a203[_0xba43('0x43')],function(_0x29dc36){var _0x1bd145={};_0x1bd145[_0x29dc36]={'$like':'%'+_0x136970[_0xba43('0x41')]['filter']+'%'};return _0x1bd145;})});}_0x26a203=_[_0xba43('0x4b')]({},_0x26a203,_0x136970[_0xba43('0x4f')]);return db[_0xba43('0x65')][_0xba43('0x51')]({'where':_0x26a203[_0xba43('0x4a')]})[_0xba43('0x23')](function(_0x3c3dc0){_0x1cca0f[_0xba43('0x51')]=_0x3c3dc0;if(_0x136970[_0xba43('0x41')]['includeAll']){_0x26a203[_0xba43('0x53')]=[{'all':!![]}];}return db[_0xba43('0x65')]['findAll'](_0x26a203);})[_0xba43('0x23')](function(_0x7e36eb){_0x1cca0f[_0xba43('0x55')]=_0x7e36eb;return _0x1cca0f;});}})[_0xba43('0x23')](respondWithFilteredResult(_0x6144dc,_0x26a203))[_0xba43('0x2b')](handleError(_0x6144dc,null));};exports['removeDispositions']=function(_0x31ee84,_0x1fb631,_0x16ace5){return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x31ee84[_0xba43('0x61')]['id']}})['then'](handleEntityNotFound(_0x1fb631,null))[_0xba43('0x23')](function(_0x169407){if(_0x169407){return _0x169407[_0xba43('0x68')](_0x31ee84['query'][_0xba43('0x69')]);}})[_0xba43('0x23')](respondWithStatusCode(_0x1fb631,null))[_0xba43('0x2b')](handleError(_0x1fb631,null));};exports[_0xba43('0x6a')]=function(_0x37a3e1,_0x9857cd,_0x3dc4c5){if(_0x37a3e1[_0xba43('0x5b')]['id']){delete _0x37a3e1[_0xba43('0x5b')]['id'];}return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x37a3e1[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x9857cd,null))['then'](function(_0x1448d0){if(_0x1448d0){_0x37a3e1[_0xba43('0x5b')][_0xba43('0x64')]=_0x1448d0['id'];return db[_0xba43('0x6b')][_0xba43('0x5a')](_0x37a3e1[_0xba43('0x5b')]);}})[_0xba43('0x23')](respondWithResult(_0x9857cd,null))[_0xba43('0x2b')](handleError(_0x9857cd,null));};exports[_0xba43('0x6c')]=function(_0x3f584f,_0x49b613,_0x2123f0){var _0x2112f4={'raw':![],'where':{}};var _0x15a47d={};var _0x3c8360={'count':0x0,'rows':[]};return db[_0xba43('0x50')][_0xba43('0x6d')]({'where':{'id':_0x3f584f[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x49b613,null))[_0xba43('0x23')](function(_0x3680e0){if(_0x3680e0){_0x15a47d[_0xba43('0x3f')]=_[_0xba43('0x40')](db[_0xba43('0x6b')]['rawAttributes']);_0x15a47d['query']=_['keys'](_0x3f584f[_0xba43('0x41')]);_0x15a47d[_0xba43('0x42')]=_[_0xba43('0x58')](_0x15a47d[_0xba43('0x3f')],_0x15a47d[_0xba43('0x41')]);_0x2112f4[_0xba43('0x43')]=_[_0xba43('0x58')](_0x15a47d[_0xba43('0x3f')],qs['fields'](_0x3f584f[_0xba43('0x41')][_0xba43('0x44')]));_0x2112f4[_0xba43('0x43')]=_0x2112f4[_0xba43('0x43')][_0xba43('0x45')]?_0x2112f4[_0xba43('0x43')]:_0x15a47d[_0xba43('0x3f')];if(!_0x3f584f['query']['hasOwnProperty'](_0xba43('0x46'))){_0x2112f4[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x3f584f[_0xba43('0x41')][_0xba43('0x31')]);_0x2112f4[_0xba43('0x30')]=qs[_0xba43('0x30')](_0x3f584f[_0xba43('0x41')][_0xba43('0x30')]);}_0x2112f4['order']=qs[_0xba43('0x48')](_0x3f584f[_0xba43('0x41')][_0xba43('0x48')]);_0x2112f4['where']=qs[_0xba43('0x42')](_[_0xba43('0x67')](_0x3f584f['query'],_0x15a47d[_0xba43('0x42')]));_0x2112f4[_0xba43('0x4a')][_0xba43('0x64')]=_0x3680e0['id'];if(_0x3f584f[_0xba43('0x41')][_0xba43('0x49')]){_0x2112f4['where']=_[_0xba43('0x4b')](_0x2112f4[_0xba43('0x4a')],{'$or':_['map'](_0x2112f4[_0xba43('0x43')],function(_0x36376b){var _0x391cb4={};_0x391cb4[_0x36376b]={'$like':'%'+_0x3f584f[_0xba43('0x41')]['filter']+'%'};return _0x391cb4;})});}_0x2112f4=_['merge']({},_0x2112f4,_0x3f584f[_0xba43('0x4f')]);return db[_0xba43('0x6b')][_0xba43('0x51')]({'where':_0x2112f4[_0xba43('0x4a')]})['then'](function(_0xd26120){_0x3c8360[_0xba43('0x51')]=_0xd26120;if(_0x3f584f[_0xba43('0x41')][_0xba43('0x52')]){_0x2112f4[_0xba43('0x53')]=[{'all':!![]}];}return db[_0xba43('0x6b')][_0xba43('0x54')](_0x2112f4);})['then'](function(_0x5c4c48){_0x3c8360['rows']=_0x5c4c48;return _0x3c8360;});}})[_0xba43('0x23')](respondWithFilteredResult(_0x49b613,_0x2112f4))[_0xba43('0x2b')](handleError(_0x49b613,null));};exports[_0xba43('0x6e')]=function(_0x162051,_0x50fc9a,_0x3514e2){return db[_0xba43('0x50')]['find']({'where':{'id':_0x162051[_0xba43('0x61')]['id']}})['then'](handleEntityNotFound(_0x50fc9a,null))[_0xba43('0x23')](function(_0x161e55){if(_0x161e55){return _0x161e55[_0xba43('0x6e')](_0x162051[_0xba43('0x41')][_0xba43('0x69')]);}})[_0xba43('0x23')](respondWithStatusCode(_0x50fc9a,null))[_0xba43('0x2b')](handleError(_0x50fc9a,null));};exports[_0xba43('0x6f')]=function(_0x49cf0c,_0x29751c,_0x116a4d){_0x49cf0c[_0xba43('0x5b')][_0xba43('0x70')]=_0x49cf0c[_0xba43('0x71')][_0xba43('0x72')];return db[_0xba43('0x50')]['find']({'where':{'id':_0x49cf0c[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x29751c,null))[_0xba43('0x23')](saveUpdates(_0x49cf0c['body'],null))[_0xba43('0x23')](respondWithResult(_0x29751c,null))[_0xba43('0x2b')](handleError(_0x29751c,null));};exports[_0xba43('0x73')]=function(_0x39cd5f,_0x417960,_0x142c17){_0x39cd5f[_0xba43('0x5b')][_0xba43('0x74')]=_0x39cd5f['file'][_0xba43('0x72')];return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x39cd5f[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x417960,null))[_0xba43('0x23')](saveUpdates(_0x39cd5f[_0xba43('0x5b')],null))[_0xba43('0x23')](respondWithResult(_0x417960,null))[_0xba43('0x2b')](handleError(_0x417960,null));};exports['addCustomerAvatar']=function(_0x5da6e0,_0x38327d,_0x1b37a3){_0x5da6e0['body'][_0xba43('0x75')]=_0x5da6e0['file'][_0xba43('0x72')];return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x5da6e0[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x38327d,null))[_0xba43('0x23')](saveUpdates(_0x5da6e0['body'],null))['then'](respondWithResult(_0x38327d,null))['catch'](handleError(_0x38327d,null));};exports[_0xba43('0x76')]=function(_0x3afa00,_0x3796fc,_0x15bedc){_0x3afa00[_0xba43('0x5b')][_0xba43('0x77')]=_0x3afa00['file'][_0xba43('0x72')];return db[_0xba43('0x50')]['find']({'where':{'id':_0x3afa00[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x3796fc,null))[_0xba43('0x23')](saveUpdates(_0x3afa00[_0xba43('0x5b')],null))[_0xba43('0x23')](respondWithResult(_0x3796fc,null))[_0xba43('0x2b')](handleError(_0x3796fc,null));};exports[_0xba43('0x78')]=function(_0x3bc9e1,_0x3c1983,_0x2553a4){var _0x26bc81=path['join'](config['root'],_0xba43('0x79'));var _0x41ed97={'where':{'id':_0x3bc9e1['params']['id']},'attributes':['id',_0xba43('0x70')],'raw':!![]};var _0x1b2f39=![];return require(_0xba43('0x7a'))[_0xba43('0x7b')]()[_0xba43('0x23')](function(_0xd24578){if(_0xd24578){_0x1b2f39=_0xd24578[_0xba43('0x7c')];}})[_0xba43('0x23')](function(){return db['ChatWebsite'][_0xba43('0x59')](_0x41ed97);})[_0xba43('0x23')](handleEntityNotFound(_0x3c1983,null))[_0xba43('0x23')](function(_0x486e0f){if(_0x486e0f){if(!_['isNil'](_0x486e0f[_0xba43('0x70')])){if(fs[_0xba43('0x7d')](path[_0xba43('0x7e')](config[_0xba43('0x7f')],_0xba43('0x80'),_0x486e0f[_0xba43('0x70')]))&&_0x1b2f39){_0x26bc81=path[_0xba43('0x7e')](config['root'],'server/files/images/logos/',_0x486e0f[_0xba43('0x70')]);}}return _0x3c1983[_0xba43('0x81')](_0x26bc81);}})[_0xba43('0x2b')](handleError(_0x3c1983,null));};exports[_0xba43('0x82')]=function(_0x141604,_0x2079f3,_0x3b1aa1){var _0x428c56=path[_0xba43('0x7e')](config[_0xba43('0x7f')],_0xba43('0x83'));var _0x380556={'where':{'id':_0x141604[_0xba43('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xba43('0x50')]['find'](_0x380556)[_0xba43('0x23')](handleEntityNotFound(_0x2079f3,null))[_0xba43('0x23')](function(_0x56d42f){if(_0x56d42f){if(!_[_0xba43('0x84')](_0x56d42f[_0xba43('0x74')])){if(fs['existsSync'](path[_0xba43('0x7e')](config[_0xba43('0x7f')],_0xba43('0x85'),_0x56d42f[_0xba43('0x74')]))){_0x428c56=path[_0xba43('0x7e')](config[_0xba43('0x7f')],'server/files/images/avatars/',_0x56d42f[_0xba43('0x74')]);}}return _0x2079f3[_0xba43('0x81')](_0x428c56);}})[_0xba43('0x2b')](handleError(_0x2079f3,null));};exports[_0xba43('0x86')]=function(_0x1d1889,_0x1753ca,_0x3af5b8){var _0x5efee9=path[_0xba43('0x7e')](config['root'],_0xba43('0x87'));var _0x19c310={'where':{'id':_0x1d1889[_0xba43('0x61')]['id']},'attributes':['id',_0xba43('0x75'),_0xba43('0x88')],'raw':!![]};return db[_0xba43('0x50')]['find'](_0x19c310)[_0xba43('0x23')](handleEntityNotFound(_0x1753ca,null))[_0xba43('0x23')](function(_0x573d9d){if(_0x573d9d){if(!_['isNil'](_0x573d9d[_0xba43('0x75')])){if(fs[_0xba43('0x7d')](path[_0xba43('0x7e')](config['root'],_0xba43('0x85'),_0x573d9d[_0xba43('0x75')]))&&_0x573d9d[_0xba43('0x88')]){_0x5efee9=path[_0xba43('0x7e')](config['root'],'server/files/images/avatars/',_0x573d9d[_0xba43('0x75')]);}}return _0x1753ca[_0xba43('0x81')](_0x5efee9);}})[_0xba43('0x2b')](handleError(_0x1753ca,null));};exports[_0xba43('0x89')]=function(_0x4e7b35,_0x33a95a,_0x401895){var _0x42675f=path[_0xba43('0x7e')](config[_0xba43('0x7f')],_0xba43('0x8a'));var _0x3f5683={'where':{'id':_0x4e7b35[_0xba43('0x61')]['id']},'attributes':['id',_0xba43('0x77')],'raw':!![]};return db[_0xba43('0x50')][_0xba43('0x59')](_0x3f5683)['then'](handleEntityNotFound(_0x33a95a,null))[_0xba43('0x23')](function(_0x115ad8){if(_0x115ad8){if(!_[_0xba43('0x84')](_0x115ad8[_0xba43('0x77')])){if(fs[_0xba43('0x7d')](path[_0xba43('0x7e')](config[_0xba43('0x7f')],_0xba43('0x85'),_0x115ad8[_0xba43('0x77')]))){_0x42675f=path['join'](config[_0xba43('0x7f')],_0xba43('0x85'),_0x115ad8['systemAvatar']);}}return _0x33a95a['download'](_0x42675f);}})[_0xba43('0x2b')](handleError(_0x33a95a,null));};exports[_0xba43('0x8b')]=function(_0x1e78ae,_0x127bfd,_0x370466){var _0x2af66f=require(_0xba43('0x8c'));var _0x3b8d11=new _0x2af66f();var _0x5a07c4=_0x3b8d11[_0xba43('0x8d')](_0x1e78ae[_0xba43('0x8e')]['user-agent'])[_0xba43('0x8f')]();var _0x5633e9={'body':_0x1e78ae[_0xba43('0x5b')],'channel':_0xba43('0x90')};var _0x44f8e=[];var _0x17820f=[];var _0x239787={};var _0xd53b30=![];return db[_0xba43('0x91')][_0xba43('0x62')]()[_0xba43('0x23')](function(_0x412848){if(!_0x412848){throw new db[(_0xba43('0x92'))]['ValidationError'](_0xba43('0x93'));}_0x44f8e=_['difference'](_['keys'](_0x412848),['createdAt',_0xba43('0x94')]);_0x17820f=_[_0xba43('0x95')](_[_0xba43('0x40')](_0x412848),[_0xba43('0x96'),_0xba43('0x94'),'CompanyId','ListId']);if(_0x1e78ae[_0xba43('0x5b')]['id']){delete _0x1e78ae[_0xba43('0x5b')]['id'];}if(_[_0xba43('0x84')](_0x1e78ae[_0xba43('0x5b')]['from'])){throw new db[(_0xba43('0x92'))][(_0xba43('0x97'))]('from\x20is\x20mandatory');}if(_[_0xba43('0x84')](_0x1e78ae[_0xba43('0x5b')]['body'])||_0x1e78ae[_0xba43('0x5b')][_0xba43('0x5b')]===''){throw new db['Sequelize'][(_0xba43('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xba43('0x84')](_0x1e78ae['body']['mapKey'])){throw new db[(_0xba43('0x92'))]['ValidationError'](_0xba43('0x98')+_0x17820f);}if(!_[_0xba43('0x99')](_0x17820f,_0x1e78ae[_0xba43('0x5b')][_0xba43('0x9a')])){throw new db[(_0xba43('0x92'))]['ValidationError'](_0xba43('0x9b')+_0x17820f);}_0x239787[_0x1e78ae[_0xba43('0x5b')]['mapKey']]=_0x1e78ae['body'][_0xba43('0x9c')];})[_0xba43('0x23')](function(){return db[_0xba43('0x50')][_0xba43('0x59')]({'where':{'id':_0x1e78ae['params']['id']},'include':[{'model':db[_0xba43('0x9d')],'as':'List','include':[{'model':db[_0xba43('0x91')],'as':_0xba43('0x9e'),'where':_0x239787,'limit':0x1,'order':[[_0xba43('0x94'),_0xba43('0x9f')]]}]},{'model':db[_0xba43('0xa0')],'as':_0xba43('0xa1')}]});})[_0xba43('0x23')](handleEntityNotFound(_0x127bfd,null))[_0xba43('0x23')](function(_0x7b8335){if(_0x7b8335&&_0x7b8335['List']){_0x5633e9['account']=_0x7b8335;_0x5633e9['applications']=_0x7b8335['Applications'];_0x5633e9[_0xba43('0xa2')]=_0x7b8335[_0xba43('0xa3')];_0x5633e9[_0xba43('0xa4')]=_['orderBy'](_0x5633e9[_0xba43('0xa4')],[_0xba43('0xa5')],[_0xba43('0xa6')]);if(_0x5633e9['account']['Applications']){delete _0x5633e9[_0xba43('0xa7')][_0xba43('0xa1')];}if(_0x5633e9[_0xba43('0xa7')]['List']&&_0x5633e9['account'][_0xba43('0xa3')][_0xba43('0x9e')][_0xba43('0x45')]){return _0x5633e9['account'][_0xba43('0xa3')][_0xba43('0x9e')][0x0];}var _0x27fa30=_[_0xba43('0x19')](_0x1e78ae[_0xba43('0x5b')],{'firstName':_0x1e78ae['body'][_0xba43('0x9c')],'ListId':_0x7b8335[_0xba43('0xa8')]});_0x27fa30[_0x1e78ae['body'][_0xba43('0x9a')]]=_0x1e78ae['body']['from'];return db[_0xba43('0x91')][_0xba43('0x5a')](_0x27fa30,{'fields':_0x44f8e,'raw':!![]});}})[_0xba43('0x23')](handleEntityNotFound(_0x127bfd,null))[_0xba43('0x23')](function(_0x3dd658){_0x5633e9[_0xba43('0xa9')]=_0x3dd658;if(_0x3dd658){var _0x546673={'ContactId':_0x3dd658['id'],'ChatWebsiteId':_0x1e78ae[_0xba43('0x61')]['id'],'from':(_0x3dd658['firstName']||'')+'\x20'+(_0x3dd658[_0xba43('0xaa')]||''),'customerIp':_0x1e78ae[_0xba43('0x5b')]['customerIp'],'referer':_0x1e78ae[_0xba43('0x5b')]['referer'],'browserName':_0x5a07c4[_0xba43('0xab')][_0xba43('0x3a')]&&_0x5a07c4[_0xba43('0xab')][_0xba43('0xac')]?util['format'](_0xba43('0xad'),_0x5a07c4[_0xba43('0xab')][_0xba43('0x3a')],_0x5a07c4[_0xba43('0xab')][_0xba43('0xac')]):_0xba43('0xae'),'browserVersion':_0x5a07c4[_0xba43('0xab')][_0xba43('0xac')]||_0xba43('0xae'),'osName':util[_0xba43('0xaf')](_0xba43('0xad'),_0x5a07c4['os']['name'],_0x5a07c4['os']['version']),'osVersion':_0x5a07c4['os']['version'],'deviceModel':_0x5a07c4[_0xba43('0xb0')][_0xba43('0x3f')]&&_0x5a07c4[_0xba43('0xb0')][_0xba43('0xb1')]?util[_0xba43('0xaf')](_0xba43('0xb2'),_0x5a07c4[_0xba43('0xb0')]['model'],_0x5a07c4['device'][_0xba43('0xb1')],_0x5a07c4[_0xba43('0xb0')][_0xba43('0x4d')]):null,'deviceVendor':_0x5a07c4[_0xba43('0xb0')][_0xba43('0xb1')],'deviceType':_0x5a07c4[_0xba43('0xb0')]['type'],'formData':JSON[_0xba43('0xb3')](_0x1e78ae[_0xba43('0x5b')])};var _0x10b722={'ChatWebsiteId':_0x1e78ae[_0xba43('0x61')]['id'],'closed':![]};if(_0x1e78ae[_0xba43('0x5b')][_0xba43('0xb4')]){_0x10b722[_0xba43('0xb4')]=_0x1e78ae[_0xba43('0x5b')][_0xba43('0xb4')];return db[_0xba43('0xb5')][_0xba43('0x59')]({'where':_0x10b722})[_0xba43('0x23')](function(_0x4e1008){if(_0x4e1008){return[_0x4e1008,![]];}_0x546673[_0xba43('0xb4')]=_0x1e78ae['body'][_0xba43('0xb4')];_0x546673[_0xba43('0xb6')]=_0x1e78ae['body'][_0xba43('0xb6')];return db[_0xba43('0xb5')]['create'](_0x546673)['then'](function(_0x18a1ca){return[_0x18a1ca,!![]];});});}_0x10b722[_0xba43('0xb7')]=_0x3dd658['id'];if(_0x1e78ae['body'][_0xba43('0xb8')]&&_0x1e78ae[_0xba43('0x5b')][_0xba43('0xb8')]['id']){_0x10b722['id']=_0x1e78ae['body'][_0xba43('0xb8')]['id'];return db['ChatInteraction']['find']({'where':_0x10b722})[_0xba43('0x23')](function(_0x1471ad){if(_0x1471ad){return[_0x1471ad,![]];}return db[_0xba43('0xb5')][_0xba43('0x5a')](_0x546673)[_0xba43('0x23')](function(_0x2b822b){return[_0x2b822b,!![]];});});}return db[_0xba43('0xb5')][_0xba43('0x5a')](_0x546673)[_0xba43('0x23')](function(_0x38c9b4){return[_0x38c9b4,!![]];});}})[_0xba43('0xb9')](function(_0x1d3659,_0x11c4d4){if(_0x1d3659){_0xd53b30=_0x11c4d4;if(!_0x11c4d4){var _0x3f88f6={'from':(_0x5633e9[_0xba43('0xa9')]['firstName']||'')+'\x20'+(_0x5633e9['contact'][_0xba43('0xaa')]||'')};if(_0x1e78ae['body'][_0xba43('0xb4')]&&_0x1e78ae[_0xba43('0x5b')][_0xba43('0xba')]&&_0x1e78ae[_0xba43('0x5b')][_0xba43('0xb4')]!=_0x1e78ae[_0xba43('0x5b')][_0xba43('0xba')]){_0x3f88f6[_0xba43('0xb4')]=_0x1e78ae[_0xba43('0x5b')][_0xba43('0xba')];}return _0x1d3659[_0xba43('0x60')](_0x3f88f6);}else{return _0x1d3659;}}})[_0xba43('0x23')](function(_0x300643){_0x5633e9['interaction']=_0x300643[_0xba43('0x36')]({'plain':!![]});_0x5633e9['interaction'][_0xba43('0xbb')]=_0xd53b30;if(_0x5633e9['interaction'][_0xba43('0xbb')]){if(_0x5633e9['account'][_0xba43('0xbc')]){_0x5633e9['applications'][_0xba43('0xbd')]({'id':0x0,'priority':_0x5633e9['applications'][_0xba43('0x45')]+0x1,'app':_0xba43('0xbe'),'appdata':_0xba43('0xbf'),'interval':_0xba43('0xc0')});}}return db[_0xba43('0xc1')]['create']({'body':_0x1e78ae['body'][_0xba43('0x5b')],'ChatWebsiteId':_0x1e78ae[_0xba43('0x61')]['id'],'ChatInteractionId':_0x300643['id'],'direction':'in','ContactId':_0x5633e9[_0xba43('0xa9')]['id'],'AttachmentId':_0x1e78ae[_0xba43('0x5b')][_0xba43('0xc2')]});})[_0xba43('0x23')](function(_0x1f36d3){_0x5633e9['message']=_0x1f36d3;if(_0x5633e9[_0xba43('0xb8')][_0xba43('0xc3')]){return db[_0xba43('0xc4')][_0xba43('0x59')]({'attributes':['id',_0xba43('0x3a')],'where':{'id':_0x5633e9[_0xba43('0xb8')]['UserId']}})[_0xba43('0x23')](function(_0x4542da){if(_0x4542da){_0x5633e9[_0xba43('0xa4')][_0xba43('0xc5')]({'id':0x0,'priority':0x0,'app':_0xba43('0xc6'),'appdata':_0x4542da[_0xba43('0x3a')]+','+(_0x5633e9[_0xba43('0xa7')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x5633e9[_0xba43('0xc7')]=!![];}return respondWithRpcPromise(_0xba43('0xc8'),_0xba43('0xc9'),_0x5633e9);});}return respondWithRpcPromise(_0xba43('0xc8'),_0xba43('0xc9'),_0x5633e9);})[_0xba43('0x23')](function(_0x3d462e){respondWithRpcPromise('EventManager',_0xba43('0xca'),{'event':_0xba43('0x8b'),'message':_0x3d462e},client9002);return _0x3d462e;})[_0xba43('0x23')](respondWithResult(_0x127bfd,null))[_0xba43('0x2b')](handleError(_0x127bfd,null));};exports[_0xba43('0xcb')]=function(_0x64c365,_0x22a8d5,_0x11d51c){var _0x2388b9,_0x5bee14,_0x554987;var _0x121c9e=[];var _0x57e38a=[];var _0x4340ea={};return db[_0xba43('0x91')][_0xba43('0x62')]()['then'](function(_0x7e93ae){if(!_0x7e93ae){throw new db['Sequelize'][(_0xba43('0x97'))]('no\x20available\x20attributes');}_0x57e38a=_[_0xba43('0x95')](_['keys'](_0x7e93ae),['createdAt',_0xba43('0x94')]);_0x121c9e=_[_0xba43('0x95')](_['keys'](_0x7e93ae),[_0xba43('0x96'),_0xba43('0x94'),'CompanyId',_0xba43('0xa8')]);if(_0x64c365['body']['id']){delete _0x64c365['body']['id'];}if(_[_0xba43('0x84')](_0x64c365[_0xba43('0x5b')][_0xba43('0x9c')])){throw _0x22a8d5[_0xba43('0x2d')](0x1f4)[_0xba43('0x3b')](new db['Sequelize'][(_0xba43('0x97'))](_0xba43('0xcc')));}if(_[_0xba43('0x84')](_0x64c365[_0xba43('0x5b')][_0xba43('0x5b')])||_0x64c365['body'][_0xba43('0x5b')]===''){throw _0x22a8d5[_0xba43('0x2d')](0x1f4)['send'](new db['Sequelize'][(_0xba43('0x97'))](_0xba43('0xcd')));}if(_[_0xba43('0x84')](_0x64c365[_0xba43('0x5b')][_0xba43('0xce')])){throw _0x22a8d5[_0xba43('0x2d')](0x1f4)[_0xba43('0x3b')](new db['Sequelize']['ValidationError'](_0xba43('0xcf')+_0x121c9e));}if(!_['includes'](_0x121c9e,_0x64c365[_0xba43('0x5b')][_0xba43('0xce')])){throw _0x22a8d5['status'](0x1f4)[_0xba43('0x3b')](new db[(_0xba43('0x92'))]['ValidationError'](_0xba43('0xd0')+_0x121c9e));}_0x4340ea[_0x64c365['body'][_0xba43('0xce')]]=_0x64c365[_0xba43('0x5b')][_0xba43('0x9c')];})[_0xba43('0x23')](function(){return db['ChatWebsite'][_0xba43('0x59')]({'where':{'id':_0x64c365[_0xba43('0x61')]['id']},'include':[{'model':db[_0xba43('0x9d')],'as':_0xba43('0xa3')}]});})[_0xba43('0x23')](handleEntityNotFound(_0x22a8d5,null))[_0xba43('0x23')](function(_0x31fa54){if(_0x31fa54&&_0x31fa54[_0xba43('0xa3')]){_0x5bee14=_0x31fa54;var _0x2561c9=_[_0xba43('0x19')](_0x64c365[_0xba43('0x5b')],{'firstName':_0x64c365[_0xba43('0x5b')]['from'],'phone':_0x64c365[_0xba43('0x5b')][_0xba43('0x9c')],'ListId':_0x31fa54['ListId']});_0x2561c9[_0x64c365[_0xba43('0x5b')][_0xba43('0xce')]]=_0x64c365[_0xba43('0x5b')][_0xba43('0x9c')];return db['CmContact']['findOrCreate']({'where':_0x4340ea,'defaults':_0x2561c9});}})['spread'](function(_0x292186){if(_0x292186){_0x554987=_0x292186;var _0x111df3=fs[_0xba43('0xd1')](path[_0xba43('0x7e')](config['root'],_0xba43('0xd2')),_0xba43('0xd3'));var _0x3ee06d=ejs[_0xba43('0xd4')](_0x111df3,{'body':_[_0xba43('0xd5')](_0x64c365['body'][_0xba43('0x5b')]),'bodyTitle':_0x5bee14[_0xba43('0xd6')]});return db[_0xba43('0xd7')][_0xba43('0x5a')]({'body':_0x3ee06d,'ContactId':_0x292186['id'],'ChatWebsiteId':_0x5bee14['id']});}})[_0xba43('0x23')](function(_0x1f7933){if(_0x1f7933){_0x2388b9=_0x1f7933;return db[_0xba43('0xd8')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xba43('0xd9')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x2ef400){if(_0x2ef400&&_0x2ef400[_0xba43('0xda')]&&_0x5bee14[_0xba43('0xdb')]){var _0x37b071={'tls':{'rejectUnauthorized':![]}};if(_0x2ef400[_0xba43('0xda')][_0xba43('0xdc')]){_0x37b071[_0xba43('0xdc')]=_0x2ef400[_0xba43('0xda')][_0xba43('0xdc')];}else{_0x37b071[_0xba43('0xdd')]=_0x2ef400['Smtp'][_0xba43('0xdd')];_0x37b071[_0xba43('0xde')]=_0x2ef400[_0xba43('0xda')][_0xba43('0xde')];_0x37b071[_0xba43('0xdf')]=_0x2ef400[_0xba43('0xda')][_0xba43('0xdf')];}if(_0x2ef400[_0xba43('0xda')][_0xba43('0xe0')]){_0x37b071[_0xba43('0xe1')]={'user':_0x2ef400['Smtp'][_0xba43('0x5c')],'pass':_0x2ef400['Smtp'][_0xba43('0xe2')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x37b071,'message':{'from':util[_0xba43('0xaf')](_0xba43('0xe3'),_0x2ef400[_0xba43('0x3a')],_0x2ef400[_0xba43('0xe4')]||_0x2ef400[_0xba43('0xda')]['user']),'to':_0x5bee14['forwardOfflineAddress'],'subject':_0x5bee14[_0xba43('0xe5')],'text':_0x2388b9[_0xba43('0x5b')]}},client9003)[_0xba43('0x23')](function(){return _0x2388b9;})[_0xba43('0x2b')](function(_0x344471){console[_0xba43('0x29')](_0x344471);});}})[_0xba43('0x23')](function(){if(_0x2388b9){return _0x2388b9;}})[_0xba43('0x23')](respondWithResult(_0x22a8d5,null))[_0xba43('0x2b')](handleError(_0x22a8d5,null));};exports[_0xba43('0xe6')]=function(_0x3ba6c4,_0x54f61d,_0x4517c0){return db[_0xba43('0xb5')][_0xba43('0x59')]({'where':{'id':_0x3ba6c4[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x54f61d,null))['then'](function(_0x11137b){if(_0x11137b){return _0x11137b['addInteraction'](_0x3ba6c4['body'][_0xba43('0x69')],_[_0xba43('0xe7')](_0x3ba6c4[_0xba43('0x5b')],[_0xba43('0x69'),'id'])||{});}})[_0xba43('0x23')](respondWithResult(_0x54f61d,null))[_0xba43('0x2b')](handleError(_0x54f61d,null));};exports[_0xba43('0xe8')]=function(_0x374522,_0x450f36,_0x1d889){var _0x32ceed={'raw':![],'where':{}};var _0x25a597={};var _0x4aeb7f={'count':0x0,'rows':[]};return db[_0xba43('0x50')]['findOne']({'where':{'id':_0x374522[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x450f36,null))[_0xba43('0x23')](function(_0x37873e){if(_0x37873e){_0x25a597[_0xba43('0x3f')]=_['keys'](db['ChatInteraction'][_0xba43('0x57')]);_0x25a597['query']=_[_0xba43('0x40')](_0x374522[_0xba43('0x41')]);_0x25a597[_0xba43('0x42')]=_[_0xba43('0x58')](_0x25a597['model'],_0x25a597['query']);_0x32ceed[_0xba43('0x43')]=_[_0xba43('0x58')](_0x25a597['model'],qs[_0xba43('0x44')](_0x374522['query'][_0xba43('0x44')]));_0x32ceed[_0xba43('0x43')]=_0x32ceed['attributes']['length']?_0x32ceed[_0xba43('0x43')]:_0x25a597[_0xba43('0x3f')];if(!_0x374522[_0xba43('0x41')][_0xba43('0x66')]('nolimit')){_0x32ceed[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x374522['query'][_0xba43('0x31')]);_0x32ceed[_0xba43('0x30')]=qs[_0xba43('0x30')](_0x374522[_0xba43('0x41')][_0xba43('0x30')]);}_0x32ceed['order']=qs[_0xba43('0x48')](_0x374522['query'][_0xba43('0x48')]);_0x32ceed['where']=qs[_0xba43('0x42')](_[_0xba43('0x67')](_0x374522['query'],_0x25a597[_0xba43('0x42')]));_0x32ceed[_0xba43('0x4a')][_0xba43('0x64')]=_0x37873e['id'];if(_0x374522[_0xba43('0x41')]['filter']){_0x32ceed[_0xba43('0x4a')]=_[_0xba43('0x4b')](_0x32ceed[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x32ceed[_0xba43('0x43')],function(_0xd75bb8){var _0x2f3637={};_0x2f3637[_0xd75bb8]={'$like':'%'+_0x374522['query'][_0xba43('0x49')]+'%'};return _0x2f3637;})});}_0x32ceed=_[_0xba43('0x4b')]({},_0x32ceed,_0x374522[_0xba43('0x4f')]);return db['ChatInteraction']['count']({'where':_0x32ceed[_0xba43('0x4a')]})[_0xba43('0x23')](function(_0x301f5c){_0x4aeb7f[_0xba43('0x51')]=_0x301f5c;if(_0x374522[_0xba43('0x41')]['includeAll']){_0x32ceed['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xba43('0xe9'),'attributes':[_0xba43('0x3a'),_0xba43('0xea'),_0xba43('0xeb')],'required':![]},{'model':db['Tag'],'as':_0xba43('0xec'),'attributes':['id',_0xba43('0x3a'),_0xba43('0xed')],'where':_0x374522['query'][_0xba43('0xee')]?{'id':_0x374522[_0xba43('0x41')][_0xba43('0xee')]}:undefined,'required':_0x374522[_0xba43('0x41')][_0xba43('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0xba43('0x54')](_0x32ceed);})[_0xba43('0x23')](function(_0x5adc71){_0x4aeb7f[_0xba43('0x55')]=_0x5adc71;return _0x4aeb7f;});}})[_0xba43('0x23')](respondWithFilteredResult(_0x450f36,_0x32ceed))[_0xba43('0x2b')](handleError(_0x450f36,null));};function iftimePromise(_0x172eeb,_0x4b4a5d){return respondWithRpcPromise('Command','getSnippet',{'command':_0x4b4a5d[_0xba43('0xef')]?util['format'](_0xba43('0xf0'),_0x172eeb[_0xba43('0xf1')],_0x4b4a5d[_0xba43('0xef')]):util[_0xba43('0xaf')](_0xba43('0xf2'),_0x172eeb[_0xba43('0xf1')])},client9002)[_0xba43('0x23')](function(_0x28d797){var _0x5b2dc3=_0x28d797&&_0x28d797[_0xba43('0xf3')](_0xba43('0xf4'))>=0x0?!![]:![];logger[_0xba43('0x24')](_0xba43('0xf5'),_0x4b4a5d['id'],_0x172eeb['id'],_0x172eeb[_0xba43('0xf1')],_0x5b2dc3?_0xba43('0xf6'):'OFFLINE',_0x4b4a5d[_0xba43('0xef')]?_0x4b4a5d[_0xba43('0xef')]:_0xba43('0xf7'));return _0x5b2dc3;})[_0xba43('0x2b')](function(_0x4ab283){logger[_0xba43('0x29')](_0xba43('0xf5'),_0x4b4a5d['id'],_0x172eeb['id'],_0x172eeb[_0xba43('0xf1')],util[_0xba43('0xf8')](_0x4ab283,{'showHidden':![],'depth':null}),_0x4b4a5d[_0xba43('0xef')]?_0x4b4a5d['timezone']:_0xba43('0xf7'));return![];});}exports['getSnippet']=function(_0x10575e,_0x2cc36c,_0x49578f){var _0x2f16ea=0x0;var _0x57d1cb=0x0;var _0x539140=![];var _0x45118f;var _0x23cddb;return db[_0xba43('0x50')]['find']({'where':{'id':_0x10575e[_0xba43('0x61')]['id']},'include':[{'model':db[_0xba43('0xf9')],'as':'Interval','include':[{'model':db[_0xba43('0xf9')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xba43('0x23')](handleEntityNotFound(_0x2cc36c,null))[_0xba43('0x23')](function(_0x38b71a){if(_0x38b71a){_0x45118f=_0x38b71a;return _0x38b71a[_0xba43('0xfa')]({'raw':!![]});}})['then'](function(_0x3de582){if(_0x45118f){if(_0x3de582){_0x23cddb=_0x3de582;}}return require('../../config/license/util')[_0xba43('0x7b')]();})['then'](function(_0x483353){if(_0x483353){_0x57d1cb=_0x483353[_0xba43('0xfb')];_0x539140=_0x483353[_0xba43('0x7c')];}})[_0xba43('0x23')](function(){return db[_0xba43('0xb5')][_0xba43('0x51')]({'where':{'closed':![]}});})['then'](function(_0x75b945){_0x2f16ea=_0x75b945;if(_0x57d1cb&&_0x75b945>_0x57d1cb){return db[_0xba43('0xfc')]['findOne']({'where':{'id':0x1}})[_0xba43('0x23')](function(_0x5c5fd8){if(_0x5c5fd8){_0x5c5fd8[_0xba43('0xfd')](_0xba43('0xfe'));}});}})[_0xba43('0x23')](function(){if(_0x45118f[_0xba43('0xf9')]&&_0x45118f[_0xba43('0xf9')][_0xba43('0xff')]){var _0x3fd987=[];for(var _0x4e1bbd=0x0;_0x4e1bbd<_0x45118f['Interval'][_0xba43('0xff')][_0xba43('0x45')];_0x4e1bbd++){var _0x9cdf9f=_0x45118f['Interval']['Intervals'][_0x4e1bbd][_0xba43('0x36')]({'plain':!![]});_0x3fd987[_0xba43('0xbd')](iftimePromise(_0x9cdf9f,_0x45118f));}return BPromise[_0xba43('0x100')](_0x3fd987)['then'](function(_0x514a7a){return _[_0xba43('0x101')](_0x514a7a);});}else{return!![];}})[_0xba43('0x23')](function(_0x20dc02){var _0x5c43f2=fs[_0xba43('0xd1')](path['join'](config[_0xba43('0x7f')],_0xba43('0x102')),_0xba43('0xd3'));var _0x410550={'remote':_0x45118f[_0xba43('0x103')],'query':querystring[_0xba43('0xb3')](_['merge'](_0x45118f[_0xba43('0x36')]({'plain':!![]}),{'customerIp':_0x10575e[_0xba43('0x8e')][_0xba43('0x104')]||_0x10575e[_0xba43('0x8e')][_0xba43('0x105')]||_0x10575e[_0xba43('0x106')]['remoteAddress']||_0x10575e['ip'],'referer':_0x10575e[_0xba43('0x8e')][_0xba43('0x107')],'openedInteractions':_0x2f16ea,'maxInteractions':_0x57d1cb,'virtual':_0x539140[_0xba43('0xfb')],'online':_0x20dc02,'custom':_0x539140}))[_0xba43('0x108')](/'/g,'\x5c\x27')};_0x2cc36c[_0xba43('0x3b')](ejs[_0xba43('0xd4')](Mustache[_0xba43('0xd4')](_0x5c43f2,_0x410550),{'proactiveActions':_0x23cddb,'alignment':_0x45118f['alignment'],'verticalAlignment':_0x45118f[_0xba43('0x109')]}));})[_0xba43('0x2b')](handleError(_0x2cc36c,null));};exports[_0xba43('0x10a')]=function(_0xe22e0d,_0x1d033f,_0x5a8b27){return db[_0xba43('0x50')][_0xba43('0x6d')]({'where':{'id':_0xe22e0d[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x1d033f,null))['then'](function(_0x57b7cc){if(_0x57b7cc){return db[_0xba43('0x10b')][_0xba43('0x10c')](function(_0x3a9d3d){return db[_0xba43('0xa0')]['destroy']({'where':{'ChatWebsiteId':_0xe22e0d[_0xba43('0x61')]['id']},'transaction':_0x3a9d3d})['then'](function(_0x137cf4){var _0x2a033a=_['map'](_0xe22e0d['body'],function(_0xfa043e){_0xfa043e['ChatWebsiteId']=_0xe22e0d[_0xba43('0x61')]['id'];return _0xfa043e;});return db[_0xba43('0xa0')][_0xba43('0x10d')](_0x2a033a,{'transaction':_0x3a9d3d});});})[_0xba43('0x23')](function(){return db[_0xba43('0xa0')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xe22e0d['params']['id']},'order':_0xba43('0xa5')});});}})['then'](respondWithResult(_0x1d033f,null))[_0xba43('0x2b')](handleError(_0x1d033f,null));};exports[_0xba43('0x10e')]=function(_0x36bce1,_0x4b687c,_0x9b37fd){var _0x3ef42a={};var _0x4421cc={};var _0x31659c;var _0x331a34;return db['ChatWebsite'][_0xba43('0x6d')]({'where':{'id':_0x36bce1['params']['id']}})['then'](handleEntityNotFound(_0x4b687c,null))[_0xba43('0x23')](function(_0x87dfe1){if(_0x87dfe1){_0x31659c=_0x87dfe1;_0x4421cc[_0xba43('0x3f')]=_[_0xba43('0x40')](db['ChatApplication'][_0xba43('0x57')]);_0x4421cc[_0xba43('0x41')]=_[_0xba43('0x40')](_0x36bce1[_0xba43('0x41')]);_0x4421cc[_0xba43('0x42')]=_[_0xba43('0x58')](_0x4421cc[_0xba43('0x3f')],_0x4421cc[_0xba43('0x41')]);_0x3ef42a[_0xba43('0x43')]=_[_0xba43('0x58')](_0x4421cc[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x36bce1[_0xba43('0x41')]['fields']));_0x3ef42a[_0xba43('0x43')]=_0x3ef42a[_0xba43('0x43')][_0xba43('0x45')]?_0x3ef42a['attributes']:_0x4421cc[_0xba43('0x3f')];_0x3ef42a['order']=qs['sort'](_0x36bce1[_0xba43('0x41')]['sort']);_0x3ef42a[_0xba43('0x4a')]=qs[_0xba43('0x42')](_[_0xba43('0x67')](_0x36bce1[_0xba43('0x41')],_0x4421cc[_0xba43('0x42')]));if(_0x36bce1[_0xba43('0x41')][_0xba43('0x49')]){_0x3ef42a['where']=_[_0xba43('0x4b')](_0x3ef42a[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x3ef42a[_0xba43('0x43')],function(_0x3c60bb){var _0x1fdf71={};_0x1fdf71[_0x3c60bb]={'$like':'%'+_0x36bce1[_0xba43('0x41')][_0xba43('0x49')]+'%'};return _0x1fdf71;})});}_0x3ef42a=_[_0xba43('0x4b')]({},_0x3ef42a,_0x36bce1['options']);return _0x31659c[_0xba43('0x10e')](_0x3ef42a);}})['then'](function(_0x5b8d14){if(_0x5b8d14){_0x331a34=_0x5b8d14[_0xba43('0x45')];if(!_0x36bce1[_0xba43('0x41')]['hasOwnProperty'](_0xba43('0x46'))){_0x3ef42a[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x36bce1['query'][_0xba43('0x31')]);_0x3ef42a[_0xba43('0x30')]=qs['offset'](_0x36bce1[_0xba43('0x41')]['offset']);}return _0x31659c['getApplications'](_0x3ef42a);}})[_0xba43('0x23')](function(_0x39f948){if(_0x39f948){return _0x39f948?{'count':_0x331a34,'rows':_0x39f948}:null;}})['then'](respondWithResult(_0x4b687c,null))[_0xba43('0x2b')](handleError(_0x4b687c,null));};exports[_0xba43('0x10f')]=function(_0x293997,_0x5068b8,_0x878b2f){return db[_0xba43('0x110')][_0xba43('0x59')]({'where':{'id':_0x293997[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x5068b8,null))[_0xba43('0x23')](function(_0xefed41){if(_0xefed41){return _0xefed41['addProactiveActions'](_0x293997['body'][_0xba43('0x69')],_[_0xba43('0xe7')](_0x293997[_0xba43('0x5b')],[_0xba43('0x69'),'id'])||{});}})[_0xba43('0x23')](respondWithResult(_0x5068b8,null))[_0xba43('0x2b')](handleError(_0x5068b8,null));};exports[_0xba43('0xfa')]=function(_0x81e615,_0x5dbe80,_0x3229af){var _0x6bba4a={};var _0x59b856={};var _0x255862;var _0x387763;return db[_0xba43('0x50')][_0xba43('0x6d')]({'where':{'id':_0x81e615[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x5dbe80,null))[_0xba43('0x23')](function(_0x291a37){if(_0x291a37){_0x255862=_0x291a37;_0x59b856[_0xba43('0x3f')]=_[_0xba43('0x40')](db[_0xba43('0x111')][_0xba43('0x57')]);_0x59b856[_0xba43('0x41')]=_[_0xba43('0x40')](_0x81e615[_0xba43('0x41')]);_0x59b856[_0xba43('0x42')]=_[_0xba43('0x58')](_0x59b856[_0xba43('0x3f')],_0x59b856[_0xba43('0x41')]);_0x6bba4a[_0xba43('0x43')]=_[_0xba43('0x58')](_0x59b856[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x81e615['query'][_0xba43('0x44')]));_0x6bba4a['attributes']=_0x6bba4a[_0xba43('0x43')][_0xba43('0x45')]?_0x6bba4a[_0xba43('0x43')]:_0x59b856[_0xba43('0x3f')];_0x6bba4a[_0xba43('0x47')]=qs['sort'](_0x81e615[_0xba43('0x41')]['sort']);_0x6bba4a[_0xba43('0x4a')]=qs[_0xba43('0x42')](_['pick'](_0x81e615[_0xba43('0x41')],_0x59b856['filters']));if(_0x81e615[_0xba43('0x41')]['filter']){_0x6bba4a[_0xba43('0x4a')]=_[_0xba43('0x4b')](_0x6bba4a[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x6bba4a[_0xba43('0x43')],function(_0x19cf35){var _0x21e651={};_0x21e651[_0x19cf35]={'$like':'%'+_0x81e615[_0xba43('0x41')][_0xba43('0x49')]+'%'};return _0x21e651;})});}_0x6bba4a=_[_0xba43('0x4b')]({},_0x6bba4a,_0x81e615['options']);return _0x255862['getProactiveActions'](_0x6bba4a);}})[_0xba43('0x23')](function(_0x40068e){if(_0x40068e){_0x387763=_0x40068e[_0xba43('0x45')];if(!_0x81e615[_0xba43('0x41')][_0xba43('0x66')](_0xba43('0x46'))){_0x6bba4a[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x81e615[_0xba43('0x41')]['limit']);_0x6bba4a[_0xba43('0x30')]=qs[_0xba43('0x30')](_0x81e615[_0xba43('0x41')][_0xba43('0x30')]);}return _0x255862[_0xba43('0xfa')](_0x6bba4a);}})[_0xba43('0x23')](function(_0x1f3a5b){if(_0x1f3a5b){return _0x1f3a5b?{'count':_0x387763,'rows':_0x1f3a5b}:null;}})[_0xba43('0x23')](respondWithResult(_0x5dbe80,null))[_0xba43('0x2b')](handleError(_0x5dbe80,null));};exports[_0xba43('0x112')]=function(_0x21ff96,_0x378832,_0x345117){var _0x53763b=_0x21ff96[_0xba43('0x41')]['online']===_0xba43('0x113')?_0xba43('0x114'):_0xba43('0x115');return db[_0xba43('0x50')][_0xba43('0x59')]({'attributes':['id',_0x53763b],'where':{'id':_0x21ff96[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x378832,null))['then'](function(_0x2f174d){if(_0x2f174d){var _0x2b2b30=_0x2f174d[_0x53763b];var _0x2d1543=_0x2b2b30&&_0x2b2b30[_0xba43('0x116')]?_0x2b2b30['items']:[];_0x378832[_0xba43('0x3b')]({'fromKey':_[_0xba43('0x84')](_0x2b2b30['fromKey'])?undefined:_0x2b2b30[_0xba43('0x117')],'count':_0x2d1543['length'],'rows':_0x2d1543});}})['catch'](handleError(_0x378832,null));};exports['getOfflineMessages']=function(_0x1385fe,_0x1641c2,_0x572ad6){var _0xbccb17={'raw':!![],'where':{}};var _0x4d5c8c={};var _0x576dd6={'count':0x0,'rows':[]};return db[_0xba43('0x50')][_0xba43('0x6d')]({'where':{'id':_0x1385fe['params']['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x1641c2,null))['then'](function(_0x2ae16d){if(_0x2ae16d){_0x4d5c8c[_0xba43('0x3f')]=_[_0xba43('0x40')](db['ChatOfflineMessage']['rawAttributes']);_0x4d5c8c['query']=_[_0xba43('0x40')](_0x1385fe[_0xba43('0x41')]);_0x4d5c8c[_0xba43('0x42')]=_[_0xba43('0x58')](_0x4d5c8c['model'],_0x4d5c8c[_0xba43('0x41')]);_0xbccb17[_0xba43('0x43')]=_[_0xba43('0x58')](_0x4d5c8c[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x1385fe[_0xba43('0x41')][_0xba43('0x44')]));_0xbccb17[_0xba43('0x43')]=_0xbccb17[_0xba43('0x43')][_0xba43('0x45')]?_0xbccb17[_0xba43('0x43')]:_0x4d5c8c['model'];if(!_0x1385fe[_0xba43('0x41')]['hasOwnProperty'](_0xba43('0x46'))){_0xbccb17[_0xba43('0x31')]=qs[_0xba43('0x31')](_0x1385fe[_0xba43('0x41')][_0xba43('0x31')]);_0xbccb17['offset']=qs[_0xba43('0x30')](_0x1385fe[_0xba43('0x41')]['offset']);}_0xbccb17[_0xba43('0x47')]=qs[_0xba43('0x48')](_0x1385fe['query'][_0xba43('0x48')]);_0xbccb17['where']=qs['filters'](_['pick'](_0x1385fe[_0xba43('0x41')],_0x4d5c8c[_0xba43('0x42')]));_0xbccb17[_0xba43('0x4a')][_0xba43('0x64')]=_0x2ae16d['id'];if(_0x1385fe[_0xba43('0x41')]['filter']){_0xbccb17['where']=_[_0xba43('0x4b')](_0xbccb17['where'],{'$or':_[_0xba43('0x4c')](_0xbccb17[_0xba43('0x43')],function(_0x3e919e){var _0x2c13bd={};_0x2c13bd[_0x3e919e]={'$like':'%'+_0x1385fe[_0xba43('0x41')][_0xba43('0x49')]+'%'};return _0x2c13bd;})});}_0xbccb17=_['merge']({},_0xbccb17,_0x1385fe[_0xba43('0x4f')]);return db[_0xba43('0xd7')][_0xba43('0x51')]({'where':_0xbccb17[_0xba43('0x4a')]})[_0xba43('0x23')](function(_0x35d5b2){_0x576dd6['count']=_0x35d5b2;if(_0x1385fe[_0xba43('0x41')][_0xba43('0x52')]){_0xbccb17['include']=[{'all':!![]}];}return db[_0xba43('0xd7')][_0xba43('0x54')](_0xbccb17);})['then'](function(_0x2d1516){_0x576dd6['rows']=_0x2d1516;return _0x576dd6;});}})[_0xba43('0x23')](respondWithFilteredResult(_0x1641c2,_0xbccb17))[_0xba43('0x2b')](handleError(_0x1641c2,null));};exports[_0xba43('0x118')]=function(_0x1a7da7,_0x5735e7,_0x1539a1){return db['ChatWebsite'][_0xba43('0x59')]({'where':{'id':_0x1a7da7[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x5735e7,null))['then'](function(_0x5a1c55){if(_0x5a1c55){return _0x5a1c55[_0xba43('0x118')](_0x1a7da7[_0xba43('0x5b')][_0xba43('0x69')],_[_0xba43('0xe7')](_0x1a7da7[_0xba43('0x5b')],[_0xba43('0x69'),'id'])||{})['spread'](function(_0x5e1d85){for(var _0x27b0a0=0x0;_0x27b0a0<_0x1a7da7[_0xba43('0x5b')][_0xba43('0x69')][_0xba43('0x45')];_0x27b0a0+=0x1){socket[_0xba43('0x119')](_0xba43('0x11a'),{'UserId':_0x1a7da7[_0xba43('0x5b')][_0xba43('0x69')][_0x27b0a0],'ChatWebsiteId':_0x1a7da7[_0xba43('0x61')]['id']});}return _0x5e1d85;});}})['then'](respondWithResult(_0x5735e7,null))[_0xba43('0x2b')](handleError(_0x5735e7,null));};exports[_0xba43('0x11b')]=function(_0xfdedcc,_0x1e8dd1,_0x2e7962){return db['ChatWebsite'][_0xba43('0x59')]({'where':{'id':_0xfdedcc[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0x1e8dd1,null))[_0xba43('0x23')](function(_0x4aea89){if(_0x4aea89){return _0x4aea89[_0xba43('0x11b')](_0xfdedcc[_0xba43('0x41')]['ids'])[_0xba43('0x23')](function(){if(_[_0xba43('0x11c')](_0xfdedcc[_0xba43('0x41')][_0xba43('0x69')])){for(var _0x4c21e4=0x0;_0x4c21e4<_0xfdedcc[_0xba43('0x41')][_0xba43('0x69')][_0xba43('0x45')];_0x4c21e4+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xfdedcc[_0xba43('0x41')]['ids'][_0x4c21e4]),'ChatWebsiteId':Number(_0xfdedcc[_0xba43('0x61')]['id'])});}}else{socket[_0xba43('0x119')](_0xba43('0x11d'),{'UserId':Number(_0xfdedcc['query']['ids']),'ChatWebsiteId':Number(_0xfdedcc[_0xba43('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x1e8dd1,null))[_0xba43('0x2b')](handleError(_0x1e8dd1,null));};exports[_0xba43('0x11e')]=function(_0x4898ef,_0xbe0f64,_0x474f19){var _0x12dd09={};var _0x115483={};var _0x1d6066;var _0x9bd030;return db[_0xba43('0x50')]['findOne']({'where':{'id':_0x4898ef[_0xba43('0x61')]['id']}})[_0xba43('0x23')](handleEntityNotFound(_0xbe0f64,null))[_0xba43('0x23')](function(_0x1b1e25){if(_0x1b1e25){_0x1d6066=_0x1b1e25;_0x115483[_0xba43('0x3f')]=_[_0xba43('0x40')](db[_0xba43('0xc4')]['rawAttributes']);_0x115483[_0xba43('0x41')]=_[_0xba43('0x40')](_0x4898ef[_0xba43('0x41')]);_0x115483[_0xba43('0x42')]=_[_0xba43('0x58')](_0x115483[_0xba43('0x3f')],_0x115483[_0xba43('0x41')]);_0x12dd09[_0xba43('0x43')]=_['intersection'](_0x115483[_0xba43('0x3f')],qs[_0xba43('0x44')](_0x4898ef['query']['fields']));_0x12dd09['attributes']=_0x12dd09[_0xba43('0x43')][_0xba43('0x45')]?_0x12dd09[_0xba43('0x43')]:_0x115483[_0xba43('0x3f')];_0x12dd09['order']=qs[_0xba43('0x48')](_0x4898ef[_0xba43('0x41')][_0xba43('0x48')]);_0x12dd09[_0xba43('0x4a')]=qs['filters'](_[_0xba43('0x67')](_0x4898ef[_0xba43('0x41')],_0x115483[_0xba43('0x42')]));if(_0x4898ef[_0xba43('0x41')][_0xba43('0x49')]){_0x12dd09[_0xba43('0x4a')]=_[_0xba43('0x4b')](_0x12dd09[_0xba43('0x4a')],{'$or':_[_0xba43('0x4c')](_0x12dd09['attributes'],function(_0xa8c88d){var _0x326897={};_0x326897[_0xa8c88d]={'$like':'%'+_0x4898ef['query']['filter']+'%'};return _0x326897;})});}_0x12dd09=_[_0xba43('0x4b')]({},_0x12dd09,_0x4898ef[_0xba43('0x4f')]);return _0x1d6066[_0xba43('0x11e')](_0x12dd09);}})[_0xba43('0x23')](function(_0x140c01){if(_0x140c01){_0x9bd030=_0x140c01[_0xba43('0x45')];if(!_0x4898ef['query']['hasOwnProperty'](_0xba43('0x46'))){_0x12dd09[_0xba43('0x31')]=qs['limit'](_0x4898ef[_0xba43('0x41')]['limit']);_0x12dd09[_0xba43('0x30')]=qs[_0xba43('0x30')](_0x4898ef[_0xba43('0x41')][_0xba43('0x30')]);}return _0x1d6066['getAgents'](_0x12dd09);}})[_0xba43('0x23')](function(_0x601ae2){if(_0x601ae2){return _0x601ae2?{'count':_0x9bd030,'rows':_0x601ae2}:null;}})[_0xba43('0x23')](respondWithResult(_0xbe0f64,null))[_0xba43('0x2b')](handleError(_0xbe0f64,null));}; \ No newline at end of file +var _0x307f=['indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.js','utf8','x-forwarded-for','connection','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','http','client','test','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','message','error','result','catch','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','merge','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','pick','map','removeDispositions','ids','CannedAnswer','getAnswers','order','addLogo','sitepic','filename','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','List','orderBy','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','Tag','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x307f,0x13f));var _0xf307=function(_0x32d8b6,_0x1410c8){_0x32d8b6=_0x32d8b6-0x0;var _0x2148e9=_0x307f[_0x32d8b6];return _0x2148e9;};'use strict';var pdf=require(_0xf307('0x0'));var emlformat=require(_0xf307('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf307('0x2'));var rp=require(_0xf307('0x3'));var moment=require(_0xf307('0x4'));var BPromise=require(_0xf307('0x5'));var Mustache=require(_0xf307('0x6'));var util=require(_0xf307('0x7'));var path=require(_0xf307('0x8'));var sox=require(_0xf307('0x9'));var csv=require(_0xf307('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf307('0xb'));var squel=require(_0xf307('0xc'));var crypto=require('crypto');var jsforce=require(_0xf307('0xd'));var deskjs=require(_0xf307('0xe'));var toCsv=require(_0xf307('0xa'));var querystring=require(_0xf307('0xf'));var Papa=require(_0xf307('0x10'));var Redis=require(_0xf307('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf307('0x12'));var logger=require('../../config/logger')(_0xf307('0x13'));var utils=require(_0xf307('0x14'));var config=require('../../config/environment');var db=require(_0xf307('0x15'))['db'];config['redis']=_[_0xf307('0x16')](config[_0xf307('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf307('0x18'))(new Redis(config[_0xf307('0x17')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0xf307('0x19'));var client=jayson['client'][_0xf307('0x1a')]({'port':0x232c});var client9002=jayson[_0xf307('0x1b')][_0xf307('0x1a')]({'port':0x232a});var client9003=jayson['client'][_0xf307('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x196e18,_0x1e45b9,_0x40fa8a){if(_0x40fa8a){var _0x58d12c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58d12c[_0xf307('0x1c')](_0x1e45b9)){return _0x196e18;}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 _0x196e18;}}function respondWithRpcPromise(_0x1aacba,_0x2427bb,_0x59b87e,_0xae4bbe){return new BPromise(function(_0x7e499f,_0x33914f){var _0x443d8f=_0xae4bbe||client;return _0x443d8f[_0xf307('0x1d')](_0x1aacba,_0x59b87e)[_0xf307('0x1e')](function(_0x2614e8){logger[_0xf307('0x1f')](_0xf307('0x20'),_0x2427bb,_0xf307('0x21'));logger[_0xf307('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2427bb,'request\x20sent',JSON[_0xf307('0x23')](_0x2614e8));if(_0x2614e8['error']){if(_0x2614e8['error']['code']===0x1f4){logger['error'](_0xf307('0x20'),_0x2427bb,_0x2614e8['error'][_0xf307('0x24')]);return _0x33914f(_0x2614e8['error']['message']);}logger[_0xf307('0x25')](_0xf307('0x20'),_0x2427bb,_0x2614e8['error'][_0xf307('0x24')]);return _0x7e499f(_0x2614e8['error'][_0xf307('0x24')]);}else{logger[_0xf307('0x1f')](_0xf307('0x20'),_0x2427bb,_0xf307('0x21'));_0x7e499f(_0x2614e8[_0xf307('0x26')][_0xf307('0x24')]);}})[_0xf307('0x27')](function(_0x1b354f){logger[_0xf307('0x25')](_0xf307('0x20'),_0x2427bb,_0x1b354f);_0x33914f(_0x1b354f);});});}function respondWithStatusCode(_0x52b251,_0x1e763e){_0x1e763e=_0x1e763e||0xcc;return function(_0x176157){if(_0x176157){return _0x52b251['sendStatus'](_0x1e763e);}return _0x52b251[_0xf307('0x28')](_0x1e763e)[_0xf307('0x29')]();};}function respondWithResult(_0x59f519,_0x10252b){_0x10252b=_0x10252b||0xc8;return function(_0x29f5be){if(_0x29f5be){return _0x59f519[_0xf307('0x28')](_0x10252b)['json'](_0x29f5be);}};}function respondWithFilteredResult(_0x4aefd9,_0x410687){return function(_0x186291){if(_0x186291){var _0x254131=_0x186291['count'],_0xff813a=_0x410687[_0xf307('0x2a')],_0x745db=_0x410687[_0xf307('0x2a')]+_0x410687['limit'],_0x368261;if(_0x745db>=_0x254131){_0x745db=_0x254131;_0x368261=0xc8;}else{_0x368261=0xce;}_0x4aefd9['status'](_0x368261);return _0x4aefd9['set'](_0xf307('0x2b'),_0xff813a+'-'+_0x745db+'/'+_0x254131)[_0xf307('0x2c')](_0x186291);}return null;};}function patchUpdates(_0x27dbb2){return function(_0x3ba1ca){try{jsonpatch[_0xf307('0x2d')](_0x3ba1ca,_0x27dbb2,!![]);}catch(_0x153b12){return BPromise[_0xf307('0x2e')](_0x153b12);}return _0x3ba1ca[_0xf307('0x2f')]();};}function saveUpdates(_0x255563,_0x187c89){return function(_0xe27f5e){if(_0xe27f5e){return _0xe27f5e[_0xf307('0x30')](_0x255563)[_0xf307('0x1e')](function(_0x6ce995){return _0x6ce995;});}return null;};}function removeEntity(_0x2dd044,_0x2ff3ad){return function(_0x5cd679){if(_0x5cd679){return _0x5cd679[_0xf307('0x31')]()[_0xf307('0x1e')](function(){var _0x880970=_0x5cd679[_0xf307('0x32')]({'plain':!![]});var _0x328940='ChatWebsites';return db[_0xf307('0x33')][_0xf307('0x31')]({'where':{'type':_0x328940,'resourceId':_0x880970['id']}})[_0xf307('0x1e')](function(){return _0x5cd679;});})[_0xf307('0x1e')](function(){_0x2dd044[_0xf307('0x28')](0xcc)[_0xf307('0x29')]();});}};}function handleEntityNotFound(_0x15c486,_0x150667){return function(_0x675a81){if(!_0x675a81){_0x15c486[_0xf307('0x34')](0x194);}return _0x675a81;};}function handleError(_0x39b0af,_0x4dfda0){_0x4dfda0=_0x4dfda0||0x1f4;return function(_0x5cc683){logger[_0xf307('0x25')](_0x5cc683[_0xf307('0x35')]);if(_0x5cc683['name']){delete _0x5cc683[_0xf307('0x36')];}_0x39b0af[_0xf307('0x28')](_0x4dfda0)[_0xf307('0x37')](_0x5cc683);};}exports[_0xf307('0x38')]=function(_0x633cf0,_0x2d0a92){var _0x3329a6={'include':[{'model':db[_0xf307('0x39')],'as':_0xf307('0x3a')}]},_0x5e11a8={},_0x46e8c4={'count':0x0,'rows':[]};var _0x408c27=db[_0xf307('0x3b')]['rawAttributes'];_0x5e11a8[_0xf307('0x3c')]=_[_0xf307('0x3d')](_0x408c27);_0x5e11a8[_0xf307('0x3e')]=_['keys'](_0x633cf0['query']);_0x5e11a8['filters']=_['intersection'](_0x5e11a8['model'],_0x5e11a8['query']);_0x3329a6['attributes']=_[_0xf307('0x3f')](_0x5e11a8[_0xf307('0x3c')],qs['fields'](_0x633cf0['query'][_0xf307('0x40')]));_0x3329a6['attributes']=_0x3329a6[_0xf307('0x41')][_0xf307('0x42')]?_0x3329a6[_0xf307('0x41')]:_0x5e11a8[_0xf307('0x3c')];if(!_0x633cf0[_0xf307('0x3e')][_0xf307('0x43')]('nolimit')){_0x3329a6[_0xf307('0x44')]=qs[_0xf307('0x44')](_0x633cf0[_0xf307('0x3e')][_0xf307('0x44')]);_0x3329a6[_0xf307('0x2a')]=qs[_0xf307('0x2a')](_0x633cf0[_0xf307('0x3e')][_0xf307('0x2a')]);}_0x3329a6['order']=qs[_0xf307('0x45')](_0x633cf0[_0xf307('0x3e')][_0xf307('0x45')]);_0x3329a6[_0xf307('0x46')]=qs[_0xf307('0x47')](_['pick'](_0x633cf0[_0xf307('0x3e')],_0x5e11a8['filters']));if(_0x633cf0[_0xf307('0x3e')]['filter']){_0x3329a6[_0xf307('0x46')]=_[_0xf307('0x48')](_0x3329a6[_0xf307('0x46')],{'$or':_['map'](_0x408c27,function(_0xafa6e5){if(_0xafa6e5['type'][_0xf307('0x49')]!==_0xf307('0x4a')){var _0x2ddcde={};_0x2ddcde[_0xafa6e5[_0xf307('0x4b')]]={'$like':'%'+_0x633cf0['query'][_0xf307('0x4c')]+'%'};return _0x2ddcde;}})});}_0x3329a6=_['merge']({},_0x3329a6,_0x633cf0[_0xf307('0x4d')]);var _0x3ecfbd={'where':_0x3329a6[_0xf307('0x46')]};return db[_0xf307('0x3b')][_0xf307('0x4e')](_0x3ecfbd)['then'](function(_0x4a9762){_0x46e8c4[_0xf307('0x4e')]=_0x4a9762;if(_0x633cf0[_0xf307('0x3e')]['includeAll']){_0x3329a6[_0xf307('0x4f')]=[{'all':!![]}];}return db[_0xf307('0x3b')][_0xf307('0x50')](_0x3329a6);})[_0xf307('0x1e')](function(_0x1417ff){_0x46e8c4[_0xf307('0x51')]=_0x1417ff;return _0x46e8c4;})['then'](respondWithFilteredResult(_0x2d0a92,_0x3329a6))[_0xf307('0x27')](handleError(_0x2d0a92,null));};exports[_0xf307('0x52')]=function(_0x3833b5,_0xf05b56){var _0x5eaa6f={'raw':![],'where':{'id':_0x3833b5[_0xf307('0x53')]['id']},'include':[{'model':db[_0xf307('0x39')],'as':_0xf307('0x3a')}]},_0x1a81ea={};_0x1a81ea[_0xf307('0x3c')]=_[_0xf307('0x3d')](db[_0xf307('0x3b')][_0xf307('0x54')]);_0x1a81ea[_0xf307('0x3e')]=_[_0xf307('0x3d')](_0x3833b5[_0xf307('0x3e')]);_0x1a81ea[_0xf307('0x47')]=_['intersection'](_0x1a81ea['model'],_0x1a81ea[_0xf307('0x3e')]);_0x5eaa6f[_0xf307('0x41')]=_[_0xf307('0x3f')](_0x1a81ea[_0xf307('0x3c')],qs['fields'](_0x3833b5['query'][_0xf307('0x40')]));_0x5eaa6f[_0xf307('0x41')]=_0x5eaa6f[_0xf307('0x41')][_0xf307('0x42')]?_0x5eaa6f[_0xf307('0x41')]:_0x1a81ea[_0xf307('0x3c')];if(_0x3833b5[_0xf307('0x3e')][_0xf307('0x55')]){_0x5eaa6f[_0xf307('0x4f')]=[{'all':!![]}];}_0x5eaa6f=_['merge']({},_0x5eaa6f,_0x3833b5[_0xf307('0x4d')]);return db[_0xf307('0x3b')][_0xf307('0x56')](_0x5eaa6f)[_0xf307('0x1e')](handleEntityNotFound(_0xf05b56,null))['then'](respondWithResult(_0xf05b56,null))[_0xf307('0x27')](handleError(_0xf05b56,null));};exports[_0xf307('0x57')]=function(_0x19ad9a,_0xaf0c01){return db[_0xf307('0x3b')]['create'](_0x19ad9a['body'],{})[_0xf307('0x1e')](function(_0x240de7){var _0x575dc1=_0x19ad9a['user'][_0xf307('0x32')]({'plain':!![]});if(!_0x575dc1)throw new Error(_0xf307('0x58'));if(_0x575dc1[_0xf307('0x59')]===_0xf307('0x5a')){var _0x37c4da=_0x240de7['get']({'plain':!![]});var _0x3ba268=_0xf307('0x5b');return db[_0xf307('0x5c')][_0xf307('0x56')]({'where':{'name':_0x3ba268,'userProfileId':_0x575dc1[_0xf307('0x5d')]},'raw':!![]})[_0xf307('0x1e')](function(_0x12262a){if(_0x12262a&&_0x12262a[_0xf307('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x37c4da[_0xf307('0x36')],'resourceId':_0x37c4da['id'],'type':_0x12262a['name'],'sectionId':_0x12262a['id']},{})['then'](function(){return _0x240de7;});}else{return _0x240de7;}})[_0xf307('0x27')](function(_0x5b4639){logger['error'](_0xf307('0x5f'),_0x5b4639);throw _0x5b4639;});}return _0x240de7;})[_0xf307('0x1e')](respondWithResult(_0xaf0c01,0xc9))[_0xf307('0x27')](handleError(_0xaf0c01,null));};exports[_0xf307('0x30')]=function(_0x5e0f71,_0x4f0544){if(_0x5e0f71['body']['id']){delete _0x5e0f71['body']['id'];}return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x5e0f71[_0xf307('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xf307('0x3a')}]})['then'](handleEntityNotFound(_0x4f0544,null))[_0xf307('0x1e')](saveUpdates(_0x5e0f71[_0xf307('0x60')],null))[_0xf307('0x1e')](respondWithResult(_0x4f0544,null))[_0xf307('0x27')](handleError(_0x4f0544,null));};exports[_0xf307('0x31')]=function(_0x31f817,_0x586965){return db['ChatWebsite'][_0xf307('0x56')]({'where':{'id':_0x31f817[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x586965,null))[_0xf307('0x1e')](removeEntity(_0x586965,null))['catch'](handleError(_0x586965,null));};exports[_0xf307('0x61')]=function(_0x2add34,_0xf18e10){return db[_0xf307('0x3b')][_0xf307('0x61')]()[_0xf307('0x1e')](respondWithResult(_0xf18e10,null))[_0xf307('0x27')](handleError(_0xf18e10,null));};exports[_0xf307('0x62')]=function(_0x1ace33,_0x4a72aa,_0x59f097){if(_0x1ace33['body']['id']){delete _0x1ace33[_0xf307('0x60')]['id'];}return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x1ace33[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x4a72aa,null))[_0xf307('0x1e')](function(_0x16fab5){if(_0x16fab5){_0x1ace33['body'][_0xf307('0x63')]=_0x16fab5['id'];return db[_0xf307('0x64')]['create'](_0x1ace33[_0xf307('0x60')]);}})[_0xf307('0x1e')](respondWithResult(_0x4a72aa,null))[_0xf307('0x27')](handleError(_0x4a72aa,null));};exports[_0xf307('0x65')]=function(_0x26a19a,_0x4ccd57,_0x319b80){var _0x3678cd={'raw':![],'where':{}};var _0x42ee02={};var _0x2a4ddd={'count':0x0,'rows':[]};return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0x26a19a['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x4ccd57,null))[_0xf307('0x1e')](function(_0x1e1759){if(_0x1e1759){_0x42ee02[_0xf307('0x3c')]=_[_0xf307('0x3d')](db[_0xf307('0x64')]['rawAttributes']);_0x42ee02[_0xf307('0x3e')]=_[_0xf307('0x3d')](_0x26a19a[_0xf307('0x3e')]);_0x42ee02[_0xf307('0x47')]=_['intersection'](_0x42ee02['model'],_0x42ee02['query']);_0x3678cd[_0xf307('0x41')]=_[_0xf307('0x3f')](_0x42ee02[_0xf307('0x3c')],qs['fields'](_0x26a19a['query'][_0xf307('0x40')]));_0x3678cd[_0xf307('0x41')]=_0x3678cd[_0xf307('0x41')][_0xf307('0x42')]?_0x3678cd[_0xf307('0x41')]:_0x42ee02[_0xf307('0x3c')];if(!_0x26a19a[_0xf307('0x3e')]['hasOwnProperty'](_0xf307('0x67'))){_0x3678cd[_0xf307('0x44')]=qs[_0xf307('0x44')](_0x26a19a[_0xf307('0x3e')][_0xf307('0x44')]);_0x3678cd[_0xf307('0x2a')]=qs[_0xf307('0x2a')](_0x26a19a[_0xf307('0x3e')][_0xf307('0x2a')]);}_0x3678cd['order']=qs[_0xf307('0x45')](_0x26a19a[_0xf307('0x3e')][_0xf307('0x45')]);_0x3678cd[_0xf307('0x46')]=qs[_0xf307('0x47')](_[_0xf307('0x68')](_0x26a19a[_0xf307('0x3e')],_0x42ee02[_0xf307('0x47')]));_0x3678cd['where'][_0xf307('0x63')]=_0x1e1759['id'];if(_0x26a19a[_0xf307('0x3e')][_0xf307('0x4c')]){_0x3678cd['where']=_[_0xf307('0x48')](_0x3678cd[_0xf307('0x46')],{'$or':_[_0xf307('0x69')](_0x3678cd[_0xf307('0x41')],function(_0x1f2a31){var _0x506f8a={};_0x506f8a[_0x1f2a31]={'$like':'%'+_0x26a19a[_0xf307('0x3e')]['filter']+'%'};return _0x506f8a;})});}_0x3678cd=_[_0xf307('0x48')]({},_0x3678cd,_0x26a19a[_0xf307('0x4d')]);return db['Disposition'][_0xf307('0x4e')]({'where':_0x3678cd[_0xf307('0x46')]})['then'](function(_0x9c6917){_0x2a4ddd[_0xf307('0x4e')]=_0x9c6917;if(_0x26a19a[_0xf307('0x3e')][_0xf307('0x55')]){_0x3678cd[_0xf307('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0xf307('0x50')](_0x3678cd);})[_0xf307('0x1e')](function(_0x222146){_0x2a4ddd['rows']=_0x222146;return _0x2a4ddd;});}})[_0xf307('0x1e')](respondWithFilteredResult(_0x4ccd57,_0x3678cd))['catch'](handleError(_0x4ccd57,null));};exports[_0xf307('0x6a')]=function(_0x5558c1,_0x5db694,_0x124af0){return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x5558c1[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x5db694,null))[_0xf307('0x1e')](function(_0x54e033){if(_0x54e033){return _0x54e033['removeDispositions'](_0x5558c1[_0xf307('0x3e')][_0xf307('0x6b')]);}})['then'](respondWithStatusCode(_0x5db694,null))[_0xf307('0x27')](handleError(_0x5db694,null));};exports['addAnswer']=function(_0x7ab5ad,_0x198abf,_0xdcc144){if(_0x7ab5ad[_0xf307('0x60')]['id']){delete _0x7ab5ad[_0xf307('0x60')]['id'];}return db[_0xf307('0x3b')]['find']({'where':{'id':_0x7ab5ad['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x198abf,null))['then'](function(_0x1b530c){if(_0x1b530c){_0x7ab5ad[_0xf307('0x60')]['ChatWebsiteId']=_0x1b530c['id'];return db[_0xf307('0x6c')][_0xf307('0x57')](_0x7ab5ad['body']);}})[_0xf307('0x1e')](respondWithResult(_0x198abf,null))[_0xf307('0x27')](handleError(_0x198abf,null));};exports[_0xf307('0x6d')]=function(_0x210b6f,_0x98448e,_0x5b6f85){var _0x5600e1={'raw':![],'where':{}};var _0x3d6b21={};var _0x52a435={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf307('0x66')]({'where':{'id':_0x210b6f['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x98448e,null))[_0xf307('0x1e')](function(_0x50389a){if(_0x50389a){_0x3d6b21['model']=_['keys'](db[_0xf307('0x6c')][_0xf307('0x54')]);_0x3d6b21[_0xf307('0x3e')]=_['keys'](_0x210b6f[_0xf307('0x3e')]);_0x3d6b21[_0xf307('0x47')]=_[_0xf307('0x3f')](_0x3d6b21[_0xf307('0x3c')],_0x3d6b21[_0xf307('0x3e')]);_0x5600e1[_0xf307('0x41')]=_['intersection'](_0x3d6b21['model'],qs[_0xf307('0x40')](_0x210b6f[_0xf307('0x3e')][_0xf307('0x40')]));_0x5600e1[_0xf307('0x41')]=_0x5600e1[_0xf307('0x41')][_0xf307('0x42')]?_0x5600e1[_0xf307('0x41')]:_0x3d6b21[_0xf307('0x3c')];if(!_0x210b6f['query'][_0xf307('0x43')](_0xf307('0x67'))){_0x5600e1[_0xf307('0x44')]=qs[_0xf307('0x44')](_0x210b6f[_0xf307('0x3e')][_0xf307('0x44')]);_0x5600e1[_0xf307('0x2a')]=qs[_0xf307('0x2a')](_0x210b6f[_0xf307('0x3e')][_0xf307('0x2a')]);}_0x5600e1[_0xf307('0x6e')]=qs[_0xf307('0x45')](_0x210b6f['query'][_0xf307('0x45')]);_0x5600e1['where']=qs['filters'](_['pick'](_0x210b6f[_0xf307('0x3e')],_0x3d6b21[_0xf307('0x47')]));_0x5600e1[_0xf307('0x46')][_0xf307('0x63')]=_0x50389a['id'];if(_0x210b6f['query'][_0xf307('0x4c')]){_0x5600e1['where']=_[_0xf307('0x48')](_0x5600e1['where'],{'$or':_[_0xf307('0x69')](_0x5600e1[_0xf307('0x41')],function(_0x101270){var _0x352031={};_0x352031[_0x101270]={'$like':'%'+_0x210b6f[_0xf307('0x3e')][_0xf307('0x4c')]+'%'};return _0x352031;})});}_0x5600e1=_['merge']({},_0x5600e1,_0x210b6f[_0xf307('0x4d')]);return db[_0xf307('0x6c')][_0xf307('0x4e')]({'where':_0x5600e1[_0xf307('0x46')]})[_0xf307('0x1e')](function(_0xedfa15){_0x52a435[_0xf307('0x4e')]=_0xedfa15;if(_0x210b6f[_0xf307('0x3e')][_0xf307('0x55')]){_0x5600e1['include']=[{'all':!![]}];}return db[_0xf307('0x6c')]['findAll'](_0x5600e1);})[_0xf307('0x1e')](function(_0x2e9f14){_0x52a435[_0xf307('0x51')]=_0x2e9f14;return _0x52a435;});}})['then'](respondWithFilteredResult(_0x98448e,_0x5600e1))[_0xf307('0x27')](handleError(_0x98448e,null));};exports['removeAnswers']=function(_0x1178a0,_0xfb319f,_0x49c2f5){return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x1178a0[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0xfb319f,null))[_0xf307('0x1e')](function(_0x416444){if(_0x416444){return _0x416444['removeAnswers'](_0x1178a0[_0xf307('0x3e')][_0xf307('0x6b')]);}})[_0xf307('0x1e')](respondWithStatusCode(_0xfb319f,null))[_0xf307('0x27')](handleError(_0xfb319f,null));};exports[_0xf307('0x6f')]=function(_0x55a263,_0x544a47,_0x26f86c){_0x55a263[_0xf307('0x60')][_0xf307('0x70')]=_0x55a263['file'][_0xf307('0x71')];return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x55a263[_0xf307('0x53')]['id']}})['then'](handleEntityNotFound(_0x544a47,null))['then'](saveUpdates(_0x55a263[_0xf307('0x60')],null))[_0xf307('0x1e')](respondWithResult(_0x544a47,null))[_0xf307('0x27')](handleError(_0x544a47,null));};exports['addAvatar']=function(_0x1f7753,_0x4160e3,_0x38403c){_0x1f7753['body'][_0xf307('0x72')]=_0x1f7753[_0xf307('0x73')][_0xf307('0x71')];return db['ChatWebsite'][_0xf307('0x56')]({'where':{'id':_0x1f7753[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x4160e3,null))[_0xf307('0x1e')](saveUpdates(_0x1f7753[_0xf307('0x60')],null))[_0xf307('0x1e')](respondWithResult(_0x4160e3,null))[_0xf307('0x27')](handleError(_0x4160e3,null));};exports[_0xf307('0x74')]=function(_0x47fe0f,_0x26cef2,_0x414b05){_0x47fe0f['body']['customerAvatar']=_0x47fe0f[_0xf307('0x73')][_0xf307('0x71')];return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x47fe0f[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x26cef2,null))[_0xf307('0x1e')](saveUpdates(_0x47fe0f[_0xf307('0x60')],null))[_0xf307('0x1e')](respondWithResult(_0x26cef2,null))[_0xf307('0x27')](handleError(_0x26cef2,null));};exports[_0xf307('0x75')]=function(_0xc3780b,_0x1427e6,_0x230116){_0xc3780b[_0xf307('0x60')][_0xf307('0x76')]=_0xc3780b[_0xf307('0x73')]['filename'];return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0xc3780b[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x1427e6,null))[_0xf307('0x1e')](saveUpdates(_0xc3780b[_0xf307('0x60')],null))[_0xf307('0x1e')](respondWithResult(_0x1427e6,null))[_0xf307('0x27')](handleError(_0x1427e6,null));};exports[_0xf307('0x77')]=function(_0xf4aa8e,_0x22f49c,_0x49817a){var _0x25d737=path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x7a'));var _0x5e7790={'where':{'id':_0xf4aa8e['params']['id']},'attributes':['id',_0xf307('0x70')],'raw':!![]};var _0xf0c32c=![];return require(_0xf307('0x7b'))[_0xf307('0x7c')]()[_0xf307('0x1e')](function(_0x365871){if(_0x365871){_0xf0c32c=_0x365871[_0xf307('0x7d')];}})['then'](function(){return db[_0xf307('0x3b')]['find'](_0x5e7790);})['then'](handleEntityNotFound(_0x22f49c,null))[_0xf307('0x1e')](function(_0xab4667){if(_0xab4667){if(!_['isNil'](_0xab4667[_0xf307('0x70')])){if(fs[_0xf307('0x7e')](path[_0xf307('0x78')](config[_0xf307('0x79')],'server/files/images/logos/',_0xab4667[_0xf307('0x70')]))&&_0xf0c32c){_0x25d737=path['join'](config[_0xf307('0x79')],_0xf307('0x7f'),_0xab4667[_0xf307('0x70')]);}}return _0x22f49c[_0xf307('0x80')](_0x25d737);}})[_0xf307('0x27')](handleError(_0x22f49c,null));};exports[_0xf307('0x81')]=function(_0x42e2f5,_0x2641c1,_0x9a7991){var _0x894686=path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x82'));var _0x1debb2={'where':{'id':_0x42e2f5['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xf307('0x3b')][_0xf307('0x56')](_0x1debb2)[_0xf307('0x1e')](handleEntityNotFound(_0x2641c1,null))[_0xf307('0x1e')](function(_0x1c6256){if(_0x1c6256){if(!_[_0xf307('0x83')](_0x1c6256[_0xf307('0x72')])){if(fs[_0xf307('0x7e')](path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x84'),_0x1c6256[_0xf307('0x72')]))){_0x894686=path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x84'),_0x1c6256['agentAvatar']);}}return _0x2641c1['download'](_0x894686);}})[_0xf307('0x27')](handleError(_0x2641c1,null));};exports['getCustomerAvatar']=function(_0x343631,_0x3ce4f2,_0x2f17de){var _0x3f0b96=path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x85'));var _0x274060={'where':{'id':_0x343631[_0xf307('0x53')]['id']},'attributes':['id',_0xf307('0x86'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x274060)[_0xf307('0x1e')](handleEntityNotFound(_0x3ce4f2,null))['then'](function(_0x2a43b8){if(_0x2a43b8){if(!_['isNil'](_0x2a43b8[_0xf307('0x86')])){if(fs[_0xf307('0x7e')](path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0x84'),_0x2a43b8[_0xf307('0x86')]))&&_0x2a43b8[_0xf307('0x87')]){_0x3f0b96=path['join'](config[_0xf307('0x79')],_0xf307('0x84'),_0x2a43b8['customerAvatar']);}}return _0x3ce4f2[_0xf307('0x80')](_0x3f0b96);}})['catch'](handleError(_0x3ce4f2,null));};exports[_0xf307('0x88')]=function(_0x12a22d,_0x2e4407,_0x6561ee){var _0x57e435=path[_0xf307('0x78')](config['root'],_0xf307('0x89'));var _0x2f6827={'where':{'id':_0x12a22d[_0xf307('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xf307('0x3b')][_0xf307('0x56')](_0x2f6827)[_0xf307('0x1e')](handleEntityNotFound(_0x2e4407,null))[_0xf307('0x1e')](function(_0x54de5e){if(_0x54de5e){if(!_[_0xf307('0x83')](_0x54de5e[_0xf307('0x76')])){if(fs[_0xf307('0x7e')](path['join'](config[_0xf307('0x79')],_0xf307('0x84'),_0x54de5e[_0xf307('0x76')]))){_0x57e435=path['join'](config['root'],'server/files/images/avatars/',_0x54de5e[_0xf307('0x76')]);}}return _0x2e4407['download'](_0x57e435);}})['catch'](handleError(_0x2e4407,null));};exports[_0xf307('0x8a')]=function(_0x57ed2c,_0x42b3b9,_0x534a82){var _0x4892b4=require('user-agent-parser');var _0x7a44ff=new _0x4892b4();var _0x15575c=_0x7a44ff[_0xf307('0x8b')](_0x57ed2c[_0xf307('0x8c')]['user-agent'])['getResult']();var _0x21d4a2={'body':_0x57ed2c[_0xf307('0x60')],'channel':_0xf307('0x8d')};var _0x39366c=[];var _0xec1ac4=[];var _0x49b5d9={};var _0x52e566=![];return db['CmContact'][_0xf307('0x61')]()['then'](function(_0x645fa3){if(!_0x645fa3){throw new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0x90'));}_0x39366c=_[_0xf307('0x91')](_[_0xf307('0x3d')](_0x645fa3),['createdAt','updatedAt']);_0xec1ac4=_[_0xf307('0x91')](_[_0xf307('0x3d')](_0x645fa3),[_0xf307('0x92'),_0xf307('0x93'),_0xf307('0x94'),_0xf307('0x95')]);if(_0x57ed2c['body']['id']){delete _0x57ed2c[_0xf307('0x60')]['id'];}if(_[_0xf307('0x83')](_0x57ed2c[_0xf307('0x60')][_0xf307('0x96')])){throw new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0x97'));}if(_[_0xf307('0x83')](_0x57ed2c[_0xf307('0x60')][_0xf307('0x60')])||_0x57ed2c[_0xf307('0x60')][_0xf307('0x60')]===''){throw new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf307('0x83')](_0x57ed2c[_0xf307('0x60')]['mapKey'])){throw new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0x98')+_0xec1ac4);}if(!_[_0xf307('0x99')](_0xec1ac4,_0x57ed2c['body'][_0xf307('0x9a')])){throw new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0x9b')+_0xec1ac4);}_0x49b5d9[_0x57ed2c[_0xf307('0x60')]['mapKey']]=_0x57ed2c[_0xf307('0x60')][_0xf307('0x96')];})['then'](function(){return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x57ed2c['params']['id']},'include':[{'model':db[_0xf307('0x9c')],'as':'List','include':[{'model':db[_0xf307('0x9d')],'as':_0xf307('0x9e'),'where':_0x49b5d9,'limit':0x1,'order':[[_0xf307('0x93'),_0xf307('0x9f')]]}]},{'model':db[_0xf307('0xa0')],'as':_0xf307('0xa1')}]});})[_0xf307('0x1e')](handleEntityNotFound(_0x42b3b9,null))[_0xf307('0x1e')](function(_0x5c7ba1){if(_0x5c7ba1&&_0x5c7ba1['List']){_0x21d4a2[_0xf307('0xa2')]=_0x5c7ba1;_0x21d4a2[_0xf307('0xa3')]=_0x5c7ba1['Applications'];_0x21d4a2['list']=_0x5c7ba1[_0xf307('0xa4')];_0x21d4a2['applications']=_[_0xf307('0xa5')](_0x21d4a2['applications'],['priority'],['asc']);if(_0x21d4a2['account'][_0xf307('0xa1')]){delete _0x21d4a2[_0xf307('0xa2')][_0xf307('0xa1')];}if(_0x21d4a2['account'][_0xf307('0xa4')]&&_0x21d4a2['account'][_0xf307('0xa4')]['Contacts']['length']){return _0x21d4a2[_0xf307('0xa2')]['List'][_0xf307('0x9e')][0x0];}var _0x1b4ca=_[_0xf307('0x16')](_0x57ed2c['body'],{'firstName':_0x57ed2c['body'][_0xf307('0x96')],'ListId':_0x5c7ba1['ListId']});_0x1b4ca[_0x57ed2c[_0xf307('0x60')][_0xf307('0x9a')]]=_0x57ed2c[_0xf307('0x60')][_0xf307('0x96')];return db[_0xf307('0x9d')]['create'](_0x1b4ca,{'fields':_0x39366c,'raw':!![]});}})[_0xf307('0x1e')](handleEntityNotFound(_0x42b3b9,null))[_0xf307('0x1e')](function(_0x5a3e10){_0x21d4a2[_0xf307('0xa6')]=_0x5a3e10;if(_0x5a3e10){var _0x1164c1={'ContactId':_0x5a3e10['id'],'ChatWebsiteId':_0x57ed2c[_0xf307('0x53')]['id'],'from':(_0x5a3e10[_0xf307('0xa7')]||'')+'\x20'+(_0x5a3e10[_0xf307('0xa8')]||''),'customerIp':_0x57ed2c[_0xf307('0x60')][_0xf307('0xa9')],'referer':_0x57ed2c[_0xf307('0x60')][_0xf307('0xaa')],'browserName':_0x15575c['browser'][_0xf307('0x36')]&&_0x15575c[_0xf307('0xab')][_0xf307('0xac')]?util[_0xf307('0xad')](_0xf307('0xae'),_0x15575c[_0xf307('0xab')]['name'],_0x15575c['browser']['version']):_0xf307('0xaf'),'browserVersion':_0x15575c[_0xf307('0xab')][_0xf307('0xac')]||_0xf307('0xaf'),'osName':util[_0xf307('0xad')]('%s\x20%s',_0x15575c['os'][_0xf307('0x36')],_0x15575c['os'][_0xf307('0xac')]),'osVersion':_0x15575c['os']['version'],'deviceModel':_0x15575c[_0xf307('0xb0')][_0xf307('0x3c')]&&_0x15575c[_0xf307('0xb0')][_0xf307('0xb1')]?util[_0xf307('0xad')]('%s\x20%s\x20%s',_0x15575c[_0xf307('0xb0')][_0xf307('0x3c')],_0x15575c['device'][_0xf307('0xb1')],_0x15575c['device'][_0xf307('0xb2')]):null,'deviceVendor':_0x15575c['device'][_0xf307('0xb1')],'deviceType':_0x15575c[_0xf307('0xb0')][_0xf307('0xb2')],'formData':JSON[_0xf307('0x23')](_0x57ed2c['body'])};var _0x3b8001={'ChatWebsiteId':_0x57ed2c[_0xf307('0x53')]['id'],'closed':![]};if(_0x57ed2c[_0xf307('0x60')][_0xf307('0xb3')]){_0x3b8001[_0xf307('0xb3')]=_0x57ed2c[_0xf307('0x60')][_0xf307('0xb3')];return db[_0xf307('0xb4')]['find']({'where':_0x3b8001})[_0xf307('0x1e')](function(_0x12d43a){if(_0x12d43a){return[_0x12d43a,![]];}_0x1164c1['threadId']=_0x57ed2c['body'][_0xf307('0xb3')];_0x1164c1[_0xf307('0xb5')]=_0x57ed2c[_0xf307('0x60')][_0xf307('0xb5')];return db[_0xf307('0xb4')][_0xf307('0x57')](_0x1164c1)['then'](function(_0xc19dc8){return[_0xc19dc8,!![]];});});}_0x3b8001[_0xf307('0xb6')]=_0x5a3e10['id'];if(_0x57ed2c[_0xf307('0x60')]['interaction']&&_0x57ed2c['body'][_0xf307('0xb7')]['id']){_0x3b8001['id']=_0x57ed2c['body'][_0xf307('0xb7')]['id'];return db[_0xf307('0xb4')][_0xf307('0x56')]({'where':_0x3b8001})[_0xf307('0x1e')](function(_0xa502d1){if(_0xa502d1){return[_0xa502d1,![]];}return db[_0xf307('0xb4')][_0xf307('0x57')](_0x1164c1)[_0xf307('0x1e')](function(_0x2344ff){return[_0x2344ff,!![]];});});}return db[_0xf307('0xb4')]['create'](_0x1164c1)['then'](function(_0x2efcfa){return[_0x2efcfa,!![]];});}})[_0xf307('0xb8')](function(_0x1aa75c,_0x1df9e4){if(_0x1aa75c){_0x52e566=_0x1df9e4;if(!_0x1df9e4){var _0x29943={'from':(_0x21d4a2[_0xf307('0xa6')][_0xf307('0xa7')]||'')+'\x20'+(_0x21d4a2[_0xf307('0xa6')][_0xf307('0xa8')]||'')};if(_0x57ed2c[_0xf307('0x60')][_0xf307('0xb3')]&&_0x57ed2c[_0xf307('0x60')]['messageId']&&_0x57ed2c['body'][_0xf307('0xb3')]!=_0x57ed2c['body']['messageId']){_0x29943[_0xf307('0xb3')]=_0x57ed2c[_0xf307('0x60')][_0xf307('0xb9')];}return _0x1aa75c[_0xf307('0x30')](_0x29943);}else{return _0x1aa75c;}}})[_0xf307('0x1e')](function(_0x424319){_0x21d4a2[_0xf307('0xb7')]=_0x424319[_0xf307('0x32')]({'plain':!![]});_0x21d4a2['interaction']['created']=_0x52e566;if(_0x21d4a2[_0xf307('0xb7')][_0xf307('0xba')]){if(_0x21d4a2[_0xf307('0xa2')][_0xf307('0xbb')]){_0x21d4a2['applications']['push']({'id':0x0,'priority':_0x21d4a2[_0xf307('0xa3')][_0xf307('0x42')]+0x1,'app':_0xf307('0xbc'),'appdata':_0xf307('0xbd'),'interval':_0xf307('0xbe')});}}return db['ChatMessage'][_0xf307('0x57')]({'body':_0x57ed2c[_0xf307('0x60')]['body'],'ChatWebsiteId':_0x57ed2c[_0xf307('0x53')]['id'],'ChatInteractionId':_0x424319['id'],'direction':'in','ContactId':_0x21d4a2['contact']['id'],'AttachmentId':_0x57ed2c[_0xf307('0x60')][_0xf307('0xbf')]});})[_0xf307('0x1e')](function(_0xcb0dc4){_0x21d4a2[_0xf307('0x24')]=_0xcb0dc4;if(_0x21d4a2[_0xf307('0xb7')]['UserId']){return db[_0xf307('0xc0')]['find']({'attributes':['id',_0xf307('0x36')],'where':{'id':_0x21d4a2[_0xf307('0xb7')][_0xf307('0xc1')]}})['then'](function(_0x4f1d6b){if(_0x4f1d6b){_0x21d4a2[_0xf307('0xa3')][_0xf307('0xc2')]({'id':0x0,'priority':0x0,'app':_0xf307('0xc3'),'appdata':_0x4f1d6b[_0xf307('0x36')]+','+(_0x21d4a2[_0xf307('0xa2')]['waitForTheAssignedAgent']||0xa),'interval':_0xf307('0xbe')});_0x21d4a2['forcedOwnership']=!![];}return respondWithRpcPromise(_0xf307('0xc4'),_0xf307('0xc5'),_0x21d4a2);});}return respondWithRpcPromise(_0xf307('0xc4'),'startRouting',_0x21d4a2);})[_0xf307('0x1e')](function(_0x205c48){respondWithRpcPromise(_0xf307('0xc6'),_0xf307('0xc6'),{'event':_0xf307('0x8a'),'message':_0x205c48},client9002);return _0x205c48;})[_0xf307('0x1e')](respondWithResult(_0x42b3b9,null))['catch'](handleError(_0x42b3b9,null));};exports[_0xf307('0xc7')]=function(_0x4bd015,_0x5d757f,_0x40fd68){var _0x19ed1d,_0x3f3a39,_0x4828e8;var _0x195eea=[];var _0x46b5d1=[];var _0x2e8277={};return db[_0xf307('0x9d')][_0xf307('0x61')]()[_0xf307('0x1e')](function(_0x26f8ed){if(!_0x26f8ed){throw new db['Sequelize'][(_0xf307('0x8f'))]('no\x20available\x20attributes');}_0x46b5d1=_[_0xf307('0x91')](_[_0xf307('0x3d')](_0x26f8ed),[_0xf307('0x92'),'updatedAt']);_0x195eea=_[_0xf307('0x91')](_['keys'](_0x26f8ed),['createdAt','updatedAt','CompanyId',_0xf307('0x95')]);if(_0x4bd015[_0xf307('0x60')]['id']){delete _0x4bd015['body']['id'];}if(_['isNil'](_0x4bd015[_0xf307('0x60')][_0xf307('0x96')])){throw _0x5d757f['status'](0x1f4)['send'](new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0x97')));}if(_[_0xf307('0x83')](_0x4bd015['body'][_0xf307('0x60')])||_0x4bd015[_0xf307('0x60')][_0xf307('0x60')]===''){throw _0x5d757f[_0xf307('0x28')](0x1f4)[_0xf307('0x37')](new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x4bd015[_0xf307('0x60')][_0xf307('0xc8')])){throw _0x5d757f[_0xf307('0x28')](0x1f4)[_0xf307('0x37')](new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0xc9')+_0x195eea));}if(!_[_0xf307('0x99')](_0x195eea,_0x4bd015['body'][_0xf307('0xc8')])){throw _0x5d757f[_0xf307('0x28')](0x1f4)[_0xf307('0x37')](new db[(_0xf307('0x8e'))][(_0xf307('0x8f'))](_0xf307('0xca')+_0x195eea));}_0x2e8277[_0x4bd015['body'][_0xf307('0xc8')]]=_0x4bd015[_0xf307('0x60')]['from'];})[_0xf307('0x1e')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4bd015[_0xf307('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0xf307('0x1e')](handleEntityNotFound(_0x5d757f,null))['then'](function(_0x46d3a9){if(_0x46d3a9&&_0x46d3a9[_0xf307('0xa4')]){_0x3f3a39=_0x46d3a9;var _0xbe4532=_['defaults'](_0x4bd015['body'],{'firstName':_0x4bd015['body'][_0xf307('0x96')],'phone':_0x4bd015['body']['from'],'ListId':_0x46d3a9[_0xf307('0x95')]});_0xbe4532[_0x4bd015['body'][_0xf307('0xc8')]]=_0x4bd015['body']['from'];return db[_0xf307('0x9d')]['findOrCreate']({'where':_0x2e8277,'defaults':_0xbe4532});}})['spread'](function(_0x370e80){if(_0x370e80){_0x4828e8=_0x370e80;var _0x3a6dfd=fs[_0xf307('0xcb')](path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0xcc')),'utf8');var _0x419dcd=ejs['render'](_0x3a6dfd,{'body':_[_0xf307('0xcd')](_0x4bd015[_0xf307('0x60')][_0xf307('0x60')]),'bodyTitle':_0x3f3a39[_0xf307('0xce')]});return db[_0xf307('0xcf')]['create']({'body':_0x419dcd,'ContactId':_0x370e80['id'],'ChatWebsiteId':_0x3f3a39['id']});}})[_0xf307('0x1e')](function(_0x48bca6){if(_0x48bca6){_0x19ed1d=_0x48bca6;return db[_0xf307('0xd0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf307('0xd1')],'as':_0xf307('0xd2'),'raw':!![]}]});}})[_0xf307('0x1e')](function(_0xc5e916){if(_0xc5e916&&_0xc5e916[_0xf307('0xd2')]&&_0x3f3a39[_0xf307('0xd3')]){var _0x568438={'tls':{'rejectUnauthorized':![]}};if(_0xc5e916[_0xf307('0xd2')][_0xf307('0xd4')]){_0x568438[_0xf307('0xd4')]=_0xc5e916[_0xf307('0xd2')][_0xf307('0xd4')];}else{_0x568438[_0xf307('0xd5')]=_0xc5e916[_0xf307('0xd2')][_0xf307('0xd5')];_0x568438[_0xf307('0xd6')]=_0xc5e916[_0xf307('0xd2')][_0xf307('0xd6')];_0x568438[_0xf307('0xd7')]=_0xc5e916[_0xf307('0xd2')][_0xf307('0xd7')];}if(_0xc5e916[_0xf307('0xd2')]['authentication']){_0x568438[_0xf307('0xd8')]={'user':_0xc5e916[_0xf307('0xd2')][_0xf307('0x5a')],'pass':_0xc5e916[_0xf307('0xd2')][_0xf307('0xd9')]};}return respondWithRpcPromise(_0xf307('0xda'),_0xf307('0xdb'),{'account':_0x568438,'message':{'from':util[_0xf307('0xad')]('\x22%s\x22\x20<%s>',_0xc5e916['name'],_0xc5e916[_0xf307('0xdc')]||_0xc5e916['Smtp'][_0xf307('0x5a')]),'to':_0x3f3a39[_0xf307('0xd3')],'subject':_0x3f3a39[_0xf307('0xdd')],'text':_0x19ed1d['body']}},client9003)[_0xf307('0x1e')](function(){return _0x19ed1d;})[_0xf307('0x27')](function(_0x1cc2b1){console['error'](_0x1cc2b1);});}})['then'](function(){if(_0x19ed1d){return _0x19ed1d;}})[_0xf307('0x1e')](respondWithResult(_0x5d757f,null))[_0xf307('0x27')](handleError(_0x5d757f,null));};exports[_0xf307('0xde')]=function(_0x51e78c,_0x2e3e1a,_0x111b24){return db['ChatInteraction']['find']({'where':{'id':_0x51e78c[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x2e3e1a,null))[_0xf307('0x1e')](function(_0x205201){if(_0x205201){return _0x205201[_0xf307('0xde')](_0x51e78c[_0xf307('0x60')][_0xf307('0x6b')],_[_0xf307('0xdf')](_0x51e78c[_0xf307('0x60')],[_0xf307('0x6b'),'id'])||{});}})[_0xf307('0x1e')](respondWithResult(_0x2e3e1a,null))[_0xf307('0x27')](handleError(_0x2e3e1a,null));};exports[_0xf307('0xe0')]=function(_0x8c2aa2,_0x309308,_0x50f1ce){var _0x44eaed={'raw':![],'where':{}};var _0x5df325={};var _0x294cf2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf307('0x66')]({'where':{'id':_0x8c2aa2[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x309308,null))[_0xf307('0x1e')](function(_0x46c4d4){if(_0x46c4d4){_0x5df325[_0xf307('0x3c')]=_[_0xf307('0x3d')](db['ChatInteraction'][_0xf307('0x54')]);_0x5df325[_0xf307('0x3e')]=_[_0xf307('0x3d')](_0x8c2aa2['query']);_0x5df325['filters']=_[_0xf307('0x3f')](_0x5df325[_0xf307('0x3c')],_0x5df325[_0xf307('0x3e')]);_0x44eaed[_0xf307('0x41')]=_[_0xf307('0x3f')](_0x5df325[_0xf307('0x3c')],qs[_0xf307('0x40')](_0x8c2aa2[_0xf307('0x3e')][_0xf307('0x40')]));_0x44eaed[_0xf307('0x41')]=_0x44eaed[_0xf307('0x41')][_0xf307('0x42')]?_0x44eaed[_0xf307('0x41')]:_0x5df325['model'];if(!_0x8c2aa2[_0xf307('0x3e')]['hasOwnProperty'](_0xf307('0x67'))){_0x44eaed[_0xf307('0x44')]=qs[_0xf307('0x44')](_0x8c2aa2[_0xf307('0x3e')]['limit']);_0x44eaed[_0xf307('0x2a')]=qs[_0xf307('0x2a')](_0x8c2aa2['query'][_0xf307('0x2a')]);}_0x44eaed[_0xf307('0x6e')]=qs['sort'](_0x8c2aa2['query'][_0xf307('0x45')]);_0x44eaed[_0xf307('0x46')]=qs[_0xf307('0x47')](_['pick'](_0x8c2aa2[_0xf307('0x3e')],_0x5df325['filters']));_0x44eaed[_0xf307('0x46')]['ChatWebsiteId']=_0x46c4d4['id'];if(_0x8c2aa2[_0xf307('0x3e')]['filter']){_0x44eaed[_0xf307('0x46')]=_[_0xf307('0x48')](_0x44eaed[_0xf307('0x46')],{'$or':_[_0xf307('0x69')](_0x44eaed[_0xf307('0x41')],function(_0x20c6b4){var _0x5ba53f={};_0x5ba53f[_0x20c6b4]={'$like':'%'+_0x8c2aa2[_0xf307('0x3e')][_0xf307('0x4c')]+'%'};return _0x5ba53f;})});}_0x44eaed=_[_0xf307('0x48')]({},_0x44eaed,_0x8c2aa2[_0xf307('0x4d')]);return db['ChatInteraction'][_0xf307('0x4e')]({'where':_0x44eaed[_0xf307('0x46')]})['then'](function(_0x327772){_0x294cf2[_0xf307('0x4e')]=_0x327772;if(_0x8c2aa2[_0xf307('0x3e')]['includeAll']){_0x44eaed[_0xf307('0x4f')]=[{'model':db[_0xf307('0x9d')],'as':_0xf307('0xe1'),'required':![]},{'model':db[_0xf307('0xc0')],'as':_0xf307('0xe2'),'attributes':[_0xf307('0x36'),'fullname','internal'],'required':![]},{'model':db[_0xf307('0xe3')],'as':'Tags','attributes':['id','name','color'],'where':_0x8c2aa2[_0xf307('0x3e')][_0xf307('0xe4')]?{'id':_0x8c2aa2[_0xf307('0x3e')]['tag']}:undefined,'required':_0x8c2aa2[_0xf307('0x3e')][_0xf307('0xe4')]?!![]:![]}];}return db[_0xf307('0xb4')][_0xf307('0x50')](_0x44eaed);})[_0xf307('0x1e')](function(_0xe31c94){_0x294cf2[_0xf307('0x51')]=_0xe31c94;return _0x294cf2;});}})[_0xf307('0x1e')](respondWithFilteredResult(_0x309308,_0x44eaed))[_0xf307('0x27')](handleError(_0x309308,null));};function iftimePromise(_0x3728ee,_0x4cca2a){return respondWithRpcPromise(_0xf307('0xe5'),_0xf307('0xe6'),{'command':_0x4cca2a['timezone']?util['format'](_0xf307('0xe7'),_0x3728ee[_0xf307('0xe8')],_0x4cca2a[_0xf307('0xe9')]):util[_0xf307('0xad')](_0xf307('0xea'),_0x3728ee[_0xf307('0xe8')])},client9002)[_0xf307('0x1e')](function(_0xdcadd1){var _0x28dadc=_0xdcadd1&&_0xdcadd1[_0xf307('0xeb')]('true')>=0x0?!![]:![];logger[_0xf307('0x1f')](_0xf307('0xec'),_0x4cca2a['id'],_0x3728ee['id'],_0x3728ee[_0xf307('0xe8')],_0x28dadc?_0xf307('0xed'):_0xf307('0xee'),_0x4cca2a[_0xf307('0xe9')]?_0x4cca2a[_0xf307('0xe9')]:_0xf307('0xef'));return _0x28dadc;})['catch'](function(_0x1cd217){logger[_0xf307('0x25')](_0xf307('0xec'),_0x4cca2a['id'],_0x3728ee['id'],_0x3728ee[_0xf307('0xe8')],util[_0xf307('0xf0')](_0x1cd217,{'showHidden':![],'depth':null}),_0x4cca2a['timezone']?_0x4cca2a[_0xf307('0xe9')]:_0xf307('0xef'));return![];});}exports[_0xf307('0xe6')]=function(_0x5b5349,_0x29ceef,_0xf2297){var _0x503529=0x0;var _0x35fd63=0x0;var _0x5e5372=![];var _0x19a5b9;var _0x44e9cd;return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x5b5349[_0xf307('0x53')]['id']},'include':[{'model':db[_0xf307('0xf1')],'as':_0xf307('0xf1'),'include':[{'model':db[_0xf307('0xf1')],'as':'Intervals','attributes':['id',_0xf307('0xe8')],'raw':!![]}]}]})[_0xf307('0x1e')](handleEntityNotFound(_0x29ceef,null))[_0xf307('0x1e')](function(_0x41da10){if(_0x41da10){_0x19a5b9=_0x41da10;return _0x41da10[_0xf307('0xf2')]({'raw':!![]});}})[_0xf307('0x1e')](function(_0x2af5ea){if(_0x19a5b9){if(_0x2af5ea){_0x44e9cd=_0x2af5ea;}}return require(_0xf307('0x7b'))[_0xf307('0x7c')]();})[_0xf307('0x1e')](function(_0x3a561f){if(_0x3a561f){_0x35fd63=_0x3a561f[_0xf307('0xf3')];_0x5e5372=_0x3a561f[_0xf307('0x7d')];}})[_0xf307('0x1e')](function(){return db[_0xf307('0xb4')][_0xf307('0x4e')]({'where':{'closed':![]}});})[_0xf307('0x1e')](function(_0x5adef5){_0x503529=_0x5adef5;if(_0x35fd63&&_0x5adef5>_0x35fd63){return db[_0xf307('0xf4')]['findOne']({'where':{'id':0x1}})[_0xf307('0x1e')](function(_0x5a2e87){if(_0x5a2e87){_0x5a2e87['increment'](_0xf307('0xf5'));}});}})[_0xf307('0x1e')](function(){if(_0x19a5b9[_0xf307('0xf1')]&&_0x19a5b9[_0xf307('0xf1')][_0xf307('0xf6')]){var _0x28f5ab=[];for(var _0x168382=0x0;_0x168382<_0x19a5b9[_0xf307('0xf1')][_0xf307('0xf6')]['length'];_0x168382++){var _0x10a90c=_0x19a5b9[_0xf307('0xf1')][_0xf307('0xf6')][_0x168382][_0xf307('0x32')]({'plain':!![]});_0x28f5ab['push'](iftimePromise(_0x10a90c,_0x19a5b9));}return BPromise['all'](_0x28f5ab)[_0xf307('0x1e')](function(_0x4e1c59){return _[_0xf307('0xf7')](_0x4e1c59);});}else{return!![];}})['then'](function(_0x5e8c50){var _0x1b3440=fs[_0xf307('0xcb')](path[_0xf307('0x78')](config[_0xf307('0x79')],_0xf307('0xf8')),_0xf307('0xf9'));var _0xeef74d={'remote':_0x19a5b9['remote'],'query':querystring[_0xf307('0x23')](_[_0xf307('0x48')](_0x19a5b9[_0xf307('0x32')]({'plain':!![]}),{'customerIp':_0x5b5349[_0xf307('0x8c')][_0xf307('0xfa')]||_0x5b5349[_0xf307('0x8c')]['x-real-ip']||_0x5b5349[_0xf307('0xfb')][_0xf307('0xfc')]||_0x5b5349['ip'],'referer':_0x5b5349[_0xf307('0x8c')][_0xf307('0xaa')],'openedInteractions':_0x503529,'maxInteractions':_0x35fd63,'virtual':_0x5e5372[_0xf307('0xf3')],'online':_0x5e8c50,'custom':_0x5e5372}))[_0xf307('0xfd')](/'/g,'\x5c\x27')};_0x29ceef[_0xf307('0x37')](ejs[_0xf307('0xfe')](Mustache[_0xf307('0xfe')](_0x1b3440,_0xeef74d),{'proactiveActions':_0x44e9cd,'alignment':_0x19a5b9[_0xf307('0xff')],'verticalAlignment':_0x19a5b9[_0xf307('0x100')]}));})[_0xf307('0x27')](handleError(_0x29ceef,null));};exports[_0xf307('0x101')]=function(_0x400c45,_0x5f43bc,_0x7d358f){return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0x400c45['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x5f43bc,null))[_0xf307('0x1e')](function(_0x13df91){if(_0x13df91){return db['sequelize']['transaction'](function(_0x1aa7e4){return db[_0xf307('0xa0')]['destroy']({'where':{'ChatWebsiteId':_0x400c45['params']['id']},'transaction':_0x1aa7e4})['then'](function(_0x430589){var _0x72ded=_[_0xf307('0x69')](_0x400c45[_0xf307('0x60')],function(_0x2e8f41){_0x2e8f41[_0xf307('0x63')]=_0x400c45[_0xf307('0x53')]['id'];return _0x2e8f41;});return db['ChatApplication']['bulkCreate'](_0x72ded,{'transaction':_0x1aa7e4});});})[_0xf307('0x1e')](function(){return db[_0xf307('0xa0')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x400c45['params']['id']},'order':_0xf307('0x102')});});}})['then'](respondWithResult(_0x5f43bc,null))['catch'](handleError(_0x5f43bc,null));};exports[_0xf307('0x103')]=function(_0xa10dfb,_0x4958b8,_0x93a5d4){var _0x2e2d68={};var _0x4c5389={};var _0x212dd1;var _0x49fd2f;return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0xa10dfb[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x4958b8,null))[_0xf307('0x1e')](function(_0xf5c069){if(_0xf5c069){_0x212dd1=_0xf5c069;_0x4c5389[_0xf307('0x3c')]=_['keys'](db['ChatApplication'][_0xf307('0x54')]);_0x4c5389['query']=_[_0xf307('0x3d')](_0xa10dfb[_0xf307('0x3e')]);_0x4c5389[_0xf307('0x47')]=_['intersection'](_0x4c5389['model'],_0x4c5389[_0xf307('0x3e')]);_0x2e2d68[_0xf307('0x41')]=_['intersection'](_0x4c5389[_0xf307('0x3c')],qs[_0xf307('0x40')](_0xa10dfb[_0xf307('0x3e')][_0xf307('0x40')]));_0x2e2d68[_0xf307('0x41')]=_0x2e2d68[_0xf307('0x41')][_0xf307('0x42')]?_0x2e2d68[_0xf307('0x41')]:_0x4c5389[_0xf307('0x3c')];_0x2e2d68['order']=qs['sort'](_0xa10dfb[_0xf307('0x3e')][_0xf307('0x45')]);_0x2e2d68[_0xf307('0x46')]=qs['filters'](_[_0xf307('0x68')](_0xa10dfb['query'],_0x4c5389[_0xf307('0x47')]));if(_0xa10dfb[_0xf307('0x3e')][_0xf307('0x4c')]){_0x2e2d68[_0xf307('0x46')]=_[_0xf307('0x48')](_0x2e2d68[_0xf307('0x46')],{'$or':_['map'](_0x2e2d68['attributes'],function(_0x37b706){var _0x1500f6={};_0x1500f6[_0x37b706]={'$like':'%'+_0xa10dfb['query']['filter']+'%'};return _0x1500f6;})});}_0x2e2d68=_[_0xf307('0x48')]({},_0x2e2d68,_0xa10dfb[_0xf307('0x4d')]);return _0x212dd1[_0xf307('0x103')](_0x2e2d68);}})[_0xf307('0x1e')](function(_0x5912f7){if(_0x5912f7){_0x49fd2f=_0x5912f7['length'];if(!_0xa10dfb[_0xf307('0x3e')][_0xf307('0x43')]('nolimit')){_0x2e2d68[_0xf307('0x44')]=qs[_0xf307('0x44')](_0xa10dfb[_0xf307('0x3e')]['limit']);_0x2e2d68[_0xf307('0x2a')]=qs['offset'](_0xa10dfb[_0xf307('0x3e')][_0xf307('0x2a')]);}return _0x212dd1['getApplications'](_0x2e2d68);}})[_0xf307('0x1e')](function(_0x59526d){if(_0x59526d){return _0x59526d?{'count':_0x49fd2f,'rows':_0x59526d}:null;}})[_0xf307('0x1e')](respondWithResult(_0x4958b8,null))[_0xf307('0x27')](handleError(_0x4958b8,null));};exports[_0xf307('0x104')]=function(_0xb48405,_0x2aedf7,_0x4c5277){return db[_0xf307('0x105')][_0xf307('0x56')]({'where':{'id':_0xb48405[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x2aedf7,null))[_0xf307('0x1e')](function(_0x2b7ad2){if(_0x2b7ad2){return _0x2b7ad2['addProactiveActions'](_0xb48405[_0xf307('0x60')][_0xf307('0x6b')],_[_0xf307('0xdf')](_0xb48405[_0xf307('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x2aedf7,null))[_0xf307('0x27')](handleError(_0x2aedf7,null));};exports['getProactiveActions']=function(_0x297de2,_0xc834bc,_0xd480f3){var _0x17e848={};var _0x4a665f={};var _0x5d8f4f;var _0x296d1a;return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0x297de2['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0xc834bc,null))[_0xf307('0x1e')](function(_0xa297cf){if(_0xa297cf){_0x5d8f4f=_0xa297cf;_0x4a665f['model']=_[_0xf307('0x3d')](db[_0xf307('0x106')]['rawAttributes']);_0x4a665f[_0xf307('0x3e')]=_['keys'](_0x297de2['query']);_0x4a665f['filters']=_[_0xf307('0x3f')](_0x4a665f['model'],_0x4a665f[_0xf307('0x3e')]);_0x17e848[_0xf307('0x41')]=_[_0xf307('0x3f')](_0x4a665f['model'],qs[_0xf307('0x40')](_0x297de2[_0xf307('0x3e')]['fields']));_0x17e848[_0xf307('0x41')]=_0x17e848['attributes']['length']?_0x17e848[_0xf307('0x41')]:_0x4a665f[_0xf307('0x3c')];_0x17e848[_0xf307('0x6e')]=qs[_0xf307('0x45')](_0x297de2[_0xf307('0x3e')]['sort']);_0x17e848['where']=qs['filters'](_[_0xf307('0x68')](_0x297de2[_0xf307('0x3e')],_0x4a665f['filters']));if(_0x297de2[_0xf307('0x3e')][_0xf307('0x4c')]){_0x17e848[_0xf307('0x46')]=_[_0xf307('0x48')](_0x17e848[_0xf307('0x46')],{'$or':_['map'](_0x17e848[_0xf307('0x41')],function(_0x2f015){var _0x3b3dc3={};_0x3b3dc3[_0x2f015]={'$like':'%'+_0x297de2[_0xf307('0x3e')][_0xf307('0x4c')]+'%'};return _0x3b3dc3;})});}_0x17e848=_['merge']({},_0x17e848,_0x297de2[_0xf307('0x4d')]);return _0x5d8f4f[_0xf307('0xf2')](_0x17e848);}})[_0xf307('0x1e')](function(_0x182bec){if(_0x182bec){_0x296d1a=_0x182bec[_0xf307('0x42')];if(!_0x297de2[_0xf307('0x3e')]['hasOwnProperty']('nolimit')){_0x17e848[_0xf307('0x44')]=qs['limit'](_0x297de2[_0xf307('0x3e')][_0xf307('0x44')]);_0x17e848['offset']=qs[_0xf307('0x2a')](_0x297de2[_0xf307('0x3e')][_0xf307('0x2a')]);}return _0x5d8f4f[_0xf307('0xf2')](_0x17e848);}})[_0xf307('0x1e')](function(_0x21e290){if(_0x21e290){return _0x21e290?{'count':_0x296d1a,'rows':_0x21e290}:null;}})['then'](respondWithResult(_0xc834bc,null))[_0xf307('0x27')](handleError(_0xc834bc,null));};exports[_0xf307('0x107')]=function(_0x257364,_0x29d87b,_0x5dc319){var _0x58d6ad=_0x257364[_0xf307('0x3e')][_0xf307('0x108')]===_0xf307('0x109')?_0xf307('0x10a'):'onlineForm';return db[_0xf307('0x3b')][_0xf307('0x56')]({'attributes':['id',_0x58d6ad],'where':{'id':_0x257364[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x29d87b,null))[_0xf307('0x1e')](function(_0x231417){if(_0x231417){var _0x2ec21d=_0x231417[_0x58d6ad];var _0x183dfd=_0x2ec21d&&_0x2ec21d[_0xf307('0x10b')]?_0x2ec21d[_0xf307('0x10b')]:[];_0x29d87b[_0xf307('0x37')]({'fromKey':_['isNil'](_0x2ec21d[_0xf307('0x10c')])?undefined:_0x2ec21d[_0xf307('0x10c')],'count':_0x183dfd['length'],'rows':_0x183dfd});}})[_0xf307('0x27')](handleError(_0x29d87b,null));};exports[_0xf307('0x10d')]=function(_0x52e41f,_0x7a62b3,_0x430efc){var _0x5cc010={'raw':!![],'where':{}};var _0x3856e1={};var _0x3f1dc2={'count':0x0,'rows':[]};return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0x52e41f['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x7a62b3,null))[_0xf307('0x1e')](function(_0x58b19f){if(_0x58b19f){_0x3856e1[_0xf307('0x3c')]=_[_0xf307('0x3d')](db[_0xf307('0xcf')][_0xf307('0x54')]);_0x3856e1[_0xf307('0x3e')]=_[_0xf307('0x3d')](_0x52e41f['query']);_0x3856e1['filters']=_[_0xf307('0x3f')](_0x3856e1[_0xf307('0x3c')],_0x3856e1['query']);_0x5cc010['attributes']=_[_0xf307('0x3f')](_0x3856e1[_0xf307('0x3c')],qs[_0xf307('0x40')](_0x52e41f[_0xf307('0x3e')]['fields']));_0x5cc010[_0xf307('0x41')]=_0x5cc010[_0xf307('0x41')][_0xf307('0x42')]?_0x5cc010['attributes']:_0x3856e1[_0xf307('0x3c')];if(!_0x52e41f[_0xf307('0x3e')][_0xf307('0x43')](_0xf307('0x67'))){_0x5cc010[_0xf307('0x44')]=qs['limit'](_0x52e41f[_0xf307('0x3e')]['limit']);_0x5cc010[_0xf307('0x2a')]=qs['offset'](_0x52e41f[_0xf307('0x3e')]['offset']);}_0x5cc010[_0xf307('0x6e')]=qs[_0xf307('0x45')](_0x52e41f[_0xf307('0x3e')][_0xf307('0x45')]);_0x5cc010[_0xf307('0x46')]=qs['filters'](_[_0xf307('0x68')](_0x52e41f[_0xf307('0x3e')],_0x3856e1[_0xf307('0x47')]));_0x5cc010[_0xf307('0x46')]['ChatWebsiteId']=_0x58b19f['id'];if(_0x52e41f[_0xf307('0x3e')]['filter']){_0x5cc010[_0xf307('0x46')]=_['merge'](_0x5cc010[_0xf307('0x46')],{'$or':_[_0xf307('0x69')](_0x5cc010[_0xf307('0x41')],function(_0x4b7307){var _0x51126e={};_0x51126e[_0x4b7307]={'$like':'%'+_0x52e41f[_0xf307('0x3e')]['filter']+'%'};return _0x51126e;})});}_0x5cc010=_[_0xf307('0x48')]({},_0x5cc010,_0x52e41f[_0xf307('0x4d')]);return db['ChatOfflineMessage'][_0xf307('0x4e')]({'where':_0x5cc010[_0xf307('0x46')]})[_0xf307('0x1e')](function(_0x3bd65c){_0x3f1dc2[_0xf307('0x4e')]=_0x3bd65c;if(_0x52e41f[_0xf307('0x3e')][_0xf307('0x55')]){_0x5cc010[_0xf307('0x4f')]=[{'all':!![]}];}return db[_0xf307('0xcf')]['findAll'](_0x5cc010);})[_0xf307('0x1e')](function(_0x3e9765){_0x3f1dc2[_0xf307('0x51')]=_0x3e9765;return _0x3f1dc2;});}})[_0xf307('0x1e')](respondWithFilteredResult(_0x7a62b3,_0x5cc010))[_0xf307('0x27')](handleError(_0x7a62b3,null));};exports[_0xf307('0x10e')]=function(_0x28fe11,_0x3680f9,_0x4f41f0){return db['ChatWebsite'][_0xf307('0x56')]({'where':{'id':_0x28fe11['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x3680f9,null))[_0xf307('0x1e')](function(_0x2f6e18){if(_0x2f6e18){return _0x2f6e18[_0xf307('0x10e')](_0x28fe11[_0xf307('0x60')][_0xf307('0x6b')],_[_0xf307('0xdf')](_0x28fe11[_0xf307('0x60')],[_0xf307('0x6b'),'id'])||{})[_0xf307('0xb8')](function(_0x5d3609){for(var _0x2bb7a7=0x0;_0x2bb7a7<_0x28fe11[_0xf307('0x60')]['ids'][_0xf307('0x42')];_0x2bb7a7+=0x1){socket[_0xf307('0x10f')](_0xf307('0x110'),{'UserId':_0x28fe11[_0xf307('0x60')][_0xf307('0x6b')][_0x2bb7a7],'ChatWebsiteId':_0x28fe11['params']['id']});}return _0x5d3609;});}})[_0xf307('0x1e')](respondWithResult(_0x3680f9,null))['catch'](handleError(_0x3680f9,null));};exports[_0xf307('0x111')]=function(_0x5c1280,_0x4160f2,_0x5dcb08){return db[_0xf307('0x3b')][_0xf307('0x56')]({'where':{'id':_0x5c1280[_0xf307('0x53')]['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x4160f2,null))[_0xf307('0x1e')](function(_0x21cab3){if(_0x21cab3){return _0x21cab3[_0xf307('0x111')](_0x5c1280[_0xf307('0x3e')][_0xf307('0x6b')])[_0xf307('0x1e')](function(){if(_[_0xf307('0x112')](_0x5c1280[_0xf307('0x3e')][_0xf307('0x6b')])){for(var _0x39fe1f=0x0;_0x39fe1f<_0x5c1280['query'][_0xf307('0x6b')][_0xf307('0x42')];_0x39fe1f+=0x1){socket[_0xf307('0x10f')](_0xf307('0x113'),{'UserId':Number(_0x5c1280['query']['ids'][_0x39fe1f]),'ChatWebsiteId':Number(_0x5c1280[_0xf307('0x53')]['id'])});}}else{socket[_0xf307('0x10f')](_0xf307('0x113'),{'UserId':Number(_0x5c1280['query'][_0xf307('0x6b')]),'ChatWebsiteId':Number(_0x5c1280['params']['id'])});}});}})[_0xf307('0x1e')](respondWithStatusCode(_0x4160f2,null))[_0xf307('0x27')](handleError(_0x4160f2,null));};exports[_0xf307('0x114')]=function(_0x3d2ef2,_0x51ae50,_0x4fd5fd){var _0x59f23c={};var _0x19db31={};var _0x4efea8;var _0x5df939;return db[_0xf307('0x3b')][_0xf307('0x66')]({'where':{'id':_0x3d2ef2['params']['id']}})[_0xf307('0x1e')](handleEntityNotFound(_0x51ae50,null))['then'](function(_0x59502a){if(_0x59502a){_0x4efea8=_0x59502a;_0x19db31[_0xf307('0x3c')]=_[_0xf307('0x3d')](db[_0xf307('0xc0')][_0xf307('0x54')]);_0x19db31[_0xf307('0x3e')]=_[_0xf307('0x3d')](_0x3d2ef2[_0xf307('0x3e')]);_0x19db31['filters']=_[_0xf307('0x3f')](_0x19db31['model'],_0x19db31[_0xf307('0x3e')]);_0x59f23c[_0xf307('0x41')]=_['intersection'](_0x19db31[_0xf307('0x3c')],qs[_0xf307('0x40')](_0x3d2ef2[_0xf307('0x3e')][_0xf307('0x40')]));_0x59f23c[_0xf307('0x41')]=_0x59f23c[_0xf307('0x41')]['length']?_0x59f23c[_0xf307('0x41')]:_0x19db31[_0xf307('0x3c')];_0x59f23c[_0xf307('0x6e')]=qs['sort'](_0x3d2ef2[_0xf307('0x3e')]['sort']);_0x59f23c[_0xf307('0x46')]=qs[_0xf307('0x47')](_[_0xf307('0x68')](_0x3d2ef2['query'],_0x19db31[_0xf307('0x47')]));if(_0x3d2ef2[_0xf307('0x3e')]['filter']){_0x59f23c['where']=_[_0xf307('0x48')](_0x59f23c[_0xf307('0x46')],{'$or':_[_0xf307('0x69')](_0x59f23c[_0xf307('0x41')],function(_0x3b0b9b){var _0x4f1b1b={};_0x4f1b1b[_0x3b0b9b]={'$like':'%'+_0x3d2ef2[_0xf307('0x3e')][_0xf307('0x4c')]+'%'};return _0x4f1b1b;})});}_0x59f23c=_[_0xf307('0x48')]({},_0x59f23c,_0x3d2ef2[_0xf307('0x4d')]);return _0x4efea8[_0xf307('0x114')](_0x59f23c);}})[_0xf307('0x1e')](function(_0x4c7e8f){if(_0x4c7e8f){_0x5df939=_0x4c7e8f[_0xf307('0x42')];if(!_0x3d2ef2[_0xf307('0x3e')][_0xf307('0x43')](_0xf307('0x67'))){_0x59f23c[_0xf307('0x44')]=qs[_0xf307('0x44')](_0x3d2ef2[_0xf307('0x3e')][_0xf307('0x44')]);_0x59f23c[_0xf307('0x2a')]=qs[_0xf307('0x2a')](_0x3d2ef2[_0xf307('0x3e')]['offset']);}return _0x4efea8[_0xf307('0x114')](_0x59f23c);}})[_0xf307('0x1e')](function(_0x4706c1){if(_0x4706c1){return _0x4706c1?{'count':_0x5df939,'rows':_0x4706c1}:null;}})[_0xf307('0x1e')](respondWithResult(_0x51ae50,null))[_0xf307('0x27')](handleError(_0x51ae50,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 84c714c..1d3f50f 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 _0x5742=['hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x10649d,_0x1c5738){var _0x78f384=function(_0x145720){while(--_0x145720){_0x10649d['push'](_0x10649d['shift']());}};_0x78f384(++_0x1c5738);}(_0x5742,0x11b));var _0x2574=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x5742[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x2574('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x2574('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2574('0x2')](0x0);var events={'afterCreate':_0x2574('0x3'),'afterUpdate':_0x2574('0x4'),'afterDestroy':_0x2574('0x5')};function emitEvent(_0x453990){return function(_0x23f70e,_0x43cdef,_0x2430f1){ChatWebsiteEvents[_0x2574('0x6')](_0x453990+':'+_0x23f70e['id'],_0x23f70e);ChatWebsiteEvents['emit'](_0x453990,_0x23f70e);_0x2430f1(null);};}for(var e in events){if(events[_0x2574('0x7')](e)){var event=events[e];ChatWebsite[_0x2574('0x8')](e,emitEvent(event));}}module[_0x2574('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xb68b=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x55e644,_0x27eea0){var _0x1be094=function(_0x216cb9){while(--_0x216cb9){_0x55e644['push'](_0x55e644['shift']());}};_0x1be094(++_0x27eea0);}(_0xb68b,0x1e6));var _0xbb68=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xb68b[_0x4ff09b];return _0x3f5c2e;};'use strict';var EventEmitter=require(_0xbb68('0x0'));var ChatWebsite=require(_0xbb68('0x1'))['db'][_0xbb68('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbb68('0x3')](0x0);var events={'afterCreate':_0xbb68('0x4'),'afterUpdate':'update','afterDestroy':_0xbb68('0x5')};function emitEvent(_0x275fe8){return function(_0x511816,_0x4e1ac3,_0xd3240b){ChatWebsiteEvents[_0xbb68('0x6')](_0x275fe8+':'+_0x511816['id'],_0x511816);ChatWebsiteEvents[_0xbb68('0x6')](_0x275fe8,_0x511816);_0xd3240b(null);};}for(var e in events){if(events[_0xbb68('0x7')](e)){var event=events[e];ChatWebsite[_0xbb68('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 15abfb8..67193ae 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 _0x82f9=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d02db,_0x34bc34){var _0x187ad1=function(_0x222a4){while(--_0x222a4){_0x5d02db['push'](_0x5d02db['shift']());}};_0x187ad1(++_0x34bc34);}(_0x82f9,0x7d));var _0x982f=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x82f9[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x982f('0x0'));var util=require(_0x982f('0x1'));var logger=require(_0x982f('0x2'))(_0x982f('0x3'));var moment=require(_0x982f('0x4'));var BPromise=require(_0x982f('0x5'));var rp=require(_0x982f('0x6'));var fs=require('fs');var path=require(_0x982f('0x7'));var rimraf=require(_0x982f('0x8'));var config=require(_0x982f('0x9'));var attributes=require(_0x982f('0xa'));module[_0x982f('0xb')]=function(_0x2181af,_0x4df1a3){return _0x2181af[_0x982f('0xc')](_0x982f('0xd'),attributes,{'tableName':_0x982f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5da9=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x5ca887,_0x1f2f64){var _0x6dff9c=function(_0x408442){while(--_0x408442){_0x5ca887['push'](_0x5ca887['shift']());}};_0x6dff9c(++_0x1f2f64);}(_0x5da9,0x128));var _0x95da=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x5da9[_0x14e27a];return _0x288688;};'use strict';var _=require(_0x95da('0x0'));var util=require(_0x95da('0x1'));var logger=require(_0x95da('0x2'))(_0x95da('0x3'));var moment=require(_0x95da('0x4'));var BPromise=require('bluebird');var rp=require(_0x95da('0x5'));var fs=require('fs');var path=require(_0x95da('0x6'));var rimraf=require(_0x95da('0x7'));var config=require(_0x95da('0x8'));var attributes=require(_0x95da('0x9'));module[_0x95da('0xa')]=function(_0x4c5884,_0x540e3b){return _0x4c5884[_0x95da('0xb')](_0x95da('0xc'),attributes,{'tableName':_0x95da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 708dcea..af2ec1d 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 _0xccac=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0xd6f94,_0x57f718){var _0x1c4901=function(_0x5c498d){while(--_0x5c498d){_0xd6f94['push'](_0xd6f94['shift']());}};_0x1c4901(++_0x57f718);}(_0xccac,0x1cb));var _0xccca=function(_0x251c6a,_0x3062e9){_0x251c6a=_0x251c6a-0x0;var _0x11c1f9=_0xccac[_0x251c6a];return _0x11c1f9;};'use strict';var _=require(_0xccca('0x0'));var util=require(_0xccca('0x1'));var moment=require(_0xccca('0x2'));var BPromise=require(_0xccca('0x3'));var rs=require(_0xccca('0x4'));var fs=require('fs');var Redis=require(_0xccca('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xccca('0x6'))('rpc');var config=require(_0xccca('0x7'));var jayson=require(_0xccca('0x8'));var client=jayson[_0xccca('0x9')][_0xccca('0xa')]({'port':0x232a});config[_0xccca('0xb')]=_['defaults'](config['redis'],{'host':_0xccca('0xc'),'port':0x18eb});var socket=require(_0xccca('0xd'))(new Redis(config[_0xccca('0xb')]));require(_0xccca('0xe'))['register'](socket);function respondWithRpcPromise(_0x5aea5d,_0x566e4b,_0x424234){return new BPromise(function(_0xe0b55c,_0x313665){return client[_0xccca('0xf')](_0x5aea5d,_0x424234)[_0xccca('0x10')](function(_0x223dc0){logger[_0xccca('0x11')](_0xccca('0x12'),_0x566e4b,'request\x20sent');logger[_0xccca('0x13')](_0xccca('0x14'),_0x566e4b,_0xccca('0x15'),JSON['stringify'](_0x223dc0));if(_0x223dc0[_0xccca('0x16')]){if(_0x223dc0[_0xccca('0x16')][_0xccca('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x566e4b,_0x223dc0[_0xccca('0x16')][_0xccca('0x18')]);return _0x313665(_0x223dc0['error'][_0xccca('0x18')]);}logger[_0xccca('0x16')](_0xccca('0x12'),_0x566e4b,_0x223dc0[_0xccca('0x16')][_0xccca('0x18')]);return _0xe0b55c(_0x223dc0[_0xccca('0x16')]['message']);}else{logger[_0xccca('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x566e4b,_0xccca('0x15'));_0xe0b55c(_0x223dc0[_0xccca('0x19')]['message']);}})[_0xccca('0x1a')](function(_0xe55669){logger[_0xccca('0x16')](_0xccca('0x12'),_0x566e4b,_0xe55669);_0x313665(_0xe55669);});});} \ No newline at end of file +var _0x184d=['result','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','register','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message'];(function(_0x103448,_0x227eca){var _0x552f2e=function(_0x461882){while(--_0x461882){_0x103448['push'](_0x103448['shift']());}};_0x552f2e(++_0x227eca);}(_0x184d,0x1d0));var _0xd184=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x184d[_0x580647];return _0x5f0792;};'use strict';var _=require('lodash');var util=require(_0xd184('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd184('0x1'))['db'];var utils=require(_0xd184('0x2'));var logger=require(_0xd184('0x3'))(_0xd184('0x4'));var config=require(_0xd184('0x5'));var jayson=require(_0xd184('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd184('0x7')](config[_0xd184('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd184('0x9'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd184('0xa')](socket);function respondWithRpcPromise(_0x37beec,_0x355935,_0x4eaee2){return new BPromise(function(_0x40933b,_0x2569ac){return client['request'](_0x37beec,_0x4eaee2)[_0xd184('0xb')](function(_0x155bda){logger[_0xd184('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x355935,_0xd184('0xd'));logger['debug'](_0xd184('0xe'),_0x355935,_0xd184('0xd'),JSON[_0xd184('0xf')](_0x155bda));if(_0x155bda[_0xd184('0x10')]){if(_0x155bda[_0xd184('0x10')][_0xd184('0x11')]===0x1f4){logger['error'](_0xd184('0x12'),_0x355935,_0x155bda[_0xd184('0x10')][_0xd184('0x13')]);return _0x2569ac(_0x155bda[_0xd184('0x10')][_0xd184('0x13')]);}logger[_0xd184('0x10')](_0xd184('0x12'),_0x355935,_0x155bda[_0xd184('0x10')][_0xd184('0x13')]);return _0x40933b(_0x155bda[_0xd184('0x10')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x355935,_0xd184('0xd'));_0x40933b(_0x155bda[_0xd184('0x14')][_0xd184('0x13')]);}})[_0xd184('0x15')](function(_0x23d0cf){logger[_0xd184('0x10')](_0xd184('0x12'),_0x355935,_0x23d0cf);_0x2569ac(_0x23d0cf);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8b80570..9aea693 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 _0x7aee=['removeListener','register','length','chatWebsite:','save','remove','update','emit'];(function(_0x2bd8a6,_0x5b9211){var _0x1e037a=function(_0x486e4b){while(--_0x486e4b){_0x2bd8a6['push'](_0x2bd8a6['shift']());}};_0x1e037a(++_0x5b9211);}(_0x7aee,0x9c));var _0xe7ae=function(_0x54bf82,_0x2e146b){_0x54bf82=_0x54bf82-0x0;var _0x2f74ba=_0x7aee[_0x54bf82];return _0x2f74ba;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe7ae('0x0'),_0xe7ae('0x1'),_0xe7ae('0x2')];function createListener(_0x2d1a8b,_0x3fc893){return function(_0x5a6614){_0x3fc893[_0xe7ae('0x3')](_0x2d1a8b,_0x5a6614);};}function removeListener(_0x20438d,_0x546633){return function(){ChatWebsiteEvents[_0xe7ae('0x4')](_0x20438d,_0x546633);};}exports[_0xe7ae('0x5')]=function(_0x5a6fda){for(var _0x26badb=0x0,_0x4f1f15=events[_0xe7ae('0x6')];_0x26badb<_0x4f1f15;_0x26badb++){var _0x33c152=events[_0x26badb];var _0x384cbc=createListener(_0xe7ae('0x7')+_0x33c152,_0x5a6fda);ChatWebsiteEvents['on'](_0x33c152,_0x384cbc);}}; \ No newline at end of file +var _0x5bf1=['register','length','chatWebsite:','./chatWebsite.events','save','remove','removeListener'];(function(_0x2f21b6,_0x55ce33){var _0x5bf0b9=function(_0x598883){while(--_0x598883){_0x2f21b6['push'](_0x2f21b6['shift']());}};_0x5bf0b9(++_0x55ce33);}(_0x5bf1,0x15a));var _0x15bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5bf1[_0x321bb2];return _0x9c12ed;};'use strict';var ChatWebsiteEvents=require(_0x15bf('0x0'));var events=[_0x15bf('0x1'),_0x15bf('0x2'),'update'];function createListener(_0x1b6b24,_0x368115){return function(_0x1f1661){_0x368115['emit'](_0x1b6b24,_0x1f1661);};}function removeListener(_0x5468f9,_0x3a530d){return function(){ChatWebsiteEvents[_0x15bf('0x3')](_0x5468f9,_0x3a530d);};}exports[_0x15bf('0x4')]=function(_0x397792){for(var _0x33c0d8=0x0,_0x47ba68=events[_0x15bf('0x5')];_0x33c0d8<_0x47ba68;_0x33c0d8++){var _0x3a9d9e=events[_0x33c0d8];var _0x34847c=createListener(_0x15bf('0x6')+_0x3a9d9e,_0x397792);ChatWebsiteEvents['on'](_0x3a9d9e,_0x34847c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2e45442..f3f4a8d 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 _0x261b=['diskStorage','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addApplications','addProactiveActions','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','originalname','addAvatar','addCustomerAvatar'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x261b,0x15a));var _0xb261=function(_0x4e6cae,_0x1724b4){_0x4e6cae=_0x4e6cae-0x0;var _0x2b8468=_0x261b[_0x4e6cae];return _0x2b8468;};'use strict';var multer=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xb261('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xb261('0x3'));var controller=require('./chatWebsite.controller');router[_0xb261('0x4')]('/',auth['isAuthenticated'](),controller[_0xb261('0x5')]);router[_0xb261('0x4')](_0xb261('0x6'),auth[_0xb261('0x7')](),controller['describe']);router[_0xb261('0x4')](_0xb261('0x8'),auth[_0xb261('0x7')](),controller[_0xb261('0x9')]);router['get'](_0xb261('0xa'),auth[_0xb261('0x7')](),controller[_0xb261('0xb')]);router[_0xb261('0x4')](_0xb261('0xc'),auth[_0xb261('0x7')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0xb261('0xd')]);router[_0xb261('0x4')](_0xb261('0xe'),controller[_0xb261('0xf')]);router[_0xb261('0x4')](_0xb261('0x10'),controller['getCustomerAvatar']);router['get'](_0xb261('0x11'),controller[_0xb261('0x12')]);router[_0xb261('0x4')](_0xb261('0x13'),auth[_0xb261('0x7')](),controller[_0xb261('0x14')]);router[_0xb261('0x4')](_0xb261('0x15'),controller[_0xb261('0x16')]);router[_0xb261('0x4')](_0xb261('0x17'),auth[_0xb261('0x7')](),controller['getApplications']);router[_0xb261('0x4')](_0xb261('0x18'),auth[_0xb261('0x7')](),controller[_0xb261('0x19')]);router['get'](_0xb261('0x1a'),controller[_0xb261('0x1b')]);router[_0xb261('0x4')](_0xb261('0x1c'),auth[_0xb261('0x7')](),controller[_0xb261('0x1d')]);router[_0xb261('0x4')](_0xb261('0x1e'),auth[_0xb261('0x7')](),controller[_0xb261('0x1f')]);router[_0xb261('0x20')]('/',auth[_0xb261('0x7')](),controller[_0xb261('0x21')]);router[_0xb261('0x20')](_0xb261('0xa'),auth[_0xb261('0x7')](),controller[_0xb261('0x22')]);router['post'](_0xb261('0xc'),auth['isAuthenticated'](),controller[_0xb261('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ddac9,_0x36a504,_0x153176){_0x153176(null,path[_0xb261('0x24')](config[_0xb261('0x25')],_0xb261('0x26')));},'filename':function(_0x1617b4,_0x4e9cbe,_0x677683){_0x677683(null,util[_0xb261('0x27')](_0xb261('0x28'),Date['now'](),_0x4e9cbe['originalname']));}})});router[_0xb261('0x20')](_0xb261('0x29'),upload[_0xb261('0x2a')](_0xb261('0x2b')),controller[_0xb261('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x181ae8,_0x3995e6,_0x5787e3){_0x5787e3(null,path[_0xb261('0x24')](config[_0xb261('0x25')],_0xb261('0x2d')));},'filename':function(_0x4bc2db,_0x1dcfb3,_0x5279de){_0x5279de(null,util[_0xb261('0x27')](_0xb261('0x28'),Date[_0xb261('0x2e')](),_0x1dcfb3[_0xb261('0x2f')]));}})});router[_0xb261('0x20')](_0xb261('0xe'),upload[_0xb261('0x2a')](_0xb261('0x2b')),controller[_0xb261('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33d53c,_0xaab320,_0x1bb1c1){_0x1bb1c1(null,path[_0xb261('0x24')](config['root'],_0xb261('0x2d')));},'filename':function(_0x196435,_0x2f39d4,_0x1b225b){_0x1b225b(null,util['format']('%s-%s',Date[_0xb261('0x2e')](),_0x2f39d4['originalname']));}})});router[_0xb261('0x20')](_0xb261('0x10'),upload[_0xb261('0x2a')](_0xb261('0x2b')),controller[_0xb261('0x31')]);var upload=multer({'storage':multer[_0xb261('0x32')]({'destination':function(_0x266ae4,_0x39dc60,_0x59b68f){_0x59b68f(null,path[_0xb261('0x24')](config[_0xb261('0x25')],'server/files/images/avatars/'));},'filename':function(_0x400a5b,_0x56c50d,_0x336773){_0x336773(null,util[_0xb261('0x27')](_0xb261('0x28'),Date[_0xb261('0x2e')](),_0x56c50d['originalname']));}})});router[_0xb261('0x20')](_0xb261('0x11'),upload[_0xb261('0x2a')](_0xb261('0x2b')),controller[_0xb261('0x33')]);router['post'](_0xb261('0x34'),controller[_0xb261('0x35')]);router[_0xb261('0x20')](_0xb261('0x36'),controller[_0xb261('0x37')]);router[_0xb261('0x20')]('/:id/interactions',auth[_0xb261('0x7')](),controller['addInteraction']);router[_0xb261('0x20')]('/:id/applications',auth[_0xb261('0x7')](),controller[_0xb261('0x38')]);router[_0xb261('0x20')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb261('0x39')]);router['post'](_0xb261('0x1e'),auth[_0xb261('0x7')](),controller['addAgents']);router[_0xb261('0x3a')]('/:id',auth[_0xb261('0x7')](),controller[_0xb261('0x3b')]);router['delete'](_0xb261('0x8'),auth[_0xb261('0x7')](),controller[_0xb261('0x3c')]);router[_0xb261('0x3d')](_0xb261('0xa'),auth[_0xb261('0x7')](),controller[_0xb261('0x3e')]);router['delete'](_0xb261('0xc'),auth['isAuthenticated'](),controller[_0xb261('0x3f')]);router['delete'](_0xb261('0x1e'),auth[_0xb261('0x7')](),controller[_0xb261('0x40')]);module[_0xb261('0x41')]=router; \ No newline at end of file +var _0xe57e=['connect-timeout','express','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','/:id/dispositions','post','addAnswer','join','root','format','now','originalname','/:id/logo','single','diskStorage','server/files/images/avatars/','file','addAvatar','%s-%s','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','delete','destroy','removeDispositions','removeAnswers','exports','multer','path'];(function(_0x56684d,_0x18b188){var _0x364a77=function(_0x2144e6){while(--_0x2144e6){_0x56684d['push'](_0x56684d['shift']());}};_0x364a77(++_0x18b188);}(_0xe57e,0xf2));var _0xee57=function(_0xa5f852,_0x30eaf3){_0xa5f852=_0xa5f852-0x0;var _0x3aa65f=_0xe57e[_0xa5f852];return _0x3aa65f;};'use strict';var multer=require(_0xee57('0x0'));var util=require('util');var path=require(_0xee57('0x1'));var timeout=require(_0xee57('0x2'));var express=require(_0xee57('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xee57('0x4'));var config=require('../../config/environment');var controller=require(_0xee57('0x5'));router[_0xee57('0x6')]('/',auth[_0xee57('0x7')](),controller['index']);router['get'](_0xee57('0x8'),auth[_0xee57('0x7')](),controller[_0xee57('0x9')]);router[_0xee57('0x6')](_0xee57('0xa'),auth[_0xee57('0x7')](),controller[_0xee57('0xb')]);router['get']('/:id/dispositions',auth[_0xee57('0x7')](),controller[_0xee57('0xc')]);router[_0xee57('0x6')](_0xee57('0xd'),auth[_0xee57('0x7')](),controller[_0xee57('0xe')]);router[_0xee57('0x6')]('/:id/logo',controller['getLogo']);router[_0xee57('0x6')](_0xee57('0xf'),controller[_0xee57('0x10')]);router[_0xee57('0x6')](_0xee57('0x11'),controller['getCustomerAvatar']);router[_0xee57('0x6')]('/:id/system_avatar',controller[_0xee57('0x12')]);router['get'](_0xee57('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xee57('0x6')](_0xee57('0x14'),controller[_0xee57('0x15')]);router[_0xee57('0x6')]('/:id/applications',auth[_0xee57('0x7')](),controller[_0xee57('0x16')]);router['get']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xee57('0x17')]);router['get'](_0xee57('0x18'),controller[_0xee57('0x19')]);router[_0xee57('0x6')](_0xee57('0x1a'),auth[_0xee57('0x7')](),controller[_0xee57('0x1b')]);router['get'](_0xee57('0x1c'),auth[_0xee57('0x7')](),controller[_0xee57('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee57('0x1e')]);router['post'](_0xee57('0x1f'),auth[_0xee57('0x7')](),controller['addDisposition']);router[_0xee57('0x20')](_0xee57('0xd'),auth[_0xee57('0x7')](),controller[_0xee57('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b5747,_0xb1fdf2,_0x111b7b){_0x111b7b(null,path[_0xee57('0x22')](config[_0xee57('0x23')],'server/files/images/logos/'));},'filename':function(_0x7d7236,_0x17fd20,_0x4eedc9){_0x4eedc9(null,util[_0xee57('0x24')]('%s-%s',Date[_0xee57('0x25')](),_0x17fd20[_0xee57('0x26')]));}})});router[_0xee57('0x20')](_0xee57('0x27'),upload[_0xee57('0x28')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xee57('0x29')]({'destination':function(_0x55646c,_0x11f6fd,_0x2c4e0f){_0x2c4e0f(null,path[_0xee57('0x22')](config[_0xee57('0x23')],_0xee57('0x2a')));},'filename':function(_0x5466bf,_0xe24fb1,_0x26f1e3){_0x26f1e3(null,util[_0xee57('0x24')]('%s-%s',Date[_0xee57('0x25')](),_0xe24fb1[_0xee57('0x26')]));}})});router['post'](_0xee57('0xf'),upload[_0xee57('0x28')](_0xee57('0x2b')),controller[_0xee57('0x2c')]);var upload=multer({'storage':multer[_0xee57('0x29')]({'destination':function(_0x552cad,_0x2bf801,_0x75e21c){_0x75e21c(null,path['join'](config[_0xee57('0x23')],_0xee57('0x2a')));},'filename':function(_0xf5ea2e,_0x195459,_0x38e4d2){_0x38e4d2(null,util['format'](_0xee57('0x2d'),Date[_0xee57('0x25')](),_0x195459[_0xee57('0x26')]));}})});router[_0xee57('0x20')](_0xee57('0x11'),upload[_0xee57('0x28')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xee57('0x29')]({'destination':function(_0xa1122d,_0x25cec8,_0x5c736a){_0x5c736a(null,path['join'](config[_0xee57('0x23')],_0xee57('0x2a')));},'filename':function(_0x53f137,_0x38001e,_0x44bdc7){_0x44bdc7(null,util['format'](_0xee57('0x2d'),Date[_0xee57('0x25')](),_0x38001e[_0xee57('0x26')]));}})});router[_0xee57('0x20')](_0xee57('0x2e'),upload['single']('file'),controller[_0xee57('0x2f')]);router[_0xee57('0x20')](_0xee57('0x30'),controller[_0xee57('0x31')]);router[_0xee57('0x20')](_0xee57('0x32'),controller[_0xee57('0x33')]);router[_0xee57('0x20')](_0xee57('0x13'),auth[_0xee57('0x7')](),controller[_0xee57('0x34')]);router[_0xee57('0x20')](_0xee57('0x35'),auth['isAuthenticated'](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0xee57('0x7')](),controller[_0xee57('0x36')]);router[_0xee57('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0xee57('0x37')]);router['put'](_0xee57('0xa'),auth[_0xee57('0x7')](),controller['update']);router[_0xee57('0x38')]('/:id',auth['isAuthenticated'](),controller[_0xee57('0x39')]);router[_0xee57('0x38')](_0xee57('0x1f'),auth[_0xee57('0x7')](),controller[_0xee57('0x3a')]);router['delete'](_0xee57('0xd'),auth[_0xee57('0x7')](),controller[_0xee57('0x3b')]);router[_0xee57('0x38')](_0xee57('0x1c'),auth[_0xee57('0x7')](),controller['removeAgents']);module[_0xee57('0x3c')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e3a8687..9c6e9e5 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 _0x91a7=['setDataValue','saFiscalMessage','join','getDataValue','INTEGER','BOOLEAN','exports','STRING','FLOAT'];(function(_0x5125ba,_0x421b1f){var _0x5e9357=function(_0x22e3d5){while(--_0x22e3d5){_0x5125ba['push'](_0x5125ba['shift']());}};_0x5e9357(++_0x421b1f);}(_0x91a7,0xe7));var _0x791a=function(_0x2b157b,_0x539abc){_0x2b157b=_0x2b157b-0x0;var _0x97c977=_0x91a7[_0x2b157b];return _0x97c977;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'companyId':{'type':Sequelize[_0x791a('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x791a('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x791a('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x791a('0x1')]},'country':{'type':Sequelize[_0x791a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x791a('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x791a('0x1')]},'sCity':{'type':Sequelize[_0x791a('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x791a('0x1')]},'flatDiscount':{'type':Sequelize[_0x791a('0x2')]},'saStreet':{'type':Sequelize[_0x791a('0x1')]},'saPostalCode':{'type':Sequelize[_0x791a('0x1')]},'saCity':{'type':Sequelize[_0x791a('0x1')]},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize[_0x791a('0x1')](0x3)},'saFiscalCode':{'type':Sequelize[_0x791a('0x1')](0x32)},'saPIVA':{'type':Sequelize['STRING'](0x32)},'saSDICode':{'type':Sequelize[_0x791a('0x1')](0x15)},'saFiscalMessage':{'type':Sequelize[_0x791a('0x1')],'set':function(_0x167bc4){this[_0x791a('0x3')](_0x791a('0x4'),_0x167bc4?_0x167bc4[_0x791a('0x5')](','):null);},'get':function(){return this['getDataValue']('saFiscalMessage')?this[_0x791a('0x6')](_0x791a('0x4'))['split'](','):[];}},'saExpiryDay':{'type':Sequelize[_0x791a('0x7')]},'saEurope':{'type':Sequelize[_0x791a('0x8')]},'saSocCap':{'type':Sequelize['STRING'](0xff)},'saPaymentMethod':{'type':Sequelize[_0x791a('0x7')]},'defaultEntry':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'vat':{'type':Sequelize[_0x791a('0x1')](0xff)}}; \ No newline at end of file +var _0x6c76=['split','INTEGER','BOOLEAN','sequelize','exports','STRING','FLOAT','setDataValue','saFiscalMessage','join','getDataValue'];(function(_0x18d3cd,_0x42baea){var _0x18e5eb=function(_0x28a410){while(--_0x28a410){_0x18d3cd['push'](_0x18d3cd['shift']());}};_0x18e5eb(++_0x42baea);}(_0x6c76,0x184));var _0x66c7=function(_0x28bc73,_0x5f29c1){_0x28bc73=_0x28bc73-0x0;var _0x593d7c=_0x6c76[_0x28bc73];return _0x593d7c;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'name':{'type':Sequelize[_0x66c7('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x66c7('0x2')]},'phone':{'type':Sequelize[_0x66c7('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x66c7('0x2')]},'postalCode':{'type':Sequelize[_0x66c7('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x66c7('0x2')]},'email':{'type':Sequelize[_0x66c7('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x66c7('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x66c7('0x2')]},'description':{'type':Sequelize[_0x66c7('0x2')]},'flatDiscount':{'type':Sequelize[_0x66c7('0x3')]},'saStreet':{'type':Sequelize['STRING']},'saPostalCode':{'type':Sequelize[_0x66c7('0x2')]},'saCity':{'type':Sequelize[_0x66c7('0x2')]},'saCountry':{'type':Sequelize[_0x66c7('0x2')]},'saISOCode':{'type':Sequelize[_0x66c7('0x2')](0x3)},'saFiscalCode':{'type':Sequelize['STRING'](0x32)},'saPIVA':{'type':Sequelize[_0x66c7('0x2')](0x32)},'saSDICode':{'type':Sequelize[_0x66c7('0x2')](0x15)},'saFiscalMessage':{'type':Sequelize[_0x66c7('0x2')],'set':function(_0x187e00){this[_0x66c7('0x4')](_0x66c7('0x5'),_0x187e00?_0x187e00[_0x66c7('0x6')](','):null);},'get':function(){return this['getDataValue'](_0x66c7('0x5'))?this[_0x66c7('0x7')](_0x66c7('0x5'))[_0x66c7('0x8')](','):[];}},'saExpiryDay':{'type':Sequelize[_0x66c7('0x9')]},'saEurope':{'type':Sequelize[_0x66c7('0xa')]},'saSocCap':{'type':Sequelize[_0x66c7('0x2')](0xff)},'saPaymentMethod':{'type':Sequelize[_0x66c7('0x9')]},'defaultEntry':{'type':Sequelize[_0x66c7('0xa')],'defaultValue':![]},'vat':{'type':Sequelize['STRING'](0xff)}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 9c655c4..6388eb1 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 _0xd92f=['filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','CmCompany','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x52598d,_0x10fb73){var _0x170309=function(_0x30c9f7){while(--_0x30c9f7){_0x52598d['push'](_0x52598d['shift']());}};_0x170309(++_0x10fb73);}(_0xd92f,0xd6));var _0xfd92=function(_0x5bab05,_0x3259a2){_0x5bab05=_0x5bab05-0x0;var _0x4d404a=_0xd92f[_0x5bab05];return _0x4d404a;};'use strict';var pdf=require(_0xfd92('0x0'));var emlformat=require(_0xfd92('0x1'));var rimraf=require(_0xfd92('0x2'));var zipdir=require(_0xfd92('0x3'));var jsonpatch=require(_0xfd92('0x4'));var rp=require(_0xfd92('0x5'));var moment=require(_0xfd92('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xfd92('0x7'));var util=require(_0xfd92('0x8'));var path=require(_0xfd92('0x9'));var sox=require(_0xfd92('0xa'));var csv=require(_0xfd92('0xb'));var ejs=require(_0xfd92('0xc'));var fs=require('fs');var _=require(_0xfd92('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfd92('0xe'));var deskjs=require(_0xfd92('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfd92('0x10'));var Papa=require('papaparse');var Redis=require(_0xfd92('0x11'));var authService=require(_0xfd92('0x12'));var qs=require(_0xfd92('0x13'));var hardwareService=require(_0xfd92('0x14'));var logger=require('../../config/logger')(_0xfd92('0x15'));var utils=require(_0xfd92('0x16'));var config=require(_0xfd92('0x17'));var db=require(_0xfd92('0x18'))['db'];function respondWithStatusCode(_0x8b69cd,_0x32f199){_0x32f199=_0x32f199||0xcc;return function(_0x4a18a2){if(_0x4a18a2){return _0x8b69cd['sendStatus'](_0x32f199);}return _0x8b69cd[_0xfd92('0x19')](_0x32f199)[_0xfd92('0x1a')]();};}function respondWithResult(_0x4f3154,_0x27f33d){_0x27f33d=_0x27f33d||0xc8;return function(_0x417d94){if(_0x417d94){return _0x4f3154[_0xfd92('0x19')](_0x27f33d)[_0xfd92('0x1b')](_0x417d94);}};}function respondWithFilteredResult(_0x4567f6,_0x552291){return function(_0x5d6e84){if(_0x5d6e84){var _0x31f385=_0x5d6e84['count'],_0x2f6258=_0x552291[_0xfd92('0x1c')],_0x4fadc3=_0x552291[_0xfd92('0x1c')]+_0x552291['limit'],_0x134898;if(_0x4fadc3>=_0x31f385){_0x4fadc3=_0x31f385;_0x134898=0xc8;}else{_0x134898=0xce;}_0x4567f6[_0xfd92('0x19')](_0x134898);return _0x4567f6[_0xfd92('0x1d')](_0xfd92('0x1e'),_0x2f6258+'-'+_0x4fadc3+'/'+_0x31f385)[_0xfd92('0x1b')](_0x5d6e84);}return null;};}function patchUpdates(_0x4a55f8){return function(_0x3b0a13){try{jsonpatch[_0xfd92('0x1f')](_0x3b0a13,_0x4a55f8,!![]);}catch(_0x33bf92){return BPromise['reject'](_0x33bf92);}return _0x3b0a13[_0xfd92('0x20')]();};}function saveUpdates(_0xf2266c,_0x3acdd1){return function(_0x9a3e93){if(_0x9a3e93){return _0x9a3e93[_0xfd92('0x21')](_0xf2266c)[_0xfd92('0x22')](function(_0x21872f){return _0x21872f;});}return null;};}function removeEntity(_0x57339f,_0x4a05e1){return function(_0x324533){if(_0x324533){return _0x324533['destroy']()[_0xfd92('0x22')](function(){var _0x30503d=_0x324533[_0xfd92('0x23')]({'plain':!![]});var _0x4aa238='Companies';return db[_0xfd92('0x24')][_0xfd92('0x25')]({'where':{'type':_0x4aa238,'resourceId':_0x30503d['id']}})[_0xfd92('0x22')](function(){return _0x324533;});})[_0xfd92('0x22')](function(){_0x57339f[_0xfd92('0x19')](0xcc)[_0xfd92('0x1a')]();});}};}function handleEntityNotFound(_0x4fe71b,_0x5829a5){return function(_0x33ff6b){if(!_0x33ff6b){_0x4fe71b[_0xfd92('0x26')](0x194);}return _0x33ff6b;};}function handleError(_0x141307,_0x5492f2){_0x5492f2=_0x5492f2||0x1f4;return function(_0x211b53){logger[_0xfd92('0x27')](_0x211b53[_0xfd92('0x28')]);if(_0x211b53[_0xfd92('0x29')]){delete _0x211b53[_0xfd92('0x29')];}_0x141307[_0xfd92('0x19')](_0x5492f2)[_0xfd92('0x2a')](_0x211b53);};}exports['index']=function(_0x1d3bde,_0x5e3ad9){var _0x26aa6e={},_0x5ca01a={},_0x523408={'count':0x0,'rows':[]};var _0x2997ed=db[_0xfd92('0x2b')][_0xfd92('0x2c')];_0x5ca01a[_0xfd92('0x2d')]=_['keys'](_0x2997ed);_0x5ca01a[_0xfd92('0x2e')]=_[_0xfd92('0x2f')](_0x1d3bde[_0xfd92('0x2e')]);_0x5ca01a[_0xfd92('0x30')]=_[_0xfd92('0x31')](_0x5ca01a[_0xfd92('0x2d')],_0x5ca01a[_0xfd92('0x2e')]);_0x26aa6e[_0xfd92('0x32')]=_[_0xfd92('0x31')](_0x5ca01a[_0xfd92('0x2d')],qs['fields'](_0x1d3bde['query'][_0xfd92('0x33')]));_0x26aa6e[_0xfd92('0x32')]=_0x26aa6e[_0xfd92('0x32')][_0xfd92('0x34')]?_0x26aa6e[_0xfd92('0x32')]:_0x5ca01a[_0xfd92('0x2d')];if(!_0x1d3bde[_0xfd92('0x2e')][_0xfd92('0x35')](_0xfd92('0x36'))){_0x26aa6e['limit']=qs[_0xfd92('0x37')](_0x1d3bde[_0xfd92('0x2e')]['limit']);_0x26aa6e[_0xfd92('0x1c')]=qs[_0xfd92('0x1c')](_0x1d3bde[_0xfd92('0x2e')]['offset']);}_0x26aa6e[_0xfd92('0x38')]=qs[_0xfd92('0x39')](_0x1d3bde['query'][_0xfd92('0x39')]);_0x26aa6e[_0xfd92('0x3a')]=qs[_0xfd92('0x30')](_['pick'](_0x1d3bde[_0xfd92('0x2e')],_0x5ca01a[_0xfd92('0x30')]));if(_0x1d3bde['query'][_0xfd92('0x3b')]){_0x26aa6e[_0xfd92('0x3a')]=_[_0xfd92('0x3c')](_0x26aa6e[_0xfd92('0x3a')],{'$or':_[_0xfd92('0x3d')](_0x2997ed,function(_0xf6a308){if(_0xf6a308[_0xfd92('0x3e')][_0xfd92('0x3f')]!==_0xfd92('0x40')){var _0x11d411={};_0x11d411[_0xf6a308[_0xfd92('0x41')]]={'$like':'%'+_0x1d3bde[_0xfd92('0x2e')][_0xfd92('0x3b')]+'%'};return _0x11d411;}})});}_0x26aa6e=_[_0xfd92('0x3c')]({},_0x26aa6e,_0x1d3bde[_0xfd92('0x42')]);var _0x82d787={'where':_0x26aa6e['where']};return db['CmCompany'][_0xfd92('0x43')](_0x82d787)['then'](function(_0x2fab5b){_0x523408[_0xfd92('0x43')]=_0x2fab5b;if(_0x1d3bde[_0xfd92('0x2e')][_0xfd92('0x44')]){_0x26aa6e[_0xfd92('0x45')]=[{'all':!![]}];}return db['CmCompany'][_0xfd92('0x46')](_0x26aa6e);})[_0xfd92('0x22')](function(_0x391da5){_0x523408[_0xfd92('0x47')]=_0x391da5;return _0x523408;})[_0xfd92('0x22')](respondWithFilteredResult(_0x5e3ad9,_0x26aa6e))[_0xfd92('0x48')](handleError(_0x5e3ad9,null));};exports[_0xfd92('0x49')]=function(_0x2caf2c,_0x455394){var _0x1be34a={'raw':![],'where':{'id':_0x2caf2c[_0xfd92('0x4a')]['id']}},_0x511bf8={};_0x511bf8['model']=_[_0xfd92('0x2f')](db[_0xfd92('0x2b')][_0xfd92('0x2c')]);_0x511bf8[_0xfd92('0x2e')]=_[_0xfd92('0x2f')](_0x2caf2c[_0xfd92('0x2e')]);_0x511bf8[_0xfd92('0x30')]=_[_0xfd92('0x31')](_0x511bf8['model'],_0x511bf8[_0xfd92('0x2e')]);_0x1be34a[_0xfd92('0x32')]=_[_0xfd92('0x31')](_0x511bf8[_0xfd92('0x2d')],qs[_0xfd92('0x33')](_0x2caf2c[_0xfd92('0x2e')][_0xfd92('0x33')]));_0x1be34a[_0xfd92('0x32')]=_0x1be34a[_0xfd92('0x32')][_0xfd92('0x34')]?_0x1be34a[_0xfd92('0x32')]:_0x511bf8[_0xfd92('0x2d')];if(_0x2caf2c[_0xfd92('0x2e')][_0xfd92('0x44')]){_0x1be34a['include']=[{'all':!![]}];}_0x1be34a=_[_0xfd92('0x3c')]({},_0x1be34a,_0x2caf2c[_0xfd92('0x42')]);return db[_0xfd92('0x2b')][_0xfd92('0x4b')](_0x1be34a)[_0xfd92('0x22')](handleEntityNotFound(_0x455394,null))['then'](respondWithResult(_0x455394,null))[_0xfd92('0x48')](handleError(_0x455394,null));};exports[_0xfd92('0x4c')]=function(_0x1c4a23,_0x153ef0){return db[_0xfd92('0x2b')][_0xfd92('0x4c')](_0x1c4a23[_0xfd92('0x4d')],{})['then'](function(_0x49c181){var _0x4952=_0x1c4a23[_0xfd92('0x4e')][_0xfd92('0x23')]({'plain':!![]});if(!_0x4952)throw new Error(_0xfd92('0x4f'));if(_0x4952[_0xfd92('0x50')]===_0xfd92('0x4e')){var _0x3573c6=_0x49c181['get']({'plain':!![]});var _0x5cac4a=_0xfd92('0x51');return db['UserProfileSection'][_0xfd92('0x4b')]({'where':{'name':_0x5cac4a,'userProfileId':_0x4952[_0xfd92('0x52')]},'raw':!![]})[_0xfd92('0x22')](function(_0x579fdb){if(_0x579fdb&&_0x579fdb[_0xfd92('0x53')]===0x0){return db[_0xfd92('0x24')]['create']({'name':_0x3573c6['name'],'resourceId':_0x3573c6['id'],'type':_0x579fdb[_0xfd92('0x29')],'sectionId':_0x579fdb['id']},{})[_0xfd92('0x22')](function(){return _0x49c181;});}else{return _0x49c181;}})[_0xfd92('0x48')](function(_0x5000c8){logger[_0xfd92('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5000c8);throw _0x5000c8;});}return _0x49c181;})[_0xfd92('0x22')](respondWithResult(_0x153ef0,0xc9))['catch'](handleError(_0x153ef0,null));};exports[_0xfd92('0x21')]=function(_0x2ca6b1,_0x26efb7){if(_0x2ca6b1[_0xfd92('0x4d')]['id']){delete _0x2ca6b1['body']['id'];}return db[_0xfd92('0x2b')][_0xfd92('0x4b')]({'where':{'id':_0x2ca6b1[_0xfd92('0x4a')]['id']}})[_0xfd92('0x22')](handleEntityNotFound(_0x26efb7,null))['then'](saveUpdates(_0x2ca6b1['body'],null))[_0xfd92('0x22')](respondWithResult(_0x26efb7,null))[_0xfd92('0x48')](handleError(_0x26efb7,null));};exports[_0xfd92('0x25')]=function(_0x7be37c,_0x5bc5f6){return db[_0xfd92('0x2b')][_0xfd92('0x4b')]({'where':{'id':_0x7be37c['params']['id']}})[_0xfd92('0x22')](handleEntityNotFound(_0x5bc5f6,null))['then'](removeEntity(_0x5bc5f6,null))['catch'](handleError(_0x5bc5f6,null));};exports[_0xfd92('0x54')]=function(_0x49b7b3,_0x52caf7,_0x3b40d1){return db[_0xfd92('0x55')]['find']({'where':{'id':_0x49b7b3[_0xfd92('0x4a')]['id']}})[_0xfd92('0x22')](handleEntityNotFound(_0x52caf7,null))[_0xfd92('0x22')](function(_0x3db9e0){if(_0x3db9e0){return _0x3db9e0['addContacts'](_0x49b7b3[_0xfd92('0x4d')][_0xfd92('0x56')],_[_0xfd92('0x57')](_0x49b7b3[_0xfd92('0x4d')],[_0xfd92('0x56'),'id'])||{});}})[_0xfd92('0x22')](respondWithResult(_0x52caf7,null))[_0xfd92('0x48')](handleError(_0x52caf7,null));};exports[_0xfd92('0x58')]=function(_0x226b0b,_0x4576d0,_0x34ede6){var _0x5ac6c4={};var _0x122cba={};var _0x5d48cb;var _0x527e7f;return db[_0xfd92('0x2b')][_0xfd92('0x59')]({'where':{'id':_0x226b0b['params']['id']}})[_0xfd92('0x22')](handleEntityNotFound(_0x4576d0,null))[_0xfd92('0x22')](function(_0x4d888c){if(_0x4d888c){_0x5d48cb=_0x4d888c;_0x122cba[_0xfd92('0x2d')]=_[_0xfd92('0x2f')](db[_0xfd92('0x55')][_0xfd92('0x2c')]);_0x122cba[_0xfd92('0x2e')]=_['keys'](_0x226b0b[_0xfd92('0x2e')]);_0x122cba[_0xfd92('0x30')]=_['intersection'](_0x122cba[_0xfd92('0x2d')],_0x122cba['query']);_0x5ac6c4['attributes']=_[_0xfd92('0x31')](_0x122cba[_0xfd92('0x2d')],qs[_0xfd92('0x33')](_0x226b0b['query'][_0xfd92('0x33')]));_0x5ac6c4[_0xfd92('0x32')]=_0x5ac6c4[_0xfd92('0x32')][_0xfd92('0x34')]?_0x5ac6c4[_0xfd92('0x32')]:_0x122cba[_0xfd92('0x2d')];_0x5ac6c4[_0xfd92('0x38')]=qs['sort'](_0x226b0b['query'][_0xfd92('0x39')]);_0x5ac6c4['where']=qs['filters'](_[_0xfd92('0x5a')](_0x226b0b[_0xfd92('0x2e')],_0x122cba[_0xfd92('0x30')]));if(_0x226b0b[_0xfd92('0x2e')]['filter']){_0x5ac6c4[_0xfd92('0x3a')]=_['merge'](_0x5ac6c4[_0xfd92('0x3a')],{'$or':_[_0xfd92('0x3d')](_0x5ac6c4[_0xfd92('0x32')],function(_0x2d6e49){var _0x8528ff={};_0x8528ff[_0x2d6e49]={'$like':'%'+_0x226b0b['query']['filter']+'%'};return _0x8528ff;})});}_0x5ac6c4=_['merge']({},_0x5ac6c4,_0x226b0b[_0xfd92('0x42')]);return _0x5d48cb[_0xfd92('0x58')](_0x5ac6c4);}})[_0xfd92('0x22')](function(_0x2bd42e){if(_0x2bd42e){_0x527e7f=_0x2bd42e['length'];if(!_0x226b0b[_0xfd92('0x2e')][_0xfd92('0x35')](_0xfd92('0x36'))){_0x5ac6c4[_0xfd92('0x37')]=qs[_0xfd92('0x37')](_0x226b0b['query'][_0xfd92('0x37')]);_0x5ac6c4[_0xfd92('0x1c')]=qs[_0xfd92('0x1c')](_0x226b0b[_0xfd92('0x2e')][_0xfd92('0x1c')]);}return _0x5d48cb[_0xfd92('0x58')](_0x5ac6c4);}})[_0xfd92('0x22')](function(_0x297249){if(_0x297249){return _0x297249?{'count':_0x527e7f,'rows':_0x297249}:null;}})['then'](respondWithResult(_0x4576d0,null))[_0xfd92('0x48')](handleError(_0x4576d0,null));}; \ No newline at end of file +var _0x4b4f=['count','offset','set','Content-Range','json','apply','reject','save','update','then','Companies','UserProfileResource','destroy','error','stack','name','send','index','CmCompany','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x1c4c0f,_0x5c127c){var _0xb73a2e=function(_0x534b51){while(--_0x534b51){_0x1c4c0f['push'](_0x1c4c0f['shift']());}};_0xb73a2e(++_0x5c127c);}(_0x4b4f,0xf0));var _0xf4b4=function(_0x59da69,_0x4b0c79){_0x59da69=_0x59da69-0x0;var _0x55c515=_0x4b4f[_0x59da69];return _0x55c515;};'use strict';var pdf=require(_0xf4b4('0x0'));var emlformat=require(_0xf4b4('0x1'));var rimraf=require(_0xf4b4('0x2'));var zipdir=require(_0xf4b4('0x3'));var jsonpatch=require(_0xf4b4('0x4'));var rp=require(_0xf4b4('0x5'));var moment=require('moment');var BPromise=require(_0xf4b4('0x6'));var Mustache=require('mustache');var util=require(_0xf4b4('0x7'));var path=require('path');var sox=require(_0xf4b4('0x8'));var csv=require(_0xf4b4('0x9'));var ejs=require(_0xf4b4('0xa'));var fs=require('fs');var _=require(_0xf4b4('0xb'));var squel=require(_0xf4b4('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf4b4('0x9'));var querystring=require('querystring');var Papa=require(_0xf4b4('0xe'));var Redis=require(_0xf4b4('0xf'));var authService=require(_0xf4b4('0x10'));var qs=require(_0xf4b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf4b4('0x12'));var utils=require(_0xf4b4('0x13'));var config=require(_0xf4b4('0x14'));var db=require(_0xf4b4('0x15'))['db'];function respondWithStatusCode(_0x49bcb2,_0x2221c5){_0x2221c5=_0x2221c5||0xcc;return function(_0x624909){if(_0x624909){return _0x49bcb2['sendStatus'](_0x2221c5);}return _0x49bcb2[_0xf4b4('0x16')](_0x2221c5)[_0xf4b4('0x17')]();};}function respondWithResult(_0x264efa,_0x5c0b){_0x5c0b=_0x5c0b||0xc8;return function(_0x44cf29){if(_0x44cf29){return _0x264efa[_0xf4b4('0x16')](_0x5c0b)['json'](_0x44cf29);}};}function respondWithFilteredResult(_0x981c4c,_0x20b6c2){return function(_0x2edbfd){if(_0x2edbfd){var _0x2d8be0=_0x2edbfd[_0xf4b4('0x18')],_0xf996ad=_0x20b6c2[_0xf4b4('0x19')],_0x533398=_0x20b6c2[_0xf4b4('0x19')]+_0x20b6c2['limit'],_0x5cdc54;if(_0x533398>=_0x2d8be0){_0x533398=_0x2d8be0;_0x5cdc54=0xc8;}else{_0x5cdc54=0xce;}_0x981c4c[_0xf4b4('0x16')](_0x5cdc54);return _0x981c4c[_0xf4b4('0x1a')](_0xf4b4('0x1b'),_0xf996ad+'-'+_0x533398+'/'+_0x2d8be0)[_0xf4b4('0x1c')](_0x2edbfd);}return null;};}function patchUpdates(_0x1dd6c6){return function(_0x1ab95e){try{jsonpatch[_0xf4b4('0x1d')](_0x1ab95e,_0x1dd6c6,!![]);}catch(_0x7d367f){return BPromise[_0xf4b4('0x1e')](_0x7d367f);}return _0x1ab95e[_0xf4b4('0x1f')]();};}function saveUpdates(_0x31e733,_0x255ed1){return function(_0x5ba9a9){if(_0x5ba9a9){return _0x5ba9a9[_0xf4b4('0x20')](_0x31e733)['then'](function(_0x2e6743){return _0x2e6743;});}return null;};}function removeEntity(_0x14b0ed,_0x97399f){return function(_0x1d565c){if(_0x1d565c){return _0x1d565c['destroy']()[_0xf4b4('0x21')](function(){var _0x3c2d10=_0x1d565c['get']({'plain':!![]});var _0x4b74bc=_0xf4b4('0x22');return db[_0xf4b4('0x23')][_0xf4b4('0x24')]({'where':{'type':_0x4b74bc,'resourceId':_0x3c2d10['id']}})[_0xf4b4('0x21')](function(){return _0x1d565c;});})['then'](function(){_0x14b0ed[_0xf4b4('0x16')](0xcc)[_0xf4b4('0x17')]();});}};}function handleEntityNotFound(_0x542c7a,_0x249ad0){return function(_0x3a18c7){if(!_0x3a18c7){_0x542c7a['sendStatus'](0x194);}return _0x3a18c7;};}function handleError(_0x39fa54,_0xc5ba7b){_0xc5ba7b=_0xc5ba7b||0x1f4;return function(_0x4ced07){logger[_0xf4b4('0x25')](_0x4ced07[_0xf4b4('0x26')]);if(_0x4ced07[_0xf4b4('0x27')]){delete _0x4ced07['name'];}_0x39fa54[_0xf4b4('0x16')](_0xc5ba7b)[_0xf4b4('0x28')](_0x4ced07);};}exports[_0xf4b4('0x29')]=function(_0x5c622e,_0xf78aa){var _0x3772ff={},_0x544180={},_0x320381={'count':0x0,'rows':[]};var _0x5f0544=db[_0xf4b4('0x2a')][_0xf4b4('0x2b')];_0x544180[_0xf4b4('0x2c')]=_[_0xf4b4('0x2d')](_0x5f0544);_0x544180[_0xf4b4('0x2e')]=_[_0xf4b4('0x2d')](_0x5c622e[_0xf4b4('0x2e')]);_0x544180[_0xf4b4('0x2f')]=_[_0xf4b4('0x30')](_0x544180[_0xf4b4('0x2c')],_0x544180['query']);_0x3772ff['attributes']=_[_0xf4b4('0x30')](_0x544180[_0xf4b4('0x2c')],qs[_0xf4b4('0x31')](_0x5c622e[_0xf4b4('0x2e')][_0xf4b4('0x31')]));_0x3772ff[_0xf4b4('0x32')]=_0x3772ff[_0xf4b4('0x32')]['length']?_0x3772ff[_0xf4b4('0x32')]:_0x544180[_0xf4b4('0x2c')];if(!_0x5c622e[_0xf4b4('0x2e')][_0xf4b4('0x33')](_0xf4b4('0x34'))){_0x3772ff['limit']=qs[_0xf4b4('0x35')](_0x5c622e[_0xf4b4('0x2e')][_0xf4b4('0x35')]);_0x3772ff['offset']=qs[_0xf4b4('0x19')](_0x5c622e[_0xf4b4('0x2e')][_0xf4b4('0x19')]);}_0x3772ff[_0xf4b4('0x36')]=qs[_0xf4b4('0x37')](_0x5c622e[_0xf4b4('0x2e')]['sort']);_0x3772ff[_0xf4b4('0x38')]=qs[_0xf4b4('0x2f')](_[_0xf4b4('0x39')](_0x5c622e['query'],_0x544180[_0xf4b4('0x2f')]));if(_0x5c622e['query'][_0xf4b4('0x3a')]){_0x3772ff['where']=_[_0xf4b4('0x3b')](_0x3772ff[_0xf4b4('0x38')],{'$or':_[_0xf4b4('0x3c')](_0x5f0544,function(_0x4da583){if(_0x4da583[_0xf4b4('0x3d')]['key']!==_0xf4b4('0x3e')){var _0x54115c={};_0x54115c[_0x4da583[_0xf4b4('0x3f')]]={'$like':'%'+_0x5c622e[_0xf4b4('0x2e')]['filter']+'%'};return _0x54115c;}})});}_0x3772ff=_[_0xf4b4('0x3b')]({},_0x3772ff,_0x5c622e[_0xf4b4('0x40')]);var _0x558227={'where':_0x3772ff['where']};return db[_0xf4b4('0x2a')][_0xf4b4('0x18')](_0x558227)[_0xf4b4('0x21')](function(_0x4c8903){_0x320381[_0xf4b4('0x18')]=_0x4c8903;if(_0x5c622e[_0xf4b4('0x2e')][_0xf4b4('0x41')]){_0x3772ff[_0xf4b4('0x42')]=[{'all':!![]}];}return db[_0xf4b4('0x2a')][_0xf4b4('0x43')](_0x3772ff);})[_0xf4b4('0x21')](function(_0x691f0b){_0x320381[_0xf4b4('0x44')]=_0x691f0b;return _0x320381;})[_0xf4b4('0x21')](respondWithFilteredResult(_0xf78aa,_0x3772ff))[_0xf4b4('0x45')](handleError(_0xf78aa,null));};exports[_0xf4b4('0x46')]=function(_0x2175f0,_0x1240bf){var _0x11494b={'raw':![],'where':{'id':_0x2175f0[_0xf4b4('0x47')]['id']}},_0x2a148f={};_0x2a148f[_0xf4b4('0x2c')]=_[_0xf4b4('0x2d')](db[_0xf4b4('0x2a')][_0xf4b4('0x2b')]);_0x2a148f[_0xf4b4('0x2e')]=_[_0xf4b4('0x2d')](_0x2175f0['query']);_0x2a148f['filters']=_['intersection'](_0x2a148f[_0xf4b4('0x2c')],_0x2a148f['query']);_0x11494b[_0xf4b4('0x32')]=_[_0xf4b4('0x30')](_0x2a148f[_0xf4b4('0x2c')],qs[_0xf4b4('0x31')](_0x2175f0['query'][_0xf4b4('0x31')]));_0x11494b[_0xf4b4('0x32')]=_0x11494b[_0xf4b4('0x32')]['length']?_0x11494b[_0xf4b4('0x32')]:_0x2a148f[_0xf4b4('0x2c')];if(_0x2175f0[_0xf4b4('0x2e')][_0xf4b4('0x41')]){_0x11494b[_0xf4b4('0x42')]=[{'all':!![]}];}_0x11494b=_[_0xf4b4('0x3b')]({},_0x11494b,_0x2175f0['options']);return db['CmCompany'][_0xf4b4('0x48')](_0x11494b)['then'](handleEntityNotFound(_0x1240bf,null))['then'](respondWithResult(_0x1240bf,null))[_0xf4b4('0x45')](handleError(_0x1240bf,null));};exports[_0xf4b4('0x49')]=function(_0x4b1762,_0x1f5dab){return db[_0xf4b4('0x2a')][_0xf4b4('0x49')](_0x4b1762[_0xf4b4('0x4a')],{})[_0xf4b4('0x21')](function(_0x295d1b){var _0x54bd91=_0x4b1762['user']['get']({'plain':!![]});if(!_0x54bd91)throw new Error(_0xf4b4('0x4b'));if(_0x54bd91['role']===_0xf4b4('0x4c')){var _0x27ac34=_0x295d1b['get']({'plain':!![]});var _0x13b8c3=_0xf4b4('0x22');return db[_0xf4b4('0x4d')][_0xf4b4('0x48')]({'where':{'name':_0x13b8c3,'userProfileId':_0x54bd91[_0xf4b4('0x4e')]},'raw':!![]})[_0xf4b4('0x21')](function(_0xc018ad){if(_0xc018ad&&_0xc018ad[_0xf4b4('0x4f')]===0x0){return db['UserProfileResource'][_0xf4b4('0x49')]({'name':_0x27ac34['name'],'resourceId':_0x27ac34['id'],'type':_0xc018ad[_0xf4b4('0x27')],'sectionId':_0xc018ad['id']},{})[_0xf4b4('0x21')](function(){return _0x295d1b;});}else{return _0x295d1b;}})[_0xf4b4('0x45')](function(_0x358b49){logger[_0xf4b4('0x25')](_0xf4b4('0x50'),_0x358b49);throw _0x358b49;});}return _0x295d1b;})[_0xf4b4('0x21')](respondWithResult(_0x1f5dab,0xc9))[_0xf4b4('0x45')](handleError(_0x1f5dab,null));};exports['update']=function(_0x768bd0,_0x3bbd9e){if(_0x768bd0[_0xf4b4('0x4a')]['id']){delete _0x768bd0[_0xf4b4('0x4a')]['id'];}return db[_0xf4b4('0x2a')][_0xf4b4('0x48')]({'where':{'id':_0x768bd0['params']['id']}})[_0xf4b4('0x21')](handleEntityNotFound(_0x3bbd9e,null))[_0xf4b4('0x21')](saveUpdates(_0x768bd0[_0xf4b4('0x4a')],null))[_0xf4b4('0x21')](respondWithResult(_0x3bbd9e,null))[_0xf4b4('0x45')](handleError(_0x3bbd9e,null));};exports[_0xf4b4('0x24')]=function(_0x23982b,_0x2047e7){return db['CmCompany']['find']({'where':{'id':_0x23982b[_0xf4b4('0x47')]['id']}})[_0xf4b4('0x21')](handleEntityNotFound(_0x2047e7,null))['then'](removeEntity(_0x2047e7,null))[_0xf4b4('0x45')](handleError(_0x2047e7,null));};exports[_0xf4b4('0x51')]=function(_0xbb4e56,_0x23491f,_0x5a2555){return db[_0xf4b4('0x52')][_0xf4b4('0x48')]({'where':{'id':_0xbb4e56['params']['id']}})[_0xf4b4('0x21')](handleEntityNotFound(_0x23491f,null))[_0xf4b4('0x21')](function(_0x5267a9){if(_0x5267a9){return _0x5267a9[_0xf4b4('0x51')](_0xbb4e56[_0xf4b4('0x4a')][_0xf4b4('0x53')],_[_0xf4b4('0x54')](_0xbb4e56[_0xf4b4('0x4a')],[_0xf4b4('0x53'),'id'])||{});}})[_0xf4b4('0x21')](respondWithResult(_0x23491f,null))[_0xf4b4('0x45')](handleError(_0x23491f,null));};exports[_0xf4b4('0x55')]=function(_0x30638c,_0xa9ddab,_0x46d116){var _0x28286d={};var _0x59a0fd={};var _0x111eae;var _0x50b184;return db[_0xf4b4('0x2a')][_0xf4b4('0x56')]({'where':{'id':_0x30638c[_0xf4b4('0x47')]['id']}})[_0xf4b4('0x21')](handleEntityNotFound(_0xa9ddab,null))[_0xf4b4('0x21')](function(_0x4a8c4e){if(_0x4a8c4e){_0x111eae=_0x4a8c4e;_0x59a0fd[_0xf4b4('0x2c')]=_[_0xf4b4('0x2d')](db['CmContact'][_0xf4b4('0x2b')]);_0x59a0fd['query']=_['keys'](_0x30638c[_0xf4b4('0x2e')]);_0x59a0fd[_0xf4b4('0x2f')]=_[_0xf4b4('0x30')](_0x59a0fd[_0xf4b4('0x2c')],_0x59a0fd[_0xf4b4('0x2e')]);_0x28286d[_0xf4b4('0x32')]=_[_0xf4b4('0x30')](_0x59a0fd['model'],qs['fields'](_0x30638c[_0xf4b4('0x2e')][_0xf4b4('0x31')]));_0x28286d[_0xf4b4('0x32')]=_0x28286d['attributes'][_0xf4b4('0x57')]?_0x28286d['attributes']:_0x59a0fd[_0xf4b4('0x2c')];_0x28286d[_0xf4b4('0x36')]=qs[_0xf4b4('0x37')](_0x30638c['query']['sort']);_0x28286d[_0xf4b4('0x38')]=qs[_0xf4b4('0x2f')](_['pick'](_0x30638c[_0xf4b4('0x2e')],_0x59a0fd['filters']));if(_0x30638c[_0xf4b4('0x2e')][_0xf4b4('0x3a')]){_0x28286d[_0xf4b4('0x38')]=_['merge'](_0x28286d[_0xf4b4('0x38')],{'$or':_[_0xf4b4('0x3c')](_0x28286d[_0xf4b4('0x32')],function(_0x36b3f3){var _0x35245e={};_0x35245e[_0x36b3f3]={'$like':'%'+_0x30638c[_0xf4b4('0x2e')][_0xf4b4('0x3a')]+'%'};return _0x35245e;})});}_0x28286d=_[_0xf4b4('0x3b')]({},_0x28286d,_0x30638c['options']);return _0x111eae[_0xf4b4('0x55')](_0x28286d);}})['then'](function(_0x4edcaf){if(_0x4edcaf){_0x50b184=_0x4edcaf[_0xf4b4('0x57')];if(!_0x30638c[_0xf4b4('0x2e')][_0xf4b4('0x33')](_0xf4b4('0x34'))){_0x28286d[_0xf4b4('0x35')]=qs[_0xf4b4('0x35')](_0x30638c[_0xf4b4('0x2e')]['limit']);_0x28286d['offset']=qs[_0xf4b4('0x19')](_0x30638c['query'][_0xf4b4('0x19')]);}return _0x111eae[_0xf4b4('0x55')](_0x28286d);}})['then'](function(_0x1ff9f1){if(_0x1ff9f1){return _0x1ff9f1?{'count':_0x50b184,'rows':_0x1ff9f1}:null;}})[_0xf4b4('0x21')](respondWithResult(_0xa9ddab,null))[_0xf4b4('0x45')](handleError(_0xa9ddab,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9dbee3e..ebe8730 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 _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2274d4,_0x2f98b6){_0x2274d4=_0x2274d4-0x0;var _0x553dfb=_0xd7d1[_0x2274d4];return _0x553dfb;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b12=['cm_companies','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','CmCompany'];(function(_0x398664,_0x42f9ea){var _0x39e409=function(_0x1f53f6){while(--_0x1f53f6){_0x398664['push'](_0x398664['shift']());}};_0x39e409(++_0x42f9ea);}(_0x5b12,0xa3));var _0x25b1=function(_0x544350,_0x576eca){_0x544350=_0x544350-0x0;var _0x156fef=_0x5b12[_0x544350];return _0x156fef;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'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 dde2859..d89fbce 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 _0x1c1b=['catch','util','moment','randomstring','ioredis','rpc','client','http','request','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x1042ad,_0x1e1abc){var _0x4aa96a=function(_0x135b11){while(--_0x135b11){_0x1042ad['push'](_0x1042ad['shift']());}};_0x4aa96a(++_0x1e1abc);}(_0x1c1b,0x1dd));var _0xb1c1=function(_0x5c01d7,_0x5a16a4){_0x5c01d7=_0x5c01d7-0x0;var _0x4dd896=_0x1c1b[_0x5c01d7];return _0x4dd896;};'use strict';var _=require('lodash');var util=require(_0xb1c1('0x0'));var moment=require(_0xb1c1('0x1'));var BPromise=require('bluebird');var rs=require(_0xb1c1('0x2'));var fs=require('fs');var Redis=require(_0xb1c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1c1('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb1c1('0x5')][_0xb1c1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd5363,_0x468f44,_0x554cef){return new BPromise(function(_0x14d7a7,_0x128917){return client[_0xb1c1('0x7')](_0xd5363,_0x554cef)['then'](function(_0xfed7d4){logger['info'](_0xb1c1('0x8'),_0x468f44,'request\x20sent');logger['debug'](_0xb1c1('0x9'),_0x468f44,_0xb1c1('0xa'),JSON[_0xb1c1('0xb')](_0xfed7d4));if(_0xfed7d4[_0xb1c1('0xc')]){if(_0xfed7d4[_0xb1c1('0xc')]['code']===0x1f4){logger[_0xb1c1('0xc')]('CmCompany,\x20%s,\x20%s',_0x468f44,_0xfed7d4['error'][_0xb1c1('0xd')]);return _0x128917(_0xfed7d4[_0xb1c1('0xc')][_0xb1c1('0xd')]);}logger[_0xb1c1('0xc')](_0xb1c1('0x8'),_0x468f44,_0xfed7d4[_0xb1c1('0xc')]['message']);return _0x14d7a7(_0xfed7d4['error'][_0xb1c1('0xd')]);}else{logger[_0xb1c1('0xe')](_0xb1c1('0x8'),_0x468f44,_0xb1c1('0xa'));_0x14d7a7(_0xfed7d4[_0xb1c1('0xf')][_0xb1c1('0xd')]);}})[_0xb1c1('0x10')](function(_0x364819){logger['error'](_0xb1c1('0x8'),_0x468f44,_0x364819);_0x128917(_0x364819);});});} \ No newline at end of file +var _0xa8ed=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x3101c5,_0x1d5762){var _0x46cddb=function(_0x2685cd){while(--_0x2685cd){_0x3101c5['push'](_0x3101c5['shift']());}};_0x46cddb(++_0x1d5762);}(_0xa8ed,0x141));var _0xda8e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa8ed[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xda8e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda8e('0x1'));var rs=require(_0xda8e('0x2'));var fs=require('fs');var Redis=require(_0xda8e('0x3'));var db=require(_0xda8e('0x4'))['db'];var utils=require(_0xda8e('0x5'));var logger=require('../../config/logger')(_0xda8e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xda8e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59c6a5,_0xb9e5c4,_0x3d6256){return new BPromise(function(_0x1c33df,_0x4b5635){return client[_0xda8e('0x8')](_0x59c6a5,_0x3d6256)[_0xda8e('0x9')](function(_0x84b935){logger[_0xda8e('0xa')](_0xda8e('0xb'),_0xb9e5c4,_0xda8e('0xc'));logger['debug'](_0xda8e('0xd'),_0xb9e5c4,_0xda8e('0xc'),JSON[_0xda8e('0xe')](_0x84b935));if(_0x84b935['error']){if(_0x84b935['error'][_0xda8e('0xf')]===0x1f4){logger[_0xda8e('0x10')](_0xda8e('0xb'),_0xb9e5c4,_0x84b935[_0xda8e('0x10')][_0xda8e('0x11')]);return _0x4b5635(_0x84b935['error'][_0xda8e('0x11')]);}logger['error'](_0xda8e('0xb'),_0xb9e5c4,_0x84b935[_0xda8e('0x10')]['message']);return _0x1c33df(_0x84b935[_0xda8e('0x10')]['message']);}else{logger[_0xda8e('0xa')](_0xda8e('0xb'),_0xb9e5c4,_0xda8e('0xc'));_0x1c33df(_0x84b935[_0xda8e('0x12')][_0xda8e('0x11')]);}})[_0xda8e('0x13')](function(_0xfe5369){logger[_0xda8e('0x10')](_0xda8e('0xb'),_0xb9e5c4,_0xfe5369);_0x4b5635(_0xfe5369);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 0440483..e376b77 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 _0x3e31=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','addContacts','update','delete','destroy','exports'];(function(_0x31345c,_0x528033){var _0x1c6dc9=function(_0x35e840){while(--_0x35e840){_0x31345c['push'](_0x31345c['shift']());}};_0x1c6dc9(++_0x528033);}(_0x3e31,0x156));var _0x13e3=function(_0xc7da5f,_0x5915d6){_0xc7da5f=_0xc7da5f-0x0;var _0x35efaf=_0x3e31[_0xc7da5f];return _0x35efaf;};'use strict';var multer=require(_0x13e3('0x0'));var util=require(_0x13e3('0x1'));var path=require(_0x13e3('0x2'));var timeout=require(_0x13e3('0x3'));var express=require('express');var router=express[_0x13e3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x13e3('0x5'));var config=require(_0x13e3('0x6'));var controller=require('./cmCompany.controller');router[_0x13e3('0x7')]('/',auth[_0x13e3('0x8')](),controller['index']);router[_0x13e3('0x7')](_0x13e3('0x9'),auth[_0x13e3('0x8')](),controller[_0x13e3('0xa')]);router[_0x13e3('0x7')]('/:id/contacts',auth[_0x13e3('0x8')](),controller['getContacts']);router[_0x13e3('0xb')]('/',auth[_0x13e3('0x8')](),controller[_0x13e3('0xc')]);router[_0x13e3('0xb')]('/:id/contacts',auth[_0x13e3('0x8')](),controller[_0x13e3('0xd')]);router['put'](_0x13e3('0x9'),auth[_0x13e3('0x8')](),controller[_0x13e3('0xe')]);router[_0x13e3('0xf')]('/:id',auth[_0x13e3('0x8')](),controller[_0x13e3('0x10')]);module[_0x13e3('0x11')]=router; \ No newline at end of file +var _0x2144=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/:id','isAuthenticated','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path'];(function(_0x77178e,_0x2473a4){var _0x2390d1=function(_0x2e7ef7){while(--_0x2e7ef7){_0x77178e['push'](_0x77178e['shift']());}};_0x2390d1(++_0x2473a4);}(_0x2144,0xfa));var _0x4214=function(_0x1b09e8,_0x5c9627){_0x1b09e8=_0x1b09e8-0x0;var _0x158835=_0x2144[_0x1b09e8];return _0x158835;};'use strict';var multer=require(_0x4214('0x0'));var util=require(_0x4214('0x1'));var path=require(_0x4214('0x2'));var timeout=require(_0x4214('0x3'));var express=require(_0x4214('0x4'));var router=express[_0x4214('0x5')]();var auth=require(_0x4214('0x6'));var interaction=require(_0x4214('0x7'));var config=require(_0x4214('0x8'));var controller=require(_0x4214('0x9'));router[_0x4214('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4214('0xa')](_0x4214('0xb'),auth[_0x4214('0xc')](),controller[_0x4214('0xd')]);router[_0x4214('0xa')](_0x4214('0xe'),auth[_0x4214('0xc')](),controller['getContacts']);router[_0x4214('0xf')]('/',auth['isAuthenticated'](),controller[_0x4214('0x10')]);router[_0x4214('0xf')]('/:id/contacts',auth[_0x4214('0xc')](),controller[_0x4214('0x11')]);router[_0x4214('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4214('0x13')]);router[_0x4214('0x14')](_0x4214('0xb'),auth['isAuthenticated'](),controller[_0x4214('0x15')]);module[_0x4214('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index ca55e1b..bfc23c7 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 _0x7e07=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x2d16ff,_0x4edbc2){var _0x319eed=function(_0x24defe){while(--_0x24defe){_0x2d16ff['push'](_0x2d16ff['shift']());}};_0x319eed(++_0x4edbc2);}(_0x7e07,0xa4));var _0x77e0=function(_0xf456b1,_0x49d83a){_0xf456b1=_0xf456b1-0x0;var _0x1ae7f=_0x7e07[_0xf456b1];return _0x1ae7f;};'use strict';var _=require(_0x77e0('0x0'));var Sequelize=require(_0x77e0('0x1'));module[_0x77e0('0x2')]={'firstName':{'type':Sequelize[_0x77e0('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x77e0('0x3')]},'street':{'type':Sequelize[_0x77e0('0x3')]},'postalCode':{'type':Sequelize[_0x77e0('0x3')]},'city':{'type':Sequelize[_0x77e0('0x3')]},'country':{'type':Sequelize[_0x77e0('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77e0('0x4')]},'phone':{'type':Sequelize[_0x77e0('0x3')]},'mobile':{'type':Sequelize[_0x77e0('0x3')]},'fax':{'type':Sequelize[_0x77e0('0x3')]},'email':{'type':Sequelize[_0x77e0('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x77e0('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x77e0('0x3')]},'skype':{'type':Sequelize[_0x77e0('0x3')]},'teams':{'type':Sequelize[_0x77e0('0x3')]},'viber':{'type':Sequelize[_0x77e0('0x3')]},'line':{'type':Sequelize[_0x77e0('0x3')]},'wechat':{'type':Sequelize[_0x77e0('0x3')]},'telegram':{'type':Sequelize[_0x77e0('0x3')]},'UserId':{'type':Sequelize[_0x77e0('0x5')]},'priority':{'type':Sequelize[_0x77e0('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x77e0('0x6')],'defaultValue':Sequelize[_0x77e0('0x7')]}}; \ No newline at end of file +var _0xff7e=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x6659c,_0x9aa503){var _0x2e25d9=function(_0x3a5ee1){while(--_0x3a5ee1){_0x6659c['push'](_0x6659c['shift']());}};_0x2e25d9(++_0x9aa503);}(_0xff7e,0xd2));var _0xeff7=function(_0xf04271,_0x2a5d4d){_0xf04271=_0xf04271-0x0;var _0x4b05b3=_0xff7e[_0xf04271];return _0x4b05b3;};'use strict';var _=require(_0xeff7('0x0'));var Sequelize=require(_0xeff7('0x1'));module[_0xeff7('0x2')]={'firstName':{'type':Sequelize[_0xeff7('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xeff7('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xeff7('0x3')]},'country':{'type':Sequelize[_0xeff7('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeff7('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xeff7('0x3')]},'fax':{'type':Sequelize[_0xeff7('0x3')]},'email':{'type':Sequelize[_0xeff7('0x3')]},'url':{'type':Sequelize[_0xeff7('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xeff7('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xeff7('0x3')]},'viber':{'type':Sequelize[_0xeff7('0x3')]},'line':{'type':Sequelize[_0xeff7('0x3')]},'wechat':{'type':Sequelize[_0xeff7('0x3')]},'telegram':{'type':Sequelize[_0xeff7('0x3')]},'UserId':{'type':Sequelize[_0xeff7('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xeff7('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xeff7('0x7')],'defaultValue':Sequelize[_0xeff7('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 97f924a..45ab4a2 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 _0xad35=['from','tools_tags','where','c.deletedAt\x20IS\x20NULL','expr','parse','advancedFilter','forEach','condition','isArray','value','and','\x20IN\x20?','tableAlias','LIKE','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','isNil','isEmpty','ListId','concat','filter','replace','\x27\x27\x27\x27','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','order','c.id','Sequelize','QueryTypes','clone','COUNT(*)','tag','having','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','t.id\x20=\x20ct.TagId','Tags','split','push','rows','catch','find','params','describe','startsWith','columnName','CmCustomField','cf_','values','body','get','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','each','duplicates','$or','findOrCreate','spread','error','show','$and','omit','format','findAll','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','Tag','options','setTags','findOne','ids','getHoppers','ContactId','includeAll','include','CmHopperHistory','rawAttributes','getJscriptySessions','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','User','agent','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','message','start\x20child\x20process\x20correctly!','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','CmContact','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','select','field','color'];(function(_0x213aa3,_0x322e42){var _0x533ec6=function(_0x371841){while(--_0x371841){_0x213aa3['push'](_0x213aa3['shift']());}};_0x533ec6(++_0x322e42);}(_0xad35,0x169));var _0x5ad3=function(_0x3b2686,_0x53a22e){_0x3b2686=_0x3b2686-0x0;var _0x32c4b6=_0xad35[_0x3b2686];return _0x32c4b6;};'use strict';var pdf=require(_0x5ad3('0x0'));var emlformat=require(_0x5ad3('0x1'));var rimraf=require(_0x5ad3('0x2'));var zipdir=require(_0x5ad3('0x3'));var jsonpatch=require(_0x5ad3('0x4'));var rp=require(_0x5ad3('0x5'));var moment=require(_0x5ad3('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5ad3('0x7'));var util=require('util');var path=require(_0x5ad3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ad3('0x9'));var squel=require(_0x5ad3('0xa'));var crypto=require(_0x5ad3('0xb'));var jsforce=require(_0x5ad3('0xc'));var deskjs=require(_0x5ad3('0xd'));var toCsv=require(_0x5ad3('0xe'));var querystring=require(_0x5ad3('0xf'));var Papa=require('papaparse');var Redis=require(_0x5ad3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5ad3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad3('0x12'))(_0x5ad3('0x13'));var utils=require(_0x5ad3('0x14'));var config=require(_0x5ad3('0x15'));var db=require(_0x5ad3('0x16'))['db'];config[_0x5ad3('0x17')]=_[_0x5ad3('0x18')](config['redis'],{'host':_0x5ad3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')['register'](socket);function respondWithStatusCode(_0xb508db,_0x1dd872){_0x1dd872=_0x1dd872||0xcc;return function(_0x1d6e7e){if(_0x1d6e7e){return _0xb508db['sendStatus'](_0x1dd872);}return _0xb508db[_0x5ad3('0x1a')](_0x1dd872)[_0x5ad3('0x1b')]();};}function respondWithResult(_0x15bc67,_0x372961){_0x372961=_0x372961||0xc8;return function(_0x4eed2d){if(_0x4eed2d){return _0x15bc67[_0x5ad3('0x1a')](_0x372961)[_0x5ad3('0x1c')](_0x4eed2d);}};}function respondWithFilteredResult(_0x395f3f,_0x4d5ced){return function(_0x316ae4){if(_0x316ae4){var _0x129a7a=_0x316ae4[_0x5ad3('0x1d')],_0x1b3860=_0x4d5ced[_0x5ad3('0x1e')],_0x4ff453=_0x4d5ced[_0x5ad3('0x1e')]+_0x4d5ced['limit'],_0x15f59e;if(_0x4ff453>=_0x129a7a){_0x4ff453=_0x129a7a;_0x15f59e=0xc8;}else{_0x15f59e=0xce;}_0x395f3f[_0x5ad3('0x1a')](_0x15f59e);return _0x395f3f[_0x5ad3('0x1f')](_0x5ad3('0x20'),_0x1b3860+'-'+_0x4ff453+'/'+_0x129a7a)[_0x5ad3('0x1c')](_0x316ae4);}return null;};}function patchUpdates(_0x221c1f){return function(_0x1142fa){try{jsonpatch[_0x5ad3('0x21')](_0x1142fa,_0x221c1f,!![]);}catch(_0x336211){return BPromise['reject'](_0x336211);}return _0x1142fa[_0x5ad3('0x22')]();};}function saveUpdates(_0x5c8943,_0x4e539d){return function(_0xa09954){if(_0xa09954){return _0xa09954[_0x5ad3('0x23')](_0x5c8943)[_0x5ad3('0x24')](function(_0x3dbdd7){return _0x3dbdd7;});}return null;};}function removeEntity(_0x3ecfe1,_0x15b972){return function(_0x533ac2){if(_0x533ac2){return _0x533ac2[_0x5ad3('0x25')]()[_0x5ad3('0x24')](function(){_0x3ecfe1[_0x5ad3('0x1a')](0xcc)[_0x5ad3('0x1b')]();});}};}function handleEntityNotFound(_0x3c5294,_0x5124c8){return function(_0x410b5d){if(!_0x410b5d){_0x3c5294[_0x5ad3('0x26')](0x194);}return _0x410b5d;};}function handleError(_0x2a511d,_0x58b9e5){_0x58b9e5=_0x58b9e5||0x1f4;return function(_0x328232){logger['error'](_0x328232[_0x5ad3('0x27')]);if(_0x328232[_0x5ad3('0x28')]){delete _0x328232[_0x5ad3('0x28')];}_0x2a511d[_0x5ad3('0x1a')](_0x58b9e5)[_0x5ad3('0x29')](_0x328232);};}exports['index']=function(_0x209a4e,_0xb12efe){var _0x400680={},_0x34a7ac={},_0x132947={'count':0x0,'rows':[]};return db[_0x5ad3('0x2a')]['describe']()[_0x5ad3('0x24')](function(_0x447fcb){_0x34a7ac['model']=_[_0x5ad3('0x2b')](_0x447fcb);_0x34a7ac[_0x5ad3('0x2c')]=_[_0x5ad3('0x2b')](_0x209a4e[_0x5ad3('0x2c')]);_0x34a7ac[_0x5ad3('0x2d')]=_[_0x5ad3('0x2e')](_0x34a7ac[_0x5ad3('0x2f')],_0x34a7ac[_0x5ad3('0x2c')]);_0x400680[_0x5ad3('0x30')]=_[_0x5ad3('0x2e')](_0x34a7ac['model'],qs[_0x5ad3('0x31')](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x31')]));_0x400680[_0x5ad3('0x30')]=_0x400680[_0x5ad3('0x30')][_0x5ad3('0x32')]?_0x400680[_0x5ad3('0x30')]:_0x34a7ac[_0x5ad3('0x2f')];if(!_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x33')](_0x5ad3('0x34'))){_0x400680[_0x5ad3('0x35')]=qs[_0x5ad3('0x35')](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x35')]);_0x400680['offset']=qs[_0x5ad3('0x1e')](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x1e')]);}_0x400680['order']=qs['sort'](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x36')]);_0x400680['where']=qs[_0x5ad3('0x2d')](_[_0x5ad3('0x37')](_0x209a4e[_0x5ad3('0x2c')],_0x34a7ac[_0x5ad3('0x2d')]));var _0x371194=[];var _0xc19e00=squel[_0x5ad3('0x38')]()[_0x5ad3('0x39')]('id')[_0x5ad3('0x39')]('name')[_0x5ad3('0x39')](_0x5ad3('0x3a'))[_0x5ad3('0x3b')](_0x5ad3('0x3c'));var _0x508e5d=squel[_0x5ad3('0x38')]()[_0x5ad3('0x3b')]('cm_contacts','c')[_0x5ad3('0x3d')](_0x5ad3('0x3e'));var _0x2a0a63=squel[_0x5ad3('0x3f')]();if(_0x209a4e['query']['advancedFilter']){var _0x2a2c9f=JSON[_0x5ad3('0x40')](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x41')]);_[_0x5ad3('0x2b')](_0x2a2c9f)[_0x5ad3('0x42')](function(_0x33effd){var _0x5a5890=_0x2a2c9f[_0x33effd];switch(_0x5a5890[_0x5ad3('0x43')]){case'IS':if(_[_0x5ad3('0x44')](_0x5a5890[_0x5ad3('0x45')])&&_0x5a5890[_0x5ad3('0x45')][_0x5ad3('0x32')]>0x1){_0x2a0a63[_0x5ad3('0x46')](_0x5a5890['tableAlias']+'.'+_0x33effd+_0x5ad3('0x47'),_0x5a5890['value']);}else{_0x2a0a63[_0x5ad3('0x46')](_0x5a5890[_0x5ad3('0x48')]+'.'+_0x33effd+'\x20=\x20?',_0x5a5890[_0x5ad3('0x45')][0x0]);}break;case'=':_0x2a0a63[_0x5ad3('0x46')](_0x5a5890[_0x5ad3('0x48')]+'.'+_0x33effd+'\x20=\x20?',_0x5a5890[_0x5ad3('0x45')]);break;case _0x5ad3('0x49'):_0x2a0a63[_0x5ad3('0x46')](_0x5a5890['tableAlias']+'.'+_0x33effd+_0x5ad3('0x4a'),'%'+_0x5a5890['value']+'%');break;case'>':_0x2a0a63['and'](_0x5a5890[_0x5ad3('0x48')]+'.'+_0x33effd+_0x5ad3('0x4b'),_0x5a5890[_0x5ad3('0x45')]);break;case'<':_0x2a0a63[_0x5ad3('0x46')](_0x5a5890[_0x5ad3('0x48')]+'.'+_0x33effd+_0x5ad3('0x4c'),_0x5a5890[_0x5ad3('0x45')]);break;}});}else{var _0x1cfe08=_(Object[_0x5ad3('0x2b')](_0x209a4e[_0x5ad3('0x2c')]))[_0x5ad3('0x4d')](function(_0x399e2f){return _0x447fcb[_0x5ad3('0x33')](_0x399e2f)?_0x399e2f:undefined;})['filter'](function(_0xfaf6d2){return!_[_0x5ad3('0x4e')](_0xfaf6d2);})[_0x5ad3('0x45')]();if(!_[_0x5ad3('0x4f')](_0x1cfe08)){_0x1cfe08[_0x5ad3('0x42')](function(_0x4ef0ef){if(_0x4ef0ef===_0x5ad3('0x50')){_0x508e5d['where']('c.ListId\x20IN\x20?',[][_0x5ad3('0x51')](_0x209a4e[_0x5ad3('0x2c')][_0x4ef0ef]));}else{_0x508e5d['where']('c.'+_0x4ef0ef+'\x20=\x20?',_0x209a4e[_0x5ad3('0x2c')][_0x4ef0ef]);}});}if(_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x52')]){var _0xe71efa=_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x52')][_0x5ad3('0x53')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5ad3('0x54'));if(qs[_0x5ad3('0x55')](_0xe71efa)){_0x2a0a63['or']('c.id\x20LIKE\x20?',_0xe71efa+'%');_0x2a0a63['or']('c.phone\x20LIKE\x20?',_0xe71efa+'%');_0x2a0a63['or'](_0x5ad3('0x56'),_0xe71efa+'%');_0x2a0a63['or'](_0x5ad3('0x57'),_0xe71efa+'%');}else if(qs['isEmail'](_0xe71efa)){_0x2a0a63['or'](_0x5ad3('0x58'),_0xe71efa+'%');}else{_0x2a0a63['or'](_0x5ad3('0x58'),_0xe71efa+'%');_0x2a0a63['or'](_0x5ad3('0x59'),_0xe71efa+'%');_0x2a0a63['or'](_0x5ad3('0x5a'),_0xe71efa+'%');}}}_0x508e5d[_0x5ad3('0x3d')](_0x2a0a63);if(_0x400680[_0x5ad3('0x5b')]){_0x400680[_0x5ad3('0x5b')][_0x5ad3('0x42')](function(_0x294269){_0x508e5d[_0x5ad3('0x5b')]('c.'+_0x294269[0x0],_0x294269[0x1]==='DESC'?![]:!![]);});}_0x508e5d['group'](_0x5ad3('0x5c'));var _0x51925d={'type':db[_0x5ad3('0x5d')][_0x5ad3('0x5e')]['SELECT'],'raw':!![]};var _0x1751a0=_0x508e5d[_0x5ad3('0x5f')]()['field'](_0x5ad3('0x60'));if(!_0x209a4e[_0x5ad3('0x2c')]['advancedFilter']){if(_0x209a4e['query'][_0x5ad3('0x61')]){var _0x4ac1a4=_[_0x5ad3('0x44')](_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x61')])?_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x61')]:new Array(_0x209a4e[_0x5ad3('0x2c')][_0x5ad3('0x61')]);var _0x2e27ab=squel['expr']();_0x4ac1a4['forEach'](function(_0x114301){_0x2e27ab['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x114301+',%');});_0x508e5d[_0x5ad3('0x62')](_0x2e27ab);_0x1751a0['left_join'](_0x5ad3('0x63'),'ct',_0x5ad3('0x64'));_0x1751a0[_0x5ad3('0x65')](_0x5ad3('0x3c'),'t','t.id\x20=\x20ct.TagId');_0x1751a0[_0x5ad3('0x3d')](_0x5ad3('0x66'),_0x4ac1a4);}}db[_0x5ad3('0x67')][_0x5ad3('0x2c')](_0xc19e00[_0x5ad3('0x68')](),_0x51925d)[_0x5ad3('0x24')](function(_0x12050e){_0x371194=_[_0x5ad3('0x69')](_0x12050e,'id');return db[_0x5ad3('0x67')][_0x5ad3('0x2c')](_0x1751a0[_0x5ad3('0x68')](),_0x51925d);})[_0x5ad3('0x24')](function(_0x2dede0){_0x132947[_0x5ad3('0x1d')]=_0x2dede0[_0x5ad3('0x32')];_0x51925d=_[_0x5ad3('0x6a')](_0x51925d,{'model':db[_0x5ad3('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x508e5d[_0x5ad3('0x39')](_0x5ad3('0x6b'));_0x508e5d[_0x5ad3('0x39')](_0x5ad3('0x6c'),_0x5ad3('0x6d'));_0x508e5d[_0x5ad3('0x65')](_0x5ad3('0x63'),'ct',_0x5ad3('0x64'));_0x508e5d[_0x5ad3('0x65')](_0x5ad3('0x3c'),'t',_0x5ad3('0x6e'));if(_0x400680['limit']){_0x508e5d[_0x5ad3('0x35')](_0x400680[_0x5ad3('0x35')]);}if(_0x400680[_0x5ad3('0x1e')]){_0x508e5d[_0x5ad3('0x1e')](_0x400680['offset']);}db[_0x5ad3('0x67')][_0x5ad3('0x2c')](_0x508e5d[_0x5ad3('0x68')](),_0x51925d)[_0x5ad3('0x24')](function(_0x6ecfa5){_0x6ecfa5[_0x5ad3('0x42')](function(_0xe06df1){if(_0xe06df1[_0x5ad3('0x6d')]){_0xe06df1[_0x5ad3('0x6f')]=[];_0xe06df1[_0x5ad3('0x6d')][_0x5ad3('0x70')](',')['forEach'](function(_0x3b7349){_0xe06df1[_0x5ad3('0x6f')][_0x5ad3('0x71')](_0x371194[_0x3b7349]);});}delete _0xe06df1[_0x5ad3('0x6d')];});_0x132947[_0x5ad3('0x72')]=_0x6ecfa5;return _0x132947;})['then'](respondWithFilteredResult(_0xb12efe,_0x400680))[_0x5ad3('0x73')](handleError(_0xb12efe,null));});});};exports['destroy']=function(_0x4853e8,_0x356698){return db[_0x5ad3('0x2a')][_0x5ad3('0x74')]({'where':{'id':_0x4853e8[_0x5ad3('0x75')]['id']}})[_0x5ad3('0x24')](handleEntityNotFound(_0x356698,null))[_0x5ad3('0x24')](removeEntity(_0x356698,null))[_0x5ad3('0x73')](handleError(_0x356698,null));};exports[_0x5ad3('0x76')]=function(_0x100d1a,_0xa9b4d1){return db[_0x5ad3('0x2a')][_0x5ad3('0x76')]()[_0x5ad3('0x24')](function(_0x5ea23f){for(var _0x3b0d71=0x0;_0x3b0d71\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','DESC','group','c.id','QueryTypes','SELECT','clone','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','cm_contact_has_tags','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','toString','keyBy','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','left_join','ct.CmContactId\x20=\x20c.id','Tags','TagIds','split','push','find','describe','cf_','columnName','displayName','CmCustomField','findAll','alias','type','body','get','mergeWith','tags','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','catch','each','duplicates','findOrCreate','spread','show','params','Tag','$and','omit','format','pickBy','startsWith','cf_%d','table','toParam','values','phone','getTags','rawAttributes','merge','options','setTags','ids','getHoppers','findOne','ContactId','include','rows','CmHopperHistory','includeAll','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!'];(function(_0x1a84fc,_0x32fb6f){var _0x178d3a=function(_0x50cadc){while(--_0x50cadc){_0x1a84fc['push'](_0x1a84fc['shift']());}};_0x178d3a(++_0x32fb6f);}(_0x9d65,0xfa));var _0x59d6=function(_0x2ef6eb,_0x1f09c4){_0x2ef6eb=_0x2ef6eb-0x0;var _0x5135c9=_0x9d65[_0x2ef6eb];return _0x5135c9;};'use strict';var pdf=require(_0x59d6('0x0'));var emlformat=require(_0x59d6('0x1'));var rimraf=require(_0x59d6('0x2'));var zipdir=require(_0x59d6('0x3'));var jsonpatch=require(_0x59d6('0x4'));var rp=require(_0x59d6('0x5'));var moment=require(_0x59d6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x59d6('0x7'));var util=require('util');var path=require(_0x59d6('0x8'));var sox=require(_0x59d6('0x9'));var csv=require(_0x59d6('0xa'));var ejs=require(_0x59d6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x59d6('0xc'));var jsforce=require(_0x59d6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x59d6('0xa'));var querystring=require(_0x59d6('0xe'));var Papa=require(_0x59d6('0xf'));var Redis=require(_0x59d6('0x10'));var authService=require(_0x59d6('0x11'));var qs=require(_0x59d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59d6('0x13'))('api');var utils=require(_0x59d6('0x14'));var config=require(_0x59d6('0x15'));var db=require(_0x59d6('0x16'))['db'];config[_0x59d6('0x17')]=_[_0x59d6('0x18')](config[_0x59d6('0x17')],{'host':_0x59d6('0x19'),'port':0x18eb});var socket=require(_0x59d6('0x1a'))(new Redis(config['redis']));require(_0x59d6('0x1b'))[_0x59d6('0x1c')](socket);function respondWithStatusCode(_0x19bf92,_0x4ff472){_0x4ff472=_0x4ff472||0xcc;return function(_0x28e240){if(_0x28e240){return _0x19bf92[_0x59d6('0x1d')](_0x4ff472);}return _0x19bf92[_0x59d6('0x1e')](_0x4ff472)[_0x59d6('0x1f')]();};}function respondWithResult(_0x4b003d,_0x3245be){_0x3245be=_0x3245be||0xc8;return function(_0xe38a0f){if(_0xe38a0f){return _0x4b003d['status'](_0x3245be)[_0x59d6('0x20')](_0xe38a0f);}};}function respondWithFilteredResult(_0x3a1347,_0x5a9844){return function(_0x20561b){if(_0x20561b){var _0x5babcf=_0x20561b[_0x59d6('0x21')],_0x3b66c8=_0x5a9844[_0x59d6('0x22')],_0x1f03bd=_0x5a9844[_0x59d6('0x22')]+_0x5a9844[_0x59d6('0x23')],_0x33e3ed;if(_0x1f03bd>=_0x5babcf){_0x1f03bd=_0x5babcf;_0x33e3ed=0xc8;}else{_0x33e3ed=0xce;}_0x3a1347[_0x59d6('0x1e')](_0x33e3ed);return _0x3a1347[_0x59d6('0x24')](_0x59d6('0x25'),_0x3b66c8+'-'+_0x1f03bd+'/'+_0x5babcf)['json'](_0x20561b);}return null;};}function patchUpdates(_0x290a04){return function(_0x2514c1){try{jsonpatch['apply'](_0x2514c1,_0x290a04,!![]);}catch(_0x325ad8){return BPromise[_0x59d6('0x26')](_0x325ad8);}return _0x2514c1[_0x59d6('0x27')]();};}function saveUpdates(_0x27e633,_0x2c1994){return function(_0x12ae73){if(_0x12ae73){return _0x12ae73[_0x59d6('0x28')](_0x27e633)['then'](function(_0x5eb554){return _0x5eb554;});}return null;};}function removeEntity(_0x1fe9bf,_0x25f31e){return function(_0x511882){if(_0x511882){return _0x511882[_0x59d6('0x29')]()['then'](function(){_0x1fe9bf['status'](0xcc)[_0x59d6('0x1f')]();});}};}function handleEntityNotFound(_0x199cb5,_0x511860){return function(_0x4578ce){if(!_0x4578ce){_0x199cb5[_0x59d6('0x1d')](0x194);}return _0x4578ce;};}function handleError(_0x1e470d,_0xeb4d34){_0xeb4d34=_0xeb4d34||0x1f4;return function(_0x56f296){logger[_0x59d6('0x2a')](_0x56f296['stack']);if(_0x56f296[_0x59d6('0x2b')]){delete _0x56f296[_0x59d6('0x2b')];}_0x1e470d[_0x59d6('0x1e')](_0xeb4d34)[_0x59d6('0x2c')](_0x56f296);};}exports[_0x59d6('0x2d')]=function(_0x227a21,_0x2ff2f8){var _0x5078df={},_0x44d399={},_0x1c2098={'count':0x0,'rows':[]};return db[_0x59d6('0x2e')]['describe']()[_0x59d6('0x2f')](function(_0x49fcc5){_0x44d399['model']=_[_0x59d6('0x30')](_0x49fcc5);_0x44d399['query']=_[_0x59d6('0x30')](_0x227a21[_0x59d6('0x31')]);_0x44d399['filters']=_['intersection'](_0x44d399['model'],_0x44d399[_0x59d6('0x31')]);_0x5078df['attributes']=_[_0x59d6('0x32')](_0x44d399[_0x59d6('0x33')],qs[_0x59d6('0x34')](_0x227a21[_0x59d6('0x31')][_0x59d6('0x34')]));_0x5078df[_0x59d6('0x35')]=_0x5078df[_0x59d6('0x35')]['length']?_0x5078df[_0x59d6('0x35')]:_0x44d399[_0x59d6('0x33')];if(!_0x227a21[_0x59d6('0x31')][_0x59d6('0x36')](_0x59d6('0x37'))){_0x5078df['limit']=qs['limit'](_0x227a21[_0x59d6('0x31')][_0x59d6('0x23')]);_0x5078df[_0x59d6('0x22')]=qs['offset'](_0x227a21[_0x59d6('0x31')][_0x59d6('0x22')]);}_0x5078df[_0x59d6('0x38')]=qs[_0x59d6('0x39')](_0x227a21[_0x59d6('0x31')][_0x59d6('0x39')]);_0x5078df[_0x59d6('0x3a')]=qs['filters'](_[_0x59d6('0x3b')](_0x227a21[_0x59d6('0x31')],_0x44d399[_0x59d6('0x3c')]));var _0x22c992=[];var _0x46796e=squel[_0x59d6('0x3d')]()['field']('id')[_0x59d6('0x3e')](_0x59d6('0x2b'))['field']('color')[_0x59d6('0x3f')](_0x59d6('0x40'));var _0x285b81=squel['select']()[_0x59d6('0x3f')](_0x59d6('0x41'),'c')[_0x59d6('0x3a')](_0x59d6('0x42'));var _0x40206b=squel[_0x59d6('0x43')]();if(_0x227a21[_0x59d6('0x31')][_0x59d6('0x44')]){var _0x9da70e=JSON[_0x59d6('0x45')](_0x227a21[_0x59d6('0x31')][_0x59d6('0x44')]);_[_0x59d6('0x30')](_0x9da70e)[_0x59d6('0x46')](function(_0x2bf7f9){var _0x1faa28=_0x9da70e[_0x2bf7f9];switch(_0x1faa28[_0x59d6('0x47')]){case'IS':if(_[_0x59d6('0x48')](_0x1faa28['value'])&&_0x1faa28[_0x59d6('0x49')][_0x59d6('0x4a')]>0x1){_0x40206b[_0x59d6('0x4b')](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+'\x20IN\x20?',_0x1faa28[_0x59d6('0x49')]);}else{_0x40206b[_0x59d6('0x4b')](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+_0x59d6('0x4d'),_0x1faa28[_0x59d6('0x49')][0x0]);}break;case'=':_0x40206b['and'](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+'\x20=\x20?',_0x1faa28['value']);break;case _0x59d6('0x4e'):_0x40206b[_0x59d6('0x4b')](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+'\x20LIKE\x20?','%'+_0x1faa28[_0x59d6('0x49')]+'%');break;case'>':_0x40206b[_0x59d6('0x4b')](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+_0x59d6('0x4f'),_0x1faa28[_0x59d6('0x49')]);break;case'<':_0x40206b[_0x59d6('0x4b')](_0x1faa28[_0x59d6('0x4c')]+'.'+_0x2bf7f9+_0x59d6('0x50'),_0x1faa28['value']);break;}});}else{var _0x4a978c=_(Object['keys'](_0x227a21['query']))[_0x59d6('0x51')](function(_0x46a071){return _0x49fcc5[_0x59d6('0x36')](_0x46a071)?_0x46a071:undefined;})[_0x59d6('0x52')](function(_0x5015e8){return!_[_0x59d6('0x53')](_0x5015e8);})[_0x59d6('0x49')]();if(!_[_0x59d6('0x54')](_0x4a978c)){_0x4a978c[_0x59d6('0x46')](function(_0x4305a2){if(_0x4305a2===_0x59d6('0x55')){_0x285b81[_0x59d6('0x3a')](_0x59d6('0x56'),[]['concat'](_0x227a21[_0x59d6('0x31')][_0x4305a2]));}else{_0x285b81['where']('c.'+_0x4305a2+_0x59d6('0x4d'),_0x227a21[_0x59d6('0x31')][_0x4305a2]);}});}if(_0x227a21[_0x59d6('0x31')][_0x59d6('0x52')]){var _0x5397fb=_0x227a21[_0x59d6('0x31')][_0x59d6('0x52')][_0x59d6('0x57')]('\x5c','\x5c\x5c')[_0x59d6('0x57')]('\x27\x27',_0x59d6('0x58'));if(qs[_0x59d6('0x59')](_0x5397fb)){_0x40206b['or'](_0x59d6('0x5a'),_0x5397fb+'%');_0x40206b['or'](_0x59d6('0x5b'),_0x5397fb+'%');_0x40206b['or'](_0x59d6('0x5c'),_0x5397fb+'%');_0x40206b['or'](_0x59d6('0x5d'),_0x5397fb+'%');}else if(qs[_0x59d6('0x5e')](_0x5397fb)){_0x40206b['or']('c.email\x20LIKE\x20?',_0x5397fb+'%');}else{_0x40206b['or'](_0x59d6('0x5f'),_0x5397fb+'%');_0x40206b['or'](_0x59d6('0x60'),_0x5397fb+'%');_0x40206b['or']('c.lastName\x20LIKE\x20?',_0x5397fb+'%');}}}_0x285b81[_0x59d6('0x3a')](_0x40206b);if(_0x5078df[_0x59d6('0x38')]){_0x5078df['order'][_0x59d6('0x46')](function(_0x1f0dc4){_0x285b81[_0x59d6('0x38')]('c.'+_0x1f0dc4[0x0],_0x1f0dc4[0x1]===_0x59d6('0x61')?![]:!![]);});}_0x285b81[_0x59d6('0x62')](_0x59d6('0x63'));var _0x4b692c={'type':db['Sequelize'][_0x59d6('0x64')][_0x59d6('0x65')],'raw':!![]};var _0x146c6f=_0x285b81[_0x59d6('0x66')]()[_0x59d6('0x3e')](_0x59d6('0x67'));if(!_0x227a21[_0x59d6('0x31')][_0x59d6('0x44')]){if(_0x227a21['query'][_0x59d6('0x68')]){var _0x24199e=_['isArray'](_0x227a21[_0x59d6('0x31')]['tag'])?_0x227a21[_0x59d6('0x31')][_0x59d6('0x68')]:new Array(_0x227a21[_0x59d6('0x31')][_0x59d6('0x68')]);var _0x30da6a=squel['expr']();_0x24199e[_0x59d6('0x46')](function(_0x55a2a0){_0x30da6a['or'](_0x59d6('0x69'),'%,'+_0x55a2a0+',%');});_0x285b81[_0x59d6('0x6a')](_0x30da6a);_0x146c6f['left_join'](_0x59d6('0x6b'),'ct','ct.CmContactId\x20=\x20c.id');_0x146c6f['left_join'](_0x59d6('0x40'),'t',_0x59d6('0x6c'));_0x146c6f['where'](_0x59d6('0x6d'),_0x24199e);}}db[_0x59d6('0x6e')]['query'](_0x46796e[_0x59d6('0x6f')](),_0x4b692c)[_0x59d6('0x2f')](function(_0x212ea4){_0x22c992=_[_0x59d6('0x70')](_0x212ea4,'id');return db[_0x59d6('0x6e')]['query'](_0x146c6f[_0x59d6('0x6f')](),_0x4b692c);})[_0x59d6('0x2f')](function(_0x33b15c){_0x1c2098[_0x59d6('0x21')]=_0x33b15c['length'];_0x4b692c=_['merge'](_0x4b692c,{'model':db[_0x59d6('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x285b81['field'](_0x59d6('0x71'));_0x285b81[_0x59d6('0x3e')](_0x59d6('0x72'),'TagIds');_0x285b81[_0x59d6('0x73')]('cm_contact_has_tags','ct',_0x59d6('0x74'));_0x285b81['left_join']('tools_tags','t',_0x59d6('0x6c'));if(_0x5078df[_0x59d6('0x23')]){_0x285b81[_0x59d6('0x23')](_0x5078df[_0x59d6('0x23')]);}if(_0x5078df[_0x59d6('0x22')]){_0x285b81[_0x59d6('0x22')](_0x5078df['offset']);}db[_0x59d6('0x6e')][_0x59d6('0x31')](_0x285b81[_0x59d6('0x6f')](),_0x4b692c)[_0x59d6('0x2f')](function(_0xe2b8f6){_0xe2b8f6[_0x59d6('0x46')](function(_0x476b61){if(_0x476b61['TagIds']){_0x476b61[_0x59d6('0x75')]=[];_0x476b61[_0x59d6('0x76')][_0x59d6('0x77')](',')[_0x59d6('0x46')](function(_0x513f3b){_0x476b61['Tags'][_0x59d6('0x78')](_0x22c992[_0x513f3b]);});}delete _0x476b61[_0x59d6('0x76')];});_0x1c2098['rows']=_0xe2b8f6;return _0x1c2098;})['then'](respondWithFilteredResult(_0x2ff2f8,_0x5078df))['catch'](handleError(_0x2ff2f8,null));});});};exports[_0x59d6('0x29')]=function(_0x5a68bc,_0x252a16){return db[_0x59d6('0x2e')][_0x59d6('0x79')]({'where':{'id':_0x5a68bc['params']['id']}})[_0x59d6('0x2f')](handleEntityNotFound(_0x252a16,null))[_0x59d6('0x2f')](removeEntity(_0x252a16,null))['catch'](handleError(_0x252a16,null));};exports[_0x59d6('0x7a')]=function(_0x79fc07,_0x543792){return db[_0x59d6('0x2e')]['describe']()[_0x59d6('0x2f')](function(_0x6f9e6){for(var _0x15dbc1=0x0;_0x15dbc1{}\s\\|]/g,'-');_0x364096(null,util['format'](_0xc9fb('0x21'),path[_0xc9fb('0x22')](_0x10adb6['originalname'],path[_0xc9fb('0x23')](_0x10adb6[_0xc9fb('0x1f')])),Date['now'](),path[_0xc9fb('0x23')](_0x10adb6[_0xc9fb('0x1f')])));}})});router['post'](_0xc9fb('0x24'),upload[_0xc9fb('0x25')](_0xc9fb('0x26')),controller[_0xc9fb('0x27')]);var upload=multer({'storage':multer[_0xc9fb('0x28')]({'destination':function(_0x4eddca,_0x4c0b40,_0x66b940){_0x66b940(null,path[_0xc9fb('0x1d')](config['root'],'server/files/tmp'));},'filename':function(_0x374a58,_0x56b9f4,_0x8654b9){_0x56b9f4[_0xc9fb('0x1f')]=_0x56b9f4['originalname'][_0xc9fb('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8654b9(null,util[_0xc9fb('0x29')](_0xc9fb('0x21'),path[_0xc9fb('0x22')](_0x56b9f4[_0xc9fb('0x1f')],path[_0xc9fb('0x23')](_0x56b9f4[_0xc9fb('0x1f')])),Date[_0xc9fb('0x2a')](),path['extname'](_0x56b9f4['originalname'])));}})});router[_0xc9fb('0x18')]('/upload',upload[_0xc9fb('0x25')](_0xc9fb('0x26')),controller['upload']);router['post'](_0xc9fb('0x2b'),auth[_0xc9fb('0xa')](),controller[_0xc9fb('0x2c')]);router[_0xc9fb('0x2d')](_0xc9fb('0xe'),auth[_0xc9fb('0xa')](),controller[_0xc9fb('0x2e')]);router[_0xc9fb('0x2f')]('/:id',auth[_0xc9fb('0xa')](),controller[_0xc9fb('0x30')]);module['exports']=router; \ No newline at end of file +var _0x34be=['../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','/:id','show','getTags','getHoppers','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','extname','/csv','single','file','uploadCsv','join','/upload','upload','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x299240,_0x453006){var _0x44b948=function(_0x299d08){while(--_0x299d08){_0x299240['push'](_0x299240['shift']());}};_0x44b948(++_0x453006);}(_0x34be,0xe8));var _0xe34b=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x34be[_0x1abb09];return _0xea1c07;};'use strict';var multer=require(_0xe34b('0x0'));var util=require(_0xe34b('0x1'));var path=require(_0xe34b('0x2'));var timeout=require(_0xe34b('0x3'));var express=require(_0xe34b('0x4'));var router=express[_0xe34b('0x5')]();var auth=require(_0xe34b('0x6'));var interaction=require(_0xe34b('0x7'));var config=require(_0xe34b('0x8'));var controller=require(_0xe34b('0x9'));router[_0xe34b('0xa')]('/',auth['isAuthenticated'](),controller[_0xe34b('0xb')]);router[_0xe34b('0xa')]('/describe',auth[_0xe34b('0xc')](),controller[_0xe34b('0xd')]);router[_0xe34b('0xa')](_0xe34b('0xe'),auth['isAuthenticated'](),controller[_0xe34b('0xf')]);router[_0xe34b('0xa')]('/:id/tags',auth[_0xe34b('0xc')](),controller[_0xe34b('0x10')]);router[_0xe34b('0xa')]('/:id/hoppers',auth[_0xe34b('0xc')](),controller[_0xe34b('0x11')]);router[_0xe34b('0xa')]('/:id/hopper_histories',auth[_0xe34b('0xc')](),controller[_0xe34b('0x12')]);router[_0xe34b('0xa')]('/:id/hopper_finals',auth[_0xe34b('0xc')](),controller[_0xe34b('0x13')]);router['get'](_0xe34b('0x14'),auth[_0xe34b('0xc')](),controller[_0xe34b('0x15')]);router[_0xe34b('0x16')]('/merge',auth[_0xe34b('0xc')](),controller['merge']);router[_0xe34b('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe34b('0x17'),auth[_0xe34b('0xc')](),controller[_0xe34b('0x18')]);router[_0xe34b('0x16')]('/:id/tags',auth[_0xe34b('0xc')](),controller[_0xe34b('0x19')]);var upload=multer({'storage':multer[_0xe34b('0x1a')]({'destination':function(_0x204da5,_0x32e015,_0x343382){_0x343382(null,path['join'](config[_0xe34b('0x1b')],_0xe34b('0x1c')));},'filename':function(_0x5261db,_0x321e49,_0x1d0fcf){_0x321e49[_0xe34b('0x1d')]=_0x321e49['originalname'][_0xe34b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d0fcf(null,util[_0xe34b('0x1f')](_0xe34b('0x20'),path[_0xe34b('0x21')](_0x321e49[_0xe34b('0x1d')],path['extname'](_0x321e49[_0xe34b('0x1d')])),Date[_0xe34b('0x22')](),path[_0xe34b('0x23')](_0x321e49[_0xe34b('0x1d')])));}})});router['post'](_0xe34b('0x24'),upload[_0xe34b('0x25')](_0xe34b('0x26')),controller[_0xe34b('0x27')]);var upload=multer({'storage':multer[_0xe34b('0x1a')]({'destination':function(_0x42cff6,_0x41a9cb,_0x16607b){_0x16607b(null,path[_0xe34b('0x28')](config[_0xe34b('0x1b')],'server/files/tmp'));},'filename':function(_0x1f0129,_0x5e986e,_0x2ba84a){_0x5e986e['originalname']=_0x5e986e['originalname'][_0xe34b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ba84a(null,util['format']('%s-%s%s',path[_0xe34b('0x21')](_0x5e986e[_0xe34b('0x1d')],path[_0xe34b('0x23')](_0x5e986e[_0xe34b('0x1d')])),Date['now'](),path[_0xe34b('0x23')](_0x5e986e[_0xe34b('0x1d')])));}})});router[_0xe34b('0x16')](_0xe34b('0x29'),upload['single'](_0xe34b('0x26')),controller[_0xe34b('0x2a')]);router[_0xe34b('0x16')]('/upload/:id',auth['isAuthenticated'](),controller['import']);router[_0xe34b('0x2b')](_0xe34b('0xe'),auth['isAuthenticated'](),controller[_0xe34b('0x2c')]);router[_0xe34b('0x2d')]('/:id',auth[_0xe34b('0xc')](),controller[_0xe34b('0x2e')]);module[_0xe34b('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 59de6b2..c0bb0fe 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 _0x8335=['name','STRING','TEXT','long','type','select','parse','isArray','values','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x8335,0x119));var _0x5833=function(_0x39790d,_0x47bfc8){_0x39790d=_0x39790d-0x0;var _0x4ed685=_0x8335[_0x39790d];return _0x4ed685;};'use strict';var Sequelize=require(_0x5833('0x0'));var _=require(_0x5833('0x1'));module[_0x5833('0x2')]={'name':{'type':Sequelize[_0x5833('0x3')],'get':function(_0x4ba546){return this[_0x5833('0x4')](_0x5833('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3ef3a1){this[_0x5833('0x6')](_0x5833('0x5'),_0x3ef3a1?_0x3ef3a1:this[_0x5833('0x4')](_0x5833('0x7')));}},'type':{'type':Sequelize[_0x5833('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x5833('0x9')](_0x5833('0xa')),'get':function(){if(this[_0x5833('0x4')](_0x5833('0xb'))===_0x5833('0xc')){return JSON[_0x5833('0xd')](this[_0x5833('0x4')]('values'));}else{return this[_0x5833('0x4')]('values');}},'set':function(_0x2a5792){if(Array[_0x5833('0xe')](_0x2a5792)){this[_0x5833('0x6')](_0x5833('0xf'),JSON[_0x5833('0x10')](_0x2a5792));}else{this[_0x5833('0x6')]('values',_0x2a5792);}}},'required':{'type':Sequelize[_0x5833('0x11')],'defaultValue':![]}}; \ No newline at end of file +var _0xf202=['long','getDataValue','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','name','TEXT'];(function(_0x178222,_0x273ec5){var _0x455666=function(_0x1f6c0c){while(--_0x1f6c0c){_0x178222['push'](_0x178222['shift']());}};_0x455666(++_0x273ec5);}(_0xf202,0xab));var _0x2f20=function(_0x67f6de,_0x521c7f){_0x67f6de=_0x67f6de-0x0;var _0x1f7b53=_0xf202[_0x67f6de];return _0x1f7b53;};'use strict';var Sequelize=require(_0x2f20('0x0'));var _=require(_0x2f20('0x1'));module[_0x2f20('0x2')]={'name':{'type':Sequelize[_0x2f20('0x3')],'get':function(_0x18e431){return this['getDataValue'](_0x2f20('0x4'));}},'alias':{'type':Sequelize[_0x2f20('0x5')],'allowNull':![],'set':function(_0x7b54fe){this[_0x2f20('0x6')]('alias',_0x7b54fe?_0x7b54fe:this['getDataValue'](_0x2f20('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x2f20('0x8')](_0x2f20('0x9')),'get':function(){if(this[_0x2f20('0xa')](_0x2f20('0xb'))===_0x2f20('0xc')){return JSON[_0x2f20('0xd')](this[_0x2f20('0xa')](_0x2f20('0xe')));}else{return this['getDataValue']('values');}},'set':function(_0x182a51){if(Array[_0x2f20('0xf')](_0x182a51)){this[_0x2f20('0x6')](_0x2f20('0xe'),JSON[_0x2f20('0x10')](_0x182a51));}else{this[_0x2f20('0x6')](_0x2f20('0xe'),_0x182a51);}}},'required':{'type':Sequelize[_0x2f20('0x11')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 355caaf..dda3d5c 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 _0xb10b=['ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','CmCustomField','rawAttributes','differenceBy','keys','name','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','length','merge','options','find','create','transaction','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d8b1d,_0x1c0f88){_0x3d8b1d=_0x3d8b1d-0x0;var _0x2bb57a=_0xb10b[_0x3d8b1d];return _0x2bb57a;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_[_0xbb10('0x2c')](_0x1acce9),[_0xbb10('0x2d')]);_0x6ed43b[_0xbb10('0x2e')]=_[_0xbb10('0x2c')](_0x4e25ff[_0xbb10('0x2e')]);_0x6ed43b['filters']=_[_0xbb10('0x2f')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2e')]);_0x24d586['attributes']=_[_0xbb10('0x2f')](_0x6ed43b[_0xbb10('0x30')],qs[_0xbb10('0x31')](_0x4e25ff['query']['fields']));_0x24d586[_0xbb10('0x32')]=_0x24d586[_0xbb10('0x32')]['length']?_0x24d586[_0xbb10('0x32')]:_0x6ed43b[_0xbb10('0x30')];if(!_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x33')](_0xbb10('0x34'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff['query'][_0xbb10('0x1d')]);_0x24d586[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x35')]=qs[_0xbb10('0x36')](_0x4e25ff[_0xbb10('0x2e')][_0xbb10('0x36')]);_0x24d586['where']=qs[_0xbb10('0x37')](_[_0xbb10('0x38')](_0x4e25ff[_0xbb10('0x2e')],_0x6ed43b[_0xbb10('0x37')]));if(_0x4e25ff['query'][_0xbb10('0x39')]){_0x24d586['where']=_['merge'](_0x24d586[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3b')](_0x1acce9,function(_0x26e76a){if(_0x26e76a[_0xbb10('0x3c')][_0xbb10('0x3d')]!==_0xbb10('0x3e')){var _0x547062={};_0x547062[_0x26e76a[_0xbb10('0x3f')]]={'$like':'%'+_0x4e25ff[_0xbb10('0x2e')]['filter']+'%'};return _0x547062;}})});}_0x24d586=_['merge']({},_0x24d586,_0x4e25ff['options']);var _0x31bee3={'where':_0x24d586[_0xbb10('0x3a')]};return db[_0xbb10('0x29')]['count'](_0x31bee3)[_0xbb10('0x25')](function(_0x3e8538){_0x1d5e95[_0xbb10('0x40')]=_0x3e8538;if(_0x4e25ff['query'][_0xbb10('0x41')]){_0x24d586[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x43')](_0x24d586);})['then'](function(_0xd238e9){_0x1d5e95[_0xbb10('0x44')]=_0xd238e9;return _0x1d5e95;})['then'](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x45')](handleError(_0x2fdde9,null));};exports[_0xbb10('0x46')]=function(_0x44d6ae,_0x3a9934){var _0x2dd35a={'raw':!![],'where':{'id':_0x44d6ae['params']['id']}},_0x185a52={};_0x185a52[_0xbb10('0x30')]=_[_0xbb10('0x2c')](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x185a52['query']=_[_0xbb10('0x2c')](_0x44d6ae[_0xbb10('0x2e')]);_0x185a52[_0xbb10('0x37')]=_[_0xbb10('0x2f')](_0x185a52['model'],_0x185a52[_0xbb10('0x2e')]);_0x2dd35a[_0xbb10('0x32')]=_['intersection'](_0x185a52['model'],qs[_0xbb10('0x31')](_0x44d6ae['query'][_0xbb10('0x31')]));_0x2dd35a[_0xbb10('0x32')]=_0x2dd35a['attributes'][_0xbb10('0x47')]?_0x2dd35a[_0xbb10('0x32')]:_0x185a52[_0xbb10('0x30')];if(_0x44d6ae['query'][_0xbb10('0x41')]){_0x2dd35a[_0xbb10('0x42')]=[{'all':!![]}];}_0x2dd35a=_[_0xbb10('0x48')]({},_0x2dd35a,_0x44d6ae[_0xbb10('0x49')]);return db[_0xbb10('0x29')][_0xbb10('0x4a')](_0x2dd35a)[_0xbb10('0x25')](handleEntityNotFound(_0x3a9934,null))[_0xbb10('0x25')](respondWithResult(_0x3a9934,null))[_0xbb10('0x45')](handleError(_0x3a9934,null));};exports[_0xbb10('0x4b')]=function(_0x197871,_0x1eadd2){return db['sequelize'][_0xbb10('0x4c')](function(_0x41bbf8){return db['CmCustomField'][_0xbb10('0x4b')](_0x197871[_0xbb10('0x4d')],{'transaction':_0x41bbf8});})[_0xbb10('0x25')](respondWithResult(_0x1eadd2,0xc9))[_0xbb10('0x45')](handleError(_0x1eadd2,null));};exports[_0xbb10('0x23')]=function(_0x39f0de,_0x3e06b0){if(_0x39f0de['body']['id']){delete _0x39f0de['body']['id'];}return db[_0xbb10('0x29')][_0xbb10('0x4a')]({'where':{'id':_0x39f0de[_0xbb10('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e06b0,null))['then'](saveUpdates(_0x39f0de[_0xbb10('0x4d')],null))[_0xbb10('0x25')](respondWithResult(_0x3e06b0,null))[_0xbb10('0x45')](handleError(_0x3e06b0,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x29')][_0xbb10('0x4a')]({'where':{'id':_0x10159b[_0xbb10('0x4e')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));}; \ No newline at end of file +var _0xa9e0=['rows','catch','params','includeAll','include','find','sequelize','transaction','create','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmCustomField','rawAttributes','model','differenceBy','keys','name','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll'];(function(_0x20ea1b,_0x14b613){var _0x449b77=function(_0x193535){while(--_0x193535){_0x20ea1b['push'](_0x20ea1b['shift']());}};_0x449b77(++_0x14b613);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':!![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['CmCustomField'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x41')][_0x0a9e('0x42')](function(_0x2e8caf){return db[_0x0a9e('0x24')][_0x0a9e('0x43')](_0x117c99[_0x0a9e('0x44')],{'transaction':_0x2e8caf});})['then'](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports['update']=function(_0x473dc8,_0x476688){if(_0x473dc8[_0x0a9e('0x44')]['id']){delete _0x473dc8['body']['id'];}return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x473dc8[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x476688,null))[_0x0a9e('0x1f')](saveUpdates(_0x473dc8[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports[_0x0a9e('0x45')]=function(_0x1bde3c,_0x1b5e80){return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x1bde3c[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1b5e80,null))[_0x0a9e('0x1f')](removeEntity(_0x1b5e80,null))[_0x0a9e('0x3c')](handleError(_0x1b5e80,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a943a96..1ccc9cd 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 _0x8b66=['type','text','BOOLEAN','defaultValue','addColumn','format','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','get','TEXT','transaction'];(function(_0x46702d,_0x465dd6){var _0x6d2f37=function(_0x10fc08){while(--_0x10fc08){_0x46702d['push'](_0x46702d['shift']());}};_0x6d2f37(++_0x465dd6);}(_0x8b66,0xae));var _0x68b6=function(_0x697a85,_0x238db2){_0x697a85=_0x697a85-0x0;var _0x4a6ba9=_0x8b66[_0x697a85];return _0x4a6ba9;};'use strict';var _=require('lodash');var util=require(_0x68b6('0x0'));var logger=require(_0x68b6('0x1'))(_0x68b6('0x2'));var moment=require('moment');var BPromise=require(_0x68b6('0x3'));var rp=require(_0x68b6('0x4'));var fs=require('fs');var path=require(_0x68b6('0x5'));var rimraf=require(_0x68b6('0x6'));var config=require('../../config/environment');var attributes=require(_0x68b6('0x7'));module[_0x68b6('0x8')]=function(_0x302f72,_0x76fd48){return _0x302f72[_0x68b6('0x9')](_0x68b6('0xa'),attributes,{'tableName':_0x68b6('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x44b5e4,_0x1f0dd2,_0x2d4c39){var _0x27ed09=_0x44b5e4[_0x68b6('0xc')]({'plain':!![]});var _0x3265a0={'type':_0x76fd48[_0x68b6('0xd')],'transaction':_0x1f0dd2[_0x68b6('0xe')]};switch(_0x27ed09[_0x68b6('0xf')]){case _0x68b6('0x10'):_0x3265a0['type']=_0x76fd48[_0x68b6('0xd')];break;case'number':_0x3265a0['type']=_0x76fd48['INTEGER'];break;case'switch':_0x3265a0[_0x68b6('0xf')]=_0x76fd48[_0x68b6('0x11')];_0x3265a0[_0x68b6('0x12')]=![];break;}_0x302f72['queryInterface'][_0x68b6('0x13')]('cm_contacts',util[_0x68b6('0x14')]('cf_%d',_0x27ed09['id']),_0x3265a0);_0x2d4c39();}}});}; \ No newline at end of file +var _0x982f=['text','type','number','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','lodash','util','../../config/logger','api','moment','path','../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','get','TEXT','transaction'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x982f,0x1bf));var _0xf982=function(_0x206cce,_0x21c146){_0x206cce=_0x206cce-0x0;var _0x432956=_0x982f[_0x206cce];return _0x432956;};'use strict';var _=require(_0xf982('0x0'));var util=require(_0xf982('0x1'));var logger=require(_0xf982('0x2'))(_0xf982('0x3'));var moment=require(_0xf982('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf982('0x5'));var rimraf=require('rimraf');var config=require(_0xf982('0x6'));var attributes=require(_0xf982('0x7'));module[_0xf982('0x8')]=function(_0x3065ac,_0x361736){return _0x3065ac['define']('CmCustomField',attributes,{'tableName':_0xf982('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x344da1,_0x5d33d7,_0x25d79f){var _0x1f4e56=_0x344da1[_0xf982('0xa')]({'plain':!![]});var _0x555134={'type':_0x361736[_0xf982('0xb')],'transaction':_0x5d33d7[_0xf982('0xc')]};switch(_0x1f4e56['type']){case _0xf982('0xd'):_0x555134[_0xf982('0xe')]=_0x361736[_0xf982('0xb')];break;case _0xf982('0xf'):_0x555134[_0xf982('0xe')]=_0x361736[_0xf982('0x10')];break;case _0xf982('0x11'):_0x555134[_0xf982('0xe')]=_0x361736[_0xf982('0x12')];_0x555134[_0xf982('0x13')]=![];break;}_0x3065ac['queryInterface']['addColumn'](_0xf982('0x14'),util[_0xf982('0x15')](_0xf982('0x16'),_0x1f4e56['id']),_0x555134);_0x25d79f();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index a130345..a8128b4 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 _0xc868=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message'];(function(_0x508d2c,_0x59d989){var _0x10ec40=function(_0x475c3e){while(--_0x475c3e){_0x508d2c['push'](_0x508d2c['shift']());}};_0x10ec40(++_0x59d989);}(_0xc868,0x172));var _0x8c86=function(_0x29f94d,_0x463245){_0x29f94d=_0x29f94d-0x0;var _0x2d4fca=_0xc868[_0x29f94d];return _0x2d4fca;};'use strict';var _=require(_0x8c86('0x0'));var util=require(_0x8c86('0x1'));var moment=require(_0x8c86('0x2'));var BPromise=require(_0x8c86('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c86('0x4'))['db'];var utils=require(_0x8c86('0x5'));var logger=require(_0x8c86('0x6'))(_0x8c86('0x7'));var config=require(_0x8c86('0x8'));var jayson=require(_0x8c86('0x9'));var client=jayson[_0x8c86('0xa')][_0x8c86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6ad8b0,_0x5e4569,_0x458f2e){return new BPromise(function(_0x2dc68b,_0x12b253){return client['request'](_0x6ad8b0,_0x458f2e)['then'](function(_0x305e9f){logger[_0x8c86('0xc')]('CmCustomField,\x20%s,\x20%s',_0x5e4569,'request\x20sent');logger[_0x8c86('0xd')](_0x8c86('0xe'),_0x5e4569,_0x8c86('0xf'),JSON[_0x8c86('0x10')](_0x305e9f));if(_0x305e9f[_0x8c86('0x11')]){if(_0x305e9f[_0x8c86('0x11')][_0x8c86('0x12')]===0x1f4){logger[_0x8c86('0x11')](_0x8c86('0x13'),_0x5e4569,_0x305e9f[_0x8c86('0x11')][_0x8c86('0x14')]);return _0x12b253(_0x305e9f[_0x8c86('0x11')][_0x8c86('0x14')]);}logger[_0x8c86('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5e4569,_0x305e9f['error']['message']);return _0x2dc68b(_0x305e9f[_0x8c86('0x11')][_0x8c86('0x14')]);}else{logger[_0x8c86('0xc')](_0x8c86('0x13'),_0x5e4569,'request\x20sent');_0x2dc68b(_0x305e9f[_0x8c86('0x15')]['message']);}})[_0x8c86('0x16')](function(_0x4cc808){logger[_0x8c86('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5e4569,_0x4cc808);_0x12b253(_0x4cc808);});});} \ No newline at end of file +var _0x6baf=['stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x3c6829,_0x5f152d){var _0x186023=function(_0x23594b){while(--_0x23594b){_0x3c6829['push'](_0x3c6829['shift']());}};_0x186023(++_0x5f152d);}(_0x6baf,0x16b));var _0xf6ba=function(_0x3f8fa2,_0x524a4){_0x3f8fa2=_0x3f8fa2-0x0;var _0x4dbd6c=_0x6baf[_0x3f8fa2];return _0x4dbd6c;};'use strict';var _=require(_0xf6ba('0x0'));var util=require(_0xf6ba('0x1'));var moment=require(_0xf6ba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6ba('0x3'));var db=require(_0xf6ba('0x4'))['db'];var utils=require(_0xf6ba('0x5'));var logger=require(_0xf6ba('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6ba('0x7'));var client=jayson[_0xf6ba('0x8')][_0xf6ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f74a0,_0x333130,_0x2c564b){return new BPromise(function(_0x17d4c6,_0x50cb49){return client['request'](_0x2f74a0,_0x2c564b)['then'](function(_0x93a309){logger[_0xf6ba('0xa')](_0xf6ba('0xb'),_0x333130,_0xf6ba('0xc'));logger[_0xf6ba('0xd')](_0xf6ba('0xe'),_0x333130,_0xf6ba('0xc'),JSON[_0xf6ba('0xf')](_0x93a309));if(_0x93a309[_0xf6ba('0x10')]){if(_0x93a309[_0xf6ba('0x10')][_0xf6ba('0x11')]===0x1f4){logger['error'](_0xf6ba('0xb'),_0x333130,_0x93a309[_0xf6ba('0x10')][_0xf6ba('0x12')]);return _0x50cb49(_0x93a309[_0xf6ba('0x10')][_0xf6ba('0x12')]);}logger[_0xf6ba('0x10')](_0xf6ba('0xb'),_0x333130,_0x93a309[_0xf6ba('0x10')]['message']);return _0x17d4c6(_0x93a309[_0xf6ba('0x10')][_0xf6ba('0x12')]);}else{logger[_0xf6ba('0xa')](_0xf6ba('0xb'),_0x333130,_0xf6ba('0xc'));_0x17d4c6(_0x93a309[_0xf6ba('0x13')][_0xf6ba('0x12')]);}})[_0xf6ba('0x14')](function(_0x20a56e){logger['error'](_0xf6ba('0xb'),_0x333130,_0x20a56e);_0x50cb49(_0x20a56e);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 32a0d97..2378635 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 _0xd140=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xd140,0x76));var _0x0d14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd140[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0d14('0x0'));var util=require(_0x0d14('0x1'));var path=require(_0x0d14('0x2'));var timeout=require(_0x0d14('0x3'));var express=require(_0x0d14('0x4'));var router=express[_0x0d14('0x5')]();var auth=require(_0x0d14('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0d14('0x7'));var controller=require(_0x0d14('0x8'));router[_0x0d14('0x9')]('/',auth[_0x0d14('0xa')](),controller[_0x0d14('0xb')]);router[_0x0d14('0x9')]('/:id',auth[_0x0d14('0xa')](),controller[_0x0d14('0xc')]);router[_0x0d14('0xd')]('/',auth[_0x0d14('0xa')](),controller[_0x0d14('0xe')]);router[_0x0d14('0xf')](_0x0d14('0x10'),auth[_0x0d14('0xa')](),controller[_0x0d14('0x11')]);router[_0x0d14('0x12')]('/:id',auth[_0x0d14('0xa')](),controller[_0x0d14('0x13')]);module['exports']=router; \ No newline at end of file +var _0xec7c=['../../components/interaction/service','./cmCustomField.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','exports','path','express','Router'];(function(_0xa7ad07,_0x2e3da7){var _0x22b144=function(_0x282edf){while(--_0x282edf){_0xa7ad07['push'](_0xa7ad07['shift']());}};_0x22b144(++_0x2e3da7);}(_0xec7c,0xfc));var _0xcec7=function(_0x2d138a,_0x38524c){_0x2d138a=_0x2d138a-0x0;var _0x1c13e9=_0xec7c[_0x2d138a];return _0x1c13e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcec7('0x0'));var timeout=require('connect-timeout');var express=require(_0xcec7('0x1'));var router=express[_0xcec7('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xcec7('0x3'));var config=require('../../config/environment');var controller=require(_0xcec7('0x4'));router['get']('/',auth[_0xcec7('0x5')](),controller['index']);router[_0xcec7('0x6')](_0xcec7('0x7'),auth[_0xcec7('0x5')](),controller[_0xcec7('0x8')]);router[_0xcec7('0x9')]('/',auth[_0xcec7('0x5')](),controller[_0xcec7('0xa')]);router[_0xcec7('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcec7('0xc')](_0xcec7('0x7'),auth[_0xcec7('0x5')](),controller[_0xcec7('0xd')]);module[_0xcec7('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e20ad45..de57ca9 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 _0xe1e8=['exports','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x2847d0,_0x10a787){var _0x1cc209=function(_0x3863ff){while(--_0x3863ff){_0x2847d0['push'](_0x2847d0['shift']());}};_0x1cc209(++_0x10a787);}(_0xe1e8,0x120));var _0x8e1e=function(_0x1156ca,_0x504015){_0x1156ca=_0x1156ca-0x0;var _0x4992a4=_0xe1e8[_0x1156ca];return _0x4992a4;};'use strict';var moment=require(_0x8e1e('0x0'));var Sequelize=require(_0x8e1e('0x1'));module[_0x8e1e('0x2')]={'phone':{'type':Sequelize[_0x8e1e('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8e1e('0x4')],'defaultValue':moment()[_0x8e1e('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8e1e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8e1e('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8e1e('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8e1e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8e1e('0x4')]},'priority':{'type':Sequelize[_0x8e1e('0x6')](0x2)[_0x8e1e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8e1e('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8e1e('0x6')],'unique':_0x8e1e('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x8e1e('0x9')},'UserId':{'type':Sequelize[_0x8e1e('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x8e1e('0x6')]}}; \ No newline at end of file +var _0x55aa=['INTEGER','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x583675,_0x2fc432){var _0x409342=function(_0x2b949b){while(--_0x2b949b){_0x583675['push'](_0x583675['shift']());}};_0x409342(++_0x2fc432);}(_0x55aa,0x146));var _0xa55a=function(_0x2e6886,_0x1f26e8){_0x2e6886=_0x2e6886-0x0;var _0x322ff7=_0x55aa[_0x2e6886];return _0x322ff7;};'use strict';var moment=require('moment');var Sequelize=require(_0xa55a('0x0'));module[_0xa55a('0x1')]={'phone':{'type':Sequelize[_0xa55a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa55a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa55a('0x4')],'defaultValue':moment()[_0xa55a('0x5')](_0xa55a('0x6'))},'countbusyretry':{'type':Sequelize[_0xa55a('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa55a('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa55a('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa55a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa55a('0x7')],'unique':_0xa55a('0x8')},'ListId':{'type':Sequelize[_0xa55a('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xa55a('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 08cca63..92e4495 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 _0xbd50=['end','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','include','show','length','includeAll','find','catch','create','body','describe','params','CampaignId','VoiceQueueId','VoiceQueue','omit','createdAt','updatedAt','state','statedesc','campaign','membername','user','deletedat','calleridnum','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','format','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','update','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1b25ad,_0x2d1244){var _0x391784=function(_0x23c830){while(--_0x23c830){_0x1b25ad['push'](_0x1b25ad['shift']());}};_0x391784(++_0x2d1244);}(_0xbd50,0x196));var _0x0bd5=function(_0x3cb786,_0x10e575){_0x3cb786=_0x3cb786-0x0;var _0x197d49=_0xbd50[_0x3cb786];return _0x197d49;};'use strict';var pdf=require(_0x0bd5('0x0'));var emlformat=require(_0x0bd5('0x1'));var rimraf=require(_0x0bd5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd5('0x3'));var rp=require(_0x0bd5('0x4'));var moment=require(_0x0bd5('0x5'));var BPromise=require(_0x0bd5('0x6'));var Mustache=require(_0x0bd5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0bd5('0x8'));var ejs=require(_0x0bd5('0x9'));var fs=require('fs');var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0x8'));var querystring=require(_0x0bd5('0xd'));var Papa=require(_0x0bd5('0xe'));var Redis=require('ioredis');var authService=require(_0x0bd5('0xf'));var qs=require(_0x0bd5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bd5('0x11'))(_0x0bd5('0x12'));var utils=require('../../config/utils');var config=require(_0x0bd5('0x13'));var db=require(_0x0bd5('0x14'))['db'];function respondWithStatusCode(_0x1aa818,_0x5f49ee){_0x5f49ee=_0x5f49ee||0xcc;return function(_0x2f7a0c){if(_0x2f7a0c){return _0x1aa818[_0x0bd5('0x15')](_0x5f49ee);}return _0x1aa818[_0x0bd5('0x16')](_0x5f49ee)[_0x0bd5('0x17')]();};}function respondWithResult(_0xfa1eed,_0x557be0){_0x557be0=_0x557be0||0xc8;return function(_0x30765e){if(_0x30765e){return _0xfa1eed[_0x0bd5('0x16')](_0x557be0)['json'](_0x30765e);}};}function respondWithFilteredResult(_0x78f9b8,_0x325e43){return function(_0x574315){if(_0x574315){var _0x31349f=_0x574315['count'],_0x23ef4e=_0x325e43[_0x0bd5('0x18')],_0x3a34e4=_0x325e43[_0x0bd5('0x18')]+_0x325e43[_0x0bd5('0x19')],_0xc22553;if(_0x3a34e4>=_0x31349f){_0x3a34e4=_0x31349f;_0xc22553=0xc8;}else{_0xc22553=0xce;}_0x78f9b8[_0x0bd5('0x16')](_0xc22553);return _0x78f9b8[_0x0bd5('0x1a')](_0x0bd5('0x1b'),_0x23ef4e+'-'+_0x3a34e4+'/'+_0x31349f)[_0x0bd5('0x1c')](_0x574315);}return null;};}function patchUpdates(_0x19fe20){return function(_0x29fa4c){try{jsonpatch[_0x0bd5('0x1d')](_0x29fa4c,_0x19fe20,!![]);}catch(_0x27bc1e){return BPromise[_0x0bd5('0x1e')](_0x27bc1e);}return _0x29fa4c[_0x0bd5('0x1f')]();};}function saveUpdates(_0x2dc1e5,_0x527c37){return function(_0x5ba943){if(_0x5ba943){return _0x5ba943['update'](_0x2dc1e5)['then'](function(_0x47d74a){return _0x47d74a;});}return null;};}function removeEntity(_0x6c06bd,_0x86381d){return function(_0x13ce46){if(_0x13ce46){return _0x13ce46[_0x0bd5('0x20')]()[_0x0bd5('0x21')](function(){_0x6c06bd['status'](0xcc)[_0x0bd5('0x17')]();});}};}function handleEntityNotFound(_0x3b235b,_0x38c21d){return function(_0x5a8139){if(!_0x5a8139){_0x3b235b[_0x0bd5('0x15')](0x194);}return _0x5a8139;};}function handleError(_0x4a8787,_0x4969e6){_0x4969e6=_0x4969e6||0x1f4;return function(_0x14c319){logger[_0x0bd5('0x22')](_0x14c319[_0x0bd5('0x23')]);if(_0x14c319['name']){delete _0x14c319[_0x0bd5('0x24')];}_0x4a8787['status'](_0x4969e6)[_0x0bd5('0x25')](_0x14c319);};}exports[_0x0bd5('0x26')]=function(_0x18cec3,_0x2b6b53){var _0x3ff237={},_0x2023d5={},_0x19bb5e={'count':0x0,'rows':[]};var _0x2f01ff=db[_0x0bd5('0x27')][_0x0bd5('0x28')];_0x2023d5[_0x0bd5('0x29')]=_[_0x0bd5('0x2a')](_0x2f01ff);_0x2023d5[_0x0bd5('0x2b')]=_[_0x0bd5('0x2a')](_0x18cec3['query']);_0x2023d5[_0x0bd5('0x2c')]=_[_0x0bd5('0x2d')](_0x2023d5['model'],_0x2023d5[_0x0bd5('0x2b')]);_0x2023d5[_0x0bd5('0x2c')]=_['concat'](_0x2023d5[_0x0bd5('0x2c')],[_0x0bd5('0x2e'),_0x0bd5('0x2f'),_0x0bd5('0x30'),'$gte',_0x0bd5('0x31'),_0x0bd5('0x32'),_0x0bd5('0x33'),_0x0bd5('0x34'),_0x0bd5('0x35'),_0x0bd5('0x36'),'$notBetween',_0x0bd5('0x37'),'$notIn',_0x0bd5('0x38'),_0x0bd5('0x39'),_0x0bd5('0x3a'),_0x0bd5('0x3b'),_0x0bd5('0x38'),_0x0bd5('0x3c'),_0x0bd5('0x3d'),_0x0bd5('0x3e'),_0x0bd5('0x3f')]);_0x3ff237[_0x0bd5('0x40')]=_[_0x0bd5('0x2d')](_0x2023d5[_0x0bd5('0x29')],qs[_0x0bd5('0x41')](_0x18cec3['query'][_0x0bd5('0x41')]));_0x3ff237[_0x0bd5('0x40')]=_0x3ff237['attributes']['length']?_0x3ff237[_0x0bd5('0x40')]:_0x2023d5[_0x0bd5('0x29')];if(!_0x18cec3[_0x0bd5('0x2b')][_0x0bd5('0x42')](_0x0bd5('0x43'))){_0x3ff237[_0x0bd5('0x19')]=qs[_0x0bd5('0x19')](_0x18cec3[_0x0bd5('0x2b')][_0x0bd5('0x19')]);_0x3ff237[_0x0bd5('0x18')]=qs[_0x0bd5('0x18')](_0x18cec3[_0x0bd5('0x2b')][_0x0bd5('0x18')]);}_0x3ff237['order']=qs[_0x0bd5('0x44')](_0x18cec3['query'][_0x0bd5('0x44')]);_0x3ff237[_0x0bd5('0x45')]=qs[_0x0bd5('0x2c')](_[_0x0bd5('0x46')](_0x18cec3[_0x0bd5('0x2b')],_0x2023d5[_0x0bd5('0x2c')]));if(_0x18cec3['query'][_0x0bd5('0x47')]){_0x3ff237[_0x0bd5('0x45')]=_[_0x0bd5('0x48')](_0x3ff237[_0x0bd5('0x45')],{'$or':_[_0x0bd5('0x49')](_0x2f01ff,function(_0x493089){if(_0x493089[_0x0bd5('0x4a')][_0x0bd5('0x4b')]!==_0x0bd5('0x4c')){var _0x56ea34={};_0x56ea34[_0x493089[_0x0bd5('0x4d')]]={'$like':'%'+_0x18cec3['query'][_0x0bd5('0x47')]+'%'};return _0x56ea34;}})});}_0x3ff237=_[_0x0bd5('0x48')]({},_0x3ff237,_0x18cec3['options']);var _0x32eb58={'where':_0x3ff237[_0x0bd5('0x45')]};return db[_0x0bd5('0x27')][_0x0bd5('0x4e')](_0x32eb58)[_0x0bd5('0x21')](function(_0x1a8d55){_0x19bb5e[_0x0bd5('0x4e')]=_0x1a8d55;if(_0x18cec3['query']['includeAll']){_0x3ff237[_0x0bd5('0x4f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3ff237);})[_0x0bd5('0x21')](function(_0x3c6f2b){_0x19bb5e['rows']=_0x3c6f2b;return _0x19bb5e;})['then'](respondWithFilteredResult(_0x2b6b53,_0x3ff237))['catch'](handleError(_0x2b6b53,null));};exports[_0x0bd5('0x50')]=function(_0x561a38,_0x4cb57a){var _0x28d252={'raw':!![],'where':{'id':_0x561a38['params']['id']}},_0x110210={};_0x110210['model']=_[_0x0bd5('0x2a')](db[_0x0bd5('0x27')][_0x0bd5('0x28')]);_0x110210[_0x0bd5('0x2b')]=_['keys'](_0x561a38[_0x0bd5('0x2b')]);_0x110210[_0x0bd5('0x2c')]=_[_0x0bd5('0x2d')](_0x110210[_0x0bd5('0x29')],_0x110210[_0x0bd5('0x2b')]);_0x28d252[_0x0bd5('0x40')]=_['intersection'](_0x110210[_0x0bd5('0x29')],qs[_0x0bd5('0x41')](_0x561a38[_0x0bd5('0x2b')]['fields']));_0x28d252[_0x0bd5('0x40')]=_0x28d252[_0x0bd5('0x40')][_0x0bd5('0x51')]?_0x28d252['attributes']:_0x110210[_0x0bd5('0x29')];if(_0x561a38[_0x0bd5('0x2b')][_0x0bd5('0x52')]){_0x28d252[_0x0bd5('0x4f')]=[{'all':!![]}];}_0x28d252=_[_0x0bd5('0x48')]({},_0x28d252,_0x561a38['options']);return db[_0x0bd5('0x27')][_0x0bd5('0x53')](_0x28d252)['then'](handleEntityNotFound(_0x4cb57a,null))[_0x0bd5('0x21')](respondWithResult(_0x4cb57a,null))[_0x0bd5('0x54')](handleError(_0x4cb57a,null));};exports[_0x0bd5('0x55')]=function(_0x19c35e,_0x2dbfe4){return db['CmHopper'][_0x0bd5('0x55')](_0x19c35e[_0x0bd5('0x56')],{})['then'](respondWithResult(_0x2dbfe4,0xc9))[_0x0bd5('0x54')](handleError(_0x2dbfe4,null));};exports['update']=function(_0x3c3e9b,_0x14b74b){if(_0x3c3e9b[_0x0bd5('0x56')]['id']){delete _0x3c3e9b[_0x0bd5('0x56')]['id'];}return db['CmHopper'][_0x0bd5('0x53')]({'where':{'id':_0x3c3e9b['params']['id']}})['then'](handleEntityNotFound(_0x14b74b,null))[_0x0bd5('0x21')](saveUpdates(_0x3c3e9b[_0x0bd5('0x56')],null))[_0x0bd5('0x21')](respondWithResult(_0x14b74b,null))['catch'](handleError(_0x14b74b,null));};exports[_0x0bd5('0x57')]=function(_0x5945cb,_0x9a4fdb){return db[_0x0bd5('0x27')][_0x0bd5('0x57')]()['then'](respondWithResult(_0x9a4fdb,null))['catch'](handleError(_0x9a4fdb,null));};exports['destroy']=function(_0x122f84,_0x21db5d){var _0x2aff3b;return db['CmHopper'][_0x0bd5('0x53')]({'where':{'id':_0x122f84[_0x0bd5('0x58')]['id']}})['then'](handleEntityNotFound(_0x21db5d,null))[_0x0bd5('0x21')](function(_0x5ba473){if(_0x5ba473){return _0x5ba473['destroy']()[_0x0bd5('0x21')](function(_0x1e5b5e){return _0x1e5b5e;});}})[_0x0bd5('0x21')](function(_0xb09083){_0x2aff3b=_0xb09083;if(_0xb09083){if(_0xb09083['VoiceQueueId']||_0xb09083[_0x0bd5('0x59')]){return db[_0xb09083[_0x0bd5('0x5a')]?_0x0bd5('0x5b'):'Campaign'][_0x0bd5('0x53')]({'where':{'id':_0xb09083[_0x0bd5('0x5a')]?_0xb09083[_0x0bd5('0x5a')]:_0xb09083['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x0bd5('0x21')](function(_0x5dd498){var _0x3e20e9={};if(_0x5dd498){_[_0x0bd5('0x48')](_0x3e20e9,_[_0x0bd5('0x5c')](_0x2aff3b['dataValues'],[_0x0bd5('0x5d'),_0x0bd5('0x5e'),'id']));_0x3e20e9[_0x0bd5('0x5f')]=0x15;_0x3e20e9[_0x0bd5('0x60')]='deleted';_0x3e20e9[_0x0bd5('0x61')]=_0x5dd498[_0x0bd5('0x24')];_0x3e20e9[_0x0bd5('0x62')]=_0x122f84[_0x0bd5('0x63')][_0x0bd5('0x24')];_0x3e20e9['UserId']=_0x122f84[_0x0bd5('0x63')]['id'];_0x3e20e9['deleted']=!![];_0x3e20e9[_0x0bd5('0x64')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e20e9[_0x0bd5('0x65')]=_0x2aff3b['phone'];_0x3e20e9[_0x0bd5('0x66')]=_0x2aff3b[_0x0bd5('0x5a')]?_0x0bd5('0x67'):'ivr';return db[_0x0bd5('0x68')][_0x0bd5('0x53')]({'where':{'id':_0x3e20e9['ContactId']},'attributes':[_0x0bd5('0x69'),_0x0bd5('0x6a')]})['then'](function(_0x460ebb){if(!_['isNil'](_0x21db5d)&&!_[_0x0bd5('0x6b')](_0x460ebb[_0x0bd5('0x69')])){_0x3e20e9[_0x0bd5('0x6c')]=_0x460ebb[_0x0bd5('0x69')];if(!_[_0x0bd5('0x6b')](_0x460ebb[_0x0bd5('0x6a')])){_0x3e20e9[_0x0bd5('0x6c')]+='\x20'+_0x460ebb['lastName'];}}})[_0x0bd5('0x6d')](function(){return db[_0x0bd5('0x6e')][_0x0bd5('0x55')](_0x3e20e9);});}})['then'](function(){return _0x21db5d['status'](0xcc)[_0x0bd5('0x17')]();})[_0x0bd5('0x54')](handleError(_0x21db5d,null));};exports[_0x0bd5('0x6f')]=function(_0x42dc72,_0x340f9a,_0x43b330){var _0x1db7f2=[];return db[_0x0bd5('0x68')][_0x0bd5('0x57')]()[_0x0bd5('0x21')](function(_0x11c266){_0x1db7f2=_[_0x0bd5('0x2a')](_0x11c266);return _0x42dc72[_0x0bd5('0x63')][_0x0bd5('0x70')]({'where':{'type':_0x0bd5('0x71'),'dialActive':!![],'dialMethod':_0x0bd5('0x72')},'attributes':['id',_0x0bd5('0x73')],'raw':!![]});})[_0x0bd5('0x21')](function(_0x56aa05){if(_0x56aa05&&_0x56aa05[_0x0bd5('0x51')]){return db[_0x0bd5('0x74')]['transaction'](function(_0x7cc5b0){var _0x51b486={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0bd5('0x75')](_0x0bd5('0x76'))},'VoiceQueueId':{'$in':_['map'](_0x56aa05,'id')},'$or':[{'UserId':null},{'UserId':_0x42dc72[_0x0bd5('0x63')]['id']}]};var _0x309aeb=[];if(_0x42dc72[_0x0bd5('0x56')][_0x0bd5('0x77')]&&_0x42dc72[_0x0bd5('0x56')][_0x0bd5('0x77')]===_0x0bd5('0x78')){if(!_[_0x0bd5('0x79')](_0x42dc72[_0x0bd5('0x56')]['hopperIds'])){_0x51b486['id']={'$in':_0x42dc72[_0x0bd5('0x56')][_0x0bd5('0x7a')]};}_0x309aeb=[['priority',_0x0bd5('0x7b')],[_0x0bd5('0x7c'),_0x56aa05[0x0]['dialOrderByScheduledAt']===_0x0bd5('0x7b')?_0x0bd5('0x7d'):'ASC'],db[_0x0bd5('0x74')]['literal'](_0x0bd5('0x7e')),['id',_0x0bd5('0x7d')]];}else{if(!_[_0x0bd5('0x79')](_0x42dc72[_0x0bd5('0x56')][_0x0bd5('0x7a')])){_0x51b486['id']={'$notIn':_0x42dc72[_0x0bd5('0x56')][_0x0bd5('0x7a')]};}_0x309aeb=[[_0x0bd5('0x7f'),_0x0bd5('0x7d')],[_0x0bd5('0x7c'),_0x56aa05[0x0][_0x0bd5('0x73')]],db[_0x0bd5('0x74')][_0x0bd5('0x80')](_0x0bd5('0x81')),['id','ASC']];}return db[_0x0bd5('0x27')][_0x0bd5('0x82')]({'attributes':['id',_0x0bd5('0x83')],'where':_0x51b486,'order':_0x309aeb,'transaction':_0x7cc5b0,'lock':_0x7cc5b0[_0x0bd5('0x84')][_0x0bd5('0x85')],'include':[{'model':db[_0x0bd5('0x68')],'as':'Contact','attributes':_0x1db7f2,'include':[{'model':db[_0x0bd5('0x86')],'as':_0x0bd5('0x87'),'attributes':['id',_0x0bd5('0x24')]}]},{'model':db[_0x0bd5('0x88')],'as':_0x0bd5('0x89'),'attributes':['id',_0x0bd5('0x24')]},{'model':db[_0x0bd5('0x5b')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x0bd5('0x21')](function(_0x343658){if(_0x343658){return _0x343658[_0x0bd5('0x8a')]({'UserId':_0x42dc72[_0x0bd5('0x63')]['id']},{'transaction':_0x7cc5b0});}});});}})[_0x0bd5('0x21')](handleEntityNotFound(_0x340f9a,null))['then'](respondWithResult(_0x340f9a,null))[_0x0bd5('0x54')](handleError(_0x340f9a,null));};exports[_0x0bd5('0x8b')]=function(_0x592438,_0x46edf6,_0x935f1c){return _0x592438[_0x0bd5('0x63')][_0x0bd5('0x70')]({'where':{'type':_0x0bd5('0x71'),'dialActive':!![],'dialMethod':_0x0bd5('0x72')},'attributes':['id'],'raw':!![]})[_0x0bd5('0x21')](function(_0x2d5a19){if(_0x2d5a19&&_0x2d5a19[_0x0bd5('0x51')]){return db[_0x0bd5('0x27')][_0x0bd5('0x4e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0bd5('0x76'))},'VoiceQueueId':{'$in':_[_0x0bd5('0x49')](_0x2d5a19,'id')},'$or':[{'UserId':null},{'UserId':_0x592438[_0x0bd5('0x63')]['id']}]}});}return 0x0;})[_0x0bd5('0x21')](function(_0x29c164){if(!_['isNil'](_0x29c164)&&_[_0x0bd5('0x8c')](_0x29c164)){return _0x46edf6[_0x0bd5('0x16')](0xc8)[_0x0bd5('0x1c')]({'contacts':_0x29c164});}else{logger[_0x0bd5('0x22')](_0x0bd5('0x8d'),_0x0bd5('0x8b'),0x194,_0x0bd5('0x8e'));_0x46edf6[_0x0bd5('0x15')](0x194);}})[_0x0bd5('0x54')](handleError(_0x46edf6,null));}; \ No newline at end of file +var _0xed1f=['concat','$and','$gt','$gte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','calleridnum','campaigntype','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','map','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','List','Queue','getOpenContacts','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','offset','set','reject','update','then','end','error','stack','name','index','CmHopper','model','keys','query','filters'];(function(_0x2a9405,_0x342aec){var _0x2ec9a2=function(_0x355c77){while(--_0x355c77){_0x2a9405['push'](_0x2a9405['shift']());}};_0x2ec9a2(++_0x342aec);}(_0xed1f,0x6a));var _0xfed1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xed1f[_0x4c445a];return _0x2f611c;};'use strict';var pdf=require(_0xfed1('0x0'));var emlformat=require(_0xfed1('0x1'));var rimraf=require(_0xfed1('0x2'));var zipdir=require(_0xfed1('0x3'));var jsonpatch=require(_0xfed1('0x4'));var rp=require(_0xfed1('0x5'));var moment=require(_0xfed1('0x6'));var BPromise=require(_0xfed1('0x7'));var Mustache=require(_0xfed1('0x8'));var util=require(_0xfed1('0x9'));var path=require(_0xfed1('0xa'));var sox=require(_0xfed1('0xb'));var csv=require(_0xfed1('0xc'));var ejs=require(_0xfed1('0xd'));var fs=require('fs');var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xc'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfed1('0x15'));var logger=require('../../config/logger')(_0xfed1('0x16'));var utils=require(_0xfed1('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1891,_0xe84ba6){_0xe84ba6=_0xe84ba6||0xcc;return function(_0x569a6e){if(_0x569a6e){return _0x3d1891[_0xfed1('0x18')](_0xe84ba6);}return _0x3d1891['status'](_0xe84ba6)['end']();};}function respondWithResult(_0x3f6555,_0x397af9){_0x397af9=_0x397af9||0xc8;return function(_0x532537){if(_0x532537){return _0x3f6555[_0xfed1('0x19')](_0x397af9)['json'](_0x532537);}};}function respondWithFilteredResult(_0x4cd9d1,_0xde25db){return function(_0x39aa0c){if(_0x39aa0c){var _0x1fbb7a=_0x39aa0c['count'],_0x123c46=_0xde25db[_0xfed1('0x1a')],_0x582e67=_0xde25db[_0xfed1('0x1a')]+_0xde25db['limit'],_0x1a00f6;if(_0x582e67>=_0x1fbb7a){_0x582e67=_0x1fbb7a;_0x1a00f6=0xc8;}else{_0x1a00f6=0xce;}_0x4cd9d1[_0xfed1('0x19')](_0x1a00f6);return _0x4cd9d1[_0xfed1('0x1b')]('Content-Range',_0x123c46+'-'+_0x582e67+'/'+_0x1fbb7a)['json'](_0x39aa0c);}return null;};}function patchUpdates(_0x586ea6){return function(_0x1e5afb){try{jsonpatch['apply'](_0x1e5afb,_0x586ea6,!![]);}catch(_0x201f18){return BPromise[_0xfed1('0x1c')](_0x201f18);}return _0x1e5afb['save']();};}function saveUpdates(_0x94cb84,_0x65f14b){return function(_0x59ee9d){if(_0x59ee9d){return _0x59ee9d[_0xfed1('0x1d')](_0x94cb84)[_0xfed1('0x1e')](function(_0xff4842){return _0xff4842;});}return null;};}function removeEntity(_0x92b92d,_0x4bac79){return function(_0x203cec){if(_0x203cec){return _0x203cec['destroy']()[_0xfed1('0x1e')](function(){_0x92b92d[_0xfed1('0x19')](0xcc)[_0xfed1('0x1f')]();});}};}function handleEntityNotFound(_0x532ec2,_0x41d22c){return function(_0x594917){if(!_0x594917){_0x532ec2[_0xfed1('0x18')](0x194);}return _0x594917;};}function handleError(_0x2793b7,_0x1b7b22){_0x1b7b22=_0x1b7b22||0x1f4;return function(_0x365bae){logger[_0xfed1('0x20')](_0x365bae[_0xfed1('0x21')]);if(_0x365bae['name']){delete _0x365bae[_0xfed1('0x22')];}_0x2793b7[_0xfed1('0x19')](_0x1b7b22)['send'](_0x365bae);};}exports[_0xfed1('0x23')]=function(_0x2b9dd2,_0x1b871a){var _0x1d62c5={},_0x3b9122={},_0x1761d1={'count':0x0,'rows':[]};var _0x583953=db[_0xfed1('0x24')]['rawAttributes'];_0x3b9122[_0xfed1('0x25')]=_['keys'](_0x583953);_0x3b9122['query']=_[_0xfed1('0x26')](_0x2b9dd2[_0xfed1('0x27')]);_0x3b9122[_0xfed1('0x28')]=_['intersection'](_0x3b9122[_0xfed1('0x25')],_0x3b9122[_0xfed1('0x27')]);_0x3b9122[_0xfed1('0x28')]=_[_0xfed1('0x29')](_0x3b9122[_0xfed1('0x28')],[_0xfed1('0x2a'),'$or',_0xfed1('0x2b'),_0xfed1('0x2c'),'$lt','$lte',_0xfed1('0x2d'),_0xfed1('0x2e'),_0xfed1('0x2f'),_0xfed1('0x30'),_0xfed1('0x31'),'$in',_0xfed1('0x32'),_0xfed1('0x33'),_0xfed1('0x34'),_0xfed1('0x35'),_0xfed1('0x36'),'$like',_0xfed1('0x37'),'$contains',_0xfed1('0x38'),_0xfed1('0x39')]);_0x1d62c5[_0xfed1('0x3a')]=_[_0xfed1('0x3b')](_0x3b9122[_0xfed1('0x25')],qs[_0xfed1('0x3c')](_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x3c')]));_0x1d62c5['attributes']=_0x1d62c5[_0xfed1('0x3a')][_0xfed1('0x3d')]?_0x1d62c5[_0xfed1('0x3a')]:_0x3b9122[_0xfed1('0x25')];if(!_0x2b9dd2['query']['hasOwnProperty'](_0xfed1('0x3e'))){_0x1d62c5[_0xfed1('0x3f')]=qs[_0xfed1('0x3f')](_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x3f')]);_0x1d62c5[_0xfed1('0x1a')]=qs[_0xfed1('0x1a')](_0x2b9dd2[_0xfed1('0x27')]['offset']);}_0x1d62c5['order']=qs[_0xfed1('0x40')](_0x2b9dd2[_0xfed1('0x27')]['sort']);_0x1d62c5[_0xfed1('0x41')]=qs[_0xfed1('0x28')](_[_0xfed1('0x42')](_0x2b9dd2[_0xfed1('0x27')],_0x3b9122[_0xfed1('0x28')]));if(_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x43')]){_0x1d62c5[_0xfed1('0x41')]=_[_0xfed1('0x44')](_0x1d62c5['where'],{'$or':_['map'](_0x583953,function(_0x5598dc){if(_0x5598dc[_0xfed1('0x45')][_0xfed1('0x46')]!==_0xfed1('0x47')){var _0x496a5d={};_0x496a5d[_0x5598dc[_0xfed1('0x48')]]={'$like':'%'+_0x2b9dd2['query'][_0xfed1('0x43')]+'%'};return _0x496a5d;}})});}_0x1d62c5=_[_0xfed1('0x44')]({},_0x1d62c5,_0x2b9dd2[_0xfed1('0x49')]);var _0x4f042a={'where':_0x1d62c5[_0xfed1('0x41')]};return db[_0xfed1('0x24')][_0xfed1('0x4a')](_0x4f042a)['then'](function(_0x1b53de){_0x1761d1['count']=_0x1b53de;if(_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x4b')]){_0x1d62c5[_0xfed1('0x4c')]=[{'all':!![]}];}return db[_0xfed1('0x24')][_0xfed1('0x4d')](_0x1d62c5);})[_0xfed1('0x1e')](function(_0x2d4f82){_0x1761d1[_0xfed1('0x4e')]=_0x2d4f82;return _0x1761d1;})[_0xfed1('0x1e')](respondWithFilteredResult(_0x1b871a,_0x1d62c5))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x4f')]=function(_0x41c7d8,_0x41c7c3){var _0x4a86af={'raw':!![],'where':{'id':_0x41c7d8[_0xfed1('0x50')]['id']}},_0x4d7445={};_0x4d7445[_0xfed1('0x25')]=_[_0xfed1('0x26')](db[_0xfed1('0x24')][_0xfed1('0x51')]);_0x4d7445[_0xfed1('0x27')]=_[_0xfed1('0x26')](_0x41c7d8[_0xfed1('0x27')]);_0x4d7445[_0xfed1('0x28')]=_[_0xfed1('0x3b')](_0x4d7445[_0xfed1('0x25')],_0x4d7445[_0xfed1('0x27')]);_0x4a86af['attributes']=_[_0xfed1('0x3b')](_0x4d7445[_0xfed1('0x25')],qs[_0xfed1('0x3c')](_0x41c7d8[_0xfed1('0x27')][_0xfed1('0x3c')]));_0x4a86af[_0xfed1('0x3a')]=_0x4a86af['attributes'][_0xfed1('0x3d')]?_0x4a86af[_0xfed1('0x3a')]:_0x4d7445[_0xfed1('0x25')];if(_0x41c7d8['query'][_0xfed1('0x4b')]){_0x4a86af[_0xfed1('0x4c')]=[{'all':!![]}];}_0x4a86af=_[_0xfed1('0x44')]({},_0x4a86af,_0x41c7d8[_0xfed1('0x49')]);return db['CmHopper'][_0xfed1('0x52')](_0x4a86af)[_0xfed1('0x1e')](handleEntityNotFound(_0x41c7c3,null))[_0xfed1('0x1e')](respondWithResult(_0x41c7c3,null))[_0xfed1('0x53')](handleError(_0x41c7c3,null));};exports[_0xfed1('0x54')]=function(_0x439947,_0x388078){return db[_0xfed1('0x24')][_0xfed1('0x54')](_0x439947[_0xfed1('0x55')],{})[_0xfed1('0x1e')](respondWithResult(_0x388078,0xc9))[_0xfed1('0x53')](handleError(_0x388078,null));};exports[_0xfed1('0x1d')]=function(_0x20c493,_0x33c77a){if(_0x20c493[_0xfed1('0x55')]['id']){delete _0x20c493[_0xfed1('0x55')]['id'];}return db[_0xfed1('0x24')]['find']({'where':{'id':_0x20c493['params']['id']}})[_0xfed1('0x1e')](handleEntityNotFound(_0x33c77a,null))[_0xfed1('0x1e')](saveUpdates(_0x20c493[_0xfed1('0x55')],null))[_0xfed1('0x1e')](respondWithResult(_0x33c77a,null))['catch'](handleError(_0x33c77a,null));};exports[_0xfed1('0x56')]=function(_0x3f1317,_0x55e7d9){return db['CmHopper']['describe']()[_0xfed1('0x1e')](respondWithResult(_0x55e7d9,null))[_0xfed1('0x53')](handleError(_0x55e7d9,null));};exports[_0xfed1('0x57')]=function(_0x1d8ef2,_0x2665c8){var _0x3cb4f;return db[_0xfed1('0x24')][_0xfed1('0x52')]({'where':{'id':_0x1d8ef2[_0xfed1('0x50')]['id']}})[_0xfed1('0x1e')](handleEntityNotFound(_0x2665c8,null))['then'](function(_0x55490a){if(_0x55490a){return _0x55490a[_0xfed1('0x57')]()[_0xfed1('0x1e')](function(_0x3f4db7){return _0x3f4db7;});}})[_0xfed1('0x1e')](function(_0x83b8d0){_0x3cb4f=_0x83b8d0;if(_0x83b8d0){if(_0x83b8d0[_0xfed1('0x58')]||_0x83b8d0[_0xfed1('0x59')]){return db[_0x83b8d0[_0xfed1('0x58')]?_0xfed1('0x5a'):_0xfed1('0x5b')][_0xfed1('0x52')]({'where':{'id':_0x83b8d0[_0xfed1('0x58')]?_0x83b8d0[_0xfed1('0x58')]:_0x83b8d0[_0xfed1('0x59')]},'attributes':['id',_0xfed1('0x22')],'raw':!![]});}}})[_0xfed1('0x1e')](function(_0x1e79f2){var _0x54eb53={};if(_0x1e79f2){_['merge'](_0x54eb53,_[_0xfed1('0x5c')](_0x3cb4f[_0xfed1('0x5d')],[_0xfed1('0x5e'),_0xfed1('0x5f'),'id']));_0x54eb53[_0xfed1('0x60')]=0x15;_0x54eb53[_0xfed1('0x61')]=_0xfed1('0x62');_0x54eb53[_0xfed1('0x63')]=_0x1e79f2[_0xfed1('0x22')];_0x54eb53[_0xfed1('0x64')]=_0x1d8ef2[_0xfed1('0x65')][_0xfed1('0x22')];_0x54eb53[_0xfed1('0x66')]=_0x1d8ef2[_0xfed1('0x65')]['id'];_0x54eb53['deleted']=!![];_0x54eb53[_0xfed1('0x67')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x54eb53[_0xfed1('0x68')]=_0x3cb4f['phone'];_0x54eb53[_0xfed1('0x69')]=_0x3cb4f['VoiceQueueId']?_0xfed1('0x6a'):_0xfed1('0x6b');return db['CmContact'][_0xfed1('0x52')]({'where':{'id':_0x54eb53[_0xfed1('0x6c')]},'attributes':['firstName',_0xfed1('0x6d')]})[_0xfed1('0x1e')](function(_0x1c99c6){if(!_[_0xfed1('0x6e')](_0x2665c8)&&!_['isNil'](_0x1c99c6[_0xfed1('0x6f')])){_0x54eb53[_0xfed1('0x70')]=_0x1c99c6[_0xfed1('0x6f')];if(!_[_0xfed1('0x6e')](_0x1c99c6[_0xfed1('0x6d')])){_0x54eb53[_0xfed1('0x70')]+='\x20'+_0x1c99c6[_0xfed1('0x6d')];}}})[_0xfed1('0x71')](function(){return db['CmHopperFinal'][_0xfed1('0x54')](_0x54eb53);});}})[_0xfed1('0x1e')](function(){return _0x2665c8[_0xfed1('0x19')](0xcc)[_0xfed1('0x1f')]();})[_0xfed1('0x53')](handleError(_0x2665c8,null));};exports[_0xfed1('0x72')]=function(_0x53b7ed,_0x518402,_0x55d280){var _0x33a479=[];return db[_0xfed1('0x73')][_0xfed1('0x56')]()[_0xfed1('0x1e')](function(_0x4aaba6){_0x33a479=_[_0xfed1('0x26')](_0x4aaba6);return _0x53b7ed['user'][_0xfed1('0x74')]({'where':{'type':_0xfed1('0x75'),'dialActive':!![],'dialMethod':_0xfed1('0x76')},'attributes':['id',_0xfed1('0x77')],'raw':!![]});})[_0xfed1('0x1e')](function(_0x59c48b){if(_0x59c48b&&_0x59c48b[_0xfed1('0x3d')]){return db[_0xfed1('0x78')][_0xfed1('0x79')](function(_0x525df1){var _0x40d25d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfed1('0x7a')](_0xfed1('0x7b'))},'VoiceQueueId':{'$in':_[_0xfed1('0x7c')](_0x59c48b,'id')},'$or':[{'UserId':null},{'UserId':_0x53b7ed['user']['id']}]};var _0x286e3d=[];if(_0x53b7ed['body'][_0xfed1('0x7d')]&&_0x53b7ed[_0xfed1('0x55')]['direction']==='prev'){if(!_[_0xfed1('0x7e')](_0x53b7ed[_0xfed1('0x55')][_0xfed1('0x7f')])){_0x40d25d['id']={'$in':_0x53b7ed[_0xfed1('0x55')]['hopperIds']};}_0x286e3d=[[_0xfed1('0x80'),_0xfed1('0x81')],[_0xfed1('0x82'),_0x59c48b[0x0][_0xfed1('0x77')]===_0xfed1('0x81')?_0xfed1('0x83'):'ASC'],db[_0xfed1('0x78')][_0xfed1('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xfed1('0x83')]];}else{if(!_[_0xfed1('0x7e')](_0x53b7ed[_0xfed1('0x55')][_0xfed1('0x7f')])){_0x40d25d['id']={'$notIn':_0x53b7ed[_0xfed1('0x55')][_0xfed1('0x7f')]};}_0x286e3d=[['priority','DESC'],[_0xfed1('0x82'),_0x59c48b[0x0]['dialOrderByScheduledAt']],db[_0xfed1('0x78')][_0xfed1('0x84')](_0xfed1('0x85')),['id',_0xfed1('0x81')]];}return db[_0xfed1('0x24')][_0xfed1('0x86')]({'attributes':['id',_0xfed1('0x87')],'where':_0x40d25d,'order':_0x286e3d,'transaction':_0x525df1,'lock':_0x525df1[_0xfed1('0x88')][_0xfed1('0x89')],'include':[{'model':db[_0xfed1('0x73')],'as':'Contact','attributes':_0x33a479,'include':[{'model':db[_0xfed1('0x8a')],'as':_0xfed1('0x8b'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xfed1('0x8c'),'attributes':['id','name']},{'model':db[_0xfed1('0x5a')],'as':_0xfed1('0x8d'),'attributes':['id',_0xfed1('0x22'),'dialActive']}]})[_0xfed1('0x1e')](function(_0x23fc8b){if(_0x23fc8b){return _0x23fc8b[_0xfed1('0x1d')]({'UserId':_0x53b7ed[_0xfed1('0x65')]['id']},{'transaction':_0x525df1});}});});}})[_0xfed1('0x1e')](handleEntityNotFound(_0x518402,null))['then'](respondWithResult(_0x518402,null))[_0xfed1('0x53')](handleError(_0x518402,null));};exports[_0xfed1('0x8e')]=function(_0x45348d,_0xccf9e,_0xf921fa){return _0x45348d['user'][_0xfed1('0x74')]({'where':{'type':_0xfed1('0x75'),'dialActive':!![],'dialMethod':_0xfed1('0x76')},'attributes':['id'],'raw':!![]})[_0xfed1('0x1e')](function(_0x2dcadd){if(_0x2dcadd&&_0x2dcadd[_0xfed1('0x3d')]){return db[_0xfed1('0x24')][_0xfed1('0x4a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfed1('0x7a')](_0xfed1('0x7b'))},'VoiceQueueId':{'$in':_['map'](_0x2dcadd,'id')},'$or':[{'UserId':null},{'UserId':_0x45348d[_0xfed1('0x65')]['id']}]}});}return 0x0;})[_0xfed1('0x1e')](function(_0x248bae){if(!_[_0xfed1('0x6e')](_0x248bae)&&_[_0xfed1('0x8f')](_0x248bae)){return _0xccf9e['status'](0xc8)[_0xfed1('0x90')]({'contacts':_0x248bae});}else{logger[_0xfed1('0x20')](_0xfed1('0x91'),_0xfed1('0x8e'),0x194,_0xfed1('0x92'));_0xccf9e[_0xfed1('0x18')](0x194);}})[_0xfed1('0x53')](handleError(_0xccf9e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8d7f943..3ccf665 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 _0xa74f=['request-promise','path','rimraf','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','bluebird'];(function(_0x4cd763,_0x968afa){var _0x17ea83=function(_0x4f7219){while(--_0x4f7219){_0x4cd763['push'](_0x4cd763['shift']());}};_0x17ea83(++_0x968afa);}(_0xa74f,0x9a));var _0xfa74=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xa74f[_0x4695ba];return _0x524b7d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[{'name':_0xfa74('0x9'),'fields':[_0xfa74('0x9')]},{'name':'phone','fields':[_0xfa74('0xa')]},{'name':_0xfa74('0xb'),'fields':[_0xfa74('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc874=['cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper'];(function(_0x2c3e32,_0x330b5f){var _0x3e2641=function(_0x58a047){while(--_0x58a047){_0x2c3e32['push'](_0x2c3e32['shift']());}};_0x3e2641(++_0x330b5f);}(_0xc874,0x154));var _0x4c87=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc874[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c87('0x3'));var fs=require('fs');var path=require(_0x4c87('0x4'));var rimraf=require(_0x4c87('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c87('0x6'));module[_0x4c87('0x7')]=function(_0x5d63ae,_0x46e0f5){return _0x5d63ae[_0x4c87('0x8')](_0x4c87('0x9'),attributes,{'tableName':_0x4c87('0xa'),'paranoid':![],'indexes':[{'name':_0x4c87('0xb'),'fields':['scheduledat']},{'name':_0x4c87('0xc'),'fields':['phone']},{'name':_0x4c87('0xd'),'fields':[_0x4c87('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index f7e3373..df10f77 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 _0x3184=['find','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','LOCK','UPDATE','Contact','keys','length','MoveContactManagedDialer','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','order','UserId','push','all','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','GetCmHopper','catch'];(function(_0xdf666c,_0x5bded4){var _0x5e59c7=function(_0x2a4806){while(--_0x2a4806){_0xdf666c['push'](_0xdf666c['shift']());}};_0x5e59c7(++_0x5bded4);}(_0x3184,0x1ac));var _0x4318=function(_0x113dd1,_0x15aaa1){_0x113dd1=_0x113dd1-0x0;var _0x1605e0=_0x3184[_0x113dd1];return _0x1605e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4318('0x0'));var BPromise=require(_0x4318('0x1'));var rs=require(_0x4318('0x2'));var fs=require('fs');var Redis=require(_0x4318('0x3'));var db=require(_0x4318('0x4'))['db'];var utils=require(_0x4318('0x5'));var logger=require(_0x4318('0x6'))(_0x4318('0x7'));var config=require(_0x4318('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4318('0x9')][_0x4318('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d7b0,_0x244bf8,_0x18b733){return new BPromise(function(_0x3d1d10,_0x4dea14){return client[_0x4318('0xb')](_0x27d7b0,_0x18b733)['then'](function(_0x4f9611){logger[_0x4318('0xc')](_0x4318('0xd'),_0x244bf8,_0x4318('0xe'));logger[_0x4318('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x244bf8,_0x4318('0xe'),JSON[_0x4318('0x10')](_0x4f9611));if(_0x4f9611[_0x4318('0x11')]){if(_0x4f9611[_0x4318('0x11')][_0x4318('0x12')]===0x1f4){logger[_0x4318('0x11')](_0x4318('0xd'),_0x244bf8,_0x4f9611[_0x4318('0x11')][_0x4318('0x13')]);return _0x4dea14(_0x4f9611['error'][_0x4318('0x13')]);}logger['error'](_0x4318('0xd'),_0x244bf8,_0x4f9611['error'][_0x4318('0x13')]);return _0x3d1d10(_0x4f9611[_0x4318('0x11')]['message']);}else{logger[_0x4318('0xc')]('CmHopper,\x20%s,\x20%s',_0x244bf8,_0x4318('0xe'));_0x3d1d10(_0x4f9611[_0x4318('0x14')][_0x4318('0x13')]);}})['catch'](function(_0x59ace4){logger[_0x4318('0x11')](_0x4318('0xd'),_0x244bf8,_0x59ace4);_0x4dea14(_0x59ace4);});});}exports['GetCmHopper']=function(_0x5112cc){var _0x2ea17b=this;return new Promise(function(_0x2cc50b,_0x1a1ce6){return db[_0x4318('0x15')][_0x4318('0x16')]({'raw':_0x5112cc['options']?_0x5112cc[_0x4318('0x17')][_0x4318('0x18')]===undefined?!![]:![]:!![],'where':_0x5112cc['options']?_0x5112cc['options'][_0x4318('0x19')]||null:null,'attributes':_0x5112cc[_0x4318('0x17')]?_0x5112cc[_0x4318('0x17')]['attributes']||null:null,'limit':_0x5112cc['options']?_0x5112cc[_0x4318('0x17')][_0x4318('0x1a')]||null:null,'include':_0x5112cc[_0x4318('0x17')]?_0x5112cc['options'][_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x5112cc[_0x4318('0x17')][_0x4318('0x1b')],function(_0x567cc1){return{'model':db[_0x567cc1[_0x4318('0x1d')]],'as':_0x567cc1['as'],'attributes':_0x567cc1[_0x4318('0x1e')],'include':_0x567cc1[_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x567cc1['include'],function(_0x38239e){return{'model':db[_0x38239e[_0x4318('0x1d')]],'as':_0x38239e['as'],'attributes':_0x38239e['attributes'],'include':_0x38239e[_0x4318('0x1b')]?_['map'](_0x38239e[_0x4318('0x1b')],function(_0x3e6bd2){return{'model':db[_0x3e6bd2[_0x4318('0x1d')]],'as':_0x3e6bd2['as'],'attributes':_0x3e6bd2[_0x4318('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4318('0x1f')](function(_0x5a6184){logger[_0x4318('0xc')](_0x4318('0x20'),_0x5112cc);logger[_0x4318('0xf')](_0x4318('0x20'),_0x5112cc,JSON['stringify'](_0x5a6184));_0x2cc50b(_0x5a6184);})[_0x4318('0x21')](function(_0x560d36){logger[_0x4318('0x11')](_0x4318('0x20'),_0x560d36[_0x4318('0x13')],_0x5112cc);_0x1a1ce6(_0x2ea17b[_0x4318('0x11')](0x1f4,_0x560d36['message']));});});};exports['ShowCmHopper']=function(_0xfb4fdd){var _0x49f363=this;return new Promise(function(_0x32ccfa,_0x5bb0db){return db[_0x4318('0x15')][_0x4318('0x22')]({'raw':_0xfb4fdd[_0x4318('0x17')]?_0xfb4fdd[_0x4318('0x17')][_0x4318('0x18')]===undefined?!![]:![]:!![],'where':_0xfb4fdd[_0x4318('0x17')]?_0xfb4fdd[_0x4318('0x17')][_0x4318('0x19')]||null:null,'attributes':_0xfb4fdd[_0x4318('0x17')]?_0xfb4fdd[_0x4318('0x17')][_0x4318('0x1e')]||null:null,'include':_0xfb4fdd[_0x4318('0x17')]?_0xfb4fdd[_0x4318('0x17')][_0x4318('0x1b')]?_[_0x4318('0x1c')](_0xfb4fdd[_0x4318('0x17')][_0x4318('0x1b')],function(_0x1903fd){return{'model':db[_0x1903fd[_0x4318('0x1d')]],'as':_0x1903fd['as'],'attributes':_0x1903fd[_0x4318('0x1e')],'include':_0x1903fd[_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x1903fd[_0x4318('0x1b')],function(_0x1faf94){return{'model':db[_0x1faf94[_0x4318('0x1d')]],'as':_0x1faf94['as'],'attributes':_0x1faf94['attributes'],'include':_0x1faf94[_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x1faf94[_0x4318('0x1b')],function(_0x59c2f4){return{'model':db[_0x59c2f4[_0x4318('0x1d')]],'as':_0x59c2f4['as'],'attributes':_0x59c2f4[_0x4318('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c1cdc){logger['info'](_0x4318('0x23'),_0xfb4fdd);logger[_0x4318('0xf')](_0x4318('0x23'),_0xfb4fdd,JSON[_0x4318('0x10')](_0x5c1cdc));_0x32ccfa(_0x5c1cdc);})[_0x4318('0x21')](function(_0x46987){logger[_0x4318('0x11')](_0x4318('0x23'),_0x46987['message'],_0xfb4fdd);_0x5bb0db(_0x49f363['error'](0x1f4,_0x46987[_0x4318('0x13')]));});});};exports[_0x4318('0x24')]=function(_0x592851){var _0x4be030=this;return new Promise(function(_0xc97587,_0x32b775){return db[_0x4318('0x15')][_0x4318('0x25')](_0x592851['body'],{'raw':_0x592851[_0x4318('0x17')]?_0x592851[_0x4318('0x17')][_0x4318('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x107c7c){logger[_0x4318('0xc')](_0x4318('0x24'),_0x592851);logger['debug'](_0x4318('0x24'),_0x592851,JSON[_0x4318('0x10')](_0x107c7c));_0xc97587(_0x107c7c);})[_0x4318('0x21')](function(_0x56e55c){logger[_0x4318('0x11')](_0x4318('0x24'),_0x56e55c[_0x4318('0x13')],_0x592851);_0x32b775(_0x4be030['error'](0x1f4,_0x56e55c[_0x4318('0x13')]));});});};exports[_0x4318('0x26')]=function(_0x417863){var _0x3f0906=this;return new Promise(function(_0x88440e,_0xc6aec4){return db['CmHopper'][_0x4318('0x27')](_0x417863[_0x4318('0x28')],{'raw':_0x417863[_0x4318('0x17')]?_0x417863[_0x4318('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417863[_0x4318('0x17')]?_0x417863[_0x4318('0x17')]['where']||null:null,'attributes':_0x417863[_0x4318('0x17')]?_0x417863[_0x4318('0x17')][_0x4318('0x1e')]||null:null,'limit':_0x417863[_0x4318('0x17')]?_0x417863[_0x4318('0x17')][_0x4318('0x1a')]||null:null})[_0x4318('0x1f')](function(_0x4242ac){logger[_0x4318('0xc')]('UpdateCmHopper',_0x417863);logger[_0x4318('0xf')](_0x4318('0x26'),_0x417863,JSON[_0x4318('0x10')](_0x4242ac));_0x88440e(_0x4242ac);})[_0x4318('0x21')](function(_0x595c05){logger[_0x4318('0x11')]('UpdateCmHopper',_0x595c05[_0x4318('0x13')],_0x417863);_0xc6aec4(_0x3f0906[_0x4318('0x11')](0x1f4,_0x595c05[_0x4318('0x13')]));});});};exports['DestroyCmHopper']=function(_0x15c4a3){var _0x2c68f0=this;return new Promise(function(_0x2b3137,_0x2830d6){return db['CmHopper'][_0x4318('0x29')]({'where':_0x15c4a3[_0x4318('0x17')]?_0x15c4a3[_0x4318('0x17')][_0x4318('0x19')]||null:null})[_0x4318('0x1f')](function(_0x416ef7){logger[_0x4318('0xc')](_0x4318('0x2a'),_0x15c4a3);logger[_0x4318('0xf')](_0x4318('0x2a'),_0x15c4a3,JSON['stringify'](_0x416ef7));_0x2b3137(_0x416ef7);})[_0x4318('0x21')](function(_0x27bcbe){logger[_0x4318('0x11')](_0x4318('0x2a'),_0x27bcbe[_0x4318('0x13')],_0x15c4a3);_0x2830d6(_0x2c68f0[_0x4318('0x11')](0x1f4,_0x27bcbe[_0x4318('0x13')]));});});};exports[_0x4318('0x2b')]=function(_0x2b9e26){var _0x48c606=this;return new Promise(function(_0x5277cd,_0x10df84){return db[_0x4318('0x2c')][_0x4318('0x2d')]()[_0x4318('0x1f')](function(_0x1f533c){return db[_0x4318('0x2e')]['transaction'](function(_0xd59202){return db[_0x4318('0x15')]['findAll']({'where':_0x2b9e26[_0x4318('0x17')]?_0x2b9e26[_0x4318('0x17')]['where']||null:null,'attributes':_0x2b9e26[_0x4318('0x17')]?_0x2b9e26[_0x4318('0x17')][_0x4318('0x1e')]||null:null,'limit':_0x2b9e26[_0x4318('0x17')]?_0x2b9e26[_0x4318('0x17')]['limit']||null:null,'order':_0x2b9e26[_0x4318('0x17')]?_0x2b9e26[_0x4318('0x17')]['order']||null:null,'transaction':_0xd59202,'lock':_0xd59202[_0x4318('0x2f')][_0x4318('0x30')],'include':[{'model':db[_0x4318('0x2c')],'as':_0x4318('0x31'),'attributes':_[_0x4318('0x32')](_0x1f533c)}]})[_0x4318('0x1f')](function(_0x3b17ab){var _0x27384b=[];for(var _0x11071b=0x0;_0x11071b<_0x3b17ab[_0x4318('0x33')];_0x11071b+=0x1){_0x27384b['push'](_0x3b17ab[_0x11071b][_0x4318('0x27')](_0x2b9e26[_0x4318('0x28')],{'transaction':_0xd59202}));}return BPromise['all'](_0x27384b);});})['then'](function(_0x542d68){logger['info']('GetContactDialer',_0x2b9e26);logger['debug'](_0x4318('0x2b'),_0x2b9e26,JSON[_0x4318('0x10')](_0x542d68));_0x5277cd(_0x542d68);})[_0x4318('0x21')](function(_0xe03e17){logger[_0x4318('0x11')](_0x4318('0x2b'),_0xe03e17[_0x4318('0x13')],_0x2b9e26);_0x10df84(_0x48c606[_0x4318('0x11')](0x1f4,_0xe03e17[_0x4318('0x13')]));});});});};exports[_0x4318('0x34')]=function(_0xb9eb8b){var _0x292236=this;return new Promise(function(_0x5d8522,_0x2bd54e){return db[_0x4318('0x2e')]['transaction'](function(_0x2f0996){return db[_0x4318('0x35')][_0x4318('0x25')](_0xb9eb8b[_0x4318('0x28')],{'raw':_0xb9eb8b[_0x4318('0x17')]?_0xb9eb8b['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x2f0996})[_0x4318('0x1f')](function(){return db['CmHopper'][_0x4318('0x29')]({'where':_0xb9eb8b[_0x4318('0x17')]?_0xb9eb8b['options'][_0x4318('0x19')]||null:null,'transaction':_0x2f0996});});})[_0x4318('0x1f')](function(_0x185369){logger['info'](_0x4318('0x34'),_0xb9eb8b);logger[_0x4318('0xf')](_0x4318('0x34'),_0xb9eb8b,JSON['stringify'](_0x185369));_0x5d8522(_0x185369);})[_0x4318('0x21')](function(_0x551706){logger[_0x4318('0x11')](_0x4318('0x34'),_0x551706[_0x4318('0x13')],_0xb9eb8b);_0x2bd54e(_0x292236[_0x4318('0x11')](0x1f4,_0x551706['message']));});});};exports['CountReScheduled']=function(_0x949651){var _0x224029=this;return new Promise(function(_0x1ee495,_0x167566){return db[_0x4318('0x15')][_0x4318('0x16')]({'raw':_0x949651['options']?_0x949651['options']['raw']===undefined?!![]:![]:!![],'where':_0x949651[_0x4318('0x17')]?_0x949651['options']['where']||null:null,'attributes':[[db[_0x4318('0x2e')]['fn'](_0x4318('0x36'),db['sequelize']['fn']('IF',db[_0x4318('0x2e')][_0x4318('0x37')](_0x4318('0x38')+util['format'](_0x4318('0x39'),moment()[_0x4318('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x4318('0x3b')))),'contactsRescheduled']]})['then'](function(_0x32959f){logger['info'](_0x4318('0x3c'),_0x949651);logger[_0x4318('0xf')](_0x4318('0x3c'),_0x949651,JSON[_0x4318('0x10')](_0x32959f));_0x1ee495(_0x32959f);})[_0x4318('0x21')](function(_0x44b15e){logger['error']('CountReScheduled',_0x44b15e[_0x4318('0x13')],_0x949651);_0x167566(_0x224029[_0x4318('0x11')](0x1f4,_0x44b15e[_0x4318('0x13')]));});});};exports[_0x4318('0x3d')]=function(_0x3e32e3){var _0x240c72=this;return new Promise(function(_0xb84519,_0x750a50){return db[_0x4318('0x2c')]['describe']()[_0x4318('0x1f')](function(_0x2a08a9){return db['sequelize']['transaction'](function(_0x52b3eb){return db[_0x4318('0x15')]['findAll']({'where':_0x3e32e3[_0x4318('0x17')]?_0x3e32e3['options'][_0x4318('0x19')]||null:null,'attributes':_0x3e32e3['options']?_0x3e32e3[_0x4318('0x17')][_0x4318('0x1e')]||null:null,'limit':0x1,'order':_0x3e32e3[_0x4318('0x17')]?_0x3e32e3[_0x4318('0x17')][_0x4318('0x3e')]||null:null,'group':db[_0x4318('0x15')][_0x4318('0x3f')],'transaction':_0x52b3eb,'lock':_0x52b3eb[_0x4318('0x2f')]['UPDATE'],'include':_0x3e32e3[_0x4318('0x17')]?_0x3e32e3[_0x4318('0x17')][_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x3e32e3[_0x4318('0x17')][_0x4318('0x1b')],function(_0x33f846){return{'model':db[_0x33f846[_0x4318('0x1d')]],'as':_0x33f846['as'],'attributes':_0x33f846[_0x4318('0x1e')],'include':_0x33f846[_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x33f846[_0x4318('0x1b')],function(_0x282244){return{'model':db[_0x282244[_0x4318('0x1d')]],'as':_0x282244['as'],'attributes':_0x282244[_0x4318('0x1e')],'include':_0x282244[_0x4318('0x1b')]?_[_0x4318('0x1c')](_0x282244[_0x4318('0x1b')],function(_0x4d7521){return{'model':db[_0x4d7521[_0x4318('0x1d')]],'as':_0x4d7521['as'],'attributes':_0x4d7521['attributes']};}):[]};}):[]};}):[]:[]})[_0x4318('0x1f')](function(_0x27553b){var _0x11f6ce=[];for(var _0x159191=0x0;_0x159191<_0x27553b[_0x4318('0x33')];_0x159191+=0x1){_0x11f6ce[_0x4318('0x40')](_0x27553b[_0x159191][_0x4318('0x27')](_0x3e32e3['body'],{'transaction':_0x52b3eb}));}return BPromise[_0x4318('0x41')](_0x11f6ce);});})[_0x4318('0x1f')](function(_0x271d81){logger[_0x4318('0xc')](_0x4318('0x3d'),_0x3e32e3);logger[_0x4318('0xf')](_0x4318('0x3d'),_0x3e32e3,JSON['stringify'](_0x271d81));_0xb84519(_0x271d81);})[_0x4318('0x21')](function(_0x10ea8d){logger[_0x4318('0x11')](_0x4318('0x3d'),_0x10ea8d['message'],_0x3e32e3);_0x750a50(_0x240c72[_0x4318('0x11')](0x1f4,_0x10ea8d[_0x4318('0x13')]));});});});}; \ No newline at end of file +var _0xf37f=['format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','model','include','map','GetCmHopper','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','destroy','CmContact','describe','transaction','order','LOCK','UPDATE','length','push','all','GetContactDialer','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20'];(function(_0x5f5a8c,_0x3dc45b){var _0x5ca1be=function(_0x55750d){while(--_0x55750d){_0x5f5a8c['push'](_0x5f5a8c['shift']());}};_0x5ca1be(++_0x3dc45b);}(_0xf37f,0x181));var _0xff37=function(_0x2c2b98,_0x51b5b3){_0x2c2b98=_0x2c2b98-0x0;var _0x5be3ae=_0xf37f[_0x2c2b98];return _0x5be3ae;};'use strict';var _=require(_0xff37('0x0'));var util=require(_0xff37('0x1'));var moment=require('moment');var BPromise=require(_0xff37('0x2'));var rs=require(_0xff37('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xff37('0x4'))(_0xff37('0x5'));var config=require('../../config/environment');var jayson=require(_0xff37('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1821f9,_0x1d107a,_0x348295){return new BPromise(function(_0x4046fa,_0x386b13){return client[_0xff37('0x7')](_0x1821f9,_0x348295)[_0xff37('0x8')](function(_0x3325f2){logger[_0xff37('0x9')](_0xff37('0xa'),_0x1d107a,_0xff37('0xb'));logger[_0xff37('0xc')](_0xff37('0xd'),_0x1d107a,_0xff37('0xb'),JSON[_0xff37('0xe')](_0x3325f2));if(_0x3325f2[_0xff37('0xf')]){if(_0x3325f2['error'][_0xff37('0x10')]===0x1f4){logger[_0xff37('0xf')](_0xff37('0xa'),_0x1d107a,_0x3325f2[_0xff37('0xf')][_0xff37('0x11')]);return _0x386b13(_0x3325f2[_0xff37('0xf')][_0xff37('0x11')]);}logger[_0xff37('0xf')](_0xff37('0xa'),_0x1d107a,_0x3325f2['error']['message']);return _0x4046fa(_0x3325f2[_0xff37('0xf')][_0xff37('0x11')]);}else{logger[_0xff37('0x9')](_0xff37('0xa'),_0x1d107a,_0xff37('0xb'));_0x4046fa(_0x3325f2[_0xff37('0x12')][_0xff37('0x11')]);}})[_0xff37('0x13')](function(_0x15db6e){logger[_0xff37('0xf')]('CmHopper,\x20%s,\x20%s',_0x1d107a,_0x15db6e);_0x386b13(_0x15db6e);});});}exports['GetCmHopper']=function(_0x4462ea){var _0x39d7b4=this;return new Promise(function(_0x406e79,_0x159907){return db[_0xff37('0x14')][_0xff37('0x15')]({'raw':_0x4462ea['options']?_0x4462ea[_0xff37('0x16')][_0xff37('0x17')]===undefined?!![]:![]:!![],'where':_0x4462ea[_0xff37('0x16')]?_0x4462ea[_0xff37('0x16')][_0xff37('0x18')]||null:null,'attributes':_0x4462ea[_0xff37('0x16')]?_0x4462ea[_0xff37('0x16')][_0xff37('0x19')]||null:null,'limit':_0x4462ea[_0xff37('0x16')]?_0x4462ea[_0xff37('0x16')][_0xff37('0x1a')]||null:null,'include':_0x4462ea[_0xff37('0x16')]?_0x4462ea[_0xff37('0x16')]['include']?_['map'](_0x4462ea[_0xff37('0x16')]['include'],function(_0xf6769b){return{'model':db[_0xf6769b[_0xff37('0x1b')]],'as':_0xf6769b['as'],'attributes':_0xf6769b['attributes'],'include':_0xf6769b[_0xff37('0x1c')]?_['map'](_0xf6769b['include'],function(_0x29a7fc){return{'model':db[_0x29a7fc['model']],'as':_0x29a7fc['as'],'attributes':_0x29a7fc[_0xff37('0x19')],'include':_0x29a7fc[_0xff37('0x1c')]?_[_0xff37('0x1d')](_0x29a7fc['include'],function(_0x2c2c69){return{'model':db[_0x2c2c69['model']],'as':_0x2c2c69['as'],'attributes':_0x2c2c69['attributes']};}):[]};}):[]};}):[]:[]})[_0xff37('0x8')](function(_0x3adf5f){logger[_0xff37('0x9')](_0xff37('0x1e'),_0x4462ea);logger['debug'](_0xff37('0x1e'),_0x4462ea,JSON['stringify'](_0x3adf5f));_0x406e79(_0x3adf5f);})['catch'](function(_0x55d68c){logger[_0xff37('0xf')](_0xff37('0x1e'),_0x55d68c[_0xff37('0x11')],_0x4462ea);_0x159907(_0x39d7b4['error'](0x1f4,_0x55d68c[_0xff37('0x11')]));});});};exports[_0xff37('0x1f')]=function(_0x2aaafb){var _0x278285=this;return new Promise(function(_0xb93d64,_0x58b549){return db[_0xff37('0x14')]['find']({'raw':_0x2aaafb['options']?_0x2aaafb[_0xff37('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2aaafb['options']?_0x2aaafb[_0xff37('0x16')]['where']||null:null,'attributes':_0x2aaafb[_0xff37('0x16')]?_0x2aaafb[_0xff37('0x16')][_0xff37('0x19')]||null:null,'include':_0x2aaafb['options']?_0x2aaafb['options']['include']?_[_0xff37('0x1d')](_0x2aaafb[_0xff37('0x16')][_0xff37('0x1c')],function(_0x413e42){return{'model':db[_0x413e42[_0xff37('0x1b')]],'as':_0x413e42['as'],'attributes':_0x413e42[_0xff37('0x19')],'include':_0x413e42[_0xff37('0x1c')]?_['map'](_0x413e42[_0xff37('0x1c')],function(_0x2d2fbf){return{'model':db[_0x2d2fbf[_0xff37('0x1b')]],'as':_0x2d2fbf['as'],'attributes':_0x2d2fbf[_0xff37('0x19')],'include':_0x2d2fbf[_0xff37('0x1c')]?_[_0xff37('0x1d')](_0x2d2fbf[_0xff37('0x1c')],function(_0x534191){return{'model':db[_0x534191['model']],'as':_0x534191['as'],'attributes':_0x534191[_0xff37('0x19')]};}):[]};}):[]};}):[]:[]})[_0xff37('0x8')](function(_0x839133){logger[_0xff37('0x9')](_0xff37('0x1f'),_0x2aaafb);logger[_0xff37('0xc')](_0xff37('0x1f'),_0x2aaafb,JSON[_0xff37('0xe')](_0x839133));_0xb93d64(_0x839133);})[_0xff37('0x13')](function(_0x34ada3){logger[_0xff37('0xf')](_0xff37('0x1f'),_0x34ada3['message'],_0x2aaafb);_0x58b549(_0x278285['error'](0x1f4,_0x34ada3[_0xff37('0x11')]));});});};exports[_0xff37('0x20')]=function(_0x17c478){var _0x22b42a=this;return new Promise(function(_0x152b01,_0x212a76){return db['CmHopper'][_0xff37('0x21')](_0x17c478['body'],{'raw':_0x17c478['options']?_0x17c478['options'][_0xff37('0x17')]===undefined?!![]:![]:!![]})[_0xff37('0x8')](function(_0x47f977){logger[_0xff37('0x9')](_0xff37('0x20'),_0x17c478);logger[_0xff37('0xc')]('CreateCmHopper',_0x17c478,JSON['stringify'](_0x47f977));_0x152b01(_0x47f977);})[_0xff37('0x13')](function(_0x5f49b8){logger[_0xff37('0xf')](_0xff37('0x20'),_0x5f49b8[_0xff37('0x11')],_0x17c478);_0x212a76(_0x22b42a[_0xff37('0xf')](0x1f4,_0x5f49b8[_0xff37('0x11')]));});});};exports[_0xff37('0x22')]=function(_0x576b17){var _0x10af5a=this;return new Promise(function(_0x265f9a,_0x2ac84c){return db['CmHopper'][_0xff37('0x23')](_0x576b17[_0xff37('0x24')],{'raw':_0x576b17[_0xff37('0x16')]?_0x576b17[_0xff37('0x16')][_0xff37('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576b17[_0xff37('0x16')]?_0x576b17['options'][_0xff37('0x18')]||null:null,'attributes':_0x576b17['options']?_0x576b17[_0xff37('0x16')][_0xff37('0x19')]||null:null,'limit':_0x576b17[_0xff37('0x16')]?_0x576b17[_0xff37('0x16')][_0xff37('0x1a')]||null:null})['then'](function(_0x2afbc4){logger[_0xff37('0x9')](_0xff37('0x22'),_0x576b17);logger[_0xff37('0xc')](_0xff37('0x22'),_0x576b17,JSON[_0xff37('0xe')](_0x2afbc4));_0x265f9a(_0x2afbc4);})['catch'](function(_0x37da53){logger[_0xff37('0xf')](_0xff37('0x22'),_0x37da53[_0xff37('0x11')],_0x576b17);_0x2ac84c(_0x10af5a[_0xff37('0xf')](0x1f4,_0x37da53['message']));});});};exports[_0xff37('0x25')]=function(_0x5d7729){var _0x30ba04=this;return new Promise(function(_0x4ba65d,_0x1e10c7){return db['CmHopper'][_0xff37('0x26')]({'where':_0x5d7729[_0xff37('0x16')]?_0x5d7729[_0xff37('0x16')]['where']||null:null})[_0xff37('0x8')](function(_0x219389){logger['info'](_0xff37('0x25'),_0x5d7729);logger[_0xff37('0xc')](_0xff37('0x25'),_0x5d7729,JSON[_0xff37('0xe')](_0x219389));_0x4ba65d(_0x219389);})[_0xff37('0x13')](function(_0x4f9132){logger[_0xff37('0xf')](_0xff37('0x25'),_0x4f9132['message'],_0x5d7729);_0x1e10c7(_0x30ba04[_0xff37('0xf')](0x1f4,_0x4f9132[_0xff37('0x11')]));});});};exports['GetContactDialer']=function(_0x4a8066){var _0x157bc4=this;return new Promise(function(_0xb1d4a9,_0x2947a0){return db[_0xff37('0x27')][_0xff37('0x28')]()[_0xff37('0x8')](function(_0x173012){return db['sequelize'][_0xff37('0x29')](function(_0x547118){return db[_0xff37('0x14')]['findAll']({'where':_0x4a8066['options']?_0x4a8066['options']['where']||null:null,'attributes':_0x4a8066[_0xff37('0x16')]?_0x4a8066[_0xff37('0x16')][_0xff37('0x19')]||null:null,'limit':_0x4a8066[_0xff37('0x16')]?_0x4a8066[_0xff37('0x16')]['limit']||null:null,'order':_0x4a8066['options']?_0x4a8066[_0xff37('0x16')][_0xff37('0x2a')]||null:null,'transaction':_0x547118,'lock':_0x547118[_0xff37('0x2b')][_0xff37('0x2c')],'include':[{'model':db[_0xff37('0x27')],'as':'Contact','attributes':_['keys'](_0x173012)}]})[_0xff37('0x8')](function(_0x206457){var _0x23060e=[];for(var _0x313bc4=0x0;_0x313bc4<_0x206457[_0xff37('0x2d')];_0x313bc4+=0x1){_0x23060e[_0xff37('0x2e')](_0x206457[_0x313bc4]['update'](_0x4a8066['body'],{'transaction':_0x547118}));}return BPromise[_0xff37('0x2f')](_0x23060e);});})[_0xff37('0x8')](function(_0x1c4beb){logger[_0xff37('0x9')]('GetContactDialer',_0x4a8066);logger['debug'](_0xff37('0x30'),_0x4a8066,JSON['stringify'](_0x1c4beb));_0xb1d4a9(_0x1c4beb);})[_0xff37('0x13')](function(_0x2b0654){logger[_0xff37('0xf')](_0xff37('0x30'),_0x2b0654['message'],_0x4a8066);_0x2947a0(_0x157bc4['error'](0x1f4,_0x2b0654['message']));});});});};exports[_0xff37('0x31')]=function(_0x38777a){var _0x2f169f=this;return new Promise(function(_0x3fd77a,_0x5d44d3){return db[_0xff37('0x32')][_0xff37('0x29')](function(_0x144c01){return db[_0xff37('0x33')][_0xff37('0x21')](_0x38777a[_0xff37('0x24')],{'raw':_0x38777a[_0xff37('0x16')]?_0x38777a[_0xff37('0x16')][_0xff37('0x17')]===undefined?!![]:![]:!![],'transaction':_0x144c01})[_0xff37('0x8')](function(){return db[_0xff37('0x14')]['destroy']({'where':_0x38777a[_0xff37('0x16')]?_0x38777a[_0xff37('0x16')]['where']||null:null,'transaction':_0x144c01});});})[_0xff37('0x8')](function(_0x2a5002){logger[_0xff37('0x9')](_0xff37('0x31'),_0x38777a);logger[_0xff37('0xc')](_0xff37('0x31'),_0x38777a,JSON[_0xff37('0xe')](_0x2a5002));_0x3fd77a(_0x2a5002);})[_0xff37('0x13')](function(_0x437229){logger[_0xff37('0xf')]('MoveContactManagedDialer',_0x437229[_0xff37('0x11')],_0x38777a);_0x5d44d3(_0x2f169f[_0xff37('0xf')](0x1f4,_0x437229[_0xff37('0x11')]));});});};exports[_0xff37('0x34')]=function(_0x132a02){var _0x40f183=this;return new Promise(function(_0x36dae4,_0x1633c7){return db['CmHopper'][_0xff37('0x15')]({'raw':_0x132a02[_0xff37('0x16')]?_0x132a02[_0xff37('0x16')][_0xff37('0x17')]===undefined?!![]:![]:!![],'where':_0x132a02[_0xff37('0x16')]?_0x132a02[_0xff37('0x16')][_0xff37('0x18')]||null:null,'attributes':[[db[_0xff37('0x32')]['fn'](_0xff37('0x35'),db[_0xff37('0x32')]['fn']('IF',db[_0xff37('0x32')][_0xff37('0x36')](_0xff37('0x37')+util[_0xff37('0x38')](_0xff37('0x39'),moment()['format'](_0xff37('0x3a')))+_0xff37('0x3b')))),_0xff37('0x3c')]]})[_0xff37('0x8')](function(_0x4d46ab){logger[_0xff37('0x9')](_0xff37('0x34'),_0x132a02);logger[_0xff37('0xc')]('CountReScheduled',_0x132a02,JSON[_0xff37('0xe')](_0x4d46ab));_0x36dae4(_0x4d46ab);})[_0xff37('0x13')](function(_0x408c8f){logger[_0xff37('0xf')](_0xff37('0x34'),_0x408c8f[_0xff37('0x11')],_0x132a02);_0x1633c7(_0x40f183[_0xff37('0xf')](0x1f4,_0x408c8f[_0xff37('0x11')]));});});};exports[_0xff37('0x3d')]=function(_0x4d69bc){var _0x834a48=this;return new Promise(function(_0x5ec7cd,_0xe06f6a){return db[_0xff37('0x27')][_0xff37('0x28')]()['then'](function(_0x597748){return db[_0xff37('0x32')]['transaction'](function(_0x1ca858){return db['CmHopper']['findAll']({'where':_0x4d69bc['options']?_0x4d69bc[_0xff37('0x16')]['where']||null:null,'attributes':_0x4d69bc[_0xff37('0x16')]?_0x4d69bc[_0xff37('0x16')][_0xff37('0x19')]||null:null,'limit':0x1,'order':_0x4d69bc[_0xff37('0x16')]?_0x4d69bc[_0xff37('0x16')][_0xff37('0x2a')]||null:null,'group':db[_0xff37('0x14')][_0xff37('0x3e')],'transaction':_0x1ca858,'lock':_0x1ca858[_0xff37('0x2b')][_0xff37('0x2c')],'include':_0x4d69bc[_0xff37('0x16')]?_0x4d69bc['options'][_0xff37('0x1c')]?_['map'](_0x4d69bc[_0xff37('0x16')][_0xff37('0x1c')],function(_0x2cdccf){return{'model':db[_0x2cdccf[_0xff37('0x1b')]],'as':_0x2cdccf['as'],'attributes':_0x2cdccf['attributes'],'include':_0x2cdccf[_0xff37('0x1c')]?_['map'](_0x2cdccf['include'],function(_0x17a391){return{'model':db[_0x17a391[_0xff37('0x1b')]],'as':_0x17a391['as'],'attributes':_0x17a391[_0xff37('0x19')],'include':_0x17a391['include']?_[_0xff37('0x1d')](_0x17a391[_0xff37('0x1c')],function(_0x1707da){return{'model':db[_0x1707da[_0xff37('0x1b')]],'as':_0x1707da['as'],'attributes':_0x1707da[_0xff37('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed9c2){var _0x36bbce=[];for(var _0x1c534f=0x0;_0x1c534f<_0x1ed9c2[_0xff37('0x2d')];_0x1c534f+=0x1){_0x36bbce['push'](_0x1ed9c2[_0x1c534f]['update'](_0x4d69bc[_0xff37('0x24')],{'transaction':_0x1ca858}));}return BPromise[_0xff37('0x2f')](_0x36bbce);});})[_0xff37('0x8')](function(_0x3cee2c){logger[_0xff37('0x9')](_0xff37('0x3d'),_0x4d69bc);logger[_0xff37('0xc')](_0xff37('0x3d'),_0x4d69bc,JSON[_0xff37('0xe')](_0x3cee2c));_0x5ec7cd(_0x3cee2c);})['catch'](function(_0x400603){logger['error'](_0xff37('0x3d'),_0x400603[_0xff37('0x11')],_0x4d69bc);_0xe06f6a(_0x834a48[_0xff37('0xf')](0x1f4,_0x400603['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d87a50e..ff535f5 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 _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x1d9a40,_0x456622){var _0x482d61=function(_0x4236f0){while(--_0x4236f0){_0x1d9a40['push'](_0x1d9a40['shift']());}};_0x482d61(++_0x456622);}(_0x7a54,0x106));var _0x47a5=function(_0x135003,_0x2eb78e){_0x135003=_0x135003-0x0;var _0x120234=_0x7a54[_0x135003];return _0x120234;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 48a217f..a7124bb 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 _0xcde9=['moment','sequelize','INTEGER','contactListQueue'];(function(_0x1d792c,_0x5473a7){var _0x4584e5=function(_0x32122e){while(--_0x32122e){_0x1d792c['push'](_0x1d792c['shift']());}};_0x4584e5(++_0x5473a7);}(_0xcde9,0x16c));var _0x9cde=function(_0x200453,_0x295906){_0x200453=_0x200453-0x0;var _0x59c4f8=_0xcde9[_0x200453];return _0x59c4f8;};'use strict';var moment=require(_0x9cde('0x0'));var Sequelize=require(_0x9cde('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9cde('0x2')],'unique':_0x9cde('0x3')},'ListId':{'type':Sequelize[_0x9cde('0x2')],'unique':_0x9cde('0x3')},'VoiceQueueId':{'type':Sequelize[_0x9cde('0x2')],'unique':_0x9cde('0x3')}}; \ No newline at end of file +var _0xb6d8=['contactListQueue','INTEGER','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb6d8,0x1b5));var _0x8b6d=function(_0x23e376,_0x15395b){_0x23e376=_0x23e376-0x0;var _0x6f2806=_0xb6d8[_0x23e376];return _0x6f2806;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8b6d('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x8b6d('0x1')},'ListId':{'type':Sequelize[_0x8b6d('0x2')],'unique':_0x8b6d('0x1')},'VoiceQueueId':{'type':Sequelize[_0x8b6d('0x2')],'unique':_0x8b6d('0x1')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 6e91b8d..dfa94d5 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 _0xef3e=['index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','key','field','options','includeAll','include','findAll','rows','catch','params','length','find','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xef3e,0x17c));var _0xeef3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xef3e[_0x465a0c];return _0x1e202e;};'use strict';var pdf=require(_0xeef3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeef3('0x1'));var jsonpatch=require(_0xeef3('0x2'));var rp=require(_0xeef3('0x3'));var moment=require(_0xeef3('0x4'));var BPromise=require(_0xeef3('0x5'));var Mustache=require(_0xeef3('0x6'));var util=require('util');var path=require(_0xeef3('0x7'));var sox=require(_0xeef3('0x8'));var csv=require(_0xeef3('0x9'));var ejs=require(_0xeef3('0xa'));var fs=require('fs');var _=require(_0xeef3('0xb'));var squel=require(_0xeef3('0xc'));var crypto=require(_0xeef3('0xd'));var jsforce=require(_0xeef3('0xe'));var deskjs=require(_0xeef3('0xf'));var toCsv=require(_0xeef3('0x9'));var querystring=require(_0xeef3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeef3('0x11'));var qs=require(_0xeef3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeef3('0x13'))(_0xeef3('0x14'));var utils=require('../../config/utils');var config=require(_0xeef3('0x15'));var db=require(_0xeef3('0x16'))['db'];function respondWithStatusCode(_0x24ab43,_0x599c6b){_0x599c6b=_0x599c6b||0xcc;return function(_0x3c0d28){if(_0x3c0d28){return _0x24ab43['sendStatus'](_0x599c6b);}return _0x24ab43[_0xeef3('0x17')](_0x599c6b)[_0xeef3('0x18')]();};}function respondWithResult(_0x35f181,_0x14374c){_0x14374c=_0x14374c||0xc8;return function(_0xc9cdf8){if(_0xc9cdf8){return _0x35f181['status'](_0x14374c)[_0xeef3('0x19')](_0xc9cdf8);}};}function respondWithFilteredResult(_0x32fc5f,_0x2f9aca){return function(_0x5d0b9e){if(_0x5d0b9e){var _0x3435f4=_0x5d0b9e[_0xeef3('0x1a')],_0xfa4b38=_0x2f9aca[_0xeef3('0x1b')],_0x41ec2c=_0x2f9aca[_0xeef3('0x1b')]+_0x2f9aca[_0xeef3('0x1c')],_0x4da274;if(_0x41ec2c>=_0x3435f4){_0x41ec2c=_0x3435f4;_0x4da274=0xc8;}else{_0x4da274=0xce;}_0x32fc5f[_0xeef3('0x17')](_0x4da274);return _0x32fc5f[_0xeef3('0x1d')](_0xeef3('0x1e'),_0xfa4b38+'-'+_0x41ec2c+'/'+_0x3435f4)[_0xeef3('0x19')](_0x5d0b9e);}return null;};}function patchUpdates(_0x66c1dd){return function(_0x28454e){try{jsonpatch['apply'](_0x28454e,_0x66c1dd,!![]);}catch(_0x32a3cc){return BPromise[_0xeef3('0x1f')](_0x32a3cc);}return _0x28454e[_0xeef3('0x20')]();};}function saveUpdates(_0x45b536,_0x514d5f){return function(_0x571504){if(_0x571504){return _0x571504[_0xeef3('0x21')](_0x45b536)['then'](function(_0x46d22b){return _0x46d22b;});}return null;};}function removeEntity(_0x5a279a,_0x23140d){return function(_0x281ee6){if(_0x281ee6){return _0x281ee6[_0xeef3('0x22')]()[_0xeef3('0x23')](function(){_0x5a279a[_0xeef3('0x17')](0xcc)[_0xeef3('0x18')]();});}};}function handleEntityNotFound(_0x4b61d5,_0x3daf54){return function(_0x1dedbc){if(!_0x1dedbc){_0x4b61d5[_0xeef3('0x24')](0x194);}return _0x1dedbc;};}function handleError(_0x85bbdc,_0x16add4){_0x16add4=_0x16add4||0x1f4;return function(_0x2e1ebc){logger['error'](_0x2e1ebc[_0xeef3('0x25')]);if(_0x2e1ebc[_0xeef3('0x26')]){delete _0x2e1ebc['name'];}_0x85bbdc['status'](_0x16add4)[_0xeef3('0x27')](_0x2e1ebc);};}exports[_0xeef3('0x28')]=function(_0x3855d8,_0xc98d32){var _0x587a84={},_0x13fd00={},_0xa06da5={'count':0x0,'rows':[]};var _0x2f8277=db[_0xeef3('0x29')][_0xeef3('0x2a')];_0x13fd00[_0xeef3('0x2b')]=_[_0xeef3('0x2c')](_0x2f8277);_0x13fd00['query']=_[_0xeef3('0x2c')](_0x3855d8[_0xeef3('0x2d')]);_0x13fd00[_0xeef3('0x2e')]=_[_0xeef3('0x2f')](_0x13fd00[_0xeef3('0x2b')],_0x13fd00[_0xeef3('0x2d')]);_0x587a84[_0xeef3('0x30')]=_['intersection'](_0x13fd00[_0xeef3('0x2b')],qs[_0xeef3('0x31')](_0x3855d8[_0xeef3('0x2d')]['fields']));_0x587a84[_0xeef3('0x30')]=_0x587a84['attributes']['length']?_0x587a84[_0xeef3('0x30')]:_0x13fd00['model'];if(!_0x3855d8[_0xeef3('0x2d')][_0xeef3('0x32')]('nolimit')){_0x587a84[_0xeef3('0x1c')]=qs[_0xeef3('0x1c')](_0x3855d8[_0xeef3('0x2d')][_0xeef3('0x1c')]);_0x587a84['offset']=qs[_0xeef3('0x1b')](_0x3855d8[_0xeef3('0x2d')][_0xeef3('0x1b')]);}_0x587a84[_0xeef3('0x33')]=qs[_0xeef3('0x34')](_0x3855d8[_0xeef3('0x2d')]['sort']);_0x587a84[_0xeef3('0x35')]=qs[_0xeef3('0x2e')](_[_0xeef3('0x36')](_0x3855d8[_0xeef3('0x2d')],_0x13fd00[_0xeef3('0x2e')]));if(_0x3855d8[_0xeef3('0x2d')][_0xeef3('0x37')]){_0x587a84[_0xeef3('0x35')]=_[_0xeef3('0x38')](_0x587a84['where'],{'$or':_['map'](_0x2f8277,function(_0x4acd07){if(_0x4acd07['type'][_0xeef3('0x39')]!=='VIRTUAL'){var _0x442156={};_0x442156[_0x4acd07[_0xeef3('0x3a')]]={'$like':'%'+_0x3855d8['query'][_0xeef3('0x37')]+'%'};return _0x442156;}})});}_0x587a84=_[_0xeef3('0x38')]({},_0x587a84,_0x3855d8[_0xeef3('0x3b')]);var _0x77f2f0={'where':_0x587a84['where']};return db[_0xeef3('0x29')]['count'](_0x77f2f0)['then'](function(_0x2d8bbb){_0xa06da5['count']=_0x2d8bbb;if(_0x3855d8[_0xeef3('0x2d')][_0xeef3('0x3c')]){_0x587a84[_0xeef3('0x3d')]=[{'all':!![]}];}return db[_0xeef3('0x29')][_0xeef3('0x3e')](_0x587a84);})[_0xeef3('0x23')](function(_0x443565){_0xa06da5[_0xeef3('0x3f')]=_0x443565;return _0xa06da5;})[_0xeef3('0x23')](respondWithFilteredResult(_0xc98d32,_0x587a84))[_0xeef3('0x40')](handleError(_0xc98d32,null));};exports['show']=function(_0x2bd518,_0x345592){var _0x46b556={'raw':!![],'where':{'id':_0x2bd518[_0xeef3('0x41')]['id']}},_0x5ebdef={};_0x5ebdef[_0xeef3('0x2b')]=_[_0xeef3('0x2c')](db[_0xeef3('0x29')][_0xeef3('0x2a')]);_0x5ebdef[_0xeef3('0x2d')]=_['keys'](_0x2bd518[_0xeef3('0x2d')]);_0x5ebdef[_0xeef3('0x2e')]=_['intersection'](_0x5ebdef[_0xeef3('0x2b')],_0x5ebdef[_0xeef3('0x2d')]);_0x46b556[_0xeef3('0x30')]=_[_0xeef3('0x2f')](_0x5ebdef[_0xeef3('0x2b')],qs['fields'](_0x2bd518[_0xeef3('0x2d')][_0xeef3('0x31')]));_0x46b556[_0xeef3('0x30')]=_0x46b556[_0xeef3('0x30')][_0xeef3('0x42')]?_0x46b556[_0xeef3('0x30')]:_0x5ebdef[_0xeef3('0x2b')];if(_0x2bd518[_0xeef3('0x2d')]['includeAll']){_0x46b556[_0xeef3('0x3d')]=[{'all':!![]}];}_0x46b556=_[_0xeef3('0x38')]({},_0x46b556,_0x2bd518['options']);return db[_0xeef3('0x29')][_0xeef3('0x43')](_0x46b556)['then'](handleEntityNotFound(_0x345592,null))[_0xeef3('0x23')](respondWithResult(_0x345592,null))['catch'](handleError(_0x345592,null));};exports['update']=function(_0x2f9519,_0x29ccfb){if(_0x2f9519[_0xeef3('0x44')]['id']){delete _0x2f9519[_0xeef3('0x44')]['id'];}return db[_0xeef3('0x29')][_0xeef3('0x43')]({'where':{'id':_0x2f9519['params']['id']}})[_0xeef3('0x23')](handleEntityNotFound(_0x29ccfb,null))[_0xeef3('0x23')](saveUpdates(_0x2f9519[_0xeef3('0x44')],null))[_0xeef3('0x23')](respondWithResult(_0x29ccfb,null))[_0xeef3('0x40')](handleError(_0x29ccfb,null));};exports['destroy']=function(_0x50e61e,_0x48535d){return db[_0xeef3('0x29')][_0xeef3('0x43')]({'where':{'id':_0x50e61e[_0xeef3('0x41')]['id']}})[_0xeef3('0x23')](handleEntityNotFound(_0x48535d,null))['then'](removeEntity(_0x48535d,null))[_0xeef3('0x40')](handleError(_0x48535d,null));};exports[_0xeef3('0x45')]=function(_0x48e6a7,_0x569be6){return db[_0xeef3('0x29')][_0xeef3('0x45')]()[_0xeef3('0x23')](respondWithResult(_0x569be6,null))[_0xeef3('0x40')](handleError(_0x569be6,null));}; \ No newline at end of file +var _0xf042=['request-promise','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','include','find','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0xf042,0x164));var _0x2f04=function(_0x20d188,_0x385b6e){_0x20d188=_0x20d188-0x0;var _0x3711dc=_0xf042[_0x20d188];return _0x3711dc;};'use strict';var pdf=require(_0x2f04('0x0'));var emlformat=require(_0x2f04('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2f04('0x2'));var jsonpatch=require(_0x2f04('0x3'));var rp=require(_0x2f04('0x4'));var moment=require('moment');var BPromise=require(_0x2f04('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2f04('0x6'));var sox=require(_0x2f04('0x7'));var csv=require('to-csv');var ejs=require(_0x2f04('0x8'));var fs=require('fs');var _=require(_0x2f04('0x9'));var squel=require(_0x2f04('0xa'));var crypto=require(_0x2f04('0xb'));var jsforce=require(_0x2f04('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2f04('0xd'));var querystring=require(_0x2f04('0xe'));var Papa=require(_0x2f04('0xf'));var Redis=require(_0x2f04('0x10'));var authService=require(_0x2f04('0x11'));var qs=require(_0x2f04('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f04('0x13'))(_0x2f04('0x14'));var utils=require(_0x2f04('0x15'));var config=require('../../config/environment');var db=require(_0x2f04('0x16'))['db'];function respondWithStatusCode(_0x59aac7,_0x107678){_0x107678=_0x107678||0xcc;return function(_0x635791){if(_0x635791){return _0x59aac7[_0x2f04('0x17')](_0x107678);}return _0x59aac7[_0x2f04('0x18')](_0x107678)[_0x2f04('0x19')]();};}function respondWithResult(_0x529de6,_0x2f42db){_0x2f42db=_0x2f42db||0xc8;return function(_0x29bf27){if(_0x29bf27){return _0x529de6['status'](_0x2f42db)[_0x2f04('0x1a')](_0x29bf27);}};}function respondWithFilteredResult(_0x4cdfa5,_0x5cd938){return function(_0x54ae1c){if(_0x54ae1c){var _0x2ca79c=_0x54ae1c[_0x2f04('0x1b')],_0x1a1b58=_0x5cd938[_0x2f04('0x1c')],_0x5cc27f=_0x5cd938[_0x2f04('0x1c')]+_0x5cd938[_0x2f04('0x1d')],_0xecef25;if(_0x5cc27f>=_0x2ca79c){_0x5cc27f=_0x2ca79c;_0xecef25=0xc8;}else{_0xecef25=0xce;}_0x4cdfa5['status'](_0xecef25);return _0x4cdfa5['set'](_0x2f04('0x1e'),_0x1a1b58+'-'+_0x5cc27f+'/'+_0x2ca79c)[_0x2f04('0x1a')](_0x54ae1c);}return null;};}function patchUpdates(_0x47f3d7){return function(_0x40975c){try{jsonpatch[_0x2f04('0x1f')](_0x40975c,_0x47f3d7,!![]);}catch(_0x29083d){return BPromise[_0x2f04('0x20')](_0x29083d);}return _0x40975c[_0x2f04('0x21')]();};}function saveUpdates(_0x235556,_0x100a6b){return function(_0x5450a8){if(_0x5450a8){return _0x5450a8[_0x2f04('0x22')](_0x235556)['then'](function(_0xcd8f60){return _0xcd8f60;});}return null;};}function removeEntity(_0x58dc33,_0x4f2869){return function(_0x3f0822){if(_0x3f0822){return _0x3f0822[_0x2f04('0x23')]()[_0x2f04('0x24')](function(){_0x58dc33[_0x2f04('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x727e27,_0x366fe8){return function(_0x45e43d){if(!_0x45e43d){_0x727e27['sendStatus'](0x194);}return _0x45e43d;};}function handleError(_0x54bea1,_0x42187d){_0x42187d=_0x42187d||0x1f4;return function(_0x370425){logger[_0x2f04('0x25')](_0x370425[_0x2f04('0x26')]);if(_0x370425[_0x2f04('0x27')]){delete _0x370425['name'];}_0x54bea1[_0x2f04('0x18')](_0x42187d)[_0x2f04('0x28')](_0x370425);};}exports['index']=function(_0x23273b,_0x531293){var _0x49c334={},_0xe03e4={},_0x51f1b0={'count':0x0,'rows':[]};var _0x1c1712=db[_0x2f04('0x29')][_0x2f04('0x2a')];_0xe03e4[_0x2f04('0x2b')]=_[_0x2f04('0x2c')](_0x1c1712);_0xe03e4[_0x2f04('0x2d')]=_[_0x2f04('0x2c')](_0x23273b[_0x2f04('0x2d')]);_0xe03e4[_0x2f04('0x2e')]=_[_0x2f04('0x2f')](_0xe03e4[_0x2f04('0x2b')],_0xe03e4[_0x2f04('0x2d')]);_0x49c334[_0x2f04('0x30')]=_[_0x2f04('0x2f')](_0xe03e4[_0x2f04('0x2b')],qs[_0x2f04('0x31')](_0x23273b[_0x2f04('0x2d')]['fields']));_0x49c334['attributes']=_0x49c334['attributes'][_0x2f04('0x32')]?_0x49c334[_0x2f04('0x30')]:_0xe03e4[_0x2f04('0x2b')];if(!_0x23273b[_0x2f04('0x2d')]['hasOwnProperty'](_0x2f04('0x33'))){_0x49c334['limit']=qs['limit'](_0x23273b['query'][_0x2f04('0x1d')]);_0x49c334[_0x2f04('0x1c')]=qs[_0x2f04('0x1c')](_0x23273b['query'][_0x2f04('0x1c')]);}_0x49c334[_0x2f04('0x34')]=qs[_0x2f04('0x35')](_0x23273b[_0x2f04('0x2d')][_0x2f04('0x35')]);_0x49c334[_0x2f04('0x36')]=qs[_0x2f04('0x2e')](_[_0x2f04('0x37')](_0x23273b[_0x2f04('0x2d')],_0xe03e4[_0x2f04('0x2e')]));if(_0x23273b['query'][_0x2f04('0x38')]){_0x49c334[_0x2f04('0x36')]=_[_0x2f04('0x39')](_0x49c334[_0x2f04('0x36')],{'$or':_['map'](_0x1c1712,function(_0x456df0){if(_0x456df0[_0x2f04('0x3a')][_0x2f04('0x3b')]!==_0x2f04('0x3c')){var _0x5c0e80={};_0x5c0e80[_0x456df0[_0x2f04('0x3d')]]={'$like':'%'+_0x23273b['query']['filter']+'%'};return _0x5c0e80;}})});}_0x49c334=_['merge']({},_0x49c334,_0x23273b[_0x2f04('0x3e')]);var _0x3e031b={'where':_0x49c334[_0x2f04('0x36')]};return db['CmHopperBlack'][_0x2f04('0x1b')](_0x3e031b)['then'](function(_0x26e689){_0x51f1b0['count']=_0x26e689;if(_0x23273b[_0x2f04('0x2d')][_0x2f04('0x3f')]){_0x49c334['include']=[{'all':!![]}];}return db[_0x2f04('0x29')][_0x2f04('0x40')](_0x49c334);})['then'](function(_0x5d8d3a){_0x51f1b0[_0x2f04('0x41')]=_0x5d8d3a;return _0x51f1b0;})[_0x2f04('0x24')](respondWithFilteredResult(_0x531293,_0x49c334))[_0x2f04('0x42')](handleError(_0x531293,null));};exports['show']=function(_0x6ca314,_0x16c9cc){var _0x554578={'raw':!![],'where':{'id':_0x6ca314[_0x2f04('0x43')]['id']}},_0x226b26={};_0x226b26[_0x2f04('0x2b')]=_['keys'](db[_0x2f04('0x29')][_0x2f04('0x2a')]);_0x226b26[_0x2f04('0x2d')]=_['keys'](_0x6ca314[_0x2f04('0x2d')]);_0x226b26['filters']=_['intersection'](_0x226b26[_0x2f04('0x2b')],_0x226b26[_0x2f04('0x2d')]);_0x554578[_0x2f04('0x30')]=_[_0x2f04('0x2f')](_0x226b26[_0x2f04('0x2b')],qs[_0x2f04('0x31')](_0x6ca314[_0x2f04('0x2d')]['fields']));_0x554578[_0x2f04('0x30')]=_0x554578['attributes'][_0x2f04('0x32')]?_0x554578[_0x2f04('0x30')]:_0x226b26[_0x2f04('0x2b')];if(_0x6ca314[_0x2f04('0x2d')][_0x2f04('0x3f')]){_0x554578[_0x2f04('0x44')]=[{'all':!![]}];}_0x554578=_[_0x2f04('0x39')]({},_0x554578,_0x6ca314[_0x2f04('0x3e')]);return db[_0x2f04('0x29')][_0x2f04('0x45')](_0x554578)['then'](handleEntityNotFound(_0x16c9cc,null))[_0x2f04('0x24')](respondWithResult(_0x16c9cc,null))[_0x2f04('0x42')](handleError(_0x16c9cc,null));};exports[_0x2f04('0x22')]=function(_0x12bc47,_0xf8f574){if(_0x12bc47[_0x2f04('0x46')]['id']){delete _0x12bc47['body']['id'];}return db[_0x2f04('0x29')]['find']({'where':{'id':_0x12bc47['params']['id']}})['then'](handleEntityNotFound(_0xf8f574,null))[_0x2f04('0x24')](saveUpdates(_0x12bc47[_0x2f04('0x46')],null))[_0x2f04('0x24')](respondWithResult(_0xf8f574,null))['catch'](handleError(_0xf8f574,null));};exports['destroy']=function(_0x494e64,_0x49dfb3){return db['CmHopperBlack']['find']({'where':{'id':_0x494e64[_0x2f04('0x43')]['id']}})[_0x2f04('0x24')](handleEntityNotFound(_0x49dfb3,null))[_0x2f04('0x24')](removeEntity(_0x49dfb3,null))[_0x2f04('0x42')](handleError(_0x49dfb3,null));};exports['describe']=function(_0x5c14a4,_0x4df83a){return db[_0x2f04('0x29')][_0x2f04('0x47')]()['then'](respondWithResult(_0x4df83a,null))['catch'](handleError(_0x4df83a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 77e4854..25e4311 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 _0x9c44=['request-promise','path','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird'];(function(_0x458656,_0x5928de){var _0x1ab671=function(_0x4df933){while(--_0x4df933){_0x458656['push'](_0x458656['shift']());}};_0x1ab671(++_0x5928de);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['cm_hopper_black','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes'];(function(_0x372047,_0x7f5c2b){var _0x44f282=function(_0x5a3d1c){while(--_0x5a3d1c){_0x372047['push'](_0x372047['shift']());}};_0x44f282(++_0x7f5c2b);}(_0x70e0,0x17b));var _0x070e=function(_0x742174,_0x146099){_0x742174=_0x742174-0x0;var _0x2163e6=_0x70e0[_0x742174];return _0x2163e6;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmHopperBlack',attributes,{'tableName':_0x070e('0x8'),'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 6c75fc1..bc4cfb0 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 _0xe676=['CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','raw','options','where','attributes','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','limit','DestroyCmHopperBlack','destroy','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1f5480,_0x18a141){var _0x52cb63=function(_0x549c06){while(--_0x549c06){_0x1f5480['push'](_0x1f5480['shift']());}};_0x52cb63(++_0x18a141);}(_0xe676,0xdc));var _0x6e67=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xe676[_0x367e5b];return _0x4b909e;};'use strict';var _=require('lodash');var util=require(_0x6e67('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e67('0x1'));var fs=require('fs');var Redis=require(_0x6e67('0x2'));var db=require(_0x6e67('0x3'))['db'];var utils=require(_0x6e67('0x4'));var logger=require(_0x6e67('0x5'))(_0x6e67('0x6'));var config=require(_0x6e67('0x7'));var jayson=require(_0x6e67('0x8'));var client=jayson[_0x6e67('0x9')][_0x6e67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x524fc4,_0x48ae69,_0x7618e7){return new BPromise(function(_0x380315,_0xae7869){return client[_0x6e67('0xb')](_0x524fc4,_0x7618e7)[_0x6e67('0xc')](function(_0x100361){logger[_0x6e67('0xd')](_0x6e67('0xe'),_0x48ae69,'request\x20sent');logger[_0x6e67('0xf')](_0x6e67('0x10'),_0x48ae69,'request\x20sent',JSON[_0x6e67('0x11')](_0x100361));if(_0x100361['error']){if(_0x100361[_0x6e67('0x12')][_0x6e67('0x13')]===0x1f4){logger['error'](_0x6e67('0xe'),_0x48ae69,_0x100361[_0x6e67('0x12')][_0x6e67('0x14')]);return _0xae7869(_0x100361[_0x6e67('0x12')]['message']);}logger[_0x6e67('0x12')](_0x6e67('0xe'),_0x48ae69,_0x100361[_0x6e67('0x12')]['message']);return _0x380315(_0x100361[_0x6e67('0x12')][_0x6e67('0x14')]);}else{logger['info'](_0x6e67('0xe'),_0x48ae69,'request\x20sent');_0x380315(_0x100361[_0x6e67('0x15')][_0x6e67('0x14')]);}})[_0x6e67('0x16')](function(_0x99f5bc){logger[_0x6e67('0x12')](_0x6e67('0xe'),_0x48ae69,_0x99f5bc);_0xae7869(_0x99f5bc);});});}exports['GetCmHopperBlack']=function(_0x5f3c0f){var _0x3fb379=this;return new Promise(function(_0x121c15,_0x210d23){return db[_0x6e67('0x17')][_0x6e67('0x18')]({'raw':_0x5f3c0f['options']?_0x5f3c0f['options'][_0x6e67('0x19')]===undefined?!![]:![]:!![],'where':_0x5f3c0f['options']?_0x5f3c0f[_0x6e67('0x1a')][_0x6e67('0x1b')]||null:null,'attributes':_0x5f3c0f['options']?_0x5f3c0f[_0x6e67('0x1a')][_0x6e67('0x1c')]||null:null,'limit':_0x5f3c0f['options']?_0x5f3c0f[_0x6e67('0x1a')]['limit']||null:null,'include':_0x5f3c0f[_0x6e67('0x1a')]?_0x5f3c0f[_0x6e67('0x1a')][_0x6e67('0x1d')]?_[_0x6e67('0x1e')](_0x5f3c0f[_0x6e67('0x1a')][_0x6e67('0x1d')],function(_0x27fa2c){return{'model':db[_0x27fa2c[_0x6e67('0x1f')]],'as':_0x27fa2c['as'],'attributes':_0x27fa2c[_0x6e67('0x1c')],'include':_0x27fa2c[_0x6e67('0x1d')]?_[_0x6e67('0x1e')](_0x27fa2c[_0x6e67('0x1d')],function(_0x5be3a3){return{'model':db[_0x5be3a3[_0x6e67('0x1f')]],'as':_0x5be3a3['as'],'attributes':_0x5be3a3[_0x6e67('0x1c')],'include':_0x5be3a3[_0x6e67('0x1d')]?_[_0x6e67('0x1e')](_0x5be3a3[_0x6e67('0x1d')],function(_0x288dc5){return{'model':db[_0x288dc5[_0x6e67('0x1f')]],'as':_0x288dc5['as'],'attributes':_0x288dc5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21f382){logger[_0x6e67('0xd')](_0x6e67('0x20'),_0x5f3c0f);logger['debug'](_0x6e67('0x20'),_0x5f3c0f,JSON[_0x6e67('0x11')](_0x21f382));_0x121c15(_0x21f382);})[_0x6e67('0x16')](function(_0x230eee){logger[_0x6e67('0x12')]('GetCmHopperBlack',_0x230eee[_0x6e67('0x14')],_0x5f3c0f);_0x210d23(_0x3fb379[_0x6e67('0x12')](0x1f4,_0x230eee[_0x6e67('0x14')]));});});};exports[_0x6e67('0x21')]=function(_0x547aea){var _0x515139=this;return new Promise(function(_0x3d8adc,_0x4df859){return db[_0x6e67('0x17')][_0x6e67('0x22')](_0x547aea[_0x6e67('0x23')],{'raw':_0x547aea[_0x6e67('0x1a')]?_0x547aea[_0x6e67('0x1a')][_0x6e67('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x547aea[_0x6e67('0x1a')]?_0x547aea[_0x6e67('0x1a')][_0x6e67('0x1b')]||null:null,'attributes':_0x547aea[_0x6e67('0x1a')]?_0x547aea['options'][_0x6e67('0x1c')]||null:null,'limit':_0x547aea[_0x6e67('0x1a')]?_0x547aea[_0x6e67('0x1a')][_0x6e67('0x24')]||null:null})[_0x6e67('0xc')](function(_0xa35524){logger[_0x6e67('0xd')](_0x6e67('0x21'),_0x547aea);logger[_0x6e67('0xf')](_0x6e67('0x21'),_0x547aea,JSON[_0x6e67('0x11')](_0xa35524));_0x3d8adc(_0xa35524);})[_0x6e67('0x16')](function(_0x212a55){logger[_0x6e67('0x12')](_0x6e67('0x21'),_0x212a55[_0x6e67('0x14')],_0x547aea);_0x4df859(_0x515139[_0x6e67('0x12')](0x1f4,_0x212a55[_0x6e67('0x14')]));});});};exports[_0x6e67('0x25')]=function(_0x5de44b){var _0x2c0004=this;return new Promise(function(_0xf2f290,_0x2d7fc3){return db['CmHopperBlack'][_0x6e67('0x26')]({'where':_0x5de44b['options']?_0x5de44b['options'][_0x6e67('0x1b')]||null:null})[_0x6e67('0xc')](function(_0x5688ac){logger['info'](_0x6e67('0x25'),_0x5de44b);logger[_0x6e67('0xf')]('DestroyCmHopperBlack',_0x5de44b,JSON[_0x6e67('0x11')](_0x5688ac));_0xf2f290(_0x5688ac);})[_0x6e67('0x16')](function(_0x3aa84c){logger[_0x6e67('0x12')]('DestroyCmHopperBlack',_0x3aa84c[_0x6e67('0x14')],_0x5de44b);_0x2d7fc3(_0x2c0004[_0x6e67('0x12')](0x1f4,_0x3aa84c[_0x6e67('0x14')]));});});}; \ No newline at end of file +var _0x255e=['GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','DestroyCmHopperBlack','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x47a11b,_0x35ca8e){var _0x353230=function(_0x4388a5){while(--_0x4388a5){_0x47a11b['push'](_0x47a11b['shift']());}};_0x353230(++_0x35ca8e);}(_0x255e,0x149));var _0xe255=function(_0x4e3cbe,_0x24364e){_0x4e3cbe=_0x4e3cbe-0x0;var _0x3f0a1e=_0x255e[_0x4e3cbe];return _0x3f0a1e;};'use strict';var _=require(_0xe255('0x0'));var util=require(_0xe255('0x1'));var moment=require(_0xe255('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe255('0x3'))['db'];var utils=require(_0xe255('0x4'));var logger=require(_0xe255('0x5'))(_0xe255('0x6'));var config=require(_0xe255('0x7'));var jayson=require(_0xe255('0x8'));var client=jayson[_0xe255('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5a6f,_0x42b421,_0x2b87e8){return new BPromise(function(_0x2c4399,_0x11f966){return client['request'](_0x4b5a6f,_0x2b87e8)[_0xe255('0xa')](function(_0x84698){logger['info'](_0xe255('0xb'),_0x42b421,_0xe255('0xc'));logger[_0xe255('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x42b421,_0xe255('0xc'),JSON[_0xe255('0xe')](_0x84698));if(_0x84698[_0xe255('0xf')]){if(_0x84698[_0xe255('0xf')][_0xe255('0x10')]===0x1f4){logger[_0xe255('0xf')](_0xe255('0xb'),_0x42b421,_0x84698['error'][_0xe255('0x11')]);return _0x11f966(_0x84698[_0xe255('0xf')]['message']);}logger[_0xe255('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x42b421,_0x84698['error']['message']);return _0x2c4399(_0x84698[_0xe255('0xf')][_0xe255('0x11')]);}else{logger[_0xe255('0x12')](_0xe255('0xb'),_0x42b421,_0xe255('0xc'));_0x2c4399(_0x84698[_0xe255('0x13')][_0xe255('0x11')]);}})[_0xe255('0x14')](function(_0x53f5c9){logger[_0xe255('0xf')](_0xe255('0xb'),_0x42b421,_0x53f5c9);_0x11f966(_0x53f5c9);});});}exports[_0xe255('0x15')]=function(_0x3ac270){var _0x461290=this;return new Promise(function(_0x19e4ea,_0x3aa116){return db[_0xe255('0x16')][_0xe255('0x17')]({'raw':_0x3ac270[_0xe255('0x18')]?_0x3ac270[_0xe255('0x18')][_0xe255('0x19')]===undefined?!![]:![]:!![],'where':_0x3ac270[_0xe255('0x18')]?_0x3ac270[_0xe255('0x18')][_0xe255('0x1a')]||null:null,'attributes':_0x3ac270['options']?_0x3ac270[_0xe255('0x18')][_0xe255('0x1b')]||null:null,'limit':_0x3ac270[_0xe255('0x18')]?_0x3ac270[_0xe255('0x18')][_0xe255('0x1c')]||null:null,'include':_0x3ac270[_0xe255('0x18')]?_0x3ac270[_0xe255('0x18')][_0xe255('0x1d')]?_['map'](_0x3ac270[_0xe255('0x18')][_0xe255('0x1d')],function(_0x43992c){return{'model':db[_0x43992c['model']],'as':_0x43992c['as'],'attributes':_0x43992c[_0xe255('0x1b')],'include':_0x43992c[_0xe255('0x1d')]?_[_0xe255('0x1e')](_0x43992c[_0xe255('0x1d')],function(_0x23ec03){return{'model':db[_0x23ec03[_0xe255('0x1f')]],'as':_0x23ec03['as'],'attributes':_0x23ec03[_0xe255('0x1b')],'include':_0x23ec03[_0xe255('0x1d')]?_[_0xe255('0x1e')](_0x23ec03[_0xe255('0x1d')],function(_0x5aada2){return{'model':db[_0x5aada2[_0xe255('0x1f')]],'as':_0x5aada2['as'],'attributes':_0x5aada2[_0xe255('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d071e){logger['info'](_0xe255('0x15'),_0x3ac270);logger[_0xe255('0xd')]('GetCmHopperBlack',_0x3ac270,JSON[_0xe255('0xe')](_0x3d071e));_0x19e4ea(_0x3d071e);})['catch'](function(_0xe66a4){logger[_0xe255('0xf')](_0xe255('0x15'),_0xe66a4[_0xe255('0x11')],_0x3ac270);_0x3aa116(_0x461290[_0xe255('0xf')](0x1f4,_0xe66a4[_0xe255('0x11')]));});});};exports[_0xe255('0x20')]=function(_0x2f337e){var _0x51f4f5=this;return new Promise(function(_0x2d5106,_0x46a20f){return db['CmHopperBlack'][_0xe255('0x21')](_0x2f337e['body'],{'raw':_0x2f337e[_0xe255('0x18')]?_0x2f337e['options'][_0xe255('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f337e[_0xe255('0x18')]?_0x2f337e[_0xe255('0x18')][_0xe255('0x1a')]||null:null,'attributes':_0x2f337e[_0xe255('0x18')]?_0x2f337e['options'][_0xe255('0x1b')]||null:null,'limit':_0x2f337e[_0xe255('0x18')]?_0x2f337e[_0xe255('0x18')][_0xe255('0x1c')]||null:null})[_0xe255('0xa')](function(_0xc866d4){logger[_0xe255('0x12')](_0xe255('0x20'),_0x2f337e);logger[_0xe255('0xd')](_0xe255('0x20'),_0x2f337e,JSON[_0xe255('0xe')](_0xc866d4));_0x2d5106(_0xc866d4);})[_0xe255('0x14')](function(_0x33b8b8){logger[_0xe255('0xf')]('UpdateCmHopperBlack',_0x33b8b8[_0xe255('0x11')],_0x2f337e);_0x46a20f(_0x51f4f5[_0xe255('0xf')](0x1f4,_0x33b8b8['message']));});});};exports[_0xe255('0x22')]=function(_0x578f3f){var _0x3e6ed2=this;return new Promise(function(_0x5e6498,_0x3b0692){return db[_0xe255('0x16')]['destroy']({'where':_0x578f3f['options']?_0x578f3f[_0xe255('0x18')]['where']||null:null})[_0xe255('0xa')](function(_0x3b7110){logger[_0xe255('0x12')](_0xe255('0x22'),_0x578f3f);logger[_0xe255('0xd')](_0xe255('0x22'),_0x578f3f,JSON[_0xe255('0xe')](_0x3b7110));_0x5e6498(_0x3b7110);})[_0xe255('0x14')](function(_0x3af5d3){logger[_0xe255('0xf')](_0xe255('0x22'),_0x3af5d3[_0xe255('0x11')],_0x578f3f);_0x3b0692(_0x3e6ed2[_0xe255('0xf')](0x1f4,_0x3af5d3[_0xe255('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1349dcf..8347703 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 _0x95f7=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x5c24e2,_0x14aa2e){var _0x3be752=function(_0x3b060e){while(--_0x3b060e){_0x5c24e2['push'](_0x5c24e2['shift']());}};_0x3be752(++_0x14aa2e);}(_0x95f7,0x68));var _0x795f=function(_0x2b2c4b,_0x2ad103){_0x2b2c4b=_0x2b2c4b-0x0;var _0x143ab0=_0x95f7[_0x2b2c4b];return _0x143ab0;};'use strict';var multer=require(_0x795f('0x0'));var util=require(_0x795f('0x1'));var path=require(_0x795f('0x2'));var timeout=require(_0x795f('0x3'));var express=require(_0x795f('0x4'));var router=express[_0x795f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x795f('0x6'));var config=require(_0x795f('0x7'));var controller=require(_0x795f('0x8'));router[_0x795f('0x9')]('/',auth[_0x795f('0xa')](),controller[_0x795f('0xb')]);router[_0x795f('0x9')](_0x795f('0xc'),auth[_0x795f('0xa')](),controller[_0x795f('0xd')]);router['get'](_0x795f('0xe'),auth[_0x795f('0xa')](),controller[_0x795f('0xf')]);router[_0x795f('0x10')](_0x795f('0xe'),auth[_0x795f('0xa')](),controller[_0x795f('0x11')]);router[_0x795f('0x12')](_0x795f('0xe'),auth[_0x795f('0xa')](),controller[_0x795f('0x13')]);module[_0x795f('0x14')]=router; \ No newline at end of file +var _0x24ca=['multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id','show','update','destroy','exports'];(function(_0x19a9a5,_0x2bf8b2){var _0x5306fe=function(_0x20f9e1){while(--_0x20f9e1){_0x19a9a5['push'](_0x19a9a5['shift']());}};_0x5306fe(++_0x2bf8b2);}(_0x24ca,0x8c));var _0xa24c=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x24ca[_0x323d87];return _0x5e8f74;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa24c('0x1'));var express=require('express');var router=express[_0xa24c('0x2')]();var auth=require(_0xa24c('0x3'));var interaction=require(_0xa24c('0x4'));var config=require('../../config/environment');var controller=require(_0xa24c('0x5'));router[_0xa24c('0x6')]('/',auth[_0xa24c('0x7')](),controller['index']);router['get']('/describe',auth[_0xa24c('0x7')](),controller[_0xa24c('0x8')]);router[_0xa24c('0x6')](_0xa24c('0x9'),auth[_0xa24c('0x7')](),controller[_0xa24c('0xa')]);router['put'](_0xa24c('0x9'),auth[_0xa24c('0x7')](),controller[_0xa24c('0xb')]);router['delete']('/:id',auth[_0xa24c('0x7')](),controller[_0xa24c('0xc')]);module[_0xa24c('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 77e0791..593ff5a 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 _0x639e=['sequelize','moment','INTEGER','DATE','STRING','getDataValue','setDataValue','followuptime','seconds','dispositionat','BOOLEAN'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x639e,0x113));var _0xe639=function(_0x1f0398,_0x37a6dd){_0x1f0398=_0x1f0398-0x0;var _0x3f0ad5=_0x639e[_0x1f0398];return _0x3f0ad5;};'use strict';var Sequelize=require(_0xe639('0x0'));var moment=require(_0xe639('0x1'));module['exports']={'state':{'type':Sequelize[_0xe639('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe639('0x3')]},'countbusyretry':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe639('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xe639('0x4')]},'originatecalleridname':{'type':Sequelize[_0xe639('0x4')]},'calleridnum':{'type':Sequelize[_0xe639('0x4')]},'calleridname':{'type':Sequelize[_0xe639('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe639('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe639('0x3')]},'ringtime':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe639('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xe639('0x4')]},'campaigntype':{'type':Sequelize[_0xe639('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xe639('0x4')]},'disposition':{'type':Sequelize[_0xe639('0x4')]},'dispositionat':{'type':Sequelize[_0xe639('0x3')],'set':function(_0x12070d){var _0x1cbc4d=this[_0xe639('0x5')]('endtime');if(_0x1cbc4d&&_0x12070d){this[_0xe639('0x6')](_0xe639('0x7'),moment(_0x12070d)['diff'](moment(_0x1cbc4d),_0xe639('0x8')));}return this['setDataValue'](_0xe639('0x9'),_0x12070d);}},'amd':{'type':Sequelize[_0xe639('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe639('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe639('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe639('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe639('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe639('0x3')]},'deleted':{'type':Sequelize[_0xe639('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe639('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe639('0x3')]}}; \ No newline at end of file +var _0x2ec6=['DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','moment','exports','INTEGER'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x2ec6,0x8d));var _0x62ec=function(_0x3fd4af,_0x5419af){_0x3fd4af=_0x3fd4af-0x0;var _0x20091a=_0x2ec6[_0x3fd4af];return _0x20091a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x62ec('0x0'));module[_0x62ec('0x1')]={'state':{'type':Sequelize[_0x62ec('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x62ec('0x3')]},'countbusyretry':{'type':Sequelize[_0x62ec('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x62ec('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x62ec('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x62ec('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x62ec('0x4')]},'originatecalleridname':{'type':Sequelize[_0x62ec('0x4')]},'calleridnum':{'type':Sequelize[_0x62ec('0x4')]},'calleridname':{'type':Sequelize[_0x62ec('0x4')]},'starttime':{'type':Sequelize[_0x62ec('0x3')]},'responsetime':{'type':Sequelize[_0x62ec('0x3')]},'answertime':{'type':Sequelize[_0x62ec('0x3')]},'droptime':{'type':Sequelize[_0x62ec('0x3')]},'endtime':{'type':Sequelize[_0x62ec('0x3')]},'ringtime':{'type':Sequelize[_0x62ec('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x62ec('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x62ec('0x4')]},'campaign':{'type':Sequelize[_0x62ec('0x4')]},'campaigntype':{'type':Sequelize[_0x62ec('0x4')]},'membername':{'type':Sequelize[_0x62ec('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x62ec('0x4')]},'dispositionat':{'type':Sequelize[_0x62ec('0x3')],'set':function(_0x3de0cc){var _0x4a9dc9=this[_0x62ec('0x5')](_0x62ec('0x6'));if(_0x4a9dc9&&_0x3de0cc){this[_0x62ec('0x7')](_0x62ec('0x8'),moment(_0x3de0cc)[_0x62ec('0x9')](moment(_0x4a9dc9),'seconds'));}return this[_0x62ec('0x7')](_0x62ec('0xa'),_0x3de0cc);}},'amd':{'type':Sequelize[_0x62ec('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x62ec('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x62ec('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x62ec('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x62ec('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x62ec('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x62ec('0x3')]},'deleted':{'type':Sequelize[_0x62ec('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x62ec('0x3')]},'recallme':{'type':Sequelize[_0x62ec('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x62ec('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a8aa1ed..08f1132 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 _0x17ce=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','catch','show','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','params','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','VoiceQueueId','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ContactId','field','ANY_VALUE(ListId)','ListId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','createdAt','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys'];(function(_0x2a1fcf,_0x48809f){var _0x4ec411=function(_0x361f83){while(--_0x361f83){_0x2a1fcf['push'](_0x2a1fcf['shift']());}};_0x4ec411(++_0x48809f);}(_0x17ce,0x1cd));var _0xe17c=function(_0x2a56a1,_0x1f553a){_0x2a56a1=_0x2a56a1-0x0;var _0xc92e24=_0x17ce[_0x2a56a1];return _0xc92e24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe17c('0x0'));var rimraf=require(_0xe17c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe17c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe17c('0x3'));var Mustache=require(_0xe17c('0x4'));var util=require(_0xe17c('0x5'));var path=require(_0xe17c('0x6'));var sox=require(_0xe17c('0x7'));var csv=require(_0xe17c('0x8'));var ejs=require(_0xe17c('0x9'));var fs=require('fs');var _=require(_0xe17c('0xa'));var squel=require(_0xe17c('0xb'));var crypto=require(_0xe17c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe17c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe17c('0xe'));var Papa=require(_0xe17c('0xf'));var Redis=require('ioredis');var authService=require(_0xe17c('0x10'));var qs=require(_0xe17c('0x11'));var hardwareService=require(_0xe17c('0x12'));var logger=require(_0xe17c('0x13'))(_0xe17c('0x14'));var utils=require('../../config/utils');var config=require(_0xe17c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dee77,_0x969a7c){_0x969a7c=_0x969a7c||0xcc;return function(_0x45e2ce){if(_0x45e2ce){return _0x4dee77[_0xe17c('0x16')](_0x969a7c);}return _0x4dee77[_0xe17c('0x17')](_0x969a7c)[_0xe17c('0x18')]();};}function respondWithResult(_0x31041d,_0x179f06){_0x179f06=_0x179f06||0xc8;return function(_0x4f2b01){if(_0x4f2b01){return _0x31041d['status'](_0x179f06)[_0xe17c('0x19')](_0x4f2b01);}};}function respondWithFilteredResult(_0x12343c,_0x4e8991){return function(_0x18ed3a){if(_0x18ed3a){var _0x44548d=_0x18ed3a[_0xe17c('0x1a')],_0x209c60=_0x4e8991['offset'],_0xc081ef=_0x4e8991[_0xe17c('0x1b')]+_0x4e8991[_0xe17c('0x1c')],_0x62bb3c;if(_0xc081ef>=_0x44548d){_0xc081ef=_0x44548d;_0x62bb3c=0xc8;}else{_0x62bb3c=0xce;}_0x12343c['status'](_0x62bb3c);return _0x12343c['set']('Content-Range',_0x209c60+'-'+_0xc081ef+'/'+_0x44548d)[_0xe17c('0x19')](_0x18ed3a);}return null;};}function patchUpdates(_0x39c53f){return function(_0x854cc0){try{jsonpatch[_0xe17c('0x1d')](_0x854cc0,_0x39c53f,!![]);}catch(_0x5b3f58){return BPromise['reject'](_0x5b3f58);}return _0x854cc0[_0xe17c('0x1e')]();};}function saveUpdates(_0x53ab98,_0x38d117){return function(_0x3f9537){if(_0x3f9537){return _0x3f9537[_0xe17c('0x1f')](_0x53ab98)[_0xe17c('0x20')](function(_0x316dcd){return _0x316dcd;});}return null;};}function removeEntity(_0x534b48,_0x151bb5){return function(_0x5a63c2){if(_0x5a63c2){return _0x5a63c2[_0xe17c('0x21')]()['then'](function(){_0x534b48['status'](0xcc)[_0xe17c('0x18')]();});}};}function handleEntityNotFound(_0x16cc72,_0x20ab68){return function(_0x209955){if(!_0x209955){_0x16cc72[_0xe17c('0x16')](0x194);}return _0x209955;};}function handleError(_0x48ebf3,_0x1e37f3){_0x1e37f3=_0x1e37f3||0x1f4;return function(_0x561788){logger[_0xe17c('0x22')](_0x561788[_0xe17c('0x23')]);if(_0x561788[_0xe17c('0x24')]){delete _0x561788['name'];}_0x48ebf3[_0xe17c('0x17')](_0x1e37f3)[_0xe17c('0x25')](_0x561788);};}exports[_0xe17c('0x26')]=function(_0x2a0d0f,_0x3216ab){var _0x3964c2={},_0x2bd447={},_0x3e6c38={'count':0x0,'rows':[]};var _0x588561=db[_0xe17c('0x27')][_0xe17c('0x28')];_0x2bd447[_0xe17c('0x29')]=_[_0xe17c('0x2a')](_0x588561);_0x2bd447[_0xe17c('0x2b')]=_['keys'](_0x2a0d0f[_0xe17c('0x2b')]);_0x2bd447[_0xe17c('0x2c')]=_[_0xe17c('0x2d')](_0x2bd447[_0xe17c('0x29')],_0x2bd447[_0xe17c('0x2b')]);_0x3964c2[_0xe17c('0x2e')]=_[_0xe17c('0x2d')](_0x2bd447[_0xe17c('0x29')],qs['fields'](_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x2f')]));_0x3964c2[_0xe17c('0x2e')]=_0x3964c2[_0xe17c('0x2e')][_0xe17c('0x30')]?_0x3964c2[_0xe17c('0x2e')]:_0x2bd447['model'];if(!_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x31')](_0xe17c('0x32'))){_0x3964c2[_0xe17c('0x1c')]=qs[_0xe17c('0x1c')](_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x1c')]);_0x3964c2['offset']=qs[_0xe17c('0x1b')](_0x2a0d0f[_0xe17c('0x2b')]['offset']);}_0x3964c2[_0xe17c('0x33')]=qs[_0xe17c('0x34')](_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x34')]);_0x3964c2[_0xe17c('0x35')]=qs[_0xe17c('0x2c')](_[_0xe17c('0x36')](_0x2a0d0f[_0xe17c('0x2b')],_0x2bd447[_0xe17c('0x2c')]));if(_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x37')]){_0x3964c2[_0xe17c('0x35')]=_[_0xe17c('0x38')](_0x3964c2[_0xe17c('0x35')],{'$or':_[_0xe17c('0x39')](_0x588561,function(_0x307b3f){if(_0x307b3f[_0xe17c('0x3a')][_0xe17c('0x3b')]!==_0xe17c('0x3c')){var _0x22d308={};_0x22d308[_0x307b3f['field']]={'$like':'%'+_0x2a0d0f[_0xe17c('0x2b')][_0xe17c('0x37')]+'%'};return _0x22d308;}})});}_0x3964c2=_[_0xe17c('0x38')]({},_0x3964c2,_0x2a0d0f[_0xe17c('0x3d')]);var _0x568185={'where':_0x3964c2[_0xe17c('0x35')]};return db['CmHopperFinal'][_0xe17c('0x1a')](_0x568185)[_0xe17c('0x20')](function(_0x3083d4){_0x3e6c38[_0xe17c('0x1a')]=_0x3083d4;if(_0x2a0d0f['query'][_0xe17c('0x3e')]){_0x3964c2[_0xe17c('0x3f')]=[{'all':!![]}];}return db[_0xe17c('0x27')][_0xe17c('0x40')](_0x3964c2);})['then'](function(_0x122978){_0x3e6c38['rows']=_0x122978;return _0x3e6c38;})[_0xe17c('0x20')](respondWithFilteredResult(_0x3216ab,_0x3964c2))[_0xe17c('0x41')](handleError(_0x3216ab,null));};exports[_0xe17c('0x42')]=function(_0x3e9cb6,_0x49cb2d){var _0x4cef5a={'raw':!![],'where':{'id':_0x3e9cb6['params']['id']}},_0x6297f0={};_0x6297f0[_0xe17c('0x29')]=_[_0xe17c('0x2a')](db[_0xe17c('0x27')][_0xe17c('0x28')]);_0x6297f0[_0xe17c('0x2b')]=_[_0xe17c('0x2a')](_0x3e9cb6[_0xe17c('0x2b')]);_0x6297f0[_0xe17c('0x2c')]=_['intersection'](_0x6297f0['model'],_0x6297f0['query']);_0x4cef5a['attributes']=_['intersection'](_0x6297f0[_0xe17c('0x29')],qs[_0xe17c('0x2f')](_0x3e9cb6['query'][_0xe17c('0x2f')]));_0x4cef5a['attributes']=_0x4cef5a[_0xe17c('0x2e')][_0xe17c('0x30')]?_0x4cef5a[_0xe17c('0x2e')]:_0x6297f0[_0xe17c('0x29')];if(_0x3e9cb6['query'][_0xe17c('0x3e')]){_0x4cef5a['include']=[{'all':!![]}];}_0x4cef5a=_['merge']({},_0x4cef5a,_0x3e9cb6['options']);return db[_0xe17c('0x27')][_0xe17c('0x43')](_0x4cef5a)[_0xe17c('0x20')](handleEntityNotFound(_0x49cb2d,null))[_0xe17c('0x20')](respondWithResult(_0x49cb2d,null))[_0xe17c('0x41')](handleError(_0x49cb2d,null));};exports[_0xe17c('0x44')]=function(_0x58b465,_0x52f36a){return db[_0xe17c('0x27')][_0xe17c('0x44')]()[_0xe17c('0x20')](respondWithResult(_0x52f36a,null))[_0xe17c('0x41')](handleError(_0x52f36a,null));};exports['update']=function(_0x3617cd,_0x403245){if(_0x3617cd['body'][_0xe17c('0x45')]){delete _0x3617cd['body'][_0xe17c('0x45')];}return db[_0xe17c('0x27')][_0xe17c('0x43')]({'where':{'uniqueid':_0x3617cd['params']['id']}})[_0xe17c('0x20')](handleEntityNotFound(_0x403245,null))[_0xe17c('0x20')](saveUpdates(_0x3617cd[_0xe17c('0x46')],null))[_0xe17c('0x20')](respondWithResult(_0x403245,null))[_0xe17c('0x41')](handleError(_0x403245,null));};exports[_0xe17c('0x47')]=function(_0x58ce1e,_0xf081ef,_0x274c4a){return db[_0xe17c('0x27')][_0xe17c('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x58ce1e[_0xe17c('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0xe17c('0x49'),db['sequelize']['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x4c')))),_0xe17c('0x4d')],[db[_0xe17c('0x4a')]['fn']('COUNT',db[_0xe17c('0x4a')]['fn']('IF',db['sequelize'][_0xe17c('0x4b')](_0xe17c('0x4e')))),_0xe17c('0x4f')],[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x50')))),_0xe17c('0x51')],[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xe17c('0x52')],[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0xe17c('0x53')))),_0xe17c('0x54')],[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db['sequelize']['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0xe17c('0x49'),db['sequelize']['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x55')))),_0xe17c('0x56')],[db['sequelize']['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')]['literal'](_0xe17c('0x57')))),'answeringMachine']]})[_0xe17c('0x20')](handleEntityNotFound(_0xf081ef,null))[_0xe17c('0x20')](respondWithResult(_0xf081ef,null))[_0xe17c('0x41')](handleError(_0xf081ef,null));};exports[_0xe17c('0x58')]=function(_0x27670f,_0x3952d4,_0x1856fd){return db[_0xe17c('0x27')][_0xe17c('0x40')]({'raw':![],'where':{'CampaignId':_0x27670f[_0xe17c('0x48')]['id']},'attributes':[[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x4c')))),_0xe17c('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe17c('0x4a')]['literal'](_0xe17c('0x4e')))),'noAnswerContacts'],[db[_0xe17c('0x4a')]['fn'](_0xe17c('0x49'),db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')]['literal'](_0xe17c('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0xe17c('0x49'),db['sequelize']['fn']('IF',db[_0xe17c('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0xe17c('0x4a')]['fn']('COUNT',db[_0xe17c('0x4a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xe17c('0x54')],[db['sequelize']['fn']('COUNT',db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x59')))),_0xe17c('0x5a')],[db[_0xe17c('0x4a')]['fn']('COUNT',db[_0xe17c('0x4a')]['fn']('IF',db[_0xe17c('0x4a')]['literal'](_0xe17c('0x55')))),_0xe17c('0x56')],[db['sequelize']['fn'](_0xe17c('0x49'),db['sequelize']['fn']('IF',db[_0xe17c('0x4a')][_0xe17c('0x4b')](_0xe17c('0x57')))),'answeringMachine']]})[_0xe17c('0x20')](handleEntityNotFound(_0x3952d4,null))['then'](respondWithResult(_0x3952d4,null))[_0xe17c('0x41')](handleError(_0x3952d4,null));};exports[_0xe17c('0x5b')]=function(_0x47ed79,_0x49877d,_0x47b647){return db[_0xe17c('0x5c')][_0xe17c('0x43')]({'where':{'id':_0x47ed79[_0xe17c('0x48')]['id']}})[_0xe17c('0x20')](handleEntityNotFound(_0x49877d,null))['then'](function(_0x26a1f1){var _0x12e19a;if(_0x26a1f1){_0x12e19a=squel[_0xe17c('0x5d')]()[_0xe17c('0x5e')](_0xe17c('0x5f'))[_0xe17c('0x60')]([_0xe17c('0x61'),_0xe17c('0x62'),'ContactId','ListId',_0xe17c('0x63'),'createdAt',_0xe17c('0x64')],squel[_0xe17c('0x65')]()['field'](_0xe17c('0x66'),_0xe17c('0x61'))['field'](_0xe17c('0x67'),_0xe17c('0x62'))['field'](_0xe17c('0x68'),_0xe17c('0x69'))[_0xe17c('0x6a')](_0xe17c('0x6b'),_0xe17c('0x6c'))['field']('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0xe17c('0x6a')]('NOW()','createdAt')[_0xe17c('0x6a')](_0xe17c('0x67'),_0xe17c('0x64'))[_0xe17c('0x6d')]('cm_hopper_final')[_0xe17c('0x35')](_0xe17c('0x6e'),_0x47ed79[_0xe17c('0x48')]['id'][_0xe17c('0x6f')]())[_0xe17c('0x35')](_0xe17c('0x70'),_0x47ed79[_0xe17c('0x46')][_0xe17c('0x71')]['toString']())['where'](_0xe17c('0x72'))[_0xe17c('0x35')](_0xe17c('0x73'),squel[_0xe17c('0x65')]()[_0xe17c('0x6a')](_0xe17c('0x61'))['from'](_0xe17c('0x5f'))[_0xe17c('0x35')](_0xe17c('0x6e'),_0x47ed79[_0xe17c('0x48')]['id'][_0xe17c('0x6f')]()))[_0xe17c('0x35')](_0xe17c('0x73'),squel[_0xe17c('0x65')]()[_0xe17c('0x6a')]('calleridnum')['from'](_0xe17c('0x74'))[_0xe17c('0x35')]('VoiceQueueId\x20=\x20?',_0x47ed79['params']['id'][_0xe17c('0x6f')]())['where'](_0xe17c('0x75')))['group'](_0xe17c('0x69')))[_0xe17c('0x6f')]();return db[_0xe17c('0x4a')]['query'](_0x12e19a);}return[];})[_0xe17c('0x20')](respondWithResult(_0x49877d,null))['catch'](handleError(_0x49877d,null));};exports[_0xe17c('0x76')]=function(_0x1fbb9a,_0x323eac,_0x2715ec){return db['Campaign']['find']({'where':{'id':_0x1fbb9a[_0xe17c('0x48')]['id']}})[_0xe17c('0x20')](handleEntityNotFound(_0x323eac,null))[_0xe17c('0x20')](function(_0x199fd0){var _0x1e60da;if(_0x199fd0){_0x1e60da=squel['insert']()[_0xe17c('0x5e')](_0xe17c('0x5f'))[_0xe17c('0x60')]([_0xe17c('0x61'),_0xe17c('0x62'),'ContactId','ListId',_0xe17c('0x77'),_0xe17c('0x78'),'updatedAt'],squel[_0xe17c('0x65')]()[_0xe17c('0x6a')](_0xe17c('0x66'),_0xe17c('0x61'))[_0xe17c('0x6a')](_0xe17c('0x67'),_0xe17c('0x62'))[_0xe17c('0x6a')](_0xe17c('0x68'),_0xe17c('0x69'))[_0xe17c('0x6a')](_0xe17c('0x6b'),_0xe17c('0x6c'))[_0xe17c('0x6a')]('ANY_VALUE(CampaignId)','CampaignId')[_0xe17c('0x6a')](_0xe17c('0x67'),'createdAt')[_0xe17c('0x6a')](_0xe17c('0x67'),'updatedAt')['from'](_0xe17c('0x74'))[_0xe17c('0x35')](_0xe17c('0x79'),_0x1fbb9a[_0xe17c('0x48')]['id'][_0xe17c('0x6f')]())['where'](_0xe17c('0x70'),_0x1fbb9a[_0xe17c('0x46')]['state']['toString']())[_0xe17c('0x35')](_0xe17c('0x72'))[_0xe17c('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe17c('0x65')]()['field']('phone')['from']('cm_hopper')[_0xe17c('0x35')](_0xe17c('0x79'),_0x1fbb9a['params']['id'][_0xe17c('0x6f')]()))[_0xe17c('0x35')](_0xe17c('0x73'),squel[_0xe17c('0x65')]()[_0xe17c('0x6a')](_0xe17c('0x7a'))[_0xe17c('0x6d')](_0xe17c('0x74'))[_0xe17c('0x35')](_0xe17c('0x79'),_0x1fbb9a[_0xe17c('0x48')]['id'][_0xe17c('0x6f')]())[_0xe17c('0x35')](_0xe17c('0x75')))['group'](_0xe17c('0x69')))[_0xe17c('0x6f')]();return db['sequelize'][_0xe17c('0x2b')](_0x1e60da);}return[];})[_0xe17c('0x20')](respondWithResult(_0x323eac,null))[_0xe17c('0x41')](handleError(_0x323eac,null));};exports[_0xe17c('0x7b')]=function(_0x273e10,_0x318533,_0x465ad3){return db[_0xe17c('0x7c')][_0xe17c('0x7d')]({'where':{'VoiceQueueId':_0x273e10[_0xe17c('0x46')]['VoiceQueueId'],'CampaignId':_0x273e10['body'][_0xe17c('0x77')],'ContactId':_0x273e10[_0xe17c('0x46')]['ContactId']}})[_0xe17c('0x20')](handleEntityNotFound(_0x318533,null))[_0xe17c('0x20')](function(_0xd95500){if(_0xd95500){return _0xd95500;}return null;})[_0xe17c('0x20')](respondWithResult(_0x318533,null))['catch'](handleError(_0x318533,null));}; \ No newline at end of file +var _0xf85d=['pick','filter','merge','map','type','key','field','options','include','rows','params','length','includeAll','find','catch','describe','body','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','select','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','checkContactHopper','CmHopper','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where'];(function(_0x3a8b9b,_0x4b1728){var _0x1a3bba=function(_0x37a74e){while(--_0x37a74e){_0x3a8b9b['push'](_0x3a8b9b['shift']());}};_0x1a3bba(++_0x4b1728);}(_0xf85d,0x1bc));var _0xdf85=function(_0x3eb4ae,_0x493c5b){_0x3eb4ae=_0x3eb4ae-0x0;var _0x1aa0d4=_0xf85d[_0x3eb4ae];return _0x1aa0d4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf85('0x1'));var jsonpatch=require(_0xdf85('0x2'));var rp=require('request-promise');var moment=require(_0xdf85('0x3'));var BPromise=require(_0xdf85('0x4'));var Mustache=require(_0xdf85('0x5'));var util=require(_0xdf85('0x6'));var path=require(_0xdf85('0x7'));var sox=require('sox');var csv=require(_0xdf85('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf85('0x9'));var jsforce=require(_0xdf85('0xa'));var deskjs=require(_0xdf85('0xb'));var toCsv=require(_0xdf85('0x8'));var querystring=require(_0xdf85('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf85('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdf85('0xe'));var logger=require(_0xdf85('0xf'))('api');var utils=require(_0xdf85('0x10'));var config=require(_0xdf85('0x11'));var db=require(_0xdf85('0x12'))['db'];function respondWithStatusCode(_0x489749,_0x19d401){_0x19d401=_0x19d401||0xcc;return function(_0x473dd3){if(_0x473dd3){return _0x489749[_0xdf85('0x13')](_0x19d401);}return _0x489749[_0xdf85('0x14')](_0x19d401)[_0xdf85('0x15')]();};}function respondWithResult(_0x87cbec,_0x3c374c){_0x3c374c=_0x3c374c||0xc8;return function(_0x26fc06){if(_0x26fc06){return _0x87cbec['status'](_0x3c374c)['json'](_0x26fc06);}};}function respondWithFilteredResult(_0x526f7e,_0x1f82a2){return function(_0x312412){if(_0x312412){var _0x5725ab=_0x312412[_0xdf85('0x16')],_0x3146c1=_0x1f82a2['offset'],_0xbd18c1=_0x1f82a2['offset']+_0x1f82a2['limit'],_0x318bf6;if(_0xbd18c1>=_0x5725ab){_0xbd18c1=_0x5725ab;_0x318bf6=0xc8;}else{_0x318bf6=0xce;}_0x526f7e[_0xdf85('0x14')](_0x318bf6);return _0x526f7e[_0xdf85('0x17')]('Content-Range',_0x3146c1+'-'+_0xbd18c1+'/'+_0x5725ab)[_0xdf85('0x18')](_0x312412);}return null;};}function patchUpdates(_0xdf652){return function(_0x243214){try{jsonpatch[_0xdf85('0x19')](_0x243214,_0xdf652,!![]);}catch(_0x421799){return BPromise[_0xdf85('0x1a')](_0x421799);}return _0x243214[_0xdf85('0x1b')]();};}function saveUpdates(_0x3ad4d8,_0x4b9105){return function(_0x25281e){if(_0x25281e){return _0x25281e[_0xdf85('0x1c')](_0x3ad4d8)['then'](function(_0x92a276){return _0x92a276;});}return null;};}function removeEntity(_0x37a885,_0x3211f1){return function(_0x95dc4c){if(_0x95dc4c){return _0x95dc4c[_0xdf85('0x1d')]()[_0xdf85('0x1e')](function(){_0x37a885[_0xdf85('0x14')](0xcc)[_0xdf85('0x15')]();});}};}function handleEntityNotFound(_0x5b813c,_0x6856e1){return function(_0x5a5583){if(!_0x5a5583){_0x5b813c['sendStatus'](0x194);}return _0x5a5583;};}function handleError(_0x17f8de,_0xdc27b){_0xdc27b=_0xdc27b||0x1f4;return function(_0x1a1243){logger[_0xdf85('0x1f')](_0x1a1243[_0xdf85('0x20')]);if(_0x1a1243[_0xdf85('0x21')]){delete _0x1a1243[_0xdf85('0x21')];}_0x17f8de[_0xdf85('0x14')](_0xdc27b)[_0xdf85('0x22')](_0x1a1243);};}exports[_0xdf85('0x23')]=function(_0x5c4de4,_0x3527db){var _0x55230e={},_0x20b577={},_0x36b7d4={'count':0x0,'rows':[]};var _0x3c38c7=db[_0xdf85('0x24')][_0xdf85('0x25')];_0x20b577[_0xdf85('0x26')]=_[_0xdf85('0x27')](_0x3c38c7);_0x20b577[_0xdf85('0x28')]=_['keys'](_0x5c4de4[_0xdf85('0x28')]);_0x20b577[_0xdf85('0x29')]=_[_0xdf85('0x2a')](_0x20b577[_0xdf85('0x26')],_0x20b577[_0xdf85('0x28')]);_0x55230e[_0xdf85('0x2b')]=_[_0xdf85('0x2a')](_0x20b577[_0xdf85('0x26')],qs[_0xdf85('0x2c')](_0x5c4de4[_0xdf85('0x28')][_0xdf85('0x2c')]));_0x55230e[_0xdf85('0x2b')]=_0x55230e['attributes']['length']?_0x55230e[_0xdf85('0x2b')]:_0x20b577[_0xdf85('0x26')];if(!_0x5c4de4[_0xdf85('0x28')][_0xdf85('0x2d')](_0xdf85('0x2e'))){_0x55230e['limit']=qs[_0xdf85('0x2f')](_0x5c4de4[_0xdf85('0x28')][_0xdf85('0x2f')]);_0x55230e[_0xdf85('0x30')]=qs[_0xdf85('0x30')](_0x5c4de4[_0xdf85('0x28')]['offset']);}_0x55230e[_0xdf85('0x31')]=qs[_0xdf85('0x32')](_0x5c4de4['query']['sort']);_0x55230e[_0xdf85('0x33')]=qs[_0xdf85('0x29')](_[_0xdf85('0x34')](_0x5c4de4[_0xdf85('0x28')],_0x20b577[_0xdf85('0x29')]));if(_0x5c4de4[_0xdf85('0x28')][_0xdf85('0x35')]){_0x55230e['where']=_[_0xdf85('0x36')](_0x55230e[_0xdf85('0x33')],{'$or':_[_0xdf85('0x37')](_0x3c38c7,function(_0x3804d3){if(_0x3804d3[_0xdf85('0x38')][_0xdf85('0x39')]!=='VIRTUAL'){var _0x1eb302={};_0x1eb302[_0x3804d3[_0xdf85('0x3a')]]={'$like':'%'+_0x5c4de4[_0xdf85('0x28')][_0xdf85('0x35')]+'%'};return _0x1eb302;}})});}_0x55230e=_[_0xdf85('0x36')]({},_0x55230e,_0x5c4de4[_0xdf85('0x3b')]);var _0x2397a5={'where':_0x55230e[_0xdf85('0x33')]};return db[_0xdf85('0x24')][_0xdf85('0x16')](_0x2397a5)[_0xdf85('0x1e')](function(_0x3f85e0){_0x36b7d4[_0xdf85('0x16')]=_0x3f85e0;if(_0x5c4de4[_0xdf85('0x28')]['includeAll']){_0x55230e[_0xdf85('0x3c')]=[{'all':!![]}];}return db[_0xdf85('0x24')]['findAll'](_0x55230e);})[_0xdf85('0x1e')](function(_0x678b65){_0x36b7d4[_0xdf85('0x3d')]=_0x678b65;return _0x36b7d4;})[_0xdf85('0x1e')](respondWithFilteredResult(_0x3527db,_0x55230e))['catch'](handleError(_0x3527db,null));};exports['show']=function(_0x5371e8,_0x47c812){var _0xbceab9={'raw':!![],'where':{'id':_0x5371e8[_0xdf85('0x3e')]['id']}},_0x604514={};_0x604514[_0xdf85('0x26')]=_[_0xdf85('0x27')](db['CmHopperFinal'][_0xdf85('0x25')]);_0x604514[_0xdf85('0x28')]=_['keys'](_0x5371e8['query']);_0x604514['filters']=_[_0xdf85('0x2a')](_0x604514[_0xdf85('0x26')],_0x604514['query']);_0xbceab9[_0xdf85('0x2b')]=_['intersection'](_0x604514[_0xdf85('0x26')],qs[_0xdf85('0x2c')](_0x5371e8['query'][_0xdf85('0x2c')]));_0xbceab9[_0xdf85('0x2b')]=_0xbceab9[_0xdf85('0x2b')][_0xdf85('0x3f')]?_0xbceab9[_0xdf85('0x2b')]:_0x604514[_0xdf85('0x26')];if(_0x5371e8[_0xdf85('0x28')][_0xdf85('0x40')]){_0xbceab9[_0xdf85('0x3c')]=[{'all':!![]}];}_0xbceab9=_[_0xdf85('0x36')]({},_0xbceab9,_0x5371e8['options']);return db[_0xdf85('0x24')][_0xdf85('0x41')](_0xbceab9)['then'](handleEntityNotFound(_0x47c812,null))[_0xdf85('0x1e')](respondWithResult(_0x47c812,null))[_0xdf85('0x42')](handleError(_0x47c812,null));};exports[_0xdf85('0x43')]=function(_0x476fe9,_0x44594e){return db[_0xdf85('0x24')][_0xdf85('0x43')]()[_0xdf85('0x1e')](respondWithResult(_0x44594e,null))[_0xdf85('0x42')](handleError(_0x44594e,null));};exports[_0xdf85('0x1c')]=function(_0x4b1c6d,_0x1a4703){if(_0x4b1c6d[_0xdf85('0x44')]['uniqueid']){delete _0x4b1c6d[_0xdf85('0x44')]['uniqueid'];}return db[_0xdf85('0x24')][_0xdf85('0x41')]({'where':{'uniqueid':_0x4b1c6d['params']['id']}})[_0xdf85('0x1e')](handleEntityNotFound(_0x1a4703,null))['then'](saveUpdates(_0x4b1c6d[_0xdf85('0x44')],null))[_0xdf85('0x1e')](respondWithResult(_0x1a4703,null))[_0xdf85('0x42')](handleError(_0x1a4703,null));};exports[_0xdf85('0x45')]=function(_0x408d68,_0x137e6b,_0x2809e7){return db[_0xdf85('0x24')][_0xdf85('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x408d68[_0xdf85('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x4a')))),'noSuchContacts'],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')]['literal'](_0xdf85('0x4b')))),_0xdf85('0x4c')],[db[_0xdf85('0x48')]['fn']('COUNT',db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')]['literal'](_0xdf85('0x4d')))),_0xdf85('0x4e')],[db[_0xdf85('0x48')]['fn']('COUNT',db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x4f')))),_0xdf85('0x50')],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x51')))),'dropContacts'],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x52')))),_0xdf85('0x53')],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db['sequelize'][_0xdf85('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x54')))),_0xdf85('0x55')]]})[_0xdf85('0x1e')](handleEntityNotFound(_0x137e6b,null))[_0xdf85('0x1e')](respondWithResult(_0x137e6b,null))[_0xdf85('0x42')](handleError(_0x137e6b,null));};exports[_0xdf85('0x56')]=function(_0x57f33f,_0x1c6f72,_0x320753){return db[_0xdf85('0x24')][_0xdf85('0x46')]({'raw':![],'where':{'CampaignId':_0x57f33f[_0xdf85('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0xdf85('0x47'),db['sequelize']['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x4a')))),_0xdf85('0x57')],[db[_0xdf85('0x48')]['fn']('COUNT',db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')]['literal'](_0xdf85('0x4b')))),_0xdf85('0x4c')],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xdf85('0x4e')],[db[_0xdf85('0x48')]['fn']('COUNT',db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x4f')))),_0xdf85('0x50')],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db['sequelize']['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x51')))),_0xdf85('0x58')],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x52')))),'abandonedContacts'],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db['sequelize']['fn']('IF',db[_0xdf85('0x48')][_0xdf85('0x49')](_0xdf85('0x59')))),'reCallContacts'],[db[_0xdf85('0x48')]['fn'](_0xdf85('0x47'),db[_0xdf85('0x48')]['fn']('IF',db[_0xdf85('0x48')]['literal'](_0xdf85('0x54')))),_0xdf85('0x55')]]})[_0xdf85('0x1e')](handleEntityNotFound(_0x1c6f72,null))[_0xdf85('0x1e')](respondWithResult(_0x1c6f72,null))[_0xdf85('0x42')](handleError(_0x1c6f72,null));};exports[_0xdf85('0x5a')]=function(_0x38c234,_0x379fce,_0x1b2474){return db['VoiceQueue'][_0xdf85('0x41')]({'where':{'id':_0x38c234[_0xdf85('0x3e')]['id']}})[_0xdf85('0x1e')](handleEntityNotFound(_0x379fce,null))[_0xdf85('0x1e')](function(_0x24100a){var _0x79996;if(_0x24100a){_0x79996=squel[_0xdf85('0x5b')]()[_0xdf85('0x5c')](_0xdf85('0x5d'))['fromQuery']([_0xdf85('0x5e'),_0xdf85('0x5f'),_0xdf85('0x60'),_0xdf85('0x61'),_0xdf85('0x62'),_0xdf85('0x63'),'updatedAt'],squel['select']()['field'](_0xdf85('0x64'),'phone')['field'](_0xdf85('0x65'),'scheduledAt')[_0xdf85('0x3a')](_0xdf85('0x66'),_0xdf85('0x60'))[_0xdf85('0x3a')]('ANY_VALUE(ListId)',_0xdf85('0x61'))[_0xdf85('0x3a')](_0xdf85('0x67'),_0xdf85('0x62'))[_0xdf85('0x3a')](_0xdf85('0x65'),_0xdf85('0x63'))['field'](_0xdf85('0x65'),_0xdf85('0x68'))[_0xdf85('0x69')](_0xdf85('0x6a'))[_0xdf85('0x33')](_0xdf85('0x6b'),_0x38c234[_0xdf85('0x3e')]['id'][_0xdf85('0x6c')]())[_0xdf85('0x33')](_0xdf85('0x6d'),_0x38c234['body']['state'][_0xdf85('0x6c')]())[_0xdf85('0x33')](_0xdf85('0x6e'))[_0xdf85('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xdf85('0x6f')]()[_0xdf85('0x3a')](_0xdf85('0x5e'))[_0xdf85('0x69')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x38c234['params']['id'][_0xdf85('0x6c')]()))[_0xdf85('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xdf85('0x3a')]('calleridnum')[_0xdf85('0x69')](_0xdf85('0x6a'))['where'](_0xdf85('0x6b'),_0x38c234[_0xdf85('0x3e')]['id'][_0xdf85('0x6c')]())[_0xdf85('0x33')](_0xdf85('0x70')))['group'](_0xdf85('0x60')))[_0xdf85('0x6c')]();return db['sequelize'][_0xdf85('0x28')](_0x79996);}return[];})[_0xdf85('0x1e')](respondWithResult(_0x379fce,null))[_0xdf85('0x42')](handleError(_0x379fce,null));};exports[_0xdf85('0x71')]=function(_0x50f8bb,_0x20ec8d,_0x5e14f1){return db['Campaign']['find']({'where':{'id':_0x50f8bb[_0xdf85('0x3e')]['id']}})['then'](handleEntityNotFound(_0x20ec8d,null))[_0xdf85('0x1e')](function(_0x435a0c){var _0x40cc68;if(_0x435a0c){_0x40cc68=squel['insert']()[_0xdf85('0x5c')](_0xdf85('0x5d'))['fromQuery']([_0xdf85('0x5e'),_0xdf85('0x5f'),_0xdf85('0x60'),_0xdf85('0x61'),_0xdf85('0x72'),_0xdf85('0x63'),_0xdf85('0x68')],squel[_0xdf85('0x6f')]()[_0xdf85('0x3a')](_0xdf85('0x64'),_0xdf85('0x5e'))[_0xdf85('0x3a')](_0xdf85('0x65'),_0xdf85('0x5f'))[_0xdf85('0x3a')](_0xdf85('0x66'),_0xdf85('0x60'))[_0xdf85('0x3a')](_0xdf85('0x73'),_0xdf85('0x61'))['field'](_0xdf85('0x74'),_0xdf85('0x72'))['field']('NOW()',_0xdf85('0x63'))['field'](_0xdf85('0x65'),'updatedAt')['from'](_0xdf85('0x6a'))[_0xdf85('0x33')](_0xdf85('0x75'),_0x50f8bb[_0xdf85('0x3e')]['id'][_0xdf85('0x6c')]())[_0xdf85('0x33')](_0xdf85('0x6d'),_0x50f8bb['body'][_0xdf85('0x76')][_0xdf85('0x6c')]())[_0xdf85('0x33')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xdf85('0x77'),squel[_0xdf85('0x6f')]()[_0xdf85('0x3a')](_0xdf85('0x5e'))['from']('cm_hopper')[_0xdf85('0x33')]('CampaignId\x20=\x20?',_0x50f8bb[_0xdf85('0x3e')]['id'][_0xdf85('0x6c')]()))['where'](_0xdf85('0x77'),squel['select']()[_0xdf85('0x3a')](_0xdf85('0x78'))[_0xdf85('0x69')](_0xdf85('0x6a'))[_0xdf85('0x33')]('CampaignId\x20=\x20?',_0x50f8bb[_0xdf85('0x3e')]['id'][_0xdf85('0x6c')]())['where'](_0xdf85('0x70')))[_0xdf85('0x79')](_0xdf85('0x60')))[_0xdf85('0x6c')]();return db[_0xdf85('0x48')]['query'](_0x40cc68);}return[];})[_0xdf85('0x1e')](respondWithResult(_0x20ec8d,null))[_0xdf85('0x42')](handleError(_0x20ec8d,null));};exports[_0xdf85('0x7a')]=function(_0x13f06b,_0x3d1d70,_0x26a5ac){return db[_0xdf85('0x7b')]['findOne']({'where':{'VoiceQueueId':_0x13f06b[_0xdf85('0x44')][_0xdf85('0x62')],'CampaignId':_0x13f06b[_0xdf85('0x44')][_0xdf85('0x72')],'ContactId':_0x13f06b[_0xdf85('0x44')][_0xdf85('0x60')]}})[_0xdf85('0x1e')](handleEntityNotFound(_0x3d1d70,null))[_0xdf85('0x1e')](function(_0x91153d){if(_0x91153d){return _0x91153d;}return null;})[_0xdf85('0x1e')](respondWithResult(_0x3d1d70,null))['catch'](handleError(_0x3d1d70,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 333b660..0594d62 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 _0xf789=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','api','moment','request-promise'];(function(_0x4ef747,_0x540897){var _0x477551=function(_0x1e86cf){while(--_0x1e86cf){_0x4ef747['push'](_0x4ef747['shift']());}};_0x477551(++_0x540897);}(_0xf789,0xb2));var _0x9f78=function(_0x25ef2b,_0x49717f){_0x25ef2b=_0x25ef2b-0x0;var _0x23f023=_0xf789[_0x25ef2b];return _0x23f023;};'use strict';var _=require(_0x9f78('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9f78('0x1'));var moment=require(_0x9f78('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f78('0x3'));var fs=require('fs');var path=require(_0x9f78('0x4'));var rimraf=require(_0x9f78('0x5'));var config=require(_0x9f78('0x6'));var attributes=require(_0x9f78('0x7'));module[_0x9f78('0x8')]=function(_0x4b7396,_0x1ab24f){return _0x4b7396[_0x9f78('0x9')](_0x9f78('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9f78('0xb'),'fields':[_0x9f78('0xb')]},{'name':_0x9f78('0xc'),'fields':[_0x9f78('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe83=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0xa1f3d9,_0x2a0fa4){var _0x5dcb0a=function(_0x52c7dd){while(--_0x52c7dd){_0xa1f3d9['push'](_0xa1f3d9['shift']());}};_0x5dcb0a(++_0x2a0fa4);}(_0xbe83,0x9c));var _0x3be8=function(_0x89dc28,_0x31c04e){_0x89dc28=_0x89dc28-0x0;var _0xe3f207=_0xbe83[_0x89dc28];return _0xe3f207;};'use strict';var _=require(_0x3be8('0x0'));var util=require(_0x3be8('0x1'));var logger=require(_0x3be8('0x2'))(_0x3be8('0x3'));var moment=require(_0x3be8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3be8('0x5'));var config=require(_0x3be8('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x3be8('0x7')]=function(_0x50b31f,_0x246a23){return _0x50b31f['define'](_0x3be8('0x8'),attributes,{'tableName':_0x3be8('0x9'),'paranoid':![],'indexes':[{'name':_0x3be8('0xa'),'fields':[_0x3be8('0xa')]},{'name':_0x3be8('0xb'),'fields':[_0x3be8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2e8900d..5372095 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 _0x70e0=['options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperFinal,\x20%s,\x20%s','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','body'];(function(_0x56448a,_0x2f4103){var _0x443eb7=function(_0x58b0c5){while(--_0x58b0c5){_0x56448a['push'](_0x56448a['shift']());}};_0x443eb7(++_0x2f4103);}(_0x70e0,0x17b));var _0x070e=function(_0x15cdac,_0x567bed){_0x15cdac=_0x15cdac-0x0;var _0x1d7d30=_0x70e0[_0x15cdac];return _0x1d7d30;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')](_0x38f6e6[_0x070e('0x19')],{'raw':_0x38f6e6[_0x070e('0x1a')]?_0x38f6e6[_0x070e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e958f){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')]('CreateCmHopperFinal',_0x38f6e6,JSON[_0x070e('0xf')](_0x4e958f));_0x364b3f(_0x4e958f);})['catch'](function(_0xf8dd5d){logger[_0x070e('0x10')](_0x070e('0x16'),_0xf8dd5d[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0xf8dd5d[_0x070e('0x13')]));});});}; \ No newline at end of file +var _0xb332=['CreateCmHopperFinal','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperFinal,\x20%s,\x20%s','message','result','catch','CmHopperFinal','create','body','options'];(function(_0x3dbae6,_0x4e3aed){var _0x1caa2d=function(_0x261cf0){while(--_0x261cf0){_0x3dbae6['push'](_0x3dbae6['shift']());}};_0x1caa2d(++_0x4e3aed);}(_0xb332,0xd9));var _0x2b33=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xb332[_0xea343d];return _0x2c6e9c;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')][_0x2b33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461d44,_0x5a7a3f,_0x5ccf2d){return new BPromise(function(_0x4302b7,_0x5f29ab){return client[_0x2b33('0x9')](_0x461d44,_0x5ccf2d)[_0x2b33('0xa')](function(_0x2f2cb3){logger[_0x2b33('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x5a7a3f,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x5a7a3f,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2f2cb3));if(_0x2f2cb3[_0x2b33('0x10')]){if(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')](_0x2b33('0x12'),_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x5f29ab(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}logger[_0x2b33('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x4302b7(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}else{logger[_0x2b33('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x5a7a3f,'request\x20sent');_0x4302b7(_0x2f2cb3[_0x2b33('0x14')][_0x2b33('0x13')]);}})[_0x2b33('0x15')](function(_0x2f5119){logger[_0x2b33('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x5a7a3f,_0x2f5119);_0x5f29ab(_0x2f5119);});});}exports['CreateCmHopperFinal']=function(_0x59f0b6){var _0x4041bd=this;return new Promise(function(_0x4f10c4,_0x543d52){return db[_0x2b33('0x16')][_0x2b33('0x17')](_0x59f0b6[_0x2b33('0x18')],{'raw':_0x59f0b6['options']?_0x59f0b6[_0x2b33('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2b33('0xa')](function(_0x2565be){logger[_0x2b33('0xb')](_0x2b33('0x1a'),_0x59f0b6);logger[_0x2b33('0xd')](_0x2b33('0x1a'),_0x59f0b6,JSON[_0x2b33('0xf')](_0x2565be));_0x4f10c4(_0x2565be);})['catch'](function(_0x23024c){logger[_0x2b33('0x10')](_0x2b33('0x1a'),_0x23024c[_0x2b33('0x13')],_0x59f0b6);_0x543d52(_0x4041bd[_0x2b33('0x10')](0x1f4,_0x23024c[_0x2b33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 19c81fd..9e9dffd 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x4d0603,_0x17f20c){var _0x1d3469=function(_0x547a31){while(--_0x547a31){_0x4d0603['push'](_0x4d0603['shift']());}};_0x1d3469(++_0x17f20c);}(_0x34e8,0x12c));var _0x834e=function(_0x9c93b2,_0x2278ed){_0x9c93b2=_0x9c93b2-0x0;var _0xb2b7a=_0x34e8[_0x9c93b2];return _0xb2b7a;};'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')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0xfa3d69,_0x1b3556){var _0x252d5=function(_0x1b8b0c){while(--_0x1b8b0c){_0xfa3d69['push'](_0xfa3d69['shift']());}};_0x252d5(++_0x1b3556);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f2b46ec..3d9c19b 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 _0x5292=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1bb2b1,_0x41efa7){var _0x3e7424=function(_0x22678d){while(--_0x22678d){_0x1bb2b1['push'](_0x1bb2b1['shift']());}};_0x3e7424(++_0x41efa7);}(_0x5292,0xf7));var _0x2529=function(_0x2a83af,_0x4fa9ed){_0x2a83af=_0x2a83af-0x0;var _0x2e1648=_0x5292[_0x2a83af];return _0x2e1648;};'use strict';var Sequelize=require(_0x2529('0x0'));module[_0x2529('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2529('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2529('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2529('0x4')]},'responsetime':{'type':Sequelize[_0x2529('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2529('0x4')]},'ringtime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2529('0x2')]},'campaign':{'type':Sequelize[_0x2529('0x2')]},'campaigntype':{'type':Sequelize[_0x2529('0x2')]},'membername':{'type':Sequelize[_0x2529('0x2')]},'reason':{'type':Sequelize[_0x2529('0x2')]},'amd':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2529('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2529('0x4')]},'edited':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xd0bb=['exports','INTEGER','DATE','STRING','BOOLEAN','sequelize'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x338442,_0x1974d1){_0x338442=_0x338442-0x0;var _0x11179b=_0xd0bb[_0x338442];return _0x11179b;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'state':{'type':Sequelize[_0xbd0b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xbd0b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbd0b('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xbd0b('0x4')]},'calleridnum':{'type':Sequelize[_0xbd0b('0x4')]},'calleridname':{'type':Sequelize[_0xbd0b('0x4')]},'starttime':{'type':Sequelize[_0xbd0b('0x3')]},'responsetime':{'type':Sequelize[_0xbd0b('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xbd0b('0x3')]},'endtime':{'type':Sequelize[_0xbd0b('0x3')]},'ringtime':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xbd0b('0x4')]},'campaigntype':{'type':Sequelize[_0xbd0b('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xbd0b('0x4')]},'amd':{'type':Sequelize[_0xbd0b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xbd0b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbd0b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbd0b('0x3')]},'recallme':{'type':Sequelize[_0xbd0b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbd0b('0x3')]},'edited':{'type':Sequelize[_0xbd0b('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index dc4b782..6ded96b 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 _0x7a54=['mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','length','includeAll','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x309251,_0x5a6279){var _0x21426a=function(_0x400625){while(--_0x400625){_0x309251['push'](_0x309251['shift']());}};_0x21426a(++_0x5a6279);}(_0x7a54,0x106));var _0x47a5=function(_0x5c1ea7,_0x3033ff){_0x5c1ea7=_0x5c1ea7-0x0;var _0x16953e=_0x7a54[_0x5c1ea7];return _0x16953e;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x5ef1b1,_0xe2dea9){return function(_0x385687){if(!_0x385687){_0x5ef1b1['sendStatus'](0x194);}return _0x385687;};}function handleError(_0x28747d,_0xc4cd63){_0xc4cd63=_0xc4cd63||0x1f4;return function(_0x4437f1){logger[_0x47a5('0x21')](_0x4437f1[_0x47a5('0x22')]);if(_0x4437f1['name']){delete _0x4437f1['name'];}_0x28747d[_0x47a5('0x16')](_0xc4cd63)['send'](_0x4437f1);};}exports[_0x47a5('0x23')]=function(_0x5b6c4e,_0x23cb77){var _0x378208={},_0x36ad34={},_0x1dac65={'count':0x0,'rows':[]};var _0x21f296=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x36ad34[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x21f296);_0x36ad34[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x29')]=_['intersection'](_0x36ad34[_0x47a5('0x26')],_0x36ad34['query']);_0x378208[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x26')],qs['fields'](_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x2c')]));_0x378208[_0x47a5('0x2a')]=_0x378208[_0x47a5('0x2a')]['length']?_0x378208['attributes']:_0x36ad34[_0x47a5('0x26')];if(!_0x5b6c4e[_0x47a5('0x28')]['hasOwnProperty']('nolimit')){_0x378208[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x5b6c4e['query'][_0x47a5('0x19')]);_0x378208['offset']=qs[_0x47a5('0x2d')](_0x5b6c4e[_0x47a5('0x28')]['offset']);}_0x378208['order']=qs[_0x47a5('0x2e')](_0x5b6c4e['query'][_0x47a5('0x2e')]);_0x378208[_0x47a5('0x2f')]=qs[_0x47a5('0x29')](_['pick'](_0x5b6c4e[_0x47a5('0x28')],_0x36ad34['filters']));if(_0x5b6c4e['query'][_0x47a5('0x30')]){_0x378208['where']=_[_0x47a5('0x31')](_0x378208['where'],{'$or':_[_0x47a5('0x32')](_0x21f296,function(_0x3534cb){if(_0x3534cb[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xed6320={};_0xed6320[_0x3534cb[_0x47a5('0x36')]]={'$like':'%'+_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x378208=_['merge']({},_0x378208,_0x5b6c4e[_0x47a5('0x37')]);var _0x10f136={'where':_0x378208['where']};return db[_0x47a5('0x24')][_0x47a5('0x18')](_0x10f136)[_0x47a5('0x20')](function(_0x49c4b5){_0x1dac65[_0x47a5('0x18')]=_0x49c4b5;if(_0x5b6c4e[_0x47a5('0x28')]['includeAll']){_0x378208[_0x47a5('0x38')]=[{'all':!![]}];}return db[_0x47a5('0x24')]['findAll'](_0x378208);})['then'](function(_0x5ebd8c){_0x1dac65[_0x47a5('0x39')]=_0x5ebd8c;return _0x1dac65;})['then'](respondWithFilteredResult(_0x23cb77,_0x378208))[_0x47a5('0x3a')](handleError(_0x23cb77,null));};exports[_0x47a5('0x3b')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':!![],'where':{'id':_0x301a85[_0x47a5('0x3c')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xcb5243[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x301a85['query']);_0xcb5243[_0x47a5('0x29')]=_[_0x47a5('0x2b')](_0xcb5243[_0x47a5('0x26')],_0xcb5243[_0x47a5('0x28')]);_0x1b2c80['attributes']=_[_0x47a5('0x2b')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x2a')]=_0x1b2c80['attributes'][_0x47a5('0x3d')]?_0x1b2c80[_0x47a5('0x2a')]:_0xcb5243[_0x47a5('0x26')];if(_0x301a85['query'][_0x47a5('0x3e')]){_0x1b2c80[_0x47a5('0x38')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x24')]['find'](_0x1b2c80)[_0x47a5('0x20')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x20')](respondWithResult(_0x111f0d,null))[_0x47a5('0x3a')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3f')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x24')][_0x47a5('0x3f')](_0x34a9ae[_0x47a5('0x40')],{})[_0x47a5('0x20')](respondWithResult(_0xf0edbb,0xc9))[_0x47a5('0x3a')](handleError(_0xf0edbb,null));};exports[_0x47a5('0x41')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x24')][_0x47a5('0x41')]()['then'](respondWithResult(_0x3574d4,null))[_0x47a5('0x3a')](handleError(_0x3574d4,null));};exports[_0x47a5('0x1e')]=function(_0x49eab1,_0x52b3a8){if(_0x49eab1[_0x47a5('0x40')]['uniqueid']){delete _0x49eab1[_0x47a5('0x40')][_0x47a5('0x42')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x49eab1[_0x47a5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x52b3a8,null))[_0x47a5('0x20')](saveUpdates(_0x49eab1[_0x47a5('0x40')],null))[_0x47a5('0x20')](respondWithResult(_0x52b3a8,null))[_0x47a5('0x3a')](handleError(_0x52b3a8,null));}; \ No newline at end of file +var _0x5fc3=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','create','body','describe','uniqueid','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','CmHopperHistory','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xf5f93,_0x5ebcef){var _0xb7172b=function(_0xbbaf40){while(--_0xbbaf40){_0xf5f93['push'](_0xf5f93['shift']());}};_0xb7172b(++_0x5ebcef);}(_0x5fc3,0xa8));var _0x35fc=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x5fc3[_0x33c637];return _0x14aa20;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var hardwareService=require(_0x35fc('0x13'));var logger=require('../../config/logger')(_0x35fc('0x14'));var utils=require(_0x35fc('0x15'));var config=require('../../config/environment');var db=require(_0x35fc('0x16'))['db'];function respondWithStatusCode(_0x1a9f2b,_0x5469f5){_0x5469f5=_0x5469f5||0xcc;return function(_0x4cbe74){if(_0x4cbe74){return _0x1a9f2b[_0x35fc('0x17')](_0x5469f5);}return _0x1a9f2b['status'](_0x5469f5)[_0x35fc('0x18')]();};}function respondWithResult(_0x22055e,_0x2a6ad2){_0x2a6ad2=_0x2a6ad2||0xc8;return function(_0x29730f){if(_0x29730f){return _0x22055e[_0x35fc('0x19')](_0x2a6ad2)['json'](_0x29730f);}};}function respondWithFilteredResult(_0x59507a,_0x5eac0f){return function(_0x558364){if(_0x558364){var _0x398b67=_0x558364[_0x35fc('0x1a')],_0x229d56=_0x5eac0f[_0x35fc('0x1b')],_0x53b898=_0x5eac0f['offset']+_0x5eac0f[_0x35fc('0x1c')],_0x154958;if(_0x53b898>=_0x398b67){_0x53b898=_0x398b67;_0x154958=0xc8;}else{_0x154958=0xce;}_0x59507a[_0x35fc('0x19')](_0x154958);return _0x59507a['set'](_0x35fc('0x1d'),_0x229d56+'-'+_0x53b898+'/'+_0x398b67)[_0x35fc('0x1e')](_0x558364);}return null;};}function patchUpdates(_0x2e513b){return function(_0x5f56c6){try{jsonpatch[_0x35fc('0x1f')](_0x5f56c6,_0x2e513b,!![]);}catch(_0x3c58ea){return BPromise[_0x35fc('0x20')](_0x3c58ea);}return _0x5f56c6['save']();};}function saveUpdates(_0x402cff,_0x350a27){return function(_0x3229d1){if(_0x3229d1){return _0x3229d1[_0x35fc('0x21')](_0x402cff)[_0x35fc('0x22')](function(_0x21f1a9){return _0x21f1a9;});}return null;};}function removeEntity(_0x155016,_0x3b05b0){return function(_0x2405e8){if(_0x2405e8){return _0x2405e8[_0x35fc('0x23')]()['then'](function(){_0x155016[_0x35fc('0x19')](0xcc)[_0x35fc('0x18')]();});}};}function handleEntityNotFound(_0x257719,_0x2d8183){return function(_0x3b4743){if(!_0x3b4743){_0x257719['sendStatus'](0x194);}return _0x3b4743;};}function handleError(_0x33f5e8,_0x4c587a){_0x4c587a=_0x4c587a||0x1f4;return function(_0x561bf8){logger[_0x35fc('0x24')](_0x561bf8[_0x35fc('0x25')]);if(_0x561bf8[_0x35fc('0x26')]){delete _0x561bf8['name'];}_0x33f5e8[_0x35fc('0x19')](_0x4c587a)['send'](_0x561bf8);};}exports[_0x35fc('0x27')]=function(_0xdfab9f,_0x5cb986){var _0x519264={},_0x47774c={},_0x58edb6={'count':0x0,'rows':[]};var _0x274208=db[_0x35fc('0x28')]['rawAttributes'];_0x47774c[_0x35fc('0x29')]=_[_0x35fc('0x2a')](_0x274208);_0x47774c[_0x35fc('0x2b')]=_[_0x35fc('0x2a')](_0xdfab9f[_0x35fc('0x2b')]);_0x47774c[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_0x47774c[_0x35fc('0x29')],_0x47774c['query']);_0x519264[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x47774c[_0x35fc('0x29')],qs['fields'](_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x2f')]));_0x519264[_0x35fc('0x2e')]=_0x519264[_0x35fc('0x2e')][_0x35fc('0x30')]?_0x519264[_0x35fc('0x2e')]:_0x47774c[_0x35fc('0x29')];if(!_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x31')](_0x35fc('0x32'))){_0x519264['limit']=qs['limit'](_0xdfab9f[_0x35fc('0x2b')]['limit']);_0x519264[_0x35fc('0x1b')]=qs[_0x35fc('0x1b')](_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x1b')]);}_0x519264[_0x35fc('0x33')]=qs[_0x35fc('0x34')](_0xdfab9f['query'][_0x35fc('0x34')]);_0x519264[_0x35fc('0x35')]=qs[_0x35fc('0x2c')](_[_0x35fc('0x36')](_0xdfab9f[_0x35fc('0x2b')],_0x47774c[_0x35fc('0x2c')]));if(_0xdfab9f['query'][_0x35fc('0x37')]){_0x519264[_0x35fc('0x35')]=_[_0x35fc('0x38')](_0x519264['where'],{'$or':_[_0x35fc('0x39')](_0x274208,function(_0x48d223){if(_0x48d223[_0x35fc('0x3a')][_0x35fc('0x3b')]!==_0x35fc('0x3c')){var _0x2e00e3={};_0x2e00e3[_0x48d223['field']]={'$like':'%'+_0xdfab9f['query']['filter']+'%'};return _0x2e00e3;}})});}_0x519264=_[_0x35fc('0x38')]({},_0x519264,_0xdfab9f['options']);var _0x20f8bb={'where':_0x519264['where']};return db[_0x35fc('0x28')][_0x35fc('0x1a')](_0x20f8bb)[_0x35fc('0x22')](function(_0x22b724){_0x58edb6[_0x35fc('0x1a')]=_0x22b724;if(_0xdfab9f[_0x35fc('0x2b')][_0x35fc('0x3d')]){_0x519264['include']=[{'all':!![]}];}return db[_0x35fc('0x28')][_0x35fc('0x3e')](_0x519264);})['then'](function(_0x1feda5){_0x58edb6[_0x35fc('0x3f')]=_0x1feda5;return _0x58edb6;})[_0x35fc('0x22')](respondWithFilteredResult(_0x5cb986,_0x519264))[_0x35fc('0x40')](handleError(_0x5cb986,null));};exports[_0x35fc('0x41')]=function(_0x31d926,_0x58f25c){var _0x3f6480={'raw':!![],'where':{'id':_0x31d926[_0x35fc('0x42')]['id']}},_0x267858={};_0x267858['model']=_[_0x35fc('0x2a')](db[_0x35fc('0x28')]['rawAttributes']);_0x267858[_0x35fc('0x2b')]=_[_0x35fc('0x2a')](_0x31d926[_0x35fc('0x2b')]);_0x267858[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_0x267858[_0x35fc('0x29')],_0x267858[_0x35fc('0x2b')]);_0x3f6480[_0x35fc('0x2e')]=_['intersection'](_0x267858['model'],qs[_0x35fc('0x2f')](_0x31d926[_0x35fc('0x2b')]['fields']));_0x3f6480['attributes']=_0x3f6480['attributes'][_0x35fc('0x30')]?_0x3f6480[_0x35fc('0x2e')]:_0x267858['model'];if(_0x31d926[_0x35fc('0x2b')][_0x35fc('0x3d')]){_0x3f6480[_0x35fc('0x43')]=[{'all':!![]}];}_0x3f6480=_[_0x35fc('0x38')]({},_0x3f6480,_0x31d926['options']);return db['CmHopperHistory']['find'](_0x3f6480)['then'](handleEntityNotFound(_0x58f25c,null))['then'](respondWithResult(_0x58f25c,null))[_0x35fc('0x40')](handleError(_0x58f25c,null));};exports[_0x35fc('0x44')]=function(_0x4fc5bc,_0x119925){return db['CmHopperHistory'][_0x35fc('0x44')](_0x4fc5bc[_0x35fc('0x45')],{})[_0x35fc('0x22')](respondWithResult(_0x119925,0xc9))[_0x35fc('0x40')](handleError(_0x119925,null));};exports[_0x35fc('0x46')]=function(_0x5d3d0f,_0x64d381){return db[_0x35fc('0x28')]['describe']()[_0x35fc('0x22')](respondWithResult(_0x64d381,null))[_0x35fc('0x40')](handleError(_0x64d381,null));};exports[_0x35fc('0x21')]=function(_0x211746,_0x5bc8c3){if(_0x211746[_0x35fc('0x45')]['uniqueid']){delete _0x211746['body'][_0x35fc('0x47')];}return db[_0x35fc('0x28')][_0x35fc('0x48')]({'where':{'uniqueid':_0x211746[_0x35fc('0x42')]['id']}})[_0x35fc('0x22')](handleEntityNotFound(_0x5bc8c3,null))[_0x35fc('0x22')](saveUpdates(_0x211746[_0x35fc('0x45')],null))[_0x35fc('0x22')](respondWithResult(_0x5bc8c3,null))['catch'](handleError(_0x5bc8c3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 000ff2f..ef80919 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 _0xe706=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x3d2944,_0x34989e){var _0x1c6648=function(_0x4ec33){while(--_0x4ec33){_0x3d2944['push'](_0x3d2944['shift']());}};_0x1c6648(++_0x34989e);}(_0xe706,0xa3));var _0x6e70=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe706[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]},{'name':_0x6e70('0xf'),'fields':[_0x6e70('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x2cbca6,_0x40f512){var _0x19b611=function(_0x40f1a0){while(--_0x40f1a0){_0x2cbca6['push'](_0x2cbca6['shift']());}};_0x19b611(++_0x40f512);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 5938dc7..72bb800 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 _0x8840=['`state`\x20=\x204,\x20`talktime`,\x20null','findAll','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','raw','where','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime'];(function(_0x2c9a9f,_0x4a1ea0){var _0x2b00cd=function(_0x342368){while(--_0x342368){_0x2c9a9f['push'](_0x2c9a9f['shift']());}};_0x2b00cd(++_0x4a1ea0);}(_0x8840,0x1ac));var _0x0884=function(_0x1d5ccb,_0x136776){_0x1d5ccb=_0x1d5ccb-0x0;var _0x49fc07=_0x8840[_0x1d5ccb];return _0x49fc07;};'use strict';var _=require(_0x0884('0x0'));var util=require('util');var moment=require(_0x0884('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0884('0x2'));var db=require(_0x0884('0x3'))['db'];var utils=require(_0x0884('0x4'));var logger=require(_0x0884('0x5'))(_0x0884('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0884('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f25ca,_0x9cbb26,_0x5aff5b){return new BPromise(function(_0x19f0d3,_0x26e915){return client[_0x0884('0x8')](_0x1f25ca,_0x5aff5b)[_0x0884('0x9')](function(_0x302342){logger[_0x0884('0xa')](_0x0884('0xb'),_0x9cbb26,_0x0884('0xc'));logger[_0x0884('0xd')](_0x0884('0xe'),_0x9cbb26,'request\x20sent',JSON[_0x0884('0xf')](_0x302342));if(_0x302342[_0x0884('0x10')]){if(_0x302342['error']['code']===0x1f4){logger['error'](_0x0884('0xb'),_0x9cbb26,_0x302342[_0x0884('0x10')][_0x0884('0x11')]);return _0x26e915(_0x302342[_0x0884('0x10')][_0x0884('0x11')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x9cbb26,_0x302342['error']['message']);return _0x19f0d3(_0x302342[_0x0884('0x10')]['message']);}else{logger['info'](_0x0884('0xb'),_0x9cbb26,_0x0884('0xc'));_0x19f0d3(_0x302342[_0x0884('0x12')]['message']);}})[_0x0884('0x13')](function(_0xf3c35){logger[_0x0884('0x10')](_0x0884('0xb'),_0x9cbb26,_0xf3c35);_0x26e915(_0xf3c35);});});}exports[_0x0884('0x14')]=function(_0x497cf9){var _0x21e7a0=this;return new Promise(function(_0x343df7,_0x45bed6){return db[_0x0884('0x15')][_0x0884('0x16')](_0x497cf9[_0x0884('0x17')],{'raw':_0x497cf9[_0x0884('0x18')]?_0x497cf9[_0x0884('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23949d){logger['info'](_0x0884('0x14'),_0x497cf9);logger[_0x0884('0xd')](_0x0884('0x14'),_0x497cf9,JSON[_0x0884('0xf')](_0x23949d));_0x343df7(_0x23949d);})[_0x0884('0x13')](function(_0x2556f4){logger[_0x0884('0x10')](_0x0884('0x14'),_0x2556f4['message'],_0x497cf9);_0x45bed6(_0x21e7a0[_0x0884('0x10')](0x1f4,_0x2556f4['message']));});});};exports[_0x0884('0x19')]=function(_0x3e4238){var _0x330124=this;return new Promise(function(_0x59d0dd,_0x479eb4){return db['CmHopperHistory']['findAll']({'raw':_0x3e4238[_0x0884('0x18')]?_0x3e4238[_0x0884('0x18')][_0x0884('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e4238['options']?_0x3e4238[_0x0884('0x18')][_0x0884('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')][_0x0884('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x20')))),_0x0884('0x21')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')]['literal'](_0x0884('0x22')))),_0x0884('0x23')],[db[_0x0884('0x1d')]['fn']('COUNT',db[_0x0884('0x1d')]['fn']('IF',db['sequelize'][_0x0884('0x1f')](_0x0884('0x24')))),_0x0884('0x25')],[db['sequelize']['fn'](_0x0884('0x26'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')]['literal'](_0x0884('0x27')))),_0x0884('0x28')],[db['sequelize']['fn'](_0x0884('0x26'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x0884('0x9')](function(_0x4d2dbf){logger['info']('AvgHandleTime',_0x3e4238);logger['debug'](_0x0884('0x19'),_0x3e4238,JSON[_0x0884('0xf')](_0x4d2dbf));_0x59d0dd(_0x4d2dbf);})[_0x0884('0x13')](function(_0x5736e0){logger[_0x0884('0x10')](_0x0884('0x19'),_0x5736e0[_0x0884('0x11')],_0x3e4238);_0x479eb4(_0x330124['error'](0x1f4,_0x5736e0[_0x0884('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3ba7a3){var _0x478256=this;return new Promise(function(_0x762228,_0x1bb243){return db['CmHopperHistory'][_0x0884('0x2a')]({'raw':_0x3ba7a3[_0x0884('0x18')]?_0x3ba7a3[_0x0884('0x18')][_0x0884('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ba7a3[_0x0884('0x18')]?_0x3ba7a3[_0x0884('0x18')][_0x0884('0x1b')]||null:null,'attributes':[[_0x0884('0x2b'),_0x0884('0x2c')],[db[_0x0884('0x1d')]['fn']('COUNT',db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),_0x0884('0x2d')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')]('`state`\x20=\x203,\x201,\x20null'))),_0x0884('0x2e')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x20')))),_0x0884('0x2f')],[db[_0x0884('0x1d')]['fn']('COUNT',db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0x0884('0x30')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x31')))),_0x0884('0x32')],[db['sequelize']['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x33')))),_0x0884('0x34')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0884('0x35')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x36')))),_0x0884('0x37')],[db['sequelize']['fn']('COUNT',db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x38')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x0884('0x1d')]['fn']('IF',db['sequelize'][_0x0884('0x1f')](_0x0884('0x39')))),_0x0884('0x3a')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')](_0x0884('0x3b')))),_0x0884('0x3c')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0884('0x1f')](_0x0884('0x3d')))),_0x0884('0x3e')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')][_0x0884('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0884('0x1f')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x0884('0x2b')]})['then'](function(_0x4fb8ad){logger['info'](_0x0884('0x3f'),_0x3ba7a3);logger[_0x0884('0xd')]('GetVoiceQueueHopperHistory',_0x3ba7a3,JSON[_0x0884('0xf')](_0x4fb8ad));_0x762228(_0x4fb8ad);})[_0x0884('0x13')](function(_0x30982e){logger[_0x0884('0x10')](_0x0884('0x3f'),_0x30982e[_0x0884('0x11')],_0x3ba7a3);_0x1bb243(_0x478256[_0x0884('0x10')](0x1f4,_0x30982e[_0x0884('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x361824){var _0xc50f96=this;return new Promise(function(_0x3471d7,_0x530451){return db[_0x0884('0x15')]['findAll']({'raw':_0x361824[_0x0884('0x18')]?_0x361824[_0x0884('0x18')][_0x0884('0x1a')]===undefined?!![]:![]:!![],'where':_0x361824[_0x0884('0x18')]?_0x361824[_0x0884('0x18')][_0x0884('0x1b')]||null:null,'attributes':[[_0x0884('0x2b'),_0x0884('0x2c')],[db[_0x0884('0x1d')]['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')][_0x0884('0x1e')]('id')),_0x0884('0x40')],[db['sequelize']['fn'](_0x0884('0x1c'),db[_0x0884('0x1d')]['fn']('IF',db[_0x0884('0x1d')]['literal'](_0x0884('0x20')))),_0x0884('0x41')]],'group':[_0x0884('0x2b')]})['then'](function(_0x449363){logger[_0x0884('0xa')]('GetCampaignHopperHistory',_0x361824);logger[_0x0884('0xd')](_0x0884('0x42'),_0x361824,JSON[_0x0884('0xf')](_0x449363));_0x3471d7(_0x449363);})[_0x0884('0x13')](function(_0x1ed143){logger[_0x0884('0x10')](_0x0884('0x42'),_0x1ed143[_0x0884('0x11')],_0x361824);_0x530451(_0xc50f96['error'](0x1f4,_0x1ed143[_0x0884('0x11')]));});});}; \ No newline at end of file +var _0x6f4f=['outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','lodash','util','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','then','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x6f4f,0x187));var _0xf6f4=function(_0x26eea8,_0x3b684c){_0x26eea8=_0x26eea8-0x0;var _0x3bf835=_0x6f4f[_0x26eea8];return _0x3bf835;};'use strict';var _=require(_0xf6f4('0x0'));var util=require(_0xf6f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf6f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6f4('0x3'))['db'];var utils=require(_0xf6f4('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf6f4('0x5'));var client=jayson[_0xf6f4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeda8c8,_0x37939c,_0x53de6f){return new BPromise(function(_0x7382a5,_0x4af406){return client['request'](_0xeda8c8,_0x53de6f)['then'](function(_0x282e55){logger[_0xf6f4('0x7')](_0xf6f4('0x8'),_0x37939c,'request\x20sent');logger[_0xf6f4('0x9')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x37939c,_0xf6f4('0xa'),JSON['stringify'](_0x282e55));if(_0x282e55[_0xf6f4('0xb')]){if(_0x282e55[_0xf6f4('0xb')][_0xf6f4('0xc')]===0x1f4){logger[_0xf6f4('0xb')](_0xf6f4('0x8'),_0x37939c,_0x282e55[_0xf6f4('0xb')][_0xf6f4('0xd')]);return _0x4af406(_0x282e55[_0xf6f4('0xb')][_0xf6f4('0xd')]);}logger[_0xf6f4('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x37939c,_0x282e55['error'][_0xf6f4('0xd')]);return _0x7382a5(_0x282e55[_0xf6f4('0xb')][_0xf6f4('0xd')]);}else{logger['info'](_0xf6f4('0x8'),_0x37939c,_0xf6f4('0xa'));_0x7382a5(_0x282e55[_0xf6f4('0xe')]['message']);}})[_0xf6f4('0xf')](function(_0x237ae3){logger[_0xf6f4('0xb')](_0xf6f4('0x8'),_0x37939c,_0x237ae3);_0x4af406(_0x237ae3);});});}exports[_0xf6f4('0x10')]=function(_0x2409fc){var _0x10d17b=this;return new Promise(function(_0x5bad09,_0x5f02fb){return db[_0xf6f4('0x11')][_0xf6f4('0x12')](_0x2409fc[_0xf6f4('0x13')],{'raw':_0x2409fc[_0xf6f4('0x14')]?_0x2409fc['options']['raw']===undefined?!![]:![]:!![]})[_0xf6f4('0x15')](function(_0x1c008b){logger[_0xf6f4('0x7')]('CreateCmHopperHistory',_0x2409fc);logger[_0xf6f4('0x9')](_0xf6f4('0x10'),_0x2409fc,JSON['stringify'](_0x1c008b));_0x5bad09(_0x1c008b);})['catch'](function(_0xbc996e){logger[_0xf6f4('0xb')](_0xf6f4('0x10'),_0xbc996e['message'],_0x2409fc);_0x5f02fb(_0x10d17b['error'](0x1f4,_0xbc996e['message']));});});};exports[_0xf6f4('0x16')]=function(_0x1d1544){var _0x38a021=this;return new Promise(function(_0x39d71e,_0x5353c5){return db['CmHopperHistory'][_0xf6f4('0x17')]({'raw':_0x1d1544['options']?_0x1d1544['options'][_0xf6f4('0x18')]===undefined?!![]:![]:!![],'where':_0x1d1544['options']?_0x1d1544['options'][_0xf6f4('0x19')]||null:null,'attributes':[[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')][_0xf6f4('0x1c')]('id')),_0xf6f4('0x1d')],[db[_0xf6f4('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x1f')))),_0xf6f4('0x20')],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),_0xf6f4('0x21')],[db['sequelize']['fn'](_0xf6f4('0x22'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x23')))),_0xf6f4('0x24')],[db['sequelize']['fn'](_0xf6f4('0x22'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x25')))),_0xf6f4('0x26')]]})[_0xf6f4('0x15')](function(_0x92cbb4){logger[_0xf6f4('0x7')]('AvgHandleTime',_0x1d1544);logger[_0xf6f4('0x9')](_0xf6f4('0x16'),_0x1d1544,JSON[_0xf6f4('0x27')](_0x92cbb4));_0x39d71e(_0x92cbb4);})[_0xf6f4('0xf')](function(_0x271e2b){logger[_0xf6f4('0xb')](_0xf6f4('0x16'),_0x271e2b['message'],_0x1d1544);_0x5353c5(_0x38a021[_0xf6f4('0xb')](0x1f4,_0x271e2b[_0xf6f4('0xd')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x308e8d){var _0x366e97=this;return new Promise(function(_0x26dc84,_0xe2e1f7){return db[_0xf6f4('0x11')][_0xf6f4('0x17')]({'raw':_0x308e8d[_0xf6f4('0x14')]?_0x308e8d['options'][_0xf6f4('0x18')]===undefined?!![]:![]:!![],'where':_0x308e8d['options']?_0x308e8d['options']['where']||null:null,'attributes':[['campaign','name'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x28')))),_0xf6f4('0x29')],[db[_0xf6f4('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf6f4('0x1e')](_0xf6f4('0x2a')))),_0xf6f4('0x2b')],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x1f')))),_0xf6f4('0x2c')],[db[_0xf6f4('0x1a')]['fn']('COUNT',db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x2d')))),_0xf6f4('0x2e')],[db['sequelize']['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x2f')))),'outboundCongestionCallsDay'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xf6f4('0x30')],[db[_0xf6f4('0x1a')]['fn']('COUNT',db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x31')))),'outboundDropCallsDayCallersExit'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db['sequelize']['literal'](_0xf6f4('0x32')))),_0xf6f4('0x33')],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db['sequelize']['fn']('IF',db[_0xf6f4('0x1a')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0xf6f4('0x34')],[db['sequelize']['fn'](_0xf6f4('0x1b'),db['sequelize']['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x35')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x36')))),_0xf6f4('0x37')],[db['sequelize']['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db['sequelize'][_0xf6f4('0x1e')](_0xf6f4('0x38')))),_0xf6f4('0x39')],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x3a')))),_0xf6f4('0x37')],[db[_0xf6f4('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')](_0xf6f4('0x3b')))),_0xf6f4('0x3c')]],'group':[_0xf6f4('0x3d')]})[_0xf6f4('0x15')](function(_0xa03cd7){logger['info'](_0xf6f4('0x3e'),_0x308e8d);logger['debug'](_0xf6f4('0x3e'),_0x308e8d,JSON['stringify'](_0xa03cd7));_0x26dc84(_0xa03cd7);})[_0xf6f4('0xf')](function(_0x23a211){logger[_0xf6f4('0xb')]('GetVoiceQueueHopperHistory',_0x23a211[_0xf6f4('0xd')],_0x308e8d);_0xe2e1f7(_0x366e97['error'](0x1f4,_0x23a211[_0xf6f4('0xd')]));});});};exports[_0xf6f4('0x3f')]=function(_0x1a0337){var _0x3ed448=this;return new Promise(function(_0x1e7a69,_0x4b5f75){return db[_0xf6f4('0x11')][_0xf6f4('0x17')]({'raw':_0x1a0337[_0xf6f4('0x14')]?_0x1a0337[_0xf6f4('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1a0337['options']?_0x1a0337[_0xf6f4('0x14')]['where']||null:null,'attributes':[[_0xf6f4('0x3d'),'name'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')][_0xf6f4('0x1c')]('id')),'ivrTotalCallsDays'],[db[_0xf6f4('0x1a')]['fn'](_0xf6f4('0x1b'),db[_0xf6f4('0x1a')]['fn']('IF',db[_0xf6f4('0x1a')][_0xf6f4('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xf6f4('0x15')](function(_0x36a61e){logger[_0xf6f4('0x7')]('GetCampaignHopperHistory',_0x1a0337);logger[_0xf6f4('0x9')](_0xf6f4('0x3f'),_0x1a0337,JSON[_0xf6f4('0x27')](_0x36a61e));_0x1e7a69(_0x36a61e);})[_0xf6f4('0xf')](function(_0x16c295){logger[_0xf6f4('0xb')]('GetCampaignHopperHistory',_0x16c295['message'],_0x1a0337);_0x4b5f75(_0x3ed448[_0xf6f4('0xb')](0x1f4,_0x16c295[_0xf6f4('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 84dd750..94f6851 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 _0x106f=['express','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','exports','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x106f,0x162));var _0xf106=function(_0x517589,_0x209a53){_0x517589=_0x517589-0x0;var _0x5d1b9d=_0x106f[_0x517589];return _0x5d1b9d;};'use strict';var multer=require(_0xf106('0x0'));var util=require(_0xf106('0x1'));var path=require('path');var timeout=require(_0xf106('0x2'));var express=require(_0xf106('0x3'));var router=express['Router']();var auth=require(_0xf106('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf106('0x5'));var controller=require(_0xf106('0x6'));router[_0xf106('0x7')]('/',auth[_0xf106('0x8')](),controller[_0xf106('0x9')]);router[_0xf106('0x7')](_0xf106('0xa'),auth['isAuthenticated'](),controller[_0xf106('0xb')]);router[_0xf106('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf106('0xc')]);router[_0xf106('0xd')](_0xf106('0xe'),auth[_0xf106('0x8')](),controller[_0xf106('0xf')]);module[_0xf106('0x10')]=router; \ No newline at end of file +var _0x2123=['post','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','show'];(function(_0x46a7bc,_0xf9be44){var _0x192c57=function(_0x34b24c){while(--_0x34b24c){_0x46a7bc['push'](_0x46a7bc['shift']());}};_0x192c57(++_0xf9be44);}(_0x2123,0x190));var _0x3212=function(_0x2f90db,_0x1327d2){_0x2f90db=_0x2f90db-0x0;var _0x59f52f=_0x2123[_0x2f90db];return _0x59f52f;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var auth=require(_0x3212('0x6'));var interaction=require(_0x3212('0x7'));var config=require(_0x3212('0x8'));var controller=require(_0x3212('0x9'));router[_0x3212('0xa')]('/',auth[_0x3212('0xb')](),controller['index']);router[_0x3212('0xa')](_0x3212('0xc'),auth[_0x3212('0xb')](),controller['describe']);router[_0x3212('0xa')]('/:id',auth[_0x3212('0xb')](),controller[_0x3212('0xd')]);router[_0x3212('0xe')]('/',auth[_0x3212('0xb')](),controller['create']);router['put'](_0x3212('0xf'),auth[_0x3212('0xb')](),controller[_0x3212('0x10')]);module[_0x3212('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 42270f6..781ac91 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 _0x24ca=['sequelize','STRING','name'];(function(_0x5cd7fd,_0x4de617){var _0x5213ae=function(_0x49b2aa){while(--_0x49b2aa){_0x5cd7fd['push'](_0x5cd7fd['shift']());}};_0x5213ae(++_0x4de617);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x24ca[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'unique':_0xa24c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa24c('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3f8a=['name','sequelize','exports','STRING'];(function(_0x5c7e64,_0x404350){var _0x350311=function(_0x49f794){while(--_0x49f794){_0x5c7e64['push'](_0x5c7e64['shift']());}};_0x350311(++_0x404350);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xaec9b8,_0x5eb035){_0xaec9b8=_0xaec9b8-0x0;var _0x35ff86=_0x3f8a[_0xaec9b8];return _0x35ff86;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'unique':_0xa3f8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xa3f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index cc559aa..1941d23 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 _0x4522=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','Lists','end','error','stack','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','map','type','key','field','filter','merge','options','includeAll','include','CmList','findAll','rows','show','params','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addDisposition','ListId','Disposition','findOne','removeDispositions','addContacts','CmContact','describe','tags','join','isArray','push','each','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','raw','getContactsCsv','cf_%d','getContacts','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4522,0x1a0));var _0x2452=function(_0x5c6968,_0x35f27a){_0x5c6968=_0x5c6968-0x0;var _0x243611=_0x4522[_0x5c6968];return _0x243611;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2452('0x0'));var zipdir=require(_0x2452('0x1'));var jsonpatch=require(_0x2452('0x2'));var rp=require('request-promise');var moment=require(_0x2452('0x3'));var BPromise=require(_0x2452('0x4'));var Mustache=require(_0x2452('0x5'));var util=require(_0x2452('0x6'));var path=require(_0x2452('0x7'));var sox=require(_0x2452('0x8'));var csv=require(_0x2452('0x9'));var ejs=require(_0x2452('0xa'));var fs=require('fs');var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x9'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2452('0x13'));var utils=require(_0x2452('0x14'));var config=require(_0x2452('0x15'));var db=require(_0x2452('0x16'))['db'];config[_0x2452('0x17')]=_[_0x2452('0x18')](config[_0x2452('0x17')],{'host':_0x2452('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x2452('0x1a')](socket);function respondWithStatusCode(_0x4fafa0,_0x33e592){_0x33e592=_0x33e592||0xcc;return function(_0x506cd4){if(_0x506cd4){return _0x4fafa0[_0x2452('0x1b')](_0x33e592);}return _0x4fafa0[_0x2452('0x1c')](_0x33e592)['end']();};}function respondWithResult(_0x1dbadf,_0x47930c){_0x47930c=_0x47930c||0xc8;return function(_0x3dd8cc){if(_0x3dd8cc){return _0x1dbadf[_0x2452('0x1c')](_0x47930c)[_0x2452('0x1d')](_0x3dd8cc);}};}function respondWithFilteredResult(_0xdede20,_0x4e1d20){return function(_0x2108e4){if(_0x2108e4){var _0x16e33a=_0x2108e4[_0x2452('0x1e')],_0x59d89a=_0x4e1d20[_0x2452('0x1f')],_0x4802ad=_0x4e1d20['offset']+_0x4e1d20[_0x2452('0x20')],_0x1bfb44;if(_0x4802ad>=_0x16e33a){_0x4802ad=_0x16e33a;_0x1bfb44=0xc8;}else{_0x1bfb44=0xce;}_0xdede20[_0x2452('0x1c')](_0x1bfb44);return _0xdede20[_0x2452('0x21')](_0x2452('0x22'),_0x59d89a+'-'+_0x4802ad+'/'+_0x16e33a)[_0x2452('0x1d')](_0x2108e4);}return null;};}function patchUpdates(_0x1c70cb){return function(_0x3f48c2){try{jsonpatch[_0x2452('0x23')](_0x3f48c2,_0x1c70cb,!![]);}catch(_0x5e921d){return BPromise['reject'](_0x5e921d);}return _0x3f48c2[_0x2452('0x24')]();};}function saveUpdates(_0x32dfe7,_0x4bb3ff){return function(_0x17d0a0){if(_0x17d0a0){return _0x17d0a0[_0x2452('0x25')](_0x32dfe7)[_0x2452('0x26')](function(_0x617ba7){return _0x617ba7;});}return null;};}function removeEntity(_0x285281,_0x397f21){return function(_0x155caa){if(_0x155caa){return _0x155caa['destroy']()[_0x2452('0x26')](function(){var _0x27d049=_0x155caa[_0x2452('0x27')]({'plain':!![]});var _0x231410=_0x2452('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x231410,'resourceId':_0x27d049['id']}})[_0x2452('0x26')](function(){return _0x155caa;});})[_0x2452('0x26')](function(){_0x285281[_0x2452('0x1c')](0xcc)[_0x2452('0x29')]();});}};}function handleEntityNotFound(_0x1aac19,_0x48b313){return function(_0x3fba00){if(!_0x3fba00){_0x1aac19[_0x2452('0x1b')](0x194);}return _0x3fba00;};}function handleError(_0x5e9184,_0x4a25aa){_0x4a25aa=_0x4a25aa||0x1f4;return function(_0x332878){logger[_0x2452('0x2a')](_0x332878[_0x2452('0x2b')]);if(_0x332878[_0x2452('0x2c')]){delete _0x332878[_0x2452('0x2c')];}_0x5e9184[_0x2452('0x1c')](_0x4a25aa)['send'](_0x332878);};}exports['index']=function(_0x46b611,_0x454e0a){var _0x130565={},_0x5c36aa={},_0x2fb2ae={'count':0x0,'rows':[]};var _0x586a20=db['CmList'][_0x2452('0x2d')];_0x5c36aa[_0x2452('0x2e')]=_[_0x2452('0x2f')](_0x586a20);_0x5c36aa[_0x2452('0x30')]=_[_0x2452('0x2f')](_0x46b611[_0x2452('0x30')]);_0x5c36aa[_0x2452('0x31')]=_[_0x2452('0x32')](_0x5c36aa[_0x2452('0x2e')],_0x5c36aa[_0x2452('0x30')]);_0x130565[_0x2452('0x33')]=_[_0x2452('0x32')](_0x5c36aa[_0x2452('0x2e')],qs['fields'](_0x46b611[_0x2452('0x30')][_0x2452('0x34')]));_0x130565['attributes']=_0x130565[_0x2452('0x33')]['length']?_0x130565[_0x2452('0x33')]:_0x5c36aa[_0x2452('0x2e')];if(!_0x46b611['query'][_0x2452('0x35')](_0x2452('0x36'))){_0x130565[_0x2452('0x20')]=qs['limit'](_0x46b611[_0x2452('0x30')][_0x2452('0x20')]);_0x130565['offset']=qs[_0x2452('0x1f')](_0x46b611[_0x2452('0x30')][_0x2452('0x1f')]);}_0x130565[_0x2452('0x37')]=qs[_0x2452('0x38')](_0x46b611['query']['sort']);_0x130565['where']=qs[_0x2452('0x31')](_[_0x2452('0x39')](_0x46b611[_0x2452('0x30')],_0x5c36aa[_0x2452('0x31')]));if(_0x46b611[_0x2452('0x30')]['filter']){_0x130565[_0x2452('0x3a')]=_['merge'](_0x130565['where'],{'$or':_[_0x2452('0x3b')](_0x586a20,function(_0x515e7b){if(_0x515e7b[_0x2452('0x3c')][_0x2452('0x3d')]!=='VIRTUAL'){var _0x30b49f={};_0x30b49f[_0x515e7b[_0x2452('0x3e')]]={'$like':'%'+_0x46b611[_0x2452('0x30')][_0x2452('0x3f')]+'%'};return _0x30b49f;}})});}_0x130565=_[_0x2452('0x40')]({},_0x130565,_0x46b611[_0x2452('0x41')]);var _0x1a1af5={'where':_0x130565[_0x2452('0x3a')]};return db['CmList'][_0x2452('0x1e')](_0x1a1af5)['then'](function(_0xaea800){_0x2fb2ae[_0x2452('0x1e')]=_0xaea800;if(_0x46b611['query'][_0x2452('0x42')]){_0x130565[_0x2452('0x43')]=[{'all':!![]}];}return db[_0x2452('0x44')][_0x2452('0x45')](_0x130565);})[_0x2452('0x26')](function(_0x5af887){_0x2fb2ae[_0x2452('0x46')]=_0x5af887;return _0x2fb2ae;})[_0x2452('0x26')](respondWithFilteredResult(_0x454e0a,_0x130565))['catch'](handleError(_0x454e0a,null));};exports[_0x2452('0x47')]=function(_0x449b89,_0xf21655){var _0x249c2e={'raw':![],'where':{'id':_0x449b89[_0x2452('0x48')]['id']}},_0x4f2dfa={};_0x4f2dfa[_0x2452('0x2e')]=_[_0x2452('0x2f')](db[_0x2452('0x44')][_0x2452('0x2d')]);_0x4f2dfa[_0x2452('0x30')]=_['keys'](_0x449b89[_0x2452('0x30')]);_0x4f2dfa['filters']=_[_0x2452('0x32')](_0x4f2dfa[_0x2452('0x2e')],_0x4f2dfa['query']);_0x249c2e['attributes']=_['intersection'](_0x4f2dfa['model'],qs[_0x2452('0x34')](_0x449b89['query'][_0x2452('0x34')]));_0x249c2e['attributes']=_0x249c2e[_0x2452('0x33')][_0x2452('0x49')]?_0x249c2e['attributes']:_0x4f2dfa['model'];if(_0x449b89[_0x2452('0x30')]['includeAll']){_0x249c2e[_0x2452('0x43')]=[{'all':!![]}];}_0x249c2e=_[_0x2452('0x40')]({},_0x249c2e,_0x449b89[_0x2452('0x41')]);return db[_0x2452('0x44')]['find'](_0x249c2e)['then'](handleEntityNotFound(_0xf21655,null))[_0x2452('0x26')](respondWithResult(_0xf21655,null))[_0x2452('0x4a')](handleError(_0xf21655,null));};exports[_0x2452('0x4b')]=function(_0x2d06f2,_0x453373){return db['CmList'][_0x2452('0x4b')](_0x2d06f2['body'],{})[_0x2452('0x26')](function(_0x53fd05){var _0x454666=_0x2d06f2[_0x2452('0x4c')]['get']({'plain':!![]});if(!_0x454666)throw new Error(_0x2452('0x4d'));if(_0x454666['role']===_0x2452('0x4c')){var _0x4ae614=_0x53fd05['get']({'plain':!![]});var _0x53a4cd=_0x2452('0x28');return db[_0x2452('0x4e')][_0x2452('0x4f')]({'where':{'name':_0x53a4cd,'userProfileId':_0x454666['userProfileId']},'raw':!![]})[_0x2452('0x26')](function(_0x39ceba){if(_0x39ceba&&_0x39ceba[_0x2452('0x50')]===0x0){return db[_0x2452('0x51')][_0x2452('0x4b')]({'name':_0x4ae614['name'],'resourceId':_0x4ae614['id'],'type':_0x39ceba[_0x2452('0x2c')],'sectionId':_0x39ceba['id']},{})['then'](function(){return _0x53fd05;});}else{return _0x53fd05;}})[_0x2452('0x4a')](function(_0x44a6f){logger[_0x2452('0x2a')](_0x2452('0x52'),_0x44a6f);throw _0x44a6f;});}return _0x53fd05;})[_0x2452('0x26')](respondWithResult(_0x453373,0xc9))[_0x2452('0x4a')](handleError(_0x453373,null));};exports[_0x2452('0x25')]=function(_0x24b552,_0x3629d3){if(_0x24b552['body']['id']){delete _0x24b552[_0x2452('0x53')]['id'];}return db['CmList'][_0x2452('0x4f')]({'where':{'id':_0x24b552['params']['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x3629d3,null))[_0x2452('0x26')](saveUpdates(_0x24b552['body'],null))[_0x2452('0x26')](respondWithResult(_0x3629d3,null))[_0x2452('0x4a')](handleError(_0x3629d3,null));};exports[_0x2452('0x54')]=function(_0x2fd391,_0x258510){return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x2fd391[_0x2452('0x48')]['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x258510,null))[_0x2452('0x26')](removeEntity(_0x258510,null))[_0x2452('0x4a')](handleError(_0x258510,null));};exports['describe']=function(_0x6ed5fa,_0x4aef77){return db[_0x2452('0x44')]['describe']()[_0x2452('0x26')](respondWithResult(_0x4aef77,null))[_0x2452('0x4a')](handleError(_0x4aef77,null));};exports[_0x2452('0x55')]=function(_0x1cc61,_0x321092,_0x3b3a5a){if(_0x1cc61[_0x2452('0x53')]['id']){delete _0x1cc61[_0x2452('0x53')]['id'];}return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x1cc61[_0x2452('0x48')]['id']}})['then'](handleEntityNotFound(_0x321092,null))[_0x2452('0x26')](function(_0x101106){if(_0x101106){_0x1cc61[_0x2452('0x53')][_0x2452('0x56')]=_0x101106['id'];return db[_0x2452('0x57')][_0x2452('0x4b')](_0x1cc61['body']);}})[_0x2452('0x26')](respondWithResult(_0x321092,null))[_0x2452('0x4a')](handleError(_0x321092,null));};exports['getDispositions']=function(_0x2c8480,_0x3a64fc,_0x1b8e8b){var _0x234468={'raw':![],'where':{}};var _0x2f1b16={};var _0xa01d01={'count':0x0,'rows':[]};return db[_0x2452('0x44')][_0x2452('0x58')]({'where':{'id':_0x2c8480[_0x2452('0x48')]['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x3a64fc,null))[_0x2452('0x26')](function(_0x58d25b){if(_0x58d25b){_0x2f1b16['model']=_[_0x2452('0x2f')](db['Disposition'][_0x2452('0x2d')]);_0x2f1b16[_0x2452('0x30')]=_[_0x2452('0x2f')](_0x2c8480[_0x2452('0x30')]);_0x2f1b16[_0x2452('0x31')]=_[_0x2452('0x32')](_0x2f1b16['model'],_0x2f1b16['query']);_0x234468[_0x2452('0x33')]=_['intersection'](_0x2f1b16[_0x2452('0x2e')],qs['fields'](_0x2c8480[_0x2452('0x30')][_0x2452('0x34')]));_0x234468[_0x2452('0x33')]=_0x234468[_0x2452('0x33')]['length']?_0x234468['attributes']:_0x2f1b16['model'];if(!_0x2c8480[_0x2452('0x30')][_0x2452('0x35')]('nolimit')){_0x234468['limit']=qs['limit'](_0x2c8480['query']['limit']);_0x234468[_0x2452('0x1f')]=qs['offset'](_0x2c8480['query'][_0x2452('0x1f')]);}_0x234468[_0x2452('0x37')]=qs[_0x2452('0x38')](_0x2c8480[_0x2452('0x30')][_0x2452('0x38')]);_0x234468[_0x2452('0x3a')]=qs['filters'](_[_0x2452('0x39')](_0x2c8480[_0x2452('0x30')],_0x2f1b16[_0x2452('0x31')]));_0x234468['where']['ListId']=_0x58d25b['id'];if(_0x2c8480[_0x2452('0x30')][_0x2452('0x3f')]){_0x234468[_0x2452('0x3a')]=_[_0x2452('0x40')](_0x234468[_0x2452('0x3a')],{'$or':_[_0x2452('0x3b')](_0x234468[_0x2452('0x33')],function(_0x2b2033){var _0x585648={};_0x585648[_0x2b2033]={'$like':'%'+_0x2c8480[_0x2452('0x30')][_0x2452('0x3f')]+'%'};return _0x585648;})});}_0x234468=_[_0x2452('0x40')]({},_0x234468,_0x2c8480[_0x2452('0x41')]);return db['Disposition'][_0x2452('0x1e')]({'where':_0x234468[_0x2452('0x3a')]})['then'](function(_0x20f796){_0xa01d01[_0x2452('0x1e')]=_0x20f796;if(_0x2c8480[_0x2452('0x30')][_0x2452('0x42')]){_0x234468[_0x2452('0x43')]=[{'all':!![]}];}return db[_0x2452('0x57')][_0x2452('0x45')](_0x234468);})[_0x2452('0x26')](function(_0x521640){_0xa01d01['rows']=_0x521640;return _0xa01d01;});}})[_0x2452('0x26')](respondWithFilteredResult(_0x3a64fc,_0x234468))[_0x2452('0x4a')](handleError(_0x3a64fc,null));};exports[_0x2452('0x59')]=function(_0x1530fe,_0x53c85e,_0x19d376){return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x1530fe[_0x2452('0x48')]['id']}})['then'](handleEntityNotFound(_0x53c85e,null))[_0x2452('0x26')](function(_0x1c632f){if(_0x1c632f){return _0x1c632f[_0x2452('0x59')](_0x1530fe[_0x2452('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x53c85e,null))[_0x2452('0x4a')](handleError(_0x53c85e,null));};exports[_0x2452('0x5a')]=function(_0x4c5192,_0x388fb8,_0xe02ef1){return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x4c5192[_0x2452('0x48')]['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x388fb8,null))[_0x2452('0x26')](function(_0x240e94){if(_0x240e94){var _0x3a6a67=[];var _0x378224={'success':[],'errors':[]};return db[_0x2452('0x5b')][_0x2452('0x5c')]()[_0x2452('0x26')](function(_0x326570){if(_0x4c5192[_0x2452('0x53')][_0x2452('0x5d')]&&_['isArray'](_0x4c5192[_0x2452('0x53')][_0x2452('0x5d')])){if(_0x4c5192[_0x2452('0x53')]['tags']['length']){_0x4c5192['body'][_0x2452('0x5d')]=_0x4c5192[_0x2452('0x53')][_0x2452('0x5d')][_0x2452('0x5e')](';')+';';}else{_0x4c5192['body']['tags']=null;}}else{_0x4c5192['body'][_0x2452('0x5d')]=null;}if(_0x4c5192['body']&&_[_0x2452('0x5f')](_0x4c5192['body'])){for(var _0x1aa7e4=0x0;_0x1aa7e4<_0x4c5192['body'][_0x2452('0x49')];_0x1aa7e4+=0x1){_0x4c5192['body'][_0x1aa7e4][_0x2452('0x56')]=_0x4c5192[_0x2452('0x48')]['id'];_0x3a6a67[_0x2452('0x60')](_0x4c5192[_0x2452('0x53')][_0x1aa7e4]);}return BPromise[_0x2452('0x61')](_0x3a6a67,function(_0x5b364f){return db[_0x2452('0x5b')][_0x2452('0x4b')](_[_0x2452('0x62')](_0x5b364f,[_0x2452('0x63'),'id'])||{},{'fields':_[_0x2452('0x2f')](_0x326570),'raw':!![]})[_0x2452('0x26')](function(_0x322a58){_0x378224[_0x2452('0x64')][_0x2452('0x60')](_0x322a58[_0x2452('0x65')]);})[_0x2452('0x4a')](function(_0x5bc43c){_0x378224[_0x2452('0x66')]['push']({'data':_0x5b364f,'error':_0x5bc43c[_0x2452('0x67')]});});})['then'](function(_0x57bc06){return _0x378224;})['catch'](function(_0x59119f){return _0x59119f;});}else{_0x388fb8['status'](0x190)['json']({'message':_0x2452('0x68')});}});}})[_0x2452('0x26')](respondWithResult(_0x388fb8,null))[_0x2452('0x4a')](handleError(_0x388fb8,null));};exports['getContacts']=function(_0x4ef9ed,_0x5448e5,_0x352a66){var _0x2167dc;return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x4ef9ed[_0x2452('0x48')]['id']},'include':[{'model':db[_0x2452('0x69')],'as':_0x2452('0x6a')}]})['then'](handleEntityNotFound(_0x5448e5,null))[_0x2452('0x26')](function(_0x218103){if(_0x218103){_0x2167dc=_0x218103;return db['CmContact'][_0x2452('0x2d')];}})[_0x2452('0x26')](function(_0x17d026){if(_0x17d026){var _0x1960e1={};var _0x4fc46f={};_0x4fc46f[_0x2452('0x2e')]=_['concat'](_[_0x2452('0x2f')](_0x17d026),_[_0x2452('0x3b')](_0x2167dc[_0x2452('0x6a')],function(_0x45ce05){return util[_0x2452('0x6b')]('cf_%d',_0x45ce05['id']);}));_0x4fc46f[_0x2452('0x30')]=_[_0x2452('0x2f')](_0x4ef9ed[_0x2452('0x30')]);_0x4fc46f[_0x2452('0x31')]=_['intersection'](_0x4fc46f[_0x2452('0x2e')],_0x4fc46f[_0x2452('0x30')]);_0x1960e1[_0x2452('0x33')]=_[_0x2452('0x32')](_0x4fc46f[_0x2452('0x2e')],qs[_0x2452('0x34')](_0x4ef9ed[_0x2452('0x30')]['fields']));_0x1960e1[_0x2452('0x33')]=_0x1960e1['attributes']['length']?_0x1960e1['attributes']:_0x4fc46f[_0x2452('0x2e')];if(!_0x4ef9ed[_0x2452('0x30')][_0x2452('0x35')](_0x2452('0x36'))){_0x1960e1[_0x2452('0x20')]=qs[_0x2452('0x20')](_0x4ef9ed[_0x2452('0x30')][_0x2452('0x20')]);_0x1960e1[_0x2452('0x1f')]=qs['offset'](_0x4ef9ed['query']['offset']);}_0x1960e1[_0x2452('0x37')]=qs['sort'](_0x4ef9ed['query'][_0x2452('0x38')]);_0x1960e1[_0x2452('0x3a')]=qs[_0x2452('0x31')](_[_0x2452('0x39')](_0x4ef9ed[_0x2452('0x30')],_0x4fc46f['filters']));_0x1960e1[_0x2452('0x6c')]=!![];if(_0x4ef9ed[_0x2452('0x30')][_0x2452('0x3f')]){_0x1960e1[_0x2452('0x3a')]=_[_0x2452('0x40')](_0x1960e1['where'],{'$or':_[_0x2452('0x3b')](_0x1960e1['attributes'],function(_0x45f40c){var _0x51b6ef={};_0x51b6ef[_0x45f40c]={'$like':'%'+_0x4ef9ed[_0x2452('0x30')][_0x2452('0x3f')]+'%'};return _0x51b6ef;})});}_0x1960e1=_[_0x2452('0x40')]({},_0x1960e1,_0x4ef9ed[_0x2452('0x41')]);return _0x2167dc['getContacts'](_0x1960e1);}})['then'](respondWithResult(_0x5448e5,null))[_0x2452('0x4a')](handleError(_0x5448e5,null));};exports[_0x2452('0x6d')]=function(_0x323a85,_0x44f633,_0x3acc94){var _0x2e32f7;return db['CmList'][_0x2452('0x4f')]({'where':{'id':_0x323a85[_0x2452('0x48')]['id']},'include':[{'model':db[_0x2452('0x69')],'as':_0x2452('0x6a')}]})['then'](handleEntityNotFound(_0x44f633,null))[_0x2452('0x26')](function(_0x1a16c5){if(_0x1a16c5){_0x2e32f7=_0x1a16c5;return db[_0x2452('0x5b')][_0x2452('0x2d')];}})['then'](function(_0x4aa370){if(_0x4aa370){var _0x12dc88={};var _0x25c7e4={};_0x25c7e4[_0x2452('0x2e')]=_['concat'](_[_0x2452('0x2f')](_0x4aa370),_[_0x2452('0x3b')](_0x2e32f7['CustomFields'],function(_0x4c7ad9){return util['format'](_0x2452('0x6e'),_0x4c7ad9['id']);}));_0x25c7e4[_0x2452('0x30')]=_[_0x2452('0x2f')](_0x323a85['query']);_0x25c7e4[_0x2452('0x31')]=_[_0x2452('0x32')](_0x25c7e4[_0x2452('0x2e')],_0x25c7e4['query']);_0x12dc88['attributes']=_[_0x2452('0x32')](_0x25c7e4['model'],qs[_0x2452('0x34')](_0x323a85[_0x2452('0x30')]['fields']));_0x12dc88[_0x2452('0x33')]=_0x12dc88[_0x2452('0x33')][_0x2452('0x49')]?_0x12dc88['attributes']:_0x25c7e4[_0x2452('0x2e')];if(!_0x323a85[_0x2452('0x30')]['hasOwnProperty'](_0x2452('0x36'))){_0x12dc88[_0x2452('0x20')]=qs[_0x2452('0x20')](_0x323a85[_0x2452('0x30')][_0x2452('0x20')]);_0x12dc88[_0x2452('0x1f')]=qs[_0x2452('0x1f')](_0x323a85['query'][_0x2452('0x1f')]);}_0x12dc88[_0x2452('0x37')]=qs[_0x2452('0x38')](_0x323a85[_0x2452('0x30')][_0x2452('0x38')]);_0x12dc88[_0x2452('0x3a')]=qs[_0x2452('0x31')](_[_0x2452('0x39')](_0x323a85[_0x2452('0x30')],_0x25c7e4['filters']));_0x12dc88[_0x2452('0x6c')]=!![];if(_0x323a85[_0x2452('0x30')][_0x2452('0x3f')]){_0x12dc88[_0x2452('0x3a')]=_[_0x2452('0x40')](_0x12dc88[_0x2452('0x3a')],{'$or':_[_0x2452('0x3b')](_0x12dc88[_0x2452('0x33')],function(_0x3b1ffc){var _0x299cc2={};_0x299cc2[_0x3b1ffc]={'$like':'%'+_0x323a85[_0x2452('0x30')]['filter']+'%'};return _0x299cc2;})});}_0x12dc88=_[_0x2452('0x40')]({},_0x12dc88,_0x323a85[_0x2452('0x41')]);return _0x2e32f7[_0x2452('0x6f')](_0x12dc88);}})['then'](function(_0x4d8ed8){if(!_[_0x2452('0x70')](_0x4d8ed8)){var _0x5dafc1=toCsv(_0x4d8ed8);var _0x1afcce=Date[_0x2452('0x71')]();fs[_0x2452('0x72')](util[_0x2452('0x6b')]('/tmp/list_%d_%s.csv',_0x2e32f7['id'],_0x1afcce),_0x5dafc1);_0x44f633[_0x2452('0x73')](_0x2452('0x74'),_0x2452('0x75')+util[_0x2452('0x6b')](_0x2452('0x76'),_0x2e32f7['id'],_0x1afcce));_0x44f633[_0x2452('0x73')](_0x2452('0x77'),_0x2452('0x78'));return _0x44f633[_0x2452('0x79')](util[_0x2452('0x6b')](_0x2452('0x7a'),_0x2e32f7['id'],_0x1afcce));}else{return _0x44f633['sendStatus'](0xcc);}})['catch'](handleError(_0x44f633,null));};exports['addCustomField']=function(_0x303d0d,_0x364fc0,_0x430133){var _0x2d12f1;delete _0x303d0d[_0x2452('0x53')]['id'];return db[_0x2452('0x44')]['findOne']({'where':{'id':_0x303d0d['params']['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x364fc0,null))[_0x2452('0x26')](function(_0x3ccc5c){if(_0x3ccc5c){return db[_0x2452('0x7b')][_0x2452('0x7c')](function(_0x103302){return db[_0x2452('0x69')][_0x2452('0x4b')](_0x303d0d[_0x2452('0x53')],{'transaction':_0x103302})[_0x2452('0x26')](function(_0x54f965){_0x2d12f1=_0x54f965;return _0x3ccc5c[_0x2452('0x7d')](_0x54f965,{'transaction':_0x103302});})[_0x2452('0x26')](function(){var _0x1c4896={'type':db[_0x2452('0x7e')][_0x2452('0x7f')],'transaction':_0x103302};switch(_0x303d0d[_0x2452('0x53')][_0x2452('0x3c')]){case _0x2452('0x80'):_0x1c4896[_0x2452('0x3c')]=db[_0x2452('0x7e')][_0x2452('0x7f')];break;case _0x2452('0x81'):_0x1c4896[_0x2452('0x3c')]=db[_0x2452('0x7e')][_0x2452('0x82')];break;case _0x2452('0x83'):_0x1c4896[_0x2452('0x3c')]=db[_0x2452('0x7e')][_0x2452('0x84')];_0x1c4896['defaultValue']=![];break;default:}return db[_0x2452('0x7b')][_0x2452('0x85')][_0x2452('0x86')](_0x2452('0x87'),util[_0x2452('0x6b')](_0x2452('0x88'),_0x2d12f1['id']),_0x1c4896);})[_0x2452('0x26')](function(){return _0x2d12f1;});});}})[_0x2452('0x26')](respondWithResult(_0x364fc0,null))['catch'](handleError(_0x364fc0,null));};exports[_0x2452('0x89')]=function(_0x327495,_0x23ee70,_0xb6b3f6){var _0x11d110={};var _0x6d2924={};var _0x51a26f;var _0x5b20cc;return db['CmList'][_0x2452('0x58')]({'where':{'id':_0x327495[_0x2452('0x48')]['id']}})[_0x2452('0x26')](handleEntityNotFound(_0x23ee70,null))[_0x2452('0x26')](function(_0x12e9f6){if(_0x12e9f6){_0x51a26f=_0x12e9f6;_0x6d2924['model']=_[_0x2452('0x2f')](db['CmCustomField'][_0x2452('0x2d')]);_0x6d2924[_0x2452('0x30')]=_[_0x2452('0x2f')](_0x327495['query']);_0x6d2924['filters']=_[_0x2452('0x32')](_0x6d2924['model'],_0x6d2924[_0x2452('0x30')]);_0x11d110[_0x2452('0x33')]=_[_0x2452('0x32')](_0x6d2924[_0x2452('0x2e')],qs[_0x2452('0x34')](_0x327495[_0x2452('0x30')]['fields']));_0x11d110['attributes']=_0x11d110['attributes']['length']?_0x11d110[_0x2452('0x33')]:_0x6d2924[_0x2452('0x2e')];_0x11d110['order']=qs['sort'](_0x327495[_0x2452('0x30')][_0x2452('0x38')]);_0x11d110['where']=qs[_0x2452('0x31')](_[_0x2452('0x39')](_0x327495[_0x2452('0x30')],_0x6d2924[_0x2452('0x31')]));_0x11d110[_0x2452('0x3a')]=_[_0x2452('0x40')](_0x11d110['where'],{'$or':[{'ListId':_0x12e9f6['id']},{'ListId':null}]});if(_0x327495[_0x2452('0x30')][_0x2452('0x3f')]){_0x11d110[_0x2452('0x3a')]=_[_0x2452('0x40')](_0x11d110[_0x2452('0x3a')],{'$or':_['map'](_0x11d110[_0x2452('0x33')],function(_0x1e426a){var _0x50e076={};_0x50e076[_0x1e426a]={'$like':'%'+_0x327495['query'][_0x2452('0x3f')]+'%'};return _0x50e076;})});}_0x11d110=_[_0x2452('0x40')]({},_0x11d110,_0x327495[_0x2452('0x41')]);return db[_0x2452('0x69')]['findAndCountAll'](_0x11d110);}})[_0x2452('0x26')](respondWithResult(_0x23ee70,null))[_0x2452('0x4a')](handleError(_0x23ee70,null));};exports[_0x2452('0x8a')]=function(_0x280261,_0x36ab85,_0x27ac75){return db[_0x2452('0x44')][_0x2452('0x4f')]({'where':{'id':_0x280261[_0x2452('0x48')]['id']}})['then'](handleEntityNotFound(_0x36ab85,null))[_0x2452('0x26')](function(_0x54daf6){if(_0x54daf6){return _0x54daf6['addAgents'](_0x280261[_0x2452('0x53')][_0x2452('0x63')],_[_0x2452('0x62')](_0x280261[_0x2452('0x53')],[_0x2452('0x63'),'id'])||{})['spread'](function(_0x37d9b6){for(var _0x5c1308=0x0;_0x5c1308<_0x280261['body']['ids'][_0x2452('0x49')];_0x5c1308+=0x1){socket[_0x2452('0x8b')](_0x2452('0x8c'),{'UserId':_0x280261[_0x2452('0x53')][_0x2452('0x63')][_0x5c1308],'CmListId':_0x280261[_0x2452('0x48')]['id']});}return _0x37d9b6;});}})[_0x2452('0x26')](respondWithResult(_0x36ab85,null))[_0x2452('0x4a')](handleError(_0x36ab85,null));};exports[_0x2452('0x8d')]=function(_0x2c9ee1,_0x5f071f,_0x17d306){return db['CmList']['find']({'where':{'id':_0x2c9ee1[_0x2452('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f071f,null))[_0x2452('0x26')](function(_0x455cc7){if(_0x455cc7){return _0x455cc7[_0x2452('0x8d')](_0x2c9ee1[_0x2452('0x30')]['ids'])[_0x2452('0x26')](function(){if(_[_0x2452('0x5f')](_0x2c9ee1[_0x2452('0x30')][_0x2452('0x63')])){for(var _0x2c1613=0x0;_0x2c1613<_0x2c9ee1[_0x2452('0x30')][_0x2452('0x63')][_0x2452('0x49')];_0x2c1613+=0x1){socket[_0x2452('0x8b')]('userCmList:remove',{'UserId':Number(_0x2c9ee1[_0x2452('0x30')][_0x2452('0x63')][_0x2c1613]),'CmListId':Number(_0x2c9ee1[_0x2452('0x48')]['id'])});}}else{socket['emit'](_0x2452('0x8e'),{'UserId':Number(_0x2c9ee1['query'][_0x2452('0x63')]),'CmListId':Number(_0x2c9ee1[_0x2452('0x48')]['id'])});}});}})[_0x2452('0x26')](respondWithStatusCode(_0x5f071f,null))[_0x2452('0x4a')](handleError(_0x5f071f,null));};exports[_0x2452('0x8f')]=function(_0x50cd5a,_0xe58a0a,_0x56f5b2){var _0x5bbe02={};var _0x5a6eaa={};var _0x3e3635;var _0x47bfb8;return db[_0x2452('0x44')]['findOne']({'where':{'id':_0x50cd5a[_0x2452('0x48')]['id']}})['then'](handleEntityNotFound(_0xe58a0a,null))[_0x2452('0x26')](function(_0x27d78f){if(_0x27d78f){_0x3e3635=_0x27d78f;_0x5a6eaa[_0x2452('0x2e')]=_[_0x2452('0x2f')](db[_0x2452('0x90')][_0x2452('0x2d')]);_0x5a6eaa['query']=_[_0x2452('0x2f')](_0x50cd5a['query']);_0x5a6eaa[_0x2452('0x31')]=_[_0x2452('0x32')](_0x5a6eaa[_0x2452('0x2e')],_0x5a6eaa[_0x2452('0x30')]);_0x5bbe02['attributes']=_['intersection'](_0x5a6eaa[_0x2452('0x2e')],qs[_0x2452('0x34')](_0x50cd5a[_0x2452('0x30')][_0x2452('0x34')]));_0x5bbe02['attributes']=_0x5bbe02[_0x2452('0x33')][_0x2452('0x49')]?_0x5bbe02['attributes']:_0x5a6eaa[_0x2452('0x2e')];_0x5bbe02[_0x2452('0x37')]=qs[_0x2452('0x38')](_0x50cd5a[_0x2452('0x30')]['sort']);_0x5bbe02[_0x2452('0x3a')]=qs[_0x2452('0x31')](_['pick'](_0x50cd5a['query'],_0x5a6eaa['filters']));if(_0x50cd5a[_0x2452('0x30')][_0x2452('0x3f')]){_0x5bbe02['where']=_['merge'](_0x5bbe02[_0x2452('0x3a')],{'$or':_[_0x2452('0x3b')](_0x5bbe02[_0x2452('0x33')],function(_0x166918){var _0xe0c3ae={};_0xe0c3ae[_0x166918]={'$like':'%'+_0x50cd5a[_0x2452('0x30')][_0x2452('0x3f')]+'%'};return _0xe0c3ae;})});}_0x5bbe02=_[_0x2452('0x40')]({},_0x5bbe02,_0x50cd5a[_0x2452('0x41')]);return _0x3e3635[_0x2452('0x8f')](_0x5bbe02);}})[_0x2452('0x26')](function(_0x4b81e6){if(_0x4b81e6){_0x47bfb8=_0x4b81e6[_0x2452('0x49')];if(!_0x50cd5a['query'][_0x2452('0x35')](_0x2452('0x36'))){_0x5bbe02[_0x2452('0x20')]=qs[_0x2452('0x20')](_0x50cd5a['query'][_0x2452('0x20')]);_0x5bbe02[_0x2452('0x1f')]=qs[_0x2452('0x1f')](_0x50cd5a[_0x2452('0x30')][_0x2452('0x1f')]);}return _0x3e3635[_0x2452('0x8f')](_0x5bbe02);}})[_0x2452('0x26')](function(_0x321abf){if(_0x321abf){return _0x321abf?{'count':_0x47bfb8,'rows':_0x321abf}:null;}})[_0x2452('0x26')](respondWithResult(_0xe58a0a,null))[_0x2452('0x4a')](handleError(_0xe58a0a,null));}; \ No newline at end of file +var _0xb688=['include','rows','show','params','includeAll','options','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','tags','join','each','CmContact','omit','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','getContactsCsv','raw','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','type','INTEGER','BOOLEAN','defaultValue','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','userCmList:remove','User','getAgents','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','Lists','error','name','send','index','CmList','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field'];(function(_0x1e3446,_0x3f0de3){var _0x364458=function(_0x48fbca){while(--_0x48fbca){_0x1e3446['push'](_0x1e3446['shift']());}};_0x364458(++_0x3f0de3);}(_0xb688,0xcf));var _0x8b68=function(_0x106354,_0x5184e6){_0x106354=_0x106354-0x0;var _0x2f6b88=_0xb688[_0x106354];return _0x2f6b88;};'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 hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))(_0x8b68('0x17'));var utils=require('../../config/utils');var config=require(_0x8b68('0x18'));var db=require(_0x8b68('0x19'))['db'];config[_0x8b68('0x1a')]=_[_0x8b68('0x1b')](config[_0x8b68('0x1a')],{'host':_0x8b68('0x1c'),'port':0x18eb});var socket=require(_0x8b68('0x1d'))(new Redis(config[_0x8b68('0x1a')]));require(_0x8b68('0x1e'))['register'](socket);function respondWithStatusCode(_0xb2df35,_0x509033){_0x509033=_0x509033||0xcc;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1f')](_0x509033);}return _0xb2df35[_0x8b68('0x20')](_0x509033)[_0x8b68('0x21')]();};}function respondWithResult(_0x5d3468,_0x5c8d0e){_0x5c8d0e=_0x5c8d0e||0xc8;return function(_0x23bd52){if(_0x23bd52){return _0x5d3468['status'](_0x5c8d0e)[_0x8b68('0x22')](_0x23bd52);}};}function respondWithFilteredResult(_0xb44923,_0x1df44f){return function(_0x10c9c6){if(_0x10c9c6){var _0x491695=_0x10c9c6[_0x8b68('0x23')],_0xd17693=_0x1df44f[_0x8b68('0x24')],_0x203dd4=_0x1df44f[_0x8b68('0x24')]+_0x1df44f[_0x8b68('0x25')],_0x4a68c7;if(_0x203dd4>=_0x491695){_0x203dd4=_0x491695;_0x4a68c7=0xc8;}else{_0x4a68c7=0xce;}_0xb44923[_0x8b68('0x20')](_0x4a68c7);return _0xb44923['set'](_0x8b68('0x26'),_0xd17693+'-'+_0x203dd4+'/'+_0x491695)[_0x8b68('0x22')](_0x10c9c6);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x27')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x28')](_0x23edc1)[_0x8b68('0x29')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x2a')]()[_0x8b68('0x29')](function(){var _0x4ca77d=_0x59bb8a[_0x8b68('0x2b')]({'plain':!![]});var _0x3cf8d2=_0x8b68('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cf8d2,'resourceId':_0x4ca77d['id']}})['then'](function(){return _0x59bb8a;});})[_0x8b68('0x29')](function(){_0x32ddc5[_0x8b68('0x20')](0xcc)[_0x8b68('0x21')]();});}};}function handleEntityNotFound(_0x583476,_0x3311c7){return function(_0x53aaa2){if(!_0x53aaa2){_0x583476['sendStatus'](0x194);}return _0x53aaa2;};}function handleError(_0x3865ea,_0x59b3ce){_0x59b3ce=_0x59b3ce||0x1f4;return function(_0x26cad7){logger[_0x8b68('0x2d')](_0x26cad7['stack']);if(_0x26cad7['name']){delete _0x26cad7[_0x8b68('0x2e')];}_0x3865ea[_0x8b68('0x20')](_0x59b3ce)[_0x8b68('0x2f')](_0x26cad7);};}exports[_0x8b68('0x30')]=function(_0x210926,_0x2ad2df){var _0x460c37={},_0x5b7ed1={},_0x3b6d1b={'count':0x0,'rows':[]};var _0x50a1e9=db[_0x8b68('0x31')][_0x8b68('0x32')];_0x5b7ed1['model']=_[_0x8b68('0x33')](_0x50a1e9);_0x5b7ed1[_0x8b68('0x34')]=_[_0x8b68('0x33')](_0x210926['query']);_0x5b7ed1['filters']=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],_0x5b7ed1[_0x8b68('0x34')]);_0x460c37[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x210926[_0x8b68('0x34')][_0x8b68('0x38')]));_0x460c37[_0x8b68('0x37')]=_0x460c37[_0x8b68('0x37')][_0x8b68('0x39')]?_0x460c37[_0x8b68('0x37')]:_0x5b7ed1[_0x8b68('0x36')];if(!_0x210926[_0x8b68('0x34')][_0x8b68('0x3a')](_0x8b68('0x3b'))){_0x460c37[_0x8b68('0x25')]=qs[_0x8b68('0x25')](_0x210926[_0x8b68('0x34')][_0x8b68('0x25')]);_0x460c37[_0x8b68('0x24')]=qs['offset'](_0x210926['query'][_0x8b68('0x24')]);}_0x460c37[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x210926[_0x8b68('0x34')][_0x8b68('0x3d')]);_0x460c37[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_[_0x8b68('0x40')](_0x210926['query'],_0x5b7ed1[_0x8b68('0x3f')]));if(_0x210926[_0x8b68('0x34')][_0x8b68('0x41')]){_0x460c37[_0x8b68('0x3e')]=_[_0x8b68('0x42')](_0x460c37[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x43')](_0x50a1e9,function(_0x2dd264){if(_0x2dd264['type'][_0x8b68('0x44')]!==_0x8b68('0x45')){var _0x1aa5c2={};_0x1aa5c2[_0x2dd264[_0x8b68('0x46')]]={'$like':'%'+_0x210926[_0x8b68('0x34')][_0x8b68('0x41')]+'%'};return _0x1aa5c2;}})});}_0x460c37=_[_0x8b68('0x42')]({},_0x460c37,_0x210926['options']);var _0x162b0c={'where':_0x460c37[_0x8b68('0x3e')]};return db['CmList'][_0x8b68('0x23')](_0x162b0c)[_0x8b68('0x29')](function(_0x50b2f1){_0x3b6d1b['count']=_0x50b2f1;if(_0x210926['query']['includeAll']){_0x460c37[_0x8b68('0x47')]=[{'all':!![]}];}return db[_0x8b68('0x31')]['findAll'](_0x460c37);})[_0x8b68('0x29')](function(_0x5960fc){_0x3b6d1b[_0x8b68('0x48')]=_0x5960fc;return _0x3b6d1b;})[_0x8b68('0x29')](respondWithFilteredResult(_0x2ad2df,_0x460c37))['catch'](handleError(_0x2ad2df,null));};exports[_0x8b68('0x49')]=function(_0x5ae345,_0x4a718c){var _0x537f6f={'raw':![],'where':{'id':_0x5ae345[_0x8b68('0x4a')]['id']}},_0x3ec20a={};_0x3ec20a[_0x8b68('0x36')]=_[_0x8b68('0x33')](db['CmList'][_0x8b68('0x32')]);_0x3ec20a['query']=_[_0x8b68('0x33')](_0x5ae345[_0x8b68('0x34')]);_0x3ec20a['filters']=_[_0x8b68('0x35')](_0x3ec20a[_0x8b68('0x36')],_0x3ec20a[_0x8b68('0x34')]);_0x537f6f[_0x8b68('0x37')]=_['intersection'](_0x3ec20a[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x5ae345[_0x8b68('0x34')][_0x8b68('0x38')]));_0x537f6f[_0x8b68('0x37')]=_0x537f6f[_0x8b68('0x37')][_0x8b68('0x39')]?_0x537f6f[_0x8b68('0x37')]:_0x3ec20a[_0x8b68('0x36')];if(_0x5ae345[_0x8b68('0x34')][_0x8b68('0x4b')]){_0x537f6f[_0x8b68('0x47')]=[{'all':!![]}];}_0x537f6f=_[_0x8b68('0x42')]({},_0x537f6f,_0x5ae345[_0x8b68('0x4c')]);return db[_0x8b68('0x31')][_0x8b68('0x4d')](_0x537f6f)['then'](handleEntityNotFound(_0x4a718c,null))[_0x8b68('0x29')](respondWithResult(_0x4a718c,null))[_0x8b68('0x4e')](handleError(_0x4a718c,null));};exports['create']=function(_0xeab810,_0x4cd28a){return db['CmList']['create'](_0xeab810[_0x8b68('0x4f')],{})[_0x8b68('0x29')](function(_0x34047c){var _0x6da48b=_0xeab810['user']['get']({'plain':!![]});if(!_0x6da48b)throw new Error(_0x8b68('0x50'));if(_0x6da48b[_0x8b68('0x51')]===_0x8b68('0x52')){var _0x5d08c4=_0x34047c[_0x8b68('0x2b')]({'plain':!![]});var _0x431a75='Lists';return db[_0x8b68('0x53')][_0x8b68('0x4d')]({'where':{'name':_0x431a75,'userProfileId':_0x6da48b['userProfileId']},'raw':!![]})[_0x8b68('0x29')](function(_0x754bf7){if(_0x754bf7&&_0x754bf7['autoAssociation']===0x0){return db[_0x8b68('0x54')][_0x8b68('0x55')]({'name':_0x5d08c4['name'],'resourceId':_0x5d08c4['id'],'type':_0x754bf7['name'],'sectionId':_0x754bf7['id']},{})['then'](function(){return _0x34047c;});}else{return _0x34047c;}})[_0x8b68('0x4e')](function(_0x42eabd){logger[_0x8b68('0x2d')](_0x8b68('0x56'),_0x42eabd);throw _0x42eabd;});}return _0x34047c;})['then'](respondWithResult(_0x4cd28a,0xc9))['catch'](handleError(_0x4cd28a,null));};exports[_0x8b68('0x28')]=function(_0xf9cebb,_0x13661e){if(_0xf9cebb['body']['id']){delete _0xf9cebb[_0x8b68('0x4f')]['id'];}return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0xf9cebb['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x13661e,null))['then'](saveUpdates(_0xf9cebb[_0x8b68('0x4f')],null))[_0x8b68('0x29')](respondWithResult(_0x13661e,null))['catch'](handleError(_0x13661e,null));};exports[_0x8b68('0x2a')]=function(_0x25842e,_0x6ac18){return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x25842e['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x6ac18,null))[_0x8b68('0x29')](removeEntity(_0x6ac18,null))[_0x8b68('0x4e')](handleError(_0x6ac18,null));};exports[_0x8b68('0x57')]=function(_0xb55358,_0x1952db){return db[_0x8b68('0x31')][_0x8b68('0x57')]()['then'](respondWithResult(_0x1952db,null))[_0x8b68('0x4e')](handleError(_0x1952db,null));};exports[_0x8b68('0x58')]=function(_0x1e8694,_0x3cc1f4,_0x9c4e2a){if(_0x1e8694[_0x8b68('0x4f')]['id']){delete _0x1e8694[_0x8b68('0x4f')]['id'];}return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x1e8694[_0x8b68('0x4a')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x3cc1f4,null))[_0x8b68('0x29')](function(_0x1019cb){if(_0x1019cb){_0x1e8694[_0x8b68('0x4f')][_0x8b68('0x59')]=_0x1019cb['id'];return db[_0x8b68('0x5a')][_0x8b68('0x55')](_0x1e8694[_0x8b68('0x4f')]);}})[_0x8b68('0x29')](respondWithResult(_0x3cc1f4,null))[_0x8b68('0x4e')](handleError(_0x3cc1f4,null));};exports['getDispositions']=function(_0xaac776,_0x51e17b,_0x592993){var _0x44cf53={'raw':![],'where':{}};var _0x5d2476={};var _0x43f826={'count':0x0,'rows':[]};return db[_0x8b68('0x31')][_0x8b68('0x5b')]({'where':{'id':_0xaac776['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x51e17b,null))[_0x8b68('0x29')](function(_0x16a8ea){if(_0x16a8ea){_0x5d2476[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x5a')][_0x8b68('0x32')]);_0x5d2476['query']=_['keys'](_0xaac776[_0x8b68('0x34')]);_0x5d2476[_0x8b68('0x3f')]=_[_0x8b68('0x35')](_0x5d2476[_0x8b68('0x36')],_0x5d2476[_0x8b68('0x34')]);_0x44cf53[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5d2476[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0xaac776[_0x8b68('0x34')][_0x8b68('0x38')]));_0x44cf53[_0x8b68('0x37')]=_0x44cf53[_0x8b68('0x37')][_0x8b68('0x39')]?_0x44cf53[_0x8b68('0x37')]:_0x5d2476[_0x8b68('0x36')];if(!_0xaac776[_0x8b68('0x34')][_0x8b68('0x3a')]('nolimit')){_0x44cf53['limit']=qs[_0x8b68('0x25')](_0xaac776[_0x8b68('0x34')]['limit']);_0x44cf53['offset']=qs['offset'](_0xaac776[_0x8b68('0x34')][_0x8b68('0x24')]);}_0x44cf53[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0xaac776[_0x8b68('0x34')]['sort']);_0x44cf53[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_['pick'](_0xaac776[_0x8b68('0x34')],_0x5d2476['filters']));_0x44cf53['where']['ListId']=_0x16a8ea['id'];if(_0xaac776[_0x8b68('0x34')][_0x8b68('0x41')]){_0x44cf53[_0x8b68('0x3e')]=_[_0x8b68('0x42')](_0x44cf53[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x43')](_0x44cf53[_0x8b68('0x37')],function(_0x34456d){var _0x427752={};_0x427752[_0x34456d]={'$like':'%'+_0xaac776[_0x8b68('0x34')]['filter']+'%'};return _0x427752;})});}_0x44cf53=_[_0x8b68('0x42')]({},_0x44cf53,_0xaac776[_0x8b68('0x4c')]);return db[_0x8b68('0x5a')]['count']({'where':_0x44cf53['where']})[_0x8b68('0x29')](function(_0x1966f6){_0x43f826['count']=_0x1966f6;if(_0xaac776[_0x8b68('0x34')][_0x8b68('0x4b')]){_0x44cf53[_0x8b68('0x47')]=[{'all':!![]}];}return db[_0x8b68('0x5a')]['findAll'](_0x44cf53);})[_0x8b68('0x29')](function(_0x4925a4){_0x43f826['rows']=_0x4925a4;return _0x43f826;});}})[_0x8b68('0x29')](respondWithFilteredResult(_0x51e17b,_0x44cf53))['catch'](handleError(_0x51e17b,null));};exports[_0x8b68('0x5c')]=function(_0x385eda,_0x5e40f4,_0x3dda74){return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x385eda[_0x8b68('0x4a')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x5e40f4,null))['then'](function(_0x3eff51){if(_0x3eff51){return _0x3eff51[_0x8b68('0x5c')](_0x385eda[_0x8b68('0x34')][_0x8b68('0x5d')]);}})[_0x8b68('0x29')](respondWithStatusCode(_0x5e40f4,null))['catch'](handleError(_0x5e40f4,null));};exports['addContacts']=function(_0x44af14,_0x47c10f,_0x2d442a){return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x44af14[_0x8b68('0x4a')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x47c10f,null))[_0x8b68('0x29')](function(_0x86d163){if(_0x86d163){var _0x486be8=[];var _0x3033b4={'success':[],'errors':[]};return db['CmContact'][_0x8b68('0x57')]()[_0x8b68('0x29')](function(_0xc8c3c){if(_0x44af14['body'][_0x8b68('0x5e')]&&_['isArray'](_0x44af14[_0x8b68('0x4f')]['tags'])){if(_0x44af14[_0x8b68('0x4f')][_0x8b68('0x5e')][_0x8b68('0x39')]){_0x44af14['body'][_0x8b68('0x5e')]=_0x44af14[_0x8b68('0x4f')][_0x8b68('0x5e')][_0x8b68('0x5f')](';')+';';}else{_0x44af14[_0x8b68('0x4f')][_0x8b68('0x5e')]=null;}}else{_0x44af14[_0x8b68('0x4f')][_0x8b68('0x5e')]=null;}if(_0x44af14[_0x8b68('0x4f')]&&_['isArray'](_0x44af14[_0x8b68('0x4f')])){for(var _0x3cb970=0x0;_0x3cb970<_0x44af14[_0x8b68('0x4f')][_0x8b68('0x39')];_0x3cb970+=0x1){_0x44af14[_0x8b68('0x4f')][_0x3cb970]['ListId']=_0x44af14[_0x8b68('0x4a')]['id'];_0x486be8['push'](_0x44af14[_0x8b68('0x4f')][_0x3cb970]);}return BPromise[_0x8b68('0x60')](_0x486be8,function(_0x524763){return db[_0x8b68('0x61')][_0x8b68('0x55')](_[_0x8b68('0x62')](_0x524763,['ids','id'])||{},{'fields':_[_0x8b68('0x33')](_0xc8c3c),'raw':!![]})[_0x8b68('0x29')](function(_0x43a874){_0x3033b4[_0x8b68('0x63')][_0x8b68('0x64')](_0x43a874[_0x8b68('0x65')]);})['catch'](function(_0x3b1c92){_0x3033b4[_0x8b68('0x66')][_0x8b68('0x64')]({'data':_0x524763,'error':_0x3b1c92['message']});});})[_0x8b68('0x29')](function(_0xde4083){return _0x3033b4;})[_0x8b68('0x4e')](function(_0x244884){return _0x244884;});}else{_0x47c10f[_0x8b68('0x20')](0x190)[_0x8b68('0x22')]({'message':_0x8b68('0x67')});}});}})[_0x8b68('0x29')](respondWithResult(_0x47c10f,null))[_0x8b68('0x4e')](handleError(_0x47c10f,null));};exports[_0x8b68('0x68')]=function(_0x44bb3a,_0x490f2c,_0x570629){var _0x1e77f0;return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x44bb3a[_0x8b68('0x4a')]['id']},'include':[{'model':db[_0x8b68('0x69')],'as':'CustomFields'}]})[_0x8b68('0x29')](handleEntityNotFound(_0x490f2c,null))[_0x8b68('0x29')](function(_0x23d041){if(_0x23d041){_0x1e77f0=_0x23d041;return db[_0x8b68('0x61')]['rawAttributes'];}})['then'](function(_0x417bc0){if(_0x417bc0){var _0x42a69b={};var _0x2905a5={};_0x2905a5[_0x8b68('0x36')]=_[_0x8b68('0x6a')](_[_0x8b68('0x33')](_0x417bc0),_[_0x8b68('0x43')](_0x1e77f0[_0x8b68('0x6b')],function(_0x51f078){return util[_0x8b68('0x6c')](_0x8b68('0x6d'),_0x51f078['id']);}));_0x2905a5[_0x8b68('0x34')]=_[_0x8b68('0x33')](_0x44bb3a[_0x8b68('0x34')]);_0x2905a5[_0x8b68('0x3f')]=_['intersection'](_0x2905a5[_0x8b68('0x36')],_0x2905a5[_0x8b68('0x34')]);_0x42a69b[_0x8b68('0x37')]=_['intersection'](_0x2905a5[_0x8b68('0x36')],qs['fields'](_0x44bb3a[_0x8b68('0x34')]['fields']));_0x42a69b[_0x8b68('0x37')]=_0x42a69b[_0x8b68('0x37')][_0x8b68('0x39')]?_0x42a69b[_0x8b68('0x37')]:_0x2905a5[_0x8b68('0x36')];if(!_0x44bb3a[_0x8b68('0x34')]['hasOwnProperty']('nolimit')){_0x42a69b['limit']=qs[_0x8b68('0x25')](_0x44bb3a[_0x8b68('0x34')][_0x8b68('0x25')]);_0x42a69b[_0x8b68('0x24')]=qs[_0x8b68('0x24')](_0x44bb3a[_0x8b68('0x34')][_0x8b68('0x24')]);}_0x42a69b[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x44bb3a[_0x8b68('0x34')][_0x8b68('0x3d')]);_0x42a69b[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_[_0x8b68('0x40')](_0x44bb3a[_0x8b68('0x34')],_0x2905a5['filters']));_0x42a69b['raw']=!![];if(_0x44bb3a['query'][_0x8b68('0x41')]){_0x42a69b[_0x8b68('0x3e')]=_[_0x8b68('0x42')](_0x42a69b[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x43')](_0x42a69b['attributes'],function(_0x620256){var _0x5294ba={};_0x5294ba[_0x620256]={'$like':'%'+_0x44bb3a[_0x8b68('0x34')]['filter']+'%'};return _0x5294ba;})});}_0x42a69b=_[_0x8b68('0x42')]({},_0x42a69b,_0x44bb3a['options']);return _0x1e77f0[_0x8b68('0x68')](_0x42a69b);}})['then'](respondWithResult(_0x490f2c,null))[_0x8b68('0x4e')](handleError(_0x490f2c,null));};exports[_0x8b68('0x6e')]=function(_0x5c5f58,_0xeb8fba,_0x4520af){var _0x5b24e7;return db[_0x8b68('0x31')]['find']({'where':{'id':_0x5c5f58[_0x8b68('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x8b68('0x6b')}]})[_0x8b68('0x29')](handleEntityNotFound(_0xeb8fba,null))[_0x8b68('0x29')](function(_0x46a616){if(_0x46a616){_0x5b24e7=_0x46a616;return db[_0x8b68('0x61')][_0x8b68('0x32')];}})[_0x8b68('0x29')](function(_0x4bb3c3){if(_0x4bb3c3){var _0x19d947={};var _0x2ecedc={};_0x2ecedc[_0x8b68('0x36')]=_[_0x8b68('0x6a')](_[_0x8b68('0x33')](_0x4bb3c3),_[_0x8b68('0x43')](_0x5b24e7[_0x8b68('0x6b')],function(_0x19c3e3){return util[_0x8b68('0x6c')](_0x8b68('0x6d'),_0x19c3e3['id']);}));_0x2ecedc[_0x8b68('0x34')]=_[_0x8b68('0x33')](_0x5c5f58[_0x8b68('0x34')]);_0x2ecedc[_0x8b68('0x3f')]=_['intersection'](_0x2ecedc[_0x8b68('0x36')],_0x2ecedc[_0x8b68('0x34')]);_0x19d947[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x2ecedc[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x5c5f58['query'][_0x8b68('0x38')]));_0x19d947[_0x8b68('0x37')]=_0x19d947[_0x8b68('0x37')][_0x8b68('0x39')]?_0x19d947[_0x8b68('0x37')]:_0x2ecedc[_0x8b68('0x36')];if(!_0x5c5f58[_0x8b68('0x34')][_0x8b68('0x3a')](_0x8b68('0x3b'))){_0x19d947['limit']=qs[_0x8b68('0x25')](_0x5c5f58['query']['limit']);_0x19d947['offset']=qs[_0x8b68('0x24')](_0x5c5f58[_0x8b68('0x34')]['offset']);}_0x19d947[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x5c5f58[_0x8b68('0x34')][_0x8b68('0x3d')]);_0x19d947[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_[_0x8b68('0x40')](_0x5c5f58[_0x8b68('0x34')],_0x2ecedc[_0x8b68('0x3f')]));_0x19d947[_0x8b68('0x6f')]=!![];if(_0x5c5f58['query'][_0x8b68('0x41')]){_0x19d947[_0x8b68('0x3e')]=_['merge'](_0x19d947[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x43')](_0x19d947['attributes'],function(_0x4d2658){var _0x798a24={};_0x798a24[_0x4d2658]={'$like':'%'+_0x5c5f58[_0x8b68('0x34')][_0x8b68('0x41')]+'%'};return _0x798a24;})});}_0x19d947=_[_0x8b68('0x42')]({},_0x19d947,_0x5c5f58[_0x8b68('0x4c')]);return _0x5b24e7[_0x8b68('0x68')](_0x19d947);}})[_0x8b68('0x29')](function(_0x1419ea){if(!_['isEmpty'](_0x1419ea)){var _0x21c83f=toCsv(_0x1419ea);var _0x5e98d0=Date['now']();fs[_0x8b68('0x70')](util[_0x8b68('0x6c')]('/tmp/list_%d_%s.csv',_0x5b24e7['id'],_0x5e98d0),_0x21c83f);_0xeb8fba[_0x8b68('0x71')]('Content-disposition',_0x8b68('0x72')+util[_0x8b68('0x6c')](_0x8b68('0x73'),_0x5b24e7['id'],_0x5e98d0));_0xeb8fba['setHeader'](_0x8b68('0x74'),'text/csv');return _0xeb8fba['download'](util[_0x8b68('0x6c')](_0x8b68('0x75'),_0x5b24e7['id'],_0x5e98d0));}else{return _0xeb8fba[_0x8b68('0x1f')](0xcc);}})[_0x8b68('0x4e')](handleError(_0xeb8fba,null));};exports[_0x8b68('0x76')]=function(_0x220893,_0x2d0613,_0x489c59){var _0x167ca8;delete _0x220893[_0x8b68('0x4f')]['id'];return db[_0x8b68('0x31')][_0x8b68('0x5b')]({'where':{'id':_0x220893[_0x8b68('0x4a')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x2d0613,null))[_0x8b68('0x29')](function(_0x58451d){if(_0x58451d){return db[_0x8b68('0x77')][_0x8b68('0x78')](function(_0x4e3356){return db['CmCustomField'][_0x8b68('0x55')](_0x220893[_0x8b68('0x4f')],{'transaction':_0x4e3356})['then'](function(_0x335b0e){_0x167ca8=_0x335b0e;return _0x58451d[_0x8b68('0x79')](_0x335b0e,{'transaction':_0x4e3356});})[_0x8b68('0x29')](function(){var _0x23f7ec={'type':db[_0x8b68('0x7a')][_0x8b68('0x7b')],'transaction':_0x4e3356};switch(_0x220893[_0x8b68('0x4f')]['type']){case _0x8b68('0x7c'):_0x23f7ec[_0x8b68('0x7d')]=db[_0x8b68('0x7a')]['TEXT'];break;case'number':_0x23f7ec[_0x8b68('0x7d')]=db[_0x8b68('0x7a')][_0x8b68('0x7e')];break;case'switch':_0x23f7ec['type']=db[_0x8b68('0x7a')][_0x8b68('0x7f')];_0x23f7ec[_0x8b68('0x80')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x8b68('0x81'),util[_0x8b68('0x6c')](_0x8b68('0x82'),_0x167ca8['id']),_0x23f7ec);})[_0x8b68('0x29')](function(){return _0x167ca8;});});}})[_0x8b68('0x29')](respondWithResult(_0x2d0613,null))['catch'](handleError(_0x2d0613,null));};exports['getCustomFields']=function(_0x1c80a9,_0x4d06a9,_0x5a1823){var _0x5b2d4c={};var _0x3a6f12={};var _0x45d5e0;var _0x40171d;return db['CmList'][_0x8b68('0x5b')]({'where':{'id':_0x1c80a9['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x4d06a9,null))[_0x8b68('0x29')](function(_0x46b29e){if(_0x46b29e){_0x45d5e0=_0x46b29e;_0x3a6f12[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x69')][_0x8b68('0x32')]);_0x3a6f12[_0x8b68('0x34')]=_[_0x8b68('0x33')](_0x1c80a9[_0x8b68('0x34')]);_0x3a6f12[_0x8b68('0x3f')]=_[_0x8b68('0x35')](_0x3a6f12[_0x8b68('0x36')],_0x3a6f12[_0x8b68('0x34')]);_0x5b2d4c[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x3a6f12[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x1c80a9[_0x8b68('0x34')]['fields']));_0x5b2d4c[_0x8b68('0x37')]=_0x5b2d4c['attributes'][_0x8b68('0x39')]?_0x5b2d4c[_0x8b68('0x37')]:_0x3a6f12[_0x8b68('0x36')];_0x5b2d4c[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x1c80a9[_0x8b68('0x34')][_0x8b68('0x3d')]);_0x5b2d4c[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_[_0x8b68('0x40')](_0x1c80a9[_0x8b68('0x34')],_0x3a6f12[_0x8b68('0x3f')]));_0x5b2d4c['where']=_[_0x8b68('0x42')](_0x5b2d4c[_0x8b68('0x3e')],{'$or':[{'ListId':_0x46b29e['id']},{'ListId':null}]});if(_0x1c80a9[_0x8b68('0x34')][_0x8b68('0x41')]){_0x5b2d4c[_0x8b68('0x3e')]=_[_0x8b68('0x42')](_0x5b2d4c[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x43')](_0x5b2d4c[_0x8b68('0x37')],function(_0x267011){var _0x2ba260={};_0x2ba260[_0x267011]={'$like':'%'+_0x1c80a9['query'][_0x8b68('0x41')]+'%'};return _0x2ba260;})});}_0x5b2d4c=_[_0x8b68('0x42')]({},_0x5b2d4c,_0x1c80a9[_0x8b68('0x4c')]);return db[_0x8b68('0x69')][_0x8b68('0x83')](_0x5b2d4c);}})['then'](respondWithResult(_0x4d06a9,null))[_0x8b68('0x4e')](handleError(_0x4d06a9,null));};exports[_0x8b68('0x84')]=function(_0x50b1fd,_0x14021d,_0x420ed6){return db['CmList']['find']({'where':{'id':_0x50b1fd[_0x8b68('0x4a')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x14021d,null))[_0x8b68('0x29')](function(_0x2b27b9){if(_0x2b27b9){return _0x2b27b9[_0x8b68('0x84')](_0x50b1fd[_0x8b68('0x4f')][_0x8b68('0x5d')],_[_0x8b68('0x62')](_0x50b1fd['body'],[_0x8b68('0x5d'),'id'])||{})[_0x8b68('0x85')](function(_0x2e7e06){for(var _0x3fbe11=0x0;_0x3fbe11<_0x50b1fd['body'][_0x8b68('0x5d')]['length'];_0x3fbe11+=0x1){socket[_0x8b68('0x86')](_0x8b68('0x87'),{'UserId':_0x50b1fd[_0x8b68('0x4f')][_0x8b68('0x5d')][_0x3fbe11],'CmListId':_0x50b1fd[_0x8b68('0x4a')]['id']});}return _0x2e7e06;});}})[_0x8b68('0x29')](respondWithResult(_0x14021d,null))['catch'](handleError(_0x14021d,null));};exports['removeAgents']=function(_0x5647ef,_0x586aa3,_0x4df9bb){return db[_0x8b68('0x31')][_0x8b68('0x4d')]({'where':{'id':_0x5647ef['params']['id']}})['then'](handleEntityNotFound(_0x586aa3,null))[_0x8b68('0x29')](function(_0x31b48b){if(_0x31b48b){return _0x31b48b['removeAgents'](_0x5647ef[_0x8b68('0x34')][_0x8b68('0x5d')])['then'](function(){if(_['isArray'](_0x5647ef[_0x8b68('0x34')][_0x8b68('0x5d')])){for(var _0x406764=0x0;_0x406764<_0x5647ef[_0x8b68('0x34')][_0x8b68('0x5d')][_0x8b68('0x39')];_0x406764+=0x1){socket[_0x8b68('0x86')](_0x8b68('0x88'),{'UserId':Number(_0x5647ef['query'][_0x8b68('0x5d')][_0x406764]),'CmListId':Number(_0x5647ef[_0x8b68('0x4a')]['id'])});}}else{socket[_0x8b68('0x86')](_0x8b68('0x88'),{'UserId':Number(_0x5647ef[_0x8b68('0x34')]['ids']),'CmListId':Number(_0x5647ef[_0x8b68('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x586aa3,null))[_0x8b68('0x4e')](handleError(_0x586aa3,null));};exports['getAgents']=function(_0x25bb57,_0x2afa34,_0x3c530f){var _0x5a031f={};var _0x278133={};var _0x4ca4ce;var _0x18d02d;return db[_0x8b68('0x31')][_0x8b68('0x5b')]({'where':{'id':_0x25bb57[_0x8b68('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2afa34,null))[_0x8b68('0x29')](function(_0x1b12a6){if(_0x1b12a6){_0x4ca4ce=_0x1b12a6;_0x278133[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x89')][_0x8b68('0x32')]);_0x278133[_0x8b68('0x34')]=_[_0x8b68('0x33')](_0x25bb57[_0x8b68('0x34')]);_0x278133[_0x8b68('0x3f')]=_[_0x8b68('0x35')](_0x278133[_0x8b68('0x36')],_0x278133[_0x8b68('0x34')]);_0x5a031f[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x278133[_0x8b68('0x36')],qs['fields'](_0x25bb57[_0x8b68('0x34')]['fields']));_0x5a031f[_0x8b68('0x37')]=_0x5a031f[_0x8b68('0x37')][_0x8b68('0x39')]?_0x5a031f[_0x8b68('0x37')]:_0x278133[_0x8b68('0x36')];_0x5a031f[_0x8b68('0x3c')]=qs['sort'](_0x25bb57['query']['sort']);_0x5a031f[_0x8b68('0x3e')]=qs[_0x8b68('0x3f')](_[_0x8b68('0x40')](_0x25bb57[_0x8b68('0x34')],_0x278133[_0x8b68('0x3f')]));if(_0x25bb57[_0x8b68('0x34')][_0x8b68('0x41')]){_0x5a031f[_0x8b68('0x3e')]=_[_0x8b68('0x42')](_0x5a031f[_0x8b68('0x3e')],{'$or':_['map'](_0x5a031f['attributes'],function(_0x241846){var _0x5b0ed7={};_0x5b0ed7[_0x241846]={'$like':'%'+_0x25bb57[_0x8b68('0x34')][_0x8b68('0x41')]+'%'};return _0x5b0ed7;})});}_0x5a031f=_[_0x8b68('0x42')]({},_0x5a031f,_0x25bb57[_0x8b68('0x4c')]);return _0x4ca4ce[_0x8b68('0x8a')](_0x5a031f);}})[_0x8b68('0x29')](function(_0x114e85){if(_0x114e85){_0x18d02d=_0x114e85['length'];if(!_0x25bb57['query'][_0x8b68('0x3a')](_0x8b68('0x3b'))){_0x5a031f[_0x8b68('0x25')]=qs[_0x8b68('0x25')](_0x25bb57[_0x8b68('0x34')]['limit']);_0x5a031f[_0x8b68('0x24')]=qs[_0x8b68('0x24')](_0x25bb57[_0x8b68('0x34')][_0x8b68('0x24')]);}return _0x4ca4ce[_0x8b68('0x8a')](_0x5a031f);}})['then'](function(_0x9d6042){if(_0x9d6042){return _0x9d6042?{'count':_0x18d02d,'rows':_0x9d6042}:null;}})[_0x8b68('0x29')](respondWithResult(_0x2afa34,null))[_0x8b68('0x4e')](handleError(_0x2afa34,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5b918c7..ebdbe8a 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 _0x6c40=['exports','../../mysqldb','CmList','setMaxListeners','update','remove','emit','hook'];(function(_0x324f55,_0x2e6ca4){var _0x284952=function(_0x36ceae){while(--_0x36ceae){_0x324f55['push'](_0x324f55['shift']());}};_0x284952(++_0x2e6ca4);}(_0x6c40,0x1a1));var _0x06c4=function(_0x571874,_0x7cc1a){_0x571874=_0x571874-0x0;var _0x4d6c5e=_0x6c40[_0x571874];return _0x4d6c5e;};'use strict';var EventEmitter=require('events');var CmList=require(_0x06c4('0x0'))['db'][_0x06c4('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x06c4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x06c4('0x3'),'afterDestroy':_0x06c4('0x4')};function emitEvent(_0x43b14b){return function(_0x4f2754,_0x39e53a,_0x3a7a30){CmListEvents[_0x06c4('0x5')](_0x43b14b+':'+_0x4f2754['id'],_0x4f2754);CmListEvents['emit'](_0x43b14b,_0x4f2754);_0x3a7a30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x06c4('0x6')](e,emitEvent(event));}}module[_0x06c4('0x7')]=CmListEvents; \ No newline at end of file +var _0xebe4=['hook','exports','events','../../mysqldb','CmList','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x17a0b0,_0x247cb7){var _0x445ead=function(_0x36dcdc){while(--_0x36dcdc){_0x17a0b0['push'](_0x17a0b0['shift']());}};_0x445ead(++_0x247cb7);}(_0xebe4,0x142));var _0x4ebe=function(_0xe84132,_0x5beb96){_0xe84132=_0xe84132-0x0;var _0x4ba436=_0xebe4[_0xe84132];return _0x4ba436;};'use strict';var EventEmitter=require(_0x4ebe('0x0'));var CmList=require(_0x4ebe('0x1'))['db'][_0x4ebe('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x4ebe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ebe('0x4'),'afterDestroy':_0x4ebe('0x5')};function emitEvent(_0x3f51da){return function(_0x252aa2,_0xd663d,_0x168642){CmListEvents['emit'](_0x3f51da+':'+_0x252aa2['id'],_0x252aa2);CmListEvents[_0x4ebe('0x6')](_0x3f51da,_0x252aa2);_0x168642(null);};}for(var e in events){if(events[_0x4ebe('0x7')](e)){var event=events[e];CmList[_0x4ebe('0x8')](e,emitEvent(event));}}module[_0x4ebe('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4ec8de1..958c0f6 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 _0x9181=['CmList','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x2dd22e,_0xec41fe){var _0x257b01=function(_0x26de99){while(--_0x26de99){_0x2dd22e['push'](_0x2dd22e['shift']());}};_0x257b01(++_0xec41fe);}(_0x9181,0x182));var _0x1918=function(_0x56aa6f,_0x5bebee){_0x56aa6f=_0x56aa6f-0x0;var _0x4f9c35=_0x9181[_0x56aa6f];return _0x4f9c35;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var logger=require(_0x1918('0x2'))(_0x1918('0x3'));var moment=require(_0x1918('0x4'));var BPromise=require('bluebird');var rp=require(_0x1918('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var attributes=require(_0x1918('0x8'));module[_0x1918('0x9')]=function(_0x424951,_0x4106d7){return _0x424951['define'](_0x1918('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae7b=['CmList','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports'];(function(_0x1e45a5,_0x57881e){var _0x526f4a=function(_0x3dd59a){while(--_0x3dd59a){_0x1e45a5['push'](_0x1e45a5['shift']());}};_0x526f4a(++_0x57881e);}(_0xae7b,0xbe));var _0xbae7=function(_0xc7679b,_0x2511a2){_0xc7679b=_0xc7679b-0x0;var _0x4e8f0b=_0xae7b[_0xc7679b];return _0x4e8f0b;};'use strict';var _=require(_0xbae7('0x0'));var util=require(_0xbae7('0x1'));var logger=require(_0xbae7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbae7('0x3'));var rp=require(_0xbae7('0x4'));var fs=require('fs');var path=require(_0xbae7('0x5'));var rimraf=require(_0xbae7('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbae7('0x7')]=function(_0xb625f6,_0x163147){return _0xb625f6['define'](_0xbae7('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index ebb5e90..1d05f0a 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 _0xebd3=['../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xebd3,0x90));var _0x3ebd=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0xebd3[_0x12e3e3];return _0x26602e;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var moment=require(_0x3ebd('0x2'));var BPromise=require(_0x3ebd('0x3'));var rs=require(_0x3ebd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ebd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ebd('0x6'))(_0x3ebd('0x7'));var config=require('../../config/environment');var jayson=require(_0x3ebd('0x8'));var client=jayson[_0x3ebd('0x9')][_0x3ebd('0xa')]({'port':0x232a});config[_0x3ebd('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ebd('0xc'))(new Redis(config[_0x3ebd('0xb')]));require(_0x3ebd('0xd'))['register'](socket);function respondWithRpcPromise(_0x47e3de,_0x310cd3,_0x3051ca){return new BPromise(function(_0x1863d,_0x48d6ae){return client[_0x3ebd('0xe')](_0x47e3de,_0x3051ca)[_0x3ebd('0xf')](function(_0x27f104){logger[_0x3ebd('0x10')](_0x3ebd('0x11'),_0x310cd3,_0x3ebd('0x12'));logger['debug'](_0x3ebd('0x13'),_0x310cd3,_0x3ebd('0x12'),JSON[_0x3ebd('0x14')](_0x27f104));if(_0x27f104[_0x3ebd('0x15')]){if(_0x27f104[_0x3ebd('0x15')][_0x3ebd('0x16')]===0x1f4){logger['error'](_0x3ebd('0x11'),_0x310cd3,_0x27f104[_0x3ebd('0x15')][_0x3ebd('0x17')]);return _0x48d6ae(_0x27f104[_0x3ebd('0x15')][_0x3ebd('0x17')]);}logger[_0x3ebd('0x15')](_0x3ebd('0x11'),_0x310cd3,_0x27f104[_0x3ebd('0x15')][_0x3ebd('0x17')]);return _0x1863d(_0x27f104[_0x3ebd('0x15')][_0x3ebd('0x17')]);}else{logger[_0x3ebd('0x10')]('CmList,\x20%s,\x20%s',_0x310cd3,_0x3ebd('0x12'));_0x1863d(_0x27f104[_0x3ebd('0x18')][_0x3ebd('0x17')]);}})['catch'](function(_0x137c5d){logger[_0x3ebd('0x15')]('CmList,\x20%s,\x20%s',_0x310cd3,_0x137c5d);_0x48d6ae(_0x137c5d);});});} \ No newline at end of file +var _0x77de=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x22499d,_0x3108f3){var _0x2d318d=function(_0x4bba60){while(--_0x4bba60){_0x22499d['push'](_0x22499d['shift']());}};_0x2d318d(++_0x3108f3);}(_0x77de,0x15c));var _0xe77d=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0x77de[_0x233cb1];return _0x29ee7e;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe77d('0x2'));var fs=require('fs');var Redis=require(_0xe77d('0x3'));var db=require(_0xe77d('0x4'))['db'];var utils=require(_0xe77d('0x5'));var logger=require('../../config/logger')(_0xe77d('0x6'));var config=require(_0xe77d('0x7'));var jayson=require(_0xe77d('0x8'));var client=jayson[_0xe77d('0x9')][_0xe77d('0xa')]({'port':0x232a});config[_0xe77d('0xb')]=_['defaults'](config[_0xe77d('0xb')],{'host':_0xe77d('0xc'),'port':0x18eb});var socket=require(_0xe77d('0xd'))(new Redis(config[_0xe77d('0xb')]));require('./cmList.socket')[_0xe77d('0xe')](socket);function respondWithRpcPromise(_0x2fca89,_0x59209d,_0x237235){return new BPromise(function(_0x2f0065,_0x3f6969){return client[_0xe77d('0xf')](_0x2fca89,_0x237235)[_0xe77d('0x10')](function(_0x3620af){logger[_0xe77d('0x11')](_0xe77d('0x12'),_0x59209d,_0xe77d('0x13'));logger[_0xe77d('0x14')](_0xe77d('0x15'),_0x59209d,_0xe77d('0x13'),JSON[_0xe77d('0x16')](_0x3620af));if(_0x3620af['error']){if(_0x3620af[_0xe77d('0x17')][_0xe77d('0x18')]===0x1f4){logger[_0xe77d('0x17')](_0xe77d('0x12'),_0x59209d,_0x3620af[_0xe77d('0x17')][_0xe77d('0x19')]);return _0x3f6969(_0x3620af[_0xe77d('0x17')]['message']);}logger['error'](_0xe77d('0x12'),_0x59209d,_0x3620af[_0xe77d('0x17')]['message']);return _0x2f0065(_0x3620af['error'][_0xe77d('0x19')]);}else{logger[_0xe77d('0x11')](_0xe77d('0x12'),_0x59209d,_0xe77d('0x13'));_0x2f0065(_0x3620af[_0xe77d('0x1a')][_0xe77d('0x19')]);}})[_0xe77d('0x1b')](function(_0x4f8667){logger['error'](_0xe77d('0x12'),_0x59209d,_0x4f8667);_0x3f6969(_0x4f8667);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4ce8105..09cbb6c 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 _0x4309=['save','remove','update','register','length','cmList:','./cmList.events'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x4309,0x133));var _0x9430=function(_0x1437e8,_0x556363){_0x1437e8=_0x1437e8-0x0;var _0x4b3e74=_0x4309[_0x1437e8];return _0x4b3e74;};'use strict';var CmListEvents=require(_0x9430('0x0'));var events=[_0x9430('0x1'),_0x9430('0x2'),_0x9430('0x3')];function createListener(_0x51a13b,_0x103619){return function(_0x3a7c05){_0x103619['emit'](_0x51a13b,_0x3a7c05);};}function removeListener(_0x4cd4c7,_0x159061){return function(){CmListEvents['removeListener'](_0x4cd4c7,_0x159061);};}exports[_0x9430('0x4')]=function(_0x28d9c3){for(var _0x42cffa=0x0,_0x1f9ec3=events[_0x9430('0x5')];_0x42cffa<_0x1f9ec3;_0x42cffa++){var _0x80d7fb=events[_0x42cffa];var _0x3906af=createListener(_0x9430('0x6')+_0x80d7fb,_0x28d9c3);CmListEvents['on'](_0x80d7fb,_0x3906af);}}; \ No newline at end of file +var _0x4cac=['length','cmList:','./cmList.events','save','remove','emit','removeListener','register'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4cac,0x16a));var _0xc4ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4cac[_0xa464c9];return _0x3d73c4;};'use strict';var CmListEvents=require(_0xc4ca('0x0'));var events=[_0xc4ca('0x1'),_0xc4ca('0x2'),'update'];function createListener(_0x3f027e,_0x2e4b05){return function(_0x4a9539){_0x2e4b05[_0xc4ca('0x3')](_0x3f027e,_0x4a9539);};}function removeListener(_0x4bc7b0,_0x19ea77){return function(){CmListEvents[_0xc4ca('0x4')](_0x4bc7b0,_0x19ea77);};}exports[_0xc4ca('0x5')]=function(_0x33fb80){for(var _0x46da94=0x0,_0x53c2e3=events[_0xc4ca('0x6')];_0x46da94<_0x53c2e3;_0x46da94++){var _0x5c4347=events[_0x46da94];var _0x2026cf=createListener(_0xc4ca('0x7')+_0x5c4347,_0x33fb80);CmListEvents['on'](_0x5c4347,_0x2026cf);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4df742f..8a0e333 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 _0x3bd5=['addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post'];(function(_0x3b8392,_0x417827){var _0x1bf877=function(_0x322ab3){while(--_0x322ab3){_0x3b8392['push'](_0x3b8392['shift']());}};_0x1bf877(++_0x417827);}(_0x3bd5,0x169));var _0x53bd=function(_0x46bbc9,_0x5cf6d2){_0x46bbc9=_0x46bbc9-0x0;var _0x3fd869=_0x3bd5[_0x46bbc9];return _0x3fd869;};'use strict';var multer=require(_0x53bd('0x0'));var util=require(_0x53bd('0x1'));var path=require(_0x53bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x53bd('0x3'));var router=express[_0x53bd('0x4')]();var auth=require(_0x53bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x53bd('0x6'));var controller=require('./cmList.controller');router[_0x53bd('0x7')]('/',auth[_0x53bd('0x8')](),controller[_0x53bd('0x9')]);router[_0x53bd('0x7')](_0x53bd('0xa'),auth[_0x53bd('0x8')](),controller[_0x53bd('0xb')]);router[_0x53bd('0x7')](_0x53bd('0xc'),auth[_0x53bd('0x8')](),controller['show']);router[_0x53bd('0x7')](_0x53bd('0xd'),auth['isAuthenticated'](),controller[_0x53bd('0xe')]);router[_0x53bd('0x7')](_0x53bd('0xf'),auth[_0x53bd('0x8')](),controller['getContacts']);router[_0x53bd('0x7')](_0x53bd('0x10'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x11')]);router['get'](_0x53bd('0x12'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x13')]);router['get'](_0x53bd('0x14'),auth['isAuthenticated'](),controller[_0x53bd('0x15')]);router['post']('/',auth[_0x53bd('0x8')](),controller['create']);router[_0x53bd('0x16')](_0x53bd('0xd'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x17')]);router[_0x53bd('0x16')](_0x53bd('0xf'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x18')]);router[_0x53bd('0x16')]('/:id/fields',auth[_0x53bd('0x8')](),controller['addCustomField']);router['post']('/:id/users',auth[_0x53bd('0x8')](),controller[_0x53bd('0x19')]);router[_0x53bd('0x1a')]('/:id',auth[_0x53bd('0x8')](),controller[_0x53bd('0x1b')]);router[_0x53bd('0x1c')](_0x53bd('0xc'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x1d')]);router['delete'](_0x53bd('0xd'),auth[_0x53bd('0x8')](),controller[_0x53bd('0x1e')]);router['delete']('/:id/users',auth[_0x53bd('0x8')](),controller['removeAgents']);module[_0x53bd('0x1f')]=router; \ No newline at end of file +var _0x81bf=['getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','create','post','/:id/fields','/:id/users','addAgents','put','/:id','update','destroy','delete','removeAgents','exports','multer','path','express','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','show','/:id/dispositions'];(function(_0x5b6bb5,_0x3172d0){var _0x225f23=function(_0x29bb26){while(--_0x29bb26){_0x5b6bb5['push'](_0x5b6bb5['shift']());}};_0x225f23(++_0x3172d0);}(_0x81bf,0x167));var _0xf81b=function(_0x3572e7,_0x10e97b){_0x3572e7=_0x3572e7-0x0;var _0x505b91=_0x81bf[_0x3572e7];return _0x505b91;};'use strict';var multer=require(_0xf81b('0x0'));var util=require('util');var path=require(_0xf81b('0x1'));var timeout=require('connect-timeout');var express=require(_0xf81b('0x2'));var router=express['Router']();var auth=require(_0xf81b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf81b('0x4'));var controller=require(_0xf81b('0x5'));router['get']('/',auth[_0xf81b('0x6')](),controller[_0xf81b('0x7')]);router['get'](_0xf81b('0x8'),auth[_0xf81b('0x6')](),controller[_0xf81b('0x9')]);router[_0xf81b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf81b('0xb')]);router[_0xf81b('0xa')](_0xf81b('0xc'),auth['isAuthenticated'](),controller[_0xf81b('0xd')]);router['get'](_0xf81b('0xe'),auth[_0xf81b('0x6')](),controller['getContacts']);router[_0xf81b('0xa')](_0xf81b('0xf'),auth[_0xf81b('0x6')](),controller[_0xf81b('0x10')]);router[_0xf81b('0xa')]('/:id/fields',auth[_0xf81b('0x6')](),controller[_0xf81b('0x11')]);router['get']('/:id/users',auth[_0xf81b('0x6')](),controller[_0xf81b('0x12')]);router['post']('/',auth[_0xf81b('0x6')](),controller[_0xf81b('0x13')]);router[_0xf81b('0x14')]('/:id/dispositions',auth[_0xf81b('0x6')](),controller['addDisposition']);router[_0xf81b('0x14')]('/:id/contacts',auth[_0xf81b('0x6')](),controller['addContacts']);router['post'](_0xf81b('0x15'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xf81b('0x14')](_0xf81b('0x16'),auth[_0xf81b('0x6')](),controller[_0xf81b('0x17')]);router[_0xf81b('0x18')](_0xf81b('0x19'),auth['isAuthenticated'](),controller[_0xf81b('0x1a')]);router['delete'](_0xf81b('0x19'),auth[_0xf81b('0x6')](),controller[_0xf81b('0x1b')]);router[_0xf81b('0x1c')](_0xf81b('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xf81b('0x16'),auth[_0xf81b('0x6')](),controller[_0xf81b('0x1d')]);module[_0xf81b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 028c7b1..ee78dd3 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 _0x4033=['sequelize','exports','getDataValue','STRING'];(function(_0x53c271,_0x30d5f9){var _0x3574bb=function(_0x4dc85a){while(--_0x4dc85a){_0x53c271['push'](_0x53c271['shift']());}};_0x3574bb(++_0x30d5f9);}(_0x4033,0x1b4));var _0x3403=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x4033[_0x4f3b2d];return _0x3dddfa;};'use strict';var Sequelize=require(_0x3403('0x0'));module[_0x3403('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b6164){return this[_0x3403('0x2')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x3403('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x3403('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x1cf5=['exports','VIRTUAL','field','STRING'];(function(_0x11d57a,_0x1e70ea){var _0x3e31fa=function(_0x36de12){while(--_0x36de12){_0x11d57a['push'](_0x11d57a['shift']());}};_0x3e31fa(++_0x1e70ea);}(_0x1cf5,0x78));var _0x51cf=function(_0x13361c,_0x445a72){_0x13361c=_0x13361c-0x0;var _0x5a8dd7=_0x1cf5[_0x13361c];return _0x5a8dd7;};'use strict';var Sequelize=require('sequelize');module[_0x51cf('0x0')]={'name':{'type':Sequelize[_0x51cf('0x1')],'get':function(_0x3d0a6b){return this['getDataValue'](_0x51cf('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x51cf('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x51cf('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 41a9810..0bf0b32 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 _0x4afe=['apply','reject','update','error','name','send','body','Condition','find','params','then','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4afe,0x1ba));var _0xe4af=function(_0x48ae79,_0x354a85){_0x48ae79=_0x48ae79-0x0;var _0xf42422=_0x4afe[_0x48ae79];return _0xf42422;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe4af('0x0'));var zipdir=require(_0xe4af('0x1'));var jsonpatch=require(_0xe4af('0x2'));var rp=require(_0xe4af('0x3'));var moment=require(_0xe4af('0x4'));var BPromise=require(_0xe4af('0x5'));var Mustache=require('mustache');var util=require(_0xe4af('0x6'));var path=require(_0xe4af('0x7'));var sox=require(_0xe4af('0x8'));var csv=require(_0xe4af('0x9'));var ejs=require(_0xe4af('0xa'));var fs=require('fs');var _=require(_0xe4af('0xb'));var squel=require(_0xe4af('0xc'));var crypto=require('crypto');var jsforce=require(_0xe4af('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe4af('0xe'));var Papa=require(_0xe4af('0xf'));var Redis=require('ioredis');var authService=require(_0xe4af('0x10'));var qs=require(_0xe4af('0x11'));var hardwareService=require(_0xe4af('0x12'));var logger=require('../../config/logger')(_0xe4af('0x13'));var utils=require('../../config/utils');var config=require(_0xe4af('0x14'));var db=require(_0xe4af('0x15'))['db'];function respondWithStatusCode(_0x3b2fe6,_0x37136d){_0x37136d=_0x37136d||0xcc;return function(_0xbf7e70){if(_0xbf7e70){return _0x3b2fe6[_0xe4af('0x16')](_0x37136d);}return _0x3b2fe6['status'](_0x37136d)[_0xe4af('0x17')]();};}function respondWithResult(_0x504dd8,_0x2e8d1d){_0x2e8d1d=_0x2e8d1d||0xc8;return function(_0x4d3b78){if(_0x4d3b78){return _0x504dd8[_0xe4af('0x18')](_0x2e8d1d)[_0xe4af('0x19')](_0x4d3b78);}};}function respondWithFilteredResult(_0x5e55e7,_0x20ea92){return function(_0x3e21d5){if(_0x3e21d5){var _0x12e53a=_0x3e21d5[_0xe4af('0x1a')],_0x52a0f8=_0x20ea92[_0xe4af('0x1b')],_0x208007=_0x20ea92[_0xe4af('0x1b')]+_0x20ea92[_0xe4af('0x1c')],_0x1044ba;if(_0x208007>=_0x12e53a){_0x208007=_0x12e53a;_0x1044ba=0xc8;}else{_0x1044ba=0xce;}_0x5e55e7[_0xe4af('0x18')](_0x1044ba);return _0x5e55e7[_0xe4af('0x1d')](_0xe4af('0x1e'),_0x52a0f8+'-'+_0x208007+'/'+_0x12e53a)[_0xe4af('0x19')](_0x3e21d5);}return null;};}function patchUpdates(_0x2ca78d){return function(_0x3ed4fd){try{jsonpatch[_0xe4af('0x1f')](_0x3ed4fd,_0x2ca78d,!![]);}catch(_0x4a963d){return BPromise[_0xe4af('0x20')](_0x4a963d);}return _0x3ed4fd['save']();};}function saveUpdates(_0x364b61,_0x1b5e2b){return function(_0x365239){if(_0x365239){return _0x365239[_0xe4af('0x21')](_0x364b61)['then'](function(_0x4eb392){return _0x4eb392;});}return null;};}function removeEntity(_0x17eff4,_0x4236af){return function(_0xb4e1cf){if(_0xb4e1cf){return _0xb4e1cf['destroy']()['then'](function(){_0x17eff4[_0xe4af('0x18')](0xcc)[_0xe4af('0x17')]();});}};}function handleEntityNotFound(_0x19115b,_0x2142e9){return function(_0x516873){if(!_0x516873){_0x19115b[_0xe4af('0x16')](0x194);}return _0x516873;};}function handleError(_0x4e1332,_0x4b1ec3){_0x4b1ec3=_0x4b1ec3||0x1f4;return function(_0x50e479){logger[_0xe4af('0x22')](_0x50e479['stack']);if(_0x50e479[_0xe4af('0x23')]){delete _0x50e479[_0xe4af('0x23')];}_0x4e1332[_0xe4af('0x18')](_0x4b1ec3)[_0xe4af('0x24')](_0x50e479);};}exports['update']=function(_0xa9a218,_0x5cebfe){if(_0xa9a218[_0xe4af('0x25')]['id']){delete _0xa9a218['body']['id'];}return db[_0xe4af('0x26')][_0xe4af('0x27')]({'where':{'id':_0xa9a218[_0xe4af('0x28')]['id']}})[_0xe4af('0x29')](handleEntityNotFound(_0x5cebfe,null))[_0xe4af('0x29')](saveUpdates(_0xa9a218[_0xe4af('0x25')],null))[_0xe4af('0x29')](respondWithResult(_0x5cebfe,null))[_0xe4af('0x2a')](handleError(_0x5cebfe,null));};exports['destroy']=function(_0x527cc2,_0x2e0c11){return db[_0xe4af('0x26')]['find']({'where':{'id':_0x527cc2[_0xe4af('0x28')]['id']}})[_0xe4af('0x29')](handleEntityNotFound(_0x2e0c11,null))['then'](removeEntity(_0x2e0c11,null))[_0xe4af('0x2a')](handleError(_0x2e0c11,null));}; \ No newline at end of file +var _0xf901=['limit','reject','save','then','error','name','send','update','find','params','body','catch','destroy','Condition','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset'];(function(_0x46b804,_0x3334c6){var _0x107c08=function(_0x27b18f){while(--_0x27b18f){_0x46b804['push'](_0x46b804['shift']());}};_0x107c08(++_0x3334c6);}(_0xf901,0x19a));var _0x1f90=function(_0x3ac62f,_0x39e588){_0x3ac62f=_0x3ac62f-0x0;var _0x3743de=_0xf901[_0x3ac62f];return _0x3743de;};'use strict';var pdf=require(_0x1f90('0x0'));var emlformat=require(_0x1f90('0x1'));var rimraf=require(_0x1f90('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f90('0x3'));var rp=require(_0x1f90('0x4'));var moment=require('moment');var BPromise=require(_0x1f90('0x5'));var Mustache=require(_0x1f90('0x6'));var util=require(_0x1f90('0x7'));var path=require(_0x1f90('0x8'));var sox=require(_0x1f90('0x9'));var csv=require(_0x1f90('0xa'));var ejs=require(_0x1f90('0xb'));var fs=require('fs');var _=require(_0x1f90('0xc'));var squel=require(_0x1f90('0xd'));var crypto=require(_0x1f90('0xe'));var jsforce=require(_0x1f90('0xf'));var deskjs=require(_0x1f90('0x10'));var toCsv=require(_0x1f90('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f90('0x11'));var authService=require(_0x1f90('0x12'));var qs=require(_0x1f90('0x13'));var hardwareService=require(_0x1f90('0x14'));var logger=require(_0x1f90('0x15'))('api');var utils=require(_0x1f90('0x16'));var config=require(_0x1f90('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e419e,_0x3bed55){_0x3bed55=_0x3bed55||0xcc;return function(_0x3ea114){if(_0x3ea114){return _0x4e419e[_0x1f90('0x18')](_0x3bed55);}return _0x4e419e[_0x1f90('0x19')](_0x3bed55)[_0x1f90('0x1a')]();};}function respondWithResult(_0x5951f9,_0xc868f5){_0xc868f5=_0xc868f5||0xc8;return function(_0x16d955){if(_0x16d955){return _0x5951f9[_0x1f90('0x19')](_0xc868f5)[_0x1f90('0x1b')](_0x16d955);}};}function respondWithFilteredResult(_0x21ff1a,_0xc5b85f){return function(_0x9b3e8d){if(_0x9b3e8d){var _0x303f6f=_0x9b3e8d[_0x1f90('0x1c')],_0x494638=_0xc5b85f[_0x1f90('0x1d')],_0x310370=_0xc5b85f[_0x1f90('0x1d')]+_0xc5b85f[_0x1f90('0x1e')],_0x807f9a;if(_0x310370>=_0x303f6f){_0x310370=_0x303f6f;_0x807f9a=0xc8;}else{_0x807f9a=0xce;}_0x21ff1a['status'](_0x807f9a);return _0x21ff1a['set']('Content-Range',_0x494638+'-'+_0x310370+'/'+_0x303f6f)[_0x1f90('0x1b')](_0x9b3e8d);}return null;};}function patchUpdates(_0x5805c6){return function(_0x21d7fc){try{jsonpatch['apply'](_0x21d7fc,_0x5805c6,!![]);}catch(_0x30f4e3){return BPromise[_0x1f90('0x1f')](_0x30f4e3);}return _0x21d7fc[_0x1f90('0x20')]();};}function saveUpdates(_0x21bdd0,_0x81aa7c){return function(_0x19536f){if(_0x19536f){return _0x19536f['update'](_0x21bdd0)[_0x1f90('0x21')](function(_0x5b3b03){return _0x5b3b03;});}return null;};}function removeEntity(_0x39b069,_0x4bd29e){return function(_0x130a18){if(_0x130a18){return _0x130a18['destroy']()[_0x1f90('0x21')](function(){_0x39b069[_0x1f90('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4df4,_0x41a73c){return function(_0x244a9d){if(!_0x244a9d){_0x2a4df4['sendStatus'](0x194);}return _0x244a9d;};}function handleError(_0x4a824b,_0x571a16){_0x571a16=_0x571a16||0x1f4;return function(_0x2ef9a0){logger[_0x1f90('0x22')](_0x2ef9a0['stack']);if(_0x2ef9a0[_0x1f90('0x23')]){delete _0x2ef9a0[_0x1f90('0x23')];}_0x4a824b['status'](_0x571a16)[_0x1f90('0x24')](_0x2ef9a0);};}exports[_0x1f90('0x25')]=function(_0x30a3aa,_0x4bcfa0){if(_0x30a3aa['body']['id']){delete _0x30a3aa['body']['id'];}return db['Condition'][_0x1f90('0x26')]({'where':{'id':_0x30a3aa[_0x1f90('0x27')]['id']}})[_0x1f90('0x21')](handleEntityNotFound(_0x4bcfa0,null))[_0x1f90('0x21')](saveUpdates(_0x30a3aa[_0x1f90('0x28')],null))['then'](respondWithResult(_0x4bcfa0,null))[_0x1f90('0x29')](handleError(_0x4bcfa0,null));};exports[_0x1f90('0x2a')]=function(_0xbb828f,_0x1d4b02){return db[_0x1f90('0x2b')][_0x1f90('0x26')]({'where':{'id':_0xbb828f[_0x1f90('0x27')]['id']}})[_0x1f90('0x21')](handleEntityNotFound(_0x1d4b02,null))[_0x1f90('0x21')](removeEntity(_0x1d4b02,null))[_0x1f90('0x29')](handleError(_0x1d4b02,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4eefd13..4f5d93c 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 _0x30f8=['Condition','util','api','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x443a1e,_0x29a802){var _0x5753e0=function(_0x2c752a){while(--_0x2c752a){_0x443a1e['push'](_0x443a1e['shift']());}};_0x5753e0(++_0x29a802);}(_0x30f8,0x139));var _0x830f=function(_0x322af8,_0x161b9c){_0x322af8=_0x322af8-0x0;var _0xeb3c38=_0x30f8[_0x322af8];return _0xeb3c38;};'use strict';var _=require('lodash');var util=require(_0x830f('0x0'));var logger=require('../../config/logger')(_0x830f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x830f('0x2'));var rimraf=require(_0x830f('0x3'));var config=require(_0x830f('0x4'));var attributes=require(_0x830f('0x5'));module[_0x830f('0x6')]=function(_0x14c2ce,_0x2b09a2){return _0x14c2ce['define'](_0x830f('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97bf=['path','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','../../config/logger','api'];(function(_0x500bd9,_0xd17362){var _0x49c713=function(_0x3bcba1){while(--_0x3bcba1){_0x500bd9['push'](_0x500bd9['shift']());}};_0x49c713(++_0xd17362);}(_0x97bf,0x178));var _0xf97b=function(_0x26a4a1,_0x40e9d){_0x26a4a1=_0x26a4a1-0x0;var _0x2310a3=_0x97bf[_0x26a4a1];return _0x2310a3;};'use strict';var _=require(_0xf97b('0x0'));var util=require(_0xf97b('0x1'));var logger=require(_0xf97b('0x2'))(_0xf97b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf97b('0x4'));var rimraf=require(_0xf97b('0x5'));var config=require(_0xf97b('0x6'));var attributes=require(_0xf97b('0x7'));module['exports']=function(_0x3872ae,_0x36db3d){return _0x3872ae['define'](_0xf97b('0x8'),attributes,{'tableName':_0xf97b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 4c87a46..0a5244b 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 _0x00cf=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x520c00,_0x486155){var _0x3eccd0=function(_0x342e2d){while(--_0x342e2d){_0x520c00['push'](_0x520c00['shift']());}};_0x3eccd0(++_0x486155);}(_0x00cf,0xfb));var _0xf00c=function(_0x269175,_0x14b8bb){_0x269175=_0x269175-0x0;var _0x44f717=_0x00cf[_0x269175];return _0x44f717;};'use strict';var _=require('lodash');var util=require(_0xf00c('0x0'));var moment=require(_0xf00c('0x1'));var BPromise=require(_0xf00c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf00c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf00c('0x4'));var logger=require(_0xf00c('0x5'))(_0xf00c('0x6'));var config=require(_0xf00c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf00c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12a107,_0xc379a9,_0x567e69){return new BPromise(function(_0x4e1b7a,_0x55aa10){return client[_0xf00c('0x9')](_0x12a107,_0x567e69)['then'](function(_0x4fdde5){logger[_0xf00c('0xa')](_0xf00c('0xb'),_0xc379a9,_0xf00c('0xc'));logger[_0xf00c('0xd')](_0xf00c('0xe'),_0xc379a9,_0xf00c('0xc'),JSON[_0xf00c('0xf')](_0x4fdde5));if(_0x4fdde5[_0xf00c('0x10')]){if(_0x4fdde5[_0xf00c('0x10')][_0xf00c('0x11')]===0x1f4){logger['error'](_0xf00c('0xb'),_0xc379a9,_0x4fdde5[_0xf00c('0x10')][_0xf00c('0x12')]);return _0x55aa10(_0x4fdde5[_0xf00c('0x10')]['message']);}logger[_0xf00c('0x10')](_0xf00c('0xb'),_0xc379a9,_0x4fdde5[_0xf00c('0x10')][_0xf00c('0x12')]);return _0x4e1b7a(_0x4fdde5[_0xf00c('0x10')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0xc379a9,_0xf00c('0xc'));_0x4e1b7a(_0x4fdde5[_0xf00c('0x13')][_0xf00c('0x12')]);}})[_0xf00c('0x14')](function(_0x262c18){logger[_0xf00c('0x10')](_0xf00c('0xb'),_0xc379a9,_0x262c18);_0x55aa10(_0x262c18);});});} \ No newline at end of file +var _0x8478=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3398ae,_0x4370bf){var _0x59002f=function(_0x4de327){while(--_0x4de327){_0x3398ae['push'](_0x3398ae['shift']());}};_0x59002f(++_0x4370bf);}(_0x8478,0xdf));var _0x8847=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8478[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x8847('0x0'));var util=require(_0x8847('0x1'));var moment=require(_0x8847('0x2'));var BPromise=require(_0x8847('0x3'));var rs=require(_0x8847('0x4'));var fs=require('fs');var Redis=require(_0x8847('0x5'));var db=require(_0x8847('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8847('0x7'))(_0x8847('0x8'));var config=require(_0x8847('0x9'));var jayson=require(_0x8847('0xa'));var client=jayson['client'][_0x8847('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x172b68,_0x5b0d66,_0x1bc269){return new BPromise(function(_0x2115fe,_0x458067){return client[_0x8847('0xc')](_0x172b68,_0x1bc269)['then'](function(_0x3fcff4){logger[_0x8847('0xd')](_0x8847('0xe'),_0x5b0d66,_0x8847('0xf'));logger[_0x8847('0x10')](_0x8847('0x11'),_0x5b0d66,_0x8847('0xf'),JSON[_0x8847('0x12')](_0x3fcff4));if(_0x3fcff4['error']){if(_0x3fcff4[_0x8847('0x13')][_0x8847('0x14')]===0x1f4){logger[_0x8847('0x13')]('Condition,\x20%s,\x20%s',_0x5b0d66,_0x3fcff4[_0x8847('0x13')][_0x8847('0x15')]);return _0x458067(_0x3fcff4[_0x8847('0x13')][_0x8847('0x15')]);}logger['error'](_0x8847('0xe'),_0x5b0d66,_0x3fcff4[_0x8847('0x13')][_0x8847('0x15')]);return _0x2115fe(_0x3fcff4['error'][_0x8847('0x15')]);}else{logger[_0x8847('0xd')]('Condition,\x20%s,\x20%s',_0x5b0d66,_0x8847('0xf'));_0x2115fe(_0x3fcff4[_0x8847('0x16')]['message']);}})[_0x8847('0x17')](function(_0x18f1e1){logger[_0x8847('0x13')](_0x8847('0xe'),_0x5b0d66,_0x18f1e1);_0x458067(_0x18f1e1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6d735bd..fc71077 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 _0x461e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x461e,0x18d));var _0xe461=function(_0x3f7fdf,_0x5e37d9){_0x3f7fdf=_0x3f7fdf-0x0;var _0x5a75dd=_0x461e[_0x3f7fdf];return _0x5a75dd;};'use strict';var multer=require(_0xe461('0x0'));var util=require(_0xe461('0x1'));var path=require(_0xe461('0x2'));var timeout=require(_0xe461('0x3'));var express=require(_0xe461('0x4'));var router=express[_0xe461('0x5')]();var auth=require(_0xe461('0x6'));var interaction=require(_0xe461('0x7'));var config=require(_0xe461('0x8'));var controller=require(_0xe461('0x9'));router[_0xe461('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe461('0xb')]);router[_0xe461('0xc')]('/:id',auth[_0xe461('0xd')](),controller[_0xe461('0xe')]);module[_0xe461('0xf')]=router; \ No newline at end of file +var _0xc7d0=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports'];(function(_0x4f1c1f,_0x2070c1){var _0x37da61=function(_0x54d880){while(--_0x54d880){_0x4f1c1f['push'](_0x4f1c1f['shift']());}};_0x37da61(++_0x2070c1);}(_0xc7d0,0x1b3));var _0x0c7d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc7d0[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x0c7d('0x0'));var util=require(_0x0c7d('0x1'));var path=require(_0x0c7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c7d('0x3')]();var auth=require(_0x0c7d('0x4'));var interaction=require(_0x0c7d('0x5'));var config=require(_0x0c7d('0x6'));var controller=require(_0x0c7d('0x7'));router[_0x0c7d('0x8')]('/:id',auth[_0x0c7d('0x9')](),controller[_0x0c7d('0xa')]);router[_0x0c7d('0xb')](_0x0c7d('0xc'),auth[_0x0c7d('0x9')](),controller[_0x0c7d('0xd')]);module[_0x0c7d('0xe')]=router; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.attributes.js b/server/api/crmActionsList/crmActionsList.attributes.js index 26595e6..6a6e910 100644 --- a/server/api/crmActionsList/crmActionsList.attributes.js +++ b/server/api/crmActionsList/crmActionsList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dd0=['TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','sequelize','exports','STRING'];(function(_0x4b040a,_0x31f24d){var _0x286a31=function(_0x588f47){while(--_0x588f47){_0x4b040a['push'](_0x4b040a['shift']());}};_0x286a31(++_0x31f24d);}(_0x1dd0,0x123));var _0x01dd=function(_0x6542f1,_0x37f42a){_0x6542f1=_0x6542f1-0x0;var _0x503e30=_0x1dd0[_0x6542f1];return _0x503e30;};'use strict';var Sequelize=require(_0x01dd('0x0'));module[_0x01dd('0x1')]={'name':{'type':Sequelize[_0x01dd('0x2')],'allowNull':![],'unique':'name'},'note':{'type':Sequelize[_0x01dd('0x3')]('long')+_0x01dd('0x4')},'ordersequence':{'type':Sequelize[_0x01dd('0x5')],'allowNull':!![]},'action':{'type':Sequelize[_0x01dd('0x2')]},'parameters':{'type':Sequelize[_0x01dd('0x2')]}}; \ No newline at end of file +var _0xd61c=['name','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd61c,0x18d));var _0xcd61=function(_0x5dc032,_0x429be1){_0x5dc032=_0x5dc032-0x0;var _0x2a8571=_0xd61c[_0x5dc032];return _0x2a8571;};'use strict';var Sequelize=require(_0xcd61('0x0'));module[_0xcd61('0x1')]={'name':{'type':Sequelize[_0xcd61('0x2')],'allowNull':![],'unique':_0xcd61('0x3')},'note':{'type':Sequelize[_0xcd61('0x4')](_0xcd61('0x5'))+_0xcd61('0x6')},'ordersequence':{'type':Sequelize[_0xcd61('0x7')],'allowNull':!![]},'action':{'type':Sequelize[_0xcd61('0x2')]},'parameters':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.controller.js b/server/api/crmActionsList/crmActionsList.controller.js index 01580fb..bd214e4 100644 --- a/server/api/crmActionsList/crmActionsList.controller.js +++ b/server/api/crmActionsList/crmActionsList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','map','type','key','field','filter','options','CrmActionsList','count','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x1ecae9,_0x3d5fb9){var _0x5518e1=function(_0x1fcef5){while(--_0x1fcef5){_0x1ecae9['push'](_0x1ecae9['shift']());}};_0x5518e1(++_0x3d5fb9);}(_0x54ef,0x112));var _0xf54e=function(_0x527be5,_0x41b763){_0x527be5=_0x527be5-0x0;var _0x191cc6=_0x54ef[_0x527be5];return _0x191cc6;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];function respondWithStatusCode(_0x553759,_0x358c88){_0x358c88=_0x358c88||0xcc;return function(_0x4b0ee1){if(_0x4b0ee1){return _0x553759['sendStatus'](_0x358c88);}return _0x553759[_0xf54e('0x18')](_0x358c88)[_0xf54e('0x19')]();};}function respondWithResult(_0x28f776,_0x380f26){_0x380f26=_0x380f26||0xc8;return function(_0x5644aa){if(_0x5644aa){return _0x28f776[_0xf54e('0x18')](_0x380f26)[_0xf54e('0x1a')](_0x5644aa);}};}function respondWithFilteredResult(_0x1855fe,_0x15f639){return function(_0x56828e){if(_0x56828e){var _0x2366ee=_0x56828e['count'],_0x389abc=_0x15f639[_0xf54e('0x1b')],_0x3eb415=_0x15f639[_0xf54e('0x1b')]+_0x15f639[_0xf54e('0x1c')],_0x5c5d00;if(_0x3eb415>=_0x2366ee){_0x3eb415=_0x2366ee;_0x5c5d00=0xc8;}else{_0x5c5d00=0xce;}_0x1855fe[_0xf54e('0x18')](_0x5c5d00);return _0x1855fe[_0xf54e('0x1d')](_0xf54e('0x1e'),_0x389abc+'-'+_0x3eb415+'/'+_0x2366ee)[_0xf54e('0x1a')](_0x56828e);}return null;};}function patchUpdates(_0x1ef06e){return function(_0x1dcc04){try{jsonpatch[_0xf54e('0x1f')](_0x1dcc04,_0x1ef06e,!![]);}catch(_0x226c96){return BPromise['reject'](_0x226c96);}return _0x1dcc04['save']();};}function saveUpdates(_0x23e14,_0x59f338){return function(_0x3e1556){if(_0x3e1556){return _0x3e1556[_0xf54e('0x20')](_0x23e14)[_0xf54e('0x21')](function(_0x9903fc){return _0x9903fc;});}return null;};}function removeEntity(_0xf64f12,_0x3887b0){return function(_0x388aa0){if(_0x388aa0){return _0x388aa0[_0xf54e('0x22')]()[_0xf54e('0x21')](function(){_0xf64f12[_0xf54e('0x18')](0xcc)[_0xf54e('0x19')]();});}};}function handleEntityNotFound(_0x5b83df,_0x6f6d29){return function(_0x54f914){if(!_0x54f914){_0x5b83df[_0xf54e('0x23')](0x194);}return _0x54f914;};}function handleError(_0x272df6,_0x335492){_0x335492=_0x335492||0x1f4;return function(_0x474b61){logger[_0xf54e('0x24')](_0x474b61[_0xf54e('0x25')]);if(_0x474b61[_0xf54e('0x26')]){delete _0x474b61[_0xf54e('0x26')];}_0x272df6[_0xf54e('0x18')](_0x335492)[_0xf54e('0x27')](_0x474b61);};}exports[_0xf54e('0x28')]=function(_0x39c0ae,_0x2ea001){var _0x5390b8={},_0xb3706e={},_0x4cbf7c={'count':0x0,'rows':[]};var _0x282c63=db['CrmActionsList'][_0xf54e('0x29')];_0xb3706e[_0xf54e('0x2a')]=_[_0xf54e('0x2b')](_0x282c63);_0xb3706e[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x39c0ae[_0xf54e('0x2c')]);_0xb3706e[_0xf54e('0x2d')]=_['intersection'](_0xb3706e['model'],_0xb3706e[_0xf54e('0x2c')]);_0x5390b8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0xb3706e[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x5390b8[_0xf54e('0x2e')]=_0x5390b8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x5390b8['attributes']:_0xb3706e['model'];if(!_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x32')]('nolimit')){_0x5390b8[_0xf54e('0x1c')]=qs[_0xf54e('0x1c')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x1c')]);_0x5390b8['offset']=qs['offset'](_0x39c0ae['query'][_0xf54e('0x1b')]);}_0x5390b8[_0xf54e('0x33')]=qs[_0xf54e('0x34')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x34')]);_0x5390b8[_0xf54e('0x35')]=qs['filters'](_['pick'](_0x39c0ae['query'],_0xb3706e[_0xf54e('0x2d')]));if(_0x39c0ae[_0xf54e('0x2c')]['filter']){_0x5390b8['where']=_[_0xf54e('0x36')](_0x5390b8[_0xf54e('0x35')],{'$or':_[_0xf54e('0x37')](_0x282c63,function(_0x4a347a){if(_0x4a347a[_0xf54e('0x38')][_0xf54e('0x39')]!=='VIRTUAL'){var _0x38d7a0={};_0x38d7a0[_0x4a347a[_0xf54e('0x3a')]]={'$like':'%'+_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3b')]+'%'};return _0x38d7a0;}})});}_0x5390b8=_[_0xf54e('0x36')]({},_0x5390b8,_0x39c0ae[_0xf54e('0x3c')]);var _0x4e00b7={'where':_0x5390b8['where']};return db[_0xf54e('0x3d')][_0xf54e('0x3e')](_0x4e00b7)[_0xf54e('0x21')](function(_0x4b1f84){_0x4cbf7c[_0xf54e('0x3e')]=_0x4b1f84;if(_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x5390b8[_0xf54e('0x40')]=[{'all':!![]}];}return db[_0xf54e('0x3d')][_0xf54e('0x41')](_0x5390b8);})[_0xf54e('0x21')](function(_0x1345b0){_0x4cbf7c[_0xf54e('0x42')]=_0x1345b0;return _0x4cbf7c;})[_0xf54e('0x21')](respondWithFilteredResult(_0x2ea001,_0x5390b8))[_0xf54e('0x43')](handleError(_0x2ea001,null));};exports[_0xf54e('0x44')]=function(_0x3dfd4e,_0x2625fd){var _0x2043a8={'raw':![],'where':{'id':_0x3dfd4e['params']['id']}},_0x5085c1={};_0x5085c1['model']=_[_0xf54e('0x2b')](db[_0xf54e('0x3d')]['rawAttributes']);_0x5085c1[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x3dfd4e[_0xf54e('0x2c')]);_0x5085c1['filters']=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],_0x5085c1[_0xf54e('0x2c')]);_0x2043a8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x2043a8['attributes']=_0x2043a8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x2043a8[_0xf54e('0x2e')]:_0x5085c1[_0xf54e('0x2a')];if(_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x2043a8['include']=[{'all':!![]}];}_0x2043a8=_[_0xf54e('0x36')]({},_0x2043a8,_0x3dfd4e['options']);return db[_0xf54e('0x3d')]['find'](_0x2043a8)[_0xf54e('0x21')](handleEntityNotFound(_0x2625fd,null))[_0xf54e('0x21')](respondWithResult(_0x2625fd,null))[_0xf54e('0x43')](handleError(_0x2625fd,null));};exports['create']=function(_0x1af35d,_0x40b21c){return db[_0xf54e('0x3d')][_0xf54e('0x45')](_0x1af35d[_0xf54e('0x46')],{})['then'](respondWithResult(_0x40b21c,0xc9))[_0xf54e('0x43')](handleError(_0x40b21c,null));};exports[_0xf54e('0x20')]=function(_0x346bb4,_0x45592b){if(_0x346bb4['body']['id']){delete _0x346bb4[_0xf54e('0x46')]['id'];}return db[_0xf54e('0x3d')]['find']({'where':{'id':_0x346bb4[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x45592b,null))[_0xf54e('0x21')](saveUpdates(_0x346bb4[_0xf54e('0x46')],null))['then'](respondWithResult(_0x45592b,null))[_0xf54e('0x43')](handleError(_0x45592b,null));};exports[_0xf54e('0x22')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x3d')][_0xf54e('0x48')]({'where':{'id':_0x2527f6[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xb4654f,null))[_0xf54e('0x21')](removeEntity(_0xb4654f,null))[_0xf54e('0x43')](handleError(_0xb4654f,null));};exports[_0xf54e('0x49')]=function(_0x1f4cf8,_0x2deb0c){return db[_0xf54e('0x3d')][_0xf54e('0x49')]()[_0xf54e('0x21')](respondWithResult(_0x2deb0c,null))[_0xf54e('0x43')](handleError(_0x2deb0c,null));}; \ No newline at end of file +var _0x008c=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','CrmActionsList','rawAttributes','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x008c,0x188));var _0xc008=function(_0x4b8ecc,_0x4cd01c){_0x4b8ecc=_0x4b8ecc-0x0;var _0x48c1b9=_0x008c[_0x4b8ecc];return _0x48c1b9;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['keys'](_0x4caaf4);_0x4fce9c[_0xc008('0x25')]=_[_0xc008('0x26')](_0x2e31c2[_0xc008('0x25')]);_0x4fce9c[_0xc008('0x27')]=_['intersection'](_0x4fce9c[_0xc008('0x24')],_0x4fce9c[_0xc008('0x25')]);_0x5e2aca['attributes']=_['intersection'](_0x4fce9c['model'],qs[_0xc008('0x28')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x28')]));_0x5e2aca[_0xc008('0x29')]=_0x5e2aca[_0xc008('0x29')][_0xc008('0x2a')]?_0x5e2aca[_0xc008('0x29')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x25')][_0xc008('0x2b')](_0xc008('0x2c'))){_0x5e2aca[_0xc008('0x2d')]=qs['limit'](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2d')]);_0x5e2aca['offset']=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2f')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2f')]);_0x5e2aca[_0xc008('0x30')]=qs[_0xc008('0x27')](_['pick'](_0x2e31c2[_0xc008('0x25')],_0x4fce9c[_0xc008('0x27')]));if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]){_0x5e2aca[_0xc008('0x30')]=_[_0xc008('0x32')](_0x5e2aca[_0xc008('0x30')],{'$or':_['map'](_0x4caaf4,function(_0x35f360){if(_0x35f360[_0xc008('0x33')]['key']!==_0xc008('0x34')){var _0x15453c={};_0x15453c[_0x35f360['field']]={'$like':'%'+_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]+'%'};return _0x15453c;}})});}_0x5e2aca=_[_0xc008('0x32')]({},_0x5e2aca,_0x2e31c2['options']);var _0x53b353={'where':_0x5e2aca['where']};return db[_0xc008('0x22')]['count'](_0x53b353)[_0xc008('0x1d')](function(_0x3884dd){_0x4adbab[_0xc008('0x19')]=_0x3884dd;if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x35')]){_0x5e2aca[_0xc008('0x36')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x37')](_0x5e2aca);})[_0xc008('0x1d')](function(_0x387dfd){_0x4adbab[_0xc008('0x38')]=_0x387dfd;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))[_0xc008('0x39')](handleError(_0x5bebd9,null));};exports[_0xc008('0x3a')]=function(_0x4cace5,_0x3238b4){var _0x23c4db={'raw':![],'where':{'id':_0x4cace5[_0xc008('0x3b')]['id']}},_0x30b7df={};_0x30b7df['model']=_[_0xc008('0x26')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x30b7df[_0xc008('0x25')]=_[_0xc008('0x26')](_0x4cace5['query']);_0x30b7df[_0xc008('0x27')]=_[_0xc008('0x3c')](_0x30b7df[_0xc008('0x24')],_0x30b7df[_0xc008('0x25')]);_0x23c4db[_0xc008('0x29')]=_['intersection'](_0x30b7df[_0xc008('0x24')],qs[_0xc008('0x28')](_0x4cace5[_0xc008('0x25')][_0xc008('0x28')]));_0x23c4db['attributes']=_0x23c4db[_0xc008('0x29')][_0xc008('0x2a')]?_0x23c4db[_0xc008('0x29')]:_0x30b7df['model'];if(_0x4cace5[_0xc008('0x25')]['includeAll']){_0x23c4db[_0xc008('0x36')]=[{'all':!![]}];}_0x23c4db=_['merge']({},_0x23c4db,_0x4cace5[_0xc008('0x3d')]);return db[_0xc008('0x22')]['find'](_0x23c4db)[_0xc008('0x1d')](handleEntityNotFound(_0x3238b4,null))[_0xc008('0x1d')](respondWithResult(_0x3238b4,null))[_0xc008('0x39')](handleError(_0x3238b4,null));};exports['create']=function(_0x1cec64,_0x2a9b5c){return db[_0xc008('0x22')][_0xc008('0x3e')](_0x1cec64[_0xc008('0x3f')],{})[_0xc008('0x1d')](respondWithResult(_0x2a9b5c,0xc9))['catch'](handleError(_0x2a9b5c,null));};exports['update']=function(_0x5283a8,_0x4552ed){if(_0x5283a8[_0xc008('0x3f')]['id']){delete _0x5283a8[_0xc008('0x3f')]['id'];}return db[_0xc008('0x22')][_0xc008('0x40')]({'where':{'id':_0x5283a8[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x4552ed,null))[_0xc008('0x1d')](saveUpdates(_0x5283a8['body'],null))['then'](respondWithResult(_0x4552ed,null))['catch'](handleError(_0x4552ed,null));};exports[_0xc008('0x1c')]=function(_0x2651cf,_0x158eae){return db['CrmActionsList'][_0xc008('0x40')]({'where':{'id':_0x2651cf[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x1d')](removeEntity(_0x158eae,null))[_0xc008('0x39')](handleError(_0x158eae,null));};exports[_0xc008('0x41')]=function(_0x17ec90,_0x405e87){return db[_0xc008('0x22')][_0xc008('0x41')]()['then'](respondWithResult(_0x405e87,null))['catch'](handleError(_0x405e87,null));}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.model.js b/server/api/crmActionsList/crmActionsList.model.js index 2c2427c..6ba87a6 100644 --- a/server/api/crmActionsList/crmActionsList.model.js +++ b/server/api/crmActionsList/crmActionsList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab20=['exports','define','crm_actions_lists','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x28fdee,_0x3e8c43){var _0x36b9b1=function(_0xce67e4){while(--_0xce67e4){_0x28fdee['push'](_0x28fdee['shift']());}};_0x36b9b1(++_0x3e8c43);}(_0xab20,0x150));var _0x0ab2=function(_0x577a8f,_0x1d0c82){_0x577a8f=_0x577a8f-0x0;var _0x27db0c=_0xab20[_0x577a8f];return _0x27db0c;};'use strict';var _=require('lodash');var util=require(_0x0ab2('0x0'));var logger=require('../../config/logger')(_0x0ab2('0x1'));var moment=require(_0x0ab2('0x2'));var BPromise=require(_0x0ab2('0x3'));var rp=require(_0x0ab2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ab2('0x5'));var config=require('../../config/environment');var attributes=require('./crmActionsList.attributes');module[_0x0ab2('0x6')]=function(_0x5134dd,_0x51735a){return _0x5134dd[_0x0ab2('0x7')]('CrmActionsList',attributes,{'tableName':_0x0ab2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb83a=['util','api','moment','bluebird','path','rimraf','exports','CrmActionsList','lodash'];(function(_0x3d3d6e,_0x350807){var _0x4d01ac=function(_0x46fbec){while(--_0x46fbec){_0x3d3d6e['push'](_0x3d3d6e['shift']());}};_0x4d01ac(++_0x350807);}(_0xb83a,0xaa));var _0xab83=function(_0x16b4c8,_0x2432b9){_0x16b4c8=_0x16b4c8-0x0;var _0x7d84d8=_0xb83a[_0x16b4c8];return _0x7d84d8;};'use strict';var _=require(_0xab83('0x0'));var util=require(_0xab83('0x1'));var logger=require('../../config/logger')(_0xab83('0x2'));var moment=require(_0xab83('0x3'));var BPromise=require(_0xab83('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab83('0x5'));var rimraf=require(_0xab83('0x6'));var config=require('../../config/environment');var attributes=require('./crmActionsList.attributes');module[_0xab83('0x7')]=function(_0x5e1881,_0x18a17b){return _0x5e1881['define'](_0xab83('0x8'),attributes,{'tableName':'crm_actions_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.rpc.js b/server/api/crmActionsList/crmActionsList.rpc.js index 0de617a..fdc37b7 100644 --- a/server/api/crmActionsList/crmActionsList.rpc.js +++ b/server/api/crmActionsList/crmActionsList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e54=['stringify','error','code','CrmActionsList,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent'];(function(_0xeb6468,_0x4d14dc){var _0x2ad0fe=function(_0x731422){while(--_0x731422){_0xeb6468['push'](_0xeb6468['shift']());}};_0x2ad0fe(++_0x4d14dc);}(_0x8e54,0x110));var _0x48e5=function(_0x18646b,_0x54eced){_0x18646b=_0x18646b-0x0;var _0x595eaa=_0x8e54[_0x18646b];return _0x595eaa;};'use strict';var _=require('lodash');var util=require(_0x48e5('0x0'));var moment=require(_0x48e5('0x1'));var BPromise=require('bluebird');var rs=require(_0x48e5('0x2'));var fs=require('fs');var Redis=require(_0x48e5('0x3'));var db=require(_0x48e5('0x4'))['db'];var utils=require(_0x48e5('0x5'));var logger=require(_0x48e5('0x6'))('rpc');var config=require(_0x48e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x48e5('0x8')][_0x48e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49ad0c,_0x5be489,_0x25f673){return new BPromise(function(_0x5a9cf7,_0x5372a3){return client[_0x48e5('0xa')](_0x49ad0c,_0x25f673)['then'](function(_0x27bfa0){logger[_0x48e5('0xb')]('CrmActionsList,\x20%s,\x20%s',_0x5be489,_0x48e5('0xc'));logger['debug']('CrmActionsList,\x20%s,\x20%s,\x20%s',_0x5be489,_0x48e5('0xc'),JSON[_0x48e5('0xd')](_0x27bfa0));if(_0x27bfa0[_0x48e5('0xe')]){if(_0x27bfa0[_0x48e5('0xe')][_0x48e5('0xf')]===0x1f4){logger['error'](_0x48e5('0x10'),_0x5be489,_0x27bfa0['error'][_0x48e5('0x11')]);return _0x5372a3(_0x27bfa0[_0x48e5('0xe')][_0x48e5('0x11')]);}logger[_0x48e5('0xe')](_0x48e5('0x10'),_0x5be489,_0x27bfa0['error']['message']);return _0x5a9cf7(_0x27bfa0[_0x48e5('0xe')][_0x48e5('0x11')]);}else{logger[_0x48e5('0xb')](_0x48e5('0x10'),_0x5be489,'request\x20sent');_0x5a9cf7(_0x27bfa0[_0x48e5('0x12')][_0x48e5('0x11')]);}})['catch'](function(_0x44c2be){logger[_0x48e5('0xe')](_0x48e5('0x10'),_0x5be489,_0x44c2be);_0x5372a3(_0x44c2be);});});} \ No newline at end of file +var _0x801e=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CrmActionsList,\x20%s,\x20%s','debug','CrmActionsList,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x801e,0x1c7));var _0xe801=function(_0x30ed00,_0x7087b8){_0x30ed00=_0x30ed00-0x0;var _0x3e2ae3=_0x801e[_0x30ed00];return _0x3e2ae3;};'use strict';var _=require(_0xe801('0x0'));var util=require(_0xe801('0x1'));var moment=require(_0xe801('0x2'));var BPromise=require(_0xe801('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe801('0x4'));var db=require(_0xe801('0x5'))['db'];var utils=require(_0xe801('0x6'));var logger=require(_0xe801('0x7'))(_0xe801('0x8'));var config=require(_0xe801('0x9'));var jayson=require(_0xe801('0xa'));var client=jayson[_0xe801('0xb')][_0xe801('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26bbf0,_0x23f7a6,_0xbdc282){return new BPromise(function(_0xb9df97,_0x19ef13){return client[_0xe801('0xd')](_0x26bbf0,_0xbdc282)[_0xe801('0xe')](function(_0x189a9b){logger[_0xe801('0xf')](_0xe801('0x10'),_0x23f7a6,'request\x20sent');logger[_0xe801('0x11')](_0xe801('0x12'),_0x23f7a6,_0xe801('0x13'),JSON['stringify'](_0x189a9b));if(_0x189a9b[_0xe801('0x14')]){if(_0x189a9b[_0xe801('0x14')]['code']===0x1f4){logger[_0xe801('0x14')]('CrmActionsList,\x20%s,\x20%s',_0x23f7a6,_0x189a9b[_0xe801('0x14')][_0xe801('0x15')]);return _0x19ef13(_0x189a9b['error'][_0xe801('0x15')]);}logger[_0xe801('0x14')](_0xe801('0x10'),_0x23f7a6,_0x189a9b['error'][_0xe801('0x15')]);return _0xb9df97(_0x189a9b[_0xe801('0x14')]['message']);}else{logger['info'](_0xe801('0x10'),_0x23f7a6,_0xe801('0x13'));_0xb9df97(_0x189a9b[_0xe801('0x16')][_0xe801('0x15')]);}})[_0xe801('0x17')](function(_0x35639a){logger[_0xe801('0x14')](_0xe801('0x10'),_0x23f7a6,_0x35639a);_0x19ef13(_0x35639a);});});} \ No newline at end of file diff --git a/server/api/crmActionsList/index.js b/server/api/crmActionsList/index.js index b037b5b..1e8e6ac 100644 --- a/server/api/crmActionsList/index.js +++ b/server/api/crmActionsList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6dc=['put','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','create'];(function(_0x16bdf3,_0x3551c3){var _0x4d1a1f=function(_0x5a1182){while(--_0x5a1182){_0x16bdf3['push'](_0x16bdf3['shift']());}};_0x4d1a1f(++_0x3551c3);}(_0xb6dc,0xbe));var _0xcb6d=function(_0xf2b8fd,_0x307507){_0xf2b8fd=_0xf2b8fd-0x0;var _0x2831d5=_0xb6dc[_0xf2b8fd];return _0x2831d5;};'use strict';var multer=require('multer');var util=require(_0xcb6d('0x0'));var path=require(_0xcb6d('0x1'));var timeout=require(_0xcb6d('0x2'));var express=require('express');var router=express[_0xcb6d('0x3')]();var auth=require(_0xcb6d('0x4'));var interaction=require(_0xcb6d('0x5'));var config=require(_0xcb6d('0x6'));var controller=require('./crmActionsList.controller');router['get']('/',auth[_0xcb6d('0x7')](),controller[_0xcb6d('0x8')]);router[_0xcb6d('0x9')](_0xcb6d('0xa'),auth[_0xcb6d('0x7')](),controller[_0xcb6d('0xb')]);router[_0xcb6d('0x9')](_0xcb6d('0xc'),auth[_0xcb6d('0x7')](),controller['show']);router['post']('/',auth[_0xcb6d('0x7')](),controller[_0xcb6d('0xd')]);router[_0xcb6d('0xe')](_0xcb6d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xcb6d('0xf')](_0xcb6d('0xc'),auth['isAuthenticated'](),controller[_0xcb6d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x62a4=['../../config/environment','./crmActionsList.controller','get','isAuthenticated','show','create','put','/:id','update','delete','multer','util','../../components/auth/service','../../components/interaction/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x62a4,0xa4));var _0x462a=function(_0x5cc751,_0x3bdb0f){_0x5cc751=_0x5cc751-0x0;var _0x27a21b=_0x62a4[_0x5cc751];return _0x27a21b;};'use strict';var multer=require(_0x462a('0x0'));var util=require(_0x462a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x462a('0x2'));var interaction=require(_0x462a('0x3'));var config=require(_0x462a('0x4'));var controller=require(_0x462a('0x5'));router[_0x462a('0x6')]('/',auth[_0x462a('0x7')](),controller['index']);router[_0x462a('0x6')]('/describe',auth[_0x462a('0x7')](),controller['describe']);router[_0x462a('0x6')]('/:id',auth[_0x462a('0x7')](),controller[_0x462a('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x462a('0x9')]);router[_0x462a('0xa')](_0x462a('0xb'),auth['isAuthenticated'](),controller[_0x462a('0xc')]);router[_0x462a('0xd')](_0x462a('0xb'),auth[_0x462a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.attributes.js b/server/api/crmMyCompanies/crmMyCompanies.attributes.js index f4195eb..e5ef4b5 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.attributes.js +++ b/server/api/crmMyCompanies/crmMyCompanies.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb803=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb803,0x163));var _0x3b80=function(_0x1599dd,_0x4dcd06){_0x1599dd=_0x1599dd-0x0;var _0xb42fe7=_0xb803[_0x1599dd];return _0xb42fe7;};'use strict';var Sequelize=require(_0x3b80('0x0'));module[_0x3b80('0x1')]={'saName':{'type':Sequelize[_0x3b80('0x2')],'unique':_0x3b80('0x3'),'allowNull':![]},'saWebsite':{'type':Sequelize[_0x3b80('0x2')]},'saPhone':{'type':Sequelize[_0x3b80('0x2')]},'saFax':{'type':Sequelize[_0x3b80('0x2')]},'saEmail':{'type':Sequelize[_0x3b80('0x2')],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize['STRING']},'saPostalCode':{'type':Sequelize['STRING']},'saCity':{'type':Sequelize[_0x3b80('0x2')]},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize[_0x3b80('0x2')](0x3)},'saFiscalCode':{'type':Sequelize['STRING'](0x10)},'saPIVA':{'type':Sequelize[_0x3b80('0x2')](0xb)},'saSDICode':{'type':Sequelize['STRING'](0x6)},'saFiscalMessage':{'type':Sequelize[_0x3b80('0x2')]},'saEurope':{'type':Sequelize[_0x3b80('0x4')]}}; \ No newline at end of file +var _0xd2da=['exports','STRING','BOOLEAN'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2da,0x15f));var _0xad2d=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xd2da[_0x152678];return _0x311a9;};'use strict';var Sequelize=require('sequelize');module[_0xad2d('0x0')]={'saName':{'type':Sequelize[_0xad2d('0x1')],'unique':'name','allowNull':![]},'saWebsite':{'type':Sequelize['STRING']},'saPhone':{'type':Sequelize[_0xad2d('0x1')]},'saFax':{'type':Sequelize[_0xad2d('0x1')]},'saEmail':{'type':Sequelize[_0xad2d('0x1')],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize[_0xad2d('0x1')]},'saPostalCode':{'type':Sequelize['STRING']},'saCity':{'type':Sequelize[_0xad2d('0x1')]},'saCountry':{'type':Sequelize[_0xad2d('0x1')]},'saISOCode':{'type':Sequelize[_0xad2d('0x1')](0x3)},'saFiscalCode':{'type':Sequelize['STRING'](0x10)},'saPIVA':{'type':Sequelize['STRING'](0xb)},'saSDICode':{'type':Sequelize[_0xad2d('0x1')](0x6)},'saFiscalMessage':{'type':Sequelize[_0xad2d('0x1')]},'saEurope':{'type':Sequelize[_0xad2d('0x2')]}}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.controller.js b/server/api/crmMyCompanies/crmMyCompanies.controller.js index da1367a..cbcdb52 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.controller.js +++ b/server/api/crmMyCompanies/crmMyCompanies.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','json','reject','save','update','then','destroy','error','stack','name','send','index','crmMyCompany','rawAttributes','keys','query','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','dateEnd','add','merge','map','filter','count','includeAll','include','findAll','rows','catch','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5afaa5,_0x286dc9){var _0x19e4fb=function(_0xd87cfa){while(--_0xd87cfa){_0x5afaa5['push'](_0x5afaa5['shift']());}};_0x19e4fb(++_0x286dc9);}(_0x896e,0x1e9));var _0xe896=function(_0x416926,_0x2691fa){_0x416926=_0x416926-0x0;var _0x132221=_0x896e[_0x416926];return _0x132221;};'use strict';var pdf=require(_0xe896('0x0'));var emlformat=require(_0xe896('0x1'));var rimraf=require(_0xe896('0x2'));var zipdir=require(_0xe896('0x3'));var jsonpatch=require(_0xe896('0x4'));var rp=require(_0xe896('0x5'));var moment=require(_0xe896('0x6'));var BPromise=require(_0xe896('0x7'));var Mustache=require(_0xe896('0x8'));var util=require(_0xe896('0x9'));var path=require(_0xe896('0xa'));var sox=require(_0xe896('0xb'));var csv=require('to-csv');var ejs=require(_0xe896('0xc'));var fs=require('fs');var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0x11'));var querystring=require(_0xe896('0x12'));var Papa=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xe896('0x14'))('api');var utils=require(_0xe896('0x15'));var config=require('../../config/environment');var db=require(_0xe896('0x16'))['db'];function respondWithStatusCode(_0x146b12,_0xa00ae9){_0xa00ae9=_0xa00ae9||0xcc;return function(_0x47a310){if(_0x47a310){return _0x146b12[_0xe896('0x17')](_0xa00ae9);}return _0x146b12[_0xe896('0x18')](_0xa00ae9)[_0xe896('0x19')]();};}function respondWithResult(_0x580aac,_0x2aa522){_0x2aa522=_0x2aa522||0xc8;return function(_0x2f1c3e){if(_0x2f1c3e){return _0x580aac[_0xe896('0x18')](_0x2aa522)['json'](_0x2f1c3e);}};}function respondWithFilteredResult(_0x2d0e46,_0x7dcf8a){return function(_0x1e7ef8){if(_0x1e7ef8){var _0x564758=_0x1e7ef8['count'],_0x5a7957=_0x7dcf8a['offset'],_0x446ce2=_0x7dcf8a[_0xe896('0x1a')]+_0x7dcf8a[_0xe896('0x1b')],_0x25606b;if(_0x446ce2>=_0x564758){_0x446ce2=_0x564758;_0x25606b=0xc8;}else{_0x25606b=0xce;}_0x2d0e46['status'](_0x25606b);return _0x2d0e46[_0xe896('0x1c')]('Content-Range',_0x5a7957+'-'+_0x446ce2+'/'+_0x564758)[_0xe896('0x1d')](_0x1e7ef8);}return null;};}function patchUpdates(_0x32f86d){return function(_0x2d4cf0){try{jsonpatch['apply'](_0x2d4cf0,_0x32f86d,!![]);}catch(_0x782813){return BPromise[_0xe896('0x1e')](_0x782813);}return _0x2d4cf0[_0xe896('0x1f')]();};}function saveUpdates(_0xbebbe1,_0x2693d6){return function(_0x3ac8b8){if(_0x3ac8b8){return _0x3ac8b8[_0xe896('0x20')](_0xbebbe1)[_0xe896('0x21')](function(_0x49547b){return _0x49547b;});}return null;};}function removeEntity(_0x180d46,_0x5e1f29){return function(_0x5d2c8d){if(_0x5d2c8d){return _0x5d2c8d[_0xe896('0x22')]()[_0xe896('0x21')](function(){_0x180d46[_0xe896('0x18')](0xcc)[_0xe896('0x19')]();});}};}function handleEntityNotFound(_0x498469,_0x468479){return function(_0x4ad156){if(!_0x4ad156){_0x498469['sendStatus'](0x194);}return _0x4ad156;};}function handleError(_0x45dd49,_0x41e689){_0x41e689=_0x41e689||0x1f4;return function(_0x1e952a){logger[_0xe896('0x23')](_0x1e952a[_0xe896('0x24')]);if(_0x1e952a[_0xe896('0x25')]){delete _0x1e952a[_0xe896('0x25')];}_0x45dd49['status'](_0x41e689)[_0xe896('0x26')](_0x1e952a);};}exports[_0xe896('0x27')]=function(_0xc3cd05,_0x569d5f){var _0x26635e={},_0xd50fe2={},_0x2bc11d={'count':0x0,'rows':[]};var _0xe93aa0=db[_0xe896('0x28')][_0xe896('0x29')];_0xd50fe2['model']=_[_0xe896('0x2a')](_0xe93aa0);var _0x34ccfd={'dateStart':_0xc3cd05[_0xe896('0x2b')][_0xe896('0x2c')],'dateEnd':_0xc3cd05[_0xe896('0x2b')]['dateEnd']};delete _0xc3cd05['query']['dateStart'];delete _0xc3cd05['query']['dateEnd'];_0xd50fe2[_0xe896('0x2b')]=_[_0xe896('0x2a')](_0xc3cd05[_0xe896('0x2b')]);_0xd50fe2[_0xe896('0x2d')]=_[_0xe896('0x2e')](_0xd50fe2[_0xe896('0x2f')],_0xd50fe2[_0xe896('0x2b')]);_0x26635e[_0xe896('0x30')]=_['intersection'](_0xd50fe2['model'],qs[_0xe896('0x31')](_0xc3cd05[_0xe896('0x2b')][_0xe896('0x31')]));_0x26635e[_0xe896('0x30')]=_0x26635e['attributes'][_0xe896('0x32')]?_0x26635e['attributes']:_0xd50fe2['model'];if(!_0xc3cd05[_0xe896('0x2b')][_0xe896('0x33')](_0xe896('0x34'))){_0x26635e['limit']=qs['limit'](_0xc3cd05['query'][_0xe896('0x1b')]);_0x26635e[_0xe896('0x1a')]=qs[_0xe896('0x1a')](_0xc3cd05[_0xe896('0x2b')][_0xe896('0x1a')]);}_0x26635e['order']=qs[_0xe896('0x35')](_0xc3cd05[_0xe896('0x2b')][_0xe896('0x35')]);_0x26635e[_0xe896('0x36')]=qs[_0xe896('0x2d')](_[_0xe896('0x37')](_0xc3cd05[_0xe896('0x2b')],_0xd50fe2[_0xe896('0x2d')]));if(_0x34ccfd['dateStart']){if(_0x34ccfd[_0xe896('0x38')]){_0x34ccfd[_0xe896('0x38')]=moment(_0x34ccfd['dateEnd'])[_0xe896('0x39')](0x1,'day');}else{_0x34ccfd[_0xe896('0x38')]=moment(_0x34ccfd['dateStart'])[_0xe896('0x39')](0x1,'day');}_[_0xe896('0x3a')](_0x26635e[_0xe896('0x36')],{'createdAt':{'$gte':_0x34ccfd[_0xe896('0x2c')],'$lte':_0x34ccfd[_0xe896('0x38')]}});}if(_0xc3cd05[_0xe896('0x2b')]['filter']){_0x26635e['where']=_[_0xe896('0x3a')](_0x26635e[_0xe896('0x36')],{'$or':_[_0xe896('0x3b')](_0x26635e[_0xe896('0x30')],function(_0x2ff489){var _0x4c0ef0={};_0x4c0ef0[_0x2ff489]={'$like':'%'+_0xc3cd05['query'][_0xe896('0x3c')]+'%'};return _0x4c0ef0;})});}_0x26635e=_[_0xe896('0x3a')]({},_0x26635e,_0xc3cd05['options']);var _0x57e194={'where':_0x26635e[_0xe896('0x36')]};return db[_0xe896('0x28')][_0xe896('0x3d')](_0x57e194)[_0xe896('0x21')](function(_0x359bfb){_0x2bc11d[_0xe896('0x3d')]=_0x359bfb;if(_0xc3cd05[_0xe896('0x2b')][_0xe896('0x3e')]){_0x26635e[_0xe896('0x3f')]=[{'all':!![]}];}return db[_0xe896('0x28')][_0xe896('0x40')](_0x26635e);})[_0xe896('0x21')](function(_0x5c00c6){_0x2bc11d[_0xe896('0x41')]=_0x5c00c6;return _0x2bc11d;})[_0xe896('0x21')](respondWithFilteredResult(_0x569d5f,_0x26635e))['catch'](handleError(_0x569d5f,null));};exports['show']=function(_0x5cd5a3,_0x36449e){var _0x2a354f={'raw':![],'where':{'id':_0x5cd5a3['params']['id']}},_0x1ab77c={};_0x1ab77c[_0xe896('0x2f')]=_[_0xe896('0x2a')](db['crmMyCompany']['rawAttributes']);_0x1ab77c['query']=_[_0xe896('0x2a')](_0x5cd5a3[_0xe896('0x2b')]);_0x1ab77c[_0xe896('0x2d')]=_[_0xe896('0x2e')](_0x1ab77c[_0xe896('0x2f')],_0x1ab77c[_0xe896('0x2b')]);_0x2a354f['attributes']=_[_0xe896('0x2e')](_0x1ab77c[_0xe896('0x2f')],qs['fields'](_0x5cd5a3[_0xe896('0x2b')][_0xe896('0x31')]));_0x2a354f[_0xe896('0x30')]=_0x2a354f[_0xe896('0x30')]['length']?_0x2a354f[_0xe896('0x30')]:_0x1ab77c[_0xe896('0x2f')];if(_0x5cd5a3[_0xe896('0x2b')][_0xe896('0x3e')]){_0x2a354f[_0xe896('0x3f')]=[{'all':!![]}];}_0x2a354f=_[_0xe896('0x3a')]({},_0x2a354f,_0x5cd5a3['options']);return db[_0xe896('0x28')]['find'](_0x2a354f)[_0xe896('0x21')](handleEntityNotFound(_0x36449e,null))[_0xe896('0x21')](respondWithResult(_0x36449e,null))[_0xe896('0x42')](handleError(_0x36449e,null));};exports[_0xe896('0x43')]=function(_0x252c27,_0x8523d7){return db['crmMyCompany'][_0xe896('0x43')](_0x252c27[_0xe896('0x44')],{})['then'](respondWithResult(_0x8523d7,0xc9))[_0xe896('0x42')](handleError(_0x8523d7,null));};exports[_0xe896('0x20')]=function(_0x4d0047,_0x3ef032){if(_0x4d0047['body']['id']){delete _0x4d0047[_0xe896('0x44')]['id'];}return db[_0xe896('0x28')][_0xe896('0x45')]({'where':{'id':_0x4d0047[_0xe896('0x46')]['id']}})[_0xe896('0x21')](handleEntityNotFound(_0x3ef032,null))['then'](saveUpdates(_0x4d0047[_0xe896('0x44')],null))[_0xe896('0x21')](respondWithResult(_0x3ef032,null))[_0xe896('0x42')](handleError(_0x3ef032,null));};exports['destroy']=function(_0x2ceae5,_0x5d205b){return db['crmMyCompany'][_0xe896('0x45')]({'where':{'id':_0x2ceae5[_0xe896('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d205b,null))[_0xe896('0x21')](removeEntity(_0x5d205b,null))[_0xe896('0x42')](handleError(_0x5d205b,null));};exports['describe']=function(_0x58497a,_0x2e8fac){return db[_0xe896('0x28')]['describe']()[_0xe896('0x21')](respondWithResult(_0x2e8fac,null))[_0xe896('0x42')](handleError(_0x2e8fac,null));}; \ No newline at end of file +var _0x14a0=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','crmMyCompany','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','where','filter','merge','map','options','includeAll','findAll','rows','show','params','include','find','catch','create','update'];(function(_0x2bfd41,_0x1d50d9){var _0x34032e=function(_0x516652){while(--_0x516652){_0x2bfd41['push'](_0x2bfd41['shift']());}};_0x34032e(++_0x1d50d9);}(_0x14a0,0x8e));var _0x014a=function(_0xc3d6f1,_0x471428){_0xc3d6f1=_0xc3d6f1-0x0;var _0x2e956f=_0x14a0[_0xc3d6f1];return _0x2e956f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x014a('0x7'));var sox=require(_0x014a('0x8'));var csv=require(_0x014a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x014a('0xe'));var config=require('../../config/environment');var db=require(_0x014a('0xf'))['db'];function respondWithStatusCode(_0x168c70,_0x543bbf){_0x543bbf=_0x543bbf||0xcc;return function(_0x18c742){if(_0x18c742){return _0x168c70[_0x014a('0x10')](_0x543bbf);}return _0x168c70[_0x014a('0x11')](_0x543bbf)[_0x014a('0x12')]();};}function respondWithResult(_0x1bcd1,_0x20cb56){_0x20cb56=_0x20cb56||0xc8;return function(_0x200ab8){if(_0x200ab8){return _0x1bcd1[_0x014a('0x11')](_0x20cb56)[_0x014a('0x13')](_0x200ab8);}};}function respondWithFilteredResult(_0x71535d,_0x45cd80){return function(_0x3c54c8){if(_0x3c54c8){var _0x4fe87c=_0x3c54c8[_0x014a('0x14')],_0x130d13=_0x45cd80[_0x014a('0x15')],_0x3cf92f=_0x45cd80['offset']+_0x45cd80[_0x014a('0x16')],_0x59f207;if(_0x3cf92f>=_0x4fe87c){_0x3cf92f=_0x4fe87c;_0x59f207=0xc8;}else{_0x59f207=0xce;}_0x71535d[_0x014a('0x11')](_0x59f207);return _0x71535d[_0x014a('0x17')](_0x014a('0x18'),_0x130d13+'-'+_0x3cf92f+'/'+_0x4fe87c)[_0x014a('0x13')](_0x3c54c8);}return null;};}function patchUpdates(_0x12d339){return function(_0x61ec9f){try{jsonpatch[_0x014a('0x19')](_0x61ec9f,_0x12d339,!![]);}catch(_0x16490a){return BPromise[_0x014a('0x1a')](_0x16490a);}return _0x61ec9f[_0x014a('0x1b')]();};}function saveUpdates(_0x89e132,_0x2a41f2){return function(_0x34e5c3){if(_0x34e5c3){return _0x34e5c3['update'](_0x89e132)[_0x014a('0x1c')](function(_0x109a9c){return _0x109a9c;});}return null;};}function removeEntity(_0x11065f,_0x1897c7){return function(_0xc9a563){if(_0xc9a563){return _0xc9a563[_0x014a('0x1d')]()[_0x014a('0x1c')](function(){_0x11065f[_0x014a('0x11')](0xcc)[_0x014a('0x12')]();});}};}function handleEntityNotFound(_0x486e66,_0x3679ed){return function(_0x5f556e){if(!_0x5f556e){_0x486e66[_0x014a('0x10')](0x194);}return _0x5f556e;};}function handleError(_0x26718b,_0x44d921){_0x44d921=_0x44d921||0x1f4;return function(_0x36d52b){logger[_0x014a('0x1e')](_0x36d52b[_0x014a('0x1f')]);if(_0x36d52b[_0x014a('0x20')]){delete _0x36d52b[_0x014a('0x20')];}_0x26718b[_0x014a('0x11')](_0x44d921)['send'](_0x36d52b);};}exports[_0x014a('0x21')]=function(_0x5358e9,_0x39a432){var _0x28701e={},_0x4f1c44={},_0x4ee195={'count':0x0,'rows':[]};var _0x9a901f=db[_0x014a('0x22')][_0x014a('0x23')];_0x4f1c44['model']=_[_0x014a('0x24')](_0x9a901f);var _0x3c1fa4={'dateStart':_0x5358e9['query'][_0x014a('0x25')],'dateEnd':_0x5358e9[_0x014a('0x26')]['dateEnd']};delete _0x5358e9['query'][_0x014a('0x25')];delete _0x5358e9[_0x014a('0x26')][_0x014a('0x27')];_0x4f1c44[_0x014a('0x26')]=_['keys'](_0x5358e9[_0x014a('0x26')]);_0x4f1c44[_0x014a('0x28')]=_[_0x014a('0x29')](_0x4f1c44[_0x014a('0x2a')],_0x4f1c44[_0x014a('0x26')]);_0x28701e[_0x014a('0x2b')]=_[_0x014a('0x29')](_0x4f1c44[_0x014a('0x2a')],qs[_0x014a('0x2c')](_0x5358e9[_0x014a('0x26')][_0x014a('0x2c')]));_0x28701e['attributes']=_0x28701e[_0x014a('0x2b')][_0x014a('0x2d')]?_0x28701e[_0x014a('0x2b')]:_0x4f1c44[_0x014a('0x2a')];if(!_0x5358e9[_0x014a('0x26')][_0x014a('0x2e')](_0x014a('0x2f'))){_0x28701e['limit']=qs[_0x014a('0x16')](_0x5358e9[_0x014a('0x26')]['limit']);_0x28701e[_0x014a('0x15')]=qs[_0x014a('0x15')](_0x5358e9[_0x014a('0x26')][_0x014a('0x15')]);}_0x28701e[_0x014a('0x30')]=qs[_0x014a('0x31')](_0x5358e9[_0x014a('0x26')][_0x014a('0x31')]);_0x28701e['where']=qs[_0x014a('0x28')](_[_0x014a('0x32')](_0x5358e9[_0x014a('0x26')],_0x4f1c44[_0x014a('0x28')]));if(_0x3c1fa4['dateStart']){if(_0x3c1fa4[_0x014a('0x27')]){_0x3c1fa4[_0x014a('0x27')]=moment(_0x3c1fa4[_0x014a('0x27')])[_0x014a('0x33')](0x1,_0x014a('0x34'));}else{_0x3c1fa4[_0x014a('0x27')]=moment(_0x3c1fa4[_0x014a('0x25')])[_0x014a('0x33')](0x1,_0x014a('0x34'));}_['merge'](_0x28701e[_0x014a('0x35')],{'createdAt':{'$gte':_0x3c1fa4['dateStart'],'$lte':_0x3c1fa4[_0x014a('0x27')]}});}if(_0x5358e9[_0x014a('0x26')][_0x014a('0x36')]){_0x28701e[_0x014a('0x35')]=_[_0x014a('0x37')](_0x28701e['where'],{'$or':_[_0x014a('0x38')](_0x28701e[_0x014a('0x2b')],function(_0x51dca8){var _0x9227b8={};_0x9227b8[_0x51dca8]={'$like':'%'+_0x5358e9[_0x014a('0x26')][_0x014a('0x36')]+'%'};return _0x9227b8;})});}_0x28701e=_[_0x014a('0x37')]({},_0x28701e,_0x5358e9[_0x014a('0x39')]);var _0x313eb8={'where':_0x28701e[_0x014a('0x35')]};return db[_0x014a('0x22')][_0x014a('0x14')](_0x313eb8)['then'](function(_0x107f2f){_0x4ee195[_0x014a('0x14')]=_0x107f2f;if(_0x5358e9[_0x014a('0x26')][_0x014a('0x3a')]){_0x28701e['include']=[{'all':!![]}];}return db[_0x014a('0x22')][_0x014a('0x3b')](_0x28701e);})[_0x014a('0x1c')](function(_0x1355dd){_0x4ee195[_0x014a('0x3c')]=_0x1355dd;return _0x4ee195;})[_0x014a('0x1c')](respondWithFilteredResult(_0x39a432,_0x28701e))['catch'](handleError(_0x39a432,null));};exports[_0x014a('0x3d')]=function(_0x2830e1,_0x5e2f74){var _0xc086b3={'raw':![],'where':{'id':_0x2830e1[_0x014a('0x3e')]['id']}},_0x15f9e6={};_0x15f9e6['model']=_[_0x014a('0x24')](db['crmMyCompany']['rawAttributes']);_0x15f9e6[_0x014a('0x26')]=_[_0x014a('0x24')](_0x2830e1['query']);_0x15f9e6[_0x014a('0x28')]=_[_0x014a('0x29')](_0x15f9e6[_0x014a('0x2a')],_0x15f9e6[_0x014a('0x26')]);_0xc086b3[_0x014a('0x2b')]=_[_0x014a('0x29')](_0x15f9e6['model'],qs[_0x014a('0x2c')](_0x2830e1[_0x014a('0x26')][_0x014a('0x2c')]));_0xc086b3['attributes']=_0xc086b3['attributes'][_0x014a('0x2d')]?_0xc086b3['attributes']:_0x15f9e6['model'];if(_0x2830e1[_0x014a('0x26')]['includeAll']){_0xc086b3[_0x014a('0x3f')]=[{'all':!![]}];}_0xc086b3=_[_0x014a('0x37')]({},_0xc086b3,_0x2830e1[_0x014a('0x39')]);return db['crmMyCompany'][_0x014a('0x40')](_0xc086b3)[_0x014a('0x1c')](handleEntityNotFound(_0x5e2f74,null))[_0x014a('0x1c')](respondWithResult(_0x5e2f74,null))[_0x014a('0x41')](handleError(_0x5e2f74,null));};exports[_0x014a('0x42')]=function(_0x16aebc,_0x559954){return db[_0x014a('0x22')][_0x014a('0x42')](_0x16aebc['body'],{})[_0x014a('0x1c')](respondWithResult(_0x559954,0xc9))[_0x014a('0x41')](handleError(_0x559954,null));};exports[_0x014a('0x43')]=function(_0x324df7,_0x40a9c1){if(_0x324df7[_0x014a('0x44')]['id']){delete _0x324df7[_0x014a('0x44')]['id'];}return db[_0x014a('0x22')]['find']({'where':{'id':_0x324df7[_0x014a('0x3e')]['id']}})[_0x014a('0x1c')](handleEntityNotFound(_0x40a9c1,null))[_0x014a('0x1c')](saveUpdates(_0x324df7[_0x014a('0x44')],null))[_0x014a('0x1c')](respondWithResult(_0x40a9c1,null))['catch'](handleError(_0x40a9c1,null));};exports[_0x014a('0x1d')]=function(_0x5bee56,_0x2da804){return db[_0x014a('0x22')][_0x014a('0x40')]({'where':{'id':_0x5bee56[_0x014a('0x3e')]['id']}})[_0x014a('0x1c')](handleEntityNotFound(_0x2da804,null))['then'](removeEntity(_0x2da804,null))['catch'](handleError(_0x2da804,null));};exports['describe']=function(_0x58905d,_0x1c11d0){return db['crmMyCompany'][_0x014a('0x45')]()['then'](respondWithResult(_0x1c11d0,null))['catch'](handleError(_0x1c11d0,null));}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.model.js b/server/api/crmMyCompanies/crmMyCompanies.model.js index 5ac928f..9bce72f 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.model.js +++ b/server/api/crmMyCompanies/crmMyCompanies.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6113=['bluebird','request-promise','./crmMyCompanies.attributes','exports','crmMyCompany','crm_maycompanies','lodash','util','../../config/logger','moment'];(function(_0x5d170e,_0x360717){var _0x21c0de=function(_0x57665f){while(--_0x57665f){_0x5d170e['push'](_0x5d170e['shift']());}};_0x21c0de(++_0x360717);}(_0x6113,0x1c8));var _0x3611=function(_0x4114ed,_0xd5a4f8){_0x4114ed=_0x4114ed-0x0;var _0x2f9388=_0x6113[_0x4114ed];return _0x2f9388;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var logger=require(_0x3611('0x2'))('api');var moment=require(_0x3611('0x3'));var BPromise=require(_0x3611('0x4'));var rp=require(_0x3611('0x5'));var attributes=require(_0x3611('0x6'));module[_0x3611('0x7')]=function(_0x1661c9,_0x33586a){return _0x1661c9['define'](_0x3611('0x8'),attributes,{'tableName':_0x3611('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65f4=['crmMyCompany','crm_maycompanies','../../config/logger','api','moment','./crmMyCompanies.attributes','exports','define'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0x65f4,0x19a));var _0x465f=function(_0x3d9c6a,_0x19130d){_0x3d9c6a=_0x3d9c6a-0x0;var _0x2c684f=_0x65f4[_0x3d9c6a];return _0x2c684f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x465f('0x0'))(_0x465f('0x1'));var moment=require(_0x465f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x465f('0x3'));module[_0x465f('0x4')]=function(_0x307a2b,_0x5387f3){return _0x307a2b[_0x465f('0x5')](_0x465f('0x6'),attributes,{'tableName':_0x465f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.rpc.js b/server/api/crmMyCompanies/crmMyCompanies.rpc.js index b0e04de..eada1c2 100644 --- a/server/api/crmMyCompanies/crmMyCompanies.rpc.js +++ b/server/api/crmMyCompanies/crmMyCompanies.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c3b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','crmMyCompany,\x20%s,\x20%s','request\x20sent','crmMyCompany,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','randomstring','../../mysqldb'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x7c3b,0x19e));var _0xb7c3=function(_0x2429a0,_0x5d69ff){_0x2429a0=_0x2429a0-0x0;var _0x1fe7b7=_0x7c3b[_0x2429a0];return _0x1fe7b7;};'use strict';var _=require(_0xb7c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb7c3('0x1'));var rs=require(_0xb7c3('0x2'));var fs=require('fs');var db=require(_0xb7c3('0x3'))['db'];var utils=require(_0xb7c3('0x4'));var logger=require(_0xb7c3('0x5'))(_0xb7c3('0x6'));var config=require(_0xb7c3('0x7'));var jayson=require(_0xb7c3('0x8'));var client=jayson[_0xb7c3('0x9')][_0xb7c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e8ce,_0x51710a,_0x42eca7){return new BPromise(function(_0x3d01a6,_0x46d485){return client['request'](_0x10e8ce,_0x42eca7)[_0xb7c3('0xb')](function(_0x1ee1e5){logger[_0xb7c3('0xc')](_0xb7c3('0xd'),_0x51710a,_0xb7c3('0xe'));logger['debug'](_0xb7c3('0xf'),_0x51710a,_0xb7c3('0xe'),JSON['stringify'](_0x1ee1e5));if(_0x1ee1e5[_0xb7c3('0x10')]){if(_0x1ee1e5[_0xb7c3('0x10')][_0xb7c3('0x11')]===0x1f4){logger[_0xb7c3('0x10')](_0xb7c3('0xd'),_0x51710a,_0x1ee1e5[_0xb7c3('0x10')][_0xb7c3('0x12')]);return _0x46d485(_0x1ee1e5[_0xb7c3('0x10')][_0xb7c3('0x12')]);}logger[_0xb7c3('0x10')](_0xb7c3('0xd'),_0x51710a,_0x1ee1e5[_0xb7c3('0x10')][_0xb7c3('0x12')]);return _0x3d01a6(_0x1ee1e5[_0xb7c3('0x10')][_0xb7c3('0x12')]);}else{logger['info'](_0xb7c3('0xd'),_0x51710a,'request\x20sent');_0x3d01a6(_0x1ee1e5['result'][_0xb7c3('0x12')]);}})['catch'](function(_0x334985){logger[_0xb7c3('0x10')]('crmMyCompany,\x20%s,\x20%s',_0x51710a,_0x334985);_0x46d485(_0x334985);});});} \ No newline at end of file +var _0x14b5=['rpc','../../config/environment','jayson/promise','http','request','then','info','crmMyCompany,\x20%s,\x20%s','request\x20sent','debug','crmMyCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4b80d9,_0x31718b){var _0x1b6068=function(_0x569d97){while(--_0x569d97){_0x4b80d9['push'](_0x4b80d9['shift']());}};_0x1b6068(++_0x31718b);}(_0x14b5,0x14b));var _0x514b=function(_0x3af43d,_0x37a9f0){_0x3af43d=_0x3af43d-0x0;var _0x1767c1=_0x14b5[_0x3af43d];return _0x1767c1;};'use strict';var _=require(_0x514b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x514b('0x1'));var rs=require(_0x514b('0x2'));var fs=require('fs');var db=require(_0x514b('0x3'))['db'];var utils=require(_0x514b('0x4'));var logger=require('../../config/logger')(_0x514b('0x5'));var config=require(_0x514b('0x6'));var jayson=require(_0x514b('0x7'));var client=jayson['client'][_0x514b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbdd169,_0x37e1c4,_0x51d74e){return new BPromise(function(_0x4bf95c,_0x110f33){return client[_0x514b('0x9')](_0xbdd169,_0x51d74e)[_0x514b('0xa')](function(_0x450187){logger[_0x514b('0xb')](_0x514b('0xc'),_0x37e1c4,_0x514b('0xd'));logger[_0x514b('0xe')](_0x514b('0xf'),_0x37e1c4,_0x514b('0xd'),JSON[_0x514b('0x10')](_0x450187));if(_0x450187[_0x514b('0x11')]){if(_0x450187[_0x514b('0x11')][_0x514b('0x12')]===0x1f4){logger[_0x514b('0x11')](_0x514b('0xc'),_0x37e1c4,_0x450187[_0x514b('0x11')][_0x514b('0x13')]);return _0x110f33(_0x450187['error'][_0x514b('0x13')]);}logger[_0x514b('0x11')](_0x514b('0xc'),_0x37e1c4,_0x450187['error'][_0x514b('0x13')]);return _0x4bf95c(_0x450187[_0x514b('0x11')][_0x514b('0x13')]);}else{logger['info'](_0x514b('0xc'),_0x37e1c4,_0x514b('0xd'));_0x4bf95c(_0x450187[_0x514b('0x14')][_0x514b('0x13')]);}})['catch'](function(_0x2e280a){logger['error'](_0x514b('0xc'),_0x37e1c4,_0x2e280a);_0x110f33(_0x2e280a);});});} \ No newline at end of file diff --git a/server/api/crmMyCompanies/index.js b/server/api/crmMyCompanies/index.js index 2065442..804d42b 100644 --- a/server/api/crmMyCompanies/index.js +++ b/server/api/crmMyCompanies/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d2c=['index','/describe','show','post','create','/:id','update','delete','destroy','exports','util','Router','./crmMyCompanies.controller','get','isAuthenticated'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x2d2c,0xaf));var _0xc2d2=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2d2c[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require(_0xc2d2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc2d2('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc2d2('0x2'));router[_0xc2d2('0x3')]('/',auth[_0xc2d2('0x4')](),controller[_0xc2d2('0x5')]);router[_0xc2d2('0x3')](_0xc2d2('0x6'),auth[_0xc2d2('0x4')](),controller['describe']);router[_0xc2d2('0x3')]('/:id',auth[_0xc2d2('0x4')](),controller[_0xc2d2('0x7')]);router[_0xc2d2('0x8')]('/',auth['isAuthenticated'](),controller[_0xc2d2('0x9')]);router['put'](_0xc2d2('0xa'),auth[_0xc2d2('0x4')](),controller[_0xc2d2('0xb')]);router[_0xc2d2('0xc')](_0xc2d2('0xa'),auth[_0xc2d2('0x4')](),controller[_0xc2d2('0xd')]);module[_0xc2d2('0xe')]=router; \ No newline at end of file +var _0xd862=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmMyCompanies.controller','get','index','/describe','isAuthenticated','/:id','show','post','create'];(function(_0x59b84e,_0x20037e){var _0x1dbe3e=function(_0x315feb){while(--_0x315feb){_0x59b84e['push'](_0x59b84e['shift']());}};_0x1dbe3e(++_0x20037e);}(_0xd862,0x139));var _0x2d86=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xd862[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x2d86('0x0'));var util=require(_0x2d86('0x1'));var path=require('path');var timeout=require(_0x2d86('0x2'));var express=require(_0x2d86('0x3'));var router=express[_0x2d86('0x4')]();var auth=require(_0x2d86('0x5'));var interaction=require(_0x2d86('0x6'));var config=require(_0x2d86('0x7'));var controller=require(_0x2d86('0x8'));router[_0x2d86('0x9')]('/',auth['isAuthenticated'](),controller[_0x2d86('0xa')]);router[_0x2d86('0x9')](_0x2d86('0xb'),auth[_0x2d86('0xc')](),controller['describe']);router['get'](_0x2d86('0xd'),auth[_0x2d86('0xc')](),controller[_0x2d86('0xe')]);router[_0x2d86('0xf')]('/',auth['isAuthenticated'](),controller[_0x2d86('0x10')]);router[_0x2d86('0x11')](_0x2d86('0xd'),auth[_0x2d86('0xc')](),controller[_0x2d86('0x12')]);router[_0x2d86('0x13')]('/:id',auth[_0x2d86('0xc')](),controller[_0x2d86('0x14')]);module[_0x2d86('0x15')]=router; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.attributes.js b/server/api/crmNation/crmNation.attributes.js index a308591..3195bdf 100644 --- a/server/api/crmNation/crmNation.attributes.js +++ b/server/api/crmNation/crmNation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83b3=['STRING','name','BOOLEAN','isoCode3','isoCode2','sequelize','exports'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x83b3,0x147));var _0x383b=function(_0x9953ab,_0x4ca17c){_0x9953ab=_0x9953ab-0x0;var _0x205899=_0x83b3[_0x9953ab];return _0x205899;};'use strict';var Sequelize=require(_0x383b('0x0'));module[_0x383b('0x1')]={'name':{'type':Sequelize[_0x383b('0x2')],'allowNull':![],'unique':_0x383b('0x3')},'europe':{'type':Sequelize[_0x383b('0x4')],'allowNull':![]},'isoCode3':{'type':Sequelize[_0x383b('0x2')](0x3),'allowNull':![],'unique':_0x383b('0x5')},'isoCode2':{'type':Sequelize[_0x383b('0x2')](0x2),'allowNull':![],'unique':_0x383b('0x6')}}; \ No newline at end of file +var _0xc5fd=['STRING','name','BOOLEAN','isoCode3','isoCode2','sequelize','exports'];(function(_0x5dece1,_0x8ff089){var _0x5c71e3=function(_0x178ade){while(--_0x178ade){_0x5dece1['push'](_0x5dece1['shift']());}};_0x5c71e3(++_0x8ff089);}(_0xc5fd,0xfa));var _0xdc5f=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xc5fd[_0x2bfd4f];return _0x341849;};'use strict';var Sequelize=require(_0xdc5f('0x0'));module[_0xdc5f('0x1')]={'name':{'type':Sequelize[_0xdc5f('0x2')],'allowNull':![],'unique':_0xdc5f('0x3')},'europe':{'type':Sequelize[_0xdc5f('0x4')],'allowNull':![]},'isoCode3':{'type':Sequelize['STRING'](0x3),'allowNull':![],'unique':_0xdc5f('0x5')},'isoCode2':{'type':Sequelize[_0xdc5f('0x2')](0x2),'allowNull':![],'unique':_0xdc5f('0x6')}}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.controller.js b/server/api/crmNation/crmNation.controller.js index d0b175e..998155e 100644 --- a/server/api/crmNation/crmNation.controller.js +++ b/server/api/crmNation/crmNation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d07=['end','json','count','offset','limit','set','apply','reject','then','error','name','send','index','CrmNation','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','filters','fields','options','find','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status'];(function(_0x547402,_0x55f166){var _0xed911c=function(_0x4c8761){while(--_0x4c8761){_0x547402['push'](_0x547402['shift']());}};_0xed911c(++_0x55f166);}(_0x2d07,0x13a));var _0x72d0=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0x2d07[_0x4b64a4];return _0xd19b0e;};'use strict';var pdf=require(_0x72d0('0x0'));var emlformat=require(_0x72d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x72d0('0x2'));var jsonpatch=require(_0x72d0('0x3'));var rp=require('request-promise');var moment=require(_0x72d0('0x4'));var BPromise=require(_0x72d0('0x5'));var Mustache=require(_0x72d0('0x6'));var util=require(_0x72d0('0x7'));var path=require(_0x72d0('0x8'));var sox=require(_0x72d0('0x9'));var csv=require('to-csv');var ejs=require(_0x72d0('0xa'));var fs=require('fs');var _=require(_0x72d0('0xb'));var squel=require(_0x72d0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72d0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72d0('0xe'));var authService=require(_0x72d0('0xf'));var qs=require(_0x72d0('0x10'));var hardwareService=require(_0x72d0('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x72d0('0x12'));var db=require(_0x72d0('0x13'))['db'];function respondWithStatusCode(_0xc8661a,_0x110012){_0x110012=_0x110012||0xcc;return function(_0x262274){if(_0x262274){return _0xc8661a['sendStatus'](_0x110012);}return _0xc8661a[_0x72d0('0x14')](_0x110012)[_0x72d0('0x15')]();};}function respondWithResult(_0x2721eb,_0x4f2343){_0x4f2343=_0x4f2343||0xc8;return function(_0x183dc7){if(_0x183dc7){return _0x2721eb[_0x72d0('0x14')](_0x4f2343)[_0x72d0('0x16')](_0x183dc7);}};}function respondWithFilteredResult(_0x167cb5,_0x19b3e7){return function(_0xea1112){if(_0xea1112){var _0x50c274=_0xea1112[_0x72d0('0x17')],_0x1e2089=_0x19b3e7[_0x72d0('0x18')],_0x197179=_0x19b3e7[_0x72d0('0x18')]+_0x19b3e7[_0x72d0('0x19')],_0x1ea03f;if(_0x197179>=_0x50c274){_0x197179=_0x50c274;_0x1ea03f=0xc8;}else{_0x1ea03f=0xce;}_0x167cb5[_0x72d0('0x14')](_0x1ea03f);return _0x167cb5[_0x72d0('0x1a')]('Content-Range',_0x1e2089+'-'+_0x197179+'/'+_0x50c274)[_0x72d0('0x16')](_0xea1112);}return null;};}function patchUpdates(_0x357553){return function(_0x2cd4aa){try{jsonpatch[_0x72d0('0x1b')](_0x2cd4aa,_0x357553,!![]);}catch(_0xf9d806){return BPromise[_0x72d0('0x1c')](_0xf9d806);}return _0x2cd4aa['save']();};}function saveUpdates(_0x4d65f3,_0x5c905a){return function(_0x4cbdf1){if(_0x4cbdf1){return _0x4cbdf1['update'](_0x4d65f3)[_0x72d0('0x1d')](function(_0x3c2441){return _0x3c2441;});}return null;};}function removeEntity(_0x55764b,_0xf8c7){return function(_0x30cb19){if(_0x30cb19){return _0x30cb19['destroy']()[_0x72d0('0x1d')](function(){_0x55764b[_0x72d0('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb4be9d,_0x1c39e3){return function(_0x350184){if(!_0x350184){_0xb4be9d['sendStatus'](0x194);}return _0x350184;};}function handleError(_0x31f6de,_0x50f263){_0x50f263=_0x50f263||0x1f4;return function(_0x37634e){logger[_0x72d0('0x1e')](_0x37634e['stack']);if(_0x37634e[_0x72d0('0x1f')]){delete _0x37634e[_0x72d0('0x1f')];}_0x31f6de[_0x72d0('0x14')](_0x50f263)[_0x72d0('0x20')](_0x37634e);};}exports[_0x72d0('0x21')]=function(_0x7f45,_0x10d27e){var _0x4e6093={'raw':!![]},_0x2ff68a={},_0x4d8340={'count':0x0,'rows':[]};var _0x20b9d=db[_0x72d0('0x22')][_0x72d0('0x23')];_0x2ff68a[_0x72d0('0x24')]=_[_0x72d0('0x25')](_0x20b9d);_0x2ff68a['query']=_[_0x72d0('0x25')](_0x7f45[_0x72d0('0x26')]);_0x2ff68a['filters']=_[_0x72d0('0x27')](_0x2ff68a[_0x72d0('0x24')],_0x2ff68a[_0x72d0('0x26')]);_0x4e6093['attributes']=_[_0x72d0('0x27')](_0x2ff68a[_0x72d0('0x24')],qs['fields'](_0x7f45[_0x72d0('0x26')]['fields']));_0x4e6093[_0x72d0('0x28')]=_0x4e6093[_0x72d0('0x28')][_0x72d0('0x29')]?_0x4e6093[_0x72d0('0x28')]:_0x2ff68a[_0x72d0('0x24')];if(!_0x7f45[_0x72d0('0x26')][_0x72d0('0x2a')](_0x72d0('0x2b'))){_0x4e6093[_0x72d0('0x19')]=qs[_0x72d0('0x19')](_0x7f45[_0x72d0('0x26')][_0x72d0('0x19')]);_0x4e6093['offset']=qs[_0x72d0('0x18')](_0x7f45[_0x72d0('0x26')][_0x72d0('0x18')]);}_0x4e6093[_0x72d0('0x2c')]=qs[_0x72d0('0x2d')](_0x7f45[_0x72d0('0x26')][_0x72d0('0x2d')]);_0x4e6093[_0x72d0('0x2e')]=qs['filters'](_[_0x72d0('0x2f')](_0x7f45[_0x72d0('0x26')],_0x2ff68a['filters']));if(_0x7f45['query'][_0x72d0('0x30')]){_0x4e6093[_0x72d0('0x2e')]=_[_0x72d0('0x31')](_0x4e6093[_0x72d0('0x2e')],{'$or':_[_0x72d0('0x32')](_0x20b9d,function(_0xe79457){if(_0xe79457[_0x72d0('0x33')][_0x72d0('0x34')]!==_0x72d0('0x35')){var _0x26b2d2={};_0x26b2d2[_0xe79457[_0x72d0('0x36')]]={'$like':'%'+_0x7f45[_0x72d0('0x26')][_0x72d0('0x30')]+'%'};return _0x26b2d2;}})});}_0x4e6093=_[_0x72d0('0x31')]({},_0x4e6093,_0x7f45['options']);var _0x5266d2={'where':_0x4e6093[_0x72d0('0x2e')]};return db[_0x72d0('0x22')]['count'](_0x5266d2)[_0x72d0('0x1d')](function(_0x3d1adc){_0x4d8340['count']=_0x3d1adc;if(_0x7f45[_0x72d0('0x26')][_0x72d0('0x37')]){_0x4e6093[_0x72d0('0x38')]=[{'all':!![]}];}return db['CrmNation'][_0x72d0('0x39')](_0x4e6093);})['then'](function(_0x5d1d78){_0x4d8340[_0x72d0('0x3a')]=_0x5d1d78;return _0x4d8340;})['then'](respondWithFilteredResult(_0x10d27e,_0x4e6093))[_0x72d0('0x3b')](handleError(_0x10d27e,null));};exports[_0x72d0('0x3c')]=function(_0x45690b,_0x3700d2){var _0xd2e05={'raw':!![],'where':{'id':_0x45690b[_0x72d0('0x3d')]['id']}},_0x572c56={};_0x572c56['model']=_[_0x72d0('0x25')](db[_0x72d0('0x22')][_0x72d0('0x23')]);_0x572c56[_0x72d0('0x26')]=_['keys'](_0x45690b[_0x72d0('0x26')]);_0x572c56[_0x72d0('0x3e')]=_[_0x72d0('0x27')](_0x572c56[_0x72d0('0x24')],_0x572c56[_0x72d0('0x26')]);_0xd2e05['attributes']=_['intersection'](_0x572c56[_0x72d0('0x24')],qs[_0x72d0('0x3f')](_0x45690b['query'][_0x72d0('0x3f')]));_0xd2e05[_0x72d0('0x28')]=_0xd2e05['attributes'][_0x72d0('0x29')]?_0xd2e05[_0x72d0('0x28')]:_0x572c56[_0x72d0('0x24')];if(_0x45690b[_0x72d0('0x26')][_0x72d0('0x37')]){_0xd2e05[_0x72d0('0x38')]=[{'all':!![]}];}_0xd2e05=_[_0x72d0('0x31')]({},_0xd2e05,_0x45690b[_0x72d0('0x40')]);return db[_0x72d0('0x22')][_0x72d0('0x41')](_0xd2e05)['then'](handleEntityNotFound(_0x3700d2,null))['then'](respondWithResult(_0x3700d2,null))[_0x72d0('0x3b')](handleError(_0x3700d2,null));};exports['create']=function(_0x4ba9c8,_0x1763f4){return db[_0x72d0('0x22')]['create'](_0x4ba9c8[_0x72d0('0x42')],{})[_0x72d0('0x1d')](respondWithResult(_0x1763f4,0xc9))[_0x72d0('0x3b')](handleError(_0x1763f4,null));}; \ No newline at end of file +var _0x714c=['apply','reject','save','update','then','destroy','sendStatus','name','send','index','CrmNation','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','find','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range'];(function(_0x1a667c,_0x434daf){var _0x210f32=function(_0x289b04){while(--_0x289b04){_0x1a667c['push'](_0x1a667c['shift']());}};_0x210f32(++_0x434daf);}(_0x714c,0x18d));var _0xc714=function(_0x5d78f0,_0x3784f9){_0x5d78f0=_0x5d78f0-0x0;var _0x4d1012=_0x714c[_0x5d78f0];return _0x4d1012;};'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 hardwareService=require(_0xc714('0x11'));var logger=require(_0xc714('0x12'))(_0xc714('0x13'));var utils=require('../../config/utils');var config=require(_0xc714('0x14'));var db=require(_0xc714('0x15'))['db'];function respondWithStatusCode(_0x5cc07f,_0x4dd735){_0x4dd735=_0x4dd735||0xcc;return function(_0x3ed655){if(_0x3ed655){return _0x5cc07f['sendStatus'](_0x4dd735);}return _0x5cc07f[_0xc714('0x16')](_0x4dd735)[_0xc714('0x17')]();};}function respondWithResult(_0x44898b,_0x3be76d){_0x3be76d=_0x3be76d||0xc8;return function(_0x5030c1){if(_0x5030c1){return _0x44898b[_0xc714('0x16')](_0x3be76d)[_0xc714('0x18')](_0x5030c1);}};}function respondWithFilteredResult(_0x30b839,_0x25a61c){return function(_0x377af1){if(_0x377af1){var _0xf5b54=_0x377af1['count'],_0x34a83e=_0x25a61c[_0xc714('0x19')],_0x54144c=_0x25a61c[_0xc714('0x19')]+_0x25a61c[_0xc714('0x1a')],_0x4fd793;if(_0x54144c>=_0xf5b54){_0x54144c=_0xf5b54;_0x4fd793=0xc8;}else{_0x4fd793=0xce;}_0x30b839[_0xc714('0x16')](_0x4fd793);return _0x30b839[_0xc714('0x1b')](_0xc714('0x1c'),_0x34a83e+'-'+_0x54144c+'/'+_0xf5b54)[_0xc714('0x18')](_0x377af1);}return null;};}function patchUpdates(_0x437484){return function(_0x50a84a){try{jsonpatch[_0xc714('0x1d')](_0x50a84a,_0x437484,!![]);}catch(_0x309ca2){return BPromise[_0xc714('0x1e')](_0x309ca2);}return _0x50a84a[_0xc714('0x1f')]();};}function saveUpdates(_0x5bc067,_0x751c4d){return function(_0xc9787a){if(_0xc9787a){return _0xc9787a[_0xc714('0x20')](_0x5bc067)[_0xc714('0x21')](function(_0x5e8d36){return _0x5e8d36;});}return null;};}function removeEntity(_0x50e00d,_0x32ea3d){return function(_0x5d4a4d){if(_0x5d4a4d){return _0x5d4a4d[_0xc714('0x22')]()[_0xc714('0x21')](function(){_0x50e00d[_0xc714('0x16')](0xcc)[_0xc714('0x17')]();});}};}function handleEntityNotFound(_0x3c6b1f,_0x587ea8){return function(_0x558907){if(!_0x558907){_0x3c6b1f[_0xc714('0x23')](0x194);}return _0x558907;};}function handleError(_0x50c332,_0xbc41ee){_0xbc41ee=_0xbc41ee||0x1f4;return function(_0x4637e7){logger['error'](_0x4637e7['stack']);if(_0x4637e7[_0xc714('0x24')]){delete _0x4637e7[_0xc714('0x24')];}_0x50c332[_0xc714('0x16')](_0xbc41ee)[_0xc714('0x25')](_0x4637e7);};}exports[_0xc714('0x26')]=function(_0x4863e9,_0x354cef){var _0x431a00={'raw':!![]},_0x56d3c8={},_0x2dad21={'count':0x0,'rows':[]};var _0x1bcd98=db[_0xc714('0x27')]['rawAttributes'];_0x56d3c8['model']=_[_0xc714('0x28')](_0x1bcd98);_0x56d3c8['query']=_[_0xc714('0x28')](_0x4863e9[_0xc714('0x29')]);_0x56d3c8['filters']=_[_0xc714('0x2a')](_0x56d3c8[_0xc714('0x2b')],_0x56d3c8['query']);_0x431a00[_0xc714('0x2c')]=_[_0xc714('0x2a')](_0x56d3c8['model'],qs[_0xc714('0x2d')](_0x4863e9[_0xc714('0x29')][_0xc714('0x2d')]));_0x431a00[_0xc714('0x2c')]=_0x431a00[_0xc714('0x2c')][_0xc714('0x2e')]?_0x431a00[_0xc714('0x2c')]:_0x56d3c8['model'];if(!_0x4863e9[_0xc714('0x29')][_0xc714('0x2f')](_0xc714('0x30'))){_0x431a00[_0xc714('0x1a')]=qs[_0xc714('0x1a')](_0x4863e9[_0xc714('0x29')][_0xc714('0x1a')]);_0x431a00[_0xc714('0x19')]=qs[_0xc714('0x19')](_0x4863e9[_0xc714('0x29')][_0xc714('0x19')]);}_0x431a00[_0xc714('0x31')]=qs[_0xc714('0x32')](_0x4863e9[_0xc714('0x29')]['sort']);_0x431a00[_0xc714('0x33')]=qs[_0xc714('0x34')](_[_0xc714('0x35')](_0x4863e9[_0xc714('0x29')],_0x56d3c8[_0xc714('0x34')]));if(_0x4863e9[_0xc714('0x29')][_0xc714('0x36')]){_0x431a00[_0xc714('0x33')]=_[_0xc714('0x37')](_0x431a00['where'],{'$or':_[_0xc714('0x38')](_0x1bcd98,function(_0x487f54){if(_0x487f54[_0xc714('0x39')][_0xc714('0x3a')]!=='VIRTUAL'){var _0x58834f={};_0x58834f[_0x487f54[_0xc714('0x3b')]]={'$like':'%'+_0x4863e9[_0xc714('0x29')][_0xc714('0x36')]+'%'};return _0x58834f;}})});}_0x431a00=_[_0xc714('0x37')]({},_0x431a00,_0x4863e9[_0xc714('0x3c')]);var _0x54c071={'where':_0x431a00[_0xc714('0x33')]};return db[_0xc714('0x27')][_0xc714('0x3d')](_0x54c071)['then'](function(_0x5d8fba){_0x2dad21['count']=_0x5d8fba;if(_0x4863e9['query'][_0xc714('0x3e')]){_0x431a00[_0xc714('0x3f')]=[{'all':!![]}];}return db[_0xc714('0x27')][_0xc714('0x40')](_0x431a00);})[_0xc714('0x21')](function(_0x3e3df6){_0x2dad21[_0xc714('0x41')]=_0x3e3df6;return _0x2dad21;})[_0xc714('0x21')](respondWithFilteredResult(_0x354cef,_0x431a00))[_0xc714('0x42')](handleError(_0x354cef,null));};exports[_0xc714('0x43')]=function(_0x4de919,_0x3dc06c){var _0x3d32df={'raw':!![],'where':{'id':_0x4de919['params']['id']}},_0x122683={};_0x122683[_0xc714('0x2b')]=_[_0xc714('0x28')](db['CrmNation']['rawAttributes']);_0x122683[_0xc714('0x29')]=_[_0xc714('0x28')](_0x4de919[_0xc714('0x29')]);_0x122683[_0xc714('0x34')]=_[_0xc714('0x2a')](_0x122683[_0xc714('0x2b')],_0x122683['query']);_0x3d32df['attributes']=_['intersection'](_0x122683[_0xc714('0x2b')],qs[_0xc714('0x2d')](_0x4de919[_0xc714('0x29')]['fields']));_0x3d32df[_0xc714('0x2c')]=_0x3d32df[_0xc714('0x2c')][_0xc714('0x2e')]?_0x3d32df[_0xc714('0x2c')]:_0x122683['model'];if(_0x4de919[_0xc714('0x29')]['includeAll']){_0x3d32df[_0xc714('0x3f')]=[{'all':!![]}];}_0x3d32df=_[_0xc714('0x37')]({},_0x3d32df,_0x4de919['options']);return db[_0xc714('0x27')][_0xc714('0x44')](_0x3d32df)['then'](handleEntityNotFound(_0x3dc06c,null))['then'](respondWithResult(_0x3dc06c,null))[_0xc714('0x42')](handleError(_0x3dc06c,null));};exports[_0xc714('0x45')]=function(_0x4c954d,_0x110358){return db['CrmNation'][_0xc714('0x45')](_0x4c954d[_0xc714('0x46')],{})[_0xc714('0x21')](respondWithResult(_0x110358,0xc9))[_0xc714('0x42')](handleError(_0x110358,null));}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.model.js b/server/api/crmNation/crmNation.model.js index 5bc9986..06802e1 100644 --- a/server/api/crmNation/crmNation.model.js +++ b/server/api/crmNation/crmNation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1860=['bluebird','path','rimraf','../../config/environment','./crmNation.attributes','exports','define','CrmNation','crm_nations','lodash','util','../../config/logger','moment'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x1860,0x1ea));var _0x0186=function(_0x5b52d9,_0xa4cd15){_0x5b52d9=_0x5b52d9-0x0;var _0x2c5c50=_0x1860[_0x5b52d9];return _0x2c5c50;};'use strict';var _=require(_0x0186('0x0'));var util=require(_0x0186('0x1'));var logger=require(_0x0186('0x2'))('api');var moment=require(_0x0186('0x3'));var BPromise=require(_0x0186('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0186('0x5'));var rimraf=require(_0x0186('0x6'));var config=require(_0x0186('0x7'));var attributes=require(_0x0186('0x8'));module[_0x0186('0x9')]=function(_0x31b73e,_0x4b789b){return _0x31b73e[_0x0186('0xa')](_0x0186('0xb'),attributes,{'tableName':_0x0186('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ebb=['rimraf','../../config/environment','exports','define','CrmNation','crm_nations','lodash','moment','bluebird','request-promise','path'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x2ebb,0xf8));var _0xb2eb=function(_0x272265,_0x30ecb1){_0x272265=_0x272265-0x0;var _0x4c7d94=_0x2ebb[_0x272265];return _0x4c7d94;};'use strict';var _=require(_0xb2eb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb2eb('0x1'));var BPromise=require(_0xb2eb('0x2'));var rp=require(_0xb2eb('0x3'));var fs=require('fs');var path=require(_0xb2eb('0x4'));var rimraf=require(_0xb2eb('0x5'));var config=require(_0xb2eb('0x6'));var attributes=require('./crmNation.attributes');module[_0xb2eb('0x7')]=function(_0x324376,_0x26e07b){return _0x324376[_0xb2eb('0x8')](_0xb2eb('0x9'),attributes,{'tableName':_0xb2eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.rpc.js b/server/api/crmNation/crmNation.rpc.js index f856f58..0ca02dd 100644 --- a/server/api/crmNation/crmNation.rpc.js +++ b/server/api/crmNation/crmNation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb2=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','CrmNation,\x20%s,\x20%s','request\x20sent','debug','CrmNation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x4eb2,0x104));var _0x24eb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4eb2[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x24eb('0x0'));var util=require('util');var moment=require(_0x24eb('0x1'));var BPromise=require(_0x24eb('0x2'));var rs=require(_0x24eb('0x3'));var fs=require('fs');var Redis=require(_0x24eb('0x4'));var db=require(_0x24eb('0x5'))['db'];var utils=require(_0x24eb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x24eb('0x7'));var jayson=require(_0x24eb('0x8'));var client=jayson[_0x24eb('0x9')][_0x24eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14df23,_0x2c4b32,_0x536f50){return new BPromise(function(_0x43cad0,_0x275827){return client[_0x24eb('0xb')](_0x14df23,_0x536f50)[_0x24eb('0xc')](function(_0x567325){logger['info'](_0x24eb('0xd'),_0x2c4b32,_0x24eb('0xe'));logger[_0x24eb('0xf')](_0x24eb('0x10'),_0x2c4b32,'request\x20sent',JSON[_0x24eb('0x11')](_0x567325));if(_0x567325[_0x24eb('0x12')]){if(_0x567325[_0x24eb('0x12')][_0x24eb('0x13')]===0x1f4){logger[_0x24eb('0x12')]('CrmNation,\x20%s,\x20%s',_0x2c4b32,_0x567325[_0x24eb('0x12')][_0x24eb('0x14')]);return _0x275827(_0x567325[_0x24eb('0x12')]['message']);}logger['error']('CrmNation,\x20%s,\x20%s',_0x2c4b32,_0x567325['error'][_0x24eb('0x14')]);return _0x43cad0(_0x567325[_0x24eb('0x12')][_0x24eb('0x14')]);}else{logger[_0x24eb('0x15')](_0x24eb('0xd'),_0x2c4b32,_0x24eb('0xe'));_0x43cad0(_0x567325[_0x24eb('0x16')][_0x24eb('0x14')]);}})[_0x24eb('0x17')](function(_0x41d1b5){logger[_0x24eb('0x12')](_0x24eb('0xd'),_0x2c4b32,_0x41d1b5);_0x275827(_0x41d1b5);});});} \ No newline at end of file +var _0x2c80=['CrmNation,\x20%s,\x20%s','debug','CrmNation,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x11347e,_0x378d58){var _0x4f71d1=function(_0x318620){while(--_0x318620){_0x11347e['push'](_0x11347e['shift']());}};_0x4f71d1(++_0x378d58);}(_0x2c80,0x183));var _0x02c8=function(_0x567ad7,_0x4f55e0){_0x567ad7=_0x567ad7-0x0;var _0x338c0e=_0x2c80[_0x567ad7];return _0x338c0e;};'use strict';var _=require(_0x02c8('0x0'));var util=require(_0x02c8('0x1'));var moment=require(_0x02c8('0x2'));var BPromise=require(_0x02c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x02c8('0x5'));var logger=require(_0x02c8('0x6'))(_0x02c8('0x7'));var config=require('../../config/environment');var jayson=require(_0x02c8('0x8'));var client=jayson[_0x02c8('0x9')][_0x02c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20bd4e,_0x56ff2f,_0x1c09fb){return new BPromise(function(_0x8f7aff,_0x5c09fc){return client['request'](_0x20bd4e,_0x1c09fb)[_0x02c8('0xb')](function(_0x2ca2e7){logger[_0x02c8('0xc')](_0x02c8('0xd'),_0x56ff2f,'request\x20sent');logger[_0x02c8('0xe')](_0x02c8('0xf'),_0x56ff2f,'request\x20sent',JSON['stringify'](_0x2ca2e7));if(_0x2ca2e7[_0x02c8('0x10')]){if(_0x2ca2e7[_0x02c8('0x10')][_0x02c8('0x11')]===0x1f4){logger[_0x02c8('0x10')]('CrmNation,\x20%s,\x20%s',_0x56ff2f,_0x2ca2e7[_0x02c8('0x10')]['message']);return _0x5c09fc(_0x2ca2e7[_0x02c8('0x10')][_0x02c8('0x12')]);}logger['error'](_0x02c8('0xd'),_0x56ff2f,_0x2ca2e7['error'][_0x02c8('0x12')]);return _0x8f7aff(_0x2ca2e7[_0x02c8('0x10')][_0x02c8('0x12')]);}else{logger[_0x02c8('0xc')](_0x02c8('0xd'),_0x56ff2f,'request\x20sent');_0x8f7aff(_0x2ca2e7[_0x02c8('0x13')][_0x02c8('0x12')]);}})['catch'](function(_0x1f8659){logger[_0x02c8('0x10')]('CrmNation,\x20%s,\x20%s',_0x56ff2f,_0x1f8659);_0x5c09fc(_0x1f8659);});});} \ No newline at end of file diff --git a/server/api/crmNation/index.js b/server/api/crmNation/index.js index f6106c0..c6537f9 100644 --- a/server/api/crmNation/index.js +++ b/server/api/crmNation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79fb=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','multer','util'];(function(_0x1a4748,_0x4a52db){var _0x3d92bc=function(_0x3dcbb9){while(--_0x3dcbb9){_0x1a4748['push'](_0x1a4748['shift']());}};_0x3d92bc(++_0x4a52db);}(_0x79fb,0xb2));var _0xb79f=function(_0x4e7d09,_0x1e3b82){_0x4e7d09=_0x4e7d09-0x0;var _0x167daf=_0x79fb[_0x4e7d09];return _0x167daf;};'use strict';var multer=require(_0xb79f('0x0'));var util=require(_0xb79f('0x1'));var path=require(_0xb79f('0x2'));var timeout=require(_0xb79f('0x3'));var express=require(_0xb79f('0x4'));var router=express[_0xb79f('0x5')]();var auth=require(_0xb79f('0x6'));var interaction=require(_0xb79f('0x7'));var config=require(_0xb79f('0x8'));var controller=require('./crmNation.controller');router[_0xb79f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb79f('0xa')]);router[_0xb79f('0x9')](_0xb79f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb79f('0xc')]('/',auth[_0xb79f('0xd')](),controller[_0xb79f('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7c8f=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','exports','multer','util'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0x7c8f,0xee));var _0xf7c8=function(_0x5c6833,_0x27223a){_0x5c6833=_0x5c6833-0x0;var _0x1f3457=_0x7c8f[_0x5c6833];return _0x1f3457;};'use strict';var multer=require(_0xf7c8('0x0'));var util=require(_0xf7c8('0x1'));var path=require(_0xf7c8('0x2'));var timeout=require(_0xf7c8('0x3'));var express=require(_0xf7c8('0x4'));var router=express[_0xf7c8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf7c8('0x6'));var config=require(_0xf7c8('0x7'));var controller=require('./crmNation.controller');router[_0xf7c8('0x8')]('/',auth[_0xf7c8('0x9')](),controller[_0xf7c8('0xa')]);router[_0xf7c8('0x8')](_0xf7c8('0xb'),auth['isAuthenticated'](),controller[_0xf7c8('0xc')]);router[_0xf7c8('0xd')]('/',auth[_0xf7c8('0x9')](),controller[_0xf7c8('0xe')]);module[_0xf7c8('0xf')]=router; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.attributes.js b/server/api/crmTask/crmTask.attributes.js index d339a63..a029173 100644 --- a/server/api/crmTask/crmTask.attributes.js +++ b/server/api/crmTask/crmTask.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe811=['name','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe811,0x1a8));var _0x1e81=function(_0x175e61,_0x3f505b){_0x175e61=_0x175e61-0x0;var _0x54c24c=_0xe811[_0x175e61];return _0x54c24c;};'use strict';var Sequelize=require(_0x1e81('0x0'));module[_0x1e81('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1e81('0x2')}}; \ No newline at end of file +var _0x3a82=['STRING','name','sequelize','exports'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3a82,0x166));var _0x23a8=function(_0x386e54,_0x2a9ccc){_0x386e54=_0x386e54-0x0;var _0x5722f2=_0x3a82[_0x386e54];return _0x5722f2;};'use strict';var Sequelize=require(_0x23a8('0x0'));module[_0x23a8('0x1')]={'name':{'type':Sequelize[_0x23a8('0x2')],'allowNull':![],'unique':_0x23a8('0x3')}}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.controller.js b/server/api/crmTask/crmTask.controller.js index 95d1f68..188748e 100644 --- a/server/api/crmTask/crmTask.controller.js +++ b/server/api/crmTask/crmTask.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c6d=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','CrmTask','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','model','query'];(function(_0x299d36,_0x29a243){var _0x3ea12a=function(_0x2968c2){while(--_0x2968c2){_0x299d36['push'](_0x299d36['shift']());}};_0x3ea12a(++_0x29a243);}(_0x7c6d,0x1c8));var _0xd7c6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7c6d[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd7c6('0x0'));var rimraf=require(_0xd7c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7c6('0x2'));var rp=require(_0xd7c6('0x3'));var moment=require(_0xd7c6('0x4'));var BPromise=require(_0xd7c6('0x5'));var Mustache=require(_0xd7c6('0x6'));var util=require(_0xd7c6('0x7'));var path=require(_0xd7c6('0x8'));var sox=require(_0xd7c6('0x9'));var csv=require(_0xd7c6('0xa'));var ejs=require(_0xd7c6('0xb'));var fs=require('fs');var _=require(_0xd7c6('0xc'));var squel=require(_0xd7c6('0xd'));var crypto=require(_0xd7c6('0xe'));var jsforce=require(_0xd7c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd7c6('0xa'));var querystring=require('querystring');var Papa=require(_0xd7c6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd7c6('0x11'));var logger=require(_0xd7c6('0x12'))(_0xd7c6('0x13'));var utils=require(_0xd7c6('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x584a1e,_0x47477d){_0x47477d=_0x47477d||0xcc;return function(_0x5dcafa){if(_0x5dcafa){return _0x584a1e[_0xd7c6('0x15')](_0x47477d);}return _0x584a1e[_0xd7c6('0x16')](_0x47477d)[_0xd7c6('0x17')]();};}function respondWithResult(_0x6d0ff8,_0x5b34db){_0x5b34db=_0x5b34db||0xc8;return function(_0x435a9d){if(_0x435a9d){return _0x6d0ff8['status'](_0x5b34db)[_0xd7c6('0x18')](_0x435a9d);}};}function respondWithFilteredResult(_0x24fa68,_0x42f27c){return function(_0x48cbef){if(_0x48cbef){var _0x1fa0bc=_0x48cbef[_0xd7c6('0x19')],_0x306933=_0x42f27c[_0xd7c6('0x1a')],_0x31f6f0=_0x42f27c[_0xd7c6('0x1a')]+_0x42f27c[_0xd7c6('0x1b')],_0x2abffb;if(_0x31f6f0>=_0x1fa0bc){_0x31f6f0=_0x1fa0bc;_0x2abffb=0xc8;}else{_0x2abffb=0xce;}_0x24fa68['status'](_0x2abffb);return _0x24fa68[_0xd7c6('0x1c')]('Content-Range',_0x306933+'-'+_0x31f6f0+'/'+_0x1fa0bc)[_0xd7c6('0x18')](_0x48cbef);}return null;};}function patchUpdates(_0x531dc4){return function(_0x1c3d57){try{jsonpatch[_0xd7c6('0x1d')](_0x1c3d57,_0x531dc4,!![]);}catch(_0x410253){return BPromise[_0xd7c6('0x1e')](_0x410253);}return _0x1c3d57[_0xd7c6('0x1f')]();};}function saveUpdates(_0x14aa1b,_0x1868b0){return function(_0x5d3438){if(_0x5d3438){return _0x5d3438[_0xd7c6('0x20')](_0x14aa1b)[_0xd7c6('0x21')](function(_0x1244dc){return _0x1244dc;});}return null;};}function removeEntity(_0x3615c0,_0x1d1ba2){return function(_0x5a91d0){if(_0x5a91d0){return _0x5a91d0[_0xd7c6('0x22')]()[_0xd7c6('0x21')](function(){_0x3615c0[_0xd7c6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df69c,_0x4f7740){return function(_0x163674){if(!_0x163674){_0x3df69c[_0xd7c6('0x15')](0x194);}return _0x163674;};}function handleError(_0x40ab5e,_0x2cf3a4){_0x2cf3a4=_0x2cf3a4||0x1f4;return function(_0x32dca5){logger['error'](_0x32dca5[_0xd7c6('0x23')]);if(_0x32dca5['name']){delete _0x32dca5[_0xd7c6('0x24')];}_0x40ab5e[_0xd7c6('0x16')](_0x2cf3a4)[_0xd7c6('0x25')](_0x32dca5);};}exports['index']=function(_0x56bb8e,_0x552c19){var _0x54740b={},_0x1bdd81={},_0x1e895e={'count':0x0,'rows':[]};var _0x526697=db['CrmTask'][_0xd7c6('0x26')];_0x1bdd81[_0xd7c6('0x27')]=_['keys'](_0x526697);_0x1bdd81[_0xd7c6('0x28')]=_[_0xd7c6('0x29')](_0x56bb8e[_0xd7c6('0x28')]);_0x1bdd81['filters']=_[_0xd7c6('0x2a')](_0x1bdd81[_0xd7c6('0x27')],_0x1bdd81[_0xd7c6('0x28')]);_0x54740b[_0xd7c6('0x2b')]=_[_0xd7c6('0x2a')](_0x1bdd81[_0xd7c6('0x27')],qs[_0xd7c6('0x2c')](_0x56bb8e[_0xd7c6('0x28')][_0xd7c6('0x2c')]));_0x54740b[_0xd7c6('0x2b')]=_0x54740b[_0xd7c6('0x2b')][_0xd7c6('0x2d')]?_0x54740b[_0xd7c6('0x2b')]:_0x1bdd81[_0xd7c6('0x27')];if(!_0x56bb8e[_0xd7c6('0x28')][_0xd7c6('0x2e')](_0xd7c6('0x2f'))){_0x54740b[_0xd7c6('0x1b')]=qs['limit'](_0x56bb8e[_0xd7c6('0x28')][_0xd7c6('0x1b')]);_0x54740b[_0xd7c6('0x1a')]=qs[_0xd7c6('0x1a')](_0x56bb8e['query'][_0xd7c6('0x1a')]);}_0x54740b[_0xd7c6('0x30')]=qs[_0xd7c6('0x31')](_0x56bb8e[_0xd7c6('0x28')][_0xd7c6('0x31')]);_0x54740b['where']=qs[_0xd7c6('0x32')](_[_0xd7c6('0x33')](_0x56bb8e[_0xd7c6('0x28')],_0x1bdd81[_0xd7c6('0x32')]));if(_0x56bb8e['query'][_0xd7c6('0x34')]){_0x54740b[_0xd7c6('0x35')]=_[_0xd7c6('0x36')](_0x54740b[_0xd7c6('0x35')],{'$or':_[_0xd7c6('0x37')](_0x526697,function(_0x38468c){if(_0x38468c['type'][_0xd7c6('0x38')]!==_0xd7c6('0x39')){var _0x4fd7d5={};_0x4fd7d5[_0x38468c[_0xd7c6('0x3a')]]={'$like':'%'+_0x56bb8e['query'][_0xd7c6('0x34')]+'%'};return _0x4fd7d5;}})});}_0x54740b=_[_0xd7c6('0x36')]({},_0x54740b,_0x56bb8e[_0xd7c6('0x3b')]);var _0x23e0f7={'where':_0x54740b['where']};return db[_0xd7c6('0x3c')][_0xd7c6('0x19')](_0x23e0f7)[_0xd7c6('0x21')](function(_0x1beee6){_0x1e895e[_0xd7c6('0x19')]=_0x1beee6;if(_0x56bb8e[_0xd7c6('0x28')][_0xd7c6('0x3d')]){_0x54740b[_0xd7c6('0x3e')]=[{'all':!![]}];}return db[_0xd7c6('0x3c')][_0xd7c6('0x3f')](_0x54740b);})[_0xd7c6('0x21')](function(_0x15ef95){_0x1e895e[_0xd7c6('0x40')]=_0x15ef95;return _0x1e895e;})[_0xd7c6('0x21')](respondWithFilteredResult(_0x552c19,_0x54740b))['catch'](handleError(_0x552c19,null));};exports['show']=function(_0x1a4c18,_0x408142){var _0x288ea4={'raw':![],'where':{'id':_0x1a4c18[_0xd7c6('0x41')]['id']}},_0x12b741={};_0x12b741[_0xd7c6('0x27')]=_['keys'](db['CrmTask'][_0xd7c6('0x26')]);_0x12b741['query']=_[_0xd7c6('0x29')](_0x1a4c18[_0xd7c6('0x28')]);_0x12b741[_0xd7c6('0x32')]=_[_0xd7c6('0x2a')](_0x12b741[_0xd7c6('0x27')],_0x12b741[_0xd7c6('0x28')]);_0x288ea4[_0xd7c6('0x2b')]=_[_0xd7c6('0x2a')](_0x12b741[_0xd7c6('0x27')],qs['fields'](_0x1a4c18[_0xd7c6('0x28')][_0xd7c6('0x2c')]));_0x288ea4[_0xd7c6('0x2b')]=_0x288ea4[_0xd7c6('0x2b')][_0xd7c6('0x2d')]?_0x288ea4[_0xd7c6('0x2b')]:_0x12b741['model'];if(_0x1a4c18[_0xd7c6('0x28')][_0xd7c6('0x3d')]){_0x288ea4[_0xd7c6('0x3e')]=[{'all':!![]}];}_0x288ea4=_[_0xd7c6('0x36')]({},_0x288ea4,_0x1a4c18[_0xd7c6('0x3b')]);return db['CrmTask'][_0xd7c6('0x42')](_0x288ea4)['then'](handleEntityNotFound(_0x408142,null))[_0xd7c6('0x21')](respondWithResult(_0x408142,null))[_0xd7c6('0x43')](handleError(_0x408142,null));};exports[_0xd7c6('0x44')]=function(_0x5bd7a9,_0x3d1ebd){return db[_0xd7c6('0x3c')]['create'](_0x5bd7a9[_0xd7c6('0x45')],{})[_0xd7c6('0x21')](respondWithResult(_0x3d1ebd,0xc9))[_0xd7c6('0x43')](handleError(_0x3d1ebd,null));};exports[_0xd7c6('0x20')]=function(_0x5117b1,_0x4d3583){if(_0x5117b1[_0xd7c6('0x45')]['id']){delete _0x5117b1[_0xd7c6('0x45')]['id'];}return db['CrmTask'][_0xd7c6('0x42')]({'where':{'id':_0x5117b1[_0xd7c6('0x41')]['id']}})[_0xd7c6('0x21')](handleEntityNotFound(_0x4d3583,null))['then'](saveUpdates(_0x5117b1['body'],null))[_0xd7c6('0x21')](respondWithResult(_0x4d3583,null))[_0xd7c6('0x43')](handleError(_0x4d3583,null));};exports[_0xd7c6('0x22')]=function(_0x2c7d82,_0x2f54ba){return db[_0xd7c6('0x3c')][_0xd7c6('0x42')]({'where':{'id':_0x2c7d82[_0xd7c6('0x41')]['id']}})[_0xd7c6('0x21')](handleEntityNotFound(_0x2f54ba,null))[_0xd7c6('0x21')](removeEntity(_0x2f54ba,null))['catch'](handleError(_0x2f54ba,null));};exports[_0xd7c6('0x46')]=function(_0x162f48,_0x16d889){return db['CrmTask'][_0xd7c6('0x46')]()[_0xd7c6('0x21')](respondWithResult(_0x16d889,null))[_0xd7c6('0x43')](handleError(_0x16d889,null));}; \ No newline at end of file +var _0x2b13=['CrmTask','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options'];(function(_0x457197,_0x3ba6aa){var _0x299ff8=function(_0x13b068){while(--_0x13b068){_0x457197['push'](_0x457197['shift']());}};_0x299ff8(++_0x3ba6aa);}(_0x2b13,0x1bc));var _0x32b1=function(_0x26f7ec,_0x5707d4){_0x26f7ec=_0x26f7ec-0x0;var _0x1ba3eb=_0x2b13[_0x26f7ec];return _0x1ba3eb;};'use strict';var pdf=require(_0x32b1('0x0'));var emlformat=require(_0x32b1('0x1'));var rimraf=require(_0x32b1('0x2'));var zipdir=require(_0x32b1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b1('0x4'));var moment=require('moment');var BPromise=require(_0x32b1('0x5'));var Mustache=require(_0x32b1('0x6'));var util=require(_0x32b1('0x7'));var path=require(_0x32b1('0x8'));var sox=require(_0x32b1('0x9'));var csv=require(_0x32b1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x32b1('0xb'));var crypto=require('crypto');var jsforce=require(_0x32b1('0xc'));var deskjs=require(_0x32b1('0xd'));var toCsv=require(_0x32b1('0xa'));var querystring=require(_0x32b1('0xe'));var Papa=require(_0x32b1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x32b1('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x32b1('0x11'));var config=require('../../config/environment');var db=require(_0x32b1('0x12'))['db'];function respondWithStatusCode(_0x31dc95,_0x4c1fb9){_0x4c1fb9=_0x4c1fb9||0xcc;return function(_0x29acf9){if(_0x29acf9){return _0x31dc95[_0x32b1('0x13')](_0x4c1fb9);}return _0x31dc95[_0x32b1('0x14')](_0x4c1fb9)[_0x32b1('0x15')]();};}function respondWithResult(_0x1b2f3f,_0x1d61d1){_0x1d61d1=_0x1d61d1||0xc8;return function(_0x3f1a47){if(_0x3f1a47){return _0x1b2f3f[_0x32b1('0x14')](_0x1d61d1)[_0x32b1('0x16')](_0x3f1a47);}};}function respondWithFilteredResult(_0x1ffb39,_0x455b2b){return function(_0xc0a4f2){if(_0xc0a4f2){var _0x44bc0f=_0xc0a4f2[_0x32b1('0x17')],_0x464890=_0x455b2b[_0x32b1('0x18')],_0x472037=_0x455b2b[_0x32b1('0x18')]+_0x455b2b[_0x32b1('0x19')],_0x2002fb;if(_0x472037>=_0x44bc0f){_0x472037=_0x44bc0f;_0x2002fb=0xc8;}else{_0x2002fb=0xce;}_0x1ffb39['status'](_0x2002fb);return _0x1ffb39['set'](_0x32b1('0x1a'),_0x464890+'-'+_0x472037+'/'+_0x44bc0f)['json'](_0xc0a4f2);}return null;};}function patchUpdates(_0x248287){return function(_0x478bfe){try{jsonpatch[_0x32b1('0x1b')](_0x478bfe,_0x248287,!![]);}catch(_0x1b70b3){return BPromise[_0x32b1('0x1c')](_0x1b70b3);}return _0x478bfe[_0x32b1('0x1d')]();};}function saveUpdates(_0x1dcf5d,_0x3ff99e){return function(_0x38c9c7){if(_0x38c9c7){return _0x38c9c7[_0x32b1('0x1e')](_0x1dcf5d)[_0x32b1('0x1f')](function(_0xb7bae4){return _0xb7bae4;});}return null;};}function removeEntity(_0x124edf,_0x2e7c15){return function(_0x43d510){if(_0x43d510){return _0x43d510[_0x32b1('0x20')]()[_0x32b1('0x1f')](function(){_0x124edf['status'](0xcc)[_0x32b1('0x15')]();});}};}function handleEntityNotFound(_0x11c1f5,_0x43bafe){return function(_0xc8a71a){if(!_0xc8a71a){_0x11c1f5[_0x32b1('0x13')](0x194);}return _0xc8a71a;};}function handleError(_0x26815f,_0x3c4490){_0x3c4490=_0x3c4490||0x1f4;return function(_0x23f04d){logger[_0x32b1('0x21')](_0x23f04d[_0x32b1('0x22')]);if(_0x23f04d[_0x32b1('0x23')]){delete _0x23f04d[_0x32b1('0x23')];}_0x26815f[_0x32b1('0x14')](_0x3c4490)[_0x32b1('0x24')](_0x23f04d);};}exports[_0x32b1('0x25')]=function(_0x2bec57,_0x2f335b){var _0x5e1e0a={},_0x54d796={},_0x49ec2a={'count':0x0,'rows':[]};var _0x1da9e7=db['CrmTask'][_0x32b1('0x26')];_0x54d796['model']=_[_0x32b1('0x27')](_0x1da9e7);_0x54d796[_0x32b1('0x28')]=_['keys'](_0x2bec57['query']);_0x54d796[_0x32b1('0x29')]=_[_0x32b1('0x2a')](_0x54d796[_0x32b1('0x2b')],_0x54d796[_0x32b1('0x28')]);_0x5e1e0a[_0x32b1('0x2c')]=_[_0x32b1('0x2a')](_0x54d796[_0x32b1('0x2b')],qs[_0x32b1('0x2d')](_0x2bec57[_0x32b1('0x28')][_0x32b1('0x2d')]));_0x5e1e0a[_0x32b1('0x2c')]=_0x5e1e0a[_0x32b1('0x2c')][_0x32b1('0x2e')]?_0x5e1e0a[_0x32b1('0x2c')]:_0x54d796[_0x32b1('0x2b')];if(!_0x2bec57[_0x32b1('0x28')][_0x32b1('0x2f')](_0x32b1('0x30'))){_0x5e1e0a[_0x32b1('0x19')]=qs[_0x32b1('0x19')](_0x2bec57[_0x32b1('0x28')][_0x32b1('0x19')]);_0x5e1e0a[_0x32b1('0x18')]=qs[_0x32b1('0x18')](_0x2bec57[_0x32b1('0x28')][_0x32b1('0x18')]);}_0x5e1e0a[_0x32b1('0x31')]=qs[_0x32b1('0x32')](_0x2bec57['query']['sort']);_0x5e1e0a[_0x32b1('0x33')]=qs[_0x32b1('0x29')](_[_0x32b1('0x34')](_0x2bec57[_0x32b1('0x28')],_0x54d796[_0x32b1('0x29')]));if(_0x2bec57['query'][_0x32b1('0x35')]){_0x5e1e0a[_0x32b1('0x33')]=_['merge'](_0x5e1e0a[_0x32b1('0x33')],{'$or':_[_0x32b1('0x36')](_0x1da9e7,function(_0x32849f){if(_0x32849f[_0x32b1('0x37')]['key']!==_0x32b1('0x38')){var _0xf1732b={};_0xf1732b[_0x32849f[_0x32b1('0x39')]]={'$like':'%'+_0x2bec57[_0x32b1('0x28')]['filter']+'%'};return _0xf1732b;}})});}_0x5e1e0a=_[_0x32b1('0x3a')]({},_0x5e1e0a,_0x2bec57[_0x32b1('0x3b')]);var _0x2532db={'where':_0x5e1e0a['where']};return db[_0x32b1('0x3c')][_0x32b1('0x17')](_0x2532db)[_0x32b1('0x1f')](function(_0x303313){_0x49ec2a['count']=_0x303313;if(_0x2bec57[_0x32b1('0x28')][_0x32b1('0x3d')]){_0x5e1e0a[_0x32b1('0x3e')]=[{'all':!![]}];}return db['CrmTask'][_0x32b1('0x3f')](_0x5e1e0a);})[_0x32b1('0x1f')](function(_0x325ffd){_0x49ec2a[_0x32b1('0x40')]=_0x325ffd;return _0x49ec2a;})[_0x32b1('0x1f')](respondWithFilteredResult(_0x2f335b,_0x5e1e0a))[_0x32b1('0x41')](handleError(_0x2f335b,null));};exports[_0x32b1('0x42')]=function(_0x29ec68,_0x1c01e1){var _0x3ba62f={'raw':![],'where':{'id':_0x29ec68[_0x32b1('0x43')]['id']}},_0x20162b={};_0x20162b[_0x32b1('0x2b')]=_[_0x32b1('0x27')](db[_0x32b1('0x3c')]['rawAttributes']);_0x20162b[_0x32b1('0x28')]=_['keys'](_0x29ec68[_0x32b1('0x28')]);_0x20162b['filters']=_[_0x32b1('0x2a')](_0x20162b['model'],_0x20162b[_0x32b1('0x28')]);_0x3ba62f[_0x32b1('0x2c')]=_[_0x32b1('0x2a')](_0x20162b['model'],qs['fields'](_0x29ec68[_0x32b1('0x28')]['fields']));_0x3ba62f[_0x32b1('0x2c')]=_0x3ba62f['attributes'][_0x32b1('0x2e')]?_0x3ba62f[_0x32b1('0x2c')]:_0x20162b['model'];if(_0x29ec68['query']['includeAll']){_0x3ba62f[_0x32b1('0x3e')]=[{'all':!![]}];}_0x3ba62f=_[_0x32b1('0x3a')]({},_0x3ba62f,_0x29ec68[_0x32b1('0x3b')]);return db[_0x32b1('0x3c')][_0x32b1('0x44')](_0x3ba62f)[_0x32b1('0x1f')](handleEntityNotFound(_0x1c01e1,null))[_0x32b1('0x1f')](respondWithResult(_0x1c01e1,null))[_0x32b1('0x41')](handleError(_0x1c01e1,null));};exports[_0x32b1('0x45')]=function(_0x5394ed,_0x49157a){return db[_0x32b1('0x3c')]['create'](_0x5394ed[_0x32b1('0x46')],{})['then'](respondWithResult(_0x49157a,0xc9))[_0x32b1('0x41')](handleError(_0x49157a,null));};exports[_0x32b1('0x1e')]=function(_0x458af4,_0x229763){if(_0x458af4['body']['id']){delete _0x458af4['body']['id'];}return db[_0x32b1('0x3c')][_0x32b1('0x44')]({'where':{'id':_0x458af4['params']['id']}})['then'](handleEntityNotFound(_0x229763,null))[_0x32b1('0x1f')](saveUpdates(_0x458af4[_0x32b1('0x46')],null))['then'](respondWithResult(_0x229763,null))[_0x32b1('0x41')](handleError(_0x229763,null));};exports[_0x32b1('0x20')]=function(_0x2807b9,_0x51eb13){return db[_0x32b1('0x3c')][_0x32b1('0x44')]({'where':{'id':_0x2807b9[_0x32b1('0x43')]['id']}})[_0x32b1('0x1f')](handleEntityNotFound(_0x51eb13,null))[_0x32b1('0x1f')](removeEntity(_0x51eb13,null))[_0x32b1('0x41')](handleError(_0x51eb13,null));};exports[_0x32b1('0x47')]=function(_0x154c2e,_0x31177f){return db[_0x32b1('0x3c')][_0x32b1('0x47')]()[_0x32b1('0x1f')](respondWithResult(_0x31177f,null))[_0x32b1('0x41')](handleError(_0x31177f,null));}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.model.js b/server/api/crmTask/crmTask.model.js index a385dc9..5189946 100644 --- a/server/api/crmTask/crmTask.model.js +++ b/server/api/crmTask/crmTask.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['path','rimraf','./crmTask.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf339,_0x15d06f){var _0xabc1d1=function(_0x4489c0){while(--_0x4489c0){_0xf339['push'](_0xf339['shift']());}};_0xabc1d1(++_0x15d06f);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xb4e6[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('CrmTask',attributes,{'tableName':'crm_tasks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x153f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./crmTask.attributes','exports','define','crm_tasks','lodash'];(function(_0x2afdd1,_0x3347a7){var _0x247c9b=function(_0x1c5445){while(--_0x1c5445){_0x2afdd1['push'](_0x2afdd1['shift']());}};_0x247c9b(++_0x3347a7);}(_0x153f,0x15b));var _0xf153=function(_0x3461f7,_0x1edcf3){_0x3461f7=_0x3461f7-0x0;var _0x13fafd=_0x153f[_0x3461f7];return _0x13fafd;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf153('0x7'));var config=require('../../config/environment');var attributes=require(_0xf153('0x8'));module[_0xf153('0x9')]=function(_0x342a45,_0xafd987){return _0x342a45[_0xf153('0xa')]('CrmTask',attributes,{'tableName':_0xf153('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.rpc.js b/server/api/crmTask/crmTask.rpc.js index 8c923fe..1dcd53e 100644 --- a/server/api/crmTask/crmTask.rpc.js +++ b/server/api/crmTask/crmTask.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8b6=['message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CrmTask,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x385603,_0x1cf762){var _0x2e10ca=function(_0x1824c0){while(--_0x1824c0){_0x385603['push'](_0x385603['shift']());}};_0x2e10ca(++_0x1cf762);}(_0xa8b6,0x167));var _0x6a8b=function(_0x5e5873,_0x4af95b){_0x5e5873=_0x5e5873-0x0;var _0x296bba=_0xa8b6[_0x5e5873];return _0x296bba;};'use strict';var _=require(_0x6a8b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6a8b('0x1'));var rs=require(_0x6a8b('0x2'));var fs=require('fs');var Redis=require(_0x6a8b('0x3'));var db=require(_0x6a8b('0x4'))['db'];var utils=require(_0x6a8b('0x5'));var logger=require(_0x6a8b('0x6'))(_0x6a8b('0x7'));var config=require(_0x6a8b('0x8'));var jayson=require(_0x6a8b('0x9'));var client=jayson[_0x6a8b('0xa')][_0x6a8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc874fa,_0x1f0e82,_0x3b0d34){return new BPromise(function(_0x4c469e,_0x39493d){return client[_0x6a8b('0xc')](_0xc874fa,_0x3b0d34)[_0x6a8b('0xd')](function(_0x4c6513){logger[_0x6a8b('0xe')](_0x6a8b('0xf'),_0x1f0e82,_0x6a8b('0x10'));logger['debug']('CrmTask,\x20%s,\x20%s,\x20%s',_0x1f0e82,'request\x20sent',JSON[_0x6a8b('0x11')](_0x4c6513));if(_0x4c6513[_0x6a8b('0x12')]){if(_0x4c6513[_0x6a8b('0x12')]['code']===0x1f4){logger['error'](_0x6a8b('0xf'),_0x1f0e82,_0x4c6513[_0x6a8b('0x12')][_0x6a8b('0x13')]);return _0x39493d(_0x4c6513[_0x6a8b('0x12')][_0x6a8b('0x13')]);}logger[_0x6a8b('0x12')](_0x6a8b('0xf'),_0x1f0e82,_0x4c6513[_0x6a8b('0x12')][_0x6a8b('0x13')]);return _0x4c469e(_0x4c6513[_0x6a8b('0x12')][_0x6a8b('0x13')]);}else{logger[_0x6a8b('0xe')](_0x6a8b('0xf'),_0x1f0e82,_0x6a8b('0x10'));_0x4c469e(_0x4c6513['result']['message']);}})[_0x6a8b('0x14')](function(_0x36e081){logger[_0x6a8b('0x12')](_0x6a8b('0xf'),_0x1f0e82,_0x36e081);_0x39493d(_0x36e081);});});} \ No newline at end of file +var _0x79fb=['then','CrmTask,\x20%s,\x20%s','request\x20sent','debug','CrmTask,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3b9d79,_0x42f721){var _0x16d93e=function(_0x15d370){while(--_0x15d370){_0x3b9d79['push'](_0x3b9d79['shift']());}};_0x16d93e(++_0x42f721);}(_0x79fb,0x11f));var _0xb79f=function(_0x497f9c,_0x313e47){_0x497f9c=_0x497f9c-0x0;var _0x9ab1bd=_0x79fb[_0x497f9c];return _0x9ab1bd;};'use strict';var _=require(_0xb79f('0x0'));var util=require(_0xb79f('0x1'));var moment=require(_0xb79f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb79f('0x3'));var fs=require('fs');var Redis=require(_0xb79f('0x4'));var db=require(_0xb79f('0x5'))['db'];var utils=require(_0xb79f('0x6'));var logger=require('../../config/logger')(_0xb79f('0x7'));var config=require(_0xb79f('0x8'));var jayson=require(_0xb79f('0x9'));var client=jayson[_0xb79f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x146eb4,_0x4d1c9f,_0x1e6ea1){return new BPromise(function(_0x14438b,_0x7e7bba){return client[_0xb79f('0xb')](_0x146eb4,_0x1e6ea1)[_0xb79f('0xc')](function(_0x1a3e4b){logger['info'](_0xb79f('0xd'),_0x4d1c9f,_0xb79f('0xe'));logger[_0xb79f('0xf')](_0xb79f('0x10'),_0x4d1c9f,'request\x20sent',JSON['stringify'](_0x1a3e4b));if(_0x1a3e4b['error']){if(_0x1a3e4b[_0xb79f('0x11')][_0xb79f('0x12')]===0x1f4){logger[_0xb79f('0x11')](_0xb79f('0xd'),_0x4d1c9f,_0x1a3e4b[_0xb79f('0x11')][_0xb79f('0x13')]);return _0x7e7bba(_0x1a3e4b[_0xb79f('0x11')]['message']);}logger[_0xb79f('0x11')](_0xb79f('0xd'),_0x4d1c9f,_0x1a3e4b[_0xb79f('0x11')][_0xb79f('0x13')]);return _0x14438b(_0x1a3e4b[_0xb79f('0x11')][_0xb79f('0x13')]);}else{logger[_0xb79f('0x14')](_0xb79f('0xd'),_0x4d1c9f,'request\x20sent');_0x14438b(_0x1a3e4b[_0xb79f('0x15')][_0xb79f('0x13')]);}})[_0xb79f('0x16')](function(_0x124aba){logger[_0xb79f('0x11')](_0xb79f('0xd'),_0x4d1c9f,_0x124aba);_0x7e7bba(_0x124aba);});});} \ No newline at end of file diff --git a/server/api/crmTask/index.js b/server/api/crmTask/index.js index 9d3dfbf..f9c3f91 100644 --- a/server/api/crmTask/index.js +++ b/server/api/crmTask/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d94=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./crmTask.controller','isAuthenticated','get','/describe','post','create','put','/:id','update','delete'];(function(_0x4f0a90,_0x482c40){var _0x4bafa6=function(_0xf9cc43){while(--_0xf9cc43){_0x4f0a90['push'](_0x4f0a90['shift']());}};_0x4bafa6(++_0x482c40);}(_0x9d94,0x1d4));var _0x49d9=function(_0x56748d,_0x596ca7){_0x56748d=_0x56748d-0x0;var _0x1b8b66=_0x9d94[_0x56748d];return _0x1b8b66;};'use strict';var multer=require(_0x49d9('0x0'));var util=require(_0x49d9('0x1'));var path=require(_0x49d9('0x2'));var timeout=require(_0x49d9('0x3'));var express=require(_0x49d9('0x4'));var router=express[_0x49d9('0x5')]();var auth=require(_0x49d9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x49d9('0x7'));var controller=require(_0x49d9('0x8'));router['get']('/',auth[_0x49d9('0x9')](),controller['index']);router[_0x49d9('0xa')](_0x49d9('0xb'),auth[_0x49d9('0x9')](),controller['describe']);router['get']('/:id',auth[_0x49d9('0x9')](),controller['show']);router[_0x49d9('0xc')]('/',auth[_0x49d9('0x9')](),controller[_0x49d9('0xd')]);router[_0x49d9('0xe')](_0x49d9('0xf'),auth['isAuthenticated'](),controller[_0x49d9('0x10')]);router[_0x49d9('0x11')](_0x49d9('0xf'),auth[_0x49d9('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbf8c=['update','delete','/:id','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./crmTask.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x6cab1b,_0x5a2613){var _0x25ff70=function(_0x29242c){while(--_0x29242c){_0x6cab1b['push'](_0x6cab1b['shift']());}};_0x25ff70(++_0x5a2613);}(_0xbf8c,0x108));var _0xcbf8=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xbf8c[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require(_0xcbf8('0x0'));var util=require('util');var path=require(_0xcbf8('0x1'));var timeout=require(_0xcbf8('0x2'));var express=require(_0xcbf8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcbf8('0x4'));var config=require(_0xcbf8('0x5'));var controller=require(_0xcbf8('0x6'));router[_0xcbf8('0x7')]('/',auth[_0xcbf8('0x8')](),controller[_0xcbf8('0x9')]);router[_0xcbf8('0x7')](_0xcbf8('0xa'),auth[_0xcbf8('0x8')](),controller[_0xcbf8('0xb')]);router[_0xcbf8('0x7')]('/:id',auth[_0xcbf8('0x8')](),controller[_0xcbf8('0xc')]);router[_0xcbf8('0xd')]('/',auth[_0xcbf8('0x8')](),controller[_0xcbf8('0xe')]);router[_0xcbf8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcbf8('0x10')]);router[_0xcbf8('0x11')](_0xcbf8('0x12'),auth[_0xcbf8('0x8')](),controller['destroy']);module[_0xcbf8('0x13')]=router; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.attributes.js b/server/api/crmWorkflow/crmWorkflow.attributes.js index 5a05e5c..816fea6 100644 --- a/server/api/crmWorkflow/crmWorkflow.attributes.js +++ b/server/api/crmWorkflow/crmWorkflow.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5e1=['CRM','SalesAid','Free','sequelize','exports','STRING','name','ENUM'];(function(_0x358bf3,_0x40ec1f){var _0x248106=function(_0x2eb1f3){while(--_0x2eb1f3){_0x358bf3['push'](_0x358bf3['shift']());}};_0x248106(++_0x40ec1f);}(_0xe5e1,0x163));var _0x1e5e=function(_0x3044d5,_0x1ab3dd){_0x3044d5=_0x3044d5-0x0;var _0x1a8b07=_0xe5e1[_0x3044d5];return _0x1a8b07;};'use strict';var Sequelize=require(_0x1e5e('0x0'));module[_0x1e5e('0x1')]={'name':{'type':Sequelize[_0x1e5e('0x2')],'allowNull':![],'unique':_0x1e5e('0x3')},'type':{'type':Sequelize[_0x1e5e('0x4')](_0x1e5e('0x5'),_0x1e5e('0x6'),_0x1e5e('0x7')),'allowNull':![]}}; \ No newline at end of file +var _0xc78d=['STRING','ENUM','CRM','SalesAid','Free','sequelize','exports'];(function(_0x225411,_0x2ed4e1){var _0x52682f=function(_0x59e824){while(--_0x59e824){_0x225411['push'](_0x225411['shift']());}};_0x52682f(++_0x2ed4e1);}(_0xc78d,0x1be));var _0xdc78=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc78d[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xdc78('0x0'));module[_0xdc78('0x1')]={'name':{'type':Sequelize[_0xdc78('0x2')],'allowNull':![],'unique':'name'},'type':{'type':Sequelize[_0xdc78('0x3')](_0xdc78('0x4'),_0xdc78('0x5'),_0xdc78('0x6')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.controller.js b/server/api/crmWorkflow/crmWorkflow.controller.js index 533caeb..5ec0239 100644 --- a/server/api/crmWorkflow/crmWorkflow.controller.js +++ b/server/api/crmWorkflow/crmWorkflow.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x490c=['create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','CrmWorkflowStep','CrmActionsList','CrmWorkflowNextStep','CrmWorkflow','rows','catch','show','params','keys'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x490c,0x138));var _0xc490=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x490c[_0x1fafa5];return _0xcf08c9;};'use strict';var pdf=require(_0xc490('0x0'));var emlformat=require(_0xc490('0x1'));var rimraf=require(_0xc490('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc490('0x3'));var rp=require(_0xc490('0x4'));var moment=require(_0xc490('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc490('0x6'));var util=require('util');var path=require(_0xc490('0x7'));var sox=require('sox');var csv=require(_0xc490('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc490('0x9'));var squel=require(_0xc490('0xa'));var crypto=require('crypto');var jsforce=require(_0xc490('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc490('0x8'));var querystring=require(_0xc490('0xc'));var Papa=require(_0xc490('0xd'));var Redis=require(_0xc490('0xe'));var authService=require(_0xc490('0xf'));var qs=require(_0xc490('0x10'));var hardwareService=require(_0xc490('0x11'));var logger=require(_0xc490('0x12'))(_0xc490('0x13'));var utils=require('../../config/utils');var config=require(_0xc490('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22053a,_0x772b33){_0x772b33=_0x772b33||0xcc;return function(_0x1b7a5a){if(_0x1b7a5a){return _0x22053a['sendStatus'](_0x772b33);}return _0x22053a[_0xc490('0x15')](_0x772b33)[_0xc490('0x16')]();};}function respondWithResult(_0x84f2c0,_0x1f4056){_0x1f4056=_0x1f4056||0xc8;return function(_0x380286){if(_0x380286){return _0x84f2c0[_0xc490('0x15')](_0x1f4056)['json'](_0x380286);}};}function respondWithFilteredResult(_0xc3af1f,_0x183b8a){return function(_0x410cb9){if(_0x410cb9){var _0x5da06e=_0x410cb9[_0xc490('0x17')],_0x28d498=_0x183b8a[_0xc490('0x18')],_0x4e561c=_0x183b8a[_0xc490('0x18')]+_0x183b8a['limit'],_0x2c210d;if(_0x4e561c>=_0x5da06e){_0x4e561c=_0x5da06e;_0x2c210d=0xc8;}else{_0x2c210d=0xce;}_0xc3af1f[_0xc490('0x15')](_0x2c210d);return _0xc3af1f[_0xc490('0x19')](_0xc490('0x1a'),_0x28d498+'-'+_0x4e561c+'/'+_0x5da06e)[_0xc490('0x1b')](_0x410cb9);}return null;};}function patchUpdates(_0x46d8e9){return function(_0x3aa915){try{jsonpatch[_0xc490('0x1c')](_0x3aa915,_0x46d8e9,!![]);}catch(_0x52ce76){return BPromise[_0xc490('0x1d')](_0x52ce76);}return _0x3aa915[_0xc490('0x1e')]();};}function saveUpdates(_0x1632ad,_0x685bde){return function(_0x560c83){if(_0x560c83){return _0x560c83[_0xc490('0x1f')](_0x1632ad)[_0xc490('0x20')](function(_0x734c76){return _0x734c76;});}return null;};}function removeEntity(_0xf2ef5f,_0x13aade){return function(_0x27b4a0){if(_0x27b4a0){return _0x27b4a0[_0xc490('0x21')]()['then'](function(){_0xf2ef5f['status'](0xcc)[_0xc490('0x16')]();});}};}function handleEntityNotFound(_0x3d1827,_0x1716f6){return function(_0x23d31d){if(!_0x23d31d){_0x3d1827[_0xc490('0x22')](0x194);}return _0x23d31d;};}function handleError(_0x3103e7,_0x891a8a){_0x891a8a=_0x891a8a||0x1f4;return function(_0x387b82){logger[_0xc490('0x23')](_0x387b82[_0xc490('0x24')]);if(_0x387b82[_0xc490('0x25')]){delete _0x387b82['name'];}_0x3103e7[_0xc490('0x15')](_0x891a8a)[_0xc490('0x26')](_0x387b82);};}exports[_0xc490('0x27')]=function(_0x2332a0,_0x2bbd6a){var _0x5e4292={},_0x22b0a4={},_0x3a5306={'count':0x0,'rows':[]};var _0x4ec44d=db['CrmWorkflow'][_0xc490('0x28')];_0x22b0a4[_0xc490('0x29')]=_['keys'](_0x4ec44d);_0x22b0a4[_0xc490('0x2a')]=_['keys'](_0x2332a0[_0xc490('0x2a')]);_0x22b0a4['filters']=_[_0xc490('0x2b')](_0x22b0a4['model'],_0x22b0a4[_0xc490('0x2a')]);_0x5e4292[_0xc490('0x2c')]=_[_0xc490('0x2b')](_0x22b0a4[_0xc490('0x29')],qs[_0xc490('0x2d')](_0x2332a0['query']['fields']));_0x5e4292['attributes']=_0x5e4292[_0xc490('0x2c')][_0xc490('0x2e')]?_0x5e4292[_0xc490('0x2c')]:_0x22b0a4['model'];if(!_0x2332a0[_0xc490('0x2a')][_0xc490('0x2f')](_0xc490('0x30'))){_0x5e4292[_0xc490('0x31')]=qs[_0xc490('0x31')](_0x2332a0['query']['limit']);_0x5e4292[_0xc490('0x18')]=qs[_0xc490('0x18')](_0x2332a0[_0xc490('0x2a')][_0xc490('0x18')]);}_0x5e4292[_0xc490('0x32')]=qs[_0xc490('0x33')](_0x2332a0['query'][_0xc490('0x33')]);_0x5e4292[_0xc490('0x34')]=qs[_0xc490('0x35')](_[_0xc490('0x36')](_0x2332a0['query'],_0x22b0a4[_0xc490('0x35')]));if(_0x2332a0[_0xc490('0x2a')][_0xc490('0x37')]){_0x5e4292[_0xc490('0x34')]=_[_0xc490('0x38')](_0x5e4292[_0xc490('0x34')],{'$or':_['map'](_0x4ec44d,function(_0x4a10d8){if(_0x4a10d8[_0xc490('0x39')][_0xc490('0x3a')]!==_0xc490('0x3b')){var _0x297618={};_0x297618[_0x4a10d8[_0xc490('0x3c')]]={'$like':'%'+_0x2332a0[_0xc490('0x2a')][_0xc490('0x37')]+'%'};return _0x297618;}})});}_0x5e4292=_[_0xc490('0x38')]({},_0x5e4292,_0x2332a0[_0xc490('0x3d')]);var _0x255eeb={'where':_0x5e4292[_0xc490('0x34')]};return db['CrmWorkflow'][_0xc490('0x17')](_0x255eeb)[_0xc490('0x20')](function(_0xaff897){_0x3a5306[_0xc490('0x17')]=_0xaff897;if(_0x2332a0['query'][_0xc490('0x3e')]){_0x5e4292[_0xc490('0x3f')]=[{'model':db[_0xc490('0x40')],'include':[{'model':db['CrmTask'],'include':[{'model':db[_0xc490('0x41')]}]},{'model':db[_0xc490('0x40')],'as':_0xc490('0x42'),'through':{'attributes':[]}}]}];}return db[_0xc490('0x43')]['findAll'](_0x5e4292);})['then'](function(_0x9b5a1a){_0x3a5306[_0xc490('0x44')]=_0x9b5a1a;return _0x3a5306;})[_0xc490('0x20')](respondWithFilteredResult(_0x2bbd6a,_0x5e4292))[_0xc490('0x45')](handleError(_0x2bbd6a,null));};exports[_0xc490('0x46')]=function(_0x4f4d36,_0x5cfe60){var _0x33562b={'raw':![],'where':{'id':_0x4f4d36[_0xc490('0x47')]['id']}},_0x1acbd8={};_0x1acbd8[_0xc490('0x29')]=_[_0xc490('0x48')](db[_0xc490('0x43')]['rawAttributes']);_0x1acbd8[_0xc490('0x2a')]=_[_0xc490('0x48')](_0x4f4d36[_0xc490('0x2a')]);_0x1acbd8[_0xc490('0x35')]=_[_0xc490('0x2b')](_0x1acbd8[_0xc490('0x29')],_0x1acbd8[_0xc490('0x2a')]);_0x33562b[_0xc490('0x2c')]=_[_0xc490('0x2b')](_0x1acbd8[_0xc490('0x29')],qs[_0xc490('0x2d')](_0x4f4d36[_0xc490('0x2a')][_0xc490('0x2d')]));_0x33562b[_0xc490('0x2c')]=_0x33562b['attributes'][_0xc490('0x2e')]?_0x33562b['attributes']:_0x1acbd8[_0xc490('0x29')];if(_0x4f4d36[_0xc490('0x2a')][_0xc490('0x3e')]){_0x33562b[_0xc490('0x3f')]=[{'all':!![]}];}_0x33562b=_[_0xc490('0x38')]({},_0x33562b,_0x4f4d36[_0xc490('0x3d')]);return db[_0xc490('0x43')]['find'](_0x33562b)[_0xc490('0x20')](handleEntityNotFound(_0x5cfe60,null))[_0xc490('0x20')](respondWithResult(_0x5cfe60,null))['catch'](handleError(_0x5cfe60,null));};exports[_0xc490('0x49')]=function(_0x156f44,_0x53d83a){return db[_0xc490('0x43')]['create'](_0x156f44['body'],{})[_0xc490('0x20')](respondWithResult(_0x53d83a,0xc9))[_0xc490('0x45')](handleError(_0x53d83a,null));};exports['update']=function(_0x226214,_0x58706d){if(_0x226214['body']['id']){delete _0x226214[_0xc490('0x4a')]['id'];}return db[_0xc490('0x43')][_0xc490('0x4b')]({'where':{'id':_0x226214[_0xc490('0x47')]['id']}})['then'](handleEntityNotFound(_0x58706d,null))[_0xc490('0x20')](saveUpdates(_0x226214[_0xc490('0x4a')],null))[_0xc490('0x20')](respondWithResult(_0x58706d,null))[_0xc490('0x45')](handleError(_0x58706d,null));};exports[_0xc490('0x21')]=function(_0x4ff8b8,_0x125a71){return db[_0xc490('0x43')][_0xc490('0x4b')]({'where':{'id':_0x4ff8b8['params']['id']}})['then'](handleEntityNotFound(_0x125a71,null))[_0xc490('0x20')](removeEntity(_0x125a71,null))[_0xc490('0x45')](handleError(_0x125a71,null));};exports[_0xc490('0x4c')]=function(_0x54bb31,_0x46966f){return db[_0xc490('0x43')]['describe']()[_0xc490('0x20')](respondWithResult(_0x46966f,null))[_0xc490('0x45')](handleError(_0x46966f,null));}; \ No newline at end of file +var _0x95d4=['field','options','count','includeAll','CrmWorkflowStep','CrmTask','CrmWorkflowNextStep','rows','catch','show','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','status','error','name','send','index','CrmWorkflow','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL'];(function(_0x4bcc37,_0x377c8d){var _0x2b2308=function(_0x517d67){while(--_0x517d67){_0x4bcc37['push'](_0x4bcc37['shift']());}};_0x2b2308(++_0x377c8d);}(_0x95d4,0xf7));var _0x495d=function(_0x53c96,_0x1e1e11){_0x53c96=_0x53c96-0x0;var _0x3a22d2=_0x95d4[_0x53c96];return _0x3a22d2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x495d('0x0'));var zipdir=require(_0x495d('0x1'));var jsonpatch=require(_0x495d('0x2'));var rp=require(_0x495d('0x3'));var moment=require(_0x495d('0x4'));var BPromise=require(_0x495d('0x5'));var Mustache=require(_0x495d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x495d('0x7'));var csv=require(_0x495d('0x8'));var ejs=require(_0x495d('0x9'));var fs=require('fs');var _=require(_0x495d('0xa'));var squel=require(_0x495d('0xb'));var crypto=require(_0x495d('0xc'));var jsforce=require(_0x495d('0xd'));var deskjs=require(_0x495d('0xe'));var toCsv=require(_0x495d('0x8'));var querystring=require(_0x495d('0xf'));var Papa=require(_0x495d('0x10'));var Redis=require(_0x495d('0x11'));var authService=require(_0x495d('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x495d('0x13'));var logger=require('../../config/logger')(_0x495d('0x14'));var utils=require(_0x495d('0x15'));var config=require('../../config/environment');var db=require(_0x495d('0x16'))['db'];function respondWithStatusCode(_0x2cfb74,_0x4f35f7){_0x4f35f7=_0x4f35f7||0xcc;return function(_0x4d204c){if(_0x4d204c){return _0x2cfb74[_0x495d('0x17')](_0x4f35f7);}return _0x2cfb74['status'](_0x4f35f7)[_0x495d('0x18')]();};}function respondWithResult(_0x4606a1,_0x3cfae5){_0x3cfae5=_0x3cfae5||0xc8;return function(_0x26663a){if(_0x26663a){return _0x4606a1['status'](_0x3cfae5)['json'](_0x26663a);}};}function respondWithFilteredResult(_0x42e88d,_0x9b1482){return function(_0x43e975){if(_0x43e975){var _0x49957e=_0x43e975['count'],_0x48211a=_0x9b1482['offset'],_0x567c2b=_0x9b1482[_0x495d('0x19')]+_0x9b1482[_0x495d('0x1a')],_0x30882c;if(_0x567c2b>=_0x49957e){_0x567c2b=_0x49957e;_0x30882c=0xc8;}else{_0x30882c=0xce;}_0x42e88d['status'](_0x30882c);return _0x42e88d[_0x495d('0x1b')](_0x495d('0x1c'),_0x48211a+'-'+_0x567c2b+'/'+_0x49957e)[_0x495d('0x1d')](_0x43e975);}return null;};}function patchUpdates(_0xc4b59a){return function(_0x1974fe){try{jsonpatch[_0x495d('0x1e')](_0x1974fe,_0xc4b59a,!![]);}catch(_0x752ffd){return BPromise[_0x495d('0x1f')](_0x752ffd);}return _0x1974fe[_0x495d('0x20')]();};}function saveUpdates(_0x123b25,_0xe324d6){return function(_0x3bf216){if(_0x3bf216){return _0x3bf216[_0x495d('0x21')](_0x123b25)['then'](function(_0x1d74b6){return _0x1d74b6;});}return null;};}function removeEntity(_0xd945bd,_0x200d4b){return function(_0x3e8539){if(_0x3e8539){return _0x3e8539[_0x495d('0x22')]()[_0x495d('0x23')](function(){_0xd945bd[_0x495d('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a86e,_0x526a9a){return function(_0x2e9ef9){if(!_0x2e9ef9){_0x41a86e[_0x495d('0x17')](0x194);}return _0x2e9ef9;};}function handleError(_0x303395,_0x175eab){_0x175eab=_0x175eab||0x1f4;return function(_0x507ac6){logger[_0x495d('0x25')](_0x507ac6['stack']);if(_0x507ac6[_0x495d('0x26')]){delete _0x507ac6[_0x495d('0x26')];}_0x303395[_0x495d('0x24')](_0x175eab)[_0x495d('0x27')](_0x507ac6);};}exports[_0x495d('0x28')]=function(_0x9683eb,_0x445812){var _0x310e9c={},_0x20bb9d={},_0x49acea={'count':0x0,'rows':[]};var _0x4e258e=db[_0x495d('0x29')][_0x495d('0x2a')];_0x20bb9d['model']=_[_0x495d('0x2b')](_0x4e258e);_0x20bb9d['query']=_['keys'](_0x9683eb[_0x495d('0x2c')]);_0x20bb9d['filters']=_[_0x495d('0x2d')](_0x20bb9d[_0x495d('0x2e')],_0x20bb9d['query']);_0x310e9c['attributes']=_['intersection'](_0x20bb9d[_0x495d('0x2e')],qs[_0x495d('0x2f')](_0x9683eb[_0x495d('0x2c')][_0x495d('0x2f')]));_0x310e9c[_0x495d('0x30')]=_0x310e9c['attributes'][_0x495d('0x31')]?_0x310e9c[_0x495d('0x30')]:_0x20bb9d[_0x495d('0x2e')];if(!_0x9683eb['query'][_0x495d('0x32')](_0x495d('0x33'))){_0x310e9c[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x9683eb[_0x495d('0x2c')][_0x495d('0x1a')]);_0x310e9c['offset']=qs['offset'](_0x9683eb[_0x495d('0x2c')]['offset']);}_0x310e9c[_0x495d('0x34')]=qs[_0x495d('0x35')](_0x9683eb[_0x495d('0x2c')][_0x495d('0x35')]);_0x310e9c[_0x495d('0x36')]=qs[_0x495d('0x37')](_[_0x495d('0x38')](_0x9683eb[_0x495d('0x2c')],_0x20bb9d[_0x495d('0x37')]));if(_0x9683eb[_0x495d('0x2c')][_0x495d('0x39')]){_0x310e9c[_0x495d('0x36')]=_[_0x495d('0x3a')](_0x310e9c[_0x495d('0x36')],{'$or':_['map'](_0x4e258e,function(_0x4c8834){if(_0x4c8834[_0x495d('0x3b')]['key']!==_0x495d('0x3c')){var _0xe4ddab={};_0xe4ddab[_0x4c8834[_0x495d('0x3d')]]={'$like':'%'+_0x9683eb[_0x495d('0x2c')]['filter']+'%'};return _0xe4ddab;}})});}_0x310e9c=_[_0x495d('0x3a')]({},_0x310e9c,_0x9683eb[_0x495d('0x3e')]);var _0x1867b0={'where':_0x310e9c[_0x495d('0x36')]};return db[_0x495d('0x29')][_0x495d('0x3f')](_0x1867b0)['then'](function(_0x3f411a){_0x49acea[_0x495d('0x3f')]=_0x3f411a;if(_0x9683eb[_0x495d('0x2c')][_0x495d('0x40')]){_0x310e9c['include']=[{'model':db[_0x495d('0x41')],'include':[{'model':db[_0x495d('0x42')],'include':[{'model':db['CrmActionsList']}]},{'model':db['CrmWorkflowStep'],'as':_0x495d('0x43'),'through':{'attributes':[]}}]}];}return db[_0x495d('0x29')]['findAll'](_0x310e9c);})[_0x495d('0x23')](function(_0x252be2){_0x49acea[_0x495d('0x44')]=_0x252be2;return _0x49acea;})['then'](respondWithFilteredResult(_0x445812,_0x310e9c))[_0x495d('0x45')](handleError(_0x445812,null));};exports[_0x495d('0x46')]=function(_0x5ebdf3,_0x1db109){var _0x4a5a5c={'raw':![],'where':{'id':_0x5ebdf3['params']['id']}},_0x57d70d={};_0x57d70d[_0x495d('0x2e')]=_[_0x495d('0x2b')](db[_0x495d('0x29')][_0x495d('0x2a')]);_0x57d70d[_0x495d('0x2c')]=_[_0x495d('0x2b')](_0x5ebdf3[_0x495d('0x2c')]);_0x57d70d[_0x495d('0x37')]=_[_0x495d('0x2d')](_0x57d70d[_0x495d('0x2e')],_0x57d70d[_0x495d('0x2c')]);_0x4a5a5c[_0x495d('0x30')]=_[_0x495d('0x2d')](_0x57d70d[_0x495d('0x2e')],qs[_0x495d('0x2f')](_0x5ebdf3[_0x495d('0x2c')][_0x495d('0x2f')]));_0x4a5a5c[_0x495d('0x30')]=_0x4a5a5c['attributes'][_0x495d('0x31')]?_0x4a5a5c[_0x495d('0x30')]:_0x57d70d['model'];if(_0x5ebdf3[_0x495d('0x2c')][_0x495d('0x40')]){_0x4a5a5c[_0x495d('0x47')]=[{'all':!![]}];}_0x4a5a5c=_[_0x495d('0x3a')]({},_0x4a5a5c,_0x5ebdf3[_0x495d('0x3e')]);return db['CrmWorkflow'][_0x495d('0x48')](_0x4a5a5c)[_0x495d('0x23')](handleEntityNotFound(_0x1db109,null))['then'](respondWithResult(_0x1db109,null))[_0x495d('0x45')](handleError(_0x1db109,null));};exports[_0x495d('0x49')]=function(_0x59ce92,_0x561ca9){return db[_0x495d('0x29')][_0x495d('0x49')](_0x59ce92[_0x495d('0x4a')],{})[_0x495d('0x23')](respondWithResult(_0x561ca9,0xc9))[_0x495d('0x45')](handleError(_0x561ca9,null));};exports[_0x495d('0x21')]=function(_0x18a957,_0x4365f3){if(_0x18a957[_0x495d('0x4a')]['id']){delete _0x18a957['body']['id'];}return db[_0x495d('0x29')]['find']({'where':{'id':_0x18a957[_0x495d('0x4b')]['id']}})[_0x495d('0x23')](handleEntityNotFound(_0x4365f3,null))[_0x495d('0x23')](saveUpdates(_0x18a957[_0x495d('0x4a')],null))[_0x495d('0x23')](respondWithResult(_0x4365f3,null))[_0x495d('0x45')](handleError(_0x4365f3,null));};exports[_0x495d('0x22')]=function(_0x269369,_0x317685){return db[_0x495d('0x29')][_0x495d('0x48')]({'where':{'id':_0x269369[_0x495d('0x4b')]['id']}})[_0x495d('0x23')](handleEntityNotFound(_0x317685,null))[_0x495d('0x23')](removeEntity(_0x317685,null))['catch'](handleError(_0x317685,null));};exports[_0x495d('0x4c')]=function(_0x2d50c7,_0x4f2adf){return db['CrmWorkflow'][_0x495d('0x4c')]()['then'](respondWithResult(_0x4f2adf,null))[_0x495d('0x45')](handleError(_0x4f2adf,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.model.js b/server/api/crmWorkflow/crmWorkflow.model.js index e79ce9e..a3d0919 100644 --- a/server/api/crmWorkflow/crmWorkflow.model.js +++ b/server/api/crmWorkflow/crmWorkflow.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a22=['api','moment','bluebird','path','rimraf','../../config/environment','./crmWorkflow.attributes','define','CrmWorkflow','crm_workflows','lodash','util','../../config/logger'];(function(_0x20a590,_0x1e8a6d){var _0x2e1b41=function(_0x48359f){while(--_0x48359f){_0x20a590['push'](_0x20a590['shift']());}};_0x2e1b41(++_0x1e8a6d);}(_0x0a22,0x1eb));var _0x20a2=function(_0x437f53,_0x185bd5){_0x437f53=_0x437f53-0x0;var _0x30c188=_0x0a22[_0x437f53];return _0x30c188;};'use strict';var _=require(_0x20a2('0x0'));var util=require(_0x20a2('0x1'));var logger=require(_0x20a2('0x2'))(_0x20a2('0x3'));var moment=require(_0x20a2('0x4'));var BPromise=require(_0x20a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a2('0x6'));var rimraf=require(_0x20a2('0x7'));var config=require(_0x20a2('0x8'));var attributes=require(_0x20a2('0x9'));module['exports']=function(_0x4804f5,_0x3eeda2){return _0x4804f5[_0x20a2('0xa')](_0x20a2('0xb'),attributes,{'tableName':_0x20a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0c8=['lodash','util','api','moment','bluebird','request-promise','path','exports','define','CrmWorkflow','crm_workflows'];(function(_0x5862dc,_0x3a7490){var _0x43f2bc=function(_0x587cb){while(--_0x587cb){_0x5862dc['push'](_0x5862dc['shift']());}};_0x43f2bc(++_0x3a7490);}(_0xa0c8,0xf2));var _0x8a0c=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0xa0c8[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x8a0c('0x0'));var util=require(_0x8a0c('0x1'));var logger=require('../../config/logger')(_0x8a0c('0x2'));var moment=require(_0x8a0c('0x3'));var BPromise=require(_0x8a0c('0x4'));var rp=require(_0x8a0c('0x5'));var fs=require('fs');var path=require(_0x8a0c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./crmWorkflow.attributes');module[_0x8a0c('0x7')]=function(_0x2aa849,_0x342861){return _0x2aa849[_0x8a0c('0x8')](_0x8a0c('0x9'),attributes,{'tableName':_0x8a0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.rpc.js b/server/api/crmWorkflow/crmWorkflow.rpc.js index 3bcb3e6..90c7dbb 100644 --- a/server/api/crmWorkflow/crmWorkflow.rpc.js +++ b/server/api/crmWorkflow/crmWorkflow.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa93a=['rpc','../../config/environment','jayson/promise','client','http','then','debug','request\x20sent','stringify','error','message','CrmWorkflow,\x20%s,\x20%s','info','catch','moment','ioredis','../../config/utils'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xa93a,0xb8));var _0xaa93=function(_0x323255,_0x1bb4bd){_0x323255=_0x323255-0x0;var _0x48664f=_0xa93a[_0x323255];return _0x48664f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa93('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa93('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa93('0x2'));var logger=require('../../config/logger')(_0xaa93('0x3'));var config=require(_0xaa93('0x4'));var jayson=require(_0xaa93('0x5'));var client=jayson[_0xaa93('0x6')][_0xaa93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f3572,_0x353544,_0x28e972){return new BPromise(function(_0x5aa7f5,_0x2bb7a8){return client['request'](_0x4f3572,_0x28e972)[_0xaa93('0x8')](function(_0x53897){logger['info']('CrmWorkflow,\x20%s,\x20%s',_0x353544,'request\x20sent');logger[_0xaa93('0x9')]('CrmWorkflow,\x20%s,\x20%s,\x20%s',_0x353544,_0xaa93('0xa'),JSON[_0xaa93('0xb')](_0x53897));if(_0x53897[_0xaa93('0xc')]){if(_0x53897['error']['code']===0x1f4){logger[_0xaa93('0xc')]('CrmWorkflow,\x20%s,\x20%s',_0x353544,_0x53897[_0xaa93('0xc')]['message']);return _0x2bb7a8(_0x53897[_0xaa93('0xc')][_0xaa93('0xd')]);}logger[_0xaa93('0xc')](_0xaa93('0xe'),_0x353544,_0x53897[_0xaa93('0xc')]['message']);return _0x5aa7f5(_0x53897[_0xaa93('0xc')]['message']);}else{logger[_0xaa93('0xf')](_0xaa93('0xe'),_0x353544,'request\x20sent');_0x5aa7f5(_0x53897['result'][_0xaa93('0xd')]);}})[_0xaa93('0x10')](function(_0x1cc0bc){logger[_0xaa93('0xc')](_0xaa93('0xe'),_0x353544,_0x1cc0bc);_0x2bb7a8(_0x1cc0bc);});});} \ No newline at end of file +var _0xb91a=['request\x20sent','debug','CrmWorkflow,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','CrmWorkflow,\x20%s,\x20%s'];(function(_0x2847e3,_0x3736ee){var _0x3344c8=function(_0x4d75b7){while(--_0x4d75b7){_0x2847e3['push'](_0x2847e3['shift']());}};_0x3344c8(++_0x3736ee);}(_0xb91a,0xe5));var _0xab91=function(_0x22722d,_0x3a9ea5){_0x22722d=_0x22722d-0x0;var _0x31abcf=_0xb91a[_0x22722d];return _0x31abcf;};'use strict';var _=require('lodash');var util=require(_0xab91('0x0'));var moment=require(_0xab91('0x1'));var BPromise=require(_0xab91('0x2'));var rs=require(_0xab91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab91('0x4'))['db'];var utils=require(_0xab91('0x5'));var logger=require('../../config/logger')(_0xab91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab91('0x7')][_0xab91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56f24d,_0x2ebd86,_0x26e44b){return new BPromise(function(_0x55a554,_0x1748f2){return client[_0xab91('0x9')](_0x56f24d,_0x26e44b)['then'](function(_0x5765fc){logger['info'](_0xab91('0xa'),_0x2ebd86,_0xab91('0xb'));logger[_0xab91('0xc')](_0xab91('0xd'),_0x2ebd86,'request\x20sent',JSON[_0xab91('0xe')](_0x5765fc));if(_0x5765fc[_0xab91('0xf')]){if(_0x5765fc['error'][_0xab91('0x10')]===0x1f4){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x5765fc['error']['message']);return _0x1748f2(_0x5765fc[_0xab91('0xf')]['message']);}logger[_0xab91('0xf')](_0xab91('0xa'),_0x2ebd86,_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);return _0x55a554(_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);}else{logger['info'](_0xab91('0xa'),_0x2ebd86,'request\x20sent');_0x55a554(_0x5765fc[_0xab91('0x12')][_0xab91('0x11')]);}})[_0xab91('0x13')](function(_0x32df88){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x32df88);_0x1748f2(_0x32df88);});});} \ No newline at end of file diff --git a/server/api/crmWorkflow/index.js b/server/api/crmWorkflow/index.js index fe2d4f6..350ff68 100644 --- a/server/api/crmWorkflow/index.js +++ b/server/api/crmWorkflow/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0120=['./crmWorkflow.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var auth=require(_0x0012('0x6'));var interaction=require(_0x0012('0x7'));var config=require(_0x0012('0x8'));var controller=require(_0x0012('0x9'));router[_0x0012('0xa')]('/',auth[_0x0012('0xb')](),controller['index']);router['get']('/describe',auth[_0x0012('0xb')](),controller[_0x0012('0xc')]);router[_0x0012('0xa')](_0x0012('0xd'),auth[_0x0012('0xb')](),controller['show']);router[_0x0012('0xe')]('/',auth[_0x0012('0xb')](),controller[_0x0012('0xf')]);router[_0x0012('0x10')]('/:id',auth[_0x0012('0xb')](),controller['update']);router[_0x0012('0x11')](_0x0012('0xd'),auth[_0x0012('0xb')](),controller[_0x0012('0x12')]);module[_0x0012('0x13')]=router; \ No newline at end of file +var _0xc025=['index','/describe','isAuthenticated','describe','show','create','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','./crmWorkflow.controller','get'];(function(_0x5b77bd,_0x23224d){var _0x5a819f=function(_0x5befeb){while(--_0x5befeb){_0x5b77bd['push'](_0x5b77bd['shift']());}};_0x5a819f(++_0x23224d);}(_0xc025,0x169));var _0x5c02=function(_0x6fbf10,_0x540d5f){_0x6fbf10=_0x6fbf10-0x0;var _0x26f043=_0xc025[_0x6fbf10];return _0x26f043;};'use strict';var multer=require(_0x5c02('0x0'));var util=require('util');var path=require(_0x5c02('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c02('0x2'));var router=express[_0x5c02('0x3')]();var auth=require(_0x5c02('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5c02('0x5'));router[_0x5c02('0x6')]('/',auth['isAuthenticated'](),controller[_0x5c02('0x7')]);router[_0x5c02('0x6')](_0x5c02('0x8'),auth[_0x5c02('0x9')](),controller[_0x5c02('0xa')]);router[_0x5c02('0x6')]('/:id',auth[_0x5c02('0x9')](),controller[_0x5c02('0xb')]);router['post']('/',auth[_0x5c02('0x9')](),controller[_0x5c02('0xc')]);router['put'](_0x5c02('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5c02('0xe')]);module[_0x5c02('0xf')]=router; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js b/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js index 77565b9..5c04f02 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda5c=['STRING','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xda5c,0xb7));var _0xcda5=function(_0x52a40e,_0x591c17){_0x52a40e=_0x52a40e-0x0;var _0x1c0b00=_0xda5c[_0x52a40e];return _0x1c0b00;};'use strict';var Sequelize=require('sequelize');module[_0xcda5('0x0')]={'name':{'type':Sequelize[_0xcda5('0x1')],'allowNull':![],'unique':'name'}}; \ No newline at end of file +var _0x32ca=['sequelize','STRING','name'];(function(_0x78291f,_0x3bf6ef){var _0x197968=function(_0x1fabff){while(--_0x1fabff){_0x78291f['push'](_0x78291f['shift']());}};_0x197968(++_0x3bf6ef);}(_0x32ca,0x123));var _0xa32c=function(_0x507126,_0x3dd5c3){_0x507126=_0x507126-0x0;var _0x5ca642=_0x32ca[_0x507126];return _0x5ca642;};'use strict';var Sequelize=require(_0xa32c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa32c('0x1')],'allowNull':![],'unique':_0xa32c('0x2')}}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.controller.js b/server/api/crmWorkflowstep/crmWorkflowstep.controller.js index 94a37e6..12a1bcd 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.controller.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6a7=['send','index','CrmWorkflowStep','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','show','include','catch','create','body','params','describe','addCrmWorkflowNextStep','find','ids','omit','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xc6a7,0x161));var _0x7c6a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc6a7[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7c6a('0x0'));var rimraf=require(_0x7c6a('0x1'));var zipdir=require(_0x7c6a('0x2'));var jsonpatch=require(_0x7c6a('0x3'));var rp=require(_0x7c6a('0x4'));var moment=require(_0x7c6a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c6a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7c6a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7c6a('0x8'));var squel=require(_0x7c6a('0x9'));var crypto=require(_0x7c6a('0xa'));var jsforce=require(_0x7c6a('0xb'));var deskjs=require(_0x7c6a('0xc'));var toCsv=require(_0x7c6a('0xd'));var querystring=require(_0x7c6a('0xe'));var Papa=require(_0x7c6a('0xf'));var Redis=require(_0x7c6a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7c6a('0x11'));var hardwareService=require(_0x7c6a('0x12'));var logger=require('../../config/logger')(_0x7c6a('0x13'));var utils=require(_0x7c6a('0x14'));var config=require('../../config/environment');var db=require(_0x7c6a('0x15'))['db'];function respondWithStatusCode(_0x1585cf,_0x1da90b){_0x1da90b=_0x1da90b||0xcc;return function(_0x23ae7b){if(_0x23ae7b){return _0x1585cf[_0x7c6a('0x16')](_0x1da90b);}return _0x1585cf['status'](_0x1da90b)[_0x7c6a('0x17')]();};}function respondWithResult(_0x397c4d,_0x580752){_0x580752=_0x580752||0xc8;return function(_0x47dc60){if(_0x47dc60){return _0x397c4d[_0x7c6a('0x18')](_0x580752)[_0x7c6a('0x19')](_0x47dc60);}};}function respondWithFilteredResult(_0x1dd25a,_0x223c57){return function(_0x2c552e){if(_0x2c552e){var _0x1a33cb=_0x2c552e[_0x7c6a('0x1a')],_0x4f8552=_0x223c57[_0x7c6a('0x1b')],_0x5530ae=_0x223c57[_0x7c6a('0x1b')]+_0x223c57[_0x7c6a('0x1c')],_0x2af4af;if(_0x5530ae>=_0x1a33cb){_0x5530ae=_0x1a33cb;_0x2af4af=0xc8;}else{_0x2af4af=0xce;}_0x1dd25a[_0x7c6a('0x18')](_0x2af4af);return _0x1dd25a['set'](_0x7c6a('0x1d'),_0x4f8552+'-'+_0x5530ae+'/'+_0x1a33cb)[_0x7c6a('0x19')](_0x2c552e);}return null;};}function patchUpdates(_0xee2eb4){return function(_0x145a9e){try{jsonpatch['apply'](_0x145a9e,_0xee2eb4,!![]);}catch(_0x22f3c6){return BPromise[_0x7c6a('0x1e')](_0x22f3c6);}return _0x145a9e['save']();};}function saveUpdates(_0x9f0889,_0x3e135e){return function(_0x43c3ac){if(_0x43c3ac){return _0x43c3ac[_0x7c6a('0x1f')](_0x9f0889)[_0x7c6a('0x20')](function(_0x559e98){return _0x559e98;});}return null;};}function removeEntity(_0x1f6122,_0x47d277){return function(_0x4d290d){if(_0x4d290d){return _0x4d290d[_0x7c6a('0x21')]()[_0x7c6a('0x20')](function(){_0x1f6122[_0x7c6a('0x18')](0xcc)[_0x7c6a('0x17')]();});}};}function handleEntityNotFound(_0x294c14,_0x526e7a){return function(_0xeacbbd){if(!_0xeacbbd){_0x294c14[_0x7c6a('0x16')](0x194);}return _0xeacbbd;};}function handleError(_0x115a1f,_0x2c412e){_0x2c412e=_0x2c412e||0x1f4;return function(_0x50e6f8){logger[_0x7c6a('0x22')](_0x50e6f8[_0x7c6a('0x23')]);if(_0x50e6f8[_0x7c6a('0x24')]){delete _0x50e6f8[_0x7c6a('0x24')];}_0x115a1f[_0x7c6a('0x18')](_0x2c412e)[_0x7c6a('0x25')](_0x50e6f8);};}exports[_0x7c6a('0x26')]=function(_0x44d96b,_0x2ed1a1){var _0x781511={},_0xaed70e={},_0x10d0aa={'count':0x0,'rows':[]};var _0x5bc87d=db[_0x7c6a('0x27')]['rawAttributes'];_0xaed70e['model']=_[_0x7c6a('0x28')](_0x5bc87d);_0xaed70e[_0x7c6a('0x29')]=_['keys'](_0x44d96b[_0x7c6a('0x29')]);_0xaed70e['filters']=_[_0x7c6a('0x2a')](_0xaed70e['model'],_0xaed70e['query']);_0x781511[_0x7c6a('0x2b')]=_[_0x7c6a('0x2a')](_0xaed70e['model'],qs[_0x7c6a('0x2c')](_0x44d96b[_0x7c6a('0x29')]['fields']));_0x781511[_0x7c6a('0x2b')]=_0x781511['attributes'][_0x7c6a('0x2d')]?_0x781511[_0x7c6a('0x2b')]:_0xaed70e[_0x7c6a('0x2e')];if(!_0x44d96b['query'][_0x7c6a('0x2f')](_0x7c6a('0x30'))){_0x781511[_0x7c6a('0x1c')]=qs[_0x7c6a('0x1c')](_0x44d96b[_0x7c6a('0x29')][_0x7c6a('0x1c')]);_0x781511['offset']=qs[_0x7c6a('0x1b')](_0x44d96b[_0x7c6a('0x29')]['offset']);}_0x781511['order']=qs[_0x7c6a('0x31')](_0x44d96b['query'][_0x7c6a('0x31')]);_0x781511[_0x7c6a('0x32')]=qs[_0x7c6a('0x33')](_[_0x7c6a('0x34')](_0x44d96b[_0x7c6a('0x29')],_0xaed70e[_0x7c6a('0x33')]));if(_0x44d96b['query'][_0x7c6a('0x35')]){_0x781511[_0x7c6a('0x32')]=_[_0x7c6a('0x36')](_0x781511['where'],{'$or':_[_0x7c6a('0x37')](_0x5bc87d,function(_0x443119){if(_0x443119['type'][_0x7c6a('0x38')]!==_0x7c6a('0x39')){var _0x52790e={};_0x52790e[_0x443119[_0x7c6a('0x3a')]]={'$like':'%'+_0x44d96b[_0x7c6a('0x29')][_0x7c6a('0x35')]+'%'};return _0x52790e;}})});}_0x781511=_[_0x7c6a('0x36')]({},_0x781511,_0x44d96b[_0x7c6a('0x3b')]);var _0x4dcca4={'where':_0x781511['where']};return db[_0x7c6a('0x27')][_0x7c6a('0x1a')](_0x4dcca4)[_0x7c6a('0x20')](function(_0x43e1f2){_0x10d0aa[_0x7c6a('0x1a')]=_0x43e1f2;if(_0x44d96b[_0x7c6a('0x29')][_0x7c6a('0x3c')]){_0x781511['include']=[{'all':!![]}];}return db[_0x7c6a('0x27')][_0x7c6a('0x3d')](_0x781511);})[_0x7c6a('0x20')](function(_0x489c46){_0x10d0aa['rows']=_0x489c46;return _0x10d0aa;})[_0x7c6a('0x20')](respondWithFilteredResult(_0x2ed1a1,_0x781511))['catch'](handleError(_0x2ed1a1,null));};exports[_0x7c6a('0x3e')]=function(_0x5e1e3d,_0x1c5b84){var _0x303df0={'raw':![],'where':{'id':_0x5e1e3d['params']['id']}},_0x5922cb={};_0x5922cb[_0x7c6a('0x2e')]=_[_0x7c6a('0x28')](db['CrmWorkflowStep']['rawAttributes']);_0x5922cb[_0x7c6a('0x29')]=_['keys'](_0x5e1e3d[_0x7c6a('0x29')]);_0x5922cb[_0x7c6a('0x33')]=_[_0x7c6a('0x2a')](_0x5922cb['model'],_0x5922cb[_0x7c6a('0x29')]);_0x303df0[_0x7c6a('0x2b')]=_[_0x7c6a('0x2a')](_0x5922cb[_0x7c6a('0x2e')],qs[_0x7c6a('0x2c')](_0x5e1e3d['query']['fields']));_0x303df0[_0x7c6a('0x2b')]=_0x303df0['attributes'][_0x7c6a('0x2d')]?_0x303df0[_0x7c6a('0x2b')]:_0x5922cb['model'];if(_0x5e1e3d['query']['includeAll']){_0x303df0[_0x7c6a('0x3f')]=[{'all':!![]}];}_0x303df0=_[_0x7c6a('0x36')]({},_0x303df0,_0x5e1e3d['options']);return db[_0x7c6a('0x27')]['find'](_0x303df0)[_0x7c6a('0x20')](handleEntityNotFound(_0x1c5b84,null))[_0x7c6a('0x20')](respondWithResult(_0x1c5b84,null))[_0x7c6a('0x40')](handleError(_0x1c5b84,null));};exports['create']=function(_0x174d46,_0x338d2b){return db[_0x7c6a('0x27')][_0x7c6a('0x41')](_0x174d46[_0x7c6a('0x42')],{})[_0x7c6a('0x20')](respondWithResult(_0x338d2b,0xc9))[_0x7c6a('0x40')](handleError(_0x338d2b,null));};exports[_0x7c6a('0x1f')]=function(_0x7e55b0,_0x1eb075){if(_0x7e55b0[_0x7c6a('0x42')]['id']){delete _0x7e55b0[_0x7c6a('0x42')]['id'];}return db['CrmWorkflowStep']['find']({'where':{'id':_0x7e55b0[_0x7c6a('0x43')]['id']}})[_0x7c6a('0x20')](handleEntityNotFound(_0x1eb075,null))[_0x7c6a('0x20')](saveUpdates(_0x7e55b0[_0x7c6a('0x42')],null))[_0x7c6a('0x20')](respondWithResult(_0x1eb075,null))[_0x7c6a('0x40')](handleError(_0x1eb075,null));};exports[_0x7c6a('0x21')]=function(_0x4cf48e,_0x5c350c){return db[_0x7c6a('0x27')]['find']({'where':{'id':_0x4cf48e[_0x7c6a('0x43')]['id']}})[_0x7c6a('0x20')](handleEntityNotFound(_0x5c350c,null))[_0x7c6a('0x20')](removeEntity(_0x5c350c,null))[_0x7c6a('0x40')](handleError(_0x5c350c,null));};exports['describe']=function(_0x27d3c4,_0x3d6889){return db[_0x7c6a('0x27')][_0x7c6a('0x44')]()['then'](respondWithResult(_0x3d6889,null))[_0x7c6a('0x40')](handleError(_0x3d6889,null));};exports[_0x7c6a('0x45')]=function(_0x1d8f9f,_0x43bc83,_0x2c56ea){return db[_0x7c6a('0x27')][_0x7c6a('0x46')]({'where':{'id':_0x1d8f9f[_0x7c6a('0x43')]['id']}})[_0x7c6a('0x20')](handleEntityNotFound(_0x43bc83,null))[_0x7c6a('0x20')](function(_0x399904){if(_0x399904){return _0x399904[_0x7c6a('0x45')](_0x1d8f9f[_0x7c6a('0x42')][_0x7c6a('0x47')],_[_0x7c6a('0x48')](_0x1d8f9f['body'],[_0x7c6a('0x47'),'id'])||{});}})[_0x7c6a('0x20')](respondWithResult(_0x43bc83,null))[_0x7c6a('0x40')](handleError(_0x43bc83,null));};exports[_0x7c6a('0x49')]=function(_0x13dda8,_0x5d8aa1,_0x42068c){return db[_0x7c6a('0x27')]['find']({'where':{'id':_0x13dda8[_0x7c6a('0x43')]['id']}})[_0x7c6a('0x20')](handleEntityNotFound(_0x5d8aa1,null))[_0x7c6a('0x20')](function(_0x403fda){if(_0x403fda){return _0x403fda[_0x7c6a('0x49')](_0x13dda8['query'][_0x7c6a('0x47')]);}})[_0x7c6a('0x20')](respondWithStatusCode(_0x5d8aa1,null))[_0x7c6a('0x40')](handleError(_0x5d8aa1,null));};exports[_0x7c6a('0x4a')]=function(_0x263f37,_0x51543b,_0x3b2f69){var _0x370bc5={};var _0x64479b={};var _0x4a0cda;var _0x26f118;return db[_0x7c6a('0x27')][_0x7c6a('0x4b')]({'where':{'id':_0x263f37[_0x7c6a('0x43')]['id']}})[_0x7c6a('0x20')](handleEntityNotFound(_0x51543b,null))[_0x7c6a('0x20')](function(_0x1afbdd){if(_0x1afbdd){_0x4a0cda=_0x1afbdd;_0x64479b[_0x7c6a('0x2e')]=_['keys'](db[_0x7c6a('0x27')][_0x7c6a('0x4c')]);_0x64479b[_0x7c6a('0x29')]=_[_0x7c6a('0x28')](_0x263f37[_0x7c6a('0x29')]);_0x64479b[_0x7c6a('0x33')]=_[_0x7c6a('0x2a')](_0x64479b[_0x7c6a('0x2e')],_0x64479b['query']);_0x370bc5[_0x7c6a('0x2b')]=_[_0x7c6a('0x2a')](_0x64479b[_0x7c6a('0x2e')],qs[_0x7c6a('0x2c')](_0x263f37[_0x7c6a('0x29')][_0x7c6a('0x2c')]));_0x370bc5[_0x7c6a('0x2b')]=_0x370bc5[_0x7c6a('0x2b')][_0x7c6a('0x2d')]?_0x370bc5[_0x7c6a('0x2b')]:_0x64479b[_0x7c6a('0x2e')];_0x370bc5[_0x7c6a('0x4d')]=qs[_0x7c6a('0x31')](_0x263f37[_0x7c6a('0x29')]['sort']);_0x370bc5[_0x7c6a('0x32')]=qs[_0x7c6a('0x33')](_[_0x7c6a('0x34')](_0x263f37['query'],_0x64479b['filters']));if(_0x263f37[_0x7c6a('0x29')][_0x7c6a('0x35')]){_0x370bc5[_0x7c6a('0x32')]=_[_0x7c6a('0x36')](_0x370bc5['where'],{'$or':_[_0x7c6a('0x37')](_0x370bc5[_0x7c6a('0x2b')],function(_0x34e71b){var _0x144a37={};_0x144a37[_0x34e71b]={'$like':'%'+_0x263f37[_0x7c6a('0x29')][_0x7c6a('0x35')]+'%'};return _0x144a37;})});}_0x370bc5=_[_0x7c6a('0x36')]({},_0x370bc5,_0x263f37[_0x7c6a('0x3b')]);return _0x4a0cda[_0x7c6a('0x4a')](_0x370bc5);}})[_0x7c6a('0x20')](function(_0xc4cd7d){if(_0xc4cd7d){_0x26f118=_0xc4cd7d[_0x7c6a('0x2d')];if(!_0x263f37[_0x7c6a('0x29')][_0x7c6a('0x2f')]('nolimit')){_0x370bc5[_0x7c6a('0x1c')]=qs['limit'](_0x263f37[_0x7c6a('0x29')][_0x7c6a('0x1c')]);_0x370bc5[_0x7c6a('0x1b')]=qs[_0x7c6a('0x1b')](_0x263f37['query'][_0x7c6a('0x1b')]);}return _0x4a0cda['getCrmWorkflowNextStep'](_0x370bc5);}})[_0x7c6a('0x20')](function(_0x32738a){if(_0x32738a){return _0x32738a?{'count':_0x26f118,'rows':_0x32738a}:null;}})[_0x7c6a('0x20')](respondWithResult(_0x51543b,null))[_0x7c6a('0x40')](handleError(_0x51543b,null));}; \ No newline at end of file +var _0x5628=['map','type','VIRTUAL','merge','options','include','catch','params','keys','includeAll','find','create','body','destroy','describe','addCrmWorkflowNextStep','omit','ids','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','status','error','name','send','index','CrmWorkflowStep','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x5628,0xb1));var _0x8562=function(_0x478ec9,_0x1c9ee1){_0x478ec9=_0x478ec9-0x0;var _0x5b6d5d=_0x5628[_0x478ec9];return _0x5b6d5d;};'use strict';var pdf=require(_0x8562('0x0'));var emlformat=require(_0x8562('0x1'));var rimraf=require(_0x8562('0x2'));var zipdir=require(_0x8562('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8562('0x4'));var moment=require(_0x8562('0x5'));var BPromise=require(_0x8562('0x6'));var Mustache=require(_0x8562('0x7'));var util=require('util');var path=require(_0x8562('0x8'));var sox=require('sox');var csv=require(_0x8562('0x9'));var ejs=require(_0x8562('0xa'));var fs=require('fs');var _=require(_0x8562('0xb'));var squel=require('squel');var crypto=require(_0x8562('0xc'));var jsforce=require(_0x8562('0xd'));var deskjs=require(_0x8562('0xe'));var toCsv=require(_0x8562('0x9'));var querystring=require(_0x8562('0xf'));var Papa=require(_0x8562('0x10'));var Redis=require(_0x8562('0x11'));var authService=require(_0x8562('0x12'));var qs=require(_0x8562('0x13'));var hardwareService=require(_0x8562('0x14'));var logger=require(_0x8562('0x15'))('api');var utils=require(_0x8562('0x16'));var config=require('../../config/environment');var db=require(_0x8562('0x17'))['db'];function respondWithStatusCode(_0x2ac1fc,_0x3e6fab){_0x3e6fab=_0x3e6fab||0xcc;return function(_0x22ac67){if(_0x22ac67){return _0x2ac1fc[_0x8562('0x18')](_0x3e6fab);}return _0x2ac1fc['status'](_0x3e6fab)[_0x8562('0x19')]();};}function respondWithResult(_0x4f363a,_0x2c6de0){_0x2c6de0=_0x2c6de0||0xc8;return function(_0x5f5a35){if(_0x5f5a35){return _0x4f363a['status'](_0x2c6de0)[_0x8562('0x1a')](_0x5f5a35);}};}function respondWithFilteredResult(_0x512a16,_0x9e0fd0){return function(_0x43c4ba){if(_0x43c4ba){var _0x57e622=_0x43c4ba[_0x8562('0x1b')],_0x4efb1a=_0x9e0fd0[_0x8562('0x1c')],_0x449a14=_0x9e0fd0[_0x8562('0x1c')]+_0x9e0fd0[_0x8562('0x1d')],_0x4230ac;if(_0x449a14>=_0x57e622){_0x449a14=_0x57e622;_0x4230ac=0xc8;}else{_0x4230ac=0xce;}_0x512a16['status'](_0x4230ac);return _0x512a16[_0x8562('0x1e')](_0x8562('0x1f'),_0x4efb1a+'-'+_0x449a14+'/'+_0x57e622)['json'](_0x43c4ba);}return null;};}function patchUpdates(_0x136e5d){return function(_0x5d4a73){try{jsonpatch[_0x8562('0x20')](_0x5d4a73,_0x136e5d,!![]);}catch(_0x5f2171){return BPromise[_0x8562('0x21')](_0x5f2171);}return _0x5d4a73['save']();};}function saveUpdates(_0x424b49,_0x5d6473){return function(_0x5cfa18){if(_0x5cfa18){return _0x5cfa18[_0x8562('0x22')](_0x424b49)[_0x8562('0x23')](function(_0x377403){return _0x377403;});}return null;};}function removeEntity(_0x3c496c,_0x4fdadd){return function(_0x3d3292){if(_0x3d3292){return _0x3d3292['destroy']()['then'](function(){_0x3c496c[_0x8562('0x24')](0xcc)[_0x8562('0x19')]();});}};}function handleEntityNotFound(_0x35ad3a,_0x11e16f){return function(_0x211824){if(!_0x211824){_0x35ad3a[_0x8562('0x18')](0x194);}return _0x211824;};}function handleError(_0x546759,_0x5cfefc){_0x5cfefc=_0x5cfefc||0x1f4;return function(_0x4aac51){logger[_0x8562('0x25')](_0x4aac51['stack']);if(_0x4aac51[_0x8562('0x26')]){delete _0x4aac51[_0x8562('0x26')];}_0x546759['status'](_0x5cfefc)[_0x8562('0x27')](_0x4aac51);};}exports[_0x8562('0x28')]=function(_0x3f347f,_0x56c15b){var _0x1024a6={},_0x529b96={},_0xf56272={'count':0x0,'rows':[]};var _0x553015=db[_0x8562('0x29')][_0x8562('0x2a')];_0x529b96['model']=_['keys'](_0x553015);_0x529b96[_0x8562('0x2b')]=_['keys'](_0x3f347f[_0x8562('0x2b')]);_0x529b96[_0x8562('0x2c')]=_[_0x8562('0x2d')](_0x529b96[_0x8562('0x2e')],_0x529b96['query']);_0x1024a6[_0x8562('0x2f')]=_['intersection'](_0x529b96[_0x8562('0x2e')],qs[_0x8562('0x30')](_0x3f347f[_0x8562('0x2b')]['fields']));_0x1024a6['attributes']=_0x1024a6[_0x8562('0x2f')][_0x8562('0x31')]?_0x1024a6[_0x8562('0x2f')]:_0x529b96[_0x8562('0x2e')];if(!_0x3f347f[_0x8562('0x2b')][_0x8562('0x32')](_0x8562('0x33'))){_0x1024a6[_0x8562('0x1d')]=qs[_0x8562('0x1d')](_0x3f347f[_0x8562('0x2b')][_0x8562('0x1d')]);_0x1024a6[_0x8562('0x1c')]=qs[_0x8562('0x1c')](_0x3f347f[_0x8562('0x2b')][_0x8562('0x1c')]);}_0x1024a6[_0x8562('0x34')]=qs[_0x8562('0x35')](_0x3f347f['query']['sort']);_0x1024a6['where']=qs[_0x8562('0x2c')](_[_0x8562('0x36')](_0x3f347f[_0x8562('0x2b')],_0x529b96['filters']));if(_0x3f347f['query'][_0x8562('0x37')]){_0x1024a6[_0x8562('0x38')]=_['merge'](_0x1024a6[_0x8562('0x38')],{'$or':_[_0x8562('0x39')](_0x553015,function(_0x57a0dc){if(_0x57a0dc[_0x8562('0x3a')]['key']!==_0x8562('0x3b')){var _0x2d2b94={};_0x2d2b94[_0x57a0dc['field']]={'$like':'%'+_0x3f347f[_0x8562('0x2b')]['filter']+'%'};return _0x2d2b94;}})});}_0x1024a6=_[_0x8562('0x3c')]({},_0x1024a6,_0x3f347f[_0x8562('0x3d')]);var _0x18ebd1={'where':_0x1024a6['where']};return db[_0x8562('0x29')]['count'](_0x18ebd1)[_0x8562('0x23')](function(_0x2d3a75){_0xf56272[_0x8562('0x1b')]=_0x2d3a75;if(_0x3f347f['query']['includeAll']){_0x1024a6[_0x8562('0x3e')]=[{'all':!![]}];}return db[_0x8562('0x29')]['findAll'](_0x1024a6);})[_0x8562('0x23')](function(_0x374464){_0xf56272['rows']=_0x374464;return _0xf56272;})['then'](respondWithFilteredResult(_0x56c15b,_0x1024a6))[_0x8562('0x3f')](handleError(_0x56c15b,null));};exports['show']=function(_0x228768,_0x5cf431){var _0x390211={'raw':![],'where':{'id':_0x228768[_0x8562('0x40')]['id']}},_0x5a5eaa={};_0x5a5eaa[_0x8562('0x2e')]=_[_0x8562('0x41')](db[_0x8562('0x29')][_0x8562('0x2a')]);_0x5a5eaa[_0x8562('0x2b')]=_[_0x8562('0x41')](_0x228768[_0x8562('0x2b')]);_0x5a5eaa[_0x8562('0x2c')]=_[_0x8562('0x2d')](_0x5a5eaa[_0x8562('0x2e')],_0x5a5eaa[_0x8562('0x2b')]);_0x390211[_0x8562('0x2f')]=_[_0x8562('0x2d')](_0x5a5eaa[_0x8562('0x2e')],qs['fields'](_0x228768['query'][_0x8562('0x30')]));_0x390211[_0x8562('0x2f')]=_0x390211['attributes'][_0x8562('0x31')]?_0x390211[_0x8562('0x2f')]:_0x5a5eaa['model'];if(_0x228768[_0x8562('0x2b')][_0x8562('0x42')]){_0x390211[_0x8562('0x3e')]=[{'all':!![]}];}_0x390211=_[_0x8562('0x3c')]({},_0x390211,_0x228768[_0x8562('0x3d')]);return db[_0x8562('0x29')][_0x8562('0x43')](_0x390211)[_0x8562('0x23')](handleEntityNotFound(_0x5cf431,null))[_0x8562('0x23')](respondWithResult(_0x5cf431,null))['catch'](handleError(_0x5cf431,null));};exports['create']=function(_0x5c227d,_0x1c51e6){return db['CrmWorkflowStep'][_0x8562('0x44')](_0x5c227d[_0x8562('0x45')],{})[_0x8562('0x23')](respondWithResult(_0x1c51e6,0xc9))['catch'](handleError(_0x1c51e6,null));};exports[_0x8562('0x22')]=function(_0x963f6c,_0x12bbef){if(_0x963f6c[_0x8562('0x45')]['id']){delete _0x963f6c[_0x8562('0x45')]['id'];}return db['CrmWorkflowStep'][_0x8562('0x43')]({'where':{'id':_0x963f6c[_0x8562('0x40')]['id']}})[_0x8562('0x23')](handleEntityNotFound(_0x12bbef,null))[_0x8562('0x23')](saveUpdates(_0x963f6c['body'],null))[_0x8562('0x23')](respondWithResult(_0x12bbef,null))[_0x8562('0x3f')](handleError(_0x12bbef,null));};exports[_0x8562('0x46')]=function(_0x9b7c03,_0x23d501){return db[_0x8562('0x29')][_0x8562('0x43')]({'where':{'id':_0x9b7c03['params']['id']}})['then'](handleEntityNotFound(_0x23d501,null))[_0x8562('0x23')](removeEntity(_0x23d501,null))[_0x8562('0x3f')](handleError(_0x23d501,null));};exports[_0x8562('0x47')]=function(_0x564c5f,_0x2000ba){return db[_0x8562('0x29')][_0x8562('0x47')]()[_0x8562('0x23')](respondWithResult(_0x2000ba,null))[_0x8562('0x3f')](handleError(_0x2000ba,null));};exports[_0x8562('0x48')]=function(_0x395dc1,_0x20794e,_0x28c014){return db['CrmWorkflowStep'][_0x8562('0x43')]({'where':{'id':_0x395dc1[_0x8562('0x40')]['id']}})[_0x8562('0x23')](handleEntityNotFound(_0x20794e,null))[_0x8562('0x23')](function(_0x33e13d){if(_0x33e13d){return _0x33e13d[_0x8562('0x48')](_0x395dc1[_0x8562('0x45')]['ids'],_[_0x8562('0x49')](_0x395dc1['body'],[_0x8562('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x20794e,null))[_0x8562('0x3f')](handleError(_0x20794e,null));};exports[_0x8562('0x4b')]=function(_0x64f631,_0x27fd10,_0x11414b){return db[_0x8562('0x29')][_0x8562('0x43')]({'where':{'id':_0x64f631[_0x8562('0x40')]['id']}})[_0x8562('0x23')](handleEntityNotFound(_0x27fd10,null))[_0x8562('0x23')](function(_0x5572b2){if(_0x5572b2){return _0x5572b2[_0x8562('0x4b')](_0x64f631[_0x8562('0x2b')][_0x8562('0x4a')]);}})[_0x8562('0x23')](respondWithStatusCode(_0x27fd10,null))[_0x8562('0x3f')](handleError(_0x27fd10,null));};exports[_0x8562('0x4c')]=function(_0x3bf753,_0xd292d6,_0x257fbf){var _0x19c02a={};var _0x5a5221={};var _0x5704ea;var _0x451a2f;return db[_0x8562('0x29')][_0x8562('0x4d')]({'where':{'id':_0x3bf753[_0x8562('0x40')]['id']}})['then'](handleEntityNotFound(_0xd292d6,null))['then'](function(_0x124db9){if(_0x124db9){_0x5704ea=_0x124db9;_0x5a5221[_0x8562('0x2e')]=_[_0x8562('0x41')](db[_0x8562('0x29')][_0x8562('0x2a')]);_0x5a5221[_0x8562('0x2b')]=_[_0x8562('0x41')](_0x3bf753[_0x8562('0x2b')]);_0x5a5221[_0x8562('0x2c')]=_[_0x8562('0x2d')](_0x5a5221[_0x8562('0x2e')],_0x5a5221[_0x8562('0x2b')]);_0x19c02a[_0x8562('0x2f')]=_[_0x8562('0x2d')](_0x5a5221['model'],qs[_0x8562('0x30')](_0x3bf753[_0x8562('0x2b')][_0x8562('0x30')]));_0x19c02a[_0x8562('0x2f')]=_0x19c02a[_0x8562('0x2f')]['length']?_0x19c02a[_0x8562('0x2f')]:_0x5a5221['model'];_0x19c02a['order']=qs[_0x8562('0x35')](_0x3bf753[_0x8562('0x2b')][_0x8562('0x35')]);_0x19c02a[_0x8562('0x38')]=qs['filters'](_['pick'](_0x3bf753['query'],_0x5a5221['filters']));if(_0x3bf753[_0x8562('0x2b')][_0x8562('0x37')]){_0x19c02a[_0x8562('0x38')]=_[_0x8562('0x3c')](_0x19c02a[_0x8562('0x38')],{'$or':_[_0x8562('0x39')](_0x19c02a[_0x8562('0x2f')],function(_0x578d7b){var _0x7b195e={};_0x7b195e[_0x578d7b]={'$like':'%'+_0x3bf753[_0x8562('0x2b')][_0x8562('0x37')]+'%'};return _0x7b195e;})});}_0x19c02a=_[_0x8562('0x3c')]({},_0x19c02a,_0x3bf753[_0x8562('0x3d')]);return _0x5704ea['getCrmWorkflowNextStep'](_0x19c02a);}})[_0x8562('0x23')](function(_0x17d052){if(_0x17d052){_0x451a2f=_0x17d052[_0x8562('0x31')];if(!_0x3bf753[_0x8562('0x2b')][_0x8562('0x32')](_0x8562('0x33'))){_0x19c02a[_0x8562('0x1d')]=qs['limit'](_0x3bf753['query'][_0x8562('0x1d')]);_0x19c02a[_0x8562('0x1c')]=qs[_0x8562('0x1c')](_0x3bf753['query'][_0x8562('0x1c')]);}return _0x5704ea[_0x8562('0x4c')](_0x19c02a);}})[_0x8562('0x23')](function(_0x397362){if(_0x397362){return _0x397362?{'count':_0x451a2f,'rows':_0x397362}:null;}})['then'](respondWithResult(_0xd292d6,null))['catch'](handleError(_0xd292d6,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.model.js b/server/api/crmWorkflowstep/crmWorkflowstep.model.js index b22358b..56fd57d 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.model.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa660=['exports','crm_workflow_steps','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./crmWorkflowstep.attributes'];(function(_0x478708,_0x816b6c){var _0x5c4bf0=function(_0x296658){while(--_0x296658){_0x478708['push'](_0x478708['shift']());}};_0x5c4bf0(++_0x816b6c);}(_0xa660,0x6e));var _0x0a66=function(_0x40ad5d,_0x2b757d){_0x40ad5d=_0x40ad5d-0x0;var _0xcae14e=_0xa660[_0x40ad5d];return _0xcae14e;};'use strict';var _=require(_0x0a66('0x0'));var util=require(_0x0a66('0x1'));var logger=require(_0x0a66('0x2'))('api');var moment=require(_0x0a66('0x3'));var BPromise=require(_0x0a66('0x4'));var rp=require(_0x0a66('0x5'));var fs=require('fs');var path=require(_0x0a66('0x6'));var rimraf=require(_0x0a66('0x7'));var config=require(_0x0a66('0x8'));var attributes=require(_0x0a66('0x9'));module[_0x0a66('0xa')]=function(_0x5b43cd,_0x22b5bc){return _0x5b43cd['define']('CrmWorkflowStep',attributes,{'tableName':_0x0a66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x547d=['rimraf','./crmWorkflowstep.attributes','exports','CrmWorkflowStep','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x547d,0xca));var _0xd547=function(_0x8fd6f5,_0x473312){_0x8fd6f5=_0x8fd6f5-0x0;var _0x458096=_0x547d[_0x8fd6f5];return _0x458096;};'use strict';var _=require(_0xd547('0x0'));var util=require(_0xd547('0x1'));var logger=require('../../config/logger')(_0xd547('0x2'));var moment=require(_0xd547('0x3'));var BPromise=require(_0xd547('0x4'));var rp=require(_0xd547('0x5'));var fs=require('fs');var path=require(_0xd547('0x6'));var rimraf=require(_0xd547('0x7'));var config=require('../../config/environment');var attributes=require(_0xd547('0x8'));module[_0xd547('0x9')]=function(_0x382808,_0x328c27){return _0x382808['define'](_0xd547('0xa'),attributes,{'tableName':'crm_workflow_steps','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js b/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js index 1f0aaff..524b1a0 100644 --- a/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js +++ b/server/api/crmWorkflowstep/crmWorkflowstep.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x613c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CrmWorkflowStep,\x20%s,\x20%s','request\x20sent','CrmWorkflowStep,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0x9f16d3,_0x26ce6a){var _0x14d37c=function(_0x1c37e6){while(--_0x1c37e6){_0x9f16d3['push'](_0x9f16d3['shift']());}};_0x14d37c(++_0x26ce6a);}(_0x613c,0xd9));var _0xc613=function(_0x36c5d5,_0x45eb64){_0x36c5d5=_0x36c5d5-0x0;var _0x365848=_0x613c[_0x36c5d5];return _0x365848;};'use strict';var _=require(_0xc613('0x0'));var util=require(_0xc613('0x1'));var moment=require('moment');var BPromise=require(_0xc613('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc613('0x3'))['db'];var utils=require(_0xc613('0x4'));var logger=require(_0xc613('0x5'))(_0xc613('0x6'));var config=require('../../config/environment');var jayson=require(_0xc613('0x7'));var client=jayson[_0xc613('0x8')][_0xc613('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1addff,_0x4e0c62,_0x2a01e9){return new BPromise(function(_0x37f461,_0x521605){return client[_0xc613('0xa')](_0x1addff,_0x2a01e9)[_0xc613('0xb')](function(_0x16faab){logger['info'](_0xc613('0xc'),_0x4e0c62,_0xc613('0xd'));logger['debug'](_0xc613('0xe'),_0x4e0c62,'request\x20sent',JSON[_0xc613('0xf')](_0x16faab));if(_0x16faab[_0xc613('0x10')]){if(_0x16faab[_0xc613('0x10')][_0xc613('0x11')]===0x1f4){logger[_0xc613('0x10')]('CrmWorkflowStep,\x20%s,\x20%s',_0x4e0c62,_0x16faab[_0xc613('0x10')][_0xc613('0x12')]);return _0x521605(_0x16faab[_0xc613('0x10')][_0xc613('0x12')]);}logger[_0xc613('0x10')]('CrmWorkflowStep,\x20%s,\x20%s',_0x4e0c62,_0x16faab['error'][_0xc613('0x12')]);return _0x37f461(_0x16faab[_0xc613('0x10')][_0xc613('0x12')]);}else{logger[_0xc613('0x13')](_0xc613('0xc'),_0x4e0c62,_0xc613('0xd'));_0x37f461(_0x16faab[_0xc613('0x14')][_0xc613('0x12')]);}})[_0xc613('0x15')](function(_0x5445fc){logger[_0xc613('0x10')](_0xc613('0xc'),_0x4e0c62,_0x5445fc);_0x521605(_0x5445fc);});});} \ No newline at end of file +var _0x2aa7=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','CrmWorkflowStep,\x20%s,\x20%s','message','result','catch','util'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x2aa7,0x11c));var _0x72aa=function(_0x33179e,_0x26c22f){_0x33179e=_0x33179e-0x0;var _0x166110=_0x2aa7[_0x33179e];return _0x166110;};'use strict';var _=require('lodash');var util=require(_0x72aa('0x0'));var moment=require(_0x72aa('0x1'));var BPromise=require('bluebird');var rs=require(_0x72aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x72aa('0x4'))(_0x72aa('0x5'));var config=require(_0x72aa('0x6'));var jayson=require(_0x72aa('0x7'));var client=jayson[_0x72aa('0x8')][_0x72aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d05c0,_0x462cb3,_0x22fa9f){return new BPromise(function(_0x379863,_0x21c217){return client[_0x72aa('0xa')](_0x4d05c0,_0x22fa9f)['then'](function(_0x2d8f7c){logger[_0x72aa('0xb')]('CrmWorkflowStep,\x20%s,\x20%s',_0x462cb3,_0x72aa('0xc'));logger['debug']('CrmWorkflowStep,\x20%s,\x20%s,\x20%s',_0x462cb3,_0x72aa('0xc'),JSON[_0x72aa('0xd')](_0x2d8f7c));if(_0x2d8f7c[_0x72aa('0xe')]){if(_0x2d8f7c[_0x72aa('0xe')]['code']===0x1f4){logger[_0x72aa('0xe')](_0x72aa('0xf'),_0x462cb3,_0x2d8f7c[_0x72aa('0xe')][_0x72aa('0x10')]);return _0x21c217(_0x2d8f7c['error'][_0x72aa('0x10')]);}logger[_0x72aa('0xe')](_0x72aa('0xf'),_0x462cb3,_0x2d8f7c[_0x72aa('0xe')][_0x72aa('0x10')]);return _0x379863(_0x2d8f7c[_0x72aa('0xe')]['message']);}else{logger[_0x72aa('0xb')](_0x72aa('0xf'),_0x462cb3,_0x72aa('0xc'));_0x379863(_0x2d8f7c[_0x72aa('0x11')]['message']);}})[_0x72aa('0x12')](function(_0xe1bae2){logger['error']('CrmWorkflowStep,\x20%s,\x20%s',_0x462cb3,_0xe1bae2);_0x21c217(_0xe1bae2);});});} \ No newline at end of file diff --git a/server/api/crmWorkflowstep/index.js b/server/api/crmWorkflowstep/index.js index 2b8fce9..d36a078 100644 --- a/server/api/crmWorkflowstep/index.js +++ b/server/api/crmWorkflowstep/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['describe','/:id','show','/:id/steps','getCrmWorkflowNextStep','create','post','addCrmWorkflowNextStep','update','delete','destroy','removeCrmWorkflowNextStep','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./crmWorkflowstep.controller','isAuthenticated','index','get','/describe'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xadb5,0xad));var _0x5adb=function(_0xae01c1,_0x289825){_0xae01c1=_0xae01c1-0x0;var _0x20e67f=_0xadb5[_0xae01c1];return _0x20e67f;};'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('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')](_0x5adb('0xe'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['put'](_0x5adb('0xc'),auth['isAuthenticated'](),controller[_0x5adb('0x13')]);router[_0x5adb('0x14')](_0x5adb('0xc'),auth['isAuthenticated'](),controller[_0x5adb('0x15')]);router[_0x5adb('0x14')](_0x5adb('0xe'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['removeCrmWorkflowNextStep','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/steps','create','post','addCrmWorkflowNextStep','update','delete','destroy'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2ef3,0xba));var _0x32ef=function(_0x418483,_0x16c664){_0x418483=_0x418483-0x0;var _0x4cd0e3=_0x2ef3[_0x418483];return _0x4cd0e3;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./crmWorkflowstep.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['getCrmWorkflowNextStep']);router['post']('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router[_0x32ef('0x10')](_0x32ef('0xe'),auth['isAuthenticated'](),controller[_0x32ef('0x11')]);router['put'](_0x32ef('0xc'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router[_0x32ef('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router['delete'](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x15')]);module[_0x32ef('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 431450f..4b24938 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 _0xfa9d=['sequelize','STRING','name'];(function(_0x18fc8b,_0x122a7d){var _0x19da15=function(_0x53334e){while(--_0x53334e){_0x18fc8b['push'](_0x18fc8b['shift']());}};_0x19da15(++_0x122a7d);}(_0xfa9d,0x156));var _0xdfa9=function(_0x4c20b4,_0x365825){_0x4c20b4=_0x4c20b4-0x0;var _0x87980a=_0xfa9d[_0x4c20b4];return _0x87980a;};'use strict';var Sequelize=require(_0xdfa9('0x0'));module['exports']={'name':{'type':Sequelize[_0xdfa9('0x1')],'allowNull':![],'unique':_0xdfa9('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ffa=['sequelize','exports','STRING','name'];(function(_0x407a8e,_0x3e3631){var _0x2618a3=function(_0x49e068){while(--_0x49e068){_0x407a8e['push'](_0x407a8e['shift']());}};_0x2618a3(++_0x3e3631);}(_0x7ffa,0x108));var _0xa7ff=function(_0x123278,_0x3c4305){_0x123278=_0x123278-0x0;var _0x586de2=_0x7ffa[_0x123278];return _0x586de2;};'use strict';var Sequelize=require(_0xa7ff('0x0'));module[_0xa7ff('0x1')]={'name':{'type':Sequelize[_0xa7ff('0x2')],'allowNull':![],'unique':_0xa7ff('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 22d2661..76f3440 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 _0x2dd6=['createdAt','updatedAt','user','autoAssociation','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','end','json','count','offset','limit','status','set','reject','update','destroy','then','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','field','options','findAll','catch','show','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit'];(function(_0x21c006,_0x3331eb){var _0x2cd053=function(_0x43d77b){while(--_0x43d77b){_0x21c006['push'](_0x21c006['shift']());}};_0x2cd053(++_0x3331eb);}(_0x2dd6,0x8f));var _0x62dd=function(_0x2782b1,_0x1f93f4){_0x2782b1=_0x2782b1-0x0;var _0x98e50a=_0x2dd6[_0x2782b1];return _0x98e50a;};'use strict';var pdf=require(_0x62dd('0x0'));var emlformat=require(_0x62dd('0x1'));var rimraf=require(_0x62dd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62dd('0x3'));var rp=require(_0x62dd('0x4'));var moment=require(_0x62dd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x62dd('0x6'));var util=require(_0x62dd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x62dd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x62dd('0x9'));var squel=require(_0x62dd('0xa'));var crypto=require('crypto');var jsforce=require(_0x62dd('0xb'));var deskjs=require(_0x62dd('0xc'));var toCsv=require(_0x62dd('0x8'));var querystring=require(_0x62dd('0xd'));var Papa=require('papaparse');var Redis=require(_0x62dd('0xe'));var authService=require(_0x62dd('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x62dd('0x10'));var logger=require(_0x62dd('0x11'))('api');var utils=require(_0x62dd('0x12'));var config=require('../../config/environment');var db=require(_0x62dd('0x13'))['db'];config[_0x62dd('0x14')]=_[_0x62dd('0x15')](config[_0x62dd('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x62dd('0x16'))(new Redis(config['redis']));require(_0x62dd('0x17'))[_0x62dd('0x18')](socket);function respondWithStatusCode(_0x5de327,_0x3fdb1a){_0x3fdb1a=_0x3fdb1a||0xcc;return function(_0x25eaed){if(_0x25eaed){return _0x5de327['sendStatus'](_0x3fdb1a);}return _0x5de327['status'](_0x3fdb1a)[_0x62dd('0x19')]();};}function respondWithResult(_0x51b849,_0x906db2){_0x906db2=_0x906db2||0xc8;return function(_0x4c5f70){if(_0x4c5f70){return _0x51b849['status'](_0x906db2)[_0x62dd('0x1a')](_0x4c5f70);}};}function respondWithFilteredResult(_0x2d2793,_0x202d67){return function(_0xdef581){if(_0xdef581){var _0xe2794b=_0xdef581[_0x62dd('0x1b')],_0x53c0e8=_0x202d67[_0x62dd('0x1c')],_0x2ff7fb=_0x202d67[_0x62dd('0x1c')]+_0x202d67[_0x62dd('0x1d')],_0x16098c;if(_0x2ff7fb>=_0xe2794b){_0x2ff7fb=_0xe2794b;_0x16098c=0xc8;}else{_0x16098c=0xce;}_0x2d2793[_0x62dd('0x1e')](_0x16098c);return _0x2d2793[_0x62dd('0x1f')]('Content-Range',_0x53c0e8+'-'+_0x2ff7fb+'/'+_0xe2794b)[_0x62dd('0x1a')](_0xdef581);}return null;};}function patchUpdates(_0xad08e7){return function(_0x15fe02){try{jsonpatch['apply'](_0x15fe02,_0xad08e7,!![]);}catch(_0x247363){return BPromise[_0x62dd('0x20')](_0x247363);}return _0x15fe02['save']();};}function saveUpdates(_0xd13211,_0x53f851){return function(_0x6045ac){if(_0x6045ac){return _0x6045ac[_0x62dd('0x21')](_0xd13211)['then'](function(_0x4bc59a){return _0x4bc59a;});}return null;};}function removeEntity(_0xa09c32,_0x56955e){return function(_0x3ab4ce){if(_0x3ab4ce){return _0x3ab4ce[_0x62dd('0x22')]()[_0x62dd('0x23')](function(){var _0x81ea49=_0x3ab4ce['get']({'plain':!![]});var _0x1bd521=_0x62dd('0x24');return db[_0x62dd('0x25')][_0x62dd('0x22')]({'where':{'type':_0x1bd521,'resourceId':_0x81ea49['id']}})[_0x62dd('0x23')](function(){return _0x3ab4ce;});})[_0x62dd('0x23')](function(){_0xa09c32[_0x62dd('0x1e')](0xcc)[_0x62dd('0x19')]();});}};}function handleEntityNotFound(_0x9f224b,_0x527481){return function(_0x1e4ce7){if(!_0x1e4ce7){_0x9f224b[_0x62dd('0x26')](0x194);}return _0x1e4ce7;};}function handleError(_0x5c3e86,_0x52fbef){_0x52fbef=_0x52fbef||0x1f4;return function(_0x365fd6){logger[_0x62dd('0x27')](_0x365fd6[_0x62dd('0x28')]);if(_0x365fd6[_0x62dd('0x29')]){delete _0x365fd6[_0x62dd('0x29')];}_0x5c3e86[_0x62dd('0x1e')](_0x52fbef)[_0x62dd('0x2a')](_0x365fd6);};}exports['index']=function(_0x5d5658,_0x150e60){var _0x272fab={},_0x3e1cd3={},_0x4a0910={'count':0x0,'rows':[]};var _0x4a9465=db[_0x62dd('0x2b')][_0x62dd('0x2c')];_0x3e1cd3[_0x62dd('0x2d')]=_[_0x62dd('0x2e')](_0x4a9465);_0x3e1cd3['query']=_[_0x62dd('0x2e')](_0x5d5658[_0x62dd('0x2f')]);_0x3e1cd3[_0x62dd('0x30')]=_[_0x62dd('0x31')](_0x3e1cd3['model'],_0x3e1cd3[_0x62dd('0x2f')]);_0x272fab[_0x62dd('0x32')]=_[_0x62dd('0x31')](_0x3e1cd3['model'],qs[_0x62dd('0x33')](_0x5d5658[_0x62dd('0x2f')][_0x62dd('0x33')]));_0x272fab[_0x62dd('0x32')]=_0x272fab[_0x62dd('0x32')][_0x62dd('0x34')]?_0x272fab['attributes']:_0x3e1cd3[_0x62dd('0x2d')];if(!_0x5d5658['query'][_0x62dd('0x35')](_0x62dd('0x36'))){_0x272fab['limit']=qs[_0x62dd('0x1d')](_0x5d5658[_0x62dd('0x2f')]['limit']);_0x272fab['offset']=qs[_0x62dd('0x1c')](_0x5d5658[_0x62dd('0x2f')][_0x62dd('0x1c')]);}_0x272fab['order']=qs['sort'](_0x5d5658[_0x62dd('0x2f')][_0x62dd('0x37')]);_0x272fab[_0x62dd('0x38')]=qs['filters'](_[_0x62dd('0x39')](_0x5d5658[_0x62dd('0x2f')],_0x3e1cd3[_0x62dd('0x30')]));if(_0x5d5658[_0x62dd('0x2f')][_0x62dd('0x3a')]){_0x272fab[_0x62dd('0x38')]=_[_0x62dd('0x3b')](_0x272fab[_0x62dd('0x38')],{'$or':_[_0x62dd('0x3c')](_0x4a9465,function(_0x5e64e7){if(_0x5e64e7[_0x62dd('0x3d')]['key']!=='VIRTUAL'){var _0x4e5815={};_0x4e5815[_0x5e64e7[_0x62dd('0x3e')]]={'$like':'%'+_0x5d5658['query']['filter']+'%'};return _0x4e5815;}})});}_0x272fab=_['merge']({},_0x272fab,_0x5d5658[_0x62dd('0x3f')]);var _0x23662d={'where':_0x272fab[_0x62dd('0x38')]};return db['Dashboard'][_0x62dd('0x1b')](_0x23662d)[_0x62dd('0x23')](function(_0x32bda8){_0x4a0910['count']=_0x32bda8;if(_0x5d5658[_0x62dd('0x2f')]['includeAll']){_0x272fab['include']=[{'all':!![]}];}return db[_0x62dd('0x2b')][_0x62dd('0x40')](_0x272fab);})[_0x62dd('0x23')](function(_0x4940a2){_0x4a0910['rows']=_0x4940a2;return _0x4a0910;})[_0x62dd('0x23')](respondWithFilteredResult(_0x150e60,_0x272fab))[_0x62dd('0x41')](handleError(_0x150e60,null));};exports[_0x62dd('0x42')]=function(_0x435d1d,_0x12d40a){var _0x2a8f41={'raw':![],'where':{'id':_0x435d1d['params']['id']}},_0x46ca21={};_0x46ca21[_0x62dd('0x2d')]=_[_0x62dd('0x2e')](db[_0x62dd('0x2b')][_0x62dd('0x2c')]);_0x46ca21['query']=_[_0x62dd('0x2e')](_0x435d1d['query']);_0x46ca21[_0x62dd('0x30')]=_[_0x62dd('0x31')](_0x46ca21[_0x62dd('0x2d')],_0x46ca21[_0x62dd('0x2f')]);_0x2a8f41['attributes']=_['intersection'](_0x46ca21['model'],qs['fields'](_0x435d1d['query'][_0x62dd('0x33')]));_0x2a8f41[_0x62dd('0x32')]=_0x2a8f41[_0x62dd('0x32')]['length']?_0x2a8f41[_0x62dd('0x32')]:_0x46ca21['model'];if(_0x435d1d['query'][_0x62dd('0x43')]){_0x2a8f41[_0x62dd('0x44')]=[{'all':!![]}];}_0x2a8f41=_['merge']({},_0x2a8f41,_0x435d1d[_0x62dd('0x3f')]);return db[_0x62dd('0x2b')][_0x62dd('0x45')](_0x2a8f41)[_0x62dd('0x23')](handleEntityNotFound(_0x12d40a,null))['then'](respondWithResult(_0x12d40a,null))[_0x62dd('0x41')](handleError(_0x12d40a,null));};exports['create']=function(_0x364aaa,_0xbb11d9){return db[_0x62dd('0x2b')][_0x62dd('0x46')](_0x364aaa[_0x62dd('0x47')],{})[_0x62dd('0x23')](function(_0x3fee16){var _0x4ff864=_0x364aaa['user'][_0x62dd('0x48')]({'plain':!![]});if(!_0x4ff864)throw new Error(_0x62dd('0x49'));if(_0x4ff864[_0x62dd('0x4a')]==='user'){var _0x424562=_0x3fee16['get']({'plain':!![]});var _0x35d9ea='CustomDashboards';return db[_0x62dd('0x4b')][_0x62dd('0x45')]({'where':{'name':_0x35d9ea,'userProfileId':_0x4ff864[_0x62dd('0x4c')]},'raw':!![]})[_0x62dd('0x23')](function(_0x2152ff){if(_0x2152ff&&_0x2152ff['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x424562[_0x62dd('0x29')],'resourceId':_0x424562['id'],'type':_0x2152ff[_0x62dd('0x29')],'sectionId':_0x2152ff['id']},{})[_0x62dd('0x23')](function(){return _0x3fee16;});}else{return _0x3fee16;}})[_0x62dd('0x41')](function(_0x190a8d){logger[_0x62dd('0x27')](_0x62dd('0x4d'),_0x190a8d);throw _0x190a8d;});}return _0x3fee16;})[_0x62dd('0x23')](respondWithResult(_0xbb11d9,0xc9))[_0x62dd('0x41')](handleError(_0xbb11d9,null));};exports[_0x62dd('0x4e')]=function(_0x522410,_0xef0de9){var _0x1c03d2={'raw':![],'where':{'id':_0x522410[_0x62dd('0x4f')]['id']}},_0x27e2a8={};_0x27e2a8['model']=_[_0x62dd('0x2e')](db[_0x62dd('0x2b')][_0x62dd('0x2c')]);_0x1c03d2[_0x62dd('0x32')]=_[_0x62dd('0x31')](_0x27e2a8['model'],qs[_0x62dd('0x33')](_0x522410[_0x62dd('0x2f')][_0x62dd('0x33')]));_0x1c03d2[_0x62dd('0x32')]=_0x1c03d2['attributes']['length']?_0x1c03d2['attributes']:_0x27e2a8[_0x62dd('0x2d')];if(_0x522410[_0x62dd('0x2f')][_0x62dd('0x43')]){_0x1c03d2[_0x62dd('0x44')]=[{'all':!![]}];}_0x1c03d2=_['merge']({},_0x1c03d2,_0x522410[_0x62dd('0x3f')]);return db[_0x62dd('0x2b')][_0x62dd('0x45')](_0x1c03d2)[_0x62dd('0x23')](handleEntityNotFound(_0xef0de9,null))[_0x62dd('0x23')](function(_0x16b2b4){if(_0x16b2b4){var _0x1488ae=_0x16b2b4['get']({'plain':!![]});_0x1488ae=qs[_0x62dd('0x50')](_0x1488ae,['id',_0x62dd('0x51'),_0x62dd('0x52')]);_0x522410[_0x62dd('0x47')]=_[_0x62dd('0x50')](_0x522410['body'],['id',_0x62dd('0x51'),_0x62dd('0x52')]);return db[_0x62dd('0x2b')][_0x62dd('0x46')](_[_0x62dd('0x3b')](_0x1488ae,_0x522410[_0x62dd('0x47')]),{'include':_0x522410['query'][_0x62dd('0x43')]?[{'all':!![]}]:undefined})[_0x62dd('0x23')](function(_0x67cf9a){var _0x319ddb=_0x522410[_0x62dd('0x53')][_0x62dd('0x48')]({'plain':!![]});if(!_0x319ddb)throw new Error(_0x62dd('0x49'));if(_0x319ddb[_0x62dd('0x4a')]===_0x62dd('0x53')){var _0x1589e0=_0x67cf9a[_0x62dd('0x48')]({'plain':!![]});var _0x2a9e5e='CustomDashboards';return db[_0x62dd('0x4b')]['find']({'where':{'name':_0x2a9e5e,'userProfileId':_0x319ddb[_0x62dd('0x4c')]},'raw':!![]})['then'](function(_0x35ef31){if(_0x35ef31&&_0x35ef31[_0x62dd('0x54')]===0x0){return db[_0x62dd('0x25')][_0x62dd('0x46')]({'name':_0x1589e0[_0x62dd('0x29')],'resourceId':_0x1589e0['id'],'type':_0x35ef31[_0x62dd('0x29')],'sectionId':_0x35ef31['id']},{})['then'](function(){return _0x67cf9a;});}else{return _0x67cf9a;}})[_0x62dd('0x41')](function(_0x1a2003){logger[_0x62dd('0x27')](_0x62dd('0x4d'),_0x1a2003);throw _0x1a2003;});}return _0x67cf9a;});}})['then'](respondWithResult(_0xef0de9,0xc9))[_0x62dd('0x41')](handleError(_0xef0de9,null));};exports[_0x62dd('0x21')]=function(_0x43cfc9,_0x336221){if(_0x43cfc9[_0x62dd('0x47')]['id']){delete _0x43cfc9[_0x62dd('0x47')]['id'];}return db['Dashboard'][_0x62dd('0x45')]({'where':{'id':_0x43cfc9[_0x62dd('0x4f')]['id']}})[_0x62dd('0x23')](handleEntityNotFound(_0x336221,null))[_0x62dd('0x23')](saveUpdates(_0x43cfc9[_0x62dd('0x47')],null))[_0x62dd('0x23')](respondWithResult(_0x336221,null))[_0x62dd('0x41')](handleError(_0x336221,null));};exports['destroy']=function(_0x371a37,_0x5a0f6d){return db[_0x62dd('0x2b')][_0x62dd('0x45')]({'where':{'id':_0x371a37[_0x62dd('0x4f')]['id']}})[_0x62dd('0x23')](handleEntityNotFound(_0x5a0f6d,null))[_0x62dd('0x23')](removeEntity(_0x5a0f6d,null))[_0x62dd('0x41')](handleError(_0x5a0f6d,null));};function widgetAttributes(_0x1391cc){try{switch(_0x1391cc[_0x62dd('0x3d')]){case'iframe':return[{'name':_0x62dd('0x55'),'value':_0x1391cc['attrUrl']||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc[_0x62dd('0x56')][0x0][_0x62dd('0x57')]:undefined)||'https://'}];case'custom':return[{'name':_0x62dd('0x58'),'value':_0x1391cc[_0x62dd('0x58')]||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc[_0x62dd('0x56')][0x0][_0x62dd('0x57')]:undefined)||''}];case _0x62dd('0x59'):return[{'name':_0x62dd('0x5a'),'value':_0x1391cc[_0x62dd('0x5a')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc['attrs'][0x0]?_0x1391cc[_0x62dd('0x56')][0x0]['value']:undefined)||_0x62dd('0x5b')},{'name':_0x62dd('0x5c'),'value':_0x1391cc[_0x62dd('0x5c')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x1]?_0x1391cc['attrs'][0x1][_0x62dd('0x57')]:undefined)||_0x62dd('0x5d')},{'name':_0x62dd('0x5e'),'value':_0x1391cc[_0x62dd('0x5e')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x2]?_0x1391cc[_0x62dd('0x56')][0x2][_0x62dd('0x57')]:undefined)||0xc}];case _0x62dd('0x5f'):return[{'name':'attrMetric','value':_0x1391cc['attrMetric']||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc[_0x62dd('0x56')][0x0][_0x62dd('0x57')]:undefined)||_0x62dd('0x60')},{'name':_0x62dd('0x61'),'value':_0x1391cc['attrVoiceQueues']||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x1]?_0x1391cc[_0x62dd('0x56')][0x1]['value']:undefined)||[]},{'name':_0x62dd('0x5e'),'value':_0x1391cc[_0x62dd('0x5e')]||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x2]?_0x1391cc[_0x62dd('0x56')][0x2][_0x62dd('0x57')]:undefined)||0x14}];case _0x62dd('0x62'):case _0x62dd('0x63'):return[{'name':'attrSerie1','value':_0x1391cc[_0x62dd('0x64')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc['attrs'][0x0][_0x62dd('0x57')]:undefined)||'total'},{'name':'attrSerie2','value':_0x1391cc[_0x62dd('0x65')]||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x1]?_0x1391cc[_0x62dd('0x56')][0x1]['value']:undefined)||null},{'name':_0x62dd('0x66'),'value':_0x1391cc['attrSerie3']||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x2]?_0x1391cc[_0x62dd('0x56')][0x2][_0x62dd('0x57')]:undefined)||null},{'name':_0x62dd('0x61'),'value':_0x1391cc[_0x62dd('0x61')]||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x3]?_0x1391cc[_0x62dd('0x56')][0x3][_0x62dd('0x57')]:undefined)||[]}];case _0x62dd('0x67'):return[{'name':_0x62dd('0x68'),'type':_0x1391cc['reportType']||(_0x1391cc['attrs']&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc['attrs'][0x0][_0x62dd('0x3d')]:undefined)||null,'value':_0x1391cc[_0x62dd('0x68')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc[_0x62dd('0x56')][0x0]?_0x1391cc[_0x62dd('0x56')][0x0][_0x62dd('0x57')]:undefined)||null},{'name':_0x62dd('0x69'),'value':_0x1391cc[_0x62dd('0x69')]||(_0x1391cc[_0x62dd('0x56')]&&_0x1391cc['attrs'][0x1]?_0x1391cc[_0x62dd('0x56')][0x1][_0x62dd('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x4578f2){logger['error'](_0x62dd('0x6a'),JSON[_0x62dd('0x6b')](_0x4578f2));return[];}}exports['addItem']=function(_0x23cca3,_0x2ba552,_0x1ec779){if(_0x23cca3['body']['id']){delete _0x23cca3[_0x62dd('0x47')]['id'];}return db[_0x62dd('0x2b')]['find']({'where':{'id':_0x23cca3['params']['id']}})[_0x62dd('0x23')](handleEntityNotFound(_0x2ba552,null))[_0x62dd('0x23')](function(_0x1a48d0){if(_0x1a48d0){_0x23cca3['body'][_0x62dd('0x6c')]=_0x1a48d0['id'];_0x23cca3[_0x62dd('0x47')]['attrs']=widgetAttributes(_0x23cca3[_0x62dd('0x47')]);return db[_0x62dd('0x6d')]['create'](_0x23cca3[_0x62dd('0x47')]);}})[_0x62dd('0x23')](respondWithResult(_0x2ba552,null))['catch'](handleError(_0x2ba552,null));};exports[_0x62dd('0x6e')]=function(_0x4e1f8f,_0x5ca450,_0x3448d0){var _0x3a4783={};var _0x4312ce={};var _0x4157b4;var _0x5b1877;return db[_0x62dd('0x2b')][_0x62dd('0x6f')]({'where':{'id':_0x4e1f8f['params']['id']}})[_0x62dd('0x23')](handleEntityNotFound(_0x5ca450,null))['then'](function(_0x2737a2){if(_0x2737a2){_0x4157b4=_0x2737a2;_0x4312ce[_0x62dd('0x2d')]=_['keys'](db[_0x62dd('0x6d')][_0x62dd('0x2c')]);_0x4312ce[_0x62dd('0x2f')]=_[_0x62dd('0x2e')](_0x4e1f8f['query']);_0x4312ce[_0x62dd('0x30')]=_[_0x62dd('0x31')](_0x4312ce[_0x62dd('0x2d')],_0x4312ce[_0x62dd('0x2f')]);_0x3a4783['attributes']=_[_0x62dd('0x31')](_0x4312ce[_0x62dd('0x2d')],qs[_0x62dd('0x33')](_0x4e1f8f[_0x62dd('0x2f')][_0x62dd('0x33')]));_0x3a4783[_0x62dd('0x32')]=_0x3a4783[_0x62dd('0x32')][_0x62dd('0x34')]?_0x3a4783['attributes']:_0x4312ce[_0x62dd('0x2d')];_0x3a4783['order']=qs['sort'](_0x4e1f8f['query'][_0x62dd('0x37')]);_0x3a4783[_0x62dd('0x38')]=qs[_0x62dd('0x30')](_['pick'](_0x4e1f8f[_0x62dd('0x2f')],_0x4312ce[_0x62dd('0x30')]));if(_0x4e1f8f[_0x62dd('0x2f')]['filter']){_0x3a4783[_0x62dd('0x38')]=_[_0x62dd('0x3b')](_0x3a4783[_0x62dd('0x38')],{'$or':_[_0x62dd('0x3c')](_0x3a4783[_0x62dd('0x32')],function(_0xe0b1a8){var _0x6d41d9={};_0x6d41d9[_0xe0b1a8]={'$like':'%'+_0x4e1f8f[_0x62dd('0x2f')][_0x62dd('0x3a')]+'%'};return _0x6d41d9;})});}_0x3a4783=_[_0x62dd('0x3b')]({},_0x3a4783,_0x4e1f8f[_0x62dd('0x3f')]);return _0x4157b4[_0x62dd('0x6e')](_0x3a4783);}})['then'](function(_0xb65b5c){if(_0xb65b5c){_0x5b1877=_0xb65b5c[_0x62dd('0x34')];if(!_0x4e1f8f[_0x62dd('0x2f')]['hasOwnProperty']('nolimit')){_0x3a4783['limit']=qs[_0x62dd('0x1d')](_0x4e1f8f[_0x62dd('0x2f')]['limit']);_0x3a4783[_0x62dd('0x1c')]=qs[_0x62dd('0x1c')](_0x4e1f8f[_0x62dd('0x2f')][_0x62dd('0x1c')]);}return _0x4157b4['getItems'](_0x3a4783);}})[_0x62dd('0x23')](function(_0x25c584){if(_0x25c584){return _0x25c584?{'count':_0x5b1877,'rows':_0x25c584}:null;}})[_0x62dd('0x23')](respondWithResult(_0x5ca450,null))[_0x62dd('0x41')](handleError(_0x5ca450,null));}; \ No newline at end of file +var _0xc635=['send','index','Dashboard','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','filter','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','get','CustomDashboards','UserProfileResource','destroy','error','stack'];(function(_0x3b1ddd,_0x7d234c){var _0x1d0725=function(_0x2ad2e5){while(--_0x2ad2e5){_0x3b1ddd['push'](_0x3b1ddd['shift']());}};_0x1d0725(++_0x7d234c);}(_0xc635,0x1b3));var _0x5c63=function(_0x27584e,_0x308674){_0x27584e=_0x27584e-0x0;var _0x48957b=_0xc635[_0x27584e];return _0x48957b;};'use strict';var pdf=require(_0x5c63('0x0'));var emlformat=require(_0x5c63('0x1'));var rimraf=require(_0x5c63('0x2'));var zipdir=require(_0x5c63('0x3'));var jsonpatch=require(_0x5c63('0x4'));var rp=require('request-promise');var moment=require(_0x5c63('0x5'));var BPromise=require(_0x5c63('0x6'));var Mustache=require(_0x5c63('0x7'));var util=require(_0x5c63('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c63('0x9'));var fs=require('fs');var _=require(_0x5c63('0xa'));var squel=require(_0x5c63('0xb'));var crypto=require(_0x5c63('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c63('0xd'));var toCsv=require(_0x5c63('0xe'));var querystring=require('querystring');var Papa=require(_0x5c63('0xf'));var Redis=require('ioredis');var authService=require(_0x5c63('0x10'));var qs=require(_0x5c63('0x11'));var hardwareService=require(_0x5c63('0x12'));var logger=require('../../config/logger')(_0x5c63('0x13'));var utils=require(_0x5c63('0x14'));var config=require(_0x5c63('0x15'));var db=require(_0x5c63('0x16'))['db'];config[_0x5c63('0x17')]=_[_0x5c63('0x18')](config[_0x5c63('0x17')],{'host':_0x5c63('0x19'),'port':0x18eb});var socket=require(_0x5c63('0x1a'))(new Redis(config[_0x5c63('0x17')]));require(_0x5c63('0x1b'))['register'](socket);function respondWithStatusCode(_0xc7b3d,_0xd2ecb1){_0xd2ecb1=_0xd2ecb1||0xcc;return function(_0x494c40){if(_0x494c40){return _0xc7b3d[_0x5c63('0x1c')](_0xd2ecb1);}return _0xc7b3d[_0x5c63('0x1d')](_0xd2ecb1)[_0x5c63('0x1e')]();};}function respondWithResult(_0x29e765,_0x4037a0){_0x4037a0=_0x4037a0||0xc8;return function(_0x526764){if(_0x526764){return _0x29e765[_0x5c63('0x1d')](_0x4037a0)[_0x5c63('0x1f')](_0x526764);}};}function respondWithFilteredResult(_0x459ca9,_0x2e6389){return function(_0x5b640c){if(_0x5b640c){var _0x49b9b6=_0x5b640c['count'],_0x3909d7=_0x2e6389[_0x5c63('0x20')],_0x2951d7=_0x2e6389[_0x5c63('0x20')]+_0x2e6389[_0x5c63('0x21')],_0x486dc5;if(_0x2951d7>=_0x49b9b6){_0x2951d7=_0x49b9b6;_0x486dc5=0xc8;}else{_0x486dc5=0xce;}_0x459ca9['status'](_0x486dc5);return _0x459ca9[_0x5c63('0x22')]('Content-Range',_0x3909d7+'-'+_0x2951d7+'/'+_0x49b9b6)[_0x5c63('0x1f')](_0x5b640c);}return null;};}function patchUpdates(_0x82da63){return function(_0x2aa6e4){try{jsonpatch[_0x5c63('0x23')](_0x2aa6e4,_0x82da63,!![]);}catch(_0x352c06){return BPromise['reject'](_0x352c06);}return _0x2aa6e4[_0x5c63('0x24')]();};}function saveUpdates(_0x252128,_0x26328f){return function(_0x2d89fb){if(_0x2d89fb){return _0x2d89fb[_0x5c63('0x25')](_0x252128)['then'](function(_0x502da){return _0x502da;});}return null;};}function removeEntity(_0x3581c3,_0x3cbfbd){return function(_0x5943cf){if(_0x5943cf){return _0x5943cf['destroy']()[_0x5c63('0x26')](function(){var _0x128981=_0x5943cf[_0x5c63('0x27')]({'plain':!![]});var _0xe72b80=_0x5c63('0x28');return db[_0x5c63('0x29')][_0x5c63('0x2a')]({'where':{'type':_0xe72b80,'resourceId':_0x128981['id']}})[_0x5c63('0x26')](function(){return _0x5943cf;});})[_0x5c63('0x26')](function(){_0x3581c3[_0x5c63('0x1d')](0xcc)[_0x5c63('0x1e')]();});}};}function handleEntityNotFound(_0x56dfb2,_0x402165){return function(_0x3934cc){if(!_0x3934cc){_0x56dfb2[_0x5c63('0x1c')](0x194);}return _0x3934cc;};}function handleError(_0x1ff7c2,_0x116f68){_0x116f68=_0x116f68||0x1f4;return function(_0x9dfbcc){logger[_0x5c63('0x2b')](_0x9dfbcc[_0x5c63('0x2c')]);if(_0x9dfbcc['name']){delete _0x9dfbcc['name'];}_0x1ff7c2['status'](_0x116f68)[_0x5c63('0x2d')](_0x9dfbcc);};}exports[_0x5c63('0x2e')]=function(_0x4def3a,_0x24f993){var _0x24ebd6={},_0x29f500={},_0x824e14={'count':0x0,'rows':[]};var _0x6a8766=db[_0x5c63('0x2f')]['rawAttributes'];_0x29f500[_0x5c63('0x30')]=_['keys'](_0x6a8766);_0x29f500[_0x5c63('0x31')]=_[_0x5c63('0x32')](_0x4def3a[_0x5c63('0x31')]);_0x29f500[_0x5c63('0x33')]=_[_0x5c63('0x34')](_0x29f500[_0x5c63('0x30')],_0x29f500[_0x5c63('0x31')]);_0x24ebd6[_0x5c63('0x35')]=_['intersection'](_0x29f500[_0x5c63('0x30')],qs[_0x5c63('0x36')](_0x4def3a[_0x5c63('0x31')][_0x5c63('0x36')]));_0x24ebd6['attributes']=_0x24ebd6['attributes'][_0x5c63('0x37')]?_0x24ebd6['attributes']:_0x29f500[_0x5c63('0x30')];if(!_0x4def3a[_0x5c63('0x31')][_0x5c63('0x38')]('nolimit')){_0x24ebd6[_0x5c63('0x21')]=qs[_0x5c63('0x21')](_0x4def3a['query'][_0x5c63('0x21')]);_0x24ebd6[_0x5c63('0x20')]=qs['offset'](_0x4def3a[_0x5c63('0x31')]['offset']);}_0x24ebd6[_0x5c63('0x39')]=qs['sort'](_0x4def3a['query'][_0x5c63('0x3a')]);_0x24ebd6[_0x5c63('0x3b')]=qs['filters'](_[_0x5c63('0x3c')](_0x4def3a[_0x5c63('0x31')],_0x29f500[_0x5c63('0x33')]));if(_0x4def3a[_0x5c63('0x31')]['filter']){_0x24ebd6[_0x5c63('0x3b')]=_['merge'](_0x24ebd6[_0x5c63('0x3b')],{'$or':_[_0x5c63('0x3d')](_0x6a8766,function(_0x174244){if(_0x174244[_0x5c63('0x3e')][_0x5c63('0x3f')]!==_0x5c63('0x40')){var _0x3d22b9={};_0x3d22b9[_0x174244[_0x5c63('0x41')]]={'$like':'%'+_0x4def3a['query']['filter']+'%'};return _0x3d22b9;}})});}_0x24ebd6=_[_0x5c63('0x42')]({},_0x24ebd6,_0x4def3a[_0x5c63('0x43')]);var _0x1a78f5={'where':_0x24ebd6[_0x5c63('0x3b')]};return db[_0x5c63('0x2f')][_0x5c63('0x44')](_0x1a78f5)[_0x5c63('0x26')](function(_0x173165){_0x824e14[_0x5c63('0x44')]=_0x173165;if(_0x4def3a['query'][_0x5c63('0x45')]){_0x24ebd6['include']=[{'all':!![]}];}return db[_0x5c63('0x2f')][_0x5c63('0x46')](_0x24ebd6);})[_0x5c63('0x26')](function(_0x51e249){_0x824e14['rows']=_0x51e249;return _0x824e14;})['then'](respondWithFilteredResult(_0x24f993,_0x24ebd6))[_0x5c63('0x47')](handleError(_0x24f993,null));};exports[_0x5c63('0x48')]=function(_0x57bd6a,_0x258888){var _0x324bf3={'raw':![],'where':{'id':_0x57bd6a[_0x5c63('0x49')]['id']}},_0x4b27b2={};_0x4b27b2[_0x5c63('0x30')]=_[_0x5c63('0x32')](db[_0x5c63('0x2f')][_0x5c63('0x4a')]);_0x4b27b2[_0x5c63('0x31')]=_[_0x5c63('0x32')](_0x57bd6a[_0x5c63('0x31')]);_0x4b27b2[_0x5c63('0x33')]=_[_0x5c63('0x34')](_0x4b27b2['model'],_0x4b27b2['query']);_0x324bf3['attributes']=_[_0x5c63('0x34')](_0x4b27b2[_0x5c63('0x30')],qs['fields'](_0x57bd6a[_0x5c63('0x31')][_0x5c63('0x36')]));_0x324bf3[_0x5c63('0x35')]=_0x324bf3['attributes'][_0x5c63('0x37')]?_0x324bf3[_0x5c63('0x35')]:_0x4b27b2[_0x5c63('0x30')];if(_0x57bd6a[_0x5c63('0x31')][_0x5c63('0x45')]){_0x324bf3['include']=[{'all':!![]}];}_0x324bf3=_[_0x5c63('0x42')]({},_0x324bf3,_0x57bd6a[_0x5c63('0x43')]);return db['Dashboard'][_0x5c63('0x4b')](_0x324bf3)[_0x5c63('0x26')](handleEntityNotFound(_0x258888,null))[_0x5c63('0x26')](respondWithResult(_0x258888,null))[_0x5c63('0x47')](handleError(_0x258888,null));};exports[_0x5c63('0x4c')]=function(_0x13c2f4,_0x497e6b){return db['Dashboard']['create'](_0x13c2f4[_0x5c63('0x4d')],{})[_0x5c63('0x26')](function(_0x160abd){var _0xf8e7ff=_0x13c2f4[_0x5c63('0x4e')][_0x5c63('0x27')]({'plain':!![]});if(!_0xf8e7ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf8e7ff[_0x5c63('0x4f')]===_0x5c63('0x4e')){var _0x271e65=_0x160abd[_0x5c63('0x27')]({'plain':!![]});var _0x171e34=_0x5c63('0x28');return db['UserProfileSection'][_0x5c63('0x4b')]({'where':{'name':_0x171e34,'userProfileId':_0xf8e7ff[_0x5c63('0x50')]},'raw':!![]})['then'](function(_0x4aadbf){if(_0x4aadbf&&_0x4aadbf[_0x5c63('0x51')]===0x0){return db[_0x5c63('0x29')]['create']({'name':_0x271e65[_0x5c63('0x52')],'resourceId':_0x271e65['id'],'type':_0x4aadbf[_0x5c63('0x52')],'sectionId':_0x4aadbf['id']},{})['then'](function(){return _0x160abd;});}else{return _0x160abd;}})[_0x5c63('0x47')](function(_0x73996b){logger[_0x5c63('0x2b')](_0x5c63('0x53'),_0x73996b);throw _0x73996b;});}return _0x160abd;})[_0x5c63('0x26')](respondWithResult(_0x497e6b,0xc9))[_0x5c63('0x47')](handleError(_0x497e6b,null));};exports[_0x5c63('0x54')]=function(_0x5535f7,_0x382bc4){var _0x1dd028={'raw':![],'where':{'id':_0x5535f7[_0x5c63('0x49')]['id']}},_0x360bed={};_0x360bed[_0x5c63('0x30')]=_[_0x5c63('0x32')](db['Dashboard']['rawAttributes']);_0x1dd028['attributes']=_['intersection'](_0x360bed['model'],qs[_0x5c63('0x36')](_0x5535f7[_0x5c63('0x31')][_0x5c63('0x36')]));_0x1dd028['attributes']=_0x1dd028[_0x5c63('0x35')][_0x5c63('0x37')]?_0x1dd028['attributes']:_0x360bed[_0x5c63('0x30')];if(_0x5535f7[_0x5c63('0x31')][_0x5c63('0x45')]){_0x1dd028[_0x5c63('0x55')]=[{'all':!![]}];}_0x1dd028=_[_0x5c63('0x42')]({},_0x1dd028,_0x5535f7[_0x5c63('0x43')]);return db[_0x5c63('0x2f')][_0x5c63('0x4b')](_0x1dd028)['then'](handleEntityNotFound(_0x382bc4,null))[_0x5c63('0x26')](function(_0x3a23f0){if(_0x3a23f0){var _0x1769f4=_0x3a23f0[_0x5c63('0x27')]({'plain':!![]});_0x1769f4=qs[_0x5c63('0x56')](_0x1769f4,['id',_0x5c63('0x57'),_0x5c63('0x58')]);_0x5535f7['body']=_[_0x5c63('0x56')](_0x5535f7[_0x5c63('0x4d')],['id',_0x5c63('0x57'),_0x5c63('0x58')]);return db[_0x5c63('0x2f')][_0x5c63('0x4c')](_[_0x5c63('0x42')](_0x1769f4,_0x5535f7[_0x5c63('0x4d')]),{'include':_0x5535f7[_0x5c63('0x31')][_0x5c63('0x45')]?[{'all':!![]}]:undefined})[_0x5c63('0x26')](function(_0x1019bb){var _0x35171a=_0x5535f7['user'][_0x5c63('0x27')]({'plain':!![]});if(!_0x35171a)throw new Error(_0x5c63('0x59'));if(_0x35171a['role']===_0x5c63('0x4e')){var _0x5e609d=_0x1019bb[_0x5c63('0x27')]({'plain':!![]});var _0xdb607a=_0x5c63('0x28');return db['UserProfileSection'][_0x5c63('0x4b')]({'where':{'name':_0xdb607a,'userProfileId':_0x35171a[_0x5c63('0x50')]},'raw':!![]})[_0x5c63('0x26')](function(_0x5e2bfd){if(_0x5e2bfd&&_0x5e2bfd[_0x5c63('0x51')]===0x0){return db['UserProfileResource'][_0x5c63('0x4c')]({'name':_0x5e609d[_0x5c63('0x52')],'resourceId':_0x5e609d['id'],'type':_0x5e2bfd[_0x5c63('0x52')],'sectionId':_0x5e2bfd['id']},{})[_0x5c63('0x26')](function(){return _0x1019bb;});}else{return _0x1019bb;}})['catch'](function(_0x5bd896){logger[_0x5c63('0x2b')](_0x5c63('0x53'),_0x5bd896);throw _0x5bd896;});}return _0x1019bb;});}})[_0x5c63('0x26')](respondWithResult(_0x382bc4,0xc9))[_0x5c63('0x47')](handleError(_0x382bc4,null));};exports[_0x5c63('0x25')]=function(_0x1ad5b1,_0x2bd06e){if(_0x1ad5b1[_0x5c63('0x4d')]['id']){delete _0x1ad5b1['body']['id'];}return db[_0x5c63('0x2f')]['find']({'where':{'id':_0x1ad5b1[_0x5c63('0x49')]['id']}})[_0x5c63('0x26')](handleEntityNotFound(_0x2bd06e,null))[_0x5c63('0x26')](saveUpdates(_0x1ad5b1[_0x5c63('0x4d')],null))[_0x5c63('0x26')](respondWithResult(_0x2bd06e,null))[_0x5c63('0x47')](handleError(_0x2bd06e,null));};exports[_0x5c63('0x2a')]=function(_0x597954,_0x541c33){return db['Dashboard'][_0x5c63('0x4b')]({'where':{'id':_0x597954[_0x5c63('0x49')]['id']}})['then'](handleEntityNotFound(_0x541c33,null))[_0x5c63('0x26')](removeEntity(_0x541c33,null))[_0x5c63('0x47')](handleError(_0x541c33,null));};function widgetAttributes(_0x39d70c){try{switch(_0x39d70c[_0x5c63('0x3e')]){case _0x5c63('0x5a'):return[{'name':_0x5c63('0x5b'),'value':_0x39d70c['attrUrl']||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c['attrs'][0x0][_0x5c63('0x5d')]:undefined)||_0x5c63('0x5e')}];case _0x5c63('0x5f'):return[{'name':_0x5c63('0x60'),'value':_0x39d70c[_0x5c63('0x60')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0][_0x5c63('0x5d')]:undefined)||''}];case _0x5c63('0x61'):return[{'name':_0x5c63('0x62'),'value':_0x39d70c[_0x5c63('0x62')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0]['value']:undefined)||_0x5c63('0x63')},{'name':_0x5c63('0x64'),'value':_0x39d70c['attrTimezone']||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x1]?_0x39d70c[_0x5c63('0x5c')][0x1][_0x5c63('0x5d')]:undefined)||'0.00'},{'name':_0x5c63('0x65'),'value':_0x39d70c[_0x5c63('0x65')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x2]?_0x39d70c['attrs'][0x2]['value']:undefined)||0xc}];case _0x5c63('0x66'):return[{'name':_0x5c63('0x67'),'value':_0x39d70c[_0x5c63('0x67')]||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0][_0x5c63('0x5d')]:undefined)||_0x5c63('0x68')},{'name':_0x5c63('0x69'),'value':_0x39d70c[_0x5c63('0x69')]||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x1]?_0x39d70c['attrs'][0x1][_0x5c63('0x5d')]:undefined)||[]},{'name':'attrFontSize','value':_0x39d70c[_0x5c63('0x65')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x2]?_0x39d70c['attrs'][0x2][_0x5c63('0x5d')]:undefined)||0x14}];case _0x5c63('0x6a'):case _0x5c63('0x6b'):return[{'name':_0x5c63('0x6c'),'value':_0x39d70c[_0x5c63('0x6c')]||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0][_0x5c63('0x5d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x39d70c[_0x5c63('0x6d')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x1]?_0x39d70c[_0x5c63('0x5c')][0x1][_0x5c63('0x5d')]:undefined)||null},{'name':_0x5c63('0x6e'),'value':_0x39d70c[_0x5c63('0x6e')]||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x2]?_0x39d70c['attrs'][0x2][_0x5c63('0x5d')]:undefined)||null},{'name':_0x5c63('0x69'),'value':_0x39d70c['attrVoiceQueues']||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x3]?_0x39d70c[_0x5c63('0x5c')][0x3]['value']:undefined)||[]}];case _0x5c63('0x6f'):return[{'name':_0x5c63('0x70'),'type':_0x39d70c['reportType']||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0][_0x5c63('0x3e')]:undefined)||null,'value':_0x39d70c[_0x5c63('0x70')]||(_0x39d70c[_0x5c63('0x5c')]&&_0x39d70c[_0x5c63('0x5c')][0x0]?_0x39d70c[_0x5c63('0x5c')][0x0][_0x5c63('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x39d70c[_0x5c63('0x71')]||(_0x39d70c['attrs']&&_0x39d70c[_0x5c63('0x5c')][0x1]?_0x39d70c['attrs'][0x1][_0x5c63('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1bb462){logger[_0x5c63('0x2b')](_0x5c63('0x72'),JSON['stringify'](_0x1bb462));return[];}}exports[_0x5c63('0x73')]=function(_0x22e149,_0x4c5b0e,_0x16f07b){if(_0x22e149[_0x5c63('0x4d')]['id']){delete _0x22e149[_0x5c63('0x4d')]['id'];}return db[_0x5c63('0x2f')][_0x5c63('0x4b')]({'where':{'id':_0x22e149[_0x5c63('0x49')]['id']}})[_0x5c63('0x26')](handleEntityNotFound(_0x4c5b0e,null))[_0x5c63('0x26')](function(_0x1c47d5){if(_0x1c47d5){_0x22e149[_0x5c63('0x4d')][_0x5c63('0x74')]=_0x1c47d5['id'];_0x22e149[_0x5c63('0x4d')][_0x5c63('0x5c')]=widgetAttributes(_0x22e149[_0x5c63('0x4d')]);return db[_0x5c63('0x75')][_0x5c63('0x4c')](_0x22e149[_0x5c63('0x4d')]);}})['then'](respondWithResult(_0x4c5b0e,null))['catch'](handleError(_0x4c5b0e,null));};exports[_0x5c63('0x76')]=function(_0xa2d55c,_0x39e982,_0x189fa5){var _0x18a117={};var _0x516092={};var _0xb84dbb;var _0x2325dc;return db[_0x5c63('0x2f')]['findOne']({'where':{'id':_0xa2d55c[_0x5c63('0x49')]['id']}})[_0x5c63('0x26')](handleEntityNotFound(_0x39e982,null))['then'](function(_0x9eefad){if(_0x9eefad){_0xb84dbb=_0x9eefad;_0x516092['model']=_[_0x5c63('0x32')](db[_0x5c63('0x75')]['rawAttributes']);_0x516092[_0x5c63('0x31')]=_[_0x5c63('0x32')](_0xa2d55c[_0x5c63('0x31')]);_0x516092[_0x5c63('0x33')]=_[_0x5c63('0x34')](_0x516092[_0x5c63('0x30')],_0x516092[_0x5c63('0x31')]);_0x18a117[_0x5c63('0x35')]=_[_0x5c63('0x34')](_0x516092[_0x5c63('0x30')],qs[_0x5c63('0x36')](_0xa2d55c[_0x5c63('0x31')]['fields']));_0x18a117[_0x5c63('0x35')]=_0x18a117[_0x5c63('0x35')][_0x5c63('0x37')]?_0x18a117[_0x5c63('0x35')]:_0x516092[_0x5c63('0x30')];_0x18a117[_0x5c63('0x39')]=qs['sort'](_0xa2d55c[_0x5c63('0x31')][_0x5c63('0x3a')]);_0x18a117['where']=qs[_0x5c63('0x33')](_[_0x5c63('0x3c')](_0xa2d55c['query'],_0x516092[_0x5c63('0x33')]));if(_0xa2d55c[_0x5c63('0x31')][_0x5c63('0x77')]){_0x18a117[_0x5c63('0x3b')]=_['merge'](_0x18a117[_0x5c63('0x3b')],{'$or':_[_0x5c63('0x3d')](_0x18a117[_0x5c63('0x35')],function(_0x5081c1){var _0x3ea4a1={};_0x3ea4a1[_0x5081c1]={'$like':'%'+_0xa2d55c[_0x5c63('0x31')][_0x5c63('0x77')]+'%'};return _0x3ea4a1;})});}_0x18a117=_['merge']({},_0x18a117,_0xa2d55c['options']);return _0xb84dbb['getItems'](_0x18a117);}})[_0x5c63('0x26')](function(_0x16d69a){if(_0x16d69a){_0x2325dc=_0x16d69a[_0x5c63('0x37')];if(!_0xa2d55c[_0x5c63('0x31')][_0x5c63('0x38')]('nolimit')){_0x18a117['limit']=qs[_0x5c63('0x21')](_0xa2d55c[_0x5c63('0x31')][_0x5c63('0x21')]);_0x18a117[_0x5c63('0x20')]=qs[_0x5c63('0x20')](_0xa2d55c['query']['offset']);}return _0xb84dbb[_0x5c63('0x76')](_0x18a117);}})[_0x5c63('0x26')](function(_0x2069c8){if(_0x2069c8){return _0x2069c8?{'count':_0x2325dc,'rows':_0x2069c8}:null;}})[_0x5c63('0x26')](respondWithResult(_0x39e982,null))[_0x5c63('0x47')](handleError(_0x39e982,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 2af75eb..452ff62 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 _0x9b97=['setMaxListeners','save','update','remove','emit','hook','exports','events','Dashboard'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x9b97,0x11e));var _0x79b9=function(_0x32820f,_0x90bceb){_0x32820f=_0x32820f-0x0;var _0x412131=_0x9b97[_0x32820f];return _0x412131;};'use strict';var EventEmitter=require(_0x79b9('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x79b9('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x79b9('0x2')](0x0);var events={'afterCreate':_0x79b9('0x3'),'afterUpdate':_0x79b9('0x4'),'afterDestroy':_0x79b9('0x5')};function emitEvent(_0x10c823){return function(_0x4edfcf,_0x5194ab,_0x1e0ed2){DashboardEvents[_0x79b9('0x6')](_0x10c823+':'+_0x4edfcf['id'],_0x4edfcf);DashboardEvents[_0x79b9('0x6')](_0x10c823,_0x4edfcf);_0x1e0ed2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x79b9('0x7')](e,emitEvent(event));}}module[_0x79b9('0x8')]=DashboardEvents; \ No newline at end of file +var _0x120b=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x120b,0x8f));var _0xb120=function(_0x21e005,_0xdbdcba){_0x21e005=_0x21e005-0x0;var _0x20e5c4=_0x120b[_0x21e005];return _0x20e5c4;};'use strict';var EventEmitter=require(_0xb120('0x0'));var Dashboard=require(_0xb120('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb120('0x2')](0x0);var events={'afterCreate':_0xb120('0x3'),'afterUpdate':_0xb120('0x4'),'afterDestroy':_0xb120('0x5')};function emitEvent(_0x2f5e7a){return function(_0xe1d9d1,_0x2208f9,_0x8df6ec){DashboardEvents[_0xb120('0x6')](_0x2f5e7a+':'+_0xe1d9d1['id'],_0xe1d9d1);DashboardEvents[_0xb120('0x6')](_0x2f5e7a,_0xe1d9d1);_0x8df6ec(null);};}for(var e in events){if(events[_0xb120('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xb120('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 150c4d6..f9318d9 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 _0x4f29=['dashboards','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x6dd381,_0x8da5f9){var _0x8c11fb=function(_0x1a090b){while(--_0x1a090b){_0x6dd381['push'](_0x6dd381['shift']());}};_0x8c11fb(++_0x8da5f9);}(_0x4f29,0xfd));var _0x94f2=function(_0x1dc1b3,_0x47ef78){_0x1dc1b3=_0x1dc1b3-0x0;var _0x18a08f=_0x4f29[_0x1dc1b3];return _0x18a08f;};'use strict';var _=require('lodash');var util=require(_0x94f2('0x0'));var logger=require(_0x94f2('0x1'))(_0x94f2('0x2'));var moment=require(_0x94f2('0x3'));var BPromise=require(_0x94f2('0x4'));var rp=require(_0x94f2('0x5'));var fs=require('fs');var path=require(_0x94f2('0x6'));var rimraf=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var attributes=require(_0x94f2('0x9'));module[_0x94f2('0xa')]=function(_0x493302,_0x5e9216){return _0x493302[_0x94f2('0xb')](_0x94f2('0xc'),attributes,{'tableName':_0x94f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06bf=['bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x06bf,0x105));var _0xf06b=function(_0x2b0e9e,_0x47b4bd){_0x2b0e9e=_0x2b0e9e-0x0;var _0x2e889d=_0x06bf[_0x2b0e9e];return _0x2e889d;};'use strict';var _=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var logger=require(_0xf06b('0x2'))(_0xf06b('0x3'));var moment=require(_0xf06b('0x4'));var BPromise=require(_0xf06b('0x5'));var rp=require(_0xf06b('0x6'));var fs=require('fs');var path=require(_0xf06b('0x7'));var rimraf=require('rimraf');var config=require(_0xf06b('0x8'));var attributes=require(_0xf06b('0x9'));module[_0xf06b('0xa')]=function(_0x502d7f,_0x2f1d0e){return _0x502d7f[_0xf06b('0xb')](_0xf06b('0xc'),attributes,{'tableName':_0xf06b('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 c1d1c69..70ed313 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 _0x6f2b=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost','socket.io-emitter','register'];(function(_0x17a329,_0x5d2f43){var _0x761387=function(_0x2e1ad3){while(--_0x2e1ad3){_0x17a329['push'](_0x17a329['shift']());}};_0x761387(++_0x5d2f43);}(_0x6f2b,0x152));var _0xb6f2=function(_0xfc7f52,_0x9f3213){_0xfc7f52=_0xfc7f52-0x0;var _0x5952ed=_0x6f2b[_0xfc7f52];return _0x5952ed;};'use strict';var _=require('lodash');var util=require(_0xb6f2('0x0'));var moment=require(_0xb6f2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6f2('0x2'));var db=require(_0xb6f2('0x3'))['db'];var utils=require(_0xb6f2('0x4'));var logger=require(_0xb6f2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb6f2('0x6'));var client=jayson[_0xb6f2('0x7')]['http']({'port':0x232a});config[_0xb6f2('0x8')]=_['defaults'](config[_0xb6f2('0x8')],{'host':_0xb6f2('0x9'),'port':0x18eb});var socket=require(_0xb6f2('0xa'))(new Redis(config[_0xb6f2('0x8')]));require('./dashboard.socket')[_0xb6f2('0xb')](socket);function respondWithRpcPromise(_0x206d92,_0x1a35b8,_0x50f014){return new BPromise(function(_0x1c5c00,_0x552c94){return client[_0xb6f2('0xc')](_0x206d92,_0x50f014)[_0xb6f2('0xd')](function(_0x4850f){logger[_0xb6f2('0xe')](_0xb6f2('0xf'),_0x1a35b8,_0xb6f2('0x10'));logger[_0xb6f2('0x11')](_0xb6f2('0x12'),_0x1a35b8,'request\x20sent',JSON[_0xb6f2('0x13')](_0x4850f));if(_0x4850f[_0xb6f2('0x14')]){if(_0x4850f[_0xb6f2('0x14')][_0xb6f2('0x15')]===0x1f4){logger[_0xb6f2('0x14')](_0xb6f2('0xf'),_0x1a35b8,_0x4850f[_0xb6f2('0x14')][_0xb6f2('0x16')]);return _0x552c94(_0x4850f[_0xb6f2('0x14')][_0xb6f2('0x16')]);}logger[_0xb6f2('0x14')](_0xb6f2('0xf'),_0x1a35b8,_0x4850f[_0xb6f2('0x14')][_0xb6f2('0x16')]);return _0x1c5c00(_0x4850f[_0xb6f2('0x14')][_0xb6f2('0x16')]);}else{logger[_0xb6f2('0xe')](_0xb6f2('0xf'),_0x1a35b8,_0xb6f2('0x10'));_0x1c5c00(_0x4850f[_0xb6f2('0x17')][_0xb6f2('0x16')]);}})[_0xb6f2('0x18')](function(_0x1455ce){logger[_0xb6f2('0x14')](_0xb6f2('0xf'),_0x1a35b8,_0x1455ce);_0x552c94(_0x1455ce);});});} \ No newline at end of file +var _0x57b5=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','request\x20sent','error'];(function(_0x155ec8,_0x265d8d){var _0x2d8938=function(_0x41e8e3){while(--_0x41e8e3){_0x155ec8['push'](_0x155ec8['shift']());}};_0x2d8938(++_0x265d8d);}(_0x57b5,0x70));var _0x557b=function(_0x56e0e5,_0x2e3937){_0x56e0e5=_0x56e0e5-0x0;var _0x27bb15=_0x57b5[_0x56e0e5];return _0x27bb15;};'use strict';var _=require(_0x557b('0x0'));var util=require(_0x557b('0x1'));var moment=require(_0x557b('0x2'));var BPromise=require(_0x557b('0x3'));var rs=require(_0x557b('0x4'));var fs=require('fs');var Redis=require(_0x557b('0x5'));var db=require(_0x557b('0x6'))['db'];var utils=require(_0x557b('0x7'));var logger=require(_0x557b('0x8'))(_0x557b('0x9'));var config=require('../../config/environment');var jayson=require(_0x557b('0xa'));var client=jayson[_0x557b('0xb')][_0x557b('0xc')]({'port':0x232a});config[_0x557b('0xd')]=_[_0x557b('0xe')](config[_0x557b('0xd')],{'host':_0x557b('0xf'),'port':0x18eb});var socket=require(_0x557b('0x10'))(new Redis(config[_0x557b('0xd')]));require(_0x557b('0x11'))[_0x557b('0x12')](socket);function respondWithRpcPromise(_0x3b5b5e,_0x30e381,_0x4d8aab){return new BPromise(function(_0x4000b0,_0x8802e4){return client[_0x557b('0x13')](_0x3b5b5e,_0x4d8aab)['then'](function(_0x8166a){logger['info'](_0x557b('0x14'),_0x30e381,_0x557b('0x15'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x30e381,'request\x20sent',JSON['stringify'](_0x8166a));if(_0x8166a[_0x557b('0x16')]){if(_0x8166a[_0x557b('0x16')]['code']===0x1f4){logger['error'](_0x557b('0x14'),_0x30e381,_0x8166a[_0x557b('0x16')]['message']);return _0x8802e4(_0x8166a[_0x557b('0x16')][_0x557b('0x17')]);}logger[_0x557b('0x16')](_0x557b('0x14'),_0x30e381,_0x8166a[_0x557b('0x16')][_0x557b('0x17')]);return _0x4000b0(_0x8166a[_0x557b('0x16')][_0x557b('0x17')]);}else{logger[_0x557b('0x18')](_0x557b('0x14'),_0x30e381,_0x557b('0x15'));_0x4000b0(_0x8166a[_0x557b('0x19')][_0x557b('0x17')]);}})[_0x557b('0x1a')](function(_0x4a54a9){logger[_0x557b('0x16')]('Dashboard,\x20%s,\x20%s',_0x30e381,_0x4a54a9);_0x8802e4(_0x4a54a9);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c4ebee5..e7346c5 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 _0x65ae=['register','length','save','emit','removeListener'];(function(_0x5b4737,_0xf1380b){var _0x244d3a=function(_0x116f42){while(--_0x116f42){_0x5b4737['push'](_0x5b4737['shift']());}};_0x244d3a(++_0xf1380b);}(_0x65ae,0x1c9));var _0xe65a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65ae[_0x14add3];return _0x4a174f;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe65a('0x0'),'remove','update'];function createListener(_0x57bf26,_0x5114cc){return function(_0x1644c5){_0x5114cc[_0xe65a('0x1')](_0x57bf26,_0x1644c5);};}function removeListener(_0x253ad1,_0x1e88ca){return function(){DashboardEvents[_0xe65a('0x2')](_0x253ad1,_0x1e88ca);};}exports[_0xe65a('0x3')]=function(_0x1de52e){for(var _0x3d619d=0x0,_0x2fd447=events[_0xe65a('0x4')];_0x3d619d<_0x2fd447;_0x3d619d++){var _0x303812=events[_0x3d619d];var _0x97d9ce=createListener('dashboard:'+_0x303812,_0x1de52e);DashboardEvents['on'](_0x303812,_0x97d9ce);}}; \ No newline at end of file +var _0x53f1=['./dashboard.events','save','remove','update','emit','removeListener','length'];(function(_0x16cce2,_0xf470d4){var _0x213186=function(_0x5dd339){while(--_0x5dd339){_0x16cce2['push'](_0x16cce2['shift']());}};_0x213186(++_0xf470d4);}(_0x53f1,0x17a));var _0x153f=function(_0x4e7be4,_0x4e88bf){_0x4e7be4=_0x4e7be4-0x0;var _0x762052=_0x53f1[_0x4e7be4];return _0x762052;};'use strict';var DashboardEvents=require(_0x153f('0x0'));var events=[_0x153f('0x1'),_0x153f('0x2'),_0x153f('0x3')];function createListener(_0x381e7b,_0x462054){return function(_0x4531ba){_0x462054[_0x153f('0x4')](_0x381e7b,_0x4531ba);};}function removeListener(_0x642861,_0x36177b){return function(){DashboardEvents[_0x153f('0x5')](_0x642861,_0x36177b);};}exports['register']=function(_0x56d904){for(var _0x2e5886=0x0,_0x3fae14=events[_0x153f('0x6')];_0x2e5886<_0x3fae14;_0x2e5886++){var _0x3807a3=events[_0x2e5886];var _0x9e97ff=createListener('dashboard:'+_0x3807a3,_0x56d904);DashboardEvents['on'](_0x3807a3,_0x9e97ff);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9b603ad..b486e85 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 _0x2701=['get','/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','update','delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./dashboard.controller','isAuthenticated','index'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x2701,0x1f2));var _0x1270=function(_0x32800a,_0x3002c3){_0x32800a=_0x32800a-0x0;var _0x1cffd7=_0x2701[_0x32800a];return _0x1cffd7;};'use strict';var multer=require(_0x1270('0x0'));var util=require(_0x1270('0x1'));var path=require('path');var timeout=require(_0x1270('0x2'));var express=require(_0x1270('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1270('0x4'));var controller=require(_0x1270('0x5'));router['get']('/',auth[_0x1270('0x6')](),controller[_0x1270('0x7')]);router[_0x1270('0x8')](_0x1270('0x9'),auth['isAuthenticated'](),controller[_0x1270('0xa')]);router[_0x1270('0x8')]('/:id/items',auth[_0x1270('0x6')](),controller[_0x1270('0xb')]);router[_0x1270('0xc')]('/',auth[_0x1270('0x6')](),controller[_0x1270('0xd')]);router['post'](_0x1270('0xe'),auth['isAuthenticated'](),controller[_0x1270('0xf')]);router[_0x1270('0xc')](_0x1270('0x10'),auth[_0x1270('0x6')](),controller[_0x1270('0x11')]);router['put'](_0x1270('0x9'),auth[_0x1270('0x6')](),controller[_0x1270('0x12')]);router[_0x1270('0x13')]('/:id',auth[_0x1270('0x6')](),controller[_0x1270('0x14')]);module[_0x1270('0x15')]=router; \ No newline at end of file +var _0xe314=['./dashboard.controller','get','isAuthenticated','index','/:id','getItems','create','post','/:id/clone','clone','/:id/items','put','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x15ca29,_0x4525dd){var _0x3912d0=function(_0x1e7eb6){while(--_0x1e7eb6){_0x15ca29['push'](_0x15ca29['shift']());}};_0x3912d0(++_0x4525dd);}(_0xe314,0x121));var _0x4e31=function(_0x11b296,_0x52e35c){_0x11b296=_0x11b296-0x0;var _0x388461=_0xe314[_0x11b296];return _0x388461;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4e31('0x3'));var interaction=require(_0x4e31('0x4'));var config=require('../../config/environment');var controller=require(_0x4e31('0x5'));router[_0x4e31('0x6')]('/',auth[_0x4e31('0x7')](),controller[_0x4e31('0x8')]);router['get'](_0x4e31('0x9'),auth[_0x4e31('0x7')](),controller['show']);router[_0x4e31('0x6')]('/:id/items',auth[_0x4e31('0x7')](),controller[_0x4e31('0xa')]);router['post']('/',auth[_0x4e31('0x7')](),controller[_0x4e31('0xb')]);router[_0x4e31('0xc')](_0x4e31('0xd'),auth[_0x4e31('0x7')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xc')](_0x4e31('0xf'),auth['isAuthenticated'](),controller['addItem']);router[_0x4e31('0x10')](_0x4e31('0x9'),auth[_0x4e31('0x7')](),controller[_0x4e31('0x11')]);router[_0x4e31('0x12')]('/:id',auth[_0x4e31('0x7')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index a17af46..1a5248f 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 _0x112c=['exports','STRING','TEXT','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash'];(function(_0x2c9527,_0x3d3e1d){var _0x2fd230=function(_0x301888){while(--_0x301888){_0x2c9527['push'](_0x2c9527['shift']());}};_0x2fd230(++_0x3d3e1d);}(_0x112c,0x111));var _0xc112=function(_0x481a6f,_0x22837f){_0x481a6f=_0x481a6f-0x0;var _0x5d1835=_0x112c[_0x481a6f];return _0x5d1835;};'use strict';var Sequelize=require(_0xc112('0x0'));var squel=require(_0xc112('0x1'));var _=require(_0xc112('0x2'));module[_0xc112('0x3')]={'title':{'type':Sequelize[_0xc112('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xc112('0x5')]('long'),'get':function(){try{return JSON['parse'](this[_0xc112('0x6')]('attrs'));}catch(_0x38ef55){return[];}},'set':function(_0x774da4){try{this['setDataValue'](_0xc112('0x7'),JSON['stringify'](_0x774da4));}catch(_0x11ab15){this[_0xc112('0x8')](_0xc112('0x7'),JSON[_0xc112('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xc112('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc112('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc112('0xa')]},'col':{'type':Sequelize[_0xc112('0xa')]},'background':{'type':Sequelize[_0xc112('0x4')],'allowNull':![],'defaultValue':_0xc112('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xc112('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0afe=['TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','exports','STRING'];(function(_0x47906c,_0x42d7e8){var _0x8a0cef=function(_0x471ff8){while(--_0x471ff8){_0x47906c['push'](_0x47906c['shift']());}};_0x8a0cef(++_0x42d7e8);}(_0x0afe,0x1f4));var _0xe0af=function(_0x2bfc42,_0x5a9e74){_0x2bfc42=_0x2bfc42-0x0;var _0x1630ef=_0x0afe[_0x2bfc42];return _0x1630ef;};'use strict';var Sequelize=require(_0xe0af('0x0'));var squel=require(_0xe0af('0x1'));var _=require('lodash');module[_0xe0af('0x2')]={'title':{'type':Sequelize[_0xe0af('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe0af('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe0af('0x4')](_0xe0af('0x5')),'get':function(){try{return JSON['parse'](this[_0xe0af('0x6')](_0xe0af('0x7')));}catch(_0x1d2c8b){return[];}},'set':function(_0x31df3c){try{this[_0xe0af('0x8')](_0xe0af('0x7'),JSON['stringify'](_0x31df3c));}catch(_0x3a2c77){this['setDataValue'](_0xe0af('0x7'),JSON[_0xe0af('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe0af('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe0af('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xe0af('0xa')]},'background':{'type':Sequelize[_0xe0af('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe0af('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe0af('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index bb7dd49..8e37ecc 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 _0x1c47=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','status','send','show','params','model','DashboardItem','keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','attrSerie1','total','attrSerie2','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','body','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x1c47,0x138));var _0x71c4=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x1c47[_0x26b5ff];return _0x58603e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x71c4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71c4('0x1'));var moment=require(_0x71c4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x71c4('0x3'));var util=require('util');var path=require(_0x71c4('0x4'));var sox=require(_0x71c4('0x5'));var csv=require(_0x71c4('0x6'));var ejs=require(_0x71c4('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x71c4('0x8'));var crypto=require(_0x71c4('0x9'));var jsforce=require(_0x71c4('0xa'));var deskjs=require(_0x71c4('0xb'));var toCsv=require(_0x71c4('0x6'));var querystring=require(_0x71c4('0xc'));var Papa=require(_0x71c4('0xd'));var Redis=require(_0x71c4('0xe'));var authService=require(_0x71c4('0xf'));var qs=require(_0x71c4('0x10'));var hardwareService=require(_0x71c4('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x71c4('0x12'));var config=require('../../config/environment');var db=require(_0x71c4('0x13'))['db'];config[_0x71c4('0x14')]=_['defaults'](config[_0x71c4('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x71c4('0x15'))(new Redis(config[_0x71c4('0x14')]));require(_0x71c4('0x16'))[_0x71c4('0x17')](socket);function respondWithStatusCode(_0x290ea7,_0x15674c){_0x15674c=_0x15674c||0xcc;return function(_0x1ad7c0){if(_0x1ad7c0){return _0x290ea7['sendStatus'](_0x15674c);}return _0x290ea7['status'](_0x15674c)[_0x71c4('0x18')]();};}function respondWithResult(_0x19e2e6,_0x4c55a2){_0x4c55a2=_0x4c55a2||0xc8;return function(_0x817148){if(_0x817148){return _0x19e2e6['status'](_0x4c55a2)[_0x71c4('0x19')](_0x817148);}};}function respondWithFilteredResult(_0x23494d,_0x2136ec){return function(_0x5be852){if(_0x5be852){var _0x28af67=_0x5be852[_0x71c4('0x1a')],_0x3c76e6=_0x2136ec[_0x71c4('0x1b')],_0x1ef7cb=_0x2136ec['offset']+_0x2136ec[_0x71c4('0x1c')],_0x24aefe;if(_0x1ef7cb>=_0x28af67){_0x1ef7cb=_0x28af67;_0x24aefe=0xc8;}else{_0x24aefe=0xce;}_0x23494d['status'](_0x24aefe);return _0x23494d['set'](_0x71c4('0x1d'),_0x3c76e6+'-'+_0x1ef7cb+'/'+_0x28af67)['json'](_0x5be852);}return null;};}function patchUpdates(_0x44e4a8){return function(_0x175781){try{jsonpatch[_0x71c4('0x1e')](_0x175781,_0x44e4a8,!![]);}catch(_0xbbad46){return BPromise[_0x71c4('0x1f')](_0xbbad46);}return _0x175781[_0x71c4('0x20')]();};}function saveUpdates(_0x52bee1,_0x325fc1){return function(_0x1cb3ef){if(_0x1cb3ef){return _0x1cb3ef[_0x71c4('0x21')](_0x52bee1)['then'](function(_0x1df921){return _0x1df921;});}return null;};}function removeEntity(_0x35566a,_0x50fed1){return function(_0x1f4901){if(_0x1f4901){return _0x1f4901[_0x71c4('0x22')]()[_0x71c4('0x23')](function(){_0x35566a['status'](0xcc)[_0x71c4('0x18')]();});}};}function handleEntityNotFound(_0x50dd2d,_0x7e69fb){return function(_0x27857b){if(!_0x27857b){_0x50dd2d[_0x71c4('0x24')](0x194);}return _0x27857b;};}function handleError(_0x53bb28,_0x43f111){_0x43f111=_0x43f111||0x1f4;return function(_0x26770b){logger[_0x71c4('0x25')](_0x26770b[_0x71c4('0x26')]);if(_0x26770b[_0x71c4('0x27')]){delete _0x26770b[_0x71c4('0x27')];}_0x53bb28[_0x71c4('0x28')](_0x43f111)[_0x71c4('0x29')](_0x26770b);};}exports[_0x71c4('0x2a')]=function(_0x35aa07,_0x326e61){var _0x283cde={'raw':![],'where':{'id':_0x35aa07[_0x71c4('0x2b')]['id']}},_0x5b3758={};_0x5b3758[_0x71c4('0x2c')]=_['keys'](db[_0x71c4('0x2d')]['rawAttributes']);_0x5b3758['query']=_[_0x71c4('0x2e')](_0x35aa07[_0x71c4('0x2f')]);_0x5b3758[_0x71c4('0x30')]=_[_0x71c4('0x31')](_0x5b3758['model'],_0x5b3758[_0x71c4('0x2f')]);_0x283cde['attributes']=_[_0x71c4('0x31')](_0x5b3758[_0x71c4('0x2c')],qs['fields'](_0x35aa07['query']['fields']));_0x283cde[_0x71c4('0x32')]=_0x283cde[_0x71c4('0x32')][_0x71c4('0x33')]?_0x283cde[_0x71c4('0x32')]:_0x5b3758['model'];if(_0x35aa07[_0x71c4('0x2f')][_0x71c4('0x34')]){_0x283cde[_0x71c4('0x35')]=[{'all':!![]}];}_0x283cde=_[_0x71c4('0x36')]({},_0x283cde,_0x35aa07[_0x71c4('0x37')]);return db[_0x71c4('0x2d')][_0x71c4('0x38')](_0x283cde)[_0x71c4('0x23')](handleEntityNotFound(_0x326e61,null))[_0x71c4('0x23')](respondWithResult(_0x326e61,null))[_0x71c4('0x39')](handleError(_0x326e61,null));};exports[_0x71c4('0x22')]=function(_0x303d37,_0x4c2051){return db['DashboardItem']['find']({'where':{'id':_0x303d37['params']['id']}})[_0x71c4('0x23')](handleEntityNotFound(_0x4c2051,null))['then'](removeEntity(_0x4c2051,null))[_0x71c4('0x39')](handleError(_0x4c2051,null));};function widgetAttributes(_0x57ea9f){try{switch(_0x57ea9f[_0x71c4('0x3a')]){case _0x71c4('0x3b'):return[{'name':'attrUrl','value':_0x57ea9f[_0x71c4('0x3c')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0][_0x71c4('0x3e')]:undefined)||_0x71c4('0x3f')}];case _0x71c4('0x40'):return[{'name':_0x71c4('0x41'),'value':_0x57ea9f['attrPath']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0][_0x71c4('0x3e')]:undefined)||''}];case _0x71c4('0x42'):return[{'name':_0x71c4('0x43'),'value':_0x57ea9f[_0x71c4('0x43')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x0]?_0x57ea9f['attrs'][0x0][_0x71c4('0x3e')]:undefined)||'HH:mm:ss'},{'name':_0x71c4('0x44'),'value':_0x57ea9f[_0x71c4('0x44')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x1]?_0x57ea9f['attrs'][0x1][_0x71c4('0x3e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x57ea9f['attrFontSize']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x2]?_0x57ea9f['attrs'][0x2]['value']:undefined)||0xc}];case _0x71c4('0x45'):return[{'name':_0x71c4('0x46'),'value':_0x57ea9f[_0x71c4('0x46')]||(_0x57ea9f['attrs']&&_0x57ea9f['attrs'][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0]['value']:undefined)||'total'},{'name':_0x71c4('0x47'),'value':_0x57ea9f[_0x71c4('0x47')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x1]?_0x57ea9f[_0x71c4('0x3d')][0x1]['value']:undefined)||[]},{'name':_0x71c4('0x48'),'value':_0x57ea9f['attrFontSize']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x2]?_0x57ea9f['attrs'][0x2][_0x71c4('0x3e')]:undefined)||0x14}];case _0x71c4('0x49'):case'pie-chart':return[{'name':_0x71c4('0x4a'),'value':_0x57ea9f[_0x71c4('0x4a')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0]['value']:undefined)||_0x71c4('0x4b')},{'name':_0x71c4('0x4c'),'value':_0x57ea9f[_0x71c4('0x4c')]||(_0x57ea9f['attrs']&&_0x57ea9f[_0x71c4('0x3d')][0x1]?_0x57ea9f['attrs'][0x1][_0x71c4('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x57ea9f['attrSerie3']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x2]?_0x57ea9f[_0x71c4('0x3d')][0x2][_0x71c4('0x3e')]:undefined)||null},{'name':_0x71c4('0x47'),'value':_0x57ea9f[_0x71c4('0x47')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x3]?_0x57ea9f['attrs'][0x3][_0x71c4('0x3e')]:undefined)||[]}];case _0x71c4('0x4d'):return[{'name':_0x71c4('0x4e'),'type':_0x57ea9f['reportType']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0][_0x71c4('0x3a')]:undefined)||null,'value':_0x57ea9f[_0x71c4('0x4e')]||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f['attrs'][0x0]?_0x57ea9f[_0x71c4('0x3d')][0x0][_0x71c4('0x3e')]:undefined)||null},{'name':_0x71c4('0x4f'),'value':_0x57ea9f['attrRefresh']||(_0x57ea9f[_0x71c4('0x3d')]&&_0x57ea9f[_0x71c4('0x3d')][0x1]?_0x57ea9f['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x33dc5c){logger['error'](_0x71c4('0x50'),JSON['stringify'](_0x33dc5c));return[];}}exports['create']=function(_0x11321c,_0x377326){if(_0x11321c['body']){_0x11321c['body'][_0x71c4('0x3d')]=widgetAttributes(_0x11321c[_0x71c4('0x51')]);}return db[_0x71c4('0x2d')]['create'](_0x11321c[_0x71c4('0x51')],{})['then'](respondWithResult(_0x377326,0xc9))[_0x71c4('0x39')](handleError(_0x377326,null));};exports['update']=function(_0x462348,_0xa1b9d4){if(_0x462348[_0x71c4('0x51')]['id']){delete _0x462348[_0x71c4('0x51')]['id'];}_0x462348['body'][_0x71c4('0x3d')]=widgetAttributes(_0x462348[_0x71c4('0x51')]);return db[_0x71c4('0x2d')][_0x71c4('0x38')]({'where':{'id':_0x462348[_0x71c4('0x2b')]['id']}})['then'](handleEntityNotFound(_0xa1b9d4,null))[_0x71c4('0x23')](saveUpdates(_0x462348['body'],null))[_0x71c4('0x23')](respondWithResult(_0xa1b9d4,null))['catch'](handleError(_0xa1b9d4,null));}; \ No newline at end of file +var _0xb9e9=['error','name','send','show','params','model','keys','DashboardItem','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','type','iframe','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x4da690,_0x12d136){var _0x263c53=function(_0x1832fa){while(--_0x1832fa){_0x4da690['push'](_0x4da690['shift']());}};_0x263c53(++_0x12d136);}(_0xb9e9,0xe4));var _0x9b9e=function(_0x21fdce,_0x3b4c0e){_0x21fdce=_0x21fdce-0x0;var _0xcdf7d6=_0xb9e9[_0x21fdce];return _0xcdf7d6;};'use strict';var pdf=require(_0x9b9e('0x0'));var emlformat=require(_0x9b9e('0x1'));var rimraf=require(_0x9b9e('0x2'));var zipdir=require(_0x9b9e('0x3'));var jsonpatch=require(_0x9b9e('0x4'));var rp=require(_0x9b9e('0x5'));var moment=require(_0x9b9e('0x6'));var BPromise=require(_0x9b9e('0x7'));var Mustache=require(_0x9b9e('0x8'));var util=require('util');var path=require(_0x9b9e('0x9'));var sox=require(_0x9b9e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b9e('0xb'));var squel=require('squel');var crypto=require(_0x9b9e('0xc'));var jsforce=require(_0x9b9e('0xd'));var deskjs=require(_0x9b9e('0xe'));var toCsv=require(_0x9b9e('0xf'));var querystring=require(_0x9b9e('0x10'));var Papa=require(_0x9b9e('0x11'));var Redis=require(_0x9b9e('0x12'));var authService=require(_0x9b9e('0x13'));var qs=require(_0x9b9e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b9e('0x15'))(_0x9b9e('0x16'));var utils=require('../../config/utils');var config=require(_0x9b9e('0x17'));var db=require(_0x9b9e('0x18'))['db'];config[_0x9b9e('0x19')]=_[_0x9b9e('0x1a')](config[_0x9b9e('0x19')],{'host':_0x9b9e('0x1b'),'port':0x18eb});var socket=require(_0x9b9e('0x1c'))(new Redis(config[_0x9b9e('0x19')]));require(_0x9b9e('0x1d'))[_0x9b9e('0x1e')](socket);function respondWithStatusCode(_0x117b94,_0x262cce){_0x262cce=_0x262cce||0xcc;return function(_0x57fadd){if(_0x57fadd){return _0x117b94['sendStatus'](_0x262cce);}return _0x117b94[_0x9b9e('0x1f')](_0x262cce)[_0x9b9e('0x20')]();};}function respondWithResult(_0x44042e,_0x4857c2){_0x4857c2=_0x4857c2||0xc8;return function(_0x221239){if(_0x221239){return _0x44042e[_0x9b9e('0x1f')](_0x4857c2)[_0x9b9e('0x21')](_0x221239);}};}function respondWithFilteredResult(_0x515a97,_0x444f8d){return function(_0x12e61b){if(_0x12e61b){var _0x3ccc5c=_0x12e61b['count'],_0x59c924=_0x444f8d[_0x9b9e('0x22')],_0x40de55=_0x444f8d[_0x9b9e('0x22')]+_0x444f8d[_0x9b9e('0x23')],_0x44f671;if(_0x40de55>=_0x3ccc5c){_0x40de55=_0x3ccc5c;_0x44f671=0xc8;}else{_0x44f671=0xce;}_0x515a97['status'](_0x44f671);return _0x515a97[_0x9b9e('0x24')](_0x9b9e('0x25'),_0x59c924+'-'+_0x40de55+'/'+_0x3ccc5c)['json'](_0x12e61b);}return null;};}function patchUpdates(_0x5ce2b0){return function(_0x222bf2){try{jsonpatch[_0x9b9e('0x26')](_0x222bf2,_0x5ce2b0,!![]);}catch(_0x215ece){return BPromise[_0x9b9e('0x27')](_0x215ece);}return _0x222bf2[_0x9b9e('0x28')]();};}function saveUpdates(_0x1e295e,_0x25a103){return function(_0x4613f8){if(_0x4613f8){return _0x4613f8[_0x9b9e('0x29')](_0x1e295e)[_0x9b9e('0x2a')](function(_0x5b84cf){return _0x5b84cf;});}return null;};}function removeEntity(_0x300b80,_0x2b33c7){return function(_0x42058b){if(_0x42058b){return _0x42058b[_0x9b9e('0x2b')]()[_0x9b9e('0x2a')](function(){_0x300b80[_0x9b9e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cadbd,_0x36253b){return function(_0x53012e){if(!_0x53012e){_0x5cadbd[_0x9b9e('0x2c')](0x194);}return _0x53012e;};}function handleError(_0x596696,_0x19bbba){_0x19bbba=_0x19bbba||0x1f4;return function(_0x33a669){logger[_0x9b9e('0x2d')](_0x33a669['stack']);if(_0x33a669[_0x9b9e('0x2e')]){delete _0x33a669['name'];}_0x596696[_0x9b9e('0x1f')](_0x19bbba)[_0x9b9e('0x2f')](_0x33a669);};}exports[_0x9b9e('0x30')]=function(_0x4b5370,_0x148b37){var _0x15a154={'raw':![],'where':{'id':_0x4b5370[_0x9b9e('0x31')]['id']}},_0x24c23d={};_0x24c23d[_0x9b9e('0x32')]=_[_0x9b9e('0x33')](db[_0x9b9e('0x34')]['rawAttributes']);_0x24c23d[_0x9b9e('0x35')]=_[_0x9b9e('0x33')](_0x4b5370['query']);_0x24c23d['filters']=_[_0x9b9e('0x36')](_0x24c23d[_0x9b9e('0x32')],_0x24c23d['query']);_0x15a154[_0x9b9e('0x37')]=_[_0x9b9e('0x36')](_0x24c23d[_0x9b9e('0x32')],qs[_0x9b9e('0x38')](_0x4b5370['query'][_0x9b9e('0x38')]));_0x15a154[_0x9b9e('0x37')]=_0x15a154[_0x9b9e('0x37')][_0x9b9e('0x39')]?_0x15a154['attributes']:_0x24c23d[_0x9b9e('0x32')];if(_0x4b5370['query'][_0x9b9e('0x3a')]){_0x15a154[_0x9b9e('0x3b')]=[{'all':!![]}];}_0x15a154=_['merge']({},_0x15a154,_0x4b5370[_0x9b9e('0x3c')]);return db['DashboardItem'][_0x9b9e('0x3d')](_0x15a154)[_0x9b9e('0x2a')](handleEntityNotFound(_0x148b37,null))['then'](respondWithResult(_0x148b37,null))[_0x9b9e('0x3e')](handleError(_0x148b37,null));};exports[_0x9b9e('0x2b')]=function(_0x4e3f3c,_0x362255){return db[_0x9b9e('0x34')][_0x9b9e('0x3d')]({'where':{'id':_0x4e3f3c['params']['id']}})[_0x9b9e('0x2a')](handleEntityNotFound(_0x362255,null))[_0x9b9e('0x2a')](removeEntity(_0x362255,null))[_0x9b9e('0x3e')](handleError(_0x362255,null));};function widgetAttributes(_0x4d0a98){try{switch(_0x4d0a98[_0x9b9e('0x3f')]){case _0x9b9e('0x40'):return[{'name':'attrUrl','value':_0x4d0a98['attrUrl']||(_0x4d0a98['attrs']&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98[_0x9b9e('0x41')][0x0]['value']:undefined)||_0x9b9e('0x42')}];case _0x9b9e('0x43'):return[{'name':_0x9b9e('0x44'),'value':_0x4d0a98[_0x9b9e('0x44')]||(_0x4d0a98['attrs']&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98['attrs'][0x0][_0x9b9e('0x45')]:undefined)||''}];case _0x9b9e('0x46'):return[{'name':_0x9b9e('0x47'),'value':_0x4d0a98[_0x9b9e('0x47')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98['attrs'][0x0][_0x9b9e('0x45')]:undefined)||_0x9b9e('0x48')},{'name':_0x9b9e('0x49'),'value':_0x4d0a98[_0x9b9e('0x49')]||(_0x4d0a98['attrs']&&_0x4d0a98[_0x9b9e('0x41')][0x1]?_0x4d0a98[_0x9b9e('0x41')][0x1][_0x9b9e('0x45')]:undefined)||'0.00'},{'name':_0x9b9e('0x4a'),'value':_0x4d0a98[_0x9b9e('0x4a')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98['attrs'][0x2]?_0x4d0a98[_0x9b9e('0x41')][0x2]['value']:undefined)||0xc}];case _0x9b9e('0x4b'):return[{'name':_0x9b9e('0x4c'),'value':_0x4d0a98['attrMetric']||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98[_0x9b9e('0x41')][0x0][_0x9b9e('0x45')]:undefined)||_0x9b9e('0x4d')},{'name':_0x9b9e('0x4e'),'value':_0x4d0a98[_0x9b9e('0x4e')]||(_0x4d0a98['attrs']&&_0x4d0a98[_0x9b9e('0x41')][0x1]?_0x4d0a98[_0x9b9e('0x41')][0x1][_0x9b9e('0x45')]:undefined)||[]},{'name':_0x9b9e('0x4a'),'value':_0x4d0a98['attrFontSize']||(_0x4d0a98['attrs']&&_0x4d0a98['attrs'][0x2]?_0x4d0a98[_0x9b9e('0x41')][0x2][_0x9b9e('0x45')]:undefined)||0x14}];case _0x9b9e('0x4f'):case _0x9b9e('0x50'):return[{'name':_0x9b9e('0x51'),'value':_0x4d0a98[_0x9b9e('0x51')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98[_0x9b9e('0x41')][0x0][_0x9b9e('0x45')]:undefined)||'total'},{'name':_0x9b9e('0x52'),'value':_0x4d0a98[_0x9b9e('0x52')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98['attrs'][0x1]?_0x4d0a98[_0x9b9e('0x41')][0x1][_0x9b9e('0x45')]:undefined)||null},{'name':'attrSerie3','value':_0x4d0a98[_0x9b9e('0x53')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x2]?_0x4d0a98[_0x9b9e('0x41')][0x2][_0x9b9e('0x45')]:undefined)||null},{'name':_0x9b9e('0x4e'),'value':_0x4d0a98[_0x9b9e('0x4e')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x3]?_0x4d0a98['attrs'][0x3][_0x9b9e('0x45')]:undefined)||[]}];case _0x9b9e('0x54'):return[{'name':'attrReport','type':_0x4d0a98[_0x9b9e('0x55')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98['attrs'][0x0]?_0x4d0a98[_0x9b9e('0x41')][0x0][_0x9b9e('0x3f')]:undefined)||null,'value':_0x4d0a98['attrReport']||(_0x4d0a98['attrs']&&_0x4d0a98[_0x9b9e('0x41')][0x0]?_0x4d0a98[_0x9b9e('0x41')][0x0]['value']:undefined)||null},{'name':_0x9b9e('0x56'),'value':_0x4d0a98[_0x9b9e('0x56')]||(_0x4d0a98[_0x9b9e('0x41')]&&_0x4d0a98[_0x9b9e('0x41')][0x1]?_0x4d0a98['attrs'][0x1][_0x9b9e('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x37a96e){logger[_0x9b9e('0x2d')](_0x9b9e('0x57'),JSON[_0x9b9e('0x58')](_0x37a96e));return[];}}exports[_0x9b9e('0x59')]=function(_0x1f5920,_0x2322a9){if(_0x1f5920[_0x9b9e('0x5a')]){_0x1f5920[_0x9b9e('0x5a')][_0x9b9e('0x41')]=widgetAttributes(_0x1f5920[_0x9b9e('0x5a')]);}return db[_0x9b9e('0x34')]['create'](_0x1f5920['body'],{})[_0x9b9e('0x2a')](respondWithResult(_0x2322a9,0xc9))[_0x9b9e('0x3e')](handleError(_0x2322a9,null));};exports['update']=function(_0xb3384f,_0x283127){if(_0xb3384f['body']['id']){delete _0xb3384f['body']['id'];}_0xb3384f[_0x9b9e('0x5a')][_0x9b9e('0x41')]=widgetAttributes(_0xb3384f[_0x9b9e('0x5a')]);return db['DashboardItem']['find']({'where':{'id':_0xb3384f[_0x9b9e('0x31')]['id']}})['then'](handleEntityNotFound(_0x283127,null))[_0x9b9e('0x2a')](saveUpdates(_0xb3384f[_0x9b9e('0x5a')],null))['then'](respondWithResult(_0x283127,null))[_0x9b9e('0x3e')](handleError(_0x283127,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 90e0697..9666199 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 _0x6901=['remove','hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6901,0x100));var _0x1690=function(_0xf22f74,_0x2dba42){_0xf22f74=_0xf22f74-0x0;var _0x322938=_0x6901[_0xf22f74];return _0x322938;};'use strict';var EventEmitter=require(_0x1690('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x1690('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1690('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1690('0x3')};function emitEvent(_0x198e19){return function(_0x540bb3,_0x53771c,_0xdf59d3){DashboardItemEvents['emit'](_0x198e19+':'+_0x540bb3['id'],_0x540bb3);DashboardItemEvents['emit'](_0x198e19,_0x540bb3);_0xdf59d3(null);};}for(var e in events){if(events[_0x1690('0x4')](e)){var event=events[e];DashboardItem[_0x1690('0x5')](e,emitEvent(event));}}module[_0x1690('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xef0f=['events','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0xef0f,0x168));var _0xfef0=function(_0x311dca,_0xbbdf15){_0x311dca=_0x311dca-0x0;var _0x229161=_0xef0f[_0x311dca];return _0x229161;};'use strict';var EventEmitter=require(_0xfef0('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xfef0('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xfef0('0x2')](0x0);var events={'afterCreate':_0xfef0('0x3'),'afterUpdate':'update','afterDestroy':_0xfef0('0x4')};function emitEvent(_0x11ab77){return function(_0x4618fb,_0x4e1af6,_0x2a6fcf){DashboardItemEvents[_0xfef0('0x5')](_0x11ab77+':'+_0x4618fb['id'],_0x4618fb);DashboardItemEvents[_0xfef0('0x5')](_0x11ab77,_0x4618fb);_0x2a6fcf(null);};}for(var e in events){if(events[_0xfef0('0x6')](e)){var event=events[e];DashboardItem[_0xfef0('0x7')](e,emitEvent(event));}}module[_0xfef0('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 d1b3902..f0a9a5c 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 _0xdcd7=['DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define'];(function(_0x187dbd,_0x2ecf58){var _0x45d1e9=function(_0x2364c0){while(--_0x2364c0){_0x187dbd['push'](_0x187dbd['shift']());}};_0x45d1e9(++_0x2ecf58);}(_0xdcd7,0x161));var _0x7dcd=function(_0xa8bdc4,_0x39e00c){_0xa8bdc4=_0xa8bdc4-0x0;var _0x1e679c=_0xdcd7[_0xa8bdc4];return _0x1e679c;};'use strict';var _=require('lodash');var util=require(_0x7dcd('0x0'));var logger=require(_0x7dcd('0x1'))(_0x7dcd('0x2'));var moment=require(_0x7dcd('0x3'));var BPromise=require(_0x7dcd('0x4'));var rp=require(_0x7dcd('0x5'));var fs=require('fs');var path=require(_0x7dcd('0x6'));var rimraf=require(_0x7dcd('0x7'));var config=require('../../config/environment');var attributes=require(_0x7dcd('0x8'));module[_0x7dcd('0x9')]=function(_0x18dd87,_0x37d751){return _0x18dd87[_0x7dcd('0xa')](_0x7dcd('0xb'),attributes,{'tableName':_0x7dcd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b76=['rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1b76,0x19f));var _0x61b7=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x1b76[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x61b7('0x0'))('api');var moment=require(_0x61b7('0x1'));var BPromise=require(_0x61b7('0x2'));var rp=require(_0x61b7('0x3'));var fs=require('fs');var path=require(_0x61b7('0x4'));var rimraf=require(_0x61b7('0x5'));var config=require(_0x61b7('0x6'));var attributes=require(_0x61b7('0x7'));module['exports']=function(_0x1bdedd,_0x5a23c1){return _0x1bdedd[_0x61b7('0x8')](_0x61b7('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 4cf3d12..4d13d80 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 _0xc06c=['util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3fa39f,_0xcf8e89){var _0x28e7a2=function(_0x1f0a4f){while(--_0x1f0a4f){_0x3fa39f['push'](_0x3fa39f['shift']());}};_0x28e7a2(++_0xcf8e89);}(_0xc06c,0x15d));var _0xcc06=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc06c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcc06('0x0'));var util=require(_0xcc06('0x1'));var moment=require('moment');var BPromise=require(_0xcc06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc06('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc06('0x4'))(_0xcc06('0x5'));var config=require(_0xcc06('0x6'));var jayson=require(_0xcc06('0x7'));var client=jayson[_0xcc06('0x8')][_0xcc06('0x9')]({'port':0x232a});config[_0xcc06('0xa')]=_[_0xcc06('0xb')](config['redis'],{'host':_0xcc06('0xc'),'port':0x18eb});var socket=require(_0xcc06('0xd'))(new Redis(config[_0xcc06('0xa')]));require(_0xcc06('0xe'))['register'](socket);function respondWithRpcPromise(_0x35695c,_0x1c558f,_0x3db39c){return new BPromise(function(_0xeb58d8,_0xae41a7){return client['request'](_0x35695c,_0x3db39c)['then'](function(_0x9df40e){logger[_0xcc06('0xf')](_0xcc06('0x10'),_0x1c558f,_0xcc06('0x11'));logger[_0xcc06('0x12')](_0xcc06('0x13'),_0x1c558f,'request\x20sent',JSON[_0xcc06('0x14')](_0x9df40e));if(_0x9df40e[_0xcc06('0x15')]){if(_0x9df40e[_0xcc06('0x15')][_0xcc06('0x16')]===0x1f4){logger[_0xcc06('0x15')](_0xcc06('0x10'),_0x1c558f,_0x9df40e[_0xcc06('0x15')][_0xcc06('0x17')]);return _0xae41a7(_0x9df40e[_0xcc06('0x15')][_0xcc06('0x17')]);}logger[_0xcc06('0x15')](_0xcc06('0x10'),_0x1c558f,_0x9df40e[_0xcc06('0x15')]['message']);return _0xeb58d8(_0x9df40e['error'][_0xcc06('0x17')]);}else{logger[_0xcc06('0xf')]('DashboardItem,\x20%s,\x20%s',_0x1c558f,_0xcc06('0x11'));_0xeb58d8(_0x9df40e['result'][_0xcc06('0x17')]);}})[_0xcc06('0x18')](function(_0x3bcd0d){logger[_0xcc06('0x15')](_0xcc06('0x10'),_0x1c558f,_0x3bcd0d);_0xae41a7(_0x3bcd0d);});});} \ No newline at end of file +var _0x9aa2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x32f464,_0x15bbcf){var _0x2394d5=function(_0x22aa22){while(--_0x22aa22){_0x32f464['push'](_0x32f464['shift']());}};_0x2394d5(++_0x15bbcf);}(_0x9aa2,0x191));var _0x29aa=function(_0x325826,_0x1a64c8){_0x325826=_0x325826-0x0;var _0x571966=_0x9aa2[_0x325826];return _0x571966;};'use strict';var _=require(_0x29aa('0x0'));var util=require(_0x29aa('0x1'));var moment=require(_0x29aa('0x2'));var BPromise=require(_0x29aa('0x3'));var rs=require(_0x29aa('0x4'));var fs=require('fs');var Redis=require(_0x29aa('0x5'));var db=require(_0x29aa('0x6'))['db'];var utils=require(_0x29aa('0x7'));var logger=require(_0x29aa('0x8'))(_0x29aa('0x9'));var config=require(_0x29aa('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x29aa('0xb')][_0x29aa('0xc')]({'port':0x232a});config[_0x29aa('0xd')]=_[_0x29aa('0xe')](config['redis'],{'host':_0x29aa('0xf'),'port':0x18eb});var socket=require(_0x29aa('0x10'))(new Redis(config['redis']));require(_0x29aa('0x11'))[_0x29aa('0x12')](socket);function respondWithRpcPromise(_0x493cce,_0x4c7188,_0x133158){return new BPromise(function(_0x3739aa,_0x3107da){return client[_0x29aa('0x13')](_0x493cce,_0x133158)[_0x29aa('0x14')](function(_0x428042){logger[_0x29aa('0x15')](_0x29aa('0x16'),_0x4c7188,_0x29aa('0x17'));logger[_0x29aa('0x18')](_0x29aa('0x19'),_0x4c7188,'request\x20sent',JSON[_0x29aa('0x1a')](_0x428042));if(_0x428042[_0x29aa('0x1b')]){if(_0x428042[_0x29aa('0x1b')]['code']===0x1f4){logger['error'](_0x29aa('0x16'),_0x4c7188,_0x428042['error']['message']);return _0x3107da(_0x428042[_0x29aa('0x1b')][_0x29aa('0x1c')]);}logger[_0x29aa('0x1b')](_0x29aa('0x16'),_0x4c7188,_0x428042[_0x29aa('0x1b')][_0x29aa('0x1c')]);return _0x3739aa(_0x428042[_0x29aa('0x1b')][_0x29aa('0x1c')]);}else{logger[_0x29aa('0x15')](_0x29aa('0x16'),_0x4c7188,_0x29aa('0x17'));_0x3739aa(_0x428042[_0x29aa('0x1d')][_0x29aa('0x1c')]);}})[_0x29aa('0x1e')](function(_0x4a7f26){logger[_0x29aa('0x1b')](_0x29aa('0x16'),_0x4c7188,_0x4a7f26);_0x3107da(_0x4a7f26);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4bc2d62..36a2f82 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 _0x9957=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var DashboardItemEvents=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(){DashboardItemEvents[_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);DashboardItemEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x480606,_0x435f24){var _0x142390=function(_0x452cbf){while(--_0x452cbf){_0x480606['push'](_0x480606['shift']());}};_0x142390(++_0x435f24);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ab976,_0x481420){_0x3ab976=_0x3ab976-0x0;var _0x252db5=_0xedd9[_0x3ab976];return _0x252db5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f274eb1..e3251db 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 _0xedd1=['show','post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./dashboardItem.controller','/:id','isAuthenticated'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xedd1,0x1a9));var _0x1edd=function(_0x5a7d7c,_0x9ae68a){_0x5a7d7c=_0x5a7d7c-0x0;var _0x239238=_0xedd1[_0x5a7d7c];return _0x239238;};'use strict';var multer=require(_0x1edd('0x0'));var util=require(_0x1edd('0x1'));var path=require(_0x1edd('0x2'));var timeout=require(_0x1edd('0x3'));var express=require(_0x1edd('0x4'));var router=express[_0x1edd('0x5')]();var auth=require(_0x1edd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1edd('0x7'));router['get'](_0x1edd('0x8'),auth[_0x1edd('0x9')](),controller[_0x1edd('0xa')]);router[_0x1edd('0xb')]('/',auth['isAuthenticated'](),controller[_0x1edd('0xc')]);router[_0x1edd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1edd('0xe')]);router['delete']('/:id',auth[_0x1edd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9bb8=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x9bb8,0xa8));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89bb('0x0'));var util=require('util');var path=require(_0x89bb('0x1'));var timeout=require(_0x89bb('0x2'));var express=require('express');var router=express[_0x89bb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x89bb('0x4'));var config=require(_0x89bb('0x5'));var controller=require(_0x89bb('0x6'));router[_0x89bb('0x7')](_0x89bb('0x8'),auth[_0x89bb('0x9')](),controller[_0x89bb('0xa')]);router[_0x89bb('0xb')]('/',auth[_0x89bb('0x9')](),controller[_0x89bb('0xc')]);router[_0x89bb('0xd')]('/:id',auth[_0x89bb('0x9')](),controller['update']);router[_0x89bb('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x89bb('0xf')]);module[_0x89bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 3f1eae2..089013b 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 _0x2306=['exports','STRING'];(function(_0x199cdd,_0x2068b8){var _0x58e49b=function(_0x511702){while(--_0x511702){_0x199cdd['push'](_0x199cdd['shift']());}};_0x58e49b(++_0x2068b8);}(_0x2306,0x10a));var _0x6230=function(_0x2ca00d,_0x3dca15){_0x2ca00d=_0x2ca00d-0x0;var _0x562d3e=_0x2306[_0x2ca00d];return _0x562d3e;};'use strict';var Sequelize=require('sequelize');module[_0x6230('0x0')]={'name':{'type':Sequelize[_0x6230('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4322=['sequelize','exports','STRING'];(function(_0x5a65f7,_0x1c8aa7){var _0x531c6c=function(_0x19a071){while(--_0x19a071){_0x5a65f7['push'](_0x5a65f7['shift']());}};_0x531c6c(++_0x1c8aa7);}(_0x4322,0x18c));var _0x2432=function(_0x4eb678,_0x1a2a8d){_0x4eb678=_0x4eb678-0x0;var _0x516338=_0x4322[_0x4eb678];return _0x516338;};'use strict';var Sequelize=require(_0x2432('0x0'));module[_0x2432('0x1')]={'name':{'type':Sequelize[_0x2432('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 ddaff18..d7274f3 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 _0x2dec=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','destroy','then','get','error','stack','name','index','Disposition','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation'];(function(_0x4ea134,_0x50e5fa){var _0x31f2ab=function(_0xf4c2e1){while(--_0xf4c2e1){_0x4ea134['push'](_0x4ea134['shift']());}};_0x31f2ab(++_0x50e5fa);}(_0x2dec,0xe2));var _0xc2de=function(_0x581e1d,_0x1ed7d4){_0x581e1d=_0x581e1d-0x0;var _0x39965b=_0x2dec[_0x581e1d];return _0x39965b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc2de('0x0'));var rimraf=require(_0xc2de('0x1'));var zipdir=require(_0xc2de('0x2'));var jsonpatch=require(_0xc2de('0x3'));var rp=require('request-promise');var moment=require(_0xc2de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2de('0x5'));var util=require('util');var path=require(_0xc2de('0x6'));var sox=require(_0xc2de('0x7'));var csv=require(_0xc2de('0x8'));var ejs=require(_0xc2de('0x9'));var fs=require('fs');var _=require(_0xc2de('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc2de('0xb'));var deskjs=require(_0xc2de('0xc'));var toCsv=require(_0xc2de('0x8'));var querystring=require(_0xc2de('0xd'));var Papa=require(_0xc2de('0xe'));var Redis=require(_0xc2de('0xf'));var authService=require(_0xc2de('0x10'));var qs=require(_0xc2de('0x11'));var hardwareService=require(_0xc2de('0x12'));var logger=require(_0xc2de('0x13'))('api');var utils=require(_0xc2de('0x14'));var config=require('../../config/environment');var db=require(_0xc2de('0x15'))['db'];function respondWithStatusCode(_0x41ede0,_0x18c135){_0x18c135=_0x18c135||0xcc;return function(_0x1b7609){if(_0x1b7609){return _0x41ede0[_0xc2de('0x16')](_0x18c135);}return _0x41ede0[_0xc2de('0x17')](_0x18c135)[_0xc2de('0x18')]();};}function respondWithResult(_0x3f8ce1,_0x12609c){_0x12609c=_0x12609c||0xc8;return function(_0x2146f3){if(_0x2146f3){return _0x3f8ce1[_0xc2de('0x17')](_0x12609c)['json'](_0x2146f3);}};}function respondWithFilteredResult(_0x252cf3,_0x3c3831){return function(_0xf85f42){if(_0xf85f42){var _0x3aebe6=_0xf85f42[_0xc2de('0x19')],_0x399d8d=_0x3c3831[_0xc2de('0x1a')],_0x3051a7=_0x3c3831[_0xc2de('0x1a')]+_0x3c3831[_0xc2de('0x1b')],_0x2c0cee;if(_0x3051a7>=_0x3aebe6){_0x3051a7=_0x3aebe6;_0x2c0cee=0xc8;}else{_0x2c0cee=0xce;}_0x252cf3[_0xc2de('0x17')](_0x2c0cee);return _0x252cf3['set'](_0xc2de('0x1c'),_0x399d8d+'-'+_0x3051a7+'/'+_0x3aebe6)['json'](_0xf85f42);}return null;};}function patchUpdates(_0x384f99){return function(_0x43dcd5){try{jsonpatch[_0xc2de('0x1d')](_0x43dcd5,_0x384f99,!![]);}catch(_0x9daed0){return BPromise[_0xc2de('0x1e')](_0x9daed0);}return _0x43dcd5[_0xc2de('0x1f')]();};}function saveUpdates(_0x331ed4,_0xab2400){return function(_0x1152a1){if(_0x1152a1){return _0x1152a1['update'](_0x331ed4)['then'](function(_0x27c1b8){return _0x27c1b8;});}return null;};}function removeEntity(_0x3a6328,_0x5be863){return function(_0xc2866c){if(_0xc2866c){return _0xc2866c[_0xc2de('0x20')]()[_0xc2de('0x21')](function(){var _0xbdeff9=_0xc2866c[_0xc2de('0x22')]({'plain':!![]});var _0x3dff6e='Dispositions';return db['UserProfileResource']['destroy']({'where':{'type':_0x3dff6e,'resourceId':_0xbdeff9['id']}})['then'](function(){return _0xc2866c;});})[_0xc2de('0x21')](function(){_0x3a6328[_0xc2de('0x17')](0xcc)[_0xc2de('0x18')]();});}};}function handleEntityNotFound(_0x25899e,_0x4acdf3){return function(_0x5b91a2){if(!_0x5b91a2){_0x25899e['sendStatus'](0x194);}return _0x5b91a2;};}function handleError(_0x289072,_0x18d15e){_0x18d15e=_0x18d15e||0x1f4;return function(_0x58e681){logger[_0xc2de('0x23')](_0x58e681[_0xc2de('0x24')]);if(_0x58e681[_0xc2de('0x25')]){delete _0x58e681['name'];}_0x289072['status'](_0x18d15e)['send'](_0x58e681);};}exports[_0xc2de('0x26')]=function(_0x1e306e,_0x1f5c78){var _0x4e07e5={},_0x4718c4={},_0x32b5d3={'count':0x0,'rows':[]};var _0x2f91d8=db[_0xc2de('0x27')]['rawAttributes'];_0x4718c4[_0xc2de('0x28')]=_[_0xc2de('0x29')](_0x2f91d8);_0x4718c4[_0xc2de('0x2a')]=_[_0xc2de('0x29')](_0x1e306e[_0xc2de('0x2a')]);_0x4718c4[_0xc2de('0x2b')]=_[_0xc2de('0x2c')](_0x4718c4[_0xc2de('0x28')],_0x4718c4['query']);_0x4e07e5[_0xc2de('0x2d')]=_[_0xc2de('0x2c')](_0x4718c4['model'],qs[_0xc2de('0x2e')](_0x1e306e['query'][_0xc2de('0x2e')]));_0x4e07e5[_0xc2de('0x2d')]=_0x4e07e5[_0xc2de('0x2d')]['length']?_0x4e07e5[_0xc2de('0x2d')]:_0x4718c4[_0xc2de('0x28')];if(!_0x1e306e[_0xc2de('0x2a')][_0xc2de('0x2f')]('nolimit')){_0x4e07e5[_0xc2de('0x1b')]=qs[_0xc2de('0x1b')](_0x1e306e['query'][_0xc2de('0x1b')]);_0x4e07e5[_0xc2de('0x1a')]=qs[_0xc2de('0x1a')](_0x1e306e[_0xc2de('0x2a')][_0xc2de('0x1a')]);}_0x4e07e5[_0xc2de('0x30')]=qs[_0xc2de('0x31')](_0x1e306e[_0xc2de('0x2a')]['sort']);_0x4e07e5[_0xc2de('0x32')]=qs['filters'](_[_0xc2de('0x33')](_0x1e306e['query'],_0x4718c4[_0xc2de('0x2b')]));if(_0x1e306e[_0xc2de('0x2a')][_0xc2de('0x34')]){_0x4e07e5[_0xc2de('0x32')]=_[_0xc2de('0x35')](_0x4e07e5[_0xc2de('0x32')],{'$or':_[_0xc2de('0x36')](_0x2f91d8,function(_0x37e16e){if(_0x37e16e['type']['key']!==_0xc2de('0x37')){var _0x4b98e6={};_0x4b98e6[_0x37e16e[_0xc2de('0x38')]]={'$like':'%'+_0x1e306e['query']['filter']+'%'};return _0x4b98e6;}})});}_0x4e07e5=_[_0xc2de('0x35')]({},_0x4e07e5,_0x1e306e[_0xc2de('0x39')]);var _0x396aa4={'where':_0x4e07e5['where']};return db[_0xc2de('0x27')][_0xc2de('0x19')](_0x396aa4)['then'](function(_0x46004a){_0x32b5d3[_0xc2de('0x19')]=_0x46004a;if(_0x1e306e[_0xc2de('0x2a')][_0xc2de('0x3a')]){_0x4e07e5['include']=[{'all':!![]}];}return db[_0xc2de('0x27')][_0xc2de('0x3b')](_0x4e07e5);})[_0xc2de('0x21')](function(_0x1140c3){_0x32b5d3['rows']=_0x1140c3;return _0x32b5d3;})[_0xc2de('0x21')](respondWithFilteredResult(_0x1f5c78,_0x4e07e5))[_0xc2de('0x3c')](handleError(_0x1f5c78,null));};exports[_0xc2de('0x3d')]=function(_0x442290,_0x4a3174){var _0x2739b8={'raw':!![],'where':{'id':_0x442290['params']['id']}},_0x82743e={};_0x82743e[_0xc2de('0x28')]=_['keys'](db[_0xc2de('0x27')]['rawAttributes']);_0x82743e['query']=_[_0xc2de('0x29')](_0x442290[_0xc2de('0x2a')]);_0x82743e['filters']=_[_0xc2de('0x2c')](_0x82743e[_0xc2de('0x28')],_0x82743e[_0xc2de('0x2a')]);_0x2739b8[_0xc2de('0x2d')]=_[_0xc2de('0x2c')](_0x82743e['model'],qs[_0xc2de('0x2e')](_0x442290['query'][_0xc2de('0x2e')]));_0x2739b8['attributes']=_0x2739b8['attributes']['length']?_0x2739b8[_0xc2de('0x2d')]:_0x82743e[_0xc2de('0x28')];if(_0x442290[_0xc2de('0x2a')][_0xc2de('0x3a')]){_0x2739b8[_0xc2de('0x3e')]=[{'all':!![]}];}_0x2739b8=_['merge']({},_0x2739b8,_0x442290[_0xc2de('0x39')]);return db['Disposition'][_0xc2de('0x3f')](_0x2739b8)[_0xc2de('0x21')](handleEntityNotFound(_0x4a3174,null))[_0xc2de('0x21')](respondWithResult(_0x4a3174,null))['catch'](handleError(_0x4a3174,null));};exports[_0xc2de('0x40')]=function(_0x114073,_0x3003e7){return db[_0xc2de('0x27')][_0xc2de('0x40')](_0x114073[_0xc2de('0x41')],{})[_0xc2de('0x21')](function(_0x4b5eca){var _0x55276c=_0x114073[_0xc2de('0x42')][_0xc2de('0x22')]({'plain':!![]});if(!_0x55276c)throw new Error(_0xc2de('0x43'));if(_0x55276c[_0xc2de('0x44')]===_0xc2de('0x42')){var _0x4dee33=_0x4b5eca['get']({'plain':!![]});var _0x221170='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x221170,'userProfileId':_0x55276c['userProfileId']},'raw':!![]})[_0xc2de('0x21')](function(_0x31d6ef){if(_0x31d6ef&&_0x31d6ef[_0xc2de('0x45')]===0x0){return db[_0xc2de('0x46')]['create']({'name':_0x4dee33[_0xc2de('0x25')],'resourceId':_0x4dee33['id'],'type':_0x31d6ef[_0xc2de('0x25')],'sectionId':_0x31d6ef['id']},{})[_0xc2de('0x21')](function(){return _0x4b5eca;});}else{return _0x4b5eca;}})[_0xc2de('0x3c')](function(_0x18a026){logger['error'](_0xc2de('0x47'),_0x18a026);throw _0x18a026;});}return _0x4b5eca;})['then'](respondWithResult(_0x3003e7,0xc9))[_0xc2de('0x3c')](handleError(_0x3003e7,null));};exports[_0xc2de('0x48')]=function(_0x341c96,_0x59d3df){if(_0x341c96[_0xc2de('0x41')]['id']){delete _0x341c96[_0xc2de('0x41')]['id'];}return db[_0xc2de('0x27')][_0xc2de('0x3f')]({'where':{'id':_0x341c96['params']['id']}})[_0xc2de('0x21')](handleEntityNotFound(_0x59d3df,null))['then'](saveUpdates(_0x341c96[_0xc2de('0x41')],null))[_0xc2de('0x21')](respondWithResult(_0x59d3df,null))[_0xc2de('0x3c')](handleError(_0x59d3df,null));};exports[_0xc2de('0x20')]=function(_0x5c14a6,_0x1f5de5){return db['Disposition']['find']({'where':{'id':_0x5c14a6[_0xc2de('0x49')]['id']}})[_0xc2de('0x21')](handleEntityNotFound(_0x1f5de5,null))['then'](removeEntity(_0x1f5de5,null))[_0xc2de('0x3c')](handleError(_0x1f5de5,null));}; \ No newline at end of file +var _0x5f4b=['map','type','key','VIRTUAL','field','filter','options','Disposition','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','merge'];(function(_0x4dbef6,_0x1fedfa){var _0x40805d=function(_0x3c4623){while(--_0x3c4623){_0x4dbef6['push'](_0x4dbef6['shift']());}};_0x40805d(++_0x1fedfa);}(_0x5f4b,0x67));var _0xb5f4=function(_0x30b113,_0x4fbf27){_0x30b113=_0x30b113-0x0;var _0x2394fc=_0x5f4b[_0x30b113];return _0x2394fc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb5f4('0x0'));var rimraf=require(_0xb5f4('0x1'));var zipdir=require(_0xb5f4('0x2'));var jsonpatch=require(_0xb5f4('0x3'));var rp=require(_0xb5f4('0x4'));var moment=require(_0xb5f4('0x5'));var BPromise=require(_0xb5f4('0x6'));var Mustache=require(_0xb5f4('0x7'));var util=require(_0xb5f4('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb5f4('0x9'));var ejs=require(_0xb5f4('0xa'));var fs=require('fs');var _=require(_0xb5f4('0xb'));var squel=require(_0xb5f4('0xc'));var crypto=require(_0xb5f4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb5f4('0xe'));var toCsv=require(_0xb5f4('0x9'));var querystring=require('querystring');var Papa=require(_0xb5f4('0xf'));var Redis=require(_0xb5f4('0x10'));var authService=require(_0xb5f4('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb5f4('0x12'));var logger=require('../../config/logger')(_0xb5f4('0x13'));var utils=require(_0xb5f4('0x14'));var config=require(_0xb5f4('0x15'));var db=require(_0xb5f4('0x16'))['db'];function respondWithStatusCode(_0x507912,_0x17f45c){_0x17f45c=_0x17f45c||0xcc;return function(_0xdd5809){if(_0xdd5809){return _0x507912[_0xb5f4('0x17')](_0x17f45c);}return _0x507912[_0xb5f4('0x18')](_0x17f45c)[_0xb5f4('0x19')]();};}function respondWithResult(_0xf684b9,_0x51b565){_0x51b565=_0x51b565||0xc8;return function(_0x3fca02){if(_0x3fca02){return _0xf684b9['status'](_0x51b565)[_0xb5f4('0x1a')](_0x3fca02);}};}function respondWithFilteredResult(_0x561c42,_0x3f297a){return function(_0x4e6151){if(_0x4e6151){var _0x5ec446=_0x4e6151['count'],_0x29f9ee=_0x3f297a[_0xb5f4('0x1b')],_0x1a6866=_0x3f297a[_0xb5f4('0x1b')]+_0x3f297a[_0xb5f4('0x1c')],_0x3a505b;if(_0x1a6866>=_0x5ec446){_0x1a6866=_0x5ec446;_0x3a505b=0xc8;}else{_0x3a505b=0xce;}_0x561c42['status'](_0x3a505b);return _0x561c42['set'](_0xb5f4('0x1d'),_0x29f9ee+'-'+_0x1a6866+'/'+_0x5ec446)['json'](_0x4e6151);}return null;};}function patchUpdates(_0x4e77cc){return function(_0x2dbe6b){try{jsonpatch[_0xb5f4('0x1e')](_0x2dbe6b,_0x4e77cc,!![]);}catch(_0x362f6d){return BPromise[_0xb5f4('0x1f')](_0x362f6d);}return _0x2dbe6b['save']();};}function saveUpdates(_0x5f1c20,_0x46709c){return function(_0xbd4f3b){if(_0xbd4f3b){return _0xbd4f3b[_0xb5f4('0x20')](_0x5f1c20)[_0xb5f4('0x21')](function(_0x2ef219){return _0x2ef219;});}return null;};}function removeEntity(_0x29b1bb,_0x20040b){return function(_0x301948){if(_0x301948){return _0x301948[_0xb5f4('0x22')]()[_0xb5f4('0x21')](function(){var _0x2011f8=_0x301948[_0xb5f4('0x23')]({'plain':!![]});var _0x44c82f=_0xb5f4('0x24');return db[_0xb5f4('0x25')]['destroy']({'where':{'type':_0x44c82f,'resourceId':_0x2011f8['id']}})[_0xb5f4('0x21')](function(){return _0x301948;});})[_0xb5f4('0x21')](function(){_0x29b1bb[_0xb5f4('0x18')](0xcc)[_0xb5f4('0x19')]();});}};}function handleEntityNotFound(_0xe8b9cf,_0x599cda){return function(_0x4f9001){if(!_0x4f9001){_0xe8b9cf[_0xb5f4('0x17')](0x194);}return _0x4f9001;};}function handleError(_0x3f7cca,_0x51367a){_0x51367a=_0x51367a||0x1f4;return function(_0x3127a0){logger['error'](_0x3127a0[_0xb5f4('0x26')]);if(_0x3127a0[_0xb5f4('0x27')]){delete _0x3127a0[_0xb5f4('0x27')];}_0x3f7cca[_0xb5f4('0x18')](_0x51367a)[_0xb5f4('0x28')](_0x3127a0);};}exports[_0xb5f4('0x29')]=function(_0x2712a2,_0x5068e1){var _0x47aca4={},_0x3f4ba3={},_0x83bf5b={'count':0x0,'rows':[]};var _0x13b09b=db['Disposition']['rawAttributes'];_0x3f4ba3['model']=_[_0xb5f4('0x2a')](_0x13b09b);_0x3f4ba3['query']=_[_0xb5f4('0x2a')](_0x2712a2[_0xb5f4('0x2b')]);_0x3f4ba3[_0xb5f4('0x2c')]=_['intersection'](_0x3f4ba3[_0xb5f4('0x2d')],_0x3f4ba3[_0xb5f4('0x2b')]);_0x47aca4[_0xb5f4('0x2e')]=_[_0xb5f4('0x2f')](_0x3f4ba3[_0xb5f4('0x2d')],qs[_0xb5f4('0x30')](_0x2712a2[_0xb5f4('0x2b')][_0xb5f4('0x30')]));_0x47aca4['attributes']=_0x47aca4['attributes'][_0xb5f4('0x31')]?_0x47aca4[_0xb5f4('0x2e')]:_0x3f4ba3[_0xb5f4('0x2d')];if(!_0x2712a2[_0xb5f4('0x2b')]['hasOwnProperty'](_0xb5f4('0x32'))){_0x47aca4['limit']=qs[_0xb5f4('0x1c')](_0x2712a2[_0xb5f4('0x2b')][_0xb5f4('0x1c')]);_0x47aca4[_0xb5f4('0x1b')]=qs[_0xb5f4('0x1b')](_0x2712a2['query']['offset']);}_0x47aca4[_0xb5f4('0x33')]=qs[_0xb5f4('0x34')](_0x2712a2[_0xb5f4('0x2b')][_0xb5f4('0x34')]);_0x47aca4[_0xb5f4('0x35')]=qs[_0xb5f4('0x2c')](_['pick'](_0x2712a2[_0xb5f4('0x2b')],_0x3f4ba3[_0xb5f4('0x2c')]));if(_0x2712a2[_0xb5f4('0x2b')]['filter']){_0x47aca4[_0xb5f4('0x35')]=_[_0xb5f4('0x36')](_0x47aca4[_0xb5f4('0x35')],{'$or':_[_0xb5f4('0x37')](_0x13b09b,function(_0x4aa2e0){if(_0x4aa2e0[_0xb5f4('0x38')][_0xb5f4('0x39')]!==_0xb5f4('0x3a')){var _0x3f4a6e={};_0x3f4a6e[_0x4aa2e0[_0xb5f4('0x3b')]]={'$like':'%'+_0x2712a2[_0xb5f4('0x2b')][_0xb5f4('0x3c')]+'%'};return _0x3f4a6e;}})});}_0x47aca4=_[_0xb5f4('0x36')]({},_0x47aca4,_0x2712a2[_0xb5f4('0x3d')]);var _0x52b8b4={'where':_0x47aca4[_0xb5f4('0x35')]};return db[_0xb5f4('0x3e')][_0xb5f4('0x3f')](_0x52b8b4)['then'](function(_0x2cf18f){_0x83bf5b['count']=_0x2cf18f;if(_0x2712a2[_0xb5f4('0x2b')][_0xb5f4('0x40')]){_0x47aca4['include']=[{'all':!![]}];}return db[_0xb5f4('0x3e')][_0xb5f4('0x41')](_0x47aca4);})[_0xb5f4('0x21')](function(_0x255af9){_0x83bf5b[_0xb5f4('0x42')]=_0x255af9;return _0x83bf5b;})[_0xb5f4('0x21')](respondWithFilteredResult(_0x5068e1,_0x47aca4))[_0xb5f4('0x43')](handleError(_0x5068e1,null));};exports[_0xb5f4('0x44')]=function(_0x5a9fe8,_0x5f2f1d){var _0x490f69={'raw':!![],'where':{'id':_0x5a9fe8[_0xb5f4('0x45')]['id']}},_0x45d906={};_0x45d906[_0xb5f4('0x2d')]=_['keys'](db[_0xb5f4('0x3e')][_0xb5f4('0x46')]);_0x45d906[_0xb5f4('0x2b')]=_[_0xb5f4('0x2a')](_0x5a9fe8['query']);_0x45d906[_0xb5f4('0x2c')]=_[_0xb5f4('0x2f')](_0x45d906[_0xb5f4('0x2d')],_0x45d906[_0xb5f4('0x2b')]);_0x490f69[_0xb5f4('0x2e')]=_[_0xb5f4('0x2f')](_0x45d906['model'],qs['fields'](_0x5a9fe8[_0xb5f4('0x2b')][_0xb5f4('0x30')]));_0x490f69[_0xb5f4('0x2e')]=_0x490f69['attributes'][_0xb5f4('0x31')]?_0x490f69[_0xb5f4('0x2e')]:_0x45d906[_0xb5f4('0x2d')];if(_0x5a9fe8['query'][_0xb5f4('0x40')]){_0x490f69[_0xb5f4('0x47')]=[{'all':!![]}];}_0x490f69=_[_0xb5f4('0x36')]({},_0x490f69,_0x5a9fe8['options']);return db[_0xb5f4('0x3e')][_0xb5f4('0x48')](_0x490f69)[_0xb5f4('0x21')](handleEntityNotFound(_0x5f2f1d,null))[_0xb5f4('0x21')](respondWithResult(_0x5f2f1d,null))['catch'](handleError(_0x5f2f1d,null));};exports[_0xb5f4('0x49')]=function(_0x428c3a,_0x3187a2){return db[_0xb5f4('0x3e')][_0xb5f4('0x49')](_0x428c3a[_0xb5f4('0x4a')],{})[_0xb5f4('0x21')](function(_0x1ed93a){var _0x1416f1=_0x428c3a[_0xb5f4('0x4b')][_0xb5f4('0x23')]({'plain':!![]});if(!_0x1416f1)throw new Error(_0xb5f4('0x4c'));if(_0x1416f1['role']===_0xb5f4('0x4b')){var _0x38f85f=_0x1ed93a[_0xb5f4('0x23')]({'plain':!![]});var _0x5f3e86=_0xb5f4('0x24');return db['UserProfileSection'][_0xb5f4('0x48')]({'where':{'name':_0x5f3e86,'userProfileId':_0x1416f1['userProfileId']},'raw':!![]})[_0xb5f4('0x21')](function(_0x1352dd){if(_0x1352dd&&_0x1352dd[_0xb5f4('0x4d')]===0x0){return db['UserProfileResource'][_0xb5f4('0x49')]({'name':_0x38f85f[_0xb5f4('0x27')],'resourceId':_0x38f85f['id'],'type':_0x1352dd[_0xb5f4('0x27')],'sectionId':_0x1352dd['id']},{})[_0xb5f4('0x21')](function(){return _0x1ed93a;});}else{return _0x1ed93a;}})[_0xb5f4('0x43')](function(_0x500f21){logger[_0xb5f4('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x500f21);throw _0x500f21;});}return _0x1ed93a;})[_0xb5f4('0x21')](respondWithResult(_0x3187a2,0xc9))[_0xb5f4('0x43')](handleError(_0x3187a2,null));};exports[_0xb5f4('0x20')]=function(_0x4ecb49,_0x26c8f6){if(_0x4ecb49[_0xb5f4('0x4a')]['id']){delete _0x4ecb49[_0xb5f4('0x4a')]['id'];}return db['Disposition']['find']({'where':{'id':_0x4ecb49[_0xb5f4('0x45')]['id']}})[_0xb5f4('0x21')](handleEntityNotFound(_0x26c8f6,null))[_0xb5f4('0x21')](saveUpdates(_0x4ecb49[_0xb5f4('0x4a')],null))[_0xb5f4('0x21')](respondWithResult(_0x26c8f6,null))['catch'](handleError(_0x26c8f6,null));};exports[_0xb5f4('0x22')]=function(_0x58eb26,_0x58c5c7){return db[_0xb5f4('0x3e')][_0xb5f4('0x48')]({'where':{'id':_0x58eb26['params']['id']}})[_0xb5f4('0x21')](handleEntityNotFound(_0x58c5c7,null))[_0xb5f4('0x21')](removeEntity(_0x58c5c7,null))[_0xb5f4('0x43')](handleError(_0x58c5c7,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index a9bfa26..7ae551a 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 _0x0d50=['tools_dispositions','name','name_chat','ChatWebsiteId','name_mail','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','Disposition'];(function(_0x3db450,_0x49d2b3){var _0x6e1517=function(_0x568e07){while(--_0x568e07){_0x3db450['push'](_0x3db450['shift']());}};_0x6e1517(++_0x49d2b3);}(_0x0d50,0x130));var _0x00d5=function(_0x5e4931,_0x5768dc){_0x5e4931=_0x5e4931-0x0;var _0x1eb815=_0x0d50[_0x5e4931];return _0x1eb815;};'use strict';var _=require(_0x00d5('0x0'));var util=require(_0x00d5('0x1'));var logger=require(_0x00d5('0x2'))(_0x00d5('0x3'));var moment=require(_0x00d5('0x4'));var BPromise=require(_0x00d5('0x5'));var rp=require(_0x00d5('0x6'));var fs=require('fs');var path=require(_0x00d5('0x7'));var rimraf=require(_0x00d5('0x8'));var config=require('../../config/environment');var attributes=require(_0x00d5('0x9'));module['exports']=function(_0x595a3e,_0x2b9c2c){return _0x595a3e['define'](_0x00d5('0xa'),attributes,{'tableName':_0x00d5('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x00d5('0xc'),'ListId']},{'unique':!![],'name':_0x00d5('0xd'),'fields':[_0x00d5('0xc'),_0x00d5('0xe')]},{'unique':!![],'name':_0x00d5('0xf'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x00d5('0x10'),'fields':[_0x00d5('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x00d5('0x11'),'fields':[_0x00d5('0xc'),_0x00d5('0x12')]},{'unique':!![],'name':_0x00d5('0x13'),'fields':[_0x00d5('0xc'),_0x00d5('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x187f=['name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x46c072,_0x193533){var _0x24c374=function(_0x58702f){while(--_0x58702f){_0x46c072['push'](_0x46c072['shift']());}};_0x24c374(++_0x193533);}(_0x187f,0x1e2));var _0xf187=function(_0x50c5fb,_0x5508a5){_0x50c5fb=_0x50c5fb-0x0;var _0x3e9f9d=_0x187f[_0x50c5fb];return _0x3e9f9d;};'use strict';var _=require(_0xf187('0x0'));var util=require(_0xf187('0x1'));var logger=require(_0xf187('0x2'))('api');var moment=require(_0xf187('0x3'));var BPromise=require(_0xf187('0x4'));var rp=require(_0xf187('0x5'));var fs=require('fs');var path=require(_0xf187('0x6'));var rimraf=require('rimraf');var config=require(_0xf187('0x7'));var attributes=require(_0xf187('0x8'));module[_0xf187('0x9')]=function(_0x305ad6,_0x5cd63d){return _0x305ad6[_0xf187('0xa')](_0xf187('0xb'),attributes,{'tableName':_0xf187('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf187('0xd'),'fields':[_0xf187('0xe'),_0xf187('0xf')]},{'unique':!![],'name':_0xf187('0x10'),'fields':[_0xf187('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xf187('0x11'),'fields':[_0xf187('0xe'),_0xf187('0x12')]},{'unique':!![],'name':_0xf187('0x13'),'fields':[_0xf187('0xe'),_0xf187('0x14')]},{'unique':!![],'name':_0xf187('0x15'),'fields':[_0xf187('0xe'),'FaxAccountId']},{'unique':!![],'name':_0xf187('0x16'),'fields':[_0xf187('0xe'),_0xf187('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 06eb55c..8ca94f4 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 _0xb66c=['../../config/environment','jayson/promise','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xf988e1,_0x157803){var _0x3d3525=function(_0x50101a){while(--_0x50101a){_0xf988e1['push'](_0xf988e1['shift']());}};_0x3d3525(++_0x157803);}(_0xb66c,0x175));var _0xcb66=function(_0x2f3bdd,_0x183ac2){_0x2f3bdd=_0x2f3bdd-0x0;var _0x5374d8=_0xb66c[_0x2f3bdd];return _0x5374d8;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var moment=require(_0xcb66('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb66('0x2'));var fs=require('fs');var Redis=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var jayson=require(_0xcb66('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19adf5,_0x1b6852,_0xa3993){return new BPromise(function(_0x439f3d,_0xf7bc39){return client['request'](_0x19adf5,_0xa3993)[_0xcb66('0x9')](function(_0x3047f7){logger[_0xcb66('0xa')](_0xcb66('0xb'),_0x1b6852,_0xcb66('0xc'));logger['debug'](_0xcb66('0xd'),_0x1b6852,_0xcb66('0xc'),JSON[_0xcb66('0xe')](_0x3047f7));if(_0x3047f7[_0xcb66('0xf')]){if(_0x3047f7['error'][_0xcb66('0x10')]===0x1f4){logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7[_0xcb66('0xf')]['message']);return _0xf7bc39(_0x3047f7[_0xcb66('0xf')][_0xcb66('0x11')]);}logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7['error'][_0xcb66('0x11')]);return _0x439f3d(_0x3047f7['error'][_0xcb66('0x11')]);}else{logger['info'](_0xcb66('0xb'),_0x1b6852,'request\x20sent');_0x439f3d(_0x3047f7['result'][_0xcb66('0x11')]);}})[_0xcb66('0x12')](function(_0x681ce3){logger[_0xcb66('0xf')]('Disposition,\x20%s,\x20%s',_0x1b6852,_0x681ce3);_0xf7bc39(_0x681ce3);});});} \ No newline at end of file +var _0xe0ae=['debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','info','Disposition,\x20%s,\x20%s'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xe0ae,0xa1));var _0xee0a=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0xe0ae[_0x557fd2];return _0x1b54a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee0a('0x0'));var BPromise=require(_0xee0a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee0a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee0a('0x3'));var logger=require(_0xee0a('0x4'))('rpc');var config=require(_0xee0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee0a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c5071,_0x347cb3,_0x344355){return new BPromise(function(_0x5e6d2e,_0x2296b9){return client['request'](_0x1c5071,_0x344355)['then'](function(_0x1f9d42){logger[_0xee0a('0x7')](_0xee0a('0x8'),_0x347cb3,'request\x20sent');logger[_0xee0a('0x9')](_0xee0a('0xa'),_0x347cb3,'request\x20sent',JSON[_0xee0a('0xb')](_0x1f9d42));if(_0x1f9d42['error']){if(_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xd')]===0x1f4){logger['error'](_0xee0a('0x8'),_0x347cb3,_0x1f9d42['error'][_0xee0a('0xe')]);return _0x2296b9(_0x1f9d42[_0xee0a('0xc')]['message']);}logger['error'](_0xee0a('0x8'),_0x347cb3,_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xe')]);return _0x5e6d2e(_0x1f9d42[_0xee0a('0xc')][_0xee0a('0xe')]);}else{logger['info'](_0xee0a('0x8'),_0x347cb3,_0xee0a('0xf'));_0x5e6d2e(_0x1f9d42['result'][_0xee0a('0xe')]);}})[_0xee0a('0x10')](function(_0x1bc8e1){logger[_0xee0a('0xc')]('Disposition,\x20%s,\x20%s',_0x347cb3,_0x1bc8e1);_0x2296b9(_0x1bc8e1);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 832b23f..3706008 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 _0x6b32=['isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','path','connect-timeout','express','Router','./disposition.controller','get'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x6b32,0x1ac));var _0x26b3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b32[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x26b3('0x0'));var util=require('util');var path=require(_0x26b3('0x1'));var timeout=require(_0x26b3('0x2'));var express=require(_0x26b3('0x3'));var router=express[_0x26b3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26b3('0x5'));router[_0x26b3('0x6')]('/',auth[_0x26b3('0x7')](),controller[_0x26b3('0x8')]);router[_0x26b3('0x6')](_0x26b3('0x9'),auth[_0x26b3('0x7')](),controller[_0x26b3('0xa')]);router[_0x26b3('0xb')]('/',auth[_0x26b3('0x7')](),controller['create']);router['put'](_0x26b3('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x26b3('0xc')](_0x26b3('0x9'),auth[_0x26b3('0x7')](),controller[_0x26b3('0xd')]);module[_0x26b3('0xe')]=router; \ No newline at end of file +var _0xa433=['get','isAuthenticated','/:id','show','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0xa433,0x1b8));var _0x3a43=function(_0x5bb7cf,_0x5f16ef){_0x5bb7cf=_0x5bb7cf-0x0;var _0x258cc9=_0xa433[_0x5bb7cf];return _0x258cc9;};'use strict';var multer=require('multer');var util=require(_0x3a43('0x0'));var path=require('path');var timeout=require(_0x3a43('0x1'));var express=require(_0x3a43('0x2'));var router=express[_0x3a43('0x3')]();var auth=require(_0x3a43('0x4'));var interaction=require(_0x3a43('0x5'));var config=require(_0x3a43('0x6'));var controller=require(_0x3a43('0x7'));router[_0x3a43('0x8')]('/',auth[_0x3a43('0x9')](),controller['index']);router[_0x3a43('0x8')](_0x3a43('0xa'),auth[_0x3a43('0x9')](),controller[_0x3a43('0xb')]);router['post']('/',auth[_0x3a43('0x9')](),controller[_0x3a43('0xc')]);router[_0x3a43('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a43('0xe')](_0x3a43('0xa'),auth[_0x3a43('0x9')](),controller['destroy']);module[_0x3a43('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9024e83..fef2e37 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 _0xb5ca=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x2acd64,_0x4e8ce8){var _0x3d3fce=function(_0x5570df){while(--_0x5570df){_0x2acd64['push'](_0x2acd64['shift']());}};_0x3d3fce(++_0x4e8ce8);}(_0xb5ca,0x1e9));var _0xab5c=function(_0x7ae9f0,_0x384e37){_0x7ae9f0=_0x7ae9f0-0x0;var _0x2d5816=_0xb5ca[_0x7ae9f0];return _0x2d5816;};'use strict';var Sequelize=require(_0xab5c('0x0'));module[_0xab5c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab5c('0x2')]},'ecm':{'type':Sequelize[_0xab5c('0x3')](_0xab5c('0x4'),'no'),'defaultValue':_0xab5c('0x4')},'headerinfo':{'type':Sequelize[_0xab5c('0x2')],'defaultValue':_0xab5c('0x5')},'localstationid':{'type':Sequelize[_0xab5c('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xab5c('0x3')](_0xab5c('0x6'),_0xab5c('0x7'),'7200','9600',_0xab5c('0x8'),_0xab5c('0x9')),'defaultValue':_0xab5c('0x7')},'maxrate':{'type':Sequelize[_0xab5c('0x3')](_0xab5c('0x6'),_0xab5c('0x7'),'7200','9600',_0xab5c('0x8'),_0xab5c('0x9')),'defaultValue':_0xab5c('0x9')},'modem':{'type':Sequelize[_0xab5c('0x2')],'defaultValue':_0xab5c('0xa')},'gateway':{'type':Sequelize[_0xab5c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xab5c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xab5c('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xab5c('0x3')](_0xab5c('0xc'),_0xab5c('0xd'),'DADHI',_0xab5c('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xab5c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xab5c('0xf')],'defaultValue':function(){return _0xab5c('0x10');}},'notificationSound':{'type':Sequelize[_0xab5c('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xab5c('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xab5c('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xab5c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xab5c('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xab5c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xab5c('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xab5c('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xab5c('0x11')],'defaultValue':![],'comment':_0xab5c('0x13'),'set':function(_0x372b8b){if(!_0x372b8b)this[_0xab5c('0x14')]('mandatoryDispositionPauseId',null);this[_0xab5c('0x14')](_0xab5c('0x15'),_0x372b8b);}}}; \ No newline at end of file +var _0x6a66=['SIP','IAX','DADHI','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','12000','14400','9600','INTEGER'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x6a66,0x120));var _0x66a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a66[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x66a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x66a6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x66a6('0x2')](_0x66a6('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x66a6('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x66a6('0x4')},'minrate':{'type':Sequelize[_0x66a6('0x2')](_0x66a6('0x5'),_0x66a6('0x6'),_0x66a6('0x7'),'9600',_0x66a6('0x8'),_0x66a6('0x9')),'defaultValue':_0x66a6('0x6')},'maxrate':{'type':Sequelize[_0x66a6('0x2')](_0x66a6('0x5'),'4800',_0x66a6('0x7'),_0x66a6('0xa'),_0x66a6('0x8'),_0x66a6('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x66a6('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x66a6('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x66a6('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x66a6('0x2')](_0x66a6('0xc'),_0x66a6('0xd'),_0x66a6('0xe'),_0x66a6('0xf')),'defaultValue':_0x66a6('0xc')},'key':{'type':Sequelize[_0x66a6('0x1')],'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[_0x66a6('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x66a6('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x66a6('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x66a6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x66a6('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x66a6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x66a6('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x66a6('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x66a6('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x298f41){if(!_0x298f41)this[_0x66a6('0x12')](_0x66a6('0x13'),null);this[_0x66a6('0x12')]('mandatoryDisposition',_0x298f41);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9d7db32..a7311e9 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 _0x5a68=['order','sort','pick','filter','where','type','key','field','merge','includeAll','findAll','rows','show','params','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','Disposition','findOne','nolimit','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','map','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','test','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x5a68,0x139));var _0x85a6=function(_0x432c1d,_0x11aebb){_0x432c1d=_0x432c1d-0x0;var _0x1d5a11=_0x5a68[_0x432c1d];return _0x1d5a11;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x85a6('0x0'));var rimraf=require(_0x85a6('0x1'));var zipdir=require(_0x85a6('0x2'));var jsonpatch=require(_0x85a6('0x3'));var rp=require(_0x85a6('0x4'));var moment=require(_0x85a6('0x5'));var BPromise=require(_0x85a6('0x6'));var Mustache=require(_0x85a6('0x7'));var util=require('util');var path=require(_0x85a6('0x8'));var sox=require(_0x85a6('0x9'));var csv=require(_0x85a6('0xa'));var ejs=require(_0x85a6('0xb'));var fs=require('fs');var _=require(_0x85a6('0xc'));var squel=require(_0x85a6('0xd'));var crypto=require(_0x85a6('0xe'));var jsforce=require(_0x85a6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x85a6('0xa'));var querystring=require(_0x85a6('0x10'));var Papa=require(_0x85a6('0x11'));var Redis=require(_0x85a6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x85a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85a6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x85a6('0x15'))['db'];config[_0x85a6('0x16')]=_['defaults'](config[_0x85a6('0x16')],{'host':_0x85a6('0x17'),'port':0x18eb});var socket=require(_0x85a6('0x18'))(new Redis(config[_0x85a6('0x16')]));require(_0x85a6('0x19'))[_0x85a6('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x85a6('0x1b')][_0x85a6('0x1c')]({'port':0x232c});var client9002=jayson[_0x85a6('0x1b')][_0x85a6('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x436414,_0x4d050a,_0x54ff8e){if(_0x54ff8e){var _0x5a775d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a775d[_0x85a6('0x1d')](_0x4d050a)){return _0x436414;}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 _0x436414;}}function respondWithRpcPromise(_0x2db0c9,_0x3945ea,_0x13788c,_0x59b2fb){return new BPromise(function(_0x1fc4b2,_0x938911){var _0x4a6eb9=_0x59b2fb||client;return _0x4a6eb9[_0x85a6('0x1e')](_0x2db0c9,_0x13788c)[_0x85a6('0x1f')](function(_0x2bd285){logger[_0x85a6('0x20')](_0x85a6('0x21'),_0x3945ea,_0x85a6('0x22'));logger[_0x85a6('0x23')](_0x85a6('0x24'),_0x3945ea,_0x85a6('0x22'),JSON[_0x85a6('0x25')](_0x2bd285));if(_0x2bd285['error']){if(_0x2bd285[_0x85a6('0x26')][_0x85a6('0x27')]===0x1f4){logger[_0x85a6('0x26')](_0x85a6('0x21'),_0x3945ea,_0x2bd285[_0x85a6('0x26')][_0x85a6('0x28')]);return _0x938911(_0x2bd285['error']['message']);}logger[_0x85a6('0x26')](_0x85a6('0x21'),_0x3945ea,_0x2bd285[_0x85a6('0x26')][_0x85a6('0x28')]);return _0x1fc4b2(_0x2bd285[_0x85a6('0x26')][_0x85a6('0x28')]);}else{logger[_0x85a6('0x20')](_0x85a6('0x21'),_0x3945ea,_0x85a6('0x22'));_0x1fc4b2(_0x2bd285[_0x85a6('0x29')][_0x85a6('0x28')]);}})[_0x85a6('0x2a')](function(_0x295906){logger[_0x85a6('0x26')]('FaxAccount,\x20%s,\x20%s',_0x3945ea,_0x295906);_0x938911(_0x295906);});});}function respondWithStatusCode(_0x4697f8,_0x1a0870){_0x1a0870=_0x1a0870||0xcc;return function(_0x275c5e){if(_0x275c5e){return _0x4697f8[_0x85a6('0x2b')](_0x1a0870);}return _0x4697f8[_0x85a6('0x2c')](_0x1a0870)[_0x85a6('0x2d')]();};}function respondWithResult(_0x47aae0,_0xb97411){_0xb97411=_0xb97411||0xc8;return function(_0x10a7c8){if(_0x10a7c8){return _0x47aae0[_0x85a6('0x2c')](_0xb97411)[_0x85a6('0x2e')](_0x10a7c8);}};}function respondWithFilteredResult(_0x9ebf72,_0x9f1a78){return function(_0x4b4991){if(_0x4b4991){var _0x2a7004=_0x4b4991[_0x85a6('0x2f')],_0x5aa8a9=_0x9f1a78[_0x85a6('0x30')],_0x22c91a=_0x9f1a78[_0x85a6('0x30')]+_0x9f1a78[_0x85a6('0x31')],_0x5a7048;if(_0x22c91a>=_0x2a7004){_0x22c91a=_0x2a7004;_0x5a7048=0xc8;}else{_0x5a7048=0xce;}_0x9ebf72[_0x85a6('0x2c')](_0x5a7048);return _0x9ebf72['set'](_0x85a6('0x32'),_0x5aa8a9+'-'+_0x22c91a+'/'+_0x2a7004)['json'](_0x4b4991);}return null;};}function patchUpdates(_0x4fdef6){return function(_0x8216a9){try{jsonpatch['apply'](_0x8216a9,_0x4fdef6,!![]);}catch(_0x626f6f){return BPromise[_0x85a6('0x33')](_0x626f6f);}return _0x8216a9['save']();};}function saveUpdates(_0x360394,_0x16b48b){return function(_0x433a8e){if(_0x433a8e){return _0x433a8e[_0x85a6('0x34')](_0x360394)[_0x85a6('0x1f')](function(_0x5739d5){return _0x5739d5;});}return null;};}function removeEntity(_0x4489f2,_0x34c2f6){return function(_0x2c46aa){if(_0x2c46aa){return _0x2c46aa[_0x85a6('0x35')]()[_0x85a6('0x1f')](function(){var _0x3cc62f=_0x2c46aa[_0x85a6('0x36')]({'plain':!![]});var _0x367c03=_0x85a6('0x37');return db[_0x85a6('0x38')][_0x85a6('0x35')]({'where':{'type':_0x367c03,'resourceId':_0x3cc62f['id']}})[_0x85a6('0x1f')](function(){return _0x2c46aa;});})[_0x85a6('0x1f')](function(){_0x4489f2[_0x85a6('0x2c')](0xcc)[_0x85a6('0x2d')]();});}};}function handleEntityNotFound(_0xc68e4f,_0x179b32){return function(_0x35eb29){if(!_0x35eb29){_0xc68e4f[_0x85a6('0x2b')](0x194);}return _0x35eb29;};}function handleError(_0x2a1d47,_0xa1d3d0){_0xa1d3d0=_0xa1d3d0||0x1f4;return function(_0x2d7990){logger[_0x85a6('0x26')](_0x2d7990[_0x85a6('0x39')]);if(_0x2d7990['name']){delete _0x2d7990[_0x85a6('0x3a')];}_0x2a1d47[_0x85a6('0x2c')](_0xa1d3d0)[_0x85a6('0x3b')](_0x2d7990);};}exports[_0x85a6('0x3c')]=function(_0x218da5,_0x4dfa7a){var _0x6df572={'include':[{'model':db['Pause'],'as':_0x85a6('0x3d')}]},_0x5a8299={},_0x2d1b3e={'count':0x0,'rows':[]};var _0x33c340=db[_0x85a6('0x3e')][_0x85a6('0x3f')];_0x5a8299['model']=_[_0x85a6('0x40')](_0x33c340);_0x5a8299[_0x85a6('0x41')]=_[_0x85a6('0x40')](_0x218da5['query']);_0x5a8299[_0x85a6('0x42')]=_[_0x85a6('0x43')](_0x5a8299[_0x85a6('0x44')],_0x5a8299[_0x85a6('0x41')]);_0x6df572[_0x85a6('0x45')]=_['intersection'](_0x5a8299[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x218da5[_0x85a6('0x41')][_0x85a6('0x46')]));_0x6df572[_0x85a6('0x45')]=_0x6df572[_0x85a6('0x45')][_0x85a6('0x47')]?_0x6df572[_0x85a6('0x45')]:_0x5a8299[_0x85a6('0x44')];if(!_0x218da5[_0x85a6('0x41')][_0x85a6('0x48')]('nolimit')){_0x6df572['limit']=qs[_0x85a6('0x31')](_0x218da5[_0x85a6('0x41')]['limit']);_0x6df572[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x218da5['query'][_0x85a6('0x30')]);}_0x6df572[_0x85a6('0x49')]=qs[_0x85a6('0x4a')](_0x218da5[_0x85a6('0x41')][_0x85a6('0x4a')]);_0x6df572['where']=qs[_0x85a6('0x42')](_[_0x85a6('0x4b')](_0x218da5[_0x85a6('0x41')],_0x5a8299[_0x85a6('0x42')]));if(_0x218da5[_0x85a6('0x41')][_0x85a6('0x4c')]){_0x6df572[_0x85a6('0x4d')]=_['merge'](_0x6df572[_0x85a6('0x4d')],{'$or':_['map'](_0x33c340,function(_0x3f984c){if(_0x3f984c[_0x85a6('0x4e')][_0x85a6('0x4f')]!=='VIRTUAL'){var _0x34824b={};_0x34824b[_0x3f984c[_0x85a6('0x50')]]={'$like':'%'+_0x218da5[_0x85a6('0x41')][_0x85a6('0x4c')]+'%'};return _0x34824b;}})});}_0x6df572=_[_0x85a6('0x51')]({},_0x6df572,_0x218da5['options']);var _0x214e27={'where':_0x6df572[_0x85a6('0x4d')]};return db['FaxAccount'][_0x85a6('0x2f')](_0x214e27)['then'](function(_0x365264){_0x2d1b3e[_0x85a6('0x2f')]=_0x365264;if(_0x218da5[_0x85a6('0x41')][_0x85a6('0x52')]){_0x6df572['include']=[{'all':!![]}];}return db[_0x85a6('0x3e')][_0x85a6('0x53')](_0x6df572);})[_0x85a6('0x1f')](function(_0xedc7ee){_0x2d1b3e[_0x85a6('0x54')]=_0xedc7ee;return _0x2d1b3e;})[_0x85a6('0x1f')](respondWithFilteredResult(_0x4dfa7a,_0x6df572))[_0x85a6('0x2a')](handleError(_0x4dfa7a,null));};exports[_0x85a6('0x55')]=function(_0x57d229,_0x386dce){var _0x36c1a1={'raw':![],'where':{'id':_0x57d229[_0x85a6('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x85a6('0x3d')}]},_0x5ae8a9={};_0x5ae8a9[_0x85a6('0x44')]=_[_0x85a6('0x40')](db[_0x85a6('0x3e')][_0x85a6('0x3f')]);_0x5ae8a9['query']=_[_0x85a6('0x40')](_0x57d229[_0x85a6('0x41')]);_0x5ae8a9[_0x85a6('0x42')]=_[_0x85a6('0x43')](_0x5ae8a9[_0x85a6('0x44')],_0x5ae8a9[_0x85a6('0x41')]);_0x36c1a1[_0x85a6('0x45')]=_[_0x85a6('0x43')](_0x5ae8a9[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x57d229[_0x85a6('0x41')][_0x85a6('0x46')]));_0x36c1a1[_0x85a6('0x45')]=_0x36c1a1['attributes'][_0x85a6('0x47')]?_0x36c1a1[_0x85a6('0x45')]:_0x5ae8a9['model'];if(_0x57d229[_0x85a6('0x41')]['includeAll']){_0x36c1a1[_0x85a6('0x57')]=[{'all':!![]}];}_0x36c1a1=_['merge']({},_0x36c1a1,_0x57d229[_0x85a6('0x58')]);return db[_0x85a6('0x3e')][_0x85a6('0x59')](_0x36c1a1)[_0x85a6('0x1f')](handleEntityNotFound(_0x386dce,null))[_0x85a6('0x1f')](respondWithResult(_0x386dce,null))[_0x85a6('0x2a')](handleError(_0x386dce,null));};exports[_0x85a6('0x5a')]=function(_0x143a79,_0x54fc5b){return db['FaxAccount']['create'](_0x143a79[_0x85a6('0x5b')],{})[_0x85a6('0x1f')](function(_0x3bb25d){var _0x2f70fc=_0x143a79['user'][_0x85a6('0x36')]({'plain':!![]});if(!_0x2f70fc)throw new Error(_0x85a6('0x5c'));if(_0x2f70fc[_0x85a6('0x5d')]===_0x85a6('0x5e')){var _0x528718=_0x3bb25d[_0x85a6('0x36')]({'plain':!![]});var _0x2b0254='FaxAccounts';return db[_0x85a6('0x5f')][_0x85a6('0x59')]({'where':{'name':_0x2b0254,'userProfileId':_0x2f70fc[_0x85a6('0x60')]},'raw':!![]})[_0x85a6('0x1f')](function(_0x21d83e){if(_0x21d83e&&_0x21d83e[_0x85a6('0x61')]===0x0){return db[_0x85a6('0x38')][_0x85a6('0x5a')]({'name':_0x528718[_0x85a6('0x3a')],'resourceId':_0x528718['id'],'type':_0x21d83e[_0x85a6('0x3a')],'sectionId':_0x21d83e['id']},{})[_0x85a6('0x1f')](function(){return _0x3bb25d;});}else{return _0x3bb25d;}})[_0x85a6('0x2a')](function(_0x38e4c3){logger[_0x85a6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38e4c3);throw _0x38e4c3;});}return _0x3bb25d;})[_0x85a6('0x1f')](respondWithResult(_0x54fc5b,0xc9))['catch'](handleError(_0x54fc5b,null));};exports['update']=function(_0xb4702,_0x15e5a5){if(_0xb4702[_0x85a6('0x5b')]['id']){delete _0xb4702[_0x85a6('0x5b')]['id'];}return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0xb4702[_0x85a6('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x85a6('0x3d')}]})[_0x85a6('0x1f')](handleEntityNotFound(_0x15e5a5,null))[_0x85a6('0x1f')](saveUpdates(_0xb4702['body'],null))['then'](respondWithResult(_0x15e5a5,null))['catch'](handleError(_0x15e5a5,null));};exports[_0x85a6('0x35')]=function(_0x2fe27a,_0x32ff47){return db[_0x85a6('0x3e')]['find']({'where':{'id':_0x2fe27a[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x32ff47,null))[_0x85a6('0x1f')](removeEntity(_0x32ff47,null))['catch'](handleError(_0x32ff47,null));};exports[_0x85a6('0x62')]=function(_0x381dd2,_0x4cc8a6){return db[_0x85a6('0x3e')][_0x85a6('0x62')]()[_0x85a6('0x1f')](respondWithResult(_0x4cc8a6,null))[_0x85a6('0x2a')](handleError(_0x4cc8a6,null));};exports[_0x85a6('0x63')]=function(_0x405502,_0x470a01,_0x2d09e0){if(_0x405502['body']['id']){delete _0x405502[_0x85a6('0x5b')]['id'];}return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0x405502[_0x85a6('0x56')]['id']}})['then'](handleEntityNotFound(_0x470a01,null))[_0x85a6('0x1f')](function(_0x1f60ef){if(_0x1f60ef){_0x405502['body']['FaxAccountId']=_0x1f60ef['id'];return db[_0x85a6('0x64')]['create'](_0x405502[_0x85a6('0x5b')]);}})[_0x85a6('0x1f')](respondWithResult(_0x470a01,null))[_0x85a6('0x2a')](handleError(_0x470a01,null));};exports['getDispositions']=function(_0x49573c,_0x4382b2,_0x3cba1d){var _0x9974e2={'raw':![],'where':{}};var _0x4714df={};var _0x21b9e8={'count':0x0,'rows':[]};return db[_0x85a6('0x3e')][_0x85a6('0x65')]({'where':{'id':_0x49573c[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x4382b2,null))[_0x85a6('0x1f')](function(_0xa61871){if(_0xa61871){_0x4714df['model']=_['keys'](db[_0x85a6('0x64')][_0x85a6('0x3f')]);_0x4714df['query']=_[_0x85a6('0x40')](_0x49573c[_0x85a6('0x41')]);_0x4714df[_0x85a6('0x42')]=_[_0x85a6('0x43')](_0x4714df['model'],_0x4714df[_0x85a6('0x41')]);_0x9974e2[_0x85a6('0x45')]=_['intersection'](_0x4714df[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x49573c['query'][_0x85a6('0x46')]));_0x9974e2[_0x85a6('0x45')]=_0x9974e2[_0x85a6('0x45')][_0x85a6('0x47')]?_0x9974e2['attributes']:_0x4714df['model'];if(!_0x49573c[_0x85a6('0x41')][_0x85a6('0x48')](_0x85a6('0x66'))){_0x9974e2[_0x85a6('0x31')]=qs[_0x85a6('0x31')](_0x49573c['query'][_0x85a6('0x31')]);_0x9974e2[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x49573c['query'][_0x85a6('0x30')]);}_0x9974e2[_0x85a6('0x49')]=qs['sort'](_0x49573c[_0x85a6('0x41')][_0x85a6('0x4a')]);_0x9974e2[_0x85a6('0x4d')]=qs[_0x85a6('0x42')](_[_0x85a6('0x4b')](_0x49573c[_0x85a6('0x41')],_0x4714df[_0x85a6('0x42')]));_0x9974e2[_0x85a6('0x4d')][_0x85a6('0x67')]=_0xa61871['id'];if(_0x49573c[_0x85a6('0x41')][_0x85a6('0x4c')]){_0x9974e2[_0x85a6('0x4d')]=_[_0x85a6('0x51')](_0x9974e2[_0x85a6('0x4d')],{'$or':_['map'](_0x9974e2[_0x85a6('0x45')],function(_0x34ab4d){var _0x313300={};_0x313300[_0x34ab4d]={'$like':'%'+_0x49573c['query'][_0x85a6('0x4c')]+'%'};return _0x313300;})});}_0x9974e2=_[_0x85a6('0x51')]({},_0x9974e2,_0x49573c[_0x85a6('0x58')]);return db[_0x85a6('0x64')][_0x85a6('0x2f')]({'where':_0x9974e2[_0x85a6('0x4d')]})[_0x85a6('0x1f')](function(_0x40aa64){_0x21b9e8[_0x85a6('0x2f')]=_0x40aa64;if(_0x49573c['query'][_0x85a6('0x52')]){_0x9974e2[_0x85a6('0x57')]=[{'all':!![]}];}return db[_0x85a6('0x64')]['findAll'](_0x9974e2);})[_0x85a6('0x1f')](function(_0x4b894b){_0x21b9e8[_0x85a6('0x54')]=_0x4b894b;return _0x21b9e8;});}})['then'](respondWithFilteredResult(_0x4382b2,_0x9974e2))[_0x85a6('0x2a')](handleError(_0x4382b2,null));};exports[_0x85a6('0x68')]=function(_0x5de312,_0x12518c,_0x25b6a8){return db[_0x85a6('0x3e')]['find']({'where':{'id':_0x5de312['params']['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x12518c,null))[_0x85a6('0x1f')](function(_0x5637d0){if(_0x5637d0){return _0x5637d0['removeDispositions'](_0x5de312[_0x85a6('0x41')][_0x85a6('0x69')]);}})[_0x85a6('0x1f')](respondWithStatusCode(_0x12518c,null))[_0x85a6('0x2a')](handleError(_0x12518c,null));};exports[_0x85a6('0x6a')]=function(_0x532849,_0x5a36ee,_0x44f53f){if(_0x532849[_0x85a6('0x5b')]['id']){delete _0x532849[_0x85a6('0x5b')]['id'];}return db['FaxAccount'][_0x85a6('0x59')]({'where':{'id':_0x532849[_0x85a6('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a36ee,null))[_0x85a6('0x1f')](function(_0x13cfcf){if(_0x13cfcf){_0x532849[_0x85a6('0x5b')][_0x85a6('0x67')]=_0x13cfcf['id'];return db[_0x85a6('0x6b')][_0x85a6('0x5a')](_0x532849[_0x85a6('0x5b')]);}})['then'](respondWithResult(_0x5a36ee,null))[_0x85a6('0x2a')](handleError(_0x5a36ee,null));};exports[_0x85a6('0x6c')]=function(_0x1687cb,_0x39cc2a,_0x482de5){var _0x6461cd={'raw':![],'where':{}};var _0x44900b={};var _0xfaa442={'count':0x0,'rows':[]};return db[_0x85a6('0x3e')]['findOne']({'where':{'id':_0x1687cb['params']['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x39cc2a,null))[_0x85a6('0x1f')](function(_0x11d16e){if(_0x11d16e){_0x44900b[_0x85a6('0x44')]=_[_0x85a6('0x40')](db['CannedAnswer'][_0x85a6('0x3f')]);_0x44900b[_0x85a6('0x41')]=_[_0x85a6('0x40')](_0x1687cb['query']);_0x44900b[_0x85a6('0x42')]=_[_0x85a6('0x43')](_0x44900b[_0x85a6('0x44')],_0x44900b[_0x85a6('0x41')]);_0x6461cd[_0x85a6('0x45')]=_[_0x85a6('0x43')](_0x44900b[_0x85a6('0x44')],qs['fields'](_0x1687cb[_0x85a6('0x41')]['fields']));_0x6461cd[_0x85a6('0x45')]=_0x6461cd['attributes'][_0x85a6('0x47')]?_0x6461cd['attributes']:_0x44900b['model'];if(!_0x1687cb[_0x85a6('0x41')][_0x85a6('0x48')](_0x85a6('0x66'))){_0x6461cd[_0x85a6('0x31')]=qs[_0x85a6('0x31')](_0x1687cb[_0x85a6('0x41')]['limit']);_0x6461cd[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x1687cb[_0x85a6('0x41')][_0x85a6('0x30')]);}_0x6461cd['order']=qs[_0x85a6('0x4a')](_0x1687cb['query'][_0x85a6('0x4a')]);_0x6461cd[_0x85a6('0x4d')]=qs['filters'](_['pick'](_0x1687cb[_0x85a6('0x41')],_0x44900b[_0x85a6('0x42')]));_0x6461cd[_0x85a6('0x4d')][_0x85a6('0x67')]=_0x11d16e['id'];if(_0x1687cb[_0x85a6('0x41')][_0x85a6('0x4c')]){_0x6461cd[_0x85a6('0x4d')]=_[_0x85a6('0x51')](_0x6461cd['where'],{'$or':_['map'](_0x6461cd[_0x85a6('0x45')],function(_0x57067f){var _0x5d69ae={};_0x5d69ae[_0x57067f]={'$like':'%'+_0x1687cb['query'][_0x85a6('0x4c')]+'%'};return _0x5d69ae;})});}_0x6461cd=_['merge']({},_0x6461cd,_0x1687cb[_0x85a6('0x58')]);return db[_0x85a6('0x6b')][_0x85a6('0x2f')]({'where':_0x6461cd['where']})[_0x85a6('0x1f')](function(_0x5266da){_0xfaa442[_0x85a6('0x2f')]=_0x5266da;if(_0x1687cb['query'][_0x85a6('0x52')]){_0x6461cd[_0x85a6('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x85a6('0x53')](_0x6461cd);})[_0x85a6('0x1f')](function(_0x3664fb){_0xfaa442[_0x85a6('0x54')]=_0x3664fb;return _0xfaa442;});}})[_0x85a6('0x1f')](respondWithFilteredResult(_0x39cc2a,_0x6461cd))[_0x85a6('0x2a')](handleError(_0x39cc2a,null));};exports[_0x85a6('0x6d')]=function(_0x2e403b,_0x34cfbe,_0x121258){return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0x2e403b[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x34cfbe,null))[_0x85a6('0x1f')](function(_0xa914ef){if(_0xa914ef){return _0xa914ef[_0x85a6('0x6d')](_0x2e403b[_0x85a6('0x41')]['ids']);}})[_0x85a6('0x1f')](respondWithStatusCode(_0x34cfbe,null))[_0x85a6('0x2a')](handleError(_0x34cfbe,null));};exports[_0x85a6('0x6e')]=function(_0x53655a,_0x35f4f4,_0x5ed190){return db[_0x85a6('0x6f')][_0x85a6('0x59')]({'where':{'id':_0x53655a['params']['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x35f4f4,null))[_0x85a6('0x1f')](function(_0x38d377){if(_0x38d377){return _0x38d377[_0x85a6('0x6e')](_0x53655a['body']['ids'],_[_0x85a6('0x70')](_0x53655a[_0x85a6('0x5b')],[_0x85a6('0x69'),'id'])||{});}})[_0x85a6('0x1f')](respondWithResult(_0x35f4f4,null))['catch'](handleError(_0x35f4f4,null));};exports[_0x85a6('0x71')]=function(_0x562162,_0x6a9007,_0xea7f7c){var _0x41df54={'raw':![],'where':{}};var _0x313d67={};var _0x311082={'count':0x0,'rows':[]};return db[_0x85a6('0x3e')][_0x85a6('0x65')]({'where':{'id':_0x562162['params']['id']}})['then'](handleEntityNotFound(_0x6a9007,null))[_0x85a6('0x1f')](function(_0x243cce){if(_0x243cce){_0x313d67[_0x85a6('0x44')]=_[_0x85a6('0x40')](db[_0x85a6('0x6f')]['rawAttributes']);_0x313d67[_0x85a6('0x41')]=_[_0x85a6('0x40')](_0x562162['query']);_0x313d67['filters']=_[_0x85a6('0x43')](_0x313d67[_0x85a6('0x44')],_0x313d67[_0x85a6('0x41')]);_0x41df54[_0x85a6('0x45')]=_[_0x85a6('0x43')](_0x313d67[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x562162[_0x85a6('0x41')][_0x85a6('0x46')]));_0x41df54[_0x85a6('0x45')]=_0x41df54['attributes'][_0x85a6('0x47')]?_0x41df54[_0x85a6('0x45')]:_0x313d67[_0x85a6('0x44')];if(!_0x562162[_0x85a6('0x41')][_0x85a6('0x48')](_0x85a6('0x66'))){_0x41df54[_0x85a6('0x31')]=qs['limit'](_0x562162[_0x85a6('0x41')]['limit']);_0x41df54[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x562162['query'][_0x85a6('0x30')]);}_0x41df54[_0x85a6('0x49')]=qs[_0x85a6('0x4a')](_0x562162[_0x85a6('0x41')][_0x85a6('0x4a')]);_0x41df54[_0x85a6('0x4d')]=qs['filters'](_['pick'](_0x562162[_0x85a6('0x41')],_0x313d67[_0x85a6('0x42')]));_0x41df54[_0x85a6('0x4d')]['FaxAccountId']=_0x243cce['id'];if(_0x562162[_0x85a6('0x41')][_0x85a6('0x4c')]){_0x41df54[_0x85a6('0x4d')]=_[_0x85a6('0x51')](_0x41df54[_0x85a6('0x4d')],{'$or':_[_0x85a6('0x72')](_0x41df54['attributes'],function(_0x54aefb){var _0x5094c4={};_0x5094c4[_0x54aefb]={'$like':'%'+_0x562162[_0x85a6('0x41')]['filter']+'%'};return _0x5094c4;})});}_0x41df54=_['merge']({},_0x41df54,_0x562162[_0x85a6('0x58')]);return db[_0x85a6('0x6f')][_0x85a6('0x2f')]({'where':_0x41df54[_0x85a6('0x4d')]})['then'](function(_0x5548b0){_0x311082[_0x85a6('0x2f')]=_0x5548b0;if(_0x562162[_0x85a6('0x41')][_0x85a6('0x52')]){_0x41df54['include']=[{'model':db['CmContact'],'as':_0x85a6('0x73'),'required':![]},{'model':db[_0x85a6('0x74')],'as':_0x85a6('0x75'),'attributes':[_0x85a6('0x3a'),_0x85a6('0x76'),_0x85a6('0x77')],'required':![]},{'model':db[_0x85a6('0x78')],'as':_0x85a6('0x79'),'attributes':['id',_0x85a6('0x3a'),_0x85a6('0x7a')],'where':_0x562162[_0x85a6('0x41')][_0x85a6('0x7b')]?{'id':_0x562162['query'][_0x85a6('0x7b')]}:undefined,'required':_0x562162['query'][_0x85a6('0x7b')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x41df54);})['then'](function(_0x53d8ff){_0x311082[_0x85a6('0x54')]=_0x53d8ff;return _0x311082;});}})[_0x85a6('0x1f')](respondWithFilteredResult(_0x6a9007,_0x41df54))[_0x85a6('0x2a')](handleError(_0x6a9007,null));};exports['addApplications']=function(_0x52983c,_0x2607be,_0x3c2800){return db['FaxAccount'][_0x85a6('0x65')]({'where':{'id':_0x52983c[_0x85a6('0x56')]['id']}})['then'](handleEntityNotFound(_0x2607be,null))[_0x85a6('0x1f')](function(_0x477ba8){if(_0x477ba8){return db[_0x85a6('0x7c')][_0x85a6('0x7d')](function(_0x4fdf33){return db[_0x85a6('0x7e')][_0x85a6('0x35')]({'where':{'FaxAccountId':_0x52983c[_0x85a6('0x56')]['id']},'transaction':_0x4fdf33})['then'](function(_0x382ef4){var _0x387f08=_[_0x85a6('0x72')](_0x52983c[_0x85a6('0x5b')],function(_0x4133f7){_0x4133f7[_0x85a6('0x67')]=_0x52983c[_0x85a6('0x56')]['id'];return _0x4133f7;});return db[_0x85a6('0x7e')]['bulkCreate'](_0x387f08,{'transaction':_0x4fdf33});});})[_0x85a6('0x1f')](function(){return db[_0x85a6('0x7e')][_0x85a6('0x7f')]({'where':{'FaxAccountId':_0x52983c['params']['id']},'order':_0x85a6('0x80')});});}})['then'](respondWithResult(_0x2607be,null))[_0x85a6('0x2a')](handleError(_0x2607be,null));};exports[_0x85a6('0x81')]=function(_0x174294,_0xff92c7,_0x45ccaa){var _0x469bed={};var _0xcf40b6={};var _0x558598;var _0x105186;return db[_0x85a6('0x3e')][_0x85a6('0x65')]({'where':{'id':_0x174294['params']['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0xff92c7,null))[_0x85a6('0x1f')](function(_0x323f01){if(_0x323f01){_0x558598=_0x323f01;_0xcf40b6[_0x85a6('0x44')]=_['keys'](db[_0x85a6('0x7e')]['rawAttributes']);_0xcf40b6[_0x85a6('0x41')]=_[_0x85a6('0x40')](_0x174294[_0x85a6('0x41')]);_0xcf40b6[_0x85a6('0x42')]=_[_0x85a6('0x43')](_0xcf40b6[_0x85a6('0x44')],_0xcf40b6[_0x85a6('0x41')]);_0x469bed[_0x85a6('0x45')]=_[_0x85a6('0x43')](_0xcf40b6[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x174294[_0x85a6('0x41')][_0x85a6('0x46')]));_0x469bed[_0x85a6('0x45')]=_0x469bed[_0x85a6('0x45')][_0x85a6('0x47')]?_0x469bed[_0x85a6('0x45')]:_0xcf40b6[_0x85a6('0x44')];_0x469bed[_0x85a6('0x49')]=qs[_0x85a6('0x4a')](_0x174294[_0x85a6('0x41')]['sort']);_0x469bed[_0x85a6('0x4d')]=qs['filters'](_[_0x85a6('0x4b')](_0x174294[_0x85a6('0x41')],_0xcf40b6['filters']));if(_0x174294[_0x85a6('0x41')]['filter']){_0x469bed[_0x85a6('0x4d')]=_[_0x85a6('0x51')](_0x469bed[_0x85a6('0x4d')],{'$or':_['map'](_0x469bed[_0x85a6('0x45')],function(_0x2cba69){var _0x2933d3={};_0x2933d3[_0x2cba69]={'$like':'%'+_0x174294[_0x85a6('0x41')][_0x85a6('0x4c')]+'%'};return _0x2933d3;})});}_0x469bed=_[_0x85a6('0x51')]({},_0x469bed,_0x174294[_0x85a6('0x58')]);return _0x558598[_0x85a6('0x81')](_0x469bed);}})[_0x85a6('0x1f')](function(_0x12b0a6){if(_0x12b0a6){_0x105186=_0x12b0a6['length'];if(!_0x174294[_0x85a6('0x41')][_0x85a6('0x48')](_0x85a6('0x66'))){_0x469bed['limit']=qs[_0x85a6('0x31')](_0x174294[_0x85a6('0x41')][_0x85a6('0x31')]);_0x469bed[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x174294[_0x85a6('0x41')][_0x85a6('0x30')]);}return _0x558598['getApplications'](_0x469bed);}})[_0x85a6('0x1f')](function(_0x2b6b85){if(_0x2b6b85){return _0x2b6b85?{'count':_0x105186,'rows':_0x2b6b85}:null;}})[_0x85a6('0x1f')](respondWithResult(_0xff92c7,null))['catch'](handleError(_0xff92c7,null));};function Extension(_0x84d1c2,_0x1614bf,_0x784034,_0xcd7d20){this[_0x85a6('0x82')]='from-voip-provider';this[_0x85a6('0x83')]=_0x84d1c2[_0x85a6('0x84')];this['app']=_0xcd7d20;this['type']=_0x85a6('0x85');this['description']=_0x85a6('0x86');this['FaxAccountId']=_0x84d1c2['id'];this[_0x85a6('0x80')]=_0x1614bf;this[_0x85a6('0x87')]=_0x784034;}function createExtensionsReciveFax(_0x41700f){var _0x3dfc44=0x1;var _0x581395=[];_0x581395[_0x85a6('0x88')](new Extension(_0x41700f,_0x3dfc44,'',_0x85a6('0x89')));_0x3dfc44+=0x1;_0x581395['push'](new Extension(_0x41700f,_0x3dfc44,_0x85a6('0x8a'),_0x85a6('0x8b')));_0x3dfc44+=0x1;for(var _0x4bede6 in _0x41700f){if(_0x41700f[_0x85a6('0x48')](_0x4bede6)&&(_0x4bede6===_0x85a6('0x8c')||_0x4bede6===_0x85a6('0x84')||_0x4bede6===_0x85a6('0x8d')||_0x4bede6==='faxdetect'||_0x4bede6===_0x85a6('0x8e')||_0x4bede6===_0x85a6('0x8f')||_0x4bede6===_0x85a6('0x90')||_0x4bede6===_0x85a6('0x91')||_0x4bede6===_0x85a6('0x92'))){_0x581395[_0x85a6('0x88')](new Extension(_0x41700f,_0x3dfc44,_0x85a6('0x93')+_0x4bede6+')='+_0x41700f[_0x4bede6],_0x85a6('0x8b')));_0x3dfc44+=0x1;}}_0x581395[_0x85a6('0x88')](new Extension(_0x41700f,_0x3dfc44,'6',_0x85a6('0x94')));_0x3dfc44+=0x1;_0x581395[_0x85a6('0x88')](new Extension(_0x41700f,_0x3dfc44,_0x85a6('0x95'),'ReceiveFax'));_0x3dfc44=0x0;return _0x581395;}exports[_0x85a6('0x96')]=function(_0x2452ab,_0x27d8cb,_0x3c3f97){var _0x3661e6;return db[_0x85a6('0x7c')][_0x85a6('0x7d')](function(_0x36a432){return db[_0x85a6('0x3e')][_0x85a6('0x5a')](_0x2452ab[_0x85a6('0x5b')],{'transaction':_0x36a432})['then'](function(_0x269e91){_0x3661e6=_0x269e91[_0x85a6('0x36')]({'plain':!![]});return db[_0x85a6('0x97')][_0x85a6('0x98')](createExtensionsReciveFax(_0x3661e6),{'transaction':_0x36a432});});})[_0x85a6('0x1f')](function(){return _0x3661e6;})[_0x85a6('0x1f')](respondWithResult(_0x27d8cb,null))['catch'](handleError(_0x27d8cb,null));};exports['updateAccountApplications']=function(_0x129eb8,_0x40870c,_0x483308){var _0x3bcc80;return db[_0x85a6('0x7c')]['transaction'](function(_0x4e1166){return db[_0x85a6('0x3e')]['update'](_0x129eb8['body'],{'where':{'id':_0x129eb8['body']['id']},'transaction':_0x4e1166})[_0x85a6('0x1f')](function(_0x2c3b02){return db[_0x85a6('0x97')]['destroy']({'where':{'FaxAccountId':_0x129eb8['body']['id']},'transaction':_0x4e1166})[_0x85a6('0x1f')](function(_0x2fe76b){return db[_0x85a6('0x97')][_0x85a6('0x98')](createExtensionsReciveFax(_[_0x85a6('0x70')](_0x129eb8[_0x85a6('0x5b')],[_0x85a6('0x99'),_0x85a6('0x4f'),_0x85a6('0x9a'),'updatedAt','TrunkId',_0x85a6('0x9b')])),{'transaction':_0x4e1166});});});})['then'](function(){return db[_0x85a6('0x3e')][_0x85a6('0x9c')](_0x129eb8[_0x85a6('0x5b')]['id']);})['then'](respondWithResult(_0x40870c,null))['catch'](handleError(_0x40870c,null));};exports['getMessages']=function(_0xa6133f,_0x1bb62d,_0x37b132){var _0x26594a={'raw':!![],'where':{}};var _0x201401={};var _0x2b4f70={'count':0x0,'rows':[]};return db[_0x85a6('0x3e')]['findOne']({'where':{'id':_0xa6133f['params']['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x1bb62d,null))[_0x85a6('0x1f')](function(_0x4b0b68){if(_0x4b0b68){_0x201401[_0x85a6('0x44')]=_[_0x85a6('0x40')](db[_0x85a6('0x9d')]['rawAttributes']);_0x201401[_0x85a6('0x41')]=_[_0x85a6('0x40')](_0xa6133f[_0x85a6('0x41')]);_0x201401[_0x85a6('0x42')]=_['intersection'](_0x201401[_0x85a6('0x44')],_0x201401[_0x85a6('0x41')]);_0x26594a[_0x85a6('0x45')]=_[_0x85a6('0x43')](_0x201401[_0x85a6('0x44')],qs['fields'](_0xa6133f[_0x85a6('0x41')][_0x85a6('0x46')]));_0x26594a[_0x85a6('0x45')]=_0x26594a['attributes'][_0x85a6('0x47')]?_0x26594a['attributes']:_0x201401[_0x85a6('0x44')];if(!_0xa6133f['query'][_0x85a6('0x48')](_0x85a6('0x66'))){_0x26594a[_0x85a6('0x31')]=qs['limit'](_0xa6133f['query'][_0x85a6('0x31')]);_0x26594a[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0xa6133f[_0x85a6('0x41')][_0x85a6('0x30')]);}_0x26594a[_0x85a6('0x49')]=qs[_0x85a6('0x4a')](_0xa6133f[_0x85a6('0x41')]['sort']);_0x26594a['where']=qs[_0x85a6('0x42')](_[_0x85a6('0x4b')](_0xa6133f[_0x85a6('0x41')],_0x201401[_0x85a6('0x42')]));_0x26594a['where'][_0x85a6('0x67')]=_0x4b0b68['id'];if(_0xa6133f[_0x85a6('0x41')]['filter']){_0x26594a['where']=_[_0x85a6('0x51')](_0x26594a[_0x85a6('0x4d')],{'$or':_[_0x85a6('0x72')](_0x26594a[_0x85a6('0x45')],function(_0x26041d){var _0x5a40c7={};_0x5a40c7[_0x26041d]={'$like':'%'+_0xa6133f[_0x85a6('0x41')][_0x85a6('0x4c')]+'%'};return _0x5a40c7;})});}if(_0xa6133f[_0x85a6('0x41')][_0x85a6('0x9e')]){var _0x70d380=_0xa6133f[_0x85a6('0x41')][_0x85a6('0x9e')][_0x85a6('0x9f')](',');var _0x28e00a={};_0x28e00a[_0x70d380[0x0]]={'$gte':moment(_0x70d380[0x1])[_0x85a6('0xa0')](_0x85a6('0xa1'))};_0x26594a[_0x85a6('0x4d')]=_[_0x85a6('0x51')](_0x26594a['where'],_0x28e00a);}_0x26594a=_[_0x85a6('0x51')]({},_0x26594a,_0xa6133f[_0x85a6('0x58')]);return db[_0x85a6('0x9d')][_0x85a6('0x2f')]({'where':_0x26594a['where']})['then'](function(_0x556c42){_0x2b4f70[_0x85a6('0x2f')]=_0x556c42;if(_0xa6133f[_0x85a6('0x41')][_0x85a6('0x52')]){_0x26594a[_0x85a6('0x57')]=[{'all':!![]}];}return db[_0x85a6('0x9d')][_0x85a6('0x53')](_0x26594a);})[_0x85a6('0x1f')](function(_0x16f4c9){_0x2b4f70[_0x85a6('0x54')]=_0x16f4c9;return _0x2b4f70;});}})[_0x85a6('0x1f')](respondWithFilteredResult(_0x1bb62d,_0x26594a))['catch'](handleError(_0x1bb62d,null));};exports[_0x85a6('0x3b')]=function(_0x890215,_0x5ad41d,_0x510d34){var _0x4a930f,_0x1dd87e={},_0x50d365;if(_0x890215['body']['to']){_0x50d365=_0x890215[_0x85a6('0x5b')]['to'][0x0];}return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0x890215['params']['id']},'include':[{'model':db[_0x85a6('0xa2')],'as':_0x85a6('0xa3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x50d365},'limit':0x1,'order':[['updatedAt',_0x85a6('0xa4')]]}]}]})[_0x85a6('0x1f')](handleEntityNotFound(_0x5ad41d,null))[_0x85a6('0x1f')](function(_0x58c1fb){_0x4a930f=_0x58c1fb;if(_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')]&&_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][_0x85a6('0x47')]){for(var _0x4cb963=0x0;_0x4cb963<_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][_0x85a6('0x47')];_0x4cb963+=0x1){_0x890215['body'][_0x85a6('0xa5')][_0x4cb963]={'filename':_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][_0x4cb963][_0x85a6('0x3a')],'id':_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][_0x4cb963]['id'],'path':path['join'](config[_0x85a6('0xa6')],_0x85a6('0xa7'),_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][_0x4cb963][_0x85a6('0xa8')])};}}return respondWithRpcPromise(_0x85a6('0xa9'),_0x85a6('0xa9'),{'FaxAccountId':_[_0x85a6('0xaa')](_0x890215[_0x85a6('0x56')]['id'])?undefined:_0x890215['params']['id'],'path':_[_0x85a6('0xaa')](_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0][_0x85a6('0x8')])?undefined:_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0]['path'],'fax':_['isNil'](_0x890215[_0x85a6('0x5b')]['to'][0x0])?undefined:_0x890215[_0x85a6('0x5b')]['to'][0x0]},client9002);})[_0x85a6('0x1f')](function(){if(_0x4a930f){if(_[_0x85a6('0xaa')](_0x890215['body'][_0x85a6('0xab')])){_0x890215[_0x85a6('0x5b')][_0x85a6('0xab')]=util[_0x85a6('0xa0')](_0x85a6('0xac'),_0x4a930f[_0x85a6('0x3a')],_0x4a930f[_0x85a6('0xad')]);}if(_0x4a930f[_0x85a6('0xa3')]){if(_0x4a930f['List']['Contacts']['length']){return _0x4a930f[_0x85a6('0xa3')]['Contacts'][0x0];}else{return db['CmContact'][_0x85a6('0x5a')](_[_0x85a6('0xae')](_0x890215['body'],{'firstName':_0x890215['body']['to'][0x0],'phone':_0x890215[_0x85a6('0x5b')]['to'][0x0],'fax':_0x890215[_0x85a6('0x5b')]['to'][0x0],'ListId':_0x4a930f['ListId']}));}}else{throw new Error(_0x85a6('0xaf'));}}else{throw new Error(_0x85a6('0xb0'));}})[_0x85a6('0x1f')](function(_0x15ceff){if(_0x15ceff){return db[_0x85a6('0x6f')]['find']({'where':{'ContactId':_0x15ceff['id'],'closed':![],'FaxAccountId':_0x4a930f['id']}})[_0x85a6('0x1f')](function(_0x4a0c9e){if(_0x4a0c9e){return[_0x4a0c9e,![]];}return db[_0x85a6('0x6f')][_0x85a6('0x5a')]({'UserId':_0x890215[_0x85a6('0x5e')]['id'],'ContactId':_0x15ceff['id'],'FaxAccountId':_0x4a930f['id'],'fax':_0x890215[_0x85a6('0x5b')]['to'][0x0],'firstMsgDirection':_0x85a6('0xb1'),'Messages':[_[_0x85a6('0x51')](_0x890215[_0x85a6('0x5b')],{'read':![],'body':_0x890215[_0x85a6('0x5b')]['attachments'][0x0][_0x85a6('0xb2')],'FaxAccountId':_0x4a930f['id'],'UserId':_0x890215[_0x85a6('0x5e')]['id'],'ContactId':_0x15ceff['id'],'AttachmentId':_0x890215['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x85a6('0x9d')],'as':_0x85a6('0xb3')}]})[_0x85a6('0x1f')](function(_0x36c6f6){return[_0x36c6f6,!![]];});});}else{throw new Error(_0x85a6('0xb4'));}})[_0x85a6('0xb5')](function(_0x36f51a,_0x3d6f9b){if(_0x3d6f9b){return _0x36f51a;}return db['FaxMessage'][_0x85a6('0x5a')]({'direction':_0x85a6('0xb1'),'read':![],'body':_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0][_0x85a6('0xb2')],'FaxAccountId':_0x4a930f['id'],'FaxInteractionId':_0x36f51a['id'],'UserId':_0x890215[_0x85a6('0x5e')]['id'],'ContactId':_0x36f51a[_0x85a6('0xb6')],'AttachmentId':_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0]['id']})[_0x85a6('0x1f')](function(_0xcd6235){_0x36f51a[_0x85a6('0xb7')][_0x85a6('0xb3')]=[];_0x36f51a['dataValues'][_0x85a6('0xb3')][_0x85a6('0x88')](_0xcd6235[_0x85a6('0xb7')]);return _0x36f51a;});})['then'](function(_0x167b3e){respondWithRpcPromise(_0x85a6('0xb8'),'SendFax',{'FaxAccountId':_['isNil'](_0x890215[_0x85a6('0x56')]['id'])?undefined:_0x890215[_0x85a6('0x56')]['id'],'path':_['isNil'](_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0]['path'])?undefined:_0x890215[_0x85a6('0x5b')][_0x85a6('0xa5')][0x0][_0x85a6('0x8')],'fax':_['isNil'](_0x890215['body']['to'][0x0])?undefined:_0x890215[_0x85a6('0x5b')]['to'][0x0],'AttachmentId':_0x890215['body'][_0x85a6('0xa5')][0x0]['id']},client9002)[_0x85a6('0x1f')](function(_0xb9eba7){logger['info']('SendFaxRpc,\x20%s',_0xb9eba7);})[_0x85a6('0x2a')](function(_0x2d3790){logger['info'](_0x85a6('0xb9'),_0x2d3790);});return _0x167b3e;})[_0x85a6('0x1f')](respondWithResult(_0x5ad41d,null))['catch'](handleError(_0x5ad41d,null));};exports[_0x85a6('0xba')]=function(_0xf71177,_0x384c78,_0x55be13){return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0xf71177[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x384c78,null))['then'](function(_0xf4a60b){if(_0xf4a60b){return _0xf4a60b['addAgents'](_0xf71177[_0x85a6('0x5b')][_0x85a6('0x69')],_[_0x85a6('0x70')](_0xf71177['body'],[_0x85a6('0x69'),'id'])||{})[_0x85a6('0xb5')](function(_0x5971d5){for(var _0x4675f3=0x0;_0x4675f3<_0xf71177['body'][_0x85a6('0x69')][_0x85a6('0x47')];_0x4675f3+=0x1){socket[_0x85a6('0xbb')](_0x85a6('0xbc'),{'UserId':_0xf71177[_0x85a6('0x5b')]['ids'][_0x4675f3],'FaxAccountId':_0xf71177[_0x85a6('0x56')]['id']});}return _0x5971d5;});}})['then'](respondWithResult(_0x384c78,null))[_0x85a6('0x2a')](handleError(_0x384c78,null));};exports[_0x85a6('0xbd')]=function(_0x3067c3,_0x40a36d,_0x5b4fa4){return db[_0x85a6('0x3e')][_0x85a6('0x59')]({'where':{'id':_0x3067c3[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x40a36d,null))[_0x85a6('0x1f')](function(_0x119cef){if(_0x119cef){return _0x119cef[_0x85a6('0xbd')](_0x3067c3[_0x85a6('0x41')]['ids'])['then'](function(){if(_[_0x85a6('0xbe')](_0x3067c3[_0x85a6('0x41')][_0x85a6('0x69')])){for(var _0x260e49=0x0;_0x260e49<_0x3067c3['query'][_0x85a6('0x69')][_0x85a6('0x47')];_0x260e49+=0x1){socket[_0x85a6('0xbb')](_0x85a6('0xbf'),{'UserId':Number(_0x3067c3['query'][_0x85a6('0x69')][_0x260e49]),'FaxAccountId':Number(_0x3067c3[_0x85a6('0x56')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3067c3[_0x85a6('0x41')]['ids']),'FaxAccountId':Number(_0x3067c3[_0x85a6('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x40a36d,null))[_0x85a6('0x2a')](handleError(_0x40a36d,null));};exports[_0x85a6('0xc0')]=function(_0x10aa6d,_0x2e9aff,_0x4e9d80){var _0x415f5c={};var _0x252cf8={};var _0x414da8;var _0x155eae;return db[_0x85a6('0x3e')][_0x85a6('0x65')]({'where':{'id':_0x10aa6d[_0x85a6('0x56')]['id']}})[_0x85a6('0x1f')](handleEntityNotFound(_0x2e9aff,null))[_0x85a6('0x1f')](function(_0x53e18d){if(_0x53e18d){_0x414da8=_0x53e18d;_0x252cf8[_0x85a6('0x44')]=_[_0x85a6('0x40')](db[_0x85a6('0x74')]['rawAttributes']);_0x252cf8[_0x85a6('0x41')]=_['keys'](_0x10aa6d[_0x85a6('0x41')]);_0x252cf8['filters']=_[_0x85a6('0x43')](_0x252cf8[_0x85a6('0x44')],_0x252cf8['query']);_0x415f5c[_0x85a6('0x45')]=_['intersection'](_0x252cf8[_0x85a6('0x44')],qs[_0x85a6('0x46')](_0x10aa6d['query']['fields']));_0x415f5c[_0x85a6('0x45')]=_0x415f5c['attributes'][_0x85a6('0x47')]?_0x415f5c['attributes']:_0x252cf8[_0x85a6('0x44')];_0x415f5c['order']=qs['sort'](_0x10aa6d['query'][_0x85a6('0x4a')]);_0x415f5c[_0x85a6('0x4d')]=qs[_0x85a6('0x42')](_[_0x85a6('0x4b')](_0x10aa6d[_0x85a6('0x41')],_0x252cf8[_0x85a6('0x42')]));if(_0x10aa6d['query'][_0x85a6('0x4c')]){_0x415f5c[_0x85a6('0x4d')]=_['merge'](_0x415f5c[_0x85a6('0x4d')],{'$or':_[_0x85a6('0x72')](_0x415f5c[_0x85a6('0x45')],function(_0x40b991){var _0x366274={};_0x366274[_0x40b991]={'$like':'%'+_0x10aa6d[_0x85a6('0x41')][_0x85a6('0x4c')]+'%'};return _0x366274;})});}_0x415f5c=_[_0x85a6('0x51')]({},_0x415f5c,_0x10aa6d[_0x85a6('0x58')]);return _0x414da8[_0x85a6('0xc0')](_0x415f5c);}})[_0x85a6('0x1f')](function(_0x2df589){if(_0x2df589){_0x155eae=_0x2df589[_0x85a6('0x47')];if(!_0x10aa6d[_0x85a6('0x41')]['hasOwnProperty'](_0x85a6('0x66'))){_0x415f5c['limit']=qs[_0x85a6('0x31')](_0x10aa6d[_0x85a6('0x41')][_0x85a6('0x31')]);_0x415f5c[_0x85a6('0x30')]=qs[_0x85a6('0x30')](_0x10aa6d[_0x85a6('0x41')][_0x85a6('0x30')]);}return _0x414da8['getAgents'](_0x415f5c);}})[_0x85a6('0x1f')](function(_0x4bee40){if(_0x4bee40){return _0x4bee40?{'count':_0x155eae,'rows':_0x4bee40}:null;}})[_0x85a6('0x1f')](respondWithResult(_0x2e9aff,null))[_0x85a6('0x2a')](handleError(_0x2e9aff,null));}; \ No newline at end of file +var _0x4549=['set','Content-Range','apply','reject','save','update','then','destroy','FaxAccounts','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','FaxAccount','count','includeAll','include','show','params','intersection','length','find','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','findAll','rows','removeDispositions','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','FaxInteraction','addInteraction','ids','omit','getInteractions','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmContact','Contacts','updatedAt','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','json','offset','limit'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x4549,0x14e));var _0x9454=function(_0x424caf,_0x10d160){_0x424caf=_0x424caf-0x0;var _0x1e0ca6=_0x4549[_0x424caf];return _0x1e0ca6;};'use strict';var pdf=require(_0x9454('0x0'));var emlformat=require(_0x9454('0x1'));var rimraf=require(_0x9454('0x2'));var zipdir=require(_0x9454('0x3'));var jsonpatch=require(_0x9454('0x4'));var rp=require('request-promise');var moment=require(_0x9454('0x5'));var BPromise=require(_0x9454('0x6'));var Mustache=require(_0x9454('0x7'));var util=require('util');var path=require(_0x9454('0x8'));var sox=require('sox');var csv=require(_0x9454('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9454('0xa'));var crypto=require(_0x9454('0xb'));var jsforce=require(_0x9454('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9454('0x9'));var querystring=require(_0x9454('0xd'));var Papa=require(_0x9454('0xe'));var Redis=require(_0x9454('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9454('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x9454('0x11'));var db=require(_0x9454('0x12'))['db'];config[_0x9454('0x13')]=_[_0x9454('0x14')](config[_0x9454('0x13')],{'host':_0x9454('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9454('0x13')]));require('./faxAccount.socket')[_0x9454('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9454('0x17')][_0x9454('0x18')]({'port':0x232c});var client9002=jayson[_0x9454('0x17')][_0x9454('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2e9744,_0x3bd90d,_0x509237){if(_0x509237){var _0x52f7da=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52f7da[_0x9454('0x19')](_0x3bd90d)){return _0x2e9744;}else{throw new Error(_0x9454('0x1a'));}}else{return _0x2e9744;}}function respondWithRpcPromise(_0x159738,_0xa3bca3,_0x106453,_0xf3fee4){return new BPromise(function(_0x5fb1be,_0x59b868){var _0x26d08d=_0xf3fee4||client;return _0x26d08d['request'](_0x159738,_0x106453)['then'](function(_0x4cd1a6){logger[_0x9454('0x1b')](_0x9454('0x1c'),_0xa3bca3,'request\x20sent');logger[_0x9454('0x1d')](_0x9454('0x1e'),_0xa3bca3,_0x9454('0x1f'),JSON['stringify'](_0x4cd1a6));if(_0x4cd1a6[_0x9454('0x20')]){if(_0x4cd1a6[_0x9454('0x20')]['code']===0x1f4){logger[_0x9454('0x20')](_0x9454('0x1c'),_0xa3bca3,_0x4cd1a6[_0x9454('0x20')]['message']);return _0x59b868(_0x4cd1a6['error']['message']);}logger[_0x9454('0x20')](_0x9454('0x1c'),_0xa3bca3,_0x4cd1a6[_0x9454('0x20')]['message']);return _0x5fb1be(_0x4cd1a6[_0x9454('0x20')][_0x9454('0x21')]);}else{logger[_0x9454('0x1b')](_0x9454('0x1c'),_0xa3bca3,_0x9454('0x1f'));_0x5fb1be(_0x4cd1a6[_0x9454('0x22')]['message']);}})[_0x9454('0x23')](function(_0x350cdd){logger[_0x9454('0x20')](_0x9454('0x1c'),_0xa3bca3,_0x350cdd);_0x59b868(_0x350cdd);});});}function respondWithStatusCode(_0x7207ac,_0x3328ab){_0x3328ab=_0x3328ab||0xcc;return function(_0x57016a){if(_0x57016a){return _0x7207ac['sendStatus'](_0x3328ab);}return _0x7207ac[_0x9454('0x24')](_0x3328ab)['end']();};}function respondWithResult(_0x97b49,_0x5e0761){_0x5e0761=_0x5e0761||0xc8;return function(_0x12e9bd){if(_0x12e9bd){return _0x97b49[_0x9454('0x24')](_0x5e0761)[_0x9454('0x25')](_0x12e9bd);}};}function respondWithFilteredResult(_0x4f3d17,_0x296d9b){return function(_0x58c064){if(_0x58c064){var _0x53720e=_0x58c064['count'],_0x7894c=_0x296d9b[_0x9454('0x26')],_0x2f5bb8=_0x296d9b[_0x9454('0x26')]+_0x296d9b[_0x9454('0x27')],_0x129375;if(_0x2f5bb8>=_0x53720e){_0x2f5bb8=_0x53720e;_0x129375=0xc8;}else{_0x129375=0xce;}_0x4f3d17[_0x9454('0x24')](_0x129375);return _0x4f3d17[_0x9454('0x28')](_0x9454('0x29'),_0x7894c+'-'+_0x2f5bb8+'/'+_0x53720e)[_0x9454('0x25')](_0x58c064);}return null;};}function patchUpdates(_0x40322d){return function(_0x16ac35){try{jsonpatch[_0x9454('0x2a')](_0x16ac35,_0x40322d,!![]);}catch(_0x349886){return BPromise[_0x9454('0x2b')](_0x349886);}return _0x16ac35[_0x9454('0x2c')]();};}function saveUpdates(_0x327acd,_0x4a1f27){return function(_0x1efec9){if(_0x1efec9){return _0x1efec9[_0x9454('0x2d')](_0x327acd)[_0x9454('0x2e')](function(_0x2f3dbe){return _0x2f3dbe;});}return null;};}function removeEntity(_0x3f01c4,_0x266e30){return function(_0x3c43e3){if(_0x3c43e3){return _0x3c43e3[_0x9454('0x2f')]()['then'](function(){var _0x3192cf=_0x3c43e3['get']({'plain':!![]});var _0x4132d6=_0x9454('0x30');return db['UserProfileResource'][_0x9454('0x2f')]({'where':{'type':_0x4132d6,'resourceId':_0x3192cf['id']}})[_0x9454('0x2e')](function(){return _0x3c43e3;});})[_0x9454('0x2e')](function(){_0x3f01c4[_0x9454('0x24')](0xcc)[_0x9454('0x31')]();});}};}function handleEntityNotFound(_0x50720f,_0x590250){return function(_0x409486){if(!_0x409486){_0x50720f[_0x9454('0x32')](0x194);}return _0x409486;};}function handleError(_0x7791e1,_0x194d56){_0x194d56=_0x194d56||0x1f4;return function(_0x303fc5){logger[_0x9454('0x20')](_0x303fc5[_0x9454('0x33')]);if(_0x303fc5[_0x9454('0x34')]){delete _0x303fc5[_0x9454('0x34')];}_0x7791e1[_0x9454('0x24')](_0x194d56)[_0x9454('0x35')](_0x303fc5);};}exports[_0x9454('0x36')]=function(_0x4141a1,_0x15e838){var _0x2e3214={'include':[{'model':db[_0x9454('0x37')],'as':_0x9454('0x38')}]},_0x4f9c9d={},_0x255528={'count':0x0,'rows':[]};var _0x5be978=db['FaxAccount'][_0x9454('0x39')];_0x4f9c9d[_0x9454('0x3a')]=_[_0x9454('0x3b')](_0x5be978);_0x4f9c9d[_0x9454('0x3c')]=_[_0x9454('0x3b')](_0x4141a1[_0x9454('0x3c')]);_0x4f9c9d[_0x9454('0x3d')]=_['intersection'](_0x4f9c9d[_0x9454('0x3a')],_0x4f9c9d[_0x9454('0x3c')]);_0x2e3214[_0x9454('0x3e')]=_['intersection'](_0x4f9c9d['model'],qs[_0x9454('0x3f')](_0x4141a1[_0x9454('0x3c')][_0x9454('0x3f')]));_0x2e3214[_0x9454('0x3e')]=_0x2e3214['attributes']['length']?_0x2e3214[_0x9454('0x3e')]:_0x4f9c9d[_0x9454('0x3a')];if(!_0x4141a1[_0x9454('0x3c')][_0x9454('0x40')]('nolimit')){_0x2e3214[_0x9454('0x27')]=qs[_0x9454('0x27')](_0x4141a1['query'][_0x9454('0x27')]);_0x2e3214[_0x9454('0x26')]=qs[_0x9454('0x26')](_0x4141a1[_0x9454('0x3c')]['offset']);}_0x2e3214[_0x9454('0x41')]=qs[_0x9454('0x42')](_0x4141a1[_0x9454('0x3c')]['sort']);_0x2e3214[_0x9454('0x43')]=qs[_0x9454('0x3d')](_[_0x9454('0x44')](_0x4141a1['query'],_0x4f9c9d[_0x9454('0x3d')]));if(_0x4141a1['query'][_0x9454('0x45')]){_0x2e3214[_0x9454('0x43')]=_['merge'](_0x2e3214[_0x9454('0x43')],{'$or':_[_0x9454('0x46')](_0x5be978,function(_0x9a0482){if(_0x9a0482[_0x9454('0x47')][_0x9454('0x48')]!==_0x9454('0x49')){var _0x492443={};_0x492443[_0x9a0482['field']]={'$like':'%'+_0x4141a1['query'][_0x9454('0x45')]+'%'};return _0x492443;}})});}_0x2e3214=_[_0x9454('0x4a')]({},_0x2e3214,_0x4141a1[_0x9454('0x4b')]);var _0x533979={'where':_0x2e3214[_0x9454('0x43')]};return db[_0x9454('0x4c')][_0x9454('0x4d')](_0x533979)[_0x9454('0x2e')](function(_0x543d0c){_0x255528[_0x9454('0x4d')]=_0x543d0c;if(_0x4141a1['query'][_0x9454('0x4e')]){_0x2e3214[_0x9454('0x4f')]=[{'all':!![]}];}return db[_0x9454('0x4c')]['findAll'](_0x2e3214);})['then'](function(_0x5eabaa){_0x255528['rows']=_0x5eabaa;return _0x255528;})[_0x9454('0x2e')](respondWithFilteredResult(_0x15e838,_0x2e3214))[_0x9454('0x23')](handleError(_0x15e838,null));};exports[_0x9454('0x50')]=function(_0xf59513,_0x222897){var _0xff37fb={'raw':![],'where':{'id':_0xf59513[_0x9454('0x51')]['id']},'include':[{'model':db[_0x9454('0x37')],'as':_0x9454('0x38')}]},_0xd97a19={};_0xd97a19[_0x9454('0x3a')]=_[_0x9454('0x3b')](db['FaxAccount'][_0x9454('0x39')]);_0xd97a19[_0x9454('0x3c')]=_[_0x9454('0x3b')](_0xf59513[_0x9454('0x3c')]);_0xd97a19[_0x9454('0x3d')]=_[_0x9454('0x52')](_0xd97a19[_0x9454('0x3a')],_0xd97a19[_0x9454('0x3c')]);_0xff37fb[_0x9454('0x3e')]=_[_0x9454('0x52')](_0xd97a19[_0x9454('0x3a')],qs[_0x9454('0x3f')](_0xf59513[_0x9454('0x3c')]['fields']));_0xff37fb[_0x9454('0x3e')]=_0xff37fb[_0x9454('0x3e')][_0x9454('0x53')]?_0xff37fb[_0x9454('0x3e')]:_0xd97a19[_0x9454('0x3a')];if(_0xf59513[_0x9454('0x3c')][_0x9454('0x4e')]){_0xff37fb['include']=[{'all':!![]}];}_0xff37fb=_['merge']({},_0xff37fb,_0xf59513[_0x9454('0x4b')]);return db['FaxAccount'][_0x9454('0x54')](_0xff37fb)[_0x9454('0x2e')](handleEntityNotFound(_0x222897,null))['then'](respondWithResult(_0x222897,null))[_0x9454('0x23')](handleError(_0x222897,null));};exports['create']=function(_0x2975a6,_0x533fdc){return db[_0x9454('0x4c')]['create'](_0x2975a6['body'],{})['then'](function(_0x587626){var _0x358d5f=_0x2975a6[_0x9454('0x55')][_0x9454('0x56')]({'plain':!![]});if(!_0x358d5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x358d5f['role']===_0x9454('0x55')){var _0x2f2f86=_0x587626[_0x9454('0x56')]({'plain':!![]});var _0x5cc588='FaxAccounts';return db[_0x9454('0x57')]['find']({'where':{'name':_0x5cc588,'userProfileId':_0x358d5f[_0x9454('0x58')]},'raw':!![]})[_0x9454('0x2e')](function(_0x5ee08d){if(_0x5ee08d&&_0x5ee08d[_0x9454('0x59')]===0x0){return db[_0x9454('0x5a')]['create']({'name':_0x2f2f86[_0x9454('0x34')],'resourceId':_0x2f2f86['id'],'type':_0x5ee08d['name'],'sectionId':_0x5ee08d['id']},{})['then'](function(){return _0x587626;});}else{return _0x587626;}})[_0x9454('0x23')](function(_0x36e463){logger[_0x9454('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36e463);throw _0x36e463;});}return _0x587626;})[_0x9454('0x2e')](respondWithResult(_0x533fdc,0xc9))[_0x9454('0x23')](handleError(_0x533fdc,null));};exports[_0x9454('0x2d')]=function(_0x5f06d3,_0x10b16a){if(_0x5f06d3[_0x9454('0x5b')]['id']){delete _0x5f06d3[_0x9454('0x5b')]['id'];}return db[_0x9454('0x4c')]['find']({'where':{'id':_0x5f06d3[_0x9454('0x51')]['id']},'include':[{'model':db[_0x9454('0x37')],'as':_0x9454('0x38')}]})[_0x9454('0x2e')](handleEntityNotFound(_0x10b16a,null))[_0x9454('0x2e')](saveUpdates(_0x5f06d3[_0x9454('0x5b')],null))[_0x9454('0x2e')](respondWithResult(_0x10b16a,null))[_0x9454('0x23')](handleError(_0x10b16a,null));};exports[_0x9454('0x2f')]=function(_0x19bdc0,_0x1cedae){return db[_0x9454('0x4c')]['find']({'where':{'id':_0x19bdc0['params']['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x1cedae,null))[_0x9454('0x2e')](removeEntity(_0x1cedae,null))[_0x9454('0x23')](handleError(_0x1cedae,null));};exports[_0x9454('0x5c')]=function(_0x3ce59c,_0x593586){return db[_0x9454('0x4c')]['describe']()[_0x9454('0x2e')](respondWithResult(_0x593586,null))[_0x9454('0x23')](handleError(_0x593586,null));};exports[_0x9454('0x5d')]=function(_0x54ac09,_0x56a52e,_0x2542a9){if(_0x54ac09[_0x9454('0x5b')]['id']){delete _0x54ac09['body']['id'];}return db[_0x9454('0x4c')][_0x9454('0x54')]({'where':{'id':_0x54ac09[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x56a52e,null))[_0x9454('0x2e')](function(_0x1568a8){if(_0x1568a8){_0x54ac09['body'][_0x9454('0x5e')]=_0x1568a8['id'];return db[_0x9454('0x5f')]['create'](_0x54ac09[_0x9454('0x5b')]);}})['then'](respondWithResult(_0x56a52e,null))[_0x9454('0x23')](handleError(_0x56a52e,null));};exports[_0x9454('0x60')]=function(_0x602638,_0x3bb6be,_0x5ac9d1){var _0x958c3={'raw':![],'where':{}};var _0x1bfc54={};var _0x5ec106={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9454('0x61')]({'where':{'id':_0x602638[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x3bb6be,null))['then'](function(_0x1008ba){if(_0x1008ba){_0x1bfc54[_0x9454('0x3a')]=_['keys'](db[_0x9454('0x5f')]['rawAttributes']);_0x1bfc54[_0x9454('0x3c')]=_[_0x9454('0x3b')](_0x602638['query']);_0x1bfc54[_0x9454('0x3d')]=_['intersection'](_0x1bfc54[_0x9454('0x3a')],_0x1bfc54[_0x9454('0x3c')]);_0x958c3[_0x9454('0x3e')]=_[_0x9454('0x52')](_0x1bfc54['model'],qs[_0x9454('0x3f')](_0x602638[_0x9454('0x3c')][_0x9454('0x3f')]));_0x958c3[_0x9454('0x3e')]=_0x958c3['attributes'][_0x9454('0x53')]?_0x958c3[_0x9454('0x3e')]:_0x1bfc54[_0x9454('0x3a')];if(!_0x602638[_0x9454('0x3c')][_0x9454('0x40')](_0x9454('0x62'))){_0x958c3['limit']=qs[_0x9454('0x27')](_0x602638[_0x9454('0x3c')][_0x9454('0x27')]);_0x958c3[_0x9454('0x26')]=qs['offset'](_0x602638[_0x9454('0x3c')][_0x9454('0x26')]);}_0x958c3['order']=qs['sort'](_0x602638['query']['sort']);_0x958c3[_0x9454('0x43')]=qs[_0x9454('0x3d')](_[_0x9454('0x44')](_0x602638[_0x9454('0x3c')],_0x1bfc54['filters']));_0x958c3['where'][_0x9454('0x5e')]=_0x1008ba['id'];if(_0x602638[_0x9454('0x3c')][_0x9454('0x45')]){_0x958c3[_0x9454('0x43')]=_[_0x9454('0x4a')](_0x958c3[_0x9454('0x43')],{'$or':_[_0x9454('0x46')](_0x958c3['attributes'],function(_0x7d8f10){var _0x22a425={};_0x22a425[_0x7d8f10]={'$like':'%'+_0x602638[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x22a425;})});}_0x958c3=_['merge']({},_0x958c3,_0x602638[_0x9454('0x4b')]);return db['Disposition']['count']({'where':_0x958c3[_0x9454('0x43')]})[_0x9454('0x2e')](function(_0x33d8bb){_0x5ec106[_0x9454('0x4d')]=_0x33d8bb;if(_0x602638[_0x9454('0x3c')][_0x9454('0x4e')]){_0x958c3['include']=[{'all':!![]}];}return db[_0x9454('0x5f')][_0x9454('0x63')](_0x958c3);})[_0x9454('0x2e')](function(_0x34a835){_0x5ec106[_0x9454('0x64')]=_0x34a835;return _0x5ec106;});}})[_0x9454('0x2e')](respondWithFilteredResult(_0x3bb6be,_0x958c3))['catch'](handleError(_0x3bb6be,null));};exports[_0x9454('0x65')]=function(_0x4033b3,_0x2f642b,_0x5be13d){return db['FaxAccount'][_0x9454('0x54')]({'where':{'id':_0x4033b3[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x2f642b,null))[_0x9454('0x2e')](function(_0x579bb8){if(_0x579bb8){return _0x579bb8[_0x9454('0x65')](_0x4033b3[_0x9454('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x2f642b,null))['catch'](handleError(_0x2f642b,null));};exports[_0x9454('0x66')]=function(_0x349fa7,_0x2ce2b1,_0x30dde0){if(_0x349fa7['body']['id']){delete _0x349fa7['body']['id'];}return db[_0x9454('0x4c')][_0x9454('0x54')]({'where':{'id':_0x349fa7[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x2ce2b1,null))[_0x9454('0x2e')](function(_0x27f706){if(_0x27f706){_0x349fa7[_0x9454('0x5b')][_0x9454('0x5e')]=_0x27f706['id'];return db[_0x9454('0x67')][_0x9454('0x68')](_0x349fa7[_0x9454('0x5b')]);}})[_0x9454('0x2e')](respondWithResult(_0x2ce2b1,null))[_0x9454('0x23')](handleError(_0x2ce2b1,null));};exports[_0x9454('0x69')]=function(_0x330f2f,_0x309061,_0x499499){var _0x5e177c={'raw':![],'where':{}};var _0x158137={};var _0x453bb3={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x330f2f[_0x9454('0x51')]['id']}})['then'](handleEntityNotFound(_0x309061,null))['then'](function(_0x407806){if(_0x407806){_0x158137['model']=_['keys'](db['CannedAnswer'][_0x9454('0x39')]);_0x158137[_0x9454('0x3c')]=_['keys'](_0x330f2f['query']);_0x158137[_0x9454('0x3d')]=_[_0x9454('0x52')](_0x158137[_0x9454('0x3a')],_0x158137[_0x9454('0x3c')]);_0x5e177c['attributes']=_['intersection'](_0x158137['model'],qs[_0x9454('0x3f')](_0x330f2f[_0x9454('0x3c')][_0x9454('0x3f')]));_0x5e177c['attributes']=_0x5e177c[_0x9454('0x3e')]['length']?_0x5e177c[_0x9454('0x3e')]:_0x158137['model'];if(!_0x330f2f[_0x9454('0x3c')][_0x9454('0x40')]('nolimit')){_0x5e177c['limit']=qs[_0x9454('0x27')](_0x330f2f[_0x9454('0x3c')][_0x9454('0x27')]);_0x5e177c[_0x9454('0x26')]=qs['offset'](_0x330f2f[_0x9454('0x3c')][_0x9454('0x26')]);}_0x5e177c[_0x9454('0x41')]=qs[_0x9454('0x42')](_0x330f2f['query'][_0x9454('0x42')]);_0x5e177c[_0x9454('0x43')]=qs[_0x9454('0x3d')](_[_0x9454('0x44')](_0x330f2f[_0x9454('0x3c')],_0x158137[_0x9454('0x3d')]));_0x5e177c[_0x9454('0x43')][_0x9454('0x5e')]=_0x407806['id'];if(_0x330f2f[_0x9454('0x3c')][_0x9454('0x45')]){_0x5e177c[_0x9454('0x43')]=_[_0x9454('0x4a')](_0x5e177c[_0x9454('0x43')],{'$or':_[_0x9454('0x46')](_0x5e177c[_0x9454('0x3e')],function(_0x31a590){var _0x4ca966={};_0x4ca966[_0x31a590]={'$like':'%'+_0x330f2f[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x4ca966;})});}_0x5e177c=_[_0x9454('0x4a')]({},_0x5e177c,_0x330f2f[_0x9454('0x4b')]);return db[_0x9454('0x67')]['count']({'where':_0x5e177c['where']})[_0x9454('0x2e')](function(_0x46c662){_0x453bb3[_0x9454('0x4d')]=_0x46c662;if(_0x330f2f[_0x9454('0x3c')]['includeAll']){_0x5e177c['include']=[{'all':!![]}];}return db[_0x9454('0x67')][_0x9454('0x63')](_0x5e177c);})[_0x9454('0x2e')](function(_0x53f5d8){_0x453bb3[_0x9454('0x64')]=_0x53f5d8;return _0x453bb3;});}})[_0x9454('0x2e')](respondWithFilteredResult(_0x309061,_0x5e177c))['catch'](handleError(_0x309061,null));};exports[_0x9454('0x6a')]=function(_0x5d4bae,_0x3a5dae,_0x2117c8){return db[_0x9454('0x4c')][_0x9454('0x54')]({'where':{'id':_0x5d4bae[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x3a5dae,null))[_0x9454('0x2e')](function(_0x3fa6d6){if(_0x3fa6d6){return _0x3fa6d6['removeAnswers'](_0x5d4bae[_0x9454('0x3c')]['ids']);}})[_0x9454('0x2e')](respondWithStatusCode(_0x3a5dae,null))[_0x9454('0x23')](handleError(_0x3a5dae,null));};exports['addInteraction']=function(_0x2a8ac4,_0x3a03f5,_0x3da9a6){return db[_0x9454('0x6b')]['find']({'where':{'id':_0x2a8ac4[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x3a03f5,null))[_0x9454('0x2e')](function(_0x30783d){if(_0x30783d){return _0x30783d[_0x9454('0x6c')](_0x2a8ac4['body'][_0x9454('0x6d')],_[_0x9454('0x6e')](_0x2a8ac4[_0x9454('0x5b')],['ids','id'])||{});}})[_0x9454('0x2e')](respondWithResult(_0x3a03f5,null))[_0x9454('0x23')](handleError(_0x3a03f5,null));};exports[_0x9454('0x6f')]=function(_0x152097,_0x3518b1,_0xaba2e8){var _0x33d408={'raw':![],'where':{}};var _0x5b8ca9={};var _0x3ca767={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9454('0x61')]({'where':{'id':_0x152097[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x3518b1,null))['then'](function(_0x129336){if(_0x129336){_0x5b8ca9[_0x9454('0x3a')]=_[_0x9454('0x3b')](db[_0x9454('0x6b')][_0x9454('0x39')]);_0x5b8ca9[_0x9454('0x3c')]=_['keys'](_0x152097['query']);_0x5b8ca9['filters']=_[_0x9454('0x52')](_0x5b8ca9[_0x9454('0x3a')],_0x5b8ca9[_0x9454('0x3c')]);_0x33d408['attributes']=_['intersection'](_0x5b8ca9[_0x9454('0x3a')],qs['fields'](_0x152097[_0x9454('0x3c')][_0x9454('0x3f')]));_0x33d408[_0x9454('0x3e')]=_0x33d408[_0x9454('0x3e')][_0x9454('0x53')]?_0x33d408[_0x9454('0x3e')]:_0x5b8ca9['model'];if(!_0x152097[_0x9454('0x3c')][_0x9454('0x40')](_0x9454('0x62'))){_0x33d408[_0x9454('0x27')]=qs[_0x9454('0x27')](_0x152097[_0x9454('0x3c')][_0x9454('0x27')]);_0x33d408[_0x9454('0x26')]=qs[_0x9454('0x26')](_0x152097[_0x9454('0x3c')][_0x9454('0x26')]);}_0x33d408['order']=qs[_0x9454('0x42')](_0x152097[_0x9454('0x3c')]['sort']);_0x33d408['where']=qs[_0x9454('0x3d')](_[_0x9454('0x44')](_0x152097['query'],_0x5b8ca9[_0x9454('0x3d')]));_0x33d408[_0x9454('0x43')][_0x9454('0x5e')]=_0x129336['id'];if(_0x152097[_0x9454('0x3c')][_0x9454('0x45')]){_0x33d408[_0x9454('0x43')]=_[_0x9454('0x4a')](_0x33d408[_0x9454('0x43')],{'$or':_['map'](_0x33d408[_0x9454('0x3e')],function(_0x3380ef){var _0x229ca2={};_0x229ca2[_0x3380ef]={'$like':'%'+_0x152097[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x229ca2;})});}_0x33d408=_['merge']({},_0x33d408,_0x152097['options']);return db[_0x9454('0x6b')][_0x9454('0x4d')]({'where':_0x33d408[_0x9454('0x43')]})[_0x9454('0x2e')](function(_0x3f95c7){_0x3ca767[_0x9454('0x4d')]=_0x3f95c7;if(_0x152097[_0x9454('0x3c')][_0x9454('0x4e')]){_0x33d408[_0x9454('0x4f')]=[{'model':db['CmContact'],'as':_0x9454('0x70'),'required':![]},{'model':db[_0x9454('0x71')],'as':_0x9454('0x72'),'attributes':['name','fullname',_0x9454('0x73')],'required':![]},{'model':db[_0x9454('0x74')],'as':'Tags','attributes':['id',_0x9454('0x34'),_0x9454('0x75')],'where':_0x152097[_0x9454('0x3c')][_0x9454('0x76')]?{'id':_0x152097[_0x9454('0x3c')][_0x9454('0x76')]}:undefined,'required':_0x152097[_0x9454('0x3c')][_0x9454('0x76')]?!![]:![]}];}return db['FaxInteraction'][_0x9454('0x63')](_0x33d408);})['then'](function(_0x3bfa7b){_0x3ca767[_0x9454('0x64')]=_0x3bfa7b;return _0x3ca767;});}})[_0x9454('0x2e')](respondWithFilteredResult(_0x3518b1,_0x33d408))[_0x9454('0x23')](handleError(_0x3518b1,null));};exports[_0x9454('0x77')]=function(_0x375636,_0x851dae,_0x435a40){return db['FaxAccount'][_0x9454('0x61')]({'where':{'id':_0x375636['params']['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x851dae,null))['then'](function(_0x581123){if(_0x581123){return db[_0x9454('0x78')][_0x9454('0x79')](function(_0x3314ff){return db['FaxApplication'][_0x9454('0x2f')]({'where':{'FaxAccountId':_0x375636[_0x9454('0x51')]['id']},'transaction':_0x3314ff})['then'](function(_0x50aa73){var _0x355f99=_[_0x9454('0x46')](_0x375636[_0x9454('0x5b')],function(_0x4162a1){_0x4162a1['FaxAccountId']=_0x375636[_0x9454('0x51')]['id'];return _0x4162a1;});return db[_0x9454('0x7a')][_0x9454('0x7b')](_0x355f99,{'transaction':_0x3314ff});});})[_0x9454('0x2e')](function(){return db[_0x9454('0x7a')][_0x9454('0x7c')]({'where':{'FaxAccountId':_0x375636['params']['id']},'order':'priority'});});}})[_0x9454('0x2e')](respondWithResult(_0x851dae,null))['catch'](handleError(_0x851dae,null));};exports[_0x9454('0x7d')]=function(_0x32d6f2,_0x1421d8,_0x5c6fb0){var _0x455195={};var _0x245c3f={};var _0x3a7794;var _0x1b4798;return db[_0x9454('0x4c')][_0x9454('0x61')]({'where':{'id':_0x32d6f2[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x1421d8,null))[_0x9454('0x2e')](function(_0x228450){if(_0x228450){_0x3a7794=_0x228450;_0x245c3f[_0x9454('0x3a')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x245c3f[_0x9454('0x3c')]=_[_0x9454('0x3b')](_0x32d6f2['query']);_0x245c3f['filters']=_['intersection'](_0x245c3f[_0x9454('0x3a')],_0x245c3f[_0x9454('0x3c')]);_0x455195['attributes']=_['intersection'](_0x245c3f['model'],qs[_0x9454('0x3f')](_0x32d6f2['query'][_0x9454('0x3f')]));_0x455195[_0x9454('0x3e')]=_0x455195[_0x9454('0x3e')][_0x9454('0x53')]?_0x455195[_0x9454('0x3e')]:_0x245c3f[_0x9454('0x3a')];_0x455195[_0x9454('0x41')]=qs[_0x9454('0x42')](_0x32d6f2['query'][_0x9454('0x42')]);_0x455195[_0x9454('0x43')]=qs['filters'](_['pick'](_0x32d6f2[_0x9454('0x3c')],_0x245c3f[_0x9454('0x3d')]));if(_0x32d6f2[_0x9454('0x3c')][_0x9454('0x45')]){_0x455195[_0x9454('0x43')]=_['merge'](_0x455195[_0x9454('0x43')],{'$or':_[_0x9454('0x46')](_0x455195[_0x9454('0x3e')],function(_0x20b241){var _0x1a6335={};_0x1a6335[_0x20b241]={'$like':'%'+_0x32d6f2[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x1a6335;})});}_0x455195=_[_0x9454('0x4a')]({},_0x455195,_0x32d6f2['options']);return _0x3a7794['getApplications'](_0x455195);}})[_0x9454('0x2e')](function(_0x55db46){if(_0x55db46){_0x1b4798=_0x55db46[_0x9454('0x53')];if(!_0x32d6f2[_0x9454('0x3c')][_0x9454('0x40')]('nolimit')){_0x455195[_0x9454('0x27')]=qs[_0x9454('0x27')](_0x32d6f2[_0x9454('0x3c')][_0x9454('0x27')]);_0x455195['offset']=qs[_0x9454('0x26')](_0x32d6f2[_0x9454('0x3c')][_0x9454('0x26')]);}return _0x3a7794[_0x9454('0x7d')](_0x455195);}})[_0x9454('0x2e')](function(_0xfbe8c1){if(_0xfbe8c1){return _0xfbe8c1?{'count':_0x1b4798,'rows':_0xfbe8c1}:null;}})['then'](respondWithResult(_0x1421d8,null))[_0x9454('0x23')](handleError(_0x1421d8,null));};function Extension(_0x3ea6d4,_0x33ae39,_0x4d9cea,_0x2a3849){this[_0x9454('0x7e')]=_0x9454('0x7f');this[_0x9454('0x80')]=_0x3ea6d4[_0x9454('0x81')];this[_0x9454('0x82')]=_0x2a3849;this[_0x9454('0x47')]=_0x9454('0x83');this['description']=_0x9454('0x84');this[_0x9454('0x5e')]=_0x3ea6d4['id'];this[_0x9454('0x85')]=_0x33ae39;this[_0x9454('0x86')]=_0x4d9cea;}function createExtensionsReciveFax(_0x2877a2){var _0xfcd40d=0x1;var _0x2dc7eb=[];_0x2dc7eb[_0x9454('0x87')](new Extension(_0x2877a2,_0xfcd40d,'',_0x9454('0x88')));_0xfcd40d+=0x1;_0x2dc7eb[_0x9454('0x87')](new Extension(_0x2877a2,_0xfcd40d,_0x9454('0x89'),_0x9454('0x8a')));_0xfcd40d+=0x1;for(var _0x2806d8 in _0x2877a2){if(_0x2877a2[_0x9454('0x40')](_0x2806d8)&&(_0x2806d8==='ecm'||_0x2806d8===_0x9454('0x81')||_0x2806d8===_0x9454('0x8b')||_0x2806d8===_0x9454('0x8c')||_0x2806d8==='headerinfo'||_0x2806d8===_0x9454('0x8d')||_0x2806d8===_0x9454('0x8e')||_0x2806d8===_0x9454('0x8f')||_0x2806d8===_0x9454('0x90'))){_0x2dc7eb[_0x9454('0x87')](new Extension(_0x2877a2,_0xfcd40d,_0x9454('0x91')+_0x2806d8+')='+_0x2877a2[_0x2806d8],_0x9454('0x8a')));_0xfcd40d+=0x1;}}_0x2dc7eb[_0x9454('0x87')](new Extension(_0x2877a2,_0xfcd40d,'6',_0x9454('0x92')));_0xfcd40d+=0x1;_0x2dc7eb[_0x9454('0x87')](new Extension(_0x2877a2,_0xfcd40d,_0x9454('0x93'),_0x9454('0x94')));_0xfcd40d=0x0;return _0x2dc7eb;}exports[_0x9454('0x95')]=function(_0xd9e295,_0x9ade8,_0x2b14e1){var _0x2dca60;return db[_0x9454('0x78')][_0x9454('0x79')](function(_0x5a4005){return db[_0x9454('0x4c')][_0x9454('0x68')](_0xd9e295[_0x9454('0x5b')],{'transaction':_0x5a4005})[_0x9454('0x2e')](function(_0xe82c){_0x2dca60=_0xe82c[_0x9454('0x56')]({'plain':!![]});return db[_0x9454('0x96')][_0x9454('0x7b')](createExtensionsReciveFax(_0x2dca60),{'transaction':_0x5a4005});});})[_0x9454('0x2e')](function(){return _0x2dca60;})[_0x9454('0x2e')](respondWithResult(_0x9ade8,null))[_0x9454('0x23')](handleError(_0x9ade8,null));};exports['updateAccountApplications']=function(_0xd4a2f1,_0x5ab4f4,_0xc5d842){var _0x43ed42;return db[_0x9454('0x78')][_0x9454('0x79')](function(_0x5d10e3){return db[_0x9454('0x4c')][_0x9454('0x2d')](_0xd4a2f1['body'],{'where':{'id':_0xd4a2f1[_0x9454('0x5b')]['id']},'transaction':_0x5d10e3})[_0x9454('0x2e')](function(_0x65742){return db[_0x9454('0x96')][_0x9454('0x2f')]({'where':{'FaxAccountId':_0xd4a2f1[_0x9454('0x5b')]['id']},'transaction':_0x5d10e3})[_0x9454('0x2e')](function(_0x4b4440){return db[_0x9454('0x96')][_0x9454('0x7b')](createExtensionsReciveFax(_[_0x9454('0x6e')](_0xd4a2f1[_0x9454('0x5b')],['tech',_0x9454('0x48'),_0x9454('0x97'),'updatedAt',_0x9454('0x98'),_0x9454('0x99')])),{'transaction':_0x5d10e3});});});})['then'](function(){return db[_0x9454('0x4c')][_0x9454('0x9a')](_0xd4a2f1[_0x9454('0x5b')]['id']);})[_0x9454('0x2e')](respondWithResult(_0x5ab4f4,null))[_0x9454('0x23')](handleError(_0x5ab4f4,null));};exports[_0x9454('0x9b')]=function(_0x427b11,_0x547d34,_0x590c33){var _0x5584d8={'raw':!![],'where':{}};var _0x5093c8={};var _0x2acec8={'count':0x0,'rows':[]};return db[_0x9454('0x4c')][_0x9454('0x61')]({'where':{'id':_0x427b11[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x547d34,null))[_0x9454('0x2e')](function(_0x1a682a){if(_0x1a682a){_0x5093c8['model']=_[_0x9454('0x3b')](db[_0x9454('0x9c')]['rawAttributes']);_0x5093c8[_0x9454('0x3c')]=_[_0x9454('0x3b')](_0x427b11['query']);_0x5093c8[_0x9454('0x3d')]=_['intersection'](_0x5093c8[_0x9454('0x3a')],_0x5093c8[_0x9454('0x3c')]);_0x5584d8['attributes']=_[_0x9454('0x52')](_0x5093c8[_0x9454('0x3a')],qs['fields'](_0x427b11[_0x9454('0x3c')][_0x9454('0x3f')]));_0x5584d8[_0x9454('0x3e')]=_0x5584d8['attributes'][_0x9454('0x53')]?_0x5584d8['attributes']:_0x5093c8[_0x9454('0x3a')];if(!_0x427b11[_0x9454('0x3c')]['hasOwnProperty'](_0x9454('0x62'))){_0x5584d8[_0x9454('0x27')]=qs['limit'](_0x427b11[_0x9454('0x3c')]['limit']);_0x5584d8['offset']=qs[_0x9454('0x26')](_0x427b11['query'][_0x9454('0x26')]);}_0x5584d8['order']=qs[_0x9454('0x42')](_0x427b11[_0x9454('0x3c')][_0x9454('0x42')]);_0x5584d8[_0x9454('0x43')]=qs[_0x9454('0x3d')](_['pick'](_0x427b11[_0x9454('0x3c')],_0x5093c8[_0x9454('0x3d')]));_0x5584d8[_0x9454('0x43')][_0x9454('0x5e')]=_0x1a682a['id'];if(_0x427b11[_0x9454('0x3c')][_0x9454('0x45')]){_0x5584d8[_0x9454('0x43')]=_[_0x9454('0x4a')](_0x5584d8['where'],{'$or':_[_0x9454('0x46')](_0x5584d8['attributes'],function(_0x3ef6fb){var _0x23aecb={};_0x23aecb[_0x3ef6fb]={'$like':'%'+_0x427b11[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x23aecb;})});}if(_0x427b11[_0x9454('0x3c')][_0x9454('0x9d')]){var _0x2ffd1b=_0x427b11[_0x9454('0x3c')][_0x9454('0x9d')][_0x9454('0x9e')](',');var _0x2876c0={};_0x2876c0[_0x2ffd1b[0x0]]={'$gte':moment(_0x2ffd1b[0x1])[_0x9454('0x9f')](_0x9454('0xa0'))};_0x5584d8['where']=_['merge'](_0x5584d8['where'],_0x2876c0);}_0x5584d8=_[_0x9454('0x4a')]({},_0x5584d8,_0x427b11[_0x9454('0x4b')]);return db['FaxMessage'][_0x9454('0x4d')]({'where':_0x5584d8[_0x9454('0x43')]})[_0x9454('0x2e')](function(_0x26adff){_0x2acec8[_0x9454('0x4d')]=_0x26adff;if(_0x427b11[_0x9454('0x3c')][_0x9454('0x4e')]){_0x5584d8['include']=[{'all':!![]}];}return db['FaxMessage'][_0x9454('0x63')](_0x5584d8);})[_0x9454('0x2e')](function(_0x5d6d69){_0x2acec8[_0x9454('0x64')]=_0x5d6d69;return _0x2acec8;});}})['then'](respondWithFilteredResult(_0x547d34,_0x5584d8))[_0x9454('0x23')](handleError(_0x547d34,null));};exports['send']=function(_0x26c1ae,_0x5505b7,_0x323e44){var _0x499a2e,_0x2ab697={},_0x3033e6;if(_0x26c1ae[_0x9454('0x5b')]['to']){_0x3033e6=_0x26c1ae[_0x9454('0x5b')]['to'][0x0];}return db[_0x9454('0x4c')][_0x9454('0x54')]({'where':{'id':_0x26c1ae['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9454('0xa1')],'as':_0x9454('0xa2'),'where':{'fax':_0x3033e6},'limit':0x1,'order':[[_0x9454('0xa3'),_0x9454('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x5505b7,null))['then'](function(_0xe26a29){_0x499a2e=_0xe26a29;if(_0x26c1ae['body']['attachments']&&_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')]['length']){for(var _0x15ec27=0x0;_0x15ec27<_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][_0x9454('0x53')];_0x15ec27+=0x1){_0x26c1ae[_0x9454('0x5b')]['attachments'][_0x15ec27]={'filename':_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][_0x15ec27][_0x9454('0x34')],'id':_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][_0x15ec27]['id'],'path':path['join'](config['root'],_0x9454('0xa6'),_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][_0x15ec27][_0x9454('0xa7')])};}}return respondWithRpcPromise(_0x9454('0xa8'),'CheckAfterSend',{'FaxAccountId':_[_0x9454('0xa9')](_0x26c1ae['params']['id'])?undefined:_0x26c1ae[_0x9454('0x51')]['id'],'path':_[_0x9454('0xa9')](_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0][_0x9454('0x8')])?undefined:_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0][_0x9454('0x8')],'fax':_['isNil'](_0x26c1ae[_0x9454('0x5b')]['to'][0x0])?undefined:_0x26c1ae[_0x9454('0x5b')]['to'][0x0]},client9002);})[_0x9454('0x2e')](function(){if(_0x499a2e){if(_[_0x9454('0xa9')](_0x26c1ae['body'][_0x9454('0xaa')])){_0x26c1ae[_0x9454('0x5b')][_0x9454('0xaa')]=util['format']('\x22%s\x22\x20<%s>',_0x499a2e[_0x9454('0x34')],_0x499a2e[_0x9454('0xab')]);}if(_0x499a2e[_0x9454('0xac')]){if(_0x499a2e['List'][_0x9454('0xa2')][_0x9454('0x53')]){return _0x499a2e['List']['Contacts'][0x0];}else{return db[_0x9454('0xa1')][_0x9454('0x68')](_[_0x9454('0x14')](_0x26c1ae[_0x9454('0x5b')],{'firstName':_0x26c1ae['body']['to'][0x0],'phone':_0x26c1ae[_0x9454('0x5b')]['to'][0x0],'fax':_0x26c1ae[_0x9454('0x5b')]['to'][0x0],'ListId':_0x499a2e[_0x9454('0x99')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x9454('0xad'));}})['then'](function(_0x3cd9ce){if(_0x3cd9ce){return db[_0x9454('0x6b')]['find']({'where':{'ContactId':_0x3cd9ce['id'],'closed':![],'FaxAccountId':_0x499a2e['id']}})[_0x9454('0x2e')](function(_0x486cec){if(_0x486cec){return[_0x486cec,![]];}return db[_0x9454('0x6b')][_0x9454('0x68')]({'UserId':_0x26c1ae[_0x9454('0x55')]['id'],'ContactId':_0x3cd9ce['id'],'FaxAccountId':_0x499a2e['id'],'fax':_0x26c1ae[_0x9454('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x26c1ae[_0x9454('0x5b')],{'read':![],'body':_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0][_0x9454('0xae')],'FaxAccountId':_0x499a2e['id'],'UserId':_0x26c1ae[_0x9454('0x55')]['id'],'ContactId':_0x3cd9ce['id'],'AttachmentId':_0x26c1ae[_0x9454('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9454('0x9c')],'as':_0x9454('0xaf')}]})[_0x9454('0x2e')](function(_0x3367c4){return[_0x3367c4,!![]];});});}else{throw new Error(_0x9454('0xb0'));}})[_0x9454('0xb1')](function(_0x271f7b,_0x7fa098){if(_0x7fa098){return _0x271f7b;}return db[_0x9454('0x9c')][_0x9454('0x68')]({'direction':_0x9454('0xb2'),'read':![],'body':_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0][_0x9454('0xae')],'FaxAccountId':_0x499a2e['id'],'FaxInteractionId':_0x271f7b['id'],'UserId':_0x26c1ae[_0x9454('0x55')]['id'],'ContactId':_0x271f7b[_0x9454('0xb3')],'AttachmentId':_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0]['id']})['then'](function(_0x14b3f3){_0x271f7b[_0x9454('0xb4')][_0x9454('0xaf')]=[];_0x271f7b['dataValues'][_0x9454('0xaf')]['push'](_0x14b3f3[_0x9454('0xb4')]);return _0x271f7b;});})['then'](function(_0xf04499){respondWithRpcPromise(_0x9454('0xb5'),_0x9454('0xb5'),{'FaxAccountId':_[_0x9454('0xa9')](_0x26c1ae['params']['id'])?undefined:_0x26c1ae['params']['id'],'path':_['isNil'](_0x26c1ae[_0x9454('0x5b')][_0x9454('0xa5')][0x0]['path'])?undefined:_0x26c1ae[_0x9454('0x5b')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x26c1ae[_0x9454('0x5b')]['to'][0x0])?undefined:_0x26c1ae[_0x9454('0x5b')]['to'][0x0],'AttachmentId':_0x26c1ae[_0x9454('0x5b')]['attachments'][0x0]['id']},client9002)[_0x9454('0x2e')](function(_0x2986f4){logger[_0x9454('0x1b')]('SendFaxRpc,\x20%s',_0x2986f4);})[_0x9454('0x23')](function(_0x3538dd){logger[_0x9454('0x1b')](_0x9454('0xb6'),_0x3538dd);});return _0xf04499;})[_0x9454('0x2e')](respondWithResult(_0x5505b7,null))[_0x9454('0x23')](handleError(_0x5505b7,null));};exports['addAgents']=function(_0xe45e55,_0x54c0a1,_0x287cbf){return db[_0x9454('0x4c')][_0x9454('0x54')]({'where':{'id':_0xe45e55[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x54c0a1,null))[_0x9454('0x2e')](function(_0x5c06b8){if(_0x5c06b8){return _0x5c06b8['addAgents'](_0xe45e55['body']['ids'],_['omit'](_0xe45e55[_0x9454('0x5b')],['ids','id'])||{})[_0x9454('0xb1')](function(_0x267bd4){for(var _0x31ab10=0x0;_0x31ab10<_0xe45e55[_0x9454('0x5b')]['ids'][_0x9454('0x53')];_0x31ab10+=0x1){socket[_0x9454('0xb7')](_0x9454('0xb8'),{'UserId':_0xe45e55[_0x9454('0x5b')][_0x9454('0x6d')][_0x31ab10],'FaxAccountId':_0xe45e55[_0x9454('0x51')]['id']});}return _0x267bd4;});}})['then'](respondWithResult(_0x54c0a1,null))[_0x9454('0x23')](handleError(_0x54c0a1,null));};exports[_0x9454('0xb9')]=function(_0x55326d,_0x4bdad1,_0x272a69){return db['FaxAccount'][_0x9454('0x54')]({'where':{'id':_0x55326d[_0x9454('0x51')]['id']}})[_0x9454('0x2e')](handleEntityNotFound(_0x4bdad1,null))[_0x9454('0x2e')](function(_0x22f7d0){if(_0x22f7d0){return _0x22f7d0['removeAgents'](_0x55326d[_0x9454('0x3c')][_0x9454('0x6d')])[_0x9454('0x2e')](function(){if(_['isArray'](_0x55326d[_0x9454('0x3c')][_0x9454('0x6d')])){for(var _0x5b722f=0x0;_0x5b722f<_0x55326d[_0x9454('0x3c')][_0x9454('0x6d')]['length'];_0x5b722f+=0x1){socket[_0x9454('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x55326d[_0x9454('0x3c')][_0x9454('0x6d')][_0x5b722f]),'FaxAccountId':Number(_0x55326d[_0x9454('0x51')]['id'])});}}else{socket[_0x9454('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x55326d[_0x9454('0x3c')][_0x9454('0x6d')]),'FaxAccountId':Number(_0x55326d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4bdad1,null))[_0x9454('0x23')](handleError(_0x4bdad1,null));};exports[_0x9454('0xba')]=function(_0x4a6e64,_0x2cf704,_0x1c17ba){var _0x5e2163={};var _0x197954={};var _0x351120;var _0x1e662d;return db[_0x9454('0x4c')][_0x9454('0x61')]({'where':{'id':_0x4a6e64[_0x9454('0x51')]['id']}})['then'](handleEntityNotFound(_0x2cf704,null))[_0x9454('0x2e')](function(_0x58b8e9){if(_0x58b8e9){_0x351120=_0x58b8e9;_0x197954[_0x9454('0x3a')]=_[_0x9454('0x3b')](db[_0x9454('0x71')][_0x9454('0x39')]);_0x197954['query']=_['keys'](_0x4a6e64['query']);_0x197954['filters']=_[_0x9454('0x52')](_0x197954[_0x9454('0x3a')],_0x197954['query']);_0x5e2163[_0x9454('0x3e')]=_[_0x9454('0x52')](_0x197954['model'],qs['fields'](_0x4a6e64[_0x9454('0x3c')][_0x9454('0x3f')]));_0x5e2163[_0x9454('0x3e')]=_0x5e2163[_0x9454('0x3e')][_0x9454('0x53')]?_0x5e2163[_0x9454('0x3e')]:_0x197954['model'];_0x5e2163[_0x9454('0x41')]=qs[_0x9454('0x42')](_0x4a6e64[_0x9454('0x3c')][_0x9454('0x42')]);_0x5e2163[_0x9454('0x43')]=qs[_0x9454('0x3d')](_[_0x9454('0x44')](_0x4a6e64['query'],_0x197954[_0x9454('0x3d')]));if(_0x4a6e64[_0x9454('0x3c')][_0x9454('0x45')]){_0x5e2163[_0x9454('0x43')]=_[_0x9454('0x4a')](_0x5e2163['where'],{'$or':_[_0x9454('0x46')](_0x5e2163[_0x9454('0x3e')],function(_0x43c93f){var _0x3b2635={};_0x3b2635[_0x43c93f]={'$like':'%'+_0x4a6e64[_0x9454('0x3c')][_0x9454('0x45')]+'%'};return _0x3b2635;})});}_0x5e2163=_[_0x9454('0x4a')]({},_0x5e2163,_0x4a6e64[_0x9454('0x4b')]);return _0x351120['getAgents'](_0x5e2163);}})[_0x9454('0x2e')](function(_0x565c8e){if(_0x565c8e){_0x1e662d=_0x565c8e[_0x9454('0x53')];if(!_0x4a6e64[_0x9454('0x3c')][_0x9454('0x40')](_0x9454('0x62'))){_0x5e2163[_0x9454('0x27')]=qs[_0x9454('0x27')](_0x4a6e64[_0x9454('0x3c')][_0x9454('0x27')]);_0x5e2163['offset']=qs[_0x9454('0x26')](_0x4a6e64[_0x9454('0x3c')][_0x9454('0x26')]);}return _0x351120[_0x9454('0xba')](_0x5e2163);}})[_0x9454('0x2e')](function(_0x50cb7e){if(_0x50cb7e){return _0x50cb7e?{'count':_0x1e662d,'rows':_0x50cb7e}:null;}})[_0x9454('0x2e')](respondWithResult(_0x2cf704,null))[_0x9454('0x23')](handleError(_0x2cf704,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index f534783..4275b04 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 _0x76e2=['update','remove','emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x76e2,0x105));var _0x276e=function(_0x2e4ee7,_0x4bdc11){_0x2e4ee7=_0x2e4ee7-0x0;var _0x49e2e8=_0x76e2[_0x2e4ee7];return _0x49e2e8;};'use strict';var EventEmitter=require(_0x276e('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x276e('0x1')](0x0);var events={'afterCreate':_0x276e('0x2'),'afterUpdate':_0x276e('0x3'),'afterDestroy':_0x276e('0x4')};function emitEvent(_0x44ba1b){return function(_0x522868,_0x3eb354,_0x912349){FaxAccountEvents['emit'](_0x44ba1b+':'+_0x522868['id'],_0x522868);FaxAccountEvents[_0x276e('0x5')](_0x44ba1b,_0x522868);_0x912349(null);};}for(var e in events){if(events[_0x276e('0x6')](e)){var event=events[e];FaxAccount[_0x276e('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x082d=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x082d,0xef));var _0xd082=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x082d[_0x1cb18a];return _0x22442e;};'use strict';var EventEmitter=require(_0xd082('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd082('0x1')](0x0);var events={'afterCreate':_0xd082('0x2'),'afterUpdate':_0xd082('0x3'),'afterDestroy':'remove'};function emitEvent(_0x36c521){return function(_0x386248,_0x2b8460,_0xa43c7a){FaxAccountEvents['emit'](_0x36c521+':'+_0x386248['id'],_0x386248);FaxAccountEvents[_0xd082('0x4')](_0x36c521,_0x386248);_0xa43c7a(null);};}for(var e in events){if(events[_0xd082('0x5')](e)){var event=events[e];FaxAccount[_0xd082('0x6')](e,emitEvent(event));}}module[_0xd082('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index db2acce..b8e04e9 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 _0x133b=['path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x133b,0x7c));var _0xb133=function(_0x22253c,_0xff5f0b){_0x22253c=_0x22253c-0x0;var _0x40b47a=_0x133b[_0x22253c];return _0x40b47a;};'use strict';var _=require('lodash');var util=require(_0xb133('0x0'));var logger=require(_0xb133('0x1'))(_0xb133('0x2'));var moment=require(_0xb133('0x3'));var BPromise=require(_0xb133('0x4'));var rp=require(_0xb133('0x5'));var fs=require('fs');var path=require(_0xb133('0x6'));var rimraf=require('rimraf');var config=require(_0xb133('0x7'));var attributes=require(_0xb133('0x8'));module[_0xb133('0x9')]=function(_0x57a98d,_0x1417a6){return _0x57a98d[_0xb133('0xa')](_0xb133('0xb'),attributes,{'tableName':_0xb133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf576=['api','moment','path','rimraf','../../config/environment','exports','FaxAccount','fax_accounts','lodash','util','../../config/logger'];(function(_0x4c5a12,_0x5b08ab){var _0x59947c=function(_0x5f0565){while(--_0x5f0565){_0x4c5a12['push'](_0x4c5a12['shift']());}};_0x59947c(++_0x5b08ab);}(_0xf576,0xef));var _0x6f57=function(_0x442ad8,_0x3a6414){_0x442ad8=_0x442ad8-0x0;var _0x36113b=_0xf576[_0x442ad8];return _0x36113b;};'use strict';var _=require(_0x6f57('0x0'));var util=require(_0x6f57('0x1'));var logger=require(_0x6f57('0x2'))(_0x6f57('0x3'));var moment=require(_0x6f57('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f57('0x5'));var rimraf=require(_0x6f57('0x6'));var config=require(_0x6f57('0x7'));var attributes=require('./faxAccount.attributes');module[_0x6f57('0x8')]=function(_0x455a27,_0x50edc1){return _0x455a27['define'](_0x6f57('0x9'),attributes,{'tableName':_0x6f57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index b4caaa4..8c2577b 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 _0x9333=['DESC','List','list','applications','orderBy','asc','Applications','length','defaults','create','contact','FaxInteraction','find','Contact\x20not\x20found','get','autoclose','push','close','created','interaction','FaxMessage','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','model','map','catch','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x9333,0x122));var _0x3933=function(_0x5486e9,_0x25d7e7){_0x5486e9=_0x5486e9-0x0;var _0x99a416=_0x9333[_0x5486e9];return _0x99a416;};'use strict';var _=require(_0x3933('0x0'));var util=require(_0x3933('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3933('0x2'));var fs=require('fs');var Redis=require(_0x3933('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3933('0x4'))(_0x3933('0x5'));var config=require(_0x3933('0x6'));var jayson=require(_0x3933('0x7'));var client=jayson[_0x3933('0x8')]['http']({'port':0x232c});config[_0x3933('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3933('0xa'))(new Redis(config[_0x3933('0x9')]));require(_0x3933('0xb'))[_0x3933('0xc')](socket);function respondWithRpcPromise(_0x4467a7,_0x5c5e7d,_0x1b66ce){return new BPromise(function(_0x592dae,_0x2a6608){return client[_0x3933('0xd')](_0x4467a7,_0x1b66ce)[_0x3933('0xe')](function(_0x3f81f8){logger[_0x3933('0xf')](_0x3933('0x10'),_0x5c5e7d,_0x3933('0x11'));logger[_0x3933('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5c5e7d,'request\x20sent',JSON['stringify'](_0x3f81f8));if(_0x3f81f8['error']){if(_0x3f81f8[_0x3933('0x13')][_0x3933('0x14')]===0x1f4){logger[_0x3933('0x13')]('FaxAccount,\x20%s,\x20%s',_0x5c5e7d,_0x3f81f8[_0x3933('0x13')][_0x3933('0x15')]);return _0x2a6608(_0x3f81f8[_0x3933('0x13')][_0x3933('0x15')]);}logger[_0x3933('0x13')](_0x3933('0x10'),_0x5c5e7d,_0x3f81f8[_0x3933('0x13')]['message']);return _0x592dae(_0x3f81f8[_0x3933('0x13')][_0x3933('0x15')]);}else{logger[_0x3933('0xf')]('FaxAccount,\x20%s,\x20%s',_0x5c5e7d,_0x3933('0x11'));_0x592dae(_0x3f81f8[_0x3933('0x16')][_0x3933('0x15')]);}})['catch'](function(_0x1d0763){logger['error'](_0x3933('0x10'),_0x5c5e7d,_0x1d0763);_0x2a6608(_0x1d0763);});});}exports[_0x3933('0x17')]=function(_0x4a7761){var _0x196710=this;return new Promise(function(_0x57ee90,_0x371ab6){return db[_0x3933('0x18')][_0x3933('0x19')]({'raw':_0x4a7761[_0x3933('0x1a')]?_0x4a7761['options'][_0x3933('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a7761['options']?_0x4a7761[_0x3933('0x1a')][_0x3933('0x1c')]||null:null,'attributes':_0x4a7761[_0x3933('0x1a')]?_0x4a7761[_0x3933('0x1a')][_0x3933('0x1d')]||null:null,'limit':_0x4a7761[_0x3933('0x1a')]?_0x4a7761[_0x3933('0x1a')]['limit']||null:null,'include':_0x4a7761[_0x3933('0x1a')]?_0x4a7761[_0x3933('0x1a')][_0x3933('0x1e')]?_['map'](_0x4a7761[_0x3933('0x1a')][_0x3933('0x1e')],function(_0x42ee82){return{'model':db[_0x42ee82[_0x3933('0x1f')]],'as':_0x42ee82['as'],'attributes':_0x42ee82[_0x3933('0x1d')],'include':_0x42ee82['include']?_[_0x3933('0x20')](_0x42ee82['include'],function(_0x3940e9){return{'model':db[_0x3940e9[_0x3933('0x1f')]],'as':_0x3940e9['as'],'attributes':_0x3940e9[_0x3933('0x1d')],'include':_0x3940e9[_0x3933('0x1e')]?_[_0x3933('0x20')](_0x3940e9[_0x3933('0x1e')],function(_0x296521){return{'model':db[_0x296521[_0x3933('0x1f')]],'as':_0x296521['as'],'attributes':_0x296521[_0x3933('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3933('0xe')](function(_0x4598bb){logger[_0x3933('0xf')](_0x3933('0x17'),_0x4a7761);logger[_0x3933('0x12')](_0x3933('0x17'),_0x4a7761,JSON['stringify'](_0x4598bb));_0x57ee90(_0x4598bb);})[_0x3933('0x21')](function(_0x365c9c){logger[_0x3933('0x13')](_0x3933('0x17'),_0x365c9c['message'],_0x4a7761);_0x371ab6(_0x196710[_0x3933('0x13')](0x1f4,_0x365c9c[_0x3933('0x15')]));});});};exports[_0x3933('0x22')]=function(_0x4db8aa,_0x11963d,_0x584d29){var _0x6a780c=this;return new Promise(function(_0x1ad9a5,_0x3ff333){var _0x21b69f={'body':_0x4db8aa['body'],'channel':_0x3933('0x23')};var _0x5b05a6=[];var _0x516d38=[];var _0x37999a={};return db[_0x3933('0x24')][_0x3933('0x25')]()['then'](function(_0x3a86f9){if(!_0x3a86f9){throw new db[(_0x3933('0x26'))][(_0x3933('0x27'))](_0x3933('0x28'));}_0x5b05a6=_['difference'](_[_0x3933('0x29')](_0x3a86f9),[_0x3933('0x2a'),_0x3933('0x2b')]);_0x516d38=_[_0x3933('0x2c')](_[_0x3933('0x29')](_0x3a86f9),[_0x3933('0x2a'),_0x3933('0x2b'),_0x3933('0x2d'),_0x3933('0x2e')]);if(_0x4db8aa['body']['id']){delete _0x4db8aa[_0x3933('0x2f')]['id'];}if(_[_0x3933('0x30')](_0x4db8aa[_0x3933('0x2f')][_0x3933('0x31')])){throw new db[(_0x3933('0x26'))][(_0x3933('0x27'))](_0x3933('0x32'));}if(_[_0x3933('0x30')](_0x4db8aa[_0x3933('0x2f')]['body'])||_0x4db8aa['body']['body']===''){throw new db[(_0x3933('0x26'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4db8aa['body']['mapKey'])){throw new db['Sequelize'][(_0x3933('0x27'))](_0x3933('0x33')+_0x516d38);}if(!_[_0x3933('0x34')](_0x516d38,_0x4db8aa[_0x3933('0x2f')][_0x3933('0x35')])){throw new db['Sequelize'][(_0x3933('0x27'))](_0x3933('0x36')+_0x516d38);}_0x37999a[_0x4db8aa[_0x3933('0x2f')][_0x3933('0x35')]]=_0x4db8aa[_0x3933('0x2f')][_0x3933('0x31')];})[_0x3933('0xe')](function(){return db[_0x3933('0x18')]['find']({'where':{'id':_0x4db8aa[_0x3933('0x37')]['id']},'include':[{'model':db[_0x3933('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3933('0x39'),'where':_0x37999a,'limit':0x1,'order':[[_0x3933('0x2b'),_0x3933('0x3a')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x3933('0xe')](function(_0x59d86b){if(_0x59d86b&&_0x59d86b[_0x3933('0x3b')]){var _0x476d34=_0x59d86b['get']({'plain':!![]});_0x21b69f[_0x3933('0x37')]=_0x476d34;_0x21b69f['applications']=_0x476d34['Applications'];_0x21b69f[_0x3933('0x3c')]=_0x476d34[_0x3933('0x3b')];_0x21b69f[_0x3933('0x3d')]=_[_0x3933('0x3e')](_0x21b69f[_0x3933('0x3d')],['priority'],[_0x3933('0x3f')]);if(_0x21b69f[_0x3933('0x37')][_0x3933('0x40')]){delete _0x21b69f[_0x3933('0x37')][_0x3933('0x40')];}if(_0x21b69f[_0x3933('0x37')][_0x3933('0x3b')]&&_0x21b69f['account']['List']['Contacts'][_0x3933('0x41')]){return _0x21b69f[_0x3933('0x37')][_0x3933('0x3b')][_0x3933('0x39')][0x0];}var _0x42c15c=_[_0x3933('0x42')](_0x4db8aa['body'],{'firstName':_0x4db8aa['body'][_0x3933('0x31')],'ListId':_0x476d34[_0x3933('0x2e')]});_0x42c15c[_0x4db8aa[_0x3933('0x2f')]['mapKey']]=_0x4db8aa[_0x3933('0x2f')][_0x3933('0x31')];return db[_0x3933('0x24')][_0x3933('0x43')](_0x42c15c,{'fields':_0x5b05a6,'raw':!![]});}})['then'](function(_0x213a83){_0x21b69f[_0x3933('0x44')]=_0x213a83;if(_0x213a83){var _0x234dde={'ContactId':_0x213a83['id'],'FaxAccountId':_0x4db8aa[_0x3933('0x37')]['id'],'fax':_0x213a83[_0x3933('0x23')]};return db[_0x3933('0x45')][_0x3933('0x46')]({'where':{'ContactId':_0x213a83['id'],'closed':![],'FaxAccountId':_0x4db8aa[_0x3933('0x37')]['id']}})[_0x3933('0xe')](function(_0x50ef60){if(_0x50ef60){return[_0x50ef60,![]];}return db[_0x3933('0x45')][_0x3933('0x43')](_0x234dde)['then'](function(_0x2e6e18){return[_0x2e6e18,!![]];});});}else{throw new Error(_0x3933('0x47'));}})['spread'](function(_0x4cb1c9,_0x438ffe){var _0x4804f3=_0x4cb1c9[_0x3933('0x48')]({'plain':!![]});if(_0x438ffe){if(_0x21b69f['account'][_0x3933('0x49')]){_0x21b69f[_0x3933('0x3d')][_0x3933('0x4a')]({'id':0x0,'priority':_0x21b69f['applications']['length']+0x1,'app':_0x3933('0x4b'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x4804f3[_0x3933('0x4c')]=!![];}else{_0x4804f3[_0x3933('0x4c')]=![];}_0x21b69f[_0x3933('0x4d')]=_0x4804f3;return db[_0x3933('0x4e')]['create']({'body':_0x4db8aa[_0x3933('0x2f')][_0x3933('0x2f')],'FaxAccountId':_0x4db8aa[_0x3933('0x37')]['id'],'FaxInteractionId':_0x4cb1c9['id'],'direction':'in','ContactId':_0x4cb1c9['ContactId'],'AttachmentId':_0x4db8aa[_0x3933('0x2f')]['AttachmentId']});})[_0x3933('0xe')](function(_0x277b3c){_0x21b69f['message']=_0x277b3c;if(_0x21b69f[_0x3933('0x4d')][_0x3933('0x4f')]){return db[_0x3933('0x50')][_0x3933('0x46')]({'attributes':['id',_0x3933('0x51')],'where':{'id':_0x21b69f[_0x3933('0x4d')]['UserId']}})[_0x3933('0xe')](function(_0x4d8c42){if(_0x4d8c42){_0x21b69f[_0x3933('0x3d')][_0x3933('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4d8c42[_0x3933('0x51')]+','+(_0x21b69f[_0x3933('0x37')][_0x3933('0x53')]||0xa),'interval':_0x3933('0x54')});}return respondWithRpcPromise(_0x3933('0x55'),_0x3933('0x56'),_0x21b69f);});}return respondWithRpcPromise('Start',_0x3933('0x56'),_0x21b69f);})[_0x3933('0xe')](function(_0x14758d){_0x1ad9a5(_0x14758d);})['catch'](function(_0x4c4cfb){_0x3ff333(_0x6a780c[_0x3933('0x13')](0x1f4,_0x4c4cfb[_0x3933('0x15')]));});});}; \ No newline at end of file +var _0xdbfd=['keys','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','account','length','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','limit','include','map','model','info','GetFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes'];(function(_0x1d1635,_0x4fa36f){var _0x3d032c=function(_0x496fe7){while(--_0x496fe7){_0x1d1635['push'](_0x1d1635['shift']());}};_0x3d032c(++_0x4fa36f);}(_0xdbfd,0x18b));var _0xddbf=function(_0x376dc4,_0x508034){_0x376dc4=_0x376dc4-0x0;var _0x3a9560=_0xdbfd[_0x376dc4];return _0x3a9560;};'use strict';var _=require(_0xddbf('0x0'));var util=require(_0xddbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddbf('0x2'));var db=require(_0xddbf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xddbf('0x4'))(_0xddbf('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xddbf('0x6')][_0xddbf('0x7')]({'port':0x232c});config['redis']=_[_0xddbf('0x8')](config[_0xddbf('0x9')],{'host':_0xddbf('0xa'),'port':0x18eb});var socket=require(_0xddbf('0xb'))(new Redis(config[_0xddbf('0x9')]));require('./faxAccount.socket')[_0xddbf('0xc')](socket);function respondWithRpcPromise(_0x5e8145,_0x958ab9,_0x5ae6cb){return new BPromise(function(_0x3505ee,_0x480c1b){return client[_0xddbf('0xd')](_0x5e8145,_0x5ae6cb)[_0xddbf('0xe')](function(_0x4e5f3e){logger['info'](_0xddbf('0xf'),_0x958ab9,_0xddbf('0x10'));logger[_0xddbf('0x11')](_0xddbf('0x12'),_0x958ab9,_0xddbf('0x10'),JSON[_0xddbf('0x13')](_0x4e5f3e));if(_0x4e5f3e[_0xddbf('0x14')]){if(_0x4e5f3e[_0xddbf('0x14')][_0xddbf('0x15')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x958ab9,_0x4e5f3e[_0xddbf('0x14')][_0xddbf('0x16')]);return _0x480c1b(_0x4e5f3e['error'][_0xddbf('0x16')]);}logger[_0xddbf('0x14')](_0xddbf('0xf'),_0x958ab9,_0x4e5f3e[_0xddbf('0x14')][_0xddbf('0x16')]);return _0x3505ee(_0x4e5f3e[_0xddbf('0x14')]['message']);}else{logger['info'](_0xddbf('0xf'),_0x958ab9,_0xddbf('0x10'));_0x3505ee(_0x4e5f3e[_0xddbf('0x17')]['message']);}})[_0xddbf('0x18')](function(_0x344bfd){logger[_0xddbf('0x14')](_0xddbf('0xf'),_0x958ab9,_0x344bfd);_0x480c1b(_0x344bfd);});});}exports['GetFaxAccount']=function(_0x1cd9b9){var _0x492d3f=this;return new Promise(function(_0x4ac8bb,_0x39ea8e){return db['FaxAccount']['findAll']({'raw':_0x1cd9b9[_0xddbf('0x19')]?_0x1cd9b9[_0xddbf('0x19')][_0xddbf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cd9b9['options']?_0x1cd9b9[_0xddbf('0x19')]['where']||null:null,'attributes':_0x1cd9b9[_0xddbf('0x19')]?_0x1cd9b9['options'][_0xddbf('0x1b')]||null:null,'limit':_0x1cd9b9[_0xddbf('0x19')]?_0x1cd9b9[_0xddbf('0x19')][_0xddbf('0x1c')]||null:null,'include':_0x1cd9b9[_0xddbf('0x19')]?_0x1cd9b9[_0xddbf('0x19')][_0xddbf('0x1d')]?_[_0xddbf('0x1e')](_0x1cd9b9[_0xddbf('0x19')][_0xddbf('0x1d')],function(_0x5a1a53){return{'model':db[_0x5a1a53[_0xddbf('0x1f')]],'as':_0x5a1a53['as'],'attributes':_0x5a1a53['attributes'],'include':_0x5a1a53[_0xddbf('0x1d')]?_[_0xddbf('0x1e')](_0x5a1a53[_0xddbf('0x1d')],function(_0x642efb){return{'model':db[_0x642efb[_0xddbf('0x1f')]],'as':_0x642efb['as'],'attributes':_0x642efb[_0xddbf('0x1b')],'include':_0x642efb[_0xddbf('0x1d')]?_['map'](_0x642efb[_0xddbf('0x1d')],function(_0x56c02b){return{'model':db[_0x56c02b[_0xddbf('0x1f')]],'as':_0x56c02b['as'],'attributes':_0x56c02b[_0xddbf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xddbf('0xe')](function(_0x7a76ab){logger[_0xddbf('0x20')](_0xddbf('0x21'),_0x1cd9b9);logger[_0xddbf('0x11')](_0xddbf('0x21'),_0x1cd9b9,JSON[_0xddbf('0x13')](_0x7a76ab));_0x4ac8bb(_0x7a76ab);})[_0xddbf('0x18')](function(_0x5c1086){logger[_0xddbf('0x14')]('GetFaxAccount',_0x5c1086['message'],_0x1cd9b9);_0x39ea8e(_0x492d3f['error'](0x1f4,_0x5c1086['message']));});});};exports['NotifyFaxAccount']=function(_0x3dcf81,_0x558139,_0x1b3b5e){var _0x5bc2a6=this;return new Promise(function(_0x5ef11e,_0x2113af){var _0x2989a3={'body':_0x3dcf81[_0xddbf('0x22')],'channel':_0xddbf('0x23')};var _0x5bf562=[];var _0x244723=[];var _0x487470={};return db['CmContact'][_0xddbf('0x24')]()[_0xddbf('0xe')](function(_0x2f1032){if(!_0x2f1032){throw new db[(_0xddbf('0x25'))][(_0xddbf('0x26'))](_0xddbf('0x27'));}_0x5bf562=_['difference'](_[_0xddbf('0x28')](_0x2f1032),[_0xddbf('0x29'),_0xddbf('0x2a')]);_0x244723=_[_0xddbf('0x2b')](_[_0xddbf('0x28')](_0x2f1032),[_0xddbf('0x29'),_0xddbf('0x2a'),'CompanyId',_0xddbf('0x2c')]);if(_0x3dcf81['body']['id']){delete _0x3dcf81['body']['id'];}if(_[_0xddbf('0x2d')](_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x2e')])){throw new db[(_0xddbf('0x25'))]['ValidationError'](_0xddbf('0x2f'));}if(_['isNil'](_0x3dcf81['body'][_0xddbf('0x22')])||_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x22')]===''){throw new db['Sequelize'][(_0xddbf('0x26'))](_0xddbf('0x30'));}if(_['isNil'](_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x31')])){throw new db[(_0xddbf('0x25'))]['ValidationError'](_0xddbf('0x32')+_0x244723);}if(!_['includes'](_0x244723,_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x31')])){throw new db[(_0xddbf('0x25'))][(_0xddbf('0x26'))](_0xddbf('0x33')+_0x244723);}_0x487470[_0x3dcf81['body'][_0xddbf('0x31')]]=_0x3dcf81['body'][_0xddbf('0x2e')];})['then'](function(){return db[_0xddbf('0x34')][_0xddbf('0x35')]({'where':{'id':_0x3dcf81['account']['id']},'include':[{'model':db['CmList'],'as':_0xddbf('0x36'),'include':[{'model':db['CmContact'],'as':_0xddbf('0x37'),'where':_0x487470,'limit':0x1,'order':[['updatedAt',_0xddbf('0x38')]]}]},{'model':db[_0xddbf('0x39')],'as':_0xddbf('0x3a')}]});})['then'](function(_0x5238b7){if(_0x5238b7&&_0x5238b7[_0xddbf('0x36')]){var _0x363842=_0x5238b7[_0xddbf('0x3b')]({'plain':!![]});_0x2989a3['account']=_0x363842;_0x2989a3[_0xddbf('0x3c')]=_0x363842[_0xddbf('0x3a')];_0x2989a3[_0xddbf('0x3d')]=_0x363842[_0xddbf('0x36')];_0x2989a3[_0xddbf('0x3c')]=_[_0xddbf('0x3e')](_0x2989a3[_0xddbf('0x3c')],[_0xddbf('0x3f')],[_0xddbf('0x40')]);if(_0x2989a3[_0xddbf('0x41')][_0xddbf('0x3a')]){delete _0x2989a3[_0xddbf('0x41')]['Applications'];}if(_0x2989a3['account'][_0xddbf('0x36')]&&_0x2989a3[_0xddbf('0x41')][_0xddbf('0x36')]['Contacts'][_0xddbf('0x42')]){return _0x2989a3[_0xddbf('0x41')][_0xddbf('0x36')][_0xddbf('0x37')][0x0];}var _0x132cfe=_[_0xddbf('0x8')](_0x3dcf81[_0xddbf('0x22')],{'firstName':_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x2e')],'ListId':_0x363842[_0xddbf('0x2c')]});_0x132cfe[_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x31')]]=_0x3dcf81['body']['from'];return db[_0xddbf('0x43')][_0xddbf('0x44')](_0x132cfe,{'fields':_0x5bf562,'raw':!![]});}})[_0xddbf('0xe')](function(_0xa0a4d1){_0x2989a3[_0xddbf('0x45')]=_0xa0a4d1;if(_0xa0a4d1){var _0x4689f0={'ContactId':_0xa0a4d1['id'],'FaxAccountId':_0x3dcf81[_0xddbf('0x41')]['id'],'fax':_0xa0a4d1[_0xddbf('0x23')]};return db[_0xddbf('0x46')][_0xddbf('0x35')]({'where':{'ContactId':_0xa0a4d1['id'],'closed':![],'FaxAccountId':_0x3dcf81['account']['id']}})[_0xddbf('0xe')](function(_0x24278c){if(_0x24278c){return[_0x24278c,![]];}return db[_0xddbf('0x46')][_0xddbf('0x44')](_0x4689f0)[_0xddbf('0xe')](function(_0x1747f3){return[_0x1747f3,!![]];});});}else{throw new Error(_0xddbf('0x47'));}})[_0xddbf('0x48')](function(_0x5bdffb,_0x4eb4f8){var _0x406650=_0x5bdffb[_0xddbf('0x3b')]({'plain':!![]});if(_0x4eb4f8){if(_0x2989a3[_0xddbf('0x41')]['autoclose']){_0x2989a3[_0xddbf('0x3c')]['push']({'id':0x0,'priority':_0x2989a3[_0xddbf('0x3c')][_0xddbf('0x42')]+0x1,'app':_0xddbf('0x49'),'appdata':_0xddbf('0x4a'),'interval':'*,*,*,*'});}_0x406650['created']=!![];}else{_0x406650[_0xddbf('0x4b')]=![];}_0x2989a3[_0xddbf('0x4c')]=_0x406650;return db[_0xddbf('0x4d')][_0xddbf('0x44')]({'body':_0x3dcf81[_0xddbf('0x22')]['body'],'FaxAccountId':_0x3dcf81[_0xddbf('0x41')]['id'],'FaxInteractionId':_0x5bdffb['id'],'direction':'in','ContactId':_0x5bdffb[_0xddbf('0x4e')],'AttachmentId':_0x3dcf81[_0xddbf('0x22')][_0xddbf('0x4f')]});})[_0xddbf('0xe')](function(_0x17fb65){_0x2989a3[_0xddbf('0x16')]=_0x17fb65;if(_0x2989a3[_0xddbf('0x4c')]['UserId']){return db['User'][_0xddbf('0x35')]({'attributes':['id','name'],'where':{'id':_0x2989a3[_0xddbf('0x4c')][_0xddbf('0x50')]}})[_0xddbf('0xe')](function(_0x41c91e){if(_0x41c91e){_0x2989a3['applications'][_0xddbf('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x41c91e[_0xddbf('0x52')]+','+(_0x2989a3[_0xddbf('0x41')][_0xddbf('0x53')]||0xa),'interval':_0xddbf('0x54')});}return respondWithRpcPromise(_0xddbf('0x55'),_0xddbf('0x56'),_0x2989a3);});}return respondWithRpcPromise(_0xddbf('0x55'),_0xddbf('0x56'),_0x2989a3);})[_0xddbf('0xe')](function(_0x4cfd67){_0x5ef11e(_0x4cfd67);})['catch'](function(_0x8e1b6b){_0x2113af(_0x5bc2a6['error'](0x1f4,_0x8e1b6b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9fecae7..2e497e2 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 _0x945d=['faxAccount:','./faxAccount.events','save','remove','emit','removeListener','length'];(function(_0x6e0aad,_0x3c0d9f){var _0x6e6ef0=function(_0x13ef8b){while(--_0x13ef8b){_0x6e0aad['push'](_0x6e0aad['shift']());}};_0x6e6ef0(++_0x3c0d9f);}(_0x945d,0xa2));var _0xd945=function(_0x2b6225,_0x1d0680){_0x2b6225=_0x2b6225-0x0;var _0x1906d5=_0x945d[_0x2b6225];return _0x1906d5;};'use strict';var FaxAccountEvents=require(_0xd945('0x0'));var events=[_0xd945('0x1'),_0xd945('0x2'),'update'];function createListener(_0x4412d7,_0x5ccca5){return function(_0x565a5a){_0x5ccca5[_0xd945('0x3')](_0x4412d7,_0x565a5a);};}function removeListener(_0x796eed,_0xc721b4){return function(){FaxAccountEvents[_0xd945('0x4')](_0x796eed,_0xc721b4);};}exports['register']=function(_0x41caeb){for(var _0x4ca6f8=0x0,_0x2b4651=events[_0xd945('0x5')];_0x4ca6f8<_0x2b4651;_0x4ca6f8++){var _0x53eb06=events[_0x4ca6f8];var _0xc98299=createListener(_0xd945('0x6')+_0x53eb06,_0x41caeb);FaxAccountEvents['on'](_0x53eb06,_0xc98299);}}; \ No newline at end of file +var _0x799e=['./faxAccount.events','save','remove','emit','removeListener','register','length','faxAccount:'];(function(_0x7c447b,_0x436468){var _0x50cdc5=function(_0x46a017){while(--_0x46a017){_0x7c447b['push'](_0x7c447b['shift']());}};_0x50cdc5(++_0x436468);}(_0x799e,0x1c8));var _0xe799=function(_0x2228f5,_0x7b1579){_0x2228f5=_0x2228f5-0x0;var _0x5ce069=_0x799e[_0x2228f5];return _0x5ce069;};'use strict';var FaxAccountEvents=require(_0xe799('0x0'));var events=[_0xe799('0x1'),_0xe799('0x2'),'update'];function createListener(_0x5dd098,_0x31cdf9){return function(_0x352abe){_0x31cdf9[_0xe799('0x3')](_0x5dd098,_0x352abe);};}function removeListener(_0x14b2dd,_0x44a703){return function(){FaxAccountEvents[_0xe799('0x4')](_0x14b2dd,_0x44a703);};}exports[_0xe799('0x5')]=function(_0x5a57e7){for(var _0x29a0bb=0x0,_0x12eee3=events[_0xe799('0x6')];_0x29a0bb<_0x12eee3;_0x29a0bb++){var _0x305223=events[_0x29a0bb];var _0x4b60c5=createListener(_0xe799('0x7')+_0x305223,_0x5a57e7);FaxAccountEvents['on'](_0x305223,_0x4b60c5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 583efca..a0e9366 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 _0xca34=['/:id/messages','getMessages','/:id/users','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','get','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xca34,0x134));var _0x4ca3=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xca34[_0x47b58b];return _0x46bebe;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4ca3('0x0'));var express=require(_0x4ca3('0x1'));var router=express[_0x4ca3('0x2')]();var auth=require(_0x4ca3('0x3'));var interaction=require(_0x4ca3('0x4'));var config=require(_0x4ca3('0x5'));var controller=require(_0x4ca3('0x6'));router['get']('/',auth[_0x4ca3('0x7')](),controller['index']);router['get'](_0x4ca3('0x8'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x9')]);router['get'](_0x4ca3('0xa'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0xb')]);router['get'](_0x4ca3('0xc'),auth['isAuthenticated'](),controller[_0x4ca3('0xd')]);router[_0x4ca3('0xe')](_0x4ca3('0xf'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x10')]);router[_0x4ca3('0xe')](_0x4ca3('0x11'),auth['isAuthenticated'](),controller[_0x4ca3('0x12')]);router[_0x4ca3('0xe')](_0x4ca3('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0x4ca3('0xe')](_0x4ca3('0x14'),auth['isAuthenticated'](),controller[_0x4ca3('0x15')]);router[_0x4ca3('0xe')](_0x4ca3('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x4ca3('0x17')]('/',auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x18')]);router[_0x4ca3('0x17')](_0x4ca3('0xc'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x19')]);router['post'](_0x4ca3('0xf'),auth['isAuthenticated'](),controller[_0x4ca3('0x1a')]);router[_0x4ca3('0x17')]('/:id/interactions',auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x1b')]);router[_0x4ca3('0x17')]('/:id/applications',auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x1c')]);router['post'](_0x4ca3('0x1d'),auth['isAuthenticated'](),controller[_0x4ca3('0x1e')]);router[_0x4ca3('0x17')](_0x4ca3('0x1f'),auth['isAuthenticated'](),controller[_0x4ca3('0x20')]);router['post']('/:id/send',auth[_0x4ca3('0x7')](),controller['send']);router['post'](_0x4ca3('0x16'),auth[_0x4ca3('0x7')](),controller['addAgents']);router[_0x4ca3('0x21')]('/:id',auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x22')]);router[_0x4ca3('0x23')](_0x4ca3('0xa'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x24')]);router['delete'](_0x4ca3('0xc'),auth['isAuthenticated'](),controller[_0x4ca3('0x25')]);router[_0x4ca3('0x23')](_0x4ca3('0xf'),auth['isAuthenticated'](),controller[_0x4ca3('0x26')]);router[_0x4ca3('0x23')](_0x4ca3('0x16'),auth[_0x4ca3('0x7')](),controller[_0x4ca3('0x27')]);module[_0x4ca3('0x28')]=router; \ No newline at end of file +var _0x804c=['addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','delete','destroy','removeDispositions','removeAgents','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','getMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer'];(function(_0x3210ba,_0x506845){var _0x4c4a15=function(_0xa5efa9){while(--_0xa5efa9){_0x3210ba['push'](_0x3210ba['shift']());}};_0x4c4a15(++_0x506845);}(_0x804c,0x13d));var _0xc804=function(_0x1af288,_0x20a015){_0x1af288=_0x1af288-0x0;var _0x5a0c7d=_0x804c[_0x1af288];return _0x5a0c7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc804('0x0'));var timeout=require(_0xc804('0x1'));var express=require('express');var router=express[_0xc804('0x2')]();var auth=require(_0xc804('0x3'));var interaction=require(_0xc804('0x4'));var config=require('../../config/environment');var controller=require(_0xc804('0x5'));router['get']('/',auth[_0xc804('0x6')](),controller[_0xc804('0x7')]);router[_0xc804('0x8')](_0xc804('0x9'),auth[_0xc804('0x6')](),controller[_0xc804('0xa')]);router[_0xc804('0x8')](_0xc804('0xb'),auth[_0xc804('0x6')](),controller[_0xc804('0xc')]);router[_0xc804('0x8')](_0xc804('0xd'),auth[_0xc804('0x6')](),controller['getDispositions']);router[_0xc804('0x8')](_0xc804('0xe'),auth[_0xc804('0x6')](),controller[_0xc804('0xf')]);router[_0xc804('0x8')](_0xc804('0x10'),auth[_0xc804('0x6')](),controller['getInteractions']);router[_0xc804('0x8')]('/:id/applications',auth[_0xc804('0x6')](),controller[_0xc804('0x11')]);router['get']('/:id/messages',auth[_0xc804('0x6')](),controller[_0xc804('0x12')]);router[_0xc804('0x8')](_0xc804('0x13'),auth[_0xc804('0x6')](),controller[_0xc804('0x14')]);router['post']('/',auth[_0xc804('0x6')](),controller[_0xc804('0x15')]);router[_0xc804('0x16')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc804('0x17')]);router['post'](_0xc804('0xe'),auth[_0xc804('0x6')](),controller[_0xc804('0x18')]);router[_0xc804('0x16')](_0xc804('0x10'),auth[_0xc804('0x6')](),controller[_0xc804('0x19')]);router['post'](_0xc804('0x1a'),auth[_0xc804('0x6')](),controller[_0xc804('0x1b')]);router[_0xc804('0x16')](_0xc804('0x1c'),auth[_0xc804('0x6')](),controller[_0xc804('0x1d')]);router[_0xc804('0x16')](_0xc804('0x1e'),auth[_0xc804('0x6')](),controller['updateAccountApplications']);router['post'](_0xc804('0x1f'),auth[_0xc804('0x6')](),controller[_0xc804('0x20')]);router[_0xc804('0x16')](_0xc804('0x13'),auth[_0xc804('0x6')](),controller[_0xc804('0x21')]);router['put'](_0xc804('0xb'),auth[_0xc804('0x6')](),controller['update']);router[_0xc804('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xc804('0x23')]);router[_0xc804('0x22')](_0xc804('0xd'),auth[_0xc804('0x6')](),controller[_0xc804('0x24')]);router[_0xc804('0x22')](_0xc804('0xe'),auth[_0xc804('0x6')](),controller['removeAnswers']);router[_0xc804('0x22')](_0xc804('0x13'),auth[_0xc804('0x6')](),controller[_0xc804('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 387b3d1..4dd3bc9 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 _0x8a2a=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x8a2a,0x11f));var _0xa8a2=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x8a2a[_0x54edc9];return _0x2ae7a9;};'use strict';var Sequelize=require('sequelize');module[_0xa8a2('0x0')]={'priority':{'type':Sequelize[_0xa8a2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa8a2('0x2')],'allowNull':![],'defaultValue':_0xa8a2('0x3')},'appdata':{'type':Sequelize[_0xa8a2('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa8a2('0x2')],'defaultValue':_0xa8a2('0x5')}}; \ No newline at end of file +var _0x7a2f=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1a287a,_0x3ec6e7){var _0x5c3dbd=function(_0x15f0f5){while(--_0x15f0f5){_0x1a287a['push'](_0x1a287a['shift']());}};_0x5c3dbd(++_0x3ec6e7);}(_0x7a2f,0x99));var _0xf7a2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a2f[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xf7a2('0x0'));module[_0xf7a2('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf7a2('0x2')],'allowNull':![],'defaultValue':_0xf7a2('0x3')},'appdata':{'type':Sequelize[_0xf7a2('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf7a2('0x2')],'defaultValue':_0xf7a2('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 58f6dc9..65f41f7 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 _0x55ca=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','key','filter','merge','include','catch','show','params','includeAll','options','create','body','find','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','FaxApplication','rawAttributes'];(function(_0x4de651,_0x427474){var _0x2db258=function(_0x4f0c22){while(--_0x4f0c22){_0x4de651['push'](_0x4de651['shift']());}};_0x2db258(++_0x427474);}(_0x55ca,0x126));var _0xa55c=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0x55ca[_0x294726];return _0x39e2e3;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];function respondWithStatusCode(_0x3998f7,_0x15eec8){_0x15eec8=_0x15eec8||0xcc;return function(_0x5d47ff){if(_0x5d47ff){return _0x3998f7['sendStatus'](_0x15eec8);}return _0x3998f7[_0xa55c('0x16')](_0x15eec8)['end']();};}function respondWithResult(_0x5a3672,_0x59ea8d){_0x59ea8d=_0x59ea8d||0xc8;return function(_0x18ee85){if(_0x18ee85){return _0x5a3672[_0xa55c('0x16')](_0x59ea8d)[_0xa55c('0x17')](_0x18ee85);}};}function respondWithFilteredResult(_0x938bd6,_0x458480){return function(_0x247e77){if(_0x247e77){var _0x4e0b2f=_0x247e77[_0xa55c('0x18')],_0x3ccf65=_0x458480[_0xa55c('0x19')],_0x3dcf4f=_0x458480[_0xa55c('0x19')]+_0x458480[_0xa55c('0x1a')],_0x25934f;if(_0x3dcf4f>=_0x4e0b2f){_0x3dcf4f=_0x4e0b2f;_0x25934f=0xc8;}else{_0x25934f=0xce;}_0x938bd6[_0xa55c('0x16')](_0x25934f);return _0x938bd6[_0xa55c('0x1b')]('Content-Range',_0x3ccf65+'-'+_0x3dcf4f+'/'+_0x4e0b2f)[_0xa55c('0x17')](_0x247e77);}return null;};}function patchUpdates(_0x104a99){return function(_0x461284){try{jsonpatch[_0xa55c('0x1c')](_0x461284,_0x104a99,!![]);}catch(_0x23a1ae){return BPromise[_0xa55c('0x1d')](_0x23a1ae);}return _0x461284['save']();};}function saveUpdates(_0x5f5158,_0xd643cc){return function(_0x3776ac){if(_0x3776ac){return _0x3776ac[_0xa55c('0x1e')](_0x5f5158)['then'](function(_0x383d92){return _0x383d92;});}return null;};}function removeEntity(_0x2fcb90,_0x54945a){return function(_0x187a87){if(_0x187a87){return _0x187a87[_0xa55c('0x1f')]()[_0xa55c('0x20')](function(){_0x2fcb90[_0xa55c('0x16')](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x49ed04,_0x1fc828){return function(_0x504c24){if(!_0x504c24){_0x49ed04['sendStatus'](0x194);}return _0x504c24;};}function handleError(_0x59d89a,_0x19ae88){_0x19ae88=_0x19ae88||0x1f4;return function(_0x54b038){logger[_0xa55c('0x22')](_0x54b038[_0xa55c('0x23')]);if(_0x54b038[_0xa55c('0x24')]){delete _0x54b038[_0xa55c('0x24')];}_0x59d89a[_0xa55c('0x16')](_0x19ae88)[_0xa55c('0x25')](_0x54b038);};}exports[_0xa55c('0x26')]=function(_0x11e7f7,_0x192df2){var _0x3cd152={},_0x1273d7={},_0x57f271={'count':0x0,'rows':[]};var _0x430d55=db[_0xa55c('0x27')][_0xa55c('0x28')];_0x1273d7[_0xa55c('0x29')]=_['keys'](_0x430d55);_0x1273d7[_0xa55c('0x2a')]=_[_0xa55c('0x2b')](_0x11e7f7[_0xa55c('0x2a')]);_0x1273d7[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1273d7[_0xa55c('0x29')],_0x1273d7['query']);_0x3cd152[_0xa55c('0x2e')]=_['intersection'](_0x1273d7[_0xa55c('0x29')],qs[_0xa55c('0x2f')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x3cd152['attributes']=_0x3cd152[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x3cd152[_0xa55c('0x2e')]:_0x1273d7[_0xa55c('0x29')];if(!_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x31')](_0xa55c('0x32'))){_0x3cd152[_0xa55c('0x1a')]=qs[_0xa55c('0x1a')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x1a')]);_0x3cd152['offset']=qs['offset'](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x19')]);}_0x3cd152['order']=qs[_0xa55c('0x33')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x33')]);_0x3cd152[_0xa55c('0x34')]=qs[_0xa55c('0x2c')](_[_0xa55c('0x35')](_0x11e7f7[_0xa55c('0x2a')],_0x1273d7[_0xa55c('0x2c')]));if(_0x11e7f7[_0xa55c('0x2a')]['filter']){_0x3cd152['where']=_['merge'](_0x3cd152[_0xa55c('0x34')],{'$or':_[_0xa55c('0x36')](_0x430d55,function(_0x2bb4f0){if(_0x2bb4f0['type'][_0xa55c('0x37')]!=='VIRTUAL'){var _0x119220={};_0x119220[_0x2bb4f0['field']]={'$like':'%'+_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x38')]+'%'};return _0x119220;}})});}_0x3cd152=_[_0xa55c('0x39')]({},_0x3cd152,_0x11e7f7['options']);var _0x7c4a47={'where':_0x3cd152[_0xa55c('0x34')]};return db['FaxApplication'][_0xa55c('0x18')](_0x7c4a47)[_0xa55c('0x20')](function(_0x4d9083){_0x57f271['count']=_0x4d9083;if(_0x11e7f7[_0xa55c('0x2a')]['includeAll']){_0x3cd152[_0xa55c('0x3a')]=[{'all':!![]}];}return db[_0xa55c('0x27')]['findAll'](_0x3cd152);})['then'](function(_0x5e50b6){_0x57f271['rows']=_0x5e50b6;return _0x57f271;})[_0xa55c('0x20')](respondWithFilteredResult(_0x192df2,_0x3cd152))[_0xa55c('0x3b')](handleError(_0x192df2,null));};exports[_0xa55c('0x3c')]=function(_0x99c4f8,_0x2d8cbf){var _0x56d17c={'raw':!![],'where':{'id':_0x99c4f8[_0xa55c('0x3d')]['id']}},_0x3d52d8={};_0x3d52d8[_0xa55c('0x29')]=_[_0xa55c('0x2b')](db[_0xa55c('0x27')][_0xa55c('0x28')]);_0x3d52d8['query']=_[_0xa55c('0x2b')](_0x99c4f8['query']);_0x3d52d8['filters']=_[_0xa55c('0x2d')](_0x3d52d8[_0xa55c('0x29')],_0x3d52d8['query']);_0x56d17c[_0xa55c('0x2e')]=_['intersection'](_0x3d52d8['model'],qs[_0xa55c('0x2f')](_0x99c4f8[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x56d17c['attributes']=_0x56d17c[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x56d17c['attributes']:_0x3d52d8[_0xa55c('0x29')];if(_0x99c4f8['query'][_0xa55c('0x3e')]){_0x56d17c[_0xa55c('0x3a')]=[{'all':!![]}];}_0x56d17c=_['merge']({},_0x56d17c,_0x99c4f8[_0xa55c('0x3f')]);return db[_0xa55c('0x27')]['find'](_0x56d17c)[_0xa55c('0x20')](handleEntityNotFound(_0x2d8cbf,null))[_0xa55c('0x20')](respondWithResult(_0x2d8cbf,null))[_0xa55c('0x3b')](handleError(_0x2d8cbf,null));};exports['create']=function(_0x334f52,_0x582901){return db[_0xa55c('0x27')][_0xa55c('0x40')](_0x334f52[_0xa55c('0x41')],{})['then'](respondWithResult(_0x582901,0xc9))[_0xa55c('0x3b')](handleError(_0x582901,null));};exports[_0xa55c('0x1e')]=function(_0x592429,_0x3d19f5){if(_0x592429[_0xa55c('0x41')]['id']){delete _0x592429['body']['id'];}return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x592429['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x3d19f5,null))[_0xa55c('0x20')](saveUpdates(_0x592429[_0xa55c('0x41')],null))[_0xa55c('0x20')](respondWithResult(_0x3d19f5,null))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x58a7ea['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](removeEntity(_0x2157d6,null))['catch'](handleError(_0x2157d6,null));}; \ No newline at end of file +var _0x7217=['send','index','FaxApplication','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name'];(function(_0xae4fbd,_0x55bcf9){var _0x55c452=function(_0x1a16d3){while(--_0x1a16d3){_0xae4fbd['push'](_0xae4fbd['shift']());}};_0x55c452(++_0x55bcf9);}(_0x7217,0x19e));var _0x7721=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x7217[_0x481bf7];return _0x461787;};'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 hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':!![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f272c7e..d3ae122 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 _0x5292=['rimraf','./faxApplication.attributes','define','FaxApplication','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path'];(function(_0x451dc8,_0x9d6a94){var _0x104d6f=function(_0x225b8f){while(--_0x225b8f){_0x451dc8['push'](_0x451dc8['shift']());}};_0x104d6f(++_0x9d6a94);}(_0x5292,0xf7));var _0x2529=function(_0x241de8,_0x24c165){_0x241de8=_0x241de8-0x0;var _0x19fb75=_0x5292[_0x241de8];return _0x19fb75;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2529('0xa')});}; \ No newline at end of file +var _0xd0bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5d3bf2,_0x3d8776){var _0x3e6e70=function(_0x493ff2){while(--_0x493ff2){_0x5d3bf2['push'](_0x5d3bf2['shift']());}};_0x3e6e70(++_0x3d8776);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2fa06e,_0x228d80){_0x2fa06e=_0x2fa06e-0x0;var _0x2df3f2=_0xd0bb[_0x2fa06e];return _0x2df3f2;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('api');var moment=require(_0xbd0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0b('0x4'));var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xbd0b('0x6'));var attributes=require('./faxApplication.attributes');module[_0xbd0b('0x7')]=function(_0x1b2499,_0x158b5c){return _0x1b2499[_0xbd0b('0x8')](_0xbd0b('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd0b('0xa'),'collate':_0xbd0b('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d7a8bdb..6c6498a 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 _0x831e=['then','info','FaxApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','UpdateFaxApplication','FaxApplication','body','options','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3c33f1,_0x2060d8){var _0x258376=function(_0x1c7160){while(--_0x1c7160){_0x3c33f1['push'](_0x3c33f1['shift']());}};_0x258376(++_0x2060d8);}(_0x831e,0x80));var _0xe831=function(_0x403bcf,_0x47bcd5){_0x403bcf=_0x403bcf-0x0;var _0x53436c=_0x831e[_0x403bcf];return _0x53436c;};'use strict';var _=require(_0xe831('0x0'));var util=require(_0xe831('0x1'));var moment=require('moment');var BPromise=require(_0xe831('0x2'));var rs=require(_0xe831('0x3'));var fs=require('fs');var Redis=require(_0xe831('0x4'));var db=require(_0xe831('0x5'))['db'];var utils=require(_0xe831('0x6'));var logger=require(_0xe831('0x7'))(_0xe831('0x8'));var config=require(_0xe831('0x9'));var jayson=require(_0xe831('0xa'));var client=jayson['client'][_0xe831('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x479add,_0x2b1496,_0x42ca64){return new BPromise(function(_0x1e32d2,_0x4515fa){return client['request'](_0x479add,_0x42ca64)[_0xe831('0xc')](function(_0x50608b){logger[_0xe831('0xd')](_0xe831('0xe'),_0x2b1496,'request\x20sent');logger[_0xe831('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2b1496,'request\x20sent',JSON[_0xe831('0x10')](_0x50608b));if(_0x50608b['error']){if(_0x50608b[_0xe831('0x11')][_0xe831('0x12')]===0x1f4){logger[_0xe831('0x11')](_0xe831('0xe'),_0x2b1496,_0x50608b[_0xe831('0x11')][_0xe831('0x13')]);return _0x4515fa(_0x50608b[_0xe831('0x11')][_0xe831('0x13')]);}logger[_0xe831('0x11')](_0xe831('0xe'),_0x2b1496,_0x50608b[_0xe831('0x11')][_0xe831('0x13')]);return _0x1e32d2(_0x50608b['error'][_0xe831('0x13')]);}else{logger[_0xe831('0xd')](_0xe831('0xe'),_0x2b1496,_0xe831('0x14'));_0x1e32d2(_0x50608b[_0xe831('0x15')][_0xe831('0x13')]);}})['catch'](function(_0x2c079c){logger[_0xe831('0x11')](_0xe831('0xe'),_0x2b1496,_0x2c079c);_0x4515fa(_0x2c079c);});});}exports[_0xe831('0x16')]=function(_0x389e7e){var _0x42fd51=this;return new Promise(function(_0x4bc285,_0x157902){return db[_0xe831('0x17')]['update'](_0x389e7e[_0xe831('0x18')],{'raw':_0x389e7e[_0xe831('0x19')]?_0x389e7e[_0xe831('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x389e7e[_0xe831('0x19')]?_0x389e7e[_0xe831('0x19')]['where']||null:null,'attributes':_0x389e7e[_0xe831('0x19')]?_0x389e7e[_0xe831('0x19')][_0xe831('0x1a')]||null:null,'limit':_0x389e7e[_0xe831('0x19')]?_0x389e7e[_0xe831('0x19')][_0xe831('0x1b')]||null:null})[_0xe831('0xc')](function(_0x27ae04){logger[_0xe831('0xd')]('UpdateFaxApplication',_0x389e7e);logger[_0xe831('0xf')]('UpdateFaxApplication',_0x389e7e,JSON[_0xe831('0x10')](_0x27ae04));_0x4bc285(_0x27ae04);})['catch'](function(_0x42f1cb){logger[_0xe831('0x11')](_0xe831('0x16'),_0x42f1cb[_0xe831('0x13')],_0x389e7e);_0x157902(_0x42fd51['error'](0x1f4,_0x42f1cb[_0xe831('0x13')]));});});}; \ No newline at end of file +var _0x7921=['../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateFaxApplication','update','body','options','raw','limit','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7921,0x1e7));var _0x1792=function(_0x28ec15,_0x1a7cc2){_0x28ec15=_0x28ec15-0x0;var _0x53ea0a=_0x7921[_0x28ec15];return _0x53ea0a;};'use strict';var _=require(_0x1792('0x0'));var util=require(_0x1792('0x1'));var moment=require(_0x1792('0x2'));var BPromise=require('bluebird');var rs=require(_0x1792('0x3'));var fs=require('fs');var Redis=require(_0x1792('0x4'));var db=require(_0x1792('0x5'))['db'];var utils=require(_0x1792('0x6'));var logger=require(_0x1792('0x7'))(_0x1792('0x8'));var config=require(_0x1792('0x9'));var jayson=require(_0x1792('0xa'));var client=jayson[_0x1792('0xb')][_0x1792('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x157ea3,_0x2873fe,_0x1ac422){return new BPromise(function(_0x54f11,_0x262bd8){return client[_0x1792('0xd')](_0x157ea3,_0x1ac422)['then'](function(_0x498684){logger[_0x1792('0xe')](_0x1792('0xf'),_0x2873fe,'request\x20sent');logger['debug'](_0x1792('0x10'),_0x2873fe,'request\x20sent',JSON['stringify'](_0x498684));if(_0x498684['error']){if(_0x498684[_0x1792('0x11')][_0x1792('0x12')]===0x1f4){logger[_0x1792('0x11')](_0x1792('0xf'),_0x2873fe,_0x498684[_0x1792('0x11')][_0x1792('0x13')]);return _0x262bd8(_0x498684[_0x1792('0x11')][_0x1792('0x13')]);}logger[_0x1792('0x11')](_0x1792('0xf'),_0x2873fe,_0x498684['error'][_0x1792('0x13')]);return _0x54f11(_0x498684[_0x1792('0x11')][_0x1792('0x13')]);}else{logger[_0x1792('0xe')](_0x1792('0xf'),_0x2873fe,_0x1792('0x14'));_0x54f11(_0x498684[_0x1792('0x15')][_0x1792('0x13')]);}})[_0x1792('0x16')](function(_0x233acf){logger[_0x1792('0x11')](_0x1792('0xf'),_0x2873fe,_0x233acf);_0x262bd8(_0x233acf);});});}exports[_0x1792('0x17')]=function(_0x3325b9){var _0x3d8449=this;return new Promise(function(_0x3696a5,_0x290921){return db['FaxApplication'][_0x1792('0x18')](_0x3325b9[_0x1792('0x19')],{'raw':_0x3325b9[_0x1792('0x1a')]?_0x3325b9[_0x1792('0x1a')][_0x1792('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3325b9[_0x1792('0x1a')]?_0x3325b9[_0x1792('0x1a')]['where']||null:null,'attributes':_0x3325b9[_0x1792('0x1a')]?_0x3325b9[_0x1792('0x1a')]['attributes']||null:null,'limit':_0x3325b9['options']?_0x3325b9[_0x1792('0x1a')][_0x1792('0x1c')]||null:null})[_0x1792('0x1d')](function(_0x43ccbb){logger[_0x1792('0xe')](_0x1792('0x17'),_0x3325b9);logger[_0x1792('0x1e')]('UpdateFaxApplication',_0x3325b9,JSON['stringify'](_0x43ccbb));_0x3696a5(_0x43ccbb);})['catch'](function(_0x27d63f){logger[_0x1792('0x11')](_0x1792('0x17'),_0x27d63f[_0x1792('0x13')],_0x3325b9);_0x290921(_0x3d8449['error'](0x1f4,_0x27d63f[_0x1792('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index dd678a0..3b18eb5 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 _0x955f=['path','connect-timeout','express','../../components/auth/service','./faxApplication.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x955f,0x1eb));var _0xf955=function(_0x3d2cec,_0x48b255){_0x3d2cec=_0x3d2cec-0x0;var _0x310e9a=_0x955f[_0x3d2cec];return _0x310e9a;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var auth=require(_0xf955('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf955('0x6'));router['get']('/',auth[_0xf955('0x7')](),controller[_0xf955('0x8')]);router[_0xf955('0x9')]('/:id',auth[_0xf955('0x7')](),controller[_0xf955('0xa')]);router['post']('/',auth[_0xf955('0x7')](),controller[_0xf955('0xb')]);router[_0xf955('0xc')](_0xf955('0xd'),auth[_0xf955('0x7')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/:id',auth[_0xf955('0x7')](),controller['destroy']);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0xb574=['create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xb574,0x106));var _0x4b57=function(_0x19f217,_0x43a894){_0x19f217=_0x19f217-0x0;var _0x277412=_0xb574[_0x19f217];return _0x277412;};'use strict';var multer=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var path=require('path');var timeout=require(_0x4b57('0x2'));var express=require(_0x4b57('0x3'));var router=express['Router']();var auth=require(_0x4b57('0x4'));var interaction=require(_0x4b57('0x5'));var config=require(_0x4b57('0x6'));var controller=require(_0x4b57('0x7'));router[_0x4b57('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4b57('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4b57('0x9')](),controller[_0x4b57('0xa')]);router[_0x4b57('0xb')](_0x4b57('0xc'),auth[_0x4b57('0x9')](),controller[_0x4b57('0xd')]);router[_0x4b57('0xe')](_0x4b57('0xc'),auth['isAuthenticated'](),controller[_0x4b57('0xf')]);module[_0x4b57('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 422e131..ccda769 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 _0x732f=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x2b9c45,_0x1213ea){var _0x5d1c83=function(_0x51db2a){while(--_0x51db2a){_0x2b9c45['push'](_0x2b9c45['shift']());}};_0x5d1c83(++_0x1213ea);}(_0x732f,0xb0));var _0xf732=function(_0x55b087,_0x2e94fa){_0x55b087=_0x55b087-0x0;var _0x583d66=_0x732f[_0x55b087];return _0x583d66;};'use strict';var Sequelize=require(_0xf732('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf732('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf732('0x2')]},'disposition':{'type':Sequelize[_0xf732('0x3')]},'note':{'type':Sequelize[_0xf732('0x3')]},'read1stAt':{'type':Sequelize[_0xf732('0x2')]},'fax':{'type':Sequelize[_0xf732('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf732('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf732('0x4')]('in',_0xf732('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xdd2b=['ENUM','exports','STRING','DATE','out'];(function(_0xa08c44,_0x23536b){var _0x508794=function(_0x2e287c){while(--_0x2e287c){_0xa08c44['push'](_0xa08c44['shift']());}};_0x508794(++_0x23536b);}(_0xdd2b,0xc4));var _0xbdd2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdd2b[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xbdd2('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbdd2('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbdd2('0x2')]},'fax':{'type':Sequelize[_0xbdd2('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbdd2('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbdd2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbdd2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 212470a..f29e918 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 _0x6186=['getMessages','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','attachments','root','files','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createWriteStream','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','closed','FaxMessage','unreadMessages','Users','TagIds','forEach','Tags','FaxInteraction','rawAttributes','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','from','tools_tags','select','fax_messages','me.FaxInteractionId\x20=\x20i.id','field','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','expr','advancedFilter','parse','keys','createdAt','value','dateStart','startOf','day','format','utc','endOf','and','isArray','condition','TagId','length','tableAlias','\x20IN\x20?','LIKE','ContactId','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','\x20=\x20?','c.firstName','c.lastName','map','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','QueryTypes','clone','COUNT(*)','read','%s\x20=\x200','toString','having','`Messages.count`\x20=\x200','%s\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','t.id\x20=\x20it.TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','push','all','show','params','includeAll','find','catch','update','body','describe','addMessage','ids'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6186,0x1b0));var _0x6618=function(_0x576e92,_0x165314){_0x576e92=_0x576e92-0x0;var _0x24c32e=_0x6186[_0x576e92];return _0x24c32e;};'use strict';var pdf=require(_0x6618('0x0'));var emlformat=require(_0x6618('0x1'));var rimraf=require(_0x6618('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6618('0x3'));var rp=require('request-promise');var moment=require(_0x6618('0x4'));var BPromise=require(_0x6618('0x5'));var Mustache=require(_0x6618('0x6'));var util=require(_0x6618('0x7'));var path=require(_0x6618('0x8'));var sox=require(_0x6618('0x9'));var csv=require(_0x6618('0xa'));var ejs=require(_0x6618('0xb'));var fs=require('fs');var _=require(_0x6618('0xc'));var squel=require(_0x6618('0xd'));var crypto=require(_0x6618('0xe'));var jsforce=require(_0x6618('0xf'));var deskjs=require(_0x6618('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6618('0x11'));var authService=require(_0x6618('0x12'));var qs=require(_0x6618('0x13'));var hardwareService=require(_0x6618('0x14'));var logger=require(_0x6618('0x15'))('api');var utils=require(_0x6618('0x16'));var config=require(_0x6618('0x17'));var db=require('../../mysqldb')['db'];config[_0x6618('0x18')]=_['defaults'](config[_0x6618('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6618('0x19'))(new Redis(config[_0x6618('0x18')]));require('./faxInteraction.socket')[_0x6618('0x1a')](socket);function respondWithStatusCode(_0x784f01,_0x57148b){_0x57148b=_0x57148b||0xcc;return function(_0x501110){if(_0x501110){return _0x784f01[_0x6618('0x1b')](_0x57148b);}return _0x784f01[_0x6618('0x1c')](_0x57148b)[_0x6618('0x1d')]();};}function respondWithResult(_0x5c868d,_0x3e4c66){_0x3e4c66=_0x3e4c66||0xc8;return function(_0x3faa47){if(_0x3faa47){return _0x5c868d[_0x6618('0x1c')](_0x3e4c66)[_0x6618('0x1e')](_0x3faa47);}};}function respondWithFilteredResult(_0x2b5dd6,_0xce4164){return function(_0x3c9fe8){if(_0x3c9fe8){var _0x361700=_0x3c9fe8[_0x6618('0x1f')],_0x4c8434=_0xce4164['offset'],_0x2329b4=_0xce4164[_0x6618('0x20')]+_0xce4164[_0x6618('0x21')],_0x443356;if(_0x2329b4>=_0x361700){_0x2329b4=_0x361700;_0x443356=0xc8;}else{_0x443356=0xce;}_0x2b5dd6[_0x6618('0x1c')](_0x443356);return _0x2b5dd6[_0x6618('0x22')](_0x6618('0x23'),_0x4c8434+'-'+_0x2329b4+'/'+_0x361700)[_0x6618('0x1e')](_0x3c9fe8);}return null;};}function patchUpdates(_0x3330f9){return function(_0x50b112){try{jsonpatch[_0x6618('0x24')](_0x50b112,_0x3330f9,!![]);}catch(_0x25d580){return BPromise[_0x6618('0x25')](_0x25d580);}return _0x50b112[_0x6618('0x26')]();};}function saveUpdates(_0x42e719,_0x10c240){return function(_0x293289){if(_0x293289){return _0x293289['update'](_0x42e719)[_0x6618('0x27')](function(_0x2911af){return _0x2911af;});}return null;};}function removeEntity(_0x191aa6,_0x3f0ab2){return function(_0x37b214){if(_0x37b214){return _0x37b214[_0x6618('0x28')]()[_0x6618('0x27')](function(){_0x191aa6[_0x6618('0x1c')](0xcc)[_0x6618('0x1d')]();});}};}function handleEntityNotFound(_0x353c9e,_0x4f0003){return function(_0x24549f){if(!_0x24549f){_0x353c9e[_0x6618('0x1b')](0x194);}return _0x24549f;};}function handleError(_0x3076b8,_0x21f086){_0x21f086=_0x21f086||0x1f4;return function(_0x180606){logger[_0x6618('0x29')](_0x180606[_0x6618('0x2a')]);if(_0x180606['name']){delete _0x180606[_0x6618('0x2b')];}_0x3076b8['status'](_0x21f086)[_0x6618('0x2c')](_0x180606);};}function getInteractionUnreadMessages(_0x4ee9c6){return new BPromise(function(_0x775ea3,_0x1118ce){try{if(_0x4ee9c6[_0x6618('0x2d')]){_0x4ee9c6['unreadMessages']=0x0;_0x775ea3(_0x4ee9c6);}else{return db[_0x6618('0x2e')]['count']({'where':{'FaxInteractionId':_0x4ee9c6['id'],'direction':'in','read':![]}})['then'](function(_0x410353){_0x4ee9c6[_0x6618('0x2f')]=_0x410353;_0x775ea3(_0x4ee9c6);});}}catch(_0x265156){_0x1118ce(_0x265156);}});}function getInteractionUsers(_0x5b2fb3,_0x264538){return new BPromise(function(_0x75ea5,_0x2aea63){try{if(_0x264538[_0x5b2fb3['id']]){_0x5b2fb3[_0x6618('0x30')]=_['map'](_0x264538[_0x5b2fb3['id']],function(_0x32cd4c){return{'id':_0x32cd4c['id']};});}}catch(_0x37ac2d){_0x2aea63(_0x37ac2d);}_0x75ea5(_0x5b2fb3);});}function getInteractionTags(_0x49aaf6,_0x356269){return new BPromise(function(_0x3260b6,_0x162e63){try{if(_0x49aaf6[_0x6618('0x31')]){_0x49aaf6['Tags']=[];_0x49aaf6[_0x6618('0x31')]['split'](',')[_0x6618('0x32')](function(_0x17f060){_0x49aaf6[_0x6618('0x33')]['push'](_0x356269[_0x17f060]);});}delete _0x49aaf6[_0x6618('0x31')];}catch(_0x4e4f19){_0x162e63(_0x4e4f19);}_0x3260b6(_0x49aaf6);});}function updateFaxInteraction(_0x451118,_0x58b25d,_0x431ece){return new BPromise(function(_0x112530,_0x345aeb){return getInteractionUnreadMessages(_0x451118)['then'](function(_0x1937db){return getInteractionUsers(_0x1937db,_0x431ece);})[_0x6618('0x27')](function(_0x27ae08){return getInteractionTags(_0x27ae08,_0x58b25d);})['then'](function(_0x35c0ab){_0x112530(_0x35c0ab);})['catch'](function(_0x275a0a){_0x345aeb(_0x275a0a);});});}exports['index']=function(_0xbddb49,_0x188e66){var _0x25da6a={},_0x1fff99={},_0x4b4c9d={'count':0x0,'rows':[]};var _0x2d659d=db[_0x6618('0x34')][_0x6618('0x35')];_0x1fff99['model']=_['keys'](_0x2d659d);_0x1fff99[_0x6618('0x36')]=_['keys'](_0xbddb49[_0x6618('0x36')]);_0x1fff99['filters']=_[_0x6618('0x37')](_0x1fff99[_0x6618('0x38')],_0x1fff99['query']);_0x25da6a[_0x6618('0x39')]=_['intersection'](_0x1fff99[_0x6618('0x38')],qs[_0x6618('0x3a')](_0xbddb49['query']['fields']));_0x25da6a[_0x6618('0x39')]=_0x25da6a['attributes']['length']?_0x25da6a['attributes']:_0x1fff99[_0x6618('0x38')];if(!_0xbddb49['query'][_0x6618('0x3b')](_0x6618('0x3c'))){_0x25da6a[_0x6618('0x21')]=qs['limit'](_0xbddb49[_0x6618('0x36')][_0x6618('0x21')]);_0x25da6a[_0x6618('0x20')]=qs[_0x6618('0x20')](_0xbddb49[_0x6618('0x36')]['offset']);}_0x25da6a[_0x6618('0x3d')]=qs[_0x6618('0x3e')](_0xbddb49[_0x6618('0x36')]['sort']);_0x25da6a[_0x6618('0x3f')]=qs['filters'](_[_0x6618('0x40')](_0xbddb49[_0x6618('0x36')],_0x1fff99[_0x6618('0x41')]));var _0x18dbb0=[];var _0xb38a17=squel['select']()['field']('id')['field'](_0x6618('0x2b'))['field']('color')[_0x6618('0x42')](_0x6618('0x43'));var _0x43cad5=squel[_0x6618('0x44')]()['field']('COUNT(*)')[_0x6618('0x42')](_0x6618('0x45'),'me')[_0x6618('0x3f')](_0x6618('0x46'))[_0x6618('0x3f')]('me.direction\x20=\x20\x27in\x27')[_0x6618('0x3f')]('me.read\x20=\x20false');var _0x4ea998=squel['select']()[_0x6618('0x47')](_0x6618('0x48'))[_0x6618('0x47')](_0x6618('0x49'))[_0x6618('0x42')](_0x6618('0x4a'),'ui')[_0x6618('0x4b')](_0x6618('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x45ee57=squel[_0x6618('0x44')]()[_0x6618('0x42')](_0x6618('0x4d'),'i')[_0x6618('0x4b')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x6618('0x4e'))[_0x6618('0x4b')](_0x6618('0x4f'),'a',_0x6618('0x50'))[_0x6618('0x4b')](_0x6618('0x45'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x12c8eb=squel[_0x6618('0x51')]();if(_0xbddb49[_0x6618('0x36')][_0x6618('0x52')]){var _0x2cebd2=JSON[_0x6618('0x53')](_0xbddb49[_0x6618('0x36')][_0x6618('0x52')]);_[_0x6618('0x54')](_0x2cebd2)[_0x6618('0x32')](function(_0x206e6e){var _0x4951ec=_0x2cebd2[_0x206e6e];if(_0x206e6e===_0x6618('0x55')){var _0x107e17=moment(_0x4951ec[_0x6618('0x56')][_0x6618('0x57')])[_0x6618('0x58')](_0x6618('0x59'))['utc']()[_0x6618('0x5a')]();var _0x16ace8=moment(_0x16ace8)[_0x6618('0x5b')]()[_0x6618('0x5c')]('day')[_0x6618('0x5a')]();_0x12c8eb[_0x6618('0x5d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x107e17,_0x16ace8);}else{if(_[_0x6618('0x5e')](_0x4951ec[_0x6618('0x5f')])){_0x4951ec['condition'][_0x6618('0x32')](function(_0x44e123){switch(_0x4951ec['condition'][_0x6618('0x56')]){case'IS':if(_0x206e6e!==_0x6618('0x60')&&_0x206e6e!=='Messages.count'){if(_[_0x6618('0x5e')](_0x4951ec[_0x6618('0x56')])&&_0x4951ec[_0x6618('0x56')][_0x6618('0x61')]>0x1){_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x63'),_0x4951ec[_0x6618('0x56')]);}else{_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+'\x20=\x20?',_0x4951ec['value'][0x0]);}}break;case'=':_0x12c8eb[_0x6618('0x5d')](_0x4951ec['tableAlias']+'.'+_0x206e6e+'\x20=\x20?',_0x4951ec[_0x6618('0x56')]);break;case _0x6618('0x64'):if(_0x206e6e===_0x6618('0x65')){_0x12c8eb['and']('c.firstName'+_0x6618('0x66'),'%'+_0x4951ec[_0x6618('0x56')]+'%');_0x12c8eb['or']('c.lastName'+_0x6618('0x66'),'%'+_0x4951ec['value']+'%');_0x12c8eb['or'](_0x6618('0x67')+_0x6618('0x66'),'%'+_0x4951ec['value']+'%');}else{_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x66'),'%'+_0x4951ec['value']+'%');}break;case'>':_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x68'),_0x4951ec[_0x6618('0x56')]);break;case'<':_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x69'),_0x4951ec[_0x6618('0x56')]);break;}});}else{switch(_0x4951ec['condition'][_0x6618('0x56')]){case'IS':if(_0x206e6e!==_0x6618('0x60')&&_0x206e6e!==_0x6618('0x6a')){if(_['isArray'](_0x4951ec[_0x6618('0x56')])&&_0x4951ec['value'][_0x6618('0x61')]>0x1){_0x12c8eb['and'](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+'\x20IN\x20?',_0x4951ec['value']);}else{_0x12c8eb[_0x6618('0x5d')](_0x4951ec['tableAlias']+'.'+_0x206e6e+'\x20=\x20?',_0x4951ec[_0x6618('0x56')][0x0]);}}break;case'=':_0x12c8eb['and'](_0x4951ec['tableAlias']+'.'+_0x206e6e+_0x6618('0x6b'),_0x4951ec[_0x6618('0x56')]);break;case'LIKE':if(_0x206e6e===_0x6618('0x65')){_0x12c8eb[_0x6618('0x5d')](_0x6618('0x6c')+_0x6618('0x66'),'%'+_0x4951ec[_0x6618('0x56')]+'%');_0x12c8eb['or'](_0x6618('0x6d')+'\x20LIKE\x20?','%'+_0x4951ec[_0x6618('0x56')]+'%');_0x12c8eb['or'](_0x6618('0x67')+'\x20LIKE\x20?','%'+_0x4951ec[_0x6618('0x56')]+'%');}else{_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x66'),'%'+_0x4951ec[_0x6618('0x56')]+'%');}break;case'>':_0x12c8eb[_0x6618('0x5d')](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x68'),_0x4951ec[_0x6618('0x56')]);break;case'<':_0x12c8eb['and'](_0x4951ec[_0x6618('0x62')]+'.'+_0x206e6e+_0x6618('0x69'),_0x4951ec['value']);break;}}}});}else{var _0x5224df=_(Object[_0x6618('0x54')](_0xbddb49[_0x6618('0x36')]))[_0x6618('0x6e')](function(_0x2bac29){return _0x2d659d[_0x6618('0x3b')](_0x2bac29)?_0x2bac29:undefined;})[_0x6618('0x6f')](function(_0x553b6d){return!_[_0x6618('0x70')](_0x553b6d);})[_0x6618('0x56')]();if(!_[_0x6618('0x71')](_0x5224df)){_0x5224df[_0x6618('0x32')](function(_0x28ce74){if(_0x28ce74===_0x6618('0x72')){_0x45ee57[_0x6618('0x3f')](_0x6618('0x73'),[][_0x6618('0x74')](_0xbddb49[_0x6618('0x36')][_0x28ce74]));}else if(_0x28ce74===_0x6618('0x55')){var _0x3877eb=JSON[_0x6618('0x53')](_0xbddb49[_0x6618('0x36')][_0x28ce74])[_0x6618('0x75')];var _0x517948=JSON['parse'](_0xbddb49['query'][_0x28ce74])[_0x6618('0x76')];_0x45ee57[_0x6618('0x3f')](_0x6618('0x77'),_0x3877eb,_0x517948);}else{if(_0xbddb49['query'][_0x28ce74]===_0x6618('0x78')){_0x45ee57[_0x6618('0x3f')]('i.'+_0x28ce74+'\x20IS\x20NULL');}else{_0x45ee57[_0x6618('0x3f')]('i.'+_0x28ce74+'\x20=\x20?',_0xbddb49[_0x6618('0x36')][_0x28ce74]);}}});}if(_0xbddb49[_0x6618('0x36')][_0x6618('0x6f')]){var _0x12b856=_0xbddb49[_0x6618('0x36')][_0x6618('0x6f')][_0x6618('0x79')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x6618('0x7a'));if(qs[_0x6618('0x7b')](_0x12b856)){_0x12c8eb['or'](_0x6618('0x7c'),_0x12b856+'%')['or'](_0x6618('0x7d'),_0x12b856+'%');}_0x12c8eb['or'](_0x6618('0x7e'),_0x12b856+'%');}}_0x45ee57[_0x6618('0x3f')](_0x12c8eb);if(_0x25da6a[_0x6618('0x3d')]){_0x25da6a['order'][_0x6618('0x32')](function(_0x3b1881){_0x45ee57[_0x6618('0x3d')]('i.'+_0x3b1881[0x0],_0x3b1881[0x1]===_0x6618('0x7f')?![]:!![]);});}_0x45ee57['group'](_0x6618('0x80'));var _0xd40ee8={'type':db[_0x6618('0x81')][_0x6618('0x82')]['SELECT'],'raw':!![]};var _0x42b49a=_0x45ee57[_0x6618('0x83')]()['field'](_0x6618('0x84'));if(!_0xbddb49[_0x6618('0x36')][_0x6618('0x52')]){if(_0xbddb49['query'][_0x6618('0x85')]){if(_0xbddb49[_0x6618('0x36')][_0x6618('0x85')]==0x1){_0x42b49a[_0x6618('0x3f')](util[_0x6618('0x5a')](_0x6618('0x86'),_0x43cad5[_0x6618('0x87')]()));_0x45ee57[_0x6618('0x88')](_0x6618('0x89'));}else{_0x42b49a[_0x6618('0x3f')](util[_0x6618('0x5a')](_0x6618('0x8a'),_0x43cad5[_0x6618('0x87')]()));_0x45ee57[_0x6618('0x88')]('`Messages.count`\x20>\x200');}}if(_0xbddb49[_0x6618('0x36')]['tag']){var _0x5b7305=_[_0x6618('0x5e')](_0xbddb49[_0x6618('0x36')][_0x6618('0x8b')])?_0xbddb49[_0x6618('0x36')]['tag']:new Array(_0xbddb49[_0x6618('0x36')]['tag']);var _0x42a184=squel['expr']();_0x5b7305[_0x6618('0x32')](function(_0x2246ab){_0x42a184['or'](_0x6618('0x8c'),'%,'+_0x2246ab+',%');});_0x45ee57['having'](_0x42a184);_0x42b49a[_0x6618('0x4b')](_0x6618('0x8d'),'it','it.FaxInteractionId\x20=\x20i.id');_0x42b49a['left_join']('tools_tags','t',_0x6618('0x8e'));_0x42b49a['where']('t.id\x20IN\x20?',_0x5b7305);}}else{var _0x2cebd2=JSON['parse'](_0xbddb49['query'][_0x6618('0x52')]);_['keys'](_0x2cebd2)[_0x6618('0x32')](function(_0x4c2877){var _0x447a75=_0x2cebd2[_0x4c2877];if(_0x4c2877===_0x6618('0x60')){var _0x16152e=_0x447a75[_0x6618('0x56')];var _0x411617=squel['expr']();_0x16152e[_0x6618('0x32')](function(_0x13f4ea){_0x411617['or'](_0x6618('0x8c'),'%,'+_0x13f4ea+',%');});_0x45ee57[_0x6618('0x88')](_0x411617);_0x42b49a[_0x6618('0x4b')](_0x6618('0x8f'),'it',_0x6618('0x90'));_0x42b49a[_0x6618('0x4b')]('tools_tags','t',_0x6618('0x8e'));_0x42b49a[_0x6618('0x3f')](_0x6618('0x91'),_0x16152e);}else if(_0x4c2877===_0x6618('0x6a')){if(_0x447a75[_0x6618('0x56')]['length']===0x1){if(_0x447a75[_0x6618('0x56')][0x0]===0x1){_0x42b49a[_0x6618('0x3f')](util['format'](_0x6618('0x86'),_0x43cad5['toString']()));_0x45ee57['having']('`Messages.count`\x20=\x200');}else{_0x42b49a[_0x6618('0x3f')](util[_0x6618('0x5a')](_0x6618('0x8a'),_0x43cad5['toString']()));_0x45ee57[_0x6618('0x88')](_0x6618('0x92'));}}}});}db[_0x6618('0x93')][_0x6618('0x36')](_0x42b49a['toString'](),_0xd40ee8)[_0x6618('0x27')](function(_0x524cb7){_0x4b4c9d[_0x6618('0x1f')]=_0x524cb7[_0x6618('0x61')];if(_0x4b4c9d[_0x6618('0x1f')]===0x0)return[];return db[_0x6618('0x93')]['query'](_0xb38a17[_0x6618('0x87')](),_0xd40ee8)[_0x6618('0x27')](function(_0x4ed077){_0x18dbb0=_[_0x6618('0x94')](_0x4ed077,'id');_0xd40ee8=_[_0x6618('0x95')](_0xd40ee8,{'model':db[_0x6618('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x45ee57[_0x6618('0x47')](_0x6618('0x96'),_0x6618('0x97'));_0x45ee57[_0x6618('0x47')]('i.*');_0x45ee57[_0x6618('0x47')](_0x6618('0x6c'),_0x6618('0x98'));_0x45ee57[_0x6618('0x47')](_0x6618('0x6d'),_0x6618('0x99'));_0x45ee57[_0x6618('0x47')]('c.email',_0x6618('0x9a'));_0x45ee57[_0x6618('0x47')](_0x6618('0x9b'),_0x6618('0x9c'));_0x45ee57[_0x6618('0x47')](_0x6618('0x9d'),'Contact.mobile');_0x45ee57[_0x6618('0x47')](_0x6618('0x9e'),_0x6618('0x9f'));_0x45ee57[_0x6618('0x47')](_0x6618('0xa0'),_0x6618('0x31'));_0x45ee57[_0x6618('0x4b')](_0x6618('0x8d'),'it','it.FaxInteractionId\x20=\x20i.id');_0x45ee57[_0x6618('0x4b')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x45ee57[_0x6618('0x21')](_0x25da6a[_0x6618('0x21')]);_0x45ee57[_0x6618('0x20')](_0x25da6a[_0x6618('0x20')]);return db[_0x6618('0x93')][_0x6618('0x36')](_0x45ee57['toString'](),_0xd40ee8);})[_0x6618('0x27')](function(_0x29ff79){_0x4ea998[_0x6618('0x3f')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x29ff79,'id'));return db['sequelize'][_0x6618('0x36')](_0x4ea998['toString'](),_0xd40ee8)[_0x6618('0x27')](function(_0x5239d2){var _0x4bc3b1=_['groupBy'](_0x5239d2,_0x6618('0xa1'));var _0x9d89fa=[];_0x29ff79[_0x6618('0x32')](function(_0x21b32c){_0x9d89fa[_0x6618('0xa2')](updateFaxInteraction(_0x21b32c,_0x18dbb0,_0x4bc3b1));});return BPromise[_0x6618('0xa3')](_0x9d89fa);});});})[_0x6618('0x27')](function(_0xbb2857){_0x4b4c9d['rows']=_0xbb2857;return _0x4b4c9d;})[_0x6618('0x27')](respondWithFilteredResult(_0x188e66,_0x25da6a))['catch'](handleError(_0x188e66,null));};exports[_0x6618('0xa4')]=function(_0x54db90,_0x3a3d4b){var _0x26caf4={'raw':![],'where':{'id':_0x54db90[_0x6618('0xa5')]['id']}},_0x367d92={};_0x367d92[_0x6618('0x38')]=_['keys'](db['FaxInteraction'][_0x6618('0x35')]);_0x367d92[_0x6618('0x36')]=_[_0x6618('0x54')](_0x54db90[_0x6618('0x36')]);_0x367d92[_0x6618('0x41')]=_[_0x6618('0x37')](_0x367d92[_0x6618('0x38')],_0x367d92[_0x6618('0x36')]);_0x26caf4[_0x6618('0x39')]=_['intersection'](_0x367d92[_0x6618('0x38')],qs[_0x6618('0x3a')](_0x54db90[_0x6618('0x36')]['fields']));_0x26caf4[_0x6618('0x39')]=_0x26caf4[_0x6618('0x39')][_0x6618('0x61')]?_0x26caf4[_0x6618('0x39')]:_0x367d92[_0x6618('0x38')];if(_0x54db90[_0x6618('0x36')][_0x6618('0xa6')]){_0x26caf4['include']=[{'all':!![]}];}_0x26caf4=_['merge']({},_0x26caf4,_0x54db90['options']);return db[_0x6618('0x34')][_0x6618('0xa7')](_0x26caf4)[_0x6618('0x27')](handleEntityNotFound(_0x3a3d4b,null))[_0x6618('0x27')](respondWithResult(_0x3a3d4b,null))[_0x6618('0xa8')](handleError(_0x3a3d4b,null));};exports['create']=function(_0x5d6dab,_0x21785a){return db['FaxInteraction']['create'](_0x5d6dab['body'],{})[_0x6618('0x27')](respondWithResult(_0x21785a,0xc9))[_0x6618('0xa8')](handleError(_0x21785a,null));};exports[_0x6618('0xa9')]=function(_0x238bca,_0x42ce88){if(_0x238bca[_0x6618('0xaa')]['id']){delete _0x238bca[_0x6618('0xaa')]['id'];}return db[_0x6618('0x34')]['find']({'where':{'id':_0x238bca[_0x6618('0xa5')]['id']}})[_0x6618('0x27')](handleEntityNotFound(_0x42ce88,null))['then'](saveUpdates(_0x238bca['body'],null))[_0x6618('0x27')](respondWithResult(_0x42ce88,null))[_0x6618('0xa8')](handleError(_0x42ce88,null));};exports['destroy']=function(_0x947e80,_0x3bd8a4){return db[_0x6618('0x34')][_0x6618('0xa7')]({'where':{'id':_0x947e80[_0x6618('0xa5')]['id']}})['then'](handleEntityNotFound(_0x3bd8a4,null))[_0x6618('0x27')](removeEntity(_0x3bd8a4,null))[_0x6618('0xa8')](handleError(_0x3bd8a4,null));};exports['describe']=function(_0x5da40e,_0x36387e){return db['FaxInteraction'][_0x6618('0xab')]()[_0x6618('0x27')](respondWithResult(_0x36387e,null))[_0x6618('0xa8')](handleError(_0x36387e,null));};exports[_0x6618('0xac')]=function(_0x36968c,_0x436a54,_0x28db39){return db[_0x6618('0x2e')][_0x6618('0xa7')]({'where':{'id':_0x36968c['params']['id']}})[_0x6618('0x27')](handleEntityNotFound(_0x436a54,null))[_0x6618('0x27')](function(_0x54a6da){if(_0x54a6da){return _0x54a6da[_0x6618('0xac')](_0x36968c[_0x6618('0xaa')][_0x6618('0xad')],_['omit'](_0x36968c[_0x6618('0xaa')],[_0x6618('0xad'),'id'])||{});}})[_0x6618('0x27')](respondWithResult(_0x436a54,null))[_0x6618('0xa8')](handleError(_0x436a54,null));};exports[_0x6618('0xae')]=function(_0xb9e96b,_0x4719cf,_0x581dbb){var _0x319954={'raw':![],'where':{}};var _0x1234e0={};var _0x4e741f={'count':0x0,'rows':[]};return db[_0x6618('0x34')]['findOne']({'where':{'id':_0xb9e96b[_0x6618('0xa5')]['id']}})['then'](handleEntityNotFound(_0x4719cf,null))[_0x6618('0x27')](function(_0x4eedbd){if(_0x4eedbd){_0x1234e0[_0x6618('0x38')]=_[_0x6618('0x54')](db['FaxMessage'][_0x6618('0x35')]);_0x1234e0['query']=_[_0x6618('0x54')](_0xb9e96b[_0x6618('0x36')]);_0x1234e0['filters']=_['intersection'](_0x1234e0[_0x6618('0x38')],_0x1234e0[_0x6618('0x36')]);_0x319954['attributes']=_['intersection'](_0x1234e0[_0x6618('0x38')],qs['fields'](_0xb9e96b[_0x6618('0x36')][_0x6618('0x3a')]));_0x319954[_0x6618('0x39')]=_0x319954[_0x6618('0x39')]['length']?_0x319954[_0x6618('0x39')]:_0x1234e0[_0x6618('0x38')];if(!_0xb9e96b[_0x6618('0x36')][_0x6618('0x3b')](_0x6618('0x3c'))){_0x319954[_0x6618('0x21')]=qs[_0x6618('0x21')](_0xb9e96b['query'][_0x6618('0x21')]);_0x319954[_0x6618('0x20')]=qs[_0x6618('0x20')](_0xb9e96b[_0x6618('0x36')][_0x6618('0x20')]);}_0x319954[_0x6618('0x3d')]=qs[_0x6618('0x3e')](_0xb9e96b[_0x6618('0x36')][_0x6618('0x3e')]);_0x319954[_0x6618('0x3f')]=qs['filters'](_[_0x6618('0x40')](_0xb9e96b[_0x6618('0x36')],_0x1234e0['filters']));_0x319954[_0x6618('0x3f')][_0x6618('0xa1')]=_0x4eedbd['id'];if(_0xb9e96b[_0x6618('0x36')][_0x6618('0x6f')]){_0x319954[_0x6618('0x3f')]=_[_0x6618('0x95')](_0x319954[_0x6618('0x3f')],{'$or':_['map'](_0x319954['attributes'],function(_0x378d3d){var _0x1e4231={};_0x1e4231[_0x378d3d]={'$like':'%'+_0xb9e96b[_0x6618('0x36')][_0x6618('0x6f')]+'%'};return _0x1e4231;})});}if(_0xb9e96b[_0x6618('0x36')]['$gte']){var _0x1de244=_0xb9e96b[_0x6618('0x36')]['$gte'][_0x6618('0xaf')](',');var _0x1f8828={};_0x1f8828[_0x1de244[0x0]]={'$gte':moment(_0x1de244[0x1])[_0x6618('0x5a')](_0x6618('0xb0'))};_0x319954[_0x6618('0x3f')]=_[_0x6618('0x95')](_0x319954[_0x6618('0x3f')],_0x1f8828);}_0x319954=_['merge']({},_0x319954,_0xb9e96b[_0x6618('0xb1')]);return db[_0x6618('0x2e')][_0x6618('0x1f')]({'where':_0x319954[_0x6618('0x3f')]})[_0x6618('0x27')](function(_0x43f974){_0x4e741f[_0x6618('0x1f')]=_0x43f974;if(_0xb9e96b[_0x6618('0x36')][_0x6618('0xa6')]){_0x319954['include']=[{'all':!![]}];}return db[_0x6618('0x2e')][_0x6618('0xb2')](_0x319954);})[_0x6618('0x27')](function(_0x5d4bdb){_0x4e741f[_0x6618('0xb3')]=_0x5d4bdb;return _0x4e741f;});}})[_0x6618('0x27')](respondWithFilteredResult(_0x4719cf,_0x319954))[_0x6618('0xa8')](handleError(_0x4719cf,null));};exports[_0x6618('0xb4')]=function(_0x22d7a8,_0xab9009,_0x520edd){return db['FaxInteraction'][_0x6618('0xa7')]({'where':{'id':_0x22d7a8['params']['id']}})[_0x6618('0x27')](handleEntityNotFound(_0xab9009,null))[_0x6618('0x27')](function(_0x37b0be){if(_0x37b0be){return _0x37b0be[_0x6618('0xb5')](_0x22d7a8[_0x6618('0xaa')][_0x6618('0xad')],_[_0x6618('0xb6')](_0x22d7a8[_0x6618('0xaa')],[_0x6618('0xad'),'id'])||{})[_0x6618('0xb7')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x22d7a8[_0x6618('0xaa')][_0x6618('0xad')]}});})[_0x6618('0x27')](function(_0x13a9c8){socket[_0x6618('0xb8')](_0x6618('0xb9'),{'id':Number(_0x22d7a8[_0x6618('0xa5')]['id']),'tags':_0x13a9c8||[]});return{'id':Number(_0x22d7a8[_0x6618('0xa5')]['id']),'tags':_0x13a9c8||[]};});}})['then'](respondWithResult(_0xab9009,null))[_0x6618('0xa8')](handleError(_0xab9009,null));};exports[_0x6618('0xba')]=function(_0x20259d,_0x47b8db,_0x9c918d){return db[_0x6618('0x34')][_0x6618('0xa7')]({'where':{'id':_0x20259d[_0x6618('0xa5')]['id']}})[_0x6618('0x27')](handleEntityNotFound(_0x47b8db,null))[_0x6618('0x27')](function(_0x58faaf){if(_0x58faaf){return _0x58faaf[_0x6618('0xba')](_0x20259d[_0x6618('0x36')][_0x6618('0xad')]);}})[_0x6618('0x27')](respondWithStatusCode(_0x47b8db,null))['catch'](handleError(_0x47b8db,null));};exports[_0x6618('0xbb')]=function(_0x449e5d,_0xfb20d6){var _0x16c3c3=moment()[_0x6618('0xbc')]()[_0x6618('0x87')]();var _0xd7efa=path[_0x6618('0xbd')](config['root'],_0x6618('0xbe'),'files',_0x6618('0xbf'));var _0x575066=path['join'](config[_0x6618('0xc0')],_0x6618('0xbe'),_0x6618('0xc1'),'tmp');var _0x2e7b7f=path['join'](_0x575066,_0x16c3c3);var _0x5debe5=util['format'](_0x6618('0xc2'),_0x16c3c3);var _0xdb0ff3=path[_0x6618('0xbd')](_0x575066,_0x5debe5);var _0x255c4f=![];return db[_0x6618('0x34')][_0x6618('0xa7')]({'where':{'id':_0x449e5d[_0x6618('0xa5')]['id']}})['then'](handleEntityNotFound(_0xfb20d6,null))['then'](function(_0x5779cd){if(_0x5779cd){return _0x5779cd[_0x6618('0xae')]({'attributes':['id','body',_0x6618('0x55')],'include':[{'model':db[_0x6618('0xc3')],'as':_0x6618('0xc3')}]});}return[];})[_0x6618('0x27')](function(_0x1e1e0d){_0x255c4f=_0x1e1e0d['length'];if(_0x1e1e0d[_0x6618('0x61')]){fs[_0x6618('0xc4')](_0x2e7b7f);for(var _0x3960f5=0x0;_0x3960f5<_0x1e1e0d['length'];_0x3960f5++){var _0x536467=_0x1e1e0d[_0x3960f5];var _0x5d6654=_0x536467[_0x6618('0xc3')];if(_0x5d6654){var _0x4cced7=path[_0x6618('0xbd')](_0xd7efa,_0x5d6654[_0x6618('0xc5')]);if(fs[_0x6618('0xc6')](_0x4cced7)){fs['createReadStream'](_0x4cced7)['pipe'](fs[_0x6618('0xc7')](path['join'](_0x2e7b7f,_0x5d6654[_0x6618('0xc5')])));}}}}})[_0x6618('0x27')](function(){if(_0x255c4f){return new BPromise(function(_0x5a549d,_0x20de45){zipdir(_0x2e7b7f,{'saveTo':_0xdb0ff3},function(_0x35dfb4,_0x45f6f1){if(_0x35dfb4)return _0x20de45(_0x35dfb4);return _0x5a549d(_0x45f6f1);});});}})['then'](function(){if(_0x255c4f){return new BPromise(function(_0xe79bb0,_0x1ab902){rimraf(_0x2e7b7f,function(_0x291cd9){if(_0x291cd9)_0x1ab902(_0x291cd9);return _0xe79bb0();});});}})[_0x6618('0x27')](function(){if(_0x255c4f){return _0xfb20d6[_0x6618('0xbb')](_0xdb0ff3,_0x5debe5,function(_0x531724){if(_0x531724){console['log'](_0x6618('0xc8'),_0x531724);}else{fs[_0x6618('0xc9')](_0xdb0ff3);}});}else{return _0xfb20d6[_0x6618('0x1b')](0xc8);}})[_0x6618('0xa8')](handleError(_0xfb20d6,null));}; \ No newline at end of file +var _0xb541=['isEmpty','FaxAccountId','concat','$lte','null','\x20IS\x20NULL','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','advancedFilter','read','%s\x20=\x200','%s\x20>\x200','toString','having','`Messages.count`\x20>\x200','tag','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','includeAll','options','find','body','update','params','describe','addMessage','ids','getMessages','findOne','sort','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','join','root','files','attachments','server','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','pipe','createWriteStream','log','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','name','send','closed','unreadMessages','FaxMessage','Users','map','forEach','Tags','push','TagIds','index','FaxInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','pick','select','field','from','tools_tags','COUNT(*)','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','ui.FaxInteractionId','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','expr','parse','createdAt','value','dateStart','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','Messages.count','length','isNil'];(function(_0x42068d,_0xc9a1c1){var _0x3904f6=function(_0x55ebfd){while(--_0x55ebfd){_0x42068d['push'](_0x42068d['shift']());}};_0x3904f6(++_0xc9a1c1);}(_0xb541,0x124));var _0x1b54=function(_0x2bb121,_0x1da890){_0x2bb121=_0x2bb121-0x0;var _0x116193=_0xb541[_0x2bb121];return _0x116193;};'use strict';var pdf=require(_0x1b54('0x0'));var emlformat=require(_0x1b54('0x1'));var rimraf=require(_0x1b54('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b54('0x3'));var rp=require(_0x1b54('0x4'));var moment=require(_0x1b54('0x5'));var BPromise=require(_0x1b54('0x6'));var Mustache=require(_0x1b54('0x7'));var util=require('util');var path=require(_0x1b54('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b54('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1b54('0xa'));var crypto=require(_0x1b54('0xb'));var jsforce=require(_0x1b54('0xc'));var deskjs=require(_0x1b54('0xd'));var toCsv=require(_0x1b54('0xe'));var querystring=require(_0x1b54('0xf'));var Papa=require('papaparse');var Redis=require(_0x1b54('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b54('0x11'));var hardwareService=require(_0x1b54('0x12'));var logger=require(_0x1b54('0x13'))('api');var utils=require(_0x1b54('0x14'));var config=require(_0x1b54('0x15'));var db=require('../../mysqldb')['db'];config[_0x1b54('0x16')]=_[_0x1b54('0x17')](config[_0x1b54('0x16')],{'host':_0x1b54('0x18'),'port':0x18eb});var socket=require(_0x1b54('0x19'))(new Redis(config[_0x1b54('0x16')]));require(_0x1b54('0x1a'))[_0x1b54('0x1b')](socket);function respondWithStatusCode(_0x357872,_0x2b2dad){_0x2b2dad=_0x2b2dad||0xcc;return function(_0x7a5a0f){if(_0x7a5a0f){return _0x357872[_0x1b54('0x1c')](_0x2b2dad);}return _0x357872[_0x1b54('0x1d')](_0x2b2dad)[_0x1b54('0x1e')]();};}function respondWithResult(_0x4932ee,_0x22d951){_0x22d951=_0x22d951||0xc8;return function(_0x3fe219){if(_0x3fe219){return _0x4932ee[_0x1b54('0x1d')](_0x22d951)[_0x1b54('0x1f')](_0x3fe219);}};}function respondWithFilteredResult(_0x49ee52,_0x5e92b3){return function(_0x5ecd62){if(_0x5ecd62){var _0x59790f=_0x5ecd62[_0x1b54('0x20')],_0x149972=_0x5e92b3['offset'],_0x6f718=_0x5e92b3[_0x1b54('0x21')]+_0x5e92b3[_0x1b54('0x22')],_0x569412;if(_0x6f718>=_0x59790f){_0x6f718=_0x59790f;_0x569412=0xc8;}else{_0x569412=0xce;}_0x49ee52[_0x1b54('0x1d')](_0x569412);return _0x49ee52['set'](_0x1b54('0x23'),_0x149972+'-'+_0x6f718+'/'+_0x59790f)[_0x1b54('0x1f')](_0x5ecd62);}return null;};}function patchUpdates(_0x506c52){return function(_0x4d7c80){try{jsonpatch['apply'](_0x4d7c80,_0x506c52,!![]);}catch(_0x9f9568){return BPromise[_0x1b54('0x24')](_0x9f9568);}return _0x4d7c80[_0x1b54('0x25')]();};}function saveUpdates(_0x52fc32,_0x2d1472){return function(_0x29cca9){if(_0x29cca9){return _0x29cca9['update'](_0x52fc32)[_0x1b54('0x26')](function(_0x4d1949){return _0x4d1949;});}return null;};}function removeEntity(_0x3465e8,_0x2a05e1){return function(_0x123893){if(_0x123893){return _0x123893[_0x1b54('0x27')]()['then'](function(){_0x3465e8[_0x1b54('0x1d')](0xcc)[_0x1b54('0x1e')]();});}};}function handleEntityNotFound(_0x50a9ed,_0x1930ea){return function(_0x2de205){if(!_0x2de205){_0x50a9ed[_0x1b54('0x1c')](0x194);}return _0x2de205;};}function handleError(_0x3fc942,_0x5ab72e){_0x5ab72e=_0x5ab72e||0x1f4;return function(_0x576373){logger['error'](_0x576373['stack']);if(_0x576373[_0x1b54('0x28')]){delete _0x576373[_0x1b54('0x28')];}_0x3fc942['status'](_0x5ab72e)[_0x1b54('0x29')](_0x576373);};}function getInteractionUnreadMessages(_0x499c06){return new BPromise(function(_0x38a42d,_0x37dbde){try{if(_0x499c06[_0x1b54('0x2a')]){_0x499c06[_0x1b54('0x2b')]=0x0;_0x38a42d(_0x499c06);}else{return db[_0x1b54('0x2c')][_0x1b54('0x20')]({'where':{'FaxInteractionId':_0x499c06['id'],'direction':'in','read':![]}})[_0x1b54('0x26')](function(_0x452e58){_0x499c06[_0x1b54('0x2b')]=_0x452e58;_0x38a42d(_0x499c06);});}}catch(_0x4a4a40){_0x37dbde(_0x4a4a40);}});}function getInteractionUsers(_0x4ba04a,_0x386957){return new BPromise(function(_0x525981,_0x4deb28){try{if(_0x386957[_0x4ba04a['id']]){_0x4ba04a[_0x1b54('0x2d')]=_[_0x1b54('0x2e')](_0x386957[_0x4ba04a['id']],function(_0x106258){return{'id':_0x106258['id']};});}}catch(_0x334841){_0x4deb28(_0x334841);}_0x525981(_0x4ba04a);});}function getInteractionTags(_0x8ee402,_0x13d45a){return new BPromise(function(_0x4689be,_0x37ee8a){try{if(_0x8ee402['TagIds']){_0x8ee402['Tags']=[];_0x8ee402['TagIds']['split'](',')[_0x1b54('0x2f')](function(_0x499cc0){_0x8ee402[_0x1b54('0x30')][_0x1b54('0x31')](_0x13d45a[_0x499cc0]);});}delete _0x8ee402[_0x1b54('0x32')];}catch(_0x28a8e9){_0x37ee8a(_0x28a8e9);}_0x4689be(_0x8ee402);});}function updateFaxInteraction(_0x4fe86e,_0x4f5366,_0x109d3a){return new BPromise(function(_0x9e98b4,_0x3b68a4){return getInteractionUnreadMessages(_0x4fe86e)['then'](function(_0x52ac72){return getInteractionUsers(_0x52ac72,_0x109d3a);})['then'](function(_0x4e4aeb){return getInteractionTags(_0x4e4aeb,_0x4f5366);})[_0x1b54('0x26')](function(_0x3b1458){_0x9e98b4(_0x3b1458);})['catch'](function(_0x28658d){_0x3b68a4(_0x28658d);});});}exports[_0x1b54('0x33')]=function(_0x5a4d92,_0x1231c3){var _0x4410d0={},_0x29770d={},_0x1fbf4b={'count':0x0,'rows':[]};var _0x148851=db[_0x1b54('0x34')][_0x1b54('0x35')];_0x29770d['model']=_[_0x1b54('0x36')](_0x148851);_0x29770d[_0x1b54('0x37')]=_[_0x1b54('0x36')](_0x5a4d92['query']);_0x29770d[_0x1b54('0x38')]=_[_0x1b54('0x39')](_0x29770d[_0x1b54('0x3a')],_0x29770d[_0x1b54('0x37')]);_0x4410d0[_0x1b54('0x3b')]=_[_0x1b54('0x39')](_0x29770d[_0x1b54('0x3a')],qs[_0x1b54('0x3c')](_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x3c')]));_0x4410d0['attributes']=_0x4410d0[_0x1b54('0x3b')]['length']?_0x4410d0[_0x1b54('0x3b')]:_0x29770d['model'];if(!_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x3d')](_0x1b54('0x3e'))){_0x4410d0[_0x1b54('0x22')]=qs[_0x1b54('0x22')](_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x22')]);_0x4410d0[_0x1b54('0x21')]=qs['offset'](_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x21')]);}_0x4410d0['order']=qs['sort'](_0x5a4d92['query']['sort']);_0x4410d0[_0x1b54('0x3f')]=qs['filters'](_[_0x1b54('0x40')](_0x5a4d92[_0x1b54('0x37')],_0x29770d['filters']));var _0x1d47ac=[];var _0x55922f=squel[_0x1b54('0x41')]()[_0x1b54('0x42')]('id')[_0x1b54('0x42')](_0x1b54('0x28'))[_0x1b54('0x42')]('color')[_0x1b54('0x43')](_0x1b54('0x44'));var _0x16628e=squel[_0x1b54('0x41')]()[_0x1b54('0x42')](_0x1b54('0x45'))[_0x1b54('0x43')]('fax_messages','me')[_0x1b54('0x3f')](_0x1b54('0x46'))[_0x1b54('0x3f')](_0x1b54('0x47'))[_0x1b54('0x3f')]('me.read\x20=\x20false');var _0x332846=squel['select']()[_0x1b54('0x42')]('u.id')[_0x1b54('0x42')](_0x1b54('0x48'))['from']('user_has_fax_interactions','ui')['left_join']('users','u',_0x1b54('0x49'));var _0xc0bde0=squel[_0x1b54('0x41')]()['from'](_0x1b54('0x4a'),'i')['left_join'](_0x1b54('0x4b'),'c',_0x1b54('0x4c'))[_0x1b54('0x4d')]('users','o',_0x1b54('0x4e'))[_0x1b54('0x4d')](_0x1b54('0x4f'),'a',_0x1b54('0x50'))[_0x1b54('0x4d')](_0x1b54('0x51'),'me','me.FaxInteractionId\x20=\x20i.id');var _0xeeee1c=squel[_0x1b54('0x52')]();if(_0x5a4d92[_0x1b54('0x37')]['advancedFilter']){var _0x999e63=JSON[_0x1b54('0x53')](_0x5a4d92[_0x1b54('0x37')]['advancedFilter']);_[_0x1b54('0x36')](_0x999e63)[_0x1b54('0x2f')](function(_0x5d87bb){var _0x4e9a51=_0x999e63[_0x5d87bb];if(_0x5d87bb===_0x1b54('0x54')){var _0x21e2d8=moment(_0x4e9a51[_0x1b54('0x55')][_0x1b54('0x56')])['startOf'](_0x1b54('0x57'))['utc']()['format']();var _0x4a43f6=moment(_0x4a43f6)[_0x1b54('0x58')]()['endOf'](_0x1b54('0x57'))[_0x1b54('0x59')]();_0xeeee1c[_0x1b54('0x5a')](_0x1b54('0x5b'),_0x21e2d8,_0x4a43f6);}else{if(_['isArray'](_0x4e9a51[_0x1b54('0x5c')])){_0x4e9a51[_0x1b54('0x5c')][_0x1b54('0x2f')](function(_0x4e58ab){switch(_0x4e9a51[_0x1b54('0x5c')][_0x1b54('0x55')]){case'IS':if(_0x5d87bb!==_0x1b54('0x5d')&&_0x5d87bb!=='Messages.count'){if(_[_0x1b54('0x5e')](_0x4e9a51[_0x1b54('0x55')])&&_0x4e9a51['value']['length']>0x1){_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+_0x1b54('0x5f'),_0x4e9a51[_0x1b54('0x55')]);}else{_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+'\x20=\x20?',_0x4e9a51[_0x1b54('0x55')][0x0]);}}break;case'=':_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+_0x1b54('0x61'),_0x4e9a51[_0x1b54('0x55')]);break;case _0x1b54('0x62'):if(_0x5d87bb===_0x1b54('0x63')){_0xeeee1c[_0x1b54('0x5a')](_0x1b54('0x64')+'\x20LIKE\x20?','%'+_0x4e9a51[_0x1b54('0x55')]+'%');_0xeeee1c['or'](_0x1b54('0x65')+_0x1b54('0x66'),'%'+_0x4e9a51['value']+'%');_0xeeee1c['or'](_0x1b54('0x67')+_0x1b54('0x66'),'%'+_0x4e9a51[_0x1b54('0x55')]+'%');}else{_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+_0x1b54('0x66'),'%'+_0x4e9a51['value']+'%');}break;case'>':_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+_0x1b54('0x68'),_0x4e9a51[_0x1b54('0x55')]);break;case'<':_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+'\x20<\x20?',_0x4e9a51[_0x1b54('0x55')]);break;}});}else{switch(_0x4e9a51[_0x1b54('0x5c')][_0x1b54('0x55')]){case'IS':if(_0x5d87bb!==_0x1b54('0x5d')&&_0x5d87bb!==_0x1b54('0x69')){if(_[_0x1b54('0x5e')](_0x4e9a51[_0x1b54('0x55')])&&_0x4e9a51[_0x1b54('0x55')][_0x1b54('0x6a')]>0x1){_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+_0x1b54('0x5f'),_0x4e9a51['value']);}else{_0xeeee1c['and'](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+'\x20=\x20?',_0x4e9a51[_0x1b54('0x55')][0x0]);}}break;case'=':_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+_0x1b54('0x61'),_0x4e9a51[_0x1b54('0x55')]);break;case'LIKE':if(_0x5d87bb===_0x1b54('0x63')){_0xeeee1c[_0x1b54('0x5a')](_0x1b54('0x64')+_0x1b54('0x66'),'%'+_0x4e9a51[_0x1b54('0x55')]+'%');_0xeeee1c['or'](_0x1b54('0x65')+'\x20LIKE\x20?','%'+_0x4e9a51[_0x1b54('0x55')]+'%');_0xeeee1c['or'](_0x1b54('0x67')+'\x20LIKE\x20?','%'+_0x4e9a51[_0x1b54('0x55')]+'%');}else{_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+_0x1b54('0x66'),'%'+_0x4e9a51['value']+'%');}break;case'>':_0xeeee1c[_0x1b54('0x5a')](_0x4e9a51[_0x1b54('0x60')]+'.'+_0x5d87bb+_0x1b54('0x68'),_0x4e9a51[_0x1b54('0x55')]);break;case'<':_0xeeee1c['and'](_0x4e9a51['tableAlias']+'.'+_0x5d87bb+'\x20<\x20?',_0x4e9a51[_0x1b54('0x55')]);break;}}}});}else{var _0x2f7fff=_(Object[_0x1b54('0x36')](_0x5a4d92[_0x1b54('0x37')]))[_0x1b54('0x2e')](function(_0x4cd0c8){return _0x148851[_0x1b54('0x3d')](_0x4cd0c8)?_0x4cd0c8:undefined;})['filter'](function(_0x4ab3c2){return!_[_0x1b54('0x6b')](_0x4ab3c2);})[_0x1b54('0x55')]();if(!_[_0x1b54('0x6c')](_0x2f7fff)){_0x2f7fff[_0x1b54('0x2f')](function(_0x390c1b){if(_0x390c1b===_0x1b54('0x6d')){_0xc0bde0['where']('i.FaxAccountId\x20IN\x20?',[][_0x1b54('0x6e')](_0x5a4d92[_0x1b54('0x37')][_0x390c1b]));}else if(_0x390c1b==='createdAt'){var _0x16eb3e=JSON[_0x1b54('0x53')](_0x5a4d92[_0x1b54('0x37')][_0x390c1b])['$gte'];var _0x42e88c=JSON['parse'](_0x5a4d92['query'][_0x390c1b])[_0x1b54('0x6f')];_0xc0bde0[_0x1b54('0x3f')](_0x1b54('0x5b'),_0x16eb3e,_0x42e88c);}else{if(_0x5a4d92[_0x1b54('0x37')][_0x390c1b]===_0x1b54('0x70')){_0xc0bde0[_0x1b54('0x3f')]('i.'+_0x390c1b+_0x1b54('0x71'));}else{_0xc0bde0[_0x1b54('0x3f')]('i.'+_0x390c1b+'\x20=\x20?',_0x5a4d92['query'][_0x390c1b]);}}});}if(_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x72')]){var _0x52c27c=_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x72')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1b54('0x73'));if(qs[_0x1b54('0x74')](_0x52c27c)){_0xeeee1c['or'](_0x1b54('0x75'),_0x52c27c+'%')['or'](_0x1b54('0x76'),_0x52c27c+'%');}_0xeeee1c['or'](_0x1b54('0x77'),_0x52c27c+'%');}}_0xc0bde0[_0x1b54('0x3f')](_0xeeee1c);if(_0x4410d0[_0x1b54('0x78')]){_0x4410d0[_0x1b54('0x78')][_0x1b54('0x2f')](function(_0x4d3741){_0xc0bde0[_0x1b54('0x78')]('i.'+_0x4d3741[0x0],_0x4d3741[0x1]===_0x1b54('0x79')?![]:!![]);});}_0xc0bde0[_0x1b54('0x7a')](_0x1b54('0x7b'));var _0x4d6550={'type':db[_0x1b54('0x7c')][_0x1b54('0x7d')][_0x1b54('0x7e')],'raw':!![]};var _0x436fb0=_0xc0bde0[_0x1b54('0x7f')]()['field'](_0x1b54('0x45'));if(!_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x80')]){if(_0x5a4d92[_0x1b54('0x37')]['read']){if(_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x81')]==0x1){_0x436fb0['where'](util[_0x1b54('0x59')](_0x1b54('0x82'),_0x16628e['toString']()));_0xc0bde0['having']('`Messages.count`\x20=\x200');}else{_0x436fb0[_0x1b54('0x3f')](util['format'](_0x1b54('0x83'),_0x16628e[_0x1b54('0x84')]()));_0xc0bde0[_0x1b54('0x85')](_0x1b54('0x86'));}}if(_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x87')]){var _0x34fb42=_[_0x1b54('0x5e')](_0x5a4d92['query'][_0x1b54('0x87')])?_0x5a4d92[_0x1b54('0x37')]['tag']:new Array(_0x5a4d92[_0x1b54('0x37')][_0x1b54('0x87')]);var _0x9fbd39=squel['expr']();_0x34fb42[_0x1b54('0x2f')](function(_0x489686){_0x9fbd39['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x489686+',%');});_0xc0bde0[_0x1b54('0x85')](_0x9fbd39);_0x436fb0[_0x1b54('0x4d')](_0x1b54('0x88'),'it',_0x1b54('0x89'));_0x436fb0['left_join']('tools_tags','t',_0x1b54('0x8a'));_0x436fb0[_0x1b54('0x3f')](_0x1b54('0x8b'),_0x34fb42);}}else{var _0x999e63=JSON['parse'](_0x5a4d92['query'][_0x1b54('0x80')]);_['keys'](_0x999e63)[_0x1b54('0x2f')](function(_0x311f99){var _0x14002a=_0x999e63[_0x311f99];if(_0x311f99===_0x1b54('0x5d')){var _0x516086=_0x14002a[_0x1b54('0x55')];var _0x3ae6b5=squel[_0x1b54('0x52')]();_0x516086[_0x1b54('0x2f')](function(_0xec9e4f){_0x3ae6b5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xec9e4f+',%');});_0xc0bde0['having'](_0x3ae6b5);_0x436fb0[_0x1b54('0x4d')](_0x1b54('0x8c'),'it',_0x1b54('0x8d'));_0x436fb0[_0x1b54('0x4d')](_0x1b54('0x44'),'t',_0x1b54('0x8a'));_0x436fb0[_0x1b54('0x3f')](_0x1b54('0x8b'),_0x516086);}else if(_0x311f99==='Messages.count'){if(_0x14002a[_0x1b54('0x55')]['length']===0x1){if(_0x14002a[_0x1b54('0x55')][0x0]===0x1){_0x436fb0[_0x1b54('0x3f')](util['format']('%s\x20=\x200',_0x16628e['toString']()));_0xc0bde0[_0x1b54('0x85')]('`Messages.count`\x20=\x200');}else{_0x436fb0[_0x1b54('0x3f')](util[_0x1b54('0x59')](_0x1b54('0x83'),_0x16628e[_0x1b54('0x84')]()));_0xc0bde0['having'](_0x1b54('0x86'));}}}});}db[_0x1b54('0x8e')]['query'](_0x436fb0[_0x1b54('0x84')](),_0x4d6550)[_0x1b54('0x26')](function(_0x3cf8a7){_0x1fbf4b[_0x1b54('0x20')]=_0x3cf8a7[_0x1b54('0x6a')];if(_0x1fbf4b[_0x1b54('0x20')]===0x0)return[];return db[_0x1b54('0x8e')]['query'](_0x55922f['toString'](),_0x4d6550)[_0x1b54('0x26')](function(_0x33d402){_0x1d47ac=_[_0x1b54('0x8f')](_0x33d402,'id');_0x4d6550=_[_0x1b54('0x90')](_0x4d6550,{'model':db[_0x1b54('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xc0bde0[_0x1b54('0x42')](_0x1b54('0x91'),'Account.key');_0xc0bde0[_0x1b54('0x42')](_0x1b54('0x92'));_0xc0bde0['field']('c.firstName',_0x1b54('0x93'));_0xc0bde0[_0x1b54('0x42')]('c.lastName',_0x1b54('0x94'));_0xc0bde0[_0x1b54('0x42')]('c.email',_0x1b54('0x95'));_0xc0bde0[_0x1b54('0x42')]('c.phone',_0x1b54('0x96'));_0xc0bde0['field']('c.mobile',_0x1b54('0x97'));_0xc0bde0[_0x1b54('0x42')](_0x1b54('0x98'),'Contact.fax');_0xc0bde0[_0x1b54('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1b54('0x32'));_0xc0bde0[_0x1b54('0x4d')](_0x1b54('0x88'),'it',_0x1b54('0x89'));_0xc0bde0[_0x1b54('0x4d')](_0x1b54('0x44'),'t',_0x1b54('0x8a'));_0xc0bde0[_0x1b54('0x22')](_0x4410d0[_0x1b54('0x22')]);_0xc0bde0[_0x1b54('0x21')](_0x4410d0[_0x1b54('0x21')]);return db[_0x1b54('0x8e')][_0x1b54('0x37')](_0xc0bde0[_0x1b54('0x84')](),_0x4d6550);})['then'](function(_0x3a27f5){_0x332846[_0x1b54('0x3f')](_0x1b54('0x99'),_[_0x1b54('0x2e')](_0x3a27f5,'id'));return db[_0x1b54('0x8e')][_0x1b54('0x37')](_0x332846['toString'](),_0x4d6550)[_0x1b54('0x26')](function(_0x424c6b){var _0x15dba3=_[_0x1b54('0x9a')](_0x424c6b,_0x1b54('0x9b'));var _0x329243=[];_0x3a27f5[_0x1b54('0x2f')](function(_0x4d5bb8){_0x329243['push'](updateFaxInteraction(_0x4d5bb8,_0x1d47ac,_0x15dba3));});return BPromise['all'](_0x329243);});});})[_0x1b54('0x26')](function(_0x30b0f4){_0x1fbf4b['rows']=_0x30b0f4;return _0x1fbf4b;})[_0x1b54('0x26')](respondWithFilteredResult(_0x1231c3,_0x4410d0))[_0x1b54('0x9c')](handleError(_0x1231c3,null));};exports['show']=function(_0x3f3d8d,_0x3e34fa){var _0x5d6c69={'raw':![],'where':{'id':_0x3f3d8d['params']['id']}},_0x38bbe1={};_0x38bbe1[_0x1b54('0x3a')]=_[_0x1b54('0x36')](db['FaxInteraction'][_0x1b54('0x35')]);_0x38bbe1[_0x1b54('0x37')]=_[_0x1b54('0x36')](_0x3f3d8d[_0x1b54('0x37')]);_0x38bbe1[_0x1b54('0x38')]=_[_0x1b54('0x39')](_0x38bbe1[_0x1b54('0x3a')],_0x38bbe1[_0x1b54('0x37')]);_0x5d6c69[_0x1b54('0x3b')]=_[_0x1b54('0x39')](_0x38bbe1[_0x1b54('0x3a')],qs[_0x1b54('0x3c')](_0x3f3d8d['query']['fields']));_0x5d6c69['attributes']=_0x5d6c69['attributes'][_0x1b54('0x6a')]?_0x5d6c69[_0x1b54('0x3b')]:_0x38bbe1[_0x1b54('0x3a')];if(_0x3f3d8d['query'][_0x1b54('0x9d')]){_0x5d6c69['include']=[{'all':!![]}];}_0x5d6c69=_[_0x1b54('0x90')]({},_0x5d6c69,_0x3f3d8d[_0x1b54('0x9e')]);return db[_0x1b54('0x34')][_0x1b54('0x9f')](_0x5d6c69)[_0x1b54('0x26')](handleEntityNotFound(_0x3e34fa,null))[_0x1b54('0x26')](respondWithResult(_0x3e34fa,null))['catch'](handleError(_0x3e34fa,null));};exports['create']=function(_0x23a0dc,_0x1acf51){return db['FaxInteraction']['create'](_0x23a0dc[_0x1b54('0xa0')],{})[_0x1b54('0x26')](respondWithResult(_0x1acf51,0xc9))[_0x1b54('0x9c')](handleError(_0x1acf51,null));};exports[_0x1b54('0xa1')]=function(_0x3358e1,_0x228932){if(_0x3358e1['body']['id']){delete _0x3358e1[_0x1b54('0xa0')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x3358e1[_0x1b54('0xa2')]['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x228932,null))[_0x1b54('0x26')](saveUpdates(_0x3358e1['body'],null))[_0x1b54('0x26')](respondWithResult(_0x228932,null))[_0x1b54('0x9c')](handleError(_0x228932,null));};exports[_0x1b54('0x27')]=function(_0x3d5e71,_0x18e083){return db[_0x1b54('0x34')]['find']({'where':{'id':_0x3d5e71[_0x1b54('0xa2')]['id']}})['then'](handleEntityNotFound(_0x18e083,null))[_0x1b54('0x26')](removeEntity(_0x18e083,null))['catch'](handleError(_0x18e083,null));};exports[_0x1b54('0xa3')]=function(_0x50e821,_0x3014e2){return db[_0x1b54('0x34')][_0x1b54('0xa3')]()[_0x1b54('0x26')](respondWithResult(_0x3014e2,null))[_0x1b54('0x9c')](handleError(_0x3014e2,null));};exports['addMessage']=function(_0x58c1b5,_0x15ff75,_0x1afa64){return db[_0x1b54('0x2c')]['find']({'where':{'id':_0x58c1b5[_0x1b54('0xa2')]['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x15ff75,null))[_0x1b54('0x26')](function(_0x5eeaf2){if(_0x5eeaf2){return _0x5eeaf2[_0x1b54('0xa4')](_0x58c1b5[_0x1b54('0xa0')][_0x1b54('0xa5')],_['omit'](_0x58c1b5[_0x1b54('0xa0')],['ids','id'])||{});}})[_0x1b54('0x26')](respondWithResult(_0x15ff75,null))['catch'](handleError(_0x15ff75,null));};exports[_0x1b54('0xa6')]=function(_0x546c17,_0x31aa3a,_0x57b3b9){var _0x171bf3={'raw':![],'where':{}};var _0x24b9bf={};var _0x3dd6f5={'count':0x0,'rows':[]};return db[_0x1b54('0x34')][_0x1b54('0xa7')]({'where':{'id':_0x546c17['params']['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x31aa3a,null))['then'](function(_0x52be6b){if(_0x52be6b){_0x24b9bf[_0x1b54('0x3a')]=_[_0x1b54('0x36')](db[_0x1b54('0x2c')][_0x1b54('0x35')]);_0x24b9bf[_0x1b54('0x37')]=_[_0x1b54('0x36')](_0x546c17[_0x1b54('0x37')]);_0x24b9bf[_0x1b54('0x38')]=_[_0x1b54('0x39')](_0x24b9bf[_0x1b54('0x3a')],_0x24b9bf[_0x1b54('0x37')]);_0x171bf3[_0x1b54('0x3b')]=_[_0x1b54('0x39')](_0x24b9bf[_0x1b54('0x3a')],qs[_0x1b54('0x3c')](_0x546c17[_0x1b54('0x37')][_0x1b54('0x3c')]));_0x171bf3[_0x1b54('0x3b')]=_0x171bf3['attributes']['length']?_0x171bf3['attributes']:_0x24b9bf[_0x1b54('0x3a')];if(!_0x546c17[_0x1b54('0x37')][_0x1b54('0x3d')](_0x1b54('0x3e'))){_0x171bf3['limit']=qs[_0x1b54('0x22')](_0x546c17[_0x1b54('0x37')][_0x1b54('0x22')]);_0x171bf3[_0x1b54('0x21')]=qs[_0x1b54('0x21')](_0x546c17[_0x1b54('0x37')][_0x1b54('0x21')]);}_0x171bf3['order']=qs[_0x1b54('0xa8')](_0x546c17['query'][_0x1b54('0xa8')]);_0x171bf3[_0x1b54('0x3f')]=qs[_0x1b54('0x38')](_[_0x1b54('0x40')](_0x546c17[_0x1b54('0x37')],_0x24b9bf[_0x1b54('0x38')]));_0x171bf3[_0x1b54('0x3f')]['FaxInteractionId']=_0x52be6b['id'];if(_0x546c17[_0x1b54('0x37')][_0x1b54('0x72')]){_0x171bf3[_0x1b54('0x3f')]=_[_0x1b54('0x90')](_0x171bf3[_0x1b54('0x3f')],{'$or':_[_0x1b54('0x2e')](_0x171bf3['attributes'],function(_0x1c7268){var _0x5b3201={};_0x5b3201[_0x1c7268]={'$like':'%'+_0x546c17[_0x1b54('0x37')][_0x1b54('0x72')]+'%'};return _0x5b3201;})});}if(_0x546c17[_0x1b54('0x37')]['$gte']){var _0xc166fc=_0x546c17['query'][_0x1b54('0xa9')][_0x1b54('0xaa')](',');var _0x29441e={};_0x29441e[_0xc166fc[0x0]]={'$gte':moment(_0xc166fc[0x1])[_0x1b54('0x59')](_0x1b54('0xab'))};_0x171bf3[_0x1b54('0x3f')]=_['merge'](_0x171bf3[_0x1b54('0x3f')],_0x29441e);}_0x171bf3=_[_0x1b54('0x90')]({},_0x171bf3,_0x546c17[_0x1b54('0x9e')]);return db[_0x1b54('0x2c')][_0x1b54('0x20')]({'where':_0x171bf3[_0x1b54('0x3f')]})['then'](function(_0x3e1981){_0x3dd6f5[_0x1b54('0x20')]=_0x3e1981;if(_0x546c17[_0x1b54('0x37')][_0x1b54('0x9d')]){_0x171bf3[_0x1b54('0xac')]=[{'all':!![]}];}return db[_0x1b54('0x2c')][_0x1b54('0xad')](_0x171bf3);})[_0x1b54('0x26')](function(_0x3045e2){_0x3dd6f5[_0x1b54('0xae')]=_0x3045e2;return _0x3dd6f5;});}})[_0x1b54('0x26')](respondWithFilteredResult(_0x31aa3a,_0x171bf3))['catch'](handleError(_0x31aa3a,null));};exports[_0x1b54('0xaf')]=function(_0x301c8e,_0x5d020e,_0x363a30){return db[_0x1b54('0x34')][_0x1b54('0x9f')]({'where':{'id':_0x301c8e[_0x1b54('0xa2')]['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x5d020e,null))[_0x1b54('0x26')](function(_0x1494f3){if(_0x1494f3){return _0x1494f3[_0x1b54('0xb0')](_0x301c8e[_0x1b54('0xa0')][_0x1b54('0xa5')],_[_0x1b54('0xb1')](_0x301c8e['body'],[_0x1b54('0xa5'),'id'])||{})[_0x1b54('0xb2')](function(){return db[_0x1b54('0xb3')][_0x1b54('0xad')]({'attributes':['id',_0x1b54('0x28'),_0x1b54('0xb4')],'where':{'id':_0x301c8e[_0x1b54('0xa0')]['ids']}});})[_0x1b54('0x26')](function(_0x522ece){socket[_0x1b54('0xb5')]('faxInteractionTags:save',{'id':Number(_0x301c8e[_0x1b54('0xa2')]['id']),'tags':_0x522ece||[]});return{'id':Number(_0x301c8e[_0x1b54('0xa2')]['id']),'tags':_0x522ece||[]};});}})[_0x1b54('0x26')](respondWithResult(_0x5d020e,null))[_0x1b54('0x9c')](handleError(_0x5d020e,null));};exports[_0x1b54('0xb6')]=function(_0x2db4a2,_0x2d2452,_0x5a001a){return db[_0x1b54('0x34')][_0x1b54('0x9f')]({'where':{'id':_0x2db4a2[_0x1b54('0xa2')]['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x2d2452,null))['then'](function(_0xca805d){if(_0xca805d){return _0xca805d['removeTags'](_0x2db4a2[_0x1b54('0x37')][_0x1b54('0xa5')]);}})[_0x1b54('0x26')](respondWithStatusCode(_0x2d2452,null))[_0x1b54('0x9c')](handleError(_0x2d2452,null));};exports[_0x1b54('0xb7')]=function(_0x25f0df,_0x139e90){var _0x47c71d=moment()[_0x1b54('0xb8')]()[_0x1b54('0x84')]();var _0x580a72=path[_0x1b54('0xb9')](config[_0x1b54('0xba')],'server',_0x1b54('0xbb'),_0x1b54('0xbc'));var _0x564859=path[_0x1b54('0xb9')](config['root'],_0x1b54('0xbd'),_0x1b54('0xbb'),_0x1b54('0xbe'));var _0x3da13c=path[_0x1b54('0xb9')](_0x564859,_0x47c71d);var _0x5b24c7=util['format'](_0x1b54('0xbf'),_0x47c71d);var _0x53e949=path[_0x1b54('0xb9')](_0x564859,_0x5b24c7);var _0x5dd80d=![];return db[_0x1b54('0x34')]['find']({'where':{'id':_0x25f0df['params']['id']}})[_0x1b54('0x26')](handleEntityNotFound(_0x139e90,null))[_0x1b54('0x26')](function(_0x95ca81){if(_0x95ca81){return _0x95ca81['getMessages']({'attributes':['id',_0x1b54('0xa0'),_0x1b54('0x54')],'include':[{'model':db[_0x1b54('0xc0')],'as':_0x1b54('0xc0')}]});}return[];})[_0x1b54('0x26')](function(_0x58325b){_0x5dd80d=_0x58325b[_0x1b54('0x6a')];if(_0x58325b['length']){fs[_0x1b54('0xc1')](_0x3da13c);for(var _0x16e35c=0x0;_0x16e35c<_0x58325b[_0x1b54('0x6a')];_0x16e35c++){var _0x22d66e=_0x58325b[_0x16e35c];var _0x11ffa0=_0x22d66e[_0x1b54('0xc0')];if(_0x11ffa0){var _0x1cb0ca=path[_0x1b54('0xb9')](_0x580a72,_0x11ffa0[_0x1b54('0xc2')]);if(fs[_0x1b54('0xc3')](_0x1cb0ca)){fs['createReadStream'](_0x1cb0ca)[_0x1b54('0xc4')](fs[_0x1b54('0xc5')](path[_0x1b54('0xb9')](_0x3da13c,_0x11ffa0[_0x1b54('0xc2')])));}}}}})[_0x1b54('0x26')](function(){if(_0x5dd80d){return new BPromise(function(_0x375d98,_0x159f23){zipdir(_0x3da13c,{'saveTo':_0x53e949},function(_0x3d6a1e,_0x46b19c){if(_0x3d6a1e)return _0x159f23(_0x3d6a1e);return _0x375d98(_0x46b19c);});});}})['then'](function(){if(_0x5dd80d){return new BPromise(function(_0x1ce243,_0x3ce716){rimraf(_0x3da13c,function(_0xf77926){if(_0xf77926)_0x3ce716(_0xf77926);return _0x1ce243();});});}})[_0x1b54('0x26')](function(){if(_0x5dd80d){return _0x139e90[_0x1b54('0xb7')](_0x53e949,_0x5b24c7,function(_0x71b288){if(_0x71b288){console[_0x1b54('0xc6')]('err',_0x71b288);}else{fs[_0x1b54('0xc7')](_0x53e949);}});}else{return _0x139e90[_0x1b54('0x1c')](0xc8);}})['catch'](handleError(_0x139e90,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8a97d9f..ec57753 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 _0x2024=['then','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x4f06fa,_0x31c38b){var _0x25c1a1=function(_0x273e76){while(--_0x273e76){_0x4f06fa['push'](_0x4f06fa['shift']());}};_0x25c1a1(++_0x31c38b);}(_0x2024,0xf7));var _0x4202=function(_0x16ccaf,_0x25941a){_0x16ccaf=_0x16ccaf-0x0;var _0x56958a=_0x2024[_0x16ccaf];return _0x56958a;};'use strict';var EventEmitter=require(_0x4202('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x4202('0x1')];var FaxMessage=require(_0x4202('0x2'))['db'][_0x4202('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4202('0x4')](0x0);var events={'afterCreate':_0x4202('0x5'),'afterUpdate':_0x4202('0x6'),'afterDestroy':_0x4202('0x7')};function emitEvent(_0x3d21ee){return function(_0x650a7e,_0x2b36c1,_0x1c7be3){_0x650a7e['getUsers']({'attributes':['id'],'raw':!![]})[_0x4202('0x8')](function(_0x127345){_0x650a7e['setDataValue']('Users',_0x127345['map'](function(_0x359e25){return{'id':_0x359e25['id']};}));return FaxMessage[_0x4202('0x9')]({'where':{'FaxInteractionId':_0x650a7e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4832fe){_0x650a7e[_0x4202('0xa')](_0x4202('0xb'),_0x4832fe['length']);FaxInteractionEvents['emit'](_0x3d21ee+':'+_0x650a7e['id'],_0x650a7e);FaxInteractionEvents[_0x4202('0xc')](_0x3d21ee,_0x650a7e);_0x1c7be3(null);})[_0x4202('0xd')](_0x1c7be3(null));};}for(var e in events){if(events[_0x4202('0xe')](e)){var event=events[e];FaxInteraction[_0x4202('0xf')](e,emitEvent(event));}}module[_0x4202('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x555a=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0x5410d4,_0x41c615){var _0xb1823f=function(_0x41c694){while(--_0x41c694){_0x5410d4['push'](_0x5410d4['shift']());}};_0xb1823f(++_0x41c615);}(_0x555a,0xe0));var _0xa555=function(_0x2d0502,_0x2418ac){_0x2d0502=_0x2d0502-0x0;var _0x1ad75e=_0x555a[_0x2d0502];return _0x1ad75e;};'use strict';var EventEmitter=require(_0xa555('0x0'));var FaxInteraction=require(_0xa555('0x1'))['db'][_0xa555('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xa555('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa555('0x4'),'afterUpdate':'update','afterDestroy':_0xa555('0x5')};function emitEvent(_0x284d8c){return function(_0x4bf710,_0x330bb8,_0x174afb){_0x4bf710[_0xa555('0x6')]({'attributes':['id'],'raw':!![]})[_0xa555('0x7')](function(_0x5a1754){_0x4bf710[_0xa555('0x8')](_0xa555('0x9'),_0x5a1754[_0xa555('0xa')](function(_0x37b5ce){return{'id':_0x37b5ce['id']};}));return FaxMessage[_0xa555('0xb')]({'where':{'FaxInteractionId':_0x4bf710['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa555('0x7')](function(_0x3a8189){_0x4bf710['setDataValue'](_0xa555('0xc'),_0x3a8189[_0xa555('0xd')]);FaxInteractionEvents['emit'](_0x284d8c+':'+_0x4bf710['id'],_0x4bf710);FaxInteractionEvents[_0xa555('0xe')](_0x284d8c,_0x4bf710);_0x174afb(null);})[_0xa555('0xf')](_0x174afb(null));};}for(var e in events){if(events[_0xa555('0x10')](e)){var event=events[e];FaxInteraction[_0xa555('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 394ea06..81912ed 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 _0xff3d=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x5b2fe0,_0x4a0c76){var _0x3a3091=function(_0x337b74){while(--_0x337b74){_0x5b2fe0['push'](_0x5b2fe0['shift']());}};_0x3a3091(++_0x4a0c76);}(_0xff3d,0x1c9));var _0xdff3=function(_0x46b157,_0x2e75b1){_0x46b157=_0x46b157-0x0;var _0x2d16e7=_0xff3d[_0x46b157];return _0x2d16e7;};'use strict';var _=require(_0xdff3('0x0'));var util=require(_0xdff3('0x1'));var logger=require(_0xdff3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdff3('0x3'));var rp=require(_0xdff3('0x4'));var fs=require('fs');var path=require(_0xdff3('0x5'));var rimraf=require(_0xdff3('0x6'));var config=require(_0xdff3('0x7'));var attributes=require(_0xdff3('0x8'));module[_0xdff3('0x9')]=function(_0x5d5865,_0x5efc38){return _0x5d5865[_0xdff3('0xa')](_0xdff3('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec069,_0x3a3b46,_0x531485){if(_0x1ec069[_0xdff3('0xc')]('closed')){_0x1ec069[_0xdff3('0xd')]=moment()[_0xdff3('0xe')](_0xdff3('0xf'));}_0x531485(null,_0x1ec069);}}});}; \ No newline at end of file +var _0xcdf2=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x49ea24,_0x4415ff){var _0x54c9ec=function(_0x55f9eb){while(--_0x55f9eb){_0x49ea24['push'](_0x49ea24['shift']());}};_0x54c9ec(++_0x4415ff);}(_0xcdf2,0xd7));var _0x2cdf=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xcdf2[_0x888385];return _0x22d5c2;};'use strict';var _=require(_0x2cdf('0x0'));var util=require(_0x2cdf('0x1'));var logger=require(_0x2cdf('0x2'))(_0x2cdf('0x3'));var moment=require(_0x2cdf('0x4'));var BPromise=require(_0x2cdf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cdf('0x6'));var rimraf=require(_0x2cdf('0x7'));var config=require(_0x2cdf('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x5437cc,_0x2dd042){return _0x5437cc['define']('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2977b9,_0xc030e8,_0x23ba65){if(_0x2977b9[_0x2cdf('0x9')](_0x2cdf('0xa'))){_0x2977b9[_0x2cdf('0xb')]=moment()[_0x2cdf('0xc')](_0x2cdf('0xd'));}_0x23ba65(null,_0x2977b9);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 028f3da..56fac31 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 _0xce39=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','body','options','raw','limit','then','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','FaxInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug'];(function(_0xadd0d2,_0x3bf5b9){var _0x2d564c=function(_0x36df23){while(--_0x36df23){_0xadd0d2['push'](_0xadd0d2['shift']());}};_0x2d564c(++_0x3bf5b9);}(_0xce39,0xa9));var _0x9ce3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xce39[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9ce3('0x0'));var util=require('util');var moment=require(_0x9ce3('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ce3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ce3('0x3'))['db'];var utils=require(_0x9ce3('0x4'));var logger=require('../../config/logger')(_0x9ce3('0x5'));var config=require('../../config/environment');var jayson=require(_0x9ce3('0x6'));var client=jayson[_0x9ce3('0x7')][_0x9ce3('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9ce3('0x9')],{'host':_0x9ce3('0xa'),'port':0x18eb});var socket=require(_0x9ce3('0xb'))(new Redis(config[_0x9ce3('0x9')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4b1405,_0x1242c3,_0xe7c58){return new BPromise(function(_0x430e2a,_0x363b49){return client[_0x9ce3('0xc')](_0x4b1405,_0xe7c58)['then'](function(_0x34ef87){logger[_0x9ce3('0xd')]('FaxInteraction,\x20%s,\x20%s',_0x1242c3,_0x9ce3('0xe'));logger[_0x9ce3('0xf')](_0x9ce3('0x10'),_0x1242c3,'request\x20sent',JSON['stringify'](_0x34ef87));if(_0x34ef87[_0x9ce3('0x11')]){if(_0x34ef87['error'][_0x9ce3('0x12')]===0x1f4){logger[_0x9ce3('0x11')](_0x9ce3('0x13'),_0x1242c3,_0x34ef87[_0x9ce3('0x11')]['message']);return _0x363b49(_0x34ef87['error'][_0x9ce3('0x14')]);}logger['error'](_0x9ce3('0x13'),_0x1242c3,_0x34ef87['error'][_0x9ce3('0x14')]);return _0x430e2a(_0x34ef87[_0x9ce3('0x11')]['message']);}else{logger['info'](_0x9ce3('0x13'),_0x1242c3,_0x9ce3('0xe'));_0x430e2a(_0x34ef87[_0x9ce3('0x15')][_0x9ce3('0x14')]);}})[_0x9ce3('0x16')](function(_0x49a9b9){logger['error'](_0x9ce3('0x13'),_0x1242c3,_0x49a9b9);_0x363b49(_0x49a9b9);});});}exports['UpdateFaxInteraction']=function(_0x1d43ea){var _0x340bd7=this;return new Promise(function(_0x37719c,_0x4e261e){return db['FaxInteraction']['update'](_0x1d43ea[_0x9ce3('0x17')],{'raw':_0x1d43ea[_0x9ce3('0x18')]?_0x1d43ea[_0x9ce3('0x18')][_0x9ce3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d43ea[_0x9ce3('0x18')]?_0x1d43ea[_0x9ce3('0x18')]['where']||null:null,'attributes':_0x1d43ea[_0x9ce3('0x18')]?_0x1d43ea[_0x9ce3('0x18')]['attributes']||null:null,'limit':_0x1d43ea[_0x9ce3('0x18')]?_0x1d43ea['options'][_0x9ce3('0x1a')]||null:null})[_0x9ce3('0x1b')](function(_0x41d49e){logger[_0x9ce3('0xd')](_0x9ce3('0x1c'),_0x1d43ea);logger[_0x9ce3('0xf')]('UpdateFaxInteraction',_0x1d43ea,JSON[_0x9ce3('0x1d')](_0x41d49e));_0x37719c(_0x41d49e);})[_0x9ce3('0x16')](function(_0x2b9f38){logger[_0x9ce3('0x11')](_0x9ce3('0x1c'),_0x2b9f38[_0x9ce3('0x14')],_0x1d43ea);_0x4e261e(_0x340bd7[_0x9ce3('0x11')](0x1f4,_0x2b9f38[_0x9ce3('0x14')]));});});};exports[_0x9ce3('0x1e')]=function(_0x19c17b){return new Promise(function(_0x15ea99,_0xc62d60){return db[_0x9ce3('0x1f')]['find']({'where':_0x19c17b[_0x9ce3('0x18')]?_0x19c17b[_0x9ce3('0x18')]['where']||null:null})['then'](function(_0x2afd4e){if(_0x2afd4e){return _0x2afd4e[_0x9ce3('0x20')](_0x19c17b[_0x9ce3('0x17')][_0x9ce3('0x21')],_[_0x9ce3('0x22')](_0x19c17b[_0x9ce3('0x17')],[_0x9ce3('0x21'),'id'])||{});}})[_0x9ce3('0x23')](function(_0x5bc84a){logger[_0x9ce3('0xd')](_0x9ce3('0x24'),_0x19c17b);logger[_0x9ce3('0xf')](_0x9ce3('0x24'),_0x19c17b,JSON['stringify'](_0x5bc84a));_0x15ea99(_0x5bc84a);})['catch'](function(_0x56c6ed){logger['error'](_0x9ce3('0x24'),_0x56c6ed[_0x9ce3('0x14')],_0x19c17b);_0xc62d60(_this['error'](0x1f4,_0x56c6ed['message']));});});}; \ No newline at end of file +var _0xe183=['info','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','request\x20sent','debug','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','body','options','raw','catch','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','ids','omit','spread'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0xe183,0x185));var _0x3e18=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xe183[_0x26b5ff];return _0x58603e;};'use strict';var _=require(_0x3e18('0x0'));var util=require(_0x3e18('0x1'));var moment=require(_0x3e18('0x2'));var BPromise=require(_0x3e18('0x3'));var rs=require(_0x3e18('0x4'));var fs=require('fs');var Redis=require(_0x3e18('0x5'));var db=require(_0x3e18('0x6'))['db'];var utils=require(_0x3e18('0x7'));var logger=require(_0x3e18('0x8'))(_0x3e18('0x9'));var config=require(_0x3e18('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3e18('0xb')][_0x3e18('0xc')]({'port':0x232a});config['redis']=_[_0x3e18('0xd')](config['redis'],{'host':_0x3e18('0xe'),'port':0x18eb});var socket=require(_0x3e18('0xf'))(new Redis(config[_0x3e18('0x10')]));require('./faxInteraction.socket')[_0x3e18('0x11')](socket);function respondWithRpcPromise(_0x1282d9,_0xf4a0ce,_0x4396dc){return new BPromise(function(_0x1adfc2,_0x2d337f){return client[_0x3e18('0x12')](_0x1282d9,_0x4396dc)[_0x3e18('0x13')](function(_0x1c5bc7){logger['info']('FaxInteraction,\x20%s,\x20%s',_0xf4a0ce,_0x3e18('0x14'));logger[_0x3e18('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xf4a0ce,_0x3e18('0x14'),JSON[_0x3e18('0x16')](_0x1c5bc7));if(_0x1c5bc7[_0x3e18('0x17')]){if(_0x1c5bc7[_0x3e18('0x17')][_0x3e18('0x18')]===0x1f4){logger[_0x3e18('0x17')](_0x3e18('0x19'),_0xf4a0ce,_0x1c5bc7[_0x3e18('0x17')]['message']);return _0x2d337f(_0x1c5bc7[_0x3e18('0x17')][_0x3e18('0x1a')]);}logger['error'](_0x3e18('0x19'),_0xf4a0ce,_0x1c5bc7[_0x3e18('0x17')][_0x3e18('0x1a')]);return _0x1adfc2(_0x1c5bc7[_0x3e18('0x17')][_0x3e18('0x1a')]);}else{logger['info'](_0x3e18('0x19'),_0xf4a0ce,_0x3e18('0x14'));_0x1adfc2(_0x1c5bc7[_0x3e18('0x1b')]['message']);}})['catch'](function(_0x18fed9){logger['error'](_0x3e18('0x19'),_0xf4a0ce,_0x18fed9);_0x2d337f(_0x18fed9);});});}exports[_0x3e18('0x1c')]=function(_0x174b6c){var _0x531db8=this;return new Promise(function(_0x5a9fda,_0x4b3cef){return db['FaxInteraction']['update'](_0x174b6c[_0x3e18('0x1d')],{'raw':_0x174b6c[_0x3e18('0x1e')]?_0x174b6c[_0x3e18('0x1e')][_0x3e18('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x174b6c['options']?_0x174b6c[_0x3e18('0x1e')]['where']||null:null,'attributes':_0x174b6c[_0x3e18('0x1e')]?_0x174b6c['options']['attributes']||null:null,'limit':_0x174b6c[_0x3e18('0x1e')]?_0x174b6c[_0x3e18('0x1e')]['limit']||null:null})[_0x3e18('0x13')](function(_0x269ae9){logger['info']('UpdateFaxInteraction',_0x174b6c);logger[_0x3e18('0x15')](_0x3e18('0x1c'),_0x174b6c,JSON[_0x3e18('0x16')](_0x269ae9));_0x5a9fda(_0x269ae9);})[_0x3e18('0x20')](function(_0x23a4a5){logger[_0x3e18('0x17')](_0x3e18('0x1c'),_0x23a4a5['message'],_0x174b6c);_0x4b3cef(_0x531db8[_0x3e18('0x17')](0x1f4,_0x23a4a5[_0x3e18('0x1a')]));});});};exports[_0x3e18('0x21')]=function(_0x12692f){return new Promise(function(_0x45737e,_0x3f9e83){return db[_0x3e18('0x22')][_0x3e18('0x23')]({'where':_0x12692f['options']?_0x12692f[_0x3e18('0x1e')][_0x3e18('0x24')]||null:null})[_0x3e18('0x13')](function(_0x1baa50){if(_0x1baa50){return _0x1baa50[_0x3e18('0x25')](_0x12692f[_0x3e18('0x1d')][_0x3e18('0x26')],_[_0x3e18('0x27')](_0x12692f[_0x3e18('0x1d')],['ids','id'])||{});}})[_0x3e18('0x28')](function(_0x4f2cb5){logger[_0x3e18('0x29')](_0x3e18('0x2a'),_0x12692f);logger[_0x3e18('0x15')](_0x3e18('0x2a'),_0x12692f,JSON[_0x3e18('0x16')](_0x4f2cb5));_0x45737e(_0x4f2cb5);})[_0x3e18('0x20')](function(_0x56bc57){logger[_0x3e18('0x17')](_0x3e18('0x2a'),_0x56bc57['message'],_0x12692f);_0x3f9e83(_this[_0x3e18('0x17')](0x1f4,_0x56bc57['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a956aa1..ed5a79b 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 _0x687b=['removeListener','length','faxInteraction:','./faxInteraction.events','remove','update','emit'];(function(_0x1f25ac,_0x4b7ee7){var _0x208c31=function(_0x52e1c0){while(--_0x52e1c0){_0x1f25ac['push'](_0x1f25ac['shift']());}};_0x208c31(++_0x4b7ee7);}(_0x687b,0x1ae));var _0xb687=function(_0x29631f,_0xdb767){_0x29631f=_0x29631f-0x0;var _0x486d87=_0x687b[_0x29631f];return _0x486d87;};'use strict';var FaxInteractionEvents=require(_0xb687('0x0'));var events=['save',_0xb687('0x1'),_0xb687('0x2')];function createListener(_0x48176d,_0x578dfc){return function(_0x3affc1){_0x578dfc[_0xb687('0x3')](_0x48176d,_0x3affc1);};}function removeListener(_0x410d86,_0x8df328){return function(){FaxInteractionEvents[_0xb687('0x4')](_0x410d86,_0x8df328);};}exports['register']=function(_0x2cf26f){for(var _0x1f2378=0x0,_0x316c3d=events[_0xb687('0x5')];_0x1f2378<_0x316c3d;_0x1f2378++){var _0x3a224a=events[_0x1f2378];var _0xe19742=createListener(_0xb687('0x6')+_0x3a224a,_0x2cf26f);FaxInteractionEvents['on'](_0x3a224a,_0xe19742);}}; \ No newline at end of file +var _0x3b1f=['register','length','faxInteraction:','./faxInteraction.events','remove','emit'];(function(_0x24ea2c,_0x230662){var _0x37533b=function(_0x3617d4){while(--_0x3617d4){_0x24ea2c['push'](_0x24ea2c['shift']());}};_0x37533b(++_0x230662);}(_0x3b1f,0x18f));var _0xf3b1=function(_0x154283,_0x1962d4){_0x154283=_0x154283-0x0;var _0x35159f=_0x3b1f[_0x154283];return _0x35159f;};'use strict';var FaxInteractionEvents=require(_0xf3b1('0x0'));var events=['save',_0xf3b1('0x1'),'update'];function createListener(_0x5bea7b,_0x2778bd){return function(_0x2b2bba){_0x2778bd[_0xf3b1('0x2')](_0x5bea7b,_0x2b2bba);};}function removeListener(_0x559e78,_0x1f9769){return function(){FaxInteractionEvents['removeListener'](_0x559e78,_0x1f9769);};}exports[_0xf3b1('0x3')]=function(_0x276eb7){for(var _0x422a3a=0x0,_0x19985=events[_0xf3b1('0x4')];_0x422a3a<_0x19985;_0x422a3a++){var _0x4f00e5=events[_0x422a3a];var _0x2f4e28=createListener(_0xf3b1('0x5')+_0x4f00e5,_0x276eb7);FaxInteractionEvents['on'](_0x4f00e5,_0x2f4e28);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 734258a..c17a91c 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 _0x5827=['tracked','fax','faxinteraction:addtags','put','/:id','update','delete','faxinteraction:destroy','destroy','/:id/tags','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','/:id/messages','post'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5827,0x12d));var _0x7582=function(_0x4aefb6,_0x2f462f){_0x4aefb6=_0x4aefb6-0x0;var _0x1ff1ab=_0x5827[_0x4aefb6];return _0x1ff1ab;};'use strict';var multer=require(_0x7582('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7582('0x1'));var express=require(_0x7582('0x2'));var router=express[_0x7582('0x3')]();var auth=require(_0x7582('0x4'));var interaction=require(_0x7582('0x5'));var config=require(_0x7582('0x6'));var controller=require(_0x7582('0x7'));router[_0x7582('0x8')]('/',auth[_0x7582('0x9')](),controller[_0x7582('0xa')]);router[_0x7582('0x8')](_0x7582('0xb'),auth[_0x7582('0x9')](),controller[_0x7582('0xc')]);router[_0x7582('0x8')]('/:id',auth[_0x7582('0x9')](),controller[_0x7582('0xd')]);router[_0x7582('0x8')]('/:id/messages',auth[_0x7582('0x9')](),controller[_0x7582('0xe')]);router[_0x7582('0x8')](_0x7582('0xf'),auth[_0x7582('0x9')](),controller['download']);router['post']('/',auth[_0x7582('0x9')](),controller['create']);router['post'](_0x7582('0x10'),auth[_0x7582('0x9')](),controller['addMessage']);router[_0x7582('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x7582('0x12')](_0x7582('0x13'),_0x7582('0x14')),controller['addTags']);router[_0x7582('0x15')](_0x7582('0x16'),auth[_0x7582('0x9')](),interaction[_0x7582('0x12')]('fax','faxinteraction:update'),controller[_0x7582('0x17')]);router[_0x7582('0x18')]('/:id',auth[_0x7582('0x9')](),interaction[_0x7582('0x12')](_0x7582('0x13'),_0x7582('0x19')),controller[_0x7582('0x1a')]);router['delete'](_0x7582('0x1b'),auth[_0x7582('0x9')](),controller['removeTags']);module[_0x7582('0x1c')]=router; \ No newline at end of file +var _0xfbdc=['create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x6a22a1,_0x2964b5){var _0x435d41=function(_0x49bdd0){while(--_0x49bdd0){_0x6a22a1['push'](_0x6a22a1['shift']());}};_0x435d41(++_0x2964b5);}(_0xfbdc,0xc7));var _0xcfbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbdc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcfbd('0x0'));var util=require(_0xcfbd('0x1'));var path=require(_0xcfbd('0x2'));var timeout=require(_0xcfbd('0x3'));var express=require('express');var router=express[_0xcfbd('0x4')]();var auth=require(_0xcfbd('0x5'));var interaction=require(_0xcfbd('0x6'));var config=require(_0xcfbd('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcfbd('0x8')]);router[_0xcfbd('0x9')](_0xcfbd('0xa'),auth[_0xcfbd('0xb')](),controller[_0xcfbd('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcfbd('0x9')](_0xcfbd('0xd'),auth[_0xcfbd('0xb')](),controller[_0xcfbd('0xe')]);router[_0xcfbd('0x9')](_0xcfbd('0xf'),auth['isAuthenticated'](),controller[_0xcfbd('0x10')]);router[_0xcfbd('0x11')]('/',auth['isAuthenticated'](),controller[_0xcfbd('0x12')]);router[_0xcfbd('0x11')](_0xcfbd('0xd'),auth[_0xcfbd('0xb')](),controller['addMessage']);router[_0xcfbd('0x11')](_0xcfbd('0x13'),auth['isAuthenticated'](),interaction[_0xcfbd('0x14')](_0xcfbd('0x15'),_0xcfbd('0x16')),controller[_0xcfbd('0x17')]);router[_0xcfbd('0x18')](_0xcfbd('0x19'),auth[_0xcfbd('0xb')](),interaction['tracked']('fax',_0xcfbd('0x1a')),controller['update']);router[_0xcfbd('0x1b')](_0xcfbd('0x19'),auth[_0xcfbd('0xb')](),interaction['tracked']('fax',_0xcfbd('0x1c')),controller[_0xcfbd('0x1d')]);router[_0xcfbd('0x1b')]('/:id/tags',auth[_0xcfbd('0xb')](),controller[_0xcfbd('0x1e')]);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 26384d9..a940ada 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 _0xab93=['medium','BOOLEAN','ENUM','TEXT','DATE','sequelize'];(function(_0x2a279a,_0x585709){var _0x418f09=function(_0x2ad904){while(--_0x2ad904){_0x2a279a['push'](_0x2a279a['shift']());}};_0x418f09(++_0x585709);}(_0xab93,0x1a3));var _0x3ab9=function(_0x3a5a36,_0x14a97e){_0x3a5a36=_0x3a5a36-0x0;var _0x38761a=_0xab93[_0x3a5a36];return _0x38761a;};'use strict';var Sequelize=require(_0x3ab9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3ab9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3ab9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3ab9('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x3ab9('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3ab9('0x5')]}}; \ No newline at end of file +var _0xe4d9=['out','sequelize','exports','TEXT','BOOLEAN'];(function(_0x524178,_0xdfc002){var _0x8e8807=function(_0x4487c1){while(--_0x4487c1){_0x524178['push'](_0x524178['shift']());}};_0x8e8807(++_0xdfc002);}(_0xe4d9,0x141));var _0x9e4d=function(_0x4ee1ab,_0x5e6e9b){_0x4ee1ab=_0x4ee1ab-0x0;var _0x2ddadd=_0xe4d9[_0x4ee1ab];return _0x2ddadd;};'use strict';var Sequelize=require(_0x9e4d('0x0'));module[_0x9e4d('0x1')]={'body':{'type':Sequelize[_0x9e4d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9e4d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x9e4d('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9e4d('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9ca5d62..b92dd91 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 _0xc79c=['pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','destroy','describe','accept','fax','read','format','UserId','CmContact','FaxInteraction','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','manual','channel','event','EventManager','acceptmessage','fax-interactions','agent','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','create','findOne','isNil','Attachment','AttachmentId','SendFax','basename','download','join','root','files','attachments','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','index','FaxMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0xc79c,0x13c));var _0xcc79=function(_0x469350,_0x17c356){_0x469350=_0x469350-0x0;var _0x22d28e=_0xc79c[_0x469350];return _0x22d28e;};'use strict';var pdf=require(_0xcc79('0x0'));var emlformat=require(_0xcc79('0x1'));var rimraf=require(_0xcc79('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc79('0x3'));var rp=require(_0xcc79('0x4'));var moment=require(_0xcc79('0x5'));var BPromise=require(_0xcc79('0x6'));var Mustache=require(_0xcc79('0x7'));var util=require(_0xcc79('0x8'));var path=require('path');var sox=require(_0xcc79('0x9'));var csv=require(_0xcc79('0xa'));var ejs=require(_0xcc79('0xb'));var fs=require('fs');var _=require(_0xcc79('0xc'));var squel=require(_0xcc79('0xd'));var crypto=require(_0xcc79('0xe'));var jsforce=require(_0xcc79('0xf'));var deskjs=require(_0xcc79('0x10'));var toCsv=require(_0xcc79('0xa'));var querystring=require('querystring');var Papa=require(_0xcc79('0x11'));var Redis=require(_0xcc79('0x12'));var authService=require(_0xcc79('0x13'));var qs=require(_0xcc79('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcc79('0x15'));var config=require('../../config/environment');var db=require(_0xcc79('0x16'))['db'];config[_0xcc79('0x17')]=_['defaults'](config[_0xcc79('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xcc79('0x18'))(new Redis(config['redis']));require(_0xcc79('0x19'))[_0xcc79('0x1a')](socket);var jayson=require(_0xcc79('0x1b'));var client=jayson[_0xcc79('0x1c')][_0xcc79('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xcc79('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x494dfd,_0x5d6f9a,_0x25a8aa){if(_0x25a8aa){var _0x5cd22b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cd22b[_0xcc79('0x1e')](_0x5d6f9a)){return _0x494dfd;}else{throw new Error(_0xcc79('0x1f'));}}else{return _0x494dfd;}}function respondWithRpcPromise(_0x3051de,_0x267a85,_0x4d43b0,_0x4d4915){return new BPromise(function(_0x7bb1ba,_0x42666b){var _0x3aba4b=_0x4d4915||client;return _0x3aba4b[_0xcc79('0x20')](_0x3051de,_0x4d43b0)['then'](function(_0x4b6ad9){logger['info'](_0xcc79('0x21'),_0x267a85,_0xcc79('0x22'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x267a85,_0xcc79('0x22'),JSON[_0xcc79('0x23')](_0x4b6ad9));if(_0x4b6ad9[_0xcc79('0x24')]){if(_0x4b6ad9[_0xcc79('0x24')]['code']===0x1f4){logger[_0xcc79('0x24')](_0xcc79('0x21'),_0x267a85,_0x4b6ad9[_0xcc79('0x24')][_0xcc79('0x25')]);return _0x42666b(_0x4b6ad9[_0xcc79('0x24')][_0xcc79('0x25')]);}logger[_0xcc79('0x24')](_0xcc79('0x21'),_0x267a85,_0x4b6ad9[_0xcc79('0x24')][_0xcc79('0x25')]);return _0x7bb1ba(_0x4b6ad9[_0xcc79('0x24')][_0xcc79('0x25')]);}else{logger[_0xcc79('0x26')]('FaxMessage,\x20%s,\x20%s',_0x267a85,'request\x20sent');_0x7bb1ba(_0x4b6ad9[_0xcc79('0x27')][_0xcc79('0x25')]);}})['catch'](function(_0x41fb76){logger[_0xcc79('0x24')](_0xcc79('0x21'),_0x267a85,_0x41fb76);_0x42666b(_0x41fb76);});});}function respondWithStatusCode(_0x23def3,_0x3838dc){_0x3838dc=_0x3838dc||0xcc;return function(_0x211cd6){if(_0x211cd6){return _0x23def3[_0xcc79('0x28')](_0x3838dc);}return _0x23def3[_0xcc79('0x29')](_0x3838dc)['end']();};}function respondWithResult(_0x421fce,_0x444407){_0x444407=_0x444407||0xc8;return function(_0x140af8){if(_0x140af8){return _0x421fce[_0xcc79('0x29')](_0x444407)[_0xcc79('0x2a')](_0x140af8);}};}function respondWithFilteredResult(_0x414783,_0x318a78){return function(_0x324d07){if(_0x324d07){var _0x1b0f16=_0x324d07[_0xcc79('0x2b')],_0x42cf00=_0x318a78[_0xcc79('0x2c')],_0x3eb863=_0x318a78[_0xcc79('0x2c')]+_0x318a78[_0xcc79('0x2d')],_0x468f9b;if(_0x3eb863>=_0x1b0f16){_0x3eb863=_0x1b0f16;_0x468f9b=0xc8;}else{_0x468f9b=0xce;}_0x414783['status'](_0x468f9b);return _0x414783['set'](_0xcc79('0x2e'),_0x42cf00+'-'+_0x3eb863+'/'+_0x1b0f16)[_0xcc79('0x2a')](_0x324d07);}return null;};}function patchUpdates(_0x2149df){return function(_0x4a110b){try{jsonpatch[_0xcc79('0x2f')](_0x4a110b,_0x2149df,!![]);}catch(_0x2be24b){return BPromise[_0xcc79('0x30')](_0x2be24b);}return _0x4a110b[_0xcc79('0x31')]();};}function saveUpdates(_0xd5172e,_0x2cbc73){return function(_0x46df75){if(_0x46df75){return _0x46df75[_0xcc79('0x32')](_0xd5172e)[_0xcc79('0x33')](function(_0x408f4a){return _0x408f4a;});}return null;};}function removeEntity(_0x436aa0,_0x10bb2f){return function(_0x139b69){if(_0x139b69){return _0x139b69['destroy']()['then'](function(){_0x436aa0[_0xcc79('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4ec4,_0xabf986){return function(_0x4c51de){if(!_0x4c51de){_0x5a4ec4['sendStatus'](0x194);}return _0x4c51de;};}function handleError(_0x491906,_0x547478){_0x547478=_0x547478||0x1f4;return function(_0x3320eb){logger[_0xcc79('0x24')](_0x3320eb[_0xcc79('0x34')]);if(_0x3320eb[_0xcc79('0x35')]){delete _0x3320eb[_0xcc79('0x35')];}_0x491906['status'](_0x547478)[_0xcc79('0x36')](_0x3320eb);};}exports[_0xcc79('0x37')]=function(_0x3d67e3,_0x541480){var _0x7ed62c={},_0x4380f3={},_0x1da1c6={'count':0x0,'rows':[]};var _0x111ffc=db[_0xcc79('0x38')][_0xcc79('0x39')];_0x4380f3[_0xcc79('0x3a')]=_[_0xcc79('0x3b')](_0x111ffc);_0x4380f3['query']=_[_0xcc79('0x3b')](_0x3d67e3[_0xcc79('0x3c')]);_0x4380f3['filters']=_[_0xcc79('0x3d')](_0x4380f3['model'],_0x4380f3[_0xcc79('0x3c')]);_0x7ed62c[_0xcc79('0x3e')]=_[_0xcc79('0x3d')](_0x4380f3['model'],qs[_0xcc79('0x3f')](_0x3d67e3[_0xcc79('0x3c')]['fields']));_0x7ed62c[_0xcc79('0x3e')]=_0x7ed62c[_0xcc79('0x3e')][_0xcc79('0x40')]?_0x7ed62c[_0xcc79('0x3e')]:_0x4380f3[_0xcc79('0x3a')];if(!_0x3d67e3[_0xcc79('0x3c')][_0xcc79('0x41')](_0xcc79('0x42'))){_0x7ed62c[_0xcc79('0x2d')]=qs[_0xcc79('0x2d')](_0x3d67e3[_0xcc79('0x3c')][_0xcc79('0x2d')]);_0x7ed62c['offset']=qs[_0xcc79('0x2c')](_0x3d67e3[_0xcc79('0x3c')][_0xcc79('0x2c')]);}_0x7ed62c[_0xcc79('0x43')]=qs['sort'](_0x3d67e3['query'][_0xcc79('0x44')]);_0x7ed62c[_0xcc79('0x45')]=qs[_0xcc79('0x46')](_[_0xcc79('0x47')](_0x3d67e3[_0xcc79('0x3c')],_0x4380f3[_0xcc79('0x46')]));if(_0x3d67e3['query'][_0xcc79('0x48')]){_0x7ed62c[_0xcc79('0x45')]=_[_0xcc79('0x49')](_0x7ed62c[_0xcc79('0x45')],{'$or':_[_0xcc79('0x4a')](_0x111ffc,function(_0x1e3beb){if(_0x1e3beb[_0xcc79('0x4b')][_0xcc79('0x4c')]!==_0xcc79('0x4d')){var _0x5c4349={};_0x5c4349[_0x1e3beb['field']]={'$like':'%'+_0x3d67e3[_0xcc79('0x3c')][_0xcc79('0x48')]+'%'};return _0x5c4349;}})});}_0x7ed62c=_[_0xcc79('0x49')]({},_0x7ed62c,_0x3d67e3[_0xcc79('0x4e')]);var _0x39d702={'where':_0x7ed62c[_0xcc79('0x45')]};return db['FaxMessage'][_0xcc79('0x2b')](_0x39d702)['then'](function(_0x425e80){_0x1da1c6[_0xcc79('0x2b')]=_0x425e80;if(_0x3d67e3[_0xcc79('0x3c')][_0xcc79('0x4f')]){_0x7ed62c[_0xcc79('0x50')]=[{'all':!![]}];}return db[_0xcc79('0x38')][_0xcc79('0x51')](_0x7ed62c);})[_0xcc79('0x33')](function(_0xc23fd6){_0x1da1c6['rows']=_0xc23fd6;return _0x1da1c6;})[_0xcc79('0x33')](respondWithFilteredResult(_0x541480,_0x7ed62c))[_0xcc79('0x52')](handleError(_0x541480,null));};exports[_0xcc79('0x53')]=function(_0x3e6e2a,_0x2cb6da){var _0xdda035={'raw':!![],'where':{'id':_0x3e6e2a[_0xcc79('0x54')]['id']}},_0x428fa0={};_0x428fa0[_0xcc79('0x3a')]=_[_0xcc79('0x3b')](db['FaxMessage'][_0xcc79('0x39')]);_0x428fa0['query']=_[_0xcc79('0x3b')](_0x3e6e2a[_0xcc79('0x3c')]);_0x428fa0['filters']=_['intersection'](_0x428fa0[_0xcc79('0x3a')],_0x428fa0['query']);_0xdda035[_0xcc79('0x3e')]=_[_0xcc79('0x3d')](_0x428fa0[_0xcc79('0x3a')],qs[_0xcc79('0x3f')](_0x3e6e2a['query'][_0xcc79('0x3f')]));_0xdda035[_0xcc79('0x3e')]=_0xdda035[_0xcc79('0x3e')][_0xcc79('0x40')]?_0xdda035[_0xcc79('0x3e')]:_0x428fa0['model'];if(_0x3e6e2a[_0xcc79('0x3c')][_0xcc79('0x4f')]){_0xdda035['include']=[{'all':!![]}];}_0xdda035=_[_0xcc79('0x49')]({},_0xdda035,_0x3e6e2a[_0xcc79('0x4e')]);return db[_0xcc79('0x38')][_0xcc79('0x55')](_0xdda035)[_0xcc79('0x33')](handleEntityNotFound(_0x2cb6da,null))[_0xcc79('0x33')](respondWithResult(_0x2cb6da,null))['catch'](handleError(_0x2cb6da,null));};exports[_0xcc79('0x32')]=function(_0x6a5c4a,_0x1f6044){if(_0x6a5c4a[_0xcc79('0x56')]['id']){delete _0x6a5c4a[_0xcc79('0x56')]['id'];}return db['FaxMessage'][_0xcc79('0x55')]({'where':{'id':_0x6a5c4a['params']['id']}})['then'](handleEntityNotFound(_0x1f6044,null))[_0xcc79('0x33')](saveUpdates(_0x6a5c4a[_0xcc79('0x56')],null))['then'](respondWithResult(_0x1f6044,null))[_0xcc79('0x52')](handleError(_0x1f6044,null));};exports[_0xcc79('0x57')]=function(_0x3d15f1,_0x85862d){return db[_0xcc79('0x38')][_0xcc79('0x55')]({'where':{'id':_0x3d15f1[_0xcc79('0x54')]['id']}})[_0xcc79('0x33')](handleEntityNotFound(_0x85862d,null))[_0xcc79('0x33')](removeEntity(_0x85862d,null))[_0xcc79('0x52')](handleError(_0x85862d,null));};exports[_0xcc79('0x58')]=function(_0x3be836,_0x383d25){return db['FaxMessage'][_0xcc79('0x58')]()[_0xcc79('0x33')](respondWithResult(_0x383d25,null))['catch'](handleError(_0x383d25,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xcc79('0x59')]=function(_0x3e1d03,_0x3ed98f,_0x37a263){var _0x15bf22={'channel':_0xcc79('0x5a')};if(_0x3e1d03[_0xcc79('0x56')]['id']){delete _0x3e1d03['body']['id'];}_0x3e1d03[_0xcc79('0x56')][_0xcc79('0x5b')]=!![];_0x3e1d03['body']['readAt']=moment()[_0xcc79('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e1d03[_0xcc79('0x56')][_0xcc79('0x5d')]=_0x3e1d03[_0xcc79('0x56')]['UserId']||_0x3e1d03['user']['id'];return db[_0xcc79('0x38')][_0xcc79('0x55')]({'where':{'id':_0x3e1d03['params']['id'],'UserId':null},'include':[{'model':db[_0xcc79('0x5e')],'as':'Contact'}]})[_0xcc79('0x33')](handleEntityNotFound(_0x3ed98f,null))[_0xcc79('0x33')](saveUpdates(_0x3e1d03[_0xcc79('0x56')],null))[_0xcc79('0x33')](function(_0x2de94f){if(_0x2de94f){_0x15bf22[_0xcc79('0x25')]=_0x2de94f['get']({'plain':!![]});return db[_0xcc79('0x5f')][_0xcc79('0x55')]({'where':{'id':_0x2de94f[_0xcc79('0x60')]}});}return null;})[_0xcc79('0x33')](handleEntityNotFound(_0x3ed98f,null))[_0xcc79('0x33')](function(_0x29056a){if(_0x29056a){return _0x29056a[_0xcc79('0x32')]({'UserId':_0x3e1d03[_0xcc79('0x56')][_0xcc79('0x5d')],'read1stAt':_['isNil'](_0x29056a['read1stAt'])?moment()[_0xcc79('0x5c')](_0xcc79('0x61')):undefined});}return null;})[_0xcc79('0x33')](function(_0x5a7ebd){if(_0x5a7ebd){_0x15bf22['interaction']=_0x5a7ebd['get']({'plain':!![]});interaction_log['info'](_0xcc79('0x62'),_0x3e1d03[_0xcc79('0x63')]['id'],_0x3e1d03['user'][_0xcc79('0x35')],_0x3e1d03[_0xcc79('0x63')][_0xcc79('0x64')],_0x15bf22[_0xcc79('0x65')]['id'],_0x3e1d03['body']?JSON[_0xcc79('0x23')](_0x3e1d03[_0xcc79('0x56')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x15bf22);}return null;})[_0xcc79('0x33')](function(_0x5e40d0){if(_0x5e40d0){if(_0x3e1d03[_0xcc79('0x56')][_0xcc79('0x66')]){_0x15bf22[_0xcc79('0x25')]['interface']=util[_0xcc79('0x5c')]('SIP/%s',_0x3e1d03[_0xcc79('0x63')][_0xcc79('0x35')]);_0x15bf22[_0xcc79('0x25')][_0xcc79('0x67')]=_0x15bf22[_0xcc79('0x67')];_0x15bf22['message'][_0xcc79('0x68')]=_0xcc79('0x59');return respondWithRpcPromise(_0xcc79('0x69'),_0xcc79('0x69'),{'event':_0xcc79('0x6a'),'message':_0x15bf22['message']},client9002)[_0xcc79('0x33')](function(){return _0x15bf22;});}return _0x15bf22;}return null;})[_0xcc79('0x33')](respondWithResult(_0x3ed98f,null))[_0xcc79('0x52')](handleError(_0x3ed98f,null));};var interaction_log=require('../../config/logger')(_0xcc79('0x6b'));exports[_0xcc79('0x30')]=function(_0x81a229,_0x34bff0,_0x2045d7){var _0xbf82b5={'agent':{},'channel':_0xcc79('0x5a')};if(_0x81a229[_0xcc79('0x56')]['id']){delete _0x81a229[_0xcc79('0x56')]['id'];}_0x81a229[_0xcc79('0x56')][_0xcc79('0x5d')]=_0x81a229['body'][_0xcc79('0x5d')]||_0x81a229['user']['id'];_0xbf82b5[_0xcc79('0x6c')]['id']=_0x81a229[_0xcc79('0x56')][_0xcc79('0x5d')];return db['FaxMessage']['find']({'where':{'id':_0x81a229[_0xcc79('0x54')]['id'],'UserId':null}})[_0xcc79('0x33')](handleEntityNotFound(_0x34bff0,null))[_0xcc79('0x33')](function(_0x555c72){if(_0x555c72){_0xbf82b5[_0xcc79('0x25')]=_0x555c72[_0xcc79('0x6d')]({'plain':!![]});return db[_0xcc79('0x5f')][_0xcc79('0x55')]({'where':{'id':_0x555c72[_0xcc79('0x60')]}});}return null;})[_0xcc79('0x33')](handleEntityNotFound(_0x34bff0,null))['then'](function(_0x3df418){if(_0x3df418){_0xbf82b5[_0xcc79('0x65')]=_0x3df418['get']({'plain':!![]});interaction_log['info'](_0xcc79('0x6e'),_0x81a229[_0xcc79('0x63')]['id'],_0x81a229[_0xcc79('0x63')][_0xcc79('0x35')],_0x81a229[_0xcc79('0x63')][_0xcc79('0x64')],_0xbf82b5['interaction']['id'],_0x81a229[_0xcc79('0x56')]?JSON['stringify'](_0x81a229[_0xcc79('0x56')]):_0xcc79('0x6f'));return respondWithRpcPromise(_0xcc79('0x70'),_0xcc79('0x71'),_0xbf82b5);}return null;})[_0xcc79('0x33')](function(_0x54bf47){if(_0x54bf47){_0x54bf47[_0xcc79('0x25')][_0xcc79('0x72')]=util[_0xcc79('0x5c')](_0xcc79('0x73'),_0x81a229[_0xcc79('0x63')][_0xcc79('0x35')]);_0x54bf47['message']['channel']=_0xbf82b5[_0xcc79('0x67')];_0x54bf47[_0xcc79('0x25')][_0xcc79('0x68')]=_0xcc79('0x30');respondWithRpcPromise(_0xcc79('0x69'),_0xcc79('0x69'),{'event':_0xcc79('0x74'),'message':_0x54bf47[_0xcc79('0x25')]},client9002);return _0xbf82b5;}return null;})['then'](respondWithResult(_0x34bff0,null))[_0xcc79('0x52')](handleError(_0x34bff0,null));};exports[_0xcc79('0x75')]=function(_0x5d024d,_0x2ee4fd){var _0x4fc8aa;return db[_0xcc79('0x38')][_0xcc79('0x75')](_0x5d024d[_0xcc79('0x56')],{})[_0xcc79('0x33')](function(_0x332e08){_0x4fc8aa=_0x332e08;return db['CmContact'][_0xcc79('0x76')]({'where':{'id':_0x4fc8aa['ContactId']}});})['then'](function(_0x14fea4){if(_[_0xcc79('0x77')](_0x14fea4)){return;}else{_0x4fc8aa['fax']=_0x14fea4[_0xcc79('0x5a')];return db[_0xcc79('0x78')][_0xcc79('0x76')]({'where':{'id':_0x4fc8aa[_0xcc79('0x79')]}});}})['then'](function(_0xe4afc5){return respondWithRpcPromise(_0xcc79('0x7a'),_0xcc79('0x7a'),{'FaxAccountId':_['isNil'](_0x5d024d[_0xcc79('0x56')])?undefined:_0x5d024d[_0xcc79('0x56')]['FaxAccountId'],'path':_['isNil'](_0xe4afc5)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0xe4afc5[_0xcc79('0x7b')]),'fax':_[_0xcc79('0x77')](_0x4fc8aa['fax'])?undefined:_0x4fc8aa[_0xcc79('0x5a')],'AttachmentId':_0x4fc8aa[_0xcc79('0x79')]},client9002);})[_0xcc79('0x33')](respondWithResult(_0x2ee4fd,0xc9))[_0xcc79('0x52')](handleError(_0x2ee4fd,null));};exports[_0xcc79('0x7c')]=function(_0x1fb561,_0x513881){var _0x37426e=path[_0xcc79('0x7d')](config[_0xcc79('0x7e')],'server',_0xcc79('0x7f'),_0xcc79('0x80'));return db['FaxMessage']['find']({'where':{'id':_0x1fb561[_0xcc79('0x54')]['id']},'include':[{'model':db[_0xcc79('0x78')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x513881,null))['then'](function(_0x11a424){if(_0x11a424){return _0x513881[_0xcc79('0x7c')](path[_0xcc79('0x7d')](_0x37426e,_0x11a424['Attachment'][_0xcc79('0x7b')]));}})['catch'](handleError(_0x513881,null));}; \ No newline at end of file +var _0x0f16=['server','Attachment','basename','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','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','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','stack','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','findAll','params','includeAll','update','body','destroy','find','describe','../../config/logger','accept','read','readAt','format','UserId','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','fax','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','findOne','ContactId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x0f16,0x18c));var _0x60f1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0f16[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x60f1('0x0'));var emlformat=require(_0x60f1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x60f1('0x2'));var jsonpatch=require(_0x60f1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x60f1('0x4'));var Mustache=require(_0x60f1('0x5'));var util=require(_0x60f1('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x60f1('0x7'));var crypto=require('crypto');var jsforce=require(_0x60f1('0x8'));var deskjs=require(_0x60f1('0x9'));var toCsv=require('to-csv');var querystring=require(_0x60f1('0xa'));var Papa=require(_0x60f1('0xb'));var Redis=require(_0x60f1('0xc'));var authService=require(_0x60f1('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x60f1('0xe'));var logger=require('../../config/logger')(_0x60f1('0xf'));var utils=require(_0x60f1('0x10'));var config=require(_0x60f1('0x11'));var db=require(_0x60f1('0x12'))['db'];config[_0x60f1('0x13')]=_[_0x60f1('0x14')](config[_0x60f1('0x13')],{'host':_0x60f1('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60f1('0x13')]));require(_0x60f1('0x16'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x60f1('0x17')][_0x60f1('0x18')]({'port':0x232c});var client9002=jayson[_0x60f1('0x17')][_0x60f1('0x18')]({'port':0x232a});function checkPasswordPattern(_0x358c58,_0x46fc3c,_0x594dc9){if(_0x594dc9){var _0x45ed53=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45ed53[_0x60f1('0x19')](_0x46fc3c)){return _0x358c58;}else{throw new Error(_0x60f1('0x1a'));}}else{return _0x358c58;}}function respondWithRpcPromise(_0x2a41be,_0x55f6e9,_0xbea18d,_0x4ebb3a){return new BPromise(function(_0xf7111e,_0x48a5ce){var _0x1da3da=_0x4ebb3a||client;return _0x1da3da[_0x60f1('0x1b')](_0x2a41be,_0xbea18d)[_0x60f1('0x1c')](function(_0x23c634){logger['info'](_0x60f1('0x1d'),_0x55f6e9,'request\x20sent');logger[_0x60f1('0x1e')](_0x60f1('0x1f'),_0x55f6e9,_0x60f1('0x20'),JSON[_0x60f1('0x21')](_0x23c634));if(_0x23c634[_0x60f1('0x22')]){if(_0x23c634[_0x60f1('0x22')]['code']===0x1f4){logger['error'](_0x60f1('0x1d'),_0x55f6e9,_0x23c634[_0x60f1('0x22')]['message']);return _0x48a5ce(_0x23c634['error']['message']);}logger[_0x60f1('0x22')](_0x60f1('0x1d'),_0x55f6e9,_0x23c634['error'][_0x60f1('0x23')]);return _0xf7111e(_0x23c634['error'][_0x60f1('0x23')]);}else{logger['info'](_0x60f1('0x1d'),_0x55f6e9,_0x60f1('0x20'));_0xf7111e(_0x23c634[_0x60f1('0x24')][_0x60f1('0x23')]);}})[_0x60f1('0x25')](function(_0x80e6ac){logger[_0x60f1('0x22')]('FaxMessage,\x20%s,\x20%s',_0x55f6e9,_0x80e6ac);_0x48a5ce(_0x80e6ac);});});}function respondWithStatusCode(_0x890aa4,_0x57c52b){_0x57c52b=_0x57c52b||0xcc;return function(_0x206091){if(_0x206091){return _0x890aa4[_0x60f1('0x26')](_0x57c52b);}return _0x890aa4[_0x60f1('0x27')](_0x57c52b)[_0x60f1('0x28')]();};}function respondWithResult(_0x5cbab7,_0x37fccb){_0x37fccb=_0x37fccb||0xc8;return function(_0x39bc14){if(_0x39bc14){return _0x5cbab7['status'](_0x37fccb)['json'](_0x39bc14);}};}function respondWithFilteredResult(_0x53df11,_0x18abee){return function(_0x292d45){if(_0x292d45){var _0x1e0cc6=_0x292d45[_0x60f1('0x29')],_0x4d538d=_0x18abee[_0x60f1('0x2a')],_0x197211=_0x18abee['offset']+_0x18abee[_0x60f1('0x2b')],_0x54db6f;if(_0x197211>=_0x1e0cc6){_0x197211=_0x1e0cc6;_0x54db6f=0xc8;}else{_0x54db6f=0xce;}_0x53df11[_0x60f1('0x27')](_0x54db6f);return _0x53df11[_0x60f1('0x2c')](_0x60f1('0x2d'),_0x4d538d+'-'+_0x197211+'/'+_0x1e0cc6)[_0x60f1('0x2e')](_0x292d45);}return null;};}function patchUpdates(_0x120d94){return function(_0xbd525){try{jsonpatch[_0x60f1('0x2f')](_0xbd525,_0x120d94,!![]);}catch(_0x4e9f97){return BPromise[_0x60f1('0x30')](_0x4e9f97);}return _0xbd525[_0x60f1('0x31')]();};}function saveUpdates(_0x3c9606,_0x332900){return function(_0xf8c10f){if(_0xf8c10f){return _0xf8c10f['update'](_0x3c9606)[_0x60f1('0x1c')](function(_0x5994d0){return _0x5994d0;});}return null;};}function removeEntity(_0x5667bd,_0x55d6f4){return function(_0x1994d4){if(_0x1994d4){return _0x1994d4['destroy']()[_0x60f1('0x1c')](function(){_0x5667bd[_0x60f1('0x27')](0xcc)[_0x60f1('0x28')]();});}};}function handleEntityNotFound(_0x134fc4,_0x5f0009){return function(_0x45a542){if(!_0x45a542){_0x134fc4['sendStatus'](0x194);}return _0x45a542;};}function handleError(_0x3ea047,_0x100904){_0x100904=_0x100904||0x1f4;return function(_0x3387e0){logger[_0x60f1('0x22')](_0x3387e0[_0x60f1('0x32')]);if(_0x3387e0[_0x60f1('0x33')]){delete _0x3387e0[_0x60f1('0x33')];}_0x3ea047[_0x60f1('0x27')](_0x100904)[_0x60f1('0x34')](_0x3387e0);};}exports[_0x60f1('0x35')]=function(_0x1fddec,_0x46eea1){var _0x467314={},_0xc2eb93={},_0x49f8e9={'count':0x0,'rows':[]};var _0x3c65cc=db[_0x60f1('0x36')][_0x60f1('0x37')];_0xc2eb93[_0x60f1('0x38')]=_[_0x60f1('0x39')](_0x3c65cc);_0xc2eb93[_0x60f1('0x3a')]=_[_0x60f1('0x39')](_0x1fddec[_0x60f1('0x3a')]);_0xc2eb93[_0x60f1('0x3b')]=_[_0x60f1('0x3c')](_0xc2eb93['model'],_0xc2eb93[_0x60f1('0x3a')]);_0x467314['attributes']=_['intersection'](_0xc2eb93[_0x60f1('0x38')],qs['fields'](_0x1fddec['query'][_0x60f1('0x3d')]));_0x467314['attributes']=_0x467314[_0x60f1('0x3e')][_0x60f1('0x3f')]?_0x467314[_0x60f1('0x3e')]:_0xc2eb93[_0x60f1('0x38')];if(!_0x1fddec[_0x60f1('0x3a')][_0x60f1('0x40')]('nolimit')){_0x467314['limit']=qs[_0x60f1('0x2b')](_0x1fddec[_0x60f1('0x3a')]['limit']);_0x467314['offset']=qs['offset'](_0x1fddec[_0x60f1('0x3a')][_0x60f1('0x2a')]);}_0x467314[_0x60f1('0x41')]=qs['sort'](_0x1fddec[_0x60f1('0x3a')][_0x60f1('0x42')]);_0x467314[_0x60f1('0x43')]=qs[_0x60f1('0x3b')](_[_0x60f1('0x44')](_0x1fddec[_0x60f1('0x3a')],_0xc2eb93[_0x60f1('0x3b')]));if(_0x1fddec['query'][_0x60f1('0x45')]){_0x467314['where']=_[_0x60f1('0x46')](_0x467314['where'],{'$or':_['map'](_0x3c65cc,function(_0x32c268){if(_0x32c268[_0x60f1('0x47')][_0x60f1('0x48')]!==_0x60f1('0x49')){var _0x253f29={};_0x253f29[_0x32c268[_0x60f1('0x4a')]]={'$like':'%'+_0x1fddec[_0x60f1('0x3a')]['filter']+'%'};return _0x253f29;}})});}_0x467314=_[_0x60f1('0x46')]({},_0x467314,_0x1fddec[_0x60f1('0x4b')]);var _0x12580e={'where':_0x467314[_0x60f1('0x43')]};return db[_0x60f1('0x36')]['count'](_0x12580e)[_0x60f1('0x1c')](function(_0x32025f){_0x49f8e9[_0x60f1('0x29')]=_0x32025f;if(_0x1fddec[_0x60f1('0x3a')]['includeAll']){_0x467314[_0x60f1('0x4c')]=[{'all':!![]}];}return db[_0x60f1('0x36')][_0x60f1('0x4d')](_0x467314);})[_0x60f1('0x1c')](function(_0x20a6d7){_0x49f8e9['rows']=_0x20a6d7;return _0x49f8e9;})[_0x60f1('0x1c')](respondWithFilteredResult(_0x46eea1,_0x467314))[_0x60f1('0x25')](handleError(_0x46eea1,null));};exports['show']=function(_0x1678f8,_0x785ee4){var _0x14bb43={'raw':!![],'where':{'id':_0x1678f8[_0x60f1('0x4e')]['id']}},_0x26eff5={};_0x26eff5[_0x60f1('0x38')]=_[_0x60f1('0x39')](db['FaxMessage']['rawAttributes']);_0x26eff5[_0x60f1('0x3a')]=_['keys'](_0x1678f8[_0x60f1('0x3a')]);_0x26eff5[_0x60f1('0x3b')]=_[_0x60f1('0x3c')](_0x26eff5[_0x60f1('0x38')],_0x26eff5[_0x60f1('0x3a')]);_0x14bb43[_0x60f1('0x3e')]=_[_0x60f1('0x3c')](_0x26eff5['model'],qs[_0x60f1('0x3d')](_0x1678f8[_0x60f1('0x3a')][_0x60f1('0x3d')]));_0x14bb43[_0x60f1('0x3e')]=_0x14bb43[_0x60f1('0x3e')][_0x60f1('0x3f')]?_0x14bb43[_0x60f1('0x3e')]:_0x26eff5[_0x60f1('0x38')];if(_0x1678f8['query'][_0x60f1('0x4f')]){_0x14bb43['include']=[{'all':!![]}];}_0x14bb43=_[_0x60f1('0x46')]({},_0x14bb43,_0x1678f8['options']);return db[_0x60f1('0x36')]['find'](_0x14bb43)[_0x60f1('0x1c')](handleEntityNotFound(_0x785ee4,null))[_0x60f1('0x1c')](respondWithResult(_0x785ee4,null))['catch'](handleError(_0x785ee4,null));};exports[_0x60f1('0x50')]=function(_0x25c649,_0x4cd08b){if(_0x25c649[_0x60f1('0x51')]['id']){delete _0x25c649[_0x60f1('0x51')]['id'];}return db[_0x60f1('0x36')]['find']({'where':{'id':_0x25c649[_0x60f1('0x4e')]['id']}})[_0x60f1('0x1c')](handleEntityNotFound(_0x4cd08b,null))[_0x60f1('0x1c')](saveUpdates(_0x25c649[_0x60f1('0x51')],null))[_0x60f1('0x1c')](respondWithResult(_0x4cd08b,null))['catch'](handleError(_0x4cd08b,null));};exports[_0x60f1('0x52')]=function(_0x1adc84,_0x1b53b6){return db[_0x60f1('0x36')][_0x60f1('0x53')]({'where':{'id':_0x1adc84['params']['id']}})[_0x60f1('0x1c')](handleEntityNotFound(_0x1b53b6,null))[_0x60f1('0x1c')](removeEntity(_0x1b53b6,null))[_0x60f1('0x25')](handleError(_0x1b53b6,null));};exports['describe']=function(_0x15807a,_0xe9f604){return db['FaxMessage'][_0x60f1('0x54')]()[_0x60f1('0x1c')](respondWithResult(_0xe9f604,null))[_0x60f1('0x25')](handleError(_0xe9f604,null));};var interaction_log=require(_0x60f1('0x55'))('fax-interactions');exports[_0x60f1('0x56')]=function(_0x52abca,_0x5a8baf,_0x238ca9){var _0x12ebfe={'channel':'fax'};if(_0x52abca[_0x60f1('0x51')]['id']){delete _0x52abca[_0x60f1('0x51')]['id'];}_0x52abca[_0x60f1('0x51')][_0x60f1('0x57')]=!![];_0x52abca[_0x60f1('0x51')][_0x60f1('0x58')]=moment()[_0x60f1('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x52abca['body']['UserId']=_0x52abca[_0x60f1('0x51')][_0x60f1('0x5a')]||_0x52abca['user']['id'];return db[_0x60f1('0x36')][_0x60f1('0x53')]({'where':{'id':_0x52abca[_0x60f1('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0x60f1('0x5b')],'as':_0x60f1('0x5c')}]})[_0x60f1('0x1c')](handleEntityNotFound(_0x5a8baf,null))['then'](saveUpdates(_0x52abca[_0x60f1('0x51')],null))[_0x60f1('0x1c')](function(_0x58dd72){if(_0x58dd72){_0x12ebfe[_0x60f1('0x23')]=_0x58dd72[_0x60f1('0x5d')]({'plain':!![]});return db[_0x60f1('0x5e')][_0x60f1('0x53')]({'where':{'id':_0x58dd72[_0x60f1('0x5f')]}});}return null;})[_0x60f1('0x1c')](handleEntityNotFound(_0x5a8baf,null))[_0x60f1('0x1c')](function(_0x481cff){if(_0x481cff){return _0x481cff['update']({'UserId':_0x52abca['body']['UserId'],'read1stAt':_[_0x60f1('0x60')](_0x481cff[_0x60f1('0x61')])?moment()[_0x60f1('0x59')](_0x60f1('0x62')):undefined});}return null;})[_0x60f1('0x1c')](function(_0x39aec8){if(_0x39aec8){_0x12ebfe[_0x60f1('0x63')]=_0x39aec8[_0x60f1('0x5d')]({'plain':!![]});interaction_log[_0x60f1('0x64')](_0x60f1('0x65'),_0x52abca[_0x60f1('0x66')]['id'],_0x52abca[_0x60f1('0x66')][_0x60f1('0x33')],_0x52abca[_0x60f1('0x66')][_0x60f1('0x67')],_0x12ebfe[_0x60f1('0x63')]['id'],_0x52abca[_0x60f1('0x51')]?JSON['stringify'](_0x52abca[_0x60f1('0x51')]):_0x60f1('0x68'));return respondWithRpcPromise(_0x60f1('0x69'),_0x60f1('0x6a'),_0x12ebfe);}return null;})['then'](function(_0x24580b){if(_0x24580b){if(_0x52abca[_0x60f1('0x51')][_0x60f1('0x6b')]){_0x12ebfe[_0x60f1('0x23')][_0x60f1('0x6c')]=util[_0x60f1('0x59')](_0x60f1('0x6d'),_0x52abca[_0x60f1('0x66')][_0x60f1('0x33')]);_0x12ebfe[_0x60f1('0x23')][_0x60f1('0x6e')]=_0x12ebfe[_0x60f1('0x6e')];_0x12ebfe['message'][_0x60f1('0x6f')]=_0x60f1('0x56');return respondWithRpcPromise(_0x60f1('0x70'),'EventManager',{'event':_0x60f1('0x71'),'message':_0x12ebfe['message']},client9002)[_0x60f1('0x1c')](function(){return _0x12ebfe;});}return _0x12ebfe;}return null;})[_0x60f1('0x1c')](respondWithResult(_0x5a8baf,null))[_0x60f1('0x25')](handleError(_0x5a8baf,null));};var interaction_log=require(_0x60f1('0x55'))(_0x60f1('0x72'));exports[_0x60f1('0x30')]=function(_0x1f03e1,_0x3e3cdd,_0x3c32e7){var _0x233e39={'agent':{},'channel':_0x60f1('0x73')};if(_0x1f03e1[_0x60f1('0x51')]['id']){delete _0x1f03e1[_0x60f1('0x51')]['id'];}_0x1f03e1[_0x60f1('0x51')][_0x60f1('0x5a')]=_0x1f03e1['body']['UserId']||_0x1f03e1[_0x60f1('0x66')]['id'];_0x233e39[_0x60f1('0x74')]['id']=_0x1f03e1[_0x60f1('0x51')]['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x1f03e1[_0x60f1('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3e3cdd,null))['then'](function(_0xeb72db){if(_0xeb72db){_0x233e39[_0x60f1('0x23')]=_0xeb72db[_0x60f1('0x5d')]({'plain':!![]});return db[_0x60f1('0x5e')][_0x60f1('0x53')]({'where':{'id':_0xeb72db[_0x60f1('0x5f')]}});}return null;})[_0x60f1('0x1c')](handleEntityNotFound(_0x3e3cdd,null))[_0x60f1('0x1c')](function(_0x4c3c8c){if(_0x4c3c8c){_0x233e39[_0x60f1('0x63')]=_0x4c3c8c['get']({'plain':!![]});interaction_log[_0x60f1('0x64')](_0x60f1('0x75'),_0x1f03e1['user']['id'],_0x1f03e1[_0x60f1('0x66')][_0x60f1('0x33')],_0x1f03e1[_0x60f1('0x66')][_0x60f1('0x67')],_0x233e39[_0x60f1('0x63')]['id'],_0x1f03e1[_0x60f1('0x51')]?JSON[_0x60f1('0x21')](_0x1f03e1[_0x60f1('0x51')]):'null');return respondWithRpcPromise(_0x60f1('0x76'),'rejectMessage',_0x233e39);}return null;})[_0x60f1('0x1c')](function(_0xf0240d){if(_0xf0240d){_0xf0240d[_0x60f1('0x23')][_0x60f1('0x6c')]=util[_0x60f1('0x59')](_0x60f1('0x6d'),_0x1f03e1['user']['name']);_0xf0240d['message'][_0x60f1('0x6e')]=_0x233e39[_0x60f1('0x6e')];_0xf0240d['message']['event']=_0x60f1('0x30');respondWithRpcPromise(_0x60f1('0x70'),_0x60f1('0x70'),{'event':_0x60f1('0x77'),'message':_0xf0240d['message']},client9002);return _0x233e39;}return null;})[_0x60f1('0x1c')](respondWithResult(_0x3e3cdd,null))['catch'](handleError(_0x3e3cdd,null));};exports['create']=function(_0x3679e5,_0x4bfb26){var _0x1f85e6;return db[_0x60f1('0x36')]['create'](_0x3679e5[_0x60f1('0x51')],{})[_0x60f1('0x1c')](function(_0x3ceeb5){_0x1f85e6=_0x3ceeb5;return db[_0x60f1('0x5b')][_0x60f1('0x78')]({'where':{'id':_0x1f85e6[_0x60f1('0x79')]}});})[_0x60f1('0x1c')](function(_0x19f4bb){if(_['isNil'](_0x19f4bb)){return;}else{_0x1f85e6['fax']=_0x19f4bb['fax'];return db['Attachment'][_0x60f1('0x78')]({'where':{'id':_0x1f85e6['AttachmentId']}});}})[_0x60f1('0x1c')](function(_0x3efb63){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x60f1('0x60')](_0x3679e5[_0x60f1('0x51')])?undefined:_0x3679e5[_0x60f1('0x51')][_0x60f1('0x7a')],'path':_['isNil'](_0x3efb63)?undefined:util[_0x60f1('0x59')](_0x60f1('0x7b'),_0x3efb63['basename']),'fax':_[_0x60f1('0x60')](_0x1f85e6[_0x60f1('0x73')])?undefined:_0x1f85e6['fax'],'AttachmentId':_0x1f85e6[_0x60f1('0x7c')]},client9002);})[_0x60f1('0x1c')](respondWithResult(_0x4bfb26,0xc9))['catch'](handleError(_0x4bfb26,null));};exports[_0x60f1('0x7d')]=function(_0x4fbbab,_0x158f55){var _0x31ccdf=path[_0x60f1('0x7e')](config[_0x60f1('0x7f')],_0x60f1('0x80'),'files','attachments');return db[_0x60f1('0x36')][_0x60f1('0x53')]({'where':{'id':_0x4fbbab[_0x60f1('0x4e')]['id']},'include':[{'model':db[_0x60f1('0x81')],'as':'Attachment'}]})[_0x60f1('0x1c')](handleEntityNotFound(_0x158f55,null))[_0x60f1('0x1c')](function(_0x42e321){if(_0x42e321){return _0x158f55[_0x60f1('0x7d')](path[_0x60f1('0x7e')](_0x31ccdf,_0x42e321[_0x60f1('0x81')][_0x60f1('0x82')]));}})['catch'](handleError(_0x158f55,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d31b601..fbd8547 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 _0x2231=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x197683,_0x21df72){var _0x137639=function(_0x46b902){while(--_0x46b902){_0x197683['push'](_0x197683['shift']());}};_0x137639(++_0x21df72);}(_0x2231,0x94));var _0x1223=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x2231[_0x380307];return _0x9ea14b;};'use strict';var EventEmitter=require(_0x1223('0x0'));var FaxMessage=require(_0x1223('0x1'))['db'][_0x1223('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1223('0x3')](0x0);var events={'afterCreate':_0x1223('0x4'),'afterUpdate':_0x1223('0x5'),'afterDestroy':_0x1223('0x6')};function emitEvent(_0x22fa9c){return function(_0x23439c,_0x122e1e,_0x450fdb){FaxMessageEvents['emit'](_0x22fa9c+':'+_0x23439c['id'],_0x23439c);FaxMessageEvents[_0x1223('0x7')](_0x22fa9c,_0x23439c);_0x450fdb(null);};}for(var e in events){if(events[_0x1223('0x8')](e)){var event=events[e];FaxMessage[_0x1223('0x9')](e,emitEvent(event));}}module[_0x1223('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x9fcb=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','update','emit'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x9fcb,0x1f3));var _0xb9fc=function(_0x3c6fad,_0x1c7646){_0x3c6fad=_0x3c6fad-0x0;var _0x33a9a0=_0x9fcb[_0x3c6fad];return _0x33a9a0;};'use strict';var EventEmitter=require(_0xb9fc('0x0'));var FaxMessage=require(_0xb9fc('0x1'))['db'][_0xb9fc('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb9fc('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc0212d){return function(_0x23a1e0,_0x494a39,_0x62c4d1){FaxMessageEvents['emit'](_0xc0212d+':'+_0x23a1e0['id'],_0x23a1e0);FaxMessageEvents[_0xb9fc('0x4')](_0xc0212d,_0x23a1e0);_0x62c4d1(null);};}for(var e in events){if(events[_0xb9fc('0x5')](e)){var event=events[e];FaxMessage[_0xb9fc('0x6')](e,emitEvent(event));}}module[_0xb9fc('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 1d326f9..fa7eff5 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 _0x9ca2=['FaxMessage','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define'];(function(_0x5cf48c,_0x52b774){var _0xe1c839=function(_0x434b95){while(--_0x434b95){_0x5cf48c['push'](_0x5cf48c['shift']());}};_0xe1c839(++_0x52b774);}(_0x9ca2,0x188));var _0x29ca=function(_0x135020,_0x1e8540){_0x135020=_0x135020-0x0;var _0x37ef96=_0x9ca2[_0x135020];return _0x37ef96;};'use strict';var _=require(_0x29ca('0x0'));var util=require(_0x29ca('0x1'));var logger=require('../../config/logger')(_0x29ca('0x2'));var moment=require(_0x29ca('0x3'));var BPromise=require(_0x29ca('0x4'));var rp=require(_0x29ca('0x5'));var fs=require('fs');var path=require(_0x29ca('0x6'));var rimraf=require('rimraf');var config=require(_0x29ca('0x7'));var attributes=require(_0x29ca('0x8'));module[_0x29ca('0x9')]=function(_0x5f5558,_0x1e2c17){return _0x5f5558[_0x29ca('0xa')](_0x29ca('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x29ca('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xea7b5c,_0x228e29,_0x3f97cb){var _0x4511ac=_0x5f5558[_0x29ca('0xd')];var _0x5ef403=_0xea7b5c[_0x29ca('0xe')]({'plain':!![]});if(_0x5ef403[_0x29ca('0xf')][_0x29ca('0x10')]()==='in'||_0x5ef403['direction']['toLowerCase']()===_0x29ca('0x11')&&!_0x5ef403[_0x29ca('0x12')]&&!_[_0x29ca('0x13')](_0x5ef403[_0x29ca('0x14')])){_0x4511ac[_0x29ca('0x15')][_0x29ca('0x16')]({'where':{'id':_0x5ef403[_0x29ca('0x17')]}})[_0x29ca('0x18')](function(_0x599ff7){if(_0x599ff7){_0x599ff7[_0x29ca('0x19')]({'lastMsgAt':_0x5ef403[_0x29ca('0x1a')],'lastMsgDirection':_0x5ef403[_0x29ca('0xf')][_0x29ca('0x10')]()});}})[_0x29ca('0x1b')](function(_0x3a0cd7){console[_0x29ca('0x1c')](_0x3a0cd7);});}_0x3f97cb();}},'charset':_0x29ca('0x1d'),'collate':_0x29ca('0x1e')});}; \ No newline at end of file +var _0x998a=['moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','FaxInteraction','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x998a,0x185));var _0xa998=function(_0x452ddd,_0x42d148){_0x452ddd=_0x452ddd-0x0;var _0xf554f=_0x998a[_0x452ddd];return _0xf554f;};'use strict';var _=require(_0xa998('0x0'));var util=require(_0xa998('0x1'));var logger=require(_0xa998('0x2'))('api');var moment=require(_0xa998('0x3'));var BPromise=require(_0xa998('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa998('0x5'));var rimraf=require(_0xa998('0x6'));var config=require('../../config/environment');var attributes=require(_0xa998('0x7'));module[_0xa998('0x8')]=function(_0x4704d0,_0x5f0071){return _0x4704d0[_0xa998('0x9')](_0xa998('0xa'),attributes,{'tableName':_0xa998('0xb'),'paranoid':![],'indexes':[{'name':_0xa998('0xc'),'fields':[_0xa998('0xd')],'type':_0xa998('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48806b,_0x13d116,_0x2a99f1){var _0x734efa=_0x4704d0[_0xa998('0xf')];var _0x474c0a=_0x48806b[_0xa998('0x10')]({'plain':!![]});if(_0x474c0a[_0xa998('0x11')][_0xa998('0x12')]()==='in'||_0x474c0a[_0xa998('0x11')][_0xa998('0x12')]()===_0xa998('0x13')&&!_0x474c0a['secret']&&!_[_0xa998('0x14')](_0x474c0a['UserId'])){_0x734efa[_0xa998('0x15')]['findOne']({'where':{'id':_0x474c0a['FaxInteractionId']}})[_0xa998('0x16')](function(_0x381d56){if(_0x381d56){_0x381d56[_0xa998('0x17')]({'lastMsgAt':_0x474c0a[_0xa998('0x18')],'lastMsgDirection':_0x474c0a[_0xa998('0x11')][_0xa998('0x12')]()});}})[_0xa998('0x19')](function(_0x14d672){console[_0xa998('0x1a')](_0x14d672);});}_0x2a99f1();}},'charset':_0xa998('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c1d5e8b..e8438e9 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 _0x9d92=['debug','UpdateFaxMessage','update','body','where','attributes','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxMessage.socket','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','then'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x9d92,0xdf));var _0x29d9=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0x9d92[_0x285824];return _0x311d7e;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29d9('0x1'));var rs=require(_0x29d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d9('0x3'))['db'];var utils=require(_0x29d9('0x4'));var logger=require(_0x29d9('0x5'))(_0x29d9('0x6'));var config=require(_0x29d9('0x7'));var jayson=require(_0x29d9('0x8'));var client=jayson[_0x29d9('0x9')]['http']({'port':0x232a});config[_0x29d9('0xa')]=_[_0x29d9('0xb')](config[_0x29d9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x29d9('0xc'))(new Redis(config[_0x29d9('0xa')]));require(_0x29d9('0xd'))['register'](socket);function respondWithRpcPromise(_0x49399f,_0x4d997b,_0x4fc9a9){return new BPromise(function(_0x26123d,_0xfd7bac){return client[_0x29d9('0xe')](_0x49399f,_0x4fc9a9)['then'](function(_0x22a01c){logger[_0x29d9('0xf')](_0x29d9('0x10'),_0x4d997b,_0x29d9('0x11'));logger['debug'](_0x29d9('0x12'),_0x4d997b,'request\x20sent',JSON['stringify'](_0x22a01c));if(_0x22a01c['error']){if(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x14')]===0x1f4){logger[_0x29d9('0x13')](_0x29d9('0x10'),_0x4d997b,_0x22a01c['error'][_0x29d9('0x15')]);return _0xfd7bac(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);}logger[_0x29d9('0x13')](_0x29d9('0x10'),_0x4d997b,_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);return _0x26123d(_0x22a01c[_0x29d9('0x13')][_0x29d9('0x15')]);}else{logger[_0x29d9('0xf')](_0x29d9('0x10'),_0x4d997b,'request\x20sent');_0x26123d(_0x22a01c[_0x29d9('0x16')]['message']);}})['catch'](function(_0x3b07e6){logger[_0x29d9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x4d997b,_0x3b07e6);_0xfd7bac(_0x3b07e6);});});}exports[_0x29d9('0x17')]=function(_0x3392d6){var _0x2725f7=this;return new Promise(function(_0x9b0337,_0x2a2742){return db[_0x29d9('0x18')][_0x29d9('0x19')](_0x3392d6['body'],{'raw':_0x3392d6[_0x29d9('0x1a')]?_0x3392d6[_0x29d9('0x1a')][_0x29d9('0x1b')]===undefined?!![]:![]:!![]})[_0x29d9('0x1c')](function(_0x4aecaa){logger['info'](_0x29d9('0x17'),_0x3392d6);logger[_0x29d9('0x1d')]('CreateFaxMessage',_0x3392d6,JSON['stringify'](_0x4aecaa));_0x9b0337(_0x4aecaa);})['catch'](function(_0x460d3){logger[_0x29d9('0x13')](_0x29d9('0x17'),_0x460d3['message'],_0x3392d6);_0x2a2742(_0x2725f7[_0x29d9('0x13')](0x1f4,_0x460d3[_0x29d9('0x15')]));});});};exports[_0x29d9('0x1e')]=function(_0x1d8903){var _0x47d353=this;return new Promise(function(_0xea5b4b,_0x596b69){return db['FaxMessage'][_0x29d9('0x1f')](_0x1d8903[_0x29d9('0x20')],{'raw':_0x1d8903['options']?_0x1d8903[_0x29d9('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8903[_0x29d9('0x1a')]?_0x1d8903[_0x29d9('0x1a')][_0x29d9('0x21')]||null:null,'attributes':_0x1d8903[_0x29d9('0x1a')]?_0x1d8903[_0x29d9('0x1a')][_0x29d9('0x22')]||null:null,'limit':_0x1d8903[_0x29d9('0x1a')]?_0x1d8903['options']['limit']||null:null})['then'](function(_0x297d14){logger[_0x29d9('0xf')](_0x29d9('0x1e'),_0x1d8903);logger[_0x29d9('0x1d')](_0x29d9('0x1e'),_0x1d8903,JSON[_0x29d9('0x23')](_0x297d14));_0xea5b4b(_0x297d14);})['catch'](function(_0x2c0b5d){logger['error'](_0x29d9('0x1e'),_0x2c0b5d[_0x29d9('0x15')],_0x1d8903);_0x596b69(_0x47d353[_0x29d9('0x13')](0x1f4,_0x2c0b5d['message']));});});}; \ No newline at end of file +var _0xfd87=['catch','CreateFaxMessage','FaxMessage','create','body','options','then','UpdateFaxMessage','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3f2f0f,_0xb25f88){var _0x5ead30=function(_0x5cd01d){while(--_0x5cd01d){_0x3f2f0f['push'](_0x3f2f0f['shift']());}};_0x5ead30(++_0xb25f88);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var rs=require(_0x7fd8('0x4'));var fs=require('fs');var Redis=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];var utils=require(_0x7fd8('0x7'));var logger=require(_0x7fd8('0x8'))(_0x7fd8('0x9'));var config=require(_0x7fd8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7fd8('0xb')][_0x7fd8('0xc')]({'port':0x232a});config['redis']=_[_0x7fd8('0xd')](config[_0x7fd8('0xe')],{'host':_0x7fd8('0xf'),'port':0x18eb});var socket=require(_0x7fd8('0x10'))(new Redis(config[_0x7fd8('0xe')]));require('./faxMessage.socket')[_0x7fd8('0x11')](socket);function respondWithRpcPromise(_0x18e3ea,_0x1b8863,_0x596d03){return new BPromise(function(_0x5486fc,_0x4948d0){return client[_0x7fd8('0x12')](_0x18e3ea,_0x596d03)['then'](function(_0x4749df){logger[_0x7fd8('0x13')](_0x7fd8('0x14'),_0x1b8863,'request\x20sent');logger[_0x7fd8('0x15')](_0x7fd8('0x16'),_0x1b8863,_0x7fd8('0x17'),JSON[_0x7fd8('0x18')](_0x4749df));if(_0x4749df[_0x7fd8('0x19')]){if(_0x4749df['error'][_0x7fd8('0x1a')]===0x1f4){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x4948d0(_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);}logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x5486fc(_0x4749df['error']['message']);}else{logger['info'](_0x7fd8('0x14'),_0x1b8863,_0x7fd8('0x17'));_0x5486fc(_0x4749df['result'][_0x7fd8('0x1b')]);}})[_0x7fd8('0x1c')](function(_0x40b134){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x40b134);_0x4948d0(_0x40b134);});});}exports[_0x7fd8('0x1d')]=function(_0x2edf31){var _0x4539b6=this;return new Promise(function(_0x4b5d0a,_0x34bc09){return db[_0x7fd8('0x1e')][_0x7fd8('0x1f')](_0x2edf31[_0x7fd8('0x20')],{'raw':_0x2edf31[_0x7fd8('0x21')]?_0x2edf31[_0x7fd8('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x7fd8('0x22')](function(_0x1d26d4){logger[_0x7fd8('0x13')](_0x7fd8('0x1d'),_0x2edf31);logger['debug'](_0x7fd8('0x1d'),_0x2edf31,JSON[_0x7fd8('0x18')](_0x1d26d4));_0x4b5d0a(_0x1d26d4);})[_0x7fd8('0x1c')](function(_0x33ab3d){logger[_0x7fd8('0x19')]('CreateFaxMessage',_0x33ab3d['message'],_0x2edf31);_0x34bc09(_0x4539b6[_0x7fd8('0x19')](0x1f4,_0x33ab3d[_0x7fd8('0x1b')]));});});};exports[_0x7fd8('0x23')]=function(_0xd8168f){var _0x17b86a=this;return new Promise(function(_0x50f34f,_0x12bc21){return db[_0x7fd8('0x1e')][_0x7fd8('0x24')](_0xd8168f[_0x7fd8('0x20')],{'raw':_0xd8168f[_0x7fd8('0x21')]?_0xd8168f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8168f[_0x7fd8('0x21')]?_0xd8168f[_0x7fd8('0x21')][_0x7fd8('0x25')]||null:null,'attributes':_0xd8168f[_0x7fd8('0x21')]?_0xd8168f['options']['attributes']||null:null,'limit':_0xd8168f[_0x7fd8('0x21')]?_0xd8168f['options'][_0x7fd8('0x26')]||null:null})[_0x7fd8('0x22')](function(_0x3df0a2){logger['info'](_0x7fd8('0x23'),_0xd8168f);logger['debug'](_0x7fd8('0x23'),_0xd8168f,JSON[_0x7fd8('0x18')](_0x3df0a2));_0x50f34f(_0x3df0a2);})[_0x7fd8('0x1c')](function(_0x43ca67){logger[_0x7fd8('0x19')](_0x7fd8('0x23'),_0x43ca67[_0x7fd8('0x1b')],_0xd8168f);_0x12bc21(_0x17b86a['error'](0x1f4,_0x43ca67[_0x7fd8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 69c80b2..6807a5e 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 _0x1e19=['faxMessage:','./faxMessage.events','save','remove','update','removeListener','register','length'];(function(_0x510277,_0x14a889){var _0x2ee7f7=function(_0xfdc5e2){while(--_0xfdc5e2){_0x510277['push'](_0x510277['shift']());}};_0x2ee7f7(++_0x14a889);}(_0x1e19,0x1c9));var _0x91e1=function(_0x4c69c7,_0x2f4850){_0x4c69c7=_0x4c69c7-0x0;var _0x20d218=_0x1e19[_0x4c69c7];return _0x20d218;};'use strict';var FaxMessageEvents=require(_0x91e1('0x0'));var events=[_0x91e1('0x1'),_0x91e1('0x2'),_0x91e1('0x3')];function createListener(_0x3ebfdb,_0x569e03){return function(_0x5e25dd){_0x569e03['emit'](_0x3ebfdb,_0x5e25dd);};}function removeListener(_0x5e4bdc,_0x169cdf){return function(){FaxMessageEvents[_0x91e1('0x4')](_0x5e4bdc,_0x169cdf);};}exports[_0x91e1('0x5')]=function(_0x45d13a){for(var _0x38c2c0=0x0,_0x54c3ce=events[_0x91e1('0x6')];_0x38c2c0<_0x54c3ce;_0x38c2c0++){var _0x5b3df7=events[_0x38c2c0];var _0x15f4c8=createListener(_0x91e1('0x7')+_0x5b3df7,_0x45d13a);FaxMessageEvents['on'](_0x5b3df7,_0x15f4c8);}}; \ No newline at end of file +var _0x09d3=['update','emit','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x55d890,_0x4a6c21){var _0x2cccdf=function(_0x3dbafc){while(--_0x3dbafc){_0x55d890['push'](_0x55d890['shift']());}};_0x2cccdf(++_0x4a6c21);}(_0x09d3,0xa5));var _0x309d=function(_0x210acd,_0x5617de){_0x210acd=_0x210acd-0x0;var _0x9ae98a=_0x09d3[_0x210acd];return _0x9ae98a;};'use strict';var FaxMessageEvents=require(_0x309d('0x0'));var events=[_0x309d('0x1'),_0x309d('0x2'),_0x309d('0x3')];function createListener(_0x33a8ac,_0x2a2b59){return function(_0x458543){_0x2a2b59[_0x309d('0x4')](_0x33a8ac,_0x458543);};}function removeListener(_0x4eabdc,_0x15b6df){return function(){FaxMessageEvents['removeListener'](_0x4eabdc,_0x15b6df);};}exports[_0x309d('0x5')]=function(_0x1332e8){for(var _0x4b2653=0x0,_0x208916=events[_0x309d('0x6')];_0x4b2653<_0x208916;_0x4b2653++){var _0x4ba86a=events[_0x4b2653];var _0xf9d38b=createListener(_0x309d('0x7')+_0x4ba86a,_0x1332e8);FaxMessageEvents['on'](_0x4ba86a,_0xf9d38b);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4965d7c..0f0d69c 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 _0xfb11=['show','/:id/download','download','fax','create','put','update','accept','/:id/reject','reject','delete','multer','path','connect-timeout','Router','../../components/interaction/service','./faxMessage.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x7cc38e,_0x5494){var _0x2b0ca0=function(_0xbfa003){while(--_0xbfa003){_0x7cc38e['push'](_0x7cc38e['shift']());}};_0x2b0ca0(++_0x5494);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xfb11[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1fb1('0x4'));var config=require('../../config/environment');var controller=require(_0x1fb1('0x5'));router[_0x1fb1('0x6')]('/',auth['isAuthenticated'](),controller[_0x1fb1('0x7')]);router[_0x1fb1('0x6')]('/describe',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x9')]);router[_0x1fb1('0x6')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xb')]);router[_0x1fb1('0x6')](_0x1fb1('0xc'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xd')]);router['post']('/',auth[_0x1fb1('0x8')](),interaction['tracked'](_0x1fb1('0xe'),'faxmessage:create'),controller[_0x1fb1('0xf')]);router[_0x1fb1('0x10')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x11')]);router[_0x1fb1('0x10')]('/:id/accept',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x12')]);router[_0x1fb1('0x10')](_0x1fb1('0x13'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x14')]);router[_0x1fb1('0x15')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfdbd=['update','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/download','isAuthenticated','download','post','fax','faxmessage:create','put'];(function(_0x9b01d9,_0x4802b0){var _0x401588=function(_0x5d9b07){while(--_0x5d9b07){_0x9b01d9['push'](_0x9b01d9['shift']());}};_0x401588(++_0x4802b0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x18ea8a,_0x32f09f){_0x18ea8a=_0x18ea8a-0x0;var _0x19c99a=_0xfdbd[_0x18ea8a];return _0x19c99a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var auth=require(_0xdfdb('0x6'));var interaction=require(_0xdfdb('0x7'));var config=require(_0xdfdb('0x8'));var controller=require('./faxMessage.controller');router[_0xdfdb('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfdb('0xa')]);router[_0xdfdb('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xdfdb('0x9')](_0xdfdb('0xb'),auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0x9')](_0xdfdb('0xd'),auth[_0xdfdb('0xe')](),controller[_0xdfdb('0xf')]);router[_0xdfdb('0x10')]('/',auth[_0xdfdb('0xe')](),interaction['tracked'](_0xdfdb('0x11'),_0xdfdb('0x12')),controller['create']);router[_0xdfdb('0x13')](_0xdfdb('0xb'),auth[_0xdfdb('0xe')](),controller[_0xdfdb('0x14')]);router[_0xdfdb('0x13')](_0xdfdb('0x15'),auth[_0xdfdb('0xe')](),controller[_0xdfdb('0x16')]);router['put']('/:id/reject',auth[_0xdfdb('0xe')](),controller['reject']);router[_0xdfdb('0x17')](_0xdfdb('0xb'),auth[_0xdfdb('0xe')](),controller[_0xdfdb('0x18')]);module[_0xdfdb('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 b8337db..73b2413 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 _0xd607=['STRING','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x7c645f,_0x4177ab){var _0x1ae9c0=function(_0xb6be2c){while(--_0xb6be2c){_0x7c645f['push'](_0x7c645f['shift']());}};_0x1ae9c0(++_0x4177ab);}(_0xd607,0xe2));var _0x7d60=function(_0x249d00,_0x77f08d){_0x249d00=_0x249d00-0x0;var _0x392f6c=_0xd607[_0x249d00];return _0x392f6c;};'use strict';var Sequelize=require(_0x7d60('0x0'));module[_0x7d60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d60('0x2')]},'timeout':{'type':Sequelize[_0x7d60('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d60('0x4')]('rrmemory','beepall',_0x7d60('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7d60('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc2b7=['exports','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc2b7,0x9b));var _0x7c2b=function(_0x2d78a5,_0x4606a7){_0x2d78a5=_0x2d78a5-0x0;var _0x46eac4=_0xc2b7[_0x2d78a5];return _0x46eac4;};'use strict';var Sequelize=require(_0x7c2b('0x0'));module[_0x7c2b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c2b('0x2')]},'timeout':{'type':Sequelize[_0x7c2b('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7c2b('0x4'),_0x7c2b('0x5'),'roundrobin'),'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 7ee2591..ef6e610 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 _0x310a=['ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','html-pdf','zip-dir','request-promise','moment','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','json','count','offset','status','reject','save','update','then','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','FaxQueue','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','order','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams'];(function(_0x3f9d8e,_0x65d6a3){var _0x301b2f=function(_0x12075b){while(--_0x12075b){_0x3f9d8e['push'](_0x3f9d8e['shift']());}};_0x301b2f(++_0x65d6a3);}(_0x310a,0x124));var _0xa310=function(_0xcb78b,_0x4b7292){_0xcb78b=_0xcb78b-0x0;var _0x10ab0c=_0x310a[_0xcb78b];return _0x10ab0c;};'use strict';var pdf=require(_0xa310('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa310('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa310('0x2'));var moment=require(_0xa310('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa310('0x4'));var csv=require(_0xa310('0x5'));var ejs=require(_0xa310('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa310('0x7'));var crypto=require(_0xa310('0x8'));var jsforce=require(_0xa310('0x9'));var deskjs=require(_0xa310('0xa'));var toCsv=require(_0xa310('0x5'));var querystring=require(_0xa310('0xb'));var Papa=require('papaparse');var Redis=require(_0xa310('0xc'));var authService=require(_0xa310('0xd'));var qs=require(_0xa310('0xe'));var hardwareService=require(_0xa310('0xf'));var logger=require(_0xa310('0x10'))('api');var utils=require(_0xa310('0x11'));var config=require('../../config/environment');var db=require(_0xa310('0x12'))['db'];config[_0xa310('0x13')]=_[_0xa310('0x14')](config[_0xa310('0x13')],{'host':_0xa310('0x15'),'port':0x18eb});var socket=require(_0xa310('0x16'))(new Redis(config[_0xa310('0x13')]));require(_0xa310('0x17'))[_0xa310('0x18')](socket);function respondWithStatusCode(_0x66653e,_0x19e35c){_0x19e35c=_0x19e35c||0xcc;return function(_0x3110ee){if(_0x3110ee){return _0x66653e[_0xa310('0x19')](_0x19e35c);}return _0x66653e['status'](_0x19e35c)[_0xa310('0x1a')]();};}function respondWithResult(_0x2f4320,_0x2d6df8){_0x2d6df8=_0x2d6df8||0xc8;return function(_0x2006de){if(_0x2006de){return _0x2f4320['status'](_0x2d6df8)[_0xa310('0x1b')](_0x2006de);}};}function respondWithFilteredResult(_0x3f10b2,_0x551274){return function(_0x15a956){if(_0x15a956){var _0x5ea84c=_0x15a956[_0xa310('0x1c')],_0x2925e7=_0x551274[_0xa310('0x1d')],_0x17f4ec=_0x551274[_0xa310('0x1d')]+_0x551274['limit'],_0x1b8898;if(_0x17f4ec>=_0x5ea84c){_0x17f4ec=_0x5ea84c;_0x1b8898=0xc8;}else{_0x1b8898=0xce;}_0x3f10b2[_0xa310('0x1e')](_0x1b8898);return _0x3f10b2['set']('Content-Range',_0x2925e7+'-'+_0x17f4ec+'/'+_0x5ea84c)['json'](_0x15a956);}return null;};}function patchUpdates(_0x46fbe8){return function(_0x216fa1){try{jsonpatch['apply'](_0x216fa1,_0x46fbe8,!![]);}catch(_0xc38279){return BPromise[_0xa310('0x1f')](_0xc38279);}return _0x216fa1[_0xa310('0x20')]();};}function saveUpdates(_0x4da826,_0x854987){return function(_0x5acf4e){if(_0x5acf4e){return _0x5acf4e[_0xa310('0x21')](_0x4da826)['then'](function(_0x5c8db8){return _0x5c8db8;});}return null;};}function removeEntity(_0x14df4a,_0x10d0a2){return function(_0x295eae){if(_0x295eae){return _0x295eae['destroy']()[_0xa310('0x22')](function(){var _0xed30bd=_0x295eae['get']({'plain':!![]});var _0x4c1566=_0xa310('0x23');return db[_0xa310('0x24')][_0xa310('0x25')]({'where':{'type':_0x4c1566,'resourceId':_0xed30bd['id']}})[_0xa310('0x22')](function(){return _0x295eae;});})[_0xa310('0x22')](function(){_0x14df4a['status'](0xcc)[_0xa310('0x1a')]();});}};}function handleEntityNotFound(_0x1e78aa,_0x943f64){return function(_0x1c8152){if(!_0x1c8152){_0x1e78aa[_0xa310('0x19')](0x194);}return _0x1c8152;};}function handleError(_0x43a20f,_0x294b53){_0x294b53=_0x294b53||0x1f4;return function(_0x4af88b){logger[_0xa310('0x26')](_0x4af88b[_0xa310('0x27')]);if(_0x4af88b[_0xa310('0x28')]){delete _0x4af88b[_0xa310('0x28')];}_0x43a20f[_0xa310('0x1e')](_0x294b53)[_0xa310('0x29')](_0x4af88b);};}exports[_0xa310('0x2a')]=function(_0x50b542,_0x51e24d){var _0x7c3879={},_0x179948={},_0x11e9ab={'count':0x0,'rows':[]};var _0x422007=db[_0xa310('0x2b')]['rawAttributes'];_0x179948['model']=_[_0xa310('0x2c')](_0x422007);_0x179948[_0xa310('0x2d')]=_[_0xa310('0x2c')](_0x50b542[_0xa310('0x2d')]);_0x179948[_0xa310('0x2e')]=_[_0xa310('0x2f')](_0x179948[_0xa310('0x30')],_0x179948['query']);_0x7c3879[_0xa310('0x31')]=_[_0xa310('0x2f')](_0x179948[_0xa310('0x30')],qs[_0xa310('0x32')](_0x50b542[_0xa310('0x2d')][_0xa310('0x32')]));_0x7c3879[_0xa310('0x31')]=_0x7c3879[_0xa310('0x31')][_0xa310('0x33')]?_0x7c3879[_0xa310('0x31')]:_0x179948[_0xa310('0x30')];if(!_0x50b542['query'][_0xa310('0x34')](_0xa310('0x35'))){_0x7c3879['limit']=qs[_0xa310('0x36')](_0x50b542[_0xa310('0x2d')]['limit']);_0x7c3879[_0xa310('0x1d')]=qs[_0xa310('0x1d')](_0x50b542[_0xa310('0x2d')][_0xa310('0x1d')]);}_0x7c3879['order']=qs[_0xa310('0x37')](_0x50b542[_0xa310('0x2d')]['sort']);_0x7c3879[_0xa310('0x38')]=qs[_0xa310('0x2e')](_[_0xa310('0x39')](_0x50b542[_0xa310('0x2d')],_0x179948['filters']));if(_0x50b542[_0xa310('0x2d')]['filter']){_0x7c3879[_0xa310('0x38')]=_[_0xa310('0x3a')](_0x7c3879[_0xa310('0x38')],{'$or':_[_0xa310('0x3b')](_0x422007,function(_0x5cefb9){if(_0x5cefb9[_0xa310('0x3c')]['key']!==_0xa310('0x3d')){var _0x3ac7cb={};_0x3ac7cb[_0x5cefb9[_0xa310('0x3e')]]={'$like':'%'+_0x50b542['query'][_0xa310('0x3f')]+'%'};return _0x3ac7cb;}})});}_0x7c3879=_[_0xa310('0x3a')]({},_0x7c3879,_0x50b542['options']);var _0x3d6e4a={'where':_0x7c3879[_0xa310('0x38')]};return db[_0xa310('0x2b')]['count'](_0x3d6e4a)['then'](function(_0x394dc6){_0x11e9ab['count']=_0x394dc6;if(_0x50b542[_0xa310('0x2d')][_0xa310('0x40')]){_0x7c3879[_0xa310('0x41')]=[{'all':!![]}];}return db['FaxQueue'][_0xa310('0x42')](_0x7c3879);})[_0xa310('0x22')](function(_0x520a9d){_0x11e9ab[_0xa310('0x43')]=_0x520a9d;return _0x11e9ab;})['then'](respondWithFilteredResult(_0x51e24d,_0x7c3879))[_0xa310('0x44')](handleError(_0x51e24d,null));};exports['show']=function(_0x277cb5,_0x1e1927){var _0x1d1893={'raw':!![],'where':{'id':_0x277cb5[_0xa310('0x45')]['id']}},_0x40a41f={};_0x40a41f[_0xa310('0x30')]=_[_0xa310('0x2c')](db['FaxQueue'][_0xa310('0x46')]);_0x40a41f[_0xa310('0x2d')]=_[_0xa310('0x2c')](_0x277cb5[_0xa310('0x2d')]);_0x40a41f['filters']=_[_0xa310('0x2f')](_0x40a41f[_0xa310('0x30')],_0x40a41f[_0xa310('0x2d')]);_0x1d1893['attributes']=_[_0xa310('0x2f')](_0x40a41f['model'],qs['fields'](_0x277cb5[_0xa310('0x2d')]['fields']));_0x1d1893[_0xa310('0x31')]=_0x1d1893[_0xa310('0x31')][_0xa310('0x33')]?_0x1d1893[_0xa310('0x31')]:_0x40a41f['model'];if(_0x277cb5[_0xa310('0x2d')][_0xa310('0x40')]){_0x1d1893['include']=[{'all':!![]}];}_0x1d1893=_[_0xa310('0x3a')]({},_0x1d1893,_0x277cb5[_0xa310('0x47')]);return db[_0xa310('0x2b')][_0xa310('0x48')](_0x1d1893)['then'](handleEntityNotFound(_0x1e1927,null))[_0xa310('0x22')](respondWithResult(_0x1e1927,null))[_0xa310('0x44')](handleError(_0x1e1927,null));};exports[_0xa310('0x49')]=function(_0x39ec70,_0x19758d){return db[_0xa310('0x2b')][_0xa310('0x49')](_0x39ec70[_0xa310('0x4a')],{})[_0xa310('0x22')](function(_0x212cdd){var _0x4a917c=_0x39ec70[_0xa310('0x4b')][_0xa310('0x4c')]({'plain':!![]});if(!_0x4a917c)throw new Error(_0xa310('0x4d'));if(_0x4a917c[_0xa310('0x4e')]==='user'){var _0x1db894=_0x212cdd[_0xa310('0x4c')]({'plain':!![]});var _0x5aa5fd=_0xa310('0x23');return db['UserProfileSection'][_0xa310('0x48')]({'where':{'name':_0x5aa5fd,'userProfileId':_0x4a917c['userProfileId']},'raw':!![]})[_0xa310('0x22')](function(_0x22c990){if(_0x22c990&&_0x22c990['autoAssociation']===0x0){return db[_0xa310('0x24')]['create']({'name':_0x1db894[_0xa310('0x28')],'resourceId':_0x1db894['id'],'type':_0x22c990[_0xa310('0x28')],'sectionId':_0x22c990['id']},{})['then'](function(){return _0x212cdd;});}else{return _0x212cdd;}})['catch'](function(_0x5c025d){logger[_0xa310('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c025d);throw _0x5c025d;});}return _0x212cdd;})[_0xa310('0x22')](respondWithResult(_0x19758d,0xc9))[_0xa310('0x44')](handleError(_0x19758d,null));};exports[_0xa310('0x21')]=function(_0x285379,_0xbfcaa7){if(_0x285379[_0xa310('0x4a')]['id']){delete _0x285379[_0xa310('0x4a')]['id'];}return db[_0xa310('0x2b')]['find']({'where':{'id':_0x285379['params']['id']}})[_0xa310('0x22')](handleEntityNotFound(_0xbfcaa7,null))[_0xa310('0x22')](saveUpdates(_0x285379['body'],null))[_0xa310('0x22')](respondWithResult(_0xbfcaa7,null))[_0xa310('0x44')](handleError(_0xbfcaa7,null));};exports[_0xa310('0x25')]=function(_0xacd21a,_0x658b0d){return db[_0xa310('0x2b')]['find']({'where':{'id':_0xacd21a[_0xa310('0x45')]['id']}})[_0xa310('0x22')](handleEntityNotFound(_0x658b0d,null))['then'](removeEntity(_0x658b0d,null))[_0xa310('0x44')](handleError(_0x658b0d,null));};exports[_0xa310('0x4f')]=function(_0xb46615,_0xb6c266){return db[_0xa310('0x2b')][_0xa310('0x4f')]()[_0xa310('0x22')](respondWithResult(_0xb6c266,null))['catch'](handleError(_0xb6c266,null));};exports[_0xa310('0x50')]=function(_0x2ebaf4,_0x48128a,_0x57c103){var _0x18623e={'raw':!![],'where':{}},_0x21b7a4={},_0x195a22;return db['FaxQueue'][_0xa310('0x51')]({'where':{'id':_0x2ebaf4[_0xa310('0x45')]['id']}})[_0xa310('0x22')](handleEntityNotFound(_0x48128a,null))['then'](function(_0x1a6b42){if(_0x1a6b42){_0x195a22=_0x1a6b42['get']({'plain':!![]});_0x21b7a4[_0xa310('0x30')]=_['keys'](db[_0xa310('0x52')][_0xa310('0x46')]);_0x21b7a4[_0xa310('0x2d')]=_[_0xa310('0x2c')](_0x2ebaf4['query']);_0x21b7a4[_0xa310('0x2e')]=_[_0xa310('0x2f')](_0x21b7a4[_0xa310('0x30')],_0x21b7a4['query']);_0x18623e[_0xa310('0x31')]=_[_0xa310('0x2f')](_0x21b7a4[_0xa310('0x30')],qs[_0xa310('0x32')](_0x2ebaf4[_0xa310('0x2d')]['fields']));_0x18623e[_0xa310('0x31')]=_0x18623e[_0xa310('0x31')][_0xa310('0x33')]?_0x18623e[_0xa310('0x31')]:_0x21b7a4[_0xa310('0x30')];if(!_0x2ebaf4[_0xa310('0x2d')]['hasOwnProperty']('nolimit')){_0x18623e[_0xa310('0x36')]=qs[_0xa310('0x36')](_0x2ebaf4[_0xa310('0x2d')][_0xa310('0x36')]);_0x18623e[_0xa310('0x1d')]=qs[_0xa310('0x1d')](_0x2ebaf4[_0xa310('0x2d')][_0xa310('0x1d')]);}_0x18623e['order']=qs[_0xa310('0x37')](_0x2ebaf4['query'][_0xa310('0x37')]);_0x18623e['where']=qs[_0xa310('0x2e')](_[_0xa310('0x39')](_0x2ebaf4[_0xa310('0x2d')],_0x21b7a4[_0xa310('0x2e')]));_0x18623e[_0xa310('0x38')][_0xa310('0x53')]=_0x1a6b42['id'];if(_0x2ebaf4[_0xa310('0x2d')][_0xa310('0x3f')]){_0x18623e['where']=_[_0xa310('0x3a')](_0x18623e[_0xa310('0x38')],{'$or':_['map'](_0x18623e[_0xa310('0x31')],function(_0xc753ca){var _0x7d173f={};_0x7d173f[_0xc753ca]={'$like':'%'+_0x2ebaf4[_0xa310('0x2d')][_0xa310('0x3f')]+'%'};return _0x7d173f;})});}_0x18623e=_['merge']({},_0x18623e,_0x2ebaf4[_0xa310('0x47')]);return db[_0xa310('0x52')][_0xa310('0x42')](_0x18623e);}})['then'](function(_0x5a4e60){if(_0x5a4e60){return db[_0xa310('0x54')][_0xa310('0x55')]({'where':{'id':_['map'](_0x5a4e60,_0xa310('0x56')),'role':_0xa310('0x57')},'attributes':['id',_0xa310('0x28'),_0xa310('0x58'),_0xa310('0x59'),_0xa310('0x5a')]});}})[_0xa310('0x22')](function(_0x17ff69){if(_0x17ff69){return{'count':_0x17ff69[_0xa310('0x1c')],'rows':_[_0xa310('0x3b')](_0x17ff69[_0xa310('0x43')],function(_0x3239ff){return{'membername':_0x3239ff[_0xa310('0x28')],'UserId':_0x3239ff['id'],'queue_name':_0x195a22[_0xa310('0x28')],'FaxQueueId':_0x195a22['id'],'interface':util[_0xa310('0x5b')]('%s/%s',_0xa310('0x5c'),_0x3239ff['name']),'penalty':0x0,'paused':_0x3239ff[_0xa310('0x58')],'createdAt':_0x3239ff[_0xa310('0x5a')],'updatedAt':_0x3239ff['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa310('0x22')](respondWithFilteredResult(_0x48128a,_0x18623e))['catch'](handleError(_0x48128a,null));};exports[_0xa310('0x5d')]=function(_0x3f1541,_0x464d74,_0x2fae46){var _0x2f15be={};var _0x37a2b7={};var _0x119bd7;var _0x2fa9cf;return db[_0xa310('0x2b')][_0xa310('0x51')]({'where':{'id':_0x3f1541[_0xa310('0x45')]['id']}})[_0xa310('0x22')](handleEntityNotFound(_0x464d74,null))[_0xa310('0x22')](function(_0x4714df){if(_0x4714df){_0x119bd7=_0x4714df;_0x37a2b7['model']=_[_0xa310('0x2c')](db[_0xa310('0x5e')][_0xa310('0x46')]);_0x37a2b7[_0xa310('0x2d')]=_['keys'](_0x3f1541[_0xa310('0x2d')]);_0x37a2b7['filters']=_['intersection'](_0x37a2b7[_0xa310('0x30')],_0x37a2b7[_0xa310('0x2d')]);_0x2f15be[_0xa310('0x31')]=_[_0xa310('0x2f')](_0x37a2b7['model'],qs[_0xa310('0x32')](_0x3f1541['query']['fields']));_0x2f15be[_0xa310('0x31')]=_0x2f15be[_0xa310('0x31')][_0xa310('0x33')]?_0x2f15be['attributes']:_0x37a2b7['model'];_0x2f15be[_0xa310('0x5f')]=qs[_0xa310('0x37')](_0x3f1541[_0xa310('0x2d')][_0xa310('0x37')]);_0x2f15be[_0xa310('0x38')]=qs[_0xa310('0x2e')](_[_0xa310('0x39')](_0x3f1541['query'],_0x37a2b7['filters']));if(_0x3f1541['query'][_0xa310('0x3f')]){_0x2f15be[_0xa310('0x38')]=_[_0xa310('0x3a')](_0x2f15be['where'],{'$or':_[_0xa310('0x3b')](_0x2f15be[_0xa310('0x31')],function(_0x538815){var _0x19816e={};_0x19816e[_0x538815]={'$like':'%'+_0x3f1541[_0xa310('0x2d')]['filter']+'%'};return _0x19816e;})});}_0x2f15be=_['merge']({},_0x2f15be,_0x3f1541[_0xa310('0x47')]);return _0x119bd7[_0xa310('0x5d')](_0x2f15be);}})[_0xa310('0x22')](function(_0x329443){if(_0x329443){_0x2fa9cf=_0x329443[_0xa310('0x33')];if(!_0x3f1541[_0xa310('0x2d')][_0xa310('0x34')](_0xa310('0x35'))){_0x2f15be[_0xa310('0x36')]=qs[_0xa310('0x36')](_0x3f1541[_0xa310('0x2d')]['limit']);_0x2f15be[_0xa310('0x1d')]=qs[_0xa310('0x1d')](_0x3f1541[_0xa310('0x2d')][_0xa310('0x1d')]);}return _0x119bd7[_0xa310('0x5d')](_0x2f15be);}})[_0xa310('0x22')](function(_0x47cbbb){if(_0x47cbbb){return _0x47cbbb?{'count':_0x2fa9cf,'rows':_0x47cbbb}:null;}})[_0xa310('0x22')](respondWithResult(_0x464d74,null))[_0xa310('0x44')](handleError(_0x464d74,null));};exports[_0xa310('0x60')]=function(_0x136afd,_0x3ef45b,_0x434968){var _0x37e6e4=_0x136afd[_0xa310('0x4a')][_0xa310('0x61')];return db[_0xa310('0x5e')]['findAll']({'where':{'id':_[_0xa310('0x3b')](_0x37e6e4,'id')},'attributes':['id'],'include':[{'model':db[_0xa310('0x54')],'as':_0xa310('0x62'),'attributes':['id',_0xa310('0x28'),_0xa310('0x63'),_0xa310('0x64'),'interface'],'raw':!![]}]})['then'](function(_0x48bf17){if(_0x48bf17){var _0x4bf3ea=_[_0xa310('0x65')](_0x48bf17,function(_0x480ae8){var _0x29a569=_0x480ae8[_0xa310('0x4c')]({'plain':!![]});return _0x29a569[_0xa310('0x62')];});return db[_0xa310('0x2b')]['find']({'where':{'id':_0x136afd[_0xa310('0x45')]['id']}})['then'](function(_0x21b35c){return db[_0xa310('0x66')]['transaction'](function(_0x4d9edb){return _0x21b35c['addTeams'](_[_0xa310('0x3b')](_0x37e6e4,'id'),{'transaction':_0x4d9edb})[_0xa310('0x22')](function(){return BPromise['each'](_0x4bf3ea,function(_0x4fb086){return db['UserFaxQueue'][_0xa310('0x67')]({'where':{'UserId':_0x4fb086['id'],'FaxQueueId':_0x136afd['params']['id']},'transaction':_0x4d9edb});});})[_0xa310('0x22')](function(){_0x4bf3ea['forEach'](function(_0x291d05){socket[_0xa310('0x68')](_0xa310('0x69'),{'UserId':_0x291d05['id'],'FaxQueueId':_0x21b35c['id']});});});});});}})[_0xa310('0x22')](respondWithStatusCode(_0x3ef45b,null))[_0xa310('0x44')](handleError(_0x3ef45b,null));};exports[_0xa310('0x6a')]=function(_0xd214d8,_0x54d90c,_0x2d493e){return db['Team'][_0xa310('0x42')]({'where':{'id':_0xd214d8[_0xa310('0x2d')][_0xa310('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa310('0x62'),'attributes':['id'],'raw':!![]}]})[_0xa310('0x22')](handleEntityNotFound(_0x54d90c,null))[_0xa310('0x22')](function(_0x314a5d){var _0x3c023a=_['map'](_0x314a5d,'id');var _0xd4e9fb=[];var _0x222cd7=[];var _0x554354=squel[_0xa310('0x6c')]();_0x554354[_0xa310('0x3e')](_0xa310('0x6d'))[_0xa310('0x6e')]('team_has_fax_queues','tq')[_0xa310('0x6f')](_0xa310('0x70'),'ut',_0xa310('0x71'))[_0xa310('0x38')](_0xa310('0x72'),_0xd214d8[_0xa310('0x45')]['id']);for(var _0x28d069=0x0;_0x28d069<_0x314a5d[_0xa310('0x33')];_0x28d069+=0x1){let _0x1411f3=_0x314a5d[_0x28d069];for(var _0x436bae=0x0;_0x436bae<_0x1411f3[_0xa310('0x62')]['length'];_0x436bae+=0x1){let _0x5b6185=_0x1411f3[_0xa310('0x62')][_0x436bae];var _0x1e3703=_0x554354[_0xa310('0x73')]();_0x1e3703[_0xa310('0x38')](_0xa310('0x74'),_0x5b6185['id']);_0x222cd7[_0xa310('0x75')](db[_0xa310('0x66')][_0xa310('0x2d')](_0x1e3703[_0xa310('0x76')](),{'type':db[_0xa310('0x66')][_0xa310('0x77')]['SELECT']})[_0xa310('0x22')](function(_0x1db5c4){if(_0x1db5c4[_0xa310('0x33')]===0x1){return _0x5b6185['id'];}else{var _0x529af8=_['every'](_[_0xa310('0x3b')](_0x1db5c4,'TeamId'),function(_0x7571f6){return _[_0xa310('0x78')](_0x3c023a,_0x7571f6);});if(_0x529af8){return _0x5b6185['id'];}}}));}}return BPromise[_0xa310('0x79')](_0x222cd7)[_0xa310('0x22')](function(_0x1c1351){_0xd4e9fb=_(_0xd4e9fb)[_0xa310('0x7a')](_0x1c1351)[_0xa310('0x7b')]()[_0xa310('0x7c')]();return db[_0xa310('0x2b')][_0xa310('0x48')]({'where':{'id':_0xd214d8[_0xa310('0x45')]['id']}})[_0xa310('0x22')](function(_0x2ad0f4){return db[_0xa310('0x66')][_0xa310('0x7d')](function(_0x8108f2){return _0x2ad0f4[_0xa310('0x6a')](_0xd214d8[_0xa310('0x2d')][_0xa310('0x6b')],{'transaction':_0x8108f2})[_0xa310('0x22')](function(){if(!_[_0xa310('0x7e')](_0xd4e9fb)){return _0x2ad0f4[_0xa310('0x7f')](_0xd4e9fb,{'transaction':_0x8108f2});}})[_0xa310('0x22')](function(){_0xd4e9fb[_0xa310('0x80')](function(_0x22b9ed){socket[_0xa310('0x68')]('userFaxQueue:remove',{'UserId':_0x22b9ed,'FaxQueueId':_0x2ad0f4['id']});});});});});});})[_0xa310('0x22')](respondWithStatusCode(_0x54d90c,null))[_0xa310('0x44')](handleError(_0x54d90c,null));};exports[_0xa310('0x81')]=function(_0x3bc267,_0x1c8f23,_0x4e9d99){return db[_0xa310('0x2b')]['find']({'where':{'id':_0x3bc267['params']['id']}})[_0xa310('0x22')](handleEntityNotFound(_0x1c8f23,null))[_0xa310('0x22')](function(_0x359dd3){if(_0x359dd3){return _0x359dd3[_0xa310('0x81')](_0x3bc267[_0xa310('0x4a')][_0xa310('0x6b')],_[_0xa310('0x82')](_0x3bc267[_0xa310('0x4a')],[_0xa310('0x6b'),'id'])||{})[_0xa310('0x83')](function(_0x47ca07){for(var _0x24ec1e=0x0;_0x24ec1e<_0x3bc267[_0xa310('0x4a')][_0xa310('0x6b')][_0xa310('0x33')];_0x24ec1e+=0x1){socket[_0xa310('0x68')](_0xa310('0x69'),{'UserId':_0x3bc267[_0xa310('0x4a')][_0xa310('0x6b')][_0x24ec1e],'FaxQueueId':_0x3bc267[_0xa310('0x45')]['id']});}return _0x47ca07;});}})[_0xa310('0x22')](respondWithResult(_0x1c8f23,null))[_0xa310('0x44')](handleError(_0x1c8f23,null));};exports['removeAgents']=function(_0x4d1e7d,_0x30d9b6,_0x5e7dfb){return db[_0xa310('0x2b')][_0xa310('0x48')]({'where':{'id':_0x4d1e7d[_0xa310('0x45')]['id']}})[_0xa310('0x22')](handleEntityNotFound(_0x30d9b6,null))[_0xa310('0x22')](function(_0x3ada6e){if(_0x3ada6e){return _0x3ada6e[_0xa310('0x7f')](_0x4d1e7d[_0xa310('0x2d')][_0xa310('0x6b')])['then'](function(){if(_[_0xa310('0x84')](_0x4d1e7d[_0xa310('0x2d')][_0xa310('0x6b')])){for(var _0x5746a6=0x0;_0x5746a6<_0x4d1e7d[_0xa310('0x2d')][_0xa310('0x6b')][_0xa310('0x33')];_0x5746a6+=0x1){socket[_0xa310('0x68')](_0xa310('0x85'),{'UserId':Number(_0x4d1e7d[_0xa310('0x2d')]['ids'][_0x5746a6]),'FaxQueueId':Number(_0x4d1e7d['params']['id'])});}}else{socket['emit'](_0xa310('0x85'),{'UserId':Number(_0x4d1e7d[_0xa310('0x2d')][_0xa310('0x6b')]),'FaxQueueId':Number(_0x4d1e7d['params']['id'])});}});}})[_0xa310('0x22')](respondWithStatusCode(_0x30d9b6,null))[_0xa310('0x44')](handleError(_0x30d9b6,null));};exports[_0xa310('0x86')]=function(_0x42581e,_0xca72ac,_0x51de89){var _0x537ec0={};var _0x246104={};var _0x3d01f5;var _0x47fc2e;return db[_0xa310('0x2b')][_0xa310('0x51')]({'where':{'id':_0x42581e[_0xa310('0x45')]['id']}})['then'](handleEntityNotFound(_0xca72ac,null))['then'](function(_0xdf6cad){if(_0xdf6cad){_0x3d01f5=_0xdf6cad;_0x246104[_0xa310('0x30')]=_['keys'](db['User'][_0xa310('0x46')]);_0x246104['query']=_[_0xa310('0x2c')](_0x42581e['query']);_0x246104[_0xa310('0x2e')]=_[_0xa310('0x2f')](_0x246104['model'],_0x246104[_0xa310('0x2d')]);_0x537ec0[_0xa310('0x31')]=_[_0xa310('0x2f')](_0x246104[_0xa310('0x30')],qs[_0xa310('0x32')](_0x42581e[_0xa310('0x2d')][_0xa310('0x32')]));_0x537ec0['attributes']=_0x537ec0['attributes'][_0xa310('0x33')]?_0x537ec0[_0xa310('0x31')]:_0x246104[_0xa310('0x30')];_0x537ec0['order']=qs[_0xa310('0x37')](_0x42581e[_0xa310('0x2d')][_0xa310('0x37')]);_0x537ec0[_0xa310('0x38')]=qs[_0xa310('0x2e')](_['pick'](_0x42581e[_0xa310('0x2d')],_0x246104['filters']));if(_0x42581e[_0xa310('0x2d')][_0xa310('0x3f')]){_0x537ec0[_0xa310('0x38')]=_['merge'](_0x537ec0[_0xa310('0x38')],{'$or':_[_0xa310('0x3b')](_0x537ec0[_0xa310('0x31')],function(_0x30b230){var _0x324d80={};_0x324d80[_0x30b230]={'$like':'%'+_0x42581e[_0xa310('0x2d')][_0xa310('0x3f')]+'%'};return _0x324d80;})});}_0x537ec0=_[_0xa310('0x3a')]({},_0x537ec0,_0x42581e[_0xa310('0x47')]);return _0x3d01f5['getAgents'](_0x537ec0);}})[_0xa310('0x22')](function(_0x41f1c5){if(_0x41f1c5){_0x47fc2e=_0x41f1c5[_0xa310('0x33')];if(!_0x42581e['query'][_0xa310('0x34')](_0xa310('0x35'))){_0x537ec0[_0xa310('0x36')]=qs[_0xa310('0x36')](_0x42581e[_0xa310('0x2d')][_0xa310('0x36')]);_0x537ec0[_0xa310('0x1d')]=qs[_0xa310('0x1d')](_0x42581e[_0xa310('0x2d')][_0xa310('0x1d')]);}return _0x3d01f5[_0xa310('0x86')](_0x537ec0);}})[_0xa310('0x22')](function(_0x5883a2){if(_0x5883a2){return _0x5883a2?{'count':_0x47fc2e,'rows':_0x5883a2}:null;}})[_0xa310('0x22')](respondWithResult(_0xca72ac,null))['catch'](handleError(_0xca72ac,null));}; \ No newline at end of file +var _0x209e=['sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','socket.io-emitter','./faxQueue.socket','register','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','FaxQueues','UserProfileResource','end','sendStatus','stack','name','send','FaxQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','include','findAll','rows','catch','show','params','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','body','find','describe','findOne','UserFaxQueue','FaxQueueId','User','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','Team','teams','Agents','addTeams','each','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','tq.TeamId','team_has_fax_queues','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x209e,0xf4));var _0xe209=function(_0x1568e3,_0x8e98da){_0x1568e3=_0x1568e3-0x0;var _0x8ad56b=_0x209e[_0x1568e3];return _0x8ad56b;};'use strict';var pdf=require(_0xe209('0x0'));var emlformat=require(_0xe209('0x1'));var rimraf=require(_0xe209('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe209('0x3'));var rp=require(_0xe209('0x4'));var moment=require(_0xe209('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe209('0x6'));var util=require('util');var path=require(_0xe209('0x7'));var sox=require(_0xe209('0x8'));var csv=require(_0xe209('0x9'));var ejs=require(_0xe209('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe209('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe209('0xc'));var toCsv=require(_0xe209('0x9'));var querystring=require(_0xe209('0xd'));var Papa=require(_0xe209('0xe'));var Redis=require(_0xe209('0xf'));var authService=require(_0xe209('0x10'));var qs=require(_0xe209('0x11'));var hardwareService=require(_0xe209('0x12'));var logger=require(_0xe209('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe209('0x14')]=_['defaults'](config[_0xe209('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe209('0x15'))(new Redis(config[_0xe209('0x14')]));require(_0xe209('0x16'))[_0xe209('0x17')](socket);function respondWithStatusCode(_0xb1a4d9,_0x2b9098){_0x2b9098=_0x2b9098||0xcc;return function(_0x31132a){if(_0x31132a){return _0xb1a4d9['sendStatus'](_0x2b9098);}return _0xb1a4d9[_0xe209('0x18')](_0x2b9098)['end']();};}function respondWithResult(_0x5d6944,_0x403bcb){_0x403bcb=_0x403bcb||0xc8;return function(_0x35de9){if(_0x35de9){return _0x5d6944[_0xe209('0x18')](_0x403bcb)[_0xe209('0x19')](_0x35de9);}};}function respondWithFilteredResult(_0x2aa3b4,_0x112885){return function(_0x8e0c6){if(_0x8e0c6){var _0x63d2e3=_0x8e0c6[_0xe209('0x1a')],_0x443a6e=_0x112885[_0xe209('0x1b')],_0x12e249=_0x112885[_0xe209('0x1b')]+_0x112885[_0xe209('0x1c')],_0x5642e3;if(_0x12e249>=_0x63d2e3){_0x12e249=_0x63d2e3;_0x5642e3=0xc8;}else{_0x5642e3=0xce;}_0x2aa3b4[_0xe209('0x18')](_0x5642e3);return _0x2aa3b4[_0xe209('0x1d')](_0xe209('0x1e'),_0x443a6e+'-'+_0x12e249+'/'+_0x63d2e3)[_0xe209('0x19')](_0x8e0c6);}return null;};}function patchUpdates(_0x45ec56){return function(_0x1b2d3a){try{jsonpatch[_0xe209('0x1f')](_0x1b2d3a,_0x45ec56,!![]);}catch(_0x323f5b){return BPromise['reject'](_0x323f5b);}return _0x1b2d3a['save']();};}function saveUpdates(_0x123951,_0x40ad65){return function(_0x52dd72){if(_0x52dd72){return _0x52dd72['update'](_0x123951)[_0xe209('0x20')](function(_0xe43741){return _0xe43741;});}return null;};}function removeEntity(_0xc7ed40,_0x4d03c4){return function(_0x2dadfe){if(_0x2dadfe){return _0x2dadfe[_0xe209('0x21')]()[_0xe209('0x20')](function(){var _0x3e1f15=_0x2dadfe['get']({'plain':!![]});var _0x22ee07=_0xe209('0x22');return db[_0xe209('0x23')]['destroy']({'where':{'type':_0x22ee07,'resourceId':_0x3e1f15['id']}})['then'](function(){return _0x2dadfe;});})[_0xe209('0x20')](function(){_0xc7ed40[_0xe209('0x18')](0xcc)[_0xe209('0x24')]();});}};}function handleEntityNotFound(_0x1f1840,_0x189706){return function(_0x9719c0){if(!_0x9719c0){_0x1f1840[_0xe209('0x25')](0x194);}return _0x9719c0;};}function handleError(_0x5a3f5a,_0x38ca34){_0x38ca34=_0x38ca34||0x1f4;return function(_0x2d7def){logger['error'](_0x2d7def[_0xe209('0x26')]);if(_0x2d7def[_0xe209('0x27')]){delete _0x2d7def[_0xe209('0x27')];}_0x5a3f5a[_0xe209('0x18')](_0x38ca34)[_0xe209('0x28')](_0x2d7def);};}exports['index']=function(_0x3638b8,_0x471982){var _0x1f536b={},_0xb9d1ca={},_0x165d84={'count':0x0,'rows':[]};var _0x2200d9=db[_0xe209('0x29')][_0xe209('0x2a')];_0xb9d1ca[_0xe209('0x2b')]=_[_0xe209('0x2c')](_0x2200d9);_0xb9d1ca[_0xe209('0x2d')]=_[_0xe209('0x2c')](_0x3638b8['query']);_0xb9d1ca['filters']=_[_0xe209('0x2e')](_0xb9d1ca[_0xe209('0x2b')],_0xb9d1ca[_0xe209('0x2d')]);_0x1f536b[_0xe209('0x2f')]=_[_0xe209('0x2e')](_0xb9d1ca['model'],qs[_0xe209('0x30')](_0x3638b8['query']['fields']));_0x1f536b['attributes']=_0x1f536b[_0xe209('0x2f')][_0xe209('0x31')]?_0x1f536b[_0xe209('0x2f')]:_0xb9d1ca[_0xe209('0x2b')];if(!_0x3638b8[_0xe209('0x2d')][_0xe209('0x32')](_0xe209('0x33'))){_0x1f536b[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0x3638b8[_0xe209('0x2d')][_0xe209('0x1c')]);_0x1f536b[_0xe209('0x1b')]=qs['offset'](_0x3638b8[_0xe209('0x2d')][_0xe209('0x1b')]);}_0x1f536b[_0xe209('0x34')]=qs['sort'](_0x3638b8['query'][_0xe209('0x35')]);_0x1f536b[_0xe209('0x36')]=qs[_0xe209('0x37')](_[_0xe209('0x38')](_0x3638b8[_0xe209('0x2d')],_0xb9d1ca[_0xe209('0x37')]));if(_0x3638b8[_0xe209('0x2d')][_0xe209('0x39')]){_0x1f536b['where']=_[_0xe209('0x3a')](_0x1f536b[_0xe209('0x36')],{'$or':_[_0xe209('0x3b')](_0x2200d9,function(_0x2edc0b){if(_0x2edc0b[_0xe209('0x3c')][_0xe209('0x3d')]!=='VIRTUAL'){var _0x532da9={};_0x532da9[_0x2edc0b[_0xe209('0x3e')]]={'$like':'%'+_0x3638b8[_0xe209('0x2d')]['filter']+'%'};return _0x532da9;}})});}_0x1f536b=_[_0xe209('0x3a')]({},_0x1f536b,_0x3638b8[_0xe209('0x3f')]);var _0x4b8dcf={'where':_0x1f536b['where']};return db['FaxQueue'][_0xe209('0x1a')](_0x4b8dcf)[_0xe209('0x20')](function(_0x3f3fe5){_0x165d84['count']=_0x3f3fe5;if(_0x3638b8[_0xe209('0x2d')]['includeAll']){_0x1f536b[_0xe209('0x40')]=[{'all':!![]}];}return db['FaxQueue'][_0xe209('0x41')](_0x1f536b);})[_0xe209('0x20')](function(_0x5f4368){_0x165d84[_0xe209('0x42')]=_0x5f4368;return _0x165d84;})[_0xe209('0x20')](respondWithFilteredResult(_0x471982,_0x1f536b))[_0xe209('0x43')](handleError(_0x471982,null));};exports[_0xe209('0x44')]=function(_0x4a394f,_0xd9103){var _0x405248={'raw':!![],'where':{'id':_0x4a394f[_0xe209('0x45')]['id']}},_0xf7617={};_0xf7617[_0xe209('0x2b')]=_['keys'](db[_0xe209('0x29')][_0xe209('0x2a')]);_0xf7617['query']=_[_0xe209('0x2c')](_0x4a394f[_0xe209('0x2d')]);_0xf7617[_0xe209('0x37')]=_[_0xe209('0x2e')](_0xf7617[_0xe209('0x2b')],_0xf7617['query']);_0x405248[_0xe209('0x2f')]=_[_0xe209('0x2e')](_0xf7617['model'],qs[_0xe209('0x30')](_0x4a394f['query'][_0xe209('0x30')]));_0x405248[_0xe209('0x2f')]=_0x405248[_0xe209('0x2f')][_0xe209('0x31')]?_0x405248['attributes']:_0xf7617[_0xe209('0x2b')];if(_0x4a394f[_0xe209('0x2d')][_0xe209('0x46')]){_0x405248[_0xe209('0x40')]=[{'all':!![]}];}_0x405248=_[_0xe209('0x3a')]({},_0x405248,_0x4a394f[_0xe209('0x3f')]);return db[_0xe209('0x29')]['find'](_0x405248)[_0xe209('0x20')](handleEntityNotFound(_0xd9103,null))[_0xe209('0x20')](respondWithResult(_0xd9103,null))[_0xe209('0x43')](handleError(_0xd9103,null));};exports['create']=function(_0x9eb88b,_0x4af23e){return db[_0xe209('0x29')][_0xe209('0x47')](_0x9eb88b['body'],{})['then'](function(_0x3ac5ef){var _0x4daa2c=_0x9eb88b[_0xe209('0x48')][_0xe209('0x49')]({'plain':!![]});if(!_0x4daa2c)throw new Error(_0xe209('0x4a'));if(_0x4daa2c[_0xe209('0x4b')]===_0xe209('0x48')){var _0x3d5a96=_0x3ac5ef[_0xe209('0x49')]({'plain':!![]});var _0x4fe554='FaxQueues';return db[_0xe209('0x4c')]['find']({'where':{'name':_0x4fe554,'userProfileId':_0x4daa2c[_0xe209('0x4d')]},'raw':!![]})[_0xe209('0x20')](function(_0x1df862){if(_0x1df862&&_0x1df862[_0xe209('0x4e')]===0x0){return db[_0xe209('0x23')][_0xe209('0x47')]({'name':_0x3d5a96[_0xe209('0x27')],'resourceId':_0x3d5a96['id'],'type':_0x1df862['name'],'sectionId':_0x1df862['id']},{})[_0xe209('0x20')](function(){return _0x3ac5ef;});}else{return _0x3ac5ef;}})['catch'](function(_0x29793f){logger[_0xe209('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29793f);throw _0x29793f;});}return _0x3ac5ef;})[_0xe209('0x20')](respondWithResult(_0x4af23e,0xc9))['catch'](handleError(_0x4af23e,null));};exports[_0xe209('0x50')]=function(_0x3fdf81,_0x13e63d){if(_0x3fdf81['body']['id']){delete _0x3fdf81[_0xe209('0x51')]['id'];}return db[_0xe209('0x29')][_0xe209('0x52')]({'where':{'id':_0x3fdf81[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x13e63d,null))[_0xe209('0x20')](saveUpdates(_0x3fdf81['body'],null))[_0xe209('0x20')](respondWithResult(_0x13e63d,null))[_0xe209('0x43')](handleError(_0x13e63d,null));};exports[_0xe209('0x21')]=function(_0x5c32f8,_0x426339){return db['FaxQueue'][_0xe209('0x52')]({'where':{'id':_0x5c32f8['params']['id']}})['then'](handleEntityNotFound(_0x426339,null))[_0xe209('0x20')](removeEntity(_0x426339,null))['catch'](handleError(_0x426339,null));};exports['describe']=function(_0x32de4b,_0x387831){return db['FaxQueue'][_0xe209('0x53')]()[_0xe209('0x20')](respondWithResult(_0x387831,null))[_0xe209('0x43')](handleError(_0x387831,null));};exports['getMembers']=function(_0x5e973e,_0x114137,_0xd6b604){var _0x975e43={'raw':!![],'where':{}},_0x34a2d4={},_0x27bc04;return db[_0xe209('0x29')][_0xe209('0x54')]({'where':{'id':_0x5e973e[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x114137,null))['then'](function(_0xa1d6fa){if(_0xa1d6fa){_0x27bc04=_0xa1d6fa['get']({'plain':!![]});_0x34a2d4[_0xe209('0x2b')]=_[_0xe209('0x2c')](db[_0xe209('0x55')][_0xe209('0x2a')]);_0x34a2d4[_0xe209('0x2d')]=_[_0xe209('0x2c')](_0x5e973e[_0xe209('0x2d')]);_0x34a2d4[_0xe209('0x37')]=_[_0xe209('0x2e')](_0x34a2d4['model'],_0x34a2d4['query']);_0x975e43[_0xe209('0x2f')]=_[_0xe209('0x2e')](_0x34a2d4[_0xe209('0x2b')],qs[_0xe209('0x30')](_0x5e973e[_0xe209('0x2d')]['fields']));_0x975e43['attributes']=_0x975e43['attributes'][_0xe209('0x31')]?_0x975e43['attributes']:_0x34a2d4[_0xe209('0x2b')];if(!_0x5e973e[_0xe209('0x2d')][_0xe209('0x32')](_0xe209('0x33'))){_0x975e43[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0x5e973e[_0xe209('0x2d')][_0xe209('0x1c')]);_0x975e43['offset']=qs['offset'](_0x5e973e[_0xe209('0x2d')][_0xe209('0x1b')]);}_0x975e43['order']=qs[_0xe209('0x35')](_0x5e973e[_0xe209('0x2d')][_0xe209('0x35')]);_0x975e43[_0xe209('0x36')]=qs[_0xe209('0x37')](_[_0xe209('0x38')](_0x5e973e[_0xe209('0x2d')],_0x34a2d4[_0xe209('0x37')]));_0x975e43[_0xe209('0x36')][_0xe209('0x56')]=_0xa1d6fa['id'];if(_0x5e973e[_0xe209('0x2d')][_0xe209('0x39')]){_0x975e43['where']=_[_0xe209('0x3a')](_0x975e43[_0xe209('0x36')],{'$or':_[_0xe209('0x3b')](_0x975e43['attributes'],function(_0x46dc95){var _0x344423={};_0x344423[_0x46dc95]={'$like':'%'+_0x5e973e[_0xe209('0x2d')][_0xe209('0x39')]+'%'};return _0x344423;})});}_0x975e43=_[_0xe209('0x3a')]({},_0x975e43,_0x5e973e[_0xe209('0x3f')]);return db[_0xe209('0x55')][_0xe209('0x41')](_0x975e43);}})[_0xe209('0x20')](function(_0x3006be){if(_0x3006be){return db[_0xe209('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x3006be,'UserId'),'role':_0xe209('0x58')},'attributes':['id',_0xe209('0x27'),'faxPause',_0xe209('0x59'),_0xe209('0x5a')]});}})[_0xe209('0x20')](function(_0x52c9f5){if(_0x52c9f5){return{'count':_0x52c9f5[_0xe209('0x1a')],'rows':_[_0xe209('0x3b')](_0x52c9f5[_0xe209('0x42')],function(_0x209f3c){return{'membername':_0x209f3c[_0xe209('0x27')],'UserId':_0x209f3c['id'],'queue_name':_0x27bc04['name'],'FaxQueueId':_0x27bc04['id'],'interface':util['format'](_0xe209('0x5b'),_0xe209('0x5c'),_0x209f3c[_0xe209('0x27')]),'penalty':0x0,'paused':_0x209f3c[_0xe209('0x5d')],'createdAt':_0x209f3c['createdAt'],'updatedAt':_0x209f3c[_0xe209('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe209('0x20')](respondWithFilteredResult(_0x114137,_0x975e43))['catch'](handleError(_0x114137,null));};exports[_0xe209('0x5e')]=function(_0x5d0a45,_0x1a3b2d,_0x5a4077){var _0x255074={};var _0x2fd3a9={};var _0x1f9f40;var _0x2a5af0;return db[_0xe209('0x29')][_0xe209('0x54')]({'where':{'id':_0x5d0a45[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x1a3b2d,null))[_0xe209('0x20')](function(_0x2c3a50){if(_0x2c3a50){_0x1f9f40=_0x2c3a50;_0x2fd3a9['model']=_[_0xe209('0x2c')](db[_0xe209('0x5f')]['rawAttributes']);_0x2fd3a9['query']=_[_0xe209('0x2c')](_0x5d0a45[_0xe209('0x2d')]);_0x2fd3a9[_0xe209('0x37')]=_['intersection'](_0x2fd3a9['model'],_0x2fd3a9[_0xe209('0x2d')]);_0x255074[_0xe209('0x2f')]=_[_0xe209('0x2e')](_0x2fd3a9['model'],qs['fields'](_0x5d0a45[_0xe209('0x2d')]['fields']));_0x255074['attributes']=_0x255074['attributes'][_0xe209('0x31')]?_0x255074[_0xe209('0x2f')]:_0x2fd3a9[_0xe209('0x2b')];_0x255074['order']=qs[_0xe209('0x35')](_0x5d0a45[_0xe209('0x2d')][_0xe209('0x35')]);_0x255074[_0xe209('0x36')]=qs[_0xe209('0x37')](_[_0xe209('0x38')](_0x5d0a45['query'],_0x2fd3a9['filters']));if(_0x5d0a45[_0xe209('0x2d')]['filter']){_0x255074[_0xe209('0x36')]=_['merge'](_0x255074[_0xe209('0x36')],{'$or':_[_0xe209('0x3b')](_0x255074[_0xe209('0x2f')],function(_0x319250){var _0xcb58b6={};_0xcb58b6[_0x319250]={'$like':'%'+_0x5d0a45[_0xe209('0x2d')][_0xe209('0x39')]+'%'};return _0xcb58b6;})});}_0x255074=_['merge']({},_0x255074,_0x5d0a45['options']);return _0x1f9f40[_0xe209('0x5e')](_0x255074);}})[_0xe209('0x20')](function(_0x436758){if(_0x436758){_0x2a5af0=_0x436758['length'];if(!_0x5d0a45[_0xe209('0x2d')][_0xe209('0x32')]('nolimit')){_0x255074[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0x5d0a45[_0xe209('0x2d')][_0xe209('0x1c')]);_0x255074[_0xe209('0x1b')]=qs[_0xe209('0x1b')](_0x5d0a45[_0xe209('0x2d')][_0xe209('0x1b')]);}return _0x1f9f40[_0xe209('0x5e')](_0x255074);}})[_0xe209('0x20')](function(_0x524afe){if(_0x524afe){return _0x524afe?{'count':_0x2a5af0,'rows':_0x524afe}:null;}})['then'](respondWithResult(_0x1a3b2d,null))[_0xe209('0x43')](handleError(_0x1a3b2d,null));};exports['addTeams']=function(_0x338dec,_0x33776d,_0x448532){var _0x539521=_0x338dec[_0xe209('0x51')][_0xe209('0x60')];return db[_0xe209('0x5f')][_0xe209('0x41')]({'where':{'id':_[_0xe209('0x3b')](_0x539521,'id')},'attributes':['id'],'include':[{'model':db[_0xe209('0x57')],'as':_0xe209('0x61'),'attributes':['id',_0xe209('0x27'),'online','voicePause','interface'],'raw':!![]}]})[_0xe209('0x20')](function(_0x1158a7){if(_0x1158a7){var _0x489990=_['flatMap'](_0x1158a7,function(_0x459e01){var _0x1f192e=_0x459e01[_0xe209('0x49')]({'plain':!![]});return _0x1f192e['Agents'];});return db[_0xe209('0x29')][_0xe209('0x52')]({'where':{'id':_0x338dec[_0xe209('0x45')]['id']}})[_0xe209('0x20')](function(_0x272d6f){return db['sequelize']['transaction'](function(_0x331b14){return _0x272d6f[_0xe209('0x62')](_[_0xe209('0x3b')](_0x539521,'id'),{'transaction':_0x331b14})[_0xe209('0x20')](function(){return BPromise[_0xe209('0x63')](_0x489990,function(_0x5370ae){return db[_0xe209('0x55')][_0xe209('0x64')]({'where':{'UserId':_0x5370ae['id'],'FaxQueueId':_0x338dec[_0xe209('0x45')]['id']},'transaction':_0x331b14});});})[_0xe209('0x20')](function(){_0x489990['forEach'](function(_0x2ac6dc){socket[_0xe209('0x65')](_0xe209('0x66'),{'UserId':_0x2ac6dc['id'],'FaxQueueId':_0x272d6f['id']});});});});});}})[_0xe209('0x20')](respondWithStatusCode(_0x33776d,null))[_0xe209('0x43')](handleError(_0x33776d,null));};exports[_0xe209('0x67')]=function(_0x1ededf,_0x1ef686,_0x467485){return db[_0xe209('0x5f')][_0xe209('0x41')]({'where':{'id':_0x1ededf[_0xe209('0x2d')][_0xe209('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe209('0x61'),'attributes':['id'],'raw':!![]}]})[_0xe209('0x20')](handleEntityNotFound(_0x1ef686,null))['then'](function(_0x28bacb){var _0x26a5cf=_[_0xe209('0x3b')](_0x28bacb,'id');var _0x30b93a=[];var _0x3597ec=[];var _0x3e820e=squel['select']();_0x3e820e[_0xe209('0x3e')](_0xe209('0x69'))['from'](_0xe209('0x6a'),'tq')['join'](_0xe209('0x6b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe209('0x36')]('FaxQueueId\x20=\x20?',_0x1ededf[_0xe209('0x45')]['id']);for(var _0x349936=0x0;_0x349936<_0x28bacb[_0xe209('0x31')];_0x349936+=0x1){let _0x24e96e=_0x28bacb[_0x349936];for(var _0x1ca45b=0x0;_0x1ca45b<_0x24e96e['Agents']['length'];_0x1ca45b+=0x1){let _0x4705f2=_0x24e96e[_0xe209('0x61')][_0x1ca45b];var _0x5eee3e=_0x3e820e['clone']();_0x5eee3e[_0xe209('0x36')](_0xe209('0x6c'),_0x4705f2['id']);_0x3597ec[_0xe209('0x6d')](db[_0xe209('0x6e')][_0xe209('0x2d')](_0x5eee3e['toString'](),{'type':db['sequelize'][_0xe209('0x6f')][_0xe209('0x70')]})[_0xe209('0x20')](function(_0x51f28f){if(_0x51f28f[_0xe209('0x31')]===0x1){return _0x4705f2['id'];}else{var _0x88cc23=_[_0xe209('0x71')](_[_0xe209('0x3b')](_0x51f28f,'TeamId'),function(_0xe382cd){return _[_0xe209('0x72')](_0x26a5cf,_0xe382cd);});if(_0x88cc23){return _0x4705f2['id'];}}}));}}return BPromise[_0xe209('0x73')](_0x3597ec)[_0xe209('0x20')](function(_0x22092c){_0x30b93a=_(_0x30b93a)[_0xe209('0x74')](_0x22092c)['compact']()[_0xe209('0x75')]();return db[_0xe209('0x29')][_0xe209('0x52')]({'where':{'id':_0x1ededf[_0xe209('0x45')]['id']}})[_0xe209('0x20')](function(_0x26d3b7){return db['sequelize']['transaction'](function(_0x1e80da){return _0x26d3b7[_0xe209('0x67')](_0x1ededf['query'][_0xe209('0x68')],{'transaction':_0x1e80da})['then'](function(){if(!_['isEmpty'](_0x30b93a)){return _0x26d3b7[_0xe209('0x76')](_0x30b93a,{'transaction':_0x1e80da});}})[_0xe209('0x20')](function(){_0x30b93a[_0xe209('0x77')](function(_0x19ba3a){socket[_0xe209('0x65')](_0xe209('0x78'),{'UserId':_0x19ba3a,'FaxQueueId':_0x26d3b7['id']});});});});});});})[_0xe209('0x20')](respondWithStatusCode(_0x1ef686,null))['catch'](handleError(_0x1ef686,null));};exports[_0xe209('0x79')]=function(_0xee8188,_0x4c2760,_0xe9e1eb){return db[_0xe209('0x29')][_0xe209('0x52')]({'where':{'id':_0xee8188[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x4c2760,null))[_0xe209('0x20')](function(_0x179ca8){if(_0x179ca8){return _0x179ca8[_0xe209('0x79')](_0xee8188[_0xe209('0x51')]['ids'],_[_0xe209('0x7a')](_0xee8188['body'],[_0xe209('0x68'),'id'])||{})[_0xe209('0x7b')](function(_0x2829cc){for(var _0x22a357=0x0;_0x22a357<_0xee8188[_0xe209('0x51')][_0xe209('0x68')]['length'];_0x22a357+=0x1){socket[_0xe209('0x65')](_0xe209('0x66'),{'UserId':_0xee8188[_0xe209('0x51')]['ids'][_0x22a357],'FaxQueueId':_0xee8188['params']['id']});}return _0x2829cc;});}})[_0xe209('0x20')](respondWithResult(_0x4c2760,null))[_0xe209('0x43')](handleError(_0x4c2760,null));};exports[_0xe209('0x76')]=function(_0x1fd785,_0x24b6c3,_0x49bf00){return db[_0xe209('0x29')][_0xe209('0x52')]({'where':{'id':_0x1fd785[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x24b6c3,null))[_0xe209('0x20')](function(_0x3a6a45){if(_0x3a6a45){return _0x3a6a45[_0xe209('0x76')](_0x1fd785['query'][_0xe209('0x68')])[_0xe209('0x20')](function(){if(_[_0xe209('0x7c')](_0x1fd785['query'][_0xe209('0x68')])){for(var _0x5fcbfd=0x0;_0x5fcbfd<_0x1fd785[_0xe209('0x2d')][_0xe209('0x68')][_0xe209('0x31')];_0x5fcbfd+=0x1){socket['emit'](_0xe209('0x78'),{'UserId':Number(_0x1fd785[_0xe209('0x2d')]['ids'][_0x5fcbfd]),'FaxQueueId':Number(_0x1fd785['params']['id'])});}}else{socket[_0xe209('0x65')](_0xe209('0x78'),{'UserId':Number(_0x1fd785[_0xe209('0x2d')][_0xe209('0x68')]),'FaxQueueId':Number(_0x1fd785[_0xe209('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x24b6c3,null))[_0xe209('0x43')](handleError(_0x24b6c3,null));};exports['getAgents']=function(_0xa11f57,_0x60064,_0xb05e8){var _0x370fcd={};var _0x4a74f9={};var _0x56ade8;var _0x3bff63;return db['FaxQueue']['findOne']({'where':{'id':_0xa11f57[_0xe209('0x45')]['id']}})[_0xe209('0x20')](handleEntityNotFound(_0x60064,null))['then'](function(_0xd50872){if(_0xd50872){_0x56ade8=_0xd50872;_0x4a74f9[_0xe209('0x2b')]=_[_0xe209('0x2c')](db[_0xe209('0x57')][_0xe209('0x2a')]);_0x4a74f9[_0xe209('0x2d')]=_[_0xe209('0x2c')](_0xa11f57['query']);_0x4a74f9[_0xe209('0x37')]=_[_0xe209('0x2e')](_0x4a74f9[_0xe209('0x2b')],_0x4a74f9['query']);_0x370fcd['attributes']=_[_0xe209('0x2e')](_0x4a74f9[_0xe209('0x2b')],qs['fields'](_0xa11f57['query'][_0xe209('0x30')]));_0x370fcd['attributes']=_0x370fcd[_0xe209('0x2f')][_0xe209('0x31')]?_0x370fcd['attributes']:_0x4a74f9[_0xe209('0x2b')];_0x370fcd['order']=qs[_0xe209('0x35')](_0xa11f57[_0xe209('0x2d')]['sort']);_0x370fcd[_0xe209('0x36')]=qs['filters'](_[_0xe209('0x38')](_0xa11f57['query'],_0x4a74f9[_0xe209('0x37')]));if(_0xa11f57['query'][_0xe209('0x39')]){_0x370fcd[_0xe209('0x36')]=_[_0xe209('0x3a')](_0x370fcd[_0xe209('0x36')],{'$or':_['map'](_0x370fcd['attributes'],function(_0x75dd70){var _0x1dcff7={};_0x1dcff7[_0x75dd70]={'$like':'%'+_0xa11f57['query'][_0xe209('0x39')]+'%'};return _0x1dcff7;})});}_0x370fcd=_['merge']({},_0x370fcd,_0xa11f57['options']);return _0x56ade8[_0xe209('0x7d')](_0x370fcd);}})[_0xe209('0x20')](function(_0x5428da){if(_0x5428da){_0x3bff63=_0x5428da[_0xe209('0x31')];if(!_0xa11f57[_0xe209('0x2d')][_0xe209('0x32')]('nolimit')){_0x370fcd[_0xe209('0x1c')]=qs[_0xe209('0x1c')](_0xa11f57[_0xe209('0x2d')][_0xe209('0x1c')]);_0x370fcd[_0xe209('0x1b')]=qs[_0xe209('0x1b')](_0xa11f57[_0xe209('0x2d')][_0xe209('0x1b')]);}return _0x56ade8[_0xe209('0x7d')](_0x370fcd);}})[_0xe209('0x20')](function(_0x429f84){if(_0x429f84){return _0x429f84?{'count':_0x3bff63,'rows':_0x429f84}:null;}})[_0xe209('0x20')](respondWithResult(_0x60064,null))[_0xe209('0x43')](handleError(_0x60064,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2d56bb8..130d9ce 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 _0xac4a=['../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hook','events'];(function(_0x3e5595,_0x1f1b04){var _0x5a64c0=function(_0x2b1cc4){while(--_0x2b1cc4){_0x3e5595['push'](_0x3e5595['shift']());}};_0x5a64c0(++_0x1f1b04);}(_0xac4a,0x13f));var _0xaac4=function(_0x3c8c91,_0x4fcb8b){_0x3c8c91=_0x3c8c91-0x0;var _0x3748b9=_0xac4a[_0x3c8c91];return _0x3748b9;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var FaxQueue=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){FaxQueueEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);FaxQueueEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xea28=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xea28,0x13a));var _0x8ea2=function(_0x2104cd,_0x57e319){_0x2104cd=_0x2104cd-0x0;var _0x588866=_0xea28[_0x2104cd];return _0x588866;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var FaxQueue=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8ea2('0x3')](0x0);var events={'afterCreate':_0x8ea2('0x4'),'afterUpdate':_0x8ea2('0x5'),'afterDestroy':_0x8ea2('0x6')};function emitEvent(_0x10f7bb){return function(_0x4b7cda,_0x9b45ab,_0x23aaf1){FaxQueueEvents[_0x8ea2('0x7')](_0x10f7bb+':'+_0x4b7cda['id'],_0x4b7cda);FaxQueueEvents['emit'](_0x10f7bb,_0x4b7cda);_0x23aaf1(null);};}for(var e in events){if(events[_0x8ea2('0x8')](e)){var event=events[e];FaxQueue[_0x8ea2('0x9')](e,emitEvent(event));}}module[_0x8ea2('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 85ca37e..f9ec042 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 _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x430cd5,_0x2f935b){var _0x59fb5=function(_0x728d6){while(--_0x728d6){_0x430cd5['push'](_0x430cd5['shift']());}};_0x59fb5(++_0x2f935b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x0b0e[_0x51cc1d];return _0x2eb9f2;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x31ad72,_0xfb4ae){var _0x33f4d9=function(_0x46eeca){while(--_0x46eeca){_0x31ad72['push'](_0x31ad72['shift']());}};_0x33f4d9(++_0xfb4ae);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4756a1,_0x3f8d1){_0x4756a1=_0x4756a1-0x0;var _0x177c4f=_0x0b0e[_0x4756a1];return _0x177c4f;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('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 f6619ca..979bea9 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 _0x1905=['find','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetFaxQueue','ShowFaxQueue'];(function(_0x5e215e,_0xc82305){var _0x5e2d25=function(_0x29c276){while(--_0x29c276){_0x5e215e['push'](_0x5e215e['shift']());}};_0x5e2d25(++_0xc82305);}(_0x1905,0x74));var _0x5190=function(_0x1a7d97,_0x236956){_0x1a7d97=_0x1a7d97-0x0;var _0x21ef71=_0x1905[_0x1a7d97];return _0x21ef71;};'use strict';var _=require(_0x5190('0x0'));var util=require(_0x5190('0x1'));var moment=require('moment');var BPromise=require(_0x5190('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5190('0x3'));var db=require(_0x5190('0x4'))['db'];var utils=require(_0x5190('0x5'));var logger=require(_0x5190('0x6'))(_0x5190('0x7'));var config=require(_0x5190('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5190('0x9')]['http']({'port':0x232a});config[_0x5190('0xa')]=_[_0x5190('0xb')](config[_0x5190('0xa')],{'host':_0x5190('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5190('0xd'))[_0x5190('0xe')](socket);function respondWithRpcPromise(_0x17249a,_0x34c522,_0x3e1c4f){return new BPromise(function(_0x35e5fc,_0x4714c7){return client['request'](_0x17249a,_0x3e1c4f)[_0x5190('0xf')](function(_0x361ffd){logger['info'](_0x5190('0x10'),_0x34c522,_0x5190('0x11'));logger['debug'](_0x5190('0x12'),_0x34c522,_0x5190('0x11'),JSON[_0x5190('0x13')](_0x361ffd));if(_0x361ffd[_0x5190('0x14')]){if(_0x361ffd[_0x5190('0x14')]['code']===0x1f4){logger['error'](_0x5190('0x10'),_0x34c522,_0x361ffd[_0x5190('0x14')][_0x5190('0x15')]);return _0x4714c7(_0x361ffd[_0x5190('0x14')][_0x5190('0x15')]);}logger[_0x5190('0x14')](_0x5190('0x10'),_0x34c522,_0x361ffd[_0x5190('0x14')]['message']);return _0x35e5fc(_0x361ffd[_0x5190('0x14')][_0x5190('0x15')]);}else{logger[_0x5190('0x16')]('FaxQueue,\x20%s,\x20%s',_0x34c522,'request\x20sent');_0x35e5fc(_0x361ffd['result']['message']);}})[_0x5190('0x17')](function(_0xe809db){logger[_0x5190('0x14')](_0x5190('0x10'),_0x34c522,_0xe809db);_0x4714c7(_0xe809db);});});}exports['GetFaxQueue']=function(_0x10e53b){var _0x460c69=this;return new Promise(function(_0x52eee1,_0x2fd3b7){return db[_0x5190('0x18')][_0x5190('0x19')]({'raw':_0x10e53b[_0x5190('0x1a')]?_0x10e53b[_0x5190('0x1a')][_0x5190('0x1b')]===undefined?!![]:![]:!![],'where':_0x10e53b['options']?_0x10e53b['options'][_0x5190('0x1c')]||null:null,'attributes':_0x10e53b['options']?_0x10e53b['options'][_0x5190('0x1d')]||null:null,'limit':_0x10e53b[_0x5190('0x1a')]?_0x10e53b['options'][_0x5190('0x1e')]||null:null,'include':_0x10e53b['options']?_0x10e53b[_0x5190('0x1a')][_0x5190('0x1f')]?_['map'](_0x10e53b['options'][_0x5190('0x1f')],function(_0x22bf45){return{'model':db[_0x22bf45[_0x5190('0x20')]],'as':_0x22bf45['as'],'attributes':_0x22bf45[_0x5190('0x1d')],'include':_0x22bf45['include']?_[_0x5190('0x21')](_0x22bf45[_0x5190('0x1f')],function(_0x28db4f){return{'model':db[_0x28db4f[_0x5190('0x20')]],'as':_0x28db4f['as'],'attributes':_0x28db4f['attributes'],'include':_0x28db4f['include']?_[_0x5190('0x21')](_0x28db4f['include'],function(_0x4ec401){return{'model':db[_0x4ec401[_0x5190('0x20')]],'as':_0x4ec401['as'],'attributes':_0x4ec401[_0x5190('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2134fe){logger['info'](_0x5190('0x22'),_0x10e53b);logger['debug'](_0x5190('0x22'),_0x10e53b,JSON[_0x5190('0x13')](_0x2134fe));_0x52eee1(_0x2134fe);})['catch'](function(_0x32fa04){logger[_0x5190('0x14')](_0x5190('0x22'),_0x32fa04[_0x5190('0x15')],_0x10e53b);_0x2fd3b7(_0x460c69[_0x5190('0x14')](0x1f4,_0x32fa04[_0x5190('0x15')]));});});};exports[_0x5190('0x23')]=function(_0x3f3857){var _0xb49d49=this;return new Promise(function(_0x48afb1,_0x5c0b67){return db[_0x5190('0x18')][_0x5190('0x24')]({'raw':_0x3f3857[_0x5190('0x1a')]?_0x3f3857[_0x5190('0x1a')][_0x5190('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f3857['options']?_0x3f3857[_0x5190('0x1a')][_0x5190('0x1c')]||null:null,'attributes':_0x3f3857[_0x5190('0x1a')]?_0x3f3857[_0x5190('0x1a')][_0x5190('0x1d')]||null:null,'include':_0x3f3857[_0x5190('0x1a')]?_0x3f3857[_0x5190('0x1a')][_0x5190('0x1f')]?_[_0x5190('0x21')](_0x3f3857['options'][_0x5190('0x1f')],function(_0x279a71){return{'model':db[_0x279a71[_0x5190('0x20')]],'as':_0x279a71['as'],'attributes':_0x279a71[_0x5190('0x1d')],'include':_0x279a71[_0x5190('0x1f')]?_[_0x5190('0x21')](_0x279a71[_0x5190('0x1f')],function(_0x5d3fc5){return{'model':db[_0x5d3fc5[_0x5190('0x20')]],'as':_0x5d3fc5['as'],'attributes':_0x5d3fc5[_0x5190('0x1d')],'include':_0x5d3fc5[_0x5190('0x1f')]?_[_0x5190('0x21')](_0x5d3fc5[_0x5190('0x1f')],function(_0x1fe76f){return{'model':db[_0x1fe76f[_0x5190('0x20')]],'as':_0x1fe76f['as'],'attributes':_0x1fe76f[_0x5190('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5190('0xf')](function(_0x38e650){logger[_0x5190('0x16')](_0x5190('0x23'),_0x3f3857);logger[_0x5190('0x25')](_0x5190('0x23'),_0x3f3857,JSON[_0x5190('0x13')](_0x38e650));_0x48afb1(_0x38e650);})['catch'](function(_0x10a403){logger[_0x5190('0x14')](_0x5190('0x23'),_0x10a403[_0x5190('0x15')],_0x3f3857);_0x5c0b67(_0xb49d49['error'](0x1f4,_0x10a403[_0x5190('0x15')]));});});}; \ No newline at end of file +var _0xeb74=['redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','catch','GetFaxQueue','FaxQueue','findAll','raw','options','attributes','limit','map','include','model','ShowFaxQueue','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults'];(function(_0x1f16f4,_0x5ed211){var _0x4b05b4=function(_0x171e58){while(--_0x171e58){_0x1f16f4['push'](_0x1f16f4['shift']());}};_0x4b05b4(++_0x5ed211);}(_0xeb74,0x70));var _0x4eb7=function(_0x4949bc,_0x149351){_0x4949bc=_0x4949bc-0x0;var _0x5eb97e=_0xeb74[_0x4949bc];return _0x5eb97e;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require('moment');var BPromise=require(_0x4eb7('0x2'));var rs=require(_0x4eb7('0x3'));var fs=require('fs');var Redis=require(_0x4eb7('0x4'));var db=require(_0x4eb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4eb7('0x6'));var config=require(_0x4eb7('0x7'));var jayson=require(_0x4eb7('0x8'));var client=jayson[_0x4eb7('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4eb7('0xa')](config[_0x4eb7('0xb')],{'host':_0x4eb7('0xc'),'port':0x18eb});var socket=require(_0x4eb7('0xd'))(new Redis(config[_0x4eb7('0xb')]));require(_0x4eb7('0xe'))[_0x4eb7('0xf')](socket);function respondWithRpcPromise(_0x15bce7,_0x35325c,_0x56e5d5){return new BPromise(function(_0x4483cc,_0x2d7657){return client[_0x4eb7('0x10')](_0x15bce7,_0x56e5d5)[_0x4eb7('0x11')](function(_0xf20429){logger[_0x4eb7('0x12')]('FaxQueue,\x20%s,\x20%s',_0x35325c,_0x4eb7('0x13'));logger[_0x4eb7('0x14')](_0x4eb7('0x15'),_0x35325c,'request\x20sent',JSON[_0x4eb7('0x16')](_0xf20429));if(_0xf20429[_0x4eb7('0x17')]){if(_0xf20429[_0x4eb7('0x17')][_0x4eb7('0x18')]===0x1f4){logger[_0x4eb7('0x17')]('FaxQueue,\x20%s,\x20%s',_0x35325c,_0xf20429[_0x4eb7('0x17')][_0x4eb7('0x19')]);return _0x2d7657(_0xf20429['error'][_0x4eb7('0x19')]);}logger[_0x4eb7('0x17')](_0x4eb7('0x1a'),_0x35325c,_0xf20429[_0x4eb7('0x17')][_0x4eb7('0x19')]);return _0x4483cc(_0xf20429[_0x4eb7('0x17')][_0x4eb7('0x19')]);}else{logger[_0x4eb7('0x12')](_0x4eb7('0x1a'),_0x35325c,_0x4eb7('0x13'));_0x4483cc(_0xf20429['result'][_0x4eb7('0x19')]);}})[_0x4eb7('0x1b')](function(_0x4278ad){logger['error'](_0x4eb7('0x1a'),_0x35325c,_0x4278ad);_0x2d7657(_0x4278ad);});});}exports[_0x4eb7('0x1c')]=function(_0x45fba4){var _0x37625a=this;return new Promise(function(_0x5ad335,_0xce4c10){return db[_0x4eb7('0x1d')][_0x4eb7('0x1e')]({'raw':_0x45fba4['options']?_0x45fba4['options'][_0x4eb7('0x1f')]===undefined?!![]:![]:!![],'where':_0x45fba4['options']?_0x45fba4[_0x4eb7('0x20')]['where']||null:null,'attributes':_0x45fba4[_0x4eb7('0x20')]?_0x45fba4[_0x4eb7('0x20')][_0x4eb7('0x21')]||null:null,'limit':_0x45fba4[_0x4eb7('0x20')]?_0x45fba4[_0x4eb7('0x20')][_0x4eb7('0x22')]||null:null,'include':_0x45fba4[_0x4eb7('0x20')]?_0x45fba4[_0x4eb7('0x20')]['include']?_[_0x4eb7('0x23')](_0x45fba4[_0x4eb7('0x20')][_0x4eb7('0x24')],function(_0x536a83){return{'model':db[_0x536a83[_0x4eb7('0x25')]],'as':_0x536a83['as'],'attributes':_0x536a83[_0x4eb7('0x21')],'include':_0x536a83['include']?_[_0x4eb7('0x23')](_0x536a83[_0x4eb7('0x24')],function(_0x2d9381){return{'model':db[_0x2d9381[_0x4eb7('0x25')]],'as':_0x2d9381['as'],'attributes':_0x2d9381[_0x4eb7('0x21')],'include':_0x2d9381[_0x4eb7('0x24')]?_[_0x4eb7('0x23')](_0x2d9381[_0x4eb7('0x24')],function(_0x1c0851){return{'model':db[_0x1c0851['model']],'as':_0x1c0851['as'],'attributes':_0x1c0851[_0x4eb7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa48472){logger[_0x4eb7('0x12')](_0x4eb7('0x1c'),_0x45fba4);logger['debug'](_0x4eb7('0x1c'),_0x45fba4,JSON[_0x4eb7('0x16')](_0xa48472));_0x5ad335(_0xa48472);})[_0x4eb7('0x1b')](function(_0xd5496e){logger[_0x4eb7('0x17')](_0x4eb7('0x1c'),_0xd5496e[_0x4eb7('0x19')],_0x45fba4);_0xce4c10(_0x37625a[_0x4eb7('0x17')](0x1f4,_0xd5496e[_0x4eb7('0x19')]));});});};exports[_0x4eb7('0x26')]=function(_0x5184ba){var _0x50c62d=this;return new Promise(function(_0x1ce63f,_0x97d1e4){return db[_0x4eb7('0x1d')][_0x4eb7('0x27')]({'raw':_0x5184ba['options']?_0x5184ba['options'][_0x4eb7('0x1f')]===undefined?!![]:![]:!![],'where':_0x5184ba[_0x4eb7('0x20')]?_0x5184ba['options'][_0x4eb7('0x28')]||null:null,'attributes':_0x5184ba[_0x4eb7('0x20')]?_0x5184ba[_0x4eb7('0x20')][_0x4eb7('0x21')]||null:null,'include':_0x5184ba['options']?_0x5184ba[_0x4eb7('0x20')]['include']?_[_0x4eb7('0x23')](_0x5184ba[_0x4eb7('0x20')][_0x4eb7('0x24')],function(_0xaff9b){return{'model':db[_0xaff9b[_0x4eb7('0x25')]],'as':_0xaff9b['as'],'attributes':_0xaff9b[_0x4eb7('0x21')],'include':_0xaff9b[_0x4eb7('0x24')]?_[_0x4eb7('0x23')](_0xaff9b['include'],function(_0x256e2c){return{'model':db[_0x256e2c[_0x4eb7('0x25')]],'as':_0x256e2c['as'],'attributes':_0x256e2c[_0x4eb7('0x21')],'include':_0x256e2c['include']?_[_0x4eb7('0x23')](_0x256e2c['include'],function(_0x5bf7bc){return{'model':db[_0x5bf7bc[_0x4eb7('0x25')]],'as':_0x5bf7bc['as'],'attributes':_0x5bf7bc[_0x4eb7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0x11')](function(_0x2e2cca){logger[_0x4eb7('0x12')](_0x4eb7('0x26'),_0x5184ba);logger['debug'](_0x4eb7('0x26'),_0x5184ba,JSON[_0x4eb7('0x16')](_0x2e2cca));_0x1ce63f(_0x2e2cca);})[_0x4eb7('0x1b')](function(_0x20967b){logger[_0x4eb7('0x17')]('ShowFaxQueue',_0x20967b[_0x4eb7('0x19')],_0x5184ba);_0x97d1e4(_0x50c62d[_0x4eb7('0x17')](0x1f4,_0x20967b[_0x4eb7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9ac13d0..6763ccc 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 _0x7086=['length','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x70a7bc,_0x8cccc0){var _0x379a84=function(_0x217cdb){while(--_0x217cdb){_0x70a7bc['push'](_0x70a7bc['shift']());}};_0x379a84(++_0x8cccc0);}(_0x7086,0x91));var _0x6708=function(_0x109ca9,_0x153588){_0x109ca9=_0x109ca9-0x0;var _0x5e1383=_0x7086[_0x109ca9];return _0x5e1383;};'use strict';var FaxQueueEvents=require(_0x6708('0x0'));var events=[_0x6708('0x1'),_0x6708('0x2'),_0x6708('0x3')];function createListener(_0x227e4f,_0x2f4ee0){return function(_0x4023c8){_0x2f4ee0[_0x6708('0x4')](_0x227e4f,_0x4023c8);};}function removeListener(_0x1e2f53,_0x3db0a1){return function(){FaxQueueEvents[_0x6708('0x5')](_0x1e2f53,_0x3db0a1);};}exports[_0x6708('0x6')]=function(_0x190f95){for(var _0x5ade8d=0x0,_0x2e518d=events[_0x6708('0x7')];_0x5ade8d<_0x2e518d;_0x5ade8d++){var _0x2af9cc=events[_0x5ade8d];var _0x1a21fe=createListener('faxQueue:'+_0x2af9cc,_0x190f95);FaxQueueEvents['on'](_0x2af9cc,_0x1a21fe);}}; \ No newline at end of file +var _0x99c6=['emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x99c6,0x10c));var _0x699c=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x99c6[_0x231e16];return _0x570a7c;};'use strict';var FaxQueueEvents=require(_0x699c('0x0'));var events=[_0x699c('0x1'),_0x699c('0x2'),_0x699c('0x3')];function createListener(_0x495c0b,_0x9083a6){return function(_0x307d0f){_0x9083a6[_0x699c('0x4')](_0x495c0b,_0x307d0f);};}function removeListener(_0x2f7ba8,_0x342e0f){return function(){FaxQueueEvents[_0x699c('0x5')](_0x2f7ba8,_0x342e0f);};}exports[_0x699c('0x6')]=function(_0x56048e){for(var _0x1548e7=0x0,_0x515a88=events['length'];_0x1548e7<_0x515a88;_0x1548e7++){var _0x137274=events[_0x1548e7];var _0x7db59c=createListener(_0x699c('0x7')+_0x137274,_0x56048e);FaxQueueEvents['on'](_0x137274,_0x7db59c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 32c0bd1..b559bfc 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 _0xb043=['express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout'];(function(_0x260dcb,_0x400ca4){var _0x1ca938=function(_0x460910){while(--_0x460910){_0x260dcb['push'](_0x260dcb['shift']());}};_0x1ca938(++_0x400ca4);}(_0xb043,0x159));var _0x3b04=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0xb043[_0x52e68e];return _0x3211a4;};'use strict';var multer=require('multer');var util=require(_0x3b04('0x0'));var path=require(_0x3b04('0x1'));var timeout=require(_0x3b04('0x2'));var express=require(_0x3b04('0x3'));var router=express[_0x3b04('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b04('0x5'));var config=require(_0x3b04('0x6'));var controller=require(_0x3b04('0x7'));router[_0x3b04('0x8')]('/',auth[_0x3b04('0x9')](),controller[_0x3b04('0xa')]);router[_0x3b04('0x8')](_0x3b04('0xb'),auth['isAuthenticated'](),controller[_0x3b04('0xc')]);router[_0x3b04('0x8')](_0x3b04('0xd'),auth['isAuthenticated'](),controller[_0x3b04('0xe')]);router['get'](_0x3b04('0xf'),auth[_0x3b04('0x9')](),controller[_0x3b04('0x10')]);router[_0x3b04('0x8')](_0x3b04('0x11'),auth[_0x3b04('0x9')](),controller['getTeams']);router[_0x3b04('0x8')](_0x3b04('0x12'),auth['isAuthenticated'](),controller[_0x3b04('0x13')]);router[_0x3b04('0x14')]('/',auth[_0x3b04('0x9')](),controller[_0x3b04('0x15')]);router['post'](_0x3b04('0x11'),auth[_0x3b04('0x9')](),controller[_0x3b04('0x16')]);router['post'](_0x3b04('0x12'),auth[_0x3b04('0x9')](),controller[_0x3b04('0x17')]);router[_0x3b04('0x18')](_0x3b04('0xd'),auth[_0x3b04('0x9')](),controller['update']);router[_0x3b04('0x19')](_0x3b04('0xd'),auth['isAuthenticated'](),controller[_0x3b04('0x1a')]);router[_0x3b04('0x19')](_0x3b04('0x11'),auth['isAuthenticated'](),controller[_0x3b04('0x1b')]);router['delete'](_0x3b04('0x12'),auth['isAuthenticated'](),controller[_0x3b04('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xa458=['addAgents','put','destroy','delete','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams'];(function(_0x2a894c,_0x418da3){var _0x159fe8=function(_0x408c0c){while(--_0x408c0c){_0x2a894c['push'](_0x2a894c['shift']());}};_0x159fe8(++_0x418da3);}(_0xa458,0x1f4));var _0x8a45=function(_0x424618,_0x14e53d){_0x424618=_0x424618-0x0;var _0x10f946=_0xa458[_0x424618];return _0x10f946;};'use strict';var multer=require(_0x8a45('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a45('0x1'));var express=require(_0x8a45('0x2'));var router=express[_0x8a45('0x3')]();var auth=require(_0x8a45('0x4'));var interaction=require(_0x8a45('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x8a45('0x6')]('/',auth['isAuthenticated'](),controller[_0x8a45('0x7')]);router['get'](_0x8a45('0x8'),auth[_0x8a45('0x9')](),controller[_0x8a45('0xa')]);router[_0x8a45('0x6')](_0x8a45('0xb'),auth['isAuthenticated'](),controller[_0x8a45('0xc')]);router[_0x8a45('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x8a45('0xd')]);router[_0x8a45('0x6')]('/:id/teams',auth[_0x8a45('0x9')](),controller[_0x8a45('0xe')]);router[_0x8a45('0x6')](_0x8a45('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8a45('0x10')]('/',auth[_0x8a45('0x9')](),controller[_0x8a45('0x11')]);router[_0x8a45('0x10')](_0x8a45('0x12'),auth[_0x8a45('0x9')](),controller[_0x8a45('0x13')]);router[_0x8a45('0x10')](_0x8a45('0xf'),auth['isAuthenticated'](),controller[_0x8a45('0x14')]);router[_0x8a45('0x15')](_0x8a45('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8a45('0x9')](),controller[_0x8a45('0x16')]);router[_0x8a45('0x17')](_0x8a45('0x12'),auth[_0x8a45('0x9')](),controller['removeTeams']);router[_0x8a45('0x17')](_0x8a45('0xf'),auth['isAuthenticated'](),controller[_0x8a45('0x18')]);module[_0x8a45('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index cd2a128..701eae2 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 _0xf26b=['DATE','sequelize','STRING'];(function(_0x3f9471,_0x4f2092){var _0x24709d=function(_0x50cecd){while(--_0x50cecd){_0x3f9471['push'](_0x3f9471['shift']());}};_0x24709d(++_0x4f2092);}(_0xf26b,0x163));var _0xbf26=function(_0x3e0971,_0x1eb602){_0x3e0971=_0x3e0971-0x0;var _0x14af9c=_0xf26b[_0x3e0971];return _0x14af9c;};'use strict';var moment=require('moment');var Sequelize=require(_0xbf26('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbf26('0x1')]},'joinAt':{'type':Sequelize[_0xbf26('0x2')]},'leaveAt':{'type':Sequelize[_0xbf26('0x2')]},'acceptAt':{'type':Sequelize[_0xbf26('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbf26('0x1')]}}; \ No newline at end of file +var _0xce77=['STRING','sequelize','DATE'];(function(_0x23a317,_0x362154){var _0x2671c9=function(_0x119d94){while(--_0x119d94){_0x23a317['push'](_0x23a317['shift']());}};_0x2671c9(++_0x362154);}(_0xce77,0x7f));var _0x7ce7=function(_0x5cea11,_0x27e75a){_0x5cea11=_0x5cea11-0x0;var _0x5efee7=_0xce77[_0x5cea11];return _0x5efee7;};'use strict';var moment=require('moment');var Sequelize=require(_0x7ce7('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7ce7('0x1')]},'acceptAt':{'type':Sequelize[_0x7ce7('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7ce7('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 63e95e2..be2cf71 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 _0x471a=['describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','reject','save','update','then','stack','name','send','index','FaxQueueReport','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','params'];(function(_0x169e1d,_0xe9bc52){var _0xa22977=function(_0x9b03da){while(--_0x9b03da){_0x169e1d['push'](_0x169e1d['shift']());}};_0xa22977(++_0xe9bc52);}(_0x471a,0x18d));var _0xa471=function(_0x337c63,_0x359439){_0x337c63=_0x337c63-0x0;var _0x1f1af2=_0x471a[_0x337c63];return _0x1f1af2;};'use strict';var pdf=require(_0xa471('0x0'));var emlformat=require(_0xa471('0x1'));var rimraf=require(_0xa471('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa471('0x3'));var rp=require(_0xa471('0x4'));var moment=require(_0xa471('0x5'));var BPromise=require(_0xa471('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa471('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa471('0x8'));var crypto=require(_0xa471('0x9'));var jsforce=require(_0xa471('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa471('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa471('0xc'));var authService=require(_0xa471('0xd'));var qs=require(_0xa471('0xe'));var hardwareService=require(_0xa471('0xf'));var logger=require('../../config/logger')(_0xa471('0x10'));var utils=require(_0xa471('0x11'));var config=require(_0xa471('0x12'));var db=require(_0xa471('0x13'))['db'];function respondWithStatusCode(_0x3640a0,_0x211a0b){_0x211a0b=_0x211a0b||0xcc;return function(_0x5703c9){if(_0x5703c9){return _0x3640a0[_0xa471('0x14')](_0x211a0b);}return _0x3640a0['status'](_0x211a0b)[_0xa471('0x15')]();};}function respondWithResult(_0x514134,_0x3f5db0){_0x3f5db0=_0x3f5db0||0xc8;return function(_0x115541){if(_0x115541){return _0x514134[_0xa471('0x16')](_0x3f5db0)[_0xa471('0x17')](_0x115541);}};}function respondWithFilteredResult(_0x45ef67,_0x25f5f5){return function(_0x531451){if(_0x531451){var _0x31bcb7=_0x531451[_0xa471('0x18')],_0x1ed20c=_0x25f5f5['offset'],_0x16e5bf=_0x25f5f5[_0xa471('0x19')]+_0x25f5f5[_0xa471('0x1a')],_0x4297a7;if(_0x16e5bf>=_0x31bcb7){_0x16e5bf=_0x31bcb7;_0x4297a7=0xc8;}else{_0x4297a7=0xce;}_0x45ef67[_0xa471('0x16')](_0x4297a7);return _0x45ef67['set']('Content-Range',_0x1ed20c+'-'+_0x16e5bf+'/'+_0x31bcb7)[_0xa471('0x17')](_0x531451);}return null;};}function patchUpdates(_0x4bde36){return function(_0x3ef862){try{jsonpatch['apply'](_0x3ef862,_0x4bde36,!![]);}catch(_0x5e56dc){return BPromise[_0xa471('0x1b')](_0x5e56dc);}return _0x3ef862[_0xa471('0x1c')]();};}function saveUpdates(_0x36f980,_0x1952a0){return function(_0x45ff30){if(_0x45ff30){return _0x45ff30[_0xa471('0x1d')](_0x36f980)[_0xa471('0x1e')](function(_0x554610){return _0x554610;});}return null;};}function removeEntity(_0x3376c6,_0x275144){return function(_0x398f23){if(_0x398f23){return _0x398f23['destroy']()[_0xa471('0x1e')](function(){_0x3376c6['status'](0xcc)[_0xa471('0x15')]();});}};}function handleEntityNotFound(_0x2b7755,_0x56a34e){return function(_0x21b9e5){if(!_0x21b9e5){_0x2b7755[_0xa471('0x14')](0x194);}return _0x21b9e5;};}function handleError(_0x4debbe,_0x109135){_0x109135=_0x109135||0x1f4;return function(_0x54f8d1){logger['error'](_0x54f8d1[_0xa471('0x1f')]);if(_0x54f8d1[_0xa471('0x20')]){delete _0x54f8d1['name'];}_0x4debbe['status'](_0x109135)[_0xa471('0x21')](_0x54f8d1);};}exports[_0xa471('0x22')]=function(_0x5009cf,_0x3fd3bc){var _0x1c6d6e={},_0x114799={},_0x7404f4={'count':0x0,'rows':[]};var _0x5c95b0=db[_0xa471('0x23')][_0xa471('0x24')];_0x114799['model']=_[_0xa471('0x25')](_0x5c95b0);_0x114799[_0xa471('0x26')]=_[_0xa471('0x25')](_0x5009cf[_0xa471('0x26')]);_0x114799['filters']=_[_0xa471('0x27')](_0x114799[_0xa471('0x28')],_0x114799['query']);_0x1c6d6e['attributes']=_[_0xa471('0x27')](_0x114799[_0xa471('0x28')],qs[_0xa471('0x29')](_0x5009cf[_0xa471('0x26')][_0xa471('0x29')]));_0x1c6d6e['attributes']=_0x1c6d6e[_0xa471('0x2a')][_0xa471('0x2b')]?_0x1c6d6e[_0xa471('0x2a')]:_0x114799[_0xa471('0x28')];if(!_0x5009cf[_0xa471('0x26')][_0xa471('0x2c')](_0xa471('0x2d'))){_0x1c6d6e[_0xa471('0x1a')]=qs[_0xa471('0x1a')](_0x5009cf['query'][_0xa471('0x1a')]);_0x1c6d6e[_0xa471('0x19')]=qs[_0xa471('0x19')](_0x5009cf[_0xa471('0x26')][_0xa471('0x19')]);}_0x1c6d6e['order']=qs[_0xa471('0x2e')](_0x5009cf[_0xa471('0x26')][_0xa471('0x2e')]);_0x1c6d6e[_0xa471('0x2f')]=qs[_0xa471('0x30')](_[_0xa471('0x31')](_0x5009cf['query'],_0x114799[_0xa471('0x30')]));if(_0x5009cf[_0xa471('0x26')][_0xa471('0x32')]){_0x1c6d6e[_0xa471('0x2f')]=_[_0xa471('0x33')](_0x1c6d6e[_0xa471('0x2f')],{'$or':_['map'](_0x5c95b0,function(_0x16e515){if(_0x16e515['type']['key']!==_0xa471('0x34')){var _0x7d7b16={};_0x7d7b16[_0x16e515[_0xa471('0x35')]]={'$like':'%'+_0x5009cf[_0xa471('0x26')][_0xa471('0x32')]+'%'};return _0x7d7b16;}})});}_0x1c6d6e=_['merge']({},_0x1c6d6e,_0x5009cf[_0xa471('0x36')]);var _0x34ce8d={'where':_0x1c6d6e[_0xa471('0x2f')]};return db[_0xa471('0x23')][_0xa471('0x18')](_0x34ce8d)[_0xa471('0x1e')](function(_0x32466d){_0x7404f4['count']=_0x32466d;if(_0x5009cf[_0xa471('0x26')][_0xa471('0x37')]){_0x1c6d6e['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0xa471('0x38')](_0x1c6d6e);})[_0xa471('0x1e')](function(_0x2d98f0){_0x7404f4[_0xa471('0x39')]=_0x2d98f0;return _0x7404f4;})[_0xa471('0x1e')](respondWithFilteredResult(_0x3fd3bc,_0x1c6d6e))[_0xa471('0x3a')](handleError(_0x3fd3bc,null));};exports[_0xa471('0x3b')]=function(_0xcc3f85,_0x1fb06b){var _0x5230a7={'raw':!![],'where':{'id':_0xcc3f85['params']['id']}},_0x1eb7c8={};_0x1eb7c8[_0xa471('0x28')]=_[_0xa471('0x25')](db[_0xa471('0x23')][_0xa471('0x24')]);_0x1eb7c8[_0xa471('0x26')]=_[_0xa471('0x25')](_0xcc3f85[_0xa471('0x26')]);_0x1eb7c8['filters']=_[_0xa471('0x27')](_0x1eb7c8[_0xa471('0x28')],_0x1eb7c8['query']);_0x5230a7[_0xa471('0x2a')]=_[_0xa471('0x27')](_0x1eb7c8['model'],qs['fields'](_0xcc3f85[_0xa471('0x26')][_0xa471('0x29')]));_0x5230a7[_0xa471('0x2a')]=_0x5230a7[_0xa471('0x2a')][_0xa471('0x2b')]?_0x5230a7[_0xa471('0x2a')]:_0x1eb7c8[_0xa471('0x28')];if(_0xcc3f85[_0xa471('0x26')][_0xa471('0x37')]){_0x5230a7[_0xa471('0x3c')]=[{'all':!![]}];}_0x5230a7=_[_0xa471('0x33')]({},_0x5230a7,_0xcc3f85[_0xa471('0x36')]);return db['FaxQueueReport'][_0xa471('0x3d')](_0x5230a7)[_0xa471('0x1e')](handleEntityNotFound(_0x1fb06b,null))[_0xa471('0x1e')](respondWithResult(_0x1fb06b,null))[_0xa471('0x3a')](handleError(_0x1fb06b,null));};exports[_0xa471('0x3e')]=function(_0x4cfdd5,_0x321724){return db['FaxQueueReport'][_0xa471('0x3e')](_0x4cfdd5['body'],{})[_0xa471('0x1e')](respondWithResult(_0x321724,0xc9))[_0xa471('0x3a')](handleError(_0x321724,null));};exports[_0xa471('0x1d')]=function(_0xbfd724,_0x2024d0){if(_0xbfd724['body']['id']){delete _0xbfd724[_0xa471('0x3f')]['id'];}return db['FaxQueueReport'][_0xa471('0x3d')]({'where':{'id':_0xbfd724[_0xa471('0x40')]['id']}})[_0xa471('0x1e')](handleEntityNotFound(_0x2024d0,null))[_0xa471('0x1e')](saveUpdates(_0xbfd724[_0xa471('0x3f')],null))['then'](respondWithResult(_0x2024d0,null))[_0xa471('0x3a')](handleError(_0x2024d0,null));};exports['destroy']=function(_0x5c0efe,_0x2cf4a9){return db['FaxQueueReport']['find']({'where':{'id':_0x5c0efe[_0xa471('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cf4a9,null))[_0xa471('0x1e')](removeEntity(_0x2cf4a9,null))[_0xa471('0x3a')](handleError(_0x2cf4a9,null));};exports['describe']=function(_0x44a15c,_0x41c029){return db[_0xa471('0x23')][_0xa471('0x41')]()[_0xa471('0x1e')](respondWithResult(_0x41c029,null))[_0xa471('0x3a')](handleError(_0x41c029,null));}; \ No newline at end of file +var _0x5f6f=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','field','options','includeAll','include','rows','catch','show','params','FaxQueueReport','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','send','index','rawAttributes','model','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x5c6310,_0x57afac){_0x5c6310=_0x5c6310-0x0;var _0x3e6db4=_0x5f6f[_0x5c6310];return _0x3e6db4;};'use strict';var pdf=require(_0xf5f6('0x0'));var emlformat=require(_0xf5f6('0x1'));var rimraf=require(_0xf5f6('0x2'));var zipdir=require(_0xf5f6('0x3'));var jsonpatch=require(_0xf5f6('0x4'));var rp=require('request-promise');var moment=require(_0xf5f6('0x5'));var BPromise=require(_0xf5f6('0x6'));var Mustache=require(_0xf5f6('0x7'));var util=require('util');var path=require(_0xf5f6('0x8'));var sox=require(_0xf5f6('0x9'));var csv=require(_0xf5f6('0xa'));var ejs=require(_0xf5f6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf5f6('0xc'));var jsforce=require(_0xf5f6('0xd'));var deskjs=require(_0xf5f6('0xe'));var toCsv=require(_0xf5f6('0xa'));var querystring=require(_0xf5f6('0xf'));var Papa=require(_0xf5f6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f6('0x11'));var hardwareService=require(_0xf5f6('0x12'));var logger=require('../../config/logger')(_0xf5f6('0x13'));var utils=require(_0xf5f6('0x14'));var config=require(_0xf5f6('0x15'));var db=require(_0xf5f6('0x16'))['db'];function respondWithStatusCode(_0x1e5654,_0x5e83d5){_0x5e83d5=_0x5e83d5||0xcc;return function(_0x3b407d){if(_0x3b407d){return _0x1e5654['sendStatus'](_0x5e83d5);}return _0x1e5654[_0xf5f6('0x17')](_0x5e83d5)[_0xf5f6('0x18')]();};}function respondWithResult(_0x1441ae,_0x3e056c){_0x3e056c=_0x3e056c||0xc8;return function(_0x52648d){if(_0x52648d){return _0x1441ae[_0xf5f6('0x17')](_0x3e056c)[_0xf5f6('0x19')](_0x52648d);}};}function respondWithFilteredResult(_0x1db51c,_0xa8a59e){return function(_0x504cd9){if(_0x504cd9){var _0x1e3037=_0x504cd9['count'],_0x3f9f49=_0xa8a59e['offset'],_0x21ccf7=_0xa8a59e[_0xf5f6('0x1a')]+_0xa8a59e['limit'],_0x4a9633;if(_0x21ccf7>=_0x1e3037){_0x21ccf7=_0x1e3037;_0x4a9633=0xc8;}else{_0x4a9633=0xce;}_0x1db51c[_0xf5f6('0x17')](_0x4a9633);return _0x1db51c['set'](_0xf5f6('0x1b'),_0x3f9f49+'-'+_0x21ccf7+'/'+_0x1e3037)[_0xf5f6('0x19')](_0x504cd9);}return null;};}function patchUpdates(_0x13fe89){return function(_0x301e2a){try{jsonpatch[_0xf5f6('0x1c')](_0x301e2a,_0x13fe89,!![]);}catch(_0x3199f0){return BPromise['reject'](_0x3199f0);}return _0x301e2a[_0xf5f6('0x1d')]();};}function saveUpdates(_0x3ada74,_0x332761){return function(_0x261015){if(_0x261015){return _0x261015[_0xf5f6('0x1e')](_0x3ada74)['then'](function(_0x1049e8){return _0x1049e8;});}return null;};}function removeEntity(_0x444856,_0x22e569){return function(_0x579375){if(_0x579375){return _0x579375[_0xf5f6('0x1f')]()[_0xf5f6('0x20')](function(){_0x444856[_0xf5f6('0x17')](0xcc)[_0xf5f6('0x18')]();});}};}function handleEntityNotFound(_0x49906c,_0x4adf54){return function(_0x1503e0){if(!_0x1503e0){_0x49906c[_0xf5f6('0x21')](0x194);}return _0x1503e0;};}function handleError(_0xb4f1ec,_0x535d4b){_0x535d4b=_0x535d4b||0x1f4;return function(_0x31d0fb){logger[_0xf5f6('0x22')](_0x31d0fb[_0xf5f6('0x23')]);if(_0x31d0fb['name']){delete _0x31d0fb['name'];}_0xb4f1ec[_0xf5f6('0x17')](_0x535d4b)[_0xf5f6('0x24')](_0x31d0fb);};}exports[_0xf5f6('0x25')]=function(_0x265457,_0x55d9ec){var _0xb2fab7={},_0x345242={},_0x52dfe3={'count':0x0,'rows':[]};var _0x1c171f=db['FaxQueueReport'][_0xf5f6('0x26')];_0x345242[_0xf5f6('0x27')]=_['keys'](_0x1c171f);_0x345242[_0xf5f6('0x28')]=_[_0xf5f6('0x29')](_0x265457[_0xf5f6('0x28')]);_0x345242[_0xf5f6('0x2a')]=_['intersection'](_0x345242[_0xf5f6('0x27')],_0x345242['query']);_0xb2fab7[_0xf5f6('0x2b')]=_[_0xf5f6('0x2c')](_0x345242[_0xf5f6('0x27')],qs[_0xf5f6('0x2d')](_0x265457['query'][_0xf5f6('0x2d')]));_0xb2fab7['attributes']=_0xb2fab7[_0xf5f6('0x2b')][_0xf5f6('0x2e')]?_0xb2fab7['attributes']:_0x345242[_0xf5f6('0x27')];if(!_0x265457[_0xf5f6('0x28')][_0xf5f6('0x2f')](_0xf5f6('0x30'))){_0xb2fab7[_0xf5f6('0x31')]=qs[_0xf5f6('0x31')](_0x265457[_0xf5f6('0x28')]['limit']);_0xb2fab7[_0xf5f6('0x1a')]=qs['offset'](_0x265457[_0xf5f6('0x28')][_0xf5f6('0x1a')]);}_0xb2fab7['order']=qs['sort'](_0x265457[_0xf5f6('0x28')][_0xf5f6('0x32')]);_0xb2fab7[_0xf5f6('0x33')]=qs[_0xf5f6('0x2a')](_[_0xf5f6('0x34')](_0x265457[_0xf5f6('0x28')],_0x345242[_0xf5f6('0x2a')]));if(_0x265457[_0xf5f6('0x28')]['filter']){_0xb2fab7[_0xf5f6('0x33')]=_[_0xf5f6('0x35')](_0xb2fab7[_0xf5f6('0x33')],{'$or':_['map'](_0x1c171f,function(_0x4fde0c){if(_0x4fde0c[_0xf5f6('0x36')]['key']!=='VIRTUAL'){var _0x296e10={};_0x296e10[_0x4fde0c[_0xf5f6('0x37')]]={'$like':'%'+_0x265457[_0xf5f6('0x28')]['filter']+'%'};return _0x296e10;}})});}_0xb2fab7=_[_0xf5f6('0x35')]({},_0xb2fab7,_0x265457[_0xf5f6('0x38')]);var _0x4ece62={'where':_0xb2fab7[_0xf5f6('0x33')]};return db['FaxQueueReport']['count'](_0x4ece62)[_0xf5f6('0x20')](function(_0x4e95ba){_0x52dfe3['count']=_0x4e95ba;if(_0x265457[_0xf5f6('0x28')][_0xf5f6('0x39')]){_0xb2fab7[_0xf5f6('0x3a')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xb2fab7);})[_0xf5f6('0x20')](function(_0x34ddd9){_0x52dfe3[_0xf5f6('0x3b')]=_0x34ddd9;return _0x52dfe3;})['then'](respondWithFilteredResult(_0x55d9ec,_0xb2fab7))[_0xf5f6('0x3c')](handleError(_0x55d9ec,null));};exports[_0xf5f6('0x3d')]=function(_0x1e138c,_0x4078de){var _0x1973e4={'raw':!![],'where':{'id':_0x1e138c[_0xf5f6('0x3e')]['id']}},_0x3798bd={};_0x3798bd[_0xf5f6('0x27')]=_[_0xf5f6('0x29')](db['FaxQueueReport'][_0xf5f6('0x26')]);_0x3798bd[_0xf5f6('0x28')]=_[_0xf5f6('0x29')](_0x1e138c[_0xf5f6('0x28')]);_0x3798bd[_0xf5f6('0x2a')]=_[_0xf5f6('0x2c')](_0x3798bd[_0xf5f6('0x27')],_0x3798bd[_0xf5f6('0x28')]);_0x1973e4[_0xf5f6('0x2b')]=_[_0xf5f6('0x2c')](_0x3798bd[_0xf5f6('0x27')],qs['fields'](_0x1e138c[_0xf5f6('0x28')][_0xf5f6('0x2d')]));_0x1973e4[_0xf5f6('0x2b')]=_0x1973e4['attributes'][_0xf5f6('0x2e')]?_0x1973e4[_0xf5f6('0x2b')]:_0x3798bd['model'];if(_0x1e138c[_0xf5f6('0x28')]['includeAll']){_0x1973e4['include']=[{'all':!![]}];}_0x1973e4=_[_0xf5f6('0x35')]({},_0x1973e4,_0x1e138c[_0xf5f6('0x38')]);return db[_0xf5f6('0x3f')]['find'](_0x1973e4)[_0xf5f6('0x20')](handleEntityNotFound(_0x4078de,null))[_0xf5f6('0x20')](respondWithResult(_0x4078de,null))[_0xf5f6('0x3c')](handleError(_0x4078de,null));};exports['create']=function(_0x21defb,_0x59fac2){return db[_0xf5f6('0x3f')]['create'](_0x21defb[_0xf5f6('0x40')],{})[_0xf5f6('0x20')](respondWithResult(_0x59fac2,0xc9))[_0xf5f6('0x3c')](handleError(_0x59fac2,null));};exports[_0xf5f6('0x1e')]=function(_0x1696c3,_0x557403){if(_0x1696c3['body']['id']){delete _0x1696c3[_0xf5f6('0x40')]['id'];}return db['FaxQueueReport'][_0xf5f6('0x41')]({'where':{'id':_0x1696c3[_0xf5f6('0x3e')]['id']}})[_0xf5f6('0x20')](handleEntityNotFound(_0x557403,null))['then'](saveUpdates(_0x1696c3[_0xf5f6('0x40')],null))[_0xf5f6('0x20')](respondWithResult(_0x557403,null))[_0xf5f6('0x3c')](handleError(_0x557403,null));};exports[_0xf5f6('0x1f')]=function(_0x44c264,_0x1fe5a5){return db['FaxQueueReport'][_0xf5f6('0x41')]({'where':{'id':_0x44c264[_0xf5f6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1fe5a5,null))[_0xf5f6('0x20')](removeEntity(_0x1fe5a5,null))[_0xf5f6('0x3c')](handleError(_0x1fe5a5,null));};exports[_0xf5f6('0x42')]=function(_0x142b3c,_0x2e89c2){return db[_0xf5f6('0x3f')][_0xf5f6('0x42')]()[_0xf5f6('0x20')](respondWithResult(_0x2e89c2,null))['catch'](handleError(_0x2e89c2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b676bd7..33eb9c0 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 _0x79f2=['request-promise','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x220ef1,_0x504719){var _0x3bb019=function(_0x53c4cc){while(--_0x53c4cc){_0x220ef1['push'](_0x220ef1['shift']());}};_0x3bb019(++_0x504719);}(_0x79f2,0x158));var _0x279f=function(_0x3f9252,_0x578065){_0x3f9252=_0x3f9252-0x0;var _0x293415=_0x79f2[_0x3f9252];return _0x293415;};'use strict';var _=require('lodash');var util=require(_0x279f('0x0'));var logger=require(_0x279f('0x1'))(_0x279f('0x2'));var moment=require(_0x279f('0x3'));var BPromise=require('bluebird');var rp=require(_0x279f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x279f('0x5'));var config=require(_0x279f('0x6'));var attributes=require(_0x279f('0x7'));module[_0x279f('0x8')]=function(_0xc0fc77,_0x12344a){return _0xc0fc77['define'](_0x279f('0x9'),attributes,{'tableName':_0x279f('0xa'),'paranoid':![],'indexes':[{'name':_0x279f('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9dc8=['request-promise','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','api','bluebird'];(function(_0x1e9ace,_0x5e4dd6){var _0xf41396=function(_0x58512f){while(--_0x58512f){_0x1e9ace['push'](_0x1e9ace['shift']());}};_0xf41396(++_0x5e4dd6);}(_0x9dc8,0x169));var _0x89dc=function(_0x20dcd7,_0x2c5336){_0x20dcd7=_0x20dcd7-0x0;var _0x403676=_0x9dc8[_0x20dcd7];return _0x403676;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x89dc('0x0'));var moment=require('moment');var BPromise=require(_0x89dc('0x1'));var rp=require(_0x89dc('0x2'));var fs=require('fs');var path=require(_0x89dc('0x3'));var rimraf=require(_0x89dc('0x4'));var config=require('../../config/environment');var attributes=require(_0x89dc('0x5'));module[_0x89dc('0x6')]=function(_0x56e532,_0x50663a){return _0x56e532[_0x89dc('0x7')](_0x89dc('0x8'),attributes,{'tableName':_0x89dc('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x89dc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e6d0315..409e797 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 _0x34bd=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','body','options','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x855db5,_0x536b00){var _0x50c1da=function(_0x52a3ba){while(--_0x52a3ba){_0x855db5['push'](_0x855db5['shift']());}};_0x50c1da(++_0x536b00);}(_0x34bd,0x1d2));var _0xd34b=function(_0x5b25af,_0x121dd7){_0x5b25af=_0x5b25af-0x0;var _0x181a07=_0x34bd[_0x5b25af];return _0x181a07;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd34b('0x1'));var rs=require(_0xd34b('0x2'));var fs=require('fs');var Redis=require(_0xd34b('0x3'));var db=require(_0xd34b('0x4'))['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))(_0xd34b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd34b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3eb,_0x30d93b,_0x3654a5){return new BPromise(function(_0xf51a08,_0x25bce7){return client[_0xd34b('0x9')](_0x56e3eb,_0x3654a5)[_0xd34b('0xa')](function(_0x738328){logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,_0xd34b('0xd'));logger[_0xd34b('0xe')](_0xd34b('0xf'),_0x30d93b,'request\x20sent',JSON[_0xd34b('0x10')](_0x738328));if(_0x738328['error']){if(_0x738328[_0xd34b('0x11')][_0xd34b('0x12')]===0x1f4){logger[_0xd34b('0x11')](_0xd34b('0xc'),_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0x25bce7(_0x738328['error'][_0xd34b('0x13')]);}logger[_0xd34b('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0xf51a08(_0x738328[_0xd34b('0x11')]['message']);}else{logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,'request\x20sent');_0xf51a08(_0x738328[_0xd34b('0x14')]['message']);}})[_0xd34b('0x15')](function(_0x438b61){logger[_0xd34b('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x30d93b,_0x438b61);_0x25bce7(_0x438b61);});});}exports[_0xd34b('0x16')]=function(_0x193965){var _0x1bbbb1=this;return new Promise(function(_0x105f67,_0x206f16){return db['FaxQueueReport']['create'](_0x193965[_0xd34b('0x17')],{'raw':_0x193965[_0xd34b('0x18')]?_0x193965[_0xd34b('0x18')][_0xd34b('0x19')]===undefined?!![]:![]:!![]})[_0xd34b('0xa')](function(_0x3152a9){logger['info'](_0xd34b('0x16'),_0x193965);logger[_0xd34b('0xe')](_0xd34b('0x16'),_0x193965,JSON[_0xd34b('0x10')](_0x3152a9));_0x105f67(_0x3152a9);})['catch'](function(_0x45c569){logger[_0xd34b('0x11')](_0xd34b('0x16'),_0x45c569[_0xd34b('0x13')],_0x193965);_0x206f16(_0x1bbbb1[_0xd34b('0x11')](0x1f4,_0x45c569[_0xd34b('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x50da22){var _0x49c485=this;return new Promise(function(_0x2187c0,_0x2ae0e1){return db['FaxQueueReport']['update'](_0x50da22['body'],{'raw':_0x50da22[_0xd34b('0x18')]?_0x50da22[_0xd34b('0x18')][_0xd34b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50da22['options']?_0x50da22[_0xd34b('0x18')][_0xd34b('0x1a')]||null:null,'attributes':_0x50da22['options']?_0x50da22[_0xd34b('0x18')][_0xd34b('0x1b')]||null:null,'limit':_0x50da22[_0xd34b('0x18')]?_0x50da22['options'][_0xd34b('0x1c')]||null:null})['then'](function(_0x182266){logger[_0xd34b('0xb')](_0xd34b('0x1d'),_0x50da22);logger['debug'](_0xd34b('0x1d'),_0x50da22,JSON['stringify'](_0x182266));_0x2187c0(_0x182266);})[_0xd34b('0x15')](function(_0x47c0b3){logger[_0xd34b('0x11')]('UpdateFaxQueueReport',_0x47c0b3[_0xd34b('0x13')],_0x50da22);_0x2ae0e1(_0x49c485[_0xd34b('0x11')](0x1f4,_0x47c0b3['message']));});});}; \ No newline at end of file +var _0x8caf=['FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then','UpdateFaxQueueReport','update','body','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1964b4,_0x5796f4){var _0x509a77=function(_0x247257){while(--_0x247257){_0x1964b4['push'](_0x1964b4['shift']());}};_0x509a77(++_0x5796f4);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x52ab89,_0x58a774){_0x52ab89=_0x52ab89-0x0;var _0x5e689d=_0x8caf[_0x52ab89];return _0x5e689d;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x562eea,_0x773b9f,_0x3abd58){return new BPromise(function(_0x3a91d3,_0x31300c){return client['request'](_0x562eea,_0x3abd58)['then'](function(_0x3a9674){logger['info'](_0xf8ca('0xc'),_0x773b9f,_0xf8ca('0xd'));logger[_0xf8ca('0xe')](_0xf8ca('0xf'),_0x773b9f,'request\x20sent',JSON[_0xf8ca('0x10')](_0x3a9674));if(_0x3a9674[_0xf8ca('0x11')]){if(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x12')]===0x1f4){logger['error'](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')]['message']);return _0x31300c(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);return _0x3a91d3(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}else{logger[_0xf8ca('0x14')](_0xf8ca('0xc'),_0x773b9f,'request\x20sent');_0x3a91d3(_0x3a9674[_0xf8ca('0x15')][_0xf8ca('0x13')]);}})[_0xf8ca('0x16')](function(_0x12e8f0){logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x12e8f0);_0x31300c(_0x12e8f0);});});}exports[_0xf8ca('0x17')]=function(_0x127119){var _0x50e805=this;return new Promise(function(_0x237f44,_0x3b5400){return db[_0xf8ca('0x18')][_0xf8ca('0x19')](_0x127119['body'],{'raw':_0x127119[_0xf8ca('0x1a')]?_0x127119[_0xf8ca('0x1a')][_0xf8ca('0x1b')]===undefined?!![]:![]:!![]})[_0xf8ca('0x1c')](function(_0x18e8da){logger[_0xf8ca('0x14')]('CreateFaxQueueReport',_0x127119);logger[_0xf8ca('0xe')]('CreateFaxQueueReport',_0x127119,JSON[_0xf8ca('0x10')](_0x18e8da));_0x237f44(_0x18e8da);})[_0xf8ca('0x16')](function(_0x179a48){logger[_0xf8ca('0x11')](_0xf8ca('0x17'),_0x179a48[_0xf8ca('0x13')],_0x127119);_0x3b5400(_0x50e805['error'](0x1f4,_0x179a48['message']));});});};exports[_0xf8ca('0x1d')]=function(_0x1d746a){var _0x4962a5=this;return new Promise(function(_0x55b944,_0x4357a2){return db[_0xf8ca('0x18')][_0xf8ca('0x1e')](_0x1d746a[_0xf8ca('0x1f')],{'raw':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')][_0xf8ca('0x20')]||null:null,'attributes':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a[_0xf8ca('0x1a')][_0xf8ca('0x21')]||null:null,'limit':_0x1d746a[_0xf8ca('0x1a')]?_0x1d746a['options']['limit']||null:null})[_0xf8ca('0x1c')](function(_0x873e43){logger[_0xf8ca('0x14')]('UpdateFaxQueueReport',_0x1d746a);logger[_0xf8ca('0xe')]('UpdateFaxQueueReport',_0x1d746a,JSON['stringify'](_0x873e43));_0x55b944(_0x873e43);})[_0xf8ca('0x16')](function(_0x22b4a9){logger[_0xf8ca('0x11')]('UpdateFaxQueueReport',_0x22b4a9[_0xf8ca('0x13')],_0x1d746a);_0x4357a2(_0x4962a5[_0xf8ca('0x11')](0x1f4,_0x22b4a9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a070aae..b3719f8 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 _0xf543=['../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','delete','destroy','exports','util','express'];(function(_0x95d5,_0x286dfd){var _0x2bc20a=function(_0xf64ef3){while(--_0xf64ef3){_0x95d5['push'](_0x95d5['shift']());}};_0x2bc20a(++_0x286dfd);}(_0xf543,0xee));var _0x3f54=function(_0x3aa3e4,_0x5f0a89){_0x3aa3e4=_0x3aa3e4-0x0;var _0x3dba0c=_0xf543[_0x3aa3e4];return _0x3dba0c;};'use strict';var multer=require('multer');var util=require(_0x3f54('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f54('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f54('0x2'));var controller=require(_0x3f54('0x3'));router[_0x3f54('0x4')]('/',auth[_0x3f54('0x5')](),controller[_0x3f54('0x6')]);router[_0x3f54('0x4')]('/describe',auth[_0x3f54('0x5')](),controller[_0x3f54('0x7')]);router[_0x3f54('0x4')]('/:id',auth[_0x3f54('0x5')](),controller[_0x3f54('0x8')]);router[_0x3f54('0x9')]('/',auth[_0x3f54('0x5')](),controller[_0x3f54('0xa')]);router[_0x3f54('0xb')](_0x3f54('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3f54('0xd')](_0x3f54('0xc'),auth[_0x3f54('0x5')](),controller[_0x3f54('0xe')]);module[_0x3f54('0xf')]=router; \ No newline at end of file +var _0x6bd0=['../../components/interaction/service','./faxQueueReport.controller','get','index','isAuthenticated','show','create','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bd0,0xd9));var _0x06bd=function(_0x32dda5,_0x35a22b){_0x32dda5=_0x32dda5-0x0;var _0x53e9ec=_0x6bd0[_0x32dda5];return _0x53e9ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06bd('0x0'));var timeout=require(_0x06bd('0x1'));var express=require(_0x06bd('0x2'));var router=express['Router']();var auth=require(_0x06bd('0x3'));var interaction=require(_0x06bd('0x4'));var config=require('../../config/environment');var controller=require(_0x06bd('0x5'));router[_0x06bd('0x6')]('/',auth['isAuthenticated'](),controller[_0x06bd('0x7')]);router[_0x06bd('0x6')]('/describe',auth[_0x06bd('0x8')](),controller['describe']);router[_0x06bd('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x06bd('0x9')]);router['post']('/',auth[_0x06bd('0x8')](),controller[_0x06bd('0xa')]);router[_0x06bd('0xb')]('/:id',auth[_0x06bd('0x8')](),controller[_0x06bd('0xc')]);router[_0x06bd('0xd')](_0x06bd('0xe'),auth['isAuthenticated'](),controller[_0x06bd('0xf')]);module[_0x06bd('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c112f95..15367a7 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 _0xe2e1=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x36dd16,_0x61e190){var _0x31b57b=function(_0x1a8a10){while(--_0x1a8a10){_0x36dd16['push'](_0x36dd16['shift']());}};_0x31b57b(++_0x61e190);}(_0xe2e1,0x9b));var _0x1e2e=function(_0x534c5c,_0x2b4684){_0x534c5c=_0x534c5c-0x0;var _0x267caf=_0xe2e1[_0x534c5c];return _0x267caf;};'use strict';var moment=require(_0x1e2e('0x0'));var Sequelize=require(_0x1e2e('0x1'));module[_0x1e2e('0x2')]={'uniqueid':{'type':Sequelize[_0x1e2e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1e2e('0x4')](_0x1e2e('0x5'),_0x1e2e('0x6'),'queue'),'allowNull':![],'defaultValue':_0x1e2e('0x7')},'transferredAt':{'type':Sequelize[_0x1e2e('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x1e2e('0x9')]}}; \ No newline at end of file +var _0xc09b=['agent','queue','NOW','moment','exports','STRING','ENUM','account'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xc09b,0xcb));var _0xbc09=function(_0x794854,_0x5d8c8b){_0x794854=_0x794854-0x0;var _0x281c93=_0xc09b[_0x794854];return _0x281c93;};'use strict';var moment=require(_0xbc09('0x0'));var Sequelize=require('sequelize');module[_0xbc09('0x1')]={'uniqueid':{'type':Sequelize[_0xbc09('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbc09('0x3')](_0xbc09('0x4'),_0xbc09('0x5'),_0xbc09('0x6')),'allowNull':![],'defaultValue':_0xbc09('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xbc09('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 73169be..e4040b8 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 _0xe600=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','query','keys','intersection','attributes','fields','length','model','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','field','options','FaxTransferReport','includeAll','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xe600,0x159));var _0x0e60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe600[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e60('0x1'));var jsonpatch=require(_0x0e60('0x2'));var rp=require(_0x0e60('0x3'));var moment=require(_0x0e60('0x4'));var BPromise=require(_0x0e60('0x5'));var Mustache=require(_0x0e60('0x6'));var util=require(_0x0e60('0x7'));var path=require(_0x0e60('0x8'));var sox=require(_0x0e60('0x9'));var csv=require(_0x0e60('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0xa'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e60('0x14'))(_0x0e60('0x15'));var utils=require(_0x0e60('0x16'));var config=require(_0x0e60('0x17'));var db=require(_0x0e60('0x18'))['db'];function respondWithStatusCode(_0x2a4cf0,_0x1f2f3e){_0x1f2f3e=_0x1f2f3e||0xcc;return function(_0x2f5ee4){if(_0x2f5ee4){return _0x2a4cf0['sendStatus'](_0x1f2f3e);}return _0x2a4cf0[_0x0e60('0x19')](_0x1f2f3e)[_0x0e60('0x1a')]();};}function respondWithResult(_0x24c20f,_0x1202fc){_0x1202fc=_0x1202fc||0xc8;return function(_0x45328b){if(_0x45328b){return _0x24c20f[_0x0e60('0x19')](_0x1202fc)['json'](_0x45328b);}};}function respondWithFilteredResult(_0x4192dd,_0x508fd0){return function(_0x91cd1){if(_0x91cd1){var _0x128887=_0x91cd1[_0x0e60('0x1b')],_0x170890=_0x508fd0[_0x0e60('0x1c')],_0x5ab4ba=_0x508fd0[_0x0e60('0x1c')]+_0x508fd0[_0x0e60('0x1d')],_0x2a8b5a;if(_0x5ab4ba>=_0x128887){_0x5ab4ba=_0x128887;_0x2a8b5a=0xc8;}else{_0x2a8b5a=0xce;}_0x4192dd['status'](_0x2a8b5a);return _0x4192dd[_0x0e60('0x1e')](_0x0e60('0x1f'),_0x170890+'-'+_0x5ab4ba+'/'+_0x128887)['json'](_0x91cd1);}return null;};}function patchUpdates(_0x17ab47){return function(_0x43c09d){try{jsonpatch[_0x0e60('0x20')](_0x43c09d,_0x17ab47,!![]);}catch(_0x504b31){return BPromise[_0x0e60('0x21')](_0x504b31);}return _0x43c09d['save']();};}function saveUpdates(_0x13b04c,_0x30c6a5){return function(_0xb9f037){if(_0xb9f037){return _0xb9f037[_0x0e60('0x22')](_0x13b04c)[_0x0e60('0x23')](function(_0x31a63e){return _0x31a63e;});}return null;};}function removeEntity(_0x38f677,_0x2ed72f){return function(_0x352633){if(_0x352633){return _0x352633[_0x0e60('0x24')]()[_0x0e60('0x23')](function(){_0x38f677[_0x0e60('0x19')](0xcc)[_0x0e60('0x1a')]();});}};}function handleEntityNotFound(_0x16985f,_0x4702f){return function(_0x33f9f3){if(!_0x33f9f3){_0x16985f[_0x0e60('0x25')](0x194);}return _0x33f9f3;};}function handleError(_0x2e388a,_0x21206a){_0x21206a=_0x21206a||0x1f4;return function(_0x4ba1a8){logger[_0x0e60('0x26')](_0x4ba1a8[_0x0e60('0x27')]);if(_0x4ba1a8['name']){delete _0x4ba1a8[_0x0e60('0x28')];}_0x2e388a['status'](_0x21206a)[_0x0e60('0x29')](_0x4ba1a8);};}exports['index']=function(_0x48d950,_0xd82283){var _0x39dae2={},_0x526aaa={},_0x4eb9b8={'count':0x0,'rows':[]};var _0x3ca649=db['FaxTransferReport'][_0x0e60('0x2a')];_0x526aaa['model']=_['keys'](_0x3ca649);_0x526aaa[_0x0e60('0x2b')]=_[_0x0e60('0x2c')](_0x48d950[_0x0e60('0x2b')]);_0x526aaa['filters']=_[_0x0e60('0x2d')](_0x526aaa['model'],_0x526aaa[_0x0e60('0x2b')]);_0x39dae2[_0x0e60('0x2e')]=_[_0x0e60('0x2d')](_0x526aaa['model'],qs[_0x0e60('0x2f')](_0x48d950[_0x0e60('0x2b')][_0x0e60('0x2f')]));_0x39dae2['attributes']=_0x39dae2[_0x0e60('0x2e')][_0x0e60('0x30')]?_0x39dae2[_0x0e60('0x2e')]:_0x526aaa[_0x0e60('0x31')];if(!_0x48d950[_0x0e60('0x2b')]['hasOwnProperty'](_0x0e60('0x32'))){_0x39dae2['limit']=qs[_0x0e60('0x1d')](_0x48d950['query'][_0x0e60('0x1d')]);_0x39dae2[_0x0e60('0x1c')]=qs[_0x0e60('0x1c')](_0x48d950['query'][_0x0e60('0x1c')]);}_0x39dae2[_0x0e60('0x33')]=qs[_0x0e60('0x34')](_0x48d950[_0x0e60('0x2b')][_0x0e60('0x34')]);_0x39dae2[_0x0e60('0x35')]=qs[_0x0e60('0x36')](_[_0x0e60('0x37')](_0x48d950[_0x0e60('0x2b')],_0x526aaa[_0x0e60('0x36')]));if(_0x48d950[_0x0e60('0x2b')][_0x0e60('0x38')]){_0x39dae2['where']=_[_0x0e60('0x39')](_0x39dae2[_0x0e60('0x35')],{'$or':_[_0x0e60('0x3a')](_0x3ca649,function(_0x34348d){if(_0x34348d['type']['key']!==_0x0e60('0x3b')){var _0x55ea74={};_0x55ea74[_0x34348d[_0x0e60('0x3c')]]={'$like':'%'+_0x48d950['query'][_0x0e60('0x38')]+'%'};return _0x55ea74;}})});}_0x39dae2=_[_0x0e60('0x39')]({},_0x39dae2,_0x48d950[_0x0e60('0x3d')]);var _0xa9514d={'where':_0x39dae2[_0x0e60('0x35')]};return db[_0x0e60('0x3e')][_0x0e60('0x1b')](_0xa9514d)[_0x0e60('0x23')](function(_0x2427a8){_0x4eb9b8[_0x0e60('0x1b')]=_0x2427a8;if(_0x48d950[_0x0e60('0x2b')][_0x0e60('0x3f')]){_0x39dae2['include']=[{'all':!![]}];}return db[_0x0e60('0x3e')]['findAll'](_0x39dae2);})[_0x0e60('0x23')](function(_0x266cae){_0x4eb9b8['rows']=_0x266cae;return _0x4eb9b8;})['then'](respondWithFilteredResult(_0xd82283,_0x39dae2))[_0x0e60('0x40')](handleError(_0xd82283,null));};exports[_0x0e60('0x41')]=function(_0x50b793,_0x67aea2){var _0x2c6464={'raw':!![],'where':{'id':_0x50b793[_0x0e60('0x42')]['id']}},_0x50090c={};_0x50090c[_0x0e60('0x31')]=_[_0x0e60('0x2c')](db[_0x0e60('0x3e')][_0x0e60('0x2a')]);_0x50090c[_0x0e60('0x2b')]=_[_0x0e60('0x2c')](_0x50b793[_0x0e60('0x2b')]);_0x50090c[_0x0e60('0x36')]=_['intersection'](_0x50090c['model'],_0x50090c['query']);_0x2c6464[_0x0e60('0x2e')]=_['intersection'](_0x50090c[_0x0e60('0x31')],qs[_0x0e60('0x2f')](_0x50b793[_0x0e60('0x2b')]['fields']));_0x2c6464[_0x0e60('0x2e')]=_0x2c6464[_0x0e60('0x2e')]['length']?_0x2c6464['attributes']:_0x50090c[_0x0e60('0x31')];if(_0x50b793[_0x0e60('0x2b')][_0x0e60('0x3f')]){_0x2c6464[_0x0e60('0x43')]=[{'all':!![]}];}_0x2c6464=_[_0x0e60('0x39')]({},_0x2c6464,_0x50b793[_0x0e60('0x3d')]);return db['FaxTransferReport'][_0x0e60('0x44')](_0x2c6464)[_0x0e60('0x23')](handleEntityNotFound(_0x67aea2,null))[_0x0e60('0x23')](respondWithResult(_0x67aea2,null))[_0x0e60('0x40')](handleError(_0x67aea2,null));};exports[_0x0e60('0x45')]=function(_0x557431,_0x5abbb4){return db['FaxTransferReport'][_0x0e60('0x45')](_0x557431[_0x0e60('0x46')],{})[_0x0e60('0x23')](respondWithResult(_0x5abbb4,0xc9))[_0x0e60('0x40')](handleError(_0x5abbb4,null));};exports['update']=function(_0x5b9cf6,_0x5c306f){if(_0x5b9cf6[_0x0e60('0x46')]['id']){delete _0x5b9cf6[_0x0e60('0x46')]['id'];}return db[_0x0e60('0x3e')][_0x0e60('0x44')]({'where':{'id':_0x5b9cf6[_0x0e60('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c306f,null))['then'](saveUpdates(_0x5b9cf6[_0x0e60('0x46')],null))[_0x0e60('0x23')](respondWithResult(_0x5c306f,null))[_0x0e60('0x40')](handleError(_0x5c306f,null));};exports[_0x0e60('0x24')]=function(_0x4ad156,_0x36a999){return db[_0x0e60('0x3e')][_0x0e60('0x44')]({'where':{'id':_0x4ad156['params']['id']}})[_0x0e60('0x23')](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x23')](removeEntity(_0x36a999,null))['catch'](handleError(_0x36a999,null));};exports[_0x0e60('0x47')]=function(_0x4bbcb4,_0x305a2f){return db[_0x0e60('0x3e')][_0x0e60('0x47')]()[_0x0e60('0x23')](respondWithResult(_0x305a2f,null))[_0x0e60('0x40')](handleError(_0x305a2f,null));}; \ No newline at end of file +var _0x255f=['offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','FaxTransferReport','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x255f,0x185));var _0xf255=function(_0x52d6d6,_0x34413a){_0x52d6d6=_0x52d6d6-0x0;var _0xacbfe7=_0x255f[_0x52d6d6];return _0xacbfe7;};'use strict';var pdf=require(_0xf255('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf255('0x1'));var zipdir=require(_0xf255('0x2'));var jsonpatch=require(_0xf255('0x3'));var rp=require('request-promise');var moment=require(_0xf255('0x4'));var BPromise=require(_0xf255('0x5'));var Mustache=require(_0xf255('0x6'));var util=require(_0xf255('0x7'));var path=require(_0xf255('0x8'));var sox=require(_0xf255('0x9'));var csv=require(_0xf255('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf255('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf255('0xc'));var deskjs=require(_0xf255('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf255('0xe'));var Papa=require(_0xf255('0xf'));var Redis=require('ioredis');var authService=require(_0xf255('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf255('0x11'));var logger=require(_0xf255('0x12'))(_0xf255('0x13'));var utils=require(_0xf255('0x14'));var config=require(_0xf255('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x853ad2,_0xab71ec){_0xab71ec=_0xab71ec||0xcc;return function(_0x35fe1b){if(_0x35fe1b){return _0x853ad2['sendStatus'](_0xab71ec);}return _0x853ad2[_0xf255('0x16')](_0xab71ec)[_0xf255('0x17')]();};}function respondWithResult(_0x52a804,_0x17b028){_0x17b028=_0x17b028||0xc8;return function(_0x266b73){if(_0x266b73){return _0x52a804[_0xf255('0x16')](_0x17b028)['json'](_0x266b73);}};}function respondWithFilteredResult(_0x393d1d,_0xc5b6a4){return function(_0x4b8c8){if(_0x4b8c8){var _0x750c8a=_0x4b8c8[_0xf255('0x18')],_0x194e28=_0xc5b6a4['offset'],_0x4d9a07=_0xc5b6a4[_0xf255('0x19')]+_0xc5b6a4['limit'],_0x4edad2;if(_0x4d9a07>=_0x750c8a){_0x4d9a07=_0x750c8a;_0x4edad2=0xc8;}else{_0x4edad2=0xce;}_0x393d1d[_0xf255('0x16')](_0x4edad2);return _0x393d1d[_0xf255('0x1a')](_0xf255('0x1b'),_0x194e28+'-'+_0x4d9a07+'/'+_0x750c8a)[_0xf255('0x1c')](_0x4b8c8);}return null;};}function patchUpdates(_0x186558){return function(_0x2490d9){try{jsonpatch[_0xf255('0x1d')](_0x2490d9,_0x186558,!![]);}catch(_0x422a19){return BPromise[_0xf255('0x1e')](_0x422a19);}return _0x2490d9[_0xf255('0x1f')]();};}function saveUpdates(_0x3a930d,_0x4e05e3){return function(_0x2fe87d){if(_0x2fe87d){return _0x2fe87d[_0xf255('0x20')](_0x3a930d)[_0xf255('0x21')](function(_0x2c5fbc){return _0x2c5fbc;});}return null;};}function removeEntity(_0x1e3109,_0x11fbe9){return function(_0x31bde5){if(_0x31bde5){return _0x31bde5['destroy']()[_0xf255('0x21')](function(){_0x1e3109[_0xf255('0x16')](0xcc)[_0xf255('0x17')]();});}};}function handleEntityNotFound(_0x1dad1e,_0x325ee8){return function(_0x1b3b1a){if(!_0x1b3b1a){_0x1dad1e[_0xf255('0x22')](0x194);}return _0x1b3b1a;};}function handleError(_0x4b1bef,_0x28cb07){_0x28cb07=_0x28cb07||0x1f4;return function(_0x4c1664){logger['error'](_0x4c1664[_0xf255('0x23')]);if(_0x4c1664[_0xf255('0x24')]){delete _0x4c1664[_0xf255('0x24')];}_0x4b1bef[_0xf255('0x16')](_0x28cb07)[_0xf255('0x25')](_0x4c1664);};}exports['index']=function(_0x1c3a8e,_0x157397){var _0xdeaf7e={},_0x551da1={},_0x1b1980={'count':0x0,'rows':[]};var _0x3527fb=db[_0xf255('0x26')]['rawAttributes'];_0x551da1[_0xf255('0x27')]=_[_0xf255('0x28')](_0x3527fb);_0x551da1[_0xf255('0x29')]=_[_0xf255('0x28')](_0x1c3a8e[_0xf255('0x29')]);_0x551da1[_0xf255('0x2a')]=_[_0xf255('0x2b')](_0x551da1[_0xf255('0x27')],_0x551da1[_0xf255('0x29')]);_0xdeaf7e[_0xf255('0x2c')]=_['intersection'](_0x551da1[_0xf255('0x27')],qs[_0xf255('0x2d')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x2d')]));_0xdeaf7e[_0xf255('0x2c')]=_0xdeaf7e[_0xf255('0x2c')][_0xf255('0x2e')]?_0xdeaf7e[_0xf255('0x2c')]:_0x551da1['model'];if(!_0x1c3a8e[_0xf255('0x29')]['hasOwnProperty']('nolimit')){_0xdeaf7e[_0xf255('0x2f')]=qs[_0xf255('0x2f')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x2f')]);_0xdeaf7e[_0xf255('0x19')]=qs[_0xf255('0x19')](_0x1c3a8e[_0xf255('0x29')]['offset']);}_0xdeaf7e[_0xf255('0x30')]=qs[_0xf255('0x31')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x31')]);_0xdeaf7e[_0xf255('0x32')]=qs[_0xf255('0x2a')](_['pick'](_0x1c3a8e[_0xf255('0x29')],_0x551da1[_0xf255('0x2a')]));if(_0x1c3a8e[_0xf255('0x29')][_0xf255('0x33')]){_0xdeaf7e[_0xf255('0x32')]=_['merge'](_0xdeaf7e[_0xf255('0x32')],{'$or':_[_0xf255('0x34')](_0x3527fb,function(_0x6f9156){if(_0x6f9156[_0xf255('0x35')][_0xf255('0x36')]!==_0xf255('0x37')){var _0x4ad7c7={};_0x4ad7c7[_0x6f9156[_0xf255('0x38')]]={'$like':'%'+_0x1c3a8e[_0xf255('0x29')][_0xf255('0x33')]+'%'};return _0x4ad7c7;}})});}_0xdeaf7e=_[_0xf255('0x39')]({},_0xdeaf7e,_0x1c3a8e[_0xf255('0x3a')]);var _0x4fb2b3={'where':_0xdeaf7e[_0xf255('0x32')]};return db[_0xf255('0x26')][_0xf255('0x18')](_0x4fb2b3)[_0xf255('0x21')](function(_0x19b901){_0x1b1980[_0xf255('0x18')]=_0x19b901;if(_0x1c3a8e[_0xf255('0x29')]['includeAll']){_0xdeaf7e[_0xf255('0x3b')]=[{'all':!![]}];}return db[_0xf255('0x26')][_0xf255('0x3c')](_0xdeaf7e);})['then'](function(_0x1aef9c){_0x1b1980['rows']=_0x1aef9c;return _0x1b1980;})[_0xf255('0x21')](respondWithFilteredResult(_0x157397,_0xdeaf7e))[_0xf255('0x3d')](handleError(_0x157397,null));};exports[_0xf255('0x3e')]=function(_0x4516c5,_0x2edc1a){var _0x34dcb8={'raw':!![],'where':{'id':_0x4516c5[_0xf255('0x3f')]['id']}},_0x3d7358={};_0x3d7358[_0xf255('0x27')]=_[_0xf255('0x28')](db[_0xf255('0x26')][_0xf255('0x40')]);_0x3d7358[_0xf255('0x29')]=_[_0xf255('0x28')](_0x4516c5[_0xf255('0x29')]);_0x3d7358[_0xf255('0x2a')]=_[_0xf255('0x2b')](_0x3d7358['model'],_0x3d7358[_0xf255('0x29')]);_0x34dcb8['attributes']=_[_0xf255('0x2b')](_0x3d7358[_0xf255('0x27')],qs['fields'](_0x4516c5[_0xf255('0x29')]['fields']));_0x34dcb8[_0xf255('0x2c')]=_0x34dcb8[_0xf255('0x2c')]['length']?_0x34dcb8[_0xf255('0x2c')]:_0x3d7358['model'];if(_0x4516c5['query']['includeAll']){_0x34dcb8[_0xf255('0x3b')]=[{'all':!![]}];}_0x34dcb8=_[_0xf255('0x39')]({},_0x34dcb8,_0x4516c5[_0xf255('0x3a')]);return db[_0xf255('0x26')]['find'](_0x34dcb8)[_0xf255('0x21')](handleEntityNotFound(_0x2edc1a,null))[_0xf255('0x21')](respondWithResult(_0x2edc1a,null))[_0xf255('0x3d')](handleError(_0x2edc1a,null));};exports[_0xf255('0x41')]=function(_0x2426e7,_0x5ef308){return db[_0xf255('0x26')][_0xf255('0x41')](_0x2426e7[_0xf255('0x42')],{})[_0xf255('0x21')](respondWithResult(_0x5ef308,0xc9))[_0xf255('0x3d')](handleError(_0x5ef308,null));};exports[_0xf255('0x20')]=function(_0x21ef06,_0xb37dd6){if(_0x21ef06['body']['id']){delete _0x21ef06['body']['id'];}return db['FaxTransferReport'][_0xf255('0x43')]({'where':{'id':_0x21ef06['params']['id']}})['then'](handleEntityNotFound(_0xb37dd6,null))[_0xf255('0x21')](saveUpdates(_0x21ef06[_0xf255('0x42')],null))[_0xf255('0x21')](respondWithResult(_0xb37dd6,null))[_0xf255('0x3d')](handleError(_0xb37dd6,null));};exports['destroy']=function(_0x5bf6e7,_0x1a893c){return db['FaxTransferReport']['find']({'where':{'id':_0x5bf6e7[_0xf255('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a893c,null))[_0xf255('0x21')](removeEntity(_0x1a893c,null))[_0xf255('0x3d')](handleError(_0x1a893c,null));};exports[_0xf255('0x44')]=function(_0x3bbb62,_0x37b687){return db[_0xf255('0x26')][_0xf255('0x44')]()[_0xf255('0x21')](respondWithResult(_0x37b687,null))[_0xf255('0x3d')](handleError(_0x37b687,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0602ee0..25cc81a 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 _0xb2af=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api'];(function(_0x34014b,_0x37ef4b){var _0x2cf870=function(_0xaa33d3){while(--_0xaa33d3){_0x34014b['push'](_0x34014b['shift']());}};_0x2cf870(++_0x37ef4b);}(_0xb2af,0x72));var _0xfb2a=function(_0x1bf572,_0x146c8b){_0x1bf572=_0x1bf572-0x0;var _0x29f9e0=_0xb2af[_0x1bf572];return _0x29f9e0;};'use strict';var _=require('lodash');var util=require(_0xfb2a('0x0'));var logger=require(_0xfb2a('0x1'))(_0xfb2a('0x2'));var moment=require(_0xfb2a('0x3'));var BPromise=require(_0xfb2a('0x4'));var rp=require(_0xfb2a('0x5'));var fs=require('fs');var path=require(_0xfb2a('0x6'));var rimraf=require(_0xfb2a('0x7'));var config=require(_0xfb2a('0x8'));var attributes=require(_0xfb2a('0x9'));module['exports']=function(_0xf7bd02,_0x44c184){return _0xf7bd02['define'](_0xfb2a('0xa'),attributes,{'tableName':_0xfb2a('0xb'),'paranoid':![],'indexes':[{'name':_0xfb2a('0xc'),'fields':[_0xfb2a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7849=['util','api','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','report_fax_transfer','uniqueid'];(function(_0x17cc44,_0x25b61f){var _0x31efbc=function(_0x3aed80){while(--_0x3aed80){_0x17cc44['push'](_0x17cc44['shift']());}};_0x31efbc(++_0x25b61f);}(_0x7849,0xfa));var _0x9784=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7849[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x9784('0x0'));var logger=require('../../config/logger')(_0x9784('0x1'));var moment=require(_0x9784('0x2'));var BPromise=require('bluebird');var rp=require(_0x9784('0x3'));var fs=require('fs');var path=require(_0x9784('0x4'));var rimraf=require(_0x9784('0x5'));var config=require(_0x9784('0x6'));var attributes=require(_0x9784('0x7'));module['exports']=function(_0x37da20,_0x52d4d7){return _0x37da20['define']('FaxTransferReport',attributes,{'tableName':_0x9784('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9784('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index eceac93..fa46e69 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 _0x7308=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5d5b69,_0x1111ab){var _0xf82413=function(_0x3a1f48){while(--_0x3a1f48){_0x5d5b69['push'](_0x5d5b69['shift']());}};_0xf82413(++_0x1111ab);}(_0x7308,0x1f0));var _0x8730=function(_0x5a0afd,_0x113988){_0x5a0afd=_0x5a0afd-0x0;var _0x4899fa=_0x7308[_0x5a0afd];return _0x4899fa;};'use strict';var _=require(_0x8730('0x0'));var util=require(_0x8730('0x1'));var moment=require(_0x8730('0x2'));var BPromise=require(_0x8730('0x3'));var rs=require(_0x8730('0x4'));var fs=require('fs');var Redis=require(_0x8730('0x5'));var db=require(_0x8730('0x6'))['db'];var utils=require(_0x8730('0x7'));var logger=require(_0x8730('0x8'))('rpc');var config=require(_0x8730('0x9'));var jayson=require(_0x8730('0xa'));var client=jayson[_0x8730('0xb')][_0x8730('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x227590,_0xeae372,_0x533a4d){return new BPromise(function(_0x508499,_0x453319){return client[_0x8730('0xd')](_0x227590,_0x533a4d)[_0x8730('0xe')](function(_0x9833f6){logger['info'](_0x8730('0xf'),_0xeae372,_0x8730('0x10'));logger[_0x8730('0x11')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xeae372,_0x8730('0x10'),JSON[_0x8730('0x12')](_0x9833f6));if(_0x9833f6[_0x8730('0x13')]){if(_0x9833f6[_0x8730('0x13')][_0x8730('0x14')]===0x1f4){logger[_0x8730('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0xeae372,_0x9833f6[_0x8730('0x13')][_0x8730('0x15')]);return _0x453319(_0x9833f6['error'][_0x8730('0x15')]);}logger[_0x8730('0x13')](_0x8730('0xf'),_0xeae372,_0x9833f6[_0x8730('0x13')][_0x8730('0x15')]);return _0x508499(_0x9833f6[_0x8730('0x13')][_0x8730('0x15')]);}else{logger[_0x8730('0x16')](_0x8730('0xf'),_0xeae372,_0x8730('0x10'));_0x508499(_0x9833f6['result']['message']);}})[_0x8730('0x17')](function(_0x1bc5b0){logger[_0x8730('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0xeae372,_0x1bc5b0);_0x453319(_0x1bc5b0);});});} \ No newline at end of file +var _0x3ff2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3ff2,0x94));var _0x23ff=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ff2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x23ff('0x0'));var util=require(_0x23ff('0x1'));var moment=require(_0x23ff('0x2'));var BPromise=require(_0x23ff('0x3'));var rs=require(_0x23ff('0x4'));var fs=require('fs');var Redis=require(_0x23ff('0x5'));var db=require(_0x23ff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x23ff('0x7'))(_0x23ff('0x8'));var config=require(_0x23ff('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x23ff('0xa')][_0x23ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45169d,_0x58c09d,_0x27536d){return new BPromise(function(_0x509761,_0x573ab2){return client[_0x23ff('0xc')](_0x45169d,_0x27536d)[_0x23ff('0xd')](function(_0x54f4d2){logger[_0x23ff('0xe')](_0x23ff('0xf'),_0x58c09d,'request\x20sent');logger[_0x23ff('0x10')](_0x23ff('0x11'),_0x58c09d,_0x23ff('0x12'),JSON[_0x23ff('0x13')](_0x54f4d2));if(_0x54f4d2[_0x23ff('0x14')]){if(_0x54f4d2[_0x23ff('0x14')][_0x23ff('0x15')]===0x1f4){logger[_0x23ff('0x14')](_0x23ff('0xf'),_0x58c09d,_0x54f4d2[_0x23ff('0x14')][_0x23ff('0x16')]);return _0x573ab2(_0x54f4d2[_0x23ff('0x14')][_0x23ff('0x16')]);}logger[_0x23ff('0x14')](_0x23ff('0xf'),_0x58c09d,_0x54f4d2[_0x23ff('0x14')][_0x23ff('0x16')]);return _0x509761(_0x54f4d2[_0x23ff('0x14')][_0x23ff('0x16')]);}else{logger[_0x23ff('0xe')](_0x23ff('0xf'),_0x58c09d,_0x23ff('0x12'));_0x509761(_0x54f4d2[_0x23ff('0x17')][_0x23ff('0x16')]);}})[_0x23ff('0x18')](function(_0x58b926){logger[_0x23ff('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x58c09d,_0x58b926);_0x573ab2(_0x58b926);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a672f89..8398693 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['./faxTransferReport.controller','get','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','express','../../components/interaction/service','../../config/environment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x4b84[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x9')]('/',auth[_0x44b8('0x7')](),controller['create']);router[_0x44b8('0xa')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller['destroy']);module[_0x44b8('0xe')]=router; \ No newline at end of file +var _0x0a9a=['show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3a2f5d,_0x5150cb){_0x3a2f5d=_0x3a2f5d-0x0;var _0x2b219d=_0x0a9a[_0x3a2f5d];return _0x2b219d;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var auth=require(_0xa0a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a9('0x5'));var controller=require(_0xa0a9('0x6'));router['get']('/',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x8')]);router[_0xa0a9('0x9')](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xb')]);router['get'](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xd')]);router[_0xa0a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0a9('0xf')]);router[_0xa0a9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa0a9('0x11')]);router[_0xa0a9('0x12')]('/:id',auth[_0xa0a9('0x7')](),controller['destroy']);module[_0xa0a9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 8544723..fa2139e 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 _0x4566=['destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','put','/:id','update','delete'];(function(_0x4e4938,_0x5199ed){var _0x2dcc9c=function(_0x1bdbd0){while(--_0x1bdbd0){_0x4e4938['push'](_0x4e4938['shift']());}};_0x2dcc9c(++_0x5199ed);}(_0x4566,0x1bb));var _0x6456=function(_0x4dbede,_0x3b5fc3){_0x4dbede=_0x4dbede-0x0;var _0x46bb0c=_0x4566[_0x4dbede];return _0x46bb0c;};'use strict';var multer=require(_0x6456('0x0'));var util=require(_0x6456('0x1'));var path=require('path');var timeout=require(_0x6456('0x2'));var express=require(_0x6456('0x3'));var router=express[_0x6456('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6456('0x5'));var controller=require(_0x6456('0x6'));router[_0x6456('0x7')]('/',auth[_0x6456('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6456('0x9')]);router[_0x6456('0x7')](_0x6456('0xa'),auth['isAuthenticated'](),controller[_0x6456('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x6456('0xc')]);router[_0x6456('0xd')]('/',auth['isAuthenticated'](),controller[_0x6456('0xe')]);router[_0x6456('0xd')](_0x6456('0xa'),auth[_0x6456('0x8')](),controller['addConfiguration']);router[_0x6456('0xf')](_0x6456('0x10'),auth[_0x6456('0x8')](),controller[_0x6456('0x11')]);router[_0x6456('0x12')]('/:id',auth[_0x6456('0x8')](),controller[_0x6456('0x13')]);module[_0x6456('0x14')]=router; \ No newline at end of file +var _0x11b2=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x11b2,0x1c2));var _0x211b=function(_0x445db0,_0x457829){_0x445db0=_0x445db0-0x0;var _0x44be9a=_0x11b2[_0x445db0];return _0x44be9a;};'use strict';var multer=require(_0x211b('0x0'));var util=require('util');var path=require(_0x211b('0x1'));var timeout=require(_0x211b('0x2'));var express=require(_0x211b('0x3'));var router=express['Router']();var auth=require(_0x211b('0x4'));var interaction=require(_0x211b('0x5'));var config=require(_0x211b('0x6'));var controller=require(_0x211b('0x7'));router[_0x211b('0x8')]('/',auth[_0x211b('0x9')](),controller[_0x211b('0xa')]);router[_0x211b('0x8')](_0x211b('0xb'),auth[_0x211b('0x9')](),controller['show']);router[_0x211b('0x8')](_0x211b('0xc'),auth['isAuthenticated'](),controller[_0x211b('0xd')]);router['get'](_0x211b('0xe'),auth['isAuthenticated'](),controller[_0x211b('0xf')]);router[_0x211b('0x10')]('/',auth[_0x211b('0x9')](),controller[_0x211b('0x11')]);router[_0x211b('0x10')]('/:id/configurations',auth[_0x211b('0x9')](),controller[_0x211b('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x211b('0x13')](_0x211b('0xb'),auth[_0x211b('0x9')](),controller['destroy']);module[_0x211b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 012aa4e..41b6655 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 _0x3cf4=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x175075,_0x503c85){var _0x453513=function(_0x538e32){while(--_0x538e32){_0x175075['push'](_0x175075['shift']());}};_0x453513(++_0x503c85);}(_0x3cf4,0x1c3));var _0x43cf=function(_0x6716ee,_0x34778c){_0x6716ee=_0x6716ee-0x0;var _0x992b74=_0x3cf4[_0x6716ee];return _0x992b74;};'use strict';var Sequelize=require(_0x43cf('0x0'));module[_0x43cf('0x1')]={'name':{'type':Sequelize[_0x43cf('0x2')]},'description':{'type':Sequelize[_0x43cf('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x43cf('0x2')]},'authType':{'type':Sequelize[_0x43cf('0x3')](_0x43cf('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x43cf('0x2')]},'consumerKey':{'type':Sequelize[_0x43cf('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x43cf('0x2')]},'tokenSecret':{'type':Sequelize[_0x43cf('0x2')]},'serverUrl':{'type':Sequelize[_0x43cf('0x2')]},'type':{'type':Sequelize[_0x43cf('0x3')](_0x43cf('0x5'),_0x43cf('0x6')),'defaultValue':_0x43cf('0x5')}}; \ No newline at end of file +var _0x4f52=['newTab','exports','STRING','basic','ENUM','integrationTab'];(function(_0x285507,_0x499144){var _0x44c99b=function(_0x1547cc){while(--_0x1547cc){_0x285507['push'](_0x285507['shift']());}};_0x44c99b(++_0x499144);}(_0x4f52,0x8b));var _0x24f5=function(_0x50aea2,_0x2a6e8c){_0x50aea2=_0x50aea2-0x0;var _0x590ad2=_0x4f52[_0x50aea2];return _0x590ad2;};'use strict';var Sequelize=require('sequelize');module[_0x24f5('0x0')]={'name':{'type':Sequelize[_0x24f5('0x1')]},'description':{'type':Sequelize[_0x24f5('0x1')]},'username':{'type':Sequelize[_0x24f5('0x1')]},'remoteUri':{'type':Sequelize[_0x24f5('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x24f5('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x24f5('0x1')]},'consumerKey':{'type':Sequelize[_0x24f5('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x24f5('0x1')]},'tokenSecret':{'type':Sequelize[_0x24f5('0x1')]},'serverUrl':{'type':Sequelize[_0x24f5('0x1')]},'type':{'type':Sequelize[_0x24f5('0x3')](_0x24f5('0x4'),_0x24f5('0x5')),'defaultValue':_0x24f5('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f976ab5..783b145 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d4a72db..036f209 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 _0x22fb=['rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4f6464,_0x19ce0b){var _0x2970c0=function(_0x30b705){while(--_0x30b705){_0x4f6464['push'](_0x4f6464['shift']());}};_0x2970c0(++_0x19ce0b);}(_0x22fb,0x192));var _0xb22f=function(_0x2bbb75,_0x4192a7){_0x2bbb75=_0x2bbb75-0x0;var _0x770644=_0x22fb[_0x2bbb75];return _0x770644;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));var integrations=require(_0xb22f('0x7'));module[_0xb22f('0x8')]=function(_0xc3ffcc,_0x412a95){return _0xc3ffcc[_0xb22f('0x9')]('DeskAccount',attributes,{'tableName':_0xb22f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2547=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2547,0x1cd));var _0x7254=function(_0x129377,_0x4ecb48){_0x129377=_0x129377-0x0;var _0xff5523=_0x2547[_0x129377];return _0xff5523;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));var integrations=require(_0x7254('0x9'));module[_0x7254('0xa')]=function(_0x119f66,_0x4b845f){return _0x119f66[_0x7254('0xb')](_0x7254('0xc'),attributes,{'tableName':_0x7254('0xd'),'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 037b377..9ab81f9 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 _0x866a=['error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','limit','include','map','model','attributes','debug','ShowDeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16e2c0,_0x430a4a){var _0x502b31=function(_0x2fd363){while(--_0x2fd363){_0x16e2c0['push'](_0x16e2c0['shift']());}};_0x502b31(++_0x430a4a);}(_0x866a,0x156));var _0xa866=function(_0x5a184b,_0x457876){_0x5a184b=_0x5a184b-0x0;var _0x713964=_0x866a[_0x5a184b];return _0x713964;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var moment=require(_0xa866('0x1'));var BPromise=require(_0xa866('0x2'));var rs=require(_0xa866('0x3'));var fs=require('fs');var Redis=require(_0xa866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa866('0x5'));var logger=require(_0xa866('0x6'))(_0xa866('0x7'));var config=require('../../config/environment');var jayson=require(_0xa866('0x8'));var client=jayson[_0xa866('0x9')][_0xa866('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288582,_0x3d1380,_0x2c7278){return new BPromise(function(_0x41a92a,_0x208625){return client[_0xa866('0xb')](_0x288582,_0x2c7278)[_0xa866('0xc')](function(_0x525ce6){logger[_0xa866('0xd')](_0xa866('0xe'),_0x3d1380,_0xa866('0xf'));logger['debug'](_0xa866('0x10'),_0x3d1380,_0xa866('0xf'),JSON[_0xa866('0x11')](_0x525ce6));if(_0x525ce6[_0xa866('0x12')]){if(_0x525ce6[_0xa866('0x12')][_0xa866('0x13')]===0x1f4){logger['error'](_0xa866('0xe'),_0x3d1380,_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);return _0x208625(_0x525ce6[_0xa866('0x12')]['message']);}logger[_0xa866('0x12')]('DeskAccount,\x20%s,\x20%s',_0x3d1380,_0x525ce6[_0xa866('0x12')]['message']);return _0x41a92a(_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);}else{logger[_0xa866('0xd')]('DeskAccount,\x20%s,\x20%s',_0x3d1380,_0xa866('0xf'));_0x41a92a(_0x525ce6[_0xa866('0x15')][_0xa866('0x14')]);}})[_0xa866('0x16')](function(_0x1e2211){logger[_0xa866('0x12')](_0xa866('0xe'),_0x3d1380,_0x1e2211);_0x208625(_0x1e2211);});});}exports[_0xa866('0x17')]=function(_0x440de5){var _0x48fd82=this;return new Promise(function(_0x2aca7b,_0x1de976){return db[_0xa866('0x18')][_0xa866('0x19')]({'raw':_0x440de5[_0xa866('0x1a')]?_0x440de5[_0xa866('0x1a')][_0xa866('0x1b')]===undefined?!![]:![]:!![],'where':_0x440de5['options']?_0x440de5[_0xa866('0x1a')]['where']||null:null,'attributes':_0x440de5['options']?_0x440de5[_0xa866('0x1a')]['attributes']||null:null,'limit':_0x440de5[_0xa866('0x1a')]?_0x440de5[_0xa866('0x1a')][_0xa866('0x1c')]||null:null,'include':_0x440de5['options']?_0x440de5['options'][_0xa866('0x1d')]?_[_0xa866('0x1e')](_0x440de5['options'][_0xa866('0x1d')],function(_0x31ed99){return{'model':db[_0x31ed99[_0xa866('0x1f')]],'as':_0x31ed99['as'],'attributes':_0x31ed99[_0xa866('0x20')],'include':_0x31ed99['include']?_[_0xa866('0x1e')](_0x31ed99[_0xa866('0x1d')],function(_0x35a83d){return{'model':db[_0x35a83d[_0xa866('0x1f')]],'as':_0x35a83d['as'],'attributes':_0x35a83d[_0xa866('0x20')],'include':_0x35a83d[_0xa866('0x1d')]?_['map'](_0x35a83d[_0xa866('0x1d')],function(_0x16c9f7){return{'model':db[_0x16c9f7['model']],'as':_0x16c9f7['as'],'attributes':_0x16c9f7['attributes']};}):[]};}):[]};}):[]:[]})[_0xa866('0xc')](function(_0x25f236){logger['info']('GetDeskAccount',_0x440de5);logger[_0xa866('0x21')](_0xa866('0x17'),_0x440de5,JSON['stringify'](_0x25f236));_0x2aca7b(_0x25f236);})[_0xa866('0x16')](function(_0x36e73b){logger[_0xa866('0x12')]('GetDeskAccount',_0x36e73b[_0xa866('0x14')],_0x440de5);_0x1de976(_0x48fd82[_0xa866('0x12')](0x1f4,_0x36e73b[_0xa866('0x14')]));});});};exports[_0xa866('0x22')]=function(_0x11ec00){var _0x4b3d81=this;return new Promise(function(_0x4eb663,_0x1ad800){return db[_0xa866('0x18')][_0xa866('0x23')]({'raw':_0x11ec00[_0xa866('0x1a')]?_0x11ec00[_0xa866('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x11ec00[_0xa866('0x1a')]?_0x11ec00[_0xa866('0x1a')]['where']||null:null,'attributes':_0x11ec00[_0xa866('0x1a')]?_0x11ec00[_0xa866('0x1a')]['attributes']||null:null,'include':_0x11ec00[_0xa866('0x1a')]?_0x11ec00[_0xa866('0x1a')][_0xa866('0x1d')]?_[_0xa866('0x1e')](_0x11ec00[_0xa866('0x1a')][_0xa866('0x1d')],function(_0x2ca6b1){return{'model':db[_0x2ca6b1[_0xa866('0x1f')]],'as':_0x2ca6b1['as'],'attributes':_0x2ca6b1[_0xa866('0x20')],'include':_0x2ca6b1[_0xa866('0x1d')]?_['map'](_0x2ca6b1['include'],function(_0x395b00){return{'model':db[_0x395b00[_0xa866('0x1f')]],'as':_0x395b00['as'],'attributes':_0x395b00[_0xa866('0x20')],'include':_0x395b00[_0xa866('0x1d')]?_[_0xa866('0x1e')](_0x395b00['include'],function(_0x34f3ba){return{'model':db[_0x34f3ba[_0xa866('0x1f')]],'as':_0x34f3ba['as'],'attributes':_0x34f3ba[_0xa866('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa866('0xc')](function(_0x5529b0){logger[_0xa866('0xd')](_0xa866('0x22'),_0x11ec00);logger[_0xa866('0x21')]('ShowDeskAccount',_0x11ec00,JSON[_0xa866('0x11')](_0x5529b0));_0x4eb663(_0x5529b0);})[_0xa866('0x16')](function(_0x69624c){logger[_0xa866('0x12')]('ShowDeskAccount',_0x69624c[_0xa866('0x14')],_0x11ec00);_0x1ad800(_0x4b3d81['error'](0x1f4,_0x69624c[_0xa866('0x14')]));});});}; \ No newline at end of file +var _0xcc97=['ShowDeskAccount','raw','where','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','GetDeskAccount','DeskAccount','findAll','options','limit','include','map','model','attributes'];(function(_0x2c6592,_0x13d3d9){var _0x61f78d=function(_0x31d6e8){while(--_0x31d6e8){_0x2c6592['push'](_0x2c6592['shift']());}};_0x61f78d(++_0x13d3d9);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x583eba,_0x1bd471){_0x583eba=_0x583eba-0x0;var _0x16e576=_0xcc97[_0x583eba];return _0x16e576;};'use strict';var _=require(_0x7cc9('0x0'));var util=require(_0x7cc9('0x1'));var moment=require('moment');var BPromise=require(_0x7cc9('0x2'));var rs=require(_0x7cc9('0x3'));var fs=require('fs');var Redis=require(_0x7cc9('0x4'));var db=require(_0x7cc9('0x5'))['db'];var utils=require(_0x7cc9('0x6'));var logger=require(_0x7cc9('0x7'))(_0x7cc9('0x8'));var config=require(_0x7cc9('0x9'));var jayson=require(_0x7cc9('0xa'));var client=jayson[_0x7cc9('0xb')][_0x7cc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x488e69,_0x26f907,_0x263906){return new BPromise(function(_0x2a7c60,_0xd39ae){return client[_0x7cc9('0xd')](_0x488e69,_0x263906)['then'](function(_0x400a50){logger['info'](_0x7cc9('0xe'),_0x26f907,_0x7cc9('0xf'));logger[_0x7cc9('0x10')](_0x7cc9('0x11'),_0x26f907,_0x7cc9('0xf'),JSON[_0x7cc9('0x12')](_0x400a50));if(_0x400a50[_0x7cc9('0x13')]){if(_0x400a50['error']['code']===0x1f4){logger[_0x7cc9('0x13')]('DeskAccount,\x20%s,\x20%s',_0x26f907,_0x400a50[_0x7cc9('0x13')]['message']);return _0xd39ae(_0x400a50[_0x7cc9('0x13')][_0x7cc9('0x14')]);}logger[_0x7cc9('0x13')](_0x7cc9('0xe'),_0x26f907,_0x400a50[_0x7cc9('0x13')]['message']);return _0x2a7c60(_0x400a50['error'][_0x7cc9('0x14')]);}else{logger[_0x7cc9('0x15')](_0x7cc9('0xe'),_0x26f907,_0x7cc9('0xf'));_0x2a7c60(_0x400a50['result'][_0x7cc9('0x14')]);}})['catch'](function(_0x44db32){logger[_0x7cc9('0x13')](_0x7cc9('0xe'),_0x26f907,_0x44db32);_0xd39ae(_0x44db32);});});}exports[_0x7cc9('0x16')]=function(_0x317ec4){var _0x1f1f77=this;return new Promise(function(_0x50a252,_0x387a7c){return db[_0x7cc9('0x17')][_0x7cc9('0x18')]({'raw':_0x317ec4[_0x7cc9('0x19')]?_0x317ec4['options']['raw']===undefined?!![]:![]:!![],'where':_0x317ec4['options']?_0x317ec4[_0x7cc9('0x19')]['where']||null:null,'attributes':_0x317ec4[_0x7cc9('0x19')]?_0x317ec4[_0x7cc9('0x19')]['attributes']||null:null,'limit':_0x317ec4[_0x7cc9('0x19')]?_0x317ec4[_0x7cc9('0x19')][_0x7cc9('0x1a')]||null:null,'include':_0x317ec4[_0x7cc9('0x19')]?_0x317ec4[_0x7cc9('0x19')][_0x7cc9('0x1b')]?_[_0x7cc9('0x1c')](_0x317ec4[_0x7cc9('0x19')][_0x7cc9('0x1b')],function(_0x113e6b){return{'model':db[_0x113e6b[_0x7cc9('0x1d')]],'as':_0x113e6b['as'],'attributes':_0x113e6b[_0x7cc9('0x1e')],'include':_0x113e6b[_0x7cc9('0x1b')]?_[_0x7cc9('0x1c')](_0x113e6b[_0x7cc9('0x1b')],function(_0x5ad481){return{'model':db[_0x5ad481[_0x7cc9('0x1d')]],'as':_0x5ad481['as'],'attributes':_0x5ad481['attributes'],'include':_0x5ad481[_0x7cc9('0x1b')]?_[_0x7cc9('0x1c')](_0x5ad481[_0x7cc9('0x1b')],function(_0x4f6d59){return{'model':db[_0x4f6d59[_0x7cc9('0x1d')]],'as':_0x4f6d59['as'],'attributes':_0x4f6d59['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x494f56){logger[_0x7cc9('0x15')](_0x7cc9('0x16'),_0x317ec4);logger[_0x7cc9('0x10')](_0x7cc9('0x16'),_0x317ec4,JSON[_0x7cc9('0x12')](_0x494f56));_0x50a252(_0x494f56);})['catch'](function(_0x5ba534){logger['error'](_0x7cc9('0x16'),_0x5ba534['message'],_0x317ec4);_0x387a7c(_0x1f1f77[_0x7cc9('0x13')](0x1f4,_0x5ba534[_0x7cc9('0x14')]));});});};exports[_0x7cc9('0x1f')]=function(_0xb6fe9a){var _0x24ac45=this;return new Promise(function(_0x4f6c49,_0x4eec62){return db[_0x7cc9('0x17')]['find']({'raw':_0xb6fe9a[_0x7cc9('0x19')]?_0xb6fe9a['options'][_0x7cc9('0x20')]===undefined?!![]:![]:!![],'where':_0xb6fe9a[_0x7cc9('0x19')]?_0xb6fe9a[_0x7cc9('0x19')][_0x7cc9('0x21')]||null:null,'attributes':_0xb6fe9a['options']?_0xb6fe9a[_0x7cc9('0x19')][_0x7cc9('0x1e')]||null:null,'include':_0xb6fe9a[_0x7cc9('0x19')]?_0xb6fe9a[_0x7cc9('0x19')][_0x7cc9('0x1b')]?_['map'](_0xb6fe9a['options'][_0x7cc9('0x1b')],function(_0x3eb696){return{'model':db[_0x3eb696['model']],'as':_0x3eb696['as'],'attributes':_0x3eb696[_0x7cc9('0x1e')],'include':_0x3eb696[_0x7cc9('0x1b')]?_[_0x7cc9('0x1c')](_0x3eb696[_0x7cc9('0x1b')],function(_0x1c5040){return{'model':db[_0x1c5040[_0x7cc9('0x1d')]],'as':_0x1c5040['as'],'attributes':_0x1c5040[_0x7cc9('0x1e')],'include':_0x1c5040['include']?_[_0x7cc9('0x1c')](_0x1c5040[_0x7cc9('0x1b')],function(_0x170bed){return{'model':db[_0x170bed[_0x7cc9('0x1d')]],'as':_0x170bed['as'],'attributes':_0x170bed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3293ed){logger[_0x7cc9('0x15')](_0x7cc9('0x1f'),_0xb6fe9a);logger[_0x7cc9('0x10')](_0x7cc9('0x1f'),_0xb6fe9a,JSON[_0x7cc9('0x12')](_0x3293ed));_0x4f6c49(_0x3293ed);})[_0x7cc9('0x22')](function(_0x4738b6){logger[_0x7cc9('0x13')](_0x7cc9('0x1f'),_0x4738b6['message'],_0xb6fe9a);_0x4eec62(_0x24ac45[_0x7cc9('0x13')](0x1f4,_0x4738b6[_0x7cc9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 66b104c..3dd66bd 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 _0x984b=['index','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','path','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x4152a9,_0x24d08d){var _0x3bb207=function(_0x59bb06){while(--_0x59bb06){_0x4152a9['push'](_0x4152a9['shift']());}};_0x3bb207(++_0x24d08d);}(_0x984b,0xd5));var _0xb984=function(_0x3467b8,_0x1711d5){_0x3467b8=_0x3467b8-0x0;var _0x2e387b=_0x984b[_0x3467b8];return _0x2e387b;};'use strict';var multer=require(_0xb984('0x0'));var util=require('util');var path=require(_0xb984('0x1'));var timeout=require('connect-timeout');var express=require(_0xb984('0x2'));var router=express[_0xb984('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb984('0x4'));var controller=require('./intDeskConfiguration.controller');router[_0xb984('0x5')]('/',auth[_0xb984('0x6')](),controller[_0xb984('0x7')]);router['get']('/:id',auth[_0xb984('0x6')](),controller[_0xb984('0x8')]);router[_0xb984('0x5')](_0xb984('0x9'),auth[_0xb984('0x6')](),controller[_0xb984('0xa')]);router[_0xb984('0x5')]('/:id/subjects',auth[_0xb984('0x6')](),controller[_0xb984('0xb')]);router[_0xb984('0x5')]('/:id/descriptions',auth[_0xb984('0x6')](),controller[_0xb984('0xc')]);router[_0xb984('0x5')](_0xb984('0xd'),auth[_0xb984('0x6')](),controller['getTags']);router[_0xb984('0xe')]('/',auth[_0xb984('0x6')](),controller[_0xb984('0xf')]);router[_0xb984('0xe')]('/:id/tags',auth[_0xb984('0x6')](),controller[_0xb984('0x10')]);router[_0xb984('0x11')](_0xb984('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xb984('0x13')](_0xb984('0x12'),auth[_0xb984('0x6')](),controller[_0xb984('0x14')]);module[_0xb984('0x15')]=router; \ No newline at end of file +var _0x76f8=['isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intDeskConfiguration.controller','get'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x76f8,0x1ef));var _0x876f=function(_0x2d40ea,_0x10fc91){_0x2d40ea=_0x2d40ea-0x0;var _0x102fa4=_0x76f8[_0x2d40ea];return _0x102fa4;};'use strict';var multer=require(_0x876f('0x0'));var util=require(_0x876f('0x1'));var path=require(_0x876f('0x2'));var timeout=require(_0x876f('0x3'));var express=require(_0x876f('0x4'));var router=express[_0x876f('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x876f('0x6'));var controller=require(_0x876f('0x7'));router[_0x876f('0x8')]('/',auth[_0x876f('0x9')](),controller['index']);router[_0x876f('0x8')](_0x876f('0xa'),auth[_0x876f('0x9')](),controller[_0x876f('0xb')]);router[_0x876f('0x8')]('/:id/fields',auth[_0x876f('0x9')](),controller[_0x876f('0xc')]);router[_0x876f('0x8')](_0x876f('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x876f('0x8')](_0x876f('0xe'),auth['isAuthenticated'](),controller[_0x876f('0xf')]);router[_0x876f('0x8')](_0x876f('0x10'),auth[_0x876f('0x9')](),controller[_0x876f('0x11')]);router['post']('/',auth[_0x876f('0x9')](),controller[_0x876f('0x12')]);router[_0x876f('0x13')]('/:id/tags',auth[_0x876f('0x9')](),controller[_0x876f('0x14')]);router['put'](_0x876f('0xa'),auth[_0x876f('0x9')](),controller[_0x876f('0x15')]);router[_0x876f('0x16')](_0x876f('0xa'),auth[_0x876f('0x9')](),controller['destroy']);module[_0x876f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a630caa..8db96a0 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 _0xcb16=['exports','STRING','sequelize'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xcb16,0x1a6));var _0x6cb1=function(_0x54b842,_0x46dc70){_0x54b842=_0x54b842-0x0;var _0xb931c6=_0xcb16[_0x54b842];return _0xb931c6;};'use strict';var Sequelize=require(_0x6cb1('0x0'));module[_0x6cb1('0x1')]={'name':{'type':Sequelize[_0x6cb1('0x2')]},'description':{'type':Sequelize[_0x6cb1('0x2')]}}; \ No newline at end of file +var _0xec04=['sequelize','exports','STRING'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0xec04,0x1d1));var _0x4ec0=function(_0x4798e9,_0x40e4d4){_0x4798e9=_0x4798e9-0x0;var _0x3eac78=_0xec04[_0x4798e9];return _0x3eac78;};'use strict';var Sequelize=require(_0x4ec0('0x0'));module[_0x4ec0('0x1')]={'name':{'type':Sequelize[_0x4ec0('0x2')]},'description':{'type':Sequelize[_0x4ec0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index dce175f..e5b52ac 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 _0x5d66=['../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','Content-Range','json','save','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x5d66,0x109));var _0x65d6=function(_0x309bd3,_0xf11669){_0x309bd3=_0x309bd3-0x0;var _0x4681b5=_0x5d66[_0x309bd3];return _0x4681b5;};'use strict';var pdf=require(_0x65d6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x65d6('0x1'));var zipdir=require(_0x65d6('0x2'));var jsonpatch=require(_0x65d6('0x3'));var rp=require(_0x65d6('0x4'));var moment=require(_0x65d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x65d6('0x6'));var util=require(_0x65d6('0x7'));var path=require(_0x65d6('0x8'));var sox=require(_0x65d6('0x9'));var csv=require(_0x65d6('0xa'));var ejs=require(_0x65d6('0xb'));var fs=require('fs');var _=require(_0x65d6('0xc'));var squel=require(_0x65d6('0xd'));var crypto=require(_0x65d6('0xe'));var jsforce=require(_0x65d6('0xf'));var deskjs=require(_0x65d6('0x10'));var toCsv=require(_0x65d6('0xa'));var querystring=require(_0x65d6('0x11'));var Papa=require(_0x65d6('0x12'));var Redis=require(_0x65d6('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x65d6('0x14'));var logger=require(_0x65d6('0x15'))(_0x65d6('0x16'));var utils=require('../../config/utils');var config=require(_0x65d6('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x65d6('0x18'));var client=jayson['client'][_0x65d6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3fefec,_0x3a45cc,_0x2430f2){if(_0x2430f2){var _0x10ee08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10ee08[_0x65d6('0x1a')](_0x3a45cc)){return _0x3fefec;}else{throw new Error(_0x65d6('0x1b'));}}else{return _0x3fefec;}}function respondWithRpcPromise(_0x164fd8,_0x2a4dc9,_0x39a269,_0x1647c4){return new BPromise(function(_0x1ef91b,_0x30142b){var _0x2f6cc9=_0x1647c4||client;return _0x2f6cc9[_0x65d6('0x1c')](_0x164fd8,_0x39a269)[_0x65d6('0x1d')](function(_0x8bb27f){logger[_0x65d6('0x1e')](_0x65d6('0x1f'),_0x2a4dc9,_0x65d6('0x20'));logger[_0x65d6('0x21')](_0x65d6('0x22'),_0x2a4dc9,_0x65d6('0x20'),JSON[_0x65d6('0x23')](_0x8bb27f));if(_0x8bb27f[_0x65d6('0x24')]){if(_0x8bb27f[_0x65d6('0x24')]['code']===0x1f4){logger[_0x65d6('0x24')](_0x65d6('0x1f'),_0x2a4dc9,_0x8bb27f[_0x65d6('0x24')]['message']);return _0x30142b(_0x8bb27f[_0x65d6('0x24')][_0x65d6('0x25')]);}logger[_0x65d6('0x24')](_0x65d6('0x1f'),_0x2a4dc9,_0x8bb27f[_0x65d6('0x24')][_0x65d6('0x25')]);return _0x1ef91b(_0x8bb27f[_0x65d6('0x24')]['message']);}else{logger[_0x65d6('0x1e')](_0x65d6('0x1f'),_0x2a4dc9,'request\x20sent');_0x1ef91b(_0x8bb27f[_0x65d6('0x26')][_0x65d6('0x25')]);}})[_0x65d6('0x27')](function(_0xec4fd1){logger[_0x65d6('0x24')](_0x65d6('0x1f'),_0x2a4dc9,_0xec4fd1);_0x30142b(_0xec4fd1);});});}function respondWithStatusCode(_0x28d9ea,_0x36b53f){_0x36b53f=_0x36b53f||0xcc;return function(_0x265af2){if(_0x265af2){return _0x28d9ea[_0x65d6('0x28')](_0x36b53f);}return _0x28d9ea[_0x65d6('0x29')](_0x36b53f)[_0x65d6('0x2a')]();};}function respondWithResult(_0x21ca70,_0x59a334){_0x59a334=_0x59a334||0xc8;return function(_0x51d86d){if(_0x51d86d){return _0x21ca70['status'](_0x59a334)['json'](_0x51d86d);}};}function respondWithFilteredResult(_0x3e3795,_0x5c4b34){return function(_0x3263fa){if(_0x3263fa){var _0x4511ac=_0x3263fa[_0x65d6('0x2b')],_0x49f207=_0x5c4b34[_0x65d6('0x2c')],_0x56f036=_0x5c4b34[_0x65d6('0x2c')]+_0x5c4b34['limit'],_0x187dca;if(_0x56f036>=_0x4511ac){_0x56f036=_0x4511ac;_0x187dca=0xc8;}else{_0x187dca=0xce;}_0x3e3795['status'](_0x187dca);return _0x3e3795['set'](_0x65d6('0x2d'),_0x49f207+'-'+_0x56f036+'/'+_0x4511ac)[_0x65d6('0x2e')](_0x3263fa);}return null;};}function patchUpdates(_0x231b53){return function(_0x448814){try{jsonpatch['apply'](_0x448814,_0x231b53,!![]);}catch(_0x931543){return BPromise['reject'](_0x931543);}return _0x448814[_0x65d6('0x2f')]();};}function saveUpdates(_0x182c6e,_0x83e2b4){return function(_0x4b262f){if(_0x4b262f){return _0x4b262f['update'](_0x182c6e)[_0x65d6('0x1d')](function(_0x3bafde){return _0x3bafde;});}return null;};}function removeEntity(_0x1b1e26,_0x103f20){return function(_0x25f40d){if(_0x25f40d){return _0x25f40d[_0x65d6('0x30')]()[_0x65d6('0x1d')](function(){_0x1b1e26[_0x65d6('0x29')](0xcc)[_0x65d6('0x2a')]();});}};}function handleEntityNotFound(_0x3edf5f,_0x4f4d01){return function(_0x1b3fac){if(!_0x1b3fac){_0x3edf5f[_0x65d6('0x28')](0x194);}return _0x1b3fac;};}function handleError(_0x4c451f,_0x235f51){_0x235f51=_0x235f51||0x1f4;return function(_0x51443e){logger[_0x65d6('0x24')](_0x51443e[_0x65d6('0x31')]);if(_0x51443e[_0x65d6('0x32')]){delete _0x51443e['name'];}_0x4c451f[_0x65d6('0x29')](_0x235f51)[_0x65d6('0x33')](_0x51443e);};}exports[_0x65d6('0x34')]=function(_0x4ab7b0,_0xa59276){var _0x582789={},_0x29923b={},_0x5c650a={'count':0x0,'rows':[]};var _0x1739d4=db[_0x65d6('0x35')][_0x65d6('0x36')];_0x29923b['model']=_[_0x65d6('0x37')](_0x1739d4);_0x29923b['query']=_[_0x65d6('0x37')](_0x4ab7b0['query']);_0x29923b[_0x65d6('0x38')]=_[_0x65d6('0x39')](_0x29923b['model'],_0x29923b['query']);_0x582789[_0x65d6('0x3a')]=_['intersection'](_0x29923b[_0x65d6('0x3b')],qs[_0x65d6('0x3c')](_0x4ab7b0[_0x65d6('0x3d')]['fields']));_0x582789[_0x65d6('0x3a')]=_0x582789['attributes'][_0x65d6('0x3e')]?_0x582789[_0x65d6('0x3a')]:_0x29923b[_0x65d6('0x3b')];if(!_0x4ab7b0['query'][_0x65d6('0x3f')](_0x65d6('0x40'))){_0x582789[_0x65d6('0x41')]=qs[_0x65d6('0x41')](_0x4ab7b0[_0x65d6('0x3d')][_0x65d6('0x41')]);_0x582789['offset']=qs[_0x65d6('0x2c')](_0x4ab7b0[_0x65d6('0x3d')][_0x65d6('0x2c')]);}_0x582789[_0x65d6('0x42')]=qs[_0x65d6('0x43')](_0x4ab7b0[_0x65d6('0x3d')][_0x65d6('0x43')]);_0x582789[_0x65d6('0x44')]=qs['filters'](_[_0x65d6('0x45')](_0x4ab7b0[_0x65d6('0x3d')],_0x29923b[_0x65d6('0x38')]));if(_0x4ab7b0['query'][_0x65d6('0x46')]){_0x582789[_0x65d6('0x44')]=_[_0x65d6('0x47')](_0x582789[_0x65d6('0x44')],{'$or':_[_0x65d6('0x48')](_0x1739d4,function(_0x1eee45){if(_0x1eee45[_0x65d6('0x49')][_0x65d6('0x4a')]!==_0x65d6('0x4b')){var _0x5120d1={};_0x5120d1[_0x1eee45[_0x65d6('0x4c')]]={'$like':'%'+_0x4ab7b0[_0x65d6('0x3d')][_0x65d6('0x46')]+'%'};return _0x5120d1;}})});}_0x582789=_[_0x65d6('0x47')]({},_0x582789,_0x4ab7b0[_0x65d6('0x4d')]);var _0x43a12c={'where':_0x582789[_0x65d6('0x44')]};return db['DeskConfiguration'][_0x65d6('0x2b')](_0x43a12c)[_0x65d6('0x1d')](function(_0x8d4a40){_0x5c650a[_0x65d6('0x2b')]=_0x8d4a40;if(_0x4ab7b0[_0x65d6('0x3d')][_0x65d6('0x4e')]){_0x582789[_0x65d6('0x4f')]=[{'all':!![]}];}return db[_0x65d6('0x35')][_0x65d6('0x50')](_0x582789);})[_0x65d6('0x1d')](function(_0x515c14){_0x5c650a[_0x65d6('0x51')]=_0x515c14;return _0x5c650a;})[_0x65d6('0x1d')](respondWithFilteredResult(_0xa59276,_0x582789))[_0x65d6('0x27')](handleError(_0xa59276,null));};exports[_0x65d6('0x52')]=function(_0xa7c075,_0x5f15d1){var _0x5a4b1f={'raw':![],'where':{'id':_0xa7c075[_0x65d6('0x53')]['id']}},_0x1f6071={};_0x1f6071[_0x65d6('0x3b')]=_[_0x65d6('0x37')](db[_0x65d6('0x35')]['rawAttributes']);_0x1f6071[_0x65d6('0x3d')]=_[_0x65d6('0x37')](_0xa7c075[_0x65d6('0x3d')]);_0x1f6071['filters']=_[_0x65d6('0x39')](_0x1f6071[_0x65d6('0x3b')],_0x1f6071[_0x65d6('0x3d')]);_0x5a4b1f[_0x65d6('0x3a')]=_[_0x65d6('0x39')](_0x1f6071[_0x65d6('0x3b')],qs['fields'](_0xa7c075[_0x65d6('0x3d')][_0x65d6('0x3c')]));_0x5a4b1f[_0x65d6('0x3a')]=_0x5a4b1f[_0x65d6('0x3a')]['length']?_0x5a4b1f[_0x65d6('0x3a')]:_0x1f6071[_0x65d6('0x3b')];if(_0xa7c075['query'][_0x65d6('0x4e')]){_0x5a4b1f[_0x65d6('0x4f')]=[{'all':!![]}];}_0x5a4b1f=_[_0x65d6('0x47')]({},_0x5a4b1f,_0xa7c075[_0x65d6('0x4d')]);return db[_0x65d6('0x35')][_0x65d6('0x54')](_0x5a4b1f)[_0x65d6('0x1d')](handleEntityNotFound(_0x5f15d1,null))['then'](respondWithResult(_0x5f15d1,null))[_0x65d6('0x27')](handleError(_0x5f15d1,null));};exports[_0x65d6('0x55')]=function(_0x5174b4,_0x52f67c){return db['DeskConfiguration'][_0x65d6('0x55')](_0x5174b4[_0x65d6('0x56')],{})[_0x65d6('0x1d')](respondWithResult(_0x52f67c,0xc9))[_0x65d6('0x27')](handleError(_0x52f67c,null));};exports['update']=function(_0x486f14,_0x407b1d){if(_0x486f14[_0x65d6('0x56')]['id']){delete _0x486f14['body']['id'];}return db[_0x65d6('0x35')][_0x65d6('0x54')]({'where':{'id':_0x486f14['params']['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x407b1d,null))[_0x65d6('0x1d')](saveUpdates(_0x486f14[_0x65d6('0x56')],null))[_0x65d6('0x1d')](respondWithResult(_0x407b1d,null))['catch'](handleError(_0x407b1d,null));};exports[_0x65d6('0x30')]=function(_0x2a99ea,_0x4c32a4){return db['DeskConfiguration']['find']({'where':{'id':_0x2a99ea[_0x65d6('0x53')]['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x4c32a4,null))['then'](removeEntity(_0x4c32a4,null))[_0x65d6('0x27')](handleError(_0x4c32a4,null));};exports['getFields']=function(_0x4053d0,_0x11daa0,_0x1006f5){var _0x519e98={};var _0x45874a={};var _0x555e1f;var _0x425a74;return db['DeskConfiguration'][_0x65d6('0x57')]({'where':{'id':_0x4053d0['params']['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x11daa0,null))[_0x65d6('0x1d')](function(_0x42e82b){if(_0x42e82b){_0x555e1f=_0x42e82b;_0x45874a[_0x65d6('0x3b')]=_[_0x65d6('0x37')](db[_0x65d6('0x58')][_0x65d6('0x36')]);_0x45874a[_0x65d6('0x3d')]=_[_0x65d6('0x37')](_0x4053d0[_0x65d6('0x3d')]);_0x45874a[_0x65d6('0x38')]=_[_0x65d6('0x39')](_0x45874a[_0x65d6('0x3b')],_0x45874a['query']);_0x519e98['attributes']=_[_0x65d6('0x39')](_0x45874a[_0x65d6('0x3b')],qs[_0x65d6('0x3c')](_0x4053d0['query'][_0x65d6('0x3c')]));_0x519e98[_0x65d6('0x3a')]=_0x519e98[_0x65d6('0x3a')]['length']?_0x519e98[_0x65d6('0x3a')]:_0x45874a['model'];_0x519e98['order']=qs[_0x65d6('0x43')](_0x4053d0[_0x65d6('0x3d')][_0x65d6('0x43')]);_0x519e98[_0x65d6('0x44')]=qs['filters'](_[_0x65d6('0x45')](_0x4053d0[_0x65d6('0x3d')],_0x45874a[_0x65d6('0x38')]));if(_0x4053d0[_0x65d6('0x3d')][_0x65d6('0x46')]){_0x519e98[_0x65d6('0x44')]=_[_0x65d6('0x47')](_0x519e98[_0x65d6('0x44')],{'$or':_[_0x65d6('0x48')](_0x519e98[_0x65d6('0x3a')],function(_0x6d5d7){var _0x53aa74={};_0x53aa74[_0x6d5d7]={'$like':'%'+_0x4053d0[_0x65d6('0x3d')][_0x65d6('0x46')]+'%'};return _0x53aa74;})});}_0x519e98=_['merge']({},_0x519e98,_0x4053d0[_0x65d6('0x4d')]);return _0x555e1f['getFields'](_0x519e98);}})[_0x65d6('0x1d')](function(_0x1b2aae){if(_0x1b2aae){_0x425a74=_0x1b2aae['length'];if(!_0x4053d0[_0x65d6('0x3d')][_0x65d6('0x3f')]('nolimit')){_0x519e98[_0x65d6('0x41')]=qs['limit'](_0x4053d0[_0x65d6('0x3d')][_0x65d6('0x41')]);_0x519e98[_0x65d6('0x2c')]=qs['offset'](_0x4053d0[_0x65d6('0x3d')]['offset']);}return _0x555e1f[_0x65d6('0x59')](_0x519e98);}})[_0x65d6('0x1d')](function(_0x3c114e){if(_0x3c114e){return _0x3c114e?{'count':_0x425a74,'rows':_0x3c114e}:null;}})[_0x65d6('0x1d')](respondWithResult(_0x11daa0,null))[_0x65d6('0x27')](handleError(_0x11daa0,null));};exports[_0x65d6('0x5a')]=function(_0x13dd51,_0xf5f4c6,_0x3a575b){var _0x4e74b2={};var _0x3a29e9={};var _0x30a455;var _0x66e02e;return db['DeskConfiguration']['findOne']({'where':{'id':_0x13dd51[_0x65d6('0x53')]['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0xf5f4c6,null))[_0x65d6('0x1d')](function(_0x407136){if(_0x407136){_0x30a455=_0x407136;_0x3a29e9[_0x65d6('0x3b')]=_[_0x65d6('0x37')](db[_0x65d6('0x58')][_0x65d6('0x36')]);_0x3a29e9[_0x65d6('0x3d')]=_[_0x65d6('0x37')](_0x13dd51[_0x65d6('0x3d')]);_0x3a29e9['filters']=_[_0x65d6('0x39')](_0x3a29e9[_0x65d6('0x3b')],_0x3a29e9[_0x65d6('0x3d')]);_0x4e74b2[_0x65d6('0x3a')]=_[_0x65d6('0x39')](_0x3a29e9[_0x65d6('0x3b')],qs['fields'](_0x13dd51[_0x65d6('0x3d')][_0x65d6('0x3c')]));_0x4e74b2[_0x65d6('0x3a')]=_0x4e74b2[_0x65d6('0x3a')][_0x65d6('0x3e')]?_0x4e74b2[_0x65d6('0x3a')]:_0x3a29e9[_0x65d6('0x3b')];_0x4e74b2[_0x65d6('0x42')]=qs[_0x65d6('0x43')](_0x13dd51['query'][_0x65d6('0x43')]);_0x4e74b2[_0x65d6('0x44')]=qs[_0x65d6('0x38')](_[_0x65d6('0x45')](_0x13dd51[_0x65d6('0x3d')],_0x3a29e9[_0x65d6('0x38')]));if(_0x13dd51[_0x65d6('0x3d')][_0x65d6('0x46')]){_0x4e74b2['where']=_[_0x65d6('0x47')](_0x4e74b2['where'],{'$or':_[_0x65d6('0x48')](_0x4e74b2['attributes'],function(_0x49ef29){var _0x3f87be={};_0x3f87be[_0x49ef29]={'$like':'%'+_0x13dd51[_0x65d6('0x3d')][_0x65d6('0x46')]+'%'};return _0x3f87be;})});}_0x4e74b2=_[_0x65d6('0x47')]({},_0x4e74b2,_0x13dd51[_0x65d6('0x4d')]);return _0x30a455[_0x65d6('0x5a')](_0x4e74b2);}})[_0x65d6('0x1d')](function(_0x107495){if(_0x107495){_0x66e02e=_0x107495[_0x65d6('0x3e')];if(!_0x13dd51[_0x65d6('0x3d')][_0x65d6('0x3f')](_0x65d6('0x40'))){_0x4e74b2[_0x65d6('0x41')]=qs[_0x65d6('0x41')](_0x13dd51['query'][_0x65d6('0x41')]);_0x4e74b2['offset']=qs[_0x65d6('0x2c')](_0x13dd51['query'][_0x65d6('0x2c')]);}return _0x30a455[_0x65d6('0x5a')](_0x4e74b2);}})[_0x65d6('0x1d')](function(_0x33924d){if(_0x33924d){return _0x33924d?{'count':_0x66e02e,'rows':_0x33924d}:null;}})[_0x65d6('0x1d')](respondWithResult(_0xf5f4c6,null))['catch'](handleError(_0xf5f4c6,null));};exports[_0x65d6('0x5b')]=function(_0x12aa36,_0x2ba1ee,_0xf50553){var _0x8a4ceb={};var _0x3d65db={};var _0x2272ce;var _0x225ed7;return db['DeskConfiguration'][_0x65d6('0x57')]({'where':{'id':_0x12aa36['params']['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x2ba1ee,null))['then'](function(_0x70a7fc){if(_0x70a7fc){_0x2272ce=_0x70a7fc;_0x3d65db[_0x65d6('0x3b')]=_[_0x65d6('0x37')](db['DeskField']['rawAttributes']);_0x3d65db[_0x65d6('0x3d')]=_[_0x65d6('0x37')](_0x12aa36[_0x65d6('0x3d')]);_0x3d65db[_0x65d6('0x38')]=_[_0x65d6('0x39')](_0x3d65db[_0x65d6('0x3b')],_0x3d65db[_0x65d6('0x3d')]);_0x8a4ceb[_0x65d6('0x3a')]=_[_0x65d6('0x39')](_0x3d65db[_0x65d6('0x3b')],qs[_0x65d6('0x3c')](_0x12aa36[_0x65d6('0x3d')]['fields']));_0x8a4ceb[_0x65d6('0x3a')]=_0x8a4ceb[_0x65d6('0x3a')]['length']?_0x8a4ceb[_0x65d6('0x3a')]:_0x3d65db[_0x65d6('0x3b')];_0x8a4ceb[_0x65d6('0x42')]=qs[_0x65d6('0x43')](_0x12aa36[_0x65d6('0x3d')][_0x65d6('0x43')]);_0x8a4ceb['where']=qs[_0x65d6('0x38')](_[_0x65d6('0x45')](_0x12aa36[_0x65d6('0x3d')],_0x3d65db[_0x65d6('0x38')]));if(_0x12aa36['query'][_0x65d6('0x46')]){_0x8a4ceb[_0x65d6('0x44')]=_[_0x65d6('0x47')](_0x8a4ceb[_0x65d6('0x44')],{'$or':_[_0x65d6('0x48')](_0x8a4ceb[_0x65d6('0x3a')],function(_0x510c46){var _0x44b5c7={};_0x44b5c7[_0x510c46]={'$like':'%'+_0x12aa36['query']['filter']+'%'};return _0x44b5c7;})});}_0x8a4ceb=_[_0x65d6('0x47')]({},_0x8a4ceb,_0x12aa36[_0x65d6('0x4d')]);return _0x2272ce['getDescriptions'](_0x8a4ceb);}})[_0x65d6('0x1d')](function(_0x1a4842){if(_0x1a4842){_0x225ed7=_0x1a4842[_0x65d6('0x3e')];if(!_0x12aa36['query'][_0x65d6('0x3f')](_0x65d6('0x40'))){_0x8a4ceb[_0x65d6('0x41')]=qs['limit'](_0x12aa36[_0x65d6('0x3d')]['limit']);_0x8a4ceb['offset']=qs[_0x65d6('0x2c')](_0x12aa36['query'][_0x65d6('0x2c')]);}return _0x2272ce[_0x65d6('0x5b')](_0x8a4ceb);}})[_0x65d6('0x1d')](function(_0x3222ae){if(_0x3222ae){return _0x3222ae?{'count':_0x225ed7,'rows':_0x3222ae}:null;}})['then'](respondWithResult(_0x2ba1ee,null))[_0x65d6('0x27')](handleError(_0x2ba1ee,null));};exports[_0x65d6('0x5c')]=function(_0x373756,_0x5edc39,_0x422a23){var _0x5eec52={};var _0xf786bb={};var _0x317452;var _0x1fddf7;return db[_0x65d6('0x35')]['findOne']({'where':{'id':_0x373756['params']['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x5edc39,null))[_0x65d6('0x1d')](function(_0x3985a9){if(_0x3985a9){_0x317452=_0x3985a9;_0xf786bb[_0x65d6('0x3b')]=_[_0x65d6('0x37')](db[_0x65d6('0x5d')]['rawAttributes']);_0xf786bb['query']=_[_0x65d6('0x37')](_0x373756[_0x65d6('0x3d')]);_0xf786bb['filters']=_['intersection'](_0xf786bb[_0x65d6('0x3b')],_0xf786bb['query']);_0x5eec52[_0x65d6('0x3a')]=_[_0x65d6('0x39')](_0xf786bb[_0x65d6('0x3b')],qs[_0x65d6('0x3c')](_0x373756['query']['fields']));_0x5eec52['attributes']=_0x5eec52[_0x65d6('0x3a')][_0x65d6('0x3e')]?_0x5eec52['attributes']:_0xf786bb[_0x65d6('0x3b')];_0x5eec52[_0x65d6('0x42')]=qs[_0x65d6('0x43')](_0x373756['query'][_0x65d6('0x43')]);_0x5eec52[_0x65d6('0x44')]=qs[_0x65d6('0x38')](_[_0x65d6('0x45')](_0x373756[_0x65d6('0x3d')],_0xf786bb[_0x65d6('0x38')]));if(_0x373756[_0x65d6('0x3d')][_0x65d6('0x46')]){_0x5eec52['where']=_[_0x65d6('0x47')](_0x5eec52[_0x65d6('0x44')],{'$or':_[_0x65d6('0x48')](_0x5eec52[_0x65d6('0x3a')],function(_0x52e4fe){var _0x5a1586={};_0x5a1586[_0x52e4fe]={'$like':'%'+_0x373756[_0x65d6('0x3d')][_0x65d6('0x46')]+'%'};return _0x5a1586;})});}_0x5eec52=_[_0x65d6('0x47')]({},_0x5eec52,_0x373756[_0x65d6('0x4d')]);return _0x317452[_0x65d6('0x5c')](_0x5eec52);}})[_0x65d6('0x1d')](function(_0x1fcbb4){if(_0x1fcbb4){_0x1fddf7=_0x1fcbb4[_0x65d6('0x3e')];if(!_0x373756[_0x65d6('0x3d')][_0x65d6('0x3f')](_0x65d6('0x40'))){_0x5eec52[_0x65d6('0x41')]=qs[_0x65d6('0x41')](_0x373756['query'][_0x65d6('0x41')]);_0x5eec52['offset']=qs[_0x65d6('0x2c')](_0x373756[_0x65d6('0x3d')][_0x65d6('0x2c')]);}return _0x317452[_0x65d6('0x5c')](_0x5eec52);}})[_0x65d6('0x1d')](function(_0x568b93){if(_0x568b93){return _0x568b93?{'count':_0x1fddf7,'rows':_0x568b93}:null;}})[_0x65d6('0x1d')](respondWithResult(_0x5edc39,null))['catch'](handleError(_0x5edc39,null));};exports['setTags']=function(_0x4eac3b,_0x5b1434,_0x1a3ce1){if(_0x4eac3b['body']['id']){delete _0x4eac3b[_0x65d6('0x56')]['id'];}return db[_0x65d6('0x35')][_0x65d6('0x57')]({'where':{'id':_0x4eac3b[_0x65d6('0x53')]['id']}})[_0x65d6('0x1d')](handleEntityNotFound(_0x5b1434,null))[_0x65d6('0x1d')](function(_0x3d4140){if(_0x3d4140){return _0x3d4140[_0x65d6('0x5e')](_0x4eac3b[_0x65d6('0x56')]['ids']||[]);}return null;})[_0x65d6('0x1d')](respondWithResult(_0x5b1434,null))['catch'](handleError(_0x5b1434,null));}; \ No newline at end of file +var _0xb779=['result','catch','end','status','count','offset','set','apply','reject','update','destroy','stack','name','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','options','include','show','DeskConfiguration','rawAttributes','length','includeAll','find','create','body','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','debug','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x8b6aa4,_0x540b05){var _0x1b4673=function(_0x304363){while(--_0x304363){_0x8b6aa4['push'](_0x8b6aa4['shift']());}};_0x1b4673(++_0x540b05);}(_0xb779,0xeb));var _0x9b77=function(_0x214005,_0x507102){_0x214005=_0x214005-0x0;var _0x2dcbb6=_0xb779[_0x214005];return _0x2dcbb6;};'use strict';var pdf=require(_0x9b77('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9b77('0x1'));var zipdir=require(_0x9b77('0x2'));var jsonpatch=require(_0x9b77('0x3'));var rp=require(_0x9b77('0x4'));var moment=require(_0x9b77('0x5'));var BPromise=require(_0x9b77('0x6'));var Mustache=require(_0x9b77('0x7'));var util=require(_0x9b77('0x8'));var path=require(_0x9b77('0x9'));var sox=require(_0x9b77('0xa'));var csv=require(_0x9b77('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b77('0xc'));var squel=require('squel');var crypto=require(_0x9b77('0xd'));var jsforce=require(_0x9b77('0xe'));var deskjs=require(_0x9b77('0xf'));var toCsv=require(_0x9b77('0xb'));var querystring=require(_0x9b77('0x10'));var Papa=require(_0x9b77('0x11'));var Redis=require(_0x9b77('0x12'));var authService=require(_0x9b77('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b77('0x14'))(_0x9b77('0x15'));var utils=require(_0x9b77('0x16'));var config=require(_0x9b77('0x17'));var db=require(_0x9b77('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9b77('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x75db26,_0x3f88e6,_0x285aab){if(_0x285aab){var _0x50a3fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50a3fe[_0x9b77('0x1a')](_0x3f88e6)){return _0x75db26;}else{throw new Error(_0x9b77('0x1b'));}}else{return _0x75db26;}}function respondWithRpcPromise(_0x19fbef,_0x3bf70e,_0x622733,_0x35e9a8){return new BPromise(function(_0x5081ae,_0x6f9dfd){var _0x5adc6e=_0x35e9a8||client;return _0x5adc6e[_0x9b77('0x1c')](_0x19fbef,_0x622733)[_0x9b77('0x1d')](function(_0x5b708d){logger[_0x9b77('0x1e')]('DeskConfiguration,\x20%s,\x20%s',_0x3bf70e,'request\x20sent');logger[_0x9b77('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3bf70e,'request\x20sent',JSON[_0x9b77('0x20')](_0x5b708d));if(_0x5b708d[_0x9b77('0x21')]){if(_0x5b708d['error'][_0x9b77('0x22')]===0x1f4){logger[_0x9b77('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x3bf70e,_0x5b708d[_0x9b77('0x21')]['message']);return _0x6f9dfd(_0x5b708d[_0x9b77('0x21')][_0x9b77('0x23')]);}logger[_0x9b77('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x3bf70e,_0x5b708d['error'][_0x9b77('0x23')]);return _0x5081ae(_0x5b708d[_0x9b77('0x21')][_0x9b77('0x23')]);}else{logger['info'](_0x9b77('0x24'),_0x3bf70e,_0x9b77('0x25'));_0x5081ae(_0x5b708d[_0x9b77('0x26')][_0x9b77('0x23')]);}})[_0x9b77('0x27')](function(_0x402a5e){logger[_0x9b77('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x3bf70e,_0x402a5e);_0x6f9dfd(_0x402a5e);});});}function respondWithStatusCode(_0x3d846d,_0x11cc89){_0x11cc89=_0x11cc89||0xcc;return function(_0x43fea1){if(_0x43fea1){return _0x3d846d['sendStatus'](_0x11cc89);}return _0x3d846d['status'](_0x11cc89)[_0x9b77('0x28')]();};}function respondWithResult(_0x4c2d61,_0x462921){_0x462921=_0x462921||0xc8;return function(_0x3e0641){if(_0x3e0641){return _0x4c2d61[_0x9b77('0x29')](_0x462921)['json'](_0x3e0641);}};}function respondWithFilteredResult(_0x2bb1c2,_0x3365e7){return function(_0x487938){if(_0x487938){var _0x3b5897=_0x487938[_0x9b77('0x2a')],_0x50945e=_0x3365e7[_0x9b77('0x2b')],_0x19c3ce=_0x3365e7[_0x9b77('0x2b')]+_0x3365e7['limit'],_0x470b0f;if(_0x19c3ce>=_0x3b5897){_0x19c3ce=_0x3b5897;_0x470b0f=0xc8;}else{_0x470b0f=0xce;}_0x2bb1c2[_0x9b77('0x29')](_0x470b0f);return _0x2bb1c2[_0x9b77('0x2c')]('Content-Range',_0x50945e+'-'+_0x19c3ce+'/'+_0x3b5897)['json'](_0x487938);}return null;};}function patchUpdates(_0x117786){return function(_0x47256e){try{jsonpatch[_0x9b77('0x2d')](_0x47256e,_0x117786,!![]);}catch(_0x1ed15b){return BPromise[_0x9b77('0x2e')](_0x1ed15b);}return _0x47256e['save']();};}function saveUpdates(_0x25aa10,_0x451fb9){return function(_0xf0e686){if(_0xf0e686){return _0xf0e686[_0x9b77('0x2f')](_0x25aa10)['then'](function(_0x45520a){return _0x45520a;});}return null;};}function removeEntity(_0x41039c,_0x147eea){return function(_0x48875d){if(_0x48875d){return _0x48875d[_0x9b77('0x30')]()['then'](function(){_0x41039c[_0x9b77('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d29fc,_0x59b674){return function(_0x2abde3){if(!_0x2abde3){_0x1d29fc['sendStatus'](0x194);}return _0x2abde3;};}function handleError(_0x35eabe,_0x23a76a){_0x23a76a=_0x23a76a||0x1f4;return function(_0x1b40f3){logger[_0x9b77('0x21')](_0x1b40f3[_0x9b77('0x31')]);if(_0x1b40f3[_0x9b77('0x32')]){delete _0x1b40f3[_0x9b77('0x32')];}_0x35eabe[_0x9b77('0x29')](_0x23a76a)['send'](_0x1b40f3);};}exports['index']=function(_0x3cb142,_0x427412){var _0x2744ad={},_0x4e0190={},_0x115990={'count':0x0,'rows':[]};var _0x5d0350=db['DeskConfiguration']['rawAttributes'];_0x4e0190[_0x9b77('0x33')]=_[_0x9b77('0x34')](_0x5d0350);_0x4e0190['query']=_['keys'](_0x3cb142['query']);_0x4e0190['filters']=_['intersection'](_0x4e0190[_0x9b77('0x33')],_0x4e0190[_0x9b77('0x35')]);_0x2744ad[_0x9b77('0x36')]=_[_0x9b77('0x37')](_0x4e0190['model'],qs['fields'](_0x3cb142[_0x9b77('0x35')][_0x9b77('0x38')]));_0x2744ad[_0x9b77('0x36')]=_0x2744ad[_0x9b77('0x36')]['length']?_0x2744ad[_0x9b77('0x36')]:_0x4e0190[_0x9b77('0x33')];if(!_0x3cb142[_0x9b77('0x35')][_0x9b77('0x39')](_0x9b77('0x3a'))){_0x2744ad['limit']=qs['limit'](_0x3cb142[_0x9b77('0x35')][_0x9b77('0x3b')]);_0x2744ad['offset']=qs[_0x9b77('0x2b')](_0x3cb142[_0x9b77('0x35')][_0x9b77('0x2b')]);}_0x2744ad[_0x9b77('0x3c')]=qs[_0x9b77('0x3d')](_0x3cb142[_0x9b77('0x35')][_0x9b77('0x3d')]);_0x2744ad[_0x9b77('0x3e')]=qs['filters'](_[_0x9b77('0x3f')](_0x3cb142['query'],_0x4e0190[_0x9b77('0x40')]));if(_0x3cb142[_0x9b77('0x35')][_0x9b77('0x41')]){_0x2744ad[_0x9b77('0x3e')]=_[_0x9b77('0x42')](_0x2744ad[_0x9b77('0x3e')],{'$or':_[_0x9b77('0x43')](_0x5d0350,function(_0x4c8bf8){if(_0x4c8bf8[_0x9b77('0x44')]['key']!==_0x9b77('0x45')){var _0xa43194={};_0xa43194[_0x4c8bf8[_0x9b77('0x46')]]={'$like':'%'+_0x3cb142[_0x9b77('0x35')][_0x9b77('0x41')]+'%'};return _0xa43194;}})});}_0x2744ad=_[_0x9b77('0x42')]({},_0x2744ad,_0x3cb142[_0x9b77('0x47')]);var _0x58351d={'where':_0x2744ad[_0x9b77('0x3e')]};return db['DeskConfiguration'][_0x9b77('0x2a')](_0x58351d)[_0x9b77('0x1d')](function(_0x20dc73){_0x115990[_0x9b77('0x2a')]=_0x20dc73;if(_0x3cb142[_0x9b77('0x35')]['includeAll']){_0x2744ad[_0x9b77('0x48')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x2744ad);})['then'](function(_0x2277ea){_0x115990['rows']=_0x2277ea;return _0x115990;})['then'](respondWithFilteredResult(_0x427412,_0x2744ad))[_0x9b77('0x27')](handleError(_0x427412,null));};exports[_0x9b77('0x49')]=function(_0x394482,_0x488f95){var _0x4a5404={'raw':![],'where':{'id':_0x394482['params']['id']}},_0x4ee973={};_0x4ee973['model']=_[_0x9b77('0x34')](db[_0x9b77('0x4a')][_0x9b77('0x4b')]);_0x4ee973[_0x9b77('0x35')]=_['keys'](_0x394482[_0x9b77('0x35')]);_0x4ee973[_0x9b77('0x40')]=_[_0x9b77('0x37')](_0x4ee973[_0x9b77('0x33')],_0x4ee973[_0x9b77('0x35')]);_0x4a5404[_0x9b77('0x36')]=_[_0x9b77('0x37')](_0x4ee973[_0x9b77('0x33')],qs[_0x9b77('0x38')](_0x394482[_0x9b77('0x35')][_0x9b77('0x38')]));_0x4a5404[_0x9b77('0x36')]=_0x4a5404[_0x9b77('0x36')][_0x9b77('0x4c')]?_0x4a5404['attributes']:_0x4ee973['model'];if(_0x394482[_0x9b77('0x35')][_0x9b77('0x4d')]){_0x4a5404[_0x9b77('0x48')]=[{'all':!![]}];}_0x4a5404=_['merge']({},_0x4a5404,_0x394482[_0x9b77('0x47')]);return db['DeskConfiguration'][_0x9b77('0x4e')](_0x4a5404)[_0x9b77('0x1d')](handleEntityNotFound(_0x488f95,null))[_0x9b77('0x1d')](respondWithResult(_0x488f95,null))[_0x9b77('0x27')](handleError(_0x488f95,null));};exports[_0x9b77('0x4f')]=function(_0x3c36e2,_0x3333d0){return db[_0x9b77('0x4a')][_0x9b77('0x4f')](_0x3c36e2[_0x9b77('0x50')],{})[_0x9b77('0x1d')](respondWithResult(_0x3333d0,0xc9))[_0x9b77('0x27')](handleError(_0x3333d0,null));};exports[_0x9b77('0x2f')]=function(_0x1febb8,_0x10761e){if(_0x1febb8['body']['id']){delete _0x1febb8['body']['id'];}return db[_0x9b77('0x4a')][_0x9b77('0x4e')]({'where':{'id':_0x1febb8[_0x9b77('0x51')]['id']}})[_0x9b77('0x1d')](handleEntityNotFound(_0x10761e,null))[_0x9b77('0x1d')](saveUpdates(_0x1febb8[_0x9b77('0x50')],null))['then'](respondWithResult(_0x10761e,null))[_0x9b77('0x27')](handleError(_0x10761e,null));};exports[_0x9b77('0x30')]=function(_0x43d63a,_0xda3390){return db[_0x9b77('0x4a')][_0x9b77('0x4e')]({'where':{'id':_0x43d63a[_0x9b77('0x51')]['id']}})['then'](handleEntityNotFound(_0xda3390,null))[_0x9b77('0x1d')](removeEntity(_0xda3390,null))[_0x9b77('0x27')](handleError(_0xda3390,null));};exports[_0x9b77('0x52')]=function(_0x1e1291,_0x529338,_0x2c0d3b){var _0xe74fb5={};var _0x1daf72={};var _0x346063;var _0x30f523;return db[_0x9b77('0x4a')][_0x9b77('0x53')]({'where':{'id':_0x1e1291['params']['id']}})[_0x9b77('0x1d')](handleEntityNotFound(_0x529338,null))[_0x9b77('0x1d')](function(_0x3a82dc){if(_0x3a82dc){_0x346063=_0x3a82dc;_0x1daf72[_0x9b77('0x33')]=_[_0x9b77('0x34')](db[_0x9b77('0x54')][_0x9b77('0x4b')]);_0x1daf72[_0x9b77('0x35')]=_[_0x9b77('0x34')](_0x1e1291[_0x9b77('0x35')]);_0x1daf72[_0x9b77('0x40')]=_[_0x9b77('0x37')](_0x1daf72[_0x9b77('0x33')],_0x1daf72[_0x9b77('0x35')]);_0xe74fb5['attributes']=_['intersection'](_0x1daf72[_0x9b77('0x33')],qs[_0x9b77('0x38')](_0x1e1291[_0x9b77('0x35')][_0x9b77('0x38')]));_0xe74fb5[_0x9b77('0x36')]=_0xe74fb5['attributes'][_0x9b77('0x4c')]?_0xe74fb5['attributes']:_0x1daf72[_0x9b77('0x33')];_0xe74fb5['order']=qs[_0x9b77('0x3d')](_0x1e1291[_0x9b77('0x35')]['sort']);_0xe74fb5[_0x9b77('0x3e')]=qs['filters'](_['pick'](_0x1e1291['query'],_0x1daf72['filters']));if(_0x1e1291[_0x9b77('0x35')][_0x9b77('0x41')]){_0xe74fb5[_0x9b77('0x3e')]=_[_0x9b77('0x42')](_0xe74fb5['where'],{'$or':_[_0x9b77('0x43')](_0xe74fb5[_0x9b77('0x36')],function(_0x5a688b){var _0x3c7ed8={};_0x3c7ed8[_0x5a688b]={'$like':'%'+_0x1e1291[_0x9b77('0x35')][_0x9b77('0x41')]+'%'};return _0x3c7ed8;})});}_0xe74fb5=_[_0x9b77('0x42')]({},_0xe74fb5,_0x1e1291[_0x9b77('0x47')]);return _0x346063[_0x9b77('0x52')](_0xe74fb5);}})[_0x9b77('0x1d')](function(_0x27eb14){if(_0x27eb14){_0x30f523=_0x27eb14[_0x9b77('0x4c')];if(!_0x1e1291['query']['hasOwnProperty'](_0x9b77('0x3a'))){_0xe74fb5['limit']=qs[_0x9b77('0x3b')](_0x1e1291[_0x9b77('0x35')]['limit']);_0xe74fb5[_0x9b77('0x2b')]=qs[_0x9b77('0x2b')](_0x1e1291[_0x9b77('0x35')][_0x9b77('0x2b')]);}return _0x346063[_0x9b77('0x52')](_0xe74fb5);}})[_0x9b77('0x1d')](function(_0x42191e){if(_0x42191e){return _0x42191e?{'count':_0x30f523,'rows':_0x42191e}:null;}})[_0x9b77('0x1d')](respondWithResult(_0x529338,null))[_0x9b77('0x27')](handleError(_0x529338,null));};exports[_0x9b77('0x55')]=function(_0x15a4de,_0x48ea4a,_0x2e5d19){var _0x4732ae={};var _0x57521d={};var _0x2e7247;var _0x19562b;return db[_0x9b77('0x4a')][_0x9b77('0x53')]({'where':{'id':_0x15a4de[_0x9b77('0x51')]['id']}})[_0x9b77('0x1d')](handleEntityNotFound(_0x48ea4a,null))['then'](function(_0x39dc26){if(_0x39dc26){_0x2e7247=_0x39dc26;_0x57521d[_0x9b77('0x33')]=_['keys'](db[_0x9b77('0x54')]['rawAttributes']);_0x57521d['query']=_['keys'](_0x15a4de['query']);_0x57521d[_0x9b77('0x40')]=_[_0x9b77('0x37')](_0x57521d['model'],_0x57521d[_0x9b77('0x35')]);_0x4732ae['attributes']=_['intersection'](_0x57521d['model'],qs[_0x9b77('0x38')](_0x15a4de[_0x9b77('0x35')][_0x9b77('0x38')]));_0x4732ae['attributes']=_0x4732ae[_0x9b77('0x36')]['length']?_0x4732ae[_0x9b77('0x36')]:_0x57521d[_0x9b77('0x33')];_0x4732ae[_0x9b77('0x3c')]=qs['sort'](_0x15a4de[_0x9b77('0x35')]['sort']);_0x4732ae[_0x9b77('0x3e')]=qs[_0x9b77('0x40')](_[_0x9b77('0x3f')](_0x15a4de[_0x9b77('0x35')],_0x57521d[_0x9b77('0x40')]));if(_0x15a4de['query'][_0x9b77('0x41')]){_0x4732ae[_0x9b77('0x3e')]=_['merge'](_0x4732ae[_0x9b77('0x3e')],{'$or':_[_0x9b77('0x43')](_0x4732ae['attributes'],function(_0xf58529){var _0x2082ca={};_0x2082ca[_0xf58529]={'$like':'%'+_0x15a4de['query']['filter']+'%'};return _0x2082ca;})});}_0x4732ae=_[_0x9b77('0x42')]({},_0x4732ae,_0x15a4de['options']);return _0x2e7247[_0x9b77('0x55')](_0x4732ae);}})[_0x9b77('0x1d')](function(_0x309eea){if(_0x309eea){_0x19562b=_0x309eea['length'];if(!_0x15a4de[_0x9b77('0x35')][_0x9b77('0x39')]('nolimit')){_0x4732ae[_0x9b77('0x3b')]=qs[_0x9b77('0x3b')](_0x15a4de['query']['limit']);_0x4732ae[_0x9b77('0x2b')]=qs[_0x9b77('0x2b')](_0x15a4de[_0x9b77('0x35')][_0x9b77('0x2b')]);}return _0x2e7247[_0x9b77('0x55')](_0x4732ae);}})['then'](function(_0x5b634c){if(_0x5b634c){return _0x5b634c?{'count':_0x19562b,'rows':_0x5b634c}:null;}})[_0x9b77('0x1d')](respondWithResult(_0x48ea4a,null))[_0x9b77('0x27')](handleError(_0x48ea4a,null));};exports['getDescriptions']=function(_0x1d3930,_0x3bbe8b,_0x53eb18){var _0x42cd4f={};var _0x266c83={};var _0x2408fe;var _0x40f7c5;return db[_0x9b77('0x4a')][_0x9b77('0x53')]({'where':{'id':_0x1d3930[_0x9b77('0x51')]['id']}})[_0x9b77('0x1d')](handleEntityNotFound(_0x3bbe8b,null))[_0x9b77('0x1d')](function(_0x1bbe23){if(_0x1bbe23){_0x2408fe=_0x1bbe23;_0x266c83[_0x9b77('0x33')]=_[_0x9b77('0x34')](db[_0x9b77('0x54')][_0x9b77('0x4b')]);_0x266c83[_0x9b77('0x35')]=_[_0x9b77('0x34')](_0x1d3930[_0x9b77('0x35')]);_0x266c83['filters']=_['intersection'](_0x266c83[_0x9b77('0x33')],_0x266c83['query']);_0x42cd4f[_0x9b77('0x36')]=_[_0x9b77('0x37')](_0x266c83[_0x9b77('0x33')],qs['fields'](_0x1d3930[_0x9b77('0x35')][_0x9b77('0x38')]));_0x42cd4f[_0x9b77('0x36')]=_0x42cd4f['attributes'][_0x9b77('0x4c')]?_0x42cd4f['attributes']:_0x266c83[_0x9b77('0x33')];_0x42cd4f[_0x9b77('0x3c')]=qs[_0x9b77('0x3d')](_0x1d3930[_0x9b77('0x35')][_0x9b77('0x3d')]);_0x42cd4f[_0x9b77('0x3e')]=qs[_0x9b77('0x40')](_['pick'](_0x1d3930['query'],_0x266c83[_0x9b77('0x40')]));if(_0x1d3930[_0x9b77('0x35')][_0x9b77('0x41')]){_0x42cd4f['where']=_[_0x9b77('0x42')](_0x42cd4f['where'],{'$or':_[_0x9b77('0x43')](_0x42cd4f['attributes'],function(_0x538b35){var _0x2815a7={};_0x2815a7[_0x538b35]={'$like':'%'+_0x1d3930[_0x9b77('0x35')]['filter']+'%'};return _0x2815a7;})});}_0x42cd4f=_['merge']({},_0x42cd4f,_0x1d3930[_0x9b77('0x47')]);return _0x2408fe['getDescriptions'](_0x42cd4f);}})['then'](function(_0x28a7b4){if(_0x28a7b4){_0x40f7c5=_0x28a7b4[_0x9b77('0x4c')];if(!_0x1d3930[_0x9b77('0x35')][_0x9b77('0x39')](_0x9b77('0x3a'))){_0x42cd4f[_0x9b77('0x3b')]=qs[_0x9b77('0x3b')](_0x1d3930['query']['limit']);_0x42cd4f['offset']=qs[_0x9b77('0x2b')](_0x1d3930['query']['offset']);}return _0x2408fe[_0x9b77('0x56')](_0x42cd4f);}})[_0x9b77('0x1d')](function(_0x412a30){if(_0x412a30){return _0x412a30?{'count':_0x40f7c5,'rows':_0x412a30}:null;}})[_0x9b77('0x1d')](respondWithResult(_0x3bbe8b,null))[_0x9b77('0x27')](handleError(_0x3bbe8b,null));};exports[_0x9b77('0x57')]=function(_0x1bda0a,_0x272478,_0x49149d){var _0x382d62={};var _0x11ba1e={};var _0x382e6d;var _0x55ad57;return db['DeskConfiguration'][_0x9b77('0x53')]({'where':{'id':_0x1bda0a[_0x9b77('0x51')]['id']}})[_0x9b77('0x1d')](handleEntityNotFound(_0x272478,null))['then'](function(_0x36fd32){if(_0x36fd32){_0x382e6d=_0x36fd32;_0x11ba1e[_0x9b77('0x33')]=_[_0x9b77('0x34')](db[_0x9b77('0x58')][_0x9b77('0x4b')]);_0x11ba1e[_0x9b77('0x35')]=_[_0x9b77('0x34')](_0x1bda0a[_0x9b77('0x35')]);_0x11ba1e[_0x9b77('0x40')]=_[_0x9b77('0x37')](_0x11ba1e[_0x9b77('0x33')],_0x11ba1e[_0x9b77('0x35')]);_0x382d62[_0x9b77('0x36')]=_[_0x9b77('0x37')](_0x11ba1e[_0x9b77('0x33')],qs['fields'](_0x1bda0a[_0x9b77('0x35')]['fields']));_0x382d62[_0x9b77('0x36')]=_0x382d62[_0x9b77('0x36')][_0x9b77('0x4c')]?_0x382d62[_0x9b77('0x36')]:_0x11ba1e[_0x9b77('0x33')];_0x382d62['order']=qs['sort'](_0x1bda0a['query'][_0x9b77('0x3d')]);_0x382d62['where']=qs[_0x9b77('0x40')](_[_0x9b77('0x3f')](_0x1bda0a[_0x9b77('0x35')],_0x11ba1e['filters']));if(_0x1bda0a['query'][_0x9b77('0x41')]){_0x382d62[_0x9b77('0x3e')]=_['merge'](_0x382d62[_0x9b77('0x3e')],{'$or':_[_0x9b77('0x43')](_0x382d62[_0x9b77('0x36')],function(_0x2290a6){var _0xc91307={};_0xc91307[_0x2290a6]={'$like':'%'+_0x1bda0a[_0x9b77('0x35')][_0x9b77('0x41')]+'%'};return _0xc91307;})});}_0x382d62=_['merge']({},_0x382d62,_0x1bda0a[_0x9b77('0x47')]);return _0x382e6d[_0x9b77('0x57')](_0x382d62);}})[_0x9b77('0x1d')](function(_0x21c19c){if(_0x21c19c){_0x55ad57=_0x21c19c[_0x9b77('0x4c')];if(!_0x1bda0a[_0x9b77('0x35')][_0x9b77('0x39')](_0x9b77('0x3a'))){_0x382d62[_0x9b77('0x3b')]=qs[_0x9b77('0x3b')](_0x1bda0a[_0x9b77('0x35')][_0x9b77('0x3b')]);_0x382d62[_0x9b77('0x2b')]=qs[_0x9b77('0x2b')](_0x1bda0a[_0x9b77('0x35')][_0x9b77('0x2b')]);}return _0x382e6d[_0x9b77('0x57')](_0x382d62);}})[_0x9b77('0x1d')](function(_0x4fcf1f){if(_0x4fcf1f){return _0x4fcf1f?{'count':_0x55ad57,'rows':_0x4fcf1f}:null;}})[_0x9b77('0x1d')](respondWithResult(_0x272478,null))['catch'](handleError(_0x272478,null));};exports[_0x9b77('0x59')]=function(_0x3dbbef,_0x5e6eba,_0x21a624){if(_0x3dbbef[_0x9b77('0x50')]['id']){delete _0x3dbbef['body']['id'];}return db[_0x9b77('0x4a')]['findOne']({'where':{'id':_0x3dbbef[_0x9b77('0x51')]['id']}})['then'](handleEntityNotFound(_0x5e6eba,null))[_0x9b77('0x1d')](function(_0x265db1){if(_0x265db1){return _0x265db1[_0x9b77('0x59')](_0x3dbbef['body'][_0x9b77('0x5a')]||[]);}return null;})['then'](respondWithResult(_0x5e6eba,null))[_0x9b77('0x27')](handleError(_0x5e6eba,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0d0f04f..e2d840f 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 _0x93cc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','../../config/logger'];(function(_0x9b163,_0x5d8c8f){var _0x824910=function(_0xe93c8){while(--_0xe93c8){_0x9b163['push'](_0x9b163['shift']());}};_0x824910(++_0x5d8c8f);}(_0x93cc,0x76));var _0xc93c=function(_0x1b7bee,_0x24caee){_0x1b7bee=_0x1b7bee-0x0;var _0x8490a1=_0x93cc[_0x1b7bee];return _0x8490a1;};'use strict';var _=require(_0xc93c('0x0'));var util=require('util');var logger=require(_0xc93c('0x1'))('api');var moment=require(_0xc93c('0x2'));var BPromise=require(_0xc93c('0x3'));var rp=require(_0xc93c('0x4'));var fs=require('fs');var path=require(_0xc93c('0x5'));var rimraf=require(_0xc93c('0x6'));var config=require(_0xc93c('0x7'));var attributes=require(_0xc93c('0x8'));module[_0xc93c('0x9')]=function(_0x3114c7,_0x20738c){return _0x3114c7['define'](_0xc93c('0xa'),attributes,{'tableName':_0xc93c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ffa=['request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x2ffa,0xbe));var _0xa2ff=function(_0x3e9e00,_0x5ccf8c){_0x3e9e00=_0x3e9e00-0x0;var _0x4d3a89=_0x2ffa[_0x3e9e00];return _0x4d3a89;};'use strict';var _=require(_0xa2ff('0x0'));var util=require(_0xa2ff('0x1'));var logger=require(_0xa2ff('0x2'))(_0xa2ff('0x3'));var moment=require(_0xa2ff('0x4'));var BPromise=require(_0xa2ff('0x5'));var rp=require(_0xa2ff('0x6'));var fs=require('fs');var path=require(_0xa2ff('0x7'));var rimraf=require(_0xa2ff('0x8'));var config=require(_0xa2ff('0x9'));var attributes=require('./intDeskConfiguration.attributes');module[_0xa2ff('0xa')]=function(_0x321f6e,_0x39d068){return _0x321f6e[_0xa2ff('0xb')](_0xa2ff('0xc'),attributes,{'tableName':_0xa2ff('0xd'),'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 3d602e8..21bcef5 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 _0xdc97=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1508b0,_0x4cc814){var _0x158002=function(_0x1194f7){while(--_0x1194f7){_0x1508b0['push'](_0x1508b0['shift']());}};_0x158002(++_0x4cc814);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2001e3,_0x5b5401){_0x2001e3=_0x2001e3-0x0;var _0x3c43dc=_0xdc97[_0x2001e3];return _0x3c43dc;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file +var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x4e9a3e,_0x575ddb){var _0x26803a=function(_0xa745b8){while(--_0xa745b8){_0x4e9a3e['push'](_0x4e9a3e['shift']());}};_0x26803a(++_0x575ddb);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3d426f,_0x3aca85){_0x3d426f=_0x3d426f-0x0;var _0x36fb8a=_0xdbf5[_0x3d426f];return _0x36fb8a;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6ee7001..e8d95eb 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 _0xbc1d=['../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbc1d,0x118));var _0xdbc1=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0xbc1d[_0x34f701];return _0x3e2429;};'use strict';var multer=require(_0xdbc1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbc1('0x1'));var express=require(_0xdbc1('0x2'));var router=express[_0xdbc1('0x3')]();var auth=require(_0xdbc1('0x4'));var interaction=require(_0xdbc1('0x5'));var config=require('../../config/environment');var controller=require(_0xdbc1('0x6'));router[_0xdbc1('0x7')]('/',auth[_0xdbc1('0x8')](),controller[_0xdbc1('0x9')]);router['get'](_0xdbc1('0xa'),auth['isAuthenticated'](),controller[_0xdbc1('0xb')]);router[_0xdbc1('0xc')]('/',auth['isAuthenticated'](),controller[_0xdbc1('0xd')]);router[_0xdbc1('0xe')](_0xdbc1('0xa'),auth['isAuthenticated'](),controller[_0xdbc1('0xf')]);router[_0xdbc1('0x10')](_0xdbc1('0xa'),auth[_0xdbc1('0x8')](),controller[_0xdbc1('0x11')]);module[_0xdbc1('0x12')]=router; \ No newline at end of file +var _0xd7a6=['path','connect-timeout','express','../../components/auth/service','./intDeskField.controller','get','show','post','isAuthenticated','put','/:id','delete','destroy'];(function(_0x27f790,_0x420ec0){var _0x331750=function(_0x6f2180){while(--_0x6f2180){_0x27f790['push'](_0x27f790['shift']());}};_0x331750(++_0x420ec0);}(_0xd7a6,0x8f));var _0x6d7a=function(_0x6b6b7e,_0x1b4880){_0x6b6b7e=_0x6b6b7e-0x0;var _0xfbb274=_0xd7a6[_0x6b6b7e];return _0xfbb274;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d7a('0x0'));var timeout=require(_0x6d7a('0x1'));var express=require(_0x6d7a('0x2'));var router=express['Router']();var auth=require(_0x6d7a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d7a('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6d7a('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x6d7a('0x6')]);router[_0x6d7a('0x7')]('/',auth[_0x6d7a('0x8')](),controller['create']);router[_0x6d7a('0x9')](_0x6d7a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6d7a('0xb')](_0x6d7a('0xa'),auth[_0x6d7a('0x8')](),controller[_0x6d7a('0xc')]);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 ce1169c..401a502 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 _0xcb91=['string','variable','customVariable','STRING','BOOLEAN','ENUM'];(function(_0x56413c,_0x2491f9){var _0x50ee63=function(_0x199e1f){while(--_0x199e1f){_0x56413c['push'](_0x56413c['shift']());}};_0x50ee63(++_0x2491f9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xcb91[_0x5c72ee];return _0x231876;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),_0x1cb9('0x2'),_0x1cb9('0x3'),'keyValue'),'defaultValue':_0x1cb9('0x1')},'content':{'type':Sequelize[_0x1cb9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),'variable',_0x1cb9('0x3'))},'keyContent':{'type':Sequelize[_0x1cb9('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1cb9('0x4')]},'customField':{'type':Sequelize[_0x1cb9('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x822a4a,_0x2203e9){var _0x4f34c6=function(_0xf5f8b4){while(--_0xf5f8b4){_0x822a4a['push'](_0x822a4a['shift']());}};_0x4f34c6(++_0x2203e9);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5cb6af,_0x22eb19){_0x5cb6af=_0x5cb6af-0x0;var _0x40c735=_0xb58b[_0x5cb6af];return _0x40c735;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 145f280..66f0f47 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 _0xd0b4=['crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','end','count','offset','limit','Content-Range','json','reject','save','update','then','status','sendStatus','error','stack','name','send','index','DeskField','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xd0b4,0x15b));var _0x4d0b=function(_0x172caf,_0x4d586f){_0x172caf=_0x172caf-0x0;var _0xc93db0=_0xd0b4[_0x172caf];return _0xc93db0;};'use strict';var pdf=require(_0x4d0b('0x0'));var emlformat=require(_0x4d0b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d0b('0x2'));var jsonpatch=require(_0x4d0b('0x3'));var rp=require('request-promise');var moment=require(_0x4d0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d0b('0x5'));var util=require(_0x4d0b('0x6'));var path=require(_0x4d0b('0x7'));var sox=require(_0x4d0b('0x8'));var csv=require(_0x4d0b('0x9'));var ejs=require(_0x4d0b('0xa'));var fs=require('fs');var _=require(_0x4d0b('0xb'));var squel=require(_0x4d0b('0xc'));var crypto=require(_0x4d0b('0xd'));var jsforce=require(_0x4d0b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d0b('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d0b('0x10'));var authService=require(_0x4d0b('0x11'));var qs=require(_0x4d0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d0b('0x13'))(_0x4d0b('0x14'));var utils=require('../../config/utils');var config=require(_0x4d0b('0x15'));var db=require(_0x4d0b('0x16'))['db'];function respondWithStatusCode(_0x372c9a,_0x181656){_0x181656=_0x181656||0xcc;return function(_0x52c0ef){if(_0x52c0ef){return _0x372c9a['sendStatus'](_0x181656);}return _0x372c9a['status'](_0x181656)[_0x4d0b('0x17')]();};}function respondWithResult(_0x14887c,_0x21b378){_0x21b378=_0x21b378||0xc8;return function(_0x2755c5){if(_0x2755c5){return _0x14887c['status'](_0x21b378)['json'](_0x2755c5);}};}function respondWithFilteredResult(_0x2d4ebb,_0xb55067){return function(_0x566371){if(_0x566371){var _0x477a71=_0x566371[_0x4d0b('0x18')],_0x16e880=_0xb55067[_0x4d0b('0x19')],_0x1ace66=_0xb55067[_0x4d0b('0x19')]+_0xb55067[_0x4d0b('0x1a')],_0x4e4da3;if(_0x1ace66>=_0x477a71){_0x1ace66=_0x477a71;_0x4e4da3=0xc8;}else{_0x4e4da3=0xce;}_0x2d4ebb['status'](_0x4e4da3);return _0x2d4ebb['set'](_0x4d0b('0x1b'),_0x16e880+'-'+_0x1ace66+'/'+_0x477a71)[_0x4d0b('0x1c')](_0x566371);}return null;};}function patchUpdates(_0x33cb29){return function(_0x5b616b){try{jsonpatch['apply'](_0x5b616b,_0x33cb29,!![]);}catch(_0x2a8e3f){return BPromise[_0x4d0b('0x1d')](_0x2a8e3f);}return _0x5b616b[_0x4d0b('0x1e')]();};}function saveUpdates(_0x3177d3,_0x37b315){return function(_0x2facac){if(_0x2facac){return _0x2facac[_0x4d0b('0x1f')](_0x3177d3)[_0x4d0b('0x20')](function(_0x491903){return _0x491903;});}return null;};}function removeEntity(_0x44e41e,_0x488305){return function(_0x4f65e3){if(_0x4f65e3){return _0x4f65e3['destroy']()[_0x4d0b('0x20')](function(){_0x44e41e[_0x4d0b('0x21')](0xcc)[_0x4d0b('0x17')]();});}};}function handleEntityNotFound(_0x52c509,_0x1efd4f){return function(_0x520221){if(!_0x520221){_0x52c509[_0x4d0b('0x22')](0x194);}return _0x520221;};}function handleError(_0x4902fe,_0x219949){_0x219949=_0x219949||0x1f4;return function(_0x9d9888){logger[_0x4d0b('0x23')](_0x9d9888[_0x4d0b('0x24')]);if(_0x9d9888[_0x4d0b('0x25')]){delete _0x9d9888['name'];}_0x4902fe[_0x4d0b('0x21')](_0x219949)[_0x4d0b('0x26')](_0x9d9888);};}exports[_0x4d0b('0x27')]=function(_0x1d5b5c,_0x289af7){var _0x14f53d={},_0x4fb263={},_0x60a2de={'count':0x0,'rows':[]};var _0x44dc63=db[_0x4d0b('0x28')]['rawAttributes'];_0x4fb263[_0x4d0b('0x29')]=_[_0x4d0b('0x2a')](_0x44dc63);_0x4fb263['query']=_['keys'](_0x1d5b5c[_0x4d0b('0x2b')]);_0x4fb263[_0x4d0b('0x2c')]=_[_0x4d0b('0x2d')](_0x4fb263[_0x4d0b('0x29')],_0x4fb263[_0x4d0b('0x2b')]);_0x14f53d['attributes']=_[_0x4d0b('0x2d')](_0x4fb263[_0x4d0b('0x29')],qs[_0x4d0b('0x2e')](_0x1d5b5c[_0x4d0b('0x2b')][_0x4d0b('0x2e')]));_0x14f53d['attributes']=_0x14f53d[_0x4d0b('0x2f')]['length']?_0x14f53d[_0x4d0b('0x2f')]:_0x4fb263[_0x4d0b('0x29')];if(!_0x1d5b5c[_0x4d0b('0x2b')][_0x4d0b('0x30')](_0x4d0b('0x31'))){_0x14f53d[_0x4d0b('0x1a')]=qs[_0x4d0b('0x1a')](_0x1d5b5c[_0x4d0b('0x2b')][_0x4d0b('0x1a')]);_0x14f53d[_0x4d0b('0x19')]=qs['offset'](_0x1d5b5c[_0x4d0b('0x2b')]['offset']);}_0x14f53d[_0x4d0b('0x32')]=qs[_0x4d0b('0x33')](_0x1d5b5c[_0x4d0b('0x2b')]['sort']);_0x14f53d['where']=qs[_0x4d0b('0x2c')](_[_0x4d0b('0x34')](_0x1d5b5c[_0x4d0b('0x2b')],_0x4fb263[_0x4d0b('0x2c')]));if(_0x1d5b5c[_0x4d0b('0x2b')][_0x4d0b('0x35')]){_0x14f53d[_0x4d0b('0x36')]=_[_0x4d0b('0x37')](_0x14f53d[_0x4d0b('0x36')],{'$or':_['map'](_0x44dc63,function(_0x4de42a){if(_0x4de42a[_0x4d0b('0x38')]['key']!==_0x4d0b('0x39')){var _0x39dd86={};_0x39dd86[_0x4de42a[_0x4d0b('0x3a')]]={'$like':'%'+_0x1d5b5c[_0x4d0b('0x2b')][_0x4d0b('0x35')]+'%'};return _0x39dd86;}})});}_0x14f53d=_['merge']({},_0x14f53d,_0x1d5b5c[_0x4d0b('0x3b')]);var _0x4b6187={'where':_0x14f53d[_0x4d0b('0x36')]};return db['DeskField']['count'](_0x4b6187)[_0x4d0b('0x20')](function(_0x14f516){_0x60a2de[_0x4d0b('0x18')]=_0x14f516;if(_0x1d5b5c['query'][_0x4d0b('0x3c')]){_0x14f53d[_0x4d0b('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x4d0b('0x3e')](_0x14f53d);})[_0x4d0b('0x20')](function(_0x426954){_0x60a2de[_0x4d0b('0x3f')]=_0x426954;return _0x60a2de;})[_0x4d0b('0x20')](respondWithFilteredResult(_0x289af7,_0x14f53d))['catch'](handleError(_0x289af7,null));};exports['show']=function(_0x644cc4,_0x280e2e){var _0x49a742={'raw':!![],'where':{'id':_0x644cc4[_0x4d0b('0x40')]['id']}},_0x2f48c3={};_0x2f48c3[_0x4d0b('0x29')]=_[_0x4d0b('0x2a')](db['DeskField'][_0x4d0b('0x41')]);_0x2f48c3['query']=_[_0x4d0b('0x2a')](_0x644cc4[_0x4d0b('0x2b')]);_0x2f48c3[_0x4d0b('0x2c')]=_['intersection'](_0x2f48c3[_0x4d0b('0x29')],_0x2f48c3[_0x4d0b('0x2b')]);_0x49a742['attributes']=_[_0x4d0b('0x2d')](_0x2f48c3[_0x4d0b('0x29')],qs[_0x4d0b('0x2e')](_0x644cc4['query'][_0x4d0b('0x2e')]));_0x49a742[_0x4d0b('0x2f')]=_0x49a742[_0x4d0b('0x2f')][_0x4d0b('0x42')]?_0x49a742[_0x4d0b('0x2f')]:_0x2f48c3['model'];if(_0x644cc4['query'][_0x4d0b('0x3c')]){_0x49a742[_0x4d0b('0x3d')]=[{'all':!![]}];}_0x49a742=_[_0x4d0b('0x37')]({},_0x49a742,_0x644cc4['options']);return db[_0x4d0b('0x28')][_0x4d0b('0x43')](_0x49a742)[_0x4d0b('0x20')](handleEntityNotFound(_0x280e2e,null))[_0x4d0b('0x20')](respondWithResult(_0x280e2e,null))[_0x4d0b('0x44')](handleError(_0x280e2e,null));};exports[_0x4d0b('0x45')]=function(_0x280c5b,_0x4c1239){return db[_0x4d0b('0x28')][_0x4d0b('0x45')](_0x280c5b[_0x4d0b('0x46')],{})[_0x4d0b('0x20')](respondWithResult(_0x4c1239,0xc9))['catch'](handleError(_0x4c1239,null));};exports[_0x4d0b('0x1f')]=function(_0x49a614,_0x20c115){if(_0x49a614['body']['id']){delete _0x49a614['body']['id'];}return db['DeskField']['find']({'where':{'id':_0x49a614[_0x4d0b('0x40')]['id']}})[_0x4d0b('0x20')](handleEntityNotFound(_0x20c115,null))[_0x4d0b('0x20')](saveUpdates(_0x49a614[_0x4d0b('0x46')],null))['then'](respondWithResult(_0x20c115,null))['catch'](handleError(_0x20c115,null));};exports[_0x4d0b('0x47')]=function(_0x12cdd5,_0x38c4b8){return db['DeskField'][_0x4d0b('0x43')]({'where':{'id':_0x12cdd5[_0x4d0b('0x40')]['id']}})[_0x4d0b('0x20')](handleEntityNotFound(_0x38c4b8,null))[_0x4d0b('0x20')](removeEntity(_0x38c4b8,null))[_0x4d0b('0x44')](handleError(_0x38c4b8,null));}; \ No newline at end of file +var _0xdc98=['then','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','DeskField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xdc98,0xea));var _0x8dc9=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xdc98[_0x1d24eb];return _0x1dc576;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8dc9('0x0'));var rimraf=require(_0x8dc9('0x1'));var zipdir=require(_0x8dc9('0x2'));var jsonpatch=require(_0x8dc9('0x3'));var rp=require(_0x8dc9('0x4'));var moment=require('moment');var BPromise=require(_0x8dc9('0x5'));var Mustache=require(_0x8dc9('0x6'));var util=require(_0x8dc9('0x7'));var path=require(_0x8dc9('0x8'));var sox=require('sox');var csv=require(_0x8dc9('0x9'));var ejs=require(_0x8dc9('0xa'));var fs=require('fs');var _=require(_0x8dc9('0xb'));var squel=require(_0x8dc9('0xc'));var crypto=require(_0x8dc9('0xd'));var jsforce=require(_0x8dc9('0xe'));var deskjs=require(_0x8dc9('0xf'));var toCsv=require(_0x8dc9('0x9'));var querystring=require(_0x8dc9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8dc9('0x11'));var hardwareService=require(_0x8dc9('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8dc9('0x13'));var db=require(_0x8dc9('0x14'))['db'];function respondWithStatusCode(_0x34eedb,_0x3260b2){_0x3260b2=_0x3260b2||0xcc;return function(_0x4417f4){if(_0x4417f4){return _0x34eedb['sendStatus'](_0x3260b2);}return _0x34eedb[_0x8dc9('0x15')](_0x3260b2)[_0x8dc9('0x16')]();};}function respondWithResult(_0x575b61,_0x18a94c){_0x18a94c=_0x18a94c||0xc8;return function(_0x4ee681){if(_0x4ee681){return _0x575b61[_0x8dc9('0x15')](_0x18a94c)[_0x8dc9('0x17')](_0x4ee681);}};}function respondWithFilteredResult(_0x4a7e67,_0x562048){return function(_0x4b04b3){if(_0x4b04b3){var _0x56ba4a=_0x4b04b3[_0x8dc9('0x18')],_0x1f5e10=_0x562048[_0x8dc9('0x19')],_0x646b9e=_0x562048[_0x8dc9('0x19')]+_0x562048[_0x8dc9('0x1a')],_0x9a7749;if(_0x646b9e>=_0x56ba4a){_0x646b9e=_0x56ba4a;_0x9a7749=0xc8;}else{_0x9a7749=0xce;}_0x4a7e67[_0x8dc9('0x15')](_0x9a7749);return _0x4a7e67[_0x8dc9('0x1b')](_0x8dc9('0x1c'),_0x1f5e10+'-'+_0x646b9e+'/'+_0x56ba4a)['json'](_0x4b04b3);}return null;};}function patchUpdates(_0x3492f7){return function(_0x4aaacd){try{jsonpatch[_0x8dc9('0x1d')](_0x4aaacd,_0x3492f7,!![]);}catch(_0x43202d){return BPromise[_0x8dc9('0x1e')](_0x43202d);}return _0x4aaacd[_0x8dc9('0x1f')]();};}function saveUpdates(_0x30241c,_0x273783){return function(_0x3c8ea8){if(_0x3c8ea8){return _0x3c8ea8['update'](_0x30241c)['then'](function(_0x4f8159){return _0x4f8159;});}return null;};}function removeEntity(_0x58835e,_0x2d4326){return function(_0x549205){if(_0x549205){return _0x549205[_0x8dc9('0x20')]()['then'](function(){_0x58835e[_0x8dc9('0x15')](0xcc)[_0x8dc9('0x16')]();});}};}function handleEntityNotFound(_0x171b0b,_0x4677be){return function(_0x28b05f){if(!_0x28b05f){_0x171b0b[_0x8dc9('0x21')](0x194);}return _0x28b05f;};}function handleError(_0x4218d8,_0xac65b5){_0xac65b5=_0xac65b5||0x1f4;return function(_0x264d0b){logger['error'](_0x264d0b[_0x8dc9('0x22')]);if(_0x264d0b[_0x8dc9('0x23')]){delete _0x264d0b['name'];}_0x4218d8[_0x8dc9('0x15')](_0xac65b5)[_0x8dc9('0x24')](_0x264d0b);};}exports[_0x8dc9('0x25')]=function(_0x2843cb,_0x561e77){var _0x391ec4={},_0x47920f={},_0x4f1106={'count':0x0,'rows':[]};var _0x4c5939=db[_0x8dc9('0x26')][_0x8dc9('0x27')];_0x47920f['model']=_[_0x8dc9('0x28')](_0x4c5939);_0x47920f['query']=_[_0x8dc9('0x28')](_0x2843cb[_0x8dc9('0x29')]);_0x47920f[_0x8dc9('0x2a')]=_[_0x8dc9('0x2b')](_0x47920f[_0x8dc9('0x2c')],_0x47920f[_0x8dc9('0x29')]);_0x391ec4[_0x8dc9('0x2d')]=_[_0x8dc9('0x2b')](_0x47920f[_0x8dc9('0x2c')],qs[_0x8dc9('0x2e')](_0x2843cb[_0x8dc9('0x29')]['fields']));_0x391ec4[_0x8dc9('0x2d')]=_0x391ec4[_0x8dc9('0x2d')][_0x8dc9('0x2f')]?_0x391ec4[_0x8dc9('0x2d')]:_0x47920f[_0x8dc9('0x2c')];if(!_0x2843cb[_0x8dc9('0x29')][_0x8dc9('0x30')](_0x8dc9('0x31'))){_0x391ec4['limit']=qs[_0x8dc9('0x1a')](_0x2843cb[_0x8dc9('0x29')][_0x8dc9('0x1a')]);_0x391ec4[_0x8dc9('0x19')]=qs[_0x8dc9('0x19')](_0x2843cb['query'][_0x8dc9('0x19')]);}_0x391ec4[_0x8dc9('0x32')]=qs[_0x8dc9('0x33')](_0x2843cb[_0x8dc9('0x29')][_0x8dc9('0x33')]);_0x391ec4[_0x8dc9('0x34')]=qs[_0x8dc9('0x2a')](_[_0x8dc9('0x35')](_0x2843cb[_0x8dc9('0x29')],_0x47920f[_0x8dc9('0x2a')]));if(_0x2843cb['query'][_0x8dc9('0x36')]){_0x391ec4[_0x8dc9('0x34')]=_[_0x8dc9('0x37')](_0x391ec4[_0x8dc9('0x34')],{'$or':_[_0x8dc9('0x38')](_0x4c5939,function(_0x11eb18){if(_0x11eb18[_0x8dc9('0x39')][_0x8dc9('0x3a')]!==_0x8dc9('0x3b')){var _0x4b8904={};_0x4b8904[_0x11eb18[_0x8dc9('0x3c')]]={'$like':'%'+_0x2843cb[_0x8dc9('0x29')]['filter']+'%'};return _0x4b8904;}})});}_0x391ec4=_[_0x8dc9('0x37')]({},_0x391ec4,_0x2843cb[_0x8dc9('0x3d')]);var _0x4b541b={'where':_0x391ec4[_0x8dc9('0x34')]};return db[_0x8dc9('0x26')][_0x8dc9('0x18')](_0x4b541b)[_0x8dc9('0x3e')](function(_0x460913){_0x4f1106[_0x8dc9('0x18')]=_0x460913;if(_0x2843cb[_0x8dc9('0x29')][_0x8dc9('0x3f')]){_0x391ec4[_0x8dc9('0x40')]=[{'all':!![]}];}return db[_0x8dc9('0x26')][_0x8dc9('0x41')](_0x391ec4);})[_0x8dc9('0x3e')](function(_0x38ed3){_0x4f1106[_0x8dc9('0x42')]=_0x38ed3;return _0x4f1106;})[_0x8dc9('0x3e')](respondWithFilteredResult(_0x561e77,_0x391ec4))[_0x8dc9('0x43')](handleError(_0x561e77,null));};exports[_0x8dc9('0x44')]=function(_0xe6c8e1,_0x52a4de){var _0x4336bf={'raw':!![],'where':{'id':_0xe6c8e1[_0x8dc9('0x45')]['id']}},_0x1214d3={};_0x1214d3[_0x8dc9('0x2c')]=_[_0x8dc9('0x28')](db[_0x8dc9('0x26')][_0x8dc9('0x27')]);_0x1214d3[_0x8dc9('0x29')]=_[_0x8dc9('0x28')](_0xe6c8e1[_0x8dc9('0x29')]);_0x1214d3['filters']=_['intersection'](_0x1214d3[_0x8dc9('0x2c')],_0x1214d3['query']);_0x4336bf[_0x8dc9('0x2d')]=_[_0x8dc9('0x2b')](_0x1214d3[_0x8dc9('0x2c')],qs[_0x8dc9('0x2e')](_0xe6c8e1[_0x8dc9('0x29')][_0x8dc9('0x2e')]));_0x4336bf[_0x8dc9('0x2d')]=_0x4336bf[_0x8dc9('0x2d')][_0x8dc9('0x2f')]?_0x4336bf[_0x8dc9('0x2d')]:_0x1214d3[_0x8dc9('0x2c')];if(_0xe6c8e1[_0x8dc9('0x29')][_0x8dc9('0x3f')]){_0x4336bf[_0x8dc9('0x40')]=[{'all':!![]}];}_0x4336bf=_['merge']({},_0x4336bf,_0xe6c8e1[_0x8dc9('0x3d')]);return db[_0x8dc9('0x26')][_0x8dc9('0x46')](_0x4336bf)[_0x8dc9('0x3e')](handleEntityNotFound(_0x52a4de,null))[_0x8dc9('0x3e')](respondWithResult(_0x52a4de,null))[_0x8dc9('0x43')](handleError(_0x52a4de,null));};exports[_0x8dc9('0x47')]=function(_0x5a2a8d,_0x10f5a3){return db[_0x8dc9('0x26')][_0x8dc9('0x47')](_0x5a2a8d[_0x8dc9('0x48')],{})['then'](respondWithResult(_0x10f5a3,0xc9))['catch'](handleError(_0x10f5a3,null));};exports[_0x8dc9('0x49')]=function(_0x2cbf4c,_0x1b8ebe){if(_0x2cbf4c['body']['id']){delete _0x2cbf4c[_0x8dc9('0x48')]['id'];}return db['DeskField'][_0x8dc9('0x46')]({'where':{'id':_0x2cbf4c['params']['id']}})[_0x8dc9('0x3e')](handleEntityNotFound(_0x1b8ebe,null))[_0x8dc9('0x3e')](saveUpdates(_0x2cbf4c['body'],null))[_0x8dc9('0x3e')](respondWithResult(_0x1b8ebe,null))['catch'](handleError(_0x1b8ebe,null));};exports[_0x8dc9('0x20')]=function(_0x4d3d83,_0x5b9d24){return db[_0x8dc9('0x26')][_0x8dc9('0x46')]({'where':{'id':_0x4d3d83[_0x8dc9('0x45')]['id']}})[_0x8dc9('0x3e')](handleEntityNotFound(_0x5b9d24,null))[_0x8dc9('0x3e')](removeEntity(_0x5b9d24,null))[_0x8dc9('0x43')](handleError(_0x5b9d24,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 24cc849..fcb89c8 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 _0xcddb=['DeskField','desk_unique_index','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x22dd17,_0x3afc41){var _0x56d886=function(_0x28c512){while(--_0x28c512){_0x22dd17['push'](_0x22dd17['shift']());}};_0x56d886(++_0x3afc41);}(_0xcddb,0x195));var _0xbcdd=function(_0x47c95f,_0x5c3fa3){_0x47c95f=_0x47c95f-0x0;var _0x50979b=_0xcddb[_0x47c95f];return _0x50979b;};'use strict';var _=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var logger=require(_0xbcdd('0x2'))(_0xbcdd('0x3'));var moment=require(_0xbcdd('0x4'));var BPromise=require(_0xbcdd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbcdd('0x6'));var config=require(_0xbcdd('0x7'));var attributes=require(_0xbcdd('0x8'));module[_0xbcdd('0x9')]=function(_0x1d05e1,_0x192b4c){return _0x1d05e1[_0xbcdd('0xa')](_0xbcdd('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xbcdd('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x58bb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x236ca4,_0x92402a){var _0x4e8a9a=function(_0x523b03){while(--_0x523b03){_0x236ca4['push'](_0x236ca4['shift']());}};_0x4e8a9a(++_0x92402a);}(_0x58bb,0x1a7));var _0xb58b=function(_0x8845c3,_0x45fb8e){_0x8845c3=_0x8845c3-0x0;var _0x250317=_0x58bb[_0x8845c3];return _0x250317;};'use strict';var _=require(_0xb58b('0x0'));var util=require(_0xb58b('0x1'));var logger=require(_0xb58b('0x2'))(_0xb58b('0x3'));var moment=require(_0xb58b('0x4'));var BPromise=require(_0xb58b('0x5'));var rp=require(_0xb58b('0x6'));var fs=require('fs');var path=require(_0xb58b('0x7'));var rimraf=require(_0xb58b('0x8'));var config=require('../../config/environment');var attributes=require(_0xb58b('0x9'));module[_0xb58b('0xa')]=function(_0x5ef06f,_0xa91b75){return _0x5ef06f[_0xb58b('0xb')](_0xb58b('0xc'),attributes,{'tableName':_0xb58b('0xd'),'paranoid':![],'indexes':[{'name':_0xb58b('0xe'),'fields':[_0xb58b('0xf'),_0xb58b('0x10')],'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 17ea52d..18a1eec 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 _0x4ea3=['DeskField,\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','DeskField,\x20%s,\x20%s'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'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')]('DeskField,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file +var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x56815e,_0xb2941d){var _0x3c1038=function(_0x315ead){while(--_0x315ead){_0x56815e['push'](_0x56815e['shift']());}};_0x3c1038(++_0xb2941d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x9ed6d4,_0x231566){_0x9ed6d4=_0x9ed6d4-0x0;var _0x2f235e=_0x4c4e[_0x9ed6d4];return _0x2f235e;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('DeskField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('DeskField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 06bd210..fd66bc3 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 _0xb7dd=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy'];(function(_0x33d277,_0x502430){var _0x14f919=function(_0x4b9288){while(--_0x4b9288){_0x33d277['push'](_0x33d277['shift']());}};_0x14f919(++_0x502430);}(_0xb7dd,0x169));var _0xdb7d=function(_0x1bd300,_0x51e0fa){_0x1bd300=_0x1bd300-0x0;var _0x53119a=_0xb7dd[_0x1bd300];return _0x53119a;};'use strict';var multer=require(_0xdb7d('0x0'));var util=require('util');var path=require(_0xdb7d('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb7d('0x2'));var router=express[_0xdb7d('0x3')]();var auth=require(_0xdb7d('0x4'));var interaction=require(_0xdb7d('0x5'));var config=require(_0xdb7d('0x6'));var controller=require(_0xdb7d('0x7'));router['get']('/',auth[_0xdb7d('0x8')](),controller[_0xdb7d('0x9')]);router[_0xdb7d('0xa')](_0xdb7d('0xb'),auth[_0xdb7d('0x8')](),controller[_0xdb7d('0xc')]);router['get'](_0xdb7d('0xd'),auth[_0xdb7d('0x8')](),controller[_0xdb7d('0xe')]);router['get'](_0xdb7d('0xf'),auth['isAuthenticated'](),controller[_0xdb7d('0x10')]);router[_0xdb7d('0x11')]('/',auth[_0xdb7d('0x8')](),controller[_0xdb7d('0x12')]);router[_0xdb7d('0x11')]('/:id/configurations',auth[_0xdb7d('0x8')](),controller['addConfiguration']);router[_0xdb7d('0x13')](_0xdb7d('0xb'),auth['isAuthenticated'](),controller[_0xdb7d('0x14')]);router[_0xdb7d('0x15')](_0xdb7d('0xb'),auth[_0xdb7d('0x8')](),controller[_0xdb7d('0x16')]);module[_0xdb7d('0x17')]=router; \ No newline at end of file +var _0xe098=['get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe098,0x194));var _0x8e09=function(_0x238085,_0x5f11d6){_0x238085=_0x238085-0x0;var _0x5ea387=_0xe098[_0x238085];return _0x5ea387;};'use strict';var multer=require(_0x8e09('0x0'));var util=require('util');var path=require(_0x8e09('0x1'));var timeout=require(_0x8e09('0x2'));var express=require(_0x8e09('0x3'));var router=express[_0x8e09('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8e09('0x5'));var config=require(_0x8e09('0x6'));var controller=require(_0x8e09('0x7'));router['get']('/',auth[_0x8e09('0x8')](),controller[_0x8e09('0x9')]);router[_0x8e09('0xa')](_0x8e09('0xb'),auth[_0x8e09('0x8')](),controller[_0x8e09('0xc')]);router[_0x8e09('0xa')](_0x8e09('0xd'),auth['isAuthenticated'](),controller[_0x8e09('0xe')]);router[_0x8e09('0xa')](_0x8e09('0xf'),auth[_0x8e09('0x8')](),controller[_0x8e09('0x10')]);router[_0x8e09('0x11')]('/',auth[_0x8e09('0x8')](),controller['create']);router[_0x8e09('0x11')](_0x8e09('0xd'),auth[_0x8e09('0x8')](),controller[_0x8e09('0x12')]);router[_0x8e09('0x13')](_0x8e09('0xb'),auth[_0x8e09('0x8')](),controller[_0x8e09('0x14')]);router[_0x8e09('0x15')](_0x8e09('0xb'),auth['isAuthenticated'](),controller[_0x8e09('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d81075c..3a70c83 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 _0x1f10=['STRING','exports'];(function(_0x2031c2,_0x130bcd){var _0x5ef1e7=function(_0x3d6dab){while(--_0x3d6dab){_0x2031c2['push'](_0x2031c2['shift']());}};_0x5ef1e7(++_0x130bcd);}(_0x1f10,0x1ef));var _0x01f1=function(_0x17099d,_0x5ea71e){_0x17099d=_0x17099d-0x0;var _0x4f67c6=_0x1f10[_0x17099d];return _0x4f67c6;};'use strict';var Sequelize=require('sequelize');module[_0x01f1('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x01f1('0x1')]},'password':{'type':Sequelize[_0x01f1('0x1')]},'remoteUri':{'type':Sequelize[_0x01f1('0x1')]},'tenantId':{'type':Sequelize[_0x01f1('0x1')]},'clientId':{'type':Sequelize[_0x01f1('0x1')]},'clientSecret':{'type':Sequelize[_0x01f1('0x1')]},'serverUrl':{'type':Sequelize[_0x01f1('0x1')]},'description':{'type':Sequelize[_0x01f1('0x1')]}}; \ No newline at end of file +var _0x1122=['exports','STRING'];(function(_0x19def8,_0x3c40af){var _0x3e4efa=function(_0x449562){while(--_0x449562){_0x19def8['push'](_0x19def8['shift']());}};_0x3e4efa(++_0x3c40af);}(_0x1122,0x104));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2112('0x0')]={'name':{'type':Sequelize[_0x2112('0x1')]},'username':{'type':Sequelize[_0x2112('0x1')]},'password':{'type':Sequelize[_0x2112('0x1')]},'remoteUri':{'type':Sequelize[_0x2112('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2112('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2112('0x1')]},'description':{'type':Sequelize[_0x2112('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 526847b..a95d451 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 _0x0d6a=['to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','sendStatus','name','index','Dynamics365Account','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','findAll','rows','show','intersection','includeAll','find','create','body','params','findOne','Dynamics365Configuration','filter','addConfiguration','Subjects','channel','Dynamics365Field','Descriptions','getFields','ticketType','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','directioncode','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','https://login.microsoftonline.com/','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','forEach','@odata.type','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x28333,_0x4c1a78){var _0x4e7615=function(_0x3ed8aa){while(--_0x3ed8aa){_0x28333['push'](_0x28333['shift']());}};_0x4e7615(++_0x4c1a78);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x0d6a[_0x5d80de];return _0x1c7556;};'use strict';var pdf=require(_0xa0d6('0x0'));var emlformat=require(_0xa0d6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa0d6('0x2'));var jsonpatch=require(_0xa0d6('0x3'));var rp=require(_0xa0d6('0x4'));var moment=require(_0xa0d6('0x5'));var BPromise=require(_0xa0d6('0x6'));var Mustache=require(_0xa0d6('0x7'));var util=require(_0xa0d6('0x8'));var path=require(_0xa0d6('0x9'));var sox=require(_0xa0d6('0xa'));var csv=require(_0xa0d6('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0d6('0xc'));var squel=require(_0xa0d6('0xd'));var crypto=require(_0xa0d6('0xe'));var jsforce=require(_0xa0d6('0xf'));var deskjs=require(_0xa0d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa0d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xa0d6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa0d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0d6('0x14'))(_0xa0d6('0x15'));var utils=require(_0xa0d6('0x16'));var config=require(_0xa0d6('0x17'));var db=require(_0xa0d6('0x18'))['db'];var integrations=require(_0xa0d6('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xa0d6('0x1a')][_0xa0d6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x27aa06,_0x5db766,_0x1d395e){if(_0x1d395e){var _0x216b3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x216b3b[_0xa0d6('0x1c')](_0x5db766)){return _0x27aa06;}else{throw new Error(_0xa0d6('0x1d'));}}else{return _0x27aa06;}}function respondWithRpcPromise(_0x3c3c15,_0x3fcfb7,_0x25ff19,_0x4a0f3a){return new BPromise(function(_0x5ddf29,_0x39e63f){var _0x3f8ed3=_0x4a0f3a||client;return _0x3f8ed3[_0xa0d6('0x1e')](_0x3c3c15,_0x25ff19)[_0xa0d6('0x1f')](function(_0x1e8b82){logger[_0xa0d6('0x20')](_0xa0d6('0x21'),_0x3fcfb7,'request\x20sent');logger[_0xa0d6('0x22')](_0xa0d6('0x23'),_0x3fcfb7,_0xa0d6('0x24'),JSON['stringify'](_0x1e8b82));if(_0x1e8b82[_0xa0d6('0x25')]){if(_0x1e8b82['error'][_0xa0d6('0x26')]===0x1f4){logger['error'](_0xa0d6('0x21'),_0x3fcfb7,_0x1e8b82[_0xa0d6('0x25')][_0xa0d6('0x27')]);return _0x39e63f(_0x1e8b82[_0xa0d6('0x25')][_0xa0d6('0x27')]);}logger[_0xa0d6('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x3fcfb7,_0x1e8b82[_0xa0d6('0x25')][_0xa0d6('0x27')]);return _0x5ddf29(_0x1e8b82['error'][_0xa0d6('0x27')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3fcfb7,_0xa0d6('0x24'));_0x5ddf29(_0x1e8b82[_0xa0d6('0x28')][_0xa0d6('0x27')]);}})[_0xa0d6('0x29')](function(_0x469c42){logger[_0xa0d6('0x25')](_0xa0d6('0x21'),_0x3fcfb7,_0x469c42);_0x39e63f(_0x469c42);});});}function respondWithStatusCode(_0x10b37f,_0x3f15d0){_0x3f15d0=_0x3f15d0||0xcc;return function(_0x338b17){if(_0x338b17){return _0x10b37f['sendStatus'](_0x3f15d0);}return _0x10b37f[_0xa0d6('0x2a')](_0x3f15d0)[_0xa0d6('0x2b')]();};}function respondWithResult(_0x621e42,_0x2656c5){_0x2656c5=_0x2656c5||0xc8;return function(_0x173838){if(_0x173838){return _0x621e42[_0xa0d6('0x2a')](_0x2656c5)[_0xa0d6('0x2c')](_0x173838);}};}function respondWithFilteredResult(_0x437150,_0xcb7cf2){return function(_0x28abb2){if(_0x28abb2){var _0x3ba11c=_0x28abb2[_0xa0d6('0x2d')],_0x7d731f=_0xcb7cf2[_0xa0d6('0x2e')],_0x414b84=_0xcb7cf2[_0xa0d6('0x2e')]+_0xcb7cf2[_0xa0d6('0x2f')],_0x382a37;if(_0x414b84>=_0x3ba11c){_0x414b84=_0x3ba11c;_0x382a37=0xc8;}else{_0x382a37=0xce;}_0x437150[_0xa0d6('0x2a')](_0x382a37);return _0x437150[_0xa0d6('0x30')](_0xa0d6('0x31'),_0x7d731f+'-'+_0x414b84+'/'+_0x3ba11c)[_0xa0d6('0x2c')](_0x28abb2);}return null;};}function patchUpdates(_0xa62bf6){return function(_0x471984){try{jsonpatch['apply'](_0x471984,_0xa62bf6,!![]);}catch(_0x1a811f){return BPromise['reject'](_0x1a811f);}return _0x471984[_0xa0d6('0x32')]();};}function saveUpdates(_0x266675,_0x369196){return function(_0x525c40){if(_0x525c40){return _0x525c40[_0xa0d6('0x33')](_0x266675)[_0xa0d6('0x1f')](function(_0x5e7084){return _0x5e7084;});}return null;};}function removeEntity(_0x28f597,_0x4253b4){return function(_0x556746){if(_0x556746){return _0x556746[_0xa0d6('0x34')]()[_0xa0d6('0x1f')](function(){_0x28f597['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e48dc,_0x161cda){return function(_0x5e5be8){if(!_0x5e5be8){_0x2e48dc[_0xa0d6('0x35')](0x194);}return _0x5e5be8;};}function handleError(_0x2f8a3c,_0x4d5dc4){_0x4d5dc4=_0x4d5dc4||0x1f4;return function(_0xe323b1){logger[_0xa0d6('0x25')](_0xe323b1['stack']);if(_0xe323b1[_0xa0d6('0x36')]){delete _0xe323b1[_0xa0d6('0x36')];}_0x2f8a3c['status'](_0x4d5dc4)['send'](_0xe323b1);};}exports[_0xa0d6('0x37')]=function(_0x2d84c2,_0xd13f64){var _0x4369fd={},_0x5aba86={},_0x41fbe3={'count':0x0,'rows':[]};var _0x4dbdaa=db[_0xa0d6('0x38')][_0xa0d6('0x39')];_0x5aba86[_0xa0d6('0x3a')]=_[_0xa0d6('0x3b')](_0x4dbdaa);_0x5aba86[_0xa0d6('0x3c')]=_[_0xa0d6('0x3b')](_0x2d84c2[_0xa0d6('0x3c')]);_0x5aba86[_0xa0d6('0x3d')]=_['intersection'](_0x5aba86[_0xa0d6('0x3a')],_0x5aba86[_0xa0d6('0x3c')]);_0x4369fd[_0xa0d6('0x3e')]=_['intersection'](_0x5aba86['model'],qs[_0xa0d6('0x3f')](_0x2d84c2['query'][_0xa0d6('0x3f')]));_0x4369fd[_0xa0d6('0x3e')]=_0x4369fd['attributes'][_0xa0d6('0x40')]?_0x4369fd[_0xa0d6('0x3e')]:_0x5aba86[_0xa0d6('0x3a')];if(!_0x2d84c2[_0xa0d6('0x3c')][_0xa0d6('0x41')](_0xa0d6('0x42'))){_0x4369fd['limit']=qs[_0xa0d6('0x2f')](_0x2d84c2[_0xa0d6('0x3c')][_0xa0d6('0x2f')]);_0x4369fd[_0xa0d6('0x2e')]=qs[_0xa0d6('0x2e')](_0x2d84c2['query'][_0xa0d6('0x2e')]);}_0x4369fd[_0xa0d6('0x43')]=qs['sort'](_0x2d84c2[_0xa0d6('0x3c')][_0xa0d6('0x44')]);_0x4369fd[_0xa0d6('0x45')]=qs[_0xa0d6('0x3d')](_[_0xa0d6('0x46')](_0x2d84c2[_0xa0d6('0x3c')],_0x5aba86[_0xa0d6('0x3d')]));if(_0x2d84c2[_0xa0d6('0x3c')]['filter']){_0x4369fd['where']=_[_0xa0d6('0x47')](_0x4369fd[_0xa0d6('0x45')],{'$or':_[_0xa0d6('0x48')](_0x4dbdaa,function(_0x1fbc49){if(_0x1fbc49[_0xa0d6('0x49')][_0xa0d6('0x4a')]!==_0xa0d6('0x4b')){var _0x256a8b={};_0x256a8b[_0x1fbc49[_0xa0d6('0x4c')]]={'$like':'%'+_0x2d84c2[_0xa0d6('0x3c')]['filter']+'%'};return _0x256a8b;}})});}_0x4369fd=_[_0xa0d6('0x47')]({},_0x4369fd,_0x2d84c2[_0xa0d6('0x4d')]);var _0x222a5b={'where':_0x4369fd[_0xa0d6('0x45')]};return db['Dynamics365Account'][_0xa0d6('0x2d')](_0x222a5b)[_0xa0d6('0x1f')](function(_0x362199){_0x41fbe3[_0xa0d6('0x2d')]=_0x362199;if(_0x2d84c2[_0xa0d6('0x3c')]['includeAll']){_0x4369fd['include']=[{'all':!![]}];}return db[_0xa0d6('0x38')][_0xa0d6('0x4e')](_0x4369fd);})[_0xa0d6('0x1f')](function(_0x585b82){_0x41fbe3[_0xa0d6('0x4f')]=_0x585b82;return _0x41fbe3;})['then'](respondWithFilteredResult(_0xd13f64,_0x4369fd))[_0xa0d6('0x29')](handleError(_0xd13f64,null));};exports[_0xa0d6('0x50')]=function(_0x5f49ff,_0x190f30){var _0x2e29e2={'raw':![],'where':{'id':_0x5f49ff['params']['id']}},_0x3739df={};_0x3739df[_0xa0d6('0x3a')]=_[_0xa0d6('0x3b')](db[_0xa0d6('0x38')][_0xa0d6('0x39')]);_0x3739df[_0xa0d6('0x3c')]=_[_0xa0d6('0x3b')](_0x5f49ff[_0xa0d6('0x3c')]);_0x3739df[_0xa0d6('0x3d')]=_[_0xa0d6('0x51')](_0x3739df[_0xa0d6('0x3a')],_0x3739df['query']);_0x2e29e2['attributes']=_[_0xa0d6('0x51')](_0x3739df[_0xa0d6('0x3a')],qs[_0xa0d6('0x3f')](_0x5f49ff[_0xa0d6('0x3c')][_0xa0d6('0x3f')]));_0x2e29e2[_0xa0d6('0x3e')]=_0x2e29e2['attributes'][_0xa0d6('0x40')]?_0x2e29e2['attributes']:_0x3739df[_0xa0d6('0x3a')];if(_0x5f49ff[_0xa0d6('0x3c')][_0xa0d6('0x52')]){_0x2e29e2['include']=[{'all':!![]}];}_0x2e29e2=_[_0xa0d6('0x47')]({},_0x2e29e2,_0x5f49ff[_0xa0d6('0x4d')]);return db[_0xa0d6('0x38')][_0xa0d6('0x53')](_0x2e29e2)['then'](handleEntityNotFound(_0x190f30,null))[_0xa0d6('0x1f')](respondWithResult(_0x190f30,null))[_0xa0d6('0x29')](handleError(_0x190f30,null));};exports[_0xa0d6('0x54')]=function(_0x5eceb7,_0x1526d6){return db['Dynamics365Account']['create'](_0x5eceb7[_0xa0d6('0x55')],{})[_0xa0d6('0x1f')](respondWithResult(_0x1526d6,0xc9))[_0xa0d6('0x29')](handleError(_0x1526d6,null));};exports[_0xa0d6('0x33')]=function(_0xdc1751,_0x17bf7f){if(_0xdc1751[_0xa0d6('0x55')]['id']){delete _0xdc1751[_0xa0d6('0x55')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0xdc1751[_0xa0d6('0x56')]['id']}})['then'](handleEntityNotFound(_0x17bf7f,null))[_0xa0d6('0x1f')](saveUpdates(_0xdc1751[_0xa0d6('0x55')],null))[_0xa0d6('0x1f')](respondWithResult(_0x17bf7f,null))[_0xa0d6('0x29')](handleError(_0x17bf7f,null));};exports[_0xa0d6('0x34')]=function(_0x1a361c,_0x5cce68){return db[_0xa0d6('0x38')]['find']({'where':{'id':_0x1a361c['params']['id']}})[_0xa0d6('0x1f')](handleEntityNotFound(_0x5cce68,null))[_0xa0d6('0x1f')](removeEntity(_0x5cce68,null))[_0xa0d6('0x29')](handleError(_0x5cce68,null));};exports['getConfigurations']=function(_0x207aef,_0x1bd2d9,_0x11055f){var _0x256dd9={};var _0x2f87bc={};var _0x537cc4;var _0x1614aa;return db[_0xa0d6('0x38')][_0xa0d6('0x57')]({'where':{'id':_0x207aef[_0xa0d6('0x56')]['id']}})[_0xa0d6('0x1f')](handleEntityNotFound(_0x1bd2d9,null))[_0xa0d6('0x1f')](function(_0x19dc08){if(_0x19dc08){_0x537cc4=_0x19dc08;_0x2f87bc['model']=_['keys'](db[_0xa0d6('0x58')][_0xa0d6('0x39')]);_0x2f87bc[_0xa0d6('0x3c')]=_[_0xa0d6('0x3b')](_0x207aef[_0xa0d6('0x3c')]);_0x2f87bc[_0xa0d6('0x3d')]=_['intersection'](_0x2f87bc[_0xa0d6('0x3a')],_0x2f87bc['query']);_0x256dd9[_0xa0d6('0x3e')]=_[_0xa0d6('0x51')](_0x2f87bc['model'],qs[_0xa0d6('0x3f')](_0x207aef['query'][_0xa0d6('0x3f')]));_0x256dd9['attributes']=_0x256dd9[_0xa0d6('0x3e')]['length']?_0x256dd9['attributes']:_0x2f87bc[_0xa0d6('0x3a')];_0x256dd9['order']=qs[_0xa0d6('0x44')](_0x207aef[_0xa0d6('0x3c')][_0xa0d6('0x44')]);_0x256dd9['where']=qs[_0xa0d6('0x3d')](_[_0xa0d6('0x46')](_0x207aef[_0xa0d6('0x3c')],_0x2f87bc[_0xa0d6('0x3d')]));if(_0x207aef['query'][_0xa0d6('0x59')]){_0x256dd9[_0xa0d6('0x45')]=_[_0xa0d6('0x47')](_0x256dd9[_0xa0d6('0x45')],{'$or':_[_0xa0d6('0x48')](_0x256dd9[_0xa0d6('0x3e')],function(_0x39051d){var _0x2e6caf={};_0x2e6caf[_0x39051d]={'$like':'%'+_0x207aef[_0xa0d6('0x3c')][_0xa0d6('0x59')]+'%'};return _0x2e6caf;})});}_0x256dd9=_[_0xa0d6('0x47')]({},_0x256dd9,_0x207aef[_0xa0d6('0x4d')]);return _0x537cc4['getConfigurations'](_0x256dd9);}})[_0xa0d6('0x1f')](function(_0x3d3e4d){if(_0x3d3e4d){_0x1614aa=_0x3d3e4d[_0xa0d6('0x40')];if(!_0x207aef[_0xa0d6('0x3c')][_0xa0d6('0x41')](_0xa0d6('0x42'))){_0x256dd9['limit']=qs[_0xa0d6('0x2f')](_0x207aef[_0xa0d6('0x3c')][_0xa0d6('0x2f')]);_0x256dd9['offset']=qs[_0xa0d6('0x2e')](_0x207aef[_0xa0d6('0x3c')][_0xa0d6('0x2e')]);}return _0x537cc4['getConfigurations'](_0x256dd9);}})[_0xa0d6('0x1f')](function(_0xcffab2){if(_0xcffab2){return _0xcffab2?{'count':_0x1614aa,'rows':_0xcffab2}:null;}})[_0xa0d6('0x1f')](respondWithResult(_0x1bd2d9,null))[_0xa0d6('0x29')](handleError(_0x1bd2d9,null));};exports[_0xa0d6('0x5a')]=function(_0x38a6a5,_0x1169e1,_0x4d6eba){if(_0x38a6a5['body']['id']){delete _0x38a6a5['body']['id'];}return db[_0xa0d6('0x38')][_0xa0d6('0x57')]({'where':{'id':_0x38a6a5[_0xa0d6('0x56')]['id']}})['then'](handleEntityNotFound(_0x1169e1,null))[_0xa0d6('0x1f')](function(_0x5a9aa3){if(_0x5a9aa3){_0x38a6a5[_0xa0d6('0x55')]['AccountId']=_0x5a9aa3['id'];_0x38a6a5['body'][_0xa0d6('0x5b')]=integrations['getSubjects'](_0x38a6a5[_0xa0d6('0x55')]['channel'],_0x38a6a5['body']['type']);_0x38a6a5[_0xa0d6('0x55')]['Descriptions']=integrations['getDescriptions'](_0x38a6a5['body'][_0xa0d6('0x5c')],_0x38a6a5[_0xa0d6('0x55')][_0xa0d6('0x49')]);return db[_0xa0d6('0x58')][_0xa0d6('0x54')](_0x38a6a5[_0xa0d6('0x55')],{'include':[{'model':db[_0xa0d6('0x5d')],'as':_0xa0d6('0x5b')},{'model':db[_0xa0d6('0x5d')],'as':_0xa0d6('0x5e')}]});}return null;})[_0xa0d6('0x1f')](respondWithResult(_0x1169e1,null))[_0xa0d6('0x29')](handleError(_0x1169e1,null));};exports[_0xa0d6('0x5f')]=function(_0x55ee1b,_0x1cb860,_0x4e0483){var _0x246e21=_0x55ee1b['query'][_0xa0d6('0x60')];var _0x12a8f0=_0x246e21==='incident'?_0xa0d6('0x61'):_0xa0d6('0x62');var _0x401f73='';var _0x534d8c='';var _0x1fcd5e='';var _0x31a59b='';var _0x2ab3a0='';var _0x413218='';var _0x17581c='';var _0x4ce1cf='';var _0x4b3a55=[_0xa0d6('0x63'),'description',_0xa0d6('0x64'),_0xa0d6('0x65'),_0xa0d6('0x66'),'subject','phonenumber','regardingobjectid',_0xa0d6('0x67'),_0xa0d6('0x68')];var _0x482aa1=['accountidname','accountidyominame',_0xa0d6('0x69'),_0xa0d6('0x6a'),_0xa0d6('0x6b'),'contactidyominame',_0xa0d6('0x6c'),_0xa0d6('0x6d'),_0xa0d6('0x6e'),_0xa0d6('0x6f'),_0xa0d6('0x70'),_0xa0d6('0x71'),_0xa0d6('0x72'),_0xa0d6('0x73'),_0xa0d6('0x74'),_0xa0d6('0x75'),'customeridtype',_0xa0d6('0x76'),_0xa0d6('0x77'),_0xa0d6('0x78'),_0xa0d6('0x79'),_0xa0d6('0x7a'),_0xa0d6('0x7b'),'exchangerate',_0xa0d6('0x7c'),_0xa0d6('0x7d'),'importsequencenumber',_0xa0d6('0x7e'),_0xa0d6('0x7f'),'lastonholdtime','masteridname',_0xa0d6('0x80'),_0xa0d6('0x81'),_0xa0d6('0x82'),_0xa0d6('0x83'),_0xa0d6('0x84'),_0xa0d6('0x85'),_0xa0d6('0x86'),_0xa0d6('0x87'),'msdyn_iotalertname','numberofchildincidents',_0xa0d6('0x88'),'overriddencreatedon','owneridname',_0xa0d6('0x89'),'owneridyominame',_0xa0d6('0x8a'),'primarycontactidname',_0xa0d6('0x8b'),_0xa0d6('0x8c'),_0xa0d6('0x8d'),'productserialnumber',_0xa0d6('0x8e'),_0xa0d6('0x8f'),_0xa0d6('0x90'),_0xa0d6('0x91'),_0xa0d6('0x92'),_0xa0d6('0x93'),_0xa0d6('0x94'),_0xa0d6('0x95'),_0xa0d6('0x96'),_0xa0d6('0x97'),'statuscode',_0xa0d6('0x98'),_0xa0d6('0x99'),'timezoneruleversionnumber',_0xa0d6('0x9a'),_0xa0d6('0x9b'),_0xa0d6('0x9c'),_0xa0d6('0x9d')];var _0x16561e=_0x4b3a55[_0xa0d6('0x9e')](_0x482aa1);return db['Dynamics365Account'][_0xa0d6('0x57')]({'where':{'id':_0x55ee1b[_0xa0d6('0x56')]['id']},'attributes':['id',_0xa0d6('0x9f'),'password',_0xa0d6('0xa0'),_0xa0d6('0xa1'),'clientId',_0xa0d6('0xa2')]})[_0xa0d6('0x1f')](handleEntityNotFound(_0x1cb860,null))['then'](function(_0x394831){if(_0x394831){_0x4ce1cf=_0x394831[_0xa0d6('0xa0')];var _0x1bb4e8=_0x4ce1cf[_0xa0d6('0xa3')](-0x1);if(_0x1bb4e8==='/'){_0x4ce1cf=_0x4ce1cf[_0xa0d6('0xa4')](0x0,_0x4ce1cf[_0xa0d6('0xa5')](_0x1bb4e8));}_0x17581c=util['format']('%s/api/data/v9.0/',_0x4ce1cf);var _0x557a62={'method':'POST','uri':_0xa0d6('0xa6')+_0x394831[_0xa0d6('0xa1')]+'/oauth2/token','form':{'client_id':_0x394831['clientId'],'resource':_0x4ce1cf,'username':_0x394831[_0xa0d6('0x9f')],'password':_0x394831[_0xa0d6('0xa7')],'grant_type':'password','client_secret':_0x394831[_0xa0d6('0xa2')]},'json':!![]};return rp(_0x557a62);}})[_0xa0d6('0x1f')](function(_0x149b1c){_0x413218=_0x149b1c['access_token'];var _0xc817fb={'method':_0xa0d6('0xa8'),'uri':encodeURI(_0x17581c+_0xa0d6('0xa9')+_0x12a8f0+'\x27'),'headers':{'Authorization':_0xa0d6('0xaa')+_0x413218,'If-None-Match':null,'OData-Version':_0xa0d6('0xab')},'json':!![]};return rp(_0xc817fb);})[_0xa0d6('0x1f')](function(_0x33f21b){var _0x5e5750=_0x33f21b['value'][0x0];var _0x51e9ee=_0x5e5750[_0xa0d6('0xac')];var _0x3dae5b={'method':_0xa0d6('0xa8'),'uri':_0x17581c+_0xa0d6('0xad')+_0x51e9ee+_0xa0d6('0xae'),'headers':{'Authorization':_0xa0d6('0xaa')+_0x413218,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3dae5b);})[_0xa0d6('0x1f')](function(_0x403ada){_0x401f73=_0x403ada;_0x534d8c=_0x401f73[_0xa0d6('0xaf')];_0x534d8c=_['remove'](_0x534d8c,function(_0x126e1c){return!_0x16561e[_0xa0d6('0xb0')](_0x126e1c['LogicalName']);});var _0x1c94c3=[];var _0x3f1c65=[];_0x534d8c[_0xa0d6('0xb1')](function(_0x1002fe){if(_0x1002fe[_0xa0d6('0xb2')]){var _0x5437d9=_0x1002fe[_0xa0d6('0xb2')]['substring'](_0x1002fe[_0xa0d6('0xb2')][_0xa0d6('0xa5')]('.')+0x1);if(_0x5437d9==='PicklistAttributeMetadata'){_0x1c94c3['push'](getSelectList(_0x17581c,_0x246e21,_0x3f1c65,_0x401f73[_0xa0d6('0xac')],_0x1002fe[_0xa0d6('0xac')],_0x413218));}}});return Promise[_0xa0d6('0xb3')](_0x1c94c3);})[_0xa0d6('0x1f')](function(_0x572cfe){_0x1fcd5e=_0x572cfe[0x0];var _0x558b26=[];var _0x1f1b85=[];_0x534d8c[_0xa0d6('0xb1')](function(_0x4864bd){if(!_[_0xa0d6('0xb4')](_0x4864bd[_0xa0d6('0xb2')])){var _0x51abea=_0x4864bd[_0xa0d6('0xb2')][_0xa0d6('0xa4')](_0x4864bd[_0xa0d6('0xb2')][_0xa0d6('0xa5')]('.')+0x1);if(_0x51abea==='BooleanAttributeMetadata'){_0x558b26[_0xa0d6('0xb5')](getBooleanList(_0x17581c,_0x246e21,_0x1f1b85,_0x401f73[_0xa0d6('0xac')],_0x4864bd['MetadataId'],_0x413218));}}});return Promise[_0xa0d6('0xb3')](_0x558b26);})[_0xa0d6('0x1f')](function(_0x4ef7f7){_0x31a59b=_0x4ef7f7[0x0];var _0xf2c191=[];var _0x4f6b67=[];_0x534d8c['forEach'](function(_0x29d50c){if(_0x29d50c[_0xa0d6('0xb2')]){var _0xffebe=_0x29d50c['@odata.type'][_0xa0d6('0xa4')](_0x29d50c[_0xa0d6('0xb2')][_0xa0d6('0xa5')]('.')+0x1);if(_0xffebe===_0xa0d6('0xb6')||_0xffebe===_0xa0d6('0xb7')||_0xffebe===_0xa0d6('0xb8')||_0xffebe===_0xa0d6('0xb9')||_0xffebe===_0xa0d6('0xba')||_0xffebe===_0xa0d6('0xbb')||_0xffebe===_0xa0d6('0xbc')||_0xffebe===_0xa0d6('0xbd')||_0xffebe==='StateAttributeMetadata'||_0xffebe===_0xa0d6('0xbe')){_0xf2c191[_0xa0d6('0xb5')](getInputList(_0x17581c,_0x246e21,_0xffebe,_0x4f6b67,_0x401f73[_0xa0d6('0xac')],_0x29d50c[_0xa0d6('0xac')],_0x413218));}}});return Promise[_0xa0d6('0xb3')](_0xf2c191);})[_0xa0d6('0x1f')](function(_0x1f16f6){_0x2ab3a0=_0x1f16f6[0x0];var _0x2269e3=_0x1fcd5e[_0xa0d6('0x9e')](_0x31a59b)['concat'](_0x2ab3a0);var _0x21f5c0={'count':_0x2269e3[_0xa0d6('0x40')],'rows':_0x2269e3};return _0x21f5c0;})[_0xa0d6('0x1f')](respondWithResult(_0x1cb860,null))['catch'](function(_0x2f0415){console[_0xa0d6('0xbf')](_0xa0d6('0xc0')+_0x2f0415);var _0x35c28a=_0x55ee1b['query']['test']?0x1f4:_0x2f0415[_0xa0d6('0xc1')]||0x1f4;logger[_0xa0d6('0x25')](_0x2f0415['stack']);delete _0x2f0415['name'];if(_0x35c28a===0x191){_0x35c28a=0x190;}_0x1cb860['status'](_0x35c28a)[_0xa0d6('0xc2')](_0x55ee1b[_0xa0d6('0x3c')][_0xa0d6('0x1c')]?{'message':_0xa0d6('0xc3'),'statusCode':_0x2f0415[_0xa0d6('0xc1')]}:_0x2f0415);});};function getSelectList(_0x25fa20,_0x5d5de3,_0x45f11d,_0x240de5,_0x21dfd8,_0x5439f3){var _0x22eeb3={'method':_0xa0d6('0xa8'),'uri':_0x25fa20+_0xa0d6('0xad')+_0x240de5+_0xa0d6('0xc4')+_0x21dfd8+_0xa0d6('0xc5')+_0xa0d6('0xc6'),'headers':{'Authorization':'Bearer\x20'+_0x5439f3,'If-None-Match':null,'OData-Version':_0xa0d6('0xab')},'json':!![]};return rp(_0x22eeb3)[_0xa0d6('0x1f')](function(_0x275d11){var _0x24f641=[];var _0x1c01cb=_0x275d11[_0xa0d6('0xc7')]['Options'];_0x1c01cb[_0xa0d6('0xb1')](function(_0x4fc857){_0x24f641[_0xa0d6('0xb5')]({'name':_0x4fc857[_0xa0d6('0xc8')][_0xa0d6('0xc9')][_0xa0d6('0xc8')],'value':String(_0x4fc857[_0xa0d6('0xca')])});});var _0x3245f5={'id':_0x5d5de3+'_'+_0x275d11[_0xa0d6('0xcb')],'name':_0x275d11[_0xa0d6('0xcc')][_0xa0d6('0xc9')][_0xa0d6('0xc8')],'custom':![],'options':_0x24f641};_0x45f11d['push'](_0x3245f5);return _0x45f11d;});}function getBooleanList(_0x5c7c86,_0x3b502d,_0x25174d,_0x39fa83,_0x4ea461,_0x40817e){var _0x594557={'method':'GET','uri':_0x5c7c86+_0xa0d6('0xad')+_0x39fa83+_0xa0d6('0xc4')+_0x4ea461+_0xa0d6('0xcd'),'headers':{'Authorization':_0xa0d6('0xaa')+_0x40817e,'If-None-Match':null,'OData-Version':_0xa0d6('0xab')},'json':!![]};return rp(_0x594557)[_0xa0d6('0x1f')](function(_0x2978e0){var _0x19d2c0=[];_0x19d2c0[_0xa0d6('0xb5')]({'name':_0x2978e0['OptionSet'][_0xa0d6('0xce')][_0xa0d6('0xc8')]['UserLocalizedLabel']['Label'],'value':_0xa0d6('0xcf')},{'name':_0x2978e0['OptionSet'][_0xa0d6('0xd0')][_0xa0d6('0xc8')][_0xa0d6('0xc9')][_0xa0d6('0xc8')],'value':_0xa0d6('0xd1')});var _0x1558fc={'id':_0x3b502d+'_'+_0x2978e0[_0xa0d6('0xcb')],'name':_0x2978e0['DisplayName'][_0xa0d6('0xc9')][_0xa0d6('0xc8')],'custom':![],'options':_0x19d2c0};_0x25174d[_0xa0d6('0xb5')](_0x1558fc);return _0x25174d;});}function getInputList(_0x4b6dbe,_0x1fb846,_0x45d3e9,_0x23e8a8,_0x4f59bc,_0x58225a,_0x2fbe47){var _0x4e7743={'method':_0xa0d6('0xa8'),'uri':_0x4b6dbe+_0xa0d6('0xad')+_0x4f59bc+_0xa0d6('0xc4')+_0x58225a+_0xa0d6('0xd2')+_0x45d3e9+_0xa0d6('0xd3'),'headers':{'Authorization':'Bearer\x20'+_0x2fbe47,'If-None-Match':null,'OData-Version':_0xa0d6('0xab')},'json':!![]};return rp(_0x4e7743)[_0xa0d6('0x1f')](function(_0xce6850){var _0x25fd27={'id':_0x1fb846+'_'+_0xce6850['LogicalName'],'name':_0xce6850[_0xa0d6('0xcc')][_0xa0d6('0xc9')]?_0xce6850[_0xa0d6('0xcc')][_0xa0d6('0xc9')]['Label']:_0xce6850['LogicalName'],'custom':![],'options':[]};_0x23e8a8[_0xa0d6('0xb5')](_0x25fd27);return _0x23e8a8;});} \ No newline at end of file +var _0x1393=['where','merge','type','key','VIRTUAL','field','options','include','rows','show','params','fields','length','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','map','addConfiguration','AccountId','Descriptions','channel','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','LogicalName','@odata.type','PicklistAttributeMetadata','MetadataId','BooleanAttributeMetadata','push','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','request-promise','moment','to-csv','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','index','Dynamics365Account','rawAttributes','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter'];(function(_0xaec893,_0x2c1f67){var _0x11de62=function(_0x4763df){while(--_0x4763df){_0xaec893['push'](_0xaec893['shift']());}};_0x11de62(++_0x2c1f67);}(_0x1393,0x92));var _0x3139=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1393[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3139('0x0'));var rimraf=require(_0x3139('0x1'));var zipdir=require(_0x3139('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3139('0x3'));var moment=require(_0x3139('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3139('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3139('0x6'));var crypto=require(_0x3139('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x3139('0x8'));var toCsv=require(_0x3139('0x5'));var querystring=require(_0x3139('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3139('0xa'));var qs=require(_0x3139('0xb'));var hardwareService=require(_0x3139('0xc'));var logger=require('../../config/logger')('api');var utils=require(_0x3139('0xd'));var config=require('../../config/environment');var db=require(_0x3139('0xe'))['db'];var integrations=require(_0x3139('0xf'));var jayson=require(_0x3139('0x10'));var client=jayson[_0x3139('0x11')]['http']({'port':0x232a});function checkPasswordPattern(_0x2b4c52,_0x41f7b0,_0x407583){if(_0x407583){var _0x3a8fb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a8fb2['test'](_0x41f7b0)){return _0x2b4c52;}else{throw new Error(_0x3139('0x12'));}}else{return _0x2b4c52;}}function respondWithRpcPromise(_0x375a47,_0x4eb60e,_0xe937f5,_0x39f5f2){return new BPromise(function(_0x3aa61a,_0x16fd66){var _0x78696d=_0x39f5f2||client;return _0x78696d[_0x3139('0x13')](_0x375a47,_0xe937f5)['then'](function(_0x969088){logger[_0x3139('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x4eb60e,_0x3139('0x15'));logger[_0x3139('0x16')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4eb60e,'request\x20sent',JSON[_0x3139('0x17')](_0x969088));if(_0x969088[_0x3139('0x18')]){if(_0x969088['error'][_0x3139('0x19')]===0x1f4){logger[_0x3139('0x18')](_0x3139('0x1a'),_0x4eb60e,_0x969088['error'][_0x3139('0x1b')]);return _0x16fd66(_0x969088[_0x3139('0x18')][_0x3139('0x1b')]);}logger[_0x3139('0x18')](_0x3139('0x1a'),_0x4eb60e,_0x969088[_0x3139('0x18')][_0x3139('0x1b')]);return _0x3aa61a(_0x969088[_0x3139('0x18')]['message']);}else{logger[_0x3139('0x14')](_0x3139('0x1a'),_0x4eb60e,'request\x20sent');_0x3aa61a(_0x969088[_0x3139('0x1c')][_0x3139('0x1b')]);}})[_0x3139('0x1d')](function(_0x187ea6){logger['error'](_0x3139('0x1a'),_0x4eb60e,_0x187ea6);_0x16fd66(_0x187ea6);});});}function respondWithStatusCode(_0xdecb7f,_0x146fe8){_0x146fe8=_0x146fe8||0xcc;return function(_0x313fe1){if(_0x313fe1){return _0xdecb7f[_0x3139('0x1e')](_0x146fe8);}return _0xdecb7f[_0x3139('0x1f')](_0x146fe8)['end']();};}function respondWithResult(_0x18b0fa,_0x54bff5){_0x54bff5=_0x54bff5||0xc8;return function(_0x5a9850){if(_0x5a9850){return _0x18b0fa['status'](_0x54bff5)['json'](_0x5a9850);}};}function respondWithFilteredResult(_0x9d41db,_0x2d5d2c){return function(_0xd3426f){if(_0xd3426f){var _0x286bff=_0xd3426f[_0x3139('0x20')],_0xa6b5ae=_0x2d5d2c[_0x3139('0x21')],_0x5cd9d7=_0x2d5d2c[_0x3139('0x21')]+_0x2d5d2c['limit'],_0x3473a3;if(_0x5cd9d7>=_0x286bff){_0x5cd9d7=_0x286bff;_0x3473a3=0xc8;}else{_0x3473a3=0xce;}_0x9d41db['status'](_0x3473a3);return _0x9d41db[_0x3139('0x22')](_0x3139('0x23'),_0xa6b5ae+'-'+_0x5cd9d7+'/'+_0x286bff)[_0x3139('0x24')](_0xd3426f);}return null;};}function patchUpdates(_0x262569){return function(_0x4c4d03){try{jsonpatch[_0x3139('0x25')](_0x4c4d03,_0x262569,!![]);}catch(_0x1bbce2){return BPromise[_0x3139('0x26')](_0x1bbce2);}return _0x4c4d03['save']();};}function saveUpdates(_0x4ba794,_0x803e78){return function(_0x5b3779){if(_0x5b3779){return _0x5b3779[_0x3139('0x27')](_0x4ba794)[_0x3139('0x28')](function(_0x54b0da){return _0x54b0da;});}return null;};}function removeEntity(_0x1eebcf,_0x324dea){return function(_0x98d798){if(_0x98d798){return _0x98d798[_0x3139('0x29')]()['then'](function(){_0x1eebcf['status'](0xcc)[_0x3139('0x2a')]();});}};}function handleEntityNotFound(_0x4d7f0a,_0x5135ba){return function(_0x3afa97){if(!_0x3afa97){_0x4d7f0a['sendStatus'](0x194);}return _0x3afa97;};}function handleError(_0x1137a5,_0x98e213){_0x98e213=_0x98e213||0x1f4;return function(_0x153d9a){logger[_0x3139('0x18')](_0x153d9a[_0x3139('0x2b')]);if(_0x153d9a['name']){delete _0x153d9a[_0x3139('0x2c')];}_0x1137a5['status'](_0x98e213)['send'](_0x153d9a);};}exports[_0x3139('0x2d')]=function(_0x4266b6,_0x206091){var _0x103ce5={},_0x4f1ccb={},_0x5ef920={'count':0x0,'rows':[]};var _0x1787a2=db[_0x3139('0x2e')][_0x3139('0x2f')];_0x4f1ccb[_0x3139('0x30')]=_['keys'](_0x1787a2);_0x4f1ccb[_0x3139('0x31')]=_[_0x3139('0x32')](_0x4266b6[_0x3139('0x31')]);_0x4f1ccb['filters']=_[_0x3139('0x33')](_0x4f1ccb[_0x3139('0x30')],_0x4f1ccb['query']);_0x103ce5[_0x3139('0x34')]=_['intersection'](_0x4f1ccb[_0x3139('0x30')],qs['fields'](_0x4266b6['query']['fields']));_0x103ce5[_0x3139('0x34')]=_0x103ce5['attributes']['length']?_0x103ce5[_0x3139('0x34')]:_0x4f1ccb[_0x3139('0x30')];if(!_0x4266b6[_0x3139('0x31')][_0x3139('0x35')](_0x3139('0x36'))){_0x103ce5[_0x3139('0x37')]=qs[_0x3139('0x37')](_0x4266b6[_0x3139('0x31')][_0x3139('0x37')]);_0x103ce5[_0x3139('0x21')]=qs[_0x3139('0x21')](_0x4266b6[_0x3139('0x31')][_0x3139('0x21')]);}_0x103ce5[_0x3139('0x38')]=qs[_0x3139('0x39')](_0x4266b6[_0x3139('0x31')][_0x3139('0x39')]);_0x103ce5['where']=qs['filters'](_[_0x3139('0x3a')](_0x4266b6[_0x3139('0x31')],_0x4f1ccb[_0x3139('0x3b')]));if(_0x4266b6[_0x3139('0x31')][_0x3139('0x3c')]){_0x103ce5[_0x3139('0x3d')]=_[_0x3139('0x3e')](_0x103ce5[_0x3139('0x3d')],{'$or':_['map'](_0x1787a2,function(_0x1ab56a){if(_0x1ab56a[_0x3139('0x3f')][_0x3139('0x40')]!==_0x3139('0x41')){var _0x1c9143={};_0x1c9143[_0x1ab56a[_0x3139('0x42')]]={'$like':'%'+_0x4266b6[_0x3139('0x31')]['filter']+'%'};return _0x1c9143;}})});}_0x103ce5=_['merge']({},_0x103ce5,_0x4266b6[_0x3139('0x43')]);var _0x36b75a={'where':_0x103ce5[_0x3139('0x3d')]};return db[_0x3139('0x2e')][_0x3139('0x20')](_0x36b75a)[_0x3139('0x28')](function(_0x2e7ef6){_0x5ef920[_0x3139('0x20')]=_0x2e7ef6;if(_0x4266b6['query']['includeAll']){_0x103ce5[_0x3139('0x44')]=[{'all':!![]}];}return db[_0x3139('0x2e')]['findAll'](_0x103ce5);})['then'](function(_0x3b575f){_0x5ef920[_0x3139('0x45')]=_0x3b575f;return _0x5ef920;})[_0x3139('0x28')](respondWithFilteredResult(_0x206091,_0x103ce5))['catch'](handleError(_0x206091,null));};exports[_0x3139('0x46')]=function(_0x214ee0,_0x2d507e){var _0x4c63ad={'raw':![],'where':{'id':_0x214ee0[_0x3139('0x47')]['id']}},_0xf015cf={};_0xf015cf['model']=_['keys'](db[_0x3139('0x2e')]['rawAttributes']);_0xf015cf[_0x3139('0x31')]=_[_0x3139('0x32')](_0x214ee0[_0x3139('0x31')]);_0xf015cf[_0x3139('0x3b')]=_[_0x3139('0x33')](_0xf015cf['model'],_0xf015cf['query']);_0x4c63ad['attributes']=_[_0x3139('0x33')](_0xf015cf['model'],qs['fields'](_0x214ee0['query'][_0x3139('0x48')]));_0x4c63ad['attributes']=_0x4c63ad['attributes'][_0x3139('0x49')]?_0x4c63ad[_0x3139('0x34')]:_0xf015cf[_0x3139('0x30')];if(_0x214ee0['query'][_0x3139('0x4a')]){_0x4c63ad[_0x3139('0x44')]=[{'all':!![]}];}_0x4c63ad=_[_0x3139('0x3e')]({},_0x4c63ad,_0x214ee0[_0x3139('0x43')]);return db[_0x3139('0x2e')][_0x3139('0x4b')](_0x4c63ad)[_0x3139('0x28')](handleEntityNotFound(_0x2d507e,null))[_0x3139('0x28')](respondWithResult(_0x2d507e,null))[_0x3139('0x1d')](handleError(_0x2d507e,null));};exports[_0x3139('0x4c')]=function(_0x4848c2,_0x50f050){return db['Dynamics365Account'][_0x3139('0x4c')](_0x4848c2[_0x3139('0x4d')],{})['then'](respondWithResult(_0x50f050,0xc9))[_0x3139('0x1d')](handleError(_0x50f050,null));};exports[_0x3139('0x27')]=function(_0x491c9d,_0x7174a9){if(_0x491c9d[_0x3139('0x4d')]['id']){delete _0x491c9d['body']['id'];}return db[_0x3139('0x2e')]['find']({'where':{'id':_0x491c9d['params']['id']}})[_0x3139('0x28')](handleEntityNotFound(_0x7174a9,null))['then'](saveUpdates(_0x491c9d[_0x3139('0x4d')],null))['then'](respondWithResult(_0x7174a9,null))[_0x3139('0x1d')](handleError(_0x7174a9,null));};exports[_0x3139('0x29')]=function(_0x397d75,_0x41b472){return db[_0x3139('0x2e')][_0x3139('0x4b')]({'where':{'id':_0x397d75[_0x3139('0x47')]['id']}})[_0x3139('0x28')](handleEntityNotFound(_0x41b472,null))[_0x3139('0x28')](removeEntity(_0x41b472,null))[_0x3139('0x1d')](handleError(_0x41b472,null));};exports[_0x3139('0x4e')]=function(_0xd6fd19,_0x46665c,_0x1f81ed){var _0xd68a4a={};var _0x562971={};var _0x5af515;var _0x26fad5;return db['Dynamics365Account'][_0x3139('0x4f')]({'where':{'id':_0xd6fd19['params']['id']}})[_0x3139('0x28')](handleEntityNotFound(_0x46665c,null))['then'](function(_0xcd7d7a){if(_0xcd7d7a){_0x5af515=_0xcd7d7a;_0x562971[_0x3139('0x30')]=_[_0x3139('0x32')](db[_0x3139('0x50')][_0x3139('0x2f')]);_0x562971['query']=_[_0x3139('0x32')](_0xd6fd19[_0x3139('0x31')]);_0x562971[_0x3139('0x3b')]=_[_0x3139('0x33')](_0x562971[_0x3139('0x30')],_0x562971[_0x3139('0x31')]);_0xd68a4a[_0x3139('0x34')]=_[_0x3139('0x33')](_0x562971[_0x3139('0x30')],qs[_0x3139('0x48')](_0xd6fd19[_0x3139('0x31')][_0x3139('0x48')]));_0xd68a4a[_0x3139('0x34')]=_0xd68a4a[_0x3139('0x34')]['length']?_0xd68a4a['attributes']:_0x562971[_0x3139('0x30')];_0xd68a4a[_0x3139('0x38')]=qs[_0x3139('0x39')](_0xd6fd19[_0x3139('0x31')][_0x3139('0x39')]);_0xd68a4a[_0x3139('0x3d')]=qs['filters'](_[_0x3139('0x3a')](_0xd6fd19['query'],_0x562971[_0x3139('0x3b')]));if(_0xd6fd19['query']['filter']){_0xd68a4a['where']=_[_0x3139('0x3e')](_0xd68a4a[_0x3139('0x3d')],{'$or':_[_0x3139('0x51')](_0xd68a4a[_0x3139('0x34')],function(_0x39709d){var _0x57ed34={};_0x57ed34[_0x39709d]={'$like':'%'+_0xd6fd19[_0x3139('0x31')]['filter']+'%'};return _0x57ed34;})});}_0xd68a4a=_['merge']({},_0xd68a4a,_0xd6fd19[_0x3139('0x43')]);return _0x5af515[_0x3139('0x4e')](_0xd68a4a);}})[_0x3139('0x28')](function(_0x403503){if(_0x403503){_0x26fad5=_0x403503[_0x3139('0x49')];if(!_0xd6fd19[_0x3139('0x31')][_0x3139('0x35')](_0x3139('0x36'))){_0xd68a4a[_0x3139('0x37')]=qs[_0x3139('0x37')](_0xd6fd19['query']['limit']);_0xd68a4a[_0x3139('0x21')]=qs[_0x3139('0x21')](_0xd6fd19[_0x3139('0x31')][_0x3139('0x21')]);}return _0x5af515[_0x3139('0x4e')](_0xd68a4a);}})[_0x3139('0x28')](function(_0x1ff2b0){if(_0x1ff2b0){return _0x1ff2b0?{'count':_0x26fad5,'rows':_0x1ff2b0}:null;}})[_0x3139('0x28')](respondWithResult(_0x46665c,null))['catch'](handleError(_0x46665c,null));};exports[_0x3139('0x52')]=function(_0x4c78bc,_0x43c054,_0x38fbc7){if(_0x4c78bc['body']['id']){delete _0x4c78bc['body']['id'];}return db[_0x3139('0x2e')][_0x3139('0x4f')]({'where':{'id':_0x4c78bc[_0x3139('0x47')]['id']}})['then'](handleEntityNotFound(_0x43c054,null))[_0x3139('0x28')](function(_0x2dedeb){if(_0x2dedeb){_0x4c78bc[_0x3139('0x4d')][_0x3139('0x53')]=_0x2dedeb['id'];_0x4c78bc[_0x3139('0x4d')]['Subjects']=integrations['getSubjects'](_0x4c78bc[_0x3139('0x4d')]['channel'],_0x4c78bc[_0x3139('0x4d')]['type']);_0x4c78bc[_0x3139('0x4d')][_0x3139('0x54')]=integrations['getDescriptions'](_0x4c78bc[_0x3139('0x4d')][_0x3139('0x55')],_0x4c78bc[_0x3139('0x4d')][_0x3139('0x3f')]);return db[_0x3139('0x50')][_0x3139('0x4c')](_0x4c78bc[_0x3139('0x4d')],{'include':[{'model':db[_0x3139('0x56')],'as':'Subjects'},{'model':db[_0x3139('0x56')],'as':_0x3139('0x54')}]});}return null;})[_0x3139('0x28')](respondWithResult(_0x43c054,null))[_0x3139('0x1d')](handleError(_0x43c054,null));};exports[_0x3139('0x57')]=function(_0x4387d0,_0x2eafac,_0x13cd68){var _0x254708=_0x4387d0[_0x3139('0x31')][_0x3139('0x58')];var _0x444c04=_0x254708===_0x3139('0x59')?_0x3139('0x5a'):_0x3139('0x5b');var _0x46a499='';var _0x5b8bba='';var _0x582a97='';var _0xcca005='';var _0x4e36a4='';var _0x5790b6='';var _0x522923='';var _0x3290a4='';var _0x53b487=['title','description',_0x3139('0x5c'),'ownerid',_0x3139('0x5d'),_0x3139('0x5e'),_0x3139('0x5f'),_0x3139('0x60'),_0x3139('0x61'),_0x3139('0x62')];var _0x1226e3=[_0x3139('0x63'),_0x3139('0x64'),_0x3139('0x65'),_0x3139('0x66'),_0x3139('0x67'),'contactidyominame',_0x3139('0x68'),_0x3139('0x69'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x3139('0x6a'),'createdbyyominame',_0x3139('0x6b'),_0x3139('0x6c'),_0x3139('0x6d'),_0x3139('0x6e'),_0x3139('0x6f'),'customeridyominame',_0x3139('0x70'),_0x3139('0x71'),_0x3139('0x72'),_0x3139('0x73'),_0x3139('0x74'),_0x3139('0x75'),_0x3139('0x76'),_0x3139('0x77'),'importsequencenumber',_0x3139('0x78'),_0x3139('0x79'),_0x3139('0x7a'),_0x3139('0x7b'),'modifiedbyexternalpartyname',_0x3139('0x7c'),_0x3139('0x7d'),'modifiedbyyominame',_0x3139('0x7e'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x3139('0x7f'),_0x3139('0x80'),_0x3139('0x81'),_0x3139('0x82'),'overriddencreatedon','owneridname',_0x3139('0x83'),_0x3139('0x84'),'parentcaseidname',_0x3139('0x85'),_0x3139('0x86'),_0x3139('0x87'),'productidname',_0x3139('0x88'),_0x3139('0x89'),_0x3139('0x8a'),'responseby',_0x3139('0x8b'),_0x3139('0x8c'),'sentimentvalue',_0x3139('0x8d'),'slaname',_0x3139('0x8e'),_0x3139('0x8f'),'statuscode',_0x3139('0x90'),_0x3139('0x91'),_0x3139('0x92'),'transactioncurrencyidname',_0x3139('0x93'),_0x3139('0x94'),'versionnumber'];var _0x13362f=_0x53b487[_0x3139('0x95')](_0x1226e3);return db[_0x3139('0x2e')][_0x3139('0x4f')]({'where':{'id':_0x4387d0[_0x3139('0x47')]['id']},'attributes':['id',_0x3139('0x96'),_0x3139('0x97'),_0x3139('0x98'),_0x3139('0x99'),'clientId',_0x3139('0x9a')]})[_0x3139('0x28')](handleEntityNotFound(_0x2eafac,null))[_0x3139('0x28')](function(_0x197aa5){if(_0x197aa5){_0x3290a4=_0x197aa5['remoteUri'];var _0xe7ddb0=_0x3290a4[_0x3139('0x9b')](-0x1);if(_0xe7ddb0==='/'){_0x3290a4=_0x3290a4[_0x3139('0x9c')](0x0,_0x3290a4[_0x3139('0x9d')](_0xe7ddb0));}_0x522923=util[_0x3139('0x9e')]('%s/api/data/v9.0/',_0x3290a4);var _0x21dfeb={'method':_0x3139('0x9f'),'uri':_0x3139('0xa0')+_0x197aa5[_0x3139('0x99')]+_0x3139('0xa1'),'form':{'client_id':_0x197aa5[_0x3139('0xa2')],'resource':_0x3290a4,'username':_0x197aa5['username'],'password':_0x197aa5[_0x3139('0x97')],'grant_type':'password','client_secret':_0x197aa5['clientSecret']},'json':!![]};return rp(_0x21dfeb);}})[_0x3139('0x28')](function(_0x31a9a2){_0x5790b6=_0x31a9a2[_0x3139('0xa3')];var _0x486771={'method':_0x3139('0xa4'),'uri':encodeURI(_0x522923+_0x3139('0xa5')+_0x444c04+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5790b6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x486771);})['then'](function(_0x4a6b1d){var _0x1ed189=_0x4a6b1d[_0x3139('0xa6')][0x0];var _0x4aecab=_0x1ed189['MetadataId'];var _0x3f4d12={'method':_0x3139('0xa4'),'uri':_0x522923+_0x3139('0xa7')+_0x4aecab+_0x3139('0xa8'),'headers':{'Authorization':_0x3139('0xa9')+_0x5790b6,'If-None-Match':null,'OData-Version':_0x3139('0xaa')},'json':!![]};return rp(_0x3f4d12);})['then'](function(_0xb514d3){_0x46a499=_0xb514d3;_0x5b8bba=_0x46a499[_0x3139('0xab')];_0x5b8bba=_[_0x3139('0xac')](_0x5b8bba,function(_0x4039c0){return!_0x13362f['includes'](_0x4039c0[_0x3139('0xad')]);});var _0x18bed5=[];var _0xad96c7=[];_0x5b8bba['forEach'](function(_0x3c5f13){if(_0x3c5f13[_0x3139('0xae')]){var _0x10642f=_0x3c5f13['@odata.type'][_0x3139('0x9c')](_0x3c5f13[_0x3139('0xae')][_0x3139('0x9d')]('.')+0x1);if(_0x10642f===_0x3139('0xaf')){_0x18bed5['push'](getSelectList(_0x522923,_0x254708,_0xad96c7,_0x46a499[_0x3139('0xb0')],_0x3c5f13[_0x3139('0xb0')],_0x5790b6));}}});return Promise['all'](_0x18bed5);})[_0x3139('0x28')](function(_0x43e6b6){_0x582a97=_0x43e6b6[0x0];var _0x3af554=[];var _0x33588a=[];_0x5b8bba['forEach'](function(_0x2cd91c){if(!_['isNil'](_0x2cd91c[_0x3139('0xae')])){var _0x18e693=_0x2cd91c[_0x3139('0xae')][_0x3139('0x9c')](_0x2cd91c[_0x3139('0xae')]['lastIndexOf']('.')+0x1);if(_0x18e693===_0x3139('0xb1')){_0x3af554[_0x3139('0xb2')](getBooleanList(_0x522923,_0x254708,_0x33588a,_0x46a499['MetadataId'],_0x2cd91c[_0x3139('0xb0')],_0x5790b6));}}});return Promise[_0x3139('0xb3')](_0x3af554);})['then'](function(_0x4a9c85){_0xcca005=_0x4a9c85[0x0];var _0x23b882=[];var _0x25a694=[];_0x5b8bba[_0x3139('0xb4')](function(_0x57d8b7){if(_0x57d8b7[_0x3139('0xae')]){var _0xc671e1=_0x57d8b7[_0x3139('0xae')]['substring'](_0x57d8b7[_0x3139('0xae')]['lastIndexOf']('.')+0x1);if(_0xc671e1===_0x3139('0xb5')||_0xc671e1===_0x3139('0xb6')||_0xc671e1===_0x3139('0xb7')||_0xc671e1===_0x3139('0xb8')||_0xc671e1===_0x3139('0xb9')||_0xc671e1==='DateTimeAttributeMetadata'||_0xc671e1===_0x3139('0xba')||_0xc671e1===_0x3139('0xbb')||_0xc671e1===_0x3139('0xbc')||_0xc671e1===_0x3139('0xbd')){_0x23b882[_0x3139('0xb2')](getInputList(_0x522923,_0x254708,_0xc671e1,_0x25a694,_0x46a499[_0x3139('0xb0')],_0x57d8b7[_0x3139('0xb0')],_0x5790b6));}}});return Promise[_0x3139('0xb3')](_0x23b882);})[_0x3139('0x28')](function(_0x1e402e){_0x4e36a4=_0x1e402e[0x0];var _0x4ef51d=_0x582a97['concat'](_0xcca005)[_0x3139('0x95')](_0x4e36a4);var _0x4d6562={'count':_0x4ef51d[_0x3139('0x49')],'rows':_0x4ef51d};return _0x4d6562;})[_0x3139('0x28')](respondWithResult(_0x2eafac,null))[_0x3139('0x1d')](function(_0x596548){console[_0x3139('0xbe')](_0x3139('0xbf')+_0x596548);var _0x43a0c5=_0x4387d0['query'][_0x3139('0xc0')]?0x1f4:_0x596548[_0x3139('0xc1')]||0x1f4;logger[_0x3139('0x18')](_0x596548[_0x3139('0x2b')]);delete _0x596548[_0x3139('0x2c')];if(_0x43a0c5===0x191){_0x43a0c5=0x190;}_0x2eafac[_0x3139('0x1f')](_0x43a0c5)[_0x3139('0xc2')](_0x4387d0[_0x3139('0x31')][_0x3139('0xc0')]?{'message':'Wrong\x20credentials','statusCode':_0x596548[_0x3139('0xc1')]}:_0x596548);});};function getSelectList(_0x4ec5fc,_0x496a32,_0x24ee8a,_0x386e3f,_0x2a754f,_0x1cbf8){var _0x33534c={'method':_0x3139('0xa4'),'uri':_0x4ec5fc+_0x3139('0xa7')+_0x386e3f+_0x3139('0xc3')+_0x2a754f+_0x3139('0xc4')+_0x3139('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x1cbf8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x33534c)['then'](function(_0x2b040e){var _0xa241db=[];var _0x157124=_0x2b040e[_0x3139('0xc6')]['Options'];_0x157124[_0x3139('0xb4')](function(_0x2d6779){_0xa241db[_0x3139('0xb2')]({'name':_0x2d6779[_0x3139('0xc7')][_0x3139('0xc8')][_0x3139('0xc7')],'value':String(_0x2d6779[_0x3139('0xc9')])});});var _0x9d664b={'id':_0x496a32+'_'+_0x2b040e['LogicalName'],'name':_0x2b040e[_0x3139('0xca')][_0x3139('0xc8')]['Label'],'custom':![],'options':_0xa241db};_0x24ee8a[_0x3139('0xb2')](_0x9d664b);return _0x24ee8a;});}function getBooleanList(_0x1da1b5,_0x484f90,_0x5cba67,_0x2bedaf,_0x560cd7,_0x8a6a37){var _0x468ab2={'method':_0x3139('0xa4'),'uri':_0x1da1b5+_0x3139('0xa7')+_0x2bedaf+_0x3139('0xc3')+_0x560cd7+_0x3139('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x8a6a37,'If-None-Match':null,'OData-Version':_0x3139('0xaa')},'json':!![]};return rp(_0x468ab2)[_0x3139('0x28')](function(_0x4038a1){var _0x51daf8=[];_0x51daf8['push']({'name':_0x4038a1[_0x3139('0xc6')]['TrueOption'][_0x3139('0xc7')][_0x3139('0xc8')][_0x3139('0xc7')],'value':_0x3139('0xcc')},{'name':_0x4038a1[_0x3139('0xc6')][_0x3139('0xcd')][_0x3139('0xc7')][_0x3139('0xc8')][_0x3139('0xc7')],'value':'false'});var _0x5f4312={'id':_0x484f90+'_'+_0x4038a1[_0x3139('0xad')],'name':_0x4038a1[_0x3139('0xca')]['UserLocalizedLabel'][_0x3139('0xc7')],'custom':![],'options':_0x51daf8};_0x5cba67['push'](_0x5f4312);return _0x5cba67;});}function getInputList(_0x1c1715,_0xb59af7,_0xfce4dc,_0x21df56,_0x23c745,_0xb6752e,_0x3563a8){var _0x15367a={'method':_0x3139('0xa4'),'uri':_0x1c1715+_0x3139('0xa7')+_0x23c745+_0x3139('0xc3')+_0xb6752e+_0x3139('0xce')+_0xfce4dc+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x3139('0xa9')+_0x3563a8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x15367a)[_0x3139('0x28')](function(_0x3ae71d){var _0x9e08a0={'id':_0xb59af7+'_'+_0x3ae71d[_0x3139('0xad')],'name':_0x3ae71d['DisplayName'][_0x3139('0xc8')]?_0x3ae71d[_0x3139('0xca')]['UserLocalizedLabel'][_0x3139('0xc7')]:_0x3ae71d[_0x3139('0xad')],'custom':![],'options':[]};_0x21df56[_0x3139('0xb2')](_0x9e08a0);return _0x21df56;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 36fa7d9..5f4b51b 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 _0xf5b2=['./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1852c8,_0x2fef5b){var _0x201011=function(_0x31a830){while(--_0x31a830){_0x1852c8['push'](_0x1852c8['shift']());}};_0x201011(++_0x2fef5b);}(_0xf5b2,0x19c));var _0x2f5b=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xf5b2[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require(_0x2f5b('0x0'));var util=require(_0x2f5b('0x1'));var logger=require(_0x2f5b('0x2'))(_0x2f5b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f5b('0x4'));var fs=require('fs');var path=require(_0x2f5b('0x5'));var rimraf=require(_0x2f5b('0x6'));var config=require(_0x2f5b('0x7'));var attributes=require(_0x2f5b('0x8'));var integrations=require(_0x2f5b('0x9'));module[_0x2f5b('0xa')]=function(_0x11b165,_0x1d77b9){return _0x11b165[_0x2f5b('0xb')](_0x2f5b('0xc'),attributes,{'tableName':_0x2f5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea79=['path','exports','int_dynamics365_accounts','util','../../config/logger','api'];(function(_0x4b2274,_0x1d7938){var _0x3df55e=function(_0x2a6e45){while(--_0x2a6e45){_0x4b2274['push'](_0x4b2274['shift']());}};_0x3df55e(++_0x1d7938);}(_0xea79,0xe1));var _0x9ea7=function(_0x2631f6,_0x552ce5){_0x2631f6=_0x2631f6-0x0;var _0x45917c=_0xea79[_0x2631f6];return _0x45917c;};'use strict';var _=require('lodash');var util=require(_0x9ea7('0x0'));var logger=require(_0x9ea7('0x1'))(_0x9ea7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ea7('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x9ea7('0x4')]=function(_0xf2c0b3,_0x281ea0){return _0xf2c0b3['define']('Dynamics365Account',attributes,{'tableName':_0x9ea7('0x5'),'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 1887d01..7e09403 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 _0x514a=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x259a5a,_0x438a30){var _0x15da29=function(_0x555b45){while(--_0x555b45){_0x259a5a['push'](_0x259a5a['shift']());}};_0x15da29(++_0x438a30);}(_0x514a,0xf1));var _0xa514=function(_0x4b96d1,_0x5c5faf){_0x4b96d1=_0x4b96d1-0x0;var _0x926452=_0x514a[_0x4b96d1];return _0x926452;};'use strict';var _=require(_0xa514('0x0'));var util=require(_0xa514('0x1'));var moment=require(_0xa514('0x2'));var BPromise=require(_0xa514('0x3'));var rs=require(_0xa514('0x4'));var fs=require('fs');var Redis=require(_0xa514('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa514('0x6'));var logger=require(_0xa514('0x7'))(_0xa514('0x8'));var config=require(_0xa514('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa514('0xa')][_0xa514('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35c14c,_0x42efda,_0x459fd4){return new BPromise(function(_0x1c289f,_0x598dd6){return client[_0xa514('0xc')](_0x35c14c,_0x459fd4)[_0xa514('0xd')](function(_0x5a3571){logger[_0xa514('0xe')](_0xa514('0xf'),_0x42efda,_0xa514('0x10'));logger[_0xa514('0x11')](_0xa514('0x12'),_0x42efda,_0xa514('0x10'),JSON[_0xa514('0x13')](_0x5a3571));if(_0x5a3571['error']){if(_0x5a3571['error'][_0xa514('0x14')]===0x1f4){logger[_0xa514('0x15')](_0xa514('0xf'),_0x42efda,_0x5a3571[_0xa514('0x15')]['message']);return _0x598dd6(_0x5a3571[_0xa514('0x15')][_0xa514('0x16')]);}logger[_0xa514('0x15')](_0xa514('0xf'),_0x42efda,_0x5a3571[_0xa514('0x15')][_0xa514('0x16')]);return _0x1c289f(_0x5a3571[_0xa514('0x15')][_0xa514('0x16')]);}else{logger[_0xa514('0xe')](_0xa514('0xf'),_0x42efda,_0xa514('0x10'));_0x1c289f(_0x5a3571[_0xa514('0x17')][_0xa514('0x16')]);}})[_0xa514('0x18')](function(_0x49c936){logger['error'](_0xa514('0xf'),_0x42efda,_0x49c936);_0x598dd6(_0x49c936);});});}exports[_0xa514('0x19')]=function(_0xcb0b80){var _0x1ec0c5=this;return new Promise(function(_0x153a9a,_0x490cb9){return db[_0xa514('0x1a')][_0xa514('0x1b')]({'raw':_0xcb0b80[_0xa514('0x1c')]?_0xcb0b80[_0xa514('0x1c')][_0xa514('0x1d')]===undefined?!![]:![]:!![],'where':_0xcb0b80[_0xa514('0x1c')]?_0xcb0b80[_0xa514('0x1c')][_0xa514('0x1e')]||null:null,'attributes':_0xcb0b80[_0xa514('0x1c')]?_0xcb0b80['options'][_0xa514('0x1f')]||null:null,'limit':_0xcb0b80[_0xa514('0x1c')]?_0xcb0b80[_0xa514('0x1c')]['limit']||null:null,'include':_0xcb0b80[_0xa514('0x1c')]?_0xcb0b80[_0xa514('0x1c')][_0xa514('0x20')]?_[_0xa514('0x21')](_0xcb0b80[_0xa514('0x1c')][_0xa514('0x20')],function(_0x3e2172){return{'model':db[_0x3e2172[_0xa514('0x22')]],'as':_0x3e2172['as'],'attributes':_0x3e2172['attributes'],'include':_0x3e2172[_0xa514('0x20')]?_[_0xa514('0x21')](_0x3e2172[_0xa514('0x20')],function(_0x5bd309){return{'model':db[_0x5bd309[_0xa514('0x22')]],'as':_0x5bd309['as'],'attributes':_0x5bd309[_0xa514('0x1f')],'include':_0x5bd309['include']?_[_0xa514('0x21')](_0x5bd309[_0xa514('0x20')],function(_0x344cfa){return{'model':db[_0x344cfa[_0xa514('0x22')]],'as':_0x344cfa['as'],'attributes':_0x344cfa[_0xa514('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c1a33){logger[_0xa514('0xe')](_0xa514('0x19'),_0xcb0b80);logger[_0xa514('0x11')](_0xa514('0x19'),_0xcb0b80,JSON[_0xa514('0x13')](_0x1c1a33));_0x153a9a(_0x1c1a33);})[_0xa514('0x18')](function(_0x8fd29a){logger['error'](_0xa514('0x19'),_0x8fd29a[_0xa514('0x16')],_0xcb0b80);_0x490cb9(_0x1ec0c5[_0xa514('0x15')](0x1f4,_0x8fd29a[_0xa514('0x16')]));});});};exports[_0xa514('0x23')]=function(_0x2e9a3c){var _0x2f80f3=this;return new Promise(function(_0x5e1feb,_0x5cef4c){return db[_0xa514('0x1a')][_0xa514('0x24')]({'raw':_0x2e9a3c[_0xa514('0x1c')]?_0x2e9a3c[_0xa514('0x1c')][_0xa514('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e9a3c['options']?_0x2e9a3c['options'][_0xa514('0x1e')]||null:null,'attributes':_0x2e9a3c[_0xa514('0x1c')]?_0x2e9a3c[_0xa514('0x1c')][_0xa514('0x1f')]||null:null,'include':_0x2e9a3c['options']?_0x2e9a3c[_0xa514('0x1c')][_0xa514('0x20')]?_[_0xa514('0x21')](_0x2e9a3c['options']['include'],function(_0x5c512d){return{'model':db[_0x5c512d[_0xa514('0x22')]],'as':_0x5c512d['as'],'attributes':_0x5c512d['attributes'],'include':_0x5c512d[_0xa514('0x20')]?_[_0xa514('0x21')](_0x5c512d['include'],function(_0x413f5a){return{'model':db[_0x413f5a[_0xa514('0x22')]],'as':_0x413f5a['as'],'attributes':_0x413f5a[_0xa514('0x1f')],'include':_0x413f5a[_0xa514('0x20')]?_[_0xa514('0x21')](_0x413f5a[_0xa514('0x20')],function(_0x34bc41){return{'model':db[_0x34bc41['model']],'as':_0x34bc41['as'],'attributes':_0x34bc41[_0xa514('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa514('0xd')](function(_0x1cb875){logger[_0xa514('0xe')](_0xa514('0x23'),_0x2e9a3c);logger['debug'](_0xa514('0x23'),_0x2e9a3c,JSON[_0xa514('0x13')](_0x1cb875));_0x5e1feb(_0x1cb875);})[_0xa514('0x18')](function(_0x53f866){logger[_0xa514('0x15')](_0xa514('0x23'),_0x53f866[_0xa514('0x16')],_0x2e9a3c);_0x5cef4c(_0x2f80f3[_0xa514('0x15')](0x1f4,_0x53f866['message']));});});}; \ No newline at end of file +var _0x1909=['client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','limit','include','map','attributes','model','debug','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','find','raw','where','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x367e3c,_0x4b79d3){var _0x3c40ae=function(_0x17f43f){while(--_0x17f43f){_0x367e3c['push'](_0x367e3c['shift']());}};_0x3c40ae(++_0x4b79d3);}(_0x1909,0xd0));var _0x9190=function(_0x3889ba,_0x4601ef){_0x3889ba=_0x3889ba-0x0;var _0xf51ed0=_0x1909[_0x3889ba];return _0xf51ed0;};'use strict';var _=require(_0x9190('0x0'));var util=require(_0x9190('0x1'));var moment=require(_0x9190('0x2'));var BPromise=require(_0x9190('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9190('0x4'));var logger=require('../../config/logger')(_0x9190('0x5'));var config=require(_0x9190('0x6'));var jayson=require(_0x9190('0x7'));var client=jayson[_0x9190('0x8')][_0x9190('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ee391,_0x337427,_0x465904){return new BPromise(function(_0x486148,_0x4d6c97){return client[_0x9190('0xa')](_0x2ee391,_0x465904)[_0x9190('0xb')](function(_0x3bc2f5){logger[_0x9190('0xc')](_0x9190('0xd'),_0x337427,'request\x20sent');logger['debug'](_0x9190('0xe'),_0x337427,_0x9190('0xf'),JSON[_0x9190('0x10')](_0x3bc2f5));if(_0x3bc2f5[_0x9190('0x11')]){if(_0x3bc2f5['error'][_0x9190('0x12')]===0x1f4){logger[_0x9190('0x11')](_0x9190('0xd'),_0x337427,_0x3bc2f5[_0x9190('0x11')][_0x9190('0x13')]);return _0x4d6c97(_0x3bc2f5['error'][_0x9190('0x13')]);}logger[_0x9190('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x337427,_0x3bc2f5[_0x9190('0x11')][_0x9190('0x13')]);return _0x486148(_0x3bc2f5[_0x9190('0x11')][_0x9190('0x13')]);}else{logger[_0x9190('0xc')](_0x9190('0xd'),_0x337427,_0x9190('0xf'));_0x486148(_0x3bc2f5[_0x9190('0x14')][_0x9190('0x13')]);}})[_0x9190('0x15')](function(_0x303970){logger['error'](_0x9190('0xd'),_0x337427,_0x303970);_0x4d6c97(_0x303970);});});}exports['GetDynamics365Account']=function(_0x2af80c){var _0x5182ee=this;return new Promise(function(_0x21c5c4,_0x35fdef){return db['Dynamics365Account'][_0x9190('0x16')]({'raw':_0x2af80c[_0x9190('0x17')]?_0x2af80c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2af80c['options']?_0x2af80c['options']['where']||null:null,'attributes':_0x2af80c[_0x9190('0x17')]?_0x2af80c['options']['attributes']||null:null,'limit':_0x2af80c['options']?_0x2af80c[_0x9190('0x17')][_0x9190('0x18')]||null:null,'include':_0x2af80c[_0x9190('0x17')]?_0x2af80c[_0x9190('0x17')][_0x9190('0x19')]?_[_0x9190('0x1a')](_0x2af80c['options'][_0x9190('0x19')],function(_0x3982de){return{'model':db[_0x3982de['model']],'as':_0x3982de['as'],'attributes':_0x3982de[_0x9190('0x1b')],'include':_0x3982de[_0x9190('0x19')]?_[_0x9190('0x1a')](_0x3982de[_0x9190('0x19')],function(_0x194e8d){return{'model':db[_0x194e8d[_0x9190('0x1c')]],'as':_0x194e8d['as'],'attributes':_0x194e8d[_0x9190('0x1b')],'include':_0x194e8d['include']?_[_0x9190('0x1a')](_0x194e8d[_0x9190('0x19')],function(_0x4f13fa){return{'model':db[_0x4f13fa['model']],'as':_0x4f13fa['as'],'attributes':_0x4f13fa[_0x9190('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9190('0xb')](function(_0x2d261b){logger[_0x9190('0xc')]('GetDynamics365Account',_0x2af80c);logger[_0x9190('0x1d')](_0x9190('0x1e'),_0x2af80c,JSON[_0x9190('0x10')](_0x2d261b));_0x21c5c4(_0x2d261b);})['catch'](function(_0x48406b){logger[_0x9190('0x11')](_0x9190('0x1e'),_0x48406b['message'],_0x2af80c);_0x35fdef(_0x5182ee['error'](0x1f4,_0x48406b[_0x9190('0x13')]));});});};exports[_0x9190('0x1f')]=function(_0x4dbf46){var _0xe20246=this;return new Promise(function(_0x179e81,_0x427f47){return db[_0x9190('0x20')][_0x9190('0x21')]({'raw':_0x4dbf46['options']?_0x4dbf46[_0x9190('0x17')][_0x9190('0x22')]===undefined?!![]:![]:!![],'where':_0x4dbf46[_0x9190('0x17')]?_0x4dbf46['options'][_0x9190('0x23')]||null:null,'attributes':_0x4dbf46[_0x9190('0x17')]?_0x4dbf46[_0x9190('0x17')]['attributes']||null:null,'include':_0x4dbf46[_0x9190('0x17')]?_0x4dbf46[_0x9190('0x17')]['include']?_[_0x9190('0x1a')](_0x4dbf46[_0x9190('0x17')][_0x9190('0x19')],function(_0xf0c88e){return{'model':db[_0xf0c88e[_0x9190('0x1c')]],'as':_0xf0c88e['as'],'attributes':_0xf0c88e['attributes'],'include':_0xf0c88e['include']?_[_0x9190('0x1a')](_0xf0c88e[_0x9190('0x19')],function(_0x5d76d9){return{'model':db[_0x5d76d9[_0x9190('0x1c')]],'as':_0x5d76d9['as'],'attributes':_0x5d76d9['attributes'],'include':_0x5d76d9[_0x9190('0x19')]?_[_0x9190('0x1a')](_0x5d76d9[_0x9190('0x19')],function(_0x364bf0){return{'model':db[_0x364bf0[_0x9190('0x1c')]],'as':_0x364bf0['as'],'attributes':_0x364bf0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9190('0xb')](function(_0xa4504c){logger['info'](_0x9190('0x1f'),_0x4dbf46);logger['debug'](_0x9190('0x1f'),_0x4dbf46,JSON[_0x9190('0x10')](_0xa4504c));_0x179e81(_0xa4504c);})[_0x9190('0x15')](function(_0x567418){logger[_0x9190('0x11')](_0x9190('0x1f'),_0x567418['message'],_0x4dbf46);_0x427f47(_0xe20246[_0x9190('0x11')](0x1f4,_0x567418[_0x9190('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9e354ee..eda757d 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 _0xee7d=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x30663e,_0x294abe){var _0x41c43f=function(_0x5be7a6){while(--_0x5be7a6){_0x30663e['push'](_0x30663e['shift']());}};_0x41c43f(++_0x294abe);}(_0xee7d,0xa7));var _0xdee7=function(_0x5508d9,_0x2a6dcc){_0x5508d9=_0x5508d9-0x0;var _0x2dada6=_0xee7d[_0x5508d9];return _0x2dada6;};'use strict';var multer=require(_0xdee7('0x0'));var util=require('util');var path=require(_0xdee7('0x1'));var timeout=require(_0xdee7('0x2'));var express=require('express');var router=express[_0xdee7('0x3')]();var auth=require(_0xdee7('0x4'));var interaction=require(_0xdee7('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xdee7('0x6')]('/',auth[_0xdee7('0x7')](),controller[_0xdee7('0x8')]);router['get'](_0xdee7('0x9'),auth[_0xdee7('0x7')](),controller['show']);router[_0xdee7('0x6')](_0xdee7('0xa'),auth[_0xdee7('0x7')](),controller['getFields']);router[_0xdee7('0x6')](_0xdee7('0xb'),auth[_0xdee7('0x7')](),controller[_0xdee7('0xc')]);router[_0xdee7('0x6')](_0xdee7('0xd'),auth[_0xdee7('0x7')](),controller[_0xdee7('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdee7('0xf')](_0xdee7('0x9'),auth[_0xdee7('0x7')](),controller[_0xdee7('0x10')]);router[_0xdee7('0x11')]('/:id',auth[_0xdee7('0x7')](),controller['destroy']);module[_0xdee7('0x12')]=router; \ No newline at end of file +var _0x914f=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','destroy','exports','multer'];(function(_0x1a11df,_0x2a1f79){var _0x1a1a4f=function(_0x366a46){while(--_0x366a46){_0x1a11df['push'](_0x1a11df['shift']());}};_0x1a1a4f(++_0x2a1f79);}(_0x914f,0x1b7));var _0xf914=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x914f[_0x2e6c19];return _0x52885d;};'use strict';var multer=require(_0xf914('0x0'));var util=require(_0xf914('0x1'));var path=require(_0xf914('0x2'));var timeout=require(_0xf914('0x3'));var express=require(_0xf914('0x4'));var router=express[_0xf914('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf914('0x6'));var config=require(_0xf914('0x7'));var controller=require(_0xf914('0x8'));router[_0xf914('0x9')]('/',auth[_0xf914('0xa')](),controller['index']);router[_0xf914('0x9')](_0xf914('0xb'),auth[_0xf914('0xa')](),controller['show']);router['get'](_0xf914('0xc'),auth['isAuthenticated'](),controller[_0xf914('0xd')]);router[_0xf914('0x9')](_0xf914('0xe'),auth[_0xf914('0xa')](),controller[_0xf914('0xf')]);router[_0xf914('0x9')](_0xf914('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf914('0x11')]('/',auth['isAuthenticated'](),controller[_0xf914('0x12')]);router[_0xf914('0x13')](_0xf914('0xb'),auth[_0xf914('0xa')](),controller['update']);router['delete'](_0xf914('0xb'),auth[_0xf914('0xa')](),controller[_0xf914('0x14')]);module[_0xf914('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index e530069..3522aa9 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 _0xe776=['incident','sequelize','exports','STRING'];(function(_0x1d8c9b,_0x3ff0e4){var _0x275871=function(_0x28f890){while(--_0x28f890){_0x1d8c9b['push'](_0x1d8c9b['shift']());}};_0x275871(++_0x3ff0e4);}(_0xe776,0x195));var _0x6e77=function(_0x4767c8,_0xb000ab){_0x4767c8=_0x4767c8-0x0;var _0x6de88b=_0xe776[_0x4767c8];return _0x6de88b;};'use strict';var Sequelize=require(_0x6e77('0x0'));module[_0x6e77('0x1')]={'name':{'type':Sequelize[_0x6e77('0x2')]},'description':{'type':Sequelize[_0x6e77('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6e77('0x3'),'phonecall'),'defaultValue':_0x6e77('0x3')}}; \ No newline at end of file +var _0x4b43=['STRING','ENUM','incident','phonecall','sequelize'];(function(_0x29645e,_0x25f651){var _0x3ea3b7=function(_0x5c8b5a){while(--_0x5c8b5a){_0x29645e['push'](_0x29645e['shift']());}};_0x3ea3b7(++_0x25f651);}(_0x4b43,0x1d0));var _0x34b4=function(_0x40af53,_0x4dfea3){_0x40af53=_0x40af53-0x0;var _0x36427e=_0x4b43[_0x40af53];return _0x36427e;};'use strict';var Sequelize=require(_0x34b4('0x0'));module['exports']={'name':{'type':Sequelize[_0x34b4('0x1')]},'description':{'type':Sequelize[_0x34b4('0x1')]},'ticketType':{'type':Sequelize[_0x34b4('0x2')](_0x34b4('0x3'),_0x34b4('0x4')),'defaultValue':_0x34b4('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ce6c665..e1a9edd 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 _0x59c2=['where','pick','filter','merge','map','type','key','field','options','includeAll','include','rows','show','keys','create','body','find','params','order','getFields','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','update','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x5d8e11,_0x1b2574){var _0x25fa53=function(_0x5376ce){while(--_0x5376ce){_0x5d8e11['push'](_0x5d8e11['shift']());}};_0x25fa53(++_0x1b2574);}(_0x59c2,0x11d));var _0x259c=function(_0x37ae2e,_0x35be3a){_0x37ae2e=_0x37ae2e-0x0;var _0x19c50f=_0x59c2[_0x37ae2e];return _0x19c50f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x259c('0x0'));var rimraf=require(_0x259c('0x1'));var zipdir=require(_0x259c('0x2'));var jsonpatch=require(_0x259c('0x3'));var rp=require(_0x259c('0x4'));var moment=require(_0x259c('0x5'));var BPromise=require(_0x259c('0x6'));var Mustache=require('mustache');var util=require(_0x259c('0x7'));var path=require(_0x259c('0x8'));var sox=require(_0x259c('0x9'));var csv=require('to-csv');var ejs=require(_0x259c('0xa'));var fs=require('fs');var _=require(_0x259c('0xb'));var squel=require(_0x259c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x259c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x259c('0xe'));var Papa=require('papaparse');var Redis=require(_0x259c('0xf'));var authService=require(_0x259c('0x10'));var qs=require(_0x259c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x259c('0x12'));var utils=require(_0x259c('0x13'));var config=require('../../config/environment');var db=require(_0x259c('0x14'))['db'];var jayson=require(_0x259c('0x15'));var client=jayson[_0x259c('0x16')][_0x259c('0x17')]({'port':0x232a});function checkPasswordPattern(_0x43e3e0,_0x54dc1b,_0x36c25b){if(_0x36c25b){var _0x5beb90=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5beb90[_0x259c('0x18')](_0x54dc1b)){return _0x43e3e0;}else{throw new Error(_0x259c('0x19'));}}else{return _0x43e3e0;}}function respondWithRpcPromise(_0x4b2d68,_0x5088a6,_0xe50d25,_0x5e5143){return new BPromise(function(_0x188347,_0x46ef70){var _0x504fcd=_0x5e5143||client;return _0x504fcd[_0x259c('0x1a')](_0x4b2d68,_0xe50d25)[_0x259c('0x1b')](function(_0x19a4d6){logger[_0x259c('0x1c')](_0x259c('0x1d'),_0x5088a6,_0x259c('0x1e'));logger[_0x259c('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5088a6,_0x259c('0x1e'),JSON[_0x259c('0x20')](_0x19a4d6));if(_0x19a4d6[_0x259c('0x21')]){if(_0x19a4d6[_0x259c('0x21')]['code']===0x1f4){logger[_0x259c('0x21')](_0x259c('0x1d'),_0x5088a6,_0x19a4d6[_0x259c('0x21')]['message']);return _0x46ef70(_0x19a4d6[_0x259c('0x21')][_0x259c('0x22')]);}logger['error'](_0x259c('0x1d'),_0x5088a6,_0x19a4d6[_0x259c('0x21')][_0x259c('0x22')]);return _0x188347(_0x19a4d6[_0x259c('0x21')][_0x259c('0x22')]);}else{logger['info'](_0x259c('0x1d'),_0x5088a6,_0x259c('0x1e'));_0x188347(_0x19a4d6[_0x259c('0x23')][_0x259c('0x22')]);}})[_0x259c('0x24')](function(_0xb0e21e){logger[_0x259c('0x21')](_0x259c('0x1d'),_0x5088a6,_0xb0e21e);_0x46ef70(_0xb0e21e);});});}function respondWithStatusCode(_0x2257cf,_0x38da2e){_0x38da2e=_0x38da2e||0xcc;return function(_0x33aa31){if(_0x33aa31){return _0x2257cf[_0x259c('0x25')](_0x38da2e);}return _0x2257cf[_0x259c('0x26')](_0x38da2e)[_0x259c('0x27')]();};}function respondWithResult(_0x4b4180,_0x1ac2cd){_0x1ac2cd=_0x1ac2cd||0xc8;return function(_0x51e5e9){if(_0x51e5e9){return _0x4b4180['status'](_0x1ac2cd)['json'](_0x51e5e9);}};}function respondWithFilteredResult(_0x90cdd8,_0x27cd81){return function(_0x4b09a3){if(_0x4b09a3){var _0x8544ed=_0x4b09a3[_0x259c('0x28')],_0x23d91a=_0x27cd81[_0x259c('0x29')],_0x45a2a0=_0x27cd81[_0x259c('0x29')]+_0x27cd81[_0x259c('0x2a')],_0xd337f0;if(_0x45a2a0>=_0x8544ed){_0x45a2a0=_0x8544ed;_0xd337f0=0xc8;}else{_0xd337f0=0xce;}_0x90cdd8[_0x259c('0x26')](_0xd337f0);return _0x90cdd8[_0x259c('0x2b')](_0x259c('0x2c'),_0x23d91a+'-'+_0x45a2a0+'/'+_0x8544ed)['json'](_0x4b09a3);}return null;};}function patchUpdates(_0x581f85){return function(_0x32888f){try{jsonpatch['apply'](_0x32888f,_0x581f85,!![]);}catch(_0x4fae63){return BPromise[_0x259c('0x2d')](_0x4fae63);}return _0x32888f['save']();};}function saveUpdates(_0x9d70ff,_0x2335e4){return function(_0x325ee3){if(_0x325ee3){return _0x325ee3[_0x259c('0x2e')](_0x9d70ff)[_0x259c('0x1b')](function(_0x3f0e3b){return _0x3f0e3b;});}return null;};}function removeEntity(_0x50d374,_0x4e8963){return function(_0x5d4038){if(_0x5d4038){return _0x5d4038['destroy']()['then'](function(){_0x50d374[_0x259c('0x26')](0xcc)[_0x259c('0x27')]();});}};}function handleEntityNotFound(_0x1f0c56,_0x2fec7e){return function(_0x3f5daa){if(!_0x3f5daa){_0x1f0c56['sendStatus'](0x194);}return _0x3f5daa;};}function handleError(_0xaf249c,_0x7bf7fe){_0x7bf7fe=_0x7bf7fe||0x1f4;return function(_0x1f1adf){logger[_0x259c('0x21')](_0x1f1adf[_0x259c('0x2f')]);if(_0x1f1adf[_0x259c('0x30')]){delete _0x1f1adf[_0x259c('0x30')];}_0xaf249c[_0x259c('0x26')](_0x7bf7fe)[_0x259c('0x31')](_0x1f1adf);};}exports[_0x259c('0x32')]=function(_0x687ab4,_0x3ca79e){var _0x372dfe={},_0x48a045={},_0xa1d580={'count':0x0,'rows':[]};var _0x12cebf=db[_0x259c('0x33')][_0x259c('0x34')];_0x48a045[_0x259c('0x35')]=_['keys'](_0x12cebf);_0x48a045[_0x259c('0x36')]=_['keys'](_0x687ab4[_0x259c('0x36')]);_0x48a045[_0x259c('0x37')]=_[_0x259c('0x38')](_0x48a045['model'],_0x48a045[_0x259c('0x36')]);_0x372dfe['attributes']=_[_0x259c('0x38')](_0x48a045[_0x259c('0x35')],qs['fields'](_0x687ab4[_0x259c('0x36')][_0x259c('0x39')]));_0x372dfe[_0x259c('0x3a')]=_0x372dfe[_0x259c('0x3a')][_0x259c('0x3b')]?_0x372dfe[_0x259c('0x3a')]:_0x48a045[_0x259c('0x35')];if(!_0x687ab4['query'][_0x259c('0x3c')](_0x259c('0x3d'))){_0x372dfe[_0x259c('0x2a')]=qs[_0x259c('0x2a')](_0x687ab4[_0x259c('0x36')][_0x259c('0x2a')]);_0x372dfe[_0x259c('0x29')]=qs['offset'](_0x687ab4['query'][_0x259c('0x29')]);}_0x372dfe['order']=qs[_0x259c('0x3e')](_0x687ab4['query']['sort']);_0x372dfe[_0x259c('0x3f')]=qs['filters'](_[_0x259c('0x40')](_0x687ab4[_0x259c('0x36')],_0x48a045[_0x259c('0x37')]));if(_0x687ab4[_0x259c('0x36')][_0x259c('0x41')]){_0x372dfe[_0x259c('0x3f')]=_[_0x259c('0x42')](_0x372dfe[_0x259c('0x3f')],{'$or':_[_0x259c('0x43')](_0x12cebf,function(_0x89b529){if(_0x89b529[_0x259c('0x44')][_0x259c('0x45')]!=='VIRTUAL'){var _0x7e77e7={};_0x7e77e7[_0x89b529[_0x259c('0x46')]]={'$like':'%'+_0x687ab4['query'][_0x259c('0x41')]+'%'};return _0x7e77e7;}})});}_0x372dfe=_['merge']({},_0x372dfe,_0x687ab4[_0x259c('0x47')]);var _0x4c70b5={'where':_0x372dfe['where']};return db['Dynamics365Configuration']['count'](_0x4c70b5)[_0x259c('0x1b')](function(_0x45f308){_0xa1d580['count']=_0x45f308;if(_0x687ab4[_0x259c('0x36')][_0x259c('0x48')]){_0x372dfe[_0x259c('0x49')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x372dfe);})['then'](function(_0x5f2549){_0xa1d580[_0x259c('0x4a')]=_0x5f2549;return _0xa1d580;})[_0x259c('0x1b')](respondWithFilteredResult(_0x3ca79e,_0x372dfe))['catch'](handleError(_0x3ca79e,null));};exports[_0x259c('0x4b')]=function(_0x4694c8,_0x9e26b3){var _0x4af6d9={'raw':![],'where':{'id':_0x4694c8['params']['id']}},_0x54652b={};_0x54652b['model']=_[_0x259c('0x4c')](db[_0x259c('0x33')][_0x259c('0x34')]);_0x54652b['query']=_[_0x259c('0x4c')](_0x4694c8[_0x259c('0x36')]);_0x54652b['filters']=_[_0x259c('0x38')](_0x54652b[_0x259c('0x35')],_0x54652b[_0x259c('0x36')]);_0x4af6d9[_0x259c('0x3a')]=_[_0x259c('0x38')](_0x54652b['model'],qs['fields'](_0x4694c8[_0x259c('0x36')][_0x259c('0x39')]));_0x4af6d9['attributes']=_0x4af6d9[_0x259c('0x3a')][_0x259c('0x3b')]?_0x4af6d9[_0x259c('0x3a')]:_0x54652b[_0x259c('0x35')];if(_0x4694c8[_0x259c('0x36')]['includeAll']){_0x4af6d9['include']=[{'all':!![]}];}_0x4af6d9=_[_0x259c('0x42')]({},_0x4af6d9,_0x4694c8[_0x259c('0x47')]);return db[_0x259c('0x33')]['find'](_0x4af6d9)[_0x259c('0x1b')](handleEntityNotFound(_0x9e26b3,null))[_0x259c('0x1b')](respondWithResult(_0x9e26b3,null))[_0x259c('0x24')](handleError(_0x9e26b3,null));};exports[_0x259c('0x4d')]=function(_0x3ffae2,_0x4870aa){return db['Dynamics365Configuration'][_0x259c('0x4d')](_0x3ffae2[_0x259c('0x4e')],{})['then'](respondWithResult(_0x4870aa,0xc9))[_0x259c('0x24')](handleError(_0x4870aa,null));};exports[_0x259c('0x2e')]=function(_0x419dd4,_0x3d3957){if(_0x419dd4[_0x259c('0x4e')]['id']){delete _0x419dd4[_0x259c('0x4e')]['id'];}return db[_0x259c('0x33')][_0x259c('0x4f')]({'where':{'id':_0x419dd4[_0x259c('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d3957,null))[_0x259c('0x1b')](saveUpdates(_0x419dd4[_0x259c('0x4e')],null))[_0x259c('0x1b')](respondWithResult(_0x3d3957,null))[_0x259c('0x24')](handleError(_0x3d3957,null));};exports['destroy']=function(_0x5697df,_0x19a719){return db[_0x259c('0x33')][_0x259c('0x4f')]({'where':{'id':_0x5697df['params']['id']}})[_0x259c('0x1b')](handleEntityNotFound(_0x19a719,null))['then'](removeEntity(_0x19a719,null))[_0x259c('0x24')](handleError(_0x19a719,null));};exports['getFields']=function(_0x11fafd,_0x526f5a,_0x2825ff){var _0x41fdb3={};var _0x5b0224={};var _0x2e3874;var _0x50e084;return db[_0x259c('0x33')]['findOne']({'where':{'id':_0x11fafd['params']['id']}})[_0x259c('0x1b')](handleEntityNotFound(_0x526f5a,null))[_0x259c('0x1b')](function(_0x3b0719){if(_0x3b0719){_0x2e3874=_0x3b0719;_0x5b0224[_0x259c('0x35')]=_[_0x259c('0x4c')](db['Dynamics365Field']['rawAttributes']);_0x5b0224[_0x259c('0x36')]=_[_0x259c('0x4c')](_0x11fafd[_0x259c('0x36')]);_0x5b0224[_0x259c('0x37')]=_[_0x259c('0x38')](_0x5b0224['model'],_0x5b0224[_0x259c('0x36')]);_0x41fdb3[_0x259c('0x3a')]=_[_0x259c('0x38')](_0x5b0224['model'],qs[_0x259c('0x39')](_0x11fafd[_0x259c('0x36')]['fields']));_0x41fdb3[_0x259c('0x3a')]=_0x41fdb3[_0x259c('0x3a')][_0x259c('0x3b')]?_0x41fdb3[_0x259c('0x3a')]:_0x5b0224['model'];_0x41fdb3[_0x259c('0x51')]=qs[_0x259c('0x3e')](_0x11fafd[_0x259c('0x36')][_0x259c('0x3e')]);_0x41fdb3[_0x259c('0x3f')]=qs[_0x259c('0x37')](_[_0x259c('0x40')](_0x11fafd[_0x259c('0x36')],_0x5b0224[_0x259c('0x37')]));if(_0x11fafd[_0x259c('0x36')]['filter']){_0x41fdb3['where']=_['merge'](_0x41fdb3[_0x259c('0x3f')],{'$or':_[_0x259c('0x43')](_0x41fdb3[_0x259c('0x3a')],function(_0xc3523f){var _0x37d4da={};_0x37d4da[_0xc3523f]={'$like':'%'+_0x11fafd[_0x259c('0x36')][_0x259c('0x41')]+'%'};return _0x37d4da;})});}_0x41fdb3=_[_0x259c('0x42')]({},_0x41fdb3,_0x11fafd[_0x259c('0x47')]);return _0x2e3874[_0x259c('0x52')](_0x41fdb3);}})[_0x259c('0x1b')](function(_0x3c938e){if(_0x3c938e){_0x50e084=_0x3c938e['length'];if(!_0x11fafd['query']['hasOwnProperty'](_0x259c('0x3d'))){_0x41fdb3[_0x259c('0x2a')]=qs[_0x259c('0x2a')](_0x11fafd[_0x259c('0x36')][_0x259c('0x2a')]);_0x41fdb3[_0x259c('0x29')]=qs[_0x259c('0x29')](_0x11fafd[_0x259c('0x36')]['offset']);}return _0x2e3874[_0x259c('0x52')](_0x41fdb3);}})[_0x259c('0x1b')](function(_0x35a955){if(_0x35a955){return _0x35a955?{'count':_0x50e084,'rows':_0x35a955}:null;}})['then'](respondWithResult(_0x526f5a,null))[_0x259c('0x24')](handleError(_0x526f5a,null));};exports[_0x259c('0x53')]=function(_0x27e998,_0x592ea3,_0x248329){var _0x2f64fb={};var _0xa944d3={};var _0x373c5a;var _0x2a9c05;return db['Dynamics365Configuration'][_0x259c('0x54')]({'where':{'id':_0x27e998[_0x259c('0x50')]['id']}})['then'](handleEntityNotFound(_0x592ea3,null))[_0x259c('0x1b')](function(_0x346fc0){if(_0x346fc0){_0x373c5a=_0x346fc0;_0xa944d3[_0x259c('0x35')]=_[_0x259c('0x4c')](db[_0x259c('0x55')][_0x259c('0x34')]);_0xa944d3['query']=_[_0x259c('0x4c')](_0x27e998[_0x259c('0x36')]);_0xa944d3[_0x259c('0x37')]=_[_0x259c('0x38')](_0xa944d3[_0x259c('0x35')],_0xa944d3[_0x259c('0x36')]);_0x2f64fb[_0x259c('0x3a')]=_['intersection'](_0xa944d3[_0x259c('0x35')],qs['fields'](_0x27e998[_0x259c('0x36')][_0x259c('0x39')]));_0x2f64fb['attributes']=_0x2f64fb[_0x259c('0x3a')][_0x259c('0x3b')]?_0x2f64fb[_0x259c('0x3a')]:_0xa944d3[_0x259c('0x35')];_0x2f64fb['order']=qs[_0x259c('0x3e')](_0x27e998[_0x259c('0x36')][_0x259c('0x3e')]);_0x2f64fb[_0x259c('0x3f')]=qs[_0x259c('0x37')](_[_0x259c('0x40')](_0x27e998[_0x259c('0x36')],_0xa944d3['filters']));if(_0x27e998[_0x259c('0x36')][_0x259c('0x41')]){_0x2f64fb['where']=_[_0x259c('0x42')](_0x2f64fb[_0x259c('0x3f')],{'$or':_['map'](_0x2f64fb[_0x259c('0x3a')],function(_0x5b6715){var _0x1afa54={};_0x1afa54[_0x5b6715]={'$like':'%'+_0x27e998[_0x259c('0x36')][_0x259c('0x41')]+'%'};return _0x1afa54;})});}_0x2f64fb=_[_0x259c('0x42')]({},_0x2f64fb,_0x27e998[_0x259c('0x47')]);return _0x373c5a['getSubjects'](_0x2f64fb);}})['then'](function(_0x178b23){if(_0x178b23){_0x2a9c05=_0x178b23[_0x259c('0x3b')];if(!_0x27e998[_0x259c('0x36')][_0x259c('0x3c')]('nolimit')){_0x2f64fb[_0x259c('0x2a')]=qs['limit'](_0x27e998[_0x259c('0x36')][_0x259c('0x2a')]);_0x2f64fb[_0x259c('0x29')]=qs[_0x259c('0x29')](_0x27e998[_0x259c('0x36')][_0x259c('0x29')]);}return _0x373c5a[_0x259c('0x53')](_0x2f64fb);}})[_0x259c('0x1b')](function(_0x5b83e7){if(_0x5b83e7){return _0x5b83e7?{'count':_0x2a9c05,'rows':_0x5b83e7}:null;}})[_0x259c('0x1b')](respondWithResult(_0x592ea3,null))[_0x259c('0x24')](handleError(_0x592ea3,null));};exports['getDescriptions']=function(_0x1d63c2,_0x11d520,_0xf4a112){var _0x100a6c={};var _0x7ca60={};var _0x4b053d;var _0xbe6087;return db[_0x259c('0x33')][_0x259c('0x54')]({'where':{'id':_0x1d63c2[_0x259c('0x50')]['id']}})['then'](handleEntityNotFound(_0x11d520,null))[_0x259c('0x1b')](function(_0x50688b){if(_0x50688b){_0x4b053d=_0x50688b;_0x7ca60[_0x259c('0x35')]=_[_0x259c('0x4c')](db[_0x259c('0x55')]['rawAttributes']);_0x7ca60[_0x259c('0x36')]=_['keys'](_0x1d63c2[_0x259c('0x36')]);_0x7ca60['filters']=_[_0x259c('0x38')](_0x7ca60[_0x259c('0x35')],_0x7ca60[_0x259c('0x36')]);_0x100a6c['attributes']=_['intersection'](_0x7ca60[_0x259c('0x35')],qs[_0x259c('0x39')](_0x1d63c2[_0x259c('0x36')][_0x259c('0x39')]));_0x100a6c['attributes']=_0x100a6c['attributes']['length']?_0x100a6c[_0x259c('0x3a')]:_0x7ca60['model'];_0x100a6c[_0x259c('0x51')]=qs[_0x259c('0x3e')](_0x1d63c2[_0x259c('0x36')][_0x259c('0x3e')]);_0x100a6c[_0x259c('0x3f')]=qs['filters'](_[_0x259c('0x40')](_0x1d63c2[_0x259c('0x36')],_0x7ca60[_0x259c('0x37')]));if(_0x1d63c2[_0x259c('0x36')][_0x259c('0x41')]){_0x100a6c[_0x259c('0x3f')]=_[_0x259c('0x42')](_0x100a6c[_0x259c('0x3f')],{'$or':_[_0x259c('0x43')](_0x100a6c[_0x259c('0x3a')],function(_0x308a5b){var _0xc076b8={};_0xc076b8[_0x308a5b]={'$like':'%'+_0x1d63c2['query'][_0x259c('0x41')]+'%'};return _0xc076b8;})});}_0x100a6c=_[_0x259c('0x42')]({},_0x100a6c,_0x1d63c2[_0x259c('0x47')]);return _0x4b053d[_0x259c('0x56')](_0x100a6c);}})[_0x259c('0x1b')](function(_0x47dc8d){if(_0x47dc8d){_0xbe6087=_0x47dc8d[_0x259c('0x3b')];if(!_0x1d63c2['query']['hasOwnProperty'](_0x259c('0x3d'))){_0x100a6c[_0x259c('0x2a')]=qs[_0x259c('0x2a')](_0x1d63c2['query'][_0x259c('0x2a')]);_0x100a6c[_0x259c('0x29')]=qs['offset'](_0x1d63c2['query']['offset']);}return _0x4b053d[_0x259c('0x56')](_0x100a6c);}})[_0x259c('0x1b')](function(_0x2515c1){if(_0x2515c1){return _0x2515c1?{'count':_0xbe6087,'rows':_0x2515c1}:null;}})[_0x259c('0x1b')](respondWithResult(_0x11d520,null))['catch'](handleError(_0x11d520,null));}; \ No newline at end of file +var _0x1c02=['Dynamics365Field','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','name','send','Dynamics365Configuration','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','length','find','create','body','findOne'];(function(_0x5a748e,_0x3b05c5){var _0x52f10f=function(_0x36379d){while(--_0x36379d){_0x5a748e['push'](_0x5a748e['shift']());}};_0x52f10f(++_0x3b05c5);}(_0x1c02,0xbe));var _0x21c0=function(_0x558050,_0x174ec4){_0x558050=_0x558050-0x0;var _0x3ee149=_0x1c02[_0x558050];return _0x3ee149;};'use strict';var pdf=require(_0x21c0('0x0'));var emlformat=require(_0x21c0('0x1'));var rimraf=require(_0x21c0('0x2'));var zipdir=require(_0x21c0('0x3'));var jsonpatch=require(_0x21c0('0x4'));var rp=require('request-promise');var moment=require(_0x21c0('0x5'));var BPromise=require(_0x21c0('0x6'));var Mustache=require(_0x21c0('0x7'));var util=require(_0x21c0('0x8'));var path=require(_0x21c0('0x9'));var sox=require(_0x21c0('0xa'));var csv=require(_0x21c0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x21c0('0xc'));var squel=require(_0x21c0('0xd'));var crypto=require('crypto');var jsforce=require(_0x21c0('0xe'));var deskjs=require(_0x21c0('0xf'));var toCsv=require(_0x21c0('0xb'));var querystring=require(_0x21c0('0x10'));var Papa=require(_0x21c0('0x11'));var Redis=require(_0x21c0('0x12'));var authService=require(_0x21c0('0x13'));var qs=require(_0x21c0('0x14'));var hardwareService=require(_0x21c0('0x15'));var logger=require(_0x21c0('0x16'))(_0x21c0('0x17'));var utils=require(_0x21c0('0x18'));var config=require(_0x21c0('0x19'));var db=require(_0x21c0('0x1a'))['db'];var jayson=require(_0x21c0('0x1b'));var client=jayson[_0x21c0('0x1c')][_0x21c0('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x47a6b4,_0x5b9390,_0x1d8a66){if(_0x1d8a66){var _0x5d0fe9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d0fe9[_0x21c0('0x1e')](_0x5b9390)){return _0x47a6b4;}else{throw new Error(_0x21c0('0x1f'));}}else{return _0x47a6b4;}}function respondWithRpcPromise(_0x42814e,_0x9255d5,_0x235b3f,_0x43b7c7){return new BPromise(function(_0x1a2a26,_0x3bfe28){var _0x39fbd0=_0x43b7c7||client;return _0x39fbd0[_0x21c0('0x20')](_0x42814e,_0x235b3f)['then'](function(_0x3d0ac2){logger['info'](_0x21c0('0x21'),_0x9255d5,_0x21c0('0x22'));logger[_0x21c0('0x23')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x9255d5,_0x21c0('0x22'),JSON['stringify'](_0x3d0ac2));if(_0x3d0ac2[_0x21c0('0x24')]){if(_0x3d0ac2['error'][_0x21c0('0x25')]===0x1f4){logger['error'](_0x21c0('0x21'),_0x9255d5,_0x3d0ac2[_0x21c0('0x24')][_0x21c0('0x26')]);return _0x3bfe28(_0x3d0ac2[_0x21c0('0x24')][_0x21c0('0x26')]);}logger[_0x21c0('0x24')](_0x21c0('0x21'),_0x9255d5,_0x3d0ac2[_0x21c0('0x24')][_0x21c0('0x26')]);return _0x1a2a26(_0x3d0ac2['error'][_0x21c0('0x26')]);}else{logger[_0x21c0('0x27')](_0x21c0('0x21'),_0x9255d5,_0x21c0('0x22'));_0x1a2a26(_0x3d0ac2['result'][_0x21c0('0x26')]);}})[_0x21c0('0x28')](function(_0x408167){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x9255d5,_0x408167);_0x3bfe28(_0x408167);});});}function respondWithStatusCode(_0x4b09b2,_0x35239d){_0x35239d=_0x35239d||0xcc;return function(_0x4931ff){if(_0x4931ff){return _0x4b09b2[_0x21c0('0x29')](_0x35239d);}return _0x4b09b2['status'](_0x35239d)[_0x21c0('0x2a')]();};}function respondWithResult(_0x3973a1,_0x565664){_0x565664=_0x565664||0xc8;return function(_0x43dd15){if(_0x43dd15){return _0x3973a1[_0x21c0('0x2b')](_0x565664)[_0x21c0('0x2c')](_0x43dd15);}};}function respondWithFilteredResult(_0xadde93,_0x5ccd11){return function(_0x1801e1){if(_0x1801e1){var _0x282487=_0x1801e1[_0x21c0('0x2d')],_0x34d1d7=_0x5ccd11['offset'],_0x487ff6=_0x5ccd11[_0x21c0('0x2e')]+_0x5ccd11[_0x21c0('0x2f')],_0x335a58;if(_0x487ff6>=_0x282487){_0x487ff6=_0x282487;_0x335a58=0xc8;}else{_0x335a58=0xce;}_0xadde93['status'](_0x335a58);return _0xadde93['set'](_0x21c0('0x30'),_0x34d1d7+'-'+_0x487ff6+'/'+_0x282487)[_0x21c0('0x2c')](_0x1801e1);}return null;};}function patchUpdates(_0x29d4fb){return function(_0x1f1fea){try{jsonpatch[_0x21c0('0x31')](_0x1f1fea,_0x29d4fb,!![]);}catch(_0x5772f1){return BPromise['reject'](_0x5772f1);}return _0x1f1fea[_0x21c0('0x32')]();};}function saveUpdates(_0x181067,_0x5c9f35){return function(_0x15ddac){if(_0x15ddac){return _0x15ddac[_0x21c0('0x33')](_0x181067)['then'](function(_0x36e79c){return _0x36e79c;});}return null;};}function removeEntity(_0xcef6a5,_0x32bdd4){return function(_0x5c6a5b){if(_0x5c6a5b){return _0x5c6a5b[_0x21c0('0x34')]()[_0x21c0('0x35')](function(){_0xcef6a5[_0x21c0('0x2b')](0xcc)[_0x21c0('0x2a')]();});}};}function handleEntityNotFound(_0x246985,_0xf50b0c){return function(_0x3b0cf4){if(!_0x3b0cf4){_0x246985['sendStatus'](0x194);}return _0x3b0cf4;};}function handleError(_0x48e9bd,_0x238873){_0x238873=_0x238873||0x1f4;return function(_0x47900a){logger[_0x21c0('0x24')](_0x47900a['stack']);if(_0x47900a['name']){delete _0x47900a[_0x21c0('0x36')];}_0x48e9bd[_0x21c0('0x2b')](_0x238873)[_0x21c0('0x37')](_0x47900a);};}exports['index']=function(_0x484e76,_0x3c42fd){var _0x2ac4d3={},_0x30e9b2={},_0x5202ab={'count':0x0,'rows':[]};var _0x1f3d8a=db[_0x21c0('0x38')]['rawAttributes'];_0x30e9b2[_0x21c0('0x39')]=_['keys'](_0x1f3d8a);_0x30e9b2['query']=_[_0x21c0('0x3a')](_0x484e76['query']);_0x30e9b2['filters']=_['intersection'](_0x30e9b2[_0x21c0('0x39')],_0x30e9b2[_0x21c0('0x3b')]);_0x2ac4d3[_0x21c0('0x3c')]=_['intersection'](_0x30e9b2[_0x21c0('0x39')],qs[_0x21c0('0x3d')](_0x484e76[_0x21c0('0x3b')][_0x21c0('0x3d')]));_0x2ac4d3['attributes']=_0x2ac4d3[_0x21c0('0x3c')]['length']?_0x2ac4d3[_0x21c0('0x3c')]:_0x30e9b2[_0x21c0('0x39')];if(!_0x484e76[_0x21c0('0x3b')][_0x21c0('0x3e')](_0x21c0('0x3f'))){_0x2ac4d3['limit']=qs['limit'](_0x484e76[_0x21c0('0x3b')][_0x21c0('0x2f')]);_0x2ac4d3[_0x21c0('0x2e')]=qs['offset'](_0x484e76['query'][_0x21c0('0x2e')]);}_0x2ac4d3[_0x21c0('0x40')]=qs[_0x21c0('0x41')](_0x484e76[_0x21c0('0x3b')]['sort']);_0x2ac4d3[_0x21c0('0x42')]=qs['filters'](_[_0x21c0('0x43')](_0x484e76['query'],_0x30e9b2[_0x21c0('0x44')]));if(_0x484e76['query'][_0x21c0('0x45')]){_0x2ac4d3[_0x21c0('0x42')]=_[_0x21c0('0x46')](_0x2ac4d3[_0x21c0('0x42')],{'$or':_[_0x21c0('0x47')](_0x1f3d8a,function(_0x53f952){if(_0x53f952[_0x21c0('0x48')]['key']!==_0x21c0('0x49')){var _0x5272d2={};_0x5272d2[_0x53f952[_0x21c0('0x4a')]]={'$like':'%'+_0x484e76['query'][_0x21c0('0x45')]+'%'};return _0x5272d2;}})});}_0x2ac4d3=_[_0x21c0('0x46')]({},_0x2ac4d3,_0x484e76[_0x21c0('0x4b')]);var _0x267bc1={'where':_0x2ac4d3[_0x21c0('0x42')]};return db[_0x21c0('0x38')][_0x21c0('0x2d')](_0x267bc1)[_0x21c0('0x35')](function(_0x543343){_0x5202ab[_0x21c0('0x2d')]=_0x543343;if(_0x484e76['query'][_0x21c0('0x4c')]){_0x2ac4d3[_0x21c0('0x4d')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x21c0('0x4e')](_0x2ac4d3);})[_0x21c0('0x35')](function(_0x5639ca){_0x5202ab[_0x21c0('0x4f')]=_0x5639ca;return _0x5202ab;})[_0x21c0('0x35')](respondWithFilteredResult(_0x3c42fd,_0x2ac4d3))[_0x21c0('0x28')](handleError(_0x3c42fd,null));};exports[_0x21c0('0x50')]=function(_0xdc5023,_0xc97279){var _0x33d5db={'raw':![],'where':{'id':_0xdc5023[_0x21c0('0x51')]['id']}},_0x2bb220={};_0x2bb220[_0x21c0('0x39')]=_['keys'](db['Dynamics365Configuration'][_0x21c0('0x52')]);_0x2bb220['query']=_[_0x21c0('0x3a')](_0xdc5023[_0x21c0('0x3b')]);_0x2bb220[_0x21c0('0x44')]=_['intersection'](_0x2bb220[_0x21c0('0x39')],_0x2bb220[_0x21c0('0x3b')]);_0x33d5db[_0x21c0('0x3c')]=_[_0x21c0('0x53')](_0x2bb220[_0x21c0('0x39')],qs[_0x21c0('0x3d')](_0xdc5023['query']['fields']));_0x33d5db[_0x21c0('0x3c')]=_0x33d5db['attributes'][_0x21c0('0x54')]?_0x33d5db['attributes']:_0x2bb220[_0x21c0('0x39')];if(_0xdc5023[_0x21c0('0x3b')][_0x21c0('0x4c')]){_0x33d5db[_0x21c0('0x4d')]=[{'all':!![]}];}_0x33d5db=_[_0x21c0('0x46')]({},_0x33d5db,_0xdc5023[_0x21c0('0x4b')]);return db[_0x21c0('0x38')][_0x21c0('0x55')](_0x33d5db)[_0x21c0('0x35')](handleEntityNotFound(_0xc97279,null))['then'](respondWithResult(_0xc97279,null))[_0x21c0('0x28')](handleError(_0xc97279,null));};exports[_0x21c0('0x56')]=function(_0x43a402,_0x556684){return db['Dynamics365Configuration'][_0x21c0('0x56')](_0x43a402[_0x21c0('0x57')],{})[_0x21c0('0x35')](respondWithResult(_0x556684,0xc9))['catch'](handleError(_0x556684,null));};exports['update']=function(_0x877785,_0x14f781){if(_0x877785[_0x21c0('0x57')]['id']){delete _0x877785['body']['id'];}return db[_0x21c0('0x38')][_0x21c0('0x55')]({'where':{'id':_0x877785['params']['id']}})[_0x21c0('0x35')](handleEntityNotFound(_0x14f781,null))[_0x21c0('0x35')](saveUpdates(_0x877785[_0x21c0('0x57')],null))[_0x21c0('0x35')](respondWithResult(_0x14f781,null))['catch'](handleError(_0x14f781,null));};exports[_0x21c0('0x34')]=function(_0x544b63,_0x3ed0bd){return db[_0x21c0('0x38')][_0x21c0('0x55')]({'where':{'id':_0x544b63['params']['id']}})[_0x21c0('0x35')](handleEntityNotFound(_0x3ed0bd,null))[_0x21c0('0x35')](removeEntity(_0x3ed0bd,null))[_0x21c0('0x28')](handleError(_0x3ed0bd,null));};exports['getFields']=function(_0x355fd0,_0x3acee5,_0x123386){var _0x30a6b3={};var _0x123962={};var _0x237b8c;var _0x2eb525;return db[_0x21c0('0x38')][_0x21c0('0x58')]({'where':{'id':_0x355fd0[_0x21c0('0x51')]['id']}})['then'](handleEntityNotFound(_0x3acee5,null))[_0x21c0('0x35')](function(_0x38b72d){if(_0x38b72d){_0x237b8c=_0x38b72d;_0x123962[_0x21c0('0x39')]=_[_0x21c0('0x3a')](db[_0x21c0('0x59')]['rawAttributes']);_0x123962[_0x21c0('0x3b')]=_[_0x21c0('0x3a')](_0x355fd0[_0x21c0('0x3b')]);_0x123962['filters']=_[_0x21c0('0x53')](_0x123962[_0x21c0('0x39')],_0x123962[_0x21c0('0x3b')]);_0x30a6b3[_0x21c0('0x3c')]=_[_0x21c0('0x53')](_0x123962['model'],qs[_0x21c0('0x3d')](_0x355fd0[_0x21c0('0x3b')]['fields']));_0x30a6b3[_0x21c0('0x3c')]=_0x30a6b3[_0x21c0('0x3c')][_0x21c0('0x54')]?_0x30a6b3[_0x21c0('0x3c')]:_0x123962[_0x21c0('0x39')];_0x30a6b3[_0x21c0('0x40')]=qs['sort'](_0x355fd0[_0x21c0('0x3b')][_0x21c0('0x41')]);_0x30a6b3[_0x21c0('0x42')]=qs[_0x21c0('0x44')](_[_0x21c0('0x43')](_0x355fd0['query'],_0x123962[_0x21c0('0x44')]));if(_0x355fd0[_0x21c0('0x3b')][_0x21c0('0x45')]){_0x30a6b3[_0x21c0('0x42')]=_[_0x21c0('0x46')](_0x30a6b3[_0x21c0('0x42')],{'$or':_[_0x21c0('0x47')](_0x30a6b3['attributes'],function(_0x32e8da){var _0xc432f4={};_0xc432f4[_0x32e8da]={'$like':'%'+_0x355fd0[_0x21c0('0x3b')]['filter']+'%'};return _0xc432f4;})});}_0x30a6b3=_['merge']({},_0x30a6b3,_0x355fd0[_0x21c0('0x4b')]);return _0x237b8c[_0x21c0('0x5a')](_0x30a6b3);}})[_0x21c0('0x35')](function(_0x67170c){if(_0x67170c){_0x2eb525=_0x67170c['length'];if(!_0x355fd0[_0x21c0('0x3b')]['hasOwnProperty'](_0x21c0('0x3f'))){_0x30a6b3[_0x21c0('0x2f')]=qs[_0x21c0('0x2f')](_0x355fd0[_0x21c0('0x3b')][_0x21c0('0x2f')]);_0x30a6b3['offset']=qs[_0x21c0('0x2e')](_0x355fd0[_0x21c0('0x3b')][_0x21c0('0x2e')]);}return _0x237b8c[_0x21c0('0x5a')](_0x30a6b3);}})[_0x21c0('0x35')](function(_0x3de7bd){if(_0x3de7bd){return _0x3de7bd?{'count':_0x2eb525,'rows':_0x3de7bd}:null;}})[_0x21c0('0x35')](respondWithResult(_0x3acee5,null))[_0x21c0('0x28')](handleError(_0x3acee5,null));};exports[_0x21c0('0x5b')]=function(_0x4798c8,_0x288885,_0x58573b){var _0x1b1f4b={};var _0xe126ab={};var _0x12da2d;var _0x17356e;return db[_0x21c0('0x38')]['findOne']({'where':{'id':_0x4798c8[_0x21c0('0x51')]['id']}})['then'](handleEntityNotFound(_0x288885,null))['then'](function(_0x402fe1){if(_0x402fe1){_0x12da2d=_0x402fe1;_0xe126ab[_0x21c0('0x39')]=_[_0x21c0('0x3a')](db[_0x21c0('0x59')][_0x21c0('0x52')]);_0xe126ab['query']=_[_0x21c0('0x3a')](_0x4798c8[_0x21c0('0x3b')]);_0xe126ab['filters']=_[_0x21c0('0x53')](_0xe126ab[_0x21c0('0x39')],_0xe126ab[_0x21c0('0x3b')]);_0x1b1f4b['attributes']=_[_0x21c0('0x53')](_0xe126ab['model'],qs[_0x21c0('0x3d')](_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x3d')]));_0x1b1f4b[_0x21c0('0x3c')]=_0x1b1f4b[_0x21c0('0x3c')][_0x21c0('0x54')]?_0x1b1f4b[_0x21c0('0x3c')]:_0xe126ab[_0x21c0('0x39')];_0x1b1f4b[_0x21c0('0x40')]=qs[_0x21c0('0x41')](_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x41')]);_0x1b1f4b['where']=qs[_0x21c0('0x44')](_[_0x21c0('0x43')](_0x4798c8[_0x21c0('0x3b')],_0xe126ab[_0x21c0('0x44')]));if(_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x45')]){_0x1b1f4b[_0x21c0('0x42')]=_[_0x21c0('0x46')](_0x1b1f4b[_0x21c0('0x42')],{'$or':_['map'](_0x1b1f4b[_0x21c0('0x3c')],function(_0x30f356){var _0x4ccbd1={};_0x4ccbd1[_0x30f356]={'$like':'%'+_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x45')]+'%'};return _0x4ccbd1;})});}_0x1b1f4b=_[_0x21c0('0x46')]({},_0x1b1f4b,_0x4798c8[_0x21c0('0x4b')]);return _0x12da2d['getSubjects'](_0x1b1f4b);}})['then'](function(_0x3742dc){if(_0x3742dc){_0x17356e=_0x3742dc[_0x21c0('0x54')];if(!_0x4798c8['query'][_0x21c0('0x3e')]('nolimit')){_0x1b1f4b[_0x21c0('0x2f')]=qs['limit'](_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x2f')]);_0x1b1f4b[_0x21c0('0x2e')]=qs[_0x21c0('0x2e')](_0x4798c8[_0x21c0('0x3b')][_0x21c0('0x2e')]);}return _0x12da2d[_0x21c0('0x5b')](_0x1b1f4b);}})[_0x21c0('0x35')](function(_0x3d4b7f){if(_0x3d4b7f){return _0x3d4b7f?{'count':_0x17356e,'rows':_0x3d4b7f}:null;}})[_0x21c0('0x35')](respondWithResult(_0x288885,null))[_0x21c0('0x28')](handleError(_0x288885,null));};exports['getDescriptions']=function(_0x3f3233,_0x5aac98,_0x4dee88){var _0x588b53={};var _0x43eef8={};var _0x1efa0e;var _0x4ed19e;return db[_0x21c0('0x38')][_0x21c0('0x58')]({'where':{'id':_0x3f3233[_0x21c0('0x51')]['id']}})[_0x21c0('0x35')](handleEntityNotFound(_0x5aac98,null))[_0x21c0('0x35')](function(_0x33e110){if(_0x33e110){_0x1efa0e=_0x33e110;_0x43eef8[_0x21c0('0x39')]=_['keys'](db[_0x21c0('0x59')][_0x21c0('0x52')]);_0x43eef8[_0x21c0('0x3b')]=_['keys'](_0x3f3233[_0x21c0('0x3b')]);_0x43eef8['filters']=_[_0x21c0('0x53')](_0x43eef8[_0x21c0('0x39')],_0x43eef8[_0x21c0('0x3b')]);_0x588b53[_0x21c0('0x3c')]=_[_0x21c0('0x53')](_0x43eef8[_0x21c0('0x39')],qs[_0x21c0('0x3d')](_0x3f3233[_0x21c0('0x3b')]['fields']));_0x588b53[_0x21c0('0x3c')]=_0x588b53['attributes'][_0x21c0('0x54')]?_0x588b53[_0x21c0('0x3c')]:_0x43eef8[_0x21c0('0x39')];_0x588b53[_0x21c0('0x40')]=qs[_0x21c0('0x41')](_0x3f3233[_0x21c0('0x3b')]['sort']);_0x588b53[_0x21c0('0x42')]=qs[_0x21c0('0x44')](_[_0x21c0('0x43')](_0x3f3233[_0x21c0('0x3b')],_0x43eef8[_0x21c0('0x44')]));if(_0x3f3233[_0x21c0('0x3b')][_0x21c0('0x45')]){_0x588b53[_0x21c0('0x42')]=_[_0x21c0('0x46')](_0x588b53[_0x21c0('0x42')],{'$or':_[_0x21c0('0x47')](_0x588b53[_0x21c0('0x3c')],function(_0x5743ba){var _0x3753ce={};_0x3753ce[_0x5743ba]={'$like':'%'+_0x3f3233[_0x21c0('0x3b')]['filter']+'%'};return _0x3753ce;})});}_0x588b53=_['merge']({},_0x588b53,_0x3f3233[_0x21c0('0x4b')]);return _0x1efa0e[_0x21c0('0x5c')](_0x588b53);}})[_0x21c0('0x35')](function(_0x42e6ca){if(_0x42e6ca){_0x4ed19e=_0x42e6ca[_0x21c0('0x54')];if(!_0x3f3233[_0x21c0('0x3b')]['hasOwnProperty'](_0x21c0('0x3f'))){_0x588b53[_0x21c0('0x2f')]=qs[_0x21c0('0x2f')](_0x3f3233[_0x21c0('0x3b')][_0x21c0('0x2f')]);_0x588b53['offset']=qs['offset'](_0x3f3233[_0x21c0('0x3b')][_0x21c0('0x2e')]);}return _0x1efa0e['getDescriptions'](_0x588b53);}})[_0x21c0('0x35')](function(_0x3bd6a2){if(_0x3bd6a2){return _0x3bd6a2?{'count':_0x4ed19e,'rows':_0x3bd6a2}:null;}})['then'](respondWithResult(_0x5aac98,null))[_0x21c0('0x28')](handleError(_0x5aac98,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7268d98..ac9f123 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 _0x70bc=['../../config/environment','define','Dynamics365Configuration','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0xbaa1b9,_0x9cde26){var _0x46b10e=function(_0x353474){while(--_0x353474){_0xbaa1b9['push'](_0xbaa1b9['shift']());}};_0x46b10e(++_0x9cde26);}(_0x70bc,0x1a1));var _0xc70b=function(_0x1a651c,_0x35a72e){_0x1a651c=_0x1a651c-0x0;var _0x5c6b97=_0x70bc[_0x1a651c];return _0x5c6b97;};'use strict';var _=require(_0xc70b('0x0'));var util=require('util');var logger=require(_0xc70b('0x1'))(_0xc70b('0x2'));var moment=require('moment');var BPromise=require(_0xc70b('0x3'));var rp=require(_0xc70b('0x4'));var fs=require('fs');var path=require(_0xc70b('0x5'));var rimraf=require('rimraf');var config=require(_0xc70b('0x6'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x34c32a,_0x5282a3){return _0x34c32a[_0xc70b('0x7')](_0xc70b('0x8'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fef=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x7fef,0xf9));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7fe('0x0'));var util=require(_0xf7fe('0x1'));var logger=require(_0xf7fe('0x2'))(_0xf7fe('0x3'));var moment=require(_0xf7fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7fe('0x5'));var fs=require('fs');var path=require(_0xf7fe('0x6'));var rimraf=require(_0xf7fe('0x7'));var config=require(_0xf7fe('0x8'));var attributes=require(_0xf7fe('0x9'));module[_0xf7fe('0xa')]=function(_0x2e704e,_0x520b21){return _0x2e704e['define'](_0xf7fe('0xb'),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 431bf0c..694c37f 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 _0xd626=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd626,0x75));var _0x6d62=function(_0xc4d065,_0xa616b8){_0xc4d065=_0xc4d065-0x0;var _0x43f234=_0xd626[_0xc4d065];return _0x43f234;};'use strict';var _=require(_0x6d62('0x0'));var util=require(_0x6d62('0x1'));var moment=require(_0x6d62('0x2'));var BPromise=require(_0x6d62('0x3'));var rs=require(_0x6d62('0x4'));var fs=require('fs');var Redis=require(_0x6d62('0x5'));var db=require(_0x6d62('0x6'))['db'];var utils=require(_0x6d62('0x7'));var logger=require(_0x6d62('0x8'))(_0x6d62('0x9'));var config=require(_0x6d62('0xa'));var jayson=require(_0x6d62('0xb'));var client=jayson['client'][_0x6d62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228478,_0x45d83c,_0x59ac08){return new BPromise(function(_0x4126bf,_0x4430a3){return client[_0x6d62('0xd')](_0x228478,_0x59ac08)[_0x6d62('0xe')](function(_0x25880f){logger['info'](_0x6d62('0xf'),_0x45d83c,_0x6d62('0x10'));logger[_0x6d62('0x11')](_0x6d62('0x12'),_0x45d83c,_0x6d62('0x10'),JSON['stringify'](_0x25880f));if(_0x25880f[_0x6d62('0x13')]){if(_0x25880f[_0x6d62('0x13')][_0x6d62('0x14')]===0x1f4){logger[_0x6d62('0x13')](_0x6d62('0xf'),_0x45d83c,_0x25880f['error'][_0x6d62('0x15')]);return _0x4430a3(_0x25880f['error'][_0x6d62('0x15')]);}logger[_0x6d62('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x45d83c,_0x25880f[_0x6d62('0x13')]['message']);return _0x4126bf(_0x25880f[_0x6d62('0x13')][_0x6d62('0x15')]);}else{logger[_0x6d62('0x16')](_0x6d62('0xf'),_0x45d83c,'request\x20sent');_0x4126bf(_0x25880f[_0x6d62('0x17')]['message']);}})[_0x6d62('0x18')](function(_0x173d64){logger[_0x6d62('0x13')](_0x6d62('0xf'),_0x45d83c,_0x173d64);_0x4430a3(_0x173d64);});});} \ No newline at end of file +var _0x875a=['Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x204b6,_0x119b99){var _0x11d7d9=function(_0x4b3057){while(--_0x4b3057){_0x204b6['push'](_0x204b6['shift']());}};_0x11d7d9(++_0x119b99);}(_0x875a,0x117));var _0xa875=function(_0x32c4e3,_0x51427f){_0x32c4e3=_0x32c4e3-0x0;var _0x55beee=_0x875a[_0x32c4e3];return _0x55beee;};'use strict';var _=require(_0xa875('0x0'));var util=require(_0xa875('0x1'));var moment=require(_0xa875('0x2'));var BPromise=require(_0xa875('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa875('0x4'));var db=require(_0xa875('0x5'))['db'];var utils=require(_0xa875('0x6'));var logger=require(_0xa875('0x7'))(_0xa875('0x8'));var config=require(_0xa875('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa875('0xa')][_0xa875('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17c4af,_0x2b9ac2,_0x5dd5a3){return new BPromise(function(_0x48c4ae,_0x58146d){return client[_0xa875('0xc')](_0x17c4af,_0x5dd5a3)[_0xa875('0xd')](function(_0x3b3ebc){logger[_0xa875('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b9ac2,_0xa875('0xf'));logger['debug'](_0xa875('0x10'),_0x2b9ac2,_0xa875('0xf'),JSON[_0xa875('0x11')](_0x3b3ebc));if(_0x3b3ebc[_0xa875('0x12')]){if(_0x3b3ebc['error'][_0xa875('0x13')]===0x1f4){logger[_0xa875('0x12')](_0xa875('0x14'),_0x2b9ac2,_0x3b3ebc[_0xa875('0x12')]['message']);return _0x58146d(_0x3b3ebc[_0xa875('0x12')][_0xa875('0x15')]);}logger[_0xa875('0x12')](_0xa875('0x14'),_0x2b9ac2,_0x3b3ebc[_0xa875('0x12')][_0xa875('0x15')]);return _0x48c4ae(_0x3b3ebc['error'][_0xa875('0x15')]);}else{logger['info'](_0xa875('0x14'),_0x2b9ac2,_0xa875('0xf'));_0x48c4ae(_0x3b3ebc['result'][_0xa875('0x15')]);}})[_0xa875('0x16')](function(_0xc33bb7){logger['error'](_0xa875('0x14'),_0x2b9ac2,_0xc33bb7);_0x58146d(_0xc33bb7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 497af7b..a6d5bb1 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 _0x00b2=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','put','update'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x00b2,0x110));var _0x200b=function(_0x5f358e,_0x56e0e0){_0x5f358e=_0x5f358e-0x0;var _0x1c9f67=_0x00b2[_0x5f358e];return _0x1c9f67;};'use strict';var multer=require(_0x200b('0x0'));var util=require(_0x200b('0x1'));var path=require(_0x200b('0x2'));var timeout=require(_0x200b('0x3'));var express=require('express');var router=express[_0x200b('0x4')]();var auth=require(_0x200b('0x5'));var interaction=require(_0x200b('0x6'));var config=require(_0x200b('0x7'));var controller=require('./intDynamics365Field.controller');router[_0x200b('0x8')]('/',auth['isAuthenticated'](),controller[_0x200b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x200b('0xa')]);router[_0x200b('0xb')]('/',auth[_0x200b('0xc')](),controller[_0x200b('0xd')]);router[_0x200b('0xe')]('/:id',auth[_0x200b('0xc')](),controller[_0x200b('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x200b('0x10')]);module[_0x200b('0x11')]=router; \ No newline at end of file +var _0x3323=['post','create','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x3323,0x16c));var _0x3332=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3323[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x3332('0x0'));var util=require(_0x3332('0x1'));var path=require('path');var timeout=require(_0x3332('0x2'));var express=require(_0x3332('0x3'));var router=express[_0x3332('0x4')]();var auth=require(_0x3332('0x5'));var interaction=require(_0x3332('0x6'));var config=require(_0x3332('0x7'));var controller=require(_0x3332('0x8'));router[_0x3332('0x9')]('/',auth['isAuthenticated'](),controller[_0x3332('0xa')]);router['get'](_0x3332('0xb'),auth[_0x3332('0xc')](),controller[_0x3332('0xd')]);router[_0x3332('0xe')]('/',auth['isAuthenticated'](),controller[_0x3332('0xf')]);router['put'](_0x3332('0xb'),auth[_0x3332('0xc')](),controller['update']);router['delete'](_0x3332('0xb'),auth['isAuthenticated'](),controller[_0x3332('0x10')]);module[_0x3332('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a39031e..3036c9a 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 _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x15ad02,_0x56ace9){var _0x3c87da=function(_0x32ced0){while(--_0x32ced0){_0x15ad02['push'](_0x15ad02['shift']());}};_0x3c87da(++_0x56ace9);}(_0xb58b,0x1f1));var _0xbb58=function(_0x2c139b,_0x55724a){_0x2c139b=_0x2c139b-0x0;var _0x50a72b=_0xb58b[_0x2c139b];return _0x50a72b;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file +var _0xf4eb=['string','variable','sequelize','customVariable','STRING','ENUM'];(function(_0x4fa8b3,_0x59d119){var _0x2b4be1=function(_0x47b8cd){while(--_0x47b8cd){_0x4fa8b3['push'](_0x4fa8b3['shift']());}};_0x2b4be1(++_0x59d119);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2d053b,_0x45cb50){_0x2d053b=_0x2d053b-0x0;var _0x38e5ec=_0xf4eb[_0x2d053b];return _0x38e5ec;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xbf4e('0x1'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf4e('0x2')]},'key':{'type':Sequelize[_0xbf4e('0x2')]},'keyType':{'type':Sequelize[_0xbf4e('0x3')](_0xbf4e('0x4'),_0xbf4e('0x5'),_0xbf4e('0x1'))},'keyContent':{'type':Sequelize[_0xbf4e('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf4e('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index b59d145..539d2b6 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 _0x98be=['merge','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','Dynamics365Field','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x39bf53,_0x367c0f){var _0x1a1afc=function(_0x42334c){while(--_0x42334c){_0x39bf53['push'](_0x39bf53['shift']());}};_0x1a1afc(++_0x367c0f);}(_0x98be,0x1e5));var _0xe98b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x98be[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require(_0xe98b('0x0'));var emlformat=require(_0xe98b('0x1'));var rimraf=require(_0xe98b('0x2'));var zipdir=require(_0xe98b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe98b('0x4'));var moment=require(_0xe98b('0x5'));var BPromise=require(_0xe98b('0x6'));var Mustache=require(_0xe98b('0x7'));var util=require(_0xe98b('0x8'));var path=require(_0xe98b('0x9'));var sox=require(_0xe98b('0xa'));var csv=require(_0xe98b('0xb'));var ejs=require(_0xe98b('0xc'));var fs=require('fs');var _=require(_0xe98b('0xd'));var squel=require(_0xe98b('0xe'));var crypto=require(_0xe98b('0xf'));var jsforce=require(_0xe98b('0x10'));var deskjs=require(_0xe98b('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe98b('0x12'));var Papa=require('papaparse');var Redis=require(_0xe98b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe98b('0x14'));var hardwareService=require(_0xe98b('0x15'));var logger=require(_0xe98b('0x16'))('api');var utils=require(_0xe98b('0x17'));var config=require(_0xe98b('0x18'));var db=require(_0xe98b('0x19'))['db'];function respondWithStatusCode(_0x51ee68,_0x5ec3a8){_0x5ec3a8=_0x5ec3a8||0xcc;return function(_0x392a08){if(_0x392a08){return _0x51ee68[_0xe98b('0x1a')](_0x5ec3a8);}return _0x51ee68[_0xe98b('0x1b')](_0x5ec3a8)[_0xe98b('0x1c')]();};}function respondWithResult(_0x2913f6,_0x5b56a2){_0x5b56a2=_0x5b56a2||0xc8;return function(_0x2e615a){if(_0x2e615a){return _0x2913f6[_0xe98b('0x1b')](_0x5b56a2)[_0xe98b('0x1d')](_0x2e615a);}};}function respondWithFilteredResult(_0x3632b3,_0x58efa3){return function(_0x3aa8f1){if(_0x3aa8f1){var _0x36ba2b=_0x3aa8f1[_0xe98b('0x1e')],_0x269af6=_0x58efa3[_0xe98b('0x1f')],_0x2bd843=_0x58efa3[_0xe98b('0x1f')]+_0x58efa3[_0xe98b('0x20')],_0x1738d4;if(_0x2bd843>=_0x36ba2b){_0x2bd843=_0x36ba2b;_0x1738d4=0xc8;}else{_0x1738d4=0xce;}_0x3632b3[_0xe98b('0x1b')](_0x1738d4);return _0x3632b3[_0xe98b('0x21')]('Content-Range',_0x269af6+'-'+_0x2bd843+'/'+_0x36ba2b)[_0xe98b('0x1d')](_0x3aa8f1);}return null;};}function patchUpdates(_0x1cb009){return function(_0x28e201){try{jsonpatch[_0xe98b('0x22')](_0x28e201,_0x1cb009,!![]);}catch(_0x1abd0f){return BPromise[_0xe98b('0x23')](_0x1abd0f);}return _0x28e201[_0xe98b('0x24')]();};}function saveUpdates(_0x28b310,_0x4b32a1){return function(_0x11215b){if(_0x11215b){return _0x11215b[_0xe98b('0x25')](_0x28b310)['then'](function(_0x150342){return _0x150342;});}return null;};}function removeEntity(_0x51a982,_0x3b7e3c){return function(_0x4b23b2){if(_0x4b23b2){return _0x4b23b2[_0xe98b('0x26')]()[_0xe98b('0x27')](function(){_0x51a982[_0xe98b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc02f,_0x516723){return function(_0x16e058){if(!_0x16e058){_0x3cc02f[_0xe98b('0x1a')](0x194);}return _0x16e058;};}function handleError(_0x321cf0,_0x4ec43e){_0x4ec43e=_0x4ec43e||0x1f4;return function(_0x1c915a){logger[_0xe98b('0x28')](_0x1c915a[_0xe98b('0x29')]);if(_0x1c915a[_0xe98b('0x2a')]){delete _0x1c915a[_0xe98b('0x2a')];}_0x321cf0[_0xe98b('0x1b')](_0x4ec43e)[_0xe98b('0x2b')](_0x1c915a);};}exports[_0xe98b('0x2c')]=function(_0x486d66,_0x195cc6){var _0xee5df={},_0x33cfae={},_0x13c104={'count':0x0,'rows':[]};var _0x4bd7ef=db[_0xe98b('0x2d')][_0xe98b('0x2e')];_0x33cfae['model']=_['keys'](_0x4bd7ef);_0x33cfae[_0xe98b('0x2f')]=_[_0xe98b('0x30')](_0x486d66['query']);_0x33cfae[_0xe98b('0x31')]=_[_0xe98b('0x32')](_0x33cfae[_0xe98b('0x33')],_0x33cfae['query']);_0xee5df[_0xe98b('0x34')]=_[_0xe98b('0x32')](_0x33cfae[_0xe98b('0x33')],qs[_0xe98b('0x35')](_0x486d66[_0xe98b('0x2f')][_0xe98b('0x35')]));_0xee5df[_0xe98b('0x34')]=_0xee5df[_0xe98b('0x34')]['length']?_0xee5df['attributes']:_0x33cfae[_0xe98b('0x33')];if(!_0x486d66['query'][_0xe98b('0x36')](_0xe98b('0x37'))){_0xee5df[_0xe98b('0x20')]=qs[_0xe98b('0x20')](_0x486d66['query'][_0xe98b('0x20')]);_0xee5df[_0xe98b('0x1f')]=qs['offset'](_0x486d66[_0xe98b('0x2f')][_0xe98b('0x1f')]);}_0xee5df[_0xe98b('0x38')]=qs[_0xe98b('0x39')](_0x486d66[_0xe98b('0x2f')]['sort']);_0xee5df[_0xe98b('0x3a')]=qs[_0xe98b('0x31')](_[_0xe98b('0x3b')](_0x486d66[_0xe98b('0x2f')],_0x33cfae[_0xe98b('0x31')]));if(_0x486d66[_0xe98b('0x2f')][_0xe98b('0x3c')]){_0xee5df[_0xe98b('0x3a')]=_[_0xe98b('0x3d')](_0xee5df['where'],{'$or':_['map'](_0x4bd7ef,function(_0x4c18f8){if(_0x4c18f8[_0xe98b('0x3e')][_0xe98b('0x3f')]!==_0xe98b('0x40')){var _0x222925={};_0x222925[_0x4c18f8[_0xe98b('0x41')]]={'$like':'%'+_0x486d66[_0xe98b('0x2f')][_0xe98b('0x3c')]+'%'};return _0x222925;}})});}_0xee5df=_['merge']({},_0xee5df,_0x486d66[_0xe98b('0x42')]);var _0x1ddbe3={'where':_0xee5df[_0xe98b('0x3a')]};return db[_0xe98b('0x2d')]['count'](_0x1ddbe3)[_0xe98b('0x27')](function(_0x455d7d){_0x13c104[_0xe98b('0x1e')]=_0x455d7d;if(_0x486d66[_0xe98b('0x2f')]['includeAll']){_0xee5df[_0xe98b('0x43')]=[{'all':!![]}];}return db[_0xe98b('0x2d')][_0xe98b('0x44')](_0xee5df);})[_0xe98b('0x27')](function(_0x3a2763){_0x13c104[_0xe98b('0x45')]=_0x3a2763;return _0x13c104;})[_0xe98b('0x27')](respondWithFilteredResult(_0x195cc6,_0xee5df))[_0xe98b('0x46')](handleError(_0x195cc6,null));};exports[_0xe98b('0x47')]=function(_0x2f3fcd,_0x50f87d){var _0x29cfb0={'raw':!![],'where':{'id':_0x2f3fcd[_0xe98b('0x48')]['id']}},_0x42cc28={};_0x42cc28[_0xe98b('0x33')]=_[_0xe98b('0x30')](db[_0xe98b('0x2d')][_0xe98b('0x2e')]);_0x42cc28['query']=_[_0xe98b('0x30')](_0x2f3fcd['query']);_0x42cc28['filters']=_[_0xe98b('0x32')](_0x42cc28['model'],_0x42cc28[_0xe98b('0x2f')]);_0x29cfb0[_0xe98b('0x34')]=_[_0xe98b('0x32')](_0x42cc28[_0xe98b('0x33')],qs[_0xe98b('0x35')](_0x2f3fcd[_0xe98b('0x2f')]['fields']));_0x29cfb0[_0xe98b('0x34')]=_0x29cfb0['attributes'][_0xe98b('0x49')]?_0x29cfb0[_0xe98b('0x34')]:_0x42cc28['model'];if(_0x2f3fcd[_0xe98b('0x2f')][_0xe98b('0x4a')]){_0x29cfb0[_0xe98b('0x43')]=[{'all':!![]}];}_0x29cfb0=_[_0xe98b('0x3d')]({},_0x29cfb0,_0x2f3fcd[_0xe98b('0x42')]);return db[_0xe98b('0x2d')][_0xe98b('0x4b')](_0x29cfb0)[_0xe98b('0x27')](handleEntityNotFound(_0x50f87d,null))[_0xe98b('0x27')](respondWithResult(_0x50f87d,null))['catch'](handleError(_0x50f87d,null));};exports['create']=function(_0x3961c7,_0x392e5c){return db[_0xe98b('0x2d')][_0xe98b('0x4c')](_0x3961c7[_0xe98b('0x4d')],{})[_0xe98b('0x27')](respondWithResult(_0x392e5c,0xc9))['catch'](handleError(_0x392e5c,null));};exports[_0xe98b('0x25')]=function(_0x31e99c,_0x101594){if(_0x31e99c[_0xe98b('0x4d')]['id']){delete _0x31e99c[_0xe98b('0x4d')]['id'];}return db[_0xe98b('0x2d')]['find']({'where':{'id':_0x31e99c[_0xe98b('0x48')]['id']}})[_0xe98b('0x27')](handleEntityNotFound(_0x101594,null))[_0xe98b('0x27')](saveUpdates(_0x31e99c['body'],null))[_0xe98b('0x27')](respondWithResult(_0x101594,null))['catch'](handleError(_0x101594,null));};exports[_0xe98b('0x26')]=function(_0x56b84a,_0x55180e){return db[_0xe98b('0x2d')][_0xe98b('0x4b')]({'where':{'id':_0x56b84a[_0xe98b('0x48')]['id']}})[_0xe98b('0x27')](handleEntityNotFound(_0x55180e,null))['then'](removeEntity(_0x55180e,null))[_0xe98b('0x46')](handleError(_0x55180e,null));}; \ No newline at end of file +var _0xabfc=['rows','catch','params','rawAttributes','create','body','update','find','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','reject','save','then','destroy','stack','name','send','index','Dynamics365Field','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','type','key','field','options','count','includeAll','include','findAll'];(function(_0x18812f,_0x281b49){var _0x2400ff=function(_0xe0ab76){while(--_0xe0ab76){_0x18812f['push'](_0x18812f['shift']());}};_0x2400ff(++_0x281b49);}(_0xabfc,0x194));var _0xcabf=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xabfc[_0x1e6db3];return _0x1de886;};'use strict';var pdf=require(_0xcabf('0x0'));var emlformat=require(_0xcabf('0x1'));var rimraf=require(_0xcabf('0x2'));var zipdir=require(_0xcabf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcabf('0x4'));var Mustache=require('mustache');var util=require(_0xcabf('0x5'));var path=require(_0xcabf('0x6'));var sox=require(_0xcabf('0x7'));var csv=require(_0xcabf('0x8'));var ejs=require(_0xcabf('0x9'));var fs=require('fs');var _=require(_0xcabf('0xa'));var squel=require(_0xcabf('0xb'));var crypto=require(_0xcabf('0xc'));var jsforce=require(_0xcabf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcabf('0x8'));var querystring=require('querystring');var Papa=require(_0xcabf('0xe'));var Redis=require(_0xcabf('0xf'));var authService=require(_0xcabf('0x10'));var qs=require(_0xcabf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcabf('0x12'))('api');var utils=require(_0xcabf('0x13'));var config=require('../../config/environment');var db=require(_0xcabf('0x14'))['db'];function respondWithStatusCode(_0x5d0aad,_0x155ce3){_0x155ce3=_0x155ce3||0xcc;return function(_0x5a5615){if(_0x5a5615){return _0x5d0aad[_0xcabf('0x15')](_0x155ce3);}return _0x5d0aad[_0xcabf('0x16')](_0x155ce3)[_0xcabf('0x17')]();};}function respondWithResult(_0x167a6b,_0x5483de){_0x5483de=_0x5483de||0xc8;return function(_0x31ac9d){if(_0x31ac9d){return _0x167a6b[_0xcabf('0x16')](_0x5483de)['json'](_0x31ac9d);}};}function respondWithFilteredResult(_0x380320,_0x5dd2e6){return function(_0x4e7d9e){if(_0x4e7d9e){var _0x2dd673=_0x4e7d9e['count'],_0xc02536=_0x5dd2e6[_0xcabf('0x18')],_0x553d59=_0x5dd2e6[_0xcabf('0x18')]+_0x5dd2e6[_0xcabf('0x19')],_0x10b043;if(_0x553d59>=_0x2dd673){_0x553d59=_0x2dd673;_0x10b043=0xc8;}else{_0x10b043=0xce;}_0x380320[_0xcabf('0x16')](_0x10b043);return _0x380320['set']('Content-Range',_0xc02536+'-'+_0x553d59+'/'+_0x2dd673)[_0xcabf('0x1a')](_0x4e7d9e);}return null;};}function patchUpdates(_0x1f2b61){return function(_0x14c16c){try{jsonpatch[_0xcabf('0x1b')](_0x14c16c,_0x1f2b61,!![]);}catch(_0xf96794){return BPromise[_0xcabf('0x1c')](_0xf96794);}return _0x14c16c[_0xcabf('0x1d')]();};}function saveUpdates(_0x59edbd,_0x6fd5b3){return function(_0x325c0e){if(_0x325c0e){return _0x325c0e['update'](_0x59edbd)[_0xcabf('0x1e')](function(_0x3eabe0){return _0x3eabe0;});}return null;};}function removeEntity(_0x76520c,_0x179132){return function(_0x538c57){if(_0x538c57){return _0x538c57[_0xcabf('0x1f')]()[_0xcabf('0x1e')](function(){_0x76520c[_0xcabf('0x16')](0xcc)[_0xcabf('0x17')]();});}};}function handleEntityNotFound(_0x6a3d3d,_0x5e2f5f){return function(_0x54c92b){if(!_0x54c92b){_0x6a3d3d['sendStatus'](0x194);}return _0x54c92b;};}function handleError(_0x4128f3,_0x4abf99){_0x4abf99=_0x4abf99||0x1f4;return function(_0xf88239){logger['error'](_0xf88239[_0xcabf('0x20')]);if(_0xf88239['name']){delete _0xf88239[_0xcabf('0x21')];}_0x4128f3[_0xcabf('0x16')](_0x4abf99)[_0xcabf('0x22')](_0xf88239);};}exports[_0xcabf('0x23')]=function(_0x52236f,_0x25b41f){var _0x3fdbff={},_0x286e3f={},_0x5d7f9f={'count':0x0,'rows':[]};var _0x16b6b2=db[_0xcabf('0x24')]['rawAttributes'];_0x286e3f['model']=_[_0xcabf('0x25')](_0x16b6b2);_0x286e3f['query']=_[_0xcabf('0x25')](_0x52236f['query']);_0x286e3f[_0xcabf('0x26')]=_[_0xcabf('0x27')](_0x286e3f[_0xcabf('0x28')],_0x286e3f[_0xcabf('0x29')]);_0x3fdbff['attributes']=_[_0xcabf('0x27')](_0x286e3f[_0xcabf('0x28')],qs[_0xcabf('0x2a')](_0x52236f[_0xcabf('0x29')][_0xcabf('0x2a')]));_0x3fdbff['attributes']=_0x3fdbff[_0xcabf('0x2b')]['length']?_0x3fdbff[_0xcabf('0x2b')]:_0x286e3f[_0xcabf('0x28')];if(!_0x52236f['query'][_0xcabf('0x2c')](_0xcabf('0x2d'))){_0x3fdbff[_0xcabf('0x19')]=qs[_0xcabf('0x19')](_0x52236f[_0xcabf('0x29')][_0xcabf('0x19')]);_0x3fdbff[_0xcabf('0x18')]=qs['offset'](_0x52236f[_0xcabf('0x29')][_0xcabf('0x18')]);}_0x3fdbff['order']=qs[_0xcabf('0x2e')](_0x52236f[_0xcabf('0x29')][_0xcabf('0x2e')]);_0x3fdbff['where']=qs[_0xcabf('0x26')](_['pick'](_0x52236f[_0xcabf('0x29')],_0x286e3f[_0xcabf('0x26')]));if(_0x52236f[_0xcabf('0x29')][_0xcabf('0x2f')]){_0x3fdbff[_0xcabf('0x30')]=_[_0xcabf('0x31')](_0x3fdbff[_0xcabf('0x30')],{'$or':_['map'](_0x16b6b2,function(_0x51d199){if(_0x51d199[_0xcabf('0x32')][_0xcabf('0x33')]!=='VIRTUAL'){var _0x2ae03b={};_0x2ae03b[_0x51d199[_0xcabf('0x34')]]={'$like':'%'+_0x52236f[_0xcabf('0x29')][_0xcabf('0x2f')]+'%'};return _0x2ae03b;}})});}_0x3fdbff=_[_0xcabf('0x31')]({},_0x3fdbff,_0x52236f[_0xcabf('0x35')]);var _0x5d9c0a={'where':_0x3fdbff['where']};return db[_0xcabf('0x24')][_0xcabf('0x36')](_0x5d9c0a)[_0xcabf('0x1e')](function(_0x33ed08){_0x5d7f9f['count']=_0x33ed08;if(_0x52236f[_0xcabf('0x29')][_0xcabf('0x37')]){_0x3fdbff[_0xcabf('0x38')]=[{'all':!![]}];}return db[_0xcabf('0x24')][_0xcabf('0x39')](_0x3fdbff);})[_0xcabf('0x1e')](function(_0x38fe1c){_0x5d7f9f[_0xcabf('0x3a')]=_0x38fe1c;return _0x5d7f9f;})[_0xcabf('0x1e')](respondWithFilteredResult(_0x25b41f,_0x3fdbff))[_0xcabf('0x3b')](handleError(_0x25b41f,null));};exports['show']=function(_0xf1b246,_0x39ffd0){var _0x4a0ea0={'raw':!![],'where':{'id':_0xf1b246[_0xcabf('0x3c')]['id']}},_0x1d4d63={};_0x1d4d63[_0xcabf('0x28')]=_[_0xcabf('0x25')](db[_0xcabf('0x24')][_0xcabf('0x3d')]);_0x1d4d63['query']=_[_0xcabf('0x25')](_0xf1b246[_0xcabf('0x29')]);_0x1d4d63[_0xcabf('0x26')]=_[_0xcabf('0x27')](_0x1d4d63['model'],_0x1d4d63['query']);_0x4a0ea0[_0xcabf('0x2b')]=_[_0xcabf('0x27')](_0x1d4d63[_0xcabf('0x28')],qs[_0xcabf('0x2a')](_0xf1b246[_0xcabf('0x29')][_0xcabf('0x2a')]));_0x4a0ea0[_0xcabf('0x2b')]=_0x4a0ea0[_0xcabf('0x2b')]['length']?_0x4a0ea0['attributes']:_0x1d4d63[_0xcabf('0x28')];if(_0xf1b246[_0xcabf('0x29')][_0xcabf('0x37')]){_0x4a0ea0['include']=[{'all':!![]}];}_0x4a0ea0=_['merge']({},_0x4a0ea0,_0xf1b246['options']);return db['Dynamics365Field']['find'](_0x4a0ea0)[_0xcabf('0x1e')](handleEntityNotFound(_0x39ffd0,null))[_0xcabf('0x1e')](respondWithResult(_0x39ffd0,null))[_0xcabf('0x3b')](handleError(_0x39ffd0,null));};exports[_0xcabf('0x3e')]=function(_0x22cce7,_0x2d9f61){return db[_0xcabf('0x24')][_0xcabf('0x3e')](_0x22cce7[_0xcabf('0x3f')],{})['then'](respondWithResult(_0x2d9f61,0xc9))[_0xcabf('0x3b')](handleError(_0x2d9f61,null));};exports[_0xcabf('0x40')]=function(_0x2cb6d6,_0x58544f){if(_0x2cb6d6[_0xcabf('0x3f')]['id']){delete _0x2cb6d6['body']['id'];}return db[_0xcabf('0x24')][_0xcabf('0x41')]({'where':{'id':_0x2cb6d6[_0xcabf('0x3c')]['id']}})['then'](handleEntityNotFound(_0x58544f,null))[_0xcabf('0x1e')](saveUpdates(_0x2cb6d6['body'],null))[_0xcabf('0x1e')](respondWithResult(_0x58544f,null))[_0xcabf('0x3b')](handleError(_0x58544f,null));};exports[_0xcabf('0x1f')]=function(_0x368c1c,_0x2ef903){return db[_0xcabf('0x24')][_0xcabf('0x41')]({'where':{'id':_0x368c1c['params']['id']}})[_0xcabf('0x1e')](handleEntityNotFound(_0x2ef903,null))[_0xcabf('0x1e')](removeEntity(_0x2ef903,null))[_0xcabf('0x3b')](handleError(_0x2ef903,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c6b1707..d860570 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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0xb4064,_0x40e10e){var _0x2c4031=function(_0x4d7f2a){while(--_0x4d7f2a){_0xb4064['push'](_0xb4064['shift']());}};_0x2c4031(++_0x40e10e);}(_0x7a54,0x106));var _0x47a5=function(_0x3fb675,_0x17847d){_0x3fb675=_0x3fb675-0x0;var _0x5e9ec2=_0x7a54[_0x3fb675];return _0x5e9ec2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x34691c,_0x4d60c2){var _0x52ccae=function(_0x7e904e){while(--_0x7e904e){_0x34691c['push'](_0x34691c['shift']());}};_0x52ccae(++_0x4d60c2);}(_0x7a54,0x106));var _0x47a5=function(_0x1de27e,_0x95a1ee){_0x1de27e=_0x1de27e-0x0;var _0x1e525b=_0x7a54[_0x1de27e];return _0x1e525b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 0a8d669..235be9b 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 _0x2f56=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0x2f56,0xb5));var _0x62f5=function(_0x53e36c,_0x5adedd){_0x53e36c=_0x53e36c-0x0;var _0x1fc47d=_0x2f56[_0x53e36c];return _0x1fc47d;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387150,_0x58ae99,_0x3ee814){return new BPromise(function(_0xc11beb,_0x505bfd){return client[_0x62f5('0xc')](_0x387150,_0x3ee814)[_0x62f5('0xd')](function(_0x4a3621){logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x58ae99,_0x62f5('0x10'),JSON[_0x62f5('0x11')](_0x4a3621));if(_0x4a3621[_0x62f5('0x12')]){if(_0x4a3621[_0x62f5('0x12')][_0x62f5('0x13')]===0x1f4){logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621['error'][_0x62f5('0x14')]);return _0x505bfd(_0x4a3621['error'][_0x62f5('0x14')]);}logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621[_0x62f5('0x12')]['message']);return _0xc11beb(_0x4a3621[_0x62f5('0x12')]['message']);}else{logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));_0xc11beb(_0x4a3621[_0x62f5('0x15')][_0x62f5('0x14')]);}})[_0x62f5('0x16')](function(_0x2756cb){logger[_0x62f5('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x58ae99,_0x2756cb);_0x505bfd(_0x2756cb);});});} \ No newline at end of file +var _0xd8a2=['then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd8a2,0x128));var _0x2d8a=function(_0xe8834c,_0x4e87de){_0xe8834c=_0xe8834c-0x0;var _0x28ba1a=_0xd8a2[_0xe8834c];return _0x28ba1a;};'use strict';var _=require(_0x2d8a('0x0'));var util=require(_0x2d8a('0x1'));var moment=require(_0x2d8a('0x2'));var BPromise=require(_0x2d8a('0x3'));var rs=require(_0x2d8a('0x4'));var fs=require('fs');var Redis=require(_0x2d8a('0x5'));var db=require(_0x2d8a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d8a('0x7'))(_0x2d8a('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d8a('0x9'));var client=jayson['client'][_0x2d8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514b98,_0x195f2e,_0x18b09e){return new BPromise(function(_0x26cc74,_0x119aba){return client[_0x2d8a('0xb')](_0x514b98,_0x18b09e)[_0x2d8a('0xc')](function(_0x4bac3b){logger[_0x2d8a('0xd')](_0x2d8a('0xe'),_0x195f2e,_0x2d8a('0xf'));logger[_0x2d8a('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x195f2e,_0x2d8a('0xf'),JSON['stringify'](_0x4bac3b));if(_0x4bac3b['error']){if(_0x4bac3b[_0x2d8a('0x11')][_0x2d8a('0x12')]===0x1f4){logger[_0x2d8a('0x11')](_0x2d8a('0xe'),_0x195f2e,_0x4bac3b[_0x2d8a('0x11')][_0x2d8a('0x13')]);return _0x119aba(_0x4bac3b[_0x2d8a('0x11')][_0x2d8a('0x13')]);}logger[_0x2d8a('0x11')](_0x2d8a('0xe'),_0x195f2e,_0x4bac3b[_0x2d8a('0x11')][_0x2d8a('0x13')]);return _0x26cc74(_0x4bac3b['error'][_0x2d8a('0x13')]);}else{logger[_0x2d8a('0xd')](_0x2d8a('0xe'),_0x195f2e,'request\x20sent');_0x26cc74(_0x4bac3b[_0x2d8a('0x14')][_0x2d8a('0x13')]);}})[_0x2d8a('0x15')](function(_0x2bcbea){logger['error'](_0x2d8a('0xe'),_0x195f2e,_0x2bcbea);_0x119aba(_0x2bcbea);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index db9afc2..2f32d63 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 _0x7751=['/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intFreshdeskAccount.controller','get','/:id','show'];(function(_0x84797a,_0x3557f3){var _0x2fd077=function(_0x52aad2){while(--_0x52aad2){_0x84797a['push'](_0x84797a['shift']());}};_0x2fd077(++_0x3557f3);}(_0x7751,0x155));var _0x1775=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7751[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1775('0x0'));var util=require(_0x1775('0x1'));var path=require(_0x1775('0x2'));var timeout=require(_0x1775('0x3'));var express=require(_0x1775('0x4'));var router=express[_0x1775('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1775('0x6'));var controller=require(_0x1775('0x7'));router[_0x1775('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1775('0x8')](_0x1775('0x9'),auth['isAuthenticated'](),controller[_0x1775('0xa')]);router[_0x1775('0x8')](_0x1775('0xb'),auth[_0x1775('0xc')](),controller['getConfigurations']);router[_0x1775('0x8')](_0x1775('0xd'),auth['isAuthenticated'](),controller[_0x1775('0xe')]);router[_0x1775('0xf')]('/',auth[_0x1775('0xc')](),controller[_0x1775('0x10')]);router[_0x1775('0xf')](_0x1775('0xb'),auth[_0x1775('0xc')](),controller[_0x1775('0x11')]);router[_0x1775('0x12')](_0x1775('0x9'),auth[_0x1775('0xc')](),controller[_0x1775('0x13')]);router[_0x1775('0x14')](_0x1775('0x9'),auth[_0x1775('0xc')](),controller['destroy']);module[_0x1775('0x15')]=router; \ No newline at end of file +var _0xb4d9=['../../config/environment','isAuthenticated','index','get','/:id','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xb4d9,0x174));var _0x9b4d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb4d9[_0x1a36a5];return _0x746243;};'use strict';var multer=require(_0x9b4d('0x0'));var util=require('util');var path=require(_0x9b4d('0x1'));var timeout=require(_0x9b4d('0x2'));var express=require(_0x9b4d('0x3'));var router=express['Router']();var auth=require(_0x9b4d('0x4'));var interaction=require(_0x9b4d('0x5'));var config=require(_0x9b4d('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x9b4d('0x7')](),controller[_0x9b4d('0x8')]);router[_0x9b4d('0x9')](_0x9b4d('0xa'),auth[_0x9b4d('0x7')](),controller['show']);router[_0x9b4d('0x9')]('/:id/configurations',auth[_0x9b4d('0x7')](),controller[_0x9b4d('0xb')]);router[_0x9b4d('0x9')](_0x9b4d('0xc'),auth[_0x9b4d('0x7')](),controller[_0x9b4d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b4d('0xe')]);router[_0x9b4d('0xf')]('/:id/configurations',auth[_0x9b4d('0x7')](),controller[_0x9b4d('0x10')]);router[_0x9b4d('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9b4d('0x12')](_0x9b4d('0xa'),auth[_0x9b4d('0x7')](),controller[_0x9b4d('0x13')]);module[_0x9b4d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 41b51d7..eab5d77 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 _0x431d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x431d,0x1db));var _0xd431=function(_0x28aeb2,_0x319b38){_0x28aeb2=_0x28aeb2-0x0;var _0x1d33e1=_0x431d[_0x28aeb2];return _0x1d33e1;};'use strict';var Sequelize=require(_0xd431('0x0'));module[_0xd431('0x1')]={'name':{'type':Sequelize[_0xd431('0x2')]},'description':{'type':Sequelize[_0xd431('0x2')]},'username':{'type':Sequelize[_0xd431('0x2')],'unique':_0xd431('0x3')},'apiKey':{'type':Sequelize[_0xd431('0x2')]},'remoteUri':{'type':Sequelize[_0xd431('0x2')],'unique':_0xd431('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb4dd=['exports','STRING','username','remoteUri','sequelize'];(function(_0x255a14,_0x5f50b1){var _0x1df2de=function(_0x41bd75){while(--_0x41bd75){_0x255a14['push'](_0x255a14['shift']());}};_0x1df2de(++_0x5f50b1);}(_0xb4dd,0x1df));var _0xdb4d=function(_0x5ca3c2,_0x3a5815){_0x5ca3c2=_0x5ca3c2-0x0;var _0x4976ef=_0xb4dd[_0x5ca3c2];return _0x4976ef;};'use strict';var Sequelize=require(_0xdb4d('0x0'));module[_0xdb4d('0x1')]={'name':{'type':Sequelize[_0xdb4d('0x2')]},'description':{'type':Sequelize[_0xdb4d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xdb4d('0x3')},'apiKey':{'type':Sequelize[_0xdb4d('0x2')]},'remoteUri':{'type':Sequelize[_0xdb4d('0x2')],'unique':_0xdb4d('0x4')},'serverUrl':{'type':Sequelize[_0xdb4d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 2384e01..93d0062 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 _0x7d28=['toString','subject','agent','description','priority','group','source','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','field','options','count','includeAll','include','FreshdeskAccount','findAll','rows','show','merge','find','create','body','params','getConfigurations','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','findOne','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X'];(function(_0x4ed17b,_0x2b1745){var _0x24b248=function(_0x136ab1){while(--_0x136ab1){_0x4ed17b['push'](_0x4ed17b['shift']());}};_0x24b248(++_0x2b1745);}(_0x7d28,0x112));var _0x87d2=function(_0x7d84fb,_0x143672){_0x7d84fb=_0x7d84fb-0x0;var _0x59fd7b=_0x7d28[_0x7d84fb];return _0x59fd7b;};'use strict';var pdf=require(_0x87d2('0x0'));var emlformat=require(_0x87d2('0x1'));var rimraf=require(_0x87d2('0x2'));var zipdir=require(_0x87d2('0x3'));var jsonpatch=require(_0x87d2('0x4'));var rp=require(_0x87d2('0x5'));var moment=require('moment');var BPromise=require(_0x87d2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x87d2('0x7'));var sox=require('sox');var csv=require(_0x87d2('0x8'));var ejs=require(_0x87d2('0x9'));var fs=require('fs');var _=require(_0x87d2('0xa'));var squel=require(_0x87d2('0xb'));var crypto=require(_0x87d2('0xc'));var jsforce=require(_0x87d2('0xd'));var deskjs=require(_0x87d2('0xe'));var toCsv=require(_0x87d2('0x8'));var querystring=require(_0x87d2('0xf'));var Papa=require('papaparse');var Redis=require(_0x87d2('0x10'));var authService=require(_0x87d2('0x11'));var qs=require(_0x87d2('0x12'));var hardwareService=require(_0x87d2('0x13'));var logger=require(_0x87d2('0x14'))(_0x87d2('0x15'));var utils=require(_0x87d2('0x16'));var config=require(_0x87d2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x87d2('0x18'));var jayson=require(_0x87d2('0x19'));var client=jayson[_0x87d2('0x1a')][_0x87d2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2a9387,_0x57ec73,_0x1fb66b){if(_0x1fb66b){var _0x1180ed=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1180ed['test'](_0x57ec73)){return _0x2a9387;}else{throw new Error(_0x87d2('0x1c'));}}else{return _0x2a9387;}}function respondWithRpcPromise(_0x2ba3c4,_0x39f1ed,_0x4f5a1d,_0x3d203a){return new BPromise(function(_0x4bb56e,_0x3ee74a){var _0x5bc682=_0x3d203a||client;return _0x5bc682[_0x87d2('0x1d')](_0x2ba3c4,_0x4f5a1d)[_0x87d2('0x1e')](function(_0x51cd23){logger[_0x87d2('0x1f')](_0x87d2('0x20'),_0x39f1ed,'request\x20sent');logger[_0x87d2('0x21')](_0x87d2('0x22'),_0x39f1ed,_0x87d2('0x23'),JSON['stringify'](_0x51cd23));if(_0x51cd23['error']){if(_0x51cd23[_0x87d2('0x24')][_0x87d2('0x25')]===0x1f4){logger[_0x87d2('0x24')](_0x87d2('0x20'),_0x39f1ed,_0x51cd23[_0x87d2('0x24')][_0x87d2('0x26')]);return _0x3ee74a(_0x51cd23[_0x87d2('0x24')][_0x87d2('0x26')]);}logger[_0x87d2('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x39f1ed,_0x51cd23['error'][_0x87d2('0x26')]);return _0x4bb56e(_0x51cd23['error'][_0x87d2('0x26')]);}else{logger['info'](_0x87d2('0x20'),_0x39f1ed,'request\x20sent');_0x4bb56e(_0x51cd23[_0x87d2('0x27')][_0x87d2('0x26')]);}})[_0x87d2('0x28')](function(_0x4c2816){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x39f1ed,_0x4c2816);_0x3ee74a(_0x4c2816);});});}function respondWithStatusCode(_0x542095,_0x1189e1){_0x1189e1=_0x1189e1||0xcc;return function(_0x25c18f){if(_0x25c18f){return _0x542095[_0x87d2('0x29')](_0x1189e1);}return _0x542095[_0x87d2('0x2a')](_0x1189e1)[_0x87d2('0x2b')]();};}function respondWithResult(_0x2fd268,_0x23e95d){_0x23e95d=_0x23e95d||0xc8;return function(_0x38da34){if(_0x38da34){return _0x2fd268[_0x87d2('0x2a')](_0x23e95d)[_0x87d2('0x2c')](_0x38da34);}};}function respondWithFilteredResult(_0x48f65c,_0x2ea1d6){return function(_0x16aa1f){if(_0x16aa1f){var _0x15ad34=_0x16aa1f['count'],_0x2b932e=_0x2ea1d6['offset'],_0x3ced2a=_0x2ea1d6[_0x87d2('0x2d')]+_0x2ea1d6[_0x87d2('0x2e')],_0x92d513;if(_0x3ced2a>=_0x15ad34){_0x3ced2a=_0x15ad34;_0x92d513=0xc8;}else{_0x92d513=0xce;}_0x48f65c['status'](_0x92d513);return _0x48f65c[_0x87d2('0x2f')](_0x87d2('0x30'),_0x2b932e+'-'+_0x3ced2a+'/'+_0x15ad34)[_0x87d2('0x2c')](_0x16aa1f);}return null;};}function patchUpdates(_0x329ddf){return function(_0x5089fe){try{jsonpatch['apply'](_0x5089fe,_0x329ddf,!![]);}catch(_0x30c90b){return BPromise[_0x87d2('0x31')](_0x30c90b);}return _0x5089fe['save']();};}function saveUpdates(_0x306984,_0x143b6e){return function(_0x207113){if(_0x207113){return _0x207113[_0x87d2('0x32')](_0x306984)['then'](function(_0x252cf0){return _0x252cf0;});}return null;};}function removeEntity(_0x212c03,_0x152aa8){return function(_0x341f90){if(_0x341f90){return _0x341f90[_0x87d2('0x33')]()[_0x87d2('0x1e')](function(){_0x212c03[_0x87d2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83ebe3,_0x30d646){return function(_0x8ba6c6){if(!_0x8ba6c6){_0x83ebe3['sendStatus'](0x194);}return _0x8ba6c6;};}function handleError(_0x935c32,_0x2394ac){_0x2394ac=_0x2394ac||0x1f4;return function(_0xfe90eb){logger[_0x87d2('0x24')](_0xfe90eb[_0x87d2('0x34')]);if(_0xfe90eb[_0x87d2('0x35')]){delete _0xfe90eb['name'];}_0x935c32[_0x87d2('0x2a')](_0x2394ac)[_0x87d2('0x36')](_0xfe90eb);};}exports[_0x87d2('0x37')]=function(_0x14e977,_0x5f2ac5){var _0x30d728={},_0x3343aa={},_0x4f3c29={'count':0x0,'rows':[]};var _0x17eb07=db['FreshdeskAccount'][_0x87d2('0x38')];_0x3343aa[_0x87d2('0x39')]=_[_0x87d2('0x3a')](_0x17eb07);_0x3343aa[_0x87d2('0x3b')]=_[_0x87d2('0x3a')](_0x14e977[_0x87d2('0x3b')]);_0x3343aa[_0x87d2('0x3c')]=_['intersection'](_0x3343aa[_0x87d2('0x39')],_0x3343aa[_0x87d2('0x3b')]);_0x30d728[_0x87d2('0x3d')]=_[_0x87d2('0x3e')](_0x3343aa[_0x87d2('0x39')],qs[_0x87d2('0x3f')](_0x14e977[_0x87d2('0x3b')][_0x87d2('0x3f')]));_0x30d728['attributes']=_0x30d728['attributes'][_0x87d2('0x40')]?_0x30d728[_0x87d2('0x3d')]:_0x3343aa['model'];if(!_0x14e977[_0x87d2('0x3b')][_0x87d2('0x41')](_0x87d2('0x42'))){_0x30d728[_0x87d2('0x2e')]=qs['limit'](_0x14e977[_0x87d2('0x3b')]['limit']);_0x30d728['offset']=qs[_0x87d2('0x2d')](_0x14e977[_0x87d2('0x3b')]['offset']);}_0x30d728[_0x87d2('0x43')]=qs[_0x87d2('0x44')](_0x14e977[_0x87d2('0x3b')]['sort']);_0x30d728[_0x87d2('0x45')]=qs['filters'](_[_0x87d2('0x46')](_0x14e977[_0x87d2('0x3b')],_0x3343aa[_0x87d2('0x3c')]));if(_0x14e977[_0x87d2('0x3b')][_0x87d2('0x47')]){_0x30d728['where']=_['merge'](_0x30d728['where'],{'$or':_[_0x87d2('0x48')](_0x17eb07,function(_0x133368){if(_0x133368[_0x87d2('0x49')][_0x87d2('0x4a')]!=='VIRTUAL'){var _0x58c43e={};_0x58c43e[_0x133368[_0x87d2('0x4b')]]={'$like':'%'+_0x14e977['query'][_0x87d2('0x47')]+'%'};return _0x58c43e;}})});}_0x30d728=_['merge']({},_0x30d728,_0x14e977[_0x87d2('0x4c')]);var _0x15918c={'where':_0x30d728['where']};return db['FreshdeskAccount'][_0x87d2('0x4d')](_0x15918c)[_0x87d2('0x1e')](function(_0x33837b){_0x4f3c29[_0x87d2('0x4d')]=_0x33837b;if(_0x14e977[_0x87d2('0x3b')][_0x87d2('0x4e')]){_0x30d728[_0x87d2('0x4f')]=[{'all':!![]}];}return db[_0x87d2('0x50')][_0x87d2('0x51')](_0x30d728);})[_0x87d2('0x1e')](function(_0x344205){_0x4f3c29[_0x87d2('0x52')]=_0x344205;return _0x4f3c29;})[_0x87d2('0x1e')](respondWithFilteredResult(_0x5f2ac5,_0x30d728))[_0x87d2('0x28')](handleError(_0x5f2ac5,null));};exports[_0x87d2('0x53')]=function(_0x585e86,_0x2af80d){var _0x551e98={'raw':![],'where':{'id':_0x585e86['params']['id']}},_0x46928b={};_0x46928b[_0x87d2('0x39')]=_[_0x87d2('0x3a')](db[_0x87d2('0x50')][_0x87d2('0x38')]);_0x46928b['query']=_[_0x87d2('0x3a')](_0x585e86[_0x87d2('0x3b')]);_0x46928b[_0x87d2('0x3c')]=_[_0x87d2('0x3e')](_0x46928b['model'],_0x46928b[_0x87d2('0x3b')]);_0x551e98[_0x87d2('0x3d')]=_[_0x87d2('0x3e')](_0x46928b['model'],qs[_0x87d2('0x3f')](_0x585e86[_0x87d2('0x3b')]['fields']));_0x551e98[_0x87d2('0x3d')]=_0x551e98['attributes']['length']?_0x551e98[_0x87d2('0x3d')]:_0x46928b[_0x87d2('0x39')];if(_0x585e86[_0x87d2('0x3b')][_0x87d2('0x4e')]){_0x551e98['include']=[{'all':!![]}];}_0x551e98=_[_0x87d2('0x54')]({},_0x551e98,_0x585e86[_0x87d2('0x4c')]);return db['FreshdeskAccount'][_0x87d2('0x55')](_0x551e98)[_0x87d2('0x1e')](handleEntityNotFound(_0x2af80d,null))['then'](respondWithResult(_0x2af80d,null))[_0x87d2('0x28')](handleError(_0x2af80d,null));};exports[_0x87d2('0x56')]=function(_0x2921ca,_0x2ec277){return db['FreshdeskAccount']['create'](_0x2921ca['body'],{})[_0x87d2('0x1e')](respondWithResult(_0x2ec277,0xc9))[_0x87d2('0x28')](handleError(_0x2ec277,null));};exports[_0x87d2('0x32')]=function(_0x57fad9,_0xb9aed5){if(_0x57fad9[_0x87d2('0x57')]['id']){delete _0x57fad9[_0x87d2('0x57')]['id'];}return db['FreshdeskAccount'][_0x87d2('0x55')]({'where':{'id':_0x57fad9[_0x87d2('0x58')]['id']}})[_0x87d2('0x1e')](handleEntityNotFound(_0xb9aed5,null))[_0x87d2('0x1e')](saveUpdates(_0x57fad9['body'],null))[_0x87d2('0x1e')](respondWithResult(_0xb9aed5,null))[_0x87d2('0x28')](handleError(_0xb9aed5,null));};exports[_0x87d2('0x33')]=function(_0x425782,_0x4bae36){return db[_0x87d2('0x50')]['find']({'where':{'id':_0x425782[_0x87d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x4bae36,null))['then'](removeEntity(_0x4bae36,null))[_0x87d2('0x28')](handleError(_0x4bae36,null));};exports[_0x87d2('0x59')]=function(_0x292c57,_0x358a5a,_0x533900){var _0x5cb281={};var _0x2f4b5={};var _0x18ee2c;var _0x116f8a;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x292c57[_0x87d2('0x58')]['id']}})[_0x87d2('0x1e')](handleEntityNotFound(_0x358a5a,null))['then'](function(_0x155ccf){if(_0x155ccf){_0x18ee2c=_0x155ccf;_0x2f4b5[_0x87d2('0x39')]=_['keys'](db[_0x87d2('0x5a')]['rawAttributes']);_0x2f4b5[_0x87d2('0x3b')]=_['keys'](_0x292c57[_0x87d2('0x3b')]);_0x2f4b5[_0x87d2('0x3c')]=_[_0x87d2('0x3e')](_0x2f4b5['model'],_0x2f4b5[_0x87d2('0x3b')]);_0x5cb281[_0x87d2('0x3d')]=_[_0x87d2('0x3e')](_0x2f4b5[_0x87d2('0x39')],qs[_0x87d2('0x3f')](_0x292c57[_0x87d2('0x3b')][_0x87d2('0x3f')]));_0x5cb281[_0x87d2('0x3d')]=_0x5cb281[_0x87d2('0x3d')]['length']?_0x5cb281['attributes']:_0x2f4b5['model'];_0x5cb281[_0x87d2('0x43')]=qs['sort'](_0x292c57['query'][_0x87d2('0x44')]);_0x5cb281[_0x87d2('0x45')]=qs[_0x87d2('0x3c')](_[_0x87d2('0x46')](_0x292c57[_0x87d2('0x3b')],_0x2f4b5[_0x87d2('0x3c')]));if(_0x292c57[_0x87d2('0x3b')]['filter']){_0x5cb281[_0x87d2('0x45')]=_[_0x87d2('0x54')](_0x5cb281[_0x87d2('0x45')],{'$or':_[_0x87d2('0x48')](_0x5cb281['attributes'],function(_0x3c7ed8){var _0x26b4e1={};_0x26b4e1[_0x3c7ed8]={'$like':'%'+_0x292c57[_0x87d2('0x3b')][_0x87d2('0x47')]+'%'};return _0x26b4e1;})});}_0x5cb281=_[_0x87d2('0x54')]({},_0x5cb281,_0x292c57['options']);return _0x18ee2c[_0x87d2('0x59')](_0x5cb281);}})['then'](function(_0x4afb5a){if(_0x4afb5a){_0x116f8a=_0x4afb5a[_0x87d2('0x40')];if(!_0x292c57['query'][_0x87d2('0x41')](_0x87d2('0x42'))){_0x5cb281[_0x87d2('0x2e')]=qs[_0x87d2('0x2e')](_0x292c57['query'][_0x87d2('0x2e')]);_0x5cb281[_0x87d2('0x2d')]=qs[_0x87d2('0x2d')](_0x292c57[_0x87d2('0x3b')][_0x87d2('0x2d')]);}return _0x18ee2c['getConfigurations'](_0x5cb281);}})[_0x87d2('0x1e')](function(_0x2593c9){if(_0x2593c9){return _0x2593c9?{'count':_0x116f8a,'rows':_0x2593c9}:null;}})[_0x87d2('0x1e')](respondWithResult(_0x358a5a,null))[_0x87d2('0x28')](handleError(_0x358a5a,null));};exports[_0x87d2('0x5b')]=function(_0x95a81c,_0x2755d0,_0x14d984){if(_0x95a81c[_0x87d2('0x57')]['id']){delete _0x95a81c[_0x87d2('0x57')]['id'];}return db[_0x87d2('0x50')]['findOne']({'where':{'id':_0x95a81c[_0x87d2('0x58')]['id']}})[_0x87d2('0x1e')](handleEntityNotFound(_0x2755d0,null))['then'](function(_0x103c37){if(_0x103c37){_0x95a81c[_0x87d2('0x57')]['AccountId']=_0x103c37['id'];_0x95a81c[_0x87d2('0x57')][_0x87d2('0x5c')]=integrations[_0x87d2('0x5d')](_0x95a81c[_0x87d2('0x57')][_0x87d2('0x5e')],_0x95a81c[_0x87d2('0x57')]['type']);_0x95a81c[_0x87d2('0x57')][_0x87d2('0x5f')]=integrations[_0x87d2('0x60')](_0x95a81c[_0x87d2('0x57')]['channel'],_0x95a81c[_0x87d2('0x57')][_0x87d2('0x49')]);return db[_0x87d2('0x5a')][_0x87d2('0x56')](_0x95a81c[_0x87d2('0x57')],{'include':[{'model':db[_0x87d2('0x61')],'as':_0x87d2('0x5c')},{'model':db['FreshdeskField'],'as':_0x87d2('0x5f')}]});}return null;})['then'](respondWithResult(_0x2755d0,null))['catch'](handleError(_0x2755d0,null));};exports[_0x87d2('0x62')]=function(_0x1d8e7e,_0x1351c3,_0x2bc3fb){var _0x4b20b2='';return db[_0x87d2('0x50')][_0x87d2('0x63')]({'where':{'id':_0x1d8e7e[_0x87d2('0x58')]['id']},'attributes':['id',_0x87d2('0x64'),_0x87d2('0x65')]})['then'](handleEntityNotFound(_0x1351c3,null))[_0x87d2('0x1e')](function(_0x4348dc){if(_0x4348dc){_0x4b20b2=_0x4348dc[_0x87d2('0x64')];var _0x2cbe20=_0x4b20b2[_0x87d2('0x66')](-0x1);if(_0x2cbe20==='/'){_0x4b20b2=_0x4b20b2[_0x87d2('0x67')](0x0,_0x4b20b2['lastIndexOf'](_0x2cbe20));}return rp({'method':_0x87d2('0x68'),'uri':util[_0x87d2('0x69')](_0x87d2('0x6a'),_0x4b20b2,_0x87d2('0x6b')),'headers':{'Authorization':util[_0x87d2('0x69')](_0x87d2('0x6c'),new Buffer(util[_0x87d2('0x69')](_0x87d2('0x6d'),_0x4348dc['apiKey']))[_0x87d2('0x6e')]('base64'))},'json':!![]});}})[_0x87d2('0x1e')](function(_0xcd6171){if(_0xcd6171){var _0x4401ae=['requester',_0x87d2('0x6f'),_0x87d2('0x70'),_0x87d2('0x71'),_0x87d2('0x2a'),_0x87d2('0x72'),_0x87d2('0x73'),_0x87d2('0x74'),'ticket_type',_0x87d2('0x73'),_0x87d2('0x75')];_[_0x87d2('0x76')](_0xcd6171,function(_0x221c5e){return _0x4401ae[_0x87d2('0x77')](_0x221c5e[_0x87d2('0x35')])||!_0x221c5e[_0x87d2('0x78')]&&_0x221c5e[_0x87d2('0x49')]!=='custom_text'&&_0x221c5e[_0x87d2('0x49')]!==_0x87d2('0x79');});return{'count':_0xcd6171[_0x87d2('0x40')],'rows':_[_0x87d2('0x48')](_0xcd6171,function(_0x4d27da){return{'id':_0x4d27da[_0x87d2('0x35')],'name':_0x4d27da[_0x87d2('0x7a')],'custom':!_0x4d27da['default'],'options':_0x4d27da[_0x87d2('0x7b')]?_[_0x87d2('0x48')](_0x4d27da[_0x87d2('0x7b')],function(_0x2e1c1d){return{'name':_['capitalize'](_0x2e1c1d),'value':_0x2e1c1d};}):[]};})};}})[_0x87d2('0x1e')](respondWithResult(_0x1351c3,null))[_0x87d2('0x28')](function(_0x59c68d){var _0x43e03a=_0x1d8e7e[_0x87d2('0x3b')][_0x87d2('0x7c')]?0x1f4:_0x59c68d[_0x87d2('0x7d')]||0x1f4;logger['error'](_0x87d2('0x7e'),_0x87d2('0x62'),_0x43e03a,JSON[_0x87d2('0x7f')](_0x59c68d));delete _0x59c68d[_0x87d2('0x35')];if(_0x43e03a===0x191){_0x43e03a=0x190;}_0x1351c3[_0x87d2('0x2a')](_0x43e03a)[_0x87d2('0x36')](_0x1d8e7e['query'][_0x87d2('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x59c68d[_0x87d2('0x7d')]}:_0x59c68d);});}; \ No newline at end of file +var _0xbd33=['../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','json','count','offset','limit','set','reject','save','status','end','stack','name','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','VIRTUAL','field','merge','options','FreshdeskAccount','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','group','ticket_type','remove','custom_text','custom_dropdown','default','choices','map','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0xd2ec01,_0x3ff5e7){var _0xa615c7=function(_0x1b470f){while(--_0x1b470f){_0xd2ec01['push'](_0xd2ec01['shift']());}};_0xa615c7(++_0x3ff5e7);}(_0xbd33,0x1dd));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3bd3('0x0'));var rimraf=require(_0x3bd3('0x1'));var zipdir=require(_0x3bd3('0x2'));var jsonpatch=require(_0x3bd3('0x3'));var rp=require(_0x3bd3('0x4'));var moment=require('moment');var BPromise=require(_0x3bd3('0x5'));var Mustache=require(_0x3bd3('0x6'));var util=require(_0x3bd3('0x7'));var path=require(_0x3bd3('0x8'));var sox=require(_0x3bd3('0x9'));var csv=require(_0x3bd3('0xa'));var ejs=require(_0x3bd3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3bd3('0xc'));var crypto=require(_0x3bd3('0xd'));var jsforce=require(_0x3bd3('0xe'));var deskjs=require(_0x3bd3('0xf'));var toCsv=require(_0x3bd3('0xa'));var querystring=require(_0x3bd3('0x10'));var Papa=require(_0x3bd3('0x11'));var Redis=require(_0x3bd3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3bd3('0x13'));var hardwareService=require(_0x3bd3('0x14'));var logger=require(_0x3bd3('0x15'))(_0x3bd3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3bd3('0x17'))['db'];var integrations=require(_0x3bd3('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x3bd3('0x19')][_0x3bd3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3cc92e,_0x511495,_0x155827){if(_0x155827){var _0x5beb3e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5beb3e[_0x3bd3('0x1b')](_0x511495)){return _0x3cc92e;}else{throw new Error(_0x3bd3('0x1c'));}}else{return _0x3cc92e;}}function respondWithRpcPromise(_0x13473c,_0x101db5,_0x57d52d,_0x57b315){return new BPromise(function(_0x3dfa18,_0x506cd6){var _0x277972=_0x57b315||client;return _0x277972[_0x3bd3('0x1d')](_0x13473c,_0x57d52d)[_0x3bd3('0x1e')](function(_0x23e1b9){logger[_0x3bd3('0x1f')](_0x3bd3('0x20'),_0x101db5,'request\x20sent');logger['debug'](_0x3bd3('0x21'),_0x101db5,_0x3bd3('0x22'),JSON[_0x3bd3('0x23')](_0x23e1b9));if(_0x23e1b9[_0x3bd3('0x24')]){if(_0x23e1b9[_0x3bd3('0x24')][_0x3bd3('0x25')]===0x1f4){logger[_0x3bd3('0x24')](_0x3bd3('0x20'),_0x101db5,_0x23e1b9[_0x3bd3('0x24')][_0x3bd3('0x26')]);return _0x506cd6(_0x23e1b9[_0x3bd3('0x24')][_0x3bd3('0x26')]);}logger['error'](_0x3bd3('0x20'),_0x101db5,_0x23e1b9['error'][_0x3bd3('0x26')]);return _0x3dfa18(_0x23e1b9[_0x3bd3('0x24')]['message']);}else{logger[_0x3bd3('0x1f')]('FreshdeskAccount,\x20%s,\x20%s',_0x101db5,_0x3bd3('0x22'));_0x3dfa18(_0x23e1b9['result'][_0x3bd3('0x26')]);}})[_0x3bd3('0x27')](function(_0x5d3a59){logger[_0x3bd3('0x24')](_0x3bd3('0x20'),_0x101db5,_0x5d3a59);_0x506cd6(_0x5d3a59);});});}function respondWithStatusCode(_0x31aaa7,_0x56fffa){_0x56fffa=_0x56fffa||0xcc;return function(_0x3ef3b1){if(_0x3ef3b1){return _0x31aaa7[_0x3bd3('0x28')](_0x56fffa);}return _0x31aaa7['status'](_0x56fffa)['end']();};}function respondWithResult(_0x7f19ec,_0x4c8414){_0x4c8414=_0x4c8414||0xc8;return function(_0x1f82b0){if(_0x1f82b0){return _0x7f19ec['status'](_0x4c8414)[_0x3bd3('0x29')](_0x1f82b0);}};}function respondWithFilteredResult(_0x5afaf0,_0x5a5749){return function(_0x1967ad){if(_0x1967ad){var _0x3d56bb=_0x1967ad[_0x3bd3('0x2a')],_0x1012d3=_0x5a5749[_0x3bd3('0x2b')],_0x20bf5b=_0x5a5749[_0x3bd3('0x2b')]+_0x5a5749[_0x3bd3('0x2c')],_0x1e1716;if(_0x20bf5b>=_0x3d56bb){_0x20bf5b=_0x3d56bb;_0x1e1716=0xc8;}else{_0x1e1716=0xce;}_0x5afaf0['status'](_0x1e1716);return _0x5afaf0[_0x3bd3('0x2d')]('Content-Range',_0x1012d3+'-'+_0x20bf5b+'/'+_0x3d56bb)[_0x3bd3('0x29')](_0x1967ad);}return null;};}function patchUpdates(_0x300172){return function(_0x234dd3){try{jsonpatch['apply'](_0x234dd3,_0x300172,!![]);}catch(_0xf143b3){return BPromise[_0x3bd3('0x2e')](_0xf143b3);}return _0x234dd3[_0x3bd3('0x2f')]();};}function saveUpdates(_0x33a0dc,_0x3bef7e){return function(_0x711a63){if(_0x711a63){return _0x711a63['update'](_0x33a0dc)[_0x3bd3('0x1e')](function(_0x3b1def){return _0x3b1def;});}return null;};}function removeEntity(_0x154ce4,_0x370a89){return function(_0x16030f){if(_0x16030f){return _0x16030f['destroy']()['then'](function(){_0x154ce4[_0x3bd3('0x30')](0xcc)[_0x3bd3('0x31')]();});}};}function handleEntityNotFound(_0x2f7c80,_0x5a4031){return function(_0x1628ee){if(!_0x1628ee){_0x2f7c80['sendStatus'](0x194);}return _0x1628ee;};}function handleError(_0x3caaef,_0x23e50e){_0x23e50e=_0x23e50e||0x1f4;return function(_0x5757c2){logger[_0x3bd3('0x24')](_0x5757c2[_0x3bd3('0x32')]);if(_0x5757c2['name']){delete _0x5757c2[_0x3bd3('0x33')];}_0x3caaef[_0x3bd3('0x30')](_0x23e50e)['send'](_0x5757c2);};}exports[_0x3bd3('0x34')]=function(_0x260e7c,_0xd897a6){var _0x3bad07={},_0xa9523d={},_0x45d0c2={'count':0x0,'rows':[]};var _0x319708=db['FreshdeskAccount'][_0x3bd3('0x35')];_0xa9523d[_0x3bd3('0x36')]=_[_0x3bd3('0x37')](_0x319708);_0xa9523d[_0x3bd3('0x38')]=_[_0x3bd3('0x37')](_0x260e7c[_0x3bd3('0x38')]);_0xa9523d['filters']=_['intersection'](_0xa9523d[_0x3bd3('0x36')],_0xa9523d[_0x3bd3('0x38')]);_0x3bad07['attributes']=_[_0x3bd3('0x39')](_0xa9523d['model'],qs[_0x3bd3('0x3a')](_0x260e7c[_0x3bd3('0x38')][_0x3bd3('0x3a')]));_0x3bad07[_0x3bd3('0x3b')]=_0x3bad07[_0x3bd3('0x3b')][_0x3bd3('0x3c')]?_0x3bad07['attributes']:_0xa9523d[_0x3bd3('0x36')];if(!_0x260e7c[_0x3bd3('0x38')]['hasOwnProperty'](_0x3bd3('0x3d'))){_0x3bad07['limit']=qs['limit'](_0x260e7c[_0x3bd3('0x38')]['limit']);_0x3bad07[_0x3bd3('0x2b')]=qs[_0x3bd3('0x2b')](_0x260e7c[_0x3bd3('0x38')][_0x3bd3('0x2b')]);}_0x3bad07[_0x3bd3('0x3e')]=qs[_0x3bd3('0x3f')](_0x260e7c[_0x3bd3('0x38')][_0x3bd3('0x3f')]);_0x3bad07[_0x3bd3('0x40')]=qs['filters'](_['pick'](_0x260e7c[_0x3bd3('0x38')],_0xa9523d[_0x3bd3('0x41')]));if(_0x260e7c[_0x3bd3('0x38')][_0x3bd3('0x42')]){_0x3bad07[_0x3bd3('0x40')]=_['merge'](_0x3bad07[_0x3bd3('0x40')],{'$or':_['map'](_0x319708,function(_0x3031af){if(_0x3031af['type']['key']!==_0x3bd3('0x43')){var _0x3b8fa7={};_0x3b8fa7[_0x3031af[_0x3bd3('0x44')]]={'$like':'%'+_0x260e7c['query']['filter']+'%'};return _0x3b8fa7;}})});}_0x3bad07=_[_0x3bd3('0x45')]({},_0x3bad07,_0x260e7c[_0x3bd3('0x46')]);var _0x1c519a={'where':_0x3bad07[_0x3bd3('0x40')]};return db[_0x3bd3('0x47')][_0x3bd3('0x2a')](_0x1c519a)[_0x3bd3('0x1e')](function(_0x494fb3){_0x45d0c2[_0x3bd3('0x2a')]=_0x494fb3;if(_0x260e7c[_0x3bd3('0x38')][_0x3bd3('0x48')]){_0x3bad07[_0x3bd3('0x49')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x3bd3('0x4a')](_0x3bad07);})['then'](function(_0x173f71){_0x45d0c2[_0x3bd3('0x4b')]=_0x173f71;return _0x45d0c2;})[_0x3bd3('0x1e')](respondWithFilteredResult(_0xd897a6,_0x3bad07))[_0x3bd3('0x27')](handleError(_0xd897a6,null));};exports[_0x3bd3('0x4c')]=function(_0x26543a,_0x26066e){var _0x258e19={'raw':![],'where':{'id':_0x26543a[_0x3bd3('0x4d')]['id']}},_0x5528bf={};_0x5528bf[_0x3bd3('0x36')]=_[_0x3bd3('0x37')](db[_0x3bd3('0x47')]['rawAttributes']);_0x5528bf[_0x3bd3('0x38')]=_['keys'](_0x26543a['query']);_0x5528bf['filters']=_[_0x3bd3('0x39')](_0x5528bf[_0x3bd3('0x36')],_0x5528bf['query']);_0x258e19[_0x3bd3('0x3b')]=_[_0x3bd3('0x39')](_0x5528bf[_0x3bd3('0x36')],qs['fields'](_0x26543a[_0x3bd3('0x38')][_0x3bd3('0x3a')]));_0x258e19[_0x3bd3('0x3b')]=_0x258e19['attributes'][_0x3bd3('0x3c')]?_0x258e19['attributes']:_0x5528bf['model'];if(_0x26543a[_0x3bd3('0x38')][_0x3bd3('0x48')]){_0x258e19[_0x3bd3('0x49')]=[{'all':!![]}];}_0x258e19=_[_0x3bd3('0x45')]({},_0x258e19,_0x26543a[_0x3bd3('0x46')]);return db[_0x3bd3('0x47')][_0x3bd3('0x4e')](_0x258e19)[_0x3bd3('0x1e')](handleEntityNotFound(_0x26066e,null))[_0x3bd3('0x1e')](respondWithResult(_0x26066e,null))[_0x3bd3('0x27')](handleError(_0x26066e,null));};exports[_0x3bd3('0x4f')]=function(_0x3d1854,_0x55d4f3){return db[_0x3bd3('0x47')]['create'](_0x3d1854[_0x3bd3('0x50')],{})[_0x3bd3('0x1e')](respondWithResult(_0x55d4f3,0xc9))['catch'](handleError(_0x55d4f3,null));};exports[_0x3bd3('0x51')]=function(_0x40fd44,_0x3eba96){if(_0x40fd44[_0x3bd3('0x50')]['id']){delete _0x40fd44[_0x3bd3('0x50')]['id'];}return db[_0x3bd3('0x47')][_0x3bd3('0x4e')]({'where':{'id':_0x40fd44[_0x3bd3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3eba96,null))[_0x3bd3('0x1e')](saveUpdates(_0x40fd44[_0x3bd3('0x50')],null))['then'](respondWithResult(_0x3eba96,null))['catch'](handleError(_0x3eba96,null));};exports[_0x3bd3('0x52')]=function(_0x9fa4dd,_0x117b01){return db['FreshdeskAccount'][_0x3bd3('0x4e')]({'where':{'id':_0x9fa4dd[_0x3bd3('0x4d')]['id']}})[_0x3bd3('0x1e')](handleEntityNotFound(_0x117b01,null))[_0x3bd3('0x1e')](removeEntity(_0x117b01,null))['catch'](handleError(_0x117b01,null));};exports[_0x3bd3('0x53')]=function(_0x35cfc6,_0x585613,_0x391404){var _0x392390={};var _0x5d6ee5={};var _0x4edf2f;var _0x58edab;return db[_0x3bd3('0x47')][_0x3bd3('0x54')]({'where':{'id':_0x35cfc6[_0x3bd3('0x4d')]['id']}})[_0x3bd3('0x1e')](handleEntityNotFound(_0x585613,null))[_0x3bd3('0x1e')](function(_0x9d0583){if(_0x9d0583){_0x4edf2f=_0x9d0583;_0x5d6ee5[_0x3bd3('0x36')]=_[_0x3bd3('0x37')](db[_0x3bd3('0x55')][_0x3bd3('0x35')]);_0x5d6ee5[_0x3bd3('0x38')]=_[_0x3bd3('0x37')](_0x35cfc6[_0x3bd3('0x38')]);_0x5d6ee5[_0x3bd3('0x41')]=_[_0x3bd3('0x39')](_0x5d6ee5[_0x3bd3('0x36')],_0x5d6ee5[_0x3bd3('0x38')]);_0x392390['attributes']=_['intersection'](_0x5d6ee5[_0x3bd3('0x36')],qs[_0x3bd3('0x3a')](_0x35cfc6[_0x3bd3('0x38')][_0x3bd3('0x3a')]));_0x392390[_0x3bd3('0x3b')]=_0x392390[_0x3bd3('0x3b')][_0x3bd3('0x3c')]?_0x392390[_0x3bd3('0x3b')]:_0x5d6ee5['model'];_0x392390[_0x3bd3('0x3e')]=qs[_0x3bd3('0x3f')](_0x35cfc6[_0x3bd3('0x38')][_0x3bd3('0x3f')]);_0x392390[_0x3bd3('0x40')]=qs[_0x3bd3('0x41')](_['pick'](_0x35cfc6[_0x3bd3('0x38')],_0x5d6ee5['filters']));if(_0x35cfc6[_0x3bd3('0x38')][_0x3bd3('0x42')]){_0x392390[_0x3bd3('0x40')]=_['merge'](_0x392390[_0x3bd3('0x40')],{'$or':_['map'](_0x392390[_0x3bd3('0x3b')],function(_0x24f85a){var _0x3a13e3={};_0x3a13e3[_0x24f85a]={'$like':'%'+_0x35cfc6[_0x3bd3('0x38')]['filter']+'%'};return _0x3a13e3;})});}_0x392390=_[_0x3bd3('0x45')]({},_0x392390,_0x35cfc6[_0x3bd3('0x46')]);return _0x4edf2f[_0x3bd3('0x53')](_0x392390);}})[_0x3bd3('0x1e')](function(_0x27f6dc){if(_0x27f6dc){_0x58edab=_0x27f6dc['length'];if(!_0x35cfc6[_0x3bd3('0x38')][_0x3bd3('0x56')]('nolimit')){_0x392390[_0x3bd3('0x2c')]=qs[_0x3bd3('0x2c')](_0x35cfc6['query']['limit']);_0x392390[_0x3bd3('0x2b')]=qs[_0x3bd3('0x2b')](_0x35cfc6[_0x3bd3('0x38')][_0x3bd3('0x2b')]);}return _0x4edf2f[_0x3bd3('0x53')](_0x392390);}})[_0x3bd3('0x1e')](function(_0x34f3d9){if(_0x34f3d9){return _0x34f3d9?{'count':_0x58edab,'rows':_0x34f3d9}:null;}})['then'](respondWithResult(_0x585613,null))[_0x3bd3('0x27')](handleError(_0x585613,null));};exports[_0x3bd3('0x57')]=function(_0x5df90f,_0xb68422,_0x37992a){if(_0x5df90f[_0x3bd3('0x50')]['id']){delete _0x5df90f['body']['id'];}return db[_0x3bd3('0x47')][_0x3bd3('0x54')]({'where':{'id':_0x5df90f[_0x3bd3('0x4d')]['id']}})[_0x3bd3('0x1e')](handleEntityNotFound(_0xb68422,null))[_0x3bd3('0x1e')](function(_0x3d4bc4){if(_0x3d4bc4){_0x5df90f['body'][_0x3bd3('0x58')]=_0x3d4bc4['id'];_0x5df90f[_0x3bd3('0x50')][_0x3bd3('0x59')]=integrations[_0x3bd3('0x5a')](_0x5df90f['body']['channel'],_0x5df90f[_0x3bd3('0x50')][_0x3bd3('0x5b')]);_0x5df90f[_0x3bd3('0x50')][_0x3bd3('0x5c')]=integrations[_0x3bd3('0x5d')](_0x5df90f[_0x3bd3('0x50')][_0x3bd3('0x5e')],_0x5df90f[_0x3bd3('0x50')][_0x3bd3('0x5b')]);return db[_0x3bd3('0x55')][_0x3bd3('0x4f')](_0x5df90f[_0x3bd3('0x50')],{'include':[{'model':db['FreshdeskField'],'as':_0x3bd3('0x59')},{'model':db[_0x3bd3('0x5f')],'as':_0x3bd3('0x5c')}]});}return null;})[_0x3bd3('0x1e')](respondWithResult(_0xb68422,null))[_0x3bd3('0x27')](handleError(_0xb68422,null));};exports[_0x3bd3('0x60')]=function(_0x262500,_0x161e3f,_0x42df24){var _0x1b0ebe='';return db[_0x3bd3('0x47')][_0x3bd3('0x54')]({'where':{'id':_0x262500['params']['id']},'attributes':['id','remoteUri',_0x3bd3('0x61')]})['then'](handleEntityNotFound(_0x161e3f,null))[_0x3bd3('0x1e')](function(_0x1f7c66){if(_0x1f7c66){_0x1b0ebe=_0x1f7c66[_0x3bd3('0x62')];var _0x2c2f12=_0x1b0ebe[_0x3bd3('0x63')](-0x1);if(_0x2c2f12==='/'){_0x1b0ebe=_0x1b0ebe['substring'](0x0,_0x1b0ebe[_0x3bd3('0x64')](_0x2c2f12));}return rp({'method':_0x3bd3('0x65'),'uri':util[_0x3bd3('0x66')](_0x3bd3('0x67'),_0x1b0ebe,_0x3bd3('0x68')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x3bd3('0x66')](_0x3bd3('0x69'),_0x1f7c66[_0x3bd3('0x61')]))[_0x3bd3('0x6a')](_0x3bd3('0x6b')))},'json':!![]});}})['then'](function(_0x1eb2e8){if(_0x1eb2e8){var _0x11a9b8=[_0x3bd3('0x6c'),_0x3bd3('0x6d'),_0x3bd3('0x6e'),_0x3bd3('0x6f'),_0x3bd3('0x30'),'priority',_0x3bd3('0x70'),'source',_0x3bd3('0x71'),_0x3bd3('0x70'),'company'];_[_0x3bd3('0x72')](_0x1eb2e8,function(_0x527dc5){return _0x11a9b8['includes'](_0x527dc5['name'])||!_0x527dc5['default']&&_0x527dc5[_0x3bd3('0x5b')]!==_0x3bd3('0x73')&&_0x527dc5['type']!==_0x3bd3('0x74');});return{'count':_0x1eb2e8['length'],'rows':_['map'](_0x1eb2e8,function(_0x30b467){return{'id':_0x30b467['name'],'name':_0x30b467['label'],'custom':!_0x30b467[_0x3bd3('0x75')],'options':_0x30b467[_0x3bd3('0x76')]?_[_0x3bd3('0x77')](_0x30b467[_0x3bd3('0x76')],function(_0x48334e){return{'name':_[_0x3bd3('0x78')](_0x48334e),'value':_0x48334e};}):[]};})};}})[_0x3bd3('0x1e')](respondWithResult(_0x161e3f,null))[_0x3bd3('0x27')](function(_0x20c4ba){var _0x3a0220=_0x262500[_0x3bd3('0x38')][_0x3bd3('0x1b')]?0x1f4:_0x20c4ba[_0x3bd3('0x79')]||0x1f4;logger[_0x3bd3('0x24')](_0x3bd3('0x7a'),_0x3bd3('0x60'),_0x3a0220,JSON['stringify'](_0x20c4ba));delete _0x20c4ba['name'];if(_0x3a0220===0x191){_0x3a0220=0x190;}_0x161e3f[_0x3bd3('0x30')](_0x3a0220)[_0x3bd3('0x7b')](_0x262500[_0x3bd3('0x38')][_0x3bd3('0x1b')]?{'message':_0x3bd3('0x7c'),'statusCode':_0x20c4ba['statusCode']}:_0x20c4ba);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index dca5967..ca48b5e 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 _0x51c7=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x51c7,0x194));var _0x751c=function(_0x23ca3a,_0xe44c43){_0x23ca3a=_0x23ca3a-0x0;var _0x5c1aab=_0x51c7[_0x23ca3a];return _0x5c1aab;};'use strict';var _=require(_0x751c('0x0'));var util=require(_0x751c('0x1'));var logger=require(_0x751c('0x2'))(_0x751c('0x3'));var moment=require('moment');var BPromise=require(_0x751c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x751c('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x751c('0x6'));module['exports']=function(_0x1f2fd8,_0x27c661){return _0x1f2fd8[_0x751c('0x7')](_0x751c('0x8'),attributes,{'tableName':_0x751c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7812=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x7812,0x1a4));var _0x2781=function(_0x2e4048,_0x374fcf){_0x2e4048=_0x2e4048-0x0;var _0x150fee=_0x7812[_0x2e4048];return _0x150fee;};'use strict';var _=require(_0x2781('0x0'));var util=require(_0x2781('0x1'));var logger=require(_0x2781('0x2'))(_0x2781('0x3'));var moment=require('moment');var BPromise=require(_0x2781('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2781('0x5'));var rimraf=require('rimraf');var config=require(_0x2781('0x6'));var attributes=require(_0x2781('0x7'));var integrations=require(_0x2781('0x8'));module[_0x2781('0x9')]=function(_0x3d478b,_0x34d6b3){return _0x3d478b[_0x2781('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x2781('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 2a28e69..319de27 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 _0x57b6=['catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x4bbb17,_0x23d492){var _0x31a5a1=function(_0x2e799e){while(--_0x2e799e){_0x4bbb17['push'](_0x4bbb17['shift']());}};_0x31a5a1(++_0x23d492);}(_0x57b6,0xc2));var _0x657b=function(_0x19fc9b,_0x2cc98a){_0x19fc9b=_0x19fc9b-0x0;var _0x47f7cb=_0x57b6[_0x19fc9b];return _0x47f7cb;};'use strict';var _=require(_0x657b('0x0'));var util=require(_0x657b('0x1'));var moment=require(_0x657b('0x2'));var BPromise=require(_0x657b('0x3'));var rs=require(_0x657b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x657b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x657b('0x6'))('rpc');var config=require(_0x657b('0x7'));var jayson=require(_0x657b('0x8'));var client=jayson[_0x657b('0x9')][_0x657b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfb59a5,_0x176e58,_0x1067d0){return new BPromise(function(_0x272f32,_0x528b85){return client[_0x657b('0xb')](_0xfb59a5,_0x1067d0)[_0x657b('0xc')](function(_0x218b18){logger[_0x657b('0xd')](_0x657b('0xe'),_0x176e58,'request\x20sent');logger['debug'](_0x657b('0xf'),_0x176e58,'request\x20sent',JSON[_0x657b('0x10')](_0x218b18));if(_0x218b18[_0x657b('0x11')]){if(_0x218b18[_0x657b('0x11')][_0x657b('0x12')]===0x1f4){logger[_0x657b('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x176e58,_0x218b18[_0x657b('0x11')][_0x657b('0x13')]);return _0x528b85(_0x218b18['error'][_0x657b('0x13')]);}logger[_0x657b('0x11')](_0x657b('0xe'),_0x176e58,_0x218b18['error']['message']);return _0x272f32(_0x218b18[_0x657b('0x11')][_0x657b('0x13')]);}else{logger['info'](_0x657b('0xe'),_0x176e58,_0x657b('0x14'));_0x272f32(_0x218b18[_0x657b('0x15')][_0x657b('0x13')]);}})[_0x657b('0x16')](function(_0x1096d2){logger['error'](_0x657b('0xe'),_0x176e58,_0x1096d2);_0x528b85(_0x1096d2);});});}exports[_0x657b('0x17')]=function(_0x4f3a1e){var _0x31fb61=this;return new Promise(function(_0x177323,_0x2ec1d7){return db[_0x657b('0x18')][_0x657b('0x19')]({'raw':_0x4f3a1e[_0x657b('0x1a')]?_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f3a1e[_0x657b('0x1a')]?_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1c')]||null:null,'attributes':_0x4f3a1e['options']?_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1d')]||null:null,'limit':_0x4f3a1e[_0x657b('0x1a')]?_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1e')]||null:null,'include':_0x4f3a1e[_0x657b('0x1a')]?_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1f')]?_[_0x657b('0x20')](_0x4f3a1e[_0x657b('0x1a')][_0x657b('0x1f')],function(_0x29b69){return{'model':db[_0x29b69[_0x657b('0x21')]],'as':_0x29b69['as'],'attributes':_0x29b69[_0x657b('0x1d')],'include':_0x29b69[_0x657b('0x1f')]?_[_0x657b('0x20')](_0x29b69[_0x657b('0x1f')],function(_0x42f254){return{'model':db[_0x42f254[_0x657b('0x21')]],'as':_0x42f254['as'],'attributes':_0x42f254[_0x657b('0x1d')],'include':_0x42f254['include']?_[_0x657b('0x20')](_0x42f254['include'],function(_0x55e010){return{'model':db[_0x55e010[_0x657b('0x21')]],'as':_0x55e010['as'],'attributes':_0x55e010[_0x657b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb7543b){logger[_0x657b('0xd')](_0x657b('0x17'),_0x4f3a1e);logger['debug'](_0x657b('0x17'),_0x4f3a1e,JSON[_0x657b('0x10')](_0xb7543b));_0x177323(_0xb7543b);})[_0x657b('0x16')](function(_0x12e1cf){logger[_0x657b('0x11')]('GetFreshdeskAccount',_0x12e1cf[_0x657b('0x13')],_0x4f3a1e);_0x2ec1d7(_0x31fb61[_0x657b('0x11')](0x1f4,_0x12e1cf['message']));});});};exports[_0x657b('0x22')]=function(_0xbfe5c2){var _0x1d2355=this;return new Promise(function(_0x20bc2a,_0x140548){return db[_0x657b('0x18')][_0x657b('0x23')]({'raw':_0xbfe5c2[_0x657b('0x1a')]?_0xbfe5c2[_0x657b('0x1a')][_0x657b('0x1b')]===undefined?!![]:![]:!![],'where':_0xbfe5c2[_0x657b('0x1a')]?_0xbfe5c2['options'][_0x657b('0x1c')]||null:null,'attributes':_0xbfe5c2['options']?_0xbfe5c2[_0x657b('0x1a')][_0x657b('0x1d')]||null:null,'include':_0xbfe5c2[_0x657b('0x1a')]?_0xbfe5c2[_0x657b('0x1a')][_0x657b('0x1f')]?_[_0x657b('0x20')](_0xbfe5c2[_0x657b('0x1a')]['include'],function(_0x497943){return{'model':db[_0x497943[_0x657b('0x21')]],'as':_0x497943['as'],'attributes':_0x497943['attributes'],'include':_0x497943[_0x657b('0x1f')]?_[_0x657b('0x20')](_0x497943['include'],function(_0xbddac0){return{'model':db[_0xbddac0[_0x657b('0x21')]],'as':_0xbddac0['as'],'attributes':_0xbddac0[_0x657b('0x1d')],'include':_0xbddac0[_0x657b('0x1f')]?_[_0x657b('0x20')](_0xbddac0[_0x657b('0x1f')],function(_0x279102){return{'model':db[_0x279102['model']],'as':_0x279102['as'],'attributes':_0x279102[_0x657b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x657b('0xc')](function(_0x9d89f2){logger[_0x657b('0xd')](_0x657b('0x22'),_0xbfe5c2);logger['debug'](_0x657b('0x22'),_0xbfe5c2,JSON[_0x657b('0x10')](_0x9d89f2));_0x20bc2a(_0x9d89f2);})[_0x657b('0x16')](function(_0x5e34d7){logger[_0x657b('0x11')](_0x657b('0x22'),_0x5e34d7[_0x657b('0x13')],_0xbfe5c2);_0x140548(_0x1d2355[_0x657b('0x11')](0x1f4,_0x5e34d7[_0x657b('0x13')]));});});}; \ No newline at end of file +var _0xf048=['map','model','then','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf048,0x95));var _0x8f04=function(_0xea63cf,_0x4e2ab1){_0xea63cf=_0xea63cf-0x0;var _0x4c651b=_0xf048[_0xea63cf];return _0x4c651b;};'use strict';var _=require(_0x8f04('0x0'));var util=require(_0x8f04('0x1'));var moment=require(_0x8f04('0x2'));var BPromise=require(_0x8f04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f04('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f04('0x5'));var logger=require(_0x8f04('0x6'))(_0x8f04('0x7'));var config=require(_0x8f04('0x8'));var jayson=require(_0x8f04('0x9'));var client=jayson[_0x8f04('0xa')][_0x8f04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f65d7,_0x1d3556,_0x4d244a){return new BPromise(function(_0x1a567a,_0x3b1fb5){return client[_0x8f04('0xc')](_0x3f65d7,_0x4d244a)['then'](function(_0x323eca){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x1d3556,'request\x20sent');logger['debug'](_0x8f04('0xd'),_0x1d3556,_0x8f04('0xe'),JSON[_0x8f04('0xf')](_0x323eca));if(_0x323eca[_0x8f04('0x10')]){if(_0x323eca[_0x8f04('0x10')][_0x8f04('0x11')]===0x1f4){logger[_0x8f04('0x10')](_0x8f04('0x12'),_0x1d3556,_0x323eca[_0x8f04('0x10')]['message']);return _0x3b1fb5(_0x323eca['error']['message']);}logger[_0x8f04('0x10')](_0x8f04('0x12'),_0x1d3556,_0x323eca['error']['message']);return _0x1a567a(_0x323eca['error'][_0x8f04('0x13')]);}else{logger[_0x8f04('0x14')](_0x8f04('0x12'),_0x1d3556,'request\x20sent');_0x1a567a(_0x323eca['result'][_0x8f04('0x13')]);}})[_0x8f04('0x15')](function(_0x5b2d6c){logger[_0x8f04('0x10')](_0x8f04('0x12'),_0x1d3556,_0x5b2d6c);_0x3b1fb5(_0x5b2d6c);});});}exports[_0x8f04('0x16')]=function(_0x2468e0){var _0x47667c=this;return new Promise(function(_0x5b9a27,_0x3ef451){return db[_0x8f04('0x17')][_0x8f04('0x18')]({'raw':_0x2468e0[_0x8f04('0x19')]?_0x2468e0[_0x8f04('0x19')][_0x8f04('0x1a')]===undefined?!![]:![]:!![],'where':_0x2468e0[_0x8f04('0x19')]?_0x2468e0[_0x8f04('0x19')][_0x8f04('0x1b')]||null:null,'attributes':_0x2468e0[_0x8f04('0x19')]?_0x2468e0['options'][_0x8f04('0x1c')]||null:null,'limit':_0x2468e0[_0x8f04('0x19')]?_0x2468e0[_0x8f04('0x19')][_0x8f04('0x1d')]||null:null,'include':_0x2468e0[_0x8f04('0x19')]?_0x2468e0[_0x8f04('0x19')][_0x8f04('0x1e')]?_[_0x8f04('0x1f')](_0x2468e0[_0x8f04('0x19')][_0x8f04('0x1e')],function(_0x2b4748){return{'model':db[_0x2b4748[_0x8f04('0x20')]],'as':_0x2b4748['as'],'attributes':_0x2b4748[_0x8f04('0x1c')],'include':_0x2b4748['include']?_['map'](_0x2b4748['include'],function(_0x236d0d){return{'model':db[_0x236d0d['model']],'as':_0x236d0d['as'],'attributes':_0x236d0d['attributes'],'include':_0x236d0d[_0x8f04('0x1e')]?_[_0x8f04('0x1f')](_0x236d0d['include'],function(_0x3fa63c){return{'model':db[_0x3fa63c[_0x8f04('0x20')]],'as':_0x3fa63c['as'],'attributes':_0x3fa63c[_0x8f04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8f04('0x21')](function(_0x4f8752){logger[_0x8f04('0x14')](_0x8f04('0x16'),_0x2468e0);logger['debug'](_0x8f04('0x16'),_0x2468e0,JSON[_0x8f04('0xf')](_0x4f8752));_0x5b9a27(_0x4f8752);})['catch'](function(_0x1f4d98){logger[_0x8f04('0x10')](_0x8f04('0x16'),_0x1f4d98[_0x8f04('0x13')],_0x2468e0);_0x3ef451(_0x47667c['error'](0x1f4,_0x1f4d98[_0x8f04('0x13')]));});});};exports[_0x8f04('0x22')]=function(_0x51d6c3){var _0x269887=this;return new Promise(function(_0x2f4129,_0x14cd63){return db[_0x8f04('0x17')][_0x8f04('0x23')]({'raw':_0x51d6c3[_0x8f04('0x19')]?_0x51d6c3['options'][_0x8f04('0x1a')]===undefined?!![]:![]:!![],'where':_0x51d6c3[_0x8f04('0x19')]?_0x51d6c3['options'][_0x8f04('0x1b')]||null:null,'attributes':_0x51d6c3[_0x8f04('0x19')]?_0x51d6c3['options'][_0x8f04('0x1c')]||null:null,'include':_0x51d6c3[_0x8f04('0x19')]?_0x51d6c3[_0x8f04('0x19')][_0x8f04('0x1e')]?_[_0x8f04('0x1f')](_0x51d6c3[_0x8f04('0x19')][_0x8f04('0x1e')],function(_0x2f0218){return{'model':db[_0x2f0218[_0x8f04('0x20')]],'as':_0x2f0218['as'],'attributes':_0x2f0218[_0x8f04('0x1c')],'include':_0x2f0218['include']?_[_0x8f04('0x1f')](_0x2f0218[_0x8f04('0x1e')],function(_0x433d90){return{'model':db[_0x433d90['model']],'as':_0x433d90['as'],'attributes':_0x433d90[_0x8f04('0x1c')],'include':_0x433d90[_0x8f04('0x1e')]?_[_0x8f04('0x1f')](_0x433d90[_0x8f04('0x1e')],function(_0x599767){return{'model':db[_0x599767[_0x8f04('0x20')]],'as':_0x599767['as'],'attributes':_0x599767['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f04('0x21')](function(_0x1416e5){logger[_0x8f04('0x14')](_0x8f04('0x22'),_0x51d6c3);logger['debug'](_0x8f04('0x22'),_0x51d6c3,JSON[_0x8f04('0xf')](_0x1416e5));_0x2f4129(_0x1416e5);})[_0x8f04('0x15')](function(_0x1136da){logger[_0x8f04('0x10')](_0x8f04('0x22'),_0x1136da[_0x8f04('0x13')],_0x51d6c3);_0x14cd63(_0x269887[_0x8f04('0x10')](0x1f4,_0x1136da[_0x8f04('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 70cb246..701ac9a 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 _0xa41a=['post','create','setTags','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x152b03,_0x2b427f){var _0x5a5d4b=function(_0x3037a3){while(--_0x3037a3){_0x152b03['push'](_0x152b03['shift']());}};_0x5a5d4b(++_0x2b427f);}(_0xa41a,0x6b));var _0xaa41=function(_0x36241d,_0x888d29){_0x36241d=_0x36241d-0x0;var _0x36b52c=_0xa41a[_0x36241d];return _0x36b52c;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0x9')]('/:id/fields',auth[_0xaa41('0xc')](),controller[_0xaa41('0xd')]);router[_0xaa41('0x9')](_0xaa41('0xe'),auth[_0xaa41('0xc')](),controller[_0xaa41('0xf')]);router[_0xaa41('0x9')](_0xaa41('0x10'),auth[_0xaa41('0xc')](),controller['getDescriptions']);router[_0xaa41('0x9')](_0xaa41('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0xaa41('0x12')]('/',auth['isAuthenticated'](),controller[_0xaa41('0x13')]);router[_0xaa41('0x12')](_0xaa41('0x11'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x14')]);router['put'](_0xaa41('0x15'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x16')]);router[_0xaa41('0x17')](_0xaa41('0x15'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5089=['./intFreshdeskConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x565e69,_0x57f767){var _0x456e98=function(_0x15eef0){while(--_0x15eef0){_0x565e69['push'](_0x565e69['shift']());}};_0x456e98(++_0x57f767);}(_0x5089,0x1bb));var _0x9508=function(_0x22eb5d,_0x2e519d){_0x22eb5d=_0x22eb5d-0x0;var _0x4a39ad=_0x5089[_0x22eb5d];return _0x4a39ad;};'use strict';var multer=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var path=require('path');var timeout=require(_0x9508('0x2'));var express=require(_0x9508('0x3'));var router=express[_0x9508('0x4')]();var auth=require(_0x9508('0x5'));var interaction=require(_0x9508('0x6'));var config=require('../../config/environment');var controller=require(_0x9508('0x7'));router['get']('/',auth[_0x9508('0x8')](),controller[_0x9508('0x9')]);router[_0x9508('0xa')]('/:id',auth[_0x9508('0x8')](),controller[_0x9508('0xb')]);router['get'](_0x9508('0xc'),auth[_0x9508('0x8')](),controller['getFields']);router[_0x9508('0xa')]('/:id/subjects',auth[_0x9508('0x8')](),controller[_0x9508('0xd')]);router[_0x9508('0xa')](_0x9508('0xe'),auth[_0x9508('0x8')](),controller[_0x9508('0xf')]);router['get'](_0x9508('0x10'),auth['isAuthenticated'](),controller[_0x9508('0x11')]);router[_0x9508('0x12')]('/',auth['isAuthenticated'](),controller[_0x9508('0x13')]);router[_0x9508('0x12')](_0x9508('0x10'),auth[_0x9508('0x8')](),controller['setTags']);router[_0x9508('0x14')](_0x9508('0x15'),auth['isAuthenticated'](),controller[_0x9508('0x16')]);router['delete'](_0x9508('0x15'),auth[_0x9508('0x8')](),controller[_0x9508('0x17')]);module[_0x9508('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 29fcd41..f42c857 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 _0xd745=['sequelize','exports','STRING'];(function(_0x170755,_0x58c6a9){var _0x19b747=function(_0xb068d5){while(--_0xb068d5){_0x170755['push'](_0x170755['shift']());}};_0x19b747(++_0x58c6a9);}(_0xd745,0x14d));var _0x5d74=function(_0x2d283b,_0x2e9e50){_0x2d283b=_0x2d283b-0x0;var _0x1534d7=_0xd745[_0x2d283b];return _0x1534d7;};'use strict';var Sequelize=require(_0x5d74('0x0'));module[_0x5d74('0x1')]={'name':{'type':Sequelize[_0x5d74('0x2')]},'description':{'type':Sequelize[_0x5d74('0x2')]}}; \ No newline at end of file +var _0x7a08=['exports','STRING','sequelize'];(function(_0x47b05a,_0x4a3b8b){var _0x4b2aaf=function(_0x7d12b1){while(--_0x7d12b1){_0x47b05a['push'](_0x47b05a['shift']());}};_0x4b2aaf(++_0x4a3b8b);}(_0x7a08,0x6e));var _0x87a0=function(_0x1f5d35,_0x13db91){_0x1f5d35=_0x1f5d35-0x0;var _0x27355a=_0x7a08[_0x1f5d35];return _0x27355a;};'use strict';var Sequelize=require(_0x87a0('0x0'));module[_0x87a0('0x1')]={'name':{'type':Sequelize[_0x87a0('0x2')]},'description':{'type':Sequelize[_0x87a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index dd616aa..7ce9a7a 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 _0xa9e0=['length','find','create','catch','body','params','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','FreshdeskConfiguration','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys'];(function(_0x38b0ee,_0x38f896){var _0x31c545=function(_0x29cedf){while(--_0x29cedf){_0x38b0ee['push'](_0x38b0ee['shift']());}};_0x31c545(++_0x38f896);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['create']=function(_0x53975a,_0x39d77d){return db[_0x0a9e('0x32')][_0x0a9e('0x4f')](_0x53975a['body'],{})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x50')](handleError(_0x39d77d,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x51')]['id'];}return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x5a88da[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x51')],null))[_0x0a9e('0x2c')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x50')](handleError(_0x3aedd0,null));};exports['getFields']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={};var _0x2f7092={};var _0x65432;var _0x3cfd00;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5da27d[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x2c')](function(_0x4e67ab){if(_0x4e67ab){_0x65432=_0x4e67ab;_0x2f7092[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x2f7092[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x34')]);_0x47de4c['attributes']=_[_0x0a9e('0x36')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x39')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x47de4c[_0x0a9e('0x38')]:_0x2f7092[_0x0a9e('0x37')];_0x47de4c[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x5da27d['query'][_0x0a9e('0x3d')]);_0x47de4c['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x5da27d[_0x0a9e('0x34')],_0x2f7092['filters']));if(_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x47de4c[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x42')](_0x47de4c[_0x0a9e('0x38')],function(_0x54327c){var _0x797b45={};_0x797b45[_0x54327c]={'$like':'%'+_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x797b45;})});}_0x47de4c=_[_0x0a9e('0x41')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x46')]);return _0x65432['getFields'](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x2937e0){if(_0x2937e0){_0x3cfd00=_0x2937e0[_0x0a9e('0x4d')];if(!_0x5da27d['query'][_0x0a9e('0x3a')]('nolimit')){_0x47de4c['limit']=qs[_0x0a9e('0x26')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x47de4c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x65432[_0x0a9e('0x55')](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3?{'count':_0x3cfd00,'rows':_0x1cc4f3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x50')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x56')]=function(_0x2b8192,_0x320898,_0x412a72){var _0x2a28c0={};var _0x4257c9={};var _0x5150a4;var _0x1b0b98;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x2b8192['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x320898,null))[_0x0a9e('0x2c')](function(_0x4b341d){if(_0x4b341d){_0x5150a4=_0x4b341d;_0x4257c9[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x4257c9[_0x0a9e('0x34')]=_['keys'](_0x2b8192['query']);_0x4257c9['filters']=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],_0x4257c9[_0x0a9e('0x34')]);_0x2a28c0[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x2b8192[_0x0a9e('0x34')]['fields']));_0x2a28c0[_0x0a9e('0x38')]=_0x2a28c0[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x2a28c0['attributes']:_0x4257c9[_0x0a9e('0x37')];_0x2a28c0['order']=qs[_0x0a9e('0x3d')](_0x2b8192[_0x0a9e('0x34')]['sort']);_0x2a28c0[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x2b8192[_0x0a9e('0x34')],_0x4257c9['filters']));if(_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x2a28c0[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x2a28c0['where'],{'$or':_[_0x0a9e('0x42')](_0x2a28c0[_0x0a9e('0x38')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x2b8192['query'][_0x0a9e('0x40')]+'%'};return _0x361b21;})});}_0x2a28c0=_[_0x0a9e('0x41')]({},_0x2a28c0,_0x2b8192[_0x0a9e('0x46')]);return _0x5150a4[_0x0a9e('0x56')](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0xdb98ca){if(_0xdb98ca){_0x1b0b98=_0xdb98ca[_0x0a9e('0x4d')];if(!_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x2a28c0[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x2a28c0['offset']=qs[_0x0a9e('0x25')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x5150a4['getSubjects'](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0?{'count':_0x1b0b98,'rows':_0x33dda0}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x320898,null))[_0x0a9e('0x50')](handleError(_0x320898,null));};exports['getDescriptions']=function(_0x541e80,_0x7ebea8,_0x2bbdb5){var _0x4c54fa={};var _0x45108c={};var _0x53a6a1;var _0x260f4b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x541e80[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7ebea8,null))[_0x0a9e('0x2c')](function(_0x42b959){if(_0x42b959){_0x53a6a1=_0x42b959;_0x45108c[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')]['rawAttributes']);_0x45108c[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x541e80[_0x0a9e('0x34')]);_0x45108c[_0x0a9e('0x35')]=_['intersection'](_0x45108c[_0x0a9e('0x37')],_0x45108c[_0x0a9e('0x34')]);_0x4c54fa['attributes']=_[_0x0a9e('0x36')](_0x45108c['model'],qs[_0x0a9e('0x39')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x4c54fa[_0x0a9e('0x38')]=_0x4c54fa['attributes']['length']?_0x4c54fa[_0x0a9e('0x38')]:_0x45108c[_0x0a9e('0x37')];_0x4c54fa[_0x0a9e('0x3c')]=qs['sort'](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x4c54fa['where']=qs['filters'](_[_0x0a9e('0x3f')](_0x541e80['query'],_0x45108c['filters']));if(_0x541e80['query'][_0x0a9e('0x40')]){_0x4c54fa[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x4c54fa[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x4c54fa[_0x0a9e('0x38')],function(_0x5a8854){var _0x5fd5db={};_0x5fd5db[_0x5a8854]={'$like':'%'+_0x541e80['query'][_0x0a9e('0x40')]+'%'};return _0x5fd5db;})});}_0x4c54fa=_[_0x0a9e('0x41')]({},_0x4c54fa,_0x541e80[_0x0a9e('0x46')]);return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})['then'](function(_0x46c9ac){if(_0x46c9ac){_0x260f4b=_0x46c9ac[_0x0a9e('0x4d')];if(!_0x541e80[_0x0a9e('0x34')]['hasOwnProperty'](_0x0a9e('0x3b'))){_0x4c54fa[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x4c54fa[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x541e80[_0x0a9e('0x34')]['offset']);}return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})[_0x0a9e('0x2c')](function(_0x589ff3){if(_0x589ff3){return _0x589ff3?{'count':_0x260f4b,'rows':_0x589ff3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x7ebea8,null))[_0x0a9e('0x50')](handleError(_0x7ebea8,null));};exports[_0x0a9e('0x58')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={};var _0x2b5148={};var _0x558a87;var _0x1f29bd;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5a26c8[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x96672f,null))['then'](function(_0x329d88){if(_0x329d88){_0x558a87=_0x329d88;_0x2b5148[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x59')][_0x0a9e('0x33')]);_0x2b5148[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5a26c8[_0x0a9e('0x34')]);_0x2b5148[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b5148[_0x0a9e('0x37')],_0x2b5148[_0x0a9e('0x34')]);_0x8c8fbe[_0x0a9e('0x38')]=_['intersection'](_0x2b5148[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x8c8fbe[_0x0a9e('0x38')]=_0x8c8fbe['attributes'][_0x0a9e('0x4d')]?_0x8c8fbe[_0x0a9e('0x38')]:_0x2b5148['model'];_0x8c8fbe[_0x0a9e('0x3c')]=qs['sort'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x8c8fbe[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_['pick'](_0x5a26c8[_0x0a9e('0x34')],_0x2b5148['filters']));if(_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x8c8fbe['where']=_[_0x0a9e('0x41')](_0x8c8fbe[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x8c8fbe['attributes'],function(_0x4c788f){var _0x1b82b7={};_0x1b82b7[_0x4c788f]={'$like':'%'+_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x1b82b7;})});}_0x8c8fbe=_[_0x0a9e('0x41')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x46')]);return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x3c75b9){if(_0x3c75b9){_0x1f29bd=_0x3c75b9[_0x0a9e('0x4d')];if(!_0x5a26c8['query'][_0x0a9e('0x3a')]('nolimit')){_0x8c8fbe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x8c8fbe[_0x0a9e('0x25')]=qs['offset'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x2263f1){if(_0x2263f1){return _0x2263f1?{'count':_0x1f29bd,'rows':_0x2263f1}:null;}})['then'](respondWithResult(_0x96672f,null))['catch'](handleError(_0x96672f,null));};exports[_0x0a9e('0x5a')]=function(_0x583662,_0x25eae0,_0x4658df){if(_0x583662[_0x0a9e('0x51')]['id']){delete _0x583662[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x583662['params']['id']}})['then'](handleEntityNotFound(_0x25eae0,null))[_0x0a9e('0x2c')](function(_0x5dfbe2){if(_0x5dfbe2){return _0x5dfbe2[_0x0a9e('0x5a')](_0x583662['body'][_0x0a9e('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x25eae0,null))['catch'](handleError(_0x25eae0,null));}; \ No newline at end of file +var _0xa9e0=['length','find','create','catch','body','params','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','FreshdeskConfiguration','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys'];(function(_0x18a9b0,_0x4e3b2e){var _0x11a413=function(_0x43b5fe){while(--_0x43b5fe){_0x18a9b0['push'](_0x18a9b0['shift']());}};_0x11a413(++_0x4e3b2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['create']=function(_0x53975a,_0x39d77d){return db[_0x0a9e('0x32')][_0x0a9e('0x4f')](_0x53975a['body'],{})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,0xc9))[_0x0a9e('0x50')](handleError(_0x39d77d,null));};exports['update']=function(_0x5a88da,_0x2ef381){if(_0x5a88da['body']['id']){delete _0x5a88da[_0x0a9e('0x51')]['id'];}return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x5a88da[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x2ef381,null))['then'](saveUpdates(_0x5a88da[_0x0a9e('0x51')],null))[_0x0a9e('0x2c')](respondWithResult(_0x2ef381,null))['catch'](handleError(_0x2ef381,null));};exports['destroy']=function(_0x128aa6,_0x3aedd0){return db['FreshdeskConfiguration'][_0x0a9e('0x4e')]({'where':{'id':_0x128aa6['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x3aedd0,null))['then'](removeEntity(_0x3aedd0,null))[_0x0a9e('0x50')](handleError(_0x3aedd0,null));};exports['getFields']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={};var _0x2f7092={};var _0x65432;var _0x3cfd00;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5da27d[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x2c')](function(_0x4e67ab){if(_0x4e67ab){_0x65432=_0x4e67ab;_0x2f7092[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x2f7092[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x34')]);_0x47de4c['attributes']=_[_0x0a9e('0x36')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x39')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x47de4c[_0x0a9e('0x38')]:_0x2f7092[_0x0a9e('0x37')];_0x47de4c[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x5da27d['query'][_0x0a9e('0x3d')]);_0x47de4c['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x5da27d[_0x0a9e('0x34')],_0x2f7092['filters']));if(_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x47de4c[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x42')](_0x47de4c[_0x0a9e('0x38')],function(_0x54327c){var _0x797b45={};_0x797b45[_0x54327c]={'$like':'%'+_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x797b45;})});}_0x47de4c=_[_0x0a9e('0x41')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x46')]);return _0x65432['getFields'](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x2937e0){if(_0x2937e0){_0x3cfd00=_0x2937e0[_0x0a9e('0x4d')];if(!_0x5da27d['query'][_0x0a9e('0x3a')]('nolimit')){_0x47de4c['limit']=qs[_0x0a9e('0x26')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x47de4c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5da27d[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x65432[_0x0a9e('0x55')](_0x47de4c);}})[_0x0a9e('0x2c')](function(_0x1cc4f3){if(_0x1cc4f3){return _0x1cc4f3?{'count':_0x3cfd00,'rows':_0x1cc4f3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x5df0ad,null))[_0x0a9e('0x50')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x56')]=function(_0x2b8192,_0x320898,_0x412a72){var _0x2a28c0={};var _0x4257c9={};var _0x5150a4;var _0x1b0b98;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x2b8192['params']['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x320898,null))[_0x0a9e('0x2c')](function(_0x4b341d){if(_0x4b341d){_0x5150a4=_0x4b341d;_0x4257c9[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')][_0x0a9e('0x33')]);_0x4257c9[_0x0a9e('0x34')]=_['keys'](_0x2b8192['query']);_0x4257c9['filters']=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],_0x4257c9[_0x0a9e('0x34')]);_0x2a28c0[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x4257c9[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x2b8192[_0x0a9e('0x34')]['fields']));_0x2a28c0[_0x0a9e('0x38')]=_0x2a28c0[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x2a28c0['attributes']:_0x4257c9[_0x0a9e('0x37')];_0x2a28c0['order']=qs[_0x0a9e('0x3d')](_0x2b8192[_0x0a9e('0x34')]['sort']);_0x2a28c0[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x2b8192[_0x0a9e('0x34')],_0x4257c9['filters']));if(_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x2a28c0[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x2a28c0['where'],{'$or':_[_0x0a9e('0x42')](_0x2a28c0[_0x0a9e('0x38')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x2b8192['query'][_0x0a9e('0x40')]+'%'};return _0x361b21;})});}_0x2a28c0=_[_0x0a9e('0x41')]({},_0x2a28c0,_0x2b8192[_0x0a9e('0x46')]);return _0x5150a4[_0x0a9e('0x56')](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0xdb98ca){if(_0xdb98ca){_0x1b0b98=_0xdb98ca[_0x0a9e('0x4d')];if(!_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x2a28c0[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x2a28c0['offset']=qs[_0x0a9e('0x25')](_0x2b8192[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x5150a4['getSubjects'](_0x2a28c0);}})[_0x0a9e('0x2c')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0?{'count':_0x1b0b98,'rows':_0x33dda0}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x320898,null))[_0x0a9e('0x50')](handleError(_0x320898,null));};exports['getDescriptions']=function(_0x541e80,_0x7ebea8,_0x2bbdb5){var _0x4c54fa={};var _0x45108c={};var _0x53a6a1;var _0x260f4b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x541e80[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7ebea8,null))[_0x0a9e('0x2c')](function(_0x42b959){if(_0x42b959){_0x53a6a1=_0x42b959;_0x45108c[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x54')]['rawAttributes']);_0x45108c[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x541e80[_0x0a9e('0x34')]);_0x45108c[_0x0a9e('0x35')]=_['intersection'](_0x45108c[_0x0a9e('0x37')],_0x45108c[_0x0a9e('0x34')]);_0x4c54fa['attributes']=_[_0x0a9e('0x36')](_0x45108c['model'],qs[_0x0a9e('0x39')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x4c54fa[_0x0a9e('0x38')]=_0x4c54fa['attributes']['length']?_0x4c54fa[_0x0a9e('0x38')]:_0x45108c[_0x0a9e('0x37')];_0x4c54fa[_0x0a9e('0x3c')]=qs['sort'](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x4c54fa['where']=qs['filters'](_[_0x0a9e('0x3f')](_0x541e80['query'],_0x45108c['filters']));if(_0x541e80['query'][_0x0a9e('0x40')]){_0x4c54fa[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x4c54fa[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x4c54fa[_0x0a9e('0x38')],function(_0x5a8854){var _0x5fd5db={};_0x5fd5db[_0x5a8854]={'$like':'%'+_0x541e80['query'][_0x0a9e('0x40')]+'%'};return _0x5fd5db;})});}_0x4c54fa=_[_0x0a9e('0x41')]({},_0x4c54fa,_0x541e80[_0x0a9e('0x46')]);return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})['then'](function(_0x46c9ac){if(_0x46c9ac){_0x260f4b=_0x46c9ac[_0x0a9e('0x4d')];if(!_0x541e80[_0x0a9e('0x34')]['hasOwnProperty'](_0x0a9e('0x3b'))){_0x4c54fa[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x541e80[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x4c54fa[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x541e80[_0x0a9e('0x34')]['offset']);}return _0x53a6a1[_0x0a9e('0x57')](_0x4c54fa);}})[_0x0a9e('0x2c')](function(_0x589ff3){if(_0x589ff3){return _0x589ff3?{'count':_0x260f4b,'rows':_0x589ff3}:null;}})[_0x0a9e('0x2c')](respondWithResult(_0x7ebea8,null))[_0x0a9e('0x50')](handleError(_0x7ebea8,null));};exports[_0x0a9e('0x58')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={};var _0x2b5148={};var _0x558a87;var _0x1f29bd;return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x5a26c8[_0x0a9e('0x52')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x96672f,null))['then'](function(_0x329d88){if(_0x329d88){_0x558a87=_0x329d88;_0x2b5148[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x59')][_0x0a9e('0x33')]);_0x2b5148[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x5a26c8[_0x0a9e('0x34')]);_0x2b5148[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b5148[_0x0a9e('0x37')],_0x2b5148[_0x0a9e('0x34')]);_0x8c8fbe[_0x0a9e('0x38')]=_['intersection'](_0x2b5148[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x8c8fbe[_0x0a9e('0x38')]=_0x8c8fbe['attributes'][_0x0a9e('0x4d')]?_0x8c8fbe[_0x0a9e('0x38')]:_0x2b5148['model'];_0x8c8fbe[_0x0a9e('0x3c')]=qs['sort'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x3d')]);_0x8c8fbe[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_['pick'](_0x5a26c8[_0x0a9e('0x34')],_0x2b5148['filters']));if(_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x8c8fbe['where']=_[_0x0a9e('0x41')](_0x8c8fbe[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0x8c8fbe['attributes'],function(_0x4c788f){var _0x1b82b7={};_0x1b82b7[_0x4c788f]={'$like':'%'+_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x1b82b7;})});}_0x8c8fbe=_[_0x0a9e('0x41')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x46')]);return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x3c75b9){if(_0x3c75b9){_0x1f29bd=_0x3c75b9[_0x0a9e('0x4d')];if(!_0x5a26c8['query'][_0x0a9e('0x3a')]('nolimit')){_0x8c8fbe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x26')]);_0x8c8fbe[_0x0a9e('0x25')]=qs['offset'](_0x5a26c8[_0x0a9e('0x34')][_0x0a9e('0x25')]);}return _0x558a87[_0x0a9e('0x58')](_0x8c8fbe);}})[_0x0a9e('0x2c')](function(_0x2263f1){if(_0x2263f1){return _0x2263f1?{'count':_0x1f29bd,'rows':_0x2263f1}:null;}})['then'](respondWithResult(_0x96672f,null))['catch'](handleError(_0x96672f,null));};exports[_0x0a9e('0x5a')]=function(_0x583662,_0x25eae0,_0x4658df){if(_0x583662[_0x0a9e('0x51')]['id']){delete _0x583662[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x53')]({'where':{'id':_0x583662['params']['id']}})['then'](handleEntityNotFound(_0x25eae0,null))[_0x0a9e('0x2c')](function(_0x5dfbe2){if(_0x5dfbe2){return _0x5dfbe2[_0x0a9e('0x5a')](_0x583662['body'][_0x0a9e('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x25eae0,null))['catch'](handleError(_0x25eae0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b5c6011..70e1900 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 _0x38f0=['api','moment','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x2bbf5b,_0x225431){var _0x6cce2a=function(_0x5c57ec){while(--_0x5c57ec){_0x2bbf5b['push'](_0x2bbf5b['shift']());}};_0x6cce2a(++_0x225431);}(_0x38f0,0x190));var _0x038f=function(_0x529723,_0x330a7f){_0x529723=_0x529723-0x0;var _0x1aad0a=_0x38f0[_0x529723];return _0x1aad0a;};'use strict';var _=require(_0x038f('0x0'));var util=require(_0x038f('0x1'));var logger=require(_0x038f('0x2'))(_0x038f('0x3'));var moment=require(_0x038f('0x4'));var BPromise=require('bluebird');var rp=require(_0x038f('0x5'));var fs=require('fs');var path=require(_0x038f('0x6'));var rimraf=require(_0x038f('0x7'));var config=require('../../config/environment');var attributes=require(_0x038f('0x8'));module[_0x038f('0x9')]=function(_0x3f342c,_0x4c6be7){return _0x3f342c[_0x038f('0xa')](_0x038f('0xb'),attributes,{'tableName':_0x038f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7f9=['FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','define'];(function(_0x56f16a,_0xc38e25){var _0x19e0ca=function(_0xad8cf){while(--_0xad8cf){_0x56f16a['push'](_0x56f16a['shift']());}};_0x19e0ca(++_0xc38e25);}(_0xe7f9,0x124));var _0x9e7f=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0xe7f9[_0x4de9e8];return _0x4db0de;};'use strict';var _=require('lodash');var util=require(_0x9e7f('0x0'));var logger=require(_0x9e7f('0x1'))(_0x9e7f('0x2'));var moment=require(_0x9e7f('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e7f('0x5'));var attributes=require(_0x9e7f('0x6'));module['exports']=function(_0x272660,_0x34b0d7){return _0x272660[_0x9e7f('0x7')](_0x9e7f('0x8'),attributes,{'tableName':_0x9e7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index c457646..28b4b0e 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 _0xd1f7=['result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xd1f7,0x9a));var _0x7d1f=function(_0x521054,_0x227c2f){_0x521054=_0x521054-0x0;var _0x4136d9=_0xd1f7[_0x521054];return _0x4136d9;};'use strict';var _=require('lodash');var util=require(_0x7d1f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d1f('0x1'));var fs=require('fs');var Redis=require(_0x7d1f('0x2'));var db=require(_0x7d1f('0x3'))['db'];var utils=require(_0x7d1f('0x4'));var logger=require('../../config/logger')(_0x7d1f('0x5'));var config=require(_0x7d1f('0x6'));var jayson=require(_0x7d1f('0x7'));var client=jayson[_0x7d1f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a9f10,_0x155c38,_0x421993){return new BPromise(function(_0x4fddcb,_0x533f43){return client[_0x7d1f('0x9')](_0x2a9f10,_0x421993)['then'](function(_0x1d0615){logger[_0x7d1f('0xa')](_0x7d1f('0xb'),_0x155c38,_0x7d1f('0xc'));logger[_0x7d1f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x155c38,_0x7d1f('0xc'),JSON['stringify'](_0x1d0615));if(_0x1d0615[_0x7d1f('0xe')]){if(_0x1d0615[_0x7d1f('0xe')][_0x7d1f('0xf')]===0x1f4){logger['error'](_0x7d1f('0xb'),_0x155c38,_0x1d0615[_0x7d1f('0xe')][_0x7d1f('0x10')]);return _0x533f43(_0x1d0615[_0x7d1f('0xe')][_0x7d1f('0x10')]);}logger[_0x7d1f('0xe')](_0x7d1f('0xb'),_0x155c38,_0x1d0615[_0x7d1f('0xe')][_0x7d1f('0x10')]);return _0x4fddcb(_0x1d0615['error'][_0x7d1f('0x10')]);}else{logger[_0x7d1f('0xa')](_0x7d1f('0xb'),_0x155c38,_0x7d1f('0xc'));_0x4fddcb(_0x1d0615[_0x7d1f('0x11')]['message']);}})[_0x7d1f('0x12')](function(_0x279d78){logger[_0x7d1f('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x155c38,_0x279d78);_0x533f43(_0x279d78);});});} \ No newline at end of file +var _0x5be3=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5be3,0x1b0));var _0x35be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5be3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x35be('0x0'));var util=require('util');var moment=require(_0x35be('0x1'));var BPromise=require(_0x35be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35be('0x3'));var db=require(_0x35be('0x4'))['db'];var utils=require(_0x35be('0x5'));var logger=require(_0x35be('0x6'))(_0x35be('0x7'));var config=require(_0x35be('0x8'));var jayson=require(_0x35be('0x9'));var client=jayson[_0x35be('0xa')][_0x35be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56e6a2,_0x4a41e0,_0x112718){return new BPromise(function(_0x23838f,_0xc4856f){return client['request'](_0x56e6a2,_0x112718)[_0x35be('0xc')](function(_0x573835){logger[_0x35be('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a41e0,_0x35be('0xe'));logger[_0x35be('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4a41e0,_0x35be('0xe'),JSON[_0x35be('0x10')](_0x573835));if(_0x573835[_0x35be('0x11')]){if(_0x573835[_0x35be('0x11')][_0x35be('0x12')]===0x1f4){logger[_0x35be('0x11')](_0x35be('0x13'),_0x4a41e0,_0x573835['error'][_0x35be('0x14')]);return _0xc4856f(_0x573835['error'][_0x35be('0x14')]);}logger['error'](_0x35be('0x13'),_0x4a41e0,_0x573835[_0x35be('0x11')]['message']);return _0x23838f(_0x573835['error']['message']);}else{logger[_0x35be('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a41e0,_0x35be('0xe'));_0x23838f(_0x573835['result'][_0x35be('0x14')]);}})[_0x35be('0x15')](function(_0x510bbd){logger[_0x35be('0x11')](_0x35be('0x13'),_0x4a41e0,_0x510bbd);_0xc4856f(_0x510bbd);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index a873232..d20640d 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 _0x2f3a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','/:id','update','delete','destroy','exports','multer'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4d3a08,_0x3f8cc3){_0x4d3a08=_0x4d3a08-0x0;var _0x5d0a08=_0x2f3a[_0x4d3a08];return _0x5d0a08;};'use strict';var multer=require(_0xa2f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2f3('0x1'));var express=require(_0xa2f3('0x2'));var router=express[_0xa2f3('0x3')]();var auth=require(_0xa2f3('0x4'));var interaction=require(_0xa2f3('0x5'));var config=require(_0xa2f3('0x6'));var controller=require('./intFreshdeskField.controller');router[_0xa2f3('0x7')]('/',auth['isAuthenticated'](),controller[_0xa2f3('0x8')]);router[_0xa2f3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa2f3('0x9')]);router[_0xa2f3('0xa')]('/',auth[_0xa2f3('0xb')](),controller[_0xa2f3('0xc')]);router['put'](_0xa2f3('0xd'),auth[_0xa2f3('0xb')](),controller[_0xa2f3('0xe')]);router[_0xa2f3('0xf')](_0xa2f3('0xd'),auth['isAuthenticated'](),controller[_0xa2f3('0x10')]);module[_0xa2f3('0x11')]=router; \ No newline at end of file +var _0xffea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xbd59ca,_0x46b7bc){var _0x503bfd=function(_0x419d65){while(--_0x419d65){_0xbd59ca['push'](_0xbd59ca['shift']());}};_0x503bfd(++_0x46b7bc);}(_0xffea,0x199));var _0xaffe=function(_0x2793d6,_0xcd6c37){_0x2793d6=_0x2793d6-0x0;var _0x41ff6d=_0xffea[_0x2793d6];return _0x41ff6d;};'use strict';var multer=require(_0xaffe('0x0'));var util=require(_0xaffe('0x1'));var path=require(_0xaffe('0x2'));var timeout=require(_0xaffe('0x3'));var express=require(_0xaffe('0x4'));var router=express[_0xaffe('0x5')]();var auth=require(_0xaffe('0x6'));var interaction=require(_0xaffe('0x7'));var config=require(_0xaffe('0x8'));var controller=require(_0xaffe('0x9'));router[_0xaffe('0xa')]('/',auth[_0xaffe('0xb')](),controller['index']);router[_0xaffe('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xaffe('0xc')]);router['post']('/',auth[_0xaffe('0xb')](),controller[_0xaffe('0xd')]);router[_0xaffe('0xe')]('/:id',auth[_0xaffe('0xb')](),controller['update']);router[_0xaffe('0xf')]('/:id',auth[_0xaffe('0xb')](),controller[_0xaffe('0x10')]);module[_0xaffe('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 23ee0da..c110908 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 _0x6f7a=['ENUM','string','customVariable','keyValue','STRING','variable','sequelize','exports'];(function(_0x5f1204,_0x92b018){var _0x44cf32=function(_0x2f7aaf){while(--_0x2f7aaf){_0x5f1204['push'](_0x5f1204['shift']());}};_0x44cf32(++_0x92b018);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0xa35391,_0x14f31b){_0xa35391=_0xa35391-0x0;var _0x909a72=_0x6f7a[_0xa35391];return _0x909a72;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'type':{'type':Sequelize[_0xa6f7('0x2')](_0xa6f7('0x3'),'variable',_0xa6f7('0x4'),_0xa6f7('0x5')),'defaultValue':_0xa6f7('0x3')},'content':{'type':Sequelize[_0xa6f7('0x6')]},'key':{'type':Sequelize[_0xa6f7('0x6')]},'keyType':{'type':Sequelize[_0xa6f7('0x2')](_0xa6f7('0x3'),_0xa6f7('0x7'),_0xa6f7('0x4'))},'keyContent':{'type':Sequelize[_0xa6f7('0x6')]},'idField':{'type':Sequelize[_0xa6f7('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa6f7('0x6')]}}; \ No newline at end of file +var _0x878f=['exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x4bdacd,_0x22f779){var _0x101e0b=function(_0x121bca){while(--_0x121bca){_0x4bdacd['push'](_0x4bdacd['shift']());}};_0x101e0b(++_0x22f779);}(_0x878f,0x173));var _0xf878=function(_0x27e543,_0x48a4a5){_0x27e543=_0x27e543-0x0;var _0x20a6a6=_0x878f[_0x27e543];return _0x20a6a6;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'type':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),_0xf878('0x3'),_0xf878('0x4'),_0xf878('0x5')),'defaultValue':_0xf878('0x2')},'content':{'type':Sequelize[_0xf878('0x6')]},'key':{'type':Sequelize[_0xf878('0x6')]},'keyType':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf878('0x6')]},'idField':{'type':Sequelize[_0xf878('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a059ed0..56755ee 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 _0x5887=['merge','map','type','includeAll','findAll','rows','show','keys','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where'];(function(_0x41cdde,_0x4bd78c){var _0x2dec1e=function(_0xc4e978){while(--_0xc4e978){_0x41cdde['push'](_0x41cdde['shift']());}};_0x2dec1e(++_0x4bd78c);}(_0x5887,0x12e));var _0x7588=function(_0xe45b6d,_0x443cac){_0xe45b6d=_0xe45b6d-0x0;var _0x4d6f47=_0x5887[_0xe45b6d];return _0x4d6f47;};'use strict';var pdf=require(_0x7588('0x0'));var emlformat=require(_0x7588('0x1'));var rimraf=require(_0x7588('0x2'));var zipdir=require(_0x7588('0x3'));var jsonpatch=require(_0x7588('0x4'));var rp=require(_0x7588('0x5'));var moment=require(_0x7588('0x6'));var BPromise=require(_0x7588('0x7'));var Mustache=require('mustache');var util=require(_0x7588('0x8'));var path=require(_0x7588('0x9'));var sox=require('sox');var csv=require(_0x7588('0xa'));var ejs=require(_0x7588('0xb'));var fs=require('fs');var _=require(_0x7588('0xc'));var squel=require(_0x7588('0xd'));var crypto=require(_0x7588('0xe'));var jsforce=require(_0x7588('0xf'));var deskjs=require(_0x7588('0x10'));var toCsv=require(_0x7588('0xa'));var querystring=require(_0x7588('0x11'));var Papa=require(_0x7588('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7588('0x13'));var hardwareService=require(_0x7588('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7588('0x15'));var config=require(_0x7588('0x16'));var db=require(_0x7588('0x17'))['db'];function respondWithStatusCode(_0x5b1d18,_0x13fde6){_0x13fde6=_0x13fde6||0xcc;return function(_0x5d61d1){if(_0x5d61d1){return _0x5b1d18[_0x7588('0x18')](_0x13fde6);}return _0x5b1d18[_0x7588('0x19')](_0x13fde6)[_0x7588('0x1a')]();};}function respondWithResult(_0x2d914e,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x57f035){if(_0x57f035){return _0x2d914e[_0x7588('0x19')](_0x16e490)['json'](_0x57f035);}};}function respondWithFilteredResult(_0x57b601,_0x58c9ac){return function(_0x45f3d8){if(_0x45f3d8){var _0x5c115f=_0x45f3d8[_0x7588('0x1b')],_0x4b1528=_0x58c9ac[_0x7588('0x1c')],_0x5c5d11=_0x58c9ac[_0x7588('0x1c')]+_0x58c9ac[_0x7588('0x1d')],_0x58c94a;if(_0x5c5d11>=_0x5c115f){_0x5c5d11=_0x5c115f;_0x58c94a=0xc8;}else{_0x58c94a=0xce;}_0x57b601[_0x7588('0x19')](_0x58c94a);return _0x57b601[_0x7588('0x1e')](_0x7588('0x1f'),_0x4b1528+'-'+_0x5c5d11+'/'+_0x5c115f)[_0x7588('0x20')](_0x45f3d8);}return null;};}function patchUpdates(_0x57e6dd){return function(_0x4e6777){try{jsonpatch[_0x7588('0x21')](_0x4e6777,_0x57e6dd,!![]);}catch(_0x44dc15){return BPromise['reject'](_0x44dc15);}return _0x4e6777[_0x7588('0x22')]();};}function saveUpdates(_0x13874b,_0x482fdb){return function(_0x435924){if(_0x435924){return _0x435924[_0x7588('0x23')](_0x13874b)[_0x7588('0x24')](function(_0x18b6e8){return _0x18b6e8;});}return null;};}function removeEntity(_0x393f41,_0x24e274){return function(_0x2b4295){if(_0x2b4295){return _0x2b4295[_0x7588('0x25')]()[_0x7588('0x24')](function(){_0x393f41[_0x7588('0x19')](0xcc)[_0x7588('0x1a')]();});}};}function handleEntityNotFound(_0x3b4369,_0x481b78){return function(_0x193d9c){if(!_0x193d9c){_0x3b4369[_0x7588('0x18')](0x194);}return _0x193d9c;};}function handleError(_0x5b7b00,_0x26162f){_0x26162f=_0x26162f||0x1f4;return function(_0x4aba35){logger[_0x7588('0x26')](_0x4aba35[_0x7588('0x27')]);if(_0x4aba35[_0x7588('0x28')]){delete _0x4aba35[_0x7588('0x28')];}_0x5b7b00[_0x7588('0x19')](_0x26162f)[_0x7588('0x29')](_0x4aba35);};}exports[_0x7588('0x2a')]=function(_0x3f6d0b,_0x3ec236){var _0x2a67d8={},_0xe91a36={},_0x18e1ab={'count':0x0,'rows':[]};var _0x2e3a38=db[_0x7588('0x2b')][_0x7588('0x2c')];_0xe91a36[_0x7588('0x2d')]=_['keys'](_0x2e3a38);_0xe91a36['query']=_['keys'](_0x3f6d0b[_0x7588('0x2e')]);_0xe91a36['filters']=_[_0x7588('0x2f')](_0xe91a36[_0x7588('0x2d')],_0xe91a36[_0x7588('0x2e')]);_0x2a67d8['attributes']=_[_0x7588('0x2f')](_0xe91a36['model'],qs[_0x7588('0x30')](_0x3f6d0b[_0x7588('0x2e')]['fields']));_0x2a67d8[_0x7588('0x31')]=_0x2a67d8[_0x7588('0x31')][_0x7588('0x32')]?_0x2a67d8[_0x7588('0x31')]:_0xe91a36[_0x7588('0x2d')];if(!_0x3f6d0b[_0x7588('0x2e')][_0x7588('0x33')](_0x7588('0x34'))){_0x2a67d8[_0x7588('0x1d')]=qs[_0x7588('0x1d')](_0x3f6d0b[_0x7588('0x2e')][_0x7588('0x1d')]);_0x2a67d8[_0x7588('0x1c')]=qs[_0x7588('0x1c')](_0x3f6d0b[_0x7588('0x2e')][_0x7588('0x1c')]);}_0x2a67d8['order']=qs[_0x7588('0x35')](_0x3f6d0b[_0x7588('0x2e')]['sort']);_0x2a67d8['where']=qs[_0x7588('0x36')](_[_0x7588('0x37')](_0x3f6d0b['query'],_0xe91a36['filters']));if(_0x3f6d0b['query'][_0x7588('0x38')]){_0x2a67d8[_0x7588('0x39')]=_[_0x7588('0x3a')](_0x2a67d8[_0x7588('0x39')],{'$or':_[_0x7588('0x3b')](_0x2e3a38,function(_0x2ac10d){if(_0x2ac10d[_0x7588('0x3c')]['key']!=='VIRTUAL'){var _0x2282fb={};_0x2282fb[_0x2ac10d['field']]={'$like':'%'+_0x3f6d0b[_0x7588('0x2e')]['filter']+'%'};return _0x2282fb;}})});}_0x2a67d8=_[_0x7588('0x3a')]({},_0x2a67d8,_0x3f6d0b['options']);var _0x5a3388={'where':_0x2a67d8[_0x7588('0x39')]};return db[_0x7588('0x2b')][_0x7588('0x1b')](_0x5a3388)[_0x7588('0x24')](function(_0x302597){_0x18e1ab['count']=_0x302597;if(_0x3f6d0b[_0x7588('0x2e')][_0x7588('0x3d')]){_0x2a67d8['include']=[{'all':!![]}];}return db[_0x7588('0x2b')][_0x7588('0x3e')](_0x2a67d8);})[_0x7588('0x24')](function(_0x171890){_0x18e1ab[_0x7588('0x3f')]=_0x171890;return _0x18e1ab;})[_0x7588('0x24')](respondWithFilteredResult(_0x3ec236,_0x2a67d8))['catch'](handleError(_0x3ec236,null));};exports[_0x7588('0x40')]=function(_0x1f1fe5,_0x486fd9){var _0x1f8676={'raw':!![],'where':{'id':_0x1f1fe5['params']['id']}},_0x1a1ac2={};_0x1a1ac2[_0x7588('0x2d')]=_[_0x7588('0x41')](db[_0x7588('0x2b')][_0x7588('0x2c')]);_0x1a1ac2[_0x7588('0x2e')]=_[_0x7588('0x41')](_0x1f1fe5[_0x7588('0x2e')]);_0x1a1ac2['filters']=_[_0x7588('0x2f')](_0x1a1ac2['model'],_0x1a1ac2[_0x7588('0x2e')]);_0x1f8676[_0x7588('0x31')]=_['intersection'](_0x1a1ac2['model'],qs[_0x7588('0x30')](_0x1f1fe5['query'][_0x7588('0x30')]));_0x1f8676[_0x7588('0x31')]=_0x1f8676[_0x7588('0x31')][_0x7588('0x32')]?_0x1f8676[_0x7588('0x31')]:_0x1a1ac2[_0x7588('0x2d')];if(_0x1f1fe5['query'][_0x7588('0x3d')]){_0x1f8676['include']=[{'all':!![]}];}_0x1f8676=_[_0x7588('0x3a')]({},_0x1f8676,_0x1f1fe5[_0x7588('0x42')]);return db[_0x7588('0x2b')][_0x7588('0x43')](_0x1f8676)['then'](handleEntityNotFound(_0x486fd9,null))[_0x7588('0x24')](respondWithResult(_0x486fd9,null))[_0x7588('0x44')](handleError(_0x486fd9,null));};exports[_0x7588('0x45')]=function(_0x4cb7b8,_0x4c99ae){return db[_0x7588('0x2b')][_0x7588('0x45')](_0x4cb7b8[_0x7588('0x46')],{})[_0x7588('0x24')](respondWithResult(_0x4c99ae,0xc9))['catch'](handleError(_0x4c99ae,null));};exports[_0x7588('0x23')]=function(_0x2808d4,_0x56b6da){if(_0x2808d4[_0x7588('0x46')]['id']){delete _0x2808d4['body']['id'];}return db['FreshdeskField'][_0x7588('0x43')]({'where':{'id':_0x2808d4[_0x7588('0x47')]['id']}})[_0x7588('0x24')](handleEntityNotFound(_0x56b6da,null))[_0x7588('0x24')](saveUpdates(_0x2808d4['body'],null))['then'](respondWithResult(_0x56b6da,null))[_0x7588('0x44')](handleError(_0x56b6da,null));};exports[_0x7588('0x25')]=function(_0x2dc1fb,_0x4c6ae5){return db[_0x7588('0x2b')][_0x7588('0x43')]({'where':{'id':_0x2dc1fb[_0x7588('0x47')]['id']}})[_0x7588('0x24')](handleEntityNotFound(_0x4c6ae5,null))['then'](removeEntity(_0x4c6ae5,null))[_0x7588('0x44')](handleError(_0x4c6ae5,null));}; \ No newline at end of file +var _0x0795=['save','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x488928,_0x3f3809){var _0x3e8793=function(_0xe9949d){while(--_0xe9949d){_0x488928['push'](_0x488928['shift']());}};_0x3e8793(++_0x3f3809);}(_0x0795,0x14e));var _0x5079=function(_0x1b279b,_0x5262dc){_0x1b279b=_0x1b279b-0x0;var _0x5c6044=_0x0795[_0x1b279b];return _0x5c6044;};'use strict';var pdf=require(_0x5079('0x0'));var emlformat=require(_0x5079('0x1'));var rimraf=require(_0x5079('0x2'));var zipdir=require(_0x5079('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5079('0x4'));var moment=require('moment');var BPromise=require(_0x5079('0x5'));var Mustache=require(_0x5079('0x6'));var util=require(_0x5079('0x7'));var path=require(_0x5079('0x8'));var sox=require('sox');var csv=require(_0x5079('0x9'));var ejs=require(_0x5079('0xa'));var fs=require('fs');var _=require(_0x5079('0xb'));var squel=require(_0x5079('0xc'));var crypto=require(_0x5079('0xd'));var jsforce=require(_0x5079('0xe'));var deskjs=require(_0x5079('0xf'));var toCsv=require(_0x5079('0x9'));var querystring=require(_0x5079('0x10'));var Papa=require(_0x5079('0x11'));var Redis=require('ioredis');var authService=require(_0x5079('0x12'));var qs=require(_0x5079('0x13'));var hardwareService=require(_0x5079('0x14'));var logger=require(_0x5079('0x15'))(_0x5079('0x16'));var utils=require(_0x5079('0x17'));var config=require(_0x5079('0x18'));var db=require(_0x5079('0x19'))['db'];function respondWithStatusCode(_0x3a3910,_0x100d75){_0x100d75=_0x100d75||0xcc;return function(_0x1b51b0){if(_0x1b51b0){return _0x3a3910[_0x5079('0x1a')](_0x100d75);}return _0x3a3910[_0x5079('0x1b')](_0x100d75)[_0x5079('0x1c')]();};}function respondWithResult(_0x42c9ef,_0x36f5e2){_0x36f5e2=_0x36f5e2||0xc8;return function(_0x1deec5){if(_0x1deec5){return _0x42c9ef[_0x5079('0x1b')](_0x36f5e2)[_0x5079('0x1d')](_0x1deec5);}};}function respondWithFilteredResult(_0x423220,_0x42e65c){return function(_0x16efab){if(_0x16efab){var _0x4fcf47=_0x16efab[_0x5079('0x1e')],_0xca957d=_0x42e65c[_0x5079('0x1f')],_0x192157=_0x42e65c[_0x5079('0x1f')]+_0x42e65c[_0x5079('0x20')],_0x338442;if(_0x192157>=_0x4fcf47){_0x192157=_0x4fcf47;_0x338442=0xc8;}else{_0x338442=0xce;}_0x423220[_0x5079('0x1b')](_0x338442);return _0x423220['set'](_0x5079('0x21'),_0xca957d+'-'+_0x192157+'/'+_0x4fcf47)['json'](_0x16efab);}return null;};}function patchUpdates(_0x37025a){return function(_0x4c6fff){try{jsonpatch[_0x5079('0x22')](_0x4c6fff,_0x37025a,!![]);}catch(_0x28f413){return BPromise[_0x5079('0x23')](_0x28f413);}return _0x4c6fff[_0x5079('0x24')]();};}function saveUpdates(_0x5c3ccd,_0x3c2267){return function(_0xf9fb4){if(_0xf9fb4){return _0xf9fb4[_0x5079('0x25')](_0x5c3ccd)[_0x5079('0x26')](function(_0x2e1421){return _0x2e1421;});}return null;};}function removeEntity(_0x594d5f,_0x43e12f){return function(_0x34d065){if(_0x34d065){return _0x34d065[_0x5079('0x27')]()[_0x5079('0x26')](function(){_0x594d5f[_0x5079('0x1b')](0xcc)[_0x5079('0x1c')]();});}};}function handleEntityNotFound(_0x1b15f0,_0x5d2d4c){return function(_0x4d0911){if(!_0x4d0911){_0x1b15f0[_0x5079('0x1a')](0x194);}return _0x4d0911;};}function handleError(_0x11fae6,_0x328b0a){_0x328b0a=_0x328b0a||0x1f4;return function(_0x218363){logger[_0x5079('0x28')](_0x218363[_0x5079('0x29')]);if(_0x218363[_0x5079('0x2a')]){delete _0x218363[_0x5079('0x2a')];}_0x11fae6[_0x5079('0x1b')](_0x328b0a)[_0x5079('0x2b')](_0x218363);};}exports[_0x5079('0x2c')]=function(_0x2573d7,_0x595373){var _0x58777a={},_0x3c73d9={},_0x2a5239={'count':0x0,'rows':[]};var _0x1c3dfc=db[_0x5079('0x2d')][_0x5079('0x2e')];_0x3c73d9[_0x5079('0x2f')]=_[_0x5079('0x30')](_0x1c3dfc);_0x3c73d9[_0x5079('0x31')]=_['keys'](_0x2573d7[_0x5079('0x31')]);_0x3c73d9[_0x5079('0x32')]=_['intersection'](_0x3c73d9['model'],_0x3c73d9[_0x5079('0x31')]);_0x58777a[_0x5079('0x33')]=_[_0x5079('0x34')](_0x3c73d9[_0x5079('0x2f')],qs[_0x5079('0x35')](_0x2573d7[_0x5079('0x31')][_0x5079('0x35')]));_0x58777a[_0x5079('0x33')]=_0x58777a[_0x5079('0x33')]['length']?_0x58777a[_0x5079('0x33')]:_0x3c73d9['model'];if(!_0x2573d7['query'][_0x5079('0x36')](_0x5079('0x37'))){_0x58777a[_0x5079('0x20')]=qs[_0x5079('0x20')](_0x2573d7[_0x5079('0x31')][_0x5079('0x20')]);_0x58777a[_0x5079('0x1f')]=qs['offset'](_0x2573d7['query'][_0x5079('0x1f')]);}_0x58777a['order']=qs['sort'](_0x2573d7[_0x5079('0x31')][_0x5079('0x38')]);_0x58777a[_0x5079('0x39')]=qs['filters'](_[_0x5079('0x3a')](_0x2573d7[_0x5079('0x31')],_0x3c73d9['filters']));if(_0x2573d7['query'][_0x5079('0x3b')]){_0x58777a[_0x5079('0x39')]=_[_0x5079('0x3c')](_0x58777a[_0x5079('0x39')],{'$or':_[_0x5079('0x3d')](_0x1c3dfc,function(_0x4b81c8){if(_0x4b81c8[_0x5079('0x3e')]['key']!==_0x5079('0x3f')){var _0x1e20de={};_0x1e20de[_0x4b81c8['field']]={'$like':'%'+_0x2573d7[_0x5079('0x31')][_0x5079('0x3b')]+'%'};return _0x1e20de;}})});}_0x58777a=_[_0x5079('0x3c')]({},_0x58777a,_0x2573d7['options']);var _0x5af5aa={'where':_0x58777a[_0x5079('0x39')]};return db[_0x5079('0x2d')]['count'](_0x5af5aa)[_0x5079('0x26')](function(_0x2dbd89){_0x2a5239[_0x5079('0x1e')]=_0x2dbd89;if(_0x2573d7[_0x5079('0x31')]['includeAll']){_0x58777a['include']=[{'all':!![]}];}return db[_0x5079('0x2d')][_0x5079('0x40')](_0x58777a);})[_0x5079('0x26')](function(_0x1d471a){_0x2a5239['rows']=_0x1d471a;return _0x2a5239;})[_0x5079('0x26')](respondWithFilteredResult(_0x595373,_0x58777a))[_0x5079('0x41')](handleError(_0x595373,null));};exports[_0x5079('0x42')]=function(_0x1ed0e5,_0x39a584){var _0x72ba87={'raw':!![],'where':{'id':_0x1ed0e5[_0x5079('0x43')]['id']}},_0x22fa9a={};_0x22fa9a[_0x5079('0x2f')]=_['keys'](db[_0x5079('0x2d')]['rawAttributes']);_0x22fa9a[_0x5079('0x31')]=_['keys'](_0x1ed0e5[_0x5079('0x31')]);_0x22fa9a[_0x5079('0x32')]=_[_0x5079('0x34')](_0x22fa9a[_0x5079('0x2f')],_0x22fa9a[_0x5079('0x31')]);_0x72ba87[_0x5079('0x33')]=_['intersection'](_0x22fa9a[_0x5079('0x2f')],qs[_0x5079('0x35')](_0x1ed0e5[_0x5079('0x31')][_0x5079('0x35')]));_0x72ba87[_0x5079('0x33')]=_0x72ba87[_0x5079('0x33')]['length']?_0x72ba87['attributes']:_0x22fa9a['model'];if(_0x1ed0e5['query'][_0x5079('0x44')]){_0x72ba87[_0x5079('0x45')]=[{'all':!![]}];}_0x72ba87=_[_0x5079('0x3c')]({},_0x72ba87,_0x1ed0e5[_0x5079('0x46')]);return db[_0x5079('0x2d')][_0x5079('0x47')](_0x72ba87)[_0x5079('0x26')](handleEntityNotFound(_0x39a584,null))['then'](respondWithResult(_0x39a584,null))[_0x5079('0x41')](handleError(_0x39a584,null));};exports[_0x5079('0x48')]=function(_0x193532,_0x5a4363){return db[_0x5079('0x2d')][_0x5079('0x48')](_0x193532['body'],{})[_0x5079('0x26')](respondWithResult(_0x5a4363,0xc9))[_0x5079('0x41')](handleError(_0x5a4363,null));};exports[_0x5079('0x25')]=function(_0x53bb90,_0x4259ab){if(_0x53bb90['body']['id']){delete _0x53bb90[_0x5079('0x49')]['id'];}return db[_0x5079('0x2d')][_0x5079('0x47')]({'where':{'id':_0x53bb90['params']['id']}})[_0x5079('0x26')](handleEntityNotFound(_0x4259ab,null))['then'](saveUpdates(_0x53bb90['body'],null))['then'](respondWithResult(_0x4259ab,null))['catch'](handleError(_0x4259ab,null));};exports[_0x5079('0x27')]=function(_0x2e023b,_0x4f37d7){return db['FreshdeskField'][_0x5079('0x47')]({'where':{'id':_0x2e023b[_0x5079('0x43')]['id']}})[_0x5079('0x26')](handleEntityNotFound(_0x4f37d7,null))[_0x5079('0x26')](removeEntity(_0x4f37d7,null))['catch'](handleError(_0x4f37d7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4439876..284f870 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 _0xc058=['./intFreshdeskField.attributes','exports','define','FreshdeskField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1eed8e,_0xe05364){var _0x564f41=function(_0x394a61){while(--_0x394a61){_0x1eed8e['push'](_0x1eed8e['shift']());}};_0x564f41(++_0xe05364);}(_0xc058,0x1c6));var _0x8c05=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc058[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x8c05('0x0'));var util=require(_0x8c05('0x1'));var logger=require(_0x8c05('0x2'))(_0x8c05('0x3'));var moment=require('moment');var BPromise=require(_0x8c05('0x4'));var rp=require(_0x8c05('0x5'));var fs=require('fs');var path=require(_0x8c05('0x6'));var rimraf=require(_0x8c05('0x7'));var config=require('../../config/environment');var attributes=require(_0x8c05('0x8'));module[_0x8c05('0x9')]=function(_0x38a0c2,_0x1639f6){return _0x38a0c2[_0x8c05('0xa')](_0x8c05('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x8c05('0xc'),_0x8c05('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56ff=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','idField','FieldId','lodash','api','bluebird','request-promise'];(function(_0x47ec81,_0x1965e9){var _0x10d4c9=function(_0x10a336){while(--_0x10a336){_0x47ec81['push'](_0x47ec81['shift']());}};_0x10d4c9(++_0x1965e9);}(_0x56ff,0x68));var _0xf56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56ff[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf56f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf56f('0x1'));var moment=require('moment');var BPromise=require(_0xf56f('0x2'));var rp=require(_0xf56f('0x3'));var fs=require('fs');var path=require(_0xf56f('0x4'));var rimraf=require(_0xf56f('0x5'));var config=require(_0xf56f('0x6'));var attributes=require(_0xf56f('0x7'));module[_0xf56f('0x8')]=function(_0x4626bd,_0x4aad98){return _0x4626bd[_0xf56f('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xf56f('0xa'),_0xf56f('0xb')],'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 de5c66a..3b6778b 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 _0x19ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x96a5a5,_0x556806){var _0xdbab27=function(_0x337177){while(--_0x337177){_0x96a5a5['push'](_0x96a5a5['shift']());}};_0xdbab27(++_0x556806);}(_0x19ea,0xfe));var _0xa19e=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x19ea[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});} \ No newline at end of file +var _0x2494=['../../config/utils','../../config/environment','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2e293a,_0x51144e){var _0x3fd387=function(_0x4b63f4){while(--_0x4b63f4){_0x2e293a['push'](_0x2e293a['shift']());}};_0x3fd387(++_0x51144e);}(_0x2494,0x82));var _0x4249=function(_0x29de0c,_0x10c838){_0x29de0c=_0x29de0c-0x0;var _0x51ba91=_0x2494[_0x29de0c];return _0x51ba91;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 23ccc67..09d7f11 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 _0x8143=['../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x8143,0x1f4));var _0x3814=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8143[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x3814('0x0'));var util=require(_0x3814('0x1'));var path=require('path');var timeout=require(_0x3814('0x2'));var express=require(_0x3814('0x3'));var router=express[_0x3814('0x4')]();var auth=require(_0x3814('0x5'));var interaction=require(_0x3814('0x6'));var config=require(_0x3814('0x7'));var controller=require(_0x3814('0x8'));router[_0x3814('0x9')]('/',auth[_0x3814('0xa')](),controller['index']);router[_0x3814('0x9')]('/:id',auth[_0x3814('0xa')](),controller[_0x3814('0xb')]);router[_0x3814('0x9')]('/:id/configurations',auth[_0x3814('0xa')](),controller[_0x3814('0xc')]);router['get']('/:id/fields',auth[_0x3814('0xa')](),controller[_0x3814('0xd')]);router['post']('/',auth[_0x3814('0xa')](),controller[_0x3814('0xe')]);router[_0x3814('0xf')](_0x3814('0x10'),auth[_0x3814('0xa')](),controller[_0x3814('0x11')]);router['put'](_0x3814('0x12'),auth[_0x3814('0xa')](),controller[_0x3814('0x13')]);router[_0x3814('0x14')](_0x3814('0x12'),auth[_0x3814('0xa')](),controller['destroy']);module[_0x3814('0x15')]=router; \ No newline at end of file +var _0x5829=['destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x5829,0xf4));var _0x9582=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x5829[_0x2261ce];return _0x524640;};'use strict';var multer=require(_0x9582('0x0'));var util=require(_0x9582('0x1'));var path=require(_0x9582('0x2'));var timeout=require('connect-timeout');var express=require(_0x9582('0x3'));var router=express['Router']();var auth=require(_0x9582('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9582('0x5'));var controller=require(_0x9582('0x6'));router[_0x9582('0x7')]('/',auth[_0x9582('0x8')](),controller[_0x9582('0x9')]);router[_0x9582('0x7')](_0x9582('0xa'),auth[_0x9582('0x8')](),controller[_0x9582('0xb')]);router[_0x9582('0x7')](_0x9582('0xc'),auth['isAuthenticated'](),controller[_0x9582('0xd')]);router['get'](_0x9582('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x9582('0xf')]('/',auth['isAuthenticated'](),controller[_0x9582('0x10')]);router[_0x9582('0xf')](_0x9582('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9582('0x11')](_0x9582('0xa'),auth[_0x9582('0x8')](),controller[_0x9582('0x12')]);router[_0x9582('0x13')](_0x9582('0xa'),auth[_0x9582('0x8')](),controller[_0x9582('0x14')]);module[_0x9582('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ee18a6c..43ef0bd 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 _0xa63e=['username','integrationTab','newTab','exports','STRING'];(function(_0x5af84b,_0x9ee7d9){var _0x4845dd=function(_0x589c1f){while(--_0x589c1f){_0x5af84b['push'](_0x5af84b['shift']());}};_0x4845dd(++_0x9ee7d9);}(_0xa63e,0xda));var _0xea63=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa63e[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xea63('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xea63('0x1')]},'username':{'type':Sequelize[_0xea63('0x1')],'unique':_0xea63('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xea63('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xea63('0x1')]},'securityToken':{'type':Sequelize[_0xea63('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xea63('0x3'),_0xea63('0x4')),'defaultValue':_0xea63('0x3')}}; \ No newline at end of file +var _0x0a98=['integrationTab','newTab','sequelize','STRING','username'];(function(_0x5e2104,_0x12f596){var _0x473067=function(_0x3e8a53){while(--_0x3e8a53){_0x5e2104['push'](_0x5e2104['shift']());}};_0x473067(++_0x12f596);}(_0x0a98,0x70));var _0x80a9=function(_0x4143d1,_0x500093){_0x4143d1=_0x4143d1-0x0;var _0x165cfb=_0x0a98[_0x4143d1];return _0x165cfb;};'use strict';var Sequelize=require(_0x80a9('0x0'));module['exports']={'name':{'type':Sequelize[_0x80a9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x80a9('0x1')],'unique':_0x80a9('0x2')},'remoteUri':{'type':Sequelize[_0x80a9('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x80a9('0x1')]},'clientSecret':{'type':Sequelize[_0x80a9('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x80a9('0x3'),_0x80a9('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index fe7e356..7fb0557 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 _0x4986=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','Content-Range','update','sendStatus','stack','name','index','SalesforceAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','includeAll','findAll','show','params','length','include','options','find','create','body','destroy','findOne','SalesforceConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','Priority','Status','Type','Case','Reason','IsEscalated','SuppliedCompany','remove','custom','includes','label','picklistValues','value','boolean','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http'];(function(_0x13393c,_0x5c5ca0){var _0x2ecbe7=function(_0x3d6d7c){while(--_0x3d6d7c){_0x13393c['push'](_0x13393c['shift']());}};_0x2ecbe7(++_0x5c5ca0);}(_0x4986,0x6e));var _0x6498=function(_0xfdbdd5,_0x3d9191){_0xfdbdd5=_0xfdbdd5-0x0;var _0xab1705=_0x4986[_0xfdbdd5];return _0xab1705;};'use strict';var pdf=require(_0x6498('0x0'));var emlformat=require(_0x6498('0x1'));var rimraf=require(_0x6498('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6498('0x3'));var moment=require(_0x6498('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6498('0x5'));var util=require(_0x6498('0x6'));var path=require(_0x6498('0x7'));var sox=require(_0x6498('0x8'));var csv=require(_0x6498('0x9'));var ejs=require(_0x6498('0xa'));var fs=require('fs');var _=require(_0x6498('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x9'));var querystring=require(_0x6498('0xe'));var Papa=require(_0x6498('0xf'));var Redis=require('ioredis');var authService=require(_0x6498('0x10'));var qs=require(_0x6498('0x11'));var hardwareService=require(_0x6498('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6498('0x13'));var config=require('../../config/environment');var db=require(_0x6498('0x14'))['db'];var integrations=require(_0x6498('0x15'));var jayson=require(_0x6498('0x16'));var client=jayson[_0x6498('0x17')][_0x6498('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3771b1,_0x45b86e,_0x4eaf5d){if(_0x4eaf5d){var _0x5e1e56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e1e56[_0x6498('0x19')](_0x45b86e)){return _0x3771b1;}else{throw new Error(_0x6498('0x1a'));}}else{return _0x3771b1;}}function respondWithRpcPromise(_0x3ae8e5,_0x3a076f,_0x1d49ef,_0x59833d){return new BPromise(function(_0x318b75,_0x2ab98d){var _0x172b0e=_0x59833d||client;return _0x172b0e[_0x6498('0x1b')](_0x3ae8e5,_0x1d49ef)[_0x6498('0x1c')](function(_0x1b4083){logger[_0x6498('0x1d')]('SalesforceAccount,\x20%s,\x20%s',_0x3a076f,_0x6498('0x1e'));logger[_0x6498('0x1f')](_0x6498('0x20'),_0x3a076f,_0x6498('0x1e'),JSON[_0x6498('0x21')](_0x1b4083));if(_0x1b4083['error']){if(_0x1b4083['error'][_0x6498('0x22')]===0x1f4){logger[_0x6498('0x23')](_0x6498('0x24'),_0x3a076f,_0x1b4083[_0x6498('0x23')][_0x6498('0x25')]);return _0x2ab98d(_0x1b4083[_0x6498('0x23')][_0x6498('0x25')]);}logger[_0x6498('0x23')](_0x6498('0x24'),_0x3a076f,_0x1b4083[_0x6498('0x23')][_0x6498('0x25')]);return _0x318b75(_0x1b4083[_0x6498('0x23')][_0x6498('0x25')]);}else{logger[_0x6498('0x1d')]('SalesforceAccount,\x20%s,\x20%s',_0x3a076f,'request\x20sent');_0x318b75(_0x1b4083[_0x6498('0x26')]['message']);}})[_0x6498('0x27')](function(_0x30d261){logger[_0x6498('0x23')](_0x6498('0x24'),_0x3a076f,_0x30d261);_0x2ab98d(_0x30d261);});});}function respondWithStatusCode(_0x4dcead,_0x5b6007){_0x5b6007=_0x5b6007||0xcc;return function(_0x43b1d2){if(_0x43b1d2){return _0x4dcead['sendStatus'](_0x5b6007);}return _0x4dcead[_0x6498('0x28')](_0x5b6007)[_0x6498('0x29')]();};}function respondWithResult(_0x41d43f,_0x271048){_0x271048=_0x271048||0xc8;return function(_0x1ce28d){if(_0x1ce28d){return _0x41d43f[_0x6498('0x28')](_0x271048)[_0x6498('0x2a')](_0x1ce28d);}};}function respondWithFilteredResult(_0x26f01f,_0x119790){return function(_0x2213a4){if(_0x2213a4){var _0x660782=_0x2213a4[_0x6498('0x2b')],_0x3c80da=_0x119790[_0x6498('0x2c')],_0x64df19=_0x119790['offset']+_0x119790['limit'],_0x4be06f;if(_0x64df19>=_0x660782){_0x64df19=_0x660782;_0x4be06f=0xc8;}else{_0x4be06f=0xce;}_0x26f01f['status'](_0x4be06f);return _0x26f01f['set'](_0x6498('0x2d'),_0x3c80da+'-'+_0x64df19+'/'+_0x660782)[_0x6498('0x2a')](_0x2213a4);}return null;};}function patchUpdates(_0xd17dab){return function(_0x2696f9){try{jsonpatch['apply'](_0x2696f9,_0xd17dab,!![]);}catch(_0x46b361){return BPromise['reject'](_0x46b361);}return _0x2696f9['save']();};}function saveUpdates(_0x49c4fd,_0x565975){return function(_0x28bac3){if(_0x28bac3){return _0x28bac3[_0x6498('0x2e')](_0x49c4fd)['then'](function(_0x40618c){return _0x40618c;});}return null;};}function removeEntity(_0x541271,_0x420bb3){return function(_0x23c651){if(_0x23c651){return _0x23c651['destroy']()['then'](function(){_0x541271[_0x6498('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x327a42,_0x12fdb6){return function(_0x5d3de5){if(!_0x5d3de5){_0x327a42[_0x6498('0x2f')](0x194);}return _0x5d3de5;};}function handleError(_0x52ef6c,_0xd0b96d){_0xd0b96d=_0xd0b96d||0x1f4;return function(_0x340827){logger[_0x6498('0x23')](_0x340827[_0x6498('0x30')]);if(_0x340827[_0x6498('0x31')]){delete _0x340827[_0x6498('0x31')];}_0x52ef6c[_0x6498('0x28')](_0xd0b96d)['send'](_0x340827);};}exports[_0x6498('0x32')]=function(_0x5b340e,_0x2548b8){var _0x5b5089={},_0x12c2c4={},_0x50179d={'count':0x0,'rows':[]};var _0x2411ee=db[_0x6498('0x33')][_0x6498('0x34')];_0x12c2c4[_0x6498('0x35')]=_[_0x6498('0x36')](_0x2411ee);_0x12c2c4[_0x6498('0x37')]=_[_0x6498('0x36')](_0x5b340e['query']);_0x12c2c4[_0x6498('0x38')]=_[_0x6498('0x39')](_0x12c2c4[_0x6498('0x35')],_0x12c2c4[_0x6498('0x37')]);_0x5b5089[_0x6498('0x3a')]=_[_0x6498('0x39')](_0x12c2c4[_0x6498('0x35')],qs[_0x6498('0x3b')](_0x5b340e['query'][_0x6498('0x3b')]));_0x5b5089[_0x6498('0x3a')]=_0x5b5089[_0x6498('0x3a')]['length']?_0x5b5089[_0x6498('0x3a')]:_0x12c2c4[_0x6498('0x35')];if(!_0x5b340e[_0x6498('0x37')][_0x6498('0x3c')](_0x6498('0x3d'))){_0x5b5089[_0x6498('0x3e')]=qs[_0x6498('0x3e')](_0x5b340e[_0x6498('0x37')][_0x6498('0x3e')]);_0x5b5089[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0x5b340e[_0x6498('0x37')]['offset']);}_0x5b5089['order']=qs['sort'](_0x5b340e[_0x6498('0x37')][_0x6498('0x3f')]);_0x5b5089[_0x6498('0x40')]=qs[_0x6498('0x38')](_[_0x6498('0x41')](_0x5b340e[_0x6498('0x37')],_0x12c2c4[_0x6498('0x38')]));if(_0x5b340e['query'][_0x6498('0x42')]){_0x5b5089[_0x6498('0x40')]=_[_0x6498('0x43')](_0x5b5089[_0x6498('0x40')],{'$or':_[_0x6498('0x44')](_0x2411ee,function(_0x3bc9ca){if(_0x3bc9ca['type'][_0x6498('0x45')]!==_0x6498('0x46')){var _0x482be7={};_0x482be7[_0x3bc9ca['field']]={'$like':'%'+_0x5b340e[_0x6498('0x37')][_0x6498('0x42')]+'%'};return _0x482be7;}})});}_0x5b5089=_[_0x6498('0x43')]({},_0x5b5089,_0x5b340e['options']);var _0x4fb005={'where':_0x5b5089[_0x6498('0x40')]};return db['SalesforceAccount'][_0x6498('0x2b')](_0x4fb005)[_0x6498('0x1c')](function(_0x34e5b2){_0x50179d[_0x6498('0x2b')]=_0x34e5b2;if(_0x5b340e[_0x6498('0x37')][_0x6498('0x47')]){_0x5b5089['include']=[{'all':!![]}];}return db[_0x6498('0x33')][_0x6498('0x48')](_0x5b5089);})[_0x6498('0x1c')](function(_0x3d2d1f){_0x50179d['rows']=_0x3d2d1f;return _0x50179d;})[_0x6498('0x1c')](respondWithFilteredResult(_0x2548b8,_0x5b5089))[_0x6498('0x27')](handleError(_0x2548b8,null));};exports[_0x6498('0x49')]=function(_0x1a1fe2,_0x172076){var _0x1a498c={'raw':![],'where':{'id':_0x1a1fe2[_0x6498('0x4a')]['id']}},_0x74668c={};_0x74668c['model']=_[_0x6498('0x36')](db[_0x6498('0x33')][_0x6498('0x34')]);_0x74668c[_0x6498('0x37')]=_[_0x6498('0x36')](_0x1a1fe2[_0x6498('0x37')]);_0x74668c[_0x6498('0x38')]=_[_0x6498('0x39')](_0x74668c[_0x6498('0x35')],_0x74668c[_0x6498('0x37')]);_0x1a498c[_0x6498('0x3a')]=_[_0x6498('0x39')](_0x74668c[_0x6498('0x35')],qs[_0x6498('0x3b')](_0x1a1fe2[_0x6498('0x37')][_0x6498('0x3b')]));_0x1a498c[_0x6498('0x3a')]=_0x1a498c[_0x6498('0x3a')][_0x6498('0x4b')]?_0x1a498c[_0x6498('0x3a')]:_0x74668c[_0x6498('0x35')];if(_0x1a1fe2['query'][_0x6498('0x47')]){_0x1a498c[_0x6498('0x4c')]=[{'all':!![]}];}_0x1a498c=_[_0x6498('0x43')]({},_0x1a498c,_0x1a1fe2[_0x6498('0x4d')]);return db[_0x6498('0x33')][_0x6498('0x4e')](_0x1a498c)['then'](handleEntityNotFound(_0x172076,null))['then'](respondWithResult(_0x172076,null))[_0x6498('0x27')](handleError(_0x172076,null));};exports['create']=function(_0x458815,_0x14355b){return db[_0x6498('0x33')][_0x6498('0x4f')](_0x458815[_0x6498('0x50')],{})['then'](respondWithResult(_0x14355b,0xc9))[_0x6498('0x27')](handleError(_0x14355b,null));};exports[_0x6498('0x2e')]=function(_0x3ed025,_0x1bf245){if(_0x3ed025['body']['id']){delete _0x3ed025['body']['id'];}return db[_0x6498('0x33')]['find']({'where':{'id':_0x3ed025[_0x6498('0x4a')]['id']}})[_0x6498('0x1c')](handleEntityNotFound(_0x1bf245,null))[_0x6498('0x1c')](saveUpdates(_0x3ed025[_0x6498('0x50')],null))[_0x6498('0x1c')](respondWithResult(_0x1bf245,null))[_0x6498('0x27')](handleError(_0x1bf245,null));};exports[_0x6498('0x51')]=function(_0x11e978,_0x4dea24){return db[_0x6498('0x33')][_0x6498('0x4e')]({'where':{'id':_0x11e978[_0x6498('0x4a')]['id']}})[_0x6498('0x1c')](handleEntityNotFound(_0x4dea24,null))['then'](removeEntity(_0x4dea24,null))[_0x6498('0x27')](handleError(_0x4dea24,null));};exports['getConfigurations']=function(_0xb624b6,_0x4af617,_0x463127){var _0x1cd0d4={};var _0x4de80c={};var _0x4b75b0;var _0x49e066;return db[_0x6498('0x33')][_0x6498('0x52')]({'where':{'id':_0xb624b6['params']['id']}})[_0x6498('0x1c')](handleEntityNotFound(_0x4af617,null))[_0x6498('0x1c')](function(_0x5d5c8c){if(_0x5d5c8c){_0x4b75b0=_0x5d5c8c;_0x4de80c['model']=_[_0x6498('0x36')](db[_0x6498('0x53')][_0x6498('0x34')]);_0x4de80c[_0x6498('0x37')]=_[_0x6498('0x36')](_0xb624b6[_0x6498('0x37')]);_0x4de80c[_0x6498('0x38')]=_[_0x6498('0x39')](_0x4de80c[_0x6498('0x35')],_0x4de80c['query']);_0x1cd0d4['attributes']=_[_0x6498('0x39')](_0x4de80c[_0x6498('0x35')],qs['fields'](_0xb624b6[_0x6498('0x37')][_0x6498('0x3b')]));_0x1cd0d4[_0x6498('0x3a')]=_0x1cd0d4[_0x6498('0x3a')][_0x6498('0x4b')]?_0x1cd0d4[_0x6498('0x3a')]:_0x4de80c['model'];_0x1cd0d4['order']=qs['sort'](_0xb624b6[_0x6498('0x37')][_0x6498('0x3f')]);_0x1cd0d4['where']=qs[_0x6498('0x38')](_[_0x6498('0x41')](_0xb624b6[_0x6498('0x37')],_0x4de80c[_0x6498('0x38')]));if(_0xb624b6[_0x6498('0x37')][_0x6498('0x42')]){_0x1cd0d4[_0x6498('0x40')]=_[_0x6498('0x43')](_0x1cd0d4[_0x6498('0x40')],{'$or':_[_0x6498('0x44')](_0x1cd0d4['attributes'],function(_0x4496f0){var _0x2e8ed8={};_0x2e8ed8[_0x4496f0]={'$like':'%'+_0xb624b6['query']['filter']+'%'};return _0x2e8ed8;})});}_0x1cd0d4=_['merge']({},_0x1cd0d4,_0xb624b6['options']);return _0x4b75b0[_0x6498('0x54')](_0x1cd0d4);}})[_0x6498('0x1c')](function(_0x43296a){if(_0x43296a){_0x49e066=_0x43296a[_0x6498('0x4b')];if(!_0xb624b6['query'][_0x6498('0x3c')]('nolimit')){_0x1cd0d4[_0x6498('0x3e')]=qs[_0x6498('0x3e')](_0xb624b6[_0x6498('0x37')][_0x6498('0x3e')]);_0x1cd0d4[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0xb624b6[_0x6498('0x37')][_0x6498('0x2c')]);}return _0x4b75b0[_0x6498('0x54')](_0x1cd0d4);}})[_0x6498('0x1c')](function(_0x562263){if(_0x562263){return _0x562263?{'count':_0x49e066,'rows':_0x562263}:null;}})[_0x6498('0x1c')](respondWithResult(_0x4af617,null))[_0x6498('0x27')](handleError(_0x4af617,null));};exports['addConfiguration']=function(_0x4d6b2d,_0x521896,_0x25f50a){if(_0x4d6b2d[_0x6498('0x50')]['id']){delete _0x4d6b2d['body']['id'];}return db['SalesforceAccount'][_0x6498('0x52')]({'where':{'id':_0x4d6b2d[_0x6498('0x4a')]['id']}})[_0x6498('0x1c')](handleEntityNotFound(_0x521896,null))['then'](function(_0xb13dd0){if(_0xb13dd0){_0x4d6b2d[_0x6498('0x50')][_0x6498('0x55')]=_0xb13dd0['id'];_0x4d6b2d[_0x6498('0x50')][_0x6498('0x56')]=integrations[_0x6498('0x57')](_0x4d6b2d[_0x6498('0x50')][_0x6498('0x58')],_0x4d6b2d['body'][_0x6498('0x59')]);_0x4d6b2d[_0x6498('0x50')][_0x6498('0x5a')]=integrations[_0x6498('0x5b')](_0x4d6b2d['body'][_0x6498('0x58')],_0x4d6b2d[_0x6498('0x50')][_0x6498('0x59')]);return db['SalesforceConfiguration'][_0x6498('0x4f')](_0x4d6b2d[_0x6498('0x50')],{'include':[{'model':db[_0x6498('0x5c')],'as':_0x6498('0x56')},{'model':db[_0x6498('0x5c')],'as':_0x6498('0x5a')}]});}return null;})['then'](respondWithResult(_0x521896,null))[_0x6498('0x27')](handleError(_0x521896,null));};exports[_0x6498('0x5d')]=function(_0x1fc595,_0x5319d5,_0x154b28){var _0x154d27;var _0x4834fa='';var _0x27728e=_0x6498('0x5e');return db[_0x6498('0x33')][_0x6498('0x52')]({'where':{'id':_0x1fc595['params']['id']},'attributes':['id',_0x6498('0x5f'),_0x6498('0x60'),_0x6498('0x61'),_0x6498('0x62'),_0x6498('0x63'),_0x6498('0x64')]})[_0x6498('0x1c')](handleEntityNotFound(_0x5319d5,null))[_0x6498('0x1c')](function(_0x1f1bc7){if(_0x1f1bc7){_0x4834fa=_0x1f1bc7['remoteUri'];var _0x40f208=_0x4834fa[_0x6498('0x65')](-0x1);if(_0x40f208==='/'){_0x4834fa=_0x4834fa[_0x6498('0x66')](0x0,_0x4834fa[_0x6498('0x67')](_0x40f208));}_0x154d27=new jsforce[(_0x6498('0x68'))]({'oauth2':{'loginUrl':_0x4834fa,'clientId':_0x1f1bc7[_0x6498('0x60')],'clientSecret':_0x1f1bc7[_0x6498('0x61')]}});return _0x154d27[_0x6498('0x69')](_0x1f1bc7[_0x6498('0x62')],_0x1f1bc7[_0x6498('0x63')][_0x6498('0x6a')](_0x1f1bc7[_0x6498('0x64')]));}})[_0x6498('0x1c')](function(_0x410fff){if(_0x410fff){if(!_[_0x6498('0x6b')](_0x1fc595[_0x6498('0x37')][_0x6498('0x6c')])){_0x27728e=_0x1fc595[_0x6498('0x37')][_0x6498('0x6c')];}return _0x154d27[_0x6498('0x6d')](_0x27728e)[_0x6498('0x6e')]();}})[_0x6498('0x1c')](function(_0x3525e6){var _0x3a8880=[_0x6498('0x6f'),_0x6498('0x70'),_0x6498('0x71'),'CallType','IsArchived',_0x6498('0x72'),_0x6498('0x73'),_0x6498('0x74')];if(!_[_0x6498('0x6b')](_0x1fc595[_0x6498('0x37')][_0x6498('0x6c')])&&_0x1fc595[_0x6498('0x37')][_0x6498('0x6c')]===_0x6498('0x75')){_0x3a8880=[_0x6498('0x74'),'Origin',_0x6498('0x76'),_0x6498('0x73'),_0x6498('0x72'),_0x6498('0x77'),'SuppliedName',_0x6498('0x78')];}if(_0x3525e6){_[_0x6498('0x79')](_0x3525e6[_0x6498('0x3b')],function(_0x26a997){return _0x26a997[_0x6498('0x7a')]===![]&&!_0x3a8880[_0x6498('0x7b')](_0x26a997['name']);});return{'count':_0x3525e6['fields'][_0x6498('0x4b')],'rows':_[_0x6498('0x44')](_0x3525e6[_0x6498('0x3b')],function(_0x4f3aab){return{'id':_0x4f3aab[_0x6498('0x31')],'name':_0x4f3aab[_0x6498('0x7c')],'custom':_0x4f3aab[_0x6498('0x7a')],'options':_0x4f3aab[_0x6498('0x7d')]['length']>0x0?_['map'](_0x4f3aab[_0x6498('0x7d')],function(_0x15d672){return{'name':_0x15d672[_0x6498('0x7c')],'value':_0x15d672[_0x6498('0x7e')]};}):_0x4f3aab[_0x6498('0x59')]==_0x6498('0x7f')?[{'name':_0x6498('0x80'),'value':_0x6498('0x81')},{'name':'False','value':_0x6498('0x82')}]:[]};})};}})['then'](respondWithResult(_0x5319d5,null))[_0x6498('0x27')](function(_0x5043c7){var _0x56763f=_0x1fc595[_0x6498('0x37')]['test']?0x1f4:_0x5043c7[_0x6498('0x83')]||0x1f4;logger[_0x6498('0x23')](_0x6498('0x84'),_0x6498('0x5d'),_0x56763f,JSON[_0x6498('0x21')](_0x5043c7));delete _0x5043c7[_0x6498('0x31')];if(_0x56763f===0x191){_0x56763f=0x190;}_0x5319d5[_0x6498('0x28')](_0x56763f)[_0x6498('0x85')](_0x1fc595[_0x6498('0x37')][_0x6498('0x19')]?{'message':_0x6498('0x86'),'statusCode':_0x5043c7[_0x6498('0x83')]}:_0x5043c7);});}; \ No newline at end of file +var _0xb48d=['name','label','picklistValues','value','True','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','stringify','code','error','SalesforceAccount,\x20%s,\x20%s','message','info','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','stack','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','order','sort','where','pick','type','key','VIRTUAL','field','filter','merge','options','SalesforceAccount','includeAll','findAll','catch','show','length','find','create','body','params','findOne','map','getConfigurations','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','Type','Case','Origin','IsEscalated','SuppliedCompany','remove','custom','includes'];(function(_0x4c0ac9,_0x3a5646){var _0x1b08a1=function(_0xfb9190){while(--_0xfb9190){_0x4c0ac9['push'](_0x4c0ac9['shift']());}};_0x1b08a1(++_0x3a5646);}(_0xb48d,0x194));var _0xdb48=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb48d[_0x186376];return _0x2dbdd9;};'use strict';var pdf=require(_0xdb48('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdb48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb48('0x2'));var rp=require(_0xdb48('0x3'));var moment=require(_0xdb48('0x4'));var BPromise=require(_0xdb48('0x5'));var Mustache=require('mustache');var util=require(_0xdb48('0x6'));var path=require('path');var sox=require(_0xdb48('0x7'));var csv=require(_0xdb48('0x8'));var ejs=require(_0xdb48('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x8'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb48('0xf'))(_0xdb48('0x10'));var utils=require(_0xdb48('0x11'));var config=require('../../config/environment');var db=require(_0xdb48('0x12'))['db'];var integrations=require(_0xdb48('0x13'));var jayson=require('jayson/promise');var client=jayson[_0xdb48('0x14')][_0xdb48('0x15')]({'port':0x232a});function checkPasswordPattern(_0x41e006,_0x354eec,_0xd1fabe){if(_0xd1fabe){var _0x315da2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x315da2['test'](_0x354eec)){return _0x41e006;}else{throw new Error(_0xdb48('0x16'));}}else{return _0x41e006;}}function respondWithRpcPromise(_0x142eaf,_0x33c327,_0x4ae67f,_0x28412d){return new BPromise(function(_0x518dac,_0x453d6b){var _0x3180d7=_0x28412d||client;return _0x3180d7[_0xdb48('0x17')](_0x142eaf,_0x4ae67f)[_0xdb48('0x18')](function(_0x43c3ad){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x33c327,_0xdb48('0x19'));logger[_0xdb48('0x1a')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x33c327,_0xdb48('0x19'),JSON[_0xdb48('0x1b')](_0x43c3ad));if(_0x43c3ad['error']){if(_0x43c3ad['error'][_0xdb48('0x1c')]===0x1f4){logger[_0xdb48('0x1d')](_0xdb48('0x1e'),_0x33c327,_0x43c3ad['error'][_0xdb48('0x1f')]);return _0x453d6b(_0x43c3ad[_0xdb48('0x1d')]['message']);}logger[_0xdb48('0x1d')](_0xdb48('0x1e'),_0x33c327,_0x43c3ad[_0xdb48('0x1d')][_0xdb48('0x1f')]);return _0x518dac(_0x43c3ad[_0xdb48('0x1d')]['message']);}else{logger[_0xdb48('0x20')](_0xdb48('0x1e'),_0x33c327,_0xdb48('0x19'));_0x518dac(_0x43c3ad['result']['message']);}})['catch'](function(_0x3ad23a){logger[_0xdb48('0x1d')](_0xdb48('0x1e'),_0x33c327,_0x3ad23a);_0x453d6b(_0x3ad23a);});});}function respondWithStatusCode(_0x51eeb9,_0x10cbeb){_0x10cbeb=_0x10cbeb||0xcc;return function(_0x4d29d1){if(_0x4d29d1){return _0x51eeb9[_0xdb48('0x21')](_0x10cbeb);}return _0x51eeb9[_0xdb48('0x22')](_0x10cbeb)[_0xdb48('0x23')]();};}function respondWithResult(_0x531a2a,_0x483940){_0x483940=_0x483940||0xc8;return function(_0x139139){if(_0x139139){return _0x531a2a[_0xdb48('0x22')](_0x483940)[_0xdb48('0x24')](_0x139139);}};}function respondWithFilteredResult(_0x529ff4,_0x333db7){return function(_0x36e6f6){if(_0x36e6f6){var _0x4dce04=_0x36e6f6[_0xdb48('0x25')],_0x48f9dc=_0x333db7[_0xdb48('0x26')],_0x31edb6=_0x333db7['offset']+_0x333db7[_0xdb48('0x27')],_0x2cdfa4;if(_0x31edb6>=_0x4dce04){_0x31edb6=_0x4dce04;_0x2cdfa4=0xc8;}else{_0x2cdfa4=0xce;}_0x529ff4[_0xdb48('0x22')](_0x2cdfa4);return _0x529ff4[_0xdb48('0x28')]('Content-Range',_0x48f9dc+'-'+_0x31edb6+'/'+_0x4dce04)[_0xdb48('0x24')](_0x36e6f6);}return null;};}function patchUpdates(_0xb0afbd){return function(_0x9972c0){try{jsonpatch[_0xdb48('0x29')](_0x9972c0,_0xb0afbd,!![]);}catch(_0xbac8a){return BPromise[_0xdb48('0x2a')](_0xbac8a);}return _0x9972c0['save']();};}function saveUpdates(_0x3f0ad1,_0x1fd8a0){return function(_0x1a9385){if(_0x1a9385){return _0x1a9385[_0xdb48('0x2b')](_0x3f0ad1)[_0xdb48('0x18')](function(_0x387182){return _0x387182;});}return null;};}function removeEntity(_0x4855bc,_0x5e70c8){return function(_0x256e5f){if(_0x256e5f){return _0x256e5f[_0xdb48('0x2c')]()[_0xdb48('0x18')](function(){_0x4855bc[_0xdb48('0x22')](0xcc)[_0xdb48('0x23')]();});}};}function handleEntityNotFound(_0x25b074,_0xedf6a7){return function(_0x31340a){if(!_0x31340a){_0x25b074[_0xdb48('0x21')](0x194);}return _0x31340a;};}function handleError(_0x4ede67,_0x3a85ee){_0x3a85ee=_0x3a85ee||0x1f4;return function(_0x1ed447){logger[_0xdb48('0x1d')](_0x1ed447[_0xdb48('0x2d')]);if(_0x1ed447['name']){delete _0x1ed447['name'];}_0x4ede67[_0xdb48('0x22')](_0x3a85ee)[_0xdb48('0x2e')](_0x1ed447);};}exports[_0xdb48('0x2f')]=function(_0x2e2a7b,_0x3a4c8e){var _0x3c92a4={},_0x1b4680={},_0x291153={'count':0x0,'rows':[]};var _0x516199=db['SalesforceAccount'][_0xdb48('0x30')];_0x1b4680['model']=_[_0xdb48('0x31')](_0x516199);_0x1b4680[_0xdb48('0x32')]=_[_0xdb48('0x31')](_0x2e2a7b[_0xdb48('0x32')]);_0x1b4680[_0xdb48('0x33')]=_[_0xdb48('0x34')](_0x1b4680[_0xdb48('0x35')],_0x1b4680[_0xdb48('0x32')]);_0x3c92a4['attributes']=_[_0xdb48('0x34')](_0x1b4680[_0xdb48('0x35')],qs['fields'](_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x36')]));_0x3c92a4[_0xdb48('0x37')]=_0x3c92a4[_0xdb48('0x37')]['length']?_0x3c92a4['attributes']:_0x1b4680[_0xdb48('0x35')];if(!_0x2e2a7b[_0xdb48('0x32')]['hasOwnProperty']('nolimit')){_0x3c92a4[_0xdb48('0x27')]=qs[_0xdb48('0x27')](_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x27')]);_0x3c92a4['offset']=qs['offset'](_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x26')]);}_0x3c92a4[_0xdb48('0x38')]=qs[_0xdb48('0x39')](_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x39')]);_0x3c92a4[_0xdb48('0x3a')]=qs[_0xdb48('0x33')](_[_0xdb48('0x3b')](_0x2e2a7b['query'],_0x1b4680[_0xdb48('0x33')]));if(_0x2e2a7b[_0xdb48('0x32')]['filter']){_0x3c92a4[_0xdb48('0x3a')]=_['merge'](_0x3c92a4[_0xdb48('0x3a')],{'$or':_['map'](_0x516199,function(_0x1df2e3){if(_0x1df2e3[_0xdb48('0x3c')][_0xdb48('0x3d')]!==_0xdb48('0x3e')){var _0x3d6ec9={};_0x3d6ec9[_0x1df2e3[_0xdb48('0x3f')]]={'$like':'%'+_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x40')]+'%'};return _0x3d6ec9;}})});}_0x3c92a4=_[_0xdb48('0x41')]({},_0x3c92a4,_0x2e2a7b[_0xdb48('0x42')]);var _0x2d6022={'where':_0x3c92a4[_0xdb48('0x3a')]};return db[_0xdb48('0x43')][_0xdb48('0x25')](_0x2d6022)[_0xdb48('0x18')](function(_0x2c0aa8){_0x291153[_0xdb48('0x25')]=_0x2c0aa8;if(_0x2e2a7b[_0xdb48('0x32')][_0xdb48('0x44')]){_0x3c92a4['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0xdb48('0x45')](_0x3c92a4);})[_0xdb48('0x18')](function(_0x3da5d1){_0x291153['rows']=_0x3da5d1;return _0x291153;})[_0xdb48('0x18')](respondWithFilteredResult(_0x3a4c8e,_0x3c92a4))[_0xdb48('0x46')](handleError(_0x3a4c8e,null));};exports[_0xdb48('0x47')]=function(_0x24e544,_0x31ff09){var _0x500a29={'raw':![],'where':{'id':_0x24e544['params']['id']}},_0x38fcf4={};_0x38fcf4[_0xdb48('0x35')]=_[_0xdb48('0x31')](db[_0xdb48('0x43')][_0xdb48('0x30')]);_0x38fcf4['query']=_[_0xdb48('0x31')](_0x24e544['query']);_0x38fcf4[_0xdb48('0x33')]=_[_0xdb48('0x34')](_0x38fcf4[_0xdb48('0x35')],_0x38fcf4[_0xdb48('0x32')]);_0x500a29[_0xdb48('0x37')]=_[_0xdb48('0x34')](_0x38fcf4[_0xdb48('0x35')],qs[_0xdb48('0x36')](_0x24e544[_0xdb48('0x32')][_0xdb48('0x36')]));_0x500a29['attributes']=_0x500a29['attributes'][_0xdb48('0x48')]?_0x500a29[_0xdb48('0x37')]:_0x38fcf4[_0xdb48('0x35')];if(_0x24e544[_0xdb48('0x32')]['includeAll']){_0x500a29['include']=[{'all':!![]}];}_0x500a29=_['merge']({},_0x500a29,_0x24e544[_0xdb48('0x42')]);return db[_0xdb48('0x43')][_0xdb48('0x49')](_0x500a29)['then'](handleEntityNotFound(_0x31ff09,null))[_0xdb48('0x18')](respondWithResult(_0x31ff09,null))['catch'](handleError(_0x31ff09,null));};exports[_0xdb48('0x4a')]=function(_0xa3a94c,_0x4399f4){return db['SalesforceAccount']['create'](_0xa3a94c[_0xdb48('0x4b')],{})[_0xdb48('0x18')](respondWithResult(_0x4399f4,0xc9))[_0xdb48('0x46')](handleError(_0x4399f4,null));};exports[_0xdb48('0x2b')]=function(_0x499f11,_0x461509){if(_0x499f11[_0xdb48('0x4b')]['id']){delete _0x499f11[_0xdb48('0x4b')]['id'];}return db[_0xdb48('0x43')][_0xdb48('0x49')]({'where':{'id':_0x499f11[_0xdb48('0x4c')]['id']}})[_0xdb48('0x18')](handleEntityNotFound(_0x461509,null))['then'](saveUpdates(_0x499f11['body'],null))[_0xdb48('0x18')](respondWithResult(_0x461509,null))[_0xdb48('0x46')](handleError(_0x461509,null));};exports[_0xdb48('0x2c')]=function(_0x36db1f,_0x5f4211){return db[_0xdb48('0x43')][_0xdb48('0x49')]({'where':{'id':_0x36db1f['params']['id']}})['then'](handleEntityNotFound(_0x5f4211,null))[_0xdb48('0x18')](removeEntity(_0x5f4211,null))[_0xdb48('0x46')](handleError(_0x5f4211,null));};exports['getConfigurations']=function(_0x57e2c7,_0x3815c0,_0x2e0d1d){var _0x58a4ec={};var _0x2e3f04={};var _0x1e61ca;var _0x2def82;return db[_0xdb48('0x43')][_0xdb48('0x4d')]({'where':{'id':_0x57e2c7['params']['id']}})['then'](handleEntityNotFound(_0x3815c0,null))['then'](function(_0x8c092a){if(_0x8c092a){_0x1e61ca=_0x8c092a;_0x2e3f04[_0xdb48('0x35')]=_[_0xdb48('0x31')](db['SalesforceConfiguration'][_0xdb48('0x30')]);_0x2e3f04[_0xdb48('0x32')]=_[_0xdb48('0x31')](_0x57e2c7['query']);_0x2e3f04[_0xdb48('0x33')]=_[_0xdb48('0x34')](_0x2e3f04[_0xdb48('0x35')],_0x2e3f04[_0xdb48('0x32')]);_0x58a4ec[_0xdb48('0x37')]=_[_0xdb48('0x34')](_0x2e3f04[_0xdb48('0x35')],qs['fields'](_0x57e2c7['query']['fields']));_0x58a4ec[_0xdb48('0x37')]=_0x58a4ec[_0xdb48('0x37')][_0xdb48('0x48')]?_0x58a4ec['attributes']:_0x2e3f04[_0xdb48('0x35')];_0x58a4ec['order']=qs[_0xdb48('0x39')](_0x57e2c7['query'][_0xdb48('0x39')]);_0x58a4ec[_0xdb48('0x3a')]=qs['filters'](_['pick'](_0x57e2c7[_0xdb48('0x32')],_0x2e3f04[_0xdb48('0x33')]));if(_0x57e2c7[_0xdb48('0x32')][_0xdb48('0x40')]){_0x58a4ec[_0xdb48('0x3a')]=_[_0xdb48('0x41')](_0x58a4ec[_0xdb48('0x3a')],{'$or':_[_0xdb48('0x4e')](_0x58a4ec['attributes'],function(_0x3c4c00){var _0x2b9f50={};_0x2b9f50[_0x3c4c00]={'$like':'%'+_0x57e2c7[_0xdb48('0x32')][_0xdb48('0x40')]+'%'};return _0x2b9f50;})});}_0x58a4ec=_[_0xdb48('0x41')]({},_0x58a4ec,_0x57e2c7[_0xdb48('0x42')]);return _0x1e61ca[_0xdb48('0x4f')](_0x58a4ec);}})['then'](function(_0x4bd7da){if(_0x4bd7da){_0x2def82=_0x4bd7da[_0xdb48('0x48')];if(!_0x57e2c7[_0xdb48('0x32')][_0xdb48('0x50')](_0xdb48('0x51'))){_0x58a4ec[_0xdb48('0x27')]=qs[_0xdb48('0x27')](_0x57e2c7[_0xdb48('0x32')]['limit']);_0x58a4ec[_0xdb48('0x26')]=qs[_0xdb48('0x26')](_0x57e2c7['query'][_0xdb48('0x26')]);}return _0x1e61ca[_0xdb48('0x4f')](_0x58a4ec);}})[_0xdb48('0x18')](function(_0x124b72){if(_0x124b72){return _0x124b72?{'count':_0x2def82,'rows':_0x124b72}:null;}})[_0xdb48('0x18')](respondWithResult(_0x3815c0,null))[_0xdb48('0x46')](handleError(_0x3815c0,null));};exports['addConfiguration']=function(_0x248521,_0x3005cb,_0xfb00ca){if(_0x248521['body']['id']){delete _0x248521[_0xdb48('0x4b')]['id'];}return db[_0xdb48('0x43')][_0xdb48('0x4d')]({'where':{'id':_0x248521[_0xdb48('0x4c')]['id']}})[_0xdb48('0x18')](handleEntityNotFound(_0x3005cb,null))[_0xdb48('0x18')](function(_0x305a02){if(_0x305a02){_0x248521[_0xdb48('0x4b')][_0xdb48('0x52')]=_0x305a02['id'];_0x248521[_0xdb48('0x4b')][_0xdb48('0x53')]=integrations[_0xdb48('0x54')](_0x248521[_0xdb48('0x4b')][_0xdb48('0x55')],_0x248521['body'][_0xdb48('0x3c')]);_0x248521['body'][_0xdb48('0x56')]=integrations[_0xdb48('0x57')](_0x248521['body'][_0xdb48('0x55')],_0x248521[_0xdb48('0x4b')][_0xdb48('0x3c')]);return db[_0xdb48('0x58')]['create'](_0x248521['body'],{'include':[{'model':db[_0xdb48('0x59')],'as':'Subjects'},{'model':db[_0xdb48('0x59')],'as':_0xdb48('0x56')}]});}return null;})[_0xdb48('0x18')](respondWithResult(_0x3005cb,null))[_0xdb48('0x46')](handleError(_0x3005cb,null));};exports['getFields']=function(_0x37574f,_0x1a434d,_0x3b6687){var _0x57a1e4;var _0x199273='';var _0x1c1822='Task';return db['SalesforceAccount'][_0xdb48('0x4d')]({'where':{'id':_0x37574f[_0xdb48('0x4c')]['id']},'attributes':['id',_0xdb48('0x5a'),_0xdb48('0x5b'),_0xdb48('0x5c'),_0xdb48('0x5d'),_0xdb48('0x5e'),_0xdb48('0x5f')]})[_0xdb48('0x18')](handleEntityNotFound(_0x1a434d,null))[_0xdb48('0x18')](function(_0x56fabf){if(_0x56fabf){_0x199273=_0x56fabf[_0xdb48('0x5a')];var _0xe91f2f=_0x199273[_0xdb48('0x60')](-0x1);if(_0xe91f2f==='/'){_0x199273=_0x199273[_0xdb48('0x61')](0x0,_0x199273[_0xdb48('0x62')](_0xe91f2f));}_0x57a1e4=new jsforce[(_0xdb48('0x63'))]({'oauth2':{'loginUrl':_0x199273,'clientId':_0x56fabf['clientId'],'clientSecret':_0x56fabf['clientSecret']}});return _0x57a1e4[_0xdb48('0x64')](_0x56fabf[_0xdb48('0x5d')],_0x56fabf[_0xdb48('0x5e')][_0xdb48('0x65')](_0x56fabf[_0xdb48('0x5f')]));}})['then'](function(_0x353b07){if(_0x353b07){if(!_[_0xdb48('0x66')](_0x37574f['query']['ticketType'])){_0x1c1822=_0x37574f[_0xdb48('0x32')][_0xdb48('0x67')];}return _0x57a1e4[_0xdb48('0x68')](_0x1c1822)[_0xdb48('0x69')]();}})[_0xdb48('0x18')](function(_0x4fdb61){var _0x45d1e7=[_0xdb48('0x6a'),_0xdb48('0x6b'),_0xdb48('0x6c'),'CallType',_0xdb48('0x6d'),_0xdb48('0x6e'),_0xdb48('0x6f'),_0xdb48('0x70')];if(!_[_0xdb48('0x66')](_0x37574f['query'][_0xdb48('0x67')])&&_0x37574f[_0xdb48('0x32')][_0xdb48('0x67')]===_0xdb48('0x71')){_0x45d1e7=[_0xdb48('0x70'),_0xdb48('0x72'),'Reason',_0xdb48('0x6f'),'Priority',_0xdb48('0x73'),'SuppliedName',_0xdb48('0x74')];}if(_0x4fdb61){_[_0xdb48('0x75')](_0x4fdb61['fields'],function(_0x49e091){return _0x49e091[_0xdb48('0x76')]===![]&&!_0x45d1e7[_0xdb48('0x77')](_0x49e091[_0xdb48('0x78')]);});return{'count':_0x4fdb61['fields'][_0xdb48('0x48')],'rows':_[_0xdb48('0x4e')](_0x4fdb61[_0xdb48('0x36')],function(_0x3ca08b){return{'id':_0x3ca08b[_0xdb48('0x78')],'name':_0x3ca08b[_0xdb48('0x79')],'custom':_0x3ca08b[_0xdb48('0x76')],'options':_0x3ca08b[_0xdb48('0x7a')]['length']>0x0?_[_0xdb48('0x4e')](_0x3ca08b[_0xdb48('0x7a')],function(_0x48be17){return{'name':_0x48be17[_0xdb48('0x79')],'value':_0x48be17[_0xdb48('0x7b')]};}):_0x3ca08b['type']=='boolean'?[{'name':_0xdb48('0x7c'),'value':'true'},{'name':_0xdb48('0x7d'),'value':'false'}]:[]};})};}})[_0xdb48('0x18')](respondWithResult(_0x1a434d,null))[_0xdb48('0x46')](function(_0x1344e4){var _0xfc3a52=_0x37574f['query']['test']?0x1f4:_0x1344e4[_0xdb48('0x7e')]||0x1f4;logger['error'](_0xdb48('0x7f'),_0xdb48('0x80'),_0xfc3a52,JSON[_0xdb48('0x1b')](_0x1344e4));delete _0x1344e4[_0xdb48('0x78')];if(_0xfc3a52===0x191){_0xfc3a52=0x190;}_0x1a434d[_0xdb48('0x22')](_0xfc3a52)['send'](_0x37574f['query'][_0xdb48('0x81')]?{'message':_0xdb48('0x82'),'statusCode':_0x1344e4[_0xdb48('0x7e')]}:_0x1344e4);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 8d02c78..a8c9a59 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 _0xcffe=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x5318fe,_0xed4ea){var _0xd3852f=function(_0x184315){while(--_0x184315){_0x5318fe['push'](_0x5318fe['shift']());}};_0xd3852f(++_0xed4ea);}(_0xcffe,0x1a1));var _0xecff=function(_0x151e0b,_0x3bec86){_0x151e0b=_0x151e0b-0x0;var _0x5d4a5c=_0xcffe[_0x151e0b];return _0x5d4a5c;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var logger=require(_0xecff('0x2'))(_0xecff('0x3'));var moment=require(_0xecff('0x4'));var BPromise=require(_0xecff('0x5'));var rp=require(_0xecff('0x6'));var fs=require('fs');var path=require(_0xecff('0x7'));var rimraf=require(_0xecff('0x8'));var config=require(_0xecff('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xecff('0xa')]=function(_0x25572c,_0x2e2fa9){return _0x25572c[_0xecff('0xb')](_0xecff('0xc'),attributes,{'tableName':_0xecff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x2c02e9,_0x32d6e0){var _0x4a926a=function(_0x5e648b){while(--_0x5e648b){_0x2c02e9['push'](_0x2c02e9['shift']());}};_0x4a926a(++_0x32d6e0);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x5905f0,_0x396048){_0x5905f0=_0x5905f0-0x0;var _0x399240=_0xd4f4[_0x5905f0];return _0x399240;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5e38d2,_0x1d7aa8){return _0x5e38d2[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'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 2c9f1e9..f2beead 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 _0x8427=['rpc','../../config/environment','jayson/promise','client','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8427,0x1c0));var _0x7842=function(_0x2e5395,_0x575a12){_0x2e5395=_0x2e5395-0x0;var _0x47c312=_0x8427[_0x2e5395];return _0x47c312;};'use strict';var _=require('lodash');var util=require(_0x7842('0x0'));var moment=require(_0x7842('0x1'));var BPromise=require(_0x7842('0x2'));var rs=require(_0x7842('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7842('0x4'))['db'];var utils=require(_0x7842('0x5'));var logger=require(_0x7842('0x6'))(_0x7842('0x7'));var config=require(_0x7842('0x8'));var jayson=require(_0x7842('0x9'));var client=jayson[_0x7842('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fed48,_0x46e83d,_0x251618){return new BPromise(function(_0x324732,_0x1e9872){return client[_0x7842('0xb')](_0x3fed48,_0x251618)['then'](function(_0x835571){logger[_0x7842('0xc')](_0x7842('0xd'),_0x46e83d,_0x7842('0xe'));logger['debug'](_0x7842('0xf'),_0x46e83d,'request\x20sent',JSON[_0x7842('0x10')](_0x835571));if(_0x835571[_0x7842('0x11')]){if(_0x835571[_0x7842('0x11')][_0x7842('0x12')]===0x1f4){logger[_0x7842('0x11')](_0x7842('0xd'),_0x46e83d,_0x835571[_0x7842('0x11')][_0x7842('0x13')]);return _0x1e9872(_0x835571['error'][_0x7842('0x13')]);}logger[_0x7842('0x11')](_0x7842('0xd'),_0x46e83d,_0x835571[_0x7842('0x11')]['message']);return _0x324732(_0x835571[_0x7842('0x11')][_0x7842('0x13')]);}else{logger[_0x7842('0xc')](_0x7842('0xd'),_0x46e83d,'request\x20sent');_0x324732(_0x835571[_0x7842('0x14')]['message']);}})[_0x7842('0x15')](function(_0x1f58ef){logger[_0x7842('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x46e83d,_0x1f58ef);_0x1e9872(_0x1f58ef);});});}exports[_0x7842('0x16')]=function(_0x197052){var _0x14cdcc=this;return new Promise(function(_0x4e67cd,_0x2f1fbb){return db[_0x7842('0x17')][_0x7842('0x18')]({'raw':_0x197052[_0x7842('0x19')]?_0x197052[_0x7842('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x197052[_0x7842('0x19')]?_0x197052['options'][_0x7842('0x1a')]||null:null,'attributes':_0x197052['options']?_0x197052[_0x7842('0x19')][_0x7842('0x1b')]||null:null,'limit':_0x197052['options']?_0x197052[_0x7842('0x19')][_0x7842('0x1c')]||null:null,'include':_0x197052['options']?_0x197052[_0x7842('0x19')][_0x7842('0x1d')]?_[_0x7842('0x1e')](_0x197052[_0x7842('0x19')][_0x7842('0x1d')],function(_0x55993b){return{'model':db[_0x55993b['model']],'as':_0x55993b['as'],'attributes':_0x55993b['attributes'],'include':_0x55993b[_0x7842('0x1d')]?_[_0x7842('0x1e')](_0x55993b[_0x7842('0x1d')],function(_0x35c4ca){return{'model':db[_0x35c4ca[_0x7842('0x1f')]],'as':_0x35c4ca['as'],'attributes':_0x35c4ca[_0x7842('0x1b')],'include':_0x35c4ca[_0x7842('0x1d')]?_[_0x7842('0x1e')](_0x35c4ca['include'],function(_0x5279f6){return{'model':db[_0x5279f6['model']],'as':_0x5279f6['as'],'attributes':_0x5279f6[_0x7842('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a3259){logger[_0x7842('0xc')]('GetSalesforceAccount',_0x197052);logger['debug'](_0x7842('0x16'),_0x197052,JSON['stringify'](_0x2a3259));_0x4e67cd(_0x2a3259);})['catch'](function(_0x3212ec){logger[_0x7842('0x11')](_0x7842('0x16'),_0x3212ec[_0x7842('0x13')],_0x197052);_0x2f1fbb(_0x14cdcc[_0x7842('0x11')](0x1f4,_0x3212ec[_0x7842('0x13')]));});});};exports[_0x7842('0x20')]=function(_0x5612fe){var _0x140b7d=this;return new Promise(function(_0x2c28db,_0x293965){return db[_0x7842('0x17')][_0x7842('0x21')]({'raw':_0x5612fe[_0x7842('0x19')]?_0x5612fe['options']['raw']===undefined?!![]:![]:!![],'where':_0x5612fe['options']?_0x5612fe[_0x7842('0x19')][_0x7842('0x1a')]||null:null,'attributes':_0x5612fe[_0x7842('0x19')]?_0x5612fe[_0x7842('0x19')]['attributes']||null:null,'include':_0x5612fe[_0x7842('0x19')]?_0x5612fe[_0x7842('0x19')][_0x7842('0x1d')]?_[_0x7842('0x1e')](_0x5612fe['options'][_0x7842('0x1d')],function(_0x2629dc){return{'model':db[_0x2629dc[_0x7842('0x1f')]],'as':_0x2629dc['as'],'attributes':_0x2629dc[_0x7842('0x1b')],'include':_0x2629dc['include']?_['map'](_0x2629dc[_0x7842('0x1d')],function(_0x4d3338){return{'model':db[_0x4d3338[_0x7842('0x1f')]],'as':_0x4d3338['as'],'attributes':_0x4d3338[_0x7842('0x1b')],'include':_0x4d3338['include']?_[_0x7842('0x1e')](_0x4d3338['include'],function(_0x12c464){return{'model':db[_0x12c464[_0x7842('0x1f')]],'as':_0x12c464['as'],'attributes':_0x12c464[_0x7842('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7842('0x22')](function(_0x36f09d){logger[_0x7842('0xc')](_0x7842('0x20'),_0x5612fe);logger['debug'](_0x7842('0x20'),_0x5612fe,JSON[_0x7842('0x10')](_0x36f09d));_0x2c28db(_0x36f09d);})[_0x7842('0x15')](function(_0x1d3f47){logger[_0x7842('0x11')](_0x7842('0x20'),_0x1d3f47['message'],_0x5612fe);_0x293965(_0x140b7d[_0x7842('0x11')](0x1f4,_0x1d3f47[_0x7842('0x13')]));});});}; \ No newline at end of file +var _0x4c13=['SalesforceAccount','findAll','options','raw','where','include','map','model','attributes','find','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount'];(function(_0x51a122,_0x3e480f){var _0x285dd2=function(_0x1424a4){while(--_0x1424a4){_0x51a122['push'](_0x51a122['shift']());}};_0x285dd2(++_0x3e480f);}(_0x4c13,0x1d2));var _0x34c1=function(_0x297f19,_0x47aa3e){_0x297f19=_0x297f19-0x0;var _0x4788e2=_0x4c13[_0x297f19];return _0x4788e2;};'use strict';var _=require(_0x34c1('0x0'));var util=require(_0x34c1('0x1'));var moment=require('moment');var BPromise=require(_0x34c1('0x2'));var rs=require(_0x34c1('0x3'));var fs=require('fs');var Redis=require(_0x34c1('0x4'));var db=require(_0x34c1('0x5'))['db'];var utils=require(_0x34c1('0x6'));var logger=require(_0x34c1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x34c1('0x8'));var client=jayson[_0x34c1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xebb6df,_0x37521c,_0x29f79b){return new BPromise(function(_0x51c916,_0x216e08){return client[_0x34c1('0xa')](_0xebb6df,_0x29f79b)[_0x34c1('0xb')](function(_0x5070a6){logger[_0x34c1('0xc')](_0x34c1('0xd'),_0x37521c,_0x34c1('0xe'));logger[_0x34c1('0xf')](_0x34c1('0x10'),_0x37521c,'request\x20sent',JSON[_0x34c1('0x11')](_0x5070a6));if(_0x5070a6[_0x34c1('0x12')]){if(_0x5070a6[_0x34c1('0x12')][_0x34c1('0x13')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x37521c,_0x5070a6[_0x34c1('0x12')]['message']);return _0x216e08(_0x5070a6['error'][_0x34c1('0x14')]);}logger[_0x34c1('0x12')](_0x34c1('0xd'),_0x37521c,_0x5070a6[_0x34c1('0x12')][_0x34c1('0x14')]);return _0x51c916(_0x5070a6[_0x34c1('0x12')][_0x34c1('0x14')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x37521c,_0x34c1('0xe'));_0x51c916(_0x5070a6[_0x34c1('0x15')][_0x34c1('0x14')]);}})[_0x34c1('0x16')](function(_0x5dd5e8){logger[_0x34c1('0x12')](_0x34c1('0xd'),_0x37521c,_0x5dd5e8);_0x216e08(_0x5dd5e8);});});}exports[_0x34c1('0x17')]=function(_0x12a01f){var _0x27575f=this;return new Promise(function(_0x5c3d44,_0x4fa7c2){return db[_0x34c1('0x18')][_0x34c1('0x19')]({'raw':_0x12a01f[_0x34c1('0x1a')]?_0x12a01f[_0x34c1('0x1a')][_0x34c1('0x1b')]===undefined?!![]:![]:!![],'where':_0x12a01f[_0x34c1('0x1a')]?_0x12a01f[_0x34c1('0x1a')][_0x34c1('0x1c')]||null:null,'attributes':_0x12a01f['options']?_0x12a01f[_0x34c1('0x1a')]['attributes']||null:null,'limit':_0x12a01f[_0x34c1('0x1a')]?_0x12a01f[_0x34c1('0x1a')]['limit']||null:null,'include':_0x12a01f[_0x34c1('0x1a')]?_0x12a01f[_0x34c1('0x1a')][_0x34c1('0x1d')]?_[_0x34c1('0x1e')](_0x12a01f[_0x34c1('0x1a')][_0x34c1('0x1d')],function(_0x1f10a5){return{'model':db[_0x1f10a5[_0x34c1('0x1f')]],'as':_0x1f10a5['as'],'attributes':_0x1f10a5[_0x34c1('0x20')],'include':_0x1f10a5['include']?_[_0x34c1('0x1e')](_0x1f10a5[_0x34c1('0x1d')],function(_0x363da9){return{'model':db[_0x363da9['model']],'as':_0x363da9['as'],'attributes':_0x363da9[_0x34c1('0x20')],'include':_0x363da9[_0x34c1('0x1d')]?_['map'](_0x363da9['include'],function(_0x50677a){return{'model':db[_0x50677a[_0x34c1('0x1f')]],'as':_0x50677a['as'],'attributes':_0x50677a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x377a76){logger[_0x34c1('0xc')](_0x34c1('0x17'),_0x12a01f);logger[_0x34c1('0xf')](_0x34c1('0x17'),_0x12a01f,JSON[_0x34c1('0x11')](_0x377a76));_0x5c3d44(_0x377a76);})[_0x34c1('0x16')](function(_0x509bb5){logger[_0x34c1('0x12')](_0x34c1('0x17'),_0x509bb5[_0x34c1('0x14')],_0x12a01f);_0x4fa7c2(_0x27575f[_0x34c1('0x12')](0x1f4,_0x509bb5[_0x34c1('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x1258c9){var _0x407f64=this;return new Promise(function(_0x5be00f,_0x30a53b){return db[_0x34c1('0x18')][_0x34c1('0x21')]({'raw':_0x1258c9[_0x34c1('0x1a')]?_0x1258c9[_0x34c1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1258c9[_0x34c1('0x1a')]?_0x1258c9[_0x34c1('0x1a')][_0x34c1('0x1c')]||null:null,'attributes':_0x1258c9[_0x34c1('0x1a')]?_0x1258c9[_0x34c1('0x1a')][_0x34c1('0x20')]||null:null,'include':_0x1258c9[_0x34c1('0x1a')]?_0x1258c9['options'][_0x34c1('0x1d')]?_['map'](_0x1258c9[_0x34c1('0x1a')]['include'],function(_0x2aa2f9){return{'model':db[_0x2aa2f9[_0x34c1('0x1f')]],'as':_0x2aa2f9['as'],'attributes':_0x2aa2f9[_0x34c1('0x20')],'include':_0x2aa2f9[_0x34c1('0x1d')]?_[_0x34c1('0x1e')](_0x2aa2f9['include'],function(_0x3a4e4f){return{'model':db[_0x3a4e4f[_0x34c1('0x1f')]],'as':_0x3a4e4f['as'],'attributes':_0x3a4e4f['attributes'],'include':_0x3a4e4f[_0x34c1('0x1d')]?_[_0x34c1('0x1e')](_0x3a4e4f[_0x34c1('0x1d')],function(_0x3f4841){return{'model':db[_0x3f4841['model']],'as':_0x3f4841['as'],'attributes':_0x3f4841[_0x34c1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x34c1('0xb')](function(_0x248407){logger[_0x34c1('0xc')](_0x34c1('0x22'),_0x1258c9);logger[_0x34c1('0xf')]('ShowSalesforceAccount',_0x1258c9,JSON['stringify'](_0x248407));_0x5be00f(_0x248407);})['catch'](function(_0x39bc92){logger[_0x34c1('0x12')]('ShowSalesforceAccount',_0x39bc92[_0x34c1('0x14')],_0x1258c9);_0x30a53b(_0x407f64[_0x34c1('0x12')](0x1f4,_0x39bc92[_0x34c1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index dd7e495..810f764 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 _0x9976=['get','/:id','getFields','/:id/descriptions','post','put','destroy','exports','multer','path','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index'];(function(_0x2a1428,_0x1ef92){var _0x596521=function(_0x56088b){while(--_0x56088b){_0x2a1428['push'](_0x2a1428['shift']());}};_0x596521(++_0x1ef92);}(_0x9976,0x178));var _0x6997=function(_0x1c5eff,_0x41175b){_0x1c5eff=_0x1c5eff-0x0;var _0x685ea0=_0x9976[_0x1c5eff];return _0x685ea0;};'use strict';var multer=require(_0x6997('0x0'));var util=require('util');var path=require(_0x6997('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6997('0x2')]();var auth=require(_0x6997('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6997('0x4'));var controller=require(_0x6997('0x5'));router['get']('/',auth[_0x6997('0x6')](),controller[_0x6997('0x7')]);router[_0x6997('0x8')](_0x6997('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6997('0x8')]('/:id/fields',auth[_0x6997('0x6')](),controller[_0x6997('0xa')]);router[_0x6997('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x6997('0x8')](_0x6997('0xb'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6997('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6997('0xd')](_0x6997('0x9'),auth[_0x6997('0x6')](),controller['update']);router['delete'](_0x6997('0x9'),auth['isAuthenticated'](),controller[_0x6997('0xe')]);module[_0x6997('0xf')]=router; \ No newline at end of file +var _0x3f77=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get'];(function(_0x3398a8,_0x1612d6){var _0x3e01d2=function(_0x44a554){while(--_0x44a554){_0x3398a8['push'](_0x3398a8['shift']());}};_0x3e01d2(++_0x1612d6);}(_0x3f77,0x157));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73f7('0x0'));var timeout=require(_0x73f7('0x1'));var express=require(_0x73f7('0x2'));var router=express[_0x73f7('0x3')]();var auth=require(_0x73f7('0x4'));var interaction=require(_0x73f7('0x5'));var config=require(_0x73f7('0x6'));var controller=require(_0x73f7('0x7'));router[_0x73f7('0x8')]('/',auth[_0x73f7('0x9')](),controller[_0x73f7('0xa')]);router[_0x73f7('0x8')](_0x73f7('0xb'),auth[_0x73f7('0x9')](),controller['show']);router[_0x73f7('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x73f7('0xc')]);router[_0x73f7('0x8')](_0x73f7('0xd'),auth[_0x73f7('0x9')](),controller[_0x73f7('0xe')]);router['get'](_0x73f7('0xf'),auth[_0x73f7('0x9')](),controller[_0x73f7('0x10')]);router[_0x73f7('0x11')]('/',auth[_0x73f7('0x9')](),controller[_0x73f7('0x12')]);router[_0x73f7('0x13')](_0x73f7('0xb'),auth[_0x73f7('0x9')](),controller['update']);router[_0x73f7('0x14')](_0x73f7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x73f7('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 2cf0c7a..1eafee1 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 _0x0122=['contact','lead','nothing','STRING','ENUM','Task','Case','contact_lead'];(function(_0x79f3b4,_0x526d9e){var _0x4473c9=function(_0x22ab7e){while(--_0x22ab7e){_0x79f3b4['push'](_0x79f3b4['shift']());}};_0x4473c9(++_0x526d9e);}(_0x0122,0xd3));var _0x2012=function(_0x17b1d8,_0x1827f6){_0x17b1d8=_0x17b1d8-0x0;var _0x30313f=_0x0122[_0x17b1d8];return _0x30313f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2012('0x0')]},'description':{'type':Sequelize[_0x2012('0x0')]},'ticketType':{'type':Sequelize[_0x2012('0x1')](_0x2012('0x2'),_0x2012('0x3')),'defaultValue':_0x2012('0x2')},'moduleSearch':{'type':Sequelize[_0x2012('0x1')](_0x2012('0x4'),_0x2012('0x5'),_0x2012('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2012('0x1')](_0x2012('0x7'),_0x2012('0x5'),_0x2012('0x6')),'defaultValue':_0x2012('0x6')}}; \ No newline at end of file +var _0x0ce0=['sequelize','exports','STRING','Task','Case','ENUM','contact_lead','contact','lead'];(function(_0x336768,_0x40d6d2){var _0x59e72c=function(_0x47dd53){while(--_0x47dd53){_0x336768['push'](_0x336768['shift']());}};_0x59e72c(++_0x40d6d2);}(_0x0ce0,0x1dd));var _0x00ce=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x0ce0[_0x36de10];return _0x58100f;};'use strict';var Sequelize=require(_0x00ce('0x0'));module[_0x00ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x00ce('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x00ce('0x3'),_0x00ce('0x4')),'defaultValue':_0x00ce('0x3')},'moduleSearch':{'type':Sequelize[_0x00ce('0x5')](_0x00ce('0x6'),_0x00ce('0x7'),_0x00ce('0x8')),'defaultValue':_0x00ce('0x6')},'moduleCreate':{'type':Sequelize[_0x00ce('0x5')]('nothing','contact',_0x00ce('0x8')),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 73c33e9..fe9377c 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 _0x4d47=['result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','destroy','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','SalesforceConfiguration','rows','show','params','rawAttributes','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x58c844,_0x313e00){var _0x5efd30=function(_0x2d5c1f){while(--_0x2d5c1f){_0x58c844['push'](_0x58c844['shift']());}};_0x5efd30(++_0x313e00);}(_0x4d47,0x1f1));var _0x74d4=function(_0x32f8a2,_0x49c502){_0x32f8a2=_0x32f8a2-0x0;var _0x258cca=_0x4d47[_0x32f8a2];return _0x258cca;};'use strict';var pdf=require(_0x74d4('0x0'));var emlformat=require(_0x74d4('0x1'));var rimraf=require(_0x74d4('0x2'));var zipdir=require(_0x74d4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74d4('0x4'));var moment=require(_0x74d4('0x5'));var BPromise=require(_0x74d4('0x6'));var Mustache=require(_0x74d4('0x7'));var util=require('util');var path=require(_0x74d4('0x8'));var sox=require(_0x74d4('0x9'));var csv=require(_0x74d4('0xa'));var ejs=require(_0x74d4('0xb'));var fs=require('fs');var _=require(_0x74d4('0xc'));var squel=require(_0x74d4('0xd'));var crypto=require(_0x74d4('0xe'));var jsforce=require(_0x74d4('0xf'));var deskjs=require(_0x74d4('0x10'));var toCsv=require(_0x74d4('0xa'));var querystring=require('querystring');var Papa=require(_0x74d4('0x11'));var Redis=require(_0x74d4('0x12'));var authService=require(_0x74d4('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x74d4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x74d4('0x15'));var config=require(_0x74d4('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x74d4('0x17'));var client=jayson[_0x74d4('0x18')][_0x74d4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3cdabf,_0x21a01c,_0x1d7553){if(_0x1d7553){var _0x449e3e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x449e3e[_0x74d4('0x1a')](_0x21a01c)){return _0x3cdabf;}else{throw new Error(_0x74d4('0x1b'));}}else{return _0x3cdabf;}}function respondWithRpcPromise(_0x1049f4,_0x361ba8,_0x46464f,_0x1de8dc){return new BPromise(function(_0x576a93,_0x4047b5){var _0x13e7c9=_0x1de8dc||client;return _0x13e7c9[_0x74d4('0x1c')](_0x1049f4,_0x46464f)[_0x74d4('0x1d')](function(_0x448cbd){logger[_0x74d4('0x1e')](_0x74d4('0x1f'),_0x361ba8,_0x74d4('0x20'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x361ba8,_0x74d4('0x20'),JSON[_0x74d4('0x21')](_0x448cbd));if(_0x448cbd[_0x74d4('0x22')]){if(_0x448cbd[_0x74d4('0x22')][_0x74d4('0x23')]===0x1f4){logger[_0x74d4('0x22')](_0x74d4('0x1f'),_0x361ba8,_0x448cbd[_0x74d4('0x22')][_0x74d4('0x24')]);return _0x4047b5(_0x448cbd[_0x74d4('0x22')][_0x74d4('0x24')]);}logger[_0x74d4('0x22')](_0x74d4('0x1f'),_0x361ba8,_0x448cbd[_0x74d4('0x22')][_0x74d4('0x24')]);return _0x576a93(_0x448cbd['error'][_0x74d4('0x24')]);}else{logger[_0x74d4('0x1e')](_0x74d4('0x1f'),_0x361ba8,_0x74d4('0x20'));_0x576a93(_0x448cbd[_0x74d4('0x25')][_0x74d4('0x24')]);}})[_0x74d4('0x26')](function(_0x26184a){logger[_0x74d4('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x361ba8,_0x26184a);_0x4047b5(_0x26184a);});});}function respondWithStatusCode(_0x5995c5,_0x230fe1){_0x230fe1=_0x230fe1||0xcc;return function(_0x5989d1){if(_0x5989d1){return _0x5995c5[_0x74d4('0x27')](_0x230fe1);}return _0x5995c5[_0x74d4('0x28')](_0x230fe1)[_0x74d4('0x29')]();};}function respondWithResult(_0x5cf73e,_0x280395){_0x280395=_0x280395||0xc8;return function(_0x49df56){if(_0x49df56){return _0x5cf73e['status'](_0x280395)['json'](_0x49df56);}};}function respondWithFilteredResult(_0x481b01,_0x4cd36d){return function(_0x52b0fb){if(_0x52b0fb){var _0x2bf416=_0x52b0fb[_0x74d4('0x2a')],_0x325756=_0x4cd36d[_0x74d4('0x2b')],_0x17eff8=_0x4cd36d[_0x74d4('0x2b')]+_0x4cd36d['limit'],_0x4528c8;if(_0x17eff8>=_0x2bf416){_0x17eff8=_0x2bf416;_0x4528c8=0xc8;}else{_0x4528c8=0xce;}_0x481b01[_0x74d4('0x28')](_0x4528c8);return _0x481b01[_0x74d4('0x2c')](_0x74d4('0x2d'),_0x325756+'-'+_0x17eff8+'/'+_0x2bf416)[_0x74d4('0x2e')](_0x52b0fb);}return null;};}function patchUpdates(_0x5af71b){return function(_0x22cc21){try{jsonpatch[_0x74d4('0x2f')](_0x22cc21,_0x5af71b,!![]);}catch(_0x2b9f0b){return BPromise[_0x74d4('0x30')](_0x2b9f0b);}return _0x22cc21['save']();};}function saveUpdates(_0xce3617,_0x3d3547){return function(_0x53e92c){if(_0x53e92c){return _0x53e92c['update'](_0xce3617)['then'](function(_0x121134){return _0x121134;});}return null;};}function removeEntity(_0x5cf68c,_0x2108d5){return function(_0x31f94d){if(_0x31f94d){return _0x31f94d[_0x74d4('0x31')]()['then'](function(){_0x5cf68c['status'](0xcc)[_0x74d4('0x29')]();});}};}function handleEntityNotFound(_0x59a997,_0x52bff7){return function(_0x5a755d){if(!_0x5a755d){_0x59a997[_0x74d4('0x27')](0x194);}return _0x5a755d;};}function handleError(_0x53a7c2,_0x4f235e){_0x4f235e=_0x4f235e||0x1f4;return function(_0x4016e1){logger['error'](_0x4016e1[_0x74d4('0x32')]);if(_0x4016e1[_0x74d4('0x33')]){delete _0x4016e1[_0x74d4('0x33')];}_0x53a7c2['status'](_0x4f235e)[_0x74d4('0x34')](_0x4016e1);};}exports['index']=function(_0x56a21f,_0x254ee2){var _0x2abd22={},_0x2c1366={},_0x533b5a={'count':0x0,'rows':[]};var _0x4b694a=db['SalesforceConfiguration']['rawAttributes'];_0x2c1366[_0x74d4('0x35')]=_[_0x74d4('0x36')](_0x4b694a);_0x2c1366[_0x74d4('0x37')]=_[_0x74d4('0x36')](_0x56a21f[_0x74d4('0x37')]);_0x2c1366[_0x74d4('0x38')]=_['intersection'](_0x2c1366[_0x74d4('0x35')],_0x2c1366['query']);_0x2abd22[_0x74d4('0x39')]=_[_0x74d4('0x3a')](_0x2c1366['model'],qs[_0x74d4('0x3b')](_0x56a21f['query'][_0x74d4('0x3b')]));_0x2abd22[_0x74d4('0x39')]=_0x2abd22['attributes'][_0x74d4('0x3c')]?_0x2abd22[_0x74d4('0x39')]:_0x2c1366[_0x74d4('0x35')];if(!_0x56a21f[_0x74d4('0x37')][_0x74d4('0x3d')](_0x74d4('0x3e'))){_0x2abd22[_0x74d4('0x3f')]=qs[_0x74d4('0x3f')](_0x56a21f[_0x74d4('0x37')][_0x74d4('0x3f')]);_0x2abd22['offset']=qs[_0x74d4('0x2b')](_0x56a21f['query']['offset']);}_0x2abd22[_0x74d4('0x40')]=qs['sort'](_0x56a21f['query'][_0x74d4('0x41')]);_0x2abd22['where']=qs[_0x74d4('0x38')](_[_0x74d4('0x42')](_0x56a21f[_0x74d4('0x37')],_0x2c1366[_0x74d4('0x38')]));if(_0x56a21f[_0x74d4('0x37')][_0x74d4('0x43')]){_0x2abd22[_0x74d4('0x44')]=_[_0x74d4('0x45')](_0x2abd22[_0x74d4('0x44')],{'$or':_[_0x74d4('0x46')](_0x4b694a,function(_0x5d6910){if(_0x5d6910[_0x74d4('0x47')][_0x74d4('0x48')]!==_0x74d4('0x49')){var _0x4c2a71={};_0x4c2a71[_0x5d6910['field']]={'$like':'%'+_0x56a21f[_0x74d4('0x37')][_0x74d4('0x43')]+'%'};return _0x4c2a71;}})});}_0x2abd22=_[_0x74d4('0x45')]({},_0x2abd22,_0x56a21f[_0x74d4('0x4a')]);var _0x577394={'where':_0x2abd22[_0x74d4('0x44')]};return db['SalesforceConfiguration'][_0x74d4('0x2a')](_0x577394)['then'](function(_0x1e27d3){_0x533b5a[_0x74d4('0x2a')]=_0x1e27d3;if(_0x56a21f['query'][_0x74d4('0x4b')]){_0x2abd22[_0x74d4('0x4c')]=[{'all':!![]}];}return db[_0x74d4('0x4d')]['findAll'](_0x2abd22);})['then'](function(_0x203bed){_0x533b5a[_0x74d4('0x4e')]=_0x203bed;return _0x533b5a;})['then'](respondWithFilteredResult(_0x254ee2,_0x2abd22))[_0x74d4('0x26')](handleError(_0x254ee2,null));};exports[_0x74d4('0x4f')]=function(_0x21b9fd,_0x4e7e5c){var _0x5e6f4a={'raw':![],'where':{'id':_0x21b9fd[_0x74d4('0x50')]['id']}},_0x417de1={};_0x417de1[_0x74d4('0x35')]=_[_0x74d4('0x36')](db[_0x74d4('0x4d')][_0x74d4('0x51')]);_0x417de1[_0x74d4('0x37')]=_['keys'](_0x21b9fd[_0x74d4('0x37')]);_0x417de1[_0x74d4('0x38')]=_[_0x74d4('0x3a')](_0x417de1[_0x74d4('0x35')],_0x417de1[_0x74d4('0x37')]);_0x5e6f4a[_0x74d4('0x39')]=_[_0x74d4('0x3a')](_0x417de1[_0x74d4('0x35')],qs[_0x74d4('0x3b')](_0x21b9fd['query'][_0x74d4('0x3b')]));_0x5e6f4a['attributes']=_0x5e6f4a[_0x74d4('0x39')][_0x74d4('0x3c')]?_0x5e6f4a['attributes']:_0x417de1[_0x74d4('0x35')];if(_0x21b9fd['query'][_0x74d4('0x4b')]){_0x5e6f4a[_0x74d4('0x4c')]=[{'all':!![]}];}_0x5e6f4a=_[_0x74d4('0x45')]({},_0x5e6f4a,_0x21b9fd[_0x74d4('0x4a')]);return db[_0x74d4('0x4d')]['find'](_0x5e6f4a)[_0x74d4('0x1d')](handleEntityNotFound(_0x4e7e5c,null))[_0x74d4('0x1d')](respondWithResult(_0x4e7e5c,null))[_0x74d4('0x26')](handleError(_0x4e7e5c,null));};exports[_0x74d4('0x52')]=function(_0x57f0c9,_0x461d4b){return db[_0x74d4('0x4d')][_0x74d4('0x52')](_0x57f0c9[_0x74d4('0x53')],{})['then'](respondWithResult(_0x461d4b,0xc9))[_0x74d4('0x26')](handleError(_0x461d4b,null));};exports['update']=function(_0x5d9a7c,_0x1b2db2){if(_0x5d9a7c[_0x74d4('0x53')]['id']){delete _0x5d9a7c['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x5d9a7c[_0x74d4('0x50')]['id']}})[_0x74d4('0x1d')](handleEntityNotFound(_0x1b2db2,null))[_0x74d4('0x1d')](saveUpdates(_0x5d9a7c[_0x74d4('0x53')],null))[_0x74d4('0x1d')](respondWithResult(_0x1b2db2,null))['catch'](handleError(_0x1b2db2,null));};exports[_0x74d4('0x31')]=function(_0x1ceafe,_0x966ab2){return db[_0x74d4('0x4d')]['find']({'where':{'id':_0x1ceafe[_0x74d4('0x50')]['id']}})[_0x74d4('0x1d')](handleEntityNotFound(_0x966ab2,null))[_0x74d4('0x1d')](removeEntity(_0x966ab2,null))[_0x74d4('0x26')](handleError(_0x966ab2,null));};exports[_0x74d4('0x54')]=function(_0x5c2c59,_0xf1f6eb,_0x2094ab){var _0x3620e0={};var _0xff3e08={};var _0x32d942;var _0x55f0ac;return db['SalesforceConfiguration'][_0x74d4('0x55')]({'where':{'id':_0x5c2c59[_0x74d4('0x50')]['id']}})[_0x74d4('0x1d')](handleEntityNotFound(_0xf1f6eb,null))[_0x74d4('0x1d')](function(_0x598dd8){if(_0x598dd8){_0x32d942=_0x598dd8;_0xff3e08[_0x74d4('0x35')]=_[_0x74d4('0x36')](db[_0x74d4('0x56')][_0x74d4('0x51')]);_0xff3e08[_0x74d4('0x37')]=_[_0x74d4('0x36')](_0x5c2c59['query']);_0xff3e08[_0x74d4('0x38')]=_[_0x74d4('0x3a')](_0xff3e08['model'],_0xff3e08[_0x74d4('0x37')]);_0x3620e0[_0x74d4('0x39')]=_['intersection'](_0xff3e08[_0x74d4('0x35')],qs[_0x74d4('0x3b')](_0x5c2c59[_0x74d4('0x37')][_0x74d4('0x3b')]));_0x3620e0[_0x74d4('0x39')]=_0x3620e0[_0x74d4('0x39')][_0x74d4('0x3c')]?_0x3620e0[_0x74d4('0x39')]:_0xff3e08[_0x74d4('0x35')];_0x3620e0[_0x74d4('0x40')]=qs[_0x74d4('0x41')](_0x5c2c59['query'][_0x74d4('0x41')]);_0x3620e0['where']=qs[_0x74d4('0x38')](_[_0x74d4('0x42')](_0x5c2c59[_0x74d4('0x37')],_0xff3e08[_0x74d4('0x38')]));if(_0x5c2c59[_0x74d4('0x37')]['filter']){_0x3620e0[_0x74d4('0x44')]=_['merge'](_0x3620e0['where'],{'$or':_[_0x74d4('0x46')](_0x3620e0[_0x74d4('0x39')],function(_0x48472e){var _0x488bbf={};_0x488bbf[_0x48472e]={'$like':'%'+_0x5c2c59[_0x74d4('0x37')][_0x74d4('0x43')]+'%'};return _0x488bbf;})});}_0x3620e0=_[_0x74d4('0x45')]({},_0x3620e0,_0x5c2c59[_0x74d4('0x4a')]);return _0x32d942[_0x74d4('0x54')](_0x3620e0);}})[_0x74d4('0x1d')](function(_0x3db248){if(_0x3db248){_0x55f0ac=_0x3db248[_0x74d4('0x3c')];if(!_0x5c2c59[_0x74d4('0x37')][_0x74d4('0x3d')](_0x74d4('0x3e'))){_0x3620e0['limit']=qs[_0x74d4('0x3f')](_0x5c2c59['query']['limit']);_0x3620e0[_0x74d4('0x2b')]=qs[_0x74d4('0x2b')](_0x5c2c59[_0x74d4('0x37')]['offset']);}return _0x32d942['getFields'](_0x3620e0);}})['then'](function(_0x9286bd){if(_0x9286bd){return _0x9286bd?{'count':_0x55f0ac,'rows':_0x9286bd}:null;}})[_0x74d4('0x1d')](respondWithResult(_0xf1f6eb,null))[_0x74d4('0x26')](handleError(_0xf1f6eb,null));};exports[_0x74d4('0x57')]=function(_0x46e1ec,_0x5cd266,_0x4e60e0){var _0x445076={};var _0x1efa15={};var _0x185f00;var _0x64eee6;return db[_0x74d4('0x4d')][_0x74d4('0x55')]({'where':{'id':_0x46e1ec[_0x74d4('0x50')]['id']}})[_0x74d4('0x1d')](handleEntityNotFound(_0x5cd266,null))['then'](function(_0x1a1407){if(_0x1a1407){_0x185f00=_0x1a1407;_0x1efa15[_0x74d4('0x35')]=_['keys'](db[_0x74d4('0x56')]['rawAttributes']);_0x1efa15['query']=_[_0x74d4('0x36')](_0x46e1ec[_0x74d4('0x37')]);_0x1efa15[_0x74d4('0x38')]=_[_0x74d4('0x3a')](_0x1efa15[_0x74d4('0x35')],_0x1efa15['query']);_0x445076[_0x74d4('0x39')]=_['intersection'](_0x1efa15[_0x74d4('0x35')],qs['fields'](_0x46e1ec['query']['fields']));_0x445076[_0x74d4('0x39')]=_0x445076[_0x74d4('0x39')][_0x74d4('0x3c')]?_0x445076[_0x74d4('0x39')]:_0x1efa15[_0x74d4('0x35')];_0x445076[_0x74d4('0x40')]=qs[_0x74d4('0x41')](_0x46e1ec[_0x74d4('0x37')][_0x74d4('0x41')]);_0x445076[_0x74d4('0x44')]=qs['filters'](_[_0x74d4('0x42')](_0x46e1ec[_0x74d4('0x37')],_0x1efa15[_0x74d4('0x38')]));if(_0x46e1ec['query'][_0x74d4('0x43')]){_0x445076[_0x74d4('0x44')]=_['merge'](_0x445076[_0x74d4('0x44')],{'$or':_[_0x74d4('0x46')](_0x445076[_0x74d4('0x39')],function(_0x267dc4){var _0xa42a6a={};_0xa42a6a[_0x267dc4]={'$like':'%'+_0x46e1ec[_0x74d4('0x37')][_0x74d4('0x43')]+'%'};return _0xa42a6a;})});}_0x445076=_[_0x74d4('0x45')]({},_0x445076,_0x46e1ec[_0x74d4('0x4a')]);return _0x185f00[_0x74d4('0x57')](_0x445076);}})[_0x74d4('0x1d')](function(_0x45f451){if(_0x45f451){_0x64eee6=_0x45f451[_0x74d4('0x3c')];if(!_0x46e1ec[_0x74d4('0x37')][_0x74d4('0x3d')](_0x74d4('0x3e'))){_0x445076[_0x74d4('0x3f')]=qs['limit'](_0x46e1ec['query'][_0x74d4('0x3f')]);_0x445076[_0x74d4('0x2b')]=qs['offset'](_0x46e1ec[_0x74d4('0x37')][_0x74d4('0x2b')]);}return _0x185f00['getSubjects'](_0x445076);}})[_0x74d4('0x1d')](function(_0x2e0761){if(_0x2e0761){return _0x2e0761?{'count':_0x64eee6,'rows':_0x2e0761}:null;}})[_0x74d4('0x1d')](respondWithResult(_0x5cd266,null))[_0x74d4('0x26')](handleError(_0x5cd266,null));};exports[_0x74d4('0x58')]=function(_0x32304b,_0x2d4166,_0x362bd9){var _0x25c1b8={};var _0x14ec59={};var _0x1c6372;var _0x455069;return db['SalesforceConfiguration'][_0x74d4('0x55')]({'where':{'id':_0x32304b[_0x74d4('0x50')]['id']}})[_0x74d4('0x1d')](handleEntityNotFound(_0x2d4166,null))[_0x74d4('0x1d')](function(_0x1fe7cf){if(_0x1fe7cf){_0x1c6372=_0x1fe7cf;_0x14ec59[_0x74d4('0x35')]=_[_0x74d4('0x36')](db[_0x74d4('0x56')][_0x74d4('0x51')]);_0x14ec59['query']=_[_0x74d4('0x36')](_0x32304b[_0x74d4('0x37')]);_0x14ec59['filters']=_[_0x74d4('0x3a')](_0x14ec59[_0x74d4('0x35')],_0x14ec59[_0x74d4('0x37')]);_0x25c1b8[_0x74d4('0x39')]=_[_0x74d4('0x3a')](_0x14ec59[_0x74d4('0x35')],qs[_0x74d4('0x3b')](_0x32304b[_0x74d4('0x37')][_0x74d4('0x3b')]));_0x25c1b8[_0x74d4('0x39')]=_0x25c1b8[_0x74d4('0x39')][_0x74d4('0x3c')]?_0x25c1b8[_0x74d4('0x39')]:_0x14ec59[_0x74d4('0x35')];_0x25c1b8[_0x74d4('0x40')]=qs[_0x74d4('0x41')](_0x32304b[_0x74d4('0x37')][_0x74d4('0x41')]);_0x25c1b8['where']=qs[_0x74d4('0x38')](_['pick'](_0x32304b[_0x74d4('0x37')],_0x14ec59[_0x74d4('0x38')]));if(_0x32304b[_0x74d4('0x37')]['filter']){_0x25c1b8[_0x74d4('0x44')]=_[_0x74d4('0x45')](_0x25c1b8[_0x74d4('0x44')],{'$or':_[_0x74d4('0x46')](_0x25c1b8['attributes'],function(_0x5a4a6a){var _0x1adc00={};_0x1adc00[_0x5a4a6a]={'$like':'%'+_0x32304b[_0x74d4('0x37')][_0x74d4('0x43')]+'%'};return _0x1adc00;})});}_0x25c1b8=_['merge']({},_0x25c1b8,_0x32304b['options']);return _0x1c6372[_0x74d4('0x58')](_0x25c1b8);}})['then'](function(_0x130427){if(_0x130427){_0x455069=_0x130427[_0x74d4('0x3c')];if(!_0x32304b['query'][_0x74d4('0x3d')]('nolimit')){_0x25c1b8[_0x74d4('0x3f')]=qs['limit'](_0x32304b[_0x74d4('0x37')]['limit']);_0x25c1b8[_0x74d4('0x2b')]=qs[_0x74d4('0x2b')](_0x32304b[_0x74d4('0x37')][_0x74d4('0x2b')]);}return _0x1c6372[_0x74d4('0x58')](_0x25c1b8);}})['then'](function(_0x1f1b25){if(_0x1f1b25){return _0x1f1b25?{'count':_0x455069,'rows':_0x1f1b25}:null;}})[_0x74d4('0x1d')](respondWithResult(_0x2d4166,null))['catch'](handleError(_0x2d4166,null));}; \ No newline at end of file +var _0x3799=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','stack','name','SalesforceConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','where','map','key','VIRTUAL','options','count','include','rows','params','includeAll','merge','find','create','update','body','destroy','getFields','SalesforceField','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5d4872,_0x461149){var _0x4e4949=function(_0x3e4fe7){while(--_0x3e4fe7){_0x5d4872['push'](_0x5d4872['shift']());}};_0x4e4949(++_0x461149);}(_0x3799,0x106));var _0x9379=function(_0x2235b0,_0x176c28){_0x2235b0=_0x2235b0-0x0;var _0x1b0041=_0x3799[_0x2235b0];return _0x1b0041;};'use strict';var pdf=require(_0x9379('0x0'));var emlformat=require(_0x9379('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9379('0x2'));var rp=require(_0x9379('0x3'));var moment=require(_0x9379('0x4'));var BPromise=require(_0x9379('0x5'));var Mustache=require(_0x9379('0x6'));var util=require(_0x9379('0x7'));var path=require(_0x9379('0x8'));var sox=require(_0x9379('0x9'));var csv=require(_0x9379('0xa'));var ejs=require(_0x9379('0xb'));var fs=require('fs');var _=require(_0x9379('0xc'));var squel=require(_0x9379('0xd'));var crypto=require(_0x9379('0xe'));var jsforce=require(_0x9379('0xf'));var deskjs=require(_0x9379('0x10'));var toCsv=require(_0x9379('0xa'));var querystring=require(_0x9379('0x11'));var Papa=require(_0x9379('0x12'));var Redis=require(_0x9379('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9379('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9379('0x15'))(_0x9379('0x16'));var utils=require(_0x9379('0x17'));var config=require(_0x9379('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9379('0x19'));var client=jayson[_0x9379('0x1a')][_0x9379('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x579a5a,_0x27fa08,_0x3e13e1){if(_0x3e13e1){var _0x4f9d66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f9d66[_0x9379('0x1c')](_0x27fa08)){return _0x579a5a;}else{throw new Error(_0x9379('0x1d'));}}else{return _0x579a5a;}}function respondWithRpcPromise(_0x513b55,_0x61c9cf,_0x37b8f9,_0x2613c8){return new BPromise(function(_0x1d53d2,_0x2de35f){var _0x21c638=_0x2613c8||client;return _0x21c638[_0x9379('0x1e')](_0x513b55,_0x37b8f9)[_0x9379('0x1f')](function(_0xc0a441){logger[_0x9379('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x61c9cf,'request\x20sent');logger[_0x9379('0x21')](_0x9379('0x22'),_0x61c9cf,_0x9379('0x23'),JSON['stringify'](_0xc0a441));if(_0xc0a441[_0x9379('0x24')]){if(_0xc0a441[_0x9379('0x24')][_0x9379('0x25')]===0x1f4){logger[_0x9379('0x24')](_0x9379('0x26'),_0x61c9cf,_0xc0a441['error']['message']);return _0x2de35f(_0xc0a441['error'][_0x9379('0x27')]);}logger[_0x9379('0x24')](_0x9379('0x26'),_0x61c9cf,_0xc0a441[_0x9379('0x24')]['message']);return _0x1d53d2(_0xc0a441[_0x9379('0x24')][_0x9379('0x27')]);}else{logger[_0x9379('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x61c9cf,_0x9379('0x23'));_0x1d53d2(_0xc0a441[_0x9379('0x28')][_0x9379('0x27')]);}})[_0x9379('0x29')](function(_0x214bee){logger[_0x9379('0x24')](_0x9379('0x26'),_0x61c9cf,_0x214bee);_0x2de35f(_0x214bee);});});}function respondWithStatusCode(_0x3cb47d,_0x40bbc6){_0x40bbc6=_0x40bbc6||0xcc;return function(_0x485623){if(_0x485623){return _0x3cb47d[_0x9379('0x2a')](_0x40bbc6);}return _0x3cb47d['status'](_0x40bbc6)[_0x9379('0x2b')]();};}function respondWithResult(_0x5b19fc,_0x1e3f5e){_0x1e3f5e=_0x1e3f5e||0xc8;return function(_0x3500ec){if(_0x3500ec){return _0x5b19fc[_0x9379('0x2c')](_0x1e3f5e)[_0x9379('0x2d')](_0x3500ec);}};}function respondWithFilteredResult(_0x5d65ad,_0x3e5dea){return function(_0x54f0a4){if(_0x54f0a4){var _0x1c401f=_0x54f0a4['count'],_0x44e04c=_0x3e5dea[_0x9379('0x2e')],_0xc0b654=_0x3e5dea[_0x9379('0x2e')]+_0x3e5dea['limit'],_0x24fa6c;if(_0xc0b654>=_0x1c401f){_0xc0b654=_0x1c401f;_0x24fa6c=0xc8;}else{_0x24fa6c=0xce;}_0x5d65ad[_0x9379('0x2c')](_0x24fa6c);return _0x5d65ad[_0x9379('0x2f')](_0x9379('0x30'),_0x44e04c+'-'+_0xc0b654+'/'+_0x1c401f)['json'](_0x54f0a4);}return null;};}function patchUpdates(_0xbd475b){return function(_0x5813d4){try{jsonpatch[_0x9379('0x31')](_0x5813d4,_0xbd475b,!![]);}catch(_0x3128d0){return BPromise[_0x9379('0x32')](_0x3128d0);}return _0x5813d4[_0x9379('0x33')]();};}function saveUpdates(_0x222c37,_0x129398){return function(_0x108895){if(_0x108895){return _0x108895['update'](_0x222c37)[_0x9379('0x1f')](function(_0x2b7375){return _0x2b7375;});}return null;};}function removeEntity(_0x2b7085,_0xb45bcc){return function(_0x215304){if(_0x215304){return _0x215304['destroy']()[_0x9379('0x1f')](function(){_0x2b7085[_0x9379('0x2c')](0xcc)[_0x9379('0x2b')]();});}};}function handleEntityNotFound(_0x504464,_0x2e4a55){return function(_0x5190c1){if(!_0x5190c1){_0x504464[_0x9379('0x2a')](0x194);}return _0x5190c1;};}function handleError(_0x403d43,_0x4c2861){_0x4c2861=_0x4c2861||0x1f4;return function(_0xce39e3){logger[_0x9379('0x24')](_0xce39e3[_0x9379('0x34')]);if(_0xce39e3[_0x9379('0x35')]){delete _0xce39e3['name'];}_0x403d43[_0x9379('0x2c')](_0x4c2861)['send'](_0xce39e3);};}exports['index']=function(_0x3a2a5b,_0x20db8a){var _0x5a239e={},_0x121a6c={},_0x47ef11={'count':0x0,'rows':[]};var _0x56f6b5=db[_0x9379('0x36')][_0x9379('0x37')];_0x121a6c[_0x9379('0x38')]=_[_0x9379('0x39')](_0x56f6b5);_0x121a6c[_0x9379('0x3a')]=_[_0x9379('0x39')](_0x3a2a5b[_0x9379('0x3a')]);_0x121a6c[_0x9379('0x3b')]=_['intersection'](_0x121a6c[_0x9379('0x38')],_0x121a6c[_0x9379('0x3a')]);_0x5a239e['attributes']=_[_0x9379('0x3c')](_0x121a6c[_0x9379('0x38')],qs[_0x9379('0x3d')](_0x3a2a5b['query']['fields']));_0x5a239e[_0x9379('0x3e')]=_0x5a239e[_0x9379('0x3e')][_0x9379('0x3f')]?_0x5a239e['attributes']:_0x121a6c['model'];if(!_0x3a2a5b['query']['hasOwnProperty'](_0x9379('0x40'))){_0x5a239e[_0x9379('0x41')]=qs[_0x9379('0x41')](_0x3a2a5b[_0x9379('0x3a')][_0x9379('0x41')]);_0x5a239e[_0x9379('0x2e')]=qs[_0x9379('0x2e')](_0x3a2a5b[_0x9379('0x3a')][_0x9379('0x2e')]);}_0x5a239e[_0x9379('0x42')]=qs['sort'](_0x3a2a5b[_0x9379('0x3a')][_0x9379('0x43')]);_0x5a239e['where']=qs[_0x9379('0x3b')](_['pick'](_0x3a2a5b[_0x9379('0x3a')],_0x121a6c[_0x9379('0x3b')]));if(_0x3a2a5b[_0x9379('0x3a')][_0x9379('0x44')]){_0x5a239e[_0x9379('0x45')]=_['merge'](_0x5a239e[_0x9379('0x45')],{'$or':_[_0x9379('0x46')](_0x56f6b5,function(_0x7eba51){if(_0x7eba51['type'][_0x9379('0x47')]!==_0x9379('0x48')){var _0x4bf848={};_0x4bf848[_0x7eba51['field']]={'$like':'%'+_0x3a2a5b['query'][_0x9379('0x44')]+'%'};return _0x4bf848;}})});}_0x5a239e=_['merge']({},_0x5a239e,_0x3a2a5b[_0x9379('0x49')]);var _0x1ac262={'where':_0x5a239e['where']};return db[_0x9379('0x36')][_0x9379('0x4a')](_0x1ac262)[_0x9379('0x1f')](function(_0x22d2aa){_0x47ef11[_0x9379('0x4a')]=_0x22d2aa;if(_0x3a2a5b[_0x9379('0x3a')]['includeAll']){_0x5a239e[_0x9379('0x4b')]=[{'all':!![]}];}return db[_0x9379('0x36')]['findAll'](_0x5a239e);})[_0x9379('0x1f')](function(_0x5adb8c){_0x47ef11[_0x9379('0x4c')]=_0x5adb8c;return _0x47ef11;})[_0x9379('0x1f')](respondWithFilteredResult(_0x20db8a,_0x5a239e))['catch'](handleError(_0x20db8a,null));};exports['show']=function(_0x108025,_0x25cdf6){var _0xf64d51={'raw':![],'where':{'id':_0x108025[_0x9379('0x4d')]['id']}},_0x524caa={};_0x524caa[_0x9379('0x38')]=_[_0x9379('0x39')](db[_0x9379('0x36')]['rawAttributes']);_0x524caa[_0x9379('0x3a')]=_[_0x9379('0x39')](_0x108025[_0x9379('0x3a')]);_0x524caa['filters']=_[_0x9379('0x3c')](_0x524caa['model'],_0x524caa[_0x9379('0x3a')]);_0xf64d51[_0x9379('0x3e')]=_[_0x9379('0x3c')](_0x524caa['model'],qs[_0x9379('0x3d')](_0x108025['query'][_0x9379('0x3d')]));_0xf64d51[_0x9379('0x3e')]=_0xf64d51[_0x9379('0x3e')]['length']?_0xf64d51['attributes']:_0x524caa[_0x9379('0x38')];if(_0x108025[_0x9379('0x3a')][_0x9379('0x4e')]){_0xf64d51[_0x9379('0x4b')]=[{'all':!![]}];}_0xf64d51=_[_0x9379('0x4f')]({},_0xf64d51,_0x108025[_0x9379('0x49')]);return db['SalesforceConfiguration'][_0x9379('0x50')](_0xf64d51)[_0x9379('0x1f')](handleEntityNotFound(_0x25cdf6,null))[_0x9379('0x1f')](respondWithResult(_0x25cdf6,null))[_0x9379('0x29')](handleError(_0x25cdf6,null));};exports['create']=function(_0x3848a1,_0x4f02fe){return db[_0x9379('0x36')][_0x9379('0x51')](_0x3848a1['body'],{})[_0x9379('0x1f')](respondWithResult(_0x4f02fe,0xc9))[_0x9379('0x29')](handleError(_0x4f02fe,null));};exports[_0x9379('0x52')]=function(_0x189ca1,_0x3e8302){if(_0x189ca1[_0x9379('0x53')]['id']){delete _0x189ca1[_0x9379('0x53')]['id'];}return db[_0x9379('0x36')][_0x9379('0x50')]({'where':{'id':_0x189ca1[_0x9379('0x4d')]['id']}})[_0x9379('0x1f')](handleEntityNotFound(_0x3e8302,null))[_0x9379('0x1f')](saveUpdates(_0x189ca1['body'],null))[_0x9379('0x1f')](respondWithResult(_0x3e8302,null))[_0x9379('0x29')](handleError(_0x3e8302,null));};exports[_0x9379('0x54')]=function(_0x57b81a,_0xf0fc29){return db[_0x9379('0x36')][_0x9379('0x50')]({'where':{'id':_0x57b81a['params']['id']}})[_0x9379('0x1f')](handleEntityNotFound(_0xf0fc29,null))[_0x9379('0x1f')](removeEntity(_0xf0fc29,null))[_0x9379('0x29')](handleError(_0xf0fc29,null));};exports[_0x9379('0x55')]=function(_0x1f77dd,_0x53f32e,_0x147ce7){var _0xb5b732={};var _0x4d7e67={};var _0x1bc050;var _0x44cdb7;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1f77dd[_0x9379('0x4d')]['id']}})['then'](handleEntityNotFound(_0x53f32e,null))[_0x9379('0x1f')](function(_0x17d67b){if(_0x17d67b){_0x1bc050=_0x17d67b;_0x4d7e67[_0x9379('0x38')]=_['keys'](db[_0x9379('0x56')]['rawAttributes']);_0x4d7e67[_0x9379('0x3a')]=_['keys'](_0x1f77dd[_0x9379('0x3a')]);_0x4d7e67['filters']=_[_0x9379('0x3c')](_0x4d7e67[_0x9379('0x38')],_0x4d7e67[_0x9379('0x3a')]);_0xb5b732[_0x9379('0x3e')]=_[_0x9379('0x3c')](_0x4d7e67[_0x9379('0x38')],qs['fields'](_0x1f77dd[_0x9379('0x3a')][_0x9379('0x3d')]));_0xb5b732[_0x9379('0x3e')]=_0xb5b732['attributes'][_0x9379('0x3f')]?_0xb5b732[_0x9379('0x3e')]:_0x4d7e67['model'];_0xb5b732['order']=qs[_0x9379('0x43')](_0x1f77dd[_0x9379('0x3a')]['sort']);_0xb5b732[_0x9379('0x45')]=qs[_0x9379('0x3b')](_[_0x9379('0x57')](_0x1f77dd['query'],_0x4d7e67[_0x9379('0x3b')]));if(_0x1f77dd[_0x9379('0x3a')][_0x9379('0x44')]){_0xb5b732[_0x9379('0x45')]=_['merge'](_0xb5b732[_0x9379('0x45')],{'$or':_[_0x9379('0x46')](_0xb5b732[_0x9379('0x3e')],function(_0x320b49){var _0x4e0939={};_0x4e0939[_0x320b49]={'$like':'%'+_0x1f77dd[_0x9379('0x3a')][_0x9379('0x44')]+'%'};return _0x4e0939;})});}_0xb5b732=_[_0x9379('0x4f')]({},_0xb5b732,_0x1f77dd[_0x9379('0x49')]);return _0x1bc050[_0x9379('0x55')](_0xb5b732);}})['then'](function(_0x646277){if(_0x646277){_0x44cdb7=_0x646277[_0x9379('0x3f')];if(!_0x1f77dd[_0x9379('0x3a')][_0x9379('0x58')]('nolimit')){_0xb5b732[_0x9379('0x41')]=qs['limit'](_0x1f77dd[_0x9379('0x3a')][_0x9379('0x41')]);_0xb5b732[_0x9379('0x2e')]=qs['offset'](_0x1f77dd['query'][_0x9379('0x2e')]);}return _0x1bc050['getFields'](_0xb5b732);}})[_0x9379('0x1f')](function(_0x5dac5a){if(_0x5dac5a){return _0x5dac5a?{'count':_0x44cdb7,'rows':_0x5dac5a}:null;}})[_0x9379('0x1f')](respondWithResult(_0x53f32e,null))['catch'](handleError(_0x53f32e,null));};exports['getSubjects']=function(_0x133aca,_0x4102bb,_0x468a0f){var _0x37d0b7={};var _0x1d541b={};var _0x37daf5;var _0x3877bc;return db[_0x9379('0x36')]['findOne']({'where':{'id':_0x133aca[_0x9379('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4102bb,null))[_0x9379('0x1f')](function(_0x2c5a1c){if(_0x2c5a1c){_0x37daf5=_0x2c5a1c;_0x1d541b[_0x9379('0x38')]=_[_0x9379('0x39')](db['SalesforceField'][_0x9379('0x37')]);_0x1d541b['query']=_[_0x9379('0x39')](_0x133aca[_0x9379('0x3a')]);_0x1d541b['filters']=_[_0x9379('0x3c')](_0x1d541b[_0x9379('0x38')],_0x1d541b['query']);_0x37d0b7[_0x9379('0x3e')]=_[_0x9379('0x3c')](_0x1d541b['model'],qs['fields'](_0x133aca[_0x9379('0x3a')][_0x9379('0x3d')]));_0x37d0b7[_0x9379('0x3e')]=_0x37d0b7[_0x9379('0x3e')]['length']?_0x37d0b7[_0x9379('0x3e')]:_0x1d541b[_0x9379('0x38')];_0x37d0b7['order']=qs[_0x9379('0x43')](_0x133aca['query'][_0x9379('0x43')]);_0x37d0b7[_0x9379('0x45')]=qs[_0x9379('0x3b')](_['pick'](_0x133aca['query'],_0x1d541b['filters']));if(_0x133aca[_0x9379('0x3a')][_0x9379('0x44')]){_0x37d0b7[_0x9379('0x45')]=_[_0x9379('0x4f')](_0x37d0b7[_0x9379('0x45')],{'$or':_[_0x9379('0x46')](_0x37d0b7[_0x9379('0x3e')],function(_0xece458){var _0xffe71={};_0xffe71[_0xece458]={'$like':'%'+_0x133aca[_0x9379('0x3a')][_0x9379('0x44')]+'%'};return _0xffe71;})});}_0x37d0b7=_[_0x9379('0x4f')]({},_0x37d0b7,_0x133aca['options']);return _0x37daf5[_0x9379('0x59')](_0x37d0b7);}})[_0x9379('0x1f')](function(_0x3d3628){if(_0x3d3628){_0x3877bc=_0x3d3628['length'];if(!_0x133aca[_0x9379('0x3a')][_0x9379('0x58')](_0x9379('0x40'))){_0x37d0b7[_0x9379('0x41')]=qs[_0x9379('0x41')](_0x133aca[_0x9379('0x3a')][_0x9379('0x41')]);_0x37d0b7['offset']=qs['offset'](_0x133aca['query']['offset']);}return _0x37daf5['getSubjects'](_0x37d0b7);}})[_0x9379('0x1f')](function(_0x4d53dd){if(_0x4d53dd){return _0x4d53dd?{'count':_0x3877bc,'rows':_0x4d53dd}:null;}})['then'](respondWithResult(_0x4102bb,null))[_0x9379('0x29')](handleError(_0x4102bb,null));};exports[_0x9379('0x5a')]=function(_0xe955f8,_0x5c2486,_0x554c32){var _0x30e337={};var _0x296b85={};var _0x839899;var _0x3cd0fb;return db[_0x9379('0x36')]['findOne']({'where':{'id':_0xe955f8['params']['id']}})[_0x9379('0x1f')](handleEntityNotFound(_0x5c2486,null))[_0x9379('0x1f')](function(_0x387388){if(_0x387388){_0x839899=_0x387388;_0x296b85['model']=_[_0x9379('0x39')](db[_0x9379('0x56')]['rawAttributes']);_0x296b85[_0x9379('0x3a')]=_[_0x9379('0x39')](_0xe955f8[_0x9379('0x3a')]);_0x296b85['filters']=_['intersection'](_0x296b85[_0x9379('0x38')],_0x296b85[_0x9379('0x3a')]);_0x30e337['attributes']=_[_0x9379('0x3c')](_0x296b85['model'],qs[_0x9379('0x3d')](_0xe955f8[_0x9379('0x3a')][_0x9379('0x3d')]));_0x30e337[_0x9379('0x3e')]=_0x30e337[_0x9379('0x3e')]['length']?_0x30e337['attributes']:_0x296b85[_0x9379('0x38')];_0x30e337[_0x9379('0x42')]=qs[_0x9379('0x43')](_0xe955f8[_0x9379('0x3a')][_0x9379('0x43')]);_0x30e337['where']=qs[_0x9379('0x3b')](_[_0x9379('0x57')](_0xe955f8[_0x9379('0x3a')],_0x296b85['filters']));if(_0xe955f8[_0x9379('0x3a')][_0x9379('0x44')]){_0x30e337['where']=_[_0x9379('0x4f')](_0x30e337[_0x9379('0x45')],{'$or':_[_0x9379('0x46')](_0x30e337[_0x9379('0x3e')],function(_0xd44f74){var _0x23ea82={};_0x23ea82[_0xd44f74]={'$like':'%'+_0xe955f8[_0x9379('0x3a')][_0x9379('0x44')]+'%'};return _0x23ea82;})});}_0x30e337=_[_0x9379('0x4f')]({},_0x30e337,_0xe955f8[_0x9379('0x49')]);return _0x839899['getDescriptions'](_0x30e337);}})[_0x9379('0x1f')](function(_0x4b19d9){if(_0x4b19d9){_0x3cd0fb=_0x4b19d9['length'];if(!_0xe955f8[_0x9379('0x3a')][_0x9379('0x58')]('nolimit')){_0x30e337[_0x9379('0x41')]=qs[_0x9379('0x41')](_0xe955f8[_0x9379('0x3a')]['limit']);_0x30e337[_0x9379('0x2e')]=qs[_0x9379('0x2e')](_0xe955f8['query'][_0x9379('0x2e')]);}return _0x839899['getDescriptions'](_0x30e337);}})[_0x9379('0x1f')](function(_0x45ad2b){if(_0x45ad2b){return _0x45ad2b?{'count':_0x3cd0fb,'rows':_0x45ad2b}:null;}})[_0x9379('0x1f')](respondWithResult(_0x5c2486,null))['catch'](handleError(_0x5c2486,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9f8cd10..c5e4957 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 _0x3e1b=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x233eab,_0x5c910f){var _0x288cc3=function(_0x399690){while(--_0x399690){_0x233eab['push'](_0x233eab['shift']());}};_0x288cc3(++_0x5c910f);}(_0x3e1b,0x6c));var _0xb3e1=function(_0x1380f7,_0x23614a){_0x1380f7=_0x1380f7-0x0;var _0x12c94b=_0x3e1b[_0x1380f7];return _0x12c94b;};'use strict';var _=require(_0xb3e1('0x0'));var util=require(_0xb3e1('0x1'));var logger=require(_0xb3e1('0x2'))('api');var moment=require(_0xb3e1('0x3'));var BPromise=require(_0xb3e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3e1('0x5'));var rimraf=require(_0xb3e1('0x6'));var config=require(_0xb3e1('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb3e1('0x8')]=function(_0x456439,_0x46d8f1){return _0x456439['define'](_0xb3e1('0x9'),attributes,{'tableName':_0xb3e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfbb=['path','rimraf','SalesforceConfiguration','api','request-promise'];(function(_0x33860a,_0x49ce3c){var _0x2a8aaa=function(_0x5c6b75){while(--_0x5c6b75){_0x33860a['push'](_0x33860a['shift']());}};_0x2a8aaa(++_0x49ce3c);}(_0xcfbb,0x116));var _0xbcfb=function(_0x3c989b,_0x53999a){_0x3c989b=_0x3c989b-0x0;var _0x1c68d2=_0xcfbb[_0x3c989b];return _0x1c68d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbcfb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbcfb('0x1'));var fs=require('fs');var path=require(_0xbcfb('0x2'));var rimraf=require(_0xbcfb('0x3'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x48ce4a,_0x299cb4){return _0x48ce4a['define'](_0xbcfb('0x4'),attributes,{'tableName':'int_salesforce_configurations','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 60bce33..a7fa502 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 _0x1261=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x41b234,_0x3852a3){var _0x1a8ec9=function(_0x449e68){while(--_0x449e68){_0x41b234['push'](_0x41b234['shift']());}};_0x1a8ec9(++_0x3852a3);}(_0x1261,0x144));var _0x1126=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0x1261[_0x1b9cd5];return _0x4c74ca;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e6428d5..0b252a4 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 _0x79a3=['/:id','post','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x79a3,0x1f4));var _0x379a=function(_0x1bd251,_0x338d85){_0x1bd251=_0x1bd251-0x0;var _0x29ef4c=_0x79a3[_0x1bd251];return _0x29ef4c;};'use strict';var multer=require(_0x379a('0x0'));var util=require(_0x379a('0x1'));var path=require('path');var timeout=require(_0x379a('0x2'));var express=require('express');var router=express[_0x379a('0x3')]();var auth=require(_0x379a('0x4'));var interaction=require(_0x379a('0x5'));var config=require(_0x379a('0x6'));var controller=require(_0x379a('0x7'));router[_0x379a('0x8')]('/',auth['isAuthenticated'](),controller[_0x379a('0x9')]);router[_0x379a('0x8')](_0x379a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x379a('0xb')]('/',auth[_0x379a('0xc')](),controller['create']);router['put'](_0x379a('0xa'),auth[_0x379a('0xc')](),controller[_0x379a('0xd')]);router[_0x379a('0xe')](_0x379a('0xa'),auth['isAuthenticated'](),controller[_0x379a('0xf')]);module[_0x379a('0x10')]=router; \ No newline at end of file +var _0xc53c=['/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put'];(function(_0x4131c2,_0x26ccce){var _0x1ca43f=function(_0x1dc3e7){while(--_0x1dc3e7){_0x4131c2['push'](_0x4131c2['shift']());}};_0x1ca43f(++_0x26ccce);}(_0xc53c,0x1c6));var _0xcc53=function(_0x5ebf27,_0x4514e0){_0x5ebf27=_0x5ebf27-0x0;var _0x121c72=_0xc53c[_0x5ebf27];return _0x121c72;};'use strict';var multer=require(_0xcc53('0x0'));var util=require(_0xcc53('0x1'));var path=require(_0xcc53('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc53('0x3'));var router=express[_0xcc53('0x4')]();var auth=require(_0xcc53('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc53('0x6'));var controller=require(_0xcc53('0x7'));router[_0xcc53('0x8')]('/',auth[_0xcc53('0x9')](),controller[_0xcc53('0xa')]);router[_0xcc53('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcc53('0xb')]);router['post']('/',auth[_0xcc53('0x9')](),controller[_0xcc53('0xc')]);router[_0xcc53('0xd')](_0xcc53('0xe'),auth['isAuthenticated'](),controller[_0xcc53('0xf')]);router['delete'](_0xcc53('0xe'),auth[_0xcc53('0x9')](),controller[_0xcc53('0x10')]);module[_0xcc53('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 3fae334..81fd69c 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 _0x7492=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x5b7db1,_0x43492f){var _0x2d9a57=function(_0x3a2154){while(--_0x3a2154){_0x5b7db1['push'](_0x5b7db1['shift']());}};_0x2d9a57(++_0x43492f);}(_0x7492,0x175));var _0x2749=function(_0x3a162e,_0x2b1d7b){_0x3a162e=_0x3a162e-0x0;var _0x915ad=_0x7492[_0x3a162e];return _0x915ad;};'use strict';var Sequelize=require(_0x2749('0x0'));module[_0x2749('0x1')]={'type':{'type':Sequelize[_0x2749('0x2')](_0x2749('0x3'),_0x2749('0x4'),_0x2749('0x5'),_0x2749('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2749('0x7')]},'key':{'type':Sequelize[_0x2749('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2749('0x3'),_0x2749('0x4'),_0x2749('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2749('0x7')]},'variableName':{'type':Sequelize[_0x2749('0x7')]}}; \ No newline at end of file +var _0xfc1e=['variable','customVariable','STRING','sequelize','exports','ENUM','string'];(function(_0xf1f37e,_0x159a20){var _0x2e3a6d=function(_0x4163cd){while(--_0x4163cd){_0xf1f37e['push'](_0xf1f37e['shift']());}};_0x2e3a6d(++_0x159a20);}(_0xfc1e,0x6c));var _0xefc1=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0xfc1e[_0x1aed80];return _0x43961e;};'use strict';var Sequelize=require(_0xefc1('0x0'));module[_0xefc1('0x1')]={'type':{'type':Sequelize[_0xefc1('0x2')](_0xefc1('0x3'),_0xefc1('0x4'),_0xefc1('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xefc1('0x6')]},'key':{'type':Sequelize[_0xefc1('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xefc1('0x3'),_0xefc1('0x4'),_0xefc1('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xefc1('0x6')]},'variableName':{'type':Sequelize[_0xefc1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index eb357bd..99531ff 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 _0x6011=['include','find','create','body','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','field','options','SalesforceField','count','findAll','rows','catch','show','params','includeAll'];(function(_0x19e3c9,_0x2fb0c3){var _0x377fc9=function(_0x5bd928){while(--_0x5bd928){_0x19e3c9['push'](_0x19e3c9['shift']());}};_0x377fc9(++_0x2fb0c3);}(_0x6011,0x196));var _0x1601=function(_0x1ec1e5,_0x5e968a){_0x1ec1e5=_0x1ec1e5-0x0;var _0x393ca2=_0x6011[_0x1ec1e5];return _0x393ca2;};'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(_0x1601('0x0'));var moment=require(_0x1601('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1601('0x2'));var util=require(_0x1601('0x3'));var path=require(_0x1601('0x4'));var sox=require(_0x1601('0x5'));var csv=require(_0x1601('0x6'));var ejs=require(_0x1601('0x7'));var fs=require('fs');var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x6'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1601('0x10'));var utils=require('../../config/utils');var config=require(_0x1601('0x11'));var db=require(_0x1601('0x12'))['db'];function respondWithStatusCode(_0x14db9f,_0x24cc39){_0x24cc39=_0x24cc39||0xcc;return function(_0x263bef){if(_0x263bef){return _0x14db9f[_0x1601('0x13')](_0x24cc39);}return _0x14db9f[_0x1601('0x14')](_0x24cc39)[_0x1601('0x15')]();};}function respondWithResult(_0x5da646,_0x11bbe5){_0x11bbe5=_0x11bbe5||0xc8;return function(_0x555d4f){if(_0x555d4f){return _0x5da646[_0x1601('0x14')](_0x11bbe5)['json'](_0x555d4f);}};}function respondWithFilteredResult(_0x2f0837,_0x3b6554){return function(_0x4bb5c1){if(_0x4bb5c1){var _0x1b40be=_0x4bb5c1['count'],_0x39873a=_0x3b6554[_0x1601('0x16')],_0x12ddb0=_0x3b6554[_0x1601('0x16')]+_0x3b6554[_0x1601('0x17')],_0x595c96;if(_0x12ddb0>=_0x1b40be){_0x12ddb0=_0x1b40be;_0x595c96=0xc8;}else{_0x595c96=0xce;}_0x2f0837[_0x1601('0x14')](_0x595c96);return _0x2f0837[_0x1601('0x18')](_0x1601('0x19'),_0x39873a+'-'+_0x12ddb0+'/'+_0x1b40be)[_0x1601('0x1a')](_0x4bb5c1);}return null;};}function patchUpdates(_0x3ae0c6){return function(_0x1ce2b2){try{jsonpatch['apply'](_0x1ce2b2,_0x3ae0c6,!![]);}catch(_0x4d077e){return BPromise[_0x1601('0x1b')](_0x4d077e);}return _0x1ce2b2[_0x1601('0x1c')]();};}function saveUpdates(_0xb09057,_0x5bd8fb){return function(_0x2c3b5d){if(_0x2c3b5d){return _0x2c3b5d[_0x1601('0x1d')](_0xb09057)[_0x1601('0x1e')](function(_0x2e2e0d){return _0x2e2e0d;});}return null;};}function removeEntity(_0x3fa19f,_0x54398a){return function(_0x1b8314){if(_0x1b8314){return _0x1b8314[_0x1601('0x1f')]()[_0x1601('0x1e')](function(){_0x3fa19f['status'](0xcc)[_0x1601('0x15')]();});}};}function handleEntityNotFound(_0x330033,_0x4f918b){return function(_0x2b01da){if(!_0x2b01da){_0x330033[_0x1601('0x13')](0x194);}return _0x2b01da;};}function handleError(_0x5c9543,_0x5ae062){_0x5ae062=_0x5ae062||0x1f4;return function(_0x65fb4f){logger[_0x1601('0x20')](_0x65fb4f[_0x1601('0x21')]);if(_0x65fb4f['name']){delete _0x65fb4f[_0x1601('0x22')];}_0x5c9543[_0x1601('0x14')](_0x5ae062)[_0x1601('0x23')](_0x65fb4f);};}exports[_0x1601('0x24')]=function(_0x296c34,_0x47ed39){var _0x4b2f0d={},_0x1fa0a6={},_0x1aef35={'count':0x0,'rows':[]};var _0x18509c=db['SalesforceField'][_0x1601('0x25')];_0x1fa0a6['model']=_[_0x1601('0x26')](_0x18509c);_0x1fa0a6[_0x1601('0x27')]=_[_0x1601('0x26')](_0x296c34['query']);_0x1fa0a6[_0x1601('0x28')]=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],_0x1fa0a6[_0x1601('0x27')]);_0x4b2f0d['attributes']=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],qs[_0x1601('0x2b')](_0x296c34[_0x1601('0x27')][_0x1601('0x2b')]));_0x4b2f0d[_0x1601('0x2c')]=_0x4b2f0d[_0x1601('0x2c')][_0x1601('0x2d')]?_0x4b2f0d[_0x1601('0x2c')]:_0x1fa0a6[_0x1601('0x2a')];if(!_0x296c34[_0x1601('0x27')][_0x1601('0x2e')](_0x1601('0x2f'))){_0x4b2f0d['limit']=qs[_0x1601('0x17')](_0x296c34[_0x1601('0x27')][_0x1601('0x17')]);_0x4b2f0d[_0x1601('0x16')]=qs[_0x1601('0x16')](_0x296c34['query'][_0x1601('0x16')]);}_0x4b2f0d[_0x1601('0x30')]=qs['sort'](_0x296c34[_0x1601('0x27')]['sort']);_0x4b2f0d[_0x1601('0x31')]=qs[_0x1601('0x28')](_['pick'](_0x296c34[_0x1601('0x27')],_0x1fa0a6[_0x1601('0x28')]));if(_0x296c34[_0x1601('0x27')][_0x1601('0x32')]){_0x4b2f0d[_0x1601('0x31')]=_[_0x1601('0x33')](_0x4b2f0d[_0x1601('0x31')],{'$or':_['map'](_0x18509c,function(_0x39da55){if(_0x39da55[_0x1601('0x34')]['key']!=='VIRTUAL'){var _0x431439={};_0x431439[_0x39da55[_0x1601('0x35')]]={'$like':'%'+_0x296c34[_0x1601('0x27')][_0x1601('0x32')]+'%'};return _0x431439;}})});}_0x4b2f0d=_[_0x1601('0x33')]({},_0x4b2f0d,_0x296c34[_0x1601('0x36')]);var _0x36d496={'where':_0x4b2f0d['where']};return db[_0x1601('0x37')][_0x1601('0x38')](_0x36d496)['then'](function(_0x5c79d2){_0x1aef35[_0x1601('0x38')]=_0x5c79d2;if(_0x296c34['query']['includeAll']){_0x4b2f0d['include']=[{'all':!![]}];}return db[_0x1601('0x37')][_0x1601('0x39')](_0x4b2f0d);})[_0x1601('0x1e')](function(_0xb8146e){_0x1aef35[_0x1601('0x3a')]=_0xb8146e;return _0x1aef35;})[_0x1601('0x1e')](respondWithFilteredResult(_0x47ed39,_0x4b2f0d))[_0x1601('0x3b')](handleError(_0x47ed39,null));};exports[_0x1601('0x3c')]=function(_0x388f3b,_0x2b829a){var _0x3cc562={'raw':!![],'where':{'id':_0x388f3b[_0x1601('0x3d')]['id']}},_0x3acb2d={};_0x3acb2d['model']=_[_0x1601('0x26')](db['SalesforceField']['rawAttributes']);_0x3acb2d['query']=_[_0x1601('0x26')](_0x388f3b[_0x1601('0x27')]);_0x3acb2d[_0x1601('0x28')]=_['intersection'](_0x3acb2d['model'],_0x3acb2d[_0x1601('0x27')]);_0x3cc562[_0x1601('0x2c')]=_[_0x1601('0x29')](_0x3acb2d['model'],qs[_0x1601('0x2b')](_0x388f3b['query'][_0x1601('0x2b')]));_0x3cc562[_0x1601('0x2c')]=_0x3cc562[_0x1601('0x2c')][_0x1601('0x2d')]?_0x3cc562['attributes']:_0x3acb2d[_0x1601('0x2a')];if(_0x388f3b['query'][_0x1601('0x3e')]){_0x3cc562[_0x1601('0x3f')]=[{'all':!![]}];}_0x3cc562=_['merge']({},_0x3cc562,_0x388f3b[_0x1601('0x36')]);return db[_0x1601('0x37')][_0x1601('0x40')](_0x3cc562)['then'](handleEntityNotFound(_0x2b829a,null))[_0x1601('0x1e')](respondWithResult(_0x2b829a,null))['catch'](handleError(_0x2b829a,null));};exports[_0x1601('0x41')]=function(_0x2391a1,_0x419e97){return db[_0x1601('0x37')][_0x1601('0x41')](_0x2391a1[_0x1601('0x42')],{})[_0x1601('0x1e')](respondWithResult(_0x419e97,0xc9))[_0x1601('0x3b')](handleError(_0x419e97,null));};exports[_0x1601('0x1d')]=function(_0x4a710f,_0x143c82){if(_0x4a710f['body']['id']){delete _0x4a710f[_0x1601('0x42')]['id'];}return db[_0x1601('0x37')]['find']({'where':{'id':_0x4a710f[_0x1601('0x3d')]['id']}})[_0x1601('0x1e')](handleEntityNotFound(_0x143c82,null))['then'](saveUpdates(_0x4a710f[_0x1601('0x42')],null))[_0x1601('0x1e')](respondWithResult(_0x143c82,null))[_0x1601('0x3b')](handleError(_0x143c82,null));};exports[_0x1601('0x1f')]=function(_0x30f2bf,_0xf14c98){return db[_0x1601('0x37')][_0x1601('0x40')]({'where':{'id':_0x30f2bf[_0x1601('0x3d')]['id']}})[_0x1601('0x1e')](handleEntityNotFound(_0xf14c98,null))['then'](removeEntity(_0xf14c98,null))[_0x1601('0x3b')](handleError(_0xf14c98,null));}; \ No newline at end of file +var _0xeff8=['destroy','error','stack','name','send','index','SalesforceField','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filters','filter','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xeff8,0x186));var _0x8eff=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xeff8[_0x10df18];return _0x1f9a1d;};'use strict';var pdf=require(_0x8eff('0x0'));var emlformat=require(_0x8eff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8eff('0x2'));var jsonpatch=require(_0x8eff('0x3'));var rp=require(_0x8eff('0x4'));var moment=require('moment');var BPromise=require(_0x8eff('0x5'));var Mustache=require(_0x8eff('0x6'));var util=require(_0x8eff('0x7'));var path=require(_0x8eff('0x8'));var sox=require('sox');var csv=require(_0x8eff('0x9'));var ejs=require(_0x8eff('0xa'));var fs=require('fs');var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0x9'));var querystring=require(_0x8eff('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x10'));var qs=require(_0x8eff('0x11'));var hardwareService=require(_0x8eff('0x12'));var logger=require('../../config/logger')(_0x8eff('0x13'));var utils=require(_0x8eff('0x14'));var config=require('../../config/environment');var db=require(_0x8eff('0x15'))['db'];function respondWithStatusCode(_0x271044,_0x559143){_0x559143=_0x559143||0xcc;return function(_0x4a399e){if(_0x4a399e){return _0x271044[_0x8eff('0x16')](_0x559143);}return _0x271044[_0x8eff('0x17')](_0x559143)[_0x8eff('0x18')]();};}function respondWithResult(_0x42fb24,_0x1349cb){_0x1349cb=_0x1349cb||0xc8;return function(_0x56efdf){if(_0x56efdf){return _0x42fb24[_0x8eff('0x17')](_0x1349cb)[_0x8eff('0x19')](_0x56efdf);}};}function respondWithFilteredResult(_0x372ee8,_0x1af3d6){return function(_0x228eb1){if(_0x228eb1){var _0x4cfc91=_0x228eb1[_0x8eff('0x1a')],_0x16202e=_0x1af3d6[_0x8eff('0x1b')],_0xdbb753=_0x1af3d6['offset']+_0x1af3d6[_0x8eff('0x1c')],_0x16a4eb;if(_0xdbb753>=_0x4cfc91){_0xdbb753=_0x4cfc91;_0x16a4eb=0xc8;}else{_0x16a4eb=0xce;}_0x372ee8[_0x8eff('0x17')](_0x16a4eb);return _0x372ee8[_0x8eff('0x1d')](_0x8eff('0x1e'),_0x16202e+'-'+_0xdbb753+'/'+_0x4cfc91)[_0x8eff('0x19')](_0x228eb1);}return null;};}function patchUpdates(_0x3c800b){return function(_0x38f5ee){try{jsonpatch[_0x8eff('0x1f')](_0x38f5ee,_0x3c800b,!![]);}catch(_0x1b003c){return BPromise[_0x8eff('0x20')](_0x1b003c);}return _0x38f5ee[_0x8eff('0x21')]();};}function saveUpdates(_0x1b65f9,_0x1e9ad0){return function(_0x2a7337){if(_0x2a7337){return _0x2a7337[_0x8eff('0x22')](_0x1b65f9)[_0x8eff('0x23')](function(_0x5e157c){return _0x5e157c;});}return null;};}function removeEntity(_0x1ca2e6,_0x4d3e84){return function(_0x5a2492){if(_0x5a2492){return _0x5a2492[_0x8eff('0x24')]()['then'](function(){_0x1ca2e6[_0x8eff('0x17')](0xcc)[_0x8eff('0x18')]();});}};}function handleEntityNotFound(_0x1ccc79,_0x59cc32){return function(_0x1ee09c){if(!_0x1ee09c){_0x1ccc79['sendStatus'](0x194);}return _0x1ee09c;};}function handleError(_0x179814,_0x350927){_0x350927=_0x350927||0x1f4;return function(_0x50784c){logger[_0x8eff('0x25')](_0x50784c[_0x8eff('0x26')]);if(_0x50784c[_0x8eff('0x27')]){delete _0x50784c[_0x8eff('0x27')];}_0x179814[_0x8eff('0x17')](_0x350927)[_0x8eff('0x28')](_0x50784c);};}exports[_0x8eff('0x29')]=function(_0x2e8067,_0x516173){var _0x3e1607={},_0x323ffa={},_0x15083c={'count':0x0,'rows':[]};var _0xb88ce9=db[_0x8eff('0x2a')][_0x8eff('0x2b')];_0x323ffa['model']=_['keys'](_0xb88ce9);_0x323ffa[_0x8eff('0x2c')]=_[_0x8eff('0x2d')](_0x2e8067[_0x8eff('0x2c')]);_0x323ffa['filters']=_[_0x8eff('0x2e')](_0x323ffa[_0x8eff('0x2f')],_0x323ffa[_0x8eff('0x2c')]);_0x3e1607[_0x8eff('0x30')]=_[_0x8eff('0x2e')](_0x323ffa[_0x8eff('0x2f')],qs[_0x8eff('0x31')](_0x2e8067[_0x8eff('0x2c')][_0x8eff('0x31')]));_0x3e1607[_0x8eff('0x30')]=_0x3e1607[_0x8eff('0x30')][_0x8eff('0x32')]?_0x3e1607['attributes']:_0x323ffa[_0x8eff('0x2f')];if(!_0x2e8067[_0x8eff('0x2c')][_0x8eff('0x33')](_0x8eff('0x34'))){_0x3e1607['limit']=qs[_0x8eff('0x1c')](_0x2e8067[_0x8eff('0x2c')]['limit']);_0x3e1607['offset']=qs[_0x8eff('0x1b')](_0x2e8067[_0x8eff('0x2c')]['offset']);}_0x3e1607['order']=qs['sort'](_0x2e8067[_0x8eff('0x2c')]['sort']);_0x3e1607[_0x8eff('0x35')]=qs['filters'](_[_0x8eff('0x36')](_0x2e8067[_0x8eff('0x2c')],_0x323ffa[_0x8eff('0x37')]));if(_0x2e8067[_0x8eff('0x2c')][_0x8eff('0x38')]){_0x3e1607[_0x8eff('0x35')]=_['merge'](_0x3e1607[_0x8eff('0x35')],{'$or':_['map'](_0xb88ce9,function(_0xba48d8){if(_0xba48d8['type'][_0x8eff('0x39')]!==_0x8eff('0x3a')){var _0x3080a6={};_0x3080a6[_0xba48d8[_0x8eff('0x3b')]]={'$like':'%'+_0x2e8067['query'][_0x8eff('0x38')]+'%'};return _0x3080a6;}})});}_0x3e1607=_[_0x8eff('0x3c')]({},_0x3e1607,_0x2e8067[_0x8eff('0x3d')]);var _0x5360b7={'where':_0x3e1607[_0x8eff('0x35')]};return db[_0x8eff('0x2a')][_0x8eff('0x1a')](_0x5360b7)[_0x8eff('0x23')](function(_0x721c71){_0x15083c[_0x8eff('0x1a')]=_0x721c71;if(_0x2e8067[_0x8eff('0x2c')][_0x8eff('0x3e')]){_0x3e1607[_0x8eff('0x3f')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x3e1607);})[_0x8eff('0x23')](function(_0x114f8e){_0x15083c[_0x8eff('0x40')]=_0x114f8e;return _0x15083c;})[_0x8eff('0x23')](respondWithFilteredResult(_0x516173,_0x3e1607))[_0x8eff('0x41')](handleError(_0x516173,null));};exports[_0x8eff('0x42')]=function(_0x18b132,_0x5acc86){var _0x14cf6e={'raw':!![],'where':{'id':_0x18b132['params']['id']}},_0x1c7332={};_0x1c7332[_0x8eff('0x2f')]=_[_0x8eff('0x2d')](db[_0x8eff('0x2a')][_0x8eff('0x2b')]);_0x1c7332[_0x8eff('0x2c')]=_[_0x8eff('0x2d')](_0x18b132[_0x8eff('0x2c')]);_0x1c7332[_0x8eff('0x37')]=_[_0x8eff('0x2e')](_0x1c7332['model'],_0x1c7332[_0x8eff('0x2c')]);_0x14cf6e[_0x8eff('0x30')]=_[_0x8eff('0x2e')](_0x1c7332[_0x8eff('0x2f')],qs[_0x8eff('0x31')](_0x18b132['query'][_0x8eff('0x31')]));_0x14cf6e['attributes']=_0x14cf6e[_0x8eff('0x30')][_0x8eff('0x32')]?_0x14cf6e[_0x8eff('0x30')]:_0x1c7332[_0x8eff('0x2f')];if(_0x18b132['query'][_0x8eff('0x3e')]){_0x14cf6e[_0x8eff('0x3f')]=[{'all':!![]}];}_0x14cf6e=_[_0x8eff('0x3c')]({},_0x14cf6e,_0x18b132['options']);return db['SalesforceField'][_0x8eff('0x43')](_0x14cf6e)[_0x8eff('0x23')](handleEntityNotFound(_0x5acc86,null))[_0x8eff('0x23')](respondWithResult(_0x5acc86,null))[_0x8eff('0x41')](handleError(_0x5acc86,null));};exports[_0x8eff('0x44')]=function(_0x4819dc,_0x28cb8e){return db['SalesforceField'][_0x8eff('0x44')](_0x4819dc[_0x8eff('0x45')],{})['then'](respondWithResult(_0x28cb8e,0xc9))['catch'](handleError(_0x28cb8e,null));};exports['update']=function(_0x494388,_0x4b0b41){if(_0x494388['body']['id']){delete _0x494388[_0x8eff('0x45')]['id'];}return db[_0x8eff('0x2a')][_0x8eff('0x43')]({'where':{'id':_0x494388[_0x8eff('0x46')]['id']}})[_0x8eff('0x23')](handleEntityNotFound(_0x4b0b41,null))[_0x8eff('0x23')](saveUpdates(_0x494388[_0x8eff('0x45')],null))[_0x8eff('0x23')](respondWithResult(_0x4b0b41,null))[_0x8eff('0x41')](handleError(_0x4b0b41,null));};exports[_0x8eff('0x24')]=function(_0x4c7013,_0x11e53c){return db['SalesforceField'][_0x8eff('0x43')]({'where':{'id':_0x4c7013[_0x8eff('0x46')]['id']}})[_0x8eff('0x23')](handleEntityNotFound(_0x11e53c,null))[_0x8eff('0x23')](removeEntity(_0x11e53c,null))[_0x8eff('0x41')](handleError(_0x11e53c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 95570af..c11f04f 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 _0xb1e8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0xb1e8,0x180));var _0x8b1e=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xb1e8[_0x54defc];return _0x1955d3;};'use strict';var _=require(_0x8b1e('0x0'));var util=require(_0x8b1e('0x1'));var logger=require(_0x8b1e('0x2'))(_0x8b1e('0x3'));var moment=require(_0x8b1e('0x4'));var BPromise=require(_0x8b1e('0x5'));var rp=require(_0x8b1e('0x6'));var fs=require('fs');var path=require(_0x8b1e('0x7'));var rimraf=require(_0x8b1e('0x8'));var config=require(_0x8b1e('0x9'));var attributes=require(_0x8b1e('0xa'));module[_0x8b1e('0xb')]=function(_0x5bf352,_0x3e0719){return _0x5bf352[_0x8b1e('0xc')]('SalesforceField',attributes,{'tableName':_0x8b1e('0xd'),'paranoid':![],'indexes':[{'name':_0x8b1e('0xe'),'fields':[_0x8b1e('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd248=['define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x518461,_0x59c0bd){var _0x457a1c=function(_0x4e2b1a){while(--_0x4e2b1a){_0x518461['push'](_0x518461['shift']());}};_0x457a1c(++_0x59c0bd);}(_0xd248,0x85));var _0x8d24=function(_0x560a6d,_0x42c234){_0x560a6d=_0x560a6d-0x0;var _0x4b29aa=_0xd248[_0x560a6d];return _0x4b29aa;};'use strict';var _=require(_0x8d24('0x0'));var util=require(_0x8d24('0x1'));var logger=require(_0x8d24('0x2'))(_0x8d24('0x3'));var moment=require('moment');var BPromise=require(_0x8d24('0x4'));var rp=require(_0x8d24('0x5'));var fs=require('fs');var path=require(_0x8d24('0x6'));var rimraf=require(_0x8d24('0x7'));var config=require(_0x8d24('0x8'));var attributes=require(_0x8d24('0x9'));module[_0x8d24('0xa')]=function(_0x21c068,_0x3431c5){return _0x21c068[_0x8d24('0xb')](_0x8d24('0xc'),attributes,{'tableName':_0x8d24('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x8d24('0xe'),_0x8d24('0xf')],'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 cecfe3f..6dfed17 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 _0x5755=['info','SalesforceField,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x161768,_0x220e2c){var _0x1c09d3=function(_0x303b54){while(--_0x303b54){_0x161768['push'](_0x161768['shift']());}};_0x1c09d3(++_0x220e2c);}(_0x5755,0x16c));var _0x5575=function(_0x1b776e,_0x1d341e){_0x1b776e=_0x1b776e-0x0;var _0x3b8294=_0x5755[_0x1b776e];return _0x3b8294;};'use strict';var _=require(_0x5575('0x0'));var util=require(_0x5575('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5575('0x2'));var fs=require('fs');var Redis=require(_0x5575('0x3'));var db=require(_0x5575('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5575('0x5'))(_0x5575('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5575('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496771,_0x46039e,_0x26351e){return new BPromise(function(_0x4c48bf,_0x9ab960){return client[_0x5575('0x8')](_0x496771,_0x26351e)[_0x5575('0x9')](function(_0x39fd21){logger[_0x5575('0xa')](_0x5575('0xb'),_0x46039e,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x46039e,'request\x20sent',JSON[_0x5575('0xc')](_0x39fd21));if(_0x39fd21[_0x5575('0xd')]){if(_0x39fd21[_0x5575('0xd')]['code']===0x1f4){logger[_0x5575('0xd')](_0x5575('0xb'),_0x46039e,_0x39fd21[_0x5575('0xd')][_0x5575('0xe')]);return _0x9ab960(_0x39fd21[_0x5575('0xd')][_0x5575('0xe')]);}logger[_0x5575('0xd')]('SalesforceField,\x20%s,\x20%s',_0x46039e,_0x39fd21['error'][_0x5575('0xe')]);return _0x4c48bf(_0x39fd21[_0x5575('0xd')][_0x5575('0xe')]);}else{logger[_0x5575('0xa')](_0x5575('0xb'),_0x46039e,'request\x20sent');_0x4c48bf(_0x39fd21[_0x5575('0xf')]['message']);}})[_0x5575('0x10')](function(_0x48eee7){logger[_0x5575('0xd')]('SalesforceField,\x20%s,\x20%s',_0x46039e,_0x48eee7);_0x9ab960(_0x48eee7);});});} \ No newline at end of file +var _0x139b=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x486f2e,_0x38891c){var _0x41d33b=function(_0x238a16){while(--_0x238a16){_0x486f2e['push'](_0x486f2e['shift']());}};_0x41d33b(++_0x38891c);}(_0x139b,0x1d1));var _0xb139=function(_0x1689dc,_0x1994d3){_0x1689dc=_0x1689dc-0x0;var _0x58229b=_0x139b[_0x1689dc];return _0x58229b;};'use strict';var _=require(_0xb139('0x0'));var util=require(_0xb139('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb139('0x2'));var fs=require('fs');var Redis=require(_0xb139('0x3'));var db=require(_0xb139('0x4'))['db'];var utils=require(_0xb139('0x5'));var logger=require('../../config/logger')(_0xb139('0x6'));var config=require(_0xb139('0x7'));var jayson=require(_0xb139('0x8'));var client=jayson[_0xb139('0x9')][_0xb139('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1999e6,_0x2a4071,_0x488239){return new BPromise(function(_0x56ce7c,_0x3b18bc){return client[_0xb139('0xb')](_0x1999e6,_0x488239)[_0xb139('0xc')](function(_0x3fe232){logger[_0xb139('0xd')]('SalesforceField,\x20%s,\x20%s',_0x2a4071,_0xb139('0xe'));logger[_0xb139('0xf')](_0xb139('0x10'),_0x2a4071,_0xb139('0xe'),JSON[_0xb139('0x11')](_0x3fe232));if(_0x3fe232['error']){if(_0x3fe232[_0xb139('0x12')][_0xb139('0x13')]===0x1f4){logger[_0xb139('0x12')](_0xb139('0x14'),_0x2a4071,_0x3fe232['error'][_0xb139('0x15')]);return _0x3b18bc(_0x3fe232['error'][_0xb139('0x15')]);}logger[_0xb139('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2a4071,_0x3fe232[_0xb139('0x12')][_0xb139('0x15')]);return _0x56ce7c(_0x3fe232[_0xb139('0x12')][_0xb139('0x15')]);}else{logger[_0xb139('0xd')](_0xb139('0x14'),_0x2a4071,_0xb139('0xe'));_0x56ce7c(_0x3fe232[_0xb139('0x16')]['message']);}})[_0xb139('0x17')](function(_0x5debe7){logger[_0xb139('0x12')](_0xb139('0x14'),_0x2a4071,_0x5debe7);_0x3b18bc(_0x5debe7);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 9ff42d3..7f17852 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 _0x3d4b=['express','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','delete','destroy','exports','multer','path'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x3d4b,0x17a));var _0xb3d4=function(_0x18d1f0,_0x4669a1){_0x18d1f0=_0x18d1f0-0x0;var _0x153ba7=_0x3d4b[_0x18d1f0];return _0x153ba7;};'use strict';var multer=require(_0xb3d4('0x0'));var util=require('util');var path=require(_0xb3d4('0x1'));var timeout=require('connect-timeout');var express=require(_0xb3d4('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb3d4('0x3'));var config=require(_0xb3d4('0x4'));var controller=require(_0xb3d4('0x5'));router[_0xb3d4('0x6')]('/',auth[_0xb3d4('0x7')](),controller[_0xb3d4('0x8')]);router[_0xb3d4('0x6')](_0xb3d4('0x9'),auth[_0xb3d4('0x7')](),controller[_0xb3d4('0xa')]);router[_0xb3d4('0x6')](_0xb3d4('0xb'),auth[_0xb3d4('0x7')](),controller[_0xb3d4('0xc')]);router[_0xb3d4('0x6')](_0xb3d4('0xd'),auth[_0xb3d4('0x7')](),controller[_0xb3d4('0xe')]);router[_0xb3d4('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb3d4('0xf')](_0xb3d4('0xb'),auth[_0xb3d4('0x7')](),controller['addConfiguration']);router['put'](_0xb3d4('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb3d4('0x10')](_0xb3d4('0x9'),auth['isAuthenticated'](),controller[_0xb3d4('0x11')]);module[_0xb3d4('0x12')]=router; \ No newline at end of file +var _0x8434=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x8434,0x162));var _0x4843=function(_0x5cf9f2,_0x20cd28){_0x5cf9f2=_0x5cf9f2-0x0;var _0x1becc0=_0x8434[_0x5cf9f2];return _0x1becc0;};'use strict';var multer=require('multer');var util=require(_0x4843('0x0'));var path=require('path');var timeout=require(_0x4843('0x1'));var express=require('express');var router=express[_0x4843('0x2')]();var auth=require(_0x4843('0x3'));var interaction=require(_0x4843('0x4'));var config=require(_0x4843('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x4843('0x6')]('/',auth['isAuthenticated'](),controller[_0x4843('0x7')]);router['get'](_0x4843('0x8'),auth[_0x4843('0x9')](),controller[_0x4843('0xa')]);router[_0x4843('0x6')](_0x4843('0xb'),auth[_0x4843('0x9')](),controller[_0x4843('0xc')]);router[_0x4843('0x6')](_0x4843('0xd'),auth[_0x4843('0x9')](),controller[_0x4843('0xe')]);router[_0x4843('0xf')]('/',auth[_0x4843('0x9')](),controller[_0x4843('0x10')]);router['post'](_0x4843('0xb'),auth[_0x4843('0x9')](),controller[_0x4843('0x11')]);router[_0x4843('0x12')](_0x4843('0x8'),auth[_0x4843('0x9')](),controller[_0x4843('0x13')]);router[_0x4843('0x14')](_0x4843('0x8'),auth[_0x4843('0x9')](),controller[_0x4843('0x15')]);module[_0x4843('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0b5e502..0959272 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 _0xd8b0=['username','STRING','remoteUri','sequelize','exports'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_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')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0d8b('0x2')},'password':{'type':Sequelize[_0x0d8b('0x3')]},'email':{'type':Sequelize[_0x0d8b('0x3')]},'remoteUri':{'type':Sequelize[_0x0d8b('0x3')],'unique':_0x0d8b('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x878f=['STRING','username','remoteUri','exports'];(function(_0x26d4e3,_0xaa85a2){var _0x4bf659=function(_0x1920ba){while(--_0x1920ba){_0x26d4e3['push'](_0x26d4e3['shift']());}};_0x4bf659(++_0xaa85a2);}(_0x878f,0x173));var _0xf878=function(_0x3263c9,_0x411c27){_0x3263c9=_0x3263c9-0x0;var _0xc9b389=_0x878f[_0x3263c9];return _0xc9b389;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'name':{'type':Sequelize[_0xf878('0x1')]},'description':{'type':Sequelize[_0xf878('0x1')]},'username':{'type':Sequelize[_0xf878('0x1')],'unique':_0xf878('0x2')},'password':{'type':Sequelize[_0xf878('0x1')]},'email':{'type':Sequelize[_0xf878('0x1')]},'remoteUri':{'type':Sequelize[_0xf878('0x1')],'unique':_0xf878('0x3')},'serverUrl':{'type':Sequelize[_0xf878('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 28d004a..668a3ec 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 _0x4651=['model','query','filters','attributes','fields','length','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','params','rawAttributes','create','body','find','getConfigurations','keys','intersection','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','user_input','sys_created_on','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','severity','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','findOne','username','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','ServicenowAccount'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x4651,0x8d));var _0x1465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4651[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x1465('0x0'));var emlformat=require(_0x1465('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1465('0x2'));var jsonpatch=require(_0x1465('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1465('0x4'));var Mustache=require('mustache');var util=require(_0x1465('0x5'));var path=require(_0x1465('0x6'));var sox=require(_0x1465('0x7'));var csv=require('to-csv');var ejs=require(_0x1465('0x8'));var fs=require('fs');var _=require(_0x1465('0x9'));var squel=require(_0x1465('0xa'));var crypto=require(_0x1465('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1465('0xc'));var toCsv=require(_0x1465('0xd'));var querystring=require(_0x1465('0xe'));var Papa=require(_0x1465('0xf'));var Redis=require('ioredis');var authService=require(_0x1465('0x10'));var qs=require(_0x1465('0x11'));var hardwareService=require(_0x1465('0x12'));var logger=require(_0x1465('0x13'))('api');var utils=require(_0x1465('0x14'));var config=require(_0x1465('0x15'));var db=require(_0x1465('0x16'))['db'];var integrations=require(_0x1465('0x17'));var jayson=require(_0x1465('0x18'));var client=jayson[_0x1465('0x19')][_0x1465('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5968ad,_0x18dc96,_0x5da4fc){if(_0x5da4fc){var _0x136f71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x136f71['test'](_0x18dc96)){return _0x5968ad;}else{throw new Error(_0x1465('0x1b'));}}else{return _0x5968ad;}}function respondWithRpcPromise(_0x43858f,_0x4cbe4f,_0x5e2e15,_0x23b0c2){return new BPromise(function(_0x1ba32f,_0x242969){var _0xcaa0d7=_0x23b0c2||client;return _0xcaa0d7[_0x1465('0x1c')](_0x43858f,_0x5e2e15)[_0x1465('0x1d')](function(_0x2647fa){logger[_0x1465('0x1e')](_0x1465('0x1f'),_0x4cbe4f,_0x1465('0x20'));logger[_0x1465('0x21')](_0x1465('0x22'),_0x4cbe4f,'request\x20sent',JSON[_0x1465('0x23')](_0x2647fa));if(_0x2647fa['error']){if(_0x2647fa['error'][_0x1465('0x24')]===0x1f4){logger[_0x1465('0x25')](_0x1465('0x1f'),_0x4cbe4f,_0x2647fa[_0x1465('0x25')][_0x1465('0x26')]);return _0x242969(_0x2647fa[_0x1465('0x25')][_0x1465('0x26')]);}logger[_0x1465('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x4cbe4f,_0x2647fa[_0x1465('0x25')][_0x1465('0x26')]);return _0x1ba32f(_0x2647fa[_0x1465('0x25')][_0x1465('0x26')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4cbe4f,_0x1465('0x20'));_0x1ba32f(_0x2647fa[_0x1465('0x27')][_0x1465('0x26')]);}})[_0x1465('0x28')](function(_0x10c48d){logger[_0x1465('0x25')](_0x1465('0x1f'),_0x4cbe4f,_0x10c48d);_0x242969(_0x10c48d);});});}function respondWithStatusCode(_0x38f4b4,_0x3c3445){_0x3c3445=_0x3c3445||0xcc;return function(_0x44423d){if(_0x44423d){return _0x38f4b4[_0x1465('0x29')](_0x3c3445);}return _0x38f4b4[_0x1465('0x2a')](_0x3c3445)[_0x1465('0x2b')]();};}function respondWithResult(_0x13ba4d,_0x2b4976){_0x2b4976=_0x2b4976||0xc8;return function(_0x59655f){if(_0x59655f){return _0x13ba4d['status'](_0x2b4976)[_0x1465('0x2c')](_0x59655f);}};}function respondWithFilteredResult(_0x12eacc,_0x36e371){return function(_0x1e6069){if(_0x1e6069){var _0x3d2267=_0x1e6069['count'],_0x394dfd=_0x36e371['offset'],_0xb4645=_0x36e371[_0x1465('0x2d')]+_0x36e371[_0x1465('0x2e')],_0x363399;if(_0xb4645>=_0x3d2267){_0xb4645=_0x3d2267;_0x363399=0xc8;}else{_0x363399=0xce;}_0x12eacc[_0x1465('0x2a')](_0x363399);return _0x12eacc[_0x1465('0x2f')](_0x1465('0x30'),_0x394dfd+'-'+_0xb4645+'/'+_0x3d2267)[_0x1465('0x2c')](_0x1e6069);}return null;};}function patchUpdates(_0x3b037f){return function(_0x31c58e){try{jsonpatch[_0x1465('0x31')](_0x31c58e,_0x3b037f,!![]);}catch(_0x515dc5){return BPromise[_0x1465('0x32')](_0x515dc5);}return _0x31c58e[_0x1465('0x33')]();};}function saveUpdates(_0x5701ab,_0x6c2c84){return function(_0x1ef157){if(_0x1ef157){return _0x1ef157[_0x1465('0x34')](_0x5701ab)[_0x1465('0x1d')](function(_0x290f65){return _0x290f65;});}return null;};}function removeEntity(_0x5c2c8e,_0x4318fe){return function(_0x4f3f64){if(_0x4f3f64){return _0x4f3f64[_0x1465('0x35')]()[_0x1465('0x1d')](function(){_0x5c2c8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44415c,_0x227734){return function(_0x1eac48){if(!_0x1eac48){_0x44415c[_0x1465('0x29')](0x194);}return _0x1eac48;};}function handleError(_0x1f06be,_0x2f8ddb){_0x2f8ddb=_0x2f8ddb||0x1f4;return function(_0x472721){logger[_0x1465('0x25')](_0x472721[_0x1465('0x36')]);if(_0x472721[_0x1465('0x37')]){delete _0x472721[_0x1465('0x37')];}_0x1f06be[_0x1465('0x2a')](_0x2f8ddb)['send'](_0x472721);};}exports[_0x1465('0x38')]=function(_0x581132,_0x2209b2){var _0x5b70f1={},_0x3e0307={},_0x2ff35a={'count':0x0,'rows':[]};var _0x3bd7bd=db[_0x1465('0x39')]['rawAttributes'];_0x3e0307[_0x1465('0x3a')]=_['keys'](_0x3bd7bd);_0x3e0307[_0x1465('0x3b')]=_['keys'](_0x581132[_0x1465('0x3b')]);_0x3e0307[_0x1465('0x3c')]=_['intersection'](_0x3e0307[_0x1465('0x3a')],_0x3e0307[_0x1465('0x3b')]);_0x5b70f1[_0x1465('0x3d')]=_['intersection'](_0x3e0307['model'],qs[_0x1465('0x3e')](_0x581132[_0x1465('0x3b')][_0x1465('0x3e')]));_0x5b70f1[_0x1465('0x3d')]=_0x5b70f1[_0x1465('0x3d')][_0x1465('0x3f')]?_0x5b70f1[_0x1465('0x3d')]:_0x3e0307[_0x1465('0x3a')];if(!_0x581132[_0x1465('0x3b')]['hasOwnProperty']('nolimit')){_0x5b70f1['limit']=qs[_0x1465('0x2e')](_0x581132[_0x1465('0x3b')][_0x1465('0x2e')]);_0x5b70f1[_0x1465('0x2d')]=qs[_0x1465('0x2d')](_0x581132[_0x1465('0x3b')][_0x1465('0x2d')]);}_0x5b70f1[_0x1465('0x40')]=qs['sort'](_0x581132[_0x1465('0x3b')][_0x1465('0x41')]);_0x5b70f1[_0x1465('0x42')]=qs['filters'](_['pick'](_0x581132[_0x1465('0x3b')],_0x3e0307[_0x1465('0x3c')]));if(_0x581132[_0x1465('0x3b')][_0x1465('0x43')]){_0x5b70f1[_0x1465('0x42')]=_[_0x1465('0x44')](_0x5b70f1[_0x1465('0x42')],{'$or':_[_0x1465('0x45')](_0x3bd7bd,function(_0x465729){if(_0x465729[_0x1465('0x46')][_0x1465('0x47')]!==_0x1465('0x48')){var _0x3138fe={};_0x3138fe[_0x465729[_0x1465('0x49')]]={'$like':'%'+_0x581132[_0x1465('0x3b')][_0x1465('0x43')]+'%'};return _0x3138fe;}})});}_0x5b70f1=_['merge']({},_0x5b70f1,_0x581132[_0x1465('0x4a')]);var _0x3b0cc8={'where':_0x5b70f1[_0x1465('0x42')]};return db['ServicenowAccount'][_0x1465('0x4b')](_0x3b0cc8)[_0x1465('0x1d')](function(_0x1d8ccf){_0x2ff35a[_0x1465('0x4b')]=_0x1d8ccf;if(_0x581132[_0x1465('0x3b')][_0x1465('0x4c')]){_0x5b70f1[_0x1465('0x4d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x1465('0x4e')](_0x5b70f1);})[_0x1465('0x1d')](function(_0x20df4c){_0x2ff35a[_0x1465('0x4f')]=_0x20df4c;return _0x2ff35a;})['then'](respondWithFilteredResult(_0x2209b2,_0x5b70f1))['catch'](handleError(_0x2209b2,null));};exports['show']=function(_0x46ae58,_0x1f8b6d){var _0x252ba0={'raw':![],'where':{'id':_0x46ae58[_0x1465('0x50')]['id']}},_0x39e553={};_0x39e553[_0x1465('0x3a')]=_['keys'](db[_0x1465('0x39')][_0x1465('0x51')]);_0x39e553[_0x1465('0x3b')]=_['keys'](_0x46ae58['query']);_0x39e553[_0x1465('0x3c')]=_['intersection'](_0x39e553[_0x1465('0x3a')],_0x39e553[_0x1465('0x3b')]);_0x252ba0['attributes']=_['intersection'](_0x39e553[_0x1465('0x3a')],qs[_0x1465('0x3e')](_0x46ae58[_0x1465('0x3b')][_0x1465('0x3e')]));_0x252ba0[_0x1465('0x3d')]=_0x252ba0[_0x1465('0x3d')][_0x1465('0x3f')]?_0x252ba0[_0x1465('0x3d')]:_0x39e553[_0x1465('0x3a')];if(_0x46ae58[_0x1465('0x3b')][_0x1465('0x4c')]){_0x252ba0[_0x1465('0x4d')]=[{'all':!![]}];}_0x252ba0=_['merge']({},_0x252ba0,_0x46ae58['options']);return db['ServicenowAccount']['find'](_0x252ba0)[_0x1465('0x1d')](handleEntityNotFound(_0x1f8b6d,null))[_0x1465('0x1d')](respondWithResult(_0x1f8b6d,null))[_0x1465('0x28')](handleError(_0x1f8b6d,null));};exports[_0x1465('0x52')]=function(_0x314700,_0x2a94dc){return db[_0x1465('0x39')][_0x1465('0x52')](_0x314700[_0x1465('0x53')],{})[_0x1465('0x1d')](respondWithResult(_0x2a94dc,0xc9))[_0x1465('0x28')](handleError(_0x2a94dc,null));};exports['update']=function(_0x5c3ce7,_0x23a394){if(_0x5c3ce7[_0x1465('0x53')]['id']){delete _0x5c3ce7['body']['id'];}return db['ServicenowAccount'][_0x1465('0x54')]({'where':{'id':_0x5c3ce7[_0x1465('0x50')]['id']}})[_0x1465('0x1d')](handleEntityNotFound(_0x23a394,null))[_0x1465('0x1d')](saveUpdates(_0x5c3ce7[_0x1465('0x53')],null))[_0x1465('0x1d')](respondWithResult(_0x23a394,null))['catch'](handleError(_0x23a394,null));};exports['destroy']=function(_0x1c892a,_0x3fa4cd){return db[_0x1465('0x39')]['find']({'where':{'id':_0x1c892a[_0x1465('0x50')]['id']}})[_0x1465('0x1d')](handleEntityNotFound(_0x3fa4cd,null))['then'](removeEntity(_0x3fa4cd,null))[_0x1465('0x28')](handleError(_0x3fa4cd,null));};exports[_0x1465('0x55')]=function(_0x49822e,_0x254b63,_0x805067){var _0x154b51={};var _0x5e3ad6={};var _0x212d87;var _0x2c5669;return db['ServicenowAccount']['findOne']({'where':{'id':_0x49822e[_0x1465('0x50')]['id']}})[_0x1465('0x1d')](handleEntityNotFound(_0x254b63,null))[_0x1465('0x1d')](function(_0x562953){if(_0x562953){_0x212d87=_0x562953;_0x5e3ad6['model']=_['keys'](db['ServicenowConfiguration'][_0x1465('0x51')]);_0x5e3ad6[_0x1465('0x3b')]=_[_0x1465('0x56')](_0x49822e[_0x1465('0x3b')]);_0x5e3ad6[_0x1465('0x3c')]=_['intersection'](_0x5e3ad6[_0x1465('0x3a')],_0x5e3ad6['query']);_0x154b51['attributes']=_[_0x1465('0x57')](_0x5e3ad6[_0x1465('0x3a')],qs['fields'](_0x49822e[_0x1465('0x3b')]['fields']));_0x154b51[_0x1465('0x3d')]=_0x154b51[_0x1465('0x3d')]['length']?_0x154b51[_0x1465('0x3d')]:_0x5e3ad6['model'];_0x154b51['order']=qs[_0x1465('0x41')](_0x49822e['query'][_0x1465('0x41')]);_0x154b51[_0x1465('0x42')]=qs[_0x1465('0x3c')](_[_0x1465('0x58')](_0x49822e[_0x1465('0x3b')],_0x5e3ad6[_0x1465('0x3c')]));if(_0x49822e[_0x1465('0x3b')][_0x1465('0x43')]){_0x154b51['where']=_[_0x1465('0x44')](_0x154b51[_0x1465('0x42')],{'$or':_[_0x1465('0x45')](_0x154b51[_0x1465('0x3d')],function(_0x264e24){var _0x411a9d={};_0x411a9d[_0x264e24]={'$like':'%'+_0x49822e[_0x1465('0x3b')][_0x1465('0x43')]+'%'};return _0x411a9d;})});}_0x154b51=_[_0x1465('0x44')]({},_0x154b51,_0x49822e[_0x1465('0x4a')]);return _0x212d87[_0x1465('0x55')](_0x154b51);}})[_0x1465('0x1d')](function(_0x4dabe3){if(_0x4dabe3){_0x2c5669=_0x4dabe3['length'];if(!_0x49822e['query'][_0x1465('0x59')](_0x1465('0x5a'))){_0x154b51['limit']=qs[_0x1465('0x2e')](_0x49822e[_0x1465('0x3b')]['limit']);_0x154b51[_0x1465('0x2d')]=qs[_0x1465('0x2d')](_0x49822e[_0x1465('0x3b')][_0x1465('0x2d')]);}return _0x212d87[_0x1465('0x55')](_0x154b51);}})[_0x1465('0x1d')](function(_0x30f609){if(_0x30f609){return _0x30f609?{'count':_0x2c5669,'rows':_0x30f609}:null;}})[_0x1465('0x1d')](respondWithResult(_0x254b63,null))[_0x1465('0x28')](handleError(_0x254b63,null));};exports[_0x1465('0x5b')]=function(_0x255321,_0x2559e3,_0xf61426){if(_0x255321[_0x1465('0x53')]['id']){delete _0x255321[_0x1465('0x53')]['id'];}return db[_0x1465('0x39')]['findOne']({'where':{'id':_0x255321[_0x1465('0x50')]['id']}})[_0x1465('0x1d')](handleEntityNotFound(_0x2559e3,null))['then'](function(_0x200775){if(_0x200775){_0x255321[_0x1465('0x53')][_0x1465('0x5c')]=_0x200775['id'];_0x255321[_0x1465('0x53')][_0x1465('0x5d')]=integrations[_0x1465('0x5e')](_0x255321[_0x1465('0x53')][_0x1465('0x5f')],_0x255321[_0x1465('0x53')][_0x1465('0x46')]);_0x255321['body'][_0x1465('0x60')]=integrations[_0x1465('0x61')](_0x255321[_0x1465('0x53')]['channel'],_0x255321['body'][_0x1465('0x46')]);return db[_0x1465('0x62')]['create'](_0x255321['body'],{'include':[{'model':db[_0x1465('0x63')],'as':_0x1465('0x5d')},{'model':db['ServicenowField'],'as':_0x1465('0x60')}]});}return null;})['then'](respondWithResult(_0x2559e3,null))[_0x1465('0x28')](handleError(_0x2559e3,null));};exports[_0x1465('0x64')]=function(_0x25af6e,_0x24026e,_0x6899a8){var _0x1e39f5=[_0x1465('0x65'),_0x1465('0x66'),_0x1465('0x67'),_0x1465('0x68'),_0x1465('0x69'),_0x1465('0x6a'),'incident_state','severity',_0x1465('0x6b')];var _0xabd775=[_0x1465('0x6c'),_0x1465('0x65'),'caused_by',_0x1465('0x6d'),_0x1465('0x6e'),_0x1465('0x6f'),'child_incidents',_0x1465('0x66'),_0x1465('0x70'),_0x1465('0x71'),_0x1465('0x72'),'sys_updated_by','opened_by',_0x1465('0x73'),_0x1465('0x74'),'sys_domain','state',_0x1465('0x75'),_0x1465('0x67'),_0x1465('0x40'),'calendar_stc',_0x1465('0x76'),_0x1465('0x77'),_0x1465('0x78'),_0x1465('0x79'),_0x1465('0x7a'),_0x1465('0x7b'),_0x1465('0x7c'),_0x1465('0x7d'),_0x1465('0x7e'),_0x1465('0x7f'),_0x1465('0x80'),_0x1465('0x81'),_0x1465('0x82'),_0x1465('0x83'),_0x1465('0x84'),_0x1465('0x85'),_0x1465('0x86'),'resolved_at',_0x1465('0x87'),_0x1465('0x88'),'subcategory','work_notes',_0x1465('0x89'),_0x1465('0x69'),'correlation_display',_0x1465('0x8a'),_0x1465('0x8b'),_0x1465('0x8c'),'business_stc',_0x1465('0x8d'),_0x1465('0x8e'),_0x1465('0x8f'),'notify',_0x1465('0x90'),_0x1465('0x91'),_0x1465('0x92'),_0x1465('0x93'),'parent_incident',_0x1465('0x94'),_0x1465('0x95'),_0x1465('0x96'),_0x1465('0x97'),_0x1465('0x98'),_0x1465('0x99'),_0x1465('0x9a'),_0x1465('0x9b'),'activity_due','assigned_to',_0x1465('0x9c'),_0x1465('0x9d'),'sla_due','approval',_0x1465('0x9e'),_0x1465('0x9f'),_0x1465('0xa0'),_0x1465('0xa1'),'sys_tags','escalation',_0x1465('0xa2'),'correlation_id','location','category'];var _0x524f01='';var _0x55d216='';var _0x9057f6=[];var _0x3c8906='';var _0x53d1e1='';var _0x10b638=[];var _0x5cb1d5='';var _0x5a84e8='';var _0x107eb6={};var _0x3a4c3c='';return db['ServicenowAccount'][_0x1465('0xa3')]({'where':{'id':_0x25af6e[_0x1465('0x50')]['id']},'attributes':['id',_0x1465('0xa4'),'password','email',_0x1465('0xa5'),'serverUrl']})['then'](handleEntityNotFound(_0x24026e,null))[_0x1465('0x1d')](function(_0x16f573){if(_0x16f573){_0x3a4c3c=_0x16f573[_0x1465('0xa5')];var _0x3ebd05=_0x3a4c3c[_0x1465('0xa6')](-0x1);if(_0x3ebd05==='/'){_0x3a4c3c=_0x3a4c3c[_0x1465('0xa7')](0x0,_0x3a4c3c[_0x1465('0xa8')](_0x3ebd05));}_0x5a84e8=util[_0x1465('0xa9')]('%s/api/now/doc/table/schema/',_0x3a4c3c);_0x5cb1d5=util[_0x1465('0xa9')](_0x1465('0xaa'),_0x3a4c3c);_0x107eb6={'user':_0x16f573[_0x1465('0xa4')],'pass':_0x16f573[_0x1465('0xab')]};var _0x4b92ca={'method':_0x1465('0xac'),'uri':_0x5a84e8+_0x1465('0xad'),'auth':_0x107eb6,'json':!![]};return rp(_0x4b92ca);}})[_0x1465('0x1d')](function(_0x2f5d18){if(_0x2f5d18[_0x1465('0x27')][_0x1465('0x3f')]>0x0){_0x524f01=_0x2f5d18[_0x1465('0x27')];}console[_0x1465('0xae')](_0x1465('0xaf'),_0x524f01);_0x10b638=[];_0x55d216=Object[_0x1465('0xb0')]([],_0x524f01);_[_0x1465('0xb1')](_0x55d216,function(_0x523fcf){return!_0x1e39f5['includes'](_0x523fcf[_0x1465('0x37')]);});_0x55d216[_0x1465('0xb2')](function(_0x33130c){var _0x56ca55=createFieldObject(_0x5cb1d5,_0x107eb6,_0x33130c[_0x1465('0xb3')],_0x33130c[_0x1465('0x37')],_0x33130c[_0x1465('0xb4')],![]);_0x10b638['push'](_0x56ca55);});return Promise[_0x1465('0xb5')](_0x10b638);})[_0x1465('0x1d')](function(_0xfd0813){_0x9057f6=_0xfd0813;_0x3c8906=Object[_0x1465('0xb0')]([],_0x524f01);console[_0x1465('0xae')](_0x1465('0xb6'),_0x524f01);_[_0x1465('0xb1')](_0x3c8906,function(_0x39c7c5){return _0xabd775[_0x1465('0xb7')](_0x39c7c5[_0x1465('0x37')]);});console['log'](_0x1465('0xb8'),_0x3c8906);_0x10b638=[];_0x3c8906[_0x1465('0xb2')](function(_0xdf3043){var _0x1bb523=createFieldObject(_0x5cb1d5,_0x107eb6,_0xdf3043[_0x1465('0xb3')],_0xdf3043[_0x1465('0x37')],_0xdf3043[_0x1465('0xb4')],!![]);_0x10b638[_0x1465('0xb9')](_0x1bb523);});return Promise[_0x1465('0xb5')](_0x10b638);})['then'](function(_0x37a747){_0x53d1e1=_0x37a747;var _0x25eeda=_0x9057f6[_0x1465('0xba')](_0x53d1e1);return{'count':_0x25eeda[_0x1465('0x3f')],'rows':_0x25eeda};})[_0x1465('0x1d')](respondWithResult(_0x24026e,null))[_0x1465('0x28')](function(_0x47add3){console['log'](_0x1465('0xbb')+_0x47add3);var _0x1dd702=_0x25af6e[_0x1465('0x3b')]['test']?0x1f4:_0x47add3[_0x1465('0xbc')]||0x1f4;logger[_0x1465('0x25')](_0x47add3[_0x1465('0x36')]);delete _0x47add3['name'];if(_0x1dd702===0x191){_0x1dd702=0x190;}_0x24026e[_0x1465('0x2a')](_0x1dd702)[_0x1465('0xbd')](_0x25af6e[_0x1465('0x3b')]['test']?{'message':_0x1465('0xbe'),'statusCode':_0x47add3['statusCode']}:_0x47add3);});};function createFieldObject(_0x5db3d4,_0x3bbd2a,_0x49f933,_0x4529fe,_0x40cb8c,_0x1ed739){return new Promise(function(_0x23327a,_0x57ddb5){var _0x530e0f={'id':_0x4529fe,'name':_0x40cb8c,'custom':_0x1ed739};if(_0x49f933===_0x1465('0xbf')){_0x530e0f[_0x1465('0x4a')]=[{'name':_0x1465('0xc0'),'value':_0x1465('0xc1')},{'name':_0x1465('0xc2'),'value':_0x1465('0xc3')}];_0x23327a(_0x530e0f);}else{var _0x3a8fe7={'method':_0x1465('0xac'),'uri':_0x5db3d4+_0x1465('0xc4')+_0x4529fe,'auth':_0x3bbd2a,'json':!![]};return rp(_0x3a8fe7)['then'](function(_0x35402a){var _0xec6f44=[];if(_0x35402a[_0x1465('0x27')][_0x1465('0x3f')]>0x0){_0x35402a[_0x1465('0x27')][_0x1465('0xb2')](function(_0x5c2182){if(_0x5c2182[_0x1465('0xc5')]===_0x1465('0xc3')){var _0x1f26a0={'name':_0x5c2182[_0x1465('0xb4')],'value':_0x5c2182[_0x1465('0xc6')]};_0xec6f44[_0x1465('0xb9')](_0x1f26a0);}});}_0x530e0f[_0x1465('0x4a')]=_0xec6f44;if(_0x530e0f[_0x1465('0x4a')][_0x1465('0x3f')]>0x0){_0x23327a(_0x530e0f);}else{if(_0x1ed739==![]){_0x23327a();}else{_0x23327a(_0x530e0f);}}});}});} \ No newline at end of file +var _0xdcae=['False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','rimraf','zip-dir','moment','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','../../mysqldb','../../components/integrations/configuration','client','http','test','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','count','offset','limit','json','reject','save','update','destroy','end','sendStatus','stack','name','send','ServicenowAccount','rawAttributes','keys','query','filters','model','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','key','field','merge','options','then','includeAll','include','findAll','rows','params','intersection','fields','length','find','create','body','getConfigurations','findOne','ServicenowConfiguration','map','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','opened_at','group_list','work_end','reopened_time','caller_id','approval_set','short_description','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','password','GET','incident?sysparm_display_value=all','log','remove','includes','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','statusCode','boolean','True'];(function(_0x3124fe,_0x2a2e60){var _0x318528=function(_0x4fb0b1){while(--_0x4fb0b1){_0x3124fe['push'](_0x3124fe['shift']());}};_0x318528(++_0x2a2e60);}(_0xdcae,0x185));var _0xedca=function(_0x2fdee1,_0x466858){_0x2fdee1=_0x2fdee1-0x0;var _0x2c5533=_0xdcae[_0x2fdee1];return _0x2c5533;};'use strict';var pdf=require(_0xedca('0x0'));var emlformat=require(_0xedca('0x1'));var rimraf=require(_0xedca('0x2'));var zipdir=require(_0xedca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedca('0x5'));var util=require(_0xedca('0x6'));var path=require(_0xedca('0x7'));var sox=require(_0xedca('0x8'));var csv=require('to-csv');var ejs=require(_0xedca('0x9'));var fs=require('fs');var _=require(_0xedca('0xa'));var squel=require('squel');var crypto=require(_0xedca('0xb'));var jsforce=require(_0xedca('0xc'));var deskjs=require(_0xedca('0xd'));var toCsv=require(_0xedca('0xe'));var querystring=require(_0xedca('0xf'));var Papa=require(_0xedca('0x10'));var Redis=require(_0xedca('0x11'));var authService=require(_0xedca('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xedca('0x13'));var logger=require(_0xedca('0x14'))(_0xedca('0x15'));var utils=require('../../config/utils');var config=require(_0xedca('0x16'));var db=require(_0xedca('0x17'))['db'];var integrations=require(_0xedca('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xedca('0x19')][_0xedca('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3de20e,_0xc4000b,_0x4105b0){if(_0x4105b0){var _0x3039c4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3039c4[_0xedca('0x1b')](_0xc4000b)){return _0x3de20e;}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 _0x3de20e;}}function respondWithRpcPromise(_0x3ee1c9,_0x870430,_0x4d4fd5,_0x2ee3ba){return new BPromise(function(_0x2de7d1,_0x359428){var _0x322ef8=_0x2ee3ba||client;return _0x322ef8[_0xedca('0x1c')](_0x3ee1c9,_0x4d4fd5)['then'](function(_0x5a1b9a){logger[_0xedca('0x1d')](_0xedca('0x1e'),_0x870430,'request\x20sent');logger[_0xedca('0x1f')](_0xedca('0x20'),_0x870430,'request\x20sent',JSON[_0xedca('0x21')](_0x5a1b9a));if(_0x5a1b9a[_0xedca('0x22')]){if(_0x5a1b9a['error'][_0xedca('0x23')]===0x1f4){logger['error'](_0xedca('0x1e'),_0x870430,_0x5a1b9a['error']['message']);return _0x359428(_0x5a1b9a[_0xedca('0x22')][_0xedca('0x24')]);}logger['error'](_0xedca('0x1e'),_0x870430,_0x5a1b9a[_0xedca('0x22')][_0xedca('0x24')]);return _0x2de7d1(_0x5a1b9a['error'][_0xedca('0x24')]);}else{logger[_0xedca('0x1d')](_0xedca('0x1e'),_0x870430,_0xedca('0x25'));_0x2de7d1(_0x5a1b9a[_0xedca('0x26')][_0xedca('0x24')]);}})[_0xedca('0x27')](function(_0x3dcce5){logger[_0xedca('0x22')](_0xedca('0x1e'),_0x870430,_0x3dcce5);_0x359428(_0x3dcce5);});});}function respondWithStatusCode(_0x170474,_0x9cee68){_0x9cee68=_0x9cee68||0xcc;return function(_0x68784){if(_0x68784){return _0x170474['sendStatus'](_0x9cee68);}return _0x170474[_0xedca('0x28')](_0x9cee68)['end']();};}function respondWithResult(_0x421b47,_0x30399c){_0x30399c=_0x30399c||0xc8;return function(_0x5a0054){if(_0x5a0054){return _0x421b47[_0xedca('0x28')](_0x30399c)['json'](_0x5a0054);}};}function respondWithFilteredResult(_0x4bd9c3,_0x2618b9){return function(_0x3a18b4){if(_0x3a18b4){var _0x5c76ee=_0x3a18b4[_0xedca('0x29')],_0x1b216d=_0x2618b9[_0xedca('0x2a')],_0x1a8bf1=_0x2618b9[_0xedca('0x2a')]+_0x2618b9[_0xedca('0x2b')],_0x3f59d2;if(_0x1a8bf1>=_0x5c76ee){_0x1a8bf1=_0x5c76ee;_0x3f59d2=0xc8;}else{_0x3f59d2=0xce;}_0x4bd9c3[_0xedca('0x28')](_0x3f59d2);return _0x4bd9c3['set']('Content-Range',_0x1b216d+'-'+_0x1a8bf1+'/'+_0x5c76ee)[_0xedca('0x2c')](_0x3a18b4);}return null;};}function patchUpdates(_0x52dc4d){return function(_0x202a13){try{jsonpatch['apply'](_0x202a13,_0x52dc4d,!![]);}catch(_0x349cb3){return BPromise[_0xedca('0x2d')](_0x349cb3);}return _0x202a13[_0xedca('0x2e')]();};}function saveUpdates(_0xade9ad,_0x49b67d){return function(_0x3707e2){if(_0x3707e2){return _0x3707e2[_0xedca('0x2f')](_0xade9ad)['then'](function(_0x52da8a){return _0x52da8a;});}return null;};}function removeEntity(_0x3fcdc6,_0x398dde){return function(_0x5b892b){if(_0x5b892b){return _0x5b892b[_0xedca('0x30')]()['then'](function(){_0x3fcdc6['status'](0xcc)[_0xedca('0x31')]();});}};}function handleEntityNotFound(_0x5d3fb3,_0xf22820){return function(_0x2dae22){if(!_0x2dae22){_0x5d3fb3[_0xedca('0x32')](0x194);}return _0x2dae22;};}function handleError(_0x6d6919,_0x1fe61f){_0x1fe61f=_0x1fe61f||0x1f4;return function(_0x36d66a){logger[_0xedca('0x22')](_0x36d66a[_0xedca('0x33')]);if(_0x36d66a[_0xedca('0x34')]){delete _0x36d66a[_0xedca('0x34')];}_0x6d6919[_0xedca('0x28')](_0x1fe61f)[_0xedca('0x35')](_0x36d66a);};}exports['index']=function(_0x1af05b,_0x1fe65d){var _0x3ca7f6={},_0x255d64={},_0x10bf2d={'count':0x0,'rows':[]};var _0x32ce99=db[_0xedca('0x36')][_0xedca('0x37')];_0x255d64['model']=_[_0xedca('0x38')](_0x32ce99);_0x255d64[_0xedca('0x39')]=_[_0xedca('0x38')](_0x1af05b[_0xedca('0x39')]);_0x255d64[_0xedca('0x3a')]=_['intersection'](_0x255d64[_0xedca('0x3b')],_0x255d64['query']);_0x3ca7f6[_0xedca('0x3c')]=_['intersection'](_0x255d64[_0xedca('0x3b')],qs['fields'](_0x1af05b[_0xedca('0x39')]['fields']));_0x3ca7f6['attributes']=_0x3ca7f6[_0xedca('0x3c')]['length']?_0x3ca7f6[_0xedca('0x3c')]:_0x255d64[_0xedca('0x3b')];if(!_0x1af05b[_0xedca('0x39')][_0xedca('0x3d')](_0xedca('0x3e'))){_0x3ca7f6[_0xedca('0x2b')]=qs[_0xedca('0x2b')](_0x1af05b[_0xedca('0x39')]['limit']);_0x3ca7f6[_0xedca('0x2a')]=qs['offset'](_0x1af05b['query'][_0xedca('0x2a')]);}_0x3ca7f6[_0xedca('0x3f')]=qs[_0xedca('0x40')](_0x1af05b[_0xedca('0x39')][_0xedca('0x40')]);_0x3ca7f6['where']=qs['filters'](_[_0xedca('0x41')](_0x1af05b['query'],_0x255d64[_0xedca('0x3a')]));if(_0x1af05b['query'][_0xedca('0x42')]){_0x3ca7f6[_0xedca('0x43')]=_['merge'](_0x3ca7f6[_0xedca('0x43')],{'$or':_['map'](_0x32ce99,function(_0x2bad98){if(_0x2bad98[_0xedca('0x44')][_0xedca('0x45')]!=='VIRTUAL'){var _0x5a9eb6={};_0x5a9eb6[_0x2bad98[_0xedca('0x46')]]={'$like':'%'+_0x1af05b[_0xedca('0x39')][_0xedca('0x42')]+'%'};return _0x5a9eb6;}})});}_0x3ca7f6=_[_0xedca('0x47')]({},_0x3ca7f6,_0x1af05b[_0xedca('0x48')]);var _0x392a66={'where':_0x3ca7f6['where']};return db[_0xedca('0x36')][_0xedca('0x29')](_0x392a66)[_0xedca('0x49')](function(_0x4ba8a0){_0x10bf2d['count']=_0x4ba8a0;if(_0x1af05b[_0xedca('0x39')][_0xedca('0x4a')]){_0x3ca7f6[_0xedca('0x4b')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xedca('0x4c')](_0x3ca7f6);})[_0xedca('0x49')](function(_0xcab220){_0x10bf2d[_0xedca('0x4d')]=_0xcab220;return _0x10bf2d;})[_0xedca('0x49')](respondWithFilteredResult(_0x1fe65d,_0x3ca7f6))[_0xedca('0x27')](handleError(_0x1fe65d,null));};exports['show']=function(_0xc1a761,_0x2812ce){var _0x59ab68={'raw':![],'where':{'id':_0xc1a761[_0xedca('0x4e')]['id']}},_0xb0d4d9={};_0xb0d4d9['model']=_[_0xedca('0x38')](db['ServicenowAccount'][_0xedca('0x37')]);_0xb0d4d9[_0xedca('0x39')]=_[_0xedca('0x38')](_0xc1a761[_0xedca('0x39')]);_0xb0d4d9[_0xedca('0x3a')]=_[_0xedca('0x4f')](_0xb0d4d9[_0xedca('0x3b')],_0xb0d4d9[_0xedca('0x39')]);_0x59ab68[_0xedca('0x3c')]=_[_0xedca('0x4f')](_0xb0d4d9[_0xedca('0x3b')],qs[_0xedca('0x50')](_0xc1a761[_0xedca('0x39')][_0xedca('0x50')]));_0x59ab68[_0xedca('0x3c')]=_0x59ab68['attributes'][_0xedca('0x51')]?_0x59ab68[_0xedca('0x3c')]:_0xb0d4d9[_0xedca('0x3b')];if(_0xc1a761[_0xedca('0x39')][_0xedca('0x4a')]){_0x59ab68[_0xedca('0x4b')]=[{'all':!![]}];}_0x59ab68=_[_0xedca('0x47')]({},_0x59ab68,_0xc1a761[_0xedca('0x48')]);return db[_0xedca('0x36')][_0xedca('0x52')](_0x59ab68)[_0xedca('0x49')](handleEntityNotFound(_0x2812ce,null))[_0xedca('0x49')](respondWithResult(_0x2812ce,null))[_0xedca('0x27')](handleError(_0x2812ce,null));};exports[_0xedca('0x53')]=function(_0x1dc936,_0x4cb373){return db[_0xedca('0x36')][_0xedca('0x53')](_0x1dc936[_0xedca('0x54')],{})['then'](respondWithResult(_0x4cb373,0xc9))['catch'](handleError(_0x4cb373,null));};exports[_0xedca('0x2f')]=function(_0x524bb0,_0x40d75f){if(_0x524bb0[_0xedca('0x54')]['id']){delete _0x524bb0[_0xedca('0x54')]['id'];}return db[_0xedca('0x36')][_0xedca('0x52')]({'where':{'id':_0x524bb0['params']['id']}})[_0xedca('0x49')](handleEntityNotFound(_0x40d75f,null))['then'](saveUpdates(_0x524bb0['body'],null))[_0xedca('0x49')](respondWithResult(_0x40d75f,null))[_0xedca('0x27')](handleError(_0x40d75f,null));};exports[_0xedca('0x30')]=function(_0x4364d6,_0xe0e79c){return db[_0xedca('0x36')]['find']({'where':{'id':_0x4364d6[_0xedca('0x4e')]['id']}})[_0xedca('0x49')](handleEntityNotFound(_0xe0e79c,null))[_0xedca('0x49')](removeEntity(_0xe0e79c,null))[_0xedca('0x27')](handleError(_0xe0e79c,null));};exports[_0xedca('0x55')]=function(_0x5c8a83,_0x2b28f6,_0x11076e){var _0x36f73e={};var _0x14e01b={};var _0x52b52e;var _0x586cb5;return db[_0xedca('0x36')][_0xedca('0x56')]({'where':{'id':_0x5c8a83['params']['id']}})[_0xedca('0x49')](handleEntityNotFound(_0x2b28f6,null))[_0xedca('0x49')](function(_0x1e01b2){if(_0x1e01b2){_0x52b52e=_0x1e01b2;_0x14e01b['model']=_[_0xedca('0x38')](db[_0xedca('0x57')][_0xedca('0x37')]);_0x14e01b[_0xedca('0x39')]=_['keys'](_0x5c8a83['query']);_0x14e01b['filters']=_[_0xedca('0x4f')](_0x14e01b[_0xedca('0x3b')],_0x14e01b['query']);_0x36f73e[_0xedca('0x3c')]=_['intersection'](_0x14e01b['model'],qs['fields'](_0x5c8a83[_0xedca('0x39')][_0xedca('0x50')]));_0x36f73e[_0xedca('0x3c')]=_0x36f73e[_0xedca('0x3c')]['length']?_0x36f73e[_0xedca('0x3c')]:_0x14e01b[_0xedca('0x3b')];_0x36f73e[_0xedca('0x3f')]=qs[_0xedca('0x40')](_0x5c8a83[_0xedca('0x39')][_0xedca('0x40')]);_0x36f73e[_0xedca('0x43')]=qs[_0xedca('0x3a')](_[_0xedca('0x41')](_0x5c8a83['query'],_0x14e01b[_0xedca('0x3a')]));if(_0x5c8a83[_0xedca('0x39')][_0xedca('0x42')]){_0x36f73e[_0xedca('0x43')]=_[_0xedca('0x47')](_0x36f73e['where'],{'$or':_[_0xedca('0x58')](_0x36f73e[_0xedca('0x3c')],function(_0x27389a){var _0x4bc1a5={};_0x4bc1a5[_0x27389a]={'$like':'%'+_0x5c8a83[_0xedca('0x39')]['filter']+'%'};return _0x4bc1a5;})});}_0x36f73e=_[_0xedca('0x47')]({},_0x36f73e,_0x5c8a83['options']);return _0x52b52e[_0xedca('0x55')](_0x36f73e);}})[_0xedca('0x49')](function(_0x175662){if(_0x175662){_0x586cb5=_0x175662[_0xedca('0x51')];if(!_0x5c8a83[_0xedca('0x39')][_0xedca('0x3d')](_0xedca('0x3e'))){_0x36f73e[_0xedca('0x2b')]=qs[_0xedca('0x2b')](_0x5c8a83['query'][_0xedca('0x2b')]);_0x36f73e[_0xedca('0x2a')]=qs[_0xedca('0x2a')](_0x5c8a83[_0xedca('0x39')][_0xedca('0x2a')]);}return _0x52b52e[_0xedca('0x55')](_0x36f73e);}})[_0xedca('0x49')](function(_0x169c6b){if(_0x169c6b){return _0x169c6b?{'count':_0x586cb5,'rows':_0x169c6b}:null;}})['then'](respondWithResult(_0x2b28f6,null))[_0xedca('0x27')](handleError(_0x2b28f6,null));};exports['addConfiguration']=function(_0x355bf8,_0x1a4a2e,_0x5eead0){if(_0x355bf8[_0xedca('0x54')]['id']){delete _0x355bf8[_0xedca('0x54')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x355bf8[_0xedca('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1a4a2e,null))['then'](function(_0x5257cb){if(_0x5257cb){_0x355bf8['body'][_0xedca('0x59')]=_0x5257cb['id'];_0x355bf8[_0xedca('0x54')][_0xedca('0x5a')]=integrations[_0xedca('0x5b')](_0x355bf8[_0xedca('0x54')]['channel'],_0x355bf8['body'][_0xedca('0x44')]);_0x355bf8[_0xedca('0x54')][_0xedca('0x5c')]=integrations[_0xedca('0x5d')](_0x355bf8[_0xedca('0x54')]['channel'],_0x355bf8['body']['type']);return db[_0xedca('0x57')]['create'](_0x355bf8['body'],{'include':[{'model':db[_0xedca('0x5e')],'as':_0xedca('0x5a')},{'model':db[_0xedca('0x5e')],'as':'Descriptions'}]});}return null;})[_0xedca('0x49')](respondWithResult(_0x1a4a2e,null))[_0xedca('0x27')](handleError(_0x1a4a2e,null));};exports[_0xedca('0x5f')]=function(_0x19cc5e,_0x4d709d,_0x27aec4){var _0x2c92e0=['made_sla',_0xedca('0x60'),_0xedca('0x61'),_0xedca('0x62'),_0xedca('0x63'),_0xedca('0x64'),_0xedca('0x65'),_0xedca('0x66'),_0xedca('0x67')];var _0x32784a=['parent',_0xedca('0x68'),_0xedca('0x69'),_0xedca('0x6a'),_0xedca('0x6b'),_0xedca('0x6c'),_0xedca('0x6d'),_0xedca('0x60'),_0xedca('0x6e'),'number','resolved_by',_0xedca('0x6f'),_0xedca('0x70'),_0xedca('0x71'),_0xedca('0x72'),_0xedca('0x73'),_0xedca('0x74'),'sys_created_by',_0xedca('0x61'),_0xedca('0x3f'),'calendar_stc','closed_at',_0xedca('0x75'),_0xedca('0x76'),_0xedca('0x77'),_0xedca('0x78'),_0xedca('0x79'),_0xedca('0x7a'),_0xedca('0x7b'),_0xedca('0x7c'),'rfc','time_worked','expected_start',_0xedca('0x7d'),'business_duration',_0xedca('0x7e'),_0xedca('0x7f'),_0xedca('0x80'),'resolved_at',_0xedca('0x81'),_0xedca('0x82'),'subcategory','work_notes',_0xedca('0x83'),_0xedca('0x63'),'correlation_display','delivery_task',_0xedca('0x84'),'assignment_group',_0xedca('0x85'),_0xedca('0x86'),_0xedca('0x87'),_0xedca('0x88'),_0xedca('0x64'),_0xedca('0x89'),_0xedca('0x8a'),_0xedca('0x8b'),_0xedca('0x8c'),_0xedca('0x8d'),'sys_id',_0xedca('0x8e'),_0xedca('0x8f'),_0xedca('0x65'),_0xedca('0x90'),_0xedca('0x91'),_0xedca('0x92'),_0xedca('0x93'),_0xedca('0x94'),_0xedca('0x95'),_0xedca('0x66'),_0xedca('0x96'),_0xedca('0x97'),'approval',_0xedca('0x98'),'due_date',_0xedca('0x99'),'reopen_count',_0xedca('0x9a'),_0xedca('0x9b'),_0xedca('0x9c'),_0xedca('0x9d'),_0xedca('0x9e'),_0xedca('0x67')];var _0x325029='';var _0x21847d='';var _0x20497a=[];var _0x3fd410='';var _0xa5021a='';var _0x14dd00=[];var _0x3dc0f2='';var _0x147ed4='';var _0x54d122={};var _0x4f02a2='';return db[_0xedca('0x36')][_0xedca('0x56')]({'where':{'id':_0x19cc5e[_0xedca('0x4e')]['id']},'attributes':['id','username','password',_0xedca('0x9f'),_0xedca('0xa0'),_0xedca('0xa1')]})[_0xedca('0x49')](handleEntityNotFound(_0x4d709d,null))[_0xedca('0x49')](function(_0x1ee166){if(_0x1ee166){_0x4f02a2=_0x1ee166['remoteUri'];var _0x2f7466=_0x4f02a2[_0xedca('0xa2')](-0x1);if(_0x2f7466==='/'){_0x4f02a2=_0x4f02a2[_0xedca('0xa3')](0x0,_0x4f02a2[_0xedca('0xa4')](_0x2f7466));}_0x147ed4=util['format'](_0xedca('0xa5'),_0x4f02a2);_0x3dc0f2=util[_0xedca('0xa6')](_0xedca('0xa7'),_0x4f02a2);_0x54d122={'user':_0x1ee166[_0xedca('0xa8')],'pass':_0x1ee166[_0xedca('0xa9')]};var _0x4c0c0a={'method':_0xedca('0xaa'),'uri':_0x147ed4+_0xedca('0xab'),'auth':_0x54d122,'json':!![]};return rp(_0x4c0c0a);}})[_0xedca('0x49')](function(_0x3e90f0){if(_0x3e90f0[_0xedca('0x26')][_0xedca('0x51')]>0x0){_0x325029=_0x3e90f0[_0xedca('0x26')];}console[_0xedca('0xac')]('incident\x20table\x20objects',_0x325029);_0x14dd00=[];_0x21847d=Object['assign']([],_0x325029);_[_0xedca('0xad')](_0x21847d,function(_0x4bb783){return!_0x2c92e0[_0xedca('0xae')](_0x4bb783[_0xedca('0x34')]);});_0x21847d['forEach'](function(_0x3c5f60){var _0x1b2e23=createFieldObject(_0x3dc0f2,_0x54d122,_0x3c5f60[_0xedca('0xaf')],_0x3c5f60[_0xedca('0x34')],_0x3c5f60[_0xedca('0xb0')],![]);_0x14dd00[_0xedca('0xb1')](_0x1b2e23);});return Promise[_0xedca('0xb2')](_0x14dd00);})[_0xedca('0x49')](function(_0x5791bd){_0x20497a=_0x5791bd;_0x3fd410=Object[_0xedca('0xb3')]([],_0x325029);console['log'](_0xedca('0xb4'),_0x325029);_['remove'](_0x3fd410,function(_0x3eab4b){return _0x32784a['includes'](_0x3eab4b[_0xedca('0x34')]);});console[_0xedca('0xac')](_0xedca('0xb5'),_0x3fd410);_0x14dd00=[];_0x3fd410[_0xedca('0xb6')](function(_0x19be84){var _0x1859c5=createFieldObject(_0x3dc0f2,_0x54d122,_0x19be84[_0xedca('0xaf')],_0x19be84['name'],_0x19be84[_0xedca('0xb0')],!![]);_0x14dd00[_0xedca('0xb1')](_0x1859c5);});return Promise[_0xedca('0xb2')](_0x14dd00);})[_0xedca('0x49')](function(_0x44bfc8){_0xa5021a=_0x44bfc8;var _0x5123b3=_0x20497a[_0xedca('0xb7')](_0xa5021a);return{'count':_0x5123b3[_0xedca('0x51')],'rows':_0x5123b3};})['then'](respondWithResult(_0x4d709d,null))['catch'](function(_0x19d9ef){console['log']('ServiceNow\x20error:\x20'+_0x19d9ef);var _0x1ae556=_0x19cc5e[_0xedca('0x39')][_0xedca('0x1b')]?0x1f4:_0x19d9ef[_0xedca('0xb8')]||0x1f4;logger[_0xedca('0x22')](_0x19d9ef['stack']);delete _0x19d9ef[_0xedca('0x34')];if(_0x1ae556===0x191){_0x1ae556=0x190;}_0x4d709d[_0xedca('0x28')](_0x1ae556)[_0xedca('0x35')](_0x19cc5e[_0xedca('0x39')][_0xedca('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x19d9ef[_0xedca('0xb8')]}:_0x19d9ef);});};function createFieldObject(_0x2f083d,_0x99d0ac,_0x112eb5,_0x44be23,_0x5dc43c,_0x129a3d){return new Promise(function(_0x54b1ca,_0x1df810){var _0x393b88={'id':_0x44be23,'name':_0x5dc43c,'custom':_0x129a3d};if(_0x112eb5===_0xedca('0xb9')){_0x393b88[_0xedca('0x48')]=[{'name':_0xedca('0xba'),'value':'true'},{'name':_0xedca('0xbb'),'value':_0xedca('0xbc')}];_0x54b1ca(_0x393b88);}else{var _0x51d555={'method':_0xedca('0xaa'),'uri':_0x2f083d+_0xedca('0xbd')+_0x44be23,'auth':_0x99d0ac,'json':!![]};return rp(_0x51d555)[_0xedca('0x49')](function(_0x48f17f){var _0x9efcf3=[];if(_0x48f17f['result'][_0xedca('0x51')]>0x0){_0x48f17f[_0xedca('0x26')][_0xedca('0xb6')](function(_0x341b4c){if(_0x341b4c[_0xedca('0xbe')]===_0xedca('0xbc')){var _0x46babb={'name':_0x341b4c['label'],'value':_0x341b4c[_0xedca('0xbf')]};_0x9efcf3['push'](_0x46babb);}});}_0x393b88['options']=_0x9efcf3;if(_0x393b88[_0xedca('0x48')][_0xedca('0x51')]>0x0){_0x54b1ca(_0x393b88);}else{if(_0x129a3d==![]){_0x54b1ca();}else{_0x54b1ca(_0x393b88);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9407265..74b21f4 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x18e001,_0x2d1dc4){var _0x5e7333=function(_0x35ac30){while(--_0x35ac30){_0x18e001['push'](_0x18e001['shift']());}};_0x5e7333(++_0x2d1dc4);}(_0x814b,0x1a2));var _0xb814=function(_0x929c7e,_0x38c4cc){_0x929c7e=_0x929c7e-0x0;var _0x5de099=_0x814b[_0x929c7e];return _0x5de099;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x814b,0x1a2));var _0xb814=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x814b[_0x1b2255];return _0x33e57d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 3b4f398..ef8e9c8 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 _0x6324=['error','code','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1da746,_0x28d928){var _0x4a8fb8=function(_0x40bd95){while(--_0x40bd95){_0x1da746['push'](_0x1da746['shift']());}};_0x4a8fb8(++_0x28d928);}(_0x6324,0x116));var _0x4632=function(_0x5459c1,_0x36f6f0){_0x5459c1=_0x5459c1-0x0;var _0x3f99b5=_0x6324[_0x5459c1];return _0x3f99b5;};'use strict';var _=require('lodash');var util=require(_0x4632('0x0'));var moment=require(_0x4632('0x1'));var BPromise=require(_0x4632('0x2'));var rs=require(_0x4632('0x3'));var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require(_0x4632('0x5'))['db'];var utils=require(_0x4632('0x6'));var logger=require(_0x4632('0x7'))(_0x4632('0x8'));var config=require(_0x4632('0x9'));var jayson=require(_0x4632('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x472349,_0x1ae14c,_0x3f02c9){return new BPromise(function(_0x6d14f3,_0x55b0eb){return client[_0x4632('0xb')](_0x472349,_0x3f02c9)['then'](function(_0x5a6c4f){logger[_0x4632('0xc')](_0x4632('0xd'),_0x1ae14c,_0x4632('0xe'));logger[_0x4632('0xf')](_0x4632('0x10'),_0x1ae14c,_0x4632('0xe'),JSON[_0x4632('0x11')](_0x5a6c4f));if(_0x5a6c4f['error']){if(_0x5a6c4f[_0x4632('0x12')][_0x4632('0x13')]===0x1f4){logger['error'](_0x4632('0xd'),_0x1ae14c,_0x5a6c4f[_0x4632('0x12')]['message']);return _0x55b0eb(_0x5a6c4f[_0x4632('0x12')]['message']);}logger[_0x4632('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1ae14c,_0x5a6c4f[_0x4632('0x12')][_0x4632('0x14')]);return _0x6d14f3(_0x5a6c4f['error']['message']);}else{logger[_0x4632('0xc')](_0x4632('0xd'),_0x1ae14c,_0x4632('0xe'));_0x6d14f3(_0x5a6c4f[_0x4632('0x15')][_0x4632('0x14')]);}})[_0x4632('0x16')](function(_0x4ddd3e){logger[_0x4632('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1ae14c,_0x4ddd3e);_0x55b0eb(_0x4ddd3e);});});}exports['GetServicenowAccount']=function(_0x2a9380){var _0x453ce7=this;return new Promise(function(_0x5b8d16,_0xb536e1){return db[_0x4632('0x17')][_0x4632('0x18')]({'raw':_0x2a9380['options']?_0x2a9380[_0x4632('0x19')][_0x4632('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a9380[_0x4632('0x19')]?_0x2a9380['options'][_0x4632('0x1b')]||null:null,'attributes':_0x2a9380[_0x4632('0x19')]?_0x2a9380[_0x4632('0x19')][_0x4632('0x1c')]||null:null,'limit':_0x2a9380[_0x4632('0x19')]?_0x2a9380[_0x4632('0x19')][_0x4632('0x1d')]||null:null,'include':_0x2a9380['options']?_0x2a9380[_0x4632('0x19')]['include']?_['map'](_0x2a9380[_0x4632('0x19')][_0x4632('0x1e')],function(_0x318d6c){return{'model':db[_0x318d6c['model']],'as':_0x318d6c['as'],'attributes':_0x318d6c['attributes'],'include':_0x318d6c['include']?_[_0x4632('0x1f')](_0x318d6c['include'],function(_0x4e59d2){return{'model':db[_0x4e59d2['model']],'as':_0x4e59d2['as'],'attributes':_0x4e59d2['attributes'],'include':_0x4e59d2['include']?_[_0x4632('0x1f')](_0x4e59d2[_0x4632('0x1e')],function(_0x3438da){return{'model':db[_0x3438da[_0x4632('0x20')]],'as':_0x3438da['as'],'attributes':_0x3438da[_0x4632('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a2b9){logger['info'](_0x4632('0x21'),_0x2a9380);logger[_0x4632('0xf')](_0x4632('0x21'),_0x2a9380,JSON[_0x4632('0x11')](_0x25a2b9));_0x5b8d16(_0x25a2b9);})[_0x4632('0x16')](function(_0x34ebef){logger[_0x4632('0x12')](_0x4632('0x21'),_0x34ebef['message'],_0x2a9380);_0xb536e1(_0x453ce7[_0x4632('0x12')](0x1f4,_0x34ebef[_0x4632('0x14')]));});});};exports[_0x4632('0x22')]=function(_0x445253){var _0x422ce2=this;return new Promise(function(_0x303cfa,_0x5bb8dc){return db[_0x4632('0x17')][_0x4632('0x23')]({'raw':_0x445253[_0x4632('0x19')]?_0x445253['options']['raw']===undefined?!![]:![]:!![],'where':_0x445253[_0x4632('0x19')]?_0x445253[_0x4632('0x19')][_0x4632('0x1b')]||null:null,'attributes':_0x445253[_0x4632('0x19')]?_0x445253['options']['attributes']||null:null,'include':_0x445253['options']?_0x445253[_0x4632('0x19')][_0x4632('0x1e')]?_['map'](_0x445253[_0x4632('0x19')][_0x4632('0x1e')],function(_0xa84f3b){return{'model':db[_0xa84f3b['model']],'as':_0xa84f3b['as'],'attributes':_0xa84f3b[_0x4632('0x1c')],'include':_0xa84f3b[_0x4632('0x1e')]?_['map'](_0xa84f3b[_0x4632('0x1e')],function(_0x36366a){return{'model':db[_0x36366a['model']],'as':_0x36366a['as'],'attributes':_0x36366a[_0x4632('0x1c')],'include':_0x36366a[_0x4632('0x1e')]?_[_0x4632('0x1f')](_0x36366a[_0x4632('0x1e')],function(_0x321f66){return{'model':db[_0x321f66[_0x4632('0x20')]],'as':_0x321f66['as'],'attributes':_0x321f66[_0x4632('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4632('0x24')](function(_0x3f66e3){logger[_0x4632('0xc')](_0x4632('0x22'),_0x445253);logger[_0x4632('0xf')]('ShowServicenowAccount',_0x445253,JSON[_0x4632('0x11')](_0x3f66e3));_0x303cfa(_0x3f66e3);})[_0x4632('0x16')](function(_0x153792){logger[_0x4632('0x12')]('ShowServicenowAccount',_0x153792[_0x4632('0x14')],_0x445253);_0x5bb8dc(_0x422ce2[_0x4632('0x12')](0x1f4,_0x153792[_0x4632('0x14')]));});});}; \ No newline at end of file +var _0x75f6=['attributes','include','map','model','find','raw','where','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','options'];(function(_0x48cbdd,_0x5168cb){var _0x4d174b=function(_0xc16960){while(--_0xc16960){_0x48cbdd['push'](_0x48cbdd['shift']());}};_0x4d174b(++_0x5168cb);}(_0x75f6,0x128));var _0x675f=function(_0xa51bdc,_0x3e7c1a){_0xa51bdc=_0xa51bdc-0x0;var _0x1cd07e=_0x75f6[_0xa51bdc];return _0x1cd07e;};'use strict';var _=require(_0x675f('0x0'));var util=require(_0x675f('0x1'));var moment=require(_0x675f('0x2'));var BPromise=require(_0x675f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x675f('0x4'));var db=require(_0x675f('0x5'))['db'];var utils=require(_0x675f('0x6'));var logger=require(_0x675f('0x7'))(_0x675f('0x8'));var config=require(_0x675f('0x9'));var jayson=require(_0x675f('0xa'));var client=jayson['client'][_0x675f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37cd65,_0x340c4f,_0x3553c7){return new BPromise(function(_0x14f734,_0xc1923c){return client['request'](_0x37cd65,_0x3553c7)[_0x675f('0xc')](function(_0x3d3af7){logger[_0x675f('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x340c4f,_0x675f('0xe'));logger[_0x675f('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x340c4f,_0x675f('0xe'),JSON[_0x675f('0x10')](_0x3d3af7));if(_0x3d3af7['error']){if(_0x3d3af7[_0x675f('0x11')][_0x675f('0x12')]===0x1f4){logger['error'](_0x675f('0x13'),_0x340c4f,_0x3d3af7[_0x675f('0x11')][_0x675f('0x14')]);return _0xc1923c(_0x3d3af7[_0x675f('0x11')][_0x675f('0x14')]);}logger[_0x675f('0x11')](_0x675f('0x13'),_0x340c4f,_0x3d3af7[_0x675f('0x11')][_0x675f('0x14')]);return _0x14f734(_0x3d3af7['error']['message']);}else{logger['info'](_0x675f('0x13'),_0x340c4f,'request\x20sent');_0x14f734(_0x3d3af7['result']['message']);}})[_0x675f('0x15')](function(_0x4f482c){logger[_0x675f('0x11')](_0x675f('0x13'),_0x340c4f,_0x4f482c);_0xc1923c(_0x4f482c);});});}exports[_0x675f('0x16')]=function(_0x4abeeb){var _0xefeff6=this;return new Promise(function(_0x4483fa,_0x3fc688){return db['ServicenowAccount']['findAll']({'raw':_0x4abeeb[_0x675f('0x17')]?_0x4abeeb['options']['raw']===undefined?!![]:![]:!![],'where':_0x4abeeb['options']?_0x4abeeb['options']['where']||null:null,'attributes':_0x4abeeb['options']?_0x4abeeb[_0x675f('0x17')][_0x675f('0x18')]||null:null,'limit':_0x4abeeb[_0x675f('0x17')]?_0x4abeeb[_0x675f('0x17')]['limit']||null:null,'include':_0x4abeeb[_0x675f('0x17')]?_0x4abeeb['options'][_0x675f('0x19')]?_[_0x675f('0x1a')](_0x4abeeb['options']['include'],function(_0x4e3383){return{'model':db[_0x4e3383[_0x675f('0x1b')]],'as':_0x4e3383['as'],'attributes':_0x4e3383[_0x675f('0x18')],'include':_0x4e3383['include']?_['map'](_0x4e3383[_0x675f('0x19')],function(_0x344548){return{'model':db[_0x344548[_0x675f('0x1b')]],'as':_0x344548['as'],'attributes':_0x344548[_0x675f('0x18')],'include':_0x344548['include']?_['map'](_0x344548[_0x675f('0x19')],function(_0x3e59cf){return{'model':db[_0x3e59cf[_0x675f('0x1b')]],'as':_0x3e59cf['as'],'attributes':_0x3e59cf[_0x675f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4933ca){logger[_0x675f('0xd')](_0x675f('0x16'),_0x4abeeb);logger[_0x675f('0xf')](_0x675f('0x16'),_0x4abeeb,JSON[_0x675f('0x10')](_0x4933ca));_0x4483fa(_0x4933ca);})[_0x675f('0x15')](function(_0x112da1){logger[_0x675f('0x11')](_0x675f('0x16'),_0x112da1[_0x675f('0x14')],_0x4abeeb);_0x3fc688(_0xefeff6[_0x675f('0x11')](0x1f4,_0x112da1[_0x675f('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x2fa3b2){var _0x3011d0=this;return new Promise(function(_0x3c5f81,_0x39c25e){return db['ServicenowAccount'][_0x675f('0x1c')]({'raw':_0x2fa3b2[_0x675f('0x17')]?_0x2fa3b2[_0x675f('0x17')][_0x675f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fa3b2['options']?_0x2fa3b2['options'][_0x675f('0x1e')]||null:null,'attributes':_0x2fa3b2[_0x675f('0x17')]?_0x2fa3b2[_0x675f('0x17')][_0x675f('0x18')]||null:null,'include':_0x2fa3b2['options']?_0x2fa3b2[_0x675f('0x17')][_0x675f('0x19')]?_['map'](_0x2fa3b2[_0x675f('0x17')][_0x675f('0x19')],function(_0x48e4ef){return{'model':db[_0x48e4ef[_0x675f('0x1b')]],'as':_0x48e4ef['as'],'attributes':_0x48e4ef[_0x675f('0x18')],'include':_0x48e4ef[_0x675f('0x19')]?_[_0x675f('0x1a')](_0x48e4ef[_0x675f('0x19')],function(_0x1acaf8){return{'model':db[_0x1acaf8[_0x675f('0x1b')]],'as':_0x1acaf8['as'],'attributes':_0x1acaf8['attributes'],'include':_0x1acaf8['include']?_[_0x675f('0x1a')](_0x1acaf8[_0x675f('0x19')],function(_0x247937){return{'model':db[_0x247937[_0x675f('0x1b')]],'as':_0x247937['as'],'attributes':_0x247937[_0x675f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x675f('0xc')](function(_0x334206){logger[_0x675f('0xd')](_0x675f('0x1f'),_0x2fa3b2);logger['debug'](_0x675f('0x1f'),_0x2fa3b2,JSON[_0x675f('0x10')](_0x334206));_0x3c5f81(_0x334206);})[_0x675f('0x15')](function(_0x3a2666){logger[_0x675f('0x11')](_0x675f('0x1f'),_0x3a2666[_0x675f('0x14')],_0x2fa3b2);_0x39c25e(_0x3011d0[_0x675f('0x11')](0x1f4,_0x3a2666[_0x675f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7ff4135..646b15d 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 _0xbe45=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy'];(function(_0x18eae1,_0x2f237a){var _0x50c72d=function(_0x2fcc0c){while(--_0x2fcc0c){_0x18eae1['push'](_0x18eae1['shift']());}};_0x50c72d(++_0x2f237a);}(_0xbe45,0x19f));var _0x5be4=function(_0x38029b,_0x419fa2){_0x38029b=_0x38029b-0x0;var _0x5cdc38=_0xbe45[_0x38029b];return _0x5cdc38;};'use strict';var multer=require(_0x5be4('0x0'));var util=require(_0x5be4('0x1'));var path=require(_0x5be4('0x2'));var timeout=require(_0x5be4('0x3'));var express=require(_0x5be4('0x4'));var router=express[_0x5be4('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5be4('0x6'));var controller=require(_0x5be4('0x7'));router[_0x5be4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5be4('0x8')](_0x5be4('0x9'),auth[_0x5be4('0xa')](),controller[_0x5be4('0xb')]);router[_0x5be4('0x8')](_0x5be4('0xc'),auth[_0x5be4('0xa')](),controller[_0x5be4('0xd')]);router[_0x5be4('0x8')](_0x5be4('0xe'),auth['isAuthenticated'](),controller[_0x5be4('0xf')]);router['get'](_0x5be4('0x10'),auth[_0x5be4('0xa')](),controller['getDescriptions']);router[_0x5be4('0x11')]('/',auth[_0x5be4('0xa')](),controller['create']);router[_0x5be4('0x12')](_0x5be4('0x9'),auth[_0x5be4('0xa')](),controller[_0x5be4('0x13')]);router[_0x5be4('0x14')](_0x5be4('0x9'),auth['isAuthenticated'](),controller[_0x5be4('0x15')]);module[_0x5be4('0x16')]=router; \ No newline at end of file +var _0x923e=['get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x923e,0x1a8));var _0xe923=function(_0x78977e,_0x3c26c3){_0x78977e=_0x78977e-0x0;var _0x17d4e1=_0x923e[_0x78977e];return _0x17d4e1;};'use strict';var multer=require(_0xe923('0x0'));var util=require(_0xe923('0x1'));var path=require(_0xe923('0x2'));var timeout=require(_0xe923('0x3'));var express=require(_0xe923('0x4'));var router=express['Router']();var auth=require(_0xe923('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe923('0x6'));var controller=require(_0xe923('0x7'));router[_0xe923('0x8')]('/',auth[_0xe923('0x9')](),controller[_0xe923('0xa')]);router[_0xe923('0x8')](_0xe923('0xb'),auth[_0xe923('0x9')](),controller[_0xe923('0xc')]);router[_0xe923('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe923('0xd')]);router['get'](_0xe923('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xe923('0x8')](_0xe923('0xf'),auth['isAuthenticated'](),controller[_0xe923('0x10')]);router[_0xe923('0x11')]('/',auth['isAuthenticated'](),controller[_0xe923('0x12')]);router[_0xe923('0x13')](_0xe923('0xb'),auth[_0xe923('0x9')](),controller[_0xe923('0x14')]);router[_0xe923('0x15')](_0xe923('0xb'),auth[_0xe923('0x9')](),controller[_0xe923('0x16')]);module[_0xe923('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index bf3f90e..9211ba1 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 _0xf5bf=['sequelize','exports','STRING'];(function(_0x3bb462,_0xdc1cd2){var _0x2aeb62=function(_0x3d5fc7){while(--_0x3d5fc7){_0x3bb462['push'](_0x3bb462['shift']());}};_0x2aeb62(++_0xdc1cd2);}(_0xf5bf,0x1c2));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff5b('0x0'));module[_0xff5b('0x1')]={'name':{'type':Sequelize[_0xff5b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7616=['STRING','sequelize','exports'];(function(_0x3e1096,_0x557ab4){var _0x5b9e3d=function(_0x434ea7){while(--_0x434ea7){_0x3e1096['push'](_0x3e1096['shift']());}};_0x5b9e3d(++_0x557ab4);}(_0x7616,0x1a2));var _0x6761=function(_0x19df10,_0x3ab1b4){_0x19df10=_0x19df10-0x0;var _0x4c21e3=_0x7616[_0x19df10];return _0x4c21e3;};'use strict';var Sequelize=require(_0x6761('0x0'));module[_0x6761('0x1')]={'name':{'type':Sequelize[_0x6761('0x2')]},'description':{'type':Sequelize[_0x6761('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index fad17b6..135693e 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 _0xe14b=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','map','field','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','getFields','findOne','ServicenowField','nolimit','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/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x581d41,_0x5e60bf){var _0x266d6a=function(_0x37a6ca){while(--_0x37a6ca){_0x581d41['push'](_0x581d41['shift']());}};_0x266d6a(++_0x5e60bf);}(_0xe14b,0x93));var _0xbe14=function(_0x3c029a,_0x30fbba){_0x3c029a=_0x3c029a-0x0;var _0x619f33=_0xe14b[_0x3c029a];return _0x619f33;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbe14('0x10'))(_0xbe14('0x11'));var utils=require('../../config/utils');var config=require(_0xbe14('0x12'));var db=require(_0xbe14('0x13'))['db'];var jayson=require(_0xbe14('0x14'));var client=jayson[_0xbe14('0x15')][_0xbe14('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3b898d,_0x23a730,_0x2850cb){if(_0x2850cb){var _0x16893f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16893f[_0xbe14('0x17')](_0x23a730)){return _0x3b898d;}else{throw new Error(_0xbe14('0x18'));}}else{return _0x3b898d;}}function respondWithRpcPromise(_0x33fd54,_0x813399,_0x530538,_0x55b3a7){return new BPromise(function(_0x3f58f5,_0x3dc4a9){var _0xf4ac9=_0x55b3a7||client;return _0xf4ac9[_0xbe14('0x19')](_0x33fd54,_0x530538)['then'](function(_0x21c789){logger[_0xbe14('0x1a')](_0xbe14('0x1b'),_0x813399,_0xbe14('0x1c'));logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x813399,_0xbe14('0x1c'),JSON['stringify'](_0x21c789));if(_0x21c789[_0xbe14('0x1f')]){if(_0x21c789[_0xbe14('0x1f')][_0xbe14('0x20')]===0x1f4){logger[_0xbe14('0x1f')](_0xbe14('0x1b'),_0x813399,_0x21c789[_0xbe14('0x1f')]['message']);return _0x3dc4a9(_0x21c789[_0xbe14('0x1f')][_0xbe14('0x21')]);}logger[_0xbe14('0x1f')](_0xbe14('0x1b'),_0x813399,_0x21c789[_0xbe14('0x1f')]['message']);return _0x3f58f5(_0x21c789[_0xbe14('0x1f')]['message']);}else{logger[_0xbe14('0x1a')]('ServicenowConfiguration,\x20%s,\x20%s',_0x813399,_0xbe14('0x1c'));_0x3f58f5(_0x21c789['result'][_0xbe14('0x21')]);}})[_0xbe14('0x22')](function(_0x505dbd){logger[_0xbe14('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x813399,_0x505dbd);_0x3dc4a9(_0x505dbd);});});}function respondWithStatusCode(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0xcc;return function(_0x36a21e){if(_0x36a21e){return _0x4587a8[_0xbe14('0x23')](_0x4851f8);}return _0x4587a8[_0xbe14('0x24')](_0x4851f8)[_0xbe14('0x25')]();};}function respondWithResult(_0x15ef02,_0x2703f5){_0x2703f5=_0x2703f5||0xc8;return function(_0x55d001){if(_0x55d001){return _0x15ef02[_0xbe14('0x24')](_0x2703f5)[_0xbe14('0x26')](_0x55d001);}};}function respondWithFilteredResult(_0x391556,_0x169369){return function(_0x5dd475){if(_0x5dd475){var _0x16f884=_0x5dd475[_0xbe14('0x27')],_0x29fc64=_0x169369[_0xbe14('0x28')],_0x59bf34=_0x169369[_0xbe14('0x28')]+_0x169369[_0xbe14('0x29')],_0x3c3613;if(_0x59bf34>=_0x16f884){_0x59bf34=_0x16f884;_0x3c3613=0xc8;}else{_0x3c3613=0xce;}_0x391556[_0xbe14('0x24')](_0x3c3613);return _0x391556[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x29fc64+'-'+_0x59bf34+'/'+_0x16f884)[_0xbe14('0x26')](_0x5dd475);}return null;};}function patchUpdates(_0x16a159){return function(_0x40538f){try{jsonpatch[_0xbe14('0x2c')](_0x40538f,_0x16a159,!![]);}catch(_0x39dc0a){return BPromise[_0xbe14('0x2d')](_0x39dc0a);}return _0x40538f[_0xbe14('0x2e')]();};}function saveUpdates(_0xe6feb2,_0x6ba36c){return function(_0x2ff48e){if(_0x2ff48e){return _0x2ff48e[_0xbe14('0x2f')](_0xe6feb2)[_0xbe14('0x30')](function(_0x581e86){return _0x581e86;});}return null;};}function removeEntity(_0x2e33e1,_0x499793){return function(_0x58f8de){if(_0x58f8de){return _0x58f8de[_0xbe14('0x31')]()['then'](function(){_0x2e33e1[_0xbe14('0x24')](0xcc)[_0xbe14('0x25')]();});}};}function handleEntityNotFound(_0x52a25c,_0x50cb09){return function(_0x5798c7){if(!_0x5798c7){_0x52a25c[_0xbe14('0x23')](0x194);}return _0x5798c7;};}function handleError(_0xa3d24,_0x5f27b6){_0x5f27b6=_0x5f27b6||0x1f4;return function(_0x46c570){logger[_0xbe14('0x1f')](_0x46c570[_0xbe14('0x32')]);if(_0x46c570[_0xbe14('0x33')]){delete _0x46c570[_0xbe14('0x33')];}_0xa3d24['status'](_0x5f27b6)['send'](_0x46c570);};}exports[_0xbe14('0x34')]=function(_0x52b24c,_0x5dd7aa){var _0x5c5e9f={},_0x163ef7={},_0x393f6b={'count':0x0,'rows':[]};var _0x2bb45=db[_0xbe14('0x35')][_0xbe14('0x36')];_0x163ef7[_0xbe14('0x37')]=_[_0xbe14('0x38')](_0x2bb45);_0x163ef7[_0xbe14('0x39')]=_[_0xbe14('0x38')](_0x52b24c[_0xbe14('0x39')]);_0x163ef7[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x163ef7['model'],_0x163ef7['query']);_0x5c5e9f[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x163ef7[_0xbe14('0x37')],qs['fields'](_0x52b24c[_0xbe14('0x39')][_0xbe14('0x3d')]));_0x5c5e9f[_0xbe14('0x3c')]=_0x5c5e9f[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x5c5e9f[_0xbe14('0x3c')]:_0x163ef7[_0xbe14('0x37')];if(!_0x52b24c[_0xbe14('0x39')][_0xbe14('0x3f')]('nolimit')){_0x5c5e9f[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x52b24c[_0xbe14('0x39')][_0xbe14('0x29')]);_0x5c5e9f[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x52b24c['query'][_0xbe14('0x28')]);}_0x5c5e9f[_0xbe14('0x40')]=qs[_0xbe14('0x41')](_0x52b24c[_0xbe14('0x39')]['sort']);_0x5c5e9f['where']=qs[_0xbe14('0x3a')](_[_0xbe14('0x42')](_0x52b24c[_0xbe14('0x39')],_0x163ef7['filters']));if(_0x52b24c['query'][_0xbe14('0x43')]){_0x5c5e9f['where']=_['merge'](_0x5c5e9f[_0xbe14('0x44')],{'$or':_[_0xbe14('0x45')](_0x2bb45,function(_0x8216c3){if(_0x8216c3['type']['key']!=='VIRTUAL'){var _0x46fee8={};_0x46fee8[_0x8216c3[_0xbe14('0x46')]]={'$like':'%'+_0x52b24c[_0xbe14('0x39')]['filter']+'%'};return _0x46fee8;}})});}_0x5c5e9f=_[_0xbe14('0x47')]({},_0x5c5e9f,_0x52b24c[_0xbe14('0x48')]);var _0x32f22e={'where':_0x5c5e9f[_0xbe14('0x44')]};return db['ServicenowConfiguration']['count'](_0x32f22e)[_0xbe14('0x30')](function(_0x34ffa0){_0x393f6b[_0xbe14('0x27')]=_0x34ffa0;if(_0x52b24c[_0xbe14('0x39')][_0xbe14('0x49')]){_0x5c5e9f['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xbe14('0x4a')](_0x5c5e9f);})[_0xbe14('0x30')](function(_0x238c60){_0x393f6b[_0xbe14('0x4b')]=_0x238c60;return _0x393f6b;})['then'](respondWithFilteredResult(_0x5dd7aa,_0x5c5e9f))[_0xbe14('0x22')](handleError(_0x5dd7aa,null));};exports[_0xbe14('0x4c')]=function(_0x53e8ab,_0x396e40){var _0x2a35e5={'raw':![],'where':{'id':_0x53e8ab[_0xbe14('0x4d')]['id']}},_0x2d6ee8={};_0x2d6ee8['model']=_['keys'](db[_0xbe14('0x35')][_0xbe14('0x36')]);_0x2d6ee8['query']=_['keys'](_0x53e8ab[_0xbe14('0x39')]);_0x2d6ee8[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x2d6ee8[_0xbe14('0x37')],_0x2d6ee8[_0xbe14('0x39')]);_0x2a35e5[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x2d6ee8['model'],qs[_0xbe14('0x3d')](_0x53e8ab[_0xbe14('0x39')][_0xbe14('0x3d')]));_0x2a35e5[_0xbe14('0x3c')]=_0x2a35e5[_0xbe14('0x3c')]['length']?_0x2a35e5[_0xbe14('0x3c')]:_0x2d6ee8[_0xbe14('0x37')];if(_0x53e8ab[_0xbe14('0x39')][_0xbe14('0x49')]){_0x2a35e5[_0xbe14('0x4e')]=[{'all':!![]}];}_0x2a35e5=_[_0xbe14('0x47')]({},_0x2a35e5,_0x53e8ab['options']);return db['ServicenowConfiguration'][_0xbe14('0x4f')](_0x2a35e5)[_0xbe14('0x30')](handleEntityNotFound(_0x396e40,null))[_0xbe14('0x30')](respondWithResult(_0x396e40,null))['catch'](handleError(_0x396e40,null));};exports['create']=function(_0x44fe0d,_0x134878){return db['ServicenowConfiguration'][_0xbe14('0x50')](_0x44fe0d[_0xbe14('0x51')],{})['then'](respondWithResult(_0x134878,0xc9))[_0xbe14('0x22')](handleError(_0x134878,null));};exports['update']=function(_0x41ba58,_0x410c59){if(_0x41ba58[_0xbe14('0x51')]['id']){delete _0x41ba58['body']['id'];}return db[_0xbe14('0x35')][_0xbe14('0x4f')]({'where':{'id':_0x41ba58['params']['id']}})[_0xbe14('0x30')](handleEntityNotFound(_0x410c59,null))[_0xbe14('0x30')](saveUpdates(_0x41ba58[_0xbe14('0x51')],null))[_0xbe14('0x30')](respondWithResult(_0x410c59,null))[_0xbe14('0x22')](handleError(_0x410c59,null));};exports['destroy']=function(_0x42a346,_0x34cd66){return db[_0xbe14('0x35')][_0xbe14('0x4f')]({'where':{'id':_0x42a346[_0xbe14('0x4d')]['id']}})[_0xbe14('0x30')](handleEntityNotFound(_0x34cd66,null))[_0xbe14('0x30')](removeEntity(_0x34cd66,null))['catch'](handleError(_0x34cd66,null));};exports[_0xbe14('0x52')]=function(_0x1b47a4,_0x941ee2,_0x1201e2){var _0x246ed5={};var _0x2ed3fb={};var _0xd8f78f;var _0x32df3c;return db[_0xbe14('0x35')][_0xbe14('0x53')]({'where':{'id':_0x1b47a4[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x941ee2,null))['then'](function(_0x58dd79){if(_0x58dd79){_0xd8f78f=_0x58dd79;_0x2ed3fb[_0xbe14('0x37')]=_[_0xbe14('0x38')](db[_0xbe14('0x54')][_0xbe14('0x36')]);_0x2ed3fb[_0xbe14('0x39')]=_[_0xbe14('0x38')](_0x1b47a4[_0xbe14('0x39')]);_0x2ed3fb[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x2ed3fb[_0xbe14('0x37')],_0x2ed3fb[_0xbe14('0x39')]);_0x246ed5[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x2ed3fb[_0xbe14('0x37')],qs[_0xbe14('0x3d')](_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x3d')]));_0x246ed5[_0xbe14('0x3c')]=_0x246ed5[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x246ed5['attributes']:_0x2ed3fb[_0xbe14('0x37')];_0x246ed5[_0xbe14('0x40')]=qs[_0xbe14('0x41')](_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x41')]);_0x246ed5[_0xbe14('0x44')]=qs[_0xbe14('0x3a')](_[_0xbe14('0x42')](_0x1b47a4[_0xbe14('0x39')],_0x2ed3fb[_0xbe14('0x3a')]));if(_0x1b47a4['query'][_0xbe14('0x43')]){_0x246ed5[_0xbe14('0x44')]=_[_0xbe14('0x47')](_0x246ed5[_0xbe14('0x44')],{'$or':_[_0xbe14('0x45')](_0x246ed5['attributes'],function(_0x42b341){var _0x120077={};_0x120077[_0x42b341]={'$like':'%'+_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x43')]+'%'};return _0x120077;})});}_0x246ed5=_[_0xbe14('0x47')]({},_0x246ed5,_0x1b47a4['options']);return _0xd8f78f[_0xbe14('0x52')](_0x246ed5);}})[_0xbe14('0x30')](function(_0x7ea146){if(_0x7ea146){_0x32df3c=_0x7ea146[_0xbe14('0x3e')];if(!_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x3f')](_0xbe14('0x55'))){_0x246ed5[_0xbe14('0x29')]=qs['limit'](_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x29')]);_0x246ed5[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1b47a4[_0xbe14('0x39')][_0xbe14('0x28')]);}return _0xd8f78f[_0xbe14('0x52')](_0x246ed5);}})['then'](function(_0x4eedd2){if(_0x4eedd2){return _0x4eedd2?{'count':_0x32df3c,'rows':_0x4eedd2}:null;}})[_0xbe14('0x30')](respondWithResult(_0x941ee2,null))[_0xbe14('0x22')](handleError(_0x941ee2,null));};exports[_0xbe14('0x56')]=function(_0x2510a0,_0x312504,_0x28cade){var _0x23a32f={};var _0x43511e={};var _0x50e644;var _0x5ca835;return db[_0xbe14('0x35')][_0xbe14('0x53')]({'where':{'id':_0x2510a0[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x312504,null))[_0xbe14('0x30')](function(_0x16bca1){if(_0x16bca1){_0x50e644=_0x16bca1;_0x43511e[_0xbe14('0x37')]=_[_0xbe14('0x38')](db[_0xbe14('0x54')][_0xbe14('0x36')]);_0x43511e[_0xbe14('0x39')]=_['keys'](_0x2510a0[_0xbe14('0x39')]);_0x43511e[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x43511e[_0xbe14('0x37')],_0x43511e[_0xbe14('0x39')]);_0x23a32f[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x43511e['model'],qs[_0xbe14('0x3d')](_0x2510a0[_0xbe14('0x39')][_0xbe14('0x3d')]));_0x23a32f[_0xbe14('0x3c')]=_0x23a32f[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x23a32f[_0xbe14('0x3c')]:_0x43511e[_0xbe14('0x37')];_0x23a32f['order']=qs[_0xbe14('0x41')](_0x2510a0[_0xbe14('0x39')][_0xbe14('0x41')]);_0x23a32f[_0xbe14('0x44')]=qs[_0xbe14('0x3a')](_[_0xbe14('0x42')](_0x2510a0['query'],_0x43511e[_0xbe14('0x3a')]));if(_0x2510a0[_0xbe14('0x39')][_0xbe14('0x43')]){_0x23a32f[_0xbe14('0x44')]=_['merge'](_0x23a32f[_0xbe14('0x44')],{'$or':_[_0xbe14('0x45')](_0x23a32f[_0xbe14('0x3c')],function(_0x1e7770){var _0x80b6ec={};_0x80b6ec[_0x1e7770]={'$like':'%'+_0x2510a0[_0xbe14('0x39')][_0xbe14('0x43')]+'%'};return _0x80b6ec;})});}_0x23a32f=_['merge']({},_0x23a32f,_0x2510a0[_0xbe14('0x48')]);return _0x50e644['getSubjects'](_0x23a32f);}})[_0xbe14('0x30')](function(_0x5d85d3){if(_0x5d85d3){_0x5ca835=_0x5d85d3[_0xbe14('0x3e')];if(!_0x2510a0[_0xbe14('0x39')][_0xbe14('0x3f')]('nolimit')){_0x23a32f[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x2510a0[_0xbe14('0x39')]['limit']);_0x23a32f[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x2510a0[_0xbe14('0x39')][_0xbe14('0x28')]);}return _0x50e644['getSubjects'](_0x23a32f);}})[_0xbe14('0x30')](function(_0x39bc54){if(_0x39bc54){return _0x39bc54?{'count':_0x5ca835,'rows':_0x39bc54}:null;}})[_0xbe14('0x30')](respondWithResult(_0x312504,null))[_0xbe14('0x22')](handleError(_0x312504,null));};exports[_0xbe14('0x57')]=function(_0x2b9732,_0x2737ba,_0x5ab298){var _0x2ff94c={};var _0x123f4f={};var _0x2137d5;var _0x5c89a0;return db[_0xbe14('0x35')][_0xbe14('0x53')]({'where':{'id':_0x2b9732[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2737ba,null))[_0xbe14('0x30')](function(_0x1205d1){if(_0x1205d1){_0x2137d5=_0x1205d1;_0x123f4f['model']=_[_0xbe14('0x38')](db['ServicenowField'][_0xbe14('0x36')]);_0x123f4f[_0xbe14('0x39')]=_['keys'](_0x2b9732['query']);_0x123f4f[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x123f4f[_0xbe14('0x37')],_0x123f4f['query']);_0x2ff94c[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x123f4f[_0xbe14('0x37')],qs[_0xbe14('0x3d')](_0x2b9732['query']['fields']));_0x2ff94c[_0xbe14('0x3c')]=_0x2ff94c[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2ff94c[_0xbe14('0x3c')]:_0x123f4f[_0xbe14('0x37')];_0x2ff94c[_0xbe14('0x40')]=qs[_0xbe14('0x41')](_0x2b9732['query'][_0xbe14('0x41')]);_0x2ff94c['where']=qs[_0xbe14('0x3a')](_[_0xbe14('0x42')](_0x2b9732[_0xbe14('0x39')],_0x123f4f[_0xbe14('0x3a')]));if(_0x2b9732['query'][_0xbe14('0x43')]){_0x2ff94c[_0xbe14('0x44')]=_[_0xbe14('0x47')](_0x2ff94c['where'],{'$or':_[_0xbe14('0x45')](_0x2ff94c[_0xbe14('0x3c')],function(_0x4090bc){var _0x34a277={};_0x34a277[_0x4090bc]={'$like':'%'+_0x2b9732[_0xbe14('0x39')][_0xbe14('0x43')]+'%'};return _0x34a277;})});}_0x2ff94c=_[_0xbe14('0x47')]({},_0x2ff94c,_0x2b9732[_0xbe14('0x48')]);return _0x2137d5[_0xbe14('0x57')](_0x2ff94c);}})[_0xbe14('0x30')](function(_0x2bf94c){if(_0x2bf94c){_0x5c89a0=_0x2bf94c[_0xbe14('0x3e')];if(!_0x2b9732[_0xbe14('0x39')][_0xbe14('0x3f')](_0xbe14('0x55'))){_0x2ff94c[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x2b9732[_0xbe14('0x39')][_0xbe14('0x29')]);_0x2ff94c[_0xbe14('0x28')]=qs['offset'](_0x2b9732[_0xbe14('0x39')]['offset']);}return _0x2137d5[_0xbe14('0x57')](_0x2ff94c);}})[_0xbe14('0x30')](function(_0x262bc0){if(_0x262bc0){return _0x262bc0?{'count':_0x5c89a0,'rows':_0x262bc0}:null;}})[_0xbe14('0x30')](respondWithResult(_0x2737ba,null))[_0xbe14('0x22')](handleError(_0x2737ba,null));}; \ No newline at end of file +var _0xc4aa=['order','getSubjects','getDescriptions','rawAttributes','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','../../config/license/hardware','api','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','ServicenowConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','params','create','body','find','getFields','findOne','ServicenowField'];(function(_0x2c9544,_0xe85f38){var _0x50bc45=function(_0x161161){while(--_0x161161){_0x2c9544['push'](_0x2c9544['shift']());}};_0x50bc45(++_0xe85f38);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var hardwareService=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xac4a('0x15'));var client=jayson[_0xac4a('0x16')][_0xac4a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5e16aa,_0x21a79,_0x68424a){if(_0x68424a){var _0x247b78=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x247b78[_0xac4a('0x18')](_0x21a79)){return _0x5e16aa;}else{throw new Error(_0xac4a('0x19'));}}else{return _0x5e16aa;}}function respondWithRpcPromise(_0x3b71c0,_0x34bc01,_0x33c287,_0x190418){return new BPromise(function(_0x42c7fc,_0x11e101){var _0x26dbb8=_0x190418||client;return _0x26dbb8['request'](_0x3b71c0,_0x33c287)[_0xac4a('0x1a')](function(_0x34d797){logger[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x34bc01,_0xac4a('0x1d'));logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x34bc01,_0xac4a('0x1d'),JSON['stringify'](_0x34d797));if(_0x34d797['error']){if(_0x34d797[_0xac4a('0x20')][_0xac4a('0x21')]===0x1f4){logger[_0xac4a('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34bc01,_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);return _0x11e101(_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);}logger[_0xac4a('0x20')](_0xac4a('0x1c'),_0x34bc01,_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);return _0x42c7fc(_0x34d797['error'][_0xac4a('0x22')]);}else{logger[_0xac4a('0x1b')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34bc01,_0xac4a('0x1d'));_0x42c7fc(_0x34d797[_0xac4a('0x23')][_0xac4a('0x22')]);}})[_0xac4a('0x24')](function(_0x4d2d6c){logger[_0xac4a('0x20')](_0xac4a('0x1c'),_0x34bc01,_0x4d2d6c);_0x11e101(_0x4d2d6c);});});}function respondWithStatusCode(_0x15435c,_0x412494){_0x412494=_0x412494||0xcc;return function(_0x594f36){if(_0x594f36){return _0x15435c[_0xac4a('0x25')](_0x412494);}return _0x15435c[_0xac4a('0x26')](_0x412494)[_0xac4a('0x27')]();};}function respondWithResult(_0x3e2c69,_0x3bc318){_0x3bc318=_0x3bc318||0xc8;return function(_0x1d0539){if(_0x1d0539){return _0x3e2c69[_0xac4a('0x26')](_0x3bc318)[_0xac4a('0x28')](_0x1d0539);}};}function respondWithFilteredResult(_0x472c57,_0x1c13dc){return function(_0x20202c){if(_0x20202c){var _0x4e17ce=_0x20202c[_0xac4a('0x29')],_0x23b061=_0x1c13dc[_0xac4a('0x2a')],_0x267a22=_0x1c13dc['offset']+_0x1c13dc['limit'],_0x42a33c;if(_0x267a22>=_0x4e17ce){_0x267a22=_0x4e17ce;_0x42a33c=0xc8;}else{_0x42a33c=0xce;}_0x472c57[_0xac4a('0x26')](_0x42a33c);return _0x472c57[_0xac4a('0x2b')](_0xac4a('0x2c'),_0x23b061+'-'+_0x267a22+'/'+_0x4e17ce)['json'](_0x20202c);}return null;};}function patchUpdates(_0x4bda1f){return function(_0x355755){try{jsonpatch[_0xac4a('0x2d')](_0x355755,_0x4bda1f,!![]);}catch(_0x228629){return BPromise[_0xac4a('0x2e')](_0x228629);}return _0x355755[_0xac4a('0x2f')]();};}function saveUpdates(_0x53d3a5,_0x6dcc7f){return function(_0x482afc){if(_0x482afc){return _0x482afc[_0xac4a('0x30')](_0x53d3a5)['then'](function(_0x17e6de){return _0x17e6de;});}return null;};}function removeEntity(_0xfbe355,_0x31501b){return function(_0x228aa7){if(_0x228aa7){return _0x228aa7[_0xac4a('0x31')]()[_0xac4a('0x1a')](function(){_0xfbe355[_0xac4a('0x26')](0xcc)[_0xac4a('0x27')]();});}};}function handleEntityNotFound(_0x29fb3b,_0xfd7c16){return function(_0x36ab49){if(!_0x36ab49){_0x29fb3b[_0xac4a('0x25')](0x194);}return _0x36ab49;};}function handleError(_0x1a9be2,_0x1a9d4e){_0x1a9d4e=_0x1a9d4e||0x1f4;return function(_0x5634e2){logger[_0xac4a('0x20')](_0x5634e2[_0xac4a('0x32')]);if(_0x5634e2['name']){delete _0x5634e2[_0xac4a('0x33')];}_0x1a9be2[_0xac4a('0x26')](_0x1a9d4e)['send'](_0x5634e2);};}exports['index']=function(_0x11f0be,_0x1ba096){var _0x1b42b6={},_0x3de9e2={},_0x4f5986={'count':0x0,'rows':[]};var _0x453d02=db[_0xac4a('0x34')]['rawAttributes'];_0x3de9e2[_0xac4a('0x35')]=_[_0xac4a('0x36')](_0x453d02);_0x3de9e2[_0xac4a('0x37')]=_['keys'](_0x11f0be[_0xac4a('0x37')]);_0x3de9e2[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0x3de9e2['model'],_0x3de9e2[_0xac4a('0x37')]);_0x1b42b6[_0xac4a('0x3a')]=_['intersection'](_0x3de9e2['model'],qs[_0xac4a('0x3b')](_0x11f0be['query']['fields']));_0x1b42b6['attributes']=_0x1b42b6['attributes'][_0xac4a('0x3c')]?_0x1b42b6[_0xac4a('0x3a')]:_0x3de9e2[_0xac4a('0x35')];if(!_0x11f0be[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x1b42b6[_0xac4a('0x3f')]=qs[_0xac4a('0x3f')](_0x11f0be[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x1b42b6[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x11f0be['query']['offset']);}_0x1b42b6['order']=qs[_0xac4a('0x40')](_0x11f0be[_0xac4a('0x37')][_0xac4a('0x40')]);_0x1b42b6[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0x11f0be[_0xac4a('0x37')],_0x3de9e2[_0xac4a('0x38')]));if(_0x11f0be[_0xac4a('0x37')][_0xac4a('0x43')]){_0x1b42b6['where']=_[_0xac4a('0x44')](_0x1b42b6[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x453d02,function(_0x3f24a1){if(_0x3f24a1[_0xac4a('0x46')]['key']!==_0xac4a('0x47')){var _0x1b77bb={};_0x1b77bb[_0x3f24a1['field']]={'$like':'%'+_0x11f0be[_0xac4a('0x37')]['filter']+'%'};return _0x1b77bb;}})});}_0x1b42b6=_[_0xac4a('0x44')]({},_0x1b42b6,_0x11f0be[_0xac4a('0x48')]);var _0xe5ee0f={'where':_0x1b42b6[_0xac4a('0x41')]};return db[_0xac4a('0x34')][_0xac4a('0x29')](_0xe5ee0f)[_0xac4a('0x1a')](function(_0x30a169){_0x4f5986[_0xac4a('0x29')]=_0x30a169;if(_0x11f0be[_0xac4a('0x37')][_0xac4a('0x49')]){_0x1b42b6[_0xac4a('0x4a')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xac4a('0x4b')](_0x1b42b6);})[_0xac4a('0x1a')](function(_0xeca4e9){_0x4f5986['rows']=_0xeca4e9;return _0x4f5986;})[_0xac4a('0x1a')](respondWithFilteredResult(_0x1ba096,_0x1b42b6))[_0xac4a('0x24')](handleError(_0x1ba096,null));};exports['show']=function(_0x42969b,_0x5a7f6e){var _0x244950={'raw':![],'where':{'id':_0x42969b[_0xac4a('0x4c')]['id']}},_0xe620f6={};_0xe620f6['model']=_['keys'](db[_0xac4a('0x34')]['rawAttributes']);_0xe620f6[_0xac4a('0x37')]=_['keys'](_0x42969b[_0xac4a('0x37')]);_0xe620f6['filters']=_[_0xac4a('0x39')](_0xe620f6[_0xac4a('0x35')],_0xe620f6[_0xac4a('0x37')]);_0x244950[_0xac4a('0x3a')]=_['intersection'](_0xe620f6[_0xac4a('0x35')],qs[_0xac4a('0x3b')](_0x42969b[_0xac4a('0x37')][_0xac4a('0x3b')]));_0x244950[_0xac4a('0x3a')]=_0x244950[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x244950['attributes']:_0xe620f6[_0xac4a('0x35')];if(_0x42969b[_0xac4a('0x37')]['includeAll']){_0x244950[_0xac4a('0x4a')]=[{'all':!![]}];}_0x244950=_[_0xac4a('0x44')]({},_0x244950,_0x42969b[_0xac4a('0x48')]);return db[_0xac4a('0x34')]['find'](_0x244950)[_0xac4a('0x1a')](handleEntityNotFound(_0x5a7f6e,null))[_0xac4a('0x1a')](respondWithResult(_0x5a7f6e,null))[_0xac4a('0x24')](handleError(_0x5a7f6e,null));};exports[_0xac4a('0x4d')]=function(_0x890910,_0x49fbc3){return db[_0xac4a('0x34')]['create'](_0x890910[_0xac4a('0x4e')],{})[_0xac4a('0x1a')](respondWithResult(_0x49fbc3,0xc9))['catch'](handleError(_0x49fbc3,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x4e')]['id'];}return db[_0xac4a('0x34')][_0xac4a('0x4f')]({'where':{'id':_0x437466[_0xac4a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x1a')](saveUpdates(_0x437466[_0xac4a('0x4e')],null))[_0xac4a('0x1a')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x24')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x31')]=function(_0x411547,_0x36179a){return db['ServicenowConfiguration'][_0xac4a('0x4f')]({'where':{'id':_0x411547[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x1a')](removeEntity(_0x36179a,null))[_0xac4a('0x24')](handleError(_0x36179a,null));};exports[_0xac4a('0x50')]=function(_0x213df2,_0x236f57,_0x159e43){var _0x786d9={};var _0x3b175a={};var _0x38dd4f;var _0x400ac4;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x213df2[_0xac4a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x236f57,null))[_0xac4a('0x1a')](function(_0x479ebc){if(_0x479ebc){_0x38dd4f=_0x479ebc;_0x3b175a[_0xac4a('0x35')]=_['keys'](db[_0xac4a('0x52')]['rawAttributes']);_0x3b175a[_0xac4a('0x37')]=_['keys'](_0x213df2['query']);_0x3b175a[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0x3b175a[_0xac4a('0x35')],_0x3b175a[_0xac4a('0x37')]);_0x786d9[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x3b175a['model'],qs[_0xac4a('0x3b')](_0x213df2['query'][_0xac4a('0x3b')]));_0x786d9['attributes']=_0x786d9[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x786d9[_0xac4a('0x3a')]:_0x3b175a[_0xac4a('0x35')];_0x786d9[_0xac4a('0x53')]=qs[_0xac4a('0x40')](_0x213df2[_0xac4a('0x37')][_0xac4a('0x40')]);_0x786d9[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0x213df2[_0xac4a('0x37')],_0x3b175a[_0xac4a('0x38')]));if(_0x213df2[_0xac4a('0x37')][_0xac4a('0x43')]){_0x786d9[_0xac4a('0x41')]=_[_0xac4a('0x44')](_0x786d9['where'],{'$or':_[_0xac4a('0x45')](_0x786d9[_0xac4a('0x3a')],function(_0x4fb812){var _0x3c3576={};_0x3c3576[_0x4fb812]={'$like':'%'+_0x213df2[_0xac4a('0x37')][_0xac4a('0x43')]+'%'};return _0x3c3576;})});}_0x786d9=_[_0xac4a('0x44')]({},_0x786d9,_0x213df2[_0xac4a('0x48')]);return _0x38dd4f['getFields'](_0x786d9);}})['then'](function(_0x45f3c3){if(_0x45f3c3){_0x400ac4=_0x45f3c3[_0xac4a('0x3c')];if(!_0x213df2[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x786d9[_0xac4a('0x3f')]=qs[_0xac4a('0x3f')](_0x213df2[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x786d9[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x213df2['query']['offset']);}return _0x38dd4f[_0xac4a('0x50')](_0x786d9);}})[_0xac4a('0x1a')](function(_0x2954fc){if(_0x2954fc){return _0x2954fc?{'count':_0x400ac4,'rows':_0x2954fc}:null;}})[_0xac4a('0x1a')](respondWithResult(_0x236f57,null))[_0xac4a('0x24')](handleError(_0x236f57,null));};exports[_0xac4a('0x54')]=function(_0x1d24bb,_0x34e42f,_0x453d62){var _0x2a5acc={};var _0xb09b89={};var _0xb12cc5;var _0x5f0173;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x1d24bb[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x34e42f,null))['then'](function(_0xc61e94){if(_0xc61e94){_0xb12cc5=_0xc61e94;_0xb09b89['model']=_[_0xac4a('0x36')](db[_0xac4a('0x52')]['rawAttributes']);_0xb09b89['query']=_[_0xac4a('0x36')](_0x1d24bb[_0xac4a('0x37')]);_0xb09b89[_0xac4a('0x38')]=_['intersection'](_0xb09b89[_0xac4a('0x35')],_0xb09b89['query']);_0x2a5acc[_0xac4a('0x3a')]=_['intersection'](_0xb09b89['model'],qs[_0xac4a('0x3b')](_0x1d24bb['query'][_0xac4a('0x3b')]));_0x2a5acc['attributes']=_0x2a5acc[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x2a5acc['attributes']:_0xb09b89[_0xac4a('0x35')];_0x2a5acc['order']=qs[_0xac4a('0x40')](_0x1d24bb[_0xac4a('0x37')]['sort']);_0x2a5acc[_0xac4a('0x41')]=qs['filters'](_['pick'](_0x1d24bb[_0xac4a('0x37')],_0xb09b89['filters']));if(_0x1d24bb[_0xac4a('0x37')]['filter']){_0x2a5acc['where']=_[_0xac4a('0x44')](_0x2a5acc[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x2a5acc['attributes'],function(_0x504256){var _0x1327ea={};_0x1327ea[_0x504256]={'$like':'%'+_0x1d24bb[_0xac4a('0x37')]['filter']+'%'};return _0x1327ea;})});}_0x2a5acc=_['merge']({},_0x2a5acc,_0x1d24bb[_0xac4a('0x48')]);return _0xb12cc5[_0xac4a('0x54')](_0x2a5acc);}})[_0xac4a('0x1a')](function(_0x36df3d){if(_0x36df3d){_0x5f0173=_0x36df3d[_0xac4a('0x3c')];if(!_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x2a5acc[_0xac4a('0x3f')]=qs['limit'](_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x2a5acc[_0xac4a('0x2a')]=qs['offset'](_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x2a')]);}return _0xb12cc5[_0xac4a('0x54')](_0x2a5acc);}})[_0xac4a('0x1a')](function(_0x3d2b5c){if(_0x3d2b5c){return _0x3d2b5c?{'count':_0x5f0173,'rows':_0x3d2b5c}:null;}})['then'](respondWithResult(_0x34e42f,null))[_0xac4a('0x24')](handleError(_0x34e42f,null));};exports[_0xac4a('0x55')]=function(_0xc9d040,_0x37e519,_0x72c90c){var _0x451248={};var _0xd7bdd6={};var _0x5b9e82;var _0x2e3bb7;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0xc9d040[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x37e519,null))[_0xac4a('0x1a')](function(_0x547eec){if(_0x547eec){_0x5b9e82=_0x547eec;_0xd7bdd6[_0xac4a('0x35')]=_[_0xac4a('0x36')](db[_0xac4a('0x52')][_0xac4a('0x56')]);_0xd7bdd6['query']=_[_0xac4a('0x36')](_0xc9d040['query']);_0xd7bdd6[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0xd7bdd6['model'],_0xd7bdd6['query']);_0x451248[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0xd7bdd6[_0xac4a('0x35')],qs['fields'](_0xc9d040[_0xac4a('0x37')]['fields']));_0x451248[_0xac4a('0x3a')]=_0x451248[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x451248[_0xac4a('0x3a')]:_0xd7bdd6[_0xac4a('0x35')];_0x451248['order']=qs['sort'](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x40')]);_0x451248[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0xc9d040[_0xac4a('0x37')],_0xd7bdd6[_0xac4a('0x38')]));if(_0xc9d040[_0xac4a('0x37')]['filter']){_0x451248['where']=_[_0xac4a('0x44')](_0x451248[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x451248[_0xac4a('0x3a')],function(_0x1353af){var _0x2ea4a4={};_0x2ea4a4[_0x1353af]={'$like':'%'+_0xc9d040[_0xac4a('0x37')][_0xac4a('0x43')]+'%'};return _0x2ea4a4;})});}_0x451248=_['merge']({},_0x451248,_0xc9d040['options']);return _0x5b9e82[_0xac4a('0x55')](_0x451248);}})[_0xac4a('0x1a')](function(_0x22804e){if(_0x22804e){_0x2e3bb7=_0x22804e[_0xac4a('0x3c')];if(!_0xc9d040[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x451248['limit']=qs[_0xac4a('0x3f')](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x451248['offset']=qs[_0xac4a('0x2a')](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x2a')]);}return _0x5b9e82[_0xac4a('0x55')](_0x451248);}})[_0xac4a('0x1a')](function(_0x27d023){if(_0x27d023){return _0x27d023?{'count':_0x2e3bb7,'rows':_0x27d023}:null;}})[_0xac4a('0x1a')](respondWithResult(_0x37e519,null))[_0xac4a('0x24')](handleError(_0x37e519,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index a741820..2ab6e2b 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 _0xc8da=['api','moment','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x41007e,_0x2d23b7){var _0xf6126d=function(_0xf1bc88){while(--_0xf1bc88){_0x41007e['push'](_0x41007e['shift']());}};_0xf6126d(++_0x2d23b7);}(_0xc8da,0x8d));var _0xac8d=function(_0x1fd05,_0x57f487){_0x1fd05=_0x1fd05-0x0;var _0x1e79a1=_0xc8da[_0x1fd05];return _0x1e79a1;};'use strict';var _=require(_0xac8d('0x0'));var util=require(_0xac8d('0x1'));var logger=require(_0xac8d('0x2'))(_0xac8d('0x3'));var moment=require(_0xac8d('0x4'));var BPromise=require('bluebird');var rp=require(_0xac8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac8d('0x6'));var config=require(_0xac8d('0x7'));var attributes=require(_0xac8d('0x8'));module[_0xac8d('0x9')]=function(_0x4bfeb2,_0x201109){return _0x4bfeb2[_0xac8d('0xa')](_0xac8d('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe345=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe345,0xaf));var _0x5e34=function(_0x47ae44,_0x1ecf33){_0x47ae44=_0x47ae44-0x0;var _0x37c675=_0xe345[_0x47ae44];return _0x37c675;};'use strict';var _=require(_0x5e34('0x0'));var util=require(_0x5e34('0x1'));var logger=require(_0x5e34('0x2'))(_0x5e34('0x3'));var moment=require(_0x5e34('0x4'));var BPromise=require(_0x5e34('0x5'));var rp=require(_0x5e34('0x6'));var fs=require('fs');var path=require(_0x5e34('0x7'));var rimraf=require(_0x5e34('0x8'));var config=require(_0x5e34('0x9'));var attributes=require(_0x5e34('0xa'));module['exports']=function(_0xf356dc,_0x51ef99){return _0xf356dc[_0x5e34('0xb')](_0x5e34('0xc'),attributes,{'tableName':_0x5e34('0xd'),'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 56dcdb8..12206eb 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 _0xfbe6=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xfbe6,0xf7));var _0x6fbe=function(_0x512738,_0x52ef6b){_0x512738=_0x512738-0x0;var _0x1bdb2b=_0xfbe6[_0x512738];return _0x1bdb2b;};'use strict';var _=require(_0x6fbe('0x0'));var util=require(_0x6fbe('0x1'));var moment=require(_0x6fbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x6fbe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fbe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fbe('0x5'))('rpc');var config=require(_0x6fbe('0x6'));var jayson=require(_0x6fbe('0x7'));var client=jayson['client'][_0x6fbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a4f40,_0x145a1b,_0xc1d998){return new BPromise(function(_0x57c5f8,_0x318df5){return client[_0x6fbe('0x9')](_0x1a4f40,_0xc1d998)[_0x6fbe('0xa')](function(_0x3221c6){logger[_0x6fbe('0xb')](_0x6fbe('0xc'),_0x145a1b,_0x6fbe('0xd'));logger['debug'](_0x6fbe('0xe'),_0x145a1b,_0x6fbe('0xd'),JSON[_0x6fbe('0xf')](_0x3221c6));if(_0x3221c6[_0x6fbe('0x10')]){if(_0x3221c6[_0x6fbe('0x10')]['code']===0x1f4){logger['error'](_0x6fbe('0xc'),_0x145a1b,_0x3221c6[_0x6fbe('0x10')][_0x6fbe('0x11')]);return _0x318df5(_0x3221c6['error']['message']);}logger[_0x6fbe('0x10')](_0x6fbe('0xc'),_0x145a1b,_0x3221c6[_0x6fbe('0x10')]['message']);return _0x57c5f8(_0x3221c6[_0x6fbe('0x10')][_0x6fbe('0x11')]);}else{logger[_0x6fbe('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x145a1b,_0x6fbe('0xd'));_0x57c5f8(_0x3221c6['result']['message']);}})[_0x6fbe('0x12')](function(_0x3111b5){logger[_0x6fbe('0x10')](_0x6fbe('0xc'),_0x145a1b,_0x3111b5);_0x318df5(_0x3111b5);});});} \ No newline at end of file +var _0x6d62=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x6d62,0x1dd));var _0x26d6=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6d62[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x26d6('0x0'));var util=require(_0x26d6('0x1'));var moment=require(_0x26d6('0x2'));var BPromise=require(_0x26d6('0x3'));var rs=require(_0x26d6('0x4'));var fs=require('fs');var Redis=require(_0x26d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26d6('0x6'));var logger=require(_0x26d6('0x7'))(_0x26d6('0x8'));var config=require(_0x26d6('0x9'));var jayson=require(_0x26d6('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x494823,_0x2d1c6e,_0x40ebd5){return new BPromise(function(_0xccfb2e,_0x3bb0af){return client[_0x26d6('0xb')](_0x494823,_0x40ebd5)[_0x26d6('0xc')](function(_0x4053b1){logger[_0x26d6('0xd')](_0x26d6('0xe'),_0x2d1c6e,_0x26d6('0xf'));logger[_0x26d6('0x10')](_0x26d6('0x11'),_0x2d1c6e,_0x26d6('0xf'),JSON[_0x26d6('0x12')](_0x4053b1));if(_0x4053b1[_0x26d6('0x13')]){if(_0x4053b1[_0x26d6('0x13')][_0x26d6('0x14')]===0x1f4){logger[_0x26d6('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2d1c6e,_0x4053b1[_0x26d6('0x13')][_0x26d6('0x15')]);return _0x3bb0af(_0x4053b1[_0x26d6('0x13')][_0x26d6('0x15')]);}logger[_0x26d6('0x13')](_0x26d6('0xe'),_0x2d1c6e,_0x4053b1[_0x26d6('0x13')][_0x26d6('0x15')]);return _0xccfb2e(_0x4053b1[_0x26d6('0x13')][_0x26d6('0x15')]);}else{logger[_0x26d6('0xd')](_0x26d6('0xe'),_0x2d1c6e,_0x26d6('0xf'));_0xccfb2e(_0x4053b1[_0x26d6('0x16')][_0x26d6('0x15')]);}})[_0x26d6('0x17')](function(_0xe1766f){logger['error'](_0x26d6('0xe'),_0x2d1c6e,_0xe1766f);_0x3bb0af(_0xe1766f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9b02718..a91c392 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 _0xa418=['/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated'];(function(_0x199037,_0x830990){var _0x30613d=function(_0x2f9772){while(--_0x2f9772){_0x199037['push'](_0x199037['shift']());}};_0x30613d(++_0x830990);}(_0xa418,0x1c9));var _0x8a41=function(_0x5d014e,_0x37e90c){_0x5d014e=_0x5d014e-0x0;var _0x2a4fa2=_0xa418[_0x5d014e];return _0x2a4fa2;};'use strict';var multer=require(_0x8a41('0x0'));var util=require(_0x8a41('0x1'));var path=require(_0x8a41('0x2'));var timeout=require(_0x8a41('0x3'));var express=require(_0x8a41('0x4'));var router=express['Router']();var auth=require(_0x8a41('0x5'));var interaction=require(_0x8a41('0x6'));var config=require(_0x8a41('0x7'));var controller=require(_0x8a41('0x8'));router[_0x8a41('0x9')]('/',auth[_0x8a41('0xa')](),controller['index']);router[_0x8a41('0x9')](_0x8a41('0xb'),auth[_0x8a41('0xa')](),controller[_0x8a41('0xc')]);router['post']('/',auth[_0x8a41('0xa')](),controller[_0x8a41('0xd')]);router['put'](_0x8a41('0xb'),auth[_0x8a41('0xa')](),controller[_0x8a41('0xe')]);router[_0x8a41('0xf')](_0x8a41('0xb'),auth[_0x8a41('0xa')](),controller[_0x8a41('0x10')]);module[_0x8a41('0x11')]=router; \ No newline at end of file +var _0x6a7e=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a7e,0x125));var _0xe6a7=function(_0x4561e4,_0x26f251){_0x4561e4=_0x4561e4-0x0;var _0x45cc93=_0x6a7e[_0x4561e4];return _0x45cc93;};'use strict';var multer=require(_0xe6a7('0x0'));var util=require(_0xe6a7('0x1'));var path=require(_0xe6a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe6a7('0x3'));var router=express[_0xe6a7('0x4')]();var auth=require(_0xe6a7('0x5'));var interaction=require(_0xe6a7('0x6'));var config=require(_0xe6a7('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xe6a7('0x8')](),controller[_0xe6a7('0x9')]);router[_0xe6a7('0xa')](_0xe6a7('0xb'),auth['isAuthenticated'](),controller[_0xe6a7('0xc')]);router[_0xe6a7('0xd')]('/',auth[_0xe6a7('0x8')](),controller[_0xe6a7('0xe')]);router[_0xe6a7('0xf')](_0xe6a7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe6a7('0x10')]('/:id',auth[_0xe6a7('0x8')](),controller[_0xe6a7('0x11')]);module[_0xe6a7('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 29aa912..6044a1a 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 _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0xe10b42,_0x450598){var _0x44607e=function(_0x5aa619){while(--_0x5aa619){_0xe10b42['push'](_0xe10b42['shift']());}};_0x44607e(++_0x450598);}(_0xdace,0xc5));var _0xedac=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xdace[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6c76,0x184));var _0x66c7=function(_0x5448f4,_0x319382){_0x5448f4=_0x5448f4-0x0;var _0x3bd0a8=_0x6c76[_0x5448f4];return _0x3bd0a8;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 3b54b26..f2b12b6 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 _0xcbc6=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowField','model','keys','query'];(function(_0x308d8d,_0x479ebd){var _0x374fcd=function(_0x5f1fb5){while(--_0x5f1fb5){_0x308d8d['push'](_0x308d8d['shift']());}};_0x374fcd(++_0x479ebd);}(_0xcbc6,0x64));var _0x6cbc=function(_0x303e2c,_0x4aafae){_0x303e2c=_0x303e2c-0x0;var _0x400cd7=_0xcbc6[_0x303e2c];return _0x400cd7;};'use strict';var pdf=require(_0x6cbc('0x0'));var emlformat=require(_0x6cbc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6cbc('0x2'));var moment=require(_0x6cbc('0x3'));var BPromise=require(_0x6cbc('0x4'));var Mustache=require(_0x6cbc('0x5'));var util=require('util');var path=require(_0x6cbc('0x6'));var sox=require(_0x6cbc('0x7'));var csv=require('to-csv');var ejs=require(_0x6cbc('0x8'));var fs=require('fs');var _=require(_0x6cbc('0x9'));var squel=require(_0x6cbc('0xa'));var crypto=require('crypto');var jsforce=require(_0x6cbc('0xb'));var deskjs=require(_0x6cbc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6cbc('0xd'));var Papa=require('papaparse');var Redis=require(_0x6cbc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6cbc('0xf'));var logger=require(_0x6cbc('0x10'))(_0x6cbc('0x11'));var utils=require(_0x6cbc('0x12'));var config=require(_0x6cbc('0x13'));var db=require(_0x6cbc('0x14'))['db'];function respondWithStatusCode(_0x2222cc,_0x28552c){_0x28552c=_0x28552c||0xcc;return function(_0x477d55){if(_0x477d55){return _0x2222cc[_0x6cbc('0x15')](_0x28552c);}return _0x2222cc[_0x6cbc('0x16')](_0x28552c)[_0x6cbc('0x17')]();};}function respondWithResult(_0x13b4f1,_0x4984bb){_0x4984bb=_0x4984bb||0xc8;return function(_0x3128cf){if(_0x3128cf){return _0x13b4f1['status'](_0x4984bb)['json'](_0x3128cf);}};}function respondWithFilteredResult(_0x112b11,_0x2c3b9f){return function(_0x556bf0){if(_0x556bf0){var _0x4831c1=_0x556bf0[_0x6cbc('0x18')],_0x2e7380=_0x2c3b9f[_0x6cbc('0x19')],_0x590e52=_0x2c3b9f[_0x6cbc('0x19')]+_0x2c3b9f[_0x6cbc('0x1a')],_0x23998c;if(_0x590e52>=_0x4831c1){_0x590e52=_0x4831c1;_0x23998c=0xc8;}else{_0x23998c=0xce;}_0x112b11[_0x6cbc('0x16')](_0x23998c);return _0x112b11[_0x6cbc('0x1b')]('Content-Range',_0x2e7380+'-'+_0x590e52+'/'+_0x4831c1)[_0x6cbc('0x1c')](_0x556bf0);}return null;};}function patchUpdates(_0x228b4c){return function(_0x3a4006){try{jsonpatch[_0x6cbc('0x1d')](_0x3a4006,_0x228b4c,!![]);}catch(_0x181c4f){return BPromise[_0x6cbc('0x1e')](_0x181c4f);}return _0x3a4006[_0x6cbc('0x1f')]();};}function saveUpdates(_0x11c93f,_0x2d9899){return function(_0x52bc83){if(_0x52bc83){return _0x52bc83[_0x6cbc('0x20')](_0x11c93f)[_0x6cbc('0x21')](function(_0x40df7d){return _0x40df7d;});}return null;};}function removeEntity(_0x3f4142,_0x9c3948){return function(_0x664716){if(_0x664716){return _0x664716[_0x6cbc('0x22')]()[_0x6cbc('0x21')](function(){_0x3f4142[_0x6cbc('0x16')](0xcc)[_0x6cbc('0x17')]();});}};}function handleEntityNotFound(_0x4264a2,_0x33e047){return function(_0x3981ac){if(!_0x3981ac){_0x4264a2[_0x6cbc('0x15')](0x194);}return _0x3981ac;};}function handleError(_0x4399e6,_0x2e5c7b){_0x2e5c7b=_0x2e5c7b||0x1f4;return function(_0x4ed23a){logger[_0x6cbc('0x23')](_0x4ed23a[_0x6cbc('0x24')]);if(_0x4ed23a[_0x6cbc('0x25')]){delete _0x4ed23a[_0x6cbc('0x25')];}_0x4399e6[_0x6cbc('0x16')](_0x2e5c7b)[_0x6cbc('0x26')](_0x4ed23a);};}exports[_0x6cbc('0x27')]=function(_0x1cf225,_0x4e2111){var _0x2347e5={},_0x1442ef={},_0xd4da46={'count':0x0,'rows':[]};var _0x4549da=db[_0x6cbc('0x28')]['rawAttributes'];_0x1442ef[_0x6cbc('0x29')]=_[_0x6cbc('0x2a')](_0x4549da);_0x1442ef[_0x6cbc('0x2b')]=_['keys'](_0x1cf225['query']);_0x1442ef[_0x6cbc('0x2c')]=_[_0x6cbc('0x2d')](_0x1442ef['model'],_0x1442ef[_0x6cbc('0x2b')]);_0x2347e5[_0x6cbc('0x2e')]=_['intersection'](_0x1442ef[_0x6cbc('0x29')],qs[_0x6cbc('0x2f')](_0x1cf225[_0x6cbc('0x2b')][_0x6cbc('0x2f')]));_0x2347e5[_0x6cbc('0x2e')]=_0x2347e5['attributes'][_0x6cbc('0x30')]?_0x2347e5[_0x6cbc('0x2e')]:_0x1442ef[_0x6cbc('0x29')];if(!_0x1cf225['query'][_0x6cbc('0x31')](_0x6cbc('0x32'))){_0x2347e5[_0x6cbc('0x1a')]=qs['limit'](_0x1cf225[_0x6cbc('0x2b')]['limit']);_0x2347e5[_0x6cbc('0x19')]=qs[_0x6cbc('0x19')](_0x1cf225['query'][_0x6cbc('0x19')]);}_0x2347e5[_0x6cbc('0x33')]=qs[_0x6cbc('0x34')](_0x1cf225[_0x6cbc('0x2b')][_0x6cbc('0x34')]);_0x2347e5[_0x6cbc('0x35')]=qs['filters'](_[_0x6cbc('0x36')](_0x1cf225[_0x6cbc('0x2b')],_0x1442ef[_0x6cbc('0x2c')]));if(_0x1cf225[_0x6cbc('0x2b')]['filter']){_0x2347e5[_0x6cbc('0x35')]=_[_0x6cbc('0x37')](_0x2347e5[_0x6cbc('0x35')],{'$or':_[_0x6cbc('0x38')](_0x4549da,function(_0x10861a){if(_0x10861a[_0x6cbc('0x39')][_0x6cbc('0x3a')]!==_0x6cbc('0x3b')){var _0x2e954c={};_0x2e954c[_0x10861a[_0x6cbc('0x3c')]]={'$like':'%'+_0x1cf225[_0x6cbc('0x2b')]['filter']+'%'};return _0x2e954c;}})});}_0x2347e5=_[_0x6cbc('0x37')]({},_0x2347e5,_0x1cf225[_0x6cbc('0x3d')]);var _0xcf7bc6={'where':_0x2347e5[_0x6cbc('0x35')]};return db[_0x6cbc('0x28')][_0x6cbc('0x18')](_0xcf7bc6)[_0x6cbc('0x21')](function(_0x19d276){_0xd4da46[_0x6cbc('0x18')]=_0x19d276;if(_0x1cf225[_0x6cbc('0x2b')][_0x6cbc('0x3e')]){_0x2347e5[_0x6cbc('0x3f')]=[{'all':!![]}];}return db[_0x6cbc('0x28')][_0x6cbc('0x40')](_0x2347e5);})[_0x6cbc('0x21')](function(_0x75d600){_0xd4da46['rows']=_0x75d600;return _0xd4da46;})[_0x6cbc('0x21')](respondWithFilteredResult(_0x4e2111,_0x2347e5))[_0x6cbc('0x41')](handleError(_0x4e2111,null));};exports[_0x6cbc('0x42')]=function(_0x44eadc,_0x2549ba){var _0x160f0b={'raw':!![],'where':{'id':_0x44eadc[_0x6cbc('0x43')]['id']}},_0x3469fc={};_0x3469fc[_0x6cbc('0x29')]=_[_0x6cbc('0x2a')](db[_0x6cbc('0x28')][_0x6cbc('0x44')]);_0x3469fc[_0x6cbc('0x2b')]=_[_0x6cbc('0x2a')](_0x44eadc[_0x6cbc('0x2b')]);_0x3469fc['filters']=_[_0x6cbc('0x2d')](_0x3469fc[_0x6cbc('0x29')],_0x3469fc[_0x6cbc('0x2b')]);_0x160f0b['attributes']=_[_0x6cbc('0x2d')](_0x3469fc[_0x6cbc('0x29')],qs['fields'](_0x44eadc[_0x6cbc('0x2b')][_0x6cbc('0x2f')]));_0x160f0b[_0x6cbc('0x2e')]=_0x160f0b[_0x6cbc('0x2e')][_0x6cbc('0x30')]?_0x160f0b[_0x6cbc('0x2e')]:_0x3469fc[_0x6cbc('0x29')];if(_0x44eadc[_0x6cbc('0x2b')]['includeAll']){_0x160f0b[_0x6cbc('0x3f')]=[{'all':!![]}];}_0x160f0b=_[_0x6cbc('0x37')]({},_0x160f0b,_0x44eadc['options']);return db[_0x6cbc('0x28')][_0x6cbc('0x45')](_0x160f0b)[_0x6cbc('0x21')](handleEntityNotFound(_0x2549ba,null))[_0x6cbc('0x21')](respondWithResult(_0x2549ba,null))['catch'](handleError(_0x2549ba,null));};exports[_0x6cbc('0x46')]=function(_0x53efcf,_0x4fade1){return db[_0x6cbc('0x28')][_0x6cbc('0x46')](_0x53efcf[_0x6cbc('0x47')],{})[_0x6cbc('0x21')](respondWithResult(_0x4fade1,0xc9))[_0x6cbc('0x41')](handleError(_0x4fade1,null));};exports[_0x6cbc('0x20')]=function(_0x3e50f6,_0x4a2e57){if(_0x3e50f6[_0x6cbc('0x47')]['id']){delete _0x3e50f6['body']['id'];}return db[_0x6cbc('0x28')][_0x6cbc('0x45')]({'where':{'id':_0x3e50f6[_0x6cbc('0x43')]['id']}})[_0x6cbc('0x21')](handleEntityNotFound(_0x4a2e57,null))[_0x6cbc('0x21')](saveUpdates(_0x3e50f6[_0x6cbc('0x47')],null))[_0x6cbc('0x21')](respondWithResult(_0x4a2e57,null))[_0x6cbc('0x41')](handleError(_0x4a2e57,null));};exports['destroy']=function(_0xc23c34,_0x10c0f8){return db[_0x6cbc('0x28')]['find']({'where':{'id':_0xc23c34[_0x6cbc('0x43')]['id']}})[_0x6cbc('0x21')](handleEntityNotFound(_0x10c0f8,null))[_0x6cbc('0x21')](removeEntity(_0x10c0f8,null))[_0x6cbc('0x41')](handleError(_0x10c0f8,null));}; \ No newline at end of file +var _0x2f0c=['offset','limit','set','apply','reject','save','then','sendStatus','error','stack','name','send','ServicenowField','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','field','filter','options','include','findAll','rows','catch','params','body','update','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count'];(function(_0x28c438,_0x2145ff){var _0x4a525b=function(_0xc2e4d0){while(--_0xc2e4d0){_0x28c438['push'](_0x28c438['shift']());}};_0x4a525b(++_0x2145ff);}(_0x2f0c,0xae));var _0xc2f0=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0x2f0c[_0x1fc82b];return _0x4c6679;};'use strict';var pdf=require(_0xc2f0('0x0'));var emlformat=require(_0xc2f0('0x1'));var rimraf=require(_0xc2f0('0x2'));var zipdir=require(_0xc2f0('0x3'));var jsonpatch=require(_0xc2f0('0x4'));var rp=require(_0xc2f0('0x5'));var moment=require('moment');var BPromise=require(_0xc2f0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc2f0('0x7'));var csv=require(_0xc2f0('0x8'));var ejs=require(_0xc2f0('0x9'));var fs=require('fs');var _=require(_0xc2f0('0xa'));var squel=require(_0xc2f0('0xb'));var crypto=require(_0xc2f0('0xc'));var jsforce=require(_0xc2f0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc2f0('0x8'));var querystring=require('querystring');var Papa=require(_0xc2f0('0xe'));var Redis=require('ioredis');var authService=require(_0xc2f0('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc2f0('0x10'));var logger=require('../../config/logger')(_0xc2f0('0x11'));var utils=require('../../config/utils');var config=require(_0xc2f0('0x12'));var db=require(_0xc2f0('0x13'))['db'];function respondWithStatusCode(_0x54ecfe,_0x599b8d){_0x599b8d=_0x599b8d||0xcc;return function(_0x23db34){if(_0x23db34){return _0x54ecfe['sendStatus'](_0x599b8d);}return _0x54ecfe[_0xc2f0('0x14')](_0x599b8d)[_0xc2f0('0x15')]();};}function respondWithResult(_0x2f0bf7,_0x2768f7){_0x2768f7=_0x2768f7||0xc8;return function(_0xf0a441){if(_0xf0a441){return _0x2f0bf7[_0xc2f0('0x14')](_0x2768f7)[_0xc2f0('0x16')](_0xf0a441);}};}function respondWithFilteredResult(_0x29afc3,_0x31b746){return function(_0x4003ce){if(_0x4003ce){var _0xb61534=_0x4003ce[_0xc2f0('0x17')],_0x25fb79=_0x31b746[_0xc2f0('0x18')],_0x522be5=_0x31b746[_0xc2f0('0x18')]+_0x31b746[_0xc2f0('0x19')],_0x1d6c64;if(_0x522be5>=_0xb61534){_0x522be5=_0xb61534;_0x1d6c64=0xc8;}else{_0x1d6c64=0xce;}_0x29afc3[_0xc2f0('0x14')](_0x1d6c64);return _0x29afc3[_0xc2f0('0x1a')]('Content-Range',_0x25fb79+'-'+_0x522be5+'/'+_0xb61534)[_0xc2f0('0x16')](_0x4003ce);}return null;};}function patchUpdates(_0x416b5c){return function(_0xef10b1){try{jsonpatch[_0xc2f0('0x1b')](_0xef10b1,_0x416b5c,!![]);}catch(_0x16f6a4){return BPromise[_0xc2f0('0x1c')](_0x16f6a4);}return _0xef10b1[_0xc2f0('0x1d')]();};}function saveUpdates(_0x1c5e6a,_0x54b24f){return function(_0x12f8b8){if(_0x12f8b8){return _0x12f8b8['update'](_0x1c5e6a)[_0xc2f0('0x1e')](function(_0x4218a7){return _0x4218a7;});}return null;};}function removeEntity(_0x4b2531,_0x550dbc){return function(_0x447a69){if(_0x447a69){return _0x447a69['destroy']()[_0xc2f0('0x1e')](function(){_0x4b2531[_0xc2f0('0x14')](0xcc)[_0xc2f0('0x15')]();});}};}function handleEntityNotFound(_0x26857f,_0x4f70e4){return function(_0x211681){if(!_0x211681){_0x26857f[_0xc2f0('0x1f')](0x194);}return _0x211681;};}function handleError(_0x369f9f,_0x41fcd4){_0x41fcd4=_0x41fcd4||0x1f4;return function(_0x303f3e){logger[_0xc2f0('0x20')](_0x303f3e[_0xc2f0('0x21')]);if(_0x303f3e[_0xc2f0('0x22')]){delete _0x303f3e[_0xc2f0('0x22')];}_0x369f9f['status'](_0x41fcd4)[_0xc2f0('0x23')](_0x303f3e);};}exports['index']=function(_0x36ab87,_0x5dadc2){var _0x1033b5={},_0x411515={},_0x54cb5c={'count':0x0,'rows':[]};var _0x3a6ece=db[_0xc2f0('0x24')][_0xc2f0('0x25')];_0x411515['model']=_[_0xc2f0('0x26')](_0x3a6ece);_0x411515['query']=_[_0xc2f0('0x26')](_0x36ab87[_0xc2f0('0x27')]);_0x411515[_0xc2f0('0x28')]=_[_0xc2f0('0x29')](_0x411515[_0xc2f0('0x2a')],_0x411515[_0xc2f0('0x27')]);_0x1033b5['attributes']=_['intersection'](_0x411515[_0xc2f0('0x2a')],qs['fields'](_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x2b')]));_0x1033b5[_0xc2f0('0x2c')]=_0x1033b5[_0xc2f0('0x2c')][_0xc2f0('0x2d')]?_0x1033b5[_0xc2f0('0x2c')]:_0x411515['model'];if(!_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x2e')](_0xc2f0('0x2f'))){_0x1033b5['limit']=qs[_0xc2f0('0x19')](_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x19')]);_0x1033b5[_0xc2f0('0x18')]=qs['offset'](_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x18')]);}_0x1033b5[_0xc2f0('0x30')]=qs[_0xc2f0('0x31')](_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x31')]);_0x1033b5[_0xc2f0('0x32')]=qs['filters'](_['pick'](_0x36ab87[_0xc2f0('0x27')],_0x411515[_0xc2f0('0x28')]));if(_0x36ab87[_0xc2f0('0x27')]['filter']){_0x1033b5[_0xc2f0('0x32')]=_[_0xc2f0('0x33')](_0x1033b5[_0xc2f0('0x32')],{'$or':_[_0xc2f0('0x34')](_0x3a6ece,function(_0x1baf69){if(_0x1baf69['type']['key']!==_0xc2f0('0x35')){var _0x552c42={};_0x552c42[_0x1baf69[_0xc2f0('0x36')]]={'$like':'%'+_0x36ab87[_0xc2f0('0x27')][_0xc2f0('0x37')]+'%'};return _0x552c42;}})});}_0x1033b5=_[_0xc2f0('0x33')]({},_0x1033b5,_0x36ab87[_0xc2f0('0x38')]);var _0x50fd4f={'where':_0x1033b5['where']};return db[_0xc2f0('0x24')]['count'](_0x50fd4f)[_0xc2f0('0x1e')](function(_0x2f6e1d){_0x54cb5c[_0xc2f0('0x17')]=_0x2f6e1d;if(_0x36ab87[_0xc2f0('0x27')]['includeAll']){_0x1033b5[_0xc2f0('0x39')]=[{'all':!![]}];}return db['ServicenowField'][_0xc2f0('0x3a')](_0x1033b5);})[_0xc2f0('0x1e')](function(_0x2fd950){_0x54cb5c[_0xc2f0('0x3b')]=_0x2fd950;return _0x54cb5c;})['then'](respondWithFilteredResult(_0x5dadc2,_0x1033b5))[_0xc2f0('0x3c')](handleError(_0x5dadc2,null));};exports['show']=function(_0x25f3f0,_0x26596b){var _0xc13f31={'raw':!![],'where':{'id':_0x25f3f0[_0xc2f0('0x3d')]['id']}},_0x1d2bc0={};_0x1d2bc0[_0xc2f0('0x2a')]=_[_0xc2f0('0x26')](db[_0xc2f0('0x24')][_0xc2f0('0x25')]);_0x1d2bc0[_0xc2f0('0x27')]=_[_0xc2f0('0x26')](_0x25f3f0['query']);_0x1d2bc0[_0xc2f0('0x28')]=_[_0xc2f0('0x29')](_0x1d2bc0[_0xc2f0('0x2a')],_0x1d2bc0[_0xc2f0('0x27')]);_0xc13f31[_0xc2f0('0x2c')]=_[_0xc2f0('0x29')](_0x1d2bc0['model'],qs[_0xc2f0('0x2b')](_0x25f3f0['query']['fields']));_0xc13f31[_0xc2f0('0x2c')]=_0xc13f31[_0xc2f0('0x2c')][_0xc2f0('0x2d')]?_0xc13f31['attributes']:_0x1d2bc0[_0xc2f0('0x2a')];if(_0x25f3f0[_0xc2f0('0x27')]['includeAll']){_0xc13f31[_0xc2f0('0x39')]=[{'all':!![]}];}_0xc13f31=_[_0xc2f0('0x33')]({},_0xc13f31,_0x25f3f0[_0xc2f0('0x38')]);return db[_0xc2f0('0x24')]['find'](_0xc13f31)[_0xc2f0('0x1e')](handleEntityNotFound(_0x26596b,null))['then'](respondWithResult(_0x26596b,null))[_0xc2f0('0x3c')](handleError(_0x26596b,null));};exports['create']=function(_0x580465,_0x506605){return db[_0xc2f0('0x24')]['create'](_0x580465[_0xc2f0('0x3e')],{})[_0xc2f0('0x1e')](respondWithResult(_0x506605,0xc9))[_0xc2f0('0x3c')](handleError(_0x506605,null));};exports[_0xc2f0('0x3f')]=function(_0x2b1260,_0x41aabb){if(_0x2b1260['body']['id']){delete _0x2b1260[_0xc2f0('0x3e')]['id'];}return db[_0xc2f0('0x24')][_0xc2f0('0x40')]({'where':{'id':_0x2b1260['params']['id']}})[_0xc2f0('0x1e')](handleEntityNotFound(_0x41aabb,null))[_0xc2f0('0x1e')](saveUpdates(_0x2b1260['body'],null))[_0xc2f0('0x1e')](respondWithResult(_0x41aabb,null))['catch'](handleError(_0x41aabb,null));};exports[_0xc2f0('0x41')]=function(_0x49a92e,_0xc699c9){return db['ServicenowField'][_0xc2f0('0x40')]({'where':{'id':_0x49a92e[_0xc2f0('0x3d')]['id']}})[_0xc2f0('0x1e')](handleEntityNotFound(_0xc699c9,null))[_0xc2f0('0x1e')](removeEntity(_0xc699c9,null))[_0xc2f0('0x3c')](handleError(_0xc699c9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c24754b..2baa0c0 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 _0xdf4e=['request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf4e,0x170));var _0xedf4=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0xdf4e[_0x47c5bf];return _0x11b779;};'use strict';var _=require(_0xedf4('0x0'));var util=require(_0xedf4('0x1'));var logger=require(_0xedf4('0x2'))(_0xedf4('0x3'));var moment=require(_0xedf4('0x4'));var BPromise=require(_0xedf4('0x5'));var rp=require(_0xedf4('0x6'));var fs=require('fs');var path=require(_0xedf4('0x7'));var rimraf=require(_0xedf4('0x8'));var config=require(_0xedf4('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xedf4('0xa')]=function(_0x3c9f8c,_0xbe844a){return _0x3c9f8c[_0xedf4('0xb')](_0xedf4('0xc'),attributes,{'tableName':_0xedf4('0xd'),'paranoid':![],'indexes':[{'name':_0xedf4('0xe'),'fields':[_0xedf4('0xf'),_0xedf4('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf19a=['rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','util','api','moment','bluebird','request-promise'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xf19a,0xd8));var _0xaf19=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0xf19a[_0x4990d5];return _0x275e25;};'use strict';var _=require('lodash');var util=require(_0xaf19('0x0'));var logger=require('../../config/logger')(_0xaf19('0x1'));var moment=require(_0xaf19('0x2'));var BPromise=require(_0xaf19('0x3'));var rp=require(_0xaf19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf19('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf19('0x6'));module[_0xaf19('0x7')]=function(_0x191509,_0xe9d3b3){return _0x191509[_0xaf19('0x8')](_0xaf19('0x9'),attributes,{'tableName':_0xaf19('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xaf19('0xb'),_0xaf19('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index e27198b..0bcbe4f 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x80d9c9,_0x499db2){var _0x4e3c5b=function(_0x4e22b1){while(--_0x4e22b1){_0x80d9c9['push'](_0x80d9c9['shift']());}};_0x4e3c5b(++_0x499db2);}(_0xdb28,0x106));var _0x8db2=function(_0x1b9435,_0x284cac){_0x1b9435=_0x1b9435-0x0;var _0xc53501=_0xdb28[_0x1b9435];return _0xc53501;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x7b84=['jayson/promise','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1f11ec,_0x50654e){var _0x2bf024=function(_0x212fa8){while(--_0x212fa8){_0x1f11ec['push'](_0x1f11ec['shift']());}};_0x2bf024(++_0x50654e);}(_0x7b84,0x17c));var _0x47b8=function(_0x501f7c,_0x5c559a){_0x501f7c=_0x501f7c-0x0;var _0x54b1f0=_0x7b84[_0x501f7c];return _0x54b1f0;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('ServicenowField,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index fd75d49..ac550c1 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 _0x0778=['express','../../components/interaction/service','get','isAuthenticated','index','/:id/configurations','/:id/fields','post','create','put','/:id','update','delete','multer','util','path','connect-timeout'];(function(_0x3f71ed,_0x13709b){var _0x5c3986=function(_0x4946d2){while(--_0x4946d2){_0x3f71ed['push'](_0x3f71ed['shift']());}};_0x5c3986(++_0x13709b);}(_0x0778,0x172));var _0x8077=function(_0x23b746,_0x26147b){_0x23b746=_0x23b746-0x0;var _0x20e630=_0x0778[_0x23b746];return _0x20e630;};'use strict';var multer=require(_0x8077('0x0'));var util=require(_0x8077('0x1'));var path=require(_0x8077('0x2'));var timeout=require(_0x8077('0x3'));var express=require(_0x8077('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8077('0x5'));var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router[_0x8077('0x6')]('/',auth[_0x8077('0x7')](),controller[_0x8077('0x8')]);router[_0x8077('0x6')]('/:id',auth[_0x8077('0x7')](),controller['show']);router['get'](_0x8077('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x8077('0x6')](_0x8077('0xa'),auth[_0x8077('0x7')](),controller['getFields']);router[_0x8077('0xb')]('/',auth['isAuthenticated'](),controller[_0x8077('0xc')]);router[_0x8077('0xb')]('/:id/configurations',auth[_0x8077('0x7')](),controller['addConfiguration']);router[_0x8077('0xd')](_0x8077('0xe'),auth[_0x8077('0x7')](),controller[_0x8077('0xf')]);router[_0x8077('0x10')]('/:id',auth[_0x8077('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5495=['get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller'];(function(_0x7d3039,_0x63151b){var _0x24031e=function(_0xe3939e){while(--_0xe3939e){_0x7d3039['push'](_0x7d3039['shift']());}};_0x24031e(++_0x63151b);}(_0x5495,0x151));var _0x5549=function(_0x2c3e1e,_0x1eb0f3){_0x2c3e1e=_0x2c3e1e-0x0;var _0x46df84=_0x5495[_0x2c3e1e];return _0x46df84;};'use strict';var multer=require(_0x5549('0x0'));var util=require(_0x5549('0x1'));var path=require('path');var timeout=require(_0x5549('0x2'));var express=require(_0x5549('0x3'));var router=express[_0x5549('0x4')]();var auth=require(_0x5549('0x5'));var interaction=require(_0x5549('0x6'));var config=require('../../config/environment');var controller=require(_0x5549('0x7'));router[_0x5549('0x8')]('/',auth['isAuthenticated'](),controller[_0x5549('0x9')]);router[_0x5549('0x8')](_0x5549('0xa'),auth[_0x5549('0xb')](),controller[_0x5549('0xc')]);router[_0x5549('0x8')](_0x5549('0xd'),auth['isAuthenticated'](),controller[_0x5549('0xe')]);router[_0x5549('0x8')](_0x5549('0xf'),auth[_0x5549('0xb')](),controller[_0x5549('0x10')]);router['post']('/',auth[_0x5549('0xb')](),controller[_0x5549('0x11')]);router[_0x5549('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5549('0x13')]);router[_0x5549('0x14')](_0x5549('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5549('0x15')](_0x5549('0xa'),auth[_0x5549('0xb')](),controller[_0x5549('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index de6cd6b..0f7b3c2 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 _0xe132=['exports','STRING','username','remoteUri'];(function(_0x5377ad,_0x56abc0){var _0x295812=function(_0x136910){while(--_0x136910){_0x5377ad['push'](_0x5377ad['shift']());}};_0x295812(++_0x56abc0);}(_0xe132,0xbc));var _0x2e13=function(_0x458898,_0x1ecb02){_0x458898=_0x458898-0x0;var _0x41c38a=_0xe132[_0x458898];return _0x41c38a;};'use strict';var Sequelize=require('sequelize');module[_0x2e13('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2e13('0x1')]},'username':{'type':Sequelize[_0x2e13('0x1')],'unique':_0x2e13('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2e13('0x3')},'serverUrl':{'type':Sequelize[_0x2e13('0x1')]}}; \ No newline at end of file +var _0xf084=['exports','STRING','remoteUri','sequelize'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xf084,0xd3));var _0x4f08=function(_0x3ed92c,_0x235fcc){_0x3ed92c=_0x3ed92c-0x0;var _0x38a6ef=_0xf084[_0x3ed92c];return _0x38a6ef;};'use strict';var Sequelize=require(_0x4f08('0x0'));module[_0x4f08('0x1')]={'name':{'type':Sequelize[_0x4f08('0x2')]},'description':{'type':Sequelize[_0x4f08('0x2')]},'username':{'type':Sequelize[_0x4f08('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x4f08('0x2')]},'remoteUri':{'type':Sequelize[_0x4f08('0x2')],'unique':_0x4f08('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 097a046..7600b9f 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 _0x7da6=['getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','channel','type','Descriptions','SugarcrmField','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_type','direction','username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','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','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','count','includeAll','include','findAll','show','params','length','options','find','create','body'];(function(_0x226aea,_0x78e3ed){var _0x229e93=function(_0x2166a9){while(--_0x2166a9){_0x226aea['push'](_0x226aea['shift']());}};_0x229e93(++_0x78e3ed);}(_0x7da6,0x124));var _0x67da=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x7da6[_0x48326a];return _0x466709;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x67da('0x0'));var zipdir=require(_0x67da('0x1'));var jsonpatch=require(_0x67da('0x2'));var rp=require(_0x67da('0x3'));var moment=require('moment');var BPromise=require(_0x67da('0x4'));var Mustache=require(_0x67da('0x5'));var util=require(_0x67da('0x6'));var path=require(_0x67da('0x7'));var sox=require(_0x67da('0x8'));var csv=require(_0x67da('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x67da('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x67da('0x9'));var querystring=require('querystring');var Papa=require(_0x67da('0xc'));var Redis=require(_0x67da('0xd'));var authService=require(_0x67da('0xe'));var qs=require(_0x67da('0xf'));var hardwareService=require(_0x67da('0x10'));var logger=require(_0x67da('0x11'))(_0x67da('0x12'));var utils=require('../../config/utils');var config=require(_0x67da('0x13'));var db=require(_0x67da('0x14'))['db'];var integrations=require(_0x67da('0x15'));var jayson=require(_0x67da('0x16'));var client=jayson[_0x67da('0x17')][_0x67da('0x18')]({'port':0x232a});function checkPasswordPattern(_0x483e7f,_0x745b5d,_0x9beca6){if(_0x9beca6){var _0x3929fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3929fb[_0x67da('0x19')](_0x745b5d)){return _0x483e7f;}else{throw new Error(_0x67da('0x1a'));}}else{return _0x483e7f;}}function respondWithRpcPromise(_0x508b4a,_0x11c7b5,_0x33c466,_0x5e0802){return new BPromise(function(_0x11e151,_0x3b7f96){var _0x16760f=_0x5e0802||client;return _0x16760f[_0x67da('0x1b')](_0x508b4a,_0x33c466)[_0x67da('0x1c')](function(_0xb3a67){logger[_0x67da('0x1d')](_0x67da('0x1e'),_0x11c7b5,'request\x20sent');logger[_0x67da('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x11c7b5,_0x67da('0x20'),JSON['stringify'](_0xb3a67));if(_0xb3a67[_0x67da('0x21')]){if(_0xb3a67[_0x67da('0x21')][_0x67da('0x22')]===0x1f4){logger[_0x67da('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x11c7b5,_0xb3a67[_0x67da('0x21')]['message']);return _0x3b7f96(_0xb3a67['error'][_0x67da('0x23')]);}logger[_0x67da('0x21')](_0x67da('0x1e'),_0x11c7b5,_0xb3a67[_0x67da('0x21')]['message']);return _0x11e151(_0xb3a67['error']['message']);}else{logger[_0x67da('0x1d')](_0x67da('0x1e'),_0x11c7b5,_0x67da('0x20'));_0x11e151(_0xb3a67[_0x67da('0x24')][_0x67da('0x23')]);}})[_0x67da('0x25')](function(_0x5f1a47){logger[_0x67da('0x21')](_0x67da('0x1e'),_0x11c7b5,_0x5f1a47);_0x3b7f96(_0x5f1a47);});});}function respondWithStatusCode(_0x535b83,_0x35bac5){_0x35bac5=_0x35bac5||0xcc;return function(_0x599a9d){if(_0x599a9d){return _0x535b83[_0x67da('0x26')](_0x35bac5);}return _0x535b83[_0x67da('0x27')](_0x35bac5)[_0x67da('0x28')]();};}function respondWithResult(_0x17e76f,_0x33a74d){_0x33a74d=_0x33a74d||0xc8;return function(_0x35b1bc){if(_0x35b1bc){return _0x17e76f['status'](_0x33a74d)[_0x67da('0x29')](_0x35b1bc);}};}function respondWithFilteredResult(_0x168a49,_0x5875d9){return function(_0x5afdc4){if(_0x5afdc4){var _0x37f276=_0x5afdc4['count'],_0x4753ea=_0x5875d9[_0x67da('0x2a')],_0x16a7f0=_0x5875d9[_0x67da('0x2a')]+_0x5875d9[_0x67da('0x2b')],_0x42c511;if(_0x16a7f0>=_0x37f276){_0x16a7f0=_0x37f276;_0x42c511=0xc8;}else{_0x42c511=0xce;}_0x168a49[_0x67da('0x27')](_0x42c511);return _0x168a49[_0x67da('0x2c')](_0x67da('0x2d'),_0x4753ea+'-'+_0x16a7f0+'/'+_0x37f276)[_0x67da('0x29')](_0x5afdc4);}return null;};}function patchUpdates(_0x1e2bd0){return function(_0x36d143){try{jsonpatch[_0x67da('0x2e')](_0x36d143,_0x1e2bd0,!![]);}catch(_0x18dd99){return BPromise[_0x67da('0x2f')](_0x18dd99);}return _0x36d143[_0x67da('0x30')]();};}function saveUpdates(_0x38a502,_0x48e08a){return function(_0x229b6b){if(_0x229b6b){return _0x229b6b[_0x67da('0x31')](_0x38a502)[_0x67da('0x1c')](function(_0x18aaed){return _0x18aaed;});}return null;};}function removeEntity(_0x64a68e,_0x2fa5bb){return function(_0x594a18){if(_0x594a18){return _0x594a18[_0x67da('0x32')]()[_0x67da('0x1c')](function(){_0x64a68e[_0x67da('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a21e6,_0x5c9ab8){return function(_0x4cfcab){if(!_0x4cfcab){_0x5a21e6[_0x67da('0x26')](0x194);}return _0x4cfcab;};}function handleError(_0x4b796b,_0x2cb5eb){_0x2cb5eb=_0x2cb5eb||0x1f4;return function(_0x3fb284){logger[_0x67da('0x21')](_0x3fb284[_0x67da('0x33')]);if(_0x3fb284[_0x67da('0x34')]){delete _0x3fb284[_0x67da('0x34')];}_0x4b796b[_0x67da('0x27')](_0x2cb5eb)[_0x67da('0x35')](_0x3fb284);};}exports[_0x67da('0x36')]=function(_0x11ec02,_0x207e63){var _0x13796d={},_0x2720e5={},_0x1348bb={'count':0x0,'rows':[]};var _0x3e48bf=db[_0x67da('0x37')][_0x67da('0x38')];_0x2720e5[_0x67da('0x39')]=_[_0x67da('0x3a')](_0x3e48bf);_0x2720e5[_0x67da('0x3b')]=_[_0x67da('0x3a')](_0x11ec02[_0x67da('0x3b')]);_0x2720e5[_0x67da('0x3c')]=_[_0x67da('0x3d')](_0x2720e5[_0x67da('0x39')],_0x2720e5[_0x67da('0x3b')]);_0x13796d['attributes']=_[_0x67da('0x3d')](_0x2720e5[_0x67da('0x39')],qs['fields'](_0x11ec02[_0x67da('0x3b')][_0x67da('0x3e')]));_0x13796d['attributes']=_0x13796d['attributes']['length']?_0x13796d[_0x67da('0x3f')]:_0x2720e5[_0x67da('0x39')];if(!_0x11ec02[_0x67da('0x3b')][_0x67da('0x40')](_0x67da('0x41'))){_0x13796d['limit']=qs[_0x67da('0x2b')](_0x11ec02['query'][_0x67da('0x2b')]);_0x13796d[_0x67da('0x2a')]=qs[_0x67da('0x2a')](_0x11ec02[_0x67da('0x3b')]['offset']);}_0x13796d[_0x67da('0x42')]=qs['sort'](_0x11ec02[_0x67da('0x3b')][_0x67da('0x43')]);_0x13796d[_0x67da('0x44')]=qs['filters'](_[_0x67da('0x45')](_0x11ec02[_0x67da('0x3b')],_0x2720e5[_0x67da('0x3c')]));if(_0x11ec02[_0x67da('0x3b')][_0x67da('0x46')]){_0x13796d[_0x67da('0x44')]=_['merge'](_0x13796d['where'],{'$or':_[_0x67da('0x47')](_0x3e48bf,function(_0x31b30e){if(_0x31b30e['type'][_0x67da('0x48')]!==_0x67da('0x49')){var _0x5dbd8f={};_0x5dbd8f[_0x31b30e['field']]={'$like':'%'+_0x11ec02[_0x67da('0x3b')][_0x67da('0x46')]+'%'};return _0x5dbd8f;}})});}_0x13796d=_[_0x67da('0x4a')]({},_0x13796d,_0x11ec02['options']);var _0x1fb7f6={'where':_0x13796d['where']};return db[_0x67da('0x37')][_0x67da('0x4b')](_0x1fb7f6)[_0x67da('0x1c')](function(_0x594f38){_0x1348bb[_0x67da('0x4b')]=_0x594f38;if(_0x11ec02['query'][_0x67da('0x4c')]){_0x13796d[_0x67da('0x4d')]=[{'all':!![]}];}return db[_0x67da('0x37')][_0x67da('0x4e')](_0x13796d);})['then'](function(_0x43c5b5){_0x1348bb['rows']=_0x43c5b5;return _0x1348bb;})[_0x67da('0x1c')](respondWithFilteredResult(_0x207e63,_0x13796d))[_0x67da('0x25')](handleError(_0x207e63,null));};exports[_0x67da('0x4f')]=function(_0x40b69c,_0x446fb3){var _0x40420b={'raw':![],'where':{'id':_0x40b69c[_0x67da('0x50')]['id']}},_0x5d9ebc={};_0x5d9ebc[_0x67da('0x39')]=_['keys'](db[_0x67da('0x37')][_0x67da('0x38')]);_0x5d9ebc[_0x67da('0x3b')]=_[_0x67da('0x3a')](_0x40b69c[_0x67da('0x3b')]);_0x5d9ebc['filters']=_[_0x67da('0x3d')](_0x5d9ebc[_0x67da('0x39')],_0x5d9ebc[_0x67da('0x3b')]);_0x40420b[_0x67da('0x3f')]=_[_0x67da('0x3d')](_0x5d9ebc[_0x67da('0x39')],qs[_0x67da('0x3e')](_0x40b69c[_0x67da('0x3b')]['fields']));_0x40420b[_0x67da('0x3f')]=_0x40420b[_0x67da('0x3f')][_0x67da('0x51')]?_0x40420b['attributes']:_0x5d9ebc[_0x67da('0x39')];if(_0x40b69c[_0x67da('0x3b')][_0x67da('0x4c')]){_0x40420b['include']=[{'all':!![]}];}_0x40420b=_[_0x67da('0x4a')]({},_0x40420b,_0x40b69c[_0x67da('0x52')]);return db[_0x67da('0x37')][_0x67da('0x53')](_0x40420b)[_0x67da('0x1c')](handleEntityNotFound(_0x446fb3,null))[_0x67da('0x1c')](respondWithResult(_0x446fb3,null))[_0x67da('0x25')](handleError(_0x446fb3,null));};exports['create']=function(_0xbdde9b,_0x28b71a){return db['SugarcrmAccount'][_0x67da('0x54')](_0xbdde9b['body'],{})[_0x67da('0x1c')](respondWithResult(_0x28b71a,0xc9))[_0x67da('0x25')](handleError(_0x28b71a,null));};exports[_0x67da('0x31')]=function(_0x485399,_0x1b82f9){if(_0x485399[_0x67da('0x55')]['id']){delete _0x485399['body']['id'];}return db['SugarcrmAccount'][_0x67da('0x53')]({'where':{'id':_0x485399[_0x67da('0x50')]['id']}})[_0x67da('0x1c')](handleEntityNotFound(_0x1b82f9,null))['then'](saveUpdates(_0x485399[_0x67da('0x55')],null))['then'](respondWithResult(_0x1b82f9,null))['catch'](handleError(_0x1b82f9,null));};exports['destroy']=function(_0x7210cc,_0x525f1a){return db[_0x67da('0x37')][_0x67da('0x53')]({'where':{'id':_0x7210cc['params']['id']}})[_0x67da('0x1c')](handleEntityNotFound(_0x525f1a,null))[_0x67da('0x1c')](removeEntity(_0x525f1a,null))[_0x67da('0x25')](handleError(_0x525f1a,null));};exports[_0x67da('0x56')]=function(_0x54713b,_0x1c478f,_0x1160b1){var _0x4ac3df={};var _0x27cebd={};var _0x45f320;var _0x142518;return db[_0x67da('0x37')][_0x67da('0x57')]({'where':{'id':_0x54713b[_0x67da('0x50')]['id']}})[_0x67da('0x1c')](handleEntityNotFound(_0x1c478f,null))['then'](function(_0x2ae5ba){if(_0x2ae5ba){_0x45f320=_0x2ae5ba;_0x27cebd['model']=_[_0x67da('0x3a')](db[_0x67da('0x58')][_0x67da('0x38')]);_0x27cebd['query']=_[_0x67da('0x3a')](_0x54713b[_0x67da('0x3b')]);_0x27cebd[_0x67da('0x3c')]=_[_0x67da('0x3d')](_0x27cebd[_0x67da('0x39')],_0x27cebd[_0x67da('0x3b')]);_0x4ac3df['attributes']=_['intersection'](_0x27cebd['model'],qs[_0x67da('0x3e')](_0x54713b[_0x67da('0x3b')][_0x67da('0x3e')]));_0x4ac3df[_0x67da('0x3f')]=_0x4ac3df['attributes']['length']?_0x4ac3df[_0x67da('0x3f')]:_0x27cebd[_0x67da('0x39')];_0x4ac3df[_0x67da('0x42')]=qs[_0x67da('0x43')](_0x54713b['query'][_0x67da('0x43')]);_0x4ac3df[_0x67da('0x44')]=qs['filters'](_[_0x67da('0x45')](_0x54713b[_0x67da('0x3b')],_0x27cebd[_0x67da('0x3c')]));if(_0x54713b[_0x67da('0x3b')][_0x67da('0x46')]){_0x4ac3df[_0x67da('0x44')]=_['merge'](_0x4ac3df[_0x67da('0x44')],{'$or':_[_0x67da('0x47')](_0x4ac3df[_0x67da('0x3f')],function(_0x4a9155){var _0x2f265c={};_0x2f265c[_0x4a9155]={'$like':'%'+_0x54713b['query'][_0x67da('0x46')]+'%'};return _0x2f265c;})});}_0x4ac3df=_[_0x67da('0x4a')]({},_0x4ac3df,_0x54713b[_0x67da('0x52')]);return _0x45f320[_0x67da('0x56')](_0x4ac3df);}})['then'](function(_0x2fac12){if(_0x2fac12){_0x142518=_0x2fac12[_0x67da('0x51')];if(!_0x54713b['query']['hasOwnProperty'](_0x67da('0x41'))){_0x4ac3df[_0x67da('0x2b')]=qs[_0x67da('0x2b')](_0x54713b[_0x67da('0x3b')][_0x67da('0x2b')]);_0x4ac3df[_0x67da('0x2a')]=qs[_0x67da('0x2a')](_0x54713b[_0x67da('0x3b')]['offset']);}return _0x45f320[_0x67da('0x56')](_0x4ac3df);}})[_0x67da('0x1c')](function(_0x1c216){if(_0x1c216){return _0x1c216?{'count':_0x142518,'rows':_0x1c216}:null;}})['then'](respondWithResult(_0x1c478f,null))[_0x67da('0x25')](handleError(_0x1c478f,null));};exports[_0x67da('0x59')]=function(_0x21b303,_0xd28cb4,_0x167038){if(_0x21b303[_0x67da('0x55')]['id']){delete _0x21b303[_0x67da('0x55')]['id'];}return db[_0x67da('0x37')][_0x67da('0x57')]({'where':{'id':_0x21b303[_0x67da('0x50')]['id']}})[_0x67da('0x1c')](handleEntityNotFound(_0xd28cb4,null))[_0x67da('0x1c')](function(_0x3e270b){if(_0x3e270b){_0x21b303['body'][_0x67da('0x5a')]=_0x3e270b['id'];_0x21b303[_0x67da('0x55')][_0x67da('0x5b')]=integrations['getSubjects'](_0x21b303[_0x67da('0x55')][_0x67da('0x5c')],_0x21b303[_0x67da('0x55')][_0x67da('0x5d')]);_0x21b303[_0x67da('0x55')][_0x67da('0x5e')]=integrations['getDescriptions'](_0x21b303[_0x67da('0x55')][_0x67da('0x5c')],_0x21b303[_0x67da('0x55')]['type']);return db[_0x67da('0x58')][_0x67da('0x54')](_0x21b303[_0x67da('0x55')],{'include':[{'model':db[_0x67da('0x5f')],'as':_0x67da('0x5b')},{'model':db['SugarcrmField'],'as':_0x67da('0x5e')}]});}return null;})[_0x67da('0x1c')](respondWithResult(_0xd28cb4,null))[_0x67da('0x25')](handleError(_0xd28cb4,null));};exports['getFields']=function(_0x445634,_0x30332e,_0x5154cf){var _0x41f1a2='';var _0xa7877=['id',_0x67da('0x34'),_0x67da('0x60'),'created_by',_0x67da('0x61'),_0x67da('0x62'),_0x67da('0x63'),_0x67da('0x64'),'parent_id',_0x67da('0x65'),'parent_name',_0x67da('0x66')];return db[_0x67da('0x37')][_0x67da('0x57')]({'where':{'id':_0x445634[_0x67da('0x50')]['id']},'attributes':['id',_0x67da('0x67'),_0x67da('0x68'),_0x67da('0x69')]})[_0x67da('0x1c')](handleEntityNotFound(_0x30332e,null))['then'](function(_0x41b2f6){if(_0x41b2f6){_0x41f1a2=_0x41b2f6[_0x67da('0x69')];var _0x59ebe9=_0x41f1a2['slice'](-0x1);if(_0x59ebe9==='/'){_0x41f1a2=_0x41f1a2[_0x67da('0x6a')](0x0,_0x41f1a2['lastIndexOf'](_0x59ebe9));}return rp({'method':_0x67da('0x6b'),'uri':util[_0x67da('0x6c')](_0x67da('0x6d'),_0x41f1a2,_0x67da('0x6e')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x67da('0x6f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x41b2f6[_0x67da('0x67')],'password':_0x41b2f6[_0x67da('0x68')],'encryption':_0x67da('0x70')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x67da('0x1c')](function(_0x1c7df9){if(_0x1c7df9&&_0x1c7df9[_0x67da('0x34')]!==_0x67da('0x71')&&_0x1c7df9['name']!==_0x67da('0x72')){return rp({'method':_0x67da('0x6b'),'uri':util[_0x67da('0x6c')](_0x67da('0x6d'),_0x41f1a2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x67da('0x73'),'input_type':_0x67da('0x6f'),'response_type':_0x67da('0x6f'),'rest_data':JSON['stringify']({'session':_0x1c7df9['id'],'module_name':'Calls'})}})[_0x67da('0x1c')](function(_0x434565){if(_0x434565){var _0xfaf2c3=_[_0x67da('0x74')](_0x434565[_0x67da('0x75')]);_[_0x67da('0x76')](_0xfaf2c3,function(_0x219ddd){return _0xa7877['includes'](_0x219ddd[_0x67da('0x34')]);});return{'count':_0xfaf2c3[_0x67da('0x51')],'rows':_[_0x67da('0x47')](_0xfaf2c3,function(_0x48e1d2){return{'id':_0x48e1d2[_0x67da('0x34')],'name':_0x48e1d2[_0x67da('0x77')],'custom':_['endsWith'](_0x48e1d2[_0x67da('0x34')],'_c')?!![]:![],'options':_0x48e1d2['options']?_['map'](_[_0x67da('0x74')](_0x48e1d2[_0x67da('0x52')]),function(_0x725dc7){return{'name':_0x725dc7[_0x67da('0x78')],'value':_0x725dc7[_0x67da('0x34')]};}):[]};})};}})['then'](respondWithResult(_0x30332e,null))[_0x67da('0x25')](function(_0x3d702f){var _0x24684a=_0x445634[_0x67da('0x3b')]['test']?0x1f4:_0x3d702f[_0x67da('0x79')]||0x1f4;logger['error'](_0x67da('0x7a'),_0x67da('0x7b'),_0x24684a,JSON[_0x67da('0x7c')](_0x3d702f));delete _0x3d702f[_0x67da('0x34')];if(_0x24684a===0x191){_0x24684a=0x190;}_0x30332e[_0x67da('0x27')](_0x24684a)[_0x67da('0x35')](_0x445634[_0x67da('0x3b')][_0x67da('0x19')]?{'message':_0x67da('0x7d'),'statusCode':_0x3d702f[_0x67da('0x79')]}:_0x3d702f);});}else{var _0x237db6=0x1f4;_0x30332e[_0x67da('0x27')](_0x237db6)[_0x67da('0x35')]({'message':_0x67da('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5b6e=['end','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','SugarcrmAccount','include','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','SugarcrmConfiguration','order','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','substring','POST','format','login','JSON','PLAIN','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','values','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','status','json','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x517a24,_0x222367){var _0x2eddc9=function(_0x3c7c28){while(--_0x3c7c28){_0x517a24['push'](_0x517a24['shift']());}};_0x2eddc9(++_0x222367);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x514ed7,_0x2edaa0){_0x514ed7=_0x514ed7-0x0;var _0xb7fb3d=_0x5b6e[_0x514ed7];return _0xb7fb3d;};'use strict';var pdf=require(_0xe5b6('0x0'));var emlformat=require(_0xe5b6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe5b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5b6('0x3'));var moment=require(_0xe5b6('0x4'));var BPromise=require(_0xe5b6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe5b6('0x6'));var sox=require(_0xe5b6('0x7'));var csv=require(_0xe5b6('0x8'));var ejs=require(_0xe5b6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe5b6('0xa'));var crypto=require(_0xe5b6('0xb'));var jsforce=require(_0xe5b6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe5b6('0x8'));var querystring=require('querystring');var Papa=require(_0xe5b6('0xd'));var Redis=require(_0xe5b6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe5b6('0xf'));var hardwareService=require(_0xe5b6('0x10'));var logger=require('../../config/logger')(_0xe5b6('0x11'));var utils=require(_0xe5b6('0x12'));var config=require('../../config/environment');var db=require(_0xe5b6('0x13'))['db'];var integrations=require(_0xe5b6('0x14'));var jayson=require('jayson/promise');var client=jayson[_0xe5b6('0x15')][_0xe5b6('0x16')]({'port':0x232a});function checkPasswordPattern(_0xe461e6,_0x314625,_0x2fc86d){if(_0x2fc86d){var _0x531390=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x531390[_0xe5b6('0x17')](_0x314625)){return _0xe461e6;}else{throw new Error(_0xe5b6('0x18'));}}else{return _0xe461e6;}}function respondWithRpcPromise(_0x172ea1,_0x444b97,_0x533025,_0x3f5025){return new BPromise(function(_0x8db237,_0xb33f41){var _0x117ccd=_0x3f5025||client;return _0x117ccd[_0xe5b6('0x19')](_0x172ea1,_0x533025)[_0xe5b6('0x1a')](function(_0x5dd731){logger[_0xe5b6('0x1b')]('SugarcrmAccount,\x20%s,\x20%s',_0x444b97,_0xe5b6('0x1c'));logger[_0xe5b6('0x1d')](_0xe5b6('0x1e'),_0x444b97,'request\x20sent',JSON[_0xe5b6('0x1f')](_0x5dd731));if(_0x5dd731[_0xe5b6('0x20')]){if(_0x5dd731[_0xe5b6('0x20')][_0xe5b6('0x21')]===0x1f4){logger[_0xe5b6('0x20')](_0xe5b6('0x22'),_0x444b97,_0x5dd731[_0xe5b6('0x20')][_0xe5b6('0x23')]);return _0xb33f41(_0x5dd731['error'][_0xe5b6('0x23')]);}logger[_0xe5b6('0x20')](_0xe5b6('0x22'),_0x444b97,_0x5dd731[_0xe5b6('0x20')][_0xe5b6('0x23')]);return _0x8db237(_0x5dd731['error'][_0xe5b6('0x23')]);}else{logger['info'](_0xe5b6('0x22'),_0x444b97,'request\x20sent');_0x8db237(_0x5dd731['result']['message']);}})['catch'](function(_0x2f0c1f){logger[_0xe5b6('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0x444b97,_0x2f0c1f);_0xb33f41(_0x2f0c1f);});});}function respondWithStatusCode(_0x44a248,_0x23bff6){_0x23bff6=_0x23bff6||0xcc;return function(_0x24b85f){if(_0x24b85f){return _0x44a248['sendStatus'](_0x23bff6);}return _0x44a248[_0xe5b6('0x24')](_0x23bff6)['end']();};}function respondWithResult(_0x2dec38,_0x42e094){_0x42e094=_0x42e094||0xc8;return function(_0x3b3914){if(_0x3b3914){return _0x2dec38[_0xe5b6('0x24')](_0x42e094)[_0xe5b6('0x25')](_0x3b3914);}};}function respondWithFilteredResult(_0x4530cf,_0x67e54d){return function(_0x4348c8){if(_0x4348c8){var _0xb33738=_0x4348c8[_0xe5b6('0x26')],_0x12b0d4=_0x67e54d[_0xe5b6('0x27')],_0x319d62=_0x67e54d[_0xe5b6('0x27')]+_0x67e54d['limit'],_0x3c2773;if(_0x319d62>=_0xb33738){_0x319d62=_0xb33738;_0x3c2773=0xc8;}else{_0x3c2773=0xce;}_0x4530cf[_0xe5b6('0x24')](_0x3c2773);return _0x4530cf[_0xe5b6('0x28')](_0xe5b6('0x29'),_0x12b0d4+'-'+_0x319d62+'/'+_0xb33738)[_0xe5b6('0x25')](_0x4348c8);}return null;};}function patchUpdates(_0x2cf845){return function(_0xfd4254){try{jsonpatch[_0xe5b6('0x2a')](_0xfd4254,_0x2cf845,!![]);}catch(_0x12d080){return BPromise[_0xe5b6('0x2b')](_0x12d080);}return _0xfd4254[_0xe5b6('0x2c')]();};}function saveUpdates(_0x1b477e,_0x570893){return function(_0x2d04ad){if(_0x2d04ad){return _0x2d04ad[_0xe5b6('0x2d')](_0x1b477e)[_0xe5b6('0x1a')](function(_0x463c12){return _0x463c12;});}return null;};}function removeEntity(_0xc7d32c,_0x6cc331){return function(_0x170874){if(_0x170874){return _0x170874['destroy']()[_0xe5b6('0x1a')](function(){_0xc7d32c[_0xe5b6('0x24')](0xcc)[_0xe5b6('0x2e')]();});}};}function handleEntityNotFound(_0x327acb,_0x335565){return function(_0x1fc7a6){if(!_0x1fc7a6){_0x327acb['sendStatus'](0x194);}return _0x1fc7a6;};}function handleError(_0x440460,_0x3e3f2b){_0x3e3f2b=_0x3e3f2b||0x1f4;return function(_0x513482){logger['error'](_0x513482[_0xe5b6('0x2f')]);if(_0x513482['name']){delete _0x513482[_0xe5b6('0x30')];}_0x440460[_0xe5b6('0x24')](_0x3e3f2b)[_0xe5b6('0x31')](_0x513482);};}exports[_0xe5b6('0x32')]=function(_0x1bd439,_0x3a38d9){var _0x2346c2={},_0xf1d8a7={},_0x471fe7={'count':0x0,'rows':[]};var _0x363f6b=db['SugarcrmAccount'][_0xe5b6('0x33')];_0xf1d8a7['model']=_[_0xe5b6('0x34')](_0x363f6b);_0xf1d8a7['query']=_['keys'](_0x1bd439[_0xe5b6('0x35')]);_0xf1d8a7[_0xe5b6('0x36')]=_[_0xe5b6('0x37')](_0xf1d8a7[_0xe5b6('0x38')],_0xf1d8a7[_0xe5b6('0x35')]);_0x2346c2[_0xe5b6('0x39')]=_[_0xe5b6('0x37')](_0xf1d8a7['model'],qs[_0xe5b6('0x3a')](_0x1bd439['query']['fields']));_0x2346c2['attributes']=_0x2346c2[_0xe5b6('0x39')][_0xe5b6('0x3b')]?_0x2346c2['attributes']:_0xf1d8a7['model'];if(!_0x1bd439['query'][_0xe5b6('0x3c')](_0xe5b6('0x3d'))){_0x2346c2[_0xe5b6('0x3e')]=qs[_0xe5b6('0x3e')](_0x1bd439[_0xe5b6('0x35')][_0xe5b6('0x3e')]);_0x2346c2[_0xe5b6('0x27')]=qs[_0xe5b6('0x27')](_0x1bd439[_0xe5b6('0x35')][_0xe5b6('0x27')]);}_0x2346c2['order']=qs[_0xe5b6('0x3f')](_0x1bd439[_0xe5b6('0x35')][_0xe5b6('0x3f')]);_0x2346c2[_0xe5b6('0x40')]=qs[_0xe5b6('0x36')](_[_0xe5b6('0x41')](_0x1bd439[_0xe5b6('0x35')],_0xf1d8a7['filters']));if(_0x1bd439[_0xe5b6('0x35')][_0xe5b6('0x42')]){_0x2346c2[_0xe5b6('0x40')]=_[_0xe5b6('0x43')](_0x2346c2[_0xe5b6('0x40')],{'$or':_[_0xe5b6('0x44')](_0x363f6b,function(_0x527d54){if(_0x527d54[_0xe5b6('0x45')][_0xe5b6('0x46')]!==_0xe5b6('0x47')){var _0x51a981={};_0x51a981[_0x527d54[_0xe5b6('0x48')]]={'$like':'%'+_0x1bd439[_0xe5b6('0x35')][_0xe5b6('0x42')]+'%'};return _0x51a981;}})});}_0x2346c2=_[_0xe5b6('0x43')]({},_0x2346c2,_0x1bd439['options']);var _0x5c8306={'where':_0x2346c2[_0xe5b6('0x40')]};return db[_0xe5b6('0x49')][_0xe5b6('0x26')](_0x5c8306)['then'](function(_0x1ead59){_0x471fe7[_0xe5b6('0x26')]=_0x1ead59;if(_0x1bd439[_0xe5b6('0x35')]['includeAll']){_0x2346c2[_0xe5b6('0x4a')]=[{'all':!![]}];}return db[_0xe5b6('0x49')]['findAll'](_0x2346c2);})[_0xe5b6('0x1a')](function(_0x4bdca3){_0x471fe7[_0xe5b6('0x4b')]=_0x4bdca3;return _0x471fe7;})[_0xe5b6('0x1a')](respondWithFilteredResult(_0x3a38d9,_0x2346c2))[_0xe5b6('0x4c')](handleError(_0x3a38d9,null));};exports[_0xe5b6('0x4d')]=function(_0x104373,_0x147ab7){var _0x2e7228={'raw':![],'where':{'id':_0x104373[_0xe5b6('0x4e')]['id']}},_0xfd7ed9={};_0xfd7ed9['model']=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0xfd7ed9[_0xe5b6('0x35')]=_[_0xe5b6('0x34')](_0x104373['query']);_0xfd7ed9['filters']=_[_0xe5b6('0x37')](_0xfd7ed9[_0xe5b6('0x38')],_0xfd7ed9[_0xe5b6('0x35')]);_0x2e7228[_0xe5b6('0x39')]=_[_0xe5b6('0x37')](_0xfd7ed9[_0xe5b6('0x38')],qs[_0xe5b6('0x3a')](_0x104373[_0xe5b6('0x35')][_0xe5b6('0x3a')]));_0x2e7228[_0xe5b6('0x39')]=_0x2e7228['attributes'][_0xe5b6('0x3b')]?_0x2e7228[_0xe5b6('0x39')]:_0xfd7ed9[_0xe5b6('0x38')];if(_0x104373[_0xe5b6('0x35')][_0xe5b6('0x4f')]){_0x2e7228[_0xe5b6('0x4a')]=[{'all':!![]}];}_0x2e7228=_[_0xe5b6('0x43')]({},_0x2e7228,_0x104373['options']);return db[_0xe5b6('0x49')]['find'](_0x2e7228)[_0xe5b6('0x1a')](handleEntityNotFound(_0x147ab7,null))[_0xe5b6('0x1a')](respondWithResult(_0x147ab7,null))['catch'](handleError(_0x147ab7,null));};exports[_0xe5b6('0x50')]=function(_0x564f5c,_0x5d5074){return db[_0xe5b6('0x49')]['create'](_0x564f5c[_0xe5b6('0x51')],{})[_0xe5b6('0x1a')](respondWithResult(_0x5d5074,0xc9))['catch'](handleError(_0x5d5074,null));};exports['update']=function(_0x2dfda1,_0x68d9b2){if(_0x2dfda1[_0xe5b6('0x51')]['id']){delete _0x2dfda1[_0xe5b6('0x51')]['id'];}return db[_0xe5b6('0x49')][_0xe5b6('0x52')]({'where':{'id':_0x2dfda1[_0xe5b6('0x4e')]['id']}})[_0xe5b6('0x1a')](handleEntityNotFound(_0x68d9b2,null))[_0xe5b6('0x1a')](saveUpdates(_0x2dfda1[_0xe5b6('0x51')],null))[_0xe5b6('0x1a')](respondWithResult(_0x68d9b2,null))[_0xe5b6('0x4c')](handleError(_0x68d9b2,null));};exports[_0xe5b6('0x53')]=function(_0x1c8700,_0x203e20){return db[_0xe5b6('0x49')][_0xe5b6('0x52')]({'where':{'id':_0x1c8700[_0xe5b6('0x4e')]['id']}})[_0xe5b6('0x1a')](handleEntityNotFound(_0x203e20,null))[_0xe5b6('0x1a')](removeEntity(_0x203e20,null))[_0xe5b6('0x4c')](handleError(_0x203e20,null));};exports[_0xe5b6('0x54')]=function(_0x572f55,_0x39475c,_0x642ce4){var _0x135786={};var _0x242069={};var _0x3d2a32;var _0x4ed818;return db[_0xe5b6('0x49')]['findOne']({'where':{'id':_0x572f55[_0xe5b6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x39475c,null))[_0xe5b6('0x1a')](function(_0x6c60b5){if(_0x6c60b5){_0x3d2a32=_0x6c60b5;_0x242069['model']=_['keys'](db[_0xe5b6('0x55')][_0xe5b6('0x33')]);_0x242069[_0xe5b6('0x35')]=_['keys'](_0x572f55[_0xe5b6('0x35')]);_0x242069['filters']=_['intersection'](_0x242069[_0xe5b6('0x38')],_0x242069[_0xe5b6('0x35')]);_0x135786[_0xe5b6('0x39')]=_[_0xe5b6('0x37')](_0x242069[_0xe5b6('0x38')],qs[_0xe5b6('0x3a')](_0x572f55[_0xe5b6('0x35')][_0xe5b6('0x3a')]));_0x135786[_0xe5b6('0x39')]=_0x135786[_0xe5b6('0x39')][_0xe5b6('0x3b')]?_0x135786[_0xe5b6('0x39')]:_0x242069[_0xe5b6('0x38')];_0x135786[_0xe5b6('0x56')]=qs[_0xe5b6('0x3f')](_0x572f55[_0xe5b6('0x35')]['sort']);_0x135786[_0xe5b6('0x40')]=qs[_0xe5b6('0x36')](_['pick'](_0x572f55['query'],_0x242069['filters']));if(_0x572f55[_0xe5b6('0x35')][_0xe5b6('0x42')]){_0x135786['where']=_['merge'](_0x135786['where'],{'$or':_[_0xe5b6('0x44')](_0x135786[_0xe5b6('0x39')],function(_0x285f8f){var _0x22a5f7={};_0x22a5f7[_0x285f8f]={'$like':'%'+_0x572f55[_0xe5b6('0x35')][_0xe5b6('0x42')]+'%'};return _0x22a5f7;})});}_0x135786=_[_0xe5b6('0x43')]({},_0x135786,_0x572f55[_0xe5b6('0x57')]);return _0x3d2a32[_0xe5b6('0x54')](_0x135786);}})['then'](function(_0x120cb4){if(_0x120cb4){_0x4ed818=_0x120cb4[_0xe5b6('0x3b')];if(!_0x572f55[_0xe5b6('0x35')][_0xe5b6('0x3c')]('nolimit')){_0x135786['limit']=qs[_0xe5b6('0x3e')](_0x572f55[_0xe5b6('0x35')][_0xe5b6('0x3e')]);_0x135786[_0xe5b6('0x27')]=qs[_0xe5b6('0x27')](_0x572f55[_0xe5b6('0x35')]['offset']);}return _0x3d2a32[_0xe5b6('0x54')](_0x135786);}})[_0xe5b6('0x1a')](function(_0x4057c9){if(_0x4057c9){return _0x4057c9?{'count':_0x4ed818,'rows':_0x4057c9}:null;}})[_0xe5b6('0x1a')](respondWithResult(_0x39475c,null))[_0xe5b6('0x4c')](handleError(_0x39475c,null));};exports[_0xe5b6('0x58')]=function(_0x8c7ae6,_0x2b451f,_0x2ee152){if(_0x8c7ae6[_0xe5b6('0x51')]['id']){delete _0x8c7ae6['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x8c7ae6['params']['id']}})[_0xe5b6('0x1a')](handleEntityNotFound(_0x2b451f,null))['then'](function(_0x326110){if(_0x326110){_0x8c7ae6[_0xe5b6('0x51')][_0xe5b6('0x59')]=_0x326110['id'];_0x8c7ae6[_0xe5b6('0x51')][_0xe5b6('0x5a')]=integrations[_0xe5b6('0x5b')](_0x8c7ae6[_0xe5b6('0x51')][_0xe5b6('0x5c')],_0x8c7ae6['body'][_0xe5b6('0x45')]);_0x8c7ae6[_0xe5b6('0x51')][_0xe5b6('0x5d')]=integrations[_0xe5b6('0x5e')](_0x8c7ae6['body'][_0xe5b6('0x5c')],_0x8c7ae6[_0xe5b6('0x51')][_0xe5b6('0x45')]);return db[_0xe5b6('0x55')][_0xe5b6('0x50')](_0x8c7ae6[_0xe5b6('0x51')],{'include':[{'model':db[_0xe5b6('0x5f')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xe5b6('0x5d')}]});}return null;})[_0xe5b6('0x1a')](respondWithResult(_0x2b451f,null))['catch'](handleError(_0x2b451f,null));};exports['getFields']=function(_0x25c83d,_0x25473c,_0x45b683){var _0x2415e5='';var _0x4095b2=['id',_0xe5b6('0x30'),_0xe5b6('0x60'),_0xe5b6('0x61'),_0xe5b6('0x62'),_0xe5b6('0x63'),_0xe5b6('0x64'),_0xe5b6('0x65'),_0xe5b6('0x66'),'parent_type','parent_name',_0xe5b6('0x67')];return db[_0xe5b6('0x49')]['findOne']({'where':{'id':_0x25c83d[_0xe5b6('0x4e')]['id']},'attributes':['id',_0xe5b6('0x68'),_0xe5b6('0x69'),_0xe5b6('0x6a')]})[_0xe5b6('0x1a')](handleEntityNotFound(_0x25473c,null))[_0xe5b6('0x1a')](function(_0x22dd0a){if(_0x22dd0a){_0x2415e5=_0x22dd0a['remoteUri'];var _0x1074ea=_0x2415e5['slice'](-0x1);if(_0x1074ea==='/'){_0x2415e5=_0x2415e5[_0xe5b6('0x6b')](0x0,_0x2415e5['lastIndexOf'](_0x1074ea));}return rp({'method':_0xe5b6('0x6c'),'uri':util[_0xe5b6('0x6d')]('%s%s',_0x2415e5,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe5b6('0x6e'),'input_type':_0xe5b6('0x6f'),'response_type':_0xe5b6('0x6f'),'rest_data':JSON[_0xe5b6('0x1f')]({'user_auth':{'user_name':_0x22dd0a[_0xe5b6('0x68')],'password':_0x22dd0a[_0xe5b6('0x69')],'encryption':_0xe5b6('0x70')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xe5b6('0x1a')](function(_0x1d89de){if(_0x1d89de&&_0x1d89de[_0xe5b6('0x30')]!=='Invalid\x20Login'&&_0x1d89de[_0xe5b6('0x30')]!==_0xe5b6('0x71')){return rp({'method':'POST','uri':util['format'](_0xe5b6('0x72'),_0x2415e5,_0xe5b6('0x73')),'json':!![],'form':{'method':_0xe5b6('0x74'),'input_type':'JSON','response_type':_0xe5b6('0x6f'),'rest_data':JSON[_0xe5b6('0x1f')]({'session':_0x1d89de['id'],'module_name':'Calls'})}})[_0xe5b6('0x1a')](function(_0x476d97){if(_0x476d97){var _0x1897c0=_[_0xe5b6('0x75')](_0x476d97['module_fields']);_['remove'](_0x1897c0,function(_0x1996aa){return _0x4095b2[_0xe5b6('0x76')](_0x1996aa[_0xe5b6('0x30')]);});return{'count':_0x1897c0[_0xe5b6('0x3b')],'rows':_[_0xe5b6('0x44')](_0x1897c0,function(_0xe656ec){return{'id':_0xe656ec[_0xe5b6('0x30')],'name':_0xe656ec[_0xe5b6('0x77')],'custom':_[_0xe5b6('0x78')](_0xe656ec[_0xe5b6('0x30')],'_c')?!![]:![],'options':_0xe656ec[_0xe5b6('0x57')]?_[_0xe5b6('0x44')](_[_0xe5b6('0x75')](_0xe656ec[_0xe5b6('0x57')]),function(_0x38e499){return{'name':_0x38e499[_0xe5b6('0x79')],'value':_0x38e499['name']};}):[]};})};}})[_0xe5b6('0x1a')](respondWithResult(_0x25473c,null))[_0xe5b6('0x4c')](function(_0x434e69){var _0x34329e=_0x25c83d[_0xe5b6('0x35')][_0xe5b6('0x17')]?0x1f4:_0x434e69[_0xe5b6('0x7a')]||0x1f4;logger[_0xe5b6('0x20')](_0xe5b6('0x7b'),_0xe5b6('0x7c'),_0x34329e,JSON[_0xe5b6('0x1f')](_0x434e69));delete _0x434e69[_0xe5b6('0x30')];if(_0x34329e===0x191){_0x34329e=0x190;}_0x25473c[_0xe5b6('0x24')](_0x34329e)[_0xe5b6('0x31')](_0x25c83d[_0xe5b6('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x434e69[_0xe5b6('0x7a')]}:_0x434e69);});}else{var _0x487a7e=0x1f4;_0x25473c['status'](_0x487a7e)['send']({'message':_0xe5b6('0x7d'),'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 58fd938..6247930 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 _0x66f3=['../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','request-promise','rimraf'];(function(_0x354dd4,_0x2ec598){var _0x3dfaac=function(_0x2f7916){while(--_0x2f7916){_0x354dd4['push'](_0x354dd4['shift']());}};_0x3dfaac(++_0x2ec598);}(_0x66f3,0x12e));var _0x366f=function(_0x4a6a6b,_0x1909e3){_0x4a6a6b=_0x4a6a6b-0x0;var _0x3335a6=_0x66f3[_0x4a6a6b];return _0x3335a6;};'use strict';var _=require(_0x366f('0x0'));var util=require('util');var logger=require(_0x366f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x366f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x366f('0x3'));var config=require(_0x366f('0x4'));var attributes=require(_0x366f('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x366f('0x6')]=function(_0x140246,_0x4e312c){return _0x140246['define'](_0x366f('0x7'),attributes,{'tableName':_0x366f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dae=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','api'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x9dae,0x165));var _0xe9da=function(_0x182811,_0x3bcc28){_0x182811=_0x182811-0x0;var _0x4e2cbd=_0x9dae[_0x182811];return _0x4e2cbd;};'use strict';var _=require(_0xe9da('0x0'));var util=require(_0xe9da('0x1'));var logger=require('../../config/logger')(_0xe9da('0x2'));var moment=require(_0xe9da('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9da('0x4'));var fs=require('fs');var path=require(_0xe9da('0x5'));var rimraf=require(_0xe9da('0x6'));var config=require(_0xe9da('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xe9da('0x8'));module[_0xe9da('0x9')]=function(_0x16cb0d,_0x3e0b03){return _0x16cb0d[_0xe9da('0xa')](_0xe9da('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index a5903be..00d27de 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 _0xa1b9=['request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','include','model','map','stringify','ShowSugarcrmAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client'];(function(_0x7291bf,_0x3c48a6){var _0x36e485=function(_0x3b96db){while(--_0x3b96db){_0x7291bf['push'](_0x7291bf['shift']());}};_0x36e485(++_0x3c48a6);}(_0xa1b9,0x155));var _0x9a1b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa1b9[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x9a1b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9a1b('0x1'));var rs=require(_0x9a1b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a1b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a1b('0x4'))(_0x9a1b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a1b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x467643,_0x30c00f,_0x344dbd){return new BPromise(function(_0x4522d5,_0x23cb51){return client[_0x9a1b('0x7')](_0x467643,_0x344dbd)[_0x9a1b('0x8')](function(_0xc31527){logger[_0x9a1b('0x9')](_0x9a1b('0xa'),_0x30c00f,_0x9a1b('0xb'));logger[_0x9a1b('0xc')](_0x9a1b('0xd'),_0x30c00f,_0x9a1b('0xb'),JSON['stringify'](_0xc31527));if(_0xc31527[_0x9a1b('0xe')]){if(_0xc31527[_0x9a1b('0xe')][_0x9a1b('0xf')]===0x1f4){logger[_0x9a1b('0xe')](_0x9a1b('0xa'),_0x30c00f,_0xc31527[_0x9a1b('0xe')][_0x9a1b('0x10')]);return _0x23cb51(_0xc31527[_0x9a1b('0xe')]['message']);}logger[_0x9a1b('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x30c00f,_0xc31527['error'][_0x9a1b('0x10')]);return _0x4522d5(_0xc31527[_0x9a1b('0xe')][_0x9a1b('0x10')]);}else{logger[_0x9a1b('0x9')](_0x9a1b('0xa'),_0x30c00f,_0x9a1b('0xb'));_0x4522d5(_0xc31527['result'][_0x9a1b('0x10')]);}})[_0x9a1b('0x11')](function(_0x5f1749){logger[_0x9a1b('0xe')](_0x9a1b('0xa'),_0x30c00f,_0x5f1749);_0x23cb51(_0x5f1749);});});}exports[_0x9a1b('0x12')]=function(_0x24ca44){var _0x5bb79a=this;return new Promise(function(_0x5d7cf6,_0x23c559){return db[_0x9a1b('0x13')]['findAll']({'raw':_0x24ca44['options']?_0x24ca44[_0x9a1b('0x14')][_0x9a1b('0x15')]===undefined?!![]:![]:!![],'where':_0x24ca44['options']?_0x24ca44['options'][_0x9a1b('0x16')]||null:null,'attributes':_0x24ca44[_0x9a1b('0x14')]?_0x24ca44[_0x9a1b('0x14')][_0x9a1b('0x17')]||null:null,'limit':_0x24ca44[_0x9a1b('0x14')]?_0x24ca44['options']['limit']||null:null,'include':_0x24ca44[_0x9a1b('0x14')]?_0x24ca44[_0x9a1b('0x14')]['include']?_['map'](_0x24ca44['options'][_0x9a1b('0x18')],function(_0x3691a6){return{'model':db[_0x3691a6[_0x9a1b('0x19')]],'as':_0x3691a6['as'],'attributes':_0x3691a6['attributes'],'include':_0x3691a6[_0x9a1b('0x18')]?_[_0x9a1b('0x1a')](_0x3691a6['include'],function(_0x8e5f61){return{'model':db[_0x8e5f61[_0x9a1b('0x19')]],'as':_0x8e5f61['as'],'attributes':_0x8e5f61[_0x9a1b('0x17')],'include':_0x8e5f61[_0x9a1b('0x18')]?_[_0x9a1b('0x1a')](_0x8e5f61[_0x9a1b('0x18')],function(_0x54ccf6){return{'model':db[_0x54ccf6['model']],'as':_0x54ccf6['as'],'attributes':_0x54ccf6[_0x9a1b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aac5c){logger[_0x9a1b('0x9')](_0x9a1b('0x12'),_0x24ca44);logger[_0x9a1b('0xc')](_0x9a1b('0x12'),_0x24ca44,JSON[_0x9a1b('0x1b')](_0x2aac5c));_0x5d7cf6(_0x2aac5c);})[_0x9a1b('0x11')](function(_0x1dc3a8){logger[_0x9a1b('0xe')](_0x9a1b('0x12'),_0x1dc3a8[_0x9a1b('0x10')],_0x24ca44);_0x23c559(_0x5bb79a[_0x9a1b('0xe')](0x1f4,_0x1dc3a8[_0x9a1b('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x2a3e4b){var _0x31b0a3=this;return new Promise(function(_0x2af1f8,_0x2dc147){return db[_0x9a1b('0x13')]['find']({'raw':_0x2a3e4b[_0x9a1b('0x14')]?_0x2a3e4b[_0x9a1b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2a3e4b[_0x9a1b('0x14')]?_0x2a3e4b[_0x9a1b('0x14')][_0x9a1b('0x16')]||null:null,'attributes':_0x2a3e4b[_0x9a1b('0x14')]?_0x2a3e4b[_0x9a1b('0x14')][_0x9a1b('0x17')]||null:null,'include':_0x2a3e4b[_0x9a1b('0x14')]?_0x2a3e4b[_0x9a1b('0x14')][_0x9a1b('0x18')]?_[_0x9a1b('0x1a')](_0x2a3e4b[_0x9a1b('0x14')]['include'],function(_0x3c717c){return{'model':db[_0x3c717c[_0x9a1b('0x19')]],'as':_0x3c717c['as'],'attributes':_0x3c717c['attributes'],'include':_0x3c717c[_0x9a1b('0x18')]?_[_0x9a1b('0x1a')](_0x3c717c[_0x9a1b('0x18')],function(_0x4a3266){return{'model':db[_0x4a3266['model']],'as':_0x4a3266['as'],'attributes':_0x4a3266[_0x9a1b('0x17')],'include':_0x4a3266['include']?_['map'](_0x4a3266[_0x9a1b('0x18')],function(_0x2eb770){return{'model':db[_0x2eb770['model']],'as':_0x2eb770['as'],'attributes':_0x2eb770[_0x9a1b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9a1b('0x8')](function(_0xc172c0){logger[_0x9a1b('0x9')](_0x9a1b('0x1c'),_0x2a3e4b);logger['debug'](_0x9a1b('0x1c'),_0x2a3e4b,JSON['stringify'](_0xc172c0));_0x2af1f8(_0xc172c0);})['catch'](function(_0x27b8bf){logger[_0x9a1b('0xe')](_0x9a1b('0x1c'),_0x27b8bf[_0x9a1b('0x10')],_0x2a3e4b);_0x2dc147(_0x31b0a3[_0x9a1b('0xe')](0x1f4,_0x27b8bf['message']));});});}; \ No newline at end of file +var _0x7900=['where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7900,0x158));var _0x0790=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7900[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0790('0x0'));var util=require(_0x0790('0x1'));var moment=require(_0x0790('0x2'));var BPromise=require('bluebird');var rs=require(_0x0790('0x3'));var fs=require('fs');var Redis=require(_0x0790('0x4'));var db=require(_0x0790('0x5'))['db'];var utils=require(_0x0790('0x6'));var logger=require(_0x0790('0x7'))(_0x0790('0x8'));var config=require('../../config/environment');var jayson=require(_0x0790('0x9'));var client=jayson[_0x0790('0xa')][_0x0790('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f5f9,_0x417e03,_0x5c6b76){return new BPromise(function(_0xe3f143,_0xad8c45){return client[_0x0790('0xc')](_0x13f5f9,_0x5c6b76)[_0x0790('0xd')](function(_0x4ba239){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x417e03,_0x0790('0xe'));logger['debug'](_0x0790('0xf'),_0x417e03,'request\x20sent',JSON[_0x0790('0x10')](_0x4ba239));if(_0x4ba239[_0x0790('0x11')]){if(_0x4ba239[_0x0790('0x11')]['code']===0x1f4){logger[_0x0790('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x417e03,_0x4ba239[_0x0790('0x11')][_0x0790('0x12')]);return _0xad8c45(_0x4ba239[_0x0790('0x11')][_0x0790('0x12')]);}logger['error'](_0x0790('0x13'),_0x417e03,_0x4ba239[_0x0790('0x11')][_0x0790('0x12')]);return _0xe3f143(_0x4ba239[_0x0790('0x11')][_0x0790('0x12')]);}else{logger[_0x0790('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x417e03,_0x0790('0xe'));_0xe3f143(_0x4ba239[_0x0790('0x15')][_0x0790('0x12')]);}})['catch'](function(_0x30064a){logger['error'](_0x0790('0x13'),_0x417e03,_0x30064a);_0xad8c45(_0x30064a);});});}exports[_0x0790('0x16')]=function(_0x1e573a){var _0x480e40=this;return new Promise(function(_0x486079,_0x152793){return db[_0x0790('0x17')][_0x0790('0x18')]({'raw':_0x1e573a[_0x0790('0x19')]?_0x1e573a[_0x0790('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1e573a[_0x0790('0x19')]?_0x1e573a['options'][_0x0790('0x1a')]||null:null,'attributes':_0x1e573a[_0x0790('0x19')]?_0x1e573a[_0x0790('0x19')][_0x0790('0x1b')]||null:null,'limit':_0x1e573a[_0x0790('0x19')]?_0x1e573a[_0x0790('0x19')][_0x0790('0x1c')]||null:null,'include':_0x1e573a[_0x0790('0x19')]?_0x1e573a[_0x0790('0x19')][_0x0790('0x1d')]?_[_0x0790('0x1e')](_0x1e573a[_0x0790('0x19')][_0x0790('0x1d')],function(_0x3588de){return{'model':db[_0x3588de[_0x0790('0x1f')]],'as':_0x3588de['as'],'attributes':_0x3588de[_0x0790('0x1b')],'include':_0x3588de[_0x0790('0x1d')]?_[_0x0790('0x1e')](_0x3588de[_0x0790('0x1d')],function(_0x54b5ba){return{'model':db[_0x54b5ba[_0x0790('0x1f')]],'as':_0x54b5ba['as'],'attributes':_0x54b5ba[_0x0790('0x1b')],'include':_0x54b5ba[_0x0790('0x1d')]?_[_0x0790('0x1e')](_0x54b5ba[_0x0790('0x1d')],function(_0x2dea32){return{'model':db[_0x2dea32[_0x0790('0x1f')]],'as':_0x2dea32['as'],'attributes':_0x2dea32['attributes']};}):[]};}):[]};}):[]:[]})[_0x0790('0xd')](function(_0x5aa01c){logger['info'](_0x0790('0x16'),_0x1e573a);logger['debug'](_0x0790('0x16'),_0x1e573a,JSON[_0x0790('0x10')](_0x5aa01c));_0x486079(_0x5aa01c);})[_0x0790('0x20')](function(_0x380b45){logger[_0x0790('0x11')](_0x0790('0x16'),_0x380b45[_0x0790('0x12')],_0x1e573a);_0x152793(_0x480e40[_0x0790('0x11')](0x1f4,_0x380b45[_0x0790('0x12')]));});});};exports[_0x0790('0x21')]=function(_0x5a4c55){var _0x2a7703=this;return new Promise(function(_0x27dc31,_0x29f1fa){return db[_0x0790('0x17')][_0x0790('0x22')]({'raw':_0x5a4c55[_0x0790('0x19')]?_0x5a4c55[_0x0790('0x19')][_0x0790('0x23')]===undefined?!![]:![]:!![],'where':_0x5a4c55[_0x0790('0x19')]?_0x5a4c55['options'][_0x0790('0x1a')]||null:null,'attributes':_0x5a4c55[_0x0790('0x19')]?_0x5a4c55[_0x0790('0x19')][_0x0790('0x1b')]||null:null,'include':_0x5a4c55['options']?_0x5a4c55[_0x0790('0x19')][_0x0790('0x1d')]?_[_0x0790('0x1e')](_0x5a4c55[_0x0790('0x19')][_0x0790('0x1d')],function(_0x2f9975){return{'model':db[_0x2f9975[_0x0790('0x1f')]],'as':_0x2f9975['as'],'attributes':_0x2f9975[_0x0790('0x1b')],'include':_0x2f9975['include']?_[_0x0790('0x1e')](_0x2f9975[_0x0790('0x1d')],function(_0x49b543){return{'model':db[_0x49b543[_0x0790('0x1f')]],'as':_0x49b543['as'],'attributes':_0x49b543[_0x0790('0x1b')],'include':_0x49b543[_0x0790('0x1d')]?_[_0x0790('0x1e')](_0x49b543[_0x0790('0x1d')],function(_0x13302a){return{'model':db[_0x13302a['model']],'as':_0x13302a['as'],'attributes':_0x13302a['attributes']};}):[]};}):[]};}):[]:[]})[_0x0790('0xd')](function(_0x12d778){logger[_0x0790('0x14')](_0x0790('0x21'),_0x5a4c55);logger[_0x0790('0x24')]('ShowSugarcrmAccount',_0x5a4c55,JSON['stringify'](_0x12d778));_0x27dc31(_0x12d778);})[_0x0790('0x20')](function(_0x13fb3d){logger[_0x0790('0x11')](_0x0790('0x21'),_0x13fb3d[_0x0790('0x12')],_0x5a4c55);_0x29f1fa(_0x2a7703[_0x0790('0x11')](0x1f4,_0x13fb3d[_0x0790('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 2b4dfee..0e26e71 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 _0xda79=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util'];(function(_0xe93b11,_0x39d892){var _0x3239fe=function(_0x29533d){while(--_0x29533d){_0xe93b11['push'](_0xe93b11['shift']());}};_0x3239fe(++_0x39d892);}(_0xda79,0x82));var _0x9da7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xda79[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x9da7('0x0'));var util=require(_0x9da7('0x1'));var path=require('path');var timeout=require(_0x9da7('0x2'));var express=require('express');var router=express[_0x9da7('0x3')]();var auth=require(_0x9da7('0x4'));var interaction=require(_0x9da7('0x5'));var config=require('../../config/environment');var controller=require(_0x9da7('0x6'));router[_0x9da7('0x7')]('/',auth[_0x9da7('0x8')](),controller[_0x9da7('0x9')]);router[_0x9da7('0x7')](_0x9da7('0xa'),auth[_0x9da7('0x8')](),controller['show']);router['get'](_0x9da7('0xb'),auth['isAuthenticated'](),controller[_0x9da7('0xc')]);router[_0x9da7('0x7')](_0x9da7('0xd'),auth[_0x9da7('0x8')](),controller[_0x9da7('0xe')]);router[_0x9da7('0x7')]('/:id/descriptions',auth[_0x9da7('0x8')](),controller[_0x9da7('0xf')]);router[_0x9da7('0x10')]('/',auth['isAuthenticated'](),controller[_0x9da7('0x11')]);router[_0x9da7('0x12')](_0x9da7('0xa'),auth[_0x9da7('0x8')](),controller[_0x9da7('0x13')]);router[_0x9da7('0x14')](_0x9da7('0xa'),auth[_0x9da7('0x8')](),controller['destroy']);module[_0x9da7('0x15')]=router; \ No newline at end of file +var _0x76dc=['index','get','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x3b255d,_0x360f22){var _0x11de8d=function(_0x27ae48){while(--_0x27ae48){_0x3b255d['push'](_0x3b255d['shift']());}};_0x11de8d(++_0x360f22);}(_0x76dc,0x1f2));var _0xc76d=function(_0x37e2e3,_0x9af50c){_0x37e2e3=_0x37e2e3-0x0;var _0x452a6b=_0x76dc[_0x37e2e3];return _0x452a6b;};'use strict';var multer=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var path=require(_0xc76d('0x2'));var timeout=require(_0xc76d('0x3'));var express=require('express');var router=express[_0xc76d('0x4')]();var auth=require(_0xc76d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc76d('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0xc76d('0x7')](),controller[_0xc76d('0x8')]);router[_0xc76d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc76d('0xa')]);router[_0xc76d('0x9')](_0xc76d('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xc76d('0x9')](_0xc76d('0xc'),auth['isAuthenticated'](),controller[_0xc76d('0xd')]);router['get'](_0xc76d('0xe'),auth[_0xc76d('0x7')](),controller[_0xc76d('0xf')]);router[_0xc76d('0x10')]('/',auth[_0xc76d('0x7')](),controller[_0xc76d('0x11')]);router[_0xc76d('0x12')](_0xc76d('0x13'),auth[_0xc76d('0x7')](),controller[_0xc76d('0x14')]);router[_0xc76d('0x15')](_0xc76d('0x13'),auth[_0xc76d('0x7')](),controller[_0xc76d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index f29aa17..d39748c 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 _0x2256=['exports','STRING','sequelize'];(function(_0x5da17a,_0x480929){var _0x51fa58=function(_0x57fe5b){while(--_0x57fe5b){_0x5da17a['push'](_0x5da17a['shift']());}};_0x51fa58(++_0x480929);}(_0x2256,0xcb));var _0x6225=function(_0x30a0b1,_0x1117c1){_0x30a0b1=_0x30a0b1-0x0;var _0x4f9204=_0x2256[_0x30a0b1];return _0x4f9204;};'use strict';var Sequelize=require(_0x6225('0x0'));module[_0x6225('0x1')]={'name':{'type':Sequelize[_0x6225('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x61c7=['exports','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61c7,0x1cd));var _0x761c=function(_0x46180a,_0x23483e){_0x46180a=_0x46180a-0x0;var _0x3b3e78=_0x61c7[_0x46180a];return _0x3b3e78;};'use strict';var Sequelize=require(_0x761c('0x0'));module[_0x761c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x761c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 690fd8d..6f4a515 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 _0xb086=['../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','findAll','rows','show','params','include','find','create','body','findOne','SugarcrmField','sort','map','getFields','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x405439,_0xe4fb83){var _0x26725f=function(_0x2595b9){while(--_0x2595b9){_0x405439['push'](_0x405439['shift']());}};_0x26725f(++_0xe4fb83);}(_0xb086,0x1ab));var _0x6b08=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb086[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0x6b08('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b08('0x1'));var zipdir=require(_0x6b08('0x2'));var jsonpatch=require(_0x6b08('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6b08('0x4'));var util=require('util');var path=require(_0x6b08('0x5'));var sox=require('sox');var csv=require(_0x6b08('0x6'));var ejs=require(_0x6b08('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b08('0x8'));var crypto=require(_0x6b08('0x9'));var jsforce=require(_0x6b08('0xa'));var deskjs=require(_0x6b08('0xb'));var toCsv=require(_0x6b08('0x6'));var querystring=require(_0x6b08('0xc'));var Papa=require(_0x6b08('0xd'));var Redis=require(_0x6b08('0xe'));var authService=require(_0x6b08('0xf'));var qs=require(_0x6b08('0x10'));var hardwareService=require(_0x6b08('0x11'));var logger=require(_0x6b08('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6b08('0x13'));var db=require(_0x6b08('0x14'))['db'];var jayson=require(_0x6b08('0x15'));var client=jayson[_0x6b08('0x16')][_0x6b08('0x17')]({'port':0x232a});function checkPasswordPattern(_0xf27cb5,_0x13cca5,_0x391ac0){if(_0x391ac0){var _0x581070=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x581070['test'](_0x13cca5)){return _0xf27cb5;}else{throw new Error(_0x6b08('0x18'));}}else{return _0xf27cb5;}}function respondWithRpcPromise(_0x5bbe09,_0x3a7bbb,_0x226543,_0x44b2d8){return new BPromise(function(_0x159f43,_0x4eb00f){var _0x2e7cb6=_0x44b2d8||client;return _0x2e7cb6[_0x6b08('0x19')](_0x5bbe09,_0x226543)[_0x6b08('0x1a')](function(_0x4e5ab7){logger['info'](_0x6b08('0x1b'),_0x3a7bbb,_0x6b08('0x1c'));logger[_0x6b08('0x1d')](_0x6b08('0x1e'),_0x3a7bbb,_0x6b08('0x1c'),JSON[_0x6b08('0x1f')](_0x4e5ab7));if(_0x4e5ab7['error']){if(_0x4e5ab7[_0x6b08('0x20')]['code']===0x1f4){logger['error'](_0x6b08('0x1b'),_0x3a7bbb,_0x4e5ab7[_0x6b08('0x20')][_0x6b08('0x21')]);return _0x4eb00f(_0x4e5ab7[_0x6b08('0x20')]['message']);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3a7bbb,_0x4e5ab7[_0x6b08('0x20')][_0x6b08('0x21')]);return _0x159f43(_0x4e5ab7['error']['message']);}else{logger[_0x6b08('0x22')](_0x6b08('0x1b'),_0x3a7bbb,_0x6b08('0x1c'));_0x159f43(_0x4e5ab7[_0x6b08('0x23')][_0x6b08('0x21')]);}})[_0x6b08('0x24')](function(_0x1535ea){logger[_0x6b08('0x20')](_0x6b08('0x1b'),_0x3a7bbb,_0x1535ea);_0x4eb00f(_0x1535ea);});});}function respondWithStatusCode(_0x2e1b27,_0x26ff49){_0x26ff49=_0x26ff49||0xcc;return function(_0xafb979){if(_0xafb979){return _0x2e1b27[_0x6b08('0x25')](_0x26ff49);}return _0x2e1b27[_0x6b08('0x26')](_0x26ff49)['end']();};}function respondWithResult(_0x5a53c9,_0x3e5867){_0x3e5867=_0x3e5867||0xc8;return function(_0x3ea500){if(_0x3ea500){return _0x5a53c9[_0x6b08('0x26')](_0x3e5867)[_0x6b08('0x27')](_0x3ea500);}};}function respondWithFilteredResult(_0x59ce27,_0x4c8ce6){return function(_0x1fab41){if(_0x1fab41){var _0x2ecfa2=_0x1fab41[_0x6b08('0x28')],_0x325737=_0x4c8ce6[_0x6b08('0x29')],_0x3fbfab=_0x4c8ce6[_0x6b08('0x29')]+_0x4c8ce6[_0x6b08('0x2a')],_0x9cc9cb;if(_0x3fbfab>=_0x2ecfa2){_0x3fbfab=_0x2ecfa2;_0x9cc9cb=0xc8;}else{_0x9cc9cb=0xce;}_0x59ce27[_0x6b08('0x26')](_0x9cc9cb);return _0x59ce27[_0x6b08('0x2b')](_0x6b08('0x2c'),_0x325737+'-'+_0x3fbfab+'/'+_0x2ecfa2)[_0x6b08('0x27')](_0x1fab41);}return null;};}function patchUpdates(_0x51d085){return function(_0x220ec8){try{jsonpatch['apply'](_0x220ec8,_0x51d085,!![]);}catch(_0x369981){return BPromise[_0x6b08('0x2d')](_0x369981);}return _0x220ec8[_0x6b08('0x2e')]();};}function saveUpdates(_0x526ecf,_0x5bf1af){return function(_0x27ffd1){if(_0x27ffd1){return _0x27ffd1[_0x6b08('0x2f')](_0x526ecf)['then'](function(_0x22fcfb){return _0x22fcfb;});}return null;};}function removeEntity(_0xecc413,_0x134629){return function(_0x31cc55){if(_0x31cc55){return _0x31cc55[_0x6b08('0x30')]()['then'](function(){_0xecc413[_0x6b08('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35750f,_0x408133){return function(_0x4c136f){if(!_0x4c136f){_0x35750f[_0x6b08('0x25')](0x194);}return _0x4c136f;};}function handleError(_0x1d0e95,_0x390c24){_0x390c24=_0x390c24||0x1f4;return function(_0x1c1b54){logger[_0x6b08('0x20')](_0x1c1b54[_0x6b08('0x31')]);if(_0x1c1b54[_0x6b08('0x32')]){delete _0x1c1b54[_0x6b08('0x32')];}_0x1d0e95[_0x6b08('0x26')](_0x390c24)['send'](_0x1c1b54);};}exports[_0x6b08('0x33')]=function(_0x3d3aab,_0x7238e4){var _0xa970={},_0xbaf152={},_0x17667d={'count':0x0,'rows':[]};var _0x5a71b4=db[_0x6b08('0x34')][_0x6b08('0x35')];_0xbaf152[_0x6b08('0x36')]=_[_0x6b08('0x37')](_0x5a71b4);_0xbaf152['query']=_[_0x6b08('0x37')](_0x3d3aab[_0x6b08('0x38')]);_0xbaf152[_0x6b08('0x39')]=_[_0x6b08('0x3a')](_0xbaf152[_0x6b08('0x36')],_0xbaf152[_0x6b08('0x38')]);_0xa970[_0x6b08('0x3b')]=_[_0x6b08('0x3a')](_0xbaf152[_0x6b08('0x36')],qs[_0x6b08('0x3c')](_0x3d3aab['query'][_0x6b08('0x3c')]));_0xa970[_0x6b08('0x3b')]=_0xa970['attributes'][_0x6b08('0x3d')]?_0xa970[_0x6b08('0x3b')]:_0xbaf152[_0x6b08('0x36')];if(!_0x3d3aab[_0x6b08('0x38')][_0x6b08('0x3e')](_0x6b08('0x3f'))){_0xa970[_0x6b08('0x2a')]=qs[_0x6b08('0x2a')](_0x3d3aab[_0x6b08('0x38')][_0x6b08('0x2a')]);_0xa970[_0x6b08('0x29')]=qs[_0x6b08('0x29')](_0x3d3aab[_0x6b08('0x38')]['offset']);}_0xa970[_0x6b08('0x40')]=qs['sort'](_0x3d3aab[_0x6b08('0x38')]['sort']);_0xa970[_0x6b08('0x41')]=qs[_0x6b08('0x39')](_[_0x6b08('0x42')](_0x3d3aab[_0x6b08('0x38')],_0xbaf152['filters']));if(_0x3d3aab['query']['filter']){_0xa970[_0x6b08('0x41')]=_[_0x6b08('0x43')](_0xa970[_0x6b08('0x41')],{'$or':_['map'](_0x5a71b4,function(_0x1353a7){if(_0x1353a7[_0x6b08('0x44')]['key']!==_0x6b08('0x45')){var _0x41b231={};_0x41b231[_0x1353a7[_0x6b08('0x46')]]={'$like':'%'+_0x3d3aab[_0x6b08('0x38')][_0x6b08('0x47')]+'%'};return _0x41b231;}})});}_0xa970=_[_0x6b08('0x43')]({},_0xa970,_0x3d3aab[_0x6b08('0x48')]);var _0x415ec6={'where':_0xa970[_0x6b08('0x41')]};return db[_0x6b08('0x34')]['count'](_0x415ec6)[_0x6b08('0x1a')](function(_0x921253){_0x17667d[_0x6b08('0x28')]=_0x921253;if(_0x3d3aab[_0x6b08('0x38')][_0x6b08('0x49')]){_0xa970['include']=[{'all':!![]}];}return db[_0x6b08('0x34')][_0x6b08('0x4a')](_0xa970);})[_0x6b08('0x1a')](function(_0x46a3d6){_0x17667d[_0x6b08('0x4b')]=_0x46a3d6;return _0x17667d;})[_0x6b08('0x1a')](respondWithFilteredResult(_0x7238e4,_0xa970))['catch'](handleError(_0x7238e4,null));};exports[_0x6b08('0x4c')]=function(_0x2c1fe4,_0x3b47d8){var _0x201df4={'raw':![],'where':{'id':_0x2c1fe4[_0x6b08('0x4d')]['id']}},_0x17e25c={};_0x17e25c['model']=_[_0x6b08('0x37')](db[_0x6b08('0x34')]['rawAttributes']);_0x17e25c[_0x6b08('0x38')]=_[_0x6b08('0x37')](_0x2c1fe4[_0x6b08('0x38')]);_0x17e25c['filters']=_[_0x6b08('0x3a')](_0x17e25c[_0x6b08('0x36')],_0x17e25c[_0x6b08('0x38')]);_0x201df4['attributes']=_[_0x6b08('0x3a')](_0x17e25c['model'],qs[_0x6b08('0x3c')](_0x2c1fe4[_0x6b08('0x38')][_0x6b08('0x3c')]));_0x201df4['attributes']=_0x201df4[_0x6b08('0x3b')][_0x6b08('0x3d')]?_0x201df4['attributes']:_0x17e25c[_0x6b08('0x36')];if(_0x2c1fe4['query'][_0x6b08('0x49')]){_0x201df4[_0x6b08('0x4e')]=[{'all':!![]}];}_0x201df4=_['merge']({},_0x201df4,_0x2c1fe4[_0x6b08('0x48')]);return db[_0x6b08('0x34')][_0x6b08('0x4f')](_0x201df4)[_0x6b08('0x1a')](handleEntityNotFound(_0x3b47d8,null))[_0x6b08('0x1a')](respondWithResult(_0x3b47d8,null))[_0x6b08('0x24')](handleError(_0x3b47d8,null));};exports[_0x6b08('0x50')]=function(_0x481f42,_0x4c9bdd){return db[_0x6b08('0x34')][_0x6b08('0x50')](_0x481f42[_0x6b08('0x51')],{})[_0x6b08('0x1a')](respondWithResult(_0x4c9bdd,0xc9))[_0x6b08('0x24')](handleError(_0x4c9bdd,null));};exports[_0x6b08('0x2f')]=function(_0x116e58,_0x3a571c){if(_0x116e58[_0x6b08('0x51')]['id']){delete _0x116e58[_0x6b08('0x51')]['id'];}return db[_0x6b08('0x34')]['find']({'where':{'id':_0x116e58[_0x6b08('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3a571c,null))[_0x6b08('0x1a')](saveUpdates(_0x116e58[_0x6b08('0x51')],null))[_0x6b08('0x1a')](respondWithResult(_0x3a571c,null))[_0x6b08('0x24')](handleError(_0x3a571c,null));};exports['destroy']=function(_0x3f45d1,_0x3b6d83){return db[_0x6b08('0x34')][_0x6b08('0x4f')]({'where':{'id':_0x3f45d1[_0x6b08('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3b6d83,null))['then'](removeEntity(_0x3b6d83,null))[_0x6b08('0x24')](handleError(_0x3b6d83,null));};exports['getFields']=function(_0x7964e,_0x350770,_0x299fc2){var _0xc90ec8={};var _0xb3fb28={};var _0x58035f;var _0x1d9d15;return db['SugarcrmConfiguration'][_0x6b08('0x52')]({'where':{'id':_0x7964e[_0x6b08('0x4d')]['id']}})['then'](handleEntityNotFound(_0x350770,null))['then'](function(_0x17a21d){if(_0x17a21d){_0x58035f=_0x17a21d;_0xb3fb28[_0x6b08('0x36')]=_['keys'](db[_0x6b08('0x53')][_0x6b08('0x35')]);_0xb3fb28[_0x6b08('0x38')]=_[_0x6b08('0x37')](_0x7964e[_0x6b08('0x38')]);_0xb3fb28[_0x6b08('0x39')]=_[_0x6b08('0x3a')](_0xb3fb28[_0x6b08('0x36')],_0xb3fb28[_0x6b08('0x38')]);_0xc90ec8[_0x6b08('0x3b')]=_[_0x6b08('0x3a')](_0xb3fb28['model'],qs[_0x6b08('0x3c')](_0x7964e['query'][_0x6b08('0x3c')]));_0xc90ec8[_0x6b08('0x3b')]=_0xc90ec8[_0x6b08('0x3b')]['length']?_0xc90ec8[_0x6b08('0x3b')]:_0xb3fb28[_0x6b08('0x36')];_0xc90ec8[_0x6b08('0x40')]=qs[_0x6b08('0x54')](_0x7964e['query'][_0x6b08('0x54')]);_0xc90ec8['where']=qs['filters'](_[_0x6b08('0x42')](_0x7964e[_0x6b08('0x38')],_0xb3fb28[_0x6b08('0x39')]));if(_0x7964e[_0x6b08('0x38')]['filter']){_0xc90ec8[_0x6b08('0x41')]=_[_0x6b08('0x43')](_0xc90ec8[_0x6b08('0x41')],{'$or':_[_0x6b08('0x55')](_0xc90ec8[_0x6b08('0x3b')],function(_0x1f2983){var _0x3bc024={};_0x3bc024[_0x1f2983]={'$like':'%'+_0x7964e['query']['filter']+'%'};return _0x3bc024;})});}_0xc90ec8=_[_0x6b08('0x43')]({},_0xc90ec8,_0x7964e[_0x6b08('0x48')]);return _0x58035f[_0x6b08('0x56')](_0xc90ec8);}})[_0x6b08('0x1a')](function(_0x548184){if(_0x548184){_0x1d9d15=_0x548184[_0x6b08('0x3d')];if(!_0x7964e[_0x6b08('0x38')][_0x6b08('0x3e')](_0x6b08('0x3f'))){_0xc90ec8[_0x6b08('0x2a')]=qs['limit'](_0x7964e[_0x6b08('0x38')][_0x6b08('0x2a')]);_0xc90ec8[_0x6b08('0x29')]=qs['offset'](_0x7964e[_0x6b08('0x38')][_0x6b08('0x29')]);}return _0x58035f[_0x6b08('0x56')](_0xc90ec8);}})['then'](function(_0x5b9086){if(_0x5b9086){return _0x5b9086?{'count':_0x1d9d15,'rows':_0x5b9086}:null;}})[_0x6b08('0x1a')](respondWithResult(_0x350770,null))['catch'](handleError(_0x350770,null));};exports[_0x6b08('0x57')]=function(_0x54393e,_0x1c1324,_0x1d81a4){var _0x2471c1={};var _0x326e60={};var _0x1e4778;var _0xb3ba41;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x54393e['params']['id']}})[_0x6b08('0x1a')](handleEntityNotFound(_0x1c1324,null))[_0x6b08('0x1a')](function(_0x5a51ce){if(_0x5a51ce){_0x1e4778=_0x5a51ce;_0x326e60[_0x6b08('0x36')]=_[_0x6b08('0x37')](db[_0x6b08('0x53')]['rawAttributes']);_0x326e60[_0x6b08('0x38')]=_['keys'](_0x54393e['query']);_0x326e60[_0x6b08('0x39')]=_['intersection'](_0x326e60[_0x6b08('0x36')],_0x326e60[_0x6b08('0x38')]);_0x2471c1[_0x6b08('0x3b')]=_['intersection'](_0x326e60[_0x6b08('0x36')],qs['fields'](_0x54393e[_0x6b08('0x38')][_0x6b08('0x3c')]));_0x2471c1[_0x6b08('0x3b')]=_0x2471c1[_0x6b08('0x3b')]['length']?_0x2471c1[_0x6b08('0x3b')]:_0x326e60[_0x6b08('0x36')];_0x2471c1[_0x6b08('0x40')]=qs[_0x6b08('0x54')](_0x54393e[_0x6b08('0x38')]['sort']);_0x2471c1[_0x6b08('0x41')]=qs[_0x6b08('0x39')](_[_0x6b08('0x42')](_0x54393e[_0x6b08('0x38')],_0x326e60[_0x6b08('0x39')]));if(_0x54393e[_0x6b08('0x38')][_0x6b08('0x47')]){_0x2471c1[_0x6b08('0x41')]=_[_0x6b08('0x43')](_0x2471c1[_0x6b08('0x41')],{'$or':_[_0x6b08('0x55')](_0x2471c1['attributes'],function(_0x51620e){var _0xe1400b={};_0xe1400b[_0x51620e]={'$like':'%'+_0x54393e[_0x6b08('0x38')][_0x6b08('0x47')]+'%'};return _0xe1400b;})});}_0x2471c1=_[_0x6b08('0x43')]({},_0x2471c1,_0x54393e['options']);return _0x1e4778[_0x6b08('0x57')](_0x2471c1);}})[_0x6b08('0x1a')](function(_0x25415a){if(_0x25415a){_0xb3ba41=_0x25415a['length'];if(!_0x54393e[_0x6b08('0x38')][_0x6b08('0x3e')](_0x6b08('0x3f'))){_0x2471c1['limit']=qs[_0x6b08('0x2a')](_0x54393e[_0x6b08('0x38')][_0x6b08('0x2a')]);_0x2471c1[_0x6b08('0x29')]=qs['offset'](_0x54393e[_0x6b08('0x38')][_0x6b08('0x29')]);}return _0x1e4778['getSubjects'](_0x2471c1);}})[_0x6b08('0x1a')](function(_0x176b49){if(_0x176b49){return _0x176b49?{'count':_0xb3ba41,'rows':_0x176b49}:null;}})['then'](respondWithResult(_0x1c1324,null))[_0x6b08('0x24')](handleError(_0x1c1324,null));};exports[_0x6b08('0x58')]=function(_0x5129be,_0x5da797,_0x431503){var _0x1a06ca={};var _0x23f44c={};var _0x26d032;var _0x14a54a;return db[_0x6b08('0x34')][_0x6b08('0x52')]({'where':{'id':_0x5129be[_0x6b08('0x4d')]['id']}})[_0x6b08('0x1a')](handleEntityNotFound(_0x5da797,null))[_0x6b08('0x1a')](function(_0x269004){if(_0x269004){_0x26d032=_0x269004;_0x23f44c[_0x6b08('0x36')]=_[_0x6b08('0x37')](db[_0x6b08('0x53')][_0x6b08('0x35')]);_0x23f44c[_0x6b08('0x38')]=_[_0x6b08('0x37')](_0x5129be['query']);_0x23f44c[_0x6b08('0x39')]=_[_0x6b08('0x3a')](_0x23f44c[_0x6b08('0x36')],_0x23f44c[_0x6b08('0x38')]);_0x1a06ca[_0x6b08('0x3b')]=_[_0x6b08('0x3a')](_0x23f44c[_0x6b08('0x36')],qs['fields'](_0x5129be[_0x6b08('0x38')][_0x6b08('0x3c')]));_0x1a06ca[_0x6b08('0x3b')]=_0x1a06ca[_0x6b08('0x3b')]['length']?_0x1a06ca[_0x6b08('0x3b')]:_0x23f44c['model'];_0x1a06ca['order']=qs[_0x6b08('0x54')](_0x5129be['query'][_0x6b08('0x54')]);_0x1a06ca[_0x6b08('0x41')]=qs[_0x6b08('0x39')](_[_0x6b08('0x42')](_0x5129be[_0x6b08('0x38')],_0x23f44c[_0x6b08('0x39')]));if(_0x5129be['query']['filter']){_0x1a06ca[_0x6b08('0x41')]=_[_0x6b08('0x43')](_0x1a06ca[_0x6b08('0x41')],{'$or':_[_0x6b08('0x55')](_0x1a06ca['attributes'],function(_0x2cc1c0){var _0x5659e1={};_0x5659e1[_0x2cc1c0]={'$like':'%'+_0x5129be[_0x6b08('0x38')][_0x6b08('0x47')]+'%'};return _0x5659e1;})});}_0x1a06ca=_['merge']({},_0x1a06ca,_0x5129be[_0x6b08('0x48')]);return _0x26d032['getDescriptions'](_0x1a06ca);}})[_0x6b08('0x1a')](function(_0x243244){if(_0x243244){_0x14a54a=_0x243244['length'];if(!_0x5129be[_0x6b08('0x38')]['hasOwnProperty'](_0x6b08('0x3f'))){_0x1a06ca['limit']=qs[_0x6b08('0x2a')](_0x5129be['query'][_0x6b08('0x2a')]);_0x1a06ca[_0x6b08('0x29')]=qs['offset'](_0x5129be[_0x6b08('0x38')][_0x6b08('0x29')]);}return _0x26d032[_0x6b08('0x58')](_0x1a06ca);}})[_0x6b08('0x1a')](function(_0x2873df){if(_0x2873df){return _0x2873df?{'count':_0x14a54a,'rows':_0x2873df}:null;}})[_0x6b08('0x1a')](respondWithResult(_0x5da797,null))[_0x6b08('0x24')](handleError(_0x5da797,null));}; \ No newline at end of file +var _0x3715=['filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','findOne','getFields','getSubjects','SugarcrmField','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','name','index','SugarcrmConfiguration','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','key','VIRTUAL','field'];(function(_0x59cb78,_0x264e80){var _0x157feb=function(_0x5cc10b){while(--_0x5cc10b){_0x59cb78['push'](_0x59cb78['shift']());}};_0x157feb(++_0x264e80);}(_0x3715,0xb7));var _0x5371=function(_0x19f8f7,_0x1672d8){_0x19f8f7=_0x19f8f7-0x0;var _0x57b5f5=_0x3715[_0x19f8f7];return _0x57b5f5;};'use strict';var pdf=require(_0x5371('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5371('0x1'));var zipdir=require(_0x5371('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5371('0x3'));var moment=require(_0x5371('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5371('0x5'));var sox=require(_0x5371('0x6'));var csv=require(_0x5371('0x7'));var ejs=require(_0x5371('0x8'));var fs=require('fs');var _=require(_0x5371('0x9'));var squel=require(_0x5371('0xa'));var crypto=require(_0x5371('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5371('0x7'));var querystring=require('querystring');var Papa=require(_0x5371('0xc'));var Redis=require(_0x5371('0xd'));var authService=require(_0x5371('0xe'));var qs=require(_0x5371('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5371('0x10'))('api');var utils=require(_0x5371('0x11'));var config=require(_0x5371('0x12'));var db=require(_0x5371('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5371('0x14')]({'port':0x232a});function checkPasswordPattern(_0x29ece2,_0x5279bd,_0x57eba3){if(_0x57eba3){var _0x531914=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x531914['test'](_0x5279bd)){return _0x29ece2;}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 _0x29ece2;}}function respondWithRpcPromise(_0x48e795,_0xfd9866,_0x2f8cf4,_0x4729f6){return new BPromise(function(_0x3eca9e,_0x4829b1){var _0x51a932=_0x4729f6||client;return _0x51a932[_0x5371('0x15')](_0x48e795,_0x2f8cf4)[_0x5371('0x16')](function(_0x1a2784){logger[_0x5371('0x17')](_0x5371('0x18'),_0xfd9866,_0x5371('0x19'));logger[_0x5371('0x1a')](_0x5371('0x1b'),_0xfd9866,_0x5371('0x19'),JSON['stringify'](_0x1a2784));if(_0x1a2784[_0x5371('0x1c')]){if(_0x1a2784[_0x5371('0x1c')]['code']===0x1f4){logger[_0x5371('0x1c')](_0x5371('0x18'),_0xfd9866,_0x1a2784[_0x5371('0x1c')]['message']);return _0x4829b1(_0x1a2784[_0x5371('0x1c')][_0x5371('0x1d')]);}logger[_0x5371('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xfd9866,_0x1a2784[_0x5371('0x1c')][_0x5371('0x1d')]);return _0x3eca9e(_0x1a2784[_0x5371('0x1c')][_0x5371('0x1d')]);}else{logger[_0x5371('0x17')](_0x5371('0x18'),_0xfd9866,_0x5371('0x19'));_0x3eca9e(_0x1a2784[_0x5371('0x1e')][_0x5371('0x1d')]);}})['catch'](function(_0x283762){logger[_0x5371('0x1c')](_0x5371('0x18'),_0xfd9866,_0x283762);_0x4829b1(_0x283762);});});}function respondWithStatusCode(_0x40ea2c,_0x394f0e){_0x394f0e=_0x394f0e||0xcc;return function(_0x2a2f97){if(_0x2a2f97){return _0x40ea2c[_0x5371('0x1f')](_0x394f0e);}return _0x40ea2c[_0x5371('0x20')](_0x394f0e)[_0x5371('0x21')]();};}function respondWithResult(_0x11ef33,_0xe3bbf5){_0xe3bbf5=_0xe3bbf5||0xc8;return function(_0x49320b){if(_0x49320b){return _0x11ef33['status'](_0xe3bbf5)['json'](_0x49320b);}};}function respondWithFilteredResult(_0x1ad378,_0x1ccfe0){return function(_0x5f0626){if(_0x5f0626){var _0x5c3a86=_0x5f0626[_0x5371('0x22')],_0x355b58=_0x1ccfe0[_0x5371('0x23')],_0x434250=_0x1ccfe0[_0x5371('0x23')]+_0x1ccfe0[_0x5371('0x24')],_0x5cca84;if(_0x434250>=_0x5c3a86){_0x434250=_0x5c3a86;_0x5cca84=0xc8;}else{_0x5cca84=0xce;}_0x1ad378['status'](_0x5cca84);return _0x1ad378[_0x5371('0x25')](_0x5371('0x26'),_0x355b58+'-'+_0x434250+'/'+_0x5c3a86)[_0x5371('0x27')](_0x5f0626);}return null;};}function patchUpdates(_0x53fe12){return function(_0x120646){try{jsonpatch[_0x5371('0x28')](_0x120646,_0x53fe12,!![]);}catch(_0x610ddd){return BPromise[_0x5371('0x29')](_0x610ddd);}return _0x120646['save']();};}function saveUpdates(_0x119823,_0x4be95c){return function(_0x5d9f3b){if(_0x5d9f3b){return _0x5d9f3b[_0x5371('0x2a')](_0x119823)[_0x5371('0x16')](function(_0x2d2068){return _0x2d2068;});}return null;};}function removeEntity(_0x3dc8b3,_0x1ea22b){return function(_0x1e88b9){if(_0x1e88b9){return _0x1e88b9['destroy']()[_0x5371('0x16')](function(){_0x3dc8b3[_0x5371('0x20')](0xcc)[_0x5371('0x21')]();});}};}function handleEntityNotFound(_0x2a3968,_0x331c48){return function(_0x5bd5b6){if(!_0x5bd5b6){_0x2a3968['sendStatus'](0x194);}return _0x5bd5b6;};}function handleError(_0x162e49,_0x5eac3b){_0x5eac3b=_0x5eac3b||0x1f4;return function(_0x17695f){logger[_0x5371('0x1c')](_0x17695f['stack']);if(_0x17695f[_0x5371('0x2b')]){delete _0x17695f[_0x5371('0x2b')];}_0x162e49['status'](_0x5eac3b)['send'](_0x17695f);};}exports[_0x5371('0x2c')]=function(_0x5936da,_0x59669b){var _0x56f549={},_0x376e1d={},_0x81bb56={'count':0x0,'rows':[]};var _0x554f03=db[_0x5371('0x2d')][_0x5371('0x2e')];_0x376e1d[_0x5371('0x2f')]=_['keys'](_0x554f03);_0x376e1d[_0x5371('0x30')]=_[_0x5371('0x31')](_0x5936da['query']);_0x376e1d['filters']=_[_0x5371('0x32')](_0x376e1d['model'],_0x376e1d[_0x5371('0x30')]);_0x56f549[_0x5371('0x33')]=_[_0x5371('0x32')](_0x376e1d[_0x5371('0x2f')],qs['fields'](_0x5936da[_0x5371('0x30')][_0x5371('0x34')]));_0x56f549[_0x5371('0x33')]=_0x56f549[_0x5371('0x33')][_0x5371('0x35')]?_0x56f549[_0x5371('0x33')]:_0x376e1d[_0x5371('0x2f')];if(!_0x5936da[_0x5371('0x30')][_0x5371('0x36')](_0x5371('0x37'))){_0x56f549[_0x5371('0x24')]=qs['limit'](_0x5936da[_0x5371('0x30')][_0x5371('0x24')]);_0x56f549[_0x5371('0x23')]=qs['offset'](_0x5936da[_0x5371('0x30')][_0x5371('0x23')]);}_0x56f549[_0x5371('0x38')]=qs[_0x5371('0x39')](_0x5936da[_0x5371('0x30')][_0x5371('0x39')]);_0x56f549[_0x5371('0x3a')]=qs['filters'](_[_0x5371('0x3b')](_0x5936da[_0x5371('0x30')],_0x376e1d[_0x5371('0x3c')]));if(_0x5936da[_0x5371('0x30')]['filter']){_0x56f549[_0x5371('0x3a')]=_[_0x5371('0x3d')](_0x56f549['where'],{'$or':_[_0x5371('0x3e')](_0x554f03,function(_0x322fc2){if(_0x322fc2['type'][_0x5371('0x3f')]!==_0x5371('0x40')){var _0x3abb66={};_0x3abb66[_0x322fc2[_0x5371('0x41')]]={'$like':'%'+_0x5936da[_0x5371('0x30')][_0x5371('0x42')]+'%'};return _0x3abb66;}})});}_0x56f549=_['merge']({},_0x56f549,_0x5936da[_0x5371('0x43')]);var _0x5d995f={'where':_0x56f549['where']};return db[_0x5371('0x2d')][_0x5371('0x22')](_0x5d995f)[_0x5371('0x16')](function(_0x15929a){_0x81bb56['count']=_0x15929a;if(_0x5936da[_0x5371('0x30')]['includeAll']){_0x56f549[_0x5371('0x44')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x5371('0x45')](_0x56f549);})[_0x5371('0x16')](function(_0x207312){_0x81bb56[_0x5371('0x46')]=_0x207312;return _0x81bb56;})[_0x5371('0x16')](respondWithFilteredResult(_0x59669b,_0x56f549))[_0x5371('0x47')](handleError(_0x59669b,null));};exports['show']=function(_0x617fda,_0xa8c7f6){var _0x1562b4={'raw':![],'where':{'id':_0x617fda[_0x5371('0x48')]['id']}},_0x2da2c7={};_0x2da2c7[_0x5371('0x2f')]=_[_0x5371('0x31')](db[_0x5371('0x2d')][_0x5371('0x2e')]);_0x2da2c7[_0x5371('0x30')]=_[_0x5371('0x31')](_0x617fda[_0x5371('0x30')]);_0x2da2c7['filters']=_['intersection'](_0x2da2c7[_0x5371('0x2f')],_0x2da2c7[_0x5371('0x30')]);_0x1562b4[_0x5371('0x33')]=_['intersection'](_0x2da2c7[_0x5371('0x2f')],qs[_0x5371('0x34')](_0x617fda[_0x5371('0x30')][_0x5371('0x34')]));_0x1562b4[_0x5371('0x33')]=_0x1562b4[_0x5371('0x33')][_0x5371('0x35')]?_0x1562b4[_0x5371('0x33')]:_0x2da2c7[_0x5371('0x2f')];if(_0x617fda['query'][_0x5371('0x49')]){_0x1562b4['include']=[{'all':!![]}];}_0x1562b4=_['merge']({},_0x1562b4,_0x617fda[_0x5371('0x43')]);return db['SugarcrmConfiguration'][_0x5371('0x4a')](_0x1562b4)[_0x5371('0x16')](handleEntityNotFound(_0xa8c7f6,null))[_0x5371('0x16')](respondWithResult(_0xa8c7f6,null))[_0x5371('0x47')](handleError(_0xa8c7f6,null));};exports['create']=function(_0x13a915,_0x3bbbca){return db[_0x5371('0x2d')][_0x5371('0x4b')](_0x13a915[_0x5371('0x4c')],{})[_0x5371('0x16')](respondWithResult(_0x3bbbca,0xc9))['catch'](handleError(_0x3bbbca,null));};exports[_0x5371('0x2a')]=function(_0x2af682,_0x1238b1){if(_0x2af682[_0x5371('0x4c')]['id']){delete _0x2af682[_0x5371('0x4c')]['id'];}return db[_0x5371('0x2d')]['find']({'where':{'id':_0x2af682[_0x5371('0x48')]['id']}})[_0x5371('0x16')](handleEntityNotFound(_0x1238b1,null))['then'](saveUpdates(_0x2af682['body'],null))[_0x5371('0x16')](respondWithResult(_0x1238b1,null))[_0x5371('0x47')](handleError(_0x1238b1,null));};exports[_0x5371('0x4d')]=function(_0x907b57,_0x11ca52){return db[_0x5371('0x2d')][_0x5371('0x4a')]({'where':{'id':_0x907b57[_0x5371('0x48')]['id']}})[_0x5371('0x16')](handleEntityNotFound(_0x11ca52,null))[_0x5371('0x16')](removeEntity(_0x11ca52,null))['catch'](handleError(_0x11ca52,null));};exports['getFields']=function(_0x128cec,_0x212ce6,_0xf4aa3){var _0x1db585={};var _0x391864={};var _0x2acedf;var _0x265ab7;return db[_0x5371('0x2d')][_0x5371('0x4e')]({'where':{'id':_0x128cec[_0x5371('0x48')]['id']}})[_0x5371('0x16')](handleEntityNotFound(_0x212ce6,null))[_0x5371('0x16')](function(_0x1857ef){if(_0x1857ef){_0x2acedf=_0x1857ef;_0x391864[_0x5371('0x2f')]=_[_0x5371('0x31')](db['SugarcrmField'][_0x5371('0x2e')]);_0x391864[_0x5371('0x30')]=_[_0x5371('0x31')](_0x128cec[_0x5371('0x30')]);_0x391864['filters']=_['intersection'](_0x391864[_0x5371('0x2f')],_0x391864[_0x5371('0x30')]);_0x1db585[_0x5371('0x33')]=_[_0x5371('0x32')](_0x391864['model'],qs[_0x5371('0x34')](_0x128cec['query'][_0x5371('0x34')]));_0x1db585[_0x5371('0x33')]=_0x1db585[_0x5371('0x33')]['length']?_0x1db585[_0x5371('0x33')]:_0x391864[_0x5371('0x2f')];_0x1db585[_0x5371('0x38')]=qs['sort'](_0x128cec[_0x5371('0x30')][_0x5371('0x39')]);_0x1db585[_0x5371('0x3a')]=qs[_0x5371('0x3c')](_[_0x5371('0x3b')](_0x128cec[_0x5371('0x30')],_0x391864[_0x5371('0x3c')]));if(_0x128cec[_0x5371('0x30')][_0x5371('0x42')]){_0x1db585[_0x5371('0x3a')]=_[_0x5371('0x3d')](_0x1db585[_0x5371('0x3a')],{'$or':_[_0x5371('0x3e')](_0x1db585[_0x5371('0x33')],function(_0x35b339){var _0x4398dc={};_0x4398dc[_0x35b339]={'$like':'%'+_0x128cec[_0x5371('0x30')][_0x5371('0x42')]+'%'};return _0x4398dc;})});}_0x1db585=_[_0x5371('0x3d')]({},_0x1db585,_0x128cec[_0x5371('0x43')]);return _0x2acedf[_0x5371('0x4f')](_0x1db585);}})[_0x5371('0x16')](function(_0x81c53c){if(_0x81c53c){_0x265ab7=_0x81c53c[_0x5371('0x35')];if(!_0x128cec[_0x5371('0x30')]['hasOwnProperty'](_0x5371('0x37'))){_0x1db585[_0x5371('0x24')]=qs['limit'](_0x128cec['query'][_0x5371('0x24')]);_0x1db585[_0x5371('0x23')]=qs[_0x5371('0x23')](_0x128cec[_0x5371('0x30')]['offset']);}return _0x2acedf[_0x5371('0x4f')](_0x1db585);}})[_0x5371('0x16')](function(_0x1483e9){if(_0x1483e9){return _0x1483e9?{'count':_0x265ab7,'rows':_0x1483e9}:null;}})[_0x5371('0x16')](respondWithResult(_0x212ce6,null))[_0x5371('0x47')](handleError(_0x212ce6,null));};exports[_0x5371('0x50')]=function(_0x45e519,_0x5ececc,_0xe6f207){var _0x3ff6dd={};var _0x3361c9={};var _0x3688ed;var _0x55696f;return db[_0x5371('0x2d')]['findOne']({'where':{'id':_0x45e519['params']['id']}})[_0x5371('0x16')](handleEntityNotFound(_0x5ececc,null))[_0x5371('0x16')](function(_0x3ad93f){if(_0x3ad93f){_0x3688ed=_0x3ad93f;_0x3361c9[_0x5371('0x2f')]=_['keys'](db[_0x5371('0x51')][_0x5371('0x2e')]);_0x3361c9[_0x5371('0x30')]=_[_0x5371('0x31')](_0x45e519['query']);_0x3361c9['filters']=_[_0x5371('0x32')](_0x3361c9[_0x5371('0x2f')],_0x3361c9[_0x5371('0x30')]);_0x3ff6dd[_0x5371('0x33')]=_[_0x5371('0x32')](_0x3361c9['model'],qs[_0x5371('0x34')](_0x45e519[_0x5371('0x30')][_0x5371('0x34')]));_0x3ff6dd[_0x5371('0x33')]=_0x3ff6dd[_0x5371('0x33')][_0x5371('0x35')]?_0x3ff6dd[_0x5371('0x33')]:_0x3361c9['model'];_0x3ff6dd['order']=qs[_0x5371('0x39')](_0x45e519[_0x5371('0x30')]['sort']);_0x3ff6dd[_0x5371('0x3a')]=qs[_0x5371('0x3c')](_[_0x5371('0x3b')](_0x45e519['query'],_0x3361c9[_0x5371('0x3c')]));if(_0x45e519[_0x5371('0x30')][_0x5371('0x42')]){_0x3ff6dd[_0x5371('0x3a')]=_['merge'](_0x3ff6dd[_0x5371('0x3a')],{'$or':_[_0x5371('0x3e')](_0x3ff6dd['attributes'],function(_0x598f03){var _0x2b5767={};_0x2b5767[_0x598f03]={'$like':'%'+_0x45e519['query'][_0x5371('0x42')]+'%'};return _0x2b5767;})});}_0x3ff6dd=_[_0x5371('0x3d')]({},_0x3ff6dd,_0x45e519[_0x5371('0x43')]);return _0x3688ed[_0x5371('0x50')](_0x3ff6dd);}})[_0x5371('0x16')](function(_0x579b15){if(_0x579b15){_0x55696f=_0x579b15[_0x5371('0x35')];if(!_0x45e519[_0x5371('0x30')][_0x5371('0x36')](_0x5371('0x37'))){_0x3ff6dd[_0x5371('0x24')]=qs[_0x5371('0x24')](_0x45e519[_0x5371('0x30')]['limit']);_0x3ff6dd['offset']=qs[_0x5371('0x23')](_0x45e519[_0x5371('0x30')]['offset']);}return _0x3688ed['getSubjects'](_0x3ff6dd);}})[_0x5371('0x16')](function(_0x3d7b7e){if(_0x3d7b7e){return _0x3d7b7e?{'count':_0x55696f,'rows':_0x3d7b7e}:null;}})[_0x5371('0x16')](respondWithResult(_0x5ececc,null))[_0x5371('0x47')](handleError(_0x5ececc,null));};exports[_0x5371('0x52')]=function(_0x39cefd,_0x355a9c,_0x362ba7){var _0x3880ca={};var _0x10ec69={};var _0xfd0269;var _0x225850;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x39cefd[_0x5371('0x48')]['id']}})[_0x5371('0x16')](handleEntityNotFound(_0x355a9c,null))[_0x5371('0x16')](function(_0x1fc466){if(_0x1fc466){_0xfd0269=_0x1fc466;_0x10ec69['model']=_[_0x5371('0x31')](db[_0x5371('0x51')][_0x5371('0x2e')]);_0x10ec69[_0x5371('0x30')]=_['keys'](_0x39cefd['query']);_0x10ec69[_0x5371('0x3c')]=_['intersection'](_0x10ec69['model'],_0x10ec69['query']);_0x3880ca['attributes']=_[_0x5371('0x32')](_0x10ec69[_0x5371('0x2f')],qs['fields'](_0x39cefd[_0x5371('0x30')][_0x5371('0x34')]));_0x3880ca[_0x5371('0x33')]=_0x3880ca[_0x5371('0x33')][_0x5371('0x35')]?_0x3880ca[_0x5371('0x33')]:_0x10ec69[_0x5371('0x2f')];_0x3880ca['order']=qs['sort'](_0x39cefd['query'][_0x5371('0x39')]);_0x3880ca['where']=qs[_0x5371('0x3c')](_[_0x5371('0x3b')](_0x39cefd[_0x5371('0x30')],_0x10ec69[_0x5371('0x3c')]));if(_0x39cefd[_0x5371('0x30')]['filter']){_0x3880ca[_0x5371('0x3a')]=_[_0x5371('0x3d')](_0x3880ca[_0x5371('0x3a')],{'$or':_[_0x5371('0x3e')](_0x3880ca['attributes'],function(_0x8999c9){var _0x44d8d3={};_0x44d8d3[_0x8999c9]={'$like':'%'+_0x39cefd[_0x5371('0x30')]['filter']+'%'};return _0x44d8d3;})});}_0x3880ca=_[_0x5371('0x3d')]({},_0x3880ca,_0x39cefd[_0x5371('0x43')]);return _0xfd0269[_0x5371('0x52')](_0x3880ca);}})[_0x5371('0x16')](function(_0x2514f6){if(_0x2514f6){_0x225850=_0x2514f6[_0x5371('0x35')];if(!_0x39cefd[_0x5371('0x30')][_0x5371('0x36')]('nolimit')){_0x3880ca['limit']=qs[_0x5371('0x24')](_0x39cefd[_0x5371('0x30')][_0x5371('0x24')]);_0x3880ca[_0x5371('0x23')]=qs[_0x5371('0x23')](_0x39cefd['query'][_0x5371('0x23')]);}return _0xfd0269[_0x5371('0x52')](_0x3880ca);}})[_0x5371('0x16')](function(_0x21357e){if(_0x21357e){return _0x21357e?{'count':_0x225850,'rows':_0x21357e}:null;}})[_0x5371('0x16')](respondWithResult(_0x355a9c,null))[_0x5371('0x47')](handleError(_0x355a9c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 66ce3ee..60484af 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 _0x3406=['int_sugarcrm_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','exports','define','SugarcrmConfiguration'];(function(_0x4b5f64,_0x5993b8){var _0x17b254=function(_0xc7c934){while(--_0xc7c934){_0x4b5f64['push'](_0x4b5f64['shift']());}};_0x17b254(++_0x5993b8);}(_0x3406,0x119));var _0x6340=function(_0x36debe,_0xa2f296){_0x36debe=_0x36debe-0x0;var _0x503055=_0x3406[_0x36debe];return _0x503055;};'use strict';var _=require(_0x6340('0x0'));var util=require('util');var logger=require(_0x6340('0x1'))(_0x6340('0x2'));var moment=require('moment');var BPromise=require(_0x6340('0x3'));var rp=require(_0x6340('0x4'));var fs=require('fs');var path=require(_0x6340('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x6340('0x6')]=function(_0x8adb72,_0x50916d){return _0x8adb72[_0x6340('0x7')](_0x6340('0x8'),attributes,{'tableName':_0x6340('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a1c=['../../config/logger','api','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x20ae13,_0x2a0c8e){var _0x533fd5=function(_0x3bb746){while(--_0x3bb746){_0x20ae13['push'](_0x20ae13['shift']());}};_0x533fd5(++_0x2a0c8e);}(_0x0a1c,0x130));var _0xc0a1=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x0a1c[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc0a1('0x0'))(_0xc0a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc0a1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a1('0x3'));var config=require('../../config/environment');var attributes=require(_0xc0a1('0x4'));module[_0xc0a1('0x5')]=function(_0x296212,_0x921a25){return _0x296212[_0xc0a1('0x6')](_0xc0a1('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 86d44b1..b234a7c 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 _0xeeb7=['http','request','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xeeb7,0xab));var _0x7eeb=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xeeb7[_0x148c09];return _0x18e613;};'use strict';var _=require('lodash');var util=require(_0x7eeb('0x0'));var moment=require('moment');var BPromise=require(_0x7eeb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eeb('0x2'));var db=require(_0x7eeb('0x3'))['db'];var utils=require(_0x7eeb('0x4'));var logger=require(_0x7eeb('0x5'))('rpc');var config=require(_0x7eeb('0x6'));var jayson=require(_0x7eeb('0x7'));var client=jayson[_0x7eeb('0x8')][_0x7eeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53ec83,_0x29b311,_0x30aa10){return new BPromise(function(_0x4e803e,_0xf7dbc){return client[_0x7eeb('0xa')](_0x53ec83,_0x30aa10)['then'](function(_0x491c29){logger[_0x7eeb('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x29b311,_0x7eeb('0xc'));logger[_0x7eeb('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x29b311,_0x7eeb('0xc'),JSON[_0x7eeb('0xe')](_0x491c29));if(_0x491c29[_0x7eeb('0xf')]){if(_0x491c29[_0x7eeb('0xf')][_0x7eeb('0x10')]===0x1f4){logger[_0x7eeb('0xf')](_0x7eeb('0x11'),_0x29b311,_0x491c29['error']['message']);return _0xf7dbc(_0x491c29['error']['message']);}logger['error'](_0x7eeb('0x11'),_0x29b311,_0x491c29['error'][_0x7eeb('0x12')]);return _0x4e803e(_0x491c29[_0x7eeb('0xf')][_0x7eeb('0x12')]);}else{logger[_0x7eeb('0xb')](_0x7eeb('0x11'),_0x29b311,'request\x20sent');_0x4e803e(_0x491c29[_0x7eeb('0x13')][_0x7eeb('0x12')]);}})['catch'](function(_0x5732c4){logger[_0x7eeb('0xf')](_0x7eeb('0x11'),_0x29b311,_0x5732c4);_0xf7dbc(_0x5732c4);});});} \ No newline at end of file +var _0x2f72=['message','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','result'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x2f72,0x94));var _0x22f7=function(_0x4903bd,_0x3b01f8){_0x4903bd=_0x4903bd-0x0;var _0x4eceba=_0x2f72[_0x4903bd];return _0x4eceba;};'use strict';var _=require(_0x22f7('0x0'));var util=require(_0x22f7('0x1'));var moment=require(_0x22f7('0x2'));var BPromise=require(_0x22f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x22f7('0x5'))(_0x22f7('0x6'));var config=require(_0x22f7('0x7'));var jayson=require(_0x22f7('0x8'));var client=jayson[_0x22f7('0x9')][_0x22f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70a153,_0x382b6d,_0x6c4674){return new BPromise(function(_0xfa0af6,_0x5e5b7f){return client[_0x22f7('0xb')](_0x70a153,_0x6c4674)[_0x22f7('0xc')](function(_0xbd7d25){logger[_0x22f7('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x382b6d,'request\x20sent');logger['debug'](_0x22f7('0xe'),_0x382b6d,_0x22f7('0xf'),JSON[_0x22f7('0x10')](_0xbd7d25));if(_0xbd7d25['error']){if(_0xbd7d25[_0x22f7('0x11')]['code']===0x1f4){logger[_0x22f7('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x382b6d,_0xbd7d25[_0x22f7('0x11')]['message']);return _0x5e5b7f(_0xbd7d25[_0x22f7('0x11')]['message']);}logger[_0x22f7('0x11')](_0x22f7('0x12'),_0x382b6d,_0xbd7d25[_0x22f7('0x11')]['message']);return _0xfa0af6(_0xbd7d25['error']['message']);}else{logger[_0x22f7('0xd')](_0x22f7('0x12'),_0x382b6d,_0x22f7('0xf'));_0xfa0af6(_0xbd7d25[_0x22f7('0x13')][_0x22f7('0x14')]);}})['catch'](function(_0x210197){logger[_0x22f7('0x11')](_0x22f7('0x12'),_0x382b6d,_0x210197);_0x5e5b7f(_0x210197);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a6c84a0..329d298 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 _0x23ce=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id','post','create','update','destroy'];(function(_0x18b7db,_0x568c13){var _0x4fef76=function(_0x5126c0){while(--_0x5126c0){_0x18b7db['push'](_0x18b7db['shift']());}};_0x4fef76(++_0x568c13);}(_0x23ce,0x161));var _0xe23c=function(_0x244770,_0x573542){_0x244770=_0x244770-0x0;var _0x40fba5=_0x23ce[_0x244770];return _0x40fba5;};'use strict';var multer=require('multer');var util=require(_0xe23c('0x0'));var path=require(_0xe23c('0x1'));var timeout=require(_0xe23c('0x2'));var express=require('express');var router=express[_0xe23c('0x3')]();var auth=require(_0xe23c('0x4'));var interaction=require(_0xe23c('0x5'));var config=require(_0xe23c('0x6'));var controller=require(_0xe23c('0x7'));router['get']('/',auth[_0xe23c('0x8')](),controller['index']);router[_0xe23c('0x9')](_0xe23c('0xa'),auth[_0xe23c('0x8')](),controller['show']);router[_0xe23c('0xb')]('/',auth[_0xe23c('0x8')](),controller[_0xe23c('0xc')]);router['put'](_0xe23c('0xa'),auth[_0xe23c('0x8')](),controller[_0xe23c('0xd')]);router['delete']('/:id',auth[_0xe23c('0x8')](),controller[_0xe23c('0xe')]);module[_0xe23c('0xf')]=router; \ No newline at end of file +var _0xd250=['index','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd250,0x75));var _0x0d25=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xd250[_0x211087];return _0x2a581f;};'use strict';var multer=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var path=require('path');var timeout=require(_0x0d25('0x2'));var express=require(_0x0d25('0x3'));var router=express[_0x0d25('0x4')]();var auth=require(_0x0d25('0x5'));var interaction=require(_0x0d25('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x0d25('0x7')]('/',auth[_0x0d25('0x8')](),controller[_0x0d25('0x9')]);router[_0x0d25('0x7')](_0x0d25('0xa'),auth[_0x0d25('0x8')](),controller['show']);router['post']('/',auth[_0x0d25('0x8')](),controller['create']);router['put'](_0x0d25('0xa'),auth[_0x0d25('0x8')](),controller[_0x0d25('0xb')]);router['delete'](_0x0d25('0xa'),auth['isAuthenticated'](),controller[_0x0d25('0xc')]);module[_0x0d25('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 6584d87..da4e572 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 _0x4ea3=['sequelize','exports','ENUM','string','customVariable','variable','STRING'];(function(_0x449723,_0x16e4aa){var _0x16dd8f=function(_0x581472){while(--_0x581472){_0x449723['push'](_0x449723['shift']());}};_0x16dd8f(++_0x16e4aa);}(_0x4ea3,0x70));var _0x34ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4ea3[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'type':{'type':Sequelize[_0x34ea('0x2')](_0x34ea('0x3'),'variable',_0x34ea('0x4'),'keyValue'),'defaultValue':_0x34ea('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x34ea('0x2')](_0x34ea('0x3'),_0x34ea('0x5'),_0x34ea('0x4'))},'keyContent':{'type':Sequelize[_0x34ea('0x6')]},'idField':{'type':Sequelize[_0x34ea('0x6')]},'nameField':{'type':Sequelize[_0x34ea('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x34ea('0x6')]}}; \ No newline at end of file +var _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x32a5f2,_0x4499f6){var _0x2c42f6=function(_0x4f1368){while(--_0x4f1368){_0x32a5f2['push'](_0x32a5f2['shift']());}};_0x2c42f6(++_0x4499f6);}(_0x6324,0x142));var _0x4632=function(_0x478dbb,_0x48b454){_0x478dbb=_0x478dbb-0x0;var _0x3ff700=_0x6324[_0x478dbb];return _0x3ff700;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ca4e0e3..f630f78 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 _0x7969=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','SugarcrmField','findAll','rows','params','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7969,0x14c));var _0x9796=function(_0x432ef2,_0x309f5e){_0x432ef2=_0x432ef2-0x0;var _0x4efda6=_0x7969[_0x432ef2];return _0x4efda6;};'use strict';var pdf=require(_0x9796('0x0'));var emlformat=require(_0x9796('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9796('0x2'));var jsonpatch=require(_0x9796('0x3'));var rp=require(_0x9796('0x4'));var moment=require(_0x9796('0x5'));var BPromise=require(_0x9796('0x6'));var Mustache=require('mustache');var util=require(_0x9796('0x7'));var path=require(_0x9796('0x8'));var sox=require(_0x9796('0x9'));var csv=require(_0x9796('0xa'));var ejs=require(_0x9796('0xb'));var fs=require('fs');var _=require(_0x9796('0xc'));var squel=require(_0x9796('0xd'));var crypto=require(_0x9796('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9796('0xf'));var Redis=require(_0x9796('0x10'));var authService=require(_0x9796('0x11'));var qs=require(_0x9796('0x12'));var hardwareService=require(_0x9796('0x13'));var logger=require(_0x9796('0x14'))(_0x9796('0x15'));var utils=require(_0x9796('0x16'));var config=require(_0x9796('0x17'));var db=require(_0x9796('0x18'))['db'];function respondWithStatusCode(_0x47b647,_0x121cd0){_0x121cd0=_0x121cd0||0xcc;return function(_0x176aa8){if(_0x176aa8){return _0x47b647['sendStatus'](_0x121cd0);}return _0x47b647[_0x9796('0x19')](_0x121cd0)[_0x9796('0x1a')]();};}function respondWithResult(_0x4fc5a8,_0x238c80){_0x238c80=_0x238c80||0xc8;return function(_0x9ec7b){if(_0x9ec7b){return _0x4fc5a8[_0x9796('0x19')](_0x238c80)['json'](_0x9ec7b);}};}function respondWithFilteredResult(_0x1bc1cf,_0x5c1b55){return function(_0x71af2c){if(_0x71af2c){var _0x31a576=_0x71af2c['count'],_0x1d52b8=_0x5c1b55['offset'],_0x2c3d24=_0x5c1b55[_0x9796('0x1b')]+_0x5c1b55['limit'],_0x533bff;if(_0x2c3d24>=_0x31a576){_0x2c3d24=_0x31a576;_0x533bff=0xc8;}else{_0x533bff=0xce;}_0x1bc1cf[_0x9796('0x19')](_0x533bff);return _0x1bc1cf[_0x9796('0x1c')](_0x9796('0x1d'),_0x1d52b8+'-'+_0x2c3d24+'/'+_0x31a576)['json'](_0x71af2c);}return null;};}function patchUpdates(_0x10f9a9){return function(_0x14e4c0){try{jsonpatch['apply'](_0x14e4c0,_0x10f9a9,!![]);}catch(_0x53f4ce){return BPromise[_0x9796('0x1e')](_0x53f4ce);}return _0x14e4c0[_0x9796('0x1f')]();};}function saveUpdates(_0x256fcb,_0x972d46){return function(_0x593ca0){if(_0x593ca0){return _0x593ca0[_0x9796('0x20')](_0x256fcb)[_0x9796('0x21')](function(_0x186df6){return _0x186df6;});}return null;};}function removeEntity(_0x451d04,_0x435d52){return function(_0x1ec4b8){if(_0x1ec4b8){return _0x1ec4b8[_0x9796('0x22')]()['then'](function(){_0x451d04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ce48,_0x1a460f){return function(_0x3fa637){if(!_0x3fa637){_0x35ce48['sendStatus'](0x194);}return _0x3fa637;};}function handleError(_0x19b760,_0x260e88){_0x260e88=_0x260e88||0x1f4;return function(_0x24521f){logger['error'](_0x24521f[_0x9796('0x23')]);if(_0x24521f[_0x9796('0x24')]){delete _0x24521f[_0x9796('0x24')];}_0x19b760[_0x9796('0x19')](_0x260e88)['send'](_0x24521f);};}exports[_0x9796('0x25')]=function(_0x4d09ea,_0x146960){var _0x159ec4={},_0x207420={},_0x56f167={'count':0x0,'rows':[]};var _0x274b9a=db['SugarcrmField'][_0x9796('0x26')];_0x207420[_0x9796('0x27')]=_['keys'](_0x274b9a);_0x207420[_0x9796('0x28')]=_[_0x9796('0x29')](_0x4d09ea[_0x9796('0x28')]);_0x207420[_0x9796('0x2a')]=_[_0x9796('0x2b')](_0x207420[_0x9796('0x27')],_0x207420['query']);_0x159ec4[_0x9796('0x2c')]=_[_0x9796('0x2b')](_0x207420[_0x9796('0x27')],qs[_0x9796('0x2d')](_0x4d09ea[_0x9796('0x28')][_0x9796('0x2d')]));_0x159ec4[_0x9796('0x2c')]=_0x159ec4[_0x9796('0x2c')][_0x9796('0x2e')]?_0x159ec4[_0x9796('0x2c')]:_0x207420[_0x9796('0x27')];if(!_0x4d09ea[_0x9796('0x28')][_0x9796('0x2f')](_0x9796('0x30'))){_0x159ec4[_0x9796('0x31')]=qs['limit'](_0x4d09ea[_0x9796('0x28')][_0x9796('0x31')]);_0x159ec4[_0x9796('0x1b')]=qs[_0x9796('0x1b')](_0x4d09ea[_0x9796('0x28')]['offset']);}_0x159ec4['order']=qs[_0x9796('0x32')](_0x4d09ea[_0x9796('0x28')]['sort']);_0x159ec4[_0x9796('0x33')]=qs['filters'](_['pick'](_0x4d09ea[_0x9796('0x28')],_0x207420[_0x9796('0x2a')]));if(_0x4d09ea[_0x9796('0x28')][_0x9796('0x34')]){_0x159ec4[_0x9796('0x33')]=_[_0x9796('0x35')](_0x159ec4['where'],{'$or':_[_0x9796('0x36')](_0x274b9a,function(_0x362b07){if(_0x362b07['type'][_0x9796('0x37')]!==_0x9796('0x38')){var _0x4490a2={};_0x4490a2[_0x362b07[_0x9796('0x39')]]={'$like':'%'+_0x4d09ea[_0x9796('0x28')][_0x9796('0x34')]+'%'};return _0x4490a2;}})});}_0x159ec4=_[_0x9796('0x35')]({},_0x159ec4,_0x4d09ea[_0x9796('0x3a')]);var _0x4c8fe5={'where':_0x159ec4[_0x9796('0x33')]};return db['SugarcrmField']['count'](_0x4c8fe5)['then'](function(_0x2bbb27){_0x56f167[_0x9796('0x3b')]=_0x2bbb27;if(_0x4d09ea[_0x9796('0x28')][_0x9796('0x3c')]){_0x159ec4[_0x9796('0x3d')]=[{'all':!![]}];}return db[_0x9796('0x3e')][_0x9796('0x3f')](_0x159ec4);})[_0x9796('0x21')](function(_0x1f041a){_0x56f167[_0x9796('0x40')]=_0x1f041a;return _0x56f167;})['then'](respondWithFilteredResult(_0x146960,_0x159ec4))['catch'](handleError(_0x146960,null));};exports['show']=function(_0x326911,_0x14ebb7){var _0x59f4cf={'raw':!![],'where':{'id':_0x326911[_0x9796('0x41')]['id']}},_0x3f464a={};_0x3f464a[_0x9796('0x27')]=_[_0x9796('0x29')](db[_0x9796('0x3e')][_0x9796('0x26')]);_0x3f464a[_0x9796('0x28')]=_[_0x9796('0x29')](_0x326911[_0x9796('0x28')]);_0x3f464a[_0x9796('0x2a')]=_[_0x9796('0x2b')](_0x3f464a[_0x9796('0x27')],_0x3f464a[_0x9796('0x28')]);_0x59f4cf['attributes']=_[_0x9796('0x2b')](_0x3f464a[_0x9796('0x27')],qs[_0x9796('0x2d')](_0x326911['query'][_0x9796('0x2d')]));_0x59f4cf[_0x9796('0x2c')]=_0x59f4cf[_0x9796('0x2c')][_0x9796('0x2e')]?_0x59f4cf[_0x9796('0x2c')]:_0x3f464a[_0x9796('0x27')];if(_0x326911[_0x9796('0x28')][_0x9796('0x3c')]){_0x59f4cf[_0x9796('0x3d')]=[{'all':!![]}];}_0x59f4cf=_[_0x9796('0x35')]({},_0x59f4cf,_0x326911[_0x9796('0x3a')]);return db[_0x9796('0x3e')][_0x9796('0x42')](_0x59f4cf)['then'](handleEntityNotFound(_0x14ebb7,null))['then'](respondWithResult(_0x14ebb7,null))[_0x9796('0x43')](handleError(_0x14ebb7,null));};exports[_0x9796('0x44')]=function(_0x694a39,_0xcb3b46){return db[_0x9796('0x3e')]['create'](_0x694a39['body'],{})[_0x9796('0x21')](respondWithResult(_0xcb3b46,0xc9))[_0x9796('0x43')](handleError(_0xcb3b46,null));};exports[_0x9796('0x20')]=function(_0x3bdecd,_0x3f8a9d){if(_0x3bdecd['body']['id']){delete _0x3bdecd[_0x9796('0x45')]['id'];}return db[_0x9796('0x3e')][_0x9796('0x42')]({'where':{'id':_0x3bdecd[_0x9796('0x41')]['id']}})[_0x9796('0x21')](handleEntityNotFound(_0x3f8a9d,null))['then'](saveUpdates(_0x3bdecd['body'],null))[_0x9796('0x21')](respondWithResult(_0x3f8a9d,null))[_0x9796('0x43')](handleError(_0x3f8a9d,null));};exports['destroy']=function(_0x27c855,_0x29fc92){return db[_0x9796('0x3e')]['find']({'where':{'id':_0x27c855[_0x9796('0x41')]['id']}})[_0x9796('0x21')](handleEntityNotFound(_0x29fc92,null))[_0x9796('0x21')](removeEntity(_0x29fc92,null))[_0x9796('0x43')](handleError(_0x29fc92,null));}; \ No newline at end of file +var _0xf321=['../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','SugarcrmField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1a0ad8,_0x3a1dc3){var _0x5c64ac=function(_0x5d4b0b){while(--_0x5d4b0b){_0x1a0ad8['push'](_0x1a0ad8['shift']());}};_0x5c64ac(++_0x3a1dc3);}(_0xf321,0x14b));var _0x1f32=function(_0x53de9d,_0x4f6e91){_0x53de9d=_0x53de9d-0x0;var _0x2e0560=_0xf321[_0x53de9d];return _0x2e0560;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1f32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f32('0x1'));var jsonpatch=require(_0x1f32('0x2'));var rp=require(_0x1f32('0x3'));var moment=require(_0x1f32('0x4'));var BPromise=require(_0x1f32('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f32('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f32('0x7'));var jsforce=require(_0x1f32('0x8'));var deskjs=require(_0x1f32('0x9'));var toCsv=require(_0x1f32('0xa'));var querystring=require(_0x1f32('0xb'));var Papa=require(_0x1f32('0xc'));var Redis=require(_0x1f32('0xd'));var authService=require(_0x1f32('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1f32('0xf'));var logger=require(_0x1f32('0x10'))(_0x1f32('0x11'));var utils=require(_0x1f32('0x12'));var config=require(_0x1f32('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bfc97,_0x40ffa9){_0x40ffa9=_0x40ffa9||0xcc;return function(_0x315eb5){if(_0x315eb5){return _0x4bfc97['sendStatus'](_0x40ffa9);}return _0x4bfc97[_0x1f32('0x14')](_0x40ffa9)[_0x1f32('0x15')]();};}function respondWithResult(_0x3f4e76,_0x94a87d){_0x94a87d=_0x94a87d||0xc8;return function(_0x56c2db){if(_0x56c2db){return _0x3f4e76[_0x1f32('0x14')](_0x94a87d)[_0x1f32('0x16')](_0x56c2db);}};}function respondWithFilteredResult(_0x3d4e23,_0x517db4){return function(_0x2a478c){if(_0x2a478c){var _0xa07352=_0x2a478c[_0x1f32('0x17')],_0x398db4=_0x517db4[_0x1f32('0x18')],_0x3bb59a=_0x517db4[_0x1f32('0x18')]+_0x517db4[_0x1f32('0x19')],_0x27ef2e;if(_0x3bb59a>=_0xa07352){_0x3bb59a=_0xa07352;_0x27ef2e=0xc8;}else{_0x27ef2e=0xce;}_0x3d4e23[_0x1f32('0x14')](_0x27ef2e);return _0x3d4e23[_0x1f32('0x1a')](_0x1f32('0x1b'),_0x398db4+'-'+_0x3bb59a+'/'+_0xa07352)[_0x1f32('0x16')](_0x2a478c);}return null;};}function patchUpdates(_0x5ecbfb){return function(_0x2e7aef){try{jsonpatch[_0x1f32('0x1c')](_0x2e7aef,_0x5ecbfb,!![]);}catch(_0x5a81bb){return BPromise[_0x1f32('0x1d')](_0x5a81bb);}return _0x2e7aef[_0x1f32('0x1e')]();};}function saveUpdates(_0x16e003,_0x541510){return function(_0x1004f2){if(_0x1004f2){return _0x1004f2[_0x1f32('0x1f')](_0x16e003)['then'](function(_0x1834bc){return _0x1834bc;});}return null;};}function removeEntity(_0xf56ec8,_0x261a23){return function(_0x33c4bc){if(_0x33c4bc){return _0x33c4bc[_0x1f32('0x20')]()[_0x1f32('0x21')](function(){_0xf56ec8[_0x1f32('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216177,_0x2ce923){return function(_0x17507e){if(!_0x17507e){_0x216177[_0x1f32('0x22')](0x194);}return _0x17507e;};}function handleError(_0x21104f,_0x3d66a8){_0x3d66a8=_0x3d66a8||0x1f4;return function(_0x230b7a){logger['error'](_0x230b7a[_0x1f32('0x23')]);if(_0x230b7a['name']){delete _0x230b7a[_0x1f32('0x24')];}_0x21104f[_0x1f32('0x14')](_0x3d66a8)['send'](_0x230b7a);};}exports[_0x1f32('0x25')]=function(_0xae3445,_0x3ee67b){var _0x423280={},_0x5035b9={},_0x5f5947={'count':0x0,'rows':[]};var _0x51bd55=db[_0x1f32('0x26')][_0x1f32('0x27')];_0x5035b9[_0x1f32('0x28')]=_[_0x1f32('0x29')](_0x51bd55);_0x5035b9['query']=_[_0x1f32('0x29')](_0xae3445[_0x1f32('0x2a')]);_0x5035b9[_0x1f32('0x2b')]=_['intersection'](_0x5035b9[_0x1f32('0x28')],_0x5035b9[_0x1f32('0x2a')]);_0x423280[_0x1f32('0x2c')]=_[_0x1f32('0x2d')](_0x5035b9[_0x1f32('0x28')],qs['fields'](_0xae3445[_0x1f32('0x2a')][_0x1f32('0x2e')]));_0x423280[_0x1f32('0x2c')]=_0x423280[_0x1f32('0x2c')][_0x1f32('0x2f')]?_0x423280[_0x1f32('0x2c')]:_0x5035b9['model'];if(!_0xae3445[_0x1f32('0x2a')][_0x1f32('0x30')]('nolimit')){_0x423280[_0x1f32('0x19')]=qs[_0x1f32('0x19')](_0xae3445['query'][_0x1f32('0x19')]);_0x423280['offset']=qs['offset'](_0xae3445['query'][_0x1f32('0x18')]);}_0x423280[_0x1f32('0x31')]=qs[_0x1f32('0x32')](_0xae3445[_0x1f32('0x2a')]['sort']);_0x423280['where']=qs[_0x1f32('0x2b')](_[_0x1f32('0x33')](_0xae3445[_0x1f32('0x2a')],_0x5035b9[_0x1f32('0x2b')]));if(_0xae3445['query'][_0x1f32('0x34')]){_0x423280[_0x1f32('0x35')]=_[_0x1f32('0x36')](_0x423280[_0x1f32('0x35')],{'$or':_[_0x1f32('0x37')](_0x51bd55,function(_0xb66e2e){if(_0xb66e2e[_0x1f32('0x38')][_0x1f32('0x39')]!==_0x1f32('0x3a')){var _0x7576e7={};_0x7576e7[_0xb66e2e[_0x1f32('0x3b')]]={'$like':'%'+_0xae3445[_0x1f32('0x2a')]['filter']+'%'};return _0x7576e7;}})});}_0x423280=_[_0x1f32('0x36')]({},_0x423280,_0xae3445[_0x1f32('0x3c')]);var _0x6ccf24={'where':_0x423280['where']};return db[_0x1f32('0x26')][_0x1f32('0x17')](_0x6ccf24)[_0x1f32('0x21')](function(_0x5574db){_0x5f5947[_0x1f32('0x17')]=_0x5574db;if(_0xae3445[_0x1f32('0x2a')][_0x1f32('0x3d')]){_0x423280[_0x1f32('0x3e')]=[{'all':!![]}];}return db[_0x1f32('0x26')]['findAll'](_0x423280);})['then'](function(_0x1806bf){_0x5f5947[_0x1f32('0x3f')]=_0x1806bf;return _0x5f5947;})[_0x1f32('0x21')](respondWithFilteredResult(_0x3ee67b,_0x423280))[_0x1f32('0x40')](handleError(_0x3ee67b,null));};exports[_0x1f32('0x41')]=function(_0x3ff736,_0x59e8b1){var _0x3e2865={'raw':!![],'where':{'id':_0x3ff736['params']['id']}},_0x2806b1={};_0x2806b1[_0x1f32('0x28')]=_[_0x1f32('0x29')](db[_0x1f32('0x26')][_0x1f32('0x27')]);_0x2806b1[_0x1f32('0x2a')]=_[_0x1f32('0x29')](_0x3ff736[_0x1f32('0x2a')]);_0x2806b1[_0x1f32('0x2b')]=_[_0x1f32('0x2d')](_0x2806b1[_0x1f32('0x28')],_0x2806b1[_0x1f32('0x2a')]);_0x3e2865[_0x1f32('0x2c')]=_['intersection'](_0x2806b1['model'],qs['fields'](_0x3ff736[_0x1f32('0x2a')][_0x1f32('0x2e')]));_0x3e2865[_0x1f32('0x2c')]=_0x3e2865[_0x1f32('0x2c')]['length']?_0x3e2865[_0x1f32('0x2c')]:_0x2806b1[_0x1f32('0x28')];if(_0x3ff736[_0x1f32('0x2a')][_0x1f32('0x3d')]){_0x3e2865['include']=[{'all':!![]}];}_0x3e2865=_[_0x1f32('0x36')]({},_0x3e2865,_0x3ff736[_0x1f32('0x3c')]);return db['SugarcrmField'][_0x1f32('0x42')](_0x3e2865)['then'](handleEntityNotFound(_0x59e8b1,null))['then'](respondWithResult(_0x59e8b1,null))['catch'](handleError(_0x59e8b1,null));};exports[_0x1f32('0x43')]=function(_0xb5f621,_0x2eaf26){return db[_0x1f32('0x26')][_0x1f32('0x43')](_0xb5f621['body'],{})[_0x1f32('0x21')](respondWithResult(_0x2eaf26,0xc9))[_0x1f32('0x40')](handleError(_0x2eaf26,null));};exports[_0x1f32('0x1f')]=function(_0x4a773a,_0x59c3e7){if(_0x4a773a[_0x1f32('0x44')]['id']){delete _0x4a773a[_0x1f32('0x44')]['id'];}return db['SugarcrmField'][_0x1f32('0x42')]({'where':{'id':_0x4a773a[_0x1f32('0x45')]['id']}})[_0x1f32('0x21')](handleEntityNotFound(_0x59c3e7,null))[_0x1f32('0x21')](saveUpdates(_0x4a773a[_0x1f32('0x44')],null))[_0x1f32('0x21')](respondWithResult(_0x59c3e7,null))[_0x1f32('0x40')](handleError(_0x59c3e7,null));};exports[_0x1f32('0x20')]=function(_0x4742cb,_0x41a40e){return db[_0x1f32('0x26')][_0x1f32('0x42')]({'where':{'id':_0x4742cb['params']['id']}})['then'](handleEntityNotFound(_0x41a40e,null))[_0x1f32('0x21')](removeEntity(_0x41a40e,null))[_0x1f32('0x40')](handleError(_0x41a40e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index eb315f4..35b2647 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 _0x89ff=['bluebird','request-promise','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1c4525,_0x1097e6){var _0x21592f=function(_0x2a1811){while(--_0x2a1811){_0x1c4525['push'](_0x1c4525['shift']());}};_0x21592f(++_0x1097e6);}(_0x89ff,0x19b));var _0xf89f=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x89ff[_0x27638d];return _0x35da35;};'use strict';var _=require(_0xf89f('0x0'));var util=require(_0xf89f('0x1'));var logger=require(_0xf89f('0x2'))(_0xf89f('0x3'));var moment=require(_0xf89f('0x4'));var BPromise=require(_0xf89f('0x5'));var rp=require(_0xf89f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf89f('0x7'));var config=require(_0xf89f('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0xf89f('0x9')]=function(_0x4db0b4,_0x2e6984){return _0x4db0b4[_0xf89f('0xa')](_0xf89f('0xb'),attributes,{'tableName':_0xf89f('0xc'),'paranoid':![],'indexes':[{'name':_0xf89f('0xd'),'fields':[_0xf89f('0xe'),_0xf89f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb710=['path','rimraf','../../config/environment','exports','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0xb710,0x67));var _0x0b71=function(_0x5246f5,_0x493816){_0x5246f5=_0x5246f5-0x0;var _0x2e64c0=_0xb710[_0x5246f5];return _0x2e64c0;};'use strict';var _=require('lodash');var util=require(_0x0b71('0x0'));var logger=require(_0x0b71('0x1'))(_0x0b71('0x2'));var moment=require('moment');var BPromise=require(_0x0b71('0x3'));var rp=require(_0x0b71('0x4'));var fs=require('fs');var path=require(_0x0b71('0x5'));var rimraf=require(_0x0b71('0x6'));var config=require(_0x0b71('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x0b71('0x8')]=function(_0xcd0cde,_0x2f8060){return _0xcd0cde['define']('SugarcrmField',attributes,{'tableName':_0x0b71('0x9'),'paranoid':![],'indexes':[{'name':_0x0b71('0xa'),'fields':[_0x0b71('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a41b941..c3586b9 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 _0x07fd=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x260478,_0x2040a1){var _0x4048fb=function(_0x49b513){while(--_0x49b513){_0x260478['push'](_0x260478['shift']());}};_0x4048fb(++_0x2040a1);}(_0x07fd,0x13d));var _0xd07f=function(_0x155c12,_0x928a07){_0x155c12=_0x155c12-0x0;var _0x3d26f4=_0x07fd[_0x155c12];return _0x3d26f4;};'use strict';var _=require(_0xd07f('0x0'));var util=require(_0xd07f('0x1'));var moment=require('moment');var BPromise=require(_0xd07f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd07f('0x3'));var logger=require(_0xd07f('0x4'))('rpc');var config=require(_0xd07f('0x5'));var jayson=require(_0xd07f('0x6'));var client=jayson['client'][_0xd07f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b8cd1,_0x4f75d5,_0x47a086){return new BPromise(function(_0x19a8b9,_0x1d00c0){return client[_0xd07f('0x8')](_0x2b8cd1,_0x47a086)[_0xd07f('0x9')](function(_0x39bfa0){logger[_0xd07f('0xa')](_0xd07f('0xb'),_0x4f75d5,'request\x20sent');logger[_0xd07f('0xc')](_0xd07f('0xd'),_0x4f75d5,_0xd07f('0xe'),JSON[_0xd07f('0xf')](_0x39bfa0));if(_0x39bfa0['error']){if(_0x39bfa0[_0xd07f('0x10')][_0xd07f('0x11')]===0x1f4){logger[_0xd07f('0x10')](_0xd07f('0xb'),_0x4f75d5,_0x39bfa0['error'][_0xd07f('0x12')]);return _0x1d00c0(_0x39bfa0[_0xd07f('0x10')][_0xd07f('0x12')]);}logger['error'](_0xd07f('0xb'),_0x4f75d5,_0x39bfa0['error']['message']);return _0x19a8b9(_0x39bfa0[_0xd07f('0x10')][_0xd07f('0x12')]);}else{logger[_0xd07f('0xa')](_0xd07f('0xb'),_0x4f75d5,'request\x20sent');_0x19a8b9(_0x39bfa0['result'][_0xd07f('0x12')]);}})[_0xd07f('0x13')](function(_0x58f23d){logger[_0xd07f('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x4f75d5,_0x58f23d);_0x1d00c0(_0x58f23d);});});} \ No newline at end of file +var _0x0a99=['util','moment','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a99,0xaa));var _0x90a9=function(_0x4d031f,_0x2cf4ab){_0x4d031f=_0x4d031f-0x0;var _0x450383=_0x0a99[_0x4d031f];return _0x450383;};'use strict';var _=require(_0x90a9('0x0'));var util=require(_0x90a9('0x1'));var moment=require(_0x90a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90a9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x90a9('0x4'));var jayson=require(_0x90a9('0x5'));var client=jayson['client'][_0x90a9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x37c5ad,_0x3d9699,_0xdbd87d){return new BPromise(function(_0x4b1618,_0xb33393){return client[_0x90a9('0x7')](_0x37c5ad,_0xdbd87d)[_0x90a9('0x8')](function(_0x308882){logger[_0x90a9('0x9')](_0x90a9('0xa'),_0x3d9699,_0x90a9('0xb'));logger[_0x90a9('0xc')](_0x90a9('0xd'),_0x3d9699,_0x90a9('0xb'),JSON[_0x90a9('0xe')](_0x308882));if(_0x308882['error']){if(_0x308882[_0x90a9('0xf')]['code']===0x1f4){logger[_0x90a9('0xf')](_0x90a9('0xa'),_0x3d9699,_0x308882[_0x90a9('0xf')][_0x90a9('0x10')]);return _0xb33393(_0x308882[_0x90a9('0xf')][_0x90a9('0x10')]);}logger[_0x90a9('0xf')](_0x90a9('0xa'),_0x3d9699,_0x308882['error'][_0x90a9('0x10')]);return _0x4b1618(_0x308882[_0x90a9('0xf')][_0x90a9('0x10')]);}else{logger['info'](_0x90a9('0xa'),_0x3d9699,_0x90a9('0xb'));_0x4b1618(_0x308882[_0x90a9('0x11')][_0x90a9('0x10')]);}})[_0x90a9('0x12')](function(_0xdf9f33){logger[_0x90a9('0xf')](_0x90a9('0xa'),_0x3d9699,_0xdf9f33);_0xb33393(_0xdf9f33);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 034e071..38af610 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 _0xbe70=['post','create','put','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x21370e,_0x1f3ffa){var _0x1c7618=function(_0x3f5452){while(--_0x3f5452){_0x21370e['push'](_0x21370e['shift']());}};_0x1c7618(++_0x1f3ffa);}(_0xbe70,0x71));var _0x0be7=function(_0xdaaae3,_0x3f3379){_0xdaaae3=_0xdaaae3-0x0;var _0x519d8d=_0xbe70[_0xdaaae3];return _0x519d8d;};'use strict';var multer=require(_0x0be7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0be7('0x1'));var express=require(_0x0be7('0x2'));var router=express['Router']();var auth=require(_0x0be7('0x3'));var interaction=require(_0x0be7('0x4'));var config=require('../../config/environment');var controller=require(_0x0be7('0x5'));router[_0x0be7('0x6')]('/',auth[_0x0be7('0x7')](),controller['index']);router[_0x0be7('0x6')](_0x0be7('0x8'),auth[_0x0be7('0x7')](),controller[_0x0be7('0x9')]);router[_0x0be7('0x6')](_0x0be7('0xa'),auth['isAuthenticated'](),controller[_0x0be7('0xb')]);router[_0x0be7('0x6')](_0x0be7('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x0be7('0xd')]('/',auth[_0x0be7('0x7')](),controller[_0x0be7('0xe')]);router[_0x0be7('0xd')](_0x0be7('0xa'),auth[_0x0be7('0x7')](),controller['addConfiguration']);router[_0x0be7('0xf')](_0x0be7('0x8'),auth[_0x0be7('0x7')](),controller['update']);router[_0x0be7('0x10')](_0x0be7('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x0be7('0x11')]=router; \ No newline at end of file +var _0xb5a2=['express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','show','get','/:id/configurations','getConfigurations','getFields','post','addConfiguration','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x76fbb8,_0x418e3b){var _0xe9c44=function(_0x339ea8){while(--_0x339ea8){_0x76fbb8['push'](_0x76fbb8['shift']());}};_0xe9c44(++_0x418e3b);}(_0xb5a2,0x89));var _0x2b5a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb5a2[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x2b5a('0x0'));var path=require(_0x2b5a('0x1'));var timeout=require(_0x2b5a('0x2'));var express=require(_0x2b5a('0x3'));var router=express[_0x2b5a('0x4')]();var auth=require(_0x2b5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2b5a('0x6'));var controller=require(_0x2b5a('0x7'));router['get']('/',auth[_0x2b5a('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2b5a('0x9')]);router[_0x2b5a('0xa')](_0x2b5a('0xb'),auth[_0x2b5a('0x8')](),controller[_0x2b5a('0xc')]);router[_0x2b5a('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2b5a('0xd')]);router[_0x2b5a('0xe')]('/',auth[_0x2b5a('0x8')](),controller['create']);router[_0x2b5a('0xe')]('/:id/configurations',auth[_0x2b5a('0x8')](),controller[_0x2b5a('0xf')]);router['put'](_0x2b5a('0x10'),auth[_0x2b5a('0x8')](),controller[_0x2b5a('0x11')]);router[_0x2b5a('0x12')](_0x2b5a('0x10'),auth[_0x2b5a('0x8')](),controller[_0x2b5a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 911e667..b90149c 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 _0x0d1b=['STRING','HelpDesk','sequelize','exports'];(function(_0xfc219c,_0x561b52){var _0x3f1e88=function(_0x30d2b2){while(--_0x30d2b2){_0xfc219c['push'](_0xfc219c['shift']());}};_0x3f1e88(++_0x561b52);}(_0x0d1b,0x14e));var _0xb0d1=function(_0x52d160,_0x50996c){_0x52d160=_0x52d160-0x0;var _0xe58ba3=_0x0d1b[_0x52d160];return _0xe58ba3;};'use strict';var Sequelize=require(_0xb0d1('0x0'));module[_0xb0d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb0d1('0x2')]},'username':{'type':Sequelize[_0xb0d1('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb0d1('0x2')],'allowNull':![],'defaultValue':_0xb0d1('0x3')},'remoteUri':{'type':Sequelize[_0xb0d1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb0d1('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1c19=['HelpDesk','sequelize','exports','STRING'];(function(_0x1d5c95,_0x2203c6){var _0x546313=function(_0xea8e86){while(--_0xea8e86){_0x1d5c95['push'](_0x1d5c95['shift']());}};_0x546313(++_0x2203c6);}(_0x1c19,0x139));var _0x91c1=function(_0x18e014,_0x593ba7){_0x18e014=_0x18e014-0x0;var _0x858ce3=_0x1c19[_0x18e014];return _0x858ce3;};'use strict';var Sequelize=require(_0x91c1('0x0'));module[_0x91c1('0x1')]={'name':{'type':Sequelize[_0x91c1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x91c1('0x2')]},'username':{'type':Sequelize[_0x91c1('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x91c1('0x2')],'allowNull':![],'defaultValue':_0x91c1('0x3')},'remoteUri':{'type':Sequelize[_0x91c1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x91c1('0x2')]},'accessKey':{'type':Sequelize[_0x91c1('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 efb99c6..e80a29c 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 _0xe388=['VtigerAccount,\x20%s,\x20%s','result','catch','sendStatus','end','count','offset','limit','Content-Range','json','apply','reject','save','destroy','status','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','field','options','VtigerAccount','includeAll','include','rows','show','params','length','find','body','update','findOne','VtigerConfiguration','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','GET','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','map','label','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../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','info','debug','stringify','error','code','message'];(function(_0x2cad18,_0x161bf7){var _0x2e25ab=function(_0x46f0e2){while(--_0x46f0e2){_0x2cad18['push'](_0x2cad18['shift']());}};_0x2e25ab(++_0x161bf7);}(_0xe388,0x1e6));var _0x8e38=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xe388[_0xe66cf2];return _0x2d84e7;};'use strict';var pdf=require(_0x8e38('0x0'));var emlformat=require(_0x8e38('0x1'));var rimraf=require(_0x8e38('0x2'));var zipdir=require(_0x8e38('0x3'));var jsonpatch=require(_0x8e38('0x4'));var rp=require(_0x8e38('0x5'));var moment=require(_0x8e38('0x6'));var BPromise=require(_0x8e38('0x7'));var Mustache=require(_0x8e38('0x8'));var util=require(_0x8e38('0x9'));var path=require(_0x8e38('0xa'));var sox=require(_0x8e38('0xb'));var csv=require(_0x8e38('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e38('0xd'));var squel=require(_0x8e38('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8e38('0xc'));var querystring=require(_0x8e38('0xf'));var Papa=require(_0x8e38('0x10'));var Redis=require(_0x8e38('0x11'));var authService=require(_0x8e38('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8e38('0x13'));var logger=require(_0x8e38('0x14'))(_0x8e38('0x15'));var utils=require(_0x8e38('0x16'));var config=require(_0x8e38('0x17'));var db=require(_0x8e38('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8e38('0x19'));var client=jayson[_0x8e38('0x1a')][_0x8e38('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3ab500,_0x544ca5,_0x120903){if(_0x120903){var _0x1250ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1250ce[_0x8e38('0x1c')](_0x544ca5)){return _0x3ab500;}else{throw new Error(_0x8e38('0x1d'));}}else{return _0x3ab500;}}function respondWithRpcPromise(_0x449f01,_0x139cbd,_0x3f8652,_0x4de10c){return new BPromise(function(_0x1c9b16,_0x162e64){var _0x44a980=_0x4de10c||client;return _0x44a980[_0x8e38('0x1e')](_0x449f01,_0x3f8652)[_0x8e38('0x1f')](function(_0x5a524d){logger[_0x8e38('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x139cbd,'request\x20sent');logger[_0x8e38('0x21')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x139cbd,'request\x20sent',JSON[_0x8e38('0x22')](_0x5a524d));if(_0x5a524d['error']){if(_0x5a524d[_0x8e38('0x23')][_0x8e38('0x24')]===0x1f4){logger[_0x8e38('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x139cbd,_0x5a524d[_0x8e38('0x23')][_0x8e38('0x25')]);return _0x162e64(_0x5a524d['error']['message']);}logger['error'](_0x8e38('0x26'),_0x139cbd,_0x5a524d[_0x8e38('0x23')][_0x8e38('0x25')]);return _0x1c9b16(_0x5a524d['error'][_0x8e38('0x25')]);}else{logger['info'](_0x8e38('0x26'),_0x139cbd,'request\x20sent');_0x1c9b16(_0x5a524d[_0x8e38('0x27')][_0x8e38('0x25')]);}})[_0x8e38('0x28')](function(_0x1aea5c){logger[_0x8e38('0x23')](_0x8e38('0x26'),_0x139cbd,_0x1aea5c);_0x162e64(_0x1aea5c);});});}function respondWithStatusCode(_0xa39cad,_0x34b9dc){_0x34b9dc=_0x34b9dc||0xcc;return function(_0x2c69ca){if(_0x2c69ca){return _0xa39cad[_0x8e38('0x29')](_0x34b9dc);}return _0xa39cad['status'](_0x34b9dc)[_0x8e38('0x2a')]();};}function respondWithResult(_0x36abea,_0x24ca01){_0x24ca01=_0x24ca01||0xc8;return function(_0x175e33){if(_0x175e33){return _0x36abea['status'](_0x24ca01)['json'](_0x175e33);}};}function respondWithFilteredResult(_0x10c7c7,_0x258aa9){return function(_0x3b962a){if(_0x3b962a){var _0x37e5a4=_0x3b962a[_0x8e38('0x2b')],_0x57b8fc=_0x258aa9['offset'],_0x2ba71b=_0x258aa9[_0x8e38('0x2c')]+_0x258aa9[_0x8e38('0x2d')],_0x57ab20;if(_0x2ba71b>=_0x37e5a4){_0x2ba71b=_0x37e5a4;_0x57ab20=0xc8;}else{_0x57ab20=0xce;}_0x10c7c7['status'](_0x57ab20);return _0x10c7c7['set'](_0x8e38('0x2e'),_0x57b8fc+'-'+_0x2ba71b+'/'+_0x37e5a4)[_0x8e38('0x2f')](_0x3b962a);}return null;};}function patchUpdates(_0x26907a){return function(_0x23aa1c){try{jsonpatch[_0x8e38('0x30')](_0x23aa1c,_0x26907a,!![]);}catch(_0x401c03){return BPromise[_0x8e38('0x31')](_0x401c03);}return _0x23aa1c[_0x8e38('0x32')]();};}function saveUpdates(_0x586dd1,_0x30a051){return function(_0x693fc9){if(_0x693fc9){return _0x693fc9['update'](_0x586dd1)[_0x8e38('0x1f')](function(_0x387e83){return _0x387e83;});}return null;};}function removeEntity(_0x5ae4d6,_0x5bf106){return function(_0x209e30){if(_0x209e30){return _0x209e30[_0x8e38('0x33')]()[_0x8e38('0x1f')](function(){_0x5ae4d6[_0x8e38('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2480,_0x574ca4){return function(_0x24e6fe){if(!_0x24e6fe){_0x5d2480[_0x8e38('0x29')](0x194);}return _0x24e6fe;};}function handleError(_0x2d10f2,_0x55d4b7){_0x55d4b7=_0x55d4b7||0x1f4;return function(_0x254435){logger[_0x8e38('0x23')](_0x254435[_0x8e38('0x35')]);if(_0x254435[_0x8e38('0x36')]){delete _0x254435[_0x8e38('0x36')];}_0x2d10f2[_0x8e38('0x34')](_0x55d4b7)[_0x8e38('0x37')](_0x254435);};}exports[_0x8e38('0x38')]=function(_0x3ac9b4,_0xfa1f4c){var _0x1b8265={},_0x2e561a={},_0x22dd16={'count':0x0,'rows':[]};var _0x4166f1=db['VtigerAccount'][_0x8e38('0x39')];_0x2e561a[_0x8e38('0x3a')]=_['keys'](_0x4166f1);_0x2e561a[_0x8e38('0x3b')]=_[_0x8e38('0x3c')](_0x3ac9b4[_0x8e38('0x3b')]);_0x2e561a[_0x8e38('0x3d')]=_[_0x8e38('0x3e')](_0x2e561a[_0x8e38('0x3a')],_0x2e561a['query']);_0x1b8265[_0x8e38('0x3f')]=_[_0x8e38('0x3e')](_0x2e561a[_0x8e38('0x3a')],qs[_0x8e38('0x40')](_0x3ac9b4[_0x8e38('0x3b')][_0x8e38('0x40')]));_0x1b8265[_0x8e38('0x3f')]=_0x1b8265[_0x8e38('0x3f')]['length']?_0x1b8265['attributes']:_0x2e561a[_0x8e38('0x3a')];if(!_0x3ac9b4[_0x8e38('0x3b')][_0x8e38('0x41')](_0x8e38('0x42'))){_0x1b8265[_0x8e38('0x2d')]=qs[_0x8e38('0x2d')](_0x3ac9b4['query'][_0x8e38('0x2d')]);_0x1b8265[_0x8e38('0x2c')]=qs['offset'](_0x3ac9b4[_0x8e38('0x3b')]['offset']);}_0x1b8265[_0x8e38('0x43')]=qs[_0x8e38('0x44')](_0x3ac9b4[_0x8e38('0x3b')][_0x8e38('0x44')]);_0x1b8265[_0x8e38('0x45')]=qs[_0x8e38('0x3d')](_['pick'](_0x3ac9b4[_0x8e38('0x3b')],_0x2e561a[_0x8e38('0x3d')]));if(_0x3ac9b4[_0x8e38('0x3b')][_0x8e38('0x46')]){_0x1b8265['where']=_[_0x8e38('0x47')](_0x1b8265[_0x8e38('0x45')],{'$or':_['map'](_0x4166f1,function(_0x4d752a){if(_0x4d752a[_0x8e38('0x48')]['key']!==_0x8e38('0x49')){var _0x6a281={};_0x6a281[_0x4d752a[_0x8e38('0x4a')]]={'$like':'%'+_0x3ac9b4['query'][_0x8e38('0x46')]+'%'};return _0x6a281;}})});}_0x1b8265=_[_0x8e38('0x47')]({},_0x1b8265,_0x3ac9b4[_0x8e38('0x4b')]);var _0x11a8a7={'where':_0x1b8265['where']};return db[_0x8e38('0x4c')][_0x8e38('0x2b')](_0x11a8a7)[_0x8e38('0x1f')](function(_0x241532){_0x22dd16[_0x8e38('0x2b')]=_0x241532;if(_0x3ac9b4[_0x8e38('0x3b')][_0x8e38('0x4d')]){_0x1b8265[_0x8e38('0x4e')]=[{'all':!![]}];}return db[_0x8e38('0x4c')]['findAll'](_0x1b8265);})[_0x8e38('0x1f')](function(_0x2edb94){_0x22dd16[_0x8e38('0x4f')]=_0x2edb94;return _0x22dd16;})['then'](respondWithFilteredResult(_0xfa1f4c,_0x1b8265))[_0x8e38('0x28')](handleError(_0xfa1f4c,null));};exports[_0x8e38('0x50')]=function(_0x10140a,_0x3f7d55){var _0x32e929={'raw':![],'where':{'id':_0x10140a[_0x8e38('0x51')]['id']}},_0x56f2a2={};_0x56f2a2['model']=_[_0x8e38('0x3c')](db[_0x8e38('0x4c')][_0x8e38('0x39')]);_0x56f2a2[_0x8e38('0x3b')]=_[_0x8e38('0x3c')](_0x10140a[_0x8e38('0x3b')]);_0x56f2a2[_0x8e38('0x3d')]=_[_0x8e38('0x3e')](_0x56f2a2[_0x8e38('0x3a')],_0x56f2a2[_0x8e38('0x3b')]);_0x32e929[_0x8e38('0x3f')]=_[_0x8e38('0x3e')](_0x56f2a2['model'],qs['fields'](_0x10140a[_0x8e38('0x3b')][_0x8e38('0x40')]));_0x32e929[_0x8e38('0x3f')]=_0x32e929[_0x8e38('0x3f')][_0x8e38('0x52')]?_0x32e929[_0x8e38('0x3f')]:_0x56f2a2[_0x8e38('0x3a')];if(_0x10140a['query']['includeAll']){_0x32e929['include']=[{'all':!![]}];}_0x32e929=_[_0x8e38('0x47')]({},_0x32e929,_0x10140a[_0x8e38('0x4b')]);return db[_0x8e38('0x4c')][_0x8e38('0x53')](_0x32e929)['then'](handleEntityNotFound(_0x3f7d55,null))[_0x8e38('0x1f')](respondWithResult(_0x3f7d55,null))['catch'](handleError(_0x3f7d55,null));};exports['create']=function(_0x5f48ac,_0x369a14){return db['VtigerAccount']['create'](_0x5f48ac[_0x8e38('0x54')],{})['then'](respondWithResult(_0x369a14,0xc9))['catch'](handleError(_0x369a14,null));};exports[_0x8e38('0x55')]=function(_0x541cb4,_0x2149d0){if(_0x541cb4[_0x8e38('0x54')]['id']){delete _0x541cb4[_0x8e38('0x54')]['id'];}return db[_0x8e38('0x4c')]['find']({'where':{'id':_0x541cb4[_0x8e38('0x51')]['id']}})[_0x8e38('0x1f')](handleEntityNotFound(_0x2149d0,null))['then'](saveUpdates(_0x541cb4[_0x8e38('0x54')],null))['then'](respondWithResult(_0x2149d0,null))[_0x8e38('0x28')](handleError(_0x2149d0,null));};exports[_0x8e38('0x33')]=function(_0x396478,_0x2c09c6){return db['VtigerAccount'][_0x8e38('0x53')]({'where':{'id':_0x396478[_0x8e38('0x51')]['id']}})[_0x8e38('0x1f')](handleEntityNotFound(_0x2c09c6,null))['then'](removeEntity(_0x2c09c6,null))[_0x8e38('0x28')](handleError(_0x2c09c6,null));};exports['getConfigurations']=function(_0x5ea2e9,_0x5a15f3,_0xb065c9){var _0x5d408c={};var _0x3576d3={};var _0x1930d2;var _0x198ee1;return db[_0x8e38('0x4c')][_0x8e38('0x56')]({'where':{'id':_0x5ea2e9[_0x8e38('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a15f3,null))[_0x8e38('0x1f')](function(_0x346c5f){if(_0x346c5f){_0x1930d2=_0x346c5f;_0x3576d3['model']=_['keys'](db[_0x8e38('0x57')][_0x8e38('0x39')]);_0x3576d3[_0x8e38('0x3b')]=_['keys'](_0x5ea2e9['query']);_0x3576d3[_0x8e38('0x3d')]=_[_0x8e38('0x3e')](_0x3576d3[_0x8e38('0x3a')],_0x3576d3[_0x8e38('0x3b')]);_0x5d408c['attributes']=_[_0x8e38('0x3e')](_0x3576d3[_0x8e38('0x3a')],qs[_0x8e38('0x40')](_0x5ea2e9['query'][_0x8e38('0x40')]));_0x5d408c[_0x8e38('0x3f')]=_0x5d408c[_0x8e38('0x3f')]['length']?_0x5d408c[_0x8e38('0x3f')]:_0x3576d3[_0x8e38('0x3a')];_0x5d408c['order']=qs[_0x8e38('0x44')](_0x5ea2e9[_0x8e38('0x3b')][_0x8e38('0x44')]);_0x5d408c[_0x8e38('0x45')]=qs[_0x8e38('0x3d')](_[_0x8e38('0x58')](_0x5ea2e9[_0x8e38('0x3b')],_0x3576d3[_0x8e38('0x3d')]));if(_0x5ea2e9[_0x8e38('0x3b')][_0x8e38('0x46')]){_0x5d408c['where']=_[_0x8e38('0x47')](_0x5d408c[_0x8e38('0x45')],{'$or':_['map'](_0x5d408c['attributes'],function(_0xd216cc){var _0x2a6e0d={};_0x2a6e0d[_0xd216cc]={'$like':'%'+_0x5ea2e9[_0x8e38('0x3b')][_0x8e38('0x46')]+'%'};return _0x2a6e0d;})});}_0x5d408c=_[_0x8e38('0x47')]({},_0x5d408c,_0x5ea2e9['options']);return _0x1930d2[_0x8e38('0x59')](_0x5d408c);}})[_0x8e38('0x1f')](function(_0x126fb9){if(_0x126fb9){_0x198ee1=_0x126fb9[_0x8e38('0x52')];if(!_0x5ea2e9['query'][_0x8e38('0x41')](_0x8e38('0x42'))){_0x5d408c['limit']=qs[_0x8e38('0x2d')](_0x5ea2e9[_0x8e38('0x3b')][_0x8e38('0x2d')]);_0x5d408c[_0x8e38('0x2c')]=qs['offset'](_0x5ea2e9[_0x8e38('0x3b')][_0x8e38('0x2c')]);}return _0x1930d2[_0x8e38('0x59')](_0x5d408c);}})[_0x8e38('0x1f')](function(_0x2387ab){if(_0x2387ab){return _0x2387ab?{'count':_0x198ee1,'rows':_0x2387ab}:null;}})['then'](respondWithResult(_0x5a15f3,null))[_0x8e38('0x28')](handleError(_0x5a15f3,null));};exports['addConfiguration']=function(_0x37b271,_0x14d484,_0x2321e1){if(_0x37b271['body']['id']){delete _0x37b271[_0x8e38('0x54')]['id'];}return db['VtigerAccount'][_0x8e38('0x56')]({'where':{'id':_0x37b271[_0x8e38('0x51')]['id']}})['then'](handleEntityNotFound(_0x14d484,null))[_0x8e38('0x1f')](function(_0x275198){if(_0x275198){_0x37b271['body'][_0x8e38('0x5a')]=_0x275198['id'];_0x37b271[_0x8e38('0x54')][_0x8e38('0x5b')]=integrations[_0x8e38('0x5c')](_0x37b271[_0x8e38('0x54')][_0x8e38('0x5d')],_0x37b271[_0x8e38('0x54')][_0x8e38('0x48')]);_0x37b271[_0x8e38('0x54')][_0x8e38('0x5e')]=integrations[_0x8e38('0x5f')](_0x37b271[_0x8e38('0x54')][_0x8e38('0x5d')],_0x37b271['body'][_0x8e38('0x48')]);return db[_0x8e38('0x57')][_0x8e38('0x60')](_0x37b271[_0x8e38('0x54')],{'include':[{'model':db['VtigerField'],'as':_0x8e38('0x5b')},{'model':db[_0x8e38('0x61')],'as':_0x8e38('0x5e')}]});}return null;})[_0x8e38('0x1f')](respondWithResult(_0x14d484,null))[_0x8e38('0x28')](handleError(_0x14d484,null));};var md5=require('md5');exports[_0x8e38('0x62')]=function(_0x1ea372,_0x48fd92,_0x1c952a){var _0x417549=null;var _0x5d77c2=null;var _0x208b3b=null;var _0x4050bc=null;var _0x1bcabf='';return db[_0x8e38('0x4c')]['findOne']({'where':{'id':_0x1ea372[_0x8e38('0x51')]['id']},'attributes':['id','name',_0x8e38('0x63'),_0x8e38('0x64'),_0x8e38('0x65'),'remoteUri',_0x8e38('0x66'),'accessKey']})[_0x8e38('0x1f')](handleEntityNotFound(_0x48fd92,null))[_0x8e38('0x1f')](function(_0x271ca6){if(_0x271ca6){_0x417549=_0x271ca6[_0x8e38('0x63')];_0x5d77c2=_0x271ca6[_0x8e38('0x67')];_0x208b3b=_0x271ca6[_0x8e38('0x65')];_0x1bcabf=_0x271ca6[_0x8e38('0x68')];var _0x1ab26a=_0x1bcabf[_0x8e38('0x69')](-0x1);if(_0x1ab26a==='/'){_0x1bcabf=_0x1bcabf['substring'](0x0,_0x1bcabf[_0x8e38('0x6a')](_0x1ab26a));}_0x4050bc=util[_0x8e38('0x6b')]('%s/webservice.php',_0x1bcabf);var _0x3a1c75={'method':_0x8e38('0x6c'),'uri':_0x4050bc,'qs':{'operation':'getchallenge','username':_0x271ca6[_0x8e38('0x63')]},'json':!![]};return rp(_0x3a1c75);}})[_0x8e38('0x1f')](function(_0xc74de1){if(_0xc74de1[_0x8e38('0x6d')]){var _0x48f337={'method':_0x8e38('0x6e'),'uri':_0x4050bc,'form':{'operation':_0x8e38('0x6f'),'username':_0x417549,'accessKey':md5(_0xc74de1['result'][_0x8e38('0x70')]+_0x5d77c2)},'json':!![]};return rp(_0x48f337);}})[_0x8e38('0x1f')](function(_0x3e8f48){if(_0x3e8f48[_0x8e38('0x6d')]){var _0x42e7f2={'method':_0x8e38('0x6c'),'uri':_0x4050bc,'qs':{'operation':_0x8e38('0x71'),'username':_0x417549,'sessionName':_0x3e8f48[_0x8e38('0x27')][_0x8e38('0x72')],'elementType':_0x208b3b},'json':!![]};return rp(_0x42e7f2);}})[_0x8e38('0x1f')](function(_0x4e79e3){if(_0x4e79e3[_0x8e38('0x6d')]){var _0x14a202=[_0x8e38('0x73'),_0x8e38('0x74'),_0x8e38('0x75')];_[_0x8e38('0x76')](_0x4e79e3[_0x8e38('0x27')][_0x8e38('0x40')],function(_0x51c64d){return _0x14a202[_0x8e38('0x77')](_0x51c64d['type'][_0x8e38('0x36')]);});_['remove'](_0x4e79e3['result'][_0x8e38('0x40')],function(_0x32032a){return _0x32032a[_0x8e38('0x78')]===_0x8e38('0x79');});return{'count':_0x4e79e3[_0x8e38('0x27')]['fields']['length'],'rows':_[_0x8e38('0x7a')](_0x4e79e3[_0x8e38('0x27')][_0x8e38('0x40')],function(_0x57695c){return{'id':_0x57695c[_0x8e38('0x36')],'name':_0x57695c[_0x8e38('0x7b')],'custom':_['startsWith'](_0x57695c[_0x8e38('0x36')],'cf_')?!![]:![],'options':_0x57695c[_0x8e38('0x48')]['name']===_0x8e38('0x7c')&&_0x57695c[_0x8e38('0x48')][_0x8e38('0x7d')][_0x8e38('0x52')]>0x0?_[_0x8e38('0x7a')](_0x57695c[_0x8e38('0x48')][_0x8e38('0x7d')],function(_0x5c6bdc){return{'name':_0x5c6bdc['label'],'value':_0x5c6bdc[_0x8e38('0x7e')]};}):[]};})};}})['then'](respondWithResult(_0x48fd92,null))[_0x8e38('0x28')](function(_0x41a5a8){console['log'](_0x8e38('0x7f')+_0x41a5a8);var _0x16f8a2=_0x1ea372['query']['test']?0x1f4:_0x41a5a8[_0x8e38('0x80')]||0x1f4;logger['error'](_0x8e38('0x81'),_0x8e38('0x62'),_0x16f8a2,JSON[_0x8e38('0x22')](_0x41a5a8));delete _0x41a5a8[_0x8e38('0x36')];if(_0x16f8a2===0x191){_0x16f8a2=0x190;}_0x48fd92[_0x8e38('0x34')](_0x16f8a2)[_0x8e38('0x37')](_0x1ea372[_0x8e38('0x3b')]['test']?{'message':_0x8e38('0x82'),'statusCode':_0x41a5a8[_0x8e38('0x80')]}:_0x41a5a8);});}; \ No newline at end of file +var _0x0f69=['destroy','sendStatus','name','send','index','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','result','token','GET','describe','sessionName','reference','owner','includes','remove','editable','false','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/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~!@#$%^&-_=+[{]}.','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','count','offset','limit','Content-Range','save','update'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0f69,0x15f));var _0x90f6=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0f69[_0x4ae829];return _0x256b31;};'use strict';var pdf=require(_0x90f6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x90f6('0x1'));var zipdir=require(_0x90f6('0x2'));var jsonpatch=require(_0x90f6('0x3'));var rp=require(_0x90f6('0x4'));var moment=require(_0x90f6('0x5'));var BPromise=require(_0x90f6('0x6'));var Mustache=require(_0x90f6('0x7'));var util=require(_0x90f6('0x8'));var path=require(_0x90f6('0x9'));var sox=require(_0x90f6('0xa'));var csv=require(_0x90f6('0xb'));var ejs=require(_0x90f6('0xc'));var fs=require('fs');var _=require(_0x90f6('0xd'));var squel=require(_0x90f6('0xe'));var crypto=require(_0x90f6('0xf'));var jsforce=require(_0x90f6('0x10'));var deskjs=require(_0x90f6('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90f6('0x12'));var Redis=require(_0x90f6('0x13'));var authService=require(_0x90f6('0x14'));var qs=require(_0x90f6('0x15'));var hardwareService=require(_0x90f6('0x16'));var logger=require(_0x90f6('0x17'))(_0x90f6('0x18'));var utils=require(_0x90f6('0x19'));var config=require(_0x90f6('0x1a'));var db=require(_0x90f6('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x90f6('0x1c'));var client=jayson[_0x90f6('0x1d')][_0x90f6('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x434bbd,_0x4c7091,_0x5a9560){if(_0x5a9560){var _0x4ea745=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ea745[_0x90f6('0x1f')](_0x4c7091)){return _0x434bbd;}else{throw new Error(_0x90f6('0x20'));}}else{return _0x434bbd;}}function respondWithRpcPromise(_0x1b1896,_0x54110e,_0x3a6cdb,_0x209162){return new BPromise(function(_0x50740c,_0x5cc05b){var _0x5162d3=_0x209162||client;return _0x5162d3['request'](_0x1b1896,_0x3a6cdb)[_0x90f6('0x21')](function(_0x5de629){logger[_0x90f6('0x22')](_0x90f6('0x23'),_0x54110e,'request\x20sent');logger['debug'](_0x90f6('0x24'),_0x54110e,_0x90f6('0x25'),JSON[_0x90f6('0x26')](_0x5de629));if(_0x5de629[_0x90f6('0x27')]){if(_0x5de629[_0x90f6('0x27')][_0x90f6('0x28')]===0x1f4){logger[_0x90f6('0x27')]('VtigerAccount,\x20%s,\x20%s',_0x54110e,_0x5de629[_0x90f6('0x27')][_0x90f6('0x29')]);return _0x5cc05b(_0x5de629[_0x90f6('0x27')][_0x90f6('0x29')]);}logger[_0x90f6('0x27')](_0x90f6('0x23'),_0x54110e,_0x5de629[_0x90f6('0x27')]['message']);return _0x50740c(_0x5de629[_0x90f6('0x27')]['message']);}else{logger[_0x90f6('0x22')](_0x90f6('0x23'),_0x54110e,_0x90f6('0x25'));_0x50740c(_0x5de629['result'][_0x90f6('0x29')]);}})['catch'](function(_0x397408){logger[_0x90f6('0x27')](_0x90f6('0x23'),_0x54110e,_0x397408);_0x5cc05b(_0x397408);});});}function respondWithStatusCode(_0x4f2966,_0x23240a){_0x23240a=_0x23240a||0xcc;return function(_0x20b4a7){if(_0x20b4a7){return _0x4f2966['sendStatus'](_0x23240a);}return _0x4f2966[_0x90f6('0x2a')](_0x23240a)[_0x90f6('0x2b')]();};}function respondWithResult(_0x17aa06,_0x25b37f){_0x25b37f=_0x25b37f||0xc8;return function(_0x574dfe){if(_0x574dfe){return _0x17aa06[_0x90f6('0x2a')](_0x25b37f)[_0x90f6('0x2c')](_0x574dfe);}};}function respondWithFilteredResult(_0x18137d,_0x3ed31c){return function(_0x6ac83a){if(_0x6ac83a){var _0x2b51ed=_0x6ac83a[_0x90f6('0x2d')],_0x17be21=_0x3ed31c[_0x90f6('0x2e')],_0x38dcac=_0x3ed31c[_0x90f6('0x2e')]+_0x3ed31c[_0x90f6('0x2f')],_0x54043b;if(_0x38dcac>=_0x2b51ed){_0x38dcac=_0x2b51ed;_0x54043b=0xc8;}else{_0x54043b=0xce;}_0x18137d['status'](_0x54043b);return _0x18137d['set'](_0x90f6('0x30'),_0x17be21+'-'+_0x38dcac+'/'+_0x2b51ed)[_0x90f6('0x2c')](_0x6ac83a);}return null;};}function patchUpdates(_0x337e7b){return function(_0x3cf76d){try{jsonpatch['apply'](_0x3cf76d,_0x337e7b,!![]);}catch(_0x401c89){return BPromise['reject'](_0x401c89);}return _0x3cf76d[_0x90f6('0x31')]();};}function saveUpdates(_0x30863f,_0x7ce713){return function(_0x555416){if(_0x555416){return _0x555416[_0x90f6('0x32')](_0x30863f)[_0x90f6('0x21')](function(_0x50fe01){return _0x50fe01;});}return null;};}function removeEntity(_0x2b66b4,_0x48a09e){return function(_0x2d185d){if(_0x2d185d){return _0x2d185d[_0x90f6('0x33')]()[_0x90f6('0x21')](function(){_0x2b66b4['status'](0xcc)[_0x90f6('0x2b')]();});}};}function handleEntityNotFound(_0xe071d6,_0x5981f3){return function(_0x464663){if(!_0x464663){_0xe071d6[_0x90f6('0x34')](0x194);}return _0x464663;};}function handleError(_0x1f5240,_0x30adf3){_0x30adf3=_0x30adf3||0x1f4;return function(_0x14b7f5){logger['error'](_0x14b7f5['stack']);if(_0x14b7f5[_0x90f6('0x35')]){delete _0x14b7f5[_0x90f6('0x35')];}_0x1f5240[_0x90f6('0x2a')](_0x30adf3)[_0x90f6('0x36')](_0x14b7f5);};}exports[_0x90f6('0x37')]=function(_0x25cb9b,_0x730411){var _0x52089c={},_0x388459={},_0x490e20={'count':0x0,'rows':[]};var _0x464685=db[_0x90f6('0x38')][_0x90f6('0x39')];_0x388459[_0x90f6('0x3a')]=_[_0x90f6('0x3b')](_0x464685);_0x388459[_0x90f6('0x3c')]=_[_0x90f6('0x3b')](_0x25cb9b[_0x90f6('0x3c')]);_0x388459[_0x90f6('0x3d')]=_[_0x90f6('0x3e')](_0x388459[_0x90f6('0x3a')],_0x388459[_0x90f6('0x3c')]);_0x52089c[_0x90f6('0x3f')]=_[_0x90f6('0x3e')](_0x388459[_0x90f6('0x3a')],qs['fields'](_0x25cb9b['query']['fields']));_0x52089c[_0x90f6('0x3f')]=_0x52089c[_0x90f6('0x3f')][_0x90f6('0x40')]?_0x52089c[_0x90f6('0x3f')]:_0x388459['model'];if(!_0x25cb9b[_0x90f6('0x3c')][_0x90f6('0x41')](_0x90f6('0x42'))){_0x52089c[_0x90f6('0x2f')]=qs['limit'](_0x25cb9b[_0x90f6('0x3c')]['limit']);_0x52089c[_0x90f6('0x2e')]=qs[_0x90f6('0x2e')](_0x25cb9b[_0x90f6('0x3c')][_0x90f6('0x2e')]);}_0x52089c[_0x90f6('0x43')]=qs[_0x90f6('0x44')](_0x25cb9b[_0x90f6('0x3c')][_0x90f6('0x44')]);_0x52089c[_0x90f6('0x45')]=qs[_0x90f6('0x3d')](_[_0x90f6('0x46')](_0x25cb9b[_0x90f6('0x3c')],_0x388459[_0x90f6('0x3d')]));if(_0x25cb9b[_0x90f6('0x3c')][_0x90f6('0x47')]){_0x52089c[_0x90f6('0x45')]=_[_0x90f6('0x48')](_0x52089c[_0x90f6('0x45')],{'$or':_[_0x90f6('0x49')](_0x464685,function(_0x42ff8a){if(_0x42ff8a[_0x90f6('0x4a')][_0x90f6('0x4b')]!==_0x90f6('0x4c')){var _0x854543={};_0x854543[_0x42ff8a['field']]={'$like':'%'+_0x25cb9b['query']['filter']+'%'};return _0x854543;}})});}_0x52089c=_[_0x90f6('0x48')]({},_0x52089c,_0x25cb9b[_0x90f6('0x4d')]);var _0x450dbf={'where':_0x52089c[_0x90f6('0x45')]};return db[_0x90f6('0x38')]['count'](_0x450dbf)[_0x90f6('0x21')](function(_0x4c27aa){_0x490e20[_0x90f6('0x2d')]=_0x4c27aa;if(_0x25cb9b[_0x90f6('0x3c')][_0x90f6('0x4e')]){_0x52089c[_0x90f6('0x4f')]=[{'all':!![]}];}return db[_0x90f6('0x38')][_0x90f6('0x50')](_0x52089c);})[_0x90f6('0x21')](function(_0x438119){_0x490e20[_0x90f6('0x51')]=_0x438119;return _0x490e20;})[_0x90f6('0x21')](respondWithFilteredResult(_0x730411,_0x52089c))[_0x90f6('0x52')](handleError(_0x730411,null));};exports[_0x90f6('0x53')]=function(_0x32431f,_0x27a3c4){var _0x1a1e56={'raw':![],'where':{'id':_0x32431f[_0x90f6('0x54')]['id']}},_0x5c5c11={};_0x5c5c11[_0x90f6('0x3a')]=_[_0x90f6('0x3b')](db[_0x90f6('0x38')][_0x90f6('0x39')]);_0x5c5c11[_0x90f6('0x3c')]=_[_0x90f6('0x3b')](_0x32431f[_0x90f6('0x3c')]);_0x5c5c11[_0x90f6('0x3d')]=_[_0x90f6('0x3e')](_0x5c5c11[_0x90f6('0x3a')],_0x5c5c11['query']);_0x1a1e56[_0x90f6('0x3f')]=_[_0x90f6('0x3e')](_0x5c5c11[_0x90f6('0x3a')],qs[_0x90f6('0x55')](_0x32431f['query']['fields']));_0x1a1e56[_0x90f6('0x3f')]=_0x1a1e56[_0x90f6('0x3f')][_0x90f6('0x40')]?_0x1a1e56[_0x90f6('0x3f')]:_0x5c5c11[_0x90f6('0x3a')];if(_0x32431f[_0x90f6('0x3c')][_0x90f6('0x4e')]){_0x1a1e56[_0x90f6('0x4f')]=[{'all':!![]}];}_0x1a1e56=_[_0x90f6('0x48')]({},_0x1a1e56,_0x32431f[_0x90f6('0x4d')]);return db[_0x90f6('0x38')]['find'](_0x1a1e56)[_0x90f6('0x21')](handleEntityNotFound(_0x27a3c4,null))[_0x90f6('0x21')](respondWithResult(_0x27a3c4,null))[_0x90f6('0x52')](handleError(_0x27a3c4,null));};exports[_0x90f6('0x56')]=function(_0x1ecb25,_0x16187a){return db[_0x90f6('0x38')][_0x90f6('0x56')](_0x1ecb25[_0x90f6('0x57')],{})[_0x90f6('0x21')](respondWithResult(_0x16187a,0xc9))['catch'](handleError(_0x16187a,null));};exports[_0x90f6('0x32')]=function(_0x27fd8c,_0x5be96f){if(_0x27fd8c[_0x90f6('0x57')]['id']){delete _0x27fd8c['body']['id'];}return db[_0x90f6('0x38')][_0x90f6('0x58')]({'where':{'id':_0x27fd8c[_0x90f6('0x54')]['id']}})[_0x90f6('0x21')](handleEntityNotFound(_0x5be96f,null))[_0x90f6('0x21')](saveUpdates(_0x27fd8c[_0x90f6('0x57')],null))[_0x90f6('0x21')](respondWithResult(_0x5be96f,null))[_0x90f6('0x52')](handleError(_0x5be96f,null));};exports[_0x90f6('0x33')]=function(_0x21546b,_0x3ac2dc){return db[_0x90f6('0x38')]['find']({'where':{'id':_0x21546b[_0x90f6('0x54')]['id']}})[_0x90f6('0x21')](handleEntityNotFound(_0x3ac2dc,null))[_0x90f6('0x21')](removeEntity(_0x3ac2dc,null))[_0x90f6('0x52')](handleError(_0x3ac2dc,null));};exports[_0x90f6('0x59')]=function(_0x5d7897,_0x4d461c,_0x2c4bad){var _0x847bac={};var _0x286683={};var _0x46a072;var _0x5c17ae;return db[_0x90f6('0x38')][_0x90f6('0x5a')]({'where':{'id':_0x5d7897[_0x90f6('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d461c,null))[_0x90f6('0x21')](function(_0x1d963a){if(_0x1d963a){_0x46a072=_0x1d963a;_0x286683[_0x90f6('0x3a')]=_[_0x90f6('0x3b')](db[_0x90f6('0x5b')][_0x90f6('0x39')]);_0x286683[_0x90f6('0x3c')]=_['keys'](_0x5d7897[_0x90f6('0x3c')]);_0x286683['filters']=_[_0x90f6('0x3e')](_0x286683[_0x90f6('0x3a')],_0x286683['query']);_0x847bac['attributes']=_[_0x90f6('0x3e')](_0x286683[_0x90f6('0x3a')],qs[_0x90f6('0x55')](_0x5d7897[_0x90f6('0x3c')][_0x90f6('0x55')]));_0x847bac[_0x90f6('0x3f')]=_0x847bac[_0x90f6('0x3f')][_0x90f6('0x40')]?_0x847bac['attributes']:_0x286683['model'];_0x847bac[_0x90f6('0x43')]=qs[_0x90f6('0x44')](_0x5d7897[_0x90f6('0x3c')][_0x90f6('0x44')]);_0x847bac[_0x90f6('0x45')]=qs[_0x90f6('0x3d')](_[_0x90f6('0x46')](_0x5d7897[_0x90f6('0x3c')],_0x286683['filters']));if(_0x5d7897[_0x90f6('0x3c')][_0x90f6('0x47')]){_0x847bac['where']=_['merge'](_0x847bac[_0x90f6('0x45')],{'$or':_[_0x90f6('0x49')](_0x847bac[_0x90f6('0x3f')],function(_0x19760d){var _0x1f2640={};_0x1f2640[_0x19760d]={'$like':'%'+_0x5d7897[_0x90f6('0x3c')]['filter']+'%'};return _0x1f2640;})});}_0x847bac=_[_0x90f6('0x48')]({},_0x847bac,_0x5d7897[_0x90f6('0x4d')]);return _0x46a072[_0x90f6('0x59')](_0x847bac);}})[_0x90f6('0x21')](function(_0x4db171){if(_0x4db171){_0x5c17ae=_0x4db171[_0x90f6('0x40')];if(!_0x5d7897[_0x90f6('0x3c')]['hasOwnProperty'](_0x90f6('0x42'))){_0x847bac[_0x90f6('0x2f')]=qs['limit'](_0x5d7897[_0x90f6('0x3c')][_0x90f6('0x2f')]);_0x847bac[_0x90f6('0x2e')]=qs[_0x90f6('0x2e')](_0x5d7897[_0x90f6('0x3c')][_0x90f6('0x2e')]);}return _0x46a072[_0x90f6('0x59')](_0x847bac);}})['then'](function(_0x4b8624){if(_0x4b8624){return _0x4b8624?{'count':_0x5c17ae,'rows':_0x4b8624}:null;}})[_0x90f6('0x21')](respondWithResult(_0x4d461c,null))[_0x90f6('0x52')](handleError(_0x4d461c,null));};exports['addConfiguration']=function(_0x4dfa2f,_0x23abdd,_0x2d26c6){if(_0x4dfa2f[_0x90f6('0x57')]['id']){delete _0x4dfa2f[_0x90f6('0x57')]['id'];}return db['VtigerAccount'][_0x90f6('0x5a')]({'where':{'id':_0x4dfa2f[_0x90f6('0x54')]['id']}})[_0x90f6('0x21')](handleEntityNotFound(_0x23abdd,null))[_0x90f6('0x21')](function(_0x5b3c50){if(_0x5b3c50){_0x4dfa2f[_0x90f6('0x57')][_0x90f6('0x5c')]=_0x5b3c50['id'];_0x4dfa2f[_0x90f6('0x57')][_0x90f6('0x5d')]=integrations[_0x90f6('0x5e')](_0x4dfa2f[_0x90f6('0x57')]['channel'],_0x4dfa2f[_0x90f6('0x57')]['type']);_0x4dfa2f['body'][_0x90f6('0x5f')]=integrations[_0x90f6('0x60')](_0x4dfa2f[_0x90f6('0x57')]['channel'],_0x4dfa2f[_0x90f6('0x57')][_0x90f6('0x4a')]);return db['VtigerConfiguration'][_0x90f6('0x56')](_0x4dfa2f['body'],{'include':[{'model':db[_0x90f6('0x61')],'as':_0x90f6('0x5d')},{'model':db[_0x90f6('0x61')],'as':_0x90f6('0x5f')}]});}return null;})[_0x90f6('0x21')](respondWithResult(_0x23abdd,null))[_0x90f6('0x52')](handleError(_0x23abdd,null));};var md5=require(_0x90f6('0x62'));exports[_0x90f6('0x63')]=function(_0x315a39,_0x38992d,_0x40dda0){var _0x55cd6c=null;var _0x4a2f7b=null;var _0x239b9d=null;var _0xdb3cd4=null;var _0x4eac01='';return db[_0x90f6('0x38')][_0x90f6('0x5a')]({'where':{'id':_0x315a39[_0x90f6('0x54')]['id']},'attributes':['id',_0x90f6('0x35'),_0x90f6('0x64'),_0x90f6('0x65'),_0x90f6('0x66'),_0x90f6('0x67'),_0x90f6('0x68'),_0x90f6('0x69')]})['then'](handleEntityNotFound(_0x38992d,null))[_0x90f6('0x21')](function(_0x359aaa){if(_0x359aaa){_0x55cd6c=_0x359aaa[_0x90f6('0x64')];_0x4a2f7b=_0x359aaa['accessKey'];_0x239b9d=_0x359aaa[_0x90f6('0x66')];_0x4eac01=_0x359aaa[_0x90f6('0x67')];var _0xdd0fb1=_0x4eac01[_0x90f6('0x6a')](-0x1);if(_0xdd0fb1==='/'){_0x4eac01=_0x4eac01[_0x90f6('0x6b')](0x0,_0x4eac01[_0x90f6('0x6c')](_0xdd0fb1));}_0xdb3cd4=util[_0x90f6('0x6d')](_0x90f6('0x6e'),_0x4eac01);var _0xcb1003={'method':'GET','uri':_0xdb3cd4,'qs':{'operation':_0x90f6('0x6f'),'username':_0x359aaa[_0x90f6('0x64')]},'json':!![]};return rp(_0xcb1003);}})[_0x90f6('0x21')](function(_0x42fb2c){if(_0x42fb2c[_0x90f6('0x70')]){var _0x2c1181={'method':_0x90f6('0x71'),'uri':_0xdb3cd4,'form':{'operation':'login','username':_0x55cd6c,'accessKey':md5(_0x42fb2c[_0x90f6('0x72')][_0x90f6('0x73')]+_0x4a2f7b)},'json':!![]};return rp(_0x2c1181);}})[_0x90f6('0x21')](function(_0xab44a1){if(_0xab44a1[_0x90f6('0x70')]){var _0x33dced={'method':_0x90f6('0x74'),'uri':_0xdb3cd4,'qs':{'operation':_0x90f6('0x75'),'username':_0x55cd6c,'sessionName':_0xab44a1[_0x90f6('0x72')][_0x90f6('0x76')],'elementType':_0x239b9d},'json':!![]};return rp(_0x33dced);}})[_0x90f6('0x21')](function(_0x5a09a3){if(_0x5a09a3[_0x90f6('0x70')]){var _0x4ae69d=['autogenerated',_0x90f6('0x77'),_0x90f6('0x78')];_['remove'](_0x5a09a3[_0x90f6('0x72')]['fields'],function(_0x1fb9ff){return _0x4ae69d[_0x90f6('0x79')](_0x1fb9ff[_0x90f6('0x4a')]['name']);});_[_0x90f6('0x7a')](_0x5a09a3['result'][_0x90f6('0x55')],function(_0x2b865f){return _0x2b865f[_0x90f6('0x7b')]===_0x90f6('0x7c');});return{'count':_0x5a09a3[_0x90f6('0x72')][_0x90f6('0x55')][_0x90f6('0x40')],'rows':_[_0x90f6('0x49')](_0x5a09a3[_0x90f6('0x72')]['fields'],function(_0x513e17){return{'id':_0x513e17[_0x90f6('0x35')],'name':_0x513e17['label'],'custom':_['startsWith'](_0x513e17[_0x90f6('0x35')],_0x90f6('0x7d'))?!![]:![],'options':_0x513e17[_0x90f6('0x4a')][_0x90f6('0x35')]===_0x90f6('0x7e')&&_0x513e17[_0x90f6('0x4a')]['picklistValues'][_0x90f6('0x40')]>0x0?_[_0x90f6('0x49')](_0x513e17[_0x90f6('0x4a')][_0x90f6('0x7f')],function(_0x302475){return{'name':_0x302475[_0x90f6('0x80')],'value':_0x302475[_0x90f6('0x81')]};}):[]};})};}})[_0x90f6('0x21')](respondWithResult(_0x38992d,null))['catch'](function(_0x53be02){console['log'](_0x90f6('0x82')+_0x53be02);var _0x3a294a=_0x315a39[_0x90f6('0x3c')]['test']?0x1f4:_0x53be02[_0x90f6('0x83')]||0x1f4;logger[_0x90f6('0x27')](_0x90f6('0x84'),'getFields',_0x3a294a,JSON[_0x90f6('0x26')](_0x53be02));delete _0x53be02[_0x90f6('0x35')];if(_0x3a294a===0x191){_0x3a294a=0x190;}_0x38992d[_0x90f6('0x2a')](_0x3a294a)['send'](_0x315a39['query'][_0x90f6('0x1f')]?{'message':_0x90f6('0x85'),'statusCode':_0x53be02[_0x90f6('0x83')]}:_0x53be02);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 78c63bc..bb2d3a8 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 _0x6e1c=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x3a7e42,_0x58e47d){var _0x7122b7=function(_0x42acab){while(--_0x42acab){_0x3a7e42['push'](_0x3a7e42['shift']());}};_0x7122b7(++_0x58e47d);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6e1('0x1'));var moment=require(_0xc6e1('0x2'));var BPromise=require(_0xc6e1('0x3'));var rp=require(_0xc6e1('0x4'));var fs=require('fs');var path=require(_0xc6e1('0x5'));var rimraf=require(_0xc6e1('0x6'));var config=require(_0xc6e1('0x7'));var attributes=require(_0xc6e1('0x8'));var integrations=require(_0xc6e1('0x9'));module[_0xc6e1('0xa')]=function(_0x468a80,_0x5247f1){return _0x468a80[_0xc6e1('0xb')](_0xc6e1('0xc'),attributes,{'tableName':_0xc6e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcac3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger'];(function(_0x94e04c,_0x5752e3){var _0x3f9f6d=function(_0x26fba1){while(--_0x26fba1){_0x94e04c['push'](_0x94e04c['shift']());}};_0x3f9f6d(++_0x5752e3);}(_0xcac3,0x193));var _0x3cac=function(_0xffa654,_0x4c734){_0xffa654=_0xffa654-0x0;var _0x5dd847=_0xcac3[_0xffa654];return _0x5dd847;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var logger=require(_0x3cac('0x1'))(_0x3cac('0x2'));var moment=require(_0x3cac('0x3'));var BPromise=require(_0x3cac('0x4'));var rp=require(_0x3cac('0x5'));var fs=require('fs');var path=require(_0x3cac('0x6'));var rimraf=require(_0x3cac('0x7'));var config=require(_0x3cac('0x8'));var attributes=require(_0x3cac('0x9'));var integrations=require(_0x3cac('0xa'));module[_0x3cac('0xb')]=function(_0x35c687,_0x1e2560){return _0x35c687[_0x3cac('0xc')](_0x3cac('0xd'),attributes,{'tableName':_0x3cac('0xe'),'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 c776ed2..05d73c7 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 _0x8ac7=['options','raw','where','attributes','include','model','map','catch','ShowVtigerAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetVtigerAccount','VtigerAccount'];(function(_0xb358eb,_0x1c49c8){var _0x486599=function(_0x4c5c32){while(--_0x4c5c32){_0xb358eb['push'](_0xb358eb['shift']());}};_0x486599(++_0x1c49c8);}(_0x8ac7,0xea));var _0x78ac=function(_0x350ccc,_0x4d590b){_0x350ccc=_0x350ccc-0x0;var _0x161318=_0x8ac7[_0x350ccc];return _0x161318;};'use strict';var _=require(_0x78ac('0x0'));var util=require('util');var moment=require(_0x78ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x78ac('0x2'));var fs=require('fs');var Redis=require(_0x78ac('0x3'));var db=require(_0x78ac('0x4'))['db'];var utils=require(_0x78ac('0x5'));var logger=require(_0x78ac('0x6'))(_0x78ac('0x7'));var config=require(_0x78ac('0x8'));var jayson=require(_0x78ac('0x9'));var client=jayson['client'][_0x78ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c45dc,_0x102e78,_0x34c49b){return new BPromise(function(_0x3208f1,_0x495791){return client[_0x78ac('0xb')](_0x1c45dc,_0x34c49b)[_0x78ac('0xc')](function(_0x2ef5ef){logger[_0x78ac('0xd')](_0x78ac('0xe'),_0x102e78,_0x78ac('0xf'));logger[_0x78ac('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x102e78,'request\x20sent',JSON[_0x78ac('0x11')](_0x2ef5ef));if(_0x2ef5ef[_0x78ac('0x12')]){if(_0x2ef5ef[_0x78ac('0x12')]['code']===0x1f4){logger[_0x78ac('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x102e78,_0x2ef5ef[_0x78ac('0x12')][_0x78ac('0x13')]);return _0x495791(_0x2ef5ef[_0x78ac('0x12')][_0x78ac('0x13')]);}logger[_0x78ac('0x12')](_0x78ac('0xe'),_0x102e78,_0x2ef5ef[_0x78ac('0x12')]['message']);return _0x3208f1(_0x2ef5ef[_0x78ac('0x12')][_0x78ac('0x13')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x102e78,_0x78ac('0xf'));_0x3208f1(_0x2ef5ef['result']['message']);}})['catch'](function(_0x567310){logger[_0x78ac('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x102e78,_0x567310);_0x495791(_0x567310);});});}exports[_0x78ac('0x14')]=function(_0x2b7735){var _0xbf7fa8=this;return new Promise(function(_0x486b32,_0x3e8ec9){return db[_0x78ac('0x15')]['findAll']({'raw':_0x2b7735[_0x78ac('0x16')]?_0x2b7735[_0x78ac('0x16')][_0x78ac('0x17')]===undefined?!![]:![]:!![],'where':_0x2b7735[_0x78ac('0x16')]?_0x2b7735[_0x78ac('0x16')][_0x78ac('0x18')]||null:null,'attributes':_0x2b7735[_0x78ac('0x16')]?_0x2b7735[_0x78ac('0x16')][_0x78ac('0x19')]||null:null,'limit':_0x2b7735[_0x78ac('0x16')]?_0x2b7735[_0x78ac('0x16')]['limit']||null:null,'include':_0x2b7735[_0x78ac('0x16')]?_0x2b7735[_0x78ac('0x16')][_0x78ac('0x1a')]?_['map'](_0x2b7735[_0x78ac('0x16')][_0x78ac('0x1a')],function(_0x4c1dde){return{'model':db[_0x4c1dde[_0x78ac('0x1b')]],'as':_0x4c1dde['as'],'attributes':_0x4c1dde[_0x78ac('0x19')],'include':_0x4c1dde[_0x78ac('0x1a')]?_[_0x78ac('0x1c')](_0x4c1dde['include'],function(_0x4fd73f){return{'model':db[_0x4fd73f[_0x78ac('0x1b')]],'as':_0x4fd73f['as'],'attributes':_0x4fd73f['attributes'],'include':_0x4fd73f[_0x78ac('0x1a')]?_[_0x78ac('0x1c')](_0x4fd73f[_0x78ac('0x1a')],function(_0x57a3f0){return{'model':db[_0x57a3f0[_0x78ac('0x1b')]],'as':_0x57a3f0['as'],'attributes':_0x57a3f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x78ac('0xc')](function(_0x4d65f2){logger[_0x78ac('0xd')](_0x78ac('0x14'),_0x2b7735);logger['debug'](_0x78ac('0x14'),_0x2b7735,JSON['stringify'](_0x4d65f2));_0x486b32(_0x4d65f2);})[_0x78ac('0x1d')](function(_0x37b28c){logger[_0x78ac('0x12')](_0x78ac('0x14'),_0x37b28c[_0x78ac('0x13')],_0x2b7735);_0x3e8ec9(_0xbf7fa8[_0x78ac('0x12')](0x1f4,_0x37b28c[_0x78ac('0x13')]));});});};exports[_0x78ac('0x1e')]=function(_0x11d0cd){var _0x46bc27=this;return new Promise(function(_0x591ee7,_0x211ab1){return db[_0x78ac('0x15')][_0x78ac('0x1f')]({'raw':_0x11d0cd['options']?_0x11d0cd[_0x78ac('0x16')][_0x78ac('0x17')]===undefined?!![]:![]:!![],'where':_0x11d0cd[_0x78ac('0x16')]?_0x11d0cd[_0x78ac('0x16')][_0x78ac('0x18')]||null:null,'attributes':_0x11d0cd[_0x78ac('0x16')]?_0x11d0cd[_0x78ac('0x16')][_0x78ac('0x19')]||null:null,'include':_0x11d0cd[_0x78ac('0x16')]?_0x11d0cd[_0x78ac('0x16')][_0x78ac('0x1a')]?_['map'](_0x11d0cd[_0x78ac('0x16')]['include'],function(_0x113400){return{'model':db[_0x113400[_0x78ac('0x1b')]],'as':_0x113400['as'],'attributes':_0x113400[_0x78ac('0x19')],'include':_0x113400[_0x78ac('0x1a')]?_['map'](_0x113400[_0x78ac('0x1a')],function(_0x18cd7b){return{'model':db[_0x18cd7b['model']],'as':_0x18cd7b['as'],'attributes':_0x18cd7b[_0x78ac('0x19')],'include':_0x18cd7b[_0x78ac('0x1a')]?_['map'](_0x18cd7b[_0x78ac('0x1a')],function(_0x350b03){return{'model':db[_0x350b03[_0x78ac('0x1b')]],'as':_0x350b03['as'],'attributes':_0x350b03[_0x78ac('0x19')]};}):[]};}):[]};}):[]:[]})[_0x78ac('0xc')](function(_0x345c83){logger[_0x78ac('0xd')]('ShowVtigerAccount',_0x11d0cd);logger['debug']('ShowVtigerAccount',_0x11d0cd,JSON[_0x78ac('0x11')](_0x345c83));_0x591ee7(_0x345c83);})[_0x78ac('0x1d')](function(_0x2866bf){logger[_0x78ac('0x12')](_0x78ac('0x1e'),_0x2866bf[_0x78ac('0x13')],_0x11d0cd);_0x211ab1(_0x46bc27[_0x78ac('0x12')](0x1f4,_0x2866bf[_0x78ac('0x13')]));});});}; \ No newline at end of file +var _0xa9b3=['limit','map','include','attributes','model','then','debug','where','ShowVtigerAccount','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x255682,_0xbc7981){var _0x22fa6b=function(_0x5c56c1){while(--_0x5c56c1){_0x255682['push'](_0x255682['shift']());}};_0x22fa6b(++_0xbc7981);}(_0xa9b3,0x18b));var _0x3a9b=function(_0x1e0499,_0x2222ed){_0x1e0499=_0x1e0499-0x0;var _0x527766=_0xa9b3[_0x1e0499];return _0x527766;};'use strict';var _=require(_0x3a9b('0x0'));var util=require(_0x3a9b('0x1'));var moment=require(_0x3a9b('0x2'));var BPromise=require(_0x3a9b('0x3'));var rs=require(_0x3a9b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a9b('0x5'))['db'];var utils=require(_0x3a9b('0x6'));var logger=require(_0x3a9b('0x7'))(_0x3a9b('0x8'));var config=require(_0x3a9b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3a9b('0xa')][_0x3a9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41d805,_0xd6b70,_0x26bc47){return new BPromise(function(_0x53bdb0,_0x37a9e8){return client['request'](_0x41d805,_0x26bc47)['then'](function(_0x5bea5f){logger[_0x3a9b('0xc')](_0x3a9b('0xd'),_0xd6b70,_0x3a9b('0xe'));logger['debug'](_0x3a9b('0xf'),_0xd6b70,'request\x20sent',JSON[_0x3a9b('0x10')](_0x5bea5f));if(_0x5bea5f['error']){if(_0x5bea5f[_0x3a9b('0x11')][_0x3a9b('0x12')]===0x1f4){logger[_0x3a9b('0x11')](_0x3a9b('0xd'),_0xd6b70,_0x5bea5f['error'][_0x3a9b('0x13')]);return _0x37a9e8(_0x5bea5f['error'][_0x3a9b('0x13')]);}logger[_0x3a9b('0x11')](_0x3a9b('0xd'),_0xd6b70,_0x5bea5f['error'][_0x3a9b('0x13')]);return _0x53bdb0(_0x5bea5f['error'][_0x3a9b('0x13')]);}else{logger[_0x3a9b('0xc')](_0x3a9b('0xd'),_0xd6b70,_0x3a9b('0xe'));_0x53bdb0(_0x5bea5f['result'][_0x3a9b('0x13')]);}})['catch'](function(_0x183a4f){logger['error'](_0x3a9b('0xd'),_0xd6b70,_0x183a4f);_0x37a9e8(_0x183a4f);});});}exports[_0x3a9b('0x14')]=function(_0xe5b40c){var _0x36d093=this;return new Promise(function(_0x220ec6,_0x40ebd2){return db[_0x3a9b('0x15')][_0x3a9b('0x16')]({'raw':_0xe5b40c[_0x3a9b('0x17')]?_0xe5b40c[_0x3a9b('0x17')][_0x3a9b('0x18')]===undefined?!![]:![]:!![],'where':_0xe5b40c['options']?_0xe5b40c['options']['where']||null:null,'attributes':_0xe5b40c[_0x3a9b('0x17')]?_0xe5b40c['options']['attributes']||null:null,'limit':_0xe5b40c[_0x3a9b('0x17')]?_0xe5b40c['options'][_0x3a9b('0x19')]||null:null,'include':_0xe5b40c[_0x3a9b('0x17')]?_0xe5b40c[_0x3a9b('0x17')]['include']?_[_0x3a9b('0x1a')](_0xe5b40c[_0x3a9b('0x17')][_0x3a9b('0x1b')],function(_0x4932dc){return{'model':db[_0x4932dc['model']],'as':_0x4932dc['as'],'attributes':_0x4932dc[_0x3a9b('0x1c')],'include':_0x4932dc[_0x3a9b('0x1b')]?_[_0x3a9b('0x1a')](_0x4932dc[_0x3a9b('0x1b')],function(_0x5ddd01){return{'model':db[_0x5ddd01['model']],'as':_0x5ddd01['as'],'attributes':_0x5ddd01[_0x3a9b('0x1c')],'include':_0x5ddd01[_0x3a9b('0x1b')]?_['map'](_0x5ddd01[_0x3a9b('0x1b')],function(_0x36a652){return{'model':db[_0x36a652[_0x3a9b('0x1d')]],'as':_0x36a652['as'],'attributes':_0x36a652[_0x3a9b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3a9b('0x1e')](function(_0x496a50){logger[_0x3a9b('0xc')](_0x3a9b('0x14'),_0xe5b40c);logger[_0x3a9b('0x1f')](_0x3a9b('0x14'),_0xe5b40c,JSON[_0x3a9b('0x10')](_0x496a50));_0x220ec6(_0x496a50);})['catch'](function(_0x476d3b){logger[_0x3a9b('0x11')](_0x3a9b('0x14'),_0x476d3b[_0x3a9b('0x13')],_0xe5b40c);_0x40ebd2(_0x36d093[_0x3a9b('0x11')](0x1f4,_0x476d3b['message']));});});};exports['ShowVtigerAccount']=function(_0x453816){var _0x1e4148=this;return new Promise(function(_0x35e82e,_0x55c35e){return db[_0x3a9b('0x15')]['find']({'raw':_0x453816[_0x3a9b('0x17')]?_0x453816[_0x3a9b('0x17')][_0x3a9b('0x18')]===undefined?!![]:![]:!![],'where':_0x453816[_0x3a9b('0x17')]?_0x453816['options'][_0x3a9b('0x20')]||null:null,'attributes':_0x453816[_0x3a9b('0x17')]?_0x453816[_0x3a9b('0x17')][_0x3a9b('0x1c')]||null:null,'include':_0x453816[_0x3a9b('0x17')]?_0x453816[_0x3a9b('0x17')][_0x3a9b('0x1b')]?_[_0x3a9b('0x1a')](_0x453816[_0x3a9b('0x17')][_0x3a9b('0x1b')],function(_0x3dcdab){return{'model':db[_0x3dcdab[_0x3a9b('0x1d')]],'as':_0x3dcdab['as'],'attributes':_0x3dcdab['attributes'],'include':_0x3dcdab[_0x3a9b('0x1b')]?_[_0x3a9b('0x1a')](_0x3dcdab['include'],function(_0x15a1e2){return{'model':db[_0x15a1e2['model']],'as':_0x15a1e2['as'],'attributes':_0x15a1e2['attributes'],'include':_0x15a1e2[_0x3a9b('0x1b')]?_['map'](_0x15a1e2[_0x3a9b('0x1b')],function(_0x44ed83){return{'model':db[_0x44ed83[_0x3a9b('0x1d')]],'as':_0x44ed83['as'],'attributes':_0x44ed83[_0x3a9b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3a9b('0x1e')](function(_0x3edd99){logger['info'](_0x3a9b('0x21'),_0x453816);logger[_0x3a9b('0x1f')](_0x3a9b('0x21'),_0x453816,JSON['stringify'](_0x3edd99));_0x35e82e(_0x3edd99);})[_0x3a9b('0x22')](function(_0x2a04d4){logger['error'](_0x3a9b('0x21'),_0x2a04d4[_0x3a9b('0x13')],_0x453816);_0x55c35e(_0x1e4148[_0x3a9b('0x11')](0x1f4,_0x2a04d4['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index bcc1d63..3780585 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 _0xe706=['update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0xe706,0xa3));var _0x6e70=function(_0xfa716b,_0x1fa236){_0xfa716b=_0xfa716b-0x0;var _0xe946ab=_0xe706[_0xfa716b];return _0xe946ab;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x9')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router[_0x6e70('0x14')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=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(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 452501f..d384e26 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 _0x587f=['sequelize'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x587f,0x18e));var _0xf587=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0x587f[_0x2803dc];return _0x552ae4;};'use strict';var Sequelize=require(_0xf587('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x751b=['STRING','sequelize','exports'];(function(_0x30c46d,_0x166e62){var _0x23631e=function(_0x485f44){while(--_0x485f44){_0x30c46d['push'](_0x30c46d['shift']());}};_0x23631e(++_0x166e62);}(_0x751b,0x160));var _0xb751=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x751b[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xb751('0x0'));module[_0xb751('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb751('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 3135373..a1fe39e 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 _0x5178=['body','getFields','findOne','VtigerField','pick','options','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','name','index','VtigerConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','params','find','create'];(function(_0x246f57,_0x2fdf0a){var _0x565d50=function(_0xd0439e){while(--_0xd0439e){_0x246f57['push'](_0x246f57['shift']());}};_0x565d50(++_0x2fdf0a);}(_0x5178,0x171));var _0x8517=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x5178[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8517('0x0'));var rimraf=require(_0x8517('0x1'));var zipdir=require(_0x8517('0x2'));var jsonpatch=require(_0x8517('0x3'));var rp=require(_0x8517('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8517('0x5'));var util=require(_0x8517('0x6'));var path=require('path');var sox=require(_0x8517('0x7'));var csv=require('to-csv');var ejs=require(_0x8517('0x8'));var fs=require('fs');var _=require(_0x8517('0x9'));var squel=require(_0x8517('0xa'));var crypto=require(_0x8517('0xb'));var jsforce=require(_0x8517('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8517('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8517('0xe'));var authService=require(_0x8517('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8517('0x10'));var logger=require(_0x8517('0x11'))(_0x8517('0x12'));var utils=require(_0x8517('0x13'));var config=require(_0x8517('0x14'));var db=require(_0x8517('0x15'))['db'];var jayson=require(_0x8517('0x16'));var client=jayson[_0x8517('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x9c57de,_0x7f429a,_0x268128){if(_0x268128){var _0x170214=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x170214[_0x8517('0x18')](_0x7f429a)){return _0x9c57de;}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 _0x9c57de;}}function respondWithRpcPromise(_0x385219,_0x19dd9d,_0x126e0b,_0x100280){return new BPromise(function(_0x411d29,_0x18a984){var _0x260a15=_0x100280||client;return _0x260a15[_0x8517('0x19')](_0x385219,_0x126e0b)[_0x8517('0x1a')](function(_0x2953dd){logger[_0x8517('0x1b')](_0x8517('0x1c'),_0x19dd9d,'request\x20sent');logger[_0x8517('0x1d')](_0x8517('0x1e'),_0x19dd9d,_0x8517('0x1f'),JSON[_0x8517('0x20')](_0x2953dd));if(_0x2953dd[_0x8517('0x21')]){if(_0x2953dd[_0x8517('0x21')][_0x8517('0x22')]===0x1f4){logger['error'](_0x8517('0x1c'),_0x19dd9d,_0x2953dd['error']['message']);return _0x18a984(_0x2953dd[_0x8517('0x21')][_0x8517('0x23')]);}logger[_0x8517('0x21')](_0x8517('0x1c'),_0x19dd9d,_0x2953dd[_0x8517('0x21')][_0x8517('0x23')]);return _0x411d29(_0x2953dd['error']['message']);}else{logger[_0x8517('0x1b')](_0x8517('0x1c'),_0x19dd9d,_0x8517('0x1f'));_0x411d29(_0x2953dd[_0x8517('0x24')][_0x8517('0x23')]);}})[_0x8517('0x25')](function(_0x5f02ee){logger[_0x8517('0x21')](_0x8517('0x1c'),_0x19dd9d,_0x5f02ee);_0x18a984(_0x5f02ee);});});}function respondWithStatusCode(_0x5578f0,_0x7f4cf8){_0x7f4cf8=_0x7f4cf8||0xcc;return function(_0x2febd5){if(_0x2febd5){return _0x5578f0[_0x8517('0x26')](_0x7f4cf8);}return _0x5578f0['status'](_0x7f4cf8)[_0x8517('0x27')]();};}function respondWithResult(_0x572ce4,_0x2880b6){_0x2880b6=_0x2880b6||0xc8;return function(_0x2a2b7e){if(_0x2a2b7e){return _0x572ce4[_0x8517('0x28')](_0x2880b6)[_0x8517('0x29')](_0x2a2b7e);}};}function respondWithFilteredResult(_0x238f2c,_0x300e3f){return function(_0x481ceb){if(_0x481ceb){var _0x39764e=_0x481ceb[_0x8517('0x2a')],_0x51d516=_0x300e3f[_0x8517('0x2b')],_0x197aaf=_0x300e3f[_0x8517('0x2b')]+_0x300e3f[_0x8517('0x2c')],_0x70ee9d;if(_0x197aaf>=_0x39764e){_0x197aaf=_0x39764e;_0x70ee9d=0xc8;}else{_0x70ee9d=0xce;}_0x238f2c['status'](_0x70ee9d);return _0x238f2c[_0x8517('0x2d')]('Content-Range',_0x51d516+'-'+_0x197aaf+'/'+_0x39764e)[_0x8517('0x29')](_0x481ceb);}return null;};}function patchUpdates(_0x4b9983){return function(_0x1dd9fb){try{jsonpatch[_0x8517('0x2e')](_0x1dd9fb,_0x4b9983,!![]);}catch(_0x3cf945){return BPromise[_0x8517('0x2f')](_0x3cf945);}return _0x1dd9fb[_0x8517('0x30')]();};}function saveUpdates(_0x4100d5,_0x647d81){return function(_0x559707){if(_0x559707){return _0x559707[_0x8517('0x31')](_0x4100d5)[_0x8517('0x1a')](function(_0x773e3c){return _0x773e3c;});}return null;};}function removeEntity(_0x53c009,_0x5db173){return function(_0x5cb78c){if(_0x5cb78c){return _0x5cb78c[_0x8517('0x32')]()[_0x8517('0x1a')](function(){_0x53c009[_0x8517('0x28')](0xcc)[_0x8517('0x27')]();});}};}function handleEntityNotFound(_0x5ed2a9,_0x254566){return function(_0x5d9d04){if(!_0x5d9d04){_0x5ed2a9[_0x8517('0x26')](0x194);}return _0x5d9d04;};}function handleError(_0x234da4,_0x3fc3aa){_0x3fc3aa=_0x3fc3aa||0x1f4;return function(_0x55785d){logger[_0x8517('0x21')](_0x55785d['stack']);if(_0x55785d[_0x8517('0x33')]){delete _0x55785d[_0x8517('0x33')];}_0x234da4['status'](_0x3fc3aa)['send'](_0x55785d);};}exports[_0x8517('0x34')]=function(_0x27edbe,_0x2c1292){var _0x67c412={},_0x4f93bd={},_0x5b1d34={'count':0x0,'rows':[]};var _0x2cb889=db[_0x8517('0x35')][_0x8517('0x36')];_0x4f93bd['model']=_[_0x8517('0x37')](_0x2cb889);_0x4f93bd[_0x8517('0x38')]=_['keys'](_0x27edbe[_0x8517('0x38')]);_0x4f93bd[_0x8517('0x39')]=_[_0x8517('0x3a')](_0x4f93bd[_0x8517('0x3b')],_0x4f93bd['query']);_0x67c412[_0x8517('0x3c')]=_[_0x8517('0x3a')](_0x4f93bd[_0x8517('0x3b')],qs[_0x8517('0x3d')](_0x27edbe[_0x8517('0x38')][_0x8517('0x3d')]));_0x67c412[_0x8517('0x3c')]=_0x67c412[_0x8517('0x3c')][_0x8517('0x3e')]?_0x67c412[_0x8517('0x3c')]:_0x4f93bd[_0x8517('0x3b')];if(!_0x27edbe[_0x8517('0x38')][_0x8517('0x3f')]('nolimit')){_0x67c412['limit']=qs[_0x8517('0x2c')](_0x27edbe[_0x8517('0x38')][_0x8517('0x2c')]);_0x67c412[_0x8517('0x2b')]=qs[_0x8517('0x2b')](_0x27edbe['query'][_0x8517('0x2b')]);}_0x67c412[_0x8517('0x40')]=qs['sort'](_0x27edbe[_0x8517('0x38')][_0x8517('0x41')]);_0x67c412[_0x8517('0x42')]=qs[_0x8517('0x39')](_['pick'](_0x27edbe[_0x8517('0x38')],_0x4f93bd[_0x8517('0x39')]));if(_0x27edbe['query'][_0x8517('0x43')]){_0x67c412[_0x8517('0x42')]=_[_0x8517('0x44')](_0x67c412['where'],{'$or':_[_0x8517('0x45')](_0x2cb889,function(_0x31c0b9){if(_0x31c0b9[_0x8517('0x46')][_0x8517('0x47')]!==_0x8517('0x48')){var _0x1f4648={};_0x1f4648[_0x31c0b9[_0x8517('0x49')]]={'$like':'%'+_0x27edbe['query'][_0x8517('0x43')]+'%'};return _0x1f4648;}})});}_0x67c412=_[_0x8517('0x44')]({},_0x67c412,_0x27edbe['options']);var _0x326323={'where':_0x67c412[_0x8517('0x42')]};return db[_0x8517('0x35')][_0x8517('0x2a')](_0x326323)[_0x8517('0x1a')](function(_0x29ab7b){_0x5b1d34['count']=_0x29ab7b;if(_0x27edbe[_0x8517('0x38')][_0x8517('0x4a')]){_0x67c412[_0x8517('0x4b')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x8517('0x4c')](_0x67c412);})[_0x8517('0x1a')](function(_0x56d08b){_0x5b1d34[_0x8517('0x4d')]=_0x56d08b;return _0x5b1d34;})[_0x8517('0x1a')](respondWithFilteredResult(_0x2c1292,_0x67c412))['catch'](handleError(_0x2c1292,null));};exports['show']=function(_0x560e3a,_0x1dd87c){var _0x250a14={'raw':![],'where':{'id':_0x560e3a[_0x8517('0x4e')]['id']}},_0x4ec257={};_0x4ec257['model']=_['keys'](db[_0x8517('0x35')][_0x8517('0x36')]);_0x4ec257[_0x8517('0x38')]=_[_0x8517('0x37')](_0x560e3a['query']);_0x4ec257[_0x8517('0x39')]=_[_0x8517('0x3a')](_0x4ec257[_0x8517('0x3b')],_0x4ec257['query']);_0x250a14[_0x8517('0x3c')]=_[_0x8517('0x3a')](_0x4ec257[_0x8517('0x3b')],qs[_0x8517('0x3d')](_0x560e3a[_0x8517('0x38')][_0x8517('0x3d')]));_0x250a14[_0x8517('0x3c')]=_0x250a14['attributes'][_0x8517('0x3e')]?_0x250a14['attributes']:_0x4ec257['model'];if(_0x560e3a[_0x8517('0x38')][_0x8517('0x4a')]){_0x250a14[_0x8517('0x4b')]=[{'all':!![]}];}_0x250a14=_[_0x8517('0x44')]({},_0x250a14,_0x560e3a['options']);return db[_0x8517('0x35')][_0x8517('0x4f')](_0x250a14)['then'](handleEntityNotFound(_0x1dd87c,null))['then'](respondWithResult(_0x1dd87c,null))[_0x8517('0x25')](handleError(_0x1dd87c,null));};exports[_0x8517('0x50')]=function(_0x28c1fb,_0x53b617){return db[_0x8517('0x35')]['create'](_0x28c1fb[_0x8517('0x51')],{})[_0x8517('0x1a')](respondWithResult(_0x53b617,0xc9))[_0x8517('0x25')](handleError(_0x53b617,null));};exports[_0x8517('0x31')]=function(_0x2a2cac,_0x126082){if(_0x2a2cac[_0x8517('0x51')]['id']){delete _0x2a2cac[_0x8517('0x51')]['id'];}return db[_0x8517('0x35')]['find']({'where':{'id':_0x2a2cac['params']['id']}})[_0x8517('0x1a')](handleEntityNotFound(_0x126082,null))[_0x8517('0x1a')](saveUpdates(_0x2a2cac[_0x8517('0x51')],null))['then'](respondWithResult(_0x126082,null))[_0x8517('0x25')](handleError(_0x126082,null));};exports[_0x8517('0x32')]=function(_0x445f9b,_0x4cc9e2){return db['VtigerConfiguration'][_0x8517('0x4f')]({'where':{'id':_0x445f9b[_0x8517('0x4e')]['id']}})[_0x8517('0x1a')](handleEntityNotFound(_0x4cc9e2,null))[_0x8517('0x1a')](removeEntity(_0x4cc9e2,null))[_0x8517('0x25')](handleError(_0x4cc9e2,null));};exports[_0x8517('0x52')]=function(_0x3d8773,_0x123504,_0xb87fa1){var _0x343b20={};var _0x3f6f67={};var _0x3c5462;var _0xf303bb;return db[_0x8517('0x35')][_0x8517('0x53')]({'where':{'id':_0x3d8773[_0x8517('0x4e')]['id']}})['then'](handleEntityNotFound(_0x123504,null))[_0x8517('0x1a')](function(_0x9b0b48){if(_0x9b0b48){_0x3c5462=_0x9b0b48;_0x3f6f67[_0x8517('0x3b')]=_[_0x8517('0x37')](db[_0x8517('0x54')][_0x8517('0x36')]);_0x3f6f67[_0x8517('0x38')]=_['keys'](_0x3d8773[_0x8517('0x38')]);_0x3f6f67[_0x8517('0x39')]=_[_0x8517('0x3a')](_0x3f6f67[_0x8517('0x3b')],_0x3f6f67[_0x8517('0x38')]);_0x343b20['attributes']=_[_0x8517('0x3a')](_0x3f6f67['model'],qs[_0x8517('0x3d')](_0x3d8773[_0x8517('0x38')][_0x8517('0x3d')]));_0x343b20[_0x8517('0x3c')]=_0x343b20[_0x8517('0x3c')]['length']?_0x343b20[_0x8517('0x3c')]:_0x3f6f67[_0x8517('0x3b')];_0x343b20[_0x8517('0x40')]=qs[_0x8517('0x41')](_0x3d8773['query']['sort']);_0x343b20[_0x8517('0x42')]=qs['filters'](_[_0x8517('0x55')](_0x3d8773[_0x8517('0x38')],_0x3f6f67['filters']));if(_0x3d8773[_0x8517('0x38')][_0x8517('0x43')]){_0x343b20['where']=_[_0x8517('0x44')](_0x343b20[_0x8517('0x42')],{'$or':_[_0x8517('0x45')](_0x343b20[_0x8517('0x3c')],function(_0x836e5d){var _0x30260f={};_0x30260f[_0x836e5d]={'$like':'%'+_0x3d8773[_0x8517('0x38')][_0x8517('0x43')]+'%'};return _0x30260f;})});}_0x343b20=_['merge']({},_0x343b20,_0x3d8773[_0x8517('0x56')]);return _0x3c5462[_0x8517('0x52')](_0x343b20);}})[_0x8517('0x1a')](function(_0x1b9c97){if(_0x1b9c97){_0xf303bb=_0x1b9c97['length'];if(!_0x3d8773[_0x8517('0x38')]['hasOwnProperty'](_0x8517('0x57'))){_0x343b20[_0x8517('0x2c')]=qs[_0x8517('0x2c')](_0x3d8773[_0x8517('0x38')]['limit']);_0x343b20['offset']=qs[_0x8517('0x2b')](_0x3d8773[_0x8517('0x38')][_0x8517('0x2b')]);}return _0x3c5462[_0x8517('0x52')](_0x343b20);}})['then'](function(_0x11a801){if(_0x11a801){return _0x11a801?{'count':_0xf303bb,'rows':_0x11a801}:null;}})[_0x8517('0x1a')](respondWithResult(_0x123504,null))[_0x8517('0x25')](handleError(_0x123504,null));};exports[_0x8517('0x58')]=function(_0x1de091,_0x38f15f,_0x2f105f){var _0x3b7aea={};var _0x3347a9={};var _0x3d089c;var _0x4bdb9f;return db[_0x8517('0x35')][_0x8517('0x53')]({'where':{'id':_0x1de091[_0x8517('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38f15f,null))[_0x8517('0x1a')](function(_0x58f10a){if(_0x58f10a){_0x3d089c=_0x58f10a;_0x3347a9[_0x8517('0x3b')]=_[_0x8517('0x37')](db['VtigerField'][_0x8517('0x36')]);_0x3347a9[_0x8517('0x38')]=_[_0x8517('0x37')](_0x1de091[_0x8517('0x38')]);_0x3347a9[_0x8517('0x39')]=_[_0x8517('0x3a')](_0x3347a9['model'],_0x3347a9[_0x8517('0x38')]);_0x3b7aea['attributes']=_[_0x8517('0x3a')](_0x3347a9[_0x8517('0x3b')],qs[_0x8517('0x3d')](_0x1de091[_0x8517('0x38')]['fields']));_0x3b7aea[_0x8517('0x3c')]=_0x3b7aea[_0x8517('0x3c')][_0x8517('0x3e')]?_0x3b7aea['attributes']:_0x3347a9[_0x8517('0x3b')];_0x3b7aea[_0x8517('0x40')]=qs[_0x8517('0x41')](_0x1de091[_0x8517('0x38')][_0x8517('0x41')]);_0x3b7aea[_0x8517('0x42')]=qs[_0x8517('0x39')](_['pick'](_0x1de091[_0x8517('0x38')],_0x3347a9['filters']));if(_0x1de091['query'][_0x8517('0x43')]){_0x3b7aea[_0x8517('0x42')]=_[_0x8517('0x44')](_0x3b7aea['where'],{'$or':_[_0x8517('0x45')](_0x3b7aea[_0x8517('0x3c')],function(_0x55403d){var _0x1c83e7={};_0x1c83e7[_0x55403d]={'$like':'%'+_0x1de091['query']['filter']+'%'};return _0x1c83e7;})});}_0x3b7aea=_[_0x8517('0x44')]({},_0x3b7aea,_0x1de091[_0x8517('0x56')]);return _0x3d089c[_0x8517('0x58')](_0x3b7aea);}})[_0x8517('0x1a')](function(_0x37896a){if(_0x37896a){_0x4bdb9f=_0x37896a['length'];if(!_0x1de091[_0x8517('0x38')][_0x8517('0x3f')]('nolimit')){_0x3b7aea['limit']=qs[_0x8517('0x2c')](_0x1de091[_0x8517('0x38')][_0x8517('0x2c')]);_0x3b7aea[_0x8517('0x2b')]=qs[_0x8517('0x2b')](_0x1de091[_0x8517('0x38')]['offset']);}return _0x3d089c['getSubjects'](_0x3b7aea);}})[_0x8517('0x1a')](function(_0x1c0cfc){if(_0x1c0cfc){return _0x1c0cfc?{'count':_0x4bdb9f,'rows':_0x1c0cfc}:null;}})['then'](respondWithResult(_0x38f15f,null))[_0x8517('0x25')](handleError(_0x38f15f,null));};exports[_0x8517('0x59')]=function(_0x577a90,_0x3a0597,_0x3304ee){var _0x3c1b7e={};var _0x590a99={};var _0x5195a2;var _0x3cb505;return db[_0x8517('0x35')][_0x8517('0x53')]({'where':{'id':_0x577a90[_0x8517('0x4e')]['id']}})[_0x8517('0x1a')](handleEntityNotFound(_0x3a0597,null))['then'](function(_0x782f1d){if(_0x782f1d){_0x5195a2=_0x782f1d;_0x590a99[_0x8517('0x3b')]=_['keys'](db[_0x8517('0x54')][_0x8517('0x36')]);_0x590a99[_0x8517('0x38')]=_[_0x8517('0x37')](_0x577a90[_0x8517('0x38')]);_0x590a99[_0x8517('0x39')]=_[_0x8517('0x3a')](_0x590a99[_0x8517('0x3b')],_0x590a99[_0x8517('0x38')]);_0x3c1b7e[_0x8517('0x3c')]=_[_0x8517('0x3a')](_0x590a99[_0x8517('0x3b')],qs[_0x8517('0x3d')](_0x577a90[_0x8517('0x38')][_0x8517('0x3d')]));_0x3c1b7e[_0x8517('0x3c')]=_0x3c1b7e[_0x8517('0x3c')][_0x8517('0x3e')]?_0x3c1b7e[_0x8517('0x3c')]:_0x590a99['model'];_0x3c1b7e[_0x8517('0x40')]=qs[_0x8517('0x41')](_0x577a90[_0x8517('0x38')][_0x8517('0x41')]);_0x3c1b7e[_0x8517('0x42')]=qs[_0x8517('0x39')](_[_0x8517('0x55')](_0x577a90['query'],_0x590a99[_0x8517('0x39')]));if(_0x577a90[_0x8517('0x38')][_0x8517('0x43')]){_0x3c1b7e[_0x8517('0x42')]=_[_0x8517('0x44')](_0x3c1b7e[_0x8517('0x42')],{'$or':_['map'](_0x3c1b7e[_0x8517('0x3c')],function(_0x360df5){var _0x40ad1e={};_0x40ad1e[_0x360df5]={'$like':'%'+_0x577a90[_0x8517('0x38')][_0x8517('0x43')]+'%'};return _0x40ad1e;})});}_0x3c1b7e=_['merge']({},_0x3c1b7e,_0x577a90[_0x8517('0x56')]);return _0x5195a2[_0x8517('0x59')](_0x3c1b7e);}})[_0x8517('0x1a')](function(_0x26ade2){if(_0x26ade2){_0x3cb505=_0x26ade2['length'];if(!_0x577a90[_0x8517('0x38')]['hasOwnProperty'](_0x8517('0x57'))){_0x3c1b7e[_0x8517('0x2c')]=qs[_0x8517('0x2c')](_0x577a90[_0x8517('0x38')][_0x8517('0x2c')]);_0x3c1b7e[_0x8517('0x2b')]=qs[_0x8517('0x2b')](_0x577a90[_0x8517('0x38')][_0x8517('0x2b')]);}return _0x5195a2['getDescriptions'](_0x3c1b7e);}})[_0x8517('0x1a')](function(_0x23445b){if(_0x23445b){return _0x23445b?{'count':_0x3cb505,'rows':_0x23445b}:null;}})[_0x8517('0x1a')](respondWithResult(_0x3a0597,null))[_0x8517('0x25')](handleError(_0x3a0597,null));}; \ No newline at end of file +var _0xf776=['includeAll','include','rows','params','find','create','body','getFields','VtigerField','hasOwnProperty','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','destroy','stack','name','send','index','VtigerConfiguration','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','field','options'];(function(_0x2a4a05,_0x12a838){var _0x5edf87=function(_0x17777f){while(--_0x17777f){_0x2a4a05['push'](_0x2a4a05['shift']());}};_0x5edf87(++_0x12a838);}(_0xf776,0x169));var _0x6f77=function(_0x568145,_0x5c65e9){_0x568145=_0x568145-0x0;var _0x2c22a1=_0xf776[_0x568145];return _0x2c22a1;};'use strict';var pdf=require(_0x6f77('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f77('0x1'));var zipdir=require(_0x6f77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f77('0x3'));var moment=require(_0x6f77('0x4'));var BPromise=require(_0x6f77('0x5'));var Mustache=require(_0x6f77('0x6'));var util=require('util');var path=require(_0x6f77('0x7'));var sox=require('sox');var csv=require(_0x6f77('0x8'));var ejs=require(_0x6f77('0x9'));var fs=require('fs');var _=require(_0x6f77('0xa'));var squel=require(_0x6f77('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f77('0x8'));var querystring=require(_0x6f77('0xd'));var Papa=require(_0x6f77('0xe'));var Redis=require(_0x6f77('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6f77('0x10'));var hardwareService=require(_0x6f77('0x11'));var logger=require(_0x6f77('0x12'))(_0x6f77('0x13'));var utils=require(_0x6f77('0x14'));var config=require(_0x6f77('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6f77('0x16'));var client=jayson[_0x6f77('0x17')][_0x6f77('0x18')]({'port':0x232a});function checkPasswordPattern(_0x17fda5,_0x413e19,_0x17cb33){if(_0x17cb33){var _0x276d6e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x276d6e[_0x6f77('0x19')](_0x413e19)){return _0x17fda5;}else{throw new Error(_0x6f77('0x1a'));}}else{return _0x17fda5;}}function respondWithRpcPromise(_0x28e354,_0x386c51,_0x811d22,_0x592079){return new BPromise(function(_0x48c26c,_0x17c0a5){var _0x2b9b87=_0x592079||client;return _0x2b9b87['request'](_0x28e354,_0x811d22)[_0x6f77('0x1b')](function(_0x55bb85){logger[_0x6f77('0x1c')](_0x6f77('0x1d'),_0x386c51,'request\x20sent');logger['debug'](_0x6f77('0x1e'),_0x386c51,_0x6f77('0x1f'),JSON[_0x6f77('0x20')](_0x55bb85));if(_0x55bb85[_0x6f77('0x21')]){if(_0x55bb85[_0x6f77('0x21')][_0x6f77('0x22')]===0x1f4){logger[_0x6f77('0x21')](_0x6f77('0x1d'),_0x386c51,_0x55bb85['error'][_0x6f77('0x23')]);return _0x17c0a5(_0x55bb85[_0x6f77('0x21')][_0x6f77('0x23')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x386c51,_0x55bb85[_0x6f77('0x21')][_0x6f77('0x23')]);return _0x48c26c(_0x55bb85['error'][_0x6f77('0x23')]);}else{logger[_0x6f77('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0x386c51,_0x6f77('0x1f'));_0x48c26c(_0x55bb85[_0x6f77('0x24')][_0x6f77('0x23')]);}})[_0x6f77('0x25')](function(_0x2c0cb2){logger['error'](_0x6f77('0x1d'),_0x386c51,_0x2c0cb2);_0x17c0a5(_0x2c0cb2);});});}function respondWithStatusCode(_0x2cedee,_0x323f4b){_0x323f4b=_0x323f4b||0xcc;return function(_0x12a179){if(_0x12a179){return _0x2cedee[_0x6f77('0x26')](_0x323f4b);}return _0x2cedee[_0x6f77('0x27')](_0x323f4b)[_0x6f77('0x28')]();};}function respondWithResult(_0x502965,_0x4a35d0){_0x4a35d0=_0x4a35d0||0xc8;return function(_0x1f4af8){if(_0x1f4af8){return _0x502965[_0x6f77('0x27')](_0x4a35d0)[_0x6f77('0x29')](_0x1f4af8);}};}function respondWithFilteredResult(_0x45fc8b,_0x30c745){return function(_0x250254){if(_0x250254){var _0x4ff7aa=_0x250254[_0x6f77('0x2a')],_0x502306=_0x30c745[_0x6f77('0x2b')],_0x4107b7=_0x30c745[_0x6f77('0x2b')]+_0x30c745[_0x6f77('0x2c')],_0x3904f9;if(_0x4107b7>=_0x4ff7aa){_0x4107b7=_0x4ff7aa;_0x3904f9=0xc8;}else{_0x3904f9=0xce;}_0x45fc8b[_0x6f77('0x27')](_0x3904f9);return _0x45fc8b[_0x6f77('0x2d')]('Content-Range',_0x502306+'-'+_0x4107b7+'/'+_0x4ff7aa)['json'](_0x250254);}return null;};}function patchUpdates(_0x36d9d8){return function(_0x1fe6c3){try{jsonpatch[_0x6f77('0x2e')](_0x1fe6c3,_0x36d9d8,!![]);}catch(_0x438cbb){return BPromise[_0x6f77('0x2f')](_0x438cbb);}return _0x1fe6c3['save']();};}function saveUpdates(_0x80025a,_0x28cc44){return function(_0x1495ba){if(_0x1495ba){return _0x1495ba['update'](_0x80025a)[_0x6f77('0x1b')](function(_0x5bea99){return _0x5bea99;});}return null;};}function removeEntity(_0x49adce,_0x278f06){return function(_0x363a51){if(_0x363a51){return _0x363a51[_0x6f77('0x30')]()[_0x6f77('0x1b')](function(){_0x49adce[_0x6f77('0x27')](0xcc)[_0x6f77('0x28')]();});}};}function handleEntityNotFound(_0x33c69a,_0x3fa923){return function(_0x2695d4){if(!_0x2695d4){_0x33c69a['sendStatus'](0x194);}return _0x2695d4;};}function handleError(_0x3a3c39,_0x59cdbc){_0x59cdbc=_0x59cdbc||0x1f4;return function(_0x189293){logger['error'](_0x189293[_0x6f77('0x31')]);if(_0x189293[_0x6f77('0x32')]){delete _0x189293['name'];}_0x3a3c39[_0x6f77('0x27')](_0x59cdbc)[_0x6f77('0x33')](_0x189293);};}exports[_0x6f77('0x34')]=function(_0x42f484,_0x26cdc8){var _0x55ea57={},_0x222c8b={},_0x347d37={'count':0x0,'rows':[]};var _0x28dcff=db[_0x6f77('0x35')][_0x6f77('0x36')];_0x222c8b['model']=_[_0x6f77('0x37')](_0x28dcff);_0x222c8b[_0x6f77('0x38')]=_[_0x6f77('0x37')](_0x42f484[_0x6f77('0x38')]);_0x222c8b[_0x6f77('0x39')]=_['intersection'](_0x222c8b[_0x6f77('0x3a')],_0x222c8b['query']);_0x55ea57[_0x6f77('0x3b')]=_[_0x6f77('0x3c')](_0x222c8b[_0x6f77('0x3a')],qs[_0x6f77('0x3d')](_0x42f484[_0x6f77('0x38')]['fields']));_0x55ea57[_0x6f77('0x3b')]=_0x55ea57[_0x6f77('0x3b')][_0x6f77('0x3e')]?_0x55ea57['attributes']:_0x222c8b[_0x6f77('0x3a')];if(!_0x42f484[_0x6f77('0x38')]['hasOwnProperty'](_0x6f77('0x3f'))){_0x55ea57[_0x6f77('0x2c')]=qs[_0x6f77('0x2c')](_0x42f484[_0x6f77('0x38')][_0x6f77('0x2c')]);_0x55ea57['offset']=qs[_0x6f77('0x2b')](_0x42f484[_0x6f77('0x38')]['offset']);}_0x55ea57[_0x6f77('0x40')]=qs['sort'](_0x42f484[_0x6f77('0x38')][_0x6f77('0x41')]);_0x55ea57[_0x6f77('0x42')]=qs[_0x6f77('0x39')](_[_0x6f77('0x43')](_0x42f484[_0x6f77('0x38')],_0x222c8b[_0x6f77('0x39')]));if(_0x42f484[_0x6f77('0x38')][_0x6f77('0x44')]){_0x55ea57['where']=_[_0x6f77('0x45')](_0x55ea57[_0x6f77('0x42')],{'$or':_['map'](_0x28dcff,function(_0x509810){if(_0x509810[_0x6f77('0x46')][_0x6f77('0x47')]!=='VIRTUAL'){var _0x2c158c={};_0x2c158c[_0x509810[_0x6f77('0x48')]]={'$like':'%'+_0x42f484[_0x6f77('0x38')][_0x6f77('0x44')]+'%'};return _0x2c158c;}})});}_0x55ea57=_[_0x6f77('0x45')]({},_0x55ea57,_0x42f484[_0x6f77('0x49')]);var _0x4fae76={'where':_0x55ea57['where']};return db[_0x6f77('0x35')][_0x6f77('0x2a')](_0x4fae76)[_0x6f77('0x1b')](function(_0x561547){_0x347d37[_0x6f77('0x2a')]=_0x561547;if(_0x42f484[_0x6f77('0x38')][_0x6f77('0x4a')]){_0x55ea57[_0x6f77('0x4b')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x55ea57);})['then'](function(_0x4c3dd0){_0x347d37[_0x6f77('0x4c')]=_0x4c3dd0;return _0x347d37;})[_0x6f77('0x1b')](respondWithFilteredResult(_0x26cdc8,_0x55ea57))[_0x6f77('0x25')](handleError(_0x26cdc8,null));};exports['show']=function(_0x42af1f,_0x5d0568){var _0x2c5ddd={'raw':![],'where':{'id':_0x42af1f[_0x6f77('0x4d')]['id']}},_0x39547a={};_0x39547a[_0x6f77('0x3a')]=_[_0x6f77('0x37')](db['VtigerConfiguration'][_0x6f77('0x36')]);_0x39547a[_0x6f77('0x38')]=_['keys'](_0x42af1f[_0x6f77('0x38')]);_0x39547a['filters']=_['intersection'](_0x39547a[_0x6f77('0x3a')],_0x39547a[_0x6f77('0x38')]);_0x2c5ddd[_0x6f77('0x3b')]=_[_0x6f77('0x3c')](_0x39547a[_0x6f77('0x3a')],qs[_0x6f77('0x3d')](_0x42af1f[_0x6f77('0x38')][_0x6f77('0x3d')]));_0x2c5ddd[_0x6f77('0x3b')]=_0x2c5ddd['attributes']['length']?_0x2c5ddd[_0x6f77('0x3b')]:_0x39547a['model'];if(_0x42af1f[_0x6f77('0x38')][_0x6f77('0x4a')]){_0x2c5ddd['include']=[{'all':!![]}];}_0x2c5ddd=_[_0x6f77('0x45')]({},_0x2c5ddd,_0x42af1f[_0x6f77('0x49')]);return db[_0x6f77('0x35')][_0x6f77('0x4e')](_0x2c5ddd)[_0x6f77('0x1b')](handleEntityNotFound(_0x5d0568,null))[_0x6f77('0x1b')](respondWithResult(_0x5d0568,null))[_0x6f77('0x25')](handleError(_0x5d0568,null));};exports[_0x6f77('0x4f')]=function(_0x22ad86,_0x6f3541){return db[_0x6f77('0x35')][_0x6f77('0x4f')](_0x22ad86['body'],{})[_0x6f77('0x1b')](respondWithResult(_0x6f3541,0xc9))[_0x6f77('0x25')](handleError(_0x6f3541,null));};exports['update']=function(_0xf1bbb5,_0x8e9fc9){if(_0xf1bbb5[_0x6f77('0x50')]['id']){delete _0xf1bbb5[_0x6f77('0x50')]['id'];}return db[_0x6f77('0x35')][_0x6f77('0x4e')]({'where':{'id':_0xf1bbb5[_0x6f77('0x4d')]['id']}})[_0x6f77('0x1b')](handleEntityNotFound(_0x8e9fc9,null))[_0x6f77('0x1b')](saveUpdates(_0xf1bbb5[_0x6f77('0x50')],null))[_0x6f77('0x1b')](respondWithResult(_0x8e9fc9,null))[_0x6f77('0x25')](handleError(_0x8e9fc9,null));};exports[_0x6f77('0x30')]=function(_0x133c37,_0x5b6382){return db['VtigerConfiguration'][_0x6f77('0x4e')]({'where':{'id':_0x133c37[_0x6f77('0x4d')]['id']}})[_0x6f77('0x1b')](handleEntityNotFound(_0x5b6382,null))['then'](removeEntity(_0x5b6382,null))[_0x6f77('0x25')](handleError(_0x5b6382,null));};exports[_0x6f77('0x51')]=function(_0x121152,_0xd49933,_0x374b1c){var _0x5c7f2d={};var _0x3187f6={};var _0x179d4d;var _0x571376;return db[_0x6f77('0x35')]['findOne']({'where':{'id':_0x121152[_0x6f77('0x4d')]['id']}})[_0x6f77('0x1b')](handleEntityNotFound(_0xd49933,null))['then'](function(_0x49cf71){if(_0x49cf71){_0x179d4d=_0x49cf71;_0x3187f6[_0x6f77('0x3a')]=_[_0x6f77('0x37')](db[_0x6f77('0x52')]['rawAttributes']);_0x3187f6['query']=_['keys'](_0x121152[_0x6f77('0x38')]);_0x3187f6[_0x6f77('0x39')]=_[_0x6f77('0x3c')](_0x3187f6['model'],_0x3187f6[_0x6f77('0x38')]);_0x5c7f2d[_0x6f77('0x3b')]=_[_0x6f77('0x3c')](_0x3187f6['model'],qs[_0x6f77('0x3d')](_0x121152[_0x6f77('0x38')][_0x6f77('0x3d')]));_0x5c7f2d['attributes']=_0x5c7f2d['attributes'][_0x6f77('0x3e')]?_0x5c7f2d[_0x6f77('0x3b')]:_0x3187f6['model'];_0x5c7f2d['order']=qs[_0x6f77('0x41')](_0x121152[_0x6f77('0x38')]['sort']);_0x5c7f2d['where']=qs['filters'](_['pick'](_0x121152[_0x6f77('0x38')],_0x3187f6[_0x6f77('0x39')]));if(_0x121152[_0x6f77('0x38')][_0x6f77('0x44')]){_0x5c7f2d[_0x6f77('0x42')]=_[_0x6f77('0x45')](_0x5c7f2d[_0x6f77('0x42')],{'$or':_['map'](_0x5c7f2d[_0x6f77('0x3b')],function(_0x30ba4b){var _0x5d22e8={};_0x5d22e8[_0x30ba4b]={'$like':'%'+_0x121152[_0x6f77('0x38')]['filter']+'%'};return _0x5d22e8;})});}_0x5c7f2d=_['merge']({},_0x5c7f2d,_0x121152[_0x6f77('0x49')]);return _0x179d4d['getFields'](_0x5c7f2d);}})[_0x6f77('0x1b')](function(_0xdd9d62){if(_0xdd9d62){_0x571376=_0xdd9d62[_0x6f77('0x3e')];if(!_0x121152[_0x6f77('0x38')][_0x6f77('0x53')](_0x6f77('0x3f'))){_0x5c7f2d[_0x6f77('0x2c')]=qs['limit'](_0x121152[_0x6f77('0x38')][_0x6f77('0x2c')]);_0x5c7f2d[_0x6f77('0x2b')]=qs['offset'](_0x121152[_0x6f77('0x38')][_0x6f77('0x2b')]);}return _0x179d4d[_0x6f77('0x51')](_0x5c7f2d);}})[_0x6f77('0x1b')](function(_0x3846bc){if(_0x3846bc){return _0x3846bc?{'count':_0x571376,'rows':_0x3846bc}:null;}})['then'](respondWithResult(_0xd49933,null))[_0x6f77('0x25')](handleError(_0xd49933,null));};exports[_0x6f77('0x54')]=function(_0x239ea5,_0x4f3bd9,_0x22aa9e){var _0x4d658d={};var _0x3289c1={};var _0x3a3927;var _0x130c64;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x239ea5['params']['id']}})[_0x6f77('0x1b')](handleEntityNotFound(_0x4f3bd9,null))[_0x6f77('0x1b')](function(_0xc01c41){if(_0xc01c41){_0x3a3927=_0xc01c41;_0x3289c1[_0x6f77('0x3a')]=_[_0x6f77('0x37')](db['VtigerField']['rawAttributes']);_0x3289c1[_0x6f77('0x38')]=_[_0x6f77('0x37')](_0x239ea5[_0x6f77('0x38')]);_0x3289c1[_0x6f77('0x39')]=_[_0x6f77('0x3c')](_0x3289c1[_0x6f77('0x3a')],_0x3289c1['query']);_0x4d658d[_0x6f77('0x3b')]=_['intersection'](_0x3289c1[_0x6f77('0x3a')],qs[_0x6f77('0x3d')](_0x239ea5['query'][_0x6f77('0x3d')]));_0x4d658d['attributes']=_0x4d658d[_0x6f77('0x3b')][_0x6f77('0x3e')]?_0x4d658d[_0x6f77('0x3b')]:_0x3289c1['model'];_0x4d658d[_0x6f77('0x40')]=qs[_0x6f77('0x41')](_0x239ea5['query'][_0x6f77('0x41')]);_0x4d658d[_0x6f77('0x42')]=qs['filters'](_[_0x6f77('0x43')](_0x239ea5[_0x6f77('0x38')],_0x3289c1['filters']));if(_0x239ea5['query'][_0x6f77('0x44')]){_0x4d658d['where']=_[_0x6f77('0x45')](_0x4d658d['where'],{'$or':_['map'](_0x4d658d[_0x6f77('0x3b')],function(_0x129364){var _0x3d3951={};_0x3d3951[_0x129364]={'$like':'%'+_0x239ea5['query'][_0x6f77('0x44')]+'%'};return _0x3d3951;})});}_0x4d658d=_['merge']({},_0x4d658d,_0x239ea5['options']);return _0x3a3927['getSubjects'](_0x4d658d);}})[_0x6f77('0x1b')](function(_0x11e619){if(_0x11e619){_0x130c64=_0x11e619[_0x6f77('0x3e')];if(!_0x239ea5[_0x6f77('0x38')]['hasOwnProperty'](_0x6f77('0x3f'))){_0x4d658d[_0x6f77('0x2c')]=qs[_0x6f77('0x2c')](_0x239ea5[_0x6f77('0x38')][_0x6f77('0x2c')]);_0x4d658d[_0x6f77('0x2b')]=qs[_0x6f77('0x2b')](_0x239ea5[_0x6f77('0x38')]['offset']);}return _0x3a3927[_0x6f77('0x54')](_0x4d658d);}})['then'](function(_0x2f0e24){if(_0x2f0e24){return _0x2f0e24?{'count':_0x130c64,'rows':_0x2f0e24}:null;}})[_0x6f77('0x1b')](respondWithResult(_0x4f3bd9,null))[_0x6f77('0x25')](handleError(_0x4f3bd9,null));};exports['getDescriptions']=function(_0x2c1eda,_0x1b0985,_0x5dcca1){var _0x345d46={};var _0x489cf6={};var _0x15d233;var _0x689191;return db[_0x6f77('0x35')][_0x6f77('0x55')]({'where':{'id':_0x2c1eda[_0x6f77('0x4d')]['id']}})[_0x6f77('0x1b')](handleEntityNotFound(_0x1b0985,null))[_0x6f77('0x1b')](function(_0xb69bc2){if(_0xb69bc2){_0x15d233=_0xb69bc2;_0x489cf6[_0x6f77('0x3a')]=_['keys'](db[_0x6f77('0x52')][_0x6f77('0x36')]);_0x489cf6[_0x6f77('0x38')]=_[_0x6f77('0x37')](_0x2c1eda[_0x6f77('0x38')]);_0x489cf6[_0x6f77('0x39')]=_[_0x6f77('0x3c')](_0x489cf6[_0x6f77('0x3a')],_0x489cf6[_0x6f77('0x38')]);_0x345d46['attributes']=_['intersection'](_0x489cf6[_0x6f77('0x3a')],qs[_0x6f77('0x3d')](_0x2c1eda[_0x6f77('0x38')][_0x6f77('0x3d')]));_0x345d46[_0x6f77('0x3b')]=_0x345d46[_0x6f77('0x3b')]['length']?_0x345d46[_0x6f77('0x3b')]:_0x489cf6[_0x6f77('0x3a')];_0x345d46['order']=qs['sort'](_0x2c1eda[_0x6f77('0x38')][_0x6f77('0x41')]);_0x345d46[_0x6f77('0x42')]=qs['filters'](_[_0x6f77('0x43')](_0x2c1eda[_0x6f77('0x38')],_0x489cf6[_0x6f77('0x39')]));if(_0x2c1eda[_0x6f77('0x38')][_0x6f77('0x44')]){_0x345d46['where']=_[_0x6f77('0x45')](_0x345d46[_0x6f77('0x42')],{'$or':_['map'](_0x345d46[_0x6f77('0x3b')],function(_0x4ac0ab){var _0x12d80f={};_0x12d80f[_0x4ac0ab]={'$like':'%'+_0x2c1eda[_0x6f77('0x38')][_0x6f77('0x44')]+'%'};return _0x12d80f;})});}_0x345d46=_[_0x6f77('0x45')]({},_0x345d46,_0x2c1eda[_0x6f77('0x49')]);return _0x15d233['getDescriptions'](_0x345d46);}})[_0x6f77('0x1b')](function(_0x1d6262){if(_0x1d6262){_0x689191=_0x1d6262[_0x6f77('0x3e')];if(!_0x2c1eda['query'][_0x6f77('0x53')]('nolimit')){_0x345d46['limit']=qs[_0x6f77('0x2c')](_0x2c1eda[_0x6f77('0x38')]['limit']);_0x345d46['offset']=qs['offset'](_0x2c1eda[_0x6f77('0x38')][_0x6f77('0x2b')]);}return _0x15d233[_0x6f77('0x56')](_0x345d46);}})[_0x6f77('0x1b')](function(_0x5b224c){if(_0x5b224c){return _0x5b224c?{'count':_0x689191,'rows':_0x5b224c}:null;}})[_0x6f77('0x1b')](respondWithResult(_0x1b0985,null))[_0x6f77('0x25')](handleError(_0x1b0985,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 931d019..e32bdbb 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x481f77,_0xb531b6){var _0x3cf417=function(_0x104f0b){while(--_0x104f0b){_0x481f77['push'](_0x481f77['shift']());}};_0x3cf417(++_0xb531b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xc37e21,_0x240df4){var _0x12496c=function(_0x13bb2a){while(--_0x13bb2a){_0xc37e21['push'](_0xc37e21['shift']());}};_0x12496c(++_0x240df4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index af4a412..b0861f4 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 _0x9fd3=['VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9fd3,0xc9));var _0x39fd=function(_0xf1aa01,_0x477960){_0xf1aa01=_0xf1aa01-0x0;var _0x2e8946=_0x9fd3[_0xf1aa01];return _0x2e8946;};'use strict';var _=require(_0x39fd('0x0'));var util=require('util');var moment=require(_0x39fd('0x1'));var BPromise=require(_0x39fd('0x2'));var rs=require(_0x39fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39fd('0x4'))['db'];var utils=require(_0x39fd('0x5'));var logger=require(_0x39fd('0x6'))(_0x39fd('0x7'));var config=require(_0x39fd('0x8'));var jayson=require(_0x39fd('0x9'));var client=jayson[_0x39fd('0xa')][_0x39fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x160ff2,_0x2814c3,_0x587edc){return new BPromise(function(_0x1b6435,_0x5b07dc){return client[_0x39fd('0xc')](_0x160ff2,_0x587edc)[_0x39fd('0xd')](function(_0x12f770){logger[_0x39fd('0xe')](_0x39fd('0xf'),_0x2814c3,'request\x20sent');logger[_0x39fd('0x10')](_0x39fd('0x11'),_0x2814c3,_0x39fd('0x12'),JSON['stringify'](_0x12f770));if(_0x12f770[_0x39fd('0x13')]){if(_0x12f770['error'][_0x39fd('0x14')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2814c3,_0x12f770[_0x39fd('0x13')][_0x39fd('0x15')]);return _0x5b07dc(_0x12f770['error']['message']);}logger[_0x39fd('0x13')](_0x39fd('0xf'),_0x2814c3,_0x12f770[_0x39fd('0x13')][_0x39fd('0x15')]);return _0x1b6435(_0x12f770[_0x39fd('0x13')][_0x39fd('0x15')]);}else{logger[_0x39fd('0xe')](_0x39fd('0xf'),_0x2814c3,'request\x20sent');_0x1b6435(_0x12f770[_0x39fd('0x16')][_0x39fd('0x15')]);}})[_0x39fd('0x17')](function(_0x12d8a2){logger[_0x39fd('0x13')](_0x39fd('0xf'),_0x2814c3,_0x12d8a2);_0x5b07dc(_0x12d8a2);});});} \ No newline at end of file +var _0xa537=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x519b94,_0x4c44b6){var _0x1cd90e=function(_0x476eb1){while(--_0x476eb1){_0x519b94['push'](_0x519b94['shift']());}};_0x1cd90e(++_0x4c44b6);}(_0xa537,0x123));var _0x7a53=function(_0x1295c1,_0x4636e8){_0x1295c1=_0x1295c1-0x0;var _0x529fa5=_0xa537[_0x1295c1];return _0x529fa5;};'use strict';var _=require(_0x7a53('0x0'));var util=require(_0x7a53('0x1'));var moment=require('moment');var BPromise=require(_0x7a53('0x2'));var rs=require(_0x7a53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a53('0x4'))['db'];var utils=require(_0x7a53('0x5'));var logger=require('../../config/logger')(_0x7a53('0x6'));var config=require(_0x7a53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a53('0x8')][_0x7a53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2187bc,_0x1db7cf,_0xb47886){return new BPromise(function(_0xe08194,_0x3bf4a2){return client[_0x7a53('0xa')](_0x2187bc,_0xb47886)[_0x7a53('0xb')](function(_0x4fcbf8){logger[_0x7a53('0xc')](_0x7a53('0xd'),_0x1db7cf,_0x7a53('0xe'));logger['debug'](_0x7a53('0xf'),_0x1db7cf,_0x7a53('0xe'),JSON['stringify'](_0x4fcbf8));if(_0x4fcbf8[_0x7a53('0x10')]){if(_0x4fcbf8[_0x7a53('0x10')][_0x7a53('0x11')]===0x1f4){logger[_0x7a53('0x10')](_0x7a53('0xd'),_0x1db7cf,_0x4fcbf8['error'][_0x7a53('0x12')]);return _0x3bf4a2(_0x4fcbf8['error'][_0x7a53('0x12')]);}logger[_0x7a53('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1db7cf,_0x4fcbf8[_0x7a53('0x10')]['message']);return _0xe08194(_0x4fcbf8[_0x7a53('0x10')][_0x7a53('0x12')]);}else{logger[_0x7a53('0xc')](_0x7a53('0xd'),_0x1db7cf,'request\x20sent');_0xe08194(_0x4fcbf8[_0x7a53('0x13')][_0x7a53('0x12')]);}})[_0x7a53('0x14')](function(_0x57c64a){logger[_0x7a53('0x10')](_0x7a53('0xd'),_0x1db7cf,_0x57c64a);_0x3bf4a2(_0x57c64a);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 98c64dc..dae80b4 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 _0x6202=['../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6202,0x191));var _0x2620=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x6202[_0x2b91c5];return _0xbd5531;};'use strict';var multer=require(_0x2620('0x0'));var util=require('util');var path=require(_0x2620('0x1'));var timeout=require(_0x2620('0x2'));var express=require(_0x2620('0x3'));var router=express[_0x2620('0x4')]();var auth=require(_0x2620('0x5'));var interaction=require(_0x2620('0x6'));var config=require(_0x2620('0x7'));var controller=require('./intVtigerField.controller');router[_0x2620('0x8')]('/',auth[_0x2620('0x9')](),controller[_0x2620('0xa')]);router[_0x2620('0x8')](_0x2620('0xb'),auth[_0x2620('0x9')](),controller['show']);router['post']('/',auth[_0x2620('0x9')](),controller[_0x2620('0xc')]);router[_0x2620('0xd')]('/:id',auth[_0x2620('0x9')](),controller[_0x2620('0xe')]);router[_0x2620('0xf')](_0x2620('0xb'),auth['isAuthenticated'](),controller[_0x2620('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbe67=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','show'];(function(_0x107447,_0x2a828a){var _0x4bf763=function(_0x717128){while(--_0x717128){_0x107447['push'](_0x107447['shift']());}};_0x4bf763(++_0x2a828a);}(_0xbe67,0xe0));var _0x7be6=function(_0x11c97d,_0x32281f){_0x11c97d=_0x11c97d-0x0;var _0x2bce42=_0xbe67[_0x11c97d];return _0x2bce42;};'use strict';var multer=require(_0x7be6('0x0'));var util=require(_0x7be6('0x1'));var path=require(_0x7be6('0x2'));var timeout=require(_0x7be6('0x3'));var express=require('express');var router=express[_0x7be6('0x4')]();var auth=require(_0x7be6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7be6('0x6'));var controller=require(_0x7be6('0x7'));router['get']('/',auth[_0x7be6('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7be6('0x9')]);router[_0x7be6('0xa')]('/',auth[_0x7be6('0x8')](),controller[_0x7be6('0xb')]);router[_0x7be6('0xc')](_0x7be6('0xd'),auth['isAuthenticated'](),controller[_0x7be6('0xe')]);router[_0x7be6('0xf')](_0x7be6('0xd'),auth[_0x7be6('0x8')](),controller[_0x7be6('0x10')]);module[_0x7be6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 85ad62c..bd53fdd 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 _0x2750=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x2750,0x13b));var _0x0275=function(_0x528284,_0x3ed944){_0x528284=_0x528284-0x0;var _0x3fb5ac=_0x2750[_0x528284];return _0x3fb5ac;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'type':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),_0x0275('0x3'),_0x0275('0x4'),_0x0275('0x5')),'defaultValue':_0x0275('0x2')},'content':{'type':Sequelize[_0x0275('0x6')]},'key':{'type':Sequelize[_0x0275('0x6')]},'keyType':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),'variable',_0x0275('0x4'))},'keyContent':{'type':Sequelize[_0x0275('0x6')]},'idField':{'type':Sequelize[_0x0275('0x6')]},'nameField':{'type':Sequelize[_0x0275('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0275('0x6')]}}; \ No newline at end of file +var _0x1be1=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1be1,0x192));var _0x11be=function(_0x194afb,_0xbcb926){_0x194afb=_0x194afb-0x0;var _0x4dd5a=_0x1be1[_0x194afb];return _0x4dd5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),'variable',_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x1')},'content':{'type':Sequelize[_0x11be('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),_0x11be('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x11be('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11be('0x4')]},'customField':{'type':Sequelize[_0x11be('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11be('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0eb4b12..c2fdd93 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 _0xe3fa=['where','filters','pick','filter','merge','map','key','VIRTUAL','options','VtigerField','includeAll','rows','catch','show','params','include','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort'];(function(_0x5b3231,_0x19dc47){var _0x296d34=function(_0x3958b4){while(--_0x3958b4){_0x5b3231['push'](_0x5b3231['shift']());}};_0x296d34(++_0x19dc47);}(_0xe3fa,0x1d6));var _0xae3f=function(_0x6daa52,_0x5dc467){_0x6daa52=_0x6daa52-0x0;var _0x1723bf=_0xe3fa[_0x6daa52];return _0x1723bf;};'use strict';var pdf=require(_0xae3f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xae3f('0x1'));var zipdir=require(_0xae3f('0x2'));var jsonpatch=require(_0xae3f('0x3'));var rp=require(_0xae3f('0x4'));var moment=require(_0xae3f('0x5'));var BPromise=require(_0xae3f('0x6'));var Mustache=require(_0xae3f('0x7'));var util=require(_0xae3f('0x8'));var path=require('path');var sox=require(_0xae3f('0x9'));var csv=require(_0xae3f('0xa'));var ejs=require(_0xae3f('0xb'));var fs=require('fs');var _=require(_0xae3f('0xc'));var squel=require('squel');var crypto=require(_0xae3f('0xd'));var jsforce=require(_0xae3f('0xe'));var deskjs=require(_0xae3f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xae3f('0x10'));var Papa=require(_0xae3f('0x11'));var Redis=require(_0xae3f('0x12'));var authService=require(_0xae3f('0x13'));var qs=require(_0xae3f('0x14'));var hardwareService=require(_0xae3f('0x15'));var logger=require('../../config/logger')(_0xae3f('0x16'));var utils=require(_0xae3f('0x17'));var config=require(_0xae3f('0x18'));var db=require(_0xae3f('0x19'))['db'];function respondWithStatusCode(_0x1334d9,_0x1772b6){_0x1772b6=_0x1772b6||0xcc;return function(_0x489fb9){if(_0x489fb9){return _0x1334d9[_0xae3f('0x1a')](_0x1772b6);}return _0x1334d9[_0xae3f('0x1b')](_0x1772b6)[_0xae3f('0x1c')]();};}function respondWithResult(_0x18d691,_0x5819a8){_0x5819a8=_0x5819a8||0xc8;return function(_0x31ef11){if(_0x31ef11){return _0x18d691[_0xae3f('0x1b')](_0x5819a8)['json'](_0x31ef11);}};}function respondWithFilteredResult(_0x32a55d,_0x58a613){return function(_0xc8426a){if(_0xc8426a){var _0x1c6382=_0xc8426a[_0xae3f('0x1d')],_0x613080=_0x58a613['offset'],_0x3f0134=_0x58a613['offset']+_0x58a613[_0xae3f('0x1e')],_0x3a3326;if(_0x3f0134>=_0x1c6382){_0x3f0134=_0x1c6382;_0x3a3326=0xc8;}else{_0x3a3326=0xce;}_0x32a55d[_0xae3f('0x1b')](_0x3a3326);return _0x32a55d[_0xae3f('0x1f')](_0xae3f('0x20'),_0x613080+'-'+_0x3f0134+'/'+_0x1c6382)[_0xae3f('0x21')](_0xc8426a);}return null;};}function patchUpdates(_0x111663){return function(_0x539331){try{jsonpatch['apply'](_0x539331,_0x111663,!![]);}catch(_0x5b85f7){return BPromise[_0xae3f('0x22')](_0x5b85f7);}return _0x539331[_0xae3f('0x23')]();};}function saveUpdates(_0x569333,_0x526831){return function(_0xf655f2){if(_0xf655f2){return _0xf655f2[_0xae3f('0x24')](_0x569333)[_0xae3f('0x25')](function(_0x1439f7){return _0x1439f7;});}return null;};}function removeEntity(_0x2de6a2,_0x395f96){return function(_0x37548b){if(_0x37548b){return _0x37548b['destroy']()[_0xae3f('0x25')](function(){_0x2de6a2[_0xae3f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306128,_0x1f9ecf){return function(_0x271281){if(!_0x271281){_0x306128[_0xae3f('0x1a')](0x194);}return _0x271281;};}function handleError(_0x1e63d9,_0x5be237){_0x5be237=_0x5be237||0x1f4;return function(_0x406e22){logger[_0xae3f('0x26')](_0x406e22[_0xae3f('0x27')]);if(_0x406e22['name']){delete _0x406e22[_0xae3f('0x28')];}_0x1e63d9[_0xae3f('0x1b')](_0x5be237)['send'](_0x406e22);};}exports[_0xae3f('0x29')]=function(_0x324e1b,_0x2b776d){var _0x456eb3={},_0x44ee06={},_0x393e53={'count':0x0,'rows':[]};var _0x5bf7eb=db['VtigerField'][_0xae3f('0x2a')];_0x44ee06[_0xae3f('0x2b')]=_['keys'](_0x5bf7eb);_0x44ee06[_0xae3f('0x2c')]=_[_0xae3f('0x2d')](_0x324e1b['query']);_0x44ee06['filters']=_[_0xae3f('0x2e')](_0x44ee06[_0xae3f('0x2b')],_0x44ee06[_0xae3f('0x2c')]);_0x456eb3[_0xae3f('0x2f')]=_[_0xae3f('0x2e')](_0x44ee06['model'],qs[_0xae3f('0x30')](_0x324e1b['query'][_0xae3f('0x30')]));_0x456eb3[_0xae3f('0x2f')]=_0x456eb3[_0xae3f('0x2f')][_0xae3f('0x31')]?_0x456eb3[_0xae3f('0x2f')]:_0x44ee06[_0xae3f('0x2b')];if(!_0x324e1b['query'][_0xae3f('0x32')](_0xae3f('0x33'))){_0x456eb3['limit']=qs[_0xae3f('0x1e')](_0x324e1b[_0xae3f('0x2c')][_0xae3f('0x1e')]);_0x456eb3[_0xae3f('0x34')]=qs[_0xae3f('0x34')](_0x324e1b[_0xae3f('0x2c')][_0xae3f('0x34')]);}_0x456eb3[_0xae3f('0x35')]=qs[_0xae3f('0x36')](_0x324e1b['query'][_0xae3f('0x36')]);_0x456eb3[_0xae3f('0x37')]=qs[_0xae3f('0x38')](_[_0xae3f('0x39')](_0x324e1b[_0xae3f('0x2c')],_0x44ee06[_0xae3f('0x38')]));if(_0x324e1b['query'][_0xae3f('0x3a')]){_0x456eb3['where']=_[_0xae3f('0x3b')](_0x456eb3[_0xae3f('0x37')],{'$or':_[_0xae3f('0x3c')](_0x5bf7eb,function(_0x20eafb){if(_0x20eafb['type'][_0xae3f('0x3d')]!==_0xae3f('0x3e')){var _0x2ec0db={};_0x2ec0db[_0x20eafb['field']]={'$like':'%'+_0x324e1b['query'][_0xae3f('0x3a')]+'%'};return _0x2ec0db;}})});}_0x456eb3=_[_0xae3f('0x3b')]({},_0x456eb3,_0x324e1b[_0xae3f('0x3f')]);var _0x28d900={'where':_0x456eb3[_0xae3f('0x37')]};return db[_0xae3f('0x40')][_0xae3f('0x1d')](_0x28d900)[_0xae3f('0x25')](function(_0x185b14){_0x393e53[_0xae3f('0x1d')]=_0x185b14;if(_0x324e1b[_0xae3f('0x2c')][_0xae3f('0x41')]){_0x456eb3['include']=[{'all':!![]}];}return db[_0xae3f('0x40')]['findAll'](_0x456eb3);})[_0xae3f('0x25')](function(_0x3f7219){_0x393e53[_0xae3f('0x42')]=_0x3f7219;return _0x393e53;})['then'](respondWithFilteredResult(_0x2b776d,_0x456eb3))[_0xae3f('0x43')](handleError(_0x2b776d,null));};exports[_0xae3f('0x44')]=function(_0x14dea8,_0x2aecc4){var _0x474b79={'raw':!![],'where':{'id':_0x14dea8[_0xae3f('0x45')]['id']}},_0x461c06={};_0x461c06['model']=_[_0xae3f('0x2d')](db[_0xae3f('0x40')]['rawAttributes']);_0x461c06[_0xae3f('0x2c')]=_[_0xae3f('0x2d')](_0x14dea8[_0xae3f('0x2c')]);_0x461c06[_0xae3f('0x38')]=_[_0xae3f('0x2e')](_0x461c06[_0xae3f('0x2b')],_0x461c06[_0xae3f('0x2c')]);_0x474b79[_0xae3f('0x2f')]=_[_0xae3f('0x2e')](_0x461c06[_0xae3f('0x2b')],qs[_0xae3f('0x30')](_0x14dea8['query'][_0xae3f('0x30')]));_0x474b79[_0xae3f('0x2f')]=_0x474b79[_0xae3f('0x2f')][_0xae3f('0x31')]?_0x474b79[_0xae3f('0x2f')]:_0x461c06[_0xae3f('0x2b')];if(_0x14dea8[_0xae3f('0x2c')]['includeAll']){_0x474b79[_0xae3f('0x46')]=[{'all':!![]}];}_0x474b79=_[_0xae3f('0x3b')]({},_0x474b79,_0x14dea8[_0xae3f('0x3f')]);return db[_0xae3f('0x40')][_0xae3f('0x47')](_0x474b79)[_0xae3f('0x25')](handleEntityNotFound(_0x2aecc4,null))[_0xae3f('0x25')](respondWithResult(_0x2aecc4,null))['catch'](handleError(_0x2aecc4,null));};exports[_0xae3f('0x48')]=function(_0x2442c0,_0x4f8de6){return db[_0xae3f('0x40')][_0xae3f('0x48')](_0x2442c0[_0xae3f('0x49')],{})[_0xae3f('0x25')](respondWithResult(_0x4f8de6,0xc9))[_0xae3f('0x43')](handleError(_0x4f8de6,null));};exports[_0xae3f('0x24')]=function(_0x222c19,_0x149833){if(_0x222c19['body']['id']){delete _0x222c19[_0xae3f('0x49')]['id'];}return db[_0xae3f('0x40')][_0xae3f('0x47')]({'where':{'id':_0x222c19[_0xae3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x149833,null))['then'](saveUpdates(_0x222c19[_0xae3f('0x49')],null))[_0xae3f('0x25')](respondWithResult(_0x149833,null))['catch'](handleError(_0x149833,null));};exports[_0xae3f('0x4a')]=function(_0x4a4493,_0x3a3bc6){return db['VtigerField'][_0xae3f('0x47')]({'where':{'id':_0x4a4493[_0xae3f('0x45')]['id']}})[_0xae3f('0x25')](handleEntityNotFound(_0x3a3bc6,null))[_0xae3f('0x25')](removeEntity(_0x3a3bc6,null))[_0xae3f('0x43')](handleError(_0x3a3bc6,null));}; \ No newline at end of file +var _0xe183=['merge','map','options','then','count','include','rows','catch','show','params','keys','rawAttributes','includeAll','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','reject','destroy','end','error','name','send','index','VtigerField','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe183,0x1de));var _0x3e18=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xe183[_0x258b93];return _0x35484b;};'use strict';var pdf=require(_0x3e18('0x0'));var emlformat=require(_0x3e18('0x1'));var rimraf=require(_0x3e18('0x2'));var zipdir=require(_0x3e18('0x3'));var jsonpatch=require(_0x3e18('0x4'));var rp=require('request-promise');var moment=require(_0x3e18('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3e18('0x6'));var util=require(_0x3e18('0x7'));var path=require(_0x3e18('0x8'));var sox=require(_0x3e18('0x9'));var csv=require(_0x3e18('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3e18('0xb'));var squel=require(_0x3e18('0xc'));var crypto=require(_0x3e18('0xd'));var jsforce=require(_0x3e18('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3e18('0xa'));var querystring=require('querystring');var Papa=require(_0x3e18('0xf'));var Redis=require(_0x3e18('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3e18('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e18('0x12'));var utils=require(_0x3e18('0x13'));var config=require(_0x3e18('0x14'));var db=require(_0x3e18('0x15'))['db'];function respondWithStatusCode(_0x23a014,_0x471f92){_0x471f92=_0x471f92||0xcc;return function(_0x2a45fc){if(_0x2a45fc){return _0x23a014[_0x3e18('0x16')](_0x471f92);}return _0x23a014[_0x3e18('0x17')](_0x471f92)['end']();};}function respondWithResult(_0x13b06f,_0x561859){_0x561859=_0x561859||0xc8;return function(_0x12f98b){if(_0x12f98b){return _0x13b06f['status'](_0x561859)[_0x3e18('0x18')](_0x12f98b);}};}function respondWithFilteredResult(_0x948571,_0x46c16e){return function(_0x5c8f3a){if(_0x5c8f3a){var _0x56aa2f=_0x5c8f3a['count'],_0x7f38a3=_0x46c16e['offset'],_0x5dab5a=_0x46c16e[_0x3e18('0x19')]+_0x46c16e['limit'],_0xe6d938;if(_0x5dab5a>=_0x56aa2f){_0x5dab5a=_0x56aa2f;_0xe6d938=0xc8;}else{_0xe6d938=0xce;}_0x948571[_0x3e18('0x17')](_0xe6d938);return _0x948571[_0x3e18('0x1a')](_0x3e18('0x1b'),_0x7f38a3+'-'+_0x5dab5a+'/'+_0x56aa2f)['json'](_0x5c8f3a);}return null;};}function patchUpdates(_0x496c19){return function(_0x452574){try{jsonpatch['apply'](_0x452574,_0x496c19,!![]);}catch(_0x4b2716){return BPromise[_0x3e18('0x1c')](_0x4b2716);}return _0x452574['save']();};}function saveUpdates(_0x39e38e,_0x5c531f){return function(_0x356e83){if(_0x356e83){return _0x356e83['update'](_0x39e38e)['then'](function(_0x193772){return _0x193772;});}return null;};}function removeEntity(_0x5e2a82,_0x5358d9){return function(_0x56ba85){if(_0x56ba85){return _0x56ba85[_0x3e18('0x1d')]()['then'](function(){_0x5e2a82['status'](0xcc)[_0x3e18('0x1e')]();});}};}function handleEntityNotFound(_0x569cc7,_0xf5db11){return function(_0x5e5c73){if(!_0x5e5c73){_0x569cc7[_0x3e18('0x16')](0x194);}return _0x5e5c73;};}function handleError(_0x43416a,_0x3fedc1){_0x3fedc1=_0x3fedc1||0x1f4;return function(_0x193635){logger[_0x3e18('0x1f')](_0x193635['stack']);if(_0x193635[_0x3e18('0x20')]){delete _0x193635[_0x3e18('0x20')];}_0x43416a['status'](_0x3fedc1)[_0x3e18('0x21')](_0x193635);};}exports[_0x3e18('0x22')]=function(_0x5186ed,_0x2868e1){var _0x4221ee={},_0x2868de={},_0xc29763={'count':0x0,'rows':[]};var _0x48e5ca=db[_0x3e18('0x23')]['rawAttributes'];_0x2868de[_0x3e18('0x24')]=_['keys'](_0x48e5ca);_0x2868de[_0x3e18('0x25')]=_['keys'](_0x5186ed[_0x3e18('0x25')]);_0x2868de['filters']=_['intersection'](_0x2868de[_0x3e18('0x24')],_0x2868de[_0x3e18('0x25')]);_0x4221ee[_0x3e18('0x26')]=_[_0x3e18('0x27')](_0x2868de[_0x3e18('0x24')],qs[_0x3e18('0x28')](_0x5186ed[_0x3e18('0x25')][_0x3e18('0x28')]));_0x4221ee['attributes']=_0x4221ee[_0x3e18('0x26')][_0x3e18('0x29')]?_0x4221ee['attributes']:_0x2868de[_0x3e18('0x24')];if(!_0x5186ed[_0x3e18('0x25')][_0x3e18('0x2a')](_0x3e18('0x2b'))){_0x4221ee[_0x3e18('0x2c')]=qs['limit'](_0x5186ed[_0x3e18('0x25')][_0x3e18('0x2c')]);_0x4221ee[_0x3e18('0x19')]=qs[_0x3e18('0x19')](_0x5186ed[_0x3e18('0x25')][_0x3e18('0x19')]);}_0x4221ee[_0x3e18('0x2d')]=qs[_0x3e18('0x2e')](_0x5186ed[_0x3e18('0x25')][_0x3e18('0x2e')]);_0x4221ee[_0x3e18('0x2f')]=qs[_0x3e18('0x30')](_['pick'](_0x5186ed['query'],_0x2868de[_0x3e18('0x30')]));if(_0x5186ed[_0x3e18('0x25')][_0x3e18('0x31')]){_0x4221ee[_0x3e18('0x2f')]=_[_0x3e18('0x32')](_0x4221ee[_0x3e18('0x2f')],{'$or':_[_0x3e18('0x33')](_0x48e5ca,function(_0x5a7c61){if(_0x5a7c61['type']['key']!=='VIRTUAL'){var _0x4e63d9={};_0x4e63d9[_0x5a7c61['field']]={'$like':'%'+_0x5186ed[_0x3e18('0x25')][_0x3e18('0x31')]+'%'};return _0x4e63d9;}})});}_0x4221ee=_['merge']({},_0x4221ee,_0x5186ed[_0x3e18('0x34')]);var _0x305473={'where':_0x4221ee[_0x3e18('0x2f')]};return db[_0x3e18('0x23')]['count'](_0x305473)[_0x3e18('0x35')](function(_0x32c5b2){_0xc29763[_0x3e18('0x36')]=_0x32c5b2;if(_0x5186ed['query']['includeAll']){_0x4221ee[_0x3e18('0x37')]=[{'all':!![]}];}return db[_0x3e18('0x23')]['findAll'](_0x4221ee);})[_0x3e18('0x35')](function(_0xdee169){_0xc29763[_0x3e18('0x38')]=_0xdee169;return _0xc29763;})[_0x3e18('0x35')](respondWithFilteredResult(_0x2868e1,_0x4221ee))[_0x3e18('0x39')](handleError(_0x2868e1,null));};exports[_0x3e18('0x3a')]=function(_0x30d946,_0x4a1728){var _0x2af36d={'raw':!![],'where':{'id':_0x30d946[_0x3e18('0x3b')]['id']}},_0x4b02be={};_0x4b02be['model']=_[_0x3e18('0x3c')](db[_0x3e18('0x23')][_0x3e18('0x3d')]);_0x4b02be[_0x3e18('0x25')]=_['keys'](_0x30d946['query']);_0x4b02be[_0x3e18('0x30')]=_['intersection'](_0x4b02be[_0x3e18('0x24')],_0x4b02be[_0x3e18('0x25')]);_0x2af36d[_0x3e18('0x26')]=_[_0x3e18('0x27')](_0x4b02be[_0x3e18('0x24')],qs['fields'](_0x30d946[_0x3e18('0x25')][_0x3e18('0x28')]));_0x2af36d[_0x3e18('0x26')]=_0x2af36d[_0x3e18('0x26')]['length']?_0x2af36d[_0x3e18('0x26')]:_0x4b02be[_0x3e18('0x24')];if(_0x30d946['query'][_0x3e18('0x3e')]){_0x2af36d[_0x3e18('0x37')]=[{'all':!![]}];}_0x2af36d=_['merge']({},_0x2af36d,_0x30d946['options']);return db[_0x3e18('0x23')]['find'](_0x2af36d)['then'](handleEntityNotFound(_0x4a1728,null))[_0x3e18('0x35')](respondWithResult(_0x4a1728,null))[_0x3e18('0x39')](handleError(_0x4a1728,null));};exports[_0x3e18('0x3f')]=function(_0x13a1e1,_0x3414e8){return db[_0x3e18('0x23')][_0x3e18('0x3f')](_0x13a1e1[_0x3e18('0x40')],{})[_0x3e18('0x35')](respondWithResult(_0x3414e8,0xc9))[_0x3e18('0x39')](handleError(_0x3414e8,null));};exports['update']=function(_0x231325,_0x2bcdb3){if(_0x231325[_0x3e18('0x40')]['id']){delete _0x231325[_0x3e18('0x40')]['id'];}return db[_0x3e18('0x23')][_0x3e18('0x41')]({'where':{'id':_0x231325[_0x3e18('0x3b')]['id']}})[_0x3e18('0x35')](handleEntityNotFound(_0x2bcdb3,null))['then'](saveUpdates(_0x231325[_0x3e18('0x40')],null))[_0x3e18('0x35')](respondWithResult(_0x2bcdb3,null))[_0x3e18('0x39')](handleError(_0x2bcdb3,null));};exports[_0x3e18('0x1d')]=function(_0x4eb411,_0xe1e843){return db[_0x3e18('0x23')][_0x3e18('0x41')]({'where':{'id':_0x4eb411['params']['id']}})[_0x3e18('0x35')](handleEntityNotFound(_0xe1e843,null))[_0x3e18('0x35')](removeEntity(_0xe1e843,null))[_0x3e18('0x39')](handleError(_0xe1e843,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e4e8821..19fb549 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 _0x38ab=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','moment','bluebird','path','rimraf','./intVtigerField.attributes','exports'];(function(_0x38a3d2,_0x20a5d8){var _0x22af63=function(_0xba59c4){while(--_0xba59c4){_0x38a3d2['push'](_0x38a3d2['shift']());}};_0x22af63(++_0x20a5d8);}(_0x38ab,0x119));var _0xb38a=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x38ab[_0x4bc4c8];return _0x3bb121;};'use strict';var _=require('lodash');var util=require(_0xb38a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb38a('0x1'));var BPromise=require(_0xb38a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb38a('0x3'));var rimraf=require(_0xb38a('0x4'));var config=require('../../config/environment');var attributes=require(_0xb38a('0x5'));module[_0xb38a('0x6')]=function(_0x4e78b8,_0x15e5c6){return _0x4e78b8[_0xb38a('0x7')](_0xb38a('0x8'),attributes,{'tableName':_0xb38a('0x9'),'paranoid':![],'indexes':[{'name':_0xb38a('0xa'),'fields':['idField',_0xb38a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c2=['bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','idField','lodash','../../config/logger'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xe0c2,0x1a0));var _0x2e0c=function(_0x31d022,_0x40d762){_0x31d022=_0x31d022-0x0;var _0x769256=_0xe0c2[_0x31d022];return _0x769256;};'use strict';var _=require(_0x2e0c('0x0'));var util=require('util');var logger=require(_0x2e0c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2e0c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e0c('0x3'));var rimraf=require(_0x2e0c('0x4'));var config=require(_0x2e0c('0x5'));var attributes=require(_0x2e0c('0x6'));module[_0x2e0c('0x7')]=function(_0x5b2025,_0x114d59){return _0x5b2025[_0x2e0c('0x8')](_0x2e0c('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x2e0c('0xa'),'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 89ce90c..d11007f 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 _0x2218=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0x2218,0x1b2));var _0x8221=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x2218[_0x534c8f];return _0x5a57f5;};'use strict';var _=require(_0x8221('0x0'));var util=require('util');var moment=require(_0x8221('0x1'));var BPromise=require(_0x8221('0x2'));var rs=require(_0x8221('0x3'));var fs=require('fs');var Redis=require(_0x8221('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8221('0x5'));var logger=require(_0x8221('0x6'))(_0x8221('0x7'));var config=require(_0x8221('0x8'));var jayson=require(_0x8221('0x9'));var client=jayson[_0x8221('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53dda2,_0x16491e,_0x47073a){return new BPromise(function(_0x100267,_0x30cf70){return client[_0x8221('0xb')](_0x53dda2,_0x47073a)['then'](function(_0x4dcc06){logger[_0x8221('0xc')](_0x8221('0xd'),_0x16491e,_0x8221('0xe'));logger[_0x8221('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x16491e,_0x8221('0xe'),JSON[_0x8221('0x10')](_0x4dcc06));if(_0x4dcc06['error']){if(_0x4dcc06[_0x8221('0x11')][_0x8221('0x12')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x16491e,_0x4dcc06[_0x8221('0x11')][_0x8221('0x13')]);return _0x30cf70(_0x4dcc06[_0x8221('0x11')][_0x8221('0x13')]);}logger[_0x8221('0x11')]('VtigerField,\x20%s,\x20%s',_0x16491e,_0x4dcc06[_0x8221('0x11')][_0x8221('0x13')]);return _0x100267(_0x4dcc06[_0x8221('0x11')][_0x8221('0x13')]);}else{logger[_0x8221('0xc')](_0x8221('0xd'),_0x16491e,'request\x20sent');_0x100267(_0x4dcc06[_0x8221('0x14')][_0x8221('0x13')]);}})[_0x8221('0x15')](function(_0x2c206d){logger['error']('VtigerField,\x20%s,\x20%s',_0x16491e,_0x2c206d);_0x30cf70(_0x2c206d);});});} \ No newline at end of file +var _0xf1d8=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x52e295,_0xe8246b){var _0x237c35=function(_0x597217){while(--_0x597217){_0x52e295['push'](_0x52e295['shift']());}};_0x237c35(++_0xe8246b);}(_0xf1d8,0x18b));var _0x8f1d=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xf1d8[_0x40be86];return _0xda3c3b;};'use strict';var _=require(_0x8f1d('0x0'));var util=require('util');var moment=require(_0x8f1d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f1d('0x2'));var fs=require('fs');var Redis=require(_0x8f1d('0x3'));var db=require(_0x8f1d('0x4'))['db'];var utils=require(_0x8f1d('0x5'));var logger=require(_0x8f1d('0x6'))(_0x8f1d('0x7'));var config=require(_0x8f1d('0x8'));var jayson=require(_0x8f1d('0x9'));var client=jayson['client'][_0x8f1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2655ff,_0x4fe1e3,_0x2a86bd){return new BPromise(function(_0x592be8,_0x18ec0e){return client[_0x8f1d('0xb')](_0x2655ff,_0x2a86bd)[_0x8f1d('0xc')](function(_0x51eed7){logger['info'](_0x8f1d('0xd'),_0x4fe1e3,_0x8f1d('0xe'));logger['debug'](_0x8f1d('0xf'),_0x4fe1e3,_0x8f1d('0xe'),JSON[_0x8f1d('0x10')](_0x51eed7));if(_0x51eed7['error']){if(_0x51eed7['error']['code']===0x1f4){logger['error'](_0x8f1d('0xd'),_0x4fe1e3,_0x51eed7[_0x8f1d('0x11')][_0x8f1d('0x12')]);return _0x18ec0e(_0x51eed7[_0x8f1d('0x11')][_0x8f1d('0x12')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x4fe1e3,_0x51eed7[_0x8f1d('0x11')]['message']);return _0x592be8(_0x51eed7[_0x8f1d('0x11')][_0x8f1d('0x12')]);}else{logger[_0x8f1d('0x13')](_0x8f1d('0xd'),_0x4fe1e3,_0x8f1d('0xe'));_0x592be8(_0x51eed7[_0x8f1d('0x14')][_0x8f1d('0x12')]);}})[_0x8f1d('0x15')](function(_0x2590c9){logger[_0x8f1d('0x11')](_0x8f1d('0xd'),_0x4fe1e3,_0x2590c9);_0x18ec0e(_0x2590c9);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5106024..ac6c8e5 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 _0x7b5f=['Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','index','get','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','addConfiguration','delete','/:id','destroy','multer','util','connect-timeout','express'];(function(_0xd309a4,_0x100f7b){var _0x164f91=function(_0xeae99c){while(--_0xeae99c){_0xd309a4['push'](_0xd309a4['shift']());}};_0x164f91(++_0x100f7b);}(_0x7b5f,0x114));var _0xf7b5=function(_0x5942d8,_0x59d24b){_0x5942d8=_0x5942d8-0x0;var _0x1b0d93=_0x7b5f[_0x5942d8];return _0x1b0d93;};'use strict';var multer=require(_0xf7b5('0x0'));var util=require(_0xf7b5('0x1'));var path=require('path');var timeout=require(_0xf7b5('0x2'));var express=require(_0xf7b5('0x3'));var router=express[_0xf7b5('0x4')]();var auth=require(_0xf7b5('0x5'));var interaction=require(_0xf7b5('0x6'));var config=require('../../config/environment');var controller=require(_0xf7b5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf7b5('0x8')]);router[_0xf7b5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf7b5('0xa')]);router[_0xf7b5('0x9')](_0xf7b5('0xb'),auth[_0xf7b5('0xc')](),controller[_0xf7b5('0xd')]);router[_0xf7b5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf7b5('0xe')]);router[_0xf7b5('0xf')]('/',auth[_0xf7b5('0xc')](),controller['create']);router[_0xf7b5('0xf')]('/:id/configurations',auth[_0xf7b5('0xc')](),controller[_0xf7b5('0x10')]);router['put']('/:id',auth[_0xf7b5('0xc')](),controller['update']);router[_0xf7b5('0x11')](_0xf7b5('0x12'),auth[_0xf7b5('0xc')](),controller[_0xf7b5('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1bd4=['index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get'];(function(_0x14654e,_0x3f62c2){var _0x4ddc8a=function(_0x3d10e8){while(--_0x3d10e8){_0x14654e['push'](_0x14654e['shift']());}};_0x4ddc8a(++_0x3f62c2);}(_0x1bd4,0xfa));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x41bd('0x0'));var util=require(_0x41bd('0x1'));var path=require(_0x41bd('0x2'));var timeout=require(_0x41bd('0x3'));var express=require(_0x41bd('0x4'));var router=express[_0x41bd('0x5')]();var auth=require(_0x41bd('0x6'));var interaction=require(_0x41bd('0x7'));var config=require('../../config/environment');var controller=require(_0x41bd('0x8'));router[_0x41bd('0x9')]('/',auth['isAuthenticated'](),controller[_0x41bd('0xa')]);router[_0x41bd('0x9')](_0x41bd('0xb'),auth['isAuthenticated'](),controller[_0x41bd('0xc')]);router[_0x41bd('0x9')](_0x41bd('0xd'),auth[_0x41bd('0xe')](),controller[_0x41bd('0xf')]);router[_0x41bd('0x9')](_0x41bd('0x10'),auth[_0x41bd('0xe')](),controller[_0x41bd('0x11')]);router[_0x41bd('0x12')]('/',auth['isAuthenticated'](),controller[_0x41bd('0x13')]);router['post'](_0x41bd('0xd'),auth[_0x41bd('0xe')](),controller[_0x41bd('0x14')]);router[_0x41bd('0x15')](_0x41bd('0xb'),auth['isAuthenticated'](),controller[_0x41bd('0x16')]);router[_0x41bd('0x17')](_0x41bd('0xb'),auth[_0x41bd('0xe')](),controller[_0x41bd('0x18')]);module[_0x41bd('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 b38fe9b..1a41b06 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 _0x38c7=['integrationTab','newTab','sequelize','STRING','token','ENUM'];(function(_0x5c7141,_0x5b61ec){var _0x5b356b=function(_0x617bfc){while(--_0x617bfc){_0x5c7141['push'](_0x5c7141['shift']());}};_0x5b356b(++_0x5b61ec);}(_0x38c7,0x68));var _0x738c=function(_0x20d2ba,_0x13c6db){_0x20d2ba=_0x20d2ba-0x0;var _0x506a99=_0x38c7[_0x20d2ba];return _0x506a99;};'use strict';var Sequelize=require(_0x738c('0x0'));module['exports']={'name':{'type':Sequelize[_0x738c('0x1')]},'description':{'type':Sequelize[_0x738c('0x1')]},'username':{'type':Sequelize[_0x738c('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x738c('0x1')]},'token':{'type':Sequelize[_0x738c('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x738c('0x2')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x738c('0x1')]},'type':{'type':Sequelize[_0x738c('0x3')](_0x738c('0x4'),_0x738c('0x5')),'defaultValue':_0x738c('0x4')}}; \ No newline at end of file +var _0xac94=['integrationTab','sequelize','STRING','remoteUri','password','token'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xac94,0x11b));var _0x4ac9=function(_0x5a9298,_0x3c0afb){_0x5a9298=_0x5a9298-0x0;var _0x28fd49=_0xac94[_0x5a9298];return _0x28fd49;};'use strict';var Sequelize=require(_0x4ac9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ac9('0x1')]},'username':{'type':Sequelize[_0x4ac9('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4ac9('0x2')},'authType':{'type':Sequelize['ENUM'](_0x4ac9('0x3'),_0x4ac9('0x4')),'defaultValue':_0x4ac9('0x3')},'serverUrl':{'type':Sequelize[_0x4ac9('0x1')]},'type':{'type':Sequelize['ENUM'](_0x4ac9('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0fa2b2d..89087a3 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 _0xb780=['type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','find','create','body','findOne','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','channel','getDescriptions','ZendeskConfiguration','ZendeskField','Descriptions','getFields','username','token','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','password','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','group','remove','position','title','system_field_options','custom_field_options','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','request\x20sent','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','apply','update','destroy','stack','name','send','index','ZendeskAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','nolimit','limit','sort','where','pick','filter','merge','map'];(function(_0x17c36e,_0x1f5f48){var _0x1510ea=function(_0x25aee2){while(--_0x25aee2){_0x17c36e['push'](_0x17c36e['shift']());}};_0x1510ea(++_0x1f5f48);}(_0xb780,0x127));var _0x0b78=function(_0x151f10,_0xa05471){_0x151f10=_0x151f10-0x0;var _0x2fba12=_0xb780[_0x151f10];return _0x2fba12;};'use strict';var pdf=require(_0x0b78('0x0'));var emlformat=require(_0x0b78('0x1'));var rimraf=require(_0x0b78('0x2'));var zipdir=require(_0x0b78('0x3'));var jsonpatch=require(_0x0b78('0x4'));var rp=require(_0x0b78('0x5'));var moment=require('moment');var BPromise=require(_0x0b78('0x6'));var Mustache=require('mustache');var util=require(_0x0b78('0x7'));var path=require(_0x0b78('0x8'));var sox=require(_0x0b78('0x9'));var csv=require(_0x0b78('0xa'));var ejs=require(_0x0b78('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b78('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b78('0xd'));var deskjs=require(_0x0b78('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b78('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b78('0x10'));var qs=require(_0x0b78('0x11'));var hardwareService=require(_0x0b78('0x12'));var logger=require(_0x0b78('0x13'))(_0x0b78('0x14'));var utils=require(_0x0b78('0x15'));var config=require('../../config/environment');var db=require(_0x0b78('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0b78('0x17'));var client=jayson[_0x0b78('0x18')][_0x0b78('0x19')]({'port':0x232a});function checkPasswordPattern(_0x39dbb0,_0x20c01a,_0x14f23e){if(_0x14f23e){var _0x246e3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x246e3c[_0x0b78('0x1a')](_0x20c01a)){return _0x39dbb0;}else{throw new Error(_0x0b78('0x1b'));}}else{return _0x39dbb0;}}function respondWithRpcPromise(_0x59e353,_0x554146,_0x392db7,_0x1de7f5){return new BPromise(function(_0x49568d,_0x27e437){var _0x2a8746=_0x1de7f5||client;return _0x2a8746[_0x0b78('0x1c')](_0x59e353,_0x392db7)[_0x0b78('0x1d')](function(_0x42e8f1){logger[_0x0b78('0x1e')]('ZendeskAccount,\x20%s,\x20%s',_0x554146,'request\x20sent');logger[_0x0b78('0x1f')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x554146,_0x0b78('0x20'),JSON[_0x0b78('0x21')](_0x42e8f1));if(_0x42e8f1[_0x0b78('0x22')]){if(_0x42e8f1[_0x0b78('0x22')][_0x0b78('0x23')]===0x1f4){logger[_0x0b78('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x554146,_0x42e8f1[_0x0b78('0x22')]['message']);return _0x27e437(_0x42e8f1[_0x0b78('0x22')][_0x0b78('0x24')]);}logger[_0x0b78('0x22')](_0x0b78('0x25'),_0x554146,_0x42e8f1[_0x0b78('0x22')][_0x0b78('0x24')]);return _0x49568d(_0x42e8f1['error'][_0x0b78('0x24')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x554146,_0x0b78('0x20'));_0x49568d(_0x42e8f1[_0x0b78('0x26')][_0x0b78('0x24')]);}})[_0x0b78('0x27')](function(_0xa6d98c){logger[_0x0b78('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x554146,_0xa6d98c);_0x27e437(_0xa6d98c);});});}function respondWithStatusCode(_0x41f9e2,_0x3f69a5){_0x3f69a5=_0x3f69a5||0xcc;return function(_0x1a3556){if(_0x1a3556){return _0x41f9e2[_0x0b78('0x28')](_0x3f69a5);}return _0x41f9e2[_0x0b78('0x29')](_0x3f69a5)[_0x0b78('0x2a')]();};}function respondWithResult(_0x5c1faa,_0x250d04){_0x250d04=_0x250d04||0xc8;return function(_0x12183d){if(_0x12183d){return _0x5c1faa[_0x0b78('0x29')](_0x250d04)[_0x0b78('0x2b')](_0x12183d);}};}function respondWithFilteredResult(_0x6f5de3,_0x564e1f){return function(_0x4aeea2){if(_0x4aeea2){var _0x21bc9c=_0x4aeea2[_0x0b78('0x2c')],_0x3c97f6=_0x564e1f[_0x0b78('0x2d')],_0x1ba542=_0x564e1f['offset']+_0x564e1f['limit'],_0x39193e;if(_0x1ba542>=_0x21bc9c){_0x1ba542=_0x21bc9c;_0x39193e=0xc8;}else{_0x39193e=0xce;}_0x6f5de3['status'](_0x39193e);return _0x6f5de3[_0x0b78('0x2e')]('Content-Range',_0x3c97f6+'-'+_0x1ba542+'/'+_0x21bc9c)[_0x0b78('0x2b')](_0x4aeea2);}return null;};}function patchUpdates(_0x44b6a0){return function(_0x385db7){try{jsonpatch[_0x0b78('0x2f')](_0x385db7,_0x44b6a0,!![]);}catch(_0x15456f){return BPromise['reject'](_0x15456f);}return _0x385db7['save']();};}function saveUpdates(_0x400738,_0x57cb74){return function(_0x500ddb){if(_0x500ddb){return _0x500ddb[_0x0b78('0x30')](_0x400738)[_0x0b78('0x1d')](function(_0x44c018){return _0x44c018;});}return null;};}function removeEntity(_0x21d953,_0xe00bb3){return function(_0x4fa7b4){if(_0x4fa7b4){return _0x4fa7b4[_0x0b78('0x31')]()[_0x0b78('0x1d')](function(){_0x21d953[_0x0b78('0x29')](0xcc)[_0x0b78('0x2a')]();});}};}function handleEntityNotFound(_0x50bd46,_0x1aacd5){return function(_0x161306){if(!_0x161306){_0x50bd46[_0x0b78('0x28')](0x194);}return _0x161306;};}function handleError(_0x326ceb,_0x1a9b93){_0x1a9b93=_0x1a9b93||0x1f4;return function(_0x1d02f5){logger[_0x0b78('0x22')](_0x1d02f5[_0x0b78('0x32')]);if(_0x1d02f5[_0x0b78('0x33')]){delete _0x1d02f5[_0x0b78('0x33')];}_0x326ceb['status'](_0x1a9b93)[_0x0b78('0x34')](_0x1d02f5);};}exports[_0x0b78('0x35')]=function(_0x50863b,_0x32266b){var _0x5c5e02={},_0x962b04={},_0x2c6965={'count':0x0,'rows':[]};var _0x4ea841=db[_0x0b78('0x36')][_0x0b78('0x37')];_0x962b04['model']=_[_0x0b78('0x38')](_0x4ea841);_0x962b04[_0x0b78('0x39')]=_[_0x0b78('0x38')](_0x50863b[_0x0b78('0x39')]);_0x962b04[_0x0b78('0x3a')]=_[_0x0b78('0x3b')](_0x962b04[_0x0b78('0x3c')],_0x962b04[_0x0b78('0x39')]);_0x5c5e02['attributes']=_['intersection'](_0x962b04[_0x0b78('0x3c')],qs[_0x0b78('0x3d')](_0x50863b[_0x0b78('0x39')][_0x0b78('0x3d')]));_0x5c5e02['attributes']=_0x5c5e02[_0x0b78('0x3e')]['length']?_0x5c5e02[_0x0b78('0x3e')]:_0x962b04[_0x0b78('0x3c')];if(!_0x50863b[_0x0b78('0x39')]['hasOwnProperty'](_0x0b78('0x3f'))){_0x5c5e02[_0x0b78('0x40')]=qs[_0x0b78('0x40')](_0x50863b[_0x0b78('0x39')]['limit']);_0x5c5e02['offset']=qs[_0x0b78('0x2d')](_0x50863b['query'][_0x0b78('0x2d')]);}_0x5c5e02['order']=qs[_0x0b78('0x41')](_0x50863b[_0x0b78('0x39')][_0x0b78('0x41')]);_0x5c5e02[_0x0b78('0x42')]=qs[_0x0b78('0x3a')](_[_0x0b78('0x43')](_0x50863b[_0x0b78('0x39')],_0x962b04[_0x0b78('0x3a')]));if(_0x50863b['query'][_0x0b78('0x44')]){_0x5c5e02['where']=_[_0x0b78('0x45')](_0x5c5e02['where'],{'$or':_[_0x0b78('0x46')](_0x4ea841,function(_0x5bf6aa){if(_0x5bf6aa[_0x0b78('0x47')]['key']!==_0x0b78('0x48')){var _0x1fd816={};_0x1fd816[_0x5bf6aa[_0x0b78('0x49')]]={'$like':'%'+_0x50863b[_0x0b78('0x39')][_0x0b78('0x44')]+'%'};return _0x1fd816;}})});}_0x5c5e02=_['merge']({},_0x5c5e02,_0x50863b[_0x0b78('0x4a')]);var _0x117b2f={'where':_0x5c5e02['where']};return db[_0x0b78('0x36')][_0x0b78('0x2c')](_0x117b2f)[_0x0b78('0x1d')](function(_0x361938){_0x2c6965['count']=_0x361938;if(_0x50863b[_0x0b78('0x39')][_0x0b78('0x4b')]){_0x5c5e02[_0x0b78('0x4c')]=[{'all':!![]}];}return db[_0x0b78('0x36')][_0x0b78('0x4d')](_0x5c5e02);})['then'](function(_0x2426c4){_0x2c6965[_0x0b78('0x4e')]=_0x2426c4;return _0x2c6965;})[_0x0b78('0x1d')](respondWithFilteredResult(_0x32266b,_0x5c5e02))[_0x0b78('0x27')](handleError(_0x32266b,null));};exports[_0x0b78('0x4f')]=function(_0x30c46a,_0xff4d7e){var _0x230843={'raw':![],'where':{'id':_0x30c46a[_0x0b78('0x50')]['id']}},_0x368fec={};_0x368fec[_0x0b78('0x3c')]=_[_0x0b78('0x38')](db[_0x0b78('0x36')][_0x0b78('0x37')]);_0x368fec['query']=_[_0x0b78('0x38')](_0x30c46a['query']);_0x368fec[_0x0b78('0x3a')]=_[_0x0b78('0x3b')](_0x368fec['model'],_0x368fec['query']);_0x230843['attributes']=_[_0x0b78('0x3b')](_0x368fec[_0x0b78('0x3c')],qs[_0x0b78('0x3d')](_0x30c46a[_0x0b78('0x39')][_0x0b78('0x3d')]));_0x230843[_0x0b78('0x3e')]=_0x230843[_0x0b78('0x3e')][_0x0b78('0x51')]?_0x230843[_0x0b78('0x3e')]:_0x368fec[_0x0b78('0x3c')];if(_0x30c46a[_0x0b78('0x39')][_0x0b78('0x4b')]){_0x230843[_0x0b78('0x4c')]=[{'all':!![]}];}_0x230843=_[_0x0b78('0x45')]({},_0x230843,_0x30c46a[_0x0b78('0x4a')]);return db[_0x0b78('0x36')][_0x0b78('0x52')](_0x230843)['then'](handleEntityNotFound(_0xff4d7e,null))['then'](respondWithResult(_0xff4d7e,null))[_0x0b78('0x27')](handleError(_0xff4d7e,null));};exports[_0x0b78('0x53')]=function(_0x4785bb,_0x3e8046){return db[_0x0b78('0x36')][_0x0b78('0x53')](_0x4785bb['body'],{})['then'](respondWithResult(_0x3e8046,0xc9))[_0x0b78('0x27')](handleError(_0x3e8046,null));};exports[_0x0b78('0x30')]=function(_0x2230f5,_0xe287ea){if(_0x2230f5[_0x0b78('0x54')]['id']){delete _0x2230f5[_0x0b78('0x54')]['id'];}return db[_0x0b78('0x36')][_0x0b78('0x52')]({'where':{'id':_0x2230f5[_0x0b78('0x50')]['id']}})[_0x0b78('0x1d')](handleEntityNotFound(_0xe287ea,null))[_0x0b78('0x1d')](saveUpdates(_0x2230f5['body'],null))['then'](respondWithResult(_0xe287ea,null))[_0x0b78('0x27')](handleError(_0xe287ea,null));};exports['destroy']=function(_0xb5124c,_0x24d5be){return db['ZendeskAccount'][_0x0b78('0x52')]({'where':{'id':_0xb5124c['params']['id']}})['then'](handleEntityNotFound(_0x24d5be,null))['then'](removeEntity(_0x24d5be,null))[_0x0b78('0x27')](handleError(_0x24d5be,null));};exports['getConfigurations']=function(_0x38bbc8,_0x100ccf,_0x50d122){var _0x14d58f={};var _0x2c787d={};var _0x181ef0;var _0x12884c;return db['ZendeskAccount'][_0x0b78('0x55')]({'where':{'id':_0x38bbc8[_0x0b78('0x50')]['id']}})[_0x0b78('0x1d')](handleEntityNotFound(_0x100ccf,null))['then'](function(_0x4cdcd0){if(_0x4cdcd0){_0x181ef0=_0x4cdcd0;_0x2c787d['model']=_['keys'](db['ZendeskConfiguration'][_0x0b78('0x37')]);_0x2c787d[_0x0b78('0x39')]=_[_0x0b78('0x38')](_0x38bbc8[_0x0b78('0x39')]);_0x2c787d[_0x0b78('0x3a')]=_[_0x0b78('0x3b')](_0x2c787d[_0x0b78('0x3c')],_0x2c787d[_0x0b78('0x39')]);_0x14d58f['attributes']=_[_0x0b78('0x3b')](_0x2c787d[_0x0b78('0x3c')],qs[_0x0b78('0x3d')](_0x38bbc8['query'][_0x0b78('0x3d')]));_0x14d58f[_0x0b78('0x3e')]=_0x14d58f[_0x0b78('0x3e')][_0x0b78('0x51')]?_0x14d58f[_0x0b78('0x3e')]:_0x2c787d[_0x0b78('0x3c')];_0x14d58f[_0x0b78('0x56')]=qs[_0x0b78('0x41')](_0x38bbc8[_0x0b78('0x39')][_0x0b78('0x41')]);_0x14d58f[_0x0b78('0x42')]=qs[_0x0b78('0x3a')](_['pick'](_0x38bbc8[_0x0b78('0x39')],_0x2c787d['filters']));if(_0x38bbc8['query'][_0x0b78('0x44')]){_0x14d58f[_0x0b78('0x42')]=_[_0x0b78('0x45')](_0x14d58f['where'],{'$or':_[_0x0b78('0x46')](_0x14d58f[_0x0b78('0x3e')],function(_0x1924f9){var _0x3f63e8={};_0x3f63e8[_0x1924f9]={'$like':'%'+_0x38bbc8['query']['filter']+'%'};return _0x3f63e8;})});}_0x14d58f=_[_0x0b78('0x45')]({},_0x14d58f,_0x38bbc8[_0x0b78('0x4a')]);return _0x181ef0[_0x0b78('0x57')](_0x14d58f);}})[_0x0b78('0x1d')](function(_0x325685){if(_0x325685){_0x12884c=_0x325685['length'];if(!_0x38bbc8['query'][_0x0b78('0x58')](_0x0b78('0x3f'))){_0x14d58f[_0x0b78('0x40')]=qs[_0x0b78('0x40')](_0x38bbc8[_0x0b78('0x39')][_0x0b78('0x40')]);_0x14d58f[_0x0b78('0x2d')]=qs[_0x0b78('0x2d')](_0x38bbc8[_0x0b78('0x39')][_0x0b78('0x2d')]);}return _0x181ef0[_0x0b78('0x57')](_0x14d58f);}})[_0x0b78('0x1d')](function(_0x510855){if(_0x510855){return _0x510855?{'count':_0x12884c,'rows':_0x510855}:null;}})[_0x0b78('0x1d')](respondWithResult(_0x100ccf,null))[_0x0b78('0x27')](handleError(_0x100ccf,null));};exports[_0x0b78('0x59')]=function(_0x5de20c,_0x53fcea,_0x23b962){if(_0x5de20c[_0x0b78('0x54')]['id']){delete _0x5de20c[_0x0b78('0x54')]['id'];}return db[_0x0b78('0x36')][_0x0b78('0x55')]({'where':{'id':_0x5de20c['params']['id']}})[_0x0b78('0x1d')](handleEntityNotFound(_0x53fcea,null))['then'](function(_0x2b14bf){if(_0x2b14bf){_0x5de20c[_0x0b78('0x54')][_0x0b78('0x5a')]=_0x2b14bf['id'];_0x5de20c[_0x0b78('0x54')]['Subjects']=integrations['getSubjects'](_0x5de20c[_0x0b78('0x54')][_0x0b78('0x5b')],_0x5de20c[_0x0b78('0x54')]['type']);_0x5de20c[_0x0b78('0x54')]['Descriptions']=integrations[_0x0b78('0x5c')](_0x5de20c[_0x0b78('0x54')][_0x0b78('0x5b')],_0x5de20c['body']['type']);return db[_0x0b78('0x5d')]['create'](_0x5de20c['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x0b78('0x5e')],'as':_0x0b78('0x5f')}]});}return null;})[_0x0b78('0x1d')](respondWithResult(_0x53fcea,null))[_0x0b78('0x27')](handleError(_0x53fcea,null));};exports[_0x0b78('0x60')]=function(_0x41facd,_0xd6a774,_0x5d7650){var _0xd62c59='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x41facd['params']['id']},'attributes':['id',_0x0b78('0x61'),'password',_0x0b78('0x62'),'authType','remoteUri']})[_0x0b78('0x1d')](handleEntityNotFound(_0xd6a774,null))[_0x0b78('0x1d')](function(_0x2f45ea){if(_0x2f45ea){_0xd62c59=_0x2f45ea['remoteUri'];var _0x55bb7c=_0xd62c59[_0x0b78('0x63')](-0x1);if(_0x55bb7c==='/'){_0xd62c59=_0xd62c59['substring'](0x0,_0xd62c59[_0x0b78('0x64')](_0x55bb7c));}var _0x3dcbbc={'method':_0x0b78('0x65'),'uri':util[_0x0b78('0x66')](_0x0b78('0x67'),_0xd62c59,_0x0b78('0x68')),'json':!![]};switch(_0x2f45ea[_0x0b78('0x69')]){case _0x0b78('0x6a'):_0x3dcbbc[_0x0b78('0x6b')]={'Authorization':util[_0x0b78('0x66')](_0x0b78('0x6c'),new Buffer(util[_0x0b78('0x66')](_0x0b78('0x6d'),_0x2f45ea[_0x0b78('0x61')],_0x2f45ea[_0x0b78('0x6a')]))[_0x0b78('0x6e')](_0x0b78('0x6f')))};break;case _0x0b78('0x62'):_0x3dcbbc['headers']={'Authorization':util[_0x0b78('0x66')](_0x0b78('0x6c'),new Buffer(util['format'](_0x0b78('0x70'),_0x2f45ea[_0x0b78('0x61')],_0x2f45ea[_0x0b78('0x62')]))[_0x0b78('0x6e')](_0x0b78('0x6f')))};break;default:throw new db[(_0x0b78('0x71'))]['ValidationError'](_0x0b78('0x72'));}return rp(_0x3dcbbc);}})[_0x0b78('0x1d')](function(_0x5d1477){if(_0x5d1477){var _0x279d50=['subject','description',_0x0b78('0x73'),'assignee'];_[_0x0b78('0x74')](_0x5d1477[_0x0b78('0x68')],function(_0x1d09c3){return _0x279d50['includes'](_0x1d09c3[_0x0b78('0x47')]);});return{'count':_0x5d1477['ticket_fields'][_0x0b78('0x51')],'rows':_[_0x0b78('0x46')](_0x5d1477[_0x0b78('0x68')],function(_0xf3591b){return{'id':_0xf3591b['id'],'name':_0xf3591b[_0x0b78('0x75')]>0x7?_0xf3591b[_0x0b78('0x76')]:_0xf3591b[_0x0b78('0x47')],'custom':_0xf3591b[_0x0b78('0x75')]>0x7?!![]:![],'options':_0xf3591b[_0x0b78('0x77')]?_0xf3591b[_0x0b78('0x77')]:_0xf3591b[_0x0b78('0x78')]?_0xf3591b[_0x0b78('0x78')]:[]};})};}})[_0x0b78('0x1d')](respondWithResult(_0xd6a774,null))[_0x0b78('0x27')](function(_0x4d54c9){var _0x3e1c2f=_0x41facd['query'][_0x0b78('0x1a')]?0x1f4:_0x4d54c9[_0x0b78('0x79')]||0x1f4;logger[_0x0b78('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x0b78('0x60'),_0x3e1c2f,JSON[_0x0b78('0x21')](_0x4d54c9));delete _0x4d54c9[_0x0b78('0x33')];if(_0x3e1c2f===0x191){_0x3e1c2f=0x190;}_0xd6a774[_0x0b78('0x29')](_0x3e1c2f)[_0x0b78('0x34')](_0x41facd[_0x0b78('0x39')][_0x0b78('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x4d54c9[_0x0b78('0x79')]}:_0x4d54c9);});}; \ No newline at end of file +var _0xb752=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','count','offset','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','ZendeskAccount','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','intersection','length','options','find','catch','create','body','getConfigurations','pick','map','nolimit','limit','addConfiguration','findOne','channel','ZendeskField','Descriptions','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1e972f,_0x172e57){var _0x48eff3=function(_0x1893be){while(--_0x1893be){_0x1e972f['push'](_0x1e972f['shift']());}};_0x48eff3(++_0x172e57);}(_0xb752,0x151));var _0x2b75=function(_0x31c293,_0x5acbc7){_0x31c293=_0x31c293-0x0;var _0x58c358=_0xb752[_0x31c293];return _0x58c358;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b75('0x0'));var rimraf=require(_0x2b75('0x1'));var zipdir=require(_0x2b75('0x2'));var jsonpatch=require(_0x2b75('0x3'));var rp=require('request-promise');var moment=require(_0x2b75('0x4'));var BPromise=require(_0x2b75('0x5'));var Mustache=require(_0x2b75('0x6'));var util=require(_0x2b75('0x7'));var path=require(_0x2b75('0x8'));var sox=require('sox');var csv=require(_0x2b75('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b75('0xa'));var jsforce=require(_0x2b75('0xb'));var deskjs=require(_0x2b75('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2b75('0xd'));var Papa=require(_0x2b75('0xe'));var Redis=require(_0x2b75('0xf'));var authService=require(_0x2b75('0x10'));var qs=require(_0x2b75('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b75('0x12'))(_0x2b75('0x13'));var utils=require(_0x2b75('0x14'));var config=require('../../config/environment');var db=require(_0x2b75('0x15'))['db'];var integrations=require(_0x2b75('0x16'));var jayson=require(_0x2b75('0x17'));var client=jayson[_0x2b75('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x5b501b,_0x549458,_0x18f49f){if(_0x18f49f){var _0x1198b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1198b4[_0x2b75('0x19')](_0x549458)){return _0x5b501b;}else{throw new Error(_0x2b75('0x1a'));}}else{return _0x5b501b;}}function respondWithRpcPromise(_0x48cc11,_0x102b62,_0x48582b,_0xb0ddb9){return new BPromise(function(_0x112044,_0x32abf4){var _0x572845=_0xb0ddb9||client;return _0x572845[_0x2b75('0x1b')](_0x48cc11,_0x48582b)[_0x2b75('0x1c')](function(_0x4abe1a){logger[_0x2b75('0x1d')](_0x2b75('0x1e'),_0x102b62,_0x2b75('0x1f'));logger[_0x2b75('0x20')](_0x2b75('0x21'),_0x102b62,'request\x20sent',JSON['stringify'](_0x4abe1a));if(_0x4abe1a['error']){if(_0x4abe1a[_0x2b75('0x22')][_0x2b75('0x23')]===0x1f4){logger[_0x2b75('0x22')](_0x2b75('0x1e'),_0x102b62,_0x4abe1a[_0x2b75('0x22')]['message']);return _0x32abf4(_0x4abe1a['error'][_0x2b75('0x24')]);}logger[_0x2b75('0x22')](_0x2b75('0x1e'),_0x102b62,_0x4abe1a[_0x2b75('0x22')][_0x2b75('0x24')]);return _0x112044(_0x4abe1a[_0x2b75('0x22')][_0x2b75('0x24')]);}else{logger[_0x2b75('0x1d')]('ZendeskAccount,\x20%s,\x20%s',_0x102b62,_0x2b75('0x1f'));_0x112044(_0x4abe1a[_0x2b75('0x25')][_0x2b75('0x24')]);}})['catch'](function(_0x1a7b05){logger[_0x2b75('0x22')](_0x2b75('0x1e'),_0x102b62,_0x1a7b05);_0x32abf4(_0x1a7b05);});});}function respondWithStatusCode(_0x3c40c3,_0x425394){_0x425394=_0x425394||0xcc;return function(_0x203af){if(_0x203af){return _0x3c40c3['sendStatus'](_0x425394);}return _0x3c40c3[_0x2b75('0x26')](_0x425394)[_0x2b75('0x27')]();};}function respondWithResult(_0xbf8477,_0x4b455b){_0x4b455b=_0x4b455b||0xc8;return function(_0x34dac5){if(_0x34dac5){return _0xbf8477['status'](_0x4b455b)[_0x2b75('0x28')](_0x34dac5);}};}function respondWithFilteredResult(_0x15650b,_0x2577c9){return function(_0xa054ed){if(_0xa054ed){var _0x41e44f=_0xa054ed[_0x2b75('0x29')],_0x57ec9a=_0x2577c9[_0x2b75('0x2a')],_0xbeb63a=_0x2577c9[_0x2b75('0x2a')]+_0x2577c9['limit'],_0x1cf561;if(_0xbeb63a>=_0x41e44f){_0xbeb63a=_0x41e44f;_0x1cf561=0xc8;}else{_0x1cf561=0xce;}_0x15650b[_0x2b75('0x26')](_0x1cf561);return _0x15650b[_0x2b75('0x2b')]('Content-Range',_0x57ec9a+'-'+_0xbeb63a+'/'+_0x41e44f)[_0x2b75('0x28')](_0xa054ed);}return null;};}function patchUpdates(_0x1e80be){return function(_0x410638){try{jsonpatch[_0x2b75('0x2c')](_0x410638,_0x1e80be,!![]);}catch(_0xa5d246){return BPromise[_0x2b75('0x2d')](_0xa5d246);}return _0x410638[_0x2b75('0x2e')]();};}function saveUpdates(_0x22d1cd,_0x289be7){return function(_0x87fed1){if(_0x87fed1){return _0x87fed1[_0x2b75('0x2f')](_0x22d1cd)[_0x2b75('0x1c')](function(_0xe929d5){return _0xe929d5;});}return null;};}function removeEntity(_0x4e4b39,_0x480f6f){return function(_0xc4e917){if(_0xc4e917){return _0xc4e917[_0x2b75('0x30')]()[_0x2b75('0x1c')](function(){_0x4e4b39[_0x2b75('0x26')](0xcc)[_0x2b75('0x27')]();});}};}function handleEntityNotFound(_0x1bc9f4,_0x627ffe){return function(_0x1526a1){if(!_0x1526a1){_0x1bc9f4[_0x2b75('0x31')](0x194);}return _0x1526a1;};}function handleError(_0x4282b9,_0x4b197f){_0x4b197f=_0x4b197f||0x1f4;return function(_0x49b7e5){logger['error'](_0x49b7e5[_0x2b75('0x32')]);if(_0x49b7e5['name']){delete _0x49b7e5[_0x2b75('0x33')];}_0x4282b9['status'](_0x4b197f)[_0x2b75('0x34')](_0x49b7e5);};}exports['index']=function(_0x537c1c,_0x2ae1fd){var _0xed9ff6={},_0x3143a2={},_0x43b213={'count':0x0,'rows':[]};var _0x374fea=db[_0x2b75('0x35')][_0x2b75('0x36')];_0x3143a2[_0x2b75('0x37')]=_[_0x2b75('0x38')](_0x374fea);_0x3143a2[_0x2b75('0x39')]=_[_0x2b75('0x38')](_0x537c1c[_0x2b75('0x39')]);_0x3143a2[_0x2b75('0x3a')]=_['intersection'](_0x3143a2[_0x2b75('0x37')],_0x3143a2[_0x2b75('0x39')]);_0xed9ff6[_0x2b75('0x3b')]=_['intersection'](_0x3143a2[_0x2b75('0x37')],qs['fields'](_0x537c1c[_0x2b75('0x39')][_0x2b75('0x3c')]));_0xed9ff6[_0x2b75('0x3b')]=_0xed9ff6[_0x2b75('0x3b')]['length']?_0xed9ff6['attributes']:_0x3143a2[_0x2b75('0x37')];if(!_0x537c1c[_0x2b75('0x39')][_0x2b75('0x3d')]('nolimit')){_0xed9ff6['limit']=qs['limit'](_0x537c1c[_0x2b75('0x39')]['limit']);_0xed9ff6['offset']=qs[_0x2b75('0x2a')](_0x537c1c['query'][_0x2b75('0x2a')]);}_0xed9ff6[_0x2b75('0x3e')]=qs[_0x2b75('0x3f')](_0x537c1c[_0x2b75('0x39')]['sort']);_0xed9ff6[_0x2b75('0x40')]=qs['filters'](_['pick'](_0x537c1c['query'],_0x3143a2[_0x2b75('0x3a')]));if(_0x537c1c['query'][_0x2b75('0x41')]){_0xed9ff6[_0x2b75('0x40')]=_[_0x2b75('0x42')](_0xed9ff6[_0x2b75('0x40')],{'$or':_['map'](_0x374fea,function(_0x483beb){if(_0x483beb[_0x2b75('0x43')][_0x2b75('0x44')]!==_0x2b75('0x45')){var _0x4d6bfa={};_0x4d6bfa[_0x483beb[_0x2b75('0x46')]]={'$like':'%'+_0x537c1c['query'][_0x2b75('0x41')]+'%'};return _0x4d6bfa;}})});}_0xed9ff6=_[_0x2b75('0x42')]({},_0xed9ff6,_0x537c1c['options']);var _0x27c931={'where':_0xed9ff6['where']};return db[_0x2b75('0x35')][_0x2b75('0x29')](_0x27c931)[_0x2b75('0x1c')](function(_0x5249a4){_0x43b213[_0x2b75('0x29')]=_0x5249a4;if(_0x537c1c[_0x2b75('0x39')][_0x2b75('0x47')]){_0xed9ff6[_0x2b75('0x48')]=[{'all':!![]}];}return db[_0x2b75('0x35')][_0x2b75('0x49')](_0xed9ff6);})[_0x2b75('0x1c')](function(_0x1e539d){_0x43b213[_0x2b75('0x4a')]=_0x1e539d;return _0x43b213;})[_0x2b75('0x1c')](respondWithFilteredResult(_0x2ae1fd,_0xed9ff6))['catch'](handleError(_0x2ae1fd,null));};exports[_0x2b75('0x4b')]=function(_0x16eaef,_0x102bc7){var _0x35f447={'raw':![],'where':{'id':_0x16eaef[_0x2b75('0x4c')]['id']}},_0x544f85={};_0x544f85['model']=_[_0x2b75('0x38')](db[_0x2b75('0x35')]['rawAttributes']);_0x544f85[_0x2b75('0x39')]=_[_0x2b75('0x38')](_0x16eaef[_0x2b75('0x39')]);_0x544f85[_0x2b75('0x3a')]=_[_0x2b75('0x4d')](_0x544f85[_0x2b75('0x37')],_0x544f85['query']);_0x35f447[_0x2b75('0x3b')]=_[_0x2b75('0x4d')](_0x544f85['model'],qs[_0x2b75('0x3c')](_0x16eaef[_0x2b75('0x39')]['fields']));_0x35f447[_0x2b75('0x3b')]=_0x35f447[_0x2b75('0x3b')][_0x2b75('0x4e')]?_0x35f447[_0x2b75('0x3b')]:_0x544f85[_0x2b75('0x37')];if(_0x16eaef[_0x2b75('0x39')][_0x2b75('0x47')]){_0x35f447['include']=[{'all':!![]}];}_0x35f447=_[_0x2b75('0x42')]({},_0x35f447,_0x16eaef[_0x2b75('0x4f')]);return db['ZendeskAccount'][_0x2b75('0x50')](_0x35f447)[_0x2b75('0x1c')](handleEntityNotFound(_0x102bc7,null))[_0x2b75('0x1c')](respondWithResult(_0x102bc7,null))[_0x2b75('0x51')](handleError(_0x102bc7,null));};exports[_0x2b75('0x52')]=function(_0x261402,_0x1be39c){return db['ZendeskAccount'][_0x2b75('0x52')](_0x261402['body'],{})[_0x2b75('0x1c')](respondWithResult(_0x1be39c,0xc9))[_0x2b75('0x51')](handleError(_0x1be39c,null));};exports[_0x2b75('0x2f')]=function(_0x43cb04,_0x2d7f8c){if(_0x43cb04['body']['id']){delete _0x43cb04['body']['id'];}return db[_0x2b75('0x35')]['find']({'where':{'id':_0x43cb04[_0x2b75('0x4c')]['id']}})[_0x2b75('0x1c')](handleEntityNotFound(_0x2d7f8c,null))['then'](saveUpdates(_0x43cb04[_0x2b75('0x53')],null))[_0x2b75('0x1c')](respondWithResult(_0x2d7f8c,null))[_0x2b75('0x51')](handleError(_0x2d7f8c,null));};exports[_0x2b75('0x30')]=function(_0x34d9ab,_0x83f55a){return db[_0x2b75('0x35')]['find']({'where':{'id':_0x34d9ab[_0x2b75('0x4c')]['id']}})[_0x2b75('0x1c')](handleEntityNotFound(_0x83f55a,null))['then'](removeEntity(_0x83f55a,null))[_0x2b75('0x51')](handleError(_0x83f55a,null));};exports[_0x2b75('0x54')]=function(_0x5867bc,_0x241f21,_0x6a2c09){var _0x3c1dc3={};var _0x9c2f3a={};var _0x4edbfd;var _0x42df0e;return db[_0x2b75('0x35')]['findOne']({'where':{'id':_0x5867bc[_0x2b75('0x4c')]['id']}})[_0x2b75('0x1c')](handleEntityNotFound(_0x241f21,null))[_0x2b75('0x1c')](function(_0x123aa1){if(_0x123aa1){_0x4edbfd=_0x123aa1;_0x9c2f3a['model']=_[_0x2b75('0x38')](db['ZendeskConfiguration'][_0x2b75('0x36')]);_0x9c2f3a[_0x2b75('0x39')]=_[_0x2b75('0x38')](_0x5867bc[_0x2b75('0x39')]);_0x9c2f3a[_0x2b75('0x3a')]=_['intersection'](_0x9c2f3a['model'],_0x9c2f3a['query']);_0x3c1dc3[_0x2b75('0x3b')]=_['intersection'](_0x9c2f3a[_0x2b75('0x37')],qs[_0x2b75('0x3c')](_0x5867bc[_0x2b75('0x39')][_0x2b75('0x3c')]));_0x3c1dc3[_0x2b75('0x3b')]=_0x3c1dc3['attributes'][_0x2b75('0x4e')]?_0x3c1dc3[_0x2b75('0x3b')]:_0x9c2f3a[_0x2b75('0x37')];_0x3c1dc3['order']=qs[_0x2b75('0x3f')](_0x5867bc[_0x2b75('0x39')][_0x2b75('0x3f')]);_0x3c1dc3[_0x2b75('0x40')]=qs[_0x2b75('0x3a')](_[_0x2b75('0x55')](_0x5867bc['query'],_0x9c2f3a[_0x2b75('0x3a')]));if(_0x5867bc[_0x2b75('0x39')][_0x2b75('0x41')]){_0x3c1dc3[_0x2b75('0x40')]=_[_0x2b75('0x42')](_0x3c1dc3[_0x2b75('0x40')],{'$or':_[_0x2b75('0x56')](_0x3c1dc3['attributes'],function(_0x5d755){var _0x48fc7a={};_0x48fc7a[_0x5d755]={'$like':'%'+_0x5867bc[_0x2b75('0x39')]['filter']+'%'};return _0x48fc7a;})});}_0x3c1dc3=_[_0x2b75('0x42')]({},_0x3c1dc3,_0x5867bc[_0x2b75('0x4f')]);return _0x4edbfd[_0x2b75('0x54')](_0x3c1dc3);}})['then'](function(_0x44815a){if(_0x44815a){_0x42df0e=_0x44815a[_0x2b75('0x4e')];if(!_0x5867bc[_0x2b75('0x39')]['hasOwnProperty'](_0x2b75('0x57'))){_0x3c1dc3[_0x2b75('0x58')]=qs[_0x2b75('0x58')](_0x5867bc[_0x2b75('0x39')][_0x2b75('0x58')]);_0x3c1dc3[_0x2b75('0x2a')]=qs[_0x2b75('0x2a')](_0x5867bc['query'][_0x2b75('0x2a')]);}return _0x4edbfd['getConfigurations'](_0x3c1dc3);}})['then'](function(_0x42f37a){if(_0x42f37a){return _0x42f37a?{'count':_0x42df0e,'rows':_0x42f37a}:null;}})['then'](respondWithResult(_0x241f21,null))[_0x2b75('0x51')](handleError(_0x241f21,null));};exports[_0x2b75('0x59')]=function(_0x15c194,_0x30a1f1,_0x332468){if(_0x15c194[_0x2b75('0x53')]['id']){delete _0x15c194[_0x2b75('0x53')]['id'];}return db['ZendeskAccount'][_0x2b75('0x5a')]({'where':{'id':_0x15c194[_0x2b75('0x4c')]['id']}})[_0x2b75('0x1c')](handleEntityNotFound(_0x30a1f1,null))[_0x2b75('0x1c')](function(_0x5e6ebc){if(_0x5e6ebc){_0x15c194[_0x2b75('0x53')]['AccountId']=_0x5e6ebc['id'];_0x15c194[_0x2b75('0x53')]['Subjects']=integrations['getSubjects'](_0x15c194[_0x2b75('0x53')][_0x2b75('0x5b')],_0x15c194[_0x2b75('0x53')][_0x2b75('0x43')]);_0x15c194[_0x2b75('0x53')]['Descriptions']=integrations['getDescriptions'](_0x15c194[_0x2b75('0x53')][_0x2b75('0x5b')],_0x15c194['body']['type']);return db['ZendeskConfiguration']['create'](_0x15c194[_0x2b75('0x53')],{'include':[{'model':db[_0x2b75('0x5c')],'as':'Subjects'},{'model':db[_0x2b75('0x5c')],'as':_0x2b75('0x5d')}]});}return null;})['then'](respondWithResult(_0x30a1f1,null))[_0x2b75('0x51')](handleError(_0x30a1f1,null));};exports['getFields']=function(_0x545467,_0x2e1a9f,_0x3ea4a5){var _0x2904a2='';return db[_0x2b75('0x35')][_0x2b75('0x5a')]({'where':{'id':_0x545467[_0x2b75('0x4c')]['id']},'attributes':['id','username',_0x2b75('0x5e'),_0x2b75('0x5f'),_0x2b75('0x60'),'remoteUri']})['then'](handleEntityNotFound(_0x2e1a9f,null))['then'](function(_0xd6358e){if(_0xd6358e){_0x2904a2=_0xd6358e[_0x2b75('0x61')];var _0x318bd7=_0x2904a2[_0x2b75('0x62')](-0x1);if(_0x318bd7==='/'){_0x2904a2=_0x2904a2['substring'](0x0,_0x2904a2[_0x2b75('0x63')](_0x318bd7));}var _0x216161={'method':_0x2b75('0x64'),'uri':util[_0x2b75('0x65')](_0x2b75('0x66'),_0x2904a2,_0x2b75('0x67')),'json':!![]};switch(_0xd6358e[_0x2b75('0x60')]){case _0x2b75('0x5e'):_0x216161[_0x2b75('0x68')]={'Authorization':util[_0x2b75('0x65')]('Basic\x20%s',new Buffer(util[_0x2b75('0x65')]('%s:%s',_0xd6358e['username'],_0xd6358e[_0x2b75('0x5e')]))['toString'](_0x2b75('0x69')))};break;case _0x2b75('0x5f'):_0x216161[_0x2b75('0x68')]={'Authorization':util['format'](_0x2b75('0x6a'),new Buffer(util[_0x2b75('0x65')](_0x2b75('0x6b'),_0xd6358e[_0x2b75('0x6c')],_0xd6358e['token']))['toString'](_0x2b75('0x69')))};break;default:throw new db[(_0x2b75('0x6d'))][(_0x2b75('0x6e'))](_0x2b75('0x6f'));}return rp(_0x216161);}})['then'](function(_0x4dd988){if(_0x4dd988){var _0x24e764=['subject',_0x2b75('0x70'),_0x2b75('0x71'),_0x2b75('0x72')];_[_0x2b75('0x73')](_0x4dd988[_0x2b75('0x67')],function(_0x3aa473){return _0x24e764[_0x2b75('0x74')](_0x3aa473['type']);});return{'count':_0x4dd988[_0x2b75('0x67')][_0x2b75('0x4e')],'rows':_[_0x2b75('0x56')](_0x4dd988['ticket_fields'],function(_0x216f3c){return{'id':_0x216f3c['id'],'name':_0x216f3c['position']>0x7?_0x216f3c['title']:_0x216f3c[_0x2b75('0x43')],'custom':_0x216f3c[_0x2b75('0x75')]>0x7?!![]:![],'options':_0x216f3c[_0x2b75('0x76')]?_0x216f3c[_0x2b75('0x76')]:_0x216f3c['custom_field_options']?_0x216f3c[_0x2b75('0x77')]:[]};})};}})[_0x2b75('0x1c')](respondWithResult(_0x2e1a9f,null))['catch'](function(_0x1a1156){var _0x345688=_0x545467['query'][_0x2b75('0x19')]?0x1f4:_0x1a1156['statusCode']||0x1f4;logger[_0x2b75('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x2b75('0x78'),_0x345688,JSON['stringify'](_0x1a1156));delete _0x1a1156['name'];if(_0x345688===0x191){_0x345688=0x190;}_0x2e1a9f[_0x2b75('0x26')](_0x345688)[_0x2b75('0x34')](_0x545467[_0x2b75('0x39')][_0x2b75('0x19')]?{'message':_0x2b75('0x79'),'statusCode':_0x1a1156[_0x2b75('0x7a')]}:_0x1a1156);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index ce0d454..d8c1d6b 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 _0x972c=['ZendeskAccount','int_zendesk_accounts','../../config/logger','api','bluebird','request-promise','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x972c,0xf2));var _0xc972=function(_0x184336,_0x43385a){_0x184336=_0x184336-0x0;var _0x519390=_0x972c[_0x184336];return _0x519390;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc972('0x0'))(_0xc972('0x1'));var moment=require('moment');var BPromise=require(_0xc972('0x2'));var rp=require(_0xc972('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc972('0x4'));var attributes=require(_0xc972('0x5'));var integrations=require(_0xc972('0x6'));module['exports']=function(_0xd70261,_0x4cff66){return _0xd70261[_0xc972('0x7')](_0xc972('0x8'),attributes,{'tableName':_0xc972('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6c=['rimraf','../../config/environment','../../components/integrations/configuration','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3464e5,_0xcef866){var _0x2863c2=function(_0x313b1c){while(--_0x313b1c){_0x3464e5['push'](_0x3464e5['shift']());}};_0x2863c2(++_0xcef866);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x2c5094,_0x298d57){_0x2c5094=_0x2c5094-0x0;var _0x525534=_0x3c6c[_0x2c5094];return _0x525534;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var moment=require(_0xc3c6('0x3'));var BPromise=require(_0xc3c6('0x4'));var rp=require(_0xc3c6('0x5'));var fs=require('fs');var path=require(_0xc3c6('0x6'));var rimraf=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc3c6('0x9'));module['exports']=function(_0xe7731e,_0x4d7ae6){return _0xe7731e['define']('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','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 bf27f42..8993749 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 _0x140b=['map','model','attributes','GetZendeskAccount','ShowZendeskAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','ZendeskAccount','findAll','options','raw','where','limit','include'];(function(_0x42da4c,_0x3be988){var _0x4c4955=function(_0x47b600){while(--_0x47b600){_0x42da4c['push'](_0x42da4c['shift']());}};_0x4c4955(++_0x3be988);}(_0x140b,0x6f));var _0xb140=function(_0x155976,_0x52d024){_0x155976=_0x155976-0x0;var _0x44c06a=_0x140b[_0x155976];return _0x44c06a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb140('0x0'));var BPromise=require('bluebird');var rs=require(_0xb140('0x1'));var fs=require('fs');var Redis=require(_0xb140('0x2'));var db=require(_0xb140('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb140('0x4'))(_0xb140('0x5'));var config=require(_0xb140('0x6'));var jayson=require(_0xb140('0x7'));var client=jayson[_0xb140('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5c500,_0x166cf5,_0x2c9702){return new BPromise(function(_0x367779,_0x375bf7){return client[_0xb140('0x9')](_0xe5c500,_0x2c9702)[_0xb140('0xa')](function(_0x305e73){logger[_0xb140('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x166cf5,_0xb140('0xc'));logger[_0xb140('0xd')](_0xb140('0xe'),_0x166cf5,'request\x20sent',JSON[_0xb140('0xf')](_0x305e73));if(_0x305e73['error']){if(_0x305e73['error'][_0xb140('0x10')]===0x1f4){logger[_0xb140('0x11')](_0xb140('0x12'),_0x166cf5,_0x305e73[_0xb140('0x11')][_0xb140('0x13')]);return _0x375bf7(_0x305e73['error'][_0xb140('0x13')]);}logger[_0xb140('0x11')](_0xb140('0x12'),_0x166cf5,_0x305e73[_0xb140('0x11')][_0xb140('0x13')]);return _0x367779(_0x305e73[_0xb140('0x11')]['message']);}else{logger[_0xb140('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x166cf5,'request\x20sent');_0x367779(_0x305e73[_0xb140('0x14')]['message']);}})[_0xb140('0x15')](function(_0x4a17ec){logger['error'](_0xb140('0x12'),_0x166cf5,_0x4a17ec);_0x375bf7(_0x4a17ec);});});}exports['GetZendeskAccount']=function(_0x54f935){var _0x5c6049=this;return new Promise(function(_0x3cacda,_0x425ae6){return db[_0xb140('0x16')][_0xb140('0x17')]({'raw':_0x54f935[_0xb140('0x18')]?_0x54f935[_0xb140('0x18')][_0xb140('0x19')]===undefined?!![]:![]:!![],'where':_0x54f935[_0xb140('0x18')]?_0x54f935[_0xb140('0x18')][_0xb140('0x1a')]||null:null,'attributes':_0x54f935['options']?_0x54f935['options']['attributes']||null:null,'limit':_0x54f935['options']?_0x54f935[_0xb140('0x18')][_0xb140('0x1b')]||null:null,'include':_0x54f935[_0xb140('0x18')]?_0x54f935['options'][_0xb140('0x1c')]?_[_0xb140('0x1d')](_0x54f935[_0xb140('0x18')]['include'],function(_0x364519){return{'model':db[_0x364519['model']],'as':_0x364519['as'],'attributes':_0x364519['attributes'],'include':_0x364519[_0xb140('0x1c')]?_[_0xb140('0x1d')](_0x364519[_0xb140('0x1c')],function(_0x2664d){return{'model':db[_0x2664d[_0xb140('0x1e')]],'as':_0x2664d['as'],'attributes':_0x2664d[_0xb140('0x1f')],'include':_0x2664d[_0xb140('0x1c')]?_['map'](_0x2664d['include'],function(_0x3fb68a){return{'model':db[_0x3fb68a[_0xb140('0x1e')]],'as':_0x3fb68a['as'],'attributes':_0x3fb68a[_0xb140('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb140('0xa')](function(_0x35c3c4){logger[_0xb140('0xb')](_0xb140('0x20'),_0x54f935);logger['debug'](_0xb140('0x20'),_0x54f935,JSON[_0xb140('0xf')](_0x35c3c4));_0x3cacda(_0x35c3c4);})[_0xb140('0x15')](function(_0x559349){logger[_0xb140('0x11')](_0xb140('0x20'),_0x559349[_0xb140('0x13')],_0x54f935);_0x425ae6(_0x5c6049['error'](0x1f4,_0x559349[_0xb140('0x13')]));});});};exports[_0xb140('0x21')]=function(_0x1f2e61){var _0x5ad8ee=this;return new Promise(function(_0x11701d,_0x2e976e){return db[_0xb140('0x16')][_0xb140('0x22')]({'raw':_0x1f2e61['options']?_0x1f2e61[_0xb140('0x18')][_0xb140('0x19')]===undefined?!![]:![]:!![],'where':_0x1f2e61[_0xb140('0x18')]?_0x1f2e61[_0xb140('0x18')]['where']||null:null,'attributes':_0x1f2e61[_0xb140('0x18')]?_0x1f2e61['options']['attributes']||null:null,'include':_0x1f2e61[_0xb140('0x18')]?_0x1f2e61['options'][_0xb140('0x1c')]?_[_0xb140('0x1d')](_0x1f2e61['options'][_0xb140('0x1c')],function(_0x5a15cf){return{'model':db[_0x5a15cf[_0xb140('0x1e')]],'as':_0x5a15cf['as'],'attributes':_0x5a15cf[_0xb140('0x1f')],'include':_0x5a15cf[_0xb140('0x1c')]?_[_0xb140('0x1d')](_0x5a15cf['include'],function(_0x3eaa2e){return{'model':db[_0x3eaa2e[_0xb140('0x1e')]],'as':_0x3eaa2e['as'],'attributes':_0x3eaa2e[_0xb140('0x1f')],'include':_0x3eaa2e[_0xb140('0x1c')]?_[_0xb140('0x1d')](_0x3eaa2e['include'],function(_0x5d1f5a){return{'model':db[_0x5d1f5a['model']],'as':_0x5d1f5a['as'],'attributes':_0x5d1f5a[_0xb140('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb140('0xa')](function(_0x5069b5){logger[_0xb140('0xb')](_0xb140('0x21'),_0x1f2e61);logger[_0xb140('0xd')]('ShowZendeskAccount',_0x1f2e61,JSON[_0xb140('0xf')](_0x5069b5));_0x11701d(_0x5069b5);})[_0xb140('0x15')](function(_0x2f6352){logger[_0xb140('0x11')]('ShowZendeskAccount',_0x2f6352[_0xb140('0x13')],_0x1f2e61);_0x2e976e(_0x5ad8ee['error'](0x1f4,_0x2f6352[_0xb140('0x13')]));});});}; \ No newline at end of file +var _0x0e1c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','include','then','ShowZendeskAccount','find','model','lodash','util','moment','randomstring'];(function(_0x3b2774,_0x5ae077){var _0x445ab6=function(_0xa564df){while(--_0xa564df){_0x3b2774['push'](_0x3b2774['shift']());}};_0x445ab6(++_0x5ae077);}(_0x0e1c,0x140));var _0xc0e1=function(_0x3526db,_0x21d524){_0x3526db=_0x3526db-0x0;var _0x289462=_0x0e1c[_0x3526db];return _0x289462;};'use strict';var _=require(_0xc0e1('0x0'));var util=require(_0xc0e1('0x1'));var moment=require(_0xc0e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0e1('0x3'));var fs=require('fs');var Redis=require(_0xc0e1('0x4'));var db=require(_0xc0e1('0x5'))['db'];var utils=require(_0xc0e1('0x6'));var logger=require(_0xc0e1('0x7'))(_0xc0e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xc0e1('0x9'));var client=jayson['client'][_0xc0e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19d1da,_0x545dad,_0x173ca6){return new BPromise(function(_0x14a4b7,_0x144609){return client[_0xc0e1('0xb')](_0x19d1da,_0x173ca6)['then'](function(_0x254f7a){logger[_0xc0e1('0xc')](_0xc0e1('0xd'),_0x545dad,_0xc0e1('0xe'));logger[_0xc0e1('0xf')](_0xc0e1('0x10'),_0x545dad,_0xc0e1('0xe'),JSON[_0xc0e1('0x11')](_0x254f7a));if(_0x254f7a[_0xc0e1('0x12')]){if(_0x254f7a['error'][_0xc0e1('0x13')]===0x1f4){logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);return _0x144609(_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);}logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);return _0x14a4b7(_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);}else{logger[_0xc0e1('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0xc0e1('0xe'));_0x14a4b7(_0x254f7a['result'][_0xc0e1('0x14')]);}})[_0xc0e1('0x15')](function(_0xc50504){logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0xc50504);_0x144609(_0xc50504);});});}exports[_0xc0e1('0x16')]=function(_0x2ff42f){var _0x5e1888=this;return new Promise(function(_0x59392b,_0x410231){return db[_0xc0e1('0x17')][_0xc0e1('0x18')]({'raw':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f['options'][_0xc0e1('0x1b')]||null:null,'attributes':_0x2ff42f['options']?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1c')]||null:null,'limit':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1d')]||null:null,'include':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f['options']['include']?_[_0xc0e1('0x1e')](_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1f')],function(_0x185e63){return{'model':db[_0x185e63['model']],'as':_0x185e63['as'],'attributes':_0x185e63[_0xc0e1('0x1c')],'include':_0x185e63['include']?_[_0xc0e1('0x1e')](_0x185e63['include'],function(_0x44c34a){return{'model':db[_0x44c34a['model']],'as':_0x44c34a['as'],'attributes':_0x44c34a[_0xc0e1('0x1c')],'include':_0x44c34a[_0xc0e1('0x1f')]?_['map'](_0x44c34a['include'],function(_0x1a8e3e){return{'model':db[_0x1a8e3e['model']],'as':_0x1a8e3e['as'],'attributes':_0x1a8e3e[_0xc0e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0e1('0x20')](function(_0x177358){logger[_0xc0e1('0xc')]('GetZendeskAccount',_0x2ff42f);logger[_0xc0e1('0xf')](_0xc0e1('0x16'),_0x2ff42f,JSON['stringify'](_0x177358));_0x59392b(_0x177358);})[_0xc0e1('0x15')](function(_0x4aee04){logger[_0xc0e1('0x12')]('GetZendeskAccount',_0x4aee04[_0xc0e1('0x14')],_0x2ff42f);_0x410231(_0x5e1888[_0xc0e1('0x12')](0x1f4,_0x4aee04['message']));});});};exports[_0xc0e1('0x21')]=function(_0x159caa){var _0x4b8213=this;return new Promise(function(_0x50b12f,_0x464080){return db[_0xc0e1('0x17')][_0xc0e1('0x22')]({'raw':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1b')]||null:null,'attributes':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1c')]||null:null,'include':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x159caa[_0xc0e1('0x19')]['include'],function(_0x586489){return{'model':db[_0x586489[_0xc0e1('0x23')]],'as':_0x586489['as'],'attributes':_0x586489['attributes'],'include':_0x586489[_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x586489[_0xc0e1('0x1f')],function(_0x18914d){return{'model':db[_0x18914d[_0xc0e1('0x23')]],'as':_0x18914d['as'],'attributes':_0x18914d[_0xc0e1('0x1c')],'include':_0x18914d[_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x18914d[_0xc0e1('0x1f')],function(_0x296f74){return{'model':db[_0x296f74[_0xc0e1('0x23')]],'as':_0x296f74['as'],'attributes':_0x296f74[_0xc0e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0e1('0x20')](function(_0x4fb759){logger[_0xc0e1('0xc')]('ShowZendeskAccount',_0x159caa);logger[_0xc0e1('0xf')](_0xc0e1('0x21'),_0x159caa,JSON[_0xc0e1('0x11')](_0x4fb759));_0x50b12f(_0x4fb759);})[_0xc0e1('0x15')](function(_0x36759b){logger[_0xc0e1('0x12')](_0xc0e1('0x21'),_0x36759b['message'],_0x159caa);_0x464080(_0x4b8213[_0xc0e1('0x12')](0x1f4,_0x36759b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index fa72447..e96bcd8 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 _0x2fb5=['destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x2fb5,0xff));var _0x52fb=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x2fb5[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x52fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x52fb('0x1'));var express=require(_0x52fb('0x2'));var router=express[_0x52fb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x52fb('0x4'));var config=require(_0x52fb('0x5'));var controller=require(_0x52fb('0x6'));router[_0x52fb('0x7')]('/',auth['isAuthenticated'](),controller[_0x52fb('0x8')]);router['get'](_0x52fb('0x9'),auth[_0x52fb('0xa')](),controller[_0x52fb('0xb')]);router[_0x52fb('0x7')](_0x52fb('0xc'),auth[_0x52fb('0xa')](),controller['getFields']);router[_0x52fb('0x7')]('/:id/subjects',auth[_0x52fb('0xa')](),controller[_0x52fb('0xd')]);router[_0x52fb('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x52fb('0xe')]);router['get'](_0x52fb('0xf'),auth['isAuthenticated'](),controller[_0x52fb('0x10')]);router[_0x52fb('0x11')]('/',auth[_0x52fb('0xa')](),controller[_0x52fb('0x12')]);router['post'](_0x52fb('0xf'),auth[_0x52fb('0xa')](),controller[_0x52fb('0x13')]);router[_0x52fb('0x14')]('/:id',auth[_0x52fb('0xa')](),controller['update']);router['delete']('/:id',auth[_0x52fb('0xa')](),controller[_0x52fb('0x15')]);module[_0x52fb('0x16')]=router; \ No newline at end of file +var _0x642c=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x642c,0x17b));var _0xc642=function(_0x2b67f7,_0x3df538){_0x2b67f7=_0x2b67f7-0x0;var _0x61fc62=_0x642c[_0x2b67f7];return _0x61fc62;};'use strict';var multer=require(_0xc642('0x0'));var util=require(_0xc642('0x1'));var path=require(_0xc642('0x2'));var timeout=require('connect-timeout');var express=require(_0xc642('0x3'));var router=express[_0xc642('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc642('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0xc642('0x6')]('/',auth[_0xc642('0x7')](),controller['index']);router[_0xc642('0x6')](_0xc642('0x8'),auth[_0xc642('0x7')](),controller[_0xc642('0x9')]);router[_0xc642('0x6')](_0xc642('0xa'),auth[_0xc642('0x7')](),controller[_0xc642('0xb')]);router['get'](_0xc642('0xc'),auth[_0xc642('0x7')](),controller['getSubjects']);router[_0xc642('0x6')](_0xc642('0xd'),auth[_0xc642('0x7')](),controller[_0xc642('0xe')]);router['get'](_0xc642('0xf'),auth[_0xc642('0x7')](),controller[_0xc642('0x10')]);router[_0xc642('0x11')]('/',auth['isAuthenticated'](),controller[_0xc642('0x12')]);router[_0xc642('0x11')](_0xc642('0xf'),auth[_0xc642('0x7')](),controller[_0xc642('0x13')]);router[_0xc642('0x14')](_0xc642('0x8'),auth['isAuthenticated'](),controller[_0xc642('0x15')]);router[_0xc642('0x16')](_0xc642('0x8'),auth[_0xc642('0x7')](),controller[_0xc642('0x17')]);module[_0xc642('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 8fbf269..0c6d4dc 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 _0xd929=['STRING','sequelize','exports'];(function(_0x2ba5a8,_0x331996){var _0x53b347=function(_0x446d5e){while(--_0x446d5e){_0x2ba5a8['push'](_0x2ba5a8['shift']());}};_0x53b347(++_0x331996);}(_0xd929,0x11b));var _0x9d92=function(_0x51813e,_0x12e0af){_0x51813e=_0x51813e-0x0;var _0x53fb97=_0xd929[_0x51813e];return _0x53fb97;};'use strict';var Sequelize=require(_0x9d92('0x0'));module[_0x9d92('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9d92('0x2')]}}; \ No newline at end of file +var _0xbbb8=['STRING'];(function(_0x3c9b15,_0x2fae5d){var _0x55344e=function(_0x5dad0d){while(--_0x5dad0d){_0x3c9b15['push'](_0x3c9b15['shift']());}};_0x55344e(++_0x2fae5d);}(_0xbbb8,0xc6));var _0x8bbb=function(_0x324197,_0x106d9d){_0x324197=_0x324197-0x0;var _0x121f8b=_0xbbb8[_0x324197];return _0x121f8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8bbb('0x0')]},'description':{'type':Sequelize[_0x8bbb('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index ea5e3b6..68f4293 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 _0x9c44=['order','sort','where','pick','filter','map','type','key','field','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','getFields','ZendeskField','getSubjects','findOne','getDescriptions','Tag','getTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','catch','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','update','destroy','name','send','index','ZendeskConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x132605,_0x18f711){var _0x1312d3=function(_0x45db2e){while(--_0x45db2e){_0x132605['push'](_0x132605['shift']());}};_0x1312d3(++_0x18f711);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x49c4('0x13'));var client=jayson[_0x49c4('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x7df3a9,_0x403bfb,_0x5f2fd9){if(_0x5f2fd9){var _0x1909fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1909fe[_0x49c4('0x15')](_0x403bfb)){return _0x7df3a9;}else{throw new Error(_0x49c4('0x16'));}}else{return _0x7df3a9;}}function respondWithRpcPromise(_0x2decee,_0x12777c,_0x18211c,_0x75ea8){return new BPromise(function(_0x3de397,_0x58d177){var _0x3acd06=_0x75ea8||client;return _0x3acd06[_0x49c4('0x17')](_0x2decee,_0x18211c)[_0x49c4('0x18')](function(_0x81e831){logger[_0x49c4('0x19')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12777c,_0x49c4('0x1a'));logger[_0x49c4('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x12777c,'request\x20sent',JSON[_0x49c4('0x1c')](_0x81e831));if(_0x81e831[_0x49c4('0x1d')]){if(_0x81e831[_0x49c4('0x1d')]['code']===0x1f4){logger[_0x49c4('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12777c,_0x81e831[_0x49c4('0x1d')][_0x49c4('0x1e')]);return _0x58d177(_0x81e831[_0x49c4('0x1d')][_0x49c4('0x1e')]);}logger[_0x49c4('0x1d')](_0x49c4('0x1f'),_0x12777c,_0x81e831[_0x49c4('0x1d')][_0x49c4('0x1e')]);return _0x3de397(_0x81e831[_0x49c4('0x1d')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x12777c,_0x49c4('0x1a'));_0x3de397(_0x81e831['result']['message']);}})[_0x49c4('0x20')](function(_0x15581b){logger[_0x49c4('0x1d')](_0x49c4('0x1f'),_0x12777c,_0x15581b);_0x58d177(_0x15581b);});});}function respondWithStatusCode(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0xcc;return function(_0x180276){if(_0x180276){return _0x4811c4[_0x49c4('0x21')](_0x5850f2);}return _0x4811c4['status'](_0x5850f2)[_0x49c4('0x22')]();};}function respondWithResult(_0x43e014,_0x210159){_0x210159=_0x210159||0xc8;return function(_0xa7a826){if(_0xa7a826){return _0x43e014['status'](_0x210159)['json'](_0xa7a826);}};}function respondWithFilteredResult(_0x449960,_0x53c199){return function(_0x3800b7){if(_0x3800b7){var _0x3852b2=_0x3800b7[_0x49c4('0x23')],_0x3f1708=_0x53c199[_0x49c4('0x24')],_0x372a47=_0x53c199[_0x49c4('0x24')]+_0x53c199[_0x49c4('0x25')],_0x5987ae;if(_0x372a47>=_0x3852b2){_0x372a47=_0x3852b2;_0x5987ae=0xc8;}else{_0x5987ae=0xce;}_0x449960[_0x49c4('0x26')](_0x5987ae);return _0x449960[_0x49c4('0x27')](_0x49c4('0x28'),_0x3f1708+'-'+_0x372a47+'/'+_0x3852b2)[_0x49c4('0x29')](_0x3800b7);}return null;};}function patchUpdates(_0x17b50f){return function(_0x2cbd88){try{jsonpatch[_0x49c4('0x2a')](_0x2cbd88,_0x17b50f,!![]);}catch(_0x4ea6ea){return BPromise['reject'](_0x4ea6ea);}return _0x2cbd88['save']();};}function saveUpdates(_0x134928,_0x7ee704){return function(_0x1eb035){if(_0x1eb035){return _0x1eb035[_0x49c4('0x2b')](_0x134928)[_0x49c4('0x18')](function(_0x574fd3){return _0x574fd3;});}return null;};}function removeEntity(_0x38ad77,_0x116eb4){return function(_0x2e7a69){if(_0x2e7a69){return _0x2e7a69[_0x49c4('0x2c')]()['then'](function(){_0x38ad77['status'](0xcc)[_0x49c4('0x22')]();});}};}function handleEntityNotFound(_0x9a1bed,_0x167efe){return function(_0x13b3b4){if(!_0x13b3b4){_0x9a1bed[_0x49c4('0x21')](0x194);}return _0x13b3b4;};}function handleError(_0x4a0c7a,_0x2aac35){_0x2aac35=_0x2aac35||0x1f4;return function(_0x84c621){logger[_0x49c4('0x1d')](_0x84c621['stack']);if(_0x84c621['name']){delete _0x84c621[_0x49c4('0x2d')];}_0x4a0c7a[_0x49c4('0x26')](_0x2aac35)[_0x49c4('0x2e')](_0x84c621);};}exports[_0x49c4('0x2f')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557={},_0x27ef5f={},_0x3209cd={'count':0x0,'rows':[]};var _0x4e0209=db[_0x49c4('0x30')]['rawAttributes'];_0x27ef5f[_0x49c4('0x31')]=_[_0x49c4('0x32')](_0x4e0209);_0x27ef5f[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x2b45a1['query']);_0x27ef5f[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x27ef5f[_0x49c4('0x31')],_0x27ef5f['query']);_0x1d1557[_0x49c4('0x36')]=_[_0x49c4('0x35')](_0x27ef5f[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x37')]));_0x1d1557[_0x49c4('0x36')]=_0x1d1557[_0x49c4('0x36')][_0x49c4('0x38')]?_0x1d1557[_0x49c4('0x36')]:_0x27ef5f[_0x49c4('0x31')];if(!_0x2b45a1['query'][_0x49c4('0x39')](_0x49c4('0x3a'))){_0x1d1557[_0x49c4('0x25')]=qs[_0x49c4('0x25')](_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x25')]);_0x1d1557[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x24')]);}_0x1d1557[_0x49c4('0x3b')]=qs[_0x49c4('0x3c')](_0x2b45a1[_0x49c4('0x33')]['sort']);_0x1d1557[_0x49c4('0x3d')]=qs['filters'](_[_0x49c4('0x3e')](_0x2b45a1[_0x49c4('0x33')],_0x27ef5f[_0x49c4('0x34')]));if(_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x3f')]){_0x1d1557[_0x49c4('0x3d')]=_['merge'](_0x1d1557['where'],{'$or':_[_0x49c4('0x40')](_0x4e0209,function(_0x1e7bdc){if(_0x1e7bdc[_0x49c4('0x41')][_0x49c4('0x42')]!=='VIRTUAL'){var _0x3baff9={};_0x3baff9[_0x1e7bdc[_0x49c4('0x43')]]={'$like':'%'+_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x3f')]+'%'};return _0x3baff9;}})});}_0x1d1557=_[_0x49c4('0x44')]({},_0x1d1557,_0x2b45a1[_0x49c4('0x45')]);var _0x1a9593={'where':_0x1d1557[_0x49c4('0x3d')]};return db[_0x49c4('0x30')]['count'](_0x1a9593)[_0x49c4('0x18')](function(_0x4d27d0){_0x3209cd[_0x49c4('0x23')]=_0x4d27d0;if(_0x2b45a1[_0x49c4('0x33')][_0x49c4('0x46')]){_0x1d1557[_0x49c4('0x47')]=[{'all':!![]}];}return db[_0x49c4('0x30')]['findAll'](_0x1d1557);})[_0x49c4('0x18')](function(_0x15b674){_0x3209cd[_0x49c4('0x48')]=_0x15b674;return _0x3209cd;})[_0x49c4('0x18')](respondWithFilteredResult(_0x2cf897,_0x1d1557))[_0x49c4('0x20')](handleError(_0x2cf897,null));};exports[_0x49c4('0x49')]=function(_0x9779ef,_0x4d89e0){var _0x3bac1b={'raw':![],'where':{'id':_0x9779ef[_0x49c4('0x4a')]['id']}},_0x5cfff9={};_0x5cfff9[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x30')][_0x49c4('0x4b')]);_0x5cfff9[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x9779ef['query']);_0x5cfff9[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x5cfff9['model'],_0x5cfff9[_0x49c4('0x33')]);_0x3bac1b[_0x49c4('0x36')]=_[_0x49c4('0x35')](_0x5cfff9[_0x49c4('0x31')],qs['fields'](_0x9779ef['query'][_0x49c4('0x37')]));_0x3bac1b['attributes']=_0x3bac1b[_0x49c4('0x36')][_0x49c4('0x38')]?_0x3bac1b[_0x49c4('0x36')]:_0x5cfff9[_0x49c4('0x31')];if(_0x9779ef[_0x49c4('0x33')][_0x49c4('0x46')]){_0x3bac1b[_0x49c4('0x47')]=[{'all':!![]}];}_0x3bac1b=_['merge']({},_0x3bac1b,_0x9779ef[_0x49c4('0x45')]);return db[_0x49c4('0x30')][_0x49c4('0x4c')](_0x3bac1b)[_0x49c4('0x18')](handleEntityNotFound(_0x4d89e0,null))[_0x49c4('0x18')](respondWithResult(_0x4d89e0,null))[_0x49c4('0x20')](handleError(_0x4d89e0,null));};exports[_0x49c4('0x4d')]=function(_0x25d174,_0x1e0b4f){return db[_0x49c4('0x30')]['create'](_0x25d174['body'],{})[_0x49c4('0x18')](respondWithResult(_0x1e0b4f,0xc9))[_0x49c4('0x20')](handleError(_0x1e0b4f,null));};exports['update']=function(_0x59a8bc,_0x77163d){if(_0x59a8bc['body']['id']){delete _0x59a8bc['body']['id'];}return db[_0x49c4('0x30')][_0x49c4('0x4c')]({'where':{'id':_0x59a8bc[_0x49c4('0x4a')]['id']}})[_0x49c4('0x18')](handleEntityNotFound(_0x77163d,null))[_0x49c4('0x18')](saveUpdates(_0x59a8bc[_0x49c4('0x4e')],null))[_0x49c4('0x18')](respondWithResult(_0x77163d,null))['catch'](handleError(_0x77163d,null));};exports[_0x49c4('0x2c')]=function(_0xcc6a2b,_0x207572){return db[_0x49c4('0x30')][_0x49c4('0x4c')]({'where':{'id':_0xcc6a2b[_0x49c4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x207572,null))['then'](removeEntity(_0x207572,null))[_0x49c4('0x20')](handleError(_0x207572,null));};exports[_0x49c4('0x4f')]=function(_0x2a6308,_0xf7a10f,_0x23288e){var _0x6b2592={};var _0xc2033f={};var _0x58dc5f;var _0x45d715;return db[_0x49c4('0x30')]['findOne']({'where':{'id':_0x2a6308[_0x49c4('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf7a10f,null))[_0x49c4('0x18')](function(_0x147ebd){if(_0x147ebd){_0x58dc5f=_0x147ebd;_0xc2033f[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x50')][_0x49c4('0x4b')]);_0xc2033f[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x2a6308['query']);_0xc2033f[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0xc2033f['model'],_0xc2033f[_0x49c4('0x33')]);_0x6b2592[_0x49c4('0x36')]=_['intersection'](_0xc2033f[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x2a6308['query']['fields']));_0x6b2592['attributes']=_0x6b2592['attributes'][_0x49c4('0x38')]?_0x6b2592['attributes']:_0xc2033f[_0x49c4('0x31')];_0x6b2592[_0x49c4('0x3b')]=qs['sort'](_0x2a6308[_0x49c4('0x33')][_0x49c4('0x3c')]);_0x6b2592['where']=qs[_0x49c4('0x34')](_[_0x49c4('0x3e')](_0x2a6308[_0x49c4('0x33')],_0xc2033f[_0x49c4('0x34')]));if(_0x2a6308['query'][_0x49c4('0x3f')]){_0x6b2592[_0x49c4('0x3d')]=_[_0x49c4('0x44')](_0x6b2592[_0x49c4('0x3d')],{'$or':_['map'](_0x6b2592[_0x49c4('0x36')],function(_0x4a93bc){var _0x568457={};_0x568457[_0x4a93bc]={'$like':'%'+_0x2a6308['query']['filter']+'%'};return _0x568457;})});}_0x6b2592=_[_0x49c4('0x44')]({},_0x6b2592,_0x2a6308[_0x49c4('0x45')]);return _0x58dc5f[_0x49c4('0x4f')](_0x6b2592);}})[_0x49c4('0x18')](function(_0x5b056e){if(_0x5b056e){_0x45d715=_0x5b056e['length'];if(!_0x2a6308[_0x49c4('0x33')][_0x49c4('0x39')](_0x49c4('0x3a'))){_0x6b2592[_0x49c4('0x25')]=qs[_0x49c4('0x25')](_0x2a6308[_0x49c4('0x33')][_0x49c4('0x25')]);_0x6b2592[_0x49c4('0x24')]=qs['offset'](_0x2a6308[_0x49c4('0x33')]['offset']);}return _0x58dc5f[_0x49c4('0x4f')](_0x6b2592);}})[_0x49c4('0x18')](function(_0x1a5d4c){if(_0x1a5d4c){return _0x1a5d4c?{'count':_0x45d715,'rows':_0x1a5d4c}:null;}})[_0x49c4('0x18')](respondWithResult(_0xf7a10f,null))[_0x49c4('0x20')](handleError(_0xf7a10f,null));};exports[_0x49c4('0x51')]=function(_0x13d657,_0x3feb0b,_0x13d951){var _0x1743d0={};var _0x1e3911={};var _0x1c5315;var _0x217ced;return db[_0x49c4('0x30')][_0x49c4('0x52')]({'where':{'id':_0x13d657[_0x49c4('0x4a')]['id']}})[_0x49c4('0x18')](handleEntityNotFound(_0x3feb0b,null))[_0x49c4('0x18')](function(_0x4e1544){if(_0x4e1544){_0x1c5315=_0x4e1544;_0x1e3911['model']=_[_0x49c4('0x32')](db[_0x49c4('0x50')]['rawAttributes']);_0x1e3911[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x13d657[_0x49c4('0x33')]);_0x1e3911[_0x49c4('0x34')]=_['intersection'](_0x1e3911['model'],_0x1e3911['query']);_0x1743d0[_0x49c4('0x36')]=_[_0x49c4('0x35')](_0x1e3911[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x13d657[_0x49c4('0x33')][_0x49c4('0x37')]));_0x1743d0[_0x49c4('0x36')]=_0x1743d0[_0x49c4('0x36')][_0x49c4('0x38')]?_0x1743d0['attributes']:_0x1e3911[_0x49c4('0x31')];_0x1743d0[_0x49c4('0x3b')]=qs[_0x49c4('0x3c')](_0x13d657['query'][_0x49c4('0x3c')]);_0x1743d0[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3e')](_0x13d657[_0x49c4('0x33')],_0x1e3911[_0x49c4('0x34')]));if(_0x13d657[_0x49c4('0x33')][_0x49c4('0x3f')]){_0x1743d0['where']=_[_0x49c4('0x44')](_0x1743d0[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x40')](_0x1743d0[_0x49c4('0x36')],function(_0x1e948a){var _0x4a204d={};_0x4a204d[_0x1e948a]={'$like':'%'+_0x13d657['query'][_0x49c4('0x3f')]+'%'};return _0x4a204d;})});}_0x1743d0=_['merge']({},_0x1743d0,_0x13d657[_0x49c4('0x45')]);return _0x1c5315['getSubjects'](_0x1743d0);}})[_0x49c4('0x18')](function(_0x27b77d){if(_0x27b77d){_0x217ced=_0x27b77d[_0x49c4('0x38')];if(!_0x13d657[_0x49c4('0x33')]['hasOwnProperty'](_0x49c4('0x3a'))){_0x1743d0[_0x49c4('0x25')]=qs[_0x49c4('0x25')](_0x13d657[_0x49c4('0x33')][_0x49c4('0x25')]);_0x1743d0[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x13d657[_0x49c4('0x33')][_0x49c4('0x24')]);}return _0x1c5315[_0x49c4('0x51')](_0x1743d0);}})['then'](function(_0x228189){if(_0x228189){return _0x228189?{'count':_0x217ced,'rows':_0x228189}:null;}})[_0x49c4('0x18')](respondWithResult(_0x3feb0b,null))['catch'](handleError(_0x3feb0b,null));};exports[_0x49c4('0x53')]=function(_0x5c7e8c,_0x1e6644,_0x1bfb8d){var _0x1f14a6={};var _0x28b0db={};var _0x2c32c0;var _0x58b90c;return db[_0x49c4('0x30')][_0x49c4('0x52')]({'where':{'id':_0x5c7e8c['params']['id']}})[_0x49c4('0x18')](handleEntityNotFound(_0x1e6644,null))[_0x49c4('0x18')](function(_0x4eb72a){if(_0x4eb72a){_0x2c32c0=_0x4eb72a;_0x28b0db[_0x49c4('0x31')]=_[_0x49c4('0x32')](db['ZendeskField'][_0x49c4('0x4b')]);_0x28b0db[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x5c7e8c[_0x49c4('0x33')]);_0x28b0db['filters']=_[_0x49c4('0x35')](_0x28b0db[_0x49c4('0x31')],_0x28b0db['query']);_0x1f14a6[_0x49c4('0x36')]=_['intersection'](_0x28b0db['model'],qs[_0x49c4('0x37')](_0x5c7e8c['query']['fields']));_0x1f14a6[_0x49c4('0x36')]=_0x1f14a6[_0x49c4('0x36')]['length']?_0x1f14a6[_0x49c4('0x36')]:_0x28b0db['model'];_0x1f14a6['order']=qs['sort'](_0x5c7e8c[_0x49c4('0x33')][_0x49c4('0x3c')]);_0x1f14a6[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_['pick'](_0x5c7e8c['query'],_0x28b0db[_0x49c4('0x34')]));if(_0x5c7e8c['query'][_0x49c4('0x3f')]){_0x1f14a6['where']=_[_0x49c4('0x44')](_0x1f14a6[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x40')](_0x1f14a6[_0x49c4('0x36')],function(_0x12d060){var _0x198924={};_0x198924[_0x12d060]={'$like':'%'+_0x5c7e8c[_0x49c4('0x33')]['filter']+'%'};return _0x198924;})});}_0x1f14a6=_[_0x49c4('0x44')]({},_0x1f14a6,_0x5c7e8c[_0x49c4('0x45')]);return _0x2c32c0[_0x49c4('0x53')](_0x1f14a6);}})[_0x49c4('0x18')](function(_0x6571a2){if(_0x6571a2){_0x58b90c=_0x6571a2['length'];if(!_0x5c7e8c[_0x49c4('0x33')][_0x49c4('0x39')](_0x49c4('0x3a'))){_0x1f14a6['limit']=qs['limit'](_0x5c7e8c[_0x49c4('0x33')][_0x49c4('0x25')]);_0x1f14a6[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x5c7e8c[_0x49c4('0x33')]['offset']);}return _0x2c32c0[_0x49c4('0x53')](_0x1f14a6);}})[_0x49c4('0x18')](function(_0x191974){if(_0x191974){return _0x191974?{'count':_0x58b90c,'rows':_0x191974}:null;}})[_0x49c4('0x18')](respondWithResult(_0x1e6644,null))['catch'](handleError(_0x1e6644,null));};exports['getTags']=function(_0x2ca918,_0x1d710a,_0x467213){var _0x294ba0={};var _0x3dac77={};var _0x5413d8;var _0x389edb;return db[_0x49c4('0x30')][_0x49c4('0x52')]({'where':{'id':_0x2ca918[_0x49c4('0x4a')]['id']}})[_0x49c4('0x18')](handleEntityNotFound(_0x1d710a,null))[_0x49c4('0x18')](function(_0x4d60cc){if(_0x4d60cc){_0x5413d8=_0x4d60cc;_0x3dac77[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x54')][_0x49c4('0x4b')]);_0x3dac77['query']=_['keys'](_0x2ca918[_0x49c4('0x33')]);_0x3dac77['filters']=_[_0x49c4('0x35')](_0x3dac77['model'],_0x3dac77[_0x49c4('0x33')]);_0x294ba0[_0x49c4('0x36')]=_[_0x49c4('0x35')](_0x3dac77[_0x49c4('0x31')],qs['fields'](_0x2ca918['query'][_0x49c4('0x37')]));_0x294ba0[_0x49c4('0x36')]=_0x294ba0[_0x49c4('0x36')]['length']?_0x294ba0['attributes']:_0x3dac77[_0x49c4('0x31')];_0x294ba0['order']=qs['sort'](_0x2ca918[_0x49c4('0x33')]['sort']);_0x294ba0[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_['pick'](_0x2ca918[_0x49c4('0x33')],_0x3dac77[_0x49c4('0x34')]));if(_0x2ca918['query']['filter']){_0x294ba0[_0x49c4('0x3d')]=_['merge'](_0x294ba0[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x40')](_0x294ba0[_0x49c4('0x36')],function(_0x352733){var _0x1bfc82={};_0x1bfc82[_0x352733]={'$like':'%'+_0x2ca918[_0x49c4('0x33')][_0x49c4('0x3f')]+'%'};return _0x1bfc82;})});}_0x294ba0=_['merge']({},_0x294ba0,_0x2ca918[_0x49c4('0x45')]);return _0x5413d8[_0x49c4('0x55')](_0x294ba0);}})[_0x49c4('0x18')](function(_0xcc42bf){if(_0xcc42bf){_0x389edb=_0xcc42bf[_0x49c4('0x38')];if(!_0x2ca918['query'][_0x49c4('0x39')]('nolimit')){_0x294ba0[_0x49c4('0x25')]=qs[_0x49c4('0x25')](_0x2ca918[_0x49c4('0x33')][_0x49c4('0x25')]);_0x294ba0['offset']=qs[_0x49c4('0x24')](_0x2ca918[_0x49c4('0x33')][_0x49c4('0x24')]);}return _0x5413d8[_0x49c4('0x55')](_0x294ba0);}})[_0x49c4('0x18')](function(_0x315c35){if(_0x315c35){return _0x315c35?{'count':_0x389edb,'rows':_0x315c35}:null;}})['then'](respondWithResult(_0x1d710a,null))[_0x49c4('0x20')](handleError(_0x1d710a,null));};exports['setTags']=function(_0xac53ad,_0x24929d,_0x1db53d){if(_0xac53ad[_0x49c4('0x4e')]['id']){delete _0xac53ad['body']['id'];}return db[_0x49c4('0x30')][_0x49c4('0x52')]({'where':{'id':_0xac53ad['params']['id']}})[_0x49c4('0x18')](handleEntityNotFound(_0x24929d,null))[_0x49c4('0x18')](function(_0x4971b1){if(_0x4971b1){return _0x4971b1['setTags'](_0xac53ad[_0x49c4('0x4e')][_0x49c4('0x56')]||[]);}return null;})[_0x49c4('0x18')](respondWithResult(_0x24929d,null))[_0x49c4('0x20')](handleError(_0x24929d,null));}; \ No newline at end of file +var _0x70e0=['includeAll','findAll','rows','show','params','options','find','create','body','update','getFields','findOne','hasOwnProperty','getSubjects','getDescriptions','ZendeskField','getTags','setTags','ids','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','info','result','message','catch','status','json','count','offset','set','Content-Range','apply','save','destroy','stack','send','index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','map','type','key','filter','merge'];(function(_0x4bd02f,_0x1ab387){var _0x54379a=function(_0x332df4){while(--_0x332df4){_0x4bd02f['push'](_0x4bd02f['shift']());}};_0x54379a(++_0x1ab387);}(_0x70e0,0x17b));var _0x070e=function(_0x43e6bd,_0x113c20){_0x43e6bd=_0x43e6bd-0x0;var _0x32e42c=_0x70e0[_0x43e6bd];return _0x32e42c;};'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 hardwareService=require(_0x070e('0xf'));var logger=require(_0x070e('0x10'))(_0x070e('0x11'));var utils=require(_0x070e('0x12'));var config=require(_0x070e('0x13'));var db=require(_0x070e('0x14'))['db'];var jayson=require(_0x070e('0x15'));var client=jayson[_0x070e('0x16')][_0x070e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5bf079,_0x2930b8,_0x52da3b){if(_0x52da3b){var _0x5dca0f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dca0f[_0x070e('0x18')](_0x2930b8)){return _0x5bf079;}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 _0x5bf079;}}function respondWithRpcPromise(_0x4a33d2,_0x5bae0f,_0x11d2ce,_0x14c3fd){return new BPromise(function(_0x51d14d,_0x5d3a38){var _0x373d86=_0x14c3fd||client;return _0x373d86[_0x070e('0x19')](_0x4a33d2,_0x11d2ce)[_0x070e('0x1a')](function(_0x19d9da){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5bae0f,_0x070e('0x1b'));logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x5bae0f,_0x070e('0x1b'),JSON[_0x070e('0x1e')](_0x19d9da));if(_0x19d9da['error']){if(_0x19d9da[_0x070e('0x1f')][_0x070e('0x20')]===0x1f4){logger[_0x070e('0x1f')](_0x070e('0x21'),_0x5bae0f,_0x19d9da[_0x070e('0x1f')]['message']);return _0x5d3a38(_0x19d9da['error']['message']);}logger[_0x070e('0x1f')](_0x070e('0x21'),_0x5bae0f,_0x19d9da[_0x070e('0x1f')]['message']);return _0x51d14d(_0x19d9da[_0x070e('0x1f')]['message']);}else{logger[_0x070e('0x22')](_0x070e('0x21'),_0x5bae0f,_0x070e('0x1b'));_0x51d14d(_0x19d9da[_0x070e('0x23')][_0x070e('0x24')]);}})[_0x070e('0x25')](function(_0xe405e){logger[_0x070e('0x1f')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5bae0f,_0xe405e);_0x5d3a38(_0xe405e);});});}function respondWithStatusCode(_0x2f8055,_0x270061){_0x270061=_0x270061||0xcc;return function(_0x4790eb){if(_0x4790eb){return _0x2f8055['sendStatus'](_0x270061);}return _0x2f8055[_0x070e('0x26')](_0x270061)['end']();};}function respondWithResult(_0x4a2dbd,_0x2ccbd7){_0x2ccbd7=_0x2ccbd7||0xc8;return function(_0x25f6e){if(_0x25f6e){return _0x4a2dbd[_0x070e('0x26')](_0x2ccbd7)[_0x070e('0x27')](_0x25f6e);}};}function respondWithFilteredResult(_0x4763c6,_0x497f58){return function(_0x374c54){if(_0x374c54){var _0x219e48=_0x374c54[_0x070e('0x28')],_0x1d72d6=_0x497f58[_0x070e('0x29')],_0x1d2a34=_0x497f58[_0x070e('0x29')]+_0x497f58['limit'],_0x43dd96;if(_0x1d2a34>=_0x219e48){_0x1d2a34=_0x219e48;_0x43dd96=0xc8;}else{_0x43dd96=0xce;}_0x4763c6[_0x070e('0x26')](_0x43dd96);return _0x4763c6[_0x070e('0x2a')](_0x070e('0x2b'),_0x1d72d6+'-'+_0x1d2a34+'/'+_0x219e48)['json'](_0x374c54);}return null;};}function patchUpdates(_0x5c5f0d){return function(_0x13097f){try{jsonpatch[_0x070e('0x2c')](_0x13097f,_0x5c5f0d,!![]);}catch(_0xa6c0ab){return BPromise['reject'](_0xa6c0ab);}return _0x13097f[_0x070e('0x2d')]();};}function saveUpdates(_0x1741a1,_0x3a9425){return function(_0x5f2bee){if(_0x5f2bee){return _0x5f2bee['update'](_0x1741a1)['then'](function(_0x523b75){return _0x523b75;});}return null;};}function removeEntity(_0x59c5b4,_0xdf8945){return function(_0x4e0a7d){if(_0x4e0a7d){return _0x4e0a7d[_0x070e('0x2e')]()[_0x070e('0x1a')](function(){_0x59c5b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x699739,_0x3454c7){return function(_0x55288a){if(!_0x55288a){_0x699739['sendStatus'](0x194);}return _0x55288a;};}function handleError(_0x41ade4,_0x27dd1f){_0x27dd1f=_0x27dd1f||0x1f4;return function(_0x444d02){logger[_0x070e('0x1f')](_0x444d02[_0x070e('0x2f')]);if(_0x444d02['name']){delete _0x444d02['name'];}_0x41ade4[_0x070e('0x26')](_0x27dd1f)[_0x070e('0x30')](_0x444d02);};}exports[_0x070e('0x31')]=function(_0xf57ed,_0xf11439){var _0x4deaf8={},_0x22f3a9={},_0x1927f4={'count':0x0,'rows':[]};var _0x534150=db[_0x070e('0x32')][_0x070e('0x33')];_0x22f3a9['model']=_['keys'](_0x534150);_0x22f3a9['query']=_[_0x070e('0x34')](_0xf57ed[_0x070e('0x35')]);_0x22f3a9[_0x070e('0x36')]=_[_0x070e('0x37')](_0x22f3a9[_0x070e('0x38')],_0x22f3a9['query']);_0x4deaf8[_0x070e('0x39')]=_[_0x070e('0x37')](_0x22f3a9[_0x070e('0x38')],qs['fields'](_0xf57ed[_0x070e('0x35')][_0x070e('0x3a')]));_0x4deaf8[_0x070e('0x39')]=_0x4deaf8['attributes'][_0x070e('0x3b')]?_0x4deaf8[_0x070e('0x39')]:_0x22f3a9['model'];if(!_0xf57ed[_0x070e('0x35')]['hasOwnProperty'](_0x070e('0x3c'))){_0x4deaf8[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0xf57ed[_0x070e('0x35')][_0x070e('0x3d')]);_0x4deaf8['offset']=qs[_0x070e('0x29')](_0xf57ed['query']['offset']);}_0x4deaf8[_0x070e('0x3e')]=qs[_0x070e('0x3f')](_0xf57ed[_0x070e('0x35')]['sort']);_0x4deaf8[_0x070e('0x40')]=qs[_0x070e('0x36')](_[_0x070e('0x41')](_0xf57ed[_0x070e('0x35')],_0x22f3a9['filters']));if(_0xf57ed[_0x070e('0x35')]['filter']){_0x4deaf8['where']=_['merge'](_0x4deaf8[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x534150,function(_0x26b3e2){if(_0x26b3e2[_0x070e('0x43')][_0x070e('0x44')]!=='VIRTUAL'){var _0x18607f={};_0x18607f[_0x26b3e2['field']]={'$like':'%'+_0xf57ed[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x18607f;}})});}_0x4deaf8=_[_0x070e('0x46')]({},_0x4deaf8,_0xf57ed['options']);var _0x54285a={'where':_0x4deaf8[_0x070e('0x40')]};return db['ZendeskConfiguration'][_0x070e('0x28')](_0x54285a)[_0x070e('0x1a')](function(_0x139820){_0x1927f4['count']=_0x139820;if(_0xf57ed[_0x070e('0x35')][_0x070e('0x47')]){_0x4deaf8['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x070e('0x48')](_0x4deaf8);})[_0x070e('0x1a')](function(_0x2d43ce){_0x1927f4[_0x070e('0x49')]=_0x2d43ce;return _0x1927f4;})[_0x070e('0x1a')](respondWithFilteredResult(_0xf11439,_0x4deaf8))['catch'](handleError(_0xf11439,null));};exports[_0x070e('0x4a')]=function(_0x3f6c64,_0x427fa7){var _0x391dee={'raw':![],'where':{'id':_0x3f6c64[_0x070e('0x4b')]['id']}},_0x79eaa0={};_0x79eaa0[_0x070e('0x38')]=_[_0x070e('0x34')](db[_0x070e('0x32')][_0x070e('0x33')]);_0x79eaa0[_0x070e('0x35')]=_[_0x070e('0x34')](_0x3f6c64[_0x070e('0x35')]);_0x79eaa0[_0x070e('0x36')]=_[_0x070e('0x37')](_0x79eaa0['model'],_0x79eaa0[_0x070e('0x35')]);_0x391dee[_0x070e('0x39')]=_[_0x070e('0x37')](_0x79eaa0[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x3f6c64[_0x070e('0x35')][_0x070e('0x3a')]));_0x391dee[_0x070e('0x39')]=_0x391dee[_0x070e('0x39')]['length']?_0x391dee[_0x070e('0x39')]:_0x79eaa0['model'];if(_0x3f6c64[_0x070e('0x35')][_0x070e('0x47')]){_0x391dee['include']=[{'all':!![]}];}_0x391dee=_[_0x070e('0x46')]({},_0x391dee,_0x3f6c64[_0x070e('0x4c')]);return db[_0x070e('0x32')][_0x070e('0x4d')](_0x391dee)[_0x070e('0x1a')](handleEntityNotFound(_0x427fa7,null))[_0x070e('0x1a')](respondWithResult(_0x427fa7,null))[_0x070e('0x25')](handleError(_0x427fa7,null));};exports['create']=function(_0x296978,_0x5bacbd){return db['ZendeskConfiguration'][_0x070e('0x4e')](_0x296978[_0x070e('0x4f')],{})[_0x070e('0x1a')](respondWithResult(_0x5bacbd,0xc9))[_0x070e('0x25')](handleError(_0x5bacbd,null));};exports[_0x070e('0x50')]=function(_0x7948ed,_0x440fa1){if(_0x7948ed[_0x070e('0x4f')]['id']){delete _0x7948ed['body']['id'];}return db[_0x070e('0x32')]['find']({'where':{'id':_0x7948ed['params']['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x440fa1,null))[_0x070e('0x1a')](saveUpdates(_0x7948ed['body'],null))[_0x070e('0x1a')](respondWithResult(_0x440fa1,null))[_0x070e('0x25')](handleError(_0x440fa1,null));};exports[_0x070e('0x2e')]=function(_0x2f8104,_0x1aacfc){return db[_0x070e('0x32')][_0x070e('0x4d')]({'where':{'id':_0x2f8104['params']['id']}})['then'](handleEntityNotFound(_0x1aacfc,null))['then'](removeEntity(_0x1aacfc,null))[_0x070e('0x25')](handleError(_0x1aacfc,null));};exports[_0x070e('0x51')]=function(_0x29f497,_0x2f8fcb,_0x5ac0b5){var _0x25f34c={};var _0x5d3c3a={};var _0x212710;var _0x1cbb7e;return db[_0x070e('0x32')][_0x070e('0x52')]({'where':{'id':_0x29f497[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x2f8fcb,null))['then'](function(_0x20ff87){if(_0x20ff87){_0x212710=_0x20ff87;_0x5d3c3a[_0x070e('0x38')]=_[_0x070e('0x34')](db['ZendeskField'][_0x070e('0x33')]);_0x5d3c3a[_0x070e('0x35')]=_['keys'](_0x29f497[_0x070e('0x35')]);_0x5d3c3a['filters']=_[_0x070e('0x37')](_0x5d3c3a['model'],_0x5d3c3a['query']);_0x25f34c['attributes']=_[_0x070e('0x37')](_0x5d3c3a[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x29f497[_0x070e('0x35')][_0x070e('0x3a')]));_0x25f34c[_0x070e('0x39')]=_0x25f34c['attributes'][_0x070e('0x3b')]?_0x25f34c['attributes']:_0x5d3c3a[_0x070e('0x38')];_0x25f34c['order']=qs[_0x070e('0x3f')](_0x29f497[_0x070e('0x35')]['sort']);_0x25f34c[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x29f497[_0x070e('0x35')],_0x5d3c3a[_0x070e('0x36')]));if(_0x29f497[_0x070e('0x35')][_0x070e('0x45')]){_0x25f34c[_0x070e('0x40')]=_[_0x070e('0x46')](_0x25f34c[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x25f34c[_0x070e('0x39')],function(_0x40c560){var _0x16887c={};_0x16887c[_0x40c560]={'$like':'%'+_0x29f497[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x16887c;})});}_0x25f34c=_['merge']({},_0x25f34c,_0x29f497[_0x070e('0x4c')]);return _0x212710[_0x070e('0x51')](_0x25f34c);}})[_0x070e('0x1a')](function(_0x93301a){if(_0x93301a){_0x1cbb7e=_0x93301a['length'];if(!_0x29f497[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x25f34c[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x29f497[_0x070e('0x35')]['limit']);_0x25f34c[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x29f497[_0x070e('0x35')][_0x070e('0x29')]);}return _0x212710['getFields'](_0x25f34c);}})[_0x070e('0x1a')](function(_0x52804d){if(_0x52804d){return _0x52804d?{'count':_0x1cbb7e,'rows':_0x52804d}:null;}})[_0x070e('0x1a')](respondWithResult(_0x2f8fcb,null))[_0x070e('0x25')](handleError(_0x2f8fcb,null));};exports[_0x070e('0x54')]=function(_0x150bf6,_0x2a20d4,_0x50ef9f){var _0x2e48f9={};var _0x2e38c6={};var _0x8cc913;var _0x114bcf;return db['ZendeskConfiguration'][_0x070e('0x52')]({'where':{'id':_0x150bf6['params']['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x2a20d4,null))[_0x070e('0x1a')](function(_0x1214d2){if(_0x1214d2){_0x8cc913=_0x1214d2;_0x2e38c6['model']=_[_0x070e('0x34')](db['ZendeskField'][_0x070e('0x33')]);_0x2e38c6['query']=_[_0x070e('0x34')](_0x150bf6[_0x070e('0x35')]);_0x2e38c6['filters']=_[_0x070e('0x37')](_0x2e38c6['model'],_0x2e38c6[_0x070e('0x35')]);_0x2e48f9[_0x070e('0x39')]=_['intersection'](_0x2e38c6['model'],qs[_0x070e('0x3a')](_0x150bf6[_0x070e('0x35')][_0x070e('0x3a')]));_0x2e48f9[_0x070e('0x39')]=_0x2e48f9[_0x070e('0x39')][_0x070e('0x3b')]?_0x2e48f9[_0x070e('0x39')]:_0x2e38c6[_0x070e('0x38')];_0x2e48f9[_0x070e('0x3e')]=qs[_0x070e('0x3f')](_0x150bf6[_0x070e('0x35')][_0x070e('0x3f')]);_0x2e48f9[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x150bf6[_0x070e('0x35')],_0x2e38c6['filters']));if(_0x150bf6['query'][_0x070e('0x45')]){_0x2e48f9[_0x070e('0x40')]=_[_0x070e('0x46')](_0x2e48f9[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x2e48f9[_0x070e('0x39')],function(_0x3223a4){var _0x110813={};_0x110813[_0x3223a4]={'$like':'%'+_0x150bf6[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x110813;})});}_0x2e48f9=_[_0x070e('0x46')]({},_0x2e48f9,_0x150bf6[_0x070e('0x4c')]);return _0x8cc913[_0x070e('0x54')](_0x2e48f9);}})['then'](function(_0x4f720f){if(_0x4f720f){_0x114bcf=_0x4f720f['length'];if(!_0x150bf6[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x2e48f9[_0x070e('0x3d')]=qs['limit'](_0x150bf6[_0x070e('0x35')][_0x070e('0x3d')]);_0x2e48f9[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x150bf6[_0x070e('0x35')][_0x070e('0x29')]);}return _0x8cc913['getSubjects'](_0x2e48f9);}})[_0x070e('0x1a')](function(_0x5c56bd){if(_0x5c56bd){return _0x5c56bd?{'count':_0x114bcf,'rows':_0x5c56bd}:null;}})[_0x070e('0x1a')](respondWithResult(_0x2a20d4,null))[_0x070e('0x25')](handleError(_0x2a20d4,null));};exports[_0x070e('0x55')]=function(_0x3aa620,_0x117fe4,_0x4a5694){var _0x63e78b={};var _0x15450f={};var _0x5d3bd8;var _0x421392;return db[_0x070e('0x32')]['findOne']({'where':{'id':_0x3aa620[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x117fe4,null))[_0x070e('0x1a')](function(_0x4da906){if(_0x4da906){_0x5d3bd8=_0x4da906;_0x15450f[_0x070e('0x38')]=_[_0x070e('0x34')](db[_0x070e('0x56')][_0x070e('0x33')]);_0x15450f[_0x070e('0x35')]=_[_0x070e('0x34')](_0x3aa620[_0x070e('0x35')]);_0x15450f[_0x070e('0x36')]=_[_0x070e('0x37')](_0x15450f[_0x070e('0x38')],_0x15450f[_0x070e('0x35')]);_0x63e78b[_0x070e('0x39')]=_[_0x070e('0x37')](_0x15450f['model'],qs[_0x070e('0x3a')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3a')]));_0x63e78b[_0x070e('0x39')]=_0x63e78b[_0x070e('0x39')][_0x070e('0x3b')]?_0x63e78b['attributes']:_0x15450f['model'];_0x63e78b['order']=qs[_0x070e('0x3f')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3f')]);_0x63e78b[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x3aa620[_0x070e('0x35')],_0x15450f[_0x070e('0x36')]));if(_0x3aa620['query'][_0x070e('0x45')]){_0x63e78b['where']=_[_0x070e('0x46')](_0x63e78b[_0x070e('0x40')],{'$or':_['map'](_0x63e78b['attributes'],function(_0x2048e9){var _0x1fa499={};_0x1fa499[_0x2048e9]={'$like':'%'+_0x3aa620['query'][_0x070e('0x45')]+'%'};return _0x1fa499;})});}_0x63e78b=_['merge']({},_0x63e78b,_0x3aa620['options']);return _0x5d3bd8['getDescriptions'](_0x63e78b);}})[_0x070e('0x1a')](function(_0x283cc4){if(_0x283cc4){_0x421392=_0x283cc4[_0x070e('0x3b')];if(!_0x3aa620[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x63e78b[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3d')]);_0x63e78b[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x3aa620[_0x070e('0x35')][_0x070e('0x29')]);}return _0x5d3bd8[_0x070e('0x55')](_0x63e78b);}})[_0x070e('0x1a')](function(_0x1c6cf3){if(_0x1c6cf3){return _0x1c6cf3?{'count':_0x421392,'rows':_0x1c6cf3}:null;}})[_0x070e('0x1a')](respondWithResult(_0x117fe4,null))[_0x070e('0x25')](handleError(_0x117fe4,null));};exports[_0x070e('0x57')]=function(_0x153a37,_0x3863f2,_0x58f2e8){var _0x4124cc={};var _0x276e6e={};var _0x449337;var _0xe50b1b;return db['ZendeskConfiguration'][_0x070e('0x52')]({'where':{'id':_0x153a37[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x3863f2,null))[_0x070e('0x1a')](function(_0x9a5439){if(_0x9a5439){_0x449337=_0x9a5439;_0x276e6e[_0x070e('0x38')]=_['keys'](db['Tag']['rawAttributes']);_0x276e6e[_0x070e('0x35')]=_['keys'](_0x153a37[_0x070e('0x35')]);_0x276e6e[_0x070e('0x36')]=_['intersection'](_0x276e6e[_0x070e('0x38')],_0x276e6e[_0x070e('0x35')]);_0x4124cc['attributes']=_['intersection'](_0x276e6e[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x153a37[_0x070e('0x35')][_0x070e('0x3a')]));_0x4124cc[_0x070e('0x39')]=_0x4124cc['attributes'][_0x070e('0x3b')]?_0x4124cc['attributes']:_0x276e6e[_0x070e('0x38')];_0x4124cc[_0x070e('0x3e')]=qs['sort'](_0x153a37[_0x070e('0x35')][_0x070e('0x3f')]);_0x4124cc[_0x070e('0x40')]=qs[_0x070e('0x36')](_[_0x070e('0x41')](_0x153a37[_0x070e('0x35')],_0x276e6e['filters']));if(_0x153a37[_0x070e('0x35')][_0x070e('0x45')]){_0x4124cc[_0x070e('0x40')]=_[_0x070e('0x46')](_0x4124cc[_0x070e('0x40')],{'$or':_['map'](_0x4124cc[_0x070e('0x39')],function(_0x3f03aa){var _0x35491d={};_0x35491d[_0x3f03aa]={'$like':'%'+_0x153a37[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x35491d;})});}_0x4124cc=_[_0x070e('0x46')]({},_0x4124cc,_0x153a37[_0x070e('0x4c')]);return _0x449337[_0x070e('0x57')](_0x4124cc);}})[_0x070e('0x1a')](function(_0xfe61be){if(_0xfe61be){_0xe50b1b=_0xfe61be[_0x070e('0x3b')];if(!_0x153a37[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x4124cc[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x153a37['query']['limit']);_0x4124cc[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x153a37['query']['offset']);}return _0x449337['getTags'](_0x4124cc);}})['then'](function(_0x1a430d){if(_0x1a430d){return _0x1a430d?{'count':_0xe50b1b,'rows':_0x1a430d}:null;}})[_0x070e('0x1a')](respondWithResult(_0x3863f2,null))[_0x070e('0x25')](handleError(_0x3863f2,null));};exports[_0x070e('0x58')]=function(_0x409811,_0x3973e8,_0x32cfe3){if(_0x409811[_0x070e('0x4f')]['id']){delete _0x409811[_0x070e('0x4f')]['id'];}return db[_0x070e('0x32')]['findOne']({'where':{'id':_0x409811[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x3973e8,null))['then'](function(_0x30db4a){if(_0x30db4a){return _0x30db4a[_0x070e('0x58')](_0x409811[_0x070e('0x4f')][_0x070e('0x59')]||[]);}return null;})['then'](respondWithResult(_0x3973e8,null))[_0x070e('0x25')](handleError(_0x3973e8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 2f41b74..a632a01 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 _0xfa3a=['api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger'];(function(_0x3a607b,_0x4060ec){var _0x381f9e=function(_0x586d1e){while(--_0x586d1e){_0x3a607b['push'](_0x3a607b['shift']());}};_0x381f9e(++_0x4060ec);}(_0xfa3a,0xa6));var _0xafa3=function(_0x2ec3aa,_0x29bd65){_0x2ec3aa=_0x2ec3aa-0x0;var _0x284ab2=_0xfa3a[_0x2ec3aa];return _0x284ab2;};'use strict';var _=require(_0xafa3('0x0'));var util=require(_0xafa3('0x1'));var logger=require(_0xafa3('0x2'))(_0xafa3('0x3'));var moment=require(_0xafa3('0x4'));var BPromise=require(_0xafa3('0x5'));var rp=require(_0xafa3('0x6'));var fs=require('fs');var path=require(_0xafa3('0x7'));var rimraf=require('rimraf');var config=require(_0xafa3('0x8'));var attributes=require(_0xafa3('0x9'));module[_0xafa3('0xa')]=function(_0x1e3b62,_0x21e8f9){return _0x1e3b62[_0xafa3('0xb')](_0xafa3('0xc'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6014=['util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x502f3e,_0xa2fbf6){var _0xbf689e=function(_0x2aadae){while(--_0x2aadae){_0x502f3e['push'](_0x502f3e['shift']());}};_0xbf689e(++_0xa2fbf6);}(_0x6014,0x6d));var _0x4601=function(_0x42f41b,_0x67e11f){_0x42f41b=_0x42f41b-0x0;var _0x4a4e89=_0x6014[_0x42f41b];return _0x4a4e89;};'use strict';var _=require(_0x4601('0x0'));var util=require(_0x4601('0x1'));var logger=require(_0x4601('0x2'))(_0x4601('0x3'));var moment=require('moment');var BPromise=require(_0x4601('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4601('0x5'));var rimraf=require('rimraf');var config=require(_0x4601('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x4601('0x7')]=function(_0x16b32f,_0xba2fff){return _0x16b32f[_0x4601('0x8')](_0x4601('0x9'),attributes,{'tableName':_0x4601('0xa'),'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 aa91e6c..9d62c35 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 _0x2236=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b173c,_0x27d0b2){var _0x51be42=function(_0x5592da){while(--_0x5592da){_0x2b173c['push'](_0x2b173c['shift']());}};_0x51be42(++_0x27d0b2);}(_0x2236,0x87));var _0x6223=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x2236[_0x3d2e4b];return _0x509e78;};'use strict';var _=require(_0x6223('0x0'));var util=require(_0x6223('0x1'));var moment=require(_0x6223('0x2'));var BPromise=require(_0x6223('0x3'));var rs=require(_0x6223('0x4'));var fs=require('fs');var Redis=require(_0x6223('0x5'));var db=require(_0x6223('0x6'))['db'];var utils=require(_0x6223('0x7'));var logger=require(_0x6223('0x8'))(_0x6223('0x9'));var config=require(_0x6223('0xa'));var jayson=require(_0x6223('0xb'));var client=jayson[_0x6223('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55ba12,_0x4ee6e8,_0x26cb82){return new BPromise(function(_0x42f0cb,_0x2ccc46){return client[_0x6223('0xd')](_0x55ba12,_0x26cb82)['then'](function(_0x1a75fd){logger[_0x6223('0xe')](_0x6223('0xf'),_0x4ee6e8,_0x6223('0x10'));logger['debug'](_0x6223('0x11'),_0x4ee6e8,_0x6223('0x10'),JSON[_0x6223('0x12')](_0x1a75fd));if(_0x1a75fd['error']){if(_0x1a75fd[_0x6223('0x13')]['code']===0x1f4){logger['error'](_0x6223('0xf'),_0x4ee6e8,_0x1a75fd[_0x6223('0x13')][_0x6223('0x14')]);return _0x2ccc46(_0x1a75fd[_0x6223('0x13')]['message']);}logger[_0x6223('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ee6e8,_0x1a75fd[_0x6223('0x13')]['message']);return _0x42f0cb(_0x1a75fd['error'][_0x6223('0x14')]);}else{logger[_0x6223('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ee6e8,_0x6223('0x10'));_0x42f0cb(_0x1a75fd['result'][_0x6223('0x14')]);}})[_0x6223('0x15')](function(_0x24f7dd){logger[_0x6223('0x13')](_0x6223('0xf'),_0x4ee6e8,_0x24f7dd);_0x2ccc46(_0x24f7dd);});});} \ No newline at end of file +var _0x2e74=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45a6e3,_0x563067){var _0x286235=function(_0x1bf755){while(--_0x1bf755){_0x45a6e3['push'](_0x45a6e3['shift']());}};_0x286235(++_0x563067);}(_0x2e74,0x6c));var _0x42e7=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x2e74[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x42e7('0x0'));var util=require(_0x42e7('0x1'));var moment=require('moment');var BPromise=require(_0x42e7('0x2'));var rs=require(_0x42e7('0x3'));var fs=require('fs');var Redis=require(_0x42e7('0x4'));var db=require(_0x42e7('0x5'))['db'];var utils=require(_0x42e7('0x6'));var logger=require(_0x42e7('0x7'))('rpc');var config=require(_0x42e7('0x8'));var jayson=require(_0x42e7('0x9'));var client=jayson[_0x42e7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14393d,_0x49d9c5,_0x245779){return new BPromise(function(_0x19a0ce,_0x4148b2){return client['request'](_0x14393d,_0x245779)[_0x42e7('0xb')](function(_0x3bdb80){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x49d9c5,_0x42e7('0xc'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x49d9c5,_0x42e7('0xc'),JSON['stringify'](_0x3bdb80));if(_0x3bdb80[_0x42e7('0xd')]){if(_0x3bdb80[_0x42e7('0xd')][_0x42e7('0xe')]===0x1f4){logger[_0x42e7('0xd')](_0x42e7('0xf'),_0x49d9c5,_0x3bdb80[_0x42e7('0xd')]['message']);return _0x4148b2(_0x3bdb80['error']['message']);}logger[_0x42e7('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x49d9c5,_0x3bdb80['error']['message']);return _0x19a0ce(_0x3bdb80[_0x42e7('0xd')]['message']);}else{logger[_0x42e7('0x10')](_0x42e7('0xf'),_0x49d9c5,_0x42e7('0xc'));_0x19a0ce(_0x3bdb80[_0x42e7('0x11')]['message']);}})[_0x42e7('0x12')](function(_0x22902f){logger['error'](_0x42e7('0xf'),_0x49d9c5,_0x22902f);_0x4148b2(_0x22902f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 56588c5..92428d1 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x561a56,_0x35978e){var _0x402f3a=function(_0x353bf4){while(--_0x353bf4){_0x561a56['push'](_0x561a56['shift']());}};_0x402f3a(++_0x35978e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x36a7d8,_0x2588ee){var _0x5326f3=function(_0x364b1b){while(--_0x364b1b){_0x36a7d8['push'](_0x36a7d8['shift']());}};_0x5326f3(++_0x2588ee);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index ad06851..65c1d6c 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 _0x0bb5=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0bb5,0x148));var _0x50bb=function(_0x146790,_0x40b78b){_0x146790=_0x146790-0x0;var _0x1f89da=_0x0bb5[_0x146790];return _0x1f89da;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x50bb('0x2'),_0x50bb('0x3'),_0x50bb('0x4')),'defaultValue':_0x50bb('0x5')},'content':{'type':Sequelize[_0x50bb('0x6')]},'key':{'type':Sequelize[_0x50bb('0x6')]},'keyType':{'type':Sequelize[_0x50bb('0x7')](_0x50bb('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x50bb('0x6')]},'idField':{'type':Sequelize[_0x50bb('0x6')]},'nameField':{'type':Sequelize[_0x50bb('0x6')]},'customField':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x8ac79c,_0x541f87){var _0x2c034f=function(_0x5a7b99){while(--_0x5a7b99){_0x8ac79c['push'](_0x8ac79c['shift']());}};_0x2c034f(++_0x541f87);}(_0x750a,0x140));var _0xa750=function(_0x2a5982,_0x1bbb46){_0x2a5982=_0x2a5982-0x0;var _0x266fda=_0x750a[_0x2a5982];return _0x266fda;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c924b88..cc698d9 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 _0x3645=['then','stack','name','send','ZendeskField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x3645,0x154));var _0x5364=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x3645[_0xe30e17];return _0x2342c9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5364('0x0'));var rimraf=require(_0x5364('0x1'));var zipdir=require(_0x5364('0x2'));var jsonpatch=require(_0x5364('0x3'));var rp=require(_0x5364('0x4'));var moment=require(_0x5364('0x5'));var BPromise=require(_0x5364('0x6'));var Mustache=require('mustache');var util=require(_0x5364('0x7'));var path=require(_0x5364('0x8'));var sox=require(_0x5364('0x9'));var csv=require(_0x5364('0xa'));var ejs=require(_0x5364('0xb'));var fs=require('fs');var _=require(_0x5364('0xc'));var squel=require(_0x5364('0xd'));var crypto=require(_0x5364('0xe'));var jsforce=require(_0x5364('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5364('0xa'));var querystring=require(_0x5364('0x10'));var Papa=require(_0x5364('0x11'));var Redis=require(_0x5364('0x12'));var authService=require(_0x5364('0x13'));var qs=require(_0x5364('0x14'));var hardwareService=require(_0x5364('0x15'));var logger=require(_0x5364('0x16'))(_0x5364('0x17'));var utils=require(_0x5364('0x18'));var config=require(_0x5364('0x19'));var db=require(_0x5364('0x1a'))['db'];function respondWithStatusCode(_0x36ef4d,_0x495688){_0x495688=_0x495688||0xcc;return function(_0x18e3aa){if(_0x18e3aa){return _0x36ef4d[_0x5364('0x1b')](_0x495688);}return _0x36ef4d[_0x5364('0x1c')](_0x495688)[_0x5364('0x1d')]();};}function respondWithResult(_0x5a2552,_0x3eb7f3){_0x3eb7f3=_0x3eb7f3||0xc8;return function(_0x50c5ab){if(_0x50c5ab){return _0x5a2552[_0x5364('0x1c')](_0x3eb7f3)['json'](_0x50c5ab);}};}function respondWithFilteredResult(_0x3ffd5d,_0x13c7d1){return function(_0x11f05e){if(_0x11f05e){var _0x2abe2a=_0x11f05e[_0x5364('0x1e')],_0x3889e4=_0x13c7d1[_0x5364('0x1f')],_0x567bb4=_0x13c7d1[_0x5364('0x1f')]+_0x13c7d1[_0x5364('0x20')],_0x50e6ce;if(_0x567bb4>=_0x2abe2a){_0x567bb4=_0x2abe2a;_0x50e6ce=0xc8;}else{_0x50e6ce=0xce;}_0x3ffd5d[_0x5364('0x1c')](_0x50e6ce);return _0x3ffd5d[_0x5364('0x21')](_0x5364('0x22'),_0x3889e4+'-'+_0x567bb4+'/'+_0x2abe2a)[_0x5364('0x23')](_0x11f05e);}return null;};}function patchUpdates(_0xaa4323){return function(_0x5192df){try{jsonpatch[_0x5364('0x24')](_0x5192df,_0xaa4323,!![]);}catch(_0x37e0a3){return BPromise[_0x5364('0x25')](_0x37e0a3);}return _0x5192df[_0x5364('0x26')]();};}function saveUpdates(_0x3c2283,_0x32a60d){return function(_0x1d5a30){if(_0x1d5a30){return _0x1d5a30[_0x5364('0x27')](_0x3c2283)[_0x5364('0x28')](function(_0x356eca){return _0x356eca;});}return null;};}function removeEntity(_0x39dc4a,_0x5a04ef){return function(_0xbb788){if(_0xbb788){return _0xbb788['destroy']()['then'](function(){_0x39dc4a[_0x5364('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd706,_0x2a8dd6){return function(_0x1c08f9){if(!_0x1c08f9){_0x1bd706[_0x5364('0x1b')](0x194);}return _0x1c08f9;};}function handleError(_0x1dfa2c,_0x553e1d){_0x553e1d=_0x553e1d||0x1f4;return function(_0x23c6e4){logger['error'](_0x23c6e4[_0x5364('0x29')]);if(_0x23c6e4[_0x5364('0x2a')]){delete _0x23c6e4['name'];}_0x1dfa2c[_0x5364('0x1c')](_0x553e1d)[_0x5364('0x2b')](_0x23c6e4);};}exports['index']=function(_0xb5ae80,_0x3302c8){var _0x2f4ae2={},_0x22fc39={},_0x4d3460={'count':0x0,'rows':[]};var _0x34248a=db[_0x5364('0x2c')][_0x5364('0x2d')];_0x22fc39[_0x5364('0x2e')]=_[_0x5364('0x2f')](_0x34248a);_0x22fc39[_0x5364('0x30')]=_['keys'](_0xb5ae80['query']);_0x22fc39[_0x5364('0x31')]=_['intersection'](_0x22fc39[_0x5364('0x2e')],_0x22fc39[_0x5364('0x30')]);_0x2f4ae2[_0x5364('0x32')]=_[_0x5364('0x33')](_0x22fc39[_0x5364('0x2e')],qs['fields'](_0xb5ae80[_0x5364('0x30')][_0x5364('0x34')]));_0x2f4ae2[_0x5364('0x32')]=_0x2f4ae2[_0x5364('0x32')][_0x5364('0x35')]?_0x2f4ae2[_0x5364('0x32')]:_0x22fc39[_0x5364('0x2e')];if(!_0xb5ae80[_0x5364('0x30')][_0x5364('0x36')](_0x5364('0x37'))){_0x2f4ae2[_0x5364('0x20')]=qs['limit'](_0xb5ae80['query'][_0x5364('0x20')]);_0x2f4ae2[_0x5364('0x1f')]=qs[_0x5364('0x1f')](_0xb5ae80['query']['offset']);}_0x2f4ae2[_0x5364('0x38')]=qs[_0x5364('0x39')](_0xb5ae80[_0x5364('0x30')]['sort']);_0x2f4ae2[_0x5364('0x3a')]=qs['filters'](_[_0x5364('0x3b')](_0xb5ae80['query'],_0x22fc39['filters']));if(_0xb5ae80[_0x5364('0x30')][_0x5364('0x3c')]){_0x2f4ae2[_0x5364('0x3a')]=_[_0x5364('0x3d')](_0x2f4ae2[_0x5364('0x3a')],{'$or':_['map'](_0x34248a,function(_0x5db982){if(_0x5db982[_0x5364('0x3e')][_0x5364('0x3f')]!==_0x5364('0x40')){var _0x146570={};_0x146570[_0x5db982[_0x5364('0x41')]]={'$like':'%'+_0xb5ae80[_0x5364('0x30')][_0x5364('0x3c')]+'%'};return _0x146570;}})});}_0x2f4ae2=_['merge']({},_0x2f4ae2,_0xb5ae80['options']);var _0x50b596={'where':_0x2f4ae2[_0x5364('0x3a')]};return db[_0x5364('0x2c')][_0x5364('0x1e')](_0x50b596)[_0x5364('0x28')](function(_0x2e6575){_0x4d3460[_0x5364('0x1e')]=_0x2e6575;if(_0xb5ae80[_0x5364('0x30')][_0x5364('0x42')]){_0x2f4ae2[_0x5364('0x43')]=[{'all':!![]}];}return db[_0x5364('0x2c')][_0x5364('0x44')](_0x2f4ae2);})[_0x5364('0x28')](function(_0x5ccc98){_0x4d3460[_0x5364('0x45')]=_0x5ccc98;return _0x4d3460;})[_0x5364('0x28')](respondWithFilteredResult(_0x3302c8,_0x2f4ae2))[_0x5364('0x46')](handleError(_0x3302c8,null));};exports[_0x5364('0x47')]=function(_0x19aa25,_0x3a430d){var _0x21fdd8={'raw':!![],'where':{'id':_0x19aa25[_0x5364('0x48')]['id']}},_0x3b907e={};_0x3b907e[_0x5364('0x2e')]=_[_0x5364('0x2f')](db[_0x5364('0x2c')][_0x5364('0x2d')]);_0x3b907e[_0x5364('0x30')]=_[_0x5364('0x2f')](_0x19aa25['query']);_0x3b907e[_0x5364('0x31')]=_['intersection'](_0x3b907e['model'],_0x3b907e[_0x5364('0x30')]);_0x21fdd8[_0x5364('0x32')]=_[_0x5364('0x33')](_0x3b907e[_0x5364('0x2e')],qs[_0x5364('0x34')](_0x19aa25[_0x5364('0x30')]['fields']));_0x21fdd8[_0x5364('0x32')]=_0x21fdd8[_0x5364('0x32')][_0x5364('0x35')]?_0x21fdd8['attributes']:_0x3b907e[_0x5364('0x2e')];if(_0x19aa25['query'][_0x5364('0x42')]){_0x21fdd8['include']=[{'all':!![]}];}_0x21fdd8=_[_0x5364('0x3d')]({},_0x21fdd8,_0x19aa25['options']);return db['ZendeskField'][_0x5364('0x49')](_0x21fdd8)[_0x5364('0x28')](handleEntityNotFound(_0x3a430d,null))[_0x5364('0x28')](respondWithResult(_0x3a430d,null))['catch'](handleError(_0x3a430d,null));};exports[_0x5364('0x4a')]=function(_0x4c5b41,_0x3cc725){return db['ZendeskField']['create'](_0x4c5b41['body'],{})[_0x5364('0x28')](respondWithResult(_0x3cc725,0xc9))[_0x5364('0x46')](handleError(_0x3cc725,null));};exports[_0x5364('0x27')]=function(_0x265fab,_0x4321fe){if(_0x265fab[_0x5364('0x4b')]['id']){delete _0x265fab[_0x5364('0x4b')]['id'];}return db[_0x5364('0x2c')]['find']({'where':{'id':_0x265fab[_0x5364('0x48')]['id']}})[_0x5364('0x28')](handleEntityNotFound(_0x4321fe,null))[_0x5364('0x28')](saveUpdates(_0x265fab['body'],null))[_0x5364('0x28')](respondWithResult(_0x4321fe,null))[_0x5364('0x46')](handleError(_0x4321fe,null));};exports['destroy']=function(_0x11ab7c,_0x41441b){return db[_0x5364('0x2c')][_0x5364('0x49')]({'where':{'id':_0x11ab7c[_0x5364('0x48')]['id']}})['then'](handleEntityNotFound(_0x41441b,null))[_0x5364('0x28')](removeEntity(_0x41441b,null))[_0x5364('0x46')](handleError(_0x41441b,null));}; \ No newline at end of file +var _0x9491=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','catch','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','ZendeskField','query','filters'];(function(_0x56916f,_0x47c5f1){var _0x1bbade=function(_0x4af7b9){while(--_0x4af7b9){_0x56916f['push'](_0x56916f['shift']());}};_0x1bbade(++_0x47c5f1);}(_0x9491,0xb6));var _0x1949=function(_0x557aff,_0x32b0d1){_0x557aff=_0x557aff-0x0;var _0x3c003f=_0x9491[_0x557aff];return _0x3c003f;};'use strict';var pdf=require(_0x1949('0x0'));var emlformat=require(_0x1949('0x1'));var rimraf=require(_0x1949('0x2'));var zipdir=require(_0x1949('0x3'));var jsonpatch=require(_0x1949('0x4'));var rp=require(_0x1949('0x5'));var moment=require(_0x1949('0x6'));var BPromise=require(_0x1949('0x7'));var Mustache=require(_0x1949('0x8'));var util=require(_0x1949('0x9'));var path=require('path');var sox=require(_0x1949('0xa'));var csv=require('to-csv');var ejs=require(_0x1949('0xb'));var fs=require('fs');var _=require(_0x1949('0xc'));var squel=require('squel');var crypto=require(_0x1949('0xd'));var jsforce=require(_0x1949('0xe'));var deskjs=require(_0x1949('0xf'));var toCsv=require(_0x1949('0x10'));var querystring=require(_0x1949('0x11'));var Papa=require(_0x1949('0x12'));var Redis=require(_0x1949('0x13'));var authService=require(_0x1949('0x14'));var qs=require(_0x1949('0x15'));var hardwareService=require(_0x1949('0x16'));var logger=require(_0x1949('0x17'))('api');var utils=require(_0x1949('0x18'));var config=require(_0x1949('0x19'));var db=require(_0x1949('0x1a'))['db'];function respondWithStatusCode(_0x1cfff9,_0xa02415){_0xa02415=_0xa02415||0xcc;return function(_0x6d5828){if(_0x6d5828){return _0x1cfff9['sendStatus'](_0xa02415);}return _0x1cfff9[_0x1949('0x1b')](_0xa02415)['end']();};}function respondWithResult(_0x574713,_0x1716fe){_0x1716fe=_0x1716fe||0xc8;return function(_0x2b374d){if(_0x2b374d){return _0x574713[_0x1949('0x1b')](_0x1716fe)['json'](_0x2b374d);}};}function respondWithFilteredResult(_0x2726f7,_0x421e52){return function(_0xb65a56){if(_0xb65a56){var _0x5356ae=_0xb65a56[_0x1949('0x1c')],_0x55784f=_0x421e52['offset'],_0x2de909=_0x421e52[_0x1949('0x1d')]+_0x421e52[_0x1949('0x1e')],_0x376090;if(_0x2de909>=_0x5356ae){_0x2de909=_0x5356ae;_0x376090=0xc8;}else{_0x376090=0xce;}_0x2726f7['status'](_0x376090);return _0x2726f7[_0x1949('0x1f')](_0x1949('0x20'),_0x55784f+'-'+_0x2de909+'/'+_0x5356ae)[_0x1949('0x21')](_0xb65a56);}return null;};}function patchUpdates(_0x705c90){return function(_0x32b91f){try{jsonpatch[_0x1949('0x22')](_0x32b91f,_0x705c90,!![]);}catch(_0x3d0d8f){return BPromise[_0x1949('0x23')](_0x3d0d8f);}return _0x32b91f[_0x1949('0x24')]();};}function saveUpdates(_0x5702fc,_0x1e0478){return function(_0x50e662){if(_0x50e662){return _0x50e662['update'](_0x5702fc)[_0x1949('0x25')](function(_0x4a3a9d){return _0x4a3a9d;});}return null;};}function removeEntity(_0x121b44,_0x2b6ae0){return function(_0x5d58b7){if(_0x5d58b7){return _0x5d58b7[_0x1949('0x26')]()['then'](function(){_0x121b44[_0x1949('0x1b')](0xcc)[_0x1949('0x27')]();});}};}function handleEntityNotFound(_0x109c00,_0x1314ca){return function(_0x4d4d13){if(!_0x4d4d13){_0x109c00[_0x1949('0x28')](0x194);}return _0x4d4d13;};}function handleError(_0x58e225,_0x4035cc){_0x4035cc=_0x4035cc||0x1f4;return function(_0x5ae4f3){logger[_0x1949('0x29')](_0x5ae4f3[_0x1949('0x2a')]);if(_0x5ae4f3['name']){delete _0x5ae4f3[_0x1949('0x2b')];}_0x58e225['status'](_0x4035cc)[_0x1949('0x2c')](_0x5ae4f3);};}exports[_0x1949('0x2d')]=function(_0x34ac62,_0x26257e){var _0x54495e={},_0x4c6557={},_0xd585c2={'count':0x0,'rows':[]};var _0x25497f=db[_0x1949('0x2e')]['rawAttributes'];_0x4c6557['model']=_['keys'](_0x25497f);_0x4c6557[_0x1949('0x2f')]=_['keys'](_0x34ac62['query']);_0x4c6557[_0x1949('0x30')]=_[_0x1949('0x31')](_0x4c6557[_0x1949('0x32')],_0x4c6557[_0x1949('0x2f')]);_0x54495e[_0x1949('0x33')]=_[_0x1949('0x31')](_0x4c6557[_0x1949('0x32')],qs[_0x1949('0x34')](_0x34ac62['query'][_0x1949('0x34')]));_0x54495e['attributes']=_0x54495e[_0x1949('0x33')][_0x1949('0x35')]?_0x54495e['attributes']:_0x4c6557[_0x1949('0x32')];if(!_0x34ac62[_0x1949('0x2f')][_0x1949('0x36')](_0x1949('0x37'))){_0x54495e[_0x1949('0x1e')]=qs[_0x1949('0x1e')](_0x34ac62[_0x1949('0x2f')][_0x1949('0x1e')]);_0x54495e['offset']=qs[_0x1949('0x1d')](_0x34ac62['query']['offset']);}_0x54495e[_0x1949('0x38')]=qs[_0x1949('0x39')](_0x34ac62[_0x1949('0x2f')][_0x1949('0x39')]);_0x54495e[_0x1949('0x3a')]=qs[_0x1949('0x30')](_[_0x1949('0x3b')](_0x34ac62[_0x1949('0x2f')],_0x4c6557[_0x1949('0x30')]));if(_0x34ac62[_0x1949('0x2f')][_0x1949('0x3c')]){_0x54495e[_0x1949('0x3a')]=_[_0x1949('0x3d')](_0x54495e[_0x1949('0x3a')],{'$or':_['map'](_0x25497f,function(_0x901373){if(_0x901373['type'][_0x1949('0x3e')]!==_0x1949('0x3f')){var _0x23f956={};_0x23f956[_0x901373['field']]={'$like':'%'+_0x34ac62[_0x1949('0x2f')][_0x1949('0x3c')]+'%'};return _0x23f956;}})});}_0x54495e=_['merge']({},_0x54495e,_0x34ac62['options']);var _0x1a0d67={'where':_0x54495e[_0x1949('0x3a')]};return db[_0x1949('0x2e')][_0x1949('0x1c')](_0x1a0d67)[_0x1949('0x25')](function(_0x1c777a){_0xd585c2[_0x1949('0x1c')]=_0x1c777a;if(_0x34ac62[_0x1949('0x2f')][_0x1949('0x40')]){_0x54495e[_0x1949('0x41')]=[{'all':!![]}];}return db[_0x1949('0x2e')][_0x1949('0x42')](_0x54495e);})[_0x1949('0x25')](function(_0x4242d1){_0xd585c2[_0x1949('0x43')]=_0x4242d1;return _0xd585c2;})[_0x1949('0x25')](respondWithFilteredResult(_0x26257e,_0x54495e))['catch'](handleError(_0x26257e,null));};exports['show']=function(_0x1f524d,_0x4573ef){var _0xd21c26={'raw':!![],'where':{'id':_0x1f524d[_0x1949('0x44')]['id']}},_0x2ac1e9={};_0x2ac1e9[_0x1949('0x32')]=_[_0x1949('0x45')](db[_0x1949('0x2e')][_0x1949('0x46')]);_0x2ac1e9['query']=_['keys'](_0x1f524d['query']);_0x2ac1e9[_0x1949('0x30')]=_[_0x1949('0x31')](_0x2ac1e9[_0x1949('0x32')],_0x2ac1e9[_0x1949('0x2f')]);_0xd21c26[_0x1949('0x33')]=_[_0x1949('0x31')](_0x2ac1e9[_0x1949('0x32')],qs[_0x1949('0x34')](_0x1f524d[_0x1949('0x2f')]['fields']));_0xd21c26[_0x1949('0x33')]=_0xd21c26['attributes'][_0x1949('0x35')]?_0xd21c26['attributes']:_0x2ac1e9['model'];if(_0x1f524d[_0x1949('0x2f')][_0x1949('0x40')]){_0xd21c26[_0x1949('0x41')]=[{'all':!![]}];}_0xd21c26=_['merge']({},_0xd21c26,_0x1f524d[_0x1949('0x47')]);return db[_0x1949('0x2e')][_0x1949('0x48')](_0xd21c26)['then'](handleEntityNotFound(_0x4573ef,null))['then'](respondWithResult(_0x4573ef,null))[_0x1949('0x49')](handleError(_0x4573ef,null));};exports['create']=function(_0x57d01d,_0x46767e){return db[_0x1949('0x2e')][_0x1949('0x4a')](_0x57d01d[_0x1949('0x4b')],{})['then'](respondWithResult(_0x46767e,0xc9))['catch'](handleError(_0x46767e,null));};exports[_0x1949('0x4c')]=function(_0x517862,_0x2e6325){if(_0x517862['body']['id']){delete _0x517862['body']['id'];}return db[_0x1949('0x2e')][_0x1949('0x48')]({'where':{'id':_0x517862[_0x1949('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e6325,null))['then'](saveUpdates(_0x517862[_0x1949('0x4b')],null))[_0x1949('0x25')](respondWithResult(_0x2e6325,null))['catch'](handleError(_0x2e6325,null));};exports['destroy']=function(_0x141d90,_0x3e9b03){return db[_0x1949('0x2e')][_0x1949('0x48')]({'where':{'id':_0x141d90[_0x1949('0x44')]['id']}})[_0x1949('0x25')](handleEntityNotFound(_0x3e9b03,null))[_0x1949('0x25')](removeEntity(_0x3e9b03,null))[_0x1949('0x49')](handleError(_0x3e9b03,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a950dc9..0d900e1 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 _0xdb6e=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb6e,0x13a));var _0xedb6=function(_0x4d7d33,_0x575510){_0x4d7d33=_0x4d7d33-0x0;var _0x19407b=_0xdb6e[_0x4d7d33];return _0x19407b;};'use strict';var _=require(_0xedb6('0x0'));var util=require(_0xedb6('0x1'));var logger=require(_0xedb6('0x2'))(_0xedb6('0x3'));var moment=require(_0xedb6('0x4'));var BPromise=require(_0xedb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xedb6('0x6'));var config=require(_0xedb6('0x7'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x2304fe,_0x32ce57){return _0x2304fe['define'](_0xedb6('0x8'),attributes,{'tableName':_0xedb6('0x9'),'paranoid':![],'indexes':[{'name':_0xedb6('0xa'),'fields':[_0xedb6('0xb'),_0xedb6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc61c=['FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x1ff93d,_0x2f2624){var _0x133338=function(_0x5601a6){while(--_0x5601a6){_0x1ff93d['push'](_0x1ff93d['shift']());}};_0x133338(++_0x2f2624);}(_0xc61c,0xd3));var _0xcc61=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0xc61c[_0x39e2d7];return _0x413d0d;};'use strict';var _=require(_0xcc61('0x0'));var util=require(_0xcc61('0x1'));var logger=require('../../config/logger')(_0xcc61('0x2'));var moment=require(_0xcc61('0x3'));var BPromise=require(_0xcc61('0x4'));var rp=require(_0xcc61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc61('0x6'));var config=require(_0xcc61('0x7'));var attributes=require(_0xcc61('0x8'));module['exports']=function(_0xab8dea,_0x57cc15){return _0xab8dea[_0xcc61('0x9')](_0xcc61('0xa'),attributes,{'tableName':_0xcc61('0xb'),'paranoid':![],'indexes':[{'name':_0xcc61('0xc'),'fields':[_0xcc61('0xd'),_0xcc61('0xe')],'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 393504a..610881b 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 _0x2547=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x2547,0x1cd));var _0x7254=function(_0x5abede,_0x33a5f8){_0x5abede=_0x5abede-0x0;var _0x23e145=_0x2547[_0x5abede];return _0x23e145;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('ZendeskField,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});} \ No newline at end of file +var _0x3f8c=['ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info'];(function(_0x38133b,_0x50d797){var _0x5e617d=function(_0x3836ca){while(--_0x3836ca){_0x38133b['push'](_0x38133b['shift']());}};_0x5e617d(++_0x50d797);}(_0x3f8c,0x104));var _0xc3f8=function(_0x5034c5,_0x51aa66){_0x5034c5=_0x5034c5-0x0;var _0x37b322=_0x3f8c[_0x5034c5];return _0x37b322;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('ZendeskField,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 25fc260..594b5c5 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 _0x8f4c=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','get','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','/:id','delete'];(function(_0x379d8a,_0x1b8006){var _0xd13759=function(_0x176ec0){while(--_0x176ec0){_0x379d8a['push'](_0x379d8a['shift']());}};_0xd13759(++_0x1b8006);}(_0x8f4c,0x113));var _0xc8f4=function(_0x3d4454,_0x25d4d3){_0x3d4454=_0x3d4454-0x0;var _0x2425f9=_0x8f4c[_0x3d4454];return _0x2425f9;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc8f4('0x6'));var config=require(_0xc8f4('0x7'));var controller=require(_0xc8f4('0x8'));router['get']('/',auth[_0xc8f4('0x9')](),controller['index']);router['get']('/:id',auth[_0xc8f4('0x9')](),controller['show']);router[_0xc8f4('0xa')](_0xc8f4('0xb'),auth[_0xc8f4('0x9')](),controller[_0xc8f4('0xc')]);router[_0xc8f4('0xa')]('/:id/fields',auth[_0xc8f4('0x9')](),controller[_0xc8f4('0xd')]);router[_0xc8f4('0xe')]('/',auth[_0xc8f4('0x9')](),controller['create']);router[_0xc8f4('0xe')]('/:id/configurations',auth[_0xc8f4('0x9')](),controller[_0xc8f4('0xf')]);router[_0xc8f4('0x10')](_0xc8f4('0x11'),auth[_0xc8f4('0x9')](),controller['update']);router[_0xc8f4('0x12')](_0xc8f4('0x11'),auth[_0xc8f4('0x9')](),controller[_0xc8f4('0x13')]);module[_0xc8f4('0x14')]=router; \ No newline at end of file +var _0xed3c=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update'];(function(_0x1dce05,_0x391a84){var _0x20fcdf=function(_0x2fcd05){while(--_0x2fcd05){_0x1dce05['push'](_0x1dce05['shift']());}};_0x20fcdf(++_0x391a84);}(_0xed3c,0x1a6));var _0xced3=function(_0x3da144,_0x578cbd){_0x3da144=_0x3da144-0x0;var _0x13fdc7=_0xed3c[_0x3da144];return _0x13fdc7;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var auth=require(_0xced3('0x5'));var interaction=require(_0xced3('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xced3('0x7')]('/',auth[_0xced3('0x8')](),controller[_0xced3('0x9')]);router[_0xced3('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xced3('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xced3('0x7')](_0xced3('0xa'),auth[_0xced3('0x8')](),controller[_0xced3('0xb')]);router[_0xced3('0xc')]('/',auth['isAuthenticated'](),controller[_0xced3('0xd')]);router[_0xced3('0xc')](_0xced3('0xe'),auth['isAuthenticated'](),controller[_0xced3('0xf')]);router[_0xced3('0x10')](_0xced3('0x11'),auth[_0xced3('0x8')](),controller[_0xced3('0x12')]);router[_0xced3('0x13')](_0xced3('0x11'),auth['isAuthenticated'](),controller[_0xced3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 8c0881b..0e72024 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 _0xfd49=['sequelize','exports','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xfd49,0x1ef));var _0x9fd4=function(_0x16c7fc,_0x36450b){_0x16c7fc=_0x16c7fc-0x0;var _0x1bf4a1=_0xfd49[_0x16c7fc];return _0x1bf4a1;};'use strict';var Sequelize=require(_0x9fd4('0x0'));module[_0x9fd4('0x1')]={'name':{'type':Sequelize[_0x9fd4('0x2')]},'description':{'type':Sequelize[_0x9fd4('0x2')]},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9fd4('0x2')]},'serverUrl':{'type':Sequelize[_0x9fd4('0x2')]}}; \ No newline at end of file +var _0xdca3=['sequelize','exports','STRING'];(function(_0x5c815f,_0x17b2a9){var _0x50db37=function(_0x27b4a7){while(--_0x27b4a7){_0x5c815f['push'](_0x5c815f['shift']());}};_0x50db37(++_0x17b2a9);}(_0xdca3,0x111));var _0x3dca=function(_0x5665f7,_0x3348cf){_0x5665f7=_0x5665f7-0x0;var _0x5d5995=_0xdca3[_0x5665f7];return _0x5d5995;};'use strict';var Sequelize=require(_0x3dca('0x0'));module[_0x3dca('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dca('0x2')]},'authToken':{'type':Sequelize[_0x3dca('0x2')]},'host':{'type':Sequelize[_0x3dca('0x2')]},'serverUrl':{'type':Sequelize[_0x3dca('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7e15872..79b43ed 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 _0xd5aa=['lastIndexOf','format','https://crm.%s/crm/private/json/Calls/getFields','authToken','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','true','Pick\x20List','val','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','key','VIRTUAL','options','where','includeAll','include','findAll','show','params','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','host','slice','substring'];(function(_0x381594,_0xb0d5c9){var _0xbf799=function(_0x53acce){while(--_0x53acce){_0x381594['push'](_0x381594['shift']());}};_0xbf799(++_0xb0d5c9);}(_0xd5aa,0x1e2));var _0xad5a=function(_0x3d6e37,_0x32cbdc){_0x3d6e37=_0x3d6e37-0x0;var _0x1a61f3=_0xd5aa[_0x3d6e37];return _0x1a61f3;};'use strict';var pdf=require(_0xad5a('0x0'));var emlformat=require(_0xad5a('0x1'));var rimraf=require(_0xad5a('0x2'));var zipdir=require(_0xad5a('0x3'));var jsonpatch=require(_0xad5a('0x4'));var rp=require(_0xad5a('0x5'));var moment=require(_0xad5a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xad5a('0x7'));var path=require(_0xad5a('0x8'));var sox=require('sox');var csv=require(_0xad5a('0x9'));var ejs=require(_0xad5a('0xa'));var fs=require('fs');var _=require(_0xad5a('0xb'));var squel=require(_0xad5a('0xc'));var crypto=require('crypto');var jsforce=require(_0xad5a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad5a('0x9'));var querystring=require('querystring');var Papa=require(_0xad5a('0xe'));var Redis=require('ioredis');var authService=require(_0xad5a('0xf'));var qs=require(_0xad5a('0x10'));var hardwareService=require(_0xad5a('0x11'));var logger=require(_0xad5a('0x12'))(_0xad5a('0x13'));var utils=require(_0xad5a('0x14'));var config=require('../../config/environment');var db=require(_0xad5a('0x15'))['db'];var integrations=require(_0xad5a('0x16'));var jayson=require(_0xad5a('0x17'));var client=jayson[_0xad5a('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x289dfb,_0x1084c9,_0x4163d1){if(_0x4163d1){var _0x1cee76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cee76[_0xad5a('0x19')](_0x1084c9)){return _0x289dfb;}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 _0x289dfb;}}function respondWithRpcPromise(_0x587d5b,_0x3ae82f,_0x2780b8,_0x49d9dc){return new BPromise(function(_0x415bba,_0x31d21b){var _0x16df52=_0x49d9dc||client;return _0x16df52[_0xad5a('0x1a')](_0x587d5b,_0x2780b8)[_0xad5a('0x1b')](function(_0xf28cab){logger['info'](_0xad5a('0x1c'),_0x3ae82f,_0xad5a('0x1d'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3ae82f,_0xad5a('0x1d'),JSON[_0xad5a('0x1e')](_0xf28cab));if(_0xf28cab[_0xad5a('0x1f')]){if(_0xf28cab[_0xad5a('0x1f')][_0xad5a('0x20')]===0x1f4){logger[_0xad5a('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x3ae82f,_0xf28cab['error'][_0xad5a('0x21')]);return _0x31d21b(_0xf28cab[_0xad5a('0x1f')][_0xad5a('0x21')]);}logger[_0xad5a('0x1f')](_0xad5a('0x1c'),_0x3ae82f,_0xf28cab['error'][_0xad5a('0x21')]);return _0x415bba(_0xf28cab['error'][_0xad5a('0x21')]);}else{logger[_0xad5a('0x22')](_0xad5a('0x1c'),_0x3ae82f,_0xad5a('0x1d'));_0x415bba(_0xf28cab[_0xad5a('0x23')][_0xad5a('0x21')]);}})[_0xad5a('0x24')](function(_0x1f7552){logger['error'](_0xad5a('0x1c'),_0x3ae82f,_0x1f7552);_0x31d21b(_0x1f7552);});});}function respondWithStatusCode(_0x552db8,_0x1f1413){_0x1f1413=_0x1f1413||0xcc;return function(_0x1f0be){if(_0x1f0be){return _0x552db8[_0xad5a('0x25')](_0x1f1413);}return _0x552db8[_0xad5a('0x26')](_0x1f1413)[_0xad5a('0x27')]();};}function respondWithResult(_0x3ae895,_0x201a2b){_0x201a2b=_0x201a2b||0xc8;return function(_0x3a8928){if(_0x3a8928){return _0x3ae895[_0xad5a('0x26')](_0x201a2b)[_0xad5a('0x28')](_0x3a8928);}};}function respondWithFilteredResult(_0x4c9627,_0x259fdf){return function(_0x288a24){if(_0x288a24){var _0x28364c=_0x288a24[_0xad5a('0x29')],_0xf071d3=_0x259fdf['offset'],_0x3e4512=_0x259fdf[_0xad5a('0x2a')]+_0x259fdf[_0xad5a('0x2b')],_0x43f739;if(_0x3e4512>=_0x28364c){_0x3e4512=_0x28364c;_0x43f739=0xc8;}else{_0x43f739=0xce;}_0x4c9627[_0xad5a('0x26')](_0x43f739);return _0x4c9627[_0xad5a('0x2c')](_0xad5a('0x2d'),_0xf071d3+'-'+_0x3e4512+'/'+_0x28364c)[_0xad5a('0x28')](_0x288a24);}return null;};}function patchUpdates(_0x5818f7){return function(_0x32164f){try{jsonpatch[_0xad5a('0x2e')](_0x32164f,_0x5818f7,!![]);}catch(_0x148641){return BPromise['reject'](_0x148641);}return _0x32164f[_0xad5a('0x2f')]();};}function saveUpdates(_0x100bf7,_0x2f8c44){return function(_0x29a3b0){if(_0x29a3b0){return _0x29a3b0[_0xad5a('0x30')](_0x100bf7)[_0xad5a('0x1b')](function(_0x4dfaa7){return _0x4dfaa7;});}return null;};}function removeEntity(_0x1d2ab0,_0xb06ec8){return function(_0x2bed19){if(_0x2bed19){return _0x2bed19[_0xad5a('0x31')]()[_0xad5a('0x1b')](function(){_0x1d2ab0['status'](0xcc)[_0xad5a('0x27')]();});}};}function handleEntityNotFound(_0x5af00d,_0x4378a4){return function(_0xb70adf){if(!_0xb70adf){_0x5af00d[_0xad5a('0x25')](0x194);}return _0xb70adf;};}function handleError(_0x5043b9,_0x2896b8){_0x2896b8=_0x2896b8||0x1f4;return function(_0x4e3edd){logger[_0xad5a('0x1f')](_0x4e3edd[_0xad5a('0x32')]);if(_0x4e3edd[_0xad5a('0x33')]){delete _0x4e3edd[_0xad5a('0x33')];}_0x5043b9[_0xad5a('0x26')](_0x2896b8)[_0xad5a('0x34')](_0x4e3edd);};}exports[_0xad5a('0x35')]=function(_0x878f86,_0x4256fb){var _0x4788be={},_0xac094b={},_0x352952={'count':0x0,'rows':[]};var _0x38bcb2=db[_0xad5a('0x36')][_0xad5a('0x37')];_0xac094b[_0xad5a('0x38')]=_[_0xad5a('0x39')](_0x38bcb2);_0xac094b[_0xad5a('0x3a')]=_[_0xad5a('0x39')](_0x878f86[_0xad5a('0x3a')]);_0xac094b[_0xad5a('0x3b')]=_[_0xad5a('0x3c')](_0xac094b[_0xad5a('0x38')],_0xac094b[_0xad5a('0x3a')]);_0x4788be[_0xad5a('0x3d')]=_[_0xad5a('0x3c')](_0xac094b[_0xad5a('0x38')],qs[_0xad5a('0x3e')](_0x878f86[_0xad5a('0x3a')][_0xad5a('0x3e')]));_0x4788be[_0xad5a('0x3d')]=_0x4788be['attributes'][_0xad5a('0x3f')]?_0x4788be[_0xad5a('0x3d')]:_0xac094b[_0xad5a('0x38')];if(!_0x878f86[_0xad5a('0x3a')][_0xad5a('0x40')](_0xad5a('0x41'))){_0x4788be[_0xad5a('0x2b')]=qs['limit'](_0x878f86[_0xad5a('0x3a')]['limit']);_0x4788be['offset']=qs[_0xad5a('0x2a')](_0x878f86[_0xad5a('0x3a')][_0xad5a('0x2a')]);}_0x4788be[_0xad5a('0x42')]=qs['sort'](_0x878f86[_0xad5a('0x3a')][_0xad5a('0x43')]);_0x4788be['where']=qs[_0xad5a('0x3b')](_[_0xad5a('0x44')](_0x878f86[_0xad5a('0x3a')],_0xac094b[_0xad5a('0x3b')]));if(_0x878f86[_0xad5a('0x3a')][_0xad5a('0x45')]){_0x4788be['where']=_[_0xad5a('0x46')](_0x4788be['where'],{'$or':_[_0xad5a('0x47')](_0x38bcb2,function(_0x4eb21e){if(_0x4eb21e[_0xad5a('0x48')][_0xad5a('0x49')]!==_0xad5a('0x4a')){var _0x3fd0ba={};_0x3fd0ba[_0x4eb21e['field']]={'$like':'%'+_0x878f86[_0xad5a('0x3a')][_0xad5a('0x45')]+'%'};return _0x3fd0ba;}})});}_0x4788be=_[_0xad5a('0x46')]({},_0x4788be,_0x878f86[_0xad5a('0x4b')]);var _0x2a7819={'where':_0x4788be[_0xad5a('0x4c')]};return db[_0xad5a('0x36')][_0xad5a('0x29')](_0x2a7819)[_0xad5a('0x1b')](function(_0x156c6f){_0x352952['count']=_0x156c6f;if(_0x878f86[_0xad5a('0x3a')][_0xad5a('0x4d')]){_0x4788be[_0xad5a('0x4e')]=[{'all':!![]}];}return db[_0xad5a('0x36')][_0xad5a('0x4f')](_0x4788be);})[_0xad5a('0x1b')](function(_0x184f53){_0x352952['rows']=_0x184f53;return _0x352952;})[_0xad5a('0x1b')](respondWithFilteredResult(_0x4256fb,_0x4788be))['catch'](handleError(_0x4256fb,null));};exports[_0xad5a('0x50')]=function(_0x2e958a,_0x241959){var _0x5f7f82={'raw':![],'where':{'id':_0x2e958a[_0xad5a('0x51')]['id']}},_0x2c2f83={};_0x2c2f83[_0xad5a('0x38')]=_['keys'](db[_0xad5a('0x36')][_0xad5a('0x37')]);_0x2c2f83[_0xad5a('0x3a')]=_[_0xad5a('0x39')](_0x2e958a[_0xad5a('0x3a')]);_0x2c2f83['filters']=_['intersection'](_0x2c2f83[_0xad5a('0x38')],_0x2c2f83[_0xad5a('0x3a')]);_0x5f7f82[_0xad5a('0x3d')]=_[_0xad5a('0x3c')](_0x2c2f83['model'],qs[_0xad5a('0x3e')](_0x2e958a[_0xad5a('0x3a')][_0xad5a('0x3e')]));_0x5f7f82[_0xad5a('0x3d')]=_0x5f7f82[_0xad5a('0x3d')]['length']?_0x5f7f82[_0xad5a('0x3d')]:_0x2c2f83[_0xad5a('0x38')];if(_0x2e958a['query'][_0xad5a('0x4d')]){_0x5f7f82[_0xad5a('0x4e')]=[{'all':!![]}];}_0x5f7f82=_[_0xad5a('0x46')]({},_0x5f7f82,_0x2e958a['options']);return db[_0xad5a('0x36')][_0xad5a('0x52')](_0x5f7f82)[_0xad5a('0x1b')](handleEntityNotFound(_0x241959,null))[_0xad5a('0x1b')](respondWithResult(_0x241959,null))[_0xad5a('0x24')](handleError(_0x241959,null));};exports[_0xad5a('0x53')]=function(_0x310ffb,_0x4beae0){return db[_0xad5a('0x36')]['create'](_0x310ffb[_0xad5a('0x54')],{})['then'](respondWithResult(_0x4beae0,0xc9))['catch'](handleError(_0x4beae0,null));};exports[_0xad5a('0x30')]=function(_0x1e7db5,_0xd9278d){if(_0x1e7db5['body']['id']){delete _0x1e7db5[_0xad5a('0x54')]['id'];}return db[_0xad5a('0x36')]['find']({'where':{'id':_0x1e7db5[_0xad5a('0x51')]['id']}})[_0xad5a('0x1b')](handleEntityNotFound(_0xd9278d,null))[_0xad5a('0x1b')](saveUpdates(_0x1e7db5[_0xad5a('0x54')],null))[_0xad5a('0x1b')](respondWithResult(_0xd9278d,null))[_0xad5a('0x24')](handleError(_0xd9278d,null));};exports[_0xad5a('0x31')]=function(_0x3042dc,_0x4bdc76){return db[_0xad5a('0x36')][_0xad5a('0x52')]({'where':{'id':_0x3042dc[_0xad5a('0x51')]['id']}})[_0xad5a('0x1b')](handleEntityNotFound(_0x4bdc76,null))[_0xad5a('0x1b')](removeEntity(_0x4bdc76,null))[_0xad5a('0x24')](handleError(_0x4bdc76,null));};exports[_0xad5a('0x55')]=function(_0x3765a8,_0x3f5f7a,_0x2ccb24){var _0x3cf8ed={};var _0x1d5018={};var _0x1a153b;var _0x5725c5;return db[_0xad5a('0x36')][_0xad5a('0x56')]({'where':{'id':_0x3765a8[_0xad5a('0x51')]['id']}})[_0xad5a('0x1b')](handleEntityNotFound(_0x3f5f7a,null))[_0xad5a('0x1b')](function(_0x4f1787){if(_0x4f1787){_0x1a153b=_0x4f1787;_0x1d5018[_0xad5a('0x38')]=_[_0xad5a('0x39')](db['ZohoConfiguration'][_0xad5a('0x37')]);_0x1d5018[_0xad5a('0x3a')]=_['keys'](_0x3765a8[_0xad5a('0x3a')]);_0x1d5018[_0xad5a('0x3b')]=_[_0xad5a('0x3c')](_0x1d5018[_0xad5a('0x38')],_0x1d5018[_0xad5a('0x3a')]);_0x3cf8ed[_0xad5a('0x3d')]=_['intersection'](_0x1d5018[_0xad5a('0x38')],qs['fields'](_0x3765a8[_0xad5a('0x3a')][_0xad5a('0x3e')]));_0x3cf8ed[_0xad5a('0x3d')]=_0x3cf8ed[_0xad5a('0x3d')][_0xad5a('0x3f')]?_0x3cf8ed[_0xad5a('0x3d')]:_0x1d5018[_0xad5a('0x38')];_0x3cf8ed[_0xad5a('0x42')]=qs[_0xad5a('0x43')](_0x3765a8[_0xad5a('0x3a')][_0xad5a('0x43')]);_0x3cf8ed['where']=qs[_0xad5a('0x3b')](_[_0xad5a('0x44')](_0x3765a8[_0xad5a('0x3a')],_0x1d5018['filters']));if(_0x3765a8[_0xad5a('0x3a')][_0xad5a('0x45')]){_0x3cf8ed[_0xad5a('0x4c')]=_[_0xad5a('0x46')](_0x3cf8ed['where'],{'$or':_[_0xad5a('0x47')](_0x3cf8ed[_0xad5a('0x3d')],function(_0x180932){var _0x489500={};_0x489500[_0x180932]={'$like':'%'+_0x3765a8[_0xad5a('0x3a')][_0xad5a('0x45')]+'%'};return _0x489500;})});}_0x3cf8ed=_[_0xad5a('0x46')]({},_0x3cf8ed,_0x3765a8['options']);return _0x1a153b[_0xad5a('0x55')](_0x3cf8ed);}})[_0xad5a('0x1b')](function(_0x335e15){if(_0x335e15){_0x5725c5=_0x335e15[_0xad5a('0x3f')];if(!_0x3765a8[_0xad5a('0x3a')]['hasOwnProperty'](_0xad5a('0x41'))){_0x3cf8ed[_0xad5a('0x2b')]=qs[_0xad5a('0x2b')](_0x3765a8[_0xad5a('0x3a')][_0xad5a('0x2b')]);_0x3cf8ed[_0xad5a('0x2a')]=qs['offset'](_0x3765a8['query'][_0xad5a('0x2a')]);}return _0x1a153b['getConfigurations'](_0x3cf8ed);}})[_0xad5a('0x1b')](function(_0x1b5bc6){if(_0x1b5bc6){return _0x1b5bc6?{'count':_0x5725c5,'rows':_0x1b5bc6}:null;}})[_0xad5a('0x1b')](respondWithResult(_0x3f5f7a,null))[_0xad5a('0x24')](handleError(_0x3f5f7a,null));};exports[_0xad5a('0x57')]=function(_0xe8004e,_0x47bfaf,_0x41493e){if(_0xe8004e[_0xad5a('0x54')]['id']){delete _0xe8004e[_0xad5a('0x54')]['id'];}return db[_0xad5a('0x36')][_0xad5a('0x56')]({'where':{'id':_0xe8004e[_0xad5a('0x51')]['id']}})[_0xad5a('0x1b')](handleEntityNotFound(_0x47bfaf,null))['then'](function(_0x545d45){if(_0x545d45){_0xe8004e['body'][_0xad5a('0x58')]=_0x545d45['id'];_0xe8004e[_0xad5a('0x54')][_0xad5a('0x59')]=integrations[_0xad5a('0x5a')](_0xe8004e[_0xad5a('0x54')][_0xad5a('0x5b')],_0xe8004e[_0xad5a('0x54')]['type']);_0xe8004e[_0xad5a('0x54')][_0xad5a('0x5c')]=integrations[_0xad5a('0x5d')](_0xe8004e['body'][_0xad5a('0x5b')],_0xe8004e[_0xad5a('0x54')][_0xad5a('0x48')]);return db['ZohoConfiguration'][_0xad5a('0x53')](_0xe8004e[_0xad5a('0x54')],{'include':[{'model':db[_0xad5a('0x5e')],'as':_0xad5a('0x59')},{'model':db[_0xad5a('0x5e')],'as':_0xad5a('0x5c')}]});}return null;})[_0xad5a('0x1b')](respondWithResult(_0x47bfaf,null))['catch'](handleError(_0x47bfaf,null));};exports['getFields']=function(_0x3fbb16,_0x150445,_0x16dbd0){var _0x188794='';return db[_0xad5a('0x36')][_0xad5a('0x56')]({'where':{'id':_0x3fbb16[_0xad5a('0x51')]['id']},'attributes':['id','host','authToken']})[_0xad5a('0x1b')](handleEntityNotFound(_0x150445,null))['then'](function(_0x5446a6){if(_0x5446a6){_0x188794=_0x5446a6[_0xad5a('0x5f')];var _0x16b2a3=_0x188794[_0xad5a('0x60')](-0x1);if(_0x16b2a3==='/'){_0x188794=_0x188794[_0xad5a('0x61')](0x0,_0x188794[_0xad5a('0x62')](_0x16b2a3));}return rp({'method':'GET','uri':util[_0xad5a('0x63')](_0xad5a('0x64'),_0x188794),'qs':{'authtoken':_0x5446a6[_0xad5a('0x65')],'scope':_0xad5a('0x66')},'json':!![]});}})[_0xad5a('0x1b')](function(_0xb19e0f){if(_0xb19e0f){if(_0xb19e0f[_0xad5a('0x67')]&&_0xb19e0f[_0xad5a('0x67')]['error']){throw new Error(_0xb19e0f[_0xad5a('0x67')][_0xad5a('0x1f')]['message']);}var _0xba0de=[];if(_0xb19e0f[_0xad5a('0x68')]&&_0xb19e0f['Calls']['section']){if(_0xb19e0f['Calls'][_0xad5a('0x69')]['FL']){var _0x25bf8d=[_0xad5a('0x6a')];for(var _0x448d19=0x0,_0xab1208=_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0xad5a('0x3f')];_0x448d19<_0xab1208;_0x448d19++){if(_[_0xad5a('0x6b')](_0x25bf8d,_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0x448d19]['dv'])){_0xba0de[_0xad5a('0x6c')]({'id':_0xb19e0f[_0xad5a('0x68')]['section']['FL'][_0x448d19]['dv'],'name':_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0x448d19][_0xad5a('0x6d')],'custom':_0xb19e0f['Calls'][_0xad5a('0x69')]['FL'][_0x448d19]['customfield']===_0xad5a('0x6e')?!![]:![],'options':_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0x448d19][_0xad5a('0x48')]===_0xad5a('0x6f')&&_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0x448d19]['val']?_[_0xad5a('0x47')](_0xb19e0f[_0xad5a('0x68')][_0xad5a('0x69')]['FL'][_0x448d19][_0xad5a('0x70')],function(_0x17f0f7){return{'name':_0x17f0f7,'value':_0x17f0f7};}):[]});}}}}return{'count':_0xba0de['length'],'rows':_0xba0de};}})['then'](respondWithResult(_0x150445,null))[_0xad5a('0x24')](function(_0x258829){var _0x12ceed=_0x3fbb16[_0xad5a('0x3a')][_0xad5a('0x19')]?0x1f4:_0x258829[_0xad5a('0x71')]||0x1f4;logger[_0xad5a('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xad5a('0x72'),_0x12ceed,JSON[_0xad5a('0x1e')](_0x258829));delete _0x258829[_0xad5a('0x33')];if(_0x12ceed===0x191){_0x12ceed=0x190;}_0x150445[_0xad5a('0x26')](_0x12ceed)[_0xad5a('0x34')](_0x3fbb16[_0xad5a('0x3a')][_0xad5a('0x19')]?{'message':_0xad5a('0x73'),'statusCode':_0x258829[_0xad5a('0x71')]}:_0x258829);});}; \ No newline at end of file +var _0xabee=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','catch','show','params','include','create','body','find','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','getFields','authToken','slice','GET','format','https://crm.%s/crm/private/json/Calls/getFields','response','section','Calls','push','label','customfield','Pick\x20List','val','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json'];(function(_0x572e10,_0x337aed){var _0x56b91d=function(_0x2df858){while(--_0x2df858){_0x572e10['push'](_0x572e10['shift']());}};_0x56b91d(++_0x337aed);}(_0xabee,0xb6));var _0xeabe=function(_0x5f1c3e,_0x532f71){_0x5f1c3e=_0x5f1c3e-0x0;var _0x19b1ca=_0xabee[_0x5f1c3e];return _0x19b1ca;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeabe('0x0'));var jsonpatch=require(_0xeabe('0x1'));var rp=require(_0xeabe('0x2'));var moment=require(_0xeabe('0x3'));var BPromise=require(_0xeabe('0x4'));var Mustache=require('mustache');var util=require(_0xeabe('0x5'));var path=require(_0xeabe('0x6'));var sox=require(_0xeabe('0x7'));var csv=require(_0xeabe('0x8'));var ejs=require(_0xeabe('0x9'));var fs=require('fs');var _=require(_0xeabe('0xa'));var squel=require(_0xeabe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeabe('0x8'));var querystring=require(_0xeabe('0xc'));var Papa=require(_0xeabe('0xd'));var Redis=require('ioredis');var authService=require(_0xeabe('0xe'));var qs=require(_0xeabe('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeabe('0x10'))(_0xeabe('0x11'));var utils=require('../../config/utils');var config=require(_0xeabe('0x12'));var db=require(_0xeabe('0x13'))['db'];var integrations=require(_0xeabe('0x14'));var jayson=require(_0xeabe('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x59a240,_0x18ddcf,_0x41fce6){if(_0x41fce6){var _0x4081f1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4081f1[_0xeabe('0x16')](_0x18ddcf)){return _0x59a240;}else{throw new Error(_0xeabe('0x17'));}}else{return _0x59a240;}}function respondWithRpcPromise(_0x42d5d6,_0x15e98a,_0x433dbf,_0x2fbb46){return new BPromise(function(_0x4f0eaa,_0x30115a){var _0x36e340=_0x2fbb46||client;return _0x36e340[_0xeabe('0x18')](_0x42d5d6,_0x433dbf)['then'](function(_0x20e9e6){logger[_0xeabe('0x19')](_0xeabe('0x1a'),_0x15e98a,_0xeabe('0x1b'));logger[_0xeabe('0x1c')](_0xeabe('0x1d'),_0x15e98a,_0xeabe('0x1b'),JSON[_0xeabe('0x1e')](_0x20e9e6));if(_0x20e9e6[_0xeabe('0x1f')]){if(_0x20e9e6[_0xeabe('0x1f')][_0xeabe('0x20')]===0x1f4){logger['error'](_0xeabe('0x1a'),_0x15e98a,_0x20e9e6['error']['message']);return _0x30115a(_0x20e9e6[_0xeabe('0x1f')][_0xeabe('0x21')]);}logger[_0xeabe('0x1f')](_0xeabe('0x1a'),_0x15e98a,_0x20e9e6[_0xeabe('0x1f')][_0xeabe('0x21')]);return _0x4f0eaa(_0x20e9e6['error'][_0xeabe('0x21')]);}else{logger[_0xeabe('0x19')](_0xeabe('0x1a'),_0x15e98a,'request\x20sent');_0x4f0eaa(_0x20e9e6['result'][_0xeabe('0x21')]);}})['catch'](function(_0x30f424){logger[_0xeabe('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x15e98a,_0x30f424);_0x30115a(_0x30f424);});});}function respondWithStatusCode(_0xb698e0,_0x391784){_0x391784=_0x391784||0xcc;return function(_0x245aef){if(_0x245aef){return _0xb698e0[_0xeabe('0x22')](_0x391784);}return _0xb698e0['status'](_0x391784)[_0xeabe('0x23')]();};}function respondWithResult(_0x736c65,_0x353372){_0x353372=_0x353372||0xc8;return function(_0x1d655b){if(_0x1d655b){return _0x736c65[_0xeabe('0x24')](_0x353372)[_0xeabe('0x25')](_0x1d655b);}};}function respondWithFilteredResult(_0x5d4a48,_0x52a388){return function(_0x2c631b){if(_0x2c631b){var _0x38e95d=_0x2c631b[_0xeabe('0x26')],_0x10911d=_0x52a388[_0xeabe('0x27')],_0x49034d=_0x52a388[_0xeabe('0x27')]+_0x52a388['limit'],_0x18a0c;if(_0x49034d>=_0x38e95d){_0x49034d=_0x38e95d;_0x18a0c=0xc8;}else{_0x18a0c=0xce;}_0x5d4a48[_0xeabe('0x24')](_0x18a0c);return _0x5d4a48[_0xeabe('0x28')](_0xeabe('0x29'),_0x10911d+'-'+_0x49034d+'/'+_0x38e95d)[_0xeabe('0x25')](_0x2c631b);}return null;};}function patchUpdates(_0x151db4){return function(_0x61991e){try{jsonpatch[_0xeabe('0x2a')](_0x61991e,_0x151db4,!![]);}catch(_0x5609e8){return BPromise[_0xeabe('0x2b')](_0x5609e8);}return _0x61991e[_0xeabe('0x2c')]();};}function saveUpdates(_0x2a51a6,_0x9e0a98){return function(_0x4e283a){if(_0x4e283a){return _0x4e283a[_0xeabe('0x2d')](_0x2a51a6)[_0xeabe('0x2e')](function(_0x1fbe81){return _0x1fbe81;});}return null;};}function removeEntity(_0x11a2c1,_0x4ecd93){return function(_0x4eed0f){if(_0x4eed0f){return _0x4eed0f[_0xeabe('0x2f')]()[_0xeabe('0x2e')](function(){_0x11a2c1[_0xeabe('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ee1f,_0x4a650e){return function(_0x45af57){if(!_0x45af57){_0x58ee1f[_0xeabe('0x22')](0x194);}return _0x45af57;};}function handleError(_0x291a6a,_0x2c1509){_0x2c1509=_0x2c1509||0x1f4;return function(_0x54962e){logger[_0xeabe('0x1f')](_0x54962e['stack']);if(_0x54962e[_0xeabe('0x30')]){delete _0x54962e['name'];}_0x291a6a['status'](_0x2c1509)[_0xeabe('0x31')](_0x54962e);};}exports['index']=function(_0x5461ec,_0x5e1c3e){var _0xc22b6f={},_0x455793={},_0x19a11e={'count':0x0,'rows':[]};var _0x1adaa7=db[_0xeabe('0x32')][_0xeabe('0x33')];_0x455793[_0xeabe('0x34')]=_[_0xeabe('0x35')](_0x1adaa7);_0x455793[_0xeabe('0x36')]=_[_0xeabe('0x35')](_0x5461ec['query']);_0x455793[_0xeabe('0x37')]=_[_0xeabe('0x38')](_0x455793['model'],_0x455793['query']);_0xc22b6f[_0xeabe('0x39')]=_['intersection'](_0x455793[_0xeabe('0x34')],qs['fields'](_0x5461ec[_0xeabe('0x36')][_0xeabe('0x3a')]));_0xc22b6f[_0xeabe('0x39')]=_0xc22b6f[_0xeabe('0x39')][_0xeabe('0x3b')]?_0xc22b6f[_0xeabe('0x39')]:_0x455793[_0xeabe('0x34')];if(!_0x5461ec['query'][_0xeabe('0x3c')]('nolimit')){_0xc22b6f[_0xeabe('0x3d')]=qs[_0xeabe('0x3d')](_0x5461ec[_0xeabe('0x36')]['limit']);_0xc22b6f[_0xeabe('0x27')]=qs[_0xeabe('0x27')](_0x5461ec[_0xeabe('0x36')][_0xeabe('0x27')]);}_0xc22b6f[_0xeabe('0x3e')]=qs[_0xeabe('0x3f')](_0x5461ec[_0xeabe('0x36')][_0xeabe('0x3f')]);_0xc22b6f[_0xeabe('0x40')]=qs[_0xeabe('0x37')](_[_0xeabe('0x41')](_0x5461ec['query'],_0x455793[_0xeabe('0x37')]));if(_0x5461ec[_0xeabe('0x36')][_0xeabe('0x42')]){_0xc22b6f['where']=_[_0xeabe('0x43')](_0xc22b6f[_0xeabe('0x40')],{'$or':_[_0xeabe('0x44')](_0x1adaa7,function(_0x2c542d){if(_0x2c542d[_0xeabe('0x45')][_0xeabe('0x46')]!==_0xeabe('0x47')){var _0xe6d982={};_0xe6d982[_0x2c542d['field']]={'$like':'%'+_0x5461ec['query'][_0xeabe('0x42')]+'%'};return _0xe6d982;}})});}_0xc22b6f=_[_0xeabe('0x43')]({},_0xc22b6f,_0x5461ec[_0xeabe('0x48')]);var _0x107ddf={'where':_0xc22b6f['where']};return db['ZohoAccount'][_0xeabe('0x26')](_0x107ddf)[_0xeabe('0x2e')](function(_0x41f4f6){_0x19a11e[_0xeabe('0x26')]=_0x41f4f6;if(_0x5461ec['query'][_0xeabe('0x49')]){_0xc22b6f['include']=[{'all':!![]}];}return db[_0xeabe('0x32')]['findAll'](_0xc22b6f);})['then'](function(_0x497112){_0x19a11e['rows']=_0x497112;return _0x19a11e;})[_0xeabe('0x2e')](respondWithFilteredResult(_0x5e1c3e,_0xc22b6f))[_0xeabe('0x4a')](handleError(_0x5e1c3e,null));};exports[_0xeabe('0x4b')]=function(_0x34f4ad,_0x230c35){var _0x273d1f={'raw':![],'where':{'id':_0x34f4ad[_0xeabe('0x4c')]['id']}},_0x38cca6={};_0x38cca6['model']=_[_0xeabe('0x35')](db['ZohoAccount'][_0xeabe('0x33')]);_0x38cca6['query']=_[_0xeabe('0x35')](_0x34f4ad[_0xeabe('0x36')]);_0x38cca6[_0xeabe('0x37')]=_['intersection'](_0x38cca6[_0xeabe('0x34')],_0x38cca6[_0xeabe('0x36')]);_0x273d1f[_0xeabe('0x39')]=_[_0xeabe('0x38')](_0x38cca6['model'],qs['fields'](_0x34f4ad[_0xeabe('0x36')][_0xeabe('0x3a')]));_0x273d1f[_0xeabe('0x39')]=_0x273d1f[_0xeabe('0x39')][_0xeabe('0x3b')]?_0x273d1f[_0xeabe('0x39')]:_0x38cca6[_0xeabe('0x34')];if(_0x34f4ad[_0xeabe('0x36')][_0xeabe('0x49')]){_0x273d1f[_0xeabe('0x4d')]=[{'all':!![]}];}_0x273d1f=_[_0xeabe('0x43')]({},_0x273d1f,_0x34f4ad[_0xeabe('0x48')]);return db[_0xeabe('0x32')]['find'](_0x273d1f)[_0xeabe('0x2e')](handleEntityNotFound(_0x230c35,null))[_0xeabe('0x2e')](respondWithResult(_0x230c35,null))[_0xeabe('0x4a')](handleError(_0x230c35,null));};exports[_0xeabe('0x4e')]=function(_0x550958,_0x4a3fb2){return db[_0xeabe('0x32')][_0xeabe('0x4e')](_0x550958['body'],{})['then'](respondWithResult(_0x4a3fb2,0xc9))['catch'](handleError(_0x4a3fb2,null));};exports[_0xeabe('0x2d')]=function(_0x14e124,_0x23d083){if(_0x14e124[_0xeabe('0x4f')]['id']){delete _0x14e124['body']['id'];}return db[_0xeabe('0x32')][_0xeabe('0x50')]({'where':{'id':_0x14e124[_0xeabe('0x4c')]['id']}})[_0xeabe('0x2e')](handleEntityNotFound(_0x23d083,null))[_0xeabe('0x2e')](saveUpdates(_0x14e124[_0xeabe('0x4f')],null))[_0xeabe('0x2e')](respondWithResult(_0x23d083,null))[_0xeabe('0x4a')](handleError(_0x23d083,null));};exports['destroy']=function(_0x31e7dc,_0x43d926){return db[_0xeabe('0x32')]['find']({'where':{'id':_0x31e7dc['params']['id']}})[_0xeabe('0x2e')](handleEntityNotFound(_0x43d926,null))['then'](removeEntity(_0x43d926,null))[_0xeabe('0x4a')](handleError(_0x43d926,null));};exports[_0xeabe('0x51')]=function(_0x2d5b23,_0x398fea,_0x35ed9d){var _0x2d3f40={};var _0xd5d813={};var _0x8ab364;var _0x4cd809;return db[_0xeabe('0x32')][_0xeabe('0x52')]({'where':{'id':_0x2d5b23[_0xeabe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x398fea,null))[_0xeabe('0x2e')](function(_0x26b22d){if(_0x26b22d){_0x8ab364=_0x26b22d;_0xd5d813['model']=_['keys'](db[_0xeabe('0x53')][_0xeabe('0x33')]);_0xd5d813[_0xeabe('0x36')]=_[_0xeabe('0x35')](_0x2d5b23[_0xeabe('0x36')]);_0xd5d813[_0xeabe('0x37')]=_[_0xeabe('0x38')](_0xd5d813['model'],_0xd5d813[_0xeabe('0x36')]);_0x2d3f40['attributes']=_[_0xeabe('0x38')](_0xd5d813[_0xeabe('0x34')],qs[_0xeabe('0x3a')](_0x2d5b23['query']['fields']));_0x2d3f40[_0xeabe('0x39')]=_0x2d3f40[_0xeabe('0x39')][_0xeabe('0x3b')]?_0x2d3f40[_0xeabe('0x39')]:_0xd5d813[_0xeabe('0x34')];_0x2d3f40[_0xeabe('0x3e')]=qs['sort'](_0x2d5b23['query']['sort']);_0x2d3f40[_0xeabe('0x40')]=qs[_0xeabe('0x37')](_[_0xeabe('0x41')](_0x2d5b23[_0xeabe('0x36')],_0xd5d813[_0xeabe('0x37')]));if(_0x2d5b23[_0xeabe('0x36')][_0xeabe('0x42')]){_0x2d3f40[_0xeabe('0x40')]=_[_0xeabe('0x43')](_0x2d3f40[_0xeabe('0x40')],{'$or':_[_0xeabe('0x44')](_0x2d3f40[_0xeabe('0x39')],function(_0x18f8b7){var _0x13643c={};_0x13643c[_0x18f8b7]={'$like':'%'+_0x2d5b23[_0xeabe('0x36')][_0xeabe('0x42')]+'%'};return _0x13643c;})});}_0x2d3f40=_[_0xeabe('0x43')]({},_0x2d3f40,_0x2d5b23[_0xeabe('0x48')]);return _0x8ab364[_0xeabe('0x51')](_0x2d3f40);}})[_0xeabe('0x2e')](function(_0x14bb82){if(_0x14bb82){_0x4cd809=_0x14bb82['length'];if(!_0x2d5b23[_0xeabe('0x36')]['hasOwnProperty'](_0xeabe('0x54'))){_0x2d3f40[_0xeabe('0x3d')]=qs[_0xeabe('0x3d')](_0x2d5b23['query']['limit']);_0x2d3f40[_0xeabe('0x27')]=qs[_0xeabe('0x27')](_0x2d5b23[_0xeabe('0x36')][_0xeabe('0x27')]);}return _0x8ab364[_0xeabe('0x51')](_0x2d3f40);}})['then'](function(_0x215c92){if(_0x215c92){return _0x215c92?{'count':_0x4cd809,'rows':_0x215c92}:null;}})[_0xeabe('0x2e')](respondWithResult(_0x398fea,null))[_0xeabe('0x4a')](handleError(_0x398fea,null));};exports[_0xeabe('0x55')]=function(_0x316b0b,_0x52990d,_0x34ae62){if(_0x316b0b[_0xeabe('0x4f')]['id']){delete _0x316b0b[_0xeabe('0x4f')]['id'];}return db[_0xeabe('0x32')]['findOne']({'where':{'id':_0x316b0b[_0xeabe('0x4c')]['id']}})[_0xeabe('0x2e')](handleEntityNotFound(_0x52990d,null))[_0xeabe('0x2e')](function(_0x57a94c){if(_0x57a94c){_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x56')]=_0x57a94c['id'];_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x57')]=integrations[_0xeabe('0x58')](_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x59')],_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x45')]);_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x5a')]=integrations[_0xeabe('0x5b')](_0x316b0b['body']['channel'],_0x316b0b[_0xeabe('0x4f')][_0xeabe('0x45')]);return db[_0xeabe('0x53')]['create'](_0x316b0b['body'],{'include':[{'model':db[_0xeabe('0x5c')],'as':_0xeabe('0x57')},{'model':db[_0xeabe('0x5c')],'as':_0xeabe('0x5a')}]});}return null;})[_0xeabe('0x2e')](respondWithResult(_0x52990d,null))[_0xeabe('0x4a')](handleError(_0x52990d,null));};exports[_0xeabe('0x5d')]=function(_0x1dc78d,_0x46c9f4,_0x41dcb6){var _0x5f4d64='';return db['ZohoAccount'][_0xeabe('0x52')]({'where':{'id':_0x1dc78d['params']['id']},'attributes':['id','host',_0xeabe('0x5e')]})[_0xeabe('0x2e')](handleEntityNotFound(_0x46c9f4,null))[_0xeabe('0x2e')](function(_0x2c197c){if(_0x2c197c){_0x5f4d64=_0x2c197c['host'];var _0x13cafc=_0x5f4d64[_0xeabe('0x5f')](-0x1);if(_0x13cafc==='/'){_0x5f4d64=_0x5f4d64['substring'](0x0,_0x5f4d64['lastIndexOf'](_0x13cafc));}return rp({'method':_0xeabe('0x60'),'uri':util[_0xeabe('0x61')](_0xeabe('0x62'),_0x5f4d64),'qs':{'authtoken':_0x2c197c[_0xeabe('0x5e')],'scope':'crmapi'},'json':!![]});}})[_0xeabe('0x2e')](function(_0x2591b7){if(_0x2591b7){if(_0x2591b7[_0xeabe('0x63')]&&_0x2591b7['response'][_0xeabe('0x1f')]){throw new Error(_0x2591b7[_0xeabe('0x63')][_0xeabe('0x1f')]['message']);}var _0x556b78=[];if(_0x2591b7['Calls']&&_0x2591b7['Calls'][_0xeabe('0x64')]){if(_0x2591b7[_0xeabe('0x65')]['section']['FL']){var _0x2ebd72=['Call\x20Purpose'];for(var _0x10f108=0x0,_0x36d0c8=_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0xeabe('0x3b')];_0x10f108<_0x36d0c8;_0x10f108++){if(_['includes'](_0x2ebd72,_0x2591b7['Calls'][_0xeabe('0x64')]['FL'][_0x10f108]['dv'])){_0x556b78[_0xeabe('0x66')]({'id':_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108]['dv'],'name':_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108][_0xeabe('0x67')],'custom':_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108][_0xeabe('0x68')]==='true'?!![]:![],'options':_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108][_0xeabe('0x45')]===_0xeabe('0x69')&&_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108]['val']?_[_0xeabe('0x44')](_0x2591b7[_0xeabe('0x65')][_0xeabe('0x64')]['FL'][_0x10f108][_0xeabe('0x6a')],function(_0x507d6b){return{'name':_0x507d6b,'value':_0x507d6b};}):[]});}}}}return{'count':_0x556b78[_0xeabe('0x3b')],'rows':_0x556b78};}})['then'](respondWithResult(_0x46c9f4,null))[_0xeabe('0x4a')](function(_0x3ebb24){var _0xcc0976=_0x1dc78d['query'][_0xeabe('0x16')]?0x1f4:_0x3ebb24['statusCode']||0x1f4;logger[_0xeabe('0x1f')](_0xeabe('0x6b'),_0xeabe('0x5d'),_0xcc0976,JSON[_0xeabe('0x1e')](_0x3ebb24));delete _0x3ebb24['name'];if(_0xcc0976===0x191){_0xcc0976=0x190;}_0x46c9f4[_0xeabe('0x24')](_0xcc0976)[_0xeabe('0x31')](_0x1dc78d['query'][_0xeabe('0x16')]?{'message':_0xeabe('0x6c'),'statusCode':_0x3ebb24[_0xeabe('0x6d')]}:_0x3ebb24);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a792fa8..982c04d 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 _0xbc7b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','lodash'];(function(_0x3f9a53,_0x210f42){var _0x45fc20=function(_0x68bb52){while(--_0x68bb52){_0x3f9a53['push'](_0x3f9a53['shift']());}};_0x45fc20(++_0x210f42);}(_0xbc7b,0x195));var _0xbbc7=function(_0x18e919,_0x150e77){_0x18e919=_0x18e919-0x0;var _0x379d42=_0xbc7b[_0x18e919];return _0x379d42;};'use strict';var _=require(_0xbbc7('0x0'));var util=require('util');var logger=require(_0xbbc7('0x1'))(_0xbbc7('0x2'));var moment=require(_0xbbc7('0x3'));var BPromise=require(_0xbbc7('0x4'));var rp=require(_0xbbc7('0x5'));var fs=require('fs');var path=require(_0xbbc7('0x6'));var rimraf=require(_0xbbc7('0x7'));var config=require(_0xbbc7('0x8'));var attributes=require(_0xbbc7('0x9'));var integrations=require(_0xbbc7('0xa'));module[_0xbbc7('0xb')]=function(_0x5a230b,_0x256169){return _0x5a230b[_0xbbc7('0xc')]('ZohoAccount',attributes,{'tableName':_0xbbc7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x826a=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','lodash'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x826a,0x15b));var _0xa826=function(_0x17b657,_0x4925b4){_0x17b657=_0x17b657-0x0;var _0x72b653=_0x826a[_0x17b657];return _0x72b653;};'use strict';var _=require(_0xa826('0x0'));var util=require(_0xa826('0x1'));var logger=require(_0xa826('0x2'))(_0xa826('0x3'));var moment=require('moment');var BPromise=require(_0xa826('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa826('0x5'));var rimraf=require(_0xa826('0x6'));var config=require(_0xa826('0x7'));var attributes=require(_0xa826('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xa826('0x9')]=function(_0x1c89c6,_0x52098){return _0x1c89c6[_0xa826('0xa')]('ZohoAccount',attributes,{'tableName':_0xa826('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f161e6d..fdad72c 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 _0x760b=['options','raw','where','attributes','limit','include','model','map','stringify','ShowZohoAccount','find','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0xd0a0c4,_0x4ebd2d){var _0x395963=function(_0x45d2d8){while(--_0x45d2d8){_0xd0a0c4['push'](_0xd0a0c4['shift']());}};_0x395963(++_0x4ebd2d);}(_0x760b,0x97));var _0xb760=function(_0x13eabb,_0x2ee286){_0x13eabb=_0x13eabb-0x0;var _0x10dea9=_0x760b[_0x13eabb];return _0x10dea9;};'use strict';var _=require(_0xb760('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb760('0x1'));var db=require(_0xb760('0x2'))['db'];var utils=require(_0xb760('0x3'));var logger=require(_0xb760('0x4'))(_0xb760('0x5'));var config=require(_0xb760('0x6'));var jayson=require(_0xb760('0x7'));var client=jayson[_0xb760('0x8')][_0xb760('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x180165,_0x544b01,_0x6f857c){return new BPromise(function(_0x2492e5,_0x5e1c46){return client[_0xb760('0xa')](_0x180165,_0x6f857c)[_0xb760('0xb')](function(_0x3d3a79){logger['info'](_0xb760('0xc'),_0x544b01,_0xb760('0xd'));logger[_0xb760('0xe')](_0xb760('0xf'),_0x544b01,'request\x20sent',JSON['stringify'](_0x3d3a79));if(_0x3d3a79[_0xb760('0x10')]){if(_0x3d3a79['error'][_0xb760('0x11')]===0x1f4){logger[_0xb760('0x10')](_0xb760('0xc'),_0x544b01,_0x3d3a79[_0xb760('0x10')][_0xb760('0x12')]);return _0x5e1c46(_0x3d3a79['error'][_0xb760('0x12')]);}logger[_0xb760('0x10')](_0xb760('0xc'),_0x544b01,_0x3d3a79['error'][_0xb760('0x12')]);return _0x2492e5(_0x3d3a79[_0xb760('0x10')][_0xb760('0x12')]);}else{logger[_0xb760('0x13')](_0xb760('0xc'),_0x544b01,'request\x20sent');_0x2492e5(_0x3d3a79['result']['message']);}})[_0xb760('0x14')](function(_0x3697e1){logger[_0xb760('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x544b01,_0x3697e1);_0x5e1c46(_0x3697e1);});});}exports[_0xb760('0x15')]=function(_0x217f01){var _0x52ef1e=this;return new Promise(function(_0x9c0bbe,_0x20ca5b){return db[_0xb760('0x16')][_0xb760('0x17')]({'raw':_0x217f01['options']?_0x217f01[_0xb760('0x18')][_0xb760('0x19')]===undefined?!![]:![]:!![],'where':_0x217f01[_0xb760('0x18')]?_0x217f01[_0xb760('0x18')][_0xb760('0x1a')]||null:null,'attributes':_0x217f01['options']?_0x217f01[_0xb760('0x18')][_0xb760('0x1b')]||null:null,'limit':_0x217f01[_0xb760('0x18')]?_0x217f01[_0xb760('0x18')][_0xb760('0x1c')]||null:null,'include':_0x217f01[_0xb760('0x18')]?_0x217f01[_0xb760('0x18')][_0xb760('0x1d')]?_['map'](_0x217f01[_0xb760('0x18')][_0xb760('0x1d')],function(_0x23b14f){return{'model':db[_0x23b14f[_0xb760('0x1e')]],'as':_0x23b14f['as'],'attributes':_0x23b14f[_0xb760('0x1b')],'include':_0x23b14f['include']?_[_0xb760('0x1f')](_0x23b14f[_0xb760('0x1d')],function(_0x44a4f5){return{'model':db[_0x44a4f5[_0xb760('0x1e')]],'as':_0x44a4f5['as'],'attributes':_0x44a4f5[_0xb760('0x1b')],'include':_0x44a4f5['include']?_[_0xb760('0x1f')](_0x44a4f5[_0xb760('0x1d')],function(_0x333aa0){return{'model':db[_0x333aa0[_0xb760('0x1e')]],'as':_0x333aa0['as'],'attributes':_0x333aa0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb760('0xb')](function(_0x1d1379){logger[_0xb760('0x13')]('GetZohoAccount',_0x217f01);logger[_0xb760('0xe')](_0xb760('0x15'),_0x217f01,JSON[_0xb760('0x20')](_0x1d1379));_0x9c0bbe(_0x1d1379);})[_0xb760('0x14')](function(_0x3beac4){logger[_0xb760('0x10')](_0xb760('0x15'),_0x3beac4[_0xb760('0x12')],_0x217f01);_0x20ca5b(_0x52ef1e[_0xb760('0x10')](0x1f4,_0x3beac4['message']));});});};exports[_0xb760('0x21')]=function(_0xf83e95){var _0x2308fc=this;return new Promise(function(_0x3fa154,_0x3f70e8){return db[_0xb760('0x16')][_0xb760('0x22')]({'raw':_0xf83e95['options']?_0xf83e95[_0xb760('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xf83e95[_0xb760('0x18')]?_0xf83e95['options'][_0xb760('0x1a')]||null:null,'attributes':_0xf83e95[_0xb760('0x18')]?_0xf83e95[_0xb760('0x18')]['attributes']||null:null,'include':_0xf83e95[_0xb760('0x18')]?_0xf83e95['options'][_0xb760('0x1d')]?_['map'](_0xf83e95['options'][_0xb760('0x1d')],function(_0x264337){return{'model':db[_0x264337[_0xb760('0x1e')]],'as':_0x264337['as'],'attributes':_0x264337[_0xb760('0x1b')],'include':_0x264337[_0xb760('0x1d')]?_[_0xb760('0x1f')](_0x264337['include'],function(_0x1eb6b7){return{'model':db[_0x1eb6b7[_0xb760('0x1e')]],'as':_0x1eb6b7['as'],'attributes':_0x1eb6b7[_0xb760('0x1b')],'include':_0x1eb6b7[_0xb760('0x1d')]?_[_0xb760('0x1f')](_0x1eb6b7[_0xb760('0x1d')],function(_0x16c9f8){return{'model':db[_0x16c9f8[_0xb760('0x1e')]],'as':_0x16c9f8['as'],'attributes':_0x16c9f8[_0xb760('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb760('0xb')](function(_0x40e8da){logger[_0xb760('0x13')](_0xb760('0x21'),_0xf83e95);logger['debug'](_0xb760('0x21'),_0xf83e95,JSON[_0xb760('0x20')](_0x40e8da));_0x3fa154(_0x40e8da);})['catch'](function(_0x4a8153){logger[_0xb760('0x10')]('ShowZohoAccount',_0x4a8153[_0xb760('0x12')],_0xf83e95);_0x3f70e8(_0x2308fc[_0xb760('0x10')](0x1f4,_0x4a8153[_0xb760('0x12')]));});});}; \ No newline at end of file +var _0x641b=['ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetZohoAccount','ZohoAccount','options','where','attributes','include','model','map','catch','ShowZohoAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x82a393,_0x2fb70e){var _0x2e1674=function(_0x25cbc2){while(--_0x25cbc2){_0x82a393['push'](_0x82a393['shift']());}};_0x2e1674(++_0x2fb70e);}(_0x641b,0xca));var _0xb641=function(_0x169024,_0x2d658c){_0x169024=_0x169024-0x0;var _0x3fc756=_0x641b[_0x169024];return _0x3fc756;};'use strict';var _=require(_0xb641('0x0'));var util=require('util');var moment=require(_0xb641('0x1'));var BPromise=require(_0xb641('0x2'));var rs=require(_0xb641('0x3'));var fs=require('fs');var Redis=require(_0xb641('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb641('0x5'));var logger=require(_0xb641('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb641('0x7'));var client=jayson[_0xb641('0x8')][_0xb641('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ca4ea,_0x104581,_0x1878e6){return new BPromise(function(_0x1b21f5,_0x185790){return client['request'](_0x1ca4ea,_0x1878e6)[_0xb641('0xa')](function(_0x2dbdba){logger[_0xb641('0xb')](_0xb641('0xc'),_0x104581,_0xb641('0xd'));logger[_0xb641('0xe')](_0xb641('0xf'),_0x104581,_0xb641('0xd'),JSON[_0xb641('0x10')](_0x2dbdba));if(_0x2dbdba['error']){if(_0x2dbdba['error'][_0xb641('0x11')]===0x1f4){logger[_0xb641('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x104581,_0x2dbdba[_0xb641('0x12')]['message']);return _0x185790(_0x2dbdba[_0xb641('0x12')][_0xb641('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x104581,_0x2dbdba['error'][_0xb641('0x13')]);return _0x1b21f5(_0x2dbdba[_0xb641('0x12')][_0xb641('0x13')]);}else{logger[_0xb641('0xb')](_0xb641('0xc'),_0x104581,'request\x20sent');_0x1b21f5(_0x2dbdba['result'][_0xb641('0x13')]);}})['catch'](function(_0x270a40){logger[_0xb641('0x12')](_0xb641('0xc'),_0x104581,_0x270a40);_0x185790(_0x270a40);});});}exports[_0xb641('0x14')]=function(_0x4a8c1c){var _0x538a8e=this;return new Promise(function(_0x329a55,_0x17e862){return db[_0xb641('0x15')]['findAll']({'raw':_0x4a8c1c[_0xb641('0x16')]?_0x4a8c1c['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a8c1c['options']?_0x4a8c1c[_0xb641('0x16')][_0xb641('0x17')]||null:null,'attributes':_0x4a8c1c[_0xb641('0x16')]?_0x4a8c1c['options'][_0xb641('0x18')]||null:null,'limit':_0x4a8c1c[_0xb641('0x16')]?_0x4a8c1c[_0xb641('0x16')]['limit']||null:null,'include':_0x4a8c1c[_0xb641('0x16')]?_0x4a8c1c[_0xb641('0x16')][_0xb641('0x19')]?_['map'](_0x4a8c1c[_0xb641('0x16')]['include'],function(_0x51b49b){return{'model':db[_0x51b49b[_0xb641('0x1a')]],'as':_0x51b49b['as'],'attributes':_0x51b49b[_0xb641('0x18')],'include':_0x51b49b[_0xb641('0x19')]?_[_0xb641('0x1b')](_0x51b49b[_0xb641('0x19')],function(_0x55c26f){return{'model':db[_0x55c26f['model']],'as':_0x55c26f['as'],'attributes':_0x55c26f[_0xb641('0x18')],'include':_0x55c26f[_0xb641('0x19')]?_[_0xb641('0x1b')](_0x55c26f[_0xb641('0x19')],function(_0x378169){return{'model':db[_0x378169[_0xb641('0x1a')]],'as':_0x378169['as'],'attributes':_0x378169[_0xb641('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb641('0xa')](function(_0x1999a2){logger[_0xb641('0xb')](_0xb641('0x14'),_0x4a8c1c);logger[_0xb641('0xe')](_0xb641('0x14'),_0x4a8c1c,JSON['stringify'](_0x1999a2));_0x329a55(_0x1999a2);})[_0xb641('0x1c')](function(_0x3abf50){logger[_0xb641('0x12')](_0xb641('0x14'),_0x3abf50[_0xb641('0x13')],_0x4a8c1c);_0x17e862(_0x538a8e[_0xb641('0x12')](0x1f4,_0x3abf50['message']));});});};exports[_0xb641('0x1d')]=function(_0x3991d5){var _0x1e1b21=this;return new Promise(function(_0x157ad1,_0x2fa23a){return db[_0xb641('0x15')][_0xb641('0x1e')]({'raw':_0x3991d5[_0xb641('0x16')]?_0x3991d5[_0xb641('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3991d5[_0xb641('0x16')]?_0x3991d5['options'][_0xb641('0x17')]||null:null,'attributes':_0x3991d5[_0xb641('0x16')]?_0x3991d5[_0xb641('0x16')][_0xb641('0x18')]||null:null,'include':_0x3991d5['options']?_0x3991d5[_0xb641('0x16')]['include']?_[_0xb641('0x1b')](_0x3991d5[_0xb641('0x16')][_0xb641('0x19')],function(_0x3512f7){return{'model':db[_0x3512f7[_0xb641('0x1a')]],'as':_0x3512f7['as'],'attributes':_0x3512f7['attributes'],'include':_0x3512f7[_0xb641('0x19')]?_[_0xb641('0x1b')](_0x3512f7[_0xb641('0x19')],function(_0x243818){return{'model':db[_0x243818['model']],'as':_0x243818['as'],'attributes':_0x243818[_0xb641('0x18')],'include':_0x243818[_0xb641('0x19')]?_[_0xb641('0x1b')](_0x243818[_0xb641('0x19')],function(_0xc5b562){return{'model':db[_0xc5b562[_0xb641('0x1a')]],'as':_0xc5b562['as'],'attributes':_0xc5b562[_0xb641('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb641('0xa')](function(_0xba8c2f){logger[_0xb641('0xb')](_0xb641('0x1d'),_0x3991d5);logger['debug'](_0xb641('0x1d'),_0x3991d5,JSON[_0xb641('0x10')](_0xba8c2f));_0x157ad1(_0xba8c2f);})[_0xb641('0x1c')](function(_0x55739d){logger[_0xb641('0x12')](_0xb641('0x1d'),_0x55739d[_0xb641('0x13')],_0x3991d5);_0x2fa23a(_0x1e1b21[_0xb641('0x12')](0x1f4,_0x55739d[_0xb641('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 6330cc1..0f850d3 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 _0xaeaf=['create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xaeaf,0x14e));var _0xfaea=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xaeaf[_0x1a89ca];return _0x29cbb2;};'use strict';var multer=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var path=require(_0xfaea('0x2'));var timeout=require(_0xfaea('0x3'));var express=require(_0xfaea('0x4'));var router=express[_0xfaea('0x5')]();var auth=require(_0xfaea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfaea('0x7'));var controller=require(_0xfaea('0x8'));router[_0xfaea('0x9')]('/',auth[_0xfaea('0xa')](),controller['index']);router[_0xfaea('0x9')](_0xfaea('0xb'),auth[_0xfaea('0xa')](),controller[_0xfaea('0xc')]);router[_0xfaea('0x9')]('/:id/fields',auth[_0xfaea('0xa')](),controller[_0xfaea('0xd')]);router['get'](_0xfaea('0xe'),auth[_0xfaea('0xa')](),controller[_0xfaea('0xf')]);router['get'](_0xfaea('0x10'),auth[_0xfaea('0xa')](),controller[_0xfaea('0x11')]);router['post']('/',auth[_0xfaea('0xa')](),controller[_0xfaea('0x12')]);router[_0xfaea('0x13')](_0xfaea('0xb'),auth[_0xfaea('0xa')](),controller['update']);router[_0xfaea('0x14')]('/:id',auth[_0xfaea('0xa')](),controller['destroy']);module[_0xfaea('0x15')]=router; \ No newline at end of file +var _0x66cf=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x66cf,0x1a2));var _0xf66c=function(_0x2c06d5,_0x3cdfbb){_0x2c06d5=_0x2c06d5-0x0;var _0x480dda=_0x66cf[_0x2c06d5];return _0x480dda;};'use strict';var multer=require(_0xf66c('0x0'));var util=require('util');var path=require(_0xf66c('0x1'));var timeout=require(_0xf66c('0x2'));var express=require('express');var router=express[_0xf66c('0x3')]();var auth=require(_0xf66c('0x4'));var interaction=require(_0xf66c('0x5'));var config=require(_0xf66c('0x6'));var controller=require(_0xf66c('0x7'));router[_0xf66c('0x8')]('/',auth[_0xf66c('0x9')](),controller['index']);router['get'](_0xf66c('0xa'),auth[_0xf66c('0x9')](),controller[_0xf66c('0xb')]);router['get']('/:id/fields',auth[_0xf66c('0x9')](),controller[_0xf66c('0xc')]);router['get'](_0xf66c('0xd'),auth[_0xf66c('0x9')](),controller[_0xf66c('0xe')]);router['get']('/:id/descriptions',auth[_0xf66c('0x9')](),controller[_0xf66c('0xf')]);router['post']('/',auth[_0xf66c('0x9')](),controller[_0xf66c('0x10')]);router[_0xf66c('0x11')](_0xf66c('0xa'),auth[_0xf66c('0x9')](),controller[_0xf66c('0x12')]);router[_0xf66c('0x13')](_0xf66c('0xa'),auth[_0xf66c('0x9')](),controller[_0xf66c('0x14')]);module[_0xf66c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 04e9554..7963dfc 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 _0x5e4a=['STRING','exports'];(function(_0x89d76b,_0x163667){var _0xe4588e=function(_0x99fd97){while(--_0x99fd97){_0x89d76b['push'](_0x89d76b['shift']());}};_0xe4588e(++_0x163667);}(_0x5e4a,0x139));var _0xa5e4=function(_0x8a4d73,_0x38f93c){_0x8a4d73=_0x8a4d73-0x0;var _0x356e64=_0x5e4a[_0x8a4d73];return _0x356e64;};'use strict';var Sequelize=require('sequelize');module[_0xa5e4('0x0')]={'name':{'type':Sequelize[_0xa5e4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2595=['STRING','sequelize'];(function(_0xc17cf8,_0x3d1a91){var _0x42fa3c=function(_0xef0825){while(--_0xef0825){_0xc17cf8['push'](_0xc17cf8['shift']());}};_0x42fa3c(++_0x3d1a91);}(_0x2595,0xa5));var _0x5259=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x2595[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require(_0x5259('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5259('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4d1f662..ec707b9 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 _0x7fbe=['send','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','include','find','create','body','params','getFields','map','hasOwnProperty','findOne','pick','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16bb1c,_0x58f468){_0x16bb1c=_0x16bb1c-0x0;var _0xace56c=_0x7fbe[_0x16bb1c];return _0xace56c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var hardwareService=require(_0xe7fb('0x13'));var logger=require(_0xe7fb('0x14'))(_0xe7fb('0x15'));var utils=require(_0xe7fb('0x16'));var config=require(_0xe7fb('0x17'));var db=require(_0xe7fb('0x18'))['db'];var jayson=require(_0xe7fb('0x19'));var client=jayson[_0xe7fb('0x1a')][_0xe7fb('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x188e1d,_0xdf9760,_0x45fe75){if(_0x45fe75){var _0x7fe4d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7fe4d3['test'](_0xdf9760)){return _0x188e1d;}else{throw new Error(_0xe7fb('0x1c'));}}else{return _0x188e1d;}}function respondWithRpcPromise(_0x2225e5,_0x5573ab,_0x30015a,_0x37eb9f){return new BPromise(function(_0x482f7d,_0xa76acf){var _0x559129=_0x37eb9f||client;return _0x559129[_0xe7fb('0x1d')](_0x2225e5,_0x30015a)[_0xe7fb('0x1e')](function(_0x12603d){logger[_0xe7fb('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x5573ab,_0xe7fb('0x20'));logger['debug'](_0xe7fb('0x21'),_0x5573ab,'request\x20sent',JSON[_0xe7fb('0x22')](_0x12603d));if(_0x12603d[_0xe7fb('0x23')]){if(_0x12603d[_0xe7fb('0x23')][_0xe7fb('0x24')]===0x1f4){logger['error'](_0xe7fb('0x25'),_0x5573ab,_0x12603d['error'][_0xe7fb('0x26')]);return _0xa76acf(_0x12603d['error'][_0xe7fb('0x26')]);}logger['error'](_0xe7fb('0x25'),_0x5573ab,_0x12603d[_0xe7fb('0x23')]['message']);return _0x482f7d(_0x12603d[_0xe7fb('0x23')][_0xe7fb('0x26')]);}else{logger[_0xe7fb('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x5573ab,_0xe7fb('0x20'));_0x482f7d(_0x12603d[_0xe7fb('0x27')]['message']);}})['catch'](function(_0x52f08b){logger[_0xe7fb('0x23')]('ZohoConfiguration,\x20%s,\x20%s',_0x5573ab,_0x52f08b);_0xa76acf(_0x52f08b);});});}function respondWithStatusCode(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0xcc;return function(_0x32e8b2){if(_0x32e8b2){return _0x49b219[_0xe7fb('0x28')](_0x4026b1);}return _0x49b219['status'](_0x4026b1)[_0xe7fb('0x29')]();};}function respondWithResult(_0x2b69c4,_0x390f32){_0x390f32=_0x390f32||0xc8;return function(_0x1ceed8){if(_0x1ceed8){return _0x2b69c4[_0xe7fb('0x2a')](_0x390f32)[_0xe7fb('0x2b')](_0x1ceed8);}};}function respondWithFilteredResult(_0x380130,_0x59e015){return function(_0x5df9f2){if(_0x5df9f2){var _0x1086e6=_0x5df9f2[_0xe7fb('0x2c')],_0x3bdee9=_0x59e015[_0xe7fb('0x2d')],_0xead63=_0x59e015[_0xe7fb('0x2d')]+_0x59e015[_0xe7fb('0x2e')],_0x4fd290;if(_0xead63>=_0x1086e6){_0xead63=_0x1086e6;_0x4fd290=0xc8;}else{_0x4fd290=0xce;}_0x380130[_0xe7fb('0x2a')](_0x4fd290);return _0x380130[_0xe7fb('0x2f')](_0xe7fb('0x30'),_0x3bdee9+'-'+_0xead63+'/'+_0x1086e6)[_0xe7fb('0x2b')](_0x5df9f2);}return null;};}function patchUpdates(_0x4ce993){return function(_0x3d1fb5){try{jsonpatch[_0xe7fb('0x31')](_0x3d1fb5,_0x4ce993,!![]);}catch(_0x29d1ca){return BPromise['reject'](_0x29d1ca);}return _0x3d1fb5['save']();};}function saveUpdates(_0xf5cd9a,_0x4a9fea){return function(_0xac56b4){if(_0xac56b4){return _0xac56b4[_0xe7fb('0x32')](_0xf5cd9a)[_0xe7fb('0x1e')](function(_0x2a4745){return _0x2a4745;});}return null;};}function removeEntity(_0x556368,_0x1af472){return function(_0x1d56d3){if(_0x1d56d3){return _0x1d56d3[_0xe7fb('0x33')]()[_0xe7fb('0x1e')](function(){_0x556368[_0xe7fb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x256694,_0x121d19){return function(_0x209eaa){if(!_0x209eaa){_0x256694[_0xe7fb('0x28')](0x194);}return _0x209eaa;};}function handleError(_0x46f430,_0x25e925){_0x25e925=_0x25e925||0x1f4;return function(_0x1bc72d){logger[_0xe7fb('0x23')](_0x1bc72d[_0xe7fb('0x34')]);if(_0x1bc72d['name']){delete _0x1bc72d[_0xe7fb('0x35')];}_0x46f430[_0xe7fb('0x2a')](_0x25e925)[_0xe7fb('0x36')](_0x1bc72d);};}exports['index']=function(_0x1de75a,_0x3502dc){var _0x4218bc={},_0x1530b1={},_0x402ca3={'count':0x0,'rows':[]};var _0x35b828=db[_0xe7fb('0x37')][_0xe7fb('0x38')];_0x1530b1[_0xe7fb('0x39')]=_[_0xe7fb('0x3a')](_0x35b828);_0x1530b1[_0xe7fb('0x3b')]=_[_0xe7fb('0x3a')](_0x1de75a[_0xe7fb('0x3b')]);_0x1530b1[_0xe7fb('0x3c')]=_[_0xe7fb('0x3d')](_0x1530b1[_0xe7fb('0x39')],_0x1530b1[_0xe7fb('0x3b')]);_0x4218bc[_0xe7fb('0x3e')]=_[_0xe7fb('0x3d')](_0x1530b1['model'],qs[_0xe7fb('0x3f')](_0x1de75a[_0xe7fb('0x3b')][_0xe7fb('0x3f')]));_0x4218bc[_0xe7fb('0x3e')]=_0x4218bc['attributes'][_0xe7fb('0x40')]?_0x4218bc[_0xe7fb('0x3e')]:_0x1530b1[_0xe7fb('0x39')];if(!_0x1de75a[_0xe7fb('0x3b')]['hasOwnProperty'](_0xe7fb('0x41'))){_0x4218bc[_0xe7fb('0x2e')]=qs[_0xe7fb('0x2e')](_0x1de75a[_0xe7fb('0x3b')][_0xe7fb('0x2e')]);_0x4218bc[_0xe7fb('0x2d')]=qs['offset'](_0x1de75a[_0xe7fb('0x3b')][_0xe7fb('0x2d')]);}_0x4218bc[_0xe7fb('0x42')]=qs['sort'](_0x1de75a[_0xe7fb('0x3b')][_0xe7fb('0x43')]);_0x4218bc['where']=qs['filters'](_['pick'](_0x1de75a['query'],_0x1530b1['filters']));if(_0x1de75a[_0xe7fb('0x3b')][_0xe7fb('0x44')]){_0x4218bc[_0xe7fb('0x45')]=_['merge'](_0x4218bc[_0xe7fb('0x45')],{'$or':_['map'](_0x35b828,function(_0x19277f){if(_0x19277f[_0xe7fb('0x46')]['key']!==_0xe7fb('0x47')){var _0x2a3422={};_0x2a3422[_0x19277f[_0xe7fb('0x48')]]={'$like':'%'+_0x1de75a[_0xe7fb('0x3b')]['filter']+'%'};return _0x2a3422;}})});}_0x4218bc=_[_0xe7fb('0x49')]({},_0x4218bc,_0x1de75a[_0xe7fb('0x4a')]);var _0x1b8a34={'where':_0x4218bc['where']};return db[_0xe7fb('0x37')][_0xe7fb('0x2c')](_0x1b8a34)[_0xe7fb('0x1e')](function(_0xd23540){_0x402ca3[_0xe7fb('0x2c')]=_0xd23540;if(_0x1de75a['query'][_0xe7fb('0x4b')]){_0x4218bc['include']=[{'all':!![]}];}return db[_0xe7fb('0x37')][_0xe7fb('0x4c')](_0x4218bc);})[_0xe7fb('0x1e')](function(_0x1ecbfd){_0x402ca3[_0xe7fb('0x4d')]=_0x1ecbfd;return _0x402ca3;})['then'](respondWithFilteredResult(_0x3502dc,_0x4218bc))[_0xe7fb('0x4e')](handleError(_0x3502dc,null));};exports['show']=function(_0x511759,_0x12c828){var _0x3d740f={'raw':![],'where':{'id':_0x511759['params']['id']}},_0x16327f={};_0x16327f[_0xe7fb('0x39')]=_[_0xe7fb('0x3a')](db['ZohoConfiguration']['rawAttributes']);_0x16327f[_0xe7fb('0x3b')]=_[_0xe7fb('0x3a')](_0x511759[_0xe7fb('0x3b')]);_0x16327f[_0xe7fb('0x3c')]=_[_0xe7fb('0x3d')](_0x16327f[_0xe7fb('0x39')],_0x16327f[_0xe7fb('0x3b')]);_0x3d740f[_0xe7fb('0x3e')]=_['intersection'](_0x16327f[_0xe7fb('0x39')],qs['fields'](_0x511759[_0xe7fb('0x3b')][_0xe7fb('0x3f')]));_0x3d740f['attributes']=_0x3d740f[_0xe7fb('0x3e')]['length']?_0x3d740f[_0xe7fb('0x3e')]:_0x16327f['model'];if(_0x511759[_0xe7fb('0x3b')]['includeAll']){_0x3d740f[_0xe7fb('0x4f')]=[{'all':!![]}];}_0x3d740f=_['merge']({},_0x3d740f,_0x511759[_0xe7fb('0x4a')]);return db[_0xe7fb('0x37')][_0xe7fb('0x50')](_0x3d740f)[_0xe7fb('0x1e')](handleEntityNotFound(_0x12c828,null))[_0xe7fb('0x1e')](respondWithResult(_0x12c828,null))[_0xe7fb('0x4e')](handleError(_0x12c828,null));};exports[_0xe7fb('0x51')]=function(_0x582a4a,_0x5d20dc){return db[_0xe7fb('0x37')]['create'](_0x582a4a['body'],{})['then'](respondWithResult(_0x5d20dc,0xc9))['catch'](handleError(_0x5d20dc,null));};exports['update']=function(_0x18773c,_0x34dd69){if(_0x18773c[_0xe7fb('0x52')]['id']){delete _0x18773c[_0xe7fb('0x52')]['id'];}return db['ZohoConfiguration'][_0xe7fb('0x50')]({'where':{'id':_0x18773c[_0xe7fb('0x53')]['id']}})[_0xe7fb('0x1e')](handleEntityNotFound(_0x34dd69,null))['then'](saveUpdates(_0x18773c['body'],null))[_0xe7fb('0x1e')](respondWithResult(_0x34dd69,null))[_0xe7fb('0x4e')](handleError(_0x34dd69,null));};exports[_0xe7fb('0x33')]=function(_0x4f4ba3,_0x27f860){return db[_0xe7fb('0x37')][_0xe7fb('0x50')]({'where':{'id':_0x4f4ba3[_0xe7fb('0x53')]['id']}})['then'](handleEntityNotFound(_0x27f860,null))['then'](removeEntity(_0x27f860,null))[_0xe7fb('0x4e')](handleError(_0x27f860,null));};exports[_0xe7fb('0x54')]=function(_0x1f16b2,_0x2f61b1,_0x3b0147){var _0x5dd7c8={};var _0x9c45a={};var _0x349a2a;var _0x23755b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1f16b2[_0xe7fb('0x53')]['id']}})[_0xe7fb('0x1e')](handleEntityNotFound(_0x2f61b1,null))[_0xe7fb('0x1e')](function(_0x1c4035){if(_0x1c4035){_0x349a2a=_0x1c4035;_0x9c45a[_0xe7fb('0x39')]=_[_0xe7fb('0x3a')](db['ZohoField'][_0xe7fb('0x38')]);_0x9c45a[_0xe7fb('0x3b')]=_[_0xe7fb('0x3a')](_0x1f16b2[_0xe7fb('0x3b')]);_0x9c45a[_0xe7fb('0x3c')]=_[_0xe7fb('0x3d')](_0x9c45a['model'],_0x9c45a[_0xe7fb('0x3b')]);_0x5dd7c8['attributes']=_[_0xe7fb('0x3d')](_0x9c45a[_0xe7fb('0x39')],qs[_0xe7fb('0x3f')](_0x1f16b2[_0xe7fb('0x3b')]['fields']));_0x5dd7c8['attributes']=_0x5dd7c8[_0xe7fb('0x3e')][_0xe7fb('0x40')]?_0x5dd7c8[_0xe7fb('0x3e')]:_0x9c45a[_0xe7fb('0x39')];_0x5dd7c8[_0xe7fb('0x42')]=qs['sort'](_0x1f16b2[_0xe7fb('0x3b')]['sort']);_0x5dd7c8[_0xe7fb('0x45')]=qs['filters'](_['pick'](_0x1f16b2[_0xe7fb('0x3b')],_0x9c45a[_0xe7fb('0x3c')]));if(_0x1f16b2[_0xe7fb('0x3b')]['filter']){_0x5dd7c8[_0xe7fb('0x45')]=_[_0xe7fb('0x49')](_0x5dd7c8[_0xe7fb('0x45')],{'$or':_[_0xe7fb('0x55')](_0x5dd7c8[_0xe7fb('0x3e')],function(_0x597ce8){var _0x404498={};_0x404498[_0x597ce8]={'$like':'%'+_0x1f16b2[_0xe7fb('0x3b')]['filter']+'%'};return _0x404498;})});}_0x5dd7c8=_[_0xe7fb('0x49')]({},_0x5dd7c8,_0x1f16b2[_0xe7fb('0x4a')]);return _0x349a2a['getFields'](_0x5dd7c8);}})[_0xe7fb('0x1e')](function(_0x4c04e1){if(_0x4c04e1){_0x23755b=_0x4c04e1[_0xe7fb('0x40')];if(!_0x1f16b2[_0xe7fb('0x3b')][_0xe7fb('0x56')]('nolimit')){_0x5dd7c8[_0xe7fb('0x2e')]=qs[_0xe7fb('0x2e')](_0x1f16b2[_0xe7fb('0x3b')][_0xe7fb('0x2e')]);_0x5dd7c8[_0xe7fb('0x2d')]=qs[_0xe7fb('0x2d')](_0x1f16b2[_0xe7fb('0x3b')][_0xe7fb('0x2d')]);}return _0x349a2a['getFields'](_0x5dd7c8);}})['then'](function(_0x3ebbd8){if(_0x3ebbd8){return _0x3ebbd8?{'count':_0x23755b,'rows':_0x3ebbd8}:null;}})[_0xe7fb('0x1e')](respondWithResult(_0x2f61b1,null))[_0xe7fb('0x4e')](handleError(_0x2f61b1,null));};exports['getSubjects']=function(_0x519c5f,_0x1ac1fd,_0x2b071c){var _0xad7c53={};var _0x1df857={};var _0x2d558c;var _0x336fd3;return db[_0xe7fb('0x37')][_0xe7fb('0x57')]({'where':{'id':_0x519c5f[_0xe7fb('0x53')]['id']}})[_0xe7fb('0x1e')](handleEntityNotFound(_0x1ac1fd,null))[_0xe7fb('0x1e')](function(_0xf423ab){if(_0xf423ab){_0x2d558c=_0xf423ab;_0x1df857[_0xe7fb('0x39')]=_['keys'](db['ZohoField'][_0xe7fb('0x38')]);_0x1df857[_0xe7fb('0x3b')]=_[_0xe7fb('0x3a')](_0x519c5f[_0xe7fb('0x3b')]);_0x1df857[_0xe7fb('0x3c')]=_['intersection'](_0x1df857[_0xe7fb('0x39')],_0x1df857[_0xe7fb('0x3b')]);_0xad7c53[_0xe7fb('0x3e')]=_[_0xe7fb('0x3d')](_0x1df857[_0xe7fb('0x39')],qs[_0xe7fb('0x3f')](_0x519c5f[_0xe7fb('0x3b')][_0xe7fb('0x3f')]));_0xad7c53[_0xe7fb('0x3e')]=_0xad7c53['attributes'][_0xe7fb('0x40')]?_0xad7c53['attributes']:_0x1df857[_0xe7fb('0x39')];_0xad7c53[_0xe7fb('0x42')]=qs[_0xe7fb('0x43')](_0x519c5f[_0xe7fb('0x3b')][_0xe7fb('0x43')]);_0xad7c53['where']=qs[_0xe7fb('0x3c')](_[_0xe7fb('0x58')](_0x519c5f[_0xe7fb('0x3b')],_0x1df857[_0xe7fb('0x3c')]));if(_0x519c5f[_0xe7fb('0x3b')][_0xe7fb('0x44')]){_0xad7c53[_0xe7fb('0x45')]=_[_0xe7fb('0x49')](_0xad7c53[_0xe7fb('0x45')],{'$or':_[_0xe7fb('0x55')](_0xad7c53[_0xe7fb('0x3e')],function(_0x14b028){var _0x3a68c0={};_0x3a68c0[_0x14b028]={'$like':'%'+_0x519c5f[_0xe7fb('0x3b')]['filter']+'%'};return _0x3a68c0;})});}_0xad7c53=_['merge']({},_0xad7c53,_0x519c5f['options']);return _0x2d558c[_0xe7fb('0x59')](_0xad7c53);}})[_0xe7fb('0x1e')](function(_0x25e4d9){if(_0x25e4d9){_0x336fd3=_0x25e4d9[_0xe7fb('0x40')];if(!_0x519c5f['query'][_0xe7fb('0x56')](_0xe7fb('0x41'))){_0xad7c53[_0xe7fb('0x2e')]=qs[_0xe7fb('0x2e')](_0x519c5f['query'][_0xe7fb('0x2e')]);_0xad7c53['offset']=qs[_0xe7fb('0x2d')](_0x519c5f[_0xe7fb('0x3b')][_0xe7fb('0x2d')]);}return _0x2d558c[_0xe7fb('0x59')](_0xad7c53);}})[_0xe7fb('0x1e')](function(_0x4ab541){if(_0x4ab541){return _0x4ab541?{'count':_0x336fd3,'rows':_0x4ab541}:null;}})[_0xe7fb('0x1e')](respondWithResult(_0x1ac1fd,null))['catch'](handleError(_0x1ac1fd,null));};exports[_0xe7fb('0x5a')]=function(_0x5410a1,_0x2aeeed,_0x38f52c){var _0x4c37cd={};var _0x2b6d69={};var _0x31642f;var _0xb19e94;return db[_0xe7fb('0x37')]['findOne']({'where':{'id':_0x5410a1[_0xe7fb('0x53')]['id']}})[_0xe7fb('0x1e')](handleEntityNotFound(_0x2aeeed,null))[_0xe7fb('0x1e')](function(_0x4d0eed){if(_0x4d0eed){_0x31642f=_0x4d0eed;_0x2b6d69[_0xe7fb('0x39')]=_['keys'](db['ZohoField']['rawAttributes']);_0x2b6d69[_0xe7fb('0x3b')]=_[_0xe7fb('0x3a')](_0x5410a1['query']);_0x2b6d69[_0xe7fb('0x3c')]=_[_0xe7fb('0x3d')](_0x2b6d69[_0xe7fb('0x39')],_0x2b6d69[_0xe7fb('0x3b')]);_0x4c37cd[_0xe7fb('0x3e')]=_[_0xe7fb('0x3d')](_0x2b6d69[_0xe7fb('0x39')],qs[_0xe7fb('0x3f')](_0x5410a1[_0xe7fb('0x3b')][_0xe7fb('0x3f')]));_0x4c37cd[_0xe7fb('0x3e')]=_0x4c37cd[_0xe7fb('0x3e')][_0xe7fb('0x40')]?_0x4c37cd[_0xe7fb('0x3e')]:_0x2b6d69[_0xe7fb('0x39')];_0x4c37cd[_0xe7fb('0x42')]=qs[_0xe7fb('0x43')](_0x5410a1[_0xe7fb('0x3b')][_0xe7fb('0x43')]);_0x4c37cd[_0xe7fb('0x45')]=qs['filters'](_[_0xe7fb('0x58')](_0x5410a1[_0xe7fb('0x3b')],_0x2b6d69[_0xe7fb('0x3c')]));if(_0x5410a1[_0xe7fb('0x3b')][_0xe7fb('0x44')]){_0x4c37cd[_0xe7fb('0x45')]=_[_0xe7fb('0x49')](_0x4c37cd['where'],{'$or':_['map'](_0x4c37cd[_0xe7fb('0x3e')],function(_0x4e1865){var _0x2f486={};_0x2f486[_0x4e1865]={'$like':'%'+_0x5410a1[_0xe7fb('0x3b')]['filter']+'%'};return _0x2f486;})});}_0x4c37cd=_[_0xe7fb('0x49')]({},_0x4c37cd,_0x5410a1[_0xe7fb('0x4a')]);return _0x31642f[_0xe7fb('0x5a')](_0x4c37cd);}})[_0xe7fb('0x1e')](function(_0x1f5687){if(_0x1f5687){_0xb19e94=_0x1f5687[_0xe7fb('0x40')];if(!_0x5410a1['query'][_0xe7fb('0x56')](_0xe7fb('0x41'))){_0x4c37cd[_0xe7fb('0x2e')]=qs[_0xe7fb('0x2e')](_0x5410a1[_0xe7fb('0x3b')][_0xe7fb('0x2e')]);_0x4c37cd['offset']=qs['offset'](_0x5410a1['query'][_0xe7fb('0x2d')]);}return _0x31642f[_0xe7fb('0x5a')](_0x4c37cd);}})[_0xe7fb('0x1e')](function(_0x499498){if(_0x499498){return _0x499498?{'count':_0xb19e94,'rows':_0x499498}:null;}})[_0xe7fb('0x1e')](respondWithResult(_0x2aeeed,null))['catch'](handleError(_0x2aeeed,null));}; \ No newline at end of file +var _0x3e74=['save','update','then','destroy','sendStatus','ZohoConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','options','count','include','findAll','rows','show','includeAll','find','create','body','params','findOne','pick','getFields','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x56f281,_0x4d9b28){var _0x5e835a=function(_0x27092a){while(--_0x27092a){_0x56f281['push'](_0x56f281['shift']());}};_0x5e835a(++_0x4d9b28);}(_0x3e74,0x175));var _0x43e7=function(_0x414fb9,_0x415dd9){_0x414fb9=_0x414fb9-0x0;var _0x4d5880=_0x3e74[_0x414fb9];return _0x4d5880;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var hardwareService=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x43e7('0x14')][_0x43e7('0x15')]({'port':0x232a});function checkPasswordPattern(_0x2718d3,_0x3bb83f,_0x4e008c){if(_0x4e008c){var _0x583d85=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x583d85[_0x43e7('0x16')](_0x3bb83f)){return _0x2718d3;}else{throw new Error(_0x43e7('0x17'));}}else{return _0x2718d3;}}function respondWithRpcPromise(_0x44b0bd,_0x51b974,_0x5e641c,_0x16849c){return new BPromise(function(_0x14c146,_0x203378){var _0x328445=_0x16849c||client;return _0x328445['request'](_0x44b0bd,_0x5e641c)['then'](function(_0xdf16c){logger[_0x43e7('0x18')](_0x43e7('0x19'),_0x51b974,'request\x20sent');logger['debug'](_0x43e7('0x1a'),_0x51b974,_0x43e7('0x1b'),JSON[_0x43e7('0x1c')](_0xdf16c));if(_0xdf16c[_0x43e7('0x1d')]){if(_0xdf16c[_0x43e7('0x1d')][_0x43e7('0x1e')]===0x1f4){logger[_0x43e7('0x1d')](_0x43e7('0x19'),_0x51b974,_0xdf16c[_0x43e7('0x1d')][_0x43e7('0x1f')]);return _0x203378(_0xdf16c[_0x43e7('0x1d')][_0x43e7('0x1f')]);}logger['error'](_0x43e7('0x19'),_0x51b974,_0xdf16c[_0x43e7('0x1d')]['message']);return _0x14c146(_0xdf16c[_0x43e7('0x1d')][_0x43e7('0x1f')]);}else{logger[_0x43e7('0x18')](_0x43e7('0x19'),_0x51b974,_0x43e7('0x1b'));_0x14c146(_0xdf16c[_0x43e7('0x20')]['message']);}})[_0x43e7('0x21')](function(_0x4eea52){logger['error'](_0x43e7('0x19'),_0x51b974,_0x4eea52);_0x203378(_0x4eea52);});});}function respondWithStatusCode(_0x43f4ff,_0x4b2b9f){_0x4b2b9f=_0x4b2b9f||0xcc;return function(_0x1f0673){if(_0x1f0673){return _0x43f4ff['sendStatus'](_0x4b2b9f);}return _0x43f4ff[_0x43e7('0x22')](_0x4b2b9f)['end']();};}function respondWithResult(_0x1af208,_0x1b5f50){_0x1b5f50=_0x1b5f50||0xc8;return function(_0x20888b){if(_0x20888b){return _0x1af208[_0x43e7('0x22')](_0x1b5f50)['json'](_0x20888b);}};}function respondWithFilteredResult(_0x52b7b3,_0x805b54){return function(_0x501551){if(_0x501551){var _0x2dd5f=_0x501551['count'],_0x40dc8f=_0x805b54[_0x43e7('0x23')],_0x3565cf=_0x805b54[_0x43e7('0x23')]+_0x805b54[_0x43e7('0x24')],_0xb1fc63;if(_0x3565cf>=_0x2dd5f){_0x3565cf=_0x2dd5f;_0xb1fc63=0xc8;}else{_0xb1fc63=0xce;}_0x52b7b3[_0x43e7('0x22')](_0xb1fc63);return _0x52b7b3[_0x43e7('0x25')](_0x43e7('0x26'),_0x40dc8f+'-'+_0x3565cf+'/'+_0x2dd5f)[_0x43e7('0x27')](_0x501551);}return null;};}function patchUpdates(_0x31b2a6){return function(_0x3bf475){try{jsonpatch[_0x43e7('0x28')](_0x3bf475,_0x31b2a6,!![]);}catch(_0x17df44){return BPromise[_0x43e7('0x29')](_0x17df44);}return _0x3bf475[_0x43e7('0x2a')]();};}function saveUpdates(_0x208706,_0x4bdb17){return function(_0x238321){if(_0x238321){return _0x238321[_0x43e7('0x2b')](_0x208706)[_0x43e7('0x2c')](function(_0x183c81){return _0x183c81;});}return null;};}function removeEntity(_0x4251c8,_0x4c8650){return function(_0x1eba65){if(_0x1eba65){return _0x1eba65[_0x43e7('0x2d')]()[_0x43e7('0x2c')](function(){_0x4251c8[_0x43e7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7342,_0x5e203f){return function(_0xf8320){if(!_0xf8320){_0x5a7342[_0x43e7('0x2e')](0x194);}return _0xf8320;};}function handleError(_0x117c07,_0x234fe6){_0x234fe6=_0x234fe6||0x1f4;return function(_0x108313){logger[_0x43e7('0x1d')](_0x108313['stack']);if(_0x108313['name']){delete _0x108313['name'];}_0x117c07['status'](_0x234fe6)['send'](_0x108313);};}exports['index']=function(_0x5cb753,_0x14d888){var _0x49cda6={},_0x2b4bfd={},_0x8e9f40={'count':0x0,'rows':[]};var _0x31bc78=db[_0x43e7('0x2f')][_0x43e7('0x30')];_0x2b4bfd[_0x43e7('0x31')]=_[_0x43e7('0x32')](_0x31bc78);_0x2b4bfd['query']=_['keys'](_0x5cb753['query']);_0x2b4bfd[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x2b4bfd[_0x43e7('0x31')],_0x2b4bfd[_0x43e7('0x35')]);_0x49cda6[_0x43e7('0x36')]=_[_0x43e7('0x34')](_0x2b4bfd[_0x43e7('0x31')],qs[_0x43e7('0x37')](_0x5cb753['query'][_0x43e7('0x37')]));_0x49cda6[_0x43e7('0x36')]=_0x49cda6['attributes'][_0x43e7('0x38')]?_0x49cda6['attributes']:_0x2b4bfd[_0x43e7('0x31')];if(!_0x5cb753[_0x43e7('0x35')][_0x43e7('0x39')](_0x43e7('0x3a'))){_0x49cda6[_0x43e7('0x24')]=qs[_0x43e7('0x24')](_0x5cb753['query']['limit']);_0x49cda6[_0x43e7('0x23')]=qs[_0x43e7('0x23')](_0x5cb753[_0x43e7('0x35')][_0x43e7('0x23')]);}_0x49cda6[_0x43e7('0x3b')]=qs['sort'](_0x5cb753[_0x43e7('0x35')][_0x43e7('0x3c')]);_0x49cda6['where']=qs[_0x43e7('0x33')](_['pick'](_0x5cb753[_0x43e7('0x35')],_0x2b4bfd['filters']));if(_0x5cb753[_0x43e7('0x35')][_0x43e7('0x3d')]){_0x49cda6[_0x43e7('0x3e')]=_[_0x43e7('0x3f')](_0x49cda6['where'],{'$or':_['map'](_0x31bc78,function(_0x103393){if(_0x103393[_0x43e7('0x40')][_0x43e7('0x41')]!==_0x43e7('0x42')){var _0x56346a={};_0x56346a[_0x103393['field']]={'$like':'%'+_0x5cb753['query'][_0x43e7('0x3d')]+'%'};return _0x56346a;}})});}_0x49cda6=_['merge']({},_0x49cda6,_0x5cb753[_0x43e7('0x43')]);var _0x4b3a59={'where':_0x49cda6['where']};return db[_0x43e7('0x2f')]['count'](_0x4b3a59)[_0x43e7('0x2c')](function(_0x39db7f){_0x8e9f40[_0x43e7('0x44')]=_0x39db7f;if(_0x5cb753[_0x43e7('0x35')]['includeAll']){_0x49cda6[_0x43e7('0x45')]=[{'all':!![]}];}return db[_0x43e7('0x2f')][_0x43e7('0x46')](_0x49cda6);})[_0x43e7('0x2c')](function(_0x296dc8){_0x8e9f40[_0x43e7('0x47')]=_0x296dc8;return _0x8e9f40;})['then'](respondWithFilteredResult(_0x14d888,_0x49cda6))['catch'](handleError(_0x14d888,null));};exports[_0x43e7('0x48')]=function(_0x36a09e,_0x212841){var _0x4c00a8={'raw':![],'where':{'id':_0x36a09e['params']['id']}},_0x5c1c18={};_0x5c1c18[_0x43e7('0x31')]=_[_0x43e7('0x32')](db['ZohoConfiguration'][_0x43e7('0x30')]);_0x5c1c18[_0x43e7('0x35')]=_[_0x43e7('0x32')](_0x36a09e['query']);_0x5c1c18['filters']=_['intersection'](_0x5c1c18['model'],_0x5c1c18[_0x43e7('0x35')]);_0x4c00a8[_0x43e7('0x36')]=_['intersection'](_0x5c1c18[_0x43e7('0x31')],qs[_0x43e7('0x37')](_0x36a09e[_0x43e7('0x35')][_0x43e7('0x37')]));_0x4c00a8['attributes']=_0x4c00a8[_0x43e7('0x36')]['length']?_0x4c00a8['attributes']:_0x5c1c18[_0x43e7('0x31')];if(_0x36a09e[_0x43e7('0x35')][_0x43e7('0x49')]){_0x4c00a8[_0x43e7('0x45')]=[{'all':!![]}];}_0x4c00a8=_[_0x43e7('0x3f')]({},_0x4c00a8,_0x36a09e[_0x43e7('0x43')]);return db[_0x43e7('0x2f')][_0x43e7('0x4a')](_0x4c00a8)[_0x43e7('0x2c')](handleEntityNotFound(_0x212841,null))[_0x43e7('0x2c')](respondWithResult(_0x212841,null))['catch'](handleError(_0x212841,null));};exports[_0x43e7('0x4b')]=function(_0x46c910,_0x499c03){return db[_0x43e7('0x2f')]['create'](_0x46c910[_0x43e7('0x4c')],{})[_0x43e7('0x2c')](respondWithResult(_0x499c03,0xc9))[_0x43e7('0x21')](handleError(_0x499c03,null));};exports[_0x43e7('0x2b')]=function(_0xfe13fa,_0x5e5556){if(_0xfe13fa['body']['id']){delete _0xfe13fa[_0x43e7('0x4c')]['id'];}return db[_0x43e7('0x2f')][_0x43e7('0x4a')]({'where':{'id':_0xfe13fa[_0x43e7('0x4d')]['id']}})[_0x43e7('0x2c')](handleEntityNotFound(_0x5e5556,null))[_0x43e7('0x2c')](saveUpdates(_0xfe13fa[_0x43e7('0x4c')],null))[_0x43e7('0x2c')](respondWithResult(_0x5e5556,null))[_0x43e7('0x21')](handleError(_0x5e5556,null));};exports[_0x43e7('0x2d')]=function(_0x312306,_0x4ace49){return db[_0x43e7('0x2f')][_0x43e7('0x4a')]({'where':{'id':_0x312306['params']['id']}})[_0x43e7('0x2c')](handleEntityNotFound(_0x4ace49,null))[_0x43e7('0x2c')](removeEntity(_0x4ace49,null))[_0x43e7('0x21')](handleError(_0x4ace49,null));};exports['getFields']=function(_0x5d63c6,_0x459c13,_0x3d9a29){var _0x4ebdde={};var _0x283dd8={};var _0x54506d;var _0x49a6ce;return db[_0x43e7('0x2f')][_0x43e7('0x4e')]({'where':{'id':_0x5d63c6[_0x43e7('0x4d')]['id']}})[_0x43e7('0x2c')](handleEntityNotFound(_0x459c13,null))[_0x43e7('0x2c')](function(_0x4dfdb0){if(_0x4dfdb0){_0x54506d=_0x4dfdb0;_0x283dd8[_0x43e7('0x31')]=_[_0x43e7('0x32')](db['ZohoField'][_0x43e7('0x30')]);_0x283dd8[_0x43e7('0x35')]=_[_0x43e7('0x32')](_0x5d63c6['query']);_0x283dd8['filters']=_['intersection'](_0x283dd8[_0x43e7('0x31')],_0x283dd8[_0x43e7('0x35')]);_0x4ebdde[_0x43e7('0x36')]=_[_0x43e7('0x34')](_0x283dd8['model'],qs['fields'](_0x5d63c6[_0x43e7('0x35')][_0x43e7('0x37')]));_0x4ebdde[_0x43e7('0x36')]=_0x4ebdde[_0x43e7('0x36')]['length']?_0x4ebdde[_0x43e7('0x36')]:_0x283dd8[_0x43e7('0x31')];_0x4ebdde[_0x43e7('0x3b')]=qs[_0x43e7('0x3c')](_0x5d63c6[_0x43e7('0x35')][_0x43e7('0x3c')]);_0x4ebdde[_0x43e7('0x3e')]=qs[_0x43e7('0x33')](_[_0x43e7('0x4f')](_0x5d63c6[_0x43e7('0x35')],_0x283dd8[_0x43e7('0x33')]));if(_0x5d63c6['query']['filter']){_0x4ebdde[_0x43e7('0x3e')]=_['merge'](_0x4ebdde['where'],{'$or':_['map'](_0x4ebdde[_0x43e7('0x36')],function(_0xe666b0){var _0x5d7b37={};_0x5d7b37[_0xe666b0]={'$like':'%'+_0x5d63c6[_0x43e7('0x35')][_0x43e7('0x3d')]+'%'};return _0x5d7b37;})});}_0x4ebdde=_[_0x43e7('0x3f')]({},_0x4ebdde,_0x5d63c6['options']);return _0x54506d[_0x43e7('0x50')](_0x4ebdde);}})[_0x43e7('0x2c')](function(_0x289f86){if(_0x289f86){_0x49a6ce=_0x289f86[_0x43e7('0x38')];if(!_0x5d63c6[_0x43e7('0x35')][_0x43e7('0x39')](_0x43e7('0x3a'))){_0x4ebdde['limit']=qs[_0x43e7('0x24')](_0x5d63c6[_0x43e7('0x35')][_0x43e7('0x24')]);_0x4ebdde['offset']=qs['offset'](_0x5d63c6[_0x43e7('0x35')]['offset']);}return _0x54506d['getFields'](_0x4ebdde);}})[_0x43e7('0x2c')](function(_0x154e47){if(_0x154e47){return _0x154e47?{'count':_0x49a6ce,'rows':_0x154e47}:null;}})['then'](respondWithResult(_0x459c13,null))[_0x43e7('0x21')](handleError(_0x459c13,null));};exports[_0x43e7('0x51')]=function(_0x1e2fed,_0x3401ec,_0x16499c){var _0x13ef5c={};var _0x398a78={};var _0x4ce33c;var _0x10cf5d;return db[_0x43e7('0x2f')]['findOne']({'where':{'id':_0x1e2fed[_0x43e7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3401ec,null))[_0x43e7('0x2c')](function(_0x248936){if(_0x248936){_0x4ce33c=_0x248936;_0x398a78[_0x43e7('0x31')]=_[_0x43e7('0x32')](db['ZohoField'][_0x43e7('0x30')]);_0x398a78[_0x43e7('0x35')]=_[_0x43e7('0x32')](_0x1e2fed['query']);_0x398a78[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x398a78[_0x43e7('0x31')],_0x398a78[_0x43e7('0x35')]);_0x13ef5c[_0x43e7('0x36')]=_['intersection'](_0x398a78[_0x43e7('0x31')],qs[_0x43e7('0x37')](_0x1e2fed[_0x43e7('0x35')][_0x43e7('0x37')]));_0x13ef5c[_0x43e7('0x36')]=_0x13ef5c[_0x43e7('0x36')][_0x43e7('0x38')]?_0x13ef5c['attributes']:_0x398a78['model'];_0x13ef5c[_0x43e7('0x3b')]=qs['sort'](_0x1e2fed['query']['sort']);_0x13ef5c[_0x43e7('0x3e')]=qs[_0x43e7('0x33')](_[_0x43e7('0x4f')](_0x1e2fed[_0x43e7('0x35')],_0x398a78[_0x43e7('0x33')]));if(_0x1e2fed[_0x43e7('0x35')]['filter']){_0x13ef5c[_0x43e7('0x3e')]=_[_0x43e7('0x3f')](_0x13ef5c[_0x43e7('0x3e')],{'$or':_['map'](_0x13ef5c[_0x43e7('0x36')],function(_0xea84ec){var _0x184ae3={};_0x184ae3[_0xea84ec]={'$like':'%'+_0x1e2fed[_0x43e7('0x35')][_0x43e7('0x3d')]+'%'};return _0x184ae3;})});}_0x13ef5c=_[_0x43e7('0x3f')]({},_0x13ef5c,_0x1e2fed[_0x43e7('0x43')]);return _0x4ce33c[_0x43e7('0x51')](_0x13ef5c);}})['then'](function(_0x52c757){if(_0x52c757){_0x10cf5d=_0x52c757['length'];if(!_0x1e2fed[_0x43e7('0x35')][_0x43e7('0x39')]('nolimit')){_0x13ef5c[_0x43e7('0x24')]=qs[_0x43e7('0x24')](_0x1e2fed[_0x43e7('0x35')][_0x43e7('0x24')]);_0x13ef5c['offset']=qs['offset'](_0x1e2fed['query'][_0x43e7('0x23')]);}return _0x4ce33c[_0x43e7('0x51')](_0x13ef5c);}})['then'](function(_0x58cbb7){if(_0x58cbb7){return _0x58cbb7?{'count':_0x10cf5d,'rows':_0x58cbb7}:null;}})[_0x43e7('0x2c')](respondWithResult(_0x3401ec,null))[_0x43e7('0x21')](handleError(_0x3401ec,null));};exports[_0x43e7('0x52')]=function(_0x4ae26f,_0x80334,_0x3d750f){var _0x401654={};var _0xb04082={};var _0x48f1dc;var _0x1d7048;return db['ZohoConfiguration'][_0x43e7('0x4e')]({'where':{'id':_0x4ae26f[_0x43e7('0x4d')]['id']}})[_0x43e7('0x2c')](handleEntityNotFound(_0x80334,null))[_0x43e7('0x2c')](function(_0xa7cb2c){if(_0xa7cb2c){_0x48f1dc=_0xa7cb2c;_0xb04082[_0x43e7('0x31')]=_[_0x43e7('0x32')](db['ZohoField'][_0x43e7('0x30')]);_0xb04082[_0x43e7('0x35')]=_[_0x43e7('0x32')](_0x4ae26f[_0x43e7('0x35')]);_0xb04082['filters']=_['intersection'](_0xb04082['model'],_0xb04082[_0x43e7('0x35')]);_0x401654['attributes']=_[_0x43e7('0x34')](_0xb04082[_0x43e7('0x31')],qs[_0x43e7('0x37')](_0x4ae26f[_0x43e7('0x35')][_0x43e7('0x37')]));_0x401654[_0x43e7('0x36')]=_0x401654[_0x43e7('0x36')][_0x43e7('0x38')]?_0x401654[_0x43e7('0x36')]:_0xb04082[_0x43e7('0x31')];_0x401654[_0x43e7('0x3b')]=qs['sort'](_0x4ae26f[_0x43e7('0x35')][_0x43e7('0x3c')]);_0x401654[_0x43e7('0x3e')]=qs[_0x43e7('0x33')](_[_0x43e7('0x4f')](_0x4ae26f['query'],_0xb04082['filters']));if(_0x4ae26f[_0x43e7('0x35')][_0x43e7('0x3d')]){_0x401654['where']=_[_0x43e7('0x3f')](_0x401654[_0x43e7('0x3e')],{'$or':_['map'](_0x401654['attributes'],function(_0x1e869a){var _0x3667a4={};_0x3667a4[_0x1e869a]={'$like':'%'+_0x4ae26f[_0x43e7('0x35')][_0x43e7('0x3d')]+'%'};return _0x3667a4;})});}_0x401654=_[_0x43e7('0x3f')]({},_0x401654,_0x4ae26f['options']);return _0x48f1dc['getDescriptions'](_0x401654);}})[_0x43e7('0x2c')](function(_0x18c438){if(_0x18c438){_0x1d7048=_0x18c438[_0x43e7('0x38')];if(!_0x4ae26f[_0x43e7('0x35')]['hasOwnProperty'](_0x43e7('0x3a'))){_0x401654[_0x43e7('0x24')]=qs[_0x43e7('0x24')](_0x4ae26f[_0x43e7('0x35')]['limit']);_0x401654[_0x43e7('0x23')]=qs[_0x43e7('0x23')](_0x4ae26f[_0x43e7('0x35')][_0x43e7('0x23')]);}return _0x48f1dc[_0x43e7('0x52')](_0x401654);}})['then'](function(_0x36d61f){if(_0x36d61f){return _0x36d61f?{'count':_0x1d7048,'rows':_0x36d61f}:null;}})[_0x43e7('0x2c')](respondWithResult(_0x80334,null))['catch'](handleError(_0x80334,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 79445fb..8f25b17 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 _0x757a=['define','int_zoho_configurations','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x757a,0xde));var _0xa757=function(_0x30f37a,_0x7f1fc0){_0x30f37a=_0x30f37a-0x0;var _0x2e0453=_0x757a[_0x30f37a];return _0x2e0453;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ZohoConfiguration',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x593e=['path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a5fe3,_0x4fe519){var _0x582603=function(_0x3bc462){while(--_0x3bc462){_0x3a5fe3['push'](_0x3a5fe3['shift']());}};_0x582603(++_0x4fe519);}(_0x593e,0xcb));var _0xe593=function(_0x586e9b,_0x1647c9){_0x586e9b=_0x586e9b-0x0;var _0x39a12b=_0x593e[_0x586e9b];return _0x39a12b;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));module[_0xe593('0xa')]=function(_0x1e50d3,_0x3b7082){return _0x1e50d3[_0xe593('0xb')](_0xe593('0xc'),attributes,{'tableName':_0xe593('0xd'),'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 2a6e09e..822bc08 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 _0xa2f3=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x179e37,_0x3e304d){var _0x39033b=function(_0x536982){while(--_0x536982){_0x179e37['push'](_0x179e37['shift']());}};_0x39033b(++_0x3e304d);}(_0xa2f3,0x1b8));var _0x3a2f=function(_0x1dacbf,_0x3e12d6){_0x1dacbf=_0x1dacbf-0x0;var _0x29baab=_0xa2f3[_0x1dacbf];return _0x29baab;};'use strict';var _=require(_0x3a2f('0x0'));var util=require(_0x3a2f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a2f('0x2'));var fs=require('fs');var Redis=require(_0x3a2f('0x3'));var db=require(_0x3a2f('0x4'))['db'];var utils=require(_0x3a2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a2f('0x6'));var jayson=require(_0x3a2f('0x7'));var client=jayson[_0x3a2f('0x8')][_0x3a2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f4843,_0x122fd,_0x565133){return new BPromise(function(_0x3dcb72,_0xc76a45){return client[_0x3a2f('0xa')](_0x5f4843,_0x565133)[_0x3a2f('0xb')](function(_0x3fdd81){logger[_0x3a2f('0xc')](_0x3a2f('0xd'),_0x122fd,_0x3a2f('0xe'));logger[_0x3a2f('0xf')](_0x3a2f('0x10'),_0x122fd,_0x3a2f('0xe'),JSON[_0x3a2f('0x11')](_0x3fdd81));if(_0x3fdd81[_0x3a2f('0x12')]){if(_0x3fdd81[_0x3a2f('0x12')][_0x3a2f('0x13')]===0x1f4){logger['error'](_0x3a2f('0xd'),_0x122fd,_0x3fdd81['error']['message']);return _0xc76a45(_0x3fdd81[_0x3a2f('0x12')][_0x3a2f('0x14')]);}logger[_0x3a2f('0x12')](_0x3a2f('0xd'),_0x122fd,_0x3fdd81['error']['message']);return _0x3dcb72(_0x3fdd81[_0x3a2f('0x12')][_0x3a2f('0x14')]);}else{logger[_0x3a2f('0xc')](_0x3a2f('0xd'),_0x122fd,_0x3a2f('0xe'));_0x3dcb72(_0x3fdd81[_0x3a2f('0x15')][_0x3a2f('0x14')]);}})[_0x3a2f('0x16')](function(_0x5d56f8){logger[_0x3a2f('0x12')](_0x3a2f('0xd'),_0x122fd,_0x5d56f8);_0xc76a45(_0x5d56f8);});});} \ No newline at end of file +var _0xa69c=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','catch','lodash','randomstring'];(function(_0x4df51d,_0x57d233){var _0x42a946=function(_0x2cf23f){while(--_0x2cf23f){_0x4df51d['push'](_0x4df51d['shift']());}};_0x42a946(++_0x57d233);}(_0xa69c,0x108));var _0xca69=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xa69c[_0x221ba2];return _0x47d08e;};'use strict';var _=require(_0xca69('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca69('0x1'));var fs=require('fs');var Redis=require(_0xca69('0x2'));var db=require(_0xca69('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca69('0x4'))('rpc');var config=require(_0xca69('0x5'));var jayson=require(_0xca69('0x6'));var client=jayson[_0xca69('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17aea2,_0x4cf285,_0x27bf5a){return new BPromise(function(_0xc8a6e8,_0xbc34c5){return client[_0xca69('0x8')](_0x17aea2,_0x27bf5a)[_0xca69('0x9')](function(_0x5e7473){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4cf285,_0xca69('0xa'));logger[_0xca69('0xb')](_0xca69('0xc'),_0x4cf285,_0xca69('0xa'),JSON[_0xca69('0xd')](_0x5e7473));if(_0x5e7473[_0xca69('0xe')]){if(_0x5e7473[_0xca69('0xe')][_0xca69('0xf')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x4cf285,_0x5e7473[_0xca69('0xe')][_0xca69('0x10')]);return _0xbc34c5(_0x5e7473[_0xca69('0xe')]['message']);}logger[_0xca69('0xe')](_0xca69('0x11'),_0x4cf285,_0x5e7473[_0xca69('0xe')][_0xca69('0x10')]);return _0xc8a6e8(_0x5e7473[_0xca69('0xe')][_0xca69('0x10')]);}else{logger['info'](_0xca69('0x11'),_0x4cf285,'request\x20sent');_0xc8a6e8(_0x5e7473['result'][_0xca69('0x10')]);}})[_0xca69('0x12')](function(_0x2ca80a){logger['error'](_0xca69('0x11'),_0x4cf285,_0x2ca80a);_0xbc34c5(_0x2ca80a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1f2c40c..7535c22 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 _0xf019=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x51a618,_0xe824f2){var _0x8fbf8d=function(_0x5dc44d){while(--_0x5dc44d){_0x51a618['push'](_0x51a618['shift']());}};_0x8fbf8d(++_0xe824f2);}(_0xf019,0x110));var _0x9f01=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf019[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x9f01('0x0'));var path=require(_0x9f01('0x1'));var timeout=require(_0x9f01('0x2'));var express=require(_0x9f01('0x3'));var router=express[_0x9f01('0x4')]();var auth=require(_0x9f01('0x5'));var interaction=require(_0x9f01('0x6'));var config=require(_0x9f01('0x7'));var controller=require(_0x9f01('0x8'));router[_0x9f01('0x9')]('/',auth[_0x9f01('0xa')](),controller[_0x9f01('0xb')]);router['get'](_0x9f01('0xc'),auth['isAuthenticated'](),controller[_0x9f01('0xd')]);router[_0x9f01('0xe')]('/',auth[_0x9f01('0xa')](),controller[_0x9f01('0xf')]);router[_0x9f01('0x10')](_0x9f01('0xc'),auth[_0x9f01('0xa')](),controller[_0x9f01('0x11')]);router[_0x9f01('0x12')](_0x9f01('0xc'),auth[_0x9f01('0xa')](),controller[_0x9f01('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2a69=['isAuthenticated','/:id','show','post','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x2a69,0x150));var _0x92a6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2a69[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x92a6('0x0'));var util=require('util');var path=require(_0x92a6('0x1'));var timeout=require(_0x92a6('0x2'));var express=require(_0x92a6('0x3'));var router=express['Router']();var auth=require(_0x92a6('0x4'));var interaction=require(_0x92a6('0x5'));var config=require(_0x92a6('0x6'));var controller=require(_0x92a6('0x7'));router[_0x92a6('0x8')]('/',auth[_0x92a6('0x9')](),controller['index']);router[_0x92a6('0x8')](_0x92a6('0xa'),auth[_0x92a6('0x9')](),controller[_0x92a6('0xb')]);router[_0x92a6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x92a6('0xa'),auth[_0x92a6('0x9')](),controller[_0x92a6('0xd')]);router['delete'](_0x92a6('0xa'),auth['isAuthenticated'](),controller[_0x92a6('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 70313ad..8a629a4 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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x5738fd,_0x4e4947){var _0x586364=function(_0x3500d7){while(--_0x3500d7){_0x5738fd['push'](_0x5738fd['shift']());}};_0x586364(++_0x4e4947);}(_0x22fb,0x192));var _0xb22f=function(_0x89826d,_0x47e716){_0x89826d=_0x89826d-0x0;var _0x1bfb8d=_0x22fb[_0x89826d];return _0x1bfb8d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file +var _0xa75b=['customVariable','keyValue','STRING','ENUM','sequelize','string','variable'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa75b,0x170));var _0xba75=function(_0x266f94,_0x12d559){_0x266f94=_0x266f94-0x0;var _0x475a58=_0xa75b[_0x266f94];return _0x475a58;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xba75('0x1'),_0xba75('0x2'),_0xba75('0x3'),_0xba75('0x4')),'defaultValue':_0xba75('0x1')},'content':{'type':Sequelize[_0xba75('0x5')]},'key':{'type':Sequelize[_0xba75('0x5')]},'keyType':{'type':Sequelize[_0xba75('0x6')](_0xba75('0x1'),_0xba75('0x2'),_0xba75('0x3'))},'keyContent':{'type':Sequelize[_0xba75('0x5')]},'idField':{'type':Sequelize[_0xba75('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba75('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index bdd6c3b..0a02bbf 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 _0x5fab=['hasOwnProperty','offset','order','sort','where','filter','merge','map','type','VIRTUAL','field','includeAll','include','rows','catch','params','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x5fab,0x177));var _0xb5fa=function(_0x335136,_0x131d00){_0x335136=_0x335136-0x0;var _0x234b60=_0x5fab[_0x335136];return _0x234b60;};'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 hardwareService=require(_0xb5fa('0x12'));var logger=require(_0xb5fa('0x13'))(_0xb5fa('0x14'));var utils=require(_0xb5fa('0x15'));var config=require(_0xb5fa('0x16'));var db=require(_0xb5fa('0x17'))['db'];function respondWithStatusCode(_0x46da66,_0x309740){_0x309740=_0x309740||0xcc;return function(_0x4d3576){if(_0x4d3576){return _0x46da66[_0xb5fa('0x18')](_0x309740);}return _0x46da66[_0xb5fa('0x19')](_0x309740)['end']();};}function respondWithResult(_0x116849,_0x577af0){_0x577af0=_0x577af0||0xc8;return function(_0x265992){if(_0x265992){return _0x116849[_0xb5fa('0x19')](_0x577af0)[_0xb5fa('0x1a')](_0x265992);}};}function respondWithFilteredResult(_0xca8d82,_0x8e9d1c){return function(_0x5371cf){if(_0x5371cf){var _0x567f31=_0x5371cf[_0xb5fa('0x1b')],_0x38e964=_0x8e9d1c['offset'],_0x587043=_0x8e9d1c['offset']+_0x8e9d1c[_0xb5fa('0x1c')],_0x31f252;if(_0x587043>=_0x567f31){_0x587043=_0x567f31;_0x31f252=0xc8;}else{_0x31f252=0xce;}_0xca8d82[_0xb5fa('0x19')](_0x31f252);return _0xca8d82[_0xb5fa('0x1d')](_0xb5fa('0x1e'),_0x38e964+'-'+_0x587043+'/'+_0x567f31)[_0xb5fa('0x1a')](_0x5371cf);}return null;};}function patchUpdates(_0x13e82b){return function(_0x3b0f69){try{jsonpatch[_0xb5fa('0x1f')](_0x3b0f69,_0x13e82b,!![]);}catch(_0xc14dc4){return BPromise[_0xb5fa('0x20')](_0xc14dc4);}return _0x3b0f69[_0xb5fa('0x21')]();};}function saveUpdates(_0x1f5064,_0x5cd822){return function(_0x432bfa){if(_0x432bfa){return _0x432bfa['update'](_0x1f5064)[_0xb5fa('0x22')](function(_0x4a6c04){return _0x4a6c04;});}return null;};}function removeEntity(_0xd0fe2b,_0x43c09f){return function(_0x4e05c0){if(_0x4e05c0){return _0x4e05c0[_0xb5fa('0x23')]()[_0xb5fa('0x22')](function(){_0xd0fe2b[_0xb5fa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32a85c,_0xec108f){return function(_0x444237){if(!_0x444237){_0x32a85c['sendStatus'](0x194);}return _0x444237;};}function handleError(_0x224ec8,_0x5d55f7){_0x5d55f7=_0x5d55f7||0x1f4;return function(_0x106c4b){logger[_0xb5fa('0x24')](_0x106c4b[_0xb5fa('0x25')]);if(_0x106c4b[_0xb5fa('0x26')]){delete _0x106c4b[_0xb5fa('0x26')];}_0x224ec8[_0xb5fa('0x19')](_0x5d55f7)[_0xb5fa('0x27')](_0x106c4b);};}exports[_0xb5fa('0x28')]=function(_0x568870,_0x4ec294){var _0x5bdf11={},_0x5a1c39={},_0x28a350={'count':0x0,'rows':[]};var _0x460b54=db[_0xb5fa('0x29')][_0xb5fa('0x2a')];_0x5a1c39[_0xb5fa('0x2b')]=_[_0xb5fa('0x2c')](_0x460b54);_0x5a1c39[_0xb5fa('0x2d')]=_[_0xb5fa('0x2c')](_0x568870[_0xb5fa('0x2d')]);_0x5a1c39[_0xb5fa('0x2e')]=_[_0xb5fa('0x2f')](_0x5a1c39[_0xb5fa('0x2b')],_0x5a1c39[_0xb5fa('0x2d')]);_0x5bdf11[_0xb5fa('0x30')]=_[_0xb5fa('0x2f')](_0x5a1c39[_0xb5fa('0x2b')],qs[_0xb5fa('0x31')](_0x568870[_0xb5fa('0x2d')][_0xb5fa('0x31')]));_0x5bdf11[_0xb5fa('0x30')]=_0x5bdf11[_0xb5fa('0x30')][_0xb5fa('0x32')]?_0x5bdf11[_0xb5fa('0x30')]:_0x5a1c39[_0xb5fa('0x2b')];if(!_0x568870['query'][_0xb5fa('0x33')]('nolimit')){_0x5bdf11['limit']=qs['limit'](_0x568870[_0xb5fa('0x2d')]['limit']);_0x5bdf11[_0xb5fa('0x34')]=qs['offset'](_0x568870['query'][_0xb5fa('0x34')]);}_0x5bdf11[_0xb5fa('0x35')]=qs['sort'](_0x568870['query'][_0xb5fa('0x36')]);_0x5bdf11[_0xb5fa('0x37')]=qs[_0xb5fa('0x2e')](_['pick'](_0x568870[_0xb5fa('0x2d')],_0x5a1c39[_0xb5fa('0x2e')]));if(_0x568870['query'][_0xb5fa('0x38')]){_0x5bdf11[_0xb5fa('0x37')]=_[_0xb5fa('0x39')](_0x5bdf11['where'],{'$or':_[_0xb5fa('0x3a')](_0x460b54,function(_0x2c950e){if(_0x2c950e[_0xb5fa('0x3b')]['key']!==_0xb5fa('0x3c')){var _0x1c818f={};_0x1c818f[_0x2c950e[_0xb5fa('0x3d')]]={'$like':'%'+_0x568870[_0xb5fa('0x2d')]['filter']+'%'};return _0x1c818f;}})});}_0x5bdf11=_['merge']({},_0x5bdf11,_0x568870['options']);var _0x49e786={'where':_0x5bdf11['where']};return db['ZohoField'][_0xb5fa('0x1b')](_0x49e786)['then'](function(_0x43de71){_0x28a350[_0xb5fa('0x1b')]=_0x43de71;if(_0x568870[_0xb5fa('0x2d')][_0xb5fa('0x3e')]){_0x5bdf11[_0xb5fa('0x3f')]=[{'all':!![]}];}return db[_0xb5fa('0x29')]['findAll'](_0x5bdf11);})['then'](function(_0x4c4bf0){_0x28a350[_0xb5fa('0x40')]=_0x4c4bf0;return _0x28a350;})['then'](respondWithFilteredResult(_0x4ec294,_0x5bdf11))[_0xb5fa('0x41')](handleError(_0x4ec294,null));};exports['show']=function(_0x58aa97,_0x3cdf63){var _0x42d331={'raw':!![],'where':{'id':_0x58aa97[_0xb5fa('0x42')]['id']}},_0x2e056e={};_0x2e056e[_0xb5fa('0x2b')]=_[_0xb5fa('0x2c')](db[_0xb5fa('0x29')][_0xb5fa('0x2a')]);_0x2e056e[_0xb5fa('0x2d')]=_[_0xb5fa('0x2c')](_0x58aa97['query']);_0x2e056e[_0xb5fa('0x2e')]=_['intersection'](_0x2e056e[_0xb5fa('0x2b')],_0x2e056e[_0xb5fa('0x2d')]);_0x42d331[_0xb5fa('0x30')]=_[_0xb5fa('0x2f')](_0x2e056e[_0xb5fa('0x2b')],qs[_0xb5fa('0x31')](_0x58aa97[_0xb5fa('0x2d')][_0xb5fa('0x31')]));_0x42d331['attributes']=_0x42d331[_0xb5fa('0x30')][_0xb5fa('0x32')]?_0x42d331['attributes']:_0x2e056e[_0xb5fa('0x2b')];if(_0x58aa97['query'][_0xb5fa('0x3e')]){_0x42d331[_0xb5fa('0x3f')]=[{'all':!![]}];}_0x42d331=_['merge']({},_0x42d331,_0x58aa97['options']);return db[_0xb5fa('0x29')][_0xb5fa('0x43')](_0x42d331)[_0xb5fa('0x22')](handleEntityNotFound(_0x3cdf63,null))[_0xb5fa('0x22')](respondWithResult(_0x3cdf63,null))[_0xb5fa('0x41')](handleError(_0x3cdf63,null));};exports[_0xb5fa('0x44')]=function(_0x10f354,_0x125a5c){return db['ZohoField'][_0xb5fa('0x44')](_0x10f354[_0xb5fa('0x45')],{})['then'](respondWithResult(_0x125a5c,0xc9))[_0xb5fa('0x41')](handleError(_0x125a5c,null));};exports[_0xb5fa('0x46')]=function(_0x247999,_0x43b056){if(_0x247999[_0xb5fa('0x45')]['id']){delete _0x247999[_0xb5fa('0x45')]['id'];}return db[_0xb5fa('0x29')][_0xb5fa('0x43')]({'where':{'id':_0x247999[_0xb5fa('0x42')]['id']}})[_0xb5fa('0x22')](handleEntityNotFound(_0x43b056,null))[_0xb5fa('0x22')](saveUpdates(_0x247999[_0xb5fa('0x45')],null))[_0xb5fa('0x22')](respondWithResult(_0x43b056,null))[_0xb5fa('0x41')](handleError(_0x43b056,null));};exports[_0xb5fa('0x23')]=function(_0x3a39f2,_0x52f5d8){return db['ZohoField'][_0xb5fa('0x43')]({'where':{'id':_0x3a39f2['params']['id']}})[_0xb5fa('0x22')](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x22')](removeEntity(_0x52f5d8,null))['catch'](handleError(_0x52f5d8,null));}; \ No newline at end of file +var _0xdb28=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','ZohoField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','map','type','key','filter','options','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x54d8ff,_0x2f577c){var _0x303cb1=function(_0xf413){while(--_0xf413){_0x54d8ff['push'](_0x54d8ff['shift']());}};_0x303cb1(++_0x2f577c);}(_0xdb28,0x106));var _0x8db2=function(_0x3e6f5a,_0x1a3111){_0x3e6f5a=_0x3e6f5a-0x0;var _0x34da4c=_0xdb28[_0x3e6f5a];return _0x34da4c;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var hardwareService=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];function respondWithStatusCode(_0x3b2faa,_0x1349f6){_0x1349f6=_0x1349f6||0xcc;return function(_0x204f49){if(_0x204f49){return _0x3b2faa[_0x8db2('0x17')](_0x1349f6);}return _0x3b2faa['status'](_0x1349f6)['end']();};}function respondWithResult(_0x15070d,_0x15e87c){_0x15e87c=_0x15e87c||0xc8;return function(_0x350d61){if(_0x350d61){return _0x15070d[_0x8db2('0x18')](_0x15e87c)[_0x8db2('0x19')](_0x350d61);}};}function respondWithFilteredResult(_0xfa285b,_0x2f177a){return function(_0x3c96a7){if(_0x3c96a7){var _0x131252=_0x3c96a7[_0x8db2('0x1a')],_0x16c8c2=_0x2f177a['offset'],_0x5489a9=_0x2f177a[_0x8db2('0x1b')]+_0x2f177a[_0x8db2('0x1c')],_0x13b0f5;if(_0x5489a9>=_0x131252){_0x5489a9=_0x131252;_0x13b0f5=0xc8;}else{_0x13b0f5=0xce;}_0xfa285b[_0x8db2('0x18')](_0x13b0f5);return _0xfa285b[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x16c8c2+'-'+_0x5489a9+'/'+_0x131252)[_0x8db2('0x19')](_0x3c96a7);}return null;};}function patchUpdates(_0x51d60d){return function(_0x5df464){try{jsonpatch[_0x8db2('0x1f')](_0x5df464,_0x51d60d,!![]);}catch(_0x104e33){return BPromise[_0x8db2('0x20')](_0x104e33);}return _0x5df464[_0x8db2('0x21')]();};}function saveUpdates(_0x58562e,_0x431d60){return function(_0x36a9ff){if(_0x36a9ff){return _0x36a9ff[_0x8db2('0x22')](_0x58562e)[_0x8db2('0x23')](function(_0x3dbe8e){return _0x3dbe8e;});}return null;};}function removeEntity(_0x597260,_0x124467){return function(_0x3e30e6){if(_0x3e30e6){return _0x3e30e6[_0x8db2('0x24')]()[_0x8db2('0x23')](function(){_0x597260[_0x8db2('0x18')](0xcc)[_0x8db2('0x25')]();});}};}function handleEntityNotFound(_0x796ec1,_0x5c6614){return function(_0x256202){if(!_0x256202){_0x796ec1['sendStatus'](0x194);}return _0x256202;};}function handleError(_0x5725f0,_0x52a9ca){_0x52a9ca=_0x52a9ca||0x1f4;return function(_0x4d923c){logger[_0x8db2('0x26')](_0x4d923c[_0x8db2('0x27')]);if(_0x4d923c[_0x8db2('0x28')]){delete _0x4d923c[_0x8db2('0x28')];}_0x5725f0[_0x8db2('0x18')](_0x52a9ca)[_0x8db2('0x29')](_0x4d923c);};}exports['index']=function(_0x3544ba,_0x372311){var _0x430dd5={},_0x8b7cec={},_0x483aee={'count':0x0,'rows':[]};var _0x2e0691=db[_0x8db2('0x2a')][_0x8db2('0x2b')];_0x8b7cec[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0x2e0691);_0x8b7cec[_0x8db2('0x2e')]=_[_0x8db2('0x2d')](_0x3544ba[_0x8db2('0x2e')]);_0x8b7cec[_0x8db2('0x2f')]=_['intersection'](_0x8b7cec[_0x8db2('0x2c')],_0x8b7cec['query']);_0x430dd5['attributes']=_[_0x8db2('0x30')](_0x8b7cec[_0x8db2('0x2c')],qs[_0x8db2('0x31')](_0x3544ba['query'][_0x8db2('0x31')]));_0x430dd5['attributes']=_0x430dd5[_0x8db2('0x32')][_0x8db2('0x33')]?_0x430dd5[_0x8db2('0x32')]:_0x8b7cec['model'];if(!_0x3544ba['query'][_0x8db2('0x34')](_0x8db2('0x35'))){_0x430dd5['limit']=qs['limit'](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1c')]);_0x430dd5[_0x8db2('0x1b')]=qs[_0x8db2('0x1b')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x1b')]);}_0x430dd5[_0x8db2('0x36')]=qs[_0x8db2('0x37')](_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x37')]);_0x430dd5['where']=qs[_0x8db2('0x2f')](_[_0x8db2('0x38')](_0x3544ba['query'],_0x8b7cec[_0x8db2('0x2f')]));if(_0x3544ba[_0x8db2('0x2e')]['filter']){_0x430dd5['where']=_[_0x8db2('0x39')](_0x430dd5['where'],{'$or':_[_0x8db2('0x3a')](_0x2e0691,function(_0x264696){if(_0x264696[_0x8db2('0x3b')][_0x8db2('0x3c')]!=='VIRTUAL'){var _0x2d3e98={};_0x2d3e98[_0x264696['field']]={'$like':'%'+_0x3544ba[_0x8db2('0x2e')][_0x8db2('0x3d')]+'%'};return _0x2d3e98;}})});}_0x430dd5=_[_0x8db2('0x39')]({},_0x430dd5,_0x3544ba[_0x8db2('0x3e')]);var _0x50e88a={'where':_0x430dd5['where']};return db[_0x8db2('0x2a')][_0x8db2('0x1a')](_0x50e88a)['then'](function(_0x2bac57){_0x483aee[_0x8db2('0x1a')]=_0x2bac57;if(_0x3544ba[_0x8db2('0x2e')]['includeAll']){_0x430dd5[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x2a')][_0x8db2('0x40')](_0x430dd5);})[_0x8db2('0x23')](function(_0x2e6f0c){_0x483aee[_0x8db2('0x41')]=_0x2e6f0c;return _0x483aee;})[_0x8db2('0x23')](respondWithFilteredResult(_0x372311,_0x430dd5))[_0x8db2('0x42')](handleError(_0x372311,null));};exports[_0x8db2('0x43')]=function(_0x63c561,_0x21cf7c){var _0x20bf0b={'raw':!![],'where':{'id':_0x63c561['params']['id']}},_0x1d9025={};_0x1d9025[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](db['ZohoField']['rawAttributes']);_0x1d9025[_0x8db2('0x2e')]=_['keys'](_0x63c561[_0x8db2('0x2e')]);_0x1d9025[_0x8db2('0x2f')]=_[_0x8db2('0x30')](_0x1d9025[_0x8db2('0x2c')],_0x1d9025[_0x8db2('0x2e')]);_0x20bf0b[_0x8db2('0x32')]=_[_0x8db2('0x30')](_0x1d9025['model'],qs[_0x8db2('0x31')](_0x63c561[_0x8db2('0x2e')][_0x8db2('0x31')]));_0x20bf0b[_0x8db2('0x32')]=_0x20bf0b['attributes'][_0x8db2('0x33')]?_0x20bf0b[_0x8db2('0x32')]:_0x1d9025[_0x8db2('0x2c')];if(_0x63c561[_0x8db2('0x2e')]['includeAll']){_0x20bf0b[_0x8db2('0x3f')]=[{'all':!![]}];}_0x20bf0b=_['merge']({},_0x20bf0b,_0x63c561[_0x8db2('0x3e')]);return db[_0x8db2('0x2a')][_0x8db2('0x44')](_0x20bf0b)['then'](handleEntityNotFound(_0x21cf7c,null))['then'](respondWithResult(_0x21cf7c,null))[_0x8db2('0x42')](handleError(_0x21cf7c,null));};exports['create']=function(_0x173cc7,_0x467866){return db[_0x8db2('0x2a')][_0x8db2('0x45')](_0x173cc7[_0x8db2('0x46')],{})[_0x8db2('0x23')](respondWithResult(_0x467866,0xc9))[_0x8db2('0x42')](handleError(_0x467866,null));};exports[_0x8db2('0x22')]=function(_0x4291e3,_0x12a1ef){if(_0x4291e3[_0x8db2('0x46')]['id']){delete _0x4291e3[_0x8db2('0x46')]['id'];}return db['ZohoField'][_0x8db2('0x44')]({'where':{'id':_0x4291e3[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x12a1ef,null))[_0x8db2('0x23')](saveUpdates(_0x4291e3['body'],null))['then'](respondWithResult(_0x12a1ef,null))[_0x8db2('0x42')](handleError(_0x12a1ef,null));};exports[_0x8db2('0x24')]=function(_0x164020,_0x4c66e5){return db['ZohoField']['find']({'where':{'id':_0x164020[_0x8db2('0x47')]['id']}})[_0x8db2('0x23')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x23')](removeEntity(_0x4c66e5,null))[_0x8db2('0x42')](handleError(_0x4c66e5,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 893d22b..b7004bf 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 _0x9984=['moment','bluebird','request-promise','path','../../config/environment','exports','ZohoField','int_zoho_fields','idField','lodash','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9984,0x1dd));var _0x4998=function(_0x31ee92,_0x578e93){_0x31ee92=_0x31ee92-0x0;var _0x310f31=_0x9984[_0x31ee92];return _0x310f31;};'use strict';var _=require(_0x4998('0x0'));var util=require('util');var logger=require(_0x4998('0x1'))(_0x4998('0x2'));var moment=require(_0x4998('0x3'));var BPromise=require(_0x4998('0x4'));var rp=require(_0x4998('0x5'));var fs=require('fs');var path=require(_0x4998('0x6'));var rimraf=require('rimraf');var config=require(_0x4998('0x7'));var attributes=require('./intZohoField.attributes');module[_0x4998('0x8')]=function(_0x7f74c3,_0x30e76a){return _0x7f74c3['define'](_0x4998('0x9'),attributes,{'tableName':_0x4998('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4998('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaafd=['zoho_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaafd,0x161));var _0xdaaf=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0xaafd[_0x131fe7];return _0x2eddf3;};'use strict';var _=require('lodash');var util=require(_0xdaaf('0x0'));var logger=require(_0xdaaf('0x1'))(_0xdaaf('0x2'));var moment=require('moment');var BPromise=require(_0xdaaf('0x3'));var rp=require(_0xdaaf('0x4'));var fs=require('fs');var path=require(_0xdaaf('0x5'));var rimraf=require(_0xdaaf('0x6'));var config=require('../../config/environment');var attributes=require(_0xdaaf('0x7'));module['exports']=function(_0x43a787,_0x43fe5a){return _0x43a787[_0xdaaf('0x8')](_0xdaaf('0x9'),attributes,{'tableName':_0xdaaf('0xa'),'paranoid':![],'indexes':[{'name':_0xdaaf('0xb'),'fields':[_0xdaaf('0xc'),_0xdaaf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index f74745e..1e861ac 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 _0xb2c2=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x4a8f12,_0x49a6f3){var _0x54871b=function(_0xd9190e){while(--_0xd9190e){_0x4a8f12['push'](_0x4a8f12['shift']());}};_0x54871b(++_0x49a6f3);}(_0xb2c2,0x7e));var _0x2b2c=function(_0x5de889,_0x115fc4){_0x5de889=_0x5de889-0x0;var _0x549a4f=_0xb2c2[_0x5de889];return _0x549a4f;};'use strict';var _=require(_0x2b2c('0x0'));var util=require(_0x2b2c('0x1'));var moment=require(_0x2b2c('0x2'));var BPromise=require(_0x2b2c('0x3'));var rs=require(_0x2b2c('0x4'));var fs=require('fs');var Redis=require(_0x2b2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b2c('0x6'));var logger=require(_0x2b2c('0x7'))(_0x2b2c('0x8'));var config=require(_0x2b2c('0x9'));var jayson=require(_0x2b2c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47e267,_0x857ac7,_0x48b924){return new BPromise(function(_0x3cb156,_0x15e83c){return client[_0x2b2c('0xb')](_0x47e267,_0x48b924)[_0x2b2c('0xc')](function(_0x5703c5){logger[_0x2b2c('0xd')](_0x2b2c('0xe'),_0x857ac7,_0x2b2c('0xf'));logger[_0x2b2c('0x10')](_0x2b2c('0x11'),_0x857ac7,_0x2b2c('0xf'),JSON[_0x2b2c('0x12')](_0x5703c5));if(_0x5703c5[_0x2b2c('0x13')]){if(_0x5703c5[_0x2b2c('0x13')][_0x2b2c('0x14')]===0x1f4){logger['error'](_0x2b2c('0xe'),_0x857ac7,_0x5703c5['error'][_0x2b2c('0x15')]);return _0x15e83c(_0x5703c5[_0x2b2c('0x13')][_0x2b2c('0x15')]);}logger[_0x2b2c('0x13')]('ZohoField,\x20%s,\x20%s',_0x857ac7,_0x5703c5['error']['message']);return _0x3cb156(_0x5703c5[_0x2b2c('0x13')][_0x2b2c('0x15')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x857ac7,_0x2b2c('0xf'));_0x3cb156(_0x5703c5[_0x2b2c('0x16')]['message']);}})[_0x2b2c('0x17')](function(_0x506548){logger[_0x2b2c('0x13')]('ZohoField,\x20%s,\x20%s',_0x857ac7,_0x506548);_0x15e83c(_0x506548);});});} \ No newline at end of file +var _0xbb77=['debug','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x3c45db,_0x401424){var _0x1bd95f=function(_0x15d35e){while(--_0x15d35e){_0x3c45db['push'](_0x3c45db['shift']());}};_0x1bd95f(++_0x401424);}(_0xbb77,0x1d8));var _0x7bb7=function(_0x3d6d66,_0xb3f3e9){_0x3d6d66=_0x3d6d66-0x0;var _0x4b1846=_0xbb77[_0x3d6d66];return _0x4b1846;};'use strict';var _=require(_0x7bb7('0x0'));var util=require(_0x7bb7('0x1'));var moment=require(_0x7bb7('0x2'));var BPromise=require(_0x7bb7('0x3'));var rs=require(_0x7bb7('0x4'));var fs=require('fs');var Redis=require(_0x7bb7('0x5'));var db=require(_0x7bb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7bb7('0x7'));var config=require('../../config/environment');var jayson=require(_0x7bb7('0x8'));var client=jayson[_0x7bb7('0x9')][_0x7bb7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x435506,_0x8dd17f,_0xbb420){return new BPromise(function(_0x3819df,_0x1980f1){return client['request'](_0x435506,_0xbb420)['then'](function(_0x1ace97){logger[_0x7bb7('0xb')](_0x7bb7('0xc'),_0x8dd17f,_0x7bb7('0xd'));logger[_0x7bb7('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x8dd17f,_0x7bb7('0xd'),JSON['stringify'](_0x1ace97));if(_0x1ace97[_0x7bb7('0xf')]){if(_0x1ace97['error']['code']===0x1f4){logger[_0x7bb7('0xf')](_0x7bb7('0xc'),_0x8dd17f,_0x1ace97['error'][_0x7bb7('0x10')]);return _0x1980f1(_0x1ace97[_0x7bb7('0xf')][_0x7bb7('0x10')]);}logger['error'](_0x7bb7('0xc'),_0x8dd17f,_0x1ace97[_0x7bb7('0xf')][_0x7bb7('0x10')]);return _0x3819df(_0x1ace97['error'][_0x7bb7('0x10')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x8dd17f,_0x7bb7('0xd'));_0x3819df(_0x1ace97[_0x7bb7('0x11')]['message']);}})['catch'](function(_0x4fe9e7){logger[_0x7bb7('0xf')]('ZohoField,\x20%s,\x20%s',_0x8dd17f,_0x4fe9e7);_0x1980f1(_0x4fe9e7);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8db77f0..2102bdf 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 _0x16ce=['path','connect-timeout','express','Router','../../components/auth/service','util'];(function(_0x1c08ae,_0x2c5f55){var _0x5bcfcb=function(_0x467f55){while(--_0x467f55){_0x1c08ae['push'](_0x1c08ae['shift']());}};_0x5bcfcb(++_0x2c5f55);}(_0x16ce,0xfb));var _0xe16c=function(_0x4659dd,_0x1bba21){_0x4659dd=_0x4659dd-0x0;var _0x597c28=_0x16ce[_0x4659dd];return _0x597c28;};'use strict';var multer=require('multer');var util=require(_0xe16c('0x0'));var path=require(_0xe16c('0x1'));var timeout=require(_0xe16c('0x2'));var express=require(_0xe16c('0x3'));var router=express[_0xe16c('0x4')]();var auth=require(_0xe16c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x2eb2=['../../components/auth/service','../../config/environment','util','path','connect-timeout','express','Router'];(function(_0x126178,_0x5b38ea){var _0x4524de=function(_0x211a60){while(--_0x211a60){_0x126178['push'](_0x126178['shift']());}};_0x4524de(++_0x5b38ea);}(_0x2eb2,0x19f));var _0x22eb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2eb2[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 0762d8f..c94c56b 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 _0xc4db=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x62565c,_0x13148e){var _0x5cfa37=function(_0x334f2c){while(--_0x334f2c){_0x62565c['push'](_0x62565c['shift']());}};_0x5cfa37(++_0x13148e);}(_0xc4db,0x1d1));var _0xbc4d=function(_0x285d29,_0x52c639){_0x285d29=_0x285d29-0x0;var _0x202256=_0xc4db[_0x285d29];return _0x202256;};'use strict';var Sequelize=require(_0xbc4d('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc4d('0x1')],'allowNull':![],'unique':_0xbc4d('0x2')},'version':{'type':Sequelize[_0xbc4d('0x1')],'allowNull':![],'unique':_0xbc4d('0x2')},'main':{'type':Sequelize[_0xbc4d('0x1')],'defaultValue':_0xbc4d('0x3')},'filename':{'type':Sequelize[_0xbc4d('0x1')]},'path':{'type':Sequelize[_0xbc4d('0x1')]},'type':{'type':Sequelize[_0xbc4d('0x1')]},'size':{'type':Sequelize[_0xbc4d('0x4')]},'active':{'type':Sequelize[_0xbc4d('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xbc4d('0x1')]},'logo':{'type':Sequelize[_0xbc4d('0x1')]},'state':{'type':Sequelize[_0xbc4d('0x1')],'unique':_0xbc4d('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xbc4d('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xbc4d('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb4fe=['exports','unique_name_and_version','STRING','app.js','BOOLEAN','sequelize'];(function(_0x54ecb4,_0x4d5aa4){var _0x735610=function(_0x58cfc6){while(--_0x58cfc6){_0x54ecb4['push'](_0x54ecb4['shift']());}};_0x735610(++_0x4d5aa4);}(_0xb4fe,0x197));var _0xeb4f=function(_0x5998cf,_0x26a0f9){_0x5998cf=_0x5998cf-0x0;var _0x3849b8=_0xb4fe[_0x5998cf];return _0x3849b8;};'use strict';var Sequelize=require(_0xeb4f('0x0'));module[_0xeb4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeb4f('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xeb4f('0x3')],'defaultValue':_0xeb4f('0x4')},'filename':{'type':Sequelize[_0xeb4f('0x3')]},'path':{'type':Sequelize[_0xeb4f('0x3')]},'type':{'type':Sequelize[_0xeb4f('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xeb4f('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xeb4f('0x3')]},'logo':{'type':Sequelize[_0xeb4f('0x3')]},'state':{'type':Sequelize[_0xeb4f('0x3')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xeb4f('0x3')]},'remoteUri':{'type':Sequelize[_0xeb4f('0x3')]},'link':{'type':Sequelize[_0xeb4f('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index c6f257b..9ec0534 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Integration','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x3869e7,_0x37e1dc){var _0x66260d=function(_0x4e0f2d){while(--_0x4e0f2d){_0x3869e7['push'](_0x3869e7['shift']());}};_0x66260d(++_0x37e1dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Integration'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Integration'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Integration','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x4c8bd3,_0x41f4d3){var _0x1e347f=function(_0x1f63a4){while(--_0x1f63a4){_0x4c8bd3['push'](_0x4c8bd3['shift']());}};_0x1e347f(++_0x41f4d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Integration'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Integration'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b700dea..dd14e24 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 _0x8b93=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','Integration'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8b93,0x15e));var _0x38b9=function(_0x2e38e8,_0xacd5a9){_0x2e38e8=_0x2e38e8-0x0;var _0x11289d=_0x8b93[_0x2e38e8];return _0x11289d;};'use strict';var _=require(_0x38b9('0x0'));var util=require(_0x38b9('0x1'));var logger=require('../../config/logger')(_0x38b9('0x2'));var moment=require(_0x38b9('0x3'));var BPromise=require(_0x38b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38b9('0x5'));var config=require(_0x38b9('0x6'));var attributes=require(_0x38b9('0x7'));module[_0x38b9('0x8')]=function(_0x29ad63,_0x13a23d){return _0x29ad63['define'](_0x38b9('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3802=['../../config/environment','./integration.attributes','exports','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14af78,_0x44a076){var _0x6eead0=function(_0x2bd182){while(--_0x2bd182){_0x14af78['push'](_0x14af78['shift']());}};_0x6eead0(++_0x44a076);}(_0x3802,0x67));var _0x2380=function(_0x188d1e,_0x2fe3f1){_0x188d1e=_0x188d1e-0x0;var _0x4ac9e6=_0x3802[_0x188d1e];return _0x4ac9e6;};'use strict';var _=require(_0x2380('0x0'));var util=require('util');var logger=require(_0x2380('0x1'))(_0x2380('0x2'));var moment=require(_0x2380('0x3'));var BPromise=require('bluebird');var rp=require(_0x2380('0x4'));var fs=require('fs');var path=require(_0x2380('0x5'));var rimraf=require(_0x2380('0x6'));var config=require(_0x2380('0x7'));var attributes=require(_0x2380('0x8'));module[_0x2380('0x9')]=function(_0x215597,_0x2d722c){return _0x215597['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index dcc3563..dfef270 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 _0x86d5=['info','Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x3ef22c,_0x10dea6){var _0x201a9a=function(_0x1dbc50){while(--_0x1dbc50){_0x3ef22c['push'](_0x3ef22c['shift']());}};_0x201a9a(++_0x10dea6);}(_0x86d5,0x128));var _0x586d=function(_0x3464e8,_0x4a208a){_0x3464e8=_0x3464e8-0x0;var _0x4e3dbb=_0x86d5[_0x3464e8];return _0x4e3dbb;};'use strict';var _=require(_0x586d('0x0'));var util=require('util');var moment=require(_0x586d('0x1'));var BPromise=require(_0x586d('0x2'));var rs=require(_0x586d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x586d('0x4'));var logger=require(_0x586d('0x5'))(_0x586d('0x6'));var config=require(_0x586d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x586d('0x8')][_0x586d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6b5f,_0x54e898,_0xe4f238){return new BPromise(function(_0x3fdb2b,_0x388aba){return client[_0x586d('0xa')](_0x2e6b5f,_0xe4f238)[_0x586d('0xb')](function(_0xb14ae8){logger[_0x586d('0xc')](_0x586d('0xd'),_0x54e898,'request\x20sent');logger[_0x586d('0xe')]('Integration,\x20%s,\x20%s,\x20%s',_0x54e898,_0x586d('0xf'),JSON[_0x586d('0x10')](_0xb14ae8));if(_0xb14ae8[_0x586d('0x11')]){if(_0xb14ae8[_0x586d('0x11')][_0x586d('0x12')]===0x1f4){logger[_0x586d('0x11')](_0x586d('0xd'),_0x54e898,_0xb14ae8[_0x586d('0x11')][_0x586d('0x13')]);return _0x388aba(_0xb14ae8['error'][_0x586d('0x13')]);}logger['error'](_0x586d('0xd'),_0x54e898,_0xb14ae8['error'][_0x586d('0x13')]);return _0x3fdb2b(_0xb14ae8[_0x586d('0x11')][_0x586d('0x13')]);}else{logger[_0x586d('0xc')]('Integration,\x20%s,\x20%s',_0x54e898,'request\x20sent');_0x3fdb2b(_0xb14ae8[_0x586d('0x14')][_0x586d('0x13')]);}})[_0x586d('0x15')](function(_0x237c5f){logger[_0x586d('0x11')](_0x586d('0xd'),_0x54e898,_0x237c5f);_0x388aba(_0x237c5f);});});} \ No newline at end of file +var _0xeb26=['Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0xeb26,0x191));var _0x6eb2=function(_0x36402e,_0x2838ec){_0x36402e=_0x36402e-0x0;var _0x10752e=_0xeb26[_0x36402e];return _0x10752e;};'use strict';var _=require(_0x6eb2('0x0'));var util=require(_0x6eb2('0x1'));var moment=require(_0x6eb2('0x2'));var BPromise=require(_0x6eb2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eb2('0x4'));var db=require(_0x6eb2('0x5'))['db'];var utils=require(_0x6eb2('0x6'));var logger=require(_0x6eb2('0x7'))(_0x6eb2('0x8'));var config=require(_0x6eb2('0x9'));var jayson=require(_0x6eb2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf1f2,_0x2e36d3,_0x572883){return new BPromise(function(_0x3d33b0,_0x33dbf4){return client['request'](_0x2cf1f2,_0x572883)[_0x6eb2('0xb')](function(_0x5d62f3){logger[_0x6eb2('0xc')](_0x6eb2('0xd'),_0x2e36d3,_0x6eb2('0xe'));logger[_0x6eb2('0xf')](_0x6eb2('0x10'),_0x2e36d3,_0x6eb2('0xe'),JSON[_0x6eb2('0x11')](_0x5d62f3));if(_0x5d62f3[_0x6eb2('0x12')]){if(_0x5d62f3[_0x6eb2('0x12')][_0x6eb2('0x13')]===0x1f4){logger['error'](_0x6eb2('0xd'),_0x2e36d3,_0x5d62f3['error'][_0x6eb2('0x14')]);return _0x33dbf4(_0x5d62f3['error'][_0x6eb2('0x14')]);}logger[_0x6eb2('0x12')]('Integration,\x20%s,\x20%s',_0x2e36d3,_0x5d62f3[_0x6eb2('0x12')]['message']);return _0x3d33b0(_0x5d62f3[_0x6eb2('0x12')]['message']);}else{logger[_0x6eb2('0xc')]('Integration,\x20%s,\x20%s',_0x2e36d3,_0x6eb2('0xe'));_0x3d33b0(_0x5d62f3[_0x6eb2('0x15')]['message']);}})[_0x6eb2('0x16')](function(_0x25f286){logger[_0x6eb2('0x12')]('Integration,\x20%s,\x20%s',_0x2e36d3,_0x25f286);_0x33dbf4(_0x25f286);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d5acef9..90bdeb8 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 _0x9e6c=['./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2b7c03,_0x166134){var _0x2bc83f=function(_0x408580){while(--_0x408580){_0x2b7c03['push'](_0x2b7c03['shift']());}};_0x2bc83f(++_0x166134);}(_0x9e6c,0x1d5));var _0xc9e6=function(_0x397a8c,_0x142f55){_0x397a8c=_0x397a8c-0x0;var _0x565aa2=_0x9e6c[_0x397a8c];return _0x565aa2;};'use strict';var multer=require(_0xc9e6('0x0'));var util=require(_0xc9e6('0x1'));var path=require('path');var timeout=require(_0xc9e6('0x2'));var express=require('express');var router=express[_0xc9e6('0x3')]();var auth=require(_0xc9e6('0x4'));var interaction=require(_0xc9e6('0x5'));var config=require('../../config/environment');var controller=require(_0xc9e6('0x6'));router[_0xc9e6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc9e6('0x8')]);router[_0xc9e6('0x7')](_0xc9e6('0x9'),auth[_0xc9e6('0xa')](),controller[_0xc9e6('0xb')]);router['get'](_0xc9e6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc9e6('0xd')]('/',auth[_0xc9e6('0xa')](),controller[_0xc9e6('0xe')]);router[_0xc9e6('0xf')](_0xc9e6('0xc'),auth[_0xc9e6('0xa')](),controller[_0xc9e6('0x10')]);router['delete'](_0xc9e6('0xc'),auth['isAuthenticated'](),controller[_0xc9e6('0x11')]);module[_0xc9e6('0x12')]=router; \ No newline at end of file +var _0x6752=['isAuthenticated','index','describe','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x495f86,_0x58efed){var _0x98ab3f=function(_0x40e51b){while(--_0x40e51b){_0x495f86['push'](_0x495f86['shift']());}};_0x98ab3f(++_0x58efed);}(_0x6752,0x96));var _0x2675=function(_0x48a61c,_0x408259){_0x48a61c=_0x48a61c-0x0;var _0x195bb7=_0x6752[_0x48a61c];return _0x195bb7;};'use strict';var multer=require(_0x2675('0x0'));var util=require(_0x2675('0x1'));var path=require(_0x2675('0x2'));var timeout=require(_0x2675('0x3'));var express=require('express');var router=express[_0x2675('0x4')]();var auth=require(_0x2675('0x5'));var interaction=require(_0x2675('0x6'));var config=require(_0x2675('0x7'));var controller=require(_0x2675('0x8'));router[_0x2675('0x9')]('/',auth[_0x2675('0xa')](),controller[_0x2675('0xb')]);router[_0x2675('0x9')]('/describe',auth[_0x2675('0xa')](),controller[_0x2675('0xc')]);router[_0x2675('0x9')](_0x2675('0xd'),auth[_0x2675('0xa')](),controller['show']);router[_0x2675('0xe')]('/',auth[_0x2675('0xa')](),controller[_0x2675('0xf')]);router[_0x2675('0x10')](_0x2675('0xd'),auth[_0x2675('0xa')](),controller[_0x2675('0x11')]);router['delete'](_0x2675('0xd'),auth[_0x2675('0xa')](),controller[_0x2675('0x12')]);module[_0x2675('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ce79211..3552bf9 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 _0xcdfb=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x59da33,_0x555969){var _0x1da20f=function(_0x3623c7){while(--_0x3623c7){_0x59da33['push'](_0x59da33['shift']());}};_0x1da20f(++_0x555969);}(_0xcdfb,0xfe));var _0xbcdf=function(_0x229992,_0x968621){_0x229992=_0x229992-0x0;var _0x62d9b2=_0xcdfb[_0x229992];return _0x62d9b2;};'use strict';var Sequelize=require('sequelize');module[_0xbcdf('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xbcdf('0x1')]},'ticketId':{'type':Sequelize[_0xbcdf('0x1')]},'integrationId':{'type':Sequelize[_0xbcdf('0x2')]},'contacts':{'type':Sequelize[_0xbcdf('0x1')]},'uniqueid':{'type':Sequelize[_0xbcdf('0x1')]},'calleridnum':{'type':Sequelize[_0xbcdf('0x1')]},'calleridname':{'type':Sequelize[_0xbcdf('0x1')]},'queue':{'type':Sequelize[_0xbcdf('0x1')]},'interface':{'type':Sequelize[_0xbcdf('0x1')]},'membername':{'type':Sequelize[_0xbcdf('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbcdf('0x3')]},'agentconnectAt':{'type':Sequelize[_0xbcdf('0x3')]},'holdtime':{'type':Sequelize[_0xbcdf('0x2')]},'agentcomplete':{'type':Sequelize[_0xbcdf('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xbcdf('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbcdf('0x2')]},'reason':{'type':Sequelize[_0xbcdf('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbcdf('0x3')]},'agentdump':{'type':Sequelize[_0xbcdf('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xbcdf('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xbcdf('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbcdf('0x1')]},'connectedlinename':{'type':Sequelize[_0xbcdf('0x1')]},'language':{'type':Sequelize[_0xbcdf('0x1')]},'accountcode':{'type':Sequelize[_0xbcdf('0x1')]},'context':{'type':Sequelize[_0xbcdf('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbcdf('0x1')]},'destchannel':{'type':Sequelize[_0xbcdf('0x1')]},'destchannelstate':{'type':Sequelize[_0xbcdf('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xbcdf('0x1')]},'destcalleridnum':{'type':Sequelize[_0xbcdf('0x1')]},'destcalleridname':{'type':Sequelize[_0xbcdf('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xbcdf('0x1')]},'destlanguage':{'type':Sequelize[_0xbcdf('0x1')]},'destaccountcode':{'type':Sequelize[_0xbcdf('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xbcdf('0x1')]},'destpriority':{'type':Sequelize[_0xbcdf('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xbcdf('0x1')]},'inReplyTo':{'type':Sequelize[_0xbcdf('0x1')]},'subject':{'type':Sequelize[_0xbcdf('0x1')]},'from':{'type':Sequelize[_0xbcdf('0x1')]},'to':{'type':Sequelize[_0xbcdf('0x1')]},'cc':{'type':Sequelize[_0xbcdf('0x1')]},'attachment':{'type':Sequelize[_0xbcdf('0x5')]},'html':{'type':Sequelize[_0xbcdf('0x5')]},'text':{'type':Sequelize[_0xbcdf('0x5')]},'status':{'type':Sequelize[_0xbcdf('0x6')](_0xbcdf('0x7'),_0xbcdf('0x8'),_0xbcdf('0x9'),_0xbcdf('0xa'))},'url':{'type':Sequelize[_0xbcdf('0x1')]},'app':{'type':Sequelize[_0xbcdf('0x1')]},'appdata':{'type':Sequelize[_0xbcdf('0x1')]},'projectId':{'type':Sequelize[_0xbcdf('0x2')]}}; \ No newline at end of file +var _0x8891=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','TEXT','ENUM','SENT','SENDING','FAILED'];(function(_0x5f2113,_0x28a9c9){var _0x35c13b=function(_0x57d71b){while(--_0x57d71b){_0x5f2113['push'](_0x5f2113['shift']());}};_0x35c13b(++_0x28a9c9);}(_0x8891,0x134));var _0x1889=function(_0x17479d,_0x593129){_0x17479d=_0x17479d-0x0;var _0x2d461c=_0x8891[_0x17479d];return _0x2d461c;};'use strict';var Sequelize=require(_0x1889('0x0'));module[_0x1889('0x1')]={'integration':{'type':Sequelize[_0x1889('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x1889('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1889('0x2')]},'calleridname':{'type':Sequelize[_0x1889('0x2')]},'queue':{'type':Sequelize[_0x1889('0x2')]},'interface':{'type':Sequelize[_0x1889('0x2')]},'membername':{'type':Sequelize[_0x1889('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x1889('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1889('0x4')]},'talktime':{'type':Sequelize[_0x1889('0x5')]},'agentacw':{'type':Sequelize[_0x1889('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1889('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1889('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1889('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1889('0x4')]},'lastevent':{'type':Sequelize[_0x1889('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1889('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1889('0x2')]},'connectedlinename':{'type':Sequelize[_0x1889('0x2')]},'language':{'type':Sequelize[_0x1889('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1889('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1889('0x2')]},'destchannelstate':{'type':Sequelize[_0x1889('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x1889('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x1889('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1889('0x2')]},'destlanguage':{'type':Sequelize[_0x1889('0x2')]},'destaccountcode':{'type':Sequelize[_0x1889('0x2')]},'destcontext':{'type':Sequelize[_0x1889('0x2')]},'destexten':{'type':Sequelize[_0x1889('0x2')]},'destpriority':{'type':Sequelize[_0x1889('0x2')]},'destuniqueid':{'type':Sequelize[_0x1889('0x2')]},'messageId':{'type':Sequelize[_0x1889('0x2')]},'inReplyTo':{'type':Sequelize[_0x1889('0x2')]},'subject':{'type':Sequelize[_0x1889('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1889('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x1889('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x1889('0x6')]},'status':{'type':Sequelize[_0x1889('0x7')](_0x1889('0x8'),_0x1889('0x9'),'RECEIVED',_0x1889('0xa'))},'url':{'type':Sequelize[_0x1889('0x2')]},'app':{'type':Sequelize[_0x1889('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1889('0x5')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 45f37b5..b6c1c2a 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 _0x1e6e=['rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','IntegrationReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll'];(function(_0x43b145,_0x334544){var _0x4b80ec=function(_0x3af778){while(--_0x3af778){_0x43b145['push'](_0x43b145['shift']());}};_0x4b80ec(++_0x334544);}(_0x1e6e,0xe6));var _0xe1e6=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x1e6e[_0x1589dd];return _0x1bddd1;};'use strict';var pdf=require(_0xe1e6('0x0'));var emlformat=require(_0xe1e6('0x1'));var rimraf=require(_0xe1e6('0x2'));var zipdir=require(_0xe1e6('0x3'));var jsonpatch=require(_0xe1e6('0x4'));var rp=require('request-promise');var moment=require(_0xe1e6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe1e6('0x6'));var path=require(_0xe1e6('0x7'));var sox=require(_0xe1e6('0x8'));var csv=require(_0xe1e6('0x9'));var ejs=require(_0xe1e6('0xa'));var fs=require('fs');var _=require(_0xe1e6('0xb'));var squel=require(_0xe1e6('0xc'));var crypto=require('crypto');var jsforce=require(_0xe1e6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe1e6('0x9'));var querystring=require(_0xe1e6('0xe'));var Papa=require(_0xe1e6('0xf'));var Redis=require(_0xe1e6('0x10'));var authService=require(_0xe1e6('0x11'));var qs=require(_0xe1e6('0x12'));var hardwareService=require(_0xe1e6('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe1e6('0x14'));var db=require(_0xe1e6('0x15'))['db'];function respondWithStatusCode(_0x4ec6e7,_0x2a52d1){_0x2a52d1=_0x2a52d1||0xcc;return function(_0xccf9d1){if(_0xccf9d1){return _0x4ec6e7[_0xe1e6('0x16')](_0x2a52d1);}return _0x4ec6e7[_0xe1e6('0x17')](_0x2a52d1)[_0xe1e6('0x18')]();};}function respondWithResult(_0x89ca6,_0x372360){_0x372360=_0x372360||0xc8;return function(_0x40bd0f){if(_0x40bd0f){return _0x89ca6['status'](_0x372360)[_0xe1e6('0x19')](_0x40bd0f);}};}function respondWithFilteredResult(_0x34a121,_0x580b4c){return function(_0x510f02){if(_0x510f02){var _0x305c94=_0x510f02[_0xe1e6('0x1a')],_0x52cdc8=_0x580b4c[_0xe1e6('0x1b')],_0x225f8e=_0x580b4c[_0xe1e6('0x1b')]+_0x580b4c[_0xe1e6('0x1c')],_0x4a9158;if(_0x225f8e>=_0x305c94){_0x225f8e=_0x305c94;_0x4a9158=0xc8;}else{_0x4a9158=0xce;}_0x34a121[_0xe1e6('0x17')](_0x4a9158);return _0x34a121[_0xe1e6('0x1d')](_0xe1e6('0x1e'),_0x52cdc8+'-'+_0x225f8e+'/'+_0x305c94)['json'](_0x510f02);}return null;};}function patchUpdates(_0x2ab7db){return function(_0x2026b3){try{jsonpatch[_0xe1e6('0x1f')](_0x2026b3,_0x2ab7db,!![]);}catch(_0x36f2ed){return BPromise[_0xe1e6('0x20')](_0x36f2ed);}return _0x2026b3[_0xe1e6('0x21')]();};}function saveUpdates(_0x5e18ff,_0x4eb89b){return function(_0x279019){if(_0x279019){return _0x279019[_0xe1e6('0x22')](_0x5e18ff)[_0xe1e6('0x23')](function(_0x4772fb){return _0x4772fb;});}return null;};}function removeEntity(_0xfcc7b,_0x1e93b5){return function(_0x735dd4){if(_0x735dd4){return _0x735dd4[_0xe1e6('0x24')]()[_0xe1e6('0x23')](function(){_0xfcc7b[_0xe1e6('0x17')](0xcc)[_0xe1e6('0x18')]();});}};}function handleEntityNotFound(_0x5b8573,_0x2f4032){return function(_0x1dad52){if(!_0x1dad52){_0x5b8573[_0xe1e6('0x16')](0x194);}return _0x1dad52;};}function handleError(_0x445688,_0x3e0110){_0x3e0110=_0x3e0110||0x1f4;return function(_0x3a0904){logger[_0xe1e6('0x25')](_0x3a0904[_0xe1e6('0x26')]);if(_0x3a0904[_0xe1e6('0x27')]){delete _0x3a0904[_0xe1e6('0x27')];}_0x445688[_0xe1e6('0x17')](_0x3e0110)['send'](_0x3a0904);};}exports[_0xe1e6('0x28')]=function(_0x186098,_0x46aa15){var _0x226bd2={},_0x398269={},_0x164b3a={'count':0x0,'rows':[]};var _0x2b6b76=db[_0xe1e6('0x29')]['rawAttributes'];_0x398269[_0xe1e6('0x2a')]=_[_0xe1e6('0x2b')](_0x2b6b76);_0x398269[_0xe1e6('0x2c')]=_[_0xe1e6('0x2b')](_0x186098[_0xe1e6('0x2c')]);_0x398269[_0xe1e6('0x2d')]=_[_0xe1e6('0x2e')](_0x398269['model'],_0x398269[_0xe1e6('0x2c')]);_0x226bd2[_0xe1e6('0x2f')]=_['intersection'](_0x398269['model'],qs[_0xe1e6('0x30')](_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x30')]));_0x226bd2['attributes']=_0x226bd2[_0xe1e6('0x2f')][_0xe1e6('0x31')]?_0x226bd2[_0xe1e6('0x2f')]:_0x398269['model'];if(!_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x32')](_0xe1e6('0x33'))){_0x226bd2[_0xe1e6('0x1c')]=qs[_0xe1e6('0x1c')](_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x1c')]);_0x226bd2[_0xe1e6('0x1b')]=qs['offset'](_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x1b')]);}_0x226bd2['order']=qs[_0xe1e6('0x34')](_0x186098[_0xe1e6('0x2c')]['sort']);_0x226bd2[_0xe1e6('0x35')]=qs[_0xe1e6('0x2d')](_[_0xe1e6('0x36')](_0x186098[_0xe1e6('0x2c')],_0x398269[_0xe1e6('0x2d')]));if(_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x37')]){_0x226bd2[_0xe1e6('0x35')]=_[_0xe1e6('0x38')](_0x226bd2[_0xe1e6('0x35')],{'$or':_[_0xe1e6('0x39')](_0x2b6b76,function(_0x1406dc){if(_0x1406dc[_0xe1e6('0x3a')][_0xe1e6('0x3b')]!==_0xe1e6('0x3c')){var _0x54a9e9={};_0x54a9e9[_0x1406dc[_0xe1e6('0x3d')]]={'$like':'%'+_0x186098['query'][_0xe1e6('0x37')]+'%'};return _0x54a9e9;}})});}_0x226bd2=_[_0xe1e6('0x38')]({},_0x226bd2,_0x186098[_0xe1e6('0x3e')]);var _0x2c1e0a={'where':_0x226bd2[_0xe1e6('0x35')]};return db[_0xe1e6('0x29')][_0xe1e6('0x1a')](_0x2c1e0a)['then'](function(_0x1dbe2b){_0x164b3a[_0xe1e6('0x1a')]=_0x1dbe2b;if(_0x186098[_0xe1e6('0x2c')][_0xe1e6('0x3f')]){_0x226bd2[_0xe1e6('0x40')]=[{'all':!![]}];}return db[_0xe1e6('0x29')][_0xe1e6('0x41')](_0x226bd2);})[_0xe1e6('0x23')](function(_0x4baf27){_0x164b3a[_0xe1e6('0x42')]=_0x4baf27;return _0x164b3a;})[_0xe1e6('0x23')](respondWithFilteredResult(_0x46aa15,_0x226bd2))[_0xe1e6('0x43')](handleError(_0x46aa15,null));};exports[_0xe1e6('0x44')]=function(_0x594b58,_0x3fb840){var _0x26551e={'raw':![],'where':{'id':_0x594b58[_0xe1e6('0x45')]['id']}},_0x3ed4b6={};_0x3ed4b6['model']=_[_0xe1e6('0x2b')](db[_0xe1e6('0x29')]['rawAttributes']);_0x3ed4b6['query']=_[_0xe1e6('0x2b')](_0x594b58[_0xe1e6('0x2c')]);_0x3ed4b6['filters']=_['intersection'](_0x3ed4b6['model'],_0x3ed4b6[_0xe1e6('0x2c')]);_0x26551e[_0xe1e6('0x2f')]=_[_0xe1e6('0x2e')](_0x3ed4b6['model'],qs[_0xe1e6('0x30')](_0x594b58[_0xe1e6('0x2c')][_0xe1e6('0x30')]));_0x26551e[_0xe1e6('0x2f')]=_0x26551e['attributes'][_0xe1e6('0x31')]?_0x26551e[_0xe1e6('0x2f')]:_0x3ed4b6[_0xe1e6('0x2a')];if(_0x594b58['query'][_0xe1e6('0x3f')]){_0x26551e[_0xe1e6('0x40')]=[{'all':!![]}];}_0x26551e=_[_0xe1e6('0x38')]({},_0x26551e,_0x594b58[_0xe1e6('0x3e')]);return db[_0xe1e6('0x29')][_0xe1e6('0x46')](_0x26551e)[_0xe1e6('0x23')](handleEntityNotFound(_0x3fb840,null))['then'](respondWithResult(_0x3fb840,null))[_0xe1e6('0x43')](handleError(_0x3fb840,null));};exports[_0xe1e6('0x47')]=function(_0x2d63fa,_0xa2f5ac){return db[_0xe1e6('0x29')][_0xe1e6('0x47')](_0x2d63fa['body'],{})[_0xe1e6('0x23')](respondWithResult(_0xa2f5ac,0xc9))[_0xe1e6('0x43')](handleError(_0xa2f5ac,null));};exports[_0xe1e6('0x22')]=function(_0x5c3cca,_0x21495e){if(_0x5c3cca[_0xe1e6('0x48')]['id']){delete _0x5c3cca[_0xe1e6('0x48')]['id'];}return db[_0xe1e6('0x29')][_0xe1e6('0x46')]({'where':{'id':_0x5c3cca[_0xe1e6('0x45')]['id']}})[_0xe1e6('0x23')](handleEntityNotFound(_0x21495e,null))[_0xe1e6('0x23')](saveUpdates(_0x5c3cca[_0xe1e6('0x48')],null))[_0xe1e6('0x23')](respondWithResult(_0x21495e,null))[_0xe1e6('0x43')](handleError(_0x21495e,null));};exports[_0xe1e6('0x24')]=function(_0x1b8753,_0x378dd9){return db[_0xe1e6('0x29')][_0xe1e6('0x46')]({'where':{'id':_0x1b8753['params']['id']}})[_0xe1e6('0x23')](handleEntityNotFound(_0x378dd9,null))['then'](removeEntity(_0x378dd9,null))[_0xe1e6('0x43')](handleError(_0x378dd9,null));};exports['describe']=function(_0x39f717,_0x29c9df){return db[_0xe1e6('0x29')][_0xe1e6('0x49')]()[_0xe1e6('0x23')](respondWithResult(_0x29c9df,null))[_0xe1e6('0x43')](handleError(_0x29c9df,null));}; \ No newline at end of file +var _0xabbe=['IntegrationReport','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','params','rawAttributes','includeAll','catch','create','body','find','describe','eml-format','zip-dir','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','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','error','stack','name','index'];(function(_0x6a094b,_0x5b1ed5){var _0x40ce63=function(_0x1d96d0){while(--_0x1d96d0){_0x6a094b['push'](_0x6a094b['shift']());}};_0x40ce63(++_0x5b1ed5);}(_0xabbe,0xb1));var _0xeabb=function(_0x1529b1,_0x11d772){_0x1529b1=_0x1529b1-0x0;var _0x584ebc=_0xabbe[_0x1529b1];return _0x584ebc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeabb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeabb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeabb('0x2'));var moment=require(_0xeabb('0x3'));var BPromise=require(_0xeabb('0x4'));var Mustache=require(_0xeabb('0x5'));var util=require(_0xeabb('0x6'));var path=require('path');var sox=require(_0xeabb('0x7'));var csv=require(_0xeabb('0x8'));var ejs=require(_0xeabb('0x9'));var fs=require('fs');var _=require(_0xeabb('0xa'));var squel=require(_0xeabb('0xb'));var crypto=require(_0xeabb('0xc'));var jsforce=require(_0xeabb('0xd'));var deskjs=require(_0xeabb('0xe'));var toCsv=require(_0xeabb('0x8'));var querystring=require(_0xeabb('0xf'));var Papa=require(_0xeabb('0x10'));var Redis=require(_0xeabb('0x11'));var authService=require(_0xeabb('0x12'));var qs=require(_0xeabb('0x13'));var hardwareService=require(_0xeabb('0x14'));var logger=require(_0xeabb('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xeabb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6e9553,_0x716764){_0x716764=_0x716764||0xcc;return function(_0x278a95){if(_0x278a95){return _0x6e9553[_0xeabb('0x17')](_0x716764);}return _0x6e9553['status'](_0x716764)['end']();};}function respondWithResult(_0x2c926f,_0x207499){_0x207499=_0x207499||0xc8;return function(_0x1c7ae7){if(_0x1c7ae7){return _0x2c926f[_0xeabb('0x18')](_0x207499)[_0xeabb('0x19')](_0x1c7ae7);}};}function respondWithFilteredResult(_0x34c0e7,_0x2428bd){return function(_0x22d174){if(_0x22d174){var _0x3b178e=_0x22d174[_0xeabb('0x1a')],_0x16b482=_0x2428bd['offset'],_0xfdeb63=_0x2428bd[_0xeabb('0x1b')]+_0x2428bd[_0xeabb('0x1c')],_0x4136a0;if(_0xfdeb63>=_0x3b178e){_0xfdeb63=_0x3b178e;_0x4136a0=0xc8;}else{_0x4136a0=0xce;}_0x34c0e7[_0xeabb('0x18')](_0x4136a0);return _0x34c0e7[_0xeabb('0x1d')]('Content-Range',_0x16b482+'-'+_0xfdeb63+'/'+_0x3b178e)[_0xeabb('0x19')](_0x22d174);}return null;};}function patchUpdates(_0x307bf3){return function(_0x14bccd){try{jsonpatch[_0xeabb('0x1e')](_0x14bccd,_0x307bf3,!![]);}catch(_0x4a9604){return BPromise['reject'](_0x4a9604);}return _0x14bccd[_0xeabb('0x1f')]();};}function saveUpdates(_0x5b5dd3,_0xf9ec0d){return function(_0x4a8d60){if(_0x4a8d60){return _0x4a8d60[_0xeabb('0x20')](_0x5b5dd3)['then'](function(_0xec6b89){return _0xec6b89;});}return null;};}function removeEntity(_0x591473,_0x30eb39){return function(_0x531b4b){if(_0x531b4b){return _0x531b4b[_0xeabb('0x21')]()[_0xeabb('0x22')](function(){_0x591473[_0xeabb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8796,_0x5561d1){return function(_0xe62002){if(!_0xe62002){_0x5b8796[_0xeabb('0x17')](0x194);}return _0xe62002;};}function handleError(_0x21952c,_0x2c2c1f){_0x2c2c1f=_0x2c2c1f||0x1f4;return function(_0x1e972d){logger[_0xeabb('0x23')](_0x1e972d[_0xeabb('0x24')]);if(_0x1e972d[_0xeabb('0x25')]){delete _0x1e972d[_0xeabb('0x25')];}_0x21952c[_0xeabb('0x18')](_0x2c2c1f)['send'](_0x1e972d);};}exports[_0xeabb('0x26')]=function(_0x110ed6,_0x4f3c98){var _0x21d586={},_0xb52181={},_0x17113f={'count':0x0,'rows':[]};var _0x10b31a=db[_0xeabb('0x27')]['rawAttributes'];_0xb52181['model']=_[_0xeabb('0x28')](_0x10b31a);_0xb52181['query']=_['keys'](_0x110ed6[_0xeabb('0x29')]);_0xb52181['filters']=_[_0xeabb('0x2a')](_0xb52181[_0xeabb('0x2b')],_0xb52181[_0xeabb('0x29')]);_0x21d586['attributes']=_[_0xeabb('0x2a')](_0xb52181[_0xeabb('0x2b')],qs[_0xeabb('0x2c')](_0x110ed6[_0xeabb('0x29')][_0xeabb('0x2c')]));_0x21d586[_0xeabb('0x2d')]=_0x21d586[_0xeabb('0x2d')][_0xeabb('0x2e')]?_0x21d586['attributes']:_0xb52181[_0xeabb('0x2b')];if(!_0x110ed6[_0xeabb('0x29')][_0xeabb('0x2f')](_0xeabb('0x30'))){_0x21d586[_0xeabb('0x1c')]=qs[_0xeabb('0x1c')](_0x110ed6[_0xeabb('0x29')][_0xeabb('0x1c')]);_0x21d586[_0xeabb('0x1b')]=qs[_0xeabb('0x1b')](_0x110ed6[_0xeabb('0x29')]['offset']);}_0x21d586['order']=qs[_0xeabb('0x31')](_0x110ed6[_0xeabb('0x29')]['sort']);_0x21d586[_0xeabb('0x32')]=qs[_0xeabb('0x33')](_[_0xeabb('0x34')](_0x110ed6[_0xeabb('0x29')],_0xb52181['filters']));if(_0x110ed6[_0xeabb('0x29')][_0xeabb('0x35')]){_0x21d586['where']=_[_0xeabb('0x36')](_0x21d586[_0xeabb('0x32')],{'$or':_[_0xeabb('0x37')](_0x10b31a,function(_0x420b34){if(_0x420b34[_0xeabb('0x38')][_0xeabb('0x39')]!==_0xeabb('0x3a')){var _0x1d0773={};_0x1d0773[_0x420b34[_0xeabb('0x3b')]]={'$like':'%'+_0x110ed6[_0xeabb('0x29')]['filter']+'%'};return _0x1d0773;}})});}_0x21d586=_['merge']({},_0x21d586,_0x110ed6[_0xeabb('0x3c')]);var _0x308c76={'where':_0x21d586['where']};return db[_0xeabb('0x27')][_0xeabb('0x1a')](_0x308c76)[_0xeabb('0x22')](function(_0x4d7e30){_0x17113f[_0xeabb('0x1a')]=_0x4d7e30;if(_0x110ed6[_0xeabb('0x29')]['includeAll']){_0x21d586[_0xeabb('0x3d')]=[{'all':!![]}];}return db[_0xeabb('0x27')][_0xeabb('0x3e')](_0x21d586);})[_0xeabb('0x22')](function(_0x18957a){_0x17113f[_0xeabb('0x3f')]=_0x18957a;return _0x17113f;})[_0xeabb('0x22')](respondWithFilteredResult(_0x4f3c98,_0x21d586))['catch'](handleError(_0x4f3c98,null));};exports['show']=function(_0x1e0473,_0x29e431){var _0x3faef5={'raw':![],'where':{'id':_0x1e0473[_0xeabb('0x40')]['id']}},_0x565cbe={};_0x565cbe[_0xeabb('0x2b')]=_[_0xeabb('0x28')](db[_0xeabb('0x27')][_0xeabb('0x41')]);_0x565cbe[_0xeabb('0x29')]=_[_0xeabb('0x28')](_0x1e0473[_0xeabb('0x29')]);_0x565cbe[_0xeabb('0x33')]=_[_0xeabb('0x2a')](_0x565cbe[_0xeabb('0x2b')],_0x565cbe['query']);_0x3faef5[_0xeabb('0x2d')]=_[_0xeabb('0x2a')](_0x565cbe[_0xeabb('0x2b')],qs[_0xeabb('0x2c')](_0x1e0473[_0xeabb('0x29')]['fields']));_0x3faef5['attributes']=_0x3faef5[_0xeabb('0x2d')][_0xeabb('0x2e')]?_0x3faef5[_0xeabb('0x2d')]:_0x565cbe[_0xeabb('0x2b')];if(_0x1e0473[_0xeabb('0x29')][_0xeabb('0x42')]){_0x3faef5[_0xeabb('0x3d')]=[{'all':!![]}];}_0x3faef5=_[_0xeabb('0x36')]({},_0x3faef5,_0x1e0473['options']);return db[_0xeabb('0x27')]['find'](_0x3faef5)[_0xeabb('0x22')](handleEntityNotFound(_0x29e431,null))[_0xeabb('0x22')](respondWithResult(_0x29e431,null))[_0xeabb('0x43')](handleError(_0x29e431,null));};exports['create']=function(_0x153a27,_0x46b815){return db[_0xeabb('0x27')][_0xeabb('0x44')](_0x153a27[_0xeabb('0x45')],{})[_0xeabb('0x22')](respondWithResult(_0x46b815,0xc9))[_0xeabb('0x43')](handleError(_0x46b815,null));};exports[_0xeabb('0x20')]=function(_0x396778,_0x1e90b3){if(_0x396778['body']['id']){delete _0x396778[_0xeabb('0x45')]['id'];}return db['IntegrationReport'][_0xeabb('0x46')]({'where':{'id':_0x396778[_0xeabb('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e90b3,null))[_0xeabb('0x22')](saveUpdates(_0x396778[_0xeabb('0x45')],null))[_0xeabb('0x22')](respondWithResult(_0x1e90b3,null))[_0xeabb('0x43')](handleError(_0x1e90b3,null));};exports[_0xeabb('0x21')]=function(_0x56d19c,_0x15975b){return db[_0xeabb('0x27')][_0xeabb('0x46')]({'where':{'id':_0x56d19c[_0xeabb('0x40')]['id']}})[_0xeabb('0x22')](handleEntityNotFound(_0x15975b,null))[_0xeabb('0x22')](removeEntity(_0x15975b,null))[_0xeabb('0x43')](handleError(_0x15975b,null));};exports[_0xeabb('0x47')]=function(_0x1d18fa,_0x3bd082){return db['IntegrationReport'][_0xeabb('0x47')]()[_0xeabb('0x22')](respondWithResult(_0x3bd082,null))[_0xeabb('0x43')](handleError(_0x3bd082,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6032875..5aeec42 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 _0x04de=['./integrationReport.attributes','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x04de,0x107));var _0xe04d=function(_0x533aa0,_0x36167e){_0x533aa0=_0x533aa0-0x0;var _0x1fc20c=_0x04de[_0x533aa0];return _0x1fc20c;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89c3=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x49490f,_0x5cd51c){var _0x30fced=function(_0x5bcdcd){while(--_0x5bcdcd){_0x49490f['push'](_0x49490f['shift']());}};_0x30fced(++_0x5cd51c);}(_0x89c3,0xff));var _0x389c=function(_0x1cf190,_0x13e53c){_0x1cf190=_0x1cf190-0x0;var _0x455f1d=_0x89c3[_0x1cf190];return _0x455f1d;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./integrationReport.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','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 b35ffdb..10100e0 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 _0xad9c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash'];(function(_0x3512c9,_0x4172f6){var _0x1f725d=function(_0x3527a3){while(--_0x3527a3){_0x3512c9['push'](_0x3512c9['shift']());}};_0x1f725d(++_0x4172f6);}(_0xad9c,0x1e2));var _0xcad9=function(_0xa0ea1c,_0x1398ea){_0xa0ea1c=_0xa0ea1c-0x0;var _0x1854e2=_0xad9c[_0xa0ea1c];return _0x1854e2;};'use strict';var _=require(_0xcad9('0x0'));var util=require(_0xcad9('0x1'));var moment=require(_0xcad9('0x2'));var BPromise=require(_0xcad9('0x3'));var rs=require(_0xcad9('0x4'));var fs=require('fs');var Redis=require(_0xcad9('0x5'));var db=require(_0xcad9('0x6'))['db'];var utils=require(_0xcad9('0x7'));var logger=require(_0xcad9('0x8'))(_0xcad9('0x9'));var config=require(_0xcad9('0xa'));var jayson=require(_0xcad9('0xb'));var client=jayson[_0xcad9('0xc')][_0xcad9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d6a2b,_0x595442,_0x174b2b){return new BPromise(function(_0xfb51aa,_0x28c9d3){return client[_0xcad9('0xe')](_0x5d6a2b,_0x174b2b)[_0xcad9('0xf')](function(_0xb2c9c2){logger['info'](_0xcad9('0x10'),_0x595442,_0xcad9('0x11'));logger['debug'](_0xcad9('0x12'),_0x595442,'request\x20sent',JSON['stringify'](_0xb2c9c2));if(_0xb2c9c2[_0xcad9('0x13')]){if(_0xb2c9c2[_0xcad9('0x13')][_0xcad9('0x14')]===0x1f4){logger['error'](_0xcad9('0x10'),_0x595442,_0xb2c9c2[_0xcad9('0x13')]['message']);return _0x28c9d3(_0xb2c9c2['error']['message']);}logger[_0xcad9('0x13')](_0xcad9('0x10'),_0x595442,_0xb2c9c2[_0xcad9('0x13')][_0xcad9('0x15')]);return _0xfb51aa(_0xb2c9c2[_0xcad9('0x13')]['message']);}else{logger[_0xcad9('0x16')]('IntegrationReport,\x20%s,\x20%s',_0x595442,_0xcad9('0x11'));_0xfb51aa(_0xb2c9c2['result'][_0xcad9('0x15')]);}})['catch'](function(_0x5b8c58){logger[_0xcad9('0x13')](_0xcad9('0x10'),_0x595442,_0x5b8c58);_0x28c9d3(_0x5b8c58);});});} \ No newline at end of file +var _0x7871=['debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','IntegrationReport,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7871,0x15d));var _0x1787=function(_0x45c535,_0x472c07){_0x45c535=_0x45c535-0x0;var _0x272ee5=_0x7871[_0x45c535];return _0x272ee5;};'use strict';var _=require(_0x1787('0x0'));var util=require('util');var moment=require(_0x1787('0x1'));var BPromise=require(_0x1787('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1787('0x3'));var db=require(_0x1787('0x4'))['db'];var utils=require(_0x1787('0x5'));var logger=require(_0x1787('0x6'))(_0x1787('0x7'));var config=require('../../config/environment');var jayson=require(_0x1787('0x8'));var client=jayson['client'][_0x1787('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b1472,_0x27291d,_0x59d46d){return new BPromise(function(_0x4dcf77,_0x2ad605){return client['request'](_0x1b1472,_0x59d46d)['then'](function(_0x4476a8){logger['info'](_0x1787('0xa'),_0x27291d,_0x1787('0xb'));logger[_0x1787('0xc')](_0x1787('0xd'),_0x27291d,_0x1787('0xb'),JSON[_0x1787('0xe')](_0x4476a8));if(_0x4476a8[_0x1787('0xf')]){if(_0x4476a8[_0x1787('0xf')][_0x1787('0x10')]===0x1f4){logger[_0x1787('0xf')](_0x1787('0xa'),_0x27291d,_0x4476a8[_0x1787('0xf')][_0x1787('0x11')]);return _0x2ad605(_0x4476a8[_0x1787('0xf')]['message']);}logger[_0x1787('0xf')](_0x1787('0xa'),_0x27291d,_0x4476a8[_0x1787('0xf')]['message']);return _0x4dcf77(_0x4476a8['error'][_0x1787('0x11')]);}else{logger['info'](_0x1787('0xa'),_0x27291d,_0x1787('0xb'));_0x4dcf77(_0x4476a8['result'][_0x1787('0x11')]);}})[_0x1787('0x12')](function(_0x441ddd){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x27291d,_0x441ddd);_0x2ad605(_0x441ddd);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 61f4540..b4bdd14 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 _0xd8a2=['addInterval','addIntervals','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','isAuthenticated','get','show','/:id/sub_intervals','getIntervals','post','create'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xd8a2,0x128));var _0x2d8a=function(_0x23844d,_0x10eccb){_0x23844d=_0x23844d-0x0;var _0x51010d=_0xd8a2[_0x23844d];return _0x51010d;};'use strict';var multer=require(_0x2d8a('0x0'));var util=require(_0x2d8a('0x1'));var path=require(_0x2d8a('0x2'));var timeout=require(_0x2d8a('0x3'));var express=require(_0x2d8a('0x4'));var router=express[_0x2d8a('0x5')]();var auth=require(_0x2d8a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2d8a('0x7'));var controller=require(_0x2d8a('0x8'));router['get']('/',auth[_0x2d8a('0x9')](),controller['index']);router[_0x2d8a('0xa')]('/:id',auth[_0x2d8a('0x9')](),controller[_0x2d8a('0xb')]);router[_0x2d8a('0xa')](_0x2d8a('0xc'),auth[_0x2d8a('0x9')](),controller[_0x2d8a('0xd')]);router[_0x2d8a('0xe')]('/',auth[_0x2d8a('0x9')](),controller[_0x2d8a('0xf')]);router[_0x2d8a('0xe')](_0x2d8a('0xc'),auth['isAuthenticated'](),controller[_0x2d8a('0x10')]);router['post']('/:id/sub_intervals/create_many',auth[_0x2d8a('0x9')](),controller[_0x2d8a('0x11')]);router[_0x2d8a('0x12')](_0x2d8a('0x13'),auth[_0x2d8a('0x9')](),controller[_0x2d8a('0x14')]);router[_0x2d8a('0x15')](_0x2d8a('0x13'),auth[_0x2d8a('0x9')](),controller[_0x2d8a('0x16')]);module[_0x2d8a('0x17')]=router; \ No newline at end of file +var _0x6bec=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update'];(function(_0x587159,_0x57fa9c){var _0x10e2e8=function(_0x24bd03){while(--_0x24bd03){_0x587159['push'](_0x587159['shift']());}};_0x10e2e8(++_0x57fa9c);}(_0x6bec,0x86));var _0xc6be=function(_0x57a1d1,_0x1a0464){_0x57a1d1=_0x57a1d1-0x0;var _0xa0e0c6=_0x6bec[_0x57a1d1];return _0xa0e0c6;};'use strict';var multer=require(_0xc6be('0x0'));var util=require(_0xc6be('0x1'));var path=require(_0xc6be('0x2'));var timeout=require(_0xc6be('0x3'));var express=require('express');var router=express[_0xc6be('0x4')]();var auth=require(_0xc6be('0x5'));var interaction=require(_0xc6be('0x6'));var config=require(_0xc6be('0x7'));var controller=require(_0xc6be('0x8'));router[_0xc6be('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6be('0x9')]('/:id',auth[_0xc6be('0xa')](),controller['show']);router[_0xc6be('0x9')](_0xc6be('0xb'),auth[_0xc6be('0xa')](),controller[_0xc6be('0xc')]);router[_0xc6be('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6be('0xb'),auth['isAuthenticated'](),controller[_0xc6be('0xe')]);router['post'](_0xc6be('0xf'),auth[_0xc6be('0xa')](),controller[_0xc6be('0x10')]);router[_0xc6be('0x11')](_0xc6be('0x12'),auth[_0xc6be('0xa')](),controller[_0xc6be('0x13')]);router[_0xc6be('0x14')](_0xc6be('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xc6be('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 3c67f48..b8488bf 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 _0x76d8=['exports','STRING','sequelize'];(function(_0x4bfbd3,_0x3578d1){var _0x171b82=function(_0x4e649d){while(--_0x4e649d){_0x4bfbd3['push'](_0x4bfbd3['shift']());}};_0x171b82(++_0x3578d1);}(_0x76d8,0x107));var _0x876d=function(_0x3af74b,_0x38b611){_0x3af74b=_0x3af74b-0x0;var _0x2ebbe7=_0x76d8[_0x3af74b];return _0x2ebbe7;};'use strict';var Sequelize=require(_0x876d('0x0'));module[_0x876d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x876d('0x2')]},'interval':{'type':Sequelize[_0x876d('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x55de=['sequelize','exports','STRING'];(function(_0x278e67,_0x4029e9){var _0x34e665=function(_0x4eeaa3){while(--_0x4eeaa3){_0x278e67['push'](_0x278e67['shift']());}};_0x34e665(++_0x4029e9);}(_0x55de,0x1ef));var _0xe55d=function(_0x5bf0d7,_0x102884){_0x5bf0d7=_0x5bf0d7-0x0;var _0x33ceb5=_0x55de[_0x5bf0d7];return _0x33ceb5;};'use strict';var Sequelize=require(_0xe55d('0x0'));module[_0xe55d('0x1')]={'name':{'type':Sequelize[_0xe55d('0x2')]},'description':{'type':Sequelize[_0xe55d('0x2')]},'interval':{'type':Sequelize[_0xe55d('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 c9d886f..c1e45e3 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 _0x188a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','findOne','map','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/extensions/rewrite','end','status','count','offset','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','Interval','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','merge','options','include','rows','catch','show','includeAll','find','create','body','user'];(function(_0x440f7a,_0x4368eb){var _0x5325e1=function(_0x1324a7){while(--_0x1324a7){_0x440f7a['push'](_0x440f7a['shift']());}};_0x5325e1(++_0x4368eb);}(_0x188a,0x69));var _0xa188=function(_0x2f636a,_0x14c607){_0x2f636a=_0x2f636a-0x0;var _0x39c291=_0x188a[_0x2f636a];return _0x39c291;};'use strict';var pdf=require(_0xa188('0x0'));var emlformat=require(_0xa188('0x1'));var rimraf=require(_0xa188('0x2'));var zipdir=require(_0xa188('0x3'));var jsonpatch=require(_0xa188('0x4'));var rp=require(_0xa188('0x5'));var moment=require(_0xa188('0x6'));var BPromise=require(_0xa188('0x7'));var Mustache=require(_0xa188('0x8'));var util=require(_0xa188('0x9'));var path=require(_0xa188('0xa'));var sox=require(_0xa188('0xb'));var csv=require(_0xa188('0xc'));var ejs=require(_0xa188('0xd'));var fs=require('fs');var _=require(_0xa188('0xe'));var squel=require(_0xa188('0xf'));var crypto=require('crypto');var jsforce=require(_0xa188('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa188('0xc'));var querystring=require(_0xa188('0x11'));var Papa=require(_0xa188('0x12'));var Redis=require(_0xa188('0x13'));var authService=require(_0xa188('0x14'));var qs=require(_0xa188('0x15'));var hardwareService=require(_0xa188('0x16'));var logger=require(_0xa188('0x17'))('api');var utils=require(_0xa188('0x18'));var config=require(_0xa188('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0xa188('0x1a'));function respondWithStatusCode(_0x27f06c,_0x137575){_0x137575=_0x137575||0xcc;return function(_0x118e5d){if(_0x118e5d){return _0x27f06c['sendStatus'](_0x137575);}return _0x27f06c['status'](_0x137575)[_0xa188('0x1b')]();};}function respondWithResult(_0x27f5c2,_0x4aa42c){_0x4aa42c=_0x4aa42c||0xc8;return function(_0x8fa4e){if(_0x8fa4e){return _0x27f5c2[_0xa188('0x1c')](_0x4aa42c)['json'](_0x8fa4e);}};}function respondWithFilteredResult(_0x4f4043,_0x3aa361){return function(_0xe05457){if(_0xe05457){var _0x2f7af5=_0xe05457[_0xa188('0x1d')],_0x44d064=_0x3aa361[_0xa188('0x1e')],_0x5cb486=_0x3aa361[_0xa188('0x1e')]+_0x3aa361['limit'],_0x50457d;if(_0x5cb486>=_0x2f7af5){_0x5cb486=_0x2f7af5;_0x50457d=0xc8;}else{_0x50457d=0xce;}_0x4f4043['status'](_0x50457d);return _0x4f4043['set'](_0xa188('0x1f'),_0x44d064+'-'+_0x5cb486+'/'+_0x2f7af5)['json'](_0xe05457);}return null;};}function patchUpdates(_0x49f4e9){return function(_0x192c30){try{jsonpatch['apply'](_0x192c30,_0x49f4e9,!![]);}catch(_0x482fdf){return BPromise[_0xa188('0x20')](_0x482fdf);}return _0x192c30[_0xa188('0x21')]();};}function saveUpdates(_0x59ec52,_0x40ab20){return function(_0x4d0ec5){if(_0x4d0ec5){return _0x4d0ec5[_0xa188('0x22')](_0x59ec52)[_0xa188('0x23')](function(_0x41f20a){return _0x41f20a;});}return null;};}function removeEntity(_0x10781a,_0x2576da){return function(_0xf21a48){if(_0xf21a48){return _0xf21a48[_0xa188('0x24')]()[_0xa188('0x23')](function(){var _0x9873f9=_0xf21a48[_0xa188('0x25')]({'plain':!![]});var _0x2b0c79=_0xa188('0x26');return db[_0xa188('0x27')][_0xa188('0x24')]({'where':{'type':_0x2b0c79,'resourceId':_0x9873f9['id']}})[_0xa188('0x23')](function(){return _0xf21a48;});})[_0xa188('0x23')](function(){_0x10781a[_0xa188('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3440e4,_0x501c01){return function(_0x9c89e5){if(!_0x9c89e5){_0x3440e4[_0xa188('0x28')](0x194);}return _0x9c89e5;};}function handleError(_0xa8e200,_0x124d04){_0x124d04=_0x124d04||0x1f4;return function(_0x3c3b29){logger['error'](_0x3c3b29[_0xa188('0x29')]);if(_0x3c3b29['name']){delete _0x3c3b29[_0xa188('0x2a')];}_0xa8e200['status'](_0x124d04)[_0xa188('0x2b')](_0x3c3b29);};}exports['index']=function(_0x1cb428,_0x271e8f){var _0x225225={},_0x5e9257={},_0x1a9022={'count':0x0,'rows':[]};var _0xf70fcd=db[_0xa188('0x2c')][_0xa188('0x2d')];_0x5e9257[_0xa188('0x2e')]=_[_0xa188('0x2f')](_0xf70fcd);_0x5e9257[_0xa188('0x30')]=_[_0xa188('0x2f')](_0x1cb428['query']);_0x5e9257[_0xa188('0x31')]=_[_0xa188('0x32')](_0x5e9257['model'],_0x5e9257[_0xa188('0x30')]);_0x225225[_0xa188('0x33')]=_[_0xa188('0x32')](_0x5e9257[_0xa188('0x2e')],qs[_0xa188('0x34')](_0x1cb428[_0xa188('0x30')][_0xa188('0x34')]));_0x225225[_0xa188('0x33')]=_0x225225['attributes'][_0xa188('0x35')]?_0x225225['attributes']:_0x5e9257['model'];if(!_0x1cb428[_0xa188('0x30')][_0xa188('0x36')](_0xa188('0x37'))){_0x225225[_0xa188('0x38')]=qs[_0xa188('0x38')](_0x1cb428[_0xa188('0x30')][_0xa188('0x38')]);_0x225225[_0xa188('0x1e')]=qs['offset'](_0x1cb428[_0xa188('0x30')][_0xa188('0x1e')]);}_0x225225[_0xa188('0x39')]=qs[_0xa188('0x3a')](_0x1cb428[_0xa188('0x30')][_0xa188('0x3a')]);_0x225225[_0xa188('0x3b')]=qs[_0xa188('0x31')](_[_0xa188('0x3c')](_0x1cb428[_0xa188('0x30')],_0x5e9257[_0xa188('0x31')]));if(_0x1cb428[_0xa188('0x30')]['filter']){_0x225225[_0xa188('0x3b')]=_['merge'](_0x225225['where'],{'$or':_['map'](_0xf70fcd,function(_0x1350cd){if(_0x1350cd[_0xa188('0x3d')][_0xa188('0x3e')]!==_0xa188('0x3f')){var _0x521546={};_0x521546[_0x1350cd[_0xa188('0x40')]]={'$like':'%'+_0x1cb428[_0xa188('0x30')][_0xa188('0x41')]+'%'};return _0x521546;}})});}_0x225225=_[_0xa188('0x42')]({},_0x225225,_0x1cb428[_0xa188('0x43')]);var _0x8af3ff={'where':_0x225225[_0xa188('0x3b')]};return db[_0xa188('0x2c')][_0xa188('0x1d')](_0x8af3ff)[_0xa188('0x23')](function(_0x4077e7){_0x1a9022[_0xa188('0x1d')]=_0x4077e7;if(_0x1cb428[_0xa188('0x30')]['includeAll']){_0x225225[_0xa188('0x44')]=[{'all':!![]}];}return db[_0xa188('0x2c')]['findAll'](_0x225225);})[_0xa188('0x23')](function(_0x3ae8ae){_0x1a9022[_0xa188('0x45')]=_0x3ae8ae;return _0x1a9022;})['then'](respondWithFilteredResult(_0x271e8f,_0x225225))[_0xa188('0x46')](handleError(_0x271e8f,null));};exports[_0xa188('0x47')]=function(_0x5bb522,_0x1ce743){var _0x51395a={'raw':!![],'where':{'id':_0x5bb522['params']['id']}},_0x3b18a2={};_0x3b18a2[_0xa188('0x2e')]=_[_0xa188('0x2f')](db[_0xa188('0x2c')][_0xa188('0x2d')]);_0x3b18a2[_0xa188('0x30')]=_[_0xa188('0x2f')](_0x5bb522[_0xa188('0x30')]);_0x3b18a2[_0xa188('0x31')]=_[_0xa188('0x32')](_0x3b18a2[_0xa188('0x2e')],_0x3b18a2[_0xa188('0x30')]);_0x51395a['attributes']=_[_0xa188('0x32')](_0x3b18a2[_0xa188('0x2e')],qs['fields'](_0x5bb522[_0xa188('0x30')]['fields']));_0x51395a[_0xa188('0x33')]=_0x51395a[_0xa188('0x33')][_0xa188('0x35')]?_0x51395a[_0xa188('0x33')]:_0x3b18a2[_0xa188('0x2e')];if(_0x5bb522['query'][_0xa188('0x48')]){_0x51395a[_0xa188('0x44')]=[{'all':!![]}];}_0x51395a=_['merge']({},_0x51395a,_0x5bb522[_0xa188('0x43')]);return db['Interval'][_0xa188('0x49')](_0x51395a)[_0xa188('0x23')](handleEntityNotFound(_0x1ce743,null))[_0xa188('0x23')](respondWithResult(_0x1ce743,null))[_0xa188('0x46')](handleError(_0x1ce743,null));};exports[_0xa188('0x4a')]=function(_0x3db669,_0x1903c4){return db[_0xa188('0x2c')][_0xa188('0x4a')](_0x3db669[_0xa188('0x4b')],{})[_0xa188('0x23')](function(_0x555dda){var _0xfc7c6d=_0x3db669[_0xa188('0x4c')][_0xa188('0x25')]({'plain':!![]});if(!_0xfc7c6d)throw new Error(_0xa188('0x4d'));if(_0xfc7c6d[_0xa188('0x4e')]===_0xa188('0x4c')){var _0x52d0eb=_0x555dda[_0xa188('0x25')]({'plain':!![]});var _0x155749=_0xa188('0x26');return db[_0xa188('0x4f')][_0xa188('0x49')]({'where':{'name':_0x155749,'userProfileId':_0xfc7c6d['userProfileId']},'raw':!![]})['then'](function(_0x2280cf){if(_0x2280cf&&_0x2280cf[_0xa188('0x50')]===0x0){return db[_0xa188('0x27')]['create']({'name':_0x52d0eb['name'],'resourceId':_0x52d0eb['id'],'type':_0x2280cf[_0xa188('0x2a')],'sectionId':_0x2280cf['id']},{})[_0xa188('0x23')](function(){return _0x555dda;});}else{return _0x555dda;}})[_0xa188('0x46')](function(_0x57fe2f){logger['error'](_0xa188('0x51'),_0x57fe2f);throw _0x57fe2f;});}return _0x555dda;})['then'](respondWithResult(_0x1903c4,0xc9))['catch'](handleError(_0x1903c4,null));};exports[_0xa188('0x22')]=function(_0x4b3e94,_0x546c87){if(_0x4b3e94[_0xa188('0x4b')]['id']){delete _0x4b3e94['body']['id'];}return db[_0xa188('0x2c')][_0xa188('0x49')]({'where':{'id':_0x4b3e94['params']['id']}})[_0xa188('0x23')](handleEntityNotFound(_0x546c87,null))['then'](saveUpdates(_0x4b3e94['body'],null))[_0xa188('0x23')](respondWithResult(_0x546c87,null))[_0xa188('0x46')](handleError(_0x546c87,null));};exports[_0xa188('0x24')]=function(_0x4a9d62,_0x210978){return db[_0xa188('0x2c')][_0xa188('0x49')]({'where':{'id':_0x4a9d62[_0xa188('0x52')]['id']}})[_0xa188('0x23')](handleEntityNotFound(_0x210978,null))['then'](removeEntity(_0x210978,null))[_0xa188('0x46')](handleError(_0x210978,null));};exports['addInterval']=function(_0x5120e5,_0xf092c2,_0x360458){if(_0x5120e5[_0xa188('0x4b')]['id']){delete _0x5120e5[_0xa188('0x4b')]['id'];}return db[_0xa188('0x2c')][_0xa188('0x49')]({'where':{'id':_0x5120e5[_0xa188('0x52')]['id']}})[_0xa188('0x23')](handleEntityNotFound(_0xf092c2,null))[_0xa188('0x23')](function(_0x5cc63b){if(_0x5cc63b){_0x5120e5[_0xa188('0x4b')][_0xa188('0x53')]=_0x5cc63b['id'];return db[_0xa188('0x2c')]['create'](_0x5120e5[_0xa188('0x4b')]);}})[_0xa188('0x23')](respondWithResult(_0xf092c2,null))['catch'](handleError(_0xf092c2,null));};exports[_0xa188('0x54')]=function(_0x3e2fe0,_0x32fd05,_0x554bf9){var _0x275e3a={};var _0xf0d2de={};var _0x2dd41c;var _0x439b20;return db['Interval'][_0xa188('0x55')]({'where':{'id':_0x3e2fe0['params']['id']}})[_0xa188('0x23')](handleEntityNotFound(_0x32fd05,null))['then'](function(_0xf3bc4a){if(_0xf3bc4a){_0x2dd41c=_0xf3bc4a;_0xf0d2de[_0xa188('0x2e')]=_['keys'](db[_0xa188('0x2c')][_0xa188('0x2d')]);_0xf0d2de[_0xa188('0x30')]=_[_0xa188('0x2f')](_0x3e2fe0[_0xa188('0x30')]);_0xf0d2de['filters']=_[_0xa188('0x32')](_0xf0d2de[_0xa188('0x2e')],_0xf0d2de[_0xa188('0x30')]);_0x275e3a[_0xa188('0x33')]=_['intersection'](_0xf0d2de[_0xa188('0x2e')],qs[_0xa188('0x34')](_0x3e2fe0[_0xa188('0x30')][_0xa188('0x34')]));_0x275e3a['attributes']=_0x275e3a['attributes'][_0xa188('0x35')]?_0x275e3a[_0xa188('0x33')]:_0xf0d2de[_0xa188('0x2e')];_0x275e3a[_0xa188('0x39')]=qs['sort'](_0x3e2fe0['query']['sort']);_0x275e3a[_0xa188('0x3b')]=qs[_0xa188('0x31')](_[_0xa188('0x3c')](_0x3e2fe0['query'],_0xf0d2de[_0xa188('0x31')]));if(_0x3e2fe0[_0xa188('0x30')][_0xa188('0x41')]){_0x275e3a[_0xa188('0x3b')]=_[_0xa188('0x42')](_0x275e3a[_0xa188('0x3b')],{'$or':_[_0xa188('0x56')](_0x275e3a[_0xa188('0x33')],function(_0x1f7039){var _0x56a59a={};_0x56a59a[_0x1f7039]={'$like':'%'+_0x3e2fe0[_0xa188('0x30')][_0xa188('0x41')]+'%'};return _0x56a59a;})});}_0x275e3a=_[_0xa188('0x42')]({},_0x275e3a,_0x3e2fe0[_0xa188('0x43')]);return _0x2dd41c['getIntervals'](_0x275e3a);}})[_0xa188('0x23')](function(_0x228b50){if(_0x228b50){_0x439b20=_0x228b50[_0xa188('0x35')];if(!_0x3e2fe0[_0xa188('0x30')][_0xa188('0x36')](_0xa188('0x37'))){_0x275e3a['limit']=qs[_0xa188('0x38')](_0x3e2fe0['query']['limit']);_0x275e3a[_0xa188('0x1e')]=qs[_0xa188('0x1e')](_0x3e2fe0['query'][_0xa188('0x1e')]);}return _0x2dd41c[_0xa188('0x54')](_0x275e3a);}})['then'](function(_0x3a30be){if(_0x3a30be){return _0x3a30be?{'count':_0x439b20,'rows':_0x3a30be}:null;}})['then'](respondWithResult(_0x32fd05,null))[_0xa188('0x46')](handleError(_0x32fd05,null));};exports[_0xa188('0x57')]=function(_0x2cd01b,_0xe6abf3,_0x1e1749){return db[_0xa188('0x2c')][_0xa188('0x55')]({'where':{'id':_0x2cd01b['params']['id']}})[_0xa188('0x23')](handleEntityNotFound(_0xe6abf3,null))[_0xa188('0x23')](function(_0x2703f2){if(_0x2703f2){return db[_0xa188('0x58')][_0xa188('0x59')](function(_0x2de933){return db[_0xa188('0x2c')]['destroy']({'where':{'IntervalId':_0x2cd01b[_0xa188('0x52')]['id']},'transaction':_0x2de933})[_0xa188('0x23')](function(_0xb5ec3e){var _0x38b023=_[_0xa188('0x56')](_0x2cd01b[_0xa188('0x4b')],function(_0x478f22){delete _0x478f22['id'];_0x478f22[_0xa188('0x53')]=_0x2cd01b[_0xa188('0x52')]['id'];return _0x478f22;});return db['Interval'][_0xa188('0x5a')](_0x38b023,{'transaction':_0x2de933});});})[_0xa188('0x23')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x2cd01b['params']['id']}});});}})[_0xa188('0x23')](respondWithResult(_0xe6abf3,null))['catch'](handleError(_0xe6abf3,null));}; \ No newline at end of file +var _0xcc9f=['then','Intervals','destroy','sendStatus','stack','name','index','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','Interval','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','map','addIntervals','findOne','transaction','IntervalId','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','status','end','json','count','offset','limit','set','apply','reject','save','update'];(function(_0x56c06f,_0x2c39e1){var _0x4b816c=function(_0x3d3d46){while(--_0x3d3d46){_0x56c06f['push'](_0x56c06f['shift']());}};_0x4b816c(++_0x2c39e1);}(_0xcc9f,0xed));var _0xfcc9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc9f[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfcc9('0x0'));var rimraf=require(_0xfcc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcc9('0x2'));var rp=require(_0xfcc9('0x3'));var moment=require(_0xfcc9('0x4'));var BPromise=require(_0xfcc9('0x5'));var Mustache=require('mustache');var util=require(_0xfcc9('0x6'));var path=require(_0xfcc9('0x7'));var sox=require('sox');var csv=require(_0xfcc9('0x8'));var ejs=require(_0xfcc9('0x9'));var fs=require('fs');var _=require(_0xfcc9('0xa'));var squel=require(_0xfcc9('0xb'));var crypto=require(_0xfcc9('0xc'));var jsforce=require(_0xfcc9('0xd'));var deskjs=require(_0xfcc9('0xe'));var toCsv=require(_0xfcc9('0x8'));var querystring=require(_0xfcc9('0xf'));var Papa=require(_0xfcc9('0x10'));var Redis=require(_0xfcc9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfcc9('0x12'));var hardwareService=require(_0xfcc9('0x13'));var logger=require(_0xfcc9('0x14'))(_0xfcc9('0x15'));var utils=require(_0xfcc9('0x16'));var config=require('../../config/environment');var db=require(_0xfcc9('0x17'))['db'];var extensions=require(_0xfcc9('0x18'));function respondWithStatusCode(_0x322ed2,_0x3cde15){_0x3cde15=_0x3cde15||0xcc;return function(_0x2d81e6){if(_0x2d81e6){return _0x322ed2['sendStatus'](_0x3cde15);}return _0x322ed2[_0xfcc9('0x19')](_0x3cde15)[_0xfcc9('0x1a')]();};}function respondWithResult(_0xbe0e6b,_0x510517){_0x510517=_0x510517||0xc8;return function(_0x5da454){if(_0x5da454){return _0xbe0e6b[_0xfcc9('0x19')](_0x510517)[_0xfcc9('0x1b')](_0x5da454);}};}function respondWithFilteredResult(_0x1f9f55,_0x5260f3){return function(_0x35b61c){if(_0x35b61c){var _0x5b8699=_0x35b61c[_0xfcc9('0x1c')],_0x3d994a=_0x5260f3['offset'],_0x1802c4=_0x5260f3[_0xfcc9('0x1d')]+_0x5260f3[_0xfcc9('0x1e')],_0x919be6;if(_0x1802c4>=_0x5b8699){_0x1802c4=_0x5b8699;_0x919be6=0xc8;}else{_0x919be6=0xce;}_0x1f9f55['status'](_0x919be6);return _0x1f9f55[_0xfcc9('0x1f')]('Content-Range',_0x3d994a+'-'+_0x1802c4+'/'+_0x5b8699)[_0xfcc9('0x1b')](_0x35b61c);}return null;};}function patchUpdates(_0x4d922c){return function(_0x2c3ccb){try{jsonpatch[_0xfcc9('0x20')](_0x2c3ccb,_0x4d922c,!![]);}catch(_0x78ab8d){return BPromise[_0xfcc9('0x21')](_0x78ab8d);}return _0x2c3ccb[_0xfcc9('0x22')]();};}function saveUpdates(_0x439754,_0x3b3f79){return function(_0x51a2f8){if(_0x51a2f8){return _0x51a2f8[_0xfcc9('0x23')](_0x439754)[_0xfcc9('0x24')](function(_0xe3b9a5){return _0xe3b9a5;});}return null;};}function removeEntity(_0xeac6d4,_0x16b880){return function(_0x55ca62){if(_0x55ca62){return _0x55ca62['destroy']()[_0xfcc9('0x24')](function(){var _0x43edd7=_0x55ca62['get']({'plain':!![]});var _0x465936=_0xfcc9('0x25');return db['UserProfileResource'][_0xfcc9('0x26')]({'where':{'type':_0x465936,'resourceId':_0x43edd7['id']}})[_0xfcc9('0x24')](function(){return _0x55ca62;});})[_0xfcc9('0x24')](function(){_0xeac6d4[_0xfcc9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ac8ba,_0xf64ba5){return function(_0x35effb){if(!_0x35effb){_0x3ac8ba[_0xfcc9('0x27')](0x194);}return _0x35effb;};}function handleError(_0x4f2634,_0x546d27){_0x546d27=_0x546d27||0x1f4;return function(_0x1e16bd){logger['error'](_0x1e16bd[_0xfcc9('0x28')]);if(_0x1e16bd[_0xfcc9('0x29')]){delete _0x1e16bd['name'];}_0x4f2634[_0xfcc9('0x19')](_0x546d27)['send'](_0x1e16bd);};}exports[_0xfcc9('0x2a')]=function(_0x2b3ff2,_0x52f77e){var _0xfd9278={},_0x50905d={},_0x3f7ba3={'count':0x0,'rows':[]};var _0x658df3=db['Interval']['rawAttributes'];_0x50905d[_0xfcc9('0x2b')]=_['keys'](_0x658df3);_0x50905d[_0xfcc9('0x2c')]=_[_0xfcc9('0x2d')](_0x2b3ff2['query']);_0x50905d[_0xfcc9('0x2e')]=_['intersection'](_0x50905d[_0xfcc9('0x2b')],_0x50905d[_0xfcc9('0x2c')]);_0xfd9278[_0xfcc9('0x2f')]=_[_0xfcc9('0x30')](_0x50905d[_0xfcc9('0x2b')],qs[_0xfcc9('0x31')](_0x2b3ff2['query']['fields']));_0xfd9278[_0xfcc9('0x2f')]=_0xfd9278[_0xfcc9('0x2f')][_0xfcc9('0x32')]?_0xfd9278[_0xfcc9('0x2f')]:_0x50905d['model'];if(!_0x2b3ff2['query'][_0xfcc9('0x33')](_0xfcc9('0x34'))){_0xfd9278['limit']=qs[_0xfcc9('0x1e')](_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x1e')]);_0xfd9278[_0xfcc9('0x1d')]=qs[_0xfcc9('0x1d')](_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x1d')]);}_0xfd9278[_0xfcc9('0x35')]=qs['sort'](_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x36')]);_0xfd9278[_0xfcc9('0x37')]=qs[_0xfcc9('0x2e')](_[_0xfcc9('0x38')](_0x2b3ff2[_0xfcc9('0x2c')],_0x50905d[_0xfcc9('0x2e')]));if(_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x39')]){_0xfd9278[_0xfcc9('0x37')]=_[_0xfcc9('0x3a')](_0xfd9278[_0xfcc9('0x37')],{'$or':_['map'](_0x658df3,function(_0x4c609e){if(_0x4c609e[_0xfcc9('0x3b')][_0xfcc9('0x3c')]!==_0xfcc9('0x3d')){var _0x58ec04={};_0x58ec04[_0x4c609e[_0xfcc9('0x3e')]]={'$like':'%'+_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x39')]+'%'};return _0x58ec04;}})});}_0xfd9278=_['merge']({},_0xfd9278,_0x2b3ff2[_0xfcc9('0x3f')]);var _0xdca295={'where':_0xfd9278[_0xfcc9('0x37')]};return db['Interval'][_0xfcc9('0x1c')](_0xdca295)[_0xfcc9('0x24')](function(_0x577114){_0x3f7ba3['count']=_0x577114;if(_0x2b3ff2[_0xfcc9('0x2c')][_0xfcc9('0x40')]){_0xfd9278[_0xfcc9('0x41')]=[{'all':!![]}];}return db['Interval'][_0xfcc9('0x42')](_0xfd9278);})[_0xfcc9('0x24')](function(_0x3db227){_0x3f7ba3[_0xfcc9('0x43')]=_0x3db227;return _0x3f7ba3;})[_0xfcc9('0x24')](respondWithFilteredResult(_0x52f77e,_0xfd9278))[_0xfcc9('0x44')](handleError(_0x52f77e,null));};exports['show']=function(_0x5a2680,_0x5cf1f3){var _0x12d4a5={'raw':!![],'where':{'id':_0x5a2680[_0xfcc9('0x45')]['id']}},_0x2e8444={};_0x2e8444['model']=_[_0xfcc9('0x2d')](db[_0xfcc9('0x46')][_0xfcc9('0x47')]);_0x2e8444[_0xfcc9('0x2c')]=_[_0xfcc9('0x2d')](_0x5a2680['query']);_0x2e8444[_0xfcc9('0x2e')]=_[_0xfcc9('0x30')](_0x2e8444[_0xfcc9('0x2b')],_0x2e8444['query']);_0x12d4a5[_0xfcc9('0x2f')]=_['intersection'](_0x2e8444[_0xfcc9('0x2b')],qs[_0xfcc9('0x31')](_0x5a2680['query'][_0xfcc9('0x31')]));_0x12d4a5[_0xfcc9('0x2f')]=_0x12d4a5[_0xfcc9('0x2f')]['length']?_0x12d4a5[_0xfcc9('0x2f')]:_0x2e8444[_0xfcc9('0x2b')];if(_0x5a2680['query'][_0xfcc9('0x40')]){_0x12d4a5[_0xfcc9('0x41')]=[{'all':!![]}];}_0x12d4a5=_[_0xfcc9('0x3a')]({},_0x12d4a5,_0x5a2680[_0xfcc9('0x3f')]);return db[_0xfcc9('0x46')]['find'](_0x12d4a5)[_0xfcc9('0x24')](handleEntityNotFound(_0x5cf1f3,null))['then'](respondWithResult(_0x5cf1f3,null))[_0xfcc9('0x44')](handleError(_0x5cf1f3,null));};exports['create']=function(_0x47ff03,_0x2b164a){return db[_0xfcc9('0x46')][_0xfcc9('0x48')](_0x47ff03[_0xfcc9('0x49')],{})[_0xfcc9('0x24')](function(_0x19a25f){var _0x4103e7=_0x47ff03[_0xfcc9('0x4a')][_0xfcc9('0x4b')]({'plain':!![]});if(!_0x4103e7)throw new Error(_0xfcc9('0x4c'));if(_0x4103e7[_0xfcc9('0x4d')]===_0xfcc9('0x4a')){var _0x23734d=_0x19a25f[_0xfcc9('0x4b')]({'plain':!![]});var _0x28304f=_0xfcc9('0x25');return db[_0xfcc9('0x4e')][_0xfcc9('0x4f')]({'where':{'name':_0x28304f,'userProfileId':_0x4103e7['userProfileId']},'raw':!![]})['then'](function(_0x5164dc){if(_0x5164dc&&_0x5164dc[_0xfcc9('0x50')]===0x0){return db[_0xfcc9('0x51')][_0xfcc9('0x48')]({'name':_0x23734d[_0xfcc9('0x29')],'resourceId':_0x23734d['id'],'type':_0x5164dc['name'],'sectionId':_0x5164dc['id']},{})[_0xfcc9('0x24')](function(){return _0x19a25f;});}else{return _0x19a25f;}})[_0xfcc9('0x44')](function(_0x14111c){logger['error'](_0xfcc9('0x52'),_0x14111c);throw _0x14111c;});}return _0x19a25f;})[_0xfcc9('0x24')](respondWithResult(_0x2b164a,0xc9))[_0xfcc9('0x44')](handleError(_0x2b164a,null));};exports['update']=function(_0x4b72e1,_0x4753cb){if(_0x4b72e1[_0xfcc9('0x49')]['id']){delete _0x4b72e1['body']['id'];}return db[_0xfcc9('0x46')][_0xfcc9('0x4f')]({'where':{'id':_0x4b72e1[_0xfcc9('0x45')]['id']}})[_0xfcc9('0x24')](handleEntityNotFound(_0x4753cb,null))[_0xfcc9('0x24')](saveUpdates(_0x4b72e1[_0xfcc9('0x49')],null))[_0xfcc9('0x24')](respondWithResult(_0x4753cb,null))[_0xfcc9('0x44')](handleError(_0x4753cb,null));};exports[_0xfcc9('0x26')]=function(_0x235ba2,_0x4bc84e){return db['Interval'][_0xfcc9('0x4f')]({'where':{'id':_0x235ba2[_0xfcc9('0x45')]['id']}})[_0xfcc9('0x24')](handleEntityNotFound(_0x4bc84e,null))[_0xfcc9('0x24')](removeEntity(_0x4bc84e,null))[_0xfcc9('0x44')](handleError(_0x4bc84e,null));};exports[_0xfcc9('0x53')]=function(_0x506b83,_0x2cf545,_0x1ebea2){if(_0x506b83[_0xfcc9('0x49')]['id']){delete _0x506b83['body']['id'];}return db[_0xfcc9('0x46')][_0xfcc9('0x4f')]({'where':{'id':_0x506b83['params']['id']}})['then'](handleEntityNotFound(_0x2cf545,null))[_0xfcc9('0x24')](function(_0x3975af){if(_0x3975af){_0x506b83[_0xfcc9('0x49')]['IntervalId']=_0x3975af['id'];return db[_0xfcc9('0x46')][_0xfcc9('0x48')](_0x506b83[_0xfcc9('0x49')]);}})[_0xfcc9('0x24')](respondWithResult(_0x2cf545,null))[_0xfcc9('0x44')](handleError(_0x2cf545,null));};exports[_0xfcc9('0x54')]=function(_0x4f1900,_0x120d4c,_0x1d9781){var _0x3e4eb2={};var _0x3dd21a={};var _0x52fa94;var _0x309ec2;return db[_0xfcc9('0x46')]['findOne']({'where':{'id':_0x4f1900[_0xfcc9('0x45')]['id']}})[_0xfcc9('0x24')](handleEntityNotFound(_0x120d4c,null))[_0xfcc9('0x24')](function(_0x2818aa){if(_0x2818aa){_0x52fa94=_0x2818aa;_0x3dd21a[_0xfcc9('0x2b')]=_['keys'](db[_0xfcc9('0x46')][_0xfcc9('0x47')]);_0x3dd21a['query']=_[_0xfcc9('0x2d')](_0x4f1900['query']);_0x3dd21a[_0xfcc9('0x2e')]=_[_0xfcc9('0x30')](_0x3dd21a['model'],_0x3dd21a[_0xfcc9('0x2c')]);_0x3e4eb2[_0xfcc9('0x2f')]=_[_0xfcc9('0x30')](_0x3dd21a['model'],qs[_0xfcc9('0x31')](_0x4f1900['query'][_0xfcc9('0x31')]));_0x3e4eb2['attributes']=_0x3e4eb2[_0xfcc9('0x2f')][_0xfcc9('0x32')]?_0x3e4eb2['attributes']:_0x3dd21a['model'];_0x3e4eb2['order']=qs[_0xfcc9('0x36')](_0x4f1900['query'][_0xfcc9('0x36')]);_0x3e4eb2[_0xfcc9('0x37')]=qs[_0xfcc9('0x2e')](_[_0xfcc9('0x38')](_0x4f1900[_0xfcc9('0x2c')],_0x3dd21a[_0xfcc9('0x2e')]));if(_0x4f1900[_0xfcc9('0x2c')][_0xfcc9('0x39')]){_0x3e4eb2[_0xfcc9('0x37')]=_['merge'](_0x3e4eb2[_0xfcc9('0x37')],{'$or':_[_0xfcc9('0x55')](_0x3e4eb2[_0xfcc9('0x2f')],function(_0x3ef1cd){var _0x2c7d6f={};_0x2c7d6f[_0x3ef1cd]={'$like':'%'+_0x4f1900[_0xfcc9('0x2c')][_0xfcc9('0x39')]+'%'};return _0x2c7d6f;})});}_0x3e4eb2=_[_0xfcc9('0x3a')]({},_0x3e4eb2,_0x4f1900['options']);return _0x52fa94[_0xfcc9('0x54')](_0x3e4eb2);}})[_0xfcc9('0x24')](function(_0x34004b){if(_0x34004b){_0x309ec2=_0x34004b['length'];if(!_0x4f1900[_0xfcc9('0x2c')][_0xfcc9('0x33')](_0xfcc9('0x34'))){_0x3e4eb2['limit']=qs[_0xfcc9('0x1e')](_0x4f1900[_0xfcc9('0x2c')][_0xfcc9('0x1e')]);_0x3e4eb2[_0xfcc9('0x1d')]=qs[_0xfcc9('0x1d')](_0x4f1900[_0xfcc9('0x2c')]['offset']);}return _0x52fa94[_0xfcc9('0x54')](_0x3e4eb2);}})[_0xfcc9('0x24')](function(_0x181e90){if(_0x181e90){return _0x181e90?{'count':_0x309ec2,'rows':_0x181e90}:null;}})[_0xfcc9('0x24')](respondWithResult(_0x120d4c,null))['catch'](handleError(_0x120d4c,null));};exports[_0xfcc9('0x56')]=function(_0x370153,_0x329431,_0x29b882){return db[_0xfcc9('0x46')][_0xfcc9('0x57')]({'where':{'id':_0x370153[_0xfcc9('0x45')]['id']}})[_0xfcc9('0x24')](handleEntityNotFound(_0x329431,null))[_0xfcc9('0x24')](function(_0x16fae2){if(_0x16fae2){return db['sequelize'][_0xfcc9('0x58')](function(_0x3ff421){return db[_0xfcc9('0x46')][_0xfcc9('0x26')]({'where':{'IntervalId':_0x370153[_0xfcc9('0x45')]['id']},'transaction':_0x3ff421})[_0xfcc9('0x24')](function(_0x169b4e){var _0x3e1858=_[_0xfcc9('0x55')](_0x370153[_0xfcc9('0x49')],function(_0x20db60){delete _0x20db60['id'];_0x20db60[_0xfcc9('0x59')]=_0x370153['params']['id'];return _0x20db60;});return db['Interval'][_0xfcc9('0x5a')](_0x3e1858,{'transaction':_0x3ff421});});})[_0xfcc9('0x24')](function(){return db[_0xfcc9('0x46')][_0xfcc9('0x42')]({'where':{'IntervalId':_0x370153[_0xfcc9('0x45')]['id']}});});}})[_0xfcc9('0x24')](respondWithResult(_0x329431,null))[_0xfcc9('0x44')](handleError(_0x329431,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e05c2fc..f6018b4 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 _0xa78b=['exports','define','Interval','tools_intervals','rewrite','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./interval.attributes'];(function(_0x54489b,_0xbfe813){var _0x1143fa=function(_0x39579d){while(--_0x39579d){_0x54489b['push'](_0x54489b['shift']());}};_0x1143fa(++_0xbfe813);}(_0xa78b,0x1a5));var _0xba78=function(_0x14d90b,_0xfdf44f){_0x14d90b=_0x14d90b-0x0;var _0x71212f=_0xa78b[_0x14d90b];return _0x71212f;};'use strict';var _=require('lodash');var util=require(_0xba78('0x0'));var logger=require(_0xba78('0x1'))('api');var moment=require(_0xba78('0x2'));var BPromise=require('bluebird');var rp=require(_0xba78('0x3'));var fs=require('fs');var path=require(_0xba78('0x4'));var rimraf=require(_0xba78('0x5'));var config=require(_0xba78('0x6'));var attributes=require(_0xba78('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xba78('0x8')]=function(_0x3a3489,_0x20d344){return _0x3a3489[_0xba78('0x9')](_0xba78('0xa'),attributes,{'tableName':_0xba78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x13eeb2,_0x287d18){extensions[_0xba78('0xc')](_0x3a3489,_0x13eeb2);},'afterBulkCreate':function(_0x1a0823,_0x2b3b9c,_0x361c05){_0x361c05();extensions['rewrite'](_0x3a3489,_0x1a0823[0x0]);},'afterUpdate':function(_0x37a6eb,_0x48ac40){extensions[_0xba78('0xc')](_0x3a3489,_0x37a6eb);},'afterDestroy':function(_0x166661,_0x4e58d4){extensions[_0xba78('0xc')](_0x3a3489,_0x166661);}}});}; \ No newline at end of file +var _0xb6ff=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_intervals','rewrite','lodash','util'];(function(_0x1a4aeb,_0x17e8a9){var _0x2a124d=function(_0x4b3600){while(--_0x4b3600){_0x1a4aeb['push'](_0x1a4aeb['shift']());}};_0x2a124d(++_0x17e8a9);}(_0xb6ff,0x1c5));var _0xfb6f=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0xb6ff[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0xfb6f('0x0'));var util=require(_0xfb6f('0x1'));var logger=require(_0xfb6f('0x2'))(_0xfb6f('0x3'));var moment=require(_0xfb6f('0x4'));var BPromise=require(_0xfb6f('0x5'));var rp=require(_0xfb6f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb6f('0x7'));var config=require(_0xfb6f('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xfb6f('0x9')]=function(_0x382147,_0x1e26bc){return _0x382147[_0xfb6f('0xa')]('Interval',attributes,{'tableName':_0xfb6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35da38,_0x570653){extensions[_0xfb6f('0xc')](_0x382147,_0x35da38);},'afterBulkCreate':function(_0xd8cc2b,_0x173b1f,_0x457e1c){_0x457e1c();extensions[_0xfb6f('0xc')](_0x382147,_0xd8cc2b[0x0]);},'afterUpdate':function(_0x48964e,_0x4e92e7){extensions[_0xfb6f('0xc')](_0x382147,_0x48964e);},'afterDestroy':function(_0x322b95,_0x5bbd1b){extensions['rewrite'](_0x382147,_0x322b95);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8849a07..8e8442e 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 _0x04de=['Interval','findAll','options','raw','where','attributes','include','model','ShowInterval','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Interval,\x20%s,\x20%s','result','catch','GetInterval'];(function(_0x1777b0,_0x4789d6){var _0x4587e8=function(_0x296e41){while(--_0x296e41){_0x1777b0['push'](_0x1777b0['shift']());}};_0x4587e8(++_0x4789d6);}(_0x04de,0x107));var _0xe04d=function(_0x16d2a9,_0x141852){_0x16d2a9=_0x16d2a9-0x0;var _0x2cbf9d=_0x04de[_0x16d2a9];return _0x2cbf9d;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('Interval,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('Interval,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});}exports[_0xe04d('0x18')]=function(_0x93b107){var _0x4090e0=this;return new Promise(function(_0x35a2b4,_0x251772){return db[_0xe04d('0x19')][_0xe04d('0x1a')]({'raw':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0x93b107[_0xe04d('0x1b')]?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1d')]||null:null,'attributes':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options'][_0xe04d('0x1e')]||null:null,'limit':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options']['limit']||null:null,'include':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')]['include']?_['map'](_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1f')],function(_0x495f73){return{'model':db[_0x495f73[_0xe04d('0x20')]],'as':_0x495f73['as'],'attributes':_0x495f73['attributes'],'include':_0x495f73[_0xe04d('0x1f')]?_['map'](_0x495f73[_0xe04d('0x1f')],function(_0x456822){return{'model':db[_0x456822[_0xe04d('0x20')]],'as':_0x456822['as'],'attributes':_0x456822[_0xe04d('0x1e')],'include':_0x456822[_0xe04d('0x1f')]?_['map'](_0x456822[_0xe04d('0x1f')],function(_0x3e43ca){return{'model':db[_0x3e43ca[_0xe04d('0x20')]],'as':_0x3e43ca['as'],'attributes':_0x3e43ca[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc73068){logger[_0xe04d('0xd')](_0xe04d('0x18'),_0x93b107);logger['debug'](_0xe04d('0x18'),_0x93b107,JSON['stringify'](_0xc73068));_0x35a2b4(_0xc73068);})['catch'](function(_0x569e4b){logger[_0xe04d('0x12')](_0xe04d('0x18'),_0x569e4b['message'],_0x93b107);_0x251772(_0x4090e0['error'](0x1f4,_0x569e4b[_0xe04d('0x14')]));});});};exports[_0xe04d('0x21')]=function(_0xff4dfb){var _0x4a2a10=this;return new Promise(function(_0x2cf005,_0x370cea){return db['Interval'][_0xe04d('0x22')]({'raw':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')]['where']||null:null,'attributes':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1e')]||null:null,'include':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0xff4dfb['options'][_0xe04d('0x1f')],function(_0x152837){return{'model':db[_0x152837[_0xe04d('0x20')]],'as':_0x152837['as'],'attributes':_0x152837[_0xe04d('0x1e')],'include':_0x152837[_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0x152837[_0xe04d('0x1f')],function(_0x10b44f){return{'model':db[_0x10b44f[_0xe04d('0x20')]],'as':_0x10b44f['as'],'attributes':_0x10b44f['attributes'],'include':_0x10b44f[_0xe04d('0x1f')]?_['map'](_0x10b44f[_0xe04d('0x1f')],function(_0x547f56){return{'model':db[_0x547f56['model']],'as':_0x547f56['as'],'attributes':_0x547f56[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe04d('0xc')](function(_0x261116){logger[_0xe04d('0xd')]('ShowInterval',_0xff4dfb);logger[_0xe04d('0xf')](_0xe04d('0x21'),_0xff4dfb,JSON[_0xe04d('0x11')](_0x261116));_0x2cf005(_0x261116);})[_0xe04d('0x17')](function(_0x322228){logger['error']('ShowInterval',_0x322228[_0xe04d('0x14')],_0xff4dfb);_0x370cea(_0x4a2a10['error'](0x1f4,_0x322228['message']));});});}; \ No newline at end of file +var _0x5089=['ShowInterval','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Interval','findAll','raw','options','attributes','limit','map','include','model','then','info','GetInterval'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5089,0x1bb));var _0x9508=function(_0x531a19,_0x43e019){_0x531a19=_0x531a19-0x0;var _0x4845d2=_0x5089[_0x531a19];return _0x4845d2;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Interval,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});}exports['GetInterval']=function(_0x22ba9c){var _0x378749=this;return new Promise(function(_0xfcc29d,_0x1ba7e6){return db[_0x9508('0x15')][_0x9508('0x16')]({'raw':_0x22ba9c['options']?_0x22ba9c['options'][_0x9508('0x17')]===undefined?!![]:![]:!![],'where':_0x22ba9c['options']?_0x22ba9c[_0x9508('0x18')]['where']||null:null,'attributes':_0x22ba9c[_0x9508('0x18')]?_0x22ba9c[_0x9508('0x18')][_0x9508('0x19')]||null:null,'limit':_0x22ba9c[_0x9508('0x18')]?_0x22ba9c[_0x9508('0x18')][_0x9508('0x1a')]||null:null,'include':_0x22ba9c[_0x9508('0x18')]?_0x22ba9c['options']['include']?_[_0x9508('0x1b')](_0x22ba9c[_0x9508('0x18')][_0x9508('0x1c')],function(_0xf70830){return{'model':db[_0xf70830[_0x9508('0x1d')]],'as':_0xf70830['as'],'attributes':_0xf70830[_0x9508('0x19')],'include':_0xf70830['include']?_['map'](_0xf70830[_0x9508('0x1c')],function(_0x55cc4d){return{'model':db[_0x55cc4d['model']],'as':_0x55cc4d['as'],'attributes':_0x55cc4d[_0x9508('0x19')],'include':_0x55cc4d['include']?_['map'](_0x55cc4d[_0x9508('0x1c')],function(_0x30da92){return{'model':db[_0x30da92['model']],'as':_0x30da92['as'],'attributes':_0x30da92[_0x9508('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9508('0x1e')](function(_0x22b2e2){logger[_0x9508('0x1f')](_0x9508('0x20'),_0x22ba9c);logger[_0x9508('0xe')](_0x9508('0x20'),_0x22ba9c,JSON[_0x9508('0x10')](_0x22b2e2));_0xfcc29d(_0x22b2e2);})[_0x9508('0x14')](function(_0x24df6){logger[_0x9508('0x11')]('GetInterval',_0x24df6[_0x9508('0x12')],_0x22ba9c);_0x1ba7e6(_0x378749[_0x9508('0x11')](0x1f4,_0x24df6[_0x9508('0x12')]));});});};exports['ShowInterval']=function(_0x3438da){var _0x38686a=this;return new Promise(function(_0x5e1d31,_0x3334d4){return db[_0x9508('0x15')]['find']({'raw':_0x3438da[_0x9508('0x18')]?_0x3438da[_0x9508('0x18')][_0x9508('0x17')]===undefined?!![]:![]:!![],'where':_0x3438da[_0x9508('0x18')]?_0x3438da['options']['where']||null:null,'attributes':_0x3438da[_0x9508('0x18')]?_0x3438da[_0x9508('0x18')][_0x9508('0x19')]||null:null,'include':_0x3438da['options']?_0x3438da['options'][_0x9508('0x1c')]?_[_0x9508('0x1b')](_0x3438da[_0x9508('0x18')][_0x9508('0x1c')],function(_0xc4ae52){return{'model':db[_0xc4ae52[_0x9508('0x1d')]],'as':_0xc4ae52['as'],'attributes':_0xc4ae52[_0x9508('0x19')],'include':_0xc4ae52[_0x9508('0x1c')]?_[_0x9508('0x1b')](_0xc4ae52[_0x9508('0x1c')],function(_0x4a34d2){return{'model':db[_0x4a34d2[_0x9508('0x1d')]],'as':_0x4a34d2['as'],'attributes':_0x4a34d2[_0x9508('0x19')],'include':_0x4a34d2['include']?_[_0x9508('0x1b')](_0x4a34d2[_0x9508('0x1c')],function(_0x3f69b1){return{'model':db[_0x3f69b1[_0x9508('0x1d')]],'as':_0x3f69b1['as'],'attributes':_0x3f69b1[_0x9508('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9508('0x1e')](function(_0x33e17c){logger[_0x9508('0x1f')](_0x9508('0x21'),_0x3438da);logger[_0x9508('0xe')](_0x9508('0x21'),_0x3438da,JSON['stringify'](_0x33e17c));_0x5e1d31(_0x33e17c);})[_0x9508('0x14')](function(_0x5b690e){logger[_0x9508('0x11')](_0x9508('0x21'),_0x5b690e[_0x9508('0x12')],_0x3438da);_0x3334d4(_0x38686a['error'](0x1f4,_0x5b690e['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 757441f..9cf478e 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x515e72,_0x224638){var _0x21d3bf=function(_0x46dfbe){while(--_0x46dfbe){_0x515e72['push'](_0x515e72['shift']());}};_0x21d3bf(++_0x224638);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26a4fb,_0x58ef61){_0x26a4fb=_0x26a4fb-0x0;var _0x542743=_0x5f2f[_0x26a4fb];return _0x542743;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index dd873ed..a1c776e 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 _0xa9e0=['Basic\x20','toString','base64','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json'];(function(_0x14ed4e,_0x3dcf54){var _0x5c3d8a=function(_0x284a91){while(--_0x284a91){_0x14ed4e['push'](_0x14ed4e['shift']());}};_0x5c3d8a(++_0x3dcf54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var https=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x0a9e('0x3');function openIssue(_0x4ce2f1,_0x333808){var _0x432180={'fields':{'project':{'key':_0x4ce2f1[_0x0a9e('0x4')]||_0x0a9e('0x5')},'summary':(_0x4ce2f1[_0x0a9e('0x6')]||'Report')+_0x0a9e('0x7')+_0x4ce2f1['ip'],'description':_0x4ce2f1[_0x0a9e('0x8')]||JSON[_0x0a9e('0x9')](_0x4ce2f1),'issuetype':{'name':_0x4ce2f1['issuetype']||'Bug'}}};_0x432180[_0x0a9e('0xa')]['customfield_11500']=_0x4ce2f1['email'];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xb')]=_0x4ce2f1[_0x0a9e('0xc')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xd')]=_0x4ce2f1[_0x0a9e('0xe')];_0x432180['fields']['customfield_11503']=_0x4ce2f1['name'];_0x432180['fields'][_0x0a9e('0xf')]=_0x4ce2f1[_0x0a9e('0x10')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0x11')]=_0x4ce2f1['ip'];var _0x32d742={'host':_0x0a9e('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0a9e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x0a9e('0x14'),'Authorization':_0x0a9e('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a9e('0x16')](_0x0a9e('0x17'))}};var _0x4d5611=JSON['stringify'](_0x432180);var _0x22dccb=https['request'](_0x32d742,function(_0x1985b6){_0x1985b6['setEncoding'](_0x0a9e('0x18'));var _0x12066b='';_0x1985b6['on']('data',function(_0x225616){_0x12066b+=_0x225616;});_0x1985b6['on']('end',function(){if(_0x333808){return _0x333808[_0x0a9e('0x19')](_0x1985b6[_0x0a9e('0x1a')])[_0x0a9e('0x1b')](JSON[_0x0a9e('0x1c')](_0x12066b));}});});_0x22dccb['on'](_0x0a9e('0x1d'),function(_0x2eb11f){if(_0x333808){return _0x333808[_0x0a9e('0x19')](0x1f4)[_0x0a9e('0x1b')]({'errors':[{'message':_0x0a9e('0x1e'),'type':_0x0a9e('0x1f')}]});}});_0x22dccb[_0x0a9e('0x20')](_0x4d5611);_0x22dccb[_0x0a9e('0x21')]();}exports['openIssue']=openIssue;exports[_0x0a9e('0x22')]=function(_0x155cce,_0x53682f){_0x155cce[_0x0a9e('0x23')]['ip']=_0x155cce['headers']['x-forwarded-for']||_0x155cce[_0x0a9e('0x24')][_0x0a9e('0x25')]||_0x155cce[_0x0a9e('0x26')][_0x0a9e('0x25')]||_0x155cce['connection'][_0x0a9e('0x26')][_0x0a9e('0x25')];return openIssue(_0x155cce[_0x0a9e('0x23')],_0x53682f);}; \ No newline at end of file +var _0xb7e7=['reason','track.xcallymotion.com','POST','toString','base64','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','key','MOTGUI','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var BPromise=require(_0x7b7e('0x0'));var https=require('https');var logger=require(_0x7b7e('0x1'))('api');var USERNAME=_0x7b7e('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3f5804,_0x556d68){var _0x31d0ed={'fields':{'project':{'key':_0x3f5804[_0x7b7e('0x3')]||_0x7b7e('0x4')},'summary':(_0x3f5804['summary']||'Report')+_0x7b7e('0x5')+_0x3f5804['ip'],'description':_0x3f5804[_0x7b7e('0x6')]||JSON[_0x7b7e('0x7')](_0x3f5804),'issuetype':{'name':_0x3f5804['issuetype']||_0x7b7e('0x8')}}};_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xa')]=_0x3f5804[_0x7b7e('0xb')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xc')]=_0x3f5804[_0x7b7e('0xd')];_0x31d0ed['fields'][_0x7b7e('0xe')]=_0x3f5804[_0x7b7e('0xf')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x10')]=_0x3f5804[_0x7b7e('0x11')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x12')]=_0x3f5804[_0x7b7e('0x13')];_0x31d0ed[_0x7b7e('0x9')]['customfield_10102']=_0x3f5804['ip'];var _0x267446={'host':_0x7b7e('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x7b7e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x7b7e('0x16')](_0x7b7e('0x17'))}};var _0xf067da=JSON[_0x7b7e('0x7')](_0x31d0ed);var _0x3d2fb2=https['request'](_0x267446,function(_0x51baf6){_0x51baf6[_0x7b7e('0x18')](_0x7b7e('0x19'));var _0x27f999='';_0x51baf6['on'](_0x7b7e('0x1a'),function(_0x2cc400){_0x27f999+=_0x2cc400;});_0x51baf6['on'](_0x7b7e('0x1b'),function(){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](_0x51baf6[_0x7b7e('0x1d')])[_0x7b7e('0x1e')](JSON[_0x7b7e('0x1f')](_0x27f999));}});});_0x3d2fb2['on'](_0x7b7e('0x20'),function(_0x14f4fe){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](0x1f4)[_0x7b7e('0x1e')]({'errors':[{'message':_0x7b7e('0x21'),'type':_0x7b7e('0x22')}]});}});_0x3d2fb2[_0x7b7e('0x23')](_0xf067da);_0x3d2fb2['end']();}exports[_0x7b7e('0x24')]=openIssue;exports[_0x7b7e('0x25')]=function(_0x24718c,_0x4c0647){_0x24718c[_0x7b7e('0x26')]['ip']=_0x24718c[_0x7b7e('0x27')][_0x7b7e('0x28')]||_0x24718c[_0x7b7e('0x29')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x2b')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x29')]['socket']['remoteAddress'];return openIssue(_0x24718c['body'],_0x4c0647);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 108be15..6ffa0d9 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 _0x4e3d=['../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e3d,0x105));var _0xd4e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4e3d[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xd4e3('0x0'));var util=require(_0xd4e3('0x1'));var path=require('path');var timeout=require(_0xd4e3('0x2'));var express=require(_0xd4e3('0x3'));var router=express[_0xd4e3('0x4')]();var auth=require(_0xd4e3('0x5'));var interaction=require(_0xd4e3('0x6'));var config=require('../../config/environment');var controller=require(_0xd4e3('0x7'));router['get']('/',auth[_0xd4e3('0x8')](),controller[_0xd4e3('0x9')]);router['get'](_0xd4e3('0xa'),auth[_0xd4e3('0x8')](),controller[_0xd4e3('0xb')]);router['get'](_0xd4e3('0xc'),auth['isAuthenticated'](),controller[_0xd4e3('0xd')]);router['post']('/',auth[_0xd4e3('0x8')](),controller[_0xd4e3('0xe')]);router[_0xd4e3('0xf')](_0xd4e3('0xc'),auth['isAuthenticated'](),controller[_0xd4e3('0x10')]);router[_0xd4e3('0x11')]('/:id',auth[_0xd4e3('0x8')](),controller['destroy']);module[_0xd4e3('0x12')]=router; \ No newline at end of file +var _0xcc5a=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment'];(function(_0x4e9074,_0x54f880){var _0x8c591=function(_0x560ddd){while(--_0x560ddd){_0x4e9074['push'](_0x4e9074['shift']());}};_0x8c591(++_0x54f880);}(_0xcc5a,0xdc));var _0xacc5=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xcc5a[_0x5e4563];return _0x8d1bf5;};'use strict';var multer=require(_0xacc5('0x0'));var util=require('util');var path=require(_0xacc5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xacc5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xacc5('0x3'));var controller=require(_0xacc5('0x4'));router[_0xacc5('0x5')]('/',auth[_0xacc5('0x6')](),controller['index']);router['get'](_0xacc5('0x7'),auth[_0xacc5('0x6')](),controller[_0xacc5('0x8')]);router[_0xacc5('0x5')](_0xacc5('0x9'),auth[_0xacc5('0x6')](),controller['show']);router[_0xacc5('0xa')]('/',auth[_0xacc5('0x6')](),controller['create']);router[_0xacc5('0xb')](_0xacc5('0x9'),auth[_0xacc5('0x6')](),controller[_0xacc5('0xc')]);router[_0xacc5('0xd')](_0xacc5('0x9'),auth[_0xacc5('0x6')](),controller[_0xacc5('0xe')]);module[_0xacc5('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 5143e5b..66402ff 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 _0xe43c=['exports','STRING','TEXT','long','sequelize'];(function(_0x26ac27,_0x574b86){var _0x44a599=function(_0x130e2c){while(--_0x130e2c){_0x26ac27['push'](_0x26ac27['shift']());}};_0x44a599(++_0x574b86);}(_0xe43c,0x180));var _0xce43=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe43c[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xce43('0x0'));module[_0xce43('0x1')]={'question':{'type':Sequelize[_0xce43('0x2')]},'answer':{'type':Sequelize[_0xce43('0x3')](_0xce43('0x4'))},'membername':{'type':Sequelize[_0xce43('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xce43('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xce43('0x2')]},'calleridnum':{'type':Sequelize[_0xce43('0x2')]},'questionId':{'type':Sequelize[_0xce43('0x2')]}}; \ No newline at end of file +var _0x41bb=['STRING','sequelize','exports','TEXT'];(function(_0x400104,_0x47783b){var _0x32ca4b=function(_0x1b0c12){while(--_0x1b0c12){_0x400104['push'](_0x400104['shift']());}};_0x32ca4b(++_0x47783b);}(_0x41bb,0xc5));var _0xb41b=function(_0x3873e6,_0x2301eb){_0x3873e6=_0x3873e6-0x0;var _0x41f611=_0x41bb[_0x3873e6];return _0x41f611;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xb41b('0x2')]('long')},'membername':{'type':Sequelize[_0xb41b('0x3')]},'projectname':{'type':Sequelize[_0xb41b('0x3')]},'queue':{'type':Sequelize[_0xb41b('0x3')]},'uniqueid':{'type':Sequelize[_0xb41b('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb41b('0x3')]},'questionId':{'type':Sequelize[_0xb41b('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 9b0517e..d68d8ab 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 _0xbffb=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','field','count','includeAll','include','findAll','catch','show','length','options','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','apply','save','update','destroy','then','sendStatus','error','send','index','JscriptyAnswerReport','rawAttributes','keys','query','intersection','model','fields'];(function(_0x167914,_0x87b5a){var _0x5e5d79=function(_0x221d4e){while(--_0x221d4e){_0x167914['push'](_0x167914['shift']());}};_0x5e5d79(++_0x87b5a);}(_0xbffb,0x1b7));var _0xbbff=function(_0x7a2a2f,_0x26057a){_0x7a2a2f=_0x7a2a2f-0x0;var _0x4fbb2a=_0xbffb[_0x7a2a2f];return _0x4fbb2a;};'use strict';var pdf=require(_0xbbff('0x0'));var emlformat=require(_0xbbff('0x1'));var rimraf=require(_0xbbff('0x2'));var zipdir=require(_0xbbff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbff('0x4'));var moment=require('moment');var BPromise=require(_0xbbff('0x5'));var Mustache=require(_0xbbff('0x6'));var util=require(_0xbbff('0x7'));var path=require(_0xbbff('0x8'));var sox=require(_0xbbff('0x9'));var csv=require('to-csv');var ejs=require(_0xbbff('0xa'));var fs=require('fs');var _=require(_0xbbff('0xb'));var squel=require(_0xbbff('0xc'));var crypto=require(_0xbbff('0xd'));var jsforce=require(_0xbbff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbbff('0xf'));var querystring=require(_0xbbff('0x10'));var Papa=require(_0xbbff('0x11'));var Redis=require('ioredis');var authService=require(_0xbbff('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbff('0x13'))(_0xbbff('0x14'));var utils=require(_0xbbff('0x15'));var config=require(_0xbbff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x104385,_0x37a24f){_0x37a24f=_0x37a24f||0xcc;return function(_0x280a34){if(_0x280a34){return _0x104385['sendStatus'](_0x37a24f);}return _0x104385[_0xbbff('0x17')](_0x37a24f)[_0xbbff('0x18')]();};}function respondWithResult(_0x577f5d,_0x5c8cf5){_0x5c8cf5=_0x5c8cf5||0xc8;return function(_0x226cd3){if(_0x226cd3){return _0x577f5d['status'](_0x5c8cf5)[_0xbbff('0x19')](_0x226cd3);}};}function respondWithFilteredResult(_0x5607fe,_0x34dd31){return function(_0x2eae71){if(_0x2eae71){var _0x117a56=_0x2eae71['count'],_0x874ff8=_0x34dd31[_0xbbff('0x1a')],_0x5ba84b=_0x34dd31[_0xbbff('0x1a')]+_0x34dd31[_0xbbff('0x1b')],_0x27a08d;if(_0x5ba84b>=_0x117a56){_0x5ba84b=_0x117a56;_0x27a08d=0xc8;}else{_0x27a08d=0xce;}_0x5607fe[_0xbbff('0x17')](_0x27a08d);return _0x5607fe['set']('Content-Range',_0x874ff8+'-'+_0x5ba84b+'/'+_0x117a56)[_0xbbff('0x19')](_0x2eae71);}return null;};}function patchUpdates(_0x4f5f11){return function(_0x563699){try{jsonpatch[_0xbbff('0x1c')](_0x563699,_0x4f5f11,!![]);}catch(_0x5e3c59){return BPromise['reject'](_0x5e3c59);}return _0x563699[_0xbbff('0x1d')]();};}function saveUpdates(_0x4e1a81,_0x393dd8){return function(_0x31f18b){if(_0x31f18b){return _0x31f18b[_0xbbff('0x1e')](_0x4e1a81)['then'](function(_0x19fedb){return _0x19fedb;});}return null;};}function removeEntity(_0x576865,_0x3d7745){return function(_0x282389){if(_0x282389){return _0x282389[_0xbbff('0x1f')]()[_0xbbff('0x20')](function(){_0x576865[_0xbbff('0x17')](0xcc)[_0xbbff('0x18')]();});}};}function handleEntityNotFound(_0x3de828,_0x3ce922){return function(_0x523dc5){if(!_0x523dc5){_0x3de828[_0xbbff('0x21')](0x194);}return _0x523dc5;};}function handleError(_0x2e4a90,_0x3b1d68){_0x3b1d68=_0x3b1d68||0x1f4;return function(_0x1a1e94){logger[_0xbbff('0x22')](_0x1a1e94['stack']);if(_0x1a1e94['name']){delete _0x1a1e94['name'];}_0x2e4a90[_0xbbff('0x17')](_0x3b1d68)[_0xbbff('0x23')](_0x1a1e94);};}exports[_0xbbff('0x24')]=function(_0x58b65f,_0x3d1239){var _0xb95a76={},_0x2a85c8={},_0x5d3e38={'count':0x0,'rows':[]};var _0x3e5ab4=db[_0xbbff('0x25')][_0xbbff('0x26')];_0x2a85c8['model']=_[_0xbbff('0x27')](_0x3e5ab4);_0x2a85c8[_0xbbff('0x28')]=_[_0xbbff('0x27')](_0x58b65f[_0xbbff('0x28')]);_0x2a85c8['filters']=_[_0xbbff('0x29')](_0x2a85c8[_0xbbff('0x2a')],_0x2a85c8[_0xbbff('0x28')]);_0xb95a76['attributes']=_[_0xbbff('0x29')](_0x2a85c8[_0xbbff('0x2a')],qs[_0xbbff('0x2b')](_0x58b65f[_0xbbff('0x28')][_0xbbff('0x2b')]));_0xb95a76[_0xbbff('0x2c')]=_0xb95a76['attributes']['length']?_0xb95a76['attributes']:_0x2a85c8[_0xbbff('0x2a')];if(!_0x58b65f[_0xbbff('0x28')][_0xbbff('0x2d')](_0xbbff('0x2e'))){_0xb95a76[_0xbbff('0x1b')]=qs[_0xbbff('0x1b')](_0x58b65f[_0xbbff('0x28')][_0xbbff('0x1b')]);_0xb95a76[_0xbbff('0x1a')]=qs[_0xbbff('0x1a')](_0x58b65f[_0xbbff('0x28')][_0xbbff('0x1a')]);}_0xb95a76[_0xbbff('0x2f')]=qs[_0xbbff('0x30')](_0x58b65f['query'][_0xbbff('0x30')]);_0xb95a76[_0xbbff('0x31')]=qs['filters'](_[_0xbbff('0x32')](_0x58b65f[_0xbbff('0x28')],_0x2a85c8[_0xbbff('0x33')]));if(_0x58b65f[_0xbbff('0x28')][_0xbbff('0x34')]){_0xb95a76['where']=_[_0xbbff('0x35')](_0xb95a76[_0xbbff('0x31')],{'$or':_[_0xbbff('0x36')](_0x3e5ab4,function(_0x37d838){if(_0x37d838['type'][_0xbbff('0x37')]!=='VIRTUAL'){var _0x252a81={};_0x252a81[_0x37d838[_0xbbff('0x38')]]={'$like':'%'+_0x58b65f[_0xbbff('0x28')]['filter']+'%'};return _0x252a81;}})});}_0xb95a76=_[_0xbbff('0x35')]({},_0xb95a76,_0x58b65f['options']);var _0xf954eb={'where':_0xb95a76[_0xbbff('0x31')]};return db['JscriptyAnswerReport'][_0xbbff('0x39')](_0xf954eb)[_0xbbff('0x20')](function(_0x504e19){_0x5d3e38[_0xbbff('0x39')]=_0x504e19;if(_0x58b65f[_0xbbff('0x28')][_0xbbff('0x3a')]){_0xb95a76[_0xbbff('0x3b')]=[{'all':!![]}];}return db[_0xbbff('0x25')][_0xbbff('0x3c')](_0xb95a76);})[_0xbbff('0x20')](function(_0x4e62c3){_0x5d3e38['rows']=_0x4e62c3;return _0x5d3e38;})[_0xbbff('0x20')](respondWithFilteredResult(_0x3d1239,_0xb95a76))[_0xbbff('0x3d')](handleError(_0x3d1239,null));};exports[_0xbbff('0x3e')]=function(_0x31470f,_0x52db77){var _0x2190ab={'raw':!![],'where':{'id':_0x31470f['params']['id']}},_0x381b8e={};_0x381b8e[_0xbbff('0x2a')]=_['keys'](db[_0xbbff('0x25')][_0xbbff('0x26')]);_0x381b8e[_0xbbff('0x28')]=_[_0xbbff('0x27')](_0x31470f[_0xbbff('0x28')]);_0x381b8e[_0xbbff('0x33')]=_[_0xbbff('0x29')](_0x381b8e[_0xbbff('0x2a')],_0x381b8e[_0xbbff('0x28')]);_0x2190ab[_0xbbff('0x2c')]=_[_0xbbff('0x29')](_0x381b8e[_0xbbff('0x2a')],qs['fields'](_0x31470f[_0xbbff('0x28')]['fields']));_0x2190ab[_0xbbff('0x2c')]=_0x2190ab[_0xbbff('0x2c')][_0xbbff('0x3f')]?_0x2190ab[_0xbbff('0x2c')]:_0x381b8e['model'];if(_0x31470f['query']['includeAll']){_0x2190ab[_0xbbff('0x3b')]=[{'all':!![]}];}_0x2190ab=_[_0xbbff('0x35')]({},_0x2190ab,_0x31470f[_0xbbff('0x40')]);return db[_0xbbff('0x25')][_0xbbff('0x41')](_0x2190ab)[_0xbbff('0x20')](handleEntityNotFound(_0x52db77,null))[_0xbbff('0x20')](respondWithResult(_0x52db77,null))[_0xbbff('0x3d')](handleError(_0x52db77,null));};exports['create']=function(_0x762000,_0x106c9e){return db['JscriptyAnswerReport']['create'](_0x762000[_0xbbff('0x42')],{})[_0xbbff('0x20')](respondWithResult(_0x106c9e,0xc9))[_0xbbff('0x3d')](handleError(_0x106c9e,null));};exports['update']=function(_0x5bfe7b,_0x2c76be){if(_0x5bfe7b[_0xbbff('0x42')]['id']){delete _0x5bfe7b['body']['id'];}return db[_0xbbff('0x25')][_0xbbff('0x41')]({'where':{'id':_0x5bfe7b[_0xbbff('0x43')]['id']}})[_0xbbff('0x20')](handleEntityNotFound(_0x2c76be,null))[_0xbbff('0x20')](saveUpdates(_0x5bfe7b[_0xbbff('0x42')],null))[_0xbbff('0x20')](respondWithResult(_0x2c76be,null))[_0xbbff('0x3d')](handleError(_0x2c76be,null));};exports[_0xbbff('0x1f')]=function(_0x143ddb,_0x35df3d){return db[_0xbbff('0x25')][_0xbbff('0x41')]({'where':{'id':_0x143ddb[_0xbbff('0x43')]['id']}})[_0xbbff('0x20')](handleEntityNotFound(_0x35df3d,null))[_0xbbff('0x20')](removeEntity(_0x35df3d,null))['catch'](handleError(_0x35df3d,null));};exports[_0xbbff('0x44')]=function(_0x2eade5,_0x4e64cd){return db['JscriptyAnswerReport'][_0xbbff('0x44')]()[_0xbbff('0x20')](respondWithResult(_0x4e64cd,null))[_0xbbff('0x3d')](handleError(_0x4e64cd,null));}; \ No newline at end of file +var _0x5ff8=['update','then','error','name','send','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','key','VIRTUAL','field','filter','options','include','rows','catch','show','includeAll','create','body','find','destroy','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save'];(function(_0x5566d8,_0x7316f2){var _0x257236=function(_0x2cb254){while(--_0x2cb254){_0x5566d8['push'](_0x5566d8['shift']());}};_0x257236(++_0x7316f2);}(_0x5ff8,0x13e));var _0x85ff=function(_0xb9b56,_0xca9793){_0xb9b56=_0xb9b56-0x0;var _0x33869c=_0x5ff8[_0xb9b56];return _0x33869c;};'use strict';var pdf=require(_0x85ff('0x0'));var emlformat=require(_0x85ff('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x85ff('0x2'));var rp=require(_0x85ff('0x3'));var moment=require(_0x85ff('0x4'));var BPromise=require(_0x85ff('0x5'));var Mustache=require('mustache');var util=require(_0x85ff('0x6'));var path=require(_0x85ff('0x7'));var sox=require('sox');var csv=require(_0x85ff('0x8'));var ejs=require(_0x85ff('0x9'));var fs=require('fs');var _=require(_0x85ff('0xa'));var squel=require('squel');var crypto=require(_0x85ff('0xb'));var jsforce=require(_0x85ff('0xc'));var deskjs=require(_0x85ff('0xd'));var toCsv=require(_0x85ff('0x8'));var querystring=require(_0x85ff('0xe'));var Papa=require('papaparse');var Redis=require(_0x85ff('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x85ff('0x10'));var hardwareService=require(_0x85ff('0x11'));var logger=require(_0x85ff('0x12'))('api');var utils=require(_0x85ff('0x13'));var config=require(_0x85ff('0x14'));var db=require(_0x85ff('0x15'))['db'];function respondWithStatusCode(_0x1faece,_0x2c717a){_0x2c717a=_0x2c717a||0xcc;return function(_0x5c796c){if(_0x5c796c){return _0x1faece[_0x85ff('0x16')](_0x2c717a);}return _0x1faece[_0x85ff('0x17')](_0x2c717a)[_0x85ff('0x18')]();};}function respondWithResult(_0x4c3352,_0x2dca28){_0x2dca28=_0x2dca28||0xc8;return function(_0x5249b6){if(_0x5249b6){return _0x4c3352['status'](_0x2dca28)['json'](_0x5249b6);}};}function respondWithFilteredResult(_0x2f0e18,_0x248821){return function(_0x221cb9){if(_0x221cb9){var _0x46c064=_0x221cb9[_0x85ff('0x19')],_0xafc2af=_0x248821[_0x85ff('0x1a')],_0x5d3900=_0x248821[_0x85ff('0x1a')]+_0x248821[_0x85ff('0x1b')],_0x36985b;if(_0x5d3900>=_0x46c064){_0x5d3900=_0x46c064;_0x36985b=0xc8;}else{_0x36985b=0xce;}_0x2f0e18[_0x85ff('0x17')](_0x36985b);return _0x2f0e18[_0x85ff('0x1c')](_0x85ff('0x1d'),_0xafc2af+'-'+_0x5d3900+'/'+_0x46c064)['json'](_0x221cb9);}return null;};}function patchUpdates(_0x4a667f){return function(_0x263317){try{jsonpatch[_0x85ff('0x1e')](_0x263317,_0x4a667f,!![]);}catch(_0x43ef80){return BPromise['reject'](_0x43ef80);}return _0x263317[_0x85ff('0x1f')]();};}function saveUpdates(_0x519784,_0x289bce){return function(_0x113de6){if(_0x113de6){return _0x113de6[_0x85ff('0x20')](_0x519784)['then'](function(_0x24b76a){return _0x24b76a;});}return null;};}function removeEntity(_0x4e3ec6,_0x4436dc){return function(_0x2d99f3){if(_0x2d99f3){return _0x2d99f3['destroy']()[_0x85ff('0x21')](function(){_0x4e3ec6[_0x85ff('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e360,_0x53a10b){return function(_0x2de4a1){if(!_0x2de4a1){_0x29e360[_0x85ff('0x16')](0x194);}return _0x2de4a1;};}function handleError(_0x37bfb8,_0x1912a1){_0x1912a1=_0x1912a1||0x1f4;return function(_0x11f404){logger[_0x85ff('0x22')](_0x11f404['stack']);if(_0x11f404[_0x85ff('0x23')]){delete _0x11f404[_0x85ff('0x23')];}_0x37bfb8['status'](_0x1912a1)[_0x85ff('0x24')](_0x11f404);};}exports['index']=function(_0x342792,_0x2b86f3){var _0x3ee905={},_0x2e39e3={},_0x2f22e6={'count':0x0,'rows':[]};var _0x2fe948=db[_0x85ff('0x25')][_0x85ff('0x26')];_0x2e39e3[_0x85ff('0x27')]=_[_0x85ff('0x28')](_0x2fe948);_0x2e39e3[_0x85ff('0x29')]=_[_0x85ff('0x28')](_0x342792['query']);_0x2e39e3[_0x85ff('0x2a')]=_['intersection'](_0x2e39e3['model'],_0x2e39e3[_0x85ff('0x29')]);_0x3ee905[_0x85ff('0x2b')]=_[_0x85ff('0x2c')](_0x2e39e3[_0x85ff('0x27')],qs[_0x85ff('0x2d')](_0x342792[_0x85ff('0x29')][_0x85ff('0x2d')]));_0x3ee905['attributes']=_0x3ee905[_0x85ff('0x2b')][_0x85ff('0x2e')]?_0x3ee905[_0x85ff('0x2b')]:_0x2e39e3[_0x85ff('0x27')];if(!_0x342792[_0x85ff('0x29')][_0x85ff('0x2f')](_0x85ff('0x30'))){_0x3ee905['limit']=qs['limit'](_0x342792[_0x85ff('0x29')][_0x85ff('0x1b')]);_0x3ee905[_0x85ff('0x1a')]=qs[_0x85ff('0x1a')](_0x342792[_0x85ff('0x29')][_0x85ff('0x1a')]);}_0x3ee905['order']=qs['sort'](_0x342792[_0x85ff('0x29')][_0x85ff('0x31')]);_0x3ee905['where']=qs[_0x85ff('0x2a')](_[_0x85ff('0x32')](_0x342792[_0x85ff('0x29')],_0x2e39e3[_0x85ff('0x2a')]));if(_0x342792['query']['filter']){_0x3ee905[_0x85ff('0x33')]=_[_0x85ff('0x34')](_0x3ee905['where'],{'$or':_[_0x85ff('0x35')](_0x2fe948,function(_0x3111cc){if(_0x3111cc['type'][_0x85ff('0x36')]!==_0x85ff('0x37')){var _0x508487={};_0x508487[_0x3111cc[_0x85ff('0x38')]]={'$like':'%'+_0x342792[_0x85ff('0x29')][_0x85ff('0x39')]+'%'};return _0x508487;}})});}_0x3ee905=_[_0x85ff('0x34')]({},_0x3ee905,_0x342792[_0x85ff('0x3a')]);var _0x5c4b28={'where':_0x3ee905[_0x85ff('0x33')]};return db['JscriptyAnswerReport'][_0x85ff('0x19')](_0x5c4b28)[_0x85ff('0x21')](function(_0x5c8fb1){_0x2f22e6[_0x85ff('0x19')]=_0x5c8fb1;if(_0x342792['query']['includeAll']){_0x3ee905[_0x85ff('0x3b')]=[{'all':!![]}];}return db[_0x85ff('0x25')]['findAll'](_0x3ee905);})[_0x85ff('0x21')](function(_0x326edc){_0x2f22e6[_0x85ff('0x3c')]=_0x326edc;return _0x2f22e6;})[_0x85ff('0x21')](respondWithFilteredResult(_0x2b86f3,_0x3ee905))[_0x85ff('0x3d')](handleError(_0x2b86f3,null));};exports[_0x85ff('0x3e')]=function(_0x2db609,_0x1430d4){var _0x2cecd4={'raw':!![],'where':{'id':_0x2db609['params']['id']}},_0x3002a7={};_0x3002a7[_0x85ff('0x27')]=_['keys'](db[_0x85ff('0x25')][_0x85ff('0x26')]);_0x3002a7[_0x85ff('0x29')]=_['keys'](_0x2db609[_0x85ff('0x29')]);_0x3002a7['filters']=_[_0x85ff('0x2c')](_0x3002a7[_0x85ff('0x27')],_0x3002a7[_0x85ff('0x29')]);_0x2cecd4[_0x85ff('0x2b')]=_['intersection'](_0x3002a7['model'],qs['fields'](_0x2db609[_0x85ff('0x29')][_0x85ff('0x2d')]));_0x2cecd4['attributes']=_0x2cecd4['attributes'][_0x85ff('0x2e')]?_0x2cecd4[_0x85ff('0x2b')]:_0x3002a7[_0x85ff('0x27')];if(_0x2db609[_0x85ff('0x29')][_0x85ff('0x3f')]){_0x2cecd4['include']=[{'all':!![]}];}_0x2cecd4=_[_0x85ff('0x34')]({},_0x2cecd4,_0x2db609[_0x85ff('0x3a')]);return db['JscriptyAnswerReport']['find'](_0x2cecd4)[_0x85ff('0x21')](handleEntityNotFound(_0x1430d4,null))[_0x85ff('0x21')](respondWithResult(_0x1430d4,null))[_0x85ff('0x3d')](handleError(_0x1430d4,null));};exports[_0x85ff('0x40')]=function(_0x2b0b5d,_0x3fc63c){return db[_0x85ff('0x25')]['create'](_0x2b0b5d[_0x85ff('0x41')],{})[_0x85ff('0x21')](respondWithResult(_0x3fc63c,0xc9))[_0x85ff('0x3d')](handleError(_0x3fc63c,null));};exports[_0x85ff('0x20')]=function(_0x4bf068,_0x3afe08){if(_0x4bf068[_0x85ff('0x41')]['id']){delete _0x4bf068[_0x85ff('0x41')]['id'];}return db[_0x85ff('0x25')][_0x85ff('0x42')]({'where':{'id':_0x4bf068['params']['id']}})[_0x85ff('0x21')](handleEntityNotFound(_0x3afe08,null))['then'](saveUpdates(_0x4bf068[_0x85ff('0x41')],null))['then'](respondWithResult(_0x3afe08,null))[_0x85ff('0x3d')](handleError(_0x3afe08,null));};exports[_0x85ff('0x43')]=function(_0x53e092,_0x112eec){return db[_0x85ff('0x25')][_0x85ff('0x42')]({'where':{'id':_0x53e092[_0x85ff('0x44')]['id']}})[_0x85ff('0x21')](handleEntityNotFound(_0x112eec,null))[_0x85ff('0x21')](removeEntity(_0x112eec,null))[_0x85ff('0x3d')](handleError(_0x112eec,null));};exports[_0x85ff('0x45')]=function(_0x79b06b,_0x3c5e2e){return db[_0x85ff('0x25')][_0x85ff('0x45')]()['then'](respondWithResult(_0x3c5e2e,null))[_0x85ff('0x3d')](handleError(_0x3c5e2e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 25c9ac9..36938e6 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 _0x6b4c=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x48fd78,_0x4b9f37){var _0x1b95b1=function(_0x449a44){while(--_0x449a44){_0x48fd78['push'](_0x48fd78['shift']());}};_0x1b95b1(++_0x4b9f37);}(_0x6b4c,0x117));var _0xc6b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b4c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6b4('0x0'));var util=require(_0xc6b4('0x1'));var logger=require(_0xc6b4('0x2'))(_0xc6b4('0x3'));var moment=require(_0xc6b4('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6b4('0x5'));var fs=require('fs');var path=require(_0xc6b4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6b4('0x7'));module[_0xc6b4('0x8')]=function(_0x169366,_0x327ced){return _0x169366['define'](_0xc6b4('0x9'),attributes,{'tableName':_0xc6b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6024=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0x6024,0x78));var _0x4602=function(_0x31b5e7,_0x30aab9){_0x31b5e7=_0x31b5e7-0x0;var _0x314239=_0x6024[_0x31b5e7];return _0x314239;};'use strict';var _=require(_0x4602('0x0'));var util=require(_0x4602('0x1'));var logger=require('../../config/logger')(_0x4602('0x2'));var moment=require(_0x4602('0x3'));var BPromise=require(_0x4602('0x4'));var rp=require(_0x4602('0x5'));var fs=require('fs');var path=require(_0x4602('0x6'));var rimraf=require(_0x4602('0x7'));var config=require('../../config/environment');var attributes=require(_0x4602('0x8'));module['exports']=function(_0x39876c,_0x24fccb){return _0x39876c[_0x4602('0x9')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ca8c21c..71eb97e 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 _0xdb35=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x2ef5b8,_0x4c913b){var _0x18bff1=function(_0x5d89b5){while(--_0x5d89b5){_0x2ef5b8['push'](_0x2ef5b8['shift']());}};_0x18bff1(++_0x4c913b);}(_0xdb35,0x8f));var _0x5db3=function(_0x3dd174,_0x31fcf6){_0x3dd174=_0x3dd174-0x0;var _0x2d0e06=_0xdb35[_0x3dd174];return _0x2d0e06;};'use strict';var _=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5db3('0x2'));var fs=require('fs');var Redis=require(_0x5db3('0x3'));var db=require(_0x5db3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5db3('0x5'))(_0x5db3('0x6'));var config=require('../../config/environment');var jayson=require(_0x5db3('0x7'));var client=jayson[_0x5db3('0x8')][_0x5db3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e74e3,_0x107975,_0x20c1a1){return new BPromise(function(_0x2b0400,_0xfa65d){return client[_0x5db3('0xa')](_0x3e74e3,_0x20c1a1)[_0x5db3('0xb')](function(_0x8d846f){logger[_0x5db3('0xc')](_0x5db3('0xd'),_0x107975,'request\x20sent');logger['debug'](_0x5db3('0xe'),_0x107975,_0x5db3('0xf'),JSON[_0x5db3('0x10')](_0x8d846f));if(_0x8d846f[_0x5db3('0x11')]){if(_0x8d846f[_0x5db3('0x11')][_0x5db3('0x12')]===0x1f4){logger['error'](_0x5db3('0xd'),_0x107975,_0x8d846f[_0x5db3('0x11')][_0x5db3('0x13')]);return _0xfa65d(_0x8d846f[_0x5db3('0x11')]['message']);}logger[_0x5db3('0x11')](_0x5db3('0xd'),_0x107975,_0x8d846f[_0x5db3('0x11')][_0x5db3('0x13')]);return _0x2b0400(_0x8d846f['error'][_0x5db3('0x13')]);}else{logger[_0x5db3('0xc')](_0x5db3('0xd'),_0x107975,_0x5db3('0xf'));_0x2b0400(_0x8d846f['result']['message']);}})[_0x5db3('0x14')](function(_0x2a9182){logger[_0x5db3('0x11')](_0x5db3('0xd'),_0x107975,_0x2a9182);_0xfa65d(_0x2a9182);});});} \ No newline at end of file +var _0x1611=['then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x1611,0xb9));var _0x1161=function(_0x2c1309,_0x4c608d){_0x2c1309=_0x2c1309-0x0;var _0x1ebd41=_0x1611[_0x2c1309];return _0x1ebd41;};'use strict';var _=require(_0x1161('0x0'));var util=require(_0x1161('0x1'));var moment=require(_0x1161('0x2'));var BPromise=require(_0x1161('0x3'));var rs=require(_0x1161('0x4'));var fs=require('fs');var Redis=require(_0x1161('0x5'));var db=require(_0x1161('0x6'))['db'];var utils=require(_0x1161('0x7'));var logger=require(_0x1161('0x8'))(_0x1161('0x9'));var config=require('../../config/environment');var jayson=require(_0x1161('0xa'));var client=jayson['client'][_0x1161('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf5f3ee,_0x12fb93,_0x532ca2){return new BPromise(function(_0x45c385,_0xd8b329){return client[_0x1161('0xc')](_0xf5f3ee,_0x532ca2)[_0x1161('0xd')](function(_0x5a9fb9){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x12fb93,_0x1161('0xe'));logger[_0x1161('0xf')](_0x1161('0x10'),_0x12fb93,_0x1161('0xe'),JSON['stringify'](_0x5a9fb9));if(_0x5a9fb9[_0x1161('0x11')]){if(_0x5a9fb9['error'][_0x1161('0x12')]===0x1f4){logger['error'](_0x1161('0x13'),_0x12fb93,_0x5a9fb9[_0x1161('0x11')]['message']);return _0xd8b329(_0x5a9fb9[_0x1161('0x11')][_0x1161('0x14')]);}logger[_0x1161('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x12fb93,_0x5a9fb9[_0x1161('0x11')][_0x1161('0x14')]);return _0x45c385(_0x5a9fb9[_0x1161('0x11')]['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x12fb93,'request\x20sent');_0x45c385(_0x5a9fb9['result'][_0x1161('0x14')]);}})[_0x1161('0x15')](function(_0x3c9cff){logger[_0x1161('0x11')](_0x1161('0x13'),_0x12fb93,_0x3c9cff);_0xd8b329(_0x3c9cff);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 58757d9..6d77f31 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 _0x703c=['index','/:id','show','/:id/sessions','getSessions','/:id/summary','30s','getSummary','post','create','clone','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x31bd6a,_0x19a326){var _0xa747ed=function(_0x380705){while(--_0x380705){_0x31bd6a['push'](_0x31bd6a['shift']());}};_0xa747ed(++_0x19a326);}(_0x703c,0x19e));var _0xc703=function(_0x1fba2a,_0x388738){_0x1fba2a=_0x1fba2a-0x0;var _0x1be278=_0x703c[_0x1fba2a];return _0x1be278;};'use strict';var multer=require(_0xc703('0x0'));var util=require('util');var path=require(_0xc703('0x1'));var timeout=require(_0xc703('0x2'));var express=require(_0xc703('0x3'));var router=express[_0xc703('0x4')]();var auth=require(_0xc703('0x5'));var interaction=require(_0xc703('0x6'));var config=require(_0xc703('0x7'));var controller=require(_0xc703('0x8'));router[_0xc703('0x9')]('/',auth[_0xc703('0xa')](),controller[_0xc703('0xb')]);router[_0xc703('0x9')](_0xc703('0xc'),auth[_0xc703('0xa')](),controller[_0xc703('0xd')]);router['get'](_0xc703('0xe'),auth[_0xc703('0xa')](),controller[_0xc703('0xf')]);router[_0xc703('0x9')]('/:id/answers',auth[_0xc703('0xa')](),controller['getAnswers']);router[_0xc703('0x9')](_0xc703('0x10'),auth[_0xc703('0xa')](),timeout(_0xc703('0x11')),controller[_0xc703('0x12')]);router[_0xc703('0x13')]('/',auth[_0xc703('0xa')](),controller[_0xc703('0x14')]);router[_0xc703('0x13')]('/:id/clone',auth[_0xc703('0xa')](),controller[_0xc703('0x15')]);router[_0xc703('0x16')]('/:id',auth[_0xc703('0xa')](),controller['update']);router[_0xc703('0x17')]('/:id',auth[_0xc703('0xa')](),controller[_0xc703('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9809=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/answers','30s','getSummary','post','create','/:id/clone','clone','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9809,0x1b2));var _0x9980=function(_0xce3972,_0x2eddd9){_0xce3972=_0xce3972-0x0;var _0xbf008c=_0x9809[_0xce3972];return _0xbf008c;};'use strict';var multer=require(_0x9980('0x0'));var util=require(_0x9980('0x1'));var path=require(_0x9980('0x2'));var timeout=require(_0x9980('0x3'));var express=require('express');var router=express[_0x9980('0x4')]();var auth=require(_0x9980('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9980('0x6'));var controller=require(_0x9980('0x7'));router[_0x9980('0x8')]('/',auth[_0x9980('0x9')](),controller[_0x9980('0xa')]);router[_0x9980('0x8')](_0x9980('0xb'),auth[_0x9980('0x9')](),controller[_0x9980('0xc')]);router['get']('/:id/sessions',auth[_0x9980('0x9')](),controller['getSessions']);router[_0x9980('0x8')](_0x9980('0xd'),auth[_0x9980('0x9')](),controller['getAnswers']);router[_0x9980('0x8')]('/:id/summary',auth[_0x9980('0x9')](),timeout(_0x9980('0xe')),controller[_0x9980('0xf')]);router[_0x9980('0x10')]('/',auth[_0x9980('0x9')](),controller[_0x9980('0x11')]);router['post'](_0x9980('0x12'),auth['isAuthenticated'](),controller[_0x9980('0x13')]);router['put']('/:id',auth[_0x9980('0x9')](),controller[_0x9980('0x14')]);router[_0x9980('0x15')](_0x9980('0xb'),auth['isAuthenticated'](),controller[_0x9980('0x16')]);module[_0x9980('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index ff4bcbd..e5857aa 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 _0xa800=['isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long'];(function(_0x3d8888,_0x3bd9b8){var _0x26aa9e=function(_0x48b85c){while(--_0x48b85c){_0x3d8888['push'](_0x3d8888['shift']());}};_0x26aa9e(++_0x3bd9b8);}(_0xa800,0xa9));var _0x0a80=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0xa800[_0x40e854];return _0x1463b3;};'use strict';var Sequelize=require(_0x0a80('0x0'));var _=require(_0x0a80('0x1'));var util=require(_0x0a80('0x2'));module[_0x0a80('0x3')]={'name':{'type':Sequelize[_0x0a80('0x4')],'unique':_0x0a80('0x5')},'description':{'type':Sequelize[_0x0a80('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x0a80('0x6')),'set':function(_0x35b0d3){if(_[_0x0a80('0x7')](_0x35b0d3)){this['setDataValue'](_0x0a80('0x8'),JSON[_0x0a80('0x9')](_0x35b0d3));}else if(_[_0x0a80('0xa')](_0x35b0d3)){this[_0x0a80('0xb')](_0x0a80('0x8'),_0x35b0d3);}else{this['setDataValue']('formData',util[_0x0a80('0xc')](_0x0a80('0xd'),this['getDataValue']('name')||'',this[_0x0a80('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0a80('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3524=['BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x409642,_0x4e2230){var _0x1a88e1=function(_0x201cf5){while(--_0x201cf5){_0x409642['push'](_0x409642['shift']());}};_0x1a88e1(++_0x4e2230);}(_0x3524,0x1dd));var _0x4352=function(_0x5eb2a2,_0x5dd2fc){_0x5eb2a2=_0x5eb2a2-0x0;var _0x41d77c=_0x3524[_0x5eb2a2];return _0x41d77c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4352('0x0'));var util=require(_0x4352('0x1'));module[_0x4352('0x2')]={'name':{'type':Sequelize[_0x4352('0x3')],'unique':_0x4352('0x4')},'description':{'type':Sequelize[_0x4352('0x3')]},'formData':{'type':Sequelize[_0x4352('0x5')](_0x4352('0x6')),'set':function(_0x494c23){if(_[_0x4352('0x7')](_0x494c23)){this[_0x4352('0x8')]('formData',JSON[_0x4352('0x9')](_0x494c23));}else if(_[_0x4352('0xa')](_0x494c23)){this[_0x4352('0x8')](_0x4352('0xb'),_0x494c23);}else{this[_0x4352('0x8')](_0x4352('0xb'),util[_0x4352('0xc')](_0x4352('0xd'),this['getDataValue']('name')||'',this[_0x4352('0xe')](_0x4352('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4352('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e0dc2ce..21cace0 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 _0x8313=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','include','JscriptyProject','findAll','catch','show','params','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','rows','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','rawAttributes','model','query','filters'];(function(_0x2322ca,_0x481956){var _0x816402=function(_0x4a2069){while(--_0x4a2069){_0x2322ca['push'](_0x2322ca['shift']());}};_0x816402(++_0x481956);}(_0x8313,0x19e));var _0x3831=function(_0x1407cf,_0x28ede8){_0x1407cf=_0x1407cf-0x0;var _0x52093b=_0x8313[_0x1407cf];return _0x52093b;};'use strict';var pdf=require(_0x3831('0x0'));var emlformat=require(_0x3831('0x1'));var rimraf=require(_0x3831('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3831('0x3'));var rp=require('request-promise');var moment=require(_0x3831('0x4'));var BPromise=require(_0x3831('0x5'));var Mustache=require(_0x3831('0x6'));var util=require(_0x3831('0x7'));var path=require(_0x3831('0x8'));var sox=require(_0x3831('0x9'));var csv=require(_0x3831('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3831('0xb'));var squel=require(_0x3831('0xc'));var crypto=require(_0x3831('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3831('0xa'));var querystring=require(_0x3831('0xe'));var Papa=require(_0x3831('0xf'));var Redis=require(_0x3831('0x10'));var authService=require(_0x3831('0x11'));var qs=require(_0x3831('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3831('0x13'))(_0x3831('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xacc2c7,_0x2cba98){_0x2cba98=_0x2cba98||0xcc;return function(_0x178c62){if(_0x178c62){return _0xacc2c7[_0x3831('0x15')](_0x2cba98);}return _0xacc2c7[_0x3831('0x16')](_0x2cba98)[_0x3831('0x17')]();};}function respondWithResult(_0x17e344,_0x3442f6){_0x3442f6=_0x3442f6||0xc8;return function(_0x3af9be){if(_0x3af9be){return _0x17e344[_0x3831('0x16')](_0x3442f6)[_0x3831('0x18')](_0x3af9be);}};}function respondWithFilteredResult(_0x1f4f33,_0x4658bb){return function(_0x11cabe){if(_0x11cabe){var _0x5d12ca=_0x11cabe['count'],_0x1df003=_0x4658bb[_0x3831('0x19')],_0x3b31a9=_0x4658bb[_0x3831('0x19')]+_0x4658bb[_0x3831('0x1a')],_0x1f8332;if(_0x3b31a9>=_0x5d12ca){_0x3b31a9=_0x5d12ca;_0x1f8332=0xc8;}else{_0x1f8332=0xce;}_0x1f4f33[_0x3831('0x16')](_0x1f8332);return _0x1f4f33[_0x3831('0x1b')]('Content-Range',_0x1df003+'-'+_0x3b31a9+'/'+_0x5d12ca)[_0x3831('0x18')](_0x11cabe);}return null;};}function patchUpdates(_0x1d2110){return function(_0xf52833){try{jsonpatch[_0x3831('0x1c')](_0xf52833,_0x1d2110,!![]);}catch(_0x4e1619){return BPromise[_0x3831('0x1d')](_0x4e1619);}return _0xf52833[_0x3831('0x1e')]();};}function saveUpdates(_0x31c338,_0x571151){return function(_0x11af0b){if(_0x11af0b){return _0x11af0b[_0x3831('0x1f')](_0x31c338)[_0x3831('0x20')](function(_0x435236){return _0x435236;});}return null;};}function removeEntity(_0xfe4523,_0x47b10f){return function(_0x5e9ab1){if(_0x5e9ab1){return _0x5e9ab1[_0x3831('0x21')]()[_0x3831('0x20')](function(){var _0x416d09=_0x5e9ab1[_0x3831('0x22')]({'plain':!![]});var _0x410072=_0x3831('0x23');return db[_0x3831('0x24')][_0x3831('0x21')]({'where':{'type':_0x410072,'resourceId':_0x416d09['id']}})[_0x3831('0x20')](function(){return _0x5e9ab1;});})[_0x3831('0x20')](function(){_0xfe4523['status'](0xcc)[_0x3831('0x17')]();});}};}function handleEntityNotFound(_0x294545,_0x57b1d4){return function(_0x5a89b0){if(!_0x5a89b0){_0x294545[_0x3831('0x15')](0x194);}return _0x5a89b0;};}function handleError(_0x4aafef,_0x2fdcdb){_0x2fdcdb=_0x2fdcdb||0x1f4;return function(_0x346479){logger[_0x3831('0x25')](_0x346479[_0x3831('0x26')]);if(_0x346479[_0x3831('0x27')]){delete _0x346479['name'];}_0x4aafef[_0x3831('0x16')](_0x2fdcdb)[_0x3831('0x28')](_0x346479);};}exports[_0x3831('0x29')]=function(_0x5750ea,_0x5a7fff){var _0x358723={},_0x264e5a={},_0x17a55b={'count':0x0,'rows':[]};var _0x7234f3=db['JscriptyProject'][_0x3831('0x2a')];_0x264e5a[_0x3831('0x2b')]=_['keys'](_0x7234f3);_0x264e5a[_0x3831('0x2c')]=_['keys'](_0x5750ea[_0x3831('0x2c')]);_0x264e5a[_0x3831('0x2d')]=_[_0x3831('0x2e')](_0x264e5a[_0x3831('0x2b')],_0x264e5a[_0x3831('0x2c')]);_0x358723['attributes']=_['intersection'](_0x264e5a[_0x3831('0x2b')],qs[_0x3831('0x2f')](_0x5750ea[_0x3831('0x2c')][_0x3831('0x2f')]));_0x358723[_0x3831('0x30')]=_0x358723[_0x3831('0x30')][_0x3831('0x31')]?_0x358723[_0x3831('0x30')]:_0x264e5a[_0x3831('0x2b')];if(!_0x5750ea[_0x3831('0x2c')][_0x3831('0x32')](_0x3831('0x33'))){_0x358723['limit']=qs[_0x3831('0x1a')](_0x5750ea[_0x3831('0x2c')][_0x3831('0x1a')]);_0x358723['offset']=qs[_0x3831('0x19')](_0x5750ea[_0x3831('0x2c')][_0x3831('0x19')]);}_0x358723[_0x3831('0x34')]=qs[_0x3831('0x35')](_0x5750ea['query'][_0x3831('0x35')]);_0x358723[_0x3831('0x36')]=qs[_0x3831('0x2d')](_[_0x3831('0x37')](_0x5750ea[_0x3831('0x2c')],_0x264e5a['filters']));if(_0x5750ea[_0x3831('0x2c')]['filter']){_0x358723['where']=_[_0x3831('0x38')](_0x358723[_0x3831('0x36')],{'$or':_[_0x3831('0x39')](_0x7234f3,function(_0x2c2aed){if(_0x2c2aed[_0x3831('0x3a')]['key']!==_0x3831('0x3b')){var _0x41d27c={};_0x41d27c[_0x2c2aed[_0x3831('0x3c')]]={'$like':'%'+_0x5750ea['query'][_0x3831('0x3d')]+'%'};return _0x41d27c;}})});}_0x358723=_['merge']({},_0x358723,_0x5750ea[_0x3831('0x3e')]);var _0x456258={'where':_0x358723[_0x3831('0x36')]};return db['JscriptyProject'][_0x3831('0x3f')](_0x456258)[_0x3831('0x20')](function(_0x5a4a36){_0x17a55b['count']=_0x5a4a36;if(_0x5750ea[_0x3831('0x2c')][_0x3831('0x40')]){_0x358723[_0x3831('0x41')]=[{'all':!![]}];}return db[_0x3831('0x42')][_0x3831('0x43')](_0x358723);})['then'](function(_0x25e9f9){_0x17a55b['rows']=_0x25e9f9;return _0x17a55b;})[_0x3831('0x20')](respondWithFilteredResult(_0x5a7fff,_0x358723))[_0x3831('0x44')](handleError(_0x5a7fff,null));};exports[_0x3831('0x45')]=function(_0x2b3370,_0x34c53e){var _0x3d168a={'raw':![],'where':{'id':_0x2b3370[_0x3831('0x46')]['id']}},_0x28149c={};_0x28149c[_0x3831('0x2b')]=_[_0x3831('0x47')](db[_0x3831('0x42')][_0x3831('0x2a')]);_0x28149c['query']=_[_0x3831('0x47')](_0x2b3370[_0x3831('0x2c')]);_0x28149c['filters']=_[_0x3831('0x2e')](_0x28149c[_0x3831('0x2b')],_0x28149c[_0x3831('0x2c')]);_0x3d168a[_0x3831('0x30')]=_[_0x3831('0x2e')](_0x28149c[_0x3831('0x2b')],qs[_0x3831('0x2f')](_0x2b3370[_0x3831('0x2c')][_0x3831('0x2f')]));_0x3d168a['attributes']=_0x3d168a[_0x3831('0x30')][_0x3831('0x31')]?_0x3d168a['attributes']:_0x28149c[_0x3831('0x2b')];if(_0x2b3370['query'][_0x3831('0x40')]){_0x3d168a[_0x3831('0x41')]=[{'all':!![]}];}_0x3d168a=_[_0x3831('0x38')]({},_0x3d168a,_0x2b3370[_0x3831('0x3e')]);return db[_0x3831('0x42')][_0x3831('0x48')](_0x3d168a)[_0x3831('0x20')](handleEntityNotFound(_0x34c53e,null))[_0x3831('0x20')](respondWithResult(_0x34c53e,null))[_0x3831('0x44')](handleError(_0x34c53e,null));};exports[_0x3831('0x49')]=function(_0x595bd7,_0x140859){return db[_0x3831('0x42')][_0x3831('0x49')](_0x595bd7['body'],{})[_0x3831('0x20')](function(_0xbf88e5){var _0x415d39=_0x595bd7[_0x3831('0x4a')][_0x3831('0x22')]({'plain':!![]});if(!_0x415d39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x415d39[_0x3831('0x4b')]==='user'){var _0x50282f=_0xbf88e5['get']({'plain':!![]});var _0x3dd30d=_0x3831('0x23');return db[_0x3831('0x4c')]['find']({'where':{'name':_0x3dd30d,'userProfileId':_0x415d39[_0x3831('0x4d')]},'raw':!![]})[_0x3831('0x20')](function(_0x4af8c8){if(_0x4af8c8&&_0x4af8c8[_0x3831('0x4e')]===0x0){return db[_0x3831('0x24')][_0x3831('0x49')]({'name':_0x50282f[_0x3831('0x27')],'resourceId':_0x50282f['id'],'type':_0x4af8c8[_0x3831('0x27')],'sectionId':_0x4af8c8['id']},{})[_0x3831('0x20')](function(){return _0xbf88e5;});}else{return _0xbf88e5;}})['catch'](function(_0x23ec07){logger['error'](_0x3831('0x4f'),_0x23ec07);throw _0x23ec07;});}return _0xbf88e5;})[_0x3831('0x20')](respondWithResult(_0x140859,0xc9))[_0x3831('0x44')](handleError(_0x140859,null));};exports[_0x3831('0x50')]=function(_0x4d2e21,_0x2598fa){var _0x464641={'raw':![],'where':{'id':_0x4d2e21[_0x3831('0x46')]['id']}},_0x212fae={};_0x212fae[_0x3831('0x2b')]=_[_0x3831('0x47')](db[_0x3831('0x42')][_0x3831('0x2a')]);_0x464641[_0x3831('0x30')]=_['intersection'](_0x212fae[_0x3831('0x2b')],qs[_0x3831('0x2f')](_0x4d2e21[_0x3831('0x2c')][_0x3831('0x2f')]));_0x464641[_0x3831('0x30')]=_0x464641[_0x3831('0x30')][_0x3831('0x31')]?_0x464641[_0x3831('0x30')]:_0x212fae[_0x3831('0x2b')];if(_0x4d2e21[_0x3831('0x2c')]['includeAll']){_0x464641[_0x3831('0x41')]=[{'all':!![]}];}_0x464641=_[_0x3831('0x38')]({},_0x464641,_0x4d2e21[_0x3831('0x3e')]);return db['JscriptyProject'][_0x3831('0x48')](_0x464641)[_0x3831('0x20')](handleEntityNotFound(_0x2598fa,null))[_0x3831('0x20')](function(_0x26c4ab){if(_0x26c4ab){var _0x5a313c=_0x26c4ab[_0x3831('0x22')]({'plain':!![]});_0x5a313c=qs['omit'](_0x5a313c,['id',_0x3831('0x51'),_0x3831('0x52')]);_0x4d2e21[_0x3831('0x53')]=_[_0x3831('0x54')](_0x4d2e21[_0x3831('0x53')],['id','createdAt',_0x3831('0x52')]);return db[_0x3831('0x42')][_0x3831('0x49')](_['merge'](_0x5a313c,_0x4d2e21['body']),{'include':_0x4d2e21[_0x3831('0x2c')][_0x3831('0x40')]?[{'all':!![]}]:undefined})[_0x3831('0x20')](function(_0x4dfcac){var _0x1109a5=_0x4d2e21[_0x3831('0x4a')][_0x3831('0x22')]({'plain':!![]});if(!_0x1109a5)throw new Error(_0x3831('0x55'));if(_0x1109a5[_0x3831('0x4b')]===_0x3831('0x4a')){var _0x1ae3f2=_0x4dfcac['get']({'plain':!![]});var _0x4bb848='Projects';return db['UserProfileSection'][_0x3831('0x48')]({'where':{'name':_0x4bb848,'userProfileId':_0x1109a5[_0x3831('0x4d')]},'raw':!![]})['then'](function(_0x70cc6d){if(_0x70cc6d&&_0x70cc6d[_0x3831('0x4e')]===0x0){return db['UserProfileResource'][_0x3831('0x49')]({'name':_0x1ae3f2['name'],'resourceId':_0x1ae3f2['id'],'type':_0x70cc6d[_0x3831('0x27')],'sectionId':_0x70cc6d['id']},{})[_0x3831('0x20')](function(){return _0x4dfcac;});}else{return _0x4dfcac;}})[_0x3831('0x44')](function(_0x5b8129){logger[_0x3831('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b8129);throw _0x5b8129;});}return _0x4dfcac;});}})[_0x3831('0x20')](respondWithResult(_0x2598fa,0xc9))[_0x3831('0x44')](handleError(_0x2598fa,null));};exports[_0x3831('0x1f')]=function(_0x3cf764,_0x27f695){if(_0x3cf764['body']['id']){delete _0x3cf764[_0x3831('0x53')]['id'];}return db[_0x3831('0x42')][_0x3831('0x48')]({'where':{'id':_0x3cf764[_0x3831('0x46')]['id']}})[_0x3831('0x20')](handleEntityNotFound(_0x27f695,null))[_0x3831('0x20')](saveUpdates(_0x3cf764[_0x3831('0x53')],null))[_0x3831('0x20')](respondWithResult(_0x27f695,null))['catch'](handleError(_0x27f695,null));};exports[_0x3831('0x21')]=function(_0x17d3e2,_0x4dd608){return db[_0x3831('0x42')]['find']({'where':{'id':_0x17d3e2[_0x3831('0x46')]['id']}})[_0x3831('0x20')](handleEntityNotFound(_0x4dd608,null))[_0x3831('0x20')](removeEntity(_0x4dd608,null))[_0x3831('0x44')](handleError(_0x4dd608,null));};exports[_0x3831('0x56')]=function(_0x14d498,_0x22b3cc,_0x8ffff3){var _0x2ba79f={'raw':!![],'where':{}};var _0x53a01d={};var _0x2787e5={'count':0x0,'rows':[]};return db[_0x3831('0x42')][_0x3831('0x57')]({'where':{'id':_0x14d498[_0x3831('0x46')]['id']}})[_0x3831('0x20')](handleEntityNotFound(_0x22b3cc,null))['then'](function(_0x26ca54){if(_0x26ca54){_0x53a01d[_0x3831('0x2b')]=_[_0x3831('0x47')](db['JscriptySessionReport']['rawAttributes']);_0x53a01d[_0x3831('0x2c')]=_[_0x3831('0x47')](_0x14d498[_0x3831('0x2c')]);_0x53a01d['filters']=_[_0x3831('0x2e')](_0x53a01d[_0x3831('0x2b')],_0x53a01d[_0x3831('0x2c')]);_0x2ba79f['attributes']=_['intersection'](_0x53a01d[_0x3831('0x2b')],qs[_0x3831('0x2f')](_0x14d498[_0x3831('0x2c')][_0x3831('0x2f')]));_0x2ba79f[_0x3831('0x30')]=_0x2ba79f['attributes'][_0x3831('0x31')]?_0x2ba79f[_0x3831('0x30')]:_0x53a01d[_0x3831('0x2b')];if(!_0x14d498[_0x3831('0x2c')]['hasOwnProperty']('nolimit')){_0x2ba79f['limit']=qs['limit'](_0x14d498[_0x3831('0x2c')][_0x3831('0x1a')]);_0x2ba79f[_0x3831('0x19')]=qs['offset'](_0x14d498[_0x3831('0x2c')][_0x3831('0x19')]);}_0x2ba79f[_0x3831('0x34')]=qs['sort'](_0x14d498[_0x3831('0x2c')][_0x3831('0x35')]);_0x2ba79f[_0x3831('0x36')]=qs[_0x3831('0x2d')](_['pick'](_0x14d498['query'],_0x53a01d[_0x3831('0x2d')]));_0x2ba79f[_0x3831('0x36')][_0x3831('0x58')]=_0x26ca54['id'];if(_0x14d498[_0x3831('0x2c')]['filter']){_0x2ba79f['where']=_[_0x3831('0x38')](_0x2ba79f['where'],{'$or':_[_0x3831('0x39')](_0x2ba79f[_0x3831('0x30')],function(_0x648f53){var _0x17f336={};_0x17f336[_0x648f53]={'$like':'%'+_0x14d498[_0x3831('0x2c')][_0x3831('0x3d')]+'%'};return _0x17f336;})});}_0x2ba79f=_['merge']({},_0x2ba79f,_0x14d498[_0x3831('0x3e')]);return db[_0x3831('0x59')]['count']({'where':_0x2ba79f['where']})[_0x3831('0x20')](function(_0x574365){_0x2787e5[_0x3831('0x3f')]=_0x574365;if(_0x14d498[_0x3831('0x2c')]['includeAll']){_0x2ba79f['include']=[{'all':!![]}];}return db[_0x3831('0x59')][_0x3831('0x43')](_0x2ba79f);})['then'](function(_0x9c3290){_0x2787e5[_0x3831('0x5a')]=_0x9c3290;return _0x2787e5;});}})['then'](respondWithFilteredResult(_0x22b3cc,_0x2ba79f))[_0x3831('0x44')](handleError(_0x22b3cc,null));};exports['getAnswers']=function(_0x361889,_0x524b0,_0x57407b){var _0x285805={'raw':!![],'where':{}};var _0x554ac={};var _0x274a63={'count':0x0,'rows':[]};return db[_0x3831('0x42')][_0x3831('0x57')]({'where':{'id':_0x361889['params']['id']}})[_0x3831('0x20')](handleEntityNotFound(_0x524b0,null))[_0x3831('0x20')](function(_0x22d0bb){if(_0x22d0bb){_0x554ac['model']=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x554ac[_0x3831('0x2c')]=_[_0x3831('0x47')](_0x361889['query']);_0x554ac[_0x3831('0x2d')]=_[_0x3831('0x2e')](_0x554ac[_0x3831('0x2b')],_0x554ac['query']);_0x285805[_0x3831('0x30')]=_[_0x3831('0x2e')](_0x554ac[_0x3831('0x2b')],qs[_0x3831('0x2f')](_0x361889[_0x3831('0x2c')][_0x3831('0x2f')]));_0x285805[_0x3831('0x30')]=_0x285805[_0x3831('0x30')][_0x3831('0x31')]?_0x285805[_0x3831('0x30')]:_0x554ac[_0x3831('0x2b')];if(!_0x361889['query'][_0x3831('0x32')](_0x3831('0x33'))){_0x285805['limit']=qs[_0x3831('0x1a')](_0x361889[_0x3831('0x2c')][_0x3831('0x1a')]);_0x285805[_0x3831('0x19')]=qs['offset'](_0x361889['query']['offset']);}_0x285805[_0x3831('0x34')]=qs[_0x3831('0x35')](_0x361889['query']['sort']);_0x285805['where']=qs[_0x3831('0x2d')](_['pick'](_0x361889[_0x3831('0x2c')],_0x554ac['filters']));_0x285805[_0x3831('0x36')]['ProjectId']=_0x22d0bb['id'];if(_0x361889[_0x3831('0x2c')][_0x3831('0x3d')]){_0x285805[_0x3831('0x36')]=_[_0x3831('0x38')](_0x285805[_0x3831('0x36')],{'$or':_[_0x3831('0x39')](_0x285805[_0x3831('0x30')],function(_0x1d81b2){var _0x3365c6={};_0x3365c6[_0x1d81b2]={'$like':'%'+_0x361889['query'][_0x3831('0x3d')]+'%'};return _0x3365c6;})});}_0x285805=_[_0x3831('0x38')]({},_0x285805,_0x361889[_0x3831('0x3e')]);return db[_0x3831('0x5b')][_0x3831('0x3f')]({'where':_0x285805[_0x3831('0x36')]})[_0x3831('0x20')](function(_0x5c228f){_0x274a63['count']=_0x5c228f;if(_0x361889[_0x3831('0x2c')][_0x3831('0x40')]){_0x285805[_0x3831('0x41')]=[{'all':!![]}];}return db[_0x3831('0x5b')][_0x3831('0x43')](_0x285805);})[_0x3831('0x20')](function(_0x3fe571){_0x274a63[_0x3831('0x5a')]=_0x3fe571;return _0x274a63;});}})[_0x3831('0x20')](respondWithFilteredResult(_0x524b0,_0x285805))[_0x3831('0x44')](handleError(_0x524b0,null));};function char(_0x41babf){return'number'===typeof _0x41babf?String[_0x3831('0x5c')]['apply'](null,arguments):_0x41babf;}function needsEncapsulation(_0x446e20){return!!_0x446e20&&(_0x446e20[_0x3831('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x446e20[_0x3831('0x5d')]()[_0x3831('0x5e')](char(0xa))>=0x0||_0x446e20[_0x3831('0x5d')]()[_0x3831('0x5e')](char(0x2c))>=0x0||_0x446e20[_0x3831('0x5d')]()[_0x3831('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x1e4f80){var _0xe17659=char(0x22),_0x507133='\x5c'+char(0x22),_0x10f1c3=_0x1e4f80['toString']()[_0x3831('0x5f')](new RegExp(_0xe17659,'g'),_0x507133);return _0xe17659+_0x10f1c3+_0xe17659;}exports[_0x3831('0x60')]=function(_0x4f62e9,_0x45f6c5,_0x3e28bb){var _0xc0dfc9,_0x30300;var _0x5674cd={'where':{'ProjectId':_0x4f62e9[_0x3831('0x46')]['id']}};if(_0x4f62e9['query'][_0x3831('0x61')]){_0x5674cd[_0x3831('0x36')][_0x3831('0x62')]=JSON[_0x3831('0x63')](_0x4f62e9[_0x3831('0x2c')][_0x3831('0x61')]);}return db[_0x3831('0x59')][_0x3831('0x43')](_0x5674cd)[_0x3831('0x20')](handleEntityNotFound(_0x45f6c5,null))[_0x3831('0x20')](function(_0x45274e){if(_0x45274e){_0xc0dfc9=_0x45274e;return db[_0x3831('0x64')][_0x3831('0x43')]({'where':{'SessionId':{'$in':_[_0x3831('0x39')](_0xc0dfc9,'id')},'ProjectId':_0x4f62e9[_0x3831('0x46')]['id']},'order':'-createdAt'});}})[_0x3831('0x20')](handleEntityNotFound(_0x45f6c5,null))[_0x3831('0x20')](function(_0x40a1f1){if(_0x40a1f1){_0x30300=_0x40a1f1;var _0x4db168={};for(var _0xba3862=0x0,_0x5c712f=_0x30300['length'];_0xba3862<_0x5c712f;_0xba3862++){if(!_0x4db168[_0x3831('0x32')](_0x30300[_0xba3862][_0x3831('0x65')])){_0x4db168[_0x30300[_0xba3862][_0x3831('0x65')]]=needsEncapsulation(_0x30300[_0xba3862]['question'])?encapsulate(_0x30300[_0xba3862][_0x3831('0x66')]):_0x30300[_0xba3862]['question'];}}var _0x293b87=[],_0x2d7958={};for(var _0x4d6431=0x0,_0x411bc5=_0xc0dfc9['length'];_0x4d6431<_0x411bc5;_0x4d6431++){_0x2d7958={'ProjectId':_0x4f62e9[_0x3831('0x46')]['id'],'SessionId':_0xc0dfc9[_0x4d6431]['id'],'StartTime':moment(_0xc0dfc9[_0x4d6431][_0x3831('0x62')])[_0x3831('0x67')](_0x3831('0x68'))};for(var _0x1871f7=0x0,_0x343fd9=_0x30300[_0x3831('0x31')];_0x1871f7<_0x343fd9;_0x1871f7++){if(_0x30300[_0x1871f7]['SessionId']==_0xc0dfc9[_0x4d6431]['id']&&_0x4db168[_0x3831('0x32')](_0x30300[_0x1871f7][_0x3831('0x65')])){_0x2d7958[_0x4db168[_0x30300[_0x1871f7][_0x3831('0x65')]]]=_0x30300[_0x1871f7]['answer'];}}for(var _0x28cee9 in _0x4db168){if(!_0x2d7958[_0x3831('0x32')](_0x4db168[_0x28cee9])){_0x2d7958[_0x4db168[_0x28cee9]]=null;}}_0x293b87[_0x3831('0x69')](_0x2d7958);}return _0x293b87;}})[_0x3831('0x20')](function(_0x113a77){if(!_[_0x3831('0x6a')](_0x113a77)){var _0x51d4ee=toCsv(_0x113a77);var _0x540601=Date[_0x3831('0x6b')]();fs[_0x3831('0x6c')](util[_0x3831('0x67')](_0x3831('0x6d'),_0x4f62e9[_0x3831('0x46')]['id'],_0x540601),_0x51d4ee);_0x45f6c5['setHeader']('Content-disposition','attachment;\x20filename='+util['format'](_0x3831('0x6e'),_0x4f62e9[_0x3831('0x46')]['id'],_0x540601));_0x45f6c5[_0x3831('0x6f')](_0x3831('0x70'),_0x3831('0x71'));return _0x45f6c5[_0x3831('0x72')](util[_0x3831('0x67')](_0x3831('0x6d'),_0x4f62e9[_0x3831('0x46')]['id'],_0x540601));}else{return _0x45f6c5['sendStatus'](0xcc);}})[_0x3831('0x44')](handleError(_0x45f6c5,null));}; \ No newline at end of file +var _0x1047=['setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','Projects','UserProfileResource','stack','name','send','index','JscriptyProject','rawAttributes','keys','query','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filters','filter','type','key','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','role','userProfileId','error','update','findOne','JscriptySessionReport','ProjectId','map','JscriptyAnswerReport','hasOwnProperty','toString','indexOf','replace','getSummary','parse','startTime','-createdAt','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','questionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv'];(function(_0x491f21,_0xe7d4b2){var _0x4f67a2=function(_0x598a8c){while(--_0x598a8c){_0x491f21['push'](_0x491f21['shift']());}};_0x4f67a2(++_0xe7d4b2);}(_0x1047,0x79));var _0x7104=function(_0x2e1516,_0x3b5c3c){_0x2e1516=_0x2e1516-0x0;var _0xdd0dc3=_0x1047[_0x2e1516];return _0xdd0dc3;};'use strict';var pdf=require(_0x7104('0x0'));var emlformat=require(_0x7104('0x1'));var rimraf=require(_0x7104('0x2'));var zipdir=require(_0x7104('0x3'));var jsonpatch=require(_0x7104('0x4'));var rp=require(_0x7104('0x5'));var moment=require(_0x7104('0x6'));var BPromise=require(_0x7104('0x7'));var Mustache=require(_0x7104('0x8'));var util=require(_0x7104('0x9'));var path=require(_0x7104('0xa'));var sox=require(_0x7104('0xb'));var csv=require(_0x7104('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7104('0xd'));var crypto=require(_0x7104('0xe'));var jsforce=require(_0x7104('0xf'));var deskjs=require(_0x7104('0x10'));var toCsv=require(_0x7104('0xc'));var querystring=require(_0x7104('0x11'));var Papa=require(_0x7104('0x12'));var Redis=require(_0x7104('0x13'));var authService=require(_0x7104('0x14'));var qs=require(_0x7104('0x15'));var hardwareService=require(_0x7104('0x16'));var logger=require(_0x7104('0x17'))(_0x7104('0x18'));var utils=require(_0x7104('0x19'));var config=require(_0x7104('0x1a'));var db=require(_0x7104('0x1b'))['db'];function respondWithStatusCode(_0x58e3b1,_0x20722c){_0x20722c=_0x20722c||0xcc;return function(_0x323250){if(_0x323250){return _0x58e3b1['sendStatus'](_0x20722c);}return _0x58e3b1['status'](_0x20722c)['end']();};}function respondWithResult(_0x4b612f,_0x187c7b){_0x187c7b=_0x187c7b||0xc8;return function(_0x128b70){if(_0x128b70){return _0x4b612f[_0x7104('0x1c')](_0x187c7b)[_0x7104('0x1d')](_0x128b70);}};}function respondWithFilteredResult(_0x48e72f,_0xf1bb4d){return function(_0x44bf3a){if(_0x44bf3a){var _0x91d2f9=_0x44bf3a['count'],_0x4c500a=_0xf1bb4d[_0x7104('0x1e')],_0x59fc4c=_0xf1bb4d[_0x7104('0x1e')]+_0xf1bb4d[_0x7104('0x1f')],_0x1976ac;if(_0x59fc4c>=_0x91d2f9){_0x59fc4c=_0x91d2f9;_0x1976ac=0xc8;}else{_0x1976ac=0xce;}_0x48e72f[_0x7104('0x1c')](_0x1976ac);return _0x48e72f[_0x7104('0x20')](_0x7104('0x21'),_0x4c500a+'-'+_0x59fc4c+'/'+_0x91d2f9)[_0x7104('0x1d')](_0x44bf3a);}return null;};}function patchUpdates(_0x366fd3){return function(_0x23d629){try{jsonpatch[_0x7104('0x22')](_0x23d629,_0x366fd3,!![]);}catch(_0x4c422b){return BPromise[_0x7104('0x23')](_0x4c422b);}return _0x23d629[_0x7104('0x24')]();};}function saveUpdates(_0x3c6123,_0x429822){return function(_0x56bace){if(_0x56bace){return _0x56bace['update'](_0x3c6123)['then'](function(_0x40587d){return _0x40587d;});}return null;};}function removeEntity(_0x14eaf9,_0x57d29b){return function(_0x40bf2d){if(_0x40bf2d){return _0x40bf2d[_0x7104('0x25')]()[_0x7104('0x26')](function(){var _0x29afe6=_0x40bf2d[_0x7104('0x27')]({'plain':!![]});var _0xef1e91=_0x7104('0x28');return db[_0x7104('0x29')]['destroy']({'where':{'type':_0xef1e91,'resourceId':_0x29afe6['id']}})[_0x7104('0x26')](function(){return _0x40bf2d;});})[_0x7104('0x26')](function(){_0x14eaf9[_0x7104('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1e5b,_0x2269af){return function(_0x4fc22f){if(!_0x4fc22f){_0x3f1e5b['sendStatus'](0x194);}return _0x4fc22f;};}function handleError(_0x21323e,_0x523905){_0x523905=_0x523905||0x1f4;return function(_0x228542){logger['error'](_0x228542[_0x7104('0x2a')]);if(_0x228542[_0x7104('0x2b')]){delete _0x228542[_0x7104('0x2b')];}_0x21323e[_0x7104('0x1c')](_0x523905)[_0x7104('0x2c')](_0x228542);};}exports[_0x7104('0x2d')]=function(_0x2ee2fb,_0x451e22){var _0x5d5c90={},_0x36ea6b={},_0x349338={'count':0x0,'rows':[]};var _0x1ab562=db[_0x7104('0x2e')][_0x7104('0x2f')];_0x36ea6b['model']=_[_0x7104('0x30')](_0x1ab562);_0x36ea6b[_0x7104('0x31')]=_[_0x7104('0x30')](_0x2ee2fb[_0x7104('0x31')]);_0x36ea6b['filters']=_[_0x7104('0x32')](_0x36ea6b[_0x7104('0x33')],_0x36ea6b[_0x7104('0x31')]);_0x5d5c90[_0x7104('0x34')]=_[_0x7104('0x32')](_0x36ea6b['model'],qs[_0x7104('0x35')](_0x2ee2fb[_0x7104('0x31')][_0x7104('0x35')]));_0x5d5c90['attributes']=_0x5d5c90[_0x7104('0x34')]['length']?_0x5d5c90[_0x7104('0x34')]:_0x36ea6b[_0x7104('0x33')];if(!_0x2ee2fb[_0x7104('0x31')]['hasOwnProperty'](_0x7104('0x36'))){_0x5d5c90['limit']=qs[_0x7104('0x1f')](_0x2ee2fb[_0x7104('0x31')][_0x7104('0x1f')]);_0x5d5c90[_0x7104('0x1e')]=qs[_0x7104('0x1e')](_0x2ee2fb[_0x7104('0x31')][_0x7104('0x1e')]);}_0x5d5c90[_0x7104('0x37')]=qs[_0x7104('0x38')](_0x2ee2fb['query'][_0x7104('0x38')]);_0x5d5c90[_0x7104('0x39')]=qs['filters'](_[_0x7104('0x3a')](_0x2ee2fb[_0x7104('0x31')],_0x36ea6b[_0x7104('0x3b')]));if(_0x2ee2fb[_0x7104('0x31')][_0x7104('0x3c')]){_0x5d5c90[_0x7104('0x39')]=_['merge'](_0x5d5c90[_0x7104('0x39')],{'$or':_['map'](_0x1ab562,function(_0x36d1d0){if(_0x36d1d0[_0x7104('0x3d')][_0x7104('0x3e')]!=='VIRTUAL'){var _0x48cfc3={};_0x48cfc3[_0x36d1d0['field']]={'$like':'%'+_0x2ee2fb[_0x7104('0x31')][_0x7104('0x3c')]+'%'};return _0x48cfc3;}})});}_0x5d5c90=_[_0x7104('0x3f')]({},_0x5d5c90,_0x2ee2fb[_0x7104('0x40')]);var _0x491496={'where':_0x5d5c90[_0x7104('0x39')]};return db['JscriptyProject'][_0x7104('0x41')](_0x491496)[_0x7104('0x26')](function(_0x5497a7){_0x349338[_0x7104('0x41')]=_0x5497a7;if(_0x2ee2fb[_0x7104('0x31')][_0x7104('0x42')]){_0x5d5c90[_0x7104('0x43')]=[{'all':!![]}];}return db[_0x7104('0x2e')][_0x7104('0x44')](_0x5d5c90);})[_0x7104('0x26')](function(_0x413dc2){_0x349338[_0x7104('0x45')]=_0x413dc2;return _0x349338;})[_0x7104('0x26')](respondWithFilteredResult(_0x451e22,_0x5d5c90))[_0x7104('0x46')](handleError(_0x451e22,null));};exports[_0x7104('0x47')]=function(_0x34011f,_0x5b438e){var _0x5b9499={'raw':![],'where':{'id':_0x34011f[_0x7104('0x48')]['id']}},_0x2db457={};_0x2db457[_0x7104('0x33')]=_[_0x7104('0x30')](db[_0x7104('0x2e')][_0x7104('0x2f')]);_0x2db457[_0x7104('0x31')]=_[_0x7104('0x30')](_0x34011f[_0x7104('0x31')]);_0x2db457[_0x7104('0x3b')]=_[_0x7104('0x32')](_0x2db457[_0x7104('0x33')],_0x2db457['query']);_0x5b9499[_0x7104('0x34')]=_[_0x7104('0x32')](_0x2db457['model'],qs[_0x7104('0x35')](_0x34011f[_0x7104('0x31')][_0x7104('0x35')]));_0x5b9499[_0x7104('0x34')]=_0x5b9499['attributes']['length']?_0x5b9499['attributes']:_0x2db457[_0x7104('0x33')];if(_0x34011f[_0x7104('0x31')]['includeAll']){_0x5b9499['include']=[{'all':!![]}];}_0x5b9499=_['merge']({},_0x5b9499,_0x34011f['options']);return db[_0x7104('0x2e')][_0x7104('0x49')](_0x5b9499)['then'](handleEntityNotFound(_0x5b438e,null))[_0x7104('0x26')](respondWithResult(_0x5b438e,null))['catch'](handleError(_0x5b438e,null));};exports[_0x7104('0x4a')]=function(_0x29206a,_0x35acde){return db[_0x7104('0x2e')]['create'](_0x29206a[_0x7104('0x4b')],{})[_0x7104('0x26')](function(_0x39ac54){var _0x1e0d76=_0x29206a[_0x7104('0x4c')][_0x7104('0x27')]({'plain':!![]});if(!_0x1e0d76)throw new Error(_0x7104('0x4d'));if(_0x1e0d76['role']===_0x7104('0x4c')){var _0x4e6087=_0x39ac54[_0x7104('0x27')]({'plain':!![]});var _0x269cd2='Projects';return db[_0x7104('0x4e')][_0x7104('0x49')]({'where':{'name':_0x269cd2,'userProfileId':_0x1e0d76['userProfileId']},'raw':!![]})[_0x7104('0x26')](function(_0x32b4de){if(_0x32b4de&&_0x32b4de[_0x7104('0x4f')]===0x0){return db[_0x7104('0x29')][_0x7104('0x4a')]({'name':_0x4e6087[_0x7104('0x2b')],'resourceId':_0x4e6087['id'],'type':_0x32b4de[_0x7104('0x2b')],'sectionId':_0x32b4de['id']},{})[_0x7104('0x26')](function(){return _0x39ac54;});}else{return _0x39ac54;}})['catch'](function(_0x225b9a){logger['error'](_0x7104('0x50'),_0x225b9a);throw _0x225b9a;});}return _0x39ac54;})[_0x7104('0x26')](respondWithResult(_0x35acde,0xc9))[_0x7104('0x46')](handleError(_0x35acde,null));};exports['clone']=function(_0x147006,_0x28c61c){var _0x70bf77={'raw':![],'where':{'id':_0x147006[_0x7104('0x48')]['id']}},_0x4f378d={};_0x4f378d['model']=_[_0x7104('0x30')](db[_0x7104('0x2e')][_0x7104('0x2f')]);_0x70bf77[_0x7104('0x34')]=_['intersection'](_0x4f378d[_0x7104('0x33')],qs[_0x7104('0x35')](_0x147006[_0x7104('0x31')][_0x7104('0x35')]));_0x70bf77[_0x7104('0x34')]=_0x70bf77[_0x7104('0x34')][_0x7104('0x51')]?_0x70bf77[_0x7104('0x34')]:_0x4f378d[_0x7104('0x33')];if(_0x147006[_0x7104('0x31')][_0x7104('0x42')]){_0x70bf77['include']=[{'all':!![]}];}_0x70bf77=_[_0x7104('0x3f')]({},_0x70bf77,_0x147006[_0x7104('0x40')]);return db['JscriptyProject'][_0x7104('0x49')](_0x70bf77)[_0x7104('0x26')](handleEntityNotFound(_0x28c61c,null))[_0x7104('0x26')](function(_0x5c0560){if(_0x5c0560){var _0x1a956e=_0x5c0560[_0x7104('0x27')]({'plain':!![]});_0x1a956e=qs[_0x7104('0x52')](_0x1a956e,['id',_0x7104('0x53'),_0x7104('0x54')]);_0x147006['body']=_[_0x7104('0x52')](_0x147006['body'],['id',_0x7104('0x53'),'updatedAt']);return db[_0x7104('0x2e')][_0x7104('0x4a')](_[_0x7104('0x3f')](_0x1a956e,_0x147006[_0x7104('0x4b')]),{'include':_0x147006[_0x7104('0x31')][_0x7104('0x42')]?[{'all':!![]}]:undefined})[_0x7104('0x26')](function(_0x1b43dd){var _0xca7c29=_0x147006['user'][_0x7104('0x27')]({'plain':!![]});if(!_0xca7c29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xca7c29[_0x7104('0x55')]===_0x7104('0x4c')){var _0x36d847=_0x1b43dd[_0x7104('0x27')]({'plain':!![]});var _0x1e40c1=_0x7104('0x28');return db[_0x7104('0x4e')][_0x7104('0x49')]({'where':{'name':_0x1e40c1,'userProfileId':_0xca7c29[_0x7104('0x56')]},'raw':!![]})[_0x7104('0x26')](function(_0xc22b6c){if(_0xc22b6c&&_0xc22b6c[_0x7104('0x4f')]===0x0){return db[_0x7104('0x29')]['create']({'name':_0x36d847[_0x7104('0x2b')],'resourceId':_0x36d847['id'],'type':_0xc22b6c[_0x7104('0x2b')],'sectionId':_0xc22b6c['id']},{})[_0x7104('0x26')](function(){return _0x1b43dd;});}else{return _0x1b43dd;}})[_0x7104('0x46')](function(_0x7bdabe){logger[_0x7104('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7bdabe);throw _0x7bdabe;});}return _0x1b43dd;});}})['then'](respondWithResult(_0x28c61c,0xc9))['catch'](handleError(_0x28c61c,null));};exports[_0x7104('0x58')]=function(_0x5c0a63,_0x1070c7){if(_0x5c0a63[_0x7104('0x4b')]['id']){delete _0x5c0a63[_0x7104('0x4b')]['id'];}return db[_0x7104('0x2e')]['find']({'where':{'id':_0x5c0a63['params']['id']}})[_0x7104('0x26')](handleEntityNotFound(_0x1070c7,null))[_0x7104('0x26')](saveUpdates(_0x5c0a63['body'],null))[_0x7104('0x26')](respondWithResult(_0x1070c7,null))[_0x7104('0x46')](handleError(_0x1070c7,null));};exports[_0x7104('0x25')]=function(_0x5a9c1a,_0x3b704a){return db[_0x7104('0x2e')][_0x7104('0x49')]({'where':{'id':_0x5a9c1a['params']['id']}})[_0x7104('0x26')](handleEntityNotFound(_0x3b704a,null))['then'](removeEntity(_0x3b704a,null))[_0x7104('0x46')](handleError(_0x3b704a,null));};exports['getSessions']=function(_0x496aac,_0x2d808e,_0x17342f){var _0x7a335f={'raw':!![],'where':{}};var _0x4f3fc9={};var _0x1e6733={'count':0x0,'rows':[]};return db[_0x7104('0x2e')][_0x7104('0x59')]({'where':{'id':_0x496aac[_0x7104('0x48')]['id']}})[_0x7104('0x26')](handleEntityNotFound(_0x2d808e,null))[_0x7104('0x26')](function(_0x569c93){if(_0x569c93){_0x4f3fc9[_0x7104('0x33')]=_[_0x7104('0x30')](db[_0x7104('0x5a')][_0x7104('0x2f')]);_0x4f3fc9[_0x7104('0x31')]=_[_0x7104('0x30')](_0x496aac[_0x7104('0x31')]);_0x4f3fc9[_0x7104('0x3b')]=_[_0x7104('0x32')](_0x4f3fc9[_0x7104('0x33')],_0x4f3fc9['query']);_0x7a335f[_0x7104('0x34')]=_['intersection'](_0x4f3fc9[_0x7104('0x33')],qs[_0x7104('0x35')](_0x496aac[_0x7104('0x31')][_0x7104('0x35')]));_0x7a335f['attributes']=_0x7a335f['attributes'][_0x7104('0x51')]?_0x7a335f[_0x7104('0x34')]:_0x4f3fc9[_0x7104('0x33')];if(!_0x496aac['query']['hasOwnProperty'](_0x7104('0x36'))){_0x7a335f[_0x7104('0x1f')]=qs['limit'](_0x496aac[_0x7104('0x31')]['limit']);_0x7a335f[_0x7104('0x1e')]=qs[_0x7104('0x1e')](_0x496aac[_0x7104('0x31')][_0x7104('0x1e')]);}_0x7a335f['order']=qs[_0x7104('0x38')](_0x496aac['query'][_0x7104('0x38')]);_0x7a335f[_0x7104('0x39')]=qs['filters'](_[_0x7104('0x3a')](_0x496aac[_0x7104('0x31')],_0x4f3fc9[_0x7104('0x3b')]));_0x7a335f['where'][_0x7104('0x5b')]=_0x569c93['id'];if(_0x496aac[_0x7104('0x31')]['filter']){_0x7a335f['where']=_[_0x7104('0x3f')](_0x7a335f[_0x7104('0x39')],{'$or':_[_0x7104('0x5c')](_0x7a335f['attributes'],function(_0x43cf40){var _0xa6c0e3={};_0xa6c0e3[_0x43cf40]={'$like':'%'+_0x496aac[_0x7104('0x31')]['filter']+'%'};return _0xa6c0e3;})});}_0x7a335f=_[_0x7104('0x3f')]({},_0x7a335f,_0x496aac[_0x7104('0x40')]);return db[_0x7104('0x5a')][_0x7104('0x41')]({'where':_0x7a335f['where']})['then'](function(_0xdaae84){_0x1e6733['count']=_0xdaae84;if(_0x496aac[_0x7104('0x31')]['includeAll']){_0x7a335f['include']=[{'all':!![]}];}return db[_0x7104('0x5a')][_0x7104('0x44')](_0x7a335f);})[_0x7104('0x26')](function(_0x397643){_0x1e6733['rows']=_0x397643;return _0x1e6733;});}})[_0x7104('0x26')](respondWithFilteredResult(_0x2d808e,_0x7a335f))[_0x7104('0x46')](handleError(_0x2d808e,null));};exports['getAnswers']=function(_0x316fe7,_0x5ad300,_0x756406){var _0x5e52bf={'raw':!![],'where':{}};var _0x72da18={};var _0x3fb6d7={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x316fe7[_0x7104('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ad300,null))[_0x7104('0x26')](function(_0xda0248){if(_0xda0248){_0x72da18[_0x7104('0x33')]=_['keys'](db[_0x7104('0x5d')][_0x7104('0x2f')]);_0x72da18[_0x7104('0x31')]=_[_0x7104('0x30')](_0x316fe7[_0x7104('0x31')]);_0x72da18['filters']=_[_0x7104('0x32')](_0x72da18[_0x7104('0x33')],_0x72da18[_0x7104('0x31')]);_0x5e52bf[_0x7104('0x34')]=_['intersection'](_0x72da18['model'],qs[_0x7104('0x35')](_0x316fe7[_0x7104('0x31')][_0x7104('0x35')]));_0x5e52bf[_0x7104('0x34')]=_0x5e52bf[_0x7104('0x34')][_0x7104('0x51')]?_0x5e52bf['attributes']:_0x72da18[_0x7104('0x33')];if(!_0x316fe7[_0x7104('0x31')][_0x7104('0x5e')](_0x7104('0x36'))){_0x5e52bf[_0x7104('0x1f')]=qs[_0x7104('0x1f')](_0x316fe7[_0x7104('0x31')][_0x7104('0x1f')]);_0x5e52bf[_0x7104('0x1e')]=qs[_0x7104('0x1e')](_0x316fe7[_0x7104('0x31')][_0x7104('0x1e')]);}_0x5e52bf[_0x7104('0x37')]=qs[_0x7104('0x38')](_0x316fe7[_0x7104('0x31')][_0x7104('0x38')]);_0x5e52bf[_0x7104('0x39')]=qs['filters'](_[_0x7104('0x3a')](_0x316fe7['query'],_0x72da18[_0x7104('0x3b')]));_0x5e52bf[_0x7104('0x39')][_0x7104('0x5b')]=_0xda0248['id'];if(_0x316fe7['query'][_0x7104('0x3c')]){_0x5e52bf[_0x7104('0x39')]=_[_0x7104('0x3f')](_0x5e52bf['where'],{'$or':_[_0x7104('0x5c')](_0x5e52bf[_0x7104('0x34')],function(_0x302f48){var _0x55446a={};_0x55446a[_0x302f48]={'$like':'%'+_0x316fe7[_0x7104('0x31')][_0x7104('0x3c')]+'%'};return _0x55446a;})});}_0x5e52bf=_[_0x7104('0x3f')]({},_0x5e52bf,_0x316fe7[_0x7104('0x40')]);return db[_0x7104('0x5d')][_0x7104('0x41')]({'where':_0x5e52bf[_0x7104('0x39')]})[_0x7104('0x26')](function(_0x181892){_0x3fb6d7[_0x7104('0x41')]=_0x181892;if(_0x316fe7[_0x7104('0x31')][_0x7104('0x42')]){_0x5e52bf[_0x7104('0x43')]=[{'all':!![]}];}return db[_0x7104('0x5d')][_0x7104('0x44')](_0x5e52bf);})[_0x7104('0x26')](function(_0x197966){_0x3fb6d7[_0x7104('0x45')]=_0x197966;return _0x3fb6d7;});}})[_0x7104('0x26')](respondWithFilteredResult(_0x5ad300,_0x5e52bf))[_0x7104('0x46')](handleError(_0x5ad300,null));};function char(_0x398e4a){return'number'===typeof _0x398e4a?String['fromCharCode']['apply'](null,arguments):_0x398e4a;}function needsEncapsulation(_0x2720d1){return!!_0x2720d1&&(_0x2720d1[_0x7104('0x5f')]()[_0x7104('0x60')](char(0xd))>=0x0||_0x2720d1[_0x7104('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x2720d1[_0x7104('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x2720d1['toString']()[_0x7104('0x60')](char(0x22))>=0x0);}function encapsulate(_0x457454){var _0x57dc30=char(0x22),_0x4fb327='\x5c'+char(0x22),_0x4408db=_0x457454[_0x7104('0x5f')]()[_0x7104('0x61')](new RegExp(_0x57dc30,'g'),_0x4fb327);return _0x57dc30+_0x4408db+_0x57dc30;}exports[_0x7104('0x62')]=function(_0x285a35,_0x189511,_0x29cf3a){var _0x45dc82,_0x29fc52;var _0x44c225={'where':{'ProjectId':_0x285a35[_0x7104('0x48')]['id']}};if(_0x285a35[_0x7104('0x31')]['startTime']){_0x44c225[_0x7104('0x39')]['starttime']=JSON[_0x7104('0x63')](_0x285a35['query'][_0x7104('0x64')]);}return db[_0x7104('0x5a')]['findAll'](_0x44c225)[_0x7104('0x26')](handleEntityNotFound(_0x189511,null))[_0x7104('0x26')](function(_0xd0dfc7){if(_0xd0dfc7){_0x45dc82=_0xd0dfc7;return db['JscriptyQuestionReport'][_0x7104('0x44')]({'where':{'SessionId':{'$in':_[_0x7104('0x5c')](_0x45dc82,'id')},'ProjectId':_0x285a35['params']['id']},'order':_0x7104('0x65')});}})[_0x7104('0x26')](handleEntityNotFound(_0x189511,null))[_0x7104('0x26')](function(_0xad61ab){if(_0xad61ab){_0x29fc52=_0xad61ab;var _0x333470={};for(var _0x28236b=0x0,_0x495431=_0x29fc52[_0x7104('0x51')];_0x28236b<_0x495431;_0x28236b++){if(!_0x333470[_0x7104('0x5e')](_0x29fc52[_0x28236b]['questionId'])){_0x333470[_0x29fc52[_0x28236b]['questionId']]=needsEncapsulation(_0x29fc52[_0x28236b][_0x7104('0x66')])?encapsulate(_0x29fc52[_0x28236b]['question']):_0x29fc52[_0x28236b][_0x7104('0x66')];}}var _0x4389ac=[],_0x212145={};for(var _0x2c6791=0x0,_0x5da41c=_0x45dc82[_0x7104('0x51')];_0x2c6791<_0x5da41c;_0x2c6791++){_0x212145={'ProjectId':_0x285a35[_0x7104('0x48')]['id'],'SessionId':_0x45dc82[_0x2c6791]['id'],'StartTime':moment(_0x45dc82[_0x2c6791][_0x7104('0x67')])[_0x7104('0x68')](_0x7104('0x69'))};for(var _0x278a58=0x0,_0x1a1bf7=_0x29fc52['length'];_0x278a58<_0x1a1bf7;_0x278a58++){if(_0x29fc52[_0x278a58]['SessionId']==_0x45dc82[_0x2c6791]['id']&&_0x333470[_0x7104('0x5e')](_0x29fc52[_0x278a58][_0x7104('0x6a')])){_0x212145[_0x333470[_0x29fc52[_0x278a58]['questionId']]]=_0x29fc52[_0x278a58][_0x7104('0x6b')];}}for(var _0x5b5b47 in _0x333470){if(!_0x212145['hasOwnProperty'](_0x333470[_0x5b5b47])){_0x212145[_0x333470[_0x5b5b47]]=null;}}_0x4389ac[_0x7104('0x6c')](_0x212145);}return _0x4389ac;}})['then'](function(_0x21bf2e){if(!_['isEmpty'](_0x21bf2e)){var _0xf6daf0=toCsv(_0x21bf2e);var _0x490ee6=Date['now']();fs[_0x7104('0x6d')](util[_0x7104('0x68')](_0x7104('0x6e'),_0x285a35[_0x7104('0x48')]['id'],_0x490ee6),_0xf6daf0);_0x189511[_0x7104('0x6f')](_0x7104('0x70'),_0x7104('0x71')+util[_0x7104('0x68')](_0x7104('0x72'),_0x285a35[_0x7104('0x48')]['id'],_0x490ee6));_0x189511[_0x7104('0x6f')]('Content-type',_0x7104('0x73'));return _0x189511['download'](util[_0x7104('0x68')](_0x7104('0x6e'),_0x285a35[_0x7104('0x48')]['id'],_0x490ee6));}else{return _0x189511['sendStatus'](0xcc);}})[_0x7104('0x46')](handleError(_0x189511,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index c909453..2f6787f 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 _0x0c9c=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x13d577,_0x54156b){var _0x54304e=function(_0x284e92){while(--_0x284e92){_0x13d577['push'](_0x13d577['shift']());}};_0x54304e(++_0x54156b);}(_0x0c9c,0x188));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc0c9('0x0'));var util=require(_0xc0c9('0x1'));var logger=require(_0xc0c9('0x2'))(_0xc0c9('0x3'));var moment=require('moment');var BPromise=require(_0xc0c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0c9('0x5'));var rimraf=require(_0xc0c9('0x6'));var config=require(_0xc0c9('0x7'));var attributes=require(_0xc0c9('0x8'));module[_0xc0c9('0x9')]=function(_0x46f5be,_0x439963){return _0x46f5be[_0xc0c9('0xa')](_0xc0c9('0xb'),attributes,{'tableName':_0xc0c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe714=['path','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','../../config/logger','api','moment','bluebird'];(function(_0x52bf06,_0x5dd574){var _0x504765=function(_0x17e286){while(--_0x17e286){_0x52bf06['push'](_0x52bf06['shift']());}};_0x504765(++_0x5dd574);}(_0xe714,0xe2));var _0x4e71=function(_0x16e852,_0xe45fef){_0x16e852=_0x16e852-0x0;var _0xc62565=_0xe714[_0x16e852];return _0xc62565;};'use strict';var _=require(_0x4e71('0x0'));var util=require('util');var logger=require(_0x4e71('0x1'))(_0x4e71('0x2'));var moment=require(_0x4e71('0x3'));var BPromise=require(_0x4e71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e71('0x5'));var rimraf=require('rimraf');var config=require(_0x4e71('0x6'));var attributes=require(_0x4e71('0x7'));module[_0x4e71('0x8')]=function(_0x204a19,_0xfe1559){return _0x204a19[_0x4e71('0x9')]('JscriptyProject',attributes,{'tableName':_0x4e71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 41ad880..a36faa1 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 _0xf30f=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','request','then','info','request\x20sent','debug','stringify','error'];(function(_0xfb6c20,_0x4bcf73){var _0x4c11c0=function(_0x505f25){while(--_0x505f25){_0xfb6c20['push'](_0xfb6c20['shift']());}};_0x4c11c0(++_0x4bcf73);}(_0xf30f,0x1d9));var _0xff30=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf30f[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xff30('0x0'));var util=require(_0xff30('0x1'));var moment=require('moment');var BPromise=require(_0xff30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff30('0x3'))['db'];var utils=require(_0xff30('0x4'));var logger=require(_0xff30('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43d7da,_0x54291f,_0x1e7a39){return new BPromise(function(_0x213a58,_0xa01a4d){return client[_0xff30('0x6')](_0x43d7da,_0x1e7a39)[_0xff30('0x7')](function(_0xb09bec){logger[_0xff30('0x8')]('JscriptyProject,\x20%s,\x20%s',_0x54291f,_0xff30('0x9'));logger[_0xff30('0xa')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x54291f,_0xff30('0x9'),JSON[_0xff30('0xb')](_0xb09bec));if(_0xb09bec[_0xff30('0xc')]){if(_0xb09bec[_0xff30('0xc')][_0xff30('0xd')]===0x1f4){logger[_0xff30('0xc')](_0xff30('0xe'),_0x54291f,_0xb09bec[_0xff30('0xc')][_0xff30('0xf')]);return _0xa01a4d(_0xb09bec[_0xff30('0xc')][_0xff30('0xf')]);}logger['error'](_0xff30('0xe'),_0x54291f,_0xb09bec[_0xff30('0xc')][_0xff30('0xf')]);return _0x213a58(_0xb09bec['error'][_0xff30('0xf')]);}else{logger[_0xff30('0x8')](_0xff30('0xe'),_0x54291f,_0xff30('0x9'));_0x213a58(_0xb09bec[_0xff30('0x10')]['message']);}})[_0xff30('0x11')](function(_0x1a074b){logger[_0xff30('0xc')](_0xff30('0xe'),_0x54291f,_0x1a074b);_0xa01a4d(_0x1a074b);});});} \ No newline at end of file +var _0xd98c=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x3e3c73,_0x2c8583){var _0x5d4cb4=function(_0x1e3443){while(--_0x1e3443){_0x3e3c73['push'](_0x3e3c73['shift']());}};_0x5d4cb4(++_0x2c8583);}(_0xd98c,0x121));var _0xcd98=function(_0x38f28e,_0x49da15){_0x38f28e=_0x38f28e-0x0;var _0x37395d=_0xd98c[_0x38f28e];return _0x37395d;};'use strict';var _=require(_0xcd98('0x0'));var util=require(_0xcd98('0x1'));var moment=require('moment');var BPromise=require(_0xcd98('0x2'));var rs=require(_0xcd98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd98('0x4'))['db'];var utils=require(_0xcd98('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcd98('0x6'));var client=jayson[_0xcd98('0x7')][_0xcd98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34e83c,_0x3b4c65,_0x53b20c){return new BPromise(function(_0x22ac5f,_0x4e49a5){return client[_0xcd98('0x9')](_0x34e83c,_0x53b20c)[_0xcd98('0xa')](function(_0x41ea1d){logger['info'](_0xcd98('0xb'),_0x3b4c65,_0xcd98('0xc'));logger[_0xcd98('0xd')](_0xcd98('0xe'),_0x3b4c65,_0xcd98('0xc'),JSON['stringify'](_0x41ea1d));if(_0x41ea1d['error']){if(_0x41ea1d['error']['code']===0x1f4){logger['error'](_0xcd98('0xb'),_0x3b4c65,_0x41ea1d[_0xcd98('0xf')][_0xcd98('0x10')]);return _0x4e49a5(_0x41ea1d[_0xcd98('0xf')][_0xcd98('0x10')]);}logger[_0xcd98('0xf')](_0xcd98('0xb'),_0x3b4c65,_0x41ea1d[_0xcd98('0xf')][_0xcd98('0x10')]);return _0x22ac5f(_0x41ea1d[_0xcd98('0xf')]['message']);}else{logger[_0xcd98('0x11')](_0xcd98('0xb'),_0x3b4c65,_0xcd98('0xc'));_0x22ac5f(_0x41ea1d[_0xcd98('0x12')]['message']);}})[_0xcd98('0x13')](function(_0x2af5fc){logger['error'](_0xcd98('0xb'),_0x3b4c65,_0x2af5fc);_0x4e49a5(_0x2af5fc);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2e24a46..2d0840b 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 _0x454d=['isAuthenticated','/describe','describe','/:id','create','put','update','delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get'];(function(_0x49416f,_0x457ccd){var _0x57ee0d=function(_0x416dc0){while(--_0x416dc0){_0x49416f['push'](_0x49416f['shift']());}};_0x57ee0d(++_0x457ccd);}(_0x454d,0x17f));var _0xd454=function(_0x33f7e1,_0x48d209){_0x33f7e1=_0x33f7e1-0x0;var _0x23bab4=_0x454d[_0x33f7e1];return _0x23bab4;};'use strict';var multer=require(_0xd454('0x0'));var util=require('util');var path=require(_0xd454('0x1'));var timeout=require('connect-timeout');var express=require(_0xd454('0x2'));var router=express['Router']();var auth=require(_0xd454('0x3'));var interaction=require(_0xd454('0x4'));var config=require(_0xd454('0x5'));var controller=require(_0xd454('0x6'));router[_0xd454('0x7')]('/',auth[_0xd454('0x8')](),controller['index']);router[_0xd454('0x7')](_0xd454('0x9'),auth[_0xd454('0x8')](),controller[_0xd454('0xa')]);router[_0xd454('0x7')](_0xd454('0xb'),auth[_0xd454('0x8')](),controller['show']);router['post']('/',auth[_0xd454('0x8')](),controller[_0xd454('0xc')]);router[_0xd454('0xd')]('/:id',auth[_0xd454('0x8')](),controller[_0xd454('0xe')]);router[_0xd454('0xf')](_0xd454('0xb'),auth[_0xd454('0x8')](),controller[_0xd454('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc8b7=['index','/describe','describe','/:id','show','post','create','update','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x1c505a,_0xab6160){var _0xfea819=function(_0xa2d898){while(--_0xa2d898){_0x1c505a['push'](_0x1c505a['shift']());}};_0xfea819(++_0xab6160);}(_0xc8b7,0x91));var _0x7c8b=function(_0x34a403,_0xb78489){_0x34a403=_0x34a403-0x0;var _0x2dc53e=_0xc8b7[_0x34a403];return _0x2dc53e;};'use strict';var multer=require('multer');var util=require(_0x7c8b('0x0'));var path=require(_0x7c8b('0x1'));var timeout=require(_0x7c8b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x7c8b('0x3'));var interaction=require(_0x7c8b('0x4'));var config=require('../../config/environment');var controller=require(_0x7c8b('0x5'));router[_0x7c8b('0x6')]('/',auth[_0x7c8b('0x7')](),controller[_0x7c8b('0x8')]);router['get'](_0x7c8b('0x9'),auth[_0x7c8b('0x7')](),controller[_0x7c8b('0xa')]);router[_0x7c8b('0x6')](_0x7c8b('0xb'),auth['isAuthenticated'](),controller[_0x7c8b('0xc')]);router[_0x7c8b('0xd')]('/',auth[_0x7c8b('0x7')](),controller[_0x7c8b('0xe')]);router['put']('/:id',auth[_0x7c8b('0x7')](),controller[_0x7c8b('0xf')]);router['delete']('/:id',auth[_0x7c8b('0x7')](),controller[_0x7c8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9e8a3cc..de511ab 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 _0xb74d=['sequelize','STRING','long'];(function(_0x2c482f,_0x448643){var _0x794093=function(_0x4cf611){while(--_0x4cf611){_0x2c482f['push'](_0x2c482f['shift']());}};_0x794093(++_0x448643);}(_0xb74d,0x16e));var _0xdb74=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0xb74d[_0x4df1f5];return _0x56585b;};'use strict';var Sequelize=require(_0xdb74('0x0'));module['exports']={'question':{'type':Sequelize[_0xdb74('0x1')]},'answer':{'type':Sequelize['TEXT'](_0xdb74('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xdb74('0x1')]},'queue':{'type':Sequelize[_0xdb74('0x1')]},'uniqueid':{'type':Sequelize[_0xdb74('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdb74('0x1')]},'questionId':{'type':Sequelize[_0xdb74('0x1')]}}; \ No newline at end of file +var _0x2f72=['STRING','TEXT','long','sequelize','exports'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x2f72,0x166));var _0x22f7=function(_0x42c03a,_0x4e4417){_0x42c03a=_0x42c03a-0x0;var _0x46a8d9=_0x2f72[_0x42c03a];return _0x46a8d9;};'use strict';var Sequelize=require(_0x22f7('0x0'));module[_0x22f7('0x1')]={'question':{'type':Sequelize[_0x22f7('0x2')]},'answer':{'type':Sequelize[_0x22f7('0x3')](_0x22f7('0x4'))},'membername':{'type':Sequelize[_0x22f7('0x2')]},'projectname':{'type':Sequelize[_0x22f7('0x2')]},'queue':{'type':Sequelize[_0x22f7('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22f7('0x2')]},'calleridnum':{'type':Sequelize[_0x22f7('0x2')]},'questionId':{'type':Sequelize[_0x22f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 81515fb..9df2c92 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 _0xa045=['end','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x5d7c46,_0x1ed609){var _0x3bd0c4=function(_0x2f1335){while(--_0x2f1335){_0x5d7c46['push'](_0x5d7c46['shift']());}};_0x3bd0c4(++_0x1ed609);}(_0xa045,0xc4));var _0x5a04=function(_0x1eec9e,_0x3481cd){_0x1eec9e=_0x1eec9e-0x0;var _0x5a5b9d=_0xa045[_0x1eec9e];return _0x5a5b9d;};'use strict';var pdf=require(_0x5a04('0x0'));var emlformat=require(_0x5a04('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5a04('0x2'));var jsonpatch=require(_0x5a04('0x3'));var rp=require('request-promise');var moment=require(_0x5a04('0x4'));var BPromise=require(_0x5a04('0x5'));var Mustache=require(_0x5a04('0x6'));var util=require(_0x5a04('0x7'));var path=require(_0x5a04('0x8'));var sox=require(_0x5a04('0x9'));var csv=require('to-csv');var ejs=require(_0x5a04('0xa'));var fs=require('fs');var _=require(_0x5a04('0xb'));var squel=require(_0x5a04('0xc'));var crypto=require('crypto');var jsforce=require(_0x5a04('0xd'));var deskjs=require(_0x5a04('0xe'));var toCsv=require(_0x5a04('0xf'));var querystring=require(_0x5a04('0x10'));var Papa=require(_0x5a04('0x11'));var Redis=require('ioredis');var authService=require(_0x5a04('0x12'));var qs=require(_0x5a04('0x13'));var hardwareService=require(_0x5a04('0x14'));var logger=require(_0x5a04('0x15'))(_0x5a04('0x16'));var utils=require(_0x5a04('0x17'));var config=require('../../config/environment');var db=require(_0x5a04('0x18'))['db'];function respondWithStatusCode(_0x40a5d0,_0x3731ba){_0x3731ba=_0x3731ba||0xcc;return function(_0x542e34){if(_0x542e34){return _0x40a5d0['sendStatus'](_0x3731ba);}return _0x40a5d0[_0x5a04('0x19')](_0x3731ba)[_0x5a04('0x1a')]();};}function respondWithResult(_0x3b21a9,_0x57167f){_0x57167f=_0x57167f||0xc8;return function(_0x562761){if(_0x562761){return _0x3b21a9['status'](_0x57167f)['json'](_0x562761);}};}function respondWithFilteredResult(_0x4c8672,_0x478789){return function(_0x1b6075){if(_0x1b6075){var _0x3accbe=_0x1b6075[_0x5a04('0x1b')],_0x1661ac=_0x478789[_0x5a04('0x1c')],_0x263b05=_0x478789[_0x5a04('0x1c')]+_0x478789['limit'],_0x11c14b;if(_0x263b05>=_0x3accbe){_0x263b05=_0x3accbe;_0x11c14b=0xc8;}else{_0x11c14b=0xce;}_0x4c8672[_0x5a04('0x19')](_0x11c14b);return _0x4c8672[_0x5a04('0x1d')]('Content-Range',_0x1661ac+'-'+_0x263b05+'/'+_0x3accbe)['json'](_0x1b6075);}return null;};}function patchUpdates(_0x16404e){return function(_0x32db32){try{jsonpatch[_0x5a04('0x1e')](_0x32db32,_0x16404e,!![]);}catch(_0x18c6f6){return BPromise[_0x5a04('0x1f')](_0x18c6f6);}return _0x32db32[_0x5a04('0x20')]();};}function saveUpdates(_0x4cc07a,_0x47e18c){return function(_0x22325c){if(_0x22325c){return _0x22325c[_0x5a04('0x21')](_0x4cc07a)[_0x5a04('0x22')](function(_0x6eb0e4){return _0x6eb0e4;});}return null;};}function removeEntity(_0x39d27f,_0x33f253){return function(_0x599b57){if(_0x599b57){return _0x599b57[_0x5a04('0x23')]()[_0x5a04('0x22')](function(){_0x39d27f['status'](0xcc)[_0x5a04('0x1a')]();});}};}function handleEntityNotFound(_0x574451,_0x5efcad){return function(_0x41e7c1){if(!_0x41e7c1){_0x574451[_0x5a04('0x24')](0x194);}return _0x41e7c1;};}function handleError(_0x7c8a09,_0x4ec075){_0x4ec075=_0x4ec075||0x1f4;return function(_0x2506ea){logger[_0x5a04('0x25')](_0x2506ea['stack']);if(_0x2506ea[_0x5a04('0x26')]){delete _0x2506ea[_0x5a04('0x26')];}_0x7c8a09['status'](_0x4ec075)['send'](_0x2506ea);};}exports[_0x5a04('0x27')]=function(_0x3a82e3,_0x1c37f4){var _0x2e5849={},_0x3047f3={},_0x5f327a={'count':0x0,'rows':[]};var _0x38a32e=db[_0x5a04('0x28')][_0x5a04('0x29')];_0x3047f3[_0x5a04('0x2a')]=_[_0x5a04('0x2b')](_0x38a32e);_0x3047f3[_0x5a04('0x2c')]=_[_0x5a04('0x2b')](_0x3a82e3['query']);_0x3047f3[_0x5a04('0x2d')]=_[_0x5a04('0x2e')](_0x3047f3['model'],_0x3047f3[_0x5a04('0x2c')]);_0x2e5849['attributes']=_[_0x5a04('0x2e')](_0x3047f3[_0x5a04('0x2a')],qs['fields'](_0x3a82e3['query'][_0x5a04('0x2f')]));_0x2e5849['attributes']=_0x2e5849['attributes'][_0x5a04('0x30')]?_0x2e5849[_0x5a04('0x31')]:_0x3047f3[_0x5a04('0x2a')];if(!_0x3a82e3['query'][_0x5a04('0x32')]('nolimit')){_0x2e5849[_0x5a04('0x33')]=qs[_0x5a04('0x33')](_0x3a82e3[_0x5a04('0x2c')]['limit']);_0x2e5849['offset']=qs[_0x5a04('0x1c')](_0x3a82e3[_0x5a04('0x2c')][_0x5a04('0x1c')]);}_0x2e5849['order']=qs[_0x5a04('0x34')](_0x3a82e3[_0x5a04('0x2c')]['sort']);_0x2e5849[_0x5a04('0x35')]=qs[_0x5a04('0x2d')](_[_0x5a04('0x36')](_0x3a82e3[_0x5a04('0x2c')],_0x3047f3[_0x5a04('0x2d')]));if(_0x3a82e3[_0x5a04('0x2c')][_0x5a04('0x37')]){_0x2e5849['where']=_[_0x5a04('0x38')](_0x2e5849['where'],{'$or':_[_0x5a04('0x39')](_0x38a32e,function(_0x3e298a){if(_0x3e298a[_0x5a04('0x3a')][_0x5a04('0x3b')]!==_0x5a04('0x3c')){var _0xb37d86={};_0xb37d86[_0x3e298a[_0x5a04('0x3d')]]={'$like':'%'+_0x3a82e3[_0x5a04('0x2c')][_0x5a04('0x37')]+'%'};return _0xb37d86;}})});}_0x2e5849=_[_0x5a04('0x38')]({},_0x2e5849,_0x3a82e3['options']);var _0x23db41={'where':_0x2e5849[_0x5a04('0x35')]};return db[_0x5a04('0x28')][_0x5a04('0x1b')](_0x23db41)[_0x5a04('0x22')](function(_0x4c9b6f){_0x5f327a[_0x5a04('0x1b')]=_0x4c9b6f;if(_0x3a82e3['query'][_0x5a04('0x3e')]){_0x2e5849[_0x5a04('0x3f')]=[{'all':!![]}];}return db[_0x5a04('0x28')][_0x5a04('0x40')](_0x2e5849);})['then'](function(_0x542271){_0x5f327a[_0x5a04('0x41')]=_0x542271;return _0x5f327a;})[_0x5a04('0x22')](respondWithFilteredResult(_0x1c37f4,_0x2e5849))[_0x5a04('0x42')](handleError(_0x1c37f4,null));};exports[_0x5a04('0x43')]=function(_0xb9c2d9,_0x1f4674){var _0x38e58f={'raw':!![],'where':{'id':_0xb9c2d9[_0x5a04('0x44')]['id']}},_0x507a7b={};_0x507a7b['model']=_[_0x5a04('0x2b')](db[_0x5a04('0x28')][_0x5a04('0x29')]);_0x507a7b['query']=_[_0x5a04('0x2b')](_0xb9c2d9[_0x5a04('0x2c')]);_0x507a7b[_0x5a04('0x2d')]=_['intersection'](_0x507a7b[_0x5a04('0x2a')],_0x507a7b[_0x5a04('0x2c')]);_0x38e58f[_0x5a04('0x31')]=_[_0x5a04('0x2e')](_0x507a7b['model'],qs[_0x5a04('0x2f')](_0xb9c2d9[_0x5a04('0x2c')][_0x5a04('0x2f')]));_0x38e58f[_0x5a04('0x31')]=_0x38e58f[_0x5a04('0x31')][_0x5a04('0x30')]?_0x38e58f[_0x5a04('0x31')]:_0x507a7b[_0x5a04('0x2a')];if(_0xb9c2d9[_0x5a04('0x2c')][_0x5a04('0x3e')]){_0x38e58f[_0x5a04('0x3f')]=[{'all':!![]}];}_0x38e58f=_[_0x5a04('0x38')]({},_0x38e58f,_0xb9c2d9[_0x5a04('0x45')]);return db[_0x5a04('0x28')][_0x5a04('0x46')](_0x38e58f)[_0x5a04('0x22')](handleEntityNotFound(_0x1f4674,null))['then'](respondWithResult(_0x1f4674,null))['catch'](handleError(_0x1f4674,null));};exports[_0x5a04('0x47')]=function(_0xdf55fc,_0x7849f9){return db[_0x5a04('0x28')][_0x5a04('0x47')](_0xdf55fc[_0x5a04('0x48')],{})[_0x5a04('0x22')](respondWithResult(_0x7849f9,0xc9))[_0x5a04('0x42')](handleError(_0x7849f9,null));};exports[_0x5a04('0x21')]=function(_0x458ba5,_0x18db66){if(_0x458ba5[_0x5a04('0x48')]['id']){delete _0x458ba5[_0x5a04('0x48')]['id'];}return db[_0x5a04('0x28')][_0x5a04('0x46')]({'where':{'id':_0x458ba5[_0x5a04('0x44')]['id']}})[_0x5a04('0x22')](handleEntityNotFound(_0x18db66,null))['then'](saveUpdates(_0x458ba5[_0x5a04('0x48')],null))['then'](respondWithResult(_0x18db66,null))['catch'](handleError(_0x18db66,null));};exports[_0x5a04('0x23')]=function(_0xe6cf4e,_0x325f60){return db[_0x5a04('0x28')]['find']({'where':{'id':_0xe6cf4e[_0x5a04('0x44')]['id']}})[_0x5a04('0x22')](handleEntityNotFound(_0x325f60,null))[_0x5a04('0x22')](removeEntity(_0x325f60,null))[_0x5a04('0x42')](handleError(_0x325f60,null));};exports[_0x5a04('0x49')]=function(_0xfc18d7,_0x24c404){return db['JscriptyQuestionReport']['describe']()[_0x5a04('0x22')](respondWithResult(_0x24c404,null))[_0x5a04('0x42')](handleError(_0x24c404,null));}; \ No newline at end of file +var _0x9f80=['index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','type','options','JscriptyQuestionReport','includeAll','rows','catch','show','find','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send'];(function(_0x52c962,_0x4a8308){var _0x154f31=function(_0x4854f3){while(--_0x4854f3){_0x52c962['push'](_0x52c962['shift']());}};_0x154f31(++_0x4a8308);}(_0x9f80,0xeb));var _0x09f8=function(_0x3c79bc,_0x490aba){_0x3c79bc=_0x3c79bc-0x0;var _0x3a29d2=_0x9f80[_0x3c79bc];return _0x3a29d2;};'use strict';var pdf=require(_0x09f8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x09f8('0x1'));var jsonpatch=require(_0x09f8('0x2'));var rp=require(_0x09f8('0x3'));var moment=require('moment');var BPromise=require(_0x09f8('0x4'));var Mustache=require(_0x09f8('0x5'));var util=require('util');var path=require(_0x09f8('0x6'));var sox=require(_0x09f8('0x7'));var csv=require(_0x09f8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x09f8('0x9'));var squel=require(_0x09f8('0xa'));var crypto=require(_0x09f8('0xb'));var jsforce=require(_0x09f8('0xc'));var deskjs=require(_0x09f8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09f8('0xe'));var Papa=require(_0x09f8('0xf'));var Redis=require(_0x09f8('0x10'));var authService=require(_0x09f8('0x11'));var qs=require(_0x09f8('0x12'));var hardwareService=require(_0x09f8('0x13'));var logger=require('../../config/logger')(_0x09f8('0x14'));var utils=require(_0x09f8('0x15'));var config=require(_0x09f8('0x16'));var db=require(_0x09f8('0x17'))['db'];function respondWithStatusCode(_0x3d0620,_0x261477){_0x261477=_0x261477||0xcc;return function(_0x42492e){if(_0x42492e){return _0x3d0620['sendStatus'](_0x261477);}return _0x3d0620[_0x09f8('0x18')](_0x261477)[_0x09f8('0x19')]();};}function respondWithResult(_0x38371e,_0x40e96b){_0x40e96b=_0x40e96b||0xc8;return function(_0x6dac51){if(_0x6dac51){return _0x38371e[_0x09f8('0x18')](_0x40e96b)[_0x09f8('0x1a')](_0x6dac51);}};}function respondWithFilteredResult(_0x49b95d,_0x17160e){return function(_0x57c4df){if(_0x57c4df){var _0x2be2e0=_0x57c4df[_0x09f8('0x1b')],_0x5d3598=_0x17160e[_0x09f8('0x1c')],_0x3edf1a=_0x17160e[_0x09f8('0x1c')]+_0x17160e[_0x09f8('0x1d')],_0x417ab6;if(_0x3edf1a>=_0x2be2e0){_0x3edf1a=_0x2be2e0;_0x417ab6=0xc8;}else{_0x417ab6=0xce;}_0x49b95d[_0x09f8('0x18')](_0x417ab6);return _0x49b95d[_0x09f8('0x1e')](_0x09f8('0x1f'),_0x5d3598+'-'+_0x3edf1a+'/'+_0x2be2e0)[_0x09f8('0x1a')](_0x57c4df);}return null;};}function patchUpdates(_0x5597e0){return function(_0x4553e4){try{jsonpatch[_0x09f8('0x20')](_0x4553e4,_0x5597e0,!![]);}catch(_0x3986fe){return BPromise[_0x09f8('0x21')](_0x3986fe);}return _0x4553e4['save']();};}function saveUpdates(_0x158ae9,_0x533a12){return function(_0x16cdf2){if(_0x16cdf2){return _0x16cdf2[_0x09f8('0x22')](_0x158ae9)[_0x09f8('0x23')](function(_0x9b00fc){return _0x9b00fc;});}return null;};}function removeEntity(_0x5d1e84,_0x2b5e81){return function(_0x60931a){if(_0x60931a){return _0x60931a[_0x09f8('0x24')]()[_0x09f8('0x23')](function(){_0x5d1e84['status'](0xcc)[_0x09f8('0x19')]();});}};}function handleEntityNotFound(_0xc2837d,_0x169239){return function(_0x4f6c25){if(!_0x4f6c25){_0xc2837d[_0x09f8('0x25')](0x194);}return _0x4f6c25;};}function handleError(_0x53b81c,_0x1d4397){_0x1d4397=_0x1d4397||0x1f4;return function(_0x1cc10a){logger[_0x09f8('0x26')](_0x1cc10a['stack']);if(_0x1cc10a[_0x09f8('0x27')]){delete _0x1cc10a['name'];}_0x53b81c[_0x09f8('0x18')](_0x1d4397)[_0x09f8('0x28')](_0x1cc10a);};}exports[_0x09f8('0x29')]=function(_0x5ca6b8,_0x5acd6a){var _0xaafd93={},_0x3d1c17={},_0x1b13d1={'count':0x0,'rows':[]};var _0x1d5870=db['JscriptyQuestionReport'][_0x09f8('0x2a')];_0x3d1c17[_0x09f8('0x2b')]=_[_0x09f8('0x2c')](_0x1d5870);_0x3d1c17[_0x09f8('0x2d')]=_[_0x09f8('0x2c')](_0x5ca6b8[_0x09f8('0x2d')]);_0x3d1c17['filters']=_[_0x09f8('0x2e')](_0x3d1c17[_0x09f8('0x2b')],_0x3d1c17[_0x09f8('0x2d')]);_0xaafd93['attributes']=_['intersection'](_0x3d1c17[_0x09f8('0x2b')],qs[_0x09f8('0x2f')](_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x2f')]));_0xaafd93['attributes']=_0xaafd93[_0x09f8('0x30')][_0x09f8('0x31')]?_0xaafd93[_0x09f8('0x30')]:_0x3d1c17[_0x09f8('0x2b')];if(!_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x32')]('nolimit')){_0xaafd93[_0x09f8('0x1d')]=qs[_0x09f8('0x1d')](_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x1d')]);_0xaafd93[_0x09f8('0x1c')]=qs[_0x09f8('0x1c')](_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x1c')]);}_0xaafd93['order']=qs[_0x09f8('0x33')](_0x5ca6b8[_0x09f8('0x2d')]['sort']);_0xaafd93[_0x09f8('0x34')]=qs[_0x09f8('0x35')](_[_0x09f8('0x36')](_0x5ca6b8[_0x09f8('0x2d')],_0x3d1c17[_0x09f8('0x35')]));if(_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x37')]){_0xaafd93['where']=_[_0x09f8('0x38')](_0xaafd93['where'],{'$or':_[_0x09f8('0x39')](_0x1d5870,function(_0x4bae9c){if(_0x4bae9c[_0x09f8('0x3a')]['key']!=='VIRTUAL'){var _0x6ca4ba={};_0x6ca4ba[_0x4bae9c['field']]={'$like':'%'+_0x5ca6b8[_0x09f8('0x2d')][_0x09f8('0x37')]+'%'};return _0x6ca4ba;}})});}_0xaafd93=_['merge']({},_0xaafd93,_0x5ca6b8[_0x09f8('0x3b')]);var _0x171c1d={'where':_0xaafd93[_0x09f8('0x34')]};return db[_0x09f8('0x3c')][_0x09f8('0x1b')](_0x171c1d)[_0x09f8('0x23')](function(_0x618de2){_0x1b13d1['count']=_0x618de2;if(_0x5ca6b8['query'][_0x09f8('0x3d')]){_0xaafd93['include']=[{'all':!![]}];}return db[_0x09f8('0x3c')]['findAll'](_0xaafd93);})[_0x09f8('0x23')](function(_0x49de10){_0x1b13d1[_0x09f8('0x3e')]=_0x49de10;return _0x1b13d1;})[_0x09f8('0x23')](respondWithFilteredResult(_0x5acd6a,_0xaafd93))[_0x09f8('0x3f')](handleError(_0x5acd6a,null));};exports[_0x09f8('0x40')]=function(_0x18fe12,_0x8de84f){var _0x3608b6={'raw':!![],'where':{'id':_0x18fe12['params']['id']}},_0x5235c5={};_0x5235c5[_0x09f8('0x2b')]=_['keys'](db[_0x09f8('0x3c')][_0x09f8('0x2a')]);_0x5235c5[_0x09f8('0x2d')]=_['keys'](_0x18fe12[_0x09f8('0x2d')]);_0x5235c5['filters']=_[_0x09f8('0x2e')](_0x5235c5['model'],_0x5235c5[_0x09f8('0x2d')]);_0x3608b6[_0x09f8('0x30')]=_[_0x09f8('0x2e')](_0x5235c5[_0x09f8('0x2b')],qs[_0x09f8('0x2f')](_0x18fe12[_0x09f8('0x2d')]['fields']));_0x3608b6['attributes']=_0x3608b6[_0x09f8('0x30')]['length']?_0x3608b6['attributes']:_0x5235c5[_0x09f8('0x2b')];if(_0x18fe12['query']['includeAll']){_0x3608b6['include']=[{'all':!![]}];}_0x3608b6=_[_0x09f8('0x38')]({},_0x3608b6,_0x18fe12['options']);return db[_0x09f8('0x3c')][_0x09f8('0x41')](_0x3608b6)['then'](handleEntityNotFound(_0x8de84f,null))[_0x09f8('0x23')](respondWithResult(_0x8de84f,null))[_0x09f8('0x3f')](handleError(_0x8de84f,null));};exports['create']=function(_0x483457,_0x269913){return db['JscriptyQuestionReport']['create'](_0x483457[_0x09f8('0x42')],{})[_0x09f8('0x23')](respondWithResult(_0x269913,0xc9))['catch'](handleError(_0x269913,null));};exports[_0x09f8('0x22')]=function(_0x95e379,_0x5a131f){if(_0x95e379[_0x09f8('0x42')]['id']){delete _0x95e379[_0x09f8('0x42')]['id'];}return db[_0x09f8('0x3c')][_0x09f8('0x41')]({'where':{'id':_0x95e379[_0x09f8('0x43')]['id']}})[_0x09f8('0x23')](handleEntityNotFound(_0x5a131f,null))['then'](saveUpdates(_0x95e379[_0x09f8('0x42')],null))[_0x09f8('0x23')](respondWithResult(_0x5a131f,null))['catch'](handleError(_0x5a131f,null));};exports[_0x09f8('0x24')]=function(_0x3af823,_0x17de0c){return db[_0x09f8('0x3c')][_0x09f8('0x41')]({'where':{'id':_0x3af823['params']['id']}})[_0x09f8('0x23')](handleEntityNotFound(_0x17de0c,null))['then'](removeEntity(_0x17de0c,null))[_0x09f8('0x3f')](handleError(_0x17de0c,null));};exports[_0x09f8('0x44')]=function(_0xdeaf6b,_0x10fef2){return db[_0x09f8('0x3c')][_0x09f8('0x44')]()[_0x09f8('0x23')](respondWithResult(_0x10fef2,null))[_0x09f8('0x3f')](handleError(_0x10fef2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index dfe9740..7270250 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 _0xb0d2=['define','JscriptyQuestionReport','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x45423e,_0x4cc862){var _0x3157c1=function(_0x5ddce4){while(--_0x5ddce4){_0x45423e['push'](_0x45423e['shift']());}};_0x3157c1(++_0x4cc862);}(_0xb0d2,0xb2));var _0x2b0d=function(_0x5530d0,_0x56bac6){_0x5530d0=_0x5530d0-0x0;var _0x4b4285=_0xb0d2[_0x5530d0];return _0x4b4285;};'use strict';var _=require(_0x2b0d('0x0'));var util=require(_0x2b0d('0x1'));var logger=require(_0x2b0d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2b0d('0x3'));var rp=require(_0x2b0d('0x4'));var fs=require('fs');var path=require(_0x2b0d('0x5'));var rimraf=require(_0x2b0d('0x6'));var config=require(_0x2b0d('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x2b0d('0x8')]=function(_0x1df39d,_0x2e074a){return _0x1df39d[_0x2b0d('0x9')](_0x2b0d('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe225=['bluebird','path','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','util','../../config/logger','api','moment'];(function(_0x34fd3c,_0x50abef){var _0x44083=function(_0x380aa1){while(--_0x380aa1){_0x34fd3c['push'](_0x34fd3c['shift']());}};_0x44083(++_0x50abef);}(_0xe225,0xac));var _0x5e22=function(_0x4e410f,_0x22beb7){_0x4e410f=_0x4e410f-0x0;var _0x3cd25c=_0xe225[_0x4e410f];return _0x3cd25c;};'use strict';var _=require('lodash');var util=require(_0x5e22('0x0'));var logger=require(_0x5e22('0x1'))(_0x5e22('0x2'));var moment=require(_0x5e22('0x3'));var BPromise=require(_0x5e22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e22('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5e22('0x6'));module['exports']=function(_0x3ef3a5,_0x48bd50){return _0x3ef3a5['define'](_0x5e22('0x7'),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 a6b6c11..95f881d 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 _0x1128=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1128,0xef));var _0x8112=function(_0x3102af,_0x137b65){_0x3102af=_0x3102af-0x0;var _0x3c208c=_0x1128[_0x3102af];return _0x3c208c;};'use strict';var _=require('lodash');var util=require(_0x8112('0x0'));var moment=require(_0x8112('0x1'));var BPromise=require(_0x8112('0x2'));var rs=require(_0x8112('0x3'));var fs=require('fs');var Redis=require(_0x8112('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8112('0x5'));var logger=require(_0x8112('0x6'))(_0x8112('0x7'));var config=require('../../config/environment');var jayson=require(_0x8112('0x8'));var client=jayson[_0x8112('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1327c1,_0x58a881,_0x4e86d2){return new BPromise(function(_0x380b6c,_0x47f396){return client[_0x8112('0xa')](_0x1327c1,_0x4e86d2)[_0x8112('0xb')](function(_0x5c4ffc){logger['info'](_0x8112('0xc'),_0x58a881,_0x8112('0xd'));logger[_0x8112('0xe')](_0x8112('0xf'),_0x58a881,_0x8112('0xd'),JSON[_0x8112('0x10')](_0x5c4ffc));if(_0x5c4ffc['error']){if(_0x5c4ffc[_0x8112('0x11')][_0x8112('0x12')]===0x1f4){logger['error'](_0x8112('0xc'),_0x58a881,_0x5c4ffc[_0x8112('0x11')]['message']);return _0x47f396(_0x5c4ffc[_0x8112('0x11')][_0x8112('0x13')]);}logger['error'](_0x8112('0xc'),_0x58a881,_0x5c4ffc[_0x8112('0x11')][_0x8112('0x13')]);return _0x380b6c(_0x5c4ffc[_0x8112('0x11')]['message']);}else{logger[_0x8112('0x14')](_0x8112('0xc'),_0x58a881,_0x8112('0xd'));_0x380b6c(_0x5c4ffc[_0x8112('0x15')][_0x8112('0x13')]);}})['catch'](function(_0x5d3c6e){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x58a881,_0x5d3c6e);_0x47f396(_0x5d3c6e);});});} \ No newline at end of file +var _0xaf4d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1158f6,_0x59d2bc){var _0x2f4b3b=function(_0x42a0f0){while(--_0x42a0f0){_0x1158f6['push'](_0x1158f6['shift']());}};_0x2f4b3b(++_0x59d2bc);}(_0xaf4d,0x19e));var _0xdaf4=function(_0x5e2244,_0x3c6742){_0x5e2244=_0x5e2244-0x0;var _0x5bbd34=_0xaf4d[_0x5e2244];return _0x5bbd34;};'use strict';var _=require('lodash');var util=require(_0xdaf4('0x0'));var moment=require(_0xdaf4('0x1'));var BPromise=require(_0xdaf4('0x2'));var rs=require(_0xdaf4('0x3'));var fs=require('fs');var Redis=require(_0xdaf4('0x4'));var db=require(_0xdaf4('0x5'))['db'];var utils=require(_0xdaf4('0x6'));var logger=require('../../config/logger')(_0xdaf4('0x7'));var config=require(_0xdaf4('0x8'));var jayson=require(_0xdaf4('0x9'));var client=jayson[_0xdaf4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f1663,_0x5629aa,_0x208883){return new BPromise(function(_0x227d9b,_0x472fb2){return client[_0xdaf4('0xb')](_0x3f1663,_0x208883)[_0xdaf4('0xc')](function(_0x330ce5){logger[_0xdaf4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5629aa,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5629aa,_0xdaf4('0xe'),JSON[_0xdaf4('0xf')](_0x330ce5));if(_0x330ce5['error']){if(_0x330ce5['error']['code']===0x1f4){logger[_0xdaf4('0x10')](_0xdaf4('0x11'),_0x5629aa,_0x330ce5[_0xdaf4('0x10')]['message']);return _0x472fb2(_0x330ce5[_0xdaf4('0x10')][_0xdaf4('0x12')]);}logger[_0xdaf4('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5629aa,_0x330ce5[_0xdaf4('0x10')][_0xdaf4('0x12')]);return _0x227d9b(_0x330ce5[_0xdaf4('0x10')][_0xdaf4('0x12')]);}else{logger[_0xdaf4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5629aa,_0xdaf4('0xe'));_0x227d9b(_0x330ce5[_0xdaf4('0x13')][_0xdaf4('0x12')]);}})[_0xdaf4('0x14')](function(_0x16a6b1){logger[_0xdaf4('0x10')](_0xdaf4('0x11'),_0x5629aa,_0x16a6b1);_0x472fb2(_0x16a6b1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 41964d4..46434f0 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 _0xf554=['create','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','getQuestions','post'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xf554,0x194));var _0x4f55=function(_0x108e52,_0x19d2c3){_0x108e52=_0x108e52-0x0;var _0x526cf6=_0xf554[_0x108e52];return _0x526cf6;};'use strict';var multer=require('multer');var util=require(_0x4f55('0x0'));var path=require('path');var timeout=require(_0x4f55('0x1'));var express=require('express');var router=express[_0x4f55('0x2')]();var auth=require(_0x4f55('0x3'));var interaction=require(_0x4f55('0x4'));var config=require(_0x4f55('0x5'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x4f55('0x6')](),controller[_0x4f55('0x7')]);router[_0x4f55('0x8')]('/describe',auth[_0x4f55('0x6')](),controller[_0x4f55('0x9')]);router[_0x4f55('0x8')](_0x4f55('0xa'),auth['isAuthenticated'](),controller[_0x4f55('0xb')]);router['get']('/:id/questions',auth[_0x4f55('0x6')](),controller[_0x4f55('0xc')]);router[_0x4f55('0xd')]('/',auth[_0x4f55('0x6')](),controller[_0x4f55('0xe')]);router[_0x4f55('0xf')](_0x4f55('0xa'),auth['isAuthenticated'](),controller[_0x4f55('0x10')]);router[_0x4f55('0x11')](_0x4f55('0xa'),auth[_0x4f55('0x6')](),controller['destroy']);module[_0x4f55('0x12')]=router; \ No newline at end of file +var _0x4cbd=['describe','get','/:id','show','/:id/questions','getQuestions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x4cbd,0x1a9));var _0xd4cb=function(_0x266850,_0x821b6b){_0x266850=_0x266850-0x0;var _0x3708bc=_0x4cbd[_0x266850];return _0x3708bc;};'use strict';var multer=require(_0xd4cb('0x0'));var util=require(_0xd4cb('0x1'));var path=require(_0xd4cb('0x2'));var timeout=require(_0xd4cb('0x3'));var express=require(_0xd4cb('0x4'));var router=express[_0xd4cb('0x5')]();var auth=require(_0xd4cb('0x6'));var interaction=require(_0xd4cb('0x7'));var config=require(_0xd4cb('0x8'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xd4cb('0x9')](),controller[_0xd4cb('0xa')]);router['get'](_0xd4cb('0xb'),auth['isAuthenticated'](),controller[_0xd4cb('0xc')]);router[_0xd4cb('0xd')](_0xd4cb('0xe'),auth[_0xd4cb('0x9')](),controller[_0xd4cb('0xf')]);router['get'](_0xd4cb('0x10'),auth[_0xd4cb('0x9')](),controller[_0xd4cb('0x11')]);router[_0xd4cb('0x12')]('/',auth[_0xd4cb('0x9')](),controller['create']);router[_0xd4cb('0x13')](_0xd4cb('0xe'),auth[_0xd4cb('0x9')](),controller[_0xd4cb('0x14')]);router[_0xd4cb('0x15')](_0xd4cb('0xe'),auth[_0xd4cb('0x9')](),controller[_0xd4cb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 4df3260..7fc0425 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 _0x2169=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize'];(function(_0x421df3,_0x1b9d7d){var _0x1f5106=function(_0x597f54){while(--_0x597f54){_0x421df3['push'](_0x421df3['shift']());}};_0x1f5106(++_0x1b9d7d);}(_0x2169,0x14f));var _0x9216=function(_0x10e5ae,_0x4a8c28){_0x10e5ae=_0x10e5ae-0x0;var _0x27d9b5=_0x2169[_0x10e5ae];return _0x27d9b5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9216('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x9216('0x1')],'set':function(_0x1c1e80){this[_0x9216('0x2')](_0x9216('0x3'),_0x1c1e80);this[_0x9216('0x2')](_0x9216('0x4'),moment()[_0x9216('0x5')](_0x9216('0x6')));}},'endtime':{'type':Sequelize[_0x9216('0x1')]},'membername':{'type':Sequelize[_0x9216('0x7')]},'projectname':{'type':Sequelize[_0x9216('0x7')]},'queue':{'type':Sequelize[_0x9216('0x7')]},'uniqueid':{'type':Sequelize[_0x9216('0x7')]},'calleridname':{'type':Sequelize[_0x9216('0x7')]},'calleridnum':{'type':Sequelize[_0x9216('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa8ac=['sequelize','exports','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x179185,_0x30f264){var _0x4f70d7=function(_0x5d7ee6){while(--_0x5d7ee6){_0x179185['push'](_0x179185['shift']());}};_0x4f70d7(++_0x30f264);}(_0xa8ac,0xd9));var _0xca8a=function(_0x2ab9a4,_0x434094){_0x2ab9a4=_0x2ab9a4-0x0;var _0x4a2988=_0xa8ac[_0x2ab9a4];return _0x4a2988;};'use strict';var moment=require('moment');var Sequelize=require(_0xca8a('0x0'));module[_0xca8a('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0xe35d8c){this[_0xca8a('0x2')]('starttime',_0xe35d8c);this['setDataValue'](_0xca8a('0x3'),moment()['format'](_0xca8a('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xca8a('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xca8a('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xca8a('0x5')]},'calleridnum':{'type':Sequelize[_0xca8a('0x5')]},'completed':{'type':Sequelize[_0xca8a('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 1d65834..063b757 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 _0x81c9=['hasOwnProperty','nolimit','order','SessionId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','JscriptySessionReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','getQuestions','findOne','JscriptyQuestionReport'];(function(_0x5046d6,_0x36e665){var _0x3328d8=function(_0x48d0b8){while(--_0x48d0b8){_0x5046d6['push'](_0x5046d6['shift']());}};_0x3328d8(++_0x36e665);}(_0x81c9,0x1de));var _0x981c=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x81c9[_0x4b2863];return _0x567d67;};'use strict';var pdf=require(_0x981c('0x0'));var emlformat=require(_0x981c('0x1'));var rimraf=require(_0x981c('0x2'));var zipdir=require(_0x981c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x981c('0x4'));var moment=require(_0x981c('0x5'));var BPromise=require(_0x981c('0x6'));var Mustache=require('mustache');var util=require(_0x981c('0x7'));var path=require(_0x981c('0x8'));var sox=require(_0x981c('0x9'));var csv=require(_0x981c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x981c('0xb'));var squel=require('squel');var crypto=require(_0x981c('0xc'));var jsforce=require(_0x981c('0xd'));var deskjs=require(_0x981c('0xe'));var toCsv=require(_0x981c('0xa'));var querystring=require(_0x981c('0xf'));var Papa=require(_0x981c('0x10'));var Redis=require(_0x981c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x981c('0x12'));var hardwareService=require(_0x981c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x981c('0x14'));var config=require(_0x981c('0x15'));var db=require(_0x981c('0x16'))['db'];function respondWithStatusCode(_0x529042,_0x5e3bcb){_0x5e3bcb=_0x5e3bcb||0xcc;return function(_0x218f07){if(_0x218f07){return _0x529042['sendStatus'](_0x5e3bcb);}return _0x529042[_0x981c('0x17')](_0x5e3bcb)[_0x981c('0x18')]();};}function respondWithResult(_0x4fd0c7,_0x5c856c){_0x5c856c=_0x5c856c||0xc8;return function(_0x112933){if(_0x112933){return _0x4fd0c7[_0x981c('0x17')](_0x5c856c)['json'](_0x112933);}};}function respondWithFilteredResult(_0x543a66,_0x9cf4fb){return function(_0x2787b6){if(_0x2787b6){var _0x37e070=_0x2787b6[_0x981c('0x19')],_0x1eff46=_0x9cf4fb[_0x981c('0x1a')],_0x302e62=_0x9cf4fb[_0x981c('0x1a')]+_0x9cf4fb['limit'],_0x54ca0f;if(_0x302e62>=_0x37e070){_0x302e62=_0x37e070;_0x54ca0f=0xc8;}else{_0x54ca0f=0xce;}_0x543a66[_0x981c('0x17')](_0x54ca0f);return _0x543a66[_0x981c('0x1b')](_0x981c('0x1c'),_0x1eff46+'-'+_0x302e62+'/'+_0x37e070)[_0x981c('0x1d')](_0x2787b6);}return null;};}function patchUpdates(_0x24d72a){return function(_0x427e0f){try{jsonpatch[_0x981c('0x1e')](_0x427e0f,_0x24d72a,!![]);}catch(_0x1f8f0f){return BPromise[_0x981c('0x1f')](_0x1f8f0f);}return _0x427e0f[_0x981c('0x20')]();};}function saveUpdates(_0x290dba,_0x47ef5d){return function(_0x483af4){if(_0x483af4){return _0x483af4[_0x981c('0x21')](_0x290dba)[_0x981c('0x22')](function(_0x1c3c1e){return _0x1c3c1e;});}return null;};}function removeEntity(_0x563d13,_0x88e860){return function(_0x48d676){if(_0x48d676){return _0x48d676[_0x981c('0x23')]()['then'](function(){_0x563d13[_0x981c('0x17')](0xcc)[_0x981c('0x18')]();});}};}function handleEntityNotFound(_0x3d1c78,_0x25000b){return function(_0x2464c9){if(!_0x2464c9){_0x3d1c78['sendStatus'](0x194);}return _0x2464c9;};}function handleError(_0x3eac07,_0x4ec1ac){_0x4ec1ac=_0x4ec1ac||0x1f4;return function(_0x27ed5d){logger[_0x981c('0x24')](_0x27ed5d[_0x981c('0x25')]);if(_0x27ed5d[_0x981c('0x26')]){delete _0x27ed5d['name'];}_0x3eac07[_0x981c('0x17')](_0x4ec1ac)['send'](_0x27ed5d);};}exports[_0x981c('0x27')]=function(_0x3848d9,_0x2f36c1){var _0x354764={},_0xd911ef={},_0x5bc2be={'count':0x0,'rows':[]};var _0x8d536c=db['JscriptySessionReport'][_0x981c('0x28')];_0xd911ef[_0x981c('0x29')]=_[_0x981c('0x2a')](_0x8d536c);_0xd911ef['query']=_[_0x981c('0x2a')](_0x3848d9[_0x981c('0x2b')]);_0xd911ef[_0x981c('0x2c')]=_[_0x981c('0x2d')](_0xd911ef[_0x981c('0x29')],_0xd911ef[_0x981c('0x2b')]);_0x354764['attributes']=_[_0x981c('0x2d')](_0xd911ef[_0x981c('0x29')],qs['fields'](_0x3848d9[_0x981c('0x2b')][_0x981c('0x2e')]));_0x354764['attributes']=_0x354764[_0x981c('0x2f')][_0x981c('0x30')]?_0x354764[_0x981c('0x2f')]:_0xd911ef['model'];if(!_0x3848d9[_0x981c('0x2b')]['hasOwnProperty']('nolimit')){_0x354764[_0x981c('0x31')]=qs[_0x981c('0x31')](_0x3848d9[_0x981c('0x2b')]['limit']);_0x354764[_0x981c('0x1a')]=qs[_0x981c('0x1a')](_0x3848d9[_0x981c('0x2b')][_0x981c('0x1a')]);}_0x354764['order']=qs[_0x981c('0x32')](_0x3848d9[_0x981c('0x2b')][_0x981c('0x32')]);_0x354764[_0x981c('0x33')]=qs[_0x981c('0x2c')](_[_0x981c('0x34')](_0x3848d9[_0x981c('0x2b')],_0xd911ef[_0x981c('0x2c')]));if(_0x3848d9[_0x981c('0x2b')][_0x981c('0x35')]){_0x354764[_0x981c('0x33')]=_[_0x981c('0x36')](_0x354764[_0x981c('0x33')],{'$or':_[_0x981c('0x37')](_0x8d536c,function(_0xab15bb){if(_0xab15bb[_0x981c('0x38')][_0x981c('0x39')]!==_0x981c('0x3a')){var _0x1894ea={};_0x1894ea[_0xab15bb[_0x981c('0x3b')]]={'$like':'%'+_0x3848d9[_0x981c('0x2b')]['filter']+'%'};return _0x1894ea;}})});}_0x354764=_[_0x981c('0x36')]({},_0x354764,_0x3848d9[_0x981c('0x3c')]);var _0x4622b5={'where':_0x354764[_0x981c('0x33')]};return db[_0x981c('0x3d')]['count'](_0x4622b5)[_0x981c('0x22')](function(_0x14d586){_0x5bc2be[_0x981c('0x19')]=_0x14d586;if(_0x3848d9[_0x981c('0x2b')][_0x981c('0x3e')]){_0x354764[_0x981c('0x3f')]=[{'all':!![]}];}return db[_0x981c('0x3d')][_0x981c('0x40')](_0x354764);})[_0x981c('0x22')](function(_0x3f4355){_0x5bc2be[_0x981c('0x41')]=_0x3f4355;return _0x5bc2be;})[_0x981c('0x22')](respondWithFilteredResult(_0x2f36c1,_0x354764))['catch'](handleError(_0x2f36c1,null));};exports[_0x981c('0x42')]=function(_0x25fdcf,_0x1216fc){var _0x15d831={'raw':!![],'where':{'id':_0x25fdcf[_0x981c('0x43')]['id']}},_0x31bc2b={};_0x31bc2b[_0x981c('0x29')]=_[_0x981c('0x2a')](db[_0x981c('0x3d')][_0x981c('0x28')]);_0x31bc2b[_0x981c('0x2b')]=_['keys'](_0x25fdcf[_0x981c('0x2b')]);_0x31bc2b['filters']=_[_0x981c('0x2d')](_0x31bc2b[_0x981c('0x29')],_0x31bc2b[_0x981c('0x2b')]);_0x15d831[_0x981c('0x2f')]=_[_0x981c('0x2d')](_0x31bc2b[_0x981c('0x29')],qs[_0x981c('0x2e')](_0x25fdcf[_0x981c('0x2b')][_0x981c('0x2e')]));_0x15d831['attributes']=_0x15d831['attributes'][_0x981c('0x30')]?_0x15d831[_0x981c('0x2f')]:_0x31bc2b[_0x981c('0x29')];if(_0x25fdcf[_0x981c('0x2b')][_0x981c('0x3e')]){_0x15d831[_0x981c('0x3f')]=[{'all':!![]}];}_0x15d831=_['merge']({},_0x15d831,_0x25fdcf['options']);return db[_0x981c('0x3d')][_0x981c('0x44')](_0x15d831)[_0x981c('0x22')](handleEntityNotFound(_0x1216fc,null))[_0x981c('0x22')](respondWithResult(_0x1216fc,null))[_0x981c('0x45')](handleError(_0x1216fc,null));};exports[_0x981c('0x46')]=function(_0x1d3617,_0x1101e4){return db['JscriptySessionReport'][_0x981c('0x46')](_0x1d3617[_0x981c('0x47')],{})[_0x981c('0x22')](respondWithResult(_0x1101e4,0xc9))['catch'](handleError(_0x1101e4,null));};exports['update']=function(_0x416b8b,_0x48a5ce){if(_0x416b8b[_0x981c('0x47')]['id']){delete _0x416b8b[_0x981c('0x47')]['id'];}return db[_0x981c('0x3d')][_0x981c('0x44')]({'where':{'id':_0x416b8b[_0x981c('0x43')]['id']}})['then'](handleEntityNotFound(_0x48a5ce,null))[_0x981c('0x22')](saveUpdates(_0x416b8b[_0x981c('0x47')],null))[_0x981c('0x22')](respondWithResult(_0x48a5ce,null))[_0x981c('0x45')](handleError(_0x48a5ce,null));};exports[_0x981c('0x23')]=function(_0x29b59e,_0x30b13b){return db[_0x981c('0x3d')]['find']({'where':{'id':_0x29b59e[_0x981c('0x43')]['id']}})[_0x981c('0x22')](handleEntityNotFound(_0x30b13b,null))[_0x981c('0x22')](removeEntity(_0x30b13b,null))[_0x981c('0x45')](handleError(_0x30b13b,null));};exports['describe']=function(_0x3e6bf9,_0x5e3d8a){return db[_0x981c('0x3d')]['describe']()['then'](respondWithResult(_0x5e3d8a,null))[_0x981c('0x45')](handleError(_0x5e3d8a,null));};exports[_0x981c('0x48')]=function(_0x4b8b16,_0x43baf1,_0x2a7271){var _0x24efc3={'raw':!![],'where':{}};var _0x18c129={};var _0x5bb3b3={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x981c('0x49')]({'where':{'id':_0x4b8b16[_0x981c('0x43')]['id']}})[_0x981c('0x22')](handleEntityNotFound(_0x43baf1,null))[_0x981c('0x22')](function(_0x1809c8){if(_0x1809c8){_0x18c129[_0x981c('0x29')]=_[_0x981c('0x2a')](db[_0x981c('0x4a')]['rawAttributes']);_0x18c129['query']=_[_0x981c('0x2a')](_0x4b8b16[_0x981c('0x2b')]);_0x18c129[_0x981c('0x2c')]=_['intersection'](_0x18c129[_0x981c('0x29')],_0x18c129[_0x981c('0x2b')]);_0x24efc3['attributes']=_[_0x981c('0x2d')](_0x18c129[_0x981c('0x29')],qs['fields'](_0x4b8b16[_0x981c('0x2b')][_0x981c('0x2e')]));_0x24efc3[_0x981c('0x2f')]=_0x24efc3[_0x981c('0x2f')][_0x981c('0x30')]?_0x24efc3[_0x981c('0x2f')]:_0x18c129[_0x981c('0x29')];if(!_0x4b8b16[_0x981c('0x2b')][_0x981c('0x4b')](_0x981c('0x4c'))){_0x24efc3[_0x981c('0x31')]=qs[_0x981c('0x31')](_0x4b8b16[_0x981c('0x2b')][_0x981c('0x31')]);_0x24efc3[_0x981c('0x1a')]=qs[_0x981c('0x1a')](_0x4b8b16[_0x981c('0x2b')]['offset']);}_0x24efc3[_0x981c('0x4d')]=qs[_0x981c('0x32')](_0x4b8b16['query'][_0x981c('0x32')]);_0x24efc3[_0x981c('0x33')]=qs[_0x981c('0x2c')](_[_0x981c('0x34')](_0x4b8b16[_0x981c('0x2b')],_0x18c129['filters']));_0x24efc3[_0x981c('0x33')][_0x981c('0x4e')]=_0x1809c8['id'];if(_0x4b8b16[_0x981c('0x2b')][_0x981c('0x35')]){_0x24efc3[_0x981c('0x33')]=_['merge'](_0x24efc3[_0x981c('0x33')],{'$or':_[_0x981c('0x37')](_0x24efc3[_0x981c('0x2f')],function(_0x34f6cd){var _0x2897c8={};_0x2897c8[_0x34f6cd]={'$like':'%'+_0x4b8b16[_0x981c('0x2b')][_0x981c('0x35')]+'%'};return _0x2897c8;})});}_0x24efc3=_['merge']({},_0x24efc3,_0x4b8b16[_0x981c('0x3c')]);return db[_0x981c('0x4a')][_0x981c('0x19')]({'where':_0x24efc3[_0x981c('0x33')]})[_0x981c('0x22')](function(_0x70c6ca){_0x5bb3b3[_0x981c('0x19')]=_0x70c6ca;if(_0x4b8b16[_0x981c('0x2b')][_0x981c('0x3e')]){_0x24efc3['include']=[{'all':!![]}];}return db[_0x981c('0x4a')][_0x981c('0x40')](_0x24efc3);})['then'](function(_0x472c7a){_0x5bb3b3[_0x981c('0x41')]=_0x472c7a;return _0x5bb3b3;});}})['then'](respondWithFilteredResult(_0x43baf1,_0x24efc3))['catch'](handleError(_0x43baf1,null));}; \ No newline at end of file +var _0xd74c=['hasOwnProperty','nolimit','order','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','fields','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','sort','SessionId','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','filters','intersection','attributes','length'];(function(_0x31f7b9,_0x5be72c){var _0xa304fb=function(_0x205efc){while(--_0x205efc){_0x31f7b9['push'](_0x31f7b9['shift']());}};_0xa304fb(++_0x5be72c);}(_0xd74c,0xb4));var _0xcd74=function(_0x19de2e,_0x345edd){_0x19de2e=_0x19de2e-0x0;var _0x2691b3=_0xd74c[_0x19de2e];return _0x2691b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd74('0x0'));var rimraf=require(_0xcd74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd74('0x2'));var moment=require(_0xcd74('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcd74('0x4'));var util=require(_0xcd74('0x5'));var path=require(_0xcd74('0x6'));var sox=require('sox');var csv=require(_0xcd74('0x7'));var ejs=require(_0xcd74('0x8'));var fs=require('fs');var _=require(_0xcd74('0x9'));var squel=require(_0xcd74('0xa'));var crypto=require(_0xcd74('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcd74('0xc'));var toCsv=require(_0xcd74('0x7'));var querystring=require(_0xcd74('0xd'));var Papa=require(_0xcd74('0xe'));var Redis=require('ioredis');var authService=require(_0xcd74('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcd74('0x10'));var logger=require('../../config/logger')(_0xcd74('0x11'));var utils=require(_0xcd74('0x12'));var config=require(_0xcd74('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x541cdf,_0x2fd77b){_0x2fd77b=_0x2fd77b||0xcc;return function(_0x2dea83){if(_0x2dea83){return _0x541cdf[_0xcd74('0x14')](_0x2fd77b);}return _0x541cdf[_0xcd74('0x15')](_0x2fd77b)[_0xcd74('0x16')]();};}function respondWithResult(_0x5a4320,_0x1bb2e2){_0x1bb2e2=_0x1bb2e2||0xc8;return function(_0x25d335){if(_0x25d335){return _0x5a4320[_0xcd74('0x15')](_0x1bb2e2)[_0xcd74('0x17')](_0x25d335);}};}function respondWithFilteredResult(_0x30546c,_0x4f97d3){return function(_0x566c27){if(_0x566c27){var _0x20af16=_0x566c27[_0xcd74('0x18')],_0x470ffa=_0x4f97d3[_0xcd74('0x19')],_0x44e3da=_0x4f97d3[_0xcd74('0x19')]+_0x4f97d3[_0xcd74('0x1a')],_0xa52983;if(_0x44e3da>=_0x20af16){_0x44e3da=_0x20af16;_0xa52983=0xc8;}else{_0xa52983=0xce;}_0x30546c['status'](_0xa52983);return _0x30546c[_0xcd74('0x1b')](_0xcd74('0x1c'),_0x470ffa+'-'+_0x44e3da+'/'+_0x20af16)[_0xcd74('0x17')](_0x566c27);}return null;};}function patchUpdates(_0xf42bee){return function(_0x276e45){try{jsonpatch['apply'](_0x276e45,_0xf42bee,!![]);}catch(_0x4ce72a){return BPromise[_0xcd74('0x1d')](_0x4ce72a);}return _0x276e45[_0xcd74('0x1e')]();};}function saveUpdates(_0x2fd6ea,_0x5651e4){return function(_0x2f9aa1){if(_0x2f9aa1){return _0x2f9aa1[_0xcd74('0x1f')](_0x2fd6ea)[_0xcd74('0x20')](function(_0x5de621){return _0x5de621;});}return null;};}function removeEntity(_0x305d34,_0x4d95f2){return function(_0x59d31c){if(_0x59d31c){return _0x59d31c[_0xcd74('0x21')]()[_0xcd74('0x20')](function(){_0x305d34[_0xcd74('0x15')](0xcc)[_0xcd74('0x16')]();});}};}function handleEntityNotFound(_0x267173,_0x33ad9f){return function(_0x33d046){if(!_0x33d046){_0x267173[_0xcd74('0x14')](0x194);}return _0x33d046;};}function handleError(_0x120f04,_0x596b79){_0x596b79=_0x596b79||0x1f4;return function(_0x57e72c){logger[_0xcd74('0x22')](_0x57e72c[_0xcd74('0x23')]);if(_0x57e72c['name']){delete _0x57e72c[_0xcd74('0x24')];}_0x120f04[_0xcd74('0x15')](_0x596b79)[_0xcd74('0x25')](_0x57e72c);};}exports[_0xcd74('0x26')]=function(_0xc7f183,_0x16e0c7){var _0xe68b0a={},_0x4002bd={},_0x4f8f8e={'count':0x0,'rows':[]};var _0x575d9a=db[_0xcd74('0x27')][_0xcd74('0x28')];_0x4002bd[_0xcd74('0x29')]=_[_0xcd74('0x2a')](_0x575d9a);_0x4002bd[_0xcd74('0x2b')]=_[_0xcd74('0x2a')](_0xc7f183[_0xcd74('0x2b')]);_0x4002bd[_0xcd74('0x2c')]=_[_0xcd74('0x2d')](_0x4002bd[_0xcd74('0x29')],_0x4002bd['query']);_0xe68b0a[_0xcd74('0x2e')]=_[_0xcd74('0x2d')](_0x4002bd[_0xcd74('0x29')],qs['fields'](_0xc7f183[_0xcd74('0x2b')]['fields']));_0xe68b0a[_0xcd74('0x2e')]=_0xe68b0a[_0xcd74('0x2e')][_0xcd74('0x2f')]?_0xe68b0a[_0xcd74('0x2e')]:_0x4002bd[_0xcd74('0x29')];if(!_0xc7f183['query'][_0xcd74('0x30')](_0xcd74('0x31'))){_0xe68b0a[_0xcd74('0x1a')]=qs[_0xcd74('0x1a')](_0xc7f183[_0xcd74('0x2b')][_0xcd74('0x1a')]);_0xe68b0a[_0xcd74('0x19')]=qs[_0xcd74('0x19')](_0xc7f183[_0xcd74('0x2b')][_0xcd74('0x19')]);}_0xe68b0a[_0xcd74('0x32')]=qs['sort'](_0xc7f183[_0xcd74('0x2b')]['sort']);_0xe68b0a[_0xcd74('0x33')]=qs[_0xcd74('0x2c')](_['pick'](_0xc7f183[_0xcd74('0x2b')],_0x4002bd[_0xcd74('0x2c')]));if(_0xc7f183[_0xcd74('0x2b')]['filter']){_0xe68b0a[_0xcd74('0x33')]=_[_0xcd74('0x34')](_0xe68b0a['where'],{'$or':_[_0xcd74('0x35')](_0x575d9a,function(_0x1bfbb2){if(_0x1bfbb2[_0xcd74('0x36')][_0xcd74('0x37')]!==_0xcd74('0x38')){var _0x4177b8={};_0x4177b8[_0x1bfbb2[_0xcd74('0x39')]]={'$like':'%'+_0xc7f183[_0xcd74('0x2b')][_0xcd74('0x3a')]+'%'};return _0x4177b8;}})});}_0xe68b0a=_[_0xcd74('0x34')]({},_0xe68b0a,_0xc7f183[_0xcd74('0x3b')]);var _0x5346a5={'where':_0xe68b0a[_0xcd74('0x33')]};return db[_0xcd74('0x27')][_0xcd74('0x18')](_0x5346a5)[_0xcd74('0x20')](function(_0x266041){_0x4f8f8e[_0xcd74('0x18')]=_0x266041;if(_0xc7f183[_0xcd74('0x2b')][_0xcd74('0x3c')]){_0xe68b0a[_0xcd74('0x3d')]=[{'all':!![]}];}return db[_0xcd74('0x27')][_0xcd74('0x3e')](_0xe68b0a);})[_0xcd74('0x20')](function(_0x15f1d7){_0x4f8f8e['rows']=_0x15f1d7;return _0x4f8f8e;})[_0xcd74('0x20')](respondWithFilteredResult(_0x16e0c7,_0xe68b0a))[_0xcd74('0x3f')](handleError(_0x16e0c7,null));};exports[_0xcd74('0x40')]=function(_0x2c07d3,_0x501fb9){var _0x3cead2={'raw':!![],'where':{'id':_0x2c07d3['params']['id']}},_0x557e99={};_0x557e99[_0xcd74('0x29')]=_[_0xcd74('0x2a')](db[_0xcd74('0x27')][_0xcd74('0x28')]);_0x557e99['query']=_[_0xcd74('0x2a')](_0x2c07d3[_0xcd74('0x2b')]);_0x557e99['filters']=_[_0xcd74('0x2d')](_0x557e99[_0xcd74('0x29')],_0x557e99[_0xcd74('0x2b')]);_0x3cead2[_0xcd74('0x2e')]=_['intersection'](_0x557e99[_0xcd74('0x29')],qs[_0xcd74('0x41')](_0x2c07d3['query'][_0xcd74('0x41')]));_0x3cead2['attributes']=_0x3cead2[_0xcd74('0x2e')]['length']?_0x3cead2[_0xcd74('0x2e')]:_0x557e99[_0xcd74('0x29')];if(_0x2c07d3[_0xcd74('0x2b')][_0xcd74('0x3c')]){_0x3cead2[_0xcd74('0x3d')]=[{'all':!![]}];}_0x3cead2=_[_0xcd74('0x34')]({},_0x3cead2,_0x2c07d3[_0xcd74('0x3b')]);return db[_0xcd74('0x27')][_0xcd74('0x42')](_0x3cead2)['then'](handleEntityNotFound(_0x501fb9,null))[_0xcd74('0x20')](respondWithResult(_0x501fb9,null))[_0xcd74('0x3f')](handleError(_0x501fb9,null));};exports[_0xcd74('0x43')]=function(_0x16e9fd,_0x32abfb){return db[_0xcd74('0x27')][_0xcd74('0x43')](_0x16e9fd[_0xcd74('0x44')],{})[_0xcd74('0x20')](respondWithResult(_0x32abfb,0xc9))[_0xcd74('0x3f')](handleError(_0x32abfb,null));};exports[_0xcd74('0x1f')]=function(_0x5bf86d,_0x529085){if(_0x5bf86d[_0xcd74('0x44')]['id']){delete _0x5bf86d[_0xcd74('0x44')]['id'];}return db[_0xcd74('0x27')][_0xcd74('0x42')]({'where':{'id':_0x5bf86d['params']['id']}})[_0xcd74('0x20')](handleEntityNotFound(_0x529085,null))[_0xcd74('0x20')](saveUpdates(_0x5bf86d[_0xcd74('0x44')],null))[_0xcd74('0x20')](respondWithResult(_0x529085,null))[_0xcd74('0x3f')](handleError(_0x529085,null));};exports[_0xcd74('0x21')]=function(_0x3cf7c7,_0x1a5fce){return db[_0xcd74('0x27')][_0xcd74('0x42')]({'where':{'id':_0x3cf7c7[_0xcd74('0x45')]['id']}})[_0xcd74('0x20')](handleEntityNotFound(_0x1a5fce,null))[_0xcd74('0x20')](removeEntity(_0x1a5fce,null))[_0xcd74('0x3f')](handleError(_0x1a5fce,null));};exports[_0xcd74('0x46')]=function(_0x380ec8,_0xec35ce){return db['JscriptySessionReport'][_0xcd74('0x46')]()[_0xcd74('0x20')](respondWithResult(_0xec35ce,null))['catch'](handleError(_0xec35ce,null));};exports[_0xcd74('0x47')]=function(_0x5dba85,_0x23ae04,_0x3d999f){var _0x19e89d={'raw':!![],'where':{}};var _0x3d3191={};var _0x1b8d7d={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xcd74('0x48')]({'where':{'id':_0x5dba85['params']['id']}})['then'](handleEntityNotFound(_0x23ae04,null))[_0xcd74('0x20')](function(_0x527da4){if(_0x527da4){_0x3d3191[_0xcd74('0x29')]=_[_0xcd74('0x2a')](db[_0xcd74('0x49')]['rawAttributes']);_0x3d3191[_0xcd74('0x2b')]=_[_0xcd74('0x2a')](_0x5dba85[_0xcd74('0x2b')]);_0x3d3191['filters']=_['intersection'](_0x3d3191[_0xcd74('0x29')],_0x3d3191[_0xcd74('0x2b')]);_0x19e89d[_0xcd74('0x2e')]=_[_0xcd74('0x2d')](_0x3d3191[_0xcd74('0x29')],qs[_0xcd74('0x41')](_0x5dba85[_0xcd74('0x2b')][_0xcd74('0x41')]));_0x19e89d[_0xcd74('0x2e')]=_0x19e89d[_0xcd74('0x2e')][_0xcd74('0x2f')]?_0x19e89d['attributes']:_0x3d3191[_0xcd74('0x29')];if(!_0x5dba85['query'][_0xcd74('0x30')](_0xcd74('0x31'))){_0x19e89d[_0xcd74('0x1a')]=qs[_0xcd74('0x1a')](_0x5dba85[_0xcd74('0x2b')][_0xcd74('0x1a')]);_0x19e89d['offset']=qs['offset'](_0x5dba85[_0xcd74('0x2b')]['offset']);}_0x19e89d['order']=qs[_0xcd74('0x4a')](_0x5dba85[_0xcd74('0x2b')][_0xcd74('0x4a')]);_0x19e89d[_0xcd74('0x33')]=qs[_0xcd74('0x2c')](_['pick'](_0x5dba85[_0xcd74('0x2b')],_0x3d3191['filters']));_0x19e89d[_0xcd74('0x33')][_0xcd74('0x4b')]=_0x527da4['id'];if(_0x5dba85[_0xcd74('0x2b')][_0xcd74('0x3a')]){_0x19e89d[_0xcd74('0x33')]=_[_0xcd74('0x34')](_0x19e89d[_0xcd74('0x33')],{'$or':_[_0xcd74('0x35')](_0x19e89d[_0xcd74('0x2e')],function(_0x2ddd0e){var _0x5839c8={};_0x5839c8[_0x2ddd0e]={'$like':'%'+_0x5dba85[_0xcd74('0x2b')]['filter']+'%'};return _0x5839c8;})});}_0x19e89d=_['merge']({},_0x19e89d,_0x5dba85['options']);return db['JscriptyQuestionReport'][_0xcd74('0x18')]({'where':_0x19e89d[_0xcd74('0x33')]})[_0xcd74('0x20')](function(_0x26877c){_0x1b8d7d[_0xcd74('0x18')]=_0x26877c;if(_0x5dba85['query']['includeAll']){_0x19e89d['include']=[{'all':!![]}];}return db[_0xcd74('0x49')][_0xcd74('0x3e')](_0x19e89d);})[_0xcd74('0x20')](function(_0x433e83){_0x1b8d7d['rows']=_0x433e83;return _0x1b8d7d;});}})[_0xcd74('0x20')](respondWithFilteredResult(_0x23ae04,_0x19e89d))[_0xcd74('0x3f')](handleError(_0x23ae04,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3de1bd9..f8dc44b 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 _0xd42f=['report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','JscriptySessionReport'];(function(_0x5baa27,_0x3f5156){var _0x7793c2=function(_0x531eab){while(--_0x531eab){_0x5baa27['push'](_0x5baa27['shift']());}};_0x7793c2(++_0x3f5156);}(_0xd42f,0x7a));var _0xfd42=function(_0x1ac546,_0x392126){_0x1ac546=_0x1ac546-0x0;var _0x7096bb=_0xd42f[_0x1ac546];return _0x7096bb;};'use strict';var _=require(_0xfd42('0x0'));var util=require('util');var logger=require(_0xfd42('0x1'))('api');var moment=require(_0xfd42('0x2'));var BPromise=require(_0xfd42('0x3'));var rp=require(_0xfd42('0x4'));var fs=require('fs');var path=require(_0xfd42('0x5'));var rimraf=require(_0xfd42('0x6'));var config=require(_0xfd42('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x380c5a,_0x40bdc4){return _0x380c5a[_0xfd42('0x8')](_0xfd42('0x9'),attributes,{'tableName':_0xfd42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6232=['report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport'];(function(_0x1fe678,_0x138225){var _0x53d6c3=function(_0x371b01){while(--_0x371b01){_0x1fe678['push'](_0x1fe678['shift']());}};_0x53d6c3(++_0x138225);}(_0x6232,0x76));var _0x2623=function(_0xa7ced,_0x3ddb9f){_0xa7ced=_0xa7ced-0x0;var _0x467d96=_0x6232[_0xa7ced];return _0x467d96;};'use strict';var _=require(_0x2623('0x0'));var util=require(_0x2623('0x1'));var logger=require(_0x2623('0x2'))(_0x2623('0x3'));var moment=require(_0x2623('0x4'));var BPromise=require(_0x2623('0x5'));var rp=require(_0x2623('0x6'));var fs=require('fs');var path=require(_0x2623('0x7'));var rimraf=require('rimraf');var config=require(_0x2623('0x8'));var attributes=require(_0x2623('0x9'));module[_0x2623('0xa')]=function(_0x566129,_0x7c859c){return _0x566129['define'](_0x2623('0xb'),attributes,{'tableName':_0x2623('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index df3adf7..9ac531a 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 _0x9300=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','bluebird','randomstring'];(function(_0xafdaf4,_0x5bd4d1){var _0x1e70a8=function(_0x33bd10){while(--_0x33bd10){_0xafdaf4['push'](_0xafdaf4['shift']());}};_0x1e70a8(++_0x5bd4d1);}(_0x9300,0x153));var _0x0930=function(_0x1d1967,_0x52b368){_0x1d1967=_0x1d1967-0x0;var _0x5d6ce0=_0x9300[_0x1d1967];return _0x5d6ce0;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45705a,_0x34c693,_0x2c0f94){return new BPromise(function(_0x1ec24f,_0x5bc3df){return client['request'](_0x45705a,_0x2c0f94)[_0x0930('0xa')](function(_0x4b1994){logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,'request\x20sent');logger[_0x0930('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x34c693,'request\x20sent',JSON[_0x0930('0xe')](_0x4b1994));if(_0x4b1994[_0x0930('0xf')]){if(_0x4b1994['error']['code']===0x1f4){logger[_0x0930('0xf')](_0x0930('0xc'),_0x34c693,_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);return _0x5bc3df(_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x34c693,_0x4b1994['error'][_0x0930('0x10')]);return _0x1ec24f(_0x4b1994['error'][_0x0930('0x10')]);}else{logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,_0x0930('0x11'));_0x1ec24f(_0x4b1994[_0x0930('0x12')][_0x0930('0x10')]);}})['catch'](function(_0x3ec27b){logger[_0x0930('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x34c693,_0x3ec27b);_0x5bc3df(_0x3ec27b);});});} \ No newline at end of file +var _0xd634=['request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x3d2129,_0x1b6d3a){var _0x535afc=function(_0x1f9628){while(--_0x1f9628){_0x3d2129['push'](_0x3d2129['shift']());}};_0x535afc(++_0x1b6d3a);}(_0xd634,0xf4));var _0x4d63=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xd634[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x4d63('0x0'));var moment=require(_0x4d63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d63('0x2'));var db=require(_0x4d63('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d63('0x4'));var config=require(_0x4d63('0x5'));var jayson=require(_0x4d63('0x6'));var client=jayson[_0x4d63('0x7')][_0x4d63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x381601,_0x3e90e1,_0x6a60f4){return new BPromise(function(_0x49c1da,_0x5be18a){return client['request'](_0x381601,_0x6a60f4)['then'](function(_0x5cfc22){logger[_0x4d63('0x9')](_0x4d63('0xa'),_0x3e90e1,_0x4d63('0xb'));logger['debug'](_0x4d63('0xc'),_0x3e90e1,_0x4d63('0xb'),JSON['stringify'](_0x5cfc22));if(_0x5cfc22['error']){if(_0x5cfc22[_0x4d63('0xd')]['code']===0x1f4){logger[_0x4d63('0xd')](_0x4d63('0xa'),_0x3e90e1,_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);return _0x5be18a(_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3e90e1,_0x5cfc22['error'][_0x4d63('0xe')]);return _0x49c1da(_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);}else{logger[_0x4d63('0x9')]('JscriptySessionReport,\x20%s,\x20%s',_0x3e90e1,_0x4d63('0xb'));_0x49c1da(_0x5cfc22[_0x4d63('0xf')][_0x4d63('0xe')]);}})[_0x4d63('0x10')](function(_0x3c96b8){logger[_0x4d63('0xd')](_0x4d63('0xa'),_0x3e90e1,_0x3c96b8);_0x5be18a(_0x3c96b8);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 1f06c84..9193d9d 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 _0x707c=['../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3463c6,_0x49e2fa){var _0x80f9bd=function(_0x4dc61e){while(--_0x4dc61e){_0x3463c6['push'](_0x3463c6['shift']());}};_0x80f9bd(++_0x49e2fa);}(_0x707c,0xa2));var _0xc707=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x707c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc707('0x0'));var util=require(_0xc707('0x1'));var path=require(_0xc707('0x2'));var timeout=require('connect-timeout');var express=require(_0xc707('0x3'));var router=express[_0xc707('0x4')]();var auth=require(_0xc707('0x5'));var interaction=require(_0xc707('0x6'));var config=require(_0xc707('0x7'));var controller=require(_0xc707('0x8'));router[_0xc707('0x9')]('/',controller[_0xc707('0xa')]);router['put'](_0xc707('0xb'),auth['isAuthenticated'](),controller[_0xc707('0xc')]);module[_0xc707('0xd')]=router; \ No newline at end of file +var _0xcda1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcda1,0x109));var _0x1cda=function(_0x177d74,_0xbde616){_0x177d74=_0x177d74-0x0;var _0xd2bdb=_0xcda1[_0x177d74];return _0xd2bdb;};'use strict';var multer=require(_0x1cda('0x0'));var util=require(_0x1cda('0x1'));var path=require(_0x1cda('0x2'));var timeout=require(_0x1cda('0x3'));var express=require(_0x1cda('0x4'));var router=express['Router']();var auth=require(_0x1cda('0x5'));var interaction=require(_0x1cda('0x6'));var config=require(_0x1cda('0x7'));var controller=require(_0x1cda('0x8'));router[_0x1cda('0x9')]('/',controller['index']);router[_0x1cda('0xa')](_0x1cda('0xb'),auth[_0x1cda('0xc')](),controller[_0x1cda('0xd')]);module[_0x1cda('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 70ce1d6..12ec120 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 _0xc763=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x21cc14,_0x105b9c){var _0xb29f5b=function(_0x537678){while(--_0x537678){_0x21cc14['push'](_0x21cc14['shift']());}};_0xb29f5b(++_0x105b9c);}(_0xc763,0xc8));var _0x3c76=function(_0x3f85c6,_0x3fbd94){_0x3f85c6=_0x3f85c6-0x0;var _0x1fa0ac=_0xc763[_0x3f85c6];return _0x1fa0ac;};'use strict';var Sequelize=require(_0x3c76('0x0'));module[_0x3c76('0x1')]={'license':{'type':Sequelize[_0x3c76('0x2')]},'data1':{'type':Sequelize[_0x3c76('0x3')]},'data2':{'type':Sequelize[_0x3c76('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3c76('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfcb2=['sequelize','STRING','INTEGER'];(function(_0x1d4fc0,_0x23e07b){var _0x55346=function(_0x3c8716){while(--_0x3c8716){_0x1d4fc0['push'](_0x1d4fc0['shift']());}};_0x55346(++_0x23e07b);}(_0xfcb2,0xed));var _0x2fcb=function(_0xc00174,_0x522827){_0xc00174=_0xc00174-0x0;var _0x4a4875=_0xfcb2[_0xc00174];return _0x4a4875;};'use strict';var Sequelize=require(_0x2fcb('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2fcb('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x2fcb('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index eb48668..edc3c58 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 _0x631c=['squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','find','checkLicense','body','demo','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs'];(function(_0x336f5d,_0x7770c2){var _0x1d8289=function(_0x16a3be){while(--_0x16a3be){_0x336f5d['push'](_0x336f5d['shift']());}};_0x1d8289(++_0x7770c2);}(_0x631c,0x1b6));var _0xc631=function(_0xe04309,_0x50b563){_0xe04309=_0xe04309-0x0;var _0x22e704=_0x631c[_0xe04309];return _0x22e704;};'use strict';var pdf=require(_0xc631('0x0'));var emlformat=require(_0xc631('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc631('0x2'));var jsonpatch=require(_0xc631('0x3'));var rp=require('request-promise');var moment=require(_0xc631('0x4'));var BPromise=require(_0xc631('0x5'));var Mustache=require(_0xc631('0x6'));var util=require('util');var path=require(_0xc631('0x7'));var sox=require(_0xc631('0x8'));var csv=require('to-csv');var ejs=require(_0xc631('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc631('0xa'));var crypto=require(_0xc631('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc631('0xc'));var Papa=require('papaparse');var Redis=require(_0xc631('0xd'));var authService=require(_0xc631('0xe'));var qs=require(_0xc631('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc631('0x10'))(_0xc631('0x11'));var utils=require(_0xc631('0x12'));var config=require(_0xc631('0x13'));var db=require(_0xc631('0x14'))['db'];function respondWithStatusCode(_0x2ffc3e,_0x56ef08){_0x56ef08=_0x56ef08||0xcc;return function(_0x3a5efd){if(_0x3a5efd){return _0x2ffc3e[_0xc631('0x15')](_0x56ef08);}return _0x2ffc3e[_0xc631('0x16')](_0x56ef08)[_0xc631('0x17')]();};}function respondWithResult(_0x19af4d,_0x551059){_0x551059=_0x551059||0xc8;return function(_0x241e39){if(_0x241e39){return _0x19af4d[_0xc631('0x16')](_0x551059)['json'](_0x241e39);}};}function respondWithFilteredResult(_0x1022b9,_0xf9bc56){return function(_0x3cc2a5){if(_0x3cc2a5){var _0xac3441=_0x3cc2a5[_0xc631('0x18')],_0x418a7c=_0xf9bc56[_0xc631('0x19')],_0x734989=_0xf9bc56['offset']+_0xf9bc56[_0xc631('0x1a')],_0x3c2c11;if(_0x734989>=_0xac3441){_0x734989=_0xac3441;_0x3c2c11=0xc8;}else{_0x3c2c11=0xce;}_0x1022b9['status'](_0x3c2c11);return _0x1022b9[_0xc631('0x1b')]('Content-Range',_0x418a7c+'-'+_0x734989+'/'+_0xac3441)[_0xc631('0x1c')](_0x3cc2a5);}return null;};}function patchUpdates(_0x5dc64b){return function(_0x4ab1dc){try{jsonpatch[_0xc631('0x1d')](_0x4ab1dc,_0x5dc64b,!![]);}catch(_0x2d09b8){return BPromise[_0xc631('0x1e')](_0x2d09b8);}return _0x4ab1dc[_0xc631('0x1f')]();};}function saveUpdates(_0x21decf,_0x3087c1){return function(_0x487bf9){if(_0x487bf9){return _0x487bf9[_0xc631('0x20')](_0x21decf)[_0xc631('0x21')](function(_0x47efa9){return _0x47efa9;});}return null;};}function removeEntity(_0x195ce1,_0x58a943){return function(_0x229859){if(_0x229859){return _0x229859[_0xc631('0x22')]()[_0xc631('0x21')](function(){_0x195ce1[_0xc631('0x16')](0xcc)[_0xc631('0x17')]();});}};}function handleEntityNotFound(_0x31f871,_0x41a5bc){return function(_0x2486f3){if(!_0x2486f3){_0x31f871['sendStatus'](0x194);}return _0x2486f3;};}function handleError(_0x332fd0,_0x32934a){_0x32934a=_0x32934a||0x1f4;return function(_0x4c6d5b){logger[_0xc631('0x23')](_0x4c6d5b['stack']);if(_0x4c6d5b[_0xc631('0x24')]){delete _0x4c6d5b['name'];}_0x332fd0[_0xc631('0x16')](_0x32934a)[_0xc631('0x25')](_0x4c6d5b);};}var utilLicense=require('../../config/license/util');exports[_0xc631('0x26')]=function(_0x2d4fd0,_0x3ebc41){var _0x5d019b={'raw':!![],'where':{'id':0x1}},_0x5679d6={};_0x5679d6[_0xc631('0x27')]=_[_0xc631('0x28')](db[_0xc631('0x29')]['rawAttributes']);_0x5679d6[_0xc631('0x2a')]=_[_0xc631('0x28')](_0x2d4fd0[_0xc631('0x2a')]);_0x5679d6[_0xc631('0x2b')]=_[_0xc631('0x2c')](_0x5679d6['model'],_0x5679d6[_0xc631('0x2a')]);_0x5d019b[_0xc631('0x2d')]=_[_0xc631('0x2c')](_0x5679d6['model'],qs[_0xc631('0x2e')](_0x2d4fd0[_0xc631('0x2a')]['fields']));_0x5d019b[_0xc631('0x2d')]=_0x5d019b[_0xc631('0x2d')][_0xc631('0x2f')]?_0x5d019b[_0xc631('0x2d')]:_0x5679d6[_0xc631('0x27')];_0x5d019b=_[_0xc631('0x30')]({},_0x5d019b,_0x2d4fd0[_0xc631('0x31')]);return utilLicense[_0xc631('0x32')](_0x5d019b)[_0xc631('0x21')](respondWithResult(_0x3ebc41,null))[_0xc631('0x33')](handleError(_0x3ebc41,null));};exports[_0xc631('0x20')]=function(_0x498695,_0x53afcd){if(_0x498695['body']['id']){delete _0x498695['body']['id'];}return db[_0xc631('0x29')][_0xc631('0x34')]({'where':{'id':_0x498695['params']['id']}})['then'](handleEntityNotFound(_0x53afcd,null))[_0xc631('0x21')](function(_0x3ef80c){var _0x20b794=_0x3ef80c['get']({'plain':!![]});return utilLicense[_0xc631('0x35')](_0x20b794,_0x498695[_0xc631('0x36')]['key']);})[_0xc631('0x21')](function(_0x2f3d29){if(!_0x2f3d29[_0xc631('0x37')]){return saveUpdates(_0x498695[_0xc631('0x36')],null);}return _0x2f3d29;})['then'](respondWithResult(_0x53afcd,null))[_0xc631('0x33')](handleError(_0x53afcd,null));}; \ No newline at end of file +var _0xb145=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','fields','merge','getLicense','catch','body','find','params','checkLicense','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x3e861a,_0x34868f){var _0x4bc3fc=function(_0x1e9c6c){while(--_0x1e9c6c){_0x3e861a['push'](_0x3e861a['shift']());}};_0x4bc3fc(++_0x34868f);}(_0xb145,0xa3));var _0x5b14=function(_0x3c575d,_0x5864b9){_0x3c575d=_0x3c575d-0x0;var _0x245e6d=_0xb145[_0x3c575d];return _0x245e6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5b14('0x0'));var rimraf=require(_0x5b14('0x1'));var zipdir=require(_0x5b14('0x2'));var jsonpatch=require(_0x5b14('0x3'));var rp=require(_0x5b14('0x4'));var moment=require(_0x5b14('0x5'));var BPromise=require(_0x5b14('0x6'));var Mustache=require(_0x5b14('0x7'));var util=require('util');var path=require(_0x5b14('0x8'));var sox=require(_0x5b14('0x9'));var csv=require(_0x5b14('0xa'));var ejs=require(_0x5b14('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0xa'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var hardwareService=require(_0x5b14('0x13'));var logger=require(_0x5b14('0x14'))(_0x5b14('0x15'));var utils=require(_0x5b14('0x16'));var config=require('../../config/environment');var db=require(_0x5b14('0x17'))['db'];function respondWithStatusCode(_0x50997e,_0x30deb8){_0x30deb8=_0x30deb8||0xcc;return function(_0x1903a5){if(_0x1903a5){return _0x50997e[_0x5b14('0x18')](_0x30deb8);}return _0x50997e[_0x5b14('0x19')](_0x30deb8)[_0x5b14('0x1a')]();};}function respondWithResult(_0x40577a,_0x52ffa9){_0x52ffa9=_0x52ffa9||0xc8;return function(_0x27b34b){if(_0x27b34b){return _0x40577a[_0x5b14('0x19')](_0x52ffa9)[_0x5b14('0x1b')](_0x27b34b);}};}function respondWithFilteredResult(_0x1dfa26,_0xba7e13){return function(_0x2a8fe5){if(_0x2a8fe5){var _0x68f695=_0x2a8fe5[_0x5b14('0x1c')],_0xe5af75=_0xba7e13[_0x5b14('0x1d')],_0x183b0a=_0xba7e13['offset']+_0xba7e13[_0x5b14('0x1e')],_0x287bb7;if(_0x183b0a>=_0x68f695){_0x183b0a=_0x68f695;_0x287bb7=0xc8;}else{_0x287bb7=0xce;}_0x1dfa26['status'](_0x287bb7);return _0x1dfa26['set']('Content-Range',_0xe5af75+'-'+_0x183b0a+'/'+_0x68f695)[_0x5b14('0x1b')](_0x2a8fe5);}return null;};}function patchUpdates(_0x3035b5){return function(_0x3662a7){try{jsonpatch[_0x5b14('0x1f')](_0x3662a7,_0x3035b5,!![]);}catch(_0x3786f7){return BPromise[_0x5b14('0x20')](_0x3786f7);}return _0x3662a7[_0x5b14('0x21')]();};}function saveUpdates(_0x4a4e60,_0x525176){return function(_0x4fa079){if(_0x4fa079){return _0x4fa079[_0x5b14('0x22')](_0x4a4e60)[_0x5b14('0x23')](function(_0x9a9495){return _0x9a9495;});}return null;};}function removeEntity(_0x1e22a5,_0x4c8080){return function(_0x1018d9){if(_0x1018d9){return _0x1018d9[_0x5b14('0x24')]()['then'](function(){_0x1e22a5[_0x5b14('0x19')](0xcc)[_0x5b14('0x1a')]();});}};}function handleEntityNotFound(_0x50951f,_0x33a293){return function(_0x54073f){if(!_0x54073f){_0x50951f['sendStatus'](0x194);}return _0x54073f;};}function handleError(_0x5e0780,_0x4def4b){_0x4def4b=_0x4def4b||0x1f4;return function(_0x2d62d1){logger[_0x5b14('0x25')](_0x2d62d1[_0x5b14('0x26')]);if(_0x2d62d1['name']){delete _0x2d62d1[_0x5b14('0x27')];}_0x5e0780[_0x5b14('0x19')](_0x4def4b)[_0x5b14('0x28')](_0x2d62d1);};}var utilLicense=require(_0x5b14('0x29'));exports[_0x5b14('0x2a')]=function(_0x1bbbd7,_0x422d22){var _0x205842={'raw':!![],'where':{'id':0x1}},_0x296d65={};_0x296d65[_0x5b14('0x2b')]=_[_0x5b14('0x2c')](db[_0x5b14('0x2d')][_0x5b14('0x2e')]);_0x296d65[_0x5b14('0x2f')]=_['keys'](_0x1bbbd7[_0x5b14('0x2f')]);_0x296d65[_0x5b14('0x30')]=_['intersection'](_0x296d65['model'],_0x296d65[_0x5b14('0x2f')]);_0x205842[_0x5b14('0x31')]=_['intersection'](_0x296d65['model'],qs[_0x5b14('0x32')](_0x1bbbd7['query'][_0x5b14('0x32')]));_0x205842[_0x5b14('0x31')]=_0x205842['attributes']['length']?_0x205842[_0x5b14('0x31')]:_0x296d65[_0x5b14('0x2b')];_0x205842=_[_0x5b14('0x33')]({},_0x205842,_0x1bbbd7['options']);return utilLicense[_0x5b14('0x34')](_0x205842)['then'](respondWithResult(_0x422d22,null))[_0x5b14('0x35')](handleError(_0x422d22,null));};exports[_0x5b14('0x22')]=function(_0x3f3c5f,_0x2e2a83){if(_0x3f3c5f['body']['id']){delete _0x3f3c5f[_0x5b14('0x36')]['id'];}return db[_0x5b14('0x2d')][_0x5b14('0x37')]({'where':{'id':_0x3f3c5f[_0x5b14('0x38')]['id']}})['then'](handleEntityNotFound(_0x2e2a83,null))[_0x5b14('0x23')](function(_0x3a11a2){var _0x17bd9f=_0x3a11a2['get']({'plain':!![]});return utilLicense[_0x5b14('0x39')](_0x17bd9f,_0x3f3c5f['body'][_0x5b14('0x3a')]);})[_0x5b14('0x23')](function(_0x49b0c9){if(!_0x49b0c9[_0x5b14('0x3b')]){return saveUpdates(_0x3f3c5f[_0x5b14('0x36')],null);}return _0x49b0c9;})['then'](respondWithResult(_0x2e2a83,null))[_0x5b14('0x35')](handleError(_0x2e2a83,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 594c332..20a6f12 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 _0x0b70=['./license.attributes','define','license','util','api','moment','request-promise','path','rimraf'];(function(_0x3ba748,_0x4b8fb9){var _0x5b04e2=function(_0x16bb9e){while(--_0x16bb9e){_0x3ba748['push'](_0x3ba748['shift']());}};_0x5b04e2(++_0x4b8fb9);}(_0x0b70,0x159));var _0x00b7=function(_0x2e124d,_0x31ce4a){_0x2e124d=_0x2e124d-0x0;var _0x1c03d2=_0x0b70[_0x2e124d];return _0x1c03d2;};'use strict';var _=require('lodash');var util=require(_0x00b7('0x0'));var logger=require('../../config/logger')(_0x00b7('0x1'));var moment=require(_0x00b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x00b7('0x3'));var fs=require('fs');var path=require(_0x00b7('0x4'));var rimraf=require(_0x00b7('0x5'));var config=require('../../config/environment');var attributes=require(_0x00b7('0x6'));module['exports']=function(_0x81e64,_0x54332d){return _0x81e64[_0x00b7('0x7')]('License',attributes,{'tableName':_0x00b7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38c9=['../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x557ea9,_0x5f2ded){var _0x476c2b=function(_0x23f7ca){while(--_0x23f7ca){_0x557ea9['push'](_0x557ea9['shift']());}};_0x476c2b(++_0x5f2ded);}(_0x38c9,0x199));var _0x938c=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x38c9[_0x1d7300];return _0x46ee98;};'use strict';var _=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var logger=require(_0x938c('0x2'))('api');var moment=require(_0x938c('0x3'));var BPromise=require(_0x938c('0x4'));var rp=require(_0x938c('0x5'));var fs=require('fs');var path=require(_0x938c('0x6'));var rimraf=require('rimraf');var config=require(_0x938c('0x7'));var attributes=require(_0x938c('0x8'));module[_0x938c('0x9')]=function(_0x15a858,_0x4dae36){return _0x15a858[_0x938c('0xa')](_0x938c('0xb'),attributes,{'tableName':_0x938c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 87c57ea..6f243a8 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 _0x027f=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x027f,0x95));var _0xf027=function(_0x4346a8,_0x2dd8e2){_0x4346a8=_0x4346a8-0x0;var _0x287ceb=_0x027f[_0x4346a8];return _0x287ceb;};'use strict';var _=require(_0xf027('0x0'));var util=require(_0xf027('0x1'));var moment=require(_0xf027('0x2'));var BPromise=require(_0xf027('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf027('0x4'));var db=require(_0xf027('0x5'))['db'];var utils=require(_0xf027('0x6'));var logger=require(_0xf027('0x7'))(_0xf027('0x8'));var config=require(_0xf027('0x9'));var jayson=require(_0xf027('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe4a7,_0x294bbd,_0x51bc17){return new BPromise(function(_0x3dd754,_0x5db2f5){return client[_0xf027('0xb')](_0x2fe4a7,_0x51bc17)[_0xf027('0xc')](function(_0xd7c8c7){logger[_0xf027('0xd')](_0xf027('0xe'),_0x294bbd,_0xf027('0xf'));logger[_0xf027('0x10')](_0xf027('0x11'),_0x294bbd,_0xf027('0xf'),JSON[_0xf027('0x12')](_0xd7c8c7));if(_0xd7c8c7['error']){if(_0xd7c8c7[_0xf027('0x13')]['code']===0x1f4){logger[_0xf027('0x13')](_0xf027('0xe'),_0x294bbd,_0xd7c8c7[_0xf027('0x13')]['message']);return _0x5db2f5(_0xd7c8c7[_0xf027('0x13')]['message']);}logger['error'](_0xf027('0xe'),_0x294bbd,_0xd7c8c7['error'][_0xf027('0x14')]);return _0x3dd754(_0xd7c8c7['error'][_0xf027('0x14')]);}else{logger[_0xf027('0xd')](_0xf027('0xe'),_0x294bbd,_0xf027('0xf'));_0x3dd754(_0xd7c8c7[_0xf027('0x15')][_0xf027('0x14')]);}})[_0xf027('0x16')](function(_0x5bb865){logger[_0xf027('0x13')](_0xf027('0xe'),_0x294bbd,_0x5bb865);_0x5db2f5(_0x5bb865);});});} \ No newline at end of file +var _0x7965=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','request'];(function(_0x521e30,_0x5326aa){var _0x3b9ce1=function(_0x288691){while(--_0x288691){_0x521e30['push'](_0x521e30['shift']());}};_0x3b9ce1(++_0x5326aa);}(_0x7965,0x1ea));var _0x5796=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x7965[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x5796('0x0'));var util=require(_0x5796('0x1'));var moment=require(_0x5796('0x2'));var BPromise=require(_0x5796('0x3'));var rs=require(_0x5796('0x4'));var fs=require('fs');var Redis=require(_0x5796('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5796('0x6'))(_0x5796('0x7'));var config=require(_0x5796('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x131c76,_0x9c01d2,_0x2e93e1){return new BPromise(function(_0x2c6e03,_0x47c229){return client[_0x5796('0x9')](_0x131c76,_0x2e93e1)['then'](function(_0x5a8858){logger[_0x5796('0xa')](_0x5796('0xb'),_0x9c01d2,_0x5796('0xc'));logger[_0x5796('0xd')](_0x5796('0xe'),_0x9c01d2,_0x5796('0xc'),JSON[_0x5796('0xf')](_0x5a8858));if(_0x5a8858[_0x5796('0x10')]){if(_0x5a8858[_0x5796('0x10')]['code']===0x1f4){logger['error'](_0x5796('0xb'),_0x9c01d2,_0x5a8858[_0x5796('0x10')][_0x5796('0x11')]);return _0x47c229(_0x5a8858['error']['message']);}logger['error']('License,\x20%s,\x20%s',_0x9c01d2,_0x5a8858['error'][_0x5796('0x11')]);return _0x2c6e03(_0x5a8858[_0x5796('0x10')]['message']);}else{logger['info'](_0x5796('0xb'),_0x9c01d2,_0x5796('0xc'));_0x2c6e03(_0x5a8858[_0x5796('0x12')][_0x5796('0x11')]);}})[_0x5796('0x13')](function(_0x8d7a87){logger['error'](_0x5796('0xb'),_0x9c01d2,_0x8d7a87);_0x47c229(_0x8d7a87);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 26f5ed7..64c33a6 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 _0x98ed=['show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','delete','removeAnswers','/:id/in_servers','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0xeff046,_0x55345b){var _0x2b6269=function(_0x2962b1){while(--_0x2962b1){_0xeff046['push'](_0xeff046['shift']());}};_0x2b6269(++_0x55345b);}(_0x98ed,0x146));var _0xd98e=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0x98ed[_0x206711];return _0x4fe02b;};'use strict';var multer=require(_0xd98e('0x0'));var util=require('util');var path=require(_0xd98e('0x1'));var timeout=require(_0xd98e('0x2'));var express=require('express');var router=express[_0xd98e('0x3')]();var auth=require(_0xd98e('0x4'));var interaction=require(_0xd98e('0x5'));var config=require(_0xd98e('0x6'));var controller=require('./mailAccount.controller');router[_0xd98e('0x7')]('/',auth[_0xd98e('0x8')](),controller['index']);router[_0xd98e('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd98e('0x7')](_0xd98e('0x9'),auth['isAuthenticated'](),controller[_0xd98e('0xa')]);router[_0xd98e('0x7')](_0xd98e('0xb'),auth[_0xd98e('0x8')](),controller[_0xd98e('0xc')]);router[_0xd98e('0x7')](_0xd98e('0xd'),auth[_0xd98e('0x8')](),controller['getAnswers']);router[_0xd98e('0x7')]('/:id/in_servers',auth[_0xd98e('0x8')](),controller['getImap']);router[_0xd98e('0x7')](_0xd98e('0xe'),auth[_0xd98e('0x8')](),controller[_0xd98e('0xf')]);router['get'](_0xd98e('0x10'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xd98e('0x11'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x12')]);router[_0xd98e('0x7')](_0xd98e('0x13'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x14')]);router[_0xd98e('0x7')](_0xd98e('0x15'),auth['isAuthenticated'](),controller[_0xd98e('0x16')]);router[_0xd98e('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xd98e('0x17')]);router['post'](_0xd98e('0xb'),auth[_0xd98e('0x8')](),controller['addDisposition']);router[_0xd98e('0x18')]('/:id/canned_answers',auth[_0xd98e('0x8')](),controller[_0xd98e('0x19')]);router[_0xd98e('0x18')]('/',auth[_0xd98e('0x8')](),controller[_0xd98e('0x1a')]);router[_0xd98e('0x18')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xd98e('0x1b')]);router[_0xd98e('0x18')](_0xd98e('0xe'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x1c')]);router[_0xd98e('0x18')](_0xd98e('0x10'),auth['isAuthenticated'](),controller[_0xd98e('0x1d')]);router[_0xd98e('0x18')](_0xd98e('0x11'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x1e')]);router[_0xd98e('0x18')](_0xd98e('0x1f'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x20')]);router['post'](_0xd98e('0x21'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x22')]);router['put']('/:id',auth[_0xd98e('0x8')](),controller['update']);router[_0xd98e('0x23')](_0xd98e('0xb'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xd98e('0xd'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x24')]);router[_0xd98e('0x23')](_0xd98e('0x25'),auth[_0xd98e('0x8')](),controller['removeImap']);router['delete'](_0xd98e('0xe'),auth['isAuthenticated'](),controller[_0xd98e('0x26')]);router[_0xd98e('0x23')](_0xd98e('0x9'),auth['isAuthenticated'](),controller[_0xd98e('0x27')]);router['delete'](_0xd98e('0x21'),auth[_0xd98e('0x8')](),controller[_0xd98e('0x28')]);module[_0xd98e('0x29')]=router; \ No newline at end of file +var _0xcd61=['getAgents','addDisposition','addAnswer','create','post','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/verify','verifySmtp','/:id/users'];(function(_0x6cfbf6,_0x594cf1){var _0x537202=function(_0x1eac35){while(--_0x1eac35){_0x6cfbf6['push'](_0x6cfbf6['shift']());}};_0x537202(++_0x594cf1);}(_0xcd61,0x165));var _0x1cd6=function(_0x45141a,_0x20a587){_0x45141a=_0x45141a-0x0;var _0x110834=_0xcd61[_0x45141a];return _0x110834;};'use strict';var multer=require(_0x1cd6('0x0'));var util=require('util');var path=require(_0x1cd6('0x1'));var timeout=require(_0x1cd6('0x2'));var express=require('express');var router=express[_0x1cd6('0x3')]();var auth=require(_0x1cd6('0x4'));var interaction=require(_0x1cd6('0x5'));var config=require(_0x1cd6('0x6'));var controller=require(_0x1cd6('0x7'));router[_0x1cd6('0x8')]('/',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0xa')]);router[_0x1cd6('0x8')](_0x1cd6('0xb'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0xc')]);router[_0x1cd6('0x8')](_0x1cd6('0xd'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0xe')]);router[_0x1cd6('0x8')](_0x1cd6('0xf'),auth['isAuthenticated'](),controller[_0x1cd6('0x10')]);router['get'](_0x1cd6('0x11'),auth['isAuthenticated'](),controller[_0x1cd6('0x12')]);router['get'](_0x1cd6('0x13'),auth[_0x1cd6('0x9')](),controller['getImap']);router[_0x1cd6('0x8')](_0x1cd6('0x14'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x15')]);router[_0x1cd6('0x8')](_0x1cd6('0x16'),auth['isAuthenticated'](),controller[_0x1cd6('0x17')]);router[_0x1cd6('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x1cd6('0x8')]('/:id/messages',auth[_0x1cd6('0x9')](),controller['getMessages']);router[_0x1cd6('0x8')](_0x1cd6('0x18'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x19')]);router['get'](_0x1cd6('0x1a'),auth['isAuthenticated'](),controller[_0x1cd6('0x1b')]);router['post'](_0x1cd6('0xf'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x1c')]);router['post'](_0x1cd6('0x11'),auth['isAuthenticated'](),controller[_0x1cd6('0x1d')]);router['post']('/',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x1e')]);router[_0x1cd6('0x1f')]('/:id/in_servers',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x20')]);router[_0x1cd6('0x1f')](_0x1cd6('0x14'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x21')]);router[_0x1cd6('0x1f')](_0x1cd6('0x16'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x22')]);router[_0x1cd6('0x1f')](_0x1cd6('0x23'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x24')]);router['post'](_0x1cd6('0x25'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x26')]);router[_0x1cd6('0x1f')](_0x1cd6('0x1a'),auth['isAuthenticated'](),controller[_0x1cd6('0x27')]);router[_0x1cd6('0x28')](_0x1cd6('0xd'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x29')]);router['delete']('/:id/dispositions',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x2a')]);router[_0x1cd6('0x2b')]('/:id/canned_answers',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x2c')]);router[_0x1cd6('0x2b')](_0x1cd6('0x13'),auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x2d')]);router['delete'](_0x1cd6('0x14'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0x1cd6('0x2b')](_0x1cd6('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x1cd6('0x2b')]('/:id/users',auth[_0x1cd6('0x9')](),controller[_0x1cd6('0x2e')]);module[_0x1cd6('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 05cc4f1..f4fa1d2 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 _0xf595=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x1059a3,_0x43e16c){var _0x450964=function(_0x4185a7){while(--_0x4185a7){_0x1059a3['push'](_0x1059a3['shift']());}};_0x450964(++_0x43e16c);}(_0xf595,0x17d));var _0x5f59=function(_0x712fc1,_0x2d0d08){_0x712fc1=_0x712fc1-0x0;var _0x2cc5bf=_0xf595[_0x712fc1];return _0x2cc5bf;};'use strict';var Sequelize=require(_0x5f59('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x5f59('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x5f59('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5f59('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5f59('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x5f59('0x3')]},'markAsUnread':{'type':Sequelize[_0x5f59('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5f59('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5f59('0x4')](0x2)[_0x5f59('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5f59('0x6');}},'notificationSound':{'type':Sequelize[_0x5f59('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f59('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f59('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f59('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f59('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5f59('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x5f59('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1e3805){if(!_0x1e3805)this[_0x5f59('0x8')](_0x5f59('0x9'),null);this['setDataValue'](_0x5f59('0xa'),_0x1e3805);}}}; \ No newline at end of file +var _0xf7df=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','mandatoryDispositionPauseId','setDataValue','sequelize','STRING','BOOLEAN','TEXT','UNSIGNED'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xf7df,0x199));var _0xff7d=function(_0x4c7a91,_0x3cb14a){_0x4c7a91=_0x4c7a91-0x0;var _0x4d943f=_0xf7df[_0x4c7a91];return _0x4d943f;};'use strict';var Sequelize=require(_0xff7d('0x0'));module['exports']={'description':{'type':Sequelize[_0xff7d('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xff7d('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xff7d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xff7d('0x3')]},'markAsUnread':{'type':Sequelize[_0xff7d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xff7d('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xff7d('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xff7d('0x3')],'defaultValue':function(){return _0xff7d('0x5');}},'notificationSound':{'type':Sequelize[_0xff7d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xff7d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xff7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff7d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xff7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff7d('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x41b9a8){if(!_0x41b9a8)this['setDataValue'](_0xff7d('0x7'),null);this[_0xff7d('0x8')]('mandatoryDisposition',_0x41b9a8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b7131c0..c7c042b 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 _0x3cbf=['where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','Imap','rawAttributes','find','body','Disposition','create','getDispositions','findOne','hasOwnProperty','MailAccountId','removeDispositions','ids','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cbf,0x1ee));var _0xf3cb=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x3cbf[_0x295a3d];return _0x23a732;};'use strict';var pdf=require(_0xf3cb('0x0'));var emlformat=require(_0xf3cb('0x1'));var rimraf=require(_0xf3cb('0x2'));var zipdir=require(_0xf3cb('0x3'));var jsonpatch=require(_0xf3cb('0x4'));var rp=require(_0xf3cb('0x5'));var moment=require(_0xf3cb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf3cb('0x7'));var util=require('util');var path=require(_0xf3cb('0x8'));var sox=require(_0xf3cb('0x9'));var csv=require(_0xf3cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf3cb('0xb'));var crypto=require('crypto');var jsforce=require(_0xf3cb('0xc'));var deskjs=require(_0xf3cb('0xd'));var toCsv=require(_0xf3cb('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf3cb('0xe'));var authService=require(_0xf3cb('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3cb('0x10'))(_0xf3cb('0x11'));var utils=require(_0xf3cb('0x12'));var config=require(_0xf3cb('0x13'));var db=require(_0xf3cb('0x14'))['db'];config[_0xf3cb('0x15')]=_[_0xf3cb('0x16')](config['redis'],{'host':_0xf3cb('0x17'),'port':0x18eb});var socket=require(_0xf3cb('0x18'))(new Redis(config[_0xf3cb('0x15')]));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf3cb('0x19')][_0xf3cb('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x506b12,_0x297dc0,_0x196e0b){if(_0x196e0b){var _0xef88e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xef88e7[_0xf3cb('0x1b')](_0x297dc0)){return _0x506b12;}else{throw new Error(_0xf3cb('0x1c'));}}else{return _0x506b12;}}function respondWithRpcPromise(_0x3a1389,_0x5da239,_0x13bdd5,_0x48b167){return new BPromise(function(_0x174f0f,_0x11326f){var _0xed4e59=_0x48b167||client;return _0xed4e59[_0xf3cb('0x1d')](_0x3a1389,_0x13bdd5)[_0xf3cb('0x1e')](function(_0x140f5b){logger[_0xf3cb('0x1f')]('MailAccount,\x20%s,\x20%s',_0x5da239,_0xf3cb('0x20'));logger[_0xf3cb('0x21')](_0xf3cb('0x22'),_0x5da239,'request\x20sent',JSON['stringify'](_0x140f5b));if(_0x140f5b[_0xf3cb('0x23')]){if(_0x140f5b['error'][_0xf3cb('0x24')]===0x1f4){logger[_0xf3cb('0x23')](_0xf3cb('0x25'),_0x5da239,_0x140f5b['error'][_0xf3cb('0x26')]);return _0x11326f(_0x140f5b[_0xf3cb('0x23')]['message']);}logger[_0xf3cb('0x23')](_0xf3cb('0x25'),_0x5da239,_0x140f5b['error'][_0xf3cb('0x26')]);return _0x174f0f(_0x140f5b[_0xf3cb('0x23')][_0xf3cb('0x26')]);}else{logger[_0xf3cb('0x1f')]('MailAccount,\x20%s,\x20%s',_0x5da239,'request\x20sent');_0x174f0f(_0x140f5b[_0xf3cb('0x27')]['message']);}})[_0xf3cb('0x28')](function(_0x169c8a){logger[_0xf3cb('0x23')](_0xf3cb('0x25'),_0x5da239,_0x169c8a);_0x11326f(_0x169c8a);});});}function respondWithStatusCode(_0x24d458,_0x286972){_0x286972=_0x286972||0xcc;return function(_0x45f6e4){if(_0x45f6e4){return _0x24d458[_0xf3cb('0x29')](_0x286972);}return _0x24d458[_0xf3cb('0x2a')](_0x286972)[_0xf3cb('0x2b')]();};}function respondWithResult(_0x40b6a9,_0xcd22c9){_0xcd22c9=_0xcd22c9||0xc8;return function(_0x225725){if(_0x225725){return _0x40b6a9[_0xf3cb('0x2a')](_0xcd22c9)[_0xf3cb('0x2c')](_0x225725);}};}function respondWithFilteredResult(_0x430172,_0x1691de){return function(_0x316fba){if(_0x316fba){var _0x1edc62=_0x316fba['count'],_0x1b28d5=_0x1691de[_0xf3cb('0x2d')],_0x163f60=_0x1691de[_0xf3cb('0x2d')]+_0x1691de[_0xf3cb('0x2e')],_0x1590ef;if(_0x163f60>=_0x1edc62){_0x163f60=_0x1edc62;_0x1590ef=0xc8;}else{_0x1590ef=0xce;}_0x430172[_0xf3cb('0x2a')](_0x1590ef);return _0x430172['set'](_0xf3cb('0x2f'),_0x1b28d5+'-'+_0x163f60+'/'+_0x1edc62)[_0xf3cb('0x2c')](_0x316fba);}return null;};}function patchUpdates(_0xdada5b){return function(_0x300809){try{jsonpatch[_0xf3cb('0x30')](_0x300809,_0xdada5b,!![]);}catch(_0x51935d){return BPromise[_0xf3cb('0x31')](_0x51935d);}return _0x300809[_0xf3cb('0x32')]();};}function saveUpdates(_0x437cb4,_0x462582){return function(_0x320554){if(_0x320554){return _0x320554[_0xf3cb('0x33')](_0x437cb4)[_0xf3cb('0x1e')](function(_0x2df4cc){return _0x2df4cc;});}return null;};}function removeEntity(_0x3bf876,_0x4963d4){return function(_0x328b0a){if(_0x328b0a){return _0x328b0a[_0xf3cb('0x34')]()[_0xf3cb('0x1e')](function(){var _0x55ffd1=_0x328b0a[_0xf3cb('0x35')]({'plain':!![]});var _0x31868d='MailAccounts';return db[_0xf3cb('0x36')]['destroy']({'where':{'type':_0x31868d,'resourceId':_0x55ffd1['id']}})[_0xf3cb('0x1e')](function(){return _0x328b0a;});})['then'](function(){_0x3bf876[_0xf3cb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ed07,_0x257a52){return function(_0x5a4c36){if(!_0x5a4c36){_0x40ed07[_0xf3cb('0x29')](0x194);}return _0x5a4c36;};}function handleError(_0x36d116,_0x1ac020){_0x1ac020=_0x1ac020||0x1f4;return function(_0xc6a8df){logger['error'](_0xc6a8df[_0xf3cb('0x37')]);if(_0xc6a8df[_0xf3cb('0x38')]){delete _0xc6a8df[_0xf3cb('0x38')];}_0x36d116[_0xf3cb('0x2a')](_0x1ac020)[_0xf3cb('0x39')](_0xc6a8df);};}exports[_0xf3cb('0x3a')]=function(_0x4ccac1,_0x5efddb){var _0x19ac25={'include':[{'model':db[_0xf3cb('0x3b')],'as':'Imap'},{'model':db[_0xf3cb('0x3c')],'as':_0xf3cb('0x3d')},{'model':db[_0xf3cb('0x3e')],'as':_0xf3cb('0x3f')}]},_0x142899={},_0x1d0348={'count':0x0,'rows':[]};var _0xf829c3=db[_0xf3cb('0x40')]['rawAttributes'];_0x142899['model']=_[_0xf3cb('0x41')](_0xf829c3);_0x142899[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x4ccac1[_0xf3cb('0x42')]);_0x142899[_0xf3cb('0x43')]=_[_0xf3cb('0x44')](_0x142899[_0xf3cb('0x45')],_0x142899[_0xf3cb('0x42')]);_0x19ac25[_0xf3cb('0x46')]=_[_0xf3cb('0x44')](_0x142899[_0xf3cb('0x45')],qs['fields'](_0x4ccac1['query'][_0xf3cb('0x47')]));_0x19ac25[_0xf3cb('0x46')]=_0x19ac25[_0xf3cb('0x46')][_0xf3cb('0x48')]?_0x19ac25[_0xf3cb('0x46')]:_0x142899[_0xf3cb('0x45')];if(!_0x4ccac1[_0xf3cb('0x42')]['hasOwnProperty'](_0xf3cb('0x49'))){_0x19ac25[_0xf3cb('0x2e')]=qs[_0xf3cb('0x2e')](_0x4ccac1['query']['limit']);_0x19ac25[_0xf3cb('0x2d')]=qs[_0xf3cb('0x2d')](_0x4ccac1['query'][_0xf3cb('0x2d')]);}_0x19ac25[_0xf3cb('0x4a')]=qs[_0xf3cb('0x4b')](_0x4ccac1[_0xf3cb('0x42')][_0xf3cb('0x4b')]);_0x19ac25[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x4ccac1[_0xf3cb('0x42')],_0x142899[_0xf3cb('0x43')]));if(_0x4ccac1[_0xf3cb('0x42')][_0xf3cb('0x4e')]){_0x19ac25['where']=_[_0xf3cb('0x4f')](_0x19ac25[_0xf3cb('0x4c')],{'$or':_[_0xf3cb('0x50')](_0xf829c3,function(_0x1305c2){if(_0x1305c2[_0xf3cb('0x51')][_0xf3cb('0x52')]!==_0xf3cb('0x53')){var _0x2862c5={};_0x2862c5[_0x1305c2[_0xf3cb('0x54')]]={'$like':'%'+_0x4ccac1[_0xf3cb('0x42')]['filter']+'%'};return _0x2862c5;}})});}_0x19ac25=_[_0xf3cb('0x4f')]({},_0x19ac25,_0x4ccac1[_0xf3cb('0x55')]);var _0x1dd4e9={'where':_0x19ac25[_0xf3cb('0x4c')]};return db['MailAccount'][_0xf3cb('0x56')](_0x1dd4e9)['then'](function(_0x456a35){_0x1d0348[_0xf3cb('0x56')]=_0x456a35;if(_0x4ccac1['query'][_0xf3cb('0x57')]){_0x19ac25[_0xf3cb('0x58')]=[{'all':!![]}];}return db[_0xf3cb('0x40')][_0xf3cb('0x59')](_0x19ac25);})['then'](function(_0x324c7c){_0x1d0348[_0xf3cb('0x5a')]=_0x324c7c;return _0x1d0348;})[_0xf3cb('0x1e')](respondWithFilteredResult(_0x5efddb,_0x19ac25))['catch'](handleError(_0x5efddb,null));};exports[_0xf3cb('0x5b')]=function(_0x47f871,_0x370c39){var _0x3df681={'raw':![],'where':{'id':_0x47f871[_0xf3cb('0x5c')]['id']},'include':[{'model':db[_0xf3cb('0x3b')],'as':_0xf3cb('0x5d')},{'model':db[_0xf3cb('0x3c')],'as':_0xf3cb('0x3d')},{'model':db[_0xf3cb('0x3e')],'as':_0xf3cb('0x3f')}]},_0x4ae570={};_0x4ae570[_0xf3cb('0x45')]=_['keys'](db[_0xf3cb('0x40')][_0xf3cb('0x5e')]);_0x4ae570[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x47f871['query']);_0x4ae570[_0xf3cb('0x43')]=_['intersection'](_0x4ae570[_0xf3cb('0x45')],_0x4ae570[_0xf3cb('0x42')]);_0x3df681[_0xf3cb('0x46')]=_[_0xf3cb('0x44')](_0x4ae570[_0xf3cb('0x45')],qs[_0xf3cb('0x47')](_0x47f871['query'][_0xf3cb('0x47')]));_0x3df681[_0xf3cb('0x46')]=_0x3df681[_0xf3cb('0x46')][_0xf3cb('0x48')]?_0x3df681[_0xf3cb('0x46')]:_0x4ae570['model'];if(_0x47f871[_0xf3cb('0x42')][_0xf3cb('0x57')]){_0x3df681[_0xf3cb('0x58')]=[{'all':!![]}];}_0x3df681=_[_0xf3cb('0x4f')]({},_0x3df681,_0x47f871['options']);return db[_0xf3cb('0x40')][_0xf3cb('0x5f')](_0x3df681)[_0xf3cb('0x1e')](handleEntityNotFound(_0x370c39,null))['then'](respondWithResult(_0x370c39,null))[_0xf3cb('0x28')](handleError(_0x370c39,null));};exports[_0xf3cb('0x33')]=function(_0x4a8a96,_0x5738df){if(_0x4a8a96['body']['id']){delete _0x4a8a96[_0xf3cb('0x60')]['id'];}return db['MailAccount'][_0xf3cb('0x5f')]({'where':{'id':_0x4a8a96[_0xf3cb('0x5c')]['id']},'include':[{'model':db[_0xf3cb('0x3b')],'as':_0xf3cb('0x5d')},{'model':db[_0xf3cb('0x3c')],'as':_0xf3cb('0x3d')},{'model':db[_0xf3cb('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xf3cb('0x1e')](handleEntityNotFound(_0x5738df,null))[_0xf3cb('0x1e')](saveUpdates(_0x4a8a96[_0xf3cb('0x60')],null))['then'](function(_0x11d463){if(_0x11d463&&_0x4a8a96['body']['Imap']){return db['MailServerIn'][_0xf3cb('0x33')](_0x4a8a96[_0xf3cb('0x60')][_0xf3cb('0x5d')],{'where':{'MailAccountId':_0x11d463['id']}})[_0xf3cb('0x1e')](function(){return _0x11d463;});}return _0x11d463;})[_0xf3cb('0x1e')](function(_0x5e4e07){if(_0x5e4e07&&_0x4a8a96['body'][_0xf3cb('0x3d')]){return db[_0xf3cb('0x3c')][_0xf3cb('0x33')](_0x4a8a96['body']['Smtp'],{'where':{'MailAccountId':_0x5e4e07['id']}})[_0xf3cb('0x1e')](function(){return _0x5e4e07;});}return _0x5e4e07;})['then'](respondWithResult(_0x5738df,null))['catch'](handleError(_0x5738df,null));};exports['describe']=function(_0x17ba8b,_0x34214c){return db[_0xf3cb('0x40')]['describe']()[_0xf3cb('0x1e')](respondWithResult(_0x34214c,null))['catch'](handleError(_0x34214c,null));};exports['addDisposition']=function(_0x3db738,_0x140a1b,_0xea97ef){if(_0x3db738['body']['id']){delete _0x3db738['body']['id'];}return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x3db738[_0xf3cb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x140a1b,null))[_0xf3cb('0x1e')](function(_0x26f4e4){if(_0x26f4e4){_0x3db738[_0xf3cb('0x60')]['MailAccountId']=_0x26f4e4['id'];return db[_0xf3cb('0x61')][_0xf3cb('0x62')](_0x3db738[_0xf3cb('0x60')]);}})['then'](respondWithResult(_0x140a1b,null))[_0xf3cb('0x28')](handleError(_0x140a1b,null));};exports[_0xf3cb('0x63')]=function(_0x3f6408,_0x140dec,_0xb3e02){var _0x44049a={'raw':![],'where':{}};var _0x4702ac={};var _0x228525={'count':0x0,'rows':[]};return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x3f6408[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x140dec,null))[_0xf3cb('0x1e')](function(_0xf86134){if(_0xf86134){_0x4702ac[_0xf3cb('0x45')]=_[_0xf3cb('0x41')](db[_0xf3cb('0x61')][_0xf3cb('0x5e')]);_0x4702ac[_0xf3cb('0x42')]=_['keys'](_0x3f6408[_0xf3cb('0x42')]);_0x4702ac[_0xf3cb('0x43')]=_['intersection'](_0x4702ac[_0xf3cb('0x45')],_0x4702ac[_0xf3cb('0x42')]);_0x44049a['attributes']=_[_0xf3cb('0x44')](_0x4702ac[_0xf3cb('0x45')],qs[_0xf3cb('0x47')](_0x3f6408[_0xf3cb('0x42')]['fields']));_0x44049a[_0xf3cb('0x46')]=_0x44049a['attributes'][_0xf3cb('0x48')]?_0x44049a['attributes']:_0x4702ac[_0xf3cb('0x45')];if(!_0x3f6408[_0xf3cb('0x42')][_0xf3cb('0x65')]('nolimit')){_0x44049a[_0xf3cb('0x2e')]=qs[_0xf3cb('0x2e')](_0x3f6408[_0xf3cb('0x42')][_0xf3cb('0x2e')]);_0x44049a[_0xf3cb('0x2d')]=qs[_0xf3cb('0x2d')](_0x3f6408[_0xf3cb('0x42')][_0xf3cb('0x2d')]);}_0x44049a[_0xf3cb('0x4a')]=qs[_0xf3cb('0x4b')](_0x3f6408['query']['sort']);_0x44049a[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x3f6408[_0xf3cb('0x42')],_0x4702ac['filters']));_0x44049a[_0xf3cb('0x4c')][_0xf3cb('0x66')]=_0xf86134['id'];if(_0x3f6408['query'][_0xf3cb('0x4e')]){_0x44049a['where']=_[_0xf3cb('0x4f')](_0x44049a['where'],{'$or':_[_0xf3cb('0x50')](_0x44049a[_0xf3cb('0x46')],function(_0x10392a){var _0x4fcdfa={};_0x4fcdfa[_0x10392a]={'$like':'%'+_0x3f6408[_0xf3cb('0x42')][_0xf3cb('0x4e')]+'%'};return _0x4fcdfa;})});}_0x44049a=_[_0xf3cb('0x4f')]({},_0x44049a,_0x3f6408[_0xf3cb('0x55')]);return db['Disposition'][_0xf3cb('0x56')]({'where':_0x44049a[_0xf3cb('0x4c')]})[_0xf3cb('0x1e')](function(_0x51191b){_0x228525[_0xf3cb('0x56')]=_0x51191b;if(_0x3f6408['query']['includeAll']){_0x44049a[_0xf3cb('0x58')]=[{'all':!![]}];}return db[_0xf3cb('0x61')][_0xf3cb('0x59')](_0x44049a);})['then'](function(_0x242a0b){_0x228525['rows']=_0x242a0b;return _0x228525;});}})[_0xf3cb('0x1e')](respondWithFilteredResult(_0x140dec,_0x44049a))[_0xf3cb('0x28')](handleError(_0x140dec,null));};exports[_0xf3cb('0x67')]=function(_0x1b7c28,_0x33bd5a,_0x2e325f){return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x1b7c28['params']['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x33bd5a,null))[_0xf3cb('0x1e')](function(_0x3fda24){if(_0x3fda24){return _0x3fda24['removeDispositions'](_0x1b7c28[_0xf3cb('0x42')][_0xf3cb('0x68')]);}})[_0xf3cb('0x1e')](respondWithStatusCode(_0x33bd5a,null))['catch'](handleError(_0x33bd5a,null));};exports['addAnswer']=function(_0x4b2a11,_0x1fb492,_0x8cb812){if(_0x4b2a11[_0xf3cb('0x60')]['id']){delete _0x4b2a11[_0xf3cb('0x60')]['id'];}return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x4b2a11[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x1fb492,null))[_0xf3cb('0x1e')](function(_0x30a5ff){if(_0x30a5ff){_0x4b2a11[_0xf3cb('0x60')][_0xf3cb('0x66')]=_0x30a5ff['id'];return db[_0xf3cb('0x69')][_0xf3cb('0x62')](_0x4b2a11[_0xf3cb('0x60')]);}})[_0xf3cb('0x1e')](respondWithResult(_0x1fb492,null))['catch'](handleError(_0x1fb492,null));};exports['getAnswers']=function(_0x233542,_0x12f98a,_0xf9e5a8){var _0x1e0a1e={'raw':![],'where':{}};var _0x1d8e18={};var _0x20e5ea={'count':0x0,'rows':[]};return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x233542[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x12f98a,null))[_0xf3cb('0x1e')](function(_0x266050){if(_0x266050){_0x1d8e18[_0xf3cb('0x45')]=_[_0xf3cb('0x41')](db[_0xf3cb('0x69')][_0xf3cb('0x5e')]);_0x1d8e18[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x233542['query']);_0x1d8e18[_0xf3cb('0x43')]=_[_0xf3cb('0x44')](_0x1d8e18['model'],_0x1d8e18[_0xf3cb('0x42')]);_0x1e0a1e[_0xf3cb('0x46')]=_[_0xf3cb('0x44')](_0x1d8e18[_0xf3cb('0x45')],qs['fields'](_0x233542[_0xf3cb('0x42')][_0xf3cb('0x47')]));_0x1e0a1e[_0xf3cb('0x46')]=_0x1e0a1e[_0xf3cb('0x46')][_0xf3cb('0x48')]?_0x1e0a1e[_0xf3cb('0x46')]:_0x1d8e18['model'];if(!_0x233542[_0xf3cb('0x42')][_0xf3cb('0x65')]('nolimit')){_0x1e0a1e['limit']=qs[_0xf3cb('0x2e')](_0x233542[_0xf3cb('0x42')]['limit']);_0x1e0a1e[_0xf3cb('0x2d')]=qs['offset'](_0x233542['query'][_0xf3cb('0x2d')]);}_0x1e0a1e['order']=qs[_0xf3cb('0x4b')](_0x233542[_0xf3cb('0x42')][_0xf3cb('0x4b')]);_0x1e0a1e[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x233542[_0xf3cb('0x42')],_0x1d8e18[_0xf3cb('0x43')]));_0x1e0a1e[_0xf3cb('0x4c')][_0xf3cb('0x66')]=_0x266050['id'];if(_0x233542[_0xf3cb('0x42')][_0xf3cb('0x4e')]){_0x1e0a1e[_0xf3cb('0x4c')]=_[_0xf3cb('0x4f')](_0x1e0a1e[_0xf3cb('0x4c')],{'$or':_['map'](_0x1e0a1e[_0xf3cb('0x46')],function(_0xee670b){var _0x1665f6={};_0x1665f6[_0xee670b]={'$like':'%'+_0x233542[_0xf3cb('0x42')]['filter']+'%'};return _0x1665f6;})});}_0x1e0a1e=_[_0xf3cb('0x4f')]({},_0x1e0a1e,_0x233542[_0xf3cb('0x55')]);return db[_0xf3cb('0x69')][_0xf3cb('0x56')]({'where':_0x1e0a1e[_0xf3cb('0x4c')]})[_0xf3cb('0x1e')](function(_0x4fe12f){_0x20e5ea['count']=_0x4fe12f;if(_0x233542[_0xf3cb('0x42')][_0xf3cb('0x57')]){_0x1e0a1e[_0xf3cb('0x58')]=[{'all':!![]}];}return db[_0xf3cb('0x69')][_0xf3cb('0x59')](_0x1e0a1e);})[_0xf3cb('0x1e')](function(_0x521f3c){_0x20e5ea[_0xf3cb('0x5a')]=_0x521f3c;return _0x20e5ea;});}})[_0xf3cb('0x1e')](respondWithFilteredResult(_0x12f98a,_0x1e0a1e))[_0xf3cb('0x28')](handleError(_0x12f98a,null));};exports[_0xf3cb('0x6a')]=function(_0x19583f,_0x1136c2,_0x229563){return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x19583f['params']['id']}})['then'](handleEntityNotFound(_0x1136c2,null))[_0xf3cb('0x1e')](function(_0x3ad80d){if(_0x3ad80d){return _0x3ad80d[_0xf3cb('0x6a')](_0x19583f[_0xf3cb('0x42')][_0xf3cb('0x68')]);}})['then'](respondWithStatusCode(_0x1136c2,null))[_0xf3cb('0x28')](handleError(_0x1136c2,null));};exports[_0xf3cb('0x62')]=function(_0x5802f9,_0x39568a){var _0x493ddb={'name':_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x38')],'key':_0x5802f9[_0xf3cb('0x60')]['key'],'email':_0x5802f9['body'][_0xf3cb('0x6b')],'ListId':_0x5802f9['body'][_0xf3cb('0x6c')],'active':!_[_0xf3cb('0x6d')](_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x6e')])?_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x6e')]:!![],'description':_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x6f')]||null,'Imap':{},'Smtp':{}};if(_[_0xf3cb('0x6d')](_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x70')])){if(_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x71')]){_0x493ddb[_0xf3cb('0x5d')]['user']=_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x72')]=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x73')];_0x493ddb[_0xf3cb('0x5d')][_0xf3cb('0x74')]=_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x75')]=_0x5802f9[_0xf3cb('0x60')]['cpassword'];}else{_0x493ddb[_0xf3cb('0x5d')][_0xf3cb('0x76')]=_0x493ddb[_0xf3cb('0x3d')]['authentication']=![];}_0x493ddb[_0xf3cb('0x5d')][_0xf3cb('0x77')]=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x5d')]['host'];_0x493ddb[_0xf3cb('0x5d')][_0xf3cb('0x78')]=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x5d')][_0xf3cb('0x78')];_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x77')]=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x3d')][_0xf3cb('0x77')];_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x78')]=_0x5802f9['body'][_0xf3cb('0x3d')][_0xf3cb('0x78')];}else{_0x493ddb['Imap'][_0xf3cb('0x79')]=_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x79')]=_0x5802f9[_0xf3cb('0x60')]['cservice'];_0x493ddb[_0xf3cb('0x5d')][_0xf3cb('0x72')]=_0x493ddb[_0xf3cb('0x3d')][_0xf3cb('0x72')]=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x73')];_0x493ddb['Imap']['password']=_0x493ddb[_0xf3cb('0x3d')]['pass']=_0x5802f9[_0xf3cb('0x60')][_0xf3cb('0x7a')];}return db[_0xf3cb('0x40')][_0xf3cb('0x62')](_0x493ddb,{'include':[{'model':db[_0xf3cb('0x3c')],'as':_0xf3cb('0x3d')},{'model':db[_0xf3cb('0x3b')],'as':'Imap'}]})[_0xf3cb('0x1e')](function(_0x153ab0){var _0x49feff=_0x5802f9[_0xf3cb('0x72')][_0xf3cb('0x35')]({'plain':!![]});if(!_0x49feff)throw new Error(_0xf3cb('0x7b'));if(_0x49feff[_0xf3cb('0x7c')]===_0xf3cb('0x72')){var _0x553d68=_0x153ab0[_0xf3cb('0x35')]({'plain':!![]});return db['UserProfileSection'][_0xf3cb('0x5f')]({'where':{'name':'MailAccounts','userProfileId':_0x49feff[_0xf3cb('0x7d')]},'raw':!![]})['then'](function(_0x4fef79){if(_0x4fef79&&_0x4fef79['autoAssociation']===0x0){return db[_0xf3cb('0x36')]['create']({'name':_0x553d68[_0xf3cb('0x38')],'resourceId':_0x553d68['id'],'type':_0x4fef79[_0xf3cb('0x38')],'sectionId':_0x4fef79['id']},{})[_0xf3cb('0x1e')](function(){return _0x153ab0;});}else{return _0x153ab0;}})[_0xf3cb('0x28')](function(_0x460666){logger[_0xf3cb('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x460666);throw _0x460666;});}return _0x153ab0;})['then'](respondWithResult(_0x39568a,0xc9))['catch'](handleError(_0x39568a,null));};exports[_0xf3cb('0x7e')]=function(_0x19e7b5,_0x127ddf,_0x4ca790){return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x19e7b5['params']['id']}})['then'](handleEntityNotFound(_0x127ddf,null))['then'](function(_0x4b9371){if(_0x4b9371){return _0x4b9371[_0xf3cb('0x7e')]();}return null;})[_0xf3cb('0x1e')](respondWithResult(_0x127ddf,null))[_0xf3cb('0x28')](handleError(_0x127ddf,null));};exports[_0xf3cb('0x7f')]=function(_0x7ea7,_0x160d11,_0x475558){if(_0x7ea7['body']['id']){delete _0x7ea7['body']['id'];}return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x7ea7[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x160d11,null))['then'](function(_0x463de5){if(_0x463de5){_0x7ea7[_0xf3cb('0x60')]['MailAccountId']=_0x463de5['id'];return db['MailServerIn'][_0xf3cb('0x62')](_0x7ea7[_0xf3cb('0x60')]);}})[_0xf3cb('0x1e')](respondWithResult(_0x160d11,null))[_0xf3cb('0x28')](handleError(_0x160d11,null));};exports[_0xf3cb('0x80')]=function(_0x11d6b3,_0x2eee1b,_0x54e2fe){return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x11d6b3[_0xf3cb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2eee1b,null))[_0xf3cb('0x1e')](function(_0x381987){if(_0x381987){return _0x381987[_0xf3cb('0x81')](null);}return null;})[_0xf3cb('0x1e')](respondWithStatusCode(_0x2eee1b,null))[_0xf3cb('0x28')](handleError(_0x2eee1b,null));};exports[_0xf3cb('0x82')]=function(_0x5a5ff1,_0x4a5960,_0x175d00){return db[_0xf3cb('0x40')]['findOne']({'where':{'id':_0x5a5ff1[_0xf3cb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4a5960,null))[_0xf3cb('0x1e')](function(_0x344b69){if(_0x344b69){return _0x344b69[_0xf3cb('0x82')]();}return null;})[_0xf3cb('0x1e')](respondWithResult(_0x4a5960,null))[_0xf3cb('0x28')](handleError(_0x4a5960,null));};exports[_0xf3cb('0x83')]=function(_0x2ef13a,_0x439708,_0x58672b){if(_0x2ef13a['body']['id']){delete _0x2ef13a['body']['id'];}return db[_0xf3cb('0x40')]['find']({'where':{'id':_0x2ef13a[_0xf3cb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x439708,null))[_0xf3cb('0x1e')](function(_0x29ccaf){if(_0x29ccaf){_0x2ef13a['body']['MailAccountId']=_0x29ccaf['id'];return db[_0xf3cb('0x3c')]['create'](_0x2ef13a['body']);}})[_0xf3cb('0x1e')](respondWithResult(_0x439708,null))[_0xf3cb('0x28')](handleError(_0x439708,null));};exports[_0xf3cb('0x84')]=function(_0x317b49,_0x3b8539,_0x277f99){return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x317b49[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x3b8539,null))['then'](function(_0x15c107){if(_0x15c107){return _0x15c107[_0xf3cb('0x85')](null);}return null;})[_0xf3cb('0x1e')](respondWithStatusCode(_0x3b8539,null))[_0xf3cb('0x28')](handleError(_0x3b8539,null));};exports[_0xf3cb('0x86')]=function(_0x50e76b,_0x4cea41,_0x22a591){return db[_0xf3cb('0x87')]['find']({'where':{'id':_0x50e76b[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x4cea41,null))['then'](function(_0x381e9c){if(_0x381e9c){return _0x381e9c[_0xf3cb('0x86')](_0x50e76b['body'][_0xf3cb('0x68')],_[_0xf3cb('0x88')](_0x50e76b['body'],[_0xf3cb('0x68'),'id'])||{});}})['then'](respondWithResult(_0x4cea41,null))['catch'](handleError(_0x4cea41,null));};exports[_0xf3cb('0x89')]=function(_0x2d45a7,_0x27e51f,_0x4f970d){var _0x3f616c={'raw':![],'where':{}};var _0x18e2b0={};var _0x3dc2cc={'count':0x0,'rows':[]};return db['MailAccount'][_0xf3cb('0x64')]({'where':{'id':_0x2d45a7[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x27e51f,null))['then'](function(_0x4cb862){if(_0x4cb862){_0x18e2b0['model']=_[_0xf3cb('0x41')](db['MailInteraction'][_0xf3cb('0x5e')]);_0x18e2b0[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x2d45a7[_0xf3cb('0x42')]);_0x18e2b0['filters']=_[_0xf3cb('0x44')](_0x18e2b0[_0xf3cb('0x45')],_0x18e2b0[_0xf3cb('0x42')]);_0x3f616c[_0xf3cb('0x46')]=_['intersection'](_0x18e2b0['model'],qs[_0xf3cb('0x47')](_0x2d45a7['query'][_0xf3cb('0x47')]));_0x3f616c[_0xf3cb('0x46')]=_0x3f616c[_0xf3cb('0x46')][_0xf3cb('0x48')]?_0x3f616c[_0xf3cb('0x46')]:_0x18e2b0['model'];if(!_0x2d45a7['query'][_0xf3cb('0x65')](_0xf3cb('0x49'))){_0x3f616c[_0xf3cb('0x2e')]=qs[_0xf3cb('0x2e')](_0x2d45a7[_0xf3cb('0x42')]['limit']);_0x3f616c[_0xf3cb('0x2d')]=qs['offset'](_0x2d45a7[_0xf3cb('0x42')]['offset']);}_0x3f616c['order']=qs[_0xf3cb('0x4b')](_0x2d45a7[_0xf3cb('0x42')][_0xf3cb('0x4b')]);_0x3f616c[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x2d45a7[_0xf3cb('0x42')],_0x18e2b0[_0xf3cb('0x43')]));_0x3f616c['where'][_0xf3cb('0x66')]=_0x4cb862['id'];if(_0x2d45a7[_0xf3cb('0x42')]['filter']){_0x3f616c[_0xf3cb('0x4c')]=_[_0xf3cb('0x4f')](_0x3f616c[_0xf3cb('0x4c')],{'$or':_[_0xf3cb('0x50')](_0x3f616c['attributes'],function(_0x2fe4b9){var _0x1d21d2={};_0x1d21d2[_0x2fe4b9]={'$like':'%'+_0x2d45a7[_0xf3cb('0x42')]['filter']+'%'};return _0x1d21d2;})});}_0x3f616c=_['merge']({},_0x3f616c,_0x2d45a7[_0xf3cb('0x55')]);return db[_0xf3cb('0x87')][_0xf3cb('0x56')]({'where':_0x3f616c['where']})[_0xf3cb('0x1e')](function(_0x554f09){_0x3dc2cc[_0xf3cb('0x56')]=_0x554f09;if(_0x2d45a7['query'][_0xf3cb('0x57')]){_0x3f616c[_0xf3cb('0x58')]=[{'model':db['CmContact'],'as':_0xf3cb('0x8a'),'required':![]},{'model':db['User'],'as':_0xf3cb('0x8b'),'attributes':['name',_0xf3cb('0x8c'),_0xf3cb('0x8d')],'required':![]},{'model':db['Tag'],'as':_0xf3cb('0x8e'),'attributes':['id',_0xf3cb('0x38'),_0xf3cb('0x8f')],'where':_0x2d45a7[_0xf3cb('0x42')][_0xf3cb('0x90')]?{'id':_0x2d45a7['query']['tag']}:undefined,'required':_0x2d45a7[_0xf3cb('0x42')][_0xf3cb('0x90')]?!![]:![]}];}return db[_0xf3cb('0x87')]['findAll'](_0x3f616c);})['then'](function(_0x2e2ef3){_0x3dc2cc[_0xf3cb('0x5a')]=_0x2e2ef3;return _0x3dc2cc;});}})[_0xf3cb('0x1e')](respondWithFilteredResult(_0x27e51f,_0x3f616c))[_0xf3cb('0x28')](handleError(_0x27e51f,null));};exports[_0xf3cb('0x91')]=function(_0x254266,_0x4c5b92,_0x3a02c7){return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x254266[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x4c5b92,null))['then'](function(_0x29dfe2){if(_0x29dfe2){return db[_0xf3cb('0x92')]['transaction'](function(_0x4775f6){return db['MailApplication'][_0xf3cb('0x34')]({'where':{'MailAccountId':_0x254266[_0xf3cb('0x5c')]['id']},'transaction':_0x4775f6})[_0xf3cb('0x1e')](function(_0x39317d){var _0x3ff3e3=_[_0xf3cb('0x50')](_0x254266['body'],function(_0x122080){_0x122080[_0xf3cb('0x66')]=_0x254266[_0xf3cb('0x5c')]['id'];return _0x122080;});return db[_0xf3cb('0x93')][_0xf3cb('0x94')](_0x3ff3e3,{'transaction':_0x4775f6});});})['then'](function(){return db[_0xf3cb('0x93')][_0xf3cb('0x95')]({'where':{'MailAccountId':_0x254266[_0xf3cb('0x5c')]['id']},'order':_0xf3cb('0x96')});});}})[_0xf3cb('0x1e')](respondWithResult(_0x4c5b92,null))[_0xf3cb('0x28')](handleError(_0x4c5b92,null));};exports[_0xf3cb('0x97')]=function(_0x1fbfa6,_0x144ca8,_0x2e9551){var _0x4c633f={};var _0x5773d8={};var _0x7b7074;var _0x48d7dd;return db['MailAccount']['findOne']({'where':{'id':_0x1fbfa6[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x144ca8,null))[_0xf3cb('0x1e')](function(_0x481ef0){if(_0x481ef0){_0x7b7074=_0x481ef0;_0x5773d8[_0xf3cb('0x45')]=_[_0xf3cb('0x41')](db['MailApplication'][_0xf3cb('0x5e')]);_0x5773d8[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x1fbfa6['query']);_0x5773d8['filters']=_[_0xf3cb('0x44')](_0x5773d8[_0xf3cb('0x45')],_0x5773d8[_0xf3cb('0x42')]);_0x4c633f['attributes']=_[_0xf3cb('0x44')](_0x5773d8[_0xf3cb('0x45')],qs[_0xf3cb('0x47')](_0x1fbfa6['query'][_0xf3cb('0x47')]));_0x4c633f['attributes']=_0x4c633f[_0xf3cb('0x46')]['length']?_0x4c633f['attributes']:_0x5773d8[_0xf3cb('0x45')];_0x4c633f['order']=qs[_0xf3cb('0x4b')](_0x1fbfa6[_0xf3cb('0x42')][_0xf3cb('0x4b')]);_0x4c633f[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x1fbfa6['query'],_0x5773d8[_0xf3cb('0x43')]));if(_0x1fbfa6[_0xf3cb('0x42')][_0xf3cb('0x4e')]){_0x4c633f['where']=_[_0xf3cb('0x4f')](_0x4c633f[_0xf3cb('0x4c')],{'$or':_[_0xf3cb('0x50')](_0x4c633f['attributes'],function(_0xa422cf){var _0x17034f={};_0x17034f[_0xa422cf]={'$like':'%'+_0x1fbfa6[_0xf3cb('0x42')][_0xf3cb('0x4e')]+'%'};return _0x17034f;})});}_0x4c633f=_[_0xf3cb('0x4f')]({},_0x4c633f,_0x1fbfa6[_0xf3cb('0x55')]);return _0x7b7074[_0xf3cb('0x97')](_0x4c633f);}})['then'](function(_0x259ef7){if(_0x259ef7){_0x48d7dd=_0x259ef7['length'];if(!_0x1fbfa6['query']['hasOwnProperty'](_0xf3cb('0x49'))){_0x4c633f[_0xf3cb('0x2e')]=qs[_0xf3cb('0x2e')](_0x1fbfa6['query'][_0xf3cb('0x2e')]);_0x4c633f[_0xf3cb('0x2d')]=qs[_0xf3cb('0x2d')](_0x1fbfa6[_0xf3cb('0x42')][_0xf3cb('0x2d')]);}return _0x7b7074[_0xf3cb('0x97')](_0x4c633f);}})['then'](function(_0x41ac9d){if(_0x41ac9d){return _0x41ac9d?{'count':_0x48d7dd,'rows':_0x41ac9d}:null;}})[_0xf3cb('0x1e')](respondWithResult(_0x144ca8,null))[_0xf3cb('0x28')](handleError(_0x144ca8,null));};exports[_0xf3cb('0x98')]=function(_0x2ffcb4,_0x15f728,_0x4a09f5){var _0x4afc16={'raw':!![],'where':{}};var _0x2d6851={};var _0xf21e98={'count':0x0,'rows':[]};return db['MailAccount'][_0xf3cb('0x64')]({'where':{'id':_0x2ffcb4[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x15f728,null))[_0xf3cb('0x1e')](function(_0x38c4ad){if(_0x38c4ad){_0x2d6851[_0xf3cb('0x45')]=_[_0xf3cb('0x41')](db[_0xf3cb('0x99')][_0xf3cb('0x5e')]);_0x2d6851[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x2ffcb4[_0xf3cb('0x42')]);_0x2d6851['filters']=_[_0xf3cb('0x44')](_0x2d6851[_0xf3cb('0x45')],_0x2d6851['query']);_0x4afc16['attributes']=_[_0xf3cb('0x44')](_0x2d6851['model'],qs[_0xf3cb('0x47')](_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x47')]));_0x4afc16[_0xf3cb('0x46')]=_0x4afc16['attributes'][_0xf3cb('0x48')]?_0x4afc16[_0xf3cb('0x46')]:_0x2d6851[_0xf3cb('0x45')];if(!_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x65')](_0xf3cb('0x49'))){_0x4afc16[_0xf3cb('0x2e')]=qs['limit'](_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x2e')]);_0x4afc16[_0xf3cb('0x2d')]=qs[_0xf3cb('0x2d')](_0x2ffcb4['query'][_0xf3cb('0x2d')]);}_0x4afc16[_0xf3cb('0x4a')]=qs[_0xf3cb('0x4b')](_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x4b')]);_0x4afc16[_0xf3cb('0x4c')]=qs[_0xf3cb('0x43')](_[_0xf3cb('0x4d')](_0x2ffcb4[_0xf3cb('0x42')],_0x2d6851[_0xf3cb('0x43')]));_0x4afc16[_0xf3cb('0x4c')]['MailAccountId']=_0x38c4ad['id'];if(_0x2ffcb4['query']['filter']){_0x4afc16['where']=_[_0xf3cb('0x4f')](_0x4afc16[_0xf3cb('0x4c')],{'$or':_['map'](_0x4afc16[_0xf3cb('0x46')],function(_0xc53202){var _0x5203f0={};_0x5203f0[_0xc53202]={'$like':'%'+_0x2ffcb4['query'][_0xf3cb('0x4e')]+'%'};return _0x5203f0;})});}if(_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x9a')]){var _0x50e0c4=_0x2ffcb4[_0xf3cb('0x42')][_0xf3cb('0x9a')][_0xf3cb('0x9b')](',');var _0x526233={};_0x526233[_0x50e0c4[0x0]]={'$gte':moment(_0x50e0c4[0x1])[_0xf3cb('0x9c')](_0xf3cb('0x9d'))};_0x4afc16[_0xf3cb('0x4c')]=_[_0xf3cb('0x4f')](_0x4afc16[_0xf3cb('0x4c')],_0x526233);}_0x4afc16=_[_0xf3cb('0x4f')]({},_0x4afc16,_0x2ffcb4[_0xf3cb('0x55')]);return db[_0xf3cb('0x99')][_0xf3cb('0x56')]({'where':_0x4afc16['where']})['then'](function(_0x1af420){_0xf21e98[_0xf3cb('0x56')]=_0x1af420;if(_0x2ffcb4['query'][_0xf3cb('0x57')]){_0x4afc16[_0xf3cb('0x58')]=[{'all':!![]}];}return db[_0xf3cb('0x99')]['findAll'](_0x4afc16);})[_0xf3cb('0x1e')](function(_0x3c8e84){_0xf21e98[_0xf3cb('0x5a')]=_0x3c8e84;return _0xf21e98;});}})[_0xf3cb('0x1e')](respondWithFilteredResult(_0x15f728,_0x4afc16))[_0xf3cb('0x28')](handleError(_0x15f728,null));};exports[_0xf3cb('0x39')]=function(_0x2eec72,_0x51aee4,_0xbd2c72){var _0x375c58,_0x4218e6={},_0x5a7fe8;if(_0x2eec72[_0xf3cb('0x60')]['to']){_0x5a7fe8=_0x2eec72['body']['to'][_0xf3cb('0x9b')](',')[0x0];}return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x2eec72[_0xf3cb('0x5c')]['id']},'include':[{'model':db[_0xf3cb('0x9e')],'as':_0xf3cb('0x9f'),'include':[{'model':db[_0xf3cb('0xa0')],'as':_0xf3cb('0xa1'),'where':{'email':_0x5a7fe8},'limit':0x1,'order':[['updatedAt',_0xf3cb('0xa2')]]}]},{'model':db[_0xf3cb('0x3c')],'as':_0xf3cb('0x3d'),'raw':!![]}]})[_0xf3cb('0x1e')](handleEntityNotFound(_0x51aee4,null))[_0xf3cb('0x1e')](function(_0x1302c4){if(_0x1302c4){_0x375c58=_0x1302c4;if(_0x1302c4[_0xf3cb('0x3d')]){if(_[_0xf3cb('0x6d')](_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa3')])){_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa3')]=util['format'](_0xf3cb('0xa4'),_0x1302c4[_0xf3cb('0x38')],_0x1302c4[_0xf3cb('0x6b')]||_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x72')]);}if(_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa5')]&&_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa5')][_0xf3cb('0x48')]){for(var _0xf059c0=0x0;_0xf059c0<_0x2eec72['body']['attachments'][_0xf3cb('0x48')];_0xf059c0+=0x1){_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa5')][_0xf059c0]={'filename':_0x2eec72['body']['attachments'][_0xf059c0][_0xf3cb('0x38')],'path':path[_0xf3cb('0xa6')](config[_0xf3cb('0xa7')],_0xf3cb('0xa8'),_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa5')][_0xf059c0][_0xf3cb('0xa9')])};}}var _0x3513b4={'tls':{'rejectUnauthorized':![]}};if(_[_0xf3cb('0x6d')](_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x79')])){if(_0x1302c4['Smtp'][_0xf3cb('0x76')]){_0x3513b4[_0xf3cb('0xaa')]={'user':_0x1302c4['Smtp'][_0xf3cb('0x72')],'pass':_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x75')]};}_0x3513b4[_0xf3cb('0x77')]=_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x77')];_0x3513b4[_0xf3cb('0x78')]=_0x1302c4[_0xf3cb('0x3d')]['port'];_0x3513b4[_0xf3cb('0xab')]=_0x1302c4[_0xf3cb('0x3d')]['secure'];}else{_0x3513b4['service']=_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x79')];_0x3513b4[_0xf3cb('0xaa')]={'user':_0x1302c4['Smtp'][_0xf3cb('0x72')],'pass':_0x1302c4[_0xf3cb('0x3d')][_0xf3cb('0x75')]};}return respondWithRpcPromise('SendMail',_0xf3cb('0xac'),{'account':_0x3513b4,'message':_0x2eec72[_0xf3cb('0x60')]});}else{throw new Error(_0xf3cb('0xad'));}}})['then'](function(_0x42fa0a){if(_0x42fa0a){_0x4218e6=_0x42fa0a;if(_0x375c58[_0xf3cb('0x9f')]){if(_0x375c58[_0xf3cb('0x9f')]['Contacts'][_0xf3cb('0x48')]){return _0x375c58['List']['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0xf3cb('0x16')](_0x2eec72[_0xf3cb('0x60')],{'firstName':_0x2eec72[_0xf3cb('0x60')]['to'],'email':_0x2eec72['body']['to'],'phone':_0x2eec72[_0xf3cb('0x60')]['to'],'ListId':_0x375c58['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x3bc6a6){if(_0x3bc6a6){var _0x216001={'UserId':_0x2eec72[_0xf3cb('0x72')]['id'],'ContactId':_0x3bc6a6['id'],'MailAccountId':_0x375c58['id'],'inReplyTo':_0x4218e6['messageId'],'to':_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xa3')],'cc':_0x2eec72[_0xf3cb('0x60')]['cc'],'subject':_0x2eec72['body']['subject'],'attach':_0x2eec72['body'][_0xf3cb('0xae')],'firstMsgDirection':_0xf3cb('0xaf'),'lastMsgAt':moment()[_0xf3cb('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf3cb('0xaf'),'lastMsgBody':_0x2eec72['body'][_0xf3cb('0x60')],'Messages':[_[_0xf3cb('0x4f')](_0x2eec72[_0xf3cb('0x60')],{'messageId':_0x4218e6['messageId'],'sentAt':moment()['format'](_0xf3cb('0x9d')),'read':!![],'MailAccountId':_0x375c58['id'],'UserId':_0x2eec72['user']['id'],'ContactId':_0x3bc6a6['id']})]};if(_0x2eec72[_0xf3cb('0x60')]['Interaction']){_0x216001=_[_0xf3cb('0x4f')](_0x216001,_0x2eec72[_0xf3cb('0x60')][_0xf3cb('0xb0')]);}return db[_0xf3cb('0x87')]['create'](_0x216001,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0xf3cb('0x1e')](respondWithResult(_0x51aee4,null))[_0xf3cb('0x28')](handleError(_0x51aee4,null));};exports[_0xf3cb('0xb1')]=function(_0x3dddaa,_0x4caad2,_0x5c57c1){return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x3dddaa[_0xf3cb('0x5c')]['id']},'include':[{'model':db[_0xf3cb('0x3c')],'as':'Smtp','raw':!![]}]})[_0xf3cb('0x1e')](handleEntityNotFound(_0x4caad2,null))['then'](function(_0x47fa5c){if(_0x47fa5c&&_0x47fa5c[_0xf3cb('0x3d')]){var _0x175bcb={'id':_0x47fa5c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x47fa5c[_0xf3cb('0x3d')]['service']){_0x175bcb[_0xf3cb('0x79')]=_0x47fa5c['Smtp'][_0xf3cb('0x79')];}else{_0x175bcb[_0xf3cb('0x77')]=_0x47fa5c[_0xf3cb('0x3d')][_0xf3cb('0x77')];_0x175bcb[_0xf3cb('0x78')]=_0x47fa5c[_0xf3cb('0x3d')]['port'];_0x175bcb[_0xf3cb('0xab')]=_0x47fa5c['Smtp'][_0xf3cb('0xab')];}if(_0x47fa5c[_0xf3cb('0x3d')][_0xf3cb('0x76')]){_0x175bcb[_0xf3cb('0xaa')]={'user':_0x47fa5c['Smtp'][_0xf3cb('0x72')],'pass':_0x47fa5c[_0xf3cb('0x3d')][_0xf3cb('0x75')]};}return respondWithRpcPromise(_0xf3cb('0xb2'),'verifySmtp',{'account':_0x175bcb});}})[_0xf3cb('0x1e')](respondWithResult(_0x4caad2,null))['catch'](handleError(_0x4caad2,null));};exports[_0xf3cb('0x34')]=function(_0x41d174,_0x168ff8){return db['MailAccount'][_0xf3cb('0x5f')]({'where':{'id':_0x41d174[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x168ff8,null))['then'](function(_0x2963d0){if(_0x2963d0&&_0x2963d0[_0xf3cb('0x79')]){throw new db[(_0xf3cb('0xb3'))][(_0xf3cb('0xb4'))](_0xf3cb('0xb5'));}return _0x2963d0;})[_0xf3cb('0x1e')](removeEntity(_0x168ff8,null))[_0xf3cb('0x28')](handleError(_0x168ff8,null));};exports['addAgents']=function(_0x4c5484,_0x5abbf2,_0x21d9d7){return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x4c5484[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x5abbf2,null))[_0xf3cb('0x1e')](function(_0x1635e8){if(_0x1635e8){return _0x1635e8[_0xf3cb('0xb6')](_0x4c5484[_0xf3cb('0x60')][_0xf3cb('0x68')],_[_0xf3cb('0x88')](_0x4c5484['body'],['ids','id'])||{})[_0xf3cb('0xb7')](function(_0xe52360){for(var _0x1e1246=0x0;_0x1e1246<_0x4c5484[_0xf3cb('0x60')][_0xf3cb('0x68')][_0xf3cb('0x48')];_0x1e1246+=0x1){socket[_0xf3cb('0xb8')](_0xf3cb('0xb9'),{'UserId':_0x4c5484[_0xf3cb('0x60')][_0xf3cb('0x68')][_0x1e1246],'MailAccountId':_0x4c5484['params']['id']});}return _0xe52360;});}})['then'](respondWithResult(_0x5abbf2,null))['catch'](handleError(_0x5abbf2,null));};exports[_0xf3cb('0xba')]=function(_0x537d5b,_0x419b34,_0x5071de){return db[_0xf3cb('0x40')][_0xf3cb('0x5f')]({'where':{'id':_0x537d5b[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x419b34,null))[_0xf3cb('0x1e')](function(_0x2c6c1b){if(_0x2c6c1b){return _0x2c6c1b[_0xf3cb('0xba')](_0x537d5b[_0xf3cb('0x42')][_0xf3cb('0x68')])[_0xf3cb('0x1e')](function(){if(_[_0xf3cb('0xbb')](_0x537d5b[_0xf3cb('0x42')][_0xf3cb('0x68')])){for(var _0x1f4bb2=0x0;_0x1f4bb2<_0x537d5b[_0xf3cb('0x42')]['ids']['length'];_0x1f4bb2+=0x1){socket[_0xf3cb('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x537d5b['query'][_0xf3cb('0x68')][_0x1f4bb2]),'MailAccountId':Number(_0x537d5b['params']['id'])});}}else{socket[_0xf3cb('0xb8')](_0xf3cb('0xbc'),{'UserId':Number(_0x537d5b[_0xf3cb('0x42')][_0xf3cb('0x68')]),'MailAccountId':Number(_0x537d5b['params']['id'])});}});}})[_0xf3cb('0x1e')](respondWithStatusCode(_0x419b34,null))[_0xf3cb('0x28')](handleError(_0x419b34,null));};exports[_0xf3cb('0xbd')]=function(_0x38d76a,_0x51a9e3,_0x293209){var _0x2f0641={};var _0x47e7f7={};var _0x42a1a6;var _0x530d4c;return db[_0xf3cb('0x40')][_0xf3cb('0x64')]({'where':{'id':_0x38d76a[_0xf3cb('0x5c')]['id']}})[_0xf3cb('0x1e')](handleEntityNotFound(_0x51a9e3,null))['then'](function(_0x332c8f){if(_0x332c8f){_0x42a1a6=_0x332c8f;_0x47e7f7[_0xf3cb('0x45')]=_[_0xf3cb('0x41')](db['User'][_0xf3cb('0x5e')]);_0x47e7f7[_0xf3cb('0x42')]=_[_0xf3cb('0x41')](_0x38d76a[_0xf3cb('0x42')]);_0x47e7f7[_0xf3cb('0x43')]=_[_0xf3cb('0x44')](_0x47e7f7[_0xf3cb('0x45')],_0x47e7f7[_0xf3cb('0x42')]);_0x2f0641[_0xf3cb('0x46')]=_[_0xf3cb('0x44')](_0x47e7f7['model'],qs[_0xf3cb('0x47')](_0x38d76a[_0xf3cb('0x42')]['fields']));_0x2f0641[_0xf3cb('0x46')]=_0x2f0641[_0xf3cb('0x46')][_0xf3cb('0x48')]?_0x2f0641[_0xf3cb('0x46')]:_0x47e7f7[_0xf3cb('0x45')];_0x2f0641['order']=qs[_0xf3cb('0x4b')](_0x38d76a['query']['sort']);_0x2f0641[_0xf3cb('0x4c')]=qs['filters'](_[_0xf3cb('0x4d')](_0x38d76a[_0xf3cb('0x42')],_0x47e7f7['filters']));if(_0x38d76a[_0xf3cb('0x42')][_0xf3cb('0x4e')]){_0x2f0641[_0xf3cb('0x4c')]=_['merge'](_0x2f0641['where'],{'$or':_[_0xf3cb('0x50')](_0x2f0641[_0xf3cb('0x46')],function(_0x846226){var _0x2a5ede={};_0x2a5ede[_0x846226]={'$like':'%'+_0x38d76a[_0xf3cb('0x42')]['filter']+'%'};return _0x2a5ede;})});}_0x2f0641=_[_0xf3cb('0x4f')]({},_0x2f0641,_0x38d76a['options']);return _0x42a1a6['getAgents'](_0x2f0641);}})[_0xf3cb('0x1e')](function(_0x1ae7d6){if(_0x1ae7d6){_0x530d4c=_0x1ae7d6[_0xf3cb('0x48')];if(!_0x38d76a[_0xf3cb('0x42')][_0xf3cb('0x65')](_0xf3cb('0x49'))){_0x2f0641[_0xf3cb('0x2e')]=qs[_0xf3cb('0x2e')](_0x38d76a[_0xf3cb('0x42')][_0xf3cb('0x2e')]);_0x2f0641[_0xf3cb('0x2d')]=qs['offset'](_0x38d76a[_0xf3cb('0x42')][_0xf3cb('0x2d')]);}return _0x42a1a6['getAgents'](_0x2f0641);}})[_0xf3cb('0x1e')](function(_0x19c906){if(_0x19c906){return _0x19c906?{'count':_0x530d4c,'rows':_0x19c906}:null;}})[_0xf3cb('0x1e')](respondWithResult(_0x51a9e3,null))[_0xf3cb('0x28')](handleError(_0x51a9e3,null));}; \ No newline at end of file +var _0x67ca=['pass','cpassword','authentication','host','port','cservice','role','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','fullname','Tag','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','root','basename','service','secure','auth','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','stack','name','send','MailServerIn','MailServerOut','Smtp','Pause','MailAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','field','filter','options','count','includeAll','findAll','rows','catch','show','params','Imap','include','find','body','mandatoryDispositionPause','describe','addDisposition','create','findOne','order','MailAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cauthentication','user','cuser','password'];(function(_0x4a4c9f,_0x5cce76){var _0x5af457=function(_0x24a8af){while(--_0x24a8af){_0x4a4c9f['push'](_0x4a4c9f['shift']());}};_0x5af457(++_0x5cce76);}(_0x67ca,0x109));var _0xa67c=function(_0x9b7a4d,_0x3685cb){_0x9b7a4d=_0x9b7a4d-0x0;var _0x234c50=_0x67ca[_0x9b7a4d];return _0x234c50;};'use strict';var pdf=require(_0xa67c('0x0'));var emlformat=require(_0xa67c('0x1'));var rimraf=require(_0xa67c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa67c('0x3'));var rp=require(_0xa67c('0x4'));var moment=require(_0xa67c('0x5'));var BPromise=require(_0xa67c('0x6'));var Mustache=require('mustache');var util=require(_0xa67c('0x7'));var path=require(_0xa67c('0x8'));var sox=require(_0xa67c('0x9'));var csv=require(_0xa67c('0xa'));var ejs=require(_0xa67c('0xb'));var fs=require('fs');var _=require(_0xa67c('0xc'));var squel=require('squel');var crypto=require(_0xa67c('0xd'));var jsforce=require(_0xa67c('0xe'));var deskjs=require(_0xa67c('0xf'));var toCsv=require(_0xa67c('0xa'));var querystring=require('querystring');var Papa=require(_0xa67c('0x10'));var Redis=require(_0xa67c('0x11'));var authService=require(_0xa67c('0x12'));var qs=require(_0xa67c('0x13'));var hardwareService=require(_0xa67c('0x14'));var logger=require(_0xa67c('0x15'))(_0xa67c('0x16'));var utils=require(_0xa67c('0x17'));var config=require('../../config/environment');var db=require(_0xa67c('0x18'))['db'];config[_0xa67c('0x19')]=_[_0xa67c('0x1a')](config[_0xa67c('0x19')],{'host':_0xa67c('0x1b'),'port':0x18eb});var socket=require(_0xa67c('0x1c'))(new Redis(config['redis']));require(_0xa67c('0x1d'))[_0xa67c('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa67c('0x1f')][_0xa67c('0x20')]({'port':0x232b});function checkPasswordPattern(_0x53e5bc,_0x11ad53,_0x33a577){if(_0x33a577){var _0x1d9bbf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d9bbf[_0xa67c('0x21')](_0x11ad53)){return _0x53e5bc;}else{throw new Error(_0xa67c('0x22'));}}else{return _0x53e5bc;}}function respondWithRpcPromise(_0x18640b,_0xa102d2,_0x5dba10,_0x2ff84a){return new BPromise(function(_0x23692e,_0x551ba5){var _0x36534d=_0x2ff84a||client;return _0x36534d[_0xa67c('0x23')](_0x18640b,_0x5dba10)[_0xa67c('0x24')](function(_0x3222af){logger[_0xa67c('0x25')]('MailAccount,\x20%s,\x20%s',_0xa102d2,_0xa67c('0x26'));logger[_0xa67c('0x27')](_0xa67c('0x28'),_0xa102d2,_0xa67c('0x26'),JSON['stringify'](_0x3222af));if(_0x3222af[_0xa67c('0x29')]){if(_0x3222af[_0xa67c('0x29')]['code']===0x1f4){logger[_0xa67c('0x29')](_0xa67c('0x2a'),_0xa102d2,_0x3222af[_0xa67c('0x29')][_0xa67c('0x2b')]);return _0x551ba5(_0x3222af[_0xa67c('0x29')][_0xa67c('0x2b')]);}logger[_0xa67c('0x29')]('MailAccount,\x20%s,\x20%s',_0xa102d2,_0x3222af[_0xa67c('0x29')][_0xa67c('0x2b')]);return _0x23692e(_0x3222af[_0xa67c('0x29')][_0xa67c('0x2b')]);}else{logger[_0xa67c('0x25')](_0xa67c('0x2a'),_0xa102d2,_0xa67c('0x26'));_0x23692e(_0x3222af[_0xa67c('0x2c')][_0xa67c('0x2b')]);}})['catch'](function(_0x29fb13){logger[_0xa67c('0x29')](_0xa67c('0x2a'),_0xa102d2,_0x29fb13);_0x551ba5(_0x29fb13);});});}function respondWithStatusCode(_0x238ba0,_0x2f5b1b){_0x2f5b1b=_0x2f5b1b||0xcc;return function(_0x266848){if(_0x266848){return _0x238ba0[_0xa67c('0x2d')](_0x2f5b1b);}return _0x238ba0['status'](_0x2f5b1b)[_0xa67c('0x2e')]();};}function respondWithResult(_0x400a93,_0xeb96be){_0xeb96be=_0xeb96be||0xc8;return function(_0x44554b){if(_0x44554b){return _0x400a93['status'](_0xeb96be)[_0xa67c('0x2f')](_0x44554b);}};}function respondWithFilteredResult(_0x26e400,_0x52d321){return function(_0x567aba){if(_0x567aba){var _0x3fd022=_0x567aba['count'],_0x3d097c=_0x52d321[_0xa67c('0x30')],_0x2c2ed8=_0x52d321[_0xa67c('0x30')]+_0x52d321[_0xa67c('0x31')],_0x45c15e;if(_0x2c2ed8>=_0x3fd022){_0x2c2ed8=_0x3fd022;_0x45c15e=0xc8;}else{_0x45c15e=0xce;}_0x26e400[_0xa67c('0x32')](_0x45c15e);return _0x26e400[_0xa67c('0x33')](_0xa67c('0x34'),_0x3d097c+'-'+_0x2c2ed8+'/'+_0x3fd022)[_0xa67c('0x2f')](_0x567aba);}return null;};}function patchUpdates(_0x1bc80e){return function(_0x191e3c){try{jsonpatch[_0xa67c('0x35')](_0x191e3c,_0x1bc80e,!![]);}catch(_0x186508){return BPromise[_0xa67c('0x36')](_0x186508);}return _0x191e3c[_0xa67c('0x37')]();};}function saveUpdates(_0x36c05c,_0xee073f){return function(_0x1ff4ef){if(_0x1ff4ef){return _0x1ff4ef[_0xa67c('0x38')](_0x36c05c)['then'](function(_0x34d74f){return _0x34d74f;});}return null;};}function removeEntity(_0x45c282,_0x7a9bc9){return function(_0x3b9705){if(_0x3b9705){return _0x3b9705[_0xa67c('0x39')]()[_0xa67c('0x24')](function(){var _0x38fab0=_0x3b9705[_0xa67c('0x3a')]({'plain':!![]});var _0x2aaacc=_0xa67c('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x2aaacc,'resourceId':_0x38fab0['id']}})[_0xa67c('0x24')](function(){return _0x3b9705;});})[_0xa67c('0x24')](function(){_0x45c282[_0xa67c('0x32')](0xcc)[_0xa67c('0x2e')]();});}};}function handleEntityNotFound(_0x597daa,_0x1fb732){return function(_0xea1e80){if(!_0xea1e80){_0x597daa[_0xa67c('0x2d')](0x194);}return _0xea1e80;};}function handleError(_0x4e7b2f,_0x2633d8){_0x2633d8=_0x2633d8||0x1f4;return function(_0x50be45){logger[_0xa67c('0x29')](_0x50be45[_0xa67c('0x3c')]);if(_0x50be45[_0xa67c('0x3d')]){delete _0x50be45[_0xa67c('0x3d')];}_0x4e7b2f[_0xa67c('0x32')](_0x2633d8)[_0xa67c('0x3e')](_0x50be45);};}exports['index']=function(_0x223e5f,_0x4a4a0a){var _0x3c2a62={'include':[{'model':db[_0xa67c('0x3f')],'as':'Imap'},{'model':db[_0xa67c('0x40')],'as':_0xa67c('0x41')},{'model':db[_0xa67c('0x42')],'as':'mandatoryDispositionPause'}]},_0x5b733e={},_0x267e27={'count':0x0,'rows':[]};var _0x191df8=db[_0xa67c('0x43')][_0xa67c('0x44')];_0x5b733e[_0xa67c('0x45')]=_[_0xa67c('0x46')](_0x191df8);_0x5b733e['query']=_[_0xa67c('0x46')](_0x223e5f[_0xa67c('0x47')]);_0x5b733e[_0xa67c('0x48')]=_['intersection'](_0x5b733e[_0xa67c('0x45')],_0x5b733e[_0xa67c('0x47')]);_0x3c2a62[_0xa67c('0x49')]=_[_0xa67c('0x4a')](_0x5b733e[_0xa67c('0x45')],qs['fields'](_0x223e5f[_0xa67c('0x47')][_0xa67c('0x4b')]));_0x3c2a62['attributes']=_0x3c2a62[_0xa67c('0x49')][_0xa67c('0x4c')]?_0x3c2a62[_0xa67c('0x49')]:_0x5b733e[_0xa67c('0x45')];if(!_0x223e5f['query'][_0xa67c('0x4d')](_0xa67c('0x4e'))){_0x3c2a62['limit']=qs['limit'](_0x223e5f['query'][_0xa67c('0x31')]);_0x3c2a62[_0xa67c('0x30')]=qs['offset'](_0x223e5f[_0xa67c('0x47')][_0xa67c('0x30')]);}_0x3c2a62['order']=qs[_0xa67c('0x4f')](_0x223e5f[_0xa67c('0x47')][_0xa67c('0x4f')]);_0x3c2a62[_0xa67c('0x50')]=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x223e5f[_0xa67c('0x47')],_0x5b733e['filters']));if(_0x223e5f[_0xa67c('0x47')]['filter']){_0x3c2a62[_0xa67c('0x50')]=_[_0xa67c('0x52')](_0x3c2a62[_0xa67c('0x50')],{'$or':_[_0xa67c('0x53')](_0x191df8,function(_0x3198a6){if(_0x3198a6[_0xa67c('0x54')][_0xa67c('0x55')]!=='VIRTUAL'){var _0x42c63a={};_0x42c63a[_0x3198a6[_0xa67c('0x56')]]={'$like':'%'+_0x223e5f[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x42c63a;}})});}_0x3c2a62=_['merge']({},_0x3c2a62,_0x223e5f[_0xa67c('0x58')]);var _0x10412e={'where':_0x3c2a62[_0xa67c('0x50')]};return db[_0xa67c('0x43')][_0xa67c('0x59')](_0x10412e)[_0xa67c('0x24')](function(_0x4b2e0f){_0x267e27[_0xa67c('0x59')]=_0x4b2e0f;if(_0x223e5f['query'][_0xa67c('0x5a')]){_0x3c2a62['include']=[{'all':!![]}];}return db['MailAccount'][_0xa67c('0x5b')](_0x3c2a62);})[_0xa67c('0x24')](function(_0x59ad41){_0x267e27[_0xa67c('0x5c')]=_0x59ad41;return _0x267e27;})[_0xa67c('0x24')](respondWithFilteredResult(_0x4a4a0a,_0x3c2a62))[_0xa67c('0x5d')](handleError(_0x4a4a0a,null));};exports[_0xa67c('0x5e')]=function(_0x47d8dc,_0x5391ba){var _0x2de376={'raw':![],'where':{'id':_0x47d8dc[_0xa67c('0x5f')]['id']},'include':[{'model':db[_0xa67c('0x3f')],'as':_0xa67c('0x60')},{'model':db[_0xa67c('0x40')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x598c78={};_0x598c78[_0xa67c('0x45')]=_[_0xa67c('0x46')](db[_0xa67c('0x43')][_0xa67c('0x44')]);_0x598c78[_0xa67c('0x47')]=_[_0xa67c('0x46')](_0x47d8dc['query']);_0x598c78[_0xa67c('0x48')]=_[_0xa67c('0x4a')](_0x598c78[_0xa67c('0x45')],_0x598c78['query']);_0x2de376[_0xa67c('0x49')]=_[_0xa67c('0x4a')](_0x598c78[_0xa67c('0x45')],qs['fields'](_0x47d8dc['query'][_0xa67c('0x4b')]));_0x2de376['attributes']=_0x2de376[_0xa67c('0x49')]['length']?_0x2de376[_0xa67c('0x49')]:_0x598c78[_0xa67c('0x45')];if(_0x47d8dc[_0xa67c('0x47')][_0xa67c('0x5a')]){_0x2de376[_0xa67c('0x61')]=[{'all':!![]}];}_0x2de376=_[_0xa67c('0x52')]({},_0x2de376,_0x47d8dc['options']);return db['MailAccount'][_0xa67c('0x62')](_0x2de376)[_0xa67c('0x24')](handleEntityNotFound(_0x5391ba,null))[_0xa67c('0x24')](respondWithResult(_0x5391ba,null))['catch'](handleError(_0x5391ba,null));};exports['update']=function(_0x42ff8b,_0x2cc010){if(_0x42ff8b['body']['id']){delete _0x42ff8b[_0xa67c('0x63')]['id'];}return db[_0xa67c('0x43')]['find']({'where':{'id':_0x42ff8b['params']['id']},'include':[{'model':db[_0xa67c('0x3f')],'as':_0xa67c('0x60')},{'model':db[_0xa67c('0x40')],'as':_0xa67c('0x41')},{'model':db[_0xa67c('0x42')],'as':_0xa67c('0x64')}]})[_0xa67c('0x24')](handleEntityNotFound(_0x2cc010,null))['then'](saveUpdates(_0x42ff8b['body'],null))[_0xa67c('0x24')](function(_0x3e7d01){if(_0x3e7d01&&_0x42ff8b[_0xa67c('0x63')][_0xa67c('0x60')]){return db['MailServerIn'][_0xa67c('0x38')](_0x42ff8b[_0xa67c('0x63')]['Imap'],{'where':{'MailAccountId':_0x3e7d01['id']}})[_0xa67c('0x24')](function(){return _0x3e7d01;});}return _0x3e7d01;})['then'](function(_0x1d4d05){if(_0x1d4d05&&_0x42ff8b['body']['Smtp']){return db[_0xa67c('0x40')][_0xa67c('0x38')](_0x42ff8b['body'][_0xa67c('0x41')],{'where':{'MailAccountId':_0x1d4d05['id']}})[_0xa67c('0x24')](function(){return _0x1d4d05;});}return _0x1d4d05;})['then'](respondWithResult(_0x2cc010,null))[_0xa67c('0x5d')](handleError(_0x2cc010,null));};exports[_0xa67c('0x65')]=function(_0x3fd6a3,_0x242182){return db[_0xa67c('0x43')][_0xa67c('0x65')]()[_0xa67c('0x24')](respondWithResult(_0x242182,null))[_0xa67c('0x5d')](handleError(_0x242182,null));};exports[_0xa67c('0x66')]=function(_0x29c8b2,_0x1fbcff,_0x22f852){if(_0x29c8b2[_0xa67c('0x63')]['id']){delete _0x29c8b2['body']['id'];}return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x29c8b2['params']['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x1fbcff,null))[_0xa67c('0x24')](function(_0x4145a6){if(_0x4145a6){_0x29c8b2['body']['MailAccountId']=_0x4145a6['id'];return db['Disposition'][_0xa67c('0x67')](_0x29c8b2[_0xa67c('0x63')]);}})[_0xa67c('0x24')](respondWithResult(_0x1fbcff,null))[_0xa67c('0x5d')](handleError(_0x1fbcff,null));};exports['getDispositions']=function(_0x3a61e1,_0x2174f5,_0x5741e3){var _0x498af4={'raw':![],'where':{}};var _0x46faa8={};var _0x38414b={'count':0x0,'rows':[]};return db['MailAccount'][_0xa67c('0x68')]({'where':{'id':_0x3a61e1[_0xa67c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2174f5,null))['then'](function(_0x299fb3){if(_0x299fb3){_0x46faa8[_0xa67c('0x45')]=_[_0xa67c('0x46')](db['Disposition']['rawAttributes']);_0x46faa8['query']=_[_0xa67c('0x46')](_0x3a61e1[_0xa67c('0x47')]);_0x46faa8[_0xa67c('0x48')]=_[_0xa67c('0x4a')](_0x46faa8[_0xa67c('0x45')],_0x46faa8[_0xa67c('0x47')]);_0x498af4[_0xa67c('0x49')]=_[_0xa67c('0x4a')](_0x46faa8['model'],qs[_0xa67c('0x4b')](_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x4b')]));_0x498af4['attributes']=_0x498af4[_0xa67c('0x49')][_0xa67c('0x4c')]?_0x498af4[_0xa67c('0x49')]:_0x46faa8[_0xa67c('0x45')];if(!_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x4d')](_0xa67c('0x4e'))){_0x498af4[_0xa67c('0x31')]=qs[_0xa67c('0x31')](_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x31')]);_0x498af4[_0xa67c('0x30')]=qs[_0xa67c('0x30')](_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x30')]);}_0x498af4[_0xa67c('0x69')]=qs[_0xa67c('0x4f')](_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x4f')]);_0x498af4['where']=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x3a61e1['query'],_0x46faa8[_0xa67c('0x48')]));_0x498af4[_0xa67c('0x50')][_0xa67c('0x6a')]=_0x299fb3['id'];if(_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x57')]){_0x498af4['where']=_[_0xa67c('0x52')](_0x498af4['where'],{'$or':_[_0xa67c('0x53')](_0x498af4[_0xa67c('0x49')],function(_0x3527f7){var _0x5b4dd8={};_0x5b4dd8[_0x3527f7]={'$like':'%'+_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x5b4dd8;})});}_0x498af4=_[_0xa67c('0x52')]({},_0x498af4,_0x3a61e1[_0xa67c('0x58')]);return db[_0xa67c('0x6b')][_0xa67c('0x59')]({'where':_0x498af4[_0xa67c('0x50')]})[_0xa67c('0x24')](function(_0x310f57){_0x38414b[_0xa67c('0x59')]=_0x310f57;if(_0x3a61e1[_0xa67c('0x47')][_0xa67c('0x5a')]){_0x498af4[_0xa67c('0x61')]=[{'all':!![]}];}return db[_0xa67c('0x6b')]['findAll'](_0x498af4);})[_0xa67c('0x24')](function(_0x3f95db){_0x38414b['rows']=_0x3f95db;return _0x38414b;});}})[_0xa67c('0x24')](respondWithFilteredResult(_0x2174f5,_0x498af4))[_0xa67c('0x5d')](handleError(_0x2174f5,null));};exports['removeDispositions']=function(_0x338a7d,_0x3c431f,_0x5b494b){return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x338a7d[_0xa67c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3c431f,null))[_0xa67c('0x24')](function(_0xcaffc3){if(_0xcaffc3){return _0xcaffc3[_0xa67c('0x6c')](_0x338a7d[_0xa67c('0x47')][_0xa67c('0x6d')]);}})['then'](respondWithStatusCode(_0x3c431f,null))[_0xa67c('0x5d')](handleError(_0x3c431f,null));};exports[_0xa67c('0x6e')]=function(_0x3eee57,_0x313870,_0x2d7e7c){if(_0x3eee57['body']['id']){delete _0x3eee57[_0xa67c('0x63')]['id'];}return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x3eee57['params']['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x313870,null))[_0xa67c('0x24')](function(_0xf27c5e){if(_0xf27c5e){_0x3eee57[_0xa67c('0x63')]['MailAccountId']=_0xf27c5e['id'];return db[_0xa67c('0x6f')]['create'](_0x3eee57[_0xa67c('0x63')]);}})['then'](respondWithResult(_0x313870,null))[_0xa67c('0x5d')](handleError(_0x313870,null));};exports[_0xa67c('0x70')]=function(_0x16b203,_0x46f819,_0x21086d){var _0xab2022={'raw':![],'where':{}};var _0x47bfc5={};var _0x346b35={'count':0x0,'rows':[]};return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0x16b203[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x46f819,null))[_0xa67c('0x24')](function(_0x4fa035){if(_0x4fa035){_0x47bfc5[_0xa67c('0x45')]=_['keys'](db[_0xa67c('0x6f')]['rawAttributes']);_0x47bfc5[_0xa67c('0x47')]=_[_0xa67c('0x46')](_0x16b203[_0xa67c('0x47')]);_0x47bfc5[_0xa67c('0x48')]=_[_0xa67c('0x4a')](_0x47bfc5['model'],_0x47bfc5['query']);_0xab2022[_0xa67c('0x49')]=_[_0xa67c('0x4a')](_0x47bfc5[_0xa67c('0x45')],qs['fields'](_0x16b203['query'][_0xa67c('0x4b')]));_0xab2022[_0xa67c('0x49')]=_0xab2022[_0xa67c('0x49')][_0xa67c('0x4c')]?_0xab2022[_0xa67c('0x49')]:_0x47bfc5[_0xa67c('0x45')];if(!_0x16b203[_0xa67c('0x47')]['hasOwnProperty'](_0xa67c('0x4e'))){_0xab2022[_0xa67c('0x31')]=qs[_0xa67c('0x31')](_0x16b203[_0xa67c('0x47')]['limit']);_0xab2022['offset']=qs['offset'](_0x16b203[_0xa67c('0x47')]['offset']);}_0xab2022[_0xa67c('0x69')]=qs[_0xa67c('0x4f')](_0x16b203['query'][_0xa67c('0x4f')]);_0xab2022[_0xa67c('0x50')]=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x16b203['query'],_0x47bfc5[_0xa67c('0x48')]));_0xab2022[_0xa67c('0x50')][_0xa67c('0x6a')]=_0x4fa035['id'];if(_0x16b203[_0xa67c('0x47')][_0xa67c('0x57')]){_0xab2022[_0xa67c('0x50')]=_[_0xa67c('0x52')](_0xab2022[_0xa67c('0x50')],{'$or':_[_0xa67c('0x53')](_0xab2022['attributes'],function(_0x54a7ad){var _0x206422={};_0x206422[_0x54a7ad]={'$like':'%'+_0x16b203['query'][_0xa67c('0x57')]+'%'};return _0x206422;})});}_0xab2022=_[_0xa67c('0x52')]({},_0xab2022,_0x16b203['options']);return db[_0xa67c('0x6f')]['count']({'where':_0xab2022[_0xa67c('0x50')]})[_0xa67c('0x24')](function(_0x1c77a3){_0x346b35['count']=_0x1c77a3;if(_0x16b203['query'][_0xa67c('0x5a')]){_0xab2022[_0xa67c('0x61')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xab2022);})[_0xa67c('0x24')](function(_0x4be621){_0x346b35[_0xa67c('0x5c')]=_0x4be621;return _0x346b35;});}})[_0xa67c('0x24')](respondWithFilteredResult(_0x46f819,_0xab2022))[_0xa67c('0x5d')](handleError(_0x46f819,null));};exports['removeAnswers']=function(_0xbbbaab,_0x54065a,_0x3291fc){return db[_0xa67c('0x43')]['find']({'where':{'id':_0xbbbaab[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x54065a,null))[_0xa67c('0x24')](function(_0x627d05){if(_0x627d05){return _0x627d05[_0xa67c('0x71')](_0xbbbaab['query'][_0xa67c('0x6d')]);}})[_0xa67c('0x24')](respondWithStatusCode(_0x54065a,null))[_0xa67c('0x5d')](handleError(_0x54065a,null));};exports[_0xa67c('0x67')]=function(_0x56522e,_0x1c9ee6){var _0x50be3d={'name':_0x56522e[_0xa67c('0x63')][_0xa67c('0x3d')],'key':_0x56522e[_0xa67c('0x63')][_0xa67c('0x55')],'email':_0x56522e['body'][_0xa67c('0x72')],'ListId':_0x56522e[_0xa67c('0x63')][_0xa67c('0x73')],'active':!_['isNil'](_0x56522e['body'][_0xa67c('0x74')])?_0x56522e[_0xa67c('0x63')][_0xa67c('0x74')]:!![],'description':_0x56522e['body'][_0xa67c('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0xa67c('0x76')](_0x56522e[_0xa67c('0x63')]['cservice'])){if(_0x56522e[_0xa67c('0x63')][_0xa67c('0x77')]){_0x50be3d['Imap'][_0xa67c('0x78')]=_0x50be3d[_0xa67c('0x41')][_0xa67c('0x78')]=_0x56522e['body'][_0xa67c('0x79')];_0x50be3d['Imap'][_0xa67c('0x7a')]=_0x50be3d['Smtp'][_0xa67c('0x7b')]=_0x56522e[_0xa67c('0x63')][_0xa67c('0x7c')];}else{_0x50be3d[_0xa67c('0x60')][_0xa67c('0x7d')]=_0x50be3d[_0xa67c('0x41')][_0xa67c('0x7d')]=![];}_0x50be3d[_0xa67c('0x60')][_0xa67c('0x7e')]=_0x56522e['body'][_0xa67c('0x60')][_0xa67c('0x7e')];_0x50be3d[_0xa67c('0x60')][_0xa67c('0x7f')]=_0x56522e[_0xa67c('0x63')][_0xa67c('0x60')]['port'];_0x50be3d[_0xa67c('0x41')][_0xa67c('0x7e')]=_0x56522e['body'][_0xa67c('0x41')][_0xa67c('0x7e')];_0x50be3d[_0xa67c('0x41')][_0xa67c('0x7f')]=_0x56522e[_0xa67c('0x63')][_0xa67c('0x41')]['port'];}else{_0x50be3d[_0xa67c('0x60')]['service']=_0x50be3d[_0xa67c('0x41')]['service']=_0x56522e['body'][_0xa67c('0x80')];_0x50be3d['Imap'][_0xa67c('0x78')]=_0x50be3d[_0xa67c('0x41')][_0xa67c('0x78')]=_0x56522e[_0xa67c('0x63')][_0xa67c('0x79')];_0x50be3d[_0xa67c('0x60')][_0xa67c('0x7a')]=_0x50be3d[_0xa67c('0x41')][_0xa67c('0x7b')]=_0x56522e[_0xa67c('0x63')][_0xa67c('0x7c')];}return db['MailAccount'][_0xa67c('0x67')](_0x50be3d,{'include':[{'model':db['MailServerOut'],'as':_0xa67c('0x41')},{'model':db[_0xa67c('0x3f')],'as':'Imap'}]})[_0xa67c('0x24')](function(_0x1395fb){var _0x94bac8=_0x56522e['user'][_0xa67c('0x3a')]({'plain':!![]});if(!_0x94bac8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x94bac8[_0xa67c('0x81')]===_0xa67c('0x78')){var _0x33d272=_0x1395fb[_0xa67c('0x3a')]({'plain':!![]});return db[_0xa67c('0x82')][_0xa67c('0x62')]({'where':{'name':_0xa67c('0x3b'),'userProfileId':_0x94bac8[_0xa67c('0x83')]},'raw':!![]})['then'](function(_0x385077){if(_0x385077&&_0x385077[_0xa67c('0x84')]===0x0){return db['UserProfileResource'][_0xa67c('0x67')]({'name':_0x33d272[_0xa67c('0x3d')],'resourceId':_0x33d272['id'],'type':_0x385077['name'],'sectionId':_0x385077['id']},{})[_0xa67c('0x24')](function(){return _0x1395fb;});}else{return _0x1395fb;}})[_0xa67c('0x5d')](function(_0x1088da){logger[_0xa67c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1088da);throw _0x1088da;});}return _0x1395fb;})[_0xa67c('0x24')](respondWithResult(_0x1c9ee6,0xc9))[_0xa67c('0x5d')](handleError(_0x1c9ee6,null));};exports[_0xa67c('0x85')]=function(_0xf033cb,_0x34749b,_0x4f84e0){return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0xf033cb['params']['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x34749b,null))[_0xa67c('0x24')](function(_0x4e15c7){if(_0x4e15c7){return _0x4e15c7[_0xa67c('0x85')]();}return null;})[_0xa67c('0x24')](respondWithResult(_0x34749b,null))[_0xa67c('0x5d')](handleError(_0x34749b,null));};exports['addImap']=function(_0x887b02,_0x25b5ab,_0x7bb2a7){if(_0x887b02['body']['id']){delete _0x887b02[_0xa67c('0x63')]['id'];}return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x887b02[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x25b5ab,null))[_0xa67c('0x24')](function(_0x31fd22){if(_0x31fd22){_0x887b02['body']['MailAccountId']=_0x31fd22['id'];return db['MailServerIn'][_0xa67c('0x67')](_0x887b02['body']);}})[_0xa67c('0x24')](respondWithResult(_0x25b5ab,null))[_0xa67c('0x5d')](handleError(_0x25b5ab,null));};exports[_0xa67c('0x86')]=function(_0xf0c425,_0x2f6c5c,_0x4f3361){return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0xf0c425[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x2f6c5c,null))[_0xa67c('0x24')](function(_0x3232b6){if(_0x3232b6){return _0x3232b6[_0xa67c('0x87')](null);}return null;})[_0xa67c('0x24')](respondWithStatusCode(_0x2f6c5c,null))[_0xa67c('0x5d')](handleError(_0x2f6c5c,null));};exports[_0xa67c('0x88')]=function(_0x539a2d,_0x4ab388,_0x45ed07){return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0x539a2d['params']['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x4ab388,null))[_0xa67c('0x24')](function(_0x5a3fac){if(_0x5a3fac){return _0x5a3fac[_0xa67c('0x88')]();}return null;})[_0xa67c('0x24')](respondWithResult(_0x4ab388,null))[_0xa67c('0x5d')](handleError(_0x4ab388,null));};exports[_0xa67c('0x89')]=function(_0x4d0033,_0x4434d5,_0x5792fc){if(_0x4d0033['body']['id']){delete _0x4d0033[_0xa67c('0x63')]['id'];}return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x4d0033[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x4434d5,null))[_0xa67c('0x24')](function(_0x4cf4cc){if(_0x4cf4cc){_0x4d0033['body'][_0xa67c('0x6a')]=_0x4cf4cc['id'];return db['MailServerOut'][_0xa67c('0x67')](_0x4d0033[_0xa67c('0x63')]);}})['then'](respondWithResult(_0x4434d5,null))[_0xa67c('0x5d')](handleError(_0x4434d5,null));};exports['removeSmtp']=function(_0x31c367,_0x46703a,_0x5e596b){return db['MailAccount'][_0xa67c('0x68')]({'where':{'id':_0x31c367[_0xa67c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x46703a,null))[_0xa67c('0x24')](function(_0x600c0d){if(_0x600c0d){return _0x600c0d[_0xa67c('0x8a')](null);}return null;})[_0xa67c('0x24')](respondWithStatusCode(_0x46703a,null))['catch'](handleError(_0x46703a,null));};exports['addInteraction']=function(_0x3933e0,_0x34b997,_0x3108cd){return db[_0xa67c('0x8b')][_0xa67c('0x62')]({'where':{'id':_0x3933e0[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x34b997,null))[_0xa67c('0x24')](function(_0x346a8a){if(_0x346a8a){return _0x346a8a[_0xa67c('0x8c')](_0x3933e0['body']['ids'],_[_0xa67c('0x8d')](_0x3933e0[_0xa67c('0x63')],[_0xa67c('0x6d'),'id'])||{});}})[_0xa67c('0x24')](respondWithResult(_0x34b997,null))[_0xa67c('0x5d')](handleError(_0x34b997,null));};exports[_0xa67c('0x8e')]=function(_0x64be75,_0x442df8,_0x23edf3){var _0x55cc21={'raw':![],'where':{}};var _0x36f7c5={};var _0x4fd289={'count':0x0,'rows':[]};return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0x64be75[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x442df8,null))[_0xa67c('0x24')](function(_0x5e1c0d){if(_0x5e1c0d){_0x36f7c5[_0xa67c('0x45')]=_[_0xa67c('0x46')](db[_0xa67c('0x8b')][_0xa67c('0x44')]);_0x36f7c5[_0xa67c('0x47')]=_['keys'](_0x64be75['query']);_0x36f7c5[_0xa67c('0x48')]=_['intersection'](_0x36f7c5[_0xa67c('0x45')],_0x36f7c5[_0xa67c('0x47')]);_0x55cc21['attributes']=_[_0xa67c('0x4a')](_0x36f7c5[_0xa67c('0x45')],qs[_0xa67c('0x4b')](_0x64be75[_0xa67c('0x47')][_0xa67c('0x4b')]));_0x55cc21[_0xa67c('0x49')]=_0x55cc21['attributes']['length']?_0x55cc21['attributes']:_0x36f7c5['model'];if(!_0x64be75[_0xa67c('0x47')]['hasOwnProperty'](_0xa67c('0x4e'))){_0x55cc21[_0xa67c('0x31')]=qs[_0xa67c('0x31')](_0x64be75[_0xa67c('0x47')][_0xa67c('0x31')]);_0x55cc21[_0xa67c('0x30')]=qs['offset'](_0x64be75['query'][_0xa67c('0x30')]);}_0x55cc21[_0xa67c('0x69')]=qs[_0xa67c('0x4f')](_0x64be75[_0xa67c('0x47')][_0xa67c('0x4f')]);_0x55cc21['where']=qs[_0xa67c('0x48')](_['pick'](_0x64be75[_0xa67c('0x47')],_0x36f7c5[_0xa67c('0x48')]));_0x55cc21[_0xa67c('0x50')][_0xa67c('0x6a')]=_0x5e1c0d['id'];if(_0x64be75[_0xa67c('0x47')][_0xa67c('0x57')]){_0x55cc21[_0xa67c('0x50')]=_[_0xa67c('0x52')](_0x55cc21[_0xa67c('0x50')],{'$or':_[_0xa67c('0x53')](_0x55cc21[_0xa67c('0x49')],function(_0x5e7ab1){var _0x179282={};_0x179282[_0x5e7ab1]={'$like':'%'+_0x64be75[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x179282;})});}_0x55cc21=_[_0xa67c('0x52')]({},_0x55cc21,_0x64be75[_0xa67c('0x58')]);return db['MailInteraction'][_0xa67c('0x59')]({'where':_0x55cc21['where']})[_0xa67c('0x24')](function(_0x3669a2){_0x4fd289[_0xa67c('0x59')]=_0x3669a2;if(_0x64be75[_0xa67c('0x47')][_0xa67c('0x5a')]){_0x55cc21[_0xa67c('0x61')]=[{'model':db[_0xa67c('0x8f')],'as':'Contact','required':![]},{'model':db[_0xa67c('0x90')],'as':'Owner','attributes':[_0xa67c('0x3d'),_0xa67c('0x91'),'internal'],'required':![]},{'model':db[_0xa67c('0x92')],'as':'Tags','attributes':['id',_0xa67c('0x3d'),_0xa67c('0x93')],'where':_0x64be75[_0xa67c('0x47')][_0xa67c('0x94')]?{'id':_0x64be75[_0xa67c('0x47')][_0xa67c('0x94')]}:undefined,'required':_0x64be75[_0xa67c('0x47')][_0xa67c('0x94')]?!![]:![]}];}return db['MailInteraction'][_0xa67c('0x5b')](_0x55cc21);})[_0xa67c('0x24')](function(_0x41043a){_0x4fd289[_0xa67c('0x5c')]=_0x41043a;return _0x4fd289;});}})[_0xa67c('0x24')](respondWithFilteredResult(_0x442df8,_0x55cc21))[_0xa67c('0x5d')](handleError(_0x442df8,null));};exports['addApplications']=function(_0xc54cba,_0x3f778d,_0x588c5e){return db['MailAccount']['findOne']({'where':{'id':_0xc54cba[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x3f778d,null))[_0xa67c('0x24')](function(_0x37f597){if(_0x37f597){return db[_0xa67c('0x95')][_0xa67c('0x96')](function(_0x3a7958){return db[_0xa67c('0x97')]['destroy']({'where':{'MailAccountId':_0xc54cba[_0xa67c('0x5f')]['id']},'transaction':_0x3a7958})[_0xa67c('0x24')](function(_0x23fc95){var _0x28e952=_[_0xa67c('0x53')](_0xc54cba['body'],function(_0x591b98){_0x591b98['MailAccountId']=_0xc54cba[_0xa67c('0x5f')]['id'];return _0x591b98;});return db[_0xa67c('0x97')][_0xa67c('0x98')](_0x28e952,{'transaction':_0x3a7958});});})[_0xa67c('0x24')](function(){return db[_0xa67c('0x97')][_0xa67c('0x99')]({'where':{'MailAccountId':_0xc54cba[_0xa67c('0x5f')]['id']},'order':_0xa67c('0x9a')});});}})[_0xa67c('0x24')](respondWithResult(_0x3f778d,null))[_0xa67c('0x5d')](handleError(_0x3f778d,null));};exports['getApplications']=function(_0x48f366,_0x58a4d6,_0x5de0bb){var _0x103267={};var _0xebf867={};var _0x293630;var _0x22e4c9;return db['MailAccount']['findOne']({'where':{'id':_0x48f366[_0xa67c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x58a4d6,null))[_0xa67c('0x24')](function(_0x13c798){if(_0x13c798){_0x293630=_0x13c798;_0xebf867['model']=_[_0xa67c('0x46')](db['MailApplication'][_0xa67c('0x44')]);_0xebf867['query']=_[_0xa67c('0x46')](_0x48f366[_0xa67c('0x47')]);_0xebf867[_0xa67c('0x48')]=_['intersection'](_0xebf867[_0xa67c('0x45')],_0xebf867[_0xa67c('0x47')]);_0x103267[_0xa67c('0x49')]=_['intersection'](_0xebf867[_0xa67c('0x45')],qs[_0xa67c('0x4b')](_0x48f366['query'][_0xa67c('0x4b')]));_0x103267[_0xa67c('0x49')]=_0x103267[_0xa67c('0x49')]['length']?_0x103267[_0xa67c('0x49')]:_0xebf867[_0xa67c('0x45')];_0x103267['order']=qs['sort'](_0x48f366['query'][_0xa67c('0x4f')]);_0x103267['where']=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x48f366[_0xa67c('0x47')],_0xebf867[_0xa67c('0x48')]));if(_0x48f366[_0xa67c('0x47')][_0xa67c('0x57')]){_0x103267['where']=_[_0xa67c('0x52')](_0x103267[_0xa67c('0x50')],{'$or':_[_0xa67c('0x53')](_0x103267[_0xa67c('0x49')],function(_0x2c9fe4){var _0x61eb03={};_0x61eb03[_0x2c9fe4]={'$like':'%'+_0x48f366[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x61eb03;})});}_0x103267=_[_0xa67c('0x52')]({},_0x103267,_0x48f366['options']);return _0x293630[_0xa67c('0x9b')](_0x103267);}})['then'](function(_0x4bdc38){if(_0x4bdc38){_0x22e4c9=_0x4bdc38['length'];if(!_0x48f366[_0xa67c('0x47')][_0xa67c('0x4d')](_0xa67c('0x4e'))){_0x103267['limit']=qs[_0xa67c('0x31')](_0x48f366[_0xa67c('0x47')][_0xa67c('0x31')]);_0x103267['offset']=qs['offset'](_0x48f366[_0xa67c('0x47')][_0xa67c('0x30')]);}return _0x293630['getApplications'](_0x103267);}})[_0xa67c('0x24')](function(_0x390409){if(_0x390409){return _0x390409?{'count':_0x22e4c9,'rows':_0x390409}:null;}})[_0xa67c('0x24')](respondWithResult(_0x58a4d6,null))[_0xa67c('0x5d')](handleError(_0x58a4d6,null));};exports['getMessages']=function(_0x259533,_0x2469af,_0x1cc6d5){var _0x42d9d6={'raw':!![],'where':{}};var _0x2e1fe3={};var _0x4cf4f6={'count':0x0,'rows':[]};return db['MailAccount'][_0xa67c('0x68')]({'where':{'id':_0x259533[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x2469af,null))[_0xa67c('0x24')](function(_0x4ec6f2){if(_0x4ec6f2){_0x2e1fe3['model']=_[_0xa67c('0x46')](db['MailMessage'][_0xa67c('0x44')]);_0x2e1fe3[_0xa67c('0x47')]=_[_0xa67c('0x46')](_0x259533[_0xa67c('0x47')]);_0x2e1fe3[_0xa67c('0x48')]=_[_0xa67c('0x4a')](_0x2e1fe3[_0xa67c('0x45')],_0x2e1fe3['query']);_0x42d9d6[_0xa67c('0x49')]=_[_0xa67c('0x4a')](_0x2e1fe3['model'],qs['fields'](_0x259533['query'][_0xa67c('0x4b')]));_0x42d9d6['attributes']=_0x42d9d6[_0xa67c('0x49')][_0xa67c('0x4c')]?_0x42d9d6[_0xa67c('0x49')]:_0x2e1fe3[_0xa67c('0x45')];if(!_0x259533[_0xa67c('0x47')][_0xa67c('0x4d')](_0xa67c('0x4e'))){_0x42d9d6['limit']=qs['limit'](_0x259533['query'][_0xa67c('0x31')]);_0x42d9d6[_0xa67c('0x30')]=qs[_0xa67c('0x30')](_0x259533[_0xa67c('0x47')][_0xa67c('0x30')]);}_0x42d9d6['order']=qs[_0xa67c('0x4f')](_0x259533['query'][_0xa67c('0x4f')]);_0x42d9d6[_0xa67c('0x50')]=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x259533[_0xa67c('0x47')],_0x2e1fe3[_0xa67c('0x48')]));_0x42d9d6[_0xa67c('0x50')][_0xa67c('0x6a')]=_0x4ec6f2['id'];if(_0x259533[_0xa67c('0x47')][_0xa67c('0x57')]){_0x42d9d6['where']=_['merge'](_0x42d9d6[_0xa67c('0x50')],{'$or':_['map'](_0x42d9d6[_0xa67c('0x49')],function(_0x1ea76a){var _0x2135b3={};_0x2135b3[_0x1ea76a]={'$like':'%'+_0x259533[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x2135b3;})});}if(_0x259533[_0xa67c('0x47')][_0xa67c('0x9c')]){var _0x55a16a=_0x259533[_0xa67c('0x47')]['$gte'][_0xa67c('0x9d')](',');var _0x42ce12={};_0x42ce12[_0x55a16a[0x0]]={'$gte':moment(_0x55a16a[0x1])['format'](_0xa67c('0x9e'))};_0x42d9d6['where']=_[_0xa67c('0x52')](_0x42d9d6[_0xa67c('0x50')],_0x42ce12);}_0x42d9d6=_[_0xa67c('0x52')]({},_0x42d9d6,_0x259533[_0xa67c('0x58')]);return db[_0xa67c('0x9f')][_0xa67c('0x59')]({'where':_0x42d9d6[_0xa67c('0x50')]})[_0xa67c('0x24')](function(_0x54bce5){_0x4cf4f6['count']=_0x54bce5;if(_0x259533['query'][_0xa67c('0x5a')]){_0x42d9d6['include']=[{'all':!![]}];}return db[_0xa67c('0x9f')][_0xa67c('0x5b')](_0x42d9d6);})[_0xa67c('0x24')](function(_0xf2e2ad){_0x4cf4f6[_0xa67c('0x5c')]=_0xf2e2ad;return _0x4cf4f6;});}})['then'](respondWithFilteredResult(_0x2469af,_0x42d9d6))[_0xa67c('0x5d')](handleError(_0x2469af,null));};exports[_0xa67c('0x3e')]=function(_0xc784d2,_0x4b2ad0,_0xd50e51){var _0x4cf938,_0x346d2a={},_0x173f92;if(_0xc784d2['body']['to']){_0x173f92=_0xc784d2[_0xa67c('0x63')]['to']['split'](',')[0x0];}return db[_0xa67c('0x43')]['find']({'where':{'id':_0xc784d2[_0xa67c('0x5f')]['id']},'include':[{'model':db[_0xa67c('0xa0')],'as':_0xa67c('0xa1'),'include':[{'model':db['CmContact'],'as':_0xa67c('0xa2'),'where':{'email':_0x173f92},'limit':0x1,'order':[[_0xa67c('0xa3'),_0xa67c('0xa4')]]}]},{'model':db[_0xa67c('0x40')],'as':_0xa67c('0x41'),'raw':!![]}]})[_0xa67c('0x24')](handleEntityNotFound(_0x4b2ad0,null))[_0xa67c('0x24')](function(_0xf706ca){if(_0xf706ca){_0x4cf938=_0xf706ca;if(_0xf706ca['Smtp']){if(_['isNil'](_0xc784d2['body'][_0xa67c('0xa5')])){_0xc784d2[_0xa67c('0x63')]['from']=util[_0xa67c('0xa6')](_0xa67c('0xa7'),_0xf706ca[_0xa67c('0x3d')],_0xf706ca['email']||_0xf706ca[_0xa67c('0x41')][_0xa67c('0x78')]);}if(_0xc784d2['body'][_0xa67c('0xa8')]&&_0xc784d2[_0xa67c('0x63')][_0xa67c('0xa8')][_0xa67c('0x4c')]){for(var _0x3ce364=0x0;_0x3ce364<_0xc784d2['body']['attachments'][_0xa67c('0x4c')];_0x3ce364+=0x1){_0xc784d2[_0xa67c('0x63')][_0xa67c('0xa8')][_0x3ce364]={'filename':_0xc784d2[_0xa67c('0x63')][_0xa67c('0xa8')][_0x3ce364][_0xa67c('0x3d')],'path':path[_0xa67c('0xa9')](config[_0xa67c('0xaa')],'server/files/attachments',_0xc784d2[_0xa67c('0x63')][_0xa67c('0xa8')][_0x3ce364][_0xa67c('0xab')])};}}var _0x65a43e={'tls':{'rejectUnauthorized':![]}};if(_[_0xa67c('0x76')](_0xf706ca[_0xa67c('0x41')][_0xa67c('0xac')])){if(_0xf706ca['Smtp'][_0xa67c('0x7d')]){_0x65a43e['auth']={'user':_0xf706ca['Smtp'][_0xa67c('0x78')],'pass':_0xf706ca[_0xa67c('0x41')]['pass']};}_0x65a43e[_0xa67c('0x7e')]=_0xf706ca[_0xa67c('0x41')]['host'];_0x65a43e[_0xa67c('0x7f')]=_0xf706ca[_0xa67c('0x41')][_0xa67c('0x7f')];_0x65a43e[_0xa67c('0xad')]=_0xf706ca['Smtp'][_0xa67c('0xad')];}else{_0x65a43e[_0xa67c('0xac')]=_0xf706ca[_0xa67c('0x41')][_0xa67c('0xac')];_0x65a43e[_0xa67c('0xae')]={'user':_0xf706ca[_0xa67c('0x41')][_0xa67c('0x78')],'pass':_0xf706ca[_0xa67c('0x41')][_0xa67c('0x7b')]};}return respondWithRpcPromise('SendMail',_0xa67c('0xaf'),{'account':_0x65a43e,'message':_0xc784d2[_0xa67c('0x63')]});}else{throw new Error(_0xa67c('0xb0'));}}})[_0xa67c('0x24')](function(_0x23a81a){if(_0x23a81a){_0x346d2a=_0x23a81a;if(_0x4cf938[_0xa67c('0xa1')]){if(_0x4cf938[_0xa67c('0xa1')][_0xa67c('0xa2')][_0xa67c('0x4c')]){return _0x4cf938[_0xa67c('0xa1')][_0xa67c('0xa2')][0x0];}else{return db[_0xa67c('0x8f')][_0xa67c('0x67')](_[_0xa67c('0x1a')](_0xc784d2[_0xa67c('0x63')],{'firstName':_0xc784d2[_0xa67c('0x63')]['to'],'email':_0xc784d2[_0xa67c('0x63')]['to'],'phone':_0xc784d2[_0xa67c('0x63')]['to'],'ListId':_0x4cf938['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0xa67c('0x24')](function(_0x28ec1f){if(_0x28ec1f){var _0x7cca39={'UserId':_0xc784d2[_0xa67c('0x78')]['id'],'ContactId':_0x28ec1f['id'],'MailAccountId':_0x4cf938['id'],'inReplyTo':_0x346d2a[_0xa67c('0xb1')],'to':_0xc784d2['body']['from'],'cc':_0xc784d2[_0xa67c('0x63')]['cc'],'subject':_0xc784d2['body'][_0xa67c('0xb2')],'attach':_0xc784d2[_0xa67c('0x63')][_0xa67c('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xa67c('0xa6')](_0xa67c('0x9e')),'lastMsgDirection':_0xa67c('0xb4'),'lastMsgBody':_0xc784d2[_0xa67c('0x63')]['body'],'Messages':[_[_0xa67c('0x52')](_0xc784d2['body'],{'messageId':_0x346d2a['messageId'],'sentAt':moment()['format'](_0xa67c('0x9e')),'read':!![],'MailAccountId':_0x4cf938['id'],'UserId':_0xc784d2[_0xa67c('0x78')]['id'],'ContactId':_0x28ec1f['id']})]};if(_0xc784d2[_0xa67c('0x63')][_0xa67c('0xb5')]){_0x7cca39=_[_0xa67c('0x52')](_0x7cca39,_0xc784d2['body']['Interaction']);}return db[_0xa67c('0x8b')][_0xa67c('0x67')](_0x7cca39,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0xa67c('0x24')](respondWithResult(_0x4b2ad0,null))[_0xa67c('0x5d')](handleError(_0x4b2ad0,null));};exports[_0xa67c('0xb6')]=function(_0x560e83,_0x4fa04f,_0x335c04){return db[_0xa67c('0x43')]['find']({'where':{'id':_0x560e83[_0xa67c('0x5f')]['id']},'include':[{'model':db[_0xa67c('0x40')],'as':_0xa67c('0x41'),'raw':!![]}]})[_0xa67c('0x24')](handleEntityNotFound(_0x4fa04f,null))['then'](function(_0x433640){if(_0x433640&&_0x433640[_0xa67c('0x41')]){var _0x2c535c={'id':_0x433640['id'],'tls':{'rejectUnauthorized':![]}};if(_0x433640[_0xa67c('0x41')][_0xa67c('0xac')]){_0x2c535c[_0xa67c('0xac')]=_0x433640[_0xa67c('0x41')]['service'];}else{_0x2c535c[_0xa67c('0x7e')]=_0x433640[_0xa67c('0x41')][_0xa67c('0x7e')];_0x2c535c[_0xa67c('0x7f')]=_0x433640[_0xa67c('0x41')][_0xa67c('0x7f')];_0x2c535c[_0xa67c('0xad')]=_0x433640[_0xa67c('0x41')]['secure'];}if(_0x433640[_0xa67c('0x41')][_0xa67c('0x7d')]){_0x2c535c['auth']={'user':_0x433640[_0xa67c('0x41')][_0xa67c('0x78')],'pass':_0x433640[_0xa67c('0x41')][_0xa67c('0x7b')]};}return respondWithRpcPromise(_0xa67c('0xb7'),'verifySmtp',{'account':_0x2c535c});}})[_0xa67c('0x24')](respondWithResult(_0x4fa04f,null))[_0xa67c('0x5d')](handleError(_0x4fa04f,null));};exports['destroy']=function(_0x2027e1,_0x13b69b){return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x2027e1[_0xa67c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x13b69b,null))['then'](function(_0x5390e5){if(_0x5390e5&&_0x5390e5[_0xa67c('0xac')]){throw new db[(_0xa67c('0xb8'))][(_0xa67c('0xb9'))](_0xa67c('0xba'));}return _0x5390e5;})['then'](removeEntity(_0x13b69b,null))['catch'](handleError(_0x13b69b,null));};exports[_0xa67c('0xbb')]=function(_0x1ca689,_0x4c8712,_0x35bee0){return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x1ca689[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x4c8712,null))[_0xa67c('0x24')](function(_0x431a97){if(_0x431a97){return _0x431a97[_0xa67c('0xbb')](_0x1ca689[_0xa67c('0x63')][_0xa67c('0x6d')],_[_0xa67c('0x8d')](_0x1ca689['body'],[_0xa67c('0x6d'),'id'])||{})['spread'](function(_0x40badf){for(var _0x490780=0x0;_0x490780<_0x1ca689[_0xa67c('0x63')][_0xa67c('0x6d')]['length'];_0x490780+=0x1){socket[_0xa67c('0xbc')](_0xa67c('0xbd'),{'UserId':_0x1ca689[_0xa67c('0x63')]['ids'][_0x490780],'MailAccountId':_0x1ca689[_0xa67c('0x5f')]['id']});}return _0x40badf;});}})[_0xa67c('0x24')](respondWithResult(_0x4c8712,null))[_0xa67c('0x5d')](handleError(_0x4c8712,null));};exports[_0xa67c('0xbe')]=function(_0x11af67,_0x5c1d79,_0x1faa8c){return db[_0xa67c('0x43')][_0xa67c('0x62')]({'where':{'id':_0x11af67[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0x5c1d79,null))[_0xa67c('0x24')](function(_0x2a08b0){if(_0x2a08b0){return _0x2a08b0[_0xa67c('0xbe')](_0x11af67[_0xa67c('0x47')]['ids'])[_0xa67c('0x24')](function(){if(_[_0xa67c('0xbf')](_0x11af67[_0xa67c('0x47')]['ids'])){for(var _0x23e71d=0x0;_0x23e71d<_0x11af67[_0xa67c('0x47')]['ids'][_0xa67c('0x4c')];_0x23e71d+=0x1){socket[_0xa67c('0xbc')](_0xa67c('0xc0'),{'UserId':Number(_0x11af67['query'][_0xa67c('0x6d')][_0x23e71d]),'MailAccountId':Number(_0x11af67[_0xa67c('0x5f')]['id'])});}}else{socket[_0xa67c('0xbc')]('userMailAccount:remove',{'UserId':Number(_0x11af67['query']['ids']),'MailAccountId':Number(_0x11af67[_0xa67c('0x5f')]['id'])});}});}})[_0xa67c('0x24')](respondWithStatusCode(_0x5c1d79,null))[_0xa67c('0x5d')](handleError(_0x5c1d79,null));};exports['getAgents']=function(_0x19a6e2,_0xef4170,_0x32eaa6){var _0x4096b7={};var _0xa83e2c={};var _0x3d2af2;var _0x1a443d;return db[_0xa67c('0x43')][_0xa67c('0x68')]({'where':{'id':_0x19a6e2[_0xa67c('0x5f')]['id']}})[_0xa67c('0x24')](handleEntityNotFound(_0xef4170,null))['then'](function(_0x4606dc){if(_0x4606dc){_0x3d2af2=_0x4606dc;_0xa83e2c[_0xa67c('0x45')]=_[_0xa67c('0x46')](db[_0xa67c('0x90')]['rawAttributes']);_0xa83e2c[_0xa67c('0x47')]=_[_0xa67c('0x46')](_0x19a6e2['query']);_0xa83e2c[_0xa67c('0x48')]=_[_0xa67c('0x4a')](_0xa83e2c[_0xa67c('0x45')],_0xa83e2c[_0xa67c('0x47')]);_0x4096b7[_0xa67c('0x49')]=_['intersection'](_0xa83e2c[_0xa67c('0x45')],qs[_0xa67c('0x4b')](_0x19a6e2[_0xa67c('0x47')]['fields']));_0x4096b7[_0xa67c('0x49')]=_0x4096b7['attributes'][_0xa67c('0x4c')]?_0x4096b7[_0xa67c('0x49')]:_0xa83e2c['model'];_0x4096b7[_0xa67c('0x69')]=qs[_0xa67c('0x4f')](_0x19a6e2[_0xa67c('0x47')][_0xa67c('0x4f')]);_0x4096b7[_0xa67c('0x50')]=qs[_0xa67c('0x48')](_[_0xa67c('0x51')](_0x19a6e2[_0xa67c('0x47')],_0xa83e2c['filters']));if(_0x19a6e2[_0xa67c('0x47')]['filter']){_0x4096b7[_0xa67c('0x50')]=_[_0xa67c('0x52')](_0x4096b7[_0xa67c('0x50')],{'$or':_[_0xa67c('0x53')](_0x4096b7[_0xa67c('0x49')],function(_0x3b9744){var _0x57c000={};_0x57c000[_0x3b9744]={'$like':'%'+_0x19a6e2[_0xa67c('0x47')][_0xa67c('0x57')]+'%'};return _0x57c000;})});}_0x4096b7=_[_0xa67c('0x52')]({},_0x4096b7,_0x19a6e2[_0xa67c('0x58')]);return _0x3d2af2['getAgents'](_0x4096b7);}})[_0xa67c('0x24')](function(_0x5f40f0){if(_0x5f40f0){_0x1a443d=_0x5f40f0[_0xa67c('0x4c')];if(!_0x19a6e2[_0xa67c('0x47')][_0xa67c('0x4d')]('nolimit')){_0x4096b7[_0xa67c('0x31')]=qs[_0xa67c('0x31')](_0x19a6e2[_0xa67c('0x47')][_0xa67c('0x31')]);_0x4096b7['offset']=qs[_0xa67c('0x30')](_0x19a6e2['query'][_0xa67c('0x30')]);}return _0x3d2af2[_0xa67c('0xc1')](_0x4096b7);}})[_0xa67c('0x24')](function(_0x208339){if(_0x208339){return _0x208339?{'count':_0x1a443d,'rows':_0x208339}:null;}})['then'](respondWithResult(_0xef4170,null))[_0xa67c('0x5d')](handleError(_0xef4170,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index f1fbd91..58c0880 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index f95af96..0b11c46 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 _0xae6e=['util','../../config/logger','api','moment','request-promise','rimraf','MailAccount','mail_accounts','lodash'];(function(_0x1e0d60,_0x503460){var _0x5b9564=function(_0x331935){while(--_0x331935){_0x1e0d60['push'](_0x1e0d60['shift']());}};_0x5b9564(++_0x503460);}(_0xae6e,0x1e5));var _0xeae6=function(_0x1b2d8f,_0xac0e97){_0x1b2d8f=_0x1b2d8f-0x0;var _0x3b498b=_0xae6e[_0x1b2d8f];return _0x3b498b;};'use strict';var _=require(_0xeae6('0x0'));var util=require(_0xeae6('0x1'));var logger=require(_0xeae6('0x2'))(_0xeae6('0x3'));var moment=require(_0xeae6('0x4'));var BPromise=require('bluebird');var rp=require(_0xeae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeae6('0x6'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module['exports']=function(_0x1d06ba,_0x33ea23){return _0x1d06ba['define'](_0xeae6('0x7'),attributes,{'tableName':_0xeae6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aab=['MailAccount','mail_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define'];(function(_0x386436,_0x3245ef){var _0xedada1=function(_0x726721){while(--_0x726721){_0x386436['push'](_0x386436['shift']());}};_0xedada1(++_0x3245ef);}(_0x1aab,0x122));var _0xb1aa=function(_0x428521,_0x331516){_0x428521=_0x428521-0x0;var _0x1215e3=_0x1aab[_0x428521];return _0x1215e3;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var logger=require(_0xb1aa('0x2'))('api');var moment=require(_0xb1aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb1aa('0x4'));var fs=require('fs');var path=require(_0xb1aa('0x5'));var rimraf=require(_0xb1aa('0x6'));var config=require(_0xb1aa('0x7'));var attributes=require(_0xb1aa('0x8'));module['exports']=function(_0x5eb27f,_0x34e0f4){return _0x5eb27f[_0xb1aa('0x9')](_0xb1aa('0xa'),attributes,{'tableName':_0xb1aa('0xb'),'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 cf6fb2f..bac3eec 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 _0x1867=['Messages','Contact\x20not\x20found','spread','update','subject','create','originTo','originCc','bcc','Attachment','Attachments','interaction','UserId','User','unshift','agent','name','Start','startRouting','lodash','util','moment','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','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowMailAccount','find','NotifyMailAccount','mail','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','CmContact','Contacts','DESC','Applications','List','get','omit','applications','orderBy','priority','asc','autoclose','push','length','close','defaults','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage'];(function(_0x8d9381,_0x3fc188){var _0x15ec14=function(_0x3fc6af){while(--_0x3fc6af){_0x8d9381['push'](_0x8d9381['shift']());}};_0x15ec14(++_0x3fc188);}(_0x1867,0x77));var _0x7186=function(_0x4d1b81,_0x31c8a4){_0x4d1b81=_0x4d1b81-0x0;var _0x12a337=_0x1867[_0x4d1b81];return _0x12a337;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var moment=require(_0x7186('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7186('0x3'));var db=require(_0x7186('0x4'))['db'];var utils=require(_0x7186('0x5'));var logger=require(_0x7186('0x6'))(_0x7186('0x7'));var config=require('../../config/environment');var jayson=require(_0x7186('0x8'));var client=jayson[_0x7186('0x9')][_0x7186('0xa')]({'port':0x232c});config[_0x7186('0xb')]=_['defaults'](config['redis'],{'host':_0x7186('0xc'),'port':0x18eb});var socket=require(_0x7186('0xd'))(new Redis(config['redis']));require(_0x7186('0xe'))[_0x7186('0xf')](socket);function respondWithRpcPromise(_0x212722,_0xffc348,_0x220c85){return new BPromise(function(_0x51a94d,_0x599a9e){return client[_0x7186('0x10')](_0x212722,_0x220c85)[_0x7186('0x11')](function(_0x51e015){logger['info'](_0x7186('0x12'),_0xffc348,_0x7186('0x13'));logger[_0x7186('0x14')](_0x7186('0x15'),_0xffc348,_0x7186('0x13'),JSON[_0x7186('0x16')](_0x51e015));if(_0x51e015[_0x7186('0x17')]){if(_0x51e015[_0x7186('0x17')]['code']===0x1f4){logger[_0x7186('0x17')](_0x7186('0x12'),_0xffc348,_0x51e015[_0x7186('0x17')][_0x7186('0x18')]);return _0x599a9e(_0x51e015['error'][_0x7186('0x18')]);}logger[_0x7186('0x17')]('MailAccount,\x20%s,\x20%s',_0xffc348,_0x51e015['error'][_0x7186('0x18')]);return _0x51a94d(_0x51e015[_0x7186('0x17')]['message']);}else{logger[_0x7186('0x19')]('MailAccount,\x20%s,\x20%s',_0xffc348,_0x7186('0x13'));_0x51a94d(_0x51e015[_0x7186('0x1a')][_0x7186('0x18')]);}})['catch'](function(_0x2b5601){logger[_0x7186('0x17')]('MailAccount,\x20%s,\x20%s',_0xffc348,_0x2b5601);_0x599a9e(_0x2b5601);});});}exports[_0x7186('0x1b')]=function(_0x563957){var _0x37a515=this;return new Promise(function(_0x5dd4dd,_0x39485c){return db[_0x7186('0x1c')][_0x7186('0x1d')]({'raw':_0x563957[_0x7186('0x1e')]?_0x563957['options'][_0x7186('0x1f')]===undefined?!![]:![]:!![],'where':_0x563957[_0x7186('0x1e')]?_0x563957[_0x7186('0x1e')][_0x7186('0x20')]||null:null,'attributes':_0x563957[_0x7186('0x1e')]?_0x563957['options'][_0x7186('0x21')]||null:null,'limit':_0x563957[_0x7186('0x1e')]?_0x563957['options'][_0x7186('0x22')]||null:null,'include':_0x563957[_0x7186('0x1e')]?_0x563957[_0x7186('0x1e')][_0x7186('0x23')]?_[_0x7186('0x24')](_0x563957[_0x7186('0x1e')][_0x7186('0x23')],function(_0x1f90c5){return{'model':db[_0x1f90c5[_0x7186('0x25')]],'as':_0x1f90c5['as'],'attributes':_0x1f90c5['attributes'],'include':_0x1f90c5[_0x7186('0x23')]?_[_0x7186('0x24')](_0x1f90c5[_0x7186('0x23')],function(_0x1027ab){return{'model':db[_0x1027ab[_0x7186('0x25')]],'as':_0x1027ab['as'],'attributes':_0x1027ab[_0x7186('0x21')],'include':_0x1027ab['include']?_[_0x7186('0x24')](_0x1027ab[_0x7186('0x23')],function(_0xf73e8f){return{'model':db[_0xf73e8f[_0x7186('0x25')]],'as':_0xf73e8f['as'],'attributes':_0xf73e8f[_0x7186('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7186('0x11')](function(_0x22e90f){logger[_0x7186('0x19')](_0x7186('0x1b'),_0x563957);logger['debug'](_0x7186('0x1b'),_0x563957,JSON[_0x7186('0x16')](_0x22e90f));_0x5dd4dd(_0x22e90f);})[_0x7186('0x26')](function(_0x2b8b2c){logger['error']('GetMailAccount',_0x2b8b2c[_0x7186('0x18')],_0x563957);_0x39485c(_0x37a515[_0x7186('0x17')](0x1f4,_0x2b8b2c[_0x7186('0x18')]));});});};exports[_0x7186('0x27')]=function(_0x319b9e){var _0x548d41=this;return new Promise(function(_0x327ee5,_0xd1f0e6){return db[_0x7186('0x1c')][_0x7186('0x28')]({'raw':_0x319b9e[_0x7186('0x1e')]?_0x319b9e[_0x7186('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x319b9e[_0x7186('0x1e')]?_0x319b9e[_0x7186('0x1e')][_0x7186('0x20')]||null:null,'attributes':_0x319b9e[_0x7186('0x1e')]?_0x319b9e[_0x7186('0x1e')][_0x7186('0x21')]||null:null,'include':_0x319b9e[_0x7186('0x1e')]?_0x319b9e['options'][_0x7186('0x23')]?_[_0x7186('0x24')](_0x319b9e[_0x7186('0x1e')][_0x7186('0x23')],function(_0xe63ff){return{'model':db[_0xe63ff['model']],'as':_0xe63ff['as'],'attributes':_0xe63ff[_0x7186('0x21')],'include':_0xe63ff[_0x7186('0x23')]?_[_0x7186('0x24')](_0xe63ff['include'],function(_0xaa06e){return{'model':db[_0xaa06e[_0x7186('0x25')]],'as':_0xaa06e['as'],'attributes':_0xaa06e['attributes'],'include':_0xaa06e['include']?_[_0x7186('0x24')](_0xaa06e[_0x7186('0x23')],function(_0x2f3355){return{'model':db[_0x2f3355[_0x7186('0x25')]],'as':_0x2f3355['as'],'attributes':_0x2f3355[_0x7186('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16540a){logger[_0x7186('0x19')](_0x7186('0x27'),_0x319b9e);logger[_0x7186('0x14')]('ShowMailAccount',_0x319b9e,JSON[_0x7186('0x16')](_0x16540a));_0x327ee5(_0x16540a);})['catch'](function(_0x23224f){logger['error'](_0x7186('0x27'),_0x23224f[_0x7186('0x18')],_0x319b9e);_0xd1f0e6(_0x548d41[_0x7186('0x17')](0x1f4,_0x23224f[_0x7186('0x18')]));});});};exports[_0x7186('0x29')]=function(_0x7fd2af){var _0x1c848b=this;return new Promise(function(_0x28806b,_0x43a9fe){var _0x2bf42b={'body':_0x7fd2af['body'],'channel':_0x7186('0x2a')};var _0x2d94b1=_['difference'](_[_0x7186('0x2b')](db['CmContact']['rawAttributes']),[_0x7186('0x2c'),_0x7186('0x2d'),_0x7186('0x2e'),_0x7186('0x2f')]);var _0x92cfa5=![];if(_0x7fd2af[_0x7186('0x30')]['id']){delete _0x7fd2af[_0x7186('0x30')]['id'];}if(_[_0x7186('0x31')](_0x7fd2af['body'][_0x7186('0x32')])){return _0x43a9fe(_0x1c848b[_0x7186('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7186('0x31')](_0x7fd2af[_0x7186('0x30')][_0x7186('0x30')])||_0x7fd2af['body'][_0x7186('0x30')]===''){return _0x43a9fe(_0x1c848b[_0x7186('0x17')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x7186('0x31')](_0x7fd2af[_0x7186('0x30')][_0x7186('0x33')])){return _0x43a9fe(_0x1c848b[_0x7186('0x17')](0x1f4,_0x7186('0x34')+_0x2d94b1));}if(!_[_0x7186('0x35')](_0x2d94b1,_0x7fd2af[_0x7186('0x30')]['mapKey'])){return _0x43a9fe(_0x1c848b[_0x7186('0x17')](0x1f4,_0x7186('0x36')+_0x2d94b1));}var _0x3c137e={};_0x3c137e[_0x7fd2af[_0x7186('0x30')][_0x7186('0x33')]]=_0x7fd2af['body'][_0x7186('0x32')];return db[_0x7186('0x1c')][_0x7186('0x28')]({'where':{'id':_0x7fd2af[_0x7186('0x37')]['id']},'include':[{'model':db[_0x7186('0x38')],'as':'List','include':[{'model':db[_0x7186('0x39')],'as':_0x7186('0x3a'),'where':_0x3c137e,'limit':0x1,'order':[['updatedAt',_0x7186('0x3b')]]}]},{'model':db['MailApplication'],'as':_0x7186('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x7186('0x11')](function(_0x3362fe){if(_0x3362fe&&_0x3362fe[_0x7186('0x3d')]){var _0x5e0c38=_0x3362fe[_0x7186('0x3e')]({'plain':!![]});_0x2bf42b[_0x7186('0x37')]=_[_0x7186('0x3f')](_0x5e0c38,[_0x7186('0x3c'),_0x7186('0x3d')]);_0x2bf42b[_0x7186('0x40')]=_0x5e0c38[_0x7186('0x3c')];_0x2bf42b['list']=_0x5e0c38['List'];_0x2bf42b[_0x7186('0x40')]=_[_0x7186('0x41')](_0x2bf42b[_0x7186('0x40')],[_0x7186('0x42')],[_0x7186('0x43')]);if(_0x2bf42b[_0x7186('0x37')]&&_0x2bf42b[_0x7186('0x37')][_0x7186('0x44')]){_0x2bf42b[_0x7186('0x40')][_0x7186('0x45')]({'id':0x0,'priority':_0x2bf42b[_0x7186('0x40')][_0x7186('0x46')]+0x1,'app':_0x7186('0x47'),'appdata':_0x7186('0x44'),'interval':'*,*,*,*'});}if(_0x2bf42b[_0x7186('0x37')][_0x7186('0x3c')]){delete _0x2bf42b[_0x7186('0x37')]['Applications'];}if(_0x2bf42b[_0x7186('0x37')][_0x7186('0x3d')]){delete _0x2bf42b[_0x7186('0x37')][_0x7186('0x3d')];}if(_0x5e0c38[_0x7186('0x3d')][_0x7186('0x3a')][_0x7186('0x46')]){return _0x5e0c38['List'][_0x7186('0x3a')][0x0];}var _0x93e17b=_[_0x7186('0x48')](_0x7fd2af[_0x7186('0x30')],{'firstName':_0x7fd2af[_0x7186('0x30')]['from'],'ListId':_0x5e0c38['ListId']});_0x93e17b[_0x7fd2af['body']['mapKey']]=_0x7fd2af[_0x7186('0x30')][_0x7186('0x32')];return db[_0x7186('0x39')]['create'](_0x93e17b);}else{throw new Error(_0x7186('0x49'));}})[_0x7186('0x11')](function(_0xc307a9){_0x2bf42b['contact']=_0xc307a9;if(_0xc307a9){if(!_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4a')]){_0x7fd2af['body']['message']['messageId']=rs[_0x7186('0x4b')]()+'\x20'+_0x7fd2af[_0x7186('0x30')]['message'][_0x7186('0x32')];}var _0x2099d7={'ContactId':_0xc307a9['id'],'MailAccountId':_0x7fd2af[_0x7186('0x37')]['id'],'inReplyTo':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4a')],'to':_0x7fd2af['body'][_0x7186('0x18')][_0x7186('0x32')],'cc':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['cc'],'subject':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['subject'],'attach':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4c')],'lastMsgAt':moment()[_0x7186('0x4d')](_0x7186('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x7fd2af[_0x7186('0x30')][_0x7186('0x30')]};return db[_0x7186('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0x7fd2af[_0x7186('0x37')]['id']},'include':[{'model':db[_0x7186('0x50')],'as':_0x7186('0x51'),'attributes':[_0x7186('0x4a')],'where':{'messageId':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['inReplyTo']}}]})[_0x7186('0x11')](function(_0x3516da){if(_0x3516da){return[_0x3516da,![]];}return db[_0x7186('0x4f')]['create'](_0x2099d7)['then'](function(_0x2b714f){return[_0x2b714f,!![]];});});}else{throw new Error(_0x7186('0x52'));}})[_0x7186('0x53')](function(_0x5e3b99,_0x52e4ac){if(_0x5e3b99){_0x92cfa5=_0x52e4ac;if(!_0x52e4ac){return _0x5e3b99[_0x7186('0x54')]({'inReplyTo':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4a')],'to':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x32')],'cc':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['cc'],'subject':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x55')],'attach':_0x5e3b99['attach']?_0x5e3b99[_0x7186('0x4c')]:_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4c')],'substatus':null,'substatusAt':moment()[_0x7186('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7186('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x7fd2af['body'][_0x7186('0x30')]});}else{return _0x5e3b99;}}})[_0x7186('0x11')](function(_0x338cad){_0x2bf42b['interaction']=_0x338cad['get']({'plain':!![]});_0x2bf42b['interaction']['created']=_0x92cfa5;return db['MailMessage'][_0x7186('0x56')]({'body':_0x7fd2af[_0x7186('0x30')]['body'],'MailAccountId':_0x7fd2af['account']['id'],'MailInteractionId':_0x338cad['id'],'direction':'in','ContactId':_0x2bf42b['contact']['id'],'messageId':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x4a')],'from':_0x7fd2af[_0x7186('0x30')]['message'][_0x7186('0x32')],'to':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['to'],'cc':_0x7fd2af[_0x7186('0x30')]['message']['cc'],'subject':_0x7fd2af['body'][_0x7186('0x18')][_0x7186('0x55')],'attach':_0x7fd2af['body'][_0x7186('0x18')][_0x7186('0x4c')],'Attachments':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')]['attachments'],'originTo':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x57')],'originCc':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x58')],'bcc':_0x7fd2af[_0x7186('0x30')][_0x7186('0x18')][_0x7186('0x59')]},{'include':[{'model':db[_0x7186('0x5a')],'as':_0x7186('0x5b')}]});})['then'](function(_0x4bf731){_0x2bf42b[_0x7186('0x18')]=_0x4bf731;if(_0x2bf42b[_0x7186('0x5c')][_0x7186('0x5d')]){return db[_0x7186('0x5e')]['find']({'attributes':['id','name'],'where':{'id':_0x2bf42b['interaction'][_0x7186('0x5d')]}})[_0x7186('0x11')](function(_0x2a96aa){if(_0x2a96aa){_0x2bf42b[_0x7186('0x40')][_0x7186('0x5f')]({'id':0x0,'priority':0x0,'app':_0x7186('0x60'),'appdata':_0x2a96aa[_0x7186('0x61')]+','+(_0x2bf42b[_0x7186('0x37')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7186('0x62'),'startRouting',_0x2bf42b);});}return respondWithRpcPromise(_0x7186('0x62'),_0x7186('0x63'),_0x2bf42b);})[_0x7186('0x11')](function(_0xd90037){_0x28806b(_0xd90037);})[_0x7186('0x26')](function(_0x30bed6){_0x43a9fe(_0x1c848b[_0x7186('0x17')](0x1f4,_0x30bed6[_0x7186('0x18')]));});});}; \ No newline at end of file +var _0xb820=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','get','Applications','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','defaults','List\x20not\x20found','contact','messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','format','interaction','created','create','attachments','originTo','bcc','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start'];(function(_0x57f397,_0x2cc884){var _0x59eafc=function(_0x29d23e){while(--_0x29d23e){_0x57f397['push'](_0x57f397['shift']());}};_0x59eafc(++_0x2cc884);}(_0xb820,0x138));var _0x0b82=function(_0x4e030d,_0x598e07){_0x4e030d=_0x4e030d-0x0;var _0x43ca75=_0xb820[_0x4e030d];return _0x43ca75;};'use strict';var _=require(_0x0b82('0x0'));var util=require(_0x0b82('0x1'));var moment=require(_0x0b82('0x2'));var BPromise=require(_0x0b82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b82('0x4'));var db=require(_0x0b82('0x5'))['db'];var utils=require(_0x0b82('0x6'));var logger=require(_0x0b82('0x7'))('rpc');var config=require(_0x0b82('0x8'));var jayson=require(_0x0b82('0x9'));var client=jayson['client'][_0x0b82('0xa')]({'port':0x232c});config['redis']=_['defaults'](config[_0x0b82('0xb')],{'host':_0x0b82('0xc'),'port':0x18eb});var socket=require(_0x0b82('0xd'))(new Redis(config[_0x0b82('0xb')]));require(_0x0b82('0xe'))[_0x0b82('0xf')](socket);function respondWithRpcPromise(_0x3fa479,_0x180b18,_0x4d3f12){return new BPromise(function(_0x24cc6c,_0x203454){return client[_0x0b82('0x10')](_0x3fa479,_0x4d3f12)[_0x0b82('0x11')](function(_0x270224){logger[_0x0b82('0x12')](_0x0b82('0x13'),_0x180b18,_0x0b82('0x14'));logger[_0x0b82('0x15')](_0x0b82('0x16'),_0x180b18,_0x0b82('0x14'),JSON[_0x0b82('0x17')](_0x270224));if(_0x270224[_0x0b82('0x18')]){if(_0x270224['error'][_0x0b82('0x19')]===0x1f4){logger[_0x0b82('0x18')](_0x0b82('0x13'),_0x180b18,_0x270224['error'][_0x0b82('0x1a')]);return _0x203454(_0x270224[_0x0b82('0x18')][_0x0b82('0x1a')]);}logger[_0x0b82('0x18')]('MailAccount,\x20%s,\x20%s',_0x180b18,_0x270224['error'][_0x0b82('0x1a')]);return _0x24cc6c(_0x270224[_0x0b82('0x18')][_0x0b82('0x1a')]);}else{logger[_0x0b82('0x12')](_0x0b82('0x13'),_0x180b18,_0x0b82('0x14'));_0x24cc6c(_0x270224[_0x0b82('0x1b')][_0x0b82('0x1a')]);}})[_0x0b82('0x1c')](function(_0x14c71c){logger[_0x0b82('0x18')]('MailAccount,\x20%s,\x20%s',_0x180b18,_0x14c71c);_0x203454(_0x14c71c);});});}exports[_0x0b82('0x1d')]=function(_0x2c7b10){var _0x300fe6=this;return new Promise(function(_0x266396,_0x54bbcf){return db[_0x0b82('0x1e')][_0x0b82('0x1f')]({'raw':_0x2c7b10[_0x0b82('0x20')]?_0x2c7b10[_0x0b82('0x20')][_0x0b82('0x21')]===undefined?!![]:![]:!![],'where':_0x2c7b10[_0x0b82('0x20')]?_0x2c7b10[_0x0b82('0x20')][_0x0b82('0x22')]||null:null,'attributes':_0x2c7b10[_0x0b82('0x20')]?_0x2c7b10[_0x0b82('0x20')][_0x0b82('0x23')]||null:null,'limit':_0x2c7b10[_0x0b82('0x20')]?_0x2c7b10['options'][_0x0b82('0x24')]||null:null,'include':_0x2c7b10[_0x0b82('0x20')]?_0x2c7b10[_0x0b82('0x20')][_0x0b82('0x25')]?_[_0x0b82('0x26')](_0x2c7b10[_0x0b82('0x20')]['include'],function(_0xfd696f){return{'model':db[_0xfd696f[_0x0b82('0x27')]],'as':_0xfd696f['as'],'attributes':_0xfd696f[_0x0b82('0x23')],'include':_0xfd696f[_0x0b82('0x25')]?_[_0x0b82('0x26')](_0xfd696f['include'],function(_0x3a9661){return{'model':db[_0x3a9661[_0x0b82('0x27')]],'as':_0x3a9661['as'],'attributes':_0x3a9661[_0x0b82('0x23')],'include':_0x3a9661[_0x0b82('0x25')]?_[_0x0b82('0x26')](_0x3a9661[_0x0b82('0x25')],function(_0x238d05){return{'model':db[_0x238d05['model']],'as':_0x238d05['as'],'attributes':_0x238d05[_0x0b82('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0b82('0x11')](function(_0x2db432){logger[_0x0b82('0x12')](_0x0b82('0x1d'),_0x2c7b10);logger[_0x0b82('0x15')]('GetMailAccount',_0x2c7b10,JSON[_0x0b82('0x17')](_0x2db432));_0x266396(_0x2db432);})['catch'](function(_0x4bf49c){logger[_0x0b82('0x18')](_0x0b82('0x1d'),_0x4bf49c['message'],_0x2c7b10);_0x54bbcf(_0x300fe6[_0x0b82('0x18')](0x1f4,_0x4bf49c[_0x0b82('0x1a')]));});});};exports[_0x0b82('0x28')]=function(_0x7d7bcb){var _0x2bcca4=this;return new Promise(function(_0x4db29e,_0x73a8f8){return db[_0x0b82('0x1e')][_0x0b82('0x29')]({'raw':_0x7d7bcb[_0x0b82('0x20')]?_0x7d7bcb[_0x0b82('0x20')][_0x0b82('0x21')]===undefined?!![]:![]:!![],'where':_0x7d7bcb['options']?_0x7d7bcb['options'][_0x0b82('0x22')]||null:null,'attributes':_0x7d7bcb[_0x0b82('0x20')]?_0x7d7bcb[_0x0b82('0x20')][_0x0b82('0x23')]||null:null,'include':_0x7d7bcb[_0x0b82('0x20')]?_0x7d7bcb[_0x0b82('0x20')][_0x0b82('0x25')]?_[_0x0b82('0x26')](_0x7d7bcb['options'][_0x0b82('0x25')],function(_0x3a0448){return{'model':db[_0x3a0448[_0x0b82('0x27')]],'as':_0x3a0448['as'],'attributes':_0x3a0448['attributes'],'include':_0x3a0448[_0x0b82('0x25')]?_['map'](_0x3a0448[_0x0b82('0x25')],function(_0x2b5f27){return{'model':db[_0x2b5f27[_0x0b82('0x27')]],'as':_0x2b5f27['as'],'attributes':_0x2b5f27[_0x0b82('0x23')],'include':_0x2b5f27[_0x0b82('0x25')]?_['map'](_0x2b5f27[_0x0b82('0x25')],function(_0x58577e){return{'model':db[_0x58577e[_0x0b82('0x27')]],'as':_0x58577e['as'],'attributes':_0x58577e[_0x0b82('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0b82('0x11')](function(_0x52ccba){logger[_0x0b82('0x12')]('ShowMailAccount',_0x7d7bcb);logger[_0x0b82('0x15')]('ShowMailAccount',_0x7d7bcb,JSON[_0x0b82('0x17')](_0x52ccba));_0x4db29e(_0x52ccba);})[_0x0b82('0x1c')](function(_0x2bd39a){logger['error'](_0x0b82('0x28'),_0x2bd39a[_0x0b82('0x1a')],_0x7d7bcb);_0x73a8f8(_0x2bcca4[_0x0b82('0x18')](0x1f4,_0x2bd39a[_0x0b82('0x1a')]));});});};exports['NotifyMailAccount']=function(_0x38b02b){var _0x4ae032=this;return new Promise(function(_0x497d7a,_0x940099){var _0x5249ad={'body':_0x38b02b[_0x0b82('0x2a')],'channel':_0x0b82('0x2b')};var _0x54e295=_[_0x0b82('0x2c')](_[_0x0b82('0x2d')](db[_0x0b82('0x2e')][_0x0b82('0x2f')]),[_0x0b82('0x30'),_0x0b82('0x31'),_0x0b82('0x32'),_0x0b82('0x33')]);var _0x3813ac=![];if(_0x38b02b[_0x0b82('0x2a')]['id']){delete _0x38b02b[_0x0b82('0x2a')]['id'];}if(_['isNil'](_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x34')])){return _0x940099(_0x4ae032[_0x0b82('0x18')](0x1f4,_0x0b82('0x35')));}if(_[_0x0b82('0x36')](_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x2a')])||_0x38b02b[_0x0b82('0x2a')]['body']===''){return _0x940099(_0x4ae032[_0x0b82('0x18')](0x1f4,_0x0b82('0x37')));}if(_[_0x0b82('0x36')](_0x38b02b[_0x0b82('0x2a')]['mapKey'])){return _0x940099(_0x4ae032[_0x0b82('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54e295));}if(!_['includes'](_0x54e295,_0x38b02b[_0x0b82('0x2a')]['mapKey'])){return _0x940099(_0x4ae032['error'](0x1f4,_0x0b82('0x38')+_0x54e295));}var _0x17c8b5={};_0x17c8b5[_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x39')]]=_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x34')];return db[_0x0b82('0x1e')]['find']({'where':{'id':_0x38b02b[_0x0b82('0x3a')]['id']},'include':[{'model':db[_0x0b82('0x3b')],'as':_0x0b82('0x3c'),'include':[{'model':db[_0x0b82('0x2e')],'as':_0x0b82('0x3d'),'where':_0x17c8b5,'limit':0x1,'order':[[_0x0b82('0x31'),_0x0b82('0x3e')]]}]},{'model':db[_0x0b82('0x3f')],'as':'Applications'},{'model':db[_0x0b82('0x40')],'as':'Smtp'}]})[_0x0b82('0x11')](function(_0x228db0){if(_0x228db0&&_0x228db0[_0x0b82('0x3c')]){var _0x4d98a0=_0x228db0[_0x0b82('0x41')]({'plain':!![]});_0x5249ad[_0x0b82('0x3a')]=_['omit'](_0x4d98a0,[_0x0b82('0x42'),_0x0b82('0x3c')]);_0x5249ad[_0x0b82('0x43')]=_0x4d98a0[_0x0b82('0x42')];_0x5249ad['list']=_0x4d98a0[_0x0b82('0x3c')];_0x5249ad['applications']=_[_0x0b82('0x44')](_0x5249ad[_0x0b82('0x43')],[_0x0b82('0x45')],['asc']);if(_0x5249ad[_0x0b82('0x3a')]&&_0x5249ad[_0x0b82('0x3a')]['autoclose']){_0x5249ad['applications'][_0x0b82('0x46')]({'id':0x0,'priority':_0x5249ad[_0x0b82('0x43')][_0x0b82('0x47')]+0x1,'app':_0x0b82('0x48'),'appdata':_0x0b82('0x49'),'interval':_0x0b82('0x4a')});}if(_0x5249ad[_0x0b82('0x3a')]['Applications']){delete _0x5249ad[_0x0b82('0x3a')][_0x0b82('0x42')];}if(_0x5249ad['account'][_0x0b82('0x3c')]){delete _0x5249ad[_0x0b82('0x3a')][_0x0b82('0x3c')];}if(_0x4d98a0[_0x0b82('0x3c')][_0x0b82('0x3d')][_0x0b82('0x47')]){return _0x4d98a0[_0x0b82('0x3c')][_0x0b82('0x3d')][0x0];}var _0x38a92b=_[_0x0b82('0x4b')](_0x38b02b[_0x0b82('0x2a')],{'firstName':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x34')],'ListId':_0x4d98a0['ListId']});_0x38a92b[_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x39')]]=_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x34')];return db['CmContact']['create'](_0x38a92b);}else{throw new Error(_0x0b82('0x4c'));}})[_0x0b82('0x11')](function(_0x54ecf5){_0x5249ad[_0x0b82('0x4d')]=_0x54ecf5;if(_0x54ecf5){if(!_0x38b02b['body']['message']['messageId']){_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x4e')]=rs[_0x0b82('0x4f')]()+'\x20'+_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['from'];}var _0xdd1caf={'ContactId':_0x54ecf5['id'],'MailAccountId':_0x38b02b['account']['id'],'inReplyTo':_0x38b02b['body']['message'][_0x0b82('0x4e')],'to':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x34')],'cc':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['cc'],'subject':_0x38b02b['body'][_0x0b82('0x1a')]['subject'],'attach':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x50')],'lastMsgAt':moment()['format'](_0x0b82('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x38b02b['body'][_0x0b82('0x2a')]};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x38b02b[_0x0b82('0x3a')]['id']},'include':[{'model':db[_0x0b82('0x52')],'as':_0x0b82('0x53'),'attributes':[_0x0b82('0x4e')],'where':{'messageId':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x54')]}}]})[_0x0b82('0x11')](function(_0x46ef66){if(_0x46ef66){return[_0x46ef66,![]];}return db['MailInteraction']['create'](_0xdd1caf)[_0x0b82('0x11')](function(_0x285528){return[_0x285528,!![]];});});}else{throw new Error(_0x0b82('0x55'));}})[_0x0b82('0x56')](function(_0x5921c6,_0x33a068){if(_0x5921c6){_0x3813ac=_0x33a068;if(!_0x33a068){return _0x5921c6[_0x0b82('0x57')]({'inReplyTo':_0x38b02b[_0x0b82('0x2a')]['message'][_0x0b82('0x4e')],'to':_0x38b02b['body'][_0x0b82('0x1a')][_0x0b82('0x34')],'cc':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['cc'],'subject':_0x38b02b[_0x0b82('0x2a')]['message'][_0x0b82('0x58')],'attach':_0x5921c6[_0x0b82('0x50')]?_0x5921c6['attach']:_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x0b82('0x59')](_0x0b82('0x51')),'lastMsgAt':moment()[_0x0b82('0x59')](_0x0b82('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x38b02b[_0x0b82('0x2a')]['body']});}else{return _0x5921c6;}}})['then'](function(_0x16a221){_0x5249ad['interaction']=_0x16a221['get']({'plain':!![]});_0x5249ad[_0x0b82('0x5a')][_0x0b82('0x5b')]=_0x3813ac;return db['MailMessage'][_0x0b82('0x5c')]({'body':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x2a')],'MailAccountId':_0x38b02b[_0x0b82('0x3a')]['id'],'MailInteractionId':_0x16a221['id'],'direction':'in','ContactId':_0x5249ad[_0x0b82('0x4d')]['id'],'messageId':_0x38b02b['body']['message'][_0x0b82('0x4e')],'from':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['from'],'to':_0x38b02b[_0x0b82('0x2a')]['message']['to'],'cc':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['cc'],'subject':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')]['subject'],'attach':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x50')],'Attachments':_0x38b02b[_0x0b82('0x2a')]['message'][_0x0b82('0x5d')],'originTo':_0x38b02b[_0x0b82('0x2a')][_0x0b82('0x1a')][_0x0b82('0x5e')],'originCc':_0x38b02b[_0x0b82('0x2a')]['message']['originCc'],'bcc':_0x38b02b['body'][_0x0b82('0x1a')][_0x0b82('0x5f')]},{'include':[{'model':db['Attachment'],'as':_0x0b82('0x60')}]});})[_0x0b82('0x11')](function(_0xb565d8){_0x5249ad[_0x0b82('0x1a')]=_0xb565d8;if(_0x5249ad['interaction'][_0x0b82('0x61')]){return db[_0x0b82('0x62')][_0x0b82('0x29')]({'attributes':['id',_0x0b82('0x63')],'where':{'id':_0x5249ad[_0x0b82('0x5a')][_0x0b82('0x61')]}})[_0x0b82('0x11')](function(_0x576ee8){if(_0x576ee8){_0x5249ad['applications'][_0x0b82('0x64')]({'id':0x0,'priority':0x0,'app':_0x0b82('0x65'),'appdata':_0x576ee8[_0x0b82('0x63')]+','+(_0x5249ad[_0x0b82('0x3a')][_0x0b82('0x66')]||0xa),'interval':_0x0b82('0x4a')});}return respondWithRpcPromise('Start','startRouting',_0x5249ad);});}return respondWithRpcPromise(_0x0b82('0x67'),'startRouting',_0x5249ad);})[_0x0b82('0x11')](function(_0x40778f){_0x497d7a(_0x40778f);})[_0x0b82('0x1c')](function(_0x5d70ac){_0x940099(_0x4ae032[_0x0b82('0x18')](0x1f4,_0x5d70ac[_0x0b82('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 54fac7d..440db80 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 _0x716f=['mailAccount:','save','remove','removeListener','register','length'];(function(_0x330075,_0x370c93){var _0x49396c=function(_0x258755){while(--_0x258755){_0x330075['push'](_0x330075['shift']());}};_0x49396c(++_0x370c93);}(_0x716f,0xcd));var _0xf716=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x716f[_0xda464c];return _0x19e222;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xf716('0x0'),_0xf716('0x1'),'update'];function createListener(_0x3e1253,_0x172be1){return function(_0xccbeb4){_0x172be1['emit'](_0x3e1253,_0xccbeb4);};}function removeListener(_0x533791,_0x299e42){return function(){MailAccountEvents[_0xf716('0x2')](_0x533791,_0x299e42);};}exports[_0xf716('0x3')]=function(_0x3a4b78){for(var _0x32da35=0x0,_0x542cc4=events[_0xf716('0x4')];_0x32da35<_0x542cc4;_0x32da35++){var _0x9f090a=events[_0x32da35];var _0x351266=createListener(_0xf716('0x5')+_0x9f090a,_0x3a4b78);MailAccountEvents['on'](_0x9f090a,_0x351266);}}; \ No newline at end of file +var _0xbea8=['length','save','update','emit','removeListener'];(function(_0x403e7f,_0x230b29){var _0x41ae67=function(_0x42e5a1){while(--_0x42e5a1){_0x403e7f['push'](_0x403e7f['shift']());}};_0x41ae67(++_0x230b29);}(_0xbea8,0x178));var _0x8bea=function(_0x5413f5,_0x3154c7){_0x5413f5=_0x5413f5-0x0;var _0x639288=_0xbea8[_0x5413f5];return _0x639288;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8bea('0x0'),'remove',_0x8bea('0x1')];function createListener(_0x3205fb,_0x10bce6){return function(_0x250fee){_0x10bce6[_0x8bea('0x2')](_0x3205fb,_0x250fee);};}function removeListener(_0x2c58bf,_0x265510){return function(){MailAccountEvents[_0x8bea('0x3')](_0x2c58bf,_0x265510);};}exports['register']=function(_0x58ca5e){for(var _0x381d25=0x0,_0x506fb2=events[_0x8bea('0x4')];_0x381d25<_0x506fb2;_0x381d25++){var _0x1b486f=events[_0x381d25];var _0x2fb62f=createListener('mailAccount:'+_0x1b486f,_0x58ca5e);MailAccountEvents['on'](_0x1b486f,_0x2fb62f);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 7b7e7ec..b837d2a 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 _0xcffe=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','update'];(function(_0x3619d3,_0x737674){var _0x304b86=function(_0x579856){while(--_0x579856){_0x3619d3['push'](_0x3619d3['shift']());}};_0x304b86(++_0x737674);}(_0xcffe,0x1a1));var _0xecff=function(_0x24f870,_0x2c8a88){_0x24f870=_0x24f870-0x0;var _0x5d065b=_0xcffe[_0x24f870];return _0x5d065b;};'use strict';var multer=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var path=require(_0xecff('0x2'));var timeout=require(_0xecff('0x3'));var express=require(_0xecff('0x4'));var router=express[_0xecff('0x5')]();var auth=require(_0xecff('0x6'));var interaction=require(_0xecff('0x7'));var config=require(_0xecff('0x8'));var controller=require(_0xecff('0x9'));router['get']('/:id',auth[_0xecff('0xa')](),controller[_0xecff('0xb')]);router[_0xecff('0xc')](_0xecff('0xd'),auth[_0xecff('0xa')](),controller[_0xecff('0xe')]);router[_0xecff('0xf')]('/:id',auth[_0xecff('0xa')](),controller[_0xecff('0x10')]);module[_0xecff('0x11')]=router; \ No newline at end of file +var _0xf109=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','../../components/auth/service'];(function(_0x101249,_0x53cf00){var _0x3fb014=function(_0x2fe84a){while(--_0x2fe84a){_0x101249['push'](_0x101249['shift']());}};_0x3fb014(++_0x53cf00);}(_0xf109,0xce));var _0x9f10=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xf109[_0x58e469];return _0x4c01c5;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9f10('0x3'));var interaction=require(_0x9f10('0x4'));var config=require(_0x9f10('0x5'));var controller=require(_0x9f10('0x6'));router[_0x9f10('0x7')](_0x9f10('0x8'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0xb')](_0x9f10('0x8'),auth[_0x9f10('0x9')](),controller['update']);router[_0x9f10('0xc')](_0x9f10('0x8'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);module[_0x9f10('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ef648f8..c7d9177 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 _0xc599=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc599,0x1b2));var _0x9c59=function(_0x19d828,_0x2439ce){_0x19d828=_0x19d828-0x0;var _0x25b133=_0xc599[_0x19d828];return _0x25b133;};'use strict';var Sequelize=require('sequelize');module[_0x9c59('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9c59('0x1')],'allowNull':![],'defaultValue':_0x9c59('0x2')},'appdata':{'type':Sequelize[_0x9c59('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9c59('0x1')],'defaultValue':_0x9c59('0x4')}}; \ No newline at end of file +var _0xc5e5=['INTEGER','noop','TEXT','STRING'];(function(_0x77f822,_0x2b5db5){var _0x37f068=function(_0x4c6493){while(--_0x4c6493){_0x77f822['push'](_0x77f822['shift']());}};_0x37f068(++_0x2b5db5);}(_0xc5e5,0xdc));var _0x5c5e=function(_0x311d57,_0x3836a2){_0x311d57=_0x311d57-0x0;var _0x16e703=_0xc5e5[_0x311d57];return _0x16e703;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x5c5e('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5c5e('0x1')},'appdata':{'type':Sequelize[_0x5c5e('0x2')]()},'description':{'type':Sequelize[_0x5c5e('0x3')]},'interval':{'type':Sequelize[_0x5c5e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9b99847..212e6e8 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 _0xd2d2=['ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','options','MailApplication','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xd2d2,0x101));var _0x2d2d=function(_0x1463ae,_0x3e3161){_0x1463ae=_0x1463ae-0x0;var _0x56caed=_0xd2d2[_0x1463ae];return _0x56caed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2d2d('0x0'));var rimraf=require(_0x2d2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d2d('0x2'));var rp=require(_0x2d2d('0x3'));var moment=require(_0x2d2d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d2d('0x5'));var util=require(_0x2d2d('0x6'));var path=require('path');var sox=require(_0x2d2d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d2d('0x8'));var fs=require('fs');var _=require(_0x2d2d('0x9'));var squel=require('squel');var crypto=require(_0x2d2d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2d2d('0xb'));var toCsv=require(_0x2d2d('0xc'));var querystring=require(_0x2d2d('0xd'));var Papa=require(_0x2d2d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d2d('0xf'))('api');var utils=require(_0x2d2d('0x10'));var config=require('../../config/environment');var db=require(_0x2d2d('0x11'))['db'];function respondWithStatusCode(_0x36f172,_0x2fcbfb){_0x2fcbfb=_0x2fcbfb||0xcc;return function(_0x4f3131){if(_0x4f3131){return _0x36f172['sendStatus'](_0x2fcbfb);}return _0x36f172[_0x2d2d('0x12')](_0x2fcbfb)[_0x2d2d('0x13')]();};}function respondWithResult(_0x11e0b8,_0x46b4ef){_0x46b4ef=_0x46b4ef||0xc8;return function(_0x53b696){if(_0x53b696){return _0x11e0b8[_0x2d2d('0x12')](_0x46b4ef)['json'](_0x53b696);}};}function respondWithFilteredResult(_0xa4e627,_0x4a22eb){return function(_0x175af2){if(_0x175af2){var _0x1d91c3=_0x175af2[_0x2d2d('0x14')],_0x2756fd=_0x4a22eb[_0x2d2d('0x15')],_0x224b43=_0x4a22eb[_0x2d2d('0x15')]+_0x4a22eb[_0x2d2d('0x16')],_0x548d35;if(_0x224b43>=_0x1d91c3){_0x224b43=_0x1d91c3;_0x548d35=0xc8;}else{_0x548d35=0xce;}_0xa4e627[_0x2d2d('0x12')](_0x548d35);return _0xa4e627[_0x2d2d('0x17')](_0x2d2d('0x18'),_0x2756fd+'-'+_0x224b43+'/'+_0x1d91c3)[_0x2d2d('0x19')](_0x175af2);}return null;};}function patchUpdates(_0x40572a){return function(_0x168c21){try{jsonpatch['apply'](_0x168c21,_0x40572a,!![]);}catch(_0x52b521){return BPromise[_0x2d2d('0x1a')](_0x52b521);}return _0x168c21[_0x2d2d('0x1b')]();};}function saveUpdates(_0x521c6e,_0x4a93e2){return function(_0x202d8d){if(_0x202d8d){return _0x202d8d[_0x2d2d('0x1c')](_0x521c6e)[_0x2d2d('0x1d')](function(_0x8e6ebe){return _0x8e6ebe;});}return null;};}function removeEntity(_0x556691,_0x4d1ff9){return function(_0x49d245){if(_0x49d245){return _0x49d245[_0x2d2d('0x1e')]()['then'](function(){_0x556691[_0x2d2d('0x12')](0xcc)[_0x2d2d('0x13')]();});}};}function handleEntityNotFound(_0x13837b,_0x41d0e2){return function(_0x299cbf){if(!_0x299cbf){_0x13837b[_0x2d2d('0x1f')](0x194);}return _0x299cbf;};}function handleError(_0x5b8d27,_0x2616e1){_0x2616e1=_0x2616e1||0x1f4;return function(_0xafcc83){logger[_0x2d2d('0x20')](_0xafcc83[_0x2d2d('0x21')]);if(_0xafcc83[_0x2d2d('0x22')]){delete _0xafcc83[_0x2d2d('0x22')];}_0x5b8d27[_0x2d2d('0x12')](_0x2616e1)[_0x2d2d('0x23')](_0xafcc83);};}exports['show']=function(_0xb3c080,_0x2da8b4){var _0x3cd918={'raw':!![],'where':{'id':_0xb3c080[_0x2d2d('0x24')]['id']}},_0x1a6648={};_0x1a6648[_0x2d2d('0x25')]=_[_0x2d2d('0x26')](db['MailApplication'][_0x2d2d('0x27')]);_0x1a6648['query']=_[_0x2d2d('0x26')](_0xb3c080['query']);_0x1a6648[_0x2d2d('0x28')]=_[_0x2d2d('0x29')](_0x1a6648[_0x2d2d('0x25')],_0x1a6648[_0x2d2d('0x2a')]);_0x3cd918['attributes']=_[_0x2d2d('0x29')](_0x1a6648[_0x2d2d('0x25')],qs['fields'](_0xb3c080[_0x2d2d('0x2a')][_0x2d2d('0x2b')]));_0x3cd918[_0x2d2d('0x2c')]=_0x3cd918[_0x2d2d('0x2c')][_0x2d2d('0x2d')]?_0x3cd918[_0x2d2d('0x2c')]:_0x1a6648[_0x2d2d('0x25')];if(_0xb3c080[_0x2d2d('0x2a')][_0x2d2d('0x2e')]){_0x3cd918[_0x2d2d('0x2f')]=[{'all':!![]}];}_0x3cd918=_['merge']({},_0x3cd918,_0xb3c080[_0x2d2d('0x30')]);return db[_0x2d2d('0x31')][_0x2d2d('0x32')](_0x3cd918)[_0x2d2d('0x1d')](handleEntityNotFound(_0x2da8b4,null))[_0x2d2d('0x1d')](respondWithResult(_0x2da8b4,null))[_0x2d2d('0x33')](handleError(_0x2da8b4,null));};exports[_0x2d2d('0x1c')]=function(_0x2409e9,_0x22a8dc){if(_0x2409e9['body']['id']){delete _0x2409e9['body']['id'];}return db[_0x2d2d('0x31')][_0x2d2d('0x32')]({'where':{'id':_0x2409e9['params']['id']}})['then'](handleEntityNotFound(_0x22a8dc,null))['then'](saveUpdates(_0x2409e9[_0x2d2d('0x34')],null))[_0x2d2d('0x1d')](respondWithResult(_0x22a8dc,null))[_0x2d2d('0x33')](handleError(_0x22a8dc,null));};exports[_0x2d2d('0x1e')]=function(_0xbc7ff2,_0x306b19){return db[_0x2d2d('0x31')]['find']({'where':{'id':_0xbc7ff2[_0x2d2d('0x24')]['id']}})[_0x2d2d('0x1d')](handleEntityNotFound(_0x306b19,null))[_0x2d2d('0x1d')](removeEntity(_0x306b19,null))['catch'](handleError(_0x306b19,null));}; \ No newline at end of file +var _0xc9a3=['name','send','show','params','model','keys','rawAttributes','query','intersection','fields','attributes','includeAll','include','options','find','catch','update','body','MailApplication','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','count','offset','limit','set','json','apply','save','then','destroy','error','stack'];(function(_0x55e767,_0x35d535){var _0x21c2ab=function(_0xd7cc57){while(--_0xd7cc57){_0x55e767['push'](_0x55e767['shift']());}};_0x21c2ab(++_0x35d535);}(_0xc9a3,0x83));var _0x3c9a=function(_0x1a0533,_0x421fc5){_0x1a0533=_0x1a0533-0x0;var _0x30e8da=_0xc9a3[_0x1a0533];return _0x30e8da;};'use strict';var pdf=require(_0x3c9a('0x0'));var emlformat=require(_0x3c9a('0x1'));var rimraf=require(_0x3c9a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c9a('0x3'));var rp=require(_0x3c9a('0x4'));var moment=require(_0x3c9a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c9a('0x6'));var util=require(_0x3c9a('0x7'));var path=require('path');var sox=require(_0x3c9a('0x8'));var csv=require(_0x3c9a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c9a('0xa'));var squel=require(_0x3c9a('0xb'));var crypto=require(_0x3c9a('0xc'));var jsforce=require(_0x3c9a('0xd'));var deskjs=require(_0x3c9a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c9a('0xf'));var Papa=require('papaparse');var Redis=require(_0x3c9a('0x10'));var authService=require(_0x3c9a('0x11'));var qs=require(_0x3c9a('0x12'));var hardwareService=require(_0x3c9a('0x13'));var logger=require(_0x3c9a('0x14'))(_0x3c9a('0x15'));var utils=require('../../config/utils');var config=require(_0x3c9a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d825,_0x3f7aab){_0x3f7aab=_0x3f7aab||0xcc;return function(_0x6bfcde){if(_0x6bfcde){return _0x25d825[_0x3c9a('0x17')](_0x3f7aab);}return _0x25d825['status'](_0x3f7aab)[_0x3c9a('0x18')]();};}function respondWithResult(_0xa112cc,_0x172193){_0x172193=_0x172193||0xc8;return function(_0x22bb22){if(_0x22bb22){return _0xa112cc[_0x3c9a('0x19')](_0x172193)['json'](_0x22bb22);}};}function respondWithFilteredResult(_0xbff9a0,_0x1ea09a){return function(_0x407f78){if(_0x407f78){var _0x1f7dd5=_0x407f78[_0x3c9a('0x1a')],_0x492c26=_0x1ea09a[_0x3c9a('0x1b')],_0x1af932=_0x1ea09a[_0x3c9a('0x1b')]+_0x1ea09a[_0x3c9a('0x1c')],_0x3a105c;if(_0x1af932>=_0x1f7dd5){_0x1af932=_0x1f7dd5;_0x3a105c=0xc8;}else{_0x3a105c=0xce;}_0xbff9a0[_0x3c9a('0x19')](_0x3a105c);return _0xbff9a0[_0x3c9a('0x1d')]('Content-Range',_0x492c26+'-'+_0x1af932+'/'+_0x1f7dd5)[_0x3c9a('0x1e')](_0x407f78);}return null;};}function patchUpdates(_0x2cfefa){return function(_0xc9a93){try{jsonpatch[_0x3c9a('0x1f')](_0xc9a93,_0x2cfefa,!![]);}catch(_0x36951f){return BPromise['reject'](_0x36951f);}return _0xc9a93[_0x3c9a('0x20')]();};}function saveUpdates(_0x140875,_0x1b4342){return function(_0x507fce){if(_0x507fce){return _0x507fce['update'](_0x140875)[_0x3c9a('0x21')](function(_0x3c0fa7){return _0x3c0fa7;});}return null;};}function removeEntity(_0x2b821c,_0x3d3547){return function(_0x5c2594){if(_0x5c2594){return _0x5c2594[_0x3c9a('0x22')]()[_0x3c9a('0x21')](function(){_0x2b821c[_0x3c9a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f19dd,_0x446d45){return function(_0x3d033a){if(!_0x3d033a){_0x5f19dd[_0x3c9a('0x17')](0x194);}return _0x3d033a;};}function handleError(_0x2ebba5,_0x2a2719){_0x2a2719=_0x2a2719||0x1f4;return function(_0x2d835a){logger[_0x3c9a('0x23')](_0x2d835a[_0x3c9a('0x24')]);if(_0x2d835a[_0x3c9a('0x25')]){delete _0x2d835a[_0x3c9a('0x25')];}_0x2ebba5[_0x3c9a('0x19')](_0x2a2719)[_0x3c9a('0x26')](_0x2d835a);};}exports[_0x3c9a('0x27')]=function(_0x20d7ad,_0x5a841b){var _0x554511={'raw':!![],'where':{'id':_0x20d7ad[_0x3c9a('0x28')]['id']}},_0xfb94cd={};_0xfb94cd[_0x3c9a('0x29')]=_[_0x3c9a('0x2a')](db['MailApplication'][_0x3c9a('0x2b')]);_0xfb94cd['query']=_['keys'](_0x20d7ad[_0x3c9a('0x2c')]);_0xfb94cd['filters']=_['intersection'](_0xfb94cd[_0x3c9a('0x29')],_0xfb94cd[_0x3c9a('0x2c')]);_0x554511['attributes']=_[_0x3c9a('0x2d')](_0xfb94cd[_0x3c9a('0x29')],qs[_0x3c9a('0x2e')](_0x20d7ad[_0x3c9a('0x2c')][_0x3c9a('0x2e')]));_0x554511[_0x3c9a('0x2f')]=_0x554511[_0x3c9a('0x2f')]['length']?_0x554511[_0x3c9a('0x2f')]:_0xfb94cd[_0x3c9a('0x29')];if(_0x20d7ad[_0x3c9a('0x2c')][_0x3c9a('0x30')]){_0x554511[_0x3c9a('0x31')]=[{'all':!![]}];}_0x554511=_['merge']({},_0x554511,_0x20d7ad[_0x3c9a('0x32')]);return db['MailApplication'][_0x3c9a('0x33')](_0x554511)['then'](handleEntityNotFound(_0x5a841b,null))[_0x3c9a('0x21')](respondWithResult(_0x5a841b,null))[_0x3c9a('0x34')](handleError(_0x5a841b,null));};exports[_0x3c9a('0x35')]=function(_0x48938c,_0x46c1d5){if(_0x48938c[_0x3c9a('0x36')]['id']){delete _0x48938c[_0x3c9a('0x36')]['id'];}return db['MailApplication'][_0x3c9a('0x33')]({'where':{'id':_0x48938c[_0x3c9a('0x28')]['id']}})[_0x3c9a('0x21')](handleEntityNotFound(_0x46c1d5,null))[_0x3c9a('0x21')](saveUpdates(_0x48938c[_0x3c9a('0x36')],null))['then'](respondWithResult(_0x46c1d5,null))[_0x3c9a('0x34')](handleError(_0x46c1d5,null));};exports[_0x3c9a('0x22')]=function(_0x3abfb4,_0x12d3cd){return db[_0x3c9a('0x37')]['find']({'where':{'id':_0x3abfb4['params']['id']}})[_0x3c9a('0x21')](handleEntityNotFound(_0x12d3cd,null))[_0x3c9a('0x21')](removeEntity(_0x12d3cd,null))[_0x3c9a('0x34')](handleError(_0x12d3cd,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index e6c9339..f45ca40 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 _0x4f7a=['utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','mail_applications','utf8mb4'];(function(_0x46b11f,_0x4d19f4){var _0x24699c=function(_0xac1baa){while(--_0xac1baa){_0x46b11f['push'](_0x46b11f['shift']());}};_0x24699c(++_0x4d19f4);}(_0x4f7a,0x105));var _0xa4f7=function(_0x198314,_0xa336f9){_0x198314=_0x198314-0x0;var _0x2f58c2=_0x4f7a[_0x198314];return _0x2f58c2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4f7('0x0'))(_0xa4f7('0x1'));var moment=require(_0xa4f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xa4f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4f7('0x4'));var config=require(_0xa4f7('0x5'));var attributes=require(_0xa4f7('0x6'));module['exports']=function(_0x31c8ab,_0x1d7c51){return _0x31c8ab['define']('MailApplication',attributes,{'tableName':_0xa4f7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4f7('0x8'),'collate':_0xa4f7('0x9')});}; \ No newline at end of file +var _0x202d=['../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x202d,0x18c));var _0xd202=function(_0x312744,_0x4e168c){_0x312744=_0x312744-0x0;var _0x28c719=_0x202d[_0x312744];return _0x28c719;};'use strict';var _=require('lodash');var util=require(_0xd202('0x0'));var logger=require(_0xd202('0x1'))(_0xd202('0x2'));var moment=require(_0xd202('0x3'));var BPromise=require('bluebird');var rp=require(_0xd202('0x4'));var fs=require('fs');var path=require(_0xd202('0x5'));var rimraf=require(_0xd202('0x6'));var config=require(_0xd202('0x7'));var attributes=require('./mailApplication.attributes');module[_0xd202('0x8')]=function(_0x30ad72,_0x585d41){return _0x30ad72[_0xd202('0x9')](_0xd202('0xa'),attributes,{'tableName':_0xd202('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd202('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 176e373..ca7aa20 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xd6902,_0x39c07e){var _0x4d30ec=function(_0x1c40cf){while(--_0x1c40cf){_0xd6902['push'](_0xd6902['shift']());}};_0x4d30ec(++_0x39c07e);}(_0x7a54,0x106));var _0x47a5=function(_0x13102c,_0x1edddf){_0x13102c=_0x13102c-0x0;var _0x52b3f8=_0x7a54[_0x13102c];return _0x52b3f8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x51b974,_0x176a77){var _0x573628=function(_0x4e8aea){while(--_0x4e8aea){_0x51b974['push'](_0x51b974['shift']());}};_0x573628(++_0x176a77);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc3b4,_0x57aed9){_0x2dc3b4=_0x2dc3b4-0x0;var _0x443c00=_0x7a54[_0x2dc3b4];return _0x443c00;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1e1f505..be82d09 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 _0x8ef6=['../../components/auth/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x595d8e,_0x3879ec){var _0x4d936d=function(_0x479c60){while(--_0x479c60){_0x595d8e['push'](_0x595d8e['shift']());}};_0x4d936d(++_0x3879ec);}(_0x8ef6,0xf2));var _0x68ef=function(_0x744865,_0x4801ab){_0x744865=_0x744865-0x0;var _0x241ed1=_0x8ef6[_0x744865];return _0x241ed1;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x9')](_0x68ef('0x11'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/',auth['isAuthenticated'](),controller[_0x68ef('0x14')]);router[_0x68ef('0x13')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x15')]);router[_0x68ef('0x13')]('/:id/tags',auth[_0x68ef('0xa')](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),'mailinteraction:addtags'),controller[_0x68ef('0x18')]);router[_0x68ef('0x19')](_0x68ef('0xd'),auth['isAuthenticated'](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),_0x68ef('0x1a')),controller[_0x68ef('0x1b')]);router['delete'](_0x68ef('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x68ef('0x17'),_0x68ef('0x1c')),controller['destroy']);router['delete'](_0x68ef('0x1d'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x8ef6=['../../components/auth/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0xa2ac4f,_0x3dbf57){var _0x3ef33a=function(_0x23f711){while(--_0x23f711){_0xa2ac4f['push'](_0xa2ac4f['shift']());}};_0x3ef33a(++_0x3dbf57);}(_0x8ef6,0xf2));var _0x68ef=function(_0x24a06f,_0x3e30d4){_0x24a06f=_0x24a06f-0x0;var _0x9001a7=_0x8ef6[_0x24a06f];return _0x9001a7;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x9')](_0x68ef('0x11'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/',auth['isAuthenticated'](),controller[_0x68ef('0x14')]);router[_0x68ef('0x13')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x15')]);router[_0x68ef('0x13')]('/:id/tags',auth[_0x68ef('0xa')](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),'mailinteraction:addtags'),controller[_0x68ef('0x18')]);router[_0x68ef('0x19')](_0x68ef('0xd'),auth['isAuthenticated'](),interaction[_0x68ef('0x16')](_0x68ef('0x17'),_0x68ef('0x1a')),controller[_0x68ef('0x1b')]);router['delete'](_0x68ef('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x68ef('0x17'),_0x68ef('0x1c')),controller['destroy']);router['delete'](_0x68ef('0x1d'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 521a852..9063795 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 _0x5518=['long','ENUM','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x346ab6,_0x3c50e8){var _0x5f3ff0=function(_0x12d7a3){while(--_0x12d7a3){_0x346ab6['push'](_0x346ab6['shift']());}};_0x5f3ff0(++_0x3c50e8);}(_0x5518,0xbf));var _0x8551=function(_0x2ad73d,_0xef509e){_0x2ad73d=_0x2ad73d-0x0;var _0x4f1ec2=_0x5518[_0x2ad73d];return _0x4f1ec2;};'use strict';var Sequelize=require(_0x8551('0x0'));var iconv=require(_0x8551('0x1'));module[_0x8551('0x2')]={'closed':{'type':Sequelize[_0x8551('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8551('0x4')]},'disposition':{'type':Sequelize[_0x8551('0x5')]},'note':{'type':Sequelize[_0x8551('0x5')]},'inReplyTo':{'type':Sequelize[_0x8551('0x5')](0x1fe)},'to':{'type':Sequelize[_0x8551('0x5')]},'cc':{'type':Sequelize[_0x8551('0x6')](_0x8551('0x7'))},'subject':{'type':Sequelize[_0x8551('0x6')]()},'attach':{'type':Sequelize[_0x8551('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x8551('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x8551('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8551('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8551('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x8551('0x7'))},'lastMsgText':{'type':Sequelize[_0x8551('0x6')](_0x8551('0x7'))}}; \ No newline at end of file +var _0x9b4a=['long','out','ENUM','TEXT','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x2a7b60,_0x3e4229){var _0x12d2cb=function(_0x5221a4){while(--_0x5221a4){_0x2a7b60['push'](_0x2a7b60['shift']());}};_0x12d2cb(++_0x3e4229);}(_0x9b4a,0x130));var _0xa9b4=function(_0x566bfb,_0x30a371){_0x566bfb=_0x566bfb-0x0;var _0x37a3a4=_0x9b4a[_0x566bfb];return _0x37a3a4;};'use strict';var Sequelize=require(_0xa9b4('0x0'));var iconv=require(_0xa9b4('0x1'));module[_0xa9b4('0x2')]={'closed':{'type':Sequelize[_0xa9b4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa9b4('0x4')]},'disposition':{'type':Sequelize[_0xa9b4('0x5')]},'note':{'type':Sequelize[_0xa9b4('0x5')]},'inReplyTo':{'type':Sequelize[_0xa9b4('0x5')](0x1fe)},'to':{'type':Sequelize[_0xa9b4('0x5')]},'cc':{'type':Sequelize['TEXT'](_0xa9b4('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xa9b4('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa9b4('0x4')]},'substatus':{'type':Sequelize[_0xa9b4('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa9b4('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa9b4('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa9b4('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xa9b4('0x9')]('long')},'lastMsgText':{'type':Sequelize[_0xa9b4('0x9')]('long')}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2b633e9..0600956 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 _0xa9e0=['sequelize','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.substatus','i.to','i.ContactId','Contact.firstName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','rows','show','params','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','emit','removeTags','unix','root','server','files','join','tmp','interaction-%s.zip','bcc','attachments','Attachment','Attachments','mkdirSync','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','closed','unreadMessages','MailMessage','Users','map','Tags','TagIds','split','forEach','push','MailInteraction','findOne','lastMsgText','trimStart','lastMsgBody','catch','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','expr','parse','createdAt','value','startOf','day','utc','and','isArray','TagId','Messages.count','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','condition','ContactId','c.firstName','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','clone','advancedFilter','read','format','%s\x20=\x200','having','`Messages.count`\x20>\x200','tag','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','t.id\x20IN\x20?','`Messages.count`\x20=\x200'];(function(_0x4d9c48,_0x2dbb71){var _0x276911=function(_0x40b506){while(--_0x40b506){_0x4d9c48['push'](_0x4d9c48['shift']());}};_0x276911(++_0x2dbb71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=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(){_0xfb6e48[_0x0a9e('0x1c')](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x1a')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x28')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x29')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x1c')](_0x33161b)[_0x0a9e('0x2a')](_0x526cf3);};}function getInteractionUnreadMessages(_0x25fba9){return new BPromise(function(_0x14433c,_0x140511){try{if(_0x25fba9[_0x0a9e('0x2b')]){_0x25fba9[_0x0a9e('0x2c')]=0x0;_0x14433c(_0x25fba9);}else{return db[_0x0a9e('0x2d')]['count']({'where':{'MailInteractionId':_0x25fba9['id'],'direction':'in','read':![]}})[_0x0a9e('0x26')](function(_0x468813){_0x25fba9[_0x0a9e('0x2c')]=_0x468813;_0x14433c(_0x25fba9);});}}catch(_0x2ec755){_0x140511(_0x2ec755);}});}function getInteractionUsers(_0x5c877d,_0x15b200){return new BPromise(function(_0x40e7a3,_0x1843b2){try{if(_0x15b200[_0x5c877d['id']]){_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x15b200[_0x5c877d['id']],function(_0x563b45){return{'id':_0x563b45['id']};});}}catch(_0x296f41){_0x1843b2(_0x296f41);}_0x40e7a3(_0x5c877d);});}function getInteractionTags(_0x2e8759,_0x1dbde2){return new BPromise(function(_0x540530,_0x426950){try{if(_0x2e8759['TagIds']){_0x2e8759[_0x0a9e('0x30')]=[];_0x2e8759[_0x0a9e('0x31')][_0x0a9e('0x32')](',')[_0x0a9e('0x33')](function(_0x25ce3a){_0x2e8759['Tags'][_0x0a9e('0x34')](_0x1dbde2[_0x25ce3a]);});}delete _0x2e8759[_0x0a9e('0x31')];}catch(_0x40cb85){_0x426950(_0x40cb85);}_0x540530(_0x2e8759);});}function getLastMessageText(_0x2da5c0){return new BPromise(function(_0x2b45ea,_0x409319){return db[_0x0a9e('0x35')][_0x0a9e('0x36')]({'where':{'id':_0x2da5c0['id']},'attributes':['lastMsgBody',_0x0a9e('0x37')],'raw':!![]})['then'](function(_0x2cc7a0){if(!_0x2cc7a0[_0x0a9e('0x37')]){_0x2da5c0[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](htmlToText['fromString'](_0x2cc7a0[_0x0a9e('0x39')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2da5c0[_0x0a9e('0x37')]=_0x2cc7a0[_0x0a9e('0x37')];}_0x2b45ea(_0x2da5c0);})[_0x0a9e('0x3a')](function(_0x4853b1){_0x409319(_0x4853b1);});});}function updateMailInteraction(_0x54135e,_0x1e8694,_0x5640eb,_0x24936a){return new BPromise(function(_0x3d9717,_0x381c37){return getInteractionUnreadMessages(_0x54135e)[_0x0a9e('0x26')](function(_0x4f41ae){return getInteractionUsers(_0x4f41ae,_0x5640eb);})[_0x0a9e('0x26')](function(_0x3bfce8){return getInteractionTags(_0x3bfce8,_0x1e8694);})[_0x0a9e('0x26')](function(_0x533942){if(_0x24936a){_0x3d9717(getLastMessageText(_0x533942));}else{_0x3d9717(_0x533942);}})[_0x0a9e('0x3a')](function(_0x1a180b){_0x381c37(_0x1a180b);});});}exports[_0x0a9e('0x3b')]=function(_0x4c1c0e,_0x546ef8){var _0x11b61d={},_0x40d766={},_0x5adda1={'count':0x0,'rows':[]};var _0x2b814e=db[_0x0a9e('0x35')][_0x0a9e('0x3c')];_0x40d766[_0x0a9e('0x3d')]=_['keys'](_0x2b814e);_0x40d766['query']=_[_0x0a9e('0x3e')](_0x4c1c0e[_0x0a9e('0x3f')]);_0x40d766['filters']=_[_0x0a9e('0x40')](_0x40d766[_0x0a9e('0x3d')],_0x40d766[_0x0a9e('0x3f')]);_0x11b61d['attributes']=_[_0x0a9e('0x40')](_0x40d766[_0x0a9e('0x3d')],qs[_0x0a9e('0x41')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x41')]));_0x11b61d[_0x0a9e('0x42')]=_0x11b61d[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x11b61d[_0x0a9e('0x42')]:_0x40d766[_0x0a9e('0x3d')];if(!_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x44')](_0x0a9e('0x45'))){_0x11b61d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4c1c0e['query']['limit']);_0x11b61d[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x1f')]);}_0x11b61d[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x47')]);_0x11b61d[_0x0a9e('0x48')]=qs[_0x0a9e('0x49')](_[_0x0a9e('0x4a')](_0x4c1c0e[_0x0a9e('0x3f')],_0x40d766['filters']));var _0x117c99=[];var _0x138b8b=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')]('id')[_0x0a9e('0x4c')](_0x0a9e('0x29'))[_0x0a9e('0x4c')](_0x0a9e('0x4d'))['from'](_0x0a9e('0x4e'));var _0x48fd45=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')](_0x0a9e('0x4f'))['from'](_0x0a9e('0x50'),'me')[_0x0a9e('0x48')](_0x0a9e('0x51'))[_0x0a9e('0x48')](_0x0a9e('0x52'))[_0x0a9e('0x48')](_0x0a9e('0x53'));var _0x5bbcde=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')](_0x0a9e('0x54'))[_0x0a9e('0x4c')](_0x0a9e('0x55'))[_0x0a9e('0x56')](_0x0a9e('0x57'),'ui')[_0x0a9e('0x58')](_0x0a9e('0x59'),'u','u.id\x20=\x20ui.UserId');var _0xe401a=squel[_0x0a9e('0x4b')]()['from']('mail_interactions','i')['left_join'](_0x0a9e('0x5a'),'c',_0x0a9e('0x5b'))[_0x0a9e('0x58')](_0x0a9e('0x59'),'o',_0x0a9e('0x5c'))[_0x0a9e('0x58')](_0x0a9e('0x5d'),'a',_0x0a9e('0x5e'))['left_join']('mail_messages','me','me.MailInteractionId\x20=\x20i.id');var _0x39d77d=squel[_0x0a9e('0x5f')]();if(_0x4c1c0e[_0x0a9e('0x3f')]['advancedFilter']){var _0x5fd5db=JSON[_0x0a9e('0x60')](_0x4c1c0e['query']['advancedFilter']);_[_0x0a9e('0x3e')](_0x5fd5db)['forEach'](function(_0x443e72){var _0x4c3845=_0x5fd5db[_0x443e72];if(_0x443e72===_0x0a9e('0x61')){var _0x3c20b2=moment(_0x4c3845[_0x0a9e('0x62')]['dateStart'])[_0x0a9e('0x63')](_0x0a9e('0x64'))['utc']()['format']();var _0x128aa6=moment(_0x128aa6)[_0x0a9e('0x65')]()['endOf'](_0x0a9e('0x64'))['format']();_0x39d77d[_0x0a9e('0x66')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3c20b2,_0x128aa6);}else{if(_[_0x0a9e('0x67')](_0x4c3845['condition'])){_0x4c3845['condition']['forEach'](function(_0x2da03c){switch(_0x4c3845['condition'][_0x0a9e('0x62')]){case'IS':if(_0x443e72!==_0x0a9e('0x68')&&_0x443e72!==_0x0a9e('0x69')){if(_[_0x0a9e('0x67')](_0x4c3845[_0x0a9e('0x62')])&&_0x4c3845[_0x0a9e('0x62')][_0x0a9e('0x43')]>0x1){_0x39d77d[_0x0a9e('0x66')](_0x4c3845['tableAlias']+'.'+_0x443e72+_0x0a9e('0x6a'),_0x4c3845[_0x0a9e('0x62')]);}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845[_0x0a9e('0x62')][0x0]);}}break;case'=':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845['value']);break;case _0x0a9e('0x6d'):if(_0x443e72==='ContactId'){_0x39d77d[_0x0a9e('0x66')]('c.firstName'+'\x20LIKE\x20?','%'+_0x4c3845['value']+'%');_0x39d77d['or'](_0x0a9e('0x6e')+'\x20LIKE\x20?','%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6f')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20LIKE\x20?','%'+_0x4c3845[_0x0a9e('0x62')]+'%');}break;case'>':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x71'),_0x4c3845[_0x0a9e('0x62')]);break;case'<':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x72'),_0x4c3845[_0x0a9e('0x62')]);break;}});}else{switch(_0x4c3845[_0x0a9e('0x73')]['value']){case'IS':if(_0x443e72!==_0x0a9e('0x68')&&_0x443e72!==_0x0a9e('0x69')){if(_['isArray'](_0x4c3845[_0x0a9e('0x62')])&&_0x4c3845[_0x0a9e('0x62')][_0x0a9e('0x43')]>0x1){_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20IN\x20?',_0x4c3845[_0x0a9e('0x62')]);}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20=\x20?',_0x4c3845[_0x0a9e('0x62')][0x0]);}}break;case'=':_0x39d77d['and'](_0x4c3845['tableAlias']+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845[_0x0a9e('0x62')]);break;case _0x0a9e('0x6d'):if(_0x443e72===_0x0a9e('0x74')){_0x39d77d[_0x0a9e('0x66')](_0x0a9e('0x75')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6e')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6f')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}break;case'>':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x71'),_0x4c3845[_0x0a9e('0x62')]);break;case'<':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x72'),_0x4c3845['value']);break;}}}});}else{var _0x83f0b2=_(Object[_0x0a9e('0x3e')](_0x4c1c0e[_0x0a9e('0x3f')]))[_0x0a9e('0x2f')](function(_0x13b5c0){return _0x2b814e['hasOwnProperty'](_0x13b5c0)?_0x13b5c0:undefined;})['filter'](function(_0x4a2438){return!_[_0x0a9e('0x76')](_0x4a2438);})[_0x0a9e('0x62')]();if(!_[_0x0a9e('0x77')](_0x83f0b2)){_0x83f0b2[_0x0a9e('0x33')](function(_0x6abd03){if(_0x6abd03===_0x0a9e('0x78')){_0xe401a[_0x0a9e('0x48')](_0x0a9e('0x79'),[]['concat'](_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03]));}else if(_0x6abd03===_0x0a9e('0x61')){var _0x12ccdb=JSON['parse'](_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03])['$gte'];var _0x4437ff=JSON[_0x0a9e('0x60')](_0x4c1c0e['query'][_0x6abd03])[_0x0a9e('0x7a')];_0xe401a[_0x0a9e('0x48')](_0x0a9e('0x7b'),_0x12ccdb,_0x4437ff);}else{if(_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03]==='null'){_0xe401a[_0x0a9e('0x48')]('i.'+_0x6abd03+_0x0a9e('0x7c'));}else{_0xe401a[_0x0a9e('0x48')]('i.'+_0x6abd03+_0x0a9e('0x6c'),_0x4c1c0e['query'][_0x6abd03]);}}});}if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x7d')]){var _0x2d5506=_0x4c1c0e[_0x0a9e('0x3f')]['filter'][_0x0a9e('0x7e')]('\x5c','\x5c\x5c')[_0x0a9e('0x7e')]('\x27\x27',_0x0a9e('0x7f'));if(qs[_0x0a9e('0x80')](_0x2d5506)){_0x39d77d['or'](_0x0a9e('0x81'),_0x2d5506+'%');}else if(qs[_0x0a9e('0x82')](_0x2d5506)){_0x39d77d['or'](_0x0a9e('0x83'),_0x2d5506+'%');}else{var _0x3df0e3=[];_0x2d5506[_0x0a9e('0x32')]('\x20')[_0x0a9e('0x33')](function(_0xc4c230){_0x3df0e3[_0x0a9e('0x34')]('+'+_0xc4c230[_0x0a9e('0x84')]());});var _0xe0749e=_0x3df0e3['join']('\x20');_0x39d77d['or'](_0x0a9e('0x85'),_0xe0749e)['or'](_0x0a9e('0x86'),_0xe0749e);}}}_0xe401a[_0x0a9e('0x48')](_0x39d77d);if(_0x11b61d['order']){_0x11b61d[_0x0a9e('0x46')][_0x0a9e('0x33')](function(_0x8cea96){_0xe401a[_0x0a9e('0x46')]('i.'+_0x8cea96[0x0],_0x8cea96[0x1]==='DESC'?![]:!![]);});}_0xe401a['group'](_0x0a9e('0x87'));var _0x2bbdb5={'type':db['Sequelize'][_0x0a9e('0x88')]['SELECT'],'raw':!![]};var _0x260f4b=_0xe401a[_0x0a9e('0x89')]()['field'](_0x0a9e('0x4f'));if(!_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8a')]){if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8b')]){if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8b')]==0x1){_0x260f4b['where'](util[_0x0a9e('0x8c')](_0x0a9e('0x8d'),_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')]('`Messages.count`\x20=\x200');}else{_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')]('%s\x20>\x200',_0x48fd45[_0x0a9e('0x84')]()));_0xe401a['having'](_0x0a9e('0x8f'));}}if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x90')]){var _0x385d52=_['isArray'](_0x4c1c0e['query'][_0x0a9e('0x90')])?_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x90')]:new Array(_0x4c1c0e['query'][_0x0a9e('0x90')]);var _0x36e975=squel['expr']();_0x385d52['forEach'](function(_0xf0a802){_0x36e975['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf0a802+',%');});_0xe401a['having'](_0x36e975);_0x260f4b['left_join'](_0x0a9e('0x91'),'it',_0x0a9e('0x92'));_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x4e'),'t',_0x0a9e('0x93'));_0x260f4b[_0x0a9e('0x48')]('t.id\x20IN\x20?',_0x385d52);}}else{var _0x5fd5db=JSON['parse'](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8a')]);_[_0x0a9e('0x3e')](_0x5fd5db)[_0x0a9e('0x33')](function(_0x50f8d7){var _0x46c9ac=_0x5fd5db[_0x50f8d7];if(_0x50f8d7===_0x0a9e('0x68')){var _0x1d4877=_0x46c9ac['value'];var _0xb6e411=squel[_0x0a9e('0x5f')]();_0x1d4877[_0x0a9e('0x33')](function(_0x22063c){_0xb6e411['or'](_0x0a9e('0x94'),'%,'+_0x22063c+',%');});_0xe401a[_0x0a9e('0x8e')](_0xb6e411);_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x91'),'it','it.MailInteractionId\x20=\x20i.id');_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x4e'),'t','t.id\x20=\x20it.TagId');_0x260f4b[_0x0a9e('0x48')](_0x0a9e('0x95'),_0x1d4877);}else if(_0x50f8d7===_0x0a9e('0x69')){if(_0x46c9ac['value'][_0x0a9e('0x43')]===0x1){if(_0x46c9ac['value'][0x0]===0x1){_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')](_0x0a9e('0x8d'),_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')](_0x0a9e('0x96'));}else{_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')]('%s\x20>\x200',_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')](_0x0a9e('0x8f'));}}}});}db[_0x0a9e('0x97')][_0x0a9e('0x3f')](_0x260f4b[_0x0a9e('0x84')](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x33f0c9){_0x5adda1[_0x0a9e('0x1e')]=_0x33f0c9[_0x0a9e('0x43')];if(_0x5adda1[_0x0a9e('0x1e')]===0x0)return[];return db[_0x0a9e('0x97')][_0x0a9e('0x3f')](_0x138b8b['toString'](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x23e2bd){_0x117c99=_[_0x0a9e('0x98')](_0x23e2bd,'id');_0x2bbdb5=_[_0x0a9e('0x99')](_0x2bbdb5,{'model':db[_0x0a9e('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe401a['field'](_0x0a9e('0x9a'),_0x0a9e('0x9b'));_0xe401a['field'](_0x0a9e('0x87'));_0xe401a['field'](_0x0a9e('0x9c'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x9d'));_0xe401a[_0x0a9e('0x4c')]('i.closed');_0xe401a[_0x0a9e('0x4c')]('i.closedAt');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x9e'));_0xe401a['field'](_0x0a9e('0x9f'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa0'));_0xe401a['field']('i.subject');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa1'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa2'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa3'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa4'));_0xe401a[_0x0a9e('0x4c')]('i.MailAccountId');_0xe401a[_0x0a9e('0x4c')]('i.UserId');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x75'),_0x0a9e('0xa5'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x6e'),'Contact.lastName');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x6f'),_0x0a9e('0xa6'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa7'),'Contact.phone');_0xe401a['field'](_0x0a9e('0xa8'),'Contact.mobile');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa9'),_0x0a9e('0xaa'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xab'),_0x0a9e('0x31'));_0xe401a['left_join']('mail_interaction_has_tags','it',_0x0a9e('0x92'));_0xe401a['left_join'](_0x0a9e('0x4e'),'t','t.id\x20=\x20it.TagId');_0xe401a[_0x0a9e('0x20')](_0x11b61d['limit']);_0xe401a['offset'](_0x11b61d[_0x0a9e('0x1f')]);return db[_0x0a9e('0x97')]['query'](_0xe401a[_0x0a9e('0x84')](),_0x2bbdb5);})[_0x0a9e('0x26')](function(_0x15c6b9){_0x5bbcde[_0x0a9e('0x48')](_0x0a9e('0xac'),_['map'](_0x15c6b9,'id'));return db['sequelize'][_0x0a9e('0x3f')](_0x5bbcde[_0x0a9e('0x84')](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x24beb6){var _0x59303b=_['groupBy'](_0x24beb6,_0x0a9e('0xad'));var _0xadce3d=[];return db['Setting'][_0x0a9e('0x36')]({'attributes':[_0x0a9e('0xae')],'raw':!![]})[_0x0a9e('0x26')](function(_0x2427d5){var _0x23b25b=_0x2427d5[_0x0a9e('0xae')];_0x15c6b9[_0x0a9e('0x33')](function(_0x476993){_0xadce3d[_0x0a9e('0x34')](updateMailInteraction(_0x476993,_0x117c99,_0x59303b,_0x23b25b));});return BPromise[_0x0a9e('0xaf')](_0xadce3d);});});});})['then'](function(_0x1065a7){_0x5adda1[_0x0a9e('0xb0')]=_0x1065a7;return _0x5adda1;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x546ef8,_0x11b61d))[_0x0a9e('0x3a')](handleError(_0x546ef8,null));};exports[_0x0a9e('0xb1')]=function(_0x547e37,_0x500868){var _0x21902c={'raw':![],'where':{'id':_0x547e37[_0x0a9e('0xb2')]['id']}},_0x16ae1a={};_0x16ae1a[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](db['MailInteraction'][_0x0a9e('0x3c')]);_0x16ae1a[_0x0a9e('0x3f')]=_[_0x0a9e('0x3e')](_0x547e37['query']);_0x16ae1a[_0x0a9e('0x49')]=_['intersection'](_0x16ae1a[_0x0a9e('0x3d')],_0x16ae1a['query']);_0x21902c[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x16ae1a[_0x0a9e('0x3d')],qs['fields'](_0x547e37[_0x0a9e('0x3f')]['fields']));_0x21902c[_0x0a9e('0x42')]=_0x21902c[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x21902c[_0x0a9e('0x42')]:_0x16ae1a[_0x0a9e('0x3d')];if(_0x547e37[_0x0a9e('0x3f')][_0x0a9e('0xb3')]){_0x21902c[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x21902c=_[_0x0a9e('0x99')]({},_0x21902c,_0x547e37[_0x0a9e('0xb5')]);return db[_0x0a9e('0x35')][_0x0a9e('0xb6')](_0x21902c)[_0x0a9e('0x26')](handleEntityNotFound(_0x500868,null))[_0x0a9e('0x26')](respondWithResult(_0x500868,null))[_0x0a9e('0x3a')](handleError(_0x500868,null));};exports[_0x0a9e('0xb7')]=function(_0x5b93dd,_0x556443){return db[_0x0a9e('0x35')]['create'](_0x5b93dd[_0x0a9e('0xb8')],{})[_0x0a9e('0x26')](respondWithResult(_0x556443,0xc9))['catch'](handleError(_0x556443,null));};exports[_0x0a9e('0x25')]=function(_0xe2b083,_0x387bbe){if(_0xe2b083[_0x0a9e('0xb8')]['id']){delete _0xe2b083['body']['id'];}return db[_0x0a9e('0x35')][_0x0a9e('0xb6')]({'where':{'id':_0xe2b083[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x387bbe,null))['then'](saveUpdates(_0xe2b083[_0x0a9e('0xb8')],null))[_0x0a9e('0x26')](respondWithResult(_0x387bbe,null))[_0x0a9e('0x3a')](handleError(_0x387bbe,null));};exports['destroy']=function(_0x2650eb,_0x270df8){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x2650eb[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x270df8,null))[_0x0a9e('0x26')](removeEntity(_0x270df8,null))[_0x0a9e('0x3a')](handleError(_0x270df8,null));};exports[_0x0a9e('0xb9')]=function(_0x555780,_0x3211d2){return db[_0x0a9e('0x35')]['describe']()[_0x0a9e('0x26')](respondWithResult(_0x3211d2,null))[_0x0a9e('0x3a')](handleError(_0x3211d2,null));};exports[_0x0a9e('0xba')]=function(_0x5822a7,_0x5c3b6f,_0x523d08){return db[_0x0a9e('0x2d')][_0x0a9e('0xb6')]({'where':{'id':_0x5822a7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c3b6f,null))[_0x0a9e('0x26')](function(_0x2a8d55){if(_0x2a8d55){return _0x2a8d55['addMessage'](_0x5822a7[_0x0a9e('0xb8')][_0x0a9e('0xbb')],_[_0x0a9e('0xbc')](_0x5822a7[_0x0a9e('0xb8')],[_0x0a9e('0xbb'),'id'])||{});}})[_0x0a9e('0x26')](respondWithResult(_0x5c3b6f,null))[_0x0a9e('0x3a')](handleError(_0x5c3b6f,null));};exports[_0x0a9e('0xbd')]=function(_0x3b5bda,_0x5a1848,_0x43c397){var _0x5526a7={'raw':![],'where':{}};var _0x138cf5={};var _0x4093e6={'count':0x0,'rows':[]};return db[_0x0a9e('0x35')][_0x0a9e('0x36')]({'where':{'id':_0x3b5bda[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a1848,null))['then'](function(_0x1a0314){if(_0x1a0314){_0x138cf5[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x2d')]['rawAttributes']);_0x138cf5[_0x0a9e('0x3f')]=_[_0x0a9e('0x3e')](_0x3b5bda[_0x0a9e('0x3f')]);_0x138cf5[_0x0a9e('0x49')]=_[_0x0a9e('0x40')](_0x138cf5[_0x0a9e('0x3d')],_0x138cf5[_0x0a9e('0x3f')]);_0x5526a7[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x138cf5[_0x0a9e('0x3d')],qs['fields'](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x41')]));_0x5526a7[_0x0a9e('0x42')]=_0x5526a7[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x5526a7[_0x0a9e('0x42')]:_0x138cf5[_0x0a9e('0x3d')];if(!_0x3b5bda[_0x0a9e('0x3f')]['hasOwnProperty'](_0x0a9e('0x45'))){_0x5526a7[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x3b5bda['query'][_0x0a9e('0x20')]);_0x5526a7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x1f')]);}_0x5526a7[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x47')]);_0x5526a7[_0x0a9e('0x48')]=qs['filters'](_[_0x0a9e('0x4a')](_0x3b5bda[_0x0a9e('0x3f')],_0x138cf5[_0x0a9e('0x49')]));_0x5526a7[_0x0a9e('0x48')][_0x0a9e('0xad')]=_0x1a0314['id'];if(_0x3b5bda[_0x0a9e('0x3f')]['filter']){_0x5526a7[_0x0a9e('0x48')]=_['merge'](_0x5526a7['where'],{'$or':_['map'](_0x5526a7[_0x0a9e('0x42')],function(_0x3fa3f2){var _0x426cb4={};_0x426cb4[_0x3fa3f2]={'$like':'%'+_0x3b5bda[_0x0a9e('0x3f')]['filter']+'%'};return _0x426cb4;})});}if(_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xbe')]){var _0x3ddbc7=_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xbe')]['split'](',');var _0x57b1b1={};_0x57b1b1[_0x3ddbc7[0x0]]={'$gte':moment(_0x3ddbc7[0x1])[_0x0a9e('0x8c')](_0x0a9e('0xbf'))};_0x5526a7[_0x0a9e('0x48')]=_['merge'](_0x5526a7[_0x0a9e('0x48')],_0x57b1b1);}_0x5526a7=_[_0x0a9e('0x99')]({},_0x5526a7,_0x3b5bda[_0x0a9e('0xb5')]);return db['MailMessage'][_0x0a9e('0x1e')]({'where':_0x5526a7[_0x0a9e('0x48')]})[_0x0a9e('0x26')](function(_0x4eda8f){_0x4093e6[_0x0a9e('0x1e')]=_0x4eda8f;if(_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xb3')]){_0x5526a7['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5526a7);})[_0x0a9e('0x26')](function(_0x1f50db){_0x4093e6[_0x0a9e('0xb0')]=_0x1f50db;return _0x4093e6;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5a1848,_0x5526a7))['catch'](handleError(_0x5a1848,null));};exports[_0x0a9e('0xc0')]=function(_0x532424,_0x3b4af9,_0x2ff2ab){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x532424[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x3b4af9,null))[_0x0a9e('0x26')](function(_0x580dd6){if(_0x580dd6){return _0x580dd6[_0x0a9e('0xc1')](_0x532424['body'][_0x0a9e('0xbb')],_['omit'](_0x532424[_0x0a9e('0xb8')],['ids','id'])||{})[_0x0a9e('0xc2')](function(){return db[_0x0a9e('0xc3')][_0x0a9e('0xc4')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x4d')],'where':{'id':_0x532424[_0x0a9e('0xb8')][_0x0a9e('0xbb')]}});})['then'](function(_0x35ace3){socket[_0x0a9e('0xc5')]('mailInteractionTags:save',{'id':Number(_0x532424[_0x0a9e('0xb2')]['id']),'tags':_0x35ace3||[]});return{'id':Number(_0x532424[_0x0a9e('0xb2')]['id']),'tags':_0x35ace3||[]};});}})['then'](respondWithResult(_0x3b4af9,null))[_0x0a9e('0x3a')](handleError(_0x3b4af9,null));};exports[_0x0a9e('0xc6')]=function(_0x16b578,_0x569528,_0x3766d7){return db[_0x0a9e('0x35')][_0x0a9e('0xb6')]({'where':{'id':_0x16b578[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x569528,null))[_0x0a9e('0x26')](function(_0x3ba897){if(_0x3ba897){return _0x3ba897[_0x0a9e('0xc6')](_0x16b578[_0x0a9e('0x3f')][_0x0a9e('0xbb')]);}})['then'](respondWithStatusCode(_0x569528,null))[_0x0a9e('0x3a')](handleError(_0x569528,null));};exports['download']=function(_0x3c9854,_0x2968e2){var _0x5b9c76=moment()[_0x0a9e('0xc7')]()[_0x0a9e('0x84')]();var _0x2d45db=path['join'](config[_0x0a9e('0xc8')],_0x0a9e('0xc9'),_0x0a9e('0xca'),'attachments');var _0x11e4e3=path[_0x0a9e('0xcb')](config[_0x0a9e('0xc8')],_0x0a9e('0xc9'),_0x0a9e('0xca'),_0x0a9e('0xcc'));var _0x1e93f5=path['join'](_0x11e4e3,_0x5b9c76);var _0x4e1b3=util[_0x0a9e('0x8c')](_0x0a9e('0xcd'),_0x5b9c76);var _0x2ce3be=path[_0x0a9e('0xcb')](_0x11e4e3,_0x4e1b3);var _0x241404=![];return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x3c9854['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2968e2,null))[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929[_0x0a9e('0xbd')]({'attributes':['id',_0x0a9e('0xb8'),_0x0a9e('0x56'),'to','cc',_0x0a9e('0xce'),'subject',_0x0a9e('0x61')],'where':{'secret':![]},'include':_0x3c9854[_0x0a9e('0x3f')][_0x0a9e('0xcf')]?[{'model':db[_0x0a9e('0xd0')],'as':_0x0a9e('0xd1')}]:undefined,'order':qs[_0x0a9e('0x47')]('id')});}return[];})[_0x0a9e('0x26')](function(_0x54f0b8){_0x241404=_0x54f0b8[_0x0a9e('0x43')];if(_0x54f0b8[_0x0a9e('0x43')]){fs[_0x0a9e('0xd2')](_0x1e93f5);return BPromise['each'](_0x54f0b8,function(_0x2b8ad4,_0x387817){var _0x2030cf=_0x2b8ad4;var _0x292f02={'from':_0x2030cf['from'],'to':_0x2030cf['to'],'subject':_0x2030cf[_0x0a9e('0xd3')],'html':_0x2030cf[_0x0a9e('0xb8')],'headers':{'Date':moment(_0x2030cf[_0x0a9e('0x61')])[_0x0a9e('0x8c')](_0x0a9e('0xd4'))},'attachments':[]};if(_0x2b8ad4['cc']){_0x292f02[_0x0a9e('0xd5')]['Cc']=_0x2b8ad4['cc'];}if(_0x2b8ad4[_0x0a9e('0xce')]){_0x292f02[_0x0a9e('0xd5')]['Bcc']=_0x2b8ad4[_0x0a9e('0xce')];}return new BPromise(function(_0x266aa1,_0x25e41f){if(_0x2b8ad4[_0x0a9e('0xd1')]){for(var _0x5f4c6f=0x0;_0x5f4c6f<_0x2b8ad4['Attachments'][_0x0a9e('0x43')];_0x5f4c6f++){var _0x2abe55=_0x2b8ad4[_0x0a9e('0xd1')][_0x5f4c6f];var _0x596ba3=path[_0x0a9e('0xcb')](_0x2d45db,_0x2abe55[_0x0a9e('0xd6')]);if(fs['existsSync'](_0x596ba3)){_0x292f02[_0x0a9e('0xcf')]['push']({'name':_0x2abe55[_0x0a9e('0x29')],'contentType':_0x2abe55['type'],'data':fs['readFileSync'](_0x596ba3)});}}}emlformat['build'](_0x292f02,function(_0xad4d10,_0x4297d1){if(_0xad4d10)return _0x25e41f(_0xad4d10);fs[_0x0a9e('0xd7')](path[_0x0a9e('0xcb')](_0x1e93f5,util[_0x0a9e('0x8c')](_0x0a9e('0xd8'),_0x387817)),_0x4297d1);return _0x266aa1(_0x4297d1);});});});}})['then'](function(){if(_0x241404){return new BPromise(function(_0x5fb7ce,_0x213e5f){zipdir(_0x1e93f5,{'saveTo':_0x2ce3be},function(_0x1713a7,_0xd18f82){if(_0x1713a7)return _0x213e5f(_0x1713a7);return _0x5fb7ce(_0xd18f82);});});}})[_0x0a9e('0x26')](function(){if(_0x241404){return new BPromise(function(_0x18dccf,_0x31c937){rimraf(_0x1e93f5,function(_0x5312fa){if(_0x5312fa)_0x31c937(_0x5312fa);return _0x18dccf();});});}})['then'](function(){if(_0x241404){return _0x2968e2[_0x0a9e('0xd9')](_0x2ce3be,_0x4e1b3,function(_0x5b6edc){if(_0x5b6edc){console[_0x0a9e('0xda')](_0x0a9e('0xdb'),_0x5b6edc);}else{fs[_0x0a9e('0xdc')](_0x2ce3be);}});}else{return _0x2968e2[_0x0a9e('0x1a')](0xc8);}})[_0x0a9e('0x3a')](handleError(_0x2968e2,null));}; \ No newline at end of file +var _0xa9e0=['sequelize','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.substatus','i.to','i.ContactId','Contact.firstName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','rows','show','params','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','emit','removeTags','unix','root','server','files','join','tmp','interaction-%s.zip','bcc','attachments','Attachment','Attachments','mkdirSync','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','closed','unreadMessages','MailMessage','Users','map','Tags','TagIds','split','forEach','push','MailInteraction','findOne','lastMsgText','trimStart','lastMsgBody','catch','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','expr','parse','createdAt','value','startOf','day','utc','and','isArray','TagId','Messages.count','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','condition','ContactId','c.firstName','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','clone','advancedFilter','read','format','%s\x20=\x200','having','`Messages.count`\x20>\x200','tag','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','t.id\x20IN\x20?','`Messages.count`\x20=\x200'];(function(_0xca629f,_0x2fe6ed){var _0x5987f9=function(_0x43d455){while(--_0x43d455){_0xca629f['push'](_0xca629f['shift']());}};_0x5987f9(++_0x2fe6ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=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(){_0xfb6e48[_0x0a9e('0x1c')](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x1a')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x28')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x29')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x1c')](_0x33161b)[_0x0a9e('0x2a')](_0x526cf3);};}function getInteractionUnreadMessages(_0x25fba9){return new BPromise(function(_0x14433c,_0x140511){try{if(_0x25fba9[_0x0a9e('0x2b')]){_0x25fba9[_0x0a9e('0x2c')]=0x0;_0x14433c(_0x25fba9);}else{return db[_0x0a9e('0x2d')]['count']({'where':{'MailInteractionId':_0x25fba9['id'],'direction':'in','read':![]}})[_0x0a9e('0x26')](function(_0x468813){_0x25fba9[_0x0a9e('0x2c')]=_0x468813;_0x14433c(_0x25fba9);});}}catch(_0x2ec755){_0x140511(_0x2ec755);}});}function getInteractionUsers(_0x5c877d,_0x15b200){return new BPromise(function(_0x40e7a3,_0x1843b2){try{if(_0x15b200[_0x5c877d['id']]){_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x15b200[_0x5c877d['id']],function(_0x563b45){return{'id':_0x563b45['id']};});}}catch(_0x296f41){_0x1843b2(_0x296f41);}_0x40e7a3(_0x5c877d);});}function getInteractionTags(_0x2e8759,_0x1dbde2){return new BPromise(function(_0x540530,_0x426950){try{if(_0x2e8759['TagIds']){_0x2e8759[_0x0a9e('0x30')]=[];_0x2e8759[_0x0a9e('0x31')][_0x0a9e('0x32')](',')[_0x0a9e('0x33')](function(_0x25ce3a){_0x2e8759['Tags'][_0x0a9e('0x34')](_0x1dbde2[_0x25ce3a]);});}delete _0x2e8759[_0x0a9e('0x31')];}catch(_0x40cb85){_0x426950(_0x40cb85);}_0x540530(_0x2e8759);});}function getLastMessageText(_0x2da5c0){return new BPromise(function(_0x2b45ea,_0x409319){return db[_0x0a9e('0x35')][_0x0a9e('0x36')]({'where':{'id':_0x2da5c0['id']},'attributes':['lastMsgBody',_0x0a9e('0x37')],'raw':!![]})['then'](function(_0x2cc7a0){if(!_0x2cc7a0[_0x0a9e('0x37')]){_0x2da5c0[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](htmlToText['fromString'](_0x2cc7a0[_0x0a9e('0x39')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2da5c0[_0x0a9e('0x37')]=_0x2cc7a0[_0x0a9e('0x37')];}_0x2b45ea(_0x2da5c0);})[_0x0a9e('0x3a')](function(_0x4853b1){_0x409319(_0x4853b1);});});}function updateMailInteraction(_0x54135e,_0x1e8694,_0x5640eb,_0x24936a){return new BPromise(function(_0x3d9717,_0x381c37){return getInteractionUnreadMessages(_0x54135e)[_0x0a9e('0x26')](function(_0x4f41ae){return getInteractionUsers(_0x4f41ae,_0x5640eb);})[_0x0a9e('0x26')](function(_0x3bfce8){return getInteractionTags(_0x3bfce8,_0x1e8694);})[_0x0a9e('0x26')](function(_0x533942){if(_0x24936a){_0x3d9717(getLastMessageText(_0x533942));}else{_0x3d9717(_0x533942);}})[_0x0a9e('0x3a')](function(_0x1a180b){_0x381c37(_0x1a180b);});});}exports[_0x0a9e('0x3b')]=function(_0x4c1c0e,_0x546ef8){var _0x11b61d={},_0x40d766={},_0x5adda1={'count':0x0,'rows':[]};var _0x2b814e=db[_0x0a9e('0x35')][_0x0a9e('0x3c')];_0x40d766[_0x0a9e('0x3d')]=_['keys'](_0x2b814e);_0x40d766['query']=_[_0x0a9e('0x3e')](_0x4c1c0e[_0x0a9e('0x3f')]);_0x40d766['filters']=_[_0x0a9e('0x40')](_0x40d766[_0x0a9e('0x3d')],_0x40d766[_0x0a9e('0x3f')]);_0x11b61d['attributes']=_[_0x0a9e('0x40')](_0x40d766[_0x0a9e('0x3d')],qs[_0x0a9e('0x41')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x41')]));_0x11b61d[_0x0a9e('0x42')]=_0x11b61d[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x11b61d[_0x0a9e('0x42')]:_0x40d766[_0x0a9e('0x3d')];if(!_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x44')](_0x0a9e('0x45'))){_0x11b61d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4c1c0e['query']['limit']);_0x11b61d[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x1f')]);}_0x11b61d[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x47')]);_0x11b61d[_0x0a9e('0x48')]=qs[_0x0a9e('0x49')](_[_0x0a9e('0x4a')](_0x4c1c0e[_0x0a9e('0x3f')],_0x40d766['filters']));var _0x117c99=[];var _0x138b8b=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')]('id')[_0x0a9e('0x4c')](_0x0a9e('0x29'))[_0x0a9e('0x4c')](_0x0a9e('0x4d'))['from'](_0x0a9e('0x4e'));var _0x48fd45=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')](_0x0a9e('0x4f'))['from'](_0x0a9e('0x50'),'me')[_0x0a9e('0x48')](_0x0a9e('0x51'))[_0x0a9e('0x48')](_0x0a9e('0x52'))[_0x0a9e('0x48')](_0x0a9e('0x53'));var _0x5bbcde=squel[_0x0a9e('0x4b')]()[_0x0a9e('0x4c')](_0x0a9e('0x54'))[_0x0a9e('0x4c')](_0x0a9e('0x55'))[_0x0a9e('0x56')](_0x0a9e('0x57'),'ui')[_0x0a9e('0x58')](_0x0a9e('0x59'),'u','u.id\x20=\x20ui.UserId');var _0xe401a=squel[_0x0a9e('0x4b')]()['from']('mail_interactions','i')['left_join'](_0x0a9e('0x5a'),'c',_0x0a9e('0x5b'))[_0x0a9e('0x58')](_0x0a9e('0x59'),'o',_0x0a9e('0x5c'))[_0x0a9e('0x58')](_0x0a9e('0x5d'),'a',_0x0a9e('0x5e'))['left_join']('mail_messages','me','me.MailInteractionId\x20=\x20i.id');var _0x39d77d=squel[_0x0a9e('0x5f')]();if(_0x4c1c0e[_0x0a9e('0x3f')]['advancedFilter']){var _0x5fd5db=JSON[_0x0a9e('0x60')](_0x4c1c0e['query']['advancedFilter']);_[_0x0a9e('0x3e')](_0x5fd5db)['forEach'](function(_0x443e72){var _0x4c3845=_0x5fd5db[_0x443e72];if(_0x443e72===_0x0a9e('0x61')){var _0x3c20b2=moment(_0x4c3845[_0x0a9e('0x62')]['dateStart'])[_0x0a9e('0x63')](_0x0a9e('0x64'))['utc']()['format']();var _0x128aa6=moment(_0x128aa6)[_0x0a9e('0x65')]()['endOf'](_0x0a9e('0x64'))['format']();_0x39d77d[_0x0a9e('0x66')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3c20b2,_0x128aa6);}else{if(_[_0x0a9e('0x67')](_0x4c3845['condition'])){_0x4c3845['condition']['forEach'](function(_0x2da03c){switch(_0x4c3845['condition'][_0x0a9e('0x62')]){case'IS':if(_0x443e72!==_0x0a9e('0x68')&&_0x443e72!==_0x0a9e('0x69')){if(_[_0x0a9e('0x67')](_0x4c3845[_0x0a9e('0x62')])&&_0x4c3845[_0x0a9e('0x62')][_0x0a9e('0x43')]>0x1){_0x39d77d[_0x0a9e('0x66')](_0x4c3845['tableAlias']+'.'+_0x443e72+_0x0a9e('0x6a'),_0x4c3845[_0x0a9e('0x62')]);}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845[_0x0a9e('0x62')][0x0]);}}break;case'=':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845['value']);break;case _0x0a9e('0x6d'):if(_0x443e72==='ContactId'){_0x39d77d[_0x0a9e('0x66')]('c.firstName'+'\x20LIKE\x20?','%'+_0x4c3845['value']+'%');_0x39d77d['or'](_0x0a9e('0x6e')+'\x20LIKE\x20?','%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6f')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20LIKE\x20?','%'+_0x4c3845[_0x0a9e('0x62')]+'%');}break;case'>':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x71'),_0x4c3845[_0x0a9e('0x62')]);break;case'<':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x72'),_0x4c3845[_0x0a9e('0x62')]);break;}});}else{switch(_0x4c3845[_0x0a9e('0x73')]['value']){case'IS':if(_0x443e72!==_0x0a9e('0x68')&&_0x443e72!==_0x0a9e('0x69')){if(_['isArray'](_0x4c3845[_0x0a9e('0x62')])&&_0x4c3845[_0x0a9e('0x62')][_0x0a9e('0x43')]>0x1){_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20IN\x20?',_0x4c3845[_0x0a9e('0x62')]);}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+'\x20=\x20?',_0x4c3845[_0x0a9e('0x62')][0x0]);}}break;case'=':_0x39d77d['and'](_0x4c3845['tableAlias']+'.'+_0x443e72+_0x0a9e('0x6c'),_0x4c3845[_0x0a9e('0x62')]);break;case _0x0a9e('0x6d'):if(_0x443e72===_0x0a9e('0x74')){_0x39d77d[_0x0a9e('0x66')](_0x0a9e('0x75')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6e')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');_0x39d77d['or'](_0x0a9e('0x6f')+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}else{_0x39d77d[_0x0a9e('0x66')](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x70'),'%'+_0x4c3845[_0x0a9e('0x62')]+'%');}break;case'>':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x71'),_0x4c3845[_0x0a9e('0x62')]);break;case'<':_0x39d77d['and'](_0x4c3845[_0x0a9e('0x6b')]+'.'+_0x443e72+_0x0a9e('0x72'),_0x4c3845['value']);break;}}}});}else{var _0x83f0b2=_(Object[_0x0a9e('0x3e')](_0x4c1c0e[_0x0a9e('0x3f')]))[_0x0a9e('0x2f')](function(_0x13b5c0){return _0x2b814e['hasOwnProperty'](_0x13b5c0)?_0x13b5c0:undefined;})['filter'](function(_0x4a2438){return!_[_0x0a9e('0x76')](_0x4a2438);})[_0x0a9e('0x62')]();if(!_[_0x0a9e('0x77')](_0x83f0b2)){_0x83f0b2[_0x0a9e('0x33')](function(_0x6abd03){if(_0x6abd03===_0x0a9e('0x78')){_0xe401a[_0x0a9e('0x48')](_0x0a9e('0x79'),[]['concat'](_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03]));}else if(_0x6abd03===_0x0a9e('0x61')){var _0x12ccdb=JSON['parse'](_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03])['$gte'];var _0x4437ff=JSON[_0x0a9e('0x60')](_0x4c1c0e['query'][_0x6abd03])[_0x0a9e('0x7a')];_0xe401a[_0x0a9e('0x48')](_0x0a9e('0x7b'),_0x12ccdb,_0x4437ff);}else{if(_0x4c1c0e[_0x0a9e('0x3f')][_0x6abd03]==='null'){_0xe401a[_0x0a9e('0x48')]('i.'+_0x6abd03+_0x0a9e('0x7c'));}else{_0xe401a[_0x0a9e('0x48')]('i.'+_0x6abd03+_0x0a9e('0x6c'),_0x4c1c0e['query'][_0x6abd03]);}}});}if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x7d')]){var _0x2d5506=_0x4c1c0e[_0x0a9e('0x3f')]['filter'][_0x0a9e('0x7e')]('\x5c','\x5c\x5c')[_0x0a9e('0x7e')]('\x27\x27',_0x0a9e('0x7f'));if(qs[_0x0a9e('0x80')](_0x2d5506)){_0x39d77d['or'](_0x0a9e('0x81'),_0x2d5506+'%');}else if(qs[_0x0a9e('0x82')](_0x2d5506)){_0x39d77d['or'](_0x0a9e('0x83'),_0x2d5506+'%');}else{var _0x3df0e3=[];_0x2d5506[_0x0a9e('0x32')]('\x20')[_0x0a9e('0x33')](function(_0xc4c230){_0x3df0e3[_0x0a9e('0x34')]('+'+_0xc4c230[_0x0a9e('0x84')]());});var _0xe0749e=_0x3df0e3['join']('\x20');_0x39d77d['or'](_0x0a9e('0x85'),_0xe0749e)['or'](_0x0a9e('0x86'),_0xe0749e);}}}_0xe401a[_0x0a9e('0x48')](_0x39d77d);if(_0x11b61d['order']){_0x11b61d[_0x0a9e('0x46')][_0x0a9e('0x33')](function(_0x8cea96){_0xe401a[_0x0a9e('0x46')]('i.'+_0x8cea96[0x0],_0x8cea96[0x1]==='DESC'?![]:!![]);});}_0xe401a['group'](_0x0a9e('0x87'));var _0x2bbdb5={'type':db['Sequelize'][_0x0a9e('0x88')]['SELECT'],'raw':!![]};var _0x260f4b=_0xe401a[_0x0a9e('0x89')]()['field'](_0x0a9e('0x4f'));if(!_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8a')]){if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8b')]){if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8b')]==0x1){_0x260f4b['where'](util[_0x0a9e('0x8c')](_0x0a9e('0x8d'),_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')]('`Messages.count`\x20=\x200');}else{_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')]('%s\x20>\x200',_0x48fd45[_0x0a9e('0x84')]()));_0xe401a['having'](_0x0a9e('0x8f'));}}if(_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x90')]){var _0x385d52=_['isArray'](_0x4c1c0e['query'][_0x0a9e('0x90')])?_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x90')]:new Array(_0x4c1c0e['query'][_0x0a9e('0x90')]);var _0x36e975=squel['expr']();_0x385d52['forEach'](function(_0xf0a802){_0x36e975['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf0a802+',%');});_0xe401a['having'](_0x36e975);_0x260f4b['left_join'](_0x0a9e('0x91'),'it',_0x0a9e('0x92'));_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x4e'),'t',_0x0a9e('0x93'));_0x260f4b[_0x0a9e('0x48')]('t.id\x20IN\x20?',_0x385d52);}}else{var _0x5fd5db=JSON['parse'](_0x4c1c0e[_0x0a9e('0x3f')][_0x0a9e('0x8a')]);_[_0x0a9e('0x3e')](_0x5fd5db)[_0x0a9e('0x33')](function(_0x50f8d7){var _0x46c9ac=_0x5fd5db[_0x50f8d7];if(_0x50f8d7===_0x0a9e('0x68')){var _0x1d4877=_0x46c9ac['value'];var _0xb6e411=squel[_0x0a9e('0x5f')]();_0x1d4877[_0x0a9e('0x33')](function(_0x22063c){_0xb6e411['or'](_0x0a9e('0x94'),'%,'+_0x22063c+',%');});_0xe401a[_0x0a9e('0x8e')](_0xb6e411);_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x91'),'it','it.MailInteractionId\x20=\x20i.id');_0x260f4b[_0x0a9e('0x58')](_0x0a9e('0x4e'),'t','t.id\x20=\x20it.TagId');_0x260f4b[_0x0a9e('0x48')](_0x0a9e('0x95'),_0x1d4877);}else if(_0x50f8d7===_0x0a9e('0x69')){if(_0x46c9ac['value'][_0x0a9e('0x43')]===0x1){if(_0x46c9ac['value'][0x0]===0x1){_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')](_0x0a9e('0x8d'),_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')](_0x0a9e('0x96'));}else{_0x260f4b[_0x0a9e('0x48')](util[_0x0a9e('0x8c')]('%s\x20>\x200',_0x48fd45[_0x0a9e('0x84')]()));_0xe401a[_0x0a9e('0x8e')](_0x0a9e('0x8f'));}}}});}db[_0x0a9e('0x97')][_0x0a9e('0x3f')](_0x260f4b[_0x0a9e('0x84')](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x33f0c9){_0x5adda1[_0x0a9e('0x1e')]=_0x33f0c9[_0x0a9e('0x43')];if(_0x5adda1[_0x0a9e('0x1e')]===0x0)return[];return db[_0x0a9e('0x97')][_0x0a9e('0x3f')](_0x138b8b['toString'](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x23e2bd){_0x117c99=_[_0x0a9e('0x98')](_0x23e2bd,'id');_0x2bbdb5=_[_0x0a9e('0x99')](_0x2bbdb5,{'model':db[_0x0a9e('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe401a['field'](_0x0a9e('0x9a'),_0x0a9e('0x9b'));_0xe401a['field'](_0x0a9e('0x87'));_0xe401a['field'](_0x0a9e('0x9c'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x9d'));_0xe401a[_0x0a9e('0x4c')]('i.closed');_0xe401a[_0x0a9e('0x4c')]('i.closedAt');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x9e'));_0xe401a['field'](_0x0a9e('0x9f'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa0'));_0xe401a['field']('i.subject');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa1'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa2'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa3'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa4'));_0xe401a[_0x0a9e('0x4c')]('i.MailAccountId');_0xe401a[_0x0a9e('0x4c')]('i.UserId');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x75'),_0x0a9e('0xa5'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x6e'),'Contact.lastName');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0x6f'),_0x0a9e('0xa6'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa7'),'Contact.phone');_0xe401a['field'](_0x0a9e('0xa8'),'Contact.mobile');_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xa9'),_0x0a9e('0xaa'));_0xe401a[_0x0a9e('0x4c')](_0x0a9e('0xab'),_0x0a9e('0x31'));_0xe401a['left_join']('mail_interaction_has_tags','it',_0x0a9e('0x92'));_0xe401a['left_join'](_0x0a9e('0x4e'),'t','t.id\x20=\x20it.TagId');_0xe401a[_0x0a9e('0x20')](_0x11b61d['limit']);_0xe401a['offset'](_0x11b61d[_0x0a9e('0x1f')]);return db[_0x0a9e('0x97')]['query'](_0xe401a[_0x0a9e('0x84')](),_0x2bbdb5);})[_0x0a9e('0x26')](function(_0x15c6b9){_0x5bbcde[_0x0a9e('0x48')](_0x0a9e('0xac'),_['map'](_0x15c6b9,'id'));return db['sequelize'][_0x0a9e('0x3f')](_0x5bbcde[_0x0a9e('0x84')](),_0x2bbdb5)[_0x0a9e('0x26')](function(_0x24beb6){var _0x59303b=_['groupBy'](_0x24beb6,_0x0a9e('0xad'));var _0xadce3d=[];return db['Setting'][_0x0a9e('0x36')]({'attributes':[_0x0a9e('0xae')],'raw':!![]})[_0x0a9e('0x26')](function(_0x2427d5){var _0x23b25b=_0x2427d5[_0x0a9e('0xae')];_0x15c6b9[_0x0a9e('0x33')](function(_0x476993){_0xadce3d[_0x0a9e('0x34')](updateMailInteraction(_0x476993,_0x117c99,_0x59303b,_0x23b25b));});return BPromise[_0x0a9e('0xaf')](_0xadce3d);});});});})['then'](function(_0x1065a7){_0x5adda1[_0x0a9e('0xb0')]=_0x1065a7;return _0x5adda1;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x546ef8,_0x11b61d))[_0x0a9e('0x3a')](handleError(_0x546ef8,null));};exports[_0x0a9e('0xb1')]=function(_0x547e37,_0x500868){var _0x21902c={'raw':![],'where':{'id':_0x547e37[_0x0a9e('0xb2')]['id']}},_0x16ae1a={};_0x16ae1a[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](db['MailInteraction'][_0x0a9e('0x3c')]);_0x16ae1a[_0x0a9e('0x3f')]=_[_0x0a9e('0x3e')](_0x547e37['query']);_0x16ae1a[_0x0a9e('0x49')]=_['intersection'](_0x16ae1a[_0x0a9e('0x3d')],_0x16ae1a['query']);_0x21902c[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x16ae1a[_0x0a9e('0x3d')],qs['fields'](_0x547e37[_0x0a9e('0x3f')]['fields']));_0x21902c[_0x0a9e('0x42')]=_0x21902c[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x21902c[_0x0a9e('0x42')]:_0x16ae1a[_0x0a9e('0x3d')];if(_0x547e37[_0x0a9e('0x3f')][_0x0a9e('0xb3')]){_0x21902c[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x21902c=_[_0x0a9e('0x99')]({},_0x21902c,_0x547e37[_0x0a9e('0xb5')]);return db[_0x0a9e('0x35')][_0x0a9e('0xb6')](_0x21902c)[_0x0a9e('0x26')](handleEntityNotFound(_0x500868,null))[_0x0a9e('0x26')](respondWithResult(_0x500868,null))[_0x0a9e('0x3a')](handleError(_0x500868,null));};exports[_0x0a9e('0xb7')]=function(_0x5b93dd,_0x556443){return db[_0x0a9e('0x35')]['create'](_0x5b93dd[_0x0a9e('0xb8')],{})[_0x0a9e('0x26')](respondWithResult(_0x556443,0xc9))['catch'](handleError(_0x556443,null));};exports[_0x0a9e('0x25')]=function(_0xe2b083,_0x387bbe){if(_0xe2b083[_0x0a9e('0xb8')]['id']){delete _0xe2b083['body']['id'];}return db[_0x0a9e('0x35')][_0x0a9e('0xb6')]({'where':{'id':_0xe2b083[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x387bbe,null))['then'](saveUpdates(_0xe2b083[_0x0a9e('0xb8')],null))[_0x0a9e('0x26')](respondWithResult(_0x387bbe,null))[_0x0a9e('0x3a')](handleError(_0x387bbe,null));};exports['destroy']=function(_0x2650eb,_0x270df8){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x2650eb[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x270df8,null))[_0x0a9e('0x26')](removeEntity(_0x270df8,null))[_0x0a9e('0x3a')](handleError(_0x270df8,null));};exports[_0x0a9e('0xb9')]=function(_0x555780,_0x3211d2){return db[_0x0a9e('0x35')]['describe']()[_0x0a9e('0x26')](respondWithResult(_0x3211d2,null))[_0x0a9e('0x3a')](handleError(_0x3211d2,null));};exports[_0x0a9e('0xba')]=function(_0x5822a7,_0x5c3b6f,_0x523d08){return db[_0x0a9e('0x2d')][_0x0a9e('0xb6')]({'where':{'id':_0x5822a7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c3b6f,null))[_0x0a9e('0x26')](function(_0x2a8d55){if(_0x2a8d55){return _0x2a8d55['addMessage'](_0x5822a7[_0x0a9e('0xb8')][_0x0a9e('0xbb')],_[_0x0a9e('0xbc')](_0x5822a7[_0x0a9e('0xb8')],[_0x0a9e('0xbb'),'id'])||{});}})[_0x0a9e('0x26')](respondWithResult(_0x5c3b6f,null))[_0x0a9e('0x3a')](handleError(_0x5c3b6f,null));};exports[_0x0a9e('0xbd')]=function(_0x3b5bda,_0x5a1848,_0x43c397){var _0x5526a7={'raw':![],'where':{}};var _0x138cf5={};var _0x4093e6={'count':0x0,'rows':[]};return db[_0x0a9e('0x35')][_0x0a9e('0x36')]({'where':{'id':_0x3b5bda[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a1848,null))['then'](function(_0x1a0314){if(_0x1a0314){_0x138cf5[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x2d')]['rawAttributes']);_0x138cf5[_0x0a9e('0x3f')]=_[_0x0a9e('0x3e')](_0x3b5bda[_0x0a9e('0x3f')]);_0x138cf5[_0x0a9e('0x49')]=_[_0x0a9e('0x40')](_0x138cf5[_0x0a9e('0x3d')],_0x138cf5[_0x0a9e('0x3f')]);_0x5526a7[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x138cf5[_0x0a9e('0x3d')],qs['fields'](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x41')]));_0x5526a7[_0x0a9e('0x42')]=_0x5526a7[_0x0a9e('0x42')][_0x0a9e('0x43')]?_0x5526a7[_0x0a9e('0x42')]:_0x138cf5[_0x0a9e('0x3d')];if(!_0x3b5bda[_0x0a9e('0x3f')]['hasOwnProperty'](_0x0a9e('0x45'))){_0x5526a7[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x3b5bda['query'][_0x0a9e('0x20')]);_0x5526a7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x1f')]);}_0x5526a7[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0x47')]);_0x5526a7[_0x0a9e('0x48')]=qs['filters'](_[_0x0a9e('0x4a')](_0x3b5bda[_0x0a9e('0x3f')],_0x138cf5[_0x0a9e('0x49')]));_0x5526a7[_0x0a9e('0x48')][_0x0a9e('0xad')]=_0x1a0314['id'];if(_0x3b5bda[_0x0a9e('0x3f')]['filter']){_0x5526a7[_0x0a9e('0x48')]=_['merge'](_0x5526a7['where'],{'$or':_['map'](_0x5526a7[_0x0a9e('0x42')],function(_0x3fa3f2){var _0x426cb4={};_0x426cb4[_0x3fa3f2]={'$like':'%'+_0x3b5bda[_0x0a9e('0x3f')]['filter']+'%'};return _0x426cb4;})});}if(_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xbe')]){var _0x3ddbc7=_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xbe')]['split'](',');var _0x57b1b1={};_0x57b1b1[_0x3ddbc7[0x0]]={'$gte':moment(_0x3ddbc7[0x1])[_0x0a9e('0x8c')](_0x0a9e('0xbf'))};_0x5526a7[_0x0a9e('0x48')]=_['merge'](_0x5526a7[_0x0a9e('0x48')],_0x57b1b1);}_0x5526a7=_[_0x0a9e('0x99')]({},_0x5526a7,_0x3b5bda[_0x0a9e('0xb5')]);return db['MailMessage'][_0x0a9e('0x1e')]({'where':_0x5526a7[_0x0a9e('0x48')]})[_0x0a9e('0x26')](function(_0x4eda8f){_0x4093e6[_0x0a9e('0x1e')]=_0x4eda8f;if(_0x3b5bda[_0x0a9e('0x3f')][_0x0a9e('0xb3')]){_0x5526a7['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5526a7);})[_0x0a9e('0x26')](function(_0x1f50db){_0x4093e6[_0x0a9e('0xb0')]=_0x1f50db;return _0x4093e6;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5a1848,_0x5526a7))['catch'](handleError(_0x5a1848,null));};exports[_0x0a9e('0xc0')]=function(_0x532424,_0x3b4af9,_0x2ff2ab){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x532424[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x3b4af9,null))[_0x0a9e('0x26')](function(_0x580dd6){if(_0x580dd6){return _0x580dd6[_0x0a9e('0xc1')](_0x532424['body'][_0x0a9e('0xbb')],_['omit'](_0x532424[_0x0a9e('0xb8')],['ids','id'])||{})[_0x0a9e('0xc2')](function(){return db[_0x0a9e('0xc3')][_0x0a9e('0xc4')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x4d')],'where':{'id':_0x532424[_0x0a9e('0xb8')][_0x0a9e('0xbb')]}});})['then'](function(_0x35ace3){socket[_0x0a9e('0xc5')]('mailInteractionTags:save',{'id':Number(_0x532424[_0x0a9e('0xb2')]['id']),'tags':_0x35ace3||[]});return{'id':Number(_0x532424[_0x0a9e('0xb2')]['id']),'tags':_0x35ace3||[]};});}})['then'](respondWithResult(_0x3b4af9,null))[_0x0a9e('0x3a')](handleError(_0x3b4af9,null));};exports[_0x0a9e('0xc6')]=function(_0x16b578,_0x569528,_0x3766d7){return db[_0x0a9e('0x35')][_0x0a9e('0xb6')]({'where':{'id':_0x16b578[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x569528,null))[_0x0a9e('0x26')](function(_0x3ba897){if(_0x3ba897){return _0x3ba897[_0x0a9e('0xc6')](_0x16b578[_0x0a9e('0x3f')][_0x0a9e('0xbb')]);}})['then'](respondWithStatusCode(_0x569528,null))[_0x0a9e('0x3a')](handleError(_0x569528,null));};exports['download']=function(_0x3c9854,_0x2968e2){var _0x5b9c76=moment()[_0x0a9e('0xc7')]()[_0x0a9e('0x84')]();var _0x2d45db=path['join'](config[_0x0a9e('0xc8')],_0x0a9e('0xc9'),_0x0a9e('0xca'),'attachments');var _0x11e4e3=path[_0x0a9e('0xcb')](config[_0x0a9e('0xc8')],_0x0a9e('0xc9'),_0x0a9e('0xca'),_0x0a9e('0xcc'));var _0x1e93f5=path['join'](_0x11e4e3,_0x5b9c76);var _0x4e1b3=util[_0x0a9e('0x8c')](_0x0a9e('0xcd'),_0x5b9c76);var _0x2ce3be=path[_0x0a9e('0xcb')](_0x11e4e3,_0x4e1b3);var _0x241404=![];return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x3c9854['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2968e2,null))[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929[_0x0a9e('0xbd')]({'attributes':['id',_0x0a9e('0xb8'),_0x0a9e('0x56'),'to','cc',_0x0a9e('0xce'),'subject',_0x0a9e('0x61')],'where':{'secret':![]},'include':_0x3c9854[_0x0a9e('0x3f')][_0x0a9e('0xcf')]?[{'model':db[_0x0a9e('0xd0')],'as':_0x0a9e('0xd1')}]:undefined,'order':qs[_0x0a9e('0x47')]('id')});}return[];})[_0x0a9e('0x26')](function(_0x54f0b8){_0x241404=_0x54f0b8[_0x0a9e('0x43')];if(_0x54f0b8[_0x0a9e('0x43')]){fs[_0x0a9e('0xd2')](_0x1e93f5);return BPromise['each'](_0x54f0b8,function(_0x2b8ad4,_0x387817){var _0x2030cf=_0x2b8ad4;var _0x292f02={'from':_0x2030cf['from'],'to':_0x2030cf['to'],'subject':_0x2030cf[_0x0a9e('0xd3')],'html':_0x2030cf[_0x0a9e('0xb8')],'headers':{'Date':moment(_0x2030cf[_0x0a9e('0x61')])[_0x0a9e('0x8c')](_0x0a9e('0xd4'))},'attachments':[]};if(_0x2b8ad4['cc']){_0x292f02[_0x0a9e('0xd5')]['Cc']=_0x2b8ad4['cc'];}if(_0x2b8ad4[_0x0a9e('0xce')]){_0x292f02[_0x0a9e('0xd5')]['Bcc']=_0x2b8ad4[_0x0a9e('0xce')];}return new BPromise(function(_0x266aa1,_0x25e41f){if(_0x2b8ad4[_0x0a9e('0xd1')]){for(var _0x5f4c6f=0x0;_0x5f4c6f<_0x2b8ad4['Attachments'][_0x0a9e('0x43')];_0x5f4c6f++){var _0x2abe55=_0x2b8ad4[_0x0a9e('0xd1')][_0x5f4c6f];var _0x596ba3=path[_0x0a9e('0xcb')](_0x2d45db,_0x2abe55[_0x0a9e('0xd6')]);if(fs['existsSync'](_0x596ba3)){_0x292f02[_0x0a9e('0xcf')]['push']({'name':_0x2abe55[_0x0a9e('0x29')],'contentType':_0x2abe55['type'],'data':fs['readFileSync'](_0x596ba3)});}}}emlformat['build'](_0x292f02,function(_0xad4d10,_0x4297d1){if(_0xad4d10)return _0x25e41f(_0xad4d10);fs[_0x0a9e('0xd7')](path[_0x0a9e('0xcb')](_0x1e93f5,util[_0x0a9e('0x8c')](_0x0a9e('0xd8'),_0x387817)),_0x4297d1);return _0x266aa1(_0x4297d1);});});});}})['then'](function(){if(_0x241404){return new BPromise(function(_0x5fb7ce,_0x213e5f){zipdir(_0x1e93f5,{'saveTo':_0x2ce3be},function(_0x1713a7,_0xd18f82){if(_0x1713a7)return _0x213e5f(_0x1713a7);return _0x5fb7ce(_0xd18f82);});});}})[_0x0a9e('0x26')](function(){if(_0x241404){return new BPromise(function(_0x18dccf,_0x31c937){rimraf(_0x1e93f5,function(_0x5312fa){if(_0x5312fa)_0x31c937(_0x5312fa);return _0x18dccf();});});}})['then'](function(){if(_0x241404){return _0x2968e2[_0x0a9e('0xd9')](_0x2ce3be,_0x4e1b3,function(_0x5b6edc){if(_0x5b6edc){console[_0x0a9e('0xda')](_0x0a9e('0xdb'),_0x5b6edc);}else{fs[_0x0a9e('0xdc')](_0x2ce3be);}});}else{return _0x2968e2[_0x0a9e('0x1a')](0xc8);}})[_0x0a9e('0x3a')](handleError(_0x2968e2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9b9f657..204a6ce 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 _0xc3ad=['events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x5f29dd,_0x32daf3){var _0x19498a=function(_0x19b1b3){while(--_0x19b1b3){_0x5f29dd['push'](_0x5f29dd['shift']());}};_0x19498a(++_0x32daf3);}(_0xc3ad,0x187));var _0xdc3a=function(_0x1cb02a,_0xcdc9f8){_0x1cb02a=_0x1cb02a-0x0;var _0x527c1c=_0xc3ad[_0x1cb02a];return _0x527c1c;};'use strict';var EventEmitter=require(_0xdc3a('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xdc3a('0x1')];var MailMessage=require(_0xdc3a('0x2'))['db'][_0xdc3a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdc3a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc3a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45e865){return function(_0x3d75de,_0x4eb797,_0x1aeb2e){_0x3d75de[_0xdc3a('0x6')]({'attributes':['id'],'raw':!![]})[_0xdc3a('0x7')](function(_0x4ec027){_0x3d75de[_0xdc3a('0x8')](_0xdc3a('0x9'),_0x4ec027[_0xdc3a('0xa')](function(_0x31914a){return{'id':_0x31914a['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3d75de['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdc3a('0x7')](function(_0x1c9202){_0x3d75de[_0xdc3a('0x8')](_0xdc3a('0xb'),_0x1c9202[_0xdc3a('0xc')]);MailInteractionEvents[_0xdc3a('0xd')](_0x45e865+':'+_0x3d75de['id'],_0x3d75de);MailInteractionEvents[_0xdc3a('0xd')](_0x45e865,_0x3d75de);_0x1aeb2e(null);})['catch'](_0x1aeb2e(null));};}for(var e in events){if(events[_0xdc3a('0xe')](e)){var event=events[e];MailInteraction[_0xdc3a('0xf')](e,emitEvent(event));}}module[_0xdc3a('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xfb5b=['getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x41774f,_0x71ba6f){var _0x30b7c2=function(_0x4e5296){while(--_0x4e5296){_0x41774f['push'](_0x41774f['shift']());}};_0x30b7c2(++_0x71ba6f);}(_0xfb5b,0x7a));var _0xbfb5=function(_0x57054d,_0x3f5d58){_0x57054d=_0x57054d-0x0;var _0x2729fc=_0xfb5b[_0x57054d];return _0x2729fc;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xbfb5('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xbfb5('0x0'))['db'][_0xbfb5('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbfb5('0x2')](0x0);var events={'afterCreate':_0xbfb5('0x3'),'afterUpdate':_0xbfb5('0x4'),'afterDestroy':_0xbfb5('0x5')};function emitEvent(_0x34ba94){return function(_0x4fdfcc,_0x5c369a,_0x32f273){_0x4fdfcc[_0xbfb5('0x6')]({'attributes':['id'],'raw':!![]})[_0xbfb5('0x7')](function(_0xb504f5){_0x4fdfcc['setDataValue'](_0xbfb5('0x8'),_0xb504f5[_0xbfb5('0x9')](function(_0x3c37f4){return{'id':_0x3c37f4['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x4fdfcc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfb5('0x7')](function(_0x5e1e3d){_0x4fdfcc[_0xbfb5('0xa')](_0xbfb5('0xb'),_0x5e1e3d[_0xbfb5('0xc')]);MailInteractionEvents[_0xbfb5('0xd')](_0x34ba94+':'+_0x4fdfcc['id'],_0x4fdfcc);MailInteractionEvents['emit'](_0x34ba94,_0x4fdfcc);_0x32f273(null);})['catch'](_0x32f273(null));};}for(var e in events){if(events[_0xbfb5('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xbfb5('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 9cbf09c..1601c6f 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 _0xd5e2=['YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format'];(function(_0x7ec366,_0x20443c){var _0x19f61f=function(_0xc82c49){while(--_0xc82c49){_0x7ec366['push'](_0x7ec366['shift']());}};_0x19f61f(++_0x20443c);}(_0xd5e2,0x1cb));var _0x2d5e=function(_0x117649,_0x51deae){_0x117649=_0x117649-0x0;var _0x492fcb=_0xd5e2[_0x117649];return _0x492fcb;};'use strict';var _=require('lodash');var util=require(_0x2d5e('0x0'));var logger=require(_0x2d5e('0x1'))('api');var moment=require(_0x2d5e('0x2'));var BPromise=require(_0x2d5e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5e('0x4'));var rimraf=require(_0x2d5e('0x5'));var config=require(_0x2d5e('0x6'));var attributes=require(_0x2d5e('0x7'));module[_0x2d5e('0x8')]=function(_0x3eb736,_0x3c6445){return _0x3eb736[_0x2d5e('0x9')](_0x2d5e('0xa'),attributes,{'tableName':_0x2d5e('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2d5e('0xc'),'to'],'type':_0x2d5e('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x531aa7,_0x50569d,_0x4ad8a5){if(_0x531aa7[_0x2d5e('0xe')]){_0x531aa7[_0x2d5e('0xf')]=moment()[_0x2d5e('0x10')](_0x2d5e('0x11'));}if(_0x531aa7[_0x2d5e('0x12')]){_0x531aa7[_0x2d5e('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4ad8a5(null,_0x50569d);},'beforeUpdate':function(_0x271467,_0x55bd92,_0x107d41){if(_0x271467[_0x2d5e('0x14')]('substatus')){_0x271467['substatusAt']=moment()[_0x2d5e('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x271467['changed'](_0x2d5e('0x12'))){_0x271467['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x107d41(null,_0x271467);},'afterUpdate':function(_0x3daf69,_0x8310a3,_0x125c4f){var _0x31d92d=_0x3eb736[_0x2d5e('0x15')];var _0x18904b=_0x3daf69[_0x2d5e('0x16')]({'plain':!![]});if(_0x18904b['closed']){return _0x31d92d['MailMessage'][_0x2d5e('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x18904b['id']}})[_0x2d5e('0x18')](function(){_0x125c4f();})[_0x2d5e('0x19')](function(_0x41629c){_0x125c4f(_0x41629c);});}else{_0x125c4f();}}},'charset':_0x2d5e('0x1a'),'collate':_0x2d5e('0x1b')});}; \ No newline at end of file +var _0x6292=['mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','closed','models','get','MailMessage','update','then','catch','lodash','util','api','moment','bluebird','rimraf','./mailInteraction.attributes','exports','define','MailInteraction'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6292,0x1ca));var _0x2629=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x6292[_0x202c61];return _0x540691;};'use strict';var _=require(_0x2629('0x0'));var util=require(_0x2629('0x1'));var logger=require('../../config/logger')(_0x2629('0x2'));var moment=require(_0x2629('0x3'));var BPromise=require(_0x2629('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2629('0x5'));var config=require('../../config/environment');var attributes=require(_0x2629('0x6'));module[_0x2629('0x7')]=function(_0xfd0ec4,_0x2fdd1f){return _0xfd0ec4[_0x2629('0x8')](_0x2629('0x9'),attributes,{'tableName':_0x2629('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2629('0xb'),'to'],'type':_0x2629('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b5f97,_0xe0c4e,_0x5ee1a2){if(_0x2b5f97[_0x2629('0xd')]){_0x2b5f97[_0x2629('0xe')]=moment()[_0x2629('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2b5f97['closed']){_0x2b5f97[_0x2629('0x10')]=moment()['format'](_0x2629('0x11'));}_0x5ee1a2(null,_0xe0c4e);},'beforeUpdate':function(_0x20fef7,_0x353dcf,_0x8309aa){if(_0x20fef7[_0x2629('0x12')](_0x2629('0xd'))){_0x20fef7[_0x2629('0xe')]=moment()[_0x2629('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x20fef7[_0x2629('0x12')](_0x2629('0x13'))){_0x20fef7[_0x2629('0x10')]=moment()[_0x2629('0xf')](_0x2629('0x11'));}_0x8309aa(null,_0x20fef7);},'afterUpdate':function(_0x55fb71,_0x3ea858,_0x22e0cd){var _0x5c30b3=_0xfd0ec4[_0x2629('0x14')];var _0xaa30d3=_0x55fb71[_0x2629('0x15')]({'plain':!![]});if(_0xaa30d3[_0x2629('0x13')]){return _0x5c30b3[_0x2629('0x16')][_0x2629('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0xaa30d3['id']}})[_0x2629('0x18')](function(){_0x22e0cd();})[_0x2629('0x19')](function(_0x1fb291){_0x22e0cd(_0x1fb291);});}else{_0x22e0cd();}}},'charset':'utf8mb4','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 f61e8c6..5d9df53 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 _0x55c3=['http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','error','code','message','MailInteraction,\x20%s,\x20%s','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','stringify','catch','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xc71c57,_0x9d9c28){var _0x286d5c=function(_0xd5d3be){while(--_0xd5d3be){_0xc71c57['push'](_0xc71c57['shift']());}};_0x286d5c(++_0x9d9c28);}(_0x55c3,0x189));var _0x355c=function(_0x130c3e,_0x54592a){_0x130c3e=_0x130c3e-0x0;var _0x2b802d=_0x55c3[_0x130c3e];return _0x2b802d;};'use strict';var _=require('lodash');var util=require(_0x355c('0x0'));var moment=require(_0x355c('0x1'));var BPromise=require(_0x355c('0x2'));var rs=require(_0x355c('0x3'));var fs=require('fs');var Redis=require(_0x355c('0x4'));var db=require(_0x355c('0x5'))['db'];var utils=require(_0x355c('0x6'));var logger=require(_0x355c('0x7'))(_0x355c('0x8'));var config=require(_0x355c('0x9'));var jayson=require(_0x355c('0xa'));var client=jayson[_0x355c('0xb')][_0x355c('0xc')]({'port':0x232a});config[_0x355c('0xd')]=_['defaults'](config['redis'],{'host':_0x355c('0xe'),'port':0x18eb});var socket=require(_0x355c('0xf'))(new Redis(config[_0x355c('0xd')]));require(_0x355c('0x10'))[_0x355c('0x11')](socket);function respondWithRpcPromise(_0x3ca52d,_0x4d91bc,_0x12fe87){return new BPromise(function(_0x3cdc28,_0xf40017){return client[_0x355c('0x12')](_0x3ca52d,_0x12fe87)[_0x355c('0x13')](function(_0x386a36){logger[_0x355c('0x14')]('MailInteraction,\x20%s,\x20%s',_0x4d91bc,_0x355c('0x15'));logger[_0x355c('0x16')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4d91bc,_0x355c('0x15'),JSON['stringify'](_0x386a36));if(_0x386a36[_0x355c('0x17')]){if(_0x386a36[_0x355c('0x17')][_0x355c('0x18')]===0x1f4){logger[_0x355c('0x17')]('MailInteraction,\x20%s,\x20%s',_0x4d91bc,_0x386a36[_0x355c('0x17')]['message']);return _0xf40017(_0x386a36['error'][_0x355c('0x19')]);}logger[_0x355c('0x17')](_0x355c('0x1a'),_0x4d91bc,_0x386a36[_0x355c('0x17')][_0x355c('0x19')]);return _0x3cdc28(_0x386a36[_0x355c('0x17')][_0x355c('0x19')]);}else{logger[_0x355c('0x14')](_0x355c('0x1a'),_0x4d91bc,'request\x20sent');_0x3cdc28(_0x386a36[_0x355c('0x1b')][_0x355c('0x19')]);}})['catch'](function(_0x4fabef){logger['error']('MailInteraction,\x20%s,\x20%s',_0x4d91bc,_0x4fabef);_0xf40017(_0x4fabef);});});}exports[_0x355c('0x1c')]=function(_0x11b117){var _0x47839f=this;return new Promise(function(_0x5b1788,_0x42323a){return db[_0x355c('0x1d')][_0x355c('0x1e')](_0x11b117[_0x355c('0x1f')],{'raw':_0x11b117[_0x355c('0x20')]?_0x11b117[_0x355c('0x20')][_0x355c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11b117[_0x355c('0x20')]?_0x11b117['options']['where']||null:null,'attributes':_0x11b117[_0x355c('0x20')]?_0x11b117[_0x355c('0x20')][_0x355c('0x22')]||null:null,'limit':_0x11b117['options']?_0x11b117[_0x355c('0x20')]['limit']||null:null})[_0x355c('0x13')](function(_0x285c0b){logger[_0x355c('0x14')](_0x355c('0x1c'),_0x11b117);logger[_0x355c('0x16')]('UpdateMailInteraction',_0x11b117,JSON[_0x355c('0x23')](_0x285c0b));_0x5b1788(_0x285c0b);})[_0x355c('0x24')](function(_0x37ac93){logger[_0x355c('0x17')](_0x355c('0x1c'),_0x37ac93['message'],_0x11b117);_0x42323a(_0x47839f[_0x355c('0x17')](0x1f4,_0x37ac93['message']));});});};exports[_0x355c('0x25')]=function(_0x1b3623){return new Promise(function(_0x44d033,_0x2ba985){return db[_0x355c('0x1d')][_0x355c('0x26')]({'where':_0x1b3623[_0x355c('0x20')]?_0x1b3623['options'][_0x355c('0x27')]||null:null})[_0x355c('0x13')](function(_0xe3acb0){if(_0xe3acb0){return _0xe3acb0[_0x355c('0x28')](_0x1b3623[_0x355c('0x1f')][_0x355c('0x29')],_[_0x355c('0x2a')](_0x1b3623[_0x355c('0x1f')],['ids','id'])||{});}})[_0x355c('0x2b')](function(_0x299e7c){logger[_0x355c('0x14')]('AddTags',_0x1b3623);logger[_0x355c('0x16')]('AddTags',_0x1b3623,JSON[_0x355c('0x23')](_0x299e7c));_0x44d033(_0x299e7c);})[_0x355c('0x24')](function(_0x8fb348){logger['error'](_0x355c('0x2c'),_0x8fb348[_0x355c('0x19')],_0x1b3623);_0x2ba985(_this['error'](0x1f4,_0x8fb348[_0x355c('0x19')]));});});}; \ No newline at end of file +var _0x0309=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','options','attributes','limit','info','stringify','find','where','addTags','body','ids','omit','AddTags','lodash','util','moment'];(function(_0x14d0d7,_0x32df52){var _0x36da65=function(_0x1b1839){while(--_0x1b1839){_0x14d0d7['push'](_0x14d0d7['shift']());}};_0x36da65(++_0x32df52);}(_0x0309,0x8d));var _0x9030=function(_0x5011d3,_0x2dfb2a){_0x5011d3=_0x5011d3-0x0;var _0x3c2fd6=_0x0309[_0x5011d3];return _0x3c2fd6;};'use strict';var _=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rs=require(_0x9030('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9030('0x5'))['db'];var utils=require(_0x9030('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9030('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9030('0x8')]=_['defaults'](config[_0x9030('0x8')],{'host':_0x9030('0x9'),'port':0x18eb});var socket=require(_0x9030('0xa'))(new Redis(config[_0x9030('0x8')]));require(_0x9030('0xb'))[_0x9030('0xc')](socket);function respondWithRpcPromise(_0xb0553f,_0x3e50f3,_0xae80e0){return new BPromise(function(_0x56d7cb,_0xa4a3b){return client['request'](_0xb0553f,_0xae80e0)[_0x9030('0xd')](function(_0x36836b){logger['info'](_0x9030('0xe'),_0x3e50f3,'request\x20sent');logger[_0x9030('0xf')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3e50f3,_0x9030('0x10'),JSON['stringify'](_0x36836b));if(_0x36836b[_0x9030('0x11')]){if(_0x36836b[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('MailInteraction,\x20%s,\x20%s',_0x3e50f3,_0x36836b['error']['message']);return _0xa4a3b(_0x36836b['error'][_0x9030('0x13')]);}logger[_0x9030('0x11')]('MailInteraction,\x20%s,\x20%s',_0x3e50f3,_0x36836b[_0x9030('0x11')][_0x9030('0x13')]);return _0x56d7cb(_0x36836b['error'][_0x9030('0x13')]);}else{logger['info'](_0x9030('0xe'),_0x3e50f3,'request\x20sent');_0x56d7cb(_0x36836b['result'][_0x9030('0x13')]);}})[_0x9030('0x14')](function(_0x2c020a){logger[_0x9030('0x11')](_0x9030('0xe'),_0x3e50f3,_0x2c020a);_0xa4a3b(_0x2c020a);});});}exports[_0x9030('0x15')]=function(_0x3207ad){var _0x4a2551=this;return new Promise(function(_0x19ef2a,_0x3e0d21){return db[_0x9030('0x16')][_0x9030('0x17')](_0x3207ad['body'],{'raw':_0x3207ad[_0x9030('0x18')]?_0x3207ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3207ad[_0x9030('0x18')]?_0x3207ad[_0x9030('0x18')]['where']||null:null,'attributes':_0x3207ad[_0x9030('0x18')]?_0x3207ad[_0x9030('0x18')][_0x9030('0x19')]||null:null,'limit':_0x3207ad[_0x9030('0x18')]?_0x3207ad[_0x9030('0x18')][_0x9030('0x1a')]||null:null})[_0x9030('0xd')](function(_0x180d1e){logger[_0x9030('0x1b')](_0x9030('0x15'),_0x3207ad);logger[_0x9030('0xf')]('UpdateMailInteraction',_0x3207ad,JSON[_0x9030('0x1c')](_0x180d1e));_0x19ef2a(_0x180d1e);})[_0x9030('0x14')](function(_0x5864e1){logger[_0x9030('0x11')]('UpdateMailInteraction',_0x5864e1[_0x9030('0x13')],_0x3207ad);_0x3e0d21(_0x4a2551[_0x9030('0x11')](0x1f4,_0x5864e1[_0x9030('0x13')]));});});};exports['AddTagsToMailInteraction']=function(_0x41328e){return new Promise(function(_0x5ee798,_0x4ab6d4){return db[_0x9030('0x16')][_0x9030('0x1d')]({'where':_0x41328e[_0x9030('0x18')]?_0x41328e['options'][_0x9030('0x1e')]||null:null})['then'](function(_0x494a77){if(_0x494a77){return _0x494a77[_0x9030('0x1f')](_0x41328e[_0x9030('0x20')][_0x9030('0x21')],_[_0x9030('0x22')](_0x41328e['body'],[_0x9030('0x21'),'id'])||{});}})['spread'](function(_0x40dd56){logger[_0x9030('0x1b')](_0x9030('0x23'),_0x41328e);logger[_0x9030('0xf')]('AddTags',_0x41328e,JSON['stringify'](_0x40dd56));_0x5ee798(_0x40dd56);})[_0x9030('0x14')](function(_0x52ff29){logger[_0x9030('0x11')](_0x9030('0x23'),_0x52ff29[_0x9030('0x13')],_0x41328e);_0x4ab6d4(_this[_0x9030('0x11')](0x1f4,_0x52ff29[_0x9030('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index dcefada..4340858 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 _0x7a75=['register','mailInteraction:','save','remove','emit','removeListener'];(function(_0x1e02d6,_0xcf046c){var _0x4f1232=function(_0x1432d4){while(--_0x1432d4){_0x1e02d6['push'](_0x1e02d6['shift']());}};_0x4f1232(++_0xcf046c);}(_0x7a75,0x14c));var _0x57a7=function(_0x2c2cf2,_0x3f15ba){_0x2c2cf2=_0x2c2cf2-0x0;var _0x4a3724=_0x7a75[_0x2c2cf2];return _0x4a3724;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x57a7('0x0'),_0x57a7('0x1'),'update'];function createListener(_0x3f12c1,_0x5efe95){return function(_0x4c38f7){_0x5efe95[_0x57a7('0x2')](_0x3f12c1,_0x4c38f7);};}function removeListener(_0xb3368b,_0x2a5dbd){return function(){MailInteractionEvents[_0x57a7('0x3')](_0xb3368b,_0x2a5dbd);};}exports[_0x57a7('0x4')]=function(_0x5db2ed){for(var _0x5df601=0x0,_0x4c2ab0=events['length'];_0x5df601<_0x4c2ab0;_0x5df601++){var _0x1b2e57=events[_0x5df601];var _0x501d97=createListener(_0x57a7('0x5')+_0x1b2e57,_0x5db2ed);MailInteractionEvents['on'](_0x1b2e57,_0x501d97);}}; \ No newline at end of file +var _0x6cfd=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x361e5d,_0x15e1a4){var _0x4c303d=function(_0x504f9f){while(--_0x504f9f){_0x361e5d['push'](_0x361e5d['shift']());}};_0x4c303d(++_0x15e1a4);}(_0x6cfd,0x112));var _0xd6cf=function(_0x1a2021,_0x1c1228){_0x1a2021=_0x1a2021-0x0;var _0x16fa06=_0x6cfd[_0x1a2021];return _0x16fa06;};'use strict';var MailInteractionEvents=require(_0xd6cf('0x0'));var events=[_0xd6cf('0x1'),_0xd6cf('0x2'),_0xd6cf('0x3')];function createListener(_0x4a922c,_0x32a357){return function(_0x1c5e1f){_0x32a357[_0xd6cf('0x4')](_0x4a922c,_0x1c5e1f);};}function removeListener(_0x2e831a,_0x3a0304){return function(){MailInteractionEvents[_0xd6cf('0x5')](_0x2e831a,_0x3a0304);};}exports['register']=function(_0x5b4a93){for(var _0x3a15c5=0x0,_0x5d7d26=events[_0xd6cf('0x6')];_0x3a15c5<_0x5d7d26;_0x3a15c5++){var _0x4d3399=events[_0x3a15c5];var _0x133839=createListener(_0xd6cf('0x7')+_0x4d3399,_0x5b4a93);MailInteractionEvents['on'](_0x4d3399,_0x133839);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index cb5737b..1f2f03e 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a8=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mail','create','update','accept','put','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x98a8,0x12c));var _0x898a=function(_0x5173d9,_0x3360d1){_0x5173d9=_0x5173d9-0x0;var _0x4b9bdc=_0x98a8[_0x5173d9];return _0x4b9bdc;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x12')]('/',auth[_0x898a('0xa')](),interaction['tracked'](_0x898a('0x13'),'mailmessage:create'),controller[_0x898a('0x14')]);router['put'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x898a('0x16')]);router[_0x898a('0x17')](_0x898a('0x18'),auth[_0x898a('0xa')](),controller[_0x898a('0x19')]);router[_0x898a('0x1a')]('/:id',auth[_0x898a('0xa')](),controller['destroy']);module[_0x898a('0x1b')]=router; \ No newline at end of file +var _0x5075=['download','tracked','mailmessage:create','create','update','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','/describe','describe','/:id','/:id/download','isAuthenticated'];(function(_0x15395b,_0x44af7e){var _0x56ba81=function(_0x1086f4){while(--_0x1086f4){_0x15395b['push'](_0x15395b['shift']());}};_0x56ba81(++_0x44af7e);}(_0x5075,0x73));var _0x5507=function(_0x28bef9,_0x28e8d6){_0x28bef9=_0x28bef9-0x0;var _0x45db81=_0x5075[_0x28bef9];return _0x45db81;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var auth=require(_0x5507('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5507('0x7'));var controller=require(_0x5507('0x8'));router[_0x5507('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5507('0x9')](_0x5507('0xa'),auth['isAuthenticated'](),controller[_0x5507('0xb')]);router[_0x5507('0x9')](_0x5507('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5507('0x9')](_0x5507('0xd'),auth[_0x5507('0xe')](),controller[_0x5507('0xf')]);router['post']('/',auth[_0x5507('0xe')](),interaction[_0x5507('0x10')]('mail',_0x5507('0x11')),controller[_0x5507('0x12')]);router['put'](_0x5507('0xc'),auth[_0x5507('0xe')](),controller[_0x5507('0x13')]);router[_0x5507('0x14')](_0x5507('0x15'),auth[_0x5507('0xe')](),controller['accept']);router[_0x5507('0x14')](_0x5507('0x16'),auth[_0x5507('0xe')](),controller[_0x5507('0x17')]);router['delete'](_0x5507('0xc'),auth[_0x5507('0xe')](),controller[_0x5507('0x18')]);module[_0x5507('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 3b51cda..cd9809f 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 _0x97f4=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','sequelize','lodash'];(function(_0x30d49d,_0x462622){var _0x387115=function(_0x506903){while(--_0x506903){_0x30d49d['push'](_0x30d49d['shift']());}};_0x387115(++_0x462622);}(_0x97f4,0x166));var _0x497f=function(_0x54d7bd,_0x54cf67){_0x54d7bd=_0x54d7bd-0x0;var _0x5aa862=_0x97f4[_0x54d7bd];return _0x5aa862;};'use strict';var Sequelize=require(_0x497f('0x0'));var _=require(_0x497f('0x1'));module[_0x497f('0x2')]={'body':{'type':Sequelize[_0x497f('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x4'))},'read':{'type':Sequelize[_0x497f('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x497f('0x6')]('in',_0x497f('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x497f('0x8')]},'to':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x9'))},'cc':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x9'))},'bcc':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x497f('0xa')]},'attach':{'type':Sequelize[_0x497f('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x9'))},'originCc':{'type':Sequelize[_0x497f('0x3')](_0x497f('0x9'))}}; \ No newline at end of file +var _0x6267=['BOOLEAN','ENUM','out','STRING','INTEGER','DATE','lodash','TEXT','long'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6267,0x1ec));var _0x7626=function(_0x17768b,_0x277f25){_0x17768b=_0x17768b-0x0;var _0x10af54=_0x6267[_0x17768b];return _0x10af54;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7626('0x0'));module['exports']={'body':{'type':Sequelize[_0x7626('0x1')](_0x7626('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7626('0x1')]('medium')},'read':{'type':Sequelize[_0x7626('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7626('0x4')]('in','out'),'defaultValue':_0x7626('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7626('0x6')](0x1fe)},'from':{'type':Sequelize[_0x7626('0x6')]},'to':{'type':Sequelize[_0x7626('0x1')](_0x7626('0x2'))},'cc':{'type':Sequelize[_0x7626('0x1')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x7626('0x2'))},'subject':{'type':Sequelize[_0x7626('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x7626('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7626('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7626('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x7626('0x1')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 931539e..cd2802f 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 _0x767f=['existsSync','readFileSync','writeFileSync','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./mailMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','map','type','VIRTUAL','merge','MailMessage','count','includeAll','include','findAll','rows','show','params','options','find','body','destroy','describe','create','direction','out','secret','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','authentication','auth','pass','secure','attachments','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','mail','read','UserId','user','CmContact','Contact','MailInteraction','MailInteractionId','read1stAt','interaction','get','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','reject','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','download','unix','join','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','headers','bcc','Bcc'];(function(_0x5b8097,_0x1f4314){var _0x2207b8=function(_0x4b59a3){while(--_0x4b59a3){_0x5b8097['push'](_0x5b8097['shift']());}};_0x2207b8(++_0x1f4314);}(_0x767f,0x144));var _0xf767=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x767f[_0x2235bf];return _0x4c3a64;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf767('0x0'));var rimraf=require(_0xf767('0x1'));var zipdir=require(_0xf767('0x2'));var jsonpatch=require(_0xf767('0x3'));var rp=require('request-promise');var moment=require(_0xf767('0x4'));var BPromise=require(_0xf767('0x5'));var Mustache=require('mustache');var util=require(_0xf767('0x6'));var path=require(_0xf767('0x7'));var sox=require('sox');var csv=require(_0xf767('0x8'));var ejs=require(_0xf767('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf767('0xa'));var deskjs=require(_0xf767('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf767('0xc'));var Redis=require(_0xf767('0xd'));var authService=require(_0xf767('0xe'));var qs=require(_0xf767('0xf'));var hardwareService=require(_0xf767('0x10'));var logger=require(_0xf767('0x11'))(_0xf767('0x12'));var utils=require('../../config/utils');var config=require(_0xf767('0x13'));var db=require(_0xf767('0x14'))['db'];config[_0xf767('0x15')]=_[_0xf767('0x16')](config[_0xf767('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf767('0x15')]));require(_0xf767('0x17'))[_0xf767('0x18')](socket);var jayson=require(_0xf767('0x19'));var client=jayson[_0xf767('0x1a')][_0xf767('0x1b')]({'port':0x232c});var client9003=jayson['client'][_0xf767('0x1b')]({'port':0x232b});var client9002=jayson[_0xf767('0x1a')][_0xf767('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x589f6b,_0x42f3b9,_0x11130f){if(_0x11130f){var _0x2d8a76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d8a76['test'](_0x42f3b9)){return _0x589f6b;}else{throw new Error(_0xf767('0x1c'));}}else{return _0x589f6b;}}function respondWithRpcPromise(_0x2075a7,_0x553a79,_0x18a625,_0x15c348){return new BPromise(function(_0x5b0f17,_0x12746f){var _0x2043f6=_0x15c348||client;return _0x2043f6['request'](_0x2075a7,_0x18a625)[_0xf767('0x1d')](function(_0x483a14){logger[_0xf767('0x1e')](_0xf767('0x1f'),_0x553a79,_0xf767('0x20'));logger[_0xf767('0x21')](_0xf767('0x22'),_0x553a79,_0xf767('0x20'),JSON[_0xf767('0x23')](_0x483a14));if(_0x483a14[_0xf767('0x24')]){if(_0x483a14[_0xf767('0x24')][_0xf767('0x25')]===0x1f4){logger[_0xf767('0x24')]('MailMessage,\x20%s,\x20%s',_0x553a79,_0x483a14[_0xf767('0x24')][_0xf767('0x26')]);return _0x12746f(_0x483a14[_0xf767('0x24')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x553a79,_0x483a14[_0xf767('0x24')][_0xf767('0x26')]);return _0x5b0f17(_0x483a14[_0xf767('0x24')]['message']);}else{logger['info'](_0xf767('0x1f'),_0x553a79,'request\x20sent');_0x5b0f17(_0x483a14['result']['message']);}})[_0xf767('0x27')](function(_0x42d6a8){logger['error'](_0xf767('0x1f'),_0x553a79,_0x42d6a8);_0x12746f(_0x42d6a8);});});}function respondWithStatusCode(_0x31acdc,_0x108694){_0x108694=_0x108694||0xcc;return function(_0x19a13e){if(_0x19a13e){return _0x31acdc[_0xf767('0x28')](_0x108694);}return _0x31acdc[_0xf767('0x29')](_0x108694)['end']();};}function respondWithResult(_0x362803,_0x27956c){_0x27956c=_0x27956c||0xc8;return function(_0x4c5993){if(_0x4c5993){return _0x362803['status'](_0x27956c)[_0xf767('0x2a')](_0x4c5993);}};}function respondWithFilteredResult(_0x306b10,_0x3a7910){return function(_0x3f7d74){if(_0x3f7d74){var _0x5d1249=_0x3f7d74['count'],_0x12e17f=_0x3a7910[_0xf767('0x2b')],_0xbee49b=_0x3a7910[_0xf767('0x2b')]+_0x3a7910[_0xf767('0x2c')],_0xd44c4;if(_0xbee49b>=_0x5d1249){_0xbee49b=_0x5d1249;_0xd44c4=0xc8;}else{_0xd44c4=0xce;}_0x306b10[_0xf767('0x29')](_0xd44c4);return _0x306b10[_0xf767('0x2d')](_0xf767('0x2e'),_0x12e17f+'-'+_0xbee49b+'/'+_0x5d1249)[_0xf767('0x2a')](_0x3f7d74);}return null;};}function patchUpdates(_0x319ccb){return function(_0x59657e){try{jsonpatch[_0xf767('0x2f')](_0x59657e,_0x319ccb,!![]);}catch(_0x59219f){return BPromise['reject'](_0x59219f);}return _0x59657e[_0xf767('0x30')]();};}function saveUpdates(_0x177901,_0x4d505c){return function(_0x55a3ae){if(_0x55a3ae){return _0x55a3ae[_0xf767('0x31')](_0x177901)['then'](function(_0x3e5ec2){return _0x3e5ec2;});}return null;};}function removeEntity(_0x3b17ff,_0x2e3d50){return function(_0x111d23){if(_0x111d23){return _0x111d23['destroy']()['then'](function(){_0x3b17ff[_0xf767('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ce38,_0x4a96f7){return function(_0xdccbc1){if(!_0xdccbc1){_0x29ce38[_0xf767('0x28')](0x194);}return _0xdccbc1;};}function handleError(_0x14fb48,_0x22bb3c){_0x22bb3c=_0x22bb3c||0x1f4;return function(_0x227711){logger[_0xf767('0x24')](_0x227711[_0xf767('0x32')]);if(_0x227711[_0xf767('0x33')]){delete _0x227711['name'];}_0x14fb48[_0xf767('0x29')](_0x22bb3c)[_0xf767('0x34')](_0x227711);};}exports[_0xf767('0x35')]=function(_0x327852,_0x337fbd){var _0x5e48cc={},_0x192c65={},_0x25c08e={'count':0x0,'rows':[]};var _0x2e5a93=db['MailMessage'][_0xf767('0x36')];_0x192c65[_0xf767('0x37')]=_[_0xf767('0x38')](_0x2e5a93);_0x192c65[_0xf767('0x39')]=_['keys'](_0x327852[_0xf767('0x39')]);_0x192c65[_0xf767('0x3a')]=_['intersection'](_0x192c65[_0xf767('0x37')],_0x192c65[_0xf767('0x39')]);_0x5e48cc[_0xf767('0x3b')]=_[_0xf767('0x3c')](_0x192c65[_0xf767('0x37')],qs[_0xf767('0x3d')](_0x327852[_0xf767('0x39')][_0xf767('0x3d')]));_0x5e48cc[_0xf767('0x3b')]=_0x5e48cc[_0xf767('0x3b')][_0xf767('0x3e')]?_0x5e48cc[_0xf767('0x3b')]:_0x192c65[_0xf767('0x37')];if(!_0x327852['query'][_0xf767('0x3f')](_0xf767('0x40'))){_0x5e48cc[_0xf767('0x2c')]=qs['limit'](_0x327852['query']['limit']);_0x5e48cc[_0xf767('0x2b')]=qs[_0xf767('0x2b')](_0x327852[_0xf767('0x39')]['offset']);}_0x5e48cc['order']=qs['sort'](_0x327852['query']['sort']);_0x5e48cc[_0xf767('0x41')]=qs[_0xf767('0x3a')](_[_0xf767('0x42')](_0x327852[_0xf767('0x39')],_0x192c65[_0xf767('0x3a')]));if(_0x327852[_0xf767('0x39')][_0xf767('0x43')]){_0x5e48cc[_0xf767('0x41')]=_['merge'](_0x5e48cc[_0xf767('0x41')],{'$or':_[_0xf767('0x44')](_0x2e5a93,function(_0x3b1906){if(_0x3b1906[_0xf767('0x45')]['key']!==_0xf767('0x46')){var _0x4d97a1={};_0x4d97a1[_0x3b1906['field']]={'$like':'%'+_0x327852[_0xf767('0x39')][_0xf767('0x43')]+'%'};return _0x4d97a1;}})});}_0x5e48cc=_[_0xf767('0x47')]({},_0x5e48cc,_0x327852['options']);var _0x2237b8={'where':_0x5e48cc['where']};return db[_0xf767('0x48')][_0xf767('0x49')](_0x2237b8)[_0xf767('0x1d')](function(_0x2b7a5d){_0x25c08e[_0xf767('0x49')]=_0x2b7a5d;if(_0x327852[_0xf767('0x39')][_0xf767('0x4a')]){_0x5e48cc[_0xf767('0x4b')]=[{'all':!![]}];}return db[_0xf767('0x48')][_0xf767('0x4c')](_0x5e48cc);})[_0xf767('0x1d')](function(_0x54b289){_0x25c08e[_0xf767('0x4d')]=_0x54b289;return _0x25c08e;})[_0xf767('0x1d')](respondWithFilteredResult(_0x337fbd,_0x5e48cc))['catch'](handleError(_0x337fbd,null));};exports[_0xf767('0x4e')]=function(_0x2ec2ba,_0x28b782){var _0x1dc1b0={'raw':!![],'where':{'id':_0x2ec2ba[_0xf767('0x4f')]['id']}},_0x4562d2={};_0x4562d2['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x4562d2[_0xf767('0x39')]=_['keys'](_0x2ec2ba[_0xf767('0x39')]);_0x4562d2[_0xf767('0x3a')]=_[_0xf767('0x3c')](_0x4562d2[_0xf767('0x37')],_0x4562d2['query']);_0x1dc1b0['attributes']=_['intersection'](_0x4562d2[_0xf767('0x37')],qs[_0xf767('0x3d')](_0x2ec2ba[_0xf767('0x39')]['fields']));_0x1dc1b0[_0xf767('0x3b')]=_0x1dc1b0[_0xf767('0x3b')][_0xf767('0x3e')]?_0x1dc1b0[_0xf767('0x3b')]:_0x4562d2[_0xf767('0x37')];if(_0x2ec2ba[_0xf767('0x39')][_0xf767('0x4a')]){_0x1dc1b0[_0xf767('0x4b')]=[{'all':!![]}];}_0x1dc1b0=_['merge']({},_0x1dc1b0,_0x2ec2ba[_0xf767('0x50')]);return db[_0xf767('0x48')][_0xf767('0x51')](_0x1dc1b0)['then'](handleEntityNotFound(_0x28b782,null))[_0xf767('0x1d')](respondWithResult(_0x28b782,null))[_0xf767('0x27')](handleError(_0x28b782,null));};exports[_0xf767('0x31')]=function(_0x354c16,_0x34d279){if(_0x354c16[_0xf767('0x52')]['id']){delete _0x354c16['body']['id'];}return db[_0xf767('0x48')]['find']({'where':{'id':_0x354c16[_0xf767('0x4f')]['id']}})[_0xf767('0x1d')](handleEntityNotFound(_0x34d279,null))[_0xf767('0x1d')](saveUpdates(_0x354c16[_0xf767('0x52')],null))['then'](respondWithResult(_0x34d279,null))[_0xf767('0x27')](handleError(_0x34d279,null));};exports[_0xf767('0x53')]=function(_0x190cd9,_0x42772f){return db['MailMessage'][_0xf767('0x51')]({'where':{'id':_0x190cd9[_0xf767('0x4f')]['id']}})[_0xf767('0x1d')](handleEntityNotFound(_0x42772f,null))['then'](removeEntity(_0x42772f,null))[_0xf767('0x27')](handleError(_0x42772f,null));};exports[_0xf767('0x54')]=function(_0x374deb,_0x39b6b1){return db[_0xf767('0x48')][_0xf767('0x54')]()[_0xf767('0x1d')](respondWithResult(_0x39b6b1,null))['catch'](handleError(_0x39b6b1,null));};exports[_0xf767('0x55')]=function(_0x106adf,_0x865f42){return db[_0xf767('0x48')]['create'](_0x106adf['body'])['then'](function(_0x5eeed8){if(_0x5eeed8){if(_0x5eeed8[_0xf767('0x56')]===_0xf767('0x57')&&!_0x5eeed8[_0xf767('0x58')]){return db['MailAccount'][_0xf767('0x59')]({'where':{'id':_0x5eeed8[_0xf767('0x5a')]},'include':[{'model':db[_0xf767('0x5b')],'as':_0xf767('0x5c'),'raw':!![]}]})[_0xf767('0x1d')](function(_0x201206){if(_0x201206&&_0x201206['Smtp']){var _0x3b0b8c={'tls':{'rejectUnauthorized':![]}};if(_[_0xf767('0x5d')](_0x201206[_0xf767('0x5c')][_0xf767('0x5e')])){_0x3b0b8c['host']=_0x201206['Smtp'][_0xf767('0x5f')];_0x3b0b8c[_0xf767('0x60')]=_0x201206['Smtp'][_0xf767('0x60')];_0x3b0b8c['secure']=_0x201206[_0xf767('0x5c')]['secure'];if(_0x201206[_0xf767('0x5c')][_0xf767('0x61')]){_0x3b0b8c[_0xf767('0x62')]={'user':_0x201206[_0xf767('0x5c')]['user'],'pass':_0x201206[_0xf767('0x5c')]['pass']};}}else{_0x3b0b8c[_0xf767('0x5e')]=_0x201206['Smtp'][_0xf767('0x5e')];_0x3b0b8c[_0xf767('0x62')]={'user':_0x201206[_0xf767('0x5c')]['user'],'pass':_0x201206[_0xf767('0x5c')][_0xf767('0x63')]};_0x3b0b8c[_0xf767('0x64')]=_0x201206['Smtp'][_0xf767('0x64')];}if(_0x106adf[_0xf767('0x52')][_0xf767('0x65')]&&_0x106adf[_0xf767('0x52')][_0xf767('0x65')][_0xf767('0x3e')]){for(var _0x2405b9=0x0;_0x2405b9<_0x106adf[_0xf767('0x52')][_0xf767('0x65')][_0xf767('0x3e')];_0x2405b9+=0x1){_0x106adf[_0xf767('0x52')]['attachments'][_0x2405b9]={'filename':_0x106adf[_0xf767('0x52')][_0xf767('0x65')][_0x2405b9][_0xf767('0x33')],'path':path['join'](config[_0xf767('0x66')],_0xf767('0x67'),_0x106adf[_0xf767('0x52')][_0xf767('0x65')][_0x2405b9][_0xf767('0x68')])};}}return{'account':_0x3b0b8c,'message':_0x106adf[_0xf767('0x52')]};}})[_0xf767('0x1d')](function(_0xb1b951){if(_0xb1b951){return respondWithRpcPromise(_0xf767('0x69'),_0xf767('0x6a'),_0xb1b951,client9003)[_0xf767('0x1d')](function(_0x1b5710){return _0x5eeed8[_0xf767('0x31')]({'read':!![],'messageId':_0x1b5710[_0xf767('0x6b')],'sentAt':moment()[_0xf767('0x6c')](_0xf767('0x6d'))});})[_0xf767('0x27')](function(_0x3c55a3){logger['error']('%s',JSON[_0xf767('0x23')](_0x3c55a3));return _0x5eeed8;});}return _0x5eeed8;});}return _0x5eeed8;}})['then'](respondWithResult(_0x865f42,0xc9))[_0xf767('0x27')](handleError(_0x865f42,null));};var interaction_log=require(_0xf767('0x11'))(_0xf767('0x6e'));exports['accept']=function(_0x3d70a0,_0x376189,_0x3716bb){var _0x3526fb={'channel':_0xf767('0x6f')};if(_0x3d70a0['body']['id']){delete _0x3d70a0[_0xf767('0x52')]['id'];}_0x3d70a0['body'][_0xf767('0x70')]=!![];_0x3d70a0[_0xf767('0x52')]['readAt']=moment()['format'](_0xf767('0x6d'));_0x3d70a0[_0xf767('0x52')][_0xf767('0x71')]=_0x3d70a0[_0xf767('0x52')][_0xf767('0x71')]||_0x3d70a0[_0xf767('0x72')]['id'];return db[_0xf767('0x48')][_0xf767('0x51')]({'where':{'id':_0x3d70a0[_0xf767('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xf767('0x73')],'as':_0xf767('0x74')}]})['then'](handleEntityNotFound(_0x376189,null))[_0xf767('0x1d')](saveUpdates(_0x3d70a0[_0xf767('0x52')],null))['then'](function(_0xe855a4){if(_0xe855a4){_0x3526fb[_0xf767('0x26')]=_0xe855a4['get']({'plain':!![]});return db[_0xf767('0x75')][_0xf767('0x51')]({'where':{'id':_0xe855a4[_0xf767('0x76')]}});}return null;})[_0xf767('0x1d')](handleEntityNotFound(_0x376189,null))['then'](function(_0x523c48){if(_0x523c48){return _0x523c48[_0xf767('0x31')]({'UserId':_0x3d70a0[_0xf767('0x52')][_0xf767('0x71')],'read1stAt':_[_0xf767('0x5d')](_0x523c48[_0xf767('0x77')])?moment()[_0xf767('0x6c')](_0xf767('0x6d')):undefined});}return null;})[_0xf767('0x1d')](function(_0x32c3d7){if(_0x32c3d7){_0x3526fb[_0xf767('0x78')]=_0x32c3d7[_0xf767('0x79')]({'plain':!![]});interaction_log[_0xf767('0x1e')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d70a0['user']['id'],_0x3d70a0[_0xf767('0x72')][_0xf767('0x33')],_0x3d70a0['user'][_0xf767('0x7a')],_0x3526fb[_0xf767('0x78')]['id'],_0x3d70a0['body']?JSON['stringify'](_0x3d70a0[_0xf767('0x52')]):'null');return respondWithRpcPromise(_0xf767('0x7b'),_0xf767('0x7c'),_0x3526fb);}return null;})[_0xf767('0x1d')](function(_0x5e6609){if(_0x5e6609){if(_0x3d70a0[_0xf767('0x52')][_0xf767('0x7d')]){_0x3526fb['message'][_0xf767('0x7e')]=util[_0xf767('0x6c')](_0xf767('0x7f'),_0x3d70a0['user'][_0xf767('0x33')]);_0x3526fb[_0xf767('0x26')][_0xf767('0x80')]=_0x3526fb[_0xf767('0x80')];_0x3526fb['message'][_0xf767('0x81')]=_0xf767('0x82');return respondWithRpcPromise('EventManager',_0xf767('0x83'),{'event':_0xf767('0x84'),'message':_0x3526fb['message']},client9002)[_0xf767('0x1d')](function(){return _0x3526fb;});}return _0x3526fb;}return null;})[_0xf767('0x1d')](respondWithResult(_0x376189,null))['catch'](handleError(_0x376189,null));};var interaction_log=require(_0xf767('0x11'))(_0xf767('0x6e'));exports[_0xf767('0x85')]=function(_0x339544,_0x311691,_0x110d76){var _0x381f43={'agent':{},'channel':'mail'};if(_0x339544['body']['id']){delete _0x339544[_0xf767('0x52')]['id'];}_0x339544['body'][_0xf767('0x71')]=_0x339544['body'][_0xf767('0x71')]||_0x339544[_0xf767('0x72')]['id'];_0x381f43[_0xf767('0x86')]['id']=_0x339544[_0xf767('0x52')][_0xf767('0x71')];return db[_0xf767('0x48')][_0xf767('0x51')]({'where':{'id':_0x339544[_0xf767('0x4f')]['id'],'UserId':null}})[_0xf767('0x1d')](handleEntityNotFound(_0x311691,null))[_0xf767('0x1d')](function(_0xdc48c1){if(_0xdc48c1){_0x381f43[_0xf767('0x26')]=_0xdc48c1['get']({'plain':!![]});return db[_0xf767('0x75')][_0xf767('0x51')]({'where':{'id':_0xdc48c1['MailInteractionId']}});}return null;})[_0xf767('0x1d')](handleEntityNotFound(_0x311691,null))[_0xf767('0x1d')](function(_0x1669d0){if(_0x1669d0){_0x381f43['interaction']=_0x1669d0[_0xf767('0x79')]({'plain':!![]});interaction_log[_0xf767('0x1e')](_0xf767('0x87'),_0x339544[_0xf767('0x72')]['id'],_0x339544['user'][_0xf767('0x33')],_0x339544[_0xf767('0x72')]['role'],_0x381f43['interaction']['id'],_0x339544[_0xf767('0x52')]?JSON[_0xf767('0x23')](_0x339544['body']):_0xf767('0x88'));return respondWithRpcPromise(_0xf767('0x89'),_0xf767('0x8a'),_0x381f43);}return null;})[_0xf767('0x1d')](function(_0x177d1d){if(_0x177d1d){_0x177d1d[_0xf767('0x26')][_0xf767('0x7e')]=util[_0xf767('0x6c')](_0xf767('0x7f'),_0x339544[_0xf767('0x72')][_0xf767('0x33')]);_0x177d1d[_0xf767('0x26')]['channel']=_0x381f43[_0xf767('0x80')];_0x177d1d[_0xf767('0x26')]['event']=_0xf767('0x85');respondWithRpcPromise('EventManager',_0xf767('0x83'),{'event':'rejectmessage','message':_0x177d1d[_0xf767('0x26')]},client9002);return _0x381f43;}return null;})[_0xf767('0x1d')](respondWithResult(_0x311691,null))[_0xf767('0x27')](handleError(_0x311691,null));};exports[_0xf767('0x8b')]=function(_0x1cf5dd,_0x10f4ac){var _0x26a3dd=moment()[_0xf767('0x8c')]()['toString']();var _0x13da40=path[_0xf767('0x8d')](config[_0xf767('0x66')],'server',_0xf767('0x8e'),_0xf767('0x8f'));var _0x1137dd=path['join'](config[_0xf767('0x66')],'server','files',_0xf767('0x65'));var _0x741266=util[_0xf767('0x6c')](_0xf767('0x90'),_0x26a3dd);return db[_0xf767('0x48')][_0xf767('0x51')]({'where':{'id':_0x1cf5dd[_0xf767('0x4f')]['id']},'attributes':['id',_0xf767('0x52'),_0xf767('0x91'),'to','cc','bcc',_0xf767('0x92'),_0xf767('0x93')],'include':_0x1cf5dd[_0xf767('0x39')]['attachments']?[{'model':db[_0xf767('0x94')],'as':_0xf767('0x95')}]:undefined})[_0xf767('0x1d')](handleEntityNotFound(_0x10f4ac,null))[_0xf767('0x1d')](function(_0x15f86c){if(_0x15f86c){var _0x8864a6=_0x15f86c;var _0x2c681a={'from':_0x8864a6[_0xf767('0x91')],'to':_0x8864a6['to'],'subject':_0x8864a6[_0xf767('0x92')],'html':_0x8864a6[_0xf767('0x52')],'headers':{'Date':moment(_0x8864a6[_0xf767('0x93')])[_0xf767('0x6c')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x15f86c['cc']){_0x2c681a[_0xf767('0x96')]['Cc']=_0x15f86c['cc'];}if(_0x15f86c[_0xf767('0x97')]){_0x2c681a['headers'][_0xf767('0x98')]=_0x15f86c['bcc'];}return new BPromise(function(_0x232f14,_0x2f3389){if(_0x15f86c['Attachments']){for(var _0x4de200=0x0;_0x4de200<_0x15f86c['Attachments']['length'];_0x4de200++){var _0x2ebe30=_0x15f86c[_0xf767('0x95')][_0x4de200];var _0xf787ff=path[_0xf767('0x8d')](_0x1137dd,_0x2ebe30[_0xf767('0x68')]);if(fs[_0xf767('0x99')](_0xf787ff)){_0x2c681a[_0xf767('0x65')]['push']({'name':_0x2ebe30['name'],'contentType':_0x2ebe30[_0xf767('0x45')],'data':fs[_0xf767('0x9a')](_0xf787ff)});}}}emlformat['build'](_0x2c681a,function(_0x38c6c8,_0x5ed3a9){if(_0x38c6c8)return _0x2f3389(_0x38c6c8);fs[_0xf767('0x9b')](path[_0xf767('0x8d')](_0x13da40,_0x741266),_0x5ed3a9);return _0x232f14(_0x5ed3a9);});});}})[_0xf767('0x1d')](function(_0x1a08af){if(_0x1a08af){return _0x10f4ac[_0xf767('0x8b')](path[_0xf767('0x8d')](_0x13da40,_0x741266),_0x741266,function(_0x5d803f){if(_0x5d803f){console[_0xf767('0x9c')](_0xf767('0x9d'),_0x5d803f);}else{fs[_0xf767('0x9e')](path[_0xf767('0x8d')](_0x13da40,_0x741266));}});}})[_0xf767('0x27')](handleError(_0x10f4ac,null));}; \ No newline at end of file +var _0x4c30=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','status','end','json','count','offset','Content-Range','apply','save','update','then','sendStatus','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','merge','map','type','field','filter','options','includeAll','include','findAll','rows','catch','params','find','body','destroy','describe','create','direction','out','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','readAt','UserId','CmContact','Contact','MailInteraction','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','mail','agent','get','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','event','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','download','log','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x19555e,_0x18bcd6){var _0x3a6640=function(_0x34b399){while(--_0x34b399){_0x19555e['push'](_0x19555e['shift']());}};_0x3a6640(++_0x18bcd6);}(_0x4c30,0x98));var _0x04c3=function(_0x3a3a18,_0x512f88){_0x3a3a18=_0x3a3a18-0x0;var _0x9c11a9=_0x4c30[_0x3a3a18];return _0x9c11a9;};'use strict';var pdf=require(_0x04c3('0x0'));var emlformat=require(_0x04c3('0x1'));var rimraf=require(_0x04c3('0x2'));var zipdir=require(_0x04c3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04c3('0x4'));var moment=require(_0x04c3('0x5'));var BPromise=require(_0x04c3('0x6'));var Mustache=require(_0x04c3('0x7'));var util=require(_0x04c3('0x8'));var path=require('path');var sox=require(_0x04c3('0x9'));var csv=require(_0x04c3('0xa'));var ejs=require(_0x04c3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x04c3('0xc'));var crypto=require(_0x04c3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x04c3('0xe'));var toCsv=require(_0x04c3('0xa'));var querystring=require(_0x04c3('0xf'));var Papa=require(_0x04c3('0x10'));var Redis=require('ioredis');var authService=require(_0x04c3('0x11'));var qs=require(_0x04c3('0x12'));var hardwareService=require(_0x04c3('0x13'));var logger=require(_0x04c3('0x14'))(_0x04c3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x04c3('0x16')]=_[_0x04c3('0x17')](config[_0x04c3('0x16')],{'host':_0x04c3('0x18'),'port':0x18eb});var socket=require(_0x04c3('0x19'))(new Redis(config['redis']));require(_0x04c3('0x1a'))['register'](socket);var jayson=require(_0x04c3('0x1b'));var client=jayson[_0x04c3('0x1c')]['http']({'port':0x232c});var client9003=jayson[_0x04c3('0x1c')][_0x04c3('0x1d')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x33ae80,_0x3707f1,_0x469899){if(_0x469899){var _0x592809=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x592809[_0x04c3('0x1e')](_0x3707f1)){return _0x33ae80;}else{throw new Error(_0x04c3('0x1f'));}}else{return _0x33ae80;}}function respondWithRpcPromise(_0x4874d3,_0x4b1fac,_0x28e8d1,_0x5468e8){return new BPromise(function(_0x290493,_0x22b05a){var _0x56ea18=_0x5468e8||client;return _0x56ea18[_0x04c3('0x20')](_0x4874d3,_0x28e8d1)['then'](function(_0x742fa8){logger[_0x04c3('0x21')](_0x04c3('0x22'),_0x4b1fac,_0x04c3('0x23'));logger[_0x04c3('0x24')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4b1fac,_0x04c3('0x23'),JSON[_0x04c3('0x25')](_0x742fa8));if(_0x742fa8['error']){if(_0x742fa8['error'][_0x04c3('0x26')]===0x1f4){logger[_0x04c3('0x27')]('MailMessage,\x20%s,\x20%s',_0x4b1fac,_0x742fa8['error'][_0x04c3('0x28')]);return _0x22b05a(_0x742fa8[_0x04c3('0x27')][_0x04c3('0x28')]);}logger[_0x04c3('0x27')](_0x04c3('0x22'),_0x4b1fac,_0x742fa8['error']['message']);return _0x290493(_0x742fa8[_0x04c3('0x27')]['message']);}else{logger['info'](_0x04c3('0x22'),_0x4b1fac,_0x04c3('0x23'));_0x290493(_0x742fa8[_0x04c3('0x29')][_0x04c3('0x28')]);}})['catch'](function(_0x4dad63){logger[_0x04c3('0x27')]('MailMessage,\x20%s,\x20%s',_0x4b1fac,_0x4dad63);_0x22b05a(_0x4dad63);});});}function respondWithStatusCode(_0x1425f8,_0x220f08){_0x220f08=_0x220f08||0xcc;return function(_0x1ca6e3){if(_0x1ca6e3){return _0x1425f8['sendStatus'](_0x220f08);}return _0x1425f8[_0x04c3('0x2a')](_0x220f08)[_0x04c3('0x2b')]();};}function respondWithResult(_0x175d48,_0x1dcb60){_0x1dcb60=_0x1dcb60||0xc8;return function(_0x37cfe8){if(_0x37cfe8){return _0x175d48[_0x04c3('0x2a')](_0x1dcb60)[_0x04c3('0x2c')](_0x37cfe8);}};}function respondWithFilteredResult(_0x330843,_0x2d52f8){return function(_0x251872){if(_0x251872){var _0xef33e=_0x251872[_0x04c3('0x2d')],_0x513c93=_0x2d52f8['offset'],_0x2dbb1c=_0x2d52f8[_0x04c3('0x2e')]+_0x2d52f8['limit'],_0xce8fcc;if(_0x2dbb1c>=_0xef33e){_0x2dbb1c=_0xef33e;_0xce8fcc=0xc8;}else{_0xce8fcc=0xce;}_0x330843['status'](_0xce8fcc);return _0x330843['set'](_0x04c3('0x2f'),_0x513c93+'-'+_0x2dbb1c+'/'+_0xef33e)[_0x04c3('0x2c')](_0x251872);}return null;};}function patchUpdates(_0x2f3a78){return function(_0x30ecef){try{jsonpatch[_0x04c3('0x30')](_0x30ecef,_0x2f3a78,!![]);}catch(_0x13ac3b){return BPromise['reject'](_0x13ac3b);}return _0x30ecef[_0x04c3('0x31')]();};}function saveUpdates(_0x2eec6e,_0x376099){return function(_0x4dd25d){if(_0x4dd25d){return _0x4dd25d[_0x04c3('0x32')](_0x2eec6e)[_0x04c3('0x33')](function(_0x4ec3bf){return _0x4ec3bf;});}return null;};}function removeEntity(_0x3f3440,_0x32ba79){return function(_0x594a7f){if(_0x594a7f){return _0x594a7f['destroy']()[_0x04c3('0x33')](function(){_0x3f3440[_0x04c3('0x2a')](0xcc)[_0x04c3('0x2b')]();});}};}function handleEntityNotFound(_0x22f9de,_0x1a24e6){return function(_0x581b53){if(!_0x581b53){_0x22f9de[_0x04c3('0x34')](0x194);}return _0x581b53;};}function handleError(_0x2e3539,_0x45775e){_0x45775e=_0x45775e||0x1f4;return function(_0x111bab){logger['error'](_0x111bab['stack']);if(_0x111bab[_0x04c3('0x35')]){delete _0x111bab['name'];}_0x2e3539['status'](_0x45775e)[_0x04c3('0x36')](_0x111bab);};}exports[_0x04c3('0x37')]=function(_0x321a2d,_0x1cc3cc){var _0xa346a3={},_0x3303c4={},_0x3091a0={'count':0x0,'rows':[]};var _0x57734d=db[_0x04c3('0x38')][_0x04c3('0x39')];_0x3303c4[_0x04c3('0x3a')]=_[_0x04c3('0x3b')](_0x57734d);_0x3303c4[_0x04c3('0x3c')]=_['keys'](_0x321a2d['query']);_0x3303c4[_0x04c3('0x3d')]=_[_0x04c3('0x3e')](_0x3303c4[_0x04c3('0x3a')],_0x3303c4['query']);_0xa346a3[_0x04c3('0x3f')]=_[_0x04c3('0x3e')](_0x3303c4['model'],qs[_0x04c3('0x40')](_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x40')]));_0xa346a3['attributes']=_0xa346a3[_0x04c3('0x3f')][_0x04c3('0x41')]?_0xa346a3[_0x04c3('0x3f')]:_0x3303c4['model'];if(!_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x42')]('nolimit')){_0xa346a3[_0x04c3('0x43')]=qs[_0x04c3('0x43')](_0x321a2d[_0x04c3('0x3c')]['limit']);_0xa346a3['offset']=qs[_0x04c3('0x2e')](_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x2e')]);}_0xa346a3['order']=qs[_0x04c3('0x44')](_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x44')]);_0xa346a3[_0x04c3('0x45')]=qs['filters'](_['pick'](_0x321a2d['query'],_0x3303c4[_0x04c3('0x3d')]));if(_0x321a2d['query']['filter']){_0xa346a3[_0x04c3('0x45')]=_[_0x04c3('0x46')](_0xa346a3[_0x04c3('0x45')],{'$or':_[_0x04c3('0x47')](_0x57734d,function(_0x45eeeb){if(_0x45eeeb[_0x04c3('0x48')]['key']!=='VIRTUAL'){var _0x57544f={};_0x57544f[_0x45eeeb[_0x04c3('0x49')]]={'$like':'%'+_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x4a')]+'%'};return _0x57544f;}})});}_0xa346a3=_[_0x04c3('0x46')]({},_0xa346a3,_0x321a2d[_0x04c3('0x4b')]);var _0x5c1baa={'where':_0xa346a3[_0x04c3('0x45')]};return db[_0x04c3('0x38')]['count'](_0x5c1baa)['then'](function(_0x500629){_0x3091a0[_0x04c3('0x2d')]=_0x500629;if(_0x321a2d[_0x04c3('0x3c')][_0x04c3('0x4c')]){_0xa346a3[_0x04c3('0x4d')]=[{'all':!![]}];}return db['MailMessage'][_0x04c3('0x4e')](_0xa346a3);})[_0x04c3('0x33')](function(_0x4e9387){_0x3091a0[_0x04c3('0x4f')]=_0x4e9387;return _0x3091a0;})[_0x04c3('0x33')](respondWithFilteredResult(_0x1cc3cc,_0xa346a3))[_0x04c3('0x50')](handleError(_0x1cc3cc,null));};exports['show']=function(_0x4fcff7,_0xa1f85e){var _0x1a089a={'raw':!![],'where':{'id':_0x4fcff7[_0x04c3('0x51')]['id']}},_0x17a989={};_0x17a989[_0x04c3('0x3a')]=_[_0x04c3('0x3b')](db[_0x04c3('0x38')][_0x04c3('0x39')]);_0x17a989[_0x04c3('0x3c')]=_[_0x04c3('0x3b')](_0x4fcff7[_0x04c3('0x3c')]);_0x17a989['filters']=_['intersection'](_0x17a989[_0x04c3('0x3a')],_0x17a989[_0x04c3('0x3c')]);_0x1a089a[_0x04c3('0x3f')]=_[_0x04c3('0x3e')](_0x17a989[_0x04c3('0x3a')],qs[_0x04c3('0x40')](_0x4fcff7[_0x04c3('0x3c')]['fields']));_0x1a089a['attributes']=_0x1a089a['attributes'][_0x04c3('0x41')]?_0x1a089a[_0x04c3('0x3f')]:_0x17a989[_0x04c3('0x3a')];if(_0x4fcff7[_0x04c3('0x3c')][_0x04c3('0x4c')]){_0x1a089a[_0x04c3('0x4d')]=[{'all':!![]}];}_0x1a089a=_['merge']({},_0x1a089a,_0x4fcff7[_0x04c3('0x4b')]);return db['MailMessage'][_0x04c3('0x52')](_0x1a089a)['then'](handleEntityNotFound(_0xa1f85e,null))[_0x04c3('0x33')](respondWithResult(_0xa1f85e,null))[_0x04c3('0x50')](handleError(_0xa1f85e,null));};exports[_0x04c3('0x32')]=function(_0x4b8559,_0x129aaf){if(_0x4b8559[_0x04c3('0x53')]['id']){delete _0x4b8559['body']['id'];}return db['MailMessage']['find']({'where':{'id':_0x4b8559[_0x04c3('0x51')]['id']}})[_0x04c3('0x33')](handleEntityNotFound(_0x129aaf,null))[_0x04c3('0x33')](saveUpdates(_0x4b8559[_0x04c3('0x53')],null))[_0x04c3('0x33')](respondWithResult(_0x129aaf,null))[_0x04c3('0x50')](handleError(_0x129aaf,null));};exports[_0x04c3('0x54')]=function(_0x25acc0,_0x299ac8){return db['MailMessage'][_0x04c3('0x52')]({'where':{'id':_0x25acc0[_0x04c3('0x51')]['id']}})[_0x04c3('0x33')](handleEntityNotFound(_0x299ac8,null))[_0x04c3('0x33')](removeEntity(_0x299ac8,null))[_0x04c3('0x50')](handleError(_0x299ac8,null));};exports[_0x04c3('0x55')]=function(_0x6042c0,_0x484365){return db[_0x04c3('0x38')]['describe']()[_0x04c3('0x33')](respondWithResult(_0x484365,null))['catch'](handleError(_0x484365,null));};exports[_0x04c3('0x56')]=function(_0x5eeb15,_0x1aa677){return db[_0x04c3('0x38')][_0x04c3('0x56')](_0x5eeb15['body'])['then'](function(_0x220eae){if(_0x220eae){if(_0x220eae[_0x04c3('0x57')]===_0x04c3('0x58')&&!_0x220eae['secret']){return db['MailAccount'][_0x04c3('0x59')]({'where':{'id':_0x220eae[_0x04c3('0x5a')]},'include':[{'model':db[_0x04c3('0x5b')],'as':_0x04c3('0x5c'),'raw':!![]}]})[_0x04c3('0x33')](function(_0x3e7934){if(_0x3e7934&&_0x3e7934[_0x04c3('0x5c')]){var _0x5c70ef={'tls':{'rejectUnauthorized':![]}};if(_[_0x04c3('0x5d')](_0x3e7934[_0x04c3('0x5c')][_0x04c3('0x5e')])){_0x5c70ef[_0x04c3('0x5f')]=_0x3e7934[_0x04c3('0x5c')]['host'];_0x5c70ef[_0x04c3('0x60')]=_0x3e7934[_0x04c3('0x5c')][_0x04c3('0x60')];_0x5c70ef[_0x04c3('0x61')]=_0x3e7934['Smtp'][_0x04c3('0x61')];if(_0x3e7934[_0x04c3('0x5c')]['authentication']){_0x5c70ef[_0x04c3('0x62')]={'user':_0x3e7934['Smtp'][_0x04c3('0x63')],'pass':_0x3e7934['Smtp'][_0x04c3('0x64')]};}}else{_0x5c70ef[_0x04c3('0x5e')]=_0x3e7934[_0x04c3('0x5c')]['service'];_0x5c70ef[_0x04c3('0x62')]={'user':_0x3e7934[_0x04c3('0x5c')]['user'],'pass':_0x3e7934[_0x04c3('0x5c')]['pass']};_0x5c70ef[_0x04c3('0x61')]=_0x3e7934[_0x04c3('0x5c')][_0x04c3('0x61')];}if(_0x5eeb15['body'][_0x04c3('0x65')]&&_0x5eeb15[_0x04c3('0x53')][_0x04c3('0x65')]['length']){for(var _0x4cb3f8=0x0;_0x4cb3f8<_0x5eeb15[_0x04c3('0x53')]['attachments'][_0x04c3('0x41')];_0x4cb3f8+=0x1){_0x5eeb15[_0x04c3('0x53')]['attachments'][_0x4cb3f8]={'filename':_0x5eeb15[_0x04c3('0x53')][_0x04c3('0x65')][_0x4cb3f8][_0x04c3('0x35')],'path':path[_0x04c3('0x66')](config['root'],'server/files/attachments',_0x5eeb15[_0x04c3('0x53')][_0x04c3('0x65')][_0x4cb3f8]['basename'])};}}return{'account':_0x5c70ef,'message':_0x5eeb15[_0x04c3('0x53')]};}})[_0x04c3('0x33')](function(_0x42ea59){if(_0x42ea59){return respondWithRpcPromise('SendMail',_0x04c3('0x67'),_0x42ea59,client9003)['then'](function(_0xc34420){return _0x220eae[_0x04c3('0x32')]({'read':!![],'messageId':_0xc34420['messageId'],'sentAt':moment()[_0x04c3('0x68')](_0x04c3('0x69'))});})[_0x04c3('0x50')](function(_0x564955){logger[_0x04c3('0x27')]('%s',JSON['stringify'](_0x564955));return _0x220eae;});}return _0x220eae;});}return _0x220eae;}})[_0x04c3('0x33')](respondWithResult(_0x1aa677,0xc9))[_0x04c3('0x50')](handleError(_0x1aa677,null));};var interaction_log=require(_0x04c3('0x14'))(_0x04c3('0x6a'));exports[_0x04c3('0x6b')]=function(_0x4db282,_0x145d57,_0x2c6c15){var _0x11ffb4={'channel':'mail'};if(_0x4db282[_0x04c3('0x53')]['id']){delete _0x4db282['body']['id'];}_0x4db282[_0x04c3('0x53')]['read']=!![];_0x4db282['body'][_0x04c3('0x6c')]=moment()[_0x04c3('0x68')](_0x04c3('0x69'));_0x4db282[_0x04c3('0x53')][_0x04c3('0x6d')]=_0x4db282[_0x04c3('0x53')]['UserId']||_0x4db282[_0x04c3('0x63')]['id'];return db[_0x04c3('0x38')]['find']({'where':{'id':_0x4db282[_0x04c3('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x04c3('0x6e')],'as':_0x04c3('0x6f')}]})['then'](handleEntityNotFound(_0x145d57,null))[_0x04c3('0x33')](saveUpdates(_0x4db282[_0x04c3('0x53')],null))[_0x04c3('0x33')](function(_0x3829a8){if(_0x3829a8){_0x11ffb4[_0x04c3('0x28')]=_0x3829a8['get']({'plain':!![]});return db[_0x04c3('0x70')][_0x04c3('0x52')]({'where':{'id':_0x3829a8['MailInteractionId']}});}return null;})[_0x04c3('0x33')](handleEntityNotFound(_0x145d57,null))['then'](function(_0x4a5a11){if(_0x4a5a11){return _0x4a5a11[_0x04c3('0x32')]({'UserId':_0x4db282[_0x04c3('0x53')][_0x04c3('0x6d')],'read1stAt':_[_0x04c3('0x5d')](_0x4a5a11[_0x04c3('0x71')])?moment()[_0x04c3('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x04c3('0x33')](function(_0x1c5c12){if(_0x1c5c12){_0x11ffb4[_0x04c3('0x72')]=_0x1c5c12['get']({'plain':!![]});interaction_log[_0x04c3('0x21')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4db282['user']['id'],_0x4db282[_0x04c3('0x63')]['name'],_0x4db282['user'][_0x04c3('0x73')],_0x11ffb4[_0x04c3('0x72')]['id'],_0x4db282[_0x04c3('0x53')]?JSON[_0x04c3('0x25')](_0x4db282[_0x04c3('0x53')]):_0x04c3('0x74'));return respondWithRpcPromise(_0x04c3('0x75'),_0x04c3('0x76'),_0x11ffb4);}return null;})[_0x04c3('0x33')](function(_0x2fe14d){if(_0x2fe14d){if(_0x4db282[_0x04c3('0x53')][_0x04c3('0x77')]){_0x11ffb4[_0x04c3('0x28')][_0x04c3('0x78')]=util[_0x04c3('0x68')](_0x04c3('0x79'),_0x4db282['user'][_0x04c3('0x35')]);_0x11ffb4[_0x04c3('0x28')][_0x04c3('0x7a')]=_0x11ffb4[_0x04c3('0x7a')];_0x11ffb4[_0x04c3('0x28')]['event']=_0x04c3('0x6b');return respondWithRpcPromise(_0x04c3('0x7b'),_0x04c3('0x7b'),{'event':_0x04c3('0x7c'),'message':_0x11ffb4['message']},client9002)[_0x04c3('0x33')](function(){return _0x11ffb4;});}return _0x11ffb4;}return null;})[_0x04c3('0x33')](respondWithResult(_0x145d57,null))[_0x04c3('0x50')](handleError(_0x145d57,null));};var interaction_log=require(_0x04c3('0x14'))(_0x04c3('0x6a'));exports[_0x04c3('0x7d')]=function(_0x1ee605,_0x2303a8,_0x4b0f82){var _0x1decb1={'agent':{},'channel':_0x04c3('0x7e')};if(_0x1ee605[_0x04c3('0x53')]['id']){delete _0x1ee605[_0x04c3('0x53')]['id'];}_0x1ee605[_0x04c3('0x53')][_0x04c3('0x6d')]=_0x1ee605[_0x04c3('0x53')]['UserId']||_0x1ee605[_0x04c3('0x63')]['id'];_0x1decb1[_0x04c3('0x7f')]['id']=_0x1ee605[_0x04c3('0x53')]['UserId'];return db[_0x04c3('0x38')][_0x04c3('0x52')]({'where':{'id':_0x1ee605[_0x04c3('0x51')]['id'],'UserId':null}})[_0x04c3('0x33')](handleEntityNotFound(_0x2303a8,null))[_0x04c3('0x33')](function(_0x535219){if(_0x535219){_0x1decb1[_0x04c3('0x28')]=_0x535219[_0x04c3('0x80')]({'plain':!![]});return db[_0x04c3('0x70')][_0x04c3('0x52')]({'where':{'id':_0x535219[_0x04c3('0x81')]}});}return null;})[_0x04c3('0x33')](handleEntityNotFound(_0x2303a8,null))['then'](function(_0x2a4b30){if(_0x2a4b30){_0x1decb1[_0x04c3('0x72')]=_0x2a4b30[_0x04c3('0x80')]({'plain':!![]});interaction_log[_0x04c3('0x21')](_0x04c3('0x82'),_0x1ee605[_0x04c3('0x63')]['id'],_0x1ee605[_0x04c3('0x63')][_0x04c3('0x35')],_0x1ee605[_0x04c3('0x63')][_0x04c3('0x73')],_0x1decb1[_0x04c3('0x72')]['id'],_0x1ee605['body']?JSON[_0x04c3('0x25')](_0x1ee605[_0x04c3('0x53')]):_0x04c3('0x74'));return respondWithRpcPromise('RejectMessage',_0x04c3('0x83'),_0x1decb1);}return null;})[_0x04c3('0x33')](function(_0x252d77){if(_0x252d77){_0x252d77['message'][_0x04c3('0x78')]=util[_0x04c3('0x68')](_0x04c3('0x79'),_0x1ee605[_0x04c3('0x63')][_0x04c3('0x35')]);_0x252d77[_0x04c3('0x28')][_0x04c3('0x7a')]=_0x1decb1[_0x04c3('0x7a')];_0x252d77[_0x04c3('0x28')][_0x04c3('0x84')]=_0x04c3('0x7d');respondWithRpcPromise(_0x04c3('0x7b'),_0x04c3('0x7b'),{'event':_0x04c3('0x85'),'message':_0x252d77[_0x04c3('0x28')]},client9002);return _0x1decb1;}return null;})[_0x04c3('0x33')](respondWithResult(_0x2303a8,null))[_0x04c3('0x50')](handleError(_0x2303a8,null));};exports['download']=function(_0x1a81c0,_0x3ad0f8){var _0x2f88f6=moment()[_0x04c3('0x86')]()[_0x04c3('0x87')]();var _0x15eee8=path['join'](config[_0x04c3('0x88')],_0x04c3('0x89'),_0x04c3('0x8a'),_0x04c3('0x8b'));var _0x37198b=path['join'](config[_0x04c3('0x88')],_0x04c3('0x89'),_0x04c3('0x8a'),_0x04c3('0x65'));var _0x1361f6=util[_0x04c3('0x68')](_0x04c3('0x8c'),_0x2f88f6);return db[_0x04c3('0x38')][_0x04c3('0x52')]({'where':{'id':_0x1a81c0[_0x04c3('0x51')]['id']},'attributes':['id',_0x04c3('0x53'),_0x04c3('0x8d'),'to','cc',_0x04c3('0x8e'),_0x04c3('0x8f'),_0x04c3('0x90')],'include':_0x1a81c0[_0x04c3('0x3c')][_0x04c3('0x65')]?[{'model':db[_0x04c3('0x91')],'as':_0x04c3('0x92')}]:undefined})[_0x04c3('0x33')](handleEntityNotFound(_0x3ad0f8,null))[_0x04c3('0x33')](function(_0x27cca9){if(_0x27cca9){var _0x3e0773=_0x27cca9;var _0x29b8e8={'from':_0x3e0773[_0x04c3('0x8d')],'to':_0x3e0773['to'],'subject':_0x3e0773[_0x04c3('0x8f')],'html':_0x3e0773[_0x04c3('0x53')],'headers':{'Date':moment(_0x3e0773['createdAt'])['format'](_0x04c3('0x93'))},'attachments':[]};if(_0x27cca9['cc']){_0x29b8e8[_0x04c3('0x94')]['Cc']=_0x27cca9['cc'];}if(_0x27cca9['bcc']){_0x29b8e8['headers'][_0x04c3('0x95')]=_0x27cca9['bcc'];}return new BPromise(function(_0x5b89f0,_0x4e4911){if(_0x27cca9['Attachments']){for(var _0x1c9a23=0x0;_0x1c9a23<_0x27cca9[_0x04c3('0x92')]['length'];_0x1c9a23++){var _0x569ad9=_0x27cca9[_0x04c3('0x92')][_0x1c9a23];var _0x319fce=path['join'](_0x37198b,_0x569ad9[_0x04c3('0x96')]);if(fs[_0x04c3('0x97')](_0x319fce)){_0x29b8e8['attachments']['push']({'name':_0x569ad9[_0x04c3('0x35')],'contentType':_0x569ad9[_0x04c3('0x48')],'data':fs[_0x04c3('0x98')](_0x319fce)});}}}emlformat['build'](_0x29b8e8,function(_0x247c6b,_0xcbc358){if(_0x247c6b)return _0x4e4911(_0x247c6b);fs[_0x04c3('0x99')](path[_0x04c3('0x66')](_0x15eee8,_0x1361f6),_0xcbc358);return _0x5b89f0(_0xcbc358);});});}})[_0x04c3('0x33')](function(_0x39da8d){if(_0x39da8d){return _0x3ad0f8[_0x04c3('0x9a')](path['join'](_0x15eee8,_0x1361f6),_0x1361f6,function(_0x48f79a){if(_0x48f79a){console[_0x04c3('0x9b')]('err',_0x48f79a);}else{fs['unlinkSync'](path[_0x04c3('0x66')](_0x15eee8,_0x1361f6));}});}})[_0x04c3('0x50')](handleError(_0x3ad0f8,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bedccef..1192d66 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 _0xfca0=['exports','events','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfca0,0x196));var _0x0fca=function(_0xa32746,_0x19c503){_0xa32746=_0xa32746-0x0;var _0x495f73=_0xfca0[_0xa32746];return _0x495f73;};'use strict';var EventEmitter=require(_0x0fca('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x0fca('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0fca('0x2')](0x0);var events={'afterCreate':_0x0fca('0x3'),'afterUpdate':'update','afterDestroy':_0x0fca('0x4')};function emitEvent(_0x94c0c4){return function(_0x527176,_0x446d59,_0x50a64f){MailMessageEvents[_0x0fca('0x5')](_0x94c0c4+':'+_0x527176['id'],_0x527176);MailMessageEvents[_0x0fca('0x5')](_0x94c0c4,_0x527176);_0x50a64f(null);};}for(var e in events){if(events[_0x0fca('0x6')](e)){var event=events[e];MailMessage[_0x0fca('0x7')](e,emitEvent(event));}}module[_0x0fca('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x4158=['MailMessage','setMaxListeners','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4158,0xde));var _0x8415=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x4158[_0x4d613c];return _0x301fe3;};'use strict';var EventEmitter=require(_0x8415('0x0'));var MailMessage=require(_0x8415('0x1'))['db'][_0x8415('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8415('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8415('0x4')};function emitEvent(_0x1bb490){return function(_0x8598d4,_0x4189ff,_0x1b1304){MailMessageEvents['emit'](_0x1bb490+':'+_0x8598d4['id'],_0x8598d4);MailMessageEvents[_0x8415('0x5')](_0x1bb490,_0x8598d4);_0x1b1304(null);};}for(var e in events){if(events[_0x8415('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index eb2050c..01294d6 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 _0x3e0a=['path','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x211f66,_0x6d409f){var _0x324240=function(_0x5b0c0e){while(--_0x5b0c0e){_0x211f66['push'](_0x211f66['shift']());}};_0x324240(++_0x6d409f);}(_0x3e0a,0x158));var _0xa3e0=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x3e0a[_0x2a7b50];return _0x4224c9;};'use strict';var _=require(_0xa3e0('0x0'));var util=require(_0xa3e0('0x1'));var logger=require(_0xa3e0('0x2'))(_0xa3e0('0x3'));var moment=require(_0xa3e0('0x4'));var BPromise=require(_0xa3e0('0x5'));var rp=require(_0xa3e0('0x6'));var htmlToText=require(_0xa3e0('0x7'));var fs=require('fs');var path=require(_0xa3e0('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3e0('0x9'));module['exports']=function(_0x5e00b3,_0xcdab74){return _0x5e00b3[_0xa3e0('0xa')]('MailMessage',attributes,{'tableName':_0xa3e0('0xb'),'paranoid':![],'indexes':[{'name':_0xa3e0('0xc'),'fields':[_0xa3e0('0xc')]},{'name':_0xa3e0('0xd'),'fields':[_0xa3e0('0xe'),_0xa3e0('0xf')],'type':_0xa3e0('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a0eda,_0x1aee91,_0xa17c07){if(_0x4a0eda[_0xa3e0('0x11')]){_0x4a0eda[_0xa3e0('0xe')]=htmlToText[_0xa3e0('0x12')](_0x4a0eda[_0xa3e0('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xa17c07(null,_0x1aee91);},'afterCreate':function(_0x2bac67,_0x59e829,_0x1f7ccd){var _0x21430a=_0x5e00b3[_0xa3e0('0x13')];var _0x451caa=_0x2bac67['get']({'plain':!![]});if(_0x451caa[_0xa3e0('0x14')][_0xa3e0('0x15')]()==='in'||_0x451caa['direction']['toLowerCase']()===_0xa3e0('0x16')&&!_0x451caa[_0xa3e0('0x17')]&&!_[_0xa3e0('0x18')](_0x451caa[_0xa3e0('0x19')])){_0x21430a['MailInteraction'][_0xa3e0('0x1a')]({'where':{'id':_0x451caa[_0xa3e0('0x1b')]}})['then'](function(_0x1a5a2a){if(_0x1a5a2a){_0x1a5a2a[_0xa3e0('0x1c')]({'lastMsgAt':_0x451caa[_0xa3e0('0x1d')],'lastMsgDirection':_0x451caa[_0xa3e0('0x14')][_0xa3e0('0x15')](),'lastMsgBody':_0x451caa[_0xa3e0('0x11')]});}})['catch'](function(_0x3a487d){console[_0xa3e0('0x1e')](_0x3a487d);});}_0x1f7ccd();}},'charset':_0xa3e0('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd40f=['toLowerCase','out','secret','isNil','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','FULLTEXT','body','plainBody','get','direction'];(function(_0x558b43,_0x59b1f0){var _0x53fd69=function(_0x36a01b){while(--_0x36a01b){_0x558b43['push'](_0x558b43['shift']());}};_0x53fd69(++_0x59b1f0);}(_0xd40f,0x12c));var _0xfd40=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xd40f[_0x255ac0];return _0x437bf1;};'use strict';var _=require(_0xfd40('0x0'));var util=require(_0xfd40('0x1'));var logger=require(_0xfd40('0x2'))(_0xfd40('0x3'));var moment=require(_0xfd40('0x4'));var BPromise=require(_0xfd40('0x5'));var rp=require(_0xfd40('0x6'));var htmlToText=require(_0xfd40('0x7'));var fs=require('fs');var path=require(_0xfd40('0x8'));var rimraf=require(_0xfd40('0x9'));var config=require('../../config/environment');var attributes=require(_0xfd40('0xa'));module['exports']=function(_0x5eb35a,_0x4d3db2){return _0x5eb35a[_0xfd40('0xb')](_0xfd40('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xfd40('0xd'),'fields':[_0xfd40('0xd')]},{'name':_0xfd40('0xe'),'fields':['plainBody','subject'],'type':_0xfd40('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x241e06,_0x5d5b20,_0x206236){if(_0x241e06[_0xfd40('0x10')]){_0x241e06[_0xfd40('0x11')]=htmlToText['fromString'](_0x241e06[_0xfd40('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x206236(null,_0x5d5b20);},'afterCreate':function(_0x4353e0,_0x5b80b5,_0x566ed9){var _0xe6792e=_0x5eb35a['models'];var _0x39c397=_0x4353e0[_0xfd40('0x12')]({'plain':!![]});if(_0x39c397[_0xfd40('0x13')][_0xfd40('0x14')]()==='in'||_0x39c397[_0xfd40('0x13')][_0xfd40('0x14')]()===_0xfd40('0x15')&&!_0x39c397[_0xfd40('0x16')]&&!_[_0xfd40('0x17')](_0x39c397['UserId'])){_0xe6792e['MailInteraction'][_0xfd40('0x18')]({'where':{'id':_0x39c397[_0xfd40('0x19')]}})[_0xfd40('0x1a')](function(_0x29788d){if(_0x29788d){_0x29788d['update']({'lastMsgAt':_0x39c397[_0xfd40('0x1b')],'lastMsgDirection':_0x39c397[_0xfd40('0x13')][_0xfd40('0x14')](),'lastMsgBody':_0x39c397[_0xfd40('0x10')]});}})[_0xfd40('0x1c')](function(_0xef772c){console[_0xfd40('0x1d')](_0xef772c);});}_0x566ed9();}},'charset':_0xfd40('0x1e'),'collate':_0xfd40('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 03ef684..63089e3 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 _0x8c32=['info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then'];(function(_0x43d7bb,_0x806556){var _0x4bc149=function(_0x5a2a29){while(--_0x5a2a29){_0x43d7bb['push'](_0x43d7bb['shift']());}};_0x4bc149(++_0x806556);}(_0x8c32,0x130));var _0x28c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c32[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var moment=require(_0x28c3('0x2'));var BPromise=require(_0x28c3('0x3'));var rs=require(_0x28c3('0x4'));var fs=require('fs');var Redis=require(_0x28c3('0x5'));var db=require(_0x28c3('0x6'))['db'];var utils=require(_0x28c3('0x7'));var logger=require(_0x28c3('0x8'))(_0x28c3('0x9'));var config=require(_0x28c3('0xa'));var jayson=require(_0x28c3('0xb'));var client=jayson['client'][_0x28c3('0xc')]({'port':0x232a});config[_0x28c3('0xd')]=_[_0x28c3('0xe')](config[_0x28c3('0xd')],{'host':_0x28c3('0xf'),'port':0x18eb});var socket=require(_0x28c3('0x10'))(new Redis(config['redis']));require(_0x28c3('0x11'))[_0x28c3('0x12')](socket);function respondWithRpcPromise(_0x52d697,_0x509390,_0x485030){return new BPromise(function(_0x472d58,_0x4624f2){return client['request'](_0x52d697,_0x485030)[_0x28c3('0x13')](function(_0x15c306){logger[_0x28c3('0x14')]('MailMessage,\x20%s,\x20%s',_0x509390,_0x28c3('0x15'));logger[_0x28c3('0x16')](_0x28c3('0x17'),_0x509390,_0x28c3('0x15'),JSON[_0x28c3('0x18')](_0x15c306));if(_0x15c306['error']){if(_0x15c306[_0x28c3('0x19')]['code']===0x1f4){logger[_0x28c3('0x19')]('MailMessage,\x20%s,\x20%s',_0x509390,_0x15c306[_0x28c3('0x19')]['message']);return _0x4624f2(_0x15c306[_0x28c3('0x19')][_0x28c3('0x1a')]);}logger['error'](_0x28c3('0x1b'),_0x509390,_0x15c306['error']['message']);return _0x472d58(_0x15c306['error'][_0x28c3('0x1a')]);}else{logger[_0x28c3('0x14')](_0x28c3('0x1b'),_0x509390,'request\x20sent');_0x472d58(_0x15c306[_0x28c3('0x1c')][_0x28c3('0x1a')]);}})[_0x28c3('0x1d')](function(_0x39256d){logger[_0x28c3('0x19')](_0x28c3('0x1b'),_0x509390,_0x39256d);_0x4624f2(_0x39256d);});});}exports[_0x28c3('0x1e')]=function(_0x177189){var _0x3efe77=this;return new Promise(function(_0x1ec227,_0x1c3489){return db[_0x28c3('0x1f')][_0x28c3('0x20')](_0x177189[_0x28c3('0x21')],{'raw':_0x177189[_0x28c3('0x22')]?_0x177189[_0x28c3('0x22')][_0x28c3('0x23')]===undefined?!![]:![]:!![]})[_0x28c3('0x13')](function(_0x864cc0){logger[_0x28c3('0x14')](_0x28c3('0x1e'),_0x177189);logger[_0x28c3('0x16')](_0x28c3('0x1e'),_0x177189,JSON[_0x28c3('0x18')](_0x864cc0));_0x1ec227(_0x864cc0);})['catch'](function(_0x312f25){logger[_0x28c3('0x19')](_0x28c3('0x1e'),_0x312f25[_0x28c3('0x1a')],_0x177189);_0x1c3489(_0x3efe77[_0x28c3('0x19')](0x1f4,_0x312f25['message']));});});}; \ No newline at end of file +var _0x1c9a=['create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x4808bc,_0x5e6b2e){var _0x37b721=function(_0x1b9546){while(--_0x1b9546){_0x4808bc['push'](_0x4808bc['shift']());}};_0x37b721(++_0x5e6b2e);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x116e4a,_0x5583ac){_0x116e4a=_0x116e4a-0x0;var _0x2a5ebe=_0x1c9a[_0x116e4a];return _0x2a5ebe;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var moment=require('moment');var BPromise=require(_0xa1c9('0x2'));var rs=require(_0xa1c9('0x3'));var fs=require('fs');var Redis=require(_0xa1c9('0x4'));var db=require(_0xa1c9('0x5'))['db'];var utils=require(_0xa1c9('0x6'));var logger=require('../../config/logger')(_0xa1c9('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1c9('0x8'));var client=jayson[_0xa1c9('0x9')][_0xa1c9('0xa')]({'port':0x232a});config[_0xa1c9('0xb')]=_[_0xa1c9('0xc')](config[_0xa1c9('0xb')],{'host':_0xa1c9('0xd'),'port':0x18eb});var socket=require(_0xa1c9('0xe'))(new Redis(config[_0xa1c9('0xb')]));require(_0xa1c9('0xf'))[_0xa1c9('0x10')](socket);function respondWithRpcPromise(_0xb96573,_0x55c191,_0x53140c){return new BPromise(function(_0x3952a6,_0x560a0d){return client[_0xa1c9('0x11')](_0xb96573,_0x53140c)[_0xa1c9('0x12')](function(_0x20493a){logger[_0xa1c9('0x13')](_0xa1c9('0x14'),_0x55c191,_0xa1c9('0x15'));logger[_0xa1c9('0x16')](_0xa1c9('0x17'),_0x55c191,_0xa1c9('0x15'),JSON[_0xa1c9('0x18')](_0x20493a));if(_0x20493a[_0xa1c9('0x19')]){if(_0x20493a[_0xa1c9('0x19')][_0xa1c9('0x1a')]===0x1f4){logger[_0xa1c9('0x19')](_0xa1c9('0x14'),_0x55c191,_0x20493a[_0xa1c9('0x19')][_0xa1c9('0x1b')]);return _0x560a0d(_0x20493a[_0xa1c9('0x19')][_0xa1c9('0x1b')]);}logger[_0xa1c9('0x19')]('MailMessage,\x20%s,\x20%s',_0x55c191,_0x20493a[_0xa1c9('0x19')]['message']);return _0x3952a6(_0x20493a[_0xa1c9('0x19')][_0xa1c9('0x1b')]);}else{logger[_0xa1c9('0x13')](_0xa1c9('0x14'),_0x55c191,_0xa1c9('0x15'));_0x3952a6(_0x20493a[_0xa1c9('0x1c')][_0xa1c9('0x1b')]);}})[_0xa1c9('0x1d')](function(_0x460450){logger[_0xa1c9('0x19')](_0xa1c9('0x14'),_0x55c191,_0x460450);_0x560a0d(_0x460450);});});}exports[_0xa1c9('0x1e')]=function(_0x58b01f){var _0x1a5b8e=this;return new Promise(function(_0x214831,_0x5d0599){return db[_0xa1c9('0x1f')][_0xa1c9('0x20')](_0x58b01f[_0xa1c9('0x21')],{'raw':_0x58b01f[_0xa1c9('0x22')]?_0x58b01f[_0xa1c9('0x22')]['raw']===undefined?!![]:![]:!![]})[_0xa1c9('0x12')](function(_0x2acfb7){logger['info'](_0xa1c9('0x1e'),_0x58b01f);logger[_0xa1c9('0x16')](_0xa1c9('0x1e'),_0x58b01f,JSON[_0xa1c9('0x18')](_0x2acfb7));_0x214831(_0x2acfb7);})[_0xa1c9('0x1d')](function(_0x57c67e){logger[_0xa1c9('0x19')](_0xa1c9('0x1e'),_0x57c67e[_0xa1c9('0x1b')],_0x58b01f);_0x5d0599(_0x1a5b8e['error'](0x1f4,_0x57c67e[_0xa1c9('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index ee048e9..a0e7ca1 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 _0xb018=['register','length','mailMessage:','./mailMessage.events','save','update','emit','removeListener'];(function(_0x5776ef,_0x294402){var _0x356aab=function(_0x384ed4){while(--_0x384ed4){_0x5776ef['push'](_0x5776ef['shift']());}};_0x356aab(++_0x294402);}(_0xb018,0x6b));var _0x8b01=function(_0x13307c,_0x5c20d8){_0x13307c=_0x13307c-0x0;var _0x5b507e=_0xb018[_0x13307c];return _0x5b507e;};'use strict';var MailMessageEvents=require(_0x8b01('0x0'));var events=[_0x8b01('0x1'),'remove',_0x8b01('0x2')];function createListener(_0x353070,_0x46e158){return function(_0x1bbce3){_0x46e158[_0x8b01('0x3')](_0x353070,_0x1bbce3);};}function removeListener(_0x44be4e,_0x34bffc){return function(){MailMessageEvents[_0x8b01('0x4')](_0x44be4e,_0x34bffc);};}exports[_0x8b01('0x5')]=function(_0x4a7206){for(var _0x5d63ef=0x0,_0x17f5fd=events[_0x8b01('0x6')];_0x5d63ef<_0x17f5fd;_0x5d63ef++){var _0x2913f1=events[_0x5d63ef];var _0x5a0bbb=createListener(_0x8b01('0x7')+_0x2913f1,_0x4a7206);MailMessageEvents['on'](_0x2913f1,_0x5a0bbb);}}; \ No newline at end of file +var _0xed5c=['remove','register','length','mailMessage:','save'];(function(_0x356f8d,_0x1b3deb){var _0x1be58e=function(_0x4033ef){while(--_0x4033ef){_0x356f8d['push'](_0x356f8d['shift']());}};_0x1be58e(++_0x1b3deb);}(_0xed5c,0x13f));var _0xced5=function(_0x3e747a,_0x44b803){_0x3e747a=_0x3e747a-0x0;var _0x508647=_0xed5c[_0x3e747a];return _0x508647;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xced5('0x0'),_0xced5('0x1'),'update'];function createListener(_0x7d9268,_0x4303c5){return function(_0x5edc23){_0x4303c5['emit'](_0x7d9268,_0x5edc23);};}function removeListener(_0x2085c0,_0x3553f1){return function(){MailMessageEvents['removeListener'](_0x2085c0,_0x3553f1);};}exports[_0xced5('0x2')]=function(_0x4a5413){for(var _0x595439=0x0,_0xbe7aba=events[_0xced5('0x3')];_0x595439<_0xbe7aba;_0x595439++){var _0x6a58b9=events[_0x595439];var _0x4ecf0b=createListener(_0xced5('0x4')+_0x6a58b9,_0x4a5413);MailMessageEvents['on'](_0x6a58b9,_0x4ecf0b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a46220e..3068044 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 _0xfa2b=['isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x55c066,_0x580eca){var _0x453857=function(_0x57478d){while(--_0x57478d){_0x55c066['push'](_0x55c066['shift']());}};_0x453857(++_0x580eca);}(_0xfa2b,0xd5));var _0xbfa2=function(_0x5c1b94,_0x201940){_0x5c1b94=_0x5c1b94-0x0;var _0x196459=_0xfa2b[_0x5c1b94];return _0x196459;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var timeout=require(_0xbfa2('0x3'));var express=require(_0xbfa2('0x4'));var router=express[_0xbfa2('0x5')]();var auth=require(_0xbfa2('0x6'));var interaction=require(_0xbfa2('0x7'));var config=require(_0xbfa2('0x8'));var controller=require(_0xbfa2('0x9'));router[_0xbfa2('0xa')]('/',auth[_0xbfa2('0xb')](),controller['index']);router[_0xbfa2('0xa')](_0xbfa2('0xc'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0xd')]);router[_0xbfa2('0xa')](_0xbfa2('0xe'),auth['isAuthenticated'](),controller[_0xbfa2('0xf')]);router[_0xbfa2('0xa')](_0xbfa2('0x10'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x11')]);router[_0xbfa2('0xa')](_0xbfa2('0x12'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x13')]);router[_0xbfa2('0xa')](_0xbfa2('0x14'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x15')]);router[_0xbfa2('0x16')]('/',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x17')]);router[_0xbfa2('0x16')](_0xbfa2('0x12'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x18')]);router[_0xbfa2('0x16')](_0xbfa2('0x14'),auth[_0xbfa2('0xb')](),controller['addAgents']);router[_0xbfa2('0x19')]('/:id',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbfa2('0x1b')]);router[_0xbfa2('0x1c')]('/:id/teams',auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x1d')]);router[_0xbfa2('0x1c')](_0xbfa2('0x14'),auth[_0xbfa2('0xb')](),controller[_0xbfa2('0x1e')]);module[_0xbfa2('0x1f')]=router; \ No newline at end of file +var _0x1db0=['util','express','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','getMembers','getTeams','/:id/users','post','create','/:id/teams','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1db0,0x1cb));var _0x01db=function(_0x163bc9,_0x4b6796){_0x163bc9=_0x163bc9-0x0;var _0xb94e42=_0x1db0[_0x163bc9];return _0xb94e42;};'use strict';var multer=require(_0x01db('0x0'));var util=require(_0x01db('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x01db('0x2'));var router=express['Router']();var auth=require(_0x01db('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x01db('0x4'));var controller=require(_0x01db('0x5'));router[_0x01db('0x6')]('/',auth[_0x01db('0x7')](),controller[_0x01db('0x8')]);router[_0x01db('0x6')](_0x01db('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x01db('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth[_0x01db('0x7')](),controller[_0x01db('0xa')]);router[_0x01db('0x6')]('/:id/teams',auth[_0x01db('0x7')](),controller[_0x01db('0xb')]);router[_0x01db('0x6')](_0x01db('0xc'),auth[_0x01db('0x7')](),controller['getAgents']);router[_0x01db('0xd')]('/',auth[_0x01db('0x7')](),controller[_0x01db('0xe')]);router['post'](_0x01db('0xf'),auth[_0x01db('0x7')](),controller['addTeams']);router['post'](_0x01db('0xc'),auth[_0x01db('0x7')](),controller['addAgents']);router['put'](_0x01db('0x10'),auth[_0x01db('0x7')](),controller[_0x01db('0x11')]);router[_0x01db('0x12')]('/:id',auth[_0x01db('0x7')](),controller[_0x01db('0x13')]);router[_0x01db('0x12')](_0x01db('0xf'),auth[_0x01db('0x7')](),controller[_0x01db('0x14')]);router[_0x01db('0x12')](_0x01db('0xc'),auth[_0x01db('0x7')](),controller[_0x01db('0x15')]);module[_0x01db('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index c255d48..ab94ec8 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 _0x1437=['ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x56588f,_0x539c4a){var _0x300c82=function(_0x486d5e){while(--_0x486d5e){_0x56588f['push'](_0x56588f['shift']());}};_0x300c82(++_0x539c4a);}(_0x1437,0xbd));var _0x7143=function(_0x50307e,_0x36ac46){_0x50307e=_0x50307e-0x0;var _0x3e41fc=_0x1437[_0x50307e];return _0x3e41fc;};'use strict';var Sequelize=require(_0x7143('0x0'));module[_0x7143('0x1')]={'name':{'type':Sequelize[_0x7143('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7143('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7143('0x3')](_0x7143('0x4'),_0x7143('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xdc0a=['exports','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0xc2c0c3,_0x2bf8a9){var _0x292acf=function(_0x192b73){while(--_0x192b73){_0xc2c0c3['push'](_0xc2c0c3['shift']());}};_0x292acf(++_0x2bf8a9);}(_0xdc0a,0x76));var _0xadc0=function(_0x1cdf36,_0x2440af){_0x1cdf36=_0x1cdf36-0x0;var _0x3115fb=_0xdc0a[_0x1cdf36];return _0x3115fb;};'use strict';var Sequelize=require(_0xadc0('0x0'));module[_0xadc0('0x1')]={'name':{'type':Sequelize[_0xadc0('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xadc0('0x2')]},'timeout':{'type':Sequelize[_0xadc0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xadc0('0x4')]('rrmemory',_0xadc0('0x5'),_0xadc0('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 9a9af6a..47d3515 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 _0x459e=['agent','mailPause','updatedAt','%s/%s','getTeams','findOne','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userMailQueue:save','removeTeams','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','ids','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','MailQueue','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','map','type','key','field','merge','options','includeAll','findAll','rows','params','rawAttributes','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','UserMailQueue','nolimit','pick','MailQueueId','filter','User','UserId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x459e,0xab));var _0xe459=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x459e[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0xe459('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe459('0x1'));var moment=require(_0xe459('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe459('0x3'));var util=require('util');var path=require(_0xe459('0x4'));var sox=require(_0xe459('0x5'));var csv=require(_0xe459('0x6'));var ejs=require(_0xe459('0x7'));var fs=require('fs');var _=require(_0xe459('0x8'));var squel=require(_0xe459('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe459('0xa'));var toCsv=require(_0xe459('0x6'));var querystring=require(_0xe459('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe459('0xc'));var qs=require(_0xe459('0xd'));var hardwareService=require(_0xe459('0xe'));var logger=require(_0xe459('0xf'))(_0xe459('0x10'));var utils=require('../../config/utils');var config=require(_0xe459('0x11'));var db=require(_0xe459('0x12'))['db'];config[_0xe459('0x13')]=_[_0xe459('0x14')](config[_0xe459('0x13')],{'host':_0xe459('0x15'),'port':0x18eb});var socket=require(_0xe459('0x16'))(new Redis(config[_0xe459('0x13')]));require(_0xe459('0x17'))['register'](socket);function respondWithStatusCode(_0x2c6423,_0x9404d){_0x9404d=_0x9404d||0xcc;return function(_0x58d0d9){if(_0x58d0d9){return _0x2c6423[_0xe459('0x18')](_0x9404d);}return _0x2c6423[_0xe459('0x19')](_0x9404d)[_0xe459('0x1a')]();};}function respondWithResult(_0x28c7f2,_0x104b6b){_0x104b6b=_0x104b6b||0xc8;return function(_0x46406b){if(_0x46406b){return _0x28c7f2[_0xe459('0x19')](_0x104b6b)[_0xe459('0x1b')](_0x46406b);}};}function respondWithFilteredResult(_0x1f9826,_0x494bf4){return function(_0x2d62a8){if(_0x2d62a8){var _0x3a9e1d=_0x2d62a8[_0xe459('0x1c')],_0x51d0ba=_0x494bf4[_0xe459('0x1d')],_0x170857=_0x494bf4[_0xe459('0x1d')]+_0x494bf4['limit'],_0x9c2aaf;if(_0x170857>=_0x3a9e1d){_0x170857=_0x3a9e1d;_0x9c2aaf=0xc8;}else{_0x9c2aaf=0xce;}_0x1f9826[_0xe459('0x19')](_0x9c2aaf);return _0x1f9826[_0xe459('0x1e')](_0xe459('0x1f'),_0x51d0ba+'-'+_0x170857+'/'+_0x3a9e1d)[_0xe459('0x1b')](_0x2d62a8);}return null;};}function patchUpdates(_0x18afe3){return function(_0x2d7a19){try{jsonpatch['apply'](_0x2d7a19,_0x18afe3,!![]);}catch(_0x59ea27){return BPromise[_0xe459('0x20')](_0x59ea27);}return _0x2d7a19['save']();};}function saveUpdates(_0x48bdda,_0x136479){return function(_0x82af03){if(_0x82af03){return _0x82af03[_0xe459('0x21')](_0x48bdda)[_0xe459('0x22')](function(_0x5590fe){return _0x5590fe;});}return null;};}function removeEntity(_0x3f67dd,_0x3ab7eb){return function(_0x284151){if(_0x284151){return _0x284151[_0xe459('0x23')]()[_0xe459('0x22')](function(){var _0xec9b91=_0x284151[_0xe459('0x24')]({'plain':!![]});var _0x3d1530=_0xe459('0x25');return db[_0xe459('0x26')][_0xe459('0x23')]({'where':{'type':_0x3d1530,'resourceId':_0xec9b91['id']}})[_0xe459('0x22')](function(){return _0x284151;});})['then'](function(){_0x3f67dd[_0xe459('0x19')](0xcc)[_0xe459('0x1a')]();});}};}function handleEntityNotFound(_0x5858c3,_0x476ca0){return function(_0x24a315){if(!_0x24a315){_0x5858c3['sendStatus'](0x194);}return _0x24a315;};}function handleError(_0x41efae,_0x131199){_0x131199=_0x131199||0x1f4;return function(_0x17b32d){logger['error'](_0x17b32d[_0xe459('0x27')]);if(_0x17b32d[_0xe459('0x28')]){delete _0x17b32d[_0xe459('0x28')];}_0x41efae[_0xe459('0x19')](_0x131199)[_0xe459('0x29')](_0x17b32d);};}exports[_0xe459('0x2a')]=function(_0x5f3a6a,_0xcefcc4){var _0x2f3704={},_0x5c3893={},_0x1abc03={'count':0x0,'rows':[]};var _0x19617a=db[_0xe459('0x2b')]['rawAttributes'];_0x5c3893['model']=_[_0xe459('0x2c')](_0x19617a);_0x5c3893['query']=_['keys'](_0x5f3a6a[_0xe459('0x2d')]);_0x5c3893[_0xe459('0x2e')]=_[_0xe459('0x2f')](_0x5c3893[_0xe459('0x30')],_0x5c3893[_0xe459('0x2d')]);_0x2f3704[_0xe459('0x31')]=_['intersection'](_0x5c3893['model'],qs[_0xe459('0x32')](_0x5f3a6a[_0xe459('0x2d')]['fields']));_0x2f3704[_0xe459('0x31')]=_0x2f3704['attributes']['length']?_0x2f3704[_0xe459('0x31')]:_0x5c3893[_0xe459('0x30')];if(!_0x5f3a6a['query'][_0xe459('0x33')]('nolimit')){_0x2f3704[_0xe459('0x34')]=qs[_0xe459('0x34')](_0x5f3a6a['query'][_0xe459('0x34')]);_0x2f3704[_0xe459('0x1d')]=qs[_0xe459('0x1d')](_0x5f3a6a[_0xe459('0x2d')][_0xe459('0x1d')]);}_0x2f3704[_0xe459('0x35')]=qs[_0xe459('0x36')](_0x5f3a6a['query']['sort']);_0x2f3704['where']=qs[_0xe459('0x2e')](_['pick'](_0x5f3a6a[_0xe459('0x2d')],_0x5c3893[_0xe459('0x2e')]));if(_0x5f3a6a['query']['filter']){_0x2f3704['where']=_['merge'](_0x2f3704[_0xe459('0x37')],{'$or':_[_0xe459('0x38')](_0x19617a,function(_0x188922){if(_0x188922[_0xe459('0x39')][_0xe459('0x3a')]!=='VIRTUAL'){var _0x27d703={};_0x27d703[_0x188922[_0xe459('0x3b')]]={'$like':'%'+_0x5f3a6a[_0xe459('0x2d')]['filter']+'%'};return _0x27d703;}})});}_0x2f3704=_[_0xe459('0x3c')]({},_0x2f3704,_0x5f3a6a[_0xe459('0x3d')]);var _0x28fb1c={'where':_0x2f3704[_0xe459('0x37')]};return db[_0xe459('0x2b')]['count'](_0x28fb1c)[_0xe459('0x22')](function(_0x66292f){_0x1abc03[_0xe459('0x1c')]=_0x66292f;if(_0x5f3a6a[_0xe459('0x2d')][_0xe459('0x3e')]){_0x2f3704['include']=[{'all':!![]}];}return db['MailQueue'][_0xe459('0x3f')](_0x2f3704);})[_0xe459('0x22')](function(_0x1cc3eb){_0x1abc03[_0xe459('0x40')]=_0x1cc3eb;return _0x1abc03;})[_0xe459('0x22')](respondWithFilteredResult(_0xcefcc4,_0x2f3704))['catch'](handleError(_0xcefcc4,null));};exports['show']=function(_0x323a4d,_0xbc7cac){var _0x265eb0={'raw':!![],'where':{'id':_0x323a4d[_0xe459('0x41')]['id']}},_0x30e146={};_0x30e146[_0xe459('0x30')]=_[_0xe459('0x2c')](db[_0xe459('0x2b')][_0xe459('0x42')]);_0x30e146[_0xe459('0x2d')]=_[_0xe459('0x2c')](_0x323a4d[_0xe459('0x2d')]);_0x30e146[_0xe459('0x2e')]=_[_0xe459('0x2f')](_0x30e146[_0xe459('0x30')],_0x30e146['query']);_0x265eb0[_0xe459('0x31')]=_[_0xe459('0x2f')](_0x30e146[_0xe459('0x30')],qs[_0xe459('0x32')](_0x323a4d[_0xe459('0x2d')][_0xe459('0x32')]));_0x265eb0[_0xe459('0x31')]=_0x265eb0[_0xe459('0x31')][_0xe459('0x43')]?_0x265eb0[_0xe459('0x31')]:_0x30e146[_0xe459('0x30')];if(_0x323a4d[_0xe459('0x2d')][_0xe459('0x3e')]){_0x265eb0[_0xe459('0x44')]=[{'all':!![]}];}_0x265eb0=_[_0xe459('0x3c')]({},_0x265eb0,_0x323a4d['options']);return db[_0xe459('0x2b')][_0xe459('0x45')](_0x265eb0)[_0xe459('0x22')](handleEntityNotFound(_0xbc7cac,null))[_0xe459('0x22')](respondWithResult(_0xbc7cac,null))[_0xe459('0x46')](handleError(_0xbc7cac,null));};exports['create']=function(_0x5044af,_0x45c4a0){return db['MailQueue'][_0xe459('0x47')](_0x5044af[_0xe459('0x48')],{})[_0xe459('0x22')](function(_0x463ad5){var _0x23369f=_0x5044af['user'][_0xe459('0x24')]({'plain':!![]});if(!_0x23369f)throw new Error(_0xe459('0x49'));if(_0x23369f[_0xe459('0x4a')]===_0xe459('0x4b')){var _0x305b4c=_0x463ad5[_0xe459('0x24')]({'plain':!![]});var _0x3e287a='MailQueues';return db[_0xe459('0x4c')][_0xe459('0x45')]({'where':{'name':_0x3e287a,'userProfileId':_0x23369f[_0xe459('0x4d')]},'raw':!![]})[_0xe459('0x22')](function(_0x41e5eb){if(_0x41e5eb&&_0x41e5eb[_0xe459('0x4e')]===0x0){return db['UserProfileResource'][_0xe459('0x47')]({'name':_0x305b4c[_0xe459('0x28')],'resourceId':_0x305b4c['id'],'type':_0x41e5eb[_0xe459('0x28')],'sectionId':_0x41e5eb['id']},{})[_0xe459('0x22')](function(){return _0x463ad5;});}else{return _0x463ad5;}})[_0xe459('0x46')](function(_0x2eaaef){logger[_0xe459('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eaaef);throw _0x2eaaef;});}return _0x463ad5;})[_0xe459('0x22')](respondWithResult(_0x45c4a0,0xc9))['catch'](handleError(_0x45c4a0,null));};exports['update']=function(_0x473edd,_0x36827a){if(_0x473edd[_0xe459('0x48')]['id']){delete _0x473edd[_0xe459('0x48')]['id'];}return db[_0xe459('0x2b')][_0xe459('0x45')]({'where':{'id':_0x473edd[_0xe459('0x41')]['id']}})['then'](handleEntityNotFound(_0x36827a,null))[_0xe459('0x22')](saveUpdates(_0x473edd[_0xe459('0x48')],null))['then'](respondWithResult(_0x36827a,null))[_0xe459('0x46')](handleError(_0x36827a,null));};exports[_0xe459('0x23')]=function(_0x37f9ca,_0x1f14c8){return db['MailQueue'][_0xe459('0x45')]({'where':{'id':_0x37f9ca[_0xe459('0x41')]['id']}})[_0xe459('0x22')](handleEntityNotFound(_0x1f14c8,null))['then'](removeEntity(_0x1f14c8,null))['catch'](handleError(_0x1f14c8,null));};exports[_0xe459('0x50')]=function(_0x5b3436,_0x2e7f8a){return db[_0xe459('0x2b')][_0xe459('0x50')]()[_0xe459('0x22')](respondWithResult(_0x2e7f8a,null))[_0xe459('0x46')](handleError(_0x2e7f8a,null));};exports[_0xe459('0x51')]=function(_0x437c7e,_0x1790e5,_0x3e29bb){var _0x307499={'raw':!![],'where':{}},_0x2eebfe={},_0x1a4cd1;return db[_0xe459('0x2b')]['findOne']({'where':{'id':_0x437c7e['params']['id']}})[_0xe459('0x22')](handleEntityNotFound(_0x1790e5,null))[_0xe459('0x22')](function(_0x358a82){if(_0x358a82){_0x1a4cd1=_0x358a82[_0xe459('0x24')]({'plain':!![]});_0x2eebfe['model']=_[_0xe459('0x2c')](db[_0xe459('0x52')][_0xe459('0x42')]);_0x2eebfe[_0xe459('0x2d')]=_[_0xe459('0x2c')](_0x437c7e[_0xe459('0x2d')]);_0x2eebfe[_0xe459('0x2e')]=_[_0xe459('0x2f')](_0x2eebfe[_0xe459('0x30')],_0x2eebfe[_0xe459('0x2d')]);_0x307499['attributes']=_[_0xe459('0x2f')](_0x2eebfe[_0xe459('0x30')],qs[_0xe459('0x32')](_0x437c7e[_0xe459('0x2d')]['fields']));_0x307499[_0xe459('0x31')]=_0x307499[_0xe459('0x31')][_0xe459('0x43')]?_0x307499['attributes']:_0x2eebfe[_0xe459('0x30')];if(!_0x437c7e[_0xe459('0x2d')]['hasOwnProperty'](_0xe459('0x53'))){_0x307499[_0xe459('0x34')]=qs[_0xe459('0x34')](_0x437c7e[_0xe459('0x2d')][_0xe459('0x34')]);_0x307499['offset']=qs[_0xe459('0x1d')](_0x437c7e[_0xe459('0x2d')][_0xe459('0x1d')]);}_0x307499[_0xe459('0x35')]=qs[_0xe459('0x36')](_0x437c7e[_0xe459('0x2d')][_0xe459('0x36')]);_0x307499[_0xe459('0x37')]=qs['filters'](_[_0xe459('0x54')](_0x437c7e['query'],_0x2eebfe[_0xe459('0x2e')]));_0x307499[_0xe459('0x37')][_0xe459('0x55')]=_0x358a82['id'];if(_0x437c7e[_0xe459('0x2d')][_0xe459('0x56')]){_0x307499['where']=_[_0xe459('0x3c')](_0x307499[_0xe459('0x37')],{'$or':_[_0xe459('0x38')](_0x307499[_0xe459('0x31')],function(_0x1751f7){var _0x230fa2={};_0x230fa2[_0x1751f7]={'$like':'%'+_0x437c7e['query'][_0xe459('0x56')]+'%'};return _0x230fa2;})});}_0x307499=_[_0xe459('0x3c')]({},_0x307499,_0x437c7e[_0xe459('0x3d')]);return db[_0xe459('0x52')][_0xe459('0x3f')](_0x307499);}})[_0xe459('0x22')](function(_0xedbff4){if(_0xedbff4){return db[_0xe459('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0xedbff4,_0xe459('0x58')),'role':_0xe459('0x59')},'attributes':['id',_0xe459('0x28'),_0xe459('0x5a'),_0xe459('0x5b'),'createdAt']});}})[_0xe459('0x22')](function(_0x483c44){if(_0x483c44){return{'count':_0x483c44[_0xe459('0x1c')],'rows':_['map'](_0x483c44[_0xe459('0x40')],function(_0x21bc14){return{'membername':_0x21bc14[_0xe459('0x28')],'UserId':_0x21bc14['id'],'queue_name':_0x1a4cd1[_0xe459('0x28')],'MailQueueId':_0x1a4cd1['id'],'interface':util['format'](_0xe459('0x5c'),'SIP',_0x21bc14[_0xe459('0x28')]),'penalty':0x0,'paused':_0x21bc14['mailPause'],'createdAt':_0x21bc14['createdAt'],'updatedAt':_0x21bc14[_0xe459('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe459('0x22')](respondWithFilteredResult(_0x1790e5,_0x307499))[_0xe459('0x46')](handleError(_0x1790e5,null));};exports[_0xe459('0x5d')]=function(_0x42d4cf,_0x3eb2aa,_0x187932){var _0x172e09={};var _0x279866={};var _0x14bf33;var _0x5d96b8;return db[_0xe459('0x2b')][_0xe459('0x5e')]({'where':{'id':_0x42d4cf['params']['id']}})['then'](handleEntityNotFound(_0x3eb2aa,null))[_0xe459('0x22')](function(_0x3b2965){if(_0x3b2965){_0x14bf33=_0x3b2965;_0x279866[_0xe459('0x30')]=_['keys'](db['Team']['rawAttributes']);_0x279866['query']=_[_0xe459('0x2c')](_0x42d4cf[_0xe459('0x2d')]);_0x279866[_0xe459('0x2e')]=_[_0xe459('0x2f')](_0x279866[_0xe459('0x30')],_0x279866[_0xe459('0x2d')]);_0x172e09[_0xe459('0x31')]=_['intersection'](_0x279866['model'],qs[_0xe459('0x32')](_0x42d4cf[_0xe459('0x2d')][_0xe459('0x32')]));_0x172e09[_0xe459('0x31')]=_0x172e09[_0xe459('0x31')][_0xe459('0x43')]?_0x172e09['attributes']:_0x279866[_0xe459('0x30')];_0x172e09['order']=qs[_0xe459('0x36')](_0x42d4cf['query'][_0xe459('0x36')]);_0x172e09[_0xe459('0x37')]=qs[_0xe459('0x2e')](_['pick'](_0x42d4cf['query'],_0x279866['filters']));if(_0x42d4cf[_0xe459('0x2d')][_0xe459('0x56')]){_0x172e09[_0xe459('0x37')]=_[_0xe459('0x3c')](_0x172e09[_0xe459('0x37')],{'$or':_[_0xe459('0x38')](_0x172e09[_0xe459('0x31')],function(_0x5dc925){var _0x5395c0={};_0x5395c0[_0x5dc925]={'$like':'%'+_0x42d4cf['query']['filter']+'%'};return _0x5395c0;})});}_0x172e09=_[_0xe459('0x3c')]({},_0x172e09,_0x42d4cf[_0xe459('0x3d')]);return _0x14bf33['getTeams'](_0x172e09);}})[_0xe459('0x22')](function(_0x1adc26){if(_0x1adc26){_0x5d96b8=_0x1adc26[_0xe459('0x43')];if(!_0x42d4cf[_0xe459('0x2d')]['hasOwnProperty'](_0xe459('0x53'))){_0x172e09[_0xe459('0x34')]=qs[_0xe459('0x34')](_0x42d4cf[_0xe459('0x2d')][_0xe459('0x34')]);_0x172e09['offset']=qs['offset'](_0x42d4cf[_0xe459('0x2d')][_0xe459('0x1d')]);}return _0x14bf33[_0xe459('0x5d')](_0x172e09);}})[_0xe459('0x22')](function(_0x5cfd10){if(_0x5cfd10){return _0x5cfd10?{'count':_0x5d96b8,'rows':_0x5cfd10}:null;}})[_0xe459('0x22')](respondWithResult(_0x3eb2aa,null))['catch'](handleError(_0x3eb2aa,null));};exports[_0xe459('0x5f')]=function(_0x49ab7a,_0x4c52d7,_0x10a6c1){var _0x12f72f=_0x49ab7a[_0xe459('0x48')][_0xe459('0x60')];return db[_0xe459('0x61')][_0xe459('0x3f')]({'where':{'id':_[_0xe459('0x38')](_0x12f72f,'id')},'attributes':['id'],'include':[{'model':db[_0xe459('0x57')],'as':_0xe459('0x62'),'attributes':['id',_0xe459('0x28'),_0xe459('0x63'),_0xe459('0x64'),_0xe459('0x65')],'raw':!![]}]})[_0xe459('0x22')](function(_0x2c83a9){if(_0x2c83a9){var _0x4ec74f=_[_0xe459('0x66')](_0x2c83a9,function(_0x42af63){var _0x2b79a5=_0x42af63[_0xe459('0x24')]({'plain':!![]});return _0x2b79a5[_0xe459('0x62')];});return db[_0xe459('0x2b')][_0xe459('0x45')]({'where':{'id':_0x49ab7a[_0xe459('0x41')]['id']}})['then'](function(_0x32bb81){return db[_0xe459('0x67')]['transaction'](function(_0x47b365){return _0x32bb81[_0xe459('0x5f')](_['map'](_0x12f72f,'id'),{'transaction':_0x47b365})['then'](function(){return BPromise[_0xe459('0x68')](_0x4ec74f,function(_0x31f209){return db[_0xe459('0x52')]['findOrCreate']({'where':{'UserId':_0x31f209['id'],'MailQueueId':_0x49ab7a['params']['id']},'transaction':_0x47b365});});})[_0xe459('0x22')](function(){_0x4ec74f[_0xe459('0x69')](function(_0x21d272){socket[_0xe459('0x6a')](_0xe459('0x6b'),{'UserId':_0x21d272['id'],'MailQueueId':_0x32bb81['id']});});});});});}})[_0xe459('0x22')](respondWithStatusCode(_0x4c52d7,null))[_0xe459('0x46')](handleError(_0x4c52d7,null));};exports[_0xe459('0x6c')]=function(_0x2190ef,_0x293459,_0x3e694e){return db[_0xe459('0x61')][_0xe459('0x3f')]({'where':{'id':_0x2190ef[_0xe459('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe459('0x57')],'as':_0xe459('0x62'),'attributes':['id'],'raw':!![]}]})[_0xe459('0x22')](handleEntityNotFound(_0x293459,null))[_0xe459('0x22')](function(_0x1c1918){var _0x3583bb=_[_0xe459('0x38')](_0x1c1918,'id');var _0x38f4a8=[];var _0x57221c=[];var _0x3692de=squel['select']();_0x3692de[_0xe459('0x3b')](_0xe459('0x6d'))['from'](_0xe459('0x6e'),'tq')[_0xe459('0x6f')](_0xe459('0x70'),'ut',_0xe459('0x71'))[_0xe459('0x37')](_0xe459('0x72'),_0x2190ef['params']['id']);for(var _0x5b3f45=0x0;_0x5b3f45<_0x1c1918[_0xe459('0x43')];_0x5b3f45+=0x1){let _0x322142=_0x1c1918[_0x5b3f45];for(var _0x2d1f84=0x0;_0x2d1f84<_0x322142[_0xe459('0x62')][_0xe459('0x43')];_0x2d1f84+=0x1){let _0x3efdc8=_0x322142[_0xe459('0x62')][_0x2d1f84];var _0x231915=_0x3692de['clone']();_0x231915['where'](_0xe459('0x73'),_0x3efdc8['id']);_0x57221c[_0xe459('0x74')](db[_0xe459('0x67')][_0xe459('0x2d')](_0x231915[_0xe459('0x75')](),{'type':db[_0xe459('0x67')]['QueryTypes']['SELECT']})[_0xe459('0x22')](function(_0x2da0b0){if(_0x2da0b0[_0xe459('0x43')]===0x1){return _0x3efdc8['id'];}else{var _0xd1a71=_[_0xe459('0x76')](_[_0xe459('0x38')](_0x2da0b0,_0xe459('0x77')),function(_0xc0daea){return _[_0xe459('0x78')](_0x3583bb,_0xc0daea);});if(_0xd1a71){return _0x3efdc8['id'];}}}));}}return BPromise[_0xe459('0x79')](_0x57221c)[_0xe459('0x22')](function(_0x1dd2a6){_0x38f4a8=_(_0x38f4a8)[_0xe459('0x7a')](_0x1dd2a6)['compact']()['value']();return db[_0xe459('0x2b')][_0xe459('0x45')]({'where':{'id':_0x2190ef['params']['id']}})[_0xe459('0x22')](function(_0x2e1305){return db[_0xe459('0x67')]['transaction'](function(_0x5d1905){return _0x2e1305['removeTeams'](_0x2190ef[_0xe459('0x2d')][_0xe459('0x7b')],{'transaction':_0x5d1905})[_0xe459('0x22')](function(){if(!_['isEmpty'](_0x38f4a8)){return _0x2e1305[_0xe459('0x7c')](_0x38f4a8,{'transaction':_0x5d1905});}})[_0xe459('0x22')](function(){_0x38f4a8[_0xe459('0x69')](function(_0x691da9){socket['emit'](_0xe459('0x7d'),{'UserId':_0x691da9,'MailQueueId':_0x2e1305['id']});});});});});});})[_0xe459('0x22')](respondWithStatusCode(_0x293459,null))[_0xe459('0x46')](handleError(_0x293459,null));};exports[_0xe459('0x7e')]=function(_0xf2c069,_0x8f636b,_0x2de547){return db[_0xe459('0x2b')]['find']({'where':{'id':_0xf2c069[_0xe459('0x41')]['id']}})['then'](handleEntityNotFound(_0x8f636b,null))[_0xe459('0x22')](function(_0x49cc6e){if(_0x49cc6e){return _0x49cc6e['addAgents'](_0xf2c069[_0xe459('0x48')][_0xe459('0x7b')],_['omit'](_0xf2c069[_0xe459('0x48')],['ids','id'])||{})[_0xe459('0x7f')](function(_0x3632d){for(var _0x2ce4ad=0x0;_0x2ce4ad<_0xf2c069[_0xe459('0x48')][_0xe459('0x7b')][_0xe459('0x43')];_0x2ce4ad+=0x1){socket['emit'](_0xe459('0x6b'),{'UserId':_0xf2c069['body'][_0xe459('0x7b')][_0x2ce4ad],'MailQueueId':_0xf2c069[_0xe459('0x41')]['id']});}return _0x3632d;});}})[_0xe459('0x22')](respondWithResult(_0x8f636b,null))[_0xe459('0x46')](handleError(_0x8f636b,null));};exports['removeAgents']=function(_0x205c8e,_0x38f45f,_0x214913){return db[_0xe459('0x2b')]['find']({'where':{'id':_0x205c8e['params']['id']}})[_0xe459('0x22')](handleEntityNotFound(_0x38f45f,null))[_0xe459('0x22')](function(_0x514300){if(_0x514300){return _0x514300[_0xe459('0x7c')](_0x205c8e[_0xe459('0x2d')]['ids'])[_0xe459('0x22')](function(){if(_[_0xe459('0x80')](_0x205c8e[_0xe459('0x2d')][_0xe459('0x7b')])){for(var _0x21595f=0x0;_0x21595f<_0x205c8e['query'][_0xe459('0x7b')][_0xe459('0x43')];_0x21595f+=0x1){socket[_0xe459('0x6a')](_0xe459('0x7d'),{'UserId':Number(_0x205c8e[_0xe459('0x2d')][_0xe459('0x7b')][_0x21595f]),'MailQueueId':Number(_0x205c8e[_0xe459('0x41')]['id'])});}}else{socket[_0xe459('0x6a')](_0xe459('0x7d'),{'UserId':Number(_0x205c8e[_0xe459('0x2d')][_0xe459('0x7b')]),'MailQueueId':Number(_0x205c8e[_0xe459('0x41')]['id'])});}});}})[_0xe459('0x22')](respondWithStatusCode(_0x38f45f,null))[_0xe459('0x46')](handleError(_0x38f45f,null));};exports[_0xe459('0x81')]=function(_0x3bf103,_0x38c4e9,_0x36be71){var _0x24657e={};var _0xe30ab7={};var _0x1560c8;var _0x4c5ca7;return db[_0xe459('0x2b')][_0xe459('0x5e')]({'where':{'id':_0x3bf103['params']['id']}})[_0xe459('0x22')](handleEntityNotFound(_0x38c4e9,null))['then'](function(_0x50da4e){if(_0x50da4e){_0x1560c8=_0x50da4e;_0xe30ab7[_0xe459('0x30')]=_[_0xe459('0x2c')](db[_0xe459('0x57')][_0xe459('0x42')]);_0xe30ab7[_0xe459('0x2d')]=_[_0xe459('0x2c')](_0x3bf103['query']);_0xe30ab7[_0xe459('0x2e')]=_[_0xe459('0x2f')](_0xe30ab7[_0xe459('0x30')],_0xe30ab7[_0xe459('0x2d')]);_0x24657e[_0xe459('0x31')]=_[_0xe459('0x2f')](_0xe30ab7[_0xe459('0x30')],qs[_0xe459('0x32')](_0x3bf103['query'][_0xe459('0x32')]));_0x24657e['attributes']=_0x24657e[_0xe459('0x31')]['length']?_0x24657e[_0xe459('0x31')]:_0xe30ab7[_0xe459('0x30')];_0x24657e['order']=qs[_0xe459('0x36')](_0x3bf103[_0xe459('0x2d')][_0xe459('0x36')]);_0x24657e[_0xe459('0x37')]=qs[_0xe459('0x2e')](_[_0xe459('0x54')](_0x3bf103[_0xe459('0x2d')],_0xe30ab7[_0xe459('0x2e')]));if(_0x3bf103[_0xe459('0x2d')][_0xe459('0x56')]){_0x24657e[_0xe459('0x37')]=_[_0xe459('0x3c')](_0x24657e[_0xe459('0x37')],{'$or':_[_0xe459('0x38')](_0x24657e['attributes'],function(_0x16af57){var _0x542525={};_0x542525[_0x16af57]={'$like':'%'+_0x3bf103[_0xe459('0x2d')]['filter']+'%'};return _0x542525;})});}_0x24657e=_[_0xe459('0x3c')]({},_0x24657e,_0x3bf103['options']);return _0x1560c8[_0xe459('0x81')](_0x24657e);}})[_0xe459('0x22')](function(_0x1605c1){if(_0x1605c1){_0x4c5ca7=_0x1605c1[_0xe459('0x43')];if(!_0x3bf103['query']['hasOwnProperty'](_0xe459('0x53'))){_0x24657e[_0xe459('0x34')]=qs[_0xe459('0x34')](_0x3bf103['query'][_0xe459('0x34')]);_0x24657e[_0xe459('0x1d')]=qs[_0xe459('0x1d')](_0x3bf103[_0xe459('0x2d')][_0xe459('0x1d')]);}return _0x1560c8[_0xe459('0x81')](_0x24657e);}})[_0xe459('0x22')](function(_0x2e2950){if(_0x2e2950){return _0x2e2950?{'count':_0x4c5ca7,'rows':_0x2e2950}:null;}})['then'](respondWithResult(_0x38c4e9,null))[_0xe459('0x46')](handleError(_0x38c4e9,null));}; \ No newline at end of file +var _0x1c16=['TeamId','includes','all','compact','value','sequelize','removeAgents','emit','addAgents','omit','isArray','userMailQueue:remove','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','limit','apply','save','update','then','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','MailQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','MailQueueId','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','teams','User','voicePause','interface','Agents','transaction','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every'];(function(_0x583bf0,_0x4b59aa){var _0x210ec6=function(_0x3a7abb){while(--_0x3a7abb){_0x583bf0['push'](_0x583bf0['shift']());}};_0x210ec6(++_0x4b59aa);}(_0x1c16,0x1b3));var _0x61c1=function(_0x9a2f5,_0x6095ba){_0x9a2f5=_0x9a2f5-0x0;var _0x1b9757=_0x1c16[_0x9a2f5];return _0x1b9757;};'use strict';var pdf=require(_0x61c1('0x0'));var emlformat=require(_0x61c1('0x1'));var rimraf=require(_0x61c1('0x2'));var zipdir=require(_0x61c1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61c1('0x4'));var moment=require(_0x61c1('0x5'));var BPromise=require(_0x61c1('0x6'));var Mustache=require(_0x61c1('0x7'));var util=require(_0x61c1('0x8'));var path=require(_0x61c1('0x9'));var sox=require(_0x61c1('0xa'));var csv=require(_0x61c1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x61c1('0xc'));var squel=require(_0x61c1('0xd'));var crypto=require(_0x61c1('0xe'));var jsforce=require(_0x61c1('0xf'));var deskjs=require(_0x61c1('0x10'));var toCsv=require(_0x61c1('0xb'));var querystring=require(_0x61c1('0x11'));var Papa=require(_0x61c1('0x12'));var Redis=require(_0x61c1('0x13'));var authService=require(_0x61c1('0x14'));var qs=require(_0x61c1('0x15'));var hardwareService=require(_0x61c1('0x16'));var logger=require(_0x61c1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x61c1('0x18'));var db=require(_0x61c1('0x19'))['db'];config[_0x61c1('0x1a')]=_[_0x61c1('0x1b')](config[_0x61c1('0x1a')],{'host':_0x61c1('0x1c'),'port':0x18eb});var socket=require(_0x61c1('0x1d'))(new Redis(config[_0x61c1('0x1a')]));require(_0x61c1('0x1e'))[_0x61c1('0x1f')](socket);function respondWithStatusCode(_0x9a3e71,_0x3b75f7){_0x3b75f7=_0x3b75f7||0xcc;return function(_0x5236c7){if(_0x5236c7){return _0x9a3e71['sendStatus'](_0x3b75f7);}return _0x9a3e71[_0x61c1('0x20')](_0x3b75f7)['end']();};}function respondWithResult(_0x3a3322,_0x5348f8){_0x5348f8=_0x5348f8||0xc8;return function(_0x535be3){if(_0x535be3){return _0x3a3322['status'](_0x5348f8)[_0x61c1('0x21')](_0x535be3);}};}function respondWithFilteredResult(_0x15cc33,_0x3156aa){return function(_0x15e6f1){if(_0x15e6f1){var _0x5cd12f=_0x15e6f1['count'],_0x5da95f=_0x3156aa[_0x61c1('0x22')],_0x4ee5b9=_0x3156aa[_0x61c1('0x22')]+_0x3156aa[_0x61c1('0x23')],_0x89aec4;if(_0x4ee5b9>=_0x5cd12f){_0x4ee5b9=_0x5cd12f;_0x89aec4=0xc8;}else{_0x89aec4=0xce;}_0x15cc33['status'](_0x89aec4);return _0x15cc33['set']('Content-Range',_0x5da95f+'-'+_0x4ee5b9+'/'+_0x5cd12f)['json'](_0x15e6f1);}return null;};}function patchUpdates(_0x54017d){return function(_0x172070){try{jsonpatch[_0x61c1('0x24')](_0x172070,_0x54017d,!![]);}catch(_0x4ddc08){return BPromise['reject'](_0x4ddc08);}return _0x172070[_0x61c1('0x25')]();};}function saveUpdates(_0x3d1691,_0x10306f){return function(_0x1f7d68){if(_0x1f7d68){return _0x1f7d68[_0x61c1('0x26')](_0x3d1691)[_0x61c1('0x27')](function(_0x59c54b){return _0x59c54b;});}return null;};}function removeEntity(_0x17d330,_0x281f1a){return function(_0xcc769a){if(_0xcc769a){return _0xcc769a['destroy']()[_0x61c1('0x27')](function(){var _0x5b20de=_0xcc769a['get']({'plain':!![]});var _0x3cd244='MailQueues';return db[_0x61c1('0x28')][_0x61c1('0x29')]({'where':{'type':_0x3cd244,'resourceId':_0x5b20de['id']}})[_0x61c1('0x27')](function(){return _0xcc769a;});})[_0x61c1('0x27')](function(){_0x17d330['status'](0xcc)[_0x61c1('0x2a')]();});}};}function handleEntityNotFound(_0x521217,_0x2589b1){return function(_0x5adaa6){if(!_0x5adaa6){_0x521217[_0x61c1('0x2b')](0x194);}return _0x5adaa6;};}function handleError(_0x7e38c5,_0x5299a2){_0x5299a2=_0x5299a2||0x1f4;return function(_0x46b267){logger[_0x61c1('0x2c')](_0x46b267[_0x61c1('0x2d')]);if(_0x46b267[_0x61c1('0x2e')]){delete _0x46b267[_0x61c1('0x2e')];}_0x7e38c5['status'](_0x5299a2)[_0x61c1('0x2f')](_0x46b267);};}exports[_0x61c1('0x30')]=function(_0xee6945,_0xd3969a){var _0x11255c={},_0x5cbcc7={},_0x3e6421={'count':0x0,'rows':[]};var _0x37bda7=db[_0x61c1('0x31')][_0x61c1('0x32')];_0x5cbcc7[_0x61c1('0x33')]=_[_0x61c1('0x34')](_0x37bda7);_0x5cbcc7[_0x61c1('0x35')]=_[_0x61c1('0x34')](_0xee6945[_0x61c1('0x35')]);_0x5cbcc7[_0x61c1('0x36')]=_[_0x61c1('0x37')](_0x5cbcc7[_0x61c1('0x33')],_0x5cbcc7[_0x61c1('0x35')]);_0x11255c['attributes']=_[_0x61c1('0x37')](_0x5cbcc7[_0x61c1('0x33')],qs['fields'](_0xee6945[_0x61c1('0x35')][_0x61c1('0x38')]));_0x11255c[_0x61c1('0x39')]=_0x11255c[_0x61c1('0x39')][_0x61c1('0x3a')]?_0x11255c['attributes']:_0x5cbcc7['model'];if(!_0xee6945['query'][_0x61c1('0x3b')](_0x61c1('0x3c'))){_0x11255c[_0x61c1('0x23')]=qs[_0x61c1('0x23')](_0xee6945[_0x61c1('0x35')][_0x61c1('0x23')]);_0x11255c[_0x61c1('0x22')]=qs[_0x61c1('0x22')](_0xee6945[_0x61c1('0x35')][_0x61c1('0x22')]);}_0x11255c[_0x61c1('0x3d')]=qs[_0x61c1('0x3e')](_0xee6945['query'][_0x61c1('0x3e')]);_0x11255c[_0x61c1('0x3f')]=qs[_0x61c1('0x36')](_[_0x61c1('0x40')](_0xee6945['query'],_0x5cbcc7[_0x61c1('0x36')]));if(_0xee6945[_0x61c1('0x35')][_0x61c1('0x41')]){_0x11255c[_0x61c1('0x3f')]=_[_0x61c1('0x42')](_0x11255c[_0x61c1('0x3f')],{'$or':_[_0x61c1('0x43')](_0x37bda7,function(_0x3e5ac3){if(_0x3e5ac3['type'][_0x61c1('0x44')]!==_0x61c1('0x45')){var _0x18f443={};_0x18f443[_0x3e5ac3[_0x61c1('0x46')]]={'$like':'%'+_0xee6945[_0x61c1('0x35')][_0x61c1('0x41')]+'%'};return _0x18f443;}})});}_0x11255c=_[_0x61c1('0x42')]({},_0x11255c,_0xee6945[_0x61c1('0x47')]);var _0x5ed0e7={'where':_0x11255c['where']};return db[_0x61c1('0x31')][_0x61c1('0x48')](_0x5ed0e7)['then'](function(_0x3d4406){_0x3e6421[_0x61c1('0x48')]=_0x3d4406;if(_0xee6945[_0x61c1('0x35')][_0x61c1('0x49')]){_0x11255c[_0x61c1('0x4a')]=[{'all':!![]}];}return db[_0x61c1('0x31')][_0x61c1('0x4b')](_0x11255c);})[_0x61c1('0x27')](function(_0x22b2a4){_0x3e6421[_0x61c1('0x4c')]=_0x22b2a4;return _0x3e6421;})['then'](respondWithFilteredResult(_0xd3969a,_0x11255c))[_0x61c1('0x4d')](handleError(_0xd3969a,null));};exports[_0x61c1('0x4e')]=function(_0x5a9849,_0x5e3896){var _0x3a2760={'raw':!![],'where':{'id':_0x5a9849[_0x61c1('0x4f')]['id']}},_0x32c580={};_0x32c580[_0x61c1('0x33')]=_[_0x61c1('0x34')](db[_0x61c1('0x31')][_0x61c1('0x32')]);_0x32c580['query']=_[_0x61c1('0x34')](_0x5a9849[_0x61c1('0x35')]);_0x32c580[_0x61c1('0x36')]=_['intersection'](_0x32c580[_0x61c1('0x33')],_0x32c580['query']);_0x3a2760[_0x61c1('0x39')]=_[_0x61c1('0x37')](_0x32c580['model'],qs[_0x61c1('0x38')](_0x5a9849['query'][_0x61c1('0x38')]));_0x3a2760[_0x61c1('0x39')]=_0x3a2760[_0x61c1('0x39')][_0x61c1('0x3a')]?_0x3a2760['attributes']:_0x32c580['model'];if(_0x5a9849[_0x61c1('0x35')][_0x61c1('0x49')]){_0x3a2760['include']=[{'all':!![]}];}_0x3a2760=_[_0x61c1('0x42')]({},_0x3a2760,_0x5a9849[_0x61c1('0x47')]);return db[_0x61c1('0x31')][_0x61c1('0x50')](_0x3a2760)[_0x61c1('0x27')](handleEntityNotFound(_0x5e3896,null))['then'](respondWithResult(_0x5e3896,null))[_0x61c1('0x4d')](handleError(_0x5e3896,null));};exports[_0x61c1('0x51')]=function(_0x4b2bf9,_0x23d830){return db['MailQueue'][_0x61c1('0x51')](_0x4b2bf9[_0x61c1('0x52')],{})[_0x61c1('0x27')](function(_0x33750a){var _0x5b18f6=_0x4b2bf9[_0x61c1('0x53')][_0x61c1('0x54')]({'plain':!![]});if(!_0x5b18f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b18f6[_0x61c1('0x55')]===_0x61c1('0x53')){var _0x17ae92=_0x33750a['get']({'plain':!![]});var _0x240a57=_0x61c1('0x56');return db['UserProfileSection'][_0x61c1('0x50')]({'where':{'name':_0x240a57,'userProfileId':_0x5b18f6[_0x61c1('0x57')]},'raw':!![]})[_0x61c1('0x27')](function(_0x3d3f92){if(_0x3d3f92&&_0x3d3f92[_0x61c1('0x58')]===0x0){return db[_0x61c1('0x28')][_0x61c1('0x51')]({'name':_0x17ae92['name'],'resourceId':_0x17ae92['id'],'type':_0x3d3f92[_0x61c1('0x2e')],'sectionId':_0x3d3f92['id']},{})[_0x61c1('0x27')](function(){return _0x33750a;});}else{return _0x33750a;}})['catch'](function(_0x441249){logger[_0x61c1('0x2c')](_0x61c1('0x59'),_0x441249);throw _0x441249;});}return _0x33750a;})['then'](respondWithResult(_0x23d830,0xc9))['catch'](handleError(_0x23d830,null));};exports[_0x61c1('0x26')]=function(_0x1439fd,_0x52828e){if(_0x1439fd[_0x61c1('0x52')]['id']){delete _0x1439fd['body']['id'];}return db[_0x61c1('0x31')][_0x61c1('0x50')]({'where':{'id':_0x1439fd['params']['id']}})[_0x61c1('0x27')](handleEntityNotFound(_0x52828e,null))['then'](saveUpdates(_0x1439fd[_0x61c1('0x52')],null))[_0x61c1('0x27')](respondWithResult(_0x52828e,null))[_0x61c1('0x4d')](handleError(_0x52828e,null));};exports[_0x61c1('0x29')]=function(_0x5b8136,_0x4607cf){return db['MailQueue'][_0x61c1('0x50')]({'where':{'id':_0x5b8136['params']['id']}})[_0x61c1('0x27')](handleEntityNotFound(_0x4607cf,null))[_0x61c1('0x27')](removeEntity(_0x4607cf,null))[_0x61c1('0x4d')](handleError(_0x4607cf,null));};exports[_0x61c1('0x5a')]=function(_0x39a277,_0x4dcd96){return db['MailQueue'][_0x61c1('0x5a')]()['then'](respondWithResult(_0x4dcd96,null))[_0x61c1('0x4d')](handleError(_0x4dcd96,null));};exports['getMembers']=function(_0x5d1f66,_0x3cce5e,_0x2c2be5){var _0xac305e={'raw':!![],'where':{}},_0x2af1bc={},_0x1befdd;return db['MailQueue'][_0x61c1('0x5b')]({'where':{'id':_0x5d1f66[_0x61c1('0x4f')]['id']}})[_0x61c1('0x27')](handleEntityNotFound(_0x3cce5e,null))['then'](function(_0xfc4ae2){if(_0xfc4ae2){_0x1befdd=_0xfc4ae2[_0x61c1('0x54')]({'plain':!![]});_0x2af1bc[_0x61c1('0x33')]=_[_0x61c1('0x34')](db[_0x61c1('0x5c')]['rawAttributes']);_0x2af1bc['query']=_[_0x61c1('0x34')](_0x5d1f66[_0x61c1('0x35')]);_0x2af1bc['filters']=_[_0x61c1('0x37')](_0x2af1bc['model'],_0x2af1bc[_0x61c1('0x35')]);_0xac305e[_0x61c1('0x39')]=_[_0x61c1('0x37')](_0x2af1bc[_0x61c1('0x33')],qs[_0x61c1('0x38')](_0x5d1f66[_0x61c1('0x35')][_0x61c1('0x38')]));_0xac305e['attributes']=_0xac305e[_0x61c1('0x39')][_0x61c1('0x3a')]?_0xac305e[_0x61c1('0x39')]:_0x2af1bc['model'];if(!_0x5d1f66[_0x61c1('0x35')]['hasOwnProperty'](_0x61c1('0x3c'))){_0xac305e['limit']=qs[_0x61c1('0x23')](_0x5d1f66['query']['limit']);_0xac305e['offset']=qs[_0x61c1('0x22')](_0x5d1f66['query']['offset']);}_0xac305e[_0x61c1('0x3d')]=qs[_0x61c1('0x3e')](_0x5d1f66['query'][_0x61c1('0x3e')]);_0xac305e['where']=qs[_0x61c1('0x36')](_[_0x61c1('0x40')](_0x5d1f66[_0x61c1('0x35')],_0x2af1bc[_0x61c1('0x36')]));_0xac305e['where'][_0x61c1('0x5d')]=_0xfc4ae2['id'];if(_0x5d1f66[_0x61c1('0x35')][_0x61c1('0x41')]){_0xac305e[_0x61c1('0x3f')]=_['merge'](_0xac305e[_0x61c1('0x3f')],{'$or':_['map'](_0xac305e[_0x61c1('0x39')],function(_0x5a132b){var _0x1d050a={};_0x1d050a[_0x5a132b]={'$like':'%'+_0x5d1f66[_0x61c1('0x35')][_0x61c1('0x41')]+'%'};return _0x1d050a;})});}_0xac305e=_[_0x61c1('0x42')]({},_0xac305e,_0x5d1f66[_0x61c1('0x47')]);return db[_0x61c1('0x5c')][_0x61c1('0x4b')](_0xac305e);}})[_0x61c1('0x27')](function(_0x1555e4){if(_0x1555e4){return db['User'][_0x61c1('0x5e')]({'where':{'id':_[_0x61c1('0x43')](_0x1555e4,'UserId'),'role':_0x61c1('0x5f')},'attributes':['id',_0x61c1('0x2e'),_0x61c1('0x60'),_0x61c1('0x61'),_0x61c1('0x62')]});}})['then'](function(_0x380d47){if(_0x380d47){return{'count':_0x380d47[_0x61c1('0x48')],'rows':_[_0x61c1('0x43')](_0x380d47[_0x61c1('0x4c')],function(_0x31d0a3){return{'membername':_0x31d0a3[_0x61c1('0x2e')],'UserId':_0x31d0a3['id'],'queue_name':_0x1befdd[_0x61c1('0x2e')],'MailQueueId':_0x1befdd['id'],'interface':util[_0x61c1('0x63')](_0x61c1('0x64'),_0x61c1('0x65'),_0x31d0a3[_0x61c1('0x2e')]),'penalty':0x0,'paused':_0x31d0a3[_0x61c1('0x60')],'createdAt':_0x31d0a3[_0x61c1('0x62')],'updatedAt':_0x31d0a3[_0x61c1('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x61c1('0x27')](respondWithFilteredResult(_0x3cce5e,_0xac305e))[_0x61c1('0x4d')](handleError(_0x3cce5e,null));};exports[_0x61c1('0x66')]=function(_0x17193b,_0x2a2960,_0x2b4a60){var _0x5648c6={};var _0x3754ed={};var _0xeed21;var _0x45d393;return db[_0x61c1('0x31')][_0x61c1('0x5b')]({'where':{'id':_0x17193b[_0x61c1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a2960,null))[_0x61c1('0x27')](function(_0x11d149){if(_0x11d149){_0xeed21=_0x11d149;_0x3754ed['model']=_[_0x61c1('0x34')](db[_0x61c1('0x67')][_0x61c1('0x32')]);_0x3754ed[_0x61c1('0x35')]=_['keys'](_0x17193b['query']);_0x3754ed[_0x61c1('0x36')]=_['intersection'](_0x3754ed['model'],_0x3754ed['query']);_0x5648c6[_0x61c1('0x39')]=_['intersection'](_0x3754ed['model'],qs['fields'](_0x17193b[_0x61c1('0x35')]['fields']));_0x5648c6['attributes']=_0x5648c6[_0x61c1('0x39')]['length']?_0x5648c6[_0x61c1('0x39')]:_0x3754ed[_0x61c1('0x33')];_0x5648c6[_0x61c1('0x3d')]=qs['sort'](_0x17193b[_0x61c1('0x35')][_0x61c1('0x3e')]);_0x5648c6['where']=qs[_0x61c1('0x36')](_['pick'](_0x17193b['query'],_0x3754ed[_0x61c1('0x36')]));if(_0x17193b[_0x61c1('0x35')][_0x61c1('0x41')]){_0x5648c6[_0x61c1('0x3f')]=_['merge'](_0x5648c6[_0x61c1('0x3f')],{'$or':_['map'](_0x5648c6[_0x61c1('0x39')],function(_0x43944f){var _0x2cbe7d={};_0x2cbe7d[_0x43944f]={'$like':'%'+_0x17193b[_0x61c1('0x35')][_0x61c1('0x41')]+'%'};return _0x2cbe7d;})});}_0x5648c6=_[_0x61c1('0x42')]({},_0x5648c6,_0x17193b[_0x61c1('0x47')]);return _0xeed21[_0x61c1('0x66')](_0x5648c6);}})['then'](function(_0x3a308f){if(_0x3a308f){_0x45d393=_0x3a308f[_0x61c1('0x3a')];if(!_0x17193b[_0x61c1('0x35')]['hasOwnProperty'](_0x61c1('0x3c'))){_0x5648c6[_0x61c1('0x23')]=qs[_0x61c1('0x23')](_0x17193b[_0x61c1('0x35')][_0x61c1('0x23')]);_0x5648c6[_0x61c1('0x22')]=qs['offset'](_0x17193b['query']['offset']);}return _0xeed21[_0x61c1('0x66')](_0x5648c6);}})['then'](function(_0x5082f2){if(_0x5082f2){return _0x5082f2?{'count':_0x45d393,'rows':_0x5082f2}:null;}})[_0x61c1('0x27')](respondWithResult(_0x2a2960,null))[_0x61c1('0x4d')](handleError(_0x2a2960,null));};exports[_0x61c1('0x68')]=function(_0x1ccc94,_0x2675e3,_0x373777){var _0xdffd31=_0x1ccc94['body'][_0x61c1('0x69')];return db[_0x61c1('0x67')][_0x61c1('0x4b')]({'where':{'id':_[_0x61c1('0x43')](_0xdffd31,'id')},'attributes':['id'],'include':[{'model':db[_0x61c1('0x6a')],'as':'Agents','attributes':['id','name','online',_0x61c1('0x6b'),_0x61c1('0x6c')],'raw':!![]}]})[_0x61c1('0x27')](function(_0x90a1d4){if(_0x90a1d4){var _0x59a566=_['flatMap'](_0x90a1d4,function(_0x3c7e83){var _0x2d6fb0=_0x3c7e83['get']({'plain':!![]});return _0x2d6fb0[_0x61c1('0x6d')];});return db['MailQueue'][_0x61c1('0x50')]({'where':{'id':_0x1ccc94[_0x61c1('0x4f')]['id']}})[_0x61c1('0x27')](function(_0x5b99db){return db['sequelize'][_0x61c1('0x6e')](function(_0x144475){return _0x5b99db[_0x61c1('0x68')](_[_0x61c1('0x43')](_0xdffd31,'id'),{'transaction':_0x144475})[_0x61c1('0x27')](function(){return BPromise['each'](_0x59a566,function(_0x23b723){return db[_0x61c1('0x5c')][_0x61c1('0x6f')]({'where':{'UserId':_0x23b723['id'],'MailQueueId':_0x1ccc94[_0x61c1('0x4f')]['id']},'transaction':_0x144475});});})['then'](function(){_0x59a566[_0x61c1('0x70')](function(_0x21fdc2){socket['emit'](_0x61c1('0x71'),{'UserId':_0x21fdc2['id'],'MailQueueId':_0x5b99db['id']});});});});});}})[_0x61c1('0x27')](respondWithStatusCode(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x61c1('0x72')]=function(_0x18a9a8,_0x13086a,_0x3a44ad){return db[_0x61c1('0x67')][_0x61c1('0x4b')]({'where':{'id':_0x18a9a8[_0x61c1('0x35')][_0x61c1('0x73')]},'attributes':['id'],'include':[{'model':db[_0x61c1('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x61c1('0x27')](handleEntityNotFound(_0x13086a,null))[_0x61c1('0x27')](function(_0x3b4091){var _0x44cf6c=_[_0x61c1('0x43')](_0x3b4091,'id');var _0x570e24=[];var _0x4074fc=[];var _0x401080=squel[_0x61c1('0x74')]();_0x401080[_0x61c1('0x46')]('tq.TeamId')[_0x61c1('0x75')](_0x61c1('0x76'),'tq')[_0x61c1('0x77')](_0x61c1('0x78'),'ut',_0x61c1('0x79'))[_0x61c1('0x3f')](_0x61c1('0x7a'),_0x18a9a8[_0x61c1('0x4f')]['id']);for(var _0x3a1255=0x0;_0x3a1255<_0x3b4091[_0x61c1('0x3a')];_0x3a1255+=0x1){let _0x1ac982=_0x3b4091[_0x3a1255];for(var _0x12b42d=0x0;_0x12b42d<_0x1ac982[_0x61c1('0x6d')][_0x61c1('0x3a')];_0x12b42d+=0x1){let _0x9ec568=_0x1ac982[_0x61c1('0x6d')][_0x12b42d];var _0x3cb699=_0x401080[_0x61c1('0x7b')]();_0x3cb699[_0x61c1('0x3f')](_0x61c1('0x7c'),_0x9ec568['id']);_0x4074fc['push'](db['sequelize']['query'](_0x3cb699[_0x61c1('0x7d')](),{'type':db['sequelize'][_0x61c1('0x7e')][_0x61c1('0x7f')]})[_0x61c1('0x27')](function(_0x35e0db){if(_0x35e0db[_0x61c1('0x3a')]===0x1){return _0x9ec568['id'];}else{var _0x4a6dff=_[_0x61c1('0x80')](_[_0x61c1('0x43')](_0x35e0db,_0x61c1('0x81')),function(_0x2a667a){return _[_0x61c1('0x82')](_0x44cf6c,_0x2a667a);});if(_0x4a6dff){return _0x9ec568['id'];}}}));}}return BPromise[_0x61c1('0x83')](_0x4074fc)[_0x61c1('0x27')](function(_0x5406e7){_0x570e24=_(_0x570e24)['union'](_0x5406e7)[_0x61c1('0x84')]()[_0x61c1('0x85')]();return db[_0x61c1('0x31')]['find']({'where':{'id':_0x18a9a8[_0x61c1('0x4f')]['id']}})[_0x61c1('0x27')](function(_0x3cd0ae){return db[_0x61c1('0x86')]['transaction'](function(_0x3460bc){return _0x3cd0ae['removeTeams'](_0x18a9a8['query']['ids'],{'transaction':_0x3460bc})[_0x61c1('0x27')](function(){if(!_['isEmpty'](_0x570e24)){return _0x3cd0ae[_0x61c1('0x87')](_0x570e24,{'transaction':_0x3460bc});}})[_0x61c1('0x27')](function(){_0x570e24['forEach'](function(_0x326eed){socket[_0x61c1('0x88')]('userMailQueue:remove',{'UserId':_0x326eed,'MailQueueId':_0x3cd0ae['id']});});});});});});})[_0x61c1('0x27')](respondWithStatusCode(_0x13086a,null))['catch'](handleError(_0x13086a,null));};exports[_0x61c1('0x89')]=function(_0x1f3e10,_0x55a497,_0xf4a060){return db[_0x61c1('0x31')][_0x61c1('0x50')]({'where':{'id':_0x1f3e10[_0x61c1('0x4f')]['id']}})[_0x61c1('0x27')](handleEntityNotFound(_0x55a497,null))[_0x61c1('0x27')](function(_0x4460a5){if(_0x4460a5){return _0x4460a5[_0x61c1('0x89')](_0x1f3e10[_0x61c1('0x52')][_0x61c1('0x73')],_[_0x61c1('0x8a')](_0x1f3e10[_0x61c1('0x52')],[_0x61c1('0x73'),'id'])||{})['spread'](function(_0xee13b8){for(var _0x1c136d=0x0;_0x1c136d<_0x1f3e10[_0x61c1('0x52')]['ids'][_0x61c1('0x3a')];_0x1c136d+=0x1){socket[_0x61c1('0x88')]('userMailQueue:save',{'UserId':_0x1f3e10[_0x61c1('0x52')]['ids'][_0x1c136d],'MailQueueId':_0x1f3e10[_0x61c1('0x4f')]['id']});}return _0xee13b8;});}})[_0x61c1('0x27')](respondWithResult(_0x55a497,null))[_0x61c1('0x4d')](handleError(_0x55a497,null));};exports['removeAgents']=function(_0x511341,_0x2ba4fd,_0x329243){return db['MailQueue'][_0x61c1('0x50')]({'where':{'id':_0x511341[_0x61c1('0x4f')]['id']}})[_0x61c1('0x27')](handleEntityNotFound(_0x2ba4fd,null))[_0x61c1('0x27')](function(_0x1d9d96){if(_0x1d9d96){return _0x1d9d96[_0x61c1('0x87')](_0x511341['query']['ids'])[_0x61c1('0x27')](function(){if(_[_0x61c1('0x8b')](_0x511341[_0x61c1('0x35')][_0x61c1('0x73')])){for(var _0x41b4b1=0x0;_0x41b4b1<_0x511341[_0x61c1('0x35')][_0x61c1('0x73')][_0x61c1('0x3a')];_0x41b4b1+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x511341[_0x61c1('0x35')][_0x61c1('0x73')][_0x41b4b1]),'MailQueueId':Number(_0x511341['params']['id'])});}}else{socket[_0x61c1('0x88')](_0x61c1('0x8c'),{'UserId':Number(_0x511341['query'][_0x61c1('0x73')]),'MailQueueId':Number(_0x511341[_0x61c1('0x4f')]['id'])});}});}})[_0x61c1('0x27')](respondWithStatusCode(_0x2ba4fd,null))[_0x61c1('0x4d')](handleError(_0x2ba4fd,null));};exports['getAgents']=function(_0x523c42,_0x2c3c48,_0xcc0e2a){var _0x16b34f={};var _0x34f0d3={};var _0x55c08d;var _0xd902a;return db[_0x61c1('0x31')][_0x61c1('0x5b')]({'where':{'id':_0x523c42[_0x61c1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c3c48,null))[_0x61c1('0x27')](function(_0x8ab67e){if(_0x8ab67e){_0x55c08d=_0x8ab67e;_0x34f0d3['model']=_[_0x61c1('0x34')](db[_0x61c1('0x6a')][_0x61c1('0x32')]);_0x34f0d3[_0x61c1('0x35')]=_[_0x61c1('0x34')](_0x523c42['query']);_0x34f0d3['filters']=_['intersection'](_0x34f0d3['model'],_0x34f0d3[_0x61c1('0x35')]);_0x16b34f[_0x61c1('0x39')]=_['intersection'](_0x34f0d3[_0x61c1('0x33')],qs[_0x61c1('0x38')](_0x523c42[_0x61c1('0x35')][_0x61c1('0x38')]));_0x16b34f[_0x61c1('0x39')]=_0x16b34f[_0x61c1('0x39')][_0x61c1('0x3a')]?_0x16b34f[_0x61c1('0x39')]:_0x34f0d3['model'];_0x16b34f['order']=qs['sort'](_0x523c42['query'][_0x61c1('0x3e')]);_0x16b34f['where']=qs[_0x61c1('0x36')](_['pick'](_0x523c42['query'],_0x34f0d3[_0x61c1('0x36')]));if(_0x523c42[_0x61c1('0x35')][_0x61c1('0x41')]){_0x16b34f[_0x61c1('0x3f')]=_['merge'](_0x16b34f[_0x61c1('0x3f')],{'$or':_['map'](_0x16b34f[_0x61c1('0x39')],function(_0x37cca6){var _0x3dcf17={};_0x3dcf17[_0x37cca6]={'$like':'%'+_0x523c42['query'][_0x61c1('0x41')]+'%'};return _0x3dcf17;})});}_0x16b34f=_[_0x61c1('0x42')]({},_0x16b34f,_0x523c42[_0x61c1('0x47')]);return _0x55c08d['getAgents'](_0x16b34f);}})[_0x61c1('0x27')](function(_0x446ca3){if(_0x446ca3){_0xd902a=_0x446ca3[_0x61c1('0x3a')];if(!_0x523c42[_0x61c1('0x35')][_0x61c1('0x3b')](_0x61c1('0x3c'))){_0x16b34f['limit']=qs[_0x61c1('0x23')](_0x523c42[_0x61c1('0x35')][_0x61c1('0x23')]);_0x16b34f[_0x61c1('0x22')]=qs[_0x61c1('0x22')](_0x523c42['query'][_0x61c1('0x22')]);}return _0x55c08d['getAgents'](_0x16b34f);}})['then'](function(_0x2a42e5){if(_0x2a42e5){return _0x2a42e5?{'count':_0xd902a,'rows':_0x2a42e5}:null;}})['then'](respondWithResult(_0x2c3c48,null))[_0x61c1('0x4d')](handleError(_0x2c3c48,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 685058c..7ea33a6 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 _0x1741=['hasOwnProperty','exports','../../mysqldb','update','emit'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x1741,0x66));var _0x1174=function(_0x3ec822,_0x59a9c2){_0x3ec822=_0x3ec822-0x0;var _0x5927c6=_0x1741[_0x3ec822];return _0x5927c6;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1174('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1174('0x1'),'afterDestroy':'remove'};function emitEvent(_0x51ba1d){return function(_0x210fe3,_0x53bc2f,_0x455f3b){MailQueueEvents['emit'](_0x51ba1d+':'+_0x210fe3['id'],_0x210fe3);MailQueueEvents[_0x1174('0x2')](_0x51ba1d,_0x210fe3);_0x455f3b(null);};}for(var e in events){if(events[_0x1174('0x3')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x1174('0x4')]=MailQueueEvents; \ No newline at end of file +var _0x1328=['setMaxListeners','save','update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1328,0x11d));var _0x8132=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1328[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0x8132('0x0'));var MailQueue=require(_0x8132('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8132('0x2')](0x0);var events={'afterCreate':_0x8132('0x3'),'afterUpdate':_0x8132('0x4'),'afterDestroy':_0x8132('0x5')};function emitEvent(_0x20b1d7){return function(_0x438566,_0x52c498,_0x1b9957){MailQueueEvents['emit'](_0x20b1d7+':'+_0x438566['id'],_0x438566);MailQueueEvents['emit'](_0x20b1d7,_0x438566);_0x1b9957(null);};}for(var e in events){if(events[_0x8132('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 60ece44..d62a452 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 _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes','define','mail_queues'];(function(_0x5bbc31,_0xa486a0){var _0x2c4190=function(_0x5908f3){while(--_0x5908f3){_0x5bbc31['push'](_0x5bbc31['shift']());}};_0x2c4190(++_0xa486a0);}(_0xac4a,0x13f));var _0xaac4=function(_0xa33292,_0x11a10c){_0xa33292=_0xa33292-0x0;var _0xbe8431=_0xac4a[_0xa33292];return _0xbe8431;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('MailQueue',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./mailQueue.attributes','exports','define','mail_queues','lodash','bluebird','rimraf','../../config/environment'];(function(_0x2290ae,_0xbbbf35){var _0x38bdd0=function(_0x4eb053){while(--_0x4eb053){_0x2290ae['push'](_0x2290ae['shift']());}};_0x38bdd0(++_0xbbbf35);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2035c5,_0x3c626f){_0x2035c5=_0x2035c5-0x0;var _0x274b00=_0xf4eb[_0x2035c5];return _0x274b00;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('MailQueue',attributes,{'tableName':_0xbf4e('0x7'),'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 59edef3..83aed17 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 _0xdcab=['message','result','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetMailQueue','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27dce3,_0x1bdcb3){var _0x456ff6=function(_0x334da6){while(--_0x334da6){_0x27dce3['push'](_0x27dce3['shift']());}};_0x456ff6(++_0x1bdcb3);}(_0xdcab,0x193));var _0xbdca=function(_0x23cb75,_0x3b22ef){_0x23cb75=_0x23cb75-0x0;var _0x4444f2=_0xdcab[_0x23cb75];return _0x4444f2;};'use strict';var _=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var moment=require(_0xbdca('0x2'));var BPromise=require(_0xbdca('0x3'));var rs=require(_0xbdca('0x4'));var fs=require('fs');var Redis=require(_0xbdca('0x5'));var db=require(_0xbdca('0x6'))['db'];var utils=require(_0xbdca('0x7'));var logger=require(_0xbdca('0x8'))('rpc');var config=require(_0xbdca('0x9'));var jayson=require(_0xbdca('0xa'));var client=jayson[_0xbdca('0xb')]['http']({'port':0x232a});config[_0xbdca('0xc')]=_[_0xbdca('0xd')](config[_0xbdca('0xc')],{'host':_0xbdca('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbdca('0xf'))[_0xbdca('0x10')](socket);function respondWithRpcPromise(_0x5f1f49,_0x2e865f,_0x5cb4d6){return new BPromise(function(_0x2b713a,_0x1795fa){return client[_0xbdca('0x11')](_0x5f1f49,_0x5cb4d6)[_0xbdca('0x12')](function(_0x35fadf){logger[_0xbdca('0x13')](_0xbdca('0x14'),_0x2e865f,_0xbdca('0x15'));logger[_0xbdca('0x16')](_0xbdca('0x17'),_0x2e865f,_0xbdca('0x15'),JSON[_0xbdca('0x18')](_0x35fadf));if(_0x35fadf[_0xbdca('0x19')]){if(_0x35fadf[_0xbdca('0x19')][_0xbdca('0x1a')]===0x1f4){logger[_0xbdca('0x19')](_0xbdca('0x14'),_0x2e865f,_0x35fadf[_0xbdca('0x19')][_0xbdca('0x1b')]);return _0x1795fa(_0x35fadf[_0xbdca('0x19')]['message']);}logger[_0xbdca('0x19')](_0xbdca('0x14'),_0x2e865f,_0x35fadf[_0xbdca('0x19')]['message']);return _0x2b713a(_0x35fadf[_0xbdca('0x19')]['message']);}else{logger['info'](_0xbdca('0x14'),_0x2e865f,_0xbdca('0x15'));_0x2b713a(_0x35fadf[_0xbdca('0x1c')][_0xbdca('0x1b')]);}})['catch'](function(_0x51923c){logger['error'](_0xbdca('0x14'),_0x2e865f,_0x51923c);_0x1795fa(_0x51923c);});});}exports['GetMailQueue']=function(_0x48e977){var _0xd1ed68=this;return new Promise(function(_0x51aaa1,_0x7081fd){return db[_0xbdca('0x1d')][_0xbdca('0x1e')]({'raw':_0x48e977[_0xbdca('0x1f')]?_0x48e977[_0xbdca('0x1f')][_0xbdca('0x20')]===undefined?!![]:![]:!![],'where':_0x48e977[_0xbdca('0x1f')]?_0x48e977[_0xbdca('0x1f')][_0xbdca('0x21')]||null:null,'attributes':_0x48e977[_0xbdca('0x1f')]?_0x48e977[_0xbdca('0x1f')][_0xbdca('0x22')]||null:null,'limit':_0x48e977[_0xbdca('0x1f')]?_0x48e977[_0xbdca('0x1f')][_0xbdca('0x23')]||null:null,'include':_0x48e977['options']?_0x48e977[_0xbdca('0x1f')][_0xbdca('0x24')]?_[_0xbdca('0x25')](_0x48e977['options']['include'],function(_0x481b77){return{'model':db[_0x481b77[_0xbdca('0x26')]],'as':_0x481b77['as'],'attributes':_0x481b77[_0xbdca('0x22')],'include':_0x481b77[_0xbdca('0x24')]?_[_0xbdca('0x25')](_0x481b77[_0xbdca('0x24')],function(_0x8428d4){return{'model':db[_0x8428d4[_0xbdca('0x26')]],'as':_0x8428d4['as'],'attributes':_0x8428d4[_0xbdca('0x22')],'include':_0x8428d4[_0xbdca('0x24')]?_['map'](_0x8428d4[_0xbdca('0x24')],function(_0x2e8c0b){return{'model':db[_0x2e8c0b['model']],'as':_0x2e8c0b['as'],'attributes':_0x2e8c0b[_0xbdca('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbdca('0x12')](function(_0x2416dd){logger['info'](_0xbdca('0x27'),_0x48e977);logger[_0xbdca('0x16')](_0xbdca('0x27'),_0x48e977,JSON[_0xbdca('0x18')](_0x2416dd));_0x51aaa1(_0x2416dd);})[_0xbdca('0x28')](function(_0x1c2b6b){logger[_0xbdca('0x19')](_0xbdca('0x27'),_0x1c2b6b['message'],_0x48e977);_0x7081fd(_0xd1ed68['error'](0x1f4,_0x1c2b6b[_0xbdca('0x1b')]));});});};exports[_0xbdca('0x29')]=function(_0x44c8dd){var _0x29c6a4=this;return new Promise(function(_0x835f58,_0x5a0aac){return db['MailQueue'][_0xbdca('0x2a')]({'raw':_0x44c8dd[_0xbdca('0x1f')]?_0x44c8dd[_0xbdca('0x1f')][_0xbdca('0x20')]===undefined?!![]:![]:!![],'where':_0x44c8dd[_0xbdca('0x1f')]?_0x44c8dd['options'][_0xbdca('0x21')]||null:null,'attributes':_0x44c8dd[_0xbdca('0x1f')]?_0x44c8dd[_0xbdca('0x1f')][_0xbdca('0x22')]||null:null,'include':_0x44c8dd[_0xbdca('0x1f')]?_0x44c8dd[_0xbdca('0x1f')][_0xbdca('0x24')]?_[_0xbdca('0x25')](_0x44c8dd[_0xbdca('0x1f')][_0xbdca('0x24')],function(_0xdcfc35){return{'model':db[_0xdcfc35[_0xbdca('0x26')]],'as':_0xdcfc35['as'],'attributes':_0xdcfc35[_0xbdca('0x22')],'include':_0xdcfc35['include']?_[_0xbdca('0x25')](_0xdcfc35['include'],function(_0x10da99){return{'model':db[_0x10da99[_0xbdca('0x26')]],'as':_0x10da99['as'],'attributes':_0x10da99[_0xbdca('0x22')],'include':_0x10da99[_0xbdca('0x24')]?_[_0xbdca('0x25')](_0x10da99['include'],function(_0x315fa5){return{'model':db[_0x315fa5[_0xbdca('0x26')]],'as':_0x315fa5['as'],'attributes':_0x315fa5[_0xbdca('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a5ab1){logger['info'](_0xbdca('0x29'),_0x44c8dd);logger[_0xbdca('0x16')](_0xbdca('0x29'),_0x44c8dd,JSON[_0xbdca('0x18')](_0x2a5ab1));_0x835f58(_0x2a5ab1);})[_0xbdca('0x28')](function(_0x5dd719){logger['error'](_0xbdca('0x29'),_0x5dd719['message'],_0x44c8dd);_0x5a0aac(_0x29c6a4['error'](0x1f4,_0x5dd719[_0xbdca('0x1b')]));});});}; \ No newline at end of file +var _0x9379=['register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailQueue','findAll','options','raw','where','include','map','model','attributes','catch','ShowMailQueue','MailQueue','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailQueue.socket'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x9379,0x1e1));var _0x9937=function(_0x214339,_0x4f4db1){_0x214339=_0x214339-0x0;var _0x1d92d7=_0x9379[_0x214339];return _0x1d92d7;};'use strict';var _=require(_0x9937('0x0'));var util=require(_0x9937('0x1'));var moment=require('moment');var BPromise=require(_0x9937('0x2'));var rs=require(_0x9937('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9937('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9937('0x5'));var config=require(_0x9937('0x6'));var jayson=require(_0x9937('0x7'));var client=jayson[_0x9937('0x8')]['http']({'port':0x232a});config[_0x9937('0x9')]=_[_0x9937('0xa')](config[_0x9937('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9937('0xb'))(new Redis(config[_0x9937('0x9')]));require(_0x9937('0xc'))[_0x9937('0xd')](socket);function respondWithRpcPromise(_0x8ac2f3,_0xc82627,_0x179598){return new BPromise(function(_0x2f8a8f,_0x22fd79){return client[_0x9937('0xe')](_0x8ac2f3,_0x179598)[_0x9937('0xf')](function(_0x379f55){logger[_0x9937('0x10')](_0x9937('0x11'),_0xc82627,_0x9937('0x12'));logger[_0x9937('0x13')](_0x9937('0x14'),_0xc82627,_0x9937('0x12'),JSON[_0x9937('0x15')](_0x379f55));if(_0x379f55[_0x9937('0x16')]){if(_0x379f55[_0x9937('0x16')][_0x9937('0x17')]===0x1f4){logger[_0x9937('0x16')](_0x9937('0x11'),_0xc82627,_0x379f55[_0x9937('0x16')][_0x9937('0x18')]);return _0x22fd79(_0x379f55[_0x9937('0x16')]['message']);}logger[_0x9937('0x16')](_0x9937('0x11'),_0xc82627,_0x379f55[_0x9937('0x16')]['message']);return _0x2f8a8f(_0x379f55[_0x9937('0x16')][_0x9937('0x18')]);}else{logger[_0x9937('0x10')](_0x9937('0x11'),_0xc82627,_0x9937('0x12'));_0x2f8a8f(_0x379f55[_0x9937('0x19')][_0x9937('0x18')]);}})['catch'](function(_0x8fdb8e){logger[_0x9937('0x16')]('MailQueue,\x20%s,\x20%s',_0xc82627,_0x8fdb8e);_0x22fd79(_0x8fdb8e);});});}exports[_0x9937('0x1a')]=function(_0x21b47a){var _0x4a687d=this;return new Promise(function(_0x37b8a3,_0x10394e){return db['MailQueue'][_0x9937('0x1b')]({'raw':_0x21b47a[_0x9937('0x1c')]?_0x21b47a[_0x9937('0x1c')][_0x9937('0x1d')]===undefined?!![]:![]:!![],'where':_0x21b47a[_0x9937('0x1c')]?_0x21b47a[_0x9937('0x1c')][_0x9937('0x1e')]||null:null,'attributes':_0x21b47a['options']?_0x21b47a[_0x9937('0x1c')]['attributes']||null:null,'limit':_0x21b47a[_0x9937('0x1c')]?_0x21b47a['options']['limit']||null:null,'include':_0x21b47a[_0x9937('0x1c')]?_0x21b47a[_0x9937('0x1c')][_0x9937('0x1f')]?_[_0x9937('0x20')](_0x21b47a[_0x9937('0x1c')]['include'],function(_0x559ce4){return{'model':db[_0x559ce4[_0x9937('0x21')]],'as':_0x559ce4['as'],'attributes':_0x559ce4[_0x9937('0x22')],'include':_0x559ce4[_0x9937('0x1f')]?_[_0x9937('0x20')](_0x559ce4[_0x9937('0x1f')],function(_0x4c0e09){return{'model':db[_0x4c0e09[_0x9937('0x21')]],'as':_0x4c0e09['as'],'attributes':_0x4c0e09['attributes'],'include':_0x4c0e09['include']?_['map'](_0x4c0e09[_0x9937('0x1f')],function(_0x32acec){return{'model':db[_0x32acec[_0x9937('0x21')]],'as':_0x32acec['as'],'attributes':_0x32acec[_0x9937('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9937('0xf')](function(_0x422721){logger[_0x9937('0x10')](_0x9937('0x1a'),_0x21b47a);logger[_0x9937('0x13')](_0x9937('0x1a'),_0x21b47a,JSON[_0x9937('0x15')](_0x422721));_0x37b8a3(_0x422721);})[_0x9937('0x23')](function(_0x4be760){logger[_0x9937('0x16')](_0x9937('0x1a'),_0x4be760[_0x9937('0x18')],_0x21b47a);_0x10394e(_0x4a687d['error'](0x1f4,_0x4be760[_0x9937('0x18')]));});});};exports[_0x9937('0x24')]=function(_0x229dc7){var _0x2ced63=this;return new Promise(function(_0x59e3ba,_0x38639b){return db[_0x9937('0x25')]['find']({'raw':_0x229dc7[_0x9937('0x1c')]?_0x229dc7[_0x9937('0x1c')][_0x9937('0x1d')]===undefined?!![]:![]:!![],'where':_0x229dc7['options']?_0x229dc7['options'][_0x9937('0x1e')]||null:null,'attributes':_0x229dc7[_0x9937('0x1c')]?_0x229dc7['options'][_0x9937('0x22')]||null:null,'include':_0x229dc7[_0x9937('0x1c')]?_0x229dc7[_0x9937('0x1c')][_0x9937('0x1f')]?_['map'](_0x229dc7[_0x9937('0x1c')][_0x9937('0x1f')],function(_0x385f18){return{'model':db[_0x385f18['model']],'as':_0x385f18['as'],'attributes':_0x385f18[_0x9937('0x22')],'include':_0x385f18['include']?_['map'](_0x385f18['include'],function(_0x1fd0a4){return{'model':db[_0x1fd0a4[_0x9937('0x21')]],'as':_0x1fd0a4['as'],'attributes':_0x1fd0a4['attributes'],'include':_0x1fd0a4[_0x9937('0x1f')]?_[_0x9937('0x20')](_0x1fd0a4[_0x9937('0x1f')],function(_0x50f7ba){return{'model':db[_0x50f7ba['model']],'as':_0x50f7ba['as'],'attributes':_0x50f7ba[_0x9937('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1482b1){logger[_0x9937('0x10')](_0x9937('0x24'),_0x229dc7);logger['debug'](_0x9937('0x24'),_0x229dc7,JSON[_0x9937('0x15')](_0x1482b1));_0x59e3ba(_0x1482b1);})[_0x9937('0x23')](function(_0x3ba11a){logger['error'](_0x9937('0x24'),_0x3ba11a[_0x9937('0x18')],_0x229dc7);_0x38639b(_0x2ced63[_0x9937('0x16')](0x1f4,_0x3ba11a[_0x9937('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5a5f866..89fa94b 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 _0x6bed=['removeListener','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x3e718a,_0x2f6618){var _0x2fbe4d=function(_0x2622d1){while(--_0x2622d1){_0x3e718a['push'](_0x3e718a['shift']());}};_0x2fbe4d(++_0x2f6618);}(_0x6bed,0x11b));var _0xd6be=function(_0x2a4500,_0xaf8f08){_0x2a4500=_0x2a4500-0x0;var _0x24bb99=_0x6bed[_0x2a4500];return _0x24bb99;};'use strict';var MailQueueEvents=require(_0xd6be('0x0'));var events=[_0xd6be('0x1'),_0xd6be('0x2'),_0xd6be('0x3')];function createListener(_0x5899bf,_0xc5aaa0){return function(_0x573072){_0xc5aaa0[_0xd6be('0x4')](_0x5899bf,_0x573072);};}function removeListener(_0x430e87,_0xf1813b){return function(){MailQueueEvents[_0xd6be('0x5')](_0x430e87,_0xf1813b);};}exports['register']=function(_0x36b25a){for(var _0x46cefe=0x0,_0x51377a=events[_0xd6be('0x6')];_0x46cefe<_0x51377a;_0x46cefe++){var _0x596d1f=events[_0x46cefe];var _0xf070b6=createListener(_0xd6be('0x7')+_0x596d1f,_0x36b25a);MailQueueEvents['on'](_0x596d1f,_0xf070b6);}}; \ No newline at end of file +var _0xdf1c=['register','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x5a1510,_0x2b0aa2){var _0x56d410=function(_0x24392d){while(--_0x24392d){_0x5a1510['push'](_0x5a1510['shift']());}};_0x56d410(++_0x2b0aa2);}(_0xdf1c,0x144));var _0xcdf1=function(_0x23a70f,_0x539839){_0x23a70f=_0x23a70f-0x0;var _0x49dc73=_0xdf1c[_0x23a70f];return _0x49dc73;};'use strict';var MailQueueEvents=require(_0xcdf1('0x0'));var events=[_0xcdf1('0x1'),'remove',_0xcdf1('0x2')];function createListener(_0x34b103,_0x53c832){return function(_0x353d55){_0x53c832[_0xcdf1('0x3')](_0x34b103,_0x353d55);};}function removeListener(_0x4333ee,_0x4676ed){return function(){MailQueueEvents[_0xcdf1('0x4')](_0x4333ee,_0x4676ed);};}exports[_0xcdf1('0x5')]=function(_0x5b7b24){for(var _0x5745f8=0x0,_0x341d56=events['length'];_0x5745f8<_0x341d56;_0x5745f8++){var _0x596f2a=events[_0x5745f8];var _0x393615=createListener(_0xcdf1('0x6')+_0x596f2a,_0x5b7b24);MailQueueEvents['on'](_0x596f2a,_0x393615);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 63bf17d..331a101 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 _0x5239=['post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2cad58,_0x62e7c1){var _0x49d0c4=function(_0x1dffe7){while(--_0x1dffe7){_0x2cad58['push'](_0x2cad58['shift']());}};_0x49d0c4(++_0x62e7c1);}(_0x5239,0x17b));var _0x9523=function(_0x5f1a50,_0x2c697e){_0x5f1a50=_0x5f1a50-0x0;var _0x3e78ba=_0x5239[_0x5f1a50];return _0x3e78ba;};'use strict';var multer=require(_0x9523('0x0'));var util=require(_0x9523('0x1'));var path=require(_0x9523('0x2'));var timeout=require(_0x9523('0x3'));var express=require(_0x9523('0x4'));var router=express[_0x9523('0x5')]();var auth=require(_0x9523('0x6'));var interaction=require(_0x9523('0x7'));var config=require(_0x9523('0x8'));var controller=require(_0x9523('0x9'));router[_0x9523('0xa')]('/',auth[_0x9523('0xb')](),controller[_0x9523('0xc')]);router[_0x9523('0xa')](_0x9523('0xd'),auth[_0x9523('0xb')](),controller[_0x9523('0xe')]);router[_0x9523('0xa')](_0x9523('0xf'),auth['isAuthenticated'](),controller[_0x9523('0x10')]);router[_0x9523('0x11')]('/',auth['isAuthenticated'](),controller[_0x9523('0x12')]);router['put'](_0x9523('0xf'),auth['isAuthenticated'](),controller[_0x9523('0x13')]);router[_0x9523('0x14')](_0x9523('0xf'),auth[_0x9523('0xb')](),controller['destroy']);module[_0x9523('0x15')]=router; \ No newline at end of file +var _0x8c37=['../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x8c37,0x1d0));var _0x78c3=function(_0x180eaf,_0x28da85){_0x180eaf=_0x180eaf-0x0;var _0x2f73e4=_0x8c37[_0x180eaf];return _0x2f73e4;};'use strict';var multer=require(_0x78c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x78c3('0x1'));var express=require(_0x78c3('0x2'));var router=express[_0x78c3('0x3')]();var auth=require(_0x78c3('0x4'));var interaction=require(_0x78c3('0x5'));var config=require('../../config/environment');var controller=require(_0x78c3('0x6'));router[_0x78c3('0x7')]('/',auth[_0x78c3('0x8')](),controller[_0x78c3('0x9')]);router[_0x78c3('0x7')](_0x78c3('0xa'),auth[_0x78c3('0x8')](),controller['describe']);router['get'](_0x78c3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x78c3('0xc')]('/',auth[_0x78c3('0x8')](),controller[_0x78c3('0xd')]);router[_0x78c3('0xe')](_0x78c3('0xb'),auth[_0x78c3('0x8')](),controller['update']);router[_0x78c3('0xf')](_0x78c3('0xb'),auth[_0x78c3('0x8')](),controller[_0x78c3('0x10')]);module[_0x78c3('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 103b70f..c55879d 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 _0xa1b7=['DATE','moment','sequelize','exports','STRING'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0xa1b7,0x6f));var _0x7a1b=function(_0x27039e,_0x3bdf2c){_0x27039e=_0x27039e-0x0;var _0x293568=_0xa1b7[_0x27039e];return _0x293568;};'use strict';var moment=require(_0x7a1b('0x0'));var Sequelize=require(_0x7a1b('0x1'));module[_0x7a1b('0x2')]={'uniqueid':{'type':Sequelize[_0x7a1b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7a1b('0x4')]},'leaveAt':{'type':Sequelize[_0x7a1b('0x4')]},'acceptAt':{'type':Sequelize[_0x7a1b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7a1b('0x3')]}}; \ No newline at end of file +var _0x3651=['DATE','moment','exports','STRING'];(function(_0x4603cd,_0x35e9a5){var _0x3471d0=function(_0x519acd){while(--_0x519acd){_0x4603cd['push'](_0x4603cd['shift']());}};_0x3471d0(++_0x35e9a5);}(_0x3651,0x69));var _0x1365=function(_0x4a0a1b,_0x2715d1){_0x4a0a1b=_0x4a0a1b-0x0;var _0xe101df=_0x3651[_0x4a0a1b];return _0xe101df;};'use strict';var moment=require(_0x1365('0x0'));var Sequelize=require('sequelize');module[_0x1365('0x1')]={'uniqueid':{'type':Sequelize[_0x1365('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1365('0x2')]},'joinAt':{'type':Sequelize[_0x1365('0x3')]},'leaveAt':{'type':Sequelize[_0x1365('0x3')]},'acceptAt':{'type':Sequelize[_0x1365('0x3')]},'exitAt':{'type':Sequelize[_0x1365('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3a2e13a..cbcca1c 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 _0xf37f=['filter','merge','map','type','key','field','options','MailQueueReport','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4f144d,_0x154950){var _0x318423=function(_0xa86b01){while(--_0xa86b01){_0x4f144d['push'](_0x4f144d['shift']());}};_0x318423(++_0x154950);}(_0xf37f,0xee));var _0xff37=function(_0xb4bd53,_0x2a6033){_0xb4bd53=_0xb4bd53-0x0;var _0x3c2969=_0xf37f[_0xb4bd53];return _0x3c2969;};'use strict';var pdf=require(_0xff37('0x0'));var emlformat=require(_0xff37('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xff37('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff37('0x3'));var moment=require(_0xff37('0x4'));var BPromise=require(_0xff37('0x5'));var Mustache=require(_0xff37('0x6'));var util=require(_0xff37('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff37('0x8'));var fs=require('fs');var _=require(_0xff37('0x9'));var squel=require(_0xff37('0xa'));var crypto=require(_0xff37('0xb'));var jsforce=require(_0xff37('0xc'));var deskjs=require(_0xff37('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff37('0xe'));var Papa=require('papaparse');var Redis=require(_0xff37('0xf'));var authService=require(_0xff37('0x10'));var qs=require(_0xff37('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff37('0x12'))('api');var utils=require(_0xff37('0x13'));var config=require(_0xff37('0x14'));var db=require(_0xff37('0x15'))['db'];function respondWithStatusCode(_0x436a5b,_0x5cef56){_0x5cef56=_0x5cef56||0xcc;return function(_0x13dc93){if(_0x13dc93){return _0x436a5b[_0xff37('0x16')](_0x5cef56);}return _0x436a5b[_0xff37('0x17')](_0x5cef56)[_0xff37('0x18')]();};}function respondWithResult(_0x54f5f2,_0x205f79){_0x205f79=_0x205f79||0xc8;return function(_0x1f7b27){if(_0x1f7b27){return _0x54f5f2[_0xff37('0x17')](_0x205f79)['json'](_0x1f7b27);}};}function respondWithFilteredResult(_0x3a46c2,_0x1c1921){return function(_0x42782f){if(_0x42782f){var _0x3464d8=_0x42782f[_0xff37('0x19')],_0x534c5d=_0x1c1921[_0xff37('0x1a')],_0x506b29=_0x1c1921[_0xff37('0x1a')]+_0x1c1921[_0xff37('0x1b')],_0x2555e9;if(_0x506b29>=_0x3464d8){_0x506b29=_0x3464d8;_0x2555e9=0xc8;}else{_0x2555e9=0xce;}_0x3a46c2['status'](_0x2555e9);return _0x3a46c2[_0xff37('0x1c')](_0xff37('0x1d'),_0x534c5d+'-'+_0x506b29+'/'+_0x3464d8)[_0xff37('0x1e')](_0x42782f);}return null;};}function patchUpdates(_0x41b819){return function(_0x1d370e){try{jsonpatch['apply'](_0x1d370e,_0x41b819,!![]);}catch(_0x4ea7ac){return BPromise['reject'](_0x4ea7ac);}return _0x1d370e[_0xff37('0x1f')]();};}function saveUpdates(_0x1fdb9b,_0x31e1d1){return function(_0x368f46){if(_0x368f46){return _0x368f46[_0xff37('0x20')](_0x1fdb9b)[_0xff37('0x21')](function(_0x2b0876){return _0x2b0876;});}return null;};}function removeEntity(_0x244416,_0x4efe21){return function(_0xfddff3){if(_0xfddff3){return _0xfddff3[_0xff37('0x22')]()[_0xff37('0x21')](function(){_0x244416[_0xff37('0x17')](0xcc)[_0xff37('0x18')]();});}};}function handleEntityNotFound(_0x83da0b,_0x1a1912){return function(_0x58482d){if(!_0x58482d){_0x83da0b['sendStatus'](0x194);}return _0x58482d;};}function handleError(_0x3da1a3,_0x35129b){_0x35129b=_0x35129b||0x1f4;return function(_0x3bfe90){logger[_0xff37('0x23')](_0x3bfe90[_0xff37('0x24')]);if(_0x3bfe90[_0xff37('0x25')]){delete _0x3bfe90[_0xff37('0x25')];}_0x3da1a3['status'](_0x35129b)[_0xff37('0x26')](_0x3bfe90);};}exports[_0xff37('0x27')]=function(_0x4c8852,_0x46c329){var _0x21e3c3={},_0x273cfb={},_0x29cd5a={'count':0x0,'rows':[]};var _0x278973=db['MailQueueReport'][_0xff37('0x28')];_0x273cfb[_0xff37('0x29')]=_[_0xff37('0x2a')](_0x278973);_0x273cfb[_0xff37('0x2b')]=_[_0xff37('0x2a')](_0x4c8852[_0xff37('0x2b')]);_0x273cfb[_0xff37('0x2c')]=_[_0xff37('0x2d')](_0x273cfb[_0xff37('0x29')],_0x273cfb[_0xff37('0x2b')]);_0x21e3c3['attributes']=_['intersection'](_0x273cfb['model'],qs[_0xff37('0x2e')](_0x4c8852[_0xff37('0x2b')][_0xff37('0x2e')]));_0x21e3c3[_0xff37('0x2f')]=_0x21e3c3[_0xff37('0x2f')][_0xff37('0x30')]?_0x21e3c3[_0xff37('0x2f')]:_0x273cfb[_0xff37('0x29')];if(!_0x4c8852[_0xff37('0x2b')][_0xff37('0x31')](_0xff37('0x32'))){_0x21e3c3['limit']=qs[_0xff37('0x1b')](_0x4c8852[_0xff37('0x2b')][_0xff37('0x1b')]);_0x21e3c3[_0xff37('0x1a')]=qs['offset'](_0x4c8852[_0xff37('0x2b')][_0xff37('0x1a')]);}_0x21e3c3['order']=qs[_0xff37('0x33')](_0x4c8852[_0xff37('0x2b')][_0xff37('0x33')]);_0x21e3c3[_0xff37('0x34')]=qs[_0xff37('0x2c')](_[_0xff37('0x35')](_0x4c8852[_0xff37('0x2b')],_0x273cfb['filters']));if(_0x4c8852[_0xff37('0x2b')][_0xff37('0x36')]){_0x21e3c3[_0xff37('0x34')]=_[_0xff37('0x37')](_0x21e3c3[_0xff37('0x34')],{'$or':_[_0xff37('0x38')](_0x278973,function(_0x2a0671){if(_0x2a0671[_0xff37('0x39')][_0xff37('0x3a')]!=='VIRTUAL'){var _0x337162={};_0x337162[_0x2a0671[_0xff37('0x3b')]]={'$like':'%'+_0x4c8852[_0xff37('0x2b')]['filter']+'%'};return _0x337162;}})});}_0x21e3c3=_[_0xff37('0x37')]({},_0x21e3c3,_0x4c8852[_0xff37('0x3c')]);var _0x19e72c={'where':_0x21e3c3['where']};return db[_0xff37('0x3d')]['count'](_0x19e72c)[_0xff37('0x21')](function(_0x38372f){_0x29cd5a[_0xff37('0x19')]=_0x38372f;if(_0x4c8852[_0xff37('0x2b')][_0xff37('0x3e')]){_0x21e3c3[_0xff37('0x3f')]=[{'all':!![]}];}return db[_0xff37('0x3d')][_0xff37('0x40')](_0x21e3c3);})[_0xff37('0x21')](function(_0x5dceed){_0x29cd5a[_0xff37('0x41')]=_0x5dceed;return _0x29cd5a;})[_0xff37('0x21')](respondWithFilteredResult(_0x46c329,_0x21e3c3))['catch'](handleError(_0x46c329,null));};exports[_0xff37('0x42')]=function(_0x25ca3e,_0x30dd5a){var _0x460261={'raw':!![],'where':{'id':_0x25ca3e['params']['id']}},_0x28dd79={};_0x28dd79[_0xff37('0x29')]=_[_0xff37('0x2a')](db[_0xff37('0x3d')]['rawAttributes']);_0x28dd79[_0xff37('0x2b')]=_[_0xff37('0x2a')](_0x25ca3e[_0xff37('0x2b')]);_0x28dd79[_0xff37('0x2c')]=_[_0xff37('0x2d')](_0x28dd79['model'],_0x28dd79[_0xff37('0x2b')]);_0x460261['attributes']=_[_0xff37('0x2d')](_0x28dd79[_0xff37('0x29')],qs[_0xff37('0x2e')](_0x25ca3e[_0xff37('0x2b')][_0xff37('0x2e')]));_0x460261[_0xff37('0x2f')]=_0x460261[_0xff37('0x2f')][_0xff37('0x30')]?_0x460261[_0xff37('0x2f')]:_0x28dd79[_0xff37('0x29')];if(_0x25ca3e['query'][_0xff37('0x3e')]){_0x460261[_0xff37('0x3f')]=[{'all':!![]}];}_0x460261=_[_0xff37('0x37')]({},_0x460261,_0x25ca3e[_0xff37('0x3c')]);return db[_0xff37('0x3d')][_0xff37('0x43')](_0x460261)[_0xff37('0x21')](handleEntityNotFound(_0x30dd5a,null))[_0xff37('0x21')](respondWithResult(_0x30dd5a,null))[_0xff37('0x44')](handleError(_0x30dd5a,null));};exports['create']=function(_0x35e7fb,_0x2d0094){return db['MailQueueReport'][_0xff37('0x45')](_0x35e7fb['body'],{})[_0xff37('0x21')](respondWithResult(_0x2d0094,0xc9))[_0xff37('0x44')](handleError(_0x2d0094,null));};exports[_0xff37('0x20')]=function(_0x3fe398,_0x100925){if(_0x3fe398[_0xff37('0x46')]['id']){delete _0x3fe398[_0xff37('0x46')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x3fe398[_0xff37('0x47')]['id']}})[_0xff37('0x21')](handleEntityNotFound(_0x100925,null))[_0xff37('0x21')](saveUpdates(_0x3fe398['body'],null))[_0xff37('0x21')](respondWithResult(_0x100925,null))[_0xff37('0x44')](handleError(_0x100925,null));};exports[_0xff37('0x22')]=function(_0x40d3fe,_0x4dcbbe){return db[_0xff37('0x3d')][_0xff37('0x43')]({'where':{'id':_0x40d3fe[_0xff37('0x47')]['id']}})[_0xff37('0x21')](handleEntityNotFound(_0x4dcbbe,null))[_0xff37('0x21')](removeEntity(_0x4dcbbe,null))[_0xff37('0x44')](handleError(_0x4dcbbe,null));};exports['describe']=function(_0x1aa5e7,_0x25d8c9){return db['MailQueueReport'][_0xff37('0x48')]()[_0xff37('0x21')](respondWithResult(_0x25d8c9,null))[_0xff37('0x44')](handleError(_0x25d8c9,null));}; \ No newline at end of file +var _0xd399=['filters','pick','merge','map','type','key','field','filter','options','include','findAll','intersection','includeAll','catch','create','body','find','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','update','then','stack','name','send','index','MailQueueReport','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x4edb7f,_0x3b68c0){var _0x52a707=function(_0x59bc62){while(--_0x59bc62){_0x4edb7f['push'](_0x4edb7f['shift']());}};_0x52a707(++_0x3b68c0);}(_0xd399,0x181));var _0x9d39=function(_0x4818fd,_0x1156e3){_0x4818fd=_0x4818fd-0x0;var _0x3549c6=_0xd399[_0x4818fd];return _0x3549c6;};'use strict';var pdf=require(_0x9d39('0x0'));var emlformat=require(_0x9d39('0x1'));var rimraf=require(_0x9d39('0x2'));var zipdir=require(_0x9d39('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d39('0x4'));var moment=require(_0x9d39('0x5'));var BPromise=require(_0x9d39('0x6'));var Mustache=require(_0x9d39('0x7'));var util=require(_0x9d39('0x8'));var path=require('path');var sox=require(_0x9d39('0x9'));var csv=require(_0x9d39('0xa'));var ejs=require(_0x9d39('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9d39('0xc'));var crypto=require(_0x9d39('0xd'));var jsforce=require(_0x9d39('0xe'));var deskjs=require(_0x9d39('0xf'));var toCsv=require(_0x9d39('0xa'));var querystring=require(_0x9d39('0x10'));var Papa=require(_0x9d39('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9d39('0x12'));var hardwareService=require(_0x9d39('0x13'));var logger=require(_0x9d39('0x14'))(_0x9d39('0x15'));var utils=require(_0x9d39('0x16'));var config=require(_0x9d39('0x17'));var db=require(_0x9d39('0x18'))['db'];function respondWithStatusCode(_0x57b6d1,_0x50bd88){_0x50bd88=_0x50bd88||0xcc;return function(_0x2d92e0){if(_0x2d92e0){return _0x57b6d1[_0x9d39('0x19')](_0x50bd88);}return _0x57b6d1[_0x9d39('0x1a')](_0x50bd88)[_0x9d39('0x1b')]();};}function respondWithResult(_0x26a922,_0x2c1398){_0x2c1398=_0x2c1398||0xc8;return function(_0x46873f){if(_0x46873f){return _0x26a922[_0x9d39('0x1a')](_0x2c1398)['json'](_0x46873f);}};}function respondWithFilteredResult(_0x107819,_0x1d345b){return function(_0xa3bb70){if(_0xa3bb70){var _0x2c9bf7=_0xa3bb70[_0x9d39('0x1c')],_0x95819c=_0x1d345b[_0x9d39('0x1d')],_0x5da431=_0x1d345b['offset']+_0x1d345b['limit'],_0x259efb;if(_0x5da431>=_0x2c9bf7){_0x5da431=_0x2c9bf7;_0x259efb=0xc8;}else{_0x259efb=0xce;}_0x107819[_0x9d39('0x1a')](_0x259efb);return _0x107819[_0x9d39('0x1e')](_0x9d39('0x1f'),_0x95819c+'-'+_0x5da431+'/'+_0x2c9bf7)['json'](_0xa3bb70);}return null;};}function patchUpdates(_0x43993d){return function(_0x8f9a6c){try{jsonpatch[_0x9d39('0x20')](_0x8f9a6c,_0x43993d,!![]);}catch(_0x2b049e){return BPromise['reject'](_0x2b049e);}return _0x8f9a6c['save']();};}function saveUpdates(_0x750458,_0x284f67){return function(_0xd2ced7){if(_0xd2ced7){return _0xd2ced7[_0x9d39('0x21')](_0x750458)[_0x9d39('0x22')](function(_0x249fa6){return _0x249fa6;});}return null;};}function removeEntity(_0x30dfeb,_0x4c1697){return function(_0x576822){if(_0x576822){return _0x576822['destroy']()[_0x9d39('0x22')](function(){_0x30dfeb[_0x9d39('0x1a')](0xcc)[_0x9d39('0x1b')]();});}};}function handleEntityNotFound(_0x41cb96,_0x20eab2){return function(_0x5a9200){if(!_0x5a9200){_0x41cb96[_0x9d39('0x19')](0x194);}return _0x5a9200;};}function handleError(_0x406060,_0x2ecf9d){_0x2ecf9d=_0x2ecf9d||0x1f4;return function(_0x33b872){logger['error'](_0x33b872[_0x9d39('0x23')]);if(_0x33b872[_0x9d39('0x24')]){delete _0x33b872[_0x9d39('0x24')];}_0x406060[_0x9d39('0x1a')](_0x2ecf9d)[_0x9d39('0x25')](_0x33b872);};}exports[_0x9d39('0x26')]=function(_0x2da4a2,_0x5c67b7){var _0x2a92e5={},_0x2a1adc={},_0x3c4408={'count':0x0,'rows':[]};var _0xcf6d09=db[_0x9d39('0x27')][_0x9d39('0x28')];_0x2a1adc[_0x9d39('0x29')]=_[_0x9d39('0x2a')](_0xcf6d09);_0x2a1adc['query']=_['keys'](_0x2da4a2[_0x9d39('0x2b')]);_0x2a1adc['filters']=_['intersection'](_0x2a1adc['model'],_0x2a1adc[_0x9d39('0x2b')]);_0x2a92e5['attributes']=_['intersection'](_0x2a1adc[_0x9d39('0x29')],qs[_0x9d39('0x2c')](_0x2da4a2[_0x9d39('0x2b')][_0x9d39('0x2c')]));_0x2a92e5[_0x9d39('0x2d')]=_0x2a92e5[_0x9d39('0x2d')][_0x9d39('0x2e')]?_0x2a92e5[_0x9d39('0x2d')]:_0x2a1adc['model'];if(!_0x2da4a2[_0x9d39('0x2b')][_0x9d39('0x2f')](_0x9d39('0x30'))){_0x2a92e5['limit']=qs[_0x9d39('0x31')](_0x2da4a2[_0x9d39('0x2b')][_0x9d39('0x31')]);_0x2a92e5[_0x9d39('0x1d')]=qs[_0x9d39('0x1d')](_0x2da4a2[_0x9d39('0x2b')][_0x9d39('0x1d')]);}_0x2a92e5[_0x9d39('0x32')]=qs[_0x9d39('0x33')](_0x2da4a2[_0x9d39('0x2b')]['sort']);_0x2a92e5[_0x9d39('0x34')]=qs[_0x9d39('0x35')](_[_0x9d39('0x36')](_0x2da4a2[_0x9d39('0x2b')],_0x2a1adc[_0x9d39('0x35')]));if(_0x2da4a2['query']['filter']){_0x2a92e5['where']=_[_0x9d39('0x37')](_0x2a92e5[_0x9d39('0x34')],{'$or':_[_0x9d39('0x38')](_0xcf6d09,function(_0x352cc4){if(_0x352cc4[_0x9d39('0x39')][_0x9d39('0x3a')]!=='VIRTUAL'){var _0x1c6e6c={};_0x1c6e6c[_0x352cc4[_0x9d39('0x3b')]]={'$like':'%'+_0x2da4a2['query'][_0x9d39('0x3c')]+'%'};return _0x1c6e6c;}})});}_0x2a92e5=_['merge']({},_0x2a92e5,_0x2da4a2[_0x9d39('0x3d')]);var _0x3f2d88={'where':_0x2a92e5[_0x9d39('0x34')]};return db[_0x9d39('0x27')][_0x9d39('0x1c')](_0x3f2d88)[_0x9d39('0x22')](function(_0x3fc1b9){_0x3c4408['count']=_0x3fc1b9;if(_0x2da4a2['query']['includeAll']){_0x2a92e5[_0x9d39('0x3e')]=[{'all':!![]}];}return db[_0x9d39('0x27')][_0x9d39('0x3f')](_0x2a92e5);})[_0x9d39('0x22')](function(_0x4bfb29){_0x3c4408['rows']=_0x4bfb29;return _0x3c4408;})[_0x9d39('0x22')](respondWithFilteredResult(_0x5c67b7,_0x2a92e5))['catch'](handleError(_0x5c67b7,null));};exports['show']=function(_0x14fa28,_0x3b1be6){var _0x18c2e9={'raw':!![],'where':{'id':_0x14fa28['params']['id']}},_0xafede6={};_0xafede6[_0x9d39('0x29')]=_[_0x9d39('0x2a')](db[_0x9d39('0x27')][_0x9d39('0x28')]);_0xafede6['query']=_['keys'](_0x14fa28[_0x9d39('0x2b')]);_0xafede6[_0x9d39('0x35')]=_[_0x9d39('0x40')](_0xafede6[_0x9d39('0x29')],_0xafede6[_0x9d39('0x2b')]);_0x18c2e9[_0x9d39('0x2d')]=_[_0x9d39('0x40')](_0xafede6['model'],qs[_0x9d39('0x2c')](_0x14fa28[_0x9d39('0x2b')][_0x9d39('0x2c')]));_0x18c2e9['attributes']=_0x18c2e9[_0x9d39('0x2d')][_0x9d39('0x2e')]?_0x18c2e9['attributes']:_0xafede6['model'];if(_0x14fa28['query'][_0x9d39('0x41')]){_0x18c2e9['include']=[{'all':!![]}];}_0x18c2e9=_[_0x9d39('0x37')]({},_0x18c2e9,_0x14fa28[_0x9d39('0x3d')]);return db[_0x9d39('0x27')]['find'](_0x18c2e9)[_0x9d39('0x22')](handleEntityNotFound(_0x3b1be6,null))['then'](respondWithResult(_0x3b1be6,null))[_0x9d39('0x42')](handleError(_0x3b1be6,null));};exports[_0x9d39('0x43')]=function(_0x5f0ec5,_0x4b0d7d){return db[_0x9d39('0x27')][_0x9d39('0x43')](_0x5f0ec5[_0x9d39('0x44')],{})['then'](respondWithResult(_0x4b0d7d,0xc9))[_0x9d39('0x42')](handleError(_0x4b0d7d,null));};exports[_0x9d39('0x21')]=function(_0x510d3b,_0x558ffe){if(_0x510d3b[_0x9d39('0x44')]['id']){delete _0x510d3b[_0x9d39('0x44')]['id'];}return db[_0x9d39('0x27')][_0x9d39('0x45')]({'where':{'id':_0x510d3b[_0x9d39('0x46')]['id']}})[_0x9d39('0x22')](handleEntityNotFound(_0x558ffe,null))[_0x9d39('0x22')](saveUpdates(_0x510d3b[_0x9d39('0x44')],null))[_0x9d39('0x22')](respondWithResult(_0x558ffe,null))[_0x9d39('0x42')](handleError(_0x558ffe,null));};exports[_0x9d39('0x47')]=function(_0x4e2bf9,_0x34e612){return db[_0x9d39('0x27')][_0x9d39('0x45')]({'where':{'id':_0x4e2bf9[_0x9d39('0x46')]['id']}})[_0x9d39('0x22')](handleEntityNotFound(_0x34e612,null))['then'](removeEntity(_0x34e612,null))[_0x9d39('0x42')](handleError(_0x34e612,null));};exports[_0x9d39('0x48')]=function(_0x23a00a,_0x52e48d){return db[_0x9d39('0x27')][_0x9d39('0x48')]()[_0x9d39('0x22')](respondWithResult(_0x52e48d,null))[_0x9d39('0x42')](handleError(_0x52e48d,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4e5be4f..e87ed61 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 _0x3c2c=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x3c2c,0x160));var _0xc3c2=function(_0x38fc71,_0x1f37a1){_0x38fc71=_0x38fc71-0x0;var _0x121eb6=_0x3c2c[_0x38fc71];return _0x121eb6;};'use strict';var _=require(_0xc3c2('0x0'));var util=require(_0xc3c2('0x1'));var logger=require(_0xc3c2('0x2'))(_0xc3c2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3c2('0x4'));var fs=require('fs');var path=require(_0xc3c2('0x5'));var rimraf=require(_0xc3c2('0x6'));var config=require(_0xc3c2('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xc3c2('0x8')]=function(_0x158a5f,_0x234da9){return _0x158a5f[_0xc3c2('0x9')](_0xc3c2('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8164=['../../config/logger','moment','bluebird','path','../../config/environment','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x55f6f6,_0x2d921e){var _0x3734f9=function(_0x343f34){while(--_0x343f34){_0x55f6f6['push'](_0x55f6f6['shift']());}};_0x3734f9(++_0x2d921e);}(_0x8164,0x170));var _0x4816=function(_0x5c2935,_0x57a86e){_0x5c2935=_0x5c2935-0x0;var _0x29fd1d=_0x8164[_0x5c2935];return _0x29fd1d;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var logger=require(_0x4816('0x2'))('api');var moment=require(_0x4816('0x3'));var BPromise=require(_0x4816('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4816('0x5'));var rimraf=require('rimraf');var config=require(_0x4816('0x6'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x1b3efa,_0x4b6510){return _0x1b3efa['define'](_0x4816('0x7'),attributes,{'tableName':_0x4816('0x8'),'paranoid':![],'indexes':[{'name':_0x4816('0x9'),'fields':[_0x4816('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 090db99..05b70c4 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 _0xbb8d=['stringify','error','code','message','result','CreateMailQueueReport','MailQueueReport','options','raw','debug','catch','UpdateMailQueueReport','update','body','where','attributes','then','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0xdfcfd1,_0x1ec03b){var _0x4e8035=function(_0x18d1c9){while(--_0x18d1c9){_0xdfcfd1['push'](_0xdfcfd1['shift']());}};_0x4e8035(++_0x1ec03b);}(_0xbb8d,0xf1));var _0xdbb8=function(_0x3c6106,_0x1ca4e9){_0x3c6106=_0x3c6106-0x0;var _0x23f6eb=_0xbb8d[_0x3c6106];return _0x23f6eb;};'use strict';var _=require(_0xdbb8('0x0'));var util=require(_0xdbb8('0x1'));var moment=require(_0xdbb8('0x2'));var BPromise=require(_0xdbb8('0x3'));var rs=require(_0xdbb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbb8('0x5'));var logger=require(_0xdbb8('0x6'))(_0xdbb8('0x7'));var config=require(_0xdbb8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdbb8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a14a,_0x1d561a,_0x350e85){return new BPromise(function(_0x33abf4,_0x4d8def){return client[_0xdbb8('0xa')](_0x18a14a,_0x350e85)['then'](function(_0x6257c0){logger[_0xdbb8('0xb')](_0xdbb8('0xc'),_0x1d561a,_0xdbb8('0xd'));logger['debug'](_0xdbb8('0xe'),_0x1d561a,_0xdbb8('0xd'),JSON[_0xdbb8('0xf')](_0x6257c0));if(_0x6257c0[_0xdbb8('0x10')]){if(_0x6257c0['error'][_0xdbb8('0x11')]===0x1f4){logger[_0xdbb8('0x10')](_0xdbb8('0xc'),_0x1d561a,_0x6257c0[_0xdbb8('0x10')][_0xdbb8('0x12')]);return _0x4d8def(_0x6257c0[_0xdbb8('0x10')][_0xdbb8('0x12')]);}logger[_0xdbb8('0x10')](_0xdbb8('0xc'),_0x1d561a,_0x6257c0['error'][_0xdbb8('0x12')]);return _0x33abf4(_0x6257c0[_0xdbb8('0x10')][_0xdbb8('0x12')]);}else{logger[_0xdbb8('0xb')](_0xdbb8('0xc'),_0x1d561a,_0xdbb8('0xd'));_0x33abf4(_0x6257c0[_0xdbb8('0x13')][_0xdbb8('0x12')]);}})['catch'](function(_0x50dfb2){logger[_0xdbb8('0x10')](_0xdbb8('0xc'),_0x1d561a,_0x50dfb2);_0x4d8def(_0x50dfb2);});});}exports[_0xdbb8('0x14')]=function(_0x1cb383){var _0x3cfc2e=this;return new Promise(function(_0x1b6804,_0x56bf08){return db[_0xdbb8('0x15')]['create'](_0x1cb383['body'],{'raw':_0x1cb383[_0xdbb8('0x16')]?_0x1cb383[_0xdbb8('0x16')][_0xdbb8('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x299632){logger['info'](_0xdbb8('0x14'),_0x1cb383);logger[_0xdbb8('0x18')](_0xdbb8('0x14'),_0x1cb383,JSON['stringify'](_0x299632));_0x1b6804(_0x299632);})[_0xdbb8('0x19')](function(_0x1ae3f9){logger['error']('CreateMailQueueReport',_0x1ae3f9[_0xdbb8('0x12')],_0x1cb383);_0x56bf08(_0x3cfc2e[_0xdbb8('0x10')](0x1f4,_0x1ae3f9['message']));});});};exports[_0xdbb8('0x1a')]=function(_0x92dd9f){var _0x29ad23=this;return new Promise(function(_0x3c1315,_0x1f79fd){return db[_0xdbb8('0x15')][_0xdbb8('0x1b')](_0x92dd9f[_0xdbb8('0x1c')],{'raw':_0x92dd9f[_0xdbb8('0x16')]?_0x92dd9f[_0xdbb8('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92dd9f[_0xdbb8('0x16')]?_0x92dd9f[_0xdbb8('0x16')][_0xdbb8('0x1d')]||null:null,'attributes':_0x92dd9f['options']?_0x92dd9f[_0xdbb8('0x16')][_0xdbb8('0x1e')]||null:null,'limit':_0x92dd9f[_0xdbb8('0x16')]?_0x92dd9f[_0xdbb8('0x16')]['limit']||null:null})[_0xdbb8('0x1f')](function(_0x34618c){logger[_0xdbb8('0xb')]('UpdateMailQueueReport',_0x92dd9f);logger[_0xdbb8('0x18')](_0xdbb8('0x1a'),_0x92dd9f,JSON[_0xdbb8('0xf')](_0x34618c));_0x3c1315(_0x34618c);})[_0xdbb8('0x19')](function(_0x4a803a){logger[_0xdbb8('0x10')](_0xdbb8('0x1a'),_0x4a803a[_0xdbb8('0x12')],_0x92dd9f);_0x1f79fd(_0x29ad23[_0xdbb8('0x10')](0x1f4,_0x4a803a[_0xdbb8('0x12')]));});});}; \ No newline at end of file +var _0xb3e4=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','MailQueueReport,\x20%s,\x20%s','message','info','catch','CreateMailQueueReport','create','body','options','raw','UpdateMailQueueReport','MailQueueReport','update','where','limit','lodash','moment','randomstring'];(function(_0x59cf23,_0x39865d){var _0x4579c6=function(_0x4748ee){while(--_0x4748ee){_0x59cf23['push'](_0x59cf23['shift']());}};_0x4579c6(++_0x39865d);}(_0xb3e4,0x171));var _0x4b3e=function(_0x386db2,_0x549d7a){_0x386db2=_0x386db2-0x0;var _0x5792d9=_0xb3e4[_0x386db2];return _0x5792d9;};'use strict';var _=require(_0x4b3e('0x0'));var util=require('util');var moment=require(_0x4b3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b3e('0x2'));var fs=require('fs');var Redis=require(_0x4b3e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b3e('0x4'));var logger=require(_0x4b3e('0x5'))('rpc');var config=require(_0x4b3e('0x6'));var jayson=require(_0x4b3e('0x7'));var client=jayson[_0x4b3e('0x8')][_0x4b3e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x435db5,_0x585862,_0x39caa4){return new BPromise(function(_0x1247b4,_0x162924){return client[_0x4b3e('0xa')](_0x435db5,_0x39caa4)[_0x4b3e('0xb')](function(_0x5eb297){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x585862,_0x4b3e('0xc'));logger[_0x4b3e('0xd')](_0x4b3e('0xe'),_0x585862,'request\x20sent',JSON['stringify'](_0x5eb297));if(_0x5eb297['error']){if(_0x5eb297[_0x4b3e('0xf')][_0x4b3e('0x10')]===0x1f4){logger[_0x4b3e('0xf')](_0x4b3e('0x11'),_0x585862,_0x5eb297[_0x4b3e('0xf')][_0x4b3e('0x12')]);return _0x162924(_0x5eb297[_0x4b3e('0xf')][_0x4b3e('0x12')]);}logger[_0x4b3e('0xf')](_0x4b3e('0x11'),_0x585862,_0x5eb297[_0x4b3e('0xf')][_0x4b3e('0x12')]);return _0x1247b4(_0x5eb297[_0x4b3e('0xf')][_0x4b3e('0x12')]);}else{logger[_0x4b3e('0x13')](_0x4b3e('0x11'),_0x585862,_0x4b3e('0xc'));_0x1247b4(_0x5eb297['result'][_0x4b3e('0x12')]);}})[_0x4b3e('0x14')](function(_0x4f25af){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x585862,_0x4f25af);_0x162924(_0x4f25af);});});}exports[_0x4b3e('0x15')]=function(_0x15bae9){var _0x2bb2a3=this;return new Promise(function(_0x2c825b,_0x445bfd){return db['MailQueueReport'][_0x4b3e('0x16')](_0x15bae9[_0x4b3e('0x17')],{'raw':_0x15bae9[_0x4b3e('0x18')]?_0x15bae9['options'][_0x4b3e('0x19')]===undefined?!![]:![]:!![]})[_0x4b3e('0xb')](function(_0x18be72){logger[_0x4b3e('0x13')](_0x4b3e('0x15'),_0x15bae9);logger['debug'](_0x4b3e('0x15'),_0x15bae9,JSON['stringify'](_0x18be72));_0x2c825b(_0x18be72);})['catch'](function(_0x563444){logger['error'](_0x4b3e('0x15'),_0x563444[_0x4b3e('0x12')],_0x15bae9);_0x445bfd(_0x2bb2a3['error'](0x1f4,_0x563444[_0x4b3e('0x12')]));});});};exports[_0x4b3e('0x1a')]=function(_0xc51b17){var _0xaee9c=this;return new Promise(function(_0x494171,_0x4dfed8){return db[_0x4b3e('0x1b')][_0x4b3e('0x1c')](_0xc51b17['body'],{'raw':_0xc51b17[_0x4b3e('0x18')]?_0xc51b17['options'][_0x4b3e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc51b17[_0x4b3e('0x18')]?_0xc51b17[_0x4b3e('0x18')][_0x4b3e('0x1d')]||null:null,'attributes':_0xc51b17[_0x4b3e('0x18')]?_0xc51b17[_0x4b3e('0x18')]['attributes']||null:null,'limit':_0xc51b17[_0x4b3e('0x18')]?_0xc51b17[_0x4b3e('0x18')][_0x4b3e('0x1e')]||null:null})[_0x4b3e('0xb')](function(_0x2b5601){logger[_0x4b3e('0x13')](_0x4b3e('0x1a'),_0xc51b17);logger[_0x4b3e('0xd')](_0x4b3e('0x1a'),_0xc51b17,JSON['stringify'](_0x2b5601));_0x494171(_0x2b5601);})[_0x4b3e('0x14')](function(_0x552176){logger[_0x4b3e('0xf')](_0x4b3e('0x1a'),_0x552176['message'],_0xc51b17);_0x4dfed8(_0xaee9c[_0x4b3e('0xf')](0x1f4,_0x552176[_0x4b3e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a3d3be5..470d1b1 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 _0x7c1f=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x3255bc,_0x9b886a){var _0x4d8a50=function(_0x46bcc1){while(--_0x46bcc1){_0x3255bc['push'](_0x3255bc['shift']());}};_0x4d8a50(++_0x9b886a);}(_0x7c1f,0x194));var _0xf7c1=function(_0xe1b5e2,_0x17ab19){_0xe1b5e2=_0xe1b5e2-0x0;var _0x1f0dfc=_0x7c1f[_0xe1b5e2];return _0x1f0dfc;};'use strict';var multer=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var path=require(_0xf7c1('0x2'));var timeout=require(_0xf7c1('0x3'));var express=require(_0xf7c1('0x4'));var router=express['Router']();var auth=require(_0xf7c1('0x5'));var interaction=require(_0xf7c1('0x6'));var config=require(_0xf7c1('0x7'));module['exports']=router; \ No newline at end of file +var _0x9ab0=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4777dc,_0xbce636){var _0x16d933=function(_0x238430){while(--_0x238430){_0x4777dc['push'](_0x4777dc['shift']());}};_0x16d933(++_0xbce636);}(_0x9ab0,0x195));var _0x09ab=function(_0x3788dd,_0x418e77){_0x3788dd=_0x3788dd-0x0;var _0xf2809b=_0x9ab0[_0x3788dd];return _0xf2809b;};'use strict';var multer=require(_0x09ab('0x0'));var util=require(_0x09ab('0x1'));var path=require(_0x09ab('0x2'));var timeout=require(_0x09ab('0x3'));var express=require(_0x09ab('0x4'));var router=express[_0x09ab('0x5')]();var auth=require(_0x09ab('0x6'));var interaction=require(_0x09ab('0x7'));var config=require(_0x09ab('0x8'));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 a15fa5d..bca9255 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 _0x6e6c=['BOOLEAN','INBOX','INTEGER','sequelize','exports','STRING'];(function(_0x487974,_0x3e5199){var _0x5c3f8d=function(_0x2cf4e2){while(--_0x2cf4e2){_0x487974['push'](_0x487974['shift']());}};_0x5c3f8d(++_0x3e5199);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc6e6('0x2')]},'authentication':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xc6e6('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xc6e6('0x4')},'connTimeout':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xc6e6('0x2')]}}; \ No newline at end of file +var _0x684c=['INTEGER','sequelize','exports','STRING','BOOLEAN','username','INBOX'];(function(_0x5846b6,_0x299729){var _0x5b4ba4=function(_0x50357f){while(--_0x50357f){_0x5846b6['push'](_0x5846b6['shift']());}};_0x5b4ba4(++_0x299729);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc684('0x0'));module[_0xc684('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc684('0x2')]},'authentication':{'type':Sequelize[_0xc684('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc684('0x2')],'unique':_0xc684('0x4')},'password':{'type':Sequelize[_0xc684('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xc684('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc684('0x2')],'defaultValue':_0xc684('0x5')},'connTimeout':{'type':Sequelize[_0xc684('0x6')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc684('0x6')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc684('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 35e67e5..9d704f2 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 _0x1642=['path','../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','../../config/logger','api'];(function(_0x56303f,_0x1561b5){var _0x35f47d=function(_0x30c467){while(--_0x30c467){_0x56303f['push'](_0x56303f['shift']());}};_0x35f47d(++_0x1561b5);}(_0x1642,0x1e8));var _0x2164=function(_0x53a8c4,_0x1deb52){_0x53a8c4=_0x53a8c4-0x0;var _0x171730=_0x1642[_0x53a8c4];return _0x171730;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2164('0x0'))(_0x2164('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2164('0x2'));var rimraf=require('rimraf');var config=require(_0x2164('0x3'));var attributes=require(_0x2164('0x4'));module['exports']=function(_0x4d51eb,_0x5d7b53){return _0x4d51eb['define'](_0x2164('0x5'),attributes,{'tableName':_0x2164('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xada4=['../../config/environment','./mailServerIn.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b4ad1,_0x2f97d5){var _0x501964=function(_0x40aacf){while(--_0x40aacf){_0x2b4ad1['push'](_0x2b4ad1['shift']());}};_0x501964(++_0x2f97d5);}(_0xada4,0x1bc));var _0x4ada=function(_0x470091,_0x25da8e){_0x470091=_0x470091-0x0;var _0x3ab462=_0xada4[_0x470091];return _0x3ab462;};'use strict';var _=require('lodash');var util=require(_0x4ada('0x0'));var logger=require(_0x4ada('0x1'))(_0x4ada('0x2'));var moment=require(_0x4ada('0x3'));var BPromise=require(_0x4ada('0x4'));var rp=require(_0x4ada('0x5'));var fs=require('fs');var path=require(_0x4ada('0x6'));var rimraf=require('rimraf');var config=require(_0x4ada('0x7'));var attributes=require(_0x4ada('0x8'));module[_0x4ada('0x9')]=function(_0x508591,_0x84040e){return _0x508591[_0x4ada('0xa')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 423c197..32281b7 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 _0x4334=['GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xb368e7,_0x9f553){var _0x43e0cd=function(_0x36669a){while(--_0x36669a){_0xb368e7['push'](_0xb368e7['shift']());}};_0x43e0cd(++_0x9f553);}(_0x4334,0xcd));var _0x4433=function(_0x304708,_0x243f40){_0x304708=_0x304708-0x0;var _0x5ea96e=_0x4334[_0x304708];return _0x5ea96e;};'use strict';var _=require(_0x4433('0x0'));var util=require(_0x4433('0x1'));var moment=require('moment');var BPromise=require(_0x4433('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4433('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4433('0x4'))(_0x4433('0x5'));var config=require('../../config/environment');var jayson=require(_0x4433('0x6'));var client=jayson[_0x4433('0x7')][_0x4433('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e66c6,_0x2119d7,_0x135b74){return new BPromise(function(_0x2e1174,_0x1f0817){return client[_0x4433('0x9')](_0x2e66c6,_0x135b74)[_0x4433('0xa')](function(_0x560c4e){logger[_0x4433('0xb')](_0x4433('0xc'),_0x2119d7,_0x4433('0xd'));logger['debug'](_0x4433('0xe'),_0x2119d7,_0x4433('0xd'),JSON['stringify'](_0x560c4e));if(_0x560c4e['error']){if(_0x560c4e[_0x4433('0xf')][_0x4433('0x10')]===0x1f4){logger[_0x4433('0xf')](_0x4433('0xc'),_0x2119d7,_0x560c4e[_0x4433('0xf')][_0x4433('0x11')]);return _0x1f0817(_0x560c4e[_0x4433('0xf')][_0x4433('0x11')]);}logger['error'](_0x4433('0xc'),_0x2119d7,_0x560c4e[_0x4433('0xf')][_0x4433('0x11')]);return _0x2e1174(_0x560c4e[_0x4433('0xf')][_0x4433('0x11')]);}else{logger[_0x4433('0xb')]('MailServerIn,\x20%s,\x20%s',_0x2119d7,_0x4433('0xd'));_0x2e1174(_0x560c4e[_0x4433('0x12')][_0x4433('0x11')]);}})['catch'](function(_0x1ad32e){logger[_0x4433('0xf')](_0x4433('0xc'),_0x2119d7,_0x1ad32e);_0x1f0817(_0x1ad32e);});});}exports[_0x4433('0x13')]=function(_0x5e8a64){var _0x10dc68=this;return new Promise(function(_0x385680,_0x169cc3){return db[_0x4433('0x14')][_0x4433('0x15')]({'raw':_0x5e8a64[_0x4433('0x16')]?_0x5e8a64[_0x4433('0x16')][_0x4433('0x17')]===undefined?!![]:![]:!![],'where':_0x5e8a64[_0x4433('0x16')]?_0x5e8a64[_0x4433('0x16')][_0x4433('0x18')]||null:null,'attributes':_0x5e8a64[_0x4433('0x16')]?_0x5e8a64[_0x4433('0x16')][_0x4433('0x19')]||null:null,'limit':_0x5e8a64[_0x4433('0x16')]?_0x5e8a64[_0x4433('0x16')][_0x4433('0x1a')]||null:null,'include':_0x5e8a64[_0x4433('0x16')]?_0x5e8a64[_0x4433('0x16')][_0x4433('0x1b')]?_[_0x4433('0x1c')](_0x5e8a64[_0x4433('0x16')][_0x4433('0x1b')],function(_0x1bf290){return{'model':db[_0x1bf290['model']],'as':_0x1bf290['as'],'attributes':_0x1bf290['attributes'],'include':_0x1bf290[_0x4433('0x1b')]?_[_0x4433('0x1c')](_0x1bf290[_0x4433('0x1b')],function(_0xcba9e){return{'model':db[_0xcba9e[_0x4433('0x1d')]],'as':_0xcba9e['as'],'attributes':_0xcba9e[_0x4433('0x19')],'include':_0xcba9e[_0x4433('0x1b')]?_[_0x4433('0x1c')](_0xcba9e['include'],function(_0x4757ec){return{'model':db[_0x4757ec[_0x4433('0x1d')]],'as':_0x4757ec['as'],'attributes':_0x4757ec[_0x4433('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x382361){logger['info'](_0x4433('0x13'),_0x5e8a64);logger['debug'](_0x4433('0x13'),_0x5e8a64,JSON[_0x4433('0x1e')](_0x382361));_0x385680(_0x382361);})[_0x4433('0x1f')](function(_0x5f4d07){logger[_0x4433('0xf')](_0x4433('0x13'),_0x5f4d07[_0x4433('0x11')],_0x5e8a64);_0x169cc3(_0x10dc68[_0x4433('0xf')](0x1f4,_0x5f4d07['message']));});});}; \ No newline at end of file +var _0x1a7f=['result','catch','MailServerIn','findAll','options','where','limit','include','model','attributes','map','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','info'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0x1a7f,0x1da));var _0xf1a7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1a7f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf1a7('0x0'));var util=require(_0xf1a7('0x1'));var moment=require(_0xf1a7('0x2'));var BPromise=require(_0xf1a7('0x3'));var rs=require(_0xf1a7('0x4'));var fs=require('fs');var Redis=require(_0xf1a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1a7('0x6'));var logger=require(_0xf1a7('0x7'))(_0xf1a7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf1a7('0x9')][_0xf1a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7d52,_0x1a80f0,_0x2dd2e6){return new BPromise(function(_0x249fcf,_0x4dd712){return client['request'](_0x2b7d52,_0x2dd2e6)[_0xf1a7('0xb')](function(_0x10f69d){logger['info']('MailServerIn,\x20%s,\x20%s',_0x1a80f0,_0xf1a7('0xc'));logger[_0xf1a7('0xd')](_0xf1a7('0xe'),_0x1a80f0,_0xf1a7('0xc'),JSON[_0xf1a7('0xf')](_0x10f69d));if(_0x10f69d[_0xf1a7('0x10')]){if(_0x10f69d[_0xf1a7('0x10')][_0xf1a7('0x11')]===0x1f4){logger[_0xf1a7('0x10')](_0xf1a7('0x12'),_0x1a80f0,_0x10f69d[_0xf1a7('0x10')][_0xf1a7('0x13')]);return _0x4dd712(_0x10f69d['error'][_0xf1a7('0x13')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x1a80f0,_0x10f69d[_0xf1a7('0x10')][_0xf1a7('0x13')]);return _0x249fcf(_0x10f69d['error'][_0xf1a7('0x13')]);}else{logger[_0xf1a7('0x14')]('MailServerIn,\x20%s,\x20%s',_0x1a80f0,_0xf1a7('0xc'));_0x249fcf(_0x10f69d[_0xf1a7('0x15')][_0xf1a7('0x13')]);}})[_0xf1a7('0x16')](function(_0x1332a8){logger[_0xf1a7('0x10')](_0xf1a7('0x12'),_0x1a80f0,_0x1332a8);_0x4dd712(_0x1332a8);});});}exports['GetMailServerIn']=function(_0x4e41dd){var _0x329178=this;return new Promise(function(_0x543121,_0x234142){return db[_0xf1a7('0x17')][_0xf1a7('0x18')]({'raw':_0x4e41dd[_0xf1a7('0x19')]?_0x4e41dd[_0xf1a7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e41dd[_0xf1a7('0x19')]?_0x4e41dd[_0xf1a7('0x19')][_0xf1a7('0x1a')]||null:null,'attributes':_0x4e41dd[_0xf1a7('0x19')]?_0x4e41dd[_0xf1a7('0x19')]['attributes']||null:null,'limit':_0x4e41dd[_0xf1a7('0x19')]?_0x4e41dd[_0xf1a7('0x19')][_0xf1a7('0x1b')]||null:null,'include':_0x4e41dd[_0xf1a7('0x19')]?_0x4e41dd[_0xf1a7('0x19')][_0xf1a7('0x1c')]?_['map'](_0x4e41dd[_0xf1a7('0x19')][_0xf1a7('0x1c')],function(_0x11a55b){return{'model':db[_0x11a55b[_0xf1a7('0x1d')]],'as':_0x11a55b['as'],'attributes':_0x11a55b[_0xf1a7('0x1e')],'include':_0x11a55b[_0xf1a7('0x1c')]?_[_0xf1a7('0x1f')](_0x11a55b[_0xf1a7('0x1c')],function(_0x2efc03){return{'model':db[_0x2efc03[_0xf1a7('0x1d')]],'as':_0x2efc03['as'],'attributes':_0x2efc03['attributes'],'include':_0x2efc03[_0xf1a7('0x1c')]?_[_0xf1a7('0x1f')](_0x2efc03['include'],function(_0xcbaea8){return{'model':db[_0xcbaea8[_0xf1a7('0x1d')]],'as':_0xcbaea8['as'],'attributes':_0xcbaea8[_0xf1a7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24395f){logger['info']('GetMailServerIn',_0x4e41dd);logger[_0xf1a7('0xd')](_0xf1a7('0x20'),_0x4e41dd,JSON[_0xf1a7('0xf')](_0x24395f));_0x543121(_0x24395f);})[_0xf1a7('0x16')](function(_0xd9143){logger[_0xf1a7('0x10')]('GetMailServerIn',_0xd9143[_0xf1a7('0x13')],_0x4e41dd);_0x234142(_0x329178[_0xf1a7('0x10')](0x1f4,_0xd9143[_0xf1a7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c5db79b..b6912fc 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 _0x4f7e=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy'];(function(_0x5224b9,_0x195fcb){var _0x363bcc=function(_0x3d219a){while(--_0x3d219a){_0x5224b9['push'](_0x5224b9['shift']());}};_0x363bcc(++_0x195fcb);}(_0x4f7e,0x10f));var _0xe4f7=function(_0x324647,_0x4510cd){_0x324647=_0x324647-0x0;var _0x2edadf=_0x4f7e[_0x324647];return _0x2edadf;};'use strict';var multer=require(_0xe4f7('0x0'));var util=require(_0xe4f7('0x1'));var path=require(_0xe4f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4f7('0x3'));var router=express[_0xe4f7('0x4')]();var auth=require(_0xe4f7('0x5'));var interaction=require(_0xe4f7('0x6'));var config=require(_0xe4f7('0x7'));var controller=require(_0xe4f7('0x8'));router[_0xe4f7('0x9')]('/',auth[_0xe4f7('0xa')](),controller[_0xe4f7('0xb')]);router[_0xe4f7('0x9')](_0xe4f7('0xc'),auth[_0xe4f7('0xa')](),controller[_0xe4f7('0xd')]);router['post']('/',auth[_0xe4f7('0xa')](),controller['create']);router[_0xe4f7('0xe')](_0xe4f7('0xc'),auth[_0xe4f7('0xa')](),controller['update']);router[_0xe4f7('0xf')](_0xe4f7('0xc'),auth[_0xe4f7('0xa')](),controller[_0xe4f7('0x10')]);module[_0xe4f7('0x11')]=router; \ No newline at end of file +var _0x5689=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x48712a,_0x51df40){var _0x10b3d1=function(_0x412831){while(--_0x412831){_0x48712a['push'](_0x48712a['shift']());}};_0x10b3d1(++_0x51df40);}(_0x5689,0xfd));var _0x9568=function(_0x2f5ee6,_0x3d4315){_0x2f5ee6=_0x2f5ee6-0x0;var _0x116d9f=_0x5689[_0x2f5ee6];return _0x116d9f;};'use strict';var multer=require(_0x9568('0x0'));var util=require('util');var path=require(_0x9568('0x1'));var timeout=require(_0x9568('0x2'));var express=require('express');var router=express[_0x9568('0x3')]();var auth=require(_0x9568('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9568('0x5'));var controller=require(_0x9568('0x6'));router[_0x9568('0x7')]('/',auth['isAuthenticated'](),controller[_0x9568('0x8')]);router['get'](_0x9568('0x9'),auth[_0x9568('0xa')](),controller[_0x9568('0xb')]);router[_0x9568('0xc')]('/',auth['isAuthenticated'](),controller[_0x9568('0xd')]);router[_0x9568('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9568('0xf')]);router['delete'](_0x9568('0x9'),auth[_0x9568('0xa')](),controller[_0x9568('0x10')]);module[_0x9568('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c8cb23e..c3f9069 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 _0x05cf=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x51821c,_0x2e39c5){var _0x20bde8=function(_0x2d307a){while(--_0x2d307a){_0x51821c['push'](_0x51821c['shift']());}};_0x20bde8(++_0x2e39c5);}(_0x05cf,0x7b));var _0xf05c=function(_0x2d323e,_0x4fcc48){_0x2d323e=_0x2d323e-0x0;var _0x101ee5=_0x05cf[_0x2d323e];return _0x101ee5;};'use strict';var Sequelize=require(_0xf05c('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xf05c('0x1')]},'user':{'type':Sequelize[_0xf05c('0x1')]},'pass':{'type':Sequelize[_0xf05c('0x1')]},'port':{'type':Sequelize[_0xf05c('0x2')]},'secure':{'type':Sequelize[_0xf05c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xf05c('0x1')]},'authentication':{'type':Sequelize[_0xf05c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3b1e=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3b1e,0xf0));var _0xe3b1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3b1e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe3b1('0x0'));module['exports']={'description':{'type':Sequelize[_0xe3b1('0x1')]},'host':{'type':Sequelize[_0xe3b1('0x1')]},'user':{'type':Sequelize[_0xe3b1('0x1')]},'pass':{'type':Sequelize[_0xe3b1('0x1')]},'port':{'type':Sequelize[_0xe3b1('0x2')]},'secure':{'type':Sequelize[_0xe3b1('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe3b1('0x1')]},'authentication':{'type':Sequelize[_0xe3b1('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index a5912bb..9920a1a 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 _0x34f0=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','reject','save','update','then','destroy','stack','name','index','MailServerOut','rawAttributes','model','keys','query','filters','attributes','length','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','rows','show','params','intersection','fields','find','create','body','catch','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x45413e,_0x3d8d36){var _0x1b9cac=function(_0x481444){while(--_0x481444){_0x45413e['push'](_0x45413e['shift']());}};_0x1b9cac(++_0x3d8d36);}(_0x34f0,0x13b));var _0x034f=function(_0x51d3c4,_0x43f5cb){_0x51d3c4=_0x51d3c4-0x0;var _0x2ccbca=_0x34f0[_0x51d3c4];return _0x2ccbca;};'use strict';var pdf=require(_0x034f('0x0'));var emlformat=require(_0x034f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x034f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x034f('0x3'));var moment=require(_0x034f('0x4'));var BPromise=require(_0x034f('0x5'));var Mustache=require(_0x034f('0x6'));var util=require(_0x034f('0x7'));var path=require('path');var sox=require(_0x034f('0x8'));var csv=require(_0x034f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x034f('0xa'));var squel=require('squel');var crypto=require(_0x034f('0xb'));var jsforce=require(_0x034f('0xc'));var deskjs=require(_0x034f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x034f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x034f('0xf'));var hardwareService=require(_0x034f('0x10'));var logger=require(_0x034f('0x11'))(_0x034f('0x12'));var utils=require(_0x034f('0x13'));var config=require('../../config/environment');var db=require(_0x034f('0x14'))['db'];function respondWithStatusCode(_0x446b50,_0x3d0f3b){_0x3d0f3b=_0x3d0f3b||0xcc;return function(_0x568180){if(_0x568180){return _0x446b50[_0x034f('0x15')](_0x3d0f3b);}return _0x446b50['status'](_0x3d0f3b)[_0x034f('0x16')]();};}function respondWithResult(_0x291d94,_0x375b1f){_0x375b1f=_0x375b1f||0xc8;return function(_0x29fe43){if(_0x29fe43){return _0x291d94[_0x034f('0x17')](_0x375b1f)[_0x034f('0x18')](_0x29fe43);}};}function respondWithFilteredResult(_0xc3061c,_0x167804){return function(_0x5bc410){if(_0x5bc410){var _0x538e89=_0x5bc410['count'],_0x101a1e=_0x167804['offset'],_0x3b911f=_0x167804[_0x034f('0x19')]+_0x167804[_0x034f('0x1a')],_0x21cd29;if(_0x3b911f>=_0x538e89){_0x3b911f=_0x538e89;_0x21cd29=0xc8;}else{_0x21cd29=0xce;}_0xc3061c['status'](_0x21cd29);return _0xc3061c[_0x034f('0x1b')]('Content-Range',_0x101a1e+'-'+_0x3b911f+'/'+_0x538e89)[_0x034f('0x18')](_0x5bc410);}return null;};}function patchUpdates(_0x2b57d0){return function(_0x1ebb01){try{jsonpatch['apply'](_0x1ebb01,_0x2b57d0,!![]);}catch(_0x21d0fc){return BPromise[_0x034f('0x1c')](_0x21d0fc);}return _0x1ebb01[_0x034f('0x1d')]();};}function saveUpdates(_0x112833,_0x349f12){return function(_0x5f442b){if(_0x5f442b){return _0x5f442b[_0x034f('0x1e')](_0x112833)[_0x034f('0x1f')](function(_0x32c4ad){return _0x32c4ad;});}return null;};}function removeEntity(_0x491ca3,_0xd6954b){return function(_0x1e9abb){if(_0x1e9abb){return _0x1e9abb[_0x034f('0x20')]()['then'](function(){_0x491ca3['status'](0xcc)[_0x034f('0x16')]();});}};}function handleEntityNotFound(_0x586598,_0x2d951b){return function(_0x1fd774){if(!_0x1fd774){_0x586598[_0x034f('0x15')](0x194);}return _0x1fd774;};}function handleError(_0x22dc21,_0x2943b8){_0x2943b8=_0x2943b8||0x1f4;return function(_0x169b1f){logger['error'](_0x169b1f[_0x034f('0x21')]);if(_0x169b1f[_0x034f('0x22')]){delete _0x169b1f[_0x034f('0x22')];}_0x22dc21[_0x034f('0x17')](_0x2943b8)['send'](_0x169b1f);};}exports[_0x034f('0x23')]=function(_0x8eacf2,_0x41793b){var _0x56d4da={},_0xa1dd7e={},_0x12d945={'count':0x0,'rows':[]};var _0x3016b5=db[_0x034f('0x24')][_0x034f('0x25')];_0xa1dd7e[_0x034f('0x26')]=_[_0x034f('0x27')](_0x3016b5);_0xa1dd7e[_0x034f('0x28')]=_[_0x034f('0x27')](_0x8eacf2[_0x034f('0x28')]);_0xa1dd7e[_0x034f('0x29')]=_['intersection'](_0xa1dd7e['model'],_0xa1dd7e[_0x034f('0x28')]);_0x56d4da['attributes']=_['intersection'](_0xa1dd7e['model'],qs['fields'](_0x8eacf2['query']['fields']));_0x56d4da[_0x034f('0x2a')]=_0x56d4da['attributes'][_0x034f('0x2b')]?_0x56d4da['attributes']:_0xa1dd7e[_0x034f('0x26')];if(!_0x8eacf2['query']['hasOwnProperty']('nolimit')){_0x56d4da[_0x034f('0x1a')]=qs[_0x034f('0x1a')](_0x8eacf2[_0x034f('0x28')]['limit']);_0x56d4da[_0x034f('0x19')]=qs['offset'](_0x8eacf2['query'][_0x034f('0x19')]);}_0x56d4da[_0x034f('0x2c')]=qs[_0x034f('0x2d')](_0x8eacf2[_0x034f('0x28')][_0x034f('0x2d')]);_0x56d4da[_0x034f('0x2e')]=qs[_0x034f('0x29')](_[_0x034f('0x2f')](_0x8eacf2[_0x034f('0x28')],_0xa1dd7e[_0x034f('0x29')]));if(_0x8eacf2[_0x034f('0x28')][_0x034f('0x30')]){_0x56d4da[_0x034f('0x2e')]=_[_0x034f('0x31')](_0x56d4da[_0x034f('0x2e')],{'$or':_['map'](_0x3016b5,function(_0x220eda){if(_0x220eda[_0x034f('0x32')][_0x034f('0x33')]!==_0x034f('0x34')){var _0x5016d0={};_0x5016d0[_0x220eda[_0x034f('0x35')]]={'$like':'%'+_0x8eacf2[_0x034f('0x28')][_0x034f('0x30')]+'%'};return _0x5016d0;}})});}_0x56d4da=_[_0x034f('0x31')]({},_0x56d4da,_0x8eacf2[_0x034f('0x36')]);var _0xd4bbc1={'where':_0x56d4da[_0x034f('0x2e')]};return db[_0x034f('0x24')][_0x034f('0x37')](_0xd4bbc1)[_0x034f('0x1f')](function(_0x38e2ed){_0x12d945['count']=_0x38e2ed;if(_0x8eacf2['query']['includeAll']){_0x56d4da[_0x034f('0x38')]=[{'all':!![]}];}return db[_0x034f('0x24')]['findAll'](_0x56d4da);})[_0x034f('0x1f')](function(_0x3e2340){_0x12d945[_0x034f('0x39')]=_0x3e2340;return _0x12d945;})[_0x034f('0x1f')](respondWithFilteredResult(_0x41793b,_0x56d4da))['catch'](handleError(_0x41793b,null));};exports[_0x034f('0x3a')]=function(_0xc4e184,_0x9d7552){var _0x1c4ae7={'raw':!![],'where':{'id':_0xc4e184[_0x034f('0x3b')]['id']}},_0x2d9c35={};_0x2d9c35[_0x034f('0x26')]=_[_0x034f('0x27')](db[_0x034f('0x24')][_0x034f('0x25')]);_0x2d9c35[_0x034f('0x28')]=_[_0x034f('0x27')](_0xc4e184[_0x034f('0x28')]);_0x2d9c35[_0x034f('0x29')]=_[_0x034f('0x3c')](_0x2d9c35[_0x034f('0x26')],_0x2d9c35[_0x034f('0x28')]);_0x1c4ae7['attributes']=_[_0x034f('0x3c')](_0x2d9c35['model'],qs[_0x034f('0x3d')](_0xc4e184[_0x034f('0x28')][_0x034f('0x3d')]));_0x1c4ae7[_0x034f('0x2a')]=_0x1c4ae7[_0x034f('0x2a')][_0x034f('0x2b')]?_0x1c4ae7[_0x034f('0x2a')]:_0x2d9c35[_0x034f('0x26')];if(_0xc4e184[_0x034f('0x28')]['includeAll']){_0x1c4ae7[_0x034f('0x38')]=[{'all':!![]}];}_0x1c4ae7=_['merge']({},_0x1c4ae7,_0xc4e184[_0x034f('0x36')]);return db[_0x034f('0x24')][_0x034f('0x3e')](_0x1c4ae7)[_0x034f('0x1f')](handleEntityNotFound(_0x9d7552,null))[_0x034f('0x1f')](respondWithResult(_0x9d7552,null))['catch'](handleError(_0x9d7552,null));};exports[_0x034f('0x3f')]=function(_0x1567d2,_0x16de26){return db[_0x034f('0x24')][_0x034f('0x3f')](_0x1567d2[_0x034f('0x40')],{})[_0x034f('0x1f')](respondWithResult(_0x16de26,0xc9))[_0x034f('0x41')](handleError(_0x16de26,null));};exports[_0x034f('0x1e')]=function(_0x111d72,_0x1af91a){if(_0x111d72[_0x034f('0x40')]['id']){delete _0x111d72[_0x034f('0x40')]['id'];}return db[_0x034f('0x24')]['find']({'where':{'id':_0x111d72[_0x034f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1af91a,null))[_0x034f('0x1f')](saveUpdates(_0x111d72[_0x034f('0x40')],null))[_0x034f('0x1f')](respondWithResult(_0x1af91a,null))[_0x034f('0x41')](handleError(_0x1af91a,null));};exports[_0x034f('0x20')]=function(_0x4bb80d,_0x38a48f){return db['MailServerOut']['find']({'where':{'id':_0x4bb80d[_0x034f('0x3b')]['id']}})[_0x034f('0x1f')](handleEntityNotFound(_0x38a48f,null))[_0x034f('0x1f')](removeEntity(_0x38a48f,null))[_0x034f('0x41')](handleError(_0x38a48f,null));}; \ No newline at end of file +var _0x5800=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','MailServerOut','rawAttributes','keys','query'];(function(_0x4bb972,_0x296d21){var _0x1b6dae=function(_0x1c6269){while(--_0x1c6269){_0x4bb972['push'](_0x4bb972['shift']());}};_0x1b6dae(++_0x296d21);}(_0x5800,0x1b9));var _0x0580=function(_0x5dc886,_0x5262bc){_0x5dc886=_0x5dc886-0x0;var _0x2b6198=_0x5800[_0x5dc886];return _0x2b6198;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0580('0x0'));var rimraf=require(_0x0580('0x1'));var zipdir=require(_0x0580('0x2'));var jsonpatch=require(_0x0580('0x3'));var rp=require('request-promise');var moment=require(_0x0580('0x4'));var BPromise=require(_0x0580('0x5'));var Mustache=require('mustache');var util=require(_0x0580('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0580('0x7'));var ejs=require(_0x0580('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0580('0x9'));var crypto=require('crypto');var jsforce=require(_0x0580('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0580('0x7'));var querystring=require(_0x0580('0xb'));var Papa=require(_0x0580('0xc'));var Redis=require(_0x0580('0xd'));var authService=require(_0x0580('0xe'));var qs=require(_0x0580('0xf'));var hardwareService=require(_0x0580('0x10'));var logger=require(_0x0580('0x11'))('api');var utils=require(_0x0580('0x12'));var config=require(_0x0580('0x13'));var db=require(_0x0580('0x14'))['db'];function respondWithStatusCode(_0x54aaff,_0x5d7f5d){_0x5d7f5d=_0x5d7f5d||0xcc;return function(_0x245002){if(_0x245002){return _0x54aaff[_0x0580('0x15')](_0x5d7f5d);}return _0x54aaff[_0x0580('0x16')](_0x5d7f5d)['end']();};}function respondWithResult(_0x58f524,_0x41ec01){_0x41ec01=_0x41ec01||0xc8;return function(_0x45d8b2){if(_0x45d8b2){return _0x58f524['status'](_0x41ec01)[_0x0580('0x17')](_0x45d8b2);}};}function respondWithFilteredResult(_0x16759a,_0x473bcd){return function(_0x25127f){if(_0x25127f){var _0x42f2ea=_0x25127f[_0x0580('0x18')],_0x16b257=_0x473bcd[_0x0580('0x19')],_0x1e9639=_0x473bcd[_0x0580('0x19')]+_0x473bcd[_0x0580('0x1a')],_0x5da996;if(_0x1e9639>=_0x42f2ea){_0x1e9639=_0x42f2ea;_0x5da996=0xc8;}else{_0x5da996=0xce;}_0x16759a[_0x0580('0x16')](_0x5da996);return _0x16759a['set'](_0x0580('0x1b'),_0x16b257+'-'+_0x1e9639+'/'+_0x42f2ea)[_0x0580('0x17')](_0x25127f);}return null;};}function patchUpdates(_0x2c0030){return function(_0x5b3db9){try{jsonpatch[_0x0580('0x1c')](_0x5b3db9,_0x2c0030,!![]);}catch(_0x252419){return BPromise[_0x0580('0x1d')](_0x252419);}return _0x5b3db9[_0x0580('0x1e')]();};}function saveUpdates(_0x14629c,_0x1a0da3){return function(_0x3e50d3){if(_0x3e50d3){return _0x3e50d3['update'](_0x14629c)[_0x0580('0x1f')](function(_0x3c9415){return _0x3c9415;});}return null;};}function removeEntity(_0xab9d36,_0x31fa1a){return function(_0x23cfa8){if(_0x23cfa8){return _0x23cfa8[_0x0580('0x20')]()[_0x0580('0x1f')](function(){_0xab9d36[_0x0580('0x16')](0xcc)[_0x0580('0x21')]();});}};}function handleEntityNotFound(_0x3ca8cd,_0x26f31f){return function(_0x2f1b31){if(!_0x2f1b31){_0x3ca8cd[_0x0580('0x15')](0x194);}return _0x2f1b31;};}function handleError(_0x4a5bee,_0x58952d){_0x58952d=_0x58952d||0x1f4;return function(_0x137ac6){logger['error'](_0x137ac6[_0x0580('0x22')]);if(_0x137ac6[_0x0580('0x23')]){delete _0x137ac6[_0x0580('0x23')];}_0x4a5bee[_0x0580('0x16')](_0x58952d)[_0x0580('0x24')](_0x137ac6);};}exports[_0x0580('0x25')]=function(_0x31799b,_0x3740c3){var _0x13ce64={},_0x26a5d2={},_0x22a5c2={'count':0x0,'rows':[]};var _0x56cb13=db[_0x0580('0x26')][_0x0580('0x27')];_0x26a5d2['model']=_[_0x0580('0x28')](_0x56cb13);_0x26a5d2[_0x0580('0x29')]=_[_0x0580('0x28')](_0x31799b[_0x0580('0x29')]);_0x26a5d2['filters']=_[_0x0580('0x2a')](_0x26a5d2[_0x0580('0x2b')],_0x26a5d2[_0x0580('0x29')]);_0x13ce64[_0x0580('0x2c')]=_[_0x0580('0x2a')](_0x26a5d2[_0x0580('0x2b')],qs[_0x0580('0x2d')](_0x31799b[_0x0580('0x29')][_0x0580('0x2d')]));_0x13ce64[_0x0580('0x2c')]=_0x13ce64[_0x0580('0x2c')][_0x0580('0x2e')]?_0x13ce64['attributes']:_0x26a5d2['model'];if(!_0x31799b[_0x0580('0x29')][_0x0580('0x2f')](_0x0580('0x30'))){_0x13ce64[_0x0580('0x1a')]=qs[_0x0580('0x1a')](_0x31799b[_0x0580('0x29')][_0x0580('0x1a')]);_0x13ce64[_0x0580('0x19')]=qs[_0x0580('0x19')](_0x31799b['query'][_0x0580('0x19')]);}_0x13ce64[_0x0580('0x31')]=qs[_0x0580('0x32')](_0x31799b[_0x0580('0x29')][_0x0580('0x32')]);_0x13ce64[_0x0580('0x33')]=qs['filters'](_[_0x0580('0x34')](_0x31799b['query'],_0x26a5d2['filters']));if(_0x31799b[_0x0580('0x29')][_0x0580('0x35')]){_0x13ce64[_0x0580('0x33')]=_[_0x0580('0x36')](_0x13ce64[_0x0580('0x33')],{'$or':_[_0x0580('0x37')](_0x56cb13,function(_0x515109){if(_0x515109[_0x0580('0x38')][_0x0580('0x39')]!==_0x0580('0x3a')){var _0x2185ef={};_0x2185ef[_0x515109['field']]={'$like':'%'+_0x31799b[_0x0580('0x29')][_0x0580('0x35')]+'%'};return _0x2185ef;}})});}_0x13ce64=_['merge']({},_0x13ce64,_0x31799b[_0x0580('0x3b')]);var _0x20081e={'where':_0x13ce64[_0x0580('0x33')]};return db['MailServerOut']['count'](_0x20081e)['then'](function(_0x2cc5ad){_0x22a5c2['count']=_0x2cc5ad;if(_0x31799b[_0x0580('0x29')][_0x0580('0x3c')]){_0x13ce64['include']=[{'all':!![]}];}return db['MailServerOut'][_0x0580('0x3d')](_0x13ce64);})[_0x0580('0x1f')](function(_0x523bc4){_0x22a5c2[_0x0580('0x3e')]=_0x523bc4;return _0x22a5c2;})[_0x0580('0x1f')](respondWithFilteredResult(_0x3740c3,_0x13ce64))['catch'](handleError(_0x3740c3,null));};exports[_0x0580('0x3f')]=function(_0x309e61,_0x1d44c6){var _0x28280a={'raw':!![],'where':{'id':_0x309e61[_0x0580('0x40')]['id']}},_0x448983={};_0x448983[_0x0580('0x2b')]=_[_0x0580('0x28')](db[_0x0580('0x26')]['rawAttributes']);_0x448983['query']=_['keys'](_0x309e61[_0x0580('0x29')]);_0x448983['filters']=_[_0x0580('0x2a')](_0x448983[_0x0580('0x2b')],_0x448983[_0x0580('0x29')]);_0x28280a[_0x0580('0x2c')]=_['intersection'](_0x448983[_0x0580('0x2b')],qs[_0x0580('0x2d')](_0x309e61[_0x0580('0x29')][_0x0580('0x2d')]));_0x28280a[_0x0580('0x2c')]=_0x28280a['attributes'][_0x0580('0x2e')]?_0x28280a[_0x0580('0x2c')]:_0x448983[_0x0580('0x2b')];if(_0x309e61[_0x0580('0x29')][_0x0580('0x3c')]){_0x28280a['include']=[{'all':!![]}];}_0x28280a=_[_0x0580('0x36')]({},_0x28280a,_0x309e61[_0x0580('0x3b')]);return db[_0x0580('0x26')][_0x0580('0x41')](_0x28280a)[_0x0580('0x1f')](handleEntityNotFound(_0x1d44c6,null))[_0x0580('0x1f')](respondWithResult(_0x1d44c6,null))['catch'](handleError(_0x1d44c6,null));};exports[_0x0580('0x42')]=function(_0x6f592e,_0x340b2e){return db[_0x0580('0x26')][_0x0580('0x42')](_0x6f592e[_0x0580('0x43')],{})[_0x0580('0x1f')](respondWithResult(_0x340b2e,0xc9))[_0x0580('0x44')](handleError(_0x340b2e,null));};exports['update']=function(_0x51473a,_0x24fb76){if(_0x51473a[_0x0580('0x43')]['id']){delete _0x51473a['body']['id'];}return db[_0x0580('0x26')][_0x0580('0x41')]({'where':{'id':_0x51473a[_0x0580('0x40')]['id']}})['then'](handleEntityNotFound(_0x24fb76,null))[_0x0580('0x1f')](saveUpdates(_0x51473a[_0x0580('0x43')],null))['then'](respondWithResult(_0x24fb76,null))['catch'](handleError(_0x24fb76,null));};exports[_0x0580('0x20')]=function(_0x4e7aec,_0x19a6d8){return db['MailServerOut'][_0x0580('0x41')]({'where':{'id':_0x4e7aec[_0x0580('0x40')]['id']}})[_0x0580('0x1f')](handleEntityNotFound(_0x19a6d8,null))[_0x0580('0x1f')](removeEntity(_0x19a6d8,null))['catch'](handleError(_0x19a6d8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3420bb8..af25152 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 _0x0abf=['define','mail_servers_out','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x2f1d83,_0x2304f0){var _0x497b4c=function(_0x27b0fb){while(--_0x27b0fb){_0x2f1d83['push'](_0x2f1d83['shift']());}};_0x497b4c(++_0x2304f0);}(_0x0abf,0xe8));var _0xf0ab=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0abf[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x2ab7d6,_0x4d2ea8){return _0x2ab7d6[_0xf0ab('0x8')]('MailServerOut',attributes,{'tableName':_0xf0ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34b7=['request-promise','path','./mailServerOut.attributes','exports','define','MailServerOut','../../config/logger','api','moment','bluebird'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x34b7,0x196));var _0x734b=function(_0x501035,_0x3c1742){_0x501035=_0x501035-0x0;var _0x4dd166=_0x34b7[_0x501035];return _0x4dd166;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 68bb585..bf729cf 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 _0x52cf=['../../config/logger','rpc','jayson/promise','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x4a9dd1,_0xfa8de5){var _0x2e761a=function(_0x546de0){while(--_0x546de0){_0x4a9dd1['push'](_0x4a9dd1['shift']());}};_0x2e761a(++_0xfa8de5);}(_0x52cf,0x121));var _0xf52c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x52cf[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf52c('0x0'));var util=require(_0xf52c('0x1'));var moment=require(_0xf52c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf52c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf52c('0x4'));var logger=require(_0xf52c('0x5'))(_0xf52c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf52c('0x7'));var client=jayson['client'][_0xf52c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26a9cc,_0x436a56,_0x57e6c5){return new BPromise(function(_0x57fab5,_0x44a5a6){return client['request'](_0x26a9cc,_0x57e6c5)[_0xf52c('0x9')](function(_0x3290e3){logger[_0xf52c('0xa')](_0xf52c('0xb'),_0x436a56,_0xf52c('0xc'));logger[_0xf52c('0xd')](_0xf52c('0xe'),_0x436a56,'request\x20sent',JSON[_0xf52c('0xf')](_0x3290e3));if(_0x3290e3[_0xf52c('0x10')]){if(_0x3290e3[_0xf52c('0x10')][_0xf52c('0x11')]===0x1f4){logger[_0xf52c('0x10')](_0xf52c('0xb'),_0x436a56,_0x3290e3[_0xf52c('0x10')][_0xf52c('0x12')]);return _0x44a5a6(_0x3290e3[_0xf52c('0x10')][_0xf52c('0x12')]);}logger['error'](_0xf52c('0xb'),_0x436a56,_0x3290e3[_0xf52c('0x10')][_0xf52c('0x12')]);return _0x57fab5(_0x3290e3[_0xf52c('0x10')][_0xf52c('0x12')]);}else{logger[_0xf52c('0xa')](_0xf52c('0xb'),_0x436a56,_0xf52c('0xc'));_0x57fab5(_0x3290e3[_0xf52c('0x13')][_0xf52c('0x12')]);}})[_0xf52c('0x14')](function(_0x21c0c2){logger[_0xf52c('0x10')](_0xf52c('0xb'),_0x436a56,_0x21c0c2);_0x44a5a6(_0x21c0c2);});});} \ No newline at end of file +var _0xddaf=['jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','../../mysqldb','rpc','../../config/environment'];(function(_0x269470,_0x4adad7){var _0x6931f0=function(_0x1bf422){while(--_0x1bf422){_0x269470['push'](_0x269470['shift']());}};_0x6931f0(++_0x4adad7);}(_0xddaf,0x9e));var _0xfdda=function(_0xead820,_0xacbfb){_0xead820=_0xead820-0x0;var _0xfb6a16=_0xddaf[_0xead820];return _0xfb6a16;};'use strict';var _=require('lodash');var util=require(_0xfdda('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdda('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfdda('0x2'));var config=require(_0xfdda('0x3'));var jayson=require(_0xfdda('0x4'));var client=jayson[_0xfdda('0x5')][_0xfdda('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58aaf6,_0x420e27,_0x342af6){return new BPromise(function(_0x41723f,_0x3f41a8){return client[_0xfdda('0x7')](_0x58aaf6,_0x342af6)[_0xfdda('0x8')](function(_0x1915dd){logger[_0xfdda('0x9')](_0xfdda('0xa'),_0x420e27,_0xfdda('0xb'));logger['debug'](_0xfdda('0xc'),_0x420e27,_0xfdda('0xb'),JSON[_0xfdda('0xd')](_0x1915dd));if(_0x1915dd[_0xfdda('0xe')]){if(_0x1915dd[_0xfdda('0xe')][_0xfdda('0xf')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x420e27,_0x1915dd[_0xfdda('0xe')][_0xfdda('0x10')]);return _0x3f41a8(_0x1915dd['error']['message']);}logger[_0xfdda('0xe')](_0xfdda('0xa'),_0x420e27,_0x1915dd[_0xfdda('0xe')]['message']);return _0x41723f(_0x1915dd[_0xfdda('0xe')][_0xfdda('0x10')]);}else{logger['info'](_0xfdda('0xa'),_0x420e27,_0xfdda('0xb'));_0x41723f(_0x1915dd[_0xfdda('0x11')][_0xfdda('0x10')]);}})['catch'](function(_0x286cb){logger[_0xfdda('0xe')]('MailServerOut,\x20%s,\x20%s',_0x420e27,_0x286cb);_0x3f41a8(_0x286cb);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f7532af..231bc63 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 _0x59a7=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0x1cdb2d,_0x8f1f76){var _0x4dafe3=function(_0xec694e){while(--_0xec694e){_0x1cdb2d['push'](_0x1cdb2d['shift']());}};_0x4dafe3(++_0x8f1f76);}(_0x59a7,0x1a7));var _0x759a=function(_0x415250,_0x4ce3f0){_0x415250=_0x415250-0x0;var _0x1ab728=_0x59a7[_0x415250];return _0x1ab728;};'use strict';var multer=require(_0x759a('0x0'));var util=require(_0x759a('0x1'));var path=require(_0x759a('0x2'));var timeout=require(_0x759a('0x3'));var express=require('express');var router=express[_0x759a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x759a('0x5'));var config=require(_0x759a('0x6'));var controller=require(_0x759a('0x7'));router[_0x759a('0x8')]('/',auth[_0x759a('0x9')](),controller[_0x759a('0xa')]);router['get'](_0x759a('0xb'),auth[_0x759a('0x9')](),controller[_0x759a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x759a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x759a('0xe')](_0x759a('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x759a('0x10')](_0x759a('0xf'),auth['isAuthenticated'](),controller[_0x759a('0x11')]);module[_0x759a('0x12')]=router; \ No newline at end of file +var _0x9a13=['describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','/describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9a13,0x1dc));var _0x39a1=function(_0x41830b,_0x1bf81f){_0x41830b=_0x41830b-0x0;var _0x45e9d3=_0x9a13[_0x41830b];return _0x45e9d3;};'use strict';var multer=require(_0x39a1('0x0'));var util=require(_0x39a1('0x1'));var path=require(_0x39a1('0x2'));var timeout=require(_0x39a1('0x3'));var express=require(_0x39a1('0x4'));var router=express['Router']();var auth=require(_0x39a1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39a1('0x6'));router[_0x39a1('0x7')]('/',auth[_0x39a1('0x8')](),controller['index']);router[_0x39a1('0x7')](_0x39a1('0x9'),auth[_0x39a1('0x8')](),controller[_0x39a1('0xa')]);router[_0x39a1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x39a1('0xb')]);router[_0x39a1('0xc')]('/',auth['isAuthenticated'](),controller[_0x39a1('0xd')]);router[_0x39a1('0xe')]('/:id',auth[_0x39a1('0x8')](),controller['update']);router['delete'](_0x39a1('0xf'),auth[_0x39a1('0x8')](),controller[_0x39a1('0x10')]);module[_0x39a1('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c8be7cc..02be196 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 _0xa1b9=['STRING','name','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa1b9,0x71));var _0x9a1b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa1b9[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x9a1b('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a1b('0x1')],'unique':_0x9a1b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9a1b('0x1')]}}; \ No newline at end of file +var _0x6427=['name','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6427,0xbe));var _0x7642=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6427[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require('sequelize');module[_0x7642('0x0')]={'name':{'type':Sequelize[_0x7642('0x1')],'unique':_0x7642('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7642('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 710e882..db27e3f 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 _0xad53=['sendStatus','stack','name','send','index','MailSubstatus','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','count','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','Content-Range','json','reject','save','update','then','destroy'];(function(_0x37fca9,_0x55a5d3){var _0x1581e2=function(_0xdafdd0){while(--_0xdafdd0){_0x37fca9['push'](_0x37fca9['shift']());}};_0x1581e2(++_0x55a5d3);}(_0xad53,0x1ea));var _0x3ad5=function(_0x4c2ec2,_0x225f80){_0x4c2ec2=_0x4c2ec2-0x0;var _0x31bf80=_0xad53[_0x4c2ec2];return _0x31bf80;};'use strict';var pdf=require(_0x3ad5('0x0'));var emlformat=require(_0x3ad5('0x1'));var rimraf=require(_0x3ad5('0x2'));var zipdir=require(_0x3ad5('0x3'));var jsonpatch=require(_0x3ad5('0x4'));var rp=require(_0x3ad5('0x5'));var moment=require(_0x3ad5('0x6'));var BPromise=require(_0x3ad5('0x7'));var Mustache=require('mustache');var util=require(_0x3ad5('0x8'));var path=require(_0x3ad5('0x9'));var sox=require(_0x3ad5('0xa'));var csv=require(_0x3ad5('0xb'));var ejs=require(_0x3ad5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ad5('0xd'));var deskjs=require(_0x3ad5('0xe'));var toCsv=require(_0x3ad5('0xb'));var querystring=require(_0x3ad5('0xf'));var Papa=require(_0x3ad5('0x10'));var Redis=require(_0x3ad5('0x11'));var authService=require(_0x3ad5('0x12'));var qs=require(_0x3ad5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ad5('0x14'))(_0x3ad5('0x15'));var utils=require(_0x3ad5('0x16'));var config=require(_0x3ad5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1b5d,_0x33ac31){_0x33ac31=_0x33ac31||0xcc;return function(_0x1dc68b){if(_0x1dc68b){return _0x4b1b5d['sendStatus'](_0x33ac31);}return _0x4b1b5d[_0x3ad5('0x18')](_0x33ac31)[_0x3ad5('0x19')]();};}function respondWithResult(_0x2d12cf,_0x214a29){_0x214a29=_0x214a29||0xc8;return function(_0x2cfe73){if(_0x2cfe73){return _0x2d12cf[_0x3ad5('0x18')](_0x214a29)['json'](_0x2cfe73);}};}function respondWithFilteredResult(_0x5bdecb,_0x412b7a){return function(_0x278364){if(_0x278364){var _0xabcbc0=_0x278364['count'],_0x70aec9=_0x412b7a['offset'],_0x1d5868=_0x412b7a[_0x3ad5('0x1a')]+_0x412b7a[_0x3ad5('0x1b')],_0x365f38;if(_0x1d5868>=_0xabcbc0){_0x1d5868=_0xabcbc0;_0x365f38=0xc8;}else{_0x365f38=0xce;}_0x5bdecb['status'](_0x365f38);return _0x5bdecb['set'](_0x3ad5('0x1c'),_0x70aec9+'-'+_0x1d5868+'/'+_0xabcbc0)[_0x3ad5('0x1d')](_0x278364);}return null;};}function patchUpdates(_0x179cda){return function(_0x2a5e60){try{jsonpatch['apply'](_0x2a5e60,_0x179cda,!![]);}catch(_0xb97fb9){return BPromise[_0x3ad5('0x1e')](_0xb97fb9);}return _0x2a5e60[_0x3ad5('0x1f')]();};}function saveUpdates(_0xa639,_0x7250f7){return function(_0x1c37c7){if(_0x1c37c7){return _0x1c37c7[_0x3ad5('0x20')](_0xa639)[_0x3ad5('0x21')](function(_0x177760){return _0x177760;});}return null;};}function removeEntity(_0x5721e8,_0x98dfb5){return function(_0x4d00e2){if(_0x4d00e2){return _0x4d00e2[_0x3ad5('0x22')]()['then'](function(){_0x5721e8[_0x3ad5('0x18')](0xcc)[_0x3ad5('0x19')]();});}};}function handleEntityNotFound(_0x1dcde4,_0xeaf8f7){return function(_0x24d2ee){if(!_0x24d2ee){_0x1dcde4[_0x3ad5('0x23')](0x194);}return _0x24d2ee;};}function handleError(_0x4c59dc,_0x437b4c){_0x437b4c=_0x437b4c||0x1f4;return function(_0x1aa2e9){logger['error'](_0x1aa2e9[_0x3ad5('0x24')]);if(_0x1aa2e9[_0x3ad5('0x25')]){delete _0x1aa2e9[_0x3ad5('0x25')];}_0x4c59dc['status'](_0x437b4c)[_0x3ad5('0x26')](_0x1aa2e9);};}exports[_0x3ad5('0x27')]=function(_0x40da5d,_0x4d73b1){var _0x512d41={},_0x578463={},_0x33c53e={'count':0x0,'rows':[]};var _0x4674f2=db[_0x3ad5('0x28')]['rawAttributes'];_0x578463[_0x3ad5('0x29')]=_[_0x3ad5('0x2a')](_0x4674f2);_0x578463['query']=_['keys'](_0x40da5d[_0x3ad5('0x2b')]);_0x578463['filters']=_[_0x3ad5('0x2c')](_0x578463[_0x3ad5('0x29')],_0x578463[_0x3ad5('0x2b')]);_0x512d41[_0x3ad5('0x2d')]=_[_0x3ad5('0x2c')](_0x578463['model'],qs['fields'](_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x2e')]));_0x512d41[_0x3ad5('0x2d')]=_0x512d41[_0x3ad5('0x2d')]['length']?_0x512d41[_0x3ad5('0x2d')]:_0x578463[_0x3ad5('0x29')];if(!_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x2f')](_0x3ad5('0x30'))){_0x512d41[_0x3ad5('0x1b')]=qs[_0x3ad5('0x1b')](_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x1b')]);_0x512d41[_0x3ad5('0x1a')]=qs['offset'](_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x1a')]);}_0x512d41[_0x3ad5('0x31')]=qs[_0x3ad5('0x32')](_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x32')]);_0x512d41[_0x3ad5('0x33')]=qs['filters'](_['pick'](_0x40da5d[_0x3ad5('0x2b')],_0x578463[_0x3ad5('0x34')]));if(_0x40da5d['query'][_0x3ad5('0x35')]){_0x512d41[_0x3ad5('0x33')]=_[_0x3ad5('0x36')](_0x512d41[_0x3ad5('0x33')],{'$or':_[_0x3ad5('0x37')](_0x4674f2,function(_0x6b9dbe){if(_0x6b9dbe[_0x3ad5('0x38')][_0x3ad5('0x39')]!==_0x3ad5('0x3a')){var _0x256c59={};_0x256c59[_0x6b9dbe[_0x3ad5('0x3b')]]={'$like':'%'+_0x40da5d[_0x3ad5('0x2b')][_0x3ad5('0x35')]+'%'};return _0x256c59;}})});}_0x512d41=_['merge']({},_0x512d41,_0x40da5d[_0x3ad5('0x3c')]);var _0x5cf352={'where':_0x512d41[_0x3ad5('0x33')]};return db[_0x3ad5('0x28')][_0x3ad5('0x3d')](_0x5cf352)[_0x3ad5('0x21')](function(_0x1d9393){_0x33c53e[_0x3ad5('0x3d')]=_0x1d9393;if(_0x40da5d[_0x3ad5('0x2b')]['includeAll']){_0x512d41['include']=[{'all':!![]}];}return db[_0x3ad5('0x28')][_0x3ad5('0x3e')](_0x512d41);})[_0x3ad5('0x21')](function(_0x1a9b61){_0x33c53e[_0x3ad5('0x3f')]=_0x1a9b61;return _0x33c53e;})[_0x3ad5('0x21')](respondWithFilteredResult(_0x4d73b1,_0x512d41))[_0x3ad5('0x40')](handleError(_0x4d73b1,null));};exports[_0x3ad5('0x41')]=function(_0x462e00,_0x135fa0){var _0xdece6d={'raw':!![],'where':{'id':_0x462e00[_0x3ad5('0x42')]['id']}},_0x3ea7e5={};_0x3ea7e5[_0x3ad5('0x29')]=_[_0x3ad5('0x2a')](db[_0x3ad5('0x28')][_0x3ad5('0x43')]);_0x3ea7e5[_0x3ad5('0x2b')]=_['keys'](_0x462e00['query']);_0x3ea7e5[_0x3ad5('0x34')]=_[_0x3ad5('0x2c')](_0x3ea7e5['model'],_0x3ea7e5[_0x3ad5('0x2b')]);_0xdece6d['attributes']=_['intersection'](_0x3ea7e5[_0x3ad5('0x29')],qs[_0x3ad5('0x2e')](_0x462e00[_0x3ad5('0x2b')][_0x3ad5('0x2e')]));_0xdece6d[_0x3ad5('0x2d')]=_0xdece6d[_0x3ad5('0x2d')][_0x3ad5('0x44')]?_0xdece6d['attributes']:_0x3ea7e5[_0x3ad5('0x29')];if(_0x462e00[_0x3ad5('0x2b')][_0x3ad5('0x45')]){_0xdece6d[_0x3ad5('0x46')]=[{'all':!![]}];}_0xdece6d=_[_0x3ad5('0x36')]({},_0xdece6d,_0x462e00['options']);return db[_0x3ad5('0x28')][_0x3ad5('0x47')](_0xdece6d)[_0x3ad5('0x21')](handleEntityNotFound(_0x135fa0,null))[_0x3ad5('0x21')](respondWithResult(_0x135fa0,null))['catch'](handleError(_0x135fa0,null));};exports['create']=function(_0x54af98,_0x357877){return db[_0x3ad5('0x28')][_0x3ad5('0x48')](_0x54af98[_0x3ad5('0x49')],{})['then'](respondWithResult(_0x357877,0xc9))['catch'](handleError(_0x357877,null));};exports[_0x3ad5('0x20')]=function(_0x4170d1,_0xf8ffe4){if(_0x4170d1['body']['id']){delete _0x4170d1[_0x3ad5('0x49')]['id'];}return db[_0x3ad5('0x28')]['find']({'where':{'id':_0x4170d1[_0x3ad5('0x42')]['id']}})[_0x3ad5('0x21')](handleEntityNotFound(_0xf8ffe4,null))[_0x3ad5('0x21')](saveUpdates(_0x4170d1['body'],null))['then'](respondWithResult(_0xf8ffe4,null))[_0x3ad5('0x40')](handleError(_0xf8ffe4,null));};exports['destroy']=function(_0x256c1d,_0x5351d9){return db[_0x3ad5('0x28')][_0x3ad5('0x47')]({'where':{'id':_0x256c1d['params']['id']}})[_0x3ad5('0x21')](handleEntityNotFound(_0x5351d9,null))[_0x3ad5('0x21')](removeEntity(_0x5351d9,null))[_0x3ad5('0x40')](handleError(_0x5351d9,null));};exports['describe']=function(_0x4871cd,_0x2e0af){return db[_0x3ad5('0x28')][_0x3ad5('0x4a')]()[_0x3ad5('0x21')](respondWithResult(_0x2e0af,null))[_0x3ad5('0x40')](handleError(_0x2e0af,null));}; \ No newline at end of file +var _0x425d=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','index','MailSubstatus','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','map','key','VIRTUAL','field','filter','merge'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x425d,0x1e0));var _0xd425=function(_0x254085,_0x42a67a){_0x254085=_0x254085-0x0;var _0x274248=_0x425d[_0x254085];return _0x274248;};'use strict';var pdf=require(_0xd425('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd425('0x1'));var zipdir=require(_0xd425('0x2'));var jsonpatch=require(_0xd425('0x3'));var rp=require(_0xd425('0x4'));var moment=require(_0xd425('0x5'));var BPromise=require(_0xd425('0x6'));var Mustache=require(_0xd425('0x7'));var util=require('util');var path=require(_0xd425('0x8'));var sox=require(_0xd425('0x9'));var csv=require(_0xd425('0xa'));var ejs=require(_0xd425('0xb'));var fs=require('fs');var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0xa'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var hardwareService=require(_0xd425('0x15'));var logger=require(_0xd425('0x16'))(_0xd425('0x17'));var utils=require(_0xd425('0x18'));var config=require(_0xd425('0x19'));var db=require(_0xd425('0x1a'))['db'];function respondWithStatusCode(_0x179742,_0x2385a5){_0x2385a5=_0x2385a5||0xcc;return function(_0x9bb611){if(_0x9bb611){return _0x179742[_0xd425('0x1b')](_0x2385a5);}return _0x179742[_0xd425('0x1c')](_0x2385a5)[_0xd425('0x1d')]();};}function respondWithResult(_0x51263f,_0x27318c){_0x27318c=_0x27318c||0xc8;return function(_0x17a498){if(_0x17a498){return _0x51263f[_0xd425('0x1c')](_0x27318c)['json'](_0x17a498);}};}function respondWithFilteredResult(_0x309263,_0x2e2e4e){return function(_0x643fd2){if(_0x643fd2){var _0x41f34d=_0x643fd2[_0xd425('0x1e')],_0x1fc822=_0x2e2e4e[_0xd425('0x1f')],_0x538a0a=_0x2e2e4e[_0xd425('0x1f')]+_0x2e2e4e['limit'],_0x278626;if(_0x538a0a>=_0x41f34d){_0x538a0a=_0x41f34d;_0x278626=0xc8;}else{_0x278626=0xce;}_0x309263[_0xd425('0x1c')](_0x278626);return _0x309263[_0xd425('0x20')](_0xd425('0x21'),_0x1fc822+'-'+_0x538a0a+'/'+_0x41f34d)[_0xd425('0x22')](_0x643fd2);}return null;};}function patchUpdates(_0x4e88fa){return function(_0x58a0c1){try{jsonpatch['apply'](_0x58a0c1,_0x4e88fa,!![]);}catch(_0x4b293a){return BPromise[_0xd425('0x23')](_0x4b293a);}return _0x58a0c1[_0xd425('0x24')]();};}function saveUpdates(_0x3c98db,_0x5e797a){return function(_0x355af0){if(_0x355af0){return _0x355af0[_0xd425('0x25')](_0x3c98db)['then'](function(_0x2e1ec4){return _0x2e1ec4;});}return null;};}function removeEntity(_0xf2d0ce,_0x249a2b){return function(_0x1d3fc0){if(_0x1d3fc0){return _0x1d3fc0[_0xd425('0x26')]()[_0xd425('0x27')](function(){_0xf2d0ce[_0xd425('0x1c')](0xcc)[_0xd425('0x1d')]();});}};}function handleEntityNotFound(_0x314201,_0x2b030b){return function(_0x151ad9){if(!_0x151ad9){_0x314201[_0xd425('0x1b')](0x194);}return _0x151ad9;};}function handleError(_0x47f44a,_0x369b5b){_0x369b5b=_0x369b5b||0x1f4;return function(_0x264b0e){logger[_0xd425('0x28')](_0x264b0e[_0xd425('0x29')]);if(_0x264b0e[_0xd425('0x2a')]){delete _0x264b0e[_0xd425('0x2a')];}_0x47f44a[_0xd425('0x1c')](_0x369b5b)['send'](_0x264b0e);};}exports[_0xd425('0x2b')]=function(_0x177de2,_0x1d8861){var _0x57c950={},_0x27ef8a={},_0x3ad9bd={'count':0x0,'rows':[]};var _0x433189=db[_0xd425('0x2c')][_0xd425('0x2d')];_0x27ef8a[_0xd425('0x2e')]=_[_0xd425('0x2f')](_0x433189);_0x27ef8a[_0xd425('0x30')]=_[_0xd425('0x2f')](_0x177de2[_0xd425('0x30')]);_0x27ef8a['filters']=_[_0xd425('0x31')](_0x27ef8a[_0xd425('0x2e')],_0x27ef8a[_0xd425('0x30')]);_0x57c950[_0xd425('0x32')]=_[_0xd425('0x31')](_0x27ef8a[_0xd425('0x2e')],qs[_0xd425('0x33')](_0x177de2[_0xd425('0x30')][_0xd425('0x33')]));_0x57c950[_0xd425('0x32')]=_0x57c950[_0xd425('0x32')]['length']?_0x57c950[_0xd425('0x32')]:_0x27ef8a[_0xd425('0x2e')];if(!_0x177de2[_0xd425('0x30')][_0xd425('0x34')](_0xd425('0x35'))){_0x57c950['limit']=qs[_0xd425('0x36')](_0x177de2[_0xd425('0x30')]['limit']);_0x57c950['offset']=qs['offset'](_0x177de2[_0xd425('0x30')][_0xd425('0x1f')]);}_0x57c950[_0xd425('0x37')]=qs[_0xd425('0x38')](_0x177de2['query'][_0xd425('0x38')]);_0x57c950[_0xd425('0x39')]=qs[_0xd425('0x3a')](_[_0xd425('0x3b')](_0x177de2[_0xd425('0x30')],_0x27ef8a[_0xd425('0x3a')]));if(_0x177de2[_0xd425('0x30')]['filter']){_0x57c950[_0xd425('0x39')]=_['merge'](_0x57c950[_0xd425('0x39')],{'$or':_[_0xd425('0x3c')](_0x433189,function(_0x36c8da){if(_0x36c8da['type'][_0xd425('0x3d')]!==_0xd425('0x3e')){var _0xbbb05f={};_0xbbb05f[_0x36c8da[_0xd425('0x3f')]]={'$like':'%'+_0x177de2['query'][_0xd425('0x40')]+'%'};return _0xbbb05f;}})});}_0x57c950=_[_0xd425('0x41')]({},_0x57c950,_0x177de2['options']);var _0x5d310e={'where':_0x57c950['where']};return db[_0xd425('0x2c')][_0xd425('0x1e')](_0x5d310e)[_0xd425('0x27')](function(_0x588688){_0x3ad9bd['count']=_0x588688;if(_0x177de2['query'][_0xd425('0x42')]){_0x57c950[_0xd425('0x43')]=[{'all':!![]}];}return db[_0xd425('0x2c')][_0xd425('0x44')](_0x57c950);})[_0xd425('0x27')](function(_0x14f3be){_0x3ad9bd[_0xd425('0x45')]=_0x14f3be;return _0x3ad9bd;})['then'](respondWithFilteredResult(_0x1d8861,_0x57c950))[_0xd425('0x46')](handleError(_0x1d8861,null));};exports[_0xd425('0x47')]=function(_0x1d82ec,_0x552fd0){var _0x3adc67={'raw':!![],'where':{'id':_0x1d82ec[_0xd425('0x48')]['id']}},_0x2dffc7={};_0x2dffc7['model']=_[_0xd425('0x2f')](db[_0xd425('0x2c')][_0xd425('0x2d')]);_0x2dffc7[_0xd425('0x30')]=_['keys'](_0x1d82ec[_0xd425('0x30')]);_0x2dffc7[_0xd425('0x3a')]=_[_0xd425('0x31')](_0x2dffc7[_0xd425('0x2e')],_0x2dffc7[_0xd425('0x30')]);_0x3adc67[_0xd425('0x32')]=_[_0xd425('0x31')](_0x2dffc7['model'],qs[_0xd425('0x33')](_0x1d82ec[_0xd425('0x30')]['fields']));_0x3adc67[_0xd425('0x32')]=_0x3adc67['attributes']['length']?_0x3adc67[_0xd425('0x32')]:_0x2dffc7['model'];if(_0x1d82ec[_0xd425('0x30')]['includeAll']){_0x3adc67[_0xd425('0x43')]=[{'all':!![]}];}_0x3adc67=_[_0xd425('0x41')]({},_0x3adc67,_0x1d82ec[_0xd425('0x49')]);return db[_0xd425('0x2c')][_0xd425('0x4a')](_0x3adc67)['then'](handleEntityNotFound(_0x552fd0,null))[_0xd425('0x27')](respondWithResult(_0x552fd0,null))['catch'](handleError(_0x552fd0,null));};exports[_0xd425('0x4b')]=function(_0x55a15d,_0x78ed9b){return db[_0xd425('0x2c')][_0xd425('0x4b')](_0x55a15d[_0xd425('0x4c')],{})[_0xd425('0x27')](respondWithResult(_0x78ed9b,0xc9))['catch'](handleError(_0x78ed9b,null));};exports[_0xd425('0x25')]=function(_0x433777,_0x35e77b){if(_0x433777[_0xd425('0x4c')]['id']){delete _0x433777[_0xd425('0x4c')]['id'];}return db['MailSubstatus'][_0xd425('0x4a')]({'where':{'id':_0x433777[_0xd425('0x48')]['id']}})[_0xd425('0x27')](handleEntityNotFound(_0x35e77b,null))[_0xd425('0x27')](saveUpdates(_0x433777[_0xd425('0x4c')],null))[_0xd425('0x27')](respondWithResult(_0x35e77b,null))['catch'](handleError(_0x35e77b,null));};exports[_0xd425('0x26')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x2c')][_0xd425('0x4a')]({'where':{'id':_0x128cb3[_0xd425('0x48')]['id']}})[_0xd425('0x27')](handleEntityNotFound(_0x5bfac6,null))['then'](removeEntity(_0x5bfac6,null))[_0xd425('0x46')](handleError(_0x5bfac6,null));};exports[_0xd425('0x4d')]=function(_0x4552cd,_0x22e91d){return db[_0xd425('0x2c')]['describe']()['then'](respondWithResult(_0x22e91d,null))[_0xd425('0x46')](handleError(_0x22e91d,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5c78661..c93d386 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 _0xdc39=['../../config/environment','exports','define','MailSubstatus','mail_substatuses','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x50c241,_0x26690b){var _0x5f4943=function(_0x4f8871){while(--_0x4f8871){_0x50c241['push'](_0x50c241['shift']());}};_0x5f4943(++_0x26690b);}(_0xdc39,0xc3));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9dc3('0x0'))(_0x9dc3('0x1'));var moment=require('moment');var BPromise=require(_0x9dc3('0x2'));var rp=require(_0x9dc3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dc3('0x4'));var config=require(_0x9dc3('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0x9dc3('0x6')]=function(_0x5305f0,_0x1586d2){return _0x5305f0[_0x9dc3('0x7')](_0x9dc3('0x8'),attributes,{'tableName':_0x9dc3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18a5=['rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5ea60d,_0xf1b6f3){var _0x1d14eb=function(_0x5a348d){while(--_0x5a348d){_0x5ea60d['push'](_0x5ea60d['shift']());}};_0x1d14eb(++_0xf1b6f3);}(_0x18a5,0x70));var _0x518a=function(_0x10f8bb,_0x1b3503){_0x10f8bb=_0x10f8bb-0x0;var _0xb850c8=_0x18a5[_0x10f8bb];return _0xb850c8;};'use strict';var _=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var logger=require(_0x518a('0x2'))(_0x518a('0x3'));var moment=require(_0x518a('0x4'));var BPromise=require(_0x518a('0x5'));var rp=require(_0x518a('0x6'));var fs=require('fs');var path=require(_0x518a('0x7'));var rimraf=require(_0x518a('0x8'));var config=require(_0x518a('0x9'));var attributes=require(_0x518a('0xa'));module[_0x518a('0xb')]=function(_0x321e42,_0x125a40){return _0x321e42[_0x518a('0xc')](_0x518a('0xd'),attributes,{'tableName':_0x518a('0xe'),'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 9e01060..2fdd18d 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 _0x4def=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client'];(function(_0x498bab,_0x32eb74){var _0x180190=function(_0x5d93d2){while(--_0x5d93d2){_0x498bab['push'](_0x498bab['shift']());}};_0x180190(++_0x32eb74);}(_0x4def,0x196));var _0xf4de=function(_0x3360f3,_0x344f01){_0x3360f3=_0x3360f3-0x0;var _0x45e856=_0x4def[_0x3360f3];return _0x45e856;};'use strict';var _=require(_0xf4de('0x0'));var util=require(_0xf4de('0x1'));var moment=require(_0xf4de('0x2'));var BPromise=require(_0xf4de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf4de('0x4'));var config=require(_0xf4de('0x5'));var jayson=require(_0xf4de('0x6'));var client=jayson[_0xf4de('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3488fb,_0x3c8151,_0x2edcf9){return new BPromise(function(_0x86a5db,_0x988bdf){return client['request'](_0x3488fb,_0x2edcf9)[_0xf4de('0x8')](function(_0x23c093){logger[_0xf4de('0x9')](_0xf4de('0xa'),_0x3c8151,_0xf4de('0xb'));logger[_0xf4de('0xc')](_0xf4de('0xd'),_0x3c8151,_0xf4de('0xb'),JSON['stringify'](_0x23c093));if(_0x23c093['error']){if(_0x23c093[_0xf4de('0xe')]['code']===0x1f4){logger[_0xf4de('0xe')](_0xf4de('0xa'),_0x3c8151,_0x23c093[_0xf4de('0xe')][_0xf4de('0xf')]);return _0x988bdf(_0x23c093[_0xf4de('0xe')][_0xf4de('0xf')]);}logger['error'](_0xf4de('0xa'),_0x3c8151,_0x23c093[_0xf4de('0xe')][_0xf4de('0xf')]);return _0x86a5db(_0x23c093[_0xf4de('0xe')][_0xf4de('0xf')]);}else{logger[_0xf4de('0x9')](_0xf4de('0xa'),_0x3c8151,_0xf4de('0xb'));_0x86a5db(_0x23c093[_0xf4de('0x10')]['message']);}})[_0xf4de('0x11')](function(_0x229d68){logger[_0xf4de('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x3c8151,_0x229d68);_0x988bdf(_0x229d68);});});} \ No newline at end of file +var _0xca3c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x43c804,_0x3b83a4){var _0x4d284b=function(_0x505049){while(--_0x505049){_0x43c804['push'](_0x43c804['shift']());}};_0x4d284b(++_0x3b83a4);}(_0xca3c,0x93));var _0xcca3=function(_0x252239,_0x4736d2){_0x252239=_0x252239-0x0;var _0x4da4f1=_0xca3c[_0x252239];return _0x4da4f1;};'use strict';var _=require(_0xcca3('0x0'));var util=require(_0xcca3('0x1'));var moment=require(_0xcca3('0x2'));var BPromise=require(_0xcca3('0x3'));var rs=require(_0xcca3('0x4'));var fs=require('fs');var Redis=require(_0xcca3('0x5'));var db=require(_0xcca3('0x6'))['db'];var utils=require(_0xcca3('0x7'));var logger=require(_0xcca3('0x8'))(_0xcca3('0x9'));var config=require(_0xcca3('0xa'));var jayson=require(_0xcca3('0xb'));var client=jayson['client'][_0xcca3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ab855,_0x54ee46,_0x35988e){return new BPromise(function(_0x3392fc,_0x4b77a9){return client[_0xcca3('0xd')](_0x1ab855,_0x35988e)[_0xcca3('0xe')](function(_0x27c29f){logger[_0xcca3('0xf')](_0xcca3('0x10'),_0x54ee46,_0xcca3('0x11'));logger[_0xcca3('0x12')](_0xcca3('0x13'),_0x54ee46,'request\x20sent',JSON['stringify'](_0x27c29f));if(_0x27c29f[_0xcca3('0x14')]){if(_0x27c29f['error'][_0xcca3('0x15')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x54ee46,_0x27c29f[_0xcca3('0x14')][_0xcca3('0x16')]);return _0x4b77a9(_0x27c29f[_0xcca3('0x14')]['message']);}logger['error'](_0xcca3('0x10'),_0x54ee46,_0x27c29f[_0xcca3('0x14')][_0xcca3('0x16')]);return _0x3392fc(_0x27c29f[_0xcca3('0x14')]['message']);}else{logger[_0xcca3('0xf')](_0xcca3('0x10'),_0x54ee46,_0xcca3('0x11'));_0x3392fc(_0x27c29f[_0xcca3('0x17')][_0xcca3('0x16')]);}})[_0xcca3('0x18')](function(_0x2dc7bb){logger[_0xcca3('0x14')](_0xcca3('0x10'),_0x54ee46,_0x2dc7bb);_0x4b77a9(_0x2dc7bb);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index c6e049b..6915baa 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 _0xeff8=['index','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0xeff8,0x186));var _0x8eff=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xeff8[_0x3b96cf];return _0x2e315a;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));var controller=require(_0x8eff('0x7'));router[_0x8eff('0x8')]('/',auth['isAuthenticated'](),controller[_0x8eff('0x9')]);router[_0x8eff('0x8')](_0x8eff('0xa'),auth[_0x8eff('0xb')](),controller['describe']);router[_0x8eff('0x8')](_0x8eff('0xc'),auth[_0x8eff('0xb')](),controller[_0x8eff('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8eff('0xe')]);router[_0x8eff('0xf')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0x10')]);router[_0x8eff('0x11')]('/:id',auth[_0x8eff('0xb')](),controller[_0x8eff('0x12')]);module['exports']=router; \ No newline at end of file +var _0x90b5=['/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','describe'];(function(_0x280907,_0x55df23){var _0x11c872=function(_0x37b5f6){while(--_0x37b5f6){_0x280907['push'](_0x280907['shift']());}};_0x11c872(++_0x55df23);}(_0x90b5,0x139));var _0x590b=function(_0x36a04d,_0x42e2d4){_0x36a04d=_0x36a04d-0x0;var _0x743c52=_0x90b5[_0x36a04d];return _0x743c52;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x590b('0x5'));var controller=require(_0x590b('0x6'));router['get']('/',auth[_0x590b('0x7')](),controller[_0x590b('0x8')]);router[_0x590b('0x9')]('/describe',auth[_0x590b('0x7')](),controller[_0x590b('0xa')]);router[_0x590b('0x9')](_0x590b('0xb'),auth[_0x590b('0x7')](),controller[_0x590b('0xc')]);router[_0x590b('0xd')]('/',auth[_0x590b('0x7')](),controller[_0x590b('0xe')]);router['put'](_0x590b('0xb'),auth[_0x590b('0x7')](),controller['update']);router[_0x590b('0xf')]('/:id',auth[_0x590b('0x7')](),controller[_0x590b('0x10')]);module[_0x590b('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 c81f90e..2aace02 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 _0x7462=['moment','sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW'];(function(_0x36a4bc,_0x3939a5){var _0x2d55fc=function(_0x798e32){while(--_0x798e32){_0x36a4bc['push'](_0x36a4bc['shift']());}};_0x2d55fc(++_0x3939a5);}(_0x7462,0x195));var _0x2746=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x7462[_0x5471ec];return _0x121d4c;};'use strict';var moment=require(_0x2746('0x0'));var Sequelize=require(_0x2746('0x1'));module[_0x2746('0x2')]={'uniqueid':{'type':Sequelize[_0x2746('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2746('0x4')]('account',_0x2746('0x5'),'queue'),'allowNull':![],'defaultValue':_0x2746('0x6')},'transferredAt':{'type':Sequelize[_0x2746('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x2746('0x8')]}}; \ No newline at end of file +var _0xac9f=['queue','moment','sequelize','exports','STRING','ENUM'];(function(_0x1f70b6,_0x3706ca){var _0x4b93f8=function(_0x7ccaad){while(--_0x7ccaad){_0x1f70b6['push'](_0x1f70b6['shift']());}};_0x4b93f8(++_0x3706ca);}(_0xac9f,0x1f3));var _0xfac9=function(_0x65583c,_0x2e14e7){_0x65583c=_0x65583c-0x0;var _0x255d5e=_0xac9f[_0x65583c];return _0x255d5e;};'use strict';var moment=require(_0xfac9('0x0'));var Sequelize=require(_0xfac9('0x1'));module[_0xfac9('0x2')]={'uniqueid':{'type':Sequelize[_0xfac9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xfac9('0x4')]('account','agent','queue'),'allowNull':![],'defaultValue':_0xfac9('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 7e22f5d..f138ee1 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 _0xf50e=['length','model','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','field','options','includeAll','rows','catch','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','status','sendStatus','error','stack','name','send','index','MailTransferReport','keys','query','filters','intersection','attributes','fields'];(function(_0xc77218,_0x10cd88){var _0x21a6fe=function(_0x1e809a){while(--_0x1e809a){_0xc77218['push'](_0xc77218['shift']());}};_0x21a6fe(++_0x10cd88);}(_0xf50e,0x1f1));var _0xef50=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0xf50e[_0x3b150c];return _0x5cd414;};'use strict';var pdf=require(_0xef50('0x0'));var emlformat=require(_0xef50('0x1'));var rimraf=require(_0xef50('0x2'));var zipdir=require(_0xef50('0x3'));var jsonpatch=require(_0xef50('0x4'));var rp=require(_0xef50('0x5'));var moment=require('moment');var BPromise=require(_0xef50('0x6'));var Mustache=require(_0xef50('0x7'));var util=require(_0xef50('0x8'));var path=require(_0xef50('0x9'));var sox=require(_0xef50('0xa'));var csv=require('to-csv');var ejs=require(_0xef50('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xef50('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xef50('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef50('0xe'));var Redis=require(_0xef50('0xf'));var authService=require(_0xef50('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xef50('0x11'));var logger=require(_0xef50('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xef50('0x13'));var db=require(_0xef50('0x14'))['db'];function respondWithStatusCode(_0x4b77ad,_0x55faec){_0x55faec=_0x55faec||0xcc;return function(_0xabc1d8){if(_0xabc1d8){return _0x4b77ad['sendStatus'](_0x55faec);}return _0x4b77ad['status'](_0x55faec)[_0xef50('0x15')]();};}function respondWithResult(_0x59805d,_0x58cb9d){_0x58cb9d=_0x58cb9d||0xc8;return function(_0x31c758){if(_0x31c758){return _0x59805d['status'](_0x58cb9d)[_0xef50('0x16')](_0x31c758);}};}function respondWithFilteredResult(_0x2bd1e4,_0x384b00){return function(_0x3757d8){if(_0x3757d8){var _0x8c7024=_0x3757d8[_0xef50('0x17')],_0x149dd7=_0x384b00[_0xef50('0x18')],_0x47d372=_0x384b00[_0xef50('0x18')]+_0x384b00[_0xef50('0x19')],_0x56aa4c;if(_0x47d372>=_0x8c7024){_0x47d372=_0x8c7024;_0x56aa4c=0xc8;}else{_0x56aa4c=0xce;}_0x2bd1e4['status'](_0x56aa4c);return _0x2bd1e4[_0xef50('0x1a')](_0xef50('0x1b'),_0x149dd7+'-'+_0x47d372+'/'+_0x8c7024)[_0xef50('0x16')](_0x3757d8);}return null;};}function patchUpdates(_0x2957e0){return function(_0x32cbe4){try{jsonpatch[_0xef50('0x1c')](_0x32cbe4,_0x2957e0,!![]);}catch(_0x3d89a6){return BPromise[_0xef50('0x1d')](_0x3d89a6);}return _0x32cbe4['save']();};}function saveUpdates(_0x47447a,_0x342a9d){return function(_0x132643){if(_0x132643){return _0x132643[_0xef50('0x1e')](_0x47447a)[_0xef50('0x1f')](function(_0x552e5c){return _0x552e5c;});}return null;};}function removeEntity(_0x40e544,_0x2cf8ea){return function(_0x5e0bff){if(_0x5e0bff){return _0x5e0bff[_0xef50('0x20')]()[_0xef50('0x1f')](function(){_0x40e544[_0xef50('0x21')](0xcc)[_0xef50('0x15')]();});}};}function handleEntityNotFound(_0x1b475f,_0x440d05){return function(_0x1a630c){if(!_0x1a630c){_0x1b475f[_0xef50('0x22')](0x194);}return _0x1a630c;};}function handleError(_0x3595df,_0x117919){_0x117919=_0x117919||0x1f4;return function(_0x20a865){logger[_0xef50('0x23')](_0x20a865[_0xef50('0x24')]);if(_0x20a865[_0xef50('0x25')]){delete _0x20a865[_0xef50('0x25')];}_0x3595df[_0xef50('0x21')](_0x117919)[_0xef50('0x26')](_0x20a865);};}exports[_0xef50('0x27')]=function(_0x226616,_0x197313){var _0x69ec41={},_0x222fc2={},_0x3049c9={'count':0x0,'rows':[]};var _0x302fb2=db[_0xef50('0x28')]['rawAttributes'];_0x222fc2['model']=_[_0xef50('0x29')](_0x302fb2);_0x222fc2[_0xef50('0x2a')]=_[_0xef50('0x29')](_0x226616['query']);_0x222fc2[_0xef50('0x2b')]=_[_0xef50('0x2c')](_0x222fc2['model'],_0x222fc2['query']);_0x69ec41[_0xef50('0x2d')]=_[_0xef50('0x2c')](_0x222fc2['model'],qs[_0xef50('0x2e')](_0x226616[_0xef50('0x2a')][_0xef50('0x2e')]));_0x69ec41['attributes']=_0x69ec41[_0xef50('0x2d')][_0xef50('0x2f')]?_0x69ec41[_0xef50('0x2d')]:_0x222fc2[_0xef50('0x30')];if(!_0x226616[_0xef50('0x2a')][_0xef50('0x31')](_0xef50('0x32'))){_0x69ec41['limit']=qs[_0xef50('0x19')](_0x226616[_0xef50('0x2a')][_0xef50('0x19')]);_0x69ec41[_0xef50('0x18')]=qs[_0xef50('0x18')](_0x226616[_0xef50('0x2a')][_0xef50('0x18')]);}_0x69ec41['order']=qs[_0xef50('0x33')](_0x226616[_0xef50('0x2a')][_0xef50('0x33')]);_0x69ec41[_0xef50('0x34')]=qs[_0xef50('0x2b')](_[_0xef50('0x35')](_0x226616[_0xef50('0x2a')],_0x222fc2[_0xef50('0x2b')]));if(_0x226616['query']['filter']){_0x69ec41[_0xef50('0x34')]=_[_0xef50('0x36')](_0x69ec41['where'],{'$or':_['map'](_0x302fb2,function(_0x35e6ae){if(_0x35e6ae[_0xef50('0x37')]['key']!==_0xef50('0x38')){var _0x5e9cde={};_0x5e9cde[_0x35e6ae[_0xef50('0x39')]]={'$like':'%'+_0x226616['query']['filter']+'%'};return _0x5e9cde;}})});}_0x69ec41=_[_0xef50('0x36')]({},_0x69ec41,_0x226616[_0xef50('0x3a')]);var _0x2b7cde={'where':_0x69ec41[_0xef50('0x34')]};return db['MailTransferReport'][_0xef50('0x17')](_0x2b7cde)['then'](function(_0x41f9ba){_0x3049c9[_0xef50('0x17')]=_0x41f9ba;if(_0x226616[_0xef50('0x2a')][_0xef50('0x3b')]){_0x69ec41['include']=[{'all':!![]}];}return db[_0xef50('0x28')]['findAll'](_0x69ec41);})[_0xef50('0x1f')](function(_0x56d66b){_0x3049c9[_0xef50('0x3c')]=_0x56d66b;return _0x3049c9;})[_0xef50('0x1f')](respondWithFilteredResult(_0x197313,_0x69ec41))[_0xef50('0x3d')](handleError(_0x197313,null));};exports['show']=function(_0x3ed648,_0x4da119){var _0x40b182={'raw':!![],'where':{'id':_0x3ed648[_0xef50('0x3e')]['id']}},_0x40d42f={};_0x40d42f[_0xef50('0x30')]=_[_0xef50('0x29')](db[_0xef50('0x28')][_0xef50('0x3f')]);_0x40d42f[_0xef50('0x2a')]=_[_0xef50('0x29')](_0x3ed648[_0xef50('0x2a')]);_0x40d42f[_0xef50('0x2b')]=_[_0xef50('0x2c')](_0x40d42f[_0xef50('0x30')],_0x40d42f[_0xef50('0x2a')]);_0x40b182[_0xef50('0x2d')]=_['intersection'](_0x40d42f['model'],qs[_0xef50('0x2e')](_0x3ed648['query'][_0xef50('0x2e')]));_0x40b182[_0xef50('0x2d')]=_0x40b182[_0xef50('0x2d')][_0xef50('0x2f')]?_0x40b182[_0xef50('0x2d')]:_0x40d42f['model'];if(_0x3ed648[_0xef50('0x2a')][_0xef50('0x3b')]){_0x40b182['include']=[{'all':!![]}];}_0x40b182=_[_0xef50('0x36')]({},_0x40b182,_0x3ed648[_0xef50('0x3a')]);return db[_0xef50('0x28')][_0xef50('0x40')](_0x40b182)[_0xef50('0x1f')](handleEntityNotFound(_0x4da119,null))['then'](respondWithResult(_0x4da119,null))['catch'](handleError(_0x4da119,null));};exports['create']=function(_0x1dc179,_0x5c9942){return db[_0xef50('0x28')][_0xef50('0x41')](_0x1dc179['body'],{})[_0xef50('0x1f')](respondWithResult(_0x5c9942,0xc9))[_0xef50('0x3d')](handleError(_0x5c9942,null));};exports['update']=function(_0x1bcddb,_0x4aac8a){if(_0x1bcddb[_0xef50('0x42')]['id']){delete _0x1bcddb[_0xef50('0x42')]['id'];}return db[_0xef50('0x28')][_0xef50('0x40')]({'where':{'id':_0x1bcddb[_0xef50('0x3e')]['id']}})[_0xef50('0x1f')](handleEntityNotFound(_0x4aac8a,null))[_0xef50('0x1f')](saveUpdates(_0x1bcddb[_0xef50('0x42')],null))['then'](respondWithResult(_0x4aac8a,null))[_0xef50('0x3d')](handleError(_0x4aac8a,null));};exports[_0xef50('0x20')]=function(_0x40ba91,_0xc127e1){return db[_0xef50('0x28')][_0xef50('0x40')]({'where':{'id':_0x40ba91[_0xef50('0x3e')]['id']}})[_0xef50('0x1f')](handleEntityNotFound(_0xc127e1,null))[_0xef50('0x1f')](removeEntity(_0xc127e1,null))[_0xef50('0x3d')](handleError(_0xc127e1,null));};exports['describe']=function(_0xc07c20,_0x2762cf){return db[_0xef50('0x28')][_0xef50('0x43')]()[_0xef50('0x1f')](respondWithResult(_0x2762cf,null))[_0xef50('0x3d')](handleError(_0x2762cf,null));}; \ No newline at end of file +var _0x0eb8=['status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0x0eb8,0x1e1));var _0x80eb=function(_0x46f106,_0x27c910){_0x46f106=_0x46f106-0x0;var _0x54f542=_0x0eb8[_0x46f106];return _0x54f542;};'use strict';var pdf=require(_0x80eb('0x0'));var emlformat=require(_0x80eb('0x1'));var rimraf=require(_0x80eb('0x2'));var zipdir=require(_0x80eb('0x3'));var jsonpatch=require(_0x80eb('0x4'));var rp=require(_0x80eb('0x5'));var moment=require('moment');var BPromise=require(_0x80eb('0x6'));var Mustache=require(_0x80eb('0x7'));var util=require(_0x80eb('0x8'));var path=require(_0x80eb('0x9'));var sox=require(_0x80eb('0xa'));var csv=require(_0x80eb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x80eb('0xc'));var crypto=require(_0x80eb('0xd'));var jsforce=require(_0x80eb('0xe'));var deskjs=require(_0x80eb('0xf'));var toCsv=require(_0x80eb('0xb'));var querystring=require(_0x80eb('0x10'));var Papa=require(_0x80eb('0x11'));var Redis=require(_0x80eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x80eb('0x13'));var hardwareService=require(_0x80eb('0x14'));var logger=require('../../config/logger')(_0x80eb('0x15'));var utils=require('../../config/utils');var config=require(_0x80eb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4de214,_0x318015){_0x318015=_0x318015||0xcc;return function(_0x5775f8){if(_0x5775f8){return _0x4de214['sendStatus'](_0x318015);}return _0x4de214[_0x80eb('0x17')](_0x318015)[_0x80eb('0x18')]();};}function respondWithResult(_0x54f4a1,_0x4e141e){_0x4e141e=_0x4e141e||0xc8;return function(_0x18eac1){if(_0x18eac1){return _0x54f4a1[_0x80eb('0x17')](_0x4e141e)['json'](_0x18eac1);}};}function respondWithFilteredResult(_0x1bf9d3,_0x47535c){return function(_0x2e87da){if(_0x2e87da){var _0x82c818=_0x2e87da[_0x80eb('0x19')],_0x38789b=_0x47535c['offset'],_0x3366a7=_0x47535c[_0x80eb('0x1a')]+_0x47535c[_0x80eb('0x1b')],_0x88391b;if(_0x3366a7>=_0x82c818){_0x3366a7=_0x82c818;_0x88391b=0xc8;}else{_0x88391b=0xce;}_0x1bf9d3[_0x80eb('0x17')](_0x88391b);return _0x1bf9d3[_0x80eb('0x1c')](_0x80eb('0x1d'),_0x38789b+'-'+_0x3366a7+'/'+_0x82c818)['json'](_0x2e87da);}return null;};}function patchUpdates(_0x42b943){return function(_0x451d10){try{jsonpatch[_0x80eb('0x1e')](_0x451d10,_0x42b943,!![]);}catch(_0x2d5ed2){return BPromise[_0x80eb('0x1f')](_0x2d5ed2);}return _0x451d10[_0x80eb('0x20')]();};}function saveUpdates(_0x4d3d07,_0xf127e0){return function(_0x158e6d){if(_0x158e6d){return _0x158e6d['update'](_0x4d3d07)[_0x80eb('0x21')](function(_0x3a1144){return _0x3a1144;});}return null;};}function removeEntity(_0x35e391,_0x18631f){return function(_0x1d8907){if(_0x1d8907){return _0x1d8907[_0x80eb('0x22')]()[_0x80eb('0x21')](function(){_0x35e391[_0x80eb('0x17')](0xcc)[_0x80eb('0x18')]();});}};}function handleEntityNotFound(_0x412db4,_0x1bf31a){return function(_0x5c1f0d){if(!_0x5c1f0d){_0x412db4['sendStatus'](0x194);}return _0x5c1f0d;};}function handleError(_0x22f2b3,_0x548353){_0x548353=_0x548353||0x1f4;return function(_0x3b1d2e){logger[_0x80eb('0x23')](_0x3b1d2e[_0x80eb('0x24')]);if(_0x3b1d2e['name']){delete _0x3b1d2e[_0x80eb('0x25')];}_0x22f2b3[_0x80eb('0x17')](_0x548353)[_0x80eb('0x26')](_0x3b1d2e);};}exports[_0x80eb('0x27')]=function(_0x259fe9,_0x2577e2){var _0x102d28={},_0x2d591d={},_0x3f20e1={'count':0x0,'rows':[]};var _0x2953da=db[_0x80eb('0x28')][_0x80eb('0x29')];_0x2d591d[_0x80eb('0x2a')]=_[_0x80eb('0x2b')](_0x2953da);_0x2d591d[_0x80eb('0x2c')]=_[_0x80eb('0x2b')](_0x259fe9[_0x80eb('0x2c')]);_0x2d591d['filters']=_[_0x80eb('0x2d')](_0x2d591d[_0x80eb('0x2a')],_0x2d591d['query']);_0x102d28[_0x80eb('0x2e')]=_['intersection'](_0x2d591d[_0x80eb('0x2a')],qs['fields'](_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x2f')]));_0x102d28[_0x80eb('0x2e')]=_0x102d28['attributes'][_0x80eb('0x30')]?_0x102d28['attributes']:_0x2d591d[_0x80eb('0x2a')];if(!_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x31')](_0x80eb('0x32'))){_0x102d28['limit']=qs[_0x80eb('0x1b')](_0x259fe9[_0x80eb('0x2c')]['limit']);_0x102d28[_0x80eb('0x1a')]=qs[_0x80eb('0x1a')](_0x259fe9['query'][_0x80eb('0x1a')]);}_0x102d28['order']=qs[_0x80eb('0x33')](_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x33')]);_0x102d28[_0x80eb('0x34')]=qs[_0x80eb('0x35')](_[_0x80eb('0x36')](_0x259fe9[_0x80eb('0x2c')],_0x2d591d[_0x80eb('0x35')]));if(_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x37')]){_0x102d28[_0x80eb('0x34')]=_[_0x80eb('0x38')](_0x102d28[_0x80eb('0x34')],{'$or':_[_0x80eb('0x39')](_0x2953da,function(_0x2e11a1){if(_0x2e11a1[_0x80eb('0x3a')]['key']!==_0x80eb('0x3b')){var _0x2cab07={};_0x2cab07[_0x2e11a1['field']]={'$like':'%'+_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x37')]+'%'};return _0x2cab07;}})});}_0x102d28=_['merge']({},_0x102d28,_0x259fe9[_0x80eb('0x3c')]);var _0x5ef92e={'where':_0x102d28[_0x80eb('0x34')]};return db[_0x80eb('0x28')][_0x80eb('0x19')](_0x5ef92e)[_0x80eb('0x21')](function(_0x2401b3){_0x3f20e1[_0x80eb('0x19')]=_0x2401b3;if(_0x259fe9[_0x80eb('0x2c')][_0x80eb('0x3d')]){_0x102d28[_0x80eb('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x80eb('0x3f')](_0x102d28);})['then'](function(_0x4a5e46){_0x3f20e1[_0x80eb('0x40')]=_0x4a5e46;return _0x3f20e1;})[_0x80eb('0x21')](respondWithFilteredResult(_0x2577e2,_0x102d28))[_0x80eb('0x41')](handleError(_0x2577e2,null));};exports[_0x80eb('0x42')]=function(_0x1f8106,_0x16e4ea){var _0x3c45e6={'raw':!![],'where':{'id':_0x1f8106['params']['id']}},_0x17e7c8={};_0x17e7c8[_0x80eb('0x2a')]=_[_0x80eb('0x2b')](db[_0x80eb('0x28')][_0x80eb('0x29')]);_0x17e7c8[_0x80eb('0x2c')]=_['keys'](_0x1f8106[_0x80eb('0x2c')]);_0x17e7c8[_0x80eb('0x35')]=_['intersection'](_0x17e7c8[_0x80eb('0x2a')],_0x17e7c8[_0x80eb('0x2c')]);_0x3c45e6[_0x80eb('0x2e')]=_[_0x80eb('0x2d')](_0x17e7c8[_0x80eb('0x2a')],qs[_0x80eb('0x2f')](_0x1f8106[_0x80eb('0x2c')][_0x80eb('0x2f')]));_0x3c45e6[_0x80eb('0x2e')]=_0x3c45e6[_0x80eb('0x2e')][_0x80eb('0x30')]?_0x3c45e6[_0x80eb('0x2e')]:_0x17e7c8['model'];if(_0x1f8106['query'][_0x80eb('0x3d')]){_0x3c45e6[_0x80eb('0x3e')]=[{'all':!![]}];}_0x3c45e6=_['merge']({},_0x3c45e6,_0x1f8106[_0x80eb('0x3c')]);return db['MailTransferReport'][_0x80eb('0x43')](_0x3c45e6)[_0x80eb('0x21')](handleEntityNotFound(_0x16e4ea,null))[_0x80eb('0x21')](respondWithResult(_0x16e4ea,null))['catch'](handleError(_0x16e4ea,null));};exports[_0x80eb('0x44')]=function(_0x7e578c,_0x52aff5){return db[_0x80eb('0x28')][_0x80eb('0x44')](_0x7e578c['body'],{})[_0x80eb('0x21')](respondWithResult(_0x52aff5,0xc9))[_0x80eb('0x41')](handleError(_0x52aff5,null));};exports[_0x80eb('0x45')]=function(_0x55d0f8,_0x48f76e){if(_0x55d0f8['body']['id']){delete _0x55d0f8['body']['id'];}return db[_0x80eb('0x28')]['find']({'where':{'id':_0x55d0f8[_0x80eb('0x46')]['id']}})[_0x80eb('0x21')](handleEntityNotFound(_0x48f76e,null))[_0x80eb('0x21')](saveUpdates(_0x55d0f8['body'],null))[_0x80eb('0x21')](respondWithResult(_0x48f76e,null))[_0x80eb('0x41')](handleError(_0x48f76e,null));};exports[_0x80eb('0x22')]=function(_0x4072fa,_0x367360){return db[_0x80eb('0x28')][_0x80eb('0x43')]({'where':{'id':_0x4072fa['params']['id']}})['then'](handleEntityNotFound(_0x367360,null))['then'](removeEntity(_0x367360,null))[_0x80eb('0x41')](handleError(_0x367360,null));};exports[_0x80eb('0x47')]=function(_0x55555b,_0x227d31){return db[_0x80eb('0x28')][_0x80eb('0x47')]()[_0x80eb('0x21')](respondWithResult(_0x227d31,null))[_0x80eb('0x41')](handleError(_0x227d31,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index aa693a0..7420d4b 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 _0x71ab=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','api','bluebird','request-promise'];(function(_0x528c84,_0x57d55a){var _0x1520b8=function(_0x58bc6f){while(--_0x58bc6f){_0x528c84['push'](_0x528c84['shift']());}};_0x1520b8(++_0x57d55a);}(_0x71ab,0x64));var _0xb71a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71ab[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['report_mail_transfer','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x038b,0x114));var _0xb038=function(_0x3d250e,_0x36bffd){_0x3d250e=_0x3d250e-0x0;var _0x4485d1=_0x038b[_0x3d250e];return _0x4485d1;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','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 56b5df8..14cc84c 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 _0xeba7=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xeba7,0x1b5));var _0x7eba=function(_0x11059b,_0x409007){_0x11059b=_0x11059b-0x0;var _0x2ebd2d=_0xeba7[_0x11059b];return _0x2ebd2d;};'use strict';var _=require(_0x7eba('0x0'));var util=require('util');var moment=require(_0x7eba('0x1'));var BPromise=require(_0x7eba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eba('0x3'));var db=require(_0x7eba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7eba('0x5'))(_0x7eba('0x6'));var config=require(_0x7eba('0x7'));var jayson=require(_0x7eba('0x8'));var client=jayson[_0x7eba('0x9')][_0x7eba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5114a2,_0xd9eea3,_0x6f060c){return new BPromise(function(_0x33cc11,_0x21d381){return client[_0x7eba('0xb')](_0x5114a2,_0x6f060c)['then'](function(_0x31e380){logger['info'](_0x7eba('0xc'),_0xd9eea3,_0x7eba('0xd'));logger[_0x7eba('0xe')](_0x7eba('0xf'),_0xd9eea3,_0x7eba('0xd'),JSON[_0x7eba('0x10')](_0x31e380));if(_0x31e380[_0x7eba('0x11')]){if(_0x31e380[_0x7eba('0x11')][_0x7eba('0x12')]===0x1f4){logger[_0x7eba('0x11')]('MailTransferReport,\x20%s,\x20%s',_0xd9eea3,_0x31e380[_0x7eba('0x11')][_0x7eba('0x13')]);return _0x21d381(_0x31e380[_0x7eba('0x11')]['message']);}logger['error'](_0x7eba('0xc'),_0xd9eea3,_0x31e380[_0x7eba('0x11')]['message']);return _0x33cc11(_0x31e380[_0x7eba('0x11')][_0x7eba('0x13')]);}else{logger[_0x7eba('0x14')](_0x7eba('0xc'),_0xd9eea3,_0x7eba('0xd'));_0x33cc11(_0x31e380[_0x7eba('0x15')]['message']);}})[_0x7eba('0x16')](function(_0xeff344){logger['error'](_0x7eba('0xc'),_0xd9eea3,_0xeff344);_0x21d381(_0xeff344);});});} \ No newline at end of file +var _0x8233=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0xf1b4cb,_0x530076){var _0x555f8d=function(_0x4acb4f){while(--_0x4acb4f){_0xf1b4cb['push'](_0xf1b4cb['shift']());}};_0x555f8d(++_0x530076);}(_0x8233,0x1eb));var _0x3823=function(_0x3699d3,_0x4bf5f2){_0x3699d3=_0x3699d3-0x0;var _0x2f8ef0=_0x8233[_0x3699d3];return _0x2f8ef0;};'use strict';var _=require(_0x3823('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3823('0x1'));var rs=require(_0x3823('0x2'));var fs=require('fs');var Redis=require(_0x3823('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3823('0x4'));var logger=require(_0x3823('0x5'))(_0x3823('0x6'));var config=require(_0x3823('0x7'));var jayson=require(_0x3823('0x8'));var client=jayson['client'][_0x3823('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139662,_0x3cc117,_0x4a0207){return new BPromise(function(_0x489895,_0x5ab2cd){return client[_0x3823('0xa')](_0x139662,_0x4a0207)[_0x3823('0xb')](function(_0x3818db){logger[_0x3823('0xc')](_0x3823('0xd'),_0x3cc117,_0x3823('0xe'));logger[_0x3823('0xf')](_0x3823('0x10'),_0x3cc117,_0x3823('0xe'),JSON['stringify'](_0x3818db));if(_0x3818db[_0x3823('0x11')]){if(_0x3818db[_0x3823('0x11')]['code']===0x1f4){logger[_0x3823('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x3cc117,_0x3818db[_0x3823('0x11')]['message']);return _0x5ab2cd(_0x3818db[_0x3823('0x11')][_0x3823('0x12')]);}logger['error'](_0x3823('0xd'),_0x3cc117,_0x3818db['error'][_0x3823('0x12')]);return _0x489895(_0x3818db[_0x3823('0x11')]['message']);}else{logger[_0x3823('0xc')](_0x3823('0xd'),_0x3cc117,_0x3823('0xe'));_0x489895(_0x3818db[_0x3823('0x13')]['message']);}})[_0x3823('0x14')](function(_0x5b623c){logger[_0x3823('0x11')](_0x3823('0xd'),_0x3cc117,_0x5b623c);_0x5ab2cd(_0x5b623c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 62f3ea0..c9f7641 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 _0x1b92=['post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xee1c5c,_0x161ec5){var _0xe1919a=function(_0x13e116){while(--_0x13e116){_0xee1c5c['push'](_0xee1c5c['shift']());}};_0xe1919a(++_0x161ec5);}(_0x1b92,0x68));var _0x21b9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1b92[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x21b9('0x0'));var util=require(_0x21b9('0x1'));var path=require(_0x21b9('0x2'));var timeout=require(_0x21b9('0x3'));var express=require(_0x21b9('0x4'));var router=express[_0x21b9('0x5')]();var auth=require(_0x21b9('0x6'));var interaction=require(_0x21b9('0x7'));var config=require(_0x21b9('0x8'));var controller=require(_0x21b9('0x9'));router[_0x21b9('0xa')]('/',auth[_0x21b9('0xb')](),controller[_0x21b9('0xc')]);router[_0x21b9('0xa')](_0x21b9('0xd'),auth[_0x21b9('0xb')](),controller[_0x21b9('0xe')]);router['get'](_0x21b9('0xf'),auth[_0x21b9('0xb')](),controller['show']);router[_0x21b9('0x10')]('/',auth[_0x21b9('0xb')](),controller[_0x21b9('0x11')]);router['put'](_0x21b9('0xf'),auth[_0x21b9('0xb')](),controller[_0x21b9('0x12')]);router[_0x21b9('0x13')](_0x21b9('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x698e=['Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x698e,0x18b));var _0xe698=function(_0x1e3784,_0x25a93e){_0x1e3784=_0x1e3784-0x0;var _0x45899b=_0x698e[_0x1e3784];return _0x45899b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe698('0x0'));var express=require('express');var router=express[_0xe698('0x1')]();var auth=require(_0xe698('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe698('0x3'));var controller=require(_0xe698('0x4'));router[_0xe698('0x5')]('/',auth['isAuthenticated'](),controller[_0xe698('0x6')]);router[_0xe698('0x5')]('/describe',auth[_0xe698('0x7')](),controller[_0xe698('0x8')]);router[_0xe698('0x5')](_0xe698('0x9'),auth[_0xe698('0x7')](),controller[_0xe698('0xa')]);router[_0xe698('0xb')]('/',auth[_0xe698('0x7')](),controller[_0xe698('0xc')]);router[_0xe698('0xd')](_0xe698('0x9'),auth[_0xe698('0x7')](),controller[_0xe698('0xe')]);router[_0xe698('0xf')](_0xe698('0x9'),auth[_0xe698('0x7')](),controller[_0xe698('0x10')]);module[_0xe698('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 56edd0b..98f75ba 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 _0x42f2=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','diff','seconds','setDataValue','exitAt','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x486ed3,_0x404640){var _0x25fd39=function(_0x2b15c1){while(--_0x2b15c1){_0x486ed3['push'](_0x486ed3['shift']());}};_0x25fd39(++_0x404640);}(_0x42f2,0xfa));var _0x242f=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0x42f2[_0x3239f5];return _0x3559c8;};'use strict';var Sequelize=require(_0x242f('0x0'));var moment=require(_0x242f('0x1'));module['exports']={'channel':{'type':Sequelize[_0x242f('0x2')]},'membername':{'type':Sequelize[_0x242f('0x2')]},'interface':{'type':Sequelize[_0x242f('0x2')]},'type':{'type':Sequelize[_0x242f('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x242f('0x3')},'duration':{'type':Sequelize[_0x242f('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x12668e){var _0x176057=moment(_0x12668e);var _0x44ee9e=moment(this[_0x242f('0x5')]('enterAt'));var _0x2ee648=_0x176057[_0x242f('0x6')](_0x44ee9e,_0x242f('0x7'));this[_0x242f('0x8')](_0x242f('0x9'),_0x12668e);this[_0x242f('0x8')]('duration',_0x2ee648||null);}},'data1':{'type':Sequelize[_0x242f('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x242f('0x2')],'comment':_0x242f('0xa')},'data3':{'type':Sequelize[_0x242f('0x2')],'comment':_0x242f('0xb')},'data4':{'type':Sequelize[_0x242f('0x2')],'comment':_0x242f('0xc')},'data5':{'type':Sequelize[_0x242f('0x2')],'comment':_0x242f('0xd')},'role':{'type':Sequelize[_0x242f('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x242f('0x2')]}}; \ No newline at end of file +var _0x1ce5=['sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1ce5,0xcc));var _0x51ce=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x1ce5[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require(_0x51ce('0x0'));var moment=require(_0x51ce('0x1'));module['exports']={'channel':{'type':Sequelize[_0x51ce('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x51ce('0x2')],'defaultValue':_0x51ce('0x3'),'comment':_0x51ce('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x51ce('0x5')],'set':function(_0x5e4f25){var _0x52c317=moment(_0x5e4f25);var _0x255709=moment(this[_0x51ce('0x6')]('enterAt'));var _0x29f9d1=_0x52c317[_0x51ce('0x7')](_0x255709,_0x51ce('0x8'));this['setDataValue'](_0x51ce('0x9'),_0x5e4f25);this[_0x51ce('0xa')](_0x51ce('0xb'),_0x29f9d1||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x51ce('0xc')},'data2':{'type':Sequelize[_0x51ce('0x2')],'comment':_0x51ce('0xd')},'data3':{'type':Sequelize[_0x51ce('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x51ce('0xe')},'data5':{'type':Sequelize[_0x51ce('0x2')],'comment':_0x51ce('0xf')},'role':{'type':Sequelize[_0x51ce('0x2')]},'internal':{'type':Sequelize[_0x51ce('0x10')]},'uniqueid':{'type':Sequelize[_0x51ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 6fdd3b0..b1d0810 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 _0x2c8f=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','stack','name','send','index','MemberReport','rawAttributes','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include','catch','params','keys','includeAll','find','create','body','destroy','describe','eml-format','request-promise','moment','bluebird','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c8f,0x192));var _0xf2c8=function(_0xa536b9,_0x5dec5b){_0xa536b9=_0xa536b9-0x0;var _0x5cb56e=_0x2c8f[_0xa536b9];return _0x5cb56e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf2c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2c8('0x1'));var moment=require(_0xf2c8('0x2'));var BPromise=require(_0xf2c8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf2c8('0x4'));var sox=require(_0xf2c8('0x5'));var csv=require(_0xf2c8('0x6'));var ejs=require(_0xf2c8('0x7'));var fs=require('fs');var _=require(_0xf2c8('0x8'));var squel=require('squel');var crypto=require(_0xf2c8('0x9'));var jsforce=require(_0xf2c8('0xa'));var deskjs=require(_0xf2c8('0xb'));var toCsv=require(_0xf2c8('0x6'));var querystring=require(_0xf2c8('0xc'));var Papa=require(_0xf2c8('0xd'));var Redis=require('ioredis');var authService=require(_0xf2c8('0xe'));var qs=require(_0xf2c8('0xf'));var hardwareService=require(_0xf2c8('0x10'));var logger=require(_0xf2c8('0x11'))(_0xf2c8('0x12'));var utils=require(_0xf2c8('0x13'));var config=require(_0xf2c8('0x14'));var db=require(_0xf2c8('0x15'))['db'];function respondWithStatusCode(_0x514dd1,_0xd90704){_0xd90704=_0xd90704||0xcc;return function(_0x5ce572){if(_0x5ce572){return _0x514dd1[_0xf2c8('0x16')](_0xd90704);}return _0x514dd1[_0xf2c8('0x17')](_0xd90704)[_0xf2c8('0x18')]();};}function respondWithResult(_0x46d0c6,_0x37db9b){_0x37db9b=_0x37db9b||0xc8;return function(_0x40849c){if(_0x40849c){return _0x46d0c6['status'](_0x37db9b)[_0xf2c8('0x19')](_0x40849c);}};}function respondWithFilteredResult(_0x165f5f,_0x9152f1){return function(_0x34f9b1){if(_0x34f9b1){var _0x3ed09e=_0x34f9b1[_0xf2c8('0x1a')],_0x383af2=_0x9152f1[_0xf2c8('0x1b')],_0x1b8c5b=_0x9152f1[_0xf2c8('0x1b')]+_0x9152f1[_0xf2c8('0x1c')],_0x5f37ba;if(_0x1b8c5b>=_0x3ed09e){_0x1b8c5b=_0x3ed09e;_0x5f37ba=0xc8;}else{_0x5f37ba=0xce;}_0x165f5f[_0xf2c8('0x17')](_0x5f37ba);return _0x165f5f['set']('Content-Range',_0x383af2+'-'+_0x1b8c5b+'/'+_0x3ed09e)[_0xf2c8('0x19')](_0x34f9b1);}return null;};}function patchUpdates(_0x290953){return function(_0x2c6d7a){try{jsonpatch[_0xf2c8('0x1d')](_0x2c6d7a,_0x290953,!![]);}catch(_0x516d99){return BPromise[_0xf2c8('0x1e')](_0x516d99);}return _0x2c6d7a[_0xf2c8('0x1f')]();};}function saveUpdates(_0x197435,_0x47b5e4){return function(_0x4442f9){if(_0x4442f9){return _0x4442f9[_0xf2c8('0x20')](_0x197435)['then'](function(_0x5b1e44){return _0x5b1e44;});}return null;};}function removeEntity(_0x43505f,_0x3e7ceb){return function(_0x98f9cb){if(_0x98f9cb){return _0x98f9cb['destroy']()[_0xf2c8('0x21')](function(){_0x43505f[_0xf2c8('0x17')](0xcc)[_0xf2c8('0x18')]();});}};}function handleEntityNotFound(_0x239350,_0x4ba1e0){return function(_0x17956f){if(!_0x17956f){_0x239350[_0xf2c8('0x16')](0x194);}return _0x17956f;};}function handleError(_0x20e994,_0x440b41){_0x440b41=_0x440b41||0x1f4;return function(_0x16938e){logger['error'](_0x16938e[_0xf2c8('0x22')]);if(_0x16938e['name']){delete _0x16938e[_0xf2c8('0x23')];}_0x20e994[_0xf2c8('0x17')](_0x440b41)[_0xf2c8('0x24')](_0x16938e);};}exports[_0xf2c8('0x25')]=function(_0x1d2e74,_0x3160a5){var _0x3ffd20={},_0x132343={},_0x33f1b0={'count':0x0,'rows':[]};var _0xcf5239=db[_0xf2c8('0x26')][_0xf2c8('0x27')];_0x132343[_0xf2c8('0x28')]=_['keys'](_0xcf5239);_0x132343[_0xf2c8('0x29')]=_['keys'](_0x1d2e74['query']);_0x132343[_0xf2c8('0x2a')]=_['intersection'](_0x132343[_0xf2c8('0x28')],_0x132343[_0xf2c8('0x29')]);_0x3ffd20[_0xf2c8('0x2b')]=_[_0xf2c8('0x2c')](_0x132343[_0xf2c8('0x28')],qs[_0xf2c8('0x2d')](_0x1d2e74[_0xf2c8('0x29')]['fields']));_0x3ffd20[_0xf2c8('0x2b')]=_0x3ffd20[_0xf2c8('0x2b')][_0xf2c8('0x2e')]?_0x3ffd20[_0xf2c8('0x2b')]:_0x132343[_0xf2c8('0x28')];if(!_0x1d2e74[_0xf2c8('0x29')]['hasOwnProperty'](_0xf2c8('0x2f'))){_0x3ffd20['limit']=qs[_0xf2c8('0x1c')](_0x1d2e74['query'][_0xf2c8('0x1c')]);_0x3ffd20[_0xf2c8('0x1b')]=qs[_0xf2c8('0x1b')](_0x1d2e74[_0xf2c8('0x29')][_0xf2c8('0x1b')]);}_0x3ffd20['order']=qs[_0xf2c8('0x30')](_0x1d2e74[_0xf2c8('0x29')]['sort']);_0x3ffd20[_0xf2c8('0x31')]=qs[_0xf2c8('0x2a')](_['pick'](_0x1d2e74[_0xf2c8('0x29')],_0x132343[_0xf2c8('0x2a')]));if(_0x1d2e74[_0xf2c8('0x29')][_0xf2c8('0x32')]){_0x3ffd20[_0xf2c8('0x31')]=_['merge'](_0x3ffd20['where'],{'$or':_[_0xf2c8('0x33')](_0xcf5239,function(_0x301567){if(_0x301567[_0xf2c8('0x34')][_0xf2c8('0x35')]!==_0xf2c8('0x36')){var _0x3a807e={};_0x3a807e[_0x301567[_0xf2c8('0x37')]]={'$like':'%'+_0x1d2e74[_0xf2c8('0x29')]['filter']+'%'};return _0x3a807e;}})});}_0x3ffd20=_[_0xf2c8('0x38')]({},_0x3ffd20,_0x1d2e74[_0xf2c8('0x39')]);var _0x2a673a={'where':_0x3ffd20['where']};return db['MemberReport']['count'](_0x2a673a)['then'](function(_0x3af100){_0x33f1b0['count']=_0x3af100;if(_0x1d2e74[_0xf2c8('0x29')]['includeAll']){_0x3ffd20[_0xf2c8('0x3a')]=[{'all':!![]}];}return db['MemberReport']['findAll'](_0x3ffd20);})[_0xf2c8('0x21')](function(_0x523f92){_0x33f1b0['rows']=_0x523f92;return _0x33f1b0;})[_0xf2c8('0x21')](respondWithFilteredResult(_0x3160a5,_0x3ffd20))[_0xf2c8('0x3b')](handleError(_0x3160a5,null));};exports['show']=function(_0x1f4115,_0x13afbd){var _0xc31337={'raw':!![],'where':{'id':_0x1f4115[_0xf2c8('0x3c')]['id']}},_0x30b9bc={};_0x30b9bc[_0xf2c8('0x28')]=_['keys'](db['MemberReport'][_0xf2c8('0x27')]);_0x30b9bc['query']=_[_0xf2c8('0x3d')](_0x1f4115['query']);_0x30b9bc[_0xf2c8('0x2a')]=_['intersection'](_0x30b9bc[_0xf2c8('0x28')],_0x30b9bc[_0xf2c8('0x29')]);_0xc31337[_0xf2c8('0x2b')]=_[_0xf2c8('0x2c')](_0x30b9bc['model'],qs[_0xf2c8('0x2d')](_0x1f4115[_0xf2c8('0x29')]['fields']));_0xc31337[_0xf2c8('0x2b')]=_0xc31337[_0xf2c8('0x2b')][_0xf2c8('0x2e')]?_0xc31337[_0xf2c8('0x2b')]:_0x30b9bc[_0xf2c8('0x28')];if(_0x1f4115[_0xf2c8('0x29')][_0xf2c8('0x3e')]){_0xc31337['include']=[{'all':!![]}];}_0xc31337=_[_0xf2c8('0x38')]({},_0xc31337,_0x1f4115[_0xf2c8('0x39')]);return db[_0xf2c8('0x26')][_0xf2c8('0x3f')](_0xc31337)['then'](handleEntityNotFound(_0x13afbd,null))['then'](respondWithResult(_0x13afbd,null))[_0xf2c8('0x3b')](handleError(_0x13afbd,null));};exports[_0xf2c8('0x40')]=function(_0x3203c3,_0x520029){return db[_0xf2c8('0x26')][_0xf2c8('0x40')](_0x3203c3['body'],{})['then'](respondWithResult(_0x520029,0xc9))[_0xf2c8('0x3b')](handleError(_0x520029,null));};exports[_0xf2c8('0x20')]=function(_0x3725a3,_0x371d14){if(_0x3725a3['body']['id']){delete _0x3725a3[_0xf2c8('0x41')]['id'];}return db[_0xf2c8('0x26')][_0xf2c8('0x3f')]({'where':{'id':_0x3725a3['params']['id']}})[_0xf2c8('0x21')](handleEntityNotFound(_0x371d14,null))[_0xf2c8('0x21')](saveUpdates(_0x3725a3[_0xf2c8('0x41')],null))['then'](respondWithResult(_0x371d14,null))[_0xf2c8('0x3b')](handleError(_0x371d14,null));};exports[_0xf2c8('0x42')]=function(_0x24d4a2,_0x3d90f5){return db[_0xf2c8('0x26')]['find']({'where':{'id':_0x24d4a2[_0xf2c8('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3d90f5,null))['then'](removeEntity(_0x3d90f5,null))[_0xf2c8('0x3b')](handleError(_0x3d90f5,null));};exports[_0xf2c8('0x43')]=function(_0xcd5dfd,_0x184d95){return db[_0xf2c8('0x26')]['describe']()[_0xf2c8('0x21')](respondWithResult(_0x184d95,null))[_0xf2c8('0x3b')](handleError(_0x184d95,null));}; \ No newline at end of file +var _0x0309=['create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','MemberReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','includeAll','include','rows','catch','show','params','options','find'];(function(_0xdc047c,_0x332142){var _0x539fdf=function(_0x44b6dc){while(--_0x44b6dc){_0xdc047c['push'](_0xdc047c['shift']());}};_0x539fdf(++_0x332142);}(_0x0309,0x165));var _0x9030=function(_0x326319,_0x738211){_0x326319=_0x326319-0x0;var _0x17d2c7=_0x0309[_0x326319];return _0x17d2c7;};'use strict';var pdf=require(_0x9030('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9030('0x2'));var rp=require(_0x9030('0x3'));var moment=require(_0x9030('0x4'));var BPromise=require(_0x9030('0x5'));var Mustache=require(_0x9030('0x6'));var util=require(_0x9030('0x7'));var path=require(_0x9030('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9030('0x9'));var fs=require('fs');var _=require(_0x9030('0xa'));var squel=require('squel');var crypto=require(_0x9030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9030('0xc'));var toCsv=require(_0x9030('0xd'));var querystring=require(_0x9030('0xe'));var Papa=require('papaparse');var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9030('0x12'))(_0x9030('0x13'));var utils=require(_0x9030('0x14'));var config=require(_0x9030('0x15'));var db=require(_0x9030('0x16'))['db'];function respondWithStatusCode(_0x1209d5,_0xa45a23){_0xa45a23=_0xa45a23||0xcc;return function(_0x5ee60f){if(_0x5ee60f){return _0x1209d5[_0x9030('0x17')](_0xa45a23);}return _0x1209d5[_0x9030('0x18')](_0xa45a23)[_0x9030('0x19')]();};}function respondWithResult(_0x45ec2a,_0x4e1858){_0x4e1858=_0x4e1858||0xc8;return function(_0x28a505){if(_0x28a505){return _0x45ec2a[_0x9030('0x18')](_0x4e1858)[_0x9030('0x1a')](_0x28a505);}};}function respondWithFilteredResult(_0x41e659,_0x4d697a){return function(_0x1615ab){if(_0x1615ab){var _0x111f3b=_0x1615ab[_0x9030('0x1b')],_0x1776e6=_0x4d697a[_0x9030('0x1c')],_0xfc6f46=_0x4d697a[_0x9030('0x1c')]+_0x4d697a[_0x9030('0x1d')],_0x55ac94;if(_0xfc6f46>=_0x111f3b){_0xfc6f46=_0x111f3b;_0x55ac94=0xc8;}else{_0x55ac94=0xce;}_0x41e659[_0x9030('0x18')](_0x55ac94);return _0x41e659[_0x9030('0x1e')](_0x9030('0x1f'),_0x1776e6+'-'+_0xfc6f46+'/'+_0x111f3b)[_0x9030('0x1a')](_0x1615ab);}return null;};}function patchUpdates(_0x1f5474){return function(_0x31e196){try{jsonpatch[_0x9030('0x20')](_0x31e196,_0x1f5474,!![]);}catch(_0x41d506){return BPromise[_0x9030('0x21')](_0x41d506);}return _0x31e196[_0x9030('0x22')]();};}function saveUpdates(_0x1e5988,_0x285d93){return function(_0x4105ec){if(_0x4105ec){return _0x4105ec['update'](_0x1e5988)['then'](function(_0x364d58){return _0x364d58;});}return null;};}function removeEntity(_0x65cf05,_0x5e1253){return function(_0x80098d){if(_0x80098d){return _0x80098d[_0x9030('0x23')]()[_0x9030('0x24')](function(){_0x65cf05[_0x9030('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4753b2,_0x51aca8){return function(_0x4c8d4a){if(!_0x4c8d4a){_0x4753b2[_0x9030('0x17')](0x194);}return _0x4c8d4a;};}function handleError(_0x2b205c,_0xcea904){_0xcea904=_0xcea904||0x1f4;return function(_0x539bb7){logger[_0x9030('0x25')](_0x539bb7[_0x9030('0x26')]);if(_0x539bb7[_0x9030('0x27')]){delete _0x539bb7[_0x9030('0x27')];}_0x2b205c[_0x9030('0x18')](_0xcea904)['send'](_0x539bb7);};}exports[_0x9030('0x28')]=function(_0x455eeb,_0x1ff4ef){var _0x463dda={},_0x42d1ba={},_0x3e00dd={'count':0x0,'rows':[]};var _0x155b8c=db[_0x9030('0x29')][_0x9030('0x2a')];_0x42d1ba[_0x9030('0x2b')]=_[_0x9030('0x2c')](_0x155b8c);_0x42d1ba[_0x9030('0x2d')]=_[_0x9030('0x2c')](_0x455eeb[_0x9030('0x2d')]);_0x42d1ba['filters']=_[_0x9030('0x2e')](_0x42d1ba['model'],_0x42d1ba[_0x9030('0x2d')]);_0x463dda['attributes']=_[_0x9030('0x2e')](_0x42d1ba[_0x9030('0x2b')],qs[_0x9030('0x2f')](_0x455eeb['query'][_0x9030('0x2f')]));_0x463dda[_0x9030('0x30')]=_0x463dda[_0x9030('0x30')][_0x9030('0x31')]?_0x463dda[_0x9030('0x30')]:_0x42d1ba[_0x9030('0x2b')];if(!_0x455eeb[_0x9030('0x2d')][_0x9030('0x32')](_0x9030('0x33'))){_0x463dda[_0x9030('0x1d')]=qs[_0x9030('0x1d')](_0x455eeb[_0x9030('0x2d')][_0x9030('0x1d')]);_0x463dda[_0x9030('0x1c')]=qs[_0x9030('0x1c')](_0x455eeb[_0x9030('0x2d')][_0x9030('0x1c')]);}_0x463dda[_0x9030('0x34')]=qs['sort'](_0x455eeb['query'][_0x9030('0x35')]);_0x463dda[_0x9030('0x36')]=qs['filters'](_['pick'](_0x455eeb[_0x9030('0x2d')],_0x42d1ba[_0x9030('0x37')]));if(_0x455eeb[_0x9030('0x2d')][_0x9030('0x38')]){_0x463dda['where']=_[_0x9030('0x39')](_0x463dda['where'],{'$or':_[_0x9030('0x3a')](_0x155b8c,function(_0x9fcce9){if(_0x9fcce9['type'][_0x9030('0x3b')]!==_0x9030('0x3c')){var _0x4572e1={};_0x4572e1[_0x9fcce9['field']]={'$like':'%'+_0x455eeb[_0x9030('0x2d')]['filter']+'%'};return _0x4572e1;}})});}_0x463dda=_[_0x9030('0x39')]({},_0x463dda,_0x455eeb['options']);var _0x3c1797={'where':_0x463dda['where']};return db[_0x9030('0x29')][_0x9030('0x1b')](_0x3c1797)[_0x9030('0x24')](function(_0x277d02){_0x3e00dd[_0x9030('0x1b')]=_0x277d02;if(_0x455eeb[_0x9030('0x2d')][_0x9030('0x3d')]){_0x463dda[_0x9030('0x3e')]=[{'all':!![]}];}return db[_0x9030('0x29')]['findAll'](_0x463dda);})[_0x9030('0x24')](function(_0x209aca){_0x3e00dd[_0x9030('0x3f')]=_0x209aca;return _0x3e00dd;})['then'](respondWithFilteredResult(_0x1ff4ef,_0x463dda))[_0x9030('0x40')](handleError(_0x1ff4ef,null));};exports[_0x9030('0x41')]=function(_0x3ebb74,_0x1a9ee5){var _0x5df7eb={'raw':!![],'where':{'id':_0x3ebb74[_0x9030('0x42')]['id']}},_0x2fa653={};_0x2fa653[_0x9030('0x2b')]=_['keys'](db[_0x9030('0x29')][_0x9030('0x2a')]);_0x2fa653[_0x9030('0x2d')]=_[_0x9030('0x2c')](_0x3ebb74[_0x9030('0x2d')]);_0x2fa653['filters']=_[_0x9030('0x2e')](_0x2fa653['model'],_0x2fa653[_0x9030('0x2d')]);_0x5df7eb[_0x9030('0x30')]=_[_0x9030('0x2e')](_0x2fa653[_0x9030('0x2b')],qs[_0x9030('0x2f')](_0x3ebb74[_0x9030('0x2d')][_0x9030('0x2f')]));_0x5df7eb[_0x9030('0x30')]=_0x5df7eb['attributes'][_0x9030('0x31')]?_0x5df7eb[_0x9030('0x30')]:_0x2fa653[_0x9030('0x2b')];if(_0x3ebb74[_0x9030('0x2d')][_0x9030('0x3d')]){_0x5df7eb[_0x9030('0x3e')]=[{'all':!![]}];}_0x5df7eb=_[_0x9030('0x39')]({},_0x5df7eb,_0x3ebb74[_0x9030('0x43')]);return db[_0x9030('0x29')][_0x9030('0x44')](_0x5df7eb)[_0x9030('0x24')](handleEntityNotFound(_0x1a9ee5,null))[_0x9030('0x24')](respondWithResult(_0x1a9ee5,null))[_0x9030('0x40')](handleError(_0x1a9ee5,null));};exports[_0x9030('0x45')]=function(_0x5e8cf9,_0x4725e5){return db[_0x9030('0x29')]['create'](_0x5e8cf9[_0x9030('0x46')],{})[_0x9030('0x24')](respondWithResult(_0x4725e5,0xc9))[_0x9030('0x40')](handleError(_0x4725e5,null));};exports['update']=function(_0x53030b,_0x16154f){if(_0x53030b['body']['id']){delete _0x53030b['body']['id'];}return db[_0x9030('0x29')][_0x9030('0x44')]({'where':{'id':_0x53030b[_0x9030('0x42')]['id']}})[_0x9030('0x24')](handleEntityNotFound(_0x16154f,null))['then'](saveUpdates(_0x53030b[_0x9030('0x46')],null))['then'](respondWithResult(_0x16154f,null))[_0x9030('0x40')](handleError(_0x16154f,null));};exports[_0x9030('0x23')]=function(_0x42c414,_0x513ee4){return db[_0x9030('0x29')][_0x9030('0x44')]({'where':{'id':_0x42c414[_0x9030('0x42')]['id']}})['then'](handleEntityNotFound(_0x513ee4,null))[_0x9030('0x24')](removeEntity(_0x513ee4,null))[_0x9030('0x40')](handleError(_0x513ee4,null));};exports['describe']=function(_0x39e03a,_0x4efbfc){return db[_0x9030('0x29')]['describe']()[_0x9030('0x24')](respondWithResult(_0x4efbfc,null))[_0x9030('0x40')](handleError(_0x4efbfc,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index faf9331..f9877e7 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 _0x9196=['interface','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','MemberReport','report_member','membername_interface'];(function(_0x28705e,_0x13537a){var _0x95ee71=function(_0x5b0ae2){while(--_0x5b0ae2){_0x28705e['push'](_0x28705e['shift']());}};_0x95ee71(++_0x13537a);}(_0x9196,0x69));var _0x6919=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x9196[_0x5180c3];return _0x55c975;};'use strict';var _=require(_0x6919('0x0'));var util=require(_0x6919('0x1'));var logger=require(_0x6919('0x2'))(_0x6919('0x3'));var moment=require(_0x6919('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6919('0x5'));var rimraf=require(_0x6919('0x6'));var config=require(_0x6919('0x7'));var attributes=require('./memberReport.attributes');module[_0x6919('0x8')]=function(_0x31de82,_0x2db121){return _0x31de82['define'](_0x6919('0x9'),attributes,{'tableName':_0x6919('0xa'),'paranoid':![],'indexes':[{'name':_0x6919('0xb'),'fields':['membername',_0x6919('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc8d4=['moment','request-promise','path','rimraf','../../config/environment','exports','define','MemberReport','membername','lodash','util','../../config/logger','api'];(function(_0x2238d6,_0x397180){var _0x3fcc31=function(_0x2e0997){while(--_0x2e0997){_0x2238d6['push'](_0x2238d6['shift']());}};_0x3fcc31(++_0x397180);}(_0xc8d4,0x98));var _0x4c8d=function(_0x52e0a5,_0x3fb182){_0x52e0a5=_0x52e0a5-0x0;var _0x4395a3=_0xc8d4[_0x52e0a5];return _0x4395a3;};'use strict';var _=require(_0x4c8d('0x0'));var util=require(_0x4c8d('0x1'));var logger=require(_0x4c8d('0x2'))(_0x4c8d('0x3'));var moment=require(_0x4c8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c8d('0x5'));var fs=require('fs');var path=require(_0x4c8d('0x6'));var rimraf=require(_0x4c8d('0x7'));var config=require(_0x4c8d('0x8'));var attributes=require('./memberReport.attributes');module[_0x4c8d('0x9')]=function(_0x31996a,_0x426e73){return _0x31996a[_0x4c8d('0xa')](_0x4c8d('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x4c8d('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 4c8fb7f..37de57e 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 _0x41e3=['where','limit','include','model','attributes','map','catch','CreateMemberReport','create','body','raw','stringify','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x2951b1,_0x1e3a2b){var _0x1501f1=function(_0x404653){while(--_0x404653){_0x2951b1['push'](_0x2951b1['shift']());}};_0x1501f1(++_0x1e3a2b);}(_0x41e3,0x1c6));var _0x341e=function(_0x2e72c7,_0x3cefda){_0x2e72c7=_0x2e72c7-0x0;var _0x12f876=_0x41e3[_0x2e72c7];return _0x12f876;};'use strict';var _=require('lodash');var util=require(_0x341e('0x0'));var moment=require(_0x341e('0x1'));var BPromise=require(_0x341e('0x2'));var rs=require(_0x341e('0x3'));var fs=require('fs');var Redis=require(_0x341e('0x4'));var db=require(_0x341e('0x5'))['db'];var utils=require(_0x341e('0x6'));var logger=require(_0x341e('0x7'))('rpc');var config=require(_0x341e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x341e('0x9')][_0x341e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c2e10,_0x508929,_0x298bd0){return new BPromise(function(_0x56368e,_0xc13474){return client[_0x341e('0xb')](_0x7c2e10,_0x298bd0)[_0x341e('0xc')](function(_0x59f9ff){logger['info'](_0x341e('0xd'),_0x508929,_0x341e('0xe'));logger[_0x341e('0xf')](_0x341e('0x10'),_0x508929,'request\x20sent',JSON['stringify'](_0x59f9ff));if(_0x59f9ff[_0x341e('0x11')]){if(_0x59f9ff['error'][_0x341e('0x12')]===0x1f4){logger[_0x341e('0x11')]('MemberReport,\x20%s,\x20%s',_0x508929,_0x59f9ff['error'][_0x341e('0x13')]);return _0xc13474(_0x59f9ff[_0x341e('0x11')]['message']);}logger[_0x341e('0x11')]('MemberReport,\x20%s,\x20%s',_0x508929,_0x59f9ff[_0x341e('0x11')]['message']);return _0x56368e(_0x59f9ff[_0x341e('0x11')][_0x341e('0x13')]);}else{logger[_0x341e('0x14')](_0x341e('0xd'),_0x508929,_0x341e('0xe'));_0x56368e(_0x59f9ff[_0x341e('0x15')][_0x341e('0x13')]);}})['catch'](function(_0x5c5ea2){logger[_0x341e('0x11')](_0x341e('0xd'),_0x508929,_0x5c5ea2);_0xc13474(_0x5c5ea2);});});}exports[_0x341e('0x16')]=function(_0x2705c8){var _0x179f9a=this;return new Promise(function(_0xcb1ae8,_0x32fae1){return db[_0x341e('0x17')][_0x341e('0x18')]({'raw':_0x2705c8['options']?_0x2705c8[_0x341e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2705c8['options']?_0x2705c8[_0x341e('0x19')][_0x341e('0x1a')]||null:null,'attributes':_0x2705c8[_0x341e('0x19')]?_0x2705c8[_0x341e('0x19')]['attributes']||null:null,'limit':_0x2705c8[_0x341e('0x19')]?_0x2705c8[_0x341e('0x19')][_0x341e('0x1b')]||null:null,'include':_0x2705c8[_0x341e('0x19')]?_0x2705c8['options'][_0x341e('0x1c')]?_['map'](_0x2705c8[_0x341e('0x19')]['include'],function(_0x225eb1){return{'model':db[_0x225eb1[_0x341e('0x1d')]],'as':_0x225eb1['as'],'attributes':_0x225eb1[_0x341e('0x1e')],'include':_0x225eb1[_0x341e('0x1c')]?_[_0x341e('0x1f')](_0x225eb1[_0x341e('0x1c')],function(_0x161ebe){return{'model':db[_0x161ebe[_0x341e('0x1d')]],'as':_0x161ebe['as'],'attributes':_0x161ebe[_0x341e('0x1e')],'include':_0x161ebe['include']?_[_0x341e('0x1f')](_0x161ebe[_0x341e('0x1c')],function(_0x509cf9){return{'model':db[_0x509cf9[_0x341e('0x1d')]],'as':_0x509cf9['as'],'attributes':_0x509cf9['attributes']};}):[]};}):[]};}):[]:[]})[_0x341e('0xc')](function(_0x3c80f7){logger[_0x341e('0x14')](_0x341e('0x16'),_0x2705c8);logger[_0x341e('0xf')](_0x341e('0x16'),_0x2705c8,JSON['stringify'](_0x3c80f7));_0xcb1ae8(_0x3c80f7);})[_0x341e('0x20')](function(_0x1a1c7b){logger[_0x341e('0x11')]('GetMemberReport',_0x1a1c7b[_0x341e('0x13')],_0x2705c8);_0x32fae1(_0x179f9a[_0x341e('0x11')](0x1f4,_0x1a1c7b[_0x341e('0x13')]));});});};exports[_0x341e('0x21')]=function(_0x4fd5a6){var _0x1e4f5d=this;return new Promise(function(_0x342149,_0x859dad){return db['MemberReport'][_0x341e('0x22')](_0x4fd5a6[_0x341e('0x23')],{'raw':_0x4fd5a6['options']?_0x4fd5a6['options'][_0x341e('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x457fec){logger[_0x341e('0x14')](_0x341e('0x21'),_0x4fd5a6);logger[_0x341e('0xf')](_0x341e('0x21'),_0x4fd5a6,JSON[_0x341e('0x25')](_0x457fec));_0x342149(_0x457fec);})[_0x341e('0x20')](function(_0x12a4c3){logger['error'](_0x341e('0x21'),_0x12a4c3[_0x341e('0x13')],_0x4fd5a6);_0x859dad(_0x1e4f5d[_0x341e('0x11')](0x1f4,_0x12a4c3[_0x341e('0x13')]));});});};exports[_0x341e('0x26')]=function(_0x3a829d){var _0x44fcb9=this;return new Promise(function(_0x1c14a0,_0x5cc196){return db['MemberReport'][_0x341e('0x27')](_0x3a829d[_0x341e('0x23')],{'raw':_0x3a829d['options']?_0x3a829d[_0x341e('0x19')][_0x341e('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a829d[_0x341e('0x19')]?_0x3a829d['options'][_0x341e('0x1a')]||null:null,'attributes':_0x3a829d[_0x341e('0x19')]?_0x3a829d[_0x341e('0x19')]['attributes']||null:null,'limit':_0x3a829d[_0x341e('0x19')]?_0x3a829d[_0x341e('0x19')]['limit']||null:null})[_0x341e('0xc')](function(_0x10d46e){logger['info'](_0x341e('0x26'),_0x3a829d);logger['debug']('UpdateMemberReport',_0x3a829d,JSON[_0x341e('0x25')](_0x10d46e));_0x1c14a0(_0x10d46e);})[_0x341e('0x20')](function(_0x57d398){logger[_0x341e('0x11')](_0x341e('0x26'),_0x57d398[_0x341e('0x13')],_0x3a829d);_0x5cc196(_0x44fcb9[_0x341e('0x11')](0x1f4,_0x57d398[_0x341e('0x13')]));});});}; \ No newline at end of file +var _0xab5f=['MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','findAll','options','raw','where','attributes','map','include','model','then','GetMemberReport','stringify','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4ea971,_0x174234){var _0x86b88d=function(_0x549b7e){while(--_0x549b7e){_0x4ea971['push'](_0x4ea971['shift']());}};_0x86b88d(++_0x174234);}(_0xab5f,0xe3));var _0xfab5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xab5f[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xfab5('0x0'));var util=require(_0xfab5('0x1'));var moment=require(_0xfab5('0x2'));var BPromise=require(_0xfab5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfab5('0x4'));var db=require(_0xfab5('0x5'))['db'];var utils=require(_0xfab5('0x6'));var logger=require(_0xfab5('0x7'))(_0xfab5('0x8'));var config=require(_0xfab5('0x9'));var jayson=require(_0xfab5('0xa'));var client=jayson[_0xfab5('0xb')][_0xfab5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4364f2,_0x545167,_0x274d40){return new BPromise(function(_0x296407,_0xf31e4e){return client[_0xfab5('0xd')](_0x4364f2,_0x274d40)['then'](function(_0x113a45){logger[_0xfab5('0xe')]('MemberReport,\x20%s,\x20%s',_0x545167,'request\x20sent');logger[_0xfab5('0xf')](_0xfab5('0x10'),_0x545167,'request\x20sent',JSON['stringify'](_0x113a45));if(_0x113a45[_0xfab5('0x11')]){if(_0x113a45['error'][_0xfab5('0x12')]===0x1f4){logger[_0xfab5('0x11')](_0xfab5('0x13'),_0x545167,_0x113a45[_0xfab5('0x11')]['message']);return _0xf31e4e(_0x113a45[_0xfab5('0x11')][_0xfab5('0x14')]);}logger[_0xfab5('0x11')](_0xfab5('0x13'),_0x545167,_0x113a45[_0xfab5('0x11')][_0xfab5('0x14')]);return _0x296407(_0x113a45[_0xfab5('0x11')]['message']);}else{logger[_0xfab5('0xe')](_0xfab5('0x13'),_0x545167,'request\x20sent');_0x296407(_0x113a45[_0xfab5('0x15')]['message']);}})[_0xfab5('0x16')](function(_0x11f4a7){logger[_0xfab5('0x11')](_0xfab5('0x13'),_0x545167,_0x11f4a7);_0xf31e4e(_0x11f4a7);});});}exports['GetMemberReport']=function(_0x5c6308){var _0xf6b5ae=this;return new Promise(function(_0x296151,_0x51037f){return db[_0xfab5('0x17')][_0xfab5('0x18')]({'raw':_0x5c6308[_0xfab5('0x19')]?_0x5c6308['options'][_0xfab5('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c6308[_0xfab5('0x19')]?_0x5c6308[_0xfab5('0x19')][_0xfab5('0x1b')]||null:null,'attributes':_0x5c6308['options']?_0x5c6308[_0xfab5('0x19')][_0xfab5('0x1c')]||null:null,'limit':_0x5c6308[_0xfab5('0x19')]?_0x5c6308[_0xfab5('0x19')]['limit']||null:null,'include':_0x5c6308[_0xfab5('0x19')]?_0x5c6308['options']['include']?_[_0xfab5('0x1d')](_0x5c6308[_0xfab5('0x19')][_0xfab5('0x1e')],function(_0x7b353d){return{'model':db[_0x7b353d['model']],'as':_0x7b353d['as'],'attributes':_0x7b353d[_0xfab5('0x1c')],'include':_0x7b353d[_0xfab5('0x1e')]?_[_0xfab5('0x1d')](_0x7b353d[_0xfab5('0x1e')],function(_0x3a2958){return{'model':db[_0x3a2958[_0xfab5('0x1f')]],'as':_0x3a2958['as'],'attributes':_0x3a2958[_0xfab5('0x1c')],'include':_0x3a2958['include']?_[_0xfab5('0x1d')](_0x3a2958['include'],function(_0x394935){return{'model':db[_0x394935[_0xfab5('0x1f')]],'as':_0x394935['as'],'attributes':_0x394935['attributes']};}):[]};}):[]};}):[]:[]})[_0xfab5('0x20')](function(_0x5a2c31){logger[_0xfab5('0xe')](_0xfab5('0x21'),_0x5c6308);logger[_0xfab5('0xf')](_0xfab5('0x21'),_0x5c6308,JSON[_0xfab5('0x22')](_0x5a2c31));_0x296151(_0x5a2c31);})[_0xfab5('0x16')](function(_0x5f3160){logger[_0xfab5('0x11')](_0xfab5('0x21'),_0x5f3160[_0xfab5('0x14')],_0x5c6308);_0x51037f(_0xf6b5ae['error'](0x1f4,_0x5f3160[_0xfab5('0x14')]));});});};exports[_0xfab5('0x23')]=function(_0x5c2fbb){var _0x2bfa47=this;return new Promise(function(_0x31432a,_0x39b93a){return db[_0xfab5('0x17')][_0xfab5('0x24')](_0x5c2fbb[_0xfab5('0x25')],{'raw':_0x5c2fbb[_0xfab5('0x19')]?_0x5c2fbb[_0xfab5('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xfab5('0x20')](function(_0x10b7d4){logger[_0xfab5('0xe')]('CreateMemberReport',_0x5c2fbb);logger[_0xfab5('0xf')](_0xfab5('0x23'),_0x5c2fbb,JSON[_0xfab5('0x22')](_0x10b7d4));_0x31432a(_0x10b7d4);})[_0xfab5('0x16')](function(_0x4c246a){logger[_0xfab5('0x11')]('CreateMemberReport',_0x4c246a[_0xfab5('0x14')],_0x5c2fbb);_0x39b93a(_0x2bfa47[_0xfab5('0x11')](0x1f4,_0x4c246a['message']));});});};exports[_0xfab5('0x26')]=function(_0x2b7b0c){var _0x2f8e6f=this;return new Promise(function(_0x3bb0d7,_0x213a89){return db[_0xfab5('0x17')][_0xfab5('0x27')](_0x2b7b0c[_0xfab5('0x25')],{'raw':_0x2b7b0c[_0xfab5('0x19')]?_0x2b7b0c[_0xfab5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7b0c['options']?_0x2b7b0c['options']['where']||null:null,'attributes':_0x2b7b0c[_0xfab5('0x19')]?_0x2b7b0c[_0xfab5('0x19')][_0xfab5('0x1c')]||null:null,'limit':_0x2b7b0c[_0xfab5('0x19')]?_0x2b7b0c['options'][_0xfab5('0x28')]||null:null})[_0xfab5('0x20')](function(_0x5ec6e0){logger[_0xfab5('0xe')](_0xfab5('0x26'),_0x2b7b0c);logger[_0xfab5('0xf')](_0xfab5('0x26'),_0x2b7b0c,JSON[_0xfab5('0x22')](_0x5ec6e0));_0x3bb0d7(_0x5ec6e0);})[_0xfab5('0x16')](function(_0x475151){logger[_0xfab5('0x11')](_0xfab5('0x26'),_0x475151[_0xfab5('0x14')],_0x2b7b0c);_0x213a89(_0x2f8e6f[_0xfab5('0x11')](0x1f4,_0x475151[_0xfab5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 27b837f..17b9285 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 _0xccce=['Router','../../components/interaction/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout'];(function(_0x31ccca,_0x514be9){var _0x52dde1=function(_0xe379b0){while(--_0xe379b0){_0x31ccca['push'](_0x31ccca['shift']());}};_0x52dde1(++_0x514be9);}(_0xccce,0x11d));var _0xeccc=function(_0x3c331b,_0x671c94){_0x3c331b=_0x3c331b-0x0;var _0x321d64=_0xccce[_0x3c331b];return _0x321d64;};'use strict';var multer=require('multer');var util=require(_0xeccc('0x0'));var path=require(_0xeccc('0x1'));var timeout=require(_0xeccc('0x2'));var express=require('express');var router=express[_0xeccc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xeccc('0x4'));var config=require(_0xeccc('0x5'));var controller=require(_0xeccc('0x6'));router[_0xeccc('0x7')]('/',controller[_0xeccc('0x8')]);module['exports']=router; \ No newline at end of file +var _0x8489=['../../components/interaction/service','../../config/environment','index','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x8489,0xe5));var _0x9848=function(_0x37ae45,_0x3ddc32){_0x37ae45=_0x37ae45-0x0;var _0x3420c7=_0x8489[_0x37ae45];return _0x3420c7;};'use strict';var multer=require(_0x9848('0x0'));var util=require('util');var path=require(_0x9848('0x1'));var timeout=require(_0x9848('0x2'));var express=require(_0x9848('0x3'));var router=express['Router']();var auth=require(_0x9848('0x4'));var interaction=require(_0x9848('0x5'));var config=require(_0x9848('0x6'));var controller=require('./migration.controller');router['get']('/',controller[_0x9848('0x7')]);module[_0x9848('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 58593b2..b184134 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 _0xbb2f=['sequelize','exports','STRING','version'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xbb2f,0x168));var _0xfbb2=function(_0xbe6591,_0x2de131){_0xbe6591=_0xbe6591-0x0;var _0x30cb56=_0xbb2f[_0xbe6591];return _0x30cb56;};'use strict';var Sequelize=require(_0xfbb2('0x0'));module[_0xfbb2('0x1')]={'version':{'type':Sequelize[_0xfbb2('0x2')],'unique':_0xfbb2('0x3')}}; \ No newline at end of file +var _0xcafc=['exports','STRING','version','sequelize'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xcafc,0x18b));var _0xccaf=function(_0x400a69,_0x126051){_0x400a69=_0x400a69-0x0;var _0x5a2b45=_0xcafc[_0x400a69];return _0x5a2b45;};'use strict';var Sequelize=require(_0xccaf('0x0'));module[_0xccaf('0x1')]={'version':{'type':Sequelize[_0xccaf('0x2')],'unique':_0xccaf('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cd0ccaa..4107fdd 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 _0xe95d=['where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','html-pdf','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','Content-Range','apply','save','update','then','name','send','index','Migration','model','keys','query','filters','attributes','length','hasOwnProperty','order','sort'];(function(_0x80f703,_0x159499){var _0x4479d2=function(_0x350beb){while(--_0x350beb){_0x80f703['push'](_0x80f703['shift']());}};_0x4479d2(++_0x159499);}(_0xe95d,0x85));var _0xde95=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0xe95d[_0x5180c3];return _0x55c975;};'use strict';var pdf=require(_0xde95('0x0'));var emlformat=require(_0xde95('0x1'));var rimraf=require(_0xde95('0x2'));var zipdir=require(_0xde95('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde95('0x4'));var util=require(_0xde95('0x5'));var path=require(_0xde95('0x6'));var sox=require('sox');var csv=require(_0xde95('0x7'));var ejs=require(_0xde95('0x8'));var fs=require('fs');var _=require(_0xde95('0x9'));var squel=require(_0xde95('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xde95('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xde95('0xc'));var Redis=require(_0xde95('0xd'));var authService=require(_0xde95('0xe'));var qs=require(_0xde95('0xf'));var hardwareService=require(_0xde95('0x10'));var logger=require('../../config/logger')(_0xde95('0x11'));var utils=require(_0xde95('0x12'));var config=require(_0xde95('0x13'));var db=require(_0xde95('0x14'))['db'];function respondWithStatusCode(_0x3528ab,_0x24b485){_0x24b485=_0x24b485||0xcc;return function(_0x4fc0b3){if(_0x4fc0b3){return _0x3528ab['sendStatus'](_0x24b485);}return _0x3528ab['status'](_0x24b485)[_0xde95('0x15')]();};}function respondWithResult(_0x6a98d1,_0x586cec){_0x586cec=_0x586cec||0xc8;return function(_0x224d42){if(_0x224d42){return _0x6a98d1[_0xde95('0x16')](_0x586cec)[_0xde95('0x17')](_0x224d42);}};}function respondWithFilteredResult(_0x5a5c32,_0x321dd8){return function(_0x2c8ae3){if(_0x2c8ae3){var _0xbd1164=_0x2c8ae3['count'],_0x2f79b2=_0x321dd8[_0xde95('0x18')],_0x2a6a99=_0x321dd8[_0xde95('0x18')]+_0x321dd8[_0xde95('0x19')],_0x21fdeb;if(_0x2a6a99>=_0xbd1164){_0x2a6a99=_0xbd1164;_0x21fdeb=0xc8;}else{_0x21fdeb=0xce;}_0x5a5c32[_0xde95('0x16')](_0x21fdeb);return _0x5a5c32['set'](_0xde95('0x1a'),_0x2f79b2+'-'+_0x2a6a99+'/'+_0xbd1164)[_0xde95('0x17')](_0x2c8ae3);}return null;};}function patchUpdates(_0x35c8bc){return function(_0x44d187){try{jsonpatch[_0xde95('0x1b')](_0x44d187,_0x35c8bc,!![]);}catch(_0x348bc0){return BPromise['reject'](_0x348bc0);}return _0x44d187[_0xde95('0x1c')]();};}function saveUpdates(_0x175669,_0x3c9a24){return function(_0x50ffbb){if(_0x50ffbb){return _0x50ffbb[_0xde95('0x1d')](_0x175669)[_0xde95('0x1e')](function(_0x1ed989){return _0x1ed989;});}return null;};}function removeEntity(_0x27ebbe,_0x1be960){return function(_0x3d08ba){if(_0x3d08ba){return _0x3d08ba['destroy']()['then'](function(){_0x27ebbe[_0xde95('0x16')](0xcc)[_0xde95('0x15')]();});}};}function handleEntityNotFound(_0x4fa7af,_0x1f53a2){return function(_0x5c6a8c){if(!_0x5c6a8c){_0x4fa7af['sendStatus'](0x194);}return _0x5c6a8c;};}function handleError(_0x1144a0,_0x51b1c6){_0x51b1c6=_0x51b1c6||0x1f4;return function(_0x400c28){logger['error'](_0x400c28['stack']);if(_0x400c28['name']){delete _0x400c28[_0xde95('0x1f')];}_0x1144a0[_0xde95('0x16')](_0x51b1c6)[_0xde95('0x20')](_0x400c28);};}exports[_0xde95('0x21')]=function(_0x485627,_0xcb928d){var _0x455045={},_0x2f93f6={},_0x2a723a={'count':0x0,'rows':[]};var _0x407c2f=db[_0xde95('0x22')]['rawAttributes'];_0x2f93f6[_0xde95('0x23')]=_['keys'](_0x407c2f);_0x2f93f6['query']=_[_0xde95('0x24')](_0x485627[_0xde95('0x25')]);_0x2f93f6[_0xde95('0x26')]=_['intersection'](_0x2f93f6[_0xde95('0x23')],_0x2f93f6[_0xde95('0x25')]);_0x455045[_0xde95('0x27')]=_['intersection'](_0x2f93f6[_0xde95('0x23')],qs['fields'](_0x485627[_0xde95('0x25')]['fields']));_0x455045[_0xde95('0x27')]=_0x455045[_0xde95('0x27')][_0xde95('0x28')]?_0x455045[_0xde95('0x27')]:_0x2f93f6[_0xde95('0x23')];if(!_0x485627[_0xde95('0x25')][_0xde95('0x29')]('nolimit')){_0x455045[_0xde95('0x19')]=qs[_0xde95('0x19')](_0x485627['query'][_0xde95('0x19')]);_0x455045[_0xde95('0x18')]=qs['offset'](_0x485627[_0xde95('0x25')][_0xde95('0x18')]);}_0x455045[_0xde95('0x2a')]=qs[_0xde95('0x2b')](_0x485627['query']['sort']);_0x455045[_0xde95('0x2c')]=qs[_0xde95('0x26')](_[_0xde95('0x2d')](_0x485627[_0xde95('0x25')],_0x2f93f6['filters']));if(_0x485627['query']['filter']){_0x455045[_0xde95('0x2c')]=_[_0xde95('0x2e')](_0x455045[_0xde95('0x2c')],{'$or':_[_0xde95('0x2f')](_0x407c2f,function(_0x497fbf){if(_0x497fbf[_0xde95('0x30')][_0xde95('0x31')]!==_0xde95('0x32')){var _0x2af1bb={};_0x2af1bb[_0x497fbf[_0xde95('0x33')]]={'$like':'%'+_0x485627[_0xde95('0x25')][_0xde95('0x34')]+'%'};return _0x2af1bb;}})});}_0x455045=_[_0xde95('0x2e')]({},_0x455045,_0x485627[_0xde95('0x35')]);var _0x6e8349={'where':_0x455045['where']};return db['Migration'][_0xde95('0x36')](_0x6e8349)[_0xde95('0x1e')](function(_0x917be3){_0x2a723a['count']=_0x917be3;if(_0x485627[_0xde95('0x25')][_0xde95('0x37')]){_0x455045[_0xde95('0x38')]=[{'all':!![]}];}return db[_0xde95('0x22')][_0xde95('0x39')](_0x455045);})[_0xde95('0x1e')](function(_0x72599b){_0x2a723a[_0xde95('0x3a')]=_0x72599b;return _0x2a723a;})['then'](respondWithFilteredResult(_0xcb928d,_0x455045))['catch'](handleError(_0xcb928d,null));}; \ No newline at end of file +var _0x6c98=['util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','Migration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','zip-dir','moment','bluebird','mustache'];(function(_0x4faa1e,_0x5076ad){var _0x505b99=function(_0x5d2d95){while(--_0x5d2d95){_0x4faa1e['push'](_0x4faa1e['shift']());}};_0x505b99(++_0x5076ad);}(_0x6c98,0x78));var _0x86c9=function(_0x49958a,_0x1b2949){_0x49958a=_0x49958a-0x0;var _0x31ef8b=_0x6c98[_0x49958a];return _0x31ef8b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86c9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86c9('0x1'));var BPromise=require(_0x86c9('0x2'));var Mustache=require(_0x86c9('0x3'));var util=require(_0x86c9('0x4'));var path=require(_0x86c9('0x5'));var sox=require(_0x86c9('0x6'));var csv=require(_0x86c9('0x7'));var ejs=require(_0x86c9('0x8'));var fs=require('fs');var _=require(_0x86c9('0x9'));var squel=require('squel');var crypto=require(_0x86c9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x86c9('0xb'));var toCsv=require(_0x86c9('0x7'));var querystring=require(_0x86c9('0xc'));var Papa=require(_0x86c9('0xd'));var Redis=require(_0x86c9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x86c9('0xf'));var hardwareService=require(_0x86c9('0x10'));var logger=require(_0x86c9('0x11'))(_0x86c9('0x12'));var utils=require('../../config/utils');var config=require(_0x86c9('0x13'));var db=require(_0x86c9('0x14'))['db'];function respondWithStatusCode(_0x46f48b,_0xfd067c){_0xfd067c=_0xfd067c||0xcc;return function(_0x2debda){if(_0x2debda){return _0x46f48b[_0x86c9('0x15')](_0xfd067c);}return _0x46f48b[_0x86c9('0x16')](_0xfd067c)[_0x86c9('0x17')]();};}function respondWithResult(_0x47bcaf,_0x283a91){_0x283a91=_0x283a91||0xc8;return function(_0x16e87f){if(_0x16e87f){return _0x47bcaf[_0x86c9('0x16')](_0x283a91)[_0x86c9('0x18')](_0x16e87f);}};}function respondWithFilteredResult(_0x4cf023,_0xa100da){return function(_0x5d1658){if(_0x5d1658){var _0xf58634=_0x5d1658[_0x86c9('0x19')],_0x3f7618=_0xa100da[_0x86c9('0x1a')],_0x58a02c=_0xa100da['offset']+_0xa100da['limit'],_0x53d1b1;if(_0x58a02c>=_0xf58634){_0x58a02c=_0xf58634;_0x53d1b1=0xc8;}else{_0x53d1b1=0xce;}_0x4cf023[_0x86c9('0x16')](_0x53d1b1);return _0x4cf023[_0x86c9('0x1b')]('Content-Range',_0x3f7618+'-'+_0x58a02c+'/'+_0xf58634)[_0x86c9('0x18')](_0x5d1658);}return null;};}function patchUpdates(_0x419f8c){return function(_0x5bcde8){try{jsonpatch[_0x86c9('0x1c')](_0x5bcde8,_0x419f8c,!![]);}catch(_0x35438b){return BPromise['reject'](_0x35438b);}return _0x5bcde8[_0x86c9('0x1d')]();};}function saveUpdates(_0x47aa75,_0x210259){return function(_0x93ca08){if(_0x93ca08){return _0x93ca08[_0x86c9('0x1e')](_0x47aa75)[_0x86c9('0x1f')](function(_0x984f8a){return _0x984f8a;});}return null;};}function removeEntity(_0x505c7b,_0x234bca){return function(_0x43b44c){if(_0x43b44c){return _0x43b44c[_0x86c9('0x20')]()[_0x86c9('0x1f')](function(){_0x505c7b[_0x86c9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f126b,_0x4fb85c){return function(_0x117677){if(!_0x117677){_0x4f126b[_0x86c9('0x15')](0x194);}return _0x117677;};}function handleError(_0x4e2318,_0xbfa7dd){_0xbfa7dd=_0xbfa7dd||0x1f4;return function(_0x5e5450){logger[_0x86c9('0x21')](_0x5e5450[_0x86c9('0x22')]);if(_0x5e5450['name']){delete _0x5e5450['name'];}_0x4e2318[_0x86c9('0x16')](_0xbfa7dd)[_0x86c9('0x23')](_0x5e5450);};}exports[_0x86c9('0x24')]=function(_0x580fb1,_0x31a5bb){var _0x403d90={},_0x3d1cde={},_0x4ed0e1={'count':0x0,'rows':[]};var _0x3dac70=db[_0x86c9('0x25')][_0x86c9('0x26')];_0x3d1cde[_0x86c9('0x27')]=_[_0x86c9('0x28')](_0x3dac70);_0x3d1cde['query']=_[_0x86c9('0x28')](_0x580fb1[_0x86c9('0x29')]);_0x3d1cde[_0x86c9('0x2a')]=_['intersection'](_0x3d1cde[_0x86c9('0x27')],_0x3d1cde[_0x86c9('0x29')]);_0x403d90[_0x86c9('0x2b')]=_[_0x86c9('0x2c')](_0x3d1cde[_0x86c9('0x27')],qs['fields'](_0x580fb1[_0x86c9('0x29')][_0x86c9('0x2d')]));_0x403d90[_0x86c9('0x2b')]=_0x403d90[_0x86c9('0x2b')]['length']?_0x403d90[_0x86c9('0x2b')]:_0x3d1cde[_0x86c9('0x27')];if(!_0x580fb1[_0x86c9('0x29')]['hasOwnProperty'](_0x86c9('0x2e'))){_0x403d90[_0x86c9('0x2f')]=qs[_0x86c9('0x2f')](_0x580fb1[_0x86c9('0x29')][_0x86c9('0x2f')]);_0x403d90[_0x86c9('0x1a')]=qs[_0x86c9('0x1a')](_0x580fb1['query'][_0x86c9('0x1a')]);}_0x403d90['order']=qs[_0x86c9('0x30')](_0x580fb1['query'][_0x86c9('0x30')]);_0x403d90[_0x86c9('0x31')]=qs[_0x86c9('0x2a')](_['pick'](_0x580fb1[_0x86c9('0x29')],_0x3d1cde['filters']));if(_0x580fb1['query'][_0x86c9('0x32')]){_0x403d90[_0x86c9('0x31')]=_[_0x86c9('0x33')](_0x403d90[_0x86c9('0x31')],{'$or':_[_0x86c9('0x34')](_0x3dac70,function(_0x3b777d){if(_0x3b777d[_0x86c9('0x35')][_0x86c9('0x36')]!==_0x86c9('0x37')){var _0x34d097={};_0x34d097[_0x3b777d['field']]={'$like':'%'+_0x580fb1[_0x86c9('0x29')][_0x86c9('0x32')]+'%'};return _0x34d097;}})});}_0x403d90=_[_0x86c9('0x33')]({},_0x403d90,_0x580fb1[_0x86c9('0x38')]);var _0x4a81e0={'where':_0x403d90[_0x86c9('0x31')]};return db[_0x86c9('0x25')][_0x86c9('0x19')](_0x4a81e0)[_0x86c9('0x1f')](function(_0x4fb833){_0x4ed0e1[_0x86c9('0x19')]=_0x4fb833;if(_0x580fb1[_0x86c9('0x29')][_0x86c9('0x39')]){_0x403d90[_0x86c9('0x3a')]=[{'all':!![]}];}return db['Migration'][_0x86c9('0x3b')](_0x403d90);})[_0x86c9('0x1f')](function(_0x23f9dc){_0x4ed0e1[_0x86c9('0x3c')]=_0x23f9dc;return _0x4ed0e1;})['then'](respondWithFilteredResult(_0x31a5bb,_0x403d90))[_0x86c9('0x3d')](handleError(_0x31a5bb,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 1bad422..b41e76b 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 _0x7777=['api','moment','bluebird','request-promise','path','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger'];(function(_0x571950,_0xf11d26){var _0x1bacce=function(_0x43008b){while(--_0x43008b){_0x571950['push'](_0x571950['shift']());}};_0x1bacce(++_0xf11d26);}(_0x7777,0xc9));var _0x7777=function(_0x477fdb,_0x462b55){_0x477fdb=_0x477fdb-0x0;var _0x32beaf=_0x7777[_0x477fdb];return _0x32beaf;};'use strict';var _=require(_0x7777('0x0'));var util=require(_0x7777('0x1'));var logger=require(_0x7777('0x2'))(_0x7777('0x3'));var moment=require(_0x7777('0x4'));var BPromise=require(_0x7777('0x5'));var rp=require(_0x7777('0x6'));var fs=require('fs');var path=require(_0x7777('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7777('0x8'));module[_0x7777('0x9')]=function(_0x30cf40,_0x29940f){return _0x30cf40['define'](_0x7777('0xa'),attributes,{'tableName':_0x7777('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6deb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','define','migrations','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6deb,0x8d));var _0xb6de=function(_0x4de351,_0x5927e8){_0x4de351=_0x4de351-0x0;var _0x1ca550=_0x6deb[_0x4de351];return _0x1ca550;};'use strict';var _=require(_0xb6de('0x0'));var util=require(_0xb6de('0x1'));var logger=require(_0xb6de('0x2'))(_0xb6de('0x3'));var moment=require(_0xb6de('0x4'));var BPromise=require(_0xb6de('0x5'));var rp=require(_0xb6de('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6de('0x7'));var config=require(_0xb6de('0x8'));var attributes=require(_0xb6de('0x9'));module['exports']=function(_0x75566e,_0x39f509){return _0x75566e[_0xb6de('0xa')]('Migration',attributes,{'tableName':_0xb6de('0xb'),'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 6c2a0ed..2e2000e 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 _0xb66c=['../../config/environment','jayson/promise','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2b8e23,_0x5c02dc){var _0x451efd=function(_0x4cd906){while(--_0x4cd906){_0x2b8e23['push'](_0x2b8e23['shift']());}};_0x451efd(++_0x5c02dc);}(_0xb66c,0x175));var _0xcb66=function(_0x3fab6f,_0x4253a3){_0x3fab6f=_0x3fab6f-0x0;var _0x1da187=_0xb66c[_0x3fab6f];return _0x1da187;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var moment=require(_0xcb66('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb66('0x2'));var fs=require('fs');var Redis=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var jayson=require(_0xcb66('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19adf5,_0x1b6852,_0xa3993){return new BPromise(function(_0x439f3d,_0xf7bc39){return client['request'](_0x19adf5,_0xa3993)[_0xcb66('0x9')](function(_0x3047f7){logger[_0xcb66('0xa')](_0xcb66('0xb'),_0x1b6852,_0xcb66('0xc'));logger['debug'](_0xcb66('0xd'),_0x1b6852,_0xcb66('0xc'),JSON[_0xcb66('0xe')](_0x3047f7));if(_0x3047f7[_0xcb66('0xf')]){if(_0x3047f7['error'][_0xcb66('0x10')]===0x1f4){logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7[_0xcb66('0xf')]['message']);return _0xf7bc39(_0x3047f7[_0xcb66('0xf')][_0xcb66('0x11')]);}logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7['error'][_0xcb66('0x11')]);return _0x439f3d(_0x3047f7['error'][_0xcb66('0x11')]);}else{logger['info'](_0xcb66('0xb'),_0x1b6852,'request\x20sent');_0x439f3d(_0x3047f7['result'][_0xcb66('0x11')]);}})[_0xcb66('0x12')](function(_0x681ce3){logger[_0xcb66('0xf')]('Migration,\x20%s,\x20%s',_0x1b6852,_0x681ce3);_0xf7bc39(_0x681ce3);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x4b15f7,_0x4144ef){var _0x36fbc=function(_0x230041){while(--_0x230041){_0x4b15f7['push'](_0x4b15f7['shift']());}};_0x36fbc(++_0x4144ef);}(_0x5fd1,0x155));var _0x15fd=function(_0x3732bc,_0x588aac){_0x3732bc=_0x3732bc-0x0;var _0x4038ab=_0x5fd1[_0x3732bc];return _0x4038ab;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b40493e..a2a1d4a 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 _0x8828=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','put','/:id','multer','util','express'];(function(_0xf78954,_0x16d9c8){var _0x1fef15=function(_0x58aa74){while(--_0x58aa74){_0xf78954['push'](_0xf78954['shift']());}};_0x1fef15(++_0x16d9c8);}(_0x8828,0x1d1));var _0x8882=function(_0x44c87a,_0x30524e){_0x44c87a=_0x44c87a-0x0;var _0x4fc564=_0x8828[_0x44c87a];return _0x4fc564;};'use strict';var multer=require(_0x8882('0x0'));var util=require(_0x8882('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8882('0x2'));var router=express[_0x8882('0x3')]();var auth=require(_0x8882('0x4'));var interaction=require(_0x8882('0x5'));var config=require(_0x8882('0x6'));var controller=require('./network.controller');router[_0x8882('0x7')]('/',auth[_0x8882('0x8')](),controller['index']);router[_0x8882('0x7')]('/:id',auth[_0x8882('0x8')](),controller['show']);router[_0x8882('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8882('0xa')](_0x8882('0xb'),auth[_0x8882('0x8')](),controller['update']);router['delete']('/:id',auth[_0x8882('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b8e=['/:id','update','delete','path','express','Router','../../components/auth/service','./network.controller','isAuthenticated','show','post','put'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x3b8e,0x10b));var _0xe3b8=function(_0x490926,_0x59037c){_0x490926=_0x490926-0x0;var _0x5d0bc3=_0x3b8e[_0x490926];return _0x5d0bc3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe3b8('0x0'));var timeout=require('connect-timeout');var express=require(_0xe3b8('0x1'));var router=express[_0xe3b8('0x2')]();var auth=require(_0xe3b8('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3b8('0x4'));router['get']('/',auth[_0xe3b8('0x5')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe3b8('0x6')]);router[_0xe3b8('0x7')]('/',auth[_0xe3b8('0x5')](),controller['create']);router[_0xe3b8('0x8')](_0xe3b8('0x9'),auth[_0xe3b8('0x5')](),controller[_0xe3b8('0xa')]);router[_0xe3b8('0xb')](_0xe3b8('0x9'),auth[_0xe3b8('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3a8cba2..f551a59 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 _0xa985=['ENUM','externip','STRING','sequelize','exports'];(function(_0x76c4a1,_0x2f58a9){var _0x1d2e7e=function(_0x63395d){while(--_0x63395d){_0x76c4a1['push'](_0x76c4a1['shift']());}};_0x1d2e7e(++_0x2f58a9);}(_0xa985,0x166));var _0x5a98=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xa985[_0x31ced5];return _0x10d9e5;};'use strict';var Sequelize=require(_0x5a98('0x0'));module[_0x5a98('0x1')]={'type':{'type':Sequelize[_0x5a98('0x2')]('localnet',_0x5a98('0x3'))},'value':{'type':Sequelize[_0x5a98('0x4')]}}; \ No newline at end of file +var _0x0758=['exports','ENUM','externip','STRING','sequelize'];(function(_0x1e354d,_0x4cdd11){var _0x25445d=function(_0x2536d4){while(--_0x2536d4){_0x1e354d['push'](_0x1e354d['shift']());}};_0x25445d(++_0x4cdd11);}(_0x0758,0x176));var _0x8075=function(_0x45f918,_0x561056){_0x45f918=_0x45f918-0x0;var _0x4fc4fd=_0x0758[_0x45f918];return _0x4fc4fd;};'use strict';var Sequelize=require(_0x8075('0x0'));module[_0x8075('0x1')]={'type':{'type':Sequelize[_0x8075('0x2')]('localnet',_0x8075('0x3'))},'value':{'type':Sequelize[_0x8075('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e012115..09b82d5 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 _0x6398=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','Network','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','map','VIRTUAL','field','filter','options','count','include','findAll','rows','catch','show','length','includeAll','merge','find','create','transaction','body','type','readFileSync','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','sequelize','params','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x28e62c,_0x401ffa){var _0x367e19=function(_0x28089c){while(--_0x28089c){_0x28e62c['push'](_0x28e62c['shift']());}};_0x367e19(++_0x401ffa);}(_0x6398,0x1ef));var _0x8639=function(_0x2a702f,_0x377aa7){_0x2a702f=_0x2a702f-0x0;var _0x52106f=_0x6398[_0x2a702f];return _0x52106f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8639('0x0'));var rimraf=require(_0x8639('0x1'));var zipdir=require(_0x8639('0x2'));var jsonpatch=require(_0x8639('0x3'));var rp=require(_0x8639('0x4'));var moment=require(_0x8639('0x5'));var BPromise=require(_0x8639('0x6'));var Mustache=require(_0x8639('0x7'));var util=require('util');var path=require(_0x8639('0x8'));var sox=require(_0x8639('0x9'));var csv=require(_0x8639('0xa'));var ejs=require(_0x8639('0xb'));var fs=require('fs');var _=require(_0x8639('0xc'));var squel=require(_0x8639('0xd'));var crypto=require(_0x8639('0xe'));var jsforce=require(_0x8639('0xf'));var deskjs=require(_0x8639('0x10'));var toCsv=require(_0x8639('0xa'));var querystring=require('querystring');var Papa=require(_0x8639('0x11'));var Redis=require(_0x8639('0x12'));var authService=require(_0x8639('0x13'));var qs=require(_0x8639('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8639('0x15'))(_0x8639('0x16'));var utils=require('../../config/utils');var config=require(_0x8639('0x17'));var db=require(_0x8639('0x18'))['db'];var jayson=require(_0x8639('0x19'));var client=jayson[_0x8639('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x42661e,_0x2577d2,_0x44faf3){if(_0x44faf3){var _0x8ad013=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x8ad013['test'](_0x2577d2)){return _0x42661e;}else{throw new Error(_0x8639('0x1b'));}}else{return _0x42661e;}}function respondWithRpcPromise(_0x493f3b,_0x2c1684,_0x423c35,_0x3053de){return new BPromise(function(_0x47ec42,_0x58acb9){var _0x4ef2c4=_0x3053de||client;return _0x4ef2c4[_0x8639('0x1c')](_0x493f3b,_0x423c35)[_0x8639('0x1d')](function(_0x3e9b6f){logger[_0x8639('0x1e')]('Network,\x20%s,\x20%s',_0x2c1684,_0x8639('0x1f'));logger[_0x8639('0x20')](_0x8639('0x21'),_0x2c1684,_0x8639('0x1f'),JSON[_0x8639('0x22')](_0x3e9b6f));if(_0x3e9b6f[_0x8639('0x23')]){if(_0x3e9b6f[_0x8639('0x23')][_0x8639('0x24')]===0x1f4){logger[_0x8639('0x23')](_0x8639('0x25'),_0x2c1684,_0x3e9b6f[_0x8639('0x23')][_0x8639('0x26')]);return _0x58acb9(_0x3e9b6f[_0x8639('0x23')][_0x8639('0x26')]);}logger['error'](_0x8639('0x25'),_0x2c1684,_0x3e9b6f[_0x8639('0x23')][_0x8639('0x26')]);return _0x47ec42(_0x3e9b6f['error'][_0x8639('0x26')]);}else{logger[_0x8639('0x1e')](_0x8639('0x25'),_0x2c1684,_0x8639('0x1f'));_0x47ec42(_0x3e9b6f[_0x8639('0x27')][_0x8639('0x26')]);}})['catch'](function(_0x5a6e21){logger[_0x8639('0x23')]('Network,\x20%s,\x20%s',_0x2c1684,_0x5a6e21);_0x58acb9(_0x5a6e21);});});}function respondWithStatusCode(_0x1dabdd,_0x39364d){_0x39364d=_0x39364d||0xcc;return function(_0x5472f0){if(_0x5472f0){return _0x1dabdd[_0x8639('0x28')](_0x39364d);}return _0x1dabdd[_0x8639('0x29')](_0x39364d)[_0x8639('0x2a')]();};}function respondWithResult(_0x2e3314,_0x17bfab){_0x17bfab=_0x17bfab||0xc8;return function(_0x4c4631){if(_0x4c4631){return _0x2e3314['status'](_0x17bfab)[_0x8639('0x2b')](_0x4c4631);}};}function respondWithFilteredResult(_0x105f30,_0x9033e3){return function(_0x298f22){if(_0x298f22){var _0x2e5e4b=_0x298f22['count'],_0x237617=_0x9033e3[_0x8639('0x2c')],_0x37c608=_0x9033e3['offset']+_0x9033e3[_0x8639('0x2d')],_0x3f2b69;if(_0x37c608>=_0x2e5e4b){_0x37c608=_0x2e5e4b;_0x3f2b69=0xc8;}else{_0x3f2b69=0xce;}_0x105f30[_0x8639('0x29')](_0x3f2b69);return _0x105f30[_0x8639('0x2e')](_0x8639('0x2f'),_0x237617+'-'+_0x37c608+'/'+_0x2e5e4b)['json'](_0x298f22);}return null;};}function patchUpdates(_0x491cf0){return function(_0x7912c3){try{jsonpatch[_0x8639('0x30')](_0x7912c3,_0x491cf0,!![]);}catch(_0x23120c){return BPromise['reject'](_0x23120c);}return _0x7912c3[_0x8639('0x31')]();};}function saveUpdates(_0x72ff28,_0x35e0eb){return function(_0xd9bf8e){if(_0xd9bf8e){return _0xd9bf8e['update'](_0x72ff28)[_0x8639('0x1d')](function(_0x2b90a2){return _0x2b90a2;});}return null;};}function removeEntity(_0xc73804,_0x5e598b){return function(_0x557a11){if(_0x557a11){return _0x557a11[_0x8639('0x32')]()['then'](function(){_0xc73804[_0x8639('0x29')](0xcc)[_0x8639('0x2a')]();});}};}function handleEntityNotFound(_0x1052d0,_0x492503){return function(_0x4beed8){if(!_0x4beed8){_0x1052d0[_0x8639('0x28')](0x194);}return _0x4beed8;};}function handleError(_0x11ee18,_0x15b802){_0x15b802=_0x15b802||0x1f4;return function(_0x411438){logger['error'](_0x411438[_0x8639('0x33')]);if(_0x411438[_0x8639('0x34')]){delete _0x411438[_0x8639('0x34')];}_0x11ee18[_0x8639('0x29')](_0x15b802)[_0x8639('0x35')](_0x411438);};}exports['index']=function(_0x73c96,_0x7f3a00){var _0x345605={},_0x5ebe13={},_0x42a067={'count':0x0,'rows':[]};var _0x540e92=db[_0x8639('0x36')][_0x8639('0x37')];_0x5ebe13[_0x8639('0x38')]=_[_0x8639('0x39')](_0x540e92);_0x5ebe13[_0x8639('0x3a')]=_[_0x8639('0x39')](_0x73c96[_0x8639('0x3a')]);_0x5ebe13['filters']=_['intersection'](_0x5ebe13['model'],_0x5ebe13['query']);_0x345605['attributes']=_[_0x8639('0x3b')](_0x5ebe13[_0x8639('0x38')],qs[_0x8639('0x3c')](_0x73c96[_0x8639('0x3a')][_0x8639('0x3c')]));_0x345605[_0x8639('0x3d')]=_0x345605['attributes']['length']?_0x345605[_0x8639('0x3d')]:_0x5ebe13[_0x8639('0x38')];if(!_0x73c96[_0x8639('0x3a')][_0x8639('0x3e')](_0x8639('0x3f'))){_0x345605[_0x8639('0x2d')]=qs[_0x8639('0x2d')](_0x73c96[_0x8639('0x3a')][_0x8639('0x2d')]);_0x345605[_0x8639('0x2c')]=qs[_0x8639('0x2c')](_0x73c96['query']['offset']);}_0x345605[_0x8639('0x40')]=qs[_0x8639('0x41')](_0x73c96['query'][_0x8639('0x41')]);_0x345605[_0x8639('0x42')]=qs[_0x8639('0x43')](_['pick'](_0x73c96[_0x8639('0x3a')],_0x5ebe13[_0x8639('0x43')]));if(_0x73c96[_0x8639('0x3a')]['filter']){_0x345605[_0x8639('0x42')]=_['merge'](_0x345605['where'],{'$or':_[_0x8639('0x44')](_0x540e92,function(_0x15e67d){if(_0x15e67d['type']['key']!==_0x8639('0x45')){var _0x3b418c={};_0x3b418c[_0x15e67d[_0x8639('0x46')]]={'$like':'%'+_0x73c96[_0x8639('0x3a')][_0x8639('0x47')]+'%'};return _0x3b418c;}})});}_0x345605=_['merge']({},_0x345605,_0x73c96[_0x8639('0x48')]);var _0x372252={'where':_0x345605[_0x8639('0x42')]};return db[_0x8639('0x36')]['count'](_0x372252)[_0x8639('0x1d')](function(_0x979ff2){_0x42a067[_0x8639('0x49')]=_0x979ff2;if(_0x73c96[_0x8639('0x3a')]['includeAll']){_0x345605[_0x8639('0x4a')]=[{'all':!![]}];}return db['Network'][_0x8639('0x4b')](_0x345605);})[_0x8639('0x1d')](function(_0x2a8e2d){_0x42a067[_0x8639('0x4c')]=_0x2a8e2d;return _0x42a067;})[_0x8639('0x1d')](respondWithFilteredResult(_0x7f3a00,_0x345605))[_0x8639('0x4d')](handleError(_0x7f3a00,null));};exports[_0x8639('0x4e')]=function(_0xe773a7,_0x59f911){var _0x179195={'raw':!![],'where':{'id':_0xe773a7['params']['id']}},_0x59e3c0={};_0x59e3c0[_0x8639('0x38')]=_[_0x8639('0x39')](db['Network']['rawAttributes']);_0x59e3c0[_0x8639('0x3a')]=_['keys'](_0xe773a7[_0x8639('0x3a')]);_0x59e3c0['filters']=_['intersection'](_0x59e3c0['model'],_0x59e3c0[_0x8639('0x3a')]);_0x179195[_0x8639('0x3d')]=_[_0x8639('0x3b')](_0x59e3c0[_0x8639('0x38')],qs[_0x8639('0x3c')](_0xe773a7['query'][_0x8639('0x3c')]));_0x179195[_0x8639('0x3d')]=_0x179195[_0x8639('0x3d')][_0x8639('0x4f')]?_0x179195[_0x8639('0x3d')]:_0x59e3c0[_0x8639('0x38')];if(_0xe773a7['query'][_0x8639('0x50')]){_0x179195['include']=[{'all':!![]}];}_0x179195=_[_0x8639('0x51')]({},_0x179195,_0xe773a7['options']);return db[_0x8639('0x36')][_0x8639('0x52')](_0x179195)['then'](handleEntityNotFound(_0x59f911,null))[_0x8639('0x1d')](respondWithResult(_0x59f911,null))[_0x8639('0x4d')](handleError(_0x59f911,null));};exports[_0x8639('0x53')]=function(_0x5bca69,_0x5334c2,_0x2790af){var _0x3d891a;return db['sequelize'][_0x8639('0x54')](function(_0x45f331){return db['Network'][_0x8639('0x53')](_0x5bca69[_0x8639('0x55')],{'raw':!![]})[_0x8639('0x1d')](function(_0xea17d7){_0x3d891a=_0xea17d7;return db[_0x8639('0x36')]['findAll']({'where':{'type':_0x5bca69[_0x8639('0x55')][_0x8639('0x56')]},'raw':!![]});})[_0x8639('0x1d')](function(_0x537002){var _0x40976e=fs[_0x8639('0x57')](path['join'](config[_0x8639('0x58')],_0x8639('0x59')),_0x8639('0x5a'));var _0xcb9d0f=ejs[_0x8639('0x5b')](_0x40976e,{'networks':_0x537002||[]});fs[_0x8639('0x5c')](util[_0x8639('0x5d')](_0x8639('0x5e'),_0x5bca69[_0x8639('0x55')]['type'][_0x8639('0x5f')]()),_0xcb9d0f);})[_0x8639('0x1d')](function(){return respondWithRpcPromise(_0x8639('0x60'),'create',{'module':_0x8639('0x61')});})[_0x8639('0x1d')](function(){return _0x3d891a;});})[_0x8639('0x1d')](respondWithResult(_0x5334c2,0xc9))['catch'](handleError(_0x5334c2,null));};exports[_0x8639('0x62')]=function(_0xcf0061,_0x3f2ac4,_0x2efaaa){var _0x46dcda;return db[_0x8639('0x63')][_0x8639('0x54')](function(_0x2e9c85){return db[_0x8639('0x36')][_0x8639('0x52')]({'where':{'id':_0xcf0061[_0x8639('0x64')]['id']}})[_0x8639('0x1d')](handleEntityNotFound(_0x3f2ac4,null))[_0x8639('0x1d')](saveUpdates(_0xcf0061[_0x8639('0x55')],null))[_0x8639('0x1d')](function(_0x333a67){if(_0x333a67){_0x46dcda=_0x333a67;return db[_0x8639('0x36')][_0x8639('0x4b')]({'where':{'type':_0x46dcda['type']},'raw':!![]});}return null;})[_0x8639('0x1d')](function(_0x32d66c){if(_0x32d66c){var _0x4032ce=fs['readFileSync'](path[_0x8639('0x65')](config[_0x8639('0x58')],'server/files/templates/network.ejs'),'utf8');var _0x53a10a=ejs['render'](_0x4032ce,{'networks':_0x32d66c||[]});fs[_0x8639('0x5c')](util[_0x8639('0x5d')]('/etc/asterisk/sip_xcally_%s.conf',_0x46dcda[_0x8639('0x56')][_0x8639('0x5f')]()),_0x53a10a);return respondWithRpcPromise('Reload','update',{'module':_0x8639('0x61')});}return null;})[_0x8639('0x1d')](function(_0x139c01){if(_0x139c01){return _0x46dcda;}return null;});})['then'](respondWithResult(_0x3f2ac4,null))[_0x8639('0x4d')](handleError(_0x3f2ac4,null));};exports['destroy']=function(_0x15a88b,_0x43a10f,_0x3ffecf){var _0x35a4bc;return db['Network'][_0x8639('0x52')]({'where':{'id':_0x15a88b[_0x8639('0x64')]['id']}})['then'](function(_0x426169){_0x35a4bc=_0x426169;return _0x426169;})[_0x8639('0x1d')](handleEntityNotFound(_0x43a10f,null))[_0x8639('0x1d')](removeEntity(_0x43a10f,null))[_0x8639('0x1d')](function(){if(_0x35a4bc){return db[_0x8639('0x36')]['findAll']({'where':{'type':_0x35a4bc[_0x8639('0x56')]},'raw':!![]});}})[_0x8639('0x1d')](function(_0x157a2f){if(_0x157a2f){var _0x9e1496=fs[_0x8639('0x57')](path[_0x8639('0x65')](config[_0x8639('0x58')],_0x8639('0x59')),_0x8639('0x5a'));var _0x57c92b=ejs[_0x8639('0x5b')](_0x9e1496,{'networks':_0x157a2f||[]});fs[_0x8639('0x5c')](util[_0x8639('0x5d')](_0x8639('0x5e'),_0x35a4bc['type'][_0x8639('0x5f')]()),_0x57c92b);return respondWithRpcPromise(_0x8639('0x60'),_0x8639('0x32'),{'module':_0x8639('0x61')});}})[_0x8639('0x4d')](handleError(_0x43a10f,null));}; \ No newline at end of file +var _0x992b=['hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','Network','findAll','rows','show','params','includeAll','include','create','sequelize','body','join','root','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','transaction','find','readFileSync','destroy','server/files/templates/network.ejs','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','stack','name','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length'];(function(_0x56616e,_0x2f036b){var _0x5b7d95=function(_0x593254){while(--_0x593254){_0x56616e['push'](_0x56616e['shift']());}};_0x5b7d95(++_0x2f036b);}(_0x992b,0x149));var _0xb992=function(_0x5ed506,_0x530e00){_0x5ed506=_0x5ed506-0x0;var _0x3845d4=_0x992b[_0x5ed506];return _0x3845d4;};'use strict';var pdf=require(_0xb992('0x0'));var emlformat=require(_0xb992('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb992('0x2'));var rp=require('request-promise');var moment=require(_0xb992('0x3'));var BPromise=require(_0xb992('0x4'));var Mustache=require(_0xb992('0x5'));var util=require(_0xb992('0x6'));var path=require(_0xb992('0x7'));var sox=require(_0xb992('0x8'));var csv=require(_0xb992('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb992('0xa'));var squel=require(_0xb992('0xb'));var crypto=require('crypto');var jsforce=require(_0xb992('0xc'));var deskjs=require(_0xb992('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb992('0xe'));var Redis=require(_0xb992('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb992('0x10'));var hardwareService=require(_0xb992('0x11'));var logger=require('../../config/logger')(_0xb992('0x12'));var utils=require(_0xb992('0x13'));var config=require(_0xb992('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb992('0x15'));var client=jayson[_0xb992('0x16')][_0xb992('0x17')]({'port':0x232a});function checkPasswordPattern(_0x81c87e,_0x1b9f44,_0x4ed8dd){if(_0x4ed8dd){var _0x53d8fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53d8fb['test'](_0x1b9f44)){return _0x81c87e;}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 _0x81c87e;}}function respondWithRpcPromise(_0x19757b,_0x5523ca,_0xc651e5,_0x11b3e9){return new BPromise(function(_0x11095a,_0x51ec37){var _0x1fe5d4=_0x11b3e9||client;return _0x1fe5d4[_0xb992('0x18')](_0x19757b,_0xc651e5)[_0xb992('0x19')](function(_0x47b0cf){logger[_0xb992('0x1a')](_0xb992('0x1b'),_0x5523ca,_0xb992('0x1c'));logger[_0xb992('0x1d')](_0xb992('0x1e'),_0x5523ca,_0xb992('0x1c'),JSON['stringify'](_0x47b0cf));if(_0x47b0cf['error']){if(_0x47b0cf[_0xb992('0x1f')][_0xb992('0x20')]===0x1f4){logger[_0xb992('0x1f')](_0xb992('0x1b'),_0x5523ca,_0x47b0cf[_0xb992('0x1f')][_0xb992('0x21')]);return _0x51ec37(_0x47b0cf['error'][_0xb992('0x21')]);}logger['error'](_0xb992('0x1b'),_0x5523ca,_0x47b0cf[_0xb992('0x1f')][_0xb992('0x21')]);return _0x11095a(_0x47b0cf[_0xb992('0x1f')][_0xb992('0x21')]);}else{logger[_0xb992('0x1a')](_0xb992('0x1b'),_0x5523ca,'request\x20sent');_0x11095a(_0x47b0cf[_0xb992('0x22')][_0xb992('0x21')]);}})[_0xb992('0x23')](function(_0x30a33d){logger['error'](_0xb992('0x1b'),_0x5523ca,_0x30a33d);_0x51ec37(_0x30a33d);});});}function respondWithStatusCode(_0xcdd331,_0x5a4bbb){_0x5a4bbb=_0x5a4bbb||0xcc;return function(_0x5779c6){if(_0x5779c6){return _0xcdd331[_0xb992('0x24')](_0x5a4bbb);}return _0xcdd331[_0xb992('0x25')](_0x5a4bbb)[_0xb992('0x26')]();};}function respondWithResult(_0x75243c,_0x31c655){_0x31c655=_0x31c655||0xc8;return function(_0x5c0c00){if(_0x5c0c00){return _0x75243c['status'](_0x31c655)[_0xb992('0x27')](_0x5c0c00);}};}function respondWithFilteredResult(_0x286b39,_0x428409){return function(_0x54713a){if(_0x54713a){var _0x182704=_0x54713a[_0xb992('0x28')],_0x5e9016=_0x428409['offset'],_0x8963a3=_0x428409[_0xb992('0x29')]+_0x428409[_0xb992('0x2a')],_0x4396dd;if(_0x8963a3>=_0x182704){_0x8963a3=_0x182704;_0x4396dd=0xc8;}else{_0x4396dd=0xce;}_0x286b39[_0xb992('0x25')](_0x4396dd);return _0x286b39[_0xb992('0x2b')]('Content-Range',_0x5e9016+'-'+_0x8963a3+'/'+_0x182704)['json'](_0x54713a);}return null;};}function patchUpdates(_0x151a5e){return function(_0x3906bb){try{jsonpatch[_0xb992('0x2c')](_0x3906bb,_0x151a5e,!![]);}catch(_0x13f5c3){return BPromise['reject'](_0x13f5c3);}return _0x3906bb[_0xb992('0x2d')]();};}function saveUpdates(_0xcf39bc,_0x37957a){return function(_0x3de26a){if(_0x3de26a){return _0x3de26a[_0xb992('0x2e')](_0xcf39bc)['then'](function(_0x9718f4){return _0x9718f4;});}return null;};}function removeEntity(_0x4d11b5,_0x2cae36){return function(_0x506b12){if(_0x506b12){return _0x506b12['destroy']()[_0xb992('0x19')](function(){_0x4d11b5[_0xb992('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf855f8,_0x51f792){return function(_0x19a306){if(!_0x19a306){_0xf855f8[_0xb992('0x24')](0x194);}return _0x19a306;};}function handleError(_0x317acb,_0x2bd1ec){_0x2bd1ec=_0x2bd1ec||0x1f4;return function(_0xf41009){logger[_0xb992('0x1f')](_0xf41009[_0xb992('0x2f')]);if(_0xf41009[_0xb992('0x30')]){delete _0xf41009[_0xb992('0x30')];}_0x317acb[_0xb992('0x25')](_0x2bd1ec)[_0xb992('0x31')](_0xf41009);};}exports[_0xb992('0x32')]=function(_0x5df6b5,_0x3240cd){var _0x41e933={},_0x3f22b7={},_0x571e07={'count':0x0,'rows':[]};var _0x2ca177=db['Network'][_0xb992('0x33')];_0x3f22b7[_0xb992('0x34')]=_['keys'](_0x2ca177);_0x3f22b7[_0xb992('0x35')]=_[_0xb992('0x36')](_0x5df6b5[_0xb992('0x35')]);_0x3f22b7['filters']=_[_0xb992('0x37')](_0x3f22b7[_0xb992('0x34')],_0x3f22b7[_0xb992('0x35')]);_0x41e933[_0xb992('0x38')]=_[_0xb992('0x37')](_0x3f22b7['model'],qs[_0xb992('0x39')](_0x5df6b5[_0xb992('0x35')][_0xb992('0x39')]));_0x41e933[_0xb992('0x38')]=_0x41e933['attributes'][_0xb992('0x3a')]?_0x41e933['attributes']:_0x3f22b7[_0xb992('0x34')];if(!_0x5df6b5[_0xb992('0x35')][_0xb992('0x3b')](_0xb992('0x3c'))){_0x41e933['limit']=qs[_0xb992('0x2a')](_0x5df6b5[_0xb992('0x35')][_0xb992('0x2a')]);_0x41e933[_0xb992('0x29')]=qs['offset'](_0x5df6b5['query'][_0xb992('0x29')]);}_0x41e933['order']=qs[_0xb992('0x3d')](_0x5df6b5['query'][_0xb992('0x3d')]);_0x41e933[_0xb992('0x3e')]=qs[_0xb992('0x3f')](_['pick'](_0x5df6b5[_0xb992('0x35')],_0x3f22b7['filters']));if(_0x5df6b5['query'][_0xb992('0x40')]){_0x41e933[_0xb992('0x3e')]=_[_0xb992('0x41')](_0x41e933['where'],{'$or':_[_0xb992('0x42')](_0x2ca177,function(_0x2e330f){if(_0x2e330f[_0xb992('0x43')][_0xb992('0x44')]!==_0xb992('0x45')){var _0x3977be={};_0x3977be[_0x2e330f[_0xb992('0x46')]]={'$like':'%'+_0x5df6b5[_0xb992('0x35')][_0xb992('0x40')]+'%'};return _0x3977be;}})});}_0x41e933=_[_0xb992('0x41')]({},_0x41e933,_0x5df6b5[_0xb992('0x47')]);var _0x270b16={'where':_0x41e933['where']};return db[_0xb992('0x48')]['count'](_0x270b16)[_0xb992('0x19')](function(_0x33d7a2){_0x571e07['count']=_0x33d7a2;if(_0x5df6b5['query']['includeAll']){_0x41e933['include']=[{'all':!![]}];}return db['Network'][_0xb992('0x49')](_0x41e933);})[_0xb992('0x19')](function(_0x1c6a1f){_0x571e07[_0xb992('0x4a')]=_0x1c6a1f;return _0x571e07;})[_0xb992('0x19')](respondWithFilteredResult(_0x3240cd,_0x41e933))[_0xb992('0x23')](handleError(_0x3240cd,null));};exports[_0xb992('0x4b')]=function(_0x40f3c8,_0xb600f2){var _0x54b179={'raw':!![],'where':{'id':_0x40f3c8[_0xb992('0x4c')]['id']}},_0x5d78db={};_0x5d78db[_0xb992('0x34')]=_['keys'](db[_0xb992('0x48')][_0xb992('0x33')]);_0x5d78db['query']=_[_0xb992('0x36')](_0x40f3c8[_0xb992('0x35')]);_0x5d78db[_0xb992('0x3f')]=_[_0xb992('0x37')](_0x5d78db[_0xb992('0x34')],_0x5d78db[_0xb992('0x35')]);_0x54b179[_0xb992('0x38')]=_[_0xb992('0x37')](_0x5d78db[_0xb992('0x34')],qs[_0xb992('0x39')](_0x40f3c8[_0xb992('0x35')][_0xb992('0x39')]));_0x54b179[_0xb992('0x38')]=_0x54b179[_0xb992('0x38')]['length']?_0x54b179[_0xb992('0x38')]:_0x5d78db['model'];if(_0x40f3c8[_0xb992('0x35')][_0xb992('0x4d')]){_0x54b179[_0xb992('0x4e')]=[{'all':!![]}];}_0x54b179=_[_0xb992('0x41')]({},_0x54b179,_0x40f3c8['options']);return db['Network']['find'](_0x54b179)[_0xb992('0x19')](handleEntityNotFound(_0xb600f2,null))[_0xb992('0x19')](respondWithResult(_0xb600f2,null))[_0xb992('0x23')](handleError(_0xb600f2,null));};exports[_0xb992('0x4f')]=function(_0x4452a8,_0x5bd94b,_0x4cce43){var _0x29fd69;return db[_0xb992('0x50')]['transaction'](function(_0x45e6b4){return db[_0xb992('0x48')][_0xb992('0x4f')](_0x4452a8[_0xb992('0x51')],{'raw':!![]})[_0xb992('0x19')](function(_0x1268f3){_0x29fd69=_0x1268f3;return db[_0xb992('0x48')]['findAll']({'where':{'type':_0x4452a8[_0xb992('0x51')][_0xb992('0x43')]},'raw':!![]});})[_0xb992('0x19')](function(_0x5e4da7){var _0x1ac1db=fs['readFileSync'](path[_0xb992('0x52')](config[_0xb992('0x53')],'server/files/templates/network.ejs'),_0xb992('0x54'));var _0x1e83b9=ejs[_0xb992('0x55')](_0x1ac1db,{'networks':_0x5e4da7||[]});fs[_0xb992('0x56')](util[_0xb992('0x57')](_0xb992('0x58'),_0x4452a8['body']['type'][_0xb992('0x59')]()),_0x1e83b9);})[_0xb992('0x19')](function(){return respondWithRpcPromise(_0xb992('0x5a'),_0xb992('0x4f'),{'module':_0xb992('0x5b')});})[_0xb992('0x19')](function(){return _0x29fd69;});})[_0xb992('0x19')](respondWithResult(_0x5bd94b,0xc9))['catch'](handleError(_0x5bd94b,null));};exports['update']=function(_0x28a5b9,_0x5fe4d3,_0x4f12c5){var _0x2e8502;return db['sequelize'][_0xb992('0x5c')](function(_0x1f56c3){return db['Network'][_0xb992('0x5d')]({'where':{'id':_0x28a5b9[_0xb992('0x4c')]['id']}})[_0xb992('0x19')](handleEntityNotFound(_0x5fe4d3,null))[_0xb992('0x19')](saveUpdates(_0x28a5b9[_0xb992('0x51')],null))['then'](function(_0x5af98a){if(_0x5af98a){_0x2e8502=_0x5af98a;return db[_0xb992('0x48')]['findAll']({'where':{'type':_0x2e8502[_0xb992('0x43')]},'raw':!![]});}return null;})[_0xb992('0x19')](function(_0x49df29){if(_0x49df29){var _0x1df8e8=fs[_0xb992('0x5e')](path[_0xb992('0x52')](config[_0xb992('0x53')],'server/files/templates/network.ejs'),'utf8');var _0x2d5724=ejs[_0xb992('0x55')](_0x1df8e8,{'networks':_0x49df29||[]});fs[_0xb992('0x56')](util[_0xb992('0x57')]('/etc/asterisk/sip_xcally_%s.conf',_0x2e8502['type'][_0xb992('0x59')]()),_0x2d5724);return respondWithRpcPromise(_0xb992('0x5a'),_0xb992('0x2e'),{'module':_0xb992('0x5b')});}return null;})[_0xb992('0x19')](function(_0x253523){if(_0x253523){return _0x2e8502;}return null;});})[_0xb992('0x19')](respondWithResult(_0x5fe4d3,null))[_0xb992('0x23')](handleError(_0x5fe4d3,null));};exports[_0xb992('0x5f')]=function(_0x2ef433,_0xb0647d,_0x287ff8){var _0xb25cde;return db[_0xb992('0x48')][_0xb992('0x5d')]({'where':{'id':_0x2ef433[_0xb992('0x4c')]['id']}})[_0xb992('0x19')](function(_0x1e0b42){_0xb25cde=_0x1e0b42;return _0x1e0b42;})[_0xb992('0x19')](handleEntityNotFound(_0xb0647d,null))[_0xb992('0x19')](removeEntity(_0xb0647d,null))[_0xb992('0x19')](function(){if(_0xb25cde){return db[_0xb992('0x48')][_0xb992('0x49')]({'where':{'type':_0xb25cde[_0xb992('0x43')]},'raw':!![]});}})[_0xb992('0x19')](function(_0x4798c6){if(_0x4798c6){var _0x45c661=fs[_0xb992('0x5e')](path['join'](config[_0xb992('0x53')],_0xb992('0x60')),_0xb992('0x54'));var _0x51ca16=ejs[_0xb992('0x55')](_0x45c661,{'networks':_0x4798c6||[]});fs[_0xb992('0x56')](util[_0xb992('0x57')](_0xb992('0x58'),_0xb25cde[_0xb992('0x43')][_0xb992('0x59')]()),_0x51ca16);return respondWithRpcPromise('Reload',_0xb992('0x5f'),{'module':'chan_sip.so'});}})['catch'](handleError(_0xb0647d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index b161226..d5d168f 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 _0xb8ed=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./network.attributes','network'];(function(_0x226a5a,_0x112230){var _0xf36874=function(_0x1f2ccb){while(--_0x1f2ccb){_0x226a5a['push'](_0x226a5a['shift']());}};_0xf36874(++_0x112230);}(_0xb8ed,0x118));var _0xdb8e=function(_0x4ca72a,_0x29cf9a){_0x4ca72a=_0x4ca72a-0x0;var _0x40ce6b=_0xb8ed[_0x4ca72a];return _0x40ce6b;};'use strict';var _=require(_0xdb8e('0x0'));var util=require(_0xdb8e('0x1'));var logger=require(_0xdb8e('0x2'))(_0xdb8e('0x3'));var moment=require('moment');var BPromise=require(_0xdb8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb8e('0x5'));var rimraf=require(_0xdb8e('0x6'));var config=require(_0xdb8e('0x7'));var attributes=require(_0xdb8e('0x8'));module['exports']=function(_0x4402d0,_0x3066b0){return _0x4402d0['define']('Network',attributes,{'tableName':_0xdb8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d42=['./network.attributes','exports','define','Network','network','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x559948,_0x5d7a75){var _0x4fc8d5=function(_0x4f77aa){while(--_0x4f77aa){_0x559948['push'](_0x559948['shift']());}};_0x4fc8d5(++_0x5d7a75);}(_0x4d42,0x157));var _0x24d4=function(_0x230724,_0x419dd0){_0x230724=_0x230724-0x0;var _0x333cb8=_0x4d42[_0x230724];return _0x333cb8;};'use strict';var _=require(_0x24d4('0x0'));var util=require(_0x24d4('0x1'));var logger=require('../../config/logger')(_0x24d4('0x2'));var moment=require(_0x24d4('0x3'));var BPromise=require(_0x24d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24d4('0x5'));var rimraf=require(_0x24d4('0x6'));var config=require(_0x24d4('0x7'));var attributes=require(_0x24d4('0x8'));module[_0x24d4('0x9')]=function(_0x57b010,_0x20c391){return _0x57b010[_0x24d4('0xa')](_0x24d4('0xb'),attributes,{'tableName':_0x24d4('0xc'),'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 e03f7b9..392995e 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 _0x8ca9=['info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then'];(function(_0x2925d4,_0x274bde){var _0xb2bb3e=function(_0x92509e){while(--_0x92509e){_0x2925d4['push'](_0x2925d4['shift']());}};_0xb2bb3e(++_0x274bde);}(_0x8ca9,0x9c));var _0x98ca=function(_0x52704,_0x86eb21){_0x52704=_0x52704-0x0;var _0x11402f=_0x8ca9[_0x52704];return _0x11402f;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require(_0x98ca('0x3'));var rs=require(_0x98ca('0x4'));var fs=require('fs');var Redis=require(_0x98ca('0x5'));var db=require(_0x98ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson['client'][_0x98ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4097,_0x18c349,_0x2852a0){return new BPromise(function(_0x323c95,_0x28a37a){return client[_0x98ca('0xa')](_0xca4097,_0x2852a0)[_0x98ca('0xb')](function(_0x277c29){logger[_0x98ca('0xc')](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));logger[_0x98ca('0xf')](_0x98ca('0x10'),_0x18c349,_0x98ca('0xe'),JSON[_0x98ca('0x11')](_0x277c29));if(_0x277c29[_0x98ca('0x12')]){if(_0x277c29[_0x98ca('0x12')]['code']===0x1f4){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x28a37a(_0x277c29['error'][_0x98ca('0x13')]);}logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);return _0x323c95(_0x277c29[_0x98ca('0x12')][_0x98ca('0x13')]);}else{logger['info'](_0x98ca('0xd'),_0x18c349,_0x98ca('0xe'));_0x323c95(_0x277c29[_0x98ca('0x14')][_0x98ca('0x13')]);}})['catch'](function(_0x238c1a){logger[_0x98ca('0x12')](_0x98ca('0xd'),_0x18c349,_0x238c1a);_0x28a37a(_0x238c1a);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0xf494,0x1c6));var _0x4f49=function(_0x2633e0,_0x4a57f1){_0x2633e0=_0x2633e0-0x0;var _0x4d37c0=_0xf494[_0x2633e0];return _0x4d37c0;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f9369de..47e7c04 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 _0x0ad8=['post','addDisposition','/:id/notify','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users'];(function(_0x2f0570,_0x30e16f){var _0x2b2a29=function(_0x2c335f){while(--_0x2c335f){_0x2f0570['push'](_0x2f0570['shift']());}};_0x2b2a29(++_0x30e16f);}(_0x0ad8,0xfb));var _0x80ad=function(_0x54055c,_0xb744b9){_0x54055c=_0x54055c-0x0;var _0x2f7e14=_0x0ad8[_0x54055c];return _0x2f7e14;};'use strict';var multer=require(_0x80ad('0x0'));var util=require(_0x80ad('0x1'));var path=require(_0x80ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x80ad('0x3'));var router=express['Router']();var auth=require(_0x80ad('0x4'));var interaction=require(_0x80ad('0x5'));var config=require(_0x80ad('0x6'));var controller=require(_0x80ad('0x7'));router['get']('/',auth[_0x80ad('0x8')](),controller['index']);router[_0x80ad('0x9')](_0x80ad('0xa'),auth[_0x80ad('0x8')](),controller[_0x80ad('0xb')]);router[_0x80ad('0x9')]('/:id',auth[_0x80ad('0x8')](),controller[_0x80ad('0xc')]);router[_0x80ad('0x9')](_0x80ad('0xd'),auth[_0x80ad('0x8')](),controller['getDispositions']);router[_0x80ad('0x9')](_0x80ad('0xe'),auth[_0x80ad('0x8')](),controller[_0x80ad('0xf')]);router[_0x80ad('0x9')](_0x80ad('0x10'),auth[_0x80ad('0x8')](),controller[_0x80ad('0x11')]);router['get'](_0x80ad('0x12'),auth[_0x80ad('0x8')](),controller[_0x80ad('0x13')]);router[_0x80ad('0x9')](_0x80ad('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x80ad('0x15')]('/',auth[_0x80ad('0x8')](),controller['create']);router[_0x80ad('0x15')]('/:id/dispositions',auth[_0x80ad('0x8')](),controller[_0x80ad('0x16')]);router[_0x80ad('0x15')](_0x80ad('0xe'),auth[_0x80ad('0x8')](),controller['addAnswer']);router[_0x80ad('0x15')](_0x80ad('0x17'),controller['notify']);router[_0x80ad('0x15')]('/:id/applications',auth[_0x80ad('0x8')](),controller[_0x80ad('0x18')]);router[_0x80ad('0x15')](_0x80ad('0x14'),auth[_0x80ad('0x8')](),controller[_0x80ad('0x19')]);router[_0x80ad('0x15')]('/:id/send',auth[_0x80ad('0x8')](),controller[_0x80ad('0x1a')]);router[_0x80ad('0x1b')]('/:id',auth[_0x80ad('0x8')](),controller[_0x80ad('0x1c')]);router[_0x80ad('0x1d')]('/:id',auth[_0x80ad('0x8')](),controller[_0x80ad('0x1e')]);router[_0x80ad('0x1d')](_0x80ad('0xd'),auth['isAuthenticated'](),controller[_0x80ad('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x80ad('0x8')](),controller['removeAnswers']);router['delete'](_0x80ad('0x14'),auth[_0x80ad('0x8')](),controller[_0x80ad('0x20')]);module[_0x80ad('0x21')]=router; \ No newline at end of file +var _0x3c2d=['addAgents','put','/:id','update','delete','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x3c2d,0x1c3));var _0xd3c2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3c2d[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xd3c2('0x0'));var util=require('util');var path=require(_0xd3c2('0x1'));var timeout=require(_0xd3c2('0x2'));var express=require(_0xd3c2('0x3'));var router=express[_0xd3c2('0x4')]();var auth=require(_0xd3c2('0x5'));var interaction=require(_0xd3c2('0x6'));var config=require('../../config/environment');var controller=require(_0xd3c2('0x7'));router[_0xd3c2('0x8')]('/',auth[_0xd3c2('0x9')](),controller[_0xd3c2('0xa')]);router['get'](_0xd3c2('0xb'),auth['isAuthenticated'](),controller[_0xd3c2('0xc')]);router[_0xd3c2('0x8')]('/:id',auth[_0xd3c2('0x9')](),controller['show']);router[_0xd3c2('0x8')]('/:id/dispositions',auth[_0xd3c2('0x9')](),controller[_0xd3c2('0xd')]);router[_0xd3c2('0x8')](_0xd3c2('0xe'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0xf')]);router[_0xd3c2('0x8')](_0xd3c2('0x10'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x11')]);router[_0xd3c2('0x8')](_0xd3c2('0x12'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x13')]);router[_0xd3c2('0x8')](_0xd3c2('0x14'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x15')]);router[_0xd3c2('0x16')]('/',auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x17')]);router['post'](_0xd3c2('0x18'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x19')]);router[_0xd3c2('0x16')](_0xd3c2('0xe'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x1a')]);router[_0xd3c2('0x16')](_0xd3c2('0x1b'),controller[_0xd3c2('0x1c')]);router[_0xd3c2('0x16')](_0xd3c2('0x10'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x1d')]);router['post'](_0xd3c2('0x14'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x1e')]);router[_0xd3c2('0x16')]('/:id/send',auth[_0xd3c2('0x9')](),controller['send']);router[_0xd3c2('0x1f')](_0xd3c2('0x20'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x21')]);router[_0xd3c2('0x22')](_0xd3c2('0x20'),auth['isAuthenticated'](),controller['destroy']);router[_0xd3c2('0x22')](_0xd3c2('0x18'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xd3c2('0xe'),auth[_0xd3c2('0x9')](),controller[_0xd3c2('0x23')]);router[_0xd3c2('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0xd3c2('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index af96882..3682f28 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 _0xdcbd=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x1d483e,_0x25818f){var _0x3969a3=function(_0x3c3d81){while(--_0x3c3d81){_0x1d483e['push'](_0x1d483e['shift']());}};_0x3969a3(++_0x25818f);}(_0xdcbd,0xb6));var _0xddcb=function(_0x4784f4,_0x199217){_0x4784f4=_0x4784f4-0x0;var _0x1fb0ce=_0xdcbd[_0x4784f4];return _0x1fb0ce;};'use strict';var Sequelize=require(_0xddcb('0x0'));var rs=require('randomstring');module[_0xddcb('0x1')]={'name':{'type':Sequelize[_0xddcb('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xddcb('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xddcb('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xddcb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xddcb('0x3')],'defaultValue':function(){return _0xddcb('0x4');}},'notificationSound':{'type':Sequelize[_0xddcb('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xddcb('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xddcb('0x2')]},'queueTransfer':{'type':Sequelize[_0xddcb('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xddcb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xddcb('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xddcb('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xddcb('0x5')],'defaultValue':![],'comment':_0xddcb('0x8'),'set':function(_0x3f848f){if(!_0x3f848f)this[_0xddcb('0x9')](_0xddcb('0xa'),null);this[_0xddcb('0x9')]('mandatoryDisposition',_0x3f848f);}}}; \ No newline at end of file +var _0x9ec0=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','TEXT','BOOLEAN'];(function(_0x1535b8,_0x2616af){var _0x1dbcea=function(_0x19d74e){while(--_0x19d74e){_0x1535b8['push'](_0x1535b8['shift']());}};_0x1dbcea(++_0x2616af);}(_0x9ec0,0x90));var _0x09ec=function(_0x55cc6a,_0x5dbd65){_0x55cc6a=_0x55cc6a-0x0;var _0x26e2cd=_0x9ec0[_0x55cc6a];return _0x26e2cd;};'use strict';var Sequelize=require(_0x09ec('0x0'));var rs=require('randomstring');module[_0x09ec('0x1')]={'name':{'type':Sequelize[_0x09ec('0x2')],'unique':_0x09ec('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x09ec('0x2')]},'token':{'type':Sequelize[_0x09ec('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x09ec('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x09ec('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x09ec('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x09ec('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x09ec('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x09ec('0x2')]},'queueTransfer':{'type':Sequelize[_0x09ec('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09ec('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x09ec('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x09ec('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09ec('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x09ec('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x09ec('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x44846e){if(!_0x44846e)this[_0x09ec('0x8')]('mandatoryDispositionPauseId',null);this[_0x09ec('0x8')](_0x09ec('0x9'),_0x44846e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 62c8e83..3906480 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 _0x4c59=['name','index','Pause','mandatoryDispositionPause','rawAttributes','keys','query','filters','intersection','model','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','Applications','List','list','applications','orderBy','priority','account','Contacts','ListId','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','dataValues','Messages','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','defaults','redis','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0x4c59,0x80));var _0x94c5=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x4c59[_0x30f87a];return _0x3a8efc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x94c5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94c5('0x1'));var rp=require(_0x94c5('0x2'));var moment=require(_0x94c5('0x3'));var BPromise=require(_0x94c5('0x4'));var Mustache=require(_0x94c5('0x5'));var util=require(_0x94c5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x94c5('0x7'));var ejs=require(_0x94c5('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x94c5('0x9'));var crypto=require(_0x94c5('0xa'));var jsforce=require(_0x94c5('0xb'));var deskjs=require(_0x94c5('0xc'));var toCsv=require(_0x94c5('0x7'));var querystring=require('querystring');var Papa=require(_0x94c5('0xd'));var Redis=require(_0x94c5('0xe'));var authService=require(_0x94c5('0xf'));var qs=require(_0x94c5('0x10'));var hardwareService=require(_0x94c5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x94c5('0x12'));var config=require(_0x94c5('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x94c5('0x14')](config[_0x94c5('0x15')],{'host':_0x94c5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94c5('0x15')]));require(_0x94c5('0x17'))[_0x94c5('0x18')](socket);var jayson=require(_0x94c5('0x19'));var client=jayson['client'][_0x94c5('0x1a')]({'port':0x232c});var client9002=jayson[_0x94c5('0x1b')][_0x94c5('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2a2442,_0x115172,_0x20a22e){if(_0x20a22e){var _0x3431a6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3431a6['test'](_0x115172)){return _0x2a2442;}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 _0x2a2442;}}function respondWithRpcPromise(_0x5d1a94,_0x4ad28d,_0x385022,_0x4864c4){return new BPromise(function(_0x515fc1,_0x50f1ac){var _0x43e994=_0x4864c4||client;return _0x43e994[_0x94c5('0x1c')](_0x5d1a94,_0x385022)[_0x94c5('0x1d')](function(_0x48f268){logger[_0x94c5('0x1e')](_0x94c5('0x1f'),_0x4ad28d,_0x94c5('0x20'));logger[_0x94c5('0x21')](_0x94c5('0x22'),_0x4ad28d,_0x94c5('0x20'),JSON[_0x94c5('0x23')](_0x48f268));if(_0x48f268['error']){if(_0x48f268['error']['code']===0x1f4){logger[_0x94c5('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ad28d,_0x48f268[_0x94c5('0x24')]['message']);return _0x50f1ac(_0x48f268[_0x94c5('0x24')][_0x94c5('0x25')]);}logger[_0x94c5('0x24')](_0x94c5('0x1f'),_0x4ad28d,_0x48f268[_0x94c5('0x24')][_0x94c5('0x25')]);return _0x515fc1(_0x48f268[_0x94c5('0x24')][_0x94c5('0x25')]);}else{logger[_0x94c5('0x1e')](_0x94c5('0x1f'),_0x4ad28d,_0x94c5('0x20'));_0x515fc1(_0x48f268[_0x94c5('0x26')][_0x94c5('0x25')]);}})[_0x94c5('0x27')](function(_0x4c792f){logger[_0x94c5('0x24')](_0x94c5('0x1f'),_0x4ad28d,_0x4c792f);_0x50f1ac(_0x4c792f);});});}function respondWithStatusCode(_0x2ebdec,_0x1ccb33){_0x1ccb33=_0x1ccb33||0xcc;return function(_0x4cf85d){if(_0x4cf85d){return _0x2ebdec[_0x94c5('0x28')](_0x1ccb33);}return _0x2ebdec[_0x94c5('0x29')](_0x1ccb33)[_0x94c5('0x2a')]();};}function respondWithResult(_0x25e9e3,_0x509230){_0x509230=_0x509230||0xc8;return function(_0x546501){if(_0x546501){return _0x25e9e3['status'](_0x509230)['json'](_0x546501);}};}function respondWithFilteredResult(_0x23c2e2,_0x10888c){return function(_0x139936){if(_0x139936){var _0x564a7d=_0x139936[_0x94c5('0x2b')],_0x3ea42b=_0x10888c[_0x94c5('0x2c')],_0x28e5d0=_0x10888c[_0x94c5('0x2c')]+_0x10888c['limit'],_0xb7f58c;if(_0x28e5d0>=_0x564a7d){_0x28e5d0=_0x564a7d;_0xb7f58c=0xc8;}else{_0xb7f58c=0xce;}_0x23c2e2['status'](_0xb7f58c);return _0x23c2e2[_0x94c5('0x2d')](_0x94c5('0x2e'),_0x3ea42b+'-'+_0x28e5d0+'/'+_0x564a7d)[_0x94c5('0x2f')](_0x139936);}return null;};}function patchUpdates(_0x38ae36){return function(_0x3d998f){try{jsonpatch['apply'](_0x3d998f,_0x38ae36,!![]);}catch(_0x5028b0){return BPromise[_0x94c5('0x30')](_0x5028b0);}return _0x3d998f[_0x94c5('0x31')]();};}function saveUpdates(_0x25a061,_0xa32f86){return function(_0x3e774c){if(_0x3e774c){return _0x3e774c['update'](_0x25a061)['then'](function(_0x36f687){return _0x36f687;});}return null;};}function removeEntity(_0x10958f,_0x3eb10c){return function(_0x2ed94f){if(_0x2ed94f){return _0x2ed94f[_0x94c5('0x32')]()['then'](function(){var _0x18e977=_0x2ed94f[_0x94c5('0x33')]({'plain':!![]});var _0x173a08=_0x94c5('0x34');return db[_0x94c5('0x35')][_0x94c5('0x32')]({'where':{'type':_0x173a08,'resourceId':_0x18e977['id']}})['then'](function(){return _0x2ed94f;});})[_0x94c5('0x1d')](function(){_0x10958f[_0x94c5('0x29')](0xcc)[_0x94c5('0x2a')]();});}};}function handleEntityNotFound(_0x165266,_0x36f448){return function(_0x3189e1){if(!_0x3189e1){_0x165266[_0x94c5('0x28')](0x194);}return _0x3189e1;};}function handleError(_0x37d37a,_0x329325){_0x329325=_0x329325||0x1f4;return function(_0x583d86){logger['error'](_0x583d86[_0x94c5('0x36')]);if(_0x583d86[_0x94c5('0x37')]){delete _0x583d86[_0x94c5('0x37')];}_0x37d37a['status'](_0x329325)['send'](_0x583d86);};}exports[_0x94c5('0x38')]=function(_0x4abafb,_0x553be6){var _0x519ee6={'include':[{'model':db[_0x94c5('0x39')],'as':_0x94c5('0x3a')}]},_0x25559d={},_0x16f54a={'count':0x0,'rows':[]};var _0x55ce9a=db['OpenchannelAccount'][_0x94c5('0x3b')];_0x25559d['model']=_[_0x94c5('0x3c')](_0x55ce9a);_0x25559d[_0x94c5('0x3d')]=_['keys'](_0x4abafb[_0x94c5('0x3d')]);_0x25559d[_0x94c5('0x3e')]=_[_0x94c5('0x3f')](_0x25559d[_0x94c5('0x40')],_0x25559d[_0x94c5('0x3d')]);_0x519ee6[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x25559d[_0x94c5('0x40')],qs['fields'](_0x4abafb['query']['fields']));_0x519ee6[_0x94c5('0x41')]=_0x519ee6[_0x94c5('0x41')][_0x94c5('0x42')]?_0x519ee6['attributes']:_0x25559d[_0x94c5('0x40')];if(!_0x4abafb[_0x94c5('0x3d')]['hasOwnProperty'](_0x94c5('0x43'))){_0x519ee6['limit']=qs[_0x94c5('0x44')](_0x4abafb[_0x94c5('0x3d')][_0x94c5('0x44')]);_0x519ee6[_0x94c5('0x2c')]=qs[_0x94c5('0x2c')](_0x4abafb[_0x94c5('0x3d')][_0x94c5('0x2c')]);}_0x519ee6[_0x94c5('0x45')]=qs[_0x94c5('0x46')](_0x4abafb['query'][_0x94c5('0x46')]);_0x519ee6['where']=qs['filters'](_[_0x94c5('0x47')](_0x4abafb[_0x94c5('0x3d')],_0x25559d[_0x94c5('0x3e')]));if(_0x4abafb[_0x94c5('0x3d')][_0x94c5('0x48')]){_0x519ee6[_0x94c5('0x49')]=_[_0x94c5('0x4a')](_0x519ee6[_0x94c5('0x49')],{'$or':_[_0x94c5('0x4b')](_0x55ce9a,function(_0x3c95a7){if(_0x3c95a7[_0x94c5('0x4c')][_0x94c5('0x4d')]!==_0x94c5('0x4e')){var _0x703c1d={};_0x703c1d[_0x3c95a7[_0x94c5('0x4f')]]={'$like':'%'+_0x4abafb[_0x94c5('0x3d')][_0x94c5('0x48')]+'%'};return _0x703c1d;}})});}_0x519ee6=_[_0x94c5('0x4a')]({},_0x519ee6,_0x4abafb[_0x94c5('0x50')]);var _0x295cd8={'where':_0x519ee6[_0x94c5('0x49')]};return db[_0x94c5('0x51')][_0x94c5('0x2b')](_0x295cd8)['then'](function(_0x313711){_0x16f54a[_0x94c5('0x2b')]=_0x313711;if(_0x4abafb[_0x94c5('0x3d')][_0x94c5('0x52')]){_0x519ee6[_0x94c5('0x53')]=[{'all':!![]}];}return db[_0x94c5('0x51')][_0x94c5('0x54')](_0x519ee6);})[_0x94c5('0x1d')](function(_0x52f4e1){_0x16f54a[_0x94c5('0x55')]=_0x52f4e1;return _0x16f54a;})[_0x94c5('0x1d')](respondWithFilteredResult(_0x553be6,_0x519ee6))[_0x94c5('0x27')](handleError(_0x553be6,null));};exports[_0x94c5('0x56')]=function(_0x5624be,_0x22ca8e){var _0x124b0c={'raw':![],'where':{'id':_0x5624be[_0x94c5('0x57')]['id']},'include':[{'model':db[_0x94c5('0x39')],'as':'mandatoryDispositionPause'}]},_0x358957={};_0x358957[_0x94c5('0x40')]=_[_0x94c5('0x3c')](db[_0x94c5('0x51')][_0x94c5('0x3b')]);_0x358957[_0x94c5('0x3d')]=_[_0x94c5('0x3c')](_0x5624be[_0x94c5('0x3d')]);_0x358957[_0x94c5('0x3e')]=_['intersection'](_0x358957[_0x94c5('0x40')],_0x358957[_0x94c5('0x3d')]);_0x124b0c[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x358957[_0x94c5('0x40')],qs[_0x94c5('0x58')](_0x5624be['query']['fields']));_0x124b0c[_0x94c5('0x41')]=_0x124b0c[_0x94c5('0x41')]['length']?_0x124b0c[_0x94c5('0x41')]:_0x358957[_0x94c5('0x40')];if(_0x5624be[_0x94c5('0x3d')][_0x94c5('0x52')]){_0x124b0c[_0x94c5('0x53')]=[{'all':!![]}];}_0x124b0c=_['merge']({},_0x124b0c,_0x5624be[_0x94c5('0x50')]);return db[_0x94c5('0x51')][_0x94c5('0x59')](_0x124b0c)[_0x94c5('0x1d')](handleEntityNotFound(_0x22ca8e,null))[_0x94c5('0x1d')](respondWithResult(_0x22ca8e,null))[_0x94c5('0x27')](handleError(_0x22ca8e,null));};exports['create']=function(_0x2847ed,_0x594baf){return db[_0x94c5('0x51')][_0x94c5('0x5a')](_0x2847ed[_0x94c5('0x5b')],{})[_0x94c5('0x1d')](function(_0x4d0e18){var _0x3e5613=_0x2847ed[_0x94c5('0x5c')][_0x94c5('0x33')]({'plain':!![]});if(!_0x3e5613)throw new Error(_0x94c5('0x5d'));if(_0x3e5613[_0x94c5('0x5e')]===_0x94c5('0x5c')){var _0x3f9c21=_0x4d0e18[_0x94c5('0x33')]({'plain':!![]});var _0x231985=_0x94c5('0x34');return db[_0x94c5('0x5f')][_0x94c5('0x59')]({'where':{'name':_0x231985,'userProfileId':_0x3e5613[_0x94c5('0x60')]},'raw':!![]})['then'](function(_0x156f0a){if(_0x156f0a&&_0x156f0a['autoAssociation']===0x0){return db[_0x94c5('0x35')][_0x94c5('0x5a')]({'name':_0x3f9c21[_0x94c5('0x37')],'resourceId':_0x3f9c21['id'],'type':_0x156f0a[_0x94c5('0x37')],'sectionId':_0x156f0a['id']},{})[_0x94c5('0x1d')](function(){return _0x4d0e18;});}else{return _0x4d0e18;}})['catch'](function(_0x279863){logger[_0x94c5('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x279863);throw _0x279863;});}return _0x4d0e18;})[_0x94c5('0x1d')](respondWithResult(_0x594baf,0xc9))['catch'](handleError(_0x594baf,null));};exports[_0x94c5('0x61')]=function(_0x1a42f3,_0x132113){if(_0x1a42f3[_0x94c5('0x5b')]['id']){delete _0x1a42f3[_0x94c5('0x5b')]['id'];}return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0x1a42f3[_0x94c5('0x57')]['id']},'include':[{'model':db[_0x94c5('0x39')],'as':_0x94c5('0x3a')}]})[_0x94c5('0x1d')](handleEntityNotFound(_0x132113,null))['then'](saveUpdates(_0x1a42f3[_0x94c5('0x5b')],null))[_0x94c5('0x1d')](respondWithResult(_0x132113,null))['catch'](handleError(_0x132113,null));};exports[_0x94c5('0x32')]=function(_0x2cd47b,_0x5e6060){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0x2cd47b[_0x94c5('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e6060,null))['then'](removeEntity(_0x5e6060,null))['catch'](handleError(_0x5e6060,null));};exports[_0x94c5('0x62')]=function(_0x9e95a,_0x5e9c4b){return db[_0x94c5('0x51')][_0x94c5('0x62')]()[_0x94c5('0x1d')](respondWithResult(_0x5e9c4b,null))[_0x94c5('0x27')](handleError(_0x5e9c4b,null));};exports[_0x94c5('0x63')]=function(_0x1080d7,_0x1c749f,_0x377930){if(_0x1080d7[_0x94c5('0x5b')]['id']){delete _0x1080d7['body']['id'];}return db[_0x94c5('0x51')]['find']({'where':{'id':_0x1080d7[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x1c749f,null))[_0x94c5('0x1d')](function(_0x5b0ebc){if(_0x5b0ebc){_0x1080d7[_0x94c5('0x5b')][_0x94c5('0x64')]=_0x5b0ebc['id'];return db['Disposition']['create'](_0x1080d7['body']);}})[_0x94c5('0x1d')](respondWithResult(_0x1c749f,null))[_0x94c5('0x27')](handleError(_0x1c749f,null));};exports[_0x94c5('0x65')]=function(_0xa3bc4f,_0x33f839,_0x67583){var _0x3f7fd8={'raw':![],'where':{}};var _0x191c98={};var _0x584950={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x94c5('0x66')]({'where':{'id':_0xa3bc4f[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x33f839,null))[_0x94c5('0x1d')](function(_0x390a72){if(_0x390a72){_0x191c98[_0x94c5('0x40')]=_[_0x94c5('0x3c')](db[_0x94c5('0x67')][_0x94c5('0x3b')]);_0x191c98['query']=_[_0x94c5('0x3c')](_0xa3bc4f[_0x94c5('0x3d')]);_0x191c98['filters']=_[_0x94c5('0x3f')](_0x191c98[_0x94c5('0x40')],_0x191c98[_0x94c5('0x3d')]);_0x3f7fd8[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x191c98['model'],qs[_0x94c5('0x58')](_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x58')]));_0x3f7fd8[_0x94c5('0x41')]=_0x3f7fd8['attributes'][_0x94c5('0x42')]?_0x3f7fd8[_0x94c5('0x41')]:_0x191c98['model'];if(!_0xa3bc4f['query'][_0x94c5('0x68')]('nolimit')){_0x3f7fd8['limit']=qs['limit'](_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x44')]);_0x3f7fd8[_0x94c5('0x2c')]=qs[_0x94c5('0x2c')](_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x2c')]);}_0x3f7fd8[_0x94c5('0x45')]=qs[_0x94c5('0x46')](_0xa3bc4f['query'][_0x94c5('0x46')]);_0x3f7fd8['where']=qs[_0x94c5('0x3e')](_[_0x94c5('0x47')](_0xa3bc4f[_0x94c5('0x3d')],_0x191c98['filters']));_0x3f7fd8[_0x94c5('0x49')]['OpenchannelAccountId']=_0x390a72['id'];if(_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x48')]){_0x3f7fd8[_0x94c5('0x49')]=_['merge'](_0x3f7fd8[_0x94c5('0x49')],{'$or':_[_0x94c5('0x4b')](_0x3f7fd8['attributes'],function(_0x1f18e4){var _0x13b54d={};_0x13b54d[_0x1f18e4]={'$like':'%'+_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x48')]+'%'};return _0x13b54d;})});}_0x3f7fd8=_['merge']({},_0x3f7fd8,_0xa3bc4f[_0x94c5('0x50')]);return db[_0x94c5('0x67')][_0x94c5('0x2b')]({'where':_0x3f7fd8[_0x94c5('0x49')]})[_0x94c5('0x1d')](function(_0x553844){_0x584950[_0x94c5('0x2b')]=_0x553844;if(_0xa3bc4f[_0x94c5('0x3d')][_0x94c5('0x52')]){_0x3f7fd8[_0x94c5('0x53')]=[{'all':!![]}];}return db[_0x94c5('0x67')]['findAll'](_0x3f7fd8);})[_0x94c5('0x1d')](function(_0x3b287c){_0x584950[_0x94c5('0x55')]=_0x3b287c;return _0x584950;});}})[_0x94c5('0x1d')](respondWithFilteredResult(_0x33f839,_0x3f7fd8))[_0x94c5('0x27')](handleError(_0x33f839,null));};exports[_0x94c5('0x69')]=function(_0xe3d534,_0x37a503,_0x6320e5){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0xe3d534[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x37a503,null))['then'](function(_0x4dd0cc){if(_0x4dd0cc){return _0x4dd0cc[_0x94c5('0x69')](_0xe3d534[_0x94c5('0x3d')][_0x94c5('0x6a')]);}})['then'](respondWithStatusCode(_0x37a503,null))[_0x94c5('0x27')](handleError(_0x37a503,null));};exports['addAnswer']=function(_0x551e6f,_0x239d49,_0x2c279b){if(_0x551e6f['body']['id']){delete _0x551e6f[_0x94c5('0x5b')]['id'];}return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0x551e6f[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x239d49,null))['then'](function(_0x28c4ee){if(_0x28c4ee){_0x551e6f[_0x94c5('0x5b')][_0x94c5('0x6b')]=_0x28c4ee['id'];return db[_0x94c5('0x6c')][_0x94c5('0x5a')](_0x551e6f[_0x94c5('0x5b')]);}})[_0x94c5('0x1d')](respondWithResult(_0x239d49,null))[_0x94c5('0x27')](handleError(_0x239d49,null));};exports[_0x94c5('0x6d')]=function(_0x19997a,_0x4ebead,_0x424bec){var _0x21e04b={'raw':![],'where':{}};var _0x58d09b={};var _0x24738a={'count':0x0,'rows':[]};return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x19997a['params']['id']}})['then'](handleEntityNotFound(_0x4ebead,null))[_0x94c5('0x1d')](function(_0x209d39){if(_0x209d39){_0x58d09b[_0x94c5('0x40')]=_['keys'](db['CannedAnswer'][_0x94c5('0x3b')]);_0x58d09b[_0x94c5('0x3d')]=_[_0x94c5('0x3c')](_0x19997a[_0x94c5('0x3d')]);_0x58d09b[_0x94c5('0x3e')]=_[_0x94c5('0x3f')](_0x58d09b[_0x94c5('0x40')],_0x58d09b['query']);_0x21e04b[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x58d09b[_0x94c5('0x40')],qs[_0x94c5('0x58')](_0x19997a['query']['fields']));_0x21e04b[_0x94c5('0x41')]=_0x21e04b[_0x94c5('0x41')][_0x94c5('0x42')]?_0x21e04b['attributes']:_0x58d09b[_0x94c5('0x40')];if(!_0x19997a[_0x94c5('0x3d')][_0x94c5('0x68')]('nolimit')){_0x21e04b[_0x94c5('0x44')]=qs[_0x94c5('0x44')](_0x19997a['query'][_0x94c5('0x44')]);_0x21e04b['offset']=qs[_0x94c5('0x2c')](_0x19997a[_0x94c5('0x3d')][_0x94c5('0x2c')]);}_0x21e04b[_0x94c5('0x45')]=qs[_0x94c5('0x46')](_0x19997a[_0x94c5('0x3d')]['sort']);_0x21e04b[_0x94c5('0x49')]=qs[_0x94c5('0x3e')](_[_0x94c5('0x47')](_0x19997a[_0x94c5('0x3d')],_0x58d09b[_0x94c5('0x3e')]));_0x21e04b[_0x94c5('0x49')]['OpenchannelAccountId']=_0x209d39['id'];if(_0x19997a[_0x94c5('0x3d')][_0x94c5('0x48')]){_0x21e04b[_0x94c5('0x49')]=_[_0x94c5('0x4a')](_0x21e04b['where'],{'$or':_[_0x94c5('0x4b')](_0x21e04b[_0x94c5('0x41')],function(_0x5ca071){var _0xb39487={};_0xb39487[_0x5ca071]={'$like':'%'+_0x19997a[_0x94c5('0x3d')]['filter']+'%'};return _0xb39487;})});}_0x21e04b=_['merge']({},_0x21e04b,_0x19997a[_0x94c5('0x50')]);return db['CannedAnswer'][_0x94c5('0x2b')]({'where':_0x21e04b['where']})[_0x94c5('0x1d')](function(_0x706915){_0x24738a[_0x94c5('0x2b')]=_0x706915;if(_0x19997a['query']['includeAll']){_0x21e04b[_0x94c5('0x53')]=[{'all':!![]}];}return db[_0x94c5('0x6c')][_0x94c5('0x54')](_0x21e04b);})[_0x94c5('0x1d')](function(_0x5ac9a2){_0x24738a[_0x94c5('0x55')]=_0x5ac9a2;return _0x24738a;});}})['then'](respondWithFilteredResult(_0x4ebead,_0x21e04b))[_0x94c5('0x27')](handleError(_0x4ebead,null));};exports[_0x94c5('0x6e')]=function(_0xae92a2,_0x5bb4e3,_0x12e673){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0xae92a2[_0x94c5('0x57')]['id']}})['then'](handleEntityNotFound(_0x5bb4e3,null))['then'](function(_0x74d341){if(_0x74d341){return _0x74d341[_0x94c5('0x6e')](_0xae92a2[_0x94c5('0x3d')]['ids']);}})[_0x94c5('0x1d')](respondWithStatusCode(_0x5bb4e3,null))[_0x94c5('0x27')](handleError(_0x5bb4e3,null));};exports['notify']=function(_0x568c1e,_0x5a9526,_0x3ecc88){var _0xcca07={'body':_0x568c1e[_0x94c5('0x5b')],'channel':_0x94c5('0x6f')};var _0x17df48=[];var _0x12a6d2=[];var _0x2269a3={};var _0x1f73e0=![];return db[_0x94c5('0x70')]['describe']()[_0x94c5('0x1d')](function(_0x74961c){if(!_0x74961c){throw new db[(_0x94c5('0x71'))][(_0x94c5('0x72'))](_0x94c5('0x73'));}_0x17df48=_[_0x94c5('0x74')](_[_0x94c5('0x3c')](_0x74961c),[_0x94c5('0x75'),'updatedAt']);_0x12a6d2=_[_0x94c5('0x74')](_[_0x94c5('0x3c')](_0x74961c),[_0x94c5('0x75'),_0x94c5('0x76'),_0x94c5('0x77'),'ListId']);if(_0x568c1e[_0x94c5('0x5b')]['id']){delete _0x568c1e[_0x94c5('0x5b')]['id'];}if(_[_0x94c5('0x78')](_0x568c1e['body'][_0x94c5('0x79')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x94c5('0x78')](_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x5b')])||_0x568c1e[_0x94c5('0x5b')]['body']===''){throw new db[(_0x94c5('0x71'))]['ValidationError'](_0x94c5('0x7a'));}if(_['isNil'](_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x7b')])){throw new db['Sequelize'][(_0x94c5('0x72'))](_0x94c5('0x7c')+_0x12a6d2);}if(!_[_0x94c5('0x7d')](_0x12a6d2,_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x7b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12a6d2);}_0x2269a3[_0x568c1e[_0x94c5('0x5b')]['mapKey']]=_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x79')];})[_0x94c5('0x1d')](function(){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0x568c1e[_0x94c5('0x57')]['id']},'include':[{'model':db[_0x94c5('0x7e')],'as':'List','include':[{'model':db[_0x94c5('0x70')],'as':'Contacts','where':_0x2269a3,'limit':0x1,'order':[[_0x94c5('0x76'),_0x94c5('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0x94c5('0x80')}]});})[_0x94c5('0x1d')](handleEntityNotFound(_0x5a9526,null))[_0x94c5('0x1d')](function(_0x6fb04d){if(_0x6fb04d&&_0x6fb04d[_0x94c5('0x81')]){_0xcca07['account']=_0x6fb04d;_0xcca07['applications']=_0x6fb04d[_0x94c5('0x80')];_0xcca07[_0x94c5('0x82')]=_0x6fb04d[_0x94c5('0x81')];_0xcca07[_0x94c5('0x83')]=_[_0x94c5('0x84')](_0xcca07[_0x94c5('0x83')],[_0x94c5('0x85')],['asc']);if(_0xcca07[_0x94c5('0x86')][_0x94c5('0x80')]){delete _0xcca07[_0x94c5('0x86')]['Applications'];}if(_0xcca07[_0x94c5('0x86')]['List']&&_0xcca07['account']['List'][_0x94c5('0x87')]['length']){return _0xcca07[_0x94c5('0x86')][_0x94c5('0x81')][_0x94c5('0x87')][0x0];}var _0xa0e9cf=_[_0x94c5('0x14')](_0x568c1e[_0x94c5('0x5b')],{'firstName':_0x568c1e[_0x94c5('0x5b')]['from'],'ListId':_0x6fb04d[_0x94c5('0x88')]});_0xa0e9cf[_0x568c1e['body'][_0x94c5('0x7b')]]=_0x568c1e[_0x94c5('0x5b')]['from'];return db[_0x94c5('0x70')][_0x94c5('0x5a')](_0xa0e9cf,{'fields':_0x17df48,'raw':!![]});}})[_0x94c5('0x1d')](handleEntityNotFound(_0x5a9526,null))[_0x94c5('0x1d')](function(_0x1f39e4){_0xcca07['contact']=_0x1f39e4;if(_0x1f39e4){var _0x2c0ebb={'ContactId':_0x1f39e4['id'],'OpenchannelAccountId':_0x568c1e[_0x94c5('0x57')]['id'],'from':(_0x1f39e4['firstName']||'')+'\x20'+(_0x1f39e4[_0x94c5('0x89')]||'')};var _0x36c796={'OpenchannelAccountId':_0x568c1e[_0x94c5('0x57')]['id'],'closed':![]};if(_0x568c1e['body'][_0x94c5('0x8a')]){_0x36c796[_0x94c5('0x8a')]=_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x8a')];return db['OpenchannelInteraction'][_0x94c5('0x59')]({'where':_0x36c796})[_0x94c5('0x1d')](function(_0x235e3a){if(_0x235e3a){return[_0x235e3a,![]];}_0x2c0ebb[_0x94c5('0x8a')]=_0x568c1e[_0x94c5('0x5b')]['threadId'];_0x2c0ebb[_0x94c5('0x8b')]=_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x8b')];return db[_0x94c5('0x8c')][_0x94c5('0x5a')](_0x2c0ebb)['then'](function(_0x4adc68){return[_0x4adc68,!![]];});});}else{_0x36c796[_0x94c5('0x8a')]=null;}_0x36c796['ContactId']=_0x1f39e4['id'];return db[_0x94c5('0x8c')][_0x94c5('0x59')]({'where':_0x36c796})['then'](function(_0x26495d){if(_0x26495d){return[_0x26495d,![]];}return db[_0x94c5('0x8c')][_0x94c5('0x5a')](_0x2c0ebb)[_0x94c5('0x1d')](function(_0x361593){return[_0x361593,!![]];});});}})[_0x94c5('0x8d')](function(_0x44dee1,_0x4aac5e){if(_0x44dee1){_0x1f73e0=_0x4aac5e;if(!_0x4aac5e){var _0x1f76b6={'from':(_0xcca07[_0x94c5('0x8e')]['firstName']||'')+'\x20'+(_0xcca07[_0x94c5('0x8e')][_0x94c5('0x89')]||'')};if(_0x568c1e['body'][_0x94c5('0x8a')]&&_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x8f')]&&_0x568c1e[_0x94c5('0x5b')]['threadId']!=_0x568c1e['body'][_0x94c5('0x8f')]){_0x1f76b6[_0x94c5('0x8a')]=_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x8f')];}return _0x44dee1['update'](_0x1f76b6);}else{return _0x44dee1;}}})[_0x94c5('0x1d')](function(_0x584de4){_0xcca07[_0x94c5('0x90')]=_0x584de4[_0x94c5('0x33')]({'plain':!![]});_0xcca07[_0x94c5('0x90')][_0x94c5('0x91')]=_0x1f73e0;if(_0xcca07['interaction'][_0x94c5('0x91')]){if(_0xcca07[_0x94c5('0x86')][_0x94c5('0x92')]){_0xcca07['applications']['push']({'id':0x0,'priority':_0xcca07['applications'][_0x94c5('0x42')]+0x1,'app':_0x94c5('0x93'),'appdata':_0x94c5('0x94'),'interval':_0x94c5('0x95')});}}return db['OpenchannelMessage'][_0x94c5('0x5a')]({'body':_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x5b')],'OpenchannelAccountId':_0x568c1e['params']['id'],'OpenchannelInteractionId':_0x584de4['id'],'direction':'in','ContactId':_0xcca07[_0x94c5('0x8e')]['id'],'AttachmentId':_0x568c1e[_0x94c5('0x5b')][_0x94c5('0x96')]});})[_0x94c5('0x1d')](function(_0x71d75b){_0xcca07[_0x94c5('0x25')]=_0x71d75b;if(_0xcca07['interaction']['UserId']){return db[_0x94c5('0x97')][_0x94c5('0x59')]({'attributes':['id',_0x94c5('0x37')],'where':{'id':_0xcca07[_0x94c5('0x90')][_0x94c5('0x98')]}})[_0x94c5('0x1d')](function(_0x4fd220){if(_0x4fd220){_0xcca07[_0x94c5('0x83')]['unshift']({'id':0x0,'priority':0x0,'app':_0x94c5('0x99'),'appdata':_0x4fd220[_0x94c5('0x37')]+','+(_0xcca07[_0x94c5('0x86')][_0x94c5('0x9a')]||0xa),'interval':_0x94c5('0x95')});_0xcca07[_0x94c5('0x9b')]=![];}return respondWithRpcPromise(_0x94c5('0x9c'),_0x94c5('0x9d'),_0xcca07);});}return respondWithRpcPromise(_0x94c5('0x9c'),_0x94c5('0x9d'),_0xcca07);})[_0x94c5('0x1d')](function(_0x52a47c){respondWithRpcPromise('EventManager',_0x94c5('0x9e'),{'event':_0x94c5('0x9f'),'message':_0x52a47c},client9002);return _0x52a47c;})[_0x94c5('0x1d')](respondWithResult(_0x5a9526,null))[_0x94c5('0x27')](handleError(_0x5a9526,null));};exports['addApplications']=function(_0x36f7e6,_0x300ac9,_0xc3205b){return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x36f7e6[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x300ac9,null))['then'](function(_0x1f6626){if(_0x1f6626){return db['sequelize'][_0x94c5('0xa0')](function(_0x4a66bc){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x36f7e6[_0x94c5('0x57')]['id']},'transaction':_0x4a66bc})[_0x94c5('0x1d')](function(_0x530714){var _0x2504fe=_[_0x94c5('0x4b')](_0x36f7e6[_0x94c5('0x5b')],function(_0x27daa5){_0x27daa5[_0x94c5('0x6b')]=_0x36f7e6['params']['id'];return _0x27daa5;});return db[_0x94c5('0xa1')][_0x94c5('0xa2')](_0x2504fe,{'transaction':_0x4a66bc});});})['then'](function(){return db[_0x94c5('0xa1')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x36f7e6['params']['id']},'order':_0x94c5('0x85')});});}})[_0x94c5('0x1d')](respondWithResult(_0x300ac9,null))[_0x94c5('0x27')](handleError(_0x300ac9,null));};exports[_0x94c5('0xa3')]=function(_0x46eb3d,_0x31878e,_0x10eb8a){var _0x26902c={};var _0x2eb5ef={};var _0x1a3033;var _0x40a39f;return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x46eb3d['params']['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x31878e,null))[_0x94c5('0x1d')](function(_0x1d6805){if(_0x1d6805){_0x1a3033=_0x1d6805;_0x2eb5ef[_0x94c5('0x40')]=_['keys'](db[_0x94c5('0xa1')]['rawAttributes']);_0x2eb5ef[_0x94c5('0x3d')]=_[_0x94c5('0x3c')](_0x46eb3d[_0x94c5('0x3d')]);_0x2eb5ef[_0x94c5('0x3e')]=_['intersection'](_0x2eb5ef['model'],_0x2eb5ef[_0x94c5('0x3d')]);_0x26902c[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x2eb5ef[_0x94c5('0x40')],qs[_0x94c5('0x58')](_0x46eb3d[_0x94c5('0x3d')][_0x94c5('0x58')]));_0x26902c[_0x94c5('0x41')]=_0x26902c['attributes']['length']?_0x26902c[_0x94c5('0x41')]:_0x2eb5ef[_0x94c5('0x40')];_0x26902c[_0x94c5('0x45')]=qs[_0x94c5('0x46')](_0x46eb3d[_0x94c5('0x3d')][_0x94c5('0x46')]);_0x26902c['where']=qs[_0x94c5('0x3e')](_['pick'](_0x46eb3d[_0x94c5('0x3d')],_0x2eb5ef[_0x94c5('0x3e')]));if(_0x46eb3d['query'][_0x94c5('0x48')]){_0x26902c[_0x94c5('0x49')]=_[_0x94c5('0x4a')](_0x26902c[_0x94c5('0x49')],{'$or':_[_0x94c5('0x4b')](_0x26902c[_0x94c5('0x41')],function(_0x2a0b78){var _0x419dae={};_0x419dae[_0x2a0b78]={'$like':'%'+_0x46eb3d[_0x94c5('0x3d')]['filter']+'%'};return _0x419dae;})});}_0x26902c=_[_0x94c5('0x4a')]({},_0x26902c,_0x46eb3d[_0x94c5('0x50')]);return _0x1a3033[_0x94c5('0xa3')](_0x26902c);}})[_0x94c5('0x1d')](function(_0x59197e){if(_0x59197e){_0x40a39f=_0x59197e[_0x94c5('0x42')];if(!_0x46eb3d['query'][_0x94c5('0x68')](_0x94c5('0x43'))){_0x26902c['limit']=qs[_0x94c5('0x44')](_0x46eb3d[_0x94c5('0x3d')][_0x94c5('0x44')]);_0x26902c[_0x94c5('0x2c')]=qs[_0x94c5('0x2c')](_0x46eb3d[_0x94c5('0x3d')][_0x94c5('0x2c')]);}return _0x1a3033['getApplications'](_0x26902c);}})[_0x94c5('0x1d')](function(_0x267f2f){if(_0x267f2f){return _0x267f2f?{'count':_0x40a39f,'rows':_0x267f2f}:null;}})[_0x94c5('0x1d')](respondWithResult(_0x31878e,null))['catch'](handleError(_0x31878e,null));};exports[_0x94c5('0xa4')]=function(_0x4ffaea,_0x17919e,_0x144284){var _0x331449={'raw':![],'where':{}};var _0x354c64={};var _0x3f35d8={'count':0x0,'rows':[]};return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x4ffaea[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x17919e,null))['then'](function(_0x34bcb0){if(_0x34bcb0){_0x354c64[_0x94c5('0x40')]=_['keys'](db[_0x94c5('0x8c')][_0x94c5('0x3b')]);_0x354c64['query']=_[_0x94c5('0x3c')](_0x4ffaea[_0x94c5('0x3d')]);_0x354c64[_0x94c5('0x3e')]=_[_0x94c5('0x3f')](_0x354c64[_0x94c5('0x40')],_0x354c64[_0x94c5('0x3d')]);_0x331449[_0x94c5('0x41')]=_[_0x94c5('0x3f')](_0x354c64['model'],qs[_0x94c5('0x58')](_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0x58')]));_0x331449[_0x94c5('0x41')]=_0x331449['attributes'][_0x94c5('0x42')]?_0x331449['attributes']:_0x354c64[_0x94c5('0x40')];if(!_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0x68')](_0x94c5('0x43'))){_0x331449['limit']=qs[_0x94c5('0x44')](_0x4ffaea[_0x94c5('0x3d')]['limit']);_0x331449[_0x94c5('0x2c')]=qs[_0x94c5('0x2c')](_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0x2c')]);}_0x331449['order']=qs['sort'](_0x4ffaea['query'][_0x94c5('0x46')]);_0x331449['where']=qs[_0x94c5('0x3e')](_[_0x94c5('0x47')](_0x4ffaea[_0x94c5('0x3d')],_0x354c64['filters']));_0x331449['where']['OpenchannelAccountId']=_0x34bcb0['id'];if(_0x4ffaea['query'][_0x94c5('0x48')]){_0x331449['where']=_[_0x94c5('0x4a')](_0x331449[_0x94c5('0x49')],{'$or':_[_0x94c5('0x4b')](_0x331449[_0x94c5('0x41')],function(_0x34b3ef){var _0xd2842e={};_0xd2842e[_0x34b3ef]={'$like':'%'+_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0x48')]+'%'};return _0xd2842e;})});}_0x331449=_['merge']({},_0x331449,_0x4ffaea[_0x94c5('0x50')]);return db[_0x94c5('0x8c')][_0x94c5('0x2b')]({'where':_0x331449['where']})[_0x94c5('0x1d')](function(_0x5e3fcd){_0x3f35d8[_0x94c5('0x2b')]=_0x5e3fcd;if(_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0x52')]){_0x331449['include']=[{'model':db[_0x94c5('0x70')],'as':_0x94c5('0xa5'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x94c5('0xa6'),_0x94c5('0xa7')],'required':![]},{'model':db['Tag'],'as':_0x94c5('0xa8'),'attributes':['id',_0x94c5('0x37'),_0x94c5('0xa9')],'where':_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0xaa')]?{'id':_0x4ffaea['query'][_0x94c5('0xaa')]}:undefined,'required':_0x4ffaea[_0x94c5('0x3d')][_0x94c5('0xaa')]?!![]:![]}];}return db[_0x94c5('0x8c')][_0x94c5('0x54')](_0x331449);})[_0x94c5('0x1d')](function(_0x2fdc70){_0x3f35d8[_0x94c5('0x55')]=_0x2fdc70;return _0x3f35d8;});}})[_0x94c5('0x1d')](respondWithFilteredResult(_0x17919e,_0x331449))[_0x94c5('0x27')](handleError(_0x17919e,null));};exports[_0x94c5('0xab')]=function(_0x3e9033,_0x28ad75,_0x1efd75){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0x3e9033[_0x94c5('0x57')]['id']}})['then'](handleEntityNotFound(_0x28ad75,null))[_0x94c5('0x1d')](function(_0x1d93e8){if(_0x1d93e8){return _0x1d93e8[_0x94c5('0xab')](_0x3e9033['body'][_0x94c5('0x6a')],_['omit'](_0x3e9033[_0x94c5('0x5b')],['ids','id'])||{})[_0x94c5('0x8d')](function(_0x368e16){for(var _0x597dab=0x0;_0x597dab<_0x3e9033['body'][_0x94c5('0x6a')]['length'];_0x597dab+=0x1){socket[_0x94c5('0xac')](_0x94c5('0xad'),{'UserId':_0x3e9033[_0x94c5('0x5b')][_0x94c5('0x6a')][_0x597dab],'OpenchannelAccountId':_0x3e9033[_0x94c5('0x57')]['id']});}return _0x368e16;});}})[_0x94c5('0x1d')](respondWithResult(_0x28ad75,null))[_0x94c5('0x27')](handleError(_0x28ad75,null));};exports[_0x94c5('0xae')]=function(_0xe4dca0,_0x2e6559,_0x409fc9){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0xe4dca0[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x2e6559,null))[_0x94c5('0x1d')](function(_0x9a6765){if(_0x9a6765){return _0x9a6765[_0x94c5('0xae')](_0xe4dca0[_0x94c5('0x3d')]['ids'])['then'](function(){if(_[_0x94c5('0xaf')](_0xe4dca0[_0x94c5('0x3d')][_0x94c5('0x6a')])){for(var _0x206cf3=0x0;_0x206cf3<_0xe4dca0[_0x94c5('0x3d')][_0x94c5('0x6a')][_0x94c5('0x42')];_0x206cf3+=0x1){socket[_0x94c5('0xac')]('userOpenchannelAccount:remove',{'UserId':Number(_0xe4dca0[_0x94c5('0x3d')][_0x94c5('0x6a')][_0x206cf3]),'OpenchannelAccountId':Number(_0xe4dca0['params']['id'])});}}else{socket['emit'](_0x94c5('0xb0'),{'UserId':Number(_0xe4dca0['query'][_0x94c5('0x6a')]),'OpenchannelAccountId':Number(_0xe4dca0[_0x94c5('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e6559,null))['catch'](handleError(_0x2e6559,null));};exports[_0x94c5('0xb1')]=function(_0x4b4e92,_0x31a9ac,_0x5125d1){var _0x211a91={};var _0x3381fc={};var _0x2560f8;var _0x3e3623;return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x4b4e92['params']['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x31a9ac,null))[_0x94c5('0x1d')](function(_0x344e47){if(_0x344e47){_0x2560f8=_0x344e47;_0x3381fc[_0x94c5('0x40')]=_[_0x94c5('0x3c')](db['User'][_0x94c5('0x3b')]);_0x3381fc[_0x94c5('0x3d')]=_[_0x94c5('0x3c')](_0x4b4e92[_0x94c5('0x3d')]);_0x3381fc[_0x94c5('0x3e')]=_[_0x94c5('0x3f')](_0x3381fc[_0x94c5('0x40')],_0x3381fc[_0x94c5('0x3d')]);_0x211a91['attributes']=_[_0x94c5('0x3f')](_0x3381fc[_0x94c5('0x40')],qs[_0x94c5('0x58')](_0x4b4e92['query']['fields']));_0x211a91['attributes']=_0x211a91[_0x94c5('0x41')][_0x94c5('0x42')]?_0x211a91['attributes']:_0x3381fc[_0x94c5('0x40')];_0x211a91[_0x94c5('0x45')]=qs[_0x94c5('0x46')](_0x4b4e92[_0x94c5('0x3d')]['sort']);_0x211a91[_0x94c5('0x49')]=qs[_0x94c5('0x3e')](_[_0x94c5('0x47')](_0x4b4e92[_0x94c5('0x3d')],_0x3381fc['filters']));if(_0x4b4e92[_0x94c5('0x3d')][_0x94c5('0x48')]){_0x211a91[_0x94c5('0x49')]=_[_0x94c5('0x4a')](_0x211a91[_0x94c5('0x49')],{'$or':_[_0x94c5('0x4b')](_0x211a91['attributes'],function(_0x4bc30a){var _0x13c391={};_0x13c391[_0x4bc30a]={'$like':'%'+_0x4b4e92[_0x94c5('0x3d')]['filter']+'%'};return _0x13c391;})});}_0x211a91=_[_0x94c5('0x4a')]({},_0x211a91,_0x4b4e92[_0x94c5('0x50')]);return _0x2560f8[_0x94c5('0xb1')](_0x211a91);}})[_0x94c5('0x1d')](function(_0x444ed8){if(_0x444ed8){_0x3e3623=_0x444ed8[_0x94c5('0x42')];if(!_0x4b4e92[_0x94c5('0x3d')][_0x94c5('0x68')](_0x94c5('0x43'))){_0x211a91[_0x94c5('0x44')]=qs[_0x94c5('0x44')](_0x4b4e92[_0x94c5('0x3d')]['limit']);_0x211a91[_0x94c5('0x2c')]=qs[_0x94c5('0x2c')](_0x4b4e92[_0x94c5('0x3d')][_0x94c5('0x2c')]);}return _0x2560f8[_0x94c5('0xb1')](_0x211a91);}})[_0x94c5('0x1d')](function(_0xdb62dd){if(_0xdb62dd){return _0xdb62dd?{'count':_0x3e3623,'rows':_0xdb62dd}:null;}})[_0x94c5('0x1d')](respondWithResult(_0x31a9ac,null))['catch'](handleError(_0x31a9ac,null));};exports[_0x94c5('0xb2')]=function(_0x3be7ab,_0x4aa9b7,_0x34e88b){var _0x3e2831,_0x277070,_0x2221f6;if(_[_0x94c5('0x78')](_0x3be7ab[_0x94c5('0x5b')][_0x94c5('0x5b')])||_0x3be7ab[_0x94c5('0x5b')][_0x94c5('0x5b')]===''){throw new db[(_0x94c5('0x71'))][(_0x94c5('0x72'))](_0x94c5('0x7a'));}if(_[_0x94c5('0x78')](_0x3be7ab['body']['to'])){}_0x3e2831=_0x3be7ab['body']['to'];return db[_0x94c5('0x51')][_0x94c5('0x66')]({'where':{'id':_0x3be7ab[_0x94c5('0x57')]['id']}})[_0x94c5('0x1d')](handleEntityNotFound(_0x4aa9b7,null))[_0x94c5('0x1d')](function(_0xfb29a5){if(_0xfb29a5){return db[_0x94c5('0x51')][_0x94c5('0x59')]({'where':{'id':_0xfb29a5['id']},'include':[{'model':db[_0x94c5('0x7e')],'as':_0x94c5('0x81'),'include':[{'model':db[_0x94c5('0x70')],'as':_0x94c5('0x87'),'where':{[_0xfb29a5[_0x94c5('0x7b')]]:_0x3e2831},'limit':0x1,'order':[[_0x94c5('0x76'),_0x94c5('0x7f')]]}]}]})[_0x94c5('0x1d')](handleEntityNotFound(_0x4aa9b7,null))[_0x94c5('0x1d')](function(_0x27b995){if(_0x27b995&&_0x27b995[_0x94c5('0x81')]){_0x277070=_0x27b995[_0x94c5('0x33')]({'plain':!![]});if(_0x277070[_0x94c5('0x81')]&&_0x277070[_0x94c5('0x81')][_0x94c5('0x87')]['length']){return _0x277070['List']['Contacts'][0x0];}return db[_0x94c5('0x70')][_0x94c5('0x5a')](_[_0x94c5('0x14')](_0x3be7ab[_0x94c5('0x5b')],{'firstName':_0x3e2831,[_0x27b995[_0x94c5('0x7b')]]:_0x3e2831,'phone':_0x3e2831,'ListId':_0x277070['ListId']}));}})[_0x94c5('0x1d')](handleEntityNotFound(_0x4aa9b7,null))['then'](function(_0x54bfd3){if(_0x54bfd3){_0x2221f6=_0x54bfd3;return db[_0x94c5('0x8c')][_0x94c5('0x59')]({'where':{'ContactId':_0x2221f6['id'],'closed':![],'OpenchannelAccountId':_0x277070['id']}})[_0x94c5('0x1d')](function(_0x372db4){if(_0x372db4){return[_0x372db4,![]];}return db['OpenchannelInteraction'][_0x94c5('0x5a')]({'UserId':_0x3be7ab[_0x94c5('0x5c')]['id'],'ContactId':_0x2221f6['id'],'OpenchannelAccountId':_0x277070['id'],'lastMsgDirection':_0x94c5('0xb3'),'Messages':[_[_0x94c5('0x4a')](_0x3be7ab[_0x94c5('0x5b')],{'read':![],'body':_0x3be7ab[_0x94c5('0x5b')][_0x94c5('0x5b')],'OpenchannelAccountId':_0x277070['id'],'UserId':_0x3be7ab['user']['id'],'ContactId':_0x2221f6['id']})]},{'include':[{'model':db[_0x94c5('0xb4')],'as':'Messages'}]})[_0x94c5('0x1d')](function(_0x34c5cc){return[_0x34c5cc,!![]];});});}})[_0x94c5('0x8d')](function(_0x2a089b,_0x28de22){if(_0x28de22){return _0x2a089b;}return db[_0x94c5('0xb4')][_0x94c5('0x5a')](_[_0x94c5('0x4a')](_0x3be7ab[_0x94c5('0x5b')],{'read':![],'body':_0x3be7ab[_0x94c5('0x5b')][_0x94c5('0x5b')],'OpenchannelAccountId':_0x277070['id'],'OpenchannelInteractionId':_0x2a089b['id'],'UserId':_0x3be7ab[_0x94c5('0x5c')]['id'],'ContactId':_0x2221f6['id']}))[_0x94c5('0x1d')](function(_0x1eccd0){_0x2a089b[_0x94c5('0xb5')][_0x94c5('0xb6')]=[];_0x2a089b[_0x94c5('0xb5')][_0x94c5('0xb6')]['push'](_0x1eccd0[_0x94c5('0xb5')]);return _0x2a089b;});});}})[_0x94c5('0x1d')](respondWithResult(_0x4aa9b7,null))[_0x94c5('0x27')](handleError(_0x4aa9b7,null));}; \ No newline at end of file +var _0x90c9=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','map','type','key','VIRTUAL','field','filter','merge','includeAll','include','findAll','rows','show','params','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','Disposition','getDispositions','findOne','sort','OpenchannelAccountId','options','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','openchannel','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','OpenchannelApplication','List','applications','Applications','list','orderBy','priority','account','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmContact','Messages','dataValues','html-pdf'];(function(_0x58b710,_0x25a98a){var _0x3584a1=function(_0x28fb99){while(--_0x28fb99){_0x58b710['push'](_0x58b710['shift']());}};_0x3584a1(++_0x25a98a);}(_0x90c9,0x175));var _0x990c=function(_0x4a9765,_0x323732){_0x4a9765=_0x4a9765-0x0;var _0x1c363c=_0x90c9[_0x4a9765];return _0x1c363c;};'use strict';var pdf=require(_0x990c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x990c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x990c('0x2'));var rp=require(_0x990c('0x3'));var moment=require(_0x990c('0x4'));var BPromise=require(_0x990c('0x5'));var Mustache=require(_0x990c('0x6'));var util=require(_0x990c('0x7'));var path=require(_0x990c('0x8'));var sox=require('sox');var csv=require(_0x990c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x990c('0xa'));var squel=require(_0x990c('0xb'));var crypto=require('crypto');var jsforce=require(_0x990c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x990c('0x9'));var querystring=require(_0x990c('0xd'));var Papa=require(_0x990c('0xe'));var Redis=require(_0x990c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x990c('0x10'));var hardwareService=require(_0x990c('0x11'));var logger=require(_0x990c('0x12'))('api');var utils=require(_0x990c('0x13'));var config=require(_0x990c('0x14'));var db=require(_0x990c('0x15'))['db'];config['redis']=_[_0x990c('0x16')](config['redis'],{'host':_0x990c('0x17'),'port':0x18eb});var socket=require(_0x990c('0x18'))(new Redis(config['redis']));require(_0x990c('0x19'))[_0x990c('0x1a')](socket);var jayson=require(_0x990c('0x1b'));var client=jayson[_0x990c('0x1c')][_0x990c('0x1d')]({'port':0x232c});var client9002=jayson[_0x990c('0x1c')][_0x990c('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x29649f,_0x46a98b,_0x10e4de){if(_0x10e4de){var _0x553645=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x553645[_0x990c('0x1e')](_0x46a98b)){return _0x29649f;}else{throw new Error(_0x990c('0x1f'));}}else{return _0x29649f;}}function respondWithRpcPromise(_0x20995a,_0x57ef01,_0xf6eaaa,_0x1b8d12){return new BPromise(function(_0x329049,_0x3bd9f9){var _0x5b8059=_0x1b8d12||client;return _0x5b8059['request'](_0x20995a,_0xf6eaaa)[_0x990c('0x20')](function(_0x8b736e){logger[_0x990c('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x57ef01,_0x990c('0x22'));logger['debug'](_0x990c('0x23'),_0x57ef01,_0x990c('0x22'),JSON['stringify'](_0x8b736e));if(_0x8b736e[_0x990c('0x24')]){if(_0x8b736e['error'][_0x990c('0x25')]===0x1f4){logger['error'](_0x990c('0x26'),_0x57ef01,_0x8b736e[_0x990c('0x24')][_0x990c('0x27')]);return _0x3bd9f9(_0x8b736e[_0x990c('0x24')][_0x990c('0x27')]);}logger['error'](_0x990c('0x26'),_0x57ef01,_0x8b736e[_0x990c('0x24')][_0x990c('0x27')]);return _0x329049(_0x8b736e[_0x990c('0x24')][_0x990c('0x27')]);}else{logger['info'](_0x990c('0x26'),_0x57ef01,_0x990c('0x22'));_0x329049(_0x8b736e[_0x990c('0x28')][_0x990c('0x27')]);}})[_0x990c('0x29')](function(_0xfbbfb8){logger[_0x990c('0x24')](_0x990c('0x26'),_0x57ef01,_0xfbbfb8);_0x3bd9f9(_0xfbbfb8);});});}function respondWithStatusCode(_0x318d09,_0x3c6c4d){_0x3c6c4d=_0x3c6c4d||0xcc;return function(_0x46b6cb){if(_0x46b6cb){return _0x318d09[_0x990c('0x2a')](_0x3c6c4d);}return _0x318d09[_0x990c('0x2b')](_0x3c6c4d)[_0x990c('0x2c')]();};}function respondWithResult(_0x54b1f0,_0x44670d){_0x44670d=_0x44670d||0xc8;return function(_0x4df951){if(_0x4df951){return _0x54b1f0['status'](_0x44670d)[_0x990c('0x2d')](_0x4df951);}};}function respondWithFilteredResult(_0x510daa,_0x3b7195){return function(_0x1e7060){if(_0x1e7060){var _0xd70917=_0x1e7060[_0x990c('0x2e')],_0x100ad3=_0x3b7195[_0x990c('0x2f')],_0x31dcd3=_0x3b7195[_0x990c('0x2f')]+_0x3b7195[_0x990c('0x30')],_0x3497fe;if(_0x31dcd3>=_0xd70917){_0x31dcd3=_0xd70917;_0x3497fe=0xc8;}else{_0x3497fe=0xce;}_0x510daa[_0x990c('0x2b')](_0x3497fe);return _0x510daa[_0x990c('0x31')](_0x990c('0x32'),_0x100ad3+'-'+_0x31dcd3+'/'+_0xd70917)[_0x990c('0x2d')](_0x1e7060);}return null;};}function patchUpdates(_0x5bd698){return function(_0x317900){try{jsonpatch[_0x990c('0x33')](_0x317900,_0x5bd698,!![]);}catch(_0x531290){return BPromise[_0x990c('0x34')](_0x531290);}return _0x317900[_0x990c('0x35')]();};}function saveUpdates(_0x719fb4,_0x2ded62){return function(_0x43f678){if(_0x43f678){return _0x43f678[_0x990c('0x36')](_0x719fb4)[_0x990c('0x20')](function(_0x4836a5){return _0x4836a5;});}return null;};}function removeEntity(_0x496828,_0x3e122a){return function(_0x2b3f71){if(_0x2b3f71){return _0x2b3f71['destroy']()['then'](function(){var _0x1d29f8=_0x2b3f71[_0x990c('0x37')]({'plain':!![]});var _0x1706a6=_0x990c('0x38');return db[_0x990c('0x39')][_0x990c('0x3a')]({'where':{'type':_0x1706a6,'resourceId':_0x1d29f8['id']}})[_0x990c('0x20')](function(){return _0x2b3f71;});})[_0x990c('0x20')](function(){_0x496828['status'](0xcc)[_0x990c('0x2c')]();});}};}function handleEntityNotFound(_0x217855,_0x5ee59e){return function(_0x202616){if(!_0x202616){_0x217855[_0x990c('0x2a')](0x194);}return _0x202616;};}function handleError(_0x103d8b,_0x51e0d6){_0x51e0d6=_0x51e0d6||0x1f4;return function(_0x15745c){logger[_0x990c('0x24')](_0x15745c['stack']);if(_0x15745c[_0x990c('0x3b')]){delete _0x15745c[_0x990c('0x3b')];}_0x103d8b[_0x990c('0x2b')](_0x51e0d6)[_0x990c('0x3c')](_0x15745c);};}exports[_0x990c('0x3d')]=function(_0xcda51c,_0x544285){var _0x807ef1={'include':[{'model':db[_0x990c('0x3e')],'as':_0x990c('0x3f')}]},_0xa5692a={},_0xa6d9cf={'count':0x0,'rows':[]};var _0x1d418e=db[_0x990c('0x40')][_0x990c('0x41')];_0xa5692a[_0x990c('0x42')]=_[_0x990c('0x43')](_0x1d418e);_0xa5692a[_0x990c('0x44')]=_[_0x990c('0x43')](_0xcda51c[_0x990c('0x44')]);_0xa5692a[_0x990c('0x45')]=_['intersection'](_0xa5692a[_0x990c('0x42')],_0xa5692a[_0x990c('0x44')]);_0x807ef1[_0x990c('0x46')]=_['intersection'](_0xa5692a[_0x990c('0x42')],qs[_0x990c('0x47')](_0xcda51c[_0x990c('0x44')][_0x990c('0x47')]));_0x807ef1[_0x990c('0x46')]=_0x807ef1[_0x990c('0x46')][_0x990c('0x48')]?_0x807ef1['attributes']:_0xa5692a['model'];if(!_0xcda51c[_0x990c('0x44')][_0x990c('0x49')](_0x990c('0x4a'))){_0x807ef1[_0x990c('0x30')]=qs[_0x990c('0x30')](_0xcda51c[_0x990c('0x44')][_0x990c('0x30')]);_0x807ef1[_0x990c('0x2f')]=qs[_0x990c('0x2f')](_0xcda51c[_0x990c('0x44')][_0x990c('0x2f')]);}_0x807ef1[_0x990c('0x4b')]=qs['sort'](_0xcda51c[_0x990c('0x44')]['sort']);_0x807ef1['where']=qs[_0x990c('0x45')](_['pick'](_0xcda51c[_0x990c('0x44')],_0xa5692a[_0x990c('0x45')]));if(_0xcda51c[_0x990c('0x44')]['filter']){_0x807ef1[_0x990c('0x4c')]=_['merge'](_0x807ef1[_0x990c('0x4c')],{'$or':_[_0x990c('0x4d')](_0x1d418e,function(_0xaec5f1){if(_0xaec5f1[_0x990c('0x4e')][_0x990c('0x4f')]!==_0x990c('0x50')){var _0x3a28e6={};_0x3a28e6[_0xaec5f1[_0x990c('0x51')]]={'$like':'%'+_0xcda51c[_0x990c('0x44')][_0x990c('0x52')]+'%'};return _0x3a28e6;}})});}_0x807ef1=_[_0x990c('0x53')]({},_0x807ef1,_0xcda51c['options']);var _0x24e531={'where':_0x807ef1[_0x990c('0x4c')]};return db['OpenchannelAccount'][_0x990c('0x2e')](_0x24e531)[_0x990c('0x20')](function(_0x4f7b14){_0xa6d9cf[_0x990c('0x2e')]=_0x4f7b14;if(_0xcda51c['query'][_0x990c('0x54')]){_0x807ef1[_0x990c('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x990c('0x56')](_0x807ef1);})['then'](function(_0x428140){_0xa6d9cf[_0x990c('0x57')]=_0x428140;return _0xa6d9cf;})[_0x990c('0x20')](respondWithFilteredResult(_0x544285,_0x807ef1))['catch'](handleError(_0x544285,null));};exports[_0x990c('0x58')]=function(_0xca0764,_0x355f8b){var _0x5880db={'raw':![],'where':{'id':_0xca0764[_0x990c('0x59')]['id']},'include':[{'model':db[_0x990c('0x3e')],'as':_0x990c('0x3f')}]},_0x22c189={};_0x22c189[_0x990c('0x42')]=_[_0x990c('0x43')](db[_0x990c('0x40')][_0x990c('0x41')]);_0x22c189['query']=_[_0x990c('0x43')](_0xca0764[_0x990c('0x44')]);_0x22c189[_0x990c('0x45')]=_[_0x990c('0x5a')](_0x22c189[_0x990c('0x42')],_0x22c189[_0x990c('0x44')]);_0x5880db['attributes']=_[_0x990c('0x5a')](_0x22c189[_0x990c('0x42')],qs[_0x990c('0x47')](_0xca0764[_0x990c('0x44')][_0x990c('0x47')]));_0x5880db['attributes']=_0x5880db['attributes'][_0x990c('0x48')]?_0x5880db[_0x990c('0x46')]:_0x22c189[_0x990c('0x42')];if(_0xca0764[_0x990c('0x44')]['includeAll']){_0x5880db[_0x990c('0x55')]=[{'all':!![]}];}_0x5880db=_['merge']({},_0x5880db,_0xca0764['options']);return db[_0x990c('0x40')]['find'](_0x5880db)['then'](handleEntityNotFound(_0x355f8b,null))[_0x990c('0x20')](respondWithResult(_0x355f8b,null))['catch'](handleError(_0x355f8b,null));};exports[_0x990c('0x5b')]=function(_0x2d56ed,_0x56eb9f){return db[_0x990c('0x40')][_0x990c('0x5b')](_0x2d56ed['body'],{})[_0x990c('0x20')](function(_0x2d1276){var _0xaf9029=_0x2d56ed[_0x990c('0x5c')][_0x990c('0x37')]({'plain':!![]});if(!_0xaf9029)throw new Error(_0x990c('0x5d'));if(_0xaf9029[_0x990c('0x5e')]===_0x990c('0x5c')){var _0x1566d4=_0x2d1276[_0x990c('0x37')]({'plain':!![]});var _0x41135d=_0x990c('0x38');return db[_0x990c('0x5f')]['find']({'where':{'name':_0x41135d,'userProfileId':_0xaf9029[_0x990c('0x60')]},'raw':!![]})[_0x990c('0x20')](function(_0x110f67){if(_0x110f67&&_0x110f67[_0x990c('0x61')]===0x0){return db[_0x990c('0x39')][_0x990c('0x5b')]({'name':_0x1566d4[_0x990c('0x3b')],'resourceId':_0x1566d4['id'],'type':_0x110f67[_0x990c('0x3b')],'sectionId':_0x110f67['id']},{})[_0x990c('0x20')](function(){return _0x2d1276;});}else{return _0x2d1276;}})[_0x990c('0x29')](function(_0x3cfec1){logger[_0x990c('0x24')](_0x990c('0x62'),_0x3cfec1);throw _0x3cfec1;});}return _0x2d1276;})['then'](respondWithResult(_0x56eb9f,0xc9))[_0x990c('0x29')](handleError(_0x56eb9f,null));};exports[_0x990c('0x36')]=function(_0x29a464,_0x32c6ad){if(_0x29a464[_0x990c('0x63')]['id']){delete _0x29a464[_0x990c('0x63')]['id'];}return db['OpenchannelAccount'][_0x990c('0x64')]({'where':{'id':_0x29a464['params']['id']},'include':[{'model':db['Pause'],'as':_0x990c('0x3f')}]})['then'](handleEntityNotFound(_0x32c6ad,null))['then'](saveUpdates(_0x29a464[_0x990c('0x63')],null))[_0x990c('0x20')](respondWithResult(_0x32c6ad,null))[_0x990c('0x29')](handleError(_0x32c6ad,null));};exports[_0x990c('0x3a')]=function(_0x2811c8,_0x2d2b4b){return db[_0x990c('0x40')][_0x990c('0x64')]({'where':{'id':_0x2811c8[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x2d2b4b,null))['then'](removeEntity(_0x2d2b4b,null))[_0x990c('0x29')](handleError(_0x2d2b4b,null));};exports['describe']=function(_0x1fc41e,_0x42c6c3){return db[_0x990c('0x40')][_0x990c('0x65')]()[_0x990c('0x20')](respondWithResult(_0x42c6c3,null))['catch'](handleError(_0x42c6c3,null));};exports[_0x990c('0x66')]=function(_0x135537,_0x29745c,_0xd7e6b2){if(_0x135537[_0x990c('0x63')]['id']){delete _0x135537[_0x990c('0x63')]['id'];}return db[_0x990c('0x40')]['find']({'where':{'id':_0x135537[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x29745c,null))[_0x990c('0x20')](function(_0x58c184){if(_0x58c184){_0x135537['body']['OpnechannelAccountId']=_0x58c184['id'];return db[_0x990c('0x67')][_0x990c('0x5b')](_0x135537[_0x990c('0x63')]);}})[_0x990c('0x20')](respondWithResult(_0x29745c,null))['catch'](handleError(_0x29745c,null));};exports[_0x990c('0x68')]=function(_0x363090,_0x489627,_0xd421e8){var _0x292670={'raw':![],'where':{}};var _0x439bd3={};var _0x205d12={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x990c('0x69')]({'where':{'id':_0x363090[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x489627,null))[_0x990c('0x20')](function(_0x31a7ee){if(_0x31a7ee){_0x439bd3[_0x990c('0x42')]=_['keys'](db[_0x990c('0x67')][_0x990c('0x41')]);_0x439bd3[_0x990c('0x44')]=_[_0x990c('0x43')](_0x363090[_0x990c('0x44')]);_0x439bd3[_0x990c('0x45')]=_['intersection'](_0x439bd3[_0x990c('0x42')],_0x439bd3[_0x990c('0x44')]);_0x292670[_0x990c('0x46')]=_[_0x990c('0x5a')](_0x439bd3[_0x990c('0x42')],qs[_0x990c('0x47')](_0x363090[_0x990c('0x44')][_0x990c('0x47')]));_0x292670[_0x990c('0x46')]=_0x292670['attributes'][_0x990c('0x48')]?_0x292670[_0x990c('0x46')]:_0x439bd3[_0x990c('0x42')];if(!_0x363090[_0x990c('0x44')][_0x990c('0x49')]('nolimit')){_0x292670[_0x990c('0x30')]=qs['limit'](_0x363090[_0x990c('0x44')][_0x990c('0x30')]);_0x292670[_0x990c('0x2f')]=qs['offset'](_0x363090[_0x990c('0x44')][_0x990c('0x2f')]);}_0x292670[_0x990c('0x4b')]=qs[_0x990c('0x6a')](_0x363090[_0x990c('0x44')][_0x990c('0x6a')]);_0x292670[_0x990c('0x4c')]=qs['filters'](_['pick'](_0x363090[_0x990c('0x44')],_0x439bd3[_0x990c('0x45')]));_0x292670[_0x990c('0x4c')][_0x990c('0x6b')]=_0x31a7ee['id'];if(_0x363090[_0x990c('0x44')]['filter']){_0x292670['where']=_[_0x990c('0x53')](_0x292670['where'],{'$or':_[_0x990c('0x4d')](_0x292670[_0x990c('0x46')],function(_0x2f3f24){var _0x337ef6={};_0x337ef6[_0x2f3f24]={'$like':'%'+_0x363090[_0x990c('0x44')]['filter']+'%'};return _0x337ef6;})});}_0x292670=_['merge']({},_0x292670,_0x363090[_0x990c('0x6c')]);return db[_0x990c('0x67')][_0x990c('0x2e')]({'where':_0x292670['where']})[_0x990c('0x20')](function(_0x490c94){_0x205d12[_0x990c('0x2e')]=_0x490c94;if(_0x363090[_0x990c('0x44')]['includeAll']){_0x292670[_0x990c('0x55')]=[{'all':!![]}];}return db[_0x990c('0x67')]['findAll'](_0x292670);})[_0x990c('0x20')](function(_0x286516){_0x205d12[_0x990c('0x57')]=_0x286516;return _0x205d12;});}})['then'](respondWithFilteredResult(_0x489627,_0x292670))['catch'](handleError(_0x489627,null));};exports['removeDispositions']=function(_0x547ebf,_0x5b51f9,_0x666cde){return db['OpenchannelAccount'][_0x990c('0x64')]({'where':{'id':_0x547ebf[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x5b51f9,null))[_0x990c('0x20')](function(_0x1dcf18){if(_0x1dcf18){return _0x1dcf18[_0x990c('0x6d')](_0x547ebf[_0x990c('0x44')][_0x990c('0x6e')]);}})['then'](respondWithStatusCode(_0x5b51f9,null))['catch'](handleError(_0x5b51f9,null));};exports['addAnswer']=function(_0x4f4fe4,_0x3383bb,_0x4ef3f4){if(_0x4f4fe4[_0x990c('0x63')]['id']){delete _0x4f4fe4[_0x990c('0x63')]['id'];}return db['OpenchannelAccount'][_0x990c('0x64')]({'where':{'id':_0x4f4fe4[_0x990c('0x59')]['id']}})['then'](handleEntityNotFound(_0x3383bb,null))[_0x990c('0x20')](function(_0x1ea94c){if(_0x1ea94c){_0x4f4fe4[_0x990c('0x63')][_0x990c('0x6b')]=_0x1ea94c['id'];return db[_0x990c('0x6f')][_0x990c('0x5b')](_0x4f4fe4[_0x990c('0x63')]);}})[_0x990c('0x20')](respondWithResult(_0x3383bb,null))['catch'](handleError(_0x3383bb,null));};exports[_0x990c('0x70')]=function(_0x261ae9,_0x1193d9,_0x56f317){var _0x1e2a43={'raw':![],'where':{}};var _0x258fa1={};var _0x275f8e={'count':0x0,'rows':[]};return db[_0x990c('0x40')][_0x990c('0x69')]({'where':{'id':_0x261ae9[_0x990c('0x59')]['id']}})['then'](handleEntityNotFound(_0x1193d9,null))[_0x990c('0x20')](function(_0x526383){if(_0x526383){_0x258fa1['model']=_[_0x990c('0x43')](db[_0x990c('0x6f')][_0x990c('0x41')]);_0x258fa1[_0x990c('0x44')]=_[_0x990c('0x43')](_0x261ae9['query']);_0x258fa1[_0x990c('0x45')]=_[_0x990c('0x5a')](_0x258fa1[_0x990c('0x42')],_0x258fa1[_0x990c('0x44')]);_0x1e2a43['attributes']=_['intersection'](_0x258fa1['model'],qs[_0x990c('0x47')](_0x261ae9['query'][_0x990c('0x47')]));_0x1e2a43[_0x990c('0x46')]=_0x1e2a43[_0x990c('0x46')][_0x990c('0x48')]?_0x1e2a43[_0x990c('0x46')]:_0x258fa1[_0x990c('0x42')];if(!_0x261ae9[_0x990c('0x44')][_0x990c('0x49')](_0x990c('0x4a'))){_0x1e2a43[_0x990c('0x30')]=qs[_0x990c('0x30')](_0x261ae9['query']['limit']);_0x1e2a43[_0x990c('0x2f')]=qs[_0x990c('0x2f')](_0x261ae9[_0x990c('0x44')][_0x990c('0x2f')]);}_0x1e2a43[_0x990c('0x4b')]=qs[_0x990c('0x6a')](_0x261ae9['query']['sort']);_0x1e2a43['where']=qs['filters'](_[_0x990c('0x71')](_0x261ae9[_0x990c('0x44')],_0x258fa1[_0x990c('0x45')]));_0x1e2a43[_0x990c('0x4c')][_0x990c('0x6b')]=_0x526383['id'];if(_0x261ae9[_0x990c('0x44')][_0x990c('0x52')]){_0x1e2a43[_0x990c('0x4c')]=_[_0x990c('0x53')](_0x1e2a43[_0x990c('0x4c')],{'$or':_[_0x990c('0x4d')](_0x1e2a43[_0x990c('0x46')],function(_0x3e83fc){var _0x39e921={};_0x39e921[_0x3e83fc]={'$like':'%'+_0x261ae9[_0x990c('0x44')][_0x990c('0x52')]+'%'};return _0x39e921;})});}_0x1e2a43=_['merge']({},_0x1e2a43,_0x261ae9[_0x990c('0x6c')]);return db[_0x990c('0x6f')]['count']({'where':_0x1e2a43[_0x990c('0x4c')]})[_0x990c('0x20')](function(_0x3e6297){_0x275f8e[_0x990c('0x2e')]=_0x3e6297;if(_0x261ae9[_0x990c('0x44')][_0x990c('0x54')]){_0x1e2a43['include']=[{'all':!![]}];}return db[_0x990c('0x6f')]['findAll'](_0x1e2a43);})[_0x990c('0x20')](function(_0x20bd60){_0x275f8e[_0x990c('0x57')]=_0x20bd60;return _0x275f8e;});}})[_0x990c('0x20')](respondWithFilteredResult(_0x1193d9,_0x1e2a43))[_0x990c('0x29')](handleError(_0x1193d9,null));};exports[_0x990c('0x72')]=function(_0x2d4ada,_0x190315,_0x9055c0){return db[_0x990c('0x40')][_0x990c('0x64')]({'where':{'id':_0x2d4ada['params']['id']}})['then'](handleEntityNotFound(_0x190315,null))['then'](function(_0x1dd896){if(_0x1dd896){return _0x1dd896[_0x990c('0x72')](_0x2d4ada[_0x990c('0x44')][_0x990c('0x6e')]);}})[_0x990c('0x20')](respondWithStatusCode(_0x190315,null))[_0x990c('0x29')](handleError(_0x190315,null));};exports[_0x990c('0x73')]=function(_0x1b926f,_0x3ec573,_0x1ef7ee){var _0x559047={'body':_0x1b926f['body'],'channel':_0x990c('0x74')};var _0x195f51=[];var _0x2a9990=[];var _0x567009={};var _0x43d45f=![];return db['CmContact']['describe']()['then'](function(_0x5b49e7){if(!_0x5b49e7){throw new db[(_0x990c('0x75'))]['ValidationError'](_0x990c('0x76'));}_0x195f51=_[_0x990c('0x77')](_['keys'](_0x5b49e7),[_0x990c('0x78'),_0x990c('0x79')]);_0x2a9990=_[_0x990c('0x77')](_['keys'](_0x5b49e7),['createdAt',_0x990c('0x79'),_0x990c('0x7a'),'ListId']);if(_0x1b926f['body']['id']){delete _0x1b926f[_0x990c('0x63')]['id'];}if(_['isNil'](_0x1b926f[_0x990c('0x63')]['from'])){throw new db['Sequelize'][(_0x990c('0x7b'))]('from\x20is\x20mandatory');}if(_[_0x990c('0x7c')](_0x1b926f[_0x990c('0x63')][_0x990c('0x63')])||_0x1b926f[_0x990c('0x63')][_0x990c('0x63')]===''){throw new db[(_0x990c('0x75'))][(_0x990c('0x7b'))](_0x990c('0x7d'));}if(_[_0x990c('0x7c')](_0x1b926f[_0x990c('0x63')][_0x990c('0x7e')])){throw new db[(_0x990c('0x75'))][(_0x990c('0x7b'))](_0x990c('0x7f')+_0x2a9990);}if(!_['includes'](_0x2a9990,_0x1b926f[_0x990c('0x63')][_0x990c('0x7e')])){throw new db[(_0x990c('0x75'))][(_0x990c('0x7b'))](_0x990c('0x80')+_0x2a9990);}_0x567009[_0x1b926f[_0x990c('0x63')][_0x990c('0x7e')]]=_0x1b926f[_0x990c('0x63')][_0x990c('0x81')];})[_0x990c('0x20')](function(){return db[_0x990c('0x40')][_0x990c('0x64')]({'where':{'id':_0x1b926f[_0x990c('0x59')]['id']},'include':[{'model':db[_0x990c('0x82')],'as':'List','include':[{'model':db['CmContact'],'as':_0x990c('0x83'),'where':_0x567009,'limit':0x1,'order':[['updatedAt',_0x990c('0x84')]]}]},{'model':db[_0x990c('0x85')],'as':'Applications'}]});})[_0x990c('0x20')](handleEntityNotFound(_0x3ec573,null))[_0x990c('0x20')](function(_0x2e6443){if(_0x2e6443&&_0x2e6443[_0x990c('0x86')]){_0x559047['account']=_0x2e6443;_0x559047[_0x990c('0x87')]=_0x2e6443[_0x990c('0x88')];_0x559047[_0x990c('0x89')]=_0x2e6443[_0x990c('0x86')];_0x559047[_0x990c('0x87')]=_[_0x990c('0x8a')](_0x559047['applications'],[_0x990c('0x8b')],['asc']);if(_0x559047[_0x990c('0x8c')][_0x990c('0x88')]){delete _0x559047[_0x990c('0x8c')][_0x990c('0x88')];}if(_0x559047[_0x990c('0x8c')][_0x990c('0x86')]&&_0x559047['account']['List'][_0x990c('0x83')]['length']){return _0x559047['account'][_0x990c('0x86')]['Contacts'][0x0];}var _0x53bad4=_['defaults'](_0x1b926f[_0x990c('0x63')],{'firstName':_0x1b926f[_0x990c('0x63')][_0x990c('0x81')],'ListId':_0x2e6443[_0x990c('0x8d')]});_0x53bad4[_0x1b926f[_0x990c('0x63')][_0x990c('0x7e')]]=_0x1b926f[_0x990c('0x63')]['from'];return db['CmContact'][_0x990c('0x5b')](_0x53bad4,{'fields':_0x195f51,'raw':!![]});}})[_0x990c('0x20')](handleEntityNotFound(_0x3ec573,null))[_0x990c('0x20')](function(_0x3e2781){_0x559047['contact']=_0x3e2781;if(_0x3e2781){var _0x2b35a8={'ContactId':_0x3e2781['id'],'OpenchannelAccountId':_0x1b926f[_0x990c('0x59')]['id'],'from':(_0x3e2781[_0x990c('0x8e')]||'')+'\x20'+(_0x3e2781[_0x990c('0x8f')]||'')};var _0x3d9e75={'OpenchannelAccountId':_0x1b926f[_0x990c('0x59')]['id'],'closed':![]};if(_0x1b926f[_0x990c('0x63')][_0x990c('0x90')]){_0x3d9e75[_0x990c('0x90')]=_0x1b926f[_0x990c('0x63')]['threadId'];return db[_0x990c('0x91')][_0x990c('0x64')]({'where':_0x3d9e75})[_0x990c('0x20')](function(_0x518e29){if(_0x518e29){return[_0x518e29,![]];}_0x2b35a8[_0x990c('0x90')]=_0x1b926f[_0x990c('0x63')][_0x990c('0x90')];_0x2b35a8[_0x990c('0x92')]=_0x1b926f[_0x990c('0x63')][_0x990c('0x92')];return db['OpenchannelInteraction'][_0x990c('0x5b')](_0x2b35a8)[_0x990c('0x20')](function(_0x1f0a28){return[_0x1f0a28,!![]];});});}else{_0x3d9e75[_0x990c('0x90')]=null;}_0x3d9e75['ContactId']=_0x3e2781['id'];return db[_0x990c('0x91')][_0x990c('0x64')]({'where':_0x3d9e75})[_0x990c('0x20')](function(_0x33bba8){if(_0x33bba8){return[_0x33bba8,![]];}return db[_0x990c('0x91')][_0x990c('0x5b')](_0x2b35a8)['then'](function(_0x4224ec){return[_0x4224ec,!![]];});});}})['spread'](function(_0x86f5d7,_0x27711){if(_0x86f5d7){_0x43d45f=_0x27711;if(!_0x27711){var _0x262ba7={'from':(_0x559047[_0x990c('0x93')]['firstName']||'')+'\x20'+(_0x559047['contact']['lastName']||'')};if(_0x1b926f[_0x990c('0x63')][_0x990c('0x90')]&&_0x1b926f[_0x990c('0x63')][_0x990c('0x94')]&&_0x1b926f[_0x990c('0x63')][_0x990c('0x90')]!=_0x1b926f[_0x990c('0x63')][_0x990c('0x94')]){_0x262ba7[_0x990c('0x90')]=_0x1b926f[_0x990c('0x63')]['messageId'];}return _0x86f5d7[_0x990c('0x36')](_0x262ba7);}else{return _0x86f5d7;}}})['then'](function(_0x3f0824){_0x559047[_0x990c('0x95')]=_0x3f0824[_0x990c('0x37')]({'plain':!![]});_0x559047[_0x990c('0x95')][_0x990c('0x96')]=_0x43d45f;if(_0x559047[_0x990c('0x95')][_0x990c('0x96')]){if(_0x559047[_0x990c('0x8c')][_0x990c('0x97')]){_0x559047[_0x990c('0x87')]['push']({'id':0x0,'priority':_0x559047[_0x990c('0x87')][_0x990c('0x48')]+0x1,'app':'close','appdata':_0x990c('0x98'),'interval':_0x990c('0x99')});}}return db[_0x990c('0x9a')]['create']({'body':_0x1b926f[_0x990c('0x63')][_0x990c('0x63')],'OpenchannelAccountId':_0x1b926f[_0x990c('0x59')]['id'],'OpenchannelInteractionId':_0x3f0824['id'],'direction':'in','ContactId':_0x559047[_0x990c('0x93')]['id'],'AttachmentId':_0x1b926f[_0x990c('0x63')][_0x990c('0x9b')]});})[_0x990c('0x20')](function(_0x4535bf){_0x559047[_0x990c('0x27')]=_0x4535bf;if(_0x559047[_0x990c('0x95')][_0x990c('0x9c')]){return db['User']['find']({'attributes':['id',_0x990c('0x3b')],'where':{'id':_0x559047['interaction']['UserId']}})[_0x990c('0x20')](function(_0x19d6ab){if(_0x19d6ab){_0x559047[_0x990c('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x990c('0x9d'),'appdata':_0x19d6ab['name']+','+(_0x559047[_0x990c('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x559047[_0x990c('0x9e')]=![];}return respondWithRpcPromise(_0x990c('0x9f'),_0x990c('0xa0'),_0x559047);});}return respondWithRpcPromise('Start','startRouting',_0x559047);})[_0x990c('0x20')](function(_0x31af32){respondWithRpcPromise(_0x990c('0xa1'),_0x990c('0xa1'),{'event':_0x990c('0x73'),'message':_0x31af32},client9002);return _0x31af32;})[_0x990c('0x20')](respondWithResult(_0x3ec573,null))[_0x990c('0x29')](handleError(_0x3ec573,null));};exports[_0x990c('0xa2')]=function(_0x138e2e,_0x16b77c,_0x2ed950){return db[_0x990c('0x40')]['findOne']({'where':{'id':_0x138e2e[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x16b77c,null))[_0x990c('0x20')](function(_0x4d53d1){if(_0x4d53d1){return db['sequelize'][_0x990c('0xa3')](function(_0x3dbc4d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x138e2e[_0x990c('0x59')]['id']},'transaction':_0x3dbc4d})['then'](function(_0x5c0918){var _0x4135fe=_[_0x990c('0x4d')](_0x138e2e[_0x990c('0x63')],function(_0x34f2b6){_0x34f2b6['OpenchannelAccountId']=_0x138e2e[_0x990c('0x59')]['id'];return _0x34f2b6;});return db['OpenchannelApplication'][_0x990c('0xa4')](_0x4135fe,{'transaction':_0x3dbc4d});});})[_0x990c('0x20')](function(){return db[_0x990c('0x85')][_0x990c('0xa5')]({'where':{'OpenchannelAccountId':_0x138e2e['params']['id']},'order':_0x990c('0x8b')});});}})[_0x990c('0x20')](respondWithResult(_0x16b77c,null))['catch'](handleError(_0x16b77c,null));};exports[_0x990c('0xa6')]=function(_0xb68ea1,_0x20171b,_0xf02f1a){var _0x4ffa82={};var _0x519b71={};var _0x8ad069;var _0x5e17e0;return db[_0x990c('0x40')][_0x990c('0x69')]({'where':{'id':_0xb68ea1[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x20171b,null))[_0x990c('0x20')](function(_0x4da96a){if(_0x4da96a){_0x8ad069=_0x4da96a;_0x519b71['model']=_['keys'](db[_0x990c('0x85')][_0x990c('0x41')]);_0x519b71[_0x990c('0x44')]=_[_0x990c('0x43')](_0xb68ea1[_0x990c('0x44')]);_0x519b71['filters']=_[_0x990c('0x5a')](_0x519b71[_0x990c('0x42')],_0x519b71[_0x990c('0x44')]);_0x4ffa82[_0x990c('0x46')]=_[_0x990c('0x5a')](_0x519b71[_0x990c('0x42')],qs['fields'](_0xb68ea1[_0x990c('0x44')][_0x990c('0x47')]));_0x4ffa82[_0x990c('0x46')]=_0x4ffa82[_0x990c('0x46')]['length']?_0x4ffa82[_0x990c('0x46')]:_0x519b71[_0x990c('0x42')];_0x4ffa82['order']=qs['sort'](_0xb68ea1[_0x990c('0x44')]['sort']);_0x4ffa82[_0x990c('0x4c')]=qs[_0x990c('0x45')](_['pick'](_0xb68ea1[_0x990c('0x44')],_0x519b71[_0x990c('0x45')]));if(_0xb68ea1[_0x990c('0x44')][_0x990c('0x52')]){_0x4ffa82[_0x990c('0x4c')]=_[_0x990c('0x53')](_0x4ffa82[_0x990c('0x4c')],{'$or':_['map'](_0x4ffa82[_0x990c('0x46')],function(_0x19ebf0){var _0x269e8d={};_0x269e8d[_0x19ebf0]={'$like':'%'+_0xb68ea1['query']['filter']+'%'};return _0x269e8d;})});}_0x4ffa82=_[_0x990c('0x53')]({},_0x4ffa82,_0xb68ea1[_0x990c('0x6c')]);return _0x8ad069[_0x990c('0xa6')](_0x4ffa82);}})[_0x990c('0x20')](function(_0x510146){if(_0x510146){_0x5e17e0=_0x510146['length'];if(!_0xb68ea1[_0x990c('0x44')][_0x990c('0x49')]('nolimit')){_0x4ffa82['limit']=qs['limit'](_0xb68ea1[_0x990c('0x44')][_0x990c('0x30')]);_0x4ffa82['offset']=qs['offset'](_0xb68ea1[_0x990c('0x44')][_0x990c('0x2f')]);}return _0x8ad069[_0x990c('0xa6')](_0x4ffa82);}})[_0x990c('0x20')](function(_0xb8e506){if(_0xb8e506){return _0xb8e506?{'count':_0x5e17e0,'rows':_0xb8e506}:null;}})[_0x990c('0x20')](respondWithResult(_0x20171b,null))[_0x990c('0x29')](handleError(_0x20171b,null));};exports[_0x990c('0xa7')]=function(_0x2ac6b8,_0x4deb60,_0x76f3d4){var _0x5d948b={'raw':![],'where':{}};var _0x4338df={};var _0xac8358={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x990c('0x69')]({'where':{'id':_0x2ac6b8[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x4deb60,null))[_0x990c('0x20')](function(_0x5574d6){if(_0x5574d6){_0x4338df[_0x990c('0x42')]=_[_0x990c('0x43')](db[_0x990c('0x91')][_0x990c('0x41')]);_0x4338df['query']=_[_0x990c('0x43')](_0x2ac6b8[_0x990c('0x44')]);_0x4338df['filters']=_[_0x990c('0x5a')](_0x4338df[_0x990c('0x42')],_0x4338df[_0x990c('0x44')]);_0x5d948b[_0x990c('0x46')]=_[_0x990c('0x5a')](_0x4338df['model'],qs[_0x990c('0x47')](_0x2ac6b8[_0x990c('0x44')][_0x990c('0x47')]));_0x5d948b['attributes']=_0x5d948b['attributes'][_0x990c('0x48')]?_0x5d948b[_0x990c('0x46')]:_0x4338df[_0x990c('0x42')];if(!_0x2ac6b8[_0x990c('0x44')]['hasOwnProperty'](_0x990c('0x4a'))){_0x5d948b[_0x990c('0x30')]=qs[_0x990c('0x30')](_0x2ac6b8[_0x990c('0x44')][_0x990c('0x30')]);_0x5d948b['offset']=qs['offset'](_0x2ac6b8[_0x990c('0x44')][_0x990c('0x2f')]);}_0x5d948b[_0x990c('0x4b')]=qs['sort'](_0x2ac6b8[_0x990c('0x44')][_0x990c('0x6a')]);_0x5d948b[_0x990c('0x4c')]=qs[_0x990c('0x45')](_[_0x990c('0x71')](_0x2ac6b8[_0x990c('0x44')],_0x4338df[_0x990c('0x45')]));_0x5d948b[_0x990c('0x4c')][_0x990c('0x6b')]=_0x5574d6['id'];if(_0x2ac6b8[_0x990c('0x44')][_0x990c('0x52')]){_0x5d948b[_0x990c('0x4c')]=_[_0x990c('0x53')](_0x5d948b['where'],{'$or':_[_0x990c('0x4d')](_0x5d948b[_0x990c('0x46')],function(_0x399b98){var _0x10946c={};_0x10946c[_0x399b98]={'$like':'%'+_0x2ac6b8[_0x990c('0x44')][_0x990c('0x52')]+'%'};return _0x10946c;})});}_0x5d948b=_[_0x990c('0x53')]({},_0x5d948b,_0x2ac6b8[_0x990c('0x6c')]);return db[_0x990c('0x91')][_0x990c('0x2e')]({'where':_0x5d948b[_0x990c('0x4c')]})[_0x990c('0x20')](function(_0x5cab2d){_0xac8358[_0x990c('0x2e')]=_0x5cab2d;if(_0x2ac6b8[_0x990c('0x44')][_0x990c('0x54')]){_0x5d948b['include']=[{'model':db['CmContact'],'as':_0x990c('0xa8'),'required':![]},{'model':db[_0x990c('0xa9')],'as':_0x990c('0xaa'),'attributes':[_0x990c('0x3b'),_0x990c('0xab'),_0x990c('0xac')],'required':![]},{'model':db[_0x990c('0xad')],'as':_0x990c('0xae'),'attributes':['id',_0x990c('0x3b'),'color'],'where':_0x2ac6b8[_0x990c('0x44')]['tag']?{'id':_0x2ac6b8['query'][_0x990c('0xaf')]}:undefined,'required':_0x2ac6b8[_0x990c('0x44')][_0x990c('0xaf')]?!![]:![]}];}return db[_0x990c('0x91')][_0x990c('0x56')](_0x5d948b);})[_0x990c('0x20')](function(_0x3c507e){_0xac8358[_0x990c('0x57')]=_0x3c507e;return _0xac8358;});}})[_0x990c('0x20')](respondWithFilteredResult(_0x4deb60,_0x5d948b))[_0x990c('0x29')](handleError(_0x4deb60,null));};exports[_0x990c('0xb0')]=function(_0x5c40a0,_0x2bf41d,_0x4d5577){return db[_0x990c('0x40')]['find']({'where':{'id':_0x5c40a0[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x2bf41d,null))['then'](function(_0x3b7fa3){if(_0x3b7fa3){return _0x3b7fa3[_0x990c('0xb0')](_0x5c40a0[_0x990c('0x63')][_0x990c('0x6e')],_[_0x990c('0xb1')](_0x5c40a0['body'],[_0x990c('0x6e'),'id'])||{})[_0x990c('0xb2')](function(_0xf30a03){for(var _0x2f43b6=0x0;_0x2f43b6<_0x5c40a0[_0x990c('0x63')]['ids']['length'];_0x2f43b6+=0x1){socket[_0x990c('0xb3')](_0x990c('0xb4'),{'UserId':_0x5c40a0['body'][_0x990c('0x6e')][_0x2f43b6],'OpenchannelAccountId':_0x5c40a0[_0x990c('0x59')]['id']});}return _0xf30a03;});}})[_0x990c('0x20')](respondWithResult(_0x2bf41d,null))[_0x990c('0x29')](handleError(_0x2bf41d,null));};exports[_0x990c('0xb5')]=function(_0x437e8a,_0x37fe6b,_0x5e6e1f){return db['OpenchannelAccount'][_0x990c('0x64')]({'where':{'id':_0x437e8a[_0x990c('0x59')]['id']}})['then'](handleEntityNotFound(_0x37fe6b,null))[_0x990c('0x20')](function(_0x5066f3){if(_0x5066f3){return _0x5066f3['removeAgents'](_0x437e8a[_0x990c('0x44')][_0x990c('0x6e')])[_0x990c('0x20')](function(){if(_['isArray'](_0x437e8a['query']['ids'])){for(var _0x24eb25=0x0;_0x24eb25<_0x437e8a['query'][_0x990c('0x6e')][_0x990c('0x48')];_0x24eb25+=0x1){socket[_0x990c('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x437e8a['query'][_0x990c('0x6e')][_0x24eb25]),'OpenchannelAccountId':Number(_0x437e8a['params']['id'])});}}else{socket[_0x990c('0xb3')](_0x990c('0xb6'),{'UserId':Number(_0x437e8a['query'][_0x990c('0x6e')]),'OpenchannelAccountId':Number(_0x437e8a['params']['id'])});}});}})[_0x990c('0x20')](respondWithStatusCode(_0x37fe6b,null))[_0x990c('0x29')](handleError(_0x37fe6b,null));};exports['getAgents']=function(_0x30ca57,_0xc75120,_0xb18931){var _0x12b307={};var _0x43550a={};var _0x43f09e;var _0x4a67cd;return db[_0x990c('0x40')][_0x990c('0x69')]({'where':{'id':_0x30ca57[_0x990c('0x59')]['id']}})['then'](handleEntityNotFound(_0xc75120,null))[_0x990c('0x20')](function(_0x1a4a76){if(_0x1a4a76){_0x43f09e=_0x1a4a76;_0x43550a[_0x990c('0x42')]=_[_0x990c('0x43')](db['User'][_0x990c('0x41')]);_0x43550a[_0x990c('0x44')]=_[_0x990c('0x43')](_0x30ca57[_0x990c('0x44')]);_0x43550a[_0x990c('0x45')]=_[_0x990c('0x5a')](_0x43550a[_0x990c('0x42')],_0x43550a[_0x990c('0x44')]);_0x12b307[_0x990c('0x46')]=_['intersection'](_0x43550a[_0x990c('0x42')],qs[_0x990c('0x47')](_0x30ca57[_0x990c('0x44')][_0x990c('0x47')]));_0x12b307['attributes']=_0x12b307[_0x990c('0x46')][_0x990c('0x48')]?_0x12b307[_0x990c('0x46')]:_0x43550a['model'];_0x12b307[_0x990c('0x4b')]=qs[_0x990c('0x6a')](_0x30ca57[_0x990c('0x44')][_0x990c('0x6a')]);_0x12b307[_0x990c('0x4c')]=qs[_0x990c('0x45')](_['pick'](_0x30ca57['query'],_0x43550a['filters']));if(_0x30ca57[_0x990c('0x44')][_0x990c('0x52')]){_0x12b307[_0x990c('0x4c')]=_['merge'](_0x12b307[_0x990c('0x4c')],{'$or':_[_0x990c('0x4d')](_0x12b307[_0x990c('0x46')],function(_0x39b90e){var _0x5c135b={};_0x5c135b[_0x39b90e]={'$like':'%'+_0x30ca57[_0x990c('0x44')][_0x990c('0x52')]+'%'};return _0x5c135b;})});}_0x12b307=_[_0x990c('0x53')]({},_0x12b307,_0x30ca57['options']);return _0x43f09e['getAgents'](_0x12b307);}})[_0x990c('0x20')](function(_0x379c92){if(_0x379c92){_0x4a67cd=_0x379c92[_0x990c('0x48')];if(!_0x30ca57[_0x990c('0x44')][_0x990c('0x49')](_0x990c('0x4a'))){_0x12b307['limit']=qs[_0x990c('0x30')](_0x30ca57[_0x990c('0x44')][_0x990c('0x30')]);_0x12b307[_0x990c('0x2f')]=qs[_0x990c('0x2f')](_0x30ca57[_0x990c('0x44')][_0x990c('0x2f')]);}return _0x43f09e[_0x990c('0xb7')](_0x12b307);}})[_0x990c('0x20')](function(_0x2b8b86){if(_0x2b8b86){return _0x2b8b86?{'count':_0x4a67cd,'rows':_0x2b8b86}:null;}})[_0x990c('0x20')](respondWithResult(_0xc75120,null))[_0x990c('0x29')](handleError(_0xc75120,null));};exports[_0x990c('0x3c')]=function(_0x246817,_0x5f35a0,_0x45a8e4){var _0x131b86,_0x5574fc,_0x1d28e9;if(_[_0x990c('0x7c')](_0x246817[_0x990c('0x63')][_0x990c('0x63')])||_0x246817[_0x990c('0x63')][_0x990c('0x63')]===''){throw new db[(_0x990c('0x75'))][(_0x990c('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x990c('0x7c')](_0x246817[_0x990c('0x63')]['to'])){}_0x131b86=_0x246817['body']['to'];return db[_0x990c('0x40')]['findOne']({'where':{'id':_0x246817[_0x990c('0x59')]['id']}})[_0x990c('0x20')](handleEntityNotFound(_0x5f35a0,null))['then'](function(_0xab2420){if(_0xab2420){return db[_0x990c('0x40')][_0x990c('0x64')]({'where':{'id':_0xab2420['id']},'include':[{'model':db['CmList'],'as':_0x990c('0x86'),'include':[{'model':db[_0x990c('0xb8')],'as':_0x990c('0x83'),'where':{[_0xab2420[_0x990c('0x7e')]]:_0x131b86},'limit':0x1,'order':[[_0x990c('0x79'),'DESC']]}]}]})[_0x990c('0x20')](handleEntityNotFound(_0x5f35a0,null))[_0x990c('0x20')](function(_0x427a31){if(_0x427a31&&_0x427a31[_0x990c('0x86')]){_0x5574fc=_0x427a31['get']({'plain':!![]});if(_0x5574fc[_0x990c('0x86')]&&_0x5574fc['List'][_0x990c('0x83')][_0x990c('0x48')]){return _0x5574fc[_0x990c('0x86')]['Contacts'][0x0];}return db['CmContact'][_0x990c('0x5b')](_['defaults'](_0x246817[_0x990c('0x63')],{'firstName':_0x131b86,[_0x427a31[_0x990c('0x7e')]]:_0x131b86,'phone':_0x131b86,'ListId':_0x5574fc[_0x990c('0x8d')]}));}})[_0x990c('0x20')](handleEntityNotFound(_0x5f35a0,null))[_0x990c('0x20')](function(_0x1ed950){if(_0x1ed950){_0x1d28e9=_0x1ed950;return db[_0x990c('0x91')][_0x990c('0x64')]({'where':{'ContactId':_0x1d28e9['id'],'closed':![],'OpenchannelAccountId':_0x5574fc['id']}})[_0x990c('0x20')](function(_0x2f5df2){if(_0x2f5df2){return[_0x2f5df2,![]];}return db['OpenchannelInteraction'][_0x990c('0x5b')]({'UserId':_0x246817[_0x990c('0x5c')]['id'],'ContactId':_0x1d28e9['id'],'OpenchannelAccountId':_0x5574fc['id'],'lastMsgDirection':'out','Messages':[_[_0x990c('0x53')](_0x246817['body'],{'read':![],'body':_0x246817[_0x990c('0x63')][_0x990c('0x63')],'OpenchannelAccountId':_0x5574fc['id'],'UserId':_0x246817[_0x990c('0x5c')]['id'],'ContactId':_0x1d28e9['id']})]},{'include':[{'model':db[_0x990c('0x9a')],'as':_0x990c('0xb9')}]})[_0x990c('0x20')](function(_0x2cf312){return[_0x2cf312,!![]];});});}})['spread'](function(_0x3fb197,_0x18241e){if(_0x18241e){return _0x3fb197;}return db['OpenchannelMessage'][_0x990c('0x5b')](_['merge'](_0x246817[_0x990c('0x63')],{'read':![],'body':_0x246817['body'][_0x990c('0x63')],'OpenchannelAccountId':_0x5574fc['id'],'OpenchannelInteractionId':_0x3fb197['id'],'UserId':_0x246817['user']['id'],'ContactId':_0x1d28e9['id']}))[_0x990c('0x20')](function(_0x23aaac){_0x3fb197[_0x990c('0xba')][_0x990c('0xb9')]=[];_0x3fb197['dataValues']['Messages']['push'](_0x23aaac['dataValues']);return _0x3fb197;});});}})[_0x990c('0x20')](respondWithResult(_0x5f35a0,null))['catch'](handleError(_0x5f35a0,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index a8cd713..4cfd5e3 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 _0xb586=['update','remove','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x197115,_0x14d69a){var _0x19d830=function(_0x1f59c5){while(--_0x1f59c5){_0x197115['push'](_0x197115['shift']());}};_0x19d830(++_0x14d69a);}(_0xb586,0xbd));var _0x6b58=function(_0x104112,_0x342eb6){_0x104112=_0x104112-0x0;var _0x394ab4=_0xb586[_0x104112];return _0x394ab4;};'use strict';var EventEmitter=require(_0x6b58('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b58('0x1')](0x0);var events={'afterCreate':_0x6b58('0x2'),'afterUpdate':_0x6b58('0x3'),'afterDestroy':_0x6b58('0x4')};function emitEvent(_0x5c5e11){return function(_0x3233a3,_0x12e2b2,_0x27edce){OpenchannelAccountEvents[_0x6b58('0x5')](_0x5c5e11+':'+_0x3233a3['id'],_0x3233a3);OpenchannelAccountEvents[_0x6b58('0x5')](_0x5c5e11,_0x3233a3);_0x27edce(null);};}for(var e in events){if(events[_0x6b58('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x6b58('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x51db=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3807af,_0x44bee8){var _0x48c8cc=function(_0x77ca5){while(--_0x77ca5){_0x3807af['push'](_0x3807af['shift']());}};_0x48c8cc(++_0x44bee8);}(_0x51db,0xb5));var _0xb51d=function(_0x384cc1,_0x2c01d4){_0x384cc1=_0x384cc1-0x0;var _0x94c39b=_0x51db[_0x384cc1];return _0x94c39b;};'use strict';var EventEmitter=require(_0xb51d('0x0'));var OpenchannelAccount=require(_0xb51d('0x1'))['db'][_0xb51d('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb51d('0x3')](0x0);var events={'afterCreate':_0xb51d('0x4'),'afterUpdate':_0xb51d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5621ca){return function(_0x2ec883,_0x1e541a,_0x3296b5){OpenchannelAccountEvents[_0xb51d('0x6')](_0x5621ca+':'+_0x2ec883['id'],_0x2ec883);OpenchannelAccountEvents[_0xb51d('0x6')](_0x5621ca,_0x2ec883);_0x3296b5(null);};}for(var e in events){if(events[_0xb51d('0x7')](e)){var event=events[e];OpenchannelAccount[_0xb51d('0x8')](e,emitEvent(event));}}module[_0xb51d('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 23fb36e..68d3e92 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 _0x299c=['../../config/environment','exports','OpenchannelAccount','openchannel_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x299c,0x180));var _0xc299=function(_0x2cddaf,_0x58b553){_0x2cddaf=_0x2cddaf-0x0;var _0x335b8e=_0x299c[_0x2cddaf];return _0x335b8e;};'use strict';var _=require(_0xc299('0x0'));var util=require('util');var logger=require(_0xc299('0x1'))('api');var moment=require(_0xc299('0x2'));var BPromise=require(_0xc299('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc299('0x4'));var rimraf=require(_0xc299('0x5'));var config=require(_0xc299('0x6'));var attributes=require('./openchannelAccount.attributes');module[_0xc299('0x7')]=function(_0x2e4c78,_0x135061){return _0x2e4c78['define'](_0xc299('0x8'),attributes,{'tableName':_0xc299('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf86=['rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x49bd8a,_0x3fb36b){var _0x19e670=function(_0x3c4aa6){while(--_0x3c4aa6){_0x49bd8a['push'](_0x49bd8a['shift']());}};_0x19e670(++_0x3fb36b);}(_0xcf86,0x165));var _0x6cf8=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xcf86[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x6cf8('0x0'));var util=require(_0x6cf8('0x1'));var logger=require(_0x6cf8('0x2'))(_0x6cf8('0x3'));var moment=require(_0x6cf8('0x4'));var BPromise=require('bluebird');var rp=require(_0x6cf8('0x5'));var fs=require('fs');var path=require(_0x6cf8('0x6'));var rimraf=require(_0x6cf8('0x7'));var config=require(_0x6cf8('0x8'));var attributes=require(_0x6cf8('0x9'));module[_0x6cf8('0xa')]=function(_0x1cbe09,_0x989abd){return _0x1cbe09[_0x6cf8('0xb')](_0x6cf8('0xc'),attributes,{'tableName':_0x6cf8('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 6e5388a..00178d9 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 _0xc4aa=['redis','defaults','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b87f4,_0x5177c4){var _0xc17634=function(_0x285c4c){while(--_0x285c4c){_0x2b87f4['push'](_0x2b87f4['shift']());}};_0xc17634(++_0x5177c4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});config[_0xac4a('0xb')]=_[_0xac4a('0xc')](config[_0xac4a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac4a('0xb')]));require(_0xac4a('0xd'))[_0xac4a('0xe')](socket);function respondWithRpcPromise(_0x4f4146,_0x1d182e,_0x3a82de){return new BPromise(function(_0x3e64f5,_0x4d4acc){return client[_0xac4a('0xf')](_0x4f4146,_0x3a82de)['then'](function(_0x2f062c){logger['info'](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));logger[_0xac4a('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1d182e,_0xac4a('0x11'),JSON[_0xac4a('0x13')](_0x2f062c));if(_0x2f062c[_0xac4a('0x14')]){if(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x15')]===0x1f4){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x4d4acc(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}logger[_0xac4a('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x3e64f5(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}else{logger[_0xac4a('0x17')](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));_0x3e64f5(_0x2f062c[_0xac4a('0x18')]['message']);}})['catch'](function(_0x21a729){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x21a729);_0x4d4acc(_0x21a729);});});} \ No newline at end of file +var _0xc4aa=['redis','defaults','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4ccbf1,_0x50da48){var _0x49af25=function(_0x244364){while(--_0x244364){_0x4ccbf1['push'](_0x4ccbf1['shift']());}};_0x49af25(++_0x50da48);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});config[_0xac4a('0xb')]=_[_0xac4a('0xc')](config[_0xac4a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac4a('0xb')]));require(_0xac4a('0xd'))[_0xac4a('0xe')](socket);function respondWithRpcPromise(_0x4f4146,_0x1d182e,_0x3a82de){return new BPromise(function(_0x3e64f5,_0x4d4acc){return client[_0xac4a('0xf')](_0x4f4146,_0x3a82de)['then'](function(_0x2f062c){logger['info'](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));logger[_0xac4a('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1d182e,_0xac4a('0x11'),JSON[_0xac4a('0x13')](_0x2f062c));if(_0x2f062c[_0xac4a('0x14')]){if(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x15')]===0x1f4){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x4d4acc(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}logger[_0xac4a('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x3e64f5(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}else{logger[_0xac4a('0x17')](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));_0x3e64f5(_0x2f062c[_0xac4a('0x18')]['message']);}})['catch'](function(_0x21a729){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x21a729);_0x4d4acc(_0x21a729);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a8771d6..86d090a 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 _0xec2d=['remove','update','emit','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x13e0ef,_0x2b966b){var _0x3617e3=function(_0x2fde67){while(--_0x2fde67){_0x13e0ef['push'](_0x13e0ef['shift']());}};_0x3617e3(++_0x2b966b);}(_0xec2d,0xbe));var _0xdec2=function(_0x3b6f58,_0x5870de){_0x3b6f58=_0x3b6f58-0x0;var _0x987c61=_0xec2d[_0x3b6f58];return _0x987c61;};'use strict';var OpenchannelAccountEvents=require(_0xdec2('0x0'));var events=[_0xdec2('0x1'),_0xdec2('0x2'),_0xdec2('0x3')];function createListener(_0x5358ea,_0x71a6f1){return function(_0x411647){_0x71a6f1[_0xdec2('0x4')](_0x5358ea,_0x411647);};}function removeListener(_0x4e4ed4,_0x2ff45f){return function(){OpenchannelAccountEvents['removeListener'](_0x4e4ed4,_0x2ff45f);};}exports[_0xdec2('0x5')]=function(_0x38912e){for(var _0x3c688b=0x0,_0x273192=events[_0xdec2('0x6')];_0x3c688b<_0x273192;_0x3c688b++){var _0x37c3cb=events[_0x3c688b];var _0x1b00fa=createListener(_0xdec2('0x7')+_0x37c3cb,_0x38912e);OpenchannelAccountEvents['on'](_0x37c3cb,_0x1b00fa);}}; \ No newline at end of file +var _0xe953=['removeListener','update','emit'];(function(_0x4d549d,_0xdc47f7){var _0x23cc7e=function(_0x407213){while(--_0x407213){_0x4d549d['push'](_0x4d549d['shift']());}};_0x23cc7e(++_0xdc47f7);}(_0xe953,0x1d2));var _0x3e95=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xe953[_0x44946b];return _0x249bc4;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save','remove',_0x3e95('0x0')];function createListener(_0x9aa3f0,_0x57e8be){return function(_0x550df9){_0x57e8be[_0x3e95('0x1')](_0x9aa3f0,_0x550df9);};}function removeListener(_0xdbcad6,_0x23ce99){return function(){OpenchannelAccountEvents[_0x3e95('0x2')](_0xdbcad6,_0x23ce99);};}exports['register']=function(_0x1cdfdd){for(var _0x1ede98=0x0,_0x2ce8f3=events['length'];_0x1ede98<_0x2ce8f3;_0x1ede98++){var _0x52be4e=events[_0x1ede98];var _0x5239f2=createListener('openchannelAccount:'+_0x52be4e,_0x1cdfdd);OpenchannelAccountEvents['on'](_0x52be4e,_0x5239f2);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 5f1585c..c4d378a 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 _0x91f3=['util','path','express','Router','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','get','/:id','post','create','update','delete','exports'];(function(_0x11fdb0,_0xe744ef){var _0x558d7c=function(_0x3c74c4){while(--_0x3c74c4){_0x11fdb0['push'](_0x11fdb0['shift']());}};_0x558d7c(++_0xe744ef);}(_0x91f3,0x1e0));var _0x391f=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x91f3[_0x467488];return _0x56107f;};'use strict';var multer=require('multer');var util=require(_0x391f('0x0'));var path=require(_0x391f('0x1'));var timeout=require('connect-timeout');var express=require(_0x391f('0x2'));var router=express[_0x391f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x391f('0x4'));var config=require('../../config/environment');var controller=require(_0x391f('0x5'));router['get']('/',auth[_0x391f('0x6')](),controller[_0x391f('0x7')]);router[_0x391f('0x8')](_0x391f('0x9'),auth[_0x391f('0x6')](),controller['show']);router[_0x391f('0xa')]('/',auth[_0x391f('0x6')](),controller[_0x391f('0xb')]);router['put'](_0x391f('0x9'),auth[_0x391f('0x6')](),controller[_0x391f('0xc')]);router[_0x391f('0xd')](_0x391f('0x9'),auth[_0x391f('0x6')](),controller['destroy']);module[_0x391f('0xe')]=router; \ No newline at end of file +var _0x984f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x6bddc3,_0x36563e){var _0x868581=function(_0x3a2628){while(--_0x3a2628){_0x6bddc3['push'](_0x6bddc3['shift']());}};_0x868581(++_0x36563e);}(_0x984f,0xc1));var _0xf984=function(_0x23e337,_0x1e3c57){_0x23e337=_0x23e337-0x0;var _0x45facf=_0x984f[_0x23e337];return _0x45facf;};'use strict';var multer=require(_0xf984('0x0'));var util=require(_0xf984('0x1'));var path=require(_0xf984('0x2'));var timeout=require(_0xf984('0x3'));var express=require(_0xf984('0x4'));var router=express['Router']();var auth=require(_0xf984('0x5'));var interaction=require(_0xf984('0x6'));var config=require(_0xf984('0x7'));var controller=require(_0xf984('0x8'));router[_0xf984('0x9')]('/',auth[_0xf984('0xa')](),controller['index']);router[_0xf984('0x9')](_0xf984('0xb'),auth[_0xf984('0xa')](),controller[_0xf984('0xc')]);router['post']('/',auth[_0xf984('0xa')](),controller[_0xf984('0xd')]);router[_0xf984('0xe')](_0xf984('0xb'),auth['isAuthenticated'](),controller[_0xf984('0xf')]);router['delete'](_0xf984('0xb'),auth[_0xf984('0xa')](),controller[_0xf984('0x10')]);module[_0xf984('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 412ae85..62c1ed4 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 _0x6851=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x4c9472,_0x2a6a24){var _0x29e182=function(_0x2701c6){while(--_0x2701c6){_0x4c9472['push'](_0x4c9472['shift']());}};_0x29e182(++_0x2a6a24);}(_0x6851,0x1df));var _0x1685=function(_0x17f716,_0x4a06c7){_0x17f716=_0x17f716-0x0;var _0x31f0de=_0x6851[_0x17f716];return _0x31f0de;};'use strict';var Sequelize=require(_0x1685('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1685('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1685('0x2')],'allowNull':![],'defaultValue':_0x1685('0x3')},'appdata':{'type':Sequelize[_0x1685('0x4')]()},'description':{'type':Sequelize[_0x1685('0x2')]},'interval':{'type':Sequelize[_0x1685('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1189=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x249f8c,_0xfb3946){var _0x5e224a=function(_0xd4c5a1){while(--_0xd4c5a1){_0x249f8c['push'](_0x249f8c['shift']());}};_0x5e224a(++_0xfb3946);}(_0x1189,0x17f));var _0x9118=function(_0x190c6a,_0x12b67a){_0x190c6a=_0x190c6a-0x0;var _0x2b93f1=_0x1189[_0x190c6a];return _0x2b93f1;};'use strict';var Sequelize=require(_0x9118('0x0'));module[_0x9118('0x1')]={'priority':{'type':Sequelize[_0x9118('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9118('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9118('0x4')]()},'description':{'type':Sequelize[_0x9118('0x3')]},'interval':{'type':Sequelize[_0x9118('0x3')],'defaultValue':_0x9118('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 5adc859..ed56bc1 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 _0xc136=['params','rawAttributes','length','options','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','index','OpenchannelApplication','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','field','includeAll','include','rows','catch','show'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xc136,0xda));var _0x6c13=function(_0x716b44,_0xf08c1a){_0x716b44=_0x716b44-0x0;var _0xe93129=_0xc136[_0x716b44];return _0xe93129;};'use strict';var pdf=require(_0x6c13('0x0'));var emlformat=require(_0x6c13('0x1'));var rimraf=require(_0x6c13('0x2'));var zipdir=require(_0x6c13('0x3'));var jsonpatch=require(_0x6c13('0x4'));var rp=require(_0x6c13('0x5'));var moment=require('moment');var BPromise=require(_0x6c13('0x6'));var Mustache=require(_0x6c13('0x7'));var util=require(_0x6c13('0x8'));var path=require(_0x6c13('0x9'));var sox=require(_0x6c13('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6c13('0xb'));var jsforce=require(_0x6c13('0xc'));var deskjs=require(_0x6c13('0xd'));var toCsv=require(_0x6c13('0xe'));var querystring=require('querystring');var Papa=require(_0x6c13('0xf'));var Redis=require(_0x6c13('0x10'));var authService=require(_0x6c13('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6c13('0x12'));var logger=require(_0x6c13('0x13'))('api');var utils=require(_0x6c13('0x14'));var config=require(_0x6c13('0x15'));var db=require(_0x6c13('0x16'))['db'];function respondWithStatusCode(_0x586c49,_0x3a39f6){_0x3a39f6=_0x3a39f6||0xcc;return function(_0x37fb76){if(_0x37fb76){return _0x586c49[_0x6c13('0x17')](_0x3a39f6);}return _0x586c49[_0x6c13('0x18')](_0x3a39f6)['end']();};}function respondWithResult(_0x193d9b,_0x1c4c10){_0x1c4c10=_0x1c4c10||0xc8;return function(_0x431b32){if(_0x431b32){return _0x193d9b['status'](_0x1c4c10)['json'](_0x431b32);}};}function respondWithFilteredResult(_0x35322f,_0x2d40ae){return function(_0x5286c4){if(_0x5286c4){var _0x102e67=_0x5286c4[_0x6c13('0x19')],_0x27b225=_0x2d40ae['offset'],_0x2226ff=_0x2d40ae[_0x6c13('0x1a')]+_0x2d40ae[_0x6c13('0x1b')],_0x22c864;if(_0x2226ff>=_0x102e67){_0x2226ff=_0x102e67;_0x22c864=0xc8;}else{_0x22c864=0xce;}_0x35322f[_0x6c13('0x18')](_0x22c864);return _0x35322f[_0x6c13('0x1c')](_0x6c13('0x1d'),_0x27b225+'-'+_0x2226ff+'/'+_0x102e67)['json'](_0x5286c4);}return null;};}function patchUpdates(_0x308a3a){return function(_0x4f6a1e){try{jsonpatch[_0x6c13('0x1e')](_0x4f6a1e,_0x308a3a,!![]);}catch(_0x5dbb41){return BPromise['reject'](_0x5dbb41);}return _0x4f6a1e[_0x6c13('0x1f')]();};}function saveUpdates(_0x13477e,_0x39d72a){return function(_0x4b22af){if(_0x4b22af){return _0x4b22af[_0x6c13('0x20')](_0x13477e)[_0x6c13('0x21')](function(_0x519061){return _0x519061;});}return null;};}function removeEntity(_0x27c248,_0xfa092f){return function(_0x379d29){if(_0x379d29){return _0x379d29['destroy']()['then'](function(){_0x27c248[_0x6c13('0x18')](0xcc)[_0x6c13('0x22')]();});}};}function handleEntityNotFound(_0x3f44b6,_0x235602){return function(_0x5c1cc9){if(!_0x5c1cc9){_0x3f44b6[_0x6c13('0x17')](0x194);}return _0x5c1cc9;};}function handleError(_0x42a7e2,_0x5a55c4){_0x5a55c4=_0x5a55c4||0x1f4;return function(_0x2c662e){logger[_0x6c13('0x23')](_0x2c662e[_0x6c13('0x24')]);if(_0x2c662e['name']){delete _0x2c662e['name'];}_0x42a7e2[_0x6c13('0x18')](_0x5a55c4)['send'](_0x2c662e);};}exports[_0x6c13('0x25')]=function(_0x4b8ed5,_0x53681f){var _0x18a0cf={},_0x1864b1={},_0x1bc839={'count':0x0,'rows':[]};var _0x480133=db[_0x6c13('0x26')]['rawAttributes'];_0x1864b1['model']=_['keys'](_0x480133);_0x1864b1[_0x6c13('0x27')]=_[_0x6c13('0x28')](_0x4b8ed5[_0x6c13('0x27')]);_0x1864b1[_0x6c13('0x29')]=_[_0x6c13('0x2a')](_0x1864b1[_0x6c13('0x2b')],_0x1864b1[_0x6c13('0x27')]);_0x18a0cf[_0x6c13('0x2c')]=_['intersection'](_0x1864b1[_0x6c13('0x2b')],qs['fields'](_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x2d')]));_0x18a0cf['attributes']=_0x18a0cf['attributes']['length']?_0x18a0cf[_0x6c13('0x2c')]:_0x1864b1['model'];if(!_0x4b8ed5['query'][_0x6c13('0x2e')](_0x6c13('0x2f'))){_0x18a0cf['limit']=qs[_0x6c13('0x1b')](_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x1b')]);_0x18a0cf['offset']=qs[_0x6c13('0x1a')](_0x4b8ed5[_0x6c13('0x27')]['offset']);}_0x18a0cf['order']=qs[_0x6c13('0x30')](_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x30')]);_0x18a0cf['where']=qs[_0x6c13('0x29')](_[_0x6c13('0x31')](_0x4b8ed5['query'],_0x1864b1[_0x6c13('0x29')]));if(_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x32')]){_0x18a0cf[_0x6c13('0x33')]=_[_0x6c13('0x34')](_0x18a0cf[_0x6c13('0x33')],{'$or':_[_0x6c13('0x35')](_0x480133,function(_0x2c7316){if(_0x2c7316[_0x6c13('0x36')][_0x6c13('0x37')]!=='VIRTUAL'){var _0x448610={};_0x448610[_0x2c7316[_0x6c13('0x38')]]={'$like':'%'+_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x32')]+'%'};return _0x448610;}})});}_0x18a0cf=_[_0x6c13('0x34')]({},_0x18a0cf,_0x4b8ed5['options']);var _0x3bc76b={'where':_0x18a0cf[_0x6c13('0x33')]};return db[_0x6c13('0x26')][_0x6c13('0x19')](_0x3bc76b)[_0x6c13('0x21')](function(_0x39f782){_0x1bc839[_0x6c13('0x19')]=_0x39f782;if(_0x4b8ed5[_0x6c13('0x27')][_0x6c13('0x39')]){_0x18a0cf[_0x6c13('0x3a')]=[{'all':!![]}];}return db[_0x6c13('0x26')]['findAll'](_0x18a0cf);})[_0x6c13('0x21')](function(_0x5bf680){_0x1bc839[_0x6c13('0x3b')]=_0x5bf680;return _0x1bc839;})['then'](respondWithFilteredResult(_0x53681f,_0x18a0cf))[_0x6c13('0x3c')](handleError(_0x53681f,null));};exports[_0x6c13('0x3d')]=function(_0x5d9ae0,_0x1b8e88){var _0x8788c2={'raw':!![],'where':{'id':_0x5d9ae0[_0x6c13('0x3e')]['id']}},_0x14fd14={};_0x14fd14[_0x6c13('0x2b')]=_[_0x6c13('0x28')](db[_0x6c13('0x26')][_0x6c13('0x3f')]);_0x14fd14['query']=_[_0x6c13('0x28')](_0x5d9ae0[_0x6c13('0x27')]);_0x14fd14['filters']=_['intersection'](_0x14fd14[_0x6c13('0x2b')],_0x14fd14[_0x6c13('0x27')]);_0x8788c2[_0x6c13('0x2c')]=_[_0x6c13('0x2a')](_0x14fd14[_0x6c13('0x2b')],qs[_0x6c13('0x2d')](_0x5d9ae0[_0x6c13('0x27')][_0x6c13('0x2d')]));_0x8788c2[_0x6c13('0x2c')]=_0x8788c2[_0x6c13('0x2c')][_0x6c13('0x40')]?_0x8788c2[_0x6c13('0x2c')]:_0x14fd14[_0x6c13('0x2b')];if(_0x5d9ae0['query']['includeAll']){_0x8788c2['include']=[{'all':!![]}];}_0x8788c2=_[_0x6c13('0x34')]({},_0x8788c2,_0x5d9ae0[_0x6c13('0x41')]);return db[_0x6c13('0x26')][_0x6c13('0x42')](_0x8788c2)[_0x6c13('0x21')](handleEntityNotFound(_0x1b8e88,null))[_0x6c13('0x21')](respondWithResult(_0x1b8e88,null))[_0x6c13('0x3c')](handleError(_0x1b8e88,null));};exports[_0x6c13('0x43')]=function(_0x52361b,_0x497450){return db[_0x6c13('0x26')][_0x6c13('0x43')](_0x52361b['body'],{})['then'](respondWithResult(_0x497450,0xc9))['catch'](handleError(_0x497450,null));};exports['update']=function(_0x7ccbf2,_0x4331a1){if(_0x7ccbf2[_0x6c13('0x44')]['id']){delete _0x7ccbf2[_0x6c13('0x44')]['id'];}return db[_0x6c13('0x26')][_0x6c13('0x42')]({'where':{'id':_0x7ccbf2[_0x6c13('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4331a1,null))[_0x6c13('0x21')](saveUpdates(_0x7ccbf2[_0x6c13('0x44')],null))[_0x6c13('0x21')](respondWithResult(_0x4331a1,null))[_0x6c13('0x3c')](handleError(_0x4331a1,null));};exports[_0x6c13('0x45')]=function(_0x58c7f6,_0x1c49af){return db[_0x6c13('0x26')][_0x6c13('0x42')]({'where':{'id':_0x58c7f6[_0x6c13('0x3e')]['id']}})[_0x6c13('0x21')](handleEntityNotFound(_0x1c49af,null))[_0x6c13('0x21')](removeEntity(_0x1c49af,null))[_0x6c13('0x3c')](handleError(_0x1c49af,null));}; \ No newline at end of file +var _0x0c19=['pick','filter','merge','type','key','VIRTUAL','options','OpenchannelApplication','count','include','findAll','rows','show','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','destroy','then','error','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x0c19,0xd5));var _0x90c1=function(_0x51a73d,_0x20af4b){_0x51a73d=_0x51a73d-0x0;var _0x271937=_0x0c19[_0x51a73d];return _0x271937;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90c1('0x0'));var rimraf=require(_0x90c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90c1('0x2'));var rp=require(_0x90c1('0x3'));var moment=require('moment');var BPromise=require(_0x90c1('0x4'));var Mustache=require(_0x90c1('0x5'));var util=require(_0x90c1('0x6'));var path=require(_0x90c1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x90c1('0x8'));var fs=require('fs');var _=require(_0x90c1('0x9'));var squel=require(_0x90c1('0xa'));var crypto=require(_0x90c1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x90c1('0xc'));var toCsv=require(_0x90c1('0xd'));var querystring=require(_0x90c1('0xe'));var Papa=require('papaparse');var Redis=require(_0x90c1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x90c1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90c1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd5a413,_0x4caacc){_0x4caacc=_0x4caacc||0xcc;return function(_0x4bc00c){if(_0x4bc00c){return _0xd5a413[_0x90c1('0x12')](_0x4caacc);}return _0xd5a413[_0x90c1('0x13')](_0x4caacc)[_0x90c1('0x14')]();};}function respondWithResult(_0x201875,_0x8cde13){_0x8cde13=_0x8cde13||0xc8;return function(_0x38a89d){if(_0x38a89d){return _0x201875[_0x90c1('0x13')](_0x8cde13)[_0x90c1('0x15')](_0x38a89d);}};}function respondWithFilteredResult(_0x38cb13,_0x5a25cc){return function(_0x530f91){if(_0x530f91){var _0x46b65e=_0x530f91['count'],_0xaaddc2=_0x5a25cc['offset'],_0x561a74=_0x5a25cc[_0x90c1('0x16')]+_0x5a25cc['limit'],_0x30287b;if(_0x561a74>=_0x46b65e){_0x561a74=_0x46b65e;_0x30287b=0xc8;}else{_0x30287b=0xce;}_0x38cb13['status'](_0x30287b);return _0x38cb13[_0x90c1('0x17')](_0x90c1('0x18'),_0xaaddc2+'-'+_0x561a74+'/'+_0x46b65e)[_0x90c1('0x15')](_0x530f91);}return null;};}function patchUpdates(_0x16417c){return function(_0x34a7aa){try{jsonpatch[_0x90c1('0x19')](_0x34a7aa,_0x16417c,!![]);}catch(_0x1abf1a){return BPromise['reject'](_0x1abf1a);}return _0x34a7aa[_0x90c1('0x1a')]();};}function saveUpdates(_0x5b8369,_0x149daa){return function(_0x595e02){if(_0x595e02){return _0x595e02[_0x90c1('0x1b')](_0x5b8369)['then'](function(_0x33249a){return _0x33249a;});}return null;};}function removeEntity(_0x1a211c,_0xb463fa){return function(_0x198cb9){if(_0x198cb9){return _0x198cb9[_0x90c1('0x1c')]()[_0x90c1('0x1d')](function(){_0x1a211c[_0x90c1('0x13')](0xcc)[_0x90c1('0x14')]();});}};}function handleEntityNotFound(_0x397db9,_0x345529){return function(_0x3d9171){if(!_0x3d9171){_0x397db9[_0x90c1('0x12')](0x194);}return _0x3d9171;};}function handleError(_0x45e56c,_0x163414){_0x163414=_0x163414||0x1f4;return function(_0x2d55d5){logger[_0x90c1('0x1e')](_0x2d55d5['stack']);if(_0x2d55d5[_0x90c1('0x1f')]){delete _0x2d55d5[_0x90c1('0x1f')];}_0x45e56c[_0x90c1('0x13')](_0x163414)['send'](_0x2d55d5);};}exports['index']=function(_0x1c2264,_0x41b655){var _0x4689e0={},_0x35e8a6={},_0x328f48={'count':0x0,'rows':[]};var _0x2e2e7e=db['OpenchannelApplication'][_0x90c1('0x20')];_0x35e8a6[_0x90c1('0x21')]=_[_0x90c1('0x22')](_0x2e2e7e);_0x35e8a6[_0x90c1('0x23')]=_[_0x90c1('0x22')](_0x1c2264['query']);_0x35e8a6[_0x90c1('0x24')]=_[_0x90c1('0x25')](_0x35e8a6[_0x90c1('0x21')],_0x35e8a6[_0x90c1('0x23')]);_0x4689e0[_0x90c1('0x26')]=_['intersection'](_0x35e8a6[_0x90c1('0x21')],qs[_0x90c1('0x27')](_0x1c2264['query'][_0x90c1('0x27')]));_0x4689e0[_0x90c1('0x26')]=_0x4689e0[_0x90c1('0x26')][_0x90c1('0x28')]?_0x4689e0[_0x90c1('0x26')]:_0x35e8a6['model'];if(!_0x1c2264['query'][_0x90c1('0x29')](_0x90c1('0x2a'))){_0x4689e0[_0x90c1('0x2b')]=qs['limit'](_0x1c2264['query']['limit']);_0x4689e0[_0x90c1('0x16')]=qs[_0x90c1('0x16')](_0x1c2264['query'][_0x90c1('0x16')]);}_0x4689e0[_0x90c1('0x2c')]=qs[_0x90c1('0x2d')](_0x1c2264[_0x90c1('0x23')][_0x90c1('0x2d')]);_0x4689e0[_0x90c1('0x2e')]=qs[_0x90c1('0x24')](_[_0x90c1('0x2f')](_0x1c2264['query'],_0x35e8a6[_0x90c1('0x24')]));if(_0x1c2264[_0x90c1('0x23')][_0x90c1('0x30')]){_0x4689e0[_0x90c1('0x2e')]=_[_0x90c1('0x31')](_0x4689e0[_0x90c1('0x2e')],{'$or':_['map'](_0x2e2e7e,function(_0x2ed61f){if(_0x2ed61f[_0x90c1('0x32')][_0x90c1('0x33')]!==_0x90c1('0x34')){var _0x28eafc={};_0x28eafc[_0x2ed61f['field']]={'$like':'%'+_0x1c2264['query'][_0x90c1('0x30')]+'%'};return _0x28eafc;}})});}_0x4689e0=_[_0x90c1('0x31')]({},_0x4689e0,_0x1c2264[_0x90c1('0x35')]);var _0x266ed9={'where':_0x4689e0[_0x90c1('0x2e')]};return db[_0x90c1('0x36')]['count'](_0x266ed9)[_0x90c1('0x1d')](function(_0x1cbade){_0x328f48[_0x90c1('0x37')]=_0x1cbade;if(_0x1c2264[_0x90c1('0x23')]['includeAll']){_0x4689e0[_0x90c1('0x38')]=[{'all':!![]}];}return db[_0x90c1('0x36')][_0x90c1('0x39')](_0x4689e0);})[_0x90c1('0x1d')](function(_0x1c98a7){_0x328f48[_0x90c1('0x3a')]=_0x1c98a7;return _0x328f48;})[_0x90c1('0x1d')](respondWithFilteredResult(_0x41b655,_0x4689e0))['catch'](handleError(_0x41b655,null));};exports[_0x90c1('0x3b')]=function(_0xaea2b9,_0x5dba8b){var _0x147887={'raw':!![],'where':{'id':_0xaea2b9['params']['id']}},_0x3ce5cd={};_0x3ce5cd[_0x90c1('0x21')]=_[_0x90c1('0x22')](db['OpenchannelApplication'][_0x90c1('0x20')]);_0x3ce5cd[_0x90c1('0x23')]=_[_0x90c1('0x22')](_0xaea2b9[_0x90c1('0x23')]);_0x3ce5cd[_0x90c1('0x24')]=_[_0x90c1('0x25')](_0x3ce5cd[_0x90c1('0x21')],_0x3ce5cd[_0x90c1('0x23')]);_0x147887[_0x90c1('0x26')]=_[_0x90c1('0x25')](_0x3ce5cd[_0x90c1('0x21')],qs[_0x90c1('0x27')](_0xaea2b9[_0x90c1('0x23')][_0x90c1('0x27')]));_0x147887['attributes']=_0x147887['attributes'][_0x90c1('0x28')]?_0x147887[_0x90c1('0x26')]:_0x3ce5cd['model'];if(_0xaea2b9[_0x90c1('0x23')]['includeAll']){_0x147887[_0x90c1('0x38')]=[{'all':!![]}];}_0x147887=_['merge']({},_0x147887,_0xaea2b9['options']);return db['OpenchannelApplication'][_0x90c1('0x3c')](_0x147887)[_0x90c1('0x1d')](handleEntityNotFound(_0x5dba8b,null))[_0x90c1('0x1d')](respondWithResult(_0x5dba8b,null))[_0x90c1('0x3d')](handleError(_0x5dba8b,null));};exports[_0x90c1('0x3e')]=function(_0x10ed4a,_0x5c23a4){return db[_0x90c1('0x36')][_0x90c1('0x3e')](_0x10ed4a['body'],{})[_0x90c1('0x1d')](respondWithResult(_0x5c23a4,0xc9))['catch'](handleError(_0x5c23a4,null));};exports[_0x90c1('0x1b')]=function(_0x2348e2,_0x56da7b){if(_0x2348e2[_0x90c1('0x3f')]['id']){delete _0x2348e2[_0x90c1('0x3f')]['id'];}return db[_0x90c1('0x36')][_0x90c1('0x3c')]({'where':{'id':_0x2348e2[_0x90c1('0x40')]['id']}})[_0x90c1('0x1d')](handleEntityNotFound(_0x56da7b,null))[_0x90c1('0x1d')](saveUpdates(_0x2348e2[_0x90c1('0x3f')],null))['then'](respondWithResult(_0x56da7b,null))['catch'](handleError(_0x56da7b,null));};exports[_0x90c1('0x1c')]=function(_0x345dd3,_0x3c8c40){return db['OpenchannelApplication'][_0x90c1('0x3c')]({'where':{'id':_0x345dd3['params']['id']}})['then'](handleEntityNotFound(_0x3c8c40,null))['then'](removeEntity(_0x3c8c40,null))['catch'](handleError(_0x3c8c40,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 53d6bc4..fc95a2b 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 _0xba78=['../../config/environment','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x3574c7,_0x25df5b){var _0x2e9681=function(_0x4d36f0){while(--_0x4d36f0){_0x3574c7['push'](_0x3574c7['shift']());}};_0x2e9681(++_0x25df5b);}(_0xba78,0x159));var _0x8ba7=function(_0x2ddcf0,_0x547c76){_0x2ddcf0=_0x2ddcf0-0x0;var _0x5ae14b=_0xba78[_0x2ddcf0];return _0x5ae14b;};'use strict';var _=require(_0x8ba7('0x0'));var util=require('util');var logger=require(_0x8ba7('0x1'))(_0x8ba7('0x2'));var moment=require('moment');var BPromise=require(_0x8ba7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8ba7('0x4'));var config=require(_0x8ba7('0x5'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x26fab5,_0x44c8d9){return _0x26fab5['define'](_0x8ba7('0x6'),attributes,{'tableName':_0x8ba7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ba7('0x8'),'collate':_0x8ba7('0x9')});}; \ No newline at end of file +var _0x4dcb=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','exports','OpenchannelApplication'];(function(_0x1b0ec2,_0x54316a){var _0x172a60=function(_0x5ba892){while(--_0x5ba892){_0x1b0ec2['push'](_0x1b0ec2['shift']());}};_0x172a60(++_0x54316a);}(_0x4dcb,0x153));var _0xb4dc=function(_0x1fb2d5,_0x37d049){_0x1fb2d5=_0x1fb2d5-0x0;var _0x6cd767=_0x4dcb[_0x1fb2d5];return _0x6cd767;};'use strict';var _=require(_0xb4dc('0x0'));var util=require(_0xb4dc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb4dc('0x2'));var BPromise=require(_0xb4dc('0x3'));var rp=require(_0xb4dc('0x4'));var fs=require('fs');var path=require(_0xb4dc('0x5'));var rimraf=require(_0xb4dc('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0xb4dc('0x7')]=function(_0x493ce7,_0x38f8bc){return _0x493ce7['define'](_0xb4dc('0x8'),attributes,{'tableName':_0xb4dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4dc('0xa'),'collate':_0xb4dc('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5e9bbcd..c3aa733 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 _0xac57=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','update','body','options','where','UpdateOpenchannelApplication'];(function(_0x2bdd00,_0x138793){var _0x7c5e30=function(_0x118f27){while(--_0x118f27){_0x2bdd00['push'](_0x2bdd00['shift']());}};_0x7c5e30(++_0x138793);}(_0xac57,0x6c));var _0x7ac5=function(_0x3736f7,_0xe2b1b4){_0x3736f7=_0x3736f7-0x0;var _0x4d1960=_0xac57[_0x3736f7];return _0x4d1960;};'use strict';var _=require(_0x7ac5('0x0'));var util=require(_0x7ac5('0x1'));var moment=require(_0x7ac5('0x2'));var BPromise=require(_0x7ac5('0x3'));var rs=require(_0x7ac5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ac5('0x5'))['db'];var utils=require(_0x7ac5('0x6'));var logger=require(_0x7ac5('0x7'))(_0x7ac5('0x8'));var config=require(_0x7ac5('0x9'));var jayson=require(_0x7ac5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a58c7,_0x4ee526,_0x3c2fc8){return new BPromise(function(_0x443004,_0x51f744){return client['request'](_0x5a58c7,_0x3c2fc8)[_0x7ac5('0xb')](function(_0x19b288){logger[_0x7ac5('0xc')](_0x7ac5('0xd'),_0x4ee526,'request\x20sent');logger[_0x7ac5('0xe')](_0x7ac5('0xf'),_0x4ee526,_0x7ac5('0x10'),JSON[_0x7ac5('0x11')](_0x19b288));if(_0x19b288['error']){if(_0x19b288[_0x7ac5('0x12')]['code']===0x1f4){logger['error'](_0x7ac5('0xd'),_0x4ee526,_0x19b288[_0x7ac5('0x12')]['message']);return _0x51f744(_0x19b288['error'][_0x7ac5('0x13')]);}logger[_0x7ac5('0x12')](_0x7ac5('0xd'),_0x4ee526,_0x19b288[_0x7ac5('0x12')][_0x7ac5('0x13')]);return _0x443004(_0x19b288['error'][_0x7ac5('0x13')]);}else{logger[_0x7ac5('0xc')](_0x7ac5('0xd'),_0x4ee526,'request\x20sent');_0x443004(_0x19b288[_0x7ac5('0x14')][_0x7ac5('0x13')]);}})[_0x7ac5('0x15')](function(_0x52694c){logger['error'](_0x7ac5('0xd'),_0x4ee526,_0x52694c);_0x51f744(_0x52694c);});});}exports['UpdateOpenchannelApplication']=function(_0x123942){var _0x5d1fbb=this;return new Promise(function(_0x219be1,_0x3c074d){return db['OpenchannelApplication'][_0x7ac5('0x16')](_0x123942[_0x7ac5('0x17')],{'raw':_0x123942[_0x7ac5('0x18')]?_0x123942[_0x7ac5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x123942['options']?_0x123942[_0x7ac5('0x18')][_0x7ac5('0x19')]||null:null,'attributes':_0x123942[_0x7ac5('0x18')]?_0x123942['options']['attributes']||null:null,'limit':_0x123942['options']?_0x123942[_0x7ac5('0x18')]['limit']||null:null})[_0x7ac5('0xb')](function(_0x437c1a){logger['info']('UpdateOpenchannelApplication',_0x123942);logger[_0x7ac5('0xe')](_0x7ac5('0x1a'),_0x123942,JSON['stringify'](_0x437c1a));_0x219be1(_0x437c1a);})[_0x7ac5('0x15')](function(_0x34f4af){logger[_0x7ac5('0x12')]('UpdateOpenchannelApplication',_0x34f4af['message'],_0x123942);_0x3c074d(_0x5d1fbb[_0x7ac5('0x12')](0x1f4,_0x34f4af[_0x7ac5('0x13')]));});});}; \ No newline at end of file +var _0xc911=['options','raw','where','attributes','limit','info','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0xc911,0x1c0));var _0x1c91=function(_0x252510,_0xff6570){_0x252510=_0x252510-0x0;var _0x2a07c8=_0xc911[_0x252510];return _0x2a07c8;};'use strict';var _=require(_0x1c91('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c91('0x1'));var fs=require('fs');var Redis=require(_0x1c91('0x2'));var db=require(_0x1c91('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c91('0x4'))(_0x1c91('0x5'));var config=require(_0x1c91('0x6'));var jayson=require(_0x1c91('0x7'));var client=jayson['client'][_0x1c91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e82da,_0xd0fa77,_0x38a86e){return new BPromise(function(_0x436080,_0x34d5d0){return client['request'](_0x4e82da,_0x38a86e)[_0x1c91('0x9')](function(_0x38db6c){logger['info'](_0x1c91('0xa'),_0xd0fa77,_0x1c91('0xb'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xd0fa77,'request\x20sent',JSON[_0x1c91('0xc')](_0x38db6c));if(_0x38db6c[_0x1c91('0xd')]){if(_0x38db6c[_0x1c91('0xd')][_0x1c91('0xe')]===0x1f4){logger[_0x1c91('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0xd0fa77,_0x38db6c[_0x1c91('0xd')][_0x1c91('0xf')]);return _0x34d5d0(_0x38db6c[_0x1c91('0xd')][_0x1c91('0xf')]);}logger['error'](_0x1c91('0xa'),_0xd0fa77,_0x38db6c[_0x1c91('0xd')][_0x1c91('0xf')]);return _0x436080(_0x38db6c[_0x1c91('0xd')]['message']);}else{logger['info'](_0x1c91('0xa'),_0xd0fa77,_0x1c91('0xb'));_0x436080(_0x38db6c[_0x1c91('0x10')][_0x1c91('0xf')]);}})['catch'](function(_0xb5e116){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xd0fa77,_0xb5e116);_0x34d5d0(_0xb5e116);});});}exports[_0x1c91('0x11')]=function(_0x1f9815){var _0xa65c95=this;return new Promise(function(_0x452a0c,_0x285443){return db[_0x1c91('0x12')]['update'](_0x1f9815[_0x1c91('0x13')],{'raw':_0x1f9815['options']?_0x1f9815[_0x1c91('0x14')][_0x1c91('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f9815[_0x1c91('0x14')]?_0x1f9815[_0x1c91('0x14')][_0x1c91('0x16')]||null:null,'attributes':_0x1f9815[_0x1c91('0x14')]?_0x1f9815[_0x1c91('0x14')][_0x1c91('0x17')]||null:null,'limit':_0x1f9815[_0x1c91('0x14')]?_0x1f9815[_0x1c91('0x14')][_0x1c91('0x18')]||null:null})[_0x1c91('0x9')](function(_0x5ecc87){logger[_0x1c91('0x19')](_0x1c91('0x11'),_0x1f9815);logger['debug']('UpdateOpenchannelApplication',_0x1f9815,JSON[_0x1c91('0xc')](_0x5ecc87));_0x452a0c(_0x5ecc87);})['catch'](function(_0x1f05a5){logger['error'](_0x1c91('0x11'),_0x1f05a5['message'],_0x1f9815);_0x285443(_0xa65c95[_0x1c91('0xd')](0x1f4,_0x1f05a5[_0x1c91('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c11b26f..4f3a752 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 _0x07e0=['openchannelinteraction:destroy','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x07e0,0xeb));var _0x007e=function(_0x20b822,_0x4affe3){_0x20b822=_0x20b822-0x0;var _0x3cd815=_0x07e0[_0x20b822];return _0x3cd815;};'use strict';var multer=require(_0x007e('0x0'));var util=require(_0x007e('0x1'));var path=require(_0x007e('0x2'));var timeout=require(_0x007e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x007e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x007e('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x007e('0x6')]('/',auth['isAuthenticated'](),controller[_0x007e('0x7')]);router[_0x007e('0x6')](_0x007e('0x8'),auth[_0x007e('0x9')](),controller[_0x007e('0xa')]);router[_0x007e('0x6')](_0x007e('0xb'),auth['isAuthenticated'](),controller[_0x007e('0xc')]);router[_0x007e('0x6')](_0x007e('0xd'),auth[_0x007e('0x9')](),controller[_0x007e('0xe')]);router[_0x007e('0x6')]('/:id/download',auth[_0x007e('0x9')](),controller[_0x007e('0xf')]);router[_0x007e('0x10')]('/',auth[_0x007e('0x9')](),controller[_0x007e('0x11')]);router[_0x007e('0x10')](_0x007e('0xd'),auth[_0x007e('0x9')](),controller[_0x007e('0x12')]);router[_0x007e('0x10')](_0x007e('0x13'),auth[_0x007e('0x9')](),interaction[_0x007e('0x14')](_0x007e('0x15'),_0x007e('0x16')),controller[_0x007e('0x17')]);router[_0x007e('0x18')](_0x007e('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x007e('0x15'),_0x007e('0x19')),controller['update']);router['delete']('/:id',auth[_0x007e('0x9')](),interaction['tracked'](_0x007e('0x15'),_0x007e('0x1a')),controller['destroy']);router[_0x007e('0x1b')](_0x007e('0x13'),auth[_0x007e('0x9')](),controller['removeTags']);module[_0x007e('0x1c')]=router; \ No newline at end of file +var _0x7545=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x7545,0x145));var _0x5754=function(_0x4d9b46,_0x536a82){_0x4d9b46=_0x4d9b46-0x0;var _0x53a8a1=_0x7545[_0x4d9b46];return _0x53a8a1;};'use strict';var multer=require(_0x5754('0x0'));var util=require(_0x5754('0x1'));var path=require(_0x5754('0x2'));var timeout=require('connect-timeout');var express=require(_0x5754('0x3'));var router=express[_0x5754('0x4')]();var auth=require(_0x5754('0x5'));var interaction=require(_0x5754('0x6'));var config=require(_0x5754('0x7'));var controller=require(_0x5754('0x8'));router[_0x5754('0x9')]('/',auth[_0x5754('0xa')](),controller[_0x5754('0xb')]);router[_0x5754('0x9')]('/describe',auth[_0x5754('0xa')](),controller[_0x5754('0xc')]);router[_0x5754('0x9')](_0x5754('0xd'),auth[_0x5754('0xa')](),controller[_0x5754('0xe')]);router[_0x5754('0x9')](_0x5754('0xf'),auth[_0x5754('0xa')](),controller['getMessages']);router[_0x5754('0x9')](_0x5754('0x10'),auth['isAuthenticated'](),controller[_0x5754('0x11')]);router[_0x5754('0x12')]('/',auth[_0x5754('0xa')](),controller['create']);router[_0x5754('0x12')](_0x5754('0xf'),auth[_0x5754('0xa')](),controller['addMessage']);router[_0x5754('0x12')](_0x5754('0x13'),auth['isAuthenticated'](),interaction[_0x5754('0x14')](_0x5754('0x15'),'openchannelinteraction:addtags'),controller[_0x5754('0x16')]);router[_0x5754('0x17')](_0x5754('0xd'),auth[_0x5754('0xa')](),interaction[_0x5754('0x14')](_0x5754('0x15'),_0x5754('0x18')),controller[_0x5754('0x19')]);router[_0x5754('0x1a')]('/:id',auth[_0x5754('0xa')](),interaction['tracked']('openchannel',_0x5754('0x1b')),controller[_0x5754('0x1c')]);router[_0x5754('0x1a')](_0x5754('0x13'),auth[_0x5754('0xa')](),controller['removeTags']);module[_0x5754('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index dc7a159..dfb56ed 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 _0x65ff=['STRING','ENUM','exports','BOOLEAN','DATE'];(function(_0x56cb83,_0x2b33d5){var _0x579621=function(_0x581abf){while(--_0x581abf){_0x56cb83['push'](_0x56cb83['shift']());}};_0x579621(++_0x2b33d5);}(_0x65ff,0x1dd));var _0xf65f=function(_0x330ac6,_0x3adc83){_0x330ac6=_0x330ac6-0x0;var _0x59b845=_0x65ff[_0x330ac6];return _0x59b845;};'use strict';var Sequelize=require('sequelize');module[_0xf65f('0x0')]={'closed':{'type':Sequelize[_0xf65f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf65f('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf65f('0x2')]},'threadId':{'type':Sequelize[_0xf65f('0x3')]},'externalUrl':{'type':Sequelize[_0xf65f('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf65f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf65f('0x3')]}}; \ No newline at end of file +var _0x385b=['STRING','ENUM','out','exports','DATE'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x385b,0x1a7));var _0xb385=function(_0xe7acb9,_0x479726){_0xe7acb9=_0xe7acb9-0x0;var _0x364bb6=_0x385b[_0xe7acb9];return _0x364bb6;};'use strict';var Sequelize=require('sequelize');module[_0xb385('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb385('0x1')]},'disposition':{'type':Sequelize[_0xb385('0x2')]},'note':{'type':Sequelize[_0xb385('0x2')]},'read1stAt':{'type':Sequelize[_0xb385('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb385('0x2')]},'lastMsgAt':{'type':Sequelize[_0xb385('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb385('0x3')]('in',_0xb385('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb385('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 067dcac..85d57f6 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 _0x4091=['spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','join','Messages','direction','secret','User','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','fullname','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','closed','closedAt','disposition','Private','basename','createReadStream','pipe','createWriteStream','out','System','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','status','json','count','offset','limit','apply','update','destroy','then','sendStatus','error','stack','name','unreadMessages','OpenchannelMessage','Users','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','select','field','color','COUNT(*)','from','where','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','expr','advancedFilter','parse','createdAt','value','dateStart','day','utc','endOf','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','Messages.count','isArray','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','map','filter','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','QueryTypes','SELECT','clone','read','having','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','%s\x20=\x200','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','params','rawAttributes','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','sort','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4091,0x1f2));var _0x1409=function(_0x1c648e,_0x5446fc){_0x1c648e=_0x1c648e-0x0;var _0x30608f=_0x4091[_0x1c648e];return _0x30608f;};'use strict';var pdf=require(_0x1409('0x0'));var emlformat=require(_0x1409('0x1'));var rimraf=require(_0x1409('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1409('0x3'));var rp=require(_0x1409('0x4'));var moment=require(_0x1409('0x5'));var BPromise=require(_0x1409('0x6'));var Mustache=require(_0x1409('0x7'));var util=require(_0x1409('0x8'));var path=require('path');var sox=require(_0x1409('0x9'));var csv=require(_0x1409('0xa'));var ejs=require(_0x1409('0xb'));var fs=require('fs');var _=require(_0x1409('0xc'));var squel=require(_0x1409('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1409('0xe'));var toCsv=require(_0x1409('0xa'));var querystring=require(_0x1409('0xf'));var Papa=require(_0x1409('0x10'));var Redis=require(_0x1409('0x11'));var authService=require(_0x1409('0x12'));var qs=require(_0x1409('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1409('0x14'))(_0x1409('0x15'));var utils=require('../../config/utils');var config=require(_0x1409('0x16'));var db=require(_0x1409('0x17'))['db'];config[_0x1409('0x18')]=_[_0x1409('0x19')](config['redis'],{'host':_0x1409('0x1a'),'port':0x18eb});var socket=require(_0x1409('0x1b'))(new Redis(config[_0x1409('0x18')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x324c99,_0xe340ff){_0xe340ff=_0xe340ff||0xcc;return function(_0x1f4378){if(_0x1f4378){return _0x324c99['sendStatus'](_0xe340ff);}return _0x324c99['status'](_0xe340ff)[_0x1409('0x1c')]();};}function respondWithResult(_0x244f7c,_0x372f20){_0x372f20=_0x372f20||0xc8;return function(_0xb14665){if(_0xb14665){return _0x244f7c[_0x1409('0x1d')](_0x372f20)[_0x1409('0x1e')](_0xb14665);}};}function respondWithFilteredResult(_0x2b9c61,_0x1f41d7){return function(_0x200193){if(_0x200193){var _0x4a6a43=_0x200193[_0x1409('0x1f')],_0x52200c=_0x1f41d7[_0x1409('0x20')],_0x467693=_0x1f41d7[_0x1409('0x20')]+_0x1f41d7[_0x1409('0x21')],_0x325008;if(_0x467693>=_0x4a6a43){_0x467693=_0x4a6a43;_0x325008=0xc8;}else{_0x325008=0xce;}_0x2b9c61[_0x1409('0x1d')](_0x325008);return _0x2b9c61['set']('Content-Range',_0x52200c+'-'+_0x467693+'/'+_0x4a6a43)[_0x1409('0x1e')](_0x200193);}return null;};}function patchUpdates(_0x5342be){return function(_0x450762){try{jsonpatch[_0x1409('0x22')](_0x450762,_0x5342be,!![]);}catch(_0x462482){return BPromise['reject'](_0x462482);}return _0x450762['save']();};}function saveUpdates(_0x76a139,_0xea3cd){return function(_0x58585e){if(_0x58585e){return _0x58585e[_0x1409('0x23')](_0x76a139)['then'](function(_0x19c320){return _0x19c320;});}return null;};}function removeEntity(_0x578503,_0x348ec3){return function(_0xc848de){if(_0xc848de){return _0xc848de[_0x1409('0x24')]()[_0x1409('0x25')](function(){_0x578503[_0x1409('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38209c,_0x58e110){return function(_0x27292c){if(!_0x27292c){_0x38209c[_0x1409('0x26')](0x194);}return _0x27292c;};}function handleError(_0x404732,_0xbcd9eb){_0xbcd9eb=_0xbcd9eb||0x1f4;return function(_0x86143b){logger[_0x1409('0x27')](_0x86143b[_0x1409('0x28')]);if(_0x86143b['name']){delete _0x86143b[_0x1409('0x29')];}_0x404732[_0x1409('0x1d')](_0xbcd9eb)['send'](_0x86143b);};}function getInteractionUnreadMessages(_0x1c7f60){return new BPromise(function(_0x5e12a6,_0x18500e){try{if(_0x1c7f60['closed']){_0x1c7f60[_0x1409('0x2a')]=0x0;_0x5e12a6(_0x1c7f60);}else{return db[_0x1409('0x2b')][_0x1409('0x1f')]({'where':{'OpenchannelInteractionId':_0x1c7f60['id'],'direction':'in','read':![]}})[_0x1409('0x25')](function(_0xe2a79b){_0x1c7f60[_0x1409('0x2a')]=_0xe2a79b;_0x5e12a6(_0x1c7f60);});}}catch(_0x5531d5){_0x18500e(_0x5531d5);}});}function getInteractionUsers(_0x51fda2,_0x2f9646){return new BPromise(function(_0x46d9b6,_0x21ee48){try{if(_0x2f9646[_0x51fda2['id']]){_0x51fda2[_0x1409('0x2c')]=_['map'](_0x2f9646[_0x51fda2['id']],function(_0x1f0310){return{'id':_0x1f0310['id']};});}}catch(_0x5ffee0){_0x21ee48(_0x5ffee0);}_0x46d9b6(_0x51fda2);});}function getInteractionTags(_0x9a4112,_0x292797){return new BPromise(function(_0x1f09f9,_0x54f99e){try{if(_0x9a4112[_0x1409('0x2d')]){_0x9a4112[_0x1409('0x2e')]=[];_0x9a4112[_0x1409('0x2d')][_0x1409('0x2f')](',')[_0x1409('0x30')](function(_0x1dcc7e){_0x9a4112[_0x1409('0x2e')][_0x1409('0x31')](_0x292797[_0x1dcc7e]);});}delete _0x9a4112[_0x1409('0x2d')];}catch(_0x2a607){_0x54f99e(_0x2a607);}_0x1f09f9(_0x9a4112);});}function updateOpenchannelInteraction(_0x3acb3c,_0x29f222,_0x9954a3){return new BPromise(function(_0x6e0105,_0x11206c){return getInteractionUnreadMessages(_0x3acb3c)['then'](function(_0x55ae3c){return getInteractionUsers(_0x55ae3c,_0x9954a3);})[_0x1409('0x25')](function(_0x4b0962){return getInteractionTags(_0x4b0962,_0x29f222);})[_0x1409('0x25')](function(_0x3a0462){_0x6e0105(_0x3a0462);})[_0x1409('0x32')](function(_0x2c5ce3){_0x11206c(_0x2c5ce3);});});}exports[_0x1409('0x33')]=function(_0x5c4dbd,_0xe9cd79){var _0x39b96b={},_0x13cf1c={},_0x820394={'count':0x0,'rows':[]};var _0x2d3354=db[_0x1409('0x34')]['rawAttributes'];_0x13cf1c[_0x1409('0x35')]=_[_0x1409('0x36')](_0x2d3354);_0x13cf1c['query']=_[_0x1409('0x36')](_0x5c4dbd[_0x1409('0x37')]);_0x13cf1c[_0x1409('0x38')]=_[_0x1409('0x39')](_0x13cf1c['model'],_0x13cf1c[_0x1409('0x37')]);_0x39b96b[_0x1409('0x3a')]=_[_0x1409('0x39')](_0x13cf1c[_0x1409('0x35')],qs[_0x1409('0x3b')](_0x5c4dbd['query'][_0x1409('0x3b')]));_0x39b96b[_0x1409('0x3a')]=_0x39b96b['attributes'][_0x1409('0x3c')]?_0x39b96b[_0x1409('0x3a')]:_0x13cf1c[_0x1409('0x35')];if(!_0x5c4dbd[_0x1409('0x37')][_0x1409('0x3d')]('nolimit')){_0x39b96b[_0x1409('0x21')]=qs[_0x1409('0x21')](_0x5c4dbd['query'][_0x1409('0x21')]);_0x39b96b[_0x1409('0x20')]=qs[_0x1409('0x20')](_0x5c4dbd[_0x1409('0x37')][_0x1409('0x20')]);}_0x39b96b[_0x1409('0x3e')]=qs['sort'](_0x5c4dbd[_0x1409('0x37')]['sort']);_0x39b96b['where']=qs[_0x1409('0x38')](_[_0x1409('0x3f')](_0x5c4dbd['query'],_0x13cf1c[_0x1409('0x38')]));var _0x1a4972=[];var _0x4c85fb=squel[_0x1409('0x40')]()[_0x1409('0x41')]('id')[_0x1409('0x41')](_0x1409('0x29'))[_0x1409('0x41')](_0x1409('0x42'))['from']('tools_tags');var _0x55ca44=squel[_0x1409('0x40')]()[_0x1409('0x41')](_0x1409('0x43'))[_0x1409('0x44')]('openchannel_messages','me')[_0x1409('0x45')](_0x1409('0x46'))[_0x1409('0x45')](_0x1409('0x47'))[_0x1409('0x45')](_0x1409('0x48'));var _0x5d4659=squel[_0x1409('0x40')]()[_0x1409('0x41')](_0x1409('0x49'))[_0x1409('0x41')]('ui.OpenchannelInteractionId')[_0x1409('0x44')](_0x1409('0x4a'),'ui')[_0x1409('0x4b')]('users','u',_0x1409('0x4c'));var _0x44dc09=squel[_0x1409('0x40')]()[_0x1409('0x44')](_0x1409('0x4d'),'i')[_0x1409('0x4b')]('cm_contacts','c',_0x1409('0x4e'))['left_join'](_0x1409('0x4f'),'o',_0x1409('0x50'))[_0x1409('0x4b')](_0x1409('0x51'),'a',_0x1409('0x52'))['left_join'](_0x1409('0x53'),'me',_0x1409('0x46'));var _0x4ceb0c=squel[_0x1409('0x54')]();if(_0x5c4dbd['query'][_0x1409('0x55')]){var _0x333c48=JSON[_0x1409('0x56')](_0x5c4dbd['query'][_0x1409('0x55')]);_[_0x1409('0x36')](_0x333c48)[_0x1409('0x30')](function(_0x28b9a5){var _0x31fea0=_0x333c48[_0x28b9a5];if(_0x28b9a5===_0x1409('0x57')){var _0x3c04df=moment(_0x31fea0[_0x1409('0x58')][_0x1409('0x59')])['startOf'](_0x1409('0x5a'))[_0x1409('0x5b')]()['format']();var _0x90df97=moment(_0x90df97)[_0x1409('0x5b')]()[_0x1409('0x5c')](_0x1409('0x5a'))[_0x1409('0x5d')]();_0x4ceb0c[_0x1409('0x5e')](_0x1409('0x5f'),_0x3c04df,_0x90df97);}else{if(_['isArray'](_0x31fea0['condition'])){_0x31fea0[_0x1409('0x60')][_0x1409('0x30')](function(_0x35f9d1){switch(_0x31fea0[_0x1409('0x60')][_0x1409('0x58')]){case'IS':if(_0x28b9a5!==_0x1409('0x61')&&_0x28b9a5!==_0x1409('0x62')){if(_[_0x1409('0x63')](_0x31fea0['value'])&&_0x31fea0[_0x1409('0x58')][_0x1409('0x3c')]>0x1){_0x4ceb0c[_0x1409('0x5e')](_0x31fea0['tableAlias']+'.'+_0x28b9a5+_0x1409('0x64'),_0x31fea0['value']);}else{_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+_0x1409('0x66'),_0x31fea0[_0x1409('0x58')][0x0]);}}break;case'=':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0['tableAlias']+'.'+_0x28b9a5+_0x1409('0x66'),_0x31fea0[_0x1409('0x58')]);break;case _0x1409('0x67'):if(_0x28b9a5===_0x1409('0x68')){_0x4ceb0c[_0x1409('0x5e')](_0x1409('0x69')+'\x20LIKE\x20?','%'+_0x31fea0[_0x1409('0x58')]+'%');_0x4ceb0c['or'](_0x1409('0x6a')+_0x1409('0x6b'),'%'+_0x31fea0[_0x1409('0x58')]+'%');_0x4ceb0c['or'](_0x1409('0x6c')+'\x20LIKE\x20?','%'+_0x31fea0[_0x1409('0x58')]+'%');}else{_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+_0x1409('0x6b'),'%'+_0x31fea0[_0x1409('0x58')]+'%');}break;case'>':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+'\x20>\x20?',_0x31fea0[_0x1409('0x58')]);break;case'<':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+'\x20<\x20?',_0x31fea0['value']);break;}});}else{switch(_0x31fea0['condition']['value']){case'IS':if(_0x28b9a5!==_0x1409('0x61')&&_0x28b9a5!==_0x1409('0x62')){if(_[_0x1409('0x63')](_0x31fea0[_0x1409('0x58')])&&_0x31fea0['value'][_0x1409('0x3c')]>0x1){_0x4ceb0c['and'](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+_0x1409('0x64'),_0x31fea0['value']);}else{_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+'\x20=\x20?',_0x31fea0[_0x1409('0x58')][0x0]);}}break;case'=':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+_0x1409('0x66'),_0x31fea0['value']);break;case _0x1409('0x67'):if(_0x28b9a5===_0x1409('0x68')){_0x4ceb0c['and'](_0x1409('0x69')+_0x1409('0x6b'),'%'+_0x31fea0[_0x1409('0x58')]+'%');_0x4ceb0c['or'](_0x1409('0x6a')+_0x1409('0x6b'),'%'+_0x31fea0[_0x1409('0x58')]+'%');_0x4ceb0c['or'](_0x1409('0x6c')+'\x20LIKE\x20?','%'+_0x31fea0[_0x1409('0x58')]+'%');}else{_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+_0x1409('0x6b'),'%'+_0x31fea0[_0x1409('0x58')]+'%');}break;case'>':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0['tableAlias']+'.'+_0x28b9a5+_0x1409('0x6d'),_0x31fea0[_0x1409('0x58')]);break;case'<':_0x4ceb0c[_0x1409('0x5e')](_0x31fea0[_0x1409('0x65')]+'.'+_0x28b9a5+'\x20<\x20?',_0x31fea0[_0x1409('0x58')]);break;}}}});}else{var _0x312db5=_(Object['keys'](_0x5c4dbd[_0x1409('0x37')]))[_0x1409('0x6e')](function(_0x2836fc){return _0x2d3354[_0x1409('0x3d')](_0x2836fc)?_0x2836fc:undefined;})[_0x1409('0x6f')](function(_0x4d4c19){return!_[_0x1409('0x70')](_0x4d4c19);})['value']();if(!_[_0x1409('0x71')](_0x312db5)){_0x312db5[_0x1409('0x30')](function(_0x273420){if(_0x273420===_0x1409('0x72')){_0x44dc09[_0x1409('0x45')](_0x1409('0x73'),[]['concat'](_0x5c4dbd[_0x1409('0x37')][_0x273420]));}else if(_0x273420===_0x1409('0x57')){var _0x4e926=JSON[_0x1409('0x56')](_0x5c4dbd['query'][_0x273420])[_0x1409('0x74')];var _0x2b0c45=JSON[_0x1409('0x56')](_0x5c4dbd[_0x1409('0x37')][_0x273420])[_0x1409('0x75')];_0x44dc09[_0x1409('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e926,_0x2b0c45);}else{if(_0x5c4dbd[_0x1409('0x37')][_0x273420]===_0x1409('0x76')){_0x44dc09['where']('i.'+_0x273420+'\x20IS\x20NULL');}else{_0x44dc09[_0x1409('0x45')]('i.'+_0x273420+'\x20=\x20?',_0x5c4dbd['query'][_0x273420]);}}});}if(_0x5c4dbd[_0x1409('0x37')][_0x1409('0x6f')]){var _0x3277c8=_0x5c4dbd[_0x1409('0x37')][_0x1409('0x6f')][_0x1409('0x77')]('\x5c','\x5c\x5c')[_0x1409('0x77')]('\x27\x27',_0x1409('0x78'));if(qs[_0x1409('0x79')](_0x3277c8)){_0x4ceb0c['or']('i.id\x20LIKE\x20?',_0x3277c8+'%');}else{var _0x3c5b5e=[];_0x3277c8[_0x1409('0x2f')]('\x20')[_0x1409('0x30')](function(_0x41d5d3){_0x3c5b5e['push']('+'+_0x41d5d3[_0x1409('0x7a')]());});var _0x54879b=_0x3c5b5e['join']('\x20');_0x4ceb0c['or'](_0x1409('0x7b'),_0x54879b)['or'](_0x1409('0x7c'),_0x3277c8+'%')['or'](_0x1409('0x7d'),_0x3277c8+'%');}}}_0x44dc09[_0x1409('0x45')](_0x4ceb0c);if(_0x39b96b[_0x1409('0x3e')]){_0x39b96b[_0x1409('0x3e')][_0x1409('0x30')](function(_0x510eff){_0x44dc09[_0x1409('0x3e')]('i.'+_0x510eff[0x0],_0x510eff[0x1]===_0x1409('0x7e')?![]:!![]);});}_0x44dc09['group'](_0x1409('0x7f'));var _0x1dbfb3={'type':db['Sequelize'][_0x1409('0x80')][_0x1409('0x81')],'raw':!![]};var _0x28aa7b=_0x44dc09[_0x1409('0x82')]()[_0x1409('0x41')]('COUNT(*)');if(!_0x5c4dbd[_0x1409('0x37')][_0x1409('0x55')]){if(_0x5c4dbd[_0x1409('0x37')][_0x1409('0x83')]){if(_0x5c4dbd['query'][_0x1409('0x83')]==0x1){_0x28aa7b[_0x1409('0x45')](util['format']('%s\x20=\x200',_0x55ca44['toString']()));_0x44dc09[_0x1409('0x84')]('`Messages.count`\x20=\x200');}else{_0x28aa7b[_0x1409('0x45')](util[_0x1409('0x5d')](_0x1409('0x85'),_0x55ca44[_0x1409('0x7a')]()));_0x44dc09['having'](_0x1409('0x86'));}}if(_0x5c4dbd[_0x1409('0x37')][_0x1409('0x87')]){var _0x32cd6d=_[_0x1409('0x63')](_0x5c4dbd[_0x1409('0x37')][_0x1409('0x87')])?_0x5c4dbd[_0x1409('0x37')][_0x1409('0x87')]:new Array(_0x5c4dbd[_0x1409('0x37')][_0x1409('0x87')]);var _0x515142=squel[_0x1409('0x54')]();_0x32cd6d[_0x1409('0x30')](function(_0x2ee0fe){_0x515142['or'](_0x1409('0x88'),'%,'+_0x2ee0fe+',%');});_0x44dc09['having'](_0x515142);_0x28aa7b['left_join'](_0x1409('0x89'),'it',_0x1409('0x8a'));_0x28aa7b[_0x1409('0x4b')](_0x1409('0x8b'),'t','t.id\x20=\x20it.TagId');_0x28aa7b[_0x1409('0x45')]('t.id\x20IN\x20?',_0x32cd6d);}}else{var _0x333c48=JSON[_0x1409('0x56')](_0x5c4dbd[_0x1409('0x37')][_0x1409('0x55')]);_[_0x1409('0x36')](_0x333c48)[_0x1409('0x30')](function(_0x44905c){var _0x471597=_0x333c48[_0x44905c];if(_0x44905c==='TagId'){var _0x29b564=_0x471597['value'];var _0x93fb04=squel[_0x1409('0x54')]();_0x29b564[_0x1409('0x30')](function(_0x27a23b){_0x93fb04['or'](_0x1409('0x88'),'%,'+_0x27a23b+',%');});_0x44dc09[_0x1409('0x84')](_0x93fb04);_0x28aa7b[_0x1409('0x4b')]('mail_interaction_has_tags','it',_0x1409('0x8c'));_0x28aa7b[_0x1409('0x4b')]('tools_tags','t',_0x1409('0x8d'));_0x28aa7b[_0x1409('0x45')](_0x1409('0x8e'),_0x29b564);}else if(_0x44905c===_0x1409('0x62')){if(_0x471597[_0x1409('0x58')]['length']===0x1){if(_0x471597[_0x1409('0x58')][0x0]===0x1){_0x28aa7b['where'](util['format'](_0x1409('0x8f'),_0x55ca44[_0x1409('0x7a')]()));_0x44dc09[_0x1409('0x84')]('`Messages.count`\x20=\x200');}else{_0x28aa7b['where'](util[_0x1409('0x5d')]('%s\x20>\x200',_0x55ca44[_0x1409('0x7a')]()));_0x44dc09['having']('`Messages.count`\x20>\x200');}}}});}db[_0x1409('0x90')]['query'](_0x28aa7b[_0x1409('0x7a')](),_0x1dbfb3)['then'](function(_0x57652a){_0x820394[_0x1409('0x1f')]=_0x57652a[_0x1409('0x3c')];if(_0x820394[_0x1409('0x1f')]===0x0)return[];return db[_0x1409('0x90')][_0x1409('0x37')](_0x4c85fb[_0x1409('0x7a')](),_0x1dbfb3)[_0x1409('0x25')](function(_0x473845){_0x1a4972=_[_0x1409('0x91')](_0x473845,'id');_0x1dbfb3=_[_0x1409('0x92')](_0x1dbfb3,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x44dc09['field'](_0x1409('0x93'),_0x1409('0x94'));_0x44dc09[_0x1409('0x41')](_0x1409('0x95'));_0x44dc09[_0x1409('0x41')](_0x1409('0x69'),_0x1409('0x96'));_0x44dc09[_0x1409('0x41')]('c.lastName',_0x1409('0x97'));_0x44dc09[_0x1409('0x41')](_0x1409('0x6c'),'Contact.email');_0x44dc09[_0x1409('0x41')](_0x1409('0x98'),_0x1409('0x99'));_0x44dc09[_0x1409('0x41')]('c.mobile',_0x1409('0x9a'));_0x44dc09[_0x1409('0x41')](_0x1409('0x9b'),_0x1409('0x9c'));_0x44dc09[_0x1409('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1409('0x2d'));_0x44dc09[_0x1409('0x4b')]('openchannel_interaction_has_tags','it',_0x1409('0x8a'));_0x44dc09[_0x1409('0x4b')](_0x1409('0x8b'),'t',_0x1409('0x8d'));_0x44dc09[_0x1409('0x21')](_0x39b96b[_0x1409('0x21')]);_0x44dc09[_0x1409('0x20')](_0x39b96b[_0x1409('0x20')]);return db[_0x1409('0x90')][_0x1409('0x37')](_0x44dc09[_0x1409('0x7a')](),_0x1dbfb3);})[_0x1409('0x25')](function(_0x5b1592){_0x5d4659[_0x1409('0x45')](_0x1409('0x9d'),_['map'](_0x5b1592,'id'));return db['sequelize'][_0x1409('0x37')](_0x5d4659[_0x1409('0x7a')](),_0x1dbfb3)[_0x1409('0x25')](function(_0x334759){var _0x4887d5=_[_0x1409('0x9e')](_0x334759,'OpenchannelInteractionId');var _0x20f2b2=[];_0x5b1592[_0x1409('0x30')](function(_0x305a36){_0x20f2b2[_0x1409('0x31')](updateOpenchannelInteraction(_0x305a36,_0x1a4972,_0x4887d5));});return BPromise[_0x1409('0x9f')](_0x20f2b2);});});})[_0x1409('0x25')](function(_0x59e080){_0x820394['rows']=_0x59e080;return _0x820394;})[_0x1409('0x25')](respondWithFilteredResult(_0xe9cd79,_0x39b96b))['catch'](handleError(_0xe9cd79,null));};exports['show']=function(_0x22858f,_0x9079cd){var _0x23ae60={'raw':![],'where':{'id':_0x22858f[_0x1409('0xa0')]['id']}},_0x8651f9={};_0x8651f9[_0x1409('0x35')]=_[_0x1409('0x36')](db[_0x1409('0x34')][_0x1409('0xa1')]);_0x8651f9[_0x1409('0x37')]=_['keys'](_0x22858f['query']);_0x8651f9['filters']=_['intersection'](_0x8651f9['model'],_0x8651f9[_0x1409('0x37')]);_0x23ae60[_0x1409('0x3a')]=_[_0x1409('0x39')](_0x8651f9['model'],qs['fields'](_0x22858f[_0x1409('0x37')][_0x1409('0x3b')]));_0x23ae60[_0x1409('0x3a')]=_0x23ae60[_0x1409('0x3a')][_0x1409('0x3c')]?_0x23ae60[_0x1409('0x3a')]:_0x8651f9[_0x1409('0x35')];if(_0x22858f[_0x1409('0x37')][_0x1409('0xa2')]){_0x23ae60[_0x1409('0xa3')]=[{'all':!![]}];}_0x23ae60=_[_0x1409('0x92')]({},_0x23ae60,_0x22858f[_0x1409('0xa4')]);return db[_0x1409('0x34')][_0x1409('0xa5')](_0x23ae60)[_0x1409('0x25')](handleEntityNotFound(_0x9079cd,null))['then'](respondWithResult(_0x9079cd,null))['catch'](handleError(_0x9079cd,null));};exports[_0x1409('0xa6')]=function(_0xf4ae70,_0x3b379e){return db['OpenchannelInteraction'][_0x1409('0xa6')](_0xf4ae70['body'],{})[_0x1409('0x25')](respondWithResult(_0x3b379e,0xc9))[_0x1409('0x32')](handleError(_0x3b379e,null));};exports[_0x1409('0x23')]=function(_0x5a5c18,_0x2613f0){if(_0x5a5c18['body']['id']){delete _0x5a5c18[_0x1409('0xa7')]['id'];}return db[_0x1409('0x34')][_0x1409('0xa5')]({'where':{'id':_0x5a5c18[_0x1409('0xa0')]['id']}})['then'](handleEntityNotFound(_0x2613f0,null))[_0x1409('0x25')](saveUpdates(_0x5a5c18[_0x1409('0xa7')],null))[_0x1409('0x25')](respondWithResult(_0x2613f0,null))[_0x1409('0x32')](handleError(_0x2613f0,null));};exports['destroy']=function(_0x58b938,_0x27c209){return db['OpenchannelInteraction']['find']({'where':{'id':_0x58b938[_0x1409('0xa0')]['id']}})[_0x1409('0x25')](handleEntityNotFound(_0x27c209,null))['then'](removeEntity(_0x27c209,null))['catch'](handleError(_0x27c209,null));};exports['describe']=function(_0x583604,_0x2593c1){return db[_0x1409('0x34')][_0x1409('0xa8')]()['then'](respondWithResult(_0x2593c1,null))[_0x1409('0x32')](handleError(_0x2593c1,null));};exports['addMessage']=function(_0x3f57ab,_0x169668,_0x5f3f60){return db['OpenchannelMessage'][_0x1409('0xa5')]({'where':{'id':_0x3f57ab[_0x1409('0xa0')]['id']}})[_0x1409('0x25')](handleEntityNotFound(_0x169668,null))[_0x1409('0x25')](function(_0x2a93ea){if(_0x2a93ea){return _0x2a93ea[_0x1409('0xa9')](_0x3f57ab['body'][_0x1409('0xaa')],_[_0x1409('0xab')](_0x3f57ab['body'],['ids','id'])||{});}})[_0x1409('0x25')](respondWithResult(_0x169668,null))[_0x1409('0x32')](handleError(_0x169668,null));};exports[_0x1409('0xac')]=function(_0x308583,_0x446d7b,_0x49a5b3){var _0x5b89e8={'raw':![],'where':{}};var _0x2e5830={};var _0x1521a1={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1409('0xad')]({'where':{'id':_0x308583['params']['id']}})[_0x1409('0x25')](handleEntityNotFound(_0x446d7b,null))[_0x1409('0x25')](function(_0x5b7b43){if(_0x5b7b43){_0x2e5830[_0x1409('0x35')]=_[_0x1409('0x36')](db[_0x1409('0x2b')][_0x1409('0xa1')]);_0x2e5830[_0x1409('0x37')]=_[_0x1409('0x36')](_0x308583['query']);_0x2e5830[_0x1409('0x38')]=_['intersection'](_0x2e5830[_0x1409('0x35')],_0x2e5830['query']);_0x5b89e8[_0x1409('0x3a')]=_[_0x1409('0x39')](_0x2e5830[_0x1409('0x35')],qs[_0x1409('0x3b')](_0x308583[_0x1409('0x37')]['fields']));_0x5b89e8[_0x1409('0x3a')]=_0x5b89e8[_0x1409('0x3a')]['length']?_0x5b89e8[_0x1409('0x3a')]:_0x2e5830['model'];if(!_0x308583[_0x1409('0x37')]['hasOwnProperty']('nolimit')){_0x5b89e8[_0x1409('0x21')]=qs[_0x1409('0x21')](_0x308583[_0x1409('0x37')][_0x1409('0x21')]);_0x5b89e8['offset']=qs[_0x1409('0x20')](_0x308583[_0x1409('0x37')]['offset']);}_0x5b89e8['order']=qs[_0x1409('0xae')](_0x308583[_0x1409('0x37')]['sort']);_0x5b89e8[_0x1409('0x45')]=qs['filters'](_['pick'](_0x308583[_0x1409('0x37')],_0x2e5830[_0x1409('0x38')]));_0x5b89e8[_0x1409('0x45')][_0x1409('0xaf')]=_0x5b7b43['id'];if(_0x308583[_0x1409('0x37')][_0x1409('0x6f')]){_0x5b89e8['where']=_['merge'](_0x5b89e8[_0x1409('0x45')],{'$or':_[_0x1409('0x6e')](_0x5b89e8[_0x1409('0x3a')],function(_0x391679){var _0x3928a6={};_0x3928a6[_0x391679]={'$like':'%'+_0x308583[_0x1409('0x37')][_0x1409('0x6f')]+'%'};return _0x3928a6;})});}if(_0x308583[_0x1409('0x37')][_0x1409('0x74')]){var _0x572358=_0x308583['query'][_0x1409('0x74')][_0x1409('0x2f')](',');var _0x59569c={};_0x59569c[_0x572358[0x0]]={'$gte':moment(_0x572358[0x1])['format'](_0x1409('0xb0'))};_0x5b89e8[_0x1409('0x45')]=_[_0x1409('0x92')](_0x5b89e8[_0x1409('0x45')],_0x59569c);}_0x5b89e8=_[_0x1409('0x92')]({},_0x5b89e8,_0x308583['options']);return db[_0x1409('0x2b')][_0x1409('0x1f')]({'where':_0x5b89e8[_0x1409('0x45')]})[_0x1409('0x25')](function(_0x325400){_0x1521a1[_0x1409('0x1f')]=_0x325400;if(_0x308583[_0x1409('0x37')]['includeAll']){_0x5b89e8[_0x1409('0xa3')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x5b89e8);})[_0x1409('0x25')](function(_0x575e36){_0x1521a1[_0x1409('0xb1')]=_0x575e36;return _0x1521a1;});}})['then'](respondWithFilteredResult(_0x446d7b,_0x5b89e8))['catch'](handleError(_0x446d7b,null));};exports[_0x1409('0xb2')]=function(_0x4d3106,_0x5f0213,_0xe48cb9){return db[_0x1409('0x34')]['find']({'where':{'id':_0x4d3106['params']['id']}})[_0x1409('0x25')](handleEntityNotFound(_0x5f0213,null))[_0x1409('0x25')](function(_0x2e403d){if(_0x2e403d){return _0x2e403d[_0x1409('0xb3')](_0x4d3106[_0x1409('0xa7')][_0x1409('0xaa')],_['omit'](_0x4d3106[_0x1409('0xa7')],[_0x1409('0xaa'),'id'])||{})[_0x1409('0xb4')](function(){return db[_0x1409('0xb5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x4d3106[_0x1409('0xa7')]['ids']}});})[_0x1409('0x25')](function(_0x1ee044){socket[_0x1409('0xb6')](_0x1409('0xb7'),{'id':Number(_0x4d3106[_0x1409('0xa0')]['id']),'tags':_0x1ee044||[]});return{'id':Number(_0x4d3106[_0x1409('0xa0')]['id']),'tags':_0x1ee044||[]};});}})[_0x1409('0x25')](respondWithResult(_0x5f0213,null))[_0x1409('0x32')](handleError(_0x5f0213,null));};exports['removeTags']=function(_0x3651a7,_0x2b6a6f,_0x36aa0f){return db[_0x1409('0x34')][_0x1409('0xa5')]({'where':{'id':_0x3651a7[_0x1409('0xa0')]['id']}})[_0x1409('0x25')](handleEntityNotFound(_0x2b6a6f,null))[_0x1409('0x25')](function(_0x21fa7b){if(_0x21fa7b){return _0x21fa7b[_0x1409('0xb8')](_0x3651a7[_0x1409('0x37')][_0x1409('0xaa')]);}})[_0x1409('0x25')](respondWithStatusCode(_0x2b6a6f,null))[_0x1409('0x32')](handleError(_0x2b6a6f,null));};exports[_0x1409('0xb9')]=function(_0x2c6959,_0x1ec9bb){var _0x48c10e=moment()[_0x1409('0xba')]()['toString']();var _0x1e4a52=path['join'](config[_0x1409('0xbb')],_0x1409('0xbc'),_0x1409('0xbd'),'tmp');var _0x1493d2=path[_0x1409('0xbe')](config[_0x1409('0xbb')],'server','files','attachments');var _0x56d0bb=path[_0x1409('0xbe')](_0x1e4a52,_0x48c10e);var _0x437e9e=util[_0x1409('0x5d')]('transcript-%d-%s.zip',_0x2c6959[_0x1409('0xa0')]['id'],_0x48c10e);var _0x14eb61=path[_0x1409('0xbe')](_0x1e4a52,_0x437e9e);var _0x15129f=![];return db[_0x1409('0x34')][_0x1409('0xa5')]({'where':{'id':_0x2c6959['params']['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x1409('0xbf'),'attributes':['id',_0x1409('0xa7'),_0x1409('0x57'),_0x1409('0xc0'),_0x1409('0xc1')],'include':[{'model':db[_0x1409('0xc2')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x1409('0xc3'),'attributes':['id',_0x1409('0xc4'),_0x1409('0xc5')],'raw':!![]},{'model':db[_0x1409('0xc6')],'as':_0x1409('0xc6'),'raw':!![]}]},{'model':db[_0x1409('0xc7')],'as':_0x1409('0xc8'),'attributes':['id',_0x1409('0x29')]},{'model':db[_0x1409('0xc2')],'as':_0x1409('0xc9'),'attributes':['id',_0x1409('0xca')]}]})[_0x1409('0x25')](handleEntityNotFound(_0x1ec9bb,null))[_0x1409('0x25')](function(_0x4f62dd){if(_0x4f62dd){var _0x331e8b=_0x4f62dd[_0x1409('0xcb')]({'plain':!![]});_0x15129f=!![];var _0x5b3ed1={'format':'A4','border':_0x1409('0xcc'),'header':{'height':_0x1409('0xcd'),'contents':{'first':_0x1409('0xce')}},'footer':{'height':'30px','contents':{'default':util[_0x1409('0x5d')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x1409('0x5d')](_0x1409('0xcf'),_0x1409('0xd0'),_0x331e8b['id']),moment()[_0x1409('0x5d')](_0x1409('0xd1'))[_0x1409('0x7a')]())}}};fs['mkdirSync'](_0x56d0bb);var _0x49c01d={'channel':_0x1409('0xd0'),'account':_0x331e8b[_0x1409('0xc8')][_0x1409('0x29')],'agent':_0x331e8b[_0x1409('0xc9')]?_0x331e8b[_0x1409('0xc9')][_0x1409('0xca')]:'N.A.','createdAt':moment(_0x331e8b[_0x1409('0x57')])[_0x1409('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1409('0x7a')](),'closedAt':_0x331e8b[_0x1409('0xd2')]?moment(_0x331e8b[_0x1409('0xd3')])[_0x1409('0x5d')](_0x1409('0xb0'))[_0x1409('0x7a')]():'','disposition':_0x331e8b[_0x1409('0xd4')],'visibility':_0x331e8b['threadId']?'Public':_0x1409('0xd5'),'messages':_(_0x331e8b[_0x1409('0xbf')])[_0x1409('0x6f')]({'secret':![]})[_0x1409('0x6e')](function(_0x46ef92){if(_0x46ef92[_0x1409('0xc6')]){var _0x2827d2=path[_0x1409('0xbe')](_0x1493d2,_0x46ef92[_0x1409('0xc6')][_0x1409('0xd6')]);if(fs['existsSync'](_0x2827d2)){fs[_0x1409('0xd7')](_0x2827d2)[_0x1409('0xd8')](fs[_0x1409('0xd9')](path[_0x1409('0xbe')](_0x56d0bb,_0x46ef92[_0x1409('0xc6')][_0x1409('0xd6')])));}}return{'date':moment(_0x46ef92[_0x1409('0x57')])['format'](_0x1409('0xb0'))[_0x1409('0x7a')](),'sender':_0x46ef92['direction']===_0x1409('0xda')?_0x46ef92['User']?_0x46ef92['User'][_0x1409('0xca')]:_0x1409('0xdb'):_0x46ef92[_0x1409('0xc3')][_0x1409('0xc4')]+(_0x46ef92[_0x1409('0xc3')][_0x1409('0xc5')]?'\x20'+_0x46ef92[_0x1409('0xc3')]['lastName']:''),'body':_0x46ef92[_0x1409('0xc6')]?_0x46ef92[_0x1409('0xc6')][_0x1409('0xd6')]:_0x46ef92[_0x1409('0xa7')],'direction':_0x46ef92[_0x1409('0xc0')]===_0x1409('0xda')?'A':'C','secret':_0x46ef92[_0x1409('0xc1')],'attachment':_0x46ef92[_0x1409('0xc6')]};})[_0x1409('0x58')]()};return ejs['renderFile'](path[_0x1409('0xbe')](config[_0x1409('0xbb')],'server','views',_0x1409('0xdc')),{'interaction':_0x49c01d})[_0x1409('0x25')](function(_0x1eb87e){return new BPromise(function(_0x2f8874,_0x36544c){pdf[_0x1409('0xa6')](_0x1eb87e,_0x5b3ed1)['toFile'](path['join'](_0x56d0bb,_0x1409('0xdd')+_0x331e8b['id']+'-'+_0x48c10e+_0x1409('0xde')),function(_0x1c9cad,_0x478dbe){if(_0x1c9cad)return _0x36544c(_0x1c9cad);_0x2f8874(_0x478dbe);});});});}})[_0x1409('0x25')](function(){if(_0x15129f){return new BPromise(function(_0x5543ef,_0x50cd18){zipdir(_0x56d0bb,{'saveTo':_0x14eb61},function(_0x14dff7,_0x42dcc2){if(_0x14dff7)return _0x50cd18(_0x14dff7);return _0x5543ef(_0x42dcc2);});})[_0x1409('0x25')](function(){return new BPromise(function(_0x4a6239,_0x24520d){rimraf(_0x56d0bb,function(_0x1fd029){if(_0x1fd029)_0x24520d(_0x1fd029);return _0x4a6239();});});})['then'](function(){return _0x1ec9bb[_0x1409('0xb9')](_0x14eb61,_0x437e9e,function(_0x5d152c){if(_0x5d152c){console[_0x1409('0xdf')](_0x1409('0xe0'),_0x5d152c);}else{fs[_0x1409('0xe1')](_0x14eb61);}});});}else{return _0x1ec9bb[_0x1409('0x26')](0xc8);}})[_0x1409('0x32')](handleError(_0x1ec9bb,null));}; \ No newline at end of file +var _0xf17f=['out','System','renderFile','downloadInteraction.html','create','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','closed','unreadMessages','Users','map','TagIds','split','forEach','Tags','push','catch','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','select','field','name','color','from','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','user_has_openchannel_interactions','users','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','parse','value','dateStart','startOf','utc','format','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','Messages.count','isArray','c.email','hasOwnProperty','filter','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','$gte','$lte','null','\x20IS\x20NULL','replace','isNumeric','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','tools_tags','%s\x20=\x200','sequelize','keyBy','merge','i.*','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.OpenchannelInteractionId\x20=\x20i.id','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','find','body','update','describe','addMessage','OpenchannelMessage','ids','omit','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','Messages','direction','secret','User','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','fullname','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','disposition','threadId','Public','Private','basename','createReadStream','pipe'];(function(_0x2c58cb,_0x45ec61){var _0x2e20ec=function(_0x4617f6){while(--_0x4617f6){_0x2c58cb['push'](_0x2c58cb['shift']());}};_0x2e20ec(++_0x45ec61);}(_0xf17f,0xf0));var _0xff17=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xf17f[_0x19159a];return _0xa677f4;};'use strict';var pdf=require(_0xff17('0x0'));var emlformat=require(_0xff17('0x1'));var rimraf=require(_0xff17('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff17('0x3'));var BPromise=require(_0xff17('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff17('0x5'));var sox=require(_0xff17('0x6'));var csv=require(_0xff17('0x7'));var ejs=require(_0xff17('0x8'));var fs=require('fs');var _=require(_0xff17('0x9'));var squel=require(_0xff17('0xa'));var crypto=require(_0xff17('0xb'));var jsforce=require(_0xff17('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xff17('0x7'));var querystring=require(_0xff17('0xd'));var Papa=require(_0xff17('0xe'));var Redis=require(_0xff17('0xf'));var authService=require(_0xff17('0x10'));var qs=require(_0xff17('0x11'));var hardwareService=require(_0xff17('0x12'));var logger=require(_0xff17('0x13'))(_0xff17('0x14'));var utils=require(_0xff17('0x15'));var config=require(_0xff17('0x16'));var db=require(_0xff17('0x17'))['db'];config[_0xff17('0x18')]=_[_0xff17('0x19')](config[_0xff17('0x18')],{'host':_0xff17('0x1a'),'port':0x18eb});var socket=require(_0xff17('0x1b'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xff17('0x1c')](socket);function respondWithStatusCode(_0x1b8af4,_0x247b14){_0x247b14=_0x247b14||0xcc;return function(_0x293a4d){if(_0x293a4d){return _0x1b8af4['sendStatus'](_0x247b14);}return _0x1b8af4[_0xff17('0x1d')](_0x247b14)[_0xff17('0x1e')]();};}function respondWithResult(_0x3f73cc,_0x258713){_0x258713=_0x258713||0xc8;return function(_0x4d08c4){if(_0x4d08c4){return _0x3f73cc['status'](_0x258713)[_0xff17('0x1f')](_0x4d08c4);}};}function respondWithFilteredResult(_0x17cd1c,_0x4ad0f4){return function(_0x1e2e0a){if(_0x1e2e0a){var _0xc10ecc=_0x1e2e0a[_0xff17('0x20')],_0x4f26f9=_0x4ad0f4['offset'],_0x15aca3=_0x4ad0f4['offset']+_0x4ad0f4[_0xff17('0x21')],_0x3386a4;if(_0x15aca3>=_0xc10ecc){_0x15aca3=_0xc10ecc;_0x3386a4=0xc8;}else{_0x3386a4=0xce;}_0x17cd1c[_0xff17('0x1d')](_0x3386a4);return _0x17cd1c[_0xff17('0x22')](_0xff17('0x23'),_0x4f26f9+'-'+_0x15aca3+'/'+_0xc10ecc)[_0xff17('0x1f')](_0x1e2e0a);}return null;};}function patchUpdates(_0x5ba35c){return function(_0x42f3c6){try{jsonpatch[_0xff17('0x24')](_0x42f3c6,_0x5ba35c,!![]);}catch(_0x28f9ff){return BPromise[_0xff17('0x25')](_0x28f9ff);}return _0x42f3c6[_0xff17('0x26')]();};}function saveUpdates(_0x127400,_0x7799af){return function(_0x2af607){if(_0x2af607){return _0x2af607['update'](_0x127400)[_0xff17('0x27')](function(_0x500fe7){return _0x500fe7;});}return null;};}function removeEntity(_0x19e13b,_0x4f4785){return function(_0xe17c3b){if(_0xe17c3b){return _0xe17c3b[_0xff17('0x28')]()['then'](function(){_0x19e13b['status'](0xcc)[_0xff17('0x1e')]();});}};}function handleEntityNotFound(_0x40e856,_0x45c1fa){return function(_0x20c0a6){if(!_0x20c0a6){_0x40e856[_0xff17('0x29')](0x194);}return _0x20c0a6;};}function handleError(_0x3fa5cc,_0x4905e0){_0x4905e0=_0x4905e0||0x1f4;return function(_0x31b961){logger[_0xff17('0x2a')](_0x31b961[_0xff17('0x2b')]);if(_0x31b961['name']){delete _0x31b961['name'];}_0x3fa5cc[_0xff17('0x1d')](_0x4905e0)[_0xff17('0x2c')](_0x31b961);};}function getInteractionUnreadMessages(_0x1b4f48){return new BPromise(function(_0x20c05f,_0x5c97f6){try{if(_0x1b4f48[_0xff17('0x2d')]){_0x1b4f48[_0xff17('0x2e')]=0x0;_0x20c05f(_0x1b4f48);}else{return db['OpenchannelMessage'][_0xff17('0x20')]({'where':{'OpenchannelInteractionId':_0x1b4f48['id'],'direction':'in','read':![]}})[_0xff17('0x27')](function(_0x46a025){_0x1b4f48[_0xff17('0x2e')]=_0x46a025;_0x20c05f(_0x1b4f48);});}}catch(_0x240ba3){_0x5c97f6(_0x240ba3);}});}function getInteractionUsers(_0x495355,_0x45f27b){return new BPromise(function(_0x3151de,_0x2745f4){try{if(_0x45f27b[_0x495355['id']]){_0x495355[_0xff17('0x2f')]=_[_0xff17('0x30')](_0x45f27b[_0x495355['id']],function(_0x3c19e7){return{'id':_0x3c19e7['id']};});}}catch(_0x59a709){_0x2745f4(_0x59a709);}_0x3151de(_0x495355);});}function getInteractionTags(_0x625466,_0x1bdff6){return new BPromise(function(_0x48645e,_0x5d8c8d){try{if(_0x625466[_0xff17('0x31')]){_0x625466['Tags']=[];_0x625466[_0xff17('0x31')][_0xff17('0x32')](',')[_0xff17('0x33')](function(_0x4f523d){_0x625466[_0xff17('0x34')][_0xff17('0x35')](_0x1bdff6[_0x4f523d]);});}delete _0x625466[_0xff17('0x31')];}catch(_0x50c66f){_0x5d8c8d(_0x50c66f);}_0x48645e(_0x625466);});}function updateOpenchannelInteraction(_0x9eb24d,_0x461e46,_0x1045d7){return new BPromise(function(_0x471c5e,_0x43a06c){return getInteractionUnreadMessages(_0x9eb24d)[_0xff17('0x27')](function(_0x2d8396){return getInteractionUsers(_0x2d8396,_0x1045d7);})['then'](function(_0x37e082){return getInteractionTags(_0x37e082,_0x461e46);})[_0xff17('0x27')](function(_0x2e4ab7){_0x471c5e(_0x2e4ab7);})[_0xff17('0x36')](function(_0x180f47){_0x43a06c(_0x180f47);});});}exports[_0xff17('0x37')]=function(_0x3a0afb,_0x9565c){var _0x8a3baa={},_0x3ed6eb={},_0x449445={'count':0x0,'rows':[]};var _0x170e2e=db[_0xff17('0x38')][_0xff17('0x39')];_0x3ed6eb[_0xff17('0x3a')]=_[_0xff17('0x3b')](_0x170e2e);_0x3ed6eb[_0xff17('0x3c')]=_[_0xff17('0x3b')](_0x3a0afb[_0xff17('0x3c')]);_0x3ed6eb[_0xff17('0x3d')]=_[_0xff17('0x3e')](_0x3ed6eb['model'],_0x3ed6eb[_0xff17('0x3c')]);_0x8a3baa[_0xff17('0x3f')]=_[_0xff17('0x3e')](_0x3ed6eb['model'],qs[_0xff17('0x40')](_0x3a0afb[_0xff17('0x3c')][_0xff17('0x40')]));_0x8a3baa[_0xff17('0x3f')]=_0x8a3baa['attributes'][_0xff17('0x41')]?_0x8a3baa['attributes']:_0x3ed6eb[_0xff17('0x3a')];if(!_0x3a0afb[_0xff17('0x3c')]['hasOwnProperty'](_0xff17('0x42'))){_0x8a3baa['limit']=qs[_0xff17('0x21')](_0x3a0afb[_0xff17('0x3c')][_0xff17('0x21')]);_0x8a3baa[_0xff17('0x43')]=qs[_0xff17('0x43')](_0x3a0afb[_0xff17('0x3c')][_0xff17('0x43')]);}_0x8a3baa[_0xff17('0x44')]=qs[_0xff17('0x45')](_0x3a0afb[_0xff17('0x3c')]['sort']);_0x8a3baa[_0xff17('0x46')]=qs[_0xff17('0x3d')](_[_0xff17('0x47')](_0x3a0afb[_0xff17('0x3c')],_0x3ed6eb[_0xff17('0x3d')]));var _0x358c25=[];var _0x97bb59=squel[_0xff17('0x48')]()[_0xff17('0x49')]('id')[_0xff17('0x49')](_0xff17('0x4a'))[_0xff17('0x49')](_0xff17('0x4b'))[_0xff17('0x4c')]('tools_tags');var _0xc18b68=squel['select']()['field'](_0xff17('0x4d'))['from'](_0xff17('0x4e'),'me')[_0xff17('0x46')](_0xff17('0x4f'))[_0xff17('0x46')](_0xff17('0x50'))['where']('me.read\x20=\x20false');var _0x1f9ffc=squel[_0xff17('0x48')]()[_0xff17('0x49')](_0xff17('0x51'))['field']('ui.OpenchannelInteractionId')[_0xff17('0x4c')](_0xff17('0x52'),'ui')['left_join'](_0xff17('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x1f2818=squel[_0xff17('0x48')]()[_0xff17('0x4c')](_0xff17('0x54'),'i')[_0xff17('0x55')](_0xff17('0x56'),'c',_0xff17('0x57'))['left_join']('users','o',_0xff17('0x58'))[_0xff17('0x55')](_0xff17('0x59'),'a',_0xff17('0x5a'))['left_join'](_0xff17('0x4e'),'me',_0xff17('0x4f'));var _0x3efd67=squel[_0xff17('0x5b')]();if(_0x3a0afb[_0xff17('0x3c')][_0xff17('0x5c')]){var _0x3f40f9=JSON[_0xff17('0x5d')](_0x3a0afb[_0xff17('0x3c')][_0xff17('0x5c')]);_[_0xff17('0x3b')](_0x3f40f9)[_0xff17('0x33')](function(_0x43dae5){var _0xaf4161=_0x3f40f9[_0x43dae5];if(_0x43dae5==='createdAt'){var _0x1966e1=moment(_0xaf4161[_0xff17('0x5e')][_0xff17('0x5f')])[_0xff17('0x60')]('day')[_0xff17('0x61')]()[_0xff17('0x62')]();var _0xa52442=moment(_0xa52442)[_0xff17('0x61')]()[_0xff17('0x63')](_0xff17('0x64'))['format']();_0x3efd67[_0xff17('0x65')](_0xff17('0x66'),_0x1966e1,_0xa52442);}else{if(_['isArray'](_0xaf4161[_0xff17('0x67')])){_0xaf4161[_0xff17('0x67')][_0xff17('0x33')](function(_0x191639){switch(_0xaf4161[_0xff17('0x67')][_0xff17('0x5e')]){case'IS':if(_0x43dae5!==_0xff17('0x68')&&_0x43dae5!=='Messages.count'){if(_['isArray'](_0xaf4161[_0xff17('0x5e')])&&_0xaf4161[_0xff17('0x5e')][_0xff17('0x41')]>0x1){_0x3efd67[_0xff17('0x65')](_0xaf4161['tableAlias']+'.'+_0x43dae5+_0xff17('0x69'),_0xaf4161[_0xff17('0x5e')]);}else{_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+'\x20=\x20?',_0xaf4161[_0xff17('0x5e')][0x0]);}}break;case'=':_0x3efd67[_0xff17('0x65')](_0xaf4161['tableAlias']+'.'+_0x43dae5+_0xff17('0x6b'),_0xaf4161[_0xff17('0x5e')]);break;case'LIKE':if(_0x43dae5===_0xff17('0x6c')){_0x3efd67['and'](_0xff17('0x6d')+_0xff17('0x6e'),'%'+_0xaf4161['value']+'%');_0x3efd67['or'](_0xff17('0x6f')+_0xff17('0x6e'),'%'+_0xaf4161[_0xff17('0x5e')]+'%');_0x3efd67['or']('c.email'+_0xff17('0x6e'),'%'+_0xaf4161['value']+'%');}else{_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x6e'),'%'+_0xaf4161['value']+'%');}break;case'>':_0x3efd67['and'](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x70'),_0xaf4161[_0xff17('0x5e')]);break;case'<':_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x71'),_0xaf4161[_0xff17('0x5e')]);break;}});}else{switch(_0xaf4161[_0xff17('0x67')][_0xff17('0x5e')]){case'IS':if(_0x43dae5!=='TagId'&&_0x43dae5!==_0xff17('0x72')){if(_[_0xff17('0x73')](_0xaf4161['value'])&&_0xaf4161[_0xff17('0x5e')][_0xff17('0x41')]>0x1){_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x69'),_0xaf4161[_0xff17('0x5e')]);}else{_0x3efd67[_0xff17('0x65')](_0xaf4161['tableAlias']+'.'+_0x43dae5+_0xff17('0x6b'),_0xaf4161[_0xff17('0x5e')][0x0]);}}break;case'=':_0x3efd67[_0xff17('0x65')](_0xaf4161['tableAlias']+'.'+_0x43dae5+'\x20=\x20?',_0xaf4161[_0xff17('0x5e')]);break;case'LIKE':if(_0x43dae5===_0xff17('0x6c')){_0x3efd67[_0xff17('0x65')](_0xff17('0x6d')+_0xff17('0x6e'),'%'+_0xaf4161[_0xff17('0x5e')]+'%');_0x3efd67['or'](_0xff17('0x6f')+'\x20LIKE\x20?','%'+_0xaf4161[_0xff17('0x5e')]+'%');_0x3efd67['or'](_0xff17('0x74')+'\x20LIKE\x20?','%'+_0xaf4161[_0xff17('0x5e')]+'%');}else{_0x3efd67['and'](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+'\x20LIKE\x20?','%'+_0xaf4161[_0xff17('0x5e')]+'%');}break;case'>':_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x70'),_0xaf4161[_0xff17('0x5e')]);break;case'<':_0x3efd67[_0xff17('0x65')](_0xaf4161[_0xff17('0x6a')]+'.'+_0x43dae5+_0xff17('0x71'),_0xaf4161[_0xff17('0x5e')]);break;}}}});}else{var _0x74e2c6=_(Object[_0xff17('0x3b')](_0x3a0afb[_0xff17('0x3c')]))[_0xff17('0x30')](function(_0x541ff6){return _0x170e2e[_0xff17('0x75')](_0x541ff6)?_0x541ff6:undefined;})[_0xff17('0x76')](function(_0x46e617){return!_[_0xff17('0x77')](_0x46e617);})[_0xff17('0x5e')]();if(!_[_0xff17('0x78')](_0x74e2c6)){_0x74e2c6[_0xff17('0x33')](function(_0x5da1f7){if(_0x5da1f7==='OpenchannelAccountId'){_0x1f2818[_0xff17('0x46')](_0xff17('0x79'),[]['concat'](_0x3a0afb['query'][_0x5da1f7]));}else if(_0x5da1f7===_0xff17('0x7a')){var _0x4fb200=JSON[_0xff17('0x5d')](_0x3a0afb[_0xff17('0x3c')][_0x5da1f7])[_0xff17('0x7b')];var _0x4f7da8=JSON[_0xff17('0x5d')](_0x3a0afb[_0xff17('0x3c')][_0x5da1f7])[_0xff17('0x7c')];_0x1f2818[_0xff17('0x46')](_0xff17('0x66'),_0x4fb200,_0x4f7da8);}else{if(_0x3a0afb[_0xff17('0x3c')][_0x5da1f7]===_0xff17('0x7d')){_0x1f2818[_0xff17('0x46')]('i.'+_0x5da1f7+_0xff17('0x7e'));}else{_0x1f2818['where']('i.'+_0x5da1f7+_0xff17('0x6b'),_0x3a0afb[_0xff17('0x3c')][_0x5da1f7]);}}});}if(_0x3a0afb[_0xff17('0x3c')]['filter']){var _0x2c4c69=_0x3a0afb[_0xff17('0x3c')][_0xff17('0x76')][_0xff17('0x7f')]('\x5c','\x5c\x5c')[_0xff17('0x7f')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xff17('0x80')](_0x2c4c69)){_0x3efd67['or']('i.id\x20LIKE\x20?',_0x2c4c69+'%');}else{var _0x318876=[];_0x2c4c69[_0xff17('0x32')]('\x20')[_0xff17('0x33')](function(_0x536eb4){_0x318876['push']('+'+_0x536eb4[_0xff17('0x81')]());});var _0x454a78=_0x318876[_0xff17('0x82')]('\x20');_0x3efd67['or'](_0xff17('0x83'),_0x454a78)['or'](_0xff17('0x84'),_0x2c4c69+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2c4c69+'%');}}}_0x1f2818[_0xff17('0x46')](_0x3efd67);if(_0x8a3baa[_0xff17('0x44')]){_0x8a3baa[_0xff17('0x44')][_0xff17('0x33')](function(_0x59422f){_0x1f2818[_0xff17('0x44')]('i.'+_0x59422f[0x0],_0x59422f[0x1]===_0xff17('0x85')?![]:!![]);});}_0x1f2818[_0xff17('0x86')]('i.id');var _0x1203b8={'type':db[_0xff17('0x87')][_0xff17('0x88')][_0xff17('0x89')],'raw':!![]};var _0x58cc43=_0x1f2818[_0xff17('0x8a')]()[_0xff17('0x49')](_0xff17('0x4d'));if(!_0x3a0afb[_0xff17('0x3c')][_0xff17('0x5c')]){if(_0x3a0afb[_0xff17('0x3c')][_0xff17('0x8b')]){if(_0x3a0afb['query']['read']==0x1){_0x58cc43[_0xff17('0x46')](util[_0xff17('0x62')]('%s\x20=\x200',_0xc18b68[_0xff17('0x81')]()));_0x1f2818[_0xff17('0x8c')](_0xff17('0x8d'));}else{_0x58cc43[_0xff17('0x46')](util['format'](_0xff17('0x8e'),_0xc18b68[_0xff17('0x81')]()));_0x1f2818[_0xff17('0x8c')](_0xff17('0x8f'));}}if(_0x3a0afb[_0xff17('0x3c')]['tag']){var _0x5d5cc8=_[_0xff17('0x73')](_0x3a0afb[_0xff17('0x3c')]['tag'])?_0x3a0afb['query'][_0xff17('0x90')]:new Array(_0x3a0afb[_0xff17('0x3c')][_0xff17('0x90')]);var _0x24c1e4=squel['expr']();_0x5d5cc8[_0xff17('0x33')](function(_0x246193){_0x24c1e4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x246193+',%');});_0x1f2818[_0xff17('0x8c')](_0x24c1e4);_0x58cc43[_0xff17('0x55')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id');_0x58cc43[_0xff17('0x55')]('tools_tags','t',_0xff17('0x91'));_0x58cc43[_0xff17('0x46')](_0xff17('0x92'),_0x5d5cc8);}}else{var _0x3f40f9=JSON[_0xff17('0x5d')](_0x3a0afb[_0xff17('0x3c')][_0xff17('0x5c')]);_[_0xff17('0x3b')](_0x3f40f9)[_0xff17('0x33')](function(_0x2715e2){var _0x5d87a7=_0x3f40f9[_0x2715e2];if(_0x2715e2===_0xff17('0x68')){var _0x59c1d1=_0x5d87a7[_0xff17('0x5e')];var _0x5602c6=squel['expr']();_0x59c1d1['forEach'](function(_0x16d429){_0x5602c6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x16d429+',%');});_0x1f2818[_0xff17('0x8c')](_0x5602c6);_0x58cc43['left_join'](_0xff17('0x93'),'it','it.MailInteractionId\x20=\x20i.id');_0x58cc43[_0xff17('0x55')](_0xff17('0x94'),'t',_0xff17('0x91'));_0x58cc43[_0xff17('0x46')](_0xff17('0x92'),_0x59c1d1);}else if(_0x2715e2===_0xff17('0x72')){if(_0x5d87a7['value'][_0xff17('0x41')]===0x1){if(_0x5d87a7[_0xff17('0x5e')][0x0]===0x1){_0x58cc43[_0xff17('0x46')](util[_0xff17('0x62')](_0xff17('0x95'),_0xc18b68[_0xff17('0x81')]()));_0x1f2818[_0xff17('0x8c')]('`Messages.count`\x20=\x200');}else{_0x58cc43['where'](util[_0xff17('0x62')](_0xff17('0x8e'),_0xc18b68[_0xff17('0x81')]()));_0x1f2818['having'](_0xff17('0x8f'));}}}});}db[_0xff17('0x96')]['query'](_0x58cc43['toString'](),_0x1203b8)['then'](function(_0x11b653){_0x449445[_0xff17('0x20')]=_0x11b653[_0xff17('0x41')];if(_0x449445[_0xff17('0x20')]===0x0)return[];return db['sequelize'][_0xff17('0x3c')](_0x97bb59['toString'](),_0x1203b8)[_0xff17('0x27')](function(_0x4f6081){_0x358c25=_[_0xff17('0x97')](_0x4f6081,'id');_0x1203b8=_[_0xff17('0x98')](_0x1203b8,{'model':db[_0xff17('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1f2818[_0xff17('0x49')]('a.key','Account.key');_0x1f2818[_0xff17('0x49')](_0xff17('0x99'));_0x1f2818[_0xff17('0x49')](_0xff17('0x6d'),'Contact.firstName');_0x1f2818['field']('c.lastName',_0xff17('0x9a'));_0x1f2818[_0xff17('0x49')](_0xff17('0x74'),'Contact.email');_0x1f2818[_0xff17('0x49')](_0xff17('0x9b'),'Contact.phone');_0x1f2818['field'](_0xff17('0x9c'),_0xff17('0x9d'));_0x1f2818[_0xff17('0x49')](_0xff17('0x9e'),_0xff17('0x9f'));_0x1f2818[_0xff17('0x49')](_0xff17('0xa0'),_0xff17('0x31'));_0x1f2818[_0xff17('0x55')]('openchannel_interaction_has_tags','it',_0xff17('0xa1'));_0x1f2818[_0xff17('0x55')](_0xff17('0x94'),'t',_0xff17('0x91'));_0x1f2818[_0xff17('0x21')](_0x8a3baa['limit']);_0x1f2818[_0xff17('0x43')](_0x8a3baa[_0xff17('0x43')]);return db[_0xff17('0x96')][_0xff17('0x3c')](_0x1f2818['toString'](),_0x1203b8);})['then'](function(_0x1d5ab9){_0x1f9ffc['where'](_0xff17('0xa2'),_[_0xff17('0x30')](_0x1d5ab9,'id'));return db[_0xff17('0x96')][_0xff17('0x3c')](_0x1f9ffc[_0xff17('0x81')](),_0x1203b8)[_0xff17('0x27')](function(_0x8b9abe){var _0x596314=_['groupBy'](_0x8b9abe,_0xff17('0xa3'));var _0x40fcad=[];_0x1d5ab9['forEach'](function(_0x17824d){_0x40fcad[_0xff17('0x35')](updateOpenchannelInteraction(_0x17824d,_0x358c25,_0x596314));});return BPromise[_0xff17('0xa4')](_0x40fcad);});});})[_0xff17('0x27')](function(_0x5c504d){_0x449445[_0xff17('0xa5')]=_0x5c504d;return _0x449445;})[_0xff17('0x27')](respondWithFilteredResult(_0x9565c,_0x8a3baa))[_0xff17('0x36')](handleError(_0x9565c,null));};exports[_0xff17('0xa6')]=function(_0x19d692,_0x44b764){var _0x43c359={'raw':![],'where':{'id':_0x19d692[_0xff17('0xa7')]['id']}},_0xb6d5b2={};_0xb6d5b2[_0xff17('0x3a')]=_[_0xff17('0x3b')](db[_0xff17('0x38')]['rawAttributes']);_0xb6d5b2[_0xff17('0x3c')]=_[_0xff17('0x3b')](_0x19d692[_0xff17('0x3c')]);_0xb6d5b2[_0xff17('0x3d')]=_[_0xff17('0x3e')](_0xb6d5b2[_0xff17('0x3a')],_0xb6d5b2[_0xff17('0x3c')]);_0x43c359['attributes']=_[_0xff17('0x3e')](_0xb6d5b2[_0xff17('0x3a')],qs[_0xff17('0x40')](_0x19d692[_0xff17('0x3c')][_0xff17('0x40')]));_0x43c359[_0xff17('0x3f')]=_0x43c359[_0xff17('0x3f')][_0xff17('0x41')]?_0x43c359['attributes']:_0xb6d5b2[_0xff17('0x3a')];if(_0x19d692[_0xff17('0x3c')][_0xff17('0xa8')]){_0x43c359[_0xff17('0xa9')]=[{'all':!![]}];}_0x43c359=_[_0xff17('0x98')]({},_0x43c359,_0x19d692[_0xff17('0xaa')]);return db[_0xff17('0x38')][_0xff17('0xab')](_0x43c359)[_0xff17('0x27')](handleEntityNotFound(_0x44b764,null))[_0xff17('0x27')](respondWithResult(_0x44b764,null))[_0xff17('0x36')](handleError(_0x44b764,null));};exports['create']=function(_0xde8f6b,_0xb03d7c){return db[_0xff17('0x38')]['create'](_0xde8f6b[_0xff17('0xac')],{})[_0xff17('0x27')](respondWithResult(_0xb03d7c,0xc9))['catch'](handleError(_0xb03d7c,null));};exports[_0xff17('0xad')]=function(_0x512ef4,_0x593454){if(_0x512ef4['body']['id']){delete _0x512ef4[_0xff17('0xac')]['id'];}return db[_0xff17('0x38')][_0xff17('0xab')]({'where':{'id':_0x512ef4['params']['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x593454,null))[_0xff17('0x27')](saveUpdates(_0x512ef4[_0xff17('0xac')],null))[_0xff17('0x27')](respondWithResult(_0x593454,null))[_0xff17('0x36')](handleError(_0x593454,null));};exports[_0xff17('0x28')]=function(_0x2d1f07,_0x1c8592){return db[_0xff17('0x38')][_0xff17('0xab')]({'where':{'id':_0x2d1f07[_0xff17('0xa7')]['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x1c8592,null))['then'](removeEntity(_0x1c8592,null))['catch'](handleError(_0x1c8592,null));};exports[_0xff17('0xae')]=function(_0x4b7bd5,_0x2f05b5){return db[_0xff17('0x38')][_0xff17('0xae')]()['then'](respondWithResult(_0x2f05b5,null))['catch'](handleError(_0x2f05b5,null));};exports[_0xff17('0xaf')]=function(_0x4df0a4,_0x38f2e2,_0x479bfb){return db[_0xff17('0xb0')][_0xff17('0xab')]({'where':{'id':_0x4df0a4[_0xff17('0xa7')]['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x38f2e2,null))[_0xff17('0x27')](function(_0x45d8c9){if(_0x45d8c9){return _0x45d8c9[_0xff17('0xaf')](_0x4df0a4[_0xff17('0xac')][_0xff17('0xb1')],_[_0xff17('0xb2')](_0x4df0a4[_0xff17('0xac')],[_0xff17('0xb1'),'id'])||{});}})[_0xff17('0x27')](respondWithResult(_0x38f2e2,null))['catch'](handleError(_0x38f2e2,null));};exports['getMessages']=function(_0x4bbc76,_0x51905c,_0xd7e3d){var _0x4f2fdb={'raw':![],'where':{}};var _0x5a4a86={};var _0x32c2c1={'count':0x0,'rows':[]};return db[_0xff17('0x38')][_0xff17('0xb3')]({'where':{'id':_0x4bbc76[_0xff17('0xa7')]['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x51905c,null))['then'](function(_0x5a9836){if(_0x5a9836){_0x5a4a86[_0xff17('0x3a')]=_[_0xff17('0x3b')](db[_0xff17('0xb0')][_0xff17('0x39')]);_0x5a4a86[_0xff17('0x3c')]=_[_0xff17('0x3b')](_0x4bbc76[_0xff17('0x3c')]);_0x5a4a86['filters']=_[_0xff17('0x3e')](_0x5a4a86[_0xff17('0x3a')],_0x5a4a86[_0xff17('0x3c')]);_0x4f2fdb['attributes']=_[_0xff17('0x3e')](_0x5a4a86[_0xff17('0x3a')],qs['fields'](_0x4bbc76[_0xff17('0x3c')][_0xff17('0x40')]));_0x4f2fdb['attributes']=_0x4f2fdb[_0xff17('0x3f')][_0xff17('0x41')]?_0x4f2fdb[_0xff17('0x3f')]:_0x5a4a86[_0xff17('0x3a')];if(!_0x4bbc76[_0xff17('0x3c')][_0xff17('0x75')]('nolimit')){_0x4f2fdb['limit']=qs[_0xff17('0x21')](_0x4bbc76[_0xff17('0x3c')][_0xff17('0x21')]);_0x4f2fdb['offset']=qs[_0xff17('0x43')](_0x4bbc76[_0xff17('0x3c')]['offset']);}_0x4f2fdb[_0xff17('0x44')]=qs[_0xff17('0x45')](_0x4bbc76[_0xff17('0x3c')][_0xff17('0x45')]);_0x4f2fdb[_0xff17('0x46')]=qs[_0xff17('0x3d')](_[_0xff17('0x47')](_0x4bbc76[_0xff17('0x3c')],_0x5a4a86[_0xff17('0x3d')]));_0x4f2fdb['where']['OpenchannelInteractionId']=_0x5a9836['id'];if(_0x4bbc76[_0xff17('0x3c')][_0xff17('0x76')]){_0x4f2fdb[_0xff17('0x46')]=_['merge'](_0x4f2fdb['where'],{'$or':_[_0xff17('0x30')](_0x4f2fdb[_0xff17('0x3f')],function(_0xa7ba45){var _0x23f12c={};_0x23f12c[_0xa7ba45]={'$like':'%'+_0x4bbc76[_0xff17('0x3c')][_0xff17('0x76')]+'%'};return _0x23f12c;})});}if(_0x4bbc76['query'][_0xff17('0x7b')]){var _0x2dbf4a=_0x4bbc76['query'][_0xff17('0x7b')][_0xff17('0x32')](',');var _0x2689d1={};_0x2689d1[_0x2dbf4a[0x0]]={'$gte':moment(_0x2dbf4a[0x1])[_0xff17('0x62')](_0xff17('0xb4'))};_0x4f2fdb[_0xff17('0x46')]=_[_0xff17('0x98')](_0x4f2fdb['where'],_0x2689d1);}_0x4f2fdb=_[_0xff17('0x98')]({},_0x4f2fdb,_0x4bbc76[_0xff17('0xaa')]);return db['OpenchannelMessage']['count']({'where':_0x4f2fdb[_0xff17('0x46')]})['then'](function(_0x4d46ce){_0x32c2c1[_0xff17('0x20')]=_0x4d46ce;if(_0x4bbc76['query']['includeAll']){_0x4f2fdb[_0xff17('0xa9')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xff17('0xb5')](_0x4f2fdb);})[_0xff17('0x27')](function(_0x597368){_0x32c2c1[_0xff17('0xa5')]=_0x597368;return _0x32c2c1;});}})[_0xff17('0x27')](respondWithFilteredResult(_0x51905c,_0x4f2fdb))[_0xff17('0x36')](handleError(_0x51905c,null));};exports[_0xff17('0xb6')]=function(_0x370251,_0x1afe35,_0x5df791){return db[_0xff17('0x38')][_0xff17('0xab')]({'where':{'id':_0x370251[_0xff17('0xa7')]['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x1afe35,null))[_0xff17('0x27')](function(_0x3062e0){if(_0x3062e0){return _0x3062e0[_0xff17('0xb7')](_0x370251['body'][_0xff17('0xb1')],_[_0xff17('0xb2')](_0x370251['body'],[_0xff17('0xb1'),'id'])||{})['spread'](function(){return db[_0xff17('0xb8')][_0xff17('0xb5')]({'attributes':['id',_0xff17('0x4a'),_0xff17('0x4b')],'where':{'id':_0x370251[_0xff17('0xac')][_0xff17('0xb1')]}});})[_0xff17('0x27')](function(_0x32594b){socket['emit'](_0xff17('0xb9'),{'id':Number(_0x370251[_0xff17('0xa7')]['id']),'tags':_0x32594b||[]});return{'id':Number(_0x370251[_0xff17('0xa7')]['id']),'tags':_0x32594b||[]};});}})[_0xff17('0x27')](respondWithResult(_0x1afe35,null))[_0xff17('0x36')](handleError(_0x1afe35,null));};exports[_0xff17('0xba')]=function(_0x2b2b99,_0x1213c4,_0x59dffe){return db['OpenchannelInteraction'][_0xff17('0xab')]({'where':{'id':_0x2b2b99[_0xff17('0xa7')]['id']}})[_0xff17('0x27')](handleEntityNotFound(_0x1213c4,null))[_0xff17('0x27')](function(_0x1062dc){if(_0x1062dc){return _0x1062dc[_0xff17('0xba')](_0x2b2b99[_0xff17('0x3c')][_0xff17('0xb1')]);}})['then'](respondWithStatusCode(_0x1213c4,null))['catch'](handleError(_0x1213c4,null));};exports[_0xff17('0xbb')]=function(_0x4aea67,_0x306e8b){var _0x215f5a=moment()[_0xff17('0xbc')]()[_0xff17('0x81')]();var _0x5cfe07=path[_0xff17('0x82')](config[_0xff17('0xbd')],_0xff17('0xbe'),_0xff17('0xbf'),_0xff17('0xc0'));var _0x262f36=path[_0xff17('0x82')](config['root'],_0xff17('0xbe'),_0xff17('0xbf'),_0xff17('0xc1'));var _0x1a43de=path[_0xff17('0x82')](_0x5cfe07,_0x215f5a);var _0x58232e=util['format']('transcript-%d-%s.zip',_0x4aea67[_0xff17('0xa7')]['id'],_0x215f5a);var _0x370ab3=path['join'](_0x5cfe07,_0x58232e);var _0x33176a=![];return db[_0xff17('0x38')][_0xff17('0xab')]({'where':{'id':_0x4aea67[_0xff17('0xa7')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0xff17('0xc2'),'attributes':['id',_0xff17('0xac'),_0xff17('0x7a'),_0xff17('0xc3'),_0xff17('0xc4')],'include':[{'model':db[_0xff17('0xc5')],'as':_0xff17('0xc5'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xff17('0xc6')],'as':_0xff17('0xc7'),'attributes':['id',_0xff17('0xc8'),_0xff17('0xc9')],'raw':!![]},{'model':db[_0xff17('0xca')],'as':_0xff17('0xca'),'raw':!![]}]},{'model':db[_0xff17('0xcb')],'as':_0xff17('0xcc'),'attributes':['id',_0xff17('0x4a')]},{'model':db[_0xff17('0xc5')],'as':_0xff17('0xcd'),'attributes':['id',_0xff17('0xce')]}]})[_0xff17('0x27')](handleEntityNotFound(_0x306e8b,null))[_0xff17('0x27')](function(_0xd22f7e){if(_0xd22f7e){var _0x91fa17=_0xd22f7e['get']({'plain':!![]});_0x33176a=!![];var _0x4577be={'format':'A4','border':'10px','header':{'height':_0xff17('0xcf'),'contents':{'first':_0xff17('0xd0')}},'footer':{'height':'30px','contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0xff17('0x62')](_0xff17('0xd1'),_0xff17('0xd2'),_0x91fa17['id']),moment()[_0xff17('0x62')](_0xff17('0xd3'))[_0xff17('0x81')]())}}};fs['mkdirSync'](_0x1a43de);var _0x46c944={'channel':_0xff17('0xd2'),'account':_0x91fa17[_0xff17('0xcc')][_0xff17('0x4a')],'agent':_0x91fa17[_0xff17('0xcd')]?_0x91fa17[_0xff17('0xcd')]['fullname']:_0xff17('0xd4'),'createdAt':moment(_0x91fa17[_0xff17('0x7a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xff17('0x81')](),'closedAt':_0x91fa17[_0xff17('0x2d')]?moment(_0x91fa17['closedAt'])[_0xff17('0x62')](_0xff17('0xb4'))[_0xff17('0x81')]():'','disposition':_0x91fa17[_0xff17('0xd5')],'visibility':_0x91fa17[_0xff17('0xd6')]?_0xff17('0xd7'):_0xff17('0xd8'),'messages':_(_0x91fa17[_0xff17('0xc2')])['filter']({'secret':![]})[_0xff17('0x30')](function(_0x16d3fb){if(_0x16d3fb['Attachment']){var _0x145dab=path[_0xff17('0x82')](_0x262f36,_0x16d3fb['Attachment'][_0xff17('0xd9')]);if(fs['existsSync'](_0x145dab)){fs[_0xff17('0xda')](_0x145dab)[_0xff17('0xdb')](fs['createWriteStream'](path[_0xff17('0x82')](_0x1a43de,_0x16d3fb[_0xff17('0xca')][_0xff17('0xd9')])));}}return{'date':moment(_0x16d3fb[_0xff17('0x7a')])[_0xff17('0x62')](_0xff17('0xb4'))['toString'](),'sender':_0x16d3fb[_0xff17('0xc3')]===_0xff17('0xdc')?_0x16d3fb['User']?_0x16d3fb[_0xff17('0xc5')][_0xff17('0xce')]:_0xff17('0xdd'):_0x16d3fb[_0xff17('0xc7')]['firstName']+(_0x16d3fb[_0xff17('0xc7')]['lastName']?'\x20'+_0x16d3fb[_0xff17('0xc7')]['lastName']:''),'body':_0x16d3fb[_0xff17('0xca')]?_0x16d3fb[_0xff17('0xca')][_0xff17('0xd9')]:_0x16d3fb[_0xff17('0xac')],'direction':_0x16d3fb[_0xff17('0xc3')]===_0xff17('0xdc')?'A':'C','secret':_0x16d3fb[_0xff17('0xc4')],'attachment':_0x16d3fb[_0xff17('0xca')]};})[_0xff17('0x5e')]()};return ejs[_0xff17('0xde')](path[_0xff17('0x82')](config['root'],_0xff17('0xbe'),'views',_0xff17('0xdf')),{'interaction':_0x46c944})[_0xff17('0x27')](function(_0x59e03c){return new BPromise(function(_0x561ff0,_0x4988b6){pdf[_0xff17('0xe0')](_0x59e03c,_0x4577be)[_0xff17('0xe1')](path[_0xff17('0x82')](_0x1a43de,'transcript-'+_0x91fa17['id']+'-'+_0x215f5a+_0xff17('0xe2')),function(_0x408024,_0x28254d){if(_0x408024)return _0x4988b6(_0x408024);_0x561ff0(_0x28254d);});});});}})[_0xff17('0x27')](function(){if(_0x33176a){return new BPromise(function(_0x2389f2,_0xb63f8a){zipdir(_0x1a43de,{'saveTo':_0x370ab3},function(_0x2bc358,_0x211771){if(_0x2bc358)return _0xb63f8a(_0x2bc358);return _0x2389f2(_0x211771);});})[_0xff17('0x27')](function(){return new BPromise(function(_0x24cbb1,_0x84fd27){rimraf(_0x1a43de,function(_0x8471ca){if(_0x8471ca)_0x84fd27(_0x8471ca);return _0x24cbb1();});});})[_0xff17('0x27')](function(){return _0x306e8b[_0xff17('0xbb')](_0x370ab3,_0x58232e,function(_0x1fcc66){if(_0x1fcc66){console[_0xff17('0xe3')](_0xff17('0xe4'),_0x1fcc66);}else{fs[_0xff17('0xe5')](_0x370ab3);}});});}else{return _0x306e8b[_0xff17('0x29')](0xc8);}})[_0xff17('0x36')](handleError(_0x306e8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 96ed57d..a7897b5 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 _0xdbe5=['setDataValue','Users','map','findAll','unreadMessages','emit','exports','events','OpenchannelInteraction','../../mysqldb','update','remove','getUsers','then'];(function(_0x105a52,_0x4e0f2e){var _0xe660ab=function(_0x3f306d){while(--_0x3f306d){_0x105a52['push'](_0x105a52['shift']());}};_0xe660ab(++_0x4e0f2e);}(_0xdbe5,0x13b));var _0x5dbe=function(_0x2186f2,_0x429eb5){_0x2186f2=_0x2186f2-0x0;var _0x36d766=_0xdbe5[_0x2186f2];return _0x36d766;};'use strict';var EventEmitter=require(_0x5dbe('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x5dbe('0x1')];var OpenchannelMessage=require(_0x5dbe('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5dbe('0x3'),'afterDestroy':_0x5dbe('0x4')};function emitEvent(_0x35b124){return function(_0x553f50,_0x5a5ae6,_0x24afc6){_0x553f50[_0x5dbe('0x5')]({'attributes':['id'],'raw':!![]})[_0x5dbe('0x6')](function(_0x5c6729){_0x553f50[_0x5dbe('0x7')](_0x5dbe('0x8'),_0x5c6729[_0x5dbe('0x9')](function(_0x553910){return{'id':_0x553910['id']};}));return OpenchannelMessage[_0x5dbe('0xa')]({'where':{'OpenchannelInteractionId':_0x553f50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5dbe('0x6')](function(_0x152a64){_0x553f50['setDataValue'](_0x5dbe('0xb'),_0x152a64['length']);OpenchannelInteractionEvents[_0x5dbe('0xc')](_0x35b124+':'+_0x553f50['id'],_0x553f50);OpenchannelInteractionEvents['emit'](_0x35b124,_0x553f50);_0x24afc6(null);})['catch'](_0x24afc6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x5dbe('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xd5bc=['setDataValue','Users','findAll','then','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers'];(function(_0x50981c,_0x1bc44e){var _0x5f0e02=function(_0x2a0e24){while(--_0x2a0e24){_0x50981c['push'](_0x50981c['shift']());}};_0x5f0e02(++_0x1bc44e);}(_0xd5bc,0x78));var _0xcd5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5bc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcd5b('0x0'));var OpenchannelInteraction=require(_0xcd5b('0x1'))['db'][_0xcd5b('0x2')];var OpenchannelMessage=require(_0xcd5b('0x1'))['db'][_0xcd5b('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcd5b('0x4')](0x0);var events={'afterCreate':_0xcd5b('0x5'),'afterUpdate':_0xcd5b('0x6'),'afterDestroy':'remove'};function emitEvent(_0x246094){return function(_0x38a2f2,_0x3d6ab6,_0x501170){_0x38a2f2[_0xcd5b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x35dcec){_0x38a2f2[_0xcd5b('0x8')](_0xcd5b('0x9'),_0x35dcec['map'](function(_0xac4a14){return{'id':_0xac4a14['id']};}));return OpenchannelMessage[_0xcd5b('0xa')]({'where':{'OpenchannelInteractionId':_0x38a2f2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcd5b('0xb')](function(_0x23410d){_0x38a2f2['setDataValue']('unreadMessages',_0x23410d[_0xcd5b('0xc')]);OpenchannelInteractionEvents[_0xcd5b('0xd')](_0x246094+':'+_0x38a2f2['id'],_0x38a2f2);OpenchannelInteractionEvents[_0xcd5b('0xd')](_0x246094,_0x38a2f2);_0x501170(null);})['catch'](_0x501170(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xcd5b('0xe')](e,emitEvent(event));}}module[_0xcd5b('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 17e7d7f..d1670be 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 _0x12c9=['../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','closed','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x349e0c,_0x3f2bbc){var _0x55a4cf=function(_0x3ede12){while(--_0x3ede12){_0x349e0c['push'](_0x349e0c['shift']());}};_0x55a4cf(++_0x3f2bbc);}(_0x12c9,0x1c9));var _0x912c=function(_0x3a8936,_0x67552b){_0x3a8936=_0x3a8936-0x0;var _0x5b8a9f=_0x12c9[_0x3a8936];return _0x5b8a9f;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require(_0x912c('0x2'))(_0x912c('0x3'));var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var rp=require(_0x912c('0x5'));var fs=require('fs');var path=require(_0x912c('0x6'));var rimraf=require(_0x912c('0x7'));var config=require(_0x912c('0x8'));var attributes=require(_0x912c('0x9'));module['exports']=function(_0x584a27,_0xe29019){return _0x584a27[_0x912c('0xa')](_0x912c('0xb'),attributes,{'tableName':_0x912c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x312a7f,_0x5c740a,_0x11ee0e){if(_0x312a7f['changed'](_0x912c('0xd'))){_0x312a7f['closedAt']=moment()[_0x912c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x11ee0e(null,_0x312a7f);}}});}; \ No newline at end of file +var _0x5ad3=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','changed'];(function(_0x33f885,_0xf22905){var _0xc40f02=function(_0x11b37f){while(--_0x11b37f){_0x33f885['push'](_0x33f885['shift']());}};_0xc40f02(++_0xf22905);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x5ad3[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cec3e,_0x3f1f55,_0x5400f3){if(_0x3cec3e[_0x35ad('0xd')]('closed')){_0x3cec3e['closedAt']=moment()[_0x35ad('0xe')](_0x35ad('0xf'));}_0x5400f3(null,_0x3cec3e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e6929c7..829ceff 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 _0x6455=['message','info','result','catch','OpenchannelInteraction','body','raw','options','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2e612a,_0x106dd7){var _0x3cb97c=function(_0x367d2f){while(--_0x367d2f){_0x2e612a['push'](_0x2e612a['shift']());}};_0x3cb97c(++_0x106dd7);}(_0x6455,0x97));var _0x5645=function(_0x350e44,_0x16fba3){_0x350e44=_0x350e44-0x0;var _0x586844=_0x6455[_0x350e44];return _0x586844;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});config[_0x5645('0xc')]=_[_0x5645('0xd')](config[_0x5645('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5645('0xc')]));require(_0x5645('0xe'))[_0x5645('0xf')](socket);function respondWithRpcPromise(_0x34fe4e,_0x7f9893,_0x16af81){return new BPromise(function(_0x587c61,_0x212e46){return client[_0x5645('0x10')](_0x34fe4e,_0x16af81)[_0x5645('0x11')](function(_0x21e32c){logger['info'](_0x5645('0x12'),_0x7f9893,'request\x20sent');logger[_0x5645('0x13')](_0x5645('0x14'),_0x7f9893,_0x5645('0x15'),JSON[_0x5645('0x16')](_0x21e32c));if(_0x21e32c[_0x5645('0x17')]){if(_0x21e32c[_0x5645('0x17')][_0x5645('0x18')]===0x1f4){logger[_0x5645('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x7f9893,_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);return _0x212e46(_0x21e32c[_0x5645('0x17')]['message']);}logger['error'](_0x5645('0x12'),_0x7f9893,_0x21e32c[_0x5645('0x17')]['message']);return _0x587c61(_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);}else{logger[_0x5645('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x7f9893,_0x5645('0x15'));_0x587c61(_0x21e32c[_0x5645('0x1b')][_0x5645('0x19')]);}})[_0x5645('0x1c')](function(_0x5ac9ee){logger[_0x5645('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x7f9893,_0x5ac9ee);_0x212e46(_0x5ac9ee);});});}exports['UpdateOpenchannelInteraction']=function(_0x7c39d7){var _0x1e2cba=this;return new Promise(function(_0x2e3350,_0x59a491){return db[_0x5645('0x1d')]['update'](_0x7c39d7[_0x5645('0x1e')],{'raw':_0x7c39d7['options']?_0x7c39d7['options'][_0x5645('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7c39d7['options']?_0x7c39d7[_0x5645('0x20')][_0x5645('0x21')]||null:null,'attributes':_0x7c39d7['options']?_0x7c39d7[_0x5645('0x20')][_0x5645('0x22')]||null:null,'limit':_0x7c39d7[_0x5645('0x20')]?_0x7c39d7['options'][_0x5645('0x23')]||null:null})[_0x5645('0x11')](function(_0x3f6929){logger[_0x5645('0x1a')]('UpdateOpenchannelInteraction',_0x7c39d7);logger['debug']('UpdateOpenchannelInteraction',_0x7c39d7,JSON['stringify'](_0x3f6929));_0x2e3350(_0x3f6929);})[_0x5645('0x1c')](function(_0x5df697){logger['error'](_0x5645('0x24'),_0x5df697[_0x5645('0x19')],_0x7c39d7);_0x59a491(_0x1e2cba[_0x5645('0x17')](0x1f4,_0x5df697[_0x5645('0x19')]));});});};exports[_0x5645('0x25')]=function(_0x351cbb){return new Promise(function(_0x3b9d8e,_0xc585f3){return db[_0x5645('0x1d')][_0x5645('0x26')]({'where':_0x351cbb[_0x5645('0x20')]?_0x351cbb[_0x5645('0x20')][_0x5645('0x21')]||null:null})[_0x5645('0x11')](function(_0x52ba45){if(_0x52ba45){return _0x52ba45[_0x5645('0x27')](_0x351cbb['body'][_0x5645('0x28')],_[_0x5645('0x29')](_0x351cbb[_0x5645('0x1e')],[_0x5645('0x28'),'id'])||{});}})[_0x5645('0x2a')](function(_0xc90d52){logger['info']('AddTags',_0x351cbb);logger[_0x5645('0x13')](_0x5645('0x2b'),_0x351cbb,JSON[_0x5645('0x16')](_0xc90d52));_0x3b9d8e(_0xc90d52);})[_0x5645('0x1c')](function(_0x3b070c){logger[_0x5645('0x17')](_0x5645('0x2b'),_0x3b070c[_0x5645('0x19')],_0x351cbb);_0xc585f3(_this[_0x5645('0x17')](0x1f4,_0x3b070c[_0x5645('0x19')]));});});}; \ No newline at end of file +var _0xfcf0=['register','request','then','request\x20sent','debug','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','catch','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','OpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfcf0,0x138));var _0x0fcf=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfcf0[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});config[_0x0fcf('0xc')]=_[_0x0fcf('0xd')](config['redis'],{'host':_0x0fcf('0xe'),'port':0x18eb});var socket=require(_0x0fcf('0xf'))(new Redis(config[_0x0fcf('0xc')]));require('./openchannelInteraction.socket')[_0x0fcf('0x10')](socket);function respondWithRpcPromise(_0x7ac7bd,_0x239e5d,_0x4b3923){return new BPromise(function(_0x369959,_0x5c29ed){return client[_0x0fcf('0x11')](_0x7ac7bd,_0x4b3923)[_0x0fcf('0x12')](function(_0x201a58){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'));logger[_0x0fcf('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'),JSON[_0x0fcf('0x15')](_0x201a58));if(_0x201a58[_0x0fcf('0x16')]){if(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x17')]===0x1f4){logger['error'](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);return _0x5c29ed(_0x201a58['error'][_0x0fcf('0x19')]);}logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')]['message']);return _0x369959(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);}else{logger[_0x0fcf('0x1a')](_0x0fcf('0x18'),_0x239e5d,_0x0fcf('0x13'));_0x369959(_0x201a58['result'][_0x0fcf('0x19')]);}})[_0x0fcf('0x1b')](function(_0x5dad87){logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x5dad87);_0x5c29ed(_0x5dad87);});});}exports['UpdateOpenchannelInteraction']=function(_0x2022e1){var _0x50ac4a=this;return new Promise(function(_0x3fc9e6,_0x13454e){return db['OpenchannelInteraction'][_0x0fcf('0x1c')](_0x2022e1[_0x0fcf('0x1d')],{'raw':_0x2022e1[_0x0fcf('0x1e')]?_0x2022e1['options'][_0x0fcf('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2022e1[_0x0fcf('0x1e')]?_0x2022e1[_0x0fcf('0x1e')][_0x0fcf('0x20')]||null:null,'attributes':_0x2022e1[_0x0fcf('0x1e')]?_0x2022e1[_0x0fcf('0x1e')]['attributes']||null:null,'limit':_0x2022e1[_0x0fcf('0x1e')]?_0x2022e1[_0x0fcf('0x1e')][_0x0fcf('0x21')]||null:null})[_0x0fcf('0x12')](function(_0x233ac9){logger[_0x0fcf('0x1a')](_0x0fcf('0x22'),_0x2022e1);logger[_0x0fcf('0x14')](_0x0fcf('0x22'),_0x2022e1,JSON['stringify'](_0x233ac9));_0x3fc9e6(_0x233ac9);})[_0x0fcf('0x1b')](function(_0xc107a){logger[_0x0fcf('0x16')](_0x0fcf('0x22'),_0xc107a[_0x0fcf('0x19')],_0x2022e1);_0x13454e(_0x50ac4a[_0x0fcf('0x16')](0x1f4,_0xc107a[_0x0fcf('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x137e10){return new Promise(function(_0xbaa4d8,_0x200517){return db[_0x0fcf('0x23')]['find']({'where':_0x137e10['options']?_0x137e10['options'][_0x0fcf('0x20')]||null:null})['then'](function(_0x26c3bc){if(_0x26c3bc){return _0x26c3bc[_0x0fcf('0x24')](_0x137e10['body'][_0x0fcf('0x25')],_[_0x0fcf('0x26')](_0x137e10[_0x0fcf('0x1d')],[_0x0fcf('0x25'),'id'])||{});}})[_0x0fcf('0x27')](function(_0x20f94c){logger['info'](_0x0fcf('0x28'),_0x137e10);logger[_0x0fcf('0x14')](_0x0fcf('0x28'),_0x137e10,JSON[_0x0fcf('0x15')](_0x20f94c));_0xbaa4d8(_0x20f94c);})[_0x0fcf('0x1b')](function(_0x436e82){logger['error'](_0x0fcf('0x28'),_0x436e82[_0x0fcf('0x19')],_0x137e10);_0x200517(_this[_0x0fcf('0x16')](0x1f4,_0x436e82[_0x0fcf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a7b637e..dd32bbf 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 _0x742d=['remove','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x506945,_0x2e8058){var _0x361e83=function(_0x38fc1f){while(--_0x38fc1f){_0x506945['push'](_0x506945['shift']());}};_0x361e83(++_0x2e8058);}(_0x742d,0x8e));var _0xd742=function(_0x31df4c,_0xf3bf77){_0x31df4c=_0x31df4c-0x0;var _0x4dae25=_0x742d[_0x31df4c];return _0x4dae25;};'use strict';var OpenchannelInteractionEvents=require(_0xd742('0x0'));var events=[_0xd742('0x1'),_0xd742('0x2'),_0xd742('0x3')];function createListener(_0x4f2ec9,_0x2c9a53){return function(_0x2eed05){_0x2c9a53[_0xd742('0x4')](_0x4f2ec9,_0x2eed05);};}function removeListener(_0x43378b,_0x2ca679){return function(){OpenchannelInteractionEvents[_0xd742('0x5')](_0x43378b,_0x2ca679);};}exports['register']=function(_0x2c0467){for(var _0x4642da=0x0,_0xc9cb9=events[_0xd742('0x6')];_0x4642da<_0xc9cb9;_0x4642da++){var _0x660c4d=events[_0x4642da];var _0x20cbc6=createListener(_0xd742('0x7')+_0x660c4d,_0x2c0467);OpenchannelInteractionEvents['on'](_0x660c4d,_0x20cbc6);}}; \ No newline at end of file +var _0xfd59=['register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','removeListener'];(function(_0x12936f,_0x42f6a3){var _0x30b634=function(_0x4368f8){while(--_0x4368f8){_0x12936f['push'](_0x12936f['shift']());}};_0x30b634(++_0x42f6a3);}(_0xfd59,0x1d3));var _0x9fd5=function(_0x2e11a9,_0x3577d2){_0x2e11a9=_0x2e11a9-0x0;var _0x579c13=_0xfd59[_0x2e11a9];return _0x579c13;};'use strict';var OpenchannelInteractionEvents=require(_0x9fd5('0x0'));var events=[_0x9fd5('0x1'),_0x9fd5('0x2'),_0x9fd5('0x3')];function createListener(_0x1f74a8,_0x53330c){return function(_0xb34530){_0x53330c['emit'](_0x1f74a8,_0xb34530);};}function removeListener(_0x157c27,_0x5c5b73){return function(){OpenchannelInteractionEvents[_0x9fd5('0x4')](_0x157c27,_0x5c5b73);};}exports[_0x9fd5('0x5')]=function(_0x1ad6ec){for(var _0x259f20=0x0,_0x8c194a=events[_0x9fd5('0x6')];_0x259f20<_0x8c194a;_0x259f20++){var _0x23e7ac=events[_0x259f20];var _0x10bb0d=createListener(_0x9fd5('0x7')+_0x23e7ac,_0x1ad6ec);OpenchannelInteractionEvents['on'](_0x23e7ac,_0x10bb0d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index bb7aacb..918aca6 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 _0xd239=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','/:id/accept','accept','/:id/reject','delete','destroy'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xd239,0x92));var _0x9d23=function(_0x5211f7,_0x1b5bfe){_0x5211f7=_0x5211f7-0x0;var _0x5b8365=_0xd239[_0x5211f7];return _0x5b8365;};'use strict';var multer=require(_0x9d23('0x0'));var util=require(_0x9d23('0x1'));var path=require(_0x9d23('0x2'));var timeout=require(_0x9d23('0x3'));var express=require(_0x9d23('0x4'));var router=express[_0x9d23('0x5')]();var auth=require(_0x9d23('0x6'));var interaction=require(_0x9d23('0x7'));var config=require(_0x9d23('0x8'));var controller=require(_0x9d23('0x9'));router[_0x9d23('0xa')]('/',auth[_0x9d23('0xb')](),controller[_0x9d23('0xc')]);router['get'](_0x9d23('0xd'),auth['isAuthenticated'](),controller[_0x9d23('0xe')]);router['get'](_0x9d23('0xf'),auth[_0x9d23('0xb')](),controller[_0x9d23('0x10')]);router[_0x9d23('0x11')]('/',auth['isAuthenticated'](),interaction[_0x9d23('0x12')](_0x9d23('0x13'),_0x9d23('0x14')),controller[_0x9d23('0x15')]);router['put'](_0x9d23('0xf'),auth['isAuthenticated'](),controller[_0x9d23('0x16')]);router['put'](_0x9d23('0x17'),auth[_0x9d23('0xb')](),controller[_0x9d23('0x18')]);router['put'](_0x9d23('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x9d23('0x1a')]('/:id',auth[_0x9d23('0xb')](),controller[_0x9d23('0x1b')]);module[_0x9d23('0x1c')]=router; \ No newline at end of file +var _0xd25f=['multer','util','connect-timeout','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','openchannel','openchannelmessage:create','update','put','accept','/:id/reject','reject','destroy','exports'];(function(_0x474e33,_0x172661){var _0x28dd=function(_0x19e6cc){while(--_0x19e6cc){_0x474e33['push'](_0x474e33['shift']());}};_0x28dd(++_0x172661);}(_0xd25f,0x84));var _0xfd25=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xd25f[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var path=require('path');var timeout=require(_0xfd25('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfd25('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfd25('0x4'));var controller=require(_0xfd25('0x5'));router[_0xfd25('0x6')]('/',auth[_0xfd25('0x7')](),controller[_0xfd25('0x8')]);router['get'](_0xfd25('0x9'),auth['isAuthenticated'](),controller[_0xfd25('0xa')]);router[_0xfd25('0x6')](_0xfd25('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xfd25('0xc')]('/',auth[_0xfd25('0x7')](),interaction['tracked'](_0xfd25('0xd'),_0xfd25('0xe')),controller['create']);router['put'](_0xfd25('0xb'),auth['isAuthenticated'](),controller[_0xfd25('0xf')]);router[_0xfd25('0x10')]('/:id/accept',auth[_0xfd25('0x7')](),controller[_0xfd25('0x11')]);router[_0xfd25('0x10')](_0xfd25('0x12'),auth['isAuthenticated'](),controller[_0xfd25('0x13')]);router['delete']('/:id',auth[_0xfd25('0x7')](),controller[_0xfd25('0x14')]);module[_0xfd25('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index bb52aaa..56f9cb0 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 _0x5c84=['medium','BOOLEAN','out','DATE','sequelize','exports','TEXT'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x5c84,0x1c4));var _0x45c8=function(_0x356554,_0x1fc7a4){_0x356554=_0x356554-0x0;var _0x4f530b=_0x5c84[_0x356554];return _0x4f530b;};'use strict';var Sequelize=require(_0x45c8('0x0'));module[_0x45c8('0x1')]={'body':{'type':Sequelize[_0x45c8('0x2')](_0x45c8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x45c8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x45c8('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x45c8('0x6')]}}; \ No newline at end of file +var _0x95a6=['ENUM','out','DATE','sequelize','medium','BOOLEAN'];(function(_0x889f5,_0x30d0a0){var _0x48cb1e=function(_0x55c3bf){while(--_0x55c3bf){_0x889f5['push'](_0x889f5['shift']());}};_0x48cb1e(++_0x30d0a0);}(_0x95a6,0x141));var _0x695a=function(_0x348ded,_0x14c3a9){_0x348ded=_0x348ded-0x0;var _0x560892=_0x95a6[_0x348ded];return _0x560892;};'use strict';var Sequelize=require(_0x695a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x695a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x695a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x695a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x695a('0x3')]('in','out'),'defaultValue':_0x695a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x695a('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 718b2b8..282fa57 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 _0x9f0e=['readAt','UserId','user','CmContact','Contact','get','OpenchannelInteraction','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','jayson/promise','http','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','key','field','merge','options','OpenchannelMessage','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x9f0e,0x116));var _0xe9f0=function(_0x221e44,_0x1cb4d3){_0x221e44=_0x221e44-0x0;var _0x461557=_0x9f0e[_0x221e44];return _0x461557;};'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 hardwareService=require(_0xe9f0('0x14'));var logger=require(_0xe9f0('0x15'))('api');var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var db=require(_0xe9f0('0x18'))['db'];config['redis']=_[_0xe9f0('0x19')](config['redis'],{'host':_0xe9f0('0x1a'),'port':0x18eb});var socket=require(_0xe9f0('0x1b'))(new Redis(config[_0xe9f0('0x1c')]));require(_0xe9f0('0x1d'))['register'](socket);var jayson=require(_0xe9f0('0x1e'));var client=jayson['client'][_0xe9f0('0x1f')]({'port':0x232c});var client9002=jayson[_0xe9f0('0x20')][_0xe9f0('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x59320d,_0x28bfac,_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e68ef['test'](_0x28bfac)){return _0x59320d;}else{throw new Error(_0xe9f0('0x21'));}}else{return _0x59320d;}}function respondWithRpcPromise(_0x1e16e0,_0xcd2042,_0xd71ac8,_0x3ed69a){return new BPromise(function(_0x2ab12b,_0x3da237){var _0x59bf5a=_0x3ed69a||client;return _0x59bf5a[_0xe9f0('0x22')](_0x1e16e0,_0xd71ac8)[_0xe9f0('0x23')](function(_0x232f2c){logger['info'](_0xe9f0('0x24'),_0xcd2042,_0xe9f0('0x25'));logger[_0xe9f0('0x26')](_0xe9f0('0x27'),_0xcd2042,'request\x20sent',JSON[_0xe9f0('0x28')](_0x232f2c));if(_0x232f2c[_0xe9f0('0x29')]){if(_0x232f2c['error']['code']===0x1f4){logger['error'](_0xe9f0('0x24'),_0xcd2042,_0x232f2c[_0xe9f0('0x29')][_0xe9f0('0x2a')]);return _0x3da237(_0x232f2c[_0xe9f0('0x29')][_0xe9f0('0x2a')]);}logger['error'](_0xe9f0('0x24'),_0xcd2042,_0x232f2c[_0xe9f0('0x29')][_0xe9f0('0x2a')]);return _0x2ab12b(_0x232f2c[_0xe9f0('0x29')][_0xe9f0('0x2a')]);}else{logger[_0xe9f0('0x2b')](_0xe9f0('0x24'),_0xcd2042,_0xe9f0('0x25'));_0x2ab12b(_0x232f2c[_0xe9f0('0x2c')][_0xe9f0('0x2a')]);}})['catch'](function(_0x371095){logger[_0xe9f0('0x29')](_0xe9f0('0x24'),_0xcd2042,_0x371095);_0x3da237(_0x371095);});});}function respondWithStatusCode(_0x1a8478,_0x4cf1b1){_0x4cf1b1=_0x4cf1b1||0xcc;return function(_0x212a38){if(_0x212a38){return _0x1a8478[_0xe9f0('0x2d')](_0x4cf1b1);}return _0x1a8478[_0xe9f0('0x2e')](_0x4cf1b1)[_0xe9f0('0x2f')]();};}function respondWithResult(_0x4335c6,_0x5457f6){_0x5457f6=_0x5457f6||0xc8;return function(_0x130f96){if(_0x130f96){return _0x4335c6[_0xe9f0('0x2e')](_0x5457f6)[_0xe9f0('0x30')](_0x130f96);}};}function respondWithFilteredResult(_0xab3d81,_0xa27c84){return function(_0xd19788){if(_0xd19788){var _0x1d788a=_0xd19788[_0xe9f0('0x31')],_0x2efd33=_0xa27c84[_0xe9f0('0x32')],_0x2b6503=_0xa27c84[_0xe9f0('0x32')]+_0xa27c84[_0xe9f0('0x33')],_0x3dbe49;if(_0x2b6503>=_0x1d788a){_0x2b6503=_0x1d788a;_0x3dbe49=0xc8;}else{_0x3dbe49=0xce;}_0xab3d81[_0xe9f0('0x2e')](_0x3dbe49);return _0xab3d81[_0xe9f0('0x34')](_0xe9f0('0x35'),_0x2efd33+'-'+_0x2b6503+'/'+_0x1d788a)[_0xe9f0('0x30')](_0xd19788);}return null;};}function patchUpdates(_0x2e7535){return function(_0x19d799){try{jsonpatch[_0xe9f0('0x36')](_0x19d799,_0x2e7535,!![]);}catch(_0x589803){return BPromise[_0xe9f0('0x37')](_0x589803);}return _0x19d799[_0xe9f0('0x38')]();};}function saveUpdates(_0x5480ce,_0x49996c){return function(_0x58d38b){if(_0x58d38b){return _0x58d38b[_0xe9f0('0x39')](_0x5480ce)['then'](function(_0x9bf61d){return _0x9bf61d;});}return null;};}function removeEntity(_0xc5fa13,_0x4d3bd6){return function(_0x285457){if(_0x285457){return _0x285457['destroy']()['then'](function(){_0xc5fa13['status'](0xcc)[_0xe9f0('0x2f')]();});}};}function handleEntityNotFound(_0x39722b,_0x5cd6ed){return function(_0x3becb9){if(!_0x3becb9){_0x39722b[_0xe9f0('0x2d')](0x194);}return _0x3becb9;};}function handleError(_0x1d4748,_0x4d4186){_0x4d4186=_0x4d4186||0x1f4;return function(_0x523fbc){logger[_0xe9f0('0x29')](_0x523fbc[_0xe9f0('0x3a')]);if(_0x523fbc[_0xe9f0('0x3b')]){delete _0x523fbc['name'];}_0x1d4748[_0xe9f0('0x2e')](_0x4d4186)[_0xe9f0('0x3c')](_0x523fbc);};}exports[_0xe9f0('0x3d')]=function(_0x2c53f1,_0x2b38de){var _0x552ec2={},_0x2ab492={},_0x3a2b23={'count':0x0,'rows':[]};var _0x2ede2=db['OpenchannelMessage'][_0xe9f0('0x3e')];_0x2ab492[_0xe9f0('0x3f')]=_['keys'](_0x2ede2);_0x2ab492[_0xe9f0('0x40')]=_['keys'](_0x2c53f1[_0xe9f0('0x40')]);_0x2ab492['filters']=_['intersection'](_0x2ab492['model'],_0x2ab492['query']);_0x552ec2['attributes']=_[_0xe9f0('0x41')](_0x2ab492[_0xe9f0('0x3f')],qs[_0xe9f0('0x42')](_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x42')]));_0x552ec2[_0xe9f0('0x43')]=_0x552ec2[_0xe9f0('0x43')][_0xe9f0('0x44')]?_0x552ec2[_0xe9f0('0x43')]:_0x2ab492['model'];if(!_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x45')](_0xe9f0('0x46'))){_0x552ec2['limit']=qs['limit'](_0x2c53f1[_0xe9f0('0x40')]['limit']);_0x552ec2[_0xe9f0('0x32')]=qs[_0xe9f0('0x32')](_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x32')]);}_0x552ec2['order']=qs[_0xe9f0('0x47')](_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x47')]);_0x552ec2[_0xe9f0('0x48')]=qs[_0xe9f0('0x49')](_['pick'](_0x2c53f1[_0xe9f0('0x40')],_0x2ab492[_0xe9f0('0x49')]));if(_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x4a')]){_0x552ec2[_0xe9f0('0x48')]=_['merge'](_0x552ec2[_0xe9f0('0x48')],{'$or':_['map'](_0x2ede2,function(_0x54e432){if(_0x54e432[_0xe9f0('0x4b')][_0xe9f0('0x4c')]!=='VIRTUAL'){var _0x10a360={};_0x10a360[_0x54e432[_0xe9f0('0x4d')]]={'$like':'%'+_0x2c53f1[_0xe9f0('0x40')][_0xe9f0('0x4a')]+'%'};return _0x10a360;}})});}_0x552ec2=_[_0xe9f0('0x4e')]({},_0x552ec2,_0x2c53f1[_0xe9f0('0x4f')]);var _0x15d529={'where':_0x552ec2['where']};return db[_0xe9f0('0x50')]['count'](_0x15d529)[_0xe9f0('0x23')](function(_0x5a3488){_0x3a2b23[_0xe9f0('0x31')]=_0x5a3488;if(_0x2c53f1['query'][_0xe9f0('0x51')]){_0x552ec2[_0xe9f0('0x52')]=[{'all':!![]}];}return db[_0xe9f0('0x50')]['findAll'](_0x552ec2);})[_0xe9f0('0x23')](function(_0xcf426d){_0x3a2b23[_0xe9f0('0x53')]=_0xcf426d;return _0x3a2b23;})[_0xe9f0('0x23')](respondWithFilteredResult(_0x2b38de,_0x552ec2))[_0xe9f0('0x54')](handleError(_0x2b38de,null));};exports[_0xe9f0('0x55')]=function(_0x6ece3f,_0x42ff7){var _0x18fc2b={'raw':!![],'where':{'id':_0x6ece3f[_0xe9f0('0x56')]['id']}},_0x13c4ad={};_0x13c4ad[_0xe9f0('0x3f')]=_['keys'](db['OpenchannelMessage'][_0xe9f0('0x3e')]);_0x13c4ad[_0xe9f0('0x40')]=_[_0xe9f0('0x57')](_0x6ece3f['query']);_0x13c4ad[_0xe9f0('0x49')]=_['intersection'](_0x13c4ad[_0xe9f0('0x3f')],_0x13c4ad[_0xe9f0('0x40')]);_0x18fc2b[_0xe9f0('0x43')]=_[_0xe9f0('0x41')](_0x13c4ad['model'],qs[_0xe9f0('0x42')](_0x6ece3f[_0xe9f0('0x40')]['fields']));_0x18fc2b[_0xe9f0('0x43')]=_0x18fc2b[_0xe9f0('0x43')][_0xe9f0('0x44')]?_0x18fc2b[_0xe9f0('0x43')]:_0x13c4ad['model'];if(_0x6ece3f[_0xe9f0('0x40')][_0xe9f0('0x51')]){_0x18fc2b[_0xe9f0('0x52')]=[{'all':!![]}];}_0x18fc2b=_[_0xe9f0('0x4e')]({},_0x18fc2b,_0x6ece3f[_0xe9f0('0x4f')]);return db[_0xe9f0('0x50')][_0xe9f0('0x58')](_0x18fc2b)[_0xe9f0('0x23')](handleEntityNotFound(_0x42ff7,null))['then'](respondWithResult(_0x42ff7,null))[_0xe9f0('0x54')](handleError(_0x42ff7,null));};exports[_0xe9f0('0x59')]=function(_0x465380,_0x4728e7){return db[_0xe9f0('0x50')][_0xe9f0('0x59')](_0x465380[_0xe9f0('0x5a')],{})[_0xe9f0('0x23')](respondWithResult(_0x4728e7,0xc9))[_0xe9f0('0x54')](handleError(_0x4728e7,null));};exports[_0xe9f0('0x39')]=function(_0x1df048,_0x3c26ac){if(_0x1df048[_0xe9f0('0x5a')]['id']){delete _0x1df048[_0xe9f0('0x5a')]['id'];}return db['OpenchannelMessage'][_0xe9f0('0x58')]({'where':{'id':_0x1df048[_0xe9f0('0x56')]['id']}})[_0xe9f0('0x23')](handleEntityNotFound(_0x3c26ac,null))['then'](saveUpdates(_0x1df048['body'],null))[_0xe9f0('0x23')](respondWithResult(_0x3c26ac,null))['catch'](handleError(_0x3c26ac,null));};exports[_0xe9f0('0x5b')]=function(_0x31deaf,_0x2b37ff){return db['OpenchannelMessage'][_0xe9f0('0x58')]({'where':{'id':_0x31deaf[_0xe9f0('0x56')]['id']}})[_0xe9f0('0x23')](handleEntityNotFound(_0x2b37ff,null))[_0xe9f0('0x23')](removeEntity(_0x2b37ff,null))['catch'](handleError(_0x2b37ff,null));};exports[_0xe9f0('0x5c')]=function(_0x3a05e7,_0x28a66e){return db[_0xe9f0('0x50')]['describe']()['then'](respondWithResult(_0x28a66e,null))[_0xe9f0('0x54')](handleError(_0x28a66e,null));};var interaction_log=require(_0xe9f0('0x15'))(_0xe9f0('0x5d'));exports[_0xe9f0('0x5e')]=function(_0x7cbe71,_0x4b680e,_0xbe2247){var _0x55ce2d={'channel':_0xe9f0('0x5f')};if(_0x7cbe71['body']['id']){delete _0x7cbe71[_0xe9f0('0x5a')]['id'];}_0x7cbe71[_0xe9f0('0x5a')][_0xe9f0('0x60')]=!![];_0x7cbe71[_0xe9f0('0x5a')][_0xe9f0('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7cbe71['body'][_0xe9f0('0x62')]=_0x7cbe71[_0xe9f0('0x5a')]['UserId']||_0x7cbe71[_0xe9f0('0x63')]['id'];return db['OpenchannelMessage']['find']({'where':{'id':_0x7cbe71[_0xe9f0('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xe9f0('0x64')],'as':_0xe9f0('0x65')}]})[_0xe9f0('0x23')](handleEntityNotFound(_0x4b680e,null))[_0xe9f0('0x23')](saveUpdates(_0x7cbe71[_0xe9f0('0x5a')],null))['then'](function(_0x5e4ad4){if(_0x5e4ad4){_0x55ce2d[_0xe9f0('0x2a')]=_0x5e4ad4[_0xe9f0('0x66')]({'plain':!![]});return db[_0xe9f0('0x67')][_0xe9f0('0x58')]({'where':{'id':_0x5e4ad4['OpenchannelInteractionId']}});}return null;})[_0xe9f0('0x23')](handleEntityNotFound(_0x4b680e,null))[_0xe9f0('0x23')](function(_0x22b44a){if(_0x22b44a){return _0x22b44a[_0xe9f0('0x39')]({'UserId':_0x7cbe71[_0xe9f0('0x5a')][_0xe9f0('0x62')],'read1stAt':_['isNil'](_0x22b44a[_0xe9f0('0x68')])?moment()[_0xe9f0('0x69')](_0xe9f0('0x6a')):undefined});}return null;})[_0xe9f0('0x23')](function(_0xb6e75d){if(_0xb6e75d){_0x55ce2d['interaction']=_0xb6e75d[_0xe9f0('0x66')]({'plain':!![]});interaction_log[_0xe9f0('0x2b')](_0xe9f0('0x6b'),_0x7cbe71[_0xe9f0('0x63')]['id'],_0x7cbe71[_0xe9f0('0x63')][_0xe9f0('0x3b')],_0x7cbe71[_0xe9f0('0x63')][_0xe9f0('0x6c')],_0x55ce2d[_0xe9f0('0x6d')]['id'],_0x7cbe71[_0xe9f0('0x5a')]?JSON[_0xe9f0('0x28')](_0x7cbe71[_0xe9f0('0x5a')]):'null');return respondWithRpcPromise(_0xe9f0('0x6e'),_0xe9f0('0x6f'),_0x55ce2d);}return null;})[_0xe9f0('0x23')](function(_0x116ec5){if(_0x116ec5){if(_0x7cbe71[_0xe9f0('0x5a')][_0xe9f0('0x70')]){_0x55ce2d[_0xe9f0('0x2a')]['interface']=util[_0xe9f0('0x69')](_0xe9f0('0x71'),_0x7cbe71['user'][_0xe9f0('0x3b')]);_0x55ce2d[_0xe9f0('0x2a')][_0xe9f0('0x72')]=_0x55ce2d['channel'];_0x55ce2d[_0xe9f0('0x2a')][_0xe9f0('0x73')]='accept';return respondWithRpcPromise(_0xe9f0('0x74'),_0xe9f0('0x74'),{'event':'acceptmessage','message':_0x55ce2d['message']},client9002)[_0xe9f0('0x23')](function(){return _0x55ce2d;});}return _0x55ce2d;}return null;})['then'](respondWithResult(_0x4b680e,null))[_0xe9f0('0x54')](handleError(_0x4b680e,null));};var interaction_log=require(_0xe9f0('0x15'))('openchannel-interactions');exports[_0xe9f0('0x37')]=function(_0x155f71,_0x3305b8,_0x300fae){var _0x161ee4={'agent':{},'channel':_0xe9f0('0x5f')};if(_0x155f71[_0xe9f0('0x5a')]['id']){delete _0x155f71[_0xe9f0('0x5a')]['id'];}_0x155f71[_0xe9f0('0x5a')]['UserId']=_0x155f71[_0xe9f0('0x5a')][_0xe9f0('0x62')]||_0x155f71[_0xe9f0('0x63')]['id'];_0x161ee4[_0xe9f0('0x75')]['id']=_0x155f71[_0xe9f0('0x5a')][_0xe9f0('0x62')];return db[_0xe9f0('0x50')][_0xe9f0('0x58')]({'where':{'id':_0x155f71['params']['id'],'UserId':null}})[_0xe9f0('0x23')](handleEntityNotFound(_0x3305b8,null))[_0xe9f0('0x23')](function(_0x2ce60c){if(_0x2ce60c){_0x161ee4[_0xe9f0('0x2a')]=_0x2ce60c[_0xe9f0('0x66')]({'plain':!![]});return db[_0xe9f0('0x67')]['find']({'where':{'id':_0x2ce60c[_0xe9f0('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x3305b8,null))['then'](function(_0x5ca5e5){if(_0x5ca5e5){_0x161ee4[_0xe9f0('0x6d')]=_0x5ca5e5[_0xe9f0('0x66')]({'plain':!![]});interaction_log[_0xe9f0('0x2b')](_0xe9f0('0x77'),_0x155f71[_0xe9f0('0x63')]['id'],_0x155f71[_0xe9f0('0x63')][_0xe9f0('0x3b')],_0x155f71[_0xe9f0('0x63')][_0xe9f0('0x6c')],_0x161ee4['interaction']['id'],_0x155f71[_0xe9f0('0x5a')]?JSON[_0xe9f0('0x28')](_0x155f71[_0xe9f0('0x5a')]):_0xe9f0('0x78'));return respondWithRpcPromise(_0xe9f0('0x79'),_0xe9f0('0x7a'),_0x161ee4);}return null;})[_0xe9f0('0x23')](function(_0x4743df){if(_0x4743df){_0x4743df[_0xe9f0('0x2a')][_0xe9f0('0x7b')]=util['format']('SIP/%s',_0x155f71[_0xe9f0('0x63')][_0xe9f0('0x3b')]);_0x4743df[_0xe9f0('0x2a')][_0xe9f0('0x72')]=_0x161ee4[_0xe9f0('0x72')];_0x4743df[_0xe9f0('0x2a')][_0xe9f0('0x73')]=_0xe9f0('0x37');respondWithRpcPromise('EventManager','EventManager',{'event':_0xe9f0('0x7c'),'message':_0x4743df[_0xe9f0('0x2a')]},client9002);return _0x161ee4;}return null;})['then'](respondWithResult(_0x3305b8,null))['catch'](handleError(_0x3305b8,null));}; \ No newline at end of file +var _0x896e=['acceptmessage','openchannel-interactions','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','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','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','status','count','offset','limit','json','apply','reject','update','destroy','name','send','OpenchannelMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','key','VIRTUAL','field','include','findAll','rows','show','params','options','find','create','body','describe','../../config/logger','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','UserId','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','interface','channel','event','EventManager'];(function(_0x3ef1c3,_0x34dbfd){var _0x84cf9c=function(_0xfebace){while(--_0xfebace){_0x3ef1c3['push'](_0x3ef1c3['shift']());}};_0x84cf9c(++_0x34dbfd);}(_0x896e,0x1e9));var _0xe896=function(_0xa5176b,_0x24e36d){_0xa5176b=_0xa5176b-0x0;var _0xc9582e=_0x896e[_0xa5176b];return _0xc9582e;};'use strict';var pdf=require(_0xe896('0x0'));var emlformat=require(_0xe896('0x1'));var rimraf=require(_0xe896('0x2'));var zipdir=require(_0xe896('0x3'));var jsonpatch=require(_0xe896('0x4'));var rp=require(_0xe896('0x5'));var moment=require(_0xe896('0x6'));var BPromise=require(_0xe896('0x7'));var Mustache=require(_0xe896('0x8'));var util=require(_0xe896('0x9'));var path=require(_0xe896('0xa'));var sox=require(_0xe896('0xb'));var csv=require('to-csv');var ejs=require(_0xe896('0xc'));var fs=require('fs');var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0x11'));var querystring=require(_0xe896('0x12'));var Papa=require(_0xe896('0x13'));var Redis=require('ioredis');var authService=require(_0xe896('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe896('0x15'));var logger=require('../../config/logger')(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require(_0xe896('0x18'));var db=require('../../mysqldb')['db'];config[_0xe896('0x19')]=_[_0xe896('0x1a')](config[_0xe896('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe896('0x1b'))(new Redis(config[_0xe896('0x19')]));require(_0xe896('0x1c'))['register'](socket);var jayson=require(_0xe896('0x1d'));var client=jayson[_0xe896('0x1e')][_0xe896('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x446ce2,_0x25606b,_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e78d6[_0xe896('0x20')](_0x25606b)){return _0x446ce2;}else{throw new Error(_0xe896('0x21'));}}else{return _0x446ce2;}}function respondWithRpcPromise(_0x57f04b,_0x50d224,_0x4e062a,_0x41cbd7){return new BPromise(function(_0x32f86d,_0x2d4cf0){var _0x5dc89d=_0x41cbd7||client;return _0x5dc89d[_0xe896('0x22')](_0x57f04b,_0x4e062a)[_0xe896('0x23')](function(_0xdcdba8){logger[_0xe896('0x24')](_0xe896('0x25'),_0x50d224,_0xe896('0x26'));logger[_0xe896('0x27')](_0xe896('0x28'),_0x50d224,'request\x20sent',JSON[_0xe896('0x29')](_0xdcdba8));if(_0xdcdba8['error']){if(_0xdcdba8['error'][_0xe896('0x2a')]===0x1f4){logger[_0xe896('0x2b')](_0xe896('0x25'),_0x50d224,_0xdcdba8[_0xe896('0x2b')]['message']);return _0x2d4cf0(_0xdcdba8[_0xe896('0x2b')]['message']);}logger['error'](_0xe896('0x25'),_0x50d224,_0xdcdba8[_0xe896('0x2b')][_0xe896('0x2c')]);return _0x32f86d(_0xdcdba8[_0xe896('0x2b')][_0xe896('0x2c')]);}else{logger[_0xe896('0x24')](_0xe896('0x25'),_0x50d224,'request\x20sent');_0x32f86d(_0xdcdba8[_0xe896('0x2d')][_0xe896('0x2c')]);}})[_0xe896('0x2e')](function(_0x569d5f){logger[_0xe896('0x2b')](_0xe896('0x25'),_0x50d224,_0x569d5f);_0x2d4cf0(_0x569d5f);});});}function respondWithStatusCode(_0x2bc11d,_0xe93aa0){_0xe93aa0=_0xe93aa0||0xcc;return function(_0x2d8a7b){if(_0x2d8a7b){return _0x2bc11d[_0xe896('0x2f')](_0xe93aa0);}return _0x2bc11d['status'](_0xe93aa0)[_0xe896('0x30')]();};}function respondWithResult(_0x34ccfd,_0x201653){_0x201653=_0x201653||0xc8;return function(_0xbfb15b){if(_0xbfb15b){return _0x34ccfd[_0xe896('0x31')](_0x201653)['json'](_0xbfb15b);}};}function respondWithFilteredResult(_0x47c268,_0x5c7dae){return function(_0x504d7c){if(_0x504d7c){var _0x562ddd=_0x504d7c[_0xe896('0x32')],_0x291290=_0x5c7dae[_0xe896('0x33')],_0x29a18e=_0x5c7dae[_0xe896('0x33')]+_0x5c7dae[_0xe896('0x34')],_0x10fd26;if(_0x29a18e>=_0x562ddd){_0x29a18e=_0x562ddd;_0x10fd26=0xc8;}else{_0x10fd26=0xce;}_0x47c268[_0xe896('0x31')](_0x10fd26);return _0x47c268['set']('Content-Range',_0x291290+'-'+_0x29a18e+'/'+_0x562ddd)[_0xe896('0x35')](_0x504d7c);}return null;};}function patchUpdates(_0x255dd1){return function(_0x29be89){try{jsonpatch[_0xe896('0x36')](_0x29be89,_0x255dd1,!![]);}catch(_0x4ddeb6){return BPromise[_0xe896('0x37')](_0x4ddeb6);}return _0x29be89['save']();};}function saveUpdates(_0x57c6e8,_0x166b86){return function(_0x363fd8){if(_0x363fd8){return _0x363fd8[_0xe896('0x38')](_0x57c6e8)['then'](function(_0x4d8092){return _0x4d8092;});}return null;};}function removeEntity(_0x567589,_0x46c8ae){return function(_0x1493b8){if(_0x1493b8){return _0x1493b8[_0xe896('0x39')]()[_0xe896('0x23')](function(){_0x567589[_0xe896('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a712,_0x394257){return function(_0x39cbe6){if(!_0x39cbe6){_0x19a712[_0xe896('0x2f')](0x194);}return _0x39cbe6;};}function handleError(_0x1366d0,_0x2cce09){_0x2cce09=_0x2cce09||0x1f4;return function(_0x3aeccc){logger[_0xe896('0x2b')](_0x3aeccc['stack']);if(_0x3aeccc[_0xe896('0x3a')]){delete _0x3aeccc[_0xe896('0x3a')];}_0x1366d0['status'](_0x2cce09)[_0xe896('0x3b')](_0x3aeccc);};}exports['index']=function(_0x43ecc4,_0x4f164f){var _0x42f445={},_0x5ba71e={},_0x2ab7a6={'count':0x0,'rows':[]};var _0x470c29=db[_0xe896('0x3c')][_0xe896('0x3d')];_0x5ba71e[_0xe896('0x3e')]=_['keys'](_0x470c29);_0x5ba71e['query']=_[_0xe896('0x3f')](_0x43ecc4[_0xe896('0x40')]);_0x5ba71e[_0xe896('0x41')]=_[_0xe896('0x42')](_0x5ba71e[_0xe896('0x3e')],_0x5ba71e['query']);_0x42f445['attributes']=_[_0xe896('0x42')](_0x5ba71e[_0xe896('0x3e')],qs['fields'](_0x43ecc4['query'][_0xe896('0x43')]));_0x42f445[_0xe896('0x44')]=_0x42f445[_0xe896('0x44')][_0xe896('0x45')]?_0x42f445[_0xe896('0x44')]:_0x5ba71e[_0xe896('0x3e')];if(!_0x43ecc4[_0xe896('0x40')][_0xe896('0x46')](_0xe896('0x47'))){_0x42f445[_0xe896('0x34')]=qs[_0xe896('0x34')](_0x43ecc4[_0xe896('0x40')]['limit']);_0x42f445[_0xe896('0x33')]=qs[_0xe896('0x33')](_0x43ecc4['query']['offset']);}_0x42f445['order']=qs[_0xe896('0x48')](_0x43ecc4[_0xe896('0x40')][_0xe896('0x48')]);_0x42f445['where']=qs[_0xe896('0x41')](_[_0xe896('0x49')](_0x43ecc4['query'],_0x5ba71e['filters']));if(_0x43ecc4['query'][_0xe896('0x4a')]){_0x42f445[_0xe896('0x4b')]=_[_0xe896('0x4c')](_0x42f445[_0xe896('0x4b')],{'$or':_[_0xe896('0x4d')](_0x470c29,function(_0x2ae833){if(_0x2ae833['type'][_0xe896('0x4e')]!==_0xe896('0x4f')){var _0x5310ff={};_0x5310ff[_0x2ae833[_0xe896('0x50')]]={'$like':'%'+_0x43ecc4[_0xe896('0x40')][_0xe896('0x4a')]+'%'};return _0x5310ff;}})});}_0x42f445=_[_0xe896('0x4c')]({},_0x42f445,_0x43ecc4['options']);var _0xb5811c={'where':_0x42f445[_0xe896('0x4b')]};return db[_0xe896('0x3c')][_0xe896('0x32')](_0xb5811c)[_0xe896('0x23')](function(_0xc6829e){_0x2ab7a6['count']=_0xc6829e;if(_0x43ecc4[_0xe896('0x40')]['includeAll']){_0x42f445[_0xe896('0x51')]=[{'all':!![]}];}return db[_0xe896('0x3c')][_0xe896('0x52')](_0x42f445);})[_0xe896('0x23')](function(_0x252c27){_0x2ab7a6[_0xe896('0x53')]=_0x252c27;return _0x2ab7a6;})['then'](respondWithFilteredResult(_0x4f164f,_0x42f445))[_0xe896('0x2e')](handleError(_0x4f164f,null));};exports[_0xe896('0x54')]=function(_0x4818cd,_0x3373dc){var _0x355443={'raw':!![],'where':{'id':_0x4818cd[_0xe896('0x55')]['id']}},_0x4d0047={};_0x4d0047['model']=_[_0xe896('0x3f')](db[_0xe896('0x3c')][_0xe896('0x3d')]);_0x4d0047[_0xe896('0x40')]=_[_0xe896('0x3f')](_0x4818cd['query']);_0x4d0047[_0xe896('0x41')]=_[_0xe896('0x42')](_0x4d0047[_0xe896('0x3e')],_0x4d0047['query']);_0x355443[_0xe896('0x44')]=_['intersection'](_0x4d0047['model'],qs[_0xe896('0x43')](_0x4818cd[_0xe896('0x40')]['fields']));_0x355443[_0xe896('0x44')]=_0x355443[_0xe896('0x44')]['length']?_0x355443['attributes']:_0x4d0047[_0xe896('0x3e')];if(_0x4818cd[_0xe896('0x40')]['includeAll']){_0x355443[_0xe896('0x51')]=[{'all':!![]}];}_0x355443=_[_0xe896('0x4c')]({},_0x355443,_0x4818cd[_0xe896('0x56')]);return db[_0xe896('0x3c')][_0xe896('0x57')](_0x355443)[_0xe896('0x23')](handleEntityNotFound(_0x3373dc,null))[_0xe896('0x23')](respondWithResult(_0x3373dc,null))[_0xe896('0x2e')](handleError(_0x3373dc,null));};exports[_0xe896('0x58')]=function(_0x3837e7,_0x357302){return db['OpenchannelMessage'][_0xe896('0x58')](_0x3837e7[_0xe896('0x59')],{})[_0xe896('0x23')](respondWithResult(_0x357302,0xc9))[_0xe896('0x2e')](handleError(_0x357302,null));};exports[_0xe896('0x38')]=function(_0x235a2a,_0x157946){if(_0x235a2a[_0xe896('0x59')]['id']){delete _0x235a2a[_0xe896('0x59')]['id'];}return db[_0xe896('0x3c')][_0xe896('0x57')]({'where':{'id':_0x235a2a[_0xe896('0x55')]['id']}})['then'](handleEntityNotFound(_0x157946,null))[_0xe896('0x23')](saveUpdates(_0x235a2a[_0xe896('0x59')],null))[_0xe896('0x23')](respondWithResult(_0x157946,null))['catch'](handleError(_0x157946,null));};exports['destroy']=function(_0x4bf8d6,_0x20f199){return db[_0xe896('0x3c')][_0xe896('0x57')]({'where':{'id':_0x4bf8d6[_0xe896('0x55')]['id']}})['then'](handleEntityNotFound(_0x20f199,null))[_0xe896('0x23')](removeEntity(_0x20f199,null))[_0xe896('0x2e')](handleError(_0x20f199,null));};exports[_0xe896('0x5a')]=function(_0x3c893a,_0x5d6c1c){return db[_0xe896('0x3c')][_0xe896('0x5a')]()['then'](respondWithResult(_0x5d6c1c,null))[_0xe896('0x2e')](handleError(_0x5d6c1c,null));};var interaction_log=require(_0xe896('0x5b'))('openchannel-interactions');exports['accept']=function(_0x2a5e68,_0x1890dc,_0x313da7){var _0x11291a={'channel':_0xe896('0x5c')};if(_0x2a5e68['body']['id']){delete _0x2a5e68[_0xe896('0x59')]['id'];}_0x2a5e68[_0xe896('0x59')][_0xe896('0x5d')]=!![];_0x2a5e68[_0xe896('0x59')]['readAt']=moment()['format'](_0xe896('0x5e'));_0x2a5e68[_0xe896('0x59')]['UserId']=_0x2a5e68[_0xe896('0x59')]['UserId']||_0x2a5e68[_0xe896('0x5f')]['id'];return db[_0xe896('0x3c')][_0xe896('0x57')]({'where':{'id':_0x2a5e68[_0xe896('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xe896('0x60')],'as':_0xe896('0x61')}]})[_0xe896('0x23')](handleEntityNotFound(_0x1890dc,null))[_0xe896('0x23')](saveUpdates(_0x2a5e68[_0xe896('0x59')],null))[_0xe896('0x23')](function(_0xcb329a){if(_0xcb329a){_0x11291a[_0xe896('0x2c')]=_0xcb329a[_0xe896('0x62')]({'plain':!![]});return db[_0xe896('0x63')][_0xe896('0x57')]({'where':{'id':_0xcb329a[_0xe896('0x64')]}});}return null;})[_0xe896('0x23')](handleEntityNotFound(_0x1890dc,null))[_0xe896('0x23')](function(_0x27d90d){if(_0x27d90d){return _0x27d90d[_0xe896('0x38')]({'UserId':_0x2a5e68[_0xe896('0x59')][_0xe896('0x65')],'read1stAt':_['isNil'](_0x27d90d['read1stAt'])?moment()[_0xe896('0x66')](_0xe896('0x5e')):undefined});}return null;})['then'](function(_0x1165ad){if(_0x1165ad){_0x11291a[_0xe896('0x67')]=_0x1165ad[_0xe896('0x62')]({'plain':!![]});interaction_log[_0xe896('0x24')](_0xe896('0x68'),_0x2a5e68[_0xe896('0x5f')]['id'],_0x2a5e68[_0xe896('0x5f')][_0xe896('0x3a')],_0x2a5e68[_0xe896('0x5f')][_0xe896('0x69')],_0x11291a[_0xe896('0x67')]['id'],_0x2a5e68['body']?JSON[_0xe896('0x29')](_0x2a5e68[_0xe896('0x59')]):'null');return respondWithRpcPromise(_0xe896('0x6a'),'acceptMessage',_0x11291a);}return null;})['then'](function(_0x1f3e10){if(_0x1f3e10){if(_0x2a5e68[_0xe896('0x59')]['manual']){_0x11291a['message'][_0xe896('0x6b')]=util['format']('SIP/%s',_0x2a5e68[_0xe896('0x5f')][_0xe896('0x3a')]);_0x11291a[_0xe896('0x2c')]['channel']=_0x11291a[_0xe896('0x6c')];_0x11291a[_0xe896('0x2c')][_0xe896('0x6d')]='accept';return respondWithRpcPromise(_0xe896('0x6e'),_0xe896('0x6e'),{'event':_0xe896('0x6f'),'message':_0x11291a[_0xe896('0x2c')]},client9002)['then'](function(){return _0x11291a;});}return _0x11291a;}return null;})[_0xe896('0x23')](respondWithResult(_0x1890dc,null))[_0xe896('0x2e')](handleError(_0x1890dc,null));};var interaction_log=require(_0xe896('0x5b'))(_0xe896('0x70'));exports['reject']=function(_0xebd9e2,_0x34bbf8,_0x4c5091){var _0x2d910b={'agent':{},'channel':_0xe896('0x5c')};if(_0xebd9e2[_0xe896('0x59')]['id']){delete _0xebd9e2[_0xe896('0x59')]['id'];}_0xebd9e2['body'][_0xe896('0x65')]=_0xebd9e2[_0xe896('0x59')][_0xe896('0x65')]||_0xebd9e2[_0xe896('0x5f')]['id'];_0x2d910b[_0xe896('0x71')]['id']=_0xebd9e2[_0xe896('0x59')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0xebd9e2[_0xe896('0x55')]['id'],'UserId':null}})[_0xe896('0x23')](handleEntityNotFound(_0x34bbf8,null))[_0xe896('0x23')](function(_0x270121){if(_0x270121){_0x2d910b[_0xe896('0x2c')]=_0x270121[_0xe896('0x62')]({'plain':!![]});return db[_0xe896('0x63')]['find']({'where':{'id':_0x270121['OpenchannelInteractionId']}});}return null;})[_0xe896('0x23')](handleEntityNotFound(_0x34bbf8,null))['then'](function(_0x36bde7){if(_0x36bde7){_0x2d910b['interaction']=_0x36bde7[_0xe896('0x62')]({'plain':!![]});interaction_log['info'](_0xe896('0x72'),_0xebd9e2[_0xe896('0x5f')]['id'],_0xebd9e2[_0xe896('0x5f')][_0xe896('0x3a')],_0xebd9e2[_0xe896('0x5f')]['role'],_0x2d910b[_0xe896('0x67')]['id'],_0xebd9e2[_0xe896('0x59')]?JSON[_0xe896('0x29')](_0xebd9e2[_0xe896('0x59')]):_0xe896('0x73'));return respondWithRpcPromise(_0xe896('0x74'),_0xe896('0x75'),_0x2d910b);}return null;})['then'](function(_0x357fee){if(_0x357fee){_0x357fee['message'][_0xe896('0x6b')]=util[_0xe896('0x66')](_0xe896('0x76'),_0xebd9e2['user'][_0xe896('0x3a')]);_0x357fee[_0xe896('0x2c')][_0xe896('0x6c')]=_0x2d910b[_0xe896('0x6c')];_0x357fee[_0xe896('0x2c')][_0xe896('0x6d')]=_0xe896('0x37');respondWithRpcPromise(_0xe896('0x6e'),_0xe896('0x6e'),{'event':_0xe896('0x77'),'message':_0x357fee[_0xe896('0x2c')]},client9002);return _0x2d910b;}return null;})['then'](respondWithResult(_0x34bbf8,null))[_0xe896('0x2e')](handleError(_0x34bbf8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 0bc3e0f..25debf8 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 _0xc98b=['hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5b6c71,_0x1fcf9c){var _0x12ce52=function(_0x1fa2d5){while(--_0x1fa2d5){_0x5b6c71['push'](_0x5b6c71['shift']());}};_0x12ce52(++_0x1fcf9c);}(_0xc98b,0x89));var _0xbc98=function(_0x314333,_0x9049dc){_0x314333=_0x314333-0x0;var _0x4f82cf=_0xc98b[_0x314333];return _0x4f82cf;};'use strict';var EventEmitter=require(_0xbc98('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xbc98('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbc98('0x2')](0x0);var events={'afterCreate':_0xbc98('0x3'),'afterUpdate':_0xbc98('0x4'),'afterDestroy':_0xbc98('0x5')};function emitEvent(_0x5eb8af){return function(_0x313de7,_0x19edae,_0x4b3c2b){OpenchannelMessageEvents['emit'](_0x5eb8af+':'+_0x313de7['id'],_0x313de7);OpenchannelMessageEvents[_0xbc98('0x6')](_0x5eb8af,_0x313de7);_0x4b3c2b(null);};}for(var e in events){if(events[_0xbc98('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xbc98('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xc905=['hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','emit'];(function(_0x5d5263,_0x52355e){var _0x4902b2=function(_0x112b2f){while(--_0x112b2f){_0x5d5263['push'](_0x5d5263['shift']());}};_0x4902b2(++_0x52355e);}(_0xc905,0xb1));var _0x5c90=function(_0x22b0e5,_0x2a6daa){_0x22b0e5=_0x22b0e5-0x0;var _0x16e6d1=_0xc905[_0x22b0e5];return _0x16e6d1;};'use strict';var EventEmitter=require(_0x5c90('0x0'));var OpenchannelMessage=require(_0x5c90('0x1'))['db'][_0x5c90('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5c90('0x3')](0x0);var events={'afterCreate':_0x5c90('0x4'),'afterUpdate':_0x5c90('0x5'),'afterDestroy':'remove'};function emitEvent(_0x571234){return function(_0x431db1,_0x21c9a9,_0x25f995){OpenchannelMessageEvents[_0x5c90('0x6')](_0x571234+':'+_0x431db1['id'],_0x431db1);OpenchannelMessageEvents['emit'](_0x571234,_0x431db1);_0x25f995(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x5c90('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index acc9e05..195e20c 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 _0xf9d4=['replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','catch','error','describe','Interactions','OpenchannelInteractionId','CmContact','Contact','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf9d4,0x105));var _0x4f9d=function(_0x1f6a0a,_0x19264d){_0x1f6a0a=_0x1f6a0a-0x0;var _0x34f23f=_0xf9d4[_0x1f6a0a];return _0x34f23f;};'use strict';var _=require(_0x4f9d('0x0'));var util=require(_0x4f9d('0x1'));var logger=require(_0x4f9d('0x2'))(_0x4f9d('0x3'));var moment=require(_0x4f9d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f9d('0x5'));var rimraf=require(_0x4f9d('0x6'));var config=require(_0x4f9d('0x7'));var attributes=require(_0x4f9d('0x8'));module[_0x4f9d('0x9')]=function(_0x88338c,_0x5ef533){return _0x88338c['define'](_0x4f9d('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x4f9d('0xb'),'fields':[_0x4f9d('0xc')],'type':_0x4f9d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29c1a8,_0x35572b,_0xa0badf){var _0x81c45f=_0x88338c[_0x4f9d('0xe')];var _0x309443=_0x29c1a8[_0x4f9d('0xf')]({'plain':!![]});if(_0x309443['direction'][_0x4f9d('0x10')]()==='in'||_0x309443[_0x4f9d('0x11')][_0x4f9d('0x10')]()===_0x4f9d('0x12')&&!_0x309443[_0x4f9d('0x13')]&&!_[_0x4f9d('0x14')](_0x309443[_0x4f9d('0x15')])){_0x81c45f[_0x4f9d('0x16')][_0x4f9d('0x17')]({'where':{'id':_0x309443['OpenchannelInteractionId']}})[_0x4f9d('0x18')](function(_0x2ff520){if(_0x2ff520){_0x2ff520['update']({'lastMsgAt':_0x309443['createdAt'],'lastMsgDirection':_0x309443[_0x4f9d('0x11')][_0x4f9d('0x10')]()});}})[_0x4f9d('0x19')](function(_0x507b40){console[_0x4f9d('0x1a')](_0x507b40);});}if(_0x309443[_0x4f9d('0x11')]===_0x4f9d('0x12')&&!_0x309443[_0x4f9d('0x13')]){var _0x1095cd;_0x81c45f['CmContact'][_0x4f9d('0x1b')]()[_0x4f9d('0x18')](function(_0x1b8f21){return _0x81c45f['OpenchannelAccount']['find']({'where':{'id':_0x309443['OpenchannelAccountId']},'include':[{'model':_0x81c45f[_0x4f9d('0x16')],'as':_0x4f9d('0x1c'),'where':{'id':_0x309443[_0x4f9d('0x1d')]},'limit':0x1,'include':[{'model':_0x81c45f[_0x4f9d('0x1e')],'as':_0x4f9d('0x1f'),'attributes':_[_0x4f9d('0x20')](_0x1b8f21)}]}]});})[_0x4f9d('0x18')](function(_0x215e87){_0x1095cd=_0x215e87[_0x4f9d('0xf')]({'plain':!![]});if(_0x1095cd&&_0x1095cd[_0x4f9d('0x21')]){logger[_0x4f9d('0x22')](_0x4f9d('0x23'),_0x4f9d('0x24'),util[_0x4f9d('0x25')](_0x4f9d('0x26'),_0x309443['id'],_0x1095cd[_0x4f9d('0x21')]));if(_0x1095cd[_0x4f9d('0x1c')]&&_0x1095cd['Interactions']['length']){_0x309443['Interaction']=_[_0x4f9d('0x27')](_0x1095cd[_0x4f9d('0x1c')][0x0],_0x4f9d('0x1f'));_0x309443['Contact']=_0x1095cd['Interactions'][0x0][_0x4f9d('0x1f')];}var _0x35572b={'method':_0x4f9d('0x28'),'uri':encodeURI(_0x1095cd[_0x4f9d('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x35572b[_0x4f9d('0x29')]){case'GET':_0x35572b['qs']=_0x309443;break;case _0x4f9d('0x28'):_0x35572b[_0x4f9d('0xc')]=_0x309443;break;}return rp(_0x35572b)['then'](function(_0x22d2f3){logger[_0x4f9d('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f9d('0x24'),util['format'](_0x4f9d('0x2a'),_0x309443['id'],_0x1095cd[_0x4f9d('0x21')]));if(_0x22d2f3[_0x4f9d('0xc')][_0x4f9d('0x2b')]&&_0x22d2f3[_0x4f9d('0xc')]['threadId']!=_0x309443[_0x4f9d('0x2c')]['threadId']){return _0x81c45f[_0x4f9d('0x16')][_0x4f9d('0x2d')]({'threadId':_0x22d2f3[_0x4f9d('0xc')][_0x4f9d('0x2b')]},{'logging':!![],'where':{'id':_0x309443[_0x4f9d('0x2c')]['id']}});}else{return;}})[_0x4f9d('0x18')](function(){return _0x29c1a8[_0x4f9d('0x2d')]({'read':!![]});})[_0x4f9d('0x19')](function(_0x2d5a35){logger['error'](_0x4f9d('0x23'),_0x4f9d('0x24'),util[_0x4f9d('0x2e')](_0x2d5a35,{'showHidden':![],'depth':null}));_0xa0badf();});}else{_0xa0badf();}})[_0x4f9d('0x2f')](function(){_0xa0badf();});}else{_0xa0badf();}}},'charset':'utf8mb4','collate':_0x4f9d('0x30')});}; \ No newline at end of file +var _0x8dab=['Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','threadId','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','OpenchannelInteraction','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x38cda5,_0x47fa4f){var _0x3b0d06=function(_0x30728d){while(--_0x30728d){_0x38cda5['push'](_0x38cda5['shift']());}};_0x3b0d06(++_0x47fa4f);}(_0x8dab,0xd3));var _0xb8da=function(_0x808374,_0x17d548){_0x808374=_0x808374-0x0;var _0x4e09ad=_0x8dab[_0x808374];return _0x4e09ad;};'use strict';var _=require(_0xb8da('0x0'));var util=require(_0xb8da('0x1'));var logger=require('../../config/logger')(_0xb8da('0x2'));var moment=require(_0xb8da('0x3'));var BPromise=require(_0xb8da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8da('0x5'));var rimraf=require(_0xb8da('0x6'));var config=require(_0xb8da('0x7'));var attributes=require(_0xb8da('0x8'));module[_0xb8da('0x9')]=function(_0x587dc1,_0x39b670){return _0x587dc1[_0xb8da('0xa')](_0xb8da('0xb'),attributes,{'tableName':_0xb8da('0xc'),'paranoid':![],'indexes':[{'name':_0xb8da('0xd'),'fields':[_0xb8da('0xe')],'type':_0xb8da('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c4816,_0x228a1d,_0x7a0769){var _0x2a2786=_0x587dc1['models'];var _0x36a4a2=_0x2c4816[_0xb8da('0x10')]({'plain':!![]});if(_0x36a4a2[_0xb8da('0x11')][_0xb8da('0x12')]()==='in'||_0x36a4a2[_0xb8da('0x11')]['toLowerCase']()===_0xb8da('0x13')&&!_0x36a4a2[_0xb8da('0x14')]&&!_['isNil'](_0x36a4a2['UserId'])){_0x2a2786[_0xb8da('0x15')]['findOne']({'where':{'id':_0x36a4a2[_0xb8da('0x16')]}})[_0xb8da('0x17')](function(_0x5ca8a2){if(_0x5ca8a2){_0x5ca8a2['update']({'lastMsgAt':_0x36a4a2[_0xb8da('0x18')],'lastMsgDirection':_0x36a4a2[_0xb8da('0x11')]['toLowerCase']()});}})[_0xb8da('0x19')](function(_0x195e3d){console[_0xb8da('0x1a')](_0x195e3d);});}if(_0x36a4a2[_0xb8da('0x11')]===_0xb8da('0x13')&&!_0x36a4a2[_0xb8da('0x14')]){var _0x2cce10;_0x2a2786[_0xb8da('0x1b')]['describe']()[_0xb8da('0x17')](function(_0x32559c){return _0x2a2786[_0xb8da('0x1c')][_0xb8da('0x1d')]({'where':{'id':_0x36a4a2[_0xb8da('0x1e')]},'include':[{'model':_0x2a2786[_0xb8da('0x15')],'as':_0xb8da('0x1f'),'where':{'id':_0x36a4a2[_0xb8da('0x16')]},'limit':0x1,'include':[{'model':_0x2a2786['CmContact'],'as':_0xb8da('0x20'),'attributes':_[_0xb8da('0x21')](_0x32559c)}]}]});})[_0xb8da('0x17')](function(_0x9ace86){_0x2cce10=_0x9ace86[_0xb8da('0x10')]({'plain':!![]});if(_0x2cce10&&_0x2cce10[_0xb8da('0x22')]){logger[_0xb8da('0x23')](_0xb8da('0x24'),_0xb8da('0x25'),util[_0xb8da('0x26')](_0xb8da('0x27'),_0x36a4a2['id'],_0x2cce10[_0xb8da('0x22')]));if(_0x2cce10[_0xb8da('0x1f')]&&_0x2cce10['Interactions']['length']){_0x36a4a2[_0xb8da('0x28')]=_[_0xb8da('0x29')](_0x2cce10[_0xb8da('0x1f')][0x0],_0xb8da('0x20'));_0x36a4a2['Contact']=_0x2cce10['Interactions'][0x0][_0xb8da('0x20')];}var _0x228a1d={'method':_0xb8da('0x2a'),'uri':encodeURI(_0x2cce10[_0xb8da('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x228a1d[_0xb8da('0x2b')]){case _0xb8da('0x2c'):_0x228a1d['qs']=_0x36a4a2;break;case _0xb8da('0x2a'):_0x228a1d[_0xb8da('0xe')]=_0x36a4a2;break;}return rp(_0x228a1d)[_0xb8da('0x17')](function(_0x307ce5){logger[_0xb8da('0x23')](_0xb8da('0x24'),_0xb8da('0x25'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x36a4a2['id'],_0x2cce10['replyUri']));if(_0x307ce5[_0xb8da('0xe')]['threadId']&&_0x307ce5[_0xb8da('0xe')][_0xb8da('0x2d')]!=_0x36a4a2[_0xb8da('0x28')][_0xb8da('0x2d')]){return _0x2a2786[_0xb8da('0x15')][_0xb8da('0x2e')]({'threadId':_0x307ce5[_0xb8da('0xe')][_0xb8da('0x2d')]},{'logging':!![],'where':{'id':_0x36a4a2[_0xb8da('0x28')]['id']}});}else{return;}})[_0xb8da('0x17')](function(){return _0x2c4816[_0xb8da('0x2e')]({'read':!![]});})['catch'](function(_0x293ece){logger['error'](_0xb8da('0x24'),_0xb8da('0x25'),util[_0xb8da('0x2f')](_0x293ece,{'showHidden':![],'depth':null}));_0x7a0769();});}else{_0x7a0769();}})[_0xb8da('0x30')](function(){_0x7a0769();});}else{_0x7a0769();}}},'charset':'utf8mb4','collate':_0xb8da('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 67ea763..8e6af4a 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 _0x2a8e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','options','raw','lodash','moment'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x2a8e,0x191));var _0xe2a8=function(_0x1cc760,_0x39e78c){_0x1cc760=_0x1cc760-0x0;var _0x549d56=_0x2a8e[_0x1cc760];return _0x549d56;};'use strict';var _=require(_0xe2a8('0x0'));var util=require('util');var moment=require(_0xe2a8('0x1'));var BPromise=require(_0xe2a8('0x2'));var rs=require(_0xe2a8('0x3'));var fs=require('fs');var Redis=require(_0xe2a8('0x4'));var db=require(_0xe2a8('0x5'))['db'];var utils=require(_0xe2a8('0x6'));var logger=require(_0xe2a8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe2a8('0x8'));var client=jayson[_0xe2a8('0x9')][_0xe2a8('0xa')]({'port':0x232a});config[_0xe2a8('0xb')]=_[_0xe2a8('0xc')](config['redis'],{'host':_0xe2a8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2a8('0xb')]));require('./openchannelMessage.socket')[_0xe2a8('0xe')](socket);function respondWithRpcPromise(_0x347200,_0x374016,_0x3f4aa3){return new BPromise(function(_0x1db12c,_0x52c7c1){return client['request'](_0x347200,_0x3f4aa3)['then'](function(_0x5a5bf5){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x374016,_0xe2a8('0xf'));logger[_0xe2a8('0x10')](_0xe2a8('0x11'),_0x374016,_0xe2a8('0xf'),JSON[_0xe2a8('0x12')](_0x5a5bf5));if(_0x5a5bf5[_0xe2a8('0x13')]){if(_0x5a5bf5['error'][_0xe2a8('0x14')]===0x1f4){logger[_0xe2a8('0x13')](_0xe2a8('0x15'),_0x374016,_0x5a5bf5['error'][_0xe2a8('0x16')]);return _0x52c7c1(_0x5a5bf5[_0xe2a8('0x13')][_0xe2a8('0x16')]);}logger[_0xe2a8('0x13')](_0xe2a8('0x15'),_0x374016,_0x5a5bf5[_0xe2a8('0x13')][_0xe2a8('0x16')]);return _0x1db12c(_0x5a5bf5['error']['message']);}else{logger[_0xe2a8('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x374016,_0xe2a8('0xf'));_0x1db12c(_0x5a5bf5[_0xe2a8('0x18')][_0xe2a8('0x16')]);}})[_0xe2a8('0x19')](function(_0x59e492){logger[_0xe2a8('0x13')](_0xe2a8('0x15'),_0x374016,_0x59e492);_0x52c7c1(_0x59e492);});});}exports[_0xe2a8('0x1a')]=function(_0x19fd44){var _0x47fee9=this;return new Promise(function(_0xd286c7,_0x45afbe){return db[_0xe2a8('0x1b')][_0xe2a8('0x1c')](_0x19fd44['body'],{'raw':_0x19fd44[_0xe2a8('0x1d')]?_0x19fd44[_0xe2a8('0x1d')][_0xe2a8('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5cf955){logger[_0xe2a8('0x17')](_0xe2a8('0x1a'),_0x19fd44);logger[_0xe2a8('0x10')]('CreateOpenchannelMessage',_0x19fd44,JSON['stringify'](_0x5cf955));_0xd286c7(_0x5cf955);})[_0xe2a8('0x19')](function(_0x435e56){logger[_0xe2a8('0x13')](_0xe2a8('0x1a'),_0x435e56[_0xe2a8('0x16')],_0x19fd44);_0x45afbe(_0x47fee9[_0xe2a8('0x13')](0x1f4,_0x435e56[_0xe2a8('0x16')]));});});}; \ No newline at end of file +var _0x5be1=['options','raw','then','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create'];(function(_0x1a45b6,_0x12bddd){var _0x19eb37=function(_0x5871d8){while(--_0x5871d8){_0x1a45b6['push'](_0x1a45b6['shift']());}};_0x19eb37(++_0x12bddd);}(_0x5be1,0xb7));var _0x15be=function(_0x26d333,_0xfb87e0){_0x26d333=_0x26d333-0x0;var _0x2ba6cc=_0x5be1[_0x26d333];return _0x2ba6cc;};'use strict';var _=require(_0x15be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x15be('0x1'));var rs=require(_0x15be('0x2'));var fs=require('fs');var Redis=require(_0x15be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x15be('0x4'));var logger=require(_0x15be('0x5'))(_0x15be('0x6'));var config=require(_0x15be('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x15be('0x8')]=_[_0x15be('0x9')](config[_0x15be('0x8')],{'host':_0x15be('0xa'),'port':0x18eb});var socket=require(_0x15be('0xb'))(new Redis(config[_0x15be('0x8')]));require('./openchannelMessage.socket')[_0x15be('0xc')](socket);function respondWithRpcPromise(_0x2b8872,_0x171824,_0x45c5e4){return new BPromise(function(_0x58568a,_0x363e5f){return client['request'](_0x2b8872,_0x45c5e4)['then'](function(_0x386307){logger[_0x15be('0xd')](_0x15be('0xe'),_0x171824,_0x15be('0xf'));logger[_0x15be('0x10')](_0x15be('0x11'),_0x171824,_0x15be('0xf'),JSON[_0x15be('0x12')](_0x386307));if(_0x386307[_0x15be('0x13')]){if(_0x386307[_0x15be('0x13')][_0x15be('0x14')]===0x1f4){logger[_0x15be('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x171824,_0x386307[_0x15be('0x13')][_0x15be('0x15')]);return _0x363e5f(_0x386307[_0x15be('0x13')]['message']);}logger[_0x15be('0x13')](_0x15be('0xe'),_0x171824,_0x386307['error']['message']);return _0x58568a(_0x386307[_0x15be('0x13')]['message']);}else{logger['info'](_0x15be('0xe'),_0x171824,'request\x20sent');_0x58568a(_0x386307[_0x15be('0x16')][_0x15be('0x15')]);}})[_0x15be('0x17')](function(_0x6cb081){logger[_0x15be('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x171824,_0x6cb081);_0x363e5f(_0x6cb081);});});}exports[_0x15be('0x18')]=function(_0x4909f8){var _0x53178c=this;return new Promise(function(_0x297145,_0x596a5c){return db[_0x15be('0x19')][_0x15be('0x1a')](_0x4909f8['body'],{'raw':_0x4909f8[_0x15be('0x1b')]?_0x4909f8[_0x15be('0x1b')][_0x15be('0x1c')]===undefined?!![]:![]:!![]})[_0x15be('0x1d')](function(_0x2f8ef9){logger['info'](_0x15be('0x18'),_0x4909f8);logger[_0x15be('0x10')](_0x15be('0x18'),_0x4909f8,JSON[_0x15be('0x12')](_0x2f8ef9));_0x297145(_0x2f8ef9);})[_0x15be('0x17')](function(_0x296e00){logger[_0x15be('0x13')](_0x15be('0x18'),_0x296e00[_0x15be('0x15')],_0x4909f8);_0x596a5c(_0x53178c[_0x15be('0x13')](0x1f4,_0x296e00[_0x15be('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 741bb52..d3cbd5c 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 _0x106f=['save','update','removeListener','register','./openchannelMessage.events'];(function(_0x3585fb,_0x5df075){var _0x48fb79=function(_0x595516){while(--_0x595516){_0x3585fb['push'](_0x3585fb['shift']());}};_0x48fb79(++_0x5df075);}(_0x106f,0x162));var _0xf106=function(_0x18aef7,_0x1f65e7){_0x18aef7=_0x18aef7-0x0;var _0x5814f3=_0x106f[_0x18aef7];return _0x5814f3;};'use strict';var OpenchannelMessageEvents=require(_0xf106('0x0'));var events=[_0xf106('0x1'),'remove',_0xf106('0x2')];function createListener(_0x6d8236,_0x59bc3a){return function(_0x102554){_0x59bc3a['emit'](_0x6d8236,_0x102554);};}function removeListener(_0x1236af,_0x370f6a){return function(){OpenchannelMessageEvents[_0xf106('0x3')](_0x1236af,_0x370f6a);};}exports[_0xf106('0x4')]=function(_0x253f6d){for(var _0x282fd4=0x0,_0xc9588d=events['length'];_0x282fd4<_0xc9588d;_0x282fd4++){var _0x4ea3b8=events[_0x282fd4];var _0x3ac1bd=createListener('openchannelMessage:'+_0x4ea3b8,_0x253f6d);OpenchannelMessageEvents['on'](_0x4ea3b8,_0x3ac1bd);}}; \ No newline at end of file +var _0xca9e=['remove','update','emit','removeListener','register','length','./openchannelMessage.events','save'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0xca9e,0x136));var _0xeca9=function(_0x2febf1,_0x5d3588){_0x2febf1=_0x2febf1-0x0;var _0x1a5263=_0xca9e[_0x2febf1];return _0x1a5263;};'use strict';var OpenchannelMessageEvents=require(_0xeca9('0x0'));var events=[_0xeca9('0x1'),_0xeca9('0x2'),_0xeca9('0x3')];function createListener(_0x2df937,_0x1443e3){return function(_0x8dbabb){_0x1443e3[_0xeca9('0x4')](_0x2df937,_0x8dbabb);};}function removeListener(_0x1b2864,_0x1e0a18){return function(){OpenchannelMessageEvents[_0xeca9('0x5')](_0x1b2864,_0x1e0a18);};}exports[_0xeca9('0x6')]=function(_0x186a47){for(var _0x305dc5=0x0,_0x483e41=events[_0xeca9('0x7')];_0x305dc5<_0x483e41;_0x305dc5++){var _0x1774f3=events[_0x305dc5];var _0x4d57ee=createListener('openchannelMessage:'+_0x1774f3,_0x186a47);OpenchannelMessageEvents['on'](_0x1774f3,_0x4d57ee);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 51639c4..7a81d9f 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 _0x47b8=['/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','describe','/:id','show','/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams'];(function(_0x195e6a,_0x379e1c){var _0x4aeab4=function(_0x3318af){while(--_0x3318af){_0x195e6a['push'](_0x195e6a['shift']());}};_0x4aeab4(++_0x379e1c);}(_0x47b8,0x106));var _0x847b=function(_0x769c00,_0x51dfff){_0x769c00=_0x769c00-0x0;var _0x2df989=_0x47b8[_0x769c00];return _0x2df989;};'use strict';var multer=require(_0x847b('0x0'));var util=require(_0x847b('0x1'));var path=require('path');var timeout=require(_0x847b('0x2'));var express=require(_0x847b('0x3'));var router=express[_0x847b('0x4')]();var auth=require(_0x847b('0x5'));var interaction=require(_0x847b('0x6'));var config=require('../../config/environment');var controller=require(_0x847b('0x7'));router[_0x847b('0x8')]('/',auth['isAuthenticated'](),controller[_0x847b('0x9')]);router[_0x847b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x847b('0xa')]);router[_0x847b('0x8')](_0x847b('0xb'),auth['isAuthenticated'](),controller[_0x847b('0xc')]);router[_0x847b('0x8')](_0x847b('0xd'),auth[_0x847b('0xe')](),controller[_0x847b('0xf')]);router['get'](_0x847b('0x10'),auth[_0x847b('0xe')](),controller[_0x847b('0x11')]);router[_0x847b('0x8')](_0x847b('0x12'),auth['isAuthenticated'](),controller[_0x847b('0x13')]);router['post']('/',auth[_0x847b('0xe')](),controller[_0x847b('0x14')]);router[_0x847b('0x15')](_0x847b('0x10'),auth[_0x847b('0xe')](),controller[_0x847b('0x16')]);router[_0x847b('0x15')](_0x847b('0x12'),auth[_0x847b('0xe')](),controller[_0x847b('0x17')]);router[_0x847b('0x18')](_0x847b('0xb'),auth[_0x847b('0xe')](),controller['update']);router[_0x847b('0x19')]('/:id',auth[_0x847b('0xe')](),controller['destroy']);router[_0x847b('0x19')](_0x847b('0x10'),auth['isAuthenticated'](),controller[_0x847b('0x1a')]);router[_0x847b('0x19')](_0x847b('0x12'),auth[_0x847b('0xe')](),controller[_0x847b('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x33d2=['delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x81));var _0x233d=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0x33d2[_0x51b362];return _0x18bd6;};'use strict';var multer=require(_0x233d('0x0'));var util=require('util');var path=require(_0x233d('0x1'));var timeout=require(_0x233d('0x2'));var express=require(_0x233d('0x3'));var router=express[_0x233d('0x4')]();var auth=require(_0x233d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x233d('0x6'));var controller=require('./openchannelQueue.controller');router[_0x233d('0x7')]('/',auth[_0x233d('0x8')](),controller[_0x233d('0x9')]);router[_0x233d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x233d('0xa')]);router['get']('/:id',auth[_0x233d('0x8')](),controller[_0x233d('0xb')]);router[_0x233d('0x7')](_0x233d('0xc'),auth[_0x233d('0x8')](),controller[_0x233d('0xd')]);router['get'](_0x233d('0xe'),auth['isAuthenticated'](),controller[_0x233d('0xf')]);router[_0x233d('0x7')](_0x233d('0x10'),auth[_0x233d('0x8')](),controller[_0x233d('0x11')]);router[_0x233d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x233d('0x12')](_0x233d('0xe'),auth[_0x233d('0x8')](),controller[_0x233d('0x13')]);router[_0x233d('0x12')]('/:id/users',auth[_0x233d('0x8')](),controller['addAgents']);router['put'](_0x233d('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x233d('0x15')]('/:id',auth[_0x233d('0x8')](),controller[_0x233d('0x16')]);router[_0x233d('0x15')]('/:id/teams',auth[_0x233d('0x8')](),controller[_0x233d('0x17')]);router[_0x233d('0x15')]('/:id/users',auth[_0x233d('0x8')](),controller['removeAgents']);module[_0x233d('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 10a59f0..2c31cbd 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 _0x5398=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x5398,0x87));var _0x8539=function(_0x29e10d,_0x53cd7f){_0x29e10d=_0x29e10d-0x0;var _0x4a2218=_0x5398[_0x29e10d];return _0x4a2218;};'use strict';var Sequelize=require(_0x8539('0x0'));module[_0x8539('0x1')]={'name':{'type':Sequelize[_0x8539('0x2')],'unique':_0x8539('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8539('0x2')]},'timeout':{'type':Sequelize[_0x8539('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8539('0x5')](_0x8539('0x6'),_0x8539('0x7'),_0x8539('0x8'))}}; \ No newline at end of file +var _0xcea3=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcea3,0x114));var _0x3cea=function(_0x2082cf,_0x2e5cb2){_0x2082cf=_0x2082cf-0x0;var _0x5638eb=_0xcea3[_0x2082cf];return _0x5638eb;};'use strict';var Sequelize=require(_0x3cea('0x0'));module[_0x3cea('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3cea('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3cea('0x3')]},'timeout':{'type':Sequelize[_0x3cea('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3cea('0x5')](_0x3cea('0x6'),_0x3cea('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4f80b43..24e0cb0 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 _0x2651=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','openchannelPause','createdAt','getTeams','findOne','Team','pick','addTeams','teams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','union','compact','value','ids','emit','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','count','includeAll','rows','catch','show','options','find'];(function(_0x26d9ae,_0x419f79){var _0x48df97=function(_0x212031){while(--_0x212031){_0x26d9ae['push'](_0x26d9ae['shift']());}};_0x48df97(++_0x419f79);}(_0x2651,0xce));var _0x1265=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x2651[_0x166d93];return _0xba708;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1265('0x0'));var rimraf=require(_0x1265('0x1'));var zipdir=require(_0x1265('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1265('0x3'));var moment=require(_0x1265('0x4'));var BPromise=require(_0x1265('0x5'));var Mustache=require(_0x1265('0x6'));var util=require('util');var path=require(_0x1265('0x7'));var sox=require(_0x1265('0x8'));var csv=require(_0x1265('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1265('0xa'));var crypto=require(_0x1265('0xb'));var jsforce=require(_0x1265('0xc'));var deskjs=require(_0x1265('0xd'));var toCsv=require(_0x1265('0x9'));var querystring=require(_0x1265('0xe'));var Papa=require(_0x1265('0xf'));var Redis=require('ioredis');var authService=require(_0x1265('0x10'));var qs=require(_0x1265('0x11'));var hardwareService=require(_0x1265('0x12'));var logger=require(_0x1265('0x13'))(_0x1265('0x14'));var utils=require(_0x1265('0x15'));var config=require(_0x1265('0x16'));var db=require(_0x1265('0x17'))['db'];config[_0x1265('0x18')]=_['defaults'](config[_0x1265('0x18')],{'host':_0x1265('0x19'),'port':0x18eb});var socket=require(_0x1265('0x1a'))(new Redis(config[_0x1265('0x18')]));require(_0x1265('0x1b'))[_0x1265('0x1c')](socket);function respondWithStatusCode(_0x1e2ce4,_0x36dd30){_0x36dd30=_0x36dd30||0xcc;return function(_0x2ffb30){if(_0x2ffb30){return _0x1e2ce4[_0x1265('0x1d')](_0x36dd30);}return _0x1e2ce4[_0x1265('0x1e')](_0x36dd30)[_0x1265('0x1f')]();};}function respondWithResult(_0x86e194,_0x3b8051){_0x3b8051=_0x3b8051||0xc8;return function(_0x218af4){if(_0x218af4){return _0x86e194[_0x1265('0x1e')](_0x3b8051)[_0x1265('0x20')](_0x218af4);}};}function respondWithFilteredResult(_0x4edbe5,_0x485457){return function(_0x57a468){if(_0x57a468){var _0x3c12cc=_0x57a468['count'],_0x50504c=_0x485457[_0x1265('0x21')],_0x160004=_0x485457[_0x1265('0x21')]+_0x485457['limit'],_0x14d22f;if(_0x160004>=_0x3c12cc){_0x160004=_0x3c12cc;_0x14d22f=0xc8;}else{_0x14d22f=0xce;}_0x4edbe5[_0x1265('0x1e')](_0x14d22f);return _0x4edbe5[_0x1265('0x22')](_0x1265('0x23'),_0x50504c+'-'+_0x160004+'/'+_0x3c12cc)['json'](_0x57a468);}return null;};}function patchUpdates(_0x541d79){return function(_0x547235){try{jsonpatch['apply'](_0x547235,_0x541d79,!![]);}catch(_0x34bb63){return BPromise[_0x1265('0x24')](_0x34bb63);}return _0x547235[_0x1265('0x25')]();};}function saveUpdates(_0xe95c16,_0x572da6){return function(_0x4a3e6a){if(_0x4a3e6a){return _0x4a3e6a['update'](_0xe95c16)[_0x1265('0x26')](function(_0x149ec3){return _0x149ec3;});}return null;};}function removeEntity(_0x19c847,_0x5e67e0){return function(_0x3240ea){if(_0x3240ea){return _0x3240ea[_0x1265('0x27')]()['then'](function(){var _0x3d4aa6=_0x3240ea[_0x1265('0x28')]({'plain':!![]});var _0x5df5ab=_0x1265('0x29');return db[_0x1265('0x2a')]['destroy']({'where':{'type':_0x5df5ab,'resourceId':_0x3d4aa6['id']}})['then'](function(){return _0x3240ea;});})['then'](function(){_0x19c847[_0x1265('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2194b5,_0x49942a){return function(_0x39687d){if(!_0x39687d){_0x2194b5[_0x1265('0x1d')](0x194);}return _0x39687d;};}function handleError(_0x52b0b3,_0xa99953){_0xa99953=_0xa99953||0x1f4;return function(_0x293039){logger[_0x1265('0x2b')](_0x293039[_0x1265('0x2c')]);if(_0x293039[_0x1265('0x2d')]){delete _0x293039[_0x1265('0x2d')];}_0x52b0b3[_0x1265('0x1e')](_0xa99953)[_0x1265('0x2e')](_0x293039);};}exports[_0x1265('0x2f')]=function(_0x378ec6,_0x31a3c4){var _0x5d1673={},_0xc68354={},_0x34810f={'count':0x0,'rows':[]};var _0x264b69=db[_0x1265('0x30')][_0x1265('0x31')];_0xc68354[_0x1265('0x32')]=_[_0x1265('0x33')](_0x264b69);_0xc68354[_0x1265('0x34')]=_[_0x1265('0x33')](_0x378ec6[_0x1265('0x34')]);_0xc68354[_0x1265('0x35')]=_['intersection'](_0xc68354[_0x1265('0x32')],_0xc68354[_0x1265('0x34')]);_0x5d1673[_0x1265('0x36')]=_[_0x1265('0x37')](_0xc68354['model'],qs[_0x1265('0x38')](_0x378ec6[_0x1265('0x34')][_0x1265('0x38')]));_0x5d1673[_0x1265('0x36')]=_0x5d1673[_0x1265('0x36')][_0x1265('0x39')]?_0x5d1673[_0x1265('0x36')]:_0xc68354['model'];if(!_0x378ec6[_0x1265('0x34')]['hasOwnProperty'](_0x1265('0x3a'))){_0x5d1673[_0x1265('0x3b')]=qs['limit'](_0x378ec6[_0x1265('0x34')][_0x1265('0x3b')]);_0x5d1673[_0x1265('0x21')]=qs[_0x1265('0x21')](_0x378ec6[_0x1265('0x34')]['offset']);}_0x5d1673[_0x1265('0x3c')]=qs[_0x1265('0x3d')](_0x378ec6['query']['sort']);_0x5d1673[_0x1265('0x3e')]=qs[_0x1265('0x35')](_['pick'](_0x378ec6[_0x1265('0x34')],_0xc68354[_0x1265('0x35')]));if(_0x378ec6[_0x1265('0x34')][_0x1265('0x3f')]){_0x5d1673[_0x1265('0x3e')]=_[_0x1265('0x40')](_0x5d1673[_0x1265('0x3e')],{'$or':_[_0x1265('0x41')](_0x264b69,function(_0x5aaa4a){if(_0x5aaa4a[_0x1265('0x42')][_0x1265('0x43')]!==_0x1265('0x44')){var _0x15af31={};_0x15af31[_0x5aaa4a['field']]={'$like':'%'+_0x378ec6[_0x1265('0x34')][_0x1265('0x3f')]+'%'};return _0x15af31;}})});}_0x5d1673=_['merge']({},_0x5d1673,_0x378ec6['options']);var _0x35babf={'where':_0x5d1673[_0x1265('0x3e')]};return db[_0x1265('0x30')]['count'](_0x35babf)[_0x1265('0x26')](function(_0xd6eddd){_0x34810f[_0x1265('0x45')]=_0xd6eddd;if(_0x378ec6['query'][_0x1265('0x46')]){_0x5d1673['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x5d1673);})[_0x1265('0x26')](function(_0x3f2467){_0x34810f[_0x1265('0x47')]=_0x3f2467;return _0x34810f;})[_0x1265('0x26')](respondWithFilteredResult(_0x31a3c4,_0x5d1673))[_0x1265('0x48')](handleError(_0x31a3c4,null));};exports[_0x1265('0x49')]=function(_0xfc6a0e,_0x3cbb24){var _0x5d04ab={'raw':!![],'where':{'id':_0xfc6a0e['params']['id']}},_0x52f885={};_0x52f885[_0x1265('0x32')]=_[_0x1265('0x33')](db[_0x1265('0x30')][_0x1265('0x31')]);_0x52f885[_0x1265('0x34')]=_['keys'](_0xfc6a0e['query']);_0x52f885[_0x1265('0x35')]=_[_0x1265('0x37')](_0x52f885['model'],_0x52f885['query']);_0x5d04ab[_0x1265('0x36')]=_['intersection'](_0x52f885[_0x1265('0x32')],qs[_0x1265('0x38')](_0xfc6a0e[_0x1265('0x34')]['fields']));_0x5d04ab[_0x1265('0x36')]=_0x5d04ab['attributes'][_0x1265('0x39')]?_0x5d04ab['attributes']:_0x52f885['model'];if(_0xfc6a0e['query'][_0x1265('0x46')]){_0x5d04ab['include']=[{'all':!![]}];}_0x5d04ab=_[_0x1265('0x40')]({},_0x5d04ab,_0xfc6a0e[_0x1265('0x4a')]);return db['OpenchannelQueue'][_0x1265('0x4b')](_0x5d04ab)[_0x1265('0x26')](handleEntityNotFound(_0x3cbb24,null))[_0x1265('0x26')](respondWithResult(_0x3cbb24,null))['catch'](handleError(_0x3cbb24,null));};exports[_0x1265('0x4c')]=function(_0x2075ee,_0x4d3322){return db['OpenchannelQueue'][_0x1265('0x4c')](_0x2075ee[_0x1265('0x4d')],{})[_0x1265('0x26')](function(_0x1b3123){var _0xd7a499=_0x2075ee[_0x1265('0x4e')][_0x1265('0x28')]({'plain':!![]});if(!_0xd7a499)throw new Error(_0x1265('0x4f'));if(_0xd7a499[_0x1265('0x50')]===_0x1265('0x4e')){var _0x1ba585=_0x1b3123[_0x1265('0x28')]({'plain':!![]});var _0x5a9448=_0x1265('0x29');return db[_0x1265('0x51')][_0x1265('0x4b')]({'where':{'name':_0x5a9448,'userProfileId':_0xd7a499['userProfileId']},'raw':!![]})['then'](function(_0x5916e5){if(_0x5916e5&&_0x5916e5['autoAssociation']===0x0){return db[_0x1265('0x2a')][_0x1265('0x4c')]({'name':_0x1ba585['name'],'resourceId':_0x1ba585['id'],'type':_0x5916e5['name'],'sectionId':_0x5916e5['id']},{})[_0x1265('0x26')](function(){return _0x1b3123;});}else{return _0x1b3123;}})[_0x1265('0x48')](function(_0x27b946){logger[_0x1265('0x2b')](_0x1265('0x52'),_0x27b946);throw _0x27b946;});}return _0x1b3123;})['then'](respondWithResult(_0x4d3322,0xc9))[_0x1265('0x48')](handleError(_0x4d3322,null));};exports[_0x1265('0x53')]=function(_0x5cf8ad,_0x1b69e0){if(_0x5cf8ad[_0x1265('0x4d')]['id']){delete _0x5cf8ad[_0x1265('0x4d')]['id'];}return db[_0x1265('0x30')][_0x1265('0x4b')]({'where':{'id':_0x5cf8ad[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x1b69e0,null))[_0x1265('0x26')](saveUpdates(_0x5cf8ad[_0x1265('0x4d')],null))[_0x1265('0x26')](respondWithResult(_0x1b69e0,null))[_0x1265('0x48')](handleError(_0x1b69e0,null));};exports['destroy']=function(_0x1d7a71,_0x430e5c){return db[_0x1265('0x30')][_0x1265('0x4b')]({'where':{'id':_0x1d7a71[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x430e5c,null))[_0x1265('0x26')](removeEntity(_0x430e5c,null))[_0x1265('0x48')](handleError(_0x430e5c,null));};exports[_0x1265('0x55')]=function(_0x8bfca6,_0x4aaedf){return db['OpenchannelQueue'][_0x1265('0x55')]()[_0x1265('0x26')](respondWithResult(_0x4aaedf,null))[_0x1265('0x48')](handleError(_0x4aaedf,null));};exports[_0x1265('0x56')]=function(_0x46ca4e,_0x57c38e,_0x4001ef){var _0x4ad7d3={'raw':!![],'where':{}},_0x29f7c9={},_0x1b49cb;return db[_0x1265('0x30')]['findOne']({'where':{'id':_0x46ca4e[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x57c38e,null))[_0x1265('0x26')](function(_0x15658e){if(_0x15658e){_0x1b49cb=_0x15658e[_0x1265('0x28')]({'plain':!![]});_0x29f7c9[_0x1265('0x32')]=_[_0x1265('0x33')](db[_0x1265('0x57')]['rawAttributes']);_0x29f7c9[_0x1265('0x34')]=_[_0x1265('0x33')](_0x46ca4e[_0x1265('0x34')]);_0x29f7c9[_0x1265('0x35')]=_[_0x1265('0x37')](_0x29f7c9[_0x1265('0x32')],_0x29f7c9['query']);_0x4ad7d3[_0x1265('0x36')]=_[_0x1265('0x37')](_0x29f7c9[_0x1265('0x32')],qs[_0x1265('0x38')](_0x46ca4e[_0x1265('0x34')][_0x1265('0x38')]));_0x4ad7d3[_0x1265('0x36')]=_0x4ad7d3[_0x1265('0x36')]['length']?_0x4ad7d3[_0x1265('0x36')]:_0x29f7c9[_0x1265('0x32')];if(!_0x46ca4e[_0x1265('0x34')][_0x1265('0x58')](_0x1265('0x3a'))){_0x4ad7d3[_0x1265('0x3b')]=qs['limit'](_0x46ca4e[_0x1265('0x34')][_0x1265('0x3b')]);_0x4ad7d3[_0x1265('0x21')]=qs['offset'](_0x46ca4e['query'][_0x1265('0x21')]);}_0x4ad7d3[_0x1265('0x3c')]=qs[_0x1265('0x3d')](_0x46ca4e['query'][_0x1265('0x3d')]);_0x4ad7d3['where']=qs[_0x1265('0x35')](_['pick'](_0x46ca4e[_0x1265('0x34')],_0x29f7c9[_0x1265('0x35')]));_0x4ad7d3[_0x1265('0x3e')][_0x1265('0x59')]=_0x15658e['id'];if(_0x46ca4e[_0x1265('0x34')][_0x1265('0x3f')]){_0x4ad7d3['where']=_['merge'](_0x4ad7d3[_0x1265('0x3e')],{'$or':_[_0x1265('0x41')](_0x4ad7d3[_0x1265('0x36')],function(_0x48f883){var _0x57a3c7={};_0x57a3c7[_0x48f883]={'$like':'%'+_0x46ca4e['query'][_0x1265('0x3f')]+'%'};return _0x57a3c7;})});}_0x4ad7d3=_[_0x1265('0x40')]({},_0x4ad7d3,_0x46ca4e[_0x1265('0x4a')]);return db[_0x1265('0x57')][_0x1265('0x5a')](_0x4ad7d3);}})[_0x1265('0x26')](function(_0x5ade14){if(_0x5ade14){return db[_0x1265('0x5b')][_0x1265('0x5c')]({'where':{'id':_[_0x1265('0x41')](_0x5ade14,'UserId'),'role':_0x1265('0x5d')},'attributes':['id',_0x1265('0x2d'),'openchannelPause',_0x1265('0x5e'),'createdAt']});}})['then'](function(_0x25539e){if(_0x25539e){return{'count':_0x25539e[_0x1265('0x45')],'rows':_[_0x1265('0x41')](_0x25539e[_0x1265('0x47')],function(_0xa2a519){return{'membername':_0xa2a519[_0x1265('0x2d')],'UserId':_0xa2a519['id'],'queue_name':_0x1b49cb[_0x1265('0x2d')],'OpenchannelQueueId':_0x1b49cb['id'],'interface':util[_0x1265('0x5f')](_0x1265('0x60'),_0x1265('0x61'),_0xa2a519['name']),'penalty':0x0,'paused':_0xa2a519[_0x1265('0x62')],'createdAt':_0xa2a519[_0x1265('0x63')],'updatedAt':_0xa2a519[_0x1265('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1265('0x26')](respondWithFilteredResult(_0x57c38e,_0x4ad7d3))['catch'](handleError(_0x57c38e,null));};exports[_0x1265('0x64')]=function(_0x59805e,_0x1f09b4,_0x573780){var _0x30c4ca={};var _0x1b5e48={};var _0x3a287c;var _0x335887;return db[_0x1265('0x30')][_0x1265('0x65')]({'where':{'id':_0x59805e[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x1f09b4,null))[_0x1265('0x26')](function(_0x570153){if(_0x570153){_0x3a287c=_0x570153;_0x1b5e48[_0x1265('0x32')]=_['keys'](db[_0x1265('0x66')][_0x1265('0x31')]);_0x1b5e48[_0x1265('0x34')]=_['keys'](_0x59805e[_0x1265('0x34')]);_0x1b5e48['filters']=_[_0x1265('0x37')](_0x1b5e48[_0x1265('0x32')],_0x1b5e48[_0x1265('0x34')]);_0x30c4ca['attributes']=_['intersection'](_0x1b5e48[_0x1265('0x32')],qs['fields'](_0x59805e[_0x1265('0x34')][_0x1265('0x38')]));_0x30c4ca[_0x1265('0x36')]=_0x30c4ca[_0x1265('0x36')][_0x1265('0x39')]?_0x30c4ca[_0x1265('0x36')]:_0x1b5e48[_0x1265('0x32')];_0x30c4ca[_0x1265('0x3c')]=qs[_0x1265('0x3d')](_0x59805e[_0x1265('0x34')][_0x1265('0x3d')]);_0x30c4ca[_0x1265('0x3e')]=qs[_0x1265('0x35')](_[_0x1265('0x67')](_0x59805e[_0x1265('0x34')],_0x1b5e48[_0x1265('0x35')]));if(_0x59805e[_0x1265('0x34')][_0x1265('0x3f')]){_0x30c4ca['where']=_[_0x1265('0x40')](_0x30c4ca[_0x1265('0x3e')],{'$or':_['map'](_0x30c4ca[_0x1265('0x36')],function(_0x3b31dc){var _0x4397a9={};_0x4397a9[_0x3b31dc]={'$like':'%'+_0x59805e['query'][_0x1265('0x3f')]+'%'};return _0x4397a9;})});}_0x30c4ca=_[_0x1265('0x40')]({},_0x30c4ca,_0x59805e[_0x1265('0x4a')]);return _0x3a287c[_0x1265('0x64')](_0x30c4ca);}})[_0x1265('0x26')](function(_0x1d2b79){if(_0x1d2b79){_0x335887=_0x1d2b79[_0x1265('0x39')];if(!_0x59805e[_0x1265('0x34')][_0x1265('0x58')]('nolimit')){_0x30c4ca[_0x1265('0x3b')]=qs[_0x1265('0x3b')](_0x59805e[_0x1265('0x34')][_0x1265('0x3b')]);_0x30c4ca['offset']=qs[_0x1265('0x21')](_0x59805e[_0x1265('0x34')][_0x1265('0x21')]);}return _0x3a287c[_0x1265('0x64')](_0x30c4ca);}})['then'](function(_0x4356c6){if(_0x4356c6){return _0x4356c6?{'count':_0x335887,'rows':_0x4356c6}:null;}})[_0x1265('0x26')](respondWithResult(_0x1f09b4,null))[_0x1265('0x48')](handleError(_0x1f09b4,null));};exports[_0x1265('0x68')]=function(_0x34b9ec,_0x36fd87,_0x36fab1){var _0x5f0b55=_0x34b9ec[_0x1265('0x4d')][_0x1265('0x69')];return db[_0x1265('0x66')][_0x1265('0x5a')]({'where':{'id':_['map'](_0x5f0b55,'id')},'attributes':['id'],'include':[{'model':db[_0x1265('0x5b')],'as':'Agents','attributes':['id',_0x1265('0x2d'),_0x1265('0x6a'),_0x1265('0x6b'),_0x1265('0x6c')],'raw':!![]}]})[_0x1265('0x26')](function(_0x332052){if(_0x332052){var _0x1826ce=_[_0x1265('0x6d')](_0x332052,function(_0x186f0f){var _0x5431ee=_0x186f0f[_0x1265('0x28')]({'plain':!![]});return _0x5431ee[_0x1265('0x6e')];});return db[_0x1265('0x30')][_0x1265('0x4b')]({'where':{'id':_0x34b9ec[_0x1265('0x54')]['id']}})[_0x1265('0x26')](function(_0x2fa183){return db[_0x1265('0x6f')][_0x1265('0x70')](function(_0x30d6fa){return _0x2fa183[_0x1265('0x68')](_[_0x1265('0x41')](_0x5f0b55,'id'),{'transaction':_0x30d6fa})['then'](function(){return BPromise[_0x1265('0x71')](_0x1826ce,function(_0x3aef32){return db[_0x1265('0x57')][_0x1265('0x72')]({'where':{'UserId':_0x3aef32['id'],'OpenchannelQueueId':_0x34b9ec['params']['id']},'transaction':_0x30d6fa});});})['then'](function(){_0x1826ce['forEach'](function(_0x243585){socket['emit'](_0x1265('0x73'),{'UserId':_0x243585['id'],'OpenchannelQueueId':_0x2fa183['id']});});});});});}})[_0x1265('0x26')](respondWithStatusCode(_0x36fd87,null))[_0x1265('0x48')](handleError(_0x36fd87,null));};exports[_0x1265('0x74')]=function(_0x345f5a,_0x10b8b1,_0x84a6fc){return db[_0x1265('0x66')]['findAll']({'where':{'id':_0x345f5a[_0x1265('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1265('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1265('0x26')](handleEntityNotFound(_0x10b8b1,null))['then'](function(_0x5cb332){var _0x105411=_[_0x1265('0x41')](_0x5cb332,'id');var _0x18e018=[];var _0x5d0f60=[];var _0xa1cac0=squel[_0x1265('0x75')]();_0xa1cac0[_0x1265('0x76')]('tq.TeamId')[_0x1265('0x77')](_0x1265('0x78'),'tq')[_0x1265('0x79')](_0x1265('0x7a'),'ut',_0x1265('0x7b'))[_0x1265('0x3e')]('OpenchannelQueueId\x20=\x20?',_0x345f5a['params']['id']);for(var _0x32564e=0x0;_0x32564e<_0x5cb332[_0x1265('0x39')];_0x32564e+=0x1){let _0x4a6ddb=_0x5cb332[_0x32564e];for(var _0x16f15f=0x0;_0x16f15f<_0x4a6ddb[_0x1265('0x6e')][_0x1265('0x39')];_0x16f15f+=0x1){let _0x402444=_0x4a6ddb[_0x1265('0x6e')][_0x16f15f];var _0x27ead0=_0xa1cac0[_0x1265('0x7c')]();_0x27ead0[_0x1265('0x3e')]('ut.UserId\x20=\x20?',_0x402444['id']);_0x5d0f60[_0x1265('0x7d')](db[_0x1265('0x6f')][_0x1265('0x34')](_0x27ead0[_0x1265('0x7e')](),{'type':db[_0x1265('0x6f')]['QueryTypes'][_0x1265('0x7f')]})[_0x1265('0x26')](function(_0x171359){if(_0x171359[_0x1265('0x39')]===0x1){return _0x402444['id'];}else{var _0xa0c5d3=_[_0x1265('0x80')](_[_0x1265('0x41')](_0x171359,_0x1265('0x81')),function(_0x4ab756){return _['includes'](_0x105411,_0x4ab756);});if(_0xa0c5d3){return _0x402444['id'];}}}));}}return BPromise['all'](_0x5d0f60)[_0x1265('0x26')](function(_0xa604fa){_0x18e018=_(_0x18e018)[_0x1265('0x82')](_0xa604fa)[_0x1265('0x83')]()[_0x1265('0x84')]();return db['OpenchannelQueue'][_0x1265('0x4b')]({'where':{'id':_0x345f5a[_0x1265('0x54')]['id']}})[_0x1265('0x26')](function(_0x34c36f){return db[_0x1265('0x6f')][_0x1265('0x70')](function(_0x11c995){return _0x34c36f[_0x1265('0x74')](_0x345f5a[_0x1265('0x34')][_0x1265('0x85')],{'transaction':_0x11c995})['then'](function(){if(!_['isEmpty'](_0x18e018)){return _0x34c36f['removeAgents'](_0x18e018,{'transaction':_0x11c995});}})['then'](function(){_0x18e018['forEach'](function(_0x3977cf){socket[_0x1265('0x86')](_0x1265('0x87'),{'UserId':_0x3977cf,'OpenchannelQueueId':_0x34c36f['id']});});});});});});})[_0x1265('0x26')](respondWithStatusCode(_0x10b8b1,null))[_0x1265('0x48')](handleError(_0x10b8b1,null));};exports[_0x1265('0x88')]=function(_0x3b988a,_0x39a094,_0x13049a){return db['OpenchannelQueue'][_0x1265('0x4b')]({'where':{'id':_0x3b988a[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x39a094,null))['then'](function(_0x43da46){if(_0x43da46){return _0x43da46[_0x1265('0x88')](_0x3b988a[_0x1265('0x4d')][_0x1265('0x85')],_[_0x1265('0x89')](_0x3b988a[_0x1265('0x4d')],[_0x1265('0x85'),'id'])||{})[_0x1265('0x8a')](function(_0xae629a){for(var _0x149c8a=0x0;_0x149c8a<_0x3b988a[_0x1265('0x4d')][_0x1265('0x85')][_0x1265('0x39')];_0x149c8a+=0x1){socket[_0x1265('0x86')](_0x1265('0x73'),{'UserId':_0x3b988a[_0x1265('0x4d')][_0x1265('0x85')][_0x149c8a],'OpenchannelQueueId':_0x3b988a[_0x1265('0x54')]['id']});}return _0xae629a;});}})[_0x1265('0x26')](respondWithResult(_0x39a094,null))[_0x1265('0x48')](handleError(_0x39a094,null));};exports[_0x1265('0x8b')]=function(_0x19a8fc,_0x5c9ba9,_0x2bba4a){return db[_0x1265('0x30')][_0x1265('0x4b')]({'where':{'id':_0x19a8fc[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x5c9ba9,null))['then'](function(_0x5b7da0){if(_0x5b7da0){return _0x5b7da0[_0x1265('0x8b')](_0x19a8fc[_0x1265('0x34')][_0x1265('0x85')])[_0x1265('0x26')](function(){if(_['isArray'](_0x19a8fc[_0x1265('0x34')][_0x1265('0x85')])){for(var _0x2efe0c=0x0;_0x2efe0c<_0x19a8fc[_0x1265('0x34')]['ids'][_0x1265('0x39')];_0x2efe0c+=0x1){socket[_0x1265('0x86')](_0x1265('0x87'),{'UserId':Number(_0x19a8fc[_0x1265('0x34')][_0x1265('0x85')][_0x2efe0c]),'OpenchannelQueueId':Number(_0x19a8fc[_0x1265('0x54')]['id'])});}}else{socket[_0x1265('0x86')](_0x1265('0x87'),{'UserId':Number(_0x19a8fc['query']['ids']),'OpenchannelQueueId':Number(_0x19a8fc['params']['id'])});}});}})[_0x1265('0x26')](respondWithStatusCode(_0x5c9ba9,null))[_0x1265('0x48')](handleError(_0x5c9ba9,null));};exports[_0x1265('0x8c')]=function(_0x54c2ef,_0x504661,_0x2b98e8){var _0x8e4ba5={};var _0x451665={};var _0x3e8932;var _0x1089b4;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x54c2ef[_0x1265('0x54')]['id']}})[_0x1265('0x26')](handleEntityNotFound(_0x504661,null))[_0x1265('0x26')](function(_0x3c8a6b){if(_0x3c8a6b){_0x3e8932=_0x3c8a6b;_0x451665[_0x1265('0x32')]=_['keys'](db[_0x1265('0x5b')][_0x1265('0x31')]);_0x451665['query']=_[_0x1265('0x33')](_0x54c2ef[_0x1265('0x34')]);_0x451665[_0x1265('0x35')]=_[_0x1265('0x37')](_0x451665[_0x1265('0x32')],_0x451665[_0x1265('0x34')]);_0x8e4ba5['attributes']=_['intersection'](_0x451665[_0x1265('0x32')],qs[_0x1265('0x38')](_0x54c2ef['query']['fields']));_0x8e4ba5[_0x1265('0x36')]=_0x8e4ba5[_0x1265('0x36')][_0x1265('0x39')]?_0x8e4ba5['attributes']:_0x451665[_0x1265('0x32')];_0x8e4ba5[_0x1265('0x3c')]=qs[_0x1265('0x3d')](_0x54c2ef[_0x1265('0x34')][_0x1265('0x3d')]);_0x8e4ba5[_0x1265('0x3e')]=qs[_0x1265('0x35')](_['pick'](_0x54c2ef[_0x1265('0x34')],_0x451665[_0x1265('0x35')]));if(_0x54c2ef[_0x1265('0x34')][_0x1265('0x3f')]){_0x8e4ba5[_0x1265('0x3e')]=_['merge'](_0x8e4ba5[_0x1265('0x3e')],{'$or':_['map'](_0x8e4ba5[_0x1265('0x36')],function(_0x13beb1){var _0x20dec0={};_0x20dec0[_0x13beb1]={'$like':'%'+_0x54c2ef['query'][_0x1265('0x3f')]+'%'};return _0x20dec0;})});}_0x8e4ba5=_[_0x1265('0x40')]({},_0x8e4ba5,_0x54c2ef[_0x1265('0x4a')]);return _0x3e8932[_0x1265('0x8c')](_0x8e4ba5);}})[_0x1265('0x26')](function(_0x5af40d){if(_0x5af40d){_0x1089b4=_0x5af40d[_0x1265('0x39')];if(!_0x54c2ef[_0x1265('0x34')][_0x1265('0x58')](_0x1265('0x3a'))){_0x8e4ba5[_0x1265('0x3b')]=qs[_0x1265('0x3b')](_0x54c2ef[_0x1265('0x34')]['limit']);_0x8e4ba5[_0x1265('0x21')]=qs[_0x1265('0x21')](_0x54c2ef[_0x1265('0x34')][_0x1265('0x21')]);}return _0x3e8932[_0x1265('0x8c')](_0x8e4ba5);}})[_0x1265('0x26')](function(_0x2cec4b){if(_0x2cec4b){return _0x2cec4b?{'count':_0x1089b4,'rows':_0x2cec4b}:null;}})[_0x1265('0x26')](respondWithResult(_0x504661,null))[_0x1265('0x48')](handleError(_0x504661,null));}; \ No newline at end of file +var _0xb423=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','where','pick','filter','merge','map','type','VIRTUAL','OpenchannelQueue','include','findAll','rows','params','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','sort','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','createdAt','SIP','updatedAt','Team','getTeams','addTeams','Agents','online','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb423,0x106));var _0x3b42=function(_0x394964,_0x5741e7){_0x394964=_0x394964-0x0;var _0x474eb5=_0xb423[_0x394964];return _0x474eb5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3b42('0x0'));var rimraf=require(_0x3b42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b42('0x2'));var rp=require(_0x3b42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b42('0x4'));var util=require(_0x3b42('0x5'));var path=require(_0x3b42('0x6'));var sox=require(_0x3b42('0x7'));var csv=require(_0x3b42('0x8'));var ejs=require(_0x3b42('0x9'));var fs=require('fs');var _=require(_0x3b42('0xa'));var squel=require(_0x3b42('0xb'));var crypto=require(_0x3b42('0xc'));var jsforce=require(_0x3b42('0xd'));var deskjs=require(_0x3b42('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3b42('0xf'));var Papa=require(_0x3b42('0x10'));var Redis=require(_0x3b42('0x11'));var authService=require(_0x3b42('0x12'));var qs=require(_0x3b42('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b42('0x14'))(_0x3b42('0x15'));var utils=require(_0x3b42('0x16'));var config=require(_0x3b42('0x17'));var db=require(_0x3b42('0x18'))['db'];config['redis']=_['defaults'](config[_0x3b42('0x19')],{'host':_0x3b42('0x1a'),'port':0x18eb});var socket=require(_0x3b42('0x1b'))(new Redis(config['redis']));require(_0x3b42('0x1c'))['register'](socket);function respondWithStatusCode(_0x464b43,_0x494716){_0x494716=_0x494716||0xcc;return function(_0x35db51){if(_0x35db51){return _0x464b43[_0x3b42('0x1d')](_0x494716);}return _0x464b43[_0x3b42('0x1e')](_0x494716)['end']();};}function respondWithResult(_0x251685,_0x5e57b5){_0x5e57b5=_0x5e57b5||0xc8;return function(_0x35b89d){if(_0x35b89d){return _0x251685[_0x3b42('0x1e')](_0x5e57b5)['json'](_0x35b89d);}};}function respondWithFilteredResult(_0x407c47,_0x38348e){return function(_0x9c5c76){if(_0x9c5c76){var _0x3697fb=_0x9c5c76[_0x3b42('0x1f')],_0x13b3ec=_0x38348e['offset'],_0x33e3fe=_0x38348e['offset']+_0x38348e[_0x3b42('0x20')],_0x2e2016;if(_0x33e3fe>=_0x3697fb){_0x33e3fe=_0x3697fb;_0x2e2016=0xc8;}else{_0x2e2016=0xce;}_0x407c47[_0x3b42('0x1e')](_0x2e2016);return _0x407c47[_0x3b42('0x21')](_0x3b42('0x22'),_0x13b3ec+'-'+_0x33e3fe+'/'+_0x3697fb)[_0x3b42('0x23')](_0x9c5c76);}return null;};}function patchUpdates(_0x2e2620){return function(_0x1e8671){try{jsonpatch[_0x3b42('0x24')](_0x1e8671,_0x2e2620,!![]);}catch(_0x52c2dd){return BPromise[_0x3b42('0x25')](_0x52c2dd);}return _0x1e8671['save']();};}function saveUpdates(_0x146b07,_0x15e14b){return function(_0x2403fe){if(_0x2403fe){return _0x2403fe[_0x3b42('0x26')](_0x146b07)[_0x3b42('0x27')](function(_0x5d1fd8){return _0x5d1fd8;});}return null;};}function removeEntity(_0x34cb7a,_0x5f43db){return function(_0x5256d7){if(_0x5256d7){return _0x5256d7[_0x3b42('0x28')]()[_0x3b42('0x27')](function(){var _0x4c6198=_0x5256d7[_0x3b42('0x29')]({'plain':!![]});var _0x415e79=_0x3b42('0x2a');return db[_0x3b42('0x2b')][_0x3b42('0x28')]({'where':{'type':_0x415e79,'resourceId':_0x4c6198['id']}})[_0x3b42('0x27')](function(){return _0x5256d7;});})[_0x3b42('0x27')](function(){_0x34cb7a[_0x3b42('0x1e')](0xcc)[_0x3b42('0x2c')]();});}};}function handleEntityNotFound(_0x5f04a0,_0x56533a){return function(_0x1819b7){if(!_0x1819b7){_0x5f04a0[_0x3b42('0x1d')](0x194);}return _0x1819b7;};}function handleError(_0x32478e,_0x174c8d){_0x174c8d=_0x174c8d||0x1f4;return function(_0x4731d9){logger[_0x3b42('0x2d')](_0x4731d9[_0x3b42('0x2e')]);if(_0x4731d9[_0x3b42('0x2f')]){delete _0x4731d9[_0x3b42('0x2f')];}_0x32478e[_0x3b42('0x1e')](_0x174c8d)['send'](_0x4731d9);};}exports[_0x3b42('0x30')]=function(_0x479f9f,_0x30eaa2){var _0x207261={},_0xa148a3={},_0x1d9d02={'count':0x0,'rows':[]};var _0x430ddd=db['OpenchannelQueue'][_0x3b42('0x31')];_0xa148a3[_0x3b42('0x32')]=_['keys'](_0x430ddd);_0xa148a3[_0x3b42('0x33')]=_[_0x3b42('0x34')](_0x479f9f[_0x3b42('0x33')]);_0xa148a3[_0x3b42('0x35')]=_[_0x3b42('0x36')](_0xa148a3[_0x3b42('0x32')],_0xa148a3[_0x3b42('0x33')]);_0x207261[_0x3b42('0x37')]=_[_0x3b42('0x36')](_0xa148a3[_0x3b42('0x32')],qs['fields'](_0x479f9f[_0x3b42('0x33')][_0x3b42('0x38')]));_0x207261[_0x3b42('0x37')]=_0x207261[_0x3b42('0x37')][_0x3b42('0x39')]?_0x207261['attributes']:_0xa148a3[_0x3b42('0x32')];if(!_0x479f9f[_0x3b42('0x33')]['hasOwnProperty'](_0x3b42('0x3a'))){_0x207261[_0x3b42('0x20')]=qs[_0x3b42('0x20')](_0x479f9f[_0x3b42('0x33')][_0x3b42('0x20')]);_0x207261[_0x3b42('0x3b')]=qs[_0x3b42('0x3b')](_0x479f9f[_0x3b42('0x33')][_0x3b42('0x3b')]);}_0x207261[_0x3b42('0x3c')]=qs['sort'](_0x479f9f[_0x3b42('0x33')]['sort']);_0x207261[_0x3b42('0x3d')]=qs[_0x3b42('0x35')](_[_0x3b42('0x3e')](_0x479f9f[_0x3b42('0x33')],_0xa148a3['filters']));if(_0x479f9f[_0x3b42('0x33')][_0x3b42('0x3f')]){_0x207261[_0x3b42('0x3d')]=_[_0x3b42('0x40')](_0x207261[_0x3b42('0x3d')],{'$or':_[_0x3b42('0x41')](_0x430ddd,function(_0x1d958c){if(_0x1d958c[_0x3b42('0x42')]['key']!==_0x3b42('0x43')){var _0x42e5df={};_0x42e5df[_0x1d958c['field']]={'$like':'%'+_0x479f9f[_0x3b42('0x33')]['filter']+'%'};return _0x42e5df;}})});}_0x207261=_[_0x3b42('0x40')]({},_0x207261,_0x479f9f['options']);var _0x5a6c86={'where':_0x207261[_0x3b42('0x3d')]};return db[_0x3b42('0x44')][_0x3b42('0x1f')](_0x5a6c86)[_0x3b42('0x27')](function(_0x542497){_0x1d9d02['count']=_0x542497;if(_0x479f9f[_0x3b42('0x33')]['includeAll']){_0x207261[_0x3b42('0x45')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x3b42('0x46')](_0x207261);})['then'](function(_0x302a46){_0x1d9d02[_0x3b42('0x47')]=_0x302a46;return _0x1d9d02;})[_0x3b42('0x27')](respondWithFilteredResult(_0x30eaa2,_0x207261))['catch'](handleError(_0x30eaa2,null));};exports['show']=function(_0x251437,_0x251cbb){var _0x15af59={'raw':!![],'where':{'id':_0x251437[_0x3b42('0x48')]['id']}},_0x2ff5dd={};_0x2ff5dd[_0x3b42('0x32')]=_[_0x3b42('0x34')](db[_0x3b42('0x44')][_0x3b42('0x31')]);_0x2ff5dd['query']=_[_0x3b42('0x34')](_0x251437[_0x3b42('0x33')]);_0x2ff5dd['filters']=_[_0x3b42('0x36')](_0x2ff5dd[_0x3b42('0x32')],_0x2ff5dd['query']);_0x15af59[_0x3b42('0x37')]=_['intersection'](_0x2ff5dd['model'],qs[_0x3b42('0x38')](_0x251437[_0x3b42('0x33')][_0x3b42('0x38')]));_0x15af59['attributes']=_0x15af59['attributes'][_0x3b42('0x39')]?_0x15af59[_0x3b42('0x37')]:_0x2ff5dd[_0x3b42('0x32')];if(_0x251437['query'][_0x3b42('0x49')]){_0x15af59[_0x3b42('0x45')]=[{'all':!![]}];}_0x15af59=_[_0x3b42('0x40')]({},_0x15af59,_0x251437[_0x3b42('0x4a')]);return db[_0x3b42('0x44')]['find'](_0x15af59)[_0x3b42('0x27')](handleEntityNotFound(_0x251cbb,null))[_0x3b42('0x27')](respondWithResult(_0x251cbb,null))[_0x3b42('0x4b')](handleError(_0x251cbb,null));};exports[_0x3b42('0x4c')]=function(_0x148e5a,_0x1994c4){return db['OpenchannelQueue']['create'](_0x148e5a[_0x3b42('0x4d')],{})['then'](function(_0x3d254b){var _0x118405=_0x148e5a[_0x3b42('0x4e')][_0x3b42('0x29')]({'plain':!![]});if(!_0x118405)throw new Error(_0x3b42('0x4f'));if(_0x118405['role']===_0x3b42('0x4e')){var _0x194825=_0x3d254b[_0x3b42('0x29')]({'plain':!![]});var _0x4978cd='OpenchannelQueues';return db[_0x3b42('0x50')][_0x3b42('0x51')]({'where':{'name':_0x4978cd,'userProfileId':_0x118405[_0x3b42('0x52')]},'raw':!![]})[_0x3b42('0x27')](function(_0x56b087){if(_0x56b087&&_0x56b087[_0x3b42('0x53')]===0x0){return db[_0x3b42('0x2b')][_0x3b42('0x4c')]({'name':_0x194825[_0x3b42('0x2f')],'resourceId':_0x194825['id'],'type':_0x56b087[_0x3b42('0x2f')],'sectionId':_0x56b087['id']},{})[_0x3b42('0x27')](function(){return _0x3d254b;});}else{return _0x3d254b;}})[_0x3b42('0x4b')](function(_0x3ab7e4){logger['error'](_0x3b42('0x54'),_0x3ab7e4);throw _0x3ab7e4;});}return _0x3d254b;})[_0x3b42('0x27')](respondWithResult(_0x1994c4,0xc9))['catch'](handleError(_0x1994c4,null));};exports[_0x3b42('0x26')]=function(_0xf6db6f,_0x262aee){if(_0xf6db6f[_0x3b42('0x4d')]['id']){delete _0xf6db6f[_0x3b42('0x4d')]['id'];}return db[_0x3b42('0x44')][_0x3b42('0x51')]({'where':{'id':_0xf6db6f['params']['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x262aee,null))[_0x3b42('0x27')](saveUpdates(_0xf6db6f[_0x3b42('0x4d')],null))[_0x3b42('0x27')](respondWithResult(_0x262aee,null))['catch'](handleError(_0x262aee,null));};exports[_0x3b42('0x28')]=function(_0x51c050,_0x1c60bf){return db[_0x3b42('0x44')]['find']({'where':{'id':_0x51c050[_0x3b42('0x48')]['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x1c60bf,null))[_0x3b42('0x27')](removeEntity(_0x1c60bf,null))[_0x3b42('0x4b')](handleError(_0x1c60bf,null));};exports[_0x3b42('0x55')]=function(_0x38e5f6,_0x164864){return db[_0x3b42('0x44')]['describe']()[_0x3b42('0x27')](respondWithResult(_0x164864,null))[_0x3b42('0x4b')](handleError(_0x164864,null));};exports[_0x3b42('0x56')]=function(_0x2f3584,_0x184518,_0x509b76){var _0x12a40f={'raw':!![],'where':{}},_0x4356ff={},_0x3771cf;return db[_0x3b42('0x44')][_0x3b42('0x57')]({'where':{'id':_0x2f3584[_0x3b42('0x48')]['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x184518,null))[_0x3b42('0x27')](function(_0x1f27b0){if(_0x1f27b0){_0x3771cf=_0x1f27b0['get']({'plain':!![]});_0x4356ff[_0x3b42('0x32')]=_[_0x3b42('0x34')](db[_0x3b42('0x58')][_0x3b42('0x31')]);_0x4356ff[_0x3b42('0x33')]=_[_0x3b42('0x34')](_0x2f3584[_0x3b42('0x33')]);_0x4356ff[_0x3b42('0x35')]=_['intersection'](_0x4356ff['model'],_0x4356ff[_0x3b42('0x33')]);_0x12a40f[_0x3b42('0x37')]=_[_0x3b42('0x36')](_0x4356ff[_0x3b42('0x32')],qs['fields'](_0x2f3584['query'][_0x3b42('0x38')]));_0x12a40f[_0x3b42('0x37')]=_0x12a40f[_0x3b42('0x37')]['length']?_0x12a40f[_0x3b42('0x37')]:_0x4356ff[_0x3b42('0x32')];if(!_0x2f3584[_0x3b42('0x33')][_0x3b42('0x59')](_0x3b42('0x3a'))){_0x12a40f[_0x3b42('0x20')]=qs[_0x3b42('0x20')](_0x2f3584['query'][_0x3b42('0x20')]);_0x12a40f[_0x3b42('0x3b')]=qs['offset'](_0x2f3584['query']['offset']);}_0x12a40f[_0x3b42('0x3c')]=qs[_0x3b42('0x5a')](_0x2f3584['query'][_0x3b42('0x5a')]);_0x12a40f[_0x3b42('0x3d')]=qs[_0x3b42('0x35')](_[_0x3b42('0x3e')](_0x2f3584[_0x3b42('0x33')],_0x4356ff[_0x3b42('0x35')]));_0x12a40f[_0x3b42('0x3d')][_0x3b42('0x5b')]=_0x1f27b0['id'];if(_0x2f3584[_0x3b42('0x33')][_0x3b42('0x3f')]){_0x12a40f[_0x3b42('0x3d')]=_[_0x3b42('0x40')](_0x12a40f['where'],{'$or':_[_0x3b42('0x41')](_0x12a40f[_0x3b42('0x37')],function(_0x6191fd){var _0x161e0a={};_0x161e0a[_0x6191fd]={'$like':'%'+_0x2f3584[_0x3b42('0x33')][_0x3b42('0x3f')]+'%'};return _0x161e0a;})});}_0x12a40f=_[_0x3b42('0x40')]({},_0x12a40f,_0x2f3584[_0x3b42('0x4a')]);return db['UserOpenchannelQueue'][_0x3b42('0x46')](_0x12a40f);}})[_0x3b42('0x27')](function(_0x3bd42e){if(_0x3bd42e){return db[_0x3b42('0x5c')][_0x3b42('0x5d')]({'where':{'id':_[_0x3b42('0x41')](_0x3bd42e,'UserId'),'role':_0x3b42('0x5e')},'attributes':['id','name',_0x3b42('0x5f'),'updatedAt',_0x3b42('0x60')]});}})[_0x3b42('0x27')](function(_0x415b22){if(_0x415b22){return{'count':_0x415b22[_0x3b42('0x1f')],'rows':_[_0x3b42('0x41')](_0x415b22[_0x3b42('0x47')],function(_0x3b74e5){return{'membername':_0x3b74e5['name'],'UserId':_0x3b74e5['id'],'queue_name':_0x3771cf[_0x3b42('0x2f')],'OpenchannelQueueId':_0x3771cf['id'],'interface':util['format']('%s/%s',_0x3b42('0x61'),_0x3b74e5[_0x3b42('0x2f')]),'penalty':0x0,'paused':_0x3b74e5[_0x3b42('0x5f')],'createdAt':_0x3b74e5[_0x3b42('0x60')],'updatedAt':_0x3b74e5[_0x3b42('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b42('0x27')](respondWithFilteredResult(_0x184518,_0x12a40f))[_0x3b42('0x4b')](handleError(_0x184518,null));};exports['getTeams']=function(_0x5c2b61,_0x3fe2fe,_0x1a363e){var _0xfdf8c4={};var _0x2378e3={};var _0x4e677d;var _0x3d464e;return db[_0x3b42('0x44')][_0x3b42('0x57')]({'where':{'id':_0x5c2b61['params']['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x3fe2fe,null))['then'](function(_0x41c170){if(_0x41c170){_0x4e677d=_0x41c170;_0x2378e3[_0x3b42('0x32')]=_[_0x3b42('0x34')](db[_0x3b42('0x63')]['rawAttributes']);_0x2378e3[_0x3b42('0x33')]=_[_0x3b42('0x34')](_0x5c2b61['query']);_0x2378e3[_0x3b42('0x35')]=_[_0x3b42('0x36')](_0x2378e3['model'],_0x2378e3['query']);_0xfdf8c4[_0x3b42('0x37')]=_[_0x3b42('0x36')](_0x2378e3['model'],qs[_0x3b42('0x38')](_0x5c2b61['query'][_0x3b42('0x38')]));_0xfdf8c4['attributes']=_0xfdf8c4[_0x3b42('0x37')][_0x3b42('0x39')]?_0xfdf8c4[_0x3b42('0x37')]:_0x2378e3[_0x3b42('0x32')];_0xfdf8c4[_0x3b42('0x3c')]=qs[_0x3b42('0x5a')](_0x5c2b61['query'][_0x3b42('0x5a')]);_0xfdf8c4['where']=qs['filters'](_[_0x3b42('0x3e')](_0x5c2b61[_0x3b42('0x33')],_0x2378e3['filters']));if(_0x5c2b61[_0x3b42('0x33')][_0x3b42('0x3f')]){_0xfdf8c4[_0x3b42('0x3d')]=_[_0x3b42('0x40')](_0xfdf8c4['where'],{'$or':_[_0x3b42('0x41')](_0xfdf8c4[_0x3b42('0x37')],function(_0xc49b){var _0x57d9ca={};_0x57d9ca[_0xc49b]={'$like':'%'+_0x5c2b61[_0x3b42('0x33')][_0x3b42('0x3f')]+'%'};return _0x57d9ca;})});}_0xfdf8c4=_[_0x3b42('0x40')]({},_0xfdf8c4,_0x5c2b61[_0x3b42('0x4a')]);return _0x4e677d[_0x3b42('0x64')](_0xfdf8c4);}})[_0x3b42('0x27')](function(_0x482e12){if(_0x482e12){_0x3d464e=_0x482e12[_0x3b42('0x39')];if(!_0x5c2b61[_0x3b42('0x33')]['hasOwnProperty'](_0x3b42('0x3a'))){_0xfdf8c4['limit']=qs['limit'](_0x5c2b61['query'][_0x3b42('0x20')]);_0xfdf8c4[_0x3b42('0x3b')]=qs[_0x3b42('0x3b')](_0x5c2b61['query'][_0x3b42('0x3b')]);}return _0x4e677d['getTeams'](_0xfdf8c4);}})['then'](function(_0x553437){if(_0x553437){return _0x553437?{'count':_0x3d464e,'rows':_0x553437}:null;}})[_0x3b42('0x27')](respondWithResult(_0x3fe2fe,null))[_0x3b42('0x4b')](handleError(_0x3fe2fe,null));};exports[_0x3b42('0x65')]=function(_0x3ac934,_0x502156,_0x520a37){var _0x40c7de=_0x3ac934[_0x3b42('0x4d')]['teams'];return db['Team'][_0x3b42('0x46')]({'where':{'id':_[_0x3b42('0x41')](_0x40c7de,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3b42('0x66'),'attributes':['id',_0x3b42('0x2f'),_0x3b42('0x67'),'voicePause','interface'],'raw':!![]}]})[_0x3b42('0x27')](function(_0x33c9b6){if(_0x33c9b6){var _0x4bab03=_['flatMap'](_0x33c9b6,function(_0x28d0bc){var _0x364ff1=_0x28d0bc[_0x3b42('0x29')]({'plain':!![]});return _0x364ff1['Agents'];});return db[_0x3b42('0x44')][_0x3b42('0x51')]({'where':{'id':_0x3ac934[_0x3b42('0x48')]['id']}})['then'](function(_0x1da735){return db['sequelize'][_0x3b42('0x68')](function(_0x461317){return _0x1da735[_0x3b42('0x65')](_[_0x3b42('0x41')](_0x40c7de,'id'),{'transaction':_0x461317})[_0x3b42('0x27')](function(){return BPromise[_0x3b42('0x69')](_0x4bab03,function(_0x49e043){return db[_0x3b42('0x58')][_0x3b42('0x6a')]({'where':{'UserId':_0x49e043['id'],'OpenchannelQueueId':_0x3ac934[_0x3b42('0x48')]['id']},'transaction':_0x461317});});})[_0x3b42('0x27')](function(){_0x4bab03[_0x3b42('0x6b')](function(_0x5013b0){socket[_0x3b42('0x6c')](_0x3b42('0x6d'),{'UserId':_0x5013b0['id'],'OpenchannelQueueId':_0x1da735['id']});});});});});}})[_0x3b42('0x27')](respondWithStatusCode(_0x502156,null))['catch'](handleError(_0x502156,null));};exports['removeTeams']=function(_0x429a90,_0x4bdd31,_0xbe720d){return db[_0x3b42('0x63')][_0x3b42('0x46')]({'where':{'id':_0x429a90[_0x3b42('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3b42('0x5c')],'as':_0x3b42('0x66'),'attributes':['id'],'raw':!![]}]})[_0x3b42('0x27')](handleEntityNotFound(_0x4bdd31,null))[_0x3b42('0x27')](function(_0x1a8c9d){var _0x5ad0bc=_[_0x3b42('0x41')](_0x1a8c9d,'id');var _0x40ac5a=[];var _0x23758f=[];var _0x414e5c=squel[_0x3b42('0x6e')]();_0x414e5c[_0x3b42('0x6f')](_0x3b42('0x70'))['from'](_0x3b42('0x71'),'tq')[_0x3b42('0x72')](_0x3b42('0x73'),'ut',_0x3b42('0x74'))[_0x3b42('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x429a90[_0x3b42('0x48')]['id']);for(var _0x353a45=0x0;_0x353a45<_0x1a8c9d[_0x3b42('0x39')];_0x353a45+=0x1){let _0x41445a=_0x1a8c9d[_0x353a45];for(var _0x1d7bd1=0x0;_0x1d7bd1<_0x41445a[_0x3b42('0x66')]['length'];_0x1d7bd1+=0x1){let _0x1b1a5b=_0x41445a['Agents'][_0x1d7bd1];var _0x395fbe=_0x414e5c[_0x3b42('0x75')]();_0x395fbe[_0x3b42('0x3d')](_0x3b42('0x76'),_0x1b1a5b['id']);_0x23758f[_0x3b42('0x77')](db[_0x3b42('0x78')][_0x3b42('0x33')](_0x395fbe['toString'](),{'type':db['sequelize'][_0x3b42('0x79')]['SELECT']})['then'](function(_0x2b0304){if(_0x2b0304[_0x3b42('0x39')]===0x1){return _0x1b1a5b['id'];}else{var _0x41d6cd=_[_0x3b42('0x7a')](_[_0x3b42('0x41')](_0x2b0304,_0x3b42('0x7b')),function(_0x2c52d6){return _[_0x3b42('0x7c')](_0x5ad0bc,_0x2c52d6);});if(_0x41d6cd){return _0x1b1a5b['id'];}}}));}}return BPromise[_0x3b42('0x7d')](_0x23758f)[_0x3b42('0x27')](function(_0x36144a){_0x40ac5a=_(_0x40ac5a)[_0x3b42('0x7e')](_0x36144a)[_0x3b42('0x7f')]()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x429a90[_0x3b42('0x48')]['id']}})['then'](function(_0x221281){return db['sequelize'][_0x3b42('0x68')](function(_0x460e29){return _0x221281[_0x3b42('0x80')](_0x429a90[_0x3b42('0x33')][_0x3b42('0x81')],{'transaction':_0x460e29})['then'](function(){if(!_[_0x3b42('0x82')](_0x40ac5a)){return _0x221281[_0x3b42('0x83')](_0x40ac5a,{'transaction':_0x460e29});}})['then'](function(){_0x40ac5a[_0x3b42('0x6b')](function(_0x3a98b6){socket['emit'](_0x3b42('0x84'),{'UserId':_0x3a98b6,'OpenchannelQueueId':_0x221281['id']});});});});});});})[_0x3b42('0x27')](respondWithStatusCode(_0x4bdd31,null))['catch'](handleError(_0x4bdd31,null));};exports[_0x3b42('0x85')]=function(_0x158bd7,_0x131b69,_0x34dbbc){return db[_0x3b42('0x44')]['find']({'where':{'id':_0x158bd7[_0x3b42('0x48')]['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x131b69,null))[_0x3b42('0x27')](function(_0x3f4caa){if(_0x3f4caa){return _0x3f4caa[_0x3b42('0x85')](_0x158bd7['body'][_0x3b42('0x81')],_[_0x3b42('0x86')](_0x158bd7[_0x3b42('0x4d')],[_0x3b42('0x81'),'id'])||{})[_0x3b42('0x87')](function(_0x5dfe53){for(var _0xccd4cd=0x0;_0xccd4cd<_0x158bd7[_0x3b42('0x4d')]['ids']['length'];_0xccd4cd+=0x1){socket[_0x3b42('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x158bd7[_0x3b42('0x4d')]['ids'][_0xccd4cd],'OpenchannelQueueId':_0x158bd7[_0x3b42('0x48')]['id']});}return _0x5dfe53;});}})['then'](respondWithResult(_0x131b69,null))['catch'](handleError(_0x131b69,null));};exports[_0x3b42('0x83')]=function(_0x5c282e,_0x4c5801,_0x39d08c){return db[_0x3b42('0x44')]['find']({'where':{'id':_0x5c282e[_0x3b42('0x48')]['id']}})[_0x3b42('0x27')](handleEntityNotFound(_0x4c5801,null))['then'](function(_0x3b872d){if(_0x3b872d){return _0x3b872d[_0x3b42('0x83')](_0x5c282e[_0x3b42('0x33')]['ids'])[_0x3b42('0x27')](function(){if(_[_0x3b42('0x88')](_0x5c282e[_0x3b42('0x33')][_0x3b42('0x81')])){for(var _0x3b6544=0x0;_0x3b6544<_0x5c282e[_0x3b42('0x33')]['ids']['length'];_0x3b6544+=0x1){socket['emit'](_0x3b42('0x84'),{'UserId':Number(_0x5c282e['query'][_0x3b42('0x81')][_0x3b6544]),'OpenchannelQueueId':Number(_0x5c282e[_0x3b42('0x48')]['id'])});}}else{socket[_0x3b42('0x6c')](_0x3b42('0x84'),{'UserId':Number(_0x5c282e[_0x3b42('0x33')][_0x3b42('0x81')]),'OpenchannelQueueId':Number(_0x5c282e[_0x3b42('0x48')]['id'])});}});}})[_0x3b42('0x27')](respondWithStatusCode(_0x4c5801,null))['catch'](handleError(_0x4c5801,null));};exports[_0x3b42('0x89')]=function(_0x511443,_0x178f0c,_0xca45c3){var _0x5a52c4={};var _0x452dd9={};var _0xeab534;var _0x242d4e;return db[_0x3b42('0x44')][_0x3b42('0x57')]({'where':{'id':_0x511443[_0x3b42('0x48')]['id']}})['then'](handleEntityNotFound(_0x178f0c,null))[_0x3b42('0x27')](function(_0x11ef1b){if(_0x11ef1b){_0xeab534=_0x11ef1b;_0x452dd9[_0x3b42('0x32')]=_[_0x3b42('0x34')](db[_0x3b42('0x5c')]['rawAttributes']);_0x452dd9[_0x3b42('0x33')]=_[_0x3b42('0x34')](_0x511443[_0x3b42('0x33')]);_0x452dd9['filters']=_['intersection'](_0x452dd9['model'],_0x452dd9[_0x3b42('0x33')]);_0x5a52c4['attributes']=_[_0x3b42('0x36')](_0x452dd9[_0x3b42('0x32')],qs['fields'](_0x511443[_0x3b42('0x33')][_0x3b42('0x38')]));_0x5a52c4[_0x3b42('0x37')]=_0x5a52c4[_0x3b42('0x37')]['length']?_0x5a52c4[_0x3b42('0x37')]:_0x452dd9[_0x3b42('0x32')];_0x5a52c4[_0x3b42('0x3c')]=qs[_0x3b42('0x5a')](_0x511443[_0x3b42('0x33')][_0x3b42('0x5a')]);_0x5a52c4[_0x3b42('0x3d')]=qs[_0x3b42('0x35')](_[_0x3b42('0x3e')](_0x511443[_0x3b42('0x33')],_0x452dd9[_0x3b42('0x35')]));if(_0x511443['query'][_0x3b42('0x3f')]){_0x5a52c4[_0x3b42('0x3d')]=_[_0x3b42('0x40')](_0x5a52c4[_0x3b42('0x3d')],{'$or':_['map'](_0x5a52c4['attributes'],function(_0x5c9d72){var _0x438fb0={};_0x438fb0[_0x5c9d72]={'$like':'%'+_0x511443['query'][_0x3b42('0x3f')]+'%'};return _0x438fb0;})});}_0x5a52c4=_[_0x3b42('0x40')]({},_0x5a52c4,_0x511443['options']);return _0xeab534['getAgents'](_0x5a52c4);}})[_0x3b42('0x27')](function(_0x2b3bf5){if(_0x2b3bf5){_0x242d4e=_0x2b3bf5[_0x3b42('0x39')];if(!_0x511443['query']['hasOwnProperty'](_0x3b42('0x3a'))){_0x5a52c4['limit']=qs[_0x3b42('0x20')](_0x511443[_0x3b42('0x33')][_0x3b42('0x20')]);_0x5a52c4[_0x3b42('0x3b')]=qs[_0x3b42('0x3b')](_0x511443[_0x3b42('0x33')][_0x3b42('0x3b')]);}return _0xeab534[_0x3b42('0x89')](_0x5a52c4);}})[_0x3b42('0x27')](function(_0xb9d5e){if(_0xb9d5e){return _0xb9d5e?{'count':_0x242d4e,'rows':_0xb9d5e}:null;}})[_0x3b42('0x27')](respondWithResult(_0x178f0c,null))['catch'](handleError(_0x178f0c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index a3b8d5c..f7294a2 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 _0xa259=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xa259,0x198));var _0x9a25=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xa259[_0x589aee];return _0x2f5ed4;};'use strict';var EventEmitter=require(_0x9a25('0x0'));var OpenchannelQueue=require(_0x9a25('0x1'))['db'][_0x9a25('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9a25('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4b8708){return function(_0x41695a,_0x573a83,_0x5c1fa3){OpenchannelQueueEvents[_0x9a25('0x4')](_0x4b8708+':'+_0x41695a['id'],_0x41695a);OpenchannelQueueEvents[_0x9a25('0x4')](_0x4b8708,_0x41695a);_0x5c1fa3(null);};}for(var e in events){if(events[_0x9a25('0x5')](e)){var event=events[e];OpenchannelQueue[_0x9a25('0x6')](e,emitEvent(event));}}module[_0x9a25('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x425d=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x425d,0x179));var _0xd425=function(_0xf5eaa0,_0x5bfa29){_0xf5eaa0=_0xf5eaa0-0x0;var _0x47039e=_0x425d[_0xf5eaa0];return _0x47039e;};'use strict';var EventEmitter=require(_0xd425('0x0'));var OpenchannelQueue=require(_0xd425('0x1'))['db'][_0xd425('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd425('0x3')](0x0);var events={'afterCreate':_0xd425('0x4'),'afterUpdate':'update','afterDestroy':_0xd425('0x5')};function emitEvent(_0x1c2301){return function(_0x1a8186,_0x5127d8,_0xb1c4b6){OpenchannelQueueEvents['emit'](_0x1c2301+':'+_0x1a8186['id'],_0x1a8186);OpenchannelQueueEvents[_0xd425('0x6')](_0x1c2301,_0x1a8186);_0xb1c4b6(null);};}for(var e in events){if(events[_0xd425('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xd425('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c937d56..acf8cb9 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 _0x1637=['openchannel_queues','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x1637,0x6f));var _0x7163=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1637[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x7163('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7163('0x1'));var moment=require(_0x7163('0x2'));var BPromise=require(_0x7163('0x3'));var rp=require(_0x7163('0x4'));var fs=require('fs');var path=require(_0x7163('0x5'));var rimraf=require('rimraf');var config=require(_0x7163('0x6'));var attributes=require(_0x7163('0x7'));module[_0x7163('0x8')]=function(_0x550ac5,_0x55d93b){return _0x550ac5['define']('OpenchannelQueue',attributes,{'tableName':_0x7163('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fbb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','api'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x0fbb,0x190));var _0xb0fb=function(_0x117fbe,_0x2e4ffa){_0x117fbe=_0x117fbe-0x0;var _0x43d0a7=_0x0fbb[_0x117fbe];return _0x43d0a7;};'use strict';var _=require(_0xb0fb('0x0'));var util=require(_0xb0fb('0x1'));var logger=require('../../config/logger')(_0xb0fb('0x2'));var moment=require(_0xb0fb('0x3'));var BPromise=require(_0xb0fb('0x4'));var rp=require(_0xb0fb('0x5'));var fs=require('fs');var path=require(_0xb0fb('0x6'));var rimraf=require(_0xb0fb('0x7'));var config=require(_0xb0fb('0x8'));var attributes=require(_0xb0fb('0x9'));module[_0xb0fb('0xa')]=function(_0x14a726,_0x34101e){return _0x14a726[_0xb0fb('0xb')](_0xb0fb('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 6e4c002..cf770fe 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 _0x07c3=['code','message','info','request\x20sent','result','catch','OpenchannelQueue','options','attributes','limit','include','map','model','GetOpenchannelQueue','find','raw','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55c7ea,_0x17eeaf){var _0x31bdf3=function(_0x25c98a){while(--_0x25c98a){_0x55c7ea['push'](_0x55c7ea['shift']());}};_0x31bdf3(++_0x17eeaf);}(_0x07c3,0x1bf));var _0x307c=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0x07c3[_0x1ce9ea];return _0x2a95b9;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});config[_0x307c('0xd')]=_[_0x307c('0xe')](config[_0x307c('0xd')],{'host':_0x307c('0xf'),'port':0x18eb});var socket=require(_0x307c('0x10'))(new Redis(config[_0x307c('0xd')]));require(_0x307c('0x11'))[_0x307c('0x12')](socket);function respondWithRpcPromise(_0x352f5a,_0x3c4a4c,_0x5d2d0f){return new BPromise(function(_0x8777ee,_0xe8236d){return client[_0x307c('0x13')](_0x352f5a,_0x5d2d0f)[_0x307c('0x14')](function(_0x4c1b82){logger['info'](_0x307c('0x15'),_0x3c4a4c,'request\x20sent');logger[_0x307c('0x16')](_0x307c('0x17'),_0x3c4a4c,'request\x20sent',JSON[_0x307c('0x18')](_0x4c1b82));if(_0x4c1b82[_0x307c('0x19')]){if(_0x4c1b82[_0x307c('0x19')][_0x307c('0x1a')]===0x1f4){logger[_0x307c('0x19')](_0x307c('0x15'),_0x3c4a4c,_0x4c1b82[_0x307c('0x19')][_0x307c('0x1b')]);return _0xe8236d(_0x4c1b82[_0x307c('0x19')][_0x307c('0x1b')]);}logger[_0x307c('0x19')](_0x307c('0x15'),_0x3c4a4c,_0x4c1b82['error'][_0x307c('0x1b')]);return _0x8777ee(_0x4c1b82[_0x307c('0x19')][_0x307c('0x1b')]);}else{logger[_0x307c('0x1c')](_0x307c('0x15'),_0x3c4a4c,_0x307c('0x1d'));_0x8777ee(_0x4c1b82[_0x307c('0x1e')][_0x307c('0x1b')]);}})[_0x307c('0x1f')](function(_0x5e03d0){logger['error'](_0x307c('0x15'),_0x3c4a4c,_0x5e03d0);_0xe8236d(_0x5e03d0);});});}exports['GetOpenchannelQueue']=function(_0x409e5b){var _0x5dafd3=this;return new Promise(function(_0x4cf649,_0x4bcc1a){return db[_0x307c('0x20')]['findAll']({'raw':_0x409e5b[_0x307c('0x21')]?_0x409e5b[_0x307c('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x409e5b[_0x307c('0x21')]?_0x409e5b[_0x307c('0x21')]['where']||null:null,'attributes':_0x409e5b[_0x307c('0x21')]?_0x409e5b[_0x307c('0x21')][_0x307c('0x22')]||null:null,'limit':_0x409e5b[_0x307c('0x21')]?_0x409e5b[_0x307c('0x21')][_0x307c('0x23')]||null:null,'include':_0x409e5b[_0x307c('0x21')]?_0x409e5b[_0x307c('0x21')][_0x307c('0x24')]?_[_0x307c('0x25')](_0x409e5b['options'][_0x307c('0x24')],function(_0x58c383){return{'model':db[_0x58c383['model']],'as':_0x58c383['as'],'attributes':_0x58c383[_0x307c('0x22')],'include':_0x58c383[_0x307c('0x24')]?_[_0x307c('0x25')](_0x58c383[_0x307c('0x24')],function(_0x25dede){return{'model':db[_0x25dede[_0x307c('0x26')]],'as':_0x25dede['as'],'attributes':_0x25dede['attributes'],'include':_0x25dede[_0x307c('0x24')]?_[_0x307c('0x25')](_0x25dede[_0x307c('0x24')],function(_0x54da33){return{'model':db[_0x54da33[_0x307c('0x26')]],'as':_0x54da33['as'],'attributes':_0x54da33[_0x307c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x307c('0x14')](function(_0x12d9a9){logger[_0x307c('0x1c')](_0x307c('0x27'),_0x409e5b);logger['debug'](_0x307c('0x27'),_0x409e5b,JSON[_0x307c('0x18')](_0x12d9a9));_0x4cf649(_0x12d9a9);})[_0x307c('0x1f')](function(_0x313fcf){logger[_0x307c('0x19')](_0x307c('0x27'),_0x313fcf[_0x307c('0x1b')],_0x409e5b);_0x4bcc1a(_0x5dafd3[_0x307c('0x19')](0x1f4,_0x313fcf[_0x307c('0x1b')]));});});};exports['ShowOpenchannelQueue']=function(_0x29c0c4){var _0x1985fb=this;return new Promise(function(_0x325961,_0x1a706a){return db[_0x307c('0x20')][_0x307c('0x28')]({'raw':_0x29c0c4[_0x307c('0x21')]?_0x29c0c4[_0x307c('0x21')][_0x307c('0x29')]===undefined?!![]:![]:!![],'where':_0x29c0c4[_0x307c('0x21')]?_0x29c0c4[_0x307c('0x21')]['where']||null:null,'attributes':_0x29c0c4[_0x307c('0x21')]?_0x29c0c4[_0x307c('0x21')]['attributes']||null:null,'include':_0x29c0c4[_0x307c('0x21')]?_0x29c0c4[_0x307c('0x21')]['include']?_[_0x307c('0x25')](_0x29c0c4['options'][_0x307c('0x24')],function(_0x246a20){return{'model':db[_0x246a20[_0x307c('0x26')]],'as':_0x246a20['as'],'attributes':_0x246a20[_0x307c('0x22')],'include':_0x246a20[_0x307c('0x24')]?_[_0x307c('0x25')](_0x246a20[_0x307c('0x24')],function(_0x4a9adb){return{'model':db[_0x4a9adb[_0x307c('0x26')]],'as':_0x4a9adb['as'],'attributes':_0x4a9adb[_0x307c('0x22')],'include':_0x4a9adb[_0x307c('0x24')]?_[_0x307c('0x25')](_0x4a9adb[_0x307c('0x24')],function(_0x1b7575){return{'model':db[_0x1b7575[_0x307c('0x26')]],'as':_0x1b7575['as'],'attributes':_0x1b7575['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x549aee){logger[_0x307c('0x1c')](_0x307c('0x2a'),_0x29c0c4);logger[_0x307c('0x16')]('ShowOpenchannelQueue',_0x29c0c4,JSON[_0x307c('0x18')](_0x549aee));_0x325961(_0x549aee);})['catch'](function(_0x3d14c8){logger[_0x307c('0x19')](_0x307c('0x2a'),_0x3d14c8[_0x307c('0x1b')],_0x29c0c4);_0x1a706a(_0x1985fb[_0x307c('0x19')](0x1f4,_0x3d14c8[_0x307c('0x1b')]));});});}; \ No newline at end of file +var _0x1a8f=['code','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x30b79a,_0x3d428c){var _0x1536e0=function(_0x519391){while(--_0x519391){_0x30b79a['push'](_0x30b79a['shift']());}};_0x1536e0(++_0x3d428c);}(_0x1a8f,0x87));var _0xf1a8=function(_0x407ebf,_0x2b47f5){_0x407ebf=_0x407ebf-0x0;var _0x29d7db=_0x1a8f[_0x407ebf];return _0x29d7db;};'use strict';var _=require(_0xf1a8('0x0'));var util=require('util');var moment=require(_0xf1a8('0x1'));var BPromise=require(_0xf1a8('0x2'));var rs=require(_0xf1a8('0x3'));var fs=require('fs');var Redis=require(_0xf1a8('0x4'));var db=require(_0xf1a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf1a8('0x6'));var client=jayson[_0xf1a8('0x7')][_0xf1a8('0x8')]({'port':0x232a});config['redis']=_[_0xf1a8('0x9')](config['redis'],{'host':_0xf1a8('0xa'),'port':0x18eb});var socket=require(_0xf1a8('0xb'))(new Redis(config[_0xf1a8('0xc')]));require('./openchannelQueue.socket')[_0xf1a8('0xd')](socket);function respondWithRpcPromise(_0x5012c6,_0x6915e2,_0x4d567f){return new BPromise(function(_0x1f2595,_0x3ff385){return client[_0xf1a8('0xe')](_0x5012c6,_0x4d567f)[_0xf1a8('0xf')](function(_0x49e1e1){logger[_0xf1a8('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x6915e2,_0xf1a8('0x11'));logger['debug'](_0xf1a8('0x12'),_0x6915e2,_0xf1a8('0x11'),JSON[_0xf1a8('0x13')](_0x49e1e1));if(_0x49e1e1[_0xf1a8('0x14')]){if(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x15')]===0x1f4){logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x49e1e1[_0xf1a8('0x14')]['message']);return _0x3ff385(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);}logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);return _0x1f2595(_0x49e1e1[_0xf1a8('0x14')][_0xf1a8('0x17')]);}else{logger[_0xf1a8('0x10')](_0xf1a8('0x16'),_0x6915e2,_0xf1a8('0x11'));_0x1f2595(_0x49e1e1[_0xf1a8('0x18')][_0xf1a8('0x17')]);}})['catch'](function(_0x159d9d){logger[_0xf1a8('0x14')](_0xf1a8('0x16'),_0x6915e2,_0x159d9d);_0x3ff385(_0x159d9d);});});}exports[_0xf1a8('0x19')]=function(_0x45df6f){var _0x50c41f=this;return new Promise(function(_0xd2839,_0x5a558a){return db[_0xf1a8('0x1a')][_0xf1a8('0x1b')]({'raw':_0x45df6f[_0xf1a8('0x1c')]?_0x45df6f[_0xf1a8('0x1c')][_0xf1a8('0x1d')]===undefined?!![]:![]:!![],'where':_0x45df6f[_0xf1a8('0x1c')]?_0x45df6f[_0xf1a8('0x1c')][_0xf1a8('0x1e')]||null:null,'attributes':_0x45df6f['options']?_0x45df6f[_0xf1a8('0x1c')][_0xf1a8('0x1f')]||null:null,'limit':_0x45df6f[_0xf1a8('0x1c')]?_0x45df6f[_0xf1a8('0x1c')][_0xf1a8('0x20')]||null:null,'include':_0x45df6f['options']?_0x45df6f[_0xf1a8('0x1c')][_0xf1a8('0x21')]?_[_0xf1a8('0x22')](_0x45df6f[_0xf1a8('0x1c')]['include'],function(_0x2db901){return{'model':db[_0x2db901['model']],'as':_0x2db901['as'],'attributes':_0x2db901[_0xf1a8('0x1f')],'include':_0x2db901[_0xf1a8('0x21')]?_[_0xf1a8('0x22')](_0x2db901['include'],function(_0x50c807){return{'model':db[_0x50c807[_0xf1a8('0x23')]],'as':_0x50c807['as'],'attributes':_0x50c807[_0xf1a8('0x1f')],'include':_0x50c807[_0xf1a8('0x21')]?_['map'](_0x50c807[_0xf1a8('0x21')],function(_0x4deba8){return{'model':db[_0x4deba8[_0xf1a8('0x23')]],'as':_0x4deba8['as'],'attributes':_0x4deba8[_0xf1a8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe6e6e3){logger['info']('GetOpenchannelQueue',_0x45df6f);logger[_0xf1a8('0x24')](_0xf1a8('0x19'),_0x45df6f,JSON[_0xf1a8('0x13')](_0xe6e6e3));_0xd2839(_0xe6e6e3);})['catch'](function(_0x321a9b){logger[_0xf1a8('0x14')](_0xf1a8('0x19'),_0x321a9b['message'],_0x45df6f);_0x5a558a(_0x50c41f[_0xf1a8('0x14')](0x1f4,_0x321a9b[_0xf1a8('0x17')]));});});};exports[_0xf1a8('0x25')]=function(_0x3eaca9){var _0x3cb923=this;return new Promise(function(_0x1fb6bb,_0x35dae3){return db[_0xf1a8('0x1a')][_0xf1a8('0x26')]({'raw':_0x3eaca9[_0xf1a8('0x1c')]?_0x3eaca9['options'][_0xf1a8('0x1d')]===undefined?!![]:![]:!![],'where':_0x3eaca9[_0xf1a8('0x1c')]?_0x3eaca9[_0xf1a8('0x1c')]['where']||null:null,'attributes':_0x3eaca9['options']?_0x3eaca9[_0xf1a8('0x1c')][_0xf1a8('0x1f')]||null:null,'include':_0x3eaca9[_0xf1a8('0x1c')]?_0x3eaca9[_0xf1a8('0x1c')][_0xf1a8('0x21')]?_['map'](_0x3eaca9[_0xf1a8('0x1c')]['include'],function(_0x4535bb){return{'model':db[_0x4535bb[_0xf1a8('0x23')]],'as':_0x4535bb['as'],'attributes':_0x4535bb['attributes'],'include':_0x4535bb[_0xf1a8('0x21')]?_[_0xf1a8('0x22')](_0x4535bb[_0xf1a8('0x21')],function(_0x3442d5){return{'model':db[_0x3442d5[_0xf1a8('0x23')]],'as':_0x3442d5['as'],'attributes':_0x3442d5[_0xf1a8('0x1f')],'include':_0x3442d5['include']?_[_0xf1a8('0x22')](_0x3442d5[_0xf1a8('0x21')],function(_0x1d4cc9){return{'model':db[_0x1d4cc9['model']],'as':_0x1d4cc9['as'],'attributes':_0x1d4cc9[_0xf1a8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf1a8('0xf')](function(_0x5d55b5){logger[_0xf1a8('0x10')](_0xf1a8('0x25'),_0x3eaca9);logger['debug'](_0xf1a8('0x25'),_0x3eaca9,JSON[_0xf1a8('0x13')](_0x5d55b5));_0x1fb6bb(_0x5d55b5);})['catch'](function(_0x1e89fc){logger[_0xf1a8('0x14')](_0xf1a8('0x25'),_0x1e89fc[_0xf1a8('0x17')],_0x3eaca9);_0x35dae3(_0x3cb923['error'](0x1f4,_0x1e89fc[_0xf1a8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 589993c..0e8e55d 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 73fac53..72dfaba 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5114a1c..91c4534 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 _0xdfb8=['sequelize','STRING','DATE','moment'];(function(_0x68602,_0x4cfb8d){var _0x690b25=function(_0x5bdeab){while(--_0x5bdeab){_0x68602['push'](_0x68602['shift']());}};_0x690b25(++_0x4cfb8d);}(_0xdfb8,0x113));var _0x8dfb=function(_0xdea1ee,_0x2d2841){_0xdea1ee=_0xdea1ee-0x0;var _0x96c530=_0xdfb8[_0xdea1ee];return _0x96c530;};'use strict';var moment=require(_0x8dfb('0x0'));var Sequelize=require(_0x8dfb('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8dfb('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8dfb('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8dfb('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfbf3=['exports','STRING','DATE','moment','sequelize'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xfbf3,0xc1));var _0x3fbf=function(_0x45b4dc,_0x42da14){_0x45b4dc=_0x45b4dc-0x0;var _0x3062c7=_0xfbf3[_0x45b4dc];return _0x3062c7;};'use strict';var moment=require(_0x3fbf('0x0'));var Sequelize=require(_0x3fbf('0x1'));module[_0x3fbf('0x2')]={'uniqueid':{'type':Sequelize[_0x3fbf('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3fbf('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3fbf('0x4')]},'exitAt':{'type':Sequelize[_0x3fbf('0x4')]},'reason':{'type':Sequelize[_0x3fbf('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 21770a3..2f9012c 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 _0xef0f=['../../config/environment','../../mysqldb','status','end','json','limit','apply','save','then','destroy','sendStatus','error','stack','send','index','OpenchannelQueueReport','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','key','field','options','count','includeAll','include','rows','show','params','rawAttributes','length','find','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0xef0f,0x75));var _0xfef0=function(_0x2acfdf,_0x44599a){_0x2acfdf=_0x2acfdf-0x0;var _0x4b3fa9=_0xef0f[_0x2acfdf];return _0x4b3fa9;};'use strict';var pdf=require(_0xfef0('0x0'));var emlformat=require(_0xfef0('0x1'));var rimraf=require(_0xfef0('0x2'));var zipdir=require(_0xfef0('0x3'));var jsonpatch=require(_0xfef0('0x4'));var rp=require(_0xfef0('0x5'));var moment=require(_0xfef0('0x6'));var BPromise=require(_0xfef0('0x7'));var Mustache=require('mustache');var util=require(_0xfef0('0x8'));var path=require(_0xfef0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfef0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfef0('0xb'));var jsforce=require(_0xfef0('0xc'));var deskjs=require(_0xfef0('0xd'));var toCsv=require(_0xfef0('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfef0('0xf'));var authService=require(_0xfef0('0x10'));var qs=require(_0xfef0('0x11'));var hardwareService=require(_0xfef0('0x12'));var logger=require(_0xfef0('0x13'))('api');var utils=require(_0xfef0('0x14'));var config=require(_0xfef0('0x15'));var db=require(_0xfef0('0x16'))['db'];function respondWithStatusCode(_0x3c87f9,_0x32a397){_0x32a397=_0x32a397||0xcc;return function(_0x56fcc1){if(_0x56fcc1){return _0x3c87f9['sendStatus'](_0x32a397);}return _0x3c87f9[_0xfef0('0x17')](_0x32a397)[_0xfef0('0x18')]();};}function respondWithResult(_0x30383f,_0x4c661f){_0x4c661f=_0x4c661f||0xc8;return function(_0x58ffac){if(_0x58ffac){return _0x30383f['status'](_0x4c661f)[_0xfef0('0x19')](_0x58ffac);}};}function respondWithFilteredResult(_0x2c1a01,_0x5a8ba9){return function(_0x1284aa){if(_0x1284aa){var _0x2630cb=_0x1284aa['count'],_0x297ea9=_0x5a8ba9['offset'],_0x3c0399=_0x5a8ba9['offset']+_0x5a8ba9[_0xfef0('0x1a')],_0x444fe7;if(_0x3c0399>=_0x2630cb){_0x3c0399=_0x2630cb;_0x444fe7=0xc8;}else{_0x444fe7=0xce;}_0x2c1a01[_0xfef0('0x17')](_0x444fe7);return _0x2c1a01['set']('Content-Range',_0x297ea9+'-'+_0x3c0399+'/'+_0x2630cb)[_0xfef0('0x19')](_0x1284aa);}return null;};}function patchUpdates(_0x54261d){return function(_0x5efbd9){try{jsonpatch[_0xfef0('0x1b')](_0x5efbd9,_0x54261d,!![]);}catch(_0x4e2fda){return BPromise['reject'](_0x4e2fda);}return _0x5efbd9[_0xfef0('0x1c')]();};}function saveUpdates(_0x4e0511,_0x53a6ea){return function(_0x310375){if(_0x310375){return _0x310375['update'](_0x4e0511)[_0xfef0('0x1d')](function(_0x45e611){return _0x45e611;});}return null;};}function removeEntity(_0xf7735,_0x34fabb){return function(_0x2cdf40){if(_0x2cdf40){return _0x2cdf40[_0xfef0('0x1e')]()['then'](function(){_0xf7735[_0xfef0('0x17')](0xcc)[_0xfef0('0x18')]();});}};}function handleEntityNotFound(_0x218b86,_0x5ed001){return function(_0x41fed8){if(!_0x41fed8){_0x218b86[_0xfef0('0x1f')](0x194);}return _0x41fed8;};}function handleError(_0x4307cf,_0x36a7a6){_0x36a7a6=_0x36a7a6||0x1f4;return function(_0x568d34){logger[_0xfef0('0x20')](_0x568d34[_0xfef0('0x21')]);if(_0x568d34['name']){delete _0x568d34['name'];}_0x4307cf[_0xfef0('0x17')](_0x36a7a6)[_0xfef0('0x22')](_0x568d34);};}exports[_0xfef0('0x23')]=function(_0x3a86d5,_0x1b41ae){var _0x39c71a={},_0xce69df={},_0x17fb80={'count':0x0,'rows':[]};var _0x310c3d=db[_0xfef0('0x24')]['rawAttributes'];_0xce69df[_0xfef0('0x25')]=_['keys'](_0x310c3d);_0xce69df[_0xfef0('0x26')]=_[_0xfef0('0x27')](_0x3a86d5[_0xfef0('0x26')]);_0xce69df[_0xfef0('0x28')]=_[_0xfef0('0x29')](_0xce69df[_0xfef0('0x25')],_0xce69df['query']);_0x39c71a['attributes']=_[_0xfef0('0x29')](_0xce69df[_0xfef0('0x25')],qs[_0xfef0('0x2a')](_0x3a86d5[_0xfef0('0x26')][_0xfef0('0x2a')]));_0x39c71a[_0xfef0('0x2b')]=_0x39c71a['attributes']['length']?_0x39c71a['attributes']:_0xce69df[_0xfef0('0x25')];if(!_0x3a86d5[_0xfef0('0x26')][_0xfef0('0x2c')](_0xfef0('0x2d'))){_0x39c71a[_0xfef0('0x1a')]=qs[_0xfef0('0x1a')](_0x3a86d5[_0xfef0('0x26')]['limit']);_0x39c71a['offset']=qs[_0xfef0('0x2e')](_0x3a86d5['query'][_0xfef0('0x2e')]);}_0x39c71a[_0xfef0('0x2f')]=qs[_0xfef0('0x30')](_0x3a86d5['query'][_0xfef0('0x30')]);_0x39c71a[_0xfef0('0x31')]=qs[_0xfef0('0x28')](_[_0xfef0('0x32')](_0x3a86d5[_0xfef0('0x26')],_0xce69df['filters']));if(_0x3a86d5[_0xfef0('0x26')][_0xfef0('0x33')]){_0x39c71a[_0xfef0('0x31')]=_[_0xfef0('0x34')](_0x39c71a[_0xfef0('0x31')],{'$or':_['map'](_0x310c3d,function(_0x44e1e7){if(_0x44e1e7[_0xfef0('0x35')][_0xfef0('0x36')]!=='VIRTUAL'){var _0x15fed2={};_0x15fed2[_0x44e1e7[_0xfef0('0x37')]]={'$like':'%'+_0x3a86d5[_0xfef0('0x26')][_0xfef0('0x33')]+'%'};return _0x15fed2;}})});}_0x39c71a=_['merge']({},_0x39c71a,_0x3a86d5[_0xfef0('0x38')]);var _0x3112dc={'where':_0x39c71a[_0xfef0('0x31')]};return db['OpenchannelQueueReport']['count'](_0x3112dc)[_0xfef0('0x1d')](function(_0x43295b){_0x17fb80[_0xfef0('0x39')]=_0x43295b;if(_0x3a86d5['query'][_0xfef0('0x3a')]){_0x39c71a[_0xfef0('0x3b')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x39c71a);})[_0xfef0('0x1d')](function(_0x2fb22e){_0x17fb80[_0xfef0('0x3c')]=_0x2fb22e;return _0x17fb80;})[_0xfef0('0x1d')](respondWithFilteredResult(_0x1b41ae,_0x39c71a))['catch'](handleError(_0x1b41ae,null));};exports[_0xfef0('0x3d')]=function(_0x3b1e2b,_0x41f7e3){var _0x36e10d={'raw':!![],'where':{'id':_0x3b1e2b[_0xfef0('0x3e')]['id']}},_0x175620={};_0x175620['model']=_[_0xfef0('0x27')](db['OpenchannelQueueReport'][_0xfef0('0x3f')]);_0x175620[_0xfef0('0x26')]=_[_0xfef0('0x27')](_0x3b1e2b[_0xfef0('0x26')]);_0x175620['filters']=_[_0xfef0('0x29')](_0x175620['model'],_0x175620[_0xfef0('0x26')]);_0x36e10d[_0xfef0('0x2b')]=_[_0xfef0('0x29')](_0x175620['model'],qs[_0xfef0('0x2a')](_0x3b1e2b[_0xfef0('0x26')][_0xfef0('0x2a')]));_0x36e10d[_0xfef0('0x2b')]=_0x36e10d[_0xfef0('0x2b')][_0xfef0('0x40')]?_0x36e10d['attributes']:_0x175620[_0xfef0('0x25')];if(_0x3b1e2b[_0xfef0('0x26')]['includeAll']){_0x36e10d[_0xfef0('0x3b')]=[{'all':!![]}];}_0x36e10d=_[_0xfef0('0x34')]({},_0x36e10d,_0x3b1e2b[_0xfef0('0x38')]);return db[_0xfef0('0x24')][_0xfef0('0x41')](_0x36e10d)[_0xfef0('0x1d')](handleEntityNotFound(_0x41f7e3,null))[_0xfef0('0x1d')](respondWithResult(_0x41f7e3,null))[_0xfef0('0x42')](handleError(_0x41f7e3,null));};exports['create']=function(_0x5372f0,_0x59cbed){return db[_0xfef0('0x24')]['create'](_0x5372f0['body'],{})['then'](respondWithResult(_0x59cbed,0xc9))[_0xfef0('0x42')](handleError(_0x59cbed,null));};exports['update']=function(_0x5b98d1,_0x2d1a2d){if(_0x5b98d1[_0xfef0('0x43')]['id']){delete _0x5b98d1['body']['id'];}return db[_0xfef0('0x24')][_0xfef0('0x41')]({'where':{'id':_0x5b98d1[_0xfef0('0x3e')]['id']}})[_0xfef0('0x1d')](handleEntityNotFound(_0x2d1a2d,null))[_0xfef0('0x1d')](saveUpdates(_0x5b98d1[_0xfef0('0x43')],null))[_0xfef0('0x1d')](respondWithResult(_0x2d1a2d,null))[_0xfef0('0x42')](handleError(_0x2d1a2d,null));};exports[_0xfef0('0x1e')]=function(_0x8e1c6b,_0x4f32c6){return db[_0xfef0('0x24')][_0xfef0('0x41')]({'where':{'id':_0x8e1c6b[_0xfef0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4f32c6,null))[_0xfef0('0x1d')](removeEntity(_0x4f32c6,null))['catch'](handleError(_0x4f32c6,null));};exports[_0xfef0('0x44')]=function(_0x2d8ea3,_0x251340){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0x251340,null))[_0xfef0('0x42')](handleError(_0x251340,null));}; \ No newline at end of file +var _0x2cba=['keys','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','merge','where','map','type','VIRTUAL','OpenchannelQueueReport','include','findAll','rows','catch','show','params','includeAll','options','create','body','destroy','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','save','update','then','error','stack','name','index','rawAttributes','model'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2cba,0xa1));var _0xa2cb=function(_0x4b8c03,_0x3085d2){_0x4b8c03=_0x4b8c03-0x0;var _0x5ceb74=_0x2cba[_0x4b8c03];return _0x5ceb74;};'use strict';var pdf=require(_0xa2cb('0x0'));var emlformat=require(_0xa2cb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa2cb('0x2'));var jsonpatch=require(_0xa2cb('0x3'));var rp=require(_0xa2cb('0x4'));var moment=require('moment');var BPromise=require(_0xa2cb('0x5'));var Mustache=require('mustache');var util=require(_0xa2cb('0x6'));var path=require('path');var sox=require(_0xa2cb('0x7'));var csv=require(_0xa2cb('0x8'));var ejs=require(_0xa2cb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2cb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2cb('0xb'));var toCsv=require(_0xa2cb('0x8'));var querystring=require(_0xa2cb('0xc'));var Papa=require('papaparse');var Redis=require(_0xa2cb('0xd'));var authService=require(_0xa2cb('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa2cb('0xf'));var logger=require('../../config/logger')(_0xa2cb('0x10'));var utils=require(_0xa2cb('0x11'));var config=require(_0xa2cb('0x12'));var db=require(_0xa2cb('0x13'))['db'];function respondWithStatusCode(_0x225eb6,_0x3e7e71){_0x3e7e71=_0x3e7e71||0xcc;return function(_0x489ee9){if(_0x489ee9){return _0x225eb6['sendStatus'](_0x3e7e71);}return _0x225eb6[_0xa2cb('0x14')](_0x3e7e71)[_0xa2cb('0x15')]();};}function respondWithResult(_0x2f9651,_0x197a4f){_0x197a4f=_0x197a4f||0xc8;return function(_0x4e2d13){if(_0x4e2d13){return _0x2f9651['status'](_0x197a4f)['json'](_0x4e2d13);}};}function respondWithFilteredResult(_0x3c0f54,_0x24a014){return function(_0x1ee3a9){if(_0x1ee3a9){var _0x3e4be4=_0x1ee3a9[_0xa2cb('0x16')],_0x3664c9=_0x24a014[_0xa2cb('0x17')],_0x46c771=_0x24a014[_0xa2cb('0x17')]+_0x24a014[_0xa2cb('0x18')],_0x21ec7c;if(_0x46c771>=_0x3e4be4){_0x46c771=_0x3e4be4;_0x21ec7c=0xc8;}else{_0x21ec7c=0xce;}_0x3c0f54[_0xa2cb('0x14')](_0x21ec7c);return _0x3c0f54[_0xa2cb('0x19')]('Content-Range',_0x3664c9+'-'+_0x46c771+'/'+_0x3e4be4)[_0xa2cb('0x1a')](_0x1ee3a9);}return null;};}function patchUpdates(_0xa8caea){return function(_0x2d7d45){try{jsonpatch[_0xa2cb('0x1b')](_0x2d7d45,_0xa8caea,!![]);}catch(_0x17655a){return BPromise['reject'](_0x17655a);}return _0x2d7d45[_0xa2cb('0x1c')]();};}function saveUpdates(_0x403ad1,_0x5133a2){return function(_0x132fa4){if(_0x132fa4){return _0x132fa4[_0xa2cb('0x1d')](_0x403ad1)['then'](function(_0x3f5c67){return _0x3f5c67;});}return null;};}function removeEntity(_0x14a7c4,_0x4ea0de){return function(_0x4c4036){if(_0x4c4036){return _0x4c4036['destroy']()[_0xa2cb('0x1e')](function(){_0x14a7c4[_0xa2cb('0x14')](0xcc)[_0xa2cb('0x15')]();});}};}function handleEntityNotFound(_0x2d4a1c,_0x33fa04){return function(_0x27d763){if(!_0x27d763){_0x2d4a1c['sendStatus'](0x194);}return _0x27d763;};}function handleError(_0x5ee055,_0x4e58ba){_0x4e58ba=_0x4e58ba||0x1f4;return function(_0x191a73){logger[_0xa2cb('0x1f')](_0x191a73[_0xa2cb('0x20')]);if(_0x191a73[_0xa2cb('0x21')]){delete _0x191a73[_0xa2cb('0x21')];}_0x5ee055[_0xa2cb('0x14')](_0x4e58ba)['send'](_0x191a73);};}exports[_0xa2cb('0x22')]=function(_0x327e3e,_0x1d1f22){var _0x349226={},_0x2ceefc={},_0x46b097={'count':0x0,'rows':[]};var _0x4750c1=db['OpenchannelQueueReport'][_0xa2cb('0x23')];_0x2ceefc[_0xa2cb('0x24')]=_[_0xa2cb('0x25')](_0x4750c1);_0x2ceefc['query']=_[_0xa2cb('0x25')](_0x327e3e[_0xa2cb('0x26')]);_0x2ceefc[_0xa2cb('0x27')]=_['intersection'](_0x2ceefc[_0xa2cb('0x24')],_0x2ceefc[_0xa2cb('0x26')]);_0x349226[_0xa2cb('0x28')]=_[_0xa2cb('0x29')](_0x2ceefc['model'],qs[_0xa2cb('0x2a')](_0x327e3e['query'][_0xa2cb('0x2a')]));_0x349226[_0xa2cb('0x28')]=_0x349226[_0xa2cb('0x28')]['length']?_0x349226[_0xa2cb('0x28')]:_0x2ceefc[_0xa2cb('0x24')];if(!_0x327e3e[_0xa2cb('0x26')]['hasOwnProperty'](_0xa2cb('0x2b'))){_0x349226['limit']=qs[_0xa2cb('0x18')](_0x327e3e[_0xa2cb('0x26')]['limit']);_0x349226[_0xa2cb('0x17')]=qs[_0xa2cb('0x17')](_0x327e3e[_0xa2cb('0x26')][_0xa2cb('0x17')]);}_0x349226[_0xa2cb('0x2c')]=qs[_0xa2cb('0x2d')](_0x327e3e[_0xa2cb('0x26')]['sort']);_0x349226['where']=qs['filters'](_['pick'](_0x327e3e[_0xa2cb('0x26')],_0x2ceefc[_0xa2cb('0x27')]));if(_0x327e3e[_0xa2cb('0x26')][_0xa2cb('0x2e')]){_0x349226['where']=_[_0xa2cb('0x2f')](_0x349226[_0xa2cb('0x30')],{'$or':_[_0xa2cb('0x31')](_0x4750c1,function(_0x436eae){if(_0x436eae[_0xa2cb('0x32')]['key']!==_0xa2cb('0x33')){var _0x3f6afc={};_0x3f6afc[_0x436eae['field']]={'$like':'%'+_0x327e3e['query'][_0xa2cb('0x2e')]+'%'};return _0x3f6afc;}})});}_0x349226=_[_0xa2cb('0x2f')]({},_0x349226,_0x327e3e['options']);var _0x11e7fc={'where':_0x349226[_0xa2cb('0x30')]};return db[_0xa2cb('0x34')]['count'](_0x11e7fc)['then'](function(_0xa8f4c6){_0x46b097[_0xa2cb('0x16')]=_0xa8f4c6;if(_0x327e3e['query']['includeAll']){_0x349226[_0xa2cb('0x35')]=[{'all':!![]}];}return db[_0xa2cb('0x34')][_0xa2cb('0x36')](_0x349226);})[_0xa2cb('0x1e')](function(_0x4ce1c5){_0x46b097[_0xa2cb('0x37')]=_0x4ce1c5;return _0x46b097;})[_0xa2cb('0x1e')](respondWithFilteredResult(_0x1d1f22,_0x349226))[_0xa2cb('0x38')](handleError(_0x1d1f22,null));};exports[_0xa2cb('0x39')]=function(_0x368ef9,_0x342990){var _0x3ffb76={'raw':!![],'where':{'id':_0x368ef9[_0xa2cb('0x3a')]['id']}},_0x16834f={};_0x16834f[_0xa2cb('0x24')]=_['keys'](db[_0xa2cb('0x34')]['rawAttributes']);_0x16834f['query']=_[_0xa2cb('0x25')](_0x368ef9[_0xa2cb('0x26')]);_0x16834f['filters']=_[_0xa2cb('0x29')](_0x16834f[_0xa2cb('0x24')],_0x16834f['query']);_0x3ffb76[_0xa2cb('0x28')]=_[_0xa2cb('0x29')](_0x16834f[_0xa2cb('0x24')],qs[_0xa2cb('0x2a')](_0x368ef9[_0xa2cb('0x26')]['fields']));_0x3ffb76[_0xa2cb('0x28')]=_0x3ffb76['attributes']['length']?_0x3ffb76[_0xa2cb('0x28')]:_0x16834f['model'];if(_0x368ef9[_0xa2cb('0x26')][_0xa2cb('0x3b')]){_0x3ffb76['include']=[{'all':!![]}];}_0x3ffb76=_[_0xa2cb('0x2f')]({},_0x3ffb76,_0x368ef9[_0xa2cb('0x3c')]);return db[_0xa2cb('0x34')]['find'](_0x3ffb76)[_0xa2cb('0x1e')](handleEntityNotFound(_0x342990,null))[_0xa2cb('0x1e')](respondWithResult(_0x342990,null))[_0xa2cb('0x38')](handleError(_0x342990,null));};exports['create']=function(_0x5ed6c1,_0x27fa3b){return db[_0xa2cb('0x34')][_0xa2cb('0x3d')](_0x5ed6c1[_0xa2cb('0x3e')],{})[_0xa2cb('0x1e')](respondWithResult(_0x27fa3b,0xc9))['catch'](handleError(_0x27fa3b,null));};exports[_0xa2cb('0x1d')]=function(_0xe9939,_0x4800ed){if(_0xe9939[_0xa2cb('0x3e')]['id']){delete _0xe9939[_0xa2cb('0x3e')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0xe9939[_0xa2cb('0x3a')]['id']}})[_0xa2cb('0x1e')](handleEntityNotFound(_0x4800ed,null))[_0xa2cb('0x1e')](saveUpdates(_0xe9939['body'],null))[_0xa2cb('0x1e')](respondWithResult(_0x4800ed,null))['catch'](handleError(_0x4800ed,null));};exports[_0xa2cb('0x3f')]=function(_0x8a5451,_0x158b9d){return db[_0xa2cb('0x34')][_0xa2cb('0x40')]({'where':{'id':_0x8a5451['params']['id']}})[_0xa2cb('0x1e')](handleEntityNotFound(_0x158b9d,null))[_0xa2cb('0x1e')](removeEntity(_0x158b9d,null))[_0xa2cb('0x38')](handleError(_0x158b9d,null));};exports[_0xa2cb('0x41')]=function(_0x51bfdb,_0x5c0a86){return db['OpenchannelQueueReport'][_0xa2cb('0x41')]()[_0xa2cb('0x1e')](respondWithResult(_0x5c0a86,null))[_0xa2cb('0x38')](handleError(_0x5c0a86,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index db859b5..da534d7 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 _0xb18e=['./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x3fa264,_0xed4e31){var _0x338cf7=function(_0x1721e7){while(--_0x1721e7){_0x3fa264['push'](_0x3fa264['shift']());}};_0x338cf7(++_0xed4e31);}(_0xb18e,0x181));var _0xeb18=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0xb18e[_0xccf869];return _0x21a9db;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb18('0x0'))('api');var moment=require(_0xeb18('0x1'));var BPromise=require('bluebird');var rp=require(_0xeb18('0x2'));var fs=require('fs');var path=require(_0xeb18('0x3'));var rimraf=require('rimraf');var config=require(_0xeb18('0x4'));var attributes=require(_0xeb18('0x5'));module[_0xeb18('0x6')]=function(_0x409efb,_0x46d281){return _0x409efb[_0xeb18('0x7')]('OpenchannelQueueReport',attributes,{'tableName':_0xeb18('0x8'),'paranoid':![],'indexes':[{'name':_0xeb18('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x032e=['./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2b1cf5,_0x1efa4e){var _0x23f4ea=function(_0x28fbd3){while(--_0x28fbd3){_0x2b1cf5['push'](_0x2b1cf5['shift']());}};_0x23f4ea(++_0x1efa4e);}(_0x032e,0x124));var _0xe032=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x032e[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var logger=require(_0xe032('0x1'))(_0xe032('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe032('0x3'));var fs=require('fs');var path=require(_0xe032('0x4'));var rimraf=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var attributes=require(_0xe032('0x7'));module[_0xe032('0x8')]=function(_0x2ba8a0,_0x33ad0b){return _0x2ba8a0[_0xe032('0x9')](_0xe032('0xa'),attributes,{'tableName':_0xe032('0xb'),'paranoid':![],'indexes':[{'name':_0xe032('0xc'),'fields':[_0xe032('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 82f5a64..448ef1a 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 _0xf6f2=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','update','limit','UpdateOpenchannelQueueReport','lodash','moment'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xf6f2,0x1b0));var _0x2f6f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf6f2[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2f6f('0x0'));var util=require('util');var moment=require(_0x2f6f('0x1'));var BPromise=require(_0x2f6f('0x2'));var rs=require(_0x2f6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2f6f('0x5'));var config=require(_0x2f6f('0x6'));var jayson=require(_0x2f6f('0x7'));var client=jayson[_0x2f6f('0x8')][_0x2f6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x390e86,_0x4cb834,_0x42b4e1){return new BPromise(function(_0x569bbb,_0x2d56dc){return client[_0x2f6f('0xa')](_0x390e86,_0x42b4e1)[_0x2f6f('0xb')](function(_0x337aaf){logger[_0x2f6f('0xc')](_0x2f6f('0xd'),_0x4cb834,_0x2f6f('0xe'));logger[_0x2f6f('0xf')](_0x2f6f('0x10'),_0x4cb834,_0x2f6f('0xe'),JSON[_0x2f6f('0x11')](_0x337aaf));if(_0x337aaf[_0x2f6f('0x12')]){if(_0x337aaf[_0x2f6f('0x12')][_0x2f6f('0x13')]===0x1f4){logger[_0x2f6f('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4cb834,_0x337aaf[_0x2f6f('0x12')][_0x2f6f('0x14')]);return _0x2d56dc(_0x337aaf[_0x2f6f('0x12')][_0x2f6f('0x14')]);}logger[_0x2f6f('0x12')](_0x2f6f('0xd'),_0x4cb834,_0x337aaf[_0x2f6f('0x12')][_0x2f6f('0x14')]);return _0x569bbb(_0x337aaf[_0x2f6f('0x12')][_0x2f6f('0x14')]);}else{logger[_0x2f6f('0xc')](_0x2f6f('0xd'),_0x4cb834,_0x2f6f('0xe'));_0x569bbb(_0x337aaf[_0x2f6f('0x15')][_0x2f6f('0x14')]);}})[_0x2f6f('0x16')](function(_0x1a2f17){logger[_0x2f6f('0x12')](_0x2f6f('0xd'),_0x4cb834,_0x1a2f17);_0x2d56dc(_0x1a2f17);});});}exports[_0x2f6f('0x17')]=function(_0x4b3dbf){var _0x4dacbd=this;return new Promise(function(_0x5cdc01,_0x86ee7e){return db['OpenchannelQueueReport'][_0x2f6f('0x18')](_0x4b3dbf[_0x2f6f('0x19')],{'raw':_0x4b3dbf[_0x2f6f('0x1a')]?_0x4b3dbf[_0x2f6f('0x1a')][_0x2f6f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x58cd21){logger[_0x2f6f('0xc')]('CreateOpenchannelQueueReport',_0x4b3dbf);logger[_0x2f6f('0xf')](_0x2f6f('0x17'),_0x4b3dbf,JSON['stringify'](_0x58cd21));_0x5cdc01(_0x58cd21);})[_0x2f6f('0x16')](function(_0x313b74){logger[_0x2f6f('0x12')](_0x2f6f('0x17'),_0x313b74[_0x2f6f('0x14')],_0x4b3dbf);_0x86ee7e(_0x4dacbd[_0x2f6f('0x12')](0x1f4,_0x313b74['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2ef21f){var _0x2fb86e=this;return new Promise(function(_0x44cbd6,_0x40756d){return db['OpenchannelQueueReport'][_0x2f6f('0x1c')](_0x2ef21f[_0x2f6f('0x19')],{'raw':_0x2ef21f[_0x2f6f('0x1a')]?_0x2ef21f[_0x2f6f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef21f[_0x2f6f('0x1a')]?_0x2ef21f[_0x2f6f('0x1a')]['where']||null:null,'attributes':_0x2ef21f[_0x2f6f('0x1a')]?_0x2ef21f[_0x2f6f('0x1a')]['attributes']||null:null,'limit':_0x2ef21f[_0x2f6f('0x1a')]?_0x2ef21f[_0x2f6f('0x1a')][_0x2f6f('0x1d')]||null:null})[_0x2f6f('0xb')](function(_0x4d5694){logger[_0x2f6f('0xc')](_0x2f6f('0x1e'),_0x2ef21f);logger[_0x2f6f('0xf')]('UpdateOpenchannelQueueReport',_0x2ef21f,JSON['stringify'](_0x4d5694));_0x44cbd6(_0x4d5694);})[_0x2f6f('0x16')](function(_0x337669){logger[_0x2f6f('0x12')](_0x2f6f('0x1e'),_0x337669[_0x2f6f('0x14')],_0x2ef21f);_0x40756d(_0x2fb86e['error'](0x1f4,_0x337669[_0x2f6f('0x14')]));});});}; \ No newline at end of file +var _0xbb70=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','create','body','options','raw','CreateOpenchannelQueueReport','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','lodash','util','moment','bluebird'];(function(_0xd72b72,_0x4784c7){var _0x4823ac=function(_0x109753){while(--_0x109753){_0xd72b72['push'](_0xd72b72['shift']());}};_0x4823ac(++_0x4784c7);}(_0xbb70,0x19c));var _0x0bb7=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xbb70[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x0bb7('0x0'));var util=require(_0x0bb7('0x1'));var moment=require(_0x0bb7('0x2'));var BPromise=require(_0x0bb7('0x3'));var rs=require(_0x0bb7('0x4'));var fs=require('fs');var Redis=require(_0x0bb7('0x5'));var db=require(_0x0bb7('0x6'))['db'];var utils=require(_0x0bb7('0x7'));var logger=require(_0x0bb7('0x8'))('rpc');var config=require(_0x0bb7('0x9'));var jayson=require(_0x0bb7('0xa'));var client=jayson[_0x0bb7('0xb')][_0x0bb7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2aa8da,_0x5e7f88,_0xf790fa){return new BPromise(function(_0x358f12,_0xd5bda7){return client[_0x0bb7('0xd')](_0x2aa8da,_0xf790fa)[_0x0bb7('0xe')](function(_0x23b401){logger['info'](_0x0bb7('0xf'),_0x5e7f88,_0x0bb7('0x10'));logger[_0x0bb7('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x5e7f88,_0x0bb7('0x10'),JSON[_0x0bb7('0x12')](_0x23b401));if(_0x23b401[_0x0bb7('0x13')]){if(_0x23b401['error']['code']===0x1f4){logger[_0x0bb7('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5e7f88,_0x23b401[_0x0bb7('0x13')]['message']);return _0xd5bda7(_0x23b401[_0x0bb7('0x13')][_0x0bb7('0x14')]);}logger[_0x0bb7('0x13')](_0x0bb7('0xf'),_0x5e7f88,_0x23b401[_0x0bb7('0x13')]['message']);return _0x358f12(_0x23b401[_0x0bb7('0x13')][_0x0bb7('0x14')]);}else{logger[_0x0bb7('0x15')](_0x0bb7('0xf'),_0x5e7f88,_0x0bb7('0x10'));_0x358f12(_0x23b401['result'][_0x0bb7('0x14')]);}})['catch'](function(_0x4f1d99){logger[_0x0bb7('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5e7f88,_0x4f1d99);_0xd5bda7(_0x4f1d99);});});}exports['CreateOpenchannelQueueReport']=function(_0x3a8ce9){var _0x27c9d5=this;return new Promise(function(_0x30ae65,_0x27f96b){return db['OpenchannelQueueReport'][_0x0bb7('0x16')](_0x3a8ce9[_0x0bb7('0x17')],{'raw':_0x3a8ce9[_0x0bb7('0x18')]?_0x3a8ce9[_0x0bb7('0x18')][_0x0bb7('0x19')]===undefined?!![]:![]:!![]})[_0x0bb7('0xe')](function(_0x348ea1){logger[_0x0bb7('0x15')](_0x0bb7('0x1a'),_0x3a8ce9);logger['debug'](_0x0bb7('0x1a'),_0x3a8ce9,JSON['stringify'](_0x348ea1));_0x30ae65(_0x348ea1);})[_0x0bb7('0x1b')](function(_0x3a0f40){logger[_0x0bb7('0x13')]('CreateOpenchannelQueueReport',_0x3a0f40['message'],_0x3a8ce9);_0x27f96b(_0x27c9d5[_0x0bb7('0x13')](0x1f4,_0x3a0f40[_0x0bb7('0x14')]));});});};exports[_0x0bb7('0x1c')]=function(_0x47e1ab){var _0x110567=this;return new Promise(function(_0xeedd8c,_0x580d9a){return db[_0x0bb7('0x1d')]['update'](_0x47e1ab[_0x0bb7('0x17')],{'raw':_0x47e1ab[_0x0bb7('0x18')]?_0x47e1ab[_0x0bb7('0x18')][_0x0bb7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47e1ab[_0x0bb7('0x18')]?_0x47e1ab[_0x0bb7('0x18')][_0x0bb7('0x1e')]||null:null,'attributes':_0x47e1ab[_0x0bb7('0x18')]?_0x47e1ab[_0x0bb7('0x18')][_0x0bb7('0x1f')]||null:null,'limit':_0x47e1ab['options']?_0x47e1ab['options']['limit']||null:null})[_0x0bb7('0xe')](function(_0x2ba5ff){logger['info'](_0x0bb7('0x1c'),_0x47e1ab);logger[_0x0bb7('0x11')](_0x0bb7('0x1c'),_0x47e1ab,JSON[_0x0bb7('0x12')](_0x2ba5ff));_0xeedd8c(_0x2ba5ff);})[_0x0bb7('0x1b')](function(_0x277fad){logger[_0x0bb7('0x13')](_0x0bb7('0x1c'),_0x277fad[_0x0bb7('0x14')],_0x47e1ab);_0x580d9a(_0x110567['error'](0x1f4,_0x277fad[_0x0bb7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cf54e88..acd8f94 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 _0x9a11=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3a26be,_0x5980e4){var _0x199a1a=function(_0x5737b8){while(--_0x5737b8){_0x3a26be['push'](_0x3a26be['shift']());}};_0x199a1a(++_0x5980e4);}(_0x9a11,0x8f));var _0x19a1=function(_0x4a2a52,_0x252f1a){_0x4a2a52=_0x4a2a52-0x0;var _0x59a43b=_0x9a11[_0x4a2a52];return _0x59a43b;};'use strict';var multer=require(_0x19a1('0x0'));var util=require('util');var path=require(_0x19a1('0x1'));var timeout=require(_0x19a1('0x2'));var express=require(_0x19a1('0x3'));var router=express[_0x19a1('0x4')]();var auth=require(_0x19a1('0x5'));var interaction=require(_0x19a1('0x6'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x19a1('0x7')]('/',auth[_0x19a1('0x8')](),controller[_0x19a1('0x9')]);router[_0x19a1('0x7')](_0x19a1('0xa'),auth['isAuthenticated'](),controller[_0x19a1('0xb')]);router[_0x19a1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x19a1('0xc')]);router[_0x19a1('0xd')]('/',auth['isAuthenticated'](),controller[_0x19a1('0xe')]);router[_0x19a1('0xf')](_0x19a1('0x10'),auth[_0x19a1('0x8')](),controller[_0x19a1('0x11')]);router[_0x19a1('0x12')](_0x19a1('0x10'),auth['isAuthenticated'](),controller[_0x19a1('0x13')]);module[_0x19a1('0x14')]=router; \ No newline at end of file +var _0x43da=['util','path','connect-timeout','Router','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x43da,0xd7));var _0xa43d=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x43da[_0x576170];return _0x397c70;};'use strict';var multer=require(_0xa43d('0x0'));var util=require(_0xa43d('0x1'));var path=require(_0xa43d('0x2'));var timeout=require(_0xa43d('0x3'));var express=require('express');var router=express[_0xa43d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa43d('0x5'));var controller=require(_0xa43d('0x6'));router['get']('/',auth[_0xa43d('0x7')](),controller['index']);router[_0xa43d('0x8')](_0xa43d('0x9'),auth[_0xa43d('0x7')](),controller['describe']);router['get'](_0xa43d('0xa'),auth[_0xa43d('0x7')](),controller['show']);router[_0xa43d('0xb')]('/',auth[_0xa43d('0x7')](),controller[_0xa43d('0xc')]);router[_0xa43d('0xd')](_0xa43d('0xa'),auth[_0xa43d('0x7')](),controller[_0xa43d('0xe')]);router[_0xa43d('0xf')](_0xa43d('0xa'),auth[_0xa43d('0x7')](),controller[_0xa43d('0x10')]);module[_0xa43d('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 7feeee8..62f11f4 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 _0x17ff=['queue','DATE','NOW','moment','sequelize','account','agent'];(function(_0x46d364,_0xe46e5f){var _0x381392=function(_0x5371f5){while(--_0x5371f5){_0x46d364['push'](_0x46d364['shift']());}};_0x381392(++_0xe46e5f);}(_0x17ff,0x122));var _0xf17f=function(_0x19b3ca,_0x24eb4a){_0x19b3ca=_0x19b3ca-0x0;var _0x123837=_0x17ff[_0x19b3ca];return _0x123837;};'use strict';var moment=require(_0xf17f('0x0'));var Sequelize=require(_0xf17f('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf17f('0x2'),_0xf17f('0x3'),'queue'),'allowNull':![],'defaultValue':_0xf17f('0x4')},'transferredAt':{'type':Sequelize[_0xf17f('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xf17f('0x6')]}}; \ No newline at end of file +var _0x215d=['agent','queue','NOW','exports','STRING','account'];(function(_0x315698,_0x1082ac){var _0x1bf316=function(_0x4c548a){while(--_0x4c548a){_0x315698['push'](_0x315698['shift']());}};_0x1bf316(++_0x1082ac);}(_0x215d,0x14d));var _0xd215=function(_0x20d584,_0x5a0735){_0x20d584=_0x20d584-0x0;var _0x247b41=_0x215d[_0x20d584];return _0x247b41;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd215('0x0')]={'uniqueid':{'type':Sequelize[_0xd215('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd215('0x2'),_0xd215('0x3'),_0xd215('0x4')),'allowNull':![],'defaultValue':_0xd215('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xd215('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4880063..9bc13b2 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 _0x3036=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4121c4,_0x487282){var _0xe6c94b=function(_0x4d8a30){while(--_0x4d8a30){_0x4121c4['push'](_0x4121c4['shift']());}};_0xe6c94b(++_0x487282);}(_0x3036,0x1a9));var _0x6303=function(_0x2c8dad,_0x1fc9ca){_0x2c8dad=_0x2c8dad-0x0;var _0x5b764a=_0x3036[_0x2c8dad];return _0x5b764a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6303('0x0'));var zipdir=require(_0x6303('0x1'));var jsonpatch=require(_0x6303('0x2'));var rp=require('request-promise');var moment=require(_0x6303('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6303('0x4'));var sox=require('sox');var csv=require(_0x6303('0x5'));var ejs=require(_0x6303('0x6'));var fs=require('fs');var _=require(_0x6303('0x7'));var squel=require('squel');var crypto=require(_0x6303('0x8'));var jsforce=require(_0x6303('0x9'));var deskjs=require(_0x6303('0xa'));var toCsv=require(_0x6303('0x5'));var querystring=require(_0x6303('0xb'));var Papa=require(_0x6303('0xc'));var Redis=require(_0x6303('0xd'));var authService=require(_0x6303('0xe'));var qs=require(_0x6303('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6303('0x10'))(_0x6303('0x11'));var utils=require(_0x6303('0x12'));var config=require(_0x6303('0x13'));var db=require(_0x6303('0x14'))['db'];function respondWithStatusCode(_0x530f24,_0x397582){_0x397582=_0x397582||0xcc;return function(_0xe6cee4){if(_0xe6cee4){return _0x530f24[_0x6303('0x15')](_0x397582);}return _0x530f24[_0x6303('0x16')](_0x397582)[_0x6303('0x17')]();};}function respondWithResult(_0x48462d,_0x5ef678){_0x5ef678=_0x5ef678||0xc8;return function(_0x5d75c1){if(_0x5d75c1){return _0x48462d[_0x6303('0x16')](_0x5ef678)[_0x6303('0x18')](_0x5d75c1);}};}function respondWithFilteredResult(_0x251995,_0x3e72aa){return function(_0x2bbc57){if(_0x2bbc57){var _0x43526d=_0x2bbc57['count'],_0x3395e0=_0x3e72aa['offset'],_0x2c4cbd=_0x3e72aa[_0x6303('0x19')]+_0x3e72aa[_0x6303('0x1a')],_0x13874f;if(_0x2c4cbd>=_0x43526d){_0x2c4cbd=_0x43526d;_0x13874f=0xc8;}else{_0x13874f=0xce;}_0x251995[_0x6303('0x16')](_0x13874f);return _0x251995[_0x6303('0x1b')](_0x6303('0x1c'),_0x3395e0+'-'+_0x2c4cbd+'/'+_0x43526d)['json'](_0x2bbc57);}return null;};}function patchUpdates(_0x30dcd2){return function(_0x1cdfd7){try{jsonpatch[_0x6303('0x1d')](_0x1cdfd7,_0x30dcd2,!![]);}catch(_0x397b97){return BPromise[_0x6303('0x1e')](_0x397b97);}return _0x1cdfd7[_0x6303('0x1f')]();};}function saveUpdates(_0x3cc5e4,_0x1211b4){return function(_0x223d91){if(_0x223d91){return _0x223d91[_0x6303('0x20')](_0x3cc5e4)[_0x6303('0x21')](function(_0x4e591d){return _0x4e591d;});}return null;};}function removeEntity(_0x579acb,_0x2ee9bb){return function(_0x344dd4){if(_0x344dd4){return _0x344dd4[_0x6303('0x22')]()[_0x6303('0x21')](function(){_0x579acb['status'](0xcc)[_0x6303('0x17')]();});}};}function handleEntityNotFound(_0x3e2a0c,_0x2872e8){return function(_0x18b80a){if(!_0x18b80a){_0x3e2a0c[_0x6303('0x15')](0x194);}return _0x18b80a;};}function handleError(_0x21eec0,_0x213798){_0x213798=_0x213798||0x1f4;return function(_0x52de40){logger['error'](_0x52de40[_0x6303('0x23')]);if(_0x52de40[_0x6303('0x24')]){delete _0x52de40['name'];}_0x21eec0[_0x6303('0x16')](_0x213798)[_0x6303('0x25')](_0x52de40);};}exports[_0x6303('0x26')]=function(_0x53adbd,_0x1e7d33){var _0x45843f={},_0x389ff5={},_0x21b220={'count':0x0,'rows':[]};var _0x768494=db[_0x6303('0x27')][_0x6303('0x28')];_0x389ff5[_0x6303('0x29')]=_[_0x6303('0x2a')](_0x768494);_0x389ff5[_0x6303('0x2b')]=_[_0x6303('0x2a')](_0x53adbd['query']);_0x389ff5[_0x6303('0x2c')]=_['intersection'](_0x389ff5[_0x6303('0x29')],_0x389ff5['query']);_0x45843f['attributes']=_[_0x6303('0x2d')](_0x389ff5[_0x6303('0x29')],qs[_0x6303('0x2e')](_0x53adbd['query']['fields']));_0x45843f[_0x6303('0x2f')]=_0x45843f['attributes']['length']?_0x45843f[_0x6303('0x2f')]:_0x389ff5[_0x6303('0x29')];if(!_0x53adbd[_0x6303('0x2b')][_0x6303('0x30')](_0x6303('0x31'))){_0x45843f['limit']=qs[_0x6303('0x1a')](_0x53adbd[_0x6303('0x2b')][_0x6303('0x1a')]);_0x45843f['offset']=qs['offset'](_0x53adbd[_0x6303('0x2b')]['offset']);}_0x45843f[_0x6303('0x32')]=qs[_0x6303('0x33')](_0x53adbd[_0x6303('0x2b')][_0x6303('0x33')]);_0x45843f[_0x6303('0x34')]=qs['filters'](_[_0x6303('0x35')](_0x53adbd[_0x6303('0x2b')],_0x389ff5[_0x6303('0x2c')]));if(_0x53adbd[_0x6303('0x2b')][_0x6303('0x36')]){_0x45843f['where']=_[_0x6303('0x37')](_0x45843f[_0x6303('0x34')],{'$or':_[_0x6303('0x38')](_0x768494,function(_0x127fd5){if(_0x127fd5[_0x6303('0x39')]['key']!==_0x6303('0x3a')){var _0x5b99bb={};_0x5b99bb[_0x127fd5[_0x6303('0x3b')]]={'$like':'%'+_0x53adbd[_0x6303('0x2b')][_0x6303('0x36')]+'%'};return _0x5b99bb;}})});}_0x45843f=_['merge']({},_0x45843f,_0x53adbd['options']);var _0x7e2e9a={'where':_0x45843f['where']};return db[_0x6303('0x27')][_0x6303('0x3c')](_0x7e2e9a)[_0x6303('0x21')](function(_0x4eb2f5){_0x21b220['count']=_0x4eb2f5;if(_0x53adbd[_0x6303('0x2b')][_0x6303('0x3d')]){_0x45843f[_0x6303('0x3e')]=[{'all':!![]}];}return db[_0x6303('0x27')][_0x6303('0x3f')](_0x45843f);})[_0x6303('0x21')](function(_0x54861c){_0x21b220[_0x6303('0x40')]=_0x54861c;return _0x21b220;})['then'](respondWithFilteredResult(_0x1e7d33,_0x45843f))[_0x6303('0x41')](handleError(_0x1e7d33,null));};exports['show']=function(_0x1688d7,_0x44cd0c){var _0x2f4a2f={'raw':!![],'where':{'id':_0x1688d7['params']['id']}},_0x22b20e={};_0x22b20e[_0x6303('0x29')]=_['keys'](db[_0x6303('0x27')][_0x6303('0x28')]);_0x22b20e['query']=_[_0x6303('0x2a')](_0x1688d7[_0x6303('0x2b')]);_0x22b20e['filters']=_[_0x6303('0x2d')](_0x22b20e['model'],_0x22b20e[_0x6303('0x2b')]);_0x2f4a2f['attributes']=_['intersection'](_0x22b20e['model'],qs[_0x6303('0x2e')](_0x1688d7[_0x6303('0x2b')]['fields']));_0x2f4a2f['attributes']=_0x2f4a2f[_0x6303('0x2f')][_0x6303('0x42')]?_0x2f4a2f['attributes']:_0x22b20e[_0x6303('0x29')];if(_0x1688d7[_0x6303('0x2b')][_0x6303('0x3d')]){_0x2f4a2f[_0x6303('0x3e')]=[{'all':!![]}];}_0x2f4a2f=_['merge']({},_0x2f4a2f,_0x1688d7[_0x6303('0x43')]);return db[_0x6303('0x27')][_0x6303('0x44')](_0x2f4a2f)['then'](handleEntityNotFound(_0x44cd0c,null))[_0x6303('0x21')](respondWithResult(_0x44cd0c,null))[_0x6303('0x41')](handleError(_0x44cd0c,null));};exports[_0x6303('0x45')]=function(_0x2c19fd,_0x692daa){return db[_0x6303('0x27')]['create'](_0x2c19fd['body'],{})[_0x6303('0x21')](respondWithResult(_0x692daa,0xc9))[_0x6303('0x41')](handleError(_0x692daa,null));};exports['update']=function(_0x35cfaf,_0x40b40a){if(_0x35cfaf[_0x6303('0x46')]['id']){delete _0x35cfaf[_0x6303('0x46')]['id'];}return db['OpenchannelTransferReport'][_0x6303('0x44')]({'where':{'id':_0x35cfaf[_0x6303('0x47')]['id']}})[_0x6303('0x21')](handleEntityNotFound(_0x40b40a,null))[_0x6303('0x21')](saveUpdates(_0x35cfaf['body'],null))[_0x6303('0x21')](respondWithResult(_0x40b40a,null))[_0x6303('0x41')](handleError(_0x40b40a,null));};exports['destroy']=function(_0x31f0e7,_0x174121){return db[_0x6303('0x27')][_0x6303('0x44')]({'where':{'id':_0x31f0e7[_0x6303('0x47')]['id']}})[_0x6303('0x21')](handleEntityNotFound(_0x174121,null))[_0x6303('0x21')](removeEntity(_0x174121,null))[_0x6303('0x41')](handleError(_0x174121,null));};exports[_0x6303('0x48')]=function(_0x3e4dfc,_0x5b10c5){return db[_0x6303('0x27')][_0x6303('0x48')]()['then'](respondWithResult(_0x5b10c5,null))[_0x6303('0x41')](handleError(_0x5b10c5,null));}; \ No newline at end of file +var _0xb49a=['../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','error','name','index','OpenchannelTransferReport','rawAttributes','model','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','then','rows','catch','keys','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api'];(function(_0x29631f,_0xdb767){var _0x486d87=function(_0x33a1bb){while(--_0x33a1bb){_0x29631f['push'](_0x29631f['shift']());}};_0x486d87(++_0xdb767);}(_0xb49a,0xfb));var _0xab49=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0xb49a[_0x3b0912];return _0xa8f339;};'use strict';var pdf=require(_0xab49('0x0'));var emlformat=require(_0xab49('0x1'));var rimraf=require(_0xab49('0x2'));var zipdir=require(_0xab49('0x3'));var jsonpatch=require(_0xab49('0x4'));var rp=require('request-promise');var moment=require(_0xab49('0x5'));var BPromise=require(_0xab49('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab49('0x7'));var sox=require(_0xab49('0x8'));var csv=require(_0xab49('0x9'));var ejs=require(_0xab49('0xa'));var fs=require('fs');var _=require(_0xab49('0xb'));var squel=require(_0xab49('0xc'));var crypto=require(_0xab49('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab49('0xe'));var toCsv=require(_0xab49('0x9'));var querystring=require(_0xab49('0xf'));var Papa=require(_0xab49('0x10'));var Redis=require(_0xab49('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xab49('0x12'));var logger=require(_0xab49('0x13'))(_0xab49('0x14'));var utils=require(_0xab49('0x15'));var config=require(_0xab49('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1515d7,_0xdd380a){_0xdd380a=_0xdd380a||0xcc;return function(_0x34af0d){if(_0x34af0d){return _0x1515d7[_0xab49('0x17')](_0xdd380a);}return _0x1515d7[_0xab49('0x18')](_0xdd380a)[_0xab49('0x19')]();};}function respondWithResult(_0x11d285,_0x136f5f){_0x136f5f=_0x136f5f||0xc8;return function(_0x24b4ad){if(_0x24b4ad){return _0x11d285[_0xab49('0x18')](_0x136f5f)[_0xab49('0x1a')](_0x24b4ad);}};}function respondWithFilteredResult(_0x5ea744,_0xcd137f){return function(_0x38ee23){if(_0x38ee23){var _0x205b09=_0x38ee23[_0xab49('0x1b')],_0x9c59e1=_0xcd137f[_0xab49('0x1c')],_0x14d8b8=_0xcd137f[_0xab49('0x1c')]+_0xcd137f[_0xab49('0x1d')],_0x589dc4;if(_0x14d8b8>=_0x205b09){_0x14d8b8=_0x205b09;_0x589dc4=0xc8;}else{_0x589dc4=0xce;}_0x5ea744[_0xab49('0x18')](_0x589dc4);return _0x5ea744['set'](_0xab49('0x1e'),_0x9c59e1+'-'+_0x14d8b8+'/'+_0x205b09)[_0xab49('0x1a')](_0x38ee23);}return null;};}function patchUpdates(_0x28449b){return function(_0x4ff277){try{jsonpatch['apply'](_0x4ff277,_0x28449b,!![]);}catch(_0x31da6b){return BPromise[_0xab49('0x1f')](_0x31da6b);}return _0x4ff277['save']();};}function saveUpdates(_0x2806b,_0x33d7bd){return function(_0x49b716){if(_0x49b716){return _0x49b716[_0xab49('0x20')](_0x2806b)['then'](function(_0x34211e){return _0x34211e;});}return null;};}function removeEntity(_0x1aafa0,_0x4dfc52){return function(_0x5802db){if(_0x5802db){return _0x5802db[_0xab49('0x21')]()['then'](function(){_0x1aafa0[_0xab49('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35682a,_0x2faeca){return function(_0x2ba18a){if(!_0x2ba18a){_0x35682a['sendStatus'](0x194);}return _0x2ba18a;};}function handleError(_0x2bf8e0,_0x49c047){_0x49c047=_0x49c047||0x1f4;return function(_0x322153){logger[_0xab49('0x22')](_0x322153['stack']);if(_0x322153[_0xab49('0x23')]){delete _0x322153[_0xab49('0x23')];}_0x2bf8e0['status'](_0x49c047)['send'](_0x322153);};}exports[_0xab49('0x24')]=function(_0x2e0e37,_0x1b70e1){var _0x5b7c22={},_0x1b1fed={},_0x237273={'count':0x0,'rows':[]};var _0x4bf0cf=db[_0xab49('0x25')][_0xab49('0x26')];_0x1b1fed[_0xab49('0x27')]=_['keys'](_0x4bf0cf);_0x1b1fed[_0xab49('0x28')]=_['keys'](_0x2e0e37[_0xab49('0x28')]);_0x1b1fed['filters']=_[_0xab49('0x29')](_0x1b1fed['model'],_0x1b1fed[_0xab49('0x28')]);_0x5b7c22[_0xab49('0x2a')]=_[_0xab49('0x29')](_0x1b1fed[_0xab49('0x27')],qs['fields'](_0x2e0e37[_0xab49('0x28')][_0xab49('0x2b')]));_0x5b7c22[_0xab49('0x2a')]=_0x5b7c22['attributes'][_0xab49('0x2c')]?_0x5b7c22['attributes']:_0x1b1fed[_0xab49('0x27')];if(!_0x2e0e37['query']['hasOwnProperty']('nolimit')){_0x5b7c22[_0xab49('0x1d')]=qs['limit'](_0x2e0e37[_0xab49('0x28')][_0xab49('0x1d')]);_0x5b7c22[_0xab49('0x1c')]=qs['offset'](_0x2e0e37[_0xab49('0x28')][_0xab49('0x1c')]);}_0x5b7c22[_0xab49('0x2d')]=qs[_0xab49('0x2e')](_0x2e0e37[_0xab49('0x28')]['sort']);_0x5b7c22[_0xab49('0x2f')]=qs[_0xab49('0x30')](_['pick'](_0x2e0e37['query'],_0x1b1fed[_0xab49('0x30')]));if(_0x2e0e37[_0xab49('0x28')][_0xab49('0x31')]){_0x5b7c22[_0xab49('0x2f')]=_[_0xab49('0x32')](_0x5b7c22[_0xab49('0x2f')],{'$or':_[_0xab49('0x33')](_0x4bf0cf,function(_0x312288){if(_0x312288[_0xab49('0x34')][_0xab49('0x35')]!==_0xab49('0x36')){var _0x3769ce={};_0x3769ce[_0x312288[_0xab49('0x37')]]={'$like':'%'+_0x2e0e37['query'][_0xab49('0x31')]+'%'};return _0x3769ce;}})});}_0x5b7c22=_[_0xab49('0x32')]({},_0x5b7c22,_0x2e0e37[_0xab49('0x38')]);var _0x46e359={'where':_0x5b7c22[_0xab49('0x2f')]};return db['OpenchannelTransferReport'][_0xab49('0x1b')](_0x46e359)['then'](function(_0x4ff230){_0x237273[_0xab49('0x1b')]=_0x4ff230;if(_0x2e0e37[_0xab49('0x28')][_0xab49('0x39')]){_0x5b7c22[_0xab49('0x3a')]=[{'all':!![]}];}return db[_0xab49('0x25')]['findAll'](_0x5b7c22);})[_0xab49('0x3b')](function(_0x2cdcbf){_0x237273[_0xab49('0x3c')]=_0x2cdcbf;return _0x237273;})[_0xab49('0x3b')](respondWithFilteredResult(_0x1b70e1,_0x5b7c22))[_0xab49('0x3d')](handleError(_0x1b70e1,null));};exports['show']=function(_0x4f89a3,_0x22c4e1){var _0x3b8020={'raw':!![],'where':{'id':_0x4f89a3['params']['id']}},_0x24a628={};_0x24a628[_0xab49('0x27')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x24a628['query']=_[_0xab49('0x3e')](_0x4f89a3[_0xab49('0x28')]);_0x24a628[_0xab49('0x30')]=_[_0xab49('0x29')](_0x24a628[_0xab49('0x27')],_0x24a628[_0xab49('0x28')]);_0x3b8020[_0xab49('0x2a')]=_[_0xab49('0x29')](_0x24a628[_0xab49('0x27')],qs[_0xab49('0x2b')](_0x4f89a3['query'][_0xab49('0x2b')]));_0x3b8020[_0xab49('0x2a')]=_0x3b8020['attributes'][_0xab49('0x2c')]?_0x3b8020[_0xab49('0x2a')]:_0x24a628[_0xab49('0x27')];if(_0x4f89a3[_0xab49('0x28')][_0xab49('0x39')]){_0x3b8020[_0xab49('0x3a')]=[{'all':!![]}];}_0x3b8020=_[_0xab49('0x32')]({},_0x3b8020,_0x4f89a3[_0xab49('0x38')]);return db['OpenchannelTransferReport'][_0xab49('0x3f')](_0x3b8020)[_0xab49('0x3b')](handleEntityNotFound(_0x22c4e1,null))[_0xab49('0x3b')](respondWithResult(_0x22c4e1,null))['catch'](handleError(_0x22c4e1,null));};exports[_0xab49('0x40')]=function(_0x1d5f40,_0x1bfd4e){return db[_0xab49('0x25')][_0xab49('0x40')](_0x1d5f40[_0xab49('0x41')],{})['then'](respondWithResult(_0x1bfd4e,0xc9))[_0xab49('0x3d')](handleError(_0x1bfd4e,null));};exports[_0xab49('0x20')]=function(_0x21e141,_0x33b568){if(_0x21e141[_0xab49('0x41')]['id']){delete _0x21e141[_0xab49('0x41')]['id'];}return db['OpenchannelTransferReport'][_0xab49('0x3f')]({'where':{'id':_0x21e141[_0xab49('0x42')]['id']}})[_0xab49('0x3b')](handleEntityNotFound(_0x33b568,null))[_0xab49('0x3b')](saveUpdates(_0x21e141[_0xab49('0x41')],null))[_0xab49('0x3b')](respondWithResult(_0x33b568,null))[_0xab49('0x3d')](handleError(_0x33b568,null));};exports[_0xab49('0x21')]=function(_0x2ae9dc,_0xfb7d69){return db[_0xab49('0x25')][_0xab49('0x3f')]({'where':{'id':_0x2ae9dc['params']['id']}})[_0xab49('0x3b')](handleEntityNotFound(_0xfb7d69,null))[_0xab49('0x3b')](removeEntity(_0xfb7d69,null))[_0xab49('0x3d')](handleError(_0xfb7d69,null));};exports[_0xab49('0x43')]=function(_0x1212f5,_0x170508){return db[_0xab49('0x25')]['describe']()[_0xab49('0x3b')](respondWithResult(_0x170508,null))['catch'](handleError(_0x170508,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 610a36c..b1a5cdf 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 _0x53d5=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x53d5,0x68));var _0x553d=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x53d5[_0x5d31f3];return _0x1cc88c;};'use strict';var _=require(_0x553d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x553d('0x1'));var moment=require(_0x553d('0x2'));var BPromise=require(_0x553d('0x3'));var rp=require(_0x553d('0x4'));var fs=require('fs');var path=require(_0x553d('0x5'));var rimraf=require(_0x553d('0x6'));var config=require(_0x553d('0x7'));var attributes=require(_0x553d('0x8'));module[_0x553d('0x9')]=function(_0x3002cc,_0x4c8dd8){return _0x3002cc['define'](_0x553d('0xa'),attributes,{'tableName':_0x553d('0xb'),'paranoid':![],'indexes':[{'name':_0x553d('0xc'),'fields':[_0x553d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['request-promise','path','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xd943,0x1da));var _0x3d94=function(_0x1a3be6,_0x3d655f){_0x1a3be6=_0x1a3be6-0x0;var _0x12f3db=_0xd943[_0x1a3be6];return _0x12f3db;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var rp=require(_0x3d94('0x6'));var fs=require('fs');var path=require(_0x3d94('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x55bf73,_0x4a2087){return _0x55bf73[_0x3d94('0x8')](_0x3d94('0x9'),attributes,{'tableName':_0x3d94('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3d94('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7e0b7b2..4cbe2e8 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 _0xdf85=['../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1af8d3,_0x544d86){var _0x3a50c5=function(_0x4179aa){while(--_0x4179aa){_0x1af8d3['push'](_0x1af8d3['shift']());}};_0x3a50c5(++_0x544d86);}(_0xdf85,0x12c));var _0x5df8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdf85[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x5df8('0x0'));var moment=require('moment');var BPromise=require(_0x5df8('0x1'));var rs=require(_0x5df8('0x2'));var fs=require('fs');var Redis=require(_0x5df8('0x3'));var db=require(_0x5df8('0x4'))['db'];var utils=require(_0x5df8('0x5'));var logger=require(_0x5df8('0x6'))(_0x5df8('0x7'));var config=require(_0x5df8('0x8'));var jayson=require(_0x5df8('0x9'));var client=jayson[_0x5df8('0xa')][_0x5df8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa871,_0xeeaef8,_0x12384d){return new BPromise(function(_0x3dec2d,_0x2b0aee){return client[_0x5df8('0xc')](_0x4aa871,_0x12384d)[_0x5df8('0xd')](function(_0x172560){logger[_0x5df8('0xe')](_0x5df8('0xf'),_0xeeaef8,_0x5df8('0x10'));logger['debug'](_0x5df8('0x11'),_0xeeaef8,_0x5df8('0x10'),JSON[_0x5df8('0x12')](_0x172560));if(_0x172560[_0x5df8('0x13')]){if(_0x172560[_0x5df8('0x13')]['code']===0x1f4){logger[_0x5df8('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xeeaef8,_0x172560[_0x5df8('0x13')]['message']);return _0x2b0aee(_0x172560[_0x5df8('0x13')][_0x5df8('0x14')]);}logger[_0x5df8('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xeeaef8,_0x172560[_0x5df8('0x13')][_0x5df8('0x14')]);return _0x3dec2d(_0x172560[_0x5df8('0x13')][_0x5df8('0x14')]);}else{logger[_0x5df8('0xe')](_0x5df8('0xf'),_0xeeaef8,_0x5df8('0x10'));_0x3dec2d(_0x172560[_0x5df8('0x15')][_0x5df8('0x14')]);}})['catch'](function(_0x103bff){logger[_0x5df8('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xeeaef8,_0x103bff);_0x2b0aee(_0x103bff);});});} \ No newline at end of file +var _0x8b1f=['moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util'];(function(_0xb9ebb8,_0x388253){var _0x42fff5=function(_0x43be49){while(--_0x43be49){_0xb9ebb8['push'](_0xb9ebb8['shift']());}};_0x42fff5(++_0x388253);}(_0x8b1f,0xda));var _0xf8b1=function(_0x226380,_0x3705d3){_0x226380=_0x226380-0x0;var _0x4f4073=_0x8b1f[_0x226380];return _0x4f4073;};'use strict';var _=require(_0xf8b1('0x0'));var util=require(_0xf8b1('0x1'));var moment=require(_0xf8b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8b1('0x3'));var fs=require('fs');var Redis=require(_0xf8b1('0x4'));var db=require(_0xf8b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf8b1('0x6'));var jayson=require(_0xf8b1('0x7'));var client=jayson[_0xf8b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23c805,_0x4a0e8b,_0x5ec56c){return new BPromise(function(_0x1e474b,_0x14b914){return client[_0xf8b1('0x9')](_0x23c805,_0x5ec56c)[_0xf8b1('0xa')](function(_0x32b2ed){logger[_0xf8b1('0xb')](_0xf8b1('0xc'),_0x4a0e8b,'request\x20sent');logger[_0xf8b1('0xd')](_0xf8b1('0xe'),_0x4a0e8b,_0xf8b1('0xf'),JSON['stringify'](_0x32b2ed));if(_0x32b2ed[_0xf8b1('0x10')]){if(_0x32b2ed[_0xf8b1('0x10')]['code']===0x1f4){logger[_0xf8b1('0x10')](_0xf8b1('0xc'),_0x4a0e8b,_0x32b2ed[_0xf8b1('0x10')]['message']);return _0x14b914(_0x32b2ed['error'][_0xf8b1('0x11')]);}logger['error'](_0xf8b1('0xc'),_0x4a0e8b,_0x32b2ed[_0xf8b1('0x10')][_0xf8b1('0x11')]);return _0x1e474b(_0x32b2ed[_0xf8b1('0x10')][_0xf8b1('0x11')]);}else{logger[_0xf8b1('0xb')](_0xf8b1('0xc'),_0x4a0e8b,_0xf8b1('0xf'));_0x1e474b(_0x32b2ed[_0xf8b1('0x12')]['message']);}})[_0xf8b1('0x13')](function(_0x18a784){logger[_0xf8b1('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4a0e8b,_0x18a784);_0x14b914(_0x18a784);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 23bec39..5c4e6af 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 _0x2746=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put'];(function(_0xedb7ba,_0x3a5c46){var _0x11c6b6=function(_0x4f236e){while(--_0x4f236e){_0xedb7ba['push'](_0xedb7ba['shift']());}};_0x11c6b6(++_0x3a5c46);}(_0x2746,0x19c));var _0x6274=function(_0x475d0e,_0x25eeb2){_0x475d0e=_0x475d0e-0x0;var _0x24d82b=_0x2746[_0x475d0e];return _0x24d82b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6274('0x0'));var timeout=require(_0x6274('0x1'));var express=require(_0x6274('0x2'));var router=express[_0x6274('0x3')]();var auth=require(_0x6274('0x4'));var interaction=require(_0x6274('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x6274('0x6')]('/',auth[_0x6274('0x7')](),controller[_0x6274('0x8')]);router['get'](_0x6274('0x9'),auth[_0x6274('0x7')](),controller[_0x6274('0xa')]);router[_0x6274('0xb')]('/',auth[_0x6274('0x7')](),controller['create']);router[_0x6274('0xc')]('/:id',auth[_0x6274('0x7')](),controller[_0x6274('0xd')]);router[_0x6274('0xe')](_0x6274('0x9'),auth[_0x6274('0x7')](),controller[_0x6274('0xf')]);module[_0x6274('0x10')]=router; \ No newline at end of file +var _0x45c8=['path','connect-timeout','express','Router','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x5abb5a,_0x1198e2){var _0x4183e8=function(_0x5ca020){while(--_0x5ca020){_0x5abb5a['push'](_0x5abb5a['shift']());}};_0x4183e8(++_0x1198e2);}(_0x45c8,0xef));var _0x845c=function(_0x3a783f,_0x2cc83d){_0x3a783f=_0x3a783f-0x0;var _0x46e974=_0x45c8[_0x3a783f];return _0x46e974;};'use strict';var multer=require(_0x845c('0x0'));var util=require('util');var path=require(_0x845c('0x1'));var timeout=require(_0x845c('0x2'));var express=require(_0x845c('0x3'));var router=express[_0x845c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x845c('0x5')]('/',auth[_0x845c('0x6')](),controller[_0x845c('0x7')]);router['get'](_0x845c('0x8'),auth['isAuthenticated'](),controller[_0x845c('0x9')]);router[_0x845c('0xa')]('/',auth[_0x845c('0x6')](),controller[_0x845c('0xb')]);router[_0x845c('0xc')](_0x845c('0x8'),auth[_0x845c('0x6')](),controller[_0x845c('0xd')]);router[_0x845c('0xe')](_0x845c('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x845c('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 1a118a0..27f7f77 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 _0x304b=['STRING','sequelize','exports'];(function(_0x164df2,_0x4083ee){var _0x4abfa1=function(_0x226c9b){while(--_0x226c9b){_0x164df2['push'](_0x164df2['shift']());}};_0x4abfa1(++_0x4083ee);}(_0x304b,0x103));var _0xb304=function(_0x29e265,_0x27d3d0){_0x29e265=_0x29e265-0x0;var _0x164f23=_0x304b[_0x29e265];return _0x164f23;};'use strict';var Sequelize=require(_0xb304('0x0'));module[_0xb304('0x1')]={'name':{'type':Sequelize[_0xb304('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb304('0x2')]}}; \ No newline at end of file +var _0x29c6=['STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x29c6,0xa9));var _0x629c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29c6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x629c('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x629c('0x0')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f23e373..fec0ca5 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 _0x7ae3=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','name','send','index','Pause','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','user','role','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','crypto'];(function(_0xadc9a3,_0x464700){var _0x12b61e=function(_0x8bb080){while(--_0x8bb080){_0xadc9a3['push'](_0xadc9a3['shift']());}};_0x12b61e(++_0x464700);}(_0x7ae3,0x17f));var _0x37ae=function(_0x463a43,_0x299df1){_0x463a43=_0x463a43-0x0;var _0x471c37=_0x7ae3[_0x463a43];return _0x471c37;};'use strict';var pdf=require(_0x37ae('0x0'));var emlformat=require(_0x37ae('0x1'));var rimraf=require(_0x37ae('0x2'));var zipdir=require(_0x37ae('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37ae('0x4'));var moment=require(_0x37ae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x37ae('0x6'));var util=require('util');var path=require(_0x37ae('0x7'));var sox=require(_0x37ae('0x8'));var csv=require('to-csv');var ejs=require(_0x37ae('0x9'));var fs=require('fs');var _=require(_0x37ae('0xa'));var squel=require('squel');var crypto=require(_0x37ae('0xb'));var jsforce=require(_0x37ae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x37ae('0xd'));var querystring=require(_0x37ae('0xe'));var Papa=require(_0x37ae('0xf'));var Redis=require(_0x37ae('0x10'));var authService=require(_0x37ae('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x37ae('0x12'));var logger=require(_0x37ae('0x13'))(_0x37ae('0x14'));var utils=require(_0x37ae('0x15'));var config=require(_0x37ae('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x190e1d,_0x381fab){_0x381fab=_0x381fab||0xcc;return function(_0x3c9bb9){if(_0x3c9bb9){return _0x190e1d[_0x37ae('0x17')](_0x381fab);}return _0x190e1d['status'](_0x381fab)['end']();};}function respondWithResult(_0x525b5e,_0x2b796a){_0x2b796a=_0x2b796a||0xc8;return function(_0x1d350d){if(_0x1d350d){return _0x525b5e[_0x37ae('0x18')](_0x2b796a)[_0x37ae('0x19')](_0x1d350d);}};}function respondWithFilteredResult(_0x88898c,_0x38ecbd){return function(_0x19cfaa){if(_0x19cfaa){var _0x171504=_0x19cfaa['count'],_0x17d0b8=_0x38ecbd['offset'],_0x2b9cf5=_0x38ecbd[_0x37ae('0x1a')]+_0x38ecbd[_0x37ae('0x1b')],_0x36f620;if(_0x2b9cf5>=_0x171504){_0x2b9cf5=_0x171504;_0x36f620=0xc8;}else{_0x36f620=0xce;}_0x88898c[_0x37ae('0x18')](_0x36f620);return _0x88898c[_0x37ae('0x1c')](_0x37ae('0x1d'),_0x17d0b8+'-'+_0x2b9cf5+'/'+_0x171504)[_0x37ae('0x19')](_0x19cfaa);}return null;};}function patchUpdates(_0x2a6e41){return function(_0x1f3a64){try{jsonpatch['apply'](_0x1f3a64,_0x2a6e41,!![]);}catch(_0x1b372f){return BPromise[_0x37ae('0x1e')](_0x1b372f);}return _0x1f3a64[_0x37ae('0x1f')]();};}function saveUpdates(_0x5bad57,_0x2546f5){return function(_0x584559){if(_0x584559){return _0x584559[_0x37ae('0x20')](_0x5bad57)[_0x37ae('0x21')](function(_0x4df229){return _0x4df229;});}return null;};}function removeEntity(_0x31f074,_0x4acf48){return function(_0x6548e5){if(_0x6548e5){return _0x6548e5[_0x37ae('0x22')]()['then'](function(){var _0x3a7faa=_0x6548e5[_0x37ae('0x23')]({'plain':!![]});var _0x334489=_0x37ae('0x24');return db[_0x37ae('0x25')]['destroy']({'where':{'type':_0x334489,'resourceId':_0x3a7faa['id']}})[_0x37ae('0x21')](function(){return _0x6548e5;});})[_0x37ae('0x21')](function(){_0x31f074[_0x37ae('0x18')](0xcc)[_0x37ae('0x26')]();});}};}function handleEntityNotFound(_0x576b34,_0xed9054){return function(_0x1c434f){if(!_0x1c434f){_0x576b34[_0x37ae('0x17')](0x194);}return _0x1c434f;};}function handleError(_0x6e29d7,_0x50f4a4){_0x50f4a4=_0x50f4a4||0x1f4;return function(_0x572a89){logger[_0x37ae('0x27')](_0x572a89['stack']);if(_0x572a89[_0x37ae('0x28')]){delete _0x572a89[_0x37ae('0x28')];}_0x6e29d7[_0x37ae('0x18')](_0x50f4a4)[_0x37ae('0x29')](_0x572a89);};}exports[_0x37ae('0x2a')]=function(_0x1a315e,_0x32eaa4){var _0x1f0442={},_0x1b9613={},_0x34731a={'count':0x0,'rows':[]};var _0x200396=db[_0x37ae('0x2b')][_0x37ae('0x2c')];_0x1b9613['model']=_[_0x37ae('0x2d')](_0x200396);_0x1b9613[_0x37ae('0x2e')]=_[_0x37ae('0x2d')](_0x1a315e[_0x37ae('0x2e')]);_0x1b9613[_0x37ae('0x2f')]=_[_0x37ae('0x30')](_0x1b9613[_0x37ae('0x31')],_0x1b9613[_0x37ae('0x2e')]);_0x1f0442['attributes']=_[_0x37ae('0x30')](_0x1b9613[_0x37ae('0x31')],qs[_0x37ae('0x32')](_0x1a315e['query'][_0x37ae('0x32')]));_0x1f0442[_0x37ae('0x33')]=_0x1f0442[_0x37ae('0x33')]['length']?_0x1f0442[_0x37ae('0x33')]:_0x1b9613[_0x37ae('0x31')];if(!_0x1a315e['query'][_0x37ae('0x34')]('nolimit')){_0x1f0442[_0x37ae('0x1b')]=qs[_0x37ae('0x1b')](_0x1a315e[_0x37ae('0x2e')][_0x37ae('0x1b')]);_0x1f0442[_0x37ae('0x1a')]=qs['offset'](_0x1a315e['query'][_0x37ae('0x1a')]);}_0x1f0442[_0x37ae('0x35')]=qs[_0x37ae('0x36')](_0x1a315e['query'][_0x37ae('0x36')]);_0x1f0442['where']=qs[_0x37ae('0x2f')](_['pick'](_0x1a315e[_0x37ae('0x2e')],_0x1b9613[_0x37ae('0x2f')]));if(_0x1a315e[_0x37ae('0x2e')][_0x37ae('0x37')]){_0x1f0442[_0x37ae('0x38')]=_[_0x37ae('0x39')](_0x1f0442[_0x37ae('0x38')],{'$or':_['map'](_0x200396,function(_0x48854e){if(_0x48854e[_0x37ae('0x3a')][_0x37ae('0x3b')]!==_0x37ae('0x3c')){var _0x4ca313={};_0x4ca313[_0x48854e[_0x37ae('0x3d')]]={'$like':'%'+_0x1a315e[_0x37ae('0x2e')][_0x37ae('0x37')]+'%'};return _0x4ca313;}})});}_0x1f0442=_[_0x37ae('0x39')]({},_0x1f0442,_0x1a315e['options']);var _0x5e1adb={'where':_0x1f0442['where']};return db[_0x37ae('0x2b')][_0x37ae('0x3e')](_0x5e1adb)['then'](function(_0x2d11e6){_0x34731a[_0x37ae('0x3e')]=_0x2d11e6;if(_0x1a315e[_0x37ae('0x2e')][_0x37ae('0x3f')]){_0x1f0442[_0x37ae('0x40')]=[{'all':!![]}];}return db[_0x37ae('0x2b')][_0x37ae('0x41')](_0x1f0442);})[_0x37ae('0x21')](function(_0xbe7729){_0x34731a[_0x37ae('0x42')]=_0xbe7729;return _0x34731a;})[_0x37ae('0x21')](respondWithFilteredResult(_0x32eaa4,_0x1f0442))['catch'](handleError(_0x32eaa4,null));};exports['show']=function(_0x3e13c0,_0x3ed7ce){var _0x2363ca={'raw':!![],'where':{'id':_0x3e13c0[_0x37ae('0x43')]['id']}},_0x1aa1e8={};_0x1aa1e8['model']=_[_0x37ae('0x2d')](db[_0x37ae('0x2b')][_0x37ae('0x2c')]);_0x1aa1e8[_0x37ae('0x2e')]=_['keys'](_0x3e13c0[_0x37ae('0x2e')]);_0x1aa1e8[_0x37ae('0x2f')]=_[_0x37ae('0x30')](_0x1aa1e8[_0x37ae('0x31')],_0x1aa1e8['query']);_0x2363ca[_0x37ae('0x33')]=_['intersection'](_0x1aa1e8['model'],qs[_0x37ae('0x32')](_0x3e13c0[_0x37ae('0x2e')]['fields']));_0x2363ca[_0x37ae('0x33')]=_0x2363ca[_0x37ae('0x33')][_0x37ae('0x44')]?_0x2363ca[_0x37ae('0x33')]:_0x1aa1e8[_0x37ae('0x31')];if(_0x3e13c0['query'][_0x37ae('0x3f')]){_0x2363ca['include']=[{'all':!![]}];}_0x2363ca=_[_0x37ae('0x39')]({},_0x2363ca,_0x3e13c0[_0x37ae('0x45')]);return db[_0x37ae('0x2b')][_0x37ae('0x46')](_0x2363ca)[_0x37ae('0x21')](handleEntityNotFound(_0x3ed7ce,null))[_0x37ae('0x21')](respondWithResult(_0x3ed7ce,null))[_0x37ae('0x47')](handleError(_0x3ed7ce,null));};exports[_0x37ae('0x48')]=function(_0x72c167,_0x10e64e){return db[_0x37ae('0x2b')]['create'](_0x72c167[_0x37ae('0x49')],{})[_0x37ae('0x21')](function(_0x4b8935){var _0x291d49=_0x72c167[_0x37ae('0x4a')][_0x37ae('0x23')]({'plain':!![]});if(!_0x291d49)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x291d49[_0x37ae('0x4b')]===_0x37ae('0x4a')){var _0x24a0f9=_0x4b8935[_0x37ae('0x23')]({'plain':!![]});var _0x3f4f0f=_0x37ae('0x24');return db['UserProfileSection'][_0x37ae('0x46')]({'where':{'name':_0x3f4f0f,'userProfileId':_0x291d49[_0x37ae('0x4c')]},'raw':!![]})[_0x37ae('0x21')](function(_0x2437c2){if(_0x2437c2&&_0x2437c2[_0x37ae('0x4d')]===0x0){return db[_0x37ae('0x25')][_0x37ae('0x48')]({'name':_0x24a0f9[_0x37ae('0x28')],'resourceId':_0x24a0f9['id'],'type':_0x2437c2['name'],'sectionId':_0x2437c2['id']},{})['then'](function(){return _0x4b8935;});}else{return _0x4b8935;}})[_0x37ae('0x47')](function(_0x2adc0e){logger[_0x37ae('0x27')](_0x37ae('0x4e'),_0x2adc0e);throw _0x2adc0e;});}return _0x4b8935;})[_0x37ae('0x21')](respondWithResult(_0x10e64e,0xc9))[_0x37ae('0x47')](handleError(_0x10e64e,null));};exports[_0x37ae('0x20')]=function(_0x266bb2,_0x5f389f){if(_0x266bb2[_0x37ae('0x49')]['id']){delete _0x266bb2[_0x37ae('0x49')]['id'];}return db[_0x37ae('0x2b')][_0x37ae('0x46')]({'where':{'id':_0x266bb2['params']['id']}})[_0x37ae('0x21')](handleEntityNotFound(_0x5f389f,null))[_0x37ae('0x21')](saveUpdates(_0x266bb2[_0x37ae('0x49')],null))[_0x37ae('0x21')](respondWithResult(_0x5f389f,null))[_0x37ae('0x47')](handleError(_0x5f389f,null));};exports[_0x37ae('0x22')]=function(_0x5bfd2d,_0xecde){return db[_0x37ae('0x2b')]['find']({'where':{'id':_0x5bfd2d[_0x37ae('0x43')]['id']}})[_0x37ae('0x21')](handleEntityNotFound(_0xecde,null))[_0x37ae('0x21')](removeEntity(_0xecde,null))['catch'](handleError(_0xecde,null));}; \ No newline at end of file +var _0xb2b5=['update','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','limit','status','set','Content-Range','json','apply','reject','then','get','UserProfileResource','end','error','name','index','Pause','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','field','options','count','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','role','Pauses','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb2b5,0xa4));var _0x5b2b=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb2b5[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x5b2b('0x0'));var emlformat=require(_0x5b2b('0x1'));var rimraf=require(_0x5b2b('0x2'));var zipdir=require(_0x5b2b('0x3'));var jsonpatch=require(_0x5b2b('0x4'));var rp=require(_0x5b2b('0x5'));var moment=require(_0x5b2b('0x6'));var BPromise=require(_0x5b2b('0x7'));var Mustache=require('mustache');var util=require(_0x5b2b('0x8'));var path=require(_0x5b2b('0x9'));var sox=require(_0x5b2b('0xa'));var csv=require(_0x5b2b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b2b('0xc'));var squel=require(_0x5b2b('0xd'));var crypto=require(_0x5b2b('0xe'));var jsforce=require(_0x5b2b('0xf'));var deskjs=require(_0x5b2b('0x10'));var toCsv=require(_0x5b2b('0xb'));var querystring=require('querystring');var Papa=require(_0x5b2b('0x11'));var Redis=require(_0x5b2b('0x12'));var authService=require(_0x5b2b('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5b2b('0x14'));var logger=require('../../config/logger')(_0x5b2b('0x15'));var utils=require(_0x5b2b('0x16'));var config=require(_0x5b2b('0x17'));var db=require(_0x5b2b('0x18'))['db'];function respondWithStatusCode(_0xf0b0b5,_0x3ef3a5){_0x3ef3a5=_0x3ef3a5||0xcc;return function(_0x5bcc58){if(_0x5bcc58){return _0xf0b0b5[_0x5b2b('0x19')](_0x3ef3a5);}return _0xf0b0b5['status'](_0x3ef3a5)['end']();};}function respondWithResult(_0x3e0371,_0x94ead6){_0x94ead6=_0x94ead6||0xc8;return function(_0xe1afb3){if(_0xe1afb3){return _0x3e0371['status'](_0x94ead6)['json'](_0xe1afb3);}};}function respondWithFilteredResult(_0x42eef9,_0x30e97a){return function(_0x2c7d6c){if(_0x2c7d6c){var _0x332520=_0x2c7d6c['count'],_0x28f856=_0x30e97a[_0x5b2b('0x1a')],_0x1f585b=_0x30e97a[_0x5b2b('0x1a')]+_0x30e97a[_0x5b2b('0x1b')],_0x4c6d21;if(_0x1f585b>=_0x332520){_0x1f585b=_0x332520;_0x4c6d21=0xc8;}else{_0x4c6d21=0xce;}_0x42eef9[_0x5b2b('0x1c')](_0x4c6d21);return _0x42eef9[_0x5b2b('0x1d')](_0x5b2b('0x1e'),_0x28f856+'-'+_0x1f585b+'/'+_0x332520)[_0x5b2b('0x1f')](_0x2c7d6c);}return null;};}function patchUpdates(_0x4db9b4){return function(_0x28133b){try{jsonpatch[_0x5b2b('0x20')](_0x28133b,_0x4db9b4,!![]);}catch(_0x262e21){return BPromise[_0x5b2b('0x21')](_0x262e21);}return _0x28133b['save']();};}function saveUpdates(_0xafbd6,_0x2e0471){return function(_0x5344ed){if(_0x5344ed){return _0x5344ed['update'](_0xafbd6)[_0x5b2b('0x22')](function(_0xc6bb5){return _0xc6bb5;});}return null;};}function removeEntity(_0x1ac4d5,_0x464f24){return function(_0x423123){if(_0x423123){return _0x423123['destroy']()[_0x5b2b('0x22')](function(){var _0x5ea9d=_0x423123[_0x5b2b('0x23')]({'plain':!![]});var _0x263956='Pauses';return db[_0x5b2b('0x24')]['destroy']({'where':{'type':_0x263956,'resourceId':_0x5ea9d['id']}})[_0x5b2b('0x22')](function(){return _0x423123;});})[_0x5b2b('0x22')](function(){_0x1ac4d5[_0x5b2b('0x1c')](0xcc)[_0x5b2b('0x25')]();});}};}function handleEntityNotFound(_0x46d167,_0x5adf76){return function(_0x1a1f66){if(!_0x1a1f66){_0x46d167[_0x5b2b('0x19')](0x194);}return _0x1a1f66;};}function handleError(_0x32bf8e,_0x204841){_0x204841=_0x204841||0x1f4;return function(_0x5364ae){logger[_0x5b2b('0x26')](_0x5364ae['stack']);if(_0x5364ae[_0x5b2b('0x27')]){delete _0x5364ae['name'];}_0x32bf8e[_0x5b2b('0x1c')](_0x204841)['send'](_0x5364ae);};}exports[_0x5b2b('0x28')]=function(_0x4e9242,_0x13351){var _0xbb2f1e={},_0x2f8102={},_0x1394f5={'count':0x0,'rows':[]};var _0x4d3620=db[_0x5b2b('0x29')]['rawAttributes'];_0x2f8102[_0x5b2b('0x2a')]=_[_0x5b2b('0x2b')](_0x4d3620);_0x2f8102[_0x5b2b('0x2c')]=_[_0x5b2b('0x2b')](_0x4e9242['query']);_0x2f8102['filters']=_[_0x5b2b('0x2d')](_0x2f8102[_0x5b2b('0x2a')],_0x2f8102[_0x5b2b('0x2c')]);_0xbb2f1e[_0x5b2b('0x2e')]=_[_0x5b2b('0x2d')](_0x2f8102['model'],qs[_0x5b2b('0x2f')](_0x4e9242['query']['fields']));_0xbb2f1e['attributes']=_0xbb2f1e[_0x5b2b('0x2e')][_0x5b2b('0x30')]?_0xbb2f1e['attributes']:_0x2f8102[_0x5b2b('0x2a')];if(!_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x31')](_0x5b2b('0x32'))){_0xbb2f1e['limit']=qs['limit'](_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x1b')]);_0xbb2f1e[_0x5b2b('0x1a')]=qs['offset'](_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x1a')]);}_0xbb2f1e[_0x5b2b('0x33')]=qs[_0x5b2b('0x34')](_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x34')]);_0xbb2f1e[_0x5b2b('0x35')]=qs[_0x5b2b('0x36')](_[_0x5b2b('0x37')](_0x4e9242[_0x5b2b('0x2c')],_0x2f8102[_0x5b2b('0x36')]));if(_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x38')]){_0xbb2f1e[_0x5b2b('0x35')]=_[_0x5b2b('0x39')](_0xbb2f1e[_0x5b2b('0x35')],{'$or':_[_0x5b2b('0x3a')](_0x4d3620,function(_0x3f2904){if(_0x3f2904[_0x5b2b('0x3b')]['key']!=='VIRTUAL'){var _0x2d90df={};_0x2d90df[_0x3f2904[_0x5b2b('0x3c')]]={'$like':'%'+_0x4e9242['query']['filter']+'%'};return _0x2d90df;}})});}_0xbb2f1e=_[_0x5b2b('0x39')]({},_0xbb2f1e,_0x4e9242[_0x5b2b('0x3d')]);var _0x446ae7={'where':_0xbb2f1e[_0x5b2b('0x35')]};return db[_0x5b2b('0x29')]['count'](_0x446ae7)[_0x5b2b('0x22')](function(_0x17ef23){_0x1394f5[_0x5b2b('0x3e')]=_0x17ef23;if(_0x4e9242[_0x5b2b('0x2c')][_0x5b2b('0x3f')]){_0xbb2f1e['include']=[{'all':!![]}];}return db[_0x5b2b('0x29')][_0x5b2b('0x40')](_0xbb2f1e);})[_0x5b2b('0x22')](function(_0x3add74){_0x1394f5[_0x5b2b('0x41')]=_0x3add74;return _0x1394f5;})['then'](respondWithFilteredResult(_0x13351,_0xbb2f1e))[_0x5b2b('0x42')](handleError(_0x13351,null));};exports['show']=function(_0x57083a,_0x2112a1){var _0x43c34c={'raw':!![],'where':{'id':_0x57083a[_0x5b2b('0x43')]['id']}},_0x343d5f={};_0x343d5f['model']=_[_0x5b2b('0x2b')](db[_0x5b2b('0x29')][_0x5b2b('0x44')]);_0x343d5f[_0x5b2b('0x2c')]=_['keys'](_0x57083a[_0x5b2b('0x2c')]);_0x343d5f[_0x5b2b('0x36')]=_[_0x5b2b('0x2d')](_0x343d5f['model'],_0x343d5f[_0x5b2b('0x2c')]);_0x43c34c[_0x5b2b('0x2e')]=_[_0x5b2b('0x2d')](_0x343d5f[_0x5b2b('0x2a')],qs[_0x5b2b('0x2f')](_0x57083a[_0x5b2b('0x2c')][_0x5b2b('0x2f')]));_0x43c34c[_0x5b2b('0x2e')]=_0x43c34c[_0x5b2b('0x2e')][_0x5b2b('0x30')]?_0x43c34c['attributes']:_0x343d5f[_0x5b2b('0x2a')];if(_0x57083a[_0x5b2b('0x2c')]['includeAll']){_0x43c34c[_0x5b2b('0x45')]=[{'all':!![]}];}_0x43c34c=_[_0x5b2b('0x39')]({},_0x43c34c,_0x57083a[_0x5b2b('0x3d')]);return db['Pause'][_0x5b2b('0x46')](_0x43c34c)[_0x5b2b('0x22')](handleEntityNotFound(_0x2112a1,null))['then'](respondWithResult(_0x2112a1,null))[_0x5b2b('0x42')](handleError(_0x2112a1,null));};exports[_0x5b2b('0x47')]=function(_0x161b6f,_0x8a4690){return db[_0x5b2b('0x29')][_0x5b2b('0x47')](_0x161b6f[_0x5b2b('0x48')],{})[_0x5b2b('0x22')](function(_0x2f81eb){var _0x2d0d35=_0x161b6f[_0x5b2b('0x49')][_0x5b2b('0x23')]({'plain':!![]});if(!_0x2d0d35)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d0d35[_0x5b2b('0x4a')]==='user'){var _0x4b596a=_0x2f81eb[_0x5b2b('0x23')]({'plain':!![]});var _0xa5c44e=_0x5b2b('0x4b');return db[_0x5b2b('0x4c')]['find']({'where':{'name':_0xa5c44e,'userProfileId':_0x2d0d35[_0x5b2b('0x4d')]},'raw':!![]})['then'](function(_0x44cb63){if(_0x44cb63&&_0x44cb63['autoAssociation']===0x0){return db[_0x5b2b('0x24')][_0x5b2b('0x47')]({'name':_0x4b596a[_0x5b2b('0x27')],'resourceId':_0x4b596a['id'],'type':_0x44cb63['name'],'sectionId':_0x44cb63['id']},{})[_0x5b2b('0x22')](function(){return _0x2f81eb;});}else{return _0x2f81eb;}})[_0x5b2b('0x42')](function(_0x3fc5be){logger['error'](_0x5b2b('0x4e'),_0x3fc5be);throw _0x3fc5be;});}return _0x2f81eb;})[_0x5b2b('0x22')](respondWithResult(_0x8a4690,0xc9))[_0x5b2b('0x42')](handleError(_0x8a4690,null));};exports[_0x5b2b('0x4f')]=function(_0x50e76b,_0x162127){if(_0x50e76b[_0x5b2b('0x48')]['id']){delete _0x50e76b[_0x5b2b('0x48')]['id'];}return db[_0x5b2b('0x29')][_0x5b2b('0x46')]({'where':{'id':_0x50e76b[_0x5b2b('0x43')]['id']}})['then'](handleEntityNotFound(_0x162127,null))[_0x5b2b('0x22')](saveUpdates(_0x50e76b[_0x5b2b('0x48')],null))[_0x5b2b('0x22')](respondWithResult(_0x162127,null))[_0x5b2b('0x42')](handleError(_0x162127,null));};exports[_0x5b2b('0x50')]=function(_0x1c7c27,_0x1a7162){return db[_0x5b2b('0x29')][_0x5b2b('0x46')]({'where':{'id':_0x1c7c27[_0x5b2b('0x43')]['id']}})[_0x5b2b('0x22')](handleEntityNotFound(_0x1a7162,null))[_0x5b2b('0x22')](removeEntity(_0x1a7162,null))['catch'](handleError(_0x1a7162,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e217867..4ae9be8 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 _0xf714=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','define','tools_pauses','lodash'];(function(_0x242a86,_0x16d528){var _0x4d0a6d=function(_0x3f563c){while(--_0x3f563c){_0x242a86['push'](_0x242a86['shift']());}};_0x4d0a6d(++_0x16d528);}(_0xf714,0xdb));var _0x4f71=function(_0x296b3c,_0x203828){_0x296b3c=_0x296b3c-0x0;var _0x53adfa=_0xf714[_0x296b3c];return _0x53adfa;};'use strict';var _=require(_0x4f71('0x0'));var util=require(_0x4f71('0x1'));var logger=require(_0x4f71('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f71('0x3'));var rp=require(_0x4f71('0x4'));var fs=require('fs');var path=require(_0x4f71('0x5'));var rimraf=require(_0x4f71('0x6'));var config=require(_0x4f71('0x7'));var attributes=require(_0x4f71('0x8'));module['exports']=function(_0x50ed05,_0x465820){return _0x50ed05[_0x4f71('0x9')]('Pause',attributes,{'tableName':_0x4f71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b69=['define','Pause','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x76bd2,_0x487abe){var _0x2e50f3=function(_0x27a6da){while(--_0x27a6da){_0x76bd2['push'](_0x76bd2['shift']());}};_0x2e50f3(++_0x487abe);}(_0x5b69,0x11a));var _0x95b6=function(_0x1416fc,_0x72e155){_0x1416fc=_0x1416fc-0x0;var _0x3a4b34=_0x5b69[_0x1416fc];return _0x3a4b34;};'use strict';var _=require(_0x95b6('0x0'));var util=require(_0x95b6('0x1'));var logger=require('../../config/logger')(_0x95b6('0x2'));var moment=require('moment');var BPromise=require(_0x95b6('0x3'));var rp=require(_0x95b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95b6('0x5'));var config=require(_0x95b6('0x6'));var attributes=require(_0x95b6('0x7'));module['exports']=function(_0x4aca61,_0x117e3f){return _0x4aca61[_0x95b6('0x8')](_0x95b6('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 214df21..20833dc 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 _0xed4b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','ShowPause','Pause','find','options','raw','include','attributes','map','stringify','lodash','util','moment','randomstring','ioredis'];(function(_0x5be060,_0x92d4ed){var _0x29d466=function(_0x22bd54){while(--_0x22bd54){_0x5be060['push'](_0x5be060['shift']());}};_0x29d466(++_0x92d4ed);}(_0xed4b,0x96));var _0xbed4=function(_0x1b5fa5,_0x262242){_0x1b5fa5=_0x1b5fa5-0x0;var _0x3ef222=_0xed4b[_0x1b5fa5];return _0x3ef222;};'use strict';var _=require(_0xbed4('0x0'));var util=require(_0xbed4('0x1'));var moment=require(_0xbed4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbed4('0x3'));var fs=require('fs');var Redis=require(_0xbed4('0x4'));var db=require(_0xbed4('0x5'))['db'];var utils=require(_0xbed4('0x6'));var logger=require(_0xbed4('0x7'))(_0xbed4('0x8'));var config=require('../../config/environment');var jayson=require(_0xbed4('0x9'));var client=jayson[_0xbed4('0xa')][_0xbed4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272560,_0x303394,_0x413e70){return new BPromise(function(_0x112c5d,_0xb635b3){return client[_0xbed4('0xc')](_0x272560,_0x413e70)[_0xbed4('0xd')](function(_0x4813a9){logger[_0xbed4('0xe')](_0xbed4('0xf'),_0x303394,'request\x20sent');logger[_0xbed4('0x10')](_0xbed4('0x11'),_0x303394,'request\x20sent',JSON['stringify'](_0x4813a9));if(_0x4813a9['error']){if(_0x4813a9[_0xbed4('0x12')][_0xbed4('0x13')]===0x1f4){logger[_0xbed4('0x12')](_0xbed4('0xf'),_0x303394,_0x4813a9[_0xbed4('0x12')][_0xbed4('0x14')]);return _0xb635b3(_0x4813a9[_0xbed4('0x12')]['message']);}logger[_0xbed4('0x12')](_0xbed4('0xf'),_0x303394,_0x4813a9[_0xbed4('0x12')]['message']);return _0x112c5d(_0x4813a9[_0xbed4('0x12')][_0xbed4('0x14')]);}else{logger[_0xbed4('0xe')](_0xbed4('0xf'),_0x303394,_0xbed4('0x15'));_0x112c5d(_0x4813a9['result']['message']);}})['catch'](function(_0xbada41){logger['error']('Pause,\x20%s,\x20%s',_0x303394,_0xbada41);_0xb635b3(_0xbada41);});});}exports[_0xbed4('0x16')]=function(_0x540b){var _0x4e80dc=this;return new Promise(function(_0x483474,_0x3e6120){return db[_0xbed4('0x17')][_0xbed4('0x18')]({'raw':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')][_0xbed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')]['where']||null:null,'attributes':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')]['attributes']||null:null,'include':_0x540b['options']?_0x540b[_0xbed4('0x19')][_0xbed4('0x1b')]?_['map'](_0x540b[_0xbed4('0x19')]['include'],function(_0x443de3){return{'model':db[_0x443de3['model']],'as':_0x443de3['as'],'attributes':_0x443de3[_0xbed4('0x1c')],'include':_0x443de3['include']?_[_0xbed4('0x1d')](_0x443de3[_0xbed4('0x1b')],function(_0x27ea52){return{'model':db[_0x27ea52['model']],'as':_0x27ea52['as'],'attributes':_0x27ea52[_0xbed4('0x1c')],'include':_0x27ea52[_0xbed4('0x1b')]?_['map'](_0x27ea52[_0xbed4('0x1b')],function(_0x4a8901){return{'model':db[_0x4a8901['model']],'as':_0x4a8901['as'],'attributes':_0x4a8901[_0xbed4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbed4('0xd')](function(_0xe705a6){logger[_0xbed4('0xe')]('ShowPause',_0x540b);logger['debug'](_0xbed4('0x16'),_0x540b,JSON[_0xbed4('0x1e')](_0xe705a6));_0x483474(_0xe705a6);})['catch'](function(_0xe87da8){logger['error'](_0xbed4('0x16'),_0xe87da8[_0xbed4('0x14')],_0x540b);_0x3e6120(_0x4e80dc['error'](0x1f4,_0xe87da8[_0xbed4('0x14')]));});});}; \ No newline at end of file +var _0x534f=['attributes','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Pause,\x20%s,\x20%s','result','ShowPause','Pause','find','options','where','include','map','model'];(function(_0x4614ce,_0x1b3311){var _0x499a1e=function(_0x4d3d62){while(--_0x4d3d62){_0x4614ce['push'](_0x4614ce['shift']());}};_0x499a1e(++_0x1b3311);}(_0x534f,0x1a3));var _0xf534=function(_0x277c5c,_0x3865c0){_0x277c5c=_0x277c5c-0x0;var _0x2f245b=_0x534f[_0x277c5c];return _0x2f245b;};'use strict';var _=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var moment=require(_0xf534('0x2'));var BPromise=require(_0xf534('0x3'));var rs=require(_0xf534('0x4'));var fs=require('fs');var Redis=require(_0xf534('0x5'));var db=require(_0xf534('0x6'))['db'];var utils=require(_0xf534('0x7'));var logger=require(_0xf534('0x8'))(_0xf534('0x9'));var config=require('../../config/environment');var jayson=require(_0xf534('0xa'));var client=jayson[_0xf534('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2863b0,_0x149353,_0x17b255){return new BPromise(function(_0x288f9e,_0x3beda5){return client[_0xf534('0xc')](_0x2863b0,_0x17b255)[_0xf534('0xd')](function(_0x35522a){logger[_0xf534('0xe')]('Pause,\x20%s,\x20%s',_0x149353,'request\x20sent');logger['debug'](_0xf534('0xf'),_0x149353,_0xf534('0x10'),JSON['stringify'](_0x35522a));if(_0x35522a[_0xf534('0x11')]){if(_0x35522a['error']['code']===0x1f4){logger[_0xf534('0x11')]('Pause,\x20%s,\x20%s',_0x149353,_0x35522a['error'][_0xf534('0x12')]);return _0x3beda5(_0x35522a[_0xf534('0x11')][_0xf534('0x12')]);}logger[_0xf534('0x11')]('Pause,\x20%s,\x20%s',_0x149353,_0x35522a[_0xf534('0x11')]['message']);return _0x288f9e(_0x35522a['error'][_0xf534('0x12')]);}else{logger['info'](_0xf534('0x13'),_0x149353,_0xf534('0x10'));_0x288f9e(_0x35522a[_0xf534('0x14')][_0xf534('0x12')]);}})['catch'](function(_0x5a4a43){logger['error'](_0xf534('0x13'),_0x149353,_0x5a4a43);_0x3beda5(_0x5a4a43);});});}exports[_0xf534('0x15')]=function(_0x3c4dfb){var _0x5cbc4c=this;return new Promise(function(_0x1b82d7,_0x19cac0){return db[_0xf534('0x16')][_0xf534('0x17')]({'raw':_0x3c4dfb['options']?_0x3c4dfb[_0xf534('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c4dfb[_0xf534('0x18')]?_0x3c4dfb[_0xf534('0x18')][_0xf534('0x19')]||null:null,'attributes':_0x3c4dfb[_0xf534('0x18')]?_0x3c4dfb[_0xf534('0x18')]['attributes']||null:null,'include':_0x3c4dfb[_0xf534('0x18')]?_0x3c4dfb[_0xf534('0x18')][_0xf534('0x1a')]?_[_0xf534('0x1b')](_0x3c4dfb[_0xf534('0x18')][_0xf534('0x1a')],function(_0x4336c9){return{'model':db[_0x4336c9[_0xf534('0x1c')]],'as':_0x4336c9['as'],'attributes':_0x4336c9[_0xf534('0x1d')],'include':_0x4336c9['include']?_[_0xf534('0x1b')](_0x4336c9['include'],function(_0x105fad){return{'model':db[_0x105fad[_0xf534('0x1c')]],'as':_0x105fad['as'],'attributes':_0x105fad['attributes'],'include':_0x105fad[_0xf534('0x1a')]?_[_0xf534('0x1b')](_0x105fad[_0xf534('0x1a')],function(_0x3d765f){return{'model':db[_0x3d765f['model']],'as':_0x3d765f['as'],'attributes':_0x3d765f['attributes']};}):[]};}):[]};}):[]:[]})[_0xf534('0xd')](function(_0xf38e3){logger[_0xf534('0xe')](_0xf534('0x15'),_0x3c4dfb);logger['debug']('ShowPause',_0x3c4dfb,JSON[_0xf534('0x1e')](_0xf38e3));_0x1b82d7(_0xf38e3);})[_0xf534('0x1f')](function(_0x3c9932){logger[_0xf534('0x11')](_0xf534('0x15'),_0x3c9932[_0xf534('0x12')],_0x3c4dfb);_0x19cac0(_0x5cbc4c[_0xf534('0x11')](0x1f4,_0x3c9932['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index eba24d0..dbb69ef 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 _0x363e=['root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join'];(function(_0x2a4000,_0x3c88d7){var _0x226381=function(_0x3c228e){while(--_0x3c228e){_0x2a4000['push'](_0x2a4000['shift']());}};_0x226381(++_0x3c88d7);}(_0x363e,0x192));var _0xe363=function(_0x364d12,_0x2c31cc){_0x364d12=_0x364d12-0x0;var _0x521308=_0x363e[_0x364d12];return _0x521308;};'use strict';var multer=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var path=require(_0xe363('0x2'));var timeout=require(_0xe363('0x3'));var express=require(_0xe363('0x4'));var router=express[_0xe363('0x5')]();var auth=require(_0xe363('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe363('0x7'));var controller=require('./plugin.controller');router[_0xe363('0x8')]('/',auth[_0xe363('0x9')](),controller[_0xe363('0xa')]);router['get'](_0xe363('0xb'),controller[_0xe363('0xc')]);router[_0xe363('0x8')](_0xe363('0xd'),auth[_0xe363('0x9')](),controller[_0xe363('0xe')]);router['get']('/:id/download',auth[_0xe363('0x9')](),controller[_0xe363('0xf')]);var upload=multer({'storage':multer[_0xe363('0x10')]({'destination':function(_0x4e7d9e,_0x2f73ac,_0x19956a){_0x19956a(null,path[_0xe363('0x11')](config[_0xe363('0x12')],_0xe363('0x13')));},'filename':function(_0x3e261d,_0x418e8b,_0x505313){_0x418e8b[_0xe363('0x14')]=_0x418e8b[_0xe363('0x14')][_0xe363('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x505313(null,util[_0xe363('0x16')](_0xe363('0x17'),path[_0xe363('0x18')](_0x418e8b[_0xe363('0x14')],path[_0xe363('0x19')](_0x418e8b[_0xe363('0x14')])),Date[_0xe363('0x1a')](),path[_0xe363('0x19')](_0x418e8b[_0xe363('0x14')])));}})});router[_0xe363('0x1b')]('/',upload[_0xe363('0x1c')](_0xe363('0x1d')),controller['upload']);router[_0xe363('0x1b')]('/webhook',controller[_0xe363('0x1e')]);router[_0xe363('0x1f')](_0xe363('0xd'),auth[_0xe363('0x9')](),controller[_0xe363('0x20')]);router[_0xe363('0x21')](_0xe363('0xd'),auth[_0xe363('0x9')](),controller['delete']);module[_0xe363('0x22')]=router; \ No newline at end of file +var _0x93d9=['./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4ce15c,_0x1bbcbd){var _0x5ee259=function(_0xfb0acd){while(--_0xfb0acd){_0x4ce15c['push'](_0x4ce15c['shift']());}};_0x5ee259(++_0x1bbcbd);}(_0x93d9,0x14e));var _0x993d=function(_0x332731,_0x4d9696){_0x332731=_0x332731-0x0;var _0x31cdf4=_0x93d9[_0x332731];return _0x31cdf4;};'use strict';var multer=require(_0x993d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x993d('0x1'));var express=require(_0x993d('0x2'));var router=express[_0x993d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x993d('0x4'));var config=require(_0x993d('0x5'));var controller=require(_0x993d('0x6'));router[_0x993d('0x7')]('/',auth['isAuthenticated'](),controller[_0x993d('0x8')]);router[_0x993d('0x7')](_0x993d('0x9'),controller[_0x993d('0xa')]);router[_0x993d('0x7')](_0x993d('0xb'),auth[_0x993d('0xc')](),controller[_0x993d('0xd')]);router['get'](_0x993d('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x993d('0xf')]({'destination':function(_0x1224b9,_0x181c2d,_0x4e27e9){_0x4e27e9(null,path[_0x993d('0x10')](config[_0x993d('0x11')],_0x993d('0x12')));},'filename':function(_0x688e0b,_0x3b669b,_0xee1d16){_0x3b669b[_0x993d('0x13')]=_0x3b669b[_0x993d('0x13')][_0x993d('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xee1d16(null,util[_0x993d('0x15')](_0x993d('0x16'),path['basename'](_0x3b669b[_0x993d('0x13')],path[_0x993d('0x17')](_0x3b669b['originalname'])),Date[_0x993d('0x18')](),path['extname'](_0x3b669b[_0x993d('0x13')])));}})});router[_0x993d('0x19')]('/',upload[_0x993d('0x1a')](_0x993d('0x1b')),controller[_0x993d('0x1c')]);router[_0x993d('0x19')]('/webhook',controller[_0x993d('0x1d')]);router[_0x993d('0x1e')](_0x993d('0xb'),auth[_0x993d('0xc')](),controller[_0x993d('0x1f')]);router['delete']('/:id',auth[_0x993d('0xc')](),controller[_0x993d('0x20')]);module[_0x993d('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4216a1e..da12fb9 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 _0xab44=['STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xab44,0xe2));var _0x4ab4=function(_0x1390c3,_0x3bb90e){_0x1390c3=_0x1390c3-0x0;var _0x444609=_0xab44[_0x1390c3];return _0x444609;};'use strict';var Sequelize=require(_0x4ab4('0x0'));module[_0x4ab4('0x1')]={'name':{'type':Sequelize[_0x4ab4('0x2')]},'type':{'type':Sequelize[_0x4ab4('0x3')](_0x4ab4('0x4'),_0x4ab4('0x5'))},'description':{'type':Sequelize[_0x4ab4('0x6')]},'version':{'type':Sequelize[_0x4ab4('0x6')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':0x0,'comment':_0x4ab4('0x8')},'sidebar':{'type':Sequelize[_0x4ab4('0x3')]('adminOnly',_0x4ab4('0x9'),_0x4ab4('0xa'),'never'),'defaultValue':_0x4ab4('0xa'),'comment':_0x4ab4('0xb')},'icon':{'type':Sequelize[_0x4ab4('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x4ab4('0x2')]},'scriptPath':{'type':Sequelize[_0x4ab4('0x2')]}}; \ No newline at end of file +var _0x0e89=['ENUM','html','STRING','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x0e89,0x77));var _0x90e8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0e89[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x90e8('0x0'));module[_0x90e8('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x90e8('0x2')](_0x90e8('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x90e8('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x90e8('0x5')},'sidebar':{'type':Sequelize[_0x90e8('0x2')](_0x90e8('0x6'),_0x90e8('0x7'),_0x90e8('0x8'),_0x90e8('0x9')),'defaultValue':'always','comment':_0x90e8('0xa')},'icon':{'type':Sequelize[_0x90e8('0x4')]},'adminUrl':{'type':Sequelize[_0x90e8('0x4')]},'agentUrl':{'type':Sequelize[_0x90e8('0x4')]},'scriptName':{'type':Sequelize[_0x90e8('0x4')]},'scriptPath':{'type':Sequelize[_0x90e8('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 8a710b1..52e4686 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 _0x3437=['update','then','destroy','get','UserProfileResource','error','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','format','%s%s','headers','content-length','statusCode','webhookPost','http://localhost:','content-type','set','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','querystring','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x6c7f6f,_0x4c9659){var _0x279db4=function(_0x380692){while(--_0x380692){_0x6c7f6f['push'](_0x6c7f6f['shift']());}};_0x279db4(++_0x4c9659);}(_0x3437,0x1e0));var _0x7343=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3437[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x7343('0x0'));var emlformat=require(_0x7343('0x1'));var rimraf=require(_0x7343('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7343('0x3'));var moment=require('moment');var BPromise=require(_0x7343('0x4'));var Mustache=require(_0x7343('0x5'));var util=require('util');var path=require(_0x7343('0x6'));var sox=require(_0x7343('0x7'));var csv=require('to-csv');var ejs=require(_0x7343('0x8'));var fs=require('fs');var _=require(_0x7343('0x9'));var squel=require('squel');var crypto=require(_0x7343('0xa'));var jsforce=require(_0x7343('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7343('0xc'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x7343('0xd'));var Redis=require(_0x7343('0xe'));var authService=require(_0x7343('0xf'));var qs=require(_0x7343('0x10'));var hardwareService=require(_0x7343('0x11'));var logger=require(_0x7343('0x12'))(_0x7343('0x13'));var utils=require(_0x7343('0x14'));var config=require(_0x7343('0x15'));var db=require(_0x7343('0x16'))['db'];config['redis']=_[_0x7343('0x17')](config[_0x7343('0x18')],{'host':_0x7343('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7343('0x18')]));require(_0x7343('0x1a'))[_0x7343('0x1b')](socket);function respondWithStatusCode(_0x16f6b3,_0x59bf58){_0x59bf58=_0x59bf58||0xcc;return function(_0x1719ec){if(_0x1719ec){return _0x16f6b3[_0x7343('0x1c')](_0x59bf58);}return _0x16f6b3[_0x7343('0x1d')](_0x59bf58)[_0x7343('0x1e')]();};}function respondWithResult(_0x6c871a,_0x479e2e){_0x479e2e=_0x479e2e||0xc8;return function(_0x4d22b4){if(_0x4d22b4){return _0x6c871a[_0x7343('0x1d')](_0x479e2e)[_0x7343('0x1f')](_0x4d22b4);}};}function respondWithFilteredResult(_0x30a2da,_0x5c0648){return function(_0x340d3d){if(_0x340d3d){var _0x5dd801=_0x340d3d[_0x7343('0x20')],_0x22c8c7=_0x5c0648[_0x7343('0x21')],_0xfd2bbf=_0x5c0648[_0x7343('0x21')]+_0x5c0648[_0x7343('0x22')],_0x4cb395;if(_0xfd2bbf>=_0x5dd801){_0xfd2bbf=_0x5dd801;_0x4cb395=0xc8;}else{_0x4cb395=0xce;}_0x30a2da['status'](_0x4cb395);return _0x30a2da['set'](_0x7343('0x23'),_0x22c8c7+'-'+_0xfd2bbf+'/'+_0x5dd801)[_0x7343('0x1f')](_0x340d3d);}return null;};}function patchUpdates(_0x108356){return function(_0x108032){try{jsonpatch[_0x7343('0x24')](_0x108032,_0x108356,!![]);}catch(_0x1b3485){return BPromise[_0x7343('0x25')](_0x1b3485);}return _0x108032[_0x7343('0x26')]();};}function saveUpdates(_0x4a4d17,_0x16e53f){return function(_0x301177){if(_0x301177){return _0x301177[_0x7343('0x27')](_0x4a4d17)[_0x7343('0x28')](function(_0x451c96){return _0x451c96;});}return null;};}function removeEntity(_0x2d3347,_0x570b13){return function(_0x1f9ab0){if(_0x1f9ab0){return _0x1f9ab0[_0x7343('0x29')]()[_0x7343('0x28')](function(){var _0x3c3834=_0x1f9ab0[_0x7343('0x2a')]({'plain':!![]});var _0x3bb012='Plugins';return db[_0x7343('0x2b')][_0x7343('0x29')]({'where':{'type':_0x3bb012,'resourceId':_0x3c3834['id']}})[_0x7343('0x28')](function(){return _0x1f9ab0;});})[_0x7343('0x28')](function(){_0x2d3347[_0x7343('0x1d')](0xcc)[_0x7343('0x1e')]();});}};}function handleEntityNotFound(_0x2da240,_0x2c39d4){return function(_0x18fa55){if(!_0x18fa55){_0x2da240['sendStatus'](0x194);}return _0x18fa55;};}function handleError(_0x3695b2,_0xe1550d){_0xe1550d=_0xe1550d||0x1f4;return function(_0x371ae7){logger[_0x7343('0x2c')](_0x371ae7[_0x7343('0x2d')]);if(_0x371ae7[_0x7343('0x2e')]){delete _0x371ae7[_0x7343('0x2e')];}_0x3695b2[_0x7343('0x1d')](_0xe1550d)[_0x7343('0x2f')](_0x371ae7);};}exports[_0x7343('0x30')]=function(_0x2f902c,_0x57abfb){var _0x150768={},_0xc611a5={},_0x2b0193={'count':0x0,'rows':[]};var _0x2d9c44=db['Plugin']['rawAttributes'];_0xc611a5['model']=_[_0x7343('0x31')](_0x2d9c44);_0xc611a5[_0x7343('0x32')]=_['keys'](_0x2f902c[_0x7343('0x32')]);_0xc611a5[_0x7343('0x33')]=_[_0x7343('0x34')](_0xc611a5[_0x7343('0x35')],_0xc611a5[_0x7343('0x32')]);_0x150768[_0x7343('0x36')]=_[_0x7343('0x34')](_0xc611a5[_0x7343('0x35')],qs[_0x7343('0x37')](_0x2f902c[_0x7343('0x32')][_0x7343('0x37')]));_0x150768['attributes']=_0x150768[_0x7343('0x36')]['length']?_0x150768[_0x7343('0x36')]:_0xc611a5[_0x7343('0x35')];if(!_0x2f902c[_0x7343('0x32')][_0x7343('0x38')](_0x7343('0x39'))){_0x150768[_0x7343('0x22')]=qs['limit'](_0x2f902c['query']['limit']);_0x150768[_0x7343('0x21')]=qs[_0x7343('0x21')](_0x2f902c[_0x7343('0x32')][_0x7343('0x21')]);}_0x150768[_0x7343('0x3a')]=qs[_0x7343('0x3b')](_0x2f902c[_0x7343('0x32')]['sort']);_0x150768[_0x7343('0x3c')]=qs[_0x7343('0x33')](_['pick'](_0x2f902c['query'],_0xc611a5[_0x7343('0x33')]));if(_0x2f902c['query'][_0x7343('0x3d')]){_0x150768['where']=_[_0x7343('0x3e')](_0x150768['where'],{'$or':_[_0x7343('0x3f')](_0x2d9c44,function(_0x56f845){if(_0x56f845[_0x7343('0x40')][_0x7343('0x41')]!==_0x7343('0x42')){var _0x561ac3={};_0x561ac3[_0x56f845[_0x7343('0x43')]]={'$like':'%'+_0x2f902c[_0x7343('0x32')]['filter']+'%'};return _0x561ac3;}})});}_0x150768=_[_0x7343('0x3e')]({},_0x150768,_0x2f902c[_0x7343('0x44')]);var _0x5eae9a={'where':_0x150768['where']};return db[_0x7343('0x45')][_0x7343('0x20')](_0x5eae9a)['then'](function(_0x4b80aa){_0x2b0193[_0x7343('0x20')]=_0x4b80aa;if(_0x2f902c['query'][_0x7343('0x46')]){_0x150768[_0x7343('0x47')]=[{'all':!![]}];}return db[_0x7343('0x45')][_0x7343('0x48')](_0x150768);})[_0x7343('0x28')](function(_0x4efabc){_0x2b0193[_0x7343('0x49')]=_0x4efabc;return _0x2b0193;})[_0x7343('0x28')](respondWithFilteredResult(_0x57abfb,_0x150768))[_0x7343('0x4a')](handleError(_0x57abfb,null));};exports[_0x7343('0x4b')]=function(_0x5b53d3,_0x585e5a){var _0x4522e9={'raw':!![],'where':{'id':_0x5b53d3[_0x7343('0x4c')]['id']}},_0xe70a16={};_0xe70a16[_0x7343('0x35')]=_[_0x7343('0x31')](db[_0x7343('0x45')]['rawAttributes']);_0xe70a16[_0x7343('0x32')]=_[_0x7343('0x31')](_0x5b53d3['query']);_0xe70a16['filters']=_[_0x7343('0x34')](_0xe70a16['model'],_0xe70a16[_0x7343('0x32')]);_0x4522e9[_0x7343('0x36')]=_[_0x7343('0x34')](_0xe70a16[_0x7343('0x35')],qs['fields'](_0x5b53d3[_0x7343('0x32')]['fields']));_0x4522e9['attributes']=_0x4522e9[_0x7343('0x36')]['length']?_0x4522e9[_0x7343('0x36')]:_0xe70a16[_0x7343('0x35')];if(_0x5b53d3[_0x7343('0x32')][_0x7343('0x46')]){_0x4522e9['include']=[{'all':!![]}];}_0x4522e9=_[_0x7343('0x3e')]({},_0x4522e9,_0x5b53d3[_0x7343('0x44')]);return db[_0x7343('0x45')][_0x7343('0x4d')](_0x4522e9)[_0x7343('0x28')](handleEntityNotFound(_0x585e5a,null))[_0x7343('0x28')](respondWithResult(_0x585e5a,null))[_0x7343('0x4a')](handleError(_0x585e5a,null));};exports[_0x7343('0x4e')]=function(_0x392bd1,_0x168c6b,_0x26c155){return db['Plugin'][_0x7343('0x4d')]({'where':{'id':_0x392bd1['params']['id']},'attributes':[_0x7343('0x2e'),_0x7343('0x6')],'raw':!![]})[_0x7343('0x28')](handleEntityNotFound(_0x168c6b,null))[_0x7343('0x28')](function(_0x38e873){if(_0x38e873){var _0x2236b1=path[_0x7343('0x4f')](config[_0x7343('0x50')],_0x7343('0x51'),util['format']('%s.zip',path[_0x7343('0x52')](_0x38e873['path'])));var _0x385d2a=fs['createWriteStream'](_0x2236b1);var _0xcd862c=archiver('zip',{'zlib':{'level':0x9}});_0xcd862c['on'](_0x7343('0x53'),function(_0x22fb1f){if(_0x22fb1f[_0x7343('0x54')]===_0x7343('0x55')){logger[_0x7343('0x2c')](_0x22fb1f);}else{throw new db[(_0x7343('0x56'))][(_0x7343('0x57'))](_0x7343('0x58'));}});_0xcd862c['on'](_0x7343('0x2c'),function(_0x16a66c){throw new db[(_0x7343('0x56'))][(_0x7343('0x57'))](_0x7343('0x58'));});_0xcd862c['pipe'](_0x385d2a);_0xcd862c['glob'](_0x7343('0x59'),{'cwd':path[_0x7343('0x4f')](config[_0x7343('0x50')],'server/files/plugins',path['dirname'](_0x38e873['path'])),'ignore':[path['join'](path[_0x7343('0x52')](_0x38e873[_0x7343('0x6')]),_0x7343('0x5a')),path[_0x7343('0x4f')](path[_0x7343('0x52')](_0x38e873[_0x7343('0x6')]),_0x7343('0x5b'))],'nodir':!![]})[_0x7343('0x5c')]();_0x385d2a['on'](_0x7343('0x5d'),function(){if(!fs[_0x7343('0x5e')](_0x2236b1)){throw new db[(_0x7343('0x56'))]['Error']('Plugin\x20not\x20found');}return _0x168c6b[_0x7343('0x4e')](_0x2236b1,util['format']('%s.zip',path[_0x7343('0x52')](_0x38e873[_0x7343('0x6')])),function(_0x1cfa41){if(_0x1cfa41){throw new db[(_0x7343('0x56'))][(_0x7343('0x57'))](_0x7343('0x5f'));}fs['unlinkSync'](_0x2236b1);logger['info'](_0x7343('0x60'));logger['info'](_0x7343('0x61'));});});}return null;})[_0x7343('0x4a')](handleError(_0x168c6b,null));};exports[_0x7343('0x62')]=function(_0x250e15,_0x386066,_0xa588ec){var _0x107af5=path[_0x7343('0x52')](_0x250e15[_0x7343('0x63')][_0x7343('0x64')],path['extname'](_0x250e15['file'][_0x7343('0x64')]));var _0x169333=path[_0x7343('0x4f')](config[_0x7343('0x50')],'server/files/plugins',_0x250e15[_0x7343('0x63')][_0x7343('0x64')]);var _0x4bbf09=path[_0x7343('0x4f')](config['root'],_0x7343('0x51'),_0x107af5);logger[_0x7343('0x65')](_0x7343('0x66'),_0x169333);logger[_0x7343('0x65')](_0x7343('0x67'),_0x4bbf09);try{fs[_0x7343('0x68')](_0x169333,parseInt(_0x7343('0x69'),0x8));extract(_0x169333,{'dir':_0x4bbf09},function(_0x40c572){if(_0x40c572){logger[_0x7343('0x2c')](_0x40c572);handleError(_0x40c572,!![]);};var _0x466948=fs[_0x7343('0x6a')](_0x4bbf09);if(_0x466948[_0x7343('0x6b')]>0x1){removeReferences(_0x169333,_0x4bbf09);logger[_0x7343('0x2c')]('Invalid\x20plugin\x20structure');return _0xa588ec(new Error(_0x7343('0x6c')));}var _0xa8ca00=fs[_0x7343('0x6d')](path[_0x7343('0x4f')](_0x4bbf09,_0x466948[0x0]));if(_0xa8ca00[_0x7343('0x6e')]()){removeReferences(_0x169333,_0x4bbf09);logger['error'](_0x7343('0x6c'));return _0xa588ec(new Error(_0x7343('0x6c')));}if(_0xa8ca00[_0x7343('0x6f')]()){var _0x430575=fs[_0x7343('0x6a')](path[_0x7343('0x4f')](_0x4bbf09,_0x466948[0x0]));if(_0x430575[_0x7343('0x6b')]===0x0){removeReferences(_0x169333,_0x4bbf09);logger['error'](_0x7343('0x6c'));return _0xa588ec(new Error('Invalid\x20plugin\x20structure'));}var _0x38308a=_0x430575['some'](function(_0x52948c){return _0x52948c===_0x7343('0x70');});if(!_0x38308a){return _0xa588ec(new Error(_0x7343('0x71')));}var _0x1da5f6=fs['readFileSync'](path[_0x7343('0x4f')](_0x4bbf09,_0x466948[0x0],'manifest.json'));var _0x43ff35=JSON[_0x7343('0x72')](_0x1da5f6);if(_0x7343('0x73')==typeof _0x43ff35[_0x7343('0x2e')]){return _0xa588ec(new Error(_0x7343('0x74')));}if(_0x7343('0x73')==typeof _0x43ff35[_0x7343('0x40')]){return _0xa588ec(new Error(_0x7343('0x75')));}if(_0x7343('0x73')==typeof _0x43ff35[_0x7343('0x76')]){return _0xa588ec(new Error(_0x7343('0x77')));}if(_0x7343('0x73')==typeof _0x43ff35[_0x7343('0x78')]){return _0xa588ec(new Error(_0x7343('0x79')));}if(_0x43ff35[_0x7343('0x40')]===_0x7343('0x7a')){if(_0x7343('0x73')==typeof _0x43ff35['parameters'][_0x7343('0x7b')]){return _0xa588ec(new Error(_0x7343('0x7c')));}if(_0x7343('0x73')==typeof _0x43ff35['parameters'][_0x7343('0x7b')][_0x7343('0x7d')]&&'undefined'==typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x7b')][_0x7343('0x7e')]){return _0xa588ec(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x43ff35['type']===_0x7343('0x7f')){if(_0x7343('0x73')==typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x80')]){return _0xa588ec(new Error(_0x7343('0x81')));}if('undefined'==typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x82')]){return _0xa588ec(new Error(_0x7343('0x83')));}}else{return _0xa588ec(new Error(_0x7343('0x84')));}var _0x574cf4=_0x43ff35[_0x7343('0x2e')];var _0x5d7289=_0x43ff35[_0x7343('0x85')];var _0x5b1d32=_0x43ff35['type'];var _0x1426e6=_0x43ff35['sidebar']?_0x43ff35[_0x7343('0x86')]:_0x7343('0x87');var _0x317964=_0x43ff35[_0x7343('0x88')]?_0x43ff35[_0x7343('0x88')]:_0x7343('0x89');var _0x5260e5='';var _0x1d13f8='';var _0x41827e='';var _0xb9a9b3='';var _0x3b3352=_0x43ff35[_0x7343('0x76')];if(_0x5b1d32===_0x7343('0x7a')){if(_0x7343('0x73')!=typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x7b')][_0x7343('0x7d')]){var _0xfb2e0e=_0x43ff35[_0x7343('0x78')][_0x7343('0x7b')][_0x7343('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x7343('0x8a')](_0xfb2e0e)){_0x5260e5=path[_0x7343('0x4f')](_0x7343('0x8b'),_0x107af5,_0x466948[0x0],_0xfb2e0e);}else{_0x5260e5=_0xfb2e0e;}}else{logger[_0x7343('0x65')](_0x7343('0x8c'));}if(_0x7343('0x73')!=typeof _0x43ff35['parameters'][_0x7343('0x7b')][_0x7343('0x7e')]){var _0x1ff884=_0x43ff35['parameters'][_0x7343('0x7b')][_0x7343('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1ff884)){_0x1d13f8=path[_0x7343('0x4f')](_0x7343('0x8b'),_0x107af5,_0x466948[0x0],_0x1ff884);}else{_0x1d13f8=_0x1ff884;}}else{logger[_0x7343('0x65')](_0x7343('0x8d'));}}else if(_0x5b1d32===_0x7343('0x7f')){_0x41827e=_0x43ff35[_0x7343('0x78')][_0x7343('0x80')];_0xb9a9b3=_0x43ff35['parameters'][_0x7343('0x82')];if('undefined'!=typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x7b')]){if('undefined'!=typeof _0x43ff35['parameters']['views'][_0x7343('0x7d')]){var _0xfb2e0e=_0x43ff35[_0x7343('0x78')][_0x7343('0x7b')][_0x7343('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x7343('0x8a')](_0xfb2e0e)){_0x5260e5=path[_0x7343('0x4f')](_0x7343('0x8b'),_0x107af5,_0x466948[0x0],_0xfb2e0e);}else{_0x5260e5=_0xfb2e0e;}}if(_0x7343('0x73')!=typeof _0x43ff35[_0x7343('0x78')][_0x7343('0x7b')][_0x7343('0x7e')]){var _0x1ff884=_0x43ff35[_0x7343('0x78')]['views'][_0x7343('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x7343('0x8a')](_0x1ff884)){_0x1d13f8=path[_0x7343('0x4f')](_0x7343('0x8b'),_0x107af5,_0x466948[0x0],_0x1ff884);}else{_0x1d13f8=_0x1ff884;}}}}var _0x54c410={'name':_0x574cf4,'description':_0x5d7289,'path':path['join'](_0x107af5,_0x466948[0x0]),'type':_0x5b1d32,'sidebar':_0x1426e6,'icon':_0x317964,'adminUrl':_0x5260e5,'agentUrl':_0x1d13f8,'scriptName':_0x41827e,'scriptPath':_0xb9a9b3,'version':_0x3b3352};removeReferences(_0x169333,null);return db[_0x7343('0x45')][_0x7343('0x8e')](_0x54c410)['then'](function(_0x374c42){var _0x148171={'role':_0x250e15[_0x7343('0x8f')][_0x7343('0x90')],'userProfileId':_0x250e15[_0x7343('0x8f')][_0x7343('0x91')]};if(!_0x148171)throw new Error(_0x7343('0x92'));if(_0x148171[_0x7343('0x90')]===_0x7343('0x93')){var _0x45e2fc=_0x374c42[_0x7343('0x2a')]({'plain':!![]});return db[_0x7343('0x94')]['find']({'where':{'name':_0x7343('0x95'),'userProfileId':_0x148171[_0x7343('0x91')]},'raw':!![]})[_0x7343('0x28')](function(_0x19e206){if(_0x19e206&&_0x19e206[_0x7343('0x96')]===0x0){return db[_0x7343('0x2b')]['create']({'name':_0x45e2fc[_0x7343('0x2e')],'resourceId':_0x45e2fc['id'],'type':_0x19e206[_0x7343('0x2e')],'sectionId':_0x19e206['id']},{})[_0x7343('0x28')](function(){return _0x374c42;});}else{return _0x374c42;}})['catch'](function(_0x119457){logger[_0x7343('0x2c')](_0x7343('0x97'),_0x119457);throw _0x119457;});}return _0x374c42;})[_0x7343('0x28')](respondWithResult(_0x386066,null))[_0x7343('0x4a')](handleError(_0x386066,null));}});}catch(_0x198b0f){_0x386066[_0x7343('0x1d')](0x1f4)[_0x7343('0x2f')](_0x198b0f);}};function removeReferences(_0x240376,_0x4797ae){try{if(_0x240376){fs[_0x7343('0x98')](_0x240376);logger['info'](_0x7343('0x99'));}if(_0x4797ae){rimraf(_0x4797ae,function(){});logger[_0x7343('0x65')](_0x7343('0x9a'));}}catch(_0x438c42){logger[_0x7343('0x2c')](_0x438c42);}}exports[_0x7343('0x27')]=function(_0x2dc79a,_0x3fed62,_0x303ae4){return db['Plugin'][_0x7343('0x4d')]({'where':{'id':_0x2dc79a[_0x7343('0x4c')]['id']}})[_0x7343('0x28')](handleEntityNotFound(_0x3fed62,null))[_0x7343('0x28')](saveUpdates(_0x2dc79a[_0x7343('0x8f')],null))[_0x7343('0x28')](respondWithResult(_0x3fed62,null))[_0x7343('0x4a')](handleError(_0x3fed62,null));};exports['delete']=function(_0x454709,_0x4cd02f,_0x6d3c8f){return db[_0x7343('0x45')]['find']({'where':{'id':_0x454709[_0x7343('0x4c')]['id']}})[_0x7343('0x28')](function(_0xf02f9){if(_0xf02f9){return _0xf02f9[_0x7343('0x29')]();}})['then'](function(_0x37643f){rimraf(path[_0x7343('0x4f')](config[_0x7343('0x50')],_0x7343('0x51'),path[_0x7343('0x9b')](_0x37643f[_0x7343('0x6')])),function(){});return _0x37643f;})[_0x7343('0x28')](handleEntityNotFound(_0x4cd02f,null))['then'](respondWithStatusCode(_0x4cd02f,null))['catch'](handleError(_0x4cd02f,null));};exports[_0x7343('0x9c')]=function(_0xa4bafa,_0x33559c,_0x457fec){return BPromise[_0x7343('0x9d')]()[_0x7343('0x28')](function(){if(!_0xa4bafa['query'][_0x7343('0x6')]){throw new Error(_0x7343('0x9e'));}if(!_0xa4bafa[_0x7343('0x32')][_0x7343('0x9f')]){throw new Error(_0x7343('0xa0'));}var _0x78a8e7=_0xa4bafa[_0x7343('0x32')][_0x7343('0xa1')]?_0xa4bafa[_0x7343('0x32')][_0x7343('0xa1')]+':'+_0xa4bafa[_0x7343('0x32')][_0x7343('0x9f')]:'http://localhost:'+_0xa4bafa['query']['port'];var _0x2a7623=_0xa4bafa[_0x7343('0x32')][_0x7343('0x1f')]?_0xa4bafa[_0x7343('0x32')][_0x7343('0x1f')]:!![];var _0x1e25fe=_0xa4bafa['query'][_0x7343('0xa2')]?_0xa4bafa[_0x7343('0x32')]['encoding']:null;var _0x57dd8f={'method':_0xa4bafa[_0x7343('0xa3')],'uri':util[_0x7343('0xa4')](_0x7343('0xa5'),_0x78a8e7,_0xa4bafa[_0x7343('0x32')][_0x7343('0x6')]),'json':_0x2a7623,'resolveWithFullResponse':!![],'encoding':_0x1e25fe,'qs':_0xa4bafa[_0x7343('0x32')]};if(_0xa4bafa[_0x7343('0xa6')]){_0x57dd8f[_0x7343('0xa6')]=_0xa4bafa[_0x7343('0xa6')];if(_0x57dd8f[_0x7343('0xa6')][_0x7343('0xa7')]){delete _0x57dd8f['headers'][_0x7343('0xa7')];}}if(_0x57dd8f[_0x7343('0xa6')]['content-type']){delete _0x57dd8f[_0x7343('0xa6')]['content-type'];}return rp(_0x57dd8f);})[_0x7343('0x28')](function(_0x39606b){if(_0x39606b){_0x33559c['set'](_0x39606b[_0x7343('0xa6')]);logger[_0x7343('0x65')](_0x39606b['body']);if(_['endsWith'](_0xa4bafa[_0x7343('0x32')][_0x7343('0x6')],_0x7343('0x4e'))&&_0x39606b['statusCode']==0x1f4){return _0x33559c[_0x7343('0x1c')](_0x39606b[_0x7343('0xa8')]);}else{return _0x33559c[_0x7343('0x1d')](_0x39606b[_0x7343('0xa8')])[_0x7343('0x2f')](_0x39606b[_0x7343('0x8f')]);}}else{return _0x33559c[_0x7343('0x1c')](0xc8);}})[_0x7343('0x4a')](handleError(_0x33559c,null));};exports[_0x7343('0xa9')]=function(_0x1cfbe6,_0x5867e5,_0x542796){return BPromise[_0x7343('0x9d')]()[_0x7343('0x28')](function(){if(!_0x1cfbe6['query'][_0x7343('0x6')]){throw new Error(_0x7343('0x9e'));}if(!_0x1cfbe6['query'][_0x7343('0x9f')]){throw new Error(_0x7343('0xa0'));}var _0x2e17f8=_0x1cfbe6[_0x7343('0x32')]['hostname']?_0x1cfbe6[_0x7343('0x32')][_0x7343('0xa1')]+':'+_0x1cfbe6[_0x7343('0x32')][_0x7343('0x9f')]:_0x7343('0xaa')+_0x1cfbe6[_0x7343('0x32')]['port'];var _0x91f27a=_0x1cfbe6[_0x7343('0x32')][_0x7343('0x1f')]?_0x1cfbe6[_0x7343('0x32')][_0x7343('0x1f')]:!![];var _0x531f8d=_0x1cfbe6[_0x7343('0x32')][_0x7343('0xa2')]?_0x1cfbe6['query'][_0x7343('0xa2')]:null;var _0x283df8={'method':_0x1cfbe6[_0x7343('0xa3')],'uri':util['format'](_0x7343('0xa5'),_0x2e17f8,_0x1cfbe6[_0x7343('0x32')]['path']),'json':_0x91f27a,'resolveWithFullResponse':!![],'encoding':_0x531f8d,'body':_0x1cfbe6[_0x7343('0x8f')]};if(_0x1cfbe6[_0x7343('0xa6')]){_0x283df8[_0x7343('0xa6')]=_0x1cfbe6[_0x7343('0xa6')];if(_0x283df8[_0x7343('0xa6')][_0x7343('0xa7')]){delete _0x283df8[_0x7343('0xa6')][_0x7343('0xa7')];}}if(_0x283df8[_0x7343('0xa6')]['content-type']){delete _0x283df8['headers'][_0x7343('0xab')];}return rp(_0x283df8);})[_0x7343('0x28')](function(_0x154e81){if(_0x154e81){_0x5867e5[_0x7343('0xac')](_0x154e81[_0x7343('0xa6')]);logger['info'](_0x154e81[_0x7343('0x8f')]);return _0x5867e5[_0x7343('0x1d')](_0x154e81[_0x7343('0xa8')])[_0x7343('0x2f')](_0x154e81['body']);}else{return _0x5867e5[_0x7343('0x1c')](0xc8);}})['catch'](handleError(_0x5867e5,null));}; \ No newline at end of file +var _0x0b13=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','where','merge','map','key','VIRTUAL','filter','options','includeAll','include','Plugin','findAll','rows','catch','show','params','find','join','server/files/plugins','%s.zip','basename','zip','code','ENOENT','Error','Sequelize','pipe','glob','**/*','root','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','description','type','sidebar','always','icon','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x0b13,0x150));var _0x30b1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0b13[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x30b1('0x0'));var emlformat=require(_0x30b1('0x1'));var rimraf=require(_0x30b1('0x2'));var zipdir=require(_0x30b1('0x3'));var jsonpatch=require(_0x30b1('0x4'));var rp=require(_0x30b1('0x5'));var moment=require(_0x30b1('0x6'));var BPromise=require(_0x30b1('0x7'));var Mustache=require(_0x30b1('0x8'));var util=require(_0x30b1('0x9'));var path=require(_0x30b1('0xa'));var sox=require(_0x30b1('0xb'));var csv=require(_0x30b1('0xc'));var ejs=require(_0x30b1('0xd'));var fs=require('fs');var _=require(_0x30b1('0xe'));var squel=require(_0x30b1('0xf'));var crypto=require(_0x30b1('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x30b1('0x11'));var toCsv=require(_0x30b1('0xc'));var querystring=require(_0x30b1('0x12'));var Papa=require(_0x30b1('0x13'));var extract=require(_0x30b1('0x14'));var rimraf=require('rimraf');var archiver=require(_0x30b1('0x15'));var Redis=require(_0x30b1('0x16'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x30b1('0x17'));var logger=require(_0x30b1('0x18'))(_0x30b1('0x19'));var utils=require(_0x30b1('0x1a'));var config=require(_0x30b1('0x1b'));var db=require(_0x30b1('0x1c'))['db'];config[_0x30b1('0x1d')]=_[_0x30b1('0x1e')](config[_0x30b1('0x1d')],{'host':_0x30b1('0x1f'),'port':0x18eb});var socket=require(_0x30b1('0x20'))(new Redis(config[_0x30b1('0x1d')]));require(_0x30b1('0x21'))['register'](socket);function respondWithStatusCode(_0xa00136,_0x54ce6f){_0x54ce6f=_0x54ce6f||0xcc;return function(_0x812ee3){if(_0x812ee3){return _0xa00136[_0x30b1('0x22')](_0x54ce6f);}return _0xa00136[_0x30b1('0x23')](_0x54ce6f)[_0x30b1('0x24')]();};}function respondWithResult(_0x1ab642,_0x26c458){_0x26c458=_0x26c458||0xc8;return function(_0x9c46a6){if(_0x9c46a6){return _0x1ab642[_0x30b1('0x23')](_0x26c458)[_0x30b1('0x25')](_0x9c46a6);}};}function respondWithFilteredResult(_0x3ab005,_0x1666cb){return function(_0x47078d){if(_0x47078d){var _0x1ef404=_0x47078d[_0x30b1('0x26')],_0xa23ba3=_0x1666cb[_0x30b1('0x27')],_0x2aa391=_0x1666cb['offset']+_0x1666cb[_0x30b1('0x28')],_0x4d5fb1;if(_0x2aa391>=_0x1ef404){_0x2aa391=_0x1ef404;_0x4d5fb1=0xc8;}else{_0x4d5fb1=0xce;}_0x3ab005['status'](_0x4d5fb1);return _0x3ab005[_0x30b1('0x29')](_0x30b1('0x2a'),_0xa23ba3+'-'+_0x2aa391+'/'+_0x1ef404)[_0x30b1('0x25')](_0x47078d);}return null;};}function patchUpdates(_0xad9931){return function(_0x5134a8){try{jsonpatch[_0x30b1('0x2b')](_0x5134a8,_0xad9931,!![]);}catch(_0xe36387){return BPromise[_0x30b1('0x2c')](_0xe36387);}return _0x5134a8['save']();};}function saveUpdates(_0x3f302e,_0x3c3fb5){return function(_0x3dfeb4){if(_0x3dfeb4){return _0x3dfeb4[_0x30b1('0x2d')](_0x3f302e)[_0x30b1('0x2e')](function(_0x3324aa){return _0x3324aa;});}return null;};}function removeEntity(_0x10f254,_0x47539f){return function(_0x1f7bf4){if(_0x1f7bf4){return _0x1f7bf4[_0x30b1('0x2f')]()[_0x30b1('0x2e')](function(){var _0x538997=_0x1f7bf4[_0x30b1('0x30')]({'plain':!![]});var _0x558c83=_0x30b1('0x31');return db[_0x30b1('0x32')][_0x30b1('0x2f')]({'where':{'type':_0x558c83,'resourceId':_0x538997['id']}})[_0x30b1('0x2e')](function(){return _0x1f7bf4;});})[_0x30b1('0x2e')](function(){_0x10f254[_0x30b1('0x23')](0xcc)[_0x30b1('0x24')]();});}};}function handleEntityNotFound(_0x54823d,_0x36d812){return function(_0x155fbe){if(!_0x155fbe){_0x54823d['sendStatus'](0x194);}return _0x155fbe;};}function handleError(_0x111ef9,_0x56876d){_0x56876d=_0x56876d||0x1f4;return function(_0x21500f){logger[_0x30b1('0x33')](_0x21500f[_0x30b1('0x34')]);if(_0x21500f[_0x30b1('0x35')]){delete _0x21500f['name'];}_0x111ef9['status'](_0x56876d)['send'](_0x21500f);};}exports[_0x30b1('0x36')]=function(_0x3475aa,_0xf3cf9a){var _0x41c59b={},_0x2eb97c={},_0x360808={'count':0x0,'rows':[]};var _0xda8f78=db['Plugin'][_0x30b1('0x37')];_0x2eb97c[_0x30b1('0x38')]=_[_0x30b1('0x39')](_0xda8f78);_0x2eb97c[_0x30b1('0x3a')]=_[_0x30b1('0x39')](_0x3475aa[_0x30b1('0x3a')]);_0x2eb97c['filters']=_[_0x30b1('0x3b')](_0x2eb97c[_0x30b1('0x38')],_0x2eb97c[_0x30b1('0x3a')]);_0x41c59b[_0x30b1('0x3c')]=_[_0x30b1('0x3b')](_0x2eb97c[_0x30b1('0x38')],qs['fields'](_0x3475aa[_0x30b1('0x3a')][_0x30b1('0x3d')]));_0x41c59b['attributes']=_0x41c59b['attributes'][_0x30b1('0x3e')]?_0x41c59b[_0x30b1('0x3c')]:_0x2eb97c[_0x30b1('0x38')];if(!_0x3475aa[_0x30b1('0x3a')]['hasOwnProperty'](_0x30b1('0x3f'))){_0x41c59b['limit']=qs['limit'](_0x3475aa['query']['limit']);_0x41c59b[_0x30b1('0x27')]=qs[_0x30b1('0x27')](_0x3475aa[_0x30b1('0x3a')][_0x30b1('0x27')]);}_0x41c59b[_0x30b1('0x40')]=qs[_0x30b1('0x41')](_0x3475aa['query']['sort']);_0x41c59b['where']=qs[_0x30b1('0x42')](_['pick'](_0x3475aa['query'],_0x2eb97c[_0x30b1('0x42')]));if(_0x3475aa[_0x30b1('0x3a')]['filter']){_0x41c59b[_0x30b1('0x43')]=_[_0x30b1('0x44')](_0x41c59b[_0x30b1('0x43')],{'$or':_[_0x30b1('0x45')](_0xda8f78,function(_0x1c72a2){if(_0x1c72a2['type'][_0x30b1('0x46')]!==_0x30b1('0x47')){var _0x2b5fa2={};_0x2b5fa2[_0x1c72a2['field']]={'$like':'%'+_0x3475aa['query'][_0x30b1('0x48')]+'%'};return _0x2b5fa2;}})});}_0x41c59b=_['merge']({},_0x41c59b,_0x3475aa[_0x30b1('0x49')]);var _0x2f0749={'where':_0x41c59b[_0x30b1('0x43')]};return db['Plugin'][_0x30b1('0x26')](_0x2f0749)[_0x30b1('0x2e')](function(_0x49ce44){_0x360808[_0x30b1('0x26')]=_0x49ce44;if(_0x3475aa[_0x30b1('0x3a')][_0x30b1('0x4a')]){_0x41c59b[_0x30b1('0x4b')]=[{'all':!![]}];}return db[_0x30b1('0x4c')][_0x30b1('0x4d')](_0x41c59b);})[_0x30b1('0x2e')](function(_0x3b8243){_0x360808[_0x30b1('0x4e')]=_0x3b8243;return _0x360808;})[_0x30b1('0x2e')](respondWithFilteredResult(_0xf3cf9a,_0x41c59b))[_0x30b1('0x4f')](handleError(_0xf3cf9a,null));};exports[_0x30b1('0x50')]=function(_0x538e33,_0x62c2c9){var _0x39b111={'raw':!![],'where':{'id':_0x538e33[_0x30b1('0x51')]['id']}},_0x2cf68a={};_0x2cf68a[_0x30b1('0x38')]=_[_0x30b1('0x39')](db['Plugin']['rawAttributes']);_0x2cf68a[_0x30b1('0x3a')]=_[_0x30b1('0x39')](_0x538e33['query']);_0x2cf68a[_0x30b1('0x42')]=_[_0x30b1('0x3b')](_0x2cf68a['model'],_0x2cf68a[_0x30b1('0x3a')]);_0x39b111[_0x30b1('0x3c')]=_['intersection'](_0x2cf68a[_0x30b1('0x38')],qs['fields'](_0x538e33['query']['fields']));_0x39b111[_0x30b1('0x3c')]=_0x39b111[_0x30b1('0x3c')][_0x30b1('0x3e')]?_0x39b111[_0x30b1('0x3c')]:_0x2cf68a[_0x30b1('0x38')];if(_0x538e33['query'][_0x30b1('0x4a')]){_0x39b111[_0x30b1('0x4b')]=[{'all':!![]}];}_0x39b111=_[_0x30b1('0x44')]({},_0x39b111,_0x538e33[_0x30b1('0x49')]);return db[_0x30b1('0x4c')][_0x30b1('0x52')](_0x39b111)[_0x30b1('0x2e')](handleEntityNotFound(_0x62c2c9,null))[_0x30b1('0x2e')](respondWithResult(_0x62c2c9,null))[_0x30b1('0x4f')](handleError(_0x62c2c9,null));};exports['download']=function(_0x18d57e,_0x3c9d43,_0x4fb232){return db[_0x30b1('0x4c')][_0x30b1('0x52')]({'where':{'id':_0x18d57e[_0x30b1('0x51')]['id']},'attributes':[_0x30b1('0x35'),_0x30b1('0xa')],'raw':!![]})['then'](handleEntityNotFound(_0x3c9d43,null))[_0x30b1('0x2e')](function(_0x49336f){if(_0x49336f){var _0x1d949e=path[_0x30b1('0x53')](config['root'],_0x30b1('0x54'),util['format'](_0x30b1('0x55'),path[_0x30b1('0x56')](_0x49336f[_0x30b1('0xa')])));var _0x327505=fs['createWriteStream'](_0x1d949e);var _0xacf7f1=archiver(_0x30b1('0x57'),{'zlib':{'level':0x9}});_0xacf7f1['on']('warning',function(_0x13747a){if(_0x13747a[_0x30b1('0x58')]===_0x30b1('0x59')){logger[_0x30b1('0x33')](_0x13747a);}else{throw new db['Sequelize'][(_0x30b1('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xacf7f1['on'](_0x30b1('0x33'),function(_0x271017){throw new db[(_0x30b1('0x5b'))][(_0x30b1('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xacf7f1[_0x30b1('0x5c')](_0x327505);_0xacf7f1[_0x30b1('0x5d')](_0x30b1('0x5e'),{'cwd':path[_0x30b1('0x53')](config[_0x30b1('0x5f')],_0x30b1('0x54'),path[_0x30b1('0x60')](_0x49336f[_0x30b1('0xa')])),'ignore':[path[_0x30b1('0x53')](path[_0x30b1('0x56')](_0x49336f[_0x30b1('0xa')]),_0x30b1('0x61')),path['join'](path[_0x30b1('0x56')](_0x49336f['path']),'attachments/**/*')],'nodir':!![]})[_0x30b1('0x62')]();_0x327505['on'](_0x30b1('0x63'),function(){if(!fs[_0x30b1('0x64')](_0x1d949e)){throw new db[(_0x30b1('0x5b'))][(_0x30b1('0x5a'))](_0x30b1('0x65'));}return _0x3c9d43['download'](_0x1d949e,util[_0x30b1('0x66')](_0x30b1('0x55'),path[_0x30b1('0x56')](_0x49336f[_0x30b1('0xa')])),function(_0x5edbc3){if(_0x5edbc3){throw new db[(_0x30b1('0x5b'))]['Error'](_0x30b1('0x67'));}fs[_0x30b1('0x68')](_0x1d949e);logger['info']('Download\x20completed');logger[_0x30b1('0x69')](_0x30b1('0x6a'));});});}return null;})['catch'](handleError(_0x3c9d43,null));};exports[_0x30b1('0x6b')]=function(_0x2edc27,_0x19b692,_0x37a340){var _0x586bf5=path[_0x30b1('0x56')](_0x2edc27[_0x30b1('0x6c')]['filename'],path[_0x30b1('0x6d')](_0x2edc27[_0x30b1('0x6c')][_0x30b1('0x6e')]));var _0x217eba=path[_0x30b1('0x53')](config[_0x30b1('0x5f')],'server/files/plugins',_0x2edc27['file']['filename']);var _0x37d64c=path[_0x30b1('0x53')](config[_0x30b1('0x5f')],_0x30b1('0x54'),_0x586bf5);logger['info'](_0x30b1('0x6f'),_0x217eba);logger[_0x30b1('0x69')](_0x30b1('0x70'),_0x37d64c);try{fs[_0x30b1('0x71')](_0x217eba,parseInt('0777',0x8));extract(_0x217eba,{'dir':_0x37d64c},function(_0x24d3d9){if(_0x24d3d9){logger[_0x30b1('0x33')](_0x24d3d9);handleError(_0x24d3d9,!![]);};var _0x67c79f=fs[_0x30b1('0x72')](_0x37d64c);if(_0x67c79f[_0x30b1('0x3e')]>0x1){removeReferences(_0x217eba,_0x37d64c);logger['error'](_0x30b1('0x73'));return _0x37a340(new Error(_0x30b1('0x73')));}var _0x4c69ce=fs[_0x30b1('0x74')](path[_0x30b1('0x53')](_0x37d64c,_0x67c79f[0x0]));if(_0x4c69ce[_0x30b1('0x75')]()){removeReferences(_0x217eba,_0x37d64c);logger[_0x30b1('0x33')](_0x30b1('0x73'));return _0x37a340(new Error(_0x30b1('0x73')));}if(_0x4c69ce[_0x30b1('0x76')]()){var _0x168ce7=fs['readdirSync'](path[_0x30b1('0x53')](_0x37d64c,_0x67c79f[0x0]));if(_0x168ce7[_0x30b1('0x3e')]===0x0){removeReferences(_0x217eba,_0x37d64c);logger[_0x30b1('0x33')](_0x30b1('0x73'));return _0x37a340(new Error('Invalid\x20plugin\x20structure'));}var _0x1b7b9f=_0x168ce7['some'](function(_0x118b08){return _0x118b08===_0x30b1('0x77');});if(!_0x1b7b9f){return _0x37a340(new Error(_0x30b1('0x78')));}var _0x1afcd2=fs[_0x30b1('0x79')](path['join'](_0x37d64c,_0x67c79f[0x0],'manifest.json'));var _0x1126b3=JSON[_0x30b1('0x7a')](_0x1afcd2);if(_0x30b1('0x7b')==typeof _0x1126b3['name']){return _0x37a340(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x30b1('0x7b')==typeof _0x1126b3['type']){return _0x37a340(new Error(_0x30b1('0x7c')));}if('undefined'==typeof _0x1126b3[_0x30b1('0x7d')]){return _0x37a340(new Error(_0x30b1('0x7e')));}if(_0x30b1('0x7b')==typeof _0x1126b3[_0x30b1('0x7f')]){return _0x37a340(new Error(_0x30b1('0x80')));}if(_0x1126b3['type']===_0x30b1('0x81')){if(_0x30b1('0x7b')==typeof _0x1126b3['parameters'][_0x30b1('0x82')]){return _0x37a340(new Error(_0x30b1('0x83')));}if(_0x30b1('0x7b')==typeof _0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')][_0x30b1('0x84')]&&_0x30b1('0x7b')==typeof _0x1126b3['parameters']['views'][_0x30b1('0x85')]){return _0x37a340(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1126b3['type']===_0x30b1('0x86')){if(_0x30b1('0x7b')==typeof _0x1126b3[_0x30b1('0x7f')][_0x30b1('0x87')]){return _0x37a340(new Error(_0x30b1('0x88')));}if(_0x30b1('0x7b')==typeof _0x1126b3[_0x30b1('0x7f')]['scriptPath']){return _0x37a340(new Error(_0x30b1('0x89')));}}else{return _0x37a340(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x1d013c=_0x1126b3[_0x30b1('0x35')];var _0x54cecf=_0x1126b3[_0x30b1('0x8a')];var _0x97435e=_0x1126b3[_0x30b1('0x8b')];var _0x135c3a=_0x1126b3['sidebar']?_0x1126b3[_0x30b1('0x8c')]:_0x30b1('0x8d');var _0x3ec826=_0x1126b3[_0x30b1('0x8e')]?_0x1126b3[_0x30b1('0x8e')]:'icon-apps';var _0x578b1f='';var _0x594f52='';var _0x44d7b0='';var _0x47e387='';var _0x583399=_0x1126b3['version'];if(_0x97435e===_0x30b1('0x81')){if(_0x30b1('0x7b')!=typeof _0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')][_0x30b1('0x84')]){var _0x15222d=_0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')][_0x30b1('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x30b1('0x8f')](_0x15222d)){_0x578b1f=path['join'](_0x30b1('0x90'),_0x586bf5,_0x67c79f[0x0],_0x15222d);}else{_0x578b1f=_0x15222d;}}else{logger[_0x30b1('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x30b1('0x7b')!=typeof _0x1126b3['parameters']['views']['agent']){var _0x50e0c4=_0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x30b1('0x8f')](_0x50e0c4)){_0x594f52=path[_0x30b1('0x53')](_0x30b1('0x90'),_0x586bf5,_0x67c79f[0x0],_0x50e0c4);}else{_0x594f52=_0x50e0c4;}}else{logger[_0x30b1('0x69')](_0x30b1('0x91'));}}else if(_0x97435e===_0x30b1('0x86')){_0x44d7b0=_0x1126b3[_0x30b1('0x7f')][_0x30b1('0x87')];_0x47e387=_0x1126b3[_0x30b1('0x7f')][_0x30b1('0x92')];if(_0x30b1('0x7b')!=typeof _0x1126b3['parameters'][_0x30b1('0x82')]){if('undefined'!=typeof _0x1126b3['parameters'][_0x30b1('0x82')][_0x30b1('0x84')]){var _0x15222d=_0x1126b3['parameters'][_0x30b1('0x82')][_0x30b1('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x15222d)){_0x578b1f=path['join']('plugins',_0x586bf5,_0x67c79f[0x0],_0x15222d);}else{_0x578b1f=_0x15222d;}}if(_0x30b1('0x7b')!=typeof _0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')][_0x30b1('0x85')]){var _0x50e0c4=_0x1126b3[_0x30b1('0x7f')][_0x30b1('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x30b1('0x8f')](_0x50e0c4)){_0x594f52=path['join'](_0x30b1('0x90'),_0x586bf5,_0x67c79f[0x0],_0x50e0c4);}else{_0x594f52=_0x50e0c4;}}}}var _0x41f384={'name':_0x1d013c,'description':_0x54cecf,'path':path[_0x30b1('0x53')](_0x586bf5,_0x67c79f[0x0]),'type':_0x97435e,'sidebar':_0x135c3a,'icon':_0x3ec826,'adminUrl':_0x578b1f,'agentUrl':_0x594f52,'scriptName':_0x44d7b0,'scriptPath':_0x47e387,'version':_0x583399};removeReferences(_0x217eba,null);return db[_0x30b1('0x4c')][_0x30b1('0x93')](_0x41f384)['then'](function(_0x5dfcb5){var _0x115b7f={'role':_0x2edc27[_0x30b1('0x94')][_0x30b1('0x95')],'userProfileId':_0x2edc27['body'][_0x30b1('0x96')]};if(!_0x115b7f)throw new Error(_0x30b1('0x97'));if(_0x115b7f[_0x30b1('0x95')]===_0x30b1('0x98')){var _0x4282aa=_0x5dfcb5['get']({'plain':!![]});return db[_0x30b1('0x99')][_0x30b1('0x52')]({'where':{'name':_0x30b1('0x31'),'userProfileId':_0x115b7f[_0x30b1('0x96')]},'raw':!![]})['then'](function(_0x347949){if(_0x347949&&_0x347949[_0x30b1('0x9a')]===0x0){return db[_0x30b1('0x32')][_0x30b1('0x93')]({'name':_0x4282aa[_0x30b1('0x35')],'resourceId':_0x4282aa['id'],'type':_0x347949[_0x30b1('0x35')],'sectionId':_0x347949['id']},{})[_0x30b1('0x2e')](function(){return _0x5dfcb5;});}else{return _0x5dfcb5;}})[_0x30b1('0x4f')](function(_0x3e9816){logger[_0x30b1('0x33')](_0x30b1('0x9b'),_0x3e9816);throw _0x3e9816;});}return _0x5dfcb5;})[_0x30b1('0x2e')](respondWithResult(_0x19b692,null))[_0x30b1('0x4f')](handleError(_0x19b692,null));}});}catch(_0x19548d){_0x19b692['status'](0x1f4)['send'](_0x19548d);}};function removeReferences(_0x35475c,_0x212ac1){try{if(_0x35475c){fs[_0x30b1('0x68')](_0x35475c);logger[_0x30b1('0x69')]('Zip\x20archive\x20removed');}if(_0x212ac1){rimraf(_0x212ac1,function(){});logger[_0x30b1('0x69')](_0x30b1('0x9c'));}}catch(_0x1f5b60){logger['error'](_0x1f5b60);}}exports[_0x30b1('0x2d')]=function(_0x33a425,_0x483c79,_0x580270){return db[_0x30b1('0x4c')]['find']({'where':{'id':_0x33a425[_0x30b1('0x51')]['id']}})['then'](handleEntityNotFound(_0x483c79,null))[_0x30b1('0x2e')](saveUpdates(_0x33a425[_0x30b1('0x94')],null))[_0x30b1('0x2e')](respondWithResult(_0x483c79,null))[_0x30b1('0x4f')](handleError(_0x483c79,null));};exports[_0x30b1('0x9d')]=function(_0x3510e3,_0xf25cfc,_0xd1266a){return db[_0x30b1('0x4c')][_0x30b1('0x52')]({'where':{'id':_0x3510e3[_0x30b1('0x51')]['id']}})['then'](function(_0xb7bf9e){if(_0xb7bf9e){return _0xb7bf9e[_0x30b1('0x2f')]();}})['then'](function(_0x3664f3){rimraf(path[_0x30b1('0x53')](config['root'],_0x30b1('0x54'),path[_0x30b1('0x60')](_0x3664f3[_0x30b1('0xa')])),function(){});return _0x3664f3;})['then'](handleEntityNotFound(_0xf25cfc,null))['then'](respondWithStatusCode(_0xf25cfc,null))[_0x30b1('0x4f')](handleError(_0xf25cfc,null));};exports[_0x30b1('0x9e')]=function(_0x3fe203,_0xb91b29,_0x2a39ef){return BPromise[_0x30b1('0x9f')]()['then'](function(){if(!_0x3fe203['query'][_0x30b1('0xa')]){throw new Error(_0x30b1('0xa0'));}if(!_0x3fe203[_0x30b1('0x3a')]['port']){throw new Error(_0x30b1('0xa1'));}var _0x555b04=_0x3fe203['query'][_0x30b1('0xa2')]?_0x3fe203[_0x30b1('0x3a')]['hostname']+':'+_0x3fe203['query'][_0x30b1('0xa3')]:_0x30b1('0xa4')+_0x3fe203[_0x30b1('0x3a')][_0x30b1('0xa3')];var _0x4874cf=_0x3fe203[_0x30b1('0x3a')]['json']?_0x3fe203['query']['json']:!![];var _0x127561=_0x3fe203[_0x30b1('0x3a')][_0x30b1('0xa5')]?_0x3fe203[_0x30b1('0x3a')][_0x30b1('0xa5')]:null;var _0x3ce34c={'method':_0x3fe203[_0x30b1('0xa6')],'uri':util[_0x30b1('0x66')](_0x30b1('0xa7'),_0x555b04,_0x3fe203[_0x30b1('0x3a')][_0x30b1('0xa')]),'json':_0x4874cf,'resolveWithFullResponse':!![],'encoding':_0x127561,'qs':_0x3fe203[_0x30b1('0x3a')]};if(_0x3fe203[_0x30b1('0xa8')]){_0x3ce34c['headers']=_0x3fe203[_0x30b1('0xa8')];if(_0x3ce34c['headers']['content-length']){delete _0x3ce34c[_0x30b1('0xa8')][_0x30b1('0xa9')];}}if(_0x3ce34c[_0x30b1('0xa8')][_0x30b1('0xaa')]){delete _0x3ce34c['headers'][_0x30b1('0xaa')];}return rp(_0x3ce34c);})['then'](function(_0x285f26){if(_0x285f26){_0xb91b29[_0x30b1('0x29')](_0x285f26[_0x30b1('0xa8')]);logger[_0x30b1('0x69')](_0x285f26[_0x30b1('0x94')]);if(_[_0x30b1('0xab')](_0x3fe203[_0x30b1('0x3a')][_0x30b1('0xa')],'download')&&_0x285f26[_0x30b1('0xac')]==0x1f4){return _0xb91b29[_0x30b1('0x22')](_0x285f26[_0x30b1('0xac')]);}else{return _0xb91b29[_0x30b1('0x23')](_0x285f26[_0x30b1('0xac')])['send'](_0x285f26['body']);}}else{return _0xb91b29[_0x30b1('0x22')](0xc8);}})[_0x30b1('0x4f')](handleError(_0xb91b29,null));};exports[_0x30b1('0xad')]=function(_0x50e143,_0x1fbc7b,_0xac5b40){return BPromise[_0x30b1('0x9f')]()[_0x30b1('0x2e')](function(){if(!_0x50e143[_0x30b1('0x3a')]['path']){throw new Error(_0x30b1('0xa0'));}if(!_0x50e143[_0x30b1('0x3a')][_0x30b1('0xa3')]){throw new Error(_0x30b1('0xa1'));}var _0x64f1a=_0x50e143['query'][_0x30b1('0xa2')]?_0x50e143[_0x30b1('0x3a')][_0x30b1('0xa2')]+':'+_0x50e143[_0x30b1('0x3a')][_0x30b1('0xa3')]:'http://localhost:'+_0x50e143[_0x30b1('0x3a')]['port'];var _0x1c3e4=_0x50e143[_0x30b1('0x3a')][_0x30b1('0x25')]?_0x50e143[_0x30b1('0x3a')][_0x30b1('0x25')]:!![];var _0x5a9177=_0x50e143[_0x30b1('0x3a')][_0x30b1('0xa5')]?_0x50e143['query'][_0x30b1('0xa5')]:null;var _0x2dcab5={'method':_0x50e143[_0x30b1('0xa6')],'uri':util[_0x30b1('0x66')]('%s%s',_0x64f1a,_0x50e143[_0x30b1('0x3a')][_0x30b1('0xa')]),'json':_0x1c3e4,'resolveWithFullResponse':!![],'encoding':_0x5a9177,'body':_0x50e143['body']};if(_0x50e143['headers']){_0x2dcab5[_0x30b1('0xa8')]=_0x50e143[_0x30b1('0xa8')];if(_0x2dcab5[_0x30b1('0xa8')][_0x30b1('0xa9')]){delete _0x2dcab5[_0x30b1('0xa8')][_0x30b1('0xa9')];}}if(_0x2dcab5['headers'][_0x30b1('0xaa')]){delete _0x2dcab5[_0x30b1('0xa8')][_0x30b1('0xaa')];}return rp(_0x2dcab5);})[_0x30b1('0x2e')](function(_0x409a2f){if(_0x409a2f){_0x1fbc7b['set'](_0x409a2f[_0x30b1('0xa8')]);logger[_0x30b1('0x69')](_0x409a2f[_0x30b1('0x94')]);return _0x1fbc7b[_0x30b1('0x23')](_0x409a2f[_0x30b1('0xac')])['send'](_0x409a2f[_0x30b1('0x94')]);}else{return _0x1fbc7b[_0x30b1('0x22')](0xc8);}})[_0x30b1('0x4f')](handleError(_0x1fbc7b,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b3679e5..e165a4e 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 _0x7453=['hasOwnProperty','hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x3fbc5d,_0xe7c039){var _0x3bc704=function(_0x1e1ccd){while(--_0x1e1ccd){_0x3fbc5d['push'](_0x3fbc5d['shift']());}};_0x3bc704(++_0xe7c039);}(_0x7453,0x1e3));var _0x3745=function(_0x4e1e2a,_0x4d57c3){_0x4e1e2a=_0x4e1e2a-0x0;var _0x4158aa=_0x7453[_0x4e1e2a];return _0x4158aa;};'use strict';var EventEmitter=require(_0x3745('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x3745('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3745('0x2'),'afterDestroy':_0x3745('0x3')};function emitEvent(_0x53a9de){return function(_0x3337a4,_0xdbf401,_0xc28104){PluginEvents[_0x3745('0x4')](_0x53a9de+':'+_0x3337a4['id'],_0x3337a4);PluginEvents[_0x3745('0x4')](_0x53a9de,_0x3337a4);_0xc28104(null);};}for(var e in events){if(events[_0x3745('0x5')](e)){var event=events[e];Plugin[_0x3745('0x6')](e,emitEvent(event));}}module[_0x3745('0x7')]=PluginEvents; \ No newline at end of file +var _0xe4ca=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x184c00,_0x4ed01b){var _0x2ea4d2=function(_0x188a42){while(--_0x188a42){_0x184c00['push'](_0x184c00['shift']());}};_0x2ea4d2(++_0x4ed01b);}(_0xe4ca,0x9a));var _0xae4c=function(_0x68bdd3,_0x11f100){_0x68bdd3=_0x68bdd3-0x0;var _0x36d78d=_0xe4ca[_0x68bdd3];return _0x36d78d;};'use strict';var EventEmitter=require(_0xae4c('0x0'));var Plugin=require(_0xae4c('0x1'))['db'][_0xae4c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xae4c('0x3')](0x0);var events={'afterCreate':_0xae4c('0x4'),'afterUpdate':_0xae4c('0x5'),'afterDestroy':_0xae4c('0x6')};function emitEvent(_0xe2a536){return function(_0x543a2d,_0x242ff1,_0x300b40){PluginEvents[_0xae4c('0x7')](_0xe2a536+':'+_0x543a2d['id'],_0x543a2d);PluginEvents[_0xae4c('0x7')](_0xe2a536,_0x543a2d);_0x300b40(null);};}for(var e in events){if(events[_0xae4c('0x8')](e)){var event=events[e];Plugin[_0xae4c('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 343d06e..ac16be9 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 _0xb9a7=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x20c075,_0x1d5ee6){var _0x1ef060=function(_0x2805dd){while(--_0x2805dd){_0x20c075['push'](_0x20c075['shift']());}};_0x1ef060(++_0x1d5ee6);}(_0xb9a7,0x172));var _0x7b9a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xb9a7[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x7b9a('0x0'));var util=require('util');var logger=require(_0x7b9a('0x1'))(_0x7b9a('0x2'));var moment=require(_0x7b9a('0x3'));var BPromise=require(_0x7b9a('0x4'));var rp=require(_0x7b9a('0x5'));var fs=require('fs');var path=require(_0x7b9a('0x6'));var rimraf=require(_0x7b9a('0x7'));var config=require(_0x7b9a('0x8'));var attributes=require(_0x7b9a('0x9'));module[_0x7b9a('0xa')]=function(_0x6f548e,_0x24526d){return _0x6f548e[_0x7b9a('0xb')](_0x7b9a('0xc'),attributes,{'tableName':_0x7b9a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6de6=['request-promise','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird'];(function(_0x59820d,_0xc8e6ba){var _0x3c72b1=function(_0x1f8971){while(--_0x1f8971){_0x59820d['push'](_0x59820d['shift']());}};_0x3c72b1(++_0xc8e6ba);}(_0x6de6,0x19d));var _0x66de=function(_0x510e91,_0x5bf2d9){_0x510e91=_0x510e91-0x0;var _0x369221=_0x6de6[_0x510e91];return _0x369221;};'use strict';var _=require(_0x66de('0x0'));var util=require('util');var logger=require(_0x66de('0x1'))(_0x66de('0x2'));var moment=require(_0x66de('0x3'));var BPromise=require(_0x66de('0x4'));var rp=require(_0x66de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x66de('0x6'));module[_0x66de('0x7')]=function(_0xfc4dc6,_0xce3127){return _0xfc4dc6[_0x66de('0x8')](_0x66de('0x9'),attributes,{'tableName':_0x66de('0xa'),'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 48fa202..5e2a2d8 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 _0x6536=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','CreatePlugin','create','body','options','raw','moment'];(function(_0x3becc8,_0x3dc8a9){var _0x49f387=function(_0x48765f){while(--_0x48765f){_0x3becc8['push'](_0x3becc8['shift']());}};_0x49f387(++_0x3dc8a9);}(_0x6536,0x1cf));var _0x6653=function(_0x3a7272,_0x5f0cae){_0x3a7272=_0x3a7272-0x0;var _0x2483d5=_0x6536[_0x3a7272];return _0x2483d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6653('0x0'));var BPromise=require('bluebird');var rs=require(_0x6653('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6653('0x2'));var logger=require(_0x6653('0x3'))(_0x6653('0x4'));var config=require(_0x6653('0x5'));var jayson=require(_0x6653('0x6'));var client=jayson[_0x6653('0x7')][_0x6653('0x8')]({'port':0x232a});config[_0x6653('0x9')]=_['defaults'](config[_0x6653('0x9')],{'host':_0x6653('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6653('0x9')]));require(_0x6653('0xb'))[_0x6653('0xc')](socket);function respondWithRpcPromise(_0x5e5385,_0x3110bc,_0x2179f3){return new BPromise(function(_0x4f8aa9,_0x1027cc){return client[_0x6653('0xd')](_0x5e5385,_0x2179f3)[_0x6653('0xe')](function(_0x55b1c0){logger['info'](_0x6653('0xf'),_0x3110bc,'request\x20sent');logger[_0x6653('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3110bc,_0x6653('0x11'),JSON[_0x6653('0x12')](_0x55b1c0));if(_0x55b1c0[_0x6653('0x13')]){if(_0x55b1c0[_0x6653('0x13')][_0x6653('0x14')]===0x1f4){logger[_0x6653('0x13')](_0x6653('0xf'),_0x3110bc,_0x55b1c0[_0x6653('0x13')][_0x6653('0x15')]);return _0x1027cc(_0x55b1c0['error'][_0x6653('0x15')]);}logger['error'](_0x6653('0xf'),_0x3110bc,_0x55b1c0[_0x6653('0x13')][_0x6653('0x15')]);return _0x4f8aa9(_0x55b1c0[_0x6653('0x13')][_0x6653('0x15')]);}else{logger[_0x6653('0x16')](_0x6653('0xf'),_0x3110bc,_0x6653('0x11'));_0x4f8aa9(_0x55b1c0[_0x6653('0x17')][_0x6653('0x15')]);}})['catch'](function(_0xb8bd56){logger['error'](_0x6653('0xf'),_0x3110bc,_0xb8bd56);_0x1027cc(_0xb8bd56);});});}exports[_0x6653('0x18')]=function(_0x6b2caa){var _0x32f907=this;return new Promise(function(_0x1d8b2a,_0xff8315){return db['Plugin'][_0x6653('0x19')](_0x6b2caa[_0x6653('0x1a')],{'raw':_0x6b2caa['options']?_0x6b2caa[_0x6653('0x1b')][_0x6653('0x1c')]===undefined?!![]:![]:!![]})[_0x6653('0xe')](function(_0x311050){logger[_0x6653('0x16')](_0x6653('0x18'),_0x6b2caa);logger[_0x6653('0x10')](_0x6653('0x18'),_0x6b2caa,JSON[_0x6653('0x12')](_0x311050));_0x1d8b2a(_0x311050);})['catch'](function(_0xaea7ff){logger[_0x6653('0x13')](_0x6653('0x18'),_0xaea7ff['message'],_0x6b2caa);_0xff8315(_0x32f907[_0x6653('0x13')](0x1f4,_0xaea7ff['message']));});});}; \ No newline at end of file +var _0xaf21=['rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xaf21,0x1a5));var _0x1af2=function(_0x214665,_0x37a187){_0x214665=_0x214665-0x0;var _0x4f574b=_0xaf21[_0x214665];return _0x4f574b;};'use strict';var _=require(_0x1af2('0x0'));var util=require(_0x1af2('0x1'));var moment=require(_0x1af2('0x2'));var BPromise=require(_0x1af2('0x3'));var rs=require(_0x1af2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1af2('0x5'))['db'];var utils=require(_0x1af2('0x6'));var logger=require(_0x1af2('0x7'))(_0x1af2('0x8'));var config=require(_0x1af2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1af2('0xa')]['http']({'port':0x232a});config[_0x1af2('0xb')]=_[_0x1af2('0xc')](config['redis'],{'host':_0x1af2('0xd'),'port':0x18eb});var socket=require(_0x1af2('0xe'))(new Redis(config['redis']));require('./plugin.socket')[_0x1af2('0xf')](socket);function respondWithRpcPromise(_0x7ddb08,_0x559d3c,_0x405b62){return new BPromise(function(_0xcbdf1f,_0x2da1a6){return client[_0x1af2('0x10')](_0x7ddb08,_0x405b62)[_0x1af2('0x11')](function(_0x48c087){logger[_0x1af2('0x12')](_0x1af2('0x13'),_0x559d3c,_0x1af2('0x14'));logger[_0x1af2('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x559d3c,_0x1af2('0x14'),JSON[_0x1af2('0x16')](_0x48c087));if(_0x48c087['error']){if(_0x48c087[_0x1af2('0x17')][_0x1af2('0x18')]===0x1f4){logger[_0x1af2('0x17')](_0x1af2('0x13'),_0x559d3c,_0x48c087[_0x1af2('0x17')][_0x1af2('0x19')]);return _0x2da1a6(_0x48c087[_0x1af2('0x17')][_0x1af2('0x19')]);}logger[_0x1af2('0x17')](_0x1af2('0x13'),_0x559d3c,_0x48c087[_0x1af2('0x17')][_0x1af2('0x19')]);return _0xcbdf1f(_0x48c087[_0x1af2('0x17')][_0x1af2('0x19')]);}else{logger[_0x1af2('0x12')](_0x1af2('0x13'),_0x559d3c,_0x1af2('0x14'));_0xcbdf1f(_0x48c087[_0x1af2('0x1a')][_0x1af2('0x19')]);}})[_0x1af2('0x1b')](function(_0x5c7689){logger[_0x1af2('0x17')](_0x1af2('0x13'),_0x559d3c,_0x5c7689);_0x2da1a6(_0x5c7689);});});}exports['CreatePlugin']=function(_0x36c11e){var _0x49b1a5=this;return new Promise(function(_0x486272,_0x8f05a){return db['Plugin'][_0x1af2('0x1c')](_0x36c11e[_0x1af2('0x1d')],{'raw':_0x36c11e[_0x1af2('0x1e')]?_0x36c11e['options'][_0x1af2('0x1f')]===undefined?!![]:![]:!![]})[_0x1af2('0x11')](function(_0x28a968){logger[_0x1af2('0x12')](_0x1af2('0x20'),_0x36c11e);logger[_0x1af2('0x15')]('CreatePlugin',_0x36c11e,JSON['stringify'](_0x28a968));_0x486272(_0x28a968);})[_0x1af2('0x1b')](function(_0x206cb6){logger[_0x1af2('0x17')](_0x1af2('0x20'),_0x206cb6[_0x1af2('0x19')],_0x36c11e);_0x8f05a(_0x49b1a5[_0x1af2('0x17')](0x1f4,_0x206cb6[_0x1af2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d2422a1..2fdfb4c 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 _0x826b=['update','emit','removeListener','register','length','./plugin.events','save','remove'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x826b,0x8d));var _0xb826=function(_0x16baab,_0xa449b2){_0x16baab=_0x16baab-0x0;var _0x3fbfc2=_0x826b[_0x16baab];return _0x3fbfc2;};'use strict';var PluginEvents=require(_0xb826('0x0'));var events=[_0xb826('0x1'),_0xb826('0x2'),_0xb826('0x3')];function createListener(_0xba1f0e,_0x1cddb7){return function(_0x8feb26){_0x1cddb7[_0xb826('0x4')](_0xba1f0e,_0x8feb26);};}function removeListener(_0x4e2eff,_0x7e1fa8){return function(){PluginEvents[_0xb826('0x5')](_0x4e2eff,_0x7e1fa8);};}exports[_0xb826('0x6')]=function(_0x274c77){for(var _0x4b31b4=0x0,_0x32f6c6=events[_0xb826('0x7')];_0x4b31b4<_0x32f6c6;_0x4b31b4++){var _0x26f8c7=events[_0x4b31b4];var _0x391277=createListener('plugin:'+_0x26f8c7,_0x274c77);PluginEvents['on'](_0x26f8c7,_0x391277);}}; \ No newline at end of file +var _0xb69f=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb69f,0x129));var _0xfb69=function(_0x27de81,_0x3c8343){_0x27de81=_0x27de81-0x0;var _0x22bd64=_0xb69f[_0x27de81];return _0x22bd64;};'use strict';var PluginEvents=require(_0xfb69('0x0'));var events=[_0xfb69('0x1'),_0xfb69('0x2'),_0xfb69('0x3')];function createListener(_0x112781,_0xfc999a){return function(_0x131e04){_0xfc999a[_0xfb69('0x4')](_0x112781,_0x131e04);};}function removeListener(_0x4cd967,_0x3e68a7){return function(){PluginEvents[_0xfb69('0x5')](_0x4cd967,_0x3e68a7);};}exports[_0xfb69('0x6')]=function(_0x306d82){for(var _0x24664d=0x0,_0x919c98=events[_0xfb69('0x7')];_0x24664d<_0x919c98;_0x24664d++){var _0x2cfe91=events[_0x24664d];var _0xbab08f=createListener(_0xfb69('0x8')+_0x2cfe91,_0x306d82);PluginEvents['on'](_0x2cfe91,_0xbab08f);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3500552..6236854 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x5cad77,_0x49181b){var _0x14ba74=function(_0x25e175){while(--_0x25e175){_0x5cad77['push'](_0x5cad77['shift']());}};_0x14ba74(++_0x49181b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x38bcfc,_0x23b3c5){var _0x11b9fd=function(_0x30960b){while(--_0x30960b){_0x38bcfc['push'](_0x38bcfc['shift']());}};_0x11b9fd(++_0x23b3c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index af1575b..9a7ec4c 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 _0xc55e=['path','exec','bluebird','error','stack','name','status','send','info','index','then','reject','express','motion2','catch','show','params','create','body','script','cwd','chdir','dump','update','restart','stop','hasOwnProperty','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api'];(function(_0x4e5af1,_0x1dfc1f){var _0x357f9d=function(_0x645f3b){while(--_0x645f3b){_0x4e5af1['push'](_0x4e5af1['shift']());}};_0x357f9d(++_0x1dfc1f);}(_0xc55e,0x146));var _0xec55=function(_0x1b9669,_0x37b934){_0x1b9669=_0x1b9669-0x0;var _0x1e04f3=_0xc55e[_0x1b9669];return _0x1e04f3;};'use strict';var _=require(_0xec55('0x0'));var pm2=require(_0xec55('0x1'));var logger=require(_0xec55('0x2'))(_0xec55('0x3'));var path=require(_0xec55('0x4'));var exec=require('child_process')[_0xec55('0x5')];var BPromise=require(_0xec55('0x6'));function handleEntityNotFound(_0x35cd14,_0xdcb93){return function(_0x3b7b45){if(!_0x3b7b45){_0x35cd14['sendStatus'](0x194);;}return _0x3b7b45;};}function respondWithResult(_0x1cda69,_0x3a887a){_0x3a887a=_0x3a887a||0xc8;return function(_0x239eeb){if(_0x239eeb){return _0x1cda69['status'](_0x3a887a)['json'](_0x239eeb);}return null;};}function handleError(_0x49c6dc,_0x1566f4){_0x1566f4=_0x1566f4||0x1f4;return function(_0x344c12){logger[_0xec55('0x7')](_0x344c12[_0xec55('0x8')]);if(_0x344c12[_0xec55('0x9')]){delete _0x344c12['name'];}_0x49c6dc[_0xec55('0xa')](_0x1566f4)[_0xec55('0xb')](_0x344c12);};}function execChildProcess(){return new BPromise(function(_0xe73275,_0x52e8d2){exec('npm\x20install',function(_0x54dc1a,_0x9d358,_0x16fa06){logger[_0xec55('0xc')](_0x9d358);logger['info'](_0x16fa06);if(_0x54dc1a){logger[_0xec55('0x7')](_0x54dc1a);return _0x52e8d2(_0x54dc1a);}return _0xe73275(_0x9d358);});});}exports[_0xec55('0xd')]=function(_0x1a508c,_0x1f5874){return pm2['list']()[_0xec55('0xe')](function(_0x5f0a85){if(_0x5f0a85){var _0x2faa9d=_[_0xec55('0xf')](_0x5f0a85,function(_0x199e9b){return _0x199e9b['name']===_0xec55('0x10')||_0x199e9b[_0xec55('0x9')]===_0xec55('0x11');});return{'rows':_0x2faa9d,'count':_0x2faa9d['length']};}return null;})[_0xec55('0xe')](respondWithResult(_0x1f5874,null))[_0xec55('0x12')](handleError(_0x1f5874,null));};exports[_0xec55('0x13')]=function(_0x3b471c,_0x65bef5){return pm2['describe'](_0x3b471c[_0xec55('0x14')]['id'])[_0xec55('0xe')](respondWithResult(_0x65bef5,null))[_0xec55('0xe')](handleEntityNotFound(_0x65bef5,null))['catch'](handleError(_0x65bef5,null));};exports[_0xec55('0x15')]=function(_0x25adea,_0x1ccecc){if(_0x25adea['body'][_0xec55('0x9')]&&_0x25adea[_0xec55('0x16')]['script']){var _0x3c8871=path['join'](__dirname,'../../files/plugins',_0x25adea[_0xec55('0x16')][_0xec55('0x17')]);var _0x2c9eb1=process[_0xec55('0x18')]();process[_0xec55('0x19')](path['dirname'](_0x3c8871));return execChildProcess()['then'](function(_0x368d09){process[_0xec55('0x19')](_0x2c9eb1);return pm2['start']({'name':_0x25adea[_0xec55('0x16')][_0xec55('0x9')],'script':_0x3c8871});})[_0xec55('0xe')](function(_0x1cec0a){pm2[_0xec55('0x1a')]();return _0x1cec0a[0x0];})[_0xec55('0xe')](respondWithResult(_0x1ccecc,0xc9))[_0xec55('0x12')](handleError(_0x1ccecc,null));}else{return _0x1ccecc[_0xec55('0xa')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xec55('0x1b')]=function(_0x26e9dd,_0x170a53){if(_0x26e9dd[_0xec55('0x16')]['id']){delete _0x26e9dd['body']['id'];}var _0x38f7fb={'online':_0xec55('0x1c'),'stopped':_0xec55('0x1d')};if(_0x38f7fb[_0xec55('0x1e')](_0x26e9dd[_0xec55('0x16')]['status'])){return pm2[_0x38f7fb[_0x26e9dd[_0xec55('0x16')]['status']]](_0x26e9dd[_0xec55('0x14')]['id'])[_0xec55('0xe')](respondWithResult(_0x170a53,0xc8))[_0xec55('0x12')](handleError(_0x170a53,null));}else{return _0x170a53[_0xec55('0xa')](0x1f4)[_0xec55('0xb')]({'message':_0xec55('0x1f')});}};exports['destroy']=function(_0x35f522,_0x1ad344){if(_0x35f522[_0xec55('0x16')]['id']){delete _0x35f522['body']['id'];}if(_0x35f522['params']['id']){return pm2['delete'](_0x35f522[_0xec55('0x14')]['id'])['then'](function(_0x53e8f7){pm2[_0xec55('0x1a')]();return _0x53e8f7[0x0];})['then'](respondWithResult(_0x1ad344,null))[_0xec55('0x12')](handleError(_0x1ad344,null));}else{return _0x1ad344['status'](0x1f4)[_0xec55('0xb')]({'message':_0xec55('0x20')});}}; \ No newline at end of file +var _0xcded=['hasOwnProperty','Unknown\x20status','destroy','delete','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','status','json','error','stack','name','send','info','list','express','motion2','length','then','catch','params','create','body','script','join','../../files/plugins','chdir','dirname','start'];(function(_0x13a4dc,_0x26a628){var _0x10fcfe=function(_0x36e1f1){while(--_0x36e1f1){_0x13a4dc['push'](_0x13a4dc['shift']());}};_0x10fcfe(++_0x26a628);}(_0xcded,0x64));var _0xdcde=function(_0x11aee5,_0x27fa94){_0x11aee5=_0x11aee5-0x0;var _0x2e8c9d=_0xcded[_0x11aee5];return _0x2e8c9d;};'use strict';var _=require('lodash');var pm2=require(_0xdcde('0x0'));var logger=require(_0xdcde('0x1'))('api');var path=require(_0xdcde('0x2'));var exec=require(_0xdcde('0x3'))[_0xdcde('0x4')];var BPromise=require(_0xdcde('0x5'));function handleEntityNotFound(_0x140613,_0x2e72f2){return function(_0x40d2ad){if(!_0x40d2ad){_0x140613['sendStatus'](0x194);;}return _0x40d2ad;};}function respondWithResult(_0x22b465,_0x1d7c54){_0x1d7c54=_0x1d7c54||0xc8;return function(_0x197d01){if(_0x197d01){return _0x22b465[_0xdcde('0x6')](_0x1d7c54)[_0xdcde('0x7')](_0x197d01);}return null;};}function handleError(_0x2a03de,_0x1131c0){_0x1131c0=_0x1131c0||0x1f4;return function(_0x10e160){logger[_0xdcde('0x8')](_0x10e160[_0xdcde('0x9')]);if(_0x10e160['name']){delete _0x10e160[_0xdcde('0xa')];}_0x2a03de[_0xdcde('0x6')](_0x1131c0)[_0xdcde('0xb')](_0x10e160);};}function execChildProcess(){return new BPromise(function(_0x531744,_0x5bf81d){exec('npm\x20install',function(_0x297a80,_0x20238c,_0x300cfe){logger['info'](_0x20238c);logger[_0xdcde('0xc')](_0x300cfe);if(_0x297a80){logger[_0xdcde('0x8')](_0x297a80);return _0x5bf81d(_0x297a80);}return _0x531744(_0x20238c);});});}exports['index']=function(_0x8ebbb8,_0x3adda9){return pm2[_0xdcde('0xd')]()['then'](function(_0x3ee506){if(_0x3ee506){var _0x11caca=_['reject'](_0x3ee506,function(_0x1442dc){return _0x1442dc[_0xdcde('0xa')]===_0xdcde('0xe')||_0x1442dc[_0xdcde('0xa')]===_0xdcde('0xf');});return{'rows':_0x11caca,'count':_0x11caca[_0xdcde('0x10')]};}return null;})[_0xdcde('0x11')](respondWithResult(_0x3adda9,null))[_0xdcde('0x12')](handleError(_0x3adda9,null));};exports['show']=function(_0x4aa9d0,_0xfaf365){return pm2['describe'](_0x4aa9d0[_0xdcde('0x13')]['id'])[_0xdcde('0x11')](respondWithResult(_0xfaf365,null))[_0xdcde('0x11')](handleEntityNotFound(_0xfaf365,null))['catch'](handleError(_0xfaf365,null));};exports[_0xdcde('0x14')]=function(_0x171b5a,_0x82cece){if(_0x171b5a[_0xdcde('0x15')]['name']&&_0x171b5a[_0xdcde('0x15')][_0xdcde('0x16')]){var _0x1b54e9=path[_0xdcde('0x17')](__dirname,_0xdcde('0x18'),_0x171b5a['body']['script']);var _0x54c67d=process['cwd']();process[_0xdcde('0x19')](path[_0xdcde('0x1a')](_0x1b54e9));return execChildProcess()[_0xdcde('0x11')](function(_0x4a6184){process[_0xdcde('0x19')](_0x54c67d);return pm2[_0xdcde('0x1b')]({'name':_0x171b5a[_0xdcde('0x15')][_0xdcde('0xa')],'script':_0x1b54e9});})['then'](function(_0x53b786){pm2['dump']();return _0x53b786[0x0];})[_0xdcde('0x11')](respondWithResult(_0x82cece,0xc9))['catch'](handleError(_0x82cece,null));}else{return _0x82cece[_0xdcde('0x6')](0x1f4)[_0xdcde('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x42145b,_0xcb6ddc){if(_0x42145b[_0xdcde('0x15')]['id']){delete _0x42145b[_0xdcde('0x15')]['id'];}var _0x200723={'online':'restart','stopped':'stop'};if(_0x200723[_0xdcde('0x1c')](_0x42145b[_0xdcde('0x15')][_0xdcde('0x6')])){return pm2[_0x200723[_0x42145b[_0xdcde('0x15')]['status']]](_0x42145b[_0xdcde('0x13')]['id'])[_0xdcde('0x11')](respondWithResult(_0xcb6ddc,0xc8))[_0xdcde('0x12')](handleError(_0xcb6ddc,null));}else{return _0xcb6ddc[_0xdcde('0x6')](0x1f4)['send']({'message':_0xdcde('0x1d')});}};exports[_0xdcde('0x1e')]=function(_0x2db681,_0x2d6a00){if(_0x2db681[_0xdcde('0x15')]['id']){delete _0x2db681[_0xdcde('0x15')]['id'];}if(_0x2db681[_0xdcde('0x13')]['id']){return pm2[_0xdcde('0x1f')](_0x2db681[_0xdcde('0x13')]['id'])[_0xdcde('0x11')](function(_0x5072a5){pm2['dump']();return _0x5072a5[0x0];})['then'](respondWithResult(_0x2d6a00,null))[_0xdcde('0x12')](handleError(_0x2d6a00,null));}else{return _0x2d6a00[_0xdcde('0x6')](0x1f4)[_0xdcde('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 347e71b..af147e2 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 _0x0f4d=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x114e1d,_0xeda681){var _0x4a2043=function(_0x3495bf){while(--_0x3495bf){_0x114e1d['push'](_0x114e1d['shift']());}};_0x4a2043(++_0xeda681);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x46ad6f,_0x33844d){_0x46ad6f=_0x46ad6f-0x0;var _0x3c48ce=_0x0f4d[_0x46ad6f];return _0x3c48ce;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var auth=require(_0xd0f4('0x2'));var interaction=require(_0xd0f4('0x3'));var config=require(_0xd0f4('0x4'));module[_0xd0f4('0x5')]=router; \ No newline at end of file +var _0x8ace=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3391fe,_0x5c24d9){_0x3391fe=_0x3391fe-0x0;var _0x1ae383=_0x8ace[_0x3391fe];return _0x1ae383;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var auth=require(_0xe8ac('0x6'));var interaction=require(_0xe8ac('0x7'));var config=require(_0xe8ac('0x8'));module[_0xe8ac('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 70891cb..1b050f0 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 _0x3382=['exports','STRING','DATE','INTEGER'];(function(_0x565b76,_0x1d150b){var _0x80f363=function(_0x140b02){while(--_0x140b02){_0x565b76['push'](_0x565b76['shift']());}};_0x80f363(++_0x1d150b);}(_0x3382,0x17c));var _0x2338=function(_0x52838e,_0x4f9d9d){_0x52838e=_0x52838e-0x0;var _0x2c8940=_0x3382[_0x52838e];return _0x2c8940;};'use strict';var Sequelize=require('sequelize');module[_0x2338('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2338('0x1')]},'scheduledat':{'type':Sequelize[_0x2338('0x2')]},'uniqueid':{'type':Sequelize[_0x2338('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2338('0x2')]},'ringtime':{'type':Sequelize[_0x2338('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x360e=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0xe97058,_0x511afa){var _0x1c0332=function(_0x16385d){while(--_0x16385d){_0xe97058['push'](_0xe97058['shift']());}};_0x1c0332(++_0x511afa);}(_0x360e,0x12b));var _0xe360=function(_0x6bb814,_0x17196b){_0x6bb814=_0x6bb814-0x0;var _0x3c4bf6=_0x360e[_0x6bb814];return _0x3c4bf6;};'use strict';var Sequelize=require(_0xe360('0x0'));module[_0xe360('0x1')]={'state':{'type':Sequelize[_0xe360('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe360('0x3')]},'scheduledat':{'type':Sequelize[_0xe360('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe360('0x4')]},'responsetime':{'type':Sequelize[_0xe360('0x4')]},'ringtime':{'type':Sequelize[_0xe360('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe360('0x3')]},'campaigntype':{'type':Sequelize[_0xe360('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e0cb50d..b77a715 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 _0x240b=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','util','../../config/logger','api','moment'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x240b,0x133));var _0xb240=function(_0x43d24c,_0x3c1879){_0x43d24c=_0x43d24c-0x0;var _0x41a60c=_0x240b[_0x43d24c];return _0x41a60c;};'use strict';var _=require(_0xb240('0x0'));var util=require(_0xb240('0x1'));var logger=require(_0xb240('0x2'))(_0xb240('0x3'));var moment=require(_0xb240('0x4'));var BPromise=require('bluebird');var rp=require(_0xb240('0x5'));var fs=require('fs');var path=require(_0xb240('0x6'));var rimraf=require(_0xb240('0x7'));var config=require(_0xb240('0x8'));var attributes=require(_0xb240('0x9'));module[_0xb240('0xa')]=function(_0xacee7d,_0x584293){return _0xacee7d['define'](_0xb240('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa07f=['util','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash'];(function(_0x16b77e,_0x4a56a3){var _0x3ae284=function(_0x5d2481){while(--_0x5d2481){_0x16b77e['push'](_0x16b77e['shift']());}};_0x3ae284(++_0x4a56a3);}(_0xa07f,0xa7));var _0xfa07=function(_0x46d0fc,_0x2c4a66){_0x46d0fc=_0x46d0fc-0x0;var _0x46199a=_0xa07f[_0x46d0fc];return _0x46199a;};'use strict';var _=require(_0xfa07('0x0'));var util=require(_0xfa07('0x1'));var logger=require('../../config/logger')(_0xfa07('0x2'));var moment=require(_0xfa07('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa07('0x4'));var fs=require('fs');var path=require(_0xfa07('0x5'));var rimraf=require(_0xfa07('0x6'));var config=require(_0xfa07('0x7'));var attributes=require(_0xfa07('0x8'));module[_0xfa07('0x9')]=function(_0x6054ee,_0x316008){return _0x6054ee[_0xfa07('0xa')]('ReportAgentPreview',attributes,{'tableName':_0xfa07('0xb'),'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 1f56d1f..e303fb2 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 _0xee6c=['CreateReportAgentPreview','create','body','options','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xee6c,0x131));var _0xcee6=function(_0x548f4a,_0x46d1e5){_0x548f4a=_0x548f4a-0x0;var _0x24a283=_0xee6c[_0x548f4a];return _0x24a283;};'use strict';var _=require(_0xcee6('0x0'));var util=require(_0xcee6('0x1'));var moment=require(_0xcee6('0x2'));var BPromise=require(_0xcee6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcee6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcee6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcee6('0x6'));var client=jayson[_0xcee6('0x7')][_0xcee6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52851f,_0x4cfef1,_0x554d55){return new BPromise(function(_0x53a0de,_0x34a3bb){return client['request'](_0x52851f,_0x554d55)[_0xcee6('0x9')](function(_0x3a773f){logger[_0xcee6('0xa')](_0xcee6('0xb'),_0x4cfef1,_0xcee6('0xc'));logger['debug'](_0xcee6('0xd'),_0x4cfef1,_0xcee6('0xc'),JSON[_0xcee6('0xe')](_0x3a773f));if(_0x3a773f[_0xcee6('0xf')]){if(_0x3a773f['error'][_0xcee6('0x10')]===0x1f4){logger[_0xcee6('0xf')](_0xcee6('0xb'),_0x4cfef1,_0x3a773f[_0xcee6('0xf')][_0xcee6('0x11')]);return _0x34a3bb(_0x3a773f['error'][_0xcee6('0x11')]);}logger[_0xcee6('0xf')](_0xcee6('0xb'),_0x4cfef1,_0x3a773f[_0xcee6('0xf')][_0xcee6('0x11')]);return _0x53a0de(_0x3a773f['error'][_0xcee6('0x11')]);}else{logger['info'](_0xcee6('0xb'),_0x4cfef1,_0xcee6('0xc'));_0x53a0de(_0x3a773f[_0xcee6('0x12')][_0xcee6('0x11')]);}})[_0xcee6('0x13')](function(_0x180add){logger[_0xcee6('0xf')](_0xcee6('0xb'),_0x4cfef1,_0x180add);_0x34a3bb(_0x180add);});});}exports[_0xcee6('0x14')]=function(_0x234e14){var _0x56c26e=this;return new Promise(function(_0x138061,_0x5b4b16){return db['ReportAgentPreview'][_0xcee6('0x15')](_0x234e14[_0xcee6('0x16')],{'raw':_0x234e14[_0xcee6('0x17')]?_0x234e14['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x202043){logger[_0xcee6('0xa')]('CreateReportAgentPreview',_0x234e14);logger[_0xcee6('0x18')](_0xcee6('0x14'),_0x234e14,JSON[_0xcee6('0xe')](_0x202043));_0x138061(_0x202043);})[_0xcee6('0x13')](function(_0x444243){logger['error'](_0xcee6('0x14'),_0x444243[_0xcee6('0x11')],_0x234e14);_0x5b4b16(_0x56c26e['error'](0x1f4,_0x444243[_0xcee6('0x11')]));});});}; \ No newline at end of file +var _0x5750=['result','CreateReportAgentPreview','create','body','options','raw','info','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x265ece,_0xf6383){var _0x1e8709=function(_0x123705){while(--_0x123705){_0x265ece['push'](_0x265ece['shift']());}};_0x1e8709(++_0xf6383);}(_0x5750,0x12b));var _0x0575=function(_0x50d1c6,_0x40051c){_0x50d1c6=_0x50d1c6-0x0;var _0x3cd375=_0x5750[_0x50d1c6];return _0x3cd375;};'use strict';var _=require(_0x0575('0x0'));var util=require('util');var moment=require(_0x0575('0x1'));var BPromise=require(_0x0575('0x2'));var rs=require(_0x0575('0x3'));var fs=require('fs');var Redis=require(_0x0575('0x4'));var db=require(_0x0575('0x5'))['db'];var utils=require(_0x0575('0x6'));var logger=require(_0x0575('0x7'))(_0x0575('0x8'));var config=require(_0x0575('0x9'));var jayson=require(_0x0575('0xa'));var client=jayson[_0x0575('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4508ad,_0x1533d2,_0x370924){return new BPromise(function(_0x5a0ecf,_0x382ab4){return client[_0x0575('0xc')](_0x4508ad,_0x370924)[_0x0575('0xd')](function(_0x4fb243){logger['info'](_0x0575('0xe'),_0x1533d2,_0x0575('0xf'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1533d2,_0x0575('0xf'),JSON[_0x0575('0x10')](_0x4fb243));if(_0x4fb243['error']){if(_0x4fb243[_0x0575('0x11')][_0x0575('0x12')]===0x1f4){logger[_0x0575('0x11')](_0x0575('0xe'),_0x1533d2,_0x4fb243[_0x0575('0x11')]['message']);return _0x382ab4(_0x4fb243[_0x0575('0x11')][_0x0575('0x13')]);}logger[_0x0575('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x1533d2,_0x4fb243[_0x0575('0x11')]['message']);return _0x5a0ecf(_0x4fb243[_0x0575('0x11')][_0x0575('0x13')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x1533d2,_0x0575('0xf'));_0x5a0ecf(_0x4fb243[_0x0575('0x14')][_0x0575('0x13')]);}})['catch'](function(_0x3b1609){logger[_0x0575('0x11')](_0x0575('0xe'),_0x1533d2,_0x3b1609);_0x382ab4(_0x3b1609);});});}exports[_0x0575('0x15')]=function(_0x344946){var _0x4f475a=this;return new Promise(function(_0x4810ab,_0x393abf){return db['ReportAgentPreview'][_0x0575('0x16')](_0x344946[_0x0575('0x17')],{'raw':_0x344946[_0x0575('0x18')]?_0x344946[_0x0575('0x18')][_0x0575('0x19')]===undefined?!![]:![]:!![]})[_0x0575('0xd')](function(_0x1c4b7e){logger[_0x0575('0x1a')](_0x0575('0x15'),_0x344946);logger[_0x0575('0x1b')](_0x0575('0x15'),_0x344946,JSON['stringify'](_0x1c4b7e));_0x4810ab(_0x1c4b7e);})[_0x0575('0x1c')](function(_0x2d5758){logger[_0x0575('0x11')](_0x0575('0x15'),_0x2d5758['message'],_0x344946);_0x393abf(_0x4f475a[_0x0575('0x11')](0x1f4,_0x2d5758[_0x0575('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 50166a9..3162c38 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 _0x3134=['showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','express','Router','../../components/auth/service','./rpc.controller','get','voiceChannels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/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','/voice/queues/channels/:uniqueid/redirect/:exten','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id'];(function(_0x7efd60,_0x24f0c6){var _0x3e0b93=function(_0x3e61dc){while(--_0x3e61dc){_0x7efd60['push'](_0x7efd60['shift']());}};_0x3e0b93(++_0x24f0c6);}(_0x3134,0xdf));var _0x4313=function(_0x69bb39,_0xa07fb2){_0x69bb39=_0x69bb39-0x0;var _0x25349b=_0x3134[_0x69bb39];return _0x25349b;};'use strict';var multer=require(_0x4313('0x0'));var util=require('util');var path=require('path');var express=require(_0x4313('0x1'));var router=express[_0x4313('0x2')]();var auth=require(_0x4313('0x3'));var controller=require(_0x4313('0x4'));router[_0x4313('0x5')]('/voice/channels',auth['isAuthenticated'](),controller[_0x4313('0x6')]);router[_0x4313('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x4313('0x7')](),controller['voiceChannelMixMonitor']);router['get'](_0x4313('0x8'),auth[_0x4313('0x7')](),controller[_0x4313('0x9')]);router[_0x4313('0x5')](_0x4313('0xa'),auth[_0x4313('0x7')](),controller[_0x4313('0xb')]);router[_0x4313('0x5')](_0x4313('0xc'),auth['isAuthenticated'](),controller[_0x4313('0xd')]);router[_0x4313('0x5')](_0x4313('0xe'),auth['isAuthenticated'](),controller[_0x4313('0xf')]);router[_0x4313('0x5')](_0x4313('0x10'),auth[_0x4313('0x7')](),controller[_0x4313('0x11')]);router[_0x4313('0x5')](_0x4313('0x12'),auth[_0x4313('0x7')](),controller[_0x4313('0x13')]);router[_0x4313('0x5')](_0x4313('0x14'),auth[_0x4313('0x7')](),controller[_0x4313('0x15')]);router[_0x4313('0x5')](_0x4313('0x16'),auth[_0x4313('0x7')](),controller[_0x4313('0x17')]);router[_0x4313('0x5')]('/voice/queues/preview/:id',auth[_0x4313('0x7')](),controller[_0x4313('0x18')]);router['get'](_0x4313('0x19'),auth['isAuthenticated'](),controller[_0x4313('0x1a')]);router[_0x4313('0x5')](_0x4313('0x1b'),auth[_0x4313('0x7')](),controller[_0x4313('0x1c')]);router[_0x4313('0x5')](_0x4313('0x1d'),auth[_0x4313('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x4313('0x5')](_0x4313('0x1e'),auth[_0x4313('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x4313('0x5')]('/voice/queues/:id',auth[_0x4313('0x7')](),controller['showVoiceQueues']);router[_0x4313('0x5')]('/outbound',auth[_0x4313('0x7')](),controller['outbound']);router[_0x4313('0x5')](_0x4313('0x1f'),auth[_0x4313('0x7')](),controller[_0x4313('0x20')]);router['get'](_0x4313('0x21'),auth['isAuthenticated'](),controller[_0x4313('0x22')]);router[_0x4313('0x23')](_0x4313('0x24'),auth['isAuthenticated'](),controller[_0x4313('0x25')]);router[_0x4313('0x5')](_0x4313('0x26'),auth[_0x4313('0x7')](),controller[_0x4313('0x27')]);router[_0x4313('0x5')](_0x4313('0x28'),auth[_0x4313('0x7')](),controller['trunks']);router[_0x4313('0x5')](_0x4313('0x29'),auth[_0x4313('0x7')](),controller[_0x4313('0x2a')]);router['get']('/fax/accounts',auth[_0x4313('0x7')](),controller[_0x4313('0x2b')]);router['get'](_0x4313('0x2c'),auth['isAuthenticated'](),controller[_0x4313('0x2d')]);router[_0x4313('0x5')](_0x4313('0x2e'),auth[_0x4313('0x7')](),controller[_0x4313('0x2f')]);router['get'](_0x4313('0x30'),auth[_0x4313('0x7')](),controller[_0x4313('0x31')]);router['get']('/sms/queues/waitinginteractions',auth[_0x4313('0x7')](),controller[_0x4313('0x32')]);router[_0x4313('0x5')](_0x4313('0x33'),auth['isAuthenticated'](),controller[_0x4313('0x34')]);router[_0x4313('0x35')](_0x4313('0x36'),auth[_0x4313('0x7')](),controller[_0x4313('0x37')](_0x4313('0x38')));router[_0x4313('0x5')](_0x4313('0x39'),auth['isAuthenticated'](),controller[_0x4313('0x3a')]);router[_0x4313('0x35')](_0x4313('0x3b'),auth[_0x4313('0x7')](),controller['queueNotify'](_0x4313('0x3c')));router[_0x4313('0x5')]('/chat/queues/:id',auth[_0x4313('0x7')](),controller[_0x4313('0x3d')]);router['post'](_0x4313('0x3e'),auth['isAuthenticated'](),controller['queueNotify'](_0x4313('0x3f')));router[_0x4313('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x4313('0x7')](),controller[_0x4313('0x37')]('openchannel'));router[_0x4313('0x5')](_0x4313('0x40'),auth[_0x4313('0x7')](),controller[_0x4313('0x41')]);router[_0x4313('0x35')](_0x4313('0x42'),auth[_0x4313('0x7')](),controller[_0x4313('0x37')](_0x4313('0x43')));router[_0x4313('0x5')](_0x4313('0x44'),auth[_0x4313('0x7')](),controller[_0x4313('0x45')]);router[_0x4313('0x35')](_0x4313('0x46'),auth['isAuthenticated'](),controller[_0x4313('0x47')]);module[_0x4313('0x48')]=router; \ No newline at end of file +var _0x171c=['/voice/queues','isAuthenticated','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','path','express','Router','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x171c,0x8b));var _0xc171=function(_0x370f30,_0x5c5ff3){_0x370f30=_0x370f30-0x0;var _0x37a632=_0x171c[_0x370f30];return _0x37a632;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc171('0x0'));var express=require(_0xc171('0x1'));var router=express[_0xc171('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xc171('0x3'));router[_0xc171('0x4')]('/voice/channels',auth['isAuthenticated'](),controller[_0xc171('0x5')]);router[_0xc171('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get'](_0xc171('0x6'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xc171('0x4')](_0xc171('0x7'),auth[_0xc171('0x8')](),controller[_0xc171('0x9')]);router[_0xc171('0x4')](_0xc171('0xa'),auth[_0xc171('0x8')](),controller[_0xc171('0xb')]);router[_0xc171('0x4')](_0xc171('0xc'),auth[_0xc171('0x8')](),controller[_0xc171('0xd')]);router[_0xc171('0x4')](_0xc171('0xe'),auth[_0xc171('0x8')](),controller[_0xc171('0xf')]);router['get'](_0xc171('0x10'),auth[_0xc171('0x8')](),controller[_0xc171('0x11')]);router['get'](_0xc171('0x12'),auth['isAuthenticated'](),controller['smsQueues']);router[_0xc171('0x4')]('/fax/queues',auth[_0xc171('0x8')](),controller['faxQueues']);router[_0xc171('0x4')](_0xc171('0x13'),auth[_0xc171('0x8')](),controller[_0xc171('0x14')]);router[_0xc171('0x4')](_0xc171('0x15'),auth[_0xc171('0x8')](),controller[_0xc171('0x16')]);router[_0xc171('0x4')](_0xc171('0x17'),auth[_0xc171('0x8')](),controller['voiceQueuesChannel']);router['get'](_0xc171('0x18'),auth[_0xc171('0x8')](),controller[_0xc171('0x19')]);router[_0xc171('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xc171('0x8')](),controller[_0xc171('0x1a')]);router[_0xc171('0x4')]('/voice/queues/:id',auth[_0xc171('0x8')](),controller[_0xc171('0x1b')]);router[_0xc171('0x4')](_0xc171('0x1c'),auth[_0xc171('0x8')](),controller[_0xc171('0x1d')]);router['get'](_0xc171('0x1e'),auth[_0xc171('0x8')](),controller[_0xc171('0x1f')]);router['get'](_0xc171('0x20'),auth[_0xc171('0x8')](),controller[_0xc171('0x21')]);router[_0xc171('0x22')](_0xc171('0x23'),auth[_0xc171('0x8')](),controller[_0xc171('0x24')]);router[_0xc171('0x4')]('/telephones',auth['isAuthenticated'](),controller[_0xc171('0x25')]);router[_0xc171('0x4')]('/trunks',auth['isAuthenticated'](),controller[_0xc171('0x26')]);router['get'](_0xc171('0x27'),auth[_0xc171('0x8')](),controller[_0xc171('0x28')]);router['get'](_0xc171('0x29'),auth[_0xc171('0x8')](),controller[_0xc171('0x2a')]);router['get'](_0xc171('0x2b'),auth[_0xc171('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xc171('0x4')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc171('0x2c')]);router[_0xc171('0x4')](_0xc171('0x2d'),auth[_0xc171('0x8')](),controller[_0xc171('0x2e')]);router[_0xc171('0x4')](_0xc171('0x2f'),auth[_0xc171('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0xc171('0x4')](_0xc171('0x30'),auth['isAuthenticated'](),controller[_0xc171('0x31')]);router['post'](_0xc171('0x32'),auth[_0xc171('0x8')](),controller['queueNotify'](_0xc171('0x33')));router[_0xc171('0x4')](_0xc171('0x34'),auth[_0xc171('0x8')](),controller[_0xc171('0x35')]);router[_0xc171('0x36')]('/chat/queues/:id/notify',auth[_0xc171('0x8')](),controller[_0xc171('0x37')](_0xc171('0x38')));router['get'](_0xc171('0x39'),auth[_0xc171('0x8')](),controller[_0xc171('0x3a')]);router[_0xc171('0x36')](_0xc171('0x3b'),auth[_0xc171('0x8')](),controller[_0xc171('0x37')](_0xc171('0x3c')));router[_0xc171('0x4')](_0xc171('0x3d'),auth[_0xc171('0x8')](),controller[_0xc171('0x3e')]);router[_0xc171('0x36')](_0xc171('0x3f'),auth['isAuthenticated'](),controller[_0xc171('0x37')](_0xc171('0x40')));router['get'](_0xc171('0x41'),auth['isAuthenticated'](),controller[_0xc171('0x42')]);router[_0xc171('0x36')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc171('0x37')](_0xc171('0x43')));router[_0xc171('0x4')](_0xc171('0x44'),auth[_0xc171('0x8')](),controller[_0xc171('0x45')]);router[_0xc171('0x36')](_0xc171('0x46'),auth[_0xc171('0x8')](),controller[_0xc171('0x47')]);module[_0xc171('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d24e841..2dd03f4 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 _0x0222=['openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0222,0x106));var _0x2022=function(_0x2a0c95,_0x4cb39a){_0x2a0c95=_0x2a0c95-0x0;var _0x37a612=_0x0222[_0x2a0c95];return _0x37a612;};'use strict';var BPromise=require(_0x2022('0x0'));var moment=require(_0x2022('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x2022('0x2'))(_0x2022('0x3'));var jayson=require(_0x2022('0x4'));var amiClient=jayson[_0x2022('0x5')][_0x2022('0x6')]({'port':0x232a});var mailClient=jayson[_0x2022('0x5')][_0x2022('0x6')]({'port':0x232b});var routingClient=jayson[_0x2022('0x5')][_0x2022('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x43dce3,_0x4dac5e,_0x10c2b3){return new BPromise(function(_0x1bfa55,_0x25108b){var _0x3d25f5=_0x10c2b3?_0x10c2b3:amiClient;return _0x3d25f5[_0x2022('0x7')](_0x43dce3,_0x4dac5e)[_0x2022('0x8')](function(_0x387281){if(_0x387281[_0x2022('0x9')]){if(_0x387281[_0x2022('0x9')][_0x2022('0xa')]===0x1f4){return _0x25108b(_0x387281[_0x2022('0x9')]['message']);}return _0x1bfa55(_0x387281[_0x2022('0x9')][_0x2022('0xb')]);}else{_0x1bfa55(_0x387281[_0x2022('0xc')]);}})[_0x2022('0xd')](function(_0x646fdc){_0x25108b(_0x646fdc);});});}function respondWithResult(_0x59f475,_0x25e2a5){_0x25e2a5=_0x25e2a5||0xc8;return function(_0x20c845){if(_0x20c845){return _0x59f475[_0x2022('0xe')](_0x25e2a5)['json'](_0x20c845);}return _0x59f475['sendStatus'](0x194);};}function handleError(_0x4f520a,_0x491aa1){_0x491aa1=_0x491aa1||0x1f4;return function(_0x5e70cf){logger[_0x2022('0x9')](_0x5e70cf[_0x2022('0xf')]);if(_0x5e70cf[_0x2022('0x10')]){delete _0x5e70cf[_0x2022('0x10')];}_0x4f520a[_0x2022('0xe')](_0x491aa1)[_0x2022('0x11')](_0x5e70cf);};}function findById(_0x1ff95a){return function(_0x1f7135){if(!_['isNil'](_0x1ff95a)&&!_[_0x2022('0x12')](_0x1f7135)&&!_['isNil'](_0x1f7135[_0x2022('0x13')])){return _[_0x2022('0x14')](_0x1f7135[_0x2022('0x13')],function(_0x41046f){return _0x41046f['id']==_0x1ff95a;});}return null;};}exports[_0x2022('0x15')]=function(_0x9b9b38,_0x746cc9){return respondWithRpcPromise('VoiceChannels',_0x9b9b38[_0x2022('0x16')])['then'](respondWithResult(_0x746cc9,null))[_0x2022('0xd')](handleError(_0x746cc9,null));};exports[_0x2022('0x17')]=function(_0x3dc0c5,_0x45475e){return respondWithRpcPromise(_0x2022('0x18'),_['merge'](_0x3dc0c5[_0x2022('0x16')],_0x3dc0c5[_0x2022('0x19')]))[_0x2022('0x8')](respondWithResult(_0x45475e,null))['catch'](handleError(_0x45475e,null));};exports[_0x2022('0x1a')]=function(_0xe29812,_0x4b452f){return respondWithRpcPromise(_0x2022('0x1b'),_[_0x2022('0x1c')](_0xe29812[_0x2022('0x16')],_0xe29812['params']))[_0x2022('0x8')](respondWithResult(_0x4b452f,null))[_0x2022('0xd')](handleError(_0x4b452f,null));};exports['voiceQueues']=function(_0x261d2d,_0x15b6e6){return respondWithRpcPromise(_0x2022('0x1d'),_0x261d2d[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x15b6e6,null))['catch'](handleError(_0x15b6e6,null));};exports[_0x2022('0x1e')]=function(_0x11f8b6,_0x195987){return respondWithRpcPromise('VoiceQueues',_0x11f8b6['query'])[_0x2022('0x8')](findById(_0x11f8b6['params']['id']))['then'](respondWithResult(_0x195987,null))[_0x2022('0xd')](handleError(_0x195987,null));};exports['voiceQueuesPreview']=function(_0x54d55b,_0x55f38a){return respondWithRpcPromise(_0x2022('0x1f'),_[_0x2022('0x1c')](_0x54d55b[_0x2022('0x16')],_0x54d55b[_0x2022('0x19')]))['then'](respondWithResult(_0x55f38a,null))[_0x2022('0xd')](handleError(_0x55f38a,null));};exports['voiceQueuesChannels']=function(_0x48d20b,_0x12252a){return respondWithRpcPromise(_0x2022('0x20'),_0x48d20b[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x12252a,null))['catch'](handleError(_0x12252a,null));};exports[_0x2022('0x21')]=function(_0x4b61ce,_0x4c81de){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x2022('0x1c')](_0x4b61ce[_0x2022('0x16')],_0x4b61ce[_0x2022('0x19')]))[_0x2022('0x8')](respondWithResult(_0x4c81de,null))['catch'](handleError(_0x4c81de,null));};exports[_0x2022('0x22')]=function(_0x262f7b,_0x452670){return respondWithRpcPromise(_0x2022('0x23'),_[_0x2022('0x1c')](_0x262f7b['query'],_0x262f7b[_0x2022('0x19')]))['then'](respondWithResult(_0x452670,null))[_0x2022('0xd')](handleError(_0x452670,null));};exports[_0x2022('0x24')]=function(_0x9c24d8,_0x4f6f21){return respondWithRpcPromise(_0x2022('0x25'),_[_0x2022('0x1c')](_0x9c24d8[_0x2022('0x16')],_0x9c24d8[_0x2022('0x19')]))['then'](respondWithResult(_0x4f6f21,null))['catch'](handleError(_0x4f6f21,null));};exports[_0x2022('0x26')]=function(_0x2adca0,_0x4c9442){return respondWithRpcPromise(_0x2022('0x27'),_0x2adca0[_0x2022('0x16')])['then'](respondWithResult(_0x4c9442,null))[_0x2022('0xd')](handleError(_0x4c9442,null));};exports[_0x2022('0x28')]=function(_0x484adc,_0x355afd){return respondWithRpcPromise(_0x2022('0x29'),_0x484adc['query'])[_0x2022('0x8')](respondWithResult(_0x355afd,null))['catch'](handleError(_0x355afd,null));};exports[_0x2022('0x2a')]=function(_0x16d6b4,_0x4f5c8b){var _0x1bbd3f;return respondWithRpcPromise(_0x2022('0x2b'),_0x16d6b4[_0x2022('0x16')])['then'](function(_0x4b6a66){_0x1bbd3f=_0x4b6a66;return respondWithRpcPromise('Agents',_0x16d6b4[_0x2022('0x16')],routingClient);})['then'](function(_0x4d8467){return _['merge']({},_0x4d8467,_0x1bbd3f);})['then'](respondWithResult(_0x4f5c8b,null))[_0x2022('0xd')](handleError(_0x4f5c8b,null));};exports[_0x2022('0x2c')]=function(_0x4a3be7,_0x3ee323){if(_0x4a3be7['body']&&_0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')]&&_0x4a3be7[_0x2022('0x2f')]&&_0x4a3be7['user'][_0x2022('0x10')]){for(var _0x5705c7 in _0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')]){if(_0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')][_0x2022('0x30')](_0x5705c7)){db[_0x2022('0x31')][_0x2022('0x32')]({'where':{'channel':_0x5705c7,'membername':_0x4a3be7[_0x2022('0x2f')][_0x2022('0x10')],'type':_0x2022('0x33'),'exitAt':null,'uniqueid':_0x4a3be7['body'][_0x2022('0x2e')][_0x5705c7]&&_0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')][_0x5705c7][_0x2022('0x34')]?{'$notIn':_0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')][_0x5705c7]}:{'$ne':null}}})[_0x2022('0x8')](function(_0x371edc){var _0x70f042=moment()[_0x2022('0x35')](_0x2022('0x36'));for(var _0x2db035=0x0,_0x3cf576=_0x371edc[_0x2022('0x34')];_0x2db035<_0x3cf576;_0x2db035+=0x1){_0x371edc[_0x2db035][_0x2022('0x37')]({'exitAt':_0x70f042});}});for(var _0x2d05b4=0x0;_0x2d05b4<_0x4a3be7['body'][_0x2022('0x2e')][_0x5705c7][_0x2022('0x34')];_0x2d05b4+=0x1){db['MemberReport'][_0x2022('0x38')]({'where':{'channel':_0x5705c7,'membername':_0x4a3be7[_0x2022('0x2f')][_0x2022('0x10')],'type':_0x2022('0x33'),'uniqueid':_0x4a3be7[_0x2022('0x2d')][_0x2022('0x2e')][_0x5705c7][_0x2d05b4],'exitAt':null},'defaults':{'channel':_0x5705c7,'membername':_0x4a3be7[_0x2022('0x2f')][_0x2022('0x10')],'interface':_[_0x2022('0x12')](_0x4a3be7[_0x2022('0x2f')][_0x2022('0x39')])?util[_0x2022('0x35')](_0x2022('0x3a'),_0x4a3be7['user'][_0x2022('0x10')]):_0x4a3be7[_0x2022('0x2f')][_0x2022('0x39')],'type':_0x2022('0x33'),'enterAt':moment()[_0x2022('0x35')](_0x2022('0x36')),'role':_0x2022('0x3b'),'internal':_0x4a3be7['user']['internal'],'uniqueid':_0x4a3be7['body'][_0x2022('0x2e')][_0x5705c7][_0x2d05b4]}});}}}}return respondWithRpcPromise(_0x2022('0x3c'),{'id':_0x4a3be7[_0x2022('0x19')]['id'],'capacity':_0x4a3be7[_0x2022('0x2d')][_0x2022('0x3d')]},routingClient)[_0x2022('0x8')](respondWithResult(_0x3ee323,null))[_0x2022('0xd')](handleError(_0x3ee323,null));};exports[_0x2022('0x3e')]=function(_0x124450,_0x16c9df){return respondWithRpcPromise(_0x2022('0x3f'),_0x124450[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x16c9df,null))[_0x2022('0xd')](handleError(_0x16c9df,null));};exports[_0x2022('0x40')]=function(_0x3445f5,_0x2025e6){return respondWithRpcPromise(_0x2022('0x41'),_0x3445f5[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x2025e6,null))[_0x2022('0xd')](handleError(_0x2025e6,null));};exports[_0x2022('0x42')]=function(_0x5cddde,_0x4eb352){return respondWithRpcPromise(_0x2022('0x43'),_0x5cddde[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x4eb352,null))['catch'](handleError(_0x4eb352,null));};exports[_0x2022('0x44')]=function(_0x4071a2,_0x46a311){return respondWithRpcPromise(_0x2022('0x45'),_0x4071a2['query'],routingClient)['then'](respondWithResult(_0x46a311,null))[_0x2022('0xd')](handleError(_0x46a311,null));};exports[_0x2022('0x46')]=function(_0x503695,_0x35023b){return respondWithRpcPromise(_0x2022('0x45'),_0x503695['query'],routingClient)[_0x2022('0x8')](findById(_0x503695['params']['id']))[_0x2022('0x8')](respondWithResult(_0x35023b,null))[_0x2022('0xd')](handleError(_0x35023b,null));};exports[_0x2022('0x47')]=function(_0xcf80ef,_0x36f918){return respondWithRpcPromise(_0x2022('0x48'),_0xcf80ef[_0x2022('0x16')],routingClient)[_0x2022('0x8')](respondWithResult(_0x36f918,null))[_0x2022('0xd')](handleError(_0x36f918,null));};exports['showMailQueues']=function(_0x2a613e,_0x28179f){return respondWithRpcPromise(_0x2022('0x48'),_0x2a613e[_0x2022('0x16')],routingClient)[_0x2022('0x8')](findById(_0x2a613e['params']['id']))[_0x2022('0x8')](respondWithResult(_0x28179f,null))['catch'](handleError(_0x28179f,null));};exports['mailAccounts']=function(_0x4fd348,_0x8d4a06){return respondWithRpcPromise(_0x2022('0x49'),_0x4fd348['query'],mailClient)[_0x2022('0x8')](respondWithResult(_0x8d4a06,null))[_0x2022('0xd')](handleError(_0x8d4a06,null));};exports[_0x2022('0x4a')]=function(_0x8677e7,_0x59f6e1){return respondWithRpcPromise('OpenchannelQueues',_0x8677e7['query'],routingClient)['then'](respondWithResult(_0x59f6e1,null))['catch'](handleError(_0x59f6e1,null));};exports[_0x2022('0x4b')]=function(_0x46c0e8,_0xe1c8e7){return respondWithRpcPromise(_0x2022('0x4c'),_0x46c0e8['query'],routingClient)[_0x2022('0x8')](findById(_0x46c0e8[_0x2022('0x19')]['id']))['then'](respondWithResult(_0xe1c8e7,null))[_0x2022('0xd')](handleError(_0xe1c8e7,null));};exports['smsQueues']=function(_0x580401,_0xc1972){return respondWithRpcPromise(_0x2022('0x4d'),_0x580401[_0x2022('0x16')],routingClient)['then'](respondWithResult(_0xc1972,null))['catch'](handleError(_0xc1972,null));};exports['showSmsQueues']=function(_0x6f8c7e,_0x4bb6f1){return respondWithRpcPromise(_0x2022('0x4d'),_0x6f8c7e[_0x2022('0x16')],routingClient)['then'](findById(_0x6f8c7e[_0x2022('0x19')]['id']))[_0x2022('0x8')](respondWithResult(_0x4bb6f1,null))[_0x2022('0xd')](handleError(_0x4bb6f1,null));};exports[_0x2022('0x4e')]=function(_0x3b30d4,_0x546d52){return respondWithRpcPromise(_0x2022('0x4f'),_0x3b30d4[_0x2022('0x16')],routingClient)[_0x2022('0x8')](respondWithResult(_0x546d52,null))['catch'](handleError(_0x546d52,null));};exports[_0x2022('0x50')]=function(_0x5d7c83,_0x4505f0){return respondWithRpcPromise(_0x2022('0x4f'),_0x5d7c83['query'],routingClient)[_0x2022('0x8')](findById(_0x5d7c83[_0x2022('0x19')]['id']))[_0x2022('0x8')](respondWithResult(_0x4505f0,null))[_0x2022('0xd')](handleError(_0x4505f0,null));};exports['faxAccounts']=function(_0x590221,_0x50d29c){return respondWithRpcPromise(_0x2022('0x51'),_0x590221[_0x2022('0x16')])[_0x2022('0x8')](respondWithResult(_0x50d29c,null))[_0x2022('0xd')](handleError(_0x50d29c,null));};exports[_0x2022('0x52')]=function(_0x5e34d7,_0x39049d){return respondWithRpcPromise(_0x2022('0x53'),_0x5e34d7['query'],routingClient)['then'](respondWithResult(_0x39049d,null))[_0x2022('0xd')](handleError(_0x39049d,null));};exports['mailQueuesWaitingInteractions']=function(_0x31f76e,_0x1d6171){return respondWithRpcPromise(_0x2022('0x54'),_0x31f76e[_0x2022('0x16')],routingClient)['then'](respondWithResult(_0x1d6171,null))[_0x2022('0xd')](handleError(_0x1d6171,null));};exports[_0x2022('0x55')]=function(_0xc8b5e5,_0x4fc017){return respondWithRpcPromise(_0x2022('0x56'),_0xc8b5e5[_0x2022('0x16')],routingClient)[_0x2022('0x8')](respondWithResult(_0x4fc017,null))[_0x2022('0xd')](handleError(_0x4fc017,null));};exports[_0x2022('0x57')]=function(_0x1f57b6,_0x3556e1){return respondWithRpcPromise(_0x2022('0x58'),_0x1f57b6[_0x2022('0x16')],routingClient)[_0x2022('0x8')](respondWithResult(_0x3556e1,null))[_0x2022('0xd')](handleError(_0x3556e1,null));};exports['faxQueuesWaitingInteractions']=function(_0x4a6e95,_0x4ff447){return respondWithRpcPromise(_0x2022('0x59'),_0x4a6e95['query'],routingClient)[_0x2022('0x8')](respondWithResult(_0x4ff447,null))[_0x2022('0xd')](handleError(_0x4ff447,null));};exports['queueNotify']=function(_0x32e23f){return function(_0x3375fe,_0xf35297){var _0x1c984e,_0x32f15c;var _0x42f89e=_[_0x2022('0x5a')](_0x32e23f);var _0xf814f5=_0x32e23f===_0x2022('0x5b')?_0x2022('0x5c'):'Account';return db[_0x42f89e+'Queue'][_0x2022('0x5d')]({'raw':!![],'where':{'id':_0x3375fe[_0x2022('0x19')]['id']}})[_0x2022('0x8')](function(_0x359a00){if(_['isNil'](_0x359a00)){throw new Error(_0x42f89e+'\x20Queue\x20not\x20found');}_0x1c984e=_0x359a00;return db[_0x42f89e+_0x2022('0x5e')][_0x2022('0x5d')]({'where':{'id':_0x3375fe[_0x2022('0x2d')][_0x2022('0x5f')]},'include':[{'model':db[_0x42f89e+_0x2022('0x60')],'as':_0x2022('0x60')},{'model':db[_0x42f89e+_0xf814f5],'as':_0x2022('0x61')}]});})[_0x2022('0x8')](function(_0x50c73a){if(_[_0x2022('0x12')](_0x50c73a)){throw new Error(_0x42f89e+_0x2022('0x62'));}_0x32f15c=_0x50c73a;return _0x50c73a[_0x2022('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2022('0x8')](function(){var _0x2868c4={'uniqueid':_0x32e23f+'.'+_0x32f15c['id']+'.'+_0x32f15c[_0x2022('0x60')]['id'],'FromUserId':_0x3375fe[_0x2022('0x2f')]['id'],'type':_0x2022('0x64')};_0x2868c4[_0x42f89e+_0x2022('0x65')]=_0x32f15c['id'];_0x2868c4[_0x42f89e+_0x2022('0x66')]=_0x32f15c['Interaction']['id'];_0x2868c4['From'+_0x42f89e+_0xf814f5+'Id']=_0x32f15c[_0x2022('0x61')]['id'];_0x2868c4['To'+_0x42f89e+_0x2022('0x67')]=_0x1c984e['id'];return db[_0x42f89e+_0x2022('0x68')][_0x2022('0x69')](_0x2868c4);})[_0x2022('0x8')](function(){return respondWithRpcPromise(_0x2022('0x6a'),{'channel':_0x32e23f,'interaction':_0x32f15c[_0x2022('0x60')],'message':_0x32f15c,'account':_0x32f15c[_0x2022('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2022('0x64'),'appdata':_0x1c984e[_0x2022('0x10')]+','+(_0x32f15c[_0x2022('0x61')]['queueTransferTimeout']||0x12c),'interval':_0x2022('0x6b')}]},routingClient);})[_0x2022('0x8')](respondWithResult(_0xf35297,null))[_0x2022('0xd')](handleError(_0xf35297,null));};};exports[_0x2022('0x6c')]=function(_0x1e2bd3,_0x8c79e3){var _0x5b6da7,_0x4855f9;if(_['isNil'](_0x1e2bd3[_0x2022('0x2d')][_0x2022('0x6d')])){throw new Error(_0x2022('0x6e'));}var _0x48b86c=_0x1e2bd3[_0x2022('0x2d')][_0x2022('0x6d')];var _0x152e7b=_[_0x2022('0x5a')](_0x48b86c);var _0x5ae9aa=_0x48b86c===_0x2022('0x5b')?_0x2022('0x5c'):'Account';return db[_0x2022('0x6f')][_0x2022('0x5d')]({'raw':!![],'where':{'id':_0x1e2bd3[_0x2022('0x19')]['id'],'role':_0x2022('0x3b')}})[_0x2022('0x8')](function(_0x5f2926){if(_[_0x2022('0x12')](_0x5f2926)){throw new Error('Agent\x20not\x20found');}_0x5b6da7=_0x5f2926;return db[_0x152e7b+_0x2022('0x5e')][_0x2022('0x5d')]({'where':{'id':_0x1e2bd3[_0x2022('0x2d')][_0x2022('0x5f')]},'include':[{'model':db[_0x152e7b+_0x2022('0x60')],'as':_0x2022('0x60')},{'model':db[_0x152e7b+_0x5ae9aa],'as':_0x2022('0x61')}]});})[_0x2022('0x8')](function(_0x8d75d2){if(_[_0x2022('0x12')](_0x8d75d2)){throw new Error(_0x152e7b+_0x2022('0x62'));}_0x4855f9=_0x8d75d2;return _0x8d75d2[_0x2022('0x63')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c97ca={'uniqueid':_0x48b86c+'.'+_0x4855f9['id']+'.'+_0x4855f9[_0x2022('0x60')]['id'],'FromUserId':_0x1e2bd3[_0x2022('0x2f')]['id'],'type':_0x2022('0x64'),'ToUserId':_0x5b6da7['id']};_0x2c97ca[_0x152e7b+_0x2022('0x65')]=_0x4855f9['id'];_0x2c97ca[_0x152e7b+_0x2022('0x66')]=_0x4855f9[_0x2022('0x60')]['id'];_0x2c97ca['From'+_0x152e7b+_0x5ae9aa+'Id']=_0x4855f9['Account']['id'];return db[_0x152e7b+_0x2022('0x68')][_0x2022('0x69')](_0x2c97ca);})[_0x2022('0x8')](function(){return respondWithRpcPromise(_0x2022('0x6a'),{'channel':_0x48b86c,'interaction':_0x4855f9[_0x2022('0x60')],'message':_0x4855f9,'account':_0x4855f9['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x2022('0x3b'),'appdata':_0x5b6da7['name']+','+(_0x4855f9[_0x2022('0x61')]['agentTransferTimeout']||0x12c),'interval':_0x2022('0x6b')}]},routingClient);})[_0x2022('0x8')](respondWithResult(_0x8c79e3,null))[_0x2022('0xd')](handleError(_0x8c79e3,null));}; \ No newline at end of file +var _0x6cfd=['*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','chat','User','Agent\x20not\x20found','update','From','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','capacity','telephones','Telephones','Trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','create','Start'];(function(_0x3539b2,_0x5e4e1e){var _0x33667f=function(_0x40907b){while(--_0x40907b){_0x3539b2['push'](_0x3539b2['shift']());}};_0x33667f(++_0x5e4e1e);}(_0x6cfd,0x7c));var _0xd6cf=function(_0x48ef7e,_0x5d765c){_0x48ef7e=_0x48ef7e-0x0;var _0x3bdacc=_0x6cfd[_0x48ef7e];return _0x3bdacc;};'use strict';var BPromise=require(_0xd6cf('0x0'));var moment=require(_0xd6cf('0x1'));var _=require(_0xd6cf('0x2'));var util=require(_0xd6cf('0x3'));var db=require(_0xd6cf('0x4'))['db'];var logger=require(_0xd6cf('0x5'))(_0xd6cf('0x6'));var jayson=require(_0xd6cf('0x7'));var amiClient=jayson[_0xd6cf('0x8')][_0xd6cf('0x9')]({'port':0x232a});var mailClient=jayson[_0xd6cf('0x8')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xd6cf('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x7dce85,_0x4223a3,_0xa70433){return new BPromise(function(_0x7fa344,_0x14a734){var _0x52628d=_0xa70433?_0xa70433:amiClient;return _0x52628d[_0xd6cf('0xa')](_0x7dce85,_0x4223a3)[_0xd6cf('0xb')](function(_0x1e1c32){if(_0x1e1c32['error']){if(_0x1e1c32[_0xd6cf('0xc')][_0xd6cf('0xd')]===0x1f4){return _0x14a734(_0x1e1c32[_0xd6cf('0xc')][_0xd6cf('0xe')]);}return _0x7fa344(_0x1e1c32[_0xd6cf('0xc')][_0xd6cf('0xe')]);}else{_0x7fa344(_0x1e1c32['result']);}})[_0xd6cf('0xf')](function(_0x546a4d){_0x14a734(_0x546a4d);});});}function respondWithResult(_0x5c8b64,_0x505987){_0x505987=_0x505987||0xc8;return function(_0x43f942){if(_0x43f942){return _0x5c8b64[_0xd6cf('0x10')](_0x505987)[_0xd6cf('0x11')](_0x43f942);}return _0x5c8b64[_0xd6cf('0x12')](0x194);};}function handleError(_0x3a6d29,_0x4d77c7){_0x4d77c7=_0x4d77c7||0x1f4;return function(_0x2dcd68){logger[_0xd6cf('0xc')](_0x2dcd68[_0xd6cf('0x13')]);if(_0x2dcd68[_0xd6cf('0x14')]){delete _0x2dcd68[_0xd6cf('0x14')];}_0x3a6d29['status'](_0x4d77c7)[_0xd6cf('0x15')](_0x2dcd68);};}function findById(_0x138422){return function(_0x2a21e0){if(!_[_0xd6cf('0x16')](_0x138422)&&!_[_0xd6cf('0x16')](_0x2a21e0)&&!_[_0xd6cf('0x16')](_0x2a21e0[_0xd6cf('0x17')])){return _[_0xd6cf('0x18')](_0x2a21e0[_0xd6cf('0x17')],function(_0x1c946c){return _0x1c946c['id']==_0x138422;});}return null;};}exports[_0xd6cf('0x19')]=function(_0x40da9d,_0x58041c){return respondWithRpcPromise(_0xd6cf('0x1a'),_0x40da9d[_0xd6cf('0x1b')])['then'](respondWithResult(_0x58041c,null))[_0xd6cf('0xf')](handleError(_0x58041c,null));};exports[_0xd6cf('0x1c')]=function(_0x1700a4,_0x34db5c){return respondWithRpcPromise(_0xd6cf('0x1d'),_[_0xd6cf('0x1e')](_0x1700a4[_0xd6cf('0x1b')],_0x1700a4[_0xd6cf('0x1f')]))['then'](respondWithResult(_0x34db5c,null))[_0xd6cf('0xf')](handleError(_0x34db5c,null));};exports[_0xd6cf('0x20')]=function(_0x361914,_0xcf3f09){return respondWithRpcPromise(_0xd6cf('0x21'),_[_0xd6cf('0x1e')](_0x361914[_0xd6cf('0x1b')],_0x361914[_0xd6cf('0x1f')]))[_0xd6cf('0xb')](respondWithResult(_0xcf3f09,null))[_0xd6cf('0xf')](handleError(_0xcf3f09,null));};exports[_0xd6cf('0x22')]=function(_0x1011e4,_0x547226){return respondWithRpcPromise(_0xd6cf('0x23'),_0x1011e4['query'])[_0xd6cf('0xb')](respondWithResult(_0x547226,null))[_0xd6cf('0xf')](handleError(_0x547226,null));};exports['showVoiceQueues']=function(_0x5d1a29,_0x5cf506){return respondWithRpcPromise(_0xd6cf('0x23'),_0x5d1a29[_0xd6cf('0x1b')])[_0xd6cf('0xb')](findById(_0x5d1a29[_0xd6cf('0x1f')]['id']))[_0xd6cf('0xb')](respondWithResult(_0x5cf506,null))['catch'](handleError(_0x5cf506,null));};exports[_0xd6cf('0x24')]=function(_0x506544,_0x2d6b1b){return respondWithRpcPromise(_0xd6cf('0x25'),_[_0xd6cf('0x1e')](_0x506544['query'],_0x506544[_0xd6cf('0x1f')]))[_0xd6cf('0xb')](respondWithResult(_0x2d6b1b,null))[_0xd6cf('0xf')](handleError(_0x2d6b1b,null));};exports[_0xd6cf('0x26')]=function(_0x1438b8,_0x46e51b){return respondWithRpcPromise(_0xd6cf('0x27'),_0x1438b8[_0xd6cf('0x1b')])[_0xd6cf('0xb')](respondWithResult(_0x46e51b,null))[_0xd6cf('0xf')](handleError(_0x46e51b,null));};exports[_0xd6cf('0x28')]=function(_0x5b57db,_0x43234e){return respondWithRpcPromise(_0xd6cf('0x29'),_[_0xd6cf('0x1e')](_0x5b57db[_0xd6cf('0x1b')],_0x5b57db[_0xd6cf('0x1f')]))['then'](respondWithResult(_0x43234e,null))[_0xd6cf('0xf')](handleError(_0x43234e,null));};exports[_0xd6cf('0x2a')]=function(_0x36e36a,_0x212141){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xd6cf('0x1e')](_0x36e36a[_0xd6cf('0x1b')],_0x36e36a[_0xd6cf('0x1f')]))[_0xd6cf('0xb')](respondWithResult(_0x212141,null))['catch'](handleError(_0x212141,null));};exports[_0xd6cf('0x2b')]=function(_0x3aaad7,_0x411d2e){return respondWithRpcPromise(_0xd6cf('0x2c'),_[_0xd6cf('0x1e')](_0x3aaad7[_0xd6cf('0x1b')],_0x3aaad7[_0xd6cf('0x1f')]))[_0xd6cf('0xb')](respondWithResult(_0x411d2e,null))[_0xd6cf('0xf')](handleError(_0x411d2e,null));};exports[_0xd6cf('0x2d')]=function(_0x3c1ed4,_0x295df9){return respondWithRpcPromise('Outbound',_0x3c1ed4[_0xd6cf('0x1b')])[_0xd6cf('0xb')](respondWithResult(_0x295df9,null))['catch'](handleError(_0x295df9,null));};exports['outboundChannels']=function(_0x40d08a,_0xd76349){return respondWithRpcPromise(_0xd6cf('0x2e'),_0x40d08a[_0xd6cf('0x1b')])['then'](respondWithResult(_0xd76349,null))[_0xd6cf('0xf')](handleError(_0xd76349,null));};exports[_0xd6cf('0x2f')]=function(_0x4da9bb,_0x580eb7){var _0x59def8;return respondWithRpcPromise(_0xd6cf('0x30'),_0x4da9bb[_0xd6cf('0x1b')])[_0xd6cf('0xb')](function(_0x2edf96){_0x59def8=_0x2edf96;return respondWithRpcPromise(_0xd6cf('0x30'),_0x4da9bb[_0xd6cf('0x1b')],routingClient);})['then'](function(_0x50bcac){return _[_0xd6cf('0x1e')]({},_0x50bcac,_0x59def8);})[_0xd6cf('0xb')](respondWithResult(_0x580eb7,null))['catch'](handleError(_0x580eb7,null));};exports[_0xd6cf('0x31')]=function(_0x72cd4e,_0xf5b462){if(_0x72cd4e[_0xd6cf('0x32')]&&_0x72cd4e[_0xd6cf('0x32')]['interaction']&&_0x72cd4e[_0xd6cf('0x33')]&&_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x14')]){for(var _0x518367 in _0x72cd4e[_0xd6cf('0x32')][_0xd6cf('0x34')]){if(_0x72cd4e[_0xd6cf('0x32')][_0xd6cf('0x34')]['hasOwnProperty'](_0x518367)){db[_0xd6cf('0x35')]['findAll']({'where':{'channel':_0x518367,'membername':_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x14')],'type':_0xd6cf('0x36'),'exitAt':null,'uniqueid':_0x72cd4e[_0xd6cf('0x32')][_0xd6cf('0x34')][_0x518367]&&_0x72cd4e[_0xd6cf('0x32')]['interaction'][_0x518367][_0xd6cf('0x37')]?{'$notIn':_0x72cd4e[_0xd6cf('0x32')][_0xd6cf('0x34')][_0x518367]}:{'$ne':null}}})['then'](function(_0x4bc07f){var _0x2ab0ad=moment()[_0xd6cf('0x38')](_0xd6cf('0x39'));for(var _0x5b0801=0x0,_0x509427=_0x4bc07f[_0xd6cf('0x37')];_0x5b0801<_0x509427;_0x5b0801+=0x1){_0x4bc07f[_0x5b0801][_0xd6cf('0x3a')]({'exitAt':_0x2ab0ad});}});for(var _0x2e637a=0x0;_0x2e637a<_0x72cd4e[_0xd6cf('0x32')]['interaction'][_0x518367][_0xd6cf('0x37')];_0x2e637a+=0x1){db[_0xd6cf('0x35')][_0xd6cf('0x3b')]({'where':{'channel':_0x518367,'membername':_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x14')],'type':'INTERACTION','uniqueid':_0x72cd4e[_0xd6cf('0x32')]['interaction'][_0x518367][_0x2e637a],'exitAt':null},'defaults':{'channel':_0x518367,'membername':_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x14')],'interface':_[_0xd6cf('0x16')](_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x3c')])?util[_0xd6cf('0x38')](_0xd6cf('0x3d'),_0x72cd4e[_0xd6cf('0x33')]['name']):_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x3c')],'type':_0xd6cf('0x36'),'enterAt':moment()[_0xd6cf('0x38')](_0xd6cf('0x39')),'role':_0xd6cf('0x3e'),'internal':_0x72cd4e[_0xd6cf('0x33')][_0xd6cf('0x3f')],'uniqueid':_0x72cd4e['body'][_0xd6cf('0x34')][_0x518367][_0x2e637a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x72cd4e[_0xd6cf('0x1f')]['id'],'capacity':_0x72cd4e[_0xd6cf('0x32')][_0xd6cf('0x40')]},routingClient)['then'](respondWithResult(_0xf5b462,null))[_0xd6cf('0xf')](handleError(_0xf5b462,null));};exports[_0xd6cf('0x41')]=function(_0x43d7e2,_0x1291c9){return respondWithRpcPromise(_0xd6cf('0x42'),_0x43d7e2[_0xd6cf('0x1b')])[_0xd6cf('0xb')](respondWithResult(_0x1291c9,null))[_0xd6cf('0xf')](handleError(_0x1291c9,null));};exports['trunks']=function(_0x1f9b6e,_0x2e8a48){return respondWithRpcPromise(_0xd6cf('0x43'),_0x1f9b6e[_0xd6cf('0x1b')])['then'](respondWithResult(_0x2e8a48,null))[_0xd6cf('0xf')](handleError(_0x2e8a48,null));};exports['campaigns']=function(_0x1b61c7,_0x5ebe0a){return respondWithRpcPromise(_0xd6cf('0x44'),_0x1b61c7['query'])['then'](respondWithResult(_0x5ebe0a,null))[_0xd6cf('0xf')](handleError(_0x5ebe0a,null));};exports['chatQueues']=function(_0x503569,_0x4ad68c){return respondWithRpcPromise(_0xd6cf('0x45'),_0x503569[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x4ad68c,null))[_0xd6cf('0xf')](handleError(_0x4ad68c,null));};exports[_0xd6cf('0x46')]=function(_0xf88166,_0x3c3240){return respondWithRpcPromise(_0xd6cf('0x45'),_0xf88166['query'],routingClient)[_0xd6cf('0xb')](findById(_0xf88166[_0xd6cf('0x1f')]['id']))[_0xd6cf('0xb')](respondWithResult(_0x3c3240,null))[_0xd6cf('0xf')](handleError(_0x3c3240,null));};exports[_0xd6cf('0x47')]=function(_0x4fad7d,_0x2d3643){return respondWithRpcPromise(_0xd6cf('0x48'),_0x4fad7d[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x2d3643,null))[_0xd6cf('0xf')](handleError(_0x2d3643,null));};exports[_0xd6cf('0x49')]=function(_0x4a1031,_0x3c30fb){return respondWithRpcPromise(_0xd6cf('0x48'),_0x4a1031[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](findById(_0x4a1031['params']['id']))[_0xd6cf('0xb')](respondWithResult(_0x3c30fb,null))[_0xd6cf('0xf')](handleError(_0x3c30fb,null));};exports[_0xd6cf('0x4a')]=function(_0x252bac,_0x40ef12){return respondWithRpcPromise('MailAccounts',_0x252bac['query'],mailClient)[_0xd6cf('0xb')](respondWithResult(_0x40ef12,null))['catch'](handleError(_0x40ef12,null));};exports[_0xd6cf('0x4b')]=function(_0x3bada9,_0x902ff){return respondWithRpcPromise(_0xd6cf('0x4c'),_0x3bada9['query'],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x902ff,null))[_0xd6cf('0xf')](handleError(_0x902ff,null));};exports[_0xd6cf('0x4d')]=function(_0x5ca809,_0x3b8627){return respondWithRpcPromise(_0xd6cf('0x4c'),_0x5ca809[_0xd6cf('0x1b')],routingClient)['then'](findById(_0x5ca809[_0xd6cf('0x1f')]['id']))['then'](respondWithResult(_0x3b8627,null))[_0xd6cf('0xf')](handleError(_0x3b8627,null));};exports[_0xd6cf('0x4e')]=function(_0x3938d4,_0x39718b){return respondWithRpcPromise(_0xd6cf('0x4f'),_0x3938d4[_0xd6cf('0x1b')],routingClient)['then'](respondWithResult(_0x39718b,null))[_0xd6cf('0xf')](handleError(_0x39718b,null));};exports[_0xd6cf('0x50')]=function(_0x4892dc,_0x127fb1){return respondWithRpcPromise('SmsQueues',_0x4892dc[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](findById(_0x4892dc[_0xd6cf('0x1f')]['id']))['then'](respondWithResult(_0x127fb1,null))[_0xd6cf('0xf')](handleError(_0x127fb1,null));};exports[_0xd6cf('0x51')]=function(_0x1e4ce2,_0x1372b2){return respondWithRpcPromise(_0xd6cf('0x52'),_0x1e4ce2[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x1372b2,null))[_0xd6cf('0xf')](handleError(_0x1372b2,null));};exports[_0xd6cf('0x53')]=function(_0x3ca0cd,_0x546b24){return respondWithRpcPromise(_0xd6cf('0x52'),_0x3ca0cd[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](findById(_0x3ca0cd[_0xd6cf('0x1f')]['id']))[_0xd6cf('0xb')](respondWithResult(_0x546b24,null))['catch'](handleError(_0x546b24,null));};exports['faxAccounts']=function(_0x1a4246,_0x350903){return respondWithRpcPromise(_0xd6cf('0x54'),_0x1a4246[_0xd6cf('0x1b')])['then'](respondWithResult(_0x350903,null))[_0xd6cf('0xf')](handleError(_0x350903,null));};exports[_0xd6cf('0x55')]=function(_0x515182,_0x2efa88){return respondWithRpcPromise(_0xd6cf('0x56'),_0x515182[_0xd6cf('0x1b')],routingClient)['then'](respondWithResult(_0x2efa88,null))['catch'](handleError(_0x2efa88,null));};exports['mailQueuesWaitingInteractions']=function(_0x59c996,_0x4cdcdf){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x59c996[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x4cdcdf,null))[_0xd6cf('0xf')](handleError(_0x4cdcdf,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x3cfaf5,_0x131465){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3cfaf5['query'],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x131465,null))[_0xd6cf('0xf')](handleError(_0x131465,null));};exports['smsQueuesWaitingInteractions']=function(_0x5501a5,_0x48cb35){return respondWithRpcPromise(_0xd6cf('0x57'),_0x5501a5[_0xd6cf('0x1b')],routingClient)[_0xd6cf('0xb')](respondWithResult(_0x48cb35,null))[_0xd6cf('0xf')](handleError(_0x48cb35,null));};exports[_0xd6cf('0x58')]=function(_0x5d3bf6,_0x3cbf69){return respondWithRpcPromise(_0xd6cf('0x59'),_0x5d3bf6[_0xd6cf('0x1b')],routingClient)['then'](respondWithResult(_0x3cbf69,null))[_0xd6cf('0xf')](handleError(_0x3cbf69,null));};exports[_0xd6cf('0x5a')]=function(_0x4ad410){return function(_0x461594,_0xcc75e5){var _0x108afd,_0x26eca2;var _0x47017b=_[_0xd6cf('0x5b')](_0x4ad410);var _0x471036=_0x4ad410==='chat'?_0xd6cf('0x5c'):_0xd6cf('0x5d');return db[_0x47017b+_0xd6cf('0x5e')]['findOne']({'raw':!![],'where':{'id':_0x461594[_0xd6cf('0x1f')]['id']}})['then'](function(_0x2053a4){if(_[_0xd6cf('0x16')](_0x2053a4)){throw new Error(_0x47017b+'\x20Queue\x20not\x20found');}_0x108afd=_0x2053a4;return db[_0x47017b+_0xd6cf('0x5f')][_0xd6cf('0x60')]({'where':{'id':_0x461594[_0xd6cf('0x32')][_0xd6cf('0x61')]},'include':[{'model':db[_0x47017b+_0xd6cf('0x62')],'as':_0xd6cf('0x62')},{'model':db[_0x47017b+_0x471036],'as':_0xd6cf('0x5d')}]});})[_0xd6cf('0xb')](function(_0x2f65d6){if(_[_0xd6cf('0x16')](_0x2f65d6)){throw new Error(_0x47017b+_0xd6cf('0x63'));}_0x26eca2=_0x2f65d6;return _0x2f65d6['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd6cf('0xb')](function(){var _0x2d3ac0={'uniqueid':_0x4ad410+'.'+_0x26eca2['id']+'.'+_0x26eca2['Interaction']['id'],'FromUserId':_0x461594['user']['id'],'type':_0xd6cf('0x64')};_0x2d3ac0[_0x47017b+_0xd6cf('0x65')]=_0x26eca2['id'];_0x2d3ac0[_0x47017b+'InteractionId']=_0x26eca2[_0xd6cf('0x62')]['id'];_0x2d3ac0['From'+_0x47017b+_0x471036+'Id']=_0x26eca2['Account']['id'];_0x2d3ac0['To'+_0x47017b+'QueueId']=_0x108afd['id'];return db[_0x47017b+'TransferReport'][_0xd6cf('0x66')](_0x2d3ac0);})[_0xd6cf('0xb')](function(){return respondWithRpcPromise(_0xd6cf('0x67'),{'channel':_0x4ad410,'interaction':_0x26eca2[_0xd6cf('0x62')],'message':_0x26eca2,'account':_0x26eca2[_0xd6cf('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd6cf('0x64'),'appdata':_0x108afd['name']+','+(_0x26eca2[_0xd6cf('0x5d')]['queueTransferTimeout']||0x12c),'interval':_0xd6cf('0x68')}]},routingClient);})[_0xd6cf('0xb')](respondWithResult(_0xcc75e5,null))[_0xd6cf('0xf')](handleError(_0xcc75e5,null));};};exports['agentNotify']=function(_0x2a2c06,_0x54834a){var _0x473d43,_0x3734f4;if(_['isNil'](_0x2a2c06[_0xd6cf('0x32')]['channel'])){throw new Error(_0xd6cf('0x69'));}var _0x1a974c=_0x2a2c06[_0xd6cf('0x32')][_0xd6cf('0x6a')];var _0x48d3df=_[_0xd6cf('0x5b')](_0x1a974c);var _0x379d61=_0x1a974c===_0xd6cf('0x6b')?_0xd6cf('0x5c'):_0xd6cf('0x5d');return db[_0xd6cf('0x6c')][_0xd6cf('0x60')]({'raw':!![],'where':{'id':_0x2a2c06['params']['id'],'role':'agent'}})[_0xd6cf('0xb')](function(_0xe47c3e){if(_[_0xd6cf('0x16')](_0xe47c3e)){throw new Error(_0xd6cf('0x6d'));}_0x473d43=_0xe47c3e;return db[_0x48d3df+_0xd6cf('0x5f')]['findOne']({'where':{'id':_0x2a2c06[_0xd6cf('0x32')]['messageId']},'include':[{'model':db[_0x48d3df+_0xd6cf('0x62')],'as':_0xd6cf('0x62')},{'model':db[_0x48d3df+_0x379d61],'as':_0xd6cf('0x5d')}]});})[_0xd6cf('0xb')](function(_0x47cfae){if(_[_0xd6cf('0x16')](_0x47cfae)){throw new Error(_0x48d3df+_0xd6cf('0x63'));}_0x3734f4=_0x47cfae;return _0x47cfae[_0xd6cf('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd6cf('0xb')](function(){var _0xccb380={'uniqueid':_0x1a974c+'.'+_0x3734f4['id']+'.'+_0x3734f4[_0xd6cf('0x62')]['id'],'FromUserId':_0x2a2c06['user']['id'],'type':'queue','ToUserId':_0x473d43['id']};_0xccb380[_0x48d3df+_0xd6cf('0x65')]=_0x3734f4['id'];_0xccb380[_0x48d3df+'InteractionId']=_0x3734f4[_0xd6cf('0x62')]['id'];_0xccb380[_0xd6cf('0x6f')+_0x48d3df+_0x379d61+'Id']=_0x3734f4[_0xd6cf('0x5d')]['id'];return db[_0x48d3df+_0xd6cf('0x70')]['create'](_0xccb380);})[_0xd6cf('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a974c,'interaction':_0x3734f4['Interaction'],'message':_0x3734f4,'account':_0x3734f4[_0xd6cf('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd6cf('0x3e'),'appdata':_0x473d43['name']+','+(_0x3734f4[_0xd6cf('0x5d')][_0xd6cf('0x71')]||0x12c),'interval':_0xd6cf('0x68')}]},routingClient);})[_0xd6cf('0xb')](respondWithResult(_0x54834a,null))[_0xd6cf('0xf')](handleError(_0x54834a,null));}; \ No newline at end of file diff --git a/server/api/saAsset/index.js b/server/api/saAsset/index.js index 7d015af..dfbae01 100644 --- a/server/api/saAsset/index.js +++ b/server/api/saAsset/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['show','post','create','automaticSubscriptionInvoiceAlignment','/:id/automaticSubscriptionInvoice','automaticSubscriptionInvoice','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./saAsset.controller','isAuthenticated','index','get','/describe','describe','/getSubscriptions','getSubscriptions','/:id'];(function(_0x2c16ab,_0xaa3f47){var _0x50d50c=function(_0x4bd914){while(--_0x4bd914){_0x2c16ab['push'](_0x2c16ab['shift']());}};_0x50d50c(++_0xaa3f47);}(_0xac9d,0x14d));var _0xdac9=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xac9d[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var auth=require(_0xdac9('0x6'));var interaction=require(_0xdac9('0x7'));var config=require('../../config/environment');var controller=require(_0xdac9('0x8'));router['get']('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0xa')]);router[_0xdac9('0xb')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0xb')](_0xdac9('0x10'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);router[_0xdac9('0x12')]('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0x13')]);router[_0xdac9('0x12')]('/:id/automaticSubscriptionInvoiceAlignment',auth[_0xdac9('0x9')](),controller[_0xdac9('0x14')]);router['post'](_0xdac9('0x15'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x16')]);router['put'](_0xdac9('0x10'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x17')]);router['delete']('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x18')]);module['exports']=router; \ No newline at end of file +var _0xf698=['../../config/environment','./saAsset.controller','isAuthenticated','describe','get','/getSubscriptions','getSubscriptions','/:id','show','post','automaticSubscriptionInvoice','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x437e8a,_0x44dfba){var _0x5e9910=function(_0x3b71e1){while(--_0x3b71e1){_0x437e8a['push'](_0x437e8a['shift']());}};_0x5e9910(++_0x44dfba);}(_0xf698,0x1de));var _0x8f69=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xf698[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var auth=require(_0x8f69('0x4'));var interaction=require(_0x8f69('0x5'));var config=require(_0x8f69('0x6'));var controller=require(_0x8f69('0x7'));router['get']('/',auth[_0x8f69('0x8')](),controller['index']);router['get']('/describe',auth[_0x8f69('0x8')](),controller[_0x8f69('0x9')]);router[_0x8f69('0xa')](_0x8f69('0xb'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xc')]);router[_0x8f69('0xa')](_0x8f69('0xd'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xe')]);router[_0x8f69('0xf')]('/',auth[_0x8f69('0x8')](),controller['create']);router[_0x8f69('0xf')]('/:id/automaticSubscriptionInvoiceAlignment',auth[_0x8f69('0x8')](),controller['automaticSubscriptionInvoiceAlignment']);router[_0x8f69('0xf')]('/:id/automaticSubscriptionInvoice',auth[_0x8f69('0x8')](),controller[_0x8f69('0x10')]);router[_0x8f69('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8f69('0x12')]);router[_0x8f69('0x13')]('/:id',auth[_0x8f69('0x8')](),controller[_0x8f69('0x14')]);module[_0x8f69('0x15')]=router; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.attributes.js b/server/api/saAsset/saAsset.attributes.js index a4a44c2..08452c7 100644 --- a/server/api/saAsset/saAsset.attributes.js +++ b/server/api/saAsset/saAsset.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeea4=['\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','DATE','BOOLEAN','sequelize','exports','STRING','INTEGER','TEXT','long'];(function(_0x2aaa7f,_0x5300a0){var _0x45804f=function(_0x121a3f){while(--_0x121a3f){_0x2aaa7f['push'](_0x2aaa7f['shift']());}};_0x45804f(++_0x5300a0);}(_0xeea4,0x19e));var _0x4eea=function(_0x13ca47,_0x3cbb9f){_0x13ca47=_0x13ca47-0x0;var _0x27a3aa=_0xeea4[_0x13ca47];return _0x27a3aa;};'use strict';var Sequelize=require(_0x4eea('0x0'));module[_0x4eea('0x1')]={'companyName':{'type':Sequelize[_0x4eea('0x2')]},'companyId':{'type':Sequelize[_0x4eea('0x3')]},'productName':{'type':Sequelize[_0x4eea('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x4eea('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x4eea('0x4')](_0x4eea('0x5'))+_0x4eea('0x6')},'typeName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x4eea('0x4')]},'pricelistId':{'type':Sequelize['TEXT']},'netPrice':{'type':Sequelize[_0x4eea('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x4eea('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x4eea('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4eea('0x4')]},'dateLastInvoice':{'type':Sequelize[_0x4eea('0x8')]},'dateNextInvoice':{'type':Sequelize['DATE']},'subscriptionId':{'type':Sequelize[_0x4eea('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x4eea('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x4eea('0x3')],'allowNull':![]},'deleted':{'type':Sequelize[_0x4eea('0x9')]},'status':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xee4f=['STRING','long','DECIMAL','DATE','BOOLEAN','sequelize','INTEGER','TEXT'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xee4f,0xad));var _0xfee4=function(_0x3c9f56,_0x198760){_0x3c9f56=_0x3c9f56-0x0;var _0x33f1be=_0xee4f[_0x3c9f56];return _0x33f1be;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xfee4('0x1')]},'productName':{'type':Sequelize[_0xfee4('0x2')],'allowNull':![]},'productCode':{'type':Sequelize[_0xfee4('0x3')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT'](_0xfee4('0x4'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'typeName':{'type':Sequelize[_0xfee4('0x3')]},'pricelistName':{'type':Sequelize['TEXT']},'pricelistId':{'type':Sequelize['TEXT']},'netPrice':{'type':Sequelize[_0xfee4('0x5')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xfee4('0x3')]},'note':{'type':Sequelize[_0xfee4('0x2')]},'dateLastInvoice':{'type':Sequelize[_0xfee4('0x6')]},'dateNextInvoice':{'type':Sequelize['DATE']},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0xfee4('0x3')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0xfee4('0x1')],'allowNull':![]},'deleted':{'type':Sequelize[_0xfee4('0x7')]},'status':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.controller.js b/server/api/saAsset/saAsset.controller.js index 531382b..d6d4013 100644 --- a/server/api/saAsset/saAsset.controller.js +++ b/server/api/saAsset/saAsset.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['value','days','diffDay','dayPrice','total','££££££££\x20products','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','SAAsset','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','map','type','key','VIRTUAL','field','include','findAll','rows','catch','show','includeAll','options','create','body','update','find','params','describe','getSubscriptions','sort','CONCAT\x20(`companyName`,\x22\x20\x22,`pricelistName`,\x22\x20\x22,`subscriptionName`)\x20as\x20SubscriptionName,DATEDIFF\x20(`dateNextInvoice`,NOW())\x20as\x20Expired,`subscriptionId`,`companyName`,`companyId`,`pricelistName`,`pricelistId`,`subscriptionName`,`dateNextInvoice`,SUM(`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20as\x20TotalNetPrice,SUM((`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20/\x20100\x20*\x20`tax`)\x20as\x20TotalTax','pricelistName','pricelistId','subscriptionName','subscriptionId','automaticSubscriptionInvoiceAlignment','sequelize','transaction','CmCompany','companyId','DESC','groupBy','forEach','log','automaticSubscriptionInvoice\x20productForCompany->','push','all','No\x20invoice.\x20Invoice\x20expired!!\x20','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','??????\x20updSubscriptionDetail\x20product->','??????\x20updSubscriptionDetail\x20product.id->','??????\x20updSubscriptionDetail\x20product.dateNextInvoice->','dateNextInvoice','Partial','add','subscriptionMonthly','nextInvoice','System','companyName','productName','productCode','typeName','netPrice','tax','note','findOne','SAPaymentMethod','saPaymentMethod','Automatic\x20Job','close','saStreet','saPostalCode','saCity','saCountry','saISOCode','saSDICode','saFiscalMessage','saEurope','saSocCap','saPIVA','bankName','bankpostalCode','bankcity','bankcountry','bankBICSWIFT','phone','fax','website','bankABI','paypalEmail','SAInvoice','pick','negate','isNull','mapValues','quantity','createdAt'];(function(_0x3c1199,_0x40e349){var _0x48196f=function(_0x3106d5){while(--_0x3106d5){_0x3c1199['push'](_0x3c1199['shift']());}};_0x48196f(++_0x40e349);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x335e20,_0x3b998c){_0x335e20=_0x335e20-0x0;var _0x410b0f=_0xbdb7[_0x335e20];return _0x410b0f;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var hardwareService=require(_0x7bdb('0x12'));var logger=require(_0x7bdb('0x13'))(_0x7bdb('0x14'));var utils=require(_0x7bdb('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b9b9,_0x3053d0){_0x3053d0=_0x3053d0||0xcc;return function(_0x25e3cb){if(_0x25e3cb){return _0x52b9b9['sendStatus'](_0x3053d0);}return _0x52b9b9[_0x7bdb('0x16')](_0x3053d0)['end']();};}function respondWithResult(_0x5898c1,_0x2abca6){_0x2abca6=_0x2abca6||0xc8;return function(_0x46dd4a){if(_0x46dd4a){return _0x5898c1['status'](_0x2abca6)['json'](_0x46dd4a);}};}function respondWithFilteredResult(_0x4e98f7,_0x4476ff){return function(_0x195b2e){if(_0x195b2e){var _0xe9919f=_0x195b2e[_0x7bdb('0x17')],_0x25d417=_0x4476ff[_0x7bdb('0x18')],_0x31c909=_0x4476ff['offset']+_0x4476ff[_0x7bdb('0x19')],_0xbde12a;if(_0x31c909>=_0xe9919f){_0x31c909=_0xe9919f;_0xbde12a=0xc8;}else{_0xbde12a=0xce;}_0x4e98f7[_0x7bdb('0x16')](_0xbde12a);return _0x4e98f7[_0x7bdb('0x1a')](_0x7bdb('0x1b'),_0x25d417+'-'+_0x31c909+'/'+_0xe9919f)['json'](_0x195b2e);}return null;};}function patchUpdates(_0x41f540){return function(_0x23e9eb){try{jsonpatch['apply'](_0x23e9eb,_0x41f540,!![]);}catch(_0x3e5f8e){return BPromise[_0x7bdb('0x1c')](_0x3e5f8e);}return _0x23e9eb[_0x7bdb('0x1d')]();};}function saveUpdates(_0x45d552,_0x112793){return function(_0x5bfc35){if(_0x5bfc35){return _0x5bfc35['update'](_0x45d552)[_0x7bdb('0x1e')](function(_0xcb25f2){return _0xcb25f2;});}return null;};}function removeEntity(_0x5daea4,_0x341fe4){return function(_0x118ea1){if(_0x118ea1){return _0x118ea1[_0x7bdb('0x1f')]()[_0x7bdb('0x1e')](function(){_0x5daea4[_0x7bdb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d37ac,_0xdad53d){return function(_0x40c447){if(!_0x40c447){_0x1d37ac[_0x7bdb('0x20')](0x194);}return _0x40c447;};}function handleError(_0x481f4b,_0x4d6e44){_0x4d6e44=_0x4d6e44||0x1f4;return function(_0x3c423f){logger['error'](_0x3c423f['stack']);if(_0x3c423f['name']){delete _0x3c423f[_0x7bdb('0x21')];}_0x481f4b['status'](_0x4d6e44)[_0x7bdb('0x22')](_0x3c423f);};}exports[_0x7bdb('0x23')]=function(_0x3ec129,_0x7c09cf){var _0x2a494e={},_0x523869={},_0x10e818={'count':0x0,'rows':[]};var _0x32242d=db[_0x7bdb('0x24')][_0x7bdb('0x25')];_0x523869[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](_0x32242d);_0x523869[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x3ec129[_0x7bdb('0x28')]);_0x523869[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],_0x523869['query']);_0x2a494e[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],qs[_0x7bdb('0x2c')](_0x3ec129[_0x7bdb('0x28')]['fields']));_0x2a494e[_0x7bdb('0x2b')]=_0x2a494e[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2a494e[_0x7bdb('0x2b')]:_0x523869['model'];if(!_0x3ec129['query']['hasOwnProperty'](_0x7bdb('0x2e'))){_0x2a494e['limit']=qs[_0x7bdb('0x19')](_0x3ec129['query'][_0x7bdb('0x19')]);_0x2a494e[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x3ec129['query'][_0x7bdb('0x18')]);}_0x2a494e['order']=qs['sort'](_0x3ec129[_0x7bdb('0x28')]['sort']);_0x2a494e[_0x7bdb('0x2f')]=qs['filters'](_['pick'](_0x3ec129[_0x7bdb('0x28')],_0x523869[_0x7bdb('0x29')]));if(_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]){_0x2a494e[_0x7bdb('0x2f')]=_[_0x7bdb('0x31')](_0x2a494e['where'],{'$or':_[_0x7bdb('0x32')](_0x32242d,function(_0x464fde){if(_0x464fde[_0x7bdb('0x33')][_0x7bdb('0x34')]!==_0x7bdb('0x35')){var _0x14c522={};_0x14c522[_0x464fde[_0x7bdb('0x36')]]={'$like':'%'+_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]+'%'};return _0x14c522;}})});}_0x2a494e=_['merge']({},_0x2a494e,_0x3ec129['options']);var _0x19c237={'where':_0x2a494e[_0x7bdb('0x2f')]};return db[_0x7bdb('0x24')][_0x7bdb('0x17')](_0x19c237)[_0x7bdb('0x1e')](function(_0x509e90){_0x10e818['count']=_0x509e90;if(_0x3ec129[_0x7bdb('0x28')]['includeAll']){_0x2a494e[_0x7bdb('0x37')]=[{'all':!![]}];}return db['SAAsset'][_0x7bdb('0x38')](_0x2a494e);})['then'](function(_0x4cf3fa){_0x10e818[_0x7bdb('0x39')]=_0x4cf3fa;return _0x10e818;})[_0x7bdb('0x1e')](respondWithFilteredResult(_0x7c09cf,_0x2a494e))[_0x7bdb('0x3a')](handleError(_0x7c09cf,null));};exports[_0x7bdb('0x3b')]=function(_0x43c7d3,_0x2b4829){var _0x2e10f3={'raw':![],'where':{'id':_0x43c7d3['params']['id']}},_0x501aff={};_0x501aff[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](db[_0x7bdb('0x24')][_0x7bdb('0x25')]);_0x501aff[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x43c7d3[_0x7bdb('0x28')]);_0x501aff['filters']=_['intersection'](_0x501aff[_0x7bdb('0x26')],_0x501aff[_0x7bdb('0x28')]);_0x2e10f3[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x501aff['model'],qs[_0x7bdb('0x2c')](_0x43c7d3['query'][_0x7bdb('0x2c')]));_0x2e10f3[_0x7bdb('0x2b')]=_0x2e10f3[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2e10f3[_0x7bdb('0x2b')]:_0x501aff[_0x7bdb('0x26')];if(_0x43c7d3[_0x7bdb('0x28')][_0x7bdb('0x3c')]){_0x2e10f3[_0x7bdb('0x37')]=[{'all':!![]}];}_0x2e10f3=_['merge']({},_0x2e10f3,_0x43c7d3[_0x7bdb('0x3d')]);return db[_0x7bdb('0x24')]['find'](_0x2e10f3)[_0x7bdb('0x1e')](handleEntityNotFound(_0x2b4829,null))['then'](respondWithResult(_0x2b4829,null))[_0x7bdb('0x3a')](handleError(_0x2b4829,null));};exports[_0x7bdb('0x3e')]=function(_0x122beb,_0x3a8415){return db[_0x7bdb('0x24')]['create'](_0x122beb[_0x7bdb('0x3f')],{})[_0x7bdb('0x1e')](respondWithResult(_0x3a8415,0xc9))[_0x7bdb('0x3a')](handleError(_0x3a8415,null));};exports[_0x7bdb('0x40')]=function(_0x31244f,_0x5021cd){if(_0x31244f[_0x7bdb('0x3f')]['id']){delete _0x31244f[_0x7bdb('0x3f')]['id'];}return db[_0x7bdb('0x24')][_0x7bdb('0x41')]({'where':{'id':_0x31244f[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x1e')](handleEntityNotFound(_0x5021cd,null))[_0x7bdb('0x1e')](saveUpdates(_0x31244f[_0x7bdb('0x3f')],null))[_0x7bdb('0x1e')](respondWithResult(_0x5021cd,null))[_0x7bdb('0x3a')](handleError(_0x5021cd,null));};exports['destroy']=function(_0x189cf8,_0x58c4bc){return db['SAAsset'][_0x7bdb('0x41')]({'where':{'id':_0x189cf8[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x58c4bc,null))[_0x7bdb('0x1e')](removeEntity(_0x58c4bc,null))[_0x7bdb('0x3a')](handleError(_0x58c4bc,null));};exports['describe']=function(_0x54ac12,_0x4edd0d){return db[_0x7bdb('0x24')][_0x7bdb('0x43')]()[_0x7bdb('0x1e')](respondWithResult(_0x4edd0d,null))[_0x7bdb('0x3a')](handleError(_0x4edd0d,null));};exports[_0x7bdb('0x44')]=function(_0x24b7b8,_0x28b5e5){var _0x2cae2e=qs[_0x7bdb('0x45')](_0x24b7b8[_0x7bdb('0x28')]['sort']);if(!_0x24b7b8[_0x7bdb('0x28')]['hasOwnProperty'](_0x7bdb('0x2e'))){var _0x27358d=qs[_0x7bdb('0x19')](_0x24b7b8[_0x7bdb('0x28')]['limit']);var _0x258f29=qs['offset'](_0x24b7b8['query'][_0x7bdb('0x18')]);}return db[_0x7bdb('0x24')]['findAll']({'attributes':[db['sequelize']['literal'](_0x7bdb('0x46'))],'group':['companyName','companyId',_0x7bdb('0x47'),_0x7bdb('0x48'),_0x7bdb('0x49'),_0x7bdb('0x4a'),'dateNextInvoice'],'order':_0x2cae2e,'limit':_0x27358d,'offset':_0x258f29,'raw':!![]})[_0x7bdb('0x1e')](function(_0x4c5c8c){return{'count':_0x4c5c8c[_0x7bdb('0x2d')],'rows':_0x4c5c8c};})[_0x7bdb('0x1e')](handleEntityNotFound(_0x28b5e5,null))[_0x7bdb('0x1e')](respondWithResult(_0x28b5e5,null))[_0x7bdb('0x3a')](handleError(_0x28b5e5,null));};exports[_0x7bdb('0x4b')]=function(_0x9beb5c,_0x52d90e,_0x40d3b5){var _0x3022ee;if(_0x9beb5c[_0x7bdb('0x3f')]['id']){delete _0x9beb5c['body']['id'];}return db[_0x7bdb('0x4c')][_0x7bdb('0x4d')](function(_0x4d813f){return db[_0x7bdb('0x4e')]['findOne']({'where':{'defaultEntry':0x1},'raw':!![]})[_0x7bdb('0x1e')](function(_0xc3a0cb){_0x3022ee=_0xc3a0cb;return db['SAAsset']['findAll']({'where':{'dateLastInvoice':null,'deleted':null},'order':[[_0x7bdb('0x4f'),_0x7bdb('0x50')],['pricelistId',_0x7bdb('0x50')],['subscriptionId',_0x7bdb('0x50')]],'raw':!![]});})['then'](function(_0x496cc3){if(_0x496cc3[_0x7bdb('0x2d')]>0x0){var _0x2d4b59=[];var _0x19bb3f=_[_0x7bdb('0x51')](_0x496cc3,_0x7bdb('0x4f'));Object[_0x7bdb('0x27')](_0x19bb3f)[_0x7bdb('0x52')](function(_0x8cf13a){var _0x3aac96=_0x19bb3f[_0x8cf13a];console[_0x7bdb('0x53')](_0x7bdb('0x54'),_0x3aac96);_0x2d4b59[_0x7bdb('0x55')](addSubscriptionInvoice(_0x3aac96,_0x3022ee,_0x8cf13a,'Partial',_0x4d813f));});return BPromise[_0x7bdb('0x56')](_0x2d4b59);}else{var _0x2d6234={'errors':[{'type':'INFO','message':_0x7bdb('0x57')}]};throw _0x2d6234;}});})[_0x7bdb('0x1e')](function(){return _0x52d90e[_0x7bdb('0x20')](0xc8);})[_0x7bdb('0x3a')](function(_0x85c7b8){console['log'](_0x7bdb('0x58'),_0x85c7b8);if(_0x85c7b8[_0x7bdb('0x21')]===_0x7bdb('0x59')){var _0x85c7b8={'errors':[{'message':_0x7bdb('0x5a')}]};}_0x52d90e[_0x7bdb('0x16')](0x1f4)[_0x7bdb('0x22')](_0x85c7b8);});};function updSubscriptionDetail(_0x11ec61,_0x30d069,_0x364385){console[_0x7bdb('0x53')](_0x7bdb('0x5b'),_0x11ec61);console[_0x7bdb('0x53')]('??????\x20invoiceType',_0x30d069);console[_0x7bdb('0x53')](_0x7bdb('0x5c'),_0x11ec61['id']);console[_0x7bdb('0x53')](_0x7bdb('0x5d'),_0x11ec61[_0x7bdb('0x5e')]);var _0xc83f14;var _0x22aa65;if(_0x30d069===_0x7bdb('0x5f')){_0xc83f14=moment();_0x22aa65=_0x11ec61[_0x7bdb('0x5e')];}else{_0xc83f14=_0x11ec61[_0x7bdb('0x5e')];_0x22aa65=moment(_0x11ec61[_0x7bdb('0x5e')])[_0x7bdb('0x60')](_0x11ec61[_0x7bdb('0x61')],'months');}console[_0x7bdb('0x53')]('lastInvoice',_0xc83f14);console[_0x7bdb('0x53')](_0x7bdb('0x62'),_0x22aa65);return db[_0x7bdb('0x24')]['update']({'dateLastInvoice':_0xc83f14,'dateNextInvoice':_0x22aa65,'agentFullname':_0x7bdb('0x63')},{'where':{'id':_0x11ec61['id']},'raw':!![],'transaction':_0x364385})[_0x7bdb('0x3a')](function(_0x4ebc9f){throw _0x4ebc9f;});}function addSubscriptionInvoiceDetail(_0x3b4736,_0x1f9024,_0x5b3105){var _0x1c4525={'companyName':_0x3b4736[_0x7bdb('0x64')],'companyId':_0x3b4736['companyId'],'productName':_0x3b4736[_0x7bdb('0x65')],'productCode':_0x3b4736[_0x7bdb('0x66')],'productDescription':_0x3b4736['productDescription'],'typeName':_0x3b4736[_0x7bdb('0x67')],'pricelistName':_0x3b4736[_0x7bdb('0x47')],'priceListId':_0x3b4736['pricelistId'],'netPrice':_0x3b4736[_0x7bdb('0x68')],'discount':_0x3b4736['discount'],'tax':_0x3b4736[_0x7bdb('0x69')],'agentFullname':_0x7bdb('0x63'),'note':_0x3b4736[_0x7bdb('0x6a')],'subscriptionId':_0x3b4736[_0x7bdb('0x4a')],'subscriptionName':_0x3b4736[_0x7bdb('0x49')],'subscriptionMonthly':_0x3b4736['subscriptionMonthly'],'quantity':_0x3b4736['quantity'],'InvoiceId':_0x1f9024['id']};return db['SAInvoiceDetail'][_0x7bdb('0x3e')](_0x1c4525,{'raw':!![],'transaction':_0x5b3105})['catch'](function(_0x242a35){throw _0x242a35;});}function addSubscriptionInvoice(_0x1a1979,_0x139f4e,_0x57d36d,_0x509531,_0x26cde0){return db[_0x7bdb('0x4e')][_0x7bdb('0x6b')]({'where':{'id':_0x57d36d},'raw':!![]})[_0x7bdb('0x1e')](function(_0x572cbe){return db[_0x7bdb('0x6c')][_0x7bdb('0x6b')]({'where':{'id':_0x572cbe[_0x7bdb('0x6d')]},'raw':!![]})[_0x7bdb('0x1e')](function(_0x48ee68){var _0x381326={'name':'Invoice\x20'+moment()+'_'+_0x509531,'note':_0x7bdb('0x6e'),'agentFullname':'System','status':_0x7bdb('0x6f'),'companyName':_0x572cbe['name'],'companyId':_0x572cbe['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x572cbe[_0x7bdb('0x70')],'receivingPostalCode':_0x572cbe[_0x7bdb('0x71')],'receivingCity':_0x572cbe[_0x7bdb('0x72')],'receivingCountry':_0x572cbe[_0x7bdb('0x73')],'receivingISOCode':_0x572cbe[_0x7bdb('0x74')],'receivingFiscalCode':_0x572cbe['saFiscalCode'],'receivingPIVA':_0x572cbe['saPIVA'],'receivingSDICode':_0x572cbe[_0x7bdb('0x75')],'receivingFiscalMessage':_0x572cbe[_0x7bdb('0x76')],'receivingExpiryDay':_0x572cbe['saExpiryDay'],'receivingEurope':_0x572cbe[_0x7bdb('0x77')],'receivingSocCap':_0x572cbe[_0x7bdb('0x78')],'issuerName':_0x139f4e['name'],'issuerStreet':_0x139f4e[_0x7bdb('0x70')],'issuerPostalCode':_0x139f4e[_0x7bdb('0x71')],'issuerCity':_0x139f4e['saCity'],'issuerCountry':_0x139f4e[_0x7bdb('0x73')],'issuerISOCode':_0x139f4e['saISOCode'],'issuerFiscalCode':_0x139f4e['saFiscalCode'],'issuerPIVA':_0x139f4e[_0x7bdb('0x79')],'issuerSDICode':_0x139f4e[_0x7bdb('0x75')],'issuerFiscalMessage':_0x139f4e['saFiscalMessage'],'issuerExpiryDay':_0x139f4e['saExpiryDay'],'issuerSocCap':_0x139f4e[_0x7bdb('0x78')],'issuerBankAccount':_0x48ee68['bankAccount'],'issuerBankName':_0x48ee68[_0x7bdb('0x7a')],'issuerBankStreet':_0x48ee68['bankstreet'],'issuerBankPostalCode':_0x48ee68[_0x7bdb('0x7b')],'issuerBankCity':_0x48ee68[_0x7bdb('0x7c')],'issuerBankCountry':_0x48ee68[_0x7bdb('0x7d')],'issuerBankBICSWIFT':_0x48ee68[_0x7bdb('0x7e')],'issuerBankIBAN':_0x48ee68['bankIBAN'],'issuerPhone':_0x139f4e[_0x7bdb('0x7f')],'issuerFax':_0x139f4e[_0x7bdb('0x80')],'issuerEmail':_0x139f4e['email'],'issuerWeb':_0x139f4e[_0x7bdb('0x81')],'issuerABI':_0x48ee68[_0x7bdb('0x82')],'issuerCAB':_0x48ee68['banckCAB'],'issuerPayPal':_0x48ee68[_0x7bdb('0x83')]};return db[_0x7bdb('0x84')][_0x7bdb('0x3e')](_0x381326,{'transaction':_0x26cde0})[_0x7bdb('0x1e')](function(_0x521d68){var _0x324285=[];for(var _0x5af736=0x0;_0x5af736<_0x1a1979[_0x7bdb('0x2d')];_0x5af736++){_0x324285[_0x7bdb('0x55')](updSubscriptionDetail(_0x1a1979[_0x5af736],_0x509531,_0x26cde0));}var _0x3dd0b0=['productCode',_0x7bdb('0x48'),_0x7bdb('0x4a'),_0x7bdb('0x68')];_(_0x1a1979)[_0x7bdb('0x51')](function(_0xc444ef){return _[_0x7bdb('0x41')](_[_0x7bdb('0x85')](_0xc444ef,_0x3dd0b0),_[_0x7bdb('0x86')](_[_0x7bdb('0x87')]));})[_0x7bdb('0x88')](function(_0x3cacbf){var _0x3b2731=_0x3cacbf[0x0];_0x3b2731[_0x7bdb('0x89')]=_0x3cacbf[_0x7bdb('0x2d')];if(_0x509531===_0x7bdb('0x5f')){_0x3b2731[_0x7bdb('0x68')]=computePrice(_0x3b2731[_0x7bdb('0x8a')],_0x3b2731[_0x7bdb('0x5e')],_0x3b2731['netPrice'],_0x3b2731[_0x7bdb('0x61')]);}_0x324285[_0x7bdb('0x55')](addSubscriptionInvoiceDetail(_0x3b2731,_0x521d68,_0x26cde0));})[_0x7bdb('0x8b')]();return BPromise[_0x7bdb('0x56')](_0x324285);});});})[_0x7bdb('0x3a')](function(_0x7a0b00){console[_0x7bdb('0x53')](_0x7bdb('0x58'),_0x7a0b00);throw _0x7a0b00;});}function computePrice(_0x209585,_0x472026,_0x1c09dc,_0x4fbf29){var _0x51a50d=_0x1c09dc;console['log'](_0x7bdb('0x8a'),_0x209585);console[_0x7bdb('0x53')]('dateNextInvoice',_0x472026);console[_0x7bdb('0x53')](_0x7bdb('0x61'),_0x4fbf29);console['log']('netPrice',_0x1c09dc);if(_0x4fbf29!=0x0){var _0x5a98de=moment(_0x209585);var _0x338424=moment(_0x472026);var _0x53bcad=Math['abs'](_0x5a98de['diff'](_0x338424,_0x7bdb('0x8c')));console[_0x7bdb('0x53')](_0x7bdb('0x8d'),_0x53bcad);var _0x535a06=_0x1c09dc/(0x1e*_0x4fbf29);console[_0x7bdb('0x53')](_0x7bdb('0x8e'),_0x535a06);_0x51a50d=_0x535a06*_0x53bcad;}console[_0x7bdb('0x53')](_0x7bdb('0x8f'),_0x51a50d);return _0x51a50d;}exports['automaticSubscriptionInvoice']=function(_0x11f759,_0x4dddbf,_0x21ff92){var _0x1bb65a;if(_0x11f759[_0x7bdb('0x3f')]['id']){delete _0x11f759['body']['id'];}return db[_0x7bdb('0x4c')][_0x7bdb('0x4d')](function(_0x341a54){return db['CmCompany'][_0x7bdb('0x6b')]({'where':{'defaultEntry':0x1},'raw':!![]})[_0x7bdb('0x1e')](function(_0x58d401){_0x1bb65a=_0x58d401;return db[_0x7bdb('0x24')][_0x7bdb('0x38')]({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[['companyId',_0x7bdb('0x50')],[_0x7bdb('0x48'),_0x7bdb('0x50')],[_0x7bdb('0x4a'),_0x7bdb('0x50')]],'raw':!![]});})['then'](function(_0x3f3336){console['log'](_0x7bdb('0x90'),_0x3f3336);if(_0x3f3336[_0x7bdb('0x2d')]>0x0){var _0x190319=[];var _0x4b7730=_[_0x7bdb('0x51')](_0x3f3336,'companyId');Object[_0x7bdb('0x27')](_0x4b7730)['forEach'](function(_0x2e28ec){var _0x2620d1=_0x4b7730[_0x2e28ec];console[_0x7bdb('0x53')](_0x7bdb('0x54'),_0x2620d1);_0x190319[_0x7bdb('0x55')](addSubscriptionInvoice(_0x2620d1,_0x1bb65a,_0x2e28ec,'Total',_0x341a54));});return BPromise['all'](_0x190319);}else{var _0x3370ae={'errors':[{'type':_0x7bdb('0x91'),'message':_0x7bdb('0x92')}]};throw _0x3370ae;}});})[_0x7bdb('0x1e')](function(){return _0x4dddbf['sendStatus'](0xc8);})[_0x7bdb('0x3a')](function(_0x4f0d1f){console['log'](_0x7bdb('0x58'),_0x4f0d1f);if(_0x4f0d1f[_0x7bdb('0x21')]==='SequelizeUniqueConstraintError'){var _0x4f0d1f={'errors':[{'message':_0x7bdb('0x5a')}]};}_0x4dddbf[_0x7bdb('0x16')](0x1f4)[_0x7bdb('0x22')](_0x4f0d1f);});}; \ No newline at end of file +var _0xaa88=['££££££££\x20products','Total','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','Duplicate\x20entry.','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','apply','reject','save','update','then','error','name','send','index','SAAsset','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','describe','getSubscriptions','sequelize','companyName','companyId','pricelistName','pricelistId','dateNextInvoice','CmCompany','DESC','forEach','automaticSubscriptionInvoice\x20productForCompany->','push','Partial','all','INFO','No\x20invoice.\x20Invoice\x20expired!!\x20','log','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','??????\x20updSubscriptionDetail\x20product->','??????\x20invoiceType','??????\x20updSubscriptionDetail\x20product.id->','??????\x20updSubscriptionDetail\x20product.dateNextInvoice->','subscriptionMonthly','months','lastInvoice','nextInvoice','System','productCode','productDescription','typeName','netPrice','discount','note','subscriptionId','subscriptionName','SAInvoiceDetail','findOne','SAPaymentMethod','saPaymentMethod','Automatic\x20Job','close','saStreet','saCity','saCountry','saISOCode','saFiscalCode','saPIVA','saExpiryDay','saEurope','saSocCap','saPostalCode','bankName','bankstreet','bankpostalCode','bankIBAN','phone','fax','email','bankABI','banckCAB','paypalEmail','SAInvoice','groupBy','mapValues','createdAt','value','abs','diff','days','diffDay','dayPrice','automaticSubscriptionInvoice'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xaa88,0x137));var _0x8aa8=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xaa88[_0xf89c3];return _0x274fc8;};'use strict';var pdf=require(_0x8aa8('0x0'));var emlformat=require(_0x8aa8('0x1'));var rimraf=require(_0x8aa8('0x2'));var zipdir=require(_0x8aa8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8aa8('0x4'));var moment=require(_0x8aa8('0x5'));var BPromise=require(_0x8aa8('0x6'));var Mustache=require(_0x8aa8('0x7'));var util=require(_0x8aa8('0x8'));var path=require(_0x8aa8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8aa8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var hardwareService=require(_0x8aa8('0x13'));var logger=require(_0x8aa8('0x14'))(_0x8aa8('0x15'));var utils=require('../../config/utils');var config=require(_0x8aa8('0x16'));var db=require(_0x8aa8('0x17'))['db'];function respondWithStatusCode(_0x50787d,_0x370b25){_0x370b25=_0x370b25||0xcc;return function(_0xa691d6){if(_0xa691d6){return _0x50787d[_0x8aa8('0x18')](_0x370b25);}return _0x50787d['status'](_0x370b25)[_0x8aa8('0x19')]();};}function respondWithResult(_0x179e33,_0x2fa66f){_0x2fa66f=_0x2fa66f||0xc8;return function(_0x4b686e){if(_0x4b686e){return _0x179e33[_0x8aa8('0x1a')](_0x2fa66f)['json'](_0x4b686e);}};}function respondWithFilteredResult(_0x4f3a2e,_0x433e95){return function(_0x200662){if(_0x200662){var _0xae81a0=_0x200662[_0x8aa8('0x1b')],_0xa6c2af=_0x433e95[_0x8aa8('0x1c')],_0x42a6a4=_0x433e95[_0x8aa8('0x1c')]+_0x433e95['limit'],_0x3778f4;if(_0x42a6a4>=_0xae81a0){_0x42a6a4=_0xae81a0;_0x3778f4=0xc8;}else{_0x3778f4=0xce;}_0x4f3a2e['status'](_0x3778f4);return _0x4f3a2e[_0x8aa8('0x1d')]('Content-Range',_0xa6c2af+'-'+_0x42a6a4+'/'+_0xae81a0)['json'](_0x200662);}return null;};}function patchUpdates(_0xab7af5){return function(_0x5ac0d9){try{jsonpatch[_0x8aa8('0x1e')](_0x5ac0d9,_0xab7af5,!![]);}catch(_0x41092b){return BPromise[_0x8aa8('0x1f')](_0x41092b);}return _0x5ac0d9[_0x8aa8('0x20')]();};}function saveUpdates(_0x502547,_0xcc2c19){return function(_0x36c445){if(_0x36c445){return _0x36c445[_0x8aa8('0x21')](_0x502547)[_0x8aa8('0x22')](function(_0x4c754e){return _0x4c754e;});}return null;};}function removeEntity(_0x34f1b7,_0x5d9b62){return function(_0x26cf63){if(_0x26cf63){return _0x26cf63['destroy']()[_0x8aa8('0x22')](function(){_0x34f1b7['status'](0xcc)[_0x8aa8('0x19')]();});}};}function handleEntityNotFound(_0x557e4e,_0x65945b){return function(_0x40adb5){if(!_0x40adb5){_0x557e4e[_0x8aa8('0x18')](0x194);}return _0x40adb5;};}function handleError(_0x5e5d91,_0x24f428){_0x24f428=_0x24f428||0x1f4;return function(_0xe978ab){logger[_0x8aa8('0x23')](_0xe978ab['stack']);if(_0xe978ab['name']){delete _0xe978ab[_0x8aa8('0x24')];}_0x5e5d91[_0x8aa8('0x1a')](_0x24f428)[_0x8aa8('0x25')](_0xe978ab);};}exports[_0x8aa8('0x26')]=function(_0x24143e,_0x4a8212){var _0x2bc34a={},_0x49d561={},_0x2a0ff2={'count':0x0,'rows':[]};var _0xe7768=db[_0x8aa8('0x27')]['rawAttributes'];_0x49d561['model']=_[_0x8aa8('0x28')](_0xe7768);_0x49d561['query']=_[_0x8aa8('0x28')](_0x24143e[_0x8aa8('0x29')]);_0x49d561[_0x8aa8('0x2a')]=_[_0x8aa8('0x2b')](_0x49d561[_0x8aa8('0x2c')],_0x49d561['query']);_0x2bc34a[_0x8aa8('0x2d')]=_[_0x8aa8('0x2b')](_0x49d561['model'],qs[_0x8aa8('0x2e')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x2e')]));_0x2bc34a['attributes']=_0x2bc34a[_0x8aa8('0x2d')][_0x8aa8('0x2f')]?_0x2bc34a[_0x8aa8('0x2d')]:_0x49d561[_0x8aa8('0x2c')];if(!_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x30')](_0x8aa8('0x31'))){_0x2bc34a[_0x8aa8('0x32')]=qs[_0x8aa8('0x32')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x32')]);_0x2bc34a['offset']=qs['offset'](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x1c')]);}_0x2bc34a[_0x8aa8('0x33')]=qs[_0x8aa8('0x34')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x34')]);_0x2bc34a['where']=qs['filters'](_[_0x8aa8('0x35')](_0x24143e['query'],_0x49d561[_0x8aa8('0x2a')]));if(_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x36')]){_0x2bc34a['where']=_[_0x8aa8('0x37')](_0x2bc34a[_0x8aa8('0x38')],{'$or':_[_0x8aa8('0x39')](_0xe7768,function(_0x5c28fa){if(_0x5c28fa['type'][_0x8aa8('0x3a')]!==_0x8aa8('0x3b')){var _0x52f87d={};_0x52f87d[_0x5c28fa[_0x8aa8('0x3c')]]={'$like':'%'+_0x24143e[_0x8aa8('0x29')]['filter']+'%'};return _0x52f87d;}})});}_0x2bc34a=_[_0x8aa8('0x37')]({},_0x2bc34a,_0x24143e['options']);var _0x530a66={'where':_0x2bc34a[_0x8aa8('0x38')]};return db['SAAsset'][_0x8aa8('0x1b')](_0x530a66)[_0x8aa8('0x22')](function(_0x926ff2){_0x2a0ff2[_0x8aa8('0x1b')]=_0x926ff2;if(_0x24143e['query'][_0x8aa8('0x3d')]){_0x2bc34a[_0x8aa8('0x3e')]=[{'all':!![]}];}return db['SAAsset'][_0x8aa8('0x3f')](_0x2bc34a);})[_0x8aa8('0x22')](function(_0x5ea57a){_0x2a0ff2[_0x8aa8('0x40')]=_0x5ea57a;return _0x2a0ff2;})[_0x8aa8('0x22')](respondWithFilteredResult(_0x4a8212,_0x2bc34a))[_0x8aa8('0x41')](handleError(_0x4a8212,null));};exports[_0x8aa8('0x42')]=function(_0x189d53,_0xea42cb){var _0x46711b={'raw':![],'where':{'id':_0x189d53[_0x8aa8('0x43')]['id']}},_0x3fb265={};_0x3fb265[_0x8aa8('0x2c')]=_[_0x8aa8('0x28')](db[_0x8aa8('0x27')][_0x8aa8('0x44')]);_0x3fb265[_0x8aa8('0x29')]=_[_0x8aa8('0x28')](_0x189d53[_0x8aa8('0x29')]);_0x3fb265['filters']=_[_0x8aa8('0x2b')](_0x3fb265['model'],_0x3fb265['query']);_0x46711b['attributes']=_[_0x8aa8('0x2b')](_0x3fb265['model'],qs['fields'](_0x189d53[_0x8aa8('0x29')]['fields']));_0x46711b[_0x8aa8('0x2d')]=_0x46711b['attributes']['length']?_0x46711b[_0x8aa8('0x2d')]:_0x3fb265[_0x8aa8('0x2c')];if(_0x189d53[_0x8aa8('0x29')][_0x8aa8('0x3d')]){_0x46711b[_0x8aa8('0x3e')]=[{'all':!![]}];}_0x46711b=_[_0x8aa8('0x37')]({},_0x46711b,_0x189d53[_0x8aa8('0x45')]);return db['SAAsset'][_0x8aa8('0x46')](_0x46711b)['then'](handleEntityNotFound(_0xea42cb,null))[_0x8aa8('0x22')](respondWithResult(_0xea42cb,null))[_0x8aa8('0x41')](handleError(_0xea42cb,null));};exports[_0x8aa8('0x47')]=function(_0x2bc6d3,_0x2a0a14){return db[_0x8aa8('0x27')]['create'](_0x2bc6d3['body'],{})[_0x8aa8('0x22')](respondWithResult(_0x2a0a14,0xc9))[_0x8aa8('0x41')](handleError(_0x2a0a14,null));};exports['update']=function(_0x35eeea,_0x25906d){if(_0x35eeea[_0x8aa8('0x48')]['id']){delete _0x35eeea['body']['id'];}return db['SAAsset']['find']({'where':{'id':_0x35eeea['params']['id']}})[_0x8aa8('0x22')](handleEntityNotFound(_0x25906d,null))[_0x8aa8('0x22')](saveUpdates(_0x35eeea['body'],null))[_0x8aa8('0x22')](respondWithResult(_0x25906d,null))[_0x8aa8('0x41')](handleError(_0x25906d,null));};exports[_0x8aa8('0x49')]=function(_0x1aa1b6,_0x20384a){return db[_0x8aa8('0x27')]['find']({'where':{'id':_0x1aa1b6['params']['id']}})[_0x8aa8('0x22')](handleEntityNotFound(_0x20384a,null))['then'](removeEntity(_0x20384a,null))[_0x8aa8('0x41')](handleError(_0x20384a,null));};exports['describe']=function(_0x1b4843,_0x263620){return db[_0x8aa8('0x27')][_0x8aa8('0x4a')]()[_0x8aa8('0x22')](respondWithResult(_0x263620,null))[_0x8aa8('0x41')](handleError(_0x263620,null));};exports[_0x8aa8('0x4b')]=function(_0x20831c,_0x35d36a){var _0x850854=qs[_0x8aa8('0x34')](_0x20831c[_0x8aa8('0x29')]['sort']);if(!_0x20831c[_0x8aa8('0x29')]['hasOwnProperty']('nolimit')){var _0x5e04d0=qs[_0x8aa8('0x32')](_0x20831c['query'][_0x8aa8('0x32')]);var _0x1474fd=qs[_0x8aa8('0x1c')](_0x20831c['query'][_0x8aa8('0x1c')]);}return db[_0x8aa8('0x27')][_0x8aa8('0x3f')]({'attributes':[db[_0x8aa8('0x4c')]['literal']('CONCAT\x20(`companyName`,\x22\x20\x22,`pricelistName`,\x22\x20\x22,`subscriptionName`)\x20as\x20SubscriptionName,DATEDIFF\x20(`dateNextInvoice`,NOW())\x20as\x20Expired,`subscriptionId`,`companyName`,`companyId`,`pricelistName`,`pricelistId`,`subscriptionName`,`dateNextInvoice`,SUM(`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20as\x20TotalNetPrice,SUM((`netPrice`\x20-\x20(`netPrice`\x20/\x20100\x20*\x20`discount`))\x20/\x20100\x20*\x20`tax`)\x20as\x20TotalTax')],'group':[_0x8aa8('0x4d'),_0x8aa8('0x4e'),_0x8aa8('0x4f'),_0x8aa8('0x50'),'subscriptionName','subscriptionId',_0x8aa8('0x51')],'order':_0x850854,'limit':_0x5e04d0,'offset':_0x1474fd,'raw':!![]})[_0x8aa8('0x22')](function(_0x26eb56){return{'count':_0x26eb56['length'],'rows':_0x26eb56};})[_0x8aa8('0x22')](handleEntityNotFound(_0x35d36a,null))[_0x8aa8('0x22')](respondWithResult(_0x35d36a,null))['catch'](handleError(_0x35d36a,null));};exports['automaticSubscriptionInvoiceAlignment']=function(_0x4b6fd7,_0x55e186,_0x392d78){var _0x4ab098;if(_0x4b6fd7[_0x8aa8('0x48')]['id']){delete _0x4b6fd7[_0x8aa8('0x48')]['id'];}return db['sequelize']['transaction'](function(_0x2725c5){return db[_0x8aa8('0x52')]['findOne']({'where':{'defaultEntry':0x1},'raw':!![]})['then'](function(_0x4da935){_0x4ab098=_0x4da935;return db[_0x8aa8('0x27')][_0x8aa8('0x3f')]({'where':{'dateLastInvoice':null,'deleted':null},'order':[['companyId','DESC'],[_0x8aa8('0x50'),_0x8aa8('0x53')],['subscriptionId',_0x8aa8('0x53')]],'raw':!![]});})[_0x8aa8('0x22')](function(_0x572e88){if(_0x572e88[_0x8aa8('0x2f')]>0x0){var _0x5dddbb=[];var _0x29dfb3=_['groupBy'](_0x572e88,_0x8aa8('0x4e'));Object[_0x8aa8('0x28')](_0x29dfb3)[_0x8aa8('0x54')](function(_0x417a34){var _0x44e267=_0x29dfb3[_0x417a34];console['log'](_0x8aa8('0x55'),_0x44e267);_0x5dddbb[_0x8aa8('0x56')](addSubscriptionInvoice(_0x44e267,_0x4ab098,_0x417a34,_0x8aa8('0x57'),_0x2725c5));});return BPromise[_0x8aa8('0x58')](_0x5dddbb);}else{var _0x4a53eb={'errors':[{'type':_0x8aa8('0x59'),'message':_0x8aa8('0x5a')}]};throw _0x4a53eb;}});})['then'](function(){return _0x55e186[_0x8aa8('0x18')](0xc8);})[_0x8aa8('0x41')](function(_0x2d322a){console[_0x8aa8('0x5b')](_0x8aa8('0x5c'),_0x2d322a);if(_0x2d322a[_0x8aa8('0x24')]===_0x8aa8('0x5d')){var _0x2d322a={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x55e186['status'](0x1f4)[_0x8aa8('0x25')](_0x2d322a);});};function updSubscriptionDetail(_0x3396fe,_0x3b7b2f,_0x1dca39){console[_0x8aa8('0x5b')](_0x8aa8('0x5e'),_0x3396fe);console[_0x8aa8('0x5b')](_0x8aa8('0x5f'),_0x3b7b2f);console[_0x8aa8('0x5b')](_0x8aa8('0x60'),_0x3396fe['id']);console[_0x8aa8('0x5b')](_0x8aa8('0x61'),_0x3396fe[_0x8aa8('0x51')]);var _0x26572c;var _0x3e80ac;if(_0x3b7b2f===_0x8aa8('0x57')){_0x26572c=moment();_0x3e80ac=_0x3396fe[_0x8aa8('0x51')];}else{_0x26572c=_0x3396fe[_0x8aa8('0x51')];_0x3e80ac=moment(_0x3396fe[_0x8aa8('0x51')])['add'](_0x3396fe[_0x8aa8('0x62')],_0x8aa8('0x63'));}console[_0x8aa8('0x5b')](_0x8aa8('0x64'),_0x26572c);console[_0x8aa8('0x5b')](_0x8aa8('0x65'),_0x3e80ac);return db[_0x8aa8('0x27')][_0x8aa8('0x21')]({'dateLastInvoice':_0x26572c,'dateNextInvoice':_0x3e80ac,'agentFullname':_0x8aa8('0x66')},{'where':{'id':_0x3396fe['id']},'raw':!![],'transaction':_0x1dca39})['catch'](function(_0x2e4dd2){throw _0x2e4dd2;});}function addSubscriptionInvoiceDetail(_0x3d2c0e,_0x4f29ca,_0x41da42){var _0x5d72d0={'companyName':_0x3d2c0e[_0x8aa8('0x4d')],'companyId':_0x3d2c0e[_0x8aa8('0x4e')],'productName':_0x3d2c0e['productName'],'productCode':_0x3d2c0e[_0x8aa8('0x67')],'productDescription':_0x3d2c0e[_0x8aa8('0x68')],'typeName':_0x3d2c0e[_0x8aa8('0x69')],'pricelistName':_0x3d2c0e[_0x8aa8('0x4f')],'priceListId':_0x3d2c0e[_0x8aa8('0x50')],'netPrice':_0x3d2c0e[_0x8aa8('0x6a')],'discount':_0x3d2c0e[_0x8aa8('0x6b')],'tax':_0x3d2c0e['tax'],'agentFullname':_0x8aa8('0x66'),'note':_0x3d2c0e[_0x8aa8('0x6c')],'subscriptionId':_0x3d2c0e[_0x8aa8('0x6d')],'subscriptionName':_0x3d2c0e[_0x8aa8('0x6e')],'subscriptionMonthly':_0x3d2c0e['subscriptionMonthly'],'quantity':_0x3d2c0e['quantity'],'InvoiceId':_0x4f29ca['id']};return db[_0x8aa8('0x6f')][_0x8aa8('0x47')](_0x5d72d0,{'raw':!![],'transaction':_0x41da42})[_0x8aa8('0x41')](function(_0x39505e){throw _0x39505e;});}function addSubscriptionInvoice(_0x486e83,_0x59e7d3,_0x5c3b1f,_0x6a6275,_0x3719b7){return db[_0x8aa8('0x52')][_0x8aa8('0x70')]({'where':{'id':_0x5c3b1f},'raw':!![]})[_0x8aa8('0x22')](function(_0x1417a1){return db[_0x8aa8('0x71')][_0x8aa8('0x70')]({'where':{'id':_0x1417a1[_0x8aa8('0x72')]},'raw':!![]})['then'](function(_0x3ce130){var _0x5c90b3={'name':'Invoice\x20'+moment()+'_'+_0x6a6275,'note':_0x8aa8('0x73'),'agentFullname':_0x8aa8('0x66'),'status':_0x8aa8('0x74'),'companyName':_0x1417a1['name'],'companyId':_0x1417a1['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x1417a1[_0x8aa8('0x75')],'receivingPostalCode':_0x1417a1['saPostalCode'],'receivingCity':_0x1417a1[_0x8aa8('0x76')],'receivingCountry':_0x1417a1[_0x8aa8('0x77')],'receivingISOCode':_0x1417a1[_0x8aa8('0x78')],'receivingFiscalCode':_0x1417a1[_0x8aa8('0x79')],'receivingPIVA':_0x1417a1[_0x8aa8('0x7a')],'receivingSDICode':_0x1417a1['saSDICode'],'receivingFiscalMessage':_0x1417a1['saFiscalMessage'],'receivingExpiryDay':_0x1417a1[_0x8aa8('0x7b')],'receivingEurope':_0x1417a1[_0x8aa8('0x7c')],'receivingSocCap':_0x1417a1[_0x8aa8('0x7d')],'issuerName':_0x59e7d3[_0x8aa8('0x24')],'issuerStreet':_0x59e7d3[_0x8aa8('0x75')],'issuerPostalCode':_0x59e7d3[_0x8aa8('0x7e')],'issuerCity':_0x59e7d3[_0x8aa8('0x76')],'issuerCountry':_0x59e7d3[_0x8aa8('0x77')],'issuerISOCode':_0x59e7d3['saISOCode'],'issuerFiscalCode':_0x59e7d3[_0x8aa8('0x79')],'issuerPIVA':_0x59e7d3[_0x8aa8('0x7a')],'issuerSDICode':_0x59e7d3['saSDICode'],'issuerFiscalMessage':_0x59e7d3['saFiscalMessage'],'issuerExpiryDay':_0x59e7d3[_0x8aa8('0x7b')],'issuerSocCap':_0x59e7d3[_0x8aa8('0x7d')],'issuerBankAccount':_0x3ce130['bankAccount'],'issuerBankName':_0x3ce130[_0x8aa8('0x7f')],'issuerBankStreet':_0x3ce130[_0x8aa8('0x80')],'issuerBankPostalCode':_0x3ce130[_0x8aa8('0x81')],'issuerBankCity':_0x3ce130['bankcity'],'issuerBankCountry':_0x3ce130['bankcountry'],'issuerBankBICSWIFT':_0x3ce130['bankBICSWIFT'],'issuerBankIBAN':_0x3ce130[_0x8aa8('0x82')],'issuerPhone':_0x59e7d3[_0x8aa8('0x83')],'issuerFax':_0x59e7d3[_0x8aa8('0x84')],'issuerEmail':_0x59e7d3[_0x8aa8('0x85')],'issuerWeb':_0x59e7d3['website'],'issuerABI':_0x3ce130[_0x8aa8('0x86')],'issuerCAB':_0x3ce130[_0x8aa8('0x87')],'issuerPayPal':_0x3ce130[_0x8aa8('0x88')]};return db[_0x8aa8('0x89')]['create'](_0x5c90b3,{'transaction':_0x3719b7})[_0x8aa8('0x22')](function(_0x5714b7){var _0x54b94d=[];for(var _0x430bb1=0x0;_0x430bb1<_0x486e83['length'];_0x430bb1++){_0x54b94d[_0x8aa8('0x56')](updSubscriptionDetail(_0x486e83[_0x430bb1],_0x6a6275,_0x3719b7));}var _0x34a5a9=[_0x8aa8('0x67'),'pricelistId',_0x8aa8('0x6d'),_0x8aa8('0x6a')];_(_0x486e83)[_0x8aa8('0x8a')](function(_0x3926a8){return _[_0x8aa8('0x46')](_[_0x8aa8('0x35')](_0x3926a8,_0x34a5a9),_['negate'](_['isNull']));})[_0x8aa8('0x8b')](function(_0x4bd4ff){var _0x5e864a=_0x4bd4ff[0x0];_0x5e864a['quantity']=_0x4bd4ff['length'];if(_0x6a6275==='Partial'){_0x5e864a[_0x8aa8('0x6a')]=computePrice(_0x5e864a[_0x8aa8('0x8c')],_0x5e864a[_0x8aa8('0x51')],_0x5e864a[_0x8aa8('0x6a')],_0x5e864a[_0x8aa8('0x62')]);}_0x54b94d[_0x8aa8('0x56')](addSubscriptionInvoiceDetail(_0x5e864a,_0x5714b7,_0x3719b7));})[_0x8aa8('0x8d')]();return BPromise[_0x8aa8('0x58')](_0x54b94d);});});})[_0x8aa8('0x41')](function(_0x1778cc){console['log']('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x1778cc);throw _0x1778cc;});}function computePrice(_0x11b395,_0x3f72cb,_0x244cd1,_0x4a6624){var _0x26599f=_0x244cd1;console[_0x8aa8('0x5b')](_0x8aa8('0x8c'),_0x11b395);console[_0x8aa8('0x5b')]('dateNextInvoice',_0x3f72cb);console[_0x8aa8('0x5b')](_0x8aa8('0x62'),_0x4a6624);console[_0x8aa8('0x5b')]('netPrice',_0x244cd1);if(_0x4a6624!=0x0){var _0x23ae62=moment(_0x11b395);var _0x183c5d=moment(_0x3f72cb);var _0x5b21fa=Math[_0x8aa8('0x8e')](_0x23ae62[_0x8aa8('0x8f')](_0x183c5d,_0x8aa8('0x90')));console[_0x8aa8('0x5b')](_0x8aa8('0x91'),_0x5b21fa);var _0x54c1c7=_0x244cd1/(0x1e*_0x4a6624);console[_0x8aa8('0x5b')](_0x8aa8('0x92'),_0x54c1c7);_0x26599f=_0x54c1c7*_0x5b21fa;}console[_0x8aa8('0x5b')]('total',_0x26599f);return _0x26599f;}exports[_0x8aa8('0x93')]=function(_0x13e9c9,_0x786047,_0x1710b4){var _0x280ad7;if(_0x13e9c9[_0x8aa8('0x48')]['id']){delete _0x13e9c9['body']['id'];}return db[_0x8aa8('0x4c')]['transaction'](function(_0x1df869){return db[_0x8aa8('0x52')][_0x8aa8('0x70')]({'where':{'defaultEntry':0x1},'raw':!![]})[_0x8aa8('0x22')](function(_0x2da6d3){_0x280ad7=_0x2da6d3;return db['SAAsset'][_0x8aa8('0x3f')]({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[[_0x8aa8('0x4e'),_0x8aa8('0x53')],[_0x8aa8('0x50'),_0x8aa8('0x53')],[_0x8aa8('0x6d'),_0x8aa8('0x53')]],'raw':!![]});})['then'](function(_0x51e859){console[_0x8aa8('0x5b')](_0x8aa8('0x94'),_0x51e859);if(_0x51e859[_0x8aa8('0x2f')]>0x0){var _0x3622e3=[];var _0x95e18e=_[_0x8aa8('0x8a')](_0x51e859,_0x8aa8('0x4e'));Object[_0x8aa8('0x28')](_0x95e18e)['forEach'](function(_0x1b5886){var _0x28cd35=_0x95e18e[_0x1b5886];console['log'](_0x8aa8('0x55'),_0x28cd35);_0x3622e3['push'](addSubscriptionInvoice(_0x28cd35,_0x280ad7,_0x1b5886,_0x8aa8('0x95'),_0x1df869));});return BPromise[_0x8aa8('0x58')](_0x3622e3);}else{var _0x1d82f8={'errors':[{'type':_0x8aa8('0x96'),'message':_0x8aa8('0x97')}]};throw _0x1d82f8;}});})[_0x8aa8('0x22')](function(){return _0x786047['sendStatus'](0xc8);})[_0x8aa8('0x41')](function(_0x1ea498){console[_0x8aa8('0x5b')](_0x8aa8('0x5c'),_0x1ea498);if(_0x1ea498[_0x8aa8('0x24')]==='SequelizeUniqueConstraintError'){var _0x1ea498={'errors':[{'message':_0x8aa8('0x98')}]};}_0x786047[_0x8aa8('0x1a')](0x1f4)[_0x8aa8('0x25')](_0x1ea498);});}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.model.js b/server/api/saAsset/saAsset.model.js index 49dd580..3f62179 100644 --- a/server/api/saAsset/saAsset.model.js +++ b/server/api/saAsset/saAsset.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e39=['path','rimraf','../../config/environment','exports','define','SAAsset','sa_assets','lodash','util','moment','bluebird','request-promise'];(function(_0x448ce2,_0x5ada5d){var _0x48e7ab=function(_0x32e47b){while(--_0x32e47b){_0x448ce2['push'](_0x448ce2['shift']());}};_0x48e7ab(++_0x5ada5d);}(_0x5e39,0x10f));var _0x95e3=function(_0x496d52,_0x21fd80){_0x496d52=_0x496d52-0x0;var _0xf6c38c=_0x5e39[_0x496d52];return _0xf6c38c;};'use strict';var _=require(_0x95e3('0x0'));var util=require(_0x95e3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var rp=require(_0x95e3('0x4'));var fs=require('fs');var path=require(_0x95e3('0x5'));var rimraf=require(_0x95e3('0x6'));var config=require(_0x95e3('0x7'));var attributes=require('./saAsset.attributes');module[_0x95e3('0x8')]=function(_0x5784fe,_0x306d15){return _0x5784fe[_0x95e3('0x9')](_0x95e3('0xa'),attributes,{'tableName':_0x95e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a81=['lodash','util','../../config/logger','api','moment','request-promise','./saAsset.attributes','define'];(function(_0x5a20ae,_0x2c373c){var _0x12b91f=function(_0x1fd80a){while(--_0x1fd80a){_0x5a20ae['push'](_0x5a20ae['shift']());}};_0x12b91f(++_0x2c373c);}(_0x4a81,0xe8));var _0x14a8=function(_0x5b7e88,_0x27cae4){_0x5b7e88=_0x5b7e88-0x0;var _0x78cd9b=_0x4a81[_0x5b7e88];return _0x78cd9b;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var logger=require(_0x14a8('0x2'))(_0x14a8('0x3'));var moment=require(_0x14a8('0x4'));var BPromise=require('bluebird');var rp=require(_0x14a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14a8('0x6'));module['exports']=function(_0x4c4281,_0x4fc62a){return _0x4c4281[_0x14a8('0x7')]('SAAsset',attributes,{'tableName':'sa_assets','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.rpc.js b/server/api/saAsset/saAsset.rpc.js index 84ac103..6951017 100644 --- a/server/api/saAsset/saAsset.rpc.js +++ b/server/api/saAsset/saAsset.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b18=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','SAAsset,\x20%s,\x20%s,\x20%s','error','code','SAAsset,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x937e9f,_0x53fac2){var _0x36adb3=function(_0x589fa6){while(--_0x589fa6){_0x937e9f['push'](_0x937e9f['shift']());}};_0x36adb3(++_0x53fac2);}(_0x2b18,0x87));var _0x82b1=function(_0x1a39bc,_0x23b0c8){_0x1a39bc=_0x1a39bc-0x0;var _0x572056=_0x2b18[_0x1a39bc];return _0x572056;};'use strict';var _=require(_0x82b1('0x0'));var util=require(_0x82b1('0x1'));var moment=require(_0x82b1('0x2'));var BPromise=require(_0x82b1('0x3'));var rs=require(_0x82b1('0x4'));var fs=require('fs');var Redis=require(_0x82b1('0x5'));var db=require(_0x82b1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x82b1('0x7'))(_0x82b1('0x8'));var config=require(_0x82b1('0x9'));var jayson=require(_0x82b1('0xa'));var client=jayson['client'][_0x82b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34d7a7,_0x518476,_0x5934a7){return new BPromise(function(_0x4e158d,_0xb6e102){return client['request'](_0x34d7a7,_0x5934a7)[_0x82b1('0xc')](function(_0x472549){logger[_0x82b1('0xd')]('SAAsset,\x20%s,\x20%s',_0x518476,_0x82b1('0xe'));logger['debug'](_0x82b1('0xf'),_0x518476,'request\x20sent',JSON['stringify'](_0x472549));if(_0x472549[_0x82b1('0x10')]){if(_0x472549[_0x82b1('0x10')][_0x82b1('0x11')]===0x1f4){logger[_0x82b1('0x10')](_0x82b1('0x12'),_0x518476,_0x472549[_0x82b1('0x10')][_0x82b1('0x13')]);return _0xb6e102(_0x472549['error']['message']);}logger[_0x82b1('0x10')](_0x82b1('0x12'),_0x518476,_0x472549[_0x82b1('0x10')][_0x82b1('0x13')]);return _0x4e158d(_0x472549[_0x82b1('0x10')]['message']);}else{logger[_0x82b1('0xd')](_0x82b1('0x12'),_0x518476,_0x82b1('0xe'));_0x4e158d(_0x472549['result'][_0x82b1('0x13')]);}})['catch'](function(_0x6ebfdf){logger['error'](_0x82b1('0x12'),_0x518476,_0x6ebfdf);_0xb6e102(_0x6ebfdf);});});} \ No newline at end of file +var _0xd4ce=['catch','lodash','moment','bluebird','rpc','../../config/environment','client','http','request','then','info','SAAsset,\x20%s,\x20%s','request\x20sent','debug','SAAsset,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x515cff,_0x27d4a5){var _0x419c0e=function(_0x4a0ad2){while(--_0x4a0ad2){_0x515cff['push'](_0x515cff['shift']());}};_0x419c0e(++_0x27d4a5);}(_0xd4ce,0x1e7));var _0xed4c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xd4ce[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xed4c('0x0'));var util=require('util');var moment=require(_0xed4c('0x1'));var BPromise=require(_0xed4c('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')(_0xed4c('0x3'));var config=require(_0xed4c('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xed4c('0x5')][_0xed4c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54f155,_0xb7c00b,_0xa0c44b){return new BPromise(function(_0x2e51c6,_0x25890c){return client[_0xed4c('0x7')](_0x54f155,_0xa0c44b)[_0xed4c('0x8')](function(_0x5cbe99){logger[_0xed4c('0x9')](_0xed4c('0xa'),_0xb7c00b,_0xed4c('0xb'));logger[_0xed4c('0xc')](_0xed4c('0xd'),_0xb7c00b,_0xed4c('0xb'),JSON[_0xed4c('0xe')](_0x5cbe99));if(_0x5cbe99[_0xed4c('0xf')]){if(_0x5cbe99[_0xed4c('0xf')]['code']===0x1f4){logger['error'](_0xed4c('0xa'),_0xb7c00b,_0x5cbe99[_0xed4c('0xf')][_0xed4c('0x10')]);return _0x25890c(_0x5cbe99[_0xed4c('0xf')]['message']);}logger['error'](_0xed4c('0xa'),_0xb7c00b,_0x5cbe99[_0xed4c('0xf')][_0xed4c('0x10')]);return _0x2e51c6(_0x5cbe99[_0xed4c('0xf')]['message']);}else{logger[_0xed4c('0x9')](_0xed4c('0xa'),_0xb7c00b,_0xed4c('0xb'));_0x2e51c6(_0x5cbe99['result']['message']);}})[_0xed4c('0x11')](function(_0x3b808e){logger[_0xed4c('0xf')](_0xed4c('0xa'),_0xb7c00b,_0x3b808e);_0x25890c(_0x3b808e);});});} \ No newline at end of file diff --git a/server/api/saCompanyRelationship/index.js b/server/api/saCompanyRelationship/index.js index 15095fb..feafe1c 100644 --- a/server/api/saCompanyRelationship/index.js +++ b/server/api/saCompanyRelationship/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd545=['Router','../../components/interaction/service','./saCompanyRelationship.controller','get','/describe','describe','isAuthenticated','create','/:id','update','delete','destroy','connect-timeout','express'];(function(_0x4743ce,_0x55dafa){var _0xa05bc1=function(_0x289089){while(--_0x289089){_0x4743ce['push'](_0x4743ce['shift']());}};_0xa05bc1(++_0x55dafa);}(_0xd545,0x140));var _0x5d54=function(_0x586266,_0x21ce2b){_0x586266=_0x586266-0x0;var _0x4df015=_0xd545[_0x586266];return _0x4df015;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5d54('0x0'));var express=require(_0x5d54('0x1'));var router=express[_0x5d54('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5d54('0x3'));var config=require('../../config/environment');var controller=require(_0x5d54('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5d54('0x5')](_0x5d54('0x6'),auth['isAuthenticated'](),controller[_0x5d54('0x7')]);router[_0x5d54('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5d54('0x8')](),controller[_0x5d54('0x9')]);router['put'](_0x5d54('0xa'),auth['isAuthenticated'](),controller[_0x5d54('0xb')]);router[_0x5d54('0xc')](_0x5d54('0xa'),auth[_0x5d54('0x8')](),controller[_0x5d54('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc442=['./saCompanyRelationship.controller','get','index','/describe','describe','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1dd487,_0x8386e3){var _0x3e851a=function(_0x377062){while(--_0x377062){_0x1dd487['push'](_0x1dd487['shift']());}};_0x3e851a(++_0x8386e3);}(_0xc442,0x116));var _0x2c44=function(_0x2fbfe4,_0x5614cd){_0x2fbfe4=_0x2fbfe4-0x0;var _0x2eca1d=_0xc442[_0x2fbfe4];return _0x2eca1d;};'use strict';var multer=require(_0x2c44('0x0'));var util=require(_0x2c44('0x1'));var path=require(_0x2c44('0x2'));var timeout=require(_0x2c44('0x3'));var express=require(_0x2c44('0x4'));var router=express['Router']();var auth=require(_0x2c44('0x5'));var interaction=require(_0x2c44('0x6'));var config=require(_0x2c44('0x7'));var controller=require(_0x2c44('0x8'));router[_0x2c44('0x9')]('/',auth['isAuthenticated'](),controller[_0x2c44('0xa')]);router[_0x2c44('0x9')](_0x2c44('0xb'),auth['isAuthenticated'](),controller[_0x2c44('0xc')]);router[_0x2c44('0x9')]('/:id',auth[_0x2c44('0xd')](),controller[_0x2c44('0xe')]);router[_0x2c44('0xf')]('/',auth['isAuthenticated'](),controller[_0x2c44('0x10')]);router[_0x2c44('0x11')]('/:id',auth[_0x2c44('0xd')](),controller[_0x2c44('0x12')]);router[_0x2c44('0x13')](_0x2c44('0x14'),auth[_0x2c44('0xd')](),controller['destroy']);module[_0x2c44('0x15')]=router; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js b/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js index 156cbe6..44b8a7d 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeb2=['exports','STRING','sequelize'];(function(_0x1fa0b9,_0x556f29){var _0x3ac6fe=function(_0x9b3315){while(--_0x9b3315){_0x1fa0b9['push'](_0x1fa0b9['shift']());}};_0x3ac6fe(++_0x556f29);}(_0xdeb2,0x7d));var _0x2deb=function(_0x436a79,_0x35e097){_0x436a79=_0x436a79-0x0;var _0x166908=_0xdeb2[_0x436a79];return _0x166908;};'use strict';var Sequelize=require(_0x2deb('0x0'));module[_0x2deb('0x1')]={'name':{'type':Sequelize[_0x2deb('0x2')],'allowNull':![],'unique':'name'}}; \ No newline at end of file +var _0x5f51=['exports','STRING','name','sequelize'];(function(_0x3c8fff,_0x455504){var _0xcf94fe=function(_0x10542a){while(--_0x10542a){_0x3c8fff['push'](_0x3c8fff['shift']());}};_0xcf94fe(++_0x455504);}(_0x5f51,0x11f));var _0x15f5=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f51[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x15f5('0x0'));module[_0x15f5('0x1')]={'name':{'type':Sequelize[_0x15f5('0x2')],'allowNull':![],'unique':_0x15f5('0x3')}}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.controller.js b/server/api/saCompanyRelationship/saCompanyRelationship.controller.js index 8ddd07e..88d3bd8 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.controller.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f96=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','SACompanyRelationship','model','keys','query','filters','attributes','intersection','hasOwnProperty','order','sort','filter','where','map','type','key','field','options','includeAll','include','findAll','rows','show','params','fields','length','merge','create','body','catch','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0xc05058,_0x4beed4){var _0x1fe6bd=function(_0x19b54c){while(--_0x19b54c){_0xc05058['push'](_0xc05058['shift']());}};_0x1fe6bd(++_0x4beed4);}(_0x1f96,0xcf));var _0x61f9=function(_0x127e17,_0x26830a){_0x127e17=_0x127e17-0x0;var _0x3ef8ac=_0x1f96[_0x127e17];return _0x3ef8ac;};'use strict';var pdf=require(_0x61f9('0x0'));var emlformat=require(_0x61f9('0x1'));var rimraf=require(_0x61f9('0x2'));var zipdir=require(_0x61f9('0x3'));var jsonpatch=require(_0x61f9('0x4'));var rp=require('request-promise');var moment=require(_0x61f9('0x5'));var BPromise=require(_0x61f9('0x6'));var Mustache=require(_0x61f9('0x7'));var util=require(_0x61f9('0x8'));var path=require('path');var sox=require(_0x61f9('0x9'));var csv=require(_0x61f9('0xa'));var ejs=require(_0x61f9('0xb'));var fs=require('fs');var _=require(_0x61f9('0xc'));var squel=require(_0x61f9('0xd'));var crypto=require(_0x61f9('0xe'));var jsforce=require(_0x61f9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x61f9('0x10'));var Papa=require(_0x61f9('0x11'));var Redis=require(_0x61f9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x61f9('0x13'));var hardwareService=require(_0x61f9('0x14'));var logger=require(_0x61f9('0x15'))(_0x61f9('0x16'));var utils=require(_0x61f9('0x17'));var config=require('../../config/environment');var db=require(_0x61f9('0x18'))['db'];function respondWithStatusCode(_0x5bb58b,_0x3ee3f5){_0x3ee3f5=_0x3ee3f5||0xcc;return function(_0x54194f){if(_0x54194f){return _0x5bb58b[_0x61f9('0x19')](_0x3ee3f5);}return _0x5bb58b['status'](_0x3ee3f5)[_0x61f9('0x1a')]();};}function respondWithResult(_0x9cab0f,_0x119835){_0x119835=_0x119835||0xc8;return function(_0x12f74f){if(_0x12f74f){return _0x9cab0f[_0x61f9('0x1b')](_0x119835)[_0x61f9('0x1c')](_0x12f74f);}};}function respondWithFilteredResult(_0x4ef83b,_0x55b9b8){return function(_0x467467){if(_0x467467){var _0x386853=_0x467467[_0x61f9('0x1d')],_0x66c83=_0x55b9b8['offset'],_0x78605b=_0x55b9b8[_0x61f9('0x1e')]+_0x55b9b8[_0x61f9('0x1f')],_0x13e2f3;if(_0x78605b>=_0x386853){_0x78605b=_0x386853;_0x13e2f3=0xc8;}else{_0x13e2f3=0xce;}_0x4ef83b[_0x61f9('0x1b')](_0x13e2f3);return _0x4ef83b['set'](_0x61f9('0x20'),_0x66c83+'-'+_0x78605b+'/'+_0x386853)[_0x61f9('0x1c')](_0x467467);}return null;};}function patchUpdates(_0x5e98d1){return function(_0x20e21c){try{jsonpatch[_0x61f9('0x21')](_0x20e21c,_0x5e98d1,!![]);}catch(_0x4480ba){return BPromise[_0x61f9('0x22')](_0x4480ba);}return _0x20e21c[_0x61f9('0x23')]();};}function saveUpdates(_0x2773f6,_0x44ae0a){return function(_0x4fb28d){if(_0x4fb28d){return _0x4fb28d[_0x61f9('0x24')](_0x2773f6)[_0x61f9('0x25')](function(_0x6ba4fa){return _0x6ba4fa;});}return null;};}function removeEntity(_0x3c9e6f,_0x4647a6){return function(_0xcdf8eb){if(_0xcdf8eb){return _0xcdf8eb['destroy']()[_0x61f9('0x25')](function(){_0x3c9e6f[_0x61f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e600c,_0x3762bd){return function(_0xee9d5e){if(!_0xee9d5e){_0x4e600c[_0x61f9('0x19')](0x194);}return _0xee9d5e;};}function handleError(_0x5b911f,_0x1abb2e){_0x1abb2e=_0x1abb2e||0x1f4;return function(_0x399886){logger['error'](_0x399886[_0x61f9('0x26')]);if(_0x399886[_0x61f9('0x27')]){delete _0x399886[_0x61f9('0x27')];}_0x5b911f['status'](_0x1abb2e)[_0x61f9('0x28')](_0x399886);};}exports['index']=function(_0x33a783,_0x5eac31){var _0x4bd8b4={},_0x39d2e4={},_0x5c9199={'count':0x0,'rows':[]};var _0x31d777=db[_0x61f9('0x29')]['rawAttributes'];_0x39d2e4[_0x61f9('0x2a')]=_[_0x61f9('0x2b')](_0x31d777);_0x39d2e4[_0x61f9('0x2c')]=_[_0x61f9('0x2b')](_0x33a783['query']);_0x39d2e4[_0x61f9('0x2d')]=_['intersection'](_0x39d2e4['model'],_0x39d2e4[_0x61f9('0x2c')]);_0x4bd8b4[_0x61f9('0x2e')]=_[_0x61f9('0x2f')](_0x39d2e4[_0x61f9('0x2a')],qs['fields'](_0x33a783[_0x61f9('0x2c')]['fields']));_0x4bd8b4[_0x61f9('0x2e')]=_0x4bd8b4[_0x61f9('0x2e')]['length']?_0x4bd8b4['attributes']:_0x39d2e4[_0x61f9('0x2a')];if(!_0x33a783[_0x61f9('0x2c')][_0x61f9('0x30')]('nolimit')){_0x4bd8b4[_0x61f9('0x1f')]=qs['limit'](_0x33a783['query']['limit']);_0x4bd8b4[_0x61f9('0x1e')]=qs[_0x61f9('0x1e')](_0x33a783[_0x61f9('0x2c')][_0x61f9('0x1e')]);}_0x4bd8b4[_0x61f9('0x31')]=qs[_0x61f9('0x32')](_0x33a783[_0x61f9('0x2c')][_0x61f9('0x32')]);_0x4bd8b4['where']=qs[_0x61f9('0x2d')](_['pick'](_0x33a783[_0x61f9('0x2c')],_0x39d2e4[_0x61f9('0x2d')]));if(_0x33a783['query'][_0x61f9('0x33')]){_0x4bd8b4['where']=_['merge'](_0x4bd8b4[_0x61f9('0x34')],{'$or':_[_0x61f9('0x35')](_0x31d777,function(_0x5c07a9){if(_0x5c07a9[_0x61f9('0x36')][_0x61f9('0x37')]!=='VIRTUAL'){var _0x347a57={};_0x347a57[_0x5c07a9[_0x61f9('0x38')]]={'$like':'%'+_0x33a783['query'][_0x61f9('0x33')]+'%'};return _0x347a57;}})});}_0x4bd8b4=_['merge']({},_0x4bd8b4,_0x33a783[_0x61f9('0x39')]);var _0xf4c7d8={'where':_0x4bd8b4[_0x61f9('0x34')]};return db['SACompanyRelationship'][_0x61f9('0x1d')](_0xf4c7d8)[_0x61f9('0x25')](function(_0x2155e0){_0x5c9199['count']=_0x2155e0;if(_0x33a783[_0x61f9('0x2c')][_0x61f9('0x3a')]){_0x4bd8b4[_0x61f9('0x3b')]=[{'all':!![]}];}return db[_0x61f9('0x29')][_0x61f9('0x3c')](_0x4bd8b4);})[_0x61f9('0x25')](function(_0x254b53){_0x5c9199[_0x61f9('0x3d')]=_0x254b53;return _0x5c9199;})[_0x61f9('0x25')](respondWithFilteredResult(_0x5eac31,_0x4bd8b4))['catch'](handleError(_0x5eac31,null));};exports[_0x61f9('0x3e')]=function(_0x4151bb,_0xde9d56){var _0x37cb52={'raw':![],'where':{'id':_0x4151bb[_0x61f9('0x3f')]['id']}},_0x45845c={};_0x45845c[_0x61f9('0x2a')]=_[_0x61f9('0x2b')](db[_0x61f9('0x29')]['rawAttributes']);_0x45845c['query']=_['keys'](_0x4151bb[_0x61f9('0x2c')]);_0x45845c[_0x61f9('0x2d')]=_[_0x61f9('0x2f')](_0x45845c['model'],_0x45845c[_0x61f9('0x2c')]);_0x37cb52[_0x61f9('0x2e')]=_[_0x61f9('0x2f')](_0x45845c['model'],qs[_0x61f9('0x40')](_0x4151bb[_0x61f9('0x2c')][_0x61f9('0x40')]));_0x37cb52[_0x61f9('0x2e')]=_0x37cb52[_0x61f9('0x2e')][_0x61f9('0x41')]?_0x37cb52[_0x61f9('0x2e')]:_0x45845c['model'];if(_0x4151bb[_0x61f9('0x2c')]['includeAll']){_0x37cb52[_0x61f9('0x3b')]=[{'all':!![]}];}_0x37cb52=_[_0x61f9('0x42')]({},_0x37cb52,_0x4151bb['options']);return db[_0x61f9('0x29')]['find'](_0x37cb52)['then'](handleEntityNotFound(_0xde9d56,null))['then'](respondWithResult(_0xde9d56,null))['catch'](handleError(_0xde9d56,null));};exports[_0x61f9('0x43')]=function(_0x518c06,_0x31e434){return db[_0x61f9('0x29')]['create'](_0x518c06[_0x61f9('0x44')],{})[_0x61f9('0x25')](respondWithResult(_0x31e434,0xc9))['catch'](handleError(_0x31e434,null));};exports[_0x61f9('0x24')]=function(_0x312ee8,_0x52ca41){if(_0x312ee8[_0x61f9('0x44')]['id']){delete _0x312ee8['body']['id'];}return db[_0x61f9('0x29')]['find']({'where':{'id':_0x312ee8[_0x61f9('0x3f')]['id']}})[_0x61f9('0x25')](handleEntityNotFound(_0x52ca41,null))[_0x61f9('0x25')](saveUpdates(_0x312ee8[_0x61f9('0x44')],null))[_0x61f9('0x25')](respondWithResult(_0x52ca41,null))[_0x61f9('0x45')](handleError(_0x52ca41,null));};exports['destroy']=function(_0x190939,_0x206114){return db[_0x61f9('0x29')][_0x61f9('0x46')]({'where':{'id':_0x190939[_0x61f9('0x3f')]['id']}})[_0x61f9('0x25')](handleEntityNotFound(_0x206114,null))['then'](removeEntity(_0x206114,null))[_0x61f9('0x45')](handleError(_0x206114,null));};exports['describe']=function(_0x4470ad,_0x14d86f){return db['SACompanyRelationship'][_0x61f9('0x47')]()['then'](respondWithResult(_0x14d86f,null))[_0x61f9('0x45')](handleError(_0x14d86f,null));}; \ No newline at end of file +var _0x4e21=['save','update','then','error','stack','name','send','rawAttributes','keys','query','intersection','fields','attributes','length','model','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','SACompanyRelationship','findAll','rows','params','filters','find','catch','create','body','destroy','describe','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject'];(function(_0x31551d,_0x611664){var _0x45837e=function(_0x2861b4){while(--_0x2861b4){_0x31551d['push'](_0x31551d['shift']());}};_0x45837e(++_0x611664);}(_0x4e21,0x6f));var _0x14e2=function(_0x13f088,_0x51ac16){_0x13f088=_0x13f088-0x0;var _0x51404d=_0x4e21[_0x13f088];return _0x51404d;};'use strict';var pdf=require(_0x14e2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14e2('0x2'));var moment=require(_0x14e2('0x3'));var BPromise=require(_0x14e2('0x4'));var Mustache=require(_0x14e2('0x5'));var util=require(_0x14e2('0x6'));var path=require(_0x14e2('0x7'));var sox=require(_0x14e2('0x8'));var csv=require(_0x14e2('0x9'));var ejs=require(_0x14e2('0xa'));var fs=require('fs');var _=require(_0x14e2('0xb'));var squel=require(_0x14e2('0xc'));var crypto=require(_0x14e2('0xd'));var jsforce=require(_0x14e2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x14e2('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x14e2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14e2('0x11'))(_0x14e2('0x12'));var utils=require(_0x14e2('0x13'));var config=require('../../config/environment');var db=require(_0x14e2('0x14'))['db'];function respondWithStatusCode(_0x492c3d,_0x24f4f1){_0x24f4f1=_0x24f4f1||0xcc;return function(_0x25c0b8){if(_0x25c0b8){return _0x492c3d[_0x14e2('0x15')](_0x24f4f1);}return _0x492c3d[_0x14e2('0x16')](_0x24f4f1)[_0x14e2('0x17')]();};}function respondWithResult(_0x32295f,_0x20877e){_0x20877e=_0x20877e||0xc8;return function(_0x24b0c3){if(_0x24b0c3){return _0x32295f[_0x14e2('0x16')](_0x20877e)[_0x14e2('0x18')](_0x24b0c3);}};}function respondWithFilteredResult(_0x7dcea2,_0x1b37cd){return function(_0x16928a){if(_0x16928a){var _0x21ac7f=_0x16928a[_0x14e2('0x19')],_0x10c97d=_0x1b37cd[_0x14e2('0x1a')],_0x21126c=_0x1b37cd[_0x14e2('0x1a')]+_0x1b37cd[_0x14e2('0x1b')],_0x34ccbb;if(_0x21126c>=_0x21ac7f){_0x21126c=_0x21ac7f;_0x34ccbb=0xc8;}else{_0x34ccbb=0xce;}_0x7dcea2[_0x14e2('0x16')](_0x34ccbb);return _0x7dcea2[_0x14e2('0x1c')]('Content-Range',_0x10c97d+'-'+_0x21126c+'/'+_0x21ac7f)['json'](_0x16928a);}return null;};}function patchUpdates(_0x38d53e){return function(_0x284a31){try{jsonpatch[_0x14e2('0x1d')](_0x284a31,_0x38d53e,!![]);}catch(_0x1e677f){return BPromise[_0x14e2('0x1e')](_0x1e677f);}return _0x284a31[_0x14e2('0x1f')]();};}function saveUpdates(_0x48e99f,_0x2e5a88){return function(_0x9cb569){if(_0x9cb569){return _0x9cb569[_0x14e2('0x20')](_0x48e99f)[_0x14e2('0x21')](function(_0x711fc1){return _0x711fc1;});}return null;};}function removeEntity(_0x3528d7,_0x15c4bf){return function(_0x68b039){if(_0x68b039){return _0x68b039['destroy']()['then'](function(){_0x3528d7['status'](0xcc)[_0x14e2('0x17')]();});}};}function handleEntityNotFound(_0x3ceb5f,_0x5f2141){return function(_0x272218){if(!_0x272218){_0x3ceb5f['sendStatus'](0x194);}return _0x272218;};}function handleError(_0x1494b9,_0x227c28){_0x227c28=_0x227c28||0x1f4;return function(_0x54d08a){logger[_0x14e2('0x22')](_0x54d08a[_0x14e2('0x23')]);if(_0x54d08a[_0x14e2('0x24')]){delete _0x54d08a[_0x14e2('0x24')];}_0x1494b9[_0x14e2('0x16')](_0x227c28)[_0x14e2('0x25')](_0x54d08a);};}exports['index']=function(_0x6e0b0c,_0xc532a5){var _0x2afcb4={},_0x29d118={},_0x49ceb2={'count':0x0,'rows':[]};var _0x5ba403=db['SACompanyRelationship'][_0x14e2('0x26')];_0x29d118['model']=_[_0x14e2('0x27')](_0x5ba403);_0x29d118[_0x14e2('0x28')]=_[_0x14e2('0x27')](_0x6e0b0c['query']);_0x29d118['filters']=_[_0x14e2('0x29')](_0x29d118['model'],_0x29d118[_0x14e2('0x28')]);_0x2afcb4['attributes']=_[_0x14e2('0x29')](_0x29d118['model'],qs[_0x14e2('0x2a')](_0x6e0b0c[_0x14e2('0x28')][_0x14e2('0x2a')]));_0x2afcb4[_0x14e2('0x2b')]=_0x2afcb4[_0x14e2('0x2b')][_0x14e2('0x2c')]?_0x2afcb4[_0x14e2('0x2b')]:_0x29d118[_0x14e2('0x2d')];if(!_0x6e0b0c['query']['hasOwnProperty'](_0x14e2('0x2e'))){_0x2afcb4[_0x14e2('0x1b')]=qs[_0x14e2('0x1b')](_0x6e0b0c[_0x14e2('0x28')]['limit']);_0x2afcb4[_0x14e2('0x1a')]=qs[_0x14e2('0x1a')](_0x6e0b0c[_0x14e2('0x28')][_0x14e2('0x1a')]);}_0x2afcb4[_0x14e2('0x2f')]=qs[_0x14e2('0x30')](_0x6e0b0c[_0x14e2('0x28')]['sort']);_0x2afcb4[_0x14e2('0x31')]=qs['filters'](_[_0x14e2('0x32')](_0x6e0b0c['query'],_0x29d118['filters']));if(_0x6e0b0c[_0x14e2('0x28')]['filter']){_0x2afcb4[_0x14e2('0x31')]=_[_0x14e2('0x33')](_0x2afcb4['where'],{'$or':_[_0x14e2('0x34')](_0x5ba403,function(_0x545b05){if(_0x545b05['type'][_0x14e2('0x35')]!==_0x14e2('0x36')){var _0x1fbd15={};_0x1fbd15[_0x545b05[_0x14e2('0x37')]]={'$like':'%'+_0x6e0b0c[_0x14e2('0x28')][_0x14e2('0x38')]+'%'};return _0x1fbd15;}})});}_0x2afcb4=_[_0x14e2('0x33')]({},_0x2afcb4,_0x6e0b0c[_0x14e2('0x39')]);var _0x2fdc23={'where':_0x2afcb4[_0x14e2('0x31')]};return db['SACompanyRelationship'][_0x14e2('0x19')](_0x2fdc23)['then'](function(_0x56055d){_0x49ceb2[_0x14e2('0x19')]=_0x56055d;if(_0x6e0b0c['query'][_0x14e2('0x3a')]){_0x2afcb4[_0x14e2('0x3b')]=[{'all':!![]}];}return db[_0x14e2('0x3c')][_0x14e2('0x3d')](_0x2afcb4);})[_0x14e2('0x21')](function(_0x3d1cf0){_0x49ceb2[_0x14e2('0x3e')]=_0x3d1cf0;return _0x49ceb2;})[_0x14e2('0x21')](respondWithFilteredResult(_0xc532a5,_0x2afcb4))['catch'](handleError(_0xc532a5,null));};exports['show']=function(_0x54586e,_0x4e6df2){var _0xb9fd8e={'raw':![],'where':{'id':_0x54586e[_0x14e2('0x3f')]['id']}},_0x193721={};_0x193721[_0x14e2('0x2d')]=_['keys'](db['SACompanyRelationship']['rawAttributes']);_0x193721[_0x14e2('0x28')]=_[_0x14e2('0x27')](_0x54586e[_0x14e2('0x28')]);_0x193721[_0x14e2('0x40')]=_[_0x14e2('0x29')](_0x193721[_0x14e2('0x2d')],_0x193721['query']);_0xb9fd8e['attributes']=_['intersection'](_0x193721['model'],qs[_0x14e2('0x2a')](_0x54586e['query'][_0x14e2('0x2a')]));_0xb9fd8e[_0x14e2('0x2b')]=_0xb9fd8e[_0x14e2('0x2b')]['length']?_0xb9fd8e[_0x14e2('0x2b')]:_0x193721['model'];if(_0x54586e['query'][_0x14e2('0x3a')]){_0xb9fd8e[_0x14e2('0x3b')]=[{'all':!![]}];}_0xb9fd8e=_[_0x14e2('0x33')]({},_0xb9fd8e,_0x54586e['options']);return db[_0x14e2('0x3c')][_0x14e2('0x41')](_0xb9fd8e)[_0x14e2('0x21')](handleEntityNotFound(_0x4e6df2,null))[_0x14e2('0x21')](respondWithResult(_0x4e6df2,null))[_0x14e2('0x42')](handleError(_0x4e6df2,null));};exports[_0x14e2('0x43')]=function(_0x487c7f,_0x26d597){return db[_0x14e2('0x3c')][_0x14e2('0x43')](_0x487c7f[_0x14e2('0x44')],{})['then'](respondWithResult(_0x26d597,0xc9))[_0x14e2('0x42')](handleError(_0x26d597,null));};exports['update']=function(_0x62164f,_0x283b5b){if(_0x62164f['body']['id']){delete _0x62164f[_0x14e2('0x44')]['id'];}return db['SACompanyRelationship'][_0x14e2('0x41')]({'where':{'id':_0x62164f[_0x14e2('0x3f')]['id']}})[_0x14e2('0x21')](handleEntityNotFound(_0x283b5b,null))['then'](saveUpdates(_0x62164f[_0x14e2('0x44')],null))['then'](respondWithResult(_0x283b5b,null))['catch'](handleError(_0x283b5b,null));};exports[_0x14e2('0x45')]=function(_0x28b683,_0x2ade5e){return db[_0x14e2('0x3c')][_0x14e2('0x41')]({'where':{'id':_0x28b683[_0x14e2('0x3f')]['id']}})[_0x14e2('0x21')](handleEntityNotFound(_0x2ade5e,null))['then'](removeEntity(_0x2ade5e,null))[_0x14e2('0x42')](handleError(_0x2ade5e,null));};exports[_0x14e2('0x46')]=function(_0x2338ba,_0x4032da){return db[_0x14e2('0x3c')][_0x14e2('0x46')]()[_0x14e2('0x21')](respondWithResult(_0x4032da,null))['catch'](handleError(_0x4032da,null));}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.model.js b/server/api/saCompanyRelationship/saCompanyRelationship.model.js index 2005ba6..d48998c 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.model.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bf2=['./saCompanyRelationship.attributes','exports','define','lodash','moment','request-promise'];(function(_0x145b93,_0x4cf77a){var _0x596ac2=function(_0x2c418d){while(--_0x2c418d){_0x145b93['push'](_0x145b93['shift']());}};_0x596ac2(++_0x4cf77a);}(_0x6bf2,0xc9));var _0x26bf=function(_0x46f5ca,_0xecad5){_0x46f5ca=_0x46f5ca-0x0;var _0x57b513=_0x6bf2[_0x46f5ca];return _0x57b513;};'use strict';var _=require(_0x26bf('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x26bf('0x1'));var BPromise=require('bluebird');var rp=require(_0x26bf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26bf('0x3'));module[_0x26bf('0x4')]=function(_0x5a1135,_0x265c7b){return _0x5a1135[_0x26bf('0x5')]('SACompanyRelationship',attributes,{'tableName':'sa_company_relationships','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x526b=['../../config/logger','api','moment','bluebird','path','./saCompanyRelationship.attributes','exports','define','sa_company_relationships','lodash'];(function(_0x312c2a,_0x43e6d9){var _0x38712b=function(_0x523876){while(--_0x523876){_0x312c2a['push'](_0x312c2a['shift']());}};_0x38712b(++_0x43e6d9);}(_0x526b,0xe5));var _0xb526=function(_0x379895,_0x265ef8){_0x379895=_0x379895-0x0;var _0x593599=_0x526b[_0x379895];return _0x593599;};'use strict';var _=require(_0xb526('0x0'));var util=require('util');var logger=require(_0xb526('0x1'))(_0xb526('0x2'));var moment=require(_0xb526('0x3'));var BPromise=require(_0xb526('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb526('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb526('0x6'));module[_0xb526('0x7')]=function(_0x4d1a37,_0x3e3f60){return _0x4d1a37[_0xb526('0x8')]('SACompanyRelationship',attributes,{'tableName':_0xb526('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js b/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js index 424bfde..7aabb78 100644 --- a/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js +++ b/server/api/saCompanyRelationship/saCompanyRelationship.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1959=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','SACompanyRelationship,\x20%s,\x20%s','request\x20sent','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1959,0x15d));var _0x9195=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1959[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x9195('0x0'));var util=require(_0x9195('0x1'));var moment=require(_0x9195('0x2'));var BPromise=require(_0x9195('0x3'));var rs=require(_0x9195('0x4'));var fs=require('fs');var Redis=require(_0x9195('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9195('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9195('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9195('0x8')][_0x9195('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14ed8e,_0x1cac32,_0x49ee87){return new BPromise(function(_0x41dbf7,_0x535127){return client[_0x9195('0xa')](_0x14ed8e,_0x49ee87)[_0x9195('0xb')](function(_0x22dcc7){logger['info'](_0x9195('0xc'),_0x1cac32,_0x9195('0xd'));logger[_0x9195('0xe')](_0x9195('0xf'),_0x1cac32,_0x9195('0xd'),JSON[_0x9195('0x10')](_0x22dcc7));if(_0x22dcc7[_0x9195('0x11')]){if(_0x22dcc7[_0x9195('0x11')][_0x9195('0x12')]===0x1f4){logger['error'](_0x9195('0xc'),_0x1cac32,_0x22dcc7[_0x9195('0x11')][_0x9195('0x13')]);return _0x535127(_0x22dcc7['error']['message']);}logger[_0x9195('0x11')]('SACompanyRelationship,\x20%s,\x20%s',_0x1cac32,_0x22dcc7[_0x9195('0x11')][_0x9195('0x13')]);return _0x41dbf7(_0x22dcc7['error'][_0x9195('0x13')]);}else{logger[_0x9195('0x14')](_0x9195('0xc'),_0x1cac32,'request\x20sent');_0x41dbf7(_0x22dcc7[_0x9195('0x15')][_0x9195('0x13')]);}})[_0x9195('0x16')](function(_0x28257b){logger[_0x9195('0x11')](_0x9195('0xc'),_0x1cac32,_0x28257b);_0x535127(_0x28257b);});});} \ No newline at end of file +var _0x2d47=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SACompanyRelationship,\x20%s,\x20%s','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xc116f3,_0x2e506a){var _0x2561ac=function(_0x7e25f2){while(--_0x7e25f2){_0xc116f3['push'](_0xc116f3['shift']());}};_0x2561ac(++_0x2e506a);}(_0x2d47,0x1ac));var _0x72d4=function(_0x105608,_0x567eea){_0x105608=_0x105608-0x0;var _0x4938a2=_0x2d47[_0x105608];return _0x4938a2;};'use strict';var _=require(_0x72d4('0x0'));var util=require('util');var moment=require(_0x72d4('0x1'));var BPromise=require(_0x72d4('0x2'));var rs=require(_0x72d4('0x3'));var fs=require('fs');var Redis=require(_0x72d4('0x4'));var db=require(_0x72d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72d4('0x6'));var config=require(_0x72d4('0x7'));var jayson=require(_0x72d4('0x8'));var client=jayson[_0x72d4('0x9')][_0x72d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb2adf,_0x46d763,_0x3cba4e){return new BPromise(function(_0x1965bc,_0x3c06ff){return client[_0x72d4('0xb')](_0xcb2adf,_0x3cba4e)[_0x72d4('0xc')](function(_0x3d3394){logger[_0x72d4('0xd')](_0x72d4('0xe'),_0x46d763,'request\x20sent');logger[_0x72d4('0xf')](_0x72d4('0x10'),_0x46d763,_0x72d4('0x11'),JSON[_0x72d4('0x12')](_0x3d3394));if(_0x3d3394['error']){if(_0x3d3394[_0x72d4('0x13')][_0x72d4('0x14')]===0x1f4){logger['error']('SACompanyRelationship,\x20%s,\x20%s',_0x46d763,_0x3d3394['error'][_0x72d4('0x15')]);return _0x3c06ff(_0x3d3394[_0x72d4('0x13')]['message']);}logger['error']('SACompanyRelationship,\x20%s,\x20%s',_0x46d763,_0x3d3394[_0x72d4('0x13')]['message']);return _0x1965bc(_0x3d3394[_0x72d4('0x13')][_0x72d4('0x15')]);}else{logger['info']('SACompanyRelationship,\x20%s,\x20%s',_0x46d763,'request\x20sent');_0x1965bc(_0x3d3394[_0x72d4('0x16')][_0x72d4('0x15')]);}})[_0x72d4('0x17')](function(_0x43e794){logger['error'](_0x72d4('0xe'),_0x46d763,_0x43e794);_0x3c06ff(_0x43e794);});});} \ No newline at end of file diff --git a/server/api/saCompanyType/index.js b/server/api/saCompanyType/index.js index 2a2936c..e51a3dc 100644 --- a/server/api/saCompanyType/index.js +++ b/server/api/saCompanyType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ca=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCompanyType.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id'];(function(_0xea16f5,_0x2afb9a){var _0x5aefb7=function(_0x1fc6e2){while(--_0x1fc6e2){_0xea16f5['push'](_0xea16f5['shift']());}};_0x5aefb7(++_0x2afb9a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0xf2ca[_0x359377];return _0x8be18a;};'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')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0x11'),auth[_0xaf2c('0x9')](),controller['update']);router['delete'](_0xaf2c('0x11'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router; \ No newline at end of file +var _0x24ca=['put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCompanyType.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x1bc));var _0xa24c=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x24ca[_0x9b3efc];return _0x200f05;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['post']('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller['destroy']);module[_0xa24c('0x13')]=router; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.attributes.js b/server/api/saCompanyType/saCompanyType.attributes.js index be163b1..f4b6d99 100644 --- a/server/api/saCompanyType/saCompanyType.attributes.js +++ b/server/api/saCompanyType/saCompanyType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a8=['sequelize','exports','STRING','name'];(function(_0x214eea,_0x307aa5){var _0x280550=function(_0x39cc34){while(--_0x39cc34){_0x214eea['push'](_0x214eea['shift']());}};_0x280550(++_0x307aa5);}(_0x98a8,0x12c));var _0x898a=function(_0x4d5d71,_0x4cba11){_0x4d5d71=_0x4d5d71-0x0;var _0x20f425=_0x98a8[_0x4d5d71];return _0x20f425;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![],'unique':_0x898a('0x3')},'fieldsToCheck':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd2bb=['STRING','exports','name'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x5bc03a,_0xf03abe){_0x5bc03a=_0x5bc03a-0x0;var _0x20057b=_0xd2bb[_0x5bc03a];return _0x20057b;};'use strict';var Sequelize=require('sequelize');module[_0xbd2b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbd2b('0x1')},'fieldsToCheck':{'type':Sequelize[_0xbd2b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.controller.js b/server/api/saCompanyType/saCompanyType.controller.js index 2514a1f..df48eac 100644 --- a/server/api/saCompanyType/saCompanyType.controller.js +++ b/server/api/saCompanyType/saCompanyType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bbc=['params','length','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','SACompanyType','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','filter','merge','type','key','field','options','includeAll','include','rows'];(function(_0x1f97a9,_0x34df0f){var _0xd3d5df=function(_0x7327f1){while(--_0x7327f1){_0x1f97a9['push'](_0x1f97a9['shift']());}};_0xd3d5df(++_0x34df0f);}(_0x2bbc,0x1dc));var _0xc2bb=function(_0x551911,_0x522e8c){_0x551911=_0x551911-0x0;var _0x578831=_0x2bbc[_0x551911];return _0x578831;};'use strict';var pdf=require(_0xc2bb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc2bb('0x1'));var zipdir=require(_0xc2bb('0x2'));var jsonpatch=require(_0xc2bb('0x3'));var rp=require(_0xc2bb('0x4'));var moment=require('moment');var BPromise=require(_0xc2bb('0x5'));var Mustache=require(_0xc2bb('0x6'));var util=require(_0xc2bb('0x7'));var path=require(_0xc2bb('0x8'));var sox=require(_0xc2bb('0x9'));var csv=require(_0xc2bb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc2bb('0xb'));var crypto=require('crypto');var jsforce=require(_0xc2bb('0xc'));var deskjs=require(_0xc2bb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc2bb('0xe'));var Papa=require(_0xc2bb('0xf'));var Redis=require(_0xc2bb('0x10'));var authService=require(_0xc2bb('0x11'));var qs=require(_0xc2bb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2bb('0x13'))('api');var utils=require(_0xc2bb('0x14'));var config=require('../../config/environment');var db=require(_0xc2bb('0x15'))['db'];function respondWithStatusCode(_0x526a98,_0x4020d9){_0x4020d9=_0x4020d9||0xcc;return function(_0x5dd113){if(_0x5dd113){return _0x526a98[_0xc2bb('0x16')](_0x4020d9);}return _0x526a98['status'](_0x4020d9)[_0xc2bb('0x17')]();};}function respondWithResult(_0x42a343,_0x127c9b){_0x127c9b=_0x127c9b||0xc8;return function(_0x3c55b2){if(_0x3c55b2){return _0x42a343[_0xc2bb('0x18')](_0x127c9b)[_0xc2bb('0x19')](_0x3c55b2);}};}function respondWithFilteredResult(_0x475724,_0x1bbd10){return function(_0x4fe3a4){if(_0x4fe3a4){var _0x2e3d7d=_0x4fe3a4[_0xc2bb('0x1a')],_0x503ad9=_0x1bbd10[_0xc2bb('0x1b')],_0x38a2a6=_0x1bbd10[_0xc2bb('0x1b')]+_0x1bbd10[_0xc2bb('0x1c')],_0x231946;if(_0x38a2a6>=_0x2e3d7d){_0x38a2a6=_0x2e3d7d;_0x231946=0xc8;}else{_0x231946=0xce;}_0x475724[_0xc2bb('0x18')](_0x231946);return _0x475724[_0xc2bb('0x1d')]('Content-Range',_0x503ad9+'-'+_0x38a2a6+'/'+_0x2e3d7d)['json'](_0x4fe3a4);}return null;};}function patchUpdates(_0x670e35){return function(_0x36e31d){try{jsonpatch[_0xc2bb('0x1e')](_0x36e31d,_0x670e35,!![]);}catch(_0x364485){return BPromise[_0xc2bb('0x1f')](_0x364485);}return _0x36e31d[_0xc2bb('0x20')]();};}function saveUpdates(_0x3e34e3,_0x1964c5){return function(_0x1069e5){if(_0x1069e5){return _0x1069e5[_0xc2bb('0x21')](_0x3e34e3)[_0xc2bb('0x22')](function(_0x51bb25){return _0x51bb25;});}return null;};}function removeEntity(_0x17e6dc,_0x18952c){return function(_0x5e9c2f){if(_0x5e9c2f){return _0x5e9c2f[_0xc2bb('0x23')]()[_0xc2bb('0x22')](function(){_0x17e6dc['status'](0xcc)[_0xc2bb('0x17')]();});}};}function handleEntityNotFound(_0x52c0fd,_0x5cbfd2){return function(_0x44e6a3){if(!_0x44e6a3){_0x52c0fd['sendStatus'](0x194);}return _0x44e6a3;};}function handleError(_0x3ab705,_0x41a202){_0x41a202=_0x41a202||0x1f4;return function(_0xbcaf5a){logger[_0xc2bb('0x24')](_0xbcaf5a['stack']);if(_0xbcaf5a[_0xc2bb('0x25')]){delete _0xbcaf5a[_0xc2bb('0x25')];}_0x3ab705['status'](_0x41a202)['send'](_0xbcaf5a);};}exports['index']=function(_0x369539,_0x1b6317){var _0x320fd3={},_0x22c6f5={},_0xab2107={'count':0x0,'rows':[]};var _0x2b8fe9=db[_0xc2bb('0x26')][_0xc2bb('0x27')];_0x22c6f5[_0xc2bb('0x28')]=_[_0xc2bb('0x29')](_0x2b8fe9);_0x22c6f5[_0xc2bb('0x2a')]=_[_0xc2bb('0x29')](_0x369539[_0xc2bb('0x2a')]);_0x22c6f5['filters']=_[_0xc2bb('0x2b')](_0x22c6f5[_0xc2bb('0x28')],_0x22c6f5[_0xc2bb('0x2a')]);_0x320fd3[_0xc2bb('0x2c')]=_[_0xc2bb('0x2b')](_0x22c6f5[_0xc2bb('0x28')],qs['fields'](_0x369539[_0xc2bb('0x2a')][_0xc2bb('0x2d')]));_0x320fd3['attributes']=_0x320fd3[_0xc2bb('0x2c')]['length']?_0x320fd3[_0xc2bb('0x2c')]:_0x22c6f5['model'];if(!_0x369539[_0xc2bb('0x2a')][_0xc2bb('0x2e')]('nolimit')){_0x320fd3[_0xc2bb('0x1c')]=qs[_0xc2bb('0x1c')](_0x369539['query']['limit']);_0x320fd3[_0xc2bb('0x1b')]=qs[_0xc2bb('0x1b')](_0x369539['query']['offset']);}_0x320fd3[_0xc2bb('0x2f')]=qs['sort'](_0x369539[_0xc2bb('0x2a')]['sort']);_0x320fd3[_0xc2bb('0x30')]=qs[_0xc2bb('0x31')](_[_0xc2bb('0x32')](_0x369539[_0xc2bb('0x2a')],_0x22c6f5[_0xc2bb('0x31')]));if(_0x369539[_0xc2bb('0x2a')][_0xc2bb('0x33')]){_0x320fd3['where']=_[_0xc2bb('0x34')](_0x320fd3[_0xc2bb('0x30')],{'$or':_['map'](_0x2b8fe9,function(_0x2f84d7){if(_0x2f84d7[_0xc2bb('0x35')][_0xc2bb('0x36')]!=='VIRTUAL'){var _0x262dd9={};_0x262dd9[_0x2f84d7[_0xc2bb('0x37')]]={'$like':'%'+_0x369539[_0xc2bb('0x2a')]['filter']+'%'};return _0x262dd9;}})});}_0x320fd3=_[_0xc2bb('0x34')]({},_0x320fd3,_0x369539[_0xc2bb('0x38')]);var _0x34623f={'where':_0x320fd3[_0xc2bb('0x30')]};return db['SACompanyType']['count'](_0x34623f)[_0xc2bb('0x22')](function(_0x145ddd){_0xab2107[_0xc2bb('0x1a')]=_0x145ddd;if(_0x369539['query'][_0xc2bb('0x39')]){_0x320fd3[_0xc2bb('0x3a')]=[{'all':!![]}];}return db[_0xc2bb('0x26')]['findAll'](_0x320fd3);})[_0xc2bb('0x22')](function(_0x19c7ef){_0xab2107[_0xc2bb('0x3b')]=_0x19c7ef;return _0xab2107;})['then'](respondWithFilteredResult(_0x1b6317,_0x320fd3))['catch'](handleError(_0x1b6317,null));};exports['show']=function(_0x114963,_0x8fc77b){var _0x2f033a={'raw':![],'where':{'id':_0x114963[_0xc2bb('0x3c')]['id']}},_0x97e409={};_0x97e409[_0xc2bb('0x28')]=_[_0xc2bb('0x29')](db[_0xc2bb('0x26')][_0xc2bb('0x27')]);_0x97e409[_0xc2bb('0x2a')]=_['keys'](_0x114963['query']);_0x97e409['filters']=_[_0xc2bb('0x2b')](_0x97e409[_0xc2bb('0x28')],_0x97e409['query']);_0x2f033a[_0xc2bb('0x2c')]=_[_0xc2bb('0x2b')](_0x97e409[_0xc2bb('0x28')],qs[_0xc2bb('0x2d')](_0x114963[_0xc2bb('0x2a')][_0xc2bb('0x2d')]));_0x2f033a[_0xc2bb('0x2c')]=_0x2f033a[_0xc2bb('0x2c')][_0xc2bb('0x3d')]?_0x2f033a[_0xc2bb('0x2c')]:_0x97e409['model'];if(_0x114963[_0xc2bb('0x2a')][_0xc2bb('0x39')]){_0x2f033a['include']=[{'all':!![]}];}_0x2f033a=_[_0xc2bb('0x34')]({},_0x2f033a,_0x114963['options']);return db['SACompanyType'][_0xc2bb('0x3e')](_0x2f033a)[_0xc2bb('0x22')](handleEntityNotFound(_0x8fc77b,null))[_0xc2bb('0x22')](respondWithResult(_0x8fc77b,null))[_0xc2bb('0x3f')](handleError(_0x8fc77b,null));};exports[_0xc2bb('0x40')]=function(_0x79ca9f,_0x4c3eca){return db[_0xc2bb('0x26')][_0xc2bb('0x40')](_0x79ca9f[_0xc2bb('0x41')],{})[_0xc2bb('0x22')](respondWithResult(_0x4c3eca,0xc9))['catch'](handleError(_0x4c3eca,null));};exports[_0xc2bb('0x21')]=function(_0x5a80e8,_0x4f874d){if(_0x5a80e8['body']['id']){delete _0x5a80e8[_0xc2bb('0x41')]['id'];}return db['SACompanyType'][_0xc2bb('0x3e')]({'where':{'id':_0x5a80e8[_0xc2bb('0x3c')]['id']}})[_0xc2bb('0x22')](handleEntityNotFound(_0x4f874d,null))[_0xc2bb('0x22')](saveUpdates(_0x5a80e8[_0xc2bb('0x41')],null))[_0xc2bb('0x22')](respondWithResult(_0x4f874d,null))[_0xc2bb('0x3f')](handleError(_0x4f874d,null));};exports[_0xc2bb('0x23')]=function(_0x2cefe8,_0x38e38c){return db[_0xc2bb('0x26')][_0xc2bb('0x3e')]({'where':{'id':_0x2cefe8[_0xc2bb('0x3c')]['id']}})[_0xc2bb('0x22')](handleEntityNotFound(_0x38e38c,null))[_0xc2bb('0x22')](removeEntity(_0x38e38c,null))[_0xc2bb('0x3f')](handleError(_0x38e38c,null));};exports[_0xc2bb('0x42')]=function(_0xd51d13,_0x1164e3){return db[_0xc2bb('0x26')]['describe']()[_0xc2bb('0x22')](respondWithResult(_0x1164e3,null))[_0xc2bb('0x3f')](handleError(_0x1164e3,null));}; \ No newline at end of file +var _0x3777=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','SACompanyType','count','includeAll','include','findAll','catch','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x3777,0x83));var _0x7377=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3777[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7377('0x0'));var rimraf=require(_0x7377('0x1'));var zipdir=require(_0x7377('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7377('0x3'));var moment=require(_0x7377('0x4'));var BPromise=require(_0x7377('0x5'));var Mustache=require(_0x7377('0x6'));var util=require(_0x7377('0x7'));var path=require(_0x7377('0x8'));var sox=require(_0x7377('0x9'));var csv=require(_0x7377('0xa'));var ejs=require(_0x7377('0xb'));var fs=require('fs');var _=require(_0x7377('0xc'));var squel=require('squel');var crypto=require(_0x7377('0xd'));var jsforce=require(_0x7377('0xe'));var deskjs=require(_0x7377('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7377('0x10'));var Papa=require(_0x7377('0x11'));var Redis=require(_0x7377('0x12'));var authService=require(_0x7377('0x13'));var qs=require(_0x7377('0x14'));var hardwareService=require(_0x7377('0x15'));var logger=require(_0x7377('0x16'))(_0x7377('0x17'));var utils=require(_0x7377('0x18'));var config=require(_0x7377('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3608a2,_0x466ae7){_0x466ae7=_0x466ae7||0xcc;return function(_0x1f854c){if(_0x1f854c){return _0x3608a2['sendStatus'](_0x466ae7);}return _0x3608a2[_0x7377('0x1a')](_0x466ae7)[_0x7377('0x1b')]();};}function respondWithResult(_0x2bbde3,_0x556221){_0x556221=_0x556221||0xc8;return function(_0x5cfe75){if(_0x5cfe75){return _0x2bbde3['status'](_0x556221)[_0x7377('0x1c')](_0x5cfe75);}};}function respondWithFilteredResult(_0x50f8f3,_0x5013a4){return function(_0x300c67){if(_0x300c67){var _0x5b9a77=_0x300c67['count'],_0x4c86f2=_0x5013a4[_0x7377('0x1d')],_0x29061b=_0x5013a4[_0x7377('0x1d')]+_0x5013a4['limit'],_0x1f1c94;if(_0x29061b>=_0x5b9a77){_0x29061b=_0x5b9a77;_0x1f1c94=0xc8;}else{_0x1f1c94=0xce;}_0x50f8f3[_0x7377('0x1a')](_0x1f1c94);return _0x50f8f3[_0x7377('0x1e')](_0x7377('0x1f'),_0x4c86f2+'-'+_0x29061b+'/'+_0x5b9a77)[_0x7377('0x1c')](_0x300c67);}return null;};}function patchUpdates(_0x14edd2){return function(_0x4e5b85){try{jsonpatch[_0x7377('0x20')](_0x4e5b85,_0x14edd2,!![]);}catch(_0x18a394){return BPromise[_0x7377('0x21')](_0x18a394);}return _0x4e5b85['save']();};}function saveUpdates(_0x47ced1,_0x30396a){return function(_0x237004){if(_0x237004){return _0x237004['update'](_0x47ced1)[_0x7377('0x22')](function(_0x4d0b2e){return _0x4d0b2e;});}return null;};}function removeEntity(_0x1f1ede,_0x3f6c82){return function(_0x1df37d){if(_0x1df37d){return _0x1df37d[_0x7377('0x23')]()[_0x7377('0x22')](function(){_0x1f1ede[_0x7377('0x1a')](0xcc)[_0x7377('0x1b')]();});}};}function handleEntityNotFound(_0x3f6232,_0x435819){return function(_0x336d8a){if(!_0x336d8a){_0x3f6232[_0x7377('0x24')](0x194);}return _0x336d8a;};}function handleError(_0x4eea30,_0x5b1f40){_0x5b1f40=_0x5b1f40||0x1f4;return function(_0x228b90){logger[_0x7377('0x25')](_0x228b90['stack']);if(_0x228b90['name']){delete _0x228b90[_0x7377('0x26')];}_0x4eea30['status'](_0x5b1f40)[_0x7377('0x27')](_0x228b90);};}exports[_0x7377('0x28')]=function(_0x5372e2,_0x440cc1){var _0x4f194e={},_0x58ece8={},_0x424507={'count':0x0,'rows':[]};var _0x3dc7ae=db['SACompanyType'][_0x7377('0x29')];_0x58ece8[_0x7377('0x2a')]=_[_0x7377('0x2b')](_0x3dc7ae);_0x58ece8[_0x7377('0x2c')]=_[_0x7377('0x2b')](_0x5372e2[_0x7377('0x2c')]);_0x58ece8[_0x7377('0x2d')]=_['intersection'](_0x58ece8[_0x7377('0x2a')],_0x58ece8[_0x7377('0x2c')]);_0x4f194e['attributes']=_['intersection'](_0x58ece8[_0x7377('0x2a')],qs[_0x7377('0x2e')](_0x5372e2[_0x7377('0x2c')][_0x7377('0x2e')]));_0x4f194e[_0x7377('0x2f')]=_0x4f194e['attributes'][_0x7377('0x30')]?_0x4f194e[_0x7377('0x2f')]:_0x58ece8[_0x7377('0x2a')];if(!_0x5372e2[_0x7377('0x2c')]['hasOwnProperty'](_0x7377('0x31'))){_0x4f194e[_0x7377('0x32')]=qs['limit'](_0x5372e2[_0x7377('0x2c')][_0x7377('0x32')]);_0x4f194e[_0x7377('0x1d')]=qs['offset'](_0x5372e2[_0x7377('0x2c')][_0x7377('0x1d')]);}_0x4f194e[_0x7377('0x33')]=qs[_0x7377('0x34')](_0x5372e2[_0x7377('0x2c')][_0x7377('0x34')]);_0x4f194e[_0x7377('0x35')]=qs['filters'](_[_0x7377('0x36')](_0x5372e2[_0x7377('0x2c')],_0x58ece8['filters']));if(_0x5372e2[_0x7377('0x2c')][_0x7377('0x37')]){_0x4f194e['where']=_[_0x7377('0x38')](_0x4f194e[_0x7377('0x35')],{'$or':_[_0x7377('0x39')](_0x3dc7ae,function(_0x2caaf1){if(_0x2caaf1[_0x7377('0x3a')][_0x7377('0x3b')]!==_0x7377('0x3c')){var _0x27d942={};_0x27d942[_0x2caaf1[_0x7377('0x3d')]]={'$like':'%'+_0x5372e2[_0x7377('0x2c')][_0x7377('0x37')]+'%'};return _0x27d942;}})});}_0x4f194e=_['merge']({},_0x4f194e,_0x5372e2[_0x7377('0x3e')]);var _0x158245={'where':_0x4f194e[_0x7377('0x35')]};return db[_0x7377('0x3f')][_0x7377('0x40')](_0x158245)[_0x7377('0x22')](function(_0x299bc9){_0x424507[_0x7377('0x40')]=_0x299bc9;if(_0x5372e2[_0x7377('0x2c')][_0x7377('0x41')]){_0x4f194e[_0x7377('0x42')]=[{'all':!![]}];}return db[_0x7377('0x3f')][_0x7377('0x43')](_0x4f194e);})[_0x7377('0x22')](function(_0x328237){_0x424507['rows']=_0x328237;return _0x424507;})[_0x7377('0x22')](respondWithFilteredResult(_0x440cc1,_0x4f194e))[_0x7377('0x44')](handleError(_0x440cc1,null));};exports['show']=function(_0x961fcc,_0x374c20){var _0x4b0582={'raw':![],'where':{'id':_0x961fcc[_0x7377('0x45')]['id']}},_0x50ecc5={};_0x50ecc5[_0x7377('0x2a')]=_[_0x7377('0x2b')](db[_0x7377('0x3f')][_0x7377('0x29')]);_0x50ecc5[_0x7377('0x2c')]=_[_0x7377('0x2b')](_0x961fcc[_0x7377('0x2c')]);_0x50ecc5[_0x7377('0x2d')]=_[_0x7377('0x46')](_0x50ecc5['model'],_0x50ecc5[_0x7377('0x2c')]);_0x4b0582[_0x7377('0x2f')]=_[_0x7377('0x46')](_0x50ecc5[_0x7377('0x2a')],qs[_0x7377('0x2e')](_0x961fcc[_0x7377('0x2c')][_0x7377('0x2e')]));_0x4b0582['attributes']=_0x4b0582[_0x7377('0x2f')]['length']?_0x4b0582[_0x7377('0x2f')]:_0x50ecc5[_0x7377('0x2a')];if(_0x961fcc[_0x7377('0x2c')]['includeAll']){_0x4b0582[_0x7377('0x42')]=[{'all':!![]}];}_0x4b0582=_[_0x7377('0x38')]({},_0x4b0582,_0x961fcc[_0x7377('0x3e')]);return db[_0x7377('0x3f')][_0x7377('0x47')](_0x4b0582)[_0x7377('0x22')](handleEntityNotFound(_0x374c20,null))['then'](respondWithResult(_0x374c20,null))['catch'](handleError(_0x374c20,null));};exports[_0x7377('0x48')]=function(_0x1e1776,_0x4e8969){return db[_0x7377('0x3f')][_0x7377('0x48')](_0x1e1776[_0x7377('0x49')],{})[_0x7377('0x22')](respondWithResult(_0x4e8969,0xc9))[_0x7377('0x44')](handleError(_0x4e8969,null));};exports['update']=function(_0x3683ae,_0x3b17d1){if(_0x3683ae['body']['id']){delete _0x3683ae[_0x7377('0x49')]['id'];}return db[_0x7377('0x3f')]['find']({'where':{'id':_0x3683ae[_0x7377('0x45')]['id']}})[_0x7377('0x22')](handleEntityNotFound(_0x3b17d1,null))[_0x7377('0x22')](saveUpdates(_0x3683ae[_0x7377('0x49')],null))[_0x7377('0x22')](respondWithResult(_0x3b17d1,null))[_0x7377('0x44')](handleError(_0x3b17d1,null));};exports['destroy']=function(_0x1d3db0,_0x4aade4){return db[_0x7377('0x3f')][_0x7377('0x47')]({'where':{'id':_0x1d3db0[_0x7377('0x45')]['id']}})['then'](handleEntityNotFound(_0x4aade4,null))[_0x7377('0x22')](removeEntity(_0x4aade4,null))[_0x7377('0x44')](handleError(_0x4aade4,null));};exports[_0x7377('0x4a')]=function(_0x1868e0,_0x513169){return db[_0x7377('0x3f')]['describe']()[_0x7377('0x22')](respondWithResult(_0x513169,null))[_0x7377('0x44')](handleError(_0x513169,null));}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.model.js b/server/api/saCompanyType/saCompanyType.model.js index bbf3335..d6cb55c 100644 --- a/server/api/saCompanyType/saCompanyType.model.js +++ b/server/api/saCompanyType/saCompanyType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff41=['define','SACompanyType','sa_company_types','lodash','../../config/logger','bluebird','request-promise','path','rimraf','exports'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0xff41,0x157));var _0x1ff4=function(_0x4e5215,_0x40374f){_0x4e5215=_0x4e5215-0x0;var _0x44e904=_0xff41[_0x4e5215];return _0x44e904;};'use strict';var _=require(_0x1ff4('0x0'));var util=require('util');var logger=require(_0x1ff4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1ff4('0x2'));var rp=require(_0x1ff4('0x3'));var fs=require('fs');var path=require(_0x1ff4('0x4'));var rimraf=require(_0x1ff4('0x5'));var config=require('../../config/environment');var attributes=require('./saCompanyType.attributes');module[_0x1ff4('0x6')]=function(_0xd96370,_0x12f024){return _0xd96370[_0x1ff4('0x7')](_0x1ff4('0x8'),attributes,{'tableName':_0x1ff4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd741=['bluebird','path','../../config/environment','./saCompanyType.attributes','exports','SACompanyType','util','api'];(function(_0x300374,_0x21e270){var _0x96b875=function(_0x15f3ef){while(--_0x15f3ef){_0x300374['push'](_0x300374['shift']());}};_0x96b875(++_0x21e270);}(_0xd741,0x136));var _0x1d74=function(_0xfceed5,_0x4ba32f){_0xfceed5=_0xfceed5-0x0;var _0x423ae3=_0xd741[_0xfceed5];return _0x423ae3;};'use strict';var _=require('lodash');var util=require(_0x1d74('0x0'));var logger=require('../../config/logger')(_0x1d74('0x1'));var moment=require('moment');var BPromise=require(_0x1d74('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d74('0x3'));var rimraf=require('rimraf');var config=require(_0x1d74('0x4'));var attributes=require(_0x1d74('0x5'));module[_0x1d74('0x6')]=function(_0x5b890b,_0x1c4f1b){return _0x5b890b['define'](_0x1d74('0x7'),attributes,{'tableName':'sa_company_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.rpc.js b/server/api/saCompanyType/saCompanyType.rpc.js index f54b5f9..2107feb 100644 --- a/server/api/saCompanyType/saCompanyType.rpc.js +++ b/server/api/saCompanyType/saCompanyType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeef7=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','request','then','info','SACompanyType,\x20%s,\x20%s','request\x20sent','debug','SACompanyType,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x28a8ea,_0x43e163){var _0x2f6276=function(_0x17c12e){while(--_0x17c12e){_0x28a8ea['push'](_0x28a8ea['shift']());}};_0x2f6276(++_0x43e163);}(_0xeef7,0x7d));var _0x7eef=function(_0x418082,_0x22f950){_0x418082=_0x418082-0x0;var _0x3a57b5=_0xeef7[_0x418082];return _0x3a57b5;};'use strict';var _=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var moment=require('moment');var BPromise=require(_0x7eef('0x2'));var rs=require(_0x7eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7eef('0x4'))(_0x7eef('0x5'));var config=require(_0x7eef('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x378a20,_0x4261aa,_0x4283d3){return new BPromise(function(_0x51bca2,_0x3c3c2b){return client[_0x7eef('0x7')](_0x378a20,_0x4283d3)[_0x7eef('0x8')](function(_0x16c390){logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));logger[_0x7eef('0xc')](_0x7eef('0xd'),_0x4261aa,'request\x20sent',JSON[_0x7eef('0xe')](_0x16c390));if(_0x16c390[_0x7eef('0xf')]){if(_0x16c390[_0x7eef('0xf')][_0x7eef('0x10')]===0x1f4){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390[_0x7eef('0xf')]['message']);return _0x3c3c2b(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390['error']['message']);return _0x51bca2(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}else{logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));_0x51bca2(_0x16c390[_0x7eef('0x12')][_0x7eef('0x11')]);}})[_0x7eef('0x13')](function(_0x263c33){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x263c33);_0x3c3c2b(_0x263c33);});});} \ No newline at end of file +var _0xdc91=['client','http','request','then','info','SACompanyType,\x20%s,\x20%s','request\x20sent','SACompanyType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50bd70,_0x591c82){var _0x28a60d=function(_0x13a45b){while(--_0x13a45b){_0x50bd70['push'](_0x50bd70['shift']());}};_0x28a60d(++_0x591c82);}(_0xdc91,0x8b));var _0x1dc9=function(_0x25aad3,_0x324dfc){_0x25aad3=_0x25aad3-0x0;var _0x404146=_0xdc91[_0x25aad3];return _0x404146;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});} \ No newline at end of file diff --git a/server/api/saCreditNote/index.js b/server/api/saCreditNote/index.js index ded00f9..c2a4d8a 100644 --- a/server/api/saCreditNote/index.js +++ b/server/api/saCreditNote/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./saCreditNote.controller','get','isAuthenticated','/describe','/:id','/:id/download','getCreditnotePDF','post','update'];(function(_0x5572b7,_0x244036){var _0x1bc232=function(_0x338cc0){while(--_0x338cc0){_0x5572b7['push'](_0x5572b7['shift']());}};_0x1bc232(++_0x244036);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0xa9e0=['delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./saCreditNote.controller','get','isAuthenticated','/describe','/:id','/:id/download','getCreditnotePDF','post','update'];(function(_0x36a8dd,_0x18263b){var _0x306e43=function(_0xe899c0){while(--_0xe899c0){_0x36a8dd['push'](_0x36a8dd['shift']());}};_0x306e43(++_0x18263b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.attributes.js b/server/api/saCreditNote/saCreditNote.attributes.js index 4fc8efc..01198b8 100644 --- a/server/api/saCreditNote/saCreditNote.attributes.js +++ b/server/api/saCreditNote/saCreditNote.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf174=['STRING','DECIMAL','BOOLEAN','DATE','sequelize','exports','INTEGER','TEXT'];(function(_0x4ec65a,_0x33a77d){var _0x4b73ab=function(_0x454617){while(--_0x454617){_0x4ec65a['push'](_0x4ec65a['shift']());}};_0x4b73ab(++_0x33a77d);}(_0xf174,0x1c4));var _0x4f17=function(_0xa37c9c,_0x3de9e8){_0xa37c9c=_0xa37c9c-0x0;var _0x2bdb44=_0xf174[_0xa37c9c];return _0x2bdb44;};'use strict';var Sequelize=require(_0x4f17('0x0'));module[_0x4f17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'InvoiceId':{'type':Sequelize[_0x4f17('0x2')]},'note':{'type':Sequelize[_0x4f17('0x3')]},'agentFullname':{'type':Sequelize[_0x4f17('0x4')]},'status':{'type':Sequelize[_0x4f17('0x3')]},'companyName':{'type':Sequelize[_0x4f17('0x4')],'allowNull':![]},'companyId':{'type':Sequelize[_0x4f17('0x2')],'allowNull':![]},'paid':{'type':Sequelize[_0x4f17('0x2')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x4f17('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x4f17('0x4')]},'receivingPostalCode':{'type':Sequelize[_0x4f17('0x4')]},'receivingCity':{'type':Sequelize[_0x4f17('0x4')]},'receivingCountry':{'type':Sequelize['STRING']},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x4f17('0x4')](0x32)},'receivingPIVA':{'type':Sequelize[_0x4f17('0x4')](0x32)},'receivingSDICode':{'type':Sequelize[_0x4f17('0x4')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x4f17('0x4')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x4f17('0x2')]},'receivingEurope':{'type':Sequelize[_0x4f17('0x6')]},'receivingSocCap':{'type':Sequelize[_0x4f17('0x4')](0xff)},'issuerName':{'type':Sequelize[_0x4f17('0x4')]},'issuerStreet':{'type':Sequelize[_0x4f17('0x4')]},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize[_0x4f17('0x4')]},'issuerCountry':{'type':Sequelize['STRING']},'issuerISOCode':{'type':Sequelize[_0x4f17('0x4')](0x3)},'issuerFiscalCode':{'type':Sequelize['STRING'](0x32)},'issuerPIVA':{'type':Sequelize[_0x4f17('0x4')](0x32)},'issuerSDICode':{'type':Sequelize['STRING'](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x4f17('0x4')]},'issuerExpiryDay':{'type':Sequelize[_0x4f17('0x2')]},'issuerEurope':{'type':Sequelize[_0x4f17('0x6')]},'issuerSocCap':{'type':Sequelize[_0x4f17('0x4')](0xff)},'issuerBankAccount':{'type':Sequelize['STRING'](0xff)},'issuerBankName':{'type':Sequelize[_0x4f17('0x4')](0xff)},'issuerBankStreet':{'type':Sequelize['STRING']},'issuerBankPostalCode':{'type':Sequelize[_0x4f17('0x4')]},'issuerBankCity':{'type':Sequelize[_0x4f17('0x4')]},'issuerBankCountry':{'type':Sequelize['STRING']},'issuerBankBICSWIFT':{'type':Sequelize[_0x4f17('0x4')]},'issuerBankIBAN':{'type':Sequelize['STRING']},'issuerPhone':{'type':Sequelize['STRING']},'issuerFax':{'type':Sequelize[_0x4f17('0x4')]},'issuerEmail':{'type':Sequelize[_0x4f17('0x4')]},'issuerWeb':{'type':Sequelize['STRING']},'issuerABI':{'type':Sequelize[_0x4f17('0x4')]},'issuerCAB':{'type':Sequelize[_0x4f17('0x4')]},'issuerPayPal':{'type':Sequelize[_0x4f17('0x4')]},'startDate':{'type':Sequelize[_0x4f17('0x7')]},'endDate':{'type':Sequelize[_0x4f17('0x7')]},'beginningCompetence':{'type':Sequelize[_0x4f17('0x7')]},'endCompetence':{'type':Sequelize[_0x4f17('0x7')]},'clientCode':{'type':Sequelize[_0x4f17('0x4')]},'number':{'type':Sequelize[_0x4f17('0x2')]}}; \ No newline at end of file +var _0xb5c8=['TEXT','INTEGER','DECIMAL','BOOLEAN','DATE','sequelize','exports','STRING'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xb5c8,0x10d));var _0x8b5c=function(_0x41a4bb,_0x36b115){_0x41a4bb=_0x41a4bb-0x0;var _0x4d4239=_0xb5c8[_0x41a4bb];return _0x4d4239;};'use strict';var Sequelize=require(_0x8b5c('0x0'));module[_0x8b5c('0x1')]={'name':{'type':Sequelize[_0x8b5c('0x2')],'allowNull':![]},'InvoiceId':{'type':Sequelize['INTEGER']},'note':{'type':Sequelize[_0x8b5c('0x3')]},'agentFullname':{'type':Sequelize[_0x8b5c('0x2')]},'status':{'type':Sequelize[_0x8b5c('0x3')]},'companyName':{'type':Sequelize[_0x8b5c('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x8b5c('0x4')],'allowNull':![]},'paid':{'type':Sequelize[_0x8b5c('0x4')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x8b5c('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x8b5c('0x2')]},'receivingPostalCode':{'type':Sequelize['STRING']},'receivingCity':{'type':Sequelize[_0x8b5c('0x2')]},'receivingCountry':{'type':Sequelize[_0x8b5c('0x2')]},'receivingISOCode':{'type':Sequelize[_0x8b5c('0x2')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x8b5c('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0x8b5c('0x2')](0x32)},'receivingSDICode':{'type':Sequelize['STRING'](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x8b5c('0x2')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x8b5c('0x4')]},'receivingEurope':{'type':Sequelize['BOOLEAN']},'receivingSocCap':{'type':Sequelize[_0x8b5c('0x2')](0xff)},'issuerName':{'type':Sequelize[_0x8b5c('0x2')]},'issuerStreet':{'type':Sequelize[_0x8b5c('0x2')]},'issuerPostalCode':{'type':Sequelize[_0x8b5c('0x2')]},'issuerCity':{'type':Sequelize[_0x8b5c('0x2')]},'issuerCountry':{'type':Sequelize[_0x8b5c('0x2')]},'issuerISOCode':{'type':Sequelize[_0x8b5c('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x8b5c('0x2')](0x32)},'issuerPIVA':{'type':Sequelize[_0x8b5c('0x2')](0x32)},'issuerSDICode':{'type':Sequelize[_0x8b5c('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x8b5c('0x2')]},'issuerExpiryDay':{'type':Sequelize[_0x8b5c('0x4')]},'issuerEurope':{'type':Sequelize[_0x8b5c('0x6')]},'issuerSocCap':{'type':Sequelize[_0x8b5c('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x8b5c('0x2')](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize[_0x8b5c('0x2')]},'issuerBankPostalCode':{'type':Sequelize[_0x8b5c('0x2')]},'issuerBankCity':{'type':Sequelize[_0x8b5c('0x2')]},'issuerBankCountry':{'type':Sequelize['STRING']},'issuerBankBICSWIFT':{'type':Sequelize[_0x8b5c('0x2')]},'issuerBankIBAN':{'type':Sequelize['STRING']},'issuerPhone':{'type':Sequelize[_0x8b5c('0x2')]},'issuerFax':{'type':Sequelize[_0x8b5c('0x2')]},'issuerEmail':{'type':Sequelize['STRING']},'issuerWeb':{'type':Sequelize[_0x8b5c('0x2')]},'issuerABI':{'type':Sequelize['STRING']},'issuerCAB':{'type':Sequelize[_0x8b5c('0x2')]},'issuerPayPal':{'type':Sequelize[_0x8b5c('0x2')]},'startDate':{'type':Sequelize[_0x8b5c('0x7')]},'endDate':{'type':Sequelize['DATE']},'beginningCompetence':{'type':Sequelize['DATE']},'endCompetence':{'type':Sequelize[_0x8b5c('0x7')]},'clientCode':{'type':Sequelize[_0x8b5c('0x2')]},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.controller.js b/server/api/saCreditNote/saCreditNote.controller.js index ac21c25..3d8f757 100644 --- a/server/api/saCreditNote/saCreditNote.controller.js +++ b/server/api/saCreditNote/saCreditNote.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7de=['../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','SACreditNote','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','where','merge','type','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','update','find','describe','toString','join','root','server','tmp','files','images','logo-invoice.png','paid-invoice.png','format','Credinote_%s-%s.pdf','SACreditNoteDetail','details','portrait','10mm','{{page}}/{{pages}}','contents','default','footer','','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','Phone','Telefono','Fax','Email','VAT\x20number','P.IVA','C.F.','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Scadenza','Item','Articolo','Description','Descrizione','Hrs/Qty','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Subtotal','Imponibile','Total','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','','\x20','','\x20%s
','creditnote','issuerName','%s
','issuerStreet','\x20%s','-\x20%s\x20
','issuerCountry','fax',':\x20%s
','email','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSocCap','','','','%s','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingFiscalCode','receivingSDICode','','','','%s,\x20','issuerCity','updatedAt','%s\x20','saExpiryDay','DD/MM/YYYY','','','','item','','description','hrsqty','subtotal','netPrice','discount','tax','quantity','%s','productName','%d','','toFixed','\x20€','','isNil','receivingFiscalMessage','indexOf','split\x20payment','','\x20','','','','\x20',' ','\x20%s\x20','replace','','','sendpayment',':','issuerBankAccount','accountholder',':\x20','bankname','issuerBankName','\x20','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCountry','','abi','cab','issuerABI','issuerCAB','bic','iban','paypal','issuerPayPal','thank1','','','thank2','','','','toFile','log','TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName','err','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5a3339,_0x49273c){var _0x243c5b=function(_0x2f4638){while(--_0x2f4638){_0x5a3339['push'](_0x5a3339['shift']());}};_0x243c5b(++_0x49273c);}(_0xf7de,0x1e8));var _0xef7d=function(_0xb92c08,_0x25c6ad){_0xb92c08=_0xb92c08-0x0;var _0x361491=_0xf7de[_0xb92c08];return _0x361491;};'use strict';var pdf=require(_0xef7d('0x0'));var emlformat=require(_0xef7d('0x1'));var rimraf=require(_0xef7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef7d('0x3'));var rp=require('request-promise');var moment=require(_0xef7d('0x4'));var BPromise=require(_0xef7d('0x5'));var Mustache=require('mustache');var util=require(_0xef7d('0x6'));var path=require(_0xef7d('0x7'));var sox=require('sox');var csv=require(_0xef7d('0x8'));var ejs=require(_0xef7d('0x9'));var fs=require('fs');var _=require(_0xef7d('0xa'));var squel=require('squel');var crypto=require(_0xef7d('0xb'));var jsforce=require(_0xef7d('0xc'));var deskjs=require(_0xef7d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xef7d('0xe'));var Papa=require('papaparse');var Redis=require(_0xef7d('0xf'));var authService=require(_0xef7d('0x10'));var qs=require(_0xef7d('0x11'));var hardwareService=require(_0xef7d('0x12'));var logger=require(_0xef7d('0x13'))(_0xef7d('0x14'));var utils=require(_0xef7d('0x15'));var config=require(_0xef7d('0x16'));var db=require(_0xef7d('0x17'))['db'];function respondWithStatusCode(_0x32beb3,_0x5543fa){_0x5543fa=_0x5543fa||0xcc;return function(_0x2a4169){if(_0x2a4169){return _0x32beb3[_0xef7d('0x18')](_0x5543fa);}return _0x32beb3[_0xef7d('0x19')](_0x5543fa)['end']();};}function respondWithResult(_0x316de6,_0x28711f){_0x28711f=_0x28711f||0xc8;return function(_0x44b95c){if(_0x44b95c){return _0x316de6[_0xef7d('0x19')](_0x28711f)['json'](_0x44b95c);}};}function respondWithFilteredResult(_0x4fb4ce,_0x2b3180){return function(_0x52fd69){if(_0x52fd69){var _0x5729f5=_0x52fd69[_0xef7d('0x1a')],_0x2bab5d=_0x2b3180[_0xef7d('0x1b')],_0x9a3313=_0x2b3180['offset']+_0x2b3180[_0xef7d('0x1c')],_0x493d32;if(_0x9a3313>=_0x5729f5){_0x9a3313=_0x5729f5;_0x493d32=0xc8;}else{_0x493d32=0xce;}_0x4fb4ce['status'](_0x493d32);return _0x4fb4ce['set'](_0xef7d('0x1d'),_0x2bab5d+'-'+_0x9a3313+'/'+_0x5729f5)[_0xef7d('0x1e')](_0x52fd69);}return null;};}function patchUpdates(_0x38395f){return function(_0x26f971){try{jsonpatch[_0xef7d('0x1f')](_0x26f971,_0x38395f,!![]);}catch(_0x1b6bf4){return BPromise[_0xef7d('0x20')](_0x1b6bf4);}return _0x26f971[_0xef7d('0x21')]();};}function saveUpdates(_0x36c58a,_0x3c7827){return function(_0x3e1a7d){if(_0x3e1a7d){return _0x3e1a7d['update'](_0x36c58a)[_0xef7d('0x22')](function(_0x4f0763){return _0x4f0763;});}return null;};}function removeEntity(_0x34eac0,_0xc84416){return function(_0xa2e26a){if(_0xa2e26a){return _0xa2e26a[_0xef7d('0x23')]()[_0xef7d('0x22')](function(){_0x34eac0[_0xef7d('0x19')](0xcc)[_0xef7d('0x24')]();});}};}function handleEntityNotFound(_0x37ae50,_0x3966aa){return function(_0x55f332){if(!_0x55f332){_0x37ae50[_0xef7d('0x18')](0x194);}return _0x55f332;};}function handleError(_0x56ec0a,_0x4e6374){_0x4e6374=_0x4e6374||0x1f4;return function(_0x59ea10){logger['error'](_0x59ea10[_0xef7d('0x25')]);if(_0x59ea10[_0xef7d('0x26')]){delete _0x59ea10['name'];}_0x56ec0a[_0xef7d('0x19')](_0x4e6374)[_0xef7d('0x27')](_0x59ea10);};}exports[_0xef7d('0x28')]=function(_0x431506,_0x7e97df){var _0x1314b5={},_0x34ae17={},_0x256f5a={'count':0x0,'rows':[]};var _0x5cc748=db[_0xef7d('0x29')]['rawAttributes'];_0x34ae17[_0xef7d('0x2a')]=_[_0xef7d('0x2b')](_0x5cc748);_0x34ae17[_0xef7d('0x2c')]=_[_0xef7d('0x2b')](_0x431506[_0xef7d('0x2c')]);_0x34ae17['filters']=_[_0xef7d('0x2d')](_0x34ae17['model'],_0x34ae17[_0xef7d('0x2c')]);_0x1314b5[_0xef7d('0x2e')]=_[_0xef7d('0x2d')](_0x34ae17[_0xef7d('0x2a')],qs[_0xef7d('0x2f')](_0x431506[_0xef7d('0x2c')][_0xef7d('0x2f')]));_0x1314b5[_0xef7d('0x2e')]=_0x1314b5[_0xef7d('0x2e')][_0xef7d('0x30')]?_0x1314b5[_0xef7d('0x2e')]:_0x34ae17[_0xef7d('0x2a')];if(!_0x431506[_0xef7d('0x2c')]['hasOwnProperty'](_0xef7d('0x31'))){_0x1314b5[_0xef7d('0x1c')]=qs['limit'](_0x431506[_0xef7d('0x2c')][_0xef7d('0x1c')]);_0x1314b5['offset']=qs['offset'](_0x431506[_0xef7d('0x2c')][_0xef7d('0x1b')]);}_0x1314b5[_0xef7d('0x32')]=qs[_0xef7d('0x33')](_0x431506['query'][_0xef7d('0x33')]);_0x1314b5['where']=qs[_0xef7d('0x34')](_['pick'](_0x431506['query'],_0x34ae17['filters']));if(_0x431506[_0xef7d('0x2c')]['filter']){_0x1314b5[_0xef7d('0x35')]=_[_0xef7d('0x36')](_0x1314b5[_0xef7d('0x35')],{'$or':_['map'](_0x5cc748,function(_0x4c5942){if(_0x4c5942[_0xef7d('0x37')][_0xef7d('0x38')]!==_0xef7d('0x39')){var _0x492763={};_0x492763[_0x4c5942[_0xef7d('0x3a')]]={'$like':'%'+_0x431506[_0xef7d('0x2c')][_0xef7d('0x3b')]+'%'};return _0x492763;}})});}_0x1314b5=_[_0xef7d('0x36')]({},_0x1314b5,_0x431506[_0xef7d('0x3c')]);var _0x38963a={'where':_0x1314b5[_0xef7d('0x35')]};return db['SACreditNote']['count'](_0x38963a)[_0xef7d('0x22')](function(_0x4e7c1d){_0x256f5a['count']=_0x4e7c1d;if(_0x431506['query'][_0xef7d('0x3d')]){_0x1314b5['include']=[{'all':!![]}];}return db['SACreditNote'][_0xef7d('0x3e')](_0x1314b5);})[_0xef7d('0x22')](function(_0x5b827f){_0x256f5a[_0xef7d('0x3f')]=_0x5b827f;return _0x256f5a;})[_0xef7d('0x22')](respondWithFilteredResult(_0x7e97df,_0x1314b5))[_0xef7d('0x40')](handleError(_0x7e97df,null));};exports['show']=function(_0x179f6e,_0x303685){var _0x551e17={'raw':![],'where':{'id':_0x179f6e[_0xef7d('0x41')]['id']}},_0xfa4ca2={};_0xfa4ca2[_0xef7d('0x2a')]=_[_0xef7d('0x2b')](db[_0xef7d('0x29')][_0xef7d('0x42')]);_0xfa4ca2[_0xef7d('0x2c')]=_[_0xef7d('0x2b')](_0x179f6e['query']);_0xfa4ca2[_0xef7d('0x34')]=_['intersection'](_0xfa4ca2[_0xef7d('0x2a')],_0xfa4ca2[_0xef7d('0x2c')]);_0x551e17['attributes']=_['intersection'](_0xfa4ca2[_0xef7d('0x2a')],qs[_0xef7d('0x2f')](_0x179f6e[_0xef7d('0x2c')][_0xef7d('0x2f')]));_0x551e17[_0xef7d('0x2e')]=_0x551e17[_0xef7d('0x2e')][_0xef7d('0x30')]?_0x551e17['attributes']:_0xfa4ca2[_0xef7d('0x2a')];if(_0x179f6e[_0xef7d('0x2c')][_0xef7d('0x3d')]){_0x551e17[_0xef7d('0x43')]=[{'all':!![]}];}_0x551e17=_['merge']({},_0x551e17,_0x179f6e[_0xef7d('0x3c')]);return db['SACreditNote']['find'](_0x551e17)['then'](handleEntityNotFound(_0x303685,null))['then'](respondWithResult(_0x303685,null))[_0xef7d('0x40')](handleError(_0x303685,null));};exports[_0xef7d('0x44')]=function(_0x4646de,_0x173151){return db[_0xef7d('0x29')]['create'](_0x4646de[_0xef7d('0x45')],{})[_0xef7d('0x22')](respondWithResult(_0x173151,0xc9))[_0xef7d('0x40')](handleError(_0x173151,null));};exports[_0xef7d('0x46')]=function(_0xd160de,_0x989707){if(_0xd160de['body']['id']){delete _0xd160de['body']['id'];}return db['SACreditNote']['find']({'where':{'id':_0xd160de[_0xef7d('0x41')]['id']}})[_0xef7d('0x22')](handleEntityNotFound(_0x989707,null))['then'](saveUpdates(_0xd160de[_0xef7d('0x45')],null))['then'](respondWithResult(_0x989707,null))[_0xef7d('0x40')](handleError(_0x989707,null));};exports[_0xef7d('0x23')]=function(_0x1b737e,_0x5cf4fd){return db['SACreditNote'][_0xef7d('0x47')]({'where':{'id':_0x1b737e['params']['id']}})[_0xef7d('0x22')](handleEntityNotFound(_0x5cf4fd,null))[_0xef7d('0x22')](removeEntity(_0x5cf4fd,null))[_0xef7d('0x40')](handleError(_0x5cf4fd,null));};exports['describe']=function(_0x3ffa27,_0x2d2d18){return db[_0xef7d('0x29')][_0xef7d('0x48')]()[_0xef7d('0x22')](respondWithResult(_0x2d2d18,null))[_0xef7d('0x40')](handleError(_0x2d2d18,null));};exports['getCreditnotePDF']=function(_0x3ada2b,_0x3cf151){var _0x5063cd=moment()['unix']()[_0xef7d('0x49')]();var _0x1e0ca1=path[_0xef7d('0x4a')](config[_0xef7d('0x4b')],_0xef7d('0x4c'),'files',_0xef7d('0x4d'));var _0x3bc591=path[_0xef7d('0x4a')](config['root'],_0xef7d('0x4c'),_0xef7d('0x4e'),_0xef7d('0x4f'),'logos',_0xef7d('0x50'));var _0x38e05c=path[_0xef7d('0x4a')](config[_0xef7d('0x4b')],_0xef7d('0x4c'),_0xef7d('0x4e'),'images','logos',_0xef7d('0x51'));var _0x51cdf5=path['join'](_0x1e0ca1,_0x5063cd);var _0xc385ac=util[_0xef7d('0x52')](_0xef7d('0x53'),_0x3ada2b[_0xef7d('0x41')]['id'],_0x5063cd);var _0x39af72=path[_0xef7d('0x4a')](_0x51cdf5,_0xc385ac);var _0x1d284e=![];var _0x231e98={};return db[_0xef7d('0x29')][_0xef7d('0x47')]({'where':{'id':_0x3ada2b[_0xef7d('0x41')]['id']},'raw':!![]})[_0xef7d('0x22')](handleEntityNotFound(_0x3cf151,null))['then'](function(_0x2acafb){if(_0x2acafb){_0x231e98['creditnote']=_0x2acafb;return db[_0xef7d('0x54')][_0xef7d('0x3e')]({'where':{'CreditNoteId':_0x2acafb['id']},'raw':!![],'logging':console['log']})[_0xef7d('0x22')](function(_0x1904db){_0x231e98[_0xef7d('0x55')]=_0x1904db;_0x1d284e=!![];var _0x4af906='';var _0x3baac3={'format':'A4','orientation':_0xef7d('0x56'),'border':'1cm','footer':{'height':_0xef7d('0x57'),'contents':{'default':_0xef7d('0x58')}}};_0x3baac3['footer'][_0xef7d('0x59')][_0xef7d('0x5a')]=_0x3baac3[_0xef7d('0x5b')][_0xef7d('0x59')][_0xef7d('0x5a')]+''+_0x231e98['creditnote']['issuerWeb']+_0xef7d('0x5c');fs[_0xef7d('0x5d')](_0x51cdf5);_0x4af906=_0xef7d('0x5e');_0x4af906+=_0xef7d('0x5f');_0x4af906+='';var _0x5441a8={'phone':{'en':_0xef7d('0x60'),'it':_0xef7d('0x61')},'fax':{'en':'Fax','it':_0xef7d('0x62')},'email':{'en':'Email','it':_0xef7d('0x63')},'piva':{'en':_0xef7d('0x64'),'it':_0xef7d('0x65')},'cf':{'en':'Tax\x20code','it':_0xef7d('0x66')},'sdi':{'en':_0xef7d('0x67'),'it':_0xef7d('0x68')},'cs':{'en':_0xef7d('0x69'),'it':_0xef7d('0x6a')},'invoice':{'en':_0xef7d('0x6b'),'it':_0xef7d('0x6c')},'proforma':{'en':_0xef7d('0x6d'),'it':_0xef7d('0x6d')},'creditnote':{'en':_0xef7d('0x6e'),'it':_0xef7d('0x6f')},'duedate':{'en':_0xef7d('0x70'),'it':_0xef7d('0x71')},'item':{'en':_0xef7d('0x72'),'it':_0xef7d('0x73')},'description':{'en':_0xef7d('0x74'),'it':_0xef7d('0x75')},'hrsqty':{'en':_0xef7d('0x76'),'it':_0xef7d('0x77')},'unitprice':{'en':_0xef7d('0x78'),'it':_0xef7d('0x79')},'subtotal':{'en':_0xef7d('0x7a'),'it':_0xef7d('0x7b')},'discount':{'en':_0xef7d('0x7c'),'it':_0xef7d('0x7d')},'total':{'en':_0xef7d('0x7e'),'it':_0xef7d('0x7f')},'tax':{'en':'Tax','it':'Tasse'},'nettopay':{'en':_0xef7d('0x80'),'it':'Totale'},'sendpayment':{'en':_0xef7d('0x81'),'it':_0xef7d('0x82')},'accountholder':{'en':'Account\x20Holder','it':'Conto\x20intestato\x20a'},'bankname':{'en':_0xef7d('0x83'),'it':_0xef7d('0x84')},'bankaddress':{'en':_0xef7d('0x85'),'it':_0xef7d('0x86')},'abi':{'en':_0xef7d('0x87'),'it':_0xef7d('0x87')},'cab':{'en':_0xef7d('0x88'),'it':'CAB'},'bic':{'en':_0xef7d('0x89'),'it':'BIC'},'swif':{'en':_0xef7d('0x8a'),'it':_0xef7d('0x8a')},'iban':{'en':_0xef7d('0x8b'),'it':_0xef7d('0x8b')},'paypal':{'en':_0xef7d('0x8c'),'it':_0xef7d('0x8d')},'thank1':{'en':_0xef7d('0x8e'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0xef7d('0x8f'),'it':_0xef7d('0x90')}};var _0x2f77cd='it';if(_0x231e98['creditnote'][_0xef7d('0x91')]!==_0xef7d('0x92')){_0x2f77cd='en';}_0x4af906+=_0xef7d('0x93');_0x4af906+=_0xef7d('0x94')+_0x3bc591+_0xef7d('0x95');_0x4af906+=_0xef7d('0x96');_0x4af906+=util['format'](_0xef7d('0x97'),_0x231e98[_0xef7d('0x98')][_0xef7d('0x99')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9a'),_0x231e98[_0xef7d('0x98')][_0xef7d('0x9b')]);_0x4af906+=util[_0xef7d('0x52')]('%s',_0x231e98[_0xef7d('0x98')]['issuerPostalCode']);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9c'),_0x231e98['creditnote']['issuerCity']);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9d'),_0x231e98[_0xef7d('0x98')][_0xef7d('0x9e')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9d'),_0x231e98[_0xef7d('0x98')][_0xef7d('0x9e')]);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8['phone'][_0x2f77cd]+':\x20%s
',_0x231e98['creditnote']['issuerPhone']);_0x4af906+=util['format'](_0x5441a8[_0xef7d('0x9f')][_0x2f77cd]+_0xef7d('0xa0'),_0x231e98[_0xef7d('0x98')]['issuerFax']);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8[_0xef7d('0xa1')][_0x2f77cd]+_0xef7d('0x9a'),_0x231e98[_0xef7d('0x98')][_0xef7d('0xa2')]);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8[_0xef7d('0xa3')][_0x2f77cd]+_0xef7d('0xa0'),_0x231e98[_0xef7d('0x98')][_0xef7d('0xa4')]);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8['cf'][_0x2f77cd]+_0xef7d('0xa0'),_0x231e98['creditnote'][_0xef7d('0xa5')]);_0x4af906+=util['format'](_0x5441a8[_0xef7d('0xa6')][_0x2f77cd]+_0xef7d('0x9a'),_0x231e98[_0xef7d('0x98')]['issuerSDICode']);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8['cs'][_0x2f77cd]+_0xef7d('0xa0'),_0x231e98['creditnote'][_0xef7d('0xa7')]);_0x4af906+=_0xef7d('0xa8');_0x4af906+=_0xef7d('0xa9');_0x4af906+=_0xef7d('0xaa');_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xab'),_0x231e98['creditnote'][_0xef7d('0xac')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9a'),_0x231e98[_0xef7d('0x98')][_0xef7d('0xad')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xae'),_0x231e98[_0xef7d('0x98')][_0xef7d('0xaf')]);_0x4af906+=util['format'](_0xef7d('0x9a'),_0x231e98['creditnote'][_0xef7d('0xb0')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0x9a'),_0x231e98['creditnote'][_0xef7d('0x91')]);_0x4af906+=util['format'](_0xef7d('0xb1')+_0x5441a8['cf'][_0x2f77cd]+':\x20%s
',_0x231e98[_0xef7d('0x98')][_0xef7d('0xb2')]);_0x4af906+=util['format'](_0x5441a8[_0xef7d('0xa3')][_0x2f77cd]+':\x20%s
',_0x231e98[_0xef7d('0x98')]['receivingPIVA']);_0x4af906+=util[_0xef7d('0x52')](_0x5441a8[_0xef7d('0xa6')][_0x2f77cd]+':\x20%s
',_0x231e98['creditnote'][_0xef7d('0xb3')]);_0x4af906+=_0xef7d('0xb4');_0x4af906+=_0xef7d('0xb5');_0x4af906+='';_0x4af906+='';_0x4af906+=util['format'](_0xef7d('0xb6')+_0x5441a8[_0xef7d('0x98')][_0x2f77cd]+'\x20N.%d',_0x2acafb['id']);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xb7'),_0x231e98[_0xef7d('0x98')][_0xef7d('0xb8')]);var _0x4d131e=moment(_0x231e98[_0xef7d('0x98')][_0xef7d('0xb9')])[_0xef7d('0x52')]('DD/MM/YYYY');_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xba'),_0x4d131e);var _0x3744d2=moment(_0x231e98[_0xef7d('0x98')]['updatedAt'])['add'](_0x231e98[_0xef7d('0x98')][_0xef7d('0xbb')],'days')[_0xef7d('0x52')](_0xef7d('0xbc'));_0x4af906+=util[_0xef7d('0x52')](''+_0x5441a8['duedate'][_0x2f77cd]+':\x20%s',_0x3744d2);_0x4af906+=_0xef7d('0xb5');_0x4af906+='';_0x4af906+=_0xef7d('0xbd');_0x4af906+=_0xef7d('0xbe');_0x4af906+='';_0x4af906+=_0xef7d('0xbf')+_0x5441a8[_0xef7d('0xc0')][_0x2f77cd]+_0xef7d('0xc1');_0x4af906+=_0xef7d('0xbf')+_0x5441a8[_0xef7d('0xc2')][_0x2f77cd]+'';_0x4af906+=_0xef7d('0xbf')+_0x5441a8[_0xef7d('0xc3')][_0x2f77cd]+_0xef7d('0xc1');_0x4af906+=_0xef7d('0xbf')+_0x5441a8['unitprice'][_0x2f77cd]+_0xef7d('0xc1');_0x4af906+=_0xef7d('0xbf')+_0x5441a8[_0xef7d('0xc4')][_0x2f77cd]+_0xef7d('0xc1');_0x4af906+='';var _0x56e6b3=0x0;var _0x3c9734=0x0;for(var _0x352fee=0x0;_0x352fee<_0x231e98[_0xef7d('0x55')][_0xef7d('0x30')];_0x352fee++){var _0x52e713=0x0;var _0x4753ec=0x0;var _0x36f760=0x0;var _0x315dc0=0x0;_0x52e713=_0x231e98[_0xef7d('0x55')][_0x352fee][_0xef7d('0xc5')]-_0x231e98[_0xef7d('0x55')][_0x352fee]['netPrice']/0x64*_0x231e98['details'][_0x352fee][_0xef7d('0xc6')];_0x4753ec=_0x52e713/0x64*_0x231e98[_0xef7d('0x55')][_0x352fee][_0xef7d('0xc7')];_0x36f760=_0x52e713*_0x231e98['details'][_0x352fee][_0xef7d('0xc8')];_0x315dc0=_0x4753ec*_0x231e98['details'][_0x352fee]['quantity'];_0x4af906+=_0xef7d('0x96');_0x4af906+=util['format'](_0xef7d('0xc9'),_0x231e98['details'][_0x352fee][_0xef7d('0xca')]);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xc9'),_0x231e98[_0xef7d('0x55')][_0x352fee]['productDescription']);_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xcb'),_0x231e98[_0xef7d('0x55')][_0x352fee][_0xef7d('0xc8')]);_0x4af906+=_0xef7d('0xcc')+_0x52e713[_0xef7d('0xcd')](0x2)+'\x20€';_0x4af906+=_0xef7d('0xcc')+_0x36f760[_0xef7d('0xcd')](0x2)+_0xef7d('0xce');_0x4af906+=_0xef7d('0xb5');_0x56e6b3+=_0x36f760;_0x3c9734+=_0x315dc0;}_0x4af906+=_0xef7d('0xcf');if(!_[_0xef7d('0xd0')](_0x231e98[_0xef7d('0x98')][_0xef7d('0xc6')])){var _0x166fde=0x0;var _0x4fc44f=0x0;var _0x210a39=_0x231e98[_0xef7d('0x98')]['discount']*0x64/_0x56e6b3;for(var _0x352fee=0x0;_0x352fee<_0x231e98[_0xef7d('0x55')][_0xef7d('0x30')];_0x352fee++){var _0x430630=0x0;var _0x1705b6=0x0;var _0x987301=0x0;_0x52e713=_0x231e98[_0xef7d('0x55')][_0x352fee][_0xef7d('0xc5')]-_0x231e98[_0xef7d('0x55')][_0x352fee][_0xef7d('0xc5')]/0x64*_0x231e98[_0xef7d('0x55')][_0x352fee]['discount'];_0x430630=_0x52e713/0x64*_0x210a39;_0x1705b6=_0x52e713-_0x430630;_0x987301=_0x1705b6*_0x231e98[_0xef7d('0x55')][_0x352fee]['quantity'];_0x166fde+=_0x987301;_0x4fc44f+=_0x987301/0x64*_0x231e98[_0xef7d('0x55')][_0x352fee]['tax'];}}var _0x2ce295=0x0;var _0x579318=0x0;var _0x365bf7=![];var _0x46a3ec=_0x231e98[_0xef7d('0x98')][_0xef7d('0xd1')];if(_0x46a3ec[_0xef7d('0xd2')](_0xef7d('0xd3'))!=-0x1){_0x365bf7=!![];}if(!_[_0xef7d('0xd0')](_0x231e98['creditnote']['discount'])){_0x4af906+=_0xef7d('0x96');if(_0x231e98[_0xef7d('0x98')]['discount']>0x0){_0x4af906+=_0xef7d('0xd4')+_0x5441a8[_0xef7d('0xc6')][_0x2f77cd]+'';_0x4af906+=_0xef7d('0xd5')+_0x231e98['creditnote']['discount'][_0xef7d('0xcd')](0x2)+'\x20€';}_0x4af906+=_0xef7d('0xb5');_0x2ce295=_0x4fc44f;_0x579318=_0x166fde;}else{_0x2ce295=_0x3c9734;_0x579318=_0x56e6b3;}if(_0x2ce295>0x0||_0x231e98['creditnote'][_0xef7d('0xc6')]>0x0){_0x4af906+=_0xef7d('0x96');_0x4af906+=_0xef7d('0xd6')+_0x5441a8['total'][_0x2f77cd]+_0xef7d('0xa8');_0x4af906+=_0xef7d('0xcc')+_0x579318[_0xef7d('0xcd')](0x2)+_0xef7d('0xce');_0x4af906+='';}if(_0x2ce295>0x0){_0x4af906+='';_0x4af906+=''+_0x5441a8['tax'][_0x2f77cd]+_0xef7d('0xa8');_0x4af906+=''+_0x2ce295[_0xef7d('0xcd')](0x2)+'\x20€';_0x4af906+='';}_0x4af906+=_0xef7d('0x96');var _0x254ca5;if(_0x365bf7){_0x254ca5=_0x579318;}else{_0x254ca5=_0x579318+_0x2ce295;}_0x4af906+=_0xef7d('0xd7')+_0x5441a8['nettopay'][_0x2f77cd]+_0xef7d('0xd8')+_0x254ca5['toFixed'](0x2)+_0xef7d('0xce');_0x4af906+=_0xef7d('0xd9');_0x4af906+=_0xef7d('0xda');_0x4af906+='';_0x4af906+=_0xef7d('0x96');_0x4af906+=util[_0xef7d('0x52')](_0xef7d('0xdb'),_0x231e98[_0xef7d('0x98')]['receivingFiscalMessage'][_0xef7d('0xdc')](new RegExp(String['fromCharCode'](0xd),'g'),_0xef7d('0xdd')));_0x4af906+='';_0x4af906+='';_0x4af906+=_0xef7d('0xbd');_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xdf')][_0x2f77cd]+_0xef7d('0xe0');if(!_[_0xef7d('0xd0')](_0x231e98[_0xef7d('0x98')][_0xef7d('0xe1')])){_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xe2')][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98[_0xef7d('0x98')][_0xef7d('0xe1')]+'';_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xe4')][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98[_0xef7d('0x98')][_0xef7d('0xe5')]+_0xef7d('0xe6');_0x4af906+=_0xef7d('0xde')+_0x5441a8['bankaddress'][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98['creditnote'][_0xef7d('0xe7')]+',\x20'+_0x231e98[_0xef7d('0x98')][_0xef7d('0xe8')]+_0xef7d('0xe9')+_0x231e98['creditnote']['issuerBankCity']+'\x20('+_0x231e98[_0xef7d('0x98')][_0xef7d('0xea')]+')'+_0xef7d('0xeb');_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xec')][_0x2f77cd]+'/'+_0x5441a8[_0xef7d('0xed')][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98['creditnote'][_0xef7d('0xee')]+'/'+_0x231e98['creditnote'][_0xef7d('0xef')]+_0xef7d('0xeb');_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xf0')][_0x2f77cd]+'/'+_0x5441a8['swif'][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98[_0xef7d('0x98')]['issuerBankBICSWIFT']+_0xef7d('0xeb');_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xf1')][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98[_0xef7d('0x98')]['issuerBankIBAN']+'';}if(!_[_0xef7d('0xd0')](_0x231e98['creditnote']['issuerPayPal'])){_0x4af906+=_0xef7d('0xde')+_0x5441a8[_0xef7d('0xf2')][_0x2f77cd]+_0xef7d('0xe3')+_0x231e98['creditnote'][_0xef7d('0xf3')]+'';}_0x4af906+=''+_0x5441a8[_0xef7d('0xf4')][_0x2f77cd]+_0xef7d('0xf5')+_0x3744d2+_0xef7d('0xf6')+_0x5441a8[_0xef7d('0xf7')][_0x2f77cd]+_0xef7d('0x5c');_0x4af906+=_0xef7d('0xa8');_0x4af906+=_0xef7d('0xb5');_0x4af906+=_0xef7d('0xf8');_0x4af906+=_0xef7d('0xf9');_0x4af906+=_0xef7d('0xfa');return new BPromise(function(_0x66b8f0,_0x3d123b){pdf[_0xef7d('0x44')](_0x4af906,_0x3baac3)[_0xef7d('0xfb')](path['join'](_0x51cdf5,_0xc385ac),function(_0x55a524,_0x58d662){if(_0x55a524)return _0x3d123b(_0x55a524);_0x66b8f0(_0x58d662);});});});}})['then'](function(){if(_0x1d284e){console[_0xef7d('0xfc')](_0xef7d('0xfd'),_0x39af72,_0xc385ac);return _0x3cf151['download'](_0x39af72,_0xc385ac,function(_0x1da70d){if(_0x1da70d){console['log'](_0xef7d('0xfe'),_0x1da70d);}else{console['log']('foldername',_0x51cdf5);rimraf(_0x51cdf5,function(){});}});}else{return _0x3cf151[_0xef7d('0x18')](0xc8);}})[_0xef7d('0x40')](handleError(_0x3cf151,null));}; \ No newline at end of file +var _0xd51c=['VIRTUAL','field','filter','options','count','include','findAll','rows','catch','show','params','fields','length','includeAll','merge','find','create','body','update','destroy','describe','getCreditnotePDF','toString','join','root','server','files','tmp','logos','images','format','Credinote_%s-%s.pdf','1cm','10mm','{{page}}/{{pages}}','footer','contents','default','creditnote','','mkdirSync','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Phone','Telefono','Fax','Email','P.IVA','Tax\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Invoice','Proforma','Credit\x20note','Scadenza','Articolo','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Subtotal','Imponibile','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','\x22\x20width=\x22180\x22>','\x20%s
','issuerName','issuerStreet','issuerPostalCode','\x20%s','-\x20%s\x20
','issuerCountry',':\x20%s
','issuerPhone','fax','email','%s
','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSDICode','','
','','%s','companyName','%s\x20-\x20','','receivingPIVA','','','','','\x20N.%d','%s,\x20','issuerCity','updatedAt','%s\x20','add','days','DD/MM/YYYY','','duedate',':\x20%s','','item','description','','hrsqty','unitprice','subtotal','details','netPrice','discount','tax','quantity','productName','','productDescription','%d','\x20€','toFixed','
%s
','isNil','receivingFiscalMessage','indexOf','','','total','','','nettopay','\x20',' ','','\x20%s\x20','fromCharCode','issuerBankAccount','','','bankname',':\x20','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','issuerABI','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerBankIBAN','paypal','','','thank2','','','toFile','log','TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName','err','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','offset','limit','set','Content-Range','apply','reject','save','then','end','error','stack','status','index','SACreditNote','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','type','key'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xd51c,0x1b0));var _0xcd51=function(_0x3a7eab,_0x5c1bc7){_0x3a7eab=_0x3a7eab-0x0;var _0x6aaba4=_0xd51c[_0x3a7eab];return _0x6aaba4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd51('0x1'));var jsonpatch=require(_0xcd51('0x2'));var rp=require('request-promise');var moment=require(_0xcd51('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcd51('0x4'));var util=require(_0xcd51('0x5'));var path=require(_0xcd51('0x6'));var sox=require('sox');var csv=require(_0xcd51('0x7'));var ejs=require(_0xcd51('0x8'));var fs=require('fs');var _=require(_0xcd51('0x9'));var squel=require(_0xcd51('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd51('0xb'));var toCsv=require(_0xcd51('0x7'));var querystring=require(_0xcd51('0xc'));var Papa=require(_0xcd51('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd51('0xe'));var hardwareService=require(_0xcd51('0xf'));var logger=require(_0xcd51('0x10'))(_0xcd51('0x11'));var utils=require('../../config/utils');var config=require(_0xcd51('0x12'));var db=require(_0xcd51('0x13'))['db'];function respondWithStatusCode(_0x3b5e69,_0x5077f0){_0x5077f0=_0x5077f0||0xcc;return function(_0x387dc8){if(_0x387dc8){return _0x3b5e69[_0xcd51('0x14')](_0x5077f0);}return _0x3b5e69['status'](_0x5077f0)['end']();};}function respondWithResult(_0x3d63c6,_0x93e89a){_0x93e89a=_0x93e89a||0xc8;return function(_0x2e3b92){if(_0x2e3b92){return _0x3d63c6['status'](_0x93e89a)['json'](_0x2e3b92);}};}function respondWithFilteredResult(_0x10adb7,_0x268741){return function(_0x5d7ba7){if(_0x5d7ba7){var _0x40ba3e=_0x5d7ba7['count'],_0x4e8c38=_0x268741[_0xcd51('0x15')],_0x430810=_0x268741['offset']+_0x268741[_0xcd51('0x16')],_0x3580bc;if(_0x430810>=_0x40ba3e){_0x430810=_0x40ba3e;_0x3580bc=0xc8;}else{_0x3580bc=0xce;}_0x10adb7['status'](_0x3580bc);return _0x10adb7[_0xcd51('0x17')](_0xcd51('0x18'),_0x4e8c38+'-'+_0x430810+'/'+_0x40ba3e)['json'](_0x5d7ba7);}return null;};}function patchUpdates(_0x3afed1){return function(_0x16b807){try{jsonpatch[_0xcd51('0x19')](_0x16b807,_0x3afed1,!![]);}catch(_0x182a07){return BPromise[_0xcd51('0x1a')](_0x182a07);}return _0x16b807[_0xcd51('0x1b')]();};}function saveUpdates(_0x8f5567,_0x13449e){return function(_0x4cda02){if(_0x4cda02){return _0x4cda02['update'](_0x8f5567)[_0xcd51('0x1c')](function(_0x2bf16e){return _0x2bf16e;});}return null;};}function removeEntity(_0x53fad7,_0x2e6e37){return function(_0x479a21){if(_0x479a21){return _0x479a21['destroy']()[_0xcd51('0x1c')](function(){_0x53fad7['status'](0xcc)[_0xcd51('0x1d')]();});}};}function handleEntityNotFound(_0x362048,_0x52461e){return function(_0x5b0ce8){if(!_0x5b0ce8){_0x362048[_0xcd51('0x14')](0x194);}return _0x5b0ce8;};}function handleError(_0x5542c2,_0x49bda1){_0x49bda1=_0x49bda1||0x1f4;return function(_0x285402){logger[_0xcd51('0x1e')](_0x285402[_0xcd51('0x1f')]);if(_0x285402['name']){delete _0x285402['name'];}_0x5542c2[_0xcd51('0x20')](_0x49bda1)['send'](_0x285402);};}exports[_0xcd51('0x21')]=function(_0x4253bc,_0x3b3e4d){var _0x1631ae={},_0x3ac3c0={},_0x519173={'count':0x0,'rows':[]};var _0x1759fc=db[_0xcd51('0x22')][_0xcd51('0x23')];_0x3ac3c0[_0xcd51('0x24')]=_[_0xcd51('0x25')](_0x1759fc);_0x3ac3c0['query']=_[_0xcd51('0x25')](_0x4253bc[_0xcd51('0x26')]);_0x3ac3c0[_0xcd51('0x27')]=_[_0xcd51('0x28')](_0x3ac3c0[_0xcd51('0x24')],_0x3ac3c0['query']);_0x1631ae[_0xcd51('0x29')]=_['intersection'](_0x3ac3c0[_0xcd51('0x24')],qs['fields'](_0x4253bc[_0xcd51('0x26')]['fields']));_0x1631ae[_0xcd51('0x29')]=_0x1631ae[_0xcd51('0x29')]['length']?_0x1631ae[_0xcd51('0x29')]:_0x3ac3c0[_0xcd51('0x24')];if(!_0x4253bc[_0xcd51('0x26')][_0xcd51('0x2a')](_0xcd51('0x2b'))){_0x1631ae[_0xcd51('0x16')]=qs['limit'](_0x4253bc['query'][_0xcd51('0x16')]);_0x1631ae[_0xcd51('0x15')]=qs[_0xcd51('0x15')](_0x4253bc[_0xcd51('0x26')]['offset']);}_0x1631ae['order']=qs[_0xcd51('0x2c')](_0x4253bc['query'][_0xcd51('0x2c')]);_0x1631ae['where']=qs[_0xcd51('0x27')](_['pick'](_0x4253bc['query'],_0x3ac3c0[_0xcd51('0x27')]));if(_0x4253bc[_0xcd51('0x26')]['filter']){_0x1631ae[_0xcd51('0x2d')]=_['merge'](_0x1631ae[_0xcd51('0x2d')],{'$or':_['map'](_0x1759fc,function(_0x2fcde){if(_0x2fcde[_0xcd51('0x2e')][_0xcd51('0x2f')]!==_0xcd51('0x30')){var _0x50c202={};_0x50c202[_0x2fcde[_0xcd51('0x31')]]={'$like':'%'+_0x4253bc[_0xcd51('0x26')][_0xcd51('0x32')]+'%'};return _0x50c202;}})});}_0x1631ae=_['merge']({},_0x1631ae,_0x4253bc[_0xcd51('0x33')]);var _0x19c015={'where':_0x1631ae['where']};return db[_0xcd51('0x22')]['count'](_0x19c015)[_0xcd51('0x1c')](function(_0x1a2657){_0x519173[_0xcd51('0x34')]=_0x1a2657;if(_0x4253bc[_0xcd51('0x26')]['includeAll']){_0x1631ae[_0xcd51('0x35')]=[{'all':!![]}];}return db['SACreditNote'][_0xcd51('0x36')](_0x1631ae);})[_0xcd51('0x1c')](function(_0x598528){_0x519173[_0xcd51('0x37')]=_0x598528;return _0x519173;})['then'](respondWithFilteredResult(_0x3b3e4d,_0x1631ae))[_0xcd51('0x38')](handleError(_0x3b3e4d,null));};exports[_0xcd51('0x39')]=function(_0x2e65fd,_0x464b52){var _0xb74946={'raw':![],'where':{'id':_0x2e65fd[_0xcd51('0x3a')]['id']}},_0x4f915e={};_0x4f915e[_0xcd51('0x24')]=_['keys'](db[_0xcd51('0x22')][_0xcd51('0x23')]);_0x4f915e[_0xcd51('0x26')]=_[_0xcd51('0x25')](_0x2e65fd['query']);_0x4f915e[_0xcd51('0x27')]=_[_0xcd51('0x28')](_0x4f915e[_0xcd51('0x24')],_0x4f915e[_0xcd51('0x26')]);_0xb74946[_0xcd51('0x29')]=_['intersection'](_0x4f915e['model'],qs['fields'](_0x2e65fd[_0xcd51('0x26')][_0xcd51('0x3b')]));_0xb74946[_0xcd51('0x29')]=_0xb74946[_0xcd51('0x29')][_0xcd51('0x3c')]?_0xb74946[_0xcd51('0x29')]:_0x4f915e['model'];if(_0x2e65fd[_0xcd51('0x26')][_0xcd51('0x3d')]){_0xb74946[_0xcd51('0x35')]=[{'all':!![]}];}_0xb74946=_[_0xcd51('0x3e')]({},_0xb74946,_0x2e65fd[_0xcd51('0x33')]);return db['SACreditNote'][_0xcd51('0x3f')](_0xb74946)['then'](handleEntityNotFound(_0x464b52,null))[_0xcd51('0x1c')](respondWithResult(_0x464b52,null))[_0xcd51('0x38')](handleError(_0x464b52,null));};exports[_0xcd51('0x40')]=function(_0x359fd7,_0x59f1e3){return db[_0xcd51('0x22')]['create'](_0x359fd7[_0xcd51('0x41')],{})['then'](respondWithResult(_0x59f1e3,0xc9))[_0xcd51('0x38')](handleError(_0x59f1e3,null));};exports[_0xcd51('0x42')]=function(_0x5debd8,_0x3af2f0){if(_0x5debd8[_0xcd51('0x41')]['id']){delete _0x5debd8[_0xcd51('0x41')]['id'];}return db[_0xcd51('0x22')][_0xcd51('0x3f')]({'where':{'id':_0x5debd8[_0xcd51('0x3a')]['id']}})[_0xcd51('0x1c')](handleEntityNotFound(_0x3af2f0,null))[_0xcd51('0x1c')](saveUpdates(_0x5debd8[_0xcd51('0x41')],null))[_0xcd51('0x1c')](respondWithResult(_0x3af2f0,null))[_0xcd51('0x38')](handleError(_0x3af2f0,null));};exports[_0xcd51('0x43')]=function(_0x1ad6a4,_0xbd8fad){return db[_0xcd51('0x22')][_0xcd51('0x3f')]({'where':{'id':_0x1ad6a4[_0xcd51('0x3a')]['id']}})[_0xcd51('0x1c')](handleEntityNotFound(_0xbd8fad,null))[_0xcd51('0x1c')](removeEntity(_0xbd8fad,null))[_0xcd51('0x38')](handleError(_0xbd8fad,null));};exports[_0xcd51('0x44')]=function(_0x2ab527,_0x31c189){return db['SACreditNote'][_0xcd51('0x44')]()[_0xcd51('0x1c')](respondWithResult(_0x31c189,null))[_0xcd51('0x38')](handleError(_0x31c189,null));};exports[_0xcd51('0x45')]=function(_0x5db668,_0x3bd68d){var _0x20143c=moment()['unix']()[_0xcd51('0x46')]();var _0x28f6e4=path[_0xcd51('0x47')](config[_0xcd51('0x48')],_0xcd51('0x49'),_0xcd51('0x4a'),_0xcd51('0x4b'));var _0x2bbc12=path[_0xcd51('0x47')](config[_0xcd51('0x48')],_0xcd51('0x49'),'files','images',_0xcd51('0x4c'),'logo-invoice.png');var _0x45a499=path[_0xcd51('0x47')](config[_0xcd51('0x48')],_0xcd51('0x49'),_0xcd51('0x4a'),_0xcd51('0x4d'),'logos','paid-invoice.png');var _0x4760ae=path['join'](_0x28f6e4,_0x20143c);var _0x14e6c4=util[_0xcd51('0x4e')](_0xcd51('0x4f'),_0x5db668['params']['id'],_0x20143c);var _0x1ac841=path[_0xcd51('0x47')](_0x4760ae,_0x14e6c4);var _0x1ef7d2=![];var _0xc594e2={};return db[_0xcd51('0x22')]['find']({'where':{'id':_0x5db668[_0xcd51('0x3a')]['id']},'raw':!![]})[_0xcd51('0x1c')](handleEntityNotFound(_0x3bd68d,null))[_0xcd51('0x1c')](function(_0x227b52){if(_0x227b52){_0xc594e2['creditnote']=_0x227b52;return db['SACreditNoteDetail'][_0xcd51('0x36')]({'where':{'CreditNoteId':_0x227b52['id']},'raw':!![],'logging':console['log']})[_0xcd51('0x1c')](function(_0x45eea2){_0xc594e2['details']=_0x45eea2;_0x1ef7d2=!![];var _0x3a1393='';var _0x147ff3={'format':'A4','orientation':'portrait','border':_0xcd51('0x50'),'footer':{'height':_0xcd51('0x51'),'contents':{'default':_0xcd51('0x52')}}};_0x147ff3[_0xcd51('0x53')][_0xcd51('0x54')][_0xcd51('0x55')]=_0x147ff3[_0xcd51('0x53')][_0xcd51('0x54')][_0xcd51('0x55')]+''+_0xc594e2[_0xcd51('0x56')]['issuerWeb']+_0xcd51('0x57');fs[_0xcd51('0x58')](_0x4760ae);_0x3a1393='';_0x3a1393+=_0xcd51('0x59');_0x3a1393+=_0xcd51('0x5a');var _0x2d7b9d={'phone':{'en':_0xcd51('0x5b'),'it':_0xcd51('0x5c')},'fax':{'en':_0xcd51('0x5d'),'it':_0xcd51('0x5d')},'email':{'en':_0xcd51('0x5e'),'it':_0xcd51('0x5e')},'piva':{'en':'VAT\x20number','it':_0xcd51('0x5f')},'cf':{'en':_0xcd51('0x60'),'it':'C.F.'},'sdi':{'en':'I.S.\x20code','it':_0xcd51('0x61')},'cs':{'en':_0xcd51('0x62'),'it':'Cap.Soc.\x20iv'},'invoice':{'en':_0xcd51('0x63'),'it':'Fattura'},'proforma':{'en':_0xcd51('0x64'),'it':'Proforma'},'creditnote':{'en':_0xcd51('0x65'),'it':'Nota\x20di\x20credito'},'duedate':{'en':'Due\x20date','it':_0xcd51('0x66')},'item':{'en':'Item','it':_0xcd51('0x67')},'description':{'en':'Description','it':'Descrizione'},'hrsqty':{'en':'Hrs/Qty','it':_0xcd51('0x68')},'unitprice':{'en':_0xcd51('0x69'),'it':_0xcd51('0x6a')},'subtotal':{'en':_0xcd51('0x6b'),'it':_0xcd51('0x6c')},'discount':{'en':'Discount','it':'Sconto'},'total':{'en':_0xcd51('0x6d'),'it':_0xcd51('0x6e')},'tax':{'en':'Tax','it':_0xcd51('0x6f')},'nettopay':{'en':_0xcd51('0x70'),'it':_0xcd51('0x71')},'sendpayment':{'en':_0xcd51('0x72'),'it':_0xcd51('0x73')},'accountholder':{'en':'Account\x20Holder','it':_0xcd51('0x74')},'bankname':{'en':_0xcd51('0x75'),'it':_0xcd51('0x76')},'bankaddress':{'en':_0xcd51('0x77'),'it':_0xcd51('0x78')},'abi':{'en':_0xcd51('0x79'),'it':_0xcd51('0x79')},'cab':{'en':_0xcd51('0x7a'),'it':_0xcd51('0x7a')},'bic':{'en':_0xcd51('0x7b'),'it':_0xcd51('0x7b')},'swif':{'en':_0xcd51('0x7c'),'it':'SWIF'},'iban':{'en':_0xcd51('0x7d'),'it':_0xcd51('0x7d')},'paypal':{'en':_0xcd51('0x7e'),'it':_0xcd51('0x7f')},'thank1':{'en':_0xcd51('0x80'),'it':_0xcd51('0x81')},'thank2':{'en':_0xcd51('0x82'),'it':_0xcd51('0x83')}};var _0xa21fdb='it';if(_0xc594e2[_0xcd51('0x56')][_0xcd51('0x84')]!==_0xcd51('0x85')){_0xa21fdb='en';}_0x3a1393+='';_0x3a1393+='\x20',_0xc594e2[_0xcd51('0x56')][_0xcd51('0x89')]);_0x3a1393+=util[_0xcd51('0x4e')]('%s',_0xc594e2[_0xcd51('0x56')][_0xcd51('0x8a')]);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x8b'),_0xc594e2[_0xcd51('0x56')]['issuerCity']);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x8c'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x8d')]);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x8c'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x8d')]);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d['phone'][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2['creditnote'][_0xcd51('0x8f')]);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x90')][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2['creditnote']['issuerFax']);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x91')][_0xa21fdb]+_0xcd51('0x92'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x93')]);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x94')][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x95')]);_0x3a1393+=util['format'](_0x2d7b9d['cf'][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2['creditnote'][_0xcd51('0x96')]);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x97')][_0xa21fdb]+'%s
',_0xc594e2[_0xcd51('0x56')][_0xcd51('0x98')]);_0x3a1393+=util['format'](_0x2d7b9d['cs'][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2['creditnote']['issuerSocCap']);_0x3a1393+=_0xcd51('0x99');_0x3a1393+=_0xcd51('0x9a');_0x3a1393+=_0xcd51('0x9b');_0x3a1393+=util['format'](_0xcd51('0x9c'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x9d')]);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x92'),_0xc594e2[_0xcd51('0x56')]['receivingStreet']);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x9e'),_0xc594e2[_0xcd51('0x56')]['receivingPostalCode']);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0x92'),_0xc594e2[_0xcd51('0x56')]['receivingCity']);_0x3a1393+=util['format'](_0xcd51('0x92'),_0xc594e2[_0xcd51('0x56')][_0xcd51('0x84')]);_0x3a1393+=util['format'](_0xcd51('0x9f')+_0x2d7b9d['cf'][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2[_0xcd51('0x56')]['receivingFiscalCode']);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x94')][_0xa21fdb]+':\x20%s
',_0xc594e2['creditnote'][_0xcd51('0xa0')]);_0x3a1393+=util[_0xcd51('0x4e')](_0x2d7b9d[_0xcd51('0x97')][_0xa21fdb]+_0xcd51('0x8e'),_0xc594e2[_0xcd51('0x56')]['receivingSDICode']);_0x3a1393+=_0xcd51('0xa1');_0x3a1393+=_0xcd51('0xa2');_0x3a1393+=_0xcd51('0xa3');_0x3a1393+=_0xcd51('0xa4');_0x3a1393+=util[_0xcd51('0x4e')](''+_0x2d7b9d[_0xcd51('0x56')][_0xa21fdb]+_0xcd51('0xa5'),_0x227b52['id']);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xa6'),_0xc594e2['creditnote'][_0xcd51('0xa7')]);var _0x1976f4=moment(_0xc594e2['creditnote'][_0xcd51('0xa8')])[_0xcd51('0x4e')]('DD/MM/YYYY');_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xa9'),_0x1976f4);var _0x181576=moment(_0xc594e2['creditnote']['updatedAt'])[_0xcd51('0xaa')](_0xc594e2['creditnote']['saExpiryDay'],_0xcd51('0xab'))[_0xcd51('0x4e')](_0xcd51('0xac'));_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xad')+_0x2d7b9d[_0xcd51('0xae')][_0xa21fdb]+_0xcd51('0xaf'),_0x181576);_0x3a1393+='
';_0x3a1393+=_0xcd51('0xa3');_0x3a1393+=_0xcd51('0xa4');_0x3a1393+='';_0x3a1393+=_0xcd51('0xa3');_0x3a1393+=_0xcd51('0xb0')+_0x2d7b9d[_0xcd51('0xb1')][_0xa21fdb]+'';_0x3a1393+=_0xcd51('0xb0')+_0x2d7b9d[_0xcd51('0xb2')][_0xa21fdb]+_0xcd51('0xb3');_0x3a1393+=_0xcd51('0xb0')+_0x2d7b9d[_0xcd51('0xb4')][_0xa21fdb]+_0xcd51('0xb3');_0x3a1393+=_0xcd51('0xb0')+_0x2d7b9d[_0xcd51('0xb5')][_0xa21fdb]+'';_0x3a1393+=''+_0x2d7b9d[_0xcd51('0xb6')][_0xa21fdb]+_0xcd51('0xb3');_0x3a1393+=_0xcd51('0xa2');var _0x230ba0=0x0;var _0xad9bab=0x0;for(var _0x45c8cd=0x0;_0x45c8cd<_0xc594e2[_0xcd51('0xb7')][_0xcd51('0x3c')];_0x45c8cd++){var _0x2313fd=0x0;var _0x27ebfb=0x0;var _0x3f3705=0x0;var _0x5efb0c=0x0;_0x2313fd=_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xb8')]-_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xb8')]/0x64*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xb9')];_0x27ebfb=_0x2313fd/0x64*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xba')];_0x3f3705=_0x2313fd*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xbb')];_0x5efb0c=_0x27ebfb*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xbb')];_0x3a1393+=_0xcd51('0xa3');_0x3a1393+=util['format']('',_0xc594e2['details'][_0x45c8cd][_0xcd51('0xbc')]);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xbd'),_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xbe')]);_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xbf'),_0xc594e2[_0xcd51('0xb7')][_0x45c8cd]['quantity']);_0x3a1393+=''+_0x2313fd['toFixed'](0x2)+_0xcd51('0xc0');_0x3a1393+=''+_0x3f3705[_0xcd51('0xc1')](0x2)+_0xcd51('0xc0');_0x3a1393+='';_0x230ba0+=_0x3f3705;_0xad9bab+=_0x5efb0c;}_0x3a1393+=_0xcd51('0xc2');if(!_[_0xcd51('0xc3')](_0xc594e2[_0xcd51('0x56')][_0xcd51('0xb9')])){var _0x444ab0=0x0;var _0x41f450=0x0;var _0x2f753d=_0xc594e2[_0xcd51('0x56')][_0xcd51('0xb9')]*0x64/_0x230ba0;for(var _0x45c8cd=0x0;_0x45c8cd<_0xc594e2['details']['length'];_0x45c8cd++){var _0x1a427b=0x0;var _0x408511=0x0;var _0x43603a=0x0;_0x2313fd=_0xc594e2[_0xcd51('0xb7')][_0x45c8cd]['netPrice']-_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xb8')]/0x64*_0xc594e2['details'][_0x45c8cd][_0xcd51('0xb9')];_0x1a427b=_0x2313fd/0x64*_0x2f753d;_0x408511=_0x2313fd-_0x1a427b;_0x43603a=_0x408511*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xbb')];_0x444ab0+=_0x43603a;_0x41f450+=_0x43603a/0x64*_0xc594e2[_0xcd51('0xb7')][_0x45c8cd][_0xcd51('0xba')];}}var _0x1e1ee8=0x0;var _0x2ecd01=0x0;var _0x4249d9=![];var _0x4fb2f9=_0xc594e2[_0xcd51('0x56')][_0xcd51('0xc4')];if(_0x4fb2f9[_0xcd51('0xc5')]('split\x20payment')!=-0x1){_0x4249d9=!![];}if(!_['isNil'](_0xc594e2['creditnote']['discount'])){_0x3a1393+='';if(_0xc594e2[_0xcd51('0x56')][_0xcd51('0xb9')]>0x0){_0x3a1393+=_0xcd51('0xc6')+_0x2d7b9d[_0xcd51('0xb9')][_0xa21fdb]+_0xcd51('0x99');_0x3a1393+='\x20'+_0xc594e2[_0xcd51('0x56')]['discount'][_0xcd51('0xc1')](0x2)+_0xcd51('0xc0');}_0x3a1393+=_0xcd51('0xa2');_0x1e1ee8=_0x41f450;_0x2ecd01=_0x444ab0;}else{_0x1e1ee8=_0xad9bab;_0x2ecd01=_0x230ba0;}if(_0x1e1ee8>0x0||_0xc594e2[_0xcd51('0x56')][_0xcd51('0xb9')]>0x0){_0x3a1393+=_0xcd51('0xa3');_0x3a1393+=_0xcd51('0xc7')+_0x2d7b9d[_0xcd51('0xc8')][_0xa21fdb]+_0xcd51('0x99');_0x3a1393+=_0xcd51('0xc9')+_0x2ecd01[_0xcd51('0xc1')](0x2)+'\x20€';_0x3a1393+=_0xcd51('0xa2');}if(_0x1e1ee8>0x0){_0x3a1393+='';_0x3a1393+=''+_0x2d7b9d['tax'][_0xa21fdb]+'';_0x3a1393+=_0xcd51('0xc9')+_0x1e1ee8['toFixed'](0x2)+_0xcd51('0xc0');_0x3a1393+=_0xcd51('0xa2');}_0x3a1393+='';var _0x86880;if(_0x4249d9){_0x86880=_0x2ecd01;}else{_0x86880=_0x2ecd01+_0x1e1ee8;}_0x3a1393+=_0xcd51('0xca')+_0x2d7b9d[_0xcd51('0xcb')][_0xa21fdb]+''+_0x86880[_0xcd51('0xc1')](0x2)+_0xcd51('0xc0');_0x3a1393+=_0xcd51('0xcc');_0x3a1393+=_0xcd51('0xcd');_0x3a1393+=_0xcd51('0xce');_0x3a1393+='';_0x3a1393+=util[_0xcd51('0x4e')](_0xcd51('0xcf'),_0xc594e2['creditnote'][_0xcd51('0xc4')]['replace'](new RegExp(String[_0xcd51('0xd0')](0xd),'g'),''));_0x3a1393+=_0xcd51('0xa2');_0x3a1393+='';_0x3a1393+=_0xcd51('0xa4');_0x3a1393+=''+_0x2d7b9d['sendpayment'][_0xa21fdb]+':';if(!_[_0xcd51('0xc3')](_0xc594e2[_0xcd51('0x56')][_0xcd51('0xd1')])){_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d['accountholder'][_0xa21fdb]+':\x20'+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xd1')]+_0xcd51('0xd3');_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xd4')][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2['creditnote'][_0xcd51('0xd6')]+_0xcd51('0xd7');_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xd8')][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xd9')]+',\x20'+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xda')]+_0xcd51('0xdb')+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xdc')]+'\x20('+_0xc594e2['creditnote'][_0xcd51('0xdd')]+')'+_0xcd51('0xd3');_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xde')][_0xa21fdb]+'/'+_0x2d7b9d['cab'][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xdf')]+'/'+_0xc594e2['creditnote'][_0xcd51('0xe0')]+_0xcd51('0xd3');_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xe1')][_0xa21fdb]+'/'+_0x2d7b9d[_0xcd51('0xe2')][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2['creditnote'][_0xcd51('0xe3')]+_0xcd51('0xd3');_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xe4')][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2[_0xcd51('0x56')][_0xcd51('0xe5')]+_0xcd51('0xd3');}if(!_[_0xcd51('0xc3')](_0xc594e2[_0xcd51('0x56')]['issuerPayPal'])){_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d[_0xcd51('0xe6')][_0xa21fdb]+_0xcd51('0xd5')+_0xc594e2[_0xcd51('0x56')]['issuerPayPal']+'';}_0x3a1393+=_0xcd51('0xd2')+_0x2d7b9d['thank1'][_0xa21fdb]+_0xcd51('0xe7')+_0x181576+_0xcd51('0xe8')+_0x2d7b9d[_0xcd51('0xe9')][_0xa21fdb]+_0xcd51('0x57');_0x3a1393+=_0xcd51('0x99');_0x3a1393+='';_0x3a1393+='
%s
';_0x3a1393+=_0xcd51('0xea');_0x3a1393+=_0xcd51('0xeb');return new BPromise(function(_0x2875d6,_0x2d39be){pdf[_0xcd51('0x40')](_0x3a1393,_0x147ff3)[_0xcd51('0xec')](path['join'](_0x4760ae,_0x14e6c4),function(_0x15950f,_0x5fd6af){if(_0x15950f)return _0x2d39be(_0x15950f);_0x2875d6(_0x5fd6af);});});});}})[_0xcd51('0x1c')](function(){if(_0x1ef7d2){console[_0xcd51('0xed')](_0xcd51('0xee'),_0x1ac841,_0x14e6c4);return _0x3bd68d['download'](_0x1ac841,_0x14e6c4,function(_0x24774d){if(_0x24774d){console['log'](_0xcd51('0xef'),_0x24774d);}else{console[_0xcd51('0xed')]('foldername',_0x4760ae);rimraf(_0x4760ae,function(){});}});}else{return _0x3bd68d['sendStatus'](0xc8);}})['catch'](handleError(_0x3bd68d,null));}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.model.js b/server/api/saCreditNote/saCreditNote.model.js index 8269799..3f4cb97 100644 --- a/server/api/saCreditNote/saCreditNote.model.js +++ b/server/api/saCreditNote/saCreditNote.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['findOne','transaction','update','SACreditNoteNumber','create','then','log','TCL:\x20error','lodash','bluebird','rimraf','../../config/environment','./saCreditNote.attributes','exports','define','sa_creditNotes','models','get','has'];(function(_0x248d01,_0x49e69a){var _0x36d675=function(_0x33286c){while(--_0x33286c){_0x248d01['push'](_0x248d01['shift']());}};_0x36d675(++_0x49e69a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x50904c,_0xc8a03c){_0x50904c=_0x50904c-0x0;var _0x3ea910=_0xf4eb[_0x50904c];return _0x3ea910;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('SACreditNote',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5013c2,_0x5e23d4,_0xa4280c){var _0x3761c1=_0xa4dcf5[_0xbf4e('0x8')];var _0xc86f04=_0x5013c2[_0xbf4e('0x9')]({'plain':!![]});var _0x22668b=0x1;var _0x177342=parseInt(moment()['format']('YYYY'));try{if(_[_0xbf4e('0xa')](_0xc86f04,'id')){return _0x3761c1['SACreditNoteNumber'][_0xbf4e('0xb')]({'where':{'year':_0x177342},'raw':!![],'logging':!![],'transaction':_0x5e23d4[_0xbf4e('0xc')]})['then'](function(_0x17fd01){if(_0x17fd01){_0x22668b=_0x17fd01['number']+0x1;return _0x3761c1['SACreditNoteNumber'][_0xbf4e('0xd')]({'number':_0x22668b},{'where':{'id':_0x17fd01['id']},'transaction':_0x5e23d4[_0xbf4e('0xc')],'logging':!![]});}return _0x3761c1[_0xbf4e('0xe')][_0xbf4e('0xf')]({'year':_0x177342,'number':_0x22668b},{'logging':!![],'transaction':_0x5e23d4[_0xbf4e('0xc')]});})[_0xbf4e('0x10')](function(){_0xc86f04['number']=_0x22668b;})['then'](function(){_0xa4280c();});}}catch(_0x180432){console[_0xbf4e('0x11')](_0xbf4e('0x12'),_0x180432);_0xa4280c();}}}});}; \ No newline at end of file +var _0x702d=['exports','define','SACreditNote','models','get','format','YYYY','has','transaction','then','SACreditNoteNumber','update','create','number','log','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x702d,0x147));var _0xd702=function(_0x4e7c86,_0x4e9a76){_0x4e7c86=_0x4e7c86-0x0;var _0x3377dd=_0x702d[_0x4e7c86];return _0x3377dd;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./saCreditNote.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'sa_creditNotes','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12bb75,_0x53bd02,_0x39c49e){var _0x25423f=_0x544e94[_0xd702('0xc')];var _0x365a0b=_0x12bb75[_0xd702('0xd')]({'plain':!![]});var _0x2a1f0d=0x1;var _0x178ad6=parseInt(moment()[_0xd702('0xe')](_0xd702('0xf')));try{if(_[_0xd702('0x10')](_0x365a0b,'id')){return _0x25423f['SACreditNoteNumber']['findOne']({'where':{'year':_0x178ad6},'raw':!![],'logging':!![],'transaction':_0x53bd02[_0xd702('0x11')]})[_0xd702('0x12')](function(_0x273577){if(_0x273577){_0x2a1f0d=_0x273577['number']+0x1;return _0x25423f[_0xd702('0x13')][_0xd702('0x14')]({'number':_0x2a1f0d},{'where':{'id':_0x273577['id']},'transaction':_0x53bd02[_0xd702('0x11')],'logging':!![]});}return _0x25423f[_0xd702('0x13')][_0xd702('0x15')]({'year':_0x178ad6,'number':_0x2a1f0d},{'logging':!![],'transaction':_0x53bd02[_0xd702('0x11')]});})['then'](function(){_0x365a0b[_0xd702('0x16')]=_0x2a1f0d;})[_0xd702('0x12')](function(){_0x39c49e();});}}catch(_0x5d7978){console[_0xd702('0x17')]('TCL:\x20error',_0x5d7978);_0x39c49e();}}}});}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.rpc.js b/server/api/saCreditNote/saCreditNote.rpc.js index 56ed6a9..e3e67ea 100644 --- a/server/api/saCreditNote/saCreditNote.rpc.js +++ b/server/api/saCreditNote/saCreditNote.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa809=['error','message','info','result','catch','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SACreditNote,\x20%s,\x20%s','request\x20sent','debug','SACreditNote,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3013b9,_0x2c55e8){var _0x2089a9=function(_0x268650){while(--_0x268650){_0x3013b9['push'](_0x3013b9['shift']());}};_0x2089a9(++_0x2c55e8);}(_0xa809,0x1f3));var _0x9a80=function(_0x54a190,_0x1815e2){_0x54a190=_0x54a190-0x0;var _0x1550e7=_0xa809[_0x54a190];return _0x1550e7;};'use strict';var _=require('lodash');var util=require(_0x9a80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a80('0x2'))(_0x9a80('0x3'));var config=require(_0x9a80('0x4'));var jayson=require(_0x9a80('0x5'));var client=jayson['client'][_0x9a80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x504ba8,_0x17b704,_0x286ac5){return new BPromise(function(_0x4ea507,_0x1ef67a){return client[_0x9a80('0x7')](_0x504ba8,_0x286ac5)[_0x9a80('0x8')](function(_0x269ee2){logger['info'](_0x9a80('0x9'),_0x17b704,_0x9a80('0xa'));logger[_0x9a80('0xb')](_0x9a80('0xc'),_0x17b704,_0x9a80('0xa'),JSON[_0x9a80('0xd')](_0x269ee2));if(_0x269ee2[_0x9a80('0xe')]){if(_0x269ee2[_0x9a80('0xe')]['code']===0x1f4){logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);return _0x1ef67a(_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);}logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2['error'][_0x9a80('0xf')]);return _0x4ea507(_0x269ee2['error'][_0x9a80('0xf')]);}else{logger[_0x9a80('0x10')](_0x9a80('0x9'),_0x17b704,'request\x20sent');_0x4ea507(_0x269ee2[_0x9a80('0x11')][_0x9a80('0xf')]);}})[_0x9a80('0x12')](function(_0x12ecee){logger[_0x9a80('0xe')]('SACreditNote,\x20%s,\x20%s',_0x17b704,_0x12ecee);_0x1ef67a(_0x12ecee);});});} \ No newline at end of file +var _0x1921=['rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SACreditNote,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SACreditNote,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1921,0xf2));var _0x1192=function(_0x33dea9,_0x2a4a75){_0x33dea9=_0x33dea9-0x0;var _0x359aad=_0x1921[_0x33dea9];return _0x359aad;};'use strict';var _=require(_0x1192('0x0'));var util=require('util');var moment=require(_0x1192('0x1'));var BPromise=require(_0x1192('0x2'));var rs=require(_0x1192('0x3'));var fs=require('fs');var Redis=require(_0x1192('0x4'));var db=require(_0x1192('0x5'))['db'];var utils=require(_0x1192('0x6'));var logger=require(_0x1192('0x7'))(_0x1192('0x8'));var config=require(_0x1192('0x9'));var jayson=require(_0x1192('0xa'));var client=jayson[_0x1192('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56989b,_0x350776,_0x1df881){return new BPromise(function(_0x19ed6f,_0x2d7ae4){return client[_0x1192('0xc')](_0x56989b,_0x1df881)[_0x1192('0xd')](function(_0x1fc22e){logger[_0x1192('0xe')]('SACreditNote,\x20%s,\x20%s',_0x350776,'request\x20sent');logger[_0x1192('0xf')](_0x1192('0x10'),_0x350776,_0x1192('0x11'),JSON[_0x1192('0x12')](_0x1fc22e));if(_0x1fc22e[_0x1192('0x13')]){if(_0x1fc22e[_0x1192('0x13')][_0x1192('0x14')]===0x1f4){logger['error'](_0x1192('0x15'),_0x350776,_0x1fc22e['error'][_0x1192('0x16')]);return _0x2d7ae4(_0x1fc22e[_0x1192('0x13')]['message']);}logger[_0x1192('0x13')](_0x1192('0x15'),_0x350776,_0x1fc22e[_0x1192('0x13')]['message']);return _0x19ed6f(_0x1fc22e[_0x1192('0x13')][_0x1192('0x16')]);}else{logger['info'](_0x1192('0x15'),_0x350776,_0x1192('0x11'));_0x19ed6f(_0x1fc22e[_0x1192('0x17')]['message']);}})[_0x1192('0x18')](function(_0x5ed569){logger[_0x1192('0x13')](_0x1192('0x15'),_0x350776,_0x5ed569);_0x2d7ae4(_0x5ed569);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/index.js b/server/api/saCreditNoteDetail/index.js index a620cfd..6f3d701 100644 --- a/server/api/saCreditNoteDetail/index.js +++ b/server/api/saCreditNoteDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16e1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','update','delete','destroy'];(function(_0x1cf870,_0x5f172d){var _0x439018=function(_0x4e0f93){while(--_0x4e0f93){_0x1cf870['push'](_0x1cf870['shift']());}};_0x439018(++_0x5f172d);}(_0x16e1,0xfc));var _0x116e=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x16e1[_0x25662e];return _0x59b7bc;};'use strict';var multer=require(_0x116e('0x0'));var util=require(_0x116e('0x1'));var path=require(_0x116e('0x2'));var timeout=require(_0x116e('0x3'));var express=require(_0x116e('0x4'));var router=express[_0x116e('0x5')]();var auth=require(_0x116e('0x6'));var interaction=require(_0x116e('0x7'));var config=require(_0x116e('0x8'));var controller=require('./saCreditNoteDetail.controller');router['get']('/',auth[_0x116e('0x9')](),controller[_0x116e('0xa')]);router[_0x116e('0xb')]('/describe',auth[_0x116e('0x9')](),controller['describe']);router['get'](_0x116e('0xc'),auth[_0x116e('0x9')](),controller[_0x116e('0xd')]);router[_0x116e('0xe')]('/',auth[_0x116e('0x9')](),controller['create']);router['put']('/:id',auth[_0x116e('0x9')](),controller[_0x116e('0xf')]);router[_0x116e('0x10')](_0x116e('0xc'),auth[_0x116e('0x9')](),controller[_0x116e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa951=['./saCreditNoteDetail.controller','isAuthenticated','index','get','/describe','describe','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x16c1d9,_0x2a1270){var _0x85293b=function(_0x2c3479){while(--_0x2c3479){_0x16c1d9['push'](_0x16c1d9['shift']());}};_0x85293b(++_0x2a1270);}(_0xa951,0x189));var _0x1a95=function(_0x30c006,_0x3deae7){_0x30c006=_0x30c006-0x0;var _0x8c59e9=_0xa951[_0x30c006];return _0x8c59e9;};'use strict';var multer=require(_0x1a95('0x0'));var util=require(_0x1a95('0x1'));var path=require(_0x1a95('0x2'));var timeout=require(_0x1a95('0x3'));var express=require('express');var router=express[_0x1a95('0x4')]();var auth=require(_0x1a95('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a95('0x6'));var controller=require(_0x1a95('0x7'));router['get']('/',auth[_0x1a95('0x8')](),controller[_0x1a95('0x9')]);router[_0x1a95('0xa')](_0x1a95('0xb'),auth[_0x1a95('0x8')](),controller[_0x1a95('0xc')]);router[_0x1a95('0xa')]('/:id',auth[_0x1a95('0x8')](),controller['show']);router[_0x1a95('0xd')]('/',auth[_0x1a95('0x8')](),controller[_0x1a95('0xe')]);router[_0x1a95('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1a95('0x10')]);router['delete'](_0x1a95('0x11'),auth[_0x1a95('0x8')](),controller[_0x1a95('0x12')]);module[_0x1a95('0x13')]=router; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js index a2c19f7..ac4616a 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeff8=['INTEGER','TEXT','STRING','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize','exports'];(function(_0x4630b8,_0x2fd52d){var _0x355db1=function(_0xd4e176){while(--_0xd4e176){_0x4630b8['push'](_0x4630b8['shift']());}};_0x355db1(++_0x2fd52d);}(_0xeff8,0x186));var _0x8eff=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xeff8[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![]},'productName':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0x8eff('0x4')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT'](_0x8eff('0x5'))+_0x8eff('0x6')},'typeName':{'type':Sequelize[_0x8eff('0x4')],'allowNull':![]},'unitName':{'type':Sequelize[_0x8eff('0x4')]},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x8eff('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x8eff('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x8eff('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING'],'allowNull':![]},'note':{'type':Sequelize[_0x8eff('0x3')]},'subscriptionId':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x8eff('0x4')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![]},'quantity':{'type':Sequelize['INTEGER'],'allowNull':![]}}; \ No newline at end of file +var _0xc1c6=['exports','STRING','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','INTEGER','sequelize'];(function(_0x2fcaf9,_0x285bbd){var _0x4cc4db=function(_0x51f37c){while(--_0x51f37c){_0x2fcaf9['push'](_0x2fcaf9['shift']());}};_0x4cc4db(++_0x285bbd);}(_0xc1c6,0xf7));var _0x6c1c=function(_0xaf9382,_0x3dede0){_0xaf9382=_0xaf9382-0x0;var _0x19c2e2=_0xc1c6[_0xaf9382];return _0x19c2e2;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'companyName':{'type':Sequelize[_0x6c1c('0x2')],'allowNull':![]},'companyId':{'type':Sequelize['INTEGER'],'allowNull':![]},'productName':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize[_0x6c1c('0x3')](_0x6c1c('0x4'))+_0x6c1c('0x5')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize['INTEGER'],'allowNull':![]},'netPrice':{'type':Sequelize[_0x6c1c('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x6c1c('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x6c1c('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0x6c1c('0x3')]},'subscriptionId':{'type':Sequelize[_0x6c1c('0x7')],'allowNull':![]},'subscriptionName':{'type':Sequelize['STRING'],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x6c1c('0x7')],'allowNull':![]},'quantity':{'type':Sequelize[_0x6c1c('0x7')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js index 73e80f5..e82aad4 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x399c=['count','offset','limit','Content-Range','apply','reject','update','then','error','name','send','SACreditNoteDetail','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x4a09d2,_0xac1d3){var _0x2372cd=function(_0x2cf0c8){while(--_0x2cf0c8){_0x4a09d2['push'](_0x4a09d2['shift']());}};_0x2372cd(++_0xac1d3);}(_0x399c,0x10d));var _0xc399=function(_0x1771d9,_0x106001){_0x1771d9=_0x1771d9-0x0;var _0x3ce681=_0x399c[_0x1771d9];return _0x3ce681;};'use strict';var pdf=require(_0xc399('0x0'));var emlformat=require(_0xc399('0x1'));var rimraf=require(_0xc399('0x2'));var zipdir=require(_0xc399('0x3'));var jsonpatch=require(_0xc399('0x4'));var rp=require(_0xc399('0x5'));var moment=require(_0xc399('0x6'));var BPromise=require(_0xc399('0x7'));var Mustache=require(_0xc399('0x8'));var util=require(_0xc399('0x9'));var path=require(_0xc399('0xa'));var sox=require(_0xc399('0xb'));var csv=require('to-csv');var ejs=require(_0xc399('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc399('0xd'));var crypto=require('crypto');var jsforce=require(_0xc399('0xe'));var deskjs=require(_0xc399('0xf'));var toCsv=require(_0xc399('0x10'));var querystring=require(_0xc399('0x11'));var Papa=require(_0xc399('0x12'));var Redis=require(_0xc399('0x13'));var authService=require(_0xc399('0x14'));var qs=require(_0xc399('0x15'));var hardwareService=require(_0xc399('0x16'));var logger=require(_0xc399('0x17'))(_0xc399('0x18'));var utils=require('../../config/utils');var config=require(_0xc399('0x19'));var db=require(_0xc399('0x1a'))['db'];function respondWithStatusCode(_0x51b8d3,_0xf068ca){_0xf068ca=_0xf068ca||0xcc;return function(_0x150e75){if(_0x150e75){return _0x51b8d3[_0xc399('0x1b')](_0xf068ca);}return _0x51b8d3[_0xc399('0x1c')](_0xf068ca)[_0xc399('0x1d')]();};}function respondWithResult(_0x117704,_0x4d5dae){_0x4d5dae=_0x4d5dae||0xc8;return function(_0x2c11f1){if(_0x2c11f1){return _0x117704['status'](_0x4d5dae)[_0xc399('0x1e')](_0x2c11f1);}};}function respondWithFilteredResult(_0x5cb78e,_0x55fc11){return function(_0x31b792){if(_0x31b792){var _0x4a8cd6=_0x31b792[_0xc399('0x1f')],_0xe3b6b7=_0x55fc11[_0xc399('0x20')],_0x377939=_0x55fc11[_0xc399('0x20')]+_0x55fc11[_0xc399('0x21')],_0x4690a3;if(_0x377939>=_0x4a8cd6){_0x377939=_0x4a8cd6;_0x4690a3=0xc8;}else{_0x4690a3=0xce;}_0x5cb78e[_0xc399('0x1c')](_0x4690a3);return _0x5cb78e['set'](_0xc399('0x22'),_0xe3b6b7+'-'+_0x377939+'/'+_0x4a8cd6)['json'](_0x31b792);}return null;};}function patchUpdates(_0x4e1635){return function(_0x17e538){try{jsonpatch[_0xc399('0x23')](_0x17e538,_0x4e1635,!![]);}catch(_0x519dba){return BPromise[_0xc399('0x24')](_0x519dba);}return _0x17e538['save']();};}function saveUpdates(_0xc4e7ba,_0x381dd6){return function(_0x54685f){if(_0x54685f){return _0x54685f[_0xc399('0x25')](_0xc4e7ba)[_0xc399('0x26')](function(_0x74053b){return _0x74053b;});}return null;};}function removeEntity(_0x3217ec,_0x22e50d){return function(_0xc74372){if(_0xc74372){return _0xc74372['destroy']()[_0xc399('0x26')](function(){_0x3217ec[_0xc399('0x1c')](0xcc)[_0xc399('0x1d')]();});}};}function handleEntityNotFound(_0x48cddd,_0xec2527){return function(_0x55fe5e){if(!_0x55fe5e){_0x48cddd['sendStatus'](0x194);}return _0x55fe5e;};}function handleError(_0x49ed8d,_0x180c91){_0x180c91=_0x180c91||0x1f4;return function(_0xb26999){logger[_0xc399('0x27')](_0xb26999['stack']);if(_0xb26999[_0xc399('0x28')]){delete _0xb26999[_0xc399('0x28')];}_0x49ed8d[_0xc399('0x1c')](_0x180c91)[_0xc399('0x29')](_0xb26999);};}exports['index']=function(_0x2fb951,_0x686df0){var _0x1b4aef={},_0x55d053={},_0x640498={'count':0x0,'rows':[]};var _0x182c88=db[_0xc399('0x2a')][_0xc399('0x2b')];_0x55d053[_0xc399('0x2c')]=_['keys'](_0x182c88);_0x55d053[_0xc399('0x2d')]=_['keys'](_0x2fb951['query']);_0x55d053[_0xc399('0x2e')]=_[_0xc399('0x2f')](_0x55d053[_0xc399('0x2c')],_0x55d053['query']);_0x1b4aef['attributes']=_[_0xc399('0x2f')](_0x55d053[_0xc399('0x2c')],qs[_0xc399('0x30')](_0x2fb951[_0xc399('0x2d')][_0xc399('0x30')]));_0x1b4aef[_0xc399('0x31')]=_0x1b4aef[_0xc399('0x31')][_0xc399('0x32')]?_0x1b4aef[_0xc399('0x31')]:_0x55d053[_0xc399('0x2c')];if(!_0x2fb951[_0xc399('0x2d')][_0xc399('0x33')](_0xc399('0x34'))){_0x1b4aef['limit']=qs['limit'](_0x2fb951[_0xc399('0x2d')]['limit']);_0x1b4aef[_0xc399('0x20')]=qs[_0xc399('0x20')](_0x2fb951[_0xc399('0x2d')][_0xc399('0x20')]);}_0x1b4aef[_0xc399('0x35')]=qs['sort'](_0x2fb951[_0xc399('0x2d')]['sort']);_0x1b4aef[_0xc399('0x36')]=qs['filters'](_[_0xc399('0x37')](_0x2fb951[_0xc399('0x2d')],_0x55d053[_0xc399('0x2e')]));if(_0x2fb951['query'][_0xc399('0x38')]){_0x1b4aef['where']=_[_0xc399('0x39')](_0x1b4aef['where'],{'$or':_[_0xc399('0x3a')](_0x182c88,function(_0xdf9a84){if(_0xdf9a84[_0xc399('0x3b')][_0xc399('0x3c')]!=='VIRTUAL'){var _0x4908a4={};_0x4908a4[_0xdf9a84[_0xc399('0x3d')]]={'$like':'%'+_0x2fb951[_0xc399('0x2d')][_0xc399('0x38')]+'%'};return _0x4908a4;}})});}_0x1b4aef=_['merge']({},_0x1b4aef,_0x2fb951[_0xc399('0x3e')]);var _0x21592d={'where':_0x1b4aef[_0xc399('0x36')]};return db[_0xc399('0x2a')][_0xc399('0x1f')](_0x21592d)[_0xc399('0x26')](function(_0x5b6362){_0x640498[_0xc399('0x1f')]=_0x5b6362;if(_0x2fb951[_0xc399('0x2d')][_0xc399('0x3f')]){_0x1b4aef[_0xc399('0x40')]=[{'all':!![]}];}return db[_0xc399('0x2a')][_0xc399('0x41')](_0x1b4aef);})[_0xc399('0x26')](function(_0x2ac86b){_0x640498[_0xc399('0x42')]=_0x2ac86b;return _0x640498;})[_0xc399('0x26')](respondWithFilteredResult(_0x686df0,_0x1b4aef))[_0xc399('0x43')](handleError(_0x686df0,null));};exports['show']=function(_0x563852,_0x1000da){var _0x5906b5={'raw':![],'where':{'id':_0x563852[_0xc399('0x44')]['id']}},_0x3ed276={};_0x3ed276[_0xc399('0x2c')]=_[_0xc399('0x45')](db[_0xc399('0x2a')]['rawAttributes']);_0x3ed276[_0xc399('0x2d')]=_[_0xc399('0x45')](_0x563852[_0xc399('0x2d')]);_0x3ed276['filters']=_['intersection'](_0x3ed276[_0xc399('0x2c')],_0x3ed276[_0xc399('0x2d')]);_0x5906b5['attributes']=_[_0xc399('0x2f')](_0x3ed276[_0xc399('0x2c')],qs[_0xc399('0x30')](_0x563852[_0xc399('0x2d')][_0xc399('0x30')]));_0x5906b5[_0xc399('0x31')]=_0x5906b5[_0xc399('0x31')]['length']?_0x5906b5[_0xc399('0x31')]:_0x3ed276[_0xc399('0x2c')];if(_0x563852[_0xc399('0x2d')][_0xc399('0x3f')]){_0x5906b5[_0xc399('0x40')]=[{'all':!![]}];}_0x5906b5=_[_0xc399('0x39')]({},_0x5906b5,_0x563852[_0xc399('0x3e')]);return db['SACreditNoteDetail']['find'](_0x5906b5)[_0xc399('0x26')](handleEntityNotFound(_0x1000da,null))['then'](respondWithResult(_0x1000da,null))[_0xc399('0x43')](handleError(_0x1000da,null));};exports[_0xc399('0x46')]=function(_0x3577dd,_0xed1758){return db[_0xc399('0x2a')][_0xc399('0x46')](_0x3577dd[_0xc399('0x47')],{})[_0xc399('0x26')](respondWithResult(_0xed1758,0xc9))[_0xc399('0x43')](handleError(_0xed1758,null));};exports[_0xc399('0x25')]=function(_0x3a3fe5,_0x24fb26){if(_0x3a3fe5[_0xc399('0x47')]['id']){delete _0x3a3fe5[_0xc399('0x47')]['id'];}return db[_0xc399('0x2a')][_0xc399('0x48')]({'where':{'id':_0x3a3fe5[_0xc399('0x44')]['id']}})[_0xc399('0x26')](handleEntityNotFound(_0x24fb26,null))[_0xc399('0x26')](saveUpdates(_0x3a3fe5['body'],null))['then'](respondWithResult(_0x24fb26,null))[_0xc399('0x43')](handleError(_0x24fb26,null));};exports[_0xc399('0x49')]=function(_0x55a146,_0xf7484e){return db[_0xc399('0x2a')][_0xc399('0x48')]({'where':{'id':_0x55a146[_0xc399('0x44')]['id']}})[_0xc399('0x26')](handleEntityNotFound(_0xf7484e,null))[_0xc399('0x26')](removeEntity(_0xf7484e,null))[_0xc399('0x43')](handleError(_0xf7484e,null));};exports[_0xc399('0x4a')]=function(_0x3e3b05,_0x59963d){return db[_0xc399('0x2a')][_0xc399('0x4a')]()['then'](respondWithResult(_0x59963d,null))[_0xc399('0x43')](handleError(_0x59963d,null));}; \ No newline at end of file +var _0x0b64=['field','options','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','SACreditNoteDetail','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b64,0x9d));var _0x40b6=function(_0x47b337,_0xcca95b){_0x47b337=_0x47b337-0x0;var _0x2294e0=_0x0b64[_0x47b337];return _0x2294e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x40b6('0x0'));var rimraf=require(_0x40b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40b6('0x2'));var rp=require(_0x40b6('0x3'));var moment=require('moment');var BPromise=require(_0x40b6('0x4'));var Mustache=require(_0x40b6('0x5'));var util=require(_0x40b6('0x6'));var path=require(_0x40b6('0x7'));var sox=require(_0x40b6('0x8'));var csv=require(_0x40b6('0x9'));var ejs=require(_0x40b6('0xa'));var fs=require('fs');var _=require(_0x40b6('0xb'));var squel=require(_0x40b6('0xc'));var crypto=require(_0x40b6('0xd'));var jsforce=require(_0x40b6('0xe'));var deskjs=require(_0x40b6('0xf'));var toCsv=require(_0x40b6('0x9'));var querystring=require('querystring');var Papa=require(_0x40b6('0x10'));var Redis=require('ioredis');var authService=require(_0x40b6('0x11'));var qs=require(_0x40b6('0x12'));var hardwareService=require(_0x40b6('0x13'));var logger=require('../../config/logger')(_0x40b6('0x14'));var utils=require(_0x40b6('0x15'));var config=require(_0x40b6('0x16'));var db=require(_0x40b6('0x17'))['db'];function respondWithStatusCode(_0x40cccc,_0x4b78f7){_0x4b78f7=_0x4b78f7||0xcc;return function(_0x4c3bb9){if(_0x4c3bb9){return _0x40cccc[_0x40b6('0x18')](_0x4b78f7);}return _0x40cccc[_0x40b6('0x19')](_0x4b78f7)[_0x40b6('0x1a')]();};}function respondWithResult(_0x199eca,_0x1469c5){_0x1469c5=_0x1469c5||0xc8;return function(_0x36c59a){if(_0x36c59a){return _0x199eca[_0x40b6('0x19')](_0x1469c5)[_0x40b6('0x1b')](_0x36c59a);}};}function respondWithFilteredResult(_0x160f36,_0x38bb40){return function(_0x4c5c38){if(_0x4c5c38){var _0x3e1313=_0x4c5c38[_0x40b6('0x1c')],_0x1ceca1=_0x38bb40[_0x40b6('0x1d')],_0x142569=_0x38bb40[_0x40b6('0x1d')]+_0x38bb40['limit'],_0x4988c3;if(_0x142569>=_0x3e1313){_0x142569=_0x3e1313;_0x4988c3=0xc8;}else{_0x4988c3=0xce;}_0x160f36[_0x40b6('0x19')](_0x4988c3);return _0x160f36[_0x40b6('0x1e')](_0x40b6('0x1f'),_0x1ceca1+'-'+_0x142569+'/'+_0x3e1313)['json'](_0x4c5c38);}return null;};}function patchUpdates(_0xa8c301){return function(_0x13d27c){try{jsonpatch[_0x40b6('0x20')](_0x13d27c,_0xa8c301,!![]);}catch(_0x501c4b){return BPromise[_0x40b6('0x21')](_0x501c4b);}return _0x13d27c[_0x40b6('0x22')]();};}function saveUpdates(_0x34517e,_0x36806f){return function(_0x4c96c7){if(_0x4c96c7){return _0x4c96c7[_0x40b6('0x23')](_0x34517e)[_0x40b6('0x24')](function(_0x3f4675){return _0x3f4675;});}return null;};}function removeEntity(_0x19bf04,_0x1bdd48){return function(_0x834731){if(_0x834731){return _0x834731[_0x40b6('0x25')]()['then'](function(){_0x19bf04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ffc4,_0x4a5bd0){return function(_0x3f142f){if(!_0x3f142f){_0x47ffc4[_0x40b6('0x18')](0x194);}return _0x3f142f;};}function handleError(_0x405692,_0x1f2839){_0x1f2839=_0x1f2839||0x1f4;return function(_0x187266){logger[_0x40b6('0x26')](_0x187266['stack']);if(_0x187266[_0x40b6('0x27')]){delete _0x187266[_0x40b6('0x27')];}_0x405692[_0x40b6('0x19')](_0x1f2839)['send'](_0x187266);};}exports[_0x40b6('0x28')]=function(_0x1ab344,_0x20cda9){var _0x422e2b={},_0x8d3b0e={},_0x34cec3={'count':0x0,'rows':[]};var _0x5188af=db[_0x40b6('0x29')][_0x40b6('0x2a')];_0x8d3b0e[_0x40b6('0x2b')]=_[_0x40b6('0x2c')](_0x5188af);_0x8d3b0e[_0x40b6('0x2d')]=_[_0x40b6('0x2c')](_0x1ab344['query']);_0x8d3b0e[_0x40b6('0x2e')]=_[_0x40b6('0x2f')](_0x8d3b0e[_0x40b6('0x2b')],_0x8d3b0e[_0x40b6('0x2d')]);_0x422e2b[_0x40b6('0x30')]=_[_0x40b6('0x2f')](_0x8d3b0e[_0x40b6('0x2b')],qs['fields'](_0x1ab344[_0x40b6('0x2d')][_0x40b6('0x31')]));_0x422e2b[_0x40b6('0x30')]=_0x422e2b[_0x40b6('0x30')][_0x40b6('0x32')]?_0x422e2b['attributes']:_0x8d3b0e['model'];if(!_0x1ab344[_0x40b6('0x2d')][_0x40b6('0x33')]('nolimit')){_0x422e2b[_0x40b6('0x34')]=qs['limit'](_0x1ab344['query'][_0x40b6('0x34')]);_0x422e2b[_0x40b6('0x1d')]=qs['offset'](_0x1ab344[_0x40b6('0x2d')][_0x40b6('0x1d')]);}_0x422e2b[_0x40b6('0x35')]=qs['sort'](_0x1ab344[_0x40b6('0x2d')][_0x40b6('0x36')]);_0x422e2b[_0x40b6('0x37')]=qs[_0x40b6('0x2e')](_[_0x40b6('0x38')](_0x1ab344[_0x40b6('0x2d')],_0x8d3b0e[_0x40b6('0x2e')]));if(_0x1ab344[_0x40b6('0x2d')]['filter']){_0x422e2b[_0x40b6('0x37')]=_[_0x40b6('0x39')](_0x422e2b[_0x40b6('0x37')],{'$or':_[_0x40b6('0x3a')](_0x5188af,function(_0x4c021b){if(_0x4c021b[_0x40b6('0x3b')][_0x40b6('0x3c')]!==_0x40b6('0x3d')){var _0x4d81fd={};_0x4d81fd[_0x4c021b[_0x40b6('0x3e')]]={'$like':'%'+_0x1ab344['query']['filter']+'%'};return _0x4d81fd;}})});}_0x422e2b=_['merge']({},_0x422e2b,_0x1ab344[_0x40b6('0x3f')]);var _0x31b962={'where':_0x422e2b[_0x40b6('0x37')]};return db[_0x40b6('0x29')][_0x40b6('0x1c')](_0x31b962)[_0x40b6('0x24')](function(_0x1a373a){_0x34cec3['count']=_0x1a373a;if(_0x1ab344['query']['includeAll']){_0x422e2b[_0x40b6('0x40')]=[{'all':!![]}];}return db['SACreditNoteDetail']['findAll'](_0x422e2b);})[_0x40b6('0x24')](function(_0x4f9503){_0x34cec3['rows']=_0x4f9503;return _0x34cec3;})[_0x40b6('0x24')](respondWithFilteredResult(_0x20cda9,_0x422e2b))[_0x40b6('0x41')](handleError(_0x20cda9,null));};exports[_0x40b6('0x42')]=function(_0x3cebac,_0x5ce995){var _0x383e37={'raw':![],'where':{'id':_0x3cebac[_0x40b6('0x43')]['id']}},_0x3a21a2={};_0x3a21a2['model']=_['keys'](db['SACreditNoteDetail']['rawAttributes']);_0x3a21a2[_0x40b6('0x2d')]=_['keys'](_0x3cebac[_0x40b6('0x2d')]);_0x3a21a2[_0x40b6('0x2e')]=_[_0x40b6('0x2f')](_0x3a21a2['model'],_0x3a21a2[_0x40b6('0x2d')]);_0x383e37['attributes']=_['intersection'](_0x3a21a2[_0x40b6('0x2b')],qs[_0x40b6('0x31')](_0x3cebac[_0x40b6('0x2d')][_0x40b6('0x31')]));_0x383e37[_0x40b6('0x30')]=_0x383e37['attributes'][_0x40b6('0x32')]?_0x383e37[_0x40b6('0x30')]:_0x3a21a2[_0x40b6('0x2b')];if(_0x3cebac[_0x40b6('0x2d')][_0x40b6('0x44')]){_0x383e37[_0x40b6('0x40')]=[{'all':!![]}];}_0x383e37=_[_0x40b6('0x39')]({},_0x383e37,_0x3cebac[_0x40b6('0x3f')]);return db[_0x40b6('0x29')][_0x40b6('0x45')](_0x383e37)[_0x40b6('0x24')](handleEntityNotFound(_0x5ce995,null))[_0x40b6('0x24')](respondWithResult(_0x5ce995,null))[_0x40b6('0x41')](handleError(_0x5ce995,null));};exports[_0x40b6('0x46')]=function(_0x4f1d16,_0x5c4e31){return db[_0x40b6('0x29')][_0x40b6('0x46')](_0x4f1d16[_0x40b6('0x47')],{})['then'](respondWithResult(_0x5c4e31,0xc9))[_0x40b6('0x41')](handleError(_0x5c4e31,null));};exports[_0x40b6('0x23')]=function(_0x40a366,_0x16bae4){if(_0x40a366[_0x40b6('0x47')]['id']){delete _0x40a366[_0x40b6('0x47')]['id'];}return db['SACreditNoteDetail'][_0x40b6('0x45')]({'where':{'id':_0x40a366[_0x40b6('0x43')]['id']}})['then'](handleEntityNotFound(_0x16bae4,null))[_0x40b6('0x24')](saveUpdates(_0x40a366[_0x40b6('0x47')],null))[_0x40b6('0x24')](respondWithResult(_0x16bae4,null))['catch'](handleError(_0x16bae4,null));};exports[_0x40b6('0x25')]=function(_0x1c59cb,_0x17ebc5){return db[_0x40b6('0x29')][_0x40b6('0x45')]({'where':{'id':_0x1c59cb[_0x40b6('0x43')]['id']}})[_0x40b6('0x24')](handleEntityNotFound(_0x17ebc5,null))[_0x40b6('0x24')](removeEntity(_0x17ebc5,null))[_0x40b6('0x41')](handleError(_0x17ebc5,null));};exports[_0x40b6('0x48')]=function(_0x497e9a,_0x5687f1){return db['SACreditNoteDetail']['describe']()[_0x40b6('0x24')](respondWithResult(_0x5687f1,null))[_0x40b6('0x41')](handleError(_0x5687f1,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js index 52a4e33..3edfe33 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c4a=['define','SACreditNoteDetail','sa_creditNote_details','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./saCreditNoteDetail.attributes','exports'];(function(_0x5c4e4e,_0x126618){var _0x246195=function(_0x2bbc33){while(--_0x2bbc33){_0x5c4e4e['push'](_0x5c4e4e['shift']());}};_0x246195(++_0x126618);}(_0x0c4a,0x12f));var _0xa0c4=function(_0x4905fd,_0xde9d0f){_0x4905fd=_0x4905fd-0x0;var _0x3c9f2e=_0x0c4a[_0x4905fd];return _0x3c9f2e;};'use strict';var _=require(_0xa0c4('0x0'));var util=require(_0xa0c4('0x1'));var logger=require(_0xa0c4('0x2'))(_0xa0c4('0x3'));var moment=require(_0xa0c4('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0c4('0x6'));var attributes=require(_0xa0c4('0x7'));module[_0xa0c4('0x8')]=function(_0x5a6060,_0x4faede){return _0x5a6060[_0xa0c4('0x9')](_0xa0c4('0xa'),attributes,{'tableName':_0xa0c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x331b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./saCreditNoteDetail.attributes','exports','define','lodash'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0x331b,0x149));var _0xb331=function(_0x4a0691,_0x4977ee){_0x4a0691=_0x4a0691-0x0;var _0x32730e=_0x331b[_0x4a0691];return _0x32730e;};'use strict';var _=require(_0xb331('0x0'));var util=require('util');var logger=require(_0xb331('0x1'))(_0xb331('0x2'));var moment=require(_0xb331('0x3'));var BPromise=require('bluebird');var rp=require(_0xb331('0x4'));var fs=require('fs');var path=require(_0xb331('0x5'));var rimraf=require(_0xb331('0x6'));var config=require(_0xb331('0x7'));var attributes=require(_0xb331('0x8'));module[_0xb331('0x9')]=function(_0x3b8f79,_0xc53650){return _0x3b8f79[_0xb331('0xa')]('SACreditNoteDetail',attributes,{'tableName':'sa_creditNote_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js index b16687e..e29feaf 100644 --- a/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js +++ b/server/api/saCreditNoteDetail/saCreditNoteDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc35a=['request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SACreditNoteDetail,\x20%s,\x20%s'];(function(_0x181d96,_0x4ffa6f){var _0x3dc5c3=function(_0x12ced6){while(--_0x12ced6){_0x181d96['push'](_0x181d96['shift']());}};_0x3dc5c3(++_0x4ffa6f);}(_0xc35a,0x182));var _0xac35=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc35a[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xac35('0x0'));var moment=require(_0xac35('0x1'));var BPromise=require(_0xac35('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac35('0x4'));var logger=require(_0xac35('0x5'))(_0xac35('0x6'));var config=require('../../config/environment');var jayson=require(_0xac35('0x7'));var client=jayson['client'][_0xac35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a9eef,_0x57348a,_0x759e88){return new BPromise(function(_0x246542,_0x35c51c){return client[_0xac35('0x9')](_0x1a9eef,_0x759e88)[_0xac35('0xa')](function(_0x5effe9){logger[_0xac35('0xb')](_0xac35('0xc'),_0x57348a,_0xac35('0xd'));logger[_0xac35('0xe')]('SACreditNoteDetail,\x20%s,\x20%s,\x20%s',_0x57348a,'request\x20sent',JSON[_0xac35('0xf')](_0x5effe9));if(_0x5effe9[_0xac35('0x10')]){if(_0x5effe9[_0xac35('0x10')]['code']===0x1f4){logger[_0xac35('0x10')](_0xac35('0xc'),_0x57348a,_0x5effe9[_0xac35('0x10')][_0xac35('0x11')]);return _0x35c51c(_0x5effe9['error'][_0xac35('0x11')]);}logger['error']('SACreditNoteDetail,\x20%s,\x20%s',_0x57348a,_0x5effe9[_0xac35('0x10')][_0xac35('0x11')]);return _0x246542(_0x5effe9['error']['message']);}else{logger['info'](_0xac35('0xc'),_0x57348a,_0xac35('0xd'));_0x246542(_0x5effe9[_0xac35('0x12')]['message']);}})['catch'](function(_0x450298){logger[_0xac35('0x10')](_0xac35('0xc'),_0x57348a,_0x450298);_0x35c51c(_0x450298);});});} \ No newline at end of file +var _0x6f21=['request\x20sent','debug','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','SACreditNoteDetail,\x20%s,\x20%s'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x6f21,0x1a4));var _0x16f2=function(_0x13d0e0,_0x2a661b){_0x13d0e0=_0x13d0e0-0x0;var _0x18deff=_0x6f21[_0x13d0e0];return _0x18deff;};'use strict';var _=require('lodash');var util=require(_0x16f2('0x0'));var moment=require('moment');var BPromise=require(_0x16f2('0x1'));var rs=require(_0x16f2('0x2'));var fs=require('fs');var Redis=require(_0x16f2('0x3'));var db=require(_0x16f2('0x4'))['db'];var utils=require(_0x16f2('0x5'));var logger=require(_0x16f2('0x6'))('rpc');var config=require(_0x16f2('0x7'));var jayson=require(_0x16f2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x324b2b,_0x4dad74,_0x114927){return new BPromise(function(_0x23e05a,_0x50ed3f){return client[_0x16f2('0x9')](_0x324b2b,_0x114927)['then'](function(_0x464705){logger[_0x16f2('0xa')](_0x16f2('0xb'),_0x4dad74,_0x16f2('0xc'));logger[_0x16f2('0xd')]('SACreditNoteDetail,\x20%s,\x20%s,\x20%s',_0x4dad74,_0x16f2('0xc'),JSON['stringify'](_0x464705));if(_0x464705[_0x16f2('0xe')]){if(_0x464705[_0x16f2('0xe')][_0x16f2('0xf')]===0x1f4){logger[_0x16f2('0xe')]('SACreditNoteDetail,\x20%s,\x20%s',_0x4dad74,_0x464705[_0x16f2('0xe')][_0x16f2('0x10')]);return _0x50ed3f(_0x464705[_0x16f2('0xe')][_0x16f2('0x10')]);}logger[_0x16f2('0xe')](_0x16f2('0xb'),_0x4dad74,_0x464705[_0x16f2('0xe')][_0x16f2('0x10')]);return _0x23e05a(_0x464705[_0x16f2('0xe')]['message']);}else{logger[_0x16f2('0xa')](_0x16f2('0xb'),_0x4dad74,_0x16f2('0xc'));_0x23e05a(_0x464705['result'][_0x16f2('0x10')]);}})[_0x16f2('0x11')](function(_0x3213fb){logger[_0x16f2('0xe')](_0x16f2('0xb'),_0x4dad74,_0x3213fb);_0x50ed3f(_0x3213fb);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/index.js b/server/api/saCreditNoteNumber/index.js index 277f3de..bf38d21 100644 --- a/server/api/saCreditNoteNumber/index.js +++ b/server/api/saCreditNoteNumber/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99bb=['isAuthenticated','show','post','create','put','/:id','update','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./saCreditNoteNumber.controller','get','index','/describe'];(function(_0x105611,_0x10ad65){var _0x42bb12=function(_0x4d3228){while(--_0x4d3228){_0x105611['push'](_0x105611['shift']());}};_0x42bb12(++_0x10ad65);}(_0x99bb,0x86));var _0xb99b=function(_0x4a06fb,_0x664507){_0x4a06fb=_0x4a06fb-0x0;var _0x2616e9=_0x99bb[_0x4a06fb];return _0x2616e9;};'use strict';var multer=require(_0xb99b('0x0'));var util=require('util');var path=require(_0xb99b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb99b('0x2'));var router=express[_0xb99b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb99b('0x4'));var config=require(_0xb99b('0x5'));var controller=require(_0xb99b('0x6'));router[_0xb99b('0x7')]('/',auth['isAuthenticated'](),controller[_0xb99b('0x8')]);router[_0xb99b('0x7')](_0xb99b('0x9'),auth[_0xb99b('0xa')](),controller['describe']);router['get']('/:id',auth[_0xb99b('0xa')](),controller[_0xb99b('0xb')]);router[_0xb99b('0xc')]('/',auth[_0xb99b('0xa')](),controller[_0xb99b('0xd')]);router[_0xb99b('0xe')](_0xb99b('0xf'),auth[_0xb99b('0xa')](),controller[_0xb99b('0x10')]);router['delete']('/:id',auth[_0xb99b('0xa')](),controller['destroy']);module[_0xb99b('0x11')]=router; \ No newline at end of file +var _0xebbd=['/:id','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./saCreditNoteNumber.controller','isAuthenticated','index','get','/describe','post','put'];(function(_0x5f4ec0,_0x1092e7){var _0xa57cc6=function(_0x1f0f55){while(--_0x1f0f55){_0x5f4ec0['push'](_0x5f4ec0['shift']());}};_0xa57cc6(++_0x1092e7);}(_0xebbd,0x1f2));var _0xdebb=function(_0x11088e,_0x5a5df3){_0x11088e=_0x11088e-0x0;var _0x3d8f41=_0xebbd[_0x11088e];return _0x3d8f41;};'use strict';var multer=require('multer');var util=require(_0xdebb('0x0'));var path=require(_0xdebb('0x1'));var timeout=require(_0xdebb('0x2'));var express=require('express');var router=express[_0xdebb('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdebb('0x4'));var controller=require(_0xdebb('0x5'));router['get']('/',auth[_0xdebb('0x6')](),controller[_0xdebb('0x7')]);router[_0xdebb('0x8')](_0xdebb('0x9'),auth[_0xdebb('0x6')](),controller['describe']);router[_0xdebb('0x8')]('/:id',auth[_0xdebb('0x6')](),controller['show']);router[_0xdebb('0xa')]('/',auth[_0xdebb('0x6')](),controller['create']);router[_0xdebb('0xb')](_0xdebb('0xc'),auth[_0xdebb('0x6')](),controller['update']);router['delete'](_0xdebb('0xc'),auth[_0xdebb('0x6')](),controller[_0xdebb('0xd')]);module[_0xdebb('0xe')]=router; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js index c59af75..f41e7d1 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6f6=['sequelize','exports','INTEGER'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xe6f6,0xcf));var _0x6e6f=function(_0x131e9b,_0x568d58){_0x131e9b=_0x131e9b-0x0;var _0x380d10=_0xe6f6[_0x131e9b];return _0x380d10;};'use strict';var Sequelize=require(_0x6e6f('0x0'));module[_0x6e6f('0x1')]={'year':{'type':Sequelize[_0x6e6f('0x2')]},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe59e=['exports','INTEGER'];(function(_0x38c861,_0x37c537){var _0x147e86=function(_0x52c5c4){while(--_0x52c5c4){_0x38c861['push'](_0x38c861['shift']());}};_0x147e86(++_0x37c537);}(_0xe59e,0x1e2));var _0xee59=function(_0x211a3e,_0x2fc134){_0x211a3e=_0x211a3e-0x0;var _0x4c4f13=_0xe59e[_0x211a3e];return _0x4c4f13;};'use strict';var Sequelize=require('sequelize');module[_0xee59('0x0')]={'year':{'type':Sequelize['INTEGER']},'number':{'type':Sequelize[_0xee59('0x1')]}}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js index 78cb002..3387b92 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f7=['where','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','describe','html-pdf','eml-format','request-promise','bluebird','mustache','path','to-csv','ejs','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','SACreditNoteNumber','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0x13eddd,_0x2bb439){var _0x3125b5=function(_0x5c2188){while(--_0x5c2188){_0x13eddd['push'](_0x13eddd['shift']());}};_0x3125b5(++_0x2bb439);}(_0x64f7,0x11b));var _0x764f=function(_0x428f3a,_0x5ddbab){_0x428f3a=_0x428f3a-0x0;var _0x3501be=_0x64f7[_0x428f3a];return _0x3501be;};'use strict';var pdf=require(_0x764f('0x0'));var emlformat=require(_0x764f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x764f('0x2'));var moment=require('moment');var BPromise=require(_0x764f('0x3'));var Mustache=require(_0x764f('0x4'));var util=require('util');var path=require(_0x764f('0x5'));var sox=require('sox');var csv=require(_0x764f('0x6'));var ejs=require(_0x764f('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x764f('0x6'));var querystring=require(_0x764f('0x8'));var Papa=require(_0x764f('0x9'));var Redis=require(_0x764f('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x764f('0xb'));var hardwareService=require(_0x764f('0xc'));var logger=require('../../config/logger')(_0x764f('0xd'));var utils=require(_0x764f('0xe'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb970c,_0x5f56ee){_0x5f56ee=_0x5f56ee||0xcc;return function(_0x2394e8){if(_0x2394e8){return _0xdb970c[_0x764f('0xf')](_0x5f56ee);}return _0xdb970c[_0x764f('0x10')](_0x5f56ee)['end']();};}function respondWithResult(_0x14f324,_0x2282f3){_0x2282f3=_0x2282f3||0xc8;return function(_0x5965da){if(_0x5965da){return _0x14f324[_0x764f('0x10')](_0x2282f3)[_0x764f('0x11')](_0x5965da);}};}function respondWithFilteredResult(_0x4c5b88,_0x136355){return function(_0x40dbd7){if(_0x40dbd7){var _0x347128=_0x40dbd7[_0x764f('0x12')],_0x2bd730=_0x136355['offset'],_0x3ebb85=_0x136355[_0x764f('0x13')]+_0x136355[_0x764f('0x14')],_0x1d80ab;if(_0x3ebb85>=_0x347128){_0x3ebb85=_0x347128;_0x1d80ab=0xc8;}else{_0x1d80ab=0xce;}_0x4c5b88[_0x764f('0x10')](_0x1d80ab);return _0x4c5b88[_0x764f('0x15')](_0x764f('0x16'),_0x2bd730+'-'+_0x3ebb85+'/'+_0x347128)['json'](_0x40dbd7);}return null;};}function patchUpdates(_0x1b436e){return function(_0x4f6600){try{jsonpatch[_0x764f('0x17')](_0x4f6600,_0x1b436e,!![]);}catch(_0xe4bef6){return BPromise[_0x764f('0x18')](_0xe4bef6);}return _0x4f6600[_0x764f('0x19')]();};}function saveUpdates(_0x5b7728,_0x445a18){return function(_0x3b4ebe){if(_0x3b4ebe){return _0x3b4ebe[_0x764f('0x1a')](_0x5b7728)[_0x764f('0x1b')](function(_0xa976ba){return _0xa976ba;});}return null;};}function removeEntity(_0x4b4d37,_0x429fed){return function(_0x437805){if(_0x437805){return _0x437805[_0x764f('0x1c')]()[_0x764f('0x1b')](function(){_0x4b4d37['status'](0xcc)[_0x764f('0x1d')]();});}};}function handleEntityNotFound(_0x1e0156,_0x4027e5){return function(_0x1305ee){if(!_0x1305ee){_0x1e0156[_0x764f('0xf')](0x194);}return _0x1305ee;};}function handleError(_0x30e7e6,_0x1489ff){_0x1489ff=_0x1489ff||0x1f4;return function(_0x325f58){logger[_0x764f('0x1e')](_0x325f58[_0x764f('0x1f')]);if(_0x325f58[_0x764f('0x20')]){delete _0x325f58['name'];}_0x30e7e6[_0x764f('0x10')](_0x1489ff)['send'](_0x325f58);};}exports[_0x764f('0x21')]=function(_0x26de92,_0x11c2b4){var _0x4cbc60={},_0x384ffc={},_0x32a93a={'count':0x0,'rows':[]};var _0x22a6c0=db[_0x764f('0x22')]['rawAttributes'];_0x384ffc['model']=_[_0x764f('0x23')](_0x22a6c0);_0x384ffc['query']=_['keys'](_0x26de92[_0x764f('0x24')]);_0x384ffc[_0x764f('0x25')]=_['intersection'](_0x384ffc[_0x764f('0x26')],_0x384ffc[_0x764f('0x24')]);_0x4cbc60['attributes']=_[_0x764f('0x27')](_0x384ffc[_0x764f('0x26')],qs[_0x764f('0x28')](_0x26de92['query'][_0x764f('0x28')]));_0x4cbc60[_0x764f('0x29')]=_0x4cbc60[_0x764f('0x29')]['length']?_0x4cbc60['attributes']:_0x384ffc[_0x764f('0x26')];if(!_0x26de92[_0x764f('0x24')][_0x764f('0x2a')](_0x764f('0x2b'))){_0x4cbc60[_0x764f('0x14')]=qs['limit'](_0x26de92[_0x764f('0x24')]['limit']);_0x4cbc60[_0x764f('0x13')]=qs[_0x764f('0x13')](_0x26de92[_0x764f('0x24')]['offset']);}_0x4cbc60['order']=qs[_0x764f('0x2c')](_0x26de92[_0x764f('0x24')][_0x764f('0x2c')]);_0x4cbc60['where']=qs['filters'](_[_0x764f('0x2d')](_0x26de92[_0x764f('0x24')],_0x384ffc[_0x764f('0x25')]));if(_0x26de92[_0x764f('0x24')][_0x764f('0x2e')]){_0x4cbc60[_0x764f('0x2f')]=_[_0x764f('0x30')](_0x4cbc60[_0x764f('0x2f')],{'$or':_[_0x764f('0x31')](_0x22a6c0,function(_0x5ed88a){if(_0x5ed88a[_0x764f('0x32')][_0x764f('0x33')]!==_0x764f('0x34')){var _0x888ced={};_0x888ced[_0x5ed88a[_0x764f('0x35')]]={'$like':'%'+_0x26de92['query'][_0x764f('0x2e')]+'%'};return _0x888ced;}})});}_0x4cbc60=_['merge']({},_0x4cbc60,_0x26de92[_0x764f('0x36')]);var _0x2a1749={'where':_0x4cbc60['where']};return db[_0x764f('0x22')][_0x764f('0x12')](_0x2a1749)[_0x764f('0x1b')](function(_0x56e122){_0x32a93a[_0x764f('0x12')]=_0x56e122;if(_0x26de92[_0x764f('0x24')][_0x764f('0x37')]){_0x4cbc60['include']=[{'all':!![]}];}return db[_0x764f('0x22')][_0x764f('0x38')](_0x4cbc60);})[_0x764f('0x1b')](function(_0x42c119){_0x32a93a[_0x764f('0x39')]=_0x42c119;return _0x32a93a;})['then'](respondWithFilteredResult(_0x11c2b4,_0x4cbc60))[_0x764f('0x3a')](handleError(_0x11c2b4,null));};exports[_0x764f('0x3b')]=function(_0x307f10,_0x570c65){var _0x9fec0d={'raw':![],'where':{'id':_0x307f10['params']['id']}},_0x484602={};_0x484602[_0x764f('0x26')]=_[_0x764f('0x23')](db['SACreditNoteNumber'][_0x764f('0x3c')]);_0x484602['query']=_['keys'](_0x307f10[_0x764f('0x24')]);_0x484602[_0x764f('0x25')]=_['intersection'](_0x484602[_0x764f('0x26')],_0x484602['query']);_0x9fec0d['attributes']=_[_0x764f('0x27')](_0x484602[_0x764f('0x26')],qs[_0x764f('0x28')](_0x307f10[_0x764f('0x24')][_0x764f('0x28')]));_0x9fec0d[_0x764f('0x29')]=_0x9fec0d[_0x764f('0x29')]['length']?_0x9fec0d[_0x764f('0x29')]:_0x484602['model'];if(_0x307f10[_0x764f('0x24')][_0x764f('0x37')]){_0x9fec0d[_0x764f('0x3d')]=[{'all':!![]}];}_0x9fec0d=_[_0x764f('0x30')]({},_0x9fec0d,_0x307f10[_0x764f('0x36')]);return db[_0x764f('0x22')][_0x764f('0x3e')](_0x9fec0d)[_0x764f('0x1b')](handleEntityNotFound(_0x570c65,null))['then'](respondWithResult(_0x570c65,null))['catch'](handleError(_0x570c65,null));};exports[_0x764f('0x3f')]=function(_0x187cdd,_0x52aeb5){return db['SACreditNoteNumber'][_0x764f('0x3f')](_0x187cdd[_0x764f('0x40')],{})[_0x764f('0x1b')](respondWithResult(_0x52aeb5,0xc9))['catch'](handleError(_0x52aeb5,null));};exports['update']=function(_0xf613bc,_0x9efc3d){if(_0xf613bc[_0x764f('0x40')]['id']){delete _0xf613bc[_0x764f('0x40')]['id'];}return db['SACreditNoteNumber'][_0x764f('0x3e')]({'where':{'id':_0xf613bc['params']['id']}})[_0x764f('0x1b')](handleEntityNotFound(_0x9efc3d,null))[_0x764f('0x1b')](saveUpdates(_0xf613bc[_0x764f('0x40')],null))[_0x764f('0x1b')](respondWithResult(_0x9efc3d,null))[_0x764f('0x3a')](handleError(_0x9efc3d,null));};exports[_0x764f('0x1c')]=function(_0x2ee175,_0x321ee0){return db[_0x764f('0x22')][_0x764f('0x3e')]({'where':{'id':_0x2ee175['params']['id']}})[_0x764f('0x1b')](handleEntityNotFound(_0x321ee0,null))[_0x764f('0x1b')](removeEntity(_0x321ee0,null))['catch'](handleError(_0x321ee0,null));};exports[_0x764f('0x41')]=function(_0x53b918,_0x530348){return db[_0x764f('0x22')][_0x764f('0x41')]()[_0x764f('0x1b')](respondWithResult(_0x530348,null))[_0x764f('0x3a')](handleError(_0x530348,null));}; \ No newline at end of file +var _0x803f=['query','filters','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','send','SACreditNoteNumber','keys'];(function(_0xa6d8a7,_0x25ba46){var _0x558b52=function(_0x28abe7){while(--_0x28abe7){_0xa6d8a7['push'](_0xa6d8a7['shift']());}};_0x558b52(++_0x25ba46);}(_0x803f,0x64));var _0xf803=function(_0x2396bb,_0x19ba1c){_0x2396bb=_0x2396bb-0x0;var _0x363d04=_0x803f[_0x2396bb];return _0x363d04;};'use strict';var pdf=require(_0xf803('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf803('0x1'));var zipdir=require(_0xf803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf803('0x3'));var moment=require(_0xf803('0x4'));var BPromise=require(_0xf803('0x5'));var Mustache=require(_0xf803('0x6'));var util=require(_0xf803('0x7'));var path=require('path');var sox=require(_0xf803('0x8'));var csv=require(_0xf803('0x9'));var ejs=require(_0xf803('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf803('0xb'));var crypto=require(_0xf803('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf803('0xd'));var toCsv=require(_0xf803('0x9'));var querystring=require(_0xf803('0xe'));var Papa=require('papaparse');var Redis=require(_0xf803('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf803('0x10'));var hardwareService=require(_0xf803('0x11'));var logger=require('../../config/logger')(_0xf803('0x12'));var utils=require(_0xf803('0x13'));var config=require(_0xf803('0x14'));var db=require(_0xf803('0x15'))['db'];function respondWithStatusCode(_0x28399a,_0x50d9ef){_0x50d9ef=_0x50d9ef||0xcc;return function(_0x510e4a){if(_0x510e4a){return _0x28399a[_0xf803('0x16')](_0x50d9ef);}return _0x28399a[_0xf803('0x17')](_0x50d9ef)['end']();};}function respondWithResult(_0x30fc8a,_0x48fc69){_0x48fc69=_0x48fc69||0xc8;return function(_0x272b96){if(_0x272b96){return _0x30fc8a[_0xf803('0x17')](_0x48fc69)[_0xf803('0x18')](_0x272b96);}};}function respondWithFilteredResult(_0x28b872,_0x58a80b){return function(_0xf08041){if(_0xf08041){var _0x135230=_0xf08041[_0xf803('0x19')],_0x3d07ca=_0x58a80b[_0xf803('0x1a')],_0x11373e=_0x58a80b['offset']+_0x58a80b['limit'],_0x2aaef6;if(_0x11373e>=_0x135230){_0x11373e=_0x135230;_0x2aaef6=0xc8;}else{_0x2aaef6=0xce;}_0x28b872[_0xf803('0x17')](_0x2aaef6);return _0x28b872[_0xf803('0x1b')](_0xf803('0x1c'),_0x3d07ca+'-'+_0x11373e+'/'+_0x135230)[_0xf803('0x18')](_0xf08041);}return null;};}function patchUpdates(_0x29e28f){return function(_0x3536f6){try{jsonpatch[_0xf803('0x1d')](_0x3536f6,_0x29e28f,!![]);}catch(_0x246364){return BPromise[_0xf803('0x1e')](_0x246364);}return _0x3536f6[_0xf803('0x1f')]();};}function saveUpdates(_0x5dc3ca,_0x19c6e7){return function(_0x252421){if(_0x252421){return _0x252421[_0xf803('0x20')](_0x5dc3ca)[_0xf803('0x21')](function(_0x38aa68){return _0x38aa68;});}return null;};}function removeEntity(_0x48bc46,_0x2db4c2){return function(_0x1a7879){if(_0x1a7879){return _0x1a7879['destroy']()[_0xf803('0x21')](function(){_0x48bc46[_0xf803('0x17')](0xcc)[_0xf803('0x22')]();});}};}function handleEntityNotFound(_0x23c46b,_0x20ed90){return function(_0x4717ac){if(!_0x4717ac){_0x23c46b[_0xf803('0x16')](0x194);}return _0x4717ac;};}function handleError(_0x20d897,_0x393d0c){_0x393d0c=_0x393d0c||0x1f4;return function(_0x1e5a2a){logger[_0xf803('0x23')](_0x1e5a2a['stack']);if(_0x1e5a2a[_0xf803('0x24')]){delete _0x1e5a2a[_0xf803('0x24')];}_0x20d897[_0xf803('0x17')](_0x393d0c)[_0xf803('0x25')](_0x1e5a2a);};}exports['index']=function(_0x483890,_0x17a57a){var _0xa5d34={},_0x1c8937={},_0x4cc98b={'count':0x0,'rows':[]};var _0x8a1ab=db[_0xf803('0x26')]['rawAttributes'];_0x1c8937['model']=_[_0xf803('0x27')](_0x8a1ab);_0x1c8937[_0xf803('0x28')]=_['keys'](_0x483890[_0xf803('0x28')]);_0x1c8937[_0xf803('0x29')]=_[_0xf803('0x2a')](_0x1c8937['model'],_0x1c8937[_0xf803('0x28')]);_0xa5d34[_0xf803('0x2b')]=_[_0xf803('0x2a')](_0x1c8937[_0xf803('0x2c')],qs[_0xf803('0x2d')](_0x483890[_0xf803('0x28')][_0xf803('0x2d')]));_0xa5d34[_0xf803('0x2b')]=_0xa5d34[_0xf803('0x2b')][_0xf803('0x2e')]?_0xa5d34['attributes']:_0x1c8937[_0xf803('0x2c')];if(!_0x483890['query'][_0xf803('0x2f')]('nolimit')){_0xa5d34[_0xf803('0x30')]=qs[_0xf803('0x30')](_0x483890[_0xf803('0x28')][_0xf803('0x30')]);_0xa5d34[_0xf803('0x1a')]=qs[_0xf803('0x1a')](_0x483890[_0xf803('0x28')]['offset']);}_0xa5d34[_0xf803('0x31')]=qs[_0xf803('0x32')](_0x483890[_0xf803('0x28')][_0xf803('0x32')]);_0xa5d34[_0xf803('0x33')]=qs[_0xf803('0x29')](_[_0xf803('0x34')](_0x483890[_0xf803('0x28')],_0x1c8937[_0xf803('0x29')]));if(_0x483890[_0xf803('0x28')]['filter']){_0xa5d34['where']=_[_0xf803('0x35')](_0xa5d34['where'],{'$or':_['map'](_0x8a1ab,function(_0xd0dbbd){if(_0xd0dbbd['type'][_0xf803('0x36')]!==_0xf803('0x37')){var _0x2cae0c={};_0x2cae0c[_0xd0dbbd[_0xf803('0x38')]]={'$like':'%'+_0x483890[_0xf803('0x28')][_0xf803('0x39')]+'%'};return _0x2cae0c;}})});}_0xa5d34=_[_0xf803('0x35')]({},_0xa5d34,_0x483890[_0xf803('0x3a')]);var _0x450be6={'where':_0xa5d34[_0xf803('0x33')]};return db['SACreditNoteNumber'][_0xf803('0x19')](_0x450be6)[_0xf803('0x21')](function(_0x3b7a62){_0x4cc98b[_0xf803('0x19')]=_0x3b7a62;if(_0x483890[_0xf803('0x28')]['includeAll']){_0xa5d34[_0xf803('0x3b')]=[{'all':!![]}];}return db[_0xf803('0x26')][_0xf803('0x3c')](_0xa5d34);})['then'](function(_0x584c6b){_0x4cc98b['rows']=_0x584c6b;return _0x4cc98b;})[_0xf803('0x21')](respondWithFilteredResult(_0x17a57a,_0xa5d34))[_0xf803('0x3d')](handleError(_0x17a57a,null));};exports['show']=function(_0x375ca2,_0x5079cc){var _0x3c7e3b={'raw':![],'where':{'id':_0x375ca2[_0xf803('0x3e')]['id']}},_0x14ee21={};_0x14ee21[_0xf803('0x2c')]=_[_0xf803('0x27')](db[_0xf803('0x26')][_0xf803('0x3f')]);_0x14ee21[_0xf803('0x28')]=_[_0xf803('0x27')](_0x375ca2['query']);_0x14ee21[_0xf803('0x29')]=_['intersection'](_0x14ee21[_0xf803('0x2c')],_0x14ee21[_0xf803('0x28')]);_0x3c7e3b[_0xf803('0x2b')]=_['intersection'](_0x14ee21[_0xf803('0x2c')],qs['fields'](_0x375ca2[_0xf803('0x28')]['fields']));_0x3c7e3b[_0xf803('0x2b')]=_0x3c7e3b[_0xf803('0x2b')]['length']?_0x3c7e3b[_0xf803('0x2b')]:_0x14ee21[_0xf803('0x2c')];if(_0x375ca2[_0xf803('0x28')][_0xf803('0x40')]){_0x3c7e3b[_0xf803('0x3b')]=[{'all':!![]}];}_0x3c7e3b=_[_0xf803('0x35')]({},_0x3c7e3b,_0x375ca2[_0xf803('0x3a')]);return db[_0xf803('0x26')][_0xf803('0x41')](_0x3c7e3b)[_0xf803('0x21')](handleEntityNotFound(_0x5079cc,null))[_0xf803('0x21')](respondWithResult(_0x5079cc,null))[_0xf803('0x3d')](handleError(_0x5079cc,null));};exports[_0xf803('0x42')]=function(_0x528faf,_0x3c97c0){return db['SACreditNoteNumber'][_0xf803('0x42')](_0x528faf[_0xf803('0x43')],{})['then'](respondWithResult(_0x3c97c0,0xc9))[_0xf803('0x3d')](handleError(_0x3c97c0,null));};exports['update']=function(_0x29800f,_0x348647){if(_0x29800f['body']['id']){delete _0x29800f[_0xf803('0x43')]['id'];}return db[_0xf803('0x26')][_0xf803('0x41')]({'where':{'id':_0x29800f[_0xf803('0x3e')]['id']}})[_0xf803('0x21')](handleEntityNotFound(_0x348647,null))[_0xf803('0x21')](saveUpdates(_0x29800f[_0xf803('0x43')],null))[_0xf803('0x21')](respondWithResult(_0x348647,null))['catch'](handleError(_0x348647,null));};exports[_0xf803('0x44')]=function(_0x501382,_0x1756b3){return db[_0xf803('0x26')]['find']({'where':{'id':_0x501382['params']['id']}})[_0xf803('0x21')](handleEntityNotFound(_0x1756b3,null))['then'](removeEntity(_0x1756b3,null))[_0xf803('0x3d')](handleError(_0x1756b3,null));};exports[_0xf803('0x45')]=function(_0x3b96a2,_0x40674f){return db['SACreditNoteNumber'][_0xf803('0x45')]()[_0xf803('0x21')](respondWithResult(_0x40674f,null))[_0xf803('0x3d')](handleError(_0x40674f,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js index 792def2..07a3afa 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cc2=['exports','SACreditNoteNumber','sa_creditNote_numbers','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saCreditNoteNumber.attributes'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8cc2,0x1cb));var _0x28cc=function(_0xc18746,_0x7387a9){_0xc18746=_0xc18746-0x0;var _0x56c6cd=_0x8cc2[_0xc18746];return _0x56c6cd;};'use strict';var _=require('lodash');var util=require(_0x28cc('0x0'));var logger=require('../../config/logger')(_0x28cc('0x1'));var moment=require(_0x28cc('0x2'));var BPromise=require(_0x28cc('0x3'));var rp=require(_0x28cc('0x4'));var fs=require('fs');var path=require(_0x28cc('0x5'));var rimraf=require(_0x28cc('0x6'));var config=require(_0x28cc('0x7'));var attributes=require(_0x28cc('0x8'));module[_0x28cc('0x9')]=function(_0x16916d,_0x14a531){return _0x16916d['define'](_0x28cc('0xa'),attributes,{'tableName':_0x28cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d78=['sa_creditNote_numbers','lodash','util','request-promise','rimraf','./saCreditNoteNumber.attributes','exports','define'];(function(_0x2877a8,_0x585084){var _0xc9501a=function(_0x3ded61){while(--_0x3ded61){_0x2877a8['push'](_0x2877a8['shift']());}};_0xc9501a(++_0x585084);}(_0x6d78,0x1c9));var _0x86d7=function(_0x3e2810,_0x104d34){_0x3e2810=_0x3e2810-0x0;var _0x577d18=_0x6d78[_0x3e2810];return _0x577d18;};'use strict';var _=require(_0x86d7('0x0'));var util=require(_0x86d7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d7('0x3'));var config=require('../../config/environment');var attributes=require(_0x86d7('0x4'));module[_0x86d7('0x5')]=function(_0x3f2659,_0x22c163){return _0x3f2659[_0x86d7('0x6')]('SACreditNoteNumber',attributes,{'tableName':_0x86d7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js index c2f5c91..dc10847 100644 --- a/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js +++ b/server/api/saCreditNoteNumber/saCreditNoteNumber.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4285=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SACreditNoteNumber,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x460d27,_0x522d83){var _0xa11cb2=function(_0x1f9636){while(--_0x1f9636){_0x460d27['push'](_0x460d27['shift']());}};_0xa11cb2(++_0x522d83);}(_0x4285,0xf3));var _0x5428=function(_0x18dd3d,_0x58196f){_0x18dd3d=_0x18dd3d-0x0;var _0x42ab14=_0x4285[_0x18dd3d];return _0x42ab14;};'use strict';var _=require(_0x5428('0x0'));var util=require(_0x5428('0x1'));var moment=require(_0x5428('0x2'));var BPromise=require(_0x5428('0x3'));var rs=require(_0x5428('0x4'));var fs=require('fs');var Redis=require(_0x5428('0x5'));var db=require(_0x5428('0x6'))['db'];var utils=require(_0x5428('0x7'));var logger=require('../../config/logger')(_0x5428('0x8'));var config=require(_0x5428('0x9'));var jayson=require(_0x5428('0xa'));var client=jayson[_0x5428('0xb')][_0x5428('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x130a47,_0x30821c,_0x1dbf06){return new BPromise(function(_0x4ab545,_0x25b6e2){return client[_0x5428('0xd')](_0x130a47,_0x1dbf06)[_0x5428('0xe')](function(_0x4b59c1){logger[_0x5428('0xf')](_0x5428('0x10'),_0x30821c,_0x5428('0x11'));logger[_0x5428('0x12')]('SACreditNoteNumber,\x20%s,\x20%s,\x20%s',_0x30821c,_0x5428('0x11'),JSON['stringify'](_0x4b59c1));if(_0x4b59c1['error']){if(_0x4b59c1[_0x5428('0x13')][_0x5428('0x14')]===0x1f4){logger[_0x5428('0x13')](_0x5428('0x10'),_0x30821c,_0x4b59c1[_0x5428('0x13')][_0x5428('0x15')]);return _0x25b6e2(_0x4b59c1['error'][_0x5428('0x15')]);}logger['error'](_0x5428('0x10'),_0x30821c,_0x4b59c1[_0x5428('0x13')][_0x5428('0x15')]);return _0x4ab545(_0x4b59c1['error'][_0x5428('0x15')]);}else{logger[_0x5428('0xf')](_0x5428('0x10'),_0x30821c,_0x5428('0x11'));_0x4ab545(_0x4b59c1[_0x5428('0x16')][_0x5428('0x15')]);}})[_0x5428('0x17')](function(_0x2fb7b7){logger['error'](_0x5428('0x10'),_0x30821c,_0x2fb7b7);_0x25b6e2(_0x2fb7b7);});});} \ No newline at end of file +var _0x39bf=['message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SACreditNoteNumber,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5322a6,_0x36fecc){var _0x536e66=function(_0x16205e){while(--_0x16205e){_0x5322a6['push'](_0x5322a6['shift']());}};_0x536e66(++_0x36fecc);}(_0x39bf,0xc8));var _0xf39b=function(_0x16b02c,_0x32ae92){_0x16b02c=_0x16b02c-0x0;var _0x4802a1=_0x39bf[_0x16b02c];return _0x4802a1;};'use strict';var _=require(_0xf39b('0x0'));var util=require('util');var moment=require(_0xf39b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf39b('0x2'));var db=require(_0xf39b('0x3'))['db'];var utils=require(_0xf39b('0x4'));var logger=require(_0xf39b('0x5'))(_0xf39b('0x6'));var config=require(_0xf39b('0x7'));var jayson=require(_0xf39b('0x8'));var client=jayson[_0xf39b('0x9')][_0xf39b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3295b2,_0x53a885,_0xba0bdf){return new BPromise(function(_0x5a7b6b,_0x1a85f5){return client[_0xf39b('0xb')](_0x3295b2,_0xba0bdf)[_0xf39b('0xc')](function(_0x4d84ed){logger[_0xf39b('0xd')](_0xf39b('0xe'),_0x53a885,_0xf39b('0xf'));logger[_0xf39b('0x10')]('SACreditNoteNumber,\x20%s,\x20%s,\x20%s',_0x53a885,_0xf39b('0xf'),JSON[_0xf39b('0x11')](_0x4d84ed));if(_0x4d84ed[_0xf39b('0x12')]){if(_0x4d84ed['error'][_0xf39b('0x13')]===0x1f4){logger[_0xf39b('0x12')]('SACreditNoteNumber,\x20%s,\x20%s',_0x53a885,_0x4d84ed[_0xf39b('0x12')][_0xf39b('0x14')]);return _0x1a85f5(_0x4d84ed[_0xf39b('0x12')][_0xf39b('0x14')]);}logger['error']('SACreditNoteNumber,\x20%s,\x20%s',_0x53a885,_0x4d84ed[_0xf39b('0x12')][_0xf39b('0x14')]);return _0x5a7b6b(_0x4d84ed['error'][_0xf39b('0x14')]);}else{logger[_0xf39b('0xd')](_0xf39b('0xe'),_0x53a885,_0xf39b('0xf'));_0x5a7b6b(_0x4d84ed['result']['message']);}})[_0xf39b('0x15')](function(_0x215f9b){logger[_0xf39b('0x12')](_0xf39b('0xe'),_0x53a885,_0x215f9b);_0x1a85f5(_0x215f9b);});});} \ No newline at end of file diff --git a/server/api/saDossier/index.js b/server/api/saDossier/index.js index f05663a..c5b2b90 100644 --- a/server/api/saDossier/index.js +++ b/server/api/saDossier/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7291=['./saDossier.controller','index','get','/describe','isAuthenticated','describe','post','put','/:id','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13a599,_0x9c2347){var _0x2ab78f=function(_0x17e5a8){while(--_0x17e5a8){_0x13a599['push'](_0x13a599['shift']());}};_0x2ab78f(++_0x9c2347);}(_0x7291,0xad));var _0x1729=function(_0x217928,_0x296b23){_0x217928=_0x217928-0x0;var _0x434f52=_0x7291[_0x217928];return _0x434f52;};'use strict';var multer=require(_0x1729('0x0'));var util=require(_0x1729('0x1'));var path=require('path');var timeout=require(_0x1729('0x2'));var express=require('express');var router=express[_0x1729('0x3')]();var auth=require(_0x1729('0x4'));var interaction=require(_0x1729('0x5'));var config=require(_0x1729('0x6'));var controller=require(_0x1729('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1729('0x8')]);router[_0x1729('0x9')](_0x1729('0xa'),auth[_0x1729('0xb')](),controller[_0x1729('0xc')]);router[_0x1729('0x9')]('/:id',auth[_0x1729('0xb')](),controller['show']);router[_0x1729('0xd')]('/',auth[_0x1729('0xb')](),controller['create']);router[_0x1729('0xe')](_0x1729('0xf'),auth[_0x1729('0xb')](),controller['update']);router['delete'](_0x1729('0xf'),auth['isAuthenticated'](),controller[_0x1729('0x10')]);module[_0x1729('0x11')]=router; \ No newline at end of file +var _0xf40b=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete'];(function(_0x27b23c,_0x3fb802){var _0x3aeda4=function(_0x540d8f){while(--_0x540d8f){_0x27b23c['push'](_0x27b23c['shift']());}};_0x3aeda4(++_0x3fb802);}(_0xf40b,0x190));var _0xbf40=function(_0x48fec7,_0x30b839){_0x48fec7=_0x48fec7-0x0;var _0x4f43de=_0xf40b[_0x48fec7];return _0x4f43de;};'use strict';var multer=require(_0xbf40('0x0'));var util=require(_0xbf40('0x1'));var path=require('path');var timeout=require(_0xbf40('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xbf40('0x3'));var interaction=require(_0xbf40('0x4'));var config=require(_0xbf40('0x5'));var controller=require('./saDossier.controller');router[_0xbf40('0x6')]('/',auth[_0xbf40('0x7')](),controller['index']);router[_0xbf40('0x6')](_0xbf40('0x8'),auth[_0xbf40('0x7')](),controller[_0xbf40('0x9')]);router[_0xbf40('0x6')]('/:id',auth[_0xbf40('0x7')](),controller[_0xbf40('0xa')]);router[_0xbf40('0xb')]('/',auth[_0xbf40('0x7')](),controller[_0xbf40('0xc')]);router[_0xbf40('0xd')](_0xbf40('0xe'),auth[_0xbf40('0x7')](),controller['update']);router[_0xbf40('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.attributes.js b/server/api/saDossier/saDossier.attributes.js index 40d4f55..3b59c72 100644 --- a/server/api/saDossier/saDossier.attributes.js +++ b/server/api/saDossier/saDossier.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78f4=['exports','STRING','TEXT'];(function(_0x543951,_0xc3790c){var _0x414c3d=function(_0x51b408){while(--_0x51b408){_0x543951['push'](_0x543951['shift']());}};_0x414c3d(++_0xc3790c);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x478f('0x0')]={'name':{'type':Sequelize[_0x478f('0x1')],'allowNull':![]},'agentFullname':{'type':Sequelize[_0x478f('0x1')]},'note':{'type':Sequelize[_0x478f('0x2')]}}; \ No newline at end of file +var _0x7de9=['exports','STRING','TEXT'];(function(_0x5a5f67,_0x48bc20){var _0x54d85e=function(_0x334772){while(--_0x334772){_0x5a5f67['push'](_0x5a5f67['shift']());}};_0x54d85e(++_0x48bc20);}(_0x7de9,0xdb));var _0x97de=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x7de9[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require('sequelize');module[_0x97de('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'agentFullname':{'type':Sequelize[_0x97de('0x1')]},'note':{'type':Sequelize[_0x97de('0x2')]}}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.controller.js b/server/api/saDossier/saDossier.controller.js index 6ce3871..4d64d1d 100644 --- a/server/api/saDossier/saDossier.controller.js +++ b/server/api/saDossier/saDossier.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8c=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','SADossier','rawAttributes','keys','query','filters','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','params','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4c7d82,_0x4a0fcf){var _0x3913c=function(_0x46f5aa){while(--_0x46f5aa){_0x4c7d82['push'](_0x4c7d82['shift']());}};_0x3913c(++_0x4a0fcf);}(_0x3f8c,0x104));var _0xc3f8=function(_0x3fbf5b,_0x1adc7a){_0x3fbf5b=_0x3fbf5b-0x0;var _0x11ceb8=_0x3f8c[_0x3fbf5b];return _0x11ceb8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc3f8('0x0'));var zipdir=require(_0xc3f8('0x1'));var jsonpatch=require(_0xc3f8('0x2'));var rp=require(_0xc3f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc3f8('0x4'));var csv=require(_0xc3f8('0x5'));var ejs=require(_0xc3f8('0x6'));var fs=require('fs');var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x5'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3f8('0x10'))(_0xc3f8('0x11'));var utils=require(_0xc3f8('0x12'));var config=require(_0xc3f8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x313714,_0x28e4c7){_0x28e4c7=_0x28e4c7||0xcc;return function(_0x256e3d){if(_0x256e3d){return _0x313714[_0xc3f8('0x14')](_0x28e4c7);}return _0x313714['status'](_0x28e4c7)[_0xc3f8('0x15')]();};}function respondWithResult(_0x1cb7a9,_0x3d7b67){_0x3d7b67=_0x3d7b67||0xc8;return function(_0x44632a){if(_0x44632a){return _0x1cb7a9[_0xc3f8('0x16')](_0x3d7b67)[_0xc3f8('0x17')](_0x44632a);}};}function respondWithFilteredResult(_0x29e2b6,_0x4731cd){return function(_0x12b141){if(_0x12b141){var _0x2fd8e8=_0x12b141['count'],_0x3cb28a=_0x4731cd[_0xc3f8('0x18')],_0x2a9f64=_0x4731cd['offset']+_0x4731cd['limit'],_0x29d031;if(_0x2a9f64>=_0x2fd8e8){_0x2a9f64=_0x2fd8e8;_0x29d031=0xc8;}else{_0x29d031=0xce;}_0x29e2b6[_0xc3f8('0x16')](_0x29d031);return _0x29e2b6[_0xc3f8('0x19')](_0xc3f8('0x1a'),_0x3cb28a+'-'+_0x2a9f64+'/'+_0x2fd8e8)[_0xc3f8('0x17')](_0x12b141);}return null;};}function patchUpdates(_0x47a185){return function(_0x3e75a4){try{jsonpatch[_0xc3f8('0x1b')](_0x3e75a4,_0x47a185,!![]);}catch(_0x5df6f9){return BPromise[_0xc3f8('0x1c')](_0x5df6f9);}return _0x3e75a4['save']();};}function saveUpdates(_0x3912c7,_0x42ce65){return function(_0x3b2e98){if(_0x3b2e98){return _0x3b2e98['update'](_0x3912c7)['then'](function(_0x113cd2){return _0x113cd2;});}return null;};}function removeEntity(_0x2a7096,_0x1436d7){return function(_0x25a4c7){if(_0x25a4c7){return _0x25a4c7[_0xc3f8('0x1d')]()[_0xc3f8('0x1e')](function(){_0x2a7096[_0xc3f8('0x16')](0xcc)[_0xc3f8('0x15')]();});}};}function handleEntityNotFound(_0x49aeea,_0x571f92){return function(_0x4b83f0){if(!_0x4b83f0){_0x49aeea[_0xc3f8('0x14')](0x194);}return _0x4b83f0;};}function handleError(_0x5e1d14,_0x11335){_0x11335=_0x11335||0x1f4;return function(_0x3f196d){logger['error'](_0x3f196d[_0xc3f8('0x1f')]);if(_0x3f196d[_0xc3f8('0x20')]){delete _0x3f196d[_0xc3f8('0x20')];}_0x5e1d14[_0xc3f8('0x16')](_0x11335)[_0xc3f8('0x21')](_0x3f196d);};}exports[_0xc3f8('0x22')]=function(_0xf1d460,_0x7f14ad){var _0x21b002={},_0xbea3b8={},_0x22c8e6={'count':0x0,'rows':[]};var _0x394629=db[_0xc3f8('0x23')][_0xc3f8('0x24')];_0xbea3b8['model']=_[_0xc3f8('0x25')](_0x394629);_0xbea3b8[_0xc3f8('0x26')]=_[_0xc3f8('0x25')](_0xf1d460['query']);_0xbea3b8[_0xc3f8('0x27')]=_['intersection'](_0xbea3b8[_0xc3f8('0x28')],_0xbea3b8[_0xc3f8('0x26')]);_0x21b002['attributes']=_['intersection'](_0xbea3b8[_0xc3f8('0x28')],qs[_0xc3f8('0x29')](_0xf1d460[_0xc3f8('0x26')][_0xc3f8('0x29')]));_0x21b002[_0xc3f8('0x2a')]=_0x21b002[_0xc3f8('0x2a')][_0xc3f8('0x2b')]?_0x21b002[_0xc3f8('0x2a')]:_0xbea3b8[_0xc3f8('0x28')];if(!_0xf1d460[_0xc3f8('0x26')]['hasOwnProperty'](_0xc3f8('0x2c'))){_0x21b002[_0xc3f8('0x2d')]=qs[_0xc3f8('0x2d')](_0xf1d460[_0xc3f8('0x26')][_0xc3f8('0x2d')]);_0x21b002['offset']=qs['offset'](_0xf1d460[_0xc3f8('0x26')][_0xc3f8('0x18')]);}_0x21b002[_0xc3f8('0x2e')]=qs[_0xc3f8('0x2f')](_0xf1d460[_0xc3f8('0x26')]['sort']);_0x21b002[_0xc3f8('0x30')]=qs[_0xc3f8('0x27')](_[_0xc3f8('0x31')](_0xf1d460['query'],_0xbea3b8[_0xc3f8('0x27')]));if(_0xf1d460[_0xc3f8('0x26')][_0xc3f8('0x32')]){_0x21b002['where']=_[_0xc3f8('0x33')](_0x21b002[_0xc3f8('0x30')],{'$or':_['map'](_0x394629,function(_0x2bf1c0){if(_0x2bf1c0[_0xc3f8('0x34')][_0xc3f8('0x35')]!==_0xc3f8('0x36')){var _0x1f4c55={};_0x1f4c55[_0x2bf1c0[_0xc3f8('0x37')]]={'$like':'%'+_0xf1d460['query'][_0xc3f8('0x32')]+'%'};return _0x1f4c55;}})});}_0x21b002=_[_0xc3f8('0x33')]({},_0x21b002,_0xf1d460[_0xc3f8('0x38')]);var _0x2f589d={'where':_0x21b002[_0xc3f8('0x30')]};return db['SADossier'][_0xc3f8('0x39')](_0x2f589d)[_0xc3f8('0x1e')](function(_0xaa4c98){_0x22c8e6['count']=_0xaa4c98;if(_0xf1d460[_0xc3f8('0x26')][_0xc3f8('0x3a')]){_0x21b002[_0xc3f8('0x3b')]=[{'all':!![]}];}return db[_0xc3f8('0x23')]['findAll'](_0x21b002);})[_0xc3f8('0x1e')](function(_0x45d416){_0x22c8e6[_0xc3f8('0x3c')]=_0x45d416;return _0x22c8e6;})[_0xc3f8('0x1e')](respondWithFilteredResult(_0x7f14ad,_0x21b002))['catch'](handleError(_0x7f14ad,null));};exports[_0xc3f8('0x3d')]=function(_0x5db44d,_0x5d144b){var _0x2923a8={'raw':![],'where':{'id':_0x5db44d[_0xc3f8('0x3e')]['id']}},_0x1f3aef={};_0x1f3aef[_0xc3f8('0x28')]=_['keys'](db['SADossier'][_0xc3f8('0x24')]);_0x1f3aef[_0xc3f8('0x26')]=_[_0xc3f8('0x25')](_0x5db44d[_0xc3f8('0x26')]);_0x1f3aef[_0xc3f8('0x27')]=_[_0xc3f8('0x3f')](_0x1f3aef[_0xc3f8('0x28')],_0x1f3aef[_0xc3f8('0x26')]);_0x2923a8[_0xc3f8('0x2a')]=_[_0xc3f8('0x3f')](_0x1f3aef[_0xc3f8('0x28')],qs['fields'](_0x5db44d[_0xc3f8('0x26')][_0xc3f8('0x29')]));_0x2923a8['attributes']=_0x2923a8[_0xc3f8('0x2a')][_0xc3f8('0x2b')]?_0x2923a8['attributes']:_0x1f3aef[_0xc3f8('0x28')];if(_0x5db44d[_0xc3f8('0x26')][_0xc3f8('0x3a')]){_0x2923a8[_0xc3f8('0x3b')]=[{'all':!![]}];}_0x2923a8=_[_0xc3f8('0x33')]({},_0x2923a8,_0x5db44d[_0xc3f8('0x38')]);return db[_0xc3f8('0x23')][_0xc3f8('0x40')](_0x2923a8)[_0xc3f8('0x1e')](handleEntityNotFound(_0x5d144b,null))[_0xc3f8('0x1e')](respondWithResult(_0x5d144b,null))[_0xc3f8('0x41')](handleError(_0x5d144b,null));};exports['create']=function(_0x35ce2f,_0x42b071){return db['SADossier'][_0xc3f8('0x42')](_0x35ce2f[_0xc3f8('0x43')],{})[_0xc3f8('0x1e')](respondWithResult(_0x42b071,0xc9))[_0xc3f8('0x41')](handleError(_0x42b071,null));};exports['update']=function(_0x4d80e4,_0x35ef68){if(_0x4d80e4[_0xc3f8('0x43')]['id']){delete _0x4d80e4[_0xc3f8('0x43')]['id'];}return db['SADossier'][_0xc3f8('0x40')]({'where':{'id':_0x4d80e4[_0xc3f8('0x3e')]['id']}})[_0xc3f8('0x1e')](handleEntityNotFound(_0x35ef68,null))[_0xc3f8('0x1e')](saveUpdates(_0x4d80e4[_0xc3f8('0x43')],null))['then'](respondWithResult(_0x35ef68,null))[_0xc3f8('0x41')](handleError(_0x35ef68,null));};exports[_0xc3f8('0x1d')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x23')][_0xc3f8('0x40')]({'where':{'id':_0x5961ab[_0xc3f8('0x3e')]['id']}})[_0xc3f8('0x1e')](handleEntityNotFound(_0x1becae,null))[_0xc3f8('0x1e')](removeEntity(_0x1becae,null))[_0xc3f8('0x41')](handleError(_0x1becae,null));};exports['describe']=function(_0x38d132,_0x257be1){return db['SADossier'][_0xc3f8('0x44')]()[_0xc3f8('0x1e')](respondWithResult(_0x257be1,null))[_0xc3f8('0x41')](handleError(_0x257be1,null));}; \ No newline at end of file +var _0x44a3=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','count','offset','set','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','SADossier','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','describe','html-pdf'];(function(_0x42a7d2,_0x1f727b){var _0x16d4bc=function(_0x2550cc){while(--_0x2550cc){_0x42a7d2['push'](_0x42a7d2['shift']());}};_0x16d4bc(++_0x1f727b);}(_0x44a3,0x1a9));var _0x344a=function(_0x2f1d2f,_0x527d85){_0x2f1d2f=_0x2f1d2f-0x0;var _0x2874cf=_0x44a3[_0x2f1d2f];return _0x2874cf;};'use strict';var pdf=require(_0x344a('0x0'));var emlformat=require(_0x344a('0x1'));var rimraf=require(_0x344a('0x2'));var zipdir=require(_0x344a('0x3'));var jsonpatch=require(_0x344a('0x4'));var rp=require(_0x344a('0x5'));var moment=require(_0x344a('0x6'));var BPromise=require(_0x344a('0x7'));var Mustache=require('mustache');var util=require(_0x344a('0x8'));var path=require(_0x344a('0x9'));var sox=require(_0x344a('0xa'));var csv=require(_0x344a('0xb'));var ejs=require(_0x344a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xb'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var hardwareService=require(_0x344a('0x12'));var logger=require('../../config/logger')(_0x344a('0x13'));var utils=require('../../config/utils');var config=require(_0x344a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd53a4f,_0x2a2aad){_0x2a2aad=_0x2a2aad||0xcc;return function(_0x57e42e){if(_0x57e42e){return _0xd53a4f['sendStatus'](_0x2a2aad);}return _0xd53a4f[_0x344a('0x15')](_0x2a2aad)[_0x344a('0x16')]();};}function respondWithResult(_0x3a974e,_0x3a854c){_0x3a854c=_0x3a854c||0xc8;return function(_0x5a0df6){if(_0x5a0df6){return _0x3a974e[_0x344a('0x15')](_0x3a854c)['json'](_0x5a0df6);}};}function respondWithFilteredResult(_0x4032d7,_0x2360e9){return function(_0xce0f65){if(_0xce0f65){var _0x6e1639=_0xce0f65[_0x344a('0x17')],_0x58c8cd=_0x2360e9[_0x344a('0x18')],_0x54a643=_0x2360e9[_0x344a('0x18')]+_0x2360e9['limit'],_0x3609ce;if(_0x54a643>=_0x6e1639){_0x54a643=_0x6e1639;_0x3609ce=0xc8;}else{_0x3609ce=0xce;}_0x4032d7[_0x344a('0x15')](_0x3609ce);return _0x4032d7[_0x344a('0x19')]('Content-Range',_0x58c8cd+'-'+_0x54a643+'/'+_0x6e1639)[_0x344a('0x1a')](_0xce0f65);}return null;};}function patchUpdates(_0x274016){return function(_0x3e936c){try{jsonpatch[_0x344a('0x1b')](_0x3e936c,_0x274016,!![]);}catch(_0x13b382){return BPromise[_0x344a('0x1c')](_0x13b382);}return _0x3e936c[_0x344a('0x1d')]();};}function saveUpdates(_0xb44a47,_0x1079ae){return function(_0x450922){if(_0x450922){return _0x450922['update'](_0xb44a47)[_0x344a('0x1e')](function(_0x4232eb){return _0x4232eb;});}return null;};}function removeEntity(_0xe0bdd4,_0x21216d){return function(_0x240be3){if(_0x240be3){return _0x240be3[_0x344a('0x1f')]()[_0x344a('0x1e')](function(){_0xe0bdd4[_0x344a('0x15')](0xcc)[_0x344a('0x16')]();});}};}function handleEntityNotFound(_0x27f527,_0x90070c){return function(_0x3b2ab9){if(!_0x3b2ab9){_0x27f527[_0x344a('0x20')](0x194);}return _0x3b2ab9;};}function handleError(_0x266fce,_0x5d11f9){_0x5d11f9=_0x5d11f9||0x1f4;return function(_0x6ccfba){logger['error'](_0x6ccfba[_0x344a('0x21')]);if(_0x6ccfba['name']){delete _0x6ccfba[_0x344a('0x22')];}_0x266fce[_0x344a('0x15')](_0x5d11f9)[_0x344a('0x23')](_0x6ccfba);};}exports[_0x344a('0x24')]=function(_0x26f059,_0x28749b){var _0x229ccd={},_0x114637={},_0x4f2499={'count':0x0,'rows':[]};var _0x283f63=db[_0x344a('0x25')][_0x344a('0x26')];_0x114637[_0x344a('0x27')]=_[_0x344a('0x28')](_0x283f63);_0x114637[_0x344a('0x29')]=_['keys'](_0x26f059[_0x344a('0x29')]);_0x114637['filters']=_['intersection'](_0x114637[_0x344a('0x27')],_0x114637[_0x344a('0x29')]);_0x229ccd[_0x344a('0x2a')]=_['intersection'](_0x114637['model'],qs['fields'](_0x26f059[_0x344a('0x29')][_0x344a('0x2b')]));_0x229ccd[_0x344a('0x2a')]=_0x229ccd['attributes'][_0x344a('0x2c')]?_0x229ccd[_0x344a('0x2a')]:_0x114637[_0x344a('0x27')];if(!_0x26f059[_0x344a('0x29')][_0x344a('0x2d')](_0x344a('0x2e'))){_0x229ccd[_0x344a('0x2f')]=qs['limit'](_0x26f059[_0x344a('0x29')]['limit']);_0x229ccd['offset']=qs['offset'](_0x26f059[_0x344a('0x29')][_0x344a('0x18')]);}_0x229ccd[_0x344a('0x30')]=qs[_0x344a('0x31')](_0x26f059[_0x344a('0x29')][_0x344a('0x31')]);_0x229ccd['where']=qs[_0x344a('0x32')](_[_0x344a('0x33')](_0x26f059[_0x344a('0x29')],_0x114637['filters']));if(_0x26f059[_0x344a('0x29')][_0x344a('0x34')]){_0x229ccd[_0x344a('0x35')]=_[_0x344a('0x36')](_0x229ccd[_0x344a('0x35')],{'$or':_['map'](_0x283f63,function(_0x305e8b){if(_0x305e8b[_0x344a('0x37')][_0x344a('0x38')]!==_0x344a('0x39')){var _0x475a9f={};_0x475a9f[_0x305e8b['field']]={'$like':'%'+_0x26f059[_0x344a('0x29')][_0x344a('0x34')]+'%'};return _0x475a9f;}})});}_0x229ccd=_[_0x344a('0x36')]({},_0x229ccd,_0x26f059[_0x344a('0x3a')]);var _0x204f22={'where':_0x229ccd['where']};return db[_0x344a('0x25')][_0x344a('0x17')](_0x204f22)[_0x344a('0x1e')](function(_0x3356fb){_0x4f2499[_0x344a('0x17')]=_0x3356fb;if(_0x26f059[_0x344a('0x29')][_0x344a('0x3b')]){_0x229ccd[_0x344a('0x3c')]=[{'all':!![]}];}return db['SADossier'][_0x344a('0x3d')](_0x229ccd);})[_0x344a('0x1e')](function(_0x3d34c3){_0x4f2499[_0x344a('0x3e')]=_0x3d34c3;return _0x4f2499;})[_0x344a('0x1e')](respondWithFilteredResult(_0x28749b,_0x229ccd))['catch'](handleError(_0x28749b,null));};exports[_0x344a('0x3f')]=function(_0x2736e9,_0x7a33d7){var _0x1fb4f5={'raw':![],'where':{'id':_0x2736e9[_0x344a('0x40')]['id']}},_0x2f5132={};_0x2f5132[_0x344a('0x27')]=_[_0x344a('0x28')](db[_0x344a('0x25')]['rawAttributes']);_0x2f5132[_0x344a('0x29')]=_[_0x344a('0x28')](_0x2736e9[_0x344a('0x29')]);_0x2f5132[_0x344a('0x32')]=_['intersection'](_0x2f5132[_0x344a('0x27')],_0x2f5132[_0x344a('0x29')]);_0x1fb4f5[_0x344a('0x2a')]=_[_0x344a('0x41')](_0x2f5132[_0x344a('0x27')],qs[_0x344a('0x2b')](_0x2736e9[_0x344a('0x29')][_0x344a('0x2b')]));_0x1fb4f5[_0x344a('0x2a')]=_0x1fb4f5[_0x344a('0x2a')][_0x344a('0x2c')]?_0x1fb4f5['attributes']:_0x2f5132[_0x344a('0x27')];if(_0x2736e9[_0x344a('0x29')]['includeAll']){_0x1fb4f5[_0x344a('0x3c')]=[{'all':!![]}];}_0x1fb4f5=_[_0x344a('0x36')]({},_0x1fb4f5,_0x2736e9['options']);return db[_0x344a('0x25')][_0x344a('0x42')](_0x1fb4f5)['then'](handleEntityNotFound(_0x7a33d7,null))[_0x344a('0x1e')](respondWithResult(_0x7a33d7,null))[_0x344a('0x43')](handleError(_0x7a33d7,null));};exports[_0x344a('0x44')]=function(_0x5150b7,_0x1157ed){return db['SADossier'][_0x344a('0x44')](_0x5150b7[_0x344a('0x45')],{})[_0x344a('0x1e')](respondWithResult(_0x1157ed,0xc9))[_0x344a('0x43')](handleError(_0x1157ed,null));};exports['update']=function(_0x519ddd,_0x306f46){if(_0x519ddd[_0x344a('0x45')]['id']){delete _0x519ddd[_0x344a('0x45')]['id'];}return db[_0x344a('0x25')][_0x344a('0x42')]({'where':{'id':_0x519ddd[_0x344a('0x40')]['id']}})[_0x344a('0x1e')](handleEntityNotFound(_0x306f46,null))[_0x344a('0x1e')](saveUpdates(_0x519ddd[_0x344a('0x45')],null))[_0x344a('0x1e')](respondWithResult(_0x306f46,null))['catch'](handleError(_0x306f46,null));};exports[_0x344a('0x1f')]=function(_0x2d9858,_0x6fad37){return db[_0x344a('0x25')]['find']({'where':{'id':_0x2d9858[_0x344a('0x40')]['id']}})['then'](handleEntityNotFound(_0x6fad37,null))['then'](removeEntity(_0x6fad37,null))[_0x344a('0x43')](handleError(_0x6fad37,null));};exports[_0x344a('0x46')]=function(_0x5917cc,_0x13ec1a){return db[_0x344a('0x25')][_0x344a('0x46')]()[_0x344a('0x1e')](respondWithResult(_0x13ec1a,null))['catch'](handleError(_0x13ec1a,null));}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.model.js b/server/api/saDossier/saDossier.model.js index ec80131..81e9915 100644 --- a/server/api/saDossier/saDossier.model.js +++ b/server/api/saDossier/saDossier.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','SADossier','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./saDossier.attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'sa_dossiers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./saDossier.attributes','exports','define','sa_dossiers','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x55ca,0x126));var _0xa55c=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0x55ca[_0x6465b0];return _0x4884fe;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('SADossier',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.rpc.js b/server/api/saDossier/saDossier.rpc.js index 31ad155..33fff15 100644 --- a/server/api/saDossier/saDossier.rpc.js +++ b/server/api/saDossier/saDossier.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa2c=['request','then','info','SADossier,\x20%s,\x20%s','request\x20sent','debug','SADossier,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xaa2c,0x79));var _0xcaa2=function(_0x55bfbd,_0x16f64f){_0x55bfbd=_0x55bfbd-0x0;var _0x190dec=_0xaa2c[_0x55bfbd];return _0x190dec;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var moment=require('moment');var BPromise=require(_0xcaa2('0x2'));var rs=require(_0xcaa2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcaa2('0x4'));var logger=require(_0xcaa2('0x5'))(_0xcaa2('0x6'));var config=require(_0xcaa2('0x7'));var jayson=require(_0xcaa2('0x8'));var client=jayson[_0xcaa2('0x9')][_0xcaa2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae7fe,_0x3e2679,_0x298193){return new BPromise(function(_0x3f2365,_0x83b11c){return client[_0xcaa2('0xb')](_0x4ae7fe,_0x298193)[_0xcaa2('0xc')](function(_0xc5b849){logger[_0xcaa2('0xd')](_0xcaa2('0xe'),_0x3e2679,_0xcaa2('0xf'));logger[_0xcaa2('0x10')](_0xcaa2('0x11'),_0x3e2679,_0xcaa2('0xf'),JSON['stringify'](_0xc5b849));if(_0xc5b849[_0xcaa2('0x12')]){if(_0xc5b849[_0xcaa2('0x12')][_0xcaa2('0x13')]===0x1f4){logger[_0xcaa2('0x12')](_0xcaa2('0xe'),_0x3e2679,_0xc5b849[_0xcaa2('0x12')]['message']);return _0x83b11c(_0xc5b849[_0xcaa2('0x12')][_0xcaa2('0x14')]);}logger[_0xcaa2('0x12')]('SADossier,\x20%s,\x20%s',_0x3e2679,_0xc5b849[_0xcaa2('0x12')]['message']);return _0x3f2365(_0xc5b849['error'][_0xcaa2('0x14')]);}else{logger['info'](_0xcaa2('0xe'),_0x3e2679,_0xcaa2('0xf'));_0x3f2365(_0xc5b849['result'][_0xcaa2('0x14')]);}})[_0xcaa2('0x15')](function(_0x4c0bf3){logger[_0xcaa2('0x12')](_0xcaa2('0xe'),_0x3e2679,_0x4c0bf3);_0x83b11c(_0x4c0bf3);});});} \ No newline at end of file +var _0x2ba3=['rpc','../../config/environment','jayson/promise','client','http','then','info','SADossier,\x20%s,\x20%s','request\x20sent','debug','SADossier,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../config/utils'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x2ba3,0xe3));var _0x32ba=function(_0x4d44a7,_0x39fc41){_0x4d44a7=_0x4d44a7-0x0;var _0x4a669f=_0x2ba3[_0x4d44a7];return _0x4a669f;};'use strict';var _=require(_0x32ba('0x0'));var util=require(_0x32ba('0x1'));var moment=require('moment');var BPromise=require(_0x32ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32ba('0x3'));var logger=require('../../config/logger')(_0x32ba('0x4'));var config=require(_0x32ba('0x5'));var jayson=require(_0x32ba('0x6'));var client=jayson[_0x32ba('0x7')][_0x32ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x167cfa,_0x233294,_0x120daa){return new BPromise(function(_0x59998c,_0x268e15){return client['request'](_0x167cfa,_0x120daa)[_0x32ba('0x9')](function(_0x1a051b){logger[_0x32ba('0xa')](_0x32ba('0xb'),_0x233294,_0x32ba('0xc'));logger[_0x32ba('0xd')](_0x32ba('0xe'),_0x233294,_0x32ba('0xc'),JSON[_0x32ba('0xf')](_0x1a051b));if(_0x1a051b[_0x32ba('0x10')]){if(_0x1a051b[_0x32ba('0x10')][_0x32ba('0x11')]===0x1f4){logger[_0x32ba('0x10')](_0x32ba('0xb'),_0x233294,_0x1a051b['error'][_0x32ba('0x12')]);return _0x268e15(_0x1a051b['error'][_0x32ba('0x12')]);}logger[_0x32ba('0x10')](_0x32ba('0xb'),_0x233294,_0x1a051b[_0x32ba('0x10')][_0x32ba('0x12')]);return _0x59998c(_0x1a051b[_0x32ba('0x10')][_0x32ba('0x12')]);}else{logger[_0x32ba('0xa')](_0x32ba('0xb'),_0x233294,_0x32ba('0xc'));_0x59998c(_0x1a051b[_0x32ba('0x13')]['message']);}})[_0x32ba('0x14')](function(_0x2d37f4){logger[_0x32ba('0x10')](_0x32ba('0xb'),_0x233294,_0x2d37f4);_0x268e15(_0x2d37f4);});});} \ No newline at end of file diff --git a/server/api/saInvoice/index.js b/server/api/saInvoice/index.js index 7fcbb16..904cd54 100644 --- a/server/api/saInvoice/index.js +++ b/server/api/saInvoice/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4119=['show','/:id/download','post','create','/:id/automaticInvoiceCreditnote','automaticInvoiceCreditnote','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/getInvoicesNumberByYear','/:id'];(function(_0x3e15af,_0x16d1f5){var _0x312cb6=function(_0x583ad5){while(--_0x583ad5){_0x3e15af['push'](_0x3e15af['shift']());}};_0x312cb6(++_0x16d1f5);}(_0x4119,0xfa));var _0x9411=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x4119[_0x411add];return _0x238242;};'use strict';var multer=require(_0x9411('0x0'));var util=require(_0x9411('0x1'));var path=require(_0x9411('0x2'));var timeout=require(_0x9411('0x3'));var express=require(_0x9411('0x4'));var router=express[_0x9411('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9411('0x6'));var config=require(_0x9411('0x7'));var controller=require('./saInvoice.controller');router[_0x9411('0x8')]('/',auth[_0x9411('0x9')](),controller[_0x9411('0xa')]);router[_0x9411('0x8')](_0x9411('0xb'),auth[_0x9411('0x9')](),controller['describe']);router[_0x9411('0x8')](_0x9411('0xc'),auth[_0x9411('0x9')](),controller['getInvoicesNumberByYear']);router[_0x9411('0x8')](_0x9411('0xd'),auth[_0x9411('0x9')](),controller[_0x9411('0xe')]);router[_0x9411('0x8')](_0x9411('0xf'),auth[_0x9411('0x9')](),controller['getInvoicePDF']);router[_0x9411('0x10')]('/',auth['isAuthenticated'](),controller[_0x9411('0x11')]);router[_0x9411('0x10')](_0x9411('0x12'),auth['isAuthenticated'](),controller[_0x9411('0x13')]);router[_0x9411('0x14')](_0x9411('0xd'),auth[_0x9411('0x9')](),controller[_0x9411('0x15')]);router['delete'](_0x9411('0xd'),auth['isAuthenticated'](),controller[_0x9411('0x16')]);module[_0x9411('0x17')]=router; \ No newline at end of file +var _0x1b4e=['show','/:id/download','getInvoicePDF','post','create','/:id/automaticInvoiceCreditnote','automaticInvoiceCreditnote','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoice.controller','get','isAuthenticated','index','describe'];(function(_0x299027,_0x5d2e4f){var _0x1bc622=function(_0x281430){while(--_0x281430){_0x299027['push'](_0x299027['shift']());}};_0x1bc622(++_0x5d2e4f);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0x31097b,_0x10f0f5){_0x31097b=_0x31097b-0x0;var _0x519e3c=_0x1b4e[_0x31097b];return _0x519e3c;};'use strict';var multer=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var path=require(_0xe1b4('0x2'));var timeout=require(_0xe1b4('0x3'));var express=require(_0xe1b4('0x4'));var router=express['Router']();var auth=require(_0xe1b4('0x5'));var interaction=require(_0xe1b4('0x6'));var config=require(_0xe1b4('0x7'));var controller=require(_0xe1b4('0x8'));router[_0xe1b4('0x9')]('/',auth[_0xe1b4('0xa')](),controller[_0xe1b4('0xb')]);router[_0xe1b4('0x9')]('/describe',auth[_0xe1b4('0xa')](),controller[_0xe1b4('0xc')]);router[_0xe1b4('0x9')]('/getInvoicesNumberByYear',auth[_0xe1b4('0xa')](),controller['getInvoicesNumberByYear']);router[_0xe1b4('0x9')]('/:id',auth[_0xe1b4('0xa')](),controller[_0xe1b4('0xd')]);router[_0xe1b4('0x9')](_0xe1b4('0xe'),auth[_0xe1b4('0xa')](),controller[_0xe1b4('0xf')]);router[_0xe1b4('0x10')]('/',auth[_0xe1b4('0xa')](),controller[_0xe1b4('0x11')]);router[_0xe1b4('0x10')](_0xe1b4('0x12'),auth[_0xe1b4('0xa')](),controller[_0xe1b4('0x13')]);router[_0xe1b4('0x14')](_0xe1b4('0x15'),auth[_0xe1b4('0xa')](),controller[_0xe1b4('0x16')]);router[_0xe1b4('0x17')](_0xe1b4('0x15'),auth[_0xe1b4('0xa')](),controller[_0xe1b4('0x18')]);module[_0xe1b4('0x19')]=router; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.attributes.js b/server/api/saInvoice/saInvoice.attributes.js index 18896c5..85bb1a4 100644 --- a/server/api/saInvoice/saInvoice.attributes.js +++ b/server/api/saInvoice/saInvoice.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65b3=['STRING','TEXT','INTEGER','DECIMAL','BOOLEAN','DATE','sequelize','exports'];(function(_0x10f50d,_0x1b200c){var _0x24128c=function(_0x18819a){while(--_0x18819a){_0x10f50d['push'](_0x10f50d['shift']());}};_0x24128c(++_0x1b200c);}(_0x65b3,0xc6));var _0x365b=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x65b3[_0x256d6a];return _0x460058;};'use strict';var Sequelize=require(_0x365b('0x0'));module[_0x365b('0x1')]={'name':{'type':Sequelize[_0x365b('0x2')]},'note':{'type':Sequelize[_0x365b('0x3')]},'agentFullname':{'type':Sequelize[_0x365b('0x2')]},'status':{'type':Sequelize[_0x365b('0x3')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x365b('0x4')],'allowNull':![]},'paid':{'type':Sequelize[_0x365b('0x4')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x365b('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize['STRING']},'receivingPostalCode':{'type':Sequelize[_0x365b('0x2')]},'receivingCity':{'type':Sequelize[_0x365b('0x2')]},'receivingCountry':{'type':Sequelize[_0x365b('0x2')]},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x365b('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0x365b('0x2')](0x32)},'receivingSDICode':{'type':Sequelize[_0x365b('0x2')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x365b('0x2')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x365b('0x4')]},'receivingEurope':{'type':Sequelize['BOOLEAN']},'receivingSocCap':{'type':Sequelize[_0x365b('0x2')](0xff)},'issuerName':{'type':Sequelize[_0x365b('0x2')]},'issuerStreet':{'type':Sequelize[_0x365b('0x2')]},'issuerPostalCode':{'type':Sequelize[_0x365b('0x2')]},'issuerCity':{'type':Sequelize[_0x365b('0x2')]},'issuerCountry':{'type':Sequelize['STRING']},'issuerISOCode':{'type':Sequelize[_0x365b('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x365b('0x2')](0x32)},'issuerPIVA':{'type':Sequelize[_0x365b('0x2')](0x32)},'issuerSDICode':{'type':Sequelize[_0x365b('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize['STRING'](0x3e8)},'issuerExpiryDay':{'type':Sequelize['INTEGER']},'issuerEurope':{'type':Sequelize[_0x365b('0x6')]},'issuerSocCap':{'type':Sequelize[_0x365b('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x365b('0x2')](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize[_0x365b('0x2')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0x365b('0x2')]},'issuerBankCountry':{'type':Sequelize[_0x365b('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x365b('0x2')]},'issuerBankIBAN':{'type':Sequelize[_0x365b('0x2')]},'issuerPhone':{'type':Sequelize[_0x365b('0x2')]},'issuerFax':{'type':Sequelize[_0x365b('0x2')]},'issuerEmail':{'type':Sequelize[_0x365b('0x2')]},'issuerWeb':{'type':Sequelize[_0x365b('0x2')]},'issuerABI':{'type':Sequelize[_0x365b('0x2')]},'issuerCAB':{'type':Sequelize[_0x365b('0x2')]},'issuerPayPal':{'type':Sequelize[_0x365b('0x2')]},'startDate':{'type':Sequelize[_0x365b('0x7')]},'endDate':{'type':Sequelize[_0x365b('0x7')]},'number':{'type':Sequelize[_0x365b('0x4')]},'beginningCompetence':{'type':Sequelize[_0x365b('0x7')]},'endCompetence':{'type':Sequelize[_0x365b('0x7')]},'clientCode':{'type':Sequelize[_0x365b('0x2')]}}; \ No newline at end of file +var _0x819c=['DECIMAL','BOOLEAN','DATE','exports','STRING','TEXT','INTEGER'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x819c,0x168));var _0xc819=function(_0x3a73dd,_0x4e2de9){_0x3a73dd=_0x3a73dd-0x0;var _0x50891b=_0x819c[_0x3a73dd];return _0x50891b;};'use strict';var Sequelize=require('sequelize');module[_0xc819('0x0')]={'name':{'type':Sequelize[_0xc819('0x1')]},'note':{'type':Sequelize[_0xc819('0x2')]},'agentFullname':{'type':Sequelize[_0xc819('0x1')]},'status':{'type':Sequelize[_0xc819('0x2')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0xc819('0x3')],'allowNull':![]},'paid':{'type':Sequelize[_0xc819('0x3')],'defaultValue':0x0},'discount':{'type':Sequelize[_0xc819('0x4')](0xd,0x4)},'receivingStreet':{'type':Sequelize['STRING']},'receivingPostalCode':{'type':Sequelize[_0xc819('0x1')]},'receivingCity':{'type':Sequelize['STRING']},'receivingCountry':{'type':Sequelize[_0xc819('0x1')]},'receivingISOCode':{'type':Sequelize[_0xc819('0x1')](0x3)},'receivingFiscalCode':{'type':Sequelize['STRING'](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0xc819('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0xc819('0x1')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0xc819('0x3')]},'receivingEurope':{'type':Sequelize[_0xc819('0x5')]},'receivingSocCap':{'type':Sequelize[_0xc819('0x1')](0xff)},'issuerName':{'type':Sequelize['STRING']},'issuerStreet':{'type':Sequelize[_0xc819('0x1')]},'issuerPostalCode':{'type':Sequelize[_0xc819('0x1')]},'issuerCity':{'type':Sequelize[_0xc819('0x1')]},'issuerCountry':{'type':Sequelize[_0xc819('0x1')]},'issuerISOCode':{'type':Sequelize[_0xc819('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0xc819('0x1')](0x32)},'issuerPIVA':{'type':Sequelize[_0xc819('0x1')](0x32)},'issuerSDICode':{'type':Sequelize[_0xc819('0x1')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0xc819('0x1')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0xc819('0x3')]},'issuerEurope':{'type':Sequelize[_0xc819('0x5')]},'issuerSocCap':{'type':Sequelize[_0xc819('0x1')](0xff)},'issuerBankAccount':{'type':Sequelize['STRING'](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize['STRING']},'issuerBankPostalCode':{'type':Sequelize[_0xc819('0x1')]},'issuerBankCity':{'type':Sequelize[_0xc819('0x1')]},'issuerBankCountry':{'type':Sequelize[_0xc819('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize[_0xc819('0x1')]},'issuerBankIBAN':{'type':Sequelize[_0xc819('0x1')]},'issuerPhone':{'type':Sequelize['STRING']},'issuerFax':{'type':Sequelize[_0xc819('0x1')]},'issuerEmail':{'type':Sequelize[_0xc819('0x1')]},'issuerWeb':{'type':Sequelize['STRING']},'issuerABI':{'type':Sequelize[_0xc819('0x1')]},'issuerCAB':{'type':Sequelize[_0xc819('0x1')]},'issuerPayPal':{'type':Sequelize[_0xc819('0x1')]},'startDate':{'type':Sequelize[_0xc819('0x6')]},'endDate':{'type':Sequelize[_0xc819('0x6')]},'number':{'type':Sequelize[_0xc819('0x3')]},'beginningCompetence':{'type':Sequelize[_0xc819('0x6')]},'endCompetence':{'type':Sequelize[_0xc819('0x6')]},'clientCode':{'type':Sequelize[_0xc819('0x1')]}}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.controller.js b/server/api/saInvoice/saInvoice.controller.js index 09a2ba2..ffcb6c7 100644 --- a/server/api/saInvoice/saInvoice.controller.js +++ b/server/api/saInvoice/saInvoice.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Nota\x20di\x20credito','Due\x20date','Scadenza','Item','Articolo','Description','Descrizione','Hrs/Qty','Ore/Qta','Unit\x20Price','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Imponibile','Tax','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Paga\x20con\x20Paypal','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','receivingCountry','Italy','','\x20','','format','\x20%s
','issuerName','issuerStreet','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','issuerFax','email','issuerEmail','piva','issuerFiscalCode','sdi','issuerSDICode','issuerSocCap','','','%s','companyName','%s
','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingPIVA','receivingSDICode','','','','','%s,\x20','updatedAt','DD/MM/YYYY','%s\x20','add','saExpiryDay','days','duedate',':\x20%s','','item','','description','','hrsqty','subtotal','quantity','%s','productDescription','','\x20€','toFixed','isNil','discount','netPrice','tax','receivingFiscalMessage','indexOf','','\x20','total','','nettopay','','\x20',' ','','\x20%s\x20','replace','fromCharCode','','','sendpayment',':','issuerBankAccount','accountholder',':\x20','','bankname','issuerBankName','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerABI','bic','swif','iban','issuerPayPal','paypal','','thank1','','thank2','paid','
','','log','TCL:\x20exports.getInvoicePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','getInvoicesNumberByYear','years','select','from','invoiceYear','MONTH(startDate)','invoiceMonth','YEAR(startDate)\x20IN\x20(','YEAR(startDate)','group','QueryTypes','SELECT','addInvoiceCreditnoteDetail->>','companyId','productName','productCode','typeName','pricelistName','priceListId','agentFullname','note','subscriptionId','subscriptionMonthly','automaticInvoiceCreditnote','SACreditNote','WARNING','No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','Duplicate\x20entry.','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','SAInvoice','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','sequelize','transaction','body','params','describe','getInvoicePDF','unix','toString','join','server','files','tmp','root','images','logos','paid-invoice.png','Invoice_%s-%s.pdf','invoice','SAInvoiceDetail','details','portrait','1cm','10mm','{{page}}/{{pages}}','contents','','issuerWeb','','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Phone','Fax','Email','P.IVA','Tax\x20code','C.F.'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0xb62e,0x1de));var _0xeb62=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb62e[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0xeb62('0x0'));var emlformat=require(_0xeb62('0x1'));var rimraf=require(_0xeb62('0x2'));var zipdir=require(_0xeb62('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb62('0x4'));var moment=require(_0xeb62('0x5'));var BPromise=require(_0xeb62('0x6'));var Mustache=require(_0xeb62('0x7'));var util=require(_0xeb62('0x8'));var path=require(_0xeb62('0x9'));var sox=require('sox');var csv=require(_0xeb62('0xa'));var ejs=require(_0xeb62('0xb'));var fs=require('fs');var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x10'));var authService=require(_0xeb62('0x11'));var qs=require(_0xeb62('0x12'));var hardwareService=require(_0xeb62('0x13'));var logger=require(_0xeb62('0x14'))(_0xeb62('0x15'));var utils=require(_0xeb62('0x16'));var config=require(_0xeb62('0x17'));var db=require(_0xeb62('0x18'))['db'];function respondWithStatusCode(_0x17724e,_0x4a493c){_0x4a493c=_0x4a493c||0xcc;return function(_0x422daf){if(_0x422daf){return _0x17724e[_0xeb62('0x19')](_0x4a493c);}return _0x17724e[_0xeb62('0x1a')](_0x4a493c)[_0xeb62('0x1b')]();};}function respondWithResult(_0x55a629,_0x333126){_0x333126=_0x333126||0xc8;return function(_0x2fbad2){if(_0x2fbad2){return _0x55a629[_0xeb62('0x1a')](_0x333126)['json'](_0x2fbad2);}};}function respondWithFilteredResult(_0x26c3fd,_0x195837){return function(_0x2fd4c7){if(_0x2fd4c7){var _0x4ce9fa=_0x2fd4c7[_0xeb62('0x1c')],_0x1f6a1f=_0x195837[_0xeb62('0x1d')],_0x15b3e8=_0x195837[_0xeb62('0x1d')]+_0x195837[_0xeb62('0x1e')],_0x184106;if(_0x15b3e8>=_0x4ce9fa){_0x15b3e8=_0x4ce9fa;_0x184106=0xc8;}else{_0x184106=0xce;}_0x26c3fd[_0xeb62('0x1a')](_0x184106);return _0x26c3fd[_0xeb62('0x1f')](_0xeb62('0x20'),_0x1f6a1f+'-'+_0x15b3e8+'/'+_0x4ce9fa)[_0xeb62('0x21')](_0x2fd4c7);}return null;};}function patchUpdates(_0x11d516){return function(_0x3cdf76){try{jsonpatch['apply'](_0x3cdf76,_0x11d516,!![]);}catch(_0x38c5e4){return BPromise[_0xeb62('0x22')](_0x38c5e4);}return _0x3cdf76[_0xeb62('0x23')]();};}function saveUpdates(_0xb44905,_0x425817){return function(_0x24cbf3){if(_0x24cbf3){return _0x24cbf3[_0xeb62('0x24')](_0xb44905)['then'](function(_0x599d0b){return _0x599d0b;});}return null;};}function removeEntity(_0x1fbfaa,_0x154451){return function(_0x11ed9c){if(_0x11ed9c){return _0x11ed9c[_0xeb62('0x25')]()[_0xeb62('0x26')](function(){_0x1fbfaa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4664ce,_0x132861){return function(_0x182781){if(!_0x182781){_0x4664ce[_0xeb62('0x19')](0x194);}return _0x182781;};}function handleError(_0x55a169,_0x4e92f5){_0x4e92f5=_0x4e92f5||0x1f4;return function(_0x3ef988){logger['error'](_0x3ef988[_0xeb62('0x27')]);if(_0x3ef988['name']){delete _0x3ef988[_0xeb62('0x28')];}_0x55a169['status'](_0x4e92f5)[_0xeb62('0x29')](_0x3ef988);};}exports[_0xeb62('0x2a')]=function(_0x46d1bb,_0x4e4268){var _0x3ef784={},_0x3ae031={},_0x5222f4={'count':0x0,'rows':[]};var _0xe8872c=db[_0xeb62('0x2b')][_0xeb62('0x2c')];_0x3ae031['model']=_[_0xeb62('0x2d')](_0xe8872c);_0x3ae031[_0xeb62('0x2e')]=_['keys'](_0x46d1bb[_0xeb62('0x2e')]);_0x3ae031[_0xeb62('0x2f')]=_[_0xeb62('0x30')](_0x3ae031[_0xeb62('0x31')],_0x3ae031[_0xeb62('0x2e')]);_0x3ef784['attributes']=_['intersection'](_0x3ae031[_0xeb62('0x31')],qs[_0xeb62('0x32')](_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x32')]));_0x3ef784[_0xeb62('0x33')]=_0x3ef784[_0xeb62('0x33')][_0xeb62('0x34')]?_0x3ef784['attributes']:_0x3ae031[_0xeb62('0x31')];if(!_0x46d1bb['query']['hasOwnProperty'](_0xeb62('0x35'))){_0x3ef784[_0xeb62('0x1e')]=qs['limit'](_0x46d1bb[_0xeb62('0x2e')]['limit']);_0x3ef784[_0xeb62('0x1d')]=qs[_0xeb62('0x1d')](_0x46d1bb['query'][_0xeb62('0x1d')]);}_0x3ef784[_0xeb62('0x36')]=qs['sort'](_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x37')]);_0x3ef784[_0xeb62('0x38')]=qs[_0xeb62('0x2f')](_['pick'](_0x46d1bb[_0xeb62('0x2e')],_0x3ae031[_0xeb62('0x2f')]));if(_0x46d1bb['query']['filter']){_0x3ef784[_0xeb62('0x38')]=_[_0xeb62('0x39')](_0x3ef784['where'],{'$or':_[_0xeb62('0x3a')](_0xe8872c,function(_0x30cff0){if(_0x30cff0[_0xeb62('0x3b')][_0xeb62('0x3c')]!==_0xeb62('0x3d')){var _0x15387a={};_0x15387a[_0x30cff0[_0xeb62('0x3e')]]={'$like':'%'+_0x46d1bb['query']['filter']+'%'};return _0x15387a;}})});}_0x3ef784=_[_0xeb62('0x39')]({},_0x3ef784,_0x46d1bb[_0xeb62('0x3f')]);var _0x21772a={'where':_0x3ef784[_0xeb62('0x38')]};return db['SAInvoice'][_0xeb62('0x1c')](_0x21772a)['then'](function(_0x20fd7a){_0x5222f4[_0xeb62('0x1c')]=_0x20fd7a;if(_0x46d1bb[_0xeb62('0x2e')][_0xeb62('0x40')]){_0x3ef784[_0xeb62('0x41')]=[{'all':!![]}];}return db[_0xeb62('0x2b')][_0xeb62('0x42')](_0x3ef784);})[_0xeb62('0x26')](function(_0x5e8ef8){_0x5222f4[_0xeb62('0x43')]=_0x5e8ef8;return _0x5222f4;})[_0xeb62('0x26')](respondWithFilteredResult(_0x4e4268,_0x3ef784))[_0xeb62('0x44')](handleError(_0x4e4268,null));};exports[_0xeb62('0x45')]=function(_0x5dd0e3,_0x4eda8b){var _0x46a560={'raw':![],'where':{'id':_0x5dd0e3['params']['id']}},_0x41fb7d={};_0x41fb7d[_0xeb62('0x31')]=_[_0xeb62('0x2d')](db['SAInvoice'][_0xeb62('0x2c')]);_0x41fb7d['query']=_[_0xeb62('0x2d')](_0x5dd0e3['query']);_0x41fb7d[_0xeb62('0x2f')]=_['intersection'](_0x41fb7d[_0xeb62('0x31')],_0x41fb7d[_0xeb62('0x2e')]);_0x46a560[_0xeb62('0x33')]=_['intersection'](_0x41fb7d['model'],qs[_0xeb62('0x32')](_0x5dd0e3[_0xeb62('0x2e')][_0xeb62('0x32')]));_0x46a560[_0xeb62('0x33')]=_0x46a560[_0xeb62('0x33')]['length']?_0x46a560[_0xeb62('0x33')]:_0x41fb7d['model'];if(_0x5dd0e3[_0xeb62('0x2e')]['includeAll']){_0x46a560[_0xeb62('0x41')]=[{'all':!![]}];}_0x46a560=_['merge']({},_0x46a560,_0x5dd0e3[_0xeb62('0x3f')]);return db['SAInvoice'][_0xeb62('0x46')](_0x46a560)[_0xeb62('0x26')](handleEntityNotFound(_0x4eda8b,null))[_0xeb62('0x26')](respondWithResult(_0x4eda8b,null))[_0xeb62('0x44')](handleError(_0x4eda8b,null));};exports[_0xeb62('0x47')]=function(_0x21bb97,_0x4e62eb){return db[_0xeb62('0x48')][_0xeb62('0x49')]({'isolationLevel':db['Sequelize']['Transaction']['ISOLATION_LEVELS']['SERIALIZABLE']},function(_0x24dff5){return db[_0xeb62('0x2b')]['create'](_0x21bb97[_0xeb62('0x4a')],{'transaction':_0x24dff5});})[_0xeb62('0x26')](respondWithResult(_0x4e62eb,0xc9))[_0xeb62('0x44')](handleError(_0x4e62eb,null));};exports[_0xeb62('0x24')]=function(_0x39595c,_0x555812){if(_0x39595c[_0xeb62('0x4a')]['id']){delete _0x39595c['body']['id'];}return db[_0xeb62('0x2b')][_0xeb62('0x46')]({'where':{'id':_0x39595c[_0xeb62('0x4b')]['id']}})[_0xeb62('0x26')](handleEntityNotFound(_0x555812,null))[_0xeb62('0x26')](saveUpdates(_0x39595c[_0xeb62('0x4a')],null))[_0xeb62('0x26')](respondWithResult(_0x555812,null))[_0xeb62('0x44')](handleError(_0x555812,null));};exports[_0xeb62('0x25')]=function(_0x3a29ac,_0xe13846){return db[_0xeb62('0x2b')]['find']({'where':{'id':_0x3a29ac[_0xeb62('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe13846,null))['then'](removeEntity(_0xe13846,null))[_0xeb62('0x44')](handleError(_0xe13846,null));};exports[_0xeb62('0x4c')]=function(_0x482fae,_0x373505){return db[_0xeb62('0x2b')]['describe']()[_0xeb62('0x26')](respondWithResult(_0x373505,null))[_0xeb62('0x44')](handleError(_0x373505,null));};exports[_0xeb62('0x4d')]=function(_0x60617,_0xe71e83){var _0x1e6238=moment()[_0xeb62('0x4e')]()[_0xeb62('0x4f')]();var _0x497714=path[_0xeb62('0x50')](config['root'],_0xeb62('0x51'),_0xeb62('0x52'),_0xeb62('0x53'));var _0x289af0=path[_0xeb62('0x50')](config[_0xeb62('0x54')],_0xeb62('0x51'),_0xeb62('0x52'),'images','logos','logo-invoice.png');var _0x5033eb=path[_0xeb62('0x50')](config['root'],_0xeb62('0x51'),'files',_0xeb62('0x55'),_0xeb62('0x56'),_0xeb62('0x57'));var _0x595797=path[_0xeb62('0x50')](_0x497714,_0x1e6238);var _0x1486a6=util['format'](_0xeb62('0x58'),_0x60617[_0xeb62('0x4b')]['id'],_0x1e6238);var _0x39190c=path[_0xeb62('0x50')](_0x595797,_0x1486a6);var _0x55370c=![];var _0x3be3e1={};return db[_0xeb62('0x2b')]['find']({'where':{'id':_0x60617[_0xeb62('0x4b')]['id']},'raw':!![]})[_0xeb62('0x26')](handleEntityNotFound(_0xe71e83,null))[_0xeb62('0x26')](function(_0x466c3c){if(_0x466c3c){_0x3be3e1[_0xeb62('0x59')]=_0x466c3c;return db[_0xeb62('0x5a')][_0xeb62('0x42')]({'where':{'InvoiceId':_0x466c3c['id']},'raw':!![]})[_0xeb62('0x26')](function(_0x222d0c){_0x3be3e1[_0xeb62('0x5b')]=_0x222d0c;_0x55370c=!![];var _0x130153='';var _0x15c93f={'format':'A4','orientation':_0xeb62('0x5c'),'border':_0xeb62('0x5d'),'footer':{'height':_0xeb62('0x5e'),'contents':{'default':_0xeb62('0x5f')}}};_0x15c93f['footer']['contents']['default']=_0x15c93f['footer'][_0xeb62('0x60')]['default']+_0xeb62('0x61')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0x62')]+_0xeb62('0x63');fs[_0xeb62('0x64')](_0x595797);_0x130153=_0xeb62('0x65');_0x130153+=_0xeb62('0x66');_0x130153+=_0xeb62('0x67');var _0x349916={'phone':{'en':_0xeb62('0x68'),'it':'Telefono'},'fax':{'en':_0xeb62('0x69'),'it':_0xeb62('0x69')},'email':{'en':_0xeb62('0x6a'),'it':_0xeb62('0x6a')},'piva':{'en':'VAT\x20number','it':_0xeb62('0x6b')},'cf':{'en':_0xeb62('0x6c'),'it':_0xeb62('0x6d')},'sdi':{'en':_0xeb62('0x6e'),'it':_0xeb62('0x6f')},'cs':{'en':_0xeb62('0x70'),'it':_0xeb62('0x71')},'invoice':{'en':_0xeb62('0x72'),'it':_0xeb62('0x73')},'proforma':{'en':_0xeb62('0x74'),'it':_0xeb62('0x74')},'creditnote':{'en':'Credit\x20note','it':_0xeb62('0x75')},'duedate':{'en':_0xeb62('0x76'),'it':_0xeb62('0x77')},'item':{'en':_0xeb62('0x78'),'it':_0xeb62('0x79')},'description':{'en':_0xeb62('0x7a'),'it':_0xeb62('0x7b')},'hrsqty':{'en':_0xeb62('0x7c'),'it':_0xeb62('0x7d')},'unitprice':{'en':_0xeb62('0x7e'),'it':'Prezzo\x20Unitario'},'subtotal':{'en':_0xeb62('0x7f'),'it':_0xeb62('0x80')},'discount':{'en':_0xeb62('0x81'),'it':_0xeb62('0x82')},'total':{'en':'Subtotal','it':_0xeb62('0x83')},'tax':{'en':_0xeb62('0x84'),'it':_0xeb62('0x85')},'nettopay':{'en':_0xeb62('0x86'),'it':_0xeb62('0x87')},'sendpayment':{'en':_0xeb62('0x88'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':_0xeb62('0x89'),'it':_0xeb62('0x8a')},'bankname':{'en':_0xeb62('0x8b'),'it':_0xeb62('0x8c')},'bankaddress':{'en':_0xeb62('0x8d'),'it':_0xeb62('0x8e')},'abi':{'en':_0xeb62('0x8f'),'it':_0xeb62('0x8f')},'cab':{'en':_0xeb62('0x90'),'it':_0xeb62('0x90')},'bic':{'en':_0xeb62('0x91'),'it':_0xeb62('0x91')},'swif':{'en':_0xeb62('0x92'),'it':_0xeb62('0x92')},'iban':{'en':_0xeb62('0x93'),'it':_0xeb62('0x93')},'paypal':{'en':'Pay\x20via\x20Paypal','it':_0xeb62('0x94')},'thank1':{'en':'Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','it':_0xeb62('0x95')},'thank2':{'en':_0xeb62('0x96'),'it':'\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.'}};var _0x2d8bbe='it';if(_0x3be3e1[_0xeb62('0x59')][_0xeb62('0x97')]!==_0xeb62('0x98')){_0x2d8bbe='en';}_0x130153+=_0xeb62('0x99');_0x130153+=_0xeb62('0x9a')+_0x289af0+_0xeb62('0x9b');_0x130153+=_0xeb62('0x9c');_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0x9e'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0x9f')]);_0x130153+=util[_0xeb62('0x9d')]('%s
',_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xa0')]);_0x130153+=util['format']('%s',_0x3be3e1[_0xeb62('0x59')]['issuerPostalCode']);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xa1'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xa2')]);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xa3'),_0x3be3e1['invoice'][_0xeb62('0xa4')]);_0x130153+=util['format'](_0x349916[_0xeb62('0xa5')][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xa7')]);_0x130153+=util[_0xeb62('0x9d')](_0x349916['fax'][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xa8')]);_0x130153+=util['format'](_0x349916[_0xeb62('0xa9')][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xaa')]);_0x130153+=util[_0xeb62('0x9d')](_0x349916[_0xeb62('0xab')][_0x2d8bbe]+':\x20%s
',_0x3be3e1['invoice']['issuerPIVA']);_0x130153+=util['format'](_0x349916['cf'][_0x2d8bbe]+':\x20%s
',_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xac')]);_0x130153+=util[_0xeb62('0x9d')](_0x349916[_0xeb62('0xad')][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xae')]);_0x130153+=util[_0xeb62('0x9d')](_0x349916['cs'][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xaf')]);_0x130153+=_0xeb62('0xb0');_0x130153+='';_0x130153+=_0xeb62('0xb1');_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xb2'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xb3')]);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xb4'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xb5')]);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xb6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xb7')]);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xb4'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xb8')]);_0x130153+=util[_0xeb62('0x9d')]('%s
',_0x3be3e1[_0xeb62('0x59')]['receivingCountry']);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xb9')+_0x349916['cf'][_0x2d8bbe]+':\x20%s
',_0x3be3e1[_0xeb62('0x59')]['receivingFiscalCode']);_0x130153+=util['format'](_0x349916[_0xeb62('0xab')][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xba')]);_0x130153+=util['format'](_0x349916[_0xeb62('0xad')][_0x2d8bbe]+_0xeb62('0xa6'),_0x3be3e1['invoice'][_0xeb62('0xbb')]);_0x130153+=_0xeb62('0xbc');_0x130153+=_0xeb62('0xbd');_0x130153+=_0xeb62('0x9c');_0x130153+=_0xeb62('0xbe');_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xbf')+_0x349916[_0xeb62('0x59')][_0x2d8bbe]+'\x20N.%d',_0x466c3c['id']);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xc0'),_0x3be3e1['invoice'][_0xeb62('0xa2')]);var _0x5c83b8=moment(_0x3be3e1['invoice'][_0xeb62('0xc1')])[_0xeb62('0x9d')](_0xeb62('0xc2'));_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xc3'),_0x5c83b8);var _0x5072fd=moment(_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xc1')])[_0xeb62('0xc4')](_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xc5')],_0xeb62('0xc6'))[_0xeb62('0x9d')](_0xeb62('0xc2'));_0x130153+=util['format'](''+_0x349916[_0xeb62('0xc7')][_0x2d8bbe]+_0xeb62('0xc8'),_0x5072fd);_0x130153+=_0xeb62('0xbd');_0x130153+=_0xeb62('0x9c');_0x130153+='';_0x130153+=_0xeb62('0xc9');_0x130153+='';_0x130153+=''+_0x349916[_0xeb62('0xca')][_0x2d8bbe]+_0xeb62('0xcb');_0x130153+=''+_0x349916[_0xeb62('0xcc')][_0x2d8bbe]+'';_0x130153+=_0xeb62('0xcd')+_0x349916[_0xeb62('0xce')][_0x2d8bbe]+_0xeb62('0xcb');_0x130153+=''+_0x349916['unitprice'][_0x2d8bbe]+_0xeb62('0xcb');_0x130153+=_0xeb62('0xcd')+_0x349916[_0xeb62('0xcf')][_0x2d8bbe]+'';_0x130153+=_0xeb62('0xbd');var _0x162993=0x0;var _0x3f5c93=0x0;for(var _0x4d0392=0x0;_0x4d0392<_0x3be3e1[_0xeb62('0x5b')][_0xeb62('0x34')];_0x4d0392++){var _0x518655=0x0;var _0x4cd599=0x0;var _0x5d0c09=0x0;var _0x23c6d7=0x0;_0x518655=_0x3be3e1['details'][_0x4d0392]['netPrice']-_0x3be3e1[_0xeb62('0x5b')][_0x4d0392]['netPrice']/0x64*_0x3be3e1['details'][_0x4d0392]['discount'];_0x4cd599=_0x518655/0x64*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392]['tax'];_0x5d0c09=_0x518655*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd0')];_0x23c6d7=_0x4cd599*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd0')];_0x130153+=_0xeb62('0x9c');_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xd1'),_0x3be3e1['details'][_0x4d0392]['productName']);_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xd1'),_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd2')]);_0x130153+=util[_0xeb62('0x9d')]('%d',_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd0')]);_0x130153+=_0xeb62('0xd3')+_0x518655['toFixed'](0x2)+_0xeb62('0xd4');_0x130153+=''+_0x5d0c09[_0xeb62('0xd5')](0x2)+_0xeb62('0xd4');_0x130153+='';_0x162993+=_0x5d0c09;_0x3f5c93+=_0x23c6d7;}_0x130153+='';if(!_[_0xeb62('0xd6')](_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xd7')])){var _0x1b7039=0x0;var _0x4ad034=0x0;var _0x403ae5=_0x3be3e1[_0xeb62('0x59')]['discount']*0x64/_0x162993;for(var _0x4d0392=0x0;_0x4d0392<_0x3be3e1[_0xeb62('0x5b')][_0xeb62('0x34')];_0x4d0392++){var _0x42b301=0x0;var _0x478336=0x0;var _0x396185=0x0;_0x518655=_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd8')]-_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd8')]/0x64*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd7')];_0x42b301=_0x518655/0x64*_0x403ae5;_0x478336=_0x518655-_0x42b301;_0x396185=_0x478336*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd0')];_0x1b7039+=_0x396185;_0x4ad034+=_0x396185/0x64*_0x3be3e1[_0xeb62('0x5b')][_0x4d0392][_0xeb62('0xd9')];}}var _0xf2a819=0x0;var _0x5984d2=0x0;var _0x1be079=![];var _0x459066=_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xda')];if(_0x459066[_0xeb62('0xdb')]('split\x20payment')!=-0x1){_0x1be079=!![];}if(!_['isNil'](_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xd7')])){_0x130153+=_0xeb62('0x9c');if(_0x3be3e1[_0xeb62('0x59')]['discount']>0x0){_0x130153+=_0xeb62('0xdc')+_0x349916['discount'][_0x2d8bbe]+_0xeb62('0xb0');_0x130153+=_0xeb62('0xdd')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xd7')][_0xeb62('0xd5')](0x2)+'\x20€';}_0x130153+=_0xeb62('0xbd');_0xf2a819=_0x4ad034;_0x5984d2=_0x1b7039;}else{_0xf2a819=_0x3f5c93;_0x5984d2=_0x162993;}if(_0xf2a819>0x0||_0x3be3e1[_0xeb62('0x59')]['discount']>0x0){_0x130153+=_0xeb62('0x9c');_0x130153+=''+_0x349916[_0xeb62('0xde')][_0x2d8bbe]+_0xeb62('0xb0');_0x130153+=_0xeb62('0xd3')+_0x5984d2[_0xeb62('0xd5')](0x2)+_0xeb62('0xd4');_0x130153+=_0xeb62('0xbd');}if(_0xf2a819>0x0){_0x130153+='';_0x130153+=''+_0x349916[_0xeb62('0xd9')][_0x2d8bbe]+_0xeb62('0xb0');_0x130153+=_0xeb62('0xd3')+_0xf2a819[_0xeb62('0xd5')](0x2)+'\x20€';_0x130153+='';}_0x130153+=_0xeb62('0x9c');var _0x527de3;if(_0x1be079){_0x527de3=_0x5984d2;}else{_0x527de3=_0x5984d2+_0xf2a819;}_0x130153+=_0xeb62('0xdf')+_0x349916[_0xeb62('0xe0')][_0x2d8bbe]+_0xeb62('0xe1')+_0x527de3['toFixed'](0x2)+_0xeb62('0xd4');_0x130153+=_0xeb62('0xe2');_0x130153+=_0xeb62('0xbd');_0x130153+=_0xeb62('0xe3');_0x130153+=_0xeb62('0xe4');_0x130153+=_0xeb62('0x9c');_0x130153+=util[_0xeb62('0x9d')](_0xeb62('0xe5'),_0x3be3e1['invoice'][_0xeb62('0xda')][_0xeb62('0xe6')](new RegExp(String[_0xeb62('0xe7')](0xd),'g'),_0xeb62('0xe8')));_0x130153+='';_0x130153+=_0xeb62('0x9c');_0x130153+=_0xeb62('0xbe');_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xea')][_0x2d8bbe]+_0xeb62('0xeb');if(!_['isNil'](_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xec')])){_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xed')][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xec')]+_0xeb62('0xef');_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xf0')][_0x2d8bbe]+':\x20'+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xf1')]+'\x20';_0x130153+=''+_0x349916[_0xeb62('0xf2')][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xf3')]+',\x20'+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xf4')]+_0xeb62('0xf5')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xf6')]+'\x20('+_0x3be3e1['invoice']['issuerBankCountry']+')'+_0xeb62('0xef');_0x130153+=_0xeb62('0xe9')+_0x349916['abi'][_0x2d8bbe]+'/'+_0x349916['cab'][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xf7')]+'/'+_0x3be3e1['invoice']['issuerCAB']+_0xeb62('0xef');_0x130153+=''+_0x349916[_0xeb62('0xf8')][_0x2d8bbe]+'/'+_0x349916[_0xeb62('0xf9')][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1['invoice']['issuerBankBICSWIFT']+'';_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xfa')][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1[_0xeb62('0x59')]['issuerBankIBAN']+_0xeb62('0xef');}if(!_[_0xeb62('0xd6')](_0x3be3e1[_0xeb62('0x59')][_0xeb62('0xfb')])){_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xfc')][_0x2d8bbe]+_0xeb62('0xee')+_0x3be3e1[_0xeb62('0x59')]['issuerPayPal']+_0xeb62('0xfd');}_0x130153+=_0xeb62('0xe9')+_0x349916[_0xeb62('0xfe')][_0x2d8bbe]+_0xeb62('0xff')+_0x5072fd+''+_0x349916[_0xeb62('0x100')][_0x2d8bbe]+_0xeb62('0x63');_0x130153+='';_0x130153+=_0xeb62('0xbd');if(_0x3be3e1[_0xeb62('0x59')][_0xeb62('0x101')]===0x1){_0x130153+=_0xeb62('0x9a')+_0x5033eb+_0xeb62('0x9b');}_0x130153+=_0xeb62('0x102');_0x130153+=_0xeb62('0x103');_0x130153+='';console[_0xeb62('0x104')]('body',_0x130153);return new BPromise(function(_0x3578a9,_0xc28582){pdf[_0xeb62('0x47')](_0x130153,_0x15c93f)['toFile'](path['join'](_0x595797,_0x1486a6),function(_0x13abd2,_0x716f0e){if(_0x13abd2)return _0xc28582(_0x13abd2);_0x3578a9(_0x716f0e);});});});}})[_0xeb62('0x26')](function(){if(_0x55370c){console[_0xeb62('0x104')](_0xeb62('0x105'),_0x39190c,_0x1486a6);return _0xe71e83[_0xeb62('0x106')](_0x39190c,_0x1486a6,function(_0x32f326){if(_0x32f326){console[_0xeb62('0x104')](_0xeb62('0x107'),_0x32f326);}else{console['log'](_0xeb62('0x108'),_0x595797);rimraf(_0x595797,function(){});}});}else{return _0xe71e83[_0xeb62('0x19')](0xc8);}})[_0xeb62('0x44')](handleError(_0xe71e83,null));};exports[_0xeb62('0x109')]=function(_0x1cda96,_0x4dc827){var _0x36a455=_0x1cda96['query'][_0xeb62('0x10a')];var _0x2d2b3c=squel[_0xeb62('0x10b')]()[_0xeb62('0x10c')]('sa_invoices')['field']('count(id)','invoiceNumber')[_0xeb62('0x3e')]('YEAR(startDate)',_0xeb62('0x10d'))[_0xeb62('0x3e')](_0xeb62('0x10e'),_0xeb62('0x10f'))[_0xeb62('0x38')](_0xeb62('0x110')+_0x36a455+')')[_0xeb62('0x36')](_0xeb62('0x10e'))[_0xeb62('0x36')](_0xeb62('0x111'),![])['group'](_0xeb62('0x111'))[_0xeb62('0x112')](_0xeb62('0x10e'));return db[_0xeb62('0x48')][_0xeb62('0x2e')](_0x2d2b3c[_0xeb62('0x4f')](),{'type':db[_0xeb62('0x48')][_0xeb62('0x113')][_0xeb62('0x114')]})['then'](function(_0x2880fb){return{'count':_0x2880fb[_0xeb62('0x34')],'rows':_0x2880fb};})[_0xeb62('0x26')](handleEntityNotFound(_0x4dc827,null))['then'](respondWithResult(_0x4dc827,null))[_0xeb62('0x44')](handleError(_0x4dc827,null));};function addInvoiceCreditnoteDetail(_0x4e505e,_0x2925ef,_0x115b6e){console['log'](_0xeb62('0x115'),_0x4e505e);var _0x585e6b={'companyName':_0x4e505e[_0xeb62('0xb3')],'companyId':_0x4e505e[_0xeb62('0x116')],'productName':_0x4e505e[_0xeb62('0x117')],'productCode':_0x4e505e[_0xeb62('0x118')],'productDescription':_0x4e505e[_0xeb62('0xd2')],'typeName':_0x4e505e[_0xeb62('0x119')],'pricelistName':_0x4e505e[_0xeb62('0x11a')],'priceListId':_0x4e505e[_0xeb62('0x11b')],'netPrice':_0x4e505e[_0xeb62('0xd8')],'discount':_0x4e505e[_0xeb62('0xd7')],'tax':_0x4e505e['tax'],'agentFullname':_0x4e505e[_0xeb62('0x11c')],'note':_0x4e505e[_0xeb62('0x11d')],'subscriptionId':_0x4e505e[_0xeb62('0x11e')],'subscriptionName':_0x4e505e['subscriptionName'],'subscriptionMonthly':_0x4e505e[_0xeb62('0x11f')],'quantity':_0x4e505e['quantity'],'CreditNoteId':_0x2925ef,'unitName':_0x4e505e['unitName']};return db['SACreditNoteDetail']['create'](_0x585e6b,{'transaction':_0x115b6e});}exports[_0xeb62('0x120')]=function(_0x2bf699,_0x504bfe,_0x3fedd4){var _0x24b424;if(_0x2bf699[_0xeb62('0x4a')]['id']){delete _0x2bf699[_0xeb62('0x4a')]['id'];}console[_0xeb62('0x104')](_0x2bf699);return db[_0xeb62('0x48')][_0xeb62('0x49')](function(_0x5cf011){return db[_0xeb62('0x121')][_0xeb62('0x47')](_0x2bf699[_0xeb62('0x4a')],{'transaction':_0x5cf011})['then'](function(_0xc8c0dd){_0x24b424=_0xc8c0dd;var _0x4c56a2=_0x2bf699[_0xeb62('0x4b')]['id'];return db[_0xeb62('0x5a')][_0xeb62('0x42')]({'where':{'InvoiceId':_0x4c56a2},'raw':!![],'logging':console['log']});})[_0xeb62('0x26')](function(_0x135a1b){if(_0x135a1b[_0xeb62('0x34')]>0x0){var _0x45b4f5=[];for(var _0x44d59b=0x0;_0x44d59b<_0x135a1b[_0xeb62('0x34')];_0x44d59b++){_0x45b4f5['push'](addInvoiceCreditnoteDetail(_0x135a1b[_0x44d59b],_0x24b424['id'],_0x5cf011));}return BPromise['all'](_0x45b4f5);}else{var _0x54c8d0={'errors':[{'type':_0xeb62('0x122'),'message':_0xeb62('0x123')}]};throw _0x54c8d0;}});})[_0xeb62('0x26')](function(){return _0x504bfe[_0xeb62('0x19')](0xc8);})['catch'](function(_0x3ffed8){console['log'](_0xeb62('0x124'),_0x3ffed8);if(_0x3ffed8['name']==='SequelizeUniqueConstraintError'){var _0x3ffed8={'errors':[{'message':_0xeb62('0x125')}]};}_0x504bfe[_0xeb62('0x1a')](0x1f4)[_0xeb62('0x29')](_0x3ffed8);});}; \ No newline at end of file +var _0xac4a=['thank1','','thank2','','','toFile','log','TCL:\x20exports.getInvoicePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','getInvoicesNumberByYear','years','select','count(id)','invoiceNumber','MONTH(startDate)','YEAR(startDate)\x20IN\x20(','YEAR(startDate)','group','QueryTypes','SELECT','addInvoiceCreditnoteDetail->>','companyId','productCode','typeName','pricelistName','agentFullname','unitName','SACreditNoteDetail','automaticInvoiceCreditnote','SACreditNote','push','all','WARNING','No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','Duplicate\x20entry.','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','stack','index','SAInvoice','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','find','create','sequelize','transaction','Sequelize','Transaction','ISOLATION_LEVELS','SERIALIZABLE','body','update','describe','getInvoicePDF','unix','toString','join','root','server','files','tmp','images','logo-invoice.png','logos','Invoice_%s-%s.pdf','SAInvoiceDetail','portrait','1cm','10mm','footer','contents','default','','invoice','issuerWeb','','mkdirSync','','Telefono','Fax','Email','VAT\x20number','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Scadenza','Item','Articolo','Description','Descrizione','Hrs/Qty','Prezzo\x20Unitario','Discount','Subtotal','Imponibile','Tax','Tasse','Totale','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','\x20','format','issuerPostalCode','issuerCity','-\x20%s\x20
','issuerCountry',':\x20%s
','fax','issuerFax','email','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSDICode','issuerSocCap','','','','%s','companyName','%s
','receivingStreet','%s\x20-\x20','receivingCity','','receivingFiscalCode','receivingSDICode','','','','','','\x20N.%d','%s,\x20','updatedAt','DD/MM/YYYY','%s\x20','days','','duedate','','','item','','description','hrsqty','subtotal','details','netPrice','discount','tax','quantity','%s','productName','productDescription','%d','','toFixed','\x20€','receivingFiscalMessage','indexOf','split\x20payment','isNil','','total','','','\x20',' ','','','','sendpayment','accountholder',':\x20','issuerBankAccount','','bankname','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','issuerBankCity','issuerBankCountry','abi','bic','swif','issuerBankBICSWIFT','iban','issuerBankIBAN','paypal','issuerPayPal',''];(function(_0x41b823,_0x4f7240){var _0x3df3f5=function(_0x383b66){while(--_0x383b66){_0x41b823['push'](_0x41b823['shift']());}};_0x3df3f5(++_0x4f7240);}(_0xac4a,0x13f));var _0xaac4=function(_0x1fc42b,_0xd0ff66){_0x1fc42b=_0x1fc42b-0x0;var _0x5be939=_0xac4a[_0x1fc42b];return _0x5be939;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508e14,_0x2348c2){_0x2348c2=_0x2348c2||0xcc;return function(_0x2e2d02){if(_0x2e2d02){return _0x508e14[_0xaac4('0x14')](_0x2348c2);}return _0x508e14['status'](_0x2348c2)[_0xaac4('0x15')]();};}function respondWithResult(_0x45c129,_0x5bcacd){_0x5bcacd=_0x5bcacd||0xc8;return function(_0xf06b1d){if(_0xf06b1d){return _0x45c129[_0xaac4('0x16')](_0x5bcacd)[_0xaac4('0x17')](_0xf06b1d);}};}function respondWithFilteredResult(_0x150fdd,_0x187624){return function(_0x2fbeb7){if(_0x2fbeb7){var _0x31b7e5=_0x2fbeb7[_0xaac4('0x18')],_0x1df9ae=_0x187624[_0xaac4('0x19')],_0x233278=_0x187624[_0xaac4('0x19')]+_0x187624['limit'],_0xb8466e;if(_0x233278>=_0x31b7e5){_0x233278=_0x31b7e5;_0xb8466e=0xc8;}else{_0xb8466e=0xce;}_0x150fdd[_0xaac4('0x16')](_0xb8466e);return _0x150fdd['set'](_0xaac4('0x1a'),_0x1df9ae+'-'+_0x233278+'/'+_0x31b7e5)['json'](_0x2fbeb7);}return null;};}function patchUpdates(_0x3ce35a){return function(_0x27fe7b){try{jsonpatch[_0xaac4('0x1b')](_0x27fe7b,_0x3ce35a,!![]);}catch(_0x271bcb){return BPromise[_0xaac4('0x1c')](_0x271bcb);}return _0x27fe7b[_0xaac4('0x1d')]();};}function saveUpdates(_0x44f0e8,_0x25b946){return function(_0x4166ee){if(_0x4166ee){return _0x4166ee['update'](_0x44f0e8)[_0xaac4('0x1e')](function(_0x4e1e89){return _0x4e1e89;});}return null;};}function removeEntity(_0x3303f1,_0x2013b7){return function(_0x43625c){if(_0x43625c){return _0x43625c[_0xaac4('0x1f')]()[_0xaac4('0x1e')](function(){_0x3303f1[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ccdc,_0x27a84d){return function(_0x174860){if(!_0x174860){_0x43ccdc[_0xaac4('0x14')](0x194);}return _0x174860;};}function handleError(_0x3dd059,_0x2dcc59){_0x2dcc59=_0x2dcc59||0x1f4;return function(_0xb2577b){logger['error'](_0xb2577b[_0xaac4('0x20')]);if(_0xb2577b['name']){delete _0xb2577b['name'];}_0x3dd059['status'](_0x2dcc59)['send'](_0xb2577b);};}exports[_0xaac4('0x21')]=function(_0x17d25f,_0x22cda2){var _0xe93120={},_0x3c1445={},_0x249a5d={'count':0x0,'rows':[]};var _0x43b122=db[_0xaac4('0x22')][_0xaac4('0x23')];_0x3c1445[_0xaac4('0x24')]=_['keys'](_0x43b122);_0x3c1445[_0xaac4('0x25')]=_[_0xaac4('0x26')](_0x17d25f[_0xaac4('0x25')]);_0x3c1445[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x3c1445[_0xaac4('0x24')],_0x3c1445['query']);_0xe93120[_0xaac4('0x29')]=_['intersection'](_0x3c1445[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2a')]));_0xe93120['attributes']=_0xe93120['attributes']['length']?_0xe93120[_0xaac4('0x29')]:_0x3c1445[_0xaac4('0x24')];if(!_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2b')](_0xaac4('0x2c'))){_0xe93120[_0xaac4('0x2d')]=qs[_0xaac4('0x2d')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2d')]);_0xe93120[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x19')]);}_0xe93120[_0xaac4('0x2e')]=qs[_0xaac4('0x2f')](_0x17d25f['query']['sort']);_0xe93120[_0xaac4('0x30')]=qs[_0xaac4('0x27')](_[_0xaac4('0x31')](_0x17d25f['query'],_0x3c1445[_0xaac4('0x27')]));if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x32')]){_0xe93120[_0xaac4('0x30')]=_[_0xaac4('0x33')](_0xe93120[_0xaac4('0x30')],{'$or':_[_0xaac4('0x34')](_0x43b122,function(_0x53b7cb){if(_0x53b7cb[_0xaac4('0x35')][_0xaac4('0x36')]!==_0xaac4('0x37')){var _0x5d64a2={};_0x5d64a2[_0x53b7cb[_0xaac4('0x38')]]={'$like':'%'+_0x17d25f['query']['filter']+'%'};return _0x5d64a2;}})});}_0xe93120=_[_0xaac4('0x33')]({},_0xe93120,_0x17d25f[_0xaac4('0x39')]);var _0x2da28a={'where':_0xe93120['where']};return db['SAInvoice'][_0xaac4('0x18')](_0x2da28a)[_0xaac4('0x1e')](function(_0x2f7300){_0x249a5d[_0xaac4('0x18')]=_0x2f7300;if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x3a')]){_0xe93120['include']=[{'all':!![]}];}return db['SAInvoice'][_0xaac4('0x3b')](_0xe93120);})[_0xaac4('0x1e')](function(_0x5371b4){_0x249a5d[_0xaac4('0x3c')]=_0x5371b4;return _0x249a5d;})[_0xaac4('0x1e')](respondWithFilteredResult(_0x22cda2,_0xe93120))[_0xaac4('0x3d')](handleError(_0x22cda2,null));};exports['show']=function(_0x74a1c,_0x4a4773){var _0x2259fc={'raw':![],'where':{'id':_0x74a1c[_0xaac4('0x3e')]['id']}},_0x5bc387={};_0x5bc387[_0xaac4('0x24')]=_[_0xaac4('0x26')](db[_0xaac4('0x22')]['rawAttributes']);_0x5bc387[_0xaac4('0x25')]=_['keys'](_0x74a1c['query']);_0x5bc387[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],_0x5bc387[_0xaac4('0x25')]);_0x2259fc[_0xaac4('0x29')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x74a1c['query'][_0xaac4('0x2a')]));_0x2259fc[_0xaac4('0x29')]=_0x2259fc[_0xaac4('0x29')][_0xaac4('0x3f')]?_0x2259fc['attributes']:_0x5bc387[_0xaac4('0x24')];if(_0x74a1c[_0xaac4('0x25')][_0xaac4('0x3a')]){_0x2259fc['include']=[{'all':!![]}];}_0x2259fc=_[_0xaac4('0x33')]({},_0x2259fc,_0x74a1c[_0xaac4('0x39')]);return db[_0xaac4('0x22')][_0xaac4('0x40')](_0x2259fc)['then'](handleEntityNotFound(_0x4a4773,null))[_0xaac4('0x1e')](respondWithResult(_0x4a4773,null))[_0xaac4('0x3d')](handleError(_0x4a4773,null));};exports[_0xaac4('0x41')]=function(_0x57a7ab,_0xf404b9){return db[_0xaac4('0x42')][_0xaac4('0x43')]({'isolationLevel':db[_0xaac4('0x44')][_0xaac4('0x45')][_0xaac4('0x46')][_0xaac4('0x47')]},function(_0xa8d1c9){return db[_0xaac4('0x22')]['create'](_0x57a7ab[_0xaac4('0x48')],{'transaction':_0xa8d1c9});})[_0xaac4('0x1e')](respondWithResult(_0xf404b9,0xc9))[_0xaac4('0x3d')](handleError(_0xf404b9,null));};exports[_0xaac4('0x49')]=function(_0x130bb5,_0x5dca5c){if(_0x130bb5['body']['id']){delete _0x130bb5[_0xaac4('0x48')]['id'];}return db[_0xaac4('0x22')][_0xaac4('0x40')]({'where':{'id':_0x130bb5[_0xaac4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5dca5c,null))[_0xaac4('0x1e')](saveUpdates(_0x130bb5['body'],null))[_0xaac4('0x1e')](respondWithResult(_0x5dca5c,null))[_0xaac4('0x3d')](handleError(_0x5dca5c,null));};exports['destroy']=function(_0x282de3,_0x1d11af){return db[_0xaac4('0x22')]['find']({'where':{'id':_0x282de3['params']['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x1d11af,null))[_0xaac4('0x1e')](removeEntity(_0x1d11af,null))[_0xaac4('0x3d')](handleError(_0x1d11af,null));};exports[_0xaac4('0x4a')]=function(_0x1877c2,_0x1616d4){return db['SAInvoice'][_0xaac4('0x4a')]()[_0xaac4('0x1e')](respondWithResult(_0x1616d4,null))[_0xaac4('0x3d')](handleError(_0x1616d4,null));};exports[_0xaac4('0x4b')]=function(_0x56201b,_0x3ca377){var _0x571418=moment()[_0xaac4('0x4c')]()[_0xaac4('0x4d')]();var _0x460252=path[_0xaac4('0x4e')](config[_0xaac4('0x4f')],_0xaac4('0x50'),_0xaac4('0x51'),_0xaac4('0x52'));var _0x28aed5=path[_0xaac4('0x4e')](config[_0xaac4('0x4f')],_0xaac4('0x50'),_0xaac4('0x51'),_0xaac4('0x53'),'logos',_0xaac4('0x54'));var _0x6f025e=path[_0xaac4('0x4e')](config[_0xaac4('0x4f')],_0xaac4('0x50'),_0xaac4('0x51'),_0xaac4('0x53'),_0xaac4('0x55'),'paid-invoice.png');var _0x3d7ccc=path['join'](_0x460252,_0x571418);var _0x15c7b4=util['format'](_0xaac4('0x56'),_0x56201b['params']['id'],_0x571418);var _0x5155a4=path[_0xaac4('0x4e')](_0x3d7ccc,_0x15c7b4);var _0x3a4e29=![];var _0x48ae39={};return db[_0xaac4('0x22')][_0xaac4('0x40')]({'where':{'id':_0x56201b[_0xaac4('0x3e')]['id']},'raw':!![]})[_0xaac4('0x1e')](handleEntityNotFound(_0x3ca377,null))[_0xaac4('0x1e')](function(_0x19d9c1){if(_0x19d9c1){_0x48ae39['invoice']=_0x19d9c1;return db[_0xaac4('0x57')]['findAll']({'where':{'InvoiceId':_0x19d9c1['id']},'raw':!![]})[_0xaac4('0x1e')](function(_0x5ec220){_0x48ae39['details']=_0x5ec220;_0x3a4e29=!![];var _0x5e302c='';var _0x352c78={'format':'A4','orientation':_0xaac4('0x58'),'border':_0xaac4('0x59'),'footer':{'height':_0xaac4('0x5a'),'contents':{'default':'{{page}}/{{pages}}'}}};_0x352c78[_0xaac4('0x5b')][_0xaac4('0x5c')][_0xaac4('0x5d')]=_0x352c78['footer'][_0xaac4('0x5c')][_0xaac4('0x5d')]+_0xaac4('0x5e')+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x60')]+_0xaac4('0x61');fs[_0xaac4('0x62')](_0x3d7ccc);_0x5e302c='';_0x5e302c+='\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}';_0x5e302c+=_0xaac4('0x63');var _0x5c6250={'phone':{'en':'Phone','it':_0xaac4('0x64')},'fax':{'en':'Fax','it':_0xaac4('0x65')},'email':{'en':'Email','it':_0xaac4('0x66')},'piva':{'en':_0xaac4('0x67'),'it':'P.IVA'},'cf':{'en':'Tax\x20code','it':'C.F.'},'sdi':{'en':'I.S.\x20code','it':_0xaac4('0x68')},'cs':{'en':_0xaac4('0x69'),'it':_0xaac4('0x6a')},'invoice':{'en':_0xaac4('0x6b'),'it':'Fattura'},'proforma':{'en':_0xaac4('0x6c'),'it':_0xaac4('0x6c')},'creditnote':{'en':_0xaac4('0x6d'),'it':_0xaac4('0x6e')},'duedate':{'en':_0xaac4('0x6f'),'it':_0xaac4('0x70')},'item':{'en':_0xaac4('0x71'),'it':_0xaac4('0x72')},'description':{'en':_0xaac4('0x73'),'it':_0xaac4('0x74')},'hrsqty':{'en':_0xaac4('0x75'),'it':'Ore/Qta'},'unitprice':{'en':'Unit\x20Price','it':_0xaac4('0x76')},'subtotal':{'en':'Sub\x20Total','it':'Sub\x20Totale'},'discount':{'en':_0xaac4('0x77'),'it':'Sconto'},'total':{'en':_0xaac4('0x78'),'it':_0xaac4('0x79')},'tax':{'en':_0xaac4('0x7a'),'it':_0xaac4('0x7b')},'nettopay':{'en':'Total','it':_0xaac4('0x7c')},'sendpayment':{'en':_0xaac4('0x7d'),'it':_0xaac4('0x7e')},'accountholder':{'en':_0xaac4('0x7f'),'it':_0xaac4('0x80')},'bankname':{'en':_0xaac4('0x81'),'it':'Nome\x20banca'},'bankaddress':{'en':_0xaac4('0x82'),'it':_0xaac4('0x83')},'abi':{'en':'ABI','it':_0xaac4('0x84')},'cab':{'en':_0xaac4('0x85'),'it':'CAB'},'bic':{'en':'BIC','it':_0xaac4('0x86')},'swif':{'en':_0xaac4('0x87'),'it':_0xaac4('0x87')},'iban':{'en':_0xaac4('0x88'),'it':_0xaac4('0x88')},'paypal':{'en':_0xaac4('0x89'),'it':_0xaac4('0x8a')},'thank1':{'en':_0xaac4('0x8b'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0xaac4('0x8c'),'it':_0xaac4('0x8d')}};var _0x3dead0='it';if(_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x8e')]!==_0xaac4('0x8f')){_0x3dead0='en';}_0x5e302c+='';_0x5e302c+=_0xaac4('0x90')+_0x28aed5+_0xaac4('0x91');_0x5e302c+='';_0x5e302c+=util['format']('\x20%s
',_0x48ae39[_0xaac4('0x5f')]['issuerName']);_0x5e302c+=util['format']('%s
',_0x48ae39['invoice']['issuerStreet']);_0x5e302c+=util[_0xaac4('0x92')]('%s',_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x93')]);_0x5e302c+=util[_0xaac4('0x92')]('\x20%s',_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x94')]);_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0x95'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x96')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250['phone'][_0x3dead0]+_0xaac4('0x97'),_0x48ae39['invoice']['issuerPhone']);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x98')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x99')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x9a')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x9b')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x9c')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x9d')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250['cf'][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x9e')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x9f')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xa0')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250['cs'][_0x3dead0]+':\x20%s
',_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xa1')]);_0x5e302c+=_0xaac4('0xa2');_0x5e302c+=_0xaac4('0xa3');_0x5e302c+=_0xaac4('0xa4');_0x5e302c+=util['format'](_0xaac4('0xa5'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xa6')]);_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xa7'),_0x48ae39['invoice'][_0xaac4('0xa8')]);_0x5e302c+=util['format'](_0xaac4('0xa9'),_0x48ae39[_0xaac4('0x5f')]['receivingPostalCode']);_0x5e302c+=util[_0xaac4('0x92')]('%s
',_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xaa')]);_0x5e302c+=util['format'](_0xaac4('0xa7'),_0x48ae39[_0xaac4('0x5f')]['receivingCountry']);_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xab')+_0x5c6250['cf'][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xac')]);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x9c')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39[_0xaac4('0x5f')]['receivingPIVA']);_0x5e302c+=util[_0xaac4('0x92')](_0x5c6250[_0xaac4('0x9f')][_0x3dead0]+_0xaac4('0x97'),_0x48ae39['invoice'][_0xaac4('0xad')]);_0x5e302c+=_0xaac4('0xae');_0x5e302c+=_0xaac4('0xaf');_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=_0xaac4('0xb1');_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xb2')+_0x5c6250[_0xaac4('0x5f')][_0x3dead0]+_0xaac4('0xb3'),_0x19d9c1['id']);_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xb4'),_0x48ae39[_0xaac4('0x5f')][_0xaac4('0x94')]);var _0x72b39c=moment(_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xb5')])['format'](_0xaac4('0xb6'));_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xb7'),_0x72b39c);var _0x553bca=moment(_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xb5')])['add'](_0x48ae39[_0xaac4('0x5f')]['saExpiryDay'],_0xaac4('0xb8'))[_0xaac4('0x92')](_0xaac4('0xb6'));_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xb9')+_0x5c6250[_0xaac4('0xba')][_0x3dead0]+':\x20%s',_0x553bca);_0x5e302c+=_0xaac4('0xaf');_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=_0xaac4('0xb1');_0x5e302c+=_0xaac4('0xbb');_0x5e302c+='
';_0x5e302c+=_0xaac4('0xbc')+_0x5c6250[_0xaac4('0xbd')][_0x3dead0]+_0xaac4('0xbe');_0x5e302c+=''+_0x5c6250[_0xaac4('0xbf')][_0x3dead0]+_0xaac4('0xbe');_0x5e302c+=_0xaac4('0xbc')+_0x5c6250[_0xaac4('0xc0')][_0x3dead0]+_0xaac4('0xbe');_0x5e302c+=''+_0x5c6250['unitprice'][_0x3dead0]+_0xaac4('0xbe');_0x5e302c+=_0xaac4('0xbc')+_0x5c6250[_0xaac4('0xc1')][_0x3dead0]+_0xaac4('0xbe');_0x5e302c+='';var _0x1973ab=0x0;var _0x233cb4=0x0;for(var _0x455441=0x0;_0x455441<_0x48ae39[_0xaac4('0xc2')][_0xaac4('0x3f')];_0x455441++){var _0x22859e=0x0;var _0x3e82e5=0x0;var _0x3f97ba=0x0;var _0x145ac1=0x0;_0x22859e=_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc3')]-_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc3')]/0x64*_0x48ae39['details'][_0x455441][_0xaac4('0xc4')];_0x3e82e5=_0x22859e/0x64*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc5')];_0x3f97ba=_0x22859e*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc6')];_0x145ac1=_0x3e82e5*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc6')];_0x5e302c+='';_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xc7'),_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc8')]);_0x5e302c+=util[_0xaac4('0x92')](_0xaac4('0xc7'),_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc9')]);_0x5e302c+=util['format'](_0xaac4('0xca'),_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc6')]);_0x5e302c+=_0xaac4('0xcb')+_0x22859e[_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');_0x5e302c+=_0xaac4('0xcb')+_0x3f97ba[_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');_0x5e302c+=_0xaac4('0xaf');_0x1973ab+=_0x3f97ba;_0x233cb4+=_0x145ac1;}_0x5e302c+='
';if(!_['isNil'](_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xc4')])){var _0x1a07df=0x0;var _0x1b70bb=0x0;var _0x384a7a=_0x48ae39['invoice'][_0xaac4('0xc4')]*0x64/_0x1973ab;for(var _0x455441=0x0;_0x455441<_0x48ae39[_0xaac4('0xc2')][_0xaac4('0x3f')];_0x455441++){var _0x74adbc=0x0;var _0xebc731=0x0;var _0x71343b=0x0;_0x22859e=_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc3')]-_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc3')]/0x64*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc4')];_0x74adbc=_0x22859e/0x64*_0x384a7a;_0xebc731=_0x22859e-_0x74adbc;_0x71343b=_0xebc731*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc6')];_0x1a07df+=_0x71343b;_0x1b70bb+=_0x71343b/0x64*_0x48ae39[_0xaac4('0xc2')][_0x455441][_0xaac4('0xc5')];}}var _0x367c2a=0x0;var _0x3b3b3f=0x0;var _0x2c7e3e=![];var _0x15b1ad=_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xce')];if(_0x15b1ad[_0xaac4('0xcf')](_0xaac4('0xd0'))!=-0x1){_0x2c7e3e=!![];}if(!_[_0xaac4('0xd1')](_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xc4')])){_0x5e302c+=_0xaac4('0xb0');if(_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xc4')]>0x0){_0x5e302c+=_0xaac4('0xd2')+_0x5c6250[_0xaac4('0xc4')][_0x3dead0]+_0xaac4('0xa2');_0x5e302c+='\x20'+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xc4')][_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');}_0x5e302c+=_0xaac4('0xaf');_0x367c2a=_0x1b70bb;_0x3b3b3f=_0x1a07df;}else{_0x367c2a=_0x233cb4;_0x3b3b3f=_0x1973ab;}if(_0x367c2a>0x0||_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xc4')]>0x0){_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=''+_0x5c6250[_0xaac4('0xd3')][_0x3dead0]+_0xaac4('0xa2');_0x5e302c+=''+_0x3b3b3f[_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');_0x5e302c+=_0xaac4('0xaf');}if(_0x367c2a>0x0){_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=''+_0x5c6250[_0xaac4('0xc5')][_0x3dead0]+_0xaac4('0xa2');_0x5e302c+=_0xaac4('0xcb')+_0x367c2a[_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');_0x5e302c+=_0xaac4('0xaf');}_0x5e302c+=_0xaac4('0xb0');var _0x15a5ec;if(_0x2c7e3e){_0x15a5ec=_0x3b3b3f;}else{_0x15a5ec=_0x3b3b3f+_0x367c2a;}_0x5e302c+=_0xaac4('0xd4')+_0x5c6250['nettopay'][_0x3dead0]+_0xaac4('0xd5')+_0x15a5ec[_0xaac4('0xcc')](0x2)+_0xaac4('0xcd');_0x5e302c+=_0xaac4('0xd6');_0x5e302c+=_0xaac4('0xaf');_0x5e302c+=_0xaac4('0xd7');_0x5e302c+=_0xaac4('0xd8');_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=util[_0xaac4('0x92')]('\x20%s\x20',_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xce')]['replace'](new RegExp(String['fromCharCode'](0xd),'g'),_0xaac4('0xd9')));_0x5e302c+=_0xaac4('0xaf');_0x5e302c+=_0xaac4('0xb0');_0x5e302c+=_0xaac4('0xb1');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xdb')][_0x3dead0]+':';if(!_[_0xaac4('0xd1')](_0x48ae39[_0xaac4('0x5f')]['issuerBankAccount'])){_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xdc')][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39['invoice'][_0xaac4('0xde')]+_0xaac4('0xdf');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xe0')][_0x3dead0]+':\x20'+_0x48ae39['invoice'][_0xaac4('0xe1')]+_0xaac4('0xe2');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xe3')][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xe4')]+',\x20'+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xe5')]+'\x20-\x20'+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xe6')]+'\x20('+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xe7')]+')'+_0xaac4('0xdf');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xe8')][_0x3dead0]+'/'+_0x5c6250['cab'][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39[_0xaac4('0x5f')]['issuerABI']+'/'+_0x48ae39['invoice']['issuerCAB']+_0xaac4('0xdf');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xe9')][_0x3dead0]+'/'+_0x5c6250[_0xaac4('0xea')][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xeb')]+_0xaac4('0xdf');_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xec')][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39[_0xaac4('0x5f')][_0xaac4('0xed')]+_0xaac4('0xdf');}if(!_['isNil'](_0x48ae39[_0xaac4('0x5f')]['issuerPayPal'])){_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xee')][_0x3dead0]+_0xaac4('0xdd')+_0x48ae39['invoice'][_0xaac4('0xef')]+_0xaac4('0xf0');}_0x5e302c+=_0xaac4('0xda')+_0x5c6250[_0xaac4('0xf1')][_0x3dead0]+''+_0x553bca+_0xaac4('0xf2')+_0x5c6250[_0xaac4('0xf3')][_0x3dead0]+_0xaac4('0x61');_0x5e302c+=_0xaac4('0xa2');_0x5e302c+=_0xaac4('0xaf');if(_0x48ae39[_0xaac4('0x5f')]['paid']===0x1){_0x5e302c+=_0xaac4('0x90')+_0x6f025e+_0xaac4('0x91');}_0x5e302c+='';_0x5e302c+=_0xaac4('0xf4');_0x5e302c+=_0xaac4('0xf5');console['log']('body',_0x5e302c);return new BPromise(function(_0x55c223,_0x13c392){pdf[_0xaac4('0x41')](_0x5e302c,_0x352c78)[_0xaac4('0xf6')](path['join'](_0x3d7ccc,_0x15c7b4),function(_0x25f93b,_0x5da3a2){if(_0x25f93b)return _0x13c392(_0x25f93b);_0x55c223(_0x5da3a2);});});});}})[_0xaac4('0x1e')](function(){if(_0x3a4e29){console[_0xaac4('0xf7')](_0xaac4('0xf8'),_0x5155a4,_0x15c7b4);return _0x3ca377[_0xaac4('0xf9')](_0x5155a4,_0x15c7b4,function(_0x4532d9){if(_0x4532d9){console['log'](_0xaac4('0xfa'),_0x4532d9);}else{console['log'](_0xaac4('0xfb'),_0x3d7ccc);rimraf(_0x3d7ccc,function(){});}});}else{return _0x3ca377[_0xaac4('0x14')](0xc8);}})[_0xaac4('0x3d')](handleError(_0x3ca377,null));};exports[_0xaac4('0xfc')]=function(_0x3af6a7,_0x136f20){var _0x24cbe8=_0x3af6a7['query'][_0xaac4('0xfd')];var _0xda4028=squel[_0xaac4('0xfe')]()['from']('sa_invoices')[_0xaac4('0x38')](_0xaac4('0xff'),_0xaac4('0x100'))['field']('YEAR(startDate)','invoiceYear')[_0xaac4('0x38')](_0xaac4('0x101'),'invoiceMonth')['where'](_0xaac4('0x102')+_0x24cbe8+')')[_0xaac4('0x2e')]('MONTH(startDate)')['order'](_0xaac4('0x103'),![])[_0xaac4('0x104')]('YEAR(startDate)')[_0xaac4('0x104')](_0xaac4('0x101'));return db['sequelize'][_0xaac4('0x25')](_0xda4028[_0xaac4('0x4d')](),{'type':db[_0xaac4('0x42')][_0xaac4('0x105')][_0xaac4('0x106')]})[_0xaac4('0x1e')](function(_0x56b172){return{'count':_0x56b172['length'],'rows':_0x56b172};})['then'](handleEntityNotFound(_0x136f20,null))[_0xaac4('0x1e')](respondWithResult(_0x136f20,null))['catch'](handleError(_0x136f20,null));};function addInvoiceCreditnoteDetail(_0x3c711a,_0x595d73,_0x2661c2){console['log'](_0xaac4('0x107'),_0x3c711a);var _0x13b55c={'companyName':_0x3c711a['companyName'],'companyId':_0x3c711a[_0xaac4('0x108')],'productName':_0x3c711a['productName'],'productCode':_0x3c711a[_0xaac4('0x109')],'productDescription':_0x3c711a['productDescription'],'typeName':_0x3c711a[_0xaac4('0x10a')],'pricelistName':_0x3c711a[_0xaac4('0x10b')],'priceListId':_0x3c711a['priceListId'],'netPrice':_0x3c711a[_0xaac4('0xc3')],'discount':_0x3c711a[_0xaac4('0xc4')],'tax':_0x3c711a[_0xaac4('0xc5')],'agentFullname':_0x3c711a[_0xaac4('0x10c')],'note':_0x3c711a['note'],'subscriptionId':_0x3c711a['subscriptionId'],'subscriptionName':_0x3c711a['subscriptionName'],'subscriptionMonthly':_0x3c711a['subscriptionMonthly'],'quantity':_0x3c711a[_0xaac4('0xc6')],'CreditNoteId':_0x595d73,'unitName':_0x3c711a[_0xaac4('0x10d')]};return db[_0xaac4('0x10e')][_0xaac4('0x41')](_0x13b55c,{'transaction':_0x2661c2});}exports[_0xaac4('0x10f')]=function(_0x2e8daf,_0xc01bd,_0x4ef5dc){var _0x815df5;if(_0x2e8daf['body']['id']){delete _0x2e8daf[_0xaac4('0x48')]['id'];}console[_0xaac4('0xf7')](_0x2e8daf);return db[_0xaac4('0x42')][_0xaac4('0x43')](function(_0x1ff011){return db[_0xaac4('0x110')][_0xaac4('0x41')](_0x2e8daf[_0xaac4('0x48')],{'transaction':_0x1ff011})[_0xaac4('0x1e')](function(_0x217151){_0x815df5=_0x217151;var _0x52c4c9=_0x2e8daf[_0xaac4('0x3e')]['id'];return db[_0xaac4('0x57')][_0xaac4('0x3b')]({'where':{'InvoiceId':_0x52c4c9},'raw':!![],'logging':console[_0xaac4('0xf7')]});})[_0xaac4('0x1e')](function(_0x29ffe0){if(_0x29ffe0[_0xaac4('0x3f')]>0x0){var _0x520ffb=[];for(var _0x3383ac=0x0;_0x3383ac<_0x29ffe0[_0xaac4('0x3f')];_0x3383ac++){_0x520ffb[_0xaac4('0x111')](addInvoiceCreditnoteDetail(_0x29ffe0[_0x3383ac],_0x815df5['id'],_0x1ff011));}return BPromise[_0xaac4('0x112')](_0x520ffb);}else{var _0x3e5115={'errors':[{'type':_0xaac4('0x113'),'message':_0xaac4('0x114')}]};throw _0x3e5115;}});})['then'](function(){return _0xc01bd[_0xaac4('0x14')](0xc8);})[_0xaac4('0x3d')](function(_0x30e4fe){console[_0xaac4('0xf7')](_0xaac4('0x115'),_0x30e4fe);if(_0x30e4fe['name']==='SequelizeUniqueConstraintError'){var _0x30e4fe={'errors':[{'message':_0xaac4('0x116')}]};}_0xc01bd[_0xaac4('0x16')](0x1f4)[_0xaac4('0x117')](_0x30e4fe);});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.model.js b/server/api/saInvoice/saInvoice.model.js index bcb4969..9ca7e3c 100644 --- a/server/api/saInvoice/saInvoice.model.js +++ b/server/api/saInvoice/saInvoice.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['rimraf','../../config/environment','./saInvoice.attributes','exports','define','SAInvoice','models','get','format','YYYY','SAInvoiceNumber','transaction','then','number','update','create','log','TCL:\x20error','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xbc88bc,_0x10ea66){var _0x548858=function(_0x178473){while(--_0x178473){_0xbc88bc['push'](_0xbc88bc['shift']());}};_0x548858(++_0x10ea66);}(_0x814b,0x1a2));var _0xb814=function(_0x493503,_0x351993){_0x493503=_0x493503-0x0;var _0x1986d0=_0x814b[_0x493503];return _0x1986d0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'sa_invoices','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x271af9,_0x2913a6,_0x186d5a){var _0x41166c=_0x322a70[_0xb814('0xd')];var _0x21d4a5=_0x271af9[_0xb814('0xe')]({'plain':!![]});var _0x19aad8=0x1;var _0x207dbc=parseInt(moment()[_0xb814('0xf')](_0xb814('0x10')));try{if(_['has'](_0x21d4a5,'id')){return _0x41166c[_0xb814('0x11')]['findOne']({'where':{'year':_0x207dbc},'raw':!![],'logging':!![],'transaction':_0x2913a6[_0xb814('0x12')]})[_0xb814('0x13')](function(_0x35b10d){if(_0x35b10d){_0x19aad8=_0x35b10d[_0xb814('0x14')]+0x1;return _0x41166c[_0xb814('0x11')][_0xb814('0x15')]({'number':_0x19aad8},{'where':{'id':_0x35b10d['id']},'transaction':_0x2913a6[_0xb814('0x12')],'logging':!![]});}return _0x41166c[_0xb814('0x11')][_0xb814('0x16')]({'year':_0x207dbc,'number':_0x19aad8},{'logging':!![],'transaction':_0x2913a6[_0xb814('0x12')]});})[_0xb814('0x13')](function(){_0x21d4a5[_0xb814('0x14')]=_0x19aad8;})[_0xb814('0x13')](function(){_0x186d5a();});}}catch(_0x39bfcf){console[_0xb814('0x17')](_0xb814('0x18'),_0x39bfcf);_0x186d5a();}}}});}; \ No newline at end of file +var _0x56e7=['bluebird','request-promise','path','rimraf','../../config/environment','./saInvoice.attributes','define','SAInvoice','models','format','YYYY','SAInvoiceNumber','findOne','update','transaction','create','number','then','util','../../config/logger','moment'];(function(_0x7e175c,_0x43ac75){var _0x1e1210=function(_0x5f4112){while(--_0x5f4112){_0x7e175c['push'](_0x7e175c['shift']());}};_0x1e1210(++_0x43ac75);}(_0x56e7,0x7b));var _0x756e=function(_0x3b8680,_0x5a3670){_0x3b8680=_0x3b8680-0x0;var _0x5f5bb5=_0x56e7[_0x3b8680];return _0x5f5bb5;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var logger=require(_0x756e('0x1'))('api');var moment=require(_0x756e('0x2'));var BPromise=require(_0x756e('0x3'));var rp=require(_0x756e('0x4'));var fs=require('fs');var path=require(_0x756e('0x5'));var rimraf=require(_0x756e('0x6'));var config=require(_0x756e('0x7'));var attributes=require(_0x756e('0x8'));module['exports']=function(_0x3b3b8f,_0x404189){return _0x3b3b8f[_0x756e('0x9')](_0x756e('0xa'),attributes,{'tableName':'sa_invoices','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c6a22,_0x5c2db4,_0x4460c7){var _0x401181=_0x3b3b8f[_0x756e('0xb')];var _0x4738dc=_0x1c6a22['get']({'plain':!![]});var _0x5d5b90=0x1;var _0x324d36=parseInt(moment()[_0x756e('0xc')](_0x756e('0xd')));try{if(_['has'](_0x4738dc,'id')){return _0x401181[_0x756e('0xe')][_0x756e('0xf')]({'where':{'year':_0x324d36},'raw':!![],'logging':!![],'transaction':_0x5c2db4['transaction']})['then'](function(_0x1b68ef){if(_0x1b68ef){_0x5d5b90=_0x1b68ef['number']+0x1;return _0x401181[_0x756e('0xe')][_0x756e('0x10')]({'number':_0x5d5b90},{'where':{'id':_0x1b68ef['id']},'transaction':_0x5c2db4[_0x756e('0x11')],'logging':!![]});}return _0x401181[_0x756e('0xe')][_0x756e('0x12')]({'year':_0x324d36,'number':_0x5d5b90},{'logging':!![],'transaction':_0x5c2db4['transaction']});})['then'](function(){_0x4738dc[_0x756e('0x13')]=_0x5d5b90;})[_0x756e('0x14')](function(){_0x4460c7();});}}catch(_0xccccd4){console['log']('TCL:\x20error',_0xccccd4);_0x4460c7();}}}});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.rpc.js b/server/api/saInvoice/saInvoice.rpc.js index 50db073..339c31b 100644 --- a/server/api/saInvoice/saInvoice.rpc.js +++ b/server/api/saInvoice/saInvoice.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x687e=['bluebird','ioredis','../../config/utils','../../config/environment','http','then','SAInvoice,\x20%s,\x20%s','request\x20sent','debug','SAInvoice,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment'];(function(_0x4db3f4,_0x3a0dfb){var _0x488893=function(_0xaa4952){while(--_0xaa4952){_0x4db3f4['push'](_0x4db3f4['shift']());}};_0x488893(++_0x3a0dfb);}(_0x687e,0x141));var _0xe687=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x687e[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xe687('0x0'));var util=require(_0xe687('0x1'));var moment=require(_0xe687('0x2'));var BPromise=require(_0xe687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe687('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe687('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe687('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe687('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36a614,_0x5b9e26,_0x58c5e2){return new BPromise(function(_0x390aa8,_0x489d79){return client['request'](_0x36a614,_0x58c5e2)[_0xe687('0x8')](function(_0x2fc466){logger['info'](_0xe687('0x9'),_0x5b9e26,_0xe687('0xa'));logger[_0xe687('0xb')](_0xe687('0xc'),_0x5b9e26,_0xe687('0xa'),JSON['stringify'](_0x2fc466));if(_0x2fc466[_0xe687('0xd')]){if(_0x2fc466[_0xe687('0xd')][_0xe687('0xe')]===0x1f4){logger[_0xe687('0xd')]('SAInvoice,\x20%s,\x20%s',_0x5b9e26,_0x2fc466[_0xe687('0xd')]['message']);return _0x489d79(_0x2fc466['error'][_0xe687('0xf')]);}logger[_0xe687('0xd')](_0xe687('0x9'),_0x5b9e26,_0x2fc466[_0xe687('0xd')]['message']);return _0x390aa8(_0x2fc466[_0xe687('0xd')]['message']);}else{logger[_0xe687('0x10')]('SAInvoice,\x20%s,\x20%s',_0x5b9e26,_0xe687('0xa'));_0x390aa8(_0x2fc466['result']['message']);}})[_0xe687('0x11')](function(_0x14c8ac){logger[_0xe687('0xd')](_0xe687('0x9'),_0x5b9e26,_0x14c8ac);_0x489d79(_0x14c8ac);});});} \ No newline at end of file +var _0x8f0b=['SAInvoice,\x20%s,\x20%s,\x20%s','stringify','error','code','SAInvoice,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x325ee2,_0xaf1371){var _0x7f2741=function(_0x15569a){while(--_0x15569a){_0x325ee2['push'](_0x325ee2['shift']());}};_0x7f2741(++_0xaf1371);}(_0x8f0b,0x70));var _0xb8f0=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8f0b[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb8f0('0x0'));var moment=require(_0xb8f0('0x1'));var BPromise=require(_0xb8f0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f0('0x4'));var logger=require(_0xb8f0('0x5'))(_0xb8f0('0x6'));var config=require('../../config/environment');var jayson=require(_0xb8f0('0x7'));var client=jayson[_0xb8f0('0x8')][_0xb8f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55856c,_0x2e6408,_0xf817a6){return new BPromise(function(_0x57adc5,_0x1fc3b3){return client[_0xb8f0('0xa')](_0x55856c,_0xf817a6)[_0xb8f0('0xb')](function(_0x34ce05){logger[_0xb8f0('0xc')]('SAInvoice,\x20%s,\x20%s',_0x2e6408,_0xb8f0('0xd'));logger['debug'](_0xb8f0('0xe'),_0x2e6408,_0xb8f0('0xd'),JSON[_0xb8f0('0xf')](_0x34ce05));if(_0x34ce05[_0xb8f0('0x10')]){if(_0x34ce05['error'][_0xb8f0('0x11')]===0x1f4){logger['error'](_0xb8f0('0x12'),_0x2e6408,_0x34ce05[_0xb8f0('0x10')]['message']);return _0x1fc3b3(_0x34ce05['error'][_0xb8f0('0x13')]);}logger[_0xb8f0('0x10')](_0xb8f0('0x12'),_0x2e6408,_0x34ce05[_0xb8f0('0x10')][_0xb8f0('0x13')]);return _0x57adc5(_0x34ce05[_0xb8f0('0x10')][_0xb8f0('0x13')]);}else{logger['info'](_0xb8f0('0x12'),_0x2e6408,_0xb8f0('0xd'));_0x57adc5(_0x34ce05['result'][_0xb8f0('0x13')]);}})[_0xb8f0('0x14')](function(_0x846ac2){logger['error'](_0xb8f0('0x12'),_0x2e6408,_0x846ac2);_0x1fc3b3(_0x846ac2);});});} \ No newline at end of file diff --git a/server/api/saInvoiceDetail/index.js b/server/api/saInvoiceDetail/index.js index d405453..a8e1441 100644 --- a/server/api/saInvoiceDetail/index.js +++ b/server/api/saInvoiceDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0639=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./saInvoiceDetail.controller'];(function(_0x46adb7,_0x433103){var _0x2db644=function(_0x2cd347){while(--_0x2cd347){_0x46adb7['push'](_0x46adb7['shift']());}};_0x2db644(++_0x433103);}(_0x0639,0xf4));var _0x9063=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0639[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0x9063('0x0'));var util=require(_0x9063('0x1'));var path=require(_0x9063('0x2'));var timeout=require(_0x9063('0x3'));var express=require(_0x9063('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9063('0x5'));var config=require(_0x9063('0x6'));var controller=require(_0x9063('0x7'));router[_0x9063('0x8')]('/',auth[_0x9063('0x9')](),controller[_0x9063('0xa')]);router[_0x9063('0x8')](_0x9063('0xb'),auth[_0x9063('0x9')](),controller[_0x9063('0xc')]);router[_0x9063('0x8')](_0x9063('0xd'),auth[_0x9063('0x9')](),controller[_0x9063('0xe')]);router[_0x9063('0xf')]('/',auth['isAuthenticated'](),controller[_0x9063('0x10')]);router['put'](_0x9063('0xd'),auth[_0x9063('0x9')](),controller[_0x9063('0x11')]);router[_0x9063('0x12')](_0x9063('0xd'),auth[_0x9063('0x9')](),controller[_0x9063('0x13')]);module[_0x9063('0x14')]=router; \ No newline at end of file +var _0x06b9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x400ad4,_0x25ab92){var _0x48f28c=function(_0x482d00){while(--_0x482d00){_0x400ad4['push'](_0x400ad4['shift']());}};_0x48f28c(++_0x25ab92);}(_0x06b9,0x7c));var _0x906b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06b9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x906b('0x0'));var util=require(_0x906b('0x1'));var path=require('path');var timeout=require(_0x906b('0x2'));var express=require(_0x906b('0x3'));var router=express[_0x906b('0x4')]();var auth=require(_0x906b('0x5'));var interaction=require(_0x906b('0x6'));var config=require(_0x906b('0x7'));var controller=require(_0x906b('0x8'));router[_0x906b('0x9')]('/',auth[_0x906b('0xa')](),controller[_0x906b('0xb')]);router[_0x906b('0x9')](_0x906b('0xc'),auth[_0x906b('0xa')](),controller[_0x906b('0xd')]);router['get'](_0x906b('0xe'),auth[_0x906b('0xa')](),controller[_0x906b('0xf')]);router['post']('/',auth[_0x906b('0xa')](),controller['create']);router[_0x906b('0x10')](_0x906b('0xe'),auth[_0x906b('0xa')](),controller[_0x906b('0x11')]);router[_0x906b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x906b('0x13')]);module[_0x906b('0x14')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js b/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js index 7400f70..a7aaf8a 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1741=['\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize','exports','STRING','INTEGER','TEXT','long'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x1741,0x10a));var _0x1174=function(_0x4abf13,_0x28742a){_0x4abf13=_0x4abf13-0x0;var _0x27b0e5=_0x1741[_0x4abf13];return _0x27b0e5;};'use strict';var Sequelize=require(_0x1174('0x0'));module[_0x1174('0x1')]={'companyName':{'type':Sequelize[_0x1174('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x1174('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0x1174('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x1174('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x1174('0x4')](_0x1174('0x5'))+_0x1174('0x6')},'typeName':{'type':Sequelize[_0x1174('0x2')],'allowNull':![]},'unitName':{'type':Sequelize[_0x1174('0x2')]},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x1174('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x1174('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x1174('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x1174('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING'],'allowNull':![]},'note':{'type':Sequelize[_0x1174('0x4')]},'subscriptionId':{'type':Sequelize[_0x1174('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x1174('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x1174('0x3')],'allowNull':![]},'quantity':{'type':Sequelize[_0x1174('0x3')],'allowNull':![]},'ProductQuotationId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9541=['INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize','exports','STRING'];(function(_0x3bd1b9,_0x1d0cce){var _0x6584bf=function(_0x19b984){while(--_0x19b984){_0x3bd1b9['push'](_0x3bd1b9['shift']());}};_0x6584bf(++_0x1d0cce);}(_0x9541,0xd5));var _0x1954=function(_0x46dc9f,_0x492d28){_0x46dc9f=_0x46dc9f-0x0;var _0x5874b6=_0x9541[_0x46dc9f];return _0x5874b6;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'companyName':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x1954('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0x1954('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x1954('0x4')](_0x1954('0x5'))+_0x1954('0x6')},'typeName':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x1954('0x4')],'allowNull':![]},'priceListId':{'type':Sequelize[_0x1954('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x1954('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x1954('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x1954('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'note':{'type':Sequelize['TEXT']},'subscriptionId':{'type':Sequelize[_0x1954('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x1954('0x3')],'allowNull':![]},'quantity':{'type':Sequelize[_0x1954('0x3')],'allowNull':![]},'ProductQuotationId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.controller.js b/server/api/saInvoiceDetail/saInvoiceDetail.controller.js index 3d4017c..8531cc7 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.controller.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4348=['status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','error','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','SAInvoiceDetail','then','includeAll','include','findAll','rows','show','params','length','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x4348,0x10e));var _0x8434=function(_0x48027f,_0x472dfc){_0x48027f=_0x48027f-0x0;var _0x551dec=_0x4348[_0x48027f];return _0x551dec;};'use strict';var pdf=require(_0x8434('0x0'));var emlformat=require(_0x8434('0x1'));var rimraf=require(_0x8434('0x2'));var zipdir=require(_0x8434('0x3'));var jsonpatch=require(_0x8434('0x4'));var rp=require(_0x8434('0x5'));var moment=require(_0x8434('0x6'));var BPromise=require(_0x8434('0x7'));var Mustache=require(_0x8434('0x8'));var util=require('util');var path=require(_0x8434('0x9'));var sox=require(_0x8434('0xa'));var csv=require(_0x8434('0xb'));var ejs=require(_0x8434('0xc'));var fs=require('fs');var _=require(_0x8434('0xd'));var squel=require('squel');var crypto=require(_0x8434('0xe'));var jsforce=require(_0x8434('0xf'));var deskjs=require(_0x8434('0x10'));var toCsv=require(_0x8434('0xb'));var querystring=require(_0x8434('0x11'));var Papa=require(_0x8434('0x12'));var Redis=require(_0x8434('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8434('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8434('0x15'))(_0x8434('0x16'));var utils=require(_0x8434('0x17'));var config=require(_0x8434('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x418535,_0x4fe7a2){_0x4fe7a2=_0x4fe7a2||0xcc;return function(_0x2bdcc8){if(_0x2bdcc8){return _0x418535[_0x8434('0x19')](_0x4fe7a2);}return _0x418535[_0x8434('0x1a')](_0x4fe7a2)[_0x8434('0x1b')]();};}function respondWithResult(_0x5c41e1,_0x4fcebe){_0x4fcebe=_0x4fcebe||0xc8;return function(_0x439da8){if(_0x439da8){return _0x5c41e1[_0x8434('0x1a')](_0x4fcebe)['json'](_0x439da8);}};}function respondWithFilteredResult(_0xdbebb0,_0x19b865){return function(_0x586dcd){if(_0x586dcd){var _0x4d7b52=_0x586dcd[_0x8434('0x1c')],_0x2d7d6e=_0x19b865[_0x8434('0x1d')],_0x3598a1=_0x19b865[_0x8434('0x1d')]+_0x19b865[_0x8434('0x1e')],_0x11889e;if(_0x3598a1>=_0x4d7b52){_0x3598a1=_0x4d7b52;_0x11889e=0xc8;}else{_0x11889e=0xce;}_0xdbebb0['status'](_0x11889e);return _0xdbebb0['set'](_0x8434('0x1f'),_0x2d7d6e+'-'+_0x3598a1+'/'+_0x4d7b52)[_0x8434('0x20')](_0x586dcd);}return null;};}function patchUpdates(_0x97f4c2){return function(_0x98940f){try{jsonpatch[_0x8434('0x21')](_0x98940f,_0x97f4c2,!![]);}catch(_0x52d92f){return BPromise[_0x8434('0x22')](_0x52d92f);}return _0x98940f[_0x8434('0x23')]();};}function saveUpdates(_0x5f315c,_0x4f713f){return function(_0x240d37){if(_0x240d37){return _0x240d37[_0x8434('0x24')](_0x5f315c)['then'](function(_0x45b90c){return _0x45b90c;});}return null;};}function removeEntity(_0xb8c2c2,_0x3d6e62){return function(_0x15f540){if(_0x15f540){return _0x15f540[_0x8434('0x25')]()['then'](function(){_0xb8c2c2['status'](0xcc)[_0x8434('0x1b')]();});}};}function handleEntityNotFound(_0x5bf42c,_0x158186){return function(_0x3b1cad){if(!_0x3b1cad){_0x5bf42c[_0x8434('0x19')](0x194);}return _0x3b1cad;};}function handleError(_0x433e52,_0x86c016){_0x86c016=_0x86c016||0x1f4;return function(_0x3ea214){logger[_0x8434('0x26')](_0x3ea214['stack']);if(_0x3ea214['name']){delete _0x3ea214[_0x8434('0x27')];}_0x433e52['status'](_0x86c016)[_0x8434('0x28')](_0x3ea214);};}exports['index']=function(_0x36a821,_0x1d810f){var _0x215afd={},_0x4970f1={},_0x3f9ab9={'count':0x0,'rows':[]};var _0x454599=db['SAInvoiceDetail'][_0x8434('0x29')];_0x4970f1[_0x8434('0x2a')]=_[_0x8434('0x2b')](_0x454599);_0x4970f1[_0x8434('0x2c')]=_[_0x8434('0x2b')](_0x36a821[_0x8434('0x2c')]);_0x4970f1[_0x8434('0x2d')]=_[_0x8434('0x2e')](_0x4970f1[_0x8434('0x2a')],_0x4970f1['query']);_0x215afd[_0x8434('0x2f')]=_[_0x8434('0x2e')](_0x4970f1[_0x8434('0x2a')],qs[_0x8434('0x30')](_0x36a821['query'][_0x8434('0x30')]));_0x215afd['attributes']=_0x215afd[_0x8434('0x2f')]['length']?_0x215afd[_0x8434('0x2f')]:_0x4970f1[_0x8434('0x2a')];if(!_0x36a821[_0x8434('0x2c')]['hasOwnProperty'](_0x8434('0x31'))){_0x215afd[_0x8434('0x1e')]=qs[_0x8434('0x1e')](_0x36a821[_0x8434('0x2c')]['limit']);_0x215afd[_0x8434('0x1d')]=qs['offset'](_0x36a821[_0x8434('0x2c')][_0x8434('0x1d')]);}_0x215afd[_0x8434('0x32')]=qs[_0x8434('0x33')](_0x36a821['query'][_0x8434('0x33')]);_0x215afd['where']=qs[_0x8434('0x2d')](_[_0x8434('0x34')](_0x36a821['query'],_0x4970f1[_0x8434('0x2d')]));if(_0x36a821[_0x8434('0x2c')][_0x8434('0x35')]){_0x215afd[_0x8434('0x36')]=_['merge'](_0x215afd['where'],{'$or':_[_0x8434('0x37')](_0x454599,function(_0x214107){if(_0x214107[_0x8434('0x38')][_0x8434('0x39')]!==_0x8434('0x3a')){var _0x39e499={};_0x39e499[_0x214107[_0x8434('0x3b')]]={'$like':'%'+_0x36a821[_0x8434('0x2c')][_0x8434('0x35')]+'%'};return _0x39e499;}})});}_0x215afd=_['merge']({},_0x215afd,_0x36a821[_0x8434('0x3c')]);var _0x2c21e9={'where':_0x215afd[_0x8434('0x36')]};return db[_0x8434('0x3d')][_0x8434('0x1c')](_0x2c21e9)[_0x8434('0x3e')](function(_0x144d2f){_0x3f9ab9['count']=_0x144d2f;if(_0x36a821['query'][_0x8434('0x3f')]){_0x215afd[_0x8434('0x40')]=[{'all':!![]}];}return db[_0x8434('0x3d')][_0x8434('0x41')](_0x215afd);})['then'](function(_0xa4eaab){_0x3f9ab9[_0x8434('0x42')]=_0xa4eaab;return _0x3f9ab9;})[_0x8434('0x3e')](respondWithFilteredResult(_0x1d810f,_0x215afd))['catch'](handleError(_0x1d810f,null));};exports[_0x8434('0x43')]=function(_0x413641,_0x1ad6a2){var _0x89da95={'raw':![],'where':{'id':_0x413641[_0x8434('0x44')]['id']}},_0x2391cd={};_0x2391cd[_0x8434('0x2a')]=_[_0x8434('0x2b')](db[_0x8434('0x3d')][_0x8434('0x29')]);_0x2391cd[_0x8434('0x2c')]=_[_0x8434('0x2b')](_0x413641[_0x8434('0x2c')]);_0x2391cd['filters']=_['intersection'](_0x2391cd[_0x8434('0x2a')],_0x2391cd['query']);_0x89da95[_0x8434('0x2f')]=_['intersection'](_0x2391cd[_0x8434('0x2a')],qs['fields'](_0x413641[_0x8434('0x2c')][_0x8434('0x30')]));_0x89da95[_0x8434('0x2f')]=_0x89da95[_0x8434('0x2f')][_0x8434('0x45')]?_0x89da95[_0x8434('0x2f')]:_0x2391cd[_0x8434('0x2a')];if(_0x413641[_0x8434('0x2c')]['includeAll']){_0x89da95['include']=[{'all':!![]}];}_0x89da95=_['merge']({},_0x89da95,_0x413641['options']);return db['SAInvoiceDetail']['find'](_0x89da95)[_0x8434('0x3e')](handleEntityNotFound(_0x1ad6a2,null))[_0x8434('0x3e')](respondWithResult(_0x1ad6a2,null))[_0x8434('0x46')](handleError(_0x1ad6a2,null));};exports[_0x8434('0x47')]=function(_0x1f856e,_0x7ceec8){return db['SAInvoiceDetail'][_0x8434('0x47')](_0x1f856e[_0x8434('0x48')],{})[_0x8434('0x3e')](respondWithResult(_0x7ceec8,0xc9))[_0x8434('0x46')](handleError(_0x7ceec8,null));};exports[_0x8434('0x24')]=function(_0x955997,_0x3a0da3){if(_0x955997[_0x8434('0x48')]['id']){delete _0x955997[_0x8434('0x48')]['id'];}return db[_0x8434('0x3d')]['find']({'where':{'id':_0x955997[_0x8434('0x44')]['id']}})[_0x8434('0x3e')](handleEntityNotFound(_0x3a0da3,null))['then'](saveUpdates(_0x955997[_0x8434('0x48')],null))[_0x8434('0x3e')](respondWithResult(_0x3a0da3,null))[_0x8434('0x46')](handleError(_0x3a0da3,null));};exports[_0x8434('0x25')]=function(_0x2a3b16,_0x5dcd80){return db[_0x8434('0x3d')]['find']({'where':{'id':_0x2a3b16[_0x8434('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dcd80,null))['then'](removeEntity(_0x5dcd80,null))[_0x8434('0x46')](handleError(_0x5dcd80,null));};exports[_0x8434('0x49')]=function(_0xf7e7be,_0x18054a){return db['SAInvoiceDetail'][_0x8434('0x49')]()[_0x8434('0x3e')](respondWithResult(_0x18054a,null))[_0x8434('0x46')](handleError(_0x18054a,null));}; \ No newline at end of file +var _0x6af2=['rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','VIRTUAL','field','merge','options','includeAll','SAInvoiceDetail','findAll','rows','catch','show','params','include','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x6af2,0x1b1));var _0x26af=function(_0x354a22,_0x3ebd32){_0x354a22=_0x354a22-0x0;var _0x86196a=_0x6af2[_0x354a22];return _0x86196a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26af('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26af('0x1'));var moment=require(_0x26af('0x2'));var BPromise=require(_0x26af('0x3'));var Mustache=require(_0x26af('0x4'));var util=require(_0x26af('0x5'));var path=require(_0x26af('0x6'));var sox=require(_0x26af('0x7'));var csv=require(_0x26af('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x26af('0x9'));var squel=require(_0x26af('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26af('0xb'));var toCsv=require(_0x26af('0x8'));var querystring=require(_0x26af('0xc'));var Papa=require(_0x26af('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26af('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26af('0xf'))(_0x26af('0x10'));var utils=require('../../config/utils');var config=require(_0x26af('0x11'));var db=require(_0x26af('0x12'))['db'];function respondWithStatusCode(_0xec9497,_0x581f53){_0x581f53=_0x581f53||0xcc;return function(_0x1035f0){if(_0x1035f0){return _0xec9497[_0x26af('0x13')](_0x581f53);}return _0xec9497[_0x26af('0x14')](_0x581f53)[_0x26af('0x15')]();};}function respondWithResult(_0xf5ff76,_0x3d9552){_0x3d9552=_0x3d9552||0xc8;return function(_0x21559e){if(_0x21559e){return _0xf5ff76[_0x26af('0x14')](_0x3d9552)[_0x26af('0x16')](_0x21559e);}};}function respondWithFilteredResult(_0x31072d,_0x502998){return function(_0x6f4c5e){if(_0x6f4c5e){var _0x3c5581=_0x6f4c5e[_0x26af('0x17')],_0x2aaadb=_0x502998['offset'],_0x3d9880=_0x502998['offset']+_0x502998[_0x26af('0x18')],_0x5aa649;if(_0x3d9880>=_0x3c5581){_0x3d9880=_0x3c5581;_0x5aa649=0xc8;}else{_0x5aa649=0xce;}_0x31072d['status'](_0x5aa649);return _0x31072d[_0x26af('0x19')](_0x26af('0x1a'),_0x2aaadb+'-'+_0x3d9880+'/'+_0x3c5581)[_0x26af('0x16')](_0x6f4c5e);}return null;};}function patchUpdates(_0x269853){return function(_0x3b9096){try{jsonpatch[_0x26af('0x1b')](_0x3b9096,_0x269853,!![]);}catch(_0x1d60a0){return BPromise[_0x26af('0x1c')](_0x1d60a0);}return _0x3b9096[_0x26af('0x1d')]();};}function saveUpdates(_0x6c046c,_0x3b19ca){return function(_0xe4d894){if(_0xe4d894){return _0xe4d894[_0x26af('0x1e')](_0x6c046c)[_0x26af('0x1f')](function(_0x28ba19){return _0x28ba19;});}return null;};}function removeEntity(_0x18fba1,_0x107197){return function(_0x33b914){if(_0x33b914){return _0x33b914[_0x26af('0x20')]()['then'](function(){_0x18fba1[_0x26af('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f48b5,_0xe687d0){return function(_0x52439a){if(!_0x52439a){_0x1f48b5[_0x26af('0x13')](0x194);}return _0x52439a;};}function handleError(_0x205818,_0x27fa03){_0x27fa03=_0x27fa03||0x1f4;return function(_0x1544f3){logger[_0x26af('0x21')](_0x1544f3['stack']);if(_0x1544f3[_0x26af('0x22')]){delete _0x1544f3[_0x26af('0x22')];}_0x205818['status'](_0x27fa03)[_0x26af('0x23')](_0x1544f3);};}exports['index']=function(_0x60da6c,_0x6fed17){var _0x52679c={},_0x369bf8={},_0x40e8ce={'count':0x0,'rows':[]};var _0x10273a=db['SAInvoiceDetail'][_0x26af('0x24')];_0x369bf8['model']=_[_0x26af('0x25')](_0x10273a);_0x369bf8[_0x26af('0x26')]=_[_0x26af('0x25')](_0x60da6c['query']);_0x369bf8[_0x26af('0x27')]=_[_0x26af('0x28')](_0x369bf8[_0x26af('0x29')],_0x369bf8['query']);_0x52679c[_0x26af('0x2a')]=_['intersection'](_0x369bf8['model'],qs[_0x26af('0x2b')](_0x60da6c[_0x26af('0x26')]['fields']));_0x52679c[_0x26af('0x2a')]=_0x52679c[_0x26af('0x2a')][_0x26af('0x2c')]?_0x52679c['attributes']:_0x369bf8[_0x26af('0x29')];if(!_0x60da6c[_0x26af('0x26')][_0x26af('0x2d')]('nolimit')){_0x52679c[_0x26af('0x18')]=qs[_0x26af('0x18')](_0x60da6c[_0x26af('0x26')][_0x26af('0x18')]);_0x52679c['offset']=qs[_0x26af('0x2e')](_0x60da6c[_0x26af('0x26')]['offset']);}_0x52679c['order']=qs[_0x26af('0x2f')](_0x60da6c[_0x26af('0x26')][_0x26af('0x2f')]);_0x52679c['where']=qs[_0x26af('0x27')](_[_0x26af('0x30')](_0x60da6c[_0x26af('0x26')],_0x369bf8[_0x26af('0x27')]));if(_0x60da6c[_0x26af('0x26')][_0x26af('0x31')]){_0x52679c['where']=_['merge'](_0x52679c[_0x26af('0x32')],{'$or':_['map'](_0x10273a,function(_0x9c29c3){if(_0x9c29c3['type']['key']!==_0x26af('0x33')){var _0x368d77={};_0x368d77[_0x9c29c3[_0x26af('0x34')]]={'$like':'%'+_0x60da6c[_0x26af('0x26')][_0x26af('0x31')]+'%'};return _0x368d77;}})});}_0x52679c=_[_0x26af('0x35')]({},_0x52679c,_0x60da6c[_0x26af('0x36')]);var _0x442bf4={'where':_0x52679c[_0x26af('0x32')]};return db['SAInvoiceDetail'][_0x26af('0x17')](_0x442bf4)['then'](function(_0xfe6247){_0x40e8ce[_0x26af('0x17')]=_0xfe6247;if(_0x60da6c[_0x26af('0x26')][_0x26af('0x37')]){_0x52679c['include']=[{'all':!![]}];}return db[_0x26af('0x38')][_0x26af('0x39')](_0x52679c);})['then'](function(_0xe5473a){_0x40e8ce[_0x26af('0x3a')]=_0xe5473a;return _0x40e8ce;})[_0x26af('0x1f')](respondWithFilteredResult(_0x6fed17,_0x52679c))[_0x26af('0x3b')](handleError(_0x6fed17,null));};exports[_0x26af('0x3c')]=function(_0x9e76dc,_0x53ae63){var _0x53c669={'raw':![],'where':{'id':_0x9e76dc[_0x26af('0x3d')]['id']}},_0x4d9ad9={};_0x4d9ad9['model']=_[_0x26af('0x25')](db[_0x26af('0x38')][_0x26af('0x24')]);_0x4d9ad9['query']=_[_0x26af('0x25')](_0x9e76dc[_0x26af('0x26')]);_0x4d9ad9[_0x26af('0x27')]=_[_0x26af('0x28')](_0x4d9ad9['model'],_0x4d9ad9[_0x26af('0x26')]);_0x53c669['attributes']=_[_0x26af('0x28')](_0x4d9ad9['model'],qs[_0x26af('0x2b')](_0x9e76dc[_0x26af('0x26')][_0x26af('0x2b')]));_0x53c669['attributes']=_0x53c669[_0x26af('0x2a')][_0x26af('0x2c')]?_0x53c669[_0x26af('0x2a')]:_0x4d9ad9['model'];if(_0x9e76dc['query'][_0x26af('0x37')]){_0x53c669[_0x26af('0x3e')]=[{'all':!![]}];}_0x53c669=_[_0x26af('0x35')]({},_0x53c669,_0x9e76dc[_0x26af('0x36')]);return db['SAInvoiceDetail'][_0x26af('0x3f')](_0x53c669)['then'](handleEntityNotFound(_0x53ae63,null))[_0x26af('0x1f')](respondWithResult(_0x53ae63,null))[_0x26af('0x3b')](handleError(_0x53ae63,null));};exports[_0x26af('0x40')]=function(_0x1f5a69,_0x13c21a){return db[_0x26af('0x38')][_0x26af('0x40')](_0x1f5a69[_0x26af('0x41')],{})['then'](respondWithResult(_0x13c21a,0xc9))[_0x26af('0x3b')](handleError(_0x13c21a,null));};exports[_0x26af('0x1e')]=function(_0x5926bb,_0x571eb8){if(_0x5926bb[_0x26af('0x41')]['id']){delete _0x5926bb[_0x26af('0x41')]['id'];}return db[_0x26af('0x38')][_0x26af('0x3f')]({'where':{'id':_0x5926bb[_0x26af('0x3d')]['id']}})[_0x26af('0x1f')](handleEntityNotFound(_0x571eb8,null))[_0x26af('0x1f')](saveUpdates(_0x5926bb['body'],null))['then'](respondWithResult(_0x571eb8,null))['catch'](handleError(_0x571eb8,null));};exports[_0x26af('0x20')]=function(_0x5e5702,_0x45d362){return db[_0x26af('0x38')][_0x26af('0x3f')]({'where':{'id':_0x5e5702[_0x26af('0x3d')]['id']}})['then'](handleEntityNotFound(_0x45d362,null))[_0x26af('0x1f')](removeEntity(_0x45d362,null))['catch'](handleError(_0x45d362,null));};exports['describe']=function(_0x6eb052,_0x4519de){return db[_0x26af('0x38')][_0x26af('0x42')]()['then'](respondWithResult(_0x4519de,null))[_0x26af('0x3b')](handleError(_0x4519de,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.model.js b/server/api/saInvoiceDetail/saInvoiceDetail.model.js index 6a0d0c0..a6a033f 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.model.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee1=['SAInvoiceDetail','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x1b3978,_0x5bedcd){var _0x4ac9e9=function(_0x34d551){while(--_0x34d551){_0x1b3978['push'](_0x1b3978['shift']());}};_0x4ac9e9(++_0x5bedcd);}(_0x7ee1,0xab));var _0x17ee=function(_0x4306ee,_0x1e4122){_0x4306ee=_0x4306ee-0x0;var _0x44b327=_0x7ee1[_0x4306ee];return _0x44b327;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require(_0x17ee('0x1'))(_0x17ee('0x2'));var moment=require(_0x17ee('0x3'));var BPromise=require(_0x17ee('0x4'));var rp=require(_0x17ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x6'));var config=require('../../config/environment');var attributes=require('./saInvoiceDetail.attributes');module[_0x17ee('0x7')]=function(_0x2e4db0,_0x2efefb){return _0x2e4db0[_0x17ee('0x8')](_0x17ee('0x9'),attributes,{'tableName':'sa_invoice_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x795a=['lodash','util','api','moment','request-promise','path','rimraf','./saInvoiceDetail.attributes','exports','define','sa_invoice_details'];(function(_0x543f9f,_0xe0ebf0){var _0x4dd488=function(_0xc8ff4d){while(--_0xc8ff4d){_0x543f9f['push'](_0x543f9f['shift']());}};_0x4dd488(++_0xe0ebf0);}(_0x795a,0x79));var _0xa795=function(_0x24fac1,_0x2cf459){_0x24fac1=_0x24fac1-0x0;var _0x3df9d7=_0x795a[_0x24fac1];return _0x3df9d7;};'use strict';var _=require(_0xa795('0x0'));var util=require(_0xa795('0x1'));var logger=require('../../config/logger')(_0xa795('0x2'));var moment=require(_0xa795('0x3'));var BPromise=require('bluebird');var rp=require(_0xa795('0x4'));var fs=require('fs');var path=require(_0xa795('0x5'));var rimraf=require(_0xa795('0x6'));var config=require('../../config/environment');var attributes=require(_0xa795('0x7'));module[_0xa795('0x8')]=function(_0x53c75f,_0x243b17){return _0x53c75f[_0xa795('0x9')]('SAInvoiceDetail',attributes,{'tableName':_0xa795('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js b/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js index 4d66632..f234ab1 100644 --- a/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js +++ b/server/api/saInvoiceDetail/saInvoiceDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa708=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','SAInvoiceDetail,\x20%s,\x20%s','debug','SAInvoiceDetail,\x20%s,\x20%s,\x20%s','code','error','message','result','catch'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa708,0x7e));var _0x8a70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa708[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a70('0x0'));var util=require(_0x8a70('0x1'));var moment=require(_0x8a70('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a70('0x3'));var fs=require('fs');var Redis=require(_0x8a70('0x4'));var db=require(_0x8a70('0x5'))['db'];var utils=require(_0x8a70('0x6'));var logger=require('../../config/logger')(_0x8a70('0x7'));var config=require(_0x8a70('0x8'));var jayson=require(_0x8a70('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x230653,_0x1e7771,_0x4a57eb){return new BPromise(function(_0x1d4896,_0x4eff08){return client[_0x8a70('0xa')](_0x230653,_0x4a57eb)[_0x8a70('0xb')](function(_0x1eb171){logger[_0x8a70('0xc')](_0x8a70('0xd'),_0x1e7771,'request\x20sent');logger[_0x8a70('0xe')](_0x8a70('0xf'),_0x1e7771,'request\x20sent',JSON['stringify'](_0x1eb171));if(_0x1eb171['error']){if(_0x1eb171['error'][_0x8a70('0x10')]===0x1f4){logger['error']('SAInvoiceDetail,\x20%s,\x20%s',_0x1e7771,_0x1eb171[_0x8a70('0x11')][_0x8a70('0x12')]);return _0x4eff08(_0x1eb171[_0x8a70('0x11')]['message']);}logger[_0x8a70('0x11')](_0x8a70('0xd'),_0x1e7771,_0x1eb171[_0x8a70('0x11')][_0x8a70('0x12')]);return _0x1d4896(_0x1eb171[_0x8a70('0x11')][_0x8a70('0x12')]);}else{logger[_0x8a70('0xc')](_0x8a70('0xd'),_0x1e7771,'request\x20sent');_0x1d4896(_0x1eb171[_0x8a70('0x13')][_0x8a70('0x12')]);}})[_0x8a70('0x14')](function(_0x2ce708){logger[_0x8a70('0x11')](_0x8a70('0xd'),_0x1e7771,_0x2ce708);_0x4eff08(_0x2ce708);});});} \ No newline at end of file +var _0x424e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','SAInvoiceDetail,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4e402d,_0x2bd9f1){var _0x7a2680=function(_0x458b67){while(--_0x458b67){_0x4e402d['push'](_0x4e402d['shift']());}};_0x7a2680(++_0x2bd9f1);}(_0x424e,0xb3));var _0xe424=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x424e[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xe424('0x0'));var util=require(_0xe424('0x1'));var moment=require(_0xe424('0x2'));var BPromise=require(_0xe424('0x3'));var rs=require(_0xe424('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe424('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe424('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe424('0x7'));var client=jayson[_0xe424('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b706b,_0x18762d,_0x4a6867){return new BPromise(function(_0x4e1333,_0x57231e){return client[_0xe424('0x9')](_0x1b706b,_0x4a6867)[_0xe424('0xa')](function(_0x2aa412){logger[_0xe424('0xb')]('SAInvoiceDetail,\x20%s,\x20%s',_0x18762d,_0xe424('0xc'));logger[_0xe424('0xd')]('SAInvoiceDetail,\x20%s,\x20%s,\x20%s',_0x18762d,_0xe424('0xc'),JSON['stringify'](_0x2aa412));if(_0x2aa412[_0xe424('0xe')]){if(_0x2aa412[_0xe424('0xe')][_0xe424('0xf')]===0x1f4){logger['error']('SAInvoiceDetail,\x20%s,\x20%s',_0x18762d,_0x2aa412[_0xe424('0xe')]['message']);return _0x57231e(_0x2aa412['error']['message']);}logger['error'](_0xe424('0x10'),_0x18762d,_0x2aa412[_0xe424('0xe')][_0xe424('0x11')]);return _0x4e1333(_0x2aa412[_0xe424('0xe')]['message']);}else{logger['info'](_0xe424('0x10'),_0x18762d,_0xe424('0xc'));_0x4e1333(_0x2aa412[_0xe424('0x12')]['message']);}})[_0xe424('0x13')](function(_0x5db7d4){logger[_0xe424('0xe')](_0xe424('0x10'),_0x18762d,_0x5db7d4);_0x57231e(_0x5db7d4);});});} \ No newline at end of file diff --git a/server/api/saInvoiceLaw/index.js b/server/api/saInvoiceLaw/index.js index bdd9084..dea003e 100644 --- a/server/api/saInvoiceLaw/index.js +++ b/server/api/saInvoiceLaw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95d5=['Router','../../config/environment','./saInvoiceLaw.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','path','express'];(function(_0x492a0e,_0x404684){var _0x315ed9=function(_0x1b7903){while(--_0x1b7903){_0x492a0e['push'](_0x492a0e['shift']());}};_0x315ed9(++_0x404684);}(_0x95d5,0x15e));var _0x595d=function(_0xbc86fc,_0x1bb24d){_0xbc86fc=_0xbc86fc-0x0;var _0x549976=_0x95d5[_0xbc86fc];return _0x549976;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x595d('0x0'));var timeout=require('connect-timeout');var express=require(_0x595d('0x1'));var router=express[_0x595d('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x595d('0x3'));var controller=require(_0x595d('0x4'));router[_0x595d('0x5')]('/',auth[_0x595d('0x6')](),controller['index']);router[_0x595d('0x5')](_0x595d('0x7'),auth[_0x595d('0x6')](),controller[_0x595d('0x8')]);router[_0x595d('0x5')](_0x595d('0x9'),auth[_0x595d('0x6')](),controller[_0x595d('0xa')]);router[_0x595d('0xb')]('/',auth[_0x595d('0x6')](),controller[_0x595d('0xc')]);router['put'](_0x595d('0x9'),auth['isAuthenticated'](),controller[_0x595d('0xd')]);router[_0x595d('0xe')]('/:id',auth[_0x595d('0x6')](),controller['destroy']);module[_0x595d('0xf')]=router; \ No newline at end of file +var _0x6b62=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete'];(function(_0x271ebd,_0x1c24ac){var _0x313e1d=function(_0x2ae8ac){while(--_0x2ae8ac){_0x271ebd['push'](_0x271ebd['shift']());}};_0x313e1d(++_0x1c24ac);}(_0x6b62,0x11a));var _0x26b6=function(_0x9f10df,_0x3531fd){_0x9f10df=_0x9f10df-0x0;var _0xd70a6=_0x6b62[_0x9f10df];return _0xd70a6;};'use strict';var multer=require(_0x26b6('0x0'));var util=require(_0x26b6('0x1'));var path=require(_0x26b6('0x2'));var timeout=require(_0x26b6('0x3'));var express=require(_0x26b6('0x4'));var router=express[_0x26b6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x26b6('0x6'));var config=require(_0x26b6('0x7'));var controller=require('./saInvoiceLaw.controller');router[_0x26b6('0x8')]('/',auth[_0x26b6('0x9')](),controller[_0x26b6('0xa')]);router[_0x26b6('0x8')](_0x26b6('0xb'),auth[_0x26b6('0x9')](),controller[_0x26b6('0xc')]);router[_0x26b6('0x8')](_0x26b6('0xd'),auth[_0x26b6('0x9')](),controller[_0x26b6('0xe')]);router[_0x26b6('0xf')]('/',auth[_0x26b6('0x9')](),controller['create']);router['put']('/:id',auth[_0x26b6('0x9')](),controller[_0x26b6('0x10')]);router[_0x26b6('0x11')](_0x26b6('0xd'),auth[_0x26b6('0x9')](),controller[_0x26b6('0x12')]);module[_0x26b6('0x13')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js b/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js index a36d54b..a410307 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb489=['name','sequelize','exports','STRING'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0xb489,0x95));var _0x9b48=function(_0x2f0fb1,_0x291a87){_0x2f0fb1=_0x2f0fb1-0x0;var _0x404a09=_0xb489[_0x2f0fb1];return _0x404a09;};'use strict';var Sequelize=require(_0x9b48('0x0'));module[_0x9b48('0x1')]={'name':{'type':Sequelize[_0x9b48('0x2')],'allowNull':![],'unique':_0x9b48('0x3')}}; \ No newline at end of file +var _0xe169=['sequelize','exports','STRING','name'];(function(_0x11503f,_0x30de86){var _0x34caab=function(_0x16e6a6){while(--_0x16e6a6){_0x11503f['push'](_0x11503f['shift']());}};_0x34caab(++_0x30de86);}(_0xe169,0x1ac));var _0x9e16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe169[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9e16('0x0'));module[_0x9e16('0x1')]={'name':{'type':Sequelize[_0x9e16('0x2')],'allowNull':![],'unique':_0x9e16('0x3')}}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.controller.js b/server/api/saInvoiceLaw/saInvoiceLaw.controller.js index 06f9653..8acaea1 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.controller.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x356e=['reject','save','update','destroy','then','end','error','stack','name','send','index','SAInvoiceLaw','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','field','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','status','json','count','offset','limit','set','apply'];(function(_0x573ded,_0x227028){var _0x1dbb15=function(_0x2f6cb8){while(--_0x2f6cb8){_0x573ded['push'](_0x573ded['shift']());}};_0x1dbb15(++_0x227028);}(_0x356e,0x1dc));var _0xe356=function(_0x1bcf5b,_0xd5637f){_0x1bcf5b=_0x1bcf5b-0x0;var _0x352544=_0x356e[_0x1bcf5b];return _0x352544;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe356('0x0'));var zipdir=require(_0xe356('0x1'));var jsonpatch=require(_0xe356('0x2'));var rp=require(_0xe356('0x3'));var moment=require(_0xe356('0x4'));var BPromise=require(_0xe356('0x5'));var Mustache=require('mustache');var util=require(_0xe356('0x6'));var path=require(_0xe356('0x7'));var sox=require(_0xe356('0x8'));var csv=require(_0xe356('0x9'));var ejs=require(_0xe356('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe356('0xb'));var crypto=require(_0xe356('0xc'));var jsforce=require(_0xe356('0xd'));var deskjs=require(_0xe356('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe356('0xf'));var Papa=require(_0xe356('0x10'));var Redis=require('ioredis');var authService=require(_0xe356('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe356('0x12'));var logger=require(_0xe356('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe356('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ab1d,_0x25de51){_0x25de51=_0x25de51||0xcc;return function(_0x5a6f54){if(_0x5a6f54){return _0x49ab1d['sendStatus'](_0x25de51);}return _0x49ab1d[_0xe356('0x15')](_0x25de51)['end']();};}function respondWithResult(_0x4ee14e,_0x5e40df){_0x5e40df=_0x5e40df||0xc8;return function(_0x582c8e){if(_0x582c8e){return _0x4ee14e[_0xe356('0x15')](_0x5e40df)[_0xe356('0x16')](_0x582c8e);}};}function respondWithFilteredResult(_0x489a5b,_0x2b3208){return function(_0x319243){if(_0x319243){var _0x1aa9b3=_0x319243[_0xe356('0x17')],_0x934016=_0x2b3208[_0xe356('0x18')],_0x56e289=_0x2b3208[_0xe356('0x18')]+_0x2b3208[_0xe356('0x19')],_0x461976;if(_0x56e289>=_0x1aa9b3){_0x56e289=_0x1aa9b3;_0x461976=0xc8;}else{_0x461976=0xce;}_0x489a5b[_0xe356('0x15')](_0x461976);return _0x489a5b[_0xe356('0x1a')]('Content-Range',_0x934016+'-'+_0x56e289+'/'+_0x1aa9b3)['json'](_0x319243);}return null;};}function patchUpdates(_0x444880){return function(_0x2d1935){try{jsonpatch[_0xe356('0x1b')](_0x2d1935,_0x444880,!![]);}catch(_0x32f4e1){return BPromise[_0xe356('0x1c')](_0x32f4e1);}return _0x2d1935[_0xe356('0x1d')]();};}function saveUpdates(_0x1635d6,_0x3607d0){return function(_0x128976){if(_0x128976){return _0x128976[_0xe356('0x1e')](_0x1635d6)['then'](function(_0x17c17b){return _0x17c17b;});}return null;};}function removeEntity(_0xa086a9,_0x169439){return function(_0x3f08f1){if(_0x3f08f1){return _0x3f08f1[_0xe356('0x1f')]()[_0xe356('0x20')](function(){_0xa086a9[_0xe356('0x15')](0xcc)[_0xe356('0x21')]();});}};}function handleEntityNotFound(_0x3f2c47,_0xd444b6){return function(_0x178336){if(!_0x178336){_0x3f2c47['sendStatus'](0x194);}return _0x178336;};}function handleError(_0x12dce5,_0x2d9f9a){_0x2d9f9a=_0x2d9f9a||0x1f4;return function(_0x4cf853){logger[_0xe356('0x22')](_0x4cf853[_0xe356('0x23')]);if(_0x4cf853[_0xe356('0x24')]){delete _0x4cf853['name'];}_0x12dce5['status'](_0x2d9f9a)[_0xe356('0x25')](_0x4cf853);};}exports[_0xe356('0x26')]=function(_0x345775,_0x1aaa5c){var _0x5b32e0={},_0x1e1cef={},_0x5ab65f={'count':0x0,'rows':[]};var _0x4b9fdd=db[_0xe356('0x27')]['rawAttributes'];_0x1e1cef['model']=_['keys'](_0x4b9fdd);_0x1e1cef[_0xe356('0x28')]=_['keys'](_0x345775[_0xe356('0x28')]);_0x1e1cef[_0xe356('0x29')]=_[_0xe356('0x2a')](_0x1e1cef[_0xe356('0x2b')],_0x1e1cef[_0xe356('0x28')]);_0x5b32e0['attributes']=_[_0xe356('0x2a')](_0x1e1cef[_0xe356('0x2b')],qs[_0xe356('0x2c')](_0x345775[_0xe356('0x28')][_0xe356('0x2c')]));_0x5b32e0[_0xe356('0x2d')]=_0x5b32e0['attributes'][_0xe356('0x2e')]?_0x5b32e0[_0xe356('0x2d')]:_0x1e1cef[_0xe356('0x2b')];if(!_0x345775['query'][_0xe356('0x2f')](_0xe356('0x30'))){_0x5b32e0[_0xe356('0x19')]=qs[_0xe356('0x19')](_0x345775[_0xe356('0x28')][_0xe356('0x19')]);_0x5b32e0['offset']=qs[_0xe356('0x18')](_0x345775['query'][_0xe356('0x18')]);}_0x5b32e0[_0xe356('0x31')]=qs[_0xe356('0x32')](_0x345775[_0xe356('0x28')][_0xe356('0x32')]);_0x5b32e0[_0xe356('0x33')]=qs['filters'](_[_0xe356('0x34')](_0x345775['query'],_0x1e1cef[_0xe356('0x29')]));if(_0x345775['query']['filter']){_0x5b32e0[_0xe356('0x33')]=_[_0xe356('0x35')](_0x5b32e0['where'],{'$or':_[_0xe356('0x36')](_0x4b9fdd,function(_0x2b30ce){if(_0x2b30ce[_0xe356('0x37')][_0xe356('0x38')]!=='VIRTUAL'){var _0x2b65cc={};_0x2b65cc[_0x2b30ce[_0xe356('0x39')]]={'$like':'%'+_0x345775[_0xe356('0x28')]['filter']+'%'};return _0x2b65cc;}})});}_0x5b32e0=_[_0xe356('0x35')]({},_0x5b32e0,_0x345775['options']);var _0x707050={'where':_0x5b32e0[_0xe356('0x33')]};return db[_0xe356('0x27')]['count'](_0x707050)[_0xe356('0x20')](function(_0x5da513){_0x5ab65f[_0xe356('0x17')]=_0x5da513;if(_0x345775[_0xe356('0x28')][_0xe356('0x3a')]){_0x5b32e0['include']=[{'all':!![]}];}return db[_0xe356('0x27')][_0xe356('0x3b')](_0x5b32e0);})['then'](function(_0x5356ce){_0x5ab65f[_0xe356('0x3c')]=_0x5356ce;return _0x5ab65f;})[_0xe356('0x20')](respondWithFilteredResult(_0x1aaa5c,_0x5b32e0))[_0xe356('0x3d')](handleError(_0x1aaa5c,null));};exports[_0xe356('0x3e')]=function(_0xa9dfc,_0x31ceb5){var _0x1bddaf={'raw':![],'where':{'id':_0xa9dfc[_0xe356('0x3f')]['id']}},_0x1254c6={};_0x1254c6[_0xe356('0x2b')]=_[_0xe356('0x40')](db['SAInvoiceLaw'][_0xe356('0x41')]);_0x1254c6['query']=_[_0xe356('0x40')](_0xa9dfc['query']);_0x1254c6[_0xe356('0x29')]=_[_0xe356('0x2a')](_0x1254c6[_0xe356('0x2b')],_0x1254c6[_0xe356('0x28')]);_0x1bddaf['attributes']=_[_0xe356('0x2a')](_0x1254c6['model'],qs[_0xe356('0x2c')](_0xa9dfc[_0xe356('0x28')][_0xe356('0x2c')]));_0x1bddaf[_0xe356('0x2d')]=_0x1bddaf[_0xe356('0x2d')][_0xe356('0x2e')]?_0x1bddaf[_0xe356('0x2d')]:_0x1254c6[_0xe356('0x2b')];if(_0xa9dfc[_0xe356('0x28')]['includeAll']){_0x1bddaf[_0xe356('0x42')]=[{'all':!![]}];}_0x1bddaf=_['merge']({},_0x1bddaf,_0xa9dfc[_0xe356('0x43')]);return db[_0xe356('0x27')]['find'](_0x1bddaf)[_0xe356('0x20')](handleEntityNotFound(_0x31ceb5,null))[_0xe356('0x20')](respondWithResult(_0x31ceb5,null))[_0xe356('0x3d')](handleError(_0x31ceb5,null));};exports[_0xe356('0x44')]=function(_0xe48326,_0x404afc){return db[_0xe356('0x27')][_0xe356('0x44')](_0xe48326['body'],{})['then'](respondWithResult(_0x404afc,0xc9))[_0xe356('0x3d')](handleError(_0x404afc,null));};exports['update']=function(_0x15d680,_0x1bfeea){if(_0x15d680[_0xe356('0x45')]['id']){delete _0x15d680[_0xe356('0x45')]['id'];}return db[_0xe356('0x27')]['find']({'where':{'id':_0x15d680['params']['id']}})[_0xe356('0x20')](handleEntityNotFound(_0x1bfeea,null))[_0xe356('0x20')](saveUpdates(_0x15d680['body'],null))[_0xe356('0x20')](respondWithResult(_0x1bfeea,null))[_0xe356('0x3d')](handleError(_0x1bfeea,null));};exports[_0xe356('0x1f')]=function(_0x169e7a,_0x18df06){return db['SAInvoiceLaw'][_0xe356('0x46')]({'where':{'id':_0x169e7a[_0xe356('0x3f')]['id']}})[_0xe356('0x20')](handleEntityNotFound(_0x18df06,null))['then'](removeEntity(_0x18df06,null))[_0xe356('0x3d')](handleError(_0x18df06,null));};exports[_0xe356('0x47')]=function(_0x2a3206,_0x105339){return db['SAInvoiceLaw'][_0xe356('0x47')]()[_0xe356('0x20')](respondWithResult(_0x105339,null))[_0xe356('0x3d')](handleError(_0x105339,null));}; \ No newline at end of file +var _0xe7e4=['rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','SAInvoiceLaw','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','save','then','destroy','error','stack','name','send','index'];(function(_0x49c495,_0x4da688){var _0x1f5889=function(_0x49f98c){while(--_0x49f98c){_0x49c495['push'](_0x49c495['shift']());}};_0x1f5889(++_0x4da688);}(_0xe7e4,0x1be));var _0x4e7e=function(_0x591f7f,_0x10ba46){_0x591f7f=_0x591f7f-0x0;var _0x3fc893=_0xe7e4[_0x591f7f];return _0x3fc893;};'use strict';var pdf=require(_0x4e7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4e7e('0x1'));var zipdir=require(_0x4e7e('0x2'));var jsonpatch=require(_0x4e7e('0x3'));var rp=require('request-promise');var moment=require(_0x4e7e('0x4'));var BPromise=require(_0x4e7e('0x5'));var Mustache=require(_0x4e7e('0x6'));var util=require('util');var path=require(_0x4e7e('0x7'));var sox=require(_0x4e7e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4e7e('0x9'));var squel=require(_0x4e7e('0xa'));var crypto=require('crypto');var jsforce=require(_0x4e7e('0xb'));var deskjs=require(_0x4e7e('0xc'));var toCsv=require(_0x4e7e('0xd'));var querystring=require(_0x4e7e('0xe'));var Papa=require('papaparse');var Redis=require(_0x4e7e('0xf'));var authService=require(_0x4e7e('0x10'));var qs=require(_0x4e7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e7e('0x12'))('api');var utils=require(_0x4e7e('0x13'));var config=require('../../config/environment');var db=require(_0x4e7e('0x14'))['db'];function respondWithStatusCode(_0x17c0a8,_0x327ac6){_0x327ac6=_0x327ac6||0xcc;return function(_0x13b645){if(_0x13b645){return _0x17c0a8[_0x4e7e('0x15')](_0x327ac6);}return _0x17c0a8[_0x4e7e('0x16')](_0x327ac6)[_0x4e7e('0x17')]();};}function respondWithResult(_0x16a0ce,_0x5e5bba){_0x5e5bba=_0x5e5bba||0xc8;return function(_0x415bda){if(_0x415bda){return _0x16a0ce[_0x4e7e('0x16')](_0x5e5bba)[_0x4e7e('0x18')](_0x415bda);}};}function respondWithFilteredResult(_0x3c3136,_0x31c2f8){return function(_0x460c87){if(_0x460c87){var _0x275363=_0x460c87[_0x4e7e('0x19')],_0x172e00=_0x31c2f8[_0x4e7e('0x1a')],_0xa088ed=_0x31c2f8['offset']+_0x31c2f8['limit'],_0x3b321e;if(_0xa088ed>=_0x275363){_0xa088ed=_0x275363;_0x3b321e=0xc8;}else{_0x3b321e=0xce;}_0x3c3136[_0x4e7e('0x16')](_0x3b321e);return _0x3c3136[_0x4e7e('0x1b')]('Content-Range',_0x172e00+'-'+_0xa088ed+'/'+_0x275363)[_0x4e7e('0x18')](_0x460c87);}return null;};}function patchUpdates(_0x393ddc){return function(_0x1c5888){try{jsonpatch['apply'](_0x1c5888,_0x393ddc,!![]);}catch(_0xc19ea8){return BPromise[_0x4e7e('0x1c')](_0xc19ea8);}return _0x1c5888[_0x4e7e('0x1d')]();};}function saveUpdates(_0x3e9800,_0x56dfd0){return function(_0x5648be){if(_0x5648be){return _0x5648be['update'](_0x3e9800)[_0x4e7e('0x1e')](function(_0x82a4dc){return _0x82a4dc;});}return null;};}function removeEntity(_0x50d225,_0x5678b4){return function(_0x4b7594){if(_0x4b7594){return _0x4b7594[_0x4e7e('0x1f')]()[_0x4e7e('0x1e')](function(){_0x50d225[_0x4e7e('0x16')](0xcc)[_0x4e7e('0x17')]();});}};}function handleEntityNotFound(_0x2eb3eb,_0x305fad){return function(_0x12fc17){if(!_0x12fc17){_0x2eb3eb['sendStatus'](0x194);}return _0x12fc17;};}function handleError(_0x121c84,_0x12abf2){_0x12abf2=_0x12abf2||0x1f4;return function(_0x22319b){logger[_0x4e7e('0x20')](_0x22319b[_0x4e7e('0x21')]);if(_0x22319b[_0x4e7e('0x22')]){delete _0x22319b[_0x4e7e('0x22')];}_0x121c84['status'](_0x12abf2)[_0x4e7e('0x23')](_0x22319b);};}exports[_0x4e7e('0x24')]=function(_0x512d3d,_0x2a690c){var _0x2ea03b={},_0x4867b8={},_0x2d0aa0={'count':0x0,'rows':[]};var _0xf6bf8=db['SAInvoiceLaw'][_0x4e7e('0x25')];_0x4867b8['model']=_['keys'](_0xf6bf8);_0x4867b8['query']=_[_0x4e7e('0x26')](_0x512d3d[_0x4e7e('0x27')]);_0x4867b8['filters']=_['intersection'](_0x4867b8[_0x4e7e('0x28')],_0x4867b8['query']);_0x2ea03b[_0x4e7e('0x29')]=_[_0x4e7e('0x2a')](_0x4867b8[_0x4e7e('0x28')],qs[_0x4e7e('0x2b')](_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x2b')]));_0x2ea03b[_0x4e7e('0x29')]=_0x2ea03b['attributes'][_0x4e7e('0x2c')]?_0x2ea03b[_0x4e7e('0x29')]:_0x4867b8[_0x4e7e('0x28')];if(!_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x2d')](_0x4e7e('0x2e'))){_0x2ea03b[_0x4e7e('0x2f')]=qs[_0x4e7e('0x2f')](_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x2f')]);_0x2ea03b[_0x4e7e('0x1a')]=qs['offset'](_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x1a')]);}_0x2ea03b['order']=qs['sort'](_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x30')]);_0x2ea03b['where']=qs[_0x4e7e('0x31')](_[_0x4e7e('0x32')](_0x512d3d[_0x4e7e('0x27')],_0x4867b8['filters']));if(_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x33')]){_0x2ea03b[_0x4e7e('0x34')]=_[_0x4e7e('0x35')](_0x2ea03b[_0x4e7e('0x34')],{'$or':_[_0x4e7e('0x36')](_0xf6bf8,function(_0x3a32a6){if(_0x3a32a6['type']['key']!==_0x4e7e('0x37')){var _0x1fa227={};_0x1fa227[_0x3a32a6['field']]={'$like':'%'+_0x512d3d['query'][_0x4e7e('0x33')]+'%'};return _0x1fa227;}})});}_0x2ea03b=_[_0x4e7e('0x35')]({},_0x2ea03b,_0x512d3d[_0x4e7e('0x38')]);var _0x25bd08={'where':_0x2ea03b['where']};return db['SAInvoiceLaw'][_0x4e7e('0x19')](_0x25bd08)[_0x4e7e('0x1e')](function(_0x43f91d){_0x2d0aa0[_0x4e7e('0x19')]=_0x43f91d;if(_0x512d3d[_0x4e7e('0x27')][_0x4e7e('0x39')]){_0x2ea03b[_0x4e7e('0x3a')]=[{'all':!![]}];}return db[_0x4e7e('0x3b')][_0x4e7e('0x3c')](_0x2ea03b);})[_0x4e7e('0x1e')](function(_0x193c98){_0x2d0aa0[_0x4e7e('0x3d')]=_0x193c98;return _0x2d0aa0;})[_0x4e7e('0x1e')](respondWithFilteredResult(_0x2a690c,_0x2ea03b))[_0x4e7e('0x3e')](handleError(_0x2a690c,null));};exports[_0x4e7e('0x3f')]=function(_0x27ed24,_0x4ed384){var _0x104e58={'raw':![],'where':{'id':_0x27ed24[_0x4e7e('0x40')]['id']}},_0x18e67d={};_0x18e67d[_0x4e7e('0x28')]=_[_0x4e7e('0x26')](db['SAInvoiceLaw'][_0x4e7e('0x25')]);_0x18e67d[_0x4e7e('0x27')]=_[_0x4e7e('0x26')](_0x27ed24['query']);_0x18e67d[_0x4e7e('0x31')]=_[_0x4e7e('0x2a')](_0x18e67d['model'],_0x18e67d[_0x4e7e('0x27')]);_0x104e58[_0x4e7e('0x29')]=_[_0x4e7e('0x2a')](_0x18e67d['model'],qs[_0x4e7e('0x2b')](_0x27ed24[_0x4e7e('0x27')]['fields']));_0x104e58[_0x4e7e('0x29')]=_0x104e58[_0x4e7e('0x29')][_0x4e7e('0x2c')]?_0x104e58[_0x4e7e('0x29')]:_0x18e67d['model'];if(_0x27ed24[_0x4e7e('0x27')][_0x4e7e('0x39')]){_0x104e58['include']=[{'all':!![]}];}_0x104e58=_['merge']({},_0x104e58,_0x27ed24[_0x4e7e('0x38')]);return db[_0x4e7e('0x3b')][_0x4e7e('0x41')](_0x104e58)[_0x4e7e('0x1e')](handleEntityNotFound(_0x4ed384,null))['then'](respondWithResult(_0x4ed384,null))[_0x4e7e('0x3e')](handleError(_0x4ed384,null));};exports[_0x4e7e('0x42')]=function(_0x529f2a,_0x30ebf7){return db[_0x4e7e('0x3b')][_0x4e7e('0x42')](_0x529f2a['body'],{})[_0x4e7e('0x1e')](respondWithResult(_0x30ebf7,0xc9))['catch'](handleError(_0x30ebf7,null));};exports['update']=function(_0x2bce81,_0x51b560){if(_0x2bce81['body']['id']){delete _0x2bce81[_0x4e7e('0x43')]['id'];}return db[_0x4e7e('0x3b')]['find']({'where':{'id':_0x2bce81[_0x4e7e('0x40')]['id']}})[_0x4e7e('0x1e')](handleEntityNotFound(_0x51b560,null))['then'](saveUpdates(_0x2bce81[_0x4e7e('0x43')],null))['then'](respondWithResult(_0x51b560,null))[_0x4e7e('0x3e')](handleError(_0x51b560,null));};exports[_0x4e7e('0x1f')]=function(_0x30cda1,_0x70ef27){return db[_0x4e7e('0x3b')]['find']({'where':{'id':_0x30cda1[_0x4e7e('0x40')]['id']}})[_0x4e7e('0x1e')](handleEntityNotFound(_0x70ef27,null))[_0x4e7e('0x1e')](removeEntity(_0x70ef27,null))[_0x4e7e('0x3e')](handleError(_0x70ef27,null));};exports[_0x4e7e('0x44')]=function(_0x12f438,_0x47b2e7){return db['SAInvoiceLaw']['describe']()[_0x4e7e('0x1e')](respondWithResult(_0x47b2e7,null))[_0x4e7e('0x3e')](handleError(_0x47b2e7,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.model.js b/server/api/saInvoiceLaw/saInvoiceLaw.model.js index db0e37c..1f22e33 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.model.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9348=['../../config/environment','./saInvoiceLaw.attributes','exports','define','sa_invoice_laws','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2508c9,_0x3dc064){var _0x48d73e=function(_0x1e67b1){while(--_0x1e67b1){_0x2508c9['push'](_0x2508c9['shift']());}};_0x48d73e(++_0x3dc064);}(_0x9348,0x10d));var _0x8934=function(_0x164098,_0x37c47d){_0x164098=_0x164098-0x0;var _0x386a0d=_0x9348[_0x164098];return _0x386a0d;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('SAInvoiceLaw',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefda=['../../config/environment','./saInvoiceLaw.attributes','exports','define','SAInvoiceLaw','sa_invoice_laws','lodash','api','moment','request-promise','path','rimraf'];(function(_0x19b3b6,_0x7a56f1){var _0x1dd890=function(_0x3a82cd){while(--_0x3a82cd){_0x19b3b6['push'](_0x19b3b6['shift']());}};_0x1dd890(++_0x7a56f1);}(_0xefda,0x96));var _0xaefd=function(_0x162081,_0x541725){_0x162081=_0x162081-0x0;var _0x578511=_0xefda[_0x162081];return _0x578511;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js b/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js index ea5c6df..a88fff7 100644 --- a/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js +++ b/server/api/saInvoiceLaw/saInvoiceLaw.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeaa5=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SAInvoiceLaw,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x330900,_0x1c8c84){var _0x1257e4=function(_0x15fd56){while(--_0x15fd56){_0x330900['push'](_0x330900['shift']());}};_0x1257e4(++_0x1c8c84);}(_0xeaa5,0x9f));var _0x5eaa=function(_0x4be1ba,_0x2a20bf){_0x4be1ba=_0x4be1ba-0x0;var _0x171072=_0xeaa5[_0x4be1ba];return _0x171072;};'use strict';var _=require(_0x5eaa('0x0'));var util=require(_0x5eaa('0x1'));var moment=require(_0x5eaa('0x2'));var BPromise=require(_0x5eaa('0x3'));var rs=require(_0x5eaa('0x4'));var fs=require('fs');var Redis=require(_0x5eaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5eaa('0x6'));var logger=require(_0x5eaa('0x7'))(_0x5eaa('0x8'));var config=require(_0x5eaa('0x9'));var jayson=require(_0x5eaa('0xa'));var client=jayson[_0x5eaa('0xb')][_0x5eaa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12cc54,_0x4616c7,_0x179279){return new BPromise(function(_0x12fc18,_0x33c833){return client[_0x5eaa('0xd')](_0x12cc54,_0x179279)['then'](function(_0x1626c2){logger[_0x5eaa('0xe')](_0x5eaa('0xf'),_0x4616c7,_0x5eaa('0x10'));logger[_0x5eaa('0x11')](_0x5eaa('0x12'),_0x4616c7,_0x5eaa('0x10'),JSON['stringify'](_0x1626c2));if(_0x1626c2[_0x5eaa('0x13')]){if(_0x1626c2[_0x5eaa('0x13')][_0x5eaa('0x14')]===0x1f4){logger[_0x5eaa('0x13')](_0x5eaa('0xf'),_0x4616c7,_0x1626c2['error']['message']);return _0x33c833(_0x1626c2[_0x5eaa('0x13')][_0x5eaa('0x15')]);}logger['error'](_0x5eaa('0xf'),_0x4616c7,_0x1626c2[_0x5eaa('0x13')][_0x5eaa('0x15')]);return _0x12fc18(_0x1626c2['error'][_0x5eaa('0x15')]);}else{logger[_0x5eaa('0xe')](_0x5eaa('0xf'),_0x4616c7,_0x5eaa('0x10'));_0x12fc18(_0x1626c2['result'][_0x5eaa('0x15')]);}})[_0x5eaa('0x16')](function(_0x4a9a5e){logger[_0x5eaa('0x13')](_0x5eaa('0xf'),_0x4616c7,_0x4a9a5e);_0x33c833(_0x4a9a5e);});});} \ No newline at end of file +var _0xf4e2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SAInvoiceLaw,\x20%s,\x20%s','catch','util','moment','bluebird'];(function(_0x5a2f92,_0x2f1d42){var _0x3c2980=function(_0x15dd64){while(--_0x15dd64){_0x5a2f92['push'](_0x5a2f92['shift']());}};_0x3c2980(++_0x2f1d42);}(_0xf4e2,0x111));var _0x2f4e=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xf4e2[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require('lodash');var util=require(_0x2f4e('0x0'));var moment=require(_0x2f4e('0x1'));var BPromise=require(_0x2f4e('0x2'));var rs=require(_0x2f4e('0x3'));var fs=require('fs');var Redis=require(_0x2f4e('0x4'));var db=require(_0x2f4e('0x5'))['db'];var utils=require(_0x2f4e('0x6'));var logger=require(_0x2f4e('0x7'))(_0x2f4e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f4e('0x9'));var client=jayson['client'][_0x2f4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23e4b1,_0x90f51a,_0x4da632){return new BPromise(function(_0x346c28,_0x14c082){return client[_0x2f4e('0xb')](_0x23e4b1,_0x4da632)[_0x2f4e('0xc')](function(_0x3916a7){logger[_0x2f4e('0xd')]('SAInvoiceLaw,\x20%s,\x20%s',_0x90f51a,_0x2f4e('0xe'));logger[_0x2f4e('0xf')](_0x2f4e('0x10'),_0x90f51a,_0x2f4e('0xe'),JSON[_0x2f4e('0x11')](_0x3916a7));if(_0x3916a7['error']){if(_0x3916a7[_0x2f4e('0x12')][_0x2f4e('0x13')]===0x1f4){logger[_0x2f4e('0x12')]('SAInvoiceLaw,\x20%s,\x20%s',_0x90f51a,_0x3916a7['error']['message']);return _0x14c082(_0x3916a7['error'][_0x2f4e('0x14')]);}logger[_0x2f4e('0x12')](_0x2f4e('0x15'),_0x90f51a,_0x3916a7[_0x2f4e('0x12')][_0x2f4e('0x14')]);return _0x346c28(_0x3916a7[_0x2f4e('0x12')][_0x2f4e('0x14')]);}else{logger[_0x2f4e('0xd')](_0x2f4e('0x15'),_0x90f51a,_0x2f4e('0xe'));_0x346c28(_0x3916a7['result'][_0x2f4e('0x14')]);}})[_0x2f4e('0x16')](function(_0x273208){logger[_0x2f4e('0x12')](_0x2f4e('0x15'),_0x90f51a,_0x273208);_0x14c082(_0x273208);});});} \ No newline at end of file diff --git a/server/api/saInvoiceNumber/index.js b/server/api/saInvoiceNumber/index.js index 7d9f411..ce2e380 100644 --- a/server/api/saInvoiceNumber/index.js +++ b/server/api/saInvoiceNumber/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa888=['../../components/interaction/service','../../config/environment','./saInvoiceNumber.controller','index','/describe','isAuthenticated','describe','get','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xa888,0x18c));var _0x8a88=function(_0x4fefbd,_0x22c958){_0x4fefbd=_0x4fefbd-0x0;var _0x32f069=_0xa888[_0x4fefbd];return _0x32f069;};'use strict';var multer=require('multer');var util=require(_0x8a88('0x0'));var path=require(_0x8a88('0x1'));var timeout=require(_0x8a88('0x2'));var express=require(_0x8a88('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8a88('0x4'));var config=require(_0x8a88('0x5'));var controller=require(_0x8a88('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a88('0x7')]);router['get'](_0x8a88('0x8'),auth[_0x8a88('0x9')](),controller[_0x8a88('0xa')]);router[_0x8a88('0xb')]('/:id',auth[_0x8a88('0x9')](),controller[_0x8a88('0xc')]);router[_0x8a88('0xd')]('/',auth[_0x8a88('0x9')](),controller['create']);router[_0x8a88('0xe')](_0x8a88('0xf'),auth[_0x8a88('0x9')](),controller[_0x8a88('0x10')]);router[_0x8a88('0x11')](_0x8a88('0xf'),auth[_0x8a88('0x9')](),controller[_0x8a88('0x12')]);module[_0x8a88('0x13')]=router; \ No newline at end of file +var _0xdc0c=['destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./saInvoiceNumber.controller','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete'];(function(_0x4e7454,_0x204e3b){var _0x15c708=function(_0x16ead4){while(--_0x16ead4){_0x4e7454['push'](_0x4e7454['shift']());}};_0x15c708(++_0x204e3b);}(_0xdc0c,0x101));var _0xcdc0=function(_0x250551,_0x371404){_0x250551=_0x250551-0x0;var _0x58b819=_0xdc0c[_0x250551];return _0x58b819;};'use strict';var multer=require('multer');var util=require(_0xcdc0('0x0'));var path=require('path');var timeout=require(_0xcdc0('0x1'));var express=require(_0xcdc0('0x2'));var router=express['Router']();var auth=require(_0xcdc0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcdc0('0x4'));var controller=require(_0xcdc0('0x5'));router[_0xcdc0('0x6')]('/',auth[_0xcdc0('0x7')](),controller['index']);router[_0xcdc0('0x6')](_0xcdc0('0x8'),auth['isAuthenticated'](),controller[_0xcdc0('0x9')]);router['get'](_0xcdc0('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcdc0('0x7')](),controller[_0xcdc0('0xb')]);router[_0xcdc0('0xc')](_0xcdc0('0xa'),auth[_0xcdc0('0x7')](),controller[_0xcdc0('0xd')]);router[_0xcdc0('0xe')](_0xcdc0('0xa'),auth['isAuthenticated'](),controller[_0xcdc0('0xf')]);module[_0xcdc0('0x10')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js b/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js index 261001a..c3151a4 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84f4=['sequelize','exports','INTEGER'];(function(_0x44f5ff,_0x597705){var _0x4df861=function(_0x2ea070){while(--_0x2ea070){_0x44f5ff['push'](_0x44f5ff['shift']());}};_0x4df861(++_0x597705);}(_0x84f4,0x1d7));var _0x484f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84f4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x484f('0x0'));module[_0x484f('0x1')]={'year':{'type':Sequelize[_0x484f('0x2')]},'number':{'type':Sequelize[_0x484f('0x2')]}}; \ No newline at end of file +var _0xbd8e=['INTEGER','sequelize','exports'];(function(_0x47d931,_0x254590){var _0x1f7fe8=function(_0x131846){while(--_0x131846){_0x47d931['push'](_0x47d931['shift']());}};_0x1f7fe8(++_0x254590);}(_0xbd8e,0xf4));var _0xebd8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbd8e[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xebd8('0x0'));module[_0xebd8('0x1')]={'year':{'type':Sequelize[_0xebd8('0x2')]},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.controller.js b/server/api/saInvoiceNumber/saInvoiceNumber.controller.js index a8b6319..4bc67bd 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.controller.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x563a=['sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','catch','show','params','length','includeAll','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','SAInvoiceNumber','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','offset','order'];(function(_0x310157,_0x27036e){var _0x2efc19=function(_0x2cc1cc){while(--_0x2cc1cc){_0x310157['push'](_0x310157['shift']());}};_0x2efc19(++_0x27036e);}(_0x563a,0xe6));var _0xa563=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x563a[_0x126558];return _0x1f6d14;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa563('0x0'));var rimraf=require(_0xa563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa563('0x2'));var rp=require(_0xa563('0x3'));var moment=require(_0xa563('0x4'));var BPromise=require(_0xa563('0x5'));var Mustache=require(_0xa563('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa563('0x7'));var csv=require('to-csv');var ejs=require(_0xa563('0x8'));var fs=require('fs');var _=require(_0xa563('0x9'));var squel=require('squel');var crypto=require(_0xa563('0xa'));var jsforce=require(_0xa563('0xb'));var deskjs=require(_0xa563('0xc'));var toCsv=require(_0xa563('0xd'));var querystring=require(_0xa563('0xe'));var Papa=require('papaparse');var Redis=require(_0xa563('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa563('0x10'));var hardwareService=require(_0xa563('0x11'));var logger=require(_0xa563('0x12'))('api');var utils=require(_0xa563('0x13'));var config=require(_0xa563('0x14'));var db=require(_0xa563('0x15'))['db'];function respondWithStatusCode(_0x3c7a62,_0x1d0bce){_0x1d0bce=_0x1d0bce||0xcc;return function(_0x174efc){if(_0x174efc){return _0x3c7a62[_0xa563('0x16')](_0x1d0bce);}return _0x3c7a62[_0xa563('0x17')](_0x1d0bce)[_0xa563('0x18')]();};}function respondWithResult(_0x4ffc65,_0x52d4df){_0x52d4df=_0x52d4df||0xc8;return function(_0x352b10){if(_0x352b10){return _0x4ffc65[_0xa563('0x17')](_0x52d4df)[_0xa563('0x19')](_0x352b10);}};}function respondWithFilteredResult(_0x4edeb9,_0x243862){return function(_0xcc8f61){if(_0xcc8f61){var _0x4888fa=_0xcc8f61[_0xa563('0x1a')],_0x1b72d5=_0x243862['offset'],_0x4e0bc7=_0x243862['offset']+_0x243862[_0xa563('0x1b')],_0x4071b6;if(_0x4e0bc7>=_0x4888fa){_0x4e0bc7=_0x4888fa;_0x4071b6=0xc8;}else{_0x4071b6=0xce;}_0x4edeb9[_0xa563('0x17')](_0x4071b6);return _0x4edeb9[_0xa563('0x1c')](_0xa563('0x1d'),_0x1b72d5+'-'+_0x4e0bc7+'/'+_0x4888fa)[_0xa563('0x19')](_0xcc8f61);}return null;};}function patchUpdates(_0x69fa1e){return function(_0x2bfa85){try{jsonpatch[_0xa563('0x1e')](_0x2bfa85,_0x69fa1e,!![]);}catch(_0x1741e1){return BPromise[_0xa563('0x1f')](_0x1741e1);}return _0x2bfa85[_0xa563('0x20')]();};}function saveUpdates(_0x273809,_0x41afa5){return function(_0x1dcf08){if(_0x1dcf08){return _0x1dcf08['update'](_0x273809)['then'](function(_0x33b853){return _0x33b853;});}return null;};}function removeEntity(_0x1b1592,_0x1575df){return function(_0x26df08){if(_0x26df08){return _0x26df08[_0xa563('0x21')]()[_0xa563('0x22')](function(){_0x1b1592[_0xa563('0x17')](0xcc)[_0xa563('0x18')]();});}};}function handleEntityNotFound(_0x289b17,_0x5da582){return function(_0x208da2){if(!_0x208da2){_0x289b17[_0xa563('0x16')](0x194);}return _0x208da2;};}function handleError(_0x4fdf87,_0x40d982){_0x40d982=_0x40d982||0x1f4;return function(_0xb1fceb){logger['error'](_0xb1fceb[_0xa563('0x23')]);if(_0xb1fceb[_0xa563('0x24')]){delete _0xb1fceb[_0xa563('0x24')];}_0x4fdf87[_0xa563('0x17')](_0x40d982)[_0xa563('0x25')](_0xb1fceb);};}exports['index']=function(_0x351a6b,_0x5e0a39){var _0x5824f2={},_0x2745cd={},_0x287c03={'count':0x0,'rows':[]};var _0x1c83b6=db[_0xa563('0x26')][_0xa563('0x27')];_0x2745cd[_0xa563('0x28')]=_[_0xa563('0x29')](_0x1c83b6);_0x2745cd[_0xa563('0x2a')]=_[_0xa563('0x29')](_0x351a6b[_0xa563('0x2a')]);_0x2745cd[_0xa563('0x2b')]=_['intersection'](_0x2745cd[_0xa563('0x28')],_0x2745cd[_0xa563('0x2a')]);_0x5824f2['attributes']=_[_0xa563('0x2c')](_0x2745cd[_0xa563('0x28')],qs[_0xa563('0x2d')](_0x351a6b[_0xa563('0x2a')][_0xa563('0x2d')]));_0x5824f2[_0xa563('0x2e')]=_0x5824f2['attributes']['length']?_0x5824f2['attributes']:_0x2745cd[_0xa563('0x28')];if(!_0x351a6b[_0xa563('0x2a')][_0xa563('0x2f')]('nolimit')){_0x5824f2['limit']=qs['limit'](_0x351a6b[_0xa563('0x2a')][_0xa563('0x1b')]);_0x5824f2['offset']=qs[_0xa563('0x30')](_0x351a6b[_0xa563('0x2a')][_0xa563('0x30')]);}_0x5824f2[_0xa563('0x31')]=qs[_0xa563('0x32')](_0x351a6b[_0xa563('0x2a')][_0xa563('0x32')]);_0x5824f2[_0xa563('0x33')]=qs[_0xa563('0x2b')](_[_0xa563('0x34')](_0x351a6b[_0xa563('0x2a')],_0x2745cd['filters']));if(_0x351a6b[_0xa563('0x2a')][_0xa563('0x35')]){_0x5824f2['where']=_[_0xa563('0x36')](_0x5824f2[_0xa563('0x33')],{'$or':_[_0xa563('0x37')](_0x1c83b6,function(_0x5c0dce){if(_0x5c0dce[_0xa563('0x38')]['key']!==_0xa563('0x39')){var _0x170568={};_0x170568[_0x5c0dce[_0xa563('0x3a')]]={'$like':'%'+_0x351a6b[_0xa563('0x2a')][_0xa563('0x35')]+'%'};return _0x170568;}})});}_0x5824f2=_[_0xa563('0x36')]({},_0x5824f2,_0x351a6b[_0xa563('0x3b')]);var _0x51abd4={'where':_0x5824f2[_0xa563('0x33')]};return db['SAInvoiceNumber'][_0xa563('0x1a')](_0x51abd4)[_0xa563('0x22')](function(_0x5221df){_0x287c03['count']=_0x5221df;if(_0x351a6b[_0xa563('0x2a')]['includeAll']){_0x5824f2['include']=[{'all':!![]}];}return db[_0xa563('0x26')]['findAll'](_0x5824f2);})[_0xa563('0x22')](function(_0x4e9a20){_0x287c03['rows']=_0x4e9a20;return _0x287c03;})[_0xa563('0x22')](respondWithFilteredResult(_0x5e0a39,_0x5824f2))[_0xa563('0x3c')](handleError(_0x5e0a39,null));};exports[_0xa563('0x3d')]=function(_0xf9083d,_0x5526f6){var _0xdd8aca={'raw':![],'where':{'id':_0xf9083d[_0xa563('0x3e')]['id']}},_0x3fa239={};_0x3fa239[_0xa563('0x28')]=_[_0xa563('0x29')](db['SAInvoiceNumber'][_0xa563('0x27')]);_0x3fa239['query']=_[_0xa563('0x29')](_0xf9083d[_0xa563('0x2a')]);_0x3fa239['filters']=_['intersection'](_0x3fa239['model'],_0x3fa239[_0xa563('0x2a')]);_0xdd8aca[_0xa563('0x2e')]=_['intersection'](_0x3fa239[_0xa563('0x28')],qs['fields'](_0xf9083d['query'][_0xa563('0x2d')]));_0xdd8aca[_0xa563('0x2e')]=_0xdd8aca[_0xa563('0x2e')][_0xa563('0x3f')]?_0xdd8aca[_0xa563('0x2e')]:_0x3fa239['model'];if(_0xf9083d[_0xa563('0x2a')][_0xa563('0x40')]){_0xdd8aca[_0xa563('0x41')]=[{'all':!![]}];}_0xdd8aca=_['merge']({},_0xdd8aca,_0xf9083d[_0xa563('0x3b')]);return db['SAInvoiceNumber']['find'](_0xdd8aca)[_0xa563('0x22')](handleEntityNotFound(_0x5526f6,null))[_0xa563('0x22')](respondWithResult(_0x5526f6,null))['catch'](handleError(_0x5526f6,null));};exports[_0xa563('0x42')]=function(_0xb3988c,_0x383c65){return db[_0xa563('0x26')][_0xa563('0x42')](_0xb3988c[_0xa563('0x43')],{})['then'](respondWithResult(_0x383c65,0xc9))[_0xa563('0x3c')](handleError(_0x383c65,null));};exports['update']=function(_0x41e17e,_0x244589){if(_0x41e17e[_0xa563('0x43')]['id']){delete _0x41e17e[_0xa563('0x43')]['id'];}return db['SAInvoiceNumber'][_0xa563('0x44')]({'where':{'id':_0x41e17e['params']['id']}})[_0xa563('0x22')](handleEntityNotFound(_0x244589,null))[_0xa563('0x22')](saveUpdates(_0x41e17e[_0xa563('0x43')],null))[_0xa563('0x22')](respondWithResult(_0x244589,null))[_0xa563('0x3c')](handleError(_0x244589,null));};exports['destroy']=function(_0xdd72da,_0x575cb4){return db[_0xa563('0x26')][_0xa563('0x44')]({'where':{'id':_0xdd72da[_0xa563('0x3e')]['id']}})[_0xa563('0x22')](handleEntityNotFound(_0x575cb4,null))[_0xa563('0x22')](removeEntity(_0x575cb4,null))[_0xa563('0x3c')](handleError(_0x575cb4,null));};exports[_0xa563('0x45')]=function(_0x19af2d,_0x33d83c){return db[_0xa563('0x26')]['describe']()['then'](respondWithResult(_0x33d83c,null))[_0xa563('0x3c')](handleError(_0x33d83c,null));}; \ No newline at end of file +var _0x9200=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','json','count','offset','status','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','index','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','pick','filters','filter','where','type','key','VIRTUAL','field','merge','options','SAInvoiceNumber','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0x29b802,_0x2377f1){var _0x14ff64=function(_0x55f474){while(--_0x55f474){_0x29b802['push'](_0x29b802['shift']());}};_0x14ff64(++_0x2377f1);}(_0x9200,0xc6));var _0x0920=function(_0x5cdc37,_0x4b25a0){_0x5cdc37=_0x5cdc37-0x0;var _0x8ebf1a=_0x9200[_0x5cdc37];return _0x8ebf1a;};'use strict';var pdf=require(_0x0920('0x0'));var emlformat=require(_0x0920('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0920('0x2'));var jsonpatch=require(_0x0920('0x3'));var rp=require(_0x0920('0x4'));var moment=require('moment');var BPromise=require(_0x0920('0x5'));var Mustache=require('mustache');var util=require(_0x0920('0x6'));var path=require(_0x0920('0x7'));var sox=require(_0x0920('0x8'));var csv=require(_0x0920('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0920('0xa'));var squel=require(_0x0920('0xb'));var crypto=require(_0x0920('0xc'));var jsforce=require(_0x0920('0xd'));var deskjs=require(_0x0920('0xe'));var toCsv=require(_0x0920('0x9'));var querystring=require(_0x0920('0xf'));var Papa=require(_0x0920('0x10'));var Redis=require('ioredis');var authService=require(_0x0920('0x11'));var qs=require(_0x0920('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0920('0x13'));var utils=require(_0x0920('0x14'));var config=require(_0x0920('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449977,_0x56582b){_0x56582b=_0x56582b||0xcc;return function(_0x3b08b4){if(_0x3b08b4){return _0x449977['sendStatus'](_0x56582b);}return _0x449977['status'](_0x56582b)[_0x0920('0x16')]();};}function respondWithResult(_0x8eb82e,_0x41c20d){_0x41c20d=_0x41c20d||0xc8;return function(_0x3a5da9){if(_0x3a5da9){return _0x8eb82e['status'](_0x41c20d)[_0x0920('0x17')](_0x3a5da9);}};}function respondWithFilteredResult(_0x5d9973,_0x1e0b06){return function(_0x57000e){if(_0x57000e){var _0x375dbb=_0x57000e[_0x0920('0x18')],_0x190cfa=_0x1e0b06[_0x0920('0x19')],_0x36cde4=_0x1e0b06[_0x0920('0x19')]+_0x1e0b06['limit'],_0x3c54a0;if(_0x36cde4>=_0x375dbb){_0x36cde4=_0x375dbb;_0x3c54a0=0xc8;}else{_0x3c54a0=0xce;}_0x5d9973[_0x0920('0x1a')](_0x3c54a0);return _0x5d9973[_0x0920('0x1b')](_0x0920('0x1c'),_0x190cfa+'-'+_0x36cde4+'/'+_0x375dbb)[_0x0920('0x17')](_0x57000e);}return null;};}function patchUpdates(_0x946c0e){return function(_0x3a679e){try{jsonpatch['apply'](_0x3a679e,_0x946c0e,!![]);}catch(_0x55afcc){return BPromise['reject'](_0x55afcc);}return _0x3a679e[_0x0920('0x1d')]();};}function saveUpdates(_0x7f56b9,_0x33e759){return function(_0x969a4b){if(_0x969a4b){return _0x969a4b[_0x0920('0x1e')](_0x7f56b9)[_0x0920('0x1f')](function(_0x3c3adc){return _0x3c3adc;});}return null;};}function removeEntity(_0x540b08,_0x369bba){return function(_0x550093){if(_0x550093){return _0x550093[_0x0920('0x20')]()[_0x0920('0x1f')](function(){_0x540b08[_0x0920('0x1a')](0xcc)[_0x0920('0x16')]();});}};}function handleEntityNotFound(_0x552db6,_0x597d81){return function(_0x39b4a4){if(!_0x39b4a4){_0x552db6[_0x0920('0x21')](0x194);}return _0x39b4a4;};}function handleError(_0x3674ad,_0x97ff02){_0x97ff02=_0x97ff02||0x1f4;return function(_0x370bfb){logger[_0x0920('0x22')](_0x370bfb[_0x0920('0x23')]);if(_0x370bfb[_0x0920('0x24')]){delete _0x370bfb[_0x0920('0x24')];}_0x3674ad['status'](_0x97ff02)['send'](_0x370bfb);};}exports[_0x0920('0x25')]=function(_0x1fffd0,_0x4c5e7c){var _0x17f3f6={},_0x27c89d={},_0x35f379={'count':0x0,'rows':[]};var _0x2c5345=db['SAInvoiceNumber']['rawAttributes'];_0x27c89d[_0x0920('0x26')]=_[_0x0920('0x27')](_0x2c5345);_0x27c89d[_0x0920('0x28')]=_[_0x0920('0x27')](_0x1fffd0[_0x0920('0x28')]);_0x27c89d['filters']=_[_0x0920('0x29')](_0x27c89d[_0x0920('0x26')],_0x27c89d[_0x0920('0x28')]);_0x17f3f6[_0x0920('0x2a')]=_[_0x0920('0x29')](_0x27c89d[_0x0920('0x26')],qs['fields'](_0x1fffd0[_0x0920('0x28')][_0x0920('0x2b')]));_0x17f3f6[_0x0920('0x2a')]=_0x17f3f6[_0x0920('0x2a')]['length']?_0x17f3f6['attributes']:_0x27c89d[_0x0920('0x26')];if(!_0x1fffd0[_0x0920('0x28')]['hasOwnProperty'](_0x0920('0x2c'))){_0x17f3f6['limit']=qs[_0x0920('0x2d')](_0x1fffd0[_0x0920('0x28')][_0x0920('0x2d')]);_0x17f3f6['offset']=qs[_0x0920('0x19')](_0x1fffd0[_0x0920('0x28')]['offset']);}_0x17f3f6[_0x0920('0x2e')]=qs['sort'](_0x1fffd0[_0x0920('0x28')][_0x0920('0x2f')]);_0x17f3f6['where']=qs['filters'](_[_0x0920('0x30')](_0x1fffd0[_0x0920('0x28')],_0x27c89d[_0x0920('0x31')]));if(_0x1fffd0[_0x0920('0x28')][_0x0920('0x32')]){_0x17f3f6[_0x0920('0x33')]=_['merge'](_0x17f3f6[_0x0920('0x33')],{'$or':_['map'](_0x2c5345,function(_0x41282e){if(_0x41282e[_0x0920('0x34')][_0x0920('0x35')]!==_0x0920('0x36')){var _0x11563f={};_0x11563f[_0x41282e[_0x0920('0x37')]]={'$like':'%'+_0x1fffd0[_0x0920('0x28')][_0x0920('0x32')]+'%'};return _0x11563f;}})});}_0x17f3f6=_[_0x0920('0x38')]({},_0x17f3f6,_0x1fffd0[_0x0920('0x39')]);var _0x5c92e4={'where':_0x17f3f6[_0x0920('0x33')]};return db[_0x0920('0x3a')][_0x0920('0x18')](_0x5c92e4)[_0x0920('0x1f')](function(_0x299479){_0x35f379['count']=_0x299479;if(_0x1fffd0[_0x0920('0x28')][_0x0920('0x3b')]){_0x17f3f6[_0x0920('0x3c')]=[{'all':!![]}];}return db[_0x0920('0x3a')]['findAll'](_0x17f3f6);})['then'](function(_0x3e4ebe){_0x35f379[_0x0920('0x3d')]=_0x3e4ebe;return _0x35f379;})[_0x0920('0x1f')](respondWithFilteredResult(_0x4c5e7c,_0x17f3f6))[_0x0920('0x3e')](handleError(_0x4c5e7c,null));};exports[_0x0920('0x3f')]=function(_0xb326b8,_0x53b0aa){var _0x41b8a2={'raw':![],'where':{'id':_0xb326b8[_0x0920('0x40')]['id']}},_0x161577={};_0x161577[_0x0920('0x26')]=_[_0x0920('0x27')](db[_0x0920('0x3a')][_0x0920('0x41')]);_0x161577[_0x0920('0x28')]=_[_0x0920('0x27')](_0xb326b8[_0x0920('0x28')]);_0x161577[_0x0920('0x31')]=_[_0x0920('0x29')](_0x161577[_0x0920('0x26')],_0x161577[_0x0920('0x28')]);_0x41b8a2[_0x0920('0x2a')]=_[_0x0920('0x29')](_0x161577[_0x0920('0x26')],qs[_0x0920('0x2b')](_0xb326b8[_0x0920('0x28')][_0x0920('0x2b')]));_0x41b8a2[_0x0920('0x2a')]=_0x41b8a2[_0x0920('0x2a')][_0x0920('0x42')]?_0x41b8a2['attributes']:_0x161577['model'];if(_0xb326b8[_0x0920('0x28')][_0x0920('0x3b')]){_0x41b8a2[_0x0920('0x3c')]=[{'all':!![]}];}_0x41b8a2=_['merge']({},_0x41b8a2,_0xb326b8[_0x0920('0x39')]);return db['SAInvoiceNumber'][_0x0920('0x43')](_0x41b8a2)[_0x0920('0x1f')](handleEntityNotFound(_0x53b0aa,null))[_0x0920('0x1f')](respondWithResult(_0x53b0aa,null))[_0x0920('0x3e')](handleError(_0x53b0aa,null));};exports[_0x0920('0x44')]=function(_0xd2d929,_0x451126){return db[_0x0920('0x3a')]['create'](_0xd2d929[_0x0920('0x45')],{})[_0x0920('0x1f')](respondWithResult(_0x451126,0xc9))['catch'](handleError(_0x451126,null));};exports[_0x0920('0x1e')]=function(_0x5d7e3c,_0x24421b){if(_0x5d7e3c['body']['id']){delete _0x5d7e3c[_0x0920('0x45')]['id'];}return db['SAInvoiceNumber']['find']({'where':{'id':_0x5d7e3c[_0x0920('0x40')]['id']}})[_0x0920('0x1f')](handleEntityNotFound(_0x24421b,null))[_0x0920('0x1f')](saveUpdates(_0x5d7e3c[_0x0920('0x45')],null))[_0x0920('0x1f')](respondWithResult(_0x24421b,null))[_0x0920('0x3e')](handleError(_0x24421b,null));};exports[_0x0920('0x20')]=function(_0x5871fb,_0x47f085){return db[_0x0920('0x3a')]['find']({'where':{'id':_0x5871fb[_0x0920('0x40')]['id']}})[_0x0920('0x1f')](handleEntityNotFound(_0x47f085,null))[_0x0920('0x1f')](removeEntity(_0x47f085,null))[_0x0920('0x3e')](handleError(_0x47f085,null));};exports[_0x0920('0x46')]=function(_0x5e1c36,_0x32c7a9){return db['SAInvoiceNumber'][_0x0920('0x46')]()[_0x0920('0x1f')](respondWithResult(_0x32c7a9,null))[_0x0920('0x3e')](handleError(_0x32c7a9,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.model.js b/server/api/saInvoiceNumber/saInvoiceNumber.model.js index 645f031..f094a3a 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.model.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x068d=['bluebird','request-promise','path','rimraf','./saInvoiceNumber.attributes','define','SAInvoiceNumber','lodash','../../config/logger','api','moment'];(function(_0x4c0baa,_0x2e110f){var _0x4bf459=function(_0x401aa3){while(--_0x401aa3){_0x4c0baa['push'](_0x4c0baa['shift']());}};_0x4bf459(++_0x2e110f);}(_0x068d,0x1d5));var _0xd068=function(_0x9e70c5,_0x284f11){_0x9e70c5=_0x9e70c5-0x0;var _0x43191b=_0x068d[_0x9e70c5];return _0x43191b;};'use strict';var _=require(_0xd068('0x0'));var util=require('util');var logger=require(_0xd068('0x1'))(_0xd068('0x2'));var moment=require(_0xd068('0x3'));var BPromise=require(_0xd068('0x4'));var rp=require(_0xd068('0x5'));var fs=require('fs');var path=require(_0xd068('0x6'));var rimraf=require(_0xd068('0x7'));var config=require('../../config/environment');var attributes=require(_0xd068('0x8'));module['exports']=function(_0x472da1,_0x3a8794){return _0x472da1[_0xd068('0x9')](_0xd068('0xa'),attributes,{'tableName':'sa_invoice_numbers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdff2=['path','rimraf','../../config/environment','./saInvoiceNumber.attributes','exports','define','SAInvoiceNumber','lodash','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdff2,0x15b));var _0x2dff=function(_0x358840,_0x4f4888){_0x358840=_0x358840-0x0;var _0x97fda6=_0xdff2[_0x358840];return _0x97fda6;};'use strict';var _=require(_0x2dff('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2dff('0x1'));var BPromise=require('bluebird');var rp=require(_0x2dff('0x2'));var fs=require('fs');var path=require(_0x2dff('0x3'));var rimraf=require(_0x2dff('0x4'));var config=require(_0x2dff('0x5'));var attributes=require(_0x2dff('0x6'));module[_0x2dff('0x7')]=function(_0x30acac,_0x2819c5){return _0x30acac[_0x2dff('0x8')](_0x2dff('0x9'),attributes,{'tableName':'sa_invoice_numbers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js b/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js index c1ea26f..cfbf620 100644 --- a/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js +++ b/server/api/saInvoiceNumber/saInvoiceNumber.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae4d=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SAInvoiceNumber,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xae4d,0xfb));var _0xdae4=function(_0x4988ce,_0x27a3a7){_0x4988ce=_0x4988ce-0x0;var _0x786381=_0xae4d[_0x4988ce];return _0x786381;};'use strict';var _=require(_0xdae4('0x0'));var util=require(_0xdae4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdae4('0x2'));var fs=require('fs');var Redis=require(_0xdae4('0x3'));var db=require(_0xdae4('0x4'))['db'];var utils=require(_0xdae4('0x5'));var logger=require(_0xdae4('0x6'))(_0xdae4('0x7'));var config=require(_0xdae4('0x8'));var jayson=require(_0xdae4('0x9'));var client=jayson[_0xdae4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42ce5d,_0x43340c,_0x56b45b){return new BPromise(function(_0x4f8bc0,_0x20bc73){return client[_0xdae4('0xb')](_0x42ce5d,_0x56b45b)['then'](function(_0x1db237){logger[_0xdae4('0xc')](_0xdae4('0xd'),_0x43340c,_0xdae4('0xe'));logger[_0xdae4('0xf')]('SAInvoiceNumber,\x20%s,\x20%s,\x20%s',_0x43340c,_0xdae4('0xe'),JSON['stringify'](_0x1db237));if(_0x1db237['error']){if(_0x1db237[_0xdae4('0x10')][_0xdae4('0x11')]===0x1f4){logger['error'](_0xdae4('0xd'),_0x43340c,_0x1db237[_0xdae4('0x10')]['message']);return _0x20bc73(_0x1db237['error'][_0xdae4('0x12')]);}logger[_0xdae4('0x10')](_0xdae4('0xd'),_0x43340c,_0x1db237[_0xdae4('0x10')][_0xdae4('0x12')]);return _0x4f8bc0(_0x1db237['error'][_0xdae4('0x12')]);}else{logger[_0xdae4('0xc')](_0xdae4('0xd'),_0x43340c,'request\x20sent');_0x4f8bc0(_0x1db237[_0xdae4('0x13')][_0xdae4('0x12')]);}})[_0xdae4('0x14')](function(_0x1c037b){logger[_0xdae4('0x10')](_0xdae4('0xd'),_0x43340c,_0x1c037b);_0x20bc73(_0x1c037b);});});} \ No newline at end of file +var _0xc6b8=['../../config/utils','rpc','../../config/environment','jayson/promise','http','then','SAInvoiceNumber,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','lodash','bluebird','randomstring'];(function(_0x62c3de,_0x4cc79b){var _0x2895cf=function(_0x57cfa2){while(--_0x57cfa2){_0x62c3de['push'](_0x62c3de['shift']());}};_0x2895cf(++_0x4cc79b);}(_0xc6b8,0x173));var _0x8c6b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc6b8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x8c6b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8c6b('0x1'));var rs=require(_0x8c6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c6b('0x3'));var logger=require('../../config/logger')(_0x8c6b('0x4'));var config=require(_0x8c6b('0x5'));var jayson=require(_0x8c6b('0x6'));var client=jayson['client'][_0x8c6b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x141c25,_0x5e9b53,_0x1dcac4){return new BPromise(function(_0x12c42d,_0x3f059e){return client['request'](_0x141c25,_0x1dcac4)[_0x8c6b('0x8')](function(_0x5f5cec){logger['info'](_0x8c6b('0x9'),_0x5e9b53,'request\x20sent');logger[_0x8c6b('0xa')]('SAInvoiceNumber,\x20%s,\x20%s,\x20%s',_0x5e9b53,_0x8c6b('0xb'),JSON['stringify'](_0x5f5cec));if(_0x5f5cec[_0x8c6b('0xc')]){if(_0x5f5cec[_0x8c6b('0xc')][_0x8c6b('0xd')]===0x1f4){logger[_0x8c6b('0xc')](_0x8c6b('0x9'),_0x5e9b53,_0x5f5cec[_0x8c6b('0xc')][_0x8c6b('0xe')]);return _0x3f059e(_0x5f5cec[_0x8c6b('0xc')][_0x8c6b('0xe')]);}logger[_0x8c6b('0xc')](_0x8c6b('0x9'),_0x5e9b53,_0x5f5cec['error'][_0x8c6b('0xe')]);return _0x12c42d(_0x5f5cec['error'][_0x8c6b('0xe')]);}else{logger[_0x8c6b('0xf')](_0x8c6b('0x9'),_0x5e9b53,_0x8c6b('0xb'));_0x12c42d(_0x5f5cec[_0x8c6b('0x10')][_0x8c6b('0xe')]);}})['catch'](function(_0x318ae3){logger[_0x8c6b('0xc')]('SAInvoiceNumber,\x20%s,\x20%s',_0x5e9b53,_0x318ae3);_0x3f059e(_0x318ae3);});});} \ No newline at end of file diff --git a/server/api/saOrder/index.js b/server/api/saOrder/index.js index 89a5a6f..b0835c2 100644 --- a/server/api/saOrder/index.js +++ b/server/api/saOrder/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4213=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post'];(function(_0x5c7c31,_0x22aa86){var _0x193fdf=function(_0x271ade){while(--_0x271ade){_0x5c7c31['push'](_0x5c7c31['shift']());}};_0x193fdf(++_0x22aa86);}(_0x4213,0x77));var _0x3421=function(_0x2acd45,_0x2dee47){_0x2acd45=_0x2acd45-0x0;var _0xb53557=_0x4213[_0x2acd45];return _0xb53557;};'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('./saOrder.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/describe',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['show']);router[_0x3421('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3421('0xe')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xf')]);router[_0x3421('0x10')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0xf4f4=['Router','../../components/auth/service','../../components/interaction/service','./saOrder.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4530fc,_0x2fe936){var _0x35c896=function(_0x458dc5){while(--_0x458dc5){_0x4530fc['push'](_0x4530fc['shift']());}};_0x35c896(++_0x2fe936);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xdc56ad,_0x3af055){_0xdc56ad=_0xdc56ad-0x0;var _0x52a819=_0xf4f4[_0xdc56ad];return _0x52a819;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var auth=require(_0x4f4f('0x5'));var interaction=require(_0x4f4f('0x6'));var config=require('../../config/environment');var controller=require(_0x4f4f('0x7'));router['get']('/',auth[_0x4f4f('0x8')](),controller[_0x4f4f('0x9')]);router[_0x4f4f('0xa')](_0x4f4f('0xb'),auth[_0x4f4f('0x8')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xa')](_0x4f4f('0xd'),auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')]('/',auth[_0x4f4f('0x8')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xd'),auth[_0x4f4f('0x8')](),controller[_0x4f4f('0x12')]);router['delete']('/:id',auth[_0x4f4f('0x8')](),controller[_0x4f4f('0x13')]);module[_0x4f4f('0x14')]=router; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.attributes.js b/server/api/saOrder/saOrder.attributes.js index 97d49bb..f8a320f 100644 --- a/server/api/saOrder/saOrder.attributes.js +++ b/server/api/saOrder/saOrder.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['exports','STRING','TEXT'];(function(_0x2545d2,_0x395db6){var _0x4e00cd=function(_0x2f5f82){while(--_0x2f5f82){_0x2545d2['push'](_0x2545d2['shift']());}};_0x4e00cd(++_0x395db6);}(_0x1261,0x144));var _0x1126=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0x1261[_0x1af0e5];return _0x3c444a;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'clientCode':{'type':Sequelize[_0x1126('0x1')]},'note':{'type':Sequelize[_0x1126('0x2')]},'agentFullname':{'type':Sequelize[_0x1126('0x1')]},'status':{'type':Sequelize[_0x1126('0x1')]}}; \ No newline at end of file +var _0x326f=['TEXT','STRING','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x326f,0xd1));var _0xf326=function(_0x35e14a,_0x1f00d7){_0x35e14a=_0x35e14a-0x0;var _0x1ad619=_0x326f[_0x35e14a];return _0x1ad619;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'clientCode':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf326('0x1')]},'agentFullname':{'type':Sequelize[_0xf326('0x2')]},'status':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.controller.js b/server/api/saOrder/saOrder.controller.js index 332555a..2b1910d 100644 --- a/server/api/saOrder/saOrder.controller.js +++ b/server/api/saOrder/saOrder.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa302=['status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SAOrder','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','merge','map','type','key','field','filter','includeAll','include','findAll','rows','catch','params','options','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0xa302,0x7e));var _0x2a30=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa302[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0x2a30('0x0'));var emlformat=require(_0x2a30('0x1'));var rimraf=require(_0x2a30('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a30('0x3'));var rp=require(_0x2a30('0x4'));var moment=require(_0x2a30('0x5'));var BPromise=require(_0x2a30('0x6'));var Mustache=require(_0x2a30('0x7'));var util=require(_0x2a30('0x8'));var path=require(_0x2a30('0x9'));var sox=require('sox');var csv=require(_0x2a30('0xa'));var ejs=require(_0x2a30('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a30('0xc'));var crypto=require(_0x2a30('0xd'));var jsforce=require(_0x2a30('0xe'));var deskjs=require(_0x2a30('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2a30('0x10'));var Papa=require(_0x2a30('0x11'));var Redis=require(_0x2a30('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2a30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a30('0x14'))(_0x2a30('0x15'));var utils=require(_0x2a30('0x16'));var config=require(_0x2a30('0x17'));var db=require(_0x2a30('0x18'))['db'];function respondWithStatusCode(_0x2da93e,_0x1e823d){_0x1e823d=_0x1e823d||0xcc;return function(_0x23a6ce){if(_0x23a6ce){return _0x2da93e[_0x2a30('0x19')](_0x1e823d);}return _0x2da93e[_0x2a30('0x1a')](_0x1e823d)[_0x2a30('0x1b')]();};}function respondWithResult(_0x20079a,_0x1707e4){_0x1707e4=_0x1707e4||0xc8;return function(_0xfe86ce){if(_0xfe86ce){return _0x20079a[_0x2a30('0x1a')](_0x1707e4)[_0x2a30('0x1c')](_0xfe86ce);}};}function respondWithFilteredResult(_0x2dcfa9,_0x3846f1){return function(_0x1c60b9){if(_0x1c60b9){var _0x21f3c3=_0x1c60b9[_0x2a30('0x1d')],_0xd503b2=_0x3846f1[_0x2a30('0x1e')],_0x3e44bc=_0x3846f1[_0x2a30('0x1e')]+_0x3846f1['limit'],_0x51ff6d;if(_0x3e44bc>=_0x21f3c3){_0x3e44bc=_0x21f3c3;_0x51ff6d=0xc8;}else{_0x51ff6d=0xce;}_0x2dcfa9[_0x2a30('0x1a')](_0x51ff6d);return _0x2dcfa9[_0x2a30('0x1f')](_0x2a30('0x20'),_0xd503b2+'-'+_0x3e44bc+'/'+_0x21f3c3)[_0x2a30('0x1c')](_0x1c60b9);}return null;};}function patchUpdates(_0x2c89c8){return function(_0x3c706d){try{jsonpatch[_0x2a30('0x21')](_0x3c706d,_0x2c89c8,!![]);}catch(_0x22b4f0){return BPromise[_0x2a30('0x22')](_0x22b4f0);}return _0x3c706d[_0x2a30('0x23')]();};}function saveUpdates(_0x3c2772,_0x46537c){return function(_0x368f6f){if(_0x368f6f){return _0x368f6f[_0x2a30('0x24')](_0x3c2772)[_0x2a30('0x25')](function(_0x5baae9){return _0x5baae9;});}return null;};}function removeEntity(_0x139329,_0x487b0a){return function(_0x5994d1){if(_0x5994d1){return _0x5994d1[_0x2a30('0x26')]()[_0x2a30('0x25')](function(){_0x139329[_0x2a30('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49542d,_0x4a2c49){return function(_0x3d92ab){if(!_0x3d92ab){_0x49542d[_0x2a30('0x19')](0x194);}return _0x3d92ab;};}function handleError(_0x285b9e,_0xdcd319){_0xdcd319=_0xdcd319||0x1f4;return function(_0x34d96f){logger[_0x2a30('0x27')](_0x34d96f[_0x2a30('0x28')]);if(_0x34d96f[_0x2a30('0x29')]){delete _0x34d96f['name'];}_0x285b9e[_0x2a30('0x1a')](_0xdcd319)[_0x2a30('0x2a')](_0x34d96f);};}exports[_0x2a30('0x2b')]=function(_0x3f1d38,_0x4eeb70){var _0x302043={},_0x5b1f9a={},_0x27993d={'count':0x0,'rows':[]};var _0x47b9c2=db[_0x2a30('0x2c')][_0x2a30('0x2d')];_0x5b1f9a['model']=_[_0x2a30('0x2e')](_0x47b9c2);_0x5b1f9a[_0x2a30('0x2f')]=_[_0x2a30('0x2e')](_0x3f1d38['query']);_0x5b1f9a[_0x2a30('0x30')]=_['intersection'](_0x5b1f9a[_0x2a30('0x31')],_0x5b1f9a[_0x2a30('0x2f')]);_0x302043[_0x2a30('0x32')]=_[_0x2a30('0x33')](_0x5b1f9a[_0x2a30('0x31')],qs[_0x2a30('0x34')](_0x3f1d38['query'][_0x2a30('0x34')]));_0x302043[_0x2a30('0x32')]=_0x302043[_0x2a30('0x32')][_0x2a30('0x35')]?_0x302043['attributes']:_0x5b1f9a[_0x2a30('0x31')];if(!_0x3f1d38['query']['hasOwnProperty'](_0x2a30('0x36'))){_0x302043[_0x2a30('0x37')]=qs[_0x2a30('0x37')](_0x3f1d38[_0x2a30('0x2f')]['limit']);_0x302043[_0x2a30('0x1e')]=qs[_0x2a30('0x1e')](_0x3f1d38['query'][_0x2a30('0x1e')]);}_0x302043[_0x2a30('0x38')]=qs[_0x2a30('0x39')](_0x3f1d38[_0x2a30('0x2f')][_0x2a30('0x39')]);_0x302043[_0x2a30('0x3a')]=qs[_0x2a30('0x30')](_['pick'](_0x3f1d38[_0x2a30('0x2f')],_0x5b1f9a[_0x2a30('0x30')]));if(_0x3f1d38[_0x2a30('0x2f')]['filter']){_0x302043[_0x2a30('0x3a')]=_[_0x2a30('0x3b')](_0x302043[_0x2a30('0x3a')],{'$or':_[_0x2a30('0x3c')](_0x47b9c2,function(_0x198e9b){if(_0x198e9b[_0x2a30('0x3d')][_0x2a30('0x3e')]!=='VIRTUAL'){var _0x87cce8={};_0x87cce8[_0x198e9b[_0x2a30('0x3f')]]={'$like':'%'+_0x3f1d38[_0x2a30('0x2f')][_0x2a30('0x40')]+'%'};return _0x87cce8;}})});}_0x302043=_[_0x2a30('0x3b')]({},_0x302043,_0x3f1d38['options']);var _0x1323d7={'where':_0x302043[_0x2a30('0x3a')]};return db[_0x2a30('0x2c')][_0x2a30('0x1d')](_0x1323d7)['then'](function(_0x846807){_0x27993d[_0x2a30('0x1d')]=_0x846807;if(_0x3f1d38['query'][_0x2a30('0x41')]){_0x302043[_0x2a30('0x42')]=[{'all':!![]}];}return db[_0x2a30('0x2c')][_0x2a30('0x43')](_0x302043);})[_0x2a30('0x25')](function(_0x116b6c){_0x27993d[_0x2a30('0x44')]=_0x116b6c;return _0x27993d;})[_0x2a30('0x25')](respondWithFilteredResult(_0x4eeb70,_0x302043))[_0x2a30('0x45')](handleError(_0x4eeb70,null));};exports['show']=function(_0x4b1f14,_0x311bfc){var _0x1acd10={'raw':![],'where':{'id':_0x4b1f14[_0x2a30('0x46')]['id']}},_0x5cfa53={};_0x5cfa53['model']=_[_0x2a30('0x2e')](db[_0x2a30('0x2c')][_0x2a30('0x2d')]);_0x5cfa53[_0x2a30('0x2f')]=_[_0x2a30('0x2e')](_0x4b1f14['query']);_0x5cfa53[_0x2a30('0x30')]=_[_0x2a30('0x33')](_0x5cfa53[_0x2a30('0x31')],_0x5cfa53[_0x2a30('0x2f')]);_0x1acd10['attributes']=_['intersection'](_0x5cfa53[_0x2a30('0x31')],qs[_0x2a30('0x34')](_0x4b1f14[_0x2a30('0x2f')][_0x2a30('0x34')]));_0x1acd10[_0x2a30('0x32')]=_0x1acd10['attributes'][_0x2a30('0x35')]?_0x1acd10[_0x2a30('0x32')]:_0x5cfa53[_0x2a30('0x31')];if(_0x4b1f14['query']['includeAll']){_0x1acd10['include']=[{'all':!![]}];}_0x1acd10=_[_0x2a30('0x3b')]({},_0x1acd10,_0x4b1f14[_0x2a30('0x47')]);return db['SAOrder']['find'](_0x1acd10)[_0x2a30('0x25')](handleEntityNotFound(_0x311bfc,null))['then'](respondWithResult(_0x311bfc,null))[_0x2a30('0x45')](handleError(_0x311bfc,null));};exports[_0x2a30('0x48')]=function(_0xab1eaf,_0x6e98b6){return db[_0x2a30('0x2c')]['create'](_0xab1eaf[_0x2a30('0x49')],{})[_0x2a30('0x25')](respondWithResult(_0x6e98b6,0xc9))[_0x2a30('0x45')](handleError(_0x6e98b6,null));};exports[_0x2a30('0x24')]=function(_0xc33435,_0x421f1a){if(_0xc33435[_0x2a30('0x49')]['id']){delete _0xc33435[_0x2a30('0x49')]['id'];}return db[_0x2a30('0x2c')][_0x2a30('0x4a')]({'where':{'id':_0xc33435[_0x2a30('0x46')]['id']}})[_0x2a30('0x25')](handleEntityNotFound(_0x421f1a,null))[_0x2a30('0x25')](saveUpdates(_0xc33435[_0x2a30('0x49')],null))[_0x2a30('0x25')](respondWithResult(_0x421f1a,null))[_0x2a30('0x45')](handleError(_0x421f1a,null));};exports[_0x2a30('0x26')]=function(_0xe58d57,_0x81937){return db[_0x2a30('0x2c')]['find']({'where':{'id':_0xe58d57[_0x2a30('0x46')]['id']}})[_0x2a30('0x25')](handleEntityNotFound(_0x81937,null))[_0x2a30('0x25')](removeEntity(_0x81937,null))['catch'](handleError(_0x81937,null));};exports[_0x2a30('0x4b')]=function(_0x4c1f0d,_0x175a50){return db[_0x2a30('0x2c')]['describe']()[_0x2a30('0x25')](respondWithResult(_0x175a50,null))[_0x2a30('0x45')](handleError(_0x175a50,null));}; \ No newline at end of file +var _0x63c6=['model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','sort','filters','filter','where','merge','map','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','SAOrder','rawAttributes'];(function(_0x595a6d,_0x565a31){var _0x19e75f=function(_0x19a8ab){while(--_0x19a8ab){_0x595a6d['push'](_0x595a6d['shift']());}};_0x19e75f(++_0x565a31);}(_0x63c6,0x67));var _0x663c=function(_0x202313,_0x3cebb5){_0x202313=_0x202313-0x0;var _0x4142af=_0x63c6[_0x202313];return _0x4142af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x663c('0x0'));var rimraf=require(_0x663c('0x1'));var zipdir=require(_0x663c('0x2'));var jsonpatch=require(_0x663c('0x3'));var rp=require('request-promise');var moment=require(_0x663c('0x4'));var BPromise=require(_0x663c('0x5'));var Mustache=require(_0x663c('0x6'));var util=require('util');var path=require(_0x663c('0x7'));var sox=require('sox');var csv=require(_0x663c('0x8'));var ejs=require(_0x663c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x663c('0xa'));var crypto=require(_0x663c('0xb'));var jsforce=require(_0x663c('0xc'));var deskjs=require(_0x663c('0xd'));var toCsv=require(_0x663c('0x8'));var querystring=require('querystring');var Papa=require(_0x663c('0xe'));var Redis=require(_0x663c('0xf'));var authService=require(_0x663c('0x10'));var qs=require(_0x663c('0x11'));var hardwareService=require(_0x663c('0x12'));var logger=require('../../config/logger')(_0x663c('0x13'));var utils=require(_0x663c('0x14'));var config=require(_0x663c('0x15'));var db=require(_0x663c('0x16'))['db'];function respondWithStatusCode(_0x389876,_0x5a7c3c){_0x5a7c3c=_0x5a7c3c||0xcc;return function(_0x2528d4){if(_0x2528d4){return _0x389876[_0x663c('0x17')](_0x5a7c3c);}return _0x389876[_0x663c('0x18')](_0x5a7c3c)[_0x663c('0x19')]();};}function respondWithResult(_0x4c878e,_0x165dd2){_0x165dd2=_0x165dd2||0xc8;return function(_0x473b4a){if(_0x473b4a){return _0x4c878e['status'](_0x165dd2)[_0x663c('0x1a')](_0x473b4a);}};}function respondWithFilteredResult(_0x3a14df,_0x1ab6c8){return function(_0x13e6aa){if(_0x13e6aa){var _0x2c7dd9=_0x13e6aa['count'],_0x46f8b5=_0x1ab6c8['offset'],_0x42f7fd=_0x1ab6c8[_0x663c('0x1b')]+_0x1ab6c8['limit'],_0x5bd766;if(_0x42f7fd>=_0x2c7dd9){_0x42f7fd=_0x2c7dd9;_0x5bd766=0xc8;}else{_0x5bd766=0xce;}_0x3a14df[_0x663c('0x18')](_0x5bd766);return _0x3a14df[_0x663c('0x1c')](_0x663c('0x1d'),_0x46f8b5+'-'+_0x42f7fd+'/'+_0x2c7dd9)[_0x663c('0x1a')](_0x13e6aa);}return null;};}function patchUpdates(_0x1256d5){return function(_0x36958a){try{jsonpatch[_0x663c('0x1e')](_0x36958a,_0x1256d5,!![]);}catch(_0x23f5a6){return BPromise[_0x663c('0x1f')](_0x23f5a6);}return _0x36958a[_0x663c('0x20')]();};}function saveUpdates(_0x537aa6,_0xe2dc45){return function(_0x43c037){if(_0x43c037){return _0x43c037[_0x663c('0x21')](_0x537aa6)[_0x663c('0x22')](function(_0x174b60){return _0x174b60;});}return null;};}function removeEntity(_0x11a30b,_0x4e46fa){return function(_0x4b2e7a){if(_0x4b2e7a){return _0x4b2e7a[_0x663c('0x23')]()[_0x663c('0x22')](function(){_0x11a30b[_0x663c('0x18')](0xcc)[_0x663c('0x19')]();});}};}function handleEntityNotFound(_0x3f3cd1,_0x2070c4){return function(_0x57dccc){if(!_0x57dccc){_0x3f3cd1[_0x663c('0x17')](0x194);}return _0x57dccc;};}function handleError(_0x154688,_0x612f08){_0x612f08=_0x612f08||0x1f4;return function(_0x117bcb){logger['error'](_0x117bcb[_0x663c('0x24')]);if(_0x117bcb['name']){delete _0x117bcb[_0x663c('0x25')];}_0x154688[_0x663c('0x18')](_0x612f08)[_0x663c('0x26')](_0x117bcb);};}exports['index']=function(_0x501d5c,_0x35a26d){var _0x15e996={},_0x5e0dee={},_0x488fd9={'count':0x0,'rows':[]};var _0x5321e1=db[_0x663c('0x27')][_0x663c('0x28')];_0x5e0dee[_0x663c('0x29')]=_[_0x663c('0x2a')](_0x5321e1);_0x5e0dee['query']=_[_0x663c('0x2a')](_0x501d5c[_0x663c('0x2b')]);_0x5e0dee['filters']=_['intersection'](_0x5e0dee[_0x663c('0x29')],_0x5e0dee[_0x663c('0x2b')]);_0x15e996[_0x663c('0x2c')]=_[_0x663c('0x2d')](_0x5e0dee['model'],qs['fields'](_0x501d5c['query'][_0x663c('0x2e')]));_0x15e996[_0x663c('0x2c')]=_0x15e996[_0x663c('0x2c')][_0x663c('0x2f')]?_0x15e996[_0x663c('0x2c')]:_0x5e0dee[_0x663c('0x29')];if(!_0x501d5c[_0x663c('0x2b')][_0x663c('0x30')]('nolimit')){_0x15e996[_0x663c('0x31')]=qs[_0x663c('0x31')](_0x501d5c[_0x663c('0x2b')][_0x663c('0x31')]);_0x15e996[_0x663c('0x1b')]=qs[_0x663c('0x1b')](_0x501d5c[_0x663c('0x2b')][_0x663c('0x1b')]);}_0x15e996['order']=qs[_0x663c('0x32')](_0x501d5c[_0x663c('0x2b')][_0x663c('0x32')]);_0x15e996['where']=qs[_0x663c('0x33')](_['pick'](_0x501d5c[_0x663c('0x2b')],_0x5e0dee['filters']));if(_0x501d5c[_0x663c('0x2b')][_0x663c('0x34')]){_0x15e996[_0x663c('0x35')]=_[_0x663c('0x36')](_0x15e996[_0x663c('0x35')],{'$or':_[_0x663c('0x37')](_0x5321e1,function(_0x56b0bd){if(_0x56b0bd['type'][_0x663c('0x38')]!==_0x663c('0x39')){var _0x348045={};_0x348045[_0x56b0bd[_0x663c('0x3a')]]={'$like':'%'+_0x501d5c[_0x663c('0x2b')][_0x663c('0x34')]+'%'};return _0x348045;}})});}_0x15e996=_[_0x663c('0x36')]({},_0x15e996,_0x501d5c[_0x663c('0x3b')]);var _0x168bc7={'where':_0x15e996[_0x663c('0x35')]};return db[_0x663c('0x27')][_0x663c('0x3c')](_0x168bc7)['then'](function(_0x1244bc){_0x488fd9[_0x663c('0x3c')]=_0x1244bc;if(_0x501d5c[_0x663c('0x2b')]['includeAll']){_0x15e996[_0x663c('0x3d')]=[{'all':!![]}];}return db[_0x663c('0x27')][_0x663c('0x3e')](_0x15e996);})[_0x663c('0x22')](function(_0x5e481a){_0x488fd9[_0x663c('0x3f')]=_0x5e481a;return _0x488fd9;})[_0x663c('0x22')](respondWithFilteredResult(_0x35a26d,_0x15e996))[_0x663c('0x40')](handleError(_0x35a26d,null));};exports[_0x663c('0x41')]=function(_0x47c252,_0x5c2711){var _0x5adf61={'raw':![],'where':{'id':_0x47c252[_0x663c('0x42')]['id']}},_0xb5819c={};_0xb5819c[_0x663c('0x29')]=_[_0x663c('0x2a')](db[_0x663c('0x27')][_0x663c('0x28')]);_0xb5819c[_0x663c('0x2b')]=_[_0x663c('0x2a')](_0x47c252[_0x663c('0x2b')]);_0xb5819c[_0x663c('0x33')]=_[_0x663c('0x2d')](_0xb5819c[_0x663c('0x29')],_0xb5819c[_0x663c('0x2b')]);_0x5adf61['attributes']=_['intersection'](_0xb5819c[_0x663c('0x29')],qs[_0x663c('0x2e')](_0x47c252[_0x663c('0x2b')][_0x663c('0x2e')]));_0x5adf61[_0x663c('0x2c')]=_0x5adf61['attributes'][_0x663c('0x2f')]?_0x5adf61[_0x663c('0x2c')]:_0xb5819c[_0x663c('0x29')];if(_0x47c252[_0x663c('0x2b')][_0x663c('0x43')]){_0x5adf61[_0x663c('0x3d')]=[{'all':!![]}];}_0x5adf61=_['merge']({},_0x5adf61,_0x47c252[_0x663c('0x3b')]);return db[_0x663c('0x27')]['find'](_0x5adf61)[_0x663c('0x22')](handleEntityNotFound(_0x5c2711,null))['then'](respondWithResult(_0x5c2711,null))[_0x663c('0x40')](handleError(_0x5c2711,null));};exports[_0x663c('0x44')]=function(_0xed5db2,_0x4cb7ac){return db[_0x663c('0x27')]['create'](_0xed5db2[_0x663c('0x45')],{})[_0x663c('0x22')](respondWithResult(_0x4cb7ac,0xc9))['catch'](handleError(_0x4cb7ac,null));};exports['update']=function(_0x2d3f5e,_0x528ef8){if(_0x2d3f5e[_0x663c('0x45')]['id']){delete _0x2d3f5e[_0x663c('0x45')]['id'];}return db[_0x663c('0x27')][_0x663c('0x46')]({'where':{'id':_0x2d3f5e['params']['id']}})[_0x663c('0x22')](handleEntityNotFound(_0x528ef8,null))['then'](saveUpdates(_0x2d3f5e[_0x663c('0x45')],null))[_0x663c('0x22')](respondWithResult(_0x528ef8,null))['catch'](handleError(_0x528ef8,null));};exports[_0x663c('0x23')]=function(_0x4e5769,_0xd7c4b8){return db[_0x663c('0x27')][_0x663c('0x46')]({'where':{'id':_0x4e5769['params']['id']}})[_0x663c('0x22')](handleEntityNotFound(_0xd7c4b8,null))['then'](removeEntity(_0xd7c4b8,null))[_0x663c('0x40')](handleError(_0xd7c4b8,null));};exports[_0x663c('0x47')]=function(_0x43f5a0,_0x37c7a4){return db[_0x663c('0x27')][_0x663c('0x47')]()[_0x663c('0x22')](respondWithResult(_0x37c7a4,null))[_0x663c('0x40')](handleError(_0x37c7a4,null));}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.model.js b/server/api/saOrder/saOrder.model.js index 550d72c..3c37da6 100644 --- a/server/api/saOrder/saOrder.model.js +++ b/server/api/saOrder/saOrder.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf66=['define','sa_orders','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./saOrder.attributes','exports'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xdf66,0x157));var _0x6df6=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xdf66[_0xe0c564];return _0x32e0f6;};'use strict';var _=require(_0x6df6('0x0'));var util=require(_0x6df6('0x1'));var logger=require(_0x6df6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6df6('0x3'));var rp=require(_0x6df6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6df6('0x5'));var config=require(_0x6df6('0x6'));var attributes=require(_0x6df6('0x7'));module[_0x6df6('0x8')]=function(_0x405040,_0x8f4e48){return _0x405040[_0x6df6('0x9')]('SAOrder',attributes,{'tableName':_0x6df6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4925=['exports','define','SAOrder','lodash','../../config/logger','api','path','rimraf','../../config/environment','./saOrder.attributes'];(function(_0x4ddd26,_0x1abb45){var _0x61e543=function(_0x401705){while(--_0x401705){_0x4ddd26['push'](_0x4ddd26['shift']());}};_0x61e543(++_0x1abb45);}(_0x4925,0x99));var _0x5492=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x4925[_0x344adc];return _0x4014b2;};'use strict';var _=require(_0x5492('0x0'));var util=require('util');var logger=require(_0x5492('0x1'))(_0x5492('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5492('0x3'));var rimraf=require(_0x5492('0x4'));var config=require(_0x5492('0x5'));var attributes=require(_0x5492('0x6'));module[_0x5492('0x7')]=function(_0x22ef38,_0x415e03){return _0x22ef38[_0x5492('0x8')](_0x5492('0x9'),attributes,{'tableName':'sa_orders','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.rpc.js b/server/api/saOrder/saOrder.rpc.js index cf4a136..a080667 100644 --- a/server/api/saOrder/saOrder.rpc.js +++ b/server/api/saOrder/saOrder.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1492=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SAOrder,\x20%s,\x20%s','SAOrder,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1492,0x1bc));var _0x2149=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x1492[_0x5e709a];return _0x57401a;};'use strict';var _=require(_0x2149('0x0'));var util=require(_0x2149('0x1'));var moment=require(_0x2149('0x2'));var BPromise=require(_0x2149('0x3'));var rs=require(_0x2149('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2149('0x5'));var logger=require(_0x2149('0x6'))(_0x2149('0x7'));var config=require(_0x2149('0x8'));var jayson=require(_0x2149('0x9'));var client=jayson[_0x2149('0xa')][_0x2149('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdcc95e,_0x269753,_0x429523){return new BPromise(function(_0x5cdfc4,_0x179b7d){return client['request'](_0xdcc95e,_0x429523)['then'](function(_0x50e59f){logger[_0x2149('0xc')](_0x2149('0xd'),_0x269753,'request\x20sent');logger['debug'](_0x2149('0xe'),_0x269753,_0x2149('0xf'),JSON[_0x2149('0x10')](_0x50e59f));if(_0x50e59f[_0x2149('0x11')]){if(_0x50e59f['error']['code']===0x1f4){logger[_0x2149('0x11')](_0x2149('0xd'),_0x269753,_0x50e59f[_0x2149('0x11')][_0x2149('0x12')]);return _0x179b7d(_0x50e59f['error'][_0x2149('0x12')]);}logger['error'](_0x2149('0xd'),_0x269753,_0x50e59f[_0x2149('0x11')][_0x2149('0x12')]);return _0x5cdfc4(_0x50e59f['error'][_0x2149('0x12')]);}else{logger[_0x2149('0xc')](_0x2149('0xd'),_0x269753,'request\x20sent');_0x5cdfc4(_0x50e59f[_0x2149('0x13')][_0x2149('0x12')]);}})[_0x2149('0x14')](function(_0x4e00ba){logger[_0x2149('0x11')](_0x2149('0xd'),_0x269753,_0x4e00ba);_0x179b7d(_0x4e00ba);});});} \ No newline at end of file +var _0x1736=['http','request','then','SAOrder,\x20%s,\x20%s','request\x20sent','debug','SAOrder,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xdf4058,_0x3d913d){var _0x141888=function(_0x52b935){while(--_0x52b935){_0xdf4058['push'](_0xdf4058['shift']());}};_0x141888(++_0x3d913d);}(_0x1736,0xc4));var _0x6173=function(_0x5a4da8,_0x232f9c){_0x5a4da8=_0x5a4da8-0x0;var _0x395613=_0x1736[_0x5a4da8];return _0x395613;};'use strict';var _=require(_0x6173('0x0'));var util=require(_0x6173('0x1'));var moment=require(_0x6173('0x2'));var BPromise=require(_0x6173('0x3'));var rs=require(_0x6173('0x4'));var fs=require('fs');var Redis=require(_0x6173('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6173('0x6'));var logger=require(_0x6173('0x7'))(_0x6173('0x8'));var config=require(_0x6173('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6173('0xa')][_0x6173('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54a420,_0x29cba2,_0x150ead){return new BPromise(function(_0xf20e68,_0x109d0c){return client[_0x6173('0xc')](_0x54a420,_0x150ead)[_0x6173('0xd')](function(_0x37e491){logger['info'](_0x6173('0xe'),_0x29cba2,_0x6173('0xf'));logger[_0x6173('0x10')](_0x6173('0x11'),_0x29cba2,'request\x20sent',JSON[_0x6173('0x12')](_0x37e491));if(_0x37e491['error']){if(_0x37e491[_0x6173('0x13')]['code']===0x1f4){logger['error'](_0x6173('0xe'),_0x29cba2,_0x37e491[_0x6173('0x13')]['message']);return _0x109d0c(_0x37e491[_0x6173('0x13')][_0x6173('0x14')]);}logger[_0x6173('0x13')](_0x6173('0xe'),_0x29cba2,_0x37e491[_0x6173('0x13')][_0x6173('0x14')]);return _0xf20e68(_0x37e491['error'][_0x6173('0x14')]);}else{logger['info']('SAOrder,\x20%s,\x20%s',_0x29cba2,'request\x20sent');_0xf20e68(_0x37e491[_0x6173('0x15')][_0x6173('0x14')]);}})[_0x6173('0x16')](function(_0x3ccadd){logger[_0x6173('0x13')](_0x6173('0xe'),_0x29cba2,_0x3ccadd);_0x109d0c(_0x3ccadd);});});} \ No newline at end of file diff --git a/server/api/saPayment/index.js b/server/api/saPayment/index.js index 85c10a9..d2436c9 100644 --- a/server/api/saPayment/index.js +++ b/server/api/saPayment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bc7=['show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPayment.controller','isAuthenticated','index','get','/:id'];(function(_0x2a3e35,_0x220d6f){var _0x2de2ca=function(_0x11f692){while(--_0x11f692){_0x2a3e35['push'](_0x2a3e35['shift']());}};_0x2de2ca(++_0x220d6f);}(_0x9bc7,0x1cd));var _0x79bc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9bc7[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x79bc('0x0'));var util=require(_0x79bc('0x1'));var path=require(_0x79bc('0x2'));var timeout=require(_0x79bc('0x3'));var express=require(_0x79bc('0x4'));var router=express[_0x79bc('0x5')]();var auth=require(_0x79bc('0x6'));var interaction=require(_0x79bc('0x7'));var config=require(_0x79bc('0x8'));var controller=require(_0x79bc('0x9'));router['get']('/',auth[_0x79bc('0xa')](),controller[_0x79bc('0xb')]);router[_0x79bc('0xc')]('/describe',auth[_0x79bc('0xa')](),controller['describe']);router[_0x79bc('0xc')](_0x79bc('0xd'),auth[_0x79bc('0xa')](),controller[_0x79bc('0xe')]);router[_0x79bc('0xf')]('/',auth['isAuthenticated'](),controller[_0x79bc('0x10')]);router['put'](_0x79bc('0xd'),auth[_0x79bc('0xa')](),controller['update']);router['delete'](_0x79bc('0xd'),auth[_0x79bc('0xa')](),controller[_0x79bc('0x11')]);module[_0x79bc('0x12')]=router; \ No newline at end of file +var _0x1ae6=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPayment.controller','get','isAuthenticated','index','describe','show','put','update','delete','/:id'];(function(_0x280a63,_0xd8ee56){var _0x5d7b79=function(_0x471d21){while(--_0x471d21){_0x280a63['push'](_0x280a63['shift']());}};_0x5d7b79(++_0xd8ee56);}(_0x1ae6,0x65));var _0x61ae=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1ae6[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x61ae('0x0'));var util=require(_0x61ae('0x1'));var path=require(_0x61ae('0x2'));var timeout=require(_0x61ae('0x3'));var express=require(_0x61ae('0x4'));var router=express[_0x61ae('0x5')]();var auth=require(_0x61ae('0x6'));var interaction=require(_0x61ae('0x7'));var config=require(_0x61ae('0x8'));var controller=require(_0x61ae('0x9'));router[_0x61ae('0xa')]('/',auth[_0x61ae('0xb')](),controller[_0x61ae('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x61ae('0xd')]);router['get']('/:id',auth[_0x61ae('0xb')](),controller[_0x61ae('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x61ae('0xf')]('/:id',auth[_0x61ae('0xb')](),controller[_0x61ae('0x10')]);router[_0x61ae('0x11')](_0x61ae('0x12'),auth[_0x61ae('0xb')](),controller[_0x61ae('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.attributes.js b/server/api/saPayment/saPayment.attributes.js index 4d63872..1b780d7 100644 --- a/server/api/saPayment/saPayment.attributes.js +++ b/server/api/saPayment/saPayment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5e8=['TEXT','DATE','sequelize','exports'];(function(_0x1c7e4e,_0x580d74){var _0x1edc6d=function(_0x10de31){while(--_0x10de31){_0x1c7e4e['push'](_0x1c7e4e['shift']());}};_0x1edc6d(++_0x580d74);}(_0xa5e8,0xca));var _0x8a5e=function(_0x411296,_0x3431d4){_0x411296=_0x411296-0x0;var _0x3347f8=_0xa5e8[_0x411296];return _0x3347f8;};'use strict';var Sequelize=require(_0x8a5e('0x0'));module[_0x8a5e('0x1')]={'payment':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize['TEXT']},'companyId':{'type':Sequelize['INTEGER']},'companyName':{'type':Sequelize[_0x8a5e('0x2')]},'paymentMethod':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize['STRING']},'paymentDate':{'type':Sequelize[_0x8a5e('0x3')]}}; \ No newline at end of file +var _0x7c73=['DATE','exports','DECIMAL','TEXT','INTEGER'];(function(_0x35a6a1,_0x67021d){var _0x394969=function(_0x288803){while(--_0x288803){_0x35a6a1['push'](_0x35a6a1['shift']());}};_0x394969(++_0x67021d);}(_0x7c73,0xe2));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x37c7('0x0')]={'payment':{'type':Sequelize[_0x37c7('0x1')](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize[_0x37c7('0x2')]},'companyId':{'type':Sequelize[_0x37c7('0x3')]},'companyName':{'type':Sequelize[_0x37c7('0x2')]},'paymentMethod':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize['STRING']},'paymentDate':{'type':Sequelize[_0x37c7('0x4')]}}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.controller.js b/server/api/saPayment/saPayment.controller.js index 89210f8..803f769 100644 --- a/server/api/saPayment/saPayment.controller.js +++ b/server/api/saPayment/saPayment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60dd=['Content-Range','apply','save','update','then','destroy','error','stack','name','send','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','type','key','VIRTUAL','field','filter','merge','SAPayment','count','includeAll','include','rows','show','params','rawAttributes','fields','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','moment','bluebird','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x60dd,0x75));var _0xd60d=function(_0x462342,_0x9ac7bd){_0x462342=_0x462342-0x0;var _0x1f948e=_0x60dd[_0x462342];return _0x1f948e;};'use strict';var pdf=require(_0xd60d('0x0'));var emlformat=require(_0xd60d('0x1'));var rimraf=require(_0xd60d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd60d('0x3'));var BPromise=require(_0xd60d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd60d('0x5'));var csv=require('to-csv');var ejs=require(_0xd60d('0x6'));var fs=require('fs');var _=require(_0xd60d('0x7'));var squel=require('squel');var crypto=require(_0xd60d('0x8'));var jsforce=require(_0xd60d('0x9'));var deskjs=require(_0xd60d('0xa'));var toCsv=require(_0xd60d('0xb'));var querystring=require(_0xd60d('0xc'));var Papa=require(_0xd60d('0xd'));var Redis=require(_0xd60d('0xe'));var authService=require(_0xd60d('0xf'));var qs=require(_0xd60d('0x10'));var hardwareService=require(_0xd60d('0x11'));var logger=require(_0xd60d('0x12'))(_0xd60d('0x13'));var utils=require(_0xd60d('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9030,_0x5567ca){_0x5567ca=_0x5567ca||0xcc;return function(_0xc2f04a){if(_0xc2f04a){return _0x1d9030[_0xd60d('0x15')](_0x5567ca);}return _0x1d9030[_0xd60d('0x16')](_0x5567ca)[_0xd60d('0x17')]();};}function respondWithResult(_0x29cc2e,_0x8a02b9){_0x8a02b9=_0x8a02b9||0xc8;return function(_0x840d59){if(_0x840d59){return _0x29cc2e[_0xd60d('0x16')](_0x8a02b9)[_0xd60d('0x18')](_0x840d59);}};}function respondWithFilteredResult(_0x33b2a8,_0x12fabb){return function(_0x280995){if(_0x280995){var _0x1a2fb2=_0x280995['count'],_0x4cb8d3=_0x12fabb[_0xd60d('0x19')],_0x25cc58=_0x12fabb[_0xd60d('0x19')]+_0x12fabb[_0xd60d('0x1a')],_0x306d61;if(_0x25cc58>=_0x1a2fb2){_0x25cc58=_0x1a2fb2;_0x306d61=0xc8;}else{_0x306d61=0xce;}_0x33b2a8[_0xd60d('0x16')](_0x306d61);return _0x33b2a8['set'](_0xd60d('0x1b'),_0x4cb8d3+'-'+_0x25cc58+'/'+_0x1a2fb2)[_0xd60d('0x18')](_0x280995);}return null;};}function patchUpdates(_0x293fab){return function(_0x2238b9){try{jsonpatch[_0xd60d('0x1c')](_0x2238b9,_0x293fab,!![]);}catch(_0x361d80){return BPromise['reject'](_0x361d80);}return _0x2238b9[_0xd60d('0x1d')]();};}function saveUpdates(_0x1ca486,_0x1b3e9a){return function(_0x55785f){if(_0x55785f){return _0x55785f[_0xd60d('0x1e')](_0x1ca486)[_0xd60d('0x1f')](function(_0x44282c){return _0x44282c;});}return null;};}function removeEntity(_0x52c3ae,_0x253f14){return function(_0x1ffb64){if(_0x1ffb64){return _0x1ffb64[_0xd60d('0x20')]()[_0xd60d('0x1f')](function(){_0x52c3ae[_0xd60d('0x16')](0xcc)[_0xd60d('0x17')]();});}};}function handleEntityNotFound(_0x462c5b,_0x1834c5){return function(_0x4fde25){if(!_0x4fde25){_0x462c5b['sendStatus'](0x194);}return _0x4fde25;};}function handleError(_0x1caa06,_0x21112e){_0x21112e=_0x21112e||0x1f4;return function(_0x4c3038){logger[_0xd60d('0x21')](_0x4c3038[_0xd60d('0x22')]);if(_0x4c3038['name']){delete _0x4c3038[_0xd60d('0x23')];}_0x1caa06[_0xd60d('0x16')](_0x21112e)[_0xd60d('0x24')](_0x4c3038);};}exports['index']=function(_0x97394a,_0xba8d3b){var _0x3f5139={},_0x3f903a={},_0x357cab={'count':0x0,'rows':[]};var _0xd99602=db['SAPayment']['rawAttributes'];_0x3f903a[_0xd60d('0x25')]=_[_0xd60d('0x26')](_0xd99602);_0x3f903a[_0xd60d('0x27')]=_[_0xd60d('0x26')](_0x97394a[_0xd60d('0x27')]);_0x3f903a['filters']=_[_0xd60d('0x28')](_0x3f903a[_0xd60d('0x25')],_0x3f903a['query']);_0x3f5139[_0xd60d('0x29')]=_[_0xd60d('0x28')](_0x3f903a[_0xd60d('0x25')],qs['fields'](_0x97394a[_0xd60d('0x27')]['fields']));_0x3f5139['attributes']=_0x3f5139['attributes'][_0xd60d('0x2a')]?_0x3f5139['attributes']:_0x3f903a[_0xd60d('0x25')];if(!_0x97394a[_0xd60d('0x27')][_0xd60d('0x2b')](_0xd60d('0x2c'))){_0x3f5139['limit']=qs[_0xd60d('0x1a')](_0x97394a[_0xd60d('0x27')][_0xd60d('0x1a')]);_0x3f5139['offset']=qs[_0xd60d('0x19')](_0x97394a[_0xd60d('0x27')][_0xd60d('0x19')]);}_0x3f5139[_0xd60d('0x2d')]=qs[_0xd60d('0x2e')](_0x97394a['query'][_0xd60d('0x2e')]);_0x3f5139['where']=qs[_0xd60d('0x2f')](_[_0xd60d('0x30')](_0x97394a[_0xd60d('0x27')],_0x3f903a[_0xd60d('0x2f')]));if(_0x97394a[_0xd60d('0x27')]['filter']){_0x3f5139[_0xd60d('0x31')]=_['merge'](_0x3f5139[_0xd60d('0x31')],{'$or':_[_0xd60d('0x32')](_0xd99602,function(_0x55d899){if(_0x55d899[_0xd60d('0x33')][_0xd60d('0x34')]!==_0xd60d('0x35')){var _0x140667={};_0x140667[_0x55d899[_0xd60d('0x36')]]={'$like':'%'+_0x97394a[_0xd60d('0x27')][_0xd60d('0x37')]+'%'};return _0x140667;}})});}_0x3f5139=_[_0xd60d('0x38')]({},_0x3f5139,_0x97394a['options']);var _0x5e0bd5={'where':_0x3f5139[_0xd60d('0x31')]};return db[_0xd60d('0x39')][_0xd60d('0x3a')](_0x5e0bd5)['then'](function(_0x5844eb){_0x357cab[_0xd60d('0x3a')]=_0x5844eb;if(_0x97394a[_0xd60d('0x27')][_0xd60d('0x3b')]){_0x3f5139[_0xd60d('0x3c')]=[{'all':!![]}];}return db[_0xd60d('0x39')]['findAll'](_0x3f5139);})[_0xd60d('0x1f')](function(_0x301d83){_0x357cab[_0xd60d('0x3d')]=_0x301d83;return _0x357cab;})[_0xd60d('0x1f')](respondWithFilteredResult(_0xba8d3b,_0x3f5139))['catch'](handleError(_0xba8d3b,null));};exports[_0xd60d('0x3e')]=function(_0x29189a,_0x1f00a4){var _0x30f73a={'raw':![],'where':{'id':_0x29189a[_0xd60d('0x3f')]['id']}},_0x25b158={};_0x25b158[_0xd60d('0x25')]=_[_0xd60d('0x26')](db[_0xd60d('0x39')][_0xd60d('0x40')]);_0x25b158['query']=_['keys'](_0x29189a[_0xd60d('0x27')]);_0x25b158['filters']=_[_0xd60d('0x28')](_0x25b158[_0xd60d('0x25')],_0x25b158[_0xd60d('0x27')]);_0x30f73a[_0xd60d('0x29')]=_[_0xd60d('0x28')](_0x25b158[_0xd60d('0x25')],qs[_0xd60d('0x41')](_0x29189a[_0xd60d('0x27')][_0xd60d('0x41')]));_0x30f73a[_0xd60d('0x29')]=_0x30f73a[_0xd60d('0x29')][_0xd60d('0x2a')]?_0x30f73a[_0xd60d('0x29')]:_0x25b158[_0xd60d('0x25')];if(_0x29189a[_0xd60d('0x27')][_0xd60d('0x3b')]){_0x30f73a[_0xd60d('0x3c')]=[{'all':!![]}];}_0x30f73a=_[_0xd60d('0x38')]({},_0x30f73a,_0x29189a[_0xd60d('0x42')]);return db[_0xd60d('0x39')][_0xd60d('0x43')](_0x30f73a)['then'](handleEntityNotFound(_0x1f00a4,null))[_0xd60d('0x1f')](respondWithResult(_0x1f00a4,null))[_0xd60d('0x44')](handleError(_0x1f00a4,null));};exports[_0xd60d('0x45')]=function(_0x1975e3,_0x2bf291){return db[_0xd60d('0x39')][_0xd60d('0x45')](_0x1975e3[_0xd60d('0x46')],{})[_0xd60d('0x1f')](respondWithResult(_0x2bf291,0xc9))[_0xd60d('0x44')](handleError(_0x2bf291,null));};exports[_0xd60d('0x1e')]=function(_0x356c90,_0x4ab19e){if(_0x356c90[_0xd60d('0x46')]['id']){delete _0x356c90[_0xd60d('0x46')]['id'];}return db[_0xd60d('0x39')]['find']({'where':{'id':_0x356c90[_0xd60d('0x3f')]['id']}})[_0xd60d('0x1f')](handleEntityNotFound(_0x4ab19e,null))[_0xd60d('0x1f')](saveUpdates(_0x356c90[_0xd60d('0x46')],null))['then'](respondWithResult(_0x4ab19e,null))[_0xd60d('0x44')](handleError(_0x4ab19e,null));};exports[_0xd60d('0x20')]=function(_0xcc3886,_0x4c25dc){return db[_0xd60d('0x39')][_0xd60d('0x43')]({'where':{'id':_0xcc3886[_0xd60d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c25dc,null))[_0xd60d('0x1f')](removeEntity(_0x4c25dc,null))[_0xd60d('0x44')](handleError(_0x4c25dc,null));};exports[_0xd60d('0x47')]=function(_0x4924e6,_0x23d73e){return db['SAPayment'][_0xd60d('0x47')]()[_0xd60d('0x1f')](respondWithResult(_0x23d73e,null))[_0xd60d('0x44')](handleError(_0x23d73e,null));}; \ No newline at end of file +var _0xc632=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','field','SAPayment','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x16d068,_0x3be4e3){var _0x1c17ad=function(_0x357c34){while(--_0x357c34){_0x16d068['push'](_0x16d068['shift']());}};_0x1c17ad(++_0x3be4e3);}(_0xc632,0xf2));var _0x2c63=function(_0x17a783,_0xe71d3a){_0x17a783=_0x17a783-0x0;var _0x4b0ea8=_0xc632[_0x17a783];return _0x4b0ea8;};'use strict';var pdf=require(_0x2c63('0x0'));var emlformat=require(_0x2c63('0x1'));var rimraf=require(_0x2c63('0x2'));var zipdir=require(_0x2c63('0x3'));var jsonpatch=require(_0x2c63('0x4'));var rp=require('request-promise');var moment=require(_0x2c63('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c63('0x6'));var util=require(_0x2c63('0x7'));var path=require(_0x2c63('0x8'));var sox=require(_0x2c63('0x9'));var csv=require(_0x2c63('0xa'));var ejs=require(_0x2c63('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c63('0xc'));var crypto=require(_0x2c63('0xd'));var jsforce=require(_0x2c63('0xe'));var deskjs=require(_0x2c63('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2c63('0x10'));var Papa=require(_0x2c63('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2c63('0x12'));var hardwareService=require(_0x2c63('0x13'));var logger=require(_0x2c63('0x14'))(_0x2c63('0x15'));var utils=require(_0x2c63('0x16'));var config=require('../../config/environment');var db=require(_0x2c63('0x17'))['db'];function respondWithStatusCode(_0xc379ec,_0x2758f3){_0x2758f3=_0x2758f3||0xcc;return function(_0x41fbc4){if(_0x41fbc4){return _0xc379ec[_0x2c63('0x18')](_0x2758f3);}return _0xc379ec[_0x2c63('0x19')](_0x2758f3)[_0x2c63('0x1a')]();};}function respondWithResult(_0x471bcc,_0x176ff4){_0x176ff4=_0x176ff4||0xc8;return function(_0x2f06ed){if(_0x2f06ed){return _0x471bcc['status'](_0x176ff4)[_0x2c63('0x1b')](_0x2f06ed);}};}function respondWithFilteredResult(_0x439078,_0x5a31b9){return function(_0x173f52){if(_0x173f52){var _0x2ad3b3=_0x173f52[_0x2c63('0x1c')],_0x504693=_0x5a31b9[_0x2c63('0x1d')],_0x4f2d9e=_0x5a31b9['offset']+_0x5a31b9[_0x2c63('0x1e')],_0x367d5d;if(_0x4f2d9e>=_0x2ad3b3){_0x4f2d9e=_0x2ad3b3;_0x367d5d=0xc8;}else{_0x367d5d=0xce;}_0x439078['status'](_0x367d5d);return _0x439078[_0x2c63('0x1f')]('Content-Range',_0x504693+'-'+_0x4f2d9e+'/'+_0x2ad3b3)[_0x2c63('0x1b')](_0x173f52);}return null;};}function patchUpdates(_0x100d0b){return function(_0x23ba98){try{jsonpatch[_0x2c63('0x20')](_0x23ba98,_0x100d0b,!![]);}catch(_0x112fc0){return BPromise[_0x2c63('0x21')](_0x112fc0);}return _0x23ba98[_0x2c63('0x22')]();};}function saveUpdates(_0x1dd03d,_0x515ae6){return function(_0x1e558f){if(_0x1e558f){return _0x1e558f[_0x2c63('0x23')](_0x1dd03d)['then'](function(_0x150907){return _0x150907;});}return null;};}function removeEntity(_0x43d5dd,_0x29060b){return function(_0x39c8c1){if(_0x39c8c1){return _0x39c8c1['destroy']()[_0x2c63('0x24')](function(){_0x43d5dd[_0x2c63('0x19')](0xcc)[_0x2c63('0x1a')]();});}};}function handleEntityNotFound(_0x2a88dd,_0x2f7e88){return function(_0x4b6e3a){if(!_0x4b6e3a){_0x2a88dd[_0x2c63('0x18')](0x194);}return _0x4b6e3a;};}function handleError(_0xe9fd1a,_0x1ae9f6){_0x1ae9f6=_0x1ae9f6||0x1f4;return function(_0x54391d){logger[_0x2c63('0x25')](_0x54391d[_0x2c63('0x26')]);if(_0x54391d[_0x2c63('0x27')]){delete _0x54391d[_0x2c63('0x27')];}_0xe9fd1a['status'](_0x1ae9f6)[_0x2c63('0x28')](_0x54391d);};}exports[_0x2c63('0x29')]=function(_0x3f0d6b,_0x4a41b4){var _0x3aba3f={},_0x38197a={},_0x5278b2={'count':0x0,'rows':[]};var _0x400b2e=db['SAPayment']['rawAttributes'];_0x38197a[_0x2c63('0x2a')]=_[_0x2c63('0x2b')](_0x400b2e);_0x38197a[_0x2c63('0x2c')]=_['keys'](_0x3f0d6b['query']);_0x38197a[_0x2c63('0x2d')]=_[_0x2c63('0x2e')](_0x38197a[_0x2c63('0x2a')],_0x38197a[_0x2c63('0x2c')]);_0x3aba3f[_0x2c63('0x2f')]=_[_0x2c63('0x2e')](_0x38197a[_0x2c63('0x2a')],qs['fields'](_0x3f0d6b[_0x2c63('0x2c')][_0x2c63('0x30')]));_0x3aba3f[_0x2c63('0x2f')]=_0x3aba3f[_0x2c63('0x2f')][_0x2c63('0x31')]?_0x3aba3f['attributes']:_0x38197a[_0x2c63('0x2a')];if(!_0x3f0d6b[_0x2c63('0x2c')][_0x2c63('0x32')](_0x2c63('0x33'))){_0x3aba3f[_0x2c63('0x1e')]=qs['limit'](_0x3f0d6b[_0x2c63('0x2c')]['limit']);_0x3aba3f[_0x2c63('0x1d')]=qs['offset'](_0x3f0d6b['query'][_0x2c63('0x1d')]);}_0x3aba3f['order']=qs[_0x2c63('0x34')](_0x3f0d6b[_0x2c63('0x2c')][_0x2c63('0x34')]);_0x3aba3f['where']=qs[_0x2c63('0x2d')](_['pick'](_0x3f0d6b[_0x2c63('0x2c')],_0x38197a['filters']));if(_0x3f0d6b[_0x2c63('0x2c')]['filter']){_0x3aba3f[_0x2c63('0x35')]=_[_0x2c63('0x36')](_0x3aba3f[_0x2c63('0x35')],{'$or':_[_0x2c63('0x37')](_0x400b2e,function(_0x174d37){if(_0x174d37['type']['key']!==_0x2c63('0x38')){var _0x2ac83e={};_0x2ac83e[_0x174d37[_0x2c63('0x39')]]={'$like':'%'+_0x3f0d6b[_0x2c63('0x2c')]['filter']+'%'};return _0x2ac83e;}})});}_0x3aba3f=_[_0x2c63('0x36')]({},_0x3aba3f,_0x3f0d6b['options']);var _0x238fcd={'where':_0x3aba3f[_0x2c63('0x35')]};return db[_0x2c63('0x3a')]['count'](_0x238fcd)['then'](function(_0x42dd24){_0x5278b2[_0x2c63('0x1c')]=_0x42dd24;if(_0x3f0d6b[_0x2c63('0x2c')][_0x2c63('0x3b')]){_0x3aba3f[_0x2c63('0x3c')]=[{'all':!![]}];}return db[_0x2c63('0x3a')][_0x2c63('0x3d')](_0x3aba3f);})[_0x2c63('0x24')](function(_0x11743e){_0x5278b2['rows']=_0x11743e;return _0x5278b2;})[_0x2c63('0x24')](respondWithFilteredResult(_0x4a41b4,_0x3aba3f))[_0x2c63('0x3e')](handleError(_0x4a41b4,null));};exports[_0x2c63('0x3f')]=function(_0x1a21b6,_0x5bcf29){var _0xc86fcf={'raw':![],'where':{'id':_0x1a21b6[_0x2c63('0x40')]['id']}},_0x47fe5d={};_0x47fe5d[_0x2c63('0x2a')]=_['keys'](db[_0x2c63('0x3a')]['rawAttributes']);_0x47fe5d[_0x2c63('0x2c')]=_['keys'](_0x1a21b6[_0x2c63('0x2c')]);_0x47fe5d[_0x2c63('0x2d')]=_[_0x2c63('0x2e')](_0x47fe5d['model'],_0x47fe5d[_0x2c63('0x2c')]);_0xc86fcf[_0x2c63('0x2f')]=_[_0x2c63('0x2e')](_0x47fe5d[_0x2c63('0x2a')],qs[_0x2c63('0x30')](_0x1a21b6[_0x2c63('0x2c')][_0x2c63('0x30')]));_0xc86fcf[_0x2c63('0x2f')]=_0xc86fcf[_0x2c63('0x2f')][_0x2c63('0x31')]?_0xc86fcf[_0x2c63('0x2f')]:_0x47fe5d['model'];if(_0x1a21b6[_0x2c63('0x2c')][_0x2c63('0x3b')]){_0xc86fcf[_0x2c63('0x3c')]=[{'all':!![]}];}_0xc86fcf=_[_0x2c63('0x36')]({},_0xc86fcf,_0x1a21b6[_0x2c63('0x41')]);return db[_0x2c63('0x3a')][_0x2c63('0x42')](_0xc86fcf)[_0x2c63('0x24')](handleEntityNotFound(_0x5bcf29,null))[_0x2c63('0x24')](respondWithResult(_0x5bcf29,null))[_0x2c63('0x3e')](handleError(_0x5bcf29,null));};exports[_0x2c63('0x43')]=function(_0x2ea930,_0x595305){return db['SAPayment']['create'](_0x2ea930[_0x2c63('0x44')],{})[_0x2c63('0x24')](respondWithResult(_0x595305,0xc9))[_0x2c63('0x3e')](handleError(_0x595305,null));};exports[_0x2c63('0x23')]=function(_0x2bbfa8,_0x5d3a33){if(_0x2bbfa8[_0x2c63('0x44')]['id']){delete _0x2bbfa8[_0x2c63('0x44')]['id'];}return db[_0x2c63('0x3a')][_0x2c63('0x42')]({'where':{'id':_0x2bbfa8['params']['id']}})['then'](handleEntityNotFound(_0x5d3a33,null))[_0x2c63('0x24')](saveUpdates(_0x2bbfa8[_0x2c63('0x44')],null))[_0x2c63('0x24')](respondWithResult(_0x5d3a33,null))[_0x2c63('0x3e')](handleError(_0x5d3a33,null));};exports[_0x2c63('0x45')]=function(_0x22c675,_0x51d153){return db[_0x2c63('0x3a')][_0x2c63('0x42')]({'where':{'id':_0x22c675['params']['id']}})['then'](handleEntityNotFound(_0x51d153,null))[_0x2c63('0x24')](removeEntity(_0x51d153,null))['catch'](handleError(_0x51d153,null));};exports[_0x2c63('0x46')]=function(_0x2b232b,_0x3be34d){return db[_0x2c63('0x3a')][_0x2c63('0x46')]()[_0x2c63('0x24')](respondWithResult(_0x3be34d,null))[_0x2c63('0x3e')](handleError(_0x3be34d,null));}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.model.js b/server/api/saPayment/saPayment.model.js index 5cf1af9..617eea8 100644 --- a/server/api/saPayment/saPayment.model.js +++ b/server/api/saPayment/saPayment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6b1=['find','InvoiceId','then','invoice','receivingFiscalMessage','indexOf','split\x20payment','SAInvoiceDetail','details','SAPayment','findAll','payments','length','payment','netPrice','discount','quantity','isNil','tax','paid','log','invoice-->','catch','TCL:\x20err','ProformaId','proforma','SAProformaDetail','SAProforma','update','Hook\x20afterCreate:\x20err','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','sa_payments','models','has','SAInvoice'];(function(_0x554b8f,_0x50ea37){var _0x198fdc=function(_0x56185f){while(--_0x56185f){_0x554b8f['push'](_0x554b8f['shift']());}};_0x198fdc(++_0x50ea37);}(_0xb6b1,0x198));var _0x1b6b=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xb6b1[_0x137d1d];return _0x485108;};'use strict';var _=require(_0x1b6b('0x0'));var util=require(_0x1b6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var rp=require(_0x1b6b('0x4'));var fs=require('fs');var path=require(_0x1b6b('0x5'));var rimraf=require(_0x1b6b('0x6'));var config=require(_0x1b6b('0x7'));var attributes=require('./saPayment.attributes');module['exports']=function(_0x3005c0,_0x2fa2f8){return _0x3005c0['define']('SAPayment',attributes,{'tableName':_0x1b6b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35a7e3,_0x433aa8,_0x47a095){var _0x1894b8=_0x3005c0[_0x1b6b('0x9')];var _0x43921a={};var _0x12c661={};var _0xa570e2=_0x35a7e3['get']({'plain':!![]});if(_[_0x1b6b('0xa')](_0xa570e2,'InvoiceId')){_0x1894b8[_0x1b6b('0xb')][_0x1b6b('0xc')]({'where':{'id':_0xa570e2[_0x1b6b('0xd')]},'raw':!![]})[_0x1b6b('0xe')](function(_0x13e99f){if(_0x13e99f){_0x43921a[_0x1b6b('0xf')]=_0x13e99f;var _0x52ec20=![];if(_0x43921a[_0x1b6b('0xf')][_0x1b6b('0x10')][_0x1b6b('0x11')](_0x1b6b('0x12'))!=-0x1){_0x52ec20=!![];}return _0x1894b8[_0x1b6b('0x13')]['findAll']({'where':{'InvoiceId':_0xa570e2[_0x1b6b('0xd')]},'raw':!![]})['then'](function(_0xf25ec2){_0x43921a[_0x1b6b('0x14')]=_0xf25ec2;return _0x1894b8[_0x1b6b('0x15')][_0x1b6b('0x16')]({'where':{'InvoiceId':_0xa570e2[_0x1b6b('0xd')]},'raw':!![]});})['then'](function(_0x5421fa){_0x43921a[_0x1b6b('0x17')]=_0x5421fa;var _0x42ad40=0x0;var _0x148496=0x0;var _0x2789aa=0x0;var _0x1f03de=0x0;var _0x4a4914=0x0;for(var _0x1b55e4=0x0;_0x1b55e4<_0x43921a[_0x1b6b('0x17')][_0x1b6b('0x18')];_0x1b55e4++){_0x42ad40+=_0x43921a['payments'][_0x1b55e4][_0x1b6b('0x19')];}for(var _0x1b55e4=0x0;_0x1b55e4<_0x43921a['details'][_0x1b6b('0x18')];_0x1b55e4++){var _0x131f13=0x0;var _0x15eae7=0x0;var _0x56c0ea=0x0;var _0x3338b5=0x0;_0x131f13=_0x43921a[_0x1b6b('0x14')][_0x1b55e4][_0x1b6b('0x1a')]-_0x43921a[_0x1b6b('0x14')][_0x1b55e4]['netPrice']/0x64*_0x43921a['details'][_0x1b55e4][_0x1b6b('0x1b')];_0x15eae7=_0x131f13/0x64*_0x43921a[_0x1b6b('0x14')][_0x1b55e4]['tax'];_0x56c0ea=_0x131f13*_0x43921a[_0x1b6b('0x14')][_0x1b55e4]['quantity'];_0x3338b5=_0x15eae7*_0x43921a[_0x1b6b('0x14')][_0x1b55e4][_0x1b6b('0x1c')];_0x1f03de+=_0x56c0ea;_0x4a4914+=_0x3338b5;}if(!_[_0x1b6b('0x1d')](_0x43921a[_0x1b6b('0xf')][_0x1b6b('0x1b')])){var _0x2a9665=0x0;var _0x132a83=0x0;var _0x8d5996=_0x43921a['invoice'][_0x1b6b('0x1b')]*0x64/_0x1f03de;for(var _0x4a2dc8=0x0;_0x4a2dc8<_0x43921a[_0x1b6b('0x14')]['length'];_0x4a2dc8++){var _0x4f37bc=0x0;var _0x21d958=0x0;var _0x5ddc99=0x0;_0x131f13=_0x43921a[_0x1b6b('0x14')][_0x4a2dc8][_0x1b6b('0x1a')]-_0x43921a[_0x1b6b('0x14')][_0x4a2dc8][_0x1b6b('0x1a')]/0x64*_0x43921a[_0x1b6b('0x14')][_0x4a2dc8][_0x1b6b('0x1b')];_0x4f37bc=_0x131f13/0x64*_0x8d5996;_0x21d958=_0x131f13-_0x4f37bc;_0x5ddc99=_0x21d958*_0x43921a[_0x1b6b('0x14')][_0x4a2dc8][_0x1b6b('0x1c')];_0x2a9665+=_0x5ddc99;_0x132a83+=_0x5ddc99/0x64*_0x43921a[_0x1b6b('0x14')][_0x4a2dc8][_0x1b6b('0x1e')];}}if(!_[_0x1b6b('0x1d')](_0x43921a[_0x1b6b('0xf')]['discount'])){if(_0x52ec20){_0x148496=_0x2a9665;}else{_0x148496=_0x132a83+_0x2a9665;}}else{if(_0x52ec20){_0x148496=_0x1f03de;}else{_0x148496=_0x4a4914+_0x1f03de;}}if(_0x42ad40==_0x148496){_0x43921a[_0x1b6b('0xf')][_0x1b6b('0x1f')]=0x1;}if(_0x42ad40<_0x148496){_0x43921a['invoice'][_0x1b6b('0x1f')]=0x2;}if(_0x42ad40>_0x148496){_0x43921a[_0x1b6b('0xf')]['paid']=0x3;}_0x1894b8[_0x1b6b('0xb')]['update'](_0x43921a['invoice'],{'where':{'id':_0xa570e2['InvoiceId']}})[_0x1b6b('0xe')](function(_0x5c2ef4){console[_0x1b6b('0x20')](_0x1b6b('0x21'),_0x5c2ef4);})[_0x1b6b('0x22')](function(_0x4fd612){console['log'](_0x1b6b('0x23'),_0x4fd612);});});}});}else{_0x1894b8['SAProforma'][_0x1b6b('0xc')]({'where':{'id':_0xa570e2[_0x1b6b('0x24')]},'raw':!![]})[_0x1b6b('0xe')](function(_0xf9e608){if(_0xf9e608){_0x12c661[_0x1b6b('0x25')]=_0xf9e608;var _0x1f8013=![];if(_0x12c661[_0x1b6b('0x25')][_0x1b6b('0x10')]['indexOf'](_0x1b6b('0x12'))!=-0x1){_0x1f8013=!![];}return _0x1894b8[_0x1b6b('0x26')][_0x1b6b('0x16')]({'where':{'ProformaId':_0xa570e2[_0x1b6b('0x24')]},'raw':!![]})[_0x1b6b('0xe')](function(_0x597e4a){_0x12c661['details']=_0x597e4a;return _0x1894b8['SAPayment'][_0x1b6b('0x16')]({'where':{'ProformaId':_0xa570e2['ProformaId']},'raw':!![]});})[_0x1b6b('0xe')](function(_0x5943a7){_0x12c661[_0x1b6b('0x17')]=_0x5943a7;var _0x81db88=0x0;var _0x456607=0x0;var _0x492c10=0x0;var _0xa23a25=0x0;var _0x3b3bc5=0x0;for(var _0x50ff2f=0x0;_0x50ff2f<_0x12c661[_0x1b6b('0x17')][_0x1b6b('0x18')];_0x50ff2f++){_0x81db88+=_0x12c661[_0x1b6b('0x17')][_0x50ff2f][_0x1b6b('0x19')];}for(var _0x50ff2f=0x0;_0x50ff2f<_0x12c661[_0x1b6b('0x14')][_0x1b6b('0x18')];_0x50ff2f++){var _0x3f850b=0x0;var _0x24579b=0x0;var _0x5284fb=0x0;var _0x179198=0x0;_0x3f850b=_0x12c661[_0x1b6b('0x14')][_0x50ff2f]['netPrice']-_0x12c661['details'][_0x50ff2f][_0x1b6b('0x1a')]/0x64*_0x12c661[_0x1b6b('0x14')][_0x50ff2f][_0x1b6b('0x1b')];_0x24579b=_0x3f850b/0x64*_0x12c661['details'][_0x50ff2f][_0x1b6b('0x1e')];_0x5284fb=_0x3f850b*_0x12c661[_0x1b6b('0x14')][_0x50ff2f][_0x1b6b('0x1c')];_0x179198=_0x24579b*_0x12c661[_0x1b6b('0x14')][_0x50ff2f][_0x1b6b('0x1c')];_0xa23a25+=_0x5284fb;_0x3b3bc5+=_0x179198;}if(!_[_0x1b6b('0x1d')](_0x12c661[_0x1b6b('0x25')]['discount'])){var _0x1ef88f=0x0;var _0x1d7d8c=0x0;var _0x55ca92=_0x12c661[_0x1b6b('0x25')][_0x1b6b('0x1b')]*0x64/_0xa23a25;for(var _0x5a0104=0x0;_0x5a0104<_0x12c661[_0x1b6b('0x14')][_0x1b6b('0x18')];_0x5a0104++){var _0x5c605f=0x0;var _0x13e0d2=0x0;var _0x48fc19=0x0;_0x3f850b=_0x12c661[_0x1b6b('0x14')][_0x5a0104][_0x1b6b('0x1a')]-_0x12c661[_0x1b6b('0x14')][_0x5a0104][_0x1b6b('0x1a')]/0x64*_0x12c661[_0x1b6b('0x14')][_0x5a0104]['discount'];_0x5c605f=_0x3f850b/0x64*_0x55ca92;_0x13e0d2=_0x3f850b-_0x5c605f;_0x48fc19=_0x13e0d2*_0x12c661[_0x1b6b('0x14')][_0x5a0104]['quantity'];_0x1ef88f+=_0x48fc19;_0x1d7d8c+=_0x48fc19/0x64*_0x12c661[_0x1b6b('0x14')][_0x5a0104][_0x1b6b('0x1e')];}}if(!_[_0x1b6b('0x1d')](_0x12c661['proforma'][_0x1b6b('0x1b')])){if(_0x1f8013){_0x456607=_0x1ef88f;}else{_0x456607=_0x1d7d8c+_0x1ef88f;}}else{if(_0x1f8013){_0x456607=_0xa23a25;}else{_0x456607=_0x3b3bc5+_0xa23a25;}}if(_0x81db88==_0x456607){_0x12c661[_0x1b6b('0x25')]['paid']=0x1;}if(_0x81db88<_0x456607){_0x12c661['proforma'][_0x1b6b('0x1f')]=0x2;}if(_0x81db88>_0x456607){_0x12c661[_0x1b6b('0x25')]['paid']=0x3;}_0x1894b8[_0x1b6b('0x27')][_0x1b6b('0x28')](_0x12c661[_0x1b6b('0x25')],{'where':{'id':_0xa570e2[_0x1b6b('0x24')]}})[_0x1b6b('0xe')](function(_0x2b2c5e){})['catch'](function(_0x3b1254){console['log'](_0x1b6b('0x29'),_0x3b1254);});});}});}_0x47a095();},'afterUpdate':function(_0x1f1f38,_0x436863,_0x401fb4){var _0x2166ae=_0x3005c0[_0x1b6b('0x9')];var _0x3c315d={};var _0x35d362={};var _0x42146d=_0x1f1f38['get']({'plain':!![]});if(_[_0x1b6b('0xa')](_0x42146d,'InvoiceId')){_0x2166ae['SAInvoice'][_0x1b6b('0xc')]({'where':{'id':_0x42146d[_0x1b6b('0xd')]},'raw':!![]})[_0x1b6b('0xe')](function(_0x5beaea){if(_0x5beaea){_0x3c315d[_0x1b6b('0xf')]=_0x5beaea;var _0x524526=![];if(_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x10')][_0x1b6b('0x11')](_0x1b6b('0x12'))!=-0x1){_0x524526=!![];}return _0x2166ae[_0x1b6b('0x13')]['findAll']({'where':{'InvoiceId':_0x42146d[_0x1b6b('0xd')]},'raw':!![]})['then'](function(_0x59e59d){_0x3c315d['details']=_0x59e59d;return _0x2166ae['SAPayment']['findAll']({'where':{'InvoiceId':_0x42146d[_0x1b6b('0xd')]},'raw':!![]});})['then'](function(_0x52284b){_0x3c315d[_0x1b6b('0x17')]=_0x52284b;var _0x3a8a17=0x0;var _0xc6f06a=0x0;var _0x2eb51f=0x0;var _0x298229=0x0;var _0x18ad3e=0x0;for(var _0x2b3184=0x0;_0x2b3184<_0x3c315d['payments'][_0x1b6b('0x18')];_0x2b3184++){_0x3a8a17+=_0x3c315d['payments'][_0x2b3184]['payment'];}for(var _0x2b3184=0x0;_0x2b3184<_0x3c315d['details'][_0x1b6b('0x18')];_0x2b3184++){var _0x3adbf4=0x0;var _0x239bdb=0x0;var _0x55093f=0x0;var _0x3e3dbe=0x0;_0x3adbf4=_0x3c315d[_0x1b6b('0x14')][_0x2b3184][_0x1b6b('0x1a')]-_0x3c315d['details'][_0x2b3184][_0x1b6b('0x1a')]/0x64*_0x3c315d[_0x1b6b('0x14')][_0x2b3184][_0x1b6b('0x1b')];_0x239bdb=_0x3adbf4/0x64*_0x3c315d[_0x1b6b('0x14')][_0x2b3184][_0x1b6b('0x1e')];_0x55093f=_0x3adbf4*_0x3c315d[_0x1b6b('0x14')][_0x2b3184][_0x1b6b('0x1c')];_0x3e3dbe=_0x239bdb*_0x3c315d[_0x1b6b('0x14')][_0x2b3184][_0x1b6b('0x1c')];_0x298229+=_0x55093f;_0x18ad3e+=_0x3e3dbe;}if(!_[_0x1b6b('0x1d')](_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x1b')])){var _0x20413d=0x0;var _0x4b4a92=0x0;var _0x1a5383=_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x1b')]*0x64/_0x298229;for(var _0x327f5b=0x0;_0x327f5b<_0x3c315d[_0x1b6b('0x14')][_0x1b6b('0x18')];_0x327f5b++){var _0x551e10=0x0;var _0x41b5e6=0x0;var _0x1aec26=0x0;_0x3adbf4=_0x3c315d[_0x1b6b('0x14')][_0x327f5b][_0x1b6b('0x1a')]-_0x3c315d[_0x1b6b('0x14')][_0x327f5b]['netPrice']/0x64*_0x3c315d['details'][_0x327f5b][_0x1b6b('0x1b')];_0x551e10=_0x3adbf4/0x64*_0x1a5383;_0x41b5e6=_0x3adbf4-_0x551e10;_0x1aec26=_0x41b5e6*_0x3c315d['details'][_0x327f5b][_0x1b6b('0x1c')];_0x20413d+=_0x1aec26;_0x4b4a92+=_0x1aec26/0x64*_0x3c315d[_0x1b6b('0x14')][_0x327f5b][_0x1b6b('0x1e')];}}if(!_['isNil'](_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x1b')])){if(_0x524526){_0xc6f06a=_0x20413d;}else{_0xc6f06a=_0x4b4a92+_0x20413d;}}else{if(_0x524526){_0xc6f06a=_0x298229;}else{_0xc6f06a=_0x18ad3e+_0x298229;}}if(_0x3a8a17==_0xc6f06a){_0x3c315d['invoice'][_0x1b6b('0x1f')]=0x1;}if(_0x3a8a17<_0xc6f06a){_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x1f')]=0x2;}if(_0x3a8a17>_0xc6f06a){_0x3c315d['invoice'][_0x1b6b('0x1f')]=0x3;}_0x2166ae['SAInvoice'][_0x1b6b('0x28')](_0x3c315d[_0x1b6b('0xf')],{'where':{'id':_0x42146d[_0x1b6b('0xd')]}})[_0x1b6b('0xe')](function(_0x452d06){console[_0x1b6b('0x20')](_0x1b6b('0x21'),_0x452d06);})[_0x1b6b('0x22')](function(_0x33c36d){console[_0x1b6b('0x20')]('TCL:\x20err',_0x33c36d);});});}});}else{_0x2166ae[_0x1b6b('0x27')][_0x1b6b('0xc')]({'where':{'id':_0x42146d[_0x1b6b('0x24')]},'raw':!![]})['then'](function(_0x548a61){if(_0x548a61){_0x35d362[_0x1b6b('0x25')]=_0x548a61;var _0xe4005a=![];if(_0x3c315d[_0x1b6b('0xf')][_0x1b6b('0x10')][_0x1b6b('0x11')](_0x1b6b('0x12'))!=-0x1){_0xe4005a=!![];}return _0x2166ae[_0x1b6b('0x26')][_0x1b6b('0x16')]({'where':{'ProformaId':_0x42146d['ProformaId']},'raw':!![]})[_0x1b6b('0xe')](function(_0x4bb4df){_0x35d362[_0x1b6b('0x14')]=_0x4bb4df;return _0x2166ae['SAPayment'][_0x1b6b('0x16')]({'where':{'ProformaId':_0x42146d['ProformaId']},'raw':!![]});})[_0x1b6b('0xe')](function(_0x17465d){_0x35d362[_0x1b6b('0x17')]=_0x17465d;var _0x557ae1=0x0;var _0x33289f=0x0;var _0x53562b=0x0;var _0x473475=0x0;var _0x204ba1=0x0;for(var _0x59f870=0x0;_0x59f870<_0x35d362[_0x1b6b('0x17')][_0x1b6b('0x18')];_0x59f870++){_0x557ae1+=_0x35d362[_0x1b6b('0x17')][_0x59f870][_0x1b6b('0x19')];}for(var _0x59f870=0x0;_0x59f870<_0x35d362[_0x1b6b('0x14')][_0x1b6b('0x18')];_0x59f870++){var _0x413474=0x0;var _0x2c9dbb=0x0;var _0x315df6=0x0;var _0x3f6039=0x0;_0x413474=_0x35d362['details'][_0x59f870][_0x1b6b('0x1a')]-_0x35d362[_0x1b6b('0x14')][_0x59f870][_0x1b6b('0x1a')]/0x64*_0x35d362[_0x1b6b('0x14')][_0x59f870]['discount'];_0x2c9dbb=_0x413474/0x64*_0x35d362[_0x1b6b('0x14')][_0x59f870][_0x1b6b('0x1e')];_0x315df6=_0x413474*_0x35d362[_0x1b6b('0x14')][_0x59f870][_0x1b6b('0x1c')];_0x3f6039=_0x2c9dbb*_0x35d362[_0x1b6b('0x14')][_0x59f870]['quantity'];_0x473475+=_0x315df6;_0x204ba1+=_0x3f6039;}if(!_['isNil'](_0x35d362[_0x1b6b('0x25')][_0x1b6b('0x1b')])){var _0x2d99f3=0x0;var _0x3ad0b6=0x0;var _0x58c8ca=_0x35d362[_0x1b6b('0x25')][_0x1b6b('0x1b')]*0x64/_0x473475;for(var _0x27ce70=0x0;_0x27ce70<_0x35d362[_0x1b6b('0x14')][_0x1b6b('0x18')];_0x27ce70++){var _0x378a94=0x0;var _0x9bc553=0x0;var _0x4e3c96=0x0;_0x413474=_0x35d362[_0x1b6b('0x14')][_0x27ce70]['netPrice']-_0x35d362[_0x1b6b('0x14')][_0x27ce70][_0x1b6b('0x1a')]/0x64*_0x35d362['details'][_0x27ce70]['discount'];_0x378a94=_0x413474/0x64*_0x58c8ca;_0x9bc553=_0x413474-_0x378a94;_0x4e3c96=_0x9bc553*_0x35d362[_0x1b6b('0x14')][_0x27ce70]['quantity'];_0x2d99f3+=_0x4e3c96;_0x3ad0b6+=_0x4e3c96/0x64*_0x35d362[_0x1b6b('0x14')][_0x27ce70][_0x1b6b('0x1e')];}}if(!_[_0x1b6b('0x1d')](_0x35d362[_0x1b6b('0x25')][_0x1b6b('0x1b')])){if(_0xe4005a){_0x33289f=_0x2d99f3;}else{_0x33289f=_0x3ad0b6+_0x2d99f3;}}else{if(_0xe4005a){_0x33289f=_0x473475;}else{_0x33289f=_0x204ba1+_0x473475;}}if(_0x557ae1==_0x33289f){_0x35d362['proforma'][_0x1b6b('0x1f')]=0x1;}if(_0x557ae1<_0x33289f){_0x35d362[_0x1b6b('0x25')][_0x1b6b('0x1f')]=0x2;}if(_0x557ae1>_0x33289f){_0x35d362[_0x1b6b('0x25')][_0x1b6b('0x1f')]=0x3;}_0x2166ae[_0x1b6b('0x27')]['update'](_0x35d362[_0x1b6b('0x25')],{'where':{'id':_0x42146d['ProformaId']}})['then'](function(_0x11695c){})[_0x1b6b('0x22')](function(_0x2e88a1){console[_0x1b6b('0x20')]('Hook\x20afterCreate:\x20err',_0x2e88a1);});});}});}_0x401fb4();}}});}; \ No newline at end of file +var _0x7be7=['invoice-->','catch','TCL:\x20err','SAProforma','ProformaId','proforma','Hook\x20afterCreate:\x20err','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./saPayment.attributes','exports','define','SAPayment','sa_payments','models','get','has','SAInvoice','find','InvoiceId','then','invoice','receivingFiscalMessage','indexOf','split\x20payment','SAInvoiceDetail','findAll','details','payments','length','payment','netPrice','discount','tax','quantity','isNil','paid','update','log'];(function(_0x5b72f4,_0x329440){var _0x377c87=function(_0x4ee49a){while(--_0x4ee49a){_0x5b72f4['push'](_0x5b72f4['shift']());}};_0x377c87(++_0x329440);}(_0x7be7,0x1c9));var _0x77be=function(_0x5df5b1,_0x208c9b){_0x5df5b1=_0x5df5b1-0x0;var _0x8d2ece=_0x7be7[_0x5df5b1];return _0x8d2ece;};'use strict';var _=require('lodash');var util=require(_0x77be('0x0'));var logger=require(_0x77be('0x1'))(_0x77be('0x2'));var moment=require(_0x77be('0x3'));var BPromise=require(_0x77be('0x4'));var rp=require(_0x77be('0x5'));var fs=require('fs');var path=require(_0x77be('0x6'));var rimraf=require(_0x77be('0x7'));var config=require('../../config/environment');var attributes=require(_0x77be('0x8'));module[_0x77be('0x9')]=function(_0x1c71a4,_0x3b1d93){return _0x1c71a4[_0x77be('0xa')](_0x77be('0xb'),attributes,{'tableName':_0x77be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d0b84,_0x3e65c0,_0x3ac715){var _0x49a798=_0x1c71a4[_0x77be('0xd')];var _0x39456f={};var _0x2bd3b8={};var _0x307f34=_0x1d0b84[_0x77be('0xe')]({'plain':!![]});if(_[_0x77be('0xf')](_0x307f34,'InvoiceId')){_0x49a798[_0x77be('0x10')][_0x77be('0x11')]({'where':{'id':_0x307f34[_0x77be('0x12')]},'raw':!![]})[_0x77be('0x13')](function(_0x2898e9){if(_0x2898e9){_0x39456f[_0x77be('0x14')]=_0x2898e9;var _0x44a981=![];if(_0x39456f['invoice'][_0x77be('0x15')][_0x77be('0x16')](_0x77be('0x17'))!=-0x1){_0x44a981=!![];}return _0x49a798[_0x77be('0x18')][_0x77be('0x19')]({'where':{'InvoiceId':_0x307f34['InvoiceId']},'raw':!![]})[_0x77be('0x13')](function(_0x57bc51){_0x39456f[_0x77be('0x1a')]=_0x57bc51;return _0x49a798[_0x77be('0xb')][_0x77be('0x19')]({'where':{'InvoiceId':_0x307f34[_0x77be('0x12')]},'raw':!![]});})['then'](function(_0x32946d){_0x39456f[_0x77be('0x1b')]=_0x32946d;var _0x1b99d8=0x0;var _0x2884d4=0x0;var _0xa8cd5e=0x0;var _0x42f086=0x0;var _0x2493cc=0x0;for(var _0xbe123c=0x0;_0xbe123c<_0x39456f[_0x77be('0x1b')][_0x77be('0x1c')];_0xbe123c++){_0x1b99d8+=_0x39456f['payments'][_0xbe123c][_0x77be('0x1d')];}for(var _0xbe123c=0x0;_0xbe123c<_0x39456f[_0x77be('0x1a')][_0x77be('0x1c')];_0xbe123c++){var _0x554271=0x0;var _0x577002=0x0;var _0x4956db=0x0;var _0x1df791=0x0;_0x554271=_0x39456f[_0x77be('0x1a')][_0xbe123c][_0x77be('0x1e')]-_0x39456f[_0x77be('0x1a')][_0xbe123c]['netPrice']/0x64*_0x39456f[_0x77be('0x1a')][_0xbe123c][_0x77be('0x1f')];_0x577002=_0x554271/0x64*_0x39456f[_0x77be('0x1a')][_0xbe123c][_0x77be('0x20')];_0x4956db=_0x554271*_0x39456f[_0x77be('0x1a')][_0xbe123c][_0x77be('0x21')];_0x1df791=_0x577002*_0x39456f['details'][_0xbe123c]['quantity'];_0x42f086+=_0x4956db;_0x2493cc+=_0x1df791;}if(!_[_0x77be('0x22')](_0x39456f[_0x77be('0x14')][_0x77be('0x1f')])){var _0x2ebeaa=0x0;var _0x3290a8=0x0;var _0x5313de=_0x39456f[_0x77be('0x14')][_0x77be('0x1f')]*0x64/_0x42f086;for(var _0x18e565=0x0;_0x18e565<_0x39456f[_0x77be('0x1a')][_0x77be('0x1c')];_0x18e565++){var _0x31b58f=0x0;var _0x666743=0x0;var _0x5ac7dd=0x0;_0x554271=_0x39456f[_0x77be('0x1a')][_0x18e565][_0x77be('0x1e')]-_0x39456f[_0x77be('0x1a')][_0x18e565][_0x77be('0x1e')]/0x64*_0x39456f[_0x77be('0x1a')][_0x18e565]['discount'];_0x31b58f=_0x554271/0x64*_0x5313de;_0x666743=_0x554271-_0x31b58f;_0x5ac7dd=_0x666743*_0x39456f[_0x77be('0x1a')][_0x18e565][_0x77be('0x21')];_0x2ebeaa+=_0x5ac7dd;_0x3290a8+=_0x5ac7dd/0x64*_0x39456f[_0x77be('0x1a')][_0x18e565][_0x77be('0x20')];}}if(!_['isNil'](_0x39456f[_0x77be('0x14')][_0x77be('0x1f')])){if(_0x44a981){_0x2884d4=_0x2ebeaa;}else{_0x2884d4=_0x3290a8+_0x2ebeaa;}}else{if(_0x44a981){_0x2884d4=_0x42f086;}else{_0x2884d4=_0x2493cc+_0x42f086;}}if(_0x1b99d8==_0x2884d4){_0x39456f[_0x77be('0x14')][_0x77be('0x23')]=0x1;}if(_0x1b99d8<_0x2884d4){_0x39456f['invoice'][_0x77be('0x23')]=0x2;}if(_0x1b99d8>_0x2884d4){_0x39456f['invoice'][_0x77be('0x23')]=0x3;}_0x49a798[_0x77be('0x10')][_0x77be('0x24')](_0x39456f[_0x77be('0x14')],{'where':{'id':_0x307f34['InvoiceId']}})[_0x77be('0x13')](function(_0xcfb196){console[_0x77be('0x25')](_0x77be('0x26'),_0xcfb196);})[_0x77be('0x27')](function(_0x4a54ce){console[_0x77be('0x25')](_0x77be('0x28'),_0x4a54ce);});});}});}else{_0x49a798[_0x77be('0x29')][_0x77be('0x11')]({'where':{'id':_0x307f34[_0x77be('0x2a')]},'raw':!![]})[_0x77be('0x13')](function(_0x4f720d){if(_0x4f720d){_0x2bd3b8[_0x77be('0x2b')]=_0x4f720d;var _0x4540cd=![];if(_0x2bd3b8[_0x77be('0x2b')]['receivingFiscalMessage'][_0x77be('0x16')](_0x77be('0x17'))!=-0x1){_0x4540cd=!![];}return _0x49a798['SAProformaDetail']['findAll']({'where':{'ProformaId':_0x307f34[_0x77be('0x2a')]},'raw':!![]})[_0x77be('0x13')](function(_0x49aa7c){_0x2bd3b8[_0x77be('0x1a')]=_0x49aa7c;return _0x49a798[_0x77be('0xb')][_0x77be('0x19')]({'where':{'ProformaId':_0x307f34[_0x77be('0x2a')]},'raw':!![]});})[_0x77be('0x13')](function(_0x4e2610){_0x2bd3b8[_0x77be('0x1b')]=_0x4e2610;var _0x34d799=0x0;var _0x3261f8=0x0;var _0x4d1d33=0x0;var _0x4ccc90=0x0;var _0x2e59af=0x0;for(var _0x5cdf99=0x0;_0x5cdf99<_0x2bd3b8[_0x77be('0x1b')][_0x77be('0x1c')];_0x5cdf99++){_0x34d799+=_0x2bd3b8[_0x77be('0x1b')][_0x5cdf99][_0x77be('0x1d')];}for(var _0x5cdf99=0x0;_0x5cdf99<_0x2bd3b8['details'][_0x77be('0x1c')];_0x5cdf99++){var _0x17550d=0x0;var _0x6f69fb=0x0;var _0x1b8925=0x0;var _0x5afc7b=0x0;_0x17550d=_0x2bd3b8[_0x77be('0x1a')][_0x5cdf99][_0x77be('0x1e')]-_0x2bd3b8[_0x77be('0x1a')][_0x5cdf99]['netPrice']/0x64*_0x2bd3b8[_0x77be('0x1a')][_0x5cdf99][_0x77be('0x1f')];_0x6f69fb=_0x17550d/0x64*_0x2bd3b8[_0x77be('0x1a')][_0x5cdf99][_0x77be('0x20')];_0x1b8925=_0x17550d*_0x2bd3b8[_0x77be('0x1a')][_0x5cdf99]['quantity'];_0x5afc7b=_0x6f69fb*_0x2bd3b8['details'][_0x5cdf99][_0x77be('0x21')];_0x4ccc90+=_0x1b8925;_0x2e59af+=_0x5afc7b;}if(!_['isNil'](_0x2bd3b8[_0x77be('0x2b')]['discount'])){var _0xe59caf=0x0;var _0x4b9a0d=0x0;var _0x8cdced=_0x2bd3b8[_0x77be('0x2b')][_0x77be('0x1f')]*0x64/_0x4ccc90;for(var _0x41738c=0x0;_0x41738c<_0x2bd3b8['details'][_0x77be('0x1c')];_0x41738c++){var _0x3d0b7e=0x0;var _0xbaf263=0x0;var _0x25e512=0x0;_0x17550d=_0x2bd3b8[_0x77be('0x1a')][_0x41738c][_0x77be('0x1e')]-_0x2bd3b8['details'][_0x41738c][_0x77be('0x1e')]/0x64*_0x2bd3b8[_0x77be('0x1a')][_0x41738c][_0x77be('0x1f')];_0x3d0b7e=_0x17550d/0x64*_0x8cdced;_0xbaf263=_0x17550d-_0x3d0b7e;_0x25e512=_0xbaf263*_0x2bd3b8['details'][_0x41738c][_0x77be('0x21')];_0xe59caf+=_0x25e512;_0x4b9a0d+=_0x25e512/0x64*_0x2bd3b8['details'][_0x41738c]['tax'];}}if(!_[_0x77be('0x22')](_0x2bd3b8[_0x77be('0x2b')][_0x77be('0x1f')])){if(_0x4540cd){_0x3261f8=_0xe59caf;}else{_0x3261f8=_0x4b9a0d+_0xe59caf;}}else{if(_0x4540cd){_0x3261f8=_0x4ccc90;}else{_0x3261f8=_0x2e59af+_0x4ccc90;}}if(_0x34d799==_0x3261f8){_0x2bd3b8['proforma']['paid']=0x1;}if(_0x34d799<_0x3261f8){_0x2bd3b8[_0x77be('0x2b')][_0x77be('0x23')]=0x2;}if(_0x34d799>_0x3261f8){_0x2bd3b8[_0x77be('0x2b')][_0x77be('0x23')]=0x3;}_0x49a798[_0x77be('0x29')][_0x77be('0x24')](_0x2bd3b8[_0x77be('0x2b')],{'where':{'id':_0x307f34['ProformaId']}})[_0x77be('0x13')](function(_0xb95710){})['catch'](function(_0x59175b){console[_0x77be('0x25')](_0x77be('0x2c'),_0x59175b);});});}});}_0x3ac715();},'afterUpdate':function(_0x14bd47,_0x579b82,_0x5f604f){var _0x1ea712=_0x1c71a4[_0x77be('0xd')];var _0x3dbd04={};var _0x501897={};var _0x35183c=_0x14bd47[_0x77be('0xe')]({'plain':!![]});if(_[_0x77be('0xf')](_0x35183c,_0x77be('0x12'))){_0x1ea712[_0x77be('0x10')][_0x77be('0x11')]({'where':{'id':_0x35183c[_0x77be('0x12')]},'raw':!![]})['then'](function(_0x4cd918){if(_0x4cd918){_0x3dbd04[_0x77be('0x14')]=_0x4cd918;var _0x38e6a7=![];if(_0x3dbd04[_0x77be('0x14')]['receivingFiscalMessage'][_0x77be('0x16')](_0x77be('0x17'))!=-0x1){_0x38e6a7=!![];}return _0x1ea712[_0x77be('0x18')][_0x77be('0x19')]({'where':{'InvoiceId':_0x35183c[_0x77be('0x12')]},'raw':!![]})['then'](function(_0x1f7448){_0x3dbd04[_0x77be('0x1a')]=_0x1f7448;return _0x1ea712[_0x77be('0xb')][_0x77be('0x19')]({'where':{'InvoiceId':_0x35183c[_0x77be('0x12')]},'raw':!![]});})['then'](function(_0x2645e2){_0x3dbd04['payments']=_0x2645e2;var _0x4e2008=0x0;var _0x412fb3=0x0;var _0x160dc3=0x0;var _0x19df14=0x0;var _0x448119=0x0;for(var _0x4ec0a5=0x0;_0x4ec0a5<_0x3dbd04[_0x77be('0x1b')][_0x77be('0x1c')];_0x4ec0a5++){_0x4e2008+=_0x3dbd04[_0x77be('0x1b')][_0x4ec0a5][_0x77be('0x1d')];}for(var _0x4ec0a5=0x0;_0x4ec0a5<_0x3dbd04['details'][_0x77be('0x1c')];_0x4ec0a5++){var _0xe0eeec=0x0;var _0x209a1b=0x0;var _0x5b5f6f=0x0;var _0x194349=0x0;_0xe0eeec=_0x3dbd04[_0x77be('0x1a')][_0x4ec0a5][_0x77be('0x1e')]-_0x3dbd04[_0x77be('0x1a')][_0x4ec0a5][_0x77be('0x1e')]/0x64*_0x3dbd04[_0x77be('0x1a')][_0x4ec0a5][_0x77be('0x1f')];_0x209a1b=_0xe0eeec/0x64*_0x3dbd04[_0x77be('0x1a')][_0x4ec0a5]['tax'];_0x5b5f6f=_0xe0eeec*_0x3dbd04['details'][_0x4ec0a5][_0x77be('0x21')];_0x194349=_0x209a1b*_0x3dbd04[_0x77be('0x1a')][_0x4ec0a5][_0x77be('0x21')];_0x19df14+=_0x5b5f6f;_0x448119+=_0x194349;}if(!_[_0x77be('0x22')](_0x3dbd04[_0x77be('0x14')][_0x77be('0x1f')])){var _0x200ecb=0x0;var _0x25c3f1=0x0;var _0x1ecf65=_0x3dbd04[_0x77be('0x14')][_0x77be('0x1f')]*0x64/_0x19df14;for(var _0x5d0540=0x0;_0x5d0540<_0x3dbd04[_0x77be('0x1a')][_0x77be('0x1c')];_0x5d0540++){var _0x51b294=0x0;var _0x16c0ff=0x0;var _0x202318=0x0;_0xe0eeec=_0x3dbd04[_0x77be('0x1a')][_0x5d0540][_0x77be('0x1e')]-_0x3dbd04[_0x77be('0x1a')][_0x5d0540][_0x77be('0x1e')]/0x64*_0x3dbd04[_0x77be('0x1a')][_0x5d0540]['discount'];_0x51b294=_0xe0eeec/0x64*_0x1ecf65;_0x16c0ff=_0xe0eeec-_0x51b294;_0x202318=_0x16c0ff*_0x3dbd04[_0x77be('0x1a')][_0x5d0540][_0x77be('0x21')];_0x200ecb+=_0x202318;_0x25c3f1+=_0x202318/0x64*_0x3dbd04[_0x77be('0x1a')][_0x5d0540][_0x77be('0x20')];}}if(!_[_0x77be('0x22')](_0x3dbd04['invoice'][_0x77be('0x1f')])){if(_0x38e6a7){_0x412fb3=_0x200ecb;}else{_0x412fb3=_0x25c3f1+_0x200ecb;}}else{if(_0x38e6a7){_0x412fb3=_0x19df14;}else{_0x412fb3=_0x448119+_0x19df14;}}if(_0x4e2008==_0x412fb3){_0x3dbd04[_0x77be('0x14')][_0x77be('0x23')]=0x1;}if(_0x4e2008<_0x412fb3){_0x3dbd04[_0x77be('0x14')][_0x77be('0x23')]=0x2;}if(_0x4e2008>_0x412fb3){_0x3dbd04[_0x77be('0x14')][_0x77be('0x23')]=0x3;}_0x1ea712[_0x77be('0x10')]['update'](_0x3dbd04[_0x77be('0x14')],{'where':{'id':_0x35183c[_0x77be('0x12')]}})[_0x77be('0x13')](function(_0x4e2cee){console[_0x77be('0x25')](_0x77be('0x26'),_0x4e2cee);})['catch'](function(_0x377df8){console[_0x77be('0x25')](_0x77be('0x28'),_0x377df8);});});}});}else{_0x1ea712[_0x77be('0x29')]['find']({'where':{'id':_0x35183c['ProformaId']},'raw':!![]})[_0x77be('0x13')](function(_0x3fe06b){if(_0x3fe06b){_0x501897[_0x77be('0x2b')]=_0x3fe06b;var _0x5a5d02=![];if(_0x3dbd04[_0x77be('0x14')][_0x77be('0x15')][_0x77be('0x16')](_0x77be('0x17'))!=-0x1){_0x5a5d02=!![];}return _0x1ea712['SAProformaDetail'][_0x77be('0x19')]({'where':{'ProformaId':_0x35183c[_0x77be('0x2a')]},'raw':!![]})['then'](function(_0x25f4cc){_0x501897[_0x77be('0x1a')]=_0x25f4cc;return _0x1ea712[_0x77be('0xb')][_0x77be('0x19')]({'where':{'ProformaId':_0x35183c[_0x77be('0x2a')]},'raw':!![]});})[_0x77be('0x13')](function(_0x33ad95){_0x501897['payments']=_0x33ad95;var _0x543e70=0x0;var _0x3db5f3=0x0;var _0x4bf89d=0x0;var _0x46fc73=0x0;var _0x57a4b5=0x0;for(var _0x494ff5=0x0;_0x494ff5<_0x501897['payments'][_0x77be('0x1c')];_0x494ff5++){_0x543e70+=_0x501897[_0x77be('0x1b')][_0x494ff5]['payment'];}for(var _0x494ff5=0x0;_0x494ff5<_0x501897['details'][_0x77be('0x1c')];_0x494ff5++){var _0x4624a8=0x0;var _0x427606=0x0;var _0xd0f3fc=0x0;var _0x409f1b=0x0;_0x4624a8=_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x1e')]-_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x1e')]/0x64*_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x1f')];_0x427606=_0x4624a8/0x64*_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x20')];_0xd0f3fc=_0x4624a8*_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x21')];_0x409f1b=_0x427606*_0x501897[_0x77be('0x1a')][_0x494ff5][_0x77be('0x21')];_0x46fc73+=_0xd0f3fc;_0x57a4b5+=_0x409f1b;}if(!_[_0x77be('0x22')](_0x501897[_0x77be('0x2b')][_0x77be('0x1f')])){var _0x4cb1ac=0x0;var _0x35e2ea=0x0;var _0x35ad3d=_0x501897['proforma'][_0x77be('0x1f')]*0x64/_0x46fc73;for(var _0x3b7898=0x0;_0x3b7898<_0x501897[_0x77be('0x1a')]['length'];_0x3b7898++){var _0x110b56=0x0;var _0x3d4e00=0x0;var _0x1a4a33=0x0;_0x4624a8=_0x501897[_0x77be('0x1a')][_0x3b7898][_0x77be('0x1e')]-_0x501897[_0x77be('0x1a')][_0x3b7898][_0x77be('0x1e')]/0x64*_0x501897['details'][_0x3b7898][_0x77be('0x1f')];_0x110b56=_0x4624a8/0x64*_0x35ad3d;_0x3d4e00=_0x4624a8-_0x110b56;_0x1a4a33=_0x3d4e00*_0x501897[_0x77be('0x1a')][_0x3b7898]['quantity'];_0x4cb1ac+=_0x1a4a33;_0x35e2ea+=_0x1a4a33/0x64*_0x501897['details'][_0x3b7898][_0x77be('0x20')];}}if(!_[_0x77be('0x22')](_0x501897[_0x77be('0x2b')][_0x77be('0x1f')])){if(_0x5a5d02){_0x3db5f3=_0x4cb1ac;}else{_0x3db5f3=_0x35e2ea+_0x4cb1ac;}}else{if(_0x5a5d02){_0x3db5f3=_0x46fc73;}else{_0x3db5f3=_0x57a4b5+_0x46fc73;}}if(_0x543e70==_0x3db5f3){_0x501897[_0x77be('0x2b')][_0x77be('0x23')]=0x1;}if(_0x543e70<_0x3db5f3){_0x501897['proforma'][_0x77be('0x23')]=0x2;}if(_0x543e70>_0x3db5f3){_0x501897[_0x77be('0x2b')][_0x77be('0x23')]=0x3;}_0x1ea712[_0x77be('0x29')][_0x77be('0x24')](_0x501897[_0x77be('0x2b')],{'where':{'id':_0x35183c[_0x77be('0x2a')]}})[_0x77be('0x13')](function(_0xf4cbe6){})[_0x77be('0x27')](function(_0x1eab09){console['log'](_0x77be('0x2c'),_0x1eab09);});});}});}_0x5f604f();}}});}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.rpc.js b/server/api/saPayment/saPayment.rpc.js index 274e453..02e1abe 100644 --- a/server/api/saPayment/saPayment.rpc.js +++ b/server/api/saPayment/saPayment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5f4=['debug','SAPayment,\x20%s,\x20%s,\x20%s','error','code','SAPayment,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2d64ba,_0x15f324){var _0x256105=function(_0x22ff18){while(--_0x22ff18){_0x2d64ba['push'](_0x2d64ba['shift']());}};_0x256105(++_0x15f324);}(_0xb5f4,0xcd));var _0x4b5f=function(_0xb5c303,_0x5e4f91){_0xb5c303=_0xb5c303-0x0;var _0x160d39=_0xb5f4[_0xb5c303];return _0x160d39;};'use strict';var _=require(_0x4b5f('0x0'));var util=require(_0x4b5f('0x1'));var moment=require('moment');var BPromise=require(_0x4b5f('0x2'));var rs=require(_0x4b5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b5f('0x4'))['db'];var utils=require(_0x4b5f('0x5'));var logger=require(_0x4b5f('0x6'))(_0x4b5f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b5f('0x8'));var client=jayson[_0x4b5f('0x9')][_0x4b5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4937ef,_0x55fdb8,_0x323338){return new BPromise(function(_0x22796f,_0x3a7596){return client[_0x4b5f('0xb')](_0x4937ef,_0x323338)[_0x4b5f('0xc')](function(_0x5a3096){logger[_0x4b5f('0xd')]('SAPayment,\x20%s,\x20%s',_0x55fdb8,_0x4b5f('0xe'));logger[_0x4b5f('0xf')](_0x4b5f('0x10'),_0x55fdb8,_0x4b5f('0xe'),JSON['stringify'](_0x5a3096));if(_0x5a3096['error']){if(_0x5a3096[_0x4b5f('0x11')][_0x4b5f('0x12')]===0x1f4){logger[_0x4b5f('0x11')](_0x4b5f('0x13'),_0x55fdb8,_0x5a3096['error'][_0x4b5f('0x14')]);return _0x3a7596(_0x5a3096['error'][_0x4b5f('0x14')]);}logger[_0x4b5f('0x11')]('SAPayment,\x20%s,\x20%s',_0x55fdb8,_0x5a3096[_0x4b5f('0x11')][_0x4b5f('0x14')]);return _0x22796f(_0x5a3096[_0x4b5f('0x11')][_0x4b5f('0x14')]);}else{logger[_0x4b5f('0xd')](_0x4b5f('0x13'),_0x55fdb8,_0x4b5f('0xe'));_0x22796f(_0x5a3096['result'][_0x4b5f('0x14')]);}})[_0x4b5f('0x15')](function(_0x23e305){logger[_0x4b5f('0x11')](_0x4b5f('0x13'),_0x55fdb8,_0x23e305);_0x3a7596(_0x23e305);});});} \ No newline at end of file +var _0xb3cd=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SAPayment,\x20%s,\x20%s','debug','SAPayment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb3cd,0x1ab));var _0xdb3c=function(_0x45afc1,_0x52a029){_0x45afc1=_0x45afc1-0x0;var _0x182539=_0xb3cd[_0x45afc1];return _0x182539;};'use strict';var _=require(_0xdb3c('0x0'));var util=require(_0xdb3c('0x1'));var moment=require('moment');var BPromise=require(_0xdb3c('0x2'));var rs=require(_0xdb3c('0x3'));var fs=require('fs');var Redis=require(_0xdb3c('0x4'));var db=require(_0xdb3c('0x5'))['db'];var utils=require(_0xdb3c('0x6'));var logger=require(_0xdb3c('0x7'))(_0xdb3c('0x8'));var config=require(_0xdb3c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdb3c('0xa')][_0xdb3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5058a2,_0x8f56f2,_0x192afb){return new BPromise(function(_0x33714a,_0x3a616c){return client[_0xdb3c('0xc')](_0x5058a2,_0x192afb)[_0xdb3c('0xd')](function(_0x25d1be){logger['info'](_0xdb3c('0xe'),_0x8f56f2,'request\x20sent');logger[_0xdb3c('0xf')](_0xdb3c('0x10'),_0x8f56f2,_0xdb3c('0x11'),JSON[_0xdb3c('0x12')](_0x25d1be));if(_0x25d1be['error']){if(_0x25d1be[_0xdb3c('0x13')][_0xdb3c('0x14')]===0x1f4){logger[_0xdb3c('0x13')]('SAPayment,\x20%s,\x20%s',_0x8f56f2,_0x25d1be[_0xdb3c('0x13')][_0xdb3c('0x15')]);return _0x3a616c(_0x25d1be[_0xdb3c('0x13')]['message']);}logger[_0xdb3c('0x13')](_0xdb3c('0xe'),_0x8f56f2,_0x25d1be[_0xdb3c('0x13')][_0xdb3c('0x15')]);return _0x33714a(_0x25d1be[_0xdb3c('0x13')][_0xdb3c('0x15')]);}else{logger[_0xdb3c('0x16')]('SAPayment,\x20%s,\x20%s',_0x8f56f2,_0xdb3c('0x11'));_0x33714a(_0x25d1be[_0xdb3c('0x17')]['message']);}})[_0xdb3c('0x18')](function(_0x13abb1){logger['error']('SAPayment,\x20%s,\x20%s',_0x8f56f2,_0x13abb1);_0x3a616c(_0x13abb1);});});} \ No newline at end of file diff --git a/server/api/saPaymentMethod/index.js b/server/api/saPaymentMethod/index.js index 801aaa4..6729bc3 100644 --- a/server/api/saPaymentMethod/index.js +++ b/server/api/saPaymentMethod/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86f7=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPaymentMethod.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x2f85b4,_0x19e4e7){var _0x34427d=function(_0x1e0acb){while(--_0x1e0acb){_0x2f85b4['push'](_0x2f85b4['shift']());}};_0x34427d(++_0x19e4e7);}(_0x86f7,0x8e));var _0x786f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x86f7[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x786f('0x0'));var util=require(_0x786f('0x1'));var path=require(_0x786f('0x2'));var timeout=require(_0x786f('0x3'));var express=require(_0x786f('0x4'));var router=express[_0x786f('0x5')]();var auth=require(_0x786f('0x6'));var interaction=require(_0x786f('0x7'));var config=require(_0x786f('0x8'));var controller=require(_0x786f('0x9'));router[_0x786f('0xa')]('/',auth['isAuthenticated'](),controller[_0x786f('0xb')]);router['get'](_0x786f('0xc'),auth[_0x786f('0xd')](),controller[_0x786f('0xe')]);router[_0x786f('0xa')](_0x786f('0xf'),auth[_0x786f('0xd')](),controller[_0x786f('0x10')]);router[_0x786f('0x11')]('/',auth[_0x786f('0xd')](),controller[_0x786f('0x12')]);router[_0x786f('0x13')](_0x786f('0xf'),auth[_0x786f('0xd')](),controller[_0x786f('0x14')]);router[_0x786f('0x15')]('/:id',auth[_0x786f('0xd')](),controller['destroy']);module[_0x786f('0x16')]=router; \ No newline at end of file +var _0xc85f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./saPaymentMethod.controller','get','index','/describe','isAuthenticated','show','post','create','put','/:id','delete','exports','multer','util'];(function(_0x4fa913,_0x322d97){var _0x187afd=function(_0x2281a7){while(--_0x2281a7){_0x4fa913['push'](_0x4fa913['shift']());}};_0x187afd(++_0x322d97);}(_0xc85f,0x1c6));var _0xfc85=function(_0x4fcbd2,_0x33b095){_0x4fcbd2=_0x4fcbd2-0x0;var _0x4137ed=_0xc85f[_0x4fcbd2];return _0x4137ed;};'use strict';var multer=require(_0xfc85('0x0'));var util=require(_0xfc85('0x1'));var path=require(_0xfc85('0x2'));var timeout=require(_0xfc85('0x3'));var express=require('express');var router=express[_0xfc85('0x4')]();var auth=require(_0xfc85('0x5'));var interaction=require(_0xfc85('0x6'));var config=require('../../config/environment');var controller=require(_0xfc85('0x7'));router[_0xfc85('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc85('0x9')]);router[_0xfc85('0x8')](_0xfc85('0xa'),auth[_0xfc85('0xb')](),controller['describe']);router['get']('/:id',auth[_0xfc85('0xb')](),controller[_0xfc85('0xc')]);router[_0xfc85('0xd')]('/',auth['isAuthenticated'](),controller[_0xfc85('0xe')]);router[_0xfc85('0xf')](_0xfc85('0x10'),auth[_0xfc85('0xb')](),controller['update']);router[_0xfc85('0x11')]('/:id',auth[_0xfc85('0xb')](),controller['destroy']);module[_0xfc85('0x12')]=router; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.attributes.js b/server/api/saPaymentMethod/saPaymentMethod.attributes.js index ad81237..3f2f866 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.attributes.js +++ b/server/api/saPaymentMethod/saPaymentMethod.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bbf=['sequelize','exports','STRING','name'];(function(_0x53e576,_0x398a4f){var _0x3e9a7c=function(_0x1cf67a){while(--_0x1cf67a){_0x53e576['push'](_0x53e576['shift']());}};_0x3e9a7c(++_0x398a4f);}(_0x7bbf,0x154));var _0xf7bb=function(_0x18be75,_0x589387){_0x18be75=_0x18be75-0x0;var _0x41cde5=_0x7bbf[_0x18be75];return _0x41cde5;};'use strict';var Sequelize=require(_0xf7bb('0x0'));module[_0xf7bb('0x1')]={'name':{'type':Sequelize[_0xf7bb('0x2')],'allowNull':![],'unique':_0xf7bb('0x3')},'bankAccount':{'type':Sequelize[_0xf7bb('0x2')]},'paymentType':{'type':Sequelize[_0xf7bb('0x2')]},'bankName':{'type':Sequelize[_0xf7bb('0x2')]},'bankstreet':{'type':Sequelize[_0xf7bb('0x2')]},'bankpostalCode':{'type':Sequelize[_0xf7bb('0x2')]},'bankcity':{'type':Sequelize[_0xf7bb('0x2')]},'bankcountry':{'type':Sequelize[_0xf7bb('0x2')]},'bankBICSWIFT':{'type':Sequelize[_0xf7bb('0x2')]},'bankIBAN':{'type':Sequelize[_0xf7bb('0x2')]},'bankABI':{'type':Sequelize['STRING']},'banckCAB':{'type':Sequelize[_0xf7bb('0x2')]},'paypalEmail':{'type':Sequelize[_0xf7bb('0x2')],'validate':{'isEmail':!![]}}}; \ No newline at end of file +var _0xfc7d=['STRING','name','sequelize','exports'];(function(_0x4ad681,_0x8b61bc){var _0x2c0e71=function(_0x37a2d9){while(--_0x37a2d9){_0x4ad681['push'](_0x4ad681['shift']());}};_0x2c0e71(++_0x8b61bc);}(_0xfc7d,0x16a));var _0xdfc7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfc7d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xdfc7('0x0'));module[_0xdfc7('0x1')]={'name':{'type':Sequelize[_0xdfc7('0x2')],'allowNull':![],'unique':_0xdfc7('0x3')},'bankAccount':{'type':Sequelize['STRING']},'paymentType':{'type':Sequelize[_0xdfc7('0x2')]},'bankName':{'type':Sequelize['STRING']},'bankstreet':{'type':Sequelize[_0xdfc7('0x2')]},'bankpostalCode':{'type':Sequelize['STRING']},'bankcity':{'type':Sequelize[_0xdfc7('0x2')]},'bankcountry':{'type':Sequelize[_0xdfc7('0x2')]},'bankBICSWIFT':{'type':Sequelize[_0xdfc7('0x2')]},'bankIBAN':{'type':Sequelize[_0xdfc7('0x2')]},'bankABI':{'type':Sequelize['STRING']},'banckCAB':{'type':Sequelize['STRING']},'paypalEmail':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}}}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.controller.js b/server/api/saPaymentMethod/saPaymentMethod.controller.js index 57fbcaf..4f1199c 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.controller.js +++ b/server/api/saPaymentMethod/saPaymentMethod.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','SAPaymentMethod','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x5ba099,_0x16a8fe){var _0x384cbd=function(_0x4077f6){while(--_0x4077f6){_0x5ba099['push'](_0x5ba099['shift']());}};_0x384cbd(++_0x16a8fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['SAPaymentMethod'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SAPaymentMethod']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['SAPaymentMethod'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','SAPaymentMethod','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x535fa7,_0x3a9818){var _0x472f42=function(_0x129efe){while(--_0x129efe){_0x535fa7['push'](_0x535fa7['shift']());}};_0x472f42(++_0x3a9818);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['SAPaymentMethod'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SAPaymentMethod']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['SAPaymentMethod'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.model.js b/server/api/saPaymentMethod/saPaymentMethod.model.js index 21970ec..ae4e294 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.model.js +++ b/server/api/saPaymentMethod/saPaymentMethod.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5052=['request-promise','rimraf','../../config/environment','./saPaymentMethod.attributes','exports','SAPaymentMethod','sa_paymentMethods','lodash','../../config/logger','api','moment'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0x5052,0x130));var _0x2505=function(_0x5a9597,_0x48e55b){_0x5a9597=_0x5a9597-0x0;var _0x5b1e40=_0x5052[_0x5a9597];return _0x5b1e40;};'use strict';var _=require(_0x2505('0x0'));var util=require('util');var logger=require(_0x2505('0x1'))(_0x2505('0x2'));var moment=require(_0x2505('0x3'));var BPromise=require('bluebird');var rp=require(_0x2505('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2505('0x5'));var config=require(_0x2505('0x6'));var attributes=require(_0x2505('0x7'));module[_0x2505('0x8')]=function(_0x2f240b,_0xa9215c){return _0x2f240b['define'](_0x2505('0x9'),attributes,{'tableName':_0x2505('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c25=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./saPaymentMethod.attributes','exports','SAPaymentMethod','sa_paymentMethods'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c25,0xa5));var _0x54c2=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x4c25[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x54c2('0x0'));var util=require(_0x54c2('0x1'));var logger=require('../../config/logger')(_0x54c2('0x2'));var moment=require('moment');var BPromise=require(_0x54c2('0x3'));var rp=require(_0x54c2('0x4'));var fs=require('fs');var path=require(_0x54c2('0x5'));var rimraf=require('rimraf');var config=require(_0x54c2('0x6'));var attributes=require(_0x54c2('0x7'));module[_0x54c2('0x8')]=function(_0xe39f54,_0x279b05){return _0xe39f54['define'](_0x54c2('0x9'),attributes,{'tableName':_0x54c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.rpc.js b/server/api/saPaymentMethod/saPaymentMethod.rpc.js index 60b589c..0edc580 100644 --- a/server/api/saPaymentMethod/saPaymentMethod.rpc.js +++ b/server/api/saPaymentMethod/saPaymentMethod.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca67=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','SAPaymentMethod,\x20%s,\x20%s','debug','SAPaymentMethod,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment'];(function(_0x4fe1a6,_0x86a75d){var _0x36eaba=function(_0x2dd3d9){while(--_0x2dd3d9){_0x4fe1a6['push'](_0x4fe1a6['shift']());}};_0x36eaba(++_0x86a75d);}(_0xca67,0xcf));var _0x7ca6=function(_0x5ef8a6,_0xfc84d5){_0x5ef8a6=_0x5ef8a6-0x0;var _0x5c3972=_0xca67[_0x5ef8a6];return _0x5c3972;};'use strict';var _=require(_0x7ca6('0x0'));var util=require(_0x7ca6('0x1'));var moment=require(_0x7ca6('0x2'));var BPromise=require(_0x7ca6('0x3'));var rs=require(_0x7ca6('0x4'));var fs=require('fs');var Redis=require(_0x7ca6('0x5'));var db=require(_0x7ca6('0x6'))['db'];var utils=require(_0x7ca6('0x7'));var logger=require(_0x7ca6('0x8'))(_0x7ca6('0x9'));var config=require(_0x7ca6('0xa'));var jayson=require(_0x7ca6('0xb'));var client=jayson[_0x7ca6('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19700c,_0x320b1a,_0x2ca4b9){return new BPromise(function(_0x39ffa8,_0x4eb16a){return client['request'](_0x19700c,_0x2ca4b9)['then'](function(_0x283239){logger[_0x7ca6('0xd')](_0x7ca6('0xe'),_0x320b1a,'request\x20sent');logger[_0x7ca6('0xf')](_0x7ca6('0x10'),_0x320b1a,'request\x20sent',JSON['stringify'](_0x283239));if(_0x283239[_0x7ca6('0x11')]){if(_0x283239[_0x7ca6('0x11')]['code']===0x1f4){logger['error'](_0x7ca6('0xe'),_0x320b1a,_0x283239['error'][_0x7ca6('0x12')]);return _0x4eb16a(_0x283239[_0x7ca6('0x11')][_0x7ca6('0x12')]);}logger[_0x7ca6('0x11')]('SAPaymentMethod,\x20%s,\x20%s',_0x320b1a,_0x283239[_0x7ca6('0x11')]['message']);return _0x39ffa8(_0x283239[_0x7ca6('0x11')][_0x7ca6('0x12')]);}else{logger[_0x7ca6('0xd')](_0x7ca6('0xe'),_0x320b1a,'request\x20sent');_0x39ffa8(_0x283239[_0x7ca6('0x13')]['message']);}})[_0x7ca6('0x14')](function(_0x68837f){logger[_0x7ca6('0x11')](_0x7ca6('0xe'),_0x320b1a,_0x68837f);_0x4eb16a(_0x68837f);});});} \ No newline at end of file +var _0xe122=['request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','SAPaymentMethod,\x20%s,\x20%s','debug','SAPaymentMethod,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4a3936,_0x36830f){var _0x1ac5da=function(_0x3058a9){while(--_0x3058a9){_0x4a3936['push'](_0x4a3936['shift']());}};_0x1ac5da(++_0x36830f);}(_0xe122,0x156));var _0x2e12=function(_0x45066d,_0x12330c){_0x45066d=_0x45066d-0x0;var _0x5e1c7f=_0xe122[_0x45066d];return _0x5e1c7f;};'use strict';var _=require(_0x2e12('0x0'));var util=require('util');var moment=require(_0x2e12('0x1'));var BPromise=require(_0x2e12('0x2'));var rs=require(_0x2e12('0x3'));var fs=require('fs');var Redis=require(_0x2e12('0x4'));var db=require(_0x2e12('0x5'))['db'];var utils=require(_0x2e12('0x6'));var logger=require(_0x2e12('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e12('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545556,_0x126fb2,_0x549d5b){return new BPromise(function(_0x2a5511,_0x151b04){return client[_0x2e12('0x9')](_0x545556,_0x549d5b)[_0x2e12('0xa')](function(_0x49da60){logger[_0x2e12('0xb')](_0x2e12('0xc'),_0x126fb2,'request\x20sent');logger[_0x2e12('0xd')](_0x2e12('0xe'),_0x126fb2,'request\x20sent',JSON[_0x2e12('0xf')](_0x49da60));if(_0x49da60['error']){if(_0x49da60[_0x2e12('0x10')]['code']===0x1f4){logger['error'](_0x2e12('0xc'),_0x126fb2,_0x49da60['error'][_0x2e12('0x11')]);return _0x151b04(_0x49da60[_0x2e12('0x10')][_0x2e12('0x11')]);}logger[_0x2e12('0x10')](_0x2e12('0xc'),_0x126fb2,_0x49da60[_0x2e12('0x10')]['message']);return _0x2a5511(_0x49da60['error'][_0x2e12('0x11')]);}else{logger[_0x2e12('0xb')](_0x2e12('0xc'),_0x126fb2,_0x2e12('0x12'));_0x2a5511(_0x49da60[_0x2e12('0x13')][_0x2e12('0x11')]);}})['catch'](function(_0x4daa62){logger['error']('SAPaymentMethod,\x20%s,\x20%s',_0x126fb2,_0x4daa62);_0x151b04(_0x4daa62);});});} \ No newline at end of file diff --git a/server/api/saPriceList/index.js b/server/api/saPriceList/index.js index 2765203..36fc362 100644 --- a/server/api/saPriceList/index.js +++ b/server/api/saPriceList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0af=['util','path','connect-timeout','express','Router','../../components/interaction/service','./saPriceList.controller','isAuthenticated','/describe','describe','/:id','show','getProducts','create','/:id/clone','clone','/:id/products','addProduct','update','delete','destroy','multer'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0xe0af,0x1e3));var _0xfe0a=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xe0af[_0x2b8077];return _0x308091;};'use strict';var multer=require(_0xfe0a('0x0'));var util=require(_0xfe0a('0x1'));var path=require(_0xfe0a('0x2'));var timeout=require(_0xfe0a('0x3'));var express=require(_0xfe0a('0x4'));var router=express[_0xfe0a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfe0a('0x6'));var config=require('../../config/environment');var controller=require(_0xfe0a('0x7'));router['get']('/',auth[_0xfe0a('0x8')](),controller['index']);router['get'](_0xfe0a('0x9'),auth[_0xfe0a('0x8')](),controller[_0xfe0a('0xa')]);router['get'](_0xfe0a('0xb'),auth['isAuthenticated'](),controller[_0xfe0a('0xc')]);router['get']('/:id/products',auth[_0xfe0a('0x8')](),controller[_0xfe0a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfe0a('0xe')]);router['post'](_0xfe0a('0xf'),auth[_0xfe0a('0x8')](),controller[_0xfe0a('0x10')]);router['post'](_0xfe0a('0x11'),auth['isAuthenticated'](),controller[_0xfe0a('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfe0a('0x13')]);router[_0xfe0a('0x14')](_0xfe0a('0xb'),auth[_0xfe0a('0x8')](),controller[_0xfe0a('0x15')]);router[_0xfe0a('0x14')](_0xfe0a('0x11'),auth[_0xfe0a('0x8')](),controller['removeProducts']);module['exports']=router; \ No newline at end of file +var _0xba6f=['show','/:id/products','getProducts','create','post','/:id/clone','clone','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x252314,_0x550148){var _0x48985d=function(_0x29cbb8){while(--_0x29cbb8){_0x252314['push'](_0x252314['shift']());}};_0x48985d(++_0x550148);}(_0xba6f,0x1bf));var _0xfba6=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0xba6f[_0x1be790];return _0x7668c8;};'use strict';var multer=require('multer');var util=require(_0xfba6('0x0'));var path=require(_0xfba6('0x1'));var timeout=require(_0xfba6('0x2'));var express=require(_0xfba6('0x3'));var router=express[_0xfba6('0x4')]();var auth=require(_0xfba6('0x5'));var interaction=require(_0xfba6('0x6'));var config=require('../../config/environment');var controller=require('./saPriceList.controller');router[_0xfba6('0x7')]('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0x9')]);router[_0xfba6('0x7')](_0xfba6('0xa'),auth[_0xfba6('0x8')](),controller[_0xfba6('0xb')]);router['get'](_0xfba6('0xc'),auth[_0xfba6('0x8')](),controller[_0xfba6('0xd')]);router['get'](_0xfba6('0xe'),auth['isAuthenticated'](),controller[_0xfba6('0xf')]);router['post']('/',auth[_0xfba6('0x8')](),controller[_0xfba6('0x10')]);router[_0xfba6('0x11')](_0xfba6('0x12'),auth[_0xfba6('0x8')](),controller[_0xfba6('0x13')]);router[_0xfba6('0x11')]('/:id/products',auth['isAuthenticated'](),controller['addProduct']);router[_0xfba6('0x14')](_0xfba6('0xc'),auth[_0xfba6('0x8')](),controller[_0xfba6('0x15')]);router[_0xfba6('0x16')](_0xfba6('0xc'),auth[_0xfba6('0x8')](),controller['destroy']);router[_0xfba6('0x16')](_0xfba6('0xe'),auth[_0xfba6('0x8')](),controller['removeProducts']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.attributes.js b/server/api/saPriceList/saPriceList.attributes.js index b7a5ca5..7af66b2 100644 --- a/server/api/saPriceList/saPriceList.attributes.js +++ b/server/api/saPriceList/saPriceList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe325=['name','TEXT','DATE','sequelize','exports','STRING'];(function(_0x2ab555,_0x279e2f){var _0x560ea6=function(_0x2f3434){while(--_0x2f3434){_0x2ab555['push'](_0x2ab555['shift']());}};_0x560ea6(++_0x279e2f);}(_0xe325,0x75));var _0x5e32=function(_0x1a1460,_0x539531){_0x1a1460=_0x1a1460-0x0;var _0x33ab03=_0xe325[_0x1a1460];return _0x33ab03;};'use strict';var Sequelize=require(_0x5e32('0x0'));module[_0x5e32('0x1')]={'name':{'type':Sequelize[_0x5e32('0x2')],'allowNull':![],'unique':_0x5e32('0x3')},'description':{'type':Sequelize[_0x5e32('0x4')],'allowNull':!![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize['DATE'],'allowNull':!![]},'endAt':{'type':Sequelize[_0x5e32('0x5')],'allowNull':!![]}}; \ No newline at end of file +var _0x22c2=['STRING','name','TEXT','DECIMAL','DATE','exports'];(function(_0x5cd7de,_0x5b98c2){var _0x56cf27=function(_0x19d3fa){while(--_0x19d3fa){_0x5cd7de['push'](_0x5cd7de['shift']());}};_0x56cf27(++_0x5b98c2);}(_0x22c2,0x77));var _0x222c=function(_0x27e19d,_0x3af633){_0x27e19d=_0x27e19d-0x0;var _0x33588f=_0x22c2[_0x27e19d];return _0x33588f;};'use strict';var Sequelize=require('sequelize');module[_0x222c('0x0')]={'name':{'type':Sequelize[_0x222c('0x1')],'allowNull':![],'unique':_0x222c('0x2')},'description':{'type':Sequelize[_0x222c('0x3')],'allowNull':!![]},'discount':{'type':Sequelize[_0x222c('0x4')](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize[_0x222c('0x5')],'allowNull':!![]},'endAt':{'type':Sequelize['DATE'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.controller.js b/server/api/saPriceList/saPriceList.controller.js index 6db949e..1856c9c 100644 --- a/server/api/saPriceList/saPriceList.controller.js +++ b/server/api/saPriceList/saPriceList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc27=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','SAPriceList','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','count','includeAll','include','CmCompany','company','findAll','rows','catch','show','options','find','create','body','clone','params','omit','createdAt','updatedAt','describe','getProducts','findOne','SAProductPricesList','PriceListId','SAProduct','Product','Pricelist','addProduct','removeProducts','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv'];(function(_0x34613,_0x5c6da8){var _0x3fd314=function(_0x32e845){while(--_0x32e845){_0x34613['push'](_0x34613['shift']());}};_0x3fd314(++_0x5c6da8);}(_0xbc27,0x1b8));var _0x7bc2=function(_0xcd0cba,_0x50d5ef){_0xcd0cba=_0xcd0cba-0x0;var _0x27be30=_0xbc27[_0xcd0cba];return _0x27be30;};'use strict';var pdf=require(_0x7bc2('0x0'));var emlformat=require(_0x7bc2('0x1'));var rimraf=require(_0x7bc2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7bc2('0x3'));var moment=require(_0x7bc2('0x4'));var BPromise=require(_0x7bc2('0x5'));var Mustache=require(_0x7bc2('0x6'));var util=require(_0x7bc2('0x7'));var path=require(_0x7bc2('0x8'));var sox=require(_0x7bc2('0x9'));var csv=require('to-csv');var ejs=require(_0x7bc2('0xa'));var fs=require('fs');var _=require(_0x7bc2('0xb'));var squel=require(_0x7bc2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7bc2('0xd'));var toCsv=require(_0x7bc2('0xe'));var querystring=require('querystring');var Papa=require(_0x7bc2('0xf'));var Redis=require(_0x7bc2('0x10'));var authService=require(_0x7bc2('0x11'));var qs=require(_0x7bc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bc2('0x13'))(_0x7bc2('0x14'));var utils=require('../../config/utils');var config=require(_0x7bc2('0x15'));var db=require(_0x7bc2('0x16'))['db'];function respondWithStatusCode(_0x5c2ec2,_0x194205){_0x194205=_0x194205||0xcc;return function(_0x532f04){if(_0x532f04){return _0x5c2ec2[_0x7bc2('0x17')](_0x194205);}return _0x5c2ec2[_0x7bc2('0x18')](_0x194205)['end']();};}function respondWithResult(_0x4aeb65,_0x135be3){_0x135be3=_0x135be3||0xc8;return function(_0xecd08a){if(_0xecd08a){return _0x4aeb65[_0x7bc2('0x18')](_0x135be3)[_0x7bc2('0x19')](_0xecd08a);}};}function respondWithFilteredResult(_0x208dd5,_0x16295b){return function(_0x5d79c3){if(_0x5d79c3){var _0x109f15=_0x5d79c3['count'],_0x548466=_0x16295b[_0x7bc2('0x1a')],_0x2338bb=_0x16295b[_0x7bc2('0x1a')]+_0x16295b[_0x7bc2('0x1b')],_0x1496a5;if(_0x2338bb>=_0x109f15){_0x2338bb=_0x109f15;_0x1496a5=0xc8;}else{_0x1496a5=0xce;}_0x208dd5['status'](_0x1496a5);return _0x208dd5[_0x7bc2('0x1c')]('Content-Range',_0x548466+'-'+_0x2338bb+'/'+_0x109f15)[_0x7bc2('0x19')](_0x5d79c3);}return null;};}function patchUpdates(_0x157e70){return function(_0x1415a5){try{jsonpatch[_0x7bc2('0x1d')](_0x1415a5,_0x157e70,!![]);}catch(_0x5b88bd){return BPromise[_0x7bc2('0x1e')](_0x5b88bd);}return _0x1415a5[_0x7bc2('0x1f')]();};}function saveUpdates(_0x11d67c,_0x4b32fe){return function(_0x3462c6){if(_0x3462c6){return _0x3462c6[_0x7bc2('0x20')](_0x11d67c)[_0x7bc2('0x21')](function(_0x2ef2bb){return _0x2ef2bb;});}return null;};}function removeEntity(_0x20b3c4,_0x60d6ca){return function(_0x3a7df0){if(_0x3a7df0){return _0x3a7df0[_0x7bc2('0x22')]()[_0x7bc2('0x21')](function(){_0x20b3c4[_0x7bc2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0224,_0x4eb96f){return function(_0x58a778){if(!_0x58a778){_0x5d0224[_0x7bc2('0x17')](0x194);}return _0x58a778;};}function handleError(_0x454729,_0x44c004){_0x44c004=_0x44c004||0x1f4;return function(_0x39024a){logger[_0x7bc2('0x23')](_0x39024a[_0x7bc2('0x24')]);if(_0x39024a[_0x7bc2('0x25')]){delete _0x39024a[_0x7bc2('0x25')];}_0x454729[_0x7bc2('0x18')](_0x44c004)[_0x7bc2('0x26')](_0x39024a);};}exports[_0x7bc2('0x27')]=function(_0x546279,_0x2d8d05){var _0x223eaf={},_0x2020f6={},_0x323b69={'count':0x0,'rows':[]};var _0x3e74ad=db[_0x7bc2('0x28')][_0x7bc2('0x29')];_0x2020f6[_0x7bc2('0x2a')]=_['keys'](_0x3e74ad);_0x2020f6['query']=_[_0x7bc2('0x2b')](_0x546279[_0x7bc2('0x2c')]);_0x2020f6[_0x7bc2('0x2d')]=_[_0x7bc2('0x2e')](_0x2020f6['model'],_0x2020f6[_0x7bc2('0x2c')]);_0x223eaf[_0x7bc2('0x2f')]=_['intersection'](_0x2020f6['model'],qs[_0x7bc2('0x30')](_0x546279['query'][_0x7bc2('0x30')]));_0x223eaf['attributes']=_0x223eaf[_0x7bc2('0x2f')][_0x7bc2('0x31')]?_0x223eaf[_0x7bc2('0x2f')]:_0x2020f6[_0x7bc2('0x2a')];if(!_0x546279[_0x7bc2('0x2c')][_0x7bc2('0x32')](_0x7bc2('0x33'))){_0x223eaf[_0x7bc2('0x1b')]=qs[_0x7bc2('0x1b')](_0x546279[_0x7bc2('0x2c')][_0x7bc2('0x1b')]);_0x223eaf[_0x7bc2('0x1a')]=qs[_0x7bc2('0x1a')](_0x546279[_0x7bc2('0x2c')]['offset']);}_0x223eaf[_0x7bc2('0x34')]=qs[_0x7bc2('0x35')](_0x546279['query'][_0x7bc2('0x35')]);_0x223eaf[_0x7bc2('0x36')]=qs[_0x7bc2('0x2d')](_[_0x7bc2('0x37')](_0x546279[_0x7bc2('0x2c')],_0x2020f6[_0x7bc2('0x2d')]));if(_0x546279[_0x7bc2('0x2c')][_0x7bc2('0x38')]){_0x223eaf[_0x7bc2('0x36')]=_['merge'](_0x223eaf[_0x7bc2('0x36')],{'$or':_[_0x7bc2('0x39')](_0x3e74ad,function(_0x220c15){if(_0x220c15[_0x7bc2('0x3a')][_0x7bc2('0x3b')]!==_0x7bc2('0x3c')){var _0x5ed852={};_0x5ed852[_0x220c15[_0x7bc2('0x3d')]]={'$like':'%'+_0x546279[_0x7bc2('0x2c')][_0x7bc2('0x38')]+'%'};return _0x5ed852;}})});}_0x223eaf=_[_0x7bc2('0x3e')]({},_0x223eaf,_0x546279['options']);var _0x45669e={'where':_0x223eaf[_0x7bc2('0x36')]};return db[_0x7bc2('0x28')][_0x7bc2('0x3f')](_0x45669e)[_0x7bc2('0x21')](function(_0x2e4e34){_0x323b69[_0x7bc2('0x3f')]=_0x2e4e34;if(_0x546279[_0x7bc2('0x2c')][_0x7bc2('0x40')]){_0x223eaf[_0x7bc2('0x41')]=[{'model':db[_0x7bc2('0x42')],'as':_0x7bc2('0x43')}];}return db[_0x7bc2('0x28')][_0x7bc2('0x44')](_0x223eaf);})[_0x7bc2('0x21')](function(_0x52a62a){_0x323b69[_0x7bc2('0x45')]=_0x52a62a;return _0x323b69;})[_0x7bc2('0x21')](respondWithFilteredResult(_0x2d8d05,_0x223eaf))[_0x7bc2('0x46')](handleError(_0x2d8d05,null));};exports[_0x7bc2('0x47')]=function(_0x12c0c8,_0x3398f2){var _0x91cbce={'raw':![],'where':{'id':_0x12c0c8['params']['id']}},_0x18b516={};_0x18b516['model']=_['keys'](db['SAPriceList'][_0x7bc2('0x29')]);_0x18b516[_0x7bc2('0x2c')]=_[_0x7bc2('0x2b')](_0x12c0c8[_0x7bc2('0x2c')]);_0x18b516['filters']=_[_0x7bc2('0x2e')](_0x18b516[_0x7bc2('0x2a')],_0x18b516[_0x7bc2('0x2c')]);_0x91cbce[_0x7bc2('0x2f')]=_[_0x7bc2('0x2e')](_0x18b516[_0x7bc2('0x2a')],qs[_0x7bc2('0x30')](_0x12c0c8['query'][_0x7bc2('0x30')]));_0x91cbce[_0x7bc2('0x2f')]=_0x91cbce[_0x7bc2('0x2f')][_0x7bc2('0x31')]?_0x91cbce[_0x7bc2('0x2f')]:_0x18b516[_0x7bc2('0x2a')];if(_0x12c0c8[_0x7bc2('0x2c')][_0x7bc2('0x40')]){_0x91cbce[_0x7bc2('0x41')]=[{'all':!![]}];}_0x91cbce=_[_0x7bc2('0x3e')]({},_0x91cbce,_0x12c0c8[_0x7bc2('0x48')]);return db[_0x7bc2('0x28')][_0x7bc2('0x49')](_0x91cbce)['then'](handleEntityNotFound(_0x3398f2,null))[_0x7bc2('0x21')](respondWithResult(_0x3398f2,null))[_0x7bc2('0x46')](handleError(_0x3398f2,null));};exports[_0x7bc2('0x4a')]=function(_0x49f34d,_0x343f8b){return db[_0x7bc2('0x28')][_0x7bc2('0x4a')](_0x49f34d[_0x7bc2('0x4b')],{})[_0x7bc2('0x21')](respondWithResult(_0x343f8b,0xc9))[_0x7bc2('0x46')](handleError(_0x343f8b,null));};exports[_0x7bc2('0x4c')]=function(_0x4d6095,_0x390552){var _0x53067b={'raw':![],'where':{'id':_0x4d6095[_0x7bc2('0x4d')]['id']}},_0x1ad721={};_0x1ad721[_0x7bc2('0x2a')]=_[_0x7bc2('0x2b')](db['SAPriceList'][_0x7bc2('0x29')]);_0x53067b['attributes']=_[_0x7bc2('0x2e')](_0x1ad721['model'],qs[_0x7bc2('0x30')](_0x4d6095['query']['fields']));_0x53067b[_0x7bc2('0x2f')]=_0x53067b[_0x7bc2('0x2f')][_0x7bc2('0x31')]?_0x53067b[_0x7bc2('0x2f')]:_0x1ad721['model'];if(_0x4d6095['query']['includeAll']){_0x53067b[_0x7bc2('0x41')]=[{'all':!![]}];}_0x53067b=_[_0x7bc2('0x3e')]({},_0x53067b,_0x4d6095['options']);return db['SAPriceList'][_0x7bc2('0x49')](_0x53067b)['then'](handleEntityNotFound(_0x390552,null))[_0x7bc2('0x21')](function(_0x6bcaf0){if(_0x6bcaf0){var _0xfd08e2=_0x6bcaf0['get']({'plain':!![]});_0xfd08e2=qs[_0x7bc2('0x4e')](_0xfd08e2,['id',_0x7bc2('0x4f'),_0x7bc2('0x50')]);_0x4d6095[_0x7bc2('0x4b')]=_[_0x7bc2('0x4e')](_0x4d6095['body'],['id','createdAt',_0x7bc2('0x50')]);return db[_0x7bc2('0x28')]['create'](_[_0x7bc2('0x3e')](_0xfd08e2,_0x4d6095[_0x7bc2('0x4b')]),{'include':_0x4d6095['query'][_0x7bc2('0x40')]?[{'all':!![]}]:undefined});}})[_0x7bc2('0x21')](respondWithResult(_0x390552,0xc9))[_0x7bc2('0x46')](handleError(_0x390552,null));};exports[_0x7bc2('0x20')]=function(_0x5d4339,_0x547065){if(_0x5d4339[_0x7bc2('0x4b')]['id']){delete _0x5d4339[_0x7bc2('0x4b')]['id'];}return db[_0x7bc2('0x28')][_0x7bc2('0x49')]({'where':{'id':_0x5d4339['params']['id']}})[_0x7bc2('0x21')](handleEntityNotFound(_0x547065,null))[_0x7bc2('0x21')](saveUpdates(_0x5d4339[_0x7bc2('0x4b')],null))['then'](respondWithResult(_0x547065,null))[_0x7bc2('0x46')](handleError(_0x547065,null));};exports[_0x7bc2('0x22')]=function(_0x8f706,_0x27f5cf){return db[_0x7bc2('0x28')][_0x7bc2('0x49')]({'where':{'id':_0x8f706[_0x7bc2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27f5cf,null))['then'](removeEntity(_0x27f5cf,null))[_0x7bc2('0x46')](handleError(_0x27f5cf,null));};exports['describe']=function(_0x2310a8,_0x5a89e3){return db[_0x7bc2('0x28')][_0x7bc2('0x51')]()[_0x7bc2('0x21')](respondWithResult(_0x5a89e3,null))[_0x7bc2('0x46')](handleError(_0x5a89e3,null));};exports[_0x7bc2('0x52')]=function(_0x290923,_0x2f5381,_0x18f7c3){var _0x5a3e14={'raw':![],'where':{}};var _0x89a5cb={};var _0x46b967={'count':0x0,'rows':[]};return db['SAPriceList'][_0x7bc2('0x53')]({'where':{'id':_0x290923['params']['id']}})[_0x7bc2('0x21')](handleEntityNotFound(_0x2f5381,null))[_0x7bc2('0x21')](function(_0x3a2010){if(_0x3a2010){_0x89a5cb[_0x7bc2('0x2a')]=_[_0x7bc2('0x2b')](db[_0x7bc2('0x54')]['rawAttributes']);_0x89a5cb[_0x7bc2('0x2c')]=_[_0x7bc2('0x2b')](_0x290923['query']);_0x89a5cb[_0x7bc2('0x2d')]=_[_0x7bc2('0x2e')](_0x89a5cb[_0x7bc2('0x2a')],_0x89a5cb[_0x7bc2('0x2c')]);_0x5a3e14[_0x7bc2('0x2f')]=_[_0x7bc2('0x2e')](_0x89a5cb[_0x7bc2('0x2a')],qs[_0x7bc2('0x30')](_0x290923[_0x7bc2('0x2c')][_0x7bc2('0x30')]));_0x5a3e14[_0x7bc2('0x2f')]=_0x5a3e14['attributes'][_0x7bc2('0x31')]?_0x5a3e14[_0x7bc2('0x2f')]:_0x89a5cb[_0x7bc2('0x2a')];if(!_0x290923['query'][_0x7bc2('0x32')]('nolimit')){_0x5a3e14[_0x7bc2('0x1b')]=qs[_0x7bc2('0x1b')](_0x290923[_0x7bc2('0x2c')][_0x7bc2('0x1b')]);_0x5a3e14[_0x7bc2('0x1a')]=qs[_0x7bc2('0x1a')](_0x290923[_0x7bc2('0x2c')]['offset']);}_0x5a3e14[_0x7bc2('0x34')]=qs[_0x7bc2('0x35')](_0x290923['query'][_0x7bc2('0x35')]);_0x5a3e14[_0x7bc2('0x36')]=qs[_0x7bc2('0x2d')](_[_0x7bc2('0x37')](_0x290923[_0x7bc2('0x2c')],_0x89a5cb[_0x7bc2('0x2d')]));_0x5a3e14[_0x7bc2('0x36')][_0x7bc2('0x55')]=_0x3a2010['id'];if(_0x290923['query'][_0x7bc2('0x38')]){_0x5a3e14[_0x7bc2('0x36')]=_[_0x7bc2('0x3e')](_0x5a3e14[_0x7bc2('0x36')],{'$or':_[_0x7bc2('0x39')](_0x5a3e14[_0x7bc2('0x2f')],function(_0x1b4e81){var _0x59f3c4={};_0x59f3c4[_0x1b4e81]={'$like':'%'+_0x290923['query'][_0x7bc2('0x38')]+'%'};return _0x59f3c4;})});}_0x5a3e14=_[_0x7bc2('0x3e')]({},_0x5a3e14,_0x290923[_0x7bc2('0x48')]);return db[_0x7bc2('0x54')]['count']({'where':_0x5a3e14[_0x7bc2('0x36')]})[_0x7bc2('0x21')](function(_0x34245a){_0x46b967['count']=_0x34245a;if(_0x290923[_0x7bc2('0x2c')]['includeAll']){_0x5a3e14[_0x7bc2('0x41')]=[{'model':db[_0x7bc2('0x56')],'as':_0x7bc2('0x57'),'include':[{'all':!![]}]},{'model':db[_0x7bc2('0x28')],'as':_0x7bc2('0x58')}];}return db['SAProductPricesList'][_0x7bc2('0x44')](_0x5a3e14);})[_0x7bc2('0x21')](function(_0x11241f){_0x46b967[_0x7bc2('0x45')]=_0x11241f;return _0x46b967;});}})['then'](respondWithFilteredResult(_0x2f5381,_0x5a3e14))['catch'](handleError(_0x2f5381,null));};exports[_0x7bc2('0x59')]=function(_0x1ab501,_0x30db22,_0x2b4ac4){if(_0x1ab501[_0x7bc2('0x4b')]['id']){delete _0x1ab501[_0x7bc2('0x4b')]['id'];}return db[_0x7bc2('0x28')][_0x7bc2('0x49')]({'where':{'id':_0x1ab501[_0x7bc2('0x4d')]['id']}})[_0x7bc2('0x21')](handleEntityNotFound(_0x30db22,null))['then'](function(_0x1b4841){if(_0x1b4841){_0x1ab501[_0x7bc2('0x4b')]['PriceListId']=_0x1b4841['id'];return db[_0x7bc2('0x54')][_0x7bc2('0x4a')](_0x1ab501[_0x7bc2('0x4b')]);}})['then'](respondWithResult(_0x30db22,null))['catch'](handleError(_0x30db22,null));};exports[_0x7bc2('0x5a')]=function(_0x57f7a3,_0x12d53d,_0x6a8346){return db[_0x7bc2('0x54')][_0x7bc2('0x49')]({'where':{'id':_0x57f7a3['params']['id']}})[_0x7bc2('0x21')](handleEntityNotFound(_0x12d53d,null))[_0x7bc2('0x21')](function(_0x11076e){if(_0x11076e){return _0x11076e['removeProducts'](_0x57f7a3['query']['ids']);}})['then'](respondWithStatusCode(_0x12d53d,null))[_0x7bc2('0x46')](handleError(_0x12d53d,null));}; \ No newline at end of file +var _0xe47a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','map','type','key','field','options','includeAll','company','findAll','catch','show','params','include','merge','find','create','body','get','omit','createdAt','updatedAt','destroy','describe','getProducts','findOne','SAProductPricesList','pick','PriceListId','Product','Pricelist','addProduct','removeProducts','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','SAPriceList','rawAttributes','model','query','keys'];(function(_0x500af7,_0xb1c4f){var _0xa479b1=function(_0x3fb707){while(--_0x3fb707){_0x500af7['push'](_0x500af7['shift']());}};_0xa479b1(++_0xb1c4f);}(_0xe47a,0x1be));var _0xae47=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe47a[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xae47('0x0'));var emlformat=require(_0xae47('0x1'));var rimraf=require(_0xae47('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xae47('0x3'));var moment=require(_0xae47('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae47('0x5'));var util=require('util');var path=require(_0xae47('0x6'));var sox=require(_0xae47('0x7'));var csv=require(_0xae47('0x8'));var ejs=require(_0xae47('0x9'));var fs=require('fs');var _=require(_0xae47('0xa'));var squel=require('squel');var crypto=require(_0xae47('0xb'));var jsforce=require(_0xae47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xae47('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xae47('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xae47('0xe'));var logger=require('../../config/logger')(_0xae47('0xf'));var utils=require('../../config/utils');var config=require(_0xae47('0x10'));var db=require(_0xae47('0x11'))['db'];function respondWithStatusCode(_0x53fdfb,_0xe458f8){_0xe458f8=_0xe458f8||0xcc;return function(_0x2317d3){if(_0x2317d3){return _0x53fdfb[_0xae47('0x12')](_0xe458f8);}return _0x53fdfb[_0xae47('0x13')](_0xe458f8)['end']();};}function respondWithResult(_0x1e3ef6,_0x55e680){_0x55e680=_0x55e680||0xc8;return function(_0x3a161c){if(_0x3a161c){return _0x1e3ef6[_0xae47('0x13')](_0x55e680)['json'](_0x3a161c);}};}function respondWithFilteredResult(_0x417561,_0x53d51b){return function(_0x2b1bf1){if(_0x2b1bf1){var _0xc2874d=_0x2b1bf1[_0xae47('0x14')],_0x4b1bdf=_0x53d51b['offset'],_0x126b0b=_0x53d51b[_0xae47('0x15')]+_0x53d51b[_0xae47('0x16')],_0x27aa17;if(_0x126b0b>=_0xc2874d){_0x126b0b=_0xc2874d;_0x27aa17=0xc8;}else{_0x27aa17=0xce;}_0x417561[_0xae47('0x13')](_0x27aa17);return _0x417561['set'](_0xae47('0x17'),_0x4b1bdf+'-'+_0x126b0b+'/'+_0xc2874d)[_0xae47('0x18')](_0x2b1bf1);}return null;};}function patchUpdates(_0x483cb6){return function(_0x153586){try{jsonpatch[_0xae47('0x19')](_0x153586,_0x483cb6,!![]);}catch(_0x12c2a4){return BPromise['reject'](_0x12c2a4);}return _0x153586[_0xae47('0x1a')]();};}function saveUpdates(_0x4752c9,_0x30e25a){return function(_0x28204a){if(_0x28204a){return _0x28204a[_0xae47('0x1b')](_0x4752c9)[_0xae47('0x1c')](function(_0x5a4cef){return _0x5a4cef;});}return null;};}function removeEntity(_0x4cb0fe,_0x2192e5){return function(_0x1b8706){if(_0x1b8706){return _0x1b8706['destroy']()['then'](function(){_0x4cb0fe[_0xae47('0x13')](0xcc)[_0xae47('0x1d')]();});}};}function handleEntityNotFound(_0xe8e025,_0xde07ff){return function(_0x71a852){if(!_0x71a852){_0xe8e025['sendStatus'](0x194);}return _0x71a852;};}function handleError(_0x2ccbde,_0x34286a){_0x34286a=_0x34286a||0x1f4;return function(_0x12b0ee){logger[_0xae47('0x1e')](_0x12b0ee[_0xae47('0x1f')]);if(_0x12b0ee[_0xae47('0x20')]){delete _0x12b0ee[_0xae47('0x20')];}_0x2ccbde[_0xae47('0x13')](_0x34286a)[_0xae47('0x21')](_0x12b0ee);};}exports[_0xae47('0x22')]=function(_0x4bd90c,_0x360008){var _0x3f1214={},_0x4b8f65={},_0x2ea9a0={'count':0x0,'rows':[]};var _0x34d838=db[_0xae47('0x23')][_0xae47('0x24')];_0x4b8f65[_0xae47('0x25')]=_['keys'](_0x34d838);_0x4b8f65[_0xae47('0x26')]=_[_0xae47('0x27')](_0x4bd90c[_0xae47('0x26')]);_0x4b8f65['filters']=_[_0xae47('0x28')](_0x4b8f65[_0xae47('0x25')],_0x4b8f65[_0xae47('0x26')]);_0x3f1214[_0xae47('0x29')]=_['intersection'](_0x4b8f65[_0xae47('0x25')],qs[_0xae47('0x2a')](_0x4bd90c[_0xae47('0x26')][_0xae47('0x2a')]));_0x3f1214[_0xae47('0x29')]=_0x3f1214[_0xae47('0x29')][_0xae47('0x2b')]?_0x3f1214[_0xae47('0x29')]:_0x4b8f65[_0xae47('0x25')];if(!_0x4bd90c['query'][_0xae47('0x2c')](_0xae47('0x2d'))){_0x3f1214[_0xae47('0x16')]=qs[_0xae47('0x16')](_0x4bd90c[_0xae47('0x26')][_0xae47('0x16')]);_0x3f1214['offset']=qs[_0xae47('0x15')](_0x4bd90c[_0xae47('0x26')][_0xae47('0x15')]);}_0x3f1214['order']=qs[_0xae47('0x2e')](_0x4bd90c[_0xae47('0x26')]['sort']);_0x3f1214['where']=qs[_0xae47('0x2f')](_['pick'](_0x4bd90c['query'],_0x4b8f65['filters']));if(_0x4bd90c[_0xae47('0x26')][_0xae47('0x30')]){_0x3f1214[_0xae47('0x31')]=_['merge'](_0x3f1214[_0xae47('0x31')],{'$or':_[_0xae47('0x32')](_0x34d838,function(_0x437371){if(_0x437371[_0xae47('0x33')][_0xae47('0x34')]!=='VIRTUAL'){var _0x269901={};_0x269901[_0x437371[_0xae47('0x35')]]={'$like':'%'+_0x4bd90c[_0xae47('0x26')]['filter']+'%'};return _0x269901;}})});}_0x3f1214=_['merge']({},_0x3f1214,_0x4bd90c[_0xae47('0x36')]);var _0x1e757a={'where':_0x3f1214[_0xae47('0x31')]};return db[_0xae47('0x23')][_0xae47('0x14')](_0x1e757a)[_0xae47('0x1c')](function(_0x2bbdca){_0x2ea9a0[_0xae47('0x14')]=_0x2bbdca;if(_0x4bd90c[_0xae47('0x26')][_0xae47('0x37')]){_0x3f1214['include']=[{'model':db['CmCompany'],'as':_0xae47('0x38')}];}return db[_0xae47('0x23')][_0xae47('0x39')](_0x3f1214);})[_0xae47('0x1c')](function(_0x495ec6){_0x2ea9a0['rows']=_0x495ec6;return _0x2ea9a0;})[_0xae47('0x1c')](respondWithFilteredResult(_0x360008,_0x3f1214))[_0xae47('0x3a')](handleError(_0x360008,null));};exports[_0xae47('0x3b')]=function(_0x277a68,_0x2f2327){var _0x3d0f8c={'raw':![],'where':{'id':_0x277a68[_0xae47('0x3c')]['id']}},_0x148c56={};_0x148c56[_0xae47('0x25')]=_['keys'](db[_0xae47('0x23')][_0xae47('0x24')]);_0x148c56[_0xae47('0x26')]=_[_0xae47('0x27')](_0x277a68[_0xae47('0x26')]);_0x148c56['filters']=_[_0xae47('0x28')](_0x148c56[_0xae47('0x25')],_0x148c56[_0xae47('0x26')]);_0x3d0f8c[_0xae47('0x29')]=_[_0xae47('0x28')](_0x148c56['model'],qs[_0xae47('0x2a')](_0x277a68[_0xae47('0x26')][_0xae47('0x2a')]));_0x3d0f8c[_0xae47('0x29')]=_0x3d0f8c['attributes'][_0xae47('0x2b')]?_0x3d0f8c[_0xae47('0x29')]:_0x148c56[_0xae47('0x25')];if(_0x277a68['query'][_0xae47('0x37')]){_0x3d0f8c[_0xae47('0x3d')]=[{'all':!![]}];}_0x3d0f8c=_[_0xae47('0x3e')]({},_0x3d0f8c,_0x277a68[_0xae47('0x36')]);return db[_0xae47('0x23')][_0xae47('0x3f')](_0x3d0f8c)[_0xae47('0x1c')](handleEntityNotFound(_0x2f2327,null))['then'](respondWithResult(_0x2f2327,null))[_0xae47('0x3a')](handleError(_0x2f2327,null));};exports['create']=function(_0xb2c474,_0x47bd2e){return db['SAPriceList'][_0xae47('0x40')](_0xb2c474[_0xae47('0x41')],{})['then'](respondWithResult(_0x47bd2e,0xc9))[_0xae47('0x3a')](handleError(_0x47bd2e,null));};exports['clone']=function(_0x2b1f7f,_0x1a069f){var _0x38f78c={'raw':![],'where':{'id':_0x2b1f7f[_0xae47('0x3c')]['id']}},_0x5ea2fa={};_0x5ea2fa[_0xae47('0x25')]=_[_0xae47('0x27')](db[_0xae47('0x23')][_0xae47('0x24')]);_0x38f78c['attributes']=_[_0xae47('0x28')](_0x5ea2fa[_0xae47('0x25')],qs['fields'](_0x2b1f7f['query'][_0xae47('0x2a')]));_0x38f78c[_0xae47('0x29')]=_0x38f78c['attributes'][_0xae47('0x2b')]?_0x38f78c['attributes']:_0x5ea2fa[_0xae47('0x25')];if(_0x2b1f7f[_0xae47('0x26')]['includeAll']){_0x38f78c['include']=[{'all':!![]}];}_0x38f78c=_[_0xae47('0x3e')]({},_0x38f78c,_0x2b1f7f['options']);return db[_0xae47('0x23')][_0xae47('0x3f')](_0x38f78c)[_0xae47('0x1c')](handleEntityNotFound(_0x1a069f,null))['then'](function(_0x185d16){if(_0x185d16){var _0x4ee024=_0x185d16[_0xae47('0x42')]({'plain':!![]});_0x4ee024=qs[_0xae47('0x43')](_0x4ee024,['id',_0xae47('0x44'),_0xae47('0x45')]);_0x2b1f7f[_0xae47('0x41')]=_[_0xae47('0x43')](_0x2b1f7f[_0xae47('0x41')],['id',_0xae47('0x44'),_0xae47('0x45')]);return db['SAPriceList'][_0xae47('0x40')](_[_0xae47('0x3e')](_0x4ee024,_0x2b1f7f['body']),{'include':_0x2b1f7f[_0xae47('0x26')][_0xae47('0x37')]?[{'all':!![]}]:undefined});}})[_0xae47('0x1c')](respondWithResult(_0x1a069f,0xc9))['catch'](handleError(_0x1a069f,null));};exports[_0xae47('0x1b')]=function(_0xfc6a8,_0x599fb6){if(_0xfc6a8['body']['id']){delete _0xfc6a8[_0xae47('0x41')]['id'];}return db[_0xae47('0x23')][_0xae47('0x3f')]({'where':{'id':_0xfc6a8[_0xae47('0x3c')]['id']}})['then'](handleEntityNotFound(_0x599fb6,null))['then'](saveUpdates(_0xfc6a8[_0xae47('0x41')],null))[_0xae47('0x1c')](respondWithResult(_0x599fb6,null))['catch'](handleError(_0x599fb6,null));};exports[_0xae47('0x46')]=function(_0x2b2af4,_0x5ca428){return db[_0xae47('0x23')][_0xae47('0x3f')]({'where':{'id':_0x2b2af4[_0xae47('0x3c')]['id']}})[_0xae47('0x1c')](handleEntityNotFound(_0x5ca428,null))[_0xae47('0x1c')](removeEntity(_0x5ca428,null))[_0xae47('0x3a')](handleError(_0x5ca428,null));};exports[_0xae47('0x47')]=function(_0x3b15b0,_0x45af36){return db[_0xae47('0x23')][_0xae47('0x47')]()['then'](respondWithResult(_0x45af36,null))[_0xae47('0x3a')](handleError(_0x45af36,null));};exports[_0xae47('0x48')]=function(_0x1a96ee,_0x4a28c2,_0x5ec88e){var _0x2cac1c={'raw':![],'where':{}};var _0x23a814={};var _0x1b83a1={'count':0x0,'rows':[]};return db[_0xae47('0x23')][_0xae47('0x49')]({'where':{'id':_0x1a96ee['params']['id']}})[_0xae47('0x1c')](handleEntityNotFound(_0x4a28c2,null))[_0xae47('0x1c')](function(_0x26b224){if(_0x26b224){_0x23a814[_0xae47('0x25')]=_[_0xae47('0x27')](db[_0xae47('0x4a')][_0xae47('0x24')]);_0x23a814[_0xae47('0x26')]=_[_0xae47('0x27')](_0x1a96ee[_0xae47('0x26')]);_0x23a814[_0xae47('0x2f')]=_['intersection'](_0x23a814[_0xae47('0x25')],_0x23a814[_0xae47('0x26')]);_0x2cac1c[_0xae47('0x29')]=_['intersection'](_0x23a814[_0xae47('0x25')],qs[_0xae47('0x2a')](_0x1a96ee[_0xae47('0x26')]['fields']));_0x2cac1c['attributes']=_0x2cac1c[_0xae47('0x29')][_0xae47('0x2b')]?_0x2cac1c[_0xae47('0x29')]:_0x23a814[_0xae47('0x25')];if(!_0x1a96ee['query'][_0xae47('0x2c')](_0xae47('0x2d'))){_0x2cac1c[_0xae47('0x16')]=qs[_0xae47('0x16')](_0x1a96ee['query']['limit']);_0x2cac1c[_0xae47('0x15')]=qs[_0xae47('0x15')](_0x1a96ee['query']['offset']);}_0x2cac1c['order']=qs[_0xae47('0x2e')](_0x1a96ee['query']['sort']);_0x2cac1c[_0xae47('0x31')]=qs[_0xae47('0x2f')](_[_0xae47('0x4b')](_0x1a96ee[_0xae47('0x26')],_0x23a814[_0xae47('0x2f')]));_0x2cac1c[_0xae47('0x31')][_0xae47('0x4c')]=_0x26b224['id'];if(_0x1a96ee[_0xae47('0x26')][_0xae47('0x30')]){_0x2cac1c[_0xae47('0x31')]=_[_0xae47('0x3e')](_0x2cac1c[_0xae47('0x31')],{'$or':_[_0xae47('0x32')](_0x2cac1c[_0xae47('0x29')],function(_0x69c90c){var _0xfa7902={};_0xfa7902[_0x69c90c]={'$like':'%'+_0x1a96ee[_0xae47('0x26')]['filter']+'%'};return _0xfa7902;})});}_0x2cac1c=_[_0xae47('0x3e')]({},_0x2cac1c,_0x1a96ee[_0xae47('0x36')]);return db[_0xae47('0x4a')][_0xae47('0x14')]({'where':_0x2cac1c[_0xae47('0x31')]})['then'](function(_0x38ee6f){_0x1b83a1[_0xae47('0x14')]=_0x38ee6f;if(_0x1a96ee[_0xae47('0x26')][_0xae47('0x37')]){_0x2cac1c[_0xae47('0x3d')]=[{'model':db['SAProduct'],'as':_0xae47('0x4d'),'include':[{'all':!![]}]},{'model':db[_0xae47('0x23')],'as':_0xae47('0x4e')}];}return db['SAProductPricesList']['findAll'](_0x2cac1c);})['then'](function(_0x32fa01){_0x1b83a1['rows']=_0x32fa01;return _0x1b83a1;});}})[_0xae47('0x1c')](respondWithFilteredResult(_0x4a28c2,_0x2cac1c))[_0xae47('0x3a')](handleError(_0x4a28c2,null));};exports[_0xae47('0x4f')]=function(_0xbe05ca,_0x563702,_0x104a5e){if(_0xbe05ca['body']['id']){delete _0xbe05ca[_0xae47('0x41')]['id'];}return db['SAPriceList'][_0xae47('0x3f')]({'where':{'id':_0xbe05ca['params']['id']}})[_0xae47('0x1c')](handleEntityNotFound(_0x563702,null))['then'](function(_0x5506cc){if(_0x5506cc){_0xbe05ca['body'][_0xae47('0x4c')]=_0x5506cc['id'];return db[_0xae47('0x4a')]['create'](_0xbe05ca[_0xae47('0x41')]);}})[_0xae47('0x1c')](respondWithResult(_0x563702,null))['catch'](handleError(_0x563702,null));};exports[_0xae47('0x50')]=function(_0x56844e,_0x4c6a29,_0x30029a){return db[_0xae47('0x4a')][_0xae47('0x3f')]({'where':{'id':_0x56844e[_0xae47('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4c6a29,null))[_0xae47('0x1c')](function(_0x3e6fc2){if(_0x3e6fc2){return _0x3e6fc2['removeProducts'](_0x56844e[_0xae47('0x26')]['ids']);}})[_0xae47('0x1c')](respondWithStatusCode(_0x4c6a29,null))[_0xae47('0x3a')](handleError(_0x4c6a29,null));}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.model.js b/server/api/saPriceList/saPriceList.model.js index 4e02973..308520d 100644 --- a/server/api/saPriceList/saPriceList.model.js +++ b/server/api/saPriceList/saPriceList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./saPriceList.attributes','exports','define','sa_price_list','lodash','../../config/logger'];(function(_0x52a7e1,_0x189bf3){var _0x4f4495=function(_0x5d1915){while(--_0x5d1915){_0x52a7e1['push'](_0x52a7e1['shift']());}};_0x4f4495(++_0x189bf3);}(_0xb10b,0x12a));var _0xbb10=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xb10b[_0x5515a7];return _0x43f4bf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('SAPriceList',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./saPriceList.attributes','exports','define','sa_price_list','lodash','../../config/logger'];(function(_0x308c00,_0x3cbd67){var _0x2b21b2=function(_0x4ce3fc){while(--_0x4ce3fc){_0x308c00['push'](_0x308c00['shift']());}};_0x2b21b2(++_0x3cbd67);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d0948,_0x29a5ad){_0x1d0948=_0x1d0948-0x0;var _0x405614=_0xb10b[_0x1d0948];return _0x405614;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('SAPriceList',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.rpc.js b/server/api/saPriceList/saPriceList.rpc.js index 87ba71a..208d8fb 100644 --- a/server/api/saPriceList/saPriceList.rpc.js +++ b/server/api/saPriceList/saPriceList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa480=['info','SAPriceList,\x20%s,\x20%s','request\x20sent','debug','SAPriceList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x503855,_0x37ccc2){var _0x239a9c=function(_0x36b0e8){while(--_0x36b0e8){_0x503855['push'](_0x503855['shift']());}};_0x239a9c(++_0x37ccc2);}(_0xa480,0x1ba));var _0x0a48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa480[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0a48('0x0'));var util=require('util');var moment=require(_0x0a48('0x1'));var BPromise=require(_0x0a48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a48('0x3'));var db=require(_0x0a48('0x4'))['db'];var utils=require(_0x0a48('0x5'));var logger=require(_0x0a48('0x6'))(_0x0a48('0x7'));var config=require(_0x0a48('0x8'));var jayson=require(_0x0a48('0x9'));var client=jayson[_0x0a48('0xa')][_0x0a48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16ead4,_0x39ccf5,_0x5d3eb7){return new BPromise(function(_0x5c8eb2,_0x3df546){return client[_0x0a48('0xc')](_0x16ead4,_0x5d3eb7)[_0x0a48('0xd')](function(_0x1ea055){logger[_0x0a48('0xe')](_0x0a48('0xf'),_0x39ccf5,_0x0a48('0x10'));logger[_0x0a48('0x11')](_0x0a48('0x12'),_0x39ccf5,_0x0a48('0x10'),JSON[_0x0a48('0x13')](_0x1ea055));if(_0x1ea055[_0x0a48('0x14')]){if(_0x1ea055[_0x0a48('0x14')][_0x0a48('0x15')]===0x1f4){logger[_0x0a48('0x14')](_0x0a48('0xf'),_0x39ccf5,_0x1ea055[_0x0a48('0x14')][_0x0a48('0x16')]);return _0x3df546(_0x1ea055[_0x0a48('0x14')][_0x0a48('0x16')]);}logger[_0x0a48('0x14')](_0x0a48('0xf'),_0x39ccf5,_0x1ea055[_0x0a48('0x14')]['message']);return _0x5c8eb2(_0x1ea055[_0x0a48('0x14')][_0x0a48('0x16')]);}else{logger[_0x0a48('0xe')](_0x0a48('0xf'),_0x39ccf5,_0x0a48('0x10'));_0x5c8eb2(_0x1ea055[_0x0a48('0x17')]['message']);}})['catch'](function(_0x24d0be){logger[_0x0a48('0x14')](_0x0a48('0xf'),_0x39ccf5,_0x24d0be);_0x3df546(_0x24d0be);});});} \ No newline at end of file +var _0x59b3=['then','SAPriceList,\x20%s,\x20%s','request\x20sent','debug','SAPriceList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise'];(function(_0x7514f2,_0x3e3175){var _0x5885b1=function(_0x2dfade){while(--_0x2dfade){_0x7514f2['push'](_0x7514f2['shift']());}};_0x5885b1(++_0x3e3175);}(_0x59b3,0x124));var _0x359b=function(_0x3bf20c,_0x4b76cf){_0x3bf20c=_0x3bf20c-0x0;var _0x566fae=_0x59b3[_0x3bf20c];return _0x566fae;};'use strict';var _=require(_0x359b('0x0'));var util=require(_0x359b('0x1'));var moment=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var rs=require(_0x359b('0x4'));var fs=require('fs');var Redis=require(_0x359b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x359b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x359b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff317,_0x42c7cd,_0x11e82a){return new BPromise(function(_0x4bd940,_0x403165){return client['request'](_0x4ff317,_0x11e82a)[_0x359b('0x8')](function(_0x57a099){logger['info'](_0x359b('0x9'),_0x42c7cd,_0x359b('0xa'));logger[_0x359b('0xb')](_0x359b('0xc'),_0x42c7cd,_0x359b('0xa'),JSON[_0x359b('0xd')](_0x57a099));if(_0x57a099[_0x359b('0xe')]){if(_0x57a099[_0x359b('0xe')][_0x359b('0xf')]===0x1f4){logger[_0x359b('0xe')](_0x359b('0x9'),_0x42c7cd,_0x57a099[_0x359b('0xe')]['message']);return _0x403165(_0x57a099[_0x359b('0xe')][_0x359b('0x10')]);}logger[_0x359b('0xe')](_0x359b('0x9'),_0x42c7cd,_0x57a099[_0x359b('0xe')][_0x359b('0x10')]);return _0x4bd940(_0x57a099[_0x359b('0xe')][_0x359b('0x10')]);}else{logger[_0x359b('0x11')]('SAPriceList,\x20%s,\x20%s',_0x42c7cd,_0x359b('0xa'));_0x4bd940(_0x57a099[_0x359b('0x12')][_0x359b('0x10')]);}})[_0x359b('0x13')](function(_0x393c77){logger['error'](_0x359b('0x9'),_0x42c7cd,_0x393c77);_0x403165(_0x393c77);});});} \ No newline at end of file diff --git a/server/api/saProduct/index.js b/server/api/saProduct/index.js index 7926164..99697c2 100644 --- a/server/api/saProduct/index.js +++ b/server/api/saProduct/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2ad=['../../components/interaction/service','../../config/environment','./saProduct.controller','get','isAuthenticated','show','post','/:id/clone','clone','put','/:id','update','multer','path','express','Router'];(function(_0x5754c1,_0x564a97){var _0x242cef=function(_0x36bee1){while(--_0x36bee1){_0x5754c1['push'](_0x5754c1['shift']());}};_0x242cef(++_0x564a97);}(_0xa2ad,0x1ec));var _0xda2a=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0xa2ad[_0x4232d8];return _0x324de2;};'use strict';var multer=require(_0xda2a('0x0'));var util=require('util');var path=require(_0xda2a('0x1'));var timeout=require('connect-timeout');var express=require(_0xda2a('0x2'));var router=express[_0xda2a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xda2a('0x4'));var config=require(_0xda2a('0x5'));var controller=require(_0xda2a('0x6'));router[_0xda2a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xda2a('0x7')]('/:id',auth[_0xda2a('0x8')](),controller[_0xda2a('0x9')]);router['post']('/',auth[_0xda2a('0x8')](),controller['create']);router[_0xda2a('0xa')](_0xda2a('0xb'),auth[_0xda2a('0x8')](),controller[_0xda2a('0xc')]);router[_0xda2a('0xd')](_0xda2a('0xe'),auth[_0xda2a('0x8')](),controller[_0xda2a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4315=['/:id','show','post','/:id/clone','clone','put','update','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./saProduct.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4315,0x111));var _0x5431=function(_0x5bc040,_0x1654cc){_0x5bc040=_0x5bc040-0x0;var _0xb2205=_0x4315[_0x5bc040];return _0xb2205;};'use strict';var multer=require(_0x5431('0x0'));var util=require('util');var path=require(_0x5431('0x1'));var timeout=require(_0x5431('0x2'));var express=require(_0x5431('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5431('0x4'));var config=require(_0x5431('0x5'));var controller=require(_0x5431('0x6'));router[_0x5431('0x7')]('/',auth['isAuthenticated'](),controller[_0x5431('0x8')]);router[_0x5431('0x7')](_0x5431('0x9'),auth[_0x5431('0xa')](),controller[_0x5431('0xb')]);router['get'](_0x5431('0xc'),auth['isAuthenticated'](),controller[_0x5431('0xd')]);router[_0x5431('0xe')]('/',auth[_0x5431('0xa')](),controller['create']);router[_0x5431('0xe')](_0x5431('0xf'),auth['isAuthenticated'](),controller[_0x5431('0x10')]);router[_0x5431('0x11')](_0x5431('0xc'),auth[_0x5431('0xa')](),controller[_0x5431('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.attributes.js b/server/api/saProduct/saProduct.attributes.js index 9d79cc0..eb0b62c 100644 --- a/server/api/saProduct/saProduct.attributes.js +++ b/server/api/saProduct/saProduct.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ee=['exports','STRING','productcode','DECIMAL','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','BOOLEAN','sequelize'];(function(_0x390d36,_0x51037d){var _0xc5ef84=function(_0x473166){while(--_0x473166){_0x390d36['push'](_0x390d36['shift']());}};_0xc5ef84(++_0x51037d);}(_0x55ee,0x143));var _0xe55e=function(_0x187b7e,_0x1aec7f){_0x187b7e=_0x187b7e-0x0;var _0xb4e76e=_0x55ee[_0x187b7e];return _0xb4e76e;};'use strict';var Sequelize=require(_0xe55e('0x0'));module[_0xe55e('0x1')]={'name':{'type':Sequelize[_0xe55e('0x2')],'allowNull':![],'unique':'name'},'productcode':{'type':Sequelize[_0xe55e('0x2')],'allowNull':![],'unique':_0xe55e('0x3')},'netprice':{'type':Sequelize[_0xe55e('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0xe55e('0x5')],'allowNull':![]},'description':{'type':Sequelize['TEXT'](_0xe55e('0x6'))+_0xe55e('0x7')},'qtymin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'phaseout':{'type':Sequelize[_0xe55e('0x8')],'defaultValue':0x0,'allowNull':![]}}; \ No newline at end of file +var _0x6174=['STRING','name','DECIMAL','INTEGER','TEXT','long','BOOLEAN','sequelize'];(function(_0x5e6ddf,_0x245d57){var _0x1a156e=function(_0x5ea6da){while(--_0x5ea6da){_0x5e6ddf['push'](_0x5e6ddf['shift']());}};_0x1a156e(++_0x245d57);}(_0x6174,0xbf));var _0x4617=function(_0x2f5933,_0x73e675){_0x2f5933=_0x2f5933-0x0;var _0x25a66b=_0x6174[_0x2f5933];return _0x25a66b;};'use strict';var Sequelize=require(_0x4617('0x0'));module['exports']={'name':{'type':Sequelize[_0x4617('0x1')],'allowNull':![],'unique':_0x4617('0x2')},'productcode':{'type':Sequelize[_0x4617('0x1')],'allowNull':![],'unique':'productcode'},'netprice':{'type':Sequelize[_0x4617('0x3')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x4617('0x4')],'allowNull':![]},'description':{'type':Sequelize[_0x4617('0x5')](_0x4617('0x6'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'qtymin':{'type':Sequelize[_0x4617('0x4')],'allowNull':!![]},'phaseout':{'type':Sequelize[_0x4617('0x7')],'defaultValue':0x0,'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.controller.js b/server/api/saProduct/saProduct.controller.js index 6b962d4..9250196 100644 --- a/server/api/saProduct/saProduct.controller.js +++ b/server/api/saProduct/saProduct.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77e4=['ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SAProduct','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','count','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','clone','params','get','omit','createdAt','body','updatedAt','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse'];(function(_0x200152,_0x2c9a47){var _0xdbba14=function(_0x349a75){while(--_0x349a75){_0x200152['push'](_0x200152['shift']());}};_0xdbba14(++_0x2c9a47);}(_0x77e4,0x1be));var _0x477e=function(_0x39253e,_0x3c8bf6){_0x39253e=_0x39253e-0x0;var _0xb100ac=_0x77e4[_0x39253e];return _0xb100ac;};'use strict';var pdf=require(_0x477e('0x0'));var emlformat=require(_0x477e('0x1'));var rimraf=require(_0x477e('0x2'));var zipdir=require(_0x477e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x477e('0x4'));var moment=require(_0x477e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x477e('0x6'));var util=require(_0x477e('0x7'));var path=require('path');var sox=require(_0x477e('0x8'));var csv=require('to-csv');var ejs=require(_0x477e('0x9'));var fs=require('fs');var _=require(_0x477e('0xa'));var squel=require(_0x477e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x477e('0xc'));var toCsv=require(_0x477e('0xd'));var querystring=require(_0x477e('0xe'));var Papa=require(_0x477e('0xf'));var Redis=require(_0x477e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x477e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x477e('0x12'))(_0x477e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x477e('0x14'))['db'];function respondWithStatusCode(_0x47fdce,_0xf27af9){_0xf27af9=_0xf27af9||0xcc;return function(_0x3f6bef){if(_0x3f6bef){return _0x47fdce[_0x477e('0x15')](_0xf27af9);}return _0x47fdce[_0x477e('0x16')](_0xf27af9)[_0x477e('0x17')]();};}function respondWithResult(_0x36a68b,_0x9900cf){_0x9900cf=_0x9900cf||0xc8;return function(_0x4906b3){if(_0x4906b3){return _0x36a68b['status'](_0x9900cf)[_0x477e('0x18')](_0x4906b3);}};}function respondWithFilteredResult(_0x425b3e,_0x481277){return function(_0x4f49bd){if(_0x4f49bd){var _0x3b1a5e=_0x4f49bd['count'],_0x12471a=_0x481277[_0x477e('0x19')],_0x292e29=_0x481277[_0x477e('0x19')]+_0x481277[_0x477e('0x1a')],_0x3a164b;if(_0x292e29>=_0x3b1a5e){_0x292e29=_0x3b1a5e;_0x3a164b=0xc8;}else{_0x3a164b=0xce;}_0x425b3e[_0x477e('0x16')](_0x3a164b);return _0x425b3e['set'](_0x477e('0x1b'),_0x12471a+'-'+_0x292e29+'/'+_0x3b1a5e)[_0x477e('0x18')](_0x4f49bd);}return null;};}function patchUpdates(_0x3a7415){return function(_0x4d3cfa){try{jsonpatch[_0x477e('0x1c')](_0x4d3cfa,_0x3a7415,!![]);}catch(_0x1f2444){return BPromise[_0x477e('0x1d')](_0x1f2444);}return _0x4d3cfa[_0x477e('0x1e')]();};}function saveUpdates(_0x127d33,_0x410609){return function(_0x3da319){if(_0x3da319){return _0x3da319[_0x477e('0x1f')](_0x127d33)[_0x477e('0x20')](function(_0x56d21f){return _0x56d21f;});}return null;};}function removeEntity(_0x2e2f0c,_0x6edfd0){return function(_0x4bf673){if(_0x4bf673){return _0x4bf673[_0x477e('0x21')]()[_0x477e('0x20')](function(){_0x2e2f0c['status'](0xcc)[_0x477e('0x17')]();});}};}function handleEntityNotFound(_0x350d06,_0xe0c0c1){return function(_0x3bf4e7){if(!_0x3bf4e7){_0x350d06[_0x477e('0x15')](0x194);}return _0x3bf4e7;};}function handleError(_0x322e33,_0x202abb){_0x202abb=_0x202abb||0x1f4;return function(_0x19d1f0){logger[_0x477e('0x22')](_0x19d1f0[_0x477e('0x23')]);if(_0x19d1f0[_0x477e('0x24')]){delete _0x19d1f0[_0x477e('0x24')];}_0x322e33[_0x477e('0x16')](_0x202abb)[_0x477e('0x25')](_0x19d1f0);};}exports[_0x477e('0x26')]=function(_0x587fba,_0x49a8d5){var _0x55c403={},_0x2ecae6={},_0x271097={'count':0x0,'rows':[]};var _0x267cd2=db[_0x477e('0x27')]['rawAttributes'];_0x2ecae6[_0x477e('0x28')]=_[_0x477e('0x29')](_0x267cd2);_0x2ecae6['query']=_[_0x477e('0x29')](_0x587fba[_0x477e('0x2a')]);_0x2ecae6[_0x477e('0x2b')]=_[_0x477e('0x2c')](_0x2ecae6[_0x477e('0x28')],_0x2ecae6['query']);_0x55c403[_0x477e('0x2d')]=_[_0x477e('0x2c')](_0x2ecae6['model'],qs[_0x477e('0x2e')](_0x587fba[_0x477e('0x2a')][_0x477e('0x2e')]));_0x55c403[_0x477e('0x2d')]=_0x55c403[_0x477e('0x2d')][_0x477e('0x2f')]?_0x55c403['attributes']:_0x2ecae6[_0x477e('0x28')];if(!_0x587fba['query'][_0x477e('0x30')]('nolimit')){_0x55c403[_0x477e('0x1a')]=qs[_0x477e('0x1a')](_0x587fba[_0x477e('0x2a')][_0x477e('0x1a')]);_0x55c403['offset']=qs[_0x477e('0x19')](_0x587fba[_0x477e('0x2a')]['offset']);}_0x55c403[_0x477e('0x31')]=qs[_0x477e('0x32')](_0x587fba[_0x477e('0x2a')]['sort']);_0x55c403[_0x477e('0x33')]=qs['filters'](_[_0x477e('0x34')](_0x587fba[_0x477e('0x2a')],_0x2ecae6[_0x477e('0x2b')]));if(_0x587fba[_0x477e('0x2a')][_0x477e('0x35')]){_0x55c403[_0x477e('0x33')]=_[_0x477e('0x36')](_0x55c403[_0x477e('0x33')],{'$or':_['map'](_0x267cd2,function(_0x2d53ca){if(_0x2d53ca[_0x477e('0x37')][_0x477e('0x38')]!==_0x477e('0x39')){var _0x3b6f01={};_0x3b6f01[_0x2d53ca[_0x477e('0x3a')]]={'$like':'%'+_0x587fba[_0x477e('0x2a')][_0x477e('0x35')]+'%'};return _0x3b6f01;}})});}_0x55c403=_['merge']({},_0x55c403,_0x587fba['options']);var _0xbe97d6={'where':_0x55c403[_0x477e('0x33')]};return db[_0x477e('0x27')][_0x477e('0x3b')](_0xbe97d6)[_0x477e('0x20')](function(_0x4c568e){_0x271097[_0x477e('0x3b')]=_0x4c568e;if(_0x587fba[_0x477e('0x2a')]['includeAll']){_0x55c403[_0x477e('0x3c')]=[{'all':!![]}];}return db[_0x477e('0x27')][_0x477e('0x3d')](_0x55c403);})[_0x477e('0x20')](function(_0x208bcf){_0x271097[_0x477e('0x3e')]=_0x208bcf;return _0x271097;})['then'](respondWithFilteredResult(_0x49a8d5,_0x55c403))[_0x477e('0x3f')](handleError(_0x49a8d5,null));};exports['show']=function(_0x3f092d,_0x4ae9a3){var _0x5852e0={'raw':![],'where':{'id':_0x3f092d['params']['id']}},_0x53010e={};_0x53010e[_0x477e('0x28')]=_[_0x477e('0x29')](db[_0x477e('0x27')][_0x477e('0x40')]);_0x53010e[_0x477e('0x2a')]=_['keys'](_0x3f092d[_0x477e('0x2a')]);_0x53010e[_0x477e('0x2b')]=_[_0x477e('0x2c')](_0x53010e['model'],_0x53010e['query']);_0x5852e0[_0x477e('0x2d')]=_[_0x477e('0x2c')](_0x53010e['model'],qs['fields'](_0x3f092d[_0x477e('0x2a')][_0x477e('0x2e')]));_0x5852e0[_0x477e('0x2d')]=_0x5852e0['attributes'][_0x477e('0x2f')]?_0x5852e0[_0x477e('0x2d')]:_0x53010e[_0x477e('0x28')];if(_0x3f092d[_0x477e('0x2a')][_0x477e('0x41')]){_0x5852e0['include']=[{'all':!![]}];}_0x5852e0=_[_0x477e('0x36')]({},_0x5852e0,_0x3f092d[_0x477e('0x42')]);return db['SAProduct'][_0x477e('0x43')](_0x5852e0)['then'](handleEntityNotFound(_0x4ae9a3,null))[_0x477e('0x20')](respondWithResult(_0x4ae9a3,null))[_0x477e('0x3f')](handleError(_0x4ae9a3,null));};exports[_0x477e('0x44')]=function(_0x459546,_0x587756){return db['SAProduct'][_0x477e('0x44')](_0x459546['body'],{})['then'](respondWithResult(_0x587756,0xc9))[_0x477e('0x3f')](handleError(_0x587756,null));};exports[_0x477e('0x45')]=function(_0x45643f,_0x2db94e){var _0x23fcd3={'raw':![],'where':{'id':_0x45643f[_0x477e('0x46')]['id']}},_0x6b7585={};_0x6b7585[_0x477e('0x28')]=_[_0x477e('0x29')](db['SAProduct'][_0x477e('0x40')]);_0x23fcd3[_0x477e('0x2d')]=_[_0x477e('0x2c')](_0x6b7585[_0x477e('0x28')],qs[_0x477e('0x2e')](_0x45643f['query'][_0x477e('0x2e')]));_0x23fcd3[_0x477e('0x2d')]=_0x23fcd3[_0x477e('0x2d')][_0x477e('0x2f')]?_0x23fcd3['attributes']:_0x6b7585['model'];if(_0x45643f[_0x477e('0x2a')][_0x477e('0x41')]){_0x23fcd3[_0x477e('0x3c')]=[{'all':!![]}];}_0x23fcd3=_[_0x477e('0x36')]({},_0x23fcd3,_0x45643f[_0x477e('0x42')]);return db[_0x477e('0x27')][_0x477e('0x43')](_0x23fcd3)[_0x477e('0x20')](handleEntityNotFound(_0x2db94e,null))['then'](function(_0x5f4832){if(_0x5f4832){var _0x1a066d=_0x5f4832[_0x477e('0x47')]({'plain':!![]});_0x1a066d=qs[_0x477e('0x48')](_0x1a066d,['id',_0x477e('0x49'),'updatedAt']);_0x45643f['body']=_[_0x477e('0x48')](_0x45643f[_0x477e('0x4a')],['id','createdAt',_0x477e('0x4b')]);return db[_0x477e('0x27')][_0x477e('0x44')](_[_0x477e('0x36')](_0x1a066d,_0x45643f['body']),{'include':_0x45643f[_0x477e('0x2a')][_0x477e('0x41')]?[{'all':!![]}]:undefined});}})[_0x477e('0x20')](respondWithResult(_0x2db94e,0xc9))['catch'](handleError(_0x2db94e,null));};exports[_0x477e('0x1f')]=function(_0x5a34f3,_0x4dbdcb){if(_0x5a34f3[_0x477e('0x4a')]['id']){delete _0x5a34f3[_0x477e('0x4a')]['id'];}return db[_0x477e('0x27')]['find']({'where':{'id':_0x5a34f3['params']['id']}})[_0x477e('0x20')](handleEntityNotFound(_0x4dbdcb,null))[_0x477e('0x20')](saveUpdates(_0x5a34f3[_0x477e('0x4a')],null))[_0x477e('0x20')](respondWithResult(_0x4dbdcb,null))['catch'](handleError(_0x4dbdcb,null));};exports['describe']=function(_0x3dee38,_0x4dcd33){return db[_0x477e('0x27')][_0x477e('0x4c')]()[_0x477e('0x20')](respondWithResult(_0x4dcd33,null))[_0x477e('0x3f')](handleError(_0x4dcd33,null));}; \ No newline at end of file +var _0x0a39=['limit','set','save','update','then','destroy','error','stack','name','send','index','SAProduct','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','find','create','clone','get','omit','createdAt','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset'];(function(_0x57e4a5,_0xf0e57e){var _0x1e93c5=function(_0x3d3aef){while(--_0x3d3aef){_0x57e4a5['push'](_0x57e4a5['shift']());}};_0x1e93c5(++_0xf0e57e);}(_0x0a39,0x7d));var _0x90a3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a39[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90a3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x90a3('0x1'));var rp=require(_0x90a3('0x2'));var moment=require(_0x90a3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x90a3('0x4'));var util=require(_0x90a3('0x5'));var path=require(_0x90a3('0x6'));var sox=require(_0x90a3('0x7'));var csv=require(_0x90a3('0x8'));var ejs=require(_0x90a3('0x9'));var fs=require('fs');var _=require(_0x90a3('0xa'));var squel=require(_0x90a3('0xb'));var crypto=require(_0x90a3('0xc'));var jsforce=require(_0x90a3('0xd'));var deskjs=require(_0x90a3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x90a3('0xf'));var Papa=require(_0x90a3('0x10'));var Redis=require(_0x90a3('0x11'));var authService=require(_0x90a3('0x12'));var qs=require(_0x90a3('0x13'));var hardwareService=require(_0x90a3('0x14'));var logger=require(_0x90a3('0x15'))(_0x90a3('0x16'));var utils=require(_0x90a3('0x17'));var config=require(_0x90a3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x288f88,_0x2731cb){_0x2731cb=_0x2731cb||0xcc;return function(_0x57a956){if(_0x57a956){return _0x288f88[_0x90a3('0x19')](_0x2731cb);}return _0x288f88[_0x90a3('0x1a')](_0x2731cb)[_0x90a3('0x1b')]();};}function respondWithResult(_0x585fca,_0x5d71a2){_0x5d71a2=_0x5d71a2||0xc8;return function(_0x1774a8){if(_0x1774a8){return _0x585fca['status'](_0x5d71a2)[_0x90a3('0x1c')](_0x1774a8);}};}function respondWithFilteredResult(_0x564c41,_0x1244d8){return function(_0x349b0e){if(_0x349b0e){var _0x4e9661=_0x349b0e[_0x90a3('0x1d')],_0x37737a=_0x1244d8[_0x90a3('0x1e')],_0x5c6270=_0x1244d8[_0x90a3('0x1e')]+_0x1244d8[_0x90a3('0x1f')],_0x2abd5a;if(_0x5c6270>=_0x4e9661){_0x5c6270=_0x4e9661;_0x2abd5a=0xc8;}else{_0x2abd5a=0xce;}_0x564c41[_0x90a3('0x1a')](_0x2abd5a);return _0x564c41[_0x90a3('0x20')]('Content-Range',_0x37737a+'-'+_0x5c6270+'/'+_0x4e9661)[_0x90a3('0x1c')](_0x349b0e);}return null;};}function patchUpdates(_0xcfa284){return function(_0x59128b){try{jsonpatch['apply'](_0x59128b,_0xcfa284,!![]);}catch(_0xa49cb5){return BPromise['reject'](_0xa49cb5);}return _0x59128b[_0x90a3('0x21')]();};}function saveUpdates(_0x2dc20a,_0x41b7c8){return function(_0x418749){if(_0x418749){return _0x418749[_0x90a3('0x22')](_0x2dc20a)[_0x90a3('0x23')](function(_0x256f1e){return _0x256f1e;});}return null;};}function removeEntity(_0x270c3c,_0x1fc7a4){return function(_0x1cc567){if(_0x1cc567){return _0x1cc567[_0x90a3('0x24')]()[_0x90a3('0x23')](function(){_0x270c3c[_0x90a3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bbfeb,_0x3b7f2b){return function(_0x18acaa){if(!_0x18acaa){_0x2bbfeb[_0x90a3('0x19')](0x194);}return _0x18acaa;};}function handleError(_0x45a9f8,_0x39817d){_0x39817d=_0x39817d||0x1f4;return function(_0x4f34ca){logger[_0x90a3('0x25')](_0x4f34ca[_0x90a3('0x26')]);if(_0x4f34ca[_0x90a3('0x27')]){delete _0x4f34ca[_0x90a3('0x27')];}_0x45a9f8[_0x90a3('0x1a')](_0x39817d)[_0x90a3('0x28')](_0x4f34ca);};}exports[_0x90a3('0x29')]=function(_0x4798cf,_0x14be46){var _0x3b9e3c={},_0x2d03a8={},_0x9ecdb={'count':0x0,'rows':[]};var _0x27420e=db[_0x90a3('0x2a')][_0x90a3('0x2b')];_0x2d03a8[_0x90a3('0x2c')]=_[_0x90a3('0x2d')](_0x27420e);_0x2d03a8['query']=_[_0x90a3('0x2d')](_0x4798cf[_0x90a3('0x2e')]);_0x2d03a8['filters']=_[_0x90a3('0x2f')](_0x2d03a8['model'],_0x2d03a8[_0x90a3('0x2e')]);_0x3b9e3c[_0x90a3('0x30')]=_[_0x90a3('0x2f')](_0x2d03a8[_0x90a3('0x2c')],qs[_0x90a3('0x31')](_0x4798cf[_0x90a3('0x2e')][_0x90a3('0x31')]));_0x3b9e3c[_0x90a3('0x30')]=_0x3b9e3c[_0x90a3('0x30')][_0x90a3('0x32')]?_0x3b9e3c['attributes']:_0x2d03a8[_0x90a3('0x2c')];if(!_0x4798cf[_0x90a3('0x2e')][_0x90a3('0x33')](_0x90a3('0x34'))){_0x3b9e3c[_0x90a3('0x1f')]=qs[_0x90a3('0x1f')](_0x4798cf[_0x90a3('0x2e')]['limit']);_0x3b9e3c[_0x90a3('0x1e')]=qs['offset'](_0x4798cf[_0x90a3('0x2e')]['offset']);}_0x3b9e3c[_0x90a3('0x35')]=qs[_0x90a3('0x36')](_0x4798cf[_0x90a3('0x2e')][_0x90a3('0x36')]);_0x3b9e3c[_0x90a3('0x37')]=qs[_0x90a3('0x38')](_[_0x90a3('0x39')](_0x4798cf['query'],_0x2d03a8[_0x90a3('0x38')]));if(_0x4798cf['query']['filter']){_0x3b9e3c[_0x90a3('0x37')]=_[_0x90a3('0x3a')](_0x3b9e3c[_0x90a3('0x37')],{'$or':_[_0x90a3('0x3b')](_0x27420e,function(_0x236b48){if(_0x236b48[_0x90a3('0x3c')][_0x90a3('0x3d')]!==_0x90a3('0x3e')){var _0x302a12={};_0x302a12[_0x236b48[_0x90a3('0x3f')]]={'$like':'%'+_0x4798cf[_0x90a3('0x2e')]['filter']+'%'};return _0x302a12;}})});}_0x3b9e3c=_['merge']({},_0x3b9e3c,_0x4798cf[_0x90a3('0x40')]);var _0x1f7f01={'where':_0x3b9e3c[_0x90a3('0x37')]};return db[_0x90a3('0x2a')]['count'](_0x1f7f01)['then'](function(_0x31d9a3){_0x9ecdb[_0x90a3('0x1d')]=_0x31d9a3;if(_0x4798cf[_0x90a3('0x2e')][_0x90a3('0x41')]){_0x3b9e3c[_0x90a3('0x42')]=[{'all':!![]}];}return db[_0x90a3('0x2a')]['findAll'](_0x3b9e3c);})['then'](function(_0x320d71){_0x9ecdb[_0x90a3('0x43')]=_0x320d71;return _0x9ecdb;})[_0x90a3('0x23')](respondWithFilteredResult(_0x14be46,_0x3b9e3c))[_0x90a3('0x44')](handleError(_0x14be46,null));};exports['show']=function(_0x266f43,_0x2af6d4){var _0x2bfe7f={'raw':![],'where':{'id':_0x266f43[_0x90a3('0x45')]['id']}},_0x2928a8={};_0x2928a8[_0x90a3('0x2c')]=_[_0x90a3('0x2d')](db[_0x90a3('0x2a')][_0x90a3('0x2b')]);_0x2928a8[_0x90a3('0x2e')]=_['keys'](_0x266f43[_0x90a3('0x2e')]);_0x2928a8[_0x90a3('0x38')]=_['intersection'](_0x2928a8[_0x90a3('0x2c')],_0x2928a8[_0x90a3('0x2e')]);_0x2bfe7f[_0x90a3('0x30')]=_[_0x90a3('0x2f')](_0x2928a8[_0x90a3('0x2c')],qs[_0x90a3('0x31')](_0x266f43[_0x90a3('0x2e')]['fields']));_0x2bfe7f[_0x90a3('0x30')]=_0x2bfe7f['attributes'][_0x90a3('0x32')]?_0x2bfe7f['attributes']:_0x2928a8['model'];if(_0x266f43[_0x90a3('0x2e')][_0x90a3('0x41')]){_0x2bfe7f[_0x90a3('0x42')]=[{'all':!![]}];}_0x2bfe7f=_[_0x90a3('0x3a')]({},_0x2bfe7f,_0x266f43['options']);return db['SAProduct'][_0x90a3('0x46')](_0x2bfe7f)[_0x90a3('0x23')](handleEntityNotFound(_0x2af6d4,null))['then'](respondWithResult(_0x2af6d4,null))[_0x90a3('0x44')](handleError(_0x2af6d4,null));};exports['create']=function(_0x392f10,_0x4fe1ee){return db[_0x90a3('0x2a')][_0x90a3('0x47')](_0x392f10['body'],{})[_0x90a3('0x23')](respondWithResult(_0x4fe1ee,0xc9))[_0x90a3('0x44')](handleError(_0x4fe1ee,null));};exports[_0x90a3('0x48')]=function(_0x2bac7f,_0x444697){var _0x240844={'raw':![],'where':{'id':_0x2bac7f['params']['id']}},_0x1411ed={};_0x1411ed[_0x90a3('0x2c')]=_[_0x90a3('0x2d')](db['SAProduct'][_0x90a3('0x2b')]);_0x240844[_0x90a3('0x30')]=_[_0x90a3('0x2f')](_0x1411ed[_0x90a3('0x2c')],qs[_0x90a3('0x31')](_0x2bac7f[_0x90a3('0x2e')][_0x90a3('0x31')]));_0x240844[_0x90a3('0x30')]=_0x240844[_0x90a3('0x30')][_0x90a3('0x32')]?_0x240844[_0x90a3('0x30')]:_0x1411ed[_0x90a3('0x2c')];if(_0x2bac7f[_0x90a3('0x2e')]['includeAll']){_0x240844[_0x90a3('0x42')]=[{'all':!![]}];}_0x240844=_[_0x90a3('0x3a')]({},_0x240844,_0x2bac7f[_0x90a3('0x40')]);return db['SAProduct'][_0x90a3('0x46')](_0x240844)['then'](handleEntityNotFound(_0x444697,null))[_0x90a3('0x23')](function(_0x200a68){if(_0x200a68){var _0x22ebc2=_0x200a68[_0x90a3('0x49')]({'plain':!![]});_0x22ebc2=qs[_0x90a3('0x4a')](_0x22ebc2,['id',_0x90a3('0x4b'),'updatedAt']);_0x2bac7f[_0x90a3('0x4c')]=_[_0x90a3('0x4a')](_0x2bac7f[_0x90a3('0x4c')],['id',_0x90a3('0x4b'),'updatedAt']);return db['SAProduct'][_0x90a3('0x47')](_[_0x90a3('0x3a')](_0x22ebc2,_0x2bac7f['body']),{'include':_0x2bac7f[_0x90a3('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x90a3('0x23')](respondWithResult(_0x444697,0xc9))[_0x90a3('0x44')](handleError(_0x444697,null));};exports[_0x90a3('0x22')]=function(_0x2bd204,_0x183570){if(_0x2bd204[_0x90a3('0x4c')]['id']){delete _0x2bd204[_0x90a3('0x4c')]['id'];}return db[_0x90a3('0x2a')][_0x90a3('0x46')]({'where':{'id':_0x2bd204[_0x90a3('0x45')]['id']}})[_0x90a3('0x23')](handleEntityNotFound(_0x183570,null))['then'](saveUpdates(_0x2bd204[_0x90a3('0x4c')],null))[_0x90a3('0x23')](respondWithResult(_0x183570,null))['catch'](handleError(_0x183570,null));};exports[_0x90a3('0x4d')]=function(_0x348faf,_0x2471d4){return db[_0x90a3('0x2a')]['describe']()['then'](respondWithResult(_0x2471d4,null))[_0x90a3('0x44')](handleError(_0x2471d4,null));}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.model.js b/server/api/saProduct/saProduct.model.js index c28e51a..b8ea07e 100644 --- a/server/api/saProduct/saProduct.model.js +++ b/server/api/saProduct/saProduct.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x787a=['../../config/environment','define','sa_products','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x395d59,_0x3aa7d1){var _0x45f776=function(_0x298b5d){while(--_0x298b5d){_0x395d59['push'](_0x395d59['shift']());}};_0x45f776(++_0x3aa7d1);}(_0x787a,0x1ce));var _0xa787=function(_0x15e7e6,_0x1e70ce){_0x15e7e6=_0x15e7e6-0x0;var _0x587485=_0x787a[_0x15e7e6];return _0x587485;};'use strict';var _=require(_0xa787('0x0'));var util=require('util');var logger=require(_0xa787('0x1'))('api');var moment=require(_0xa787('0x2'));var BPromise=require(_0xa787('0x3'));var rp=require(_0xa787('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa787('0x5'));var config=require(_0xa787('0x6'));var attributes=require('./saProduct.attributes');module['exports']=function(_0x236932,_0xf61c38){return _0x236932[_0xa787('0x7')]('SAProduct',attributes,{'tableName':_0xa787('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c04=['request-promise','path','rimraf','exports','define','SAProduct','sa_products','lodash','util','api','moment','bluebird'];(function(_0x36b9b6,_0x541c7e){var _0xa094a6=function(_0x3360ee){while(--_0x3360ee){_0x36b9b6['push'](_0x36b9b6['shift']());}};_0xa094a6(++_0x541c7e);}(_0x8c04,0x1c3));var _0x48c0=function(_0x164adf,_0x273916){_0x164adf=_0x164adf-0x0;var _0x4c61cd=_0x8c04[_0x164adf];return _0x4c61cd;};'use strict';var _=require(_0x48c0('0x0'));var util=require(_0x48c0('0x1'));var logger=require('../../config/logger')(_0x48c0('0x2'));var moment=require(_0x48c0('0x3'));var BPromise=require(_0x48c0('0x4'));var rp=require(_0x48c0('0x5'));var fs=require('fs');var path=require(_0x48c0('0x6'));var rimraf=require(_0x48c0('0x7'));var config=require('../../config/environment');var attributes=require('./saProduct.attributes');module[_0x48c0('0x8')]=function(_0x4bc158,_0x539aa5){return _0x4bc158[_0x48c0('0x9')](_0x48c0('0xa'),attributes,{'tableName':_0x48c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.rpc.js b/server/api/saProduct/saProduct.rpc.js index 8774f0e..1361570 100644 --- a/server/api/saProduct/saProduct.rpc.js +++ b/server/api/saProduct/saProduct.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed1f=['request','then','info','SAProduct,\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(_0x378a77,_0x18282e){var _0xb73b0a=function(_0x133ecd){while(--_0x133ecd){_0x378a77['push'](_0x378a77['shift']());}};_0xb73b0a(++_0x18282e);}(_0xed1f,0x6a));var _0xfed1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xed1f[_0x32b542];return _0x554d54;};'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')]('SAProduct,\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')]('SAProduct,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('SAProduct,\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')]('SAProduct,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x303a=['SAProduct,\x20%s,\x20%s,\x20%s','stringify','error','code','SAProduct,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x303a,0x1a0));var _0xa303=function(_0x42c797,_0x16382b){_0x42c797=_0x42c797-0x0;var _0x320035=_0x303a[_0x42c797];return _0x320035;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('SAProduct,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('SAProduct,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('SAProduct,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file diff --git a/server/api/saProductOrder/index.js b/server/api/saProductOrder/index.js index 021bc7c..2ac4b95 100644 --- a/server/api/saProductOrder/index.js +++ b/server/api/saProductOrder/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x628c=['show','post','create','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./saProductOrder.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5102eb,_0x73cfe5){var _0x36bae9=function(_0x52dea9){while(--_0x52dea9){_0x5102eb['push'](_0x5102eb['shift']());}};_0x36bae9(++_0x73cfe5);}(_0x628c,0x1ab));var _0xc628=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x628c[_0x57975f];return _0x4793b8;};'use strict';var multer=require(_0xc628('0x0'));var util=require(_0xc628('0x1'));var path=require(_0xc628('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc628('0x3')]();var auth=require(_0xc628('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc628('0x5'));var controller=require(_0xc628('0x6'));router[_0xc628('0x7')]('/',auth[_0xc628('0x8')](),controller[_0xc628('0x9')]);router[_0xc628('0x7')](_0xc628('0xa'),auth[_0xc628('0x8')](),controller[_0xc628('0xb')]);router[_0xc628('0x7')](_0xc628('0xc'),auth[_0xc628('0x8')](),controller[_0xc628('0xd')]);router[_0xc628('0xe')]('/',auth['isAuthenticated'](),controller[_0xc628('0xf')]);router['put'](_0xc628('0xc'),auth[_0xc628('0x8')](),controller[_0xc628('0x10')]);router[_0xc628('0x11')](_0xc628('0xc'),auth['isAuthenticated'](),controller[_0xc628('0x12')]);module[_0xc628('0x13')]=router; \ No newline at end of file +var _0xa5b2=['../../config/environment','./saProductOrder.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x123c20,_0x4b026e){var _0x575239=function(_0x4eed1d){while(--_0x4eed1d){_0x123c20['push'](_0x123c20['shift']());}};_0x575239(++_0x4b026e);}(_0xa5b2,0x16e));var _0x2a5b=function(_0xcb19e1,_0x465489){_0xcb19e1=_0xcb19e1-0x0;var _0x121872=_0xa5b2[_0xcb19e1];return _0x121872;};'use strict';var multer=require(_0x2a5b('0x0'));var util=require(_0x2a5b('0x1'));var path=require(_0x2a5b('0x2'));var timeout=require(_0x2a5b('0x3'));var express=require(_0x2a5b('0x4'));var router=express[_0x2a5b('0x5')]();var auth=require(_0x2a5b('0x6'));var interaction=require(_0x2a5b('0x7'));var config=require(_0x2a5b('0x8'));var controller=require(_0x2a5b('0x9'));router[_0x2a5b('0xa')]('/',auth[_0x2a5b('0xb')](),controller['index']);router[_0x2a5b('0xa')](_0x2a5b('0xc'),auth[_0x2a5b('0xb')](),controller[_0x2a5b('0xd')]);router[_0x2a5b('0xa')]('/:id',auth[_0x2a5b('0xb')](),controller['show']);router[_0x2a5b('0xe')]('/',auth[_0x2a5b('0xb')](),controller[_0x2a5b('0xf')]);router[_0x2a5b('0x10')](_0x2a5b('0x11'),auth[_0x2a5b('0xb')](),controller[_0x2a5b('0x12')]);router[_0x2a5b('0x13')](_0x2a5b('0x11'),auth['isAuthenticated'](),controller[_0x2a5b('0x14')]);module[_0x2a5b('0x15')]=router; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.attributes.js b/server/api/saProductOrder/saProductOrder.attributes.js index c479d5d..769f332 100644 --- a/server/api/saProductOrder/saProductOrder.attributes.js +++ b/server/api/saProductOrder/saProductOrder.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0d=['TEXT','STRING','compositeIndex_prodCode_OrderID','DECIMAL','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','sequelize','exports'];(function(_0x1c9f4d,_0x3475b0){var _0x58c2ae=function(_0x5519f9){while(--_0x5519f9){_0x1c9f4d['push'](_0x1c9f4d['shift']());}};_0x58c2ae(++_0x3475b0);}(_0x8d0d,0x14b));var _0xd8d0=function(_0xdbce2e,_0x1ba5ba){_0xdbce2e=_0xdbce2e-0x0;var _0x570025=_0x8d0d[_0xdbce2e];return _0x570025;};'use strict';var Sequelize=require(_0xd8d0('0x0'));module[_0xd8d0('0x1')]={'productName':{'type':Sequelize[_0xd8d0('0x2')],'allowNull':![]},'productCode':{'type':Sequelize[_0xd8d0('0x3')],'allowNull':![],'unique':_0xd8d0('0x4')},'productNetPrice':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4)},'productTax':{'type':Sequelize['INTEGER']},'productDescription':{'type':Sequelize[_0xd8d0('0x2')](_0xd8d0('0x6'))+_0xd8d0('0x7')},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize['TEXT']},'pricelistDiscount':{'type':Sequelize[_0xd8d0('0x5')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4)},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0xd8d0('0x8')],'allowNull':![]},'discount':{'type':Sequelize[_0xd8d0('0x5')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xd8d0('0x3')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize[_0xd8d0('0x8')]},'OrderId':{'type':Sequelize['INTEGER'],'unique':_0xd8d0('0x4')},'totalPrice':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4)},'totalTax':{'type':Sequelize[_0xd8d0('0x5')](0xd,0x4)},'typeName':{'type':Sequelize['STRING']},'TypeId':{'type':Sequelize[_0xd8d0('0x8')]},'unitName':{'type':Sequelize[_0xd8d0('0x3')]},'UnitId':{'type':Sequelize[_0xd8d0('0x8')]},'attendanceName':{'type':Sequelize['STRING']},'attendanceId':{'type':Sequelize[_0xd8d0('0x8')]},'attendanceMonthly':{'type':Sequelize[_0xd8d0('0x8')]},'companyName':{'type':Sequelize[_0xd8d0('0x3')]},'companyId':{'type':Sequelize[_0xd8d0('0x8')]},'productAsset':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xb1e1=['exports','TEXT','STRING','compositeIndex_prodCode_OrderID','INTEGER','long','DECIMAL','BOOLEAN'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0xb1e1,0xb8));var _0x1b1e=function(_0x4ee6e8,_0x51bfb4){_0x4ee6e8=_0x4ee6e8-0x0;var _0x50a78b=_0xb1e1[_0x4ee6e8];return _0x50a78b;};'use strict';var Sequelize=require('sequelize');module[_0x1b1e('0x0')]={'productName':{'type':Sequelize[_0x1b1e('0x1')],'allowNull':![]},'productCode':{'type':Sequelize[_0x1b1e('0x2')],'allowNull':![],'unique':_0x1b1e('0x3')},'productNetPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'productTax':{'type':Sequelize[_0x1b1e('0x4')]},'productDescription':{'type':Sequelize[_0x1b1e('0x1')](_0x1b1e('0x5'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x1b1e('0x1')]},'pricelistDiscount':{'type':Sequelize[_0x1b1e('0x6')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4)},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0x1b1e('0x4')],'allowNull':![]},'discount':{'type':Sequelize[_0x1b1e('0x6')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x1b1e('0x2')]},'note':{'type':Sequelize[_0x1b1e('0x1')]},'QuotationId':{'type':Sequelize[_0x1b1e('0x4')]},'OrderId':{'type':Sequelize[_0x1b1e('0x4')],'unique':_0x1b1e('0x3')},'totalPrice':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x1b1e('0x6')](0xd,0x4)},'typeName':{'type':Sequelize[_0x1b1e('0x2')]},'TypeId':{'type':Sequelize[_0x1b1e('0x4')]},'unitName':{'type':Sequelize[_0x1b1e('0x2')]},'UnitId':{'type':Sequelize['INTEGER']},'attendanceName':{'type':Sequelize['STRING']},'attendanceId':{'type':Sequelize[_0x1b1e('0x4')]},'attendanceMonthly':{'type':Sequelize[_0x1b1e('0x4')]},'companyName':{'type':Sequelize[_0x1b1e('0x2')]},'companyId':{'type':Sequelize[_0x1b1e('0x4')]},'productAsset':{'type':Sequelize[_0x1b1e('0x7')]}}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.controller.js b/server/api/saProductOrder/saProductOrder.controller.js index 313e972..d5c060e 100644 --- a/server/api/saProductOrder/saProductOrder.controller.js +++ b/server/api/saProductOrder/saProductOrder.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb71c=['json','offset','set','Content-Range','reject','update','then','name','index','SAProductOrder','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','add','day','filter','type','VIRTUAL','field','merge','options','count','includeAll','include','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x44a6e8,_0xd4003c){var _0x5f2893=function(_0x14b15e){while(--_0x14b15e){_0x44a6e8['push'](_0x44a6e8['shift']());}};_0x5f2893(++_0xd4003c);}(_0xb71c,0x151));var _0xcb71=function(_0x5b58bc,_0xaf196){_0x5b58bc=_0x5b58bc-0x0;var _0xcab4d9=_0xb71c[_0x5b58bc];return _0xcab4d9;};'use strict';var pdf=require(_0xcb71('0x0'));var emlformat=require(_0xcb71('0x1'));var rimraf=require(_0xcb71('0x2'));var zipdir=require(_0xcb71('0x3'));var jsonpatch=require(_0xcb71('0x4'));var rp=require(_0xcb71('0x5'));var moment=require(_0xcb71('0x6'));var BPromise=require(_0xcb71('0x7'));var Mustache=require(_0xcb71('0x8'));var util=require(_0xcb71('0x9'));var path=require('path');var sox=require(_0xcb71('0xa'));var csv=require(_0xcb71('0xb'));var ejs=require(_0xcb71('0xc'));var fs=require('fs');var _=require(_0xcb71('0xd'));var squel=require(_0xcb71('0xe'));var crypto=require(_0xcb71('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcb71('0x10'));var toCsv=require(_0xcb71('0xb'));var querystring=require(_0xcb71('0x11'));var Papa=require(_0xcb71('0x12'));var Redis=require(_0xcb71('0x13'));var qs=require(_0xcb71('0x14'));var logger=require(_0xcb71('0x15'))(_0xcb71('0x16'));var utils=require(_0xcb71('0x17'));var config=require(_0xcb71('0x18'));var db=require(_0xcb71('0x19'))['db'];function respondWithStatusCode(_0x175f40,_0x38f7c3){_0x38f7c3=_0x38f7c3||0xcc;return function(_0x5b4dab){if(_0x5b4dab){return _0x175f40[_0xcb71('0x1a')](_0x38f7c3);}return _0x175f40[_0xcb71('0x1b')](_0x38f7c3)['end']();};}function respondWithResult(_0x5f157b,_0x13419d){_0x13419d=_0x13419d||0xc8;return function(_0x20b828){if(_0x20b828){return _0x5f157b['status'](_0x13419d)[_0xcb71('0x1c')](_0x20b828);}};}function respondWithFilteredResult(_0x2b1033,_0x3c79f5){return function(_0x41d1ee){if(_0x41d1ee){var _0xa3ee60=_0x41d1ee['count'],_0x1de9ac=_0x3c79f5[_0xcb71('0x1d')],_0x33708c=_0x3c79f5[_0xcb71('0x1d')]+_0x3c79f5['limit'],_0x5385ca;if(_0x33708c>=_0xa3ee60){_0x33708c=_0xa3ee60;_0x5385ca=0xc8;}else{_0x5385ca=0xce;}_0x2b1033[_0xcb71('0x1b')](_0x5385ca);return _0x2b1033[_0xcb71('0x1e')](_0xcb71('0x1f'),_0x1de9ac+'-'+_0x33708c+'/'+_0xa3ee60)[_0xcb71('0x1c')](_0x41d1ee);}return null;};}function patchUpdates(_0x284a83){return function(_0x84bc66){try{jsonpatch['apply'](_0x84bc66,_0x284a83,!![]);}catch(_0x33978c){return BPromise[_0xcb71('0x20')](_0x33978c);}return _0x84bc66['save']();};}function saveUpdates(_0x566b7a,_0x42db6b){return function(_0x1a8aef){if(_0x1a8aef){return _0x1a8aef[_0xcb71('0x21')](_0x566b7a)[_0xcb71('0x22')](function(_0x287b7d){return _0x287b7d;});}return null;};}function removeEntity(_0x28f5b2,_0x2b6ad5){return function(_0x24b55f){if(_0x24b55f){return _0x24b55f['destroy']()['then'](function(){_0x28f5b2[_0xcb71('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xba7d3c,_0x4a8eb5){return function(_0x4d0fa9){if(!_0x4d0fa9){_0xba7d3c[_0xcb71('0x1a')](0x194);}return _0x4d0fa9;};}function handleError(_0x4401e5,_0x25ee33){_0x25ee33=_0x25ee33||0x1f4;return function(_0x96411){logger['error'](_0x96411['stack']);if(_0x96411[_0xcb71('0x23')]){delete _0x96411['name'];}_0x4401e5['status'](_0x25ee33)['send'](_0x96411);};}exports[_0xcb71('0x24')]=function(_0x44a4ee,_0x58c492){var _0x80eb67={'raw':!![]},_0x20ca97={},_0x35be89={'count':0x0,'rows':[]};var _0x148349=db[_0xcb71('0x25')][_0xcb71('0x26')];_0x20ca97[_0xcb71('0x27')]=_[_0xcb71('0x28')](_0x148349);var _0x12ba28={'dateStart':_0x44a4ee[_0xcb71('0x29')][_0xcb71('0x2a')],'dateEnd':_0x44a4ee['query'][_0xcb71('0x2b')]};delete _0x44a4ee[_0xcb71('0x29')]['dateStart'];delete _0x44a4ee['query'][_0xcb71('0x2b')];_0x20ca97[_0xcb71('0x29')]=_[_0xcb71('0x28')](_0x44a4ee['query']);_0x20ca97['filters']=_['intersection'](_0x20ca97[_0xcb71('0x27')],_0x20ca97[_0xcb71('0x29')]);_0x80eb67['attributes']=_[_0xcb71('0x2c')](_0x20ca97[_0xcb71('0x27')],qs[_0xcb71('0x2d')](_0x44a4ee[_0xcb71('0x29')][_0xcb71('0x2d')]));_0x80eb67[_0xcb71('0x2e')]=_0x80eb67[_0xcb71('0x2e')][_0xcb71('0x2f')]?_0x80eb67['attributes']:_0x20ca97[_0xcb71('0x27')];if(!_0x44a4ee['query'][_0xcb71('0x30')](_0xcb71('0x31'))){_0x80eb67[_0xcb71('0x32')]=qs[_0xcb71('0x32')](_0x44a4ee[_0xcb71('0x29')][_0xcb71('0x32')]);_0x80eb67[_0xcb71('0x1d')]=qs[_0xcb71('0x1d')](_0x44a4ee[_0xcb71('0x29')][_0xcb71('0x1d')]);}_0x80eb67[_0xcb71('0x33')]=qs[_0xcb71('0x34')](_0x44a4ee['query'][_0xcb71('0x34')]);_0x80eb67[_0xcb71('0x35')]=qs['filters'](_['pick'](_0x44a4ee[_0xcb71('0x29')],_0x20ca97[_0xcb71('0x36')]));if(_0x12ba28[_0xcb71('0x2a')]){if(_0x12ba28[_0xcb71('0x2b')]){_0x12ba28[_0xcb71('0x2b')]=moment(_0x12ba28['dateEnd'])[_0xcb71('0x37')](0x1,_0xcb71('0x38'));}else{_0x12ba28[_0xcb71('0x2b')]=moment(_0x12ba28['dateStart'])[_0xcb71('0x37')](0x1,'day');}_['merge'](_0x80eb67[_0xcb71('0x35')],{'createdAt':{'$gte':_0x12ba28[_0xcb71('0x2a')],'$lte':_0x12ba28[_0xcb71('0x2b')]}});}if(_0x44a4ee['query'][_0xcb71('0x39')]){_0x80eb67[_0xcb71('0x35')]=_['merge'](_0x80eb67[_0xcb71('0x35')],{'$or':_['map'](_0x148349,function(_0x1a8b8e){if(_0x1a8b8e[_0xcb71('0x3a')]['key']!==_0xcb71('0x3b')){var _0x190392={};_0x190392[_0x1a8b8e[_0xcb71('0x3c')]]={'$like':'%'+_0x44a4ee['query']['filter']+'%'};return _0x190392;}})});}_0x80eb67=_[_0xcb71('0x3d')]({},_0x80eb67,_0x44a4ee[_0xcb71('0x3e')]);var _0x5b4151={'where':_0x80eb67[_0xcb71('0x35')]};return db[_0xcb71('0x25')][_0xcb71('0x3f')](_0x5b4151)[_0xcb71('0x22')](function(_0xc4d883){_0x35be89[_0xcb71('0x3f')]=_0xc4d883;if(_0x44a4ee['query'][_0xcb71('0x40')]){_0x80eb67[_0xcb71('0x41')]=[{'all':!![]}];}return db[_0xcb71('0x25')]['findAll'](_0x80eb67);})[_0xcb71('0x22')](function(_0x12e5ad){_0x35be89['rows']=_0x12e5ad;return _0x35be89;})[_0xcb71('0x22')](respondWithFilteredResult(_0x58c492,_0x80eb67))[_0xcb71('0x42')](handleError(_0x58c492,null));};exports['show']=function(_0x9cae29,_0x22e12a){var _0x32637a={'raw':!![],'where':{'id':_0x9cae29['params']['id']}},_0x12af36={};_0x12af36[_0xcb71('0x27')]=_['keys'](db[_0xcb71('0x25')][_0xcb71('0x26')]);_0x12af36[_0xcb71('0x29')]=_[_0xcb71('0x28')](_0x9cae29[_0xcb71('0x29')]);_0x12af36[_0xcb71('0x36')]=_[_0xcb71('0x2c')](_0x12af36['model'],_0x12af36[_0xcb71('0x29')]);_0x32637a['attributes']=_['intersection'](_0x12af36[_0xcb71('0x27')],qs[_0xcb71('0x2d')](_0x9cae29[_0xcb71('0x29')][_0xcb71('0x2d')]));_0x32637a['attributes']=_0x32637a[_0xcb71('0x2e')][_0xcb71('0x2f')]?_0x32637a[_0xcb71('0x2e')]:_0x12af36['model'];if(_0x9cae29[_0xcb71('0x29')][_0xcb71('0x40')]){_0x32637a[_0xcb71('0x41')]=[{'all':!![]}];}_0x32637a=_[_0xcb71('0x3d')]({},_0x32637a,_0x9cae29[_0xcb71('0x3e')]);return db[_0xcb71('0x25')][_0xcb71('0x43')](_0x32637a)['then'](handleEntityNotFound(_0x22e12a,null))[_0xcb71('0x22')](respondWithResult(_0x22e12a,null))[_0xcb71('0x42')](handleError(_0x22e12a,null));};exports[_0xcb71('0x44')]=function(_0x147d3e,_0x13ce8e){return db[_0xcb71('0x25')]['create'](_0x147d3e['body'],{})[_0xcb71('0x22')](respondWithResult(_0x13ce8e,0xc9))[_0xcb71('0x42')](handleError(_0x13ce8e,null));};exports[_0xcb71('0x21')]=function(_0x2585e1,_0x2da7d9){if(_0x2585e1[_0xcb71('0x45')]['id']){delete _0x2585e1[_0xcb71('0x45')]['id'];}return db[_0xcb71('0x25')]['find']({'where':{'id':_0x2585e1[_0xcb71('0x46')]['id']}})[_0xcb71('0x22')](handleEntityNotFound(_0x2da7d9,null))[_0xcb71('0x22')](saveUpdates(_0x2585e1[_0xcb71('0x45')],null))[_0xcb71('0x22')](respondWithResult(_0x2da7d9,null))[_0xcb71('0x42')](handleError(_0x2da7d9,null));};exports[_0xcb71('0x47')]=function(_0x3732a5,_0x4e02b){return db[_0xcb71('0x25')][_0xcb71('0x43')]({'where':{'id':_0x3732a5[_0xcb71('0x46')]['id']}})[_0xcb71('0x22')](handleEntityNotFound(_0x4e02b,null))[_0xcb71('0x22')](removeEntity(_0x4e02b,null))[_0xcb71('0x42')](handleError(_0x4e02b,null));};exports['describe']=function(_0x40ba34,_0x2f5dfe){return db[_0xcb71('0x25')][_0xcb71('0x48')]()[_0xcb71('0x22')](respondWithResult(_0x2f5dfe,null))[_0xcb71('0x42')](handleError(_0x2f5dfe,null));}; \ No newline at end of file +var _0xa91e=['ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','save','update','destroy','error','stack','name','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','options','SAProductOrder','then','includeAll','include','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x4caab9,_0x5753cd){var _0x294f0f=function(_0x44a756){while(--_0x44a756){_0x4caab9['push'](_0x4caab9['shift']());}};_0x294f0f(++_0x5753cd);}(_0xa91e,0xd4));var _0xea91=function(_0x4e03eb,_0x5b1668){_0x4e03eb=_0x4e03eb-0x0;var _0x1e0d4c=_0xa91e[_0x4e03eb];return _0x1e0d4c;};'use strict';var pdf=require(_0xea91('0x0'));var emlformat=require(_0xea91('0x1'));var rimraf=require(_0xea91('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea91('0x3'));var rp=require(_0xea91('0x4'));var moment=require(_0xea91('0x5'));var BPromise=require(_0xea91('0x6'));var Mustache=require(_0xea91('0x7'));var util=require('util');var path=require(_0xea91('0x8'));var sox=require(_0xea91('0x9'));var csv=require('to-csv');var ejs=require(_0xea91('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea91('0xb'));var crypto=require(_0xea91('0xc'));var jsforce=require(_0xea91('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea91('0xe'));var Papa=require('papaparse');var Redis=require(_0xea91('0xf'));var qs=require(_0xea91('0x10'));var logger=require(_0xea91('0x11'))(_0xea91('0x12'));var utils=require(_0xea91('0x13'));var config=require(_0xea91('0x14'));var db=require(_0xea91('0x15'))['db'];function respondWithStatusCode(_0x436f6b,_0x4348e1){_0x4348e1=_0x4348e1||0xcc;return function(_0x33281a){if(_0x33281a){return _0x436f6b[_0xea91('0x16')](_0x4348e1);}return _0x436f6b['status'](_0x4348e1)[_0xea91('0x17')]();};}function respondWithResult(_0x5017af,_0x58cd55){_0x58cd55=_0x58cd55||0xc8;return function(_0x4de461){if(_0x4de461){return _0x5017af[_0xea91('0x18')](_0x58cd55)[_0xea91('0x19')](_0x4de461);}};}function respondWithFilteredResult(_0x3f4584,_0x50f135){return function(_0x1a276b){if(_0x1a276b){var _0x446ac5=_0x1a276b[_0xea91('0x1a')],_0x14371f=_0x50f135[_0xea91('0x1b')],_0x1c9aa0=_0x50f135[_0xea91('0x1b')]+_0x50f135[_0xea91('0x1c')],_0x21f6b1;if(_0x1c9aa0>=_0x446ac5){_0x1c9aa0=_0x446ac5;_0x21f6b1=0xc8;}else{_0x21f6b1=0xce;}_0x3f4584[_0xea91('0x18')](_0x21f6b1);return _0x3f4584[_0xea91('0x1d')]('Content-Range',_0x14371f+'-'+_0x1c9aa0+'/'+_0x446ac5)[_0xea91('0x19')](_0x1a276b);}return null;};}function patchUpdates(_0x8e2cff){return function(_0x548ee1){try{jsonpatch['apply'](_0x548ee1,_0x8e2cff,!![]);}catch(_0x39c426){return BPromise['reject'](_0x39c426);}return _0x548ee1[_0xea91('0x1e')]();};}function saveUpdates(_0x5ad64a,_0x31016c){return function(_0x172c84){if(_0x172c84){return _0x172c84[_0xea91('0x1f')](_0x5ad64a)['then'](function(_0xcf7b2e){return _0xcf7b2e;});}return null;};}function removeEntity(_0xc92515,_0x199d43){return function(_0x52482a){if(_0x52482a){return _0x52482a[_0xea91('0x20')]()['then'](function(){_0xc92515['status'](0xcc)[_0xea91('0x17')]();});}};}function handleEntityNotFound(_0x42c491,_0x4368c0){return function(_0x54d1e6){if(!_0x54d1e6){_0x42c491[_0xea91('0x16')](0x194);}return _0x54d1e6;};}function handleError(_0x418caa,_0x30a57f){_0x30a57f=_0x30a57f||0x1f4;return function(_0x2a5b46){logger[_0xea91('0x21')](_0x2a5b46[_0xea91('0x22')]);if(_0x2a5b46['name']){delete _0x2a5b46[_0xea91('0x23')];}_0x418caa[_0xea91('0x18')](_0x30a57f)['send'](_0x2a5b46);};}exports['index']=function(_0x2ee24a,_0x330a25){var _0x22e66c={'raw':!![]},_0x4fe9ef={},_0x8f277a={'count':0x0,'rows':[]};var _0x435af5=db['SAProductOrder'][_0xea91('0x24')];_0x4fe9ef['model']=_[_0xea91('0x25')](_0x435af5);var _0x120201={'dateStart':_0x2ee24a[_0xea91('0x26')][_0xea91('0x27')],'dateEnd':_0x2ee24a[_0xea91('0x26')][_0xea91('0x28')]};delete _0x2ee24a['query'][_0xea91('0x27')];delete _0x2ee24a[_0xea91('0x26')]['dateEnd'];_0x4fe9ef['query']=_[_0xea91('0x25')](_0x2ee24a[_0xea91('0x26')]);_0x4fe9ef[_0xea91('0x29')]=_[_0xea91('0x2a')](_0x4fe9ef['model'],_0x4fe9ef[_0xea91('0x26')]);_0x22e66c[_0xea91('0x2b')]=_[_0xea91('0x2a')](_0x4fe9ef[_0xea91('0x2c')],qs[_0xea91('0x2d')](_0x2ee24a[_0xea91('0x26')]['fields']));_0x22e66c[_0xea91('0x2b')]=_0x22e66c[_0xea91('0x2b')][_0xea91('0x2e')]?_0x22e66c[_0xea91('0x2b')]:_0x4fe9ef['model'];if(!_0x2ee24a[_0xea91('0x26')][_0xea91('0x2f')](_0xea91('0x30'))){_0x22e66c[_0xea91('0x1c')]=qs['limit'](_0x2ee24a[_0xea91('0x26')]['limit']);_0x22e66c[_0xea91('0x1b')]=qs['offset'](_0x2ee24a['query'][_0xea91('0x1b')]);}_0x22e66c[_0xea91('0x31')]=qs[_0xea91('0x32')](_0x2ee24a[_0xea91('0x26')]['sort']);_0x22e66c[_0xea91('0x33')]=qs[_0xea91('0x29')](_[_0xea91('0x34')](_0x2ee24a[_0xea91('0x26')],_0x4fe9ef['filters']));if(_0x120201[_0xea91('0x27')]){if(_0x120201[_0xea91('0x28')]){_0x120201[_0xea91('0x28')]=moment(_0x120201[_0xea91('0x28')])[_0xea91('0x35')](0x1,'day');}else{_0x120201[_0xea91('0x28')]=moment(_0x120201['dateStart'])['add'](0x1,_0xea91('0x36'));}_[_0xea91('0x37')](_0x22e66c[_0xea91('0x33')],{'createdAt':{'$gte':_0x120201[_0xea91('0x27')],'$lte':_0x120201[_0xea91('0x28')]}});}if(_0x2ee24a[_0xea91('0x26')][_0xea91('0x38')]){_0x22e66c[_0xea91('0x33')]=_[_0xea91('0x37')](_0x22e66c[_0xea91('0x33')],{'$or':_[_0xea91('0x39')](_0x435af5,function(_0x32e250){if(_0x32e250['type'][_0xea91('0x3a')]!==_0xea91('0x3b')){var _0x38d565={};_0x38d565[_0x32e250[_0xea91('0x3c')]]={'$like':'%'+_0x2ee24a[_0xea91('0x26')]['filter']+'%'};return _0x38d565;}})});}_0x22e66c=_[_0xea91('0x37')]({},_0x22e66c,_0x2ee24a[_0xea91('0x3d')]);var _0xdbaedd={'where':_0x22e66c['where']};return db[_0xea91('0x3e')][_0xea91('0x1a')](_0xdbaedd)[_0xea91('0x3f')](function(_0x50e4c2){_0x8f277a['count']=_0x50e4c2;if(_0x2ee24a[_0xea91('0x26')][_0xea91('0x40')]){_0x22e66c[_0xea91('0x41')]=[{'all':!![]}];}return db[_0xea91('0x3e')]['findAll'](_0x22e66c);})['then'](function(_0x2e5ea6){_0x8f277a[_0xea91('0x42')]=_0x2e5ea6;return _0x8f277a;})[_0xea91('0x3f')](respondWithFilteredResult(_0x330a25,_0x22e66c))[_0xea91('0x43')](handleError(_0x330a25,null));};exports[_0xea91('0x44')]=function(_0x23f772,_0x1f3c0e){var _0x284e1b={'raw':!![],'where':{'id':_0x23f772[_0xea91('0x45')]['id']}},_0x45d0cb={};_0x45d0cb[_0xea91('0x2c')]=_[_0xea91('0x25')](db['SAProductOrder'][_0xea91('0x24')]);_0x45d0cb[_0xea91('0x26')]=_['keys'](_0x23f772[_0xea91('0x26')]);_0x45d0cb['filters']=_[_0xea91('0x2a')](_0x45d0cb[_0xea91('0x2c')],_0x45d0cb[_0xea91('0x26')]);_0x284e1b['attributes']=_[_0xea91('0x2a')](_0x45d0cb[_0xea91('0x2c')],qs[_0xea91('0x2d')](_0x23f772[_0xea91('0x26')][_0xea91('0x2d')]));_0x284e1b['attributes']=_0x284e1b[_0xea91('0x2b')][_0xea91('0x2e')]?_0x284e1b[_0xea91('0x2b')]:_0x45d0cb[_0xea91('0x2c')];if(_0x23f772[_0xea91('0x26')][_0xea91('0x40')]){_0x284e1b[_0xea91('0x41')]=[{'all':!![]}];}_0x284e1b=_[_0xea91('0x37')]({},_0x284e1b,_0x23f772[_0xea91('0x3d')]);return db['SAProductOrder']['find'](_0x284e1b)[_0xea91('0x3f')](handleEntityNotFound(_0x1f3c0e,null))[_0xea91('0x3f')](respondWithResult(_0x1f3c0e,null))[_0xea91('0x43')](handleError(_0x1f3c0e,null));};exports[_0xea91('0x46')]=function(_0x42fe76,_0x3bfd25){return db[_0xea91('0x3e')][_0xea91('0x46')](_0x42fe76[_0xea91('0x47')],{})[_0xea91('0x3f')](respondWithResult(_0x3bfd25,0xc9))[_0xea91('0x43')](handleError(_0x3bfd25,null));};exports[_0xea91('0x1f')]=function(_0xa5f53a,_0xb35b4b){if(_0xa5f53a['body']['id']){delete _0xa5f53a[_0xea91('0x47')]['id'];}return db[_0xea91('0x3e')][_0xea91('0x48')]({'where':{'id':_0xa5f53a['params']['id']}})[_0xea91('0x3f')](handleEntityNotFound(_0xb35b4b,null))['then'](saveUpdates(_0xa5f53a[_0xea91('0x47')],null))[_0xea91('0x3f')](respondWithResult(_0xb35b4b,null))[_0xea91('0x43')](handleError(_0xb35b4b,null));};exports[_0xea91('0x20')]=function(_0x5efac6,_0x4237e5){return db[_0xea91('0x3e')]['find']({'where':{'id':_0x5efac6['params']['id']}})['then'](handleEntityNotFound(_0x4237e5,null))[_0xea91('0x3f')](removeEntity(_0x4237e5,null))[_0xea91('0x43')](handleError(_0x4237e5,null));};exports[_0xea91('0x49')]=function(_0x413d21,_0x5e5834){return db[_0xea91('0x3e')][_0xea91('0x49')]()[_0xea91('0x3f')](respondWithResult(_0x5e5834,null))['catch'](handleError(_0x5e5834,null));}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.model.js b/server/api/saProductOrder/saProductOrder.model.js index cb0c3fa..8c3ab4a 100644 --- a/server/api/saProductOrder/saProductOrder.model.js +++ b/server/api/saProductOrder/saProductOrder.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72cd=['moment','bluebird','./saProductOrder.attributes','exports','define','SAProductOrder','sa_product_has_order','lodash','util','../../config/logger','api'];(function(_0x3d062c,_0xf927fd){var _0x41d9aa=function(_0x553e01){while(--_0x553e01){_0x3d062c['push'](_0x3d062c['shift']());}};_0x41d9aa(++_0xf927fd);}(_0x72cd,0x19e));var _0xd72c=function(_0x2909d6,_0x1a6b76){_0x2909d6=_0x2909d6-0x0;var _0x358af5=_0x72cd[_0x2909d6];return _0x358af5;};'use strict';var _=require(_0xd72c('0x0'));var util=require(_0xd72c('0x1'));var logger=require(_0xd72c('0x2'))(_0xd72c('0x3'));var moment=require(_0xd72c('0x4'));var BPromise=require(_0xd72c('0x5'));var rp=require('request-promise');var attributes=require(_0xd72c('0x6'));module[_0xd72c('0x7')]=function(_0x1b207f,_0x32c43a){return _0x1b207f[_0xd72c('0x8')](_0xd72c('0x9'),attributes,{'tableName':_0xd72c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56f7=['api','moment','bluebird','request-promise','./saProductOrder.attributes','define','SAProductOrder','lodash','util'];(function(_0x245f4f,_0xed9b80){var _0x488d32=function(_0x50e39b){while(--_0x50e39b){_0x245f4f['push'](_0x245f4f['shift']());}};_0x488d32(++_0xed9b80);}(_0x56f7,0x181));var _0x756f=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x56f7[_0x319784];return _0x1917da;};'use strict';var _=require(_0x756f('0x0'));var util=require(_0x756f('0x1'));var logger=require('../../config/logger')(_0x756f('0x2'));var moment=require(_0x756f('0x3'));var BPromise=require(_0x756f('0x4'));var rp=require(_0x756f('0x5'));var attributes=require(_0x756f('0x6'));module['exports']=function(_0xff86b1,_0xa1af73){return _0xff86b1[_0x756f('0x7')](_0x756f('0x8'),attributes,{'tableName':'sa_product_has_order','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.rpc.js b/server/api/saProductOrder/saProductOrder.rpc.js index 1be5bc1..b0244e4 100644 --- a/server/api/saProductOrder/saProductOrder.rpc.js +++ b/server/api/saProductOrder/saProductOrder.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9736=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','SAProductOrder,\x20%s,\x20%s','request\x20sent','debug','SAProductOrder,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4c89b3,_0xe78b59){var _0x5eaa7a=function(_0x2b6a65){while(--_0x2b6a65){_0x4c89b3['push'](_0x4c89b3['shift']());}};_0x5eaa7a(++_0xe78b59);}(_0x9736,0x92));var _0x6973=function(_0x4fd4b7,_0x642ff4){_0x4fd4b7=_0x4fd4b7-0x0;var _0x5f55d4=_0x9736[_0x4fd4b7];return _0x5f55d4;};'use strict';var _=require(_0x6973('0x0'));var util=require(_0x6973('0x1'));var moment=require(_0x6973('0x2'));var BPromise=require('bluebird');var rs=require(_0x6973('0x3'));var fs=require('fs');var Redis=require(_0x6973('0x4'));var db=require(_0x6973('0x5'))['db'];var utils=require(_0x6973('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6973('0x7')][_0x6973('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d5f37,_0x2ba1a3,_0x405662){return new BPromise(function(_0x4682a1,_0x144a5a){return client[_0x6973('0x9')](_0x3d5f37,_0x405662)[_0x6973('0xa')](function(_0x56b4fd){logger[_0x6973('0xb')](_0x6973('0xc'),_0x2ba1a3,_0x6973('0xd'));logger[_0x6973('0xe')](_0x6973('0xf'),_0x2ba1a3,_0x6973('0xd'),JSON[_0x6973('0x10')](_0x56b4fd));if(_0x56b4fd[_0x6973('0x11')]){if(_0x56b4fd['error']['code']===0x1f4){logger[_0x6973('0x11')](_0x6973('0xc'),_0x2ba1a3,_0x56b4fd[_0x6973('0x11')]['message']);return _0x144a5a(_0x56b4fd[_0x6973('0x11')]['message']);}logger[_0x6973('0x11')](_0x6973('0xc'),_0x2ba1a3,_0x56b4fd[_0x6973('0x11')][_0x6973('0x12')]);return _0x4682a1(_0x56b4fd[_0x6973('0x11')]['message']);}else{logger[_0x6973('0xb')](_0x6973('0xc'),_0x2ba1a3,_0x6973('0xd'));_0x4682a1(_0x56b4fd[_0x6973('0x13')][_0x6973('0x12')]);}})[_0x6973('0x14')](function(_0x26ce1f){logger[_0x6973('0x11')](_0x6973('0xc'),_0x2ba1a3,_0x26ce1f);_0x144a5a(_0x26ce1f);});});} \ No newline at end of file +var _0xe14c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SAProductOrder,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','lodash','util','moment'];(function(_0x598a08,_0x273b67){var _0x143583=function(_0x91f8a9){while(--_0x91f8a9){_0x598a08['push'](_0x598a08['shift']());}};_0x143583(++_0x273b67);}(_0xe14c,0xfa));var _0xce14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe14c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce14('0x0'));var util=require(_0xce14('0x1'));var moment=require(_0xce14('0x2'));var BPromise=require(_0xce14('0x3'));var rs=require(_0xce14('0x4'));var fs=require('fs');var Redis=require(_0xce14('0x5'));var db=require(_0xce14('0x6'))['db'];var utils=require(_0xce14('0x7'));var logger=require(_0xce14('0x8'))(_0xce14('0x9'));var config=require(_0xce14('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xce14('0xb')][_0xce14('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32cbde,_0x1d0413,_0x2faf2b){return new BPromise(function(_0x5318eb,_0x48b8f4){return client['request'](_0x32cbde,_0x2faf2b)[_0xce14('0xd')](function(_0x156ee1){logger['info'](_0xce14('0xe'),_0x1d0413,_0xce14('0xf'));logger[_0xce14('0x10')]('SAProductOrder,\x20%s,\x20%s,\x20%s',_0x1d0413,_0xce14('0xf'),JSON['stringify'](_0x156ee1));if(_0x156ee1['error']){if(_0x156ee1['error'][_0xce14('0x11')]===0x1f4){logger[_0xce14('0x12')](_0xce14('0xe'),_0x1d0413,_0x156ee1['error'][_0xce14('0x13')]);return _0x48b8f4(_0x156ee1['error'][_0xce14('0x13')]);}logger[_0xce14('0x12')](_0xce14('0xe'),_0x1d0413,_0x156ee1['error']['message']);return _0x5318eb(_0x156ee1[_0xce14('0x12')][_0xce14('0x13')]);}else{logger[_0xce14('0x14')]('SAProductOrder,\x20%s,\x20%s',_0x1d0413,_0xce14('0xf'));_0x5318eb(_0x156ee1[_0xce14('0x15')]['message']);}})[_0xce14('0x16')](function(_0x21dbee){logger[_0xce14('0x12')](_0xce14('0xe'),_0x1d0413,_0x21dbee);_0x48b8f4(_0x21dbee);});});} \ No newline at end of file diff --git a/server/api/saProductPricesList/index.js b/server/api/saProductPricesList/index.js index f6d923b..2c36f31 100644 --- a/server/api/saProductPricesList/index.js +++ b/server/api/saProductPricesList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductPricesList.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x475ef2,_0x4ede74){var _0x51d673=function(_0x2207cb){while(--_0x2207cb){_0x475ef2['push'](_0x475ef2['shift']());}};_0x51d673(++_0x4ede74);}(_0x34e8,0x12c));var _0x834e=function(_0xb7cc9,_0x523cf6){_0xb7cc9=_0xb7cc9-0x0;var _0x57e2c8=_0x34e8[_0xb7cc9];return _0x57e2c8;};'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')]('/describe',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('0x10')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductPricesList.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x36f693,_0x5a34e7){var _0x4c2481=function(_0x257f43){while(--_0x257f43){_0x36f693['push'](_0x36f693['shift']());}};_0x4c2481(++_0x5a34e7);}(_0x34e8,0x12c));var _0x834e=function(_0xf79b46,_0x40e2f6){_0xf79b46=_0xf79b46-0x0;var _0x4e576a=_0x34e8[_0xf79b46];return _0x4e576a;};'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')]('/describe',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('0x10')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.attributes.js b/server/api/saProductPricesList/saProductPricesList.attributes.js index d9deffa..2c62bf8 100644 --- a/server/api/saProductPricesList/saProductPricesList.attributes.js +++ b/server/api/saProductPricesList/saProductPricesList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f64=['DECIMAL','INTEGER','compositeIndex_prodID_priceID'];(function(_0x28e933,_0x4465c9){var _0x102496=function(_0x1bf210){while(--_0x1bf210){_0x28e933['push'](_0x28e933['shift']());}};_0x102496(++_0x4465c9);}(_0x2f64,0x189));var _0x42f6=function(_0x1ce67b,_0x5d1e9f){_0x1ce67b=_0x1ce67b-0x0;var _0xc64cb0=_0x2f64[_0x1ce67b];return _0xc64cb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'discount':{'type':Sequelize[_0x42f6('0x0')](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize[_0x42f6('0x0')](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0x42f6('0x1')],'unique':'compositeIndex_prodID_priceID'},'PriceListId':{'type':Sequelize['INTEGER'],'unique':_0x42f6('0x2')}}; \ No newline at end of file +var _0x2a05=['DECIMAL','INTEGER','compositeIndex_prodID_priceID','sequelize','exports'];(function(_0x45b758,_0x2aabad){var _0x53caa4=function(_0x4b4ed9){while(--_0x4b4ed9){_0x45b758['push'](_0x45b758['shift']());}};_0x53caa4(++_0x2aabad);}(_0x2a05,0x139));var _0x52a0=function(_0x213632,_0x4db94f){_0x213632=_0x213632-0x0;var _0x450e34=_0x2a05[_0x213632];return _0x450e34;};'use strict';var Sequelize=require(_0x52a0('0x0'));module[_0x52a0('0x1')]={'discount':{'type':Sequelize[_0x52a0('0x2')](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize[_0x52a0('0x2')](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0x52a0('0x3')],'unique':_0x52a0('0x4')},'PriceListId':{'type':Sequelize[_0x52a0('0x3')],'unique':_0x52a0('0x4')}}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.controller.js b/server/api/saProductPricesList/saProductPricesList.controller.js index 86c1090..4f31c57 100644 --- a/server/api/saProductPricesList/saProductPricesList.controller.js +++ b/server/api/saProductPricesList/saProductPricesList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1a8=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','SAProductPricesList','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','where','pick','filter','merge','map','VIRTUAL','options','count','include','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x17cc14,_0x494ee3){var _0x5df73c=function(_0x47201d){while(--_0x47201d){_0x17cc14['push'](_0x17cc14['shift']());}};_0x5df73c(++_0x494ee3);}(_0xb1a8,0x1da));var _0x8b1a=function(_0xf0687c,_0x3c97b7){_0xf0687c=_0xf0687c-0x0;var _0x2a3cd5=_0xb1a8[_0xf0687c];return _0x2a3cd5;};'use strict';var pdf=require(_0x8b1a('0x0'));var emlformat=require(_0x8b1a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8b1a('0x2'));var jsonpatch=require(_0x8b1a('0x3'));var rp=require(_0x8b1a('0x4'));var moment=require(_0x8b1a('0x5'));var BPromise=require(_0x8b1a('0x6'));var Mustache=require(_0x8b1a('0x7'));var util=require(_0x8b1a('0x8'));var path=require('path');var sox=require(_0x8b1a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8b1a('0xa'));var squel=require(_0x8b1a('0xb'));var crypto=require(_0x8b1a('0xc'));var jsforce=require(_0x8b1a('0xd'));var deskjs=require(_0x8b1a('0xe'));var toCsv=require(_0x8b1a('0xf'));var querystring=require(_0x8b1a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b1a('0x11'));var qs=require(_0x8b1a('0x12'));var hardwareService=require(_0x8b1a('0x13'));var logger=require(_0x8b1a('0x14'))(_0x8b1a('0x15'));var utils=require('../../config/utils');var config=require(_0x8b1a('0x16'));var db=require(_0x8b1a('0x17'))['db'];function respondWithStatusCode(_0x54405d,_0x36e333){_0x36e333=_0x36e333||0xcc;return function(_0x5cd0d8){if(_0x5cd0d8){return _0x54405d['sendStatus'](_0x36e333);}return _0x54405d[_0x8b1a('0x18')](_0x36e333)['end']();};}function respondWithResult(_0x163539,_0x1d70e9){_0x1d70e9=_0x1d70e9||0xc8;return function(_0x3864b7){if(_0x3864b7){return _0x163539[_0x8b1a('0x18')](_0x1d70e9)[_0x8b1a('0x19')](_0x3864b7);}};}function respondWithFilteredResult(_0x2c3271,_0x11a541){return function(_0x46a4c5){if(_0x46a4c5){var _0x18055e=_0x46a4c5['count'],_0x1b92d6=_0x11a541[_0x8b1a('0x1a')],_0x5968c3=_0x11a541[_0x8b1a('0x1a')]+_0x11a541[_0x8b1a('0x1b')],_0x29a16c;if(_0x5968c3>=_0x18055e){_0x5968c3=_0x18055e;_0x29a16c=0xc8;}else{_0x29a16c=0xce;}_0x2c3271[_0x8b1a('0x18')](_0x29a16c);return _0x2c3271[_0x8b1a('0x1c')](_0x8b1a('0x1d'),_0x1b92d6+'-'+_0x5968c3+'/'+_0x18055e)[_0x8b1a('0x19')](_0x46a4c5);}return null;};}function patchUpdates(_0x39678b){return function(_0xe4e4b6){try{jsonpatch[_0x8b1a('0x1e')](_0xe4e4b6,_0x39678b,!![]);}catch(_0x370251){return BPromise[_0x8b1a('0x1f')](_0x370251);}return _0xe4e4b6['save']();};}function saveUpdates(_0x24ef1a,_0x1c65cc){return function(_0x558057){if(_0x558057){return _0x558057[_0x8b1a('0x20')](_0x24ef1a)[_0x8b1a('0x21')](function(_0x543e72){return _0x543e72;});}return null;};}function removeEntity(_0x48ac0d,_0xa9f685){return function(_0x230a1f){if(_0x230a1f){return _0x230a1f[_0x8b1a('0x22')]()[_0x8b1a('0x21')](function(){_0x48ac0d[_0x8b1a('0x18')](0xcc)[_0x8b1a('0x23')]();});}};}function handleEntityNotFound(_0x57b651,_0x5be0c5){return function(_0x344c3e){if(!_0x344c3e){_0x57b651[_0x8b1a('0x24')](0x194);}return _0x344c3e;};}function handleError(_0x32ecb5,_0x5f3798){_0x5f3798=_0x5f3798||0x1f4;return function(_0x50ba7a){logger[_0x8b1a('0x25')](_0x50ba7a['stack']);if(_0x50ba7a[_0x8b1a('0x26')]){delete _0x50ba7a[_0x8b1a('0x26')];}_0x32ecb5[_0x8b1a('0x18')](_0x5f3798)[_0x8b1a('0x27')](_0x50ba7a);};}exports[_0x8b1a('0x28')]=function(_0x4984e9,_0x5961a6){var _0x5c2ee2={},_0x62d90a={},_0x1723e3={'count':0x0,'rows':[]};var _0x226dc2=db[_0x8b1a('0x29')][_0x8b1a('0x2a')];_0x62d90a[_0x8b1a('0x2b')]=_[_0x8b1a('0x2c')](_0x226dc2);_0x62d90a[_0x8b1a('0x2d')]=_['keys'](_0x4984e9['query']);_0x62d90a[_0x8b1a('0x2e')]=_['intersection'](_0x62d90a[_0x8b1a('0x2b')],_0x62d90a['query']);_0x5c2ee2[_0x8b1a('0x2f')]=_[_0x8b1a('0x30')](_0x62d90a[_0x8b1a('0x2b')],qs[_0x8b1a('0x31')](_0x4984e9[_0x8b1a('0x2d')]['fields']));_0x5c2ee2[_0x8b1a('0x2f')]=_0x5c2ee2[_0x8b1a('0x2f')][_0x8b1a('0x32')]?_0x5c2ee2['attributes']:_0x62d90a['model'];if(!_0x4984e9[_0x8b1a('0x2d')]['hasOwnProperty'](_0x8b1a('0x33'))){_0x5c2ee2[_0x8b1a('0x1b')]=qs[_0x8b1a('0x1b')](_0x4984e9['query']['limit']);_0x5c2ee2[_0x8b1a('0x1a')]=qs['offset'](_0x4984e9[_0x8b1a('0x2d')][_0x8b1a('0x1a')]);}_0x5c2ee2['order']=qs['sort'](_0x4984e9['query']['sort']);_0x5c2ee2[_0x8b1a('0x34')]=qs[_0x8b1a('0x2e')](_[_0x8b1a('0x35')](_0x4984e9['query'],_0x62d90a[_0x8b1a('0x2e')]));if(_0x4984e9[_0x8b1a('0x2d')][_0x8b1a('0x36')]){_0x5c2ee2[_0x8b1a('0x34')]=_[_0x8b1a('0x37')](_0x5c2ee2[_0x8b1a('0x34')],{'$or':_[_0x8b1a('0x38')](_0x226dc2,function(_0x1e8db6){if(_0x1e8db6['type']['key']!==_0x8b1a('0x39')){var _0x124c47={};_0x124c47[_0x1e8db6['field']]={'$like':'%'+_0x4984e9[_0x8b1a('0x2d')][_0x8b1a('0x36')]+'%'};return _0x124c47;}})});}_0x5c2ee2=_[_0x8b1a('0x37')]({},_0x5c2ee2,_0x4984e9[_0x8b1a('0x3a')]);var _0x2ac7d7={'where':_0x5c2ee2[_0x8b1a('0x34')]};return db[_0x8b1a('0x29')]['count'](_0x2ac7d7)[_0x8b1a('0x21')](function(_0x4970dd){_0x1723e3[_0x8b1a('0x3b')]=_0x4970dd;if(_0x4984e9[_0x8b1a('0x2d')]['includeAll']){_0x5c2ee2[_0x8b1a('0x3c')]=[{'all':!![]}];}return db[_0x8b1a('0x29')][_0x8b1a('0x3d')](_0x5c2ee2);})[_0x8b1a('0x21')](function(_0xa9a7e8){_0x1723e3[_0x8b1a('0x3e')]=_0xa9a7e8;return _0x1723e3;})[_0x8b1a('0x21')](respondWithFilteredResult(_0x5961a6,_0x5c2ee2))['catch'](handleError(_0x5961a6,null));};exports[_0x8b1a('0x3f')]=function(_0x2b1c99,_0x3873f8){var _0x343f8c={'raw':![],'where':{'id':_0x2b1c99[_0x8b1a('0x40')]['id']}},_0x13b0d0={};_0x13b0d0[_0x8b1a('0x2b')]=_['keys'](db['SAProductPricesList'][_0x8b1a('0x2a')]);_0x13b0d0[_0x8b1a('0x2d')]=_[_0x8b1a('0x2c')](_0x2b1c99[_0x8b1a('0x2d')]);_0x13b0d0[_0x8b1a('0x2e')]=_['intersection'](_0x13b0d0[_0x8b1a('0x2b')],_0x13b0d0[_0x8b1a('0x2d')]);_0x343f8c['attributes']=_[_0x8b1a('0x30')](_0x13b0d0[_0x8b1a('0x2b')],qs['fields'](_0x2b1c99[_0x8b1a('0x2d')][_0x8b1a('0x31')]));_0x343f8c['attributes']=_0x343f8c[_0x8b1a('0x2f')]['length']?_0x343f8c[_0x8b1a('0x2f')]:_0x13b0d0[_0x8b1a('0x2b')];if(_0x2b1c99[_0x8b1a('0x2d')]['includeAll']){_0x343f8c[_0x8b1a('0x3c')]=[{'all':!![]}];}_0x343f8c=_[_0x8b1a('0x37')]({},_0x343f8c,_0x2b1c99['options']);return db[_0x8b1a('0x29')]['find'](_0x343f8c)[_0x8b1a('0x21')](handleEntityNotFound(_0x3873f8,null))[_0x8b1a('0x21')](respondWithResult(_0x3873f8,null))[_0x8b1a('0x41')](handleError(_0x3873f8,null));};exports[_0x8b1a('0x42')]=function(_0x460cca,_0x245741){return db[_0x8b1a('0x29')]['create'](_0x460cca['body'],{})[_0x8b1a('0x21')](respondWithResult(_0x245741,0xc9))[_0x8b1a('0x41')](handleError(_0x245741,null));};exports['update']=function(_0x18e275,_0x412d01){if(_0x18e275[_0x8b1a('0x43')]['id']){delete _0x18e275[_0x8b1a('0x43')]['id'];}return db['SAProductPricesList'][_0x8b1a('0x44')]({'where':{'id':_0x18e275[_0x8b1a('0x40')]['id']}})['then'](handleEntityNotFound(_0x412d01,null))[_0x8b1a('0x21')](saveUpdates(_0x18e275[_0x8b1a('0x43')],null))[_0x8b1a('0x21')](respondWithResult(_0x412d01,null))[_0x8b1a('0x41')](handleError(_0x412d01,null));};exports[_0x8b1a('0x22')]=function(_0x94108a,_0x49a532){return db[_0x8b1a('0x29')]['find']({'where':{'id':_0x94108a[_0x8b1a('0x40')]['id']}})[_0x8b1a('0x21')](handleEntityNotFound(_0x49a532,null))['then'](removeEntity(_0x49a532,null))['catch'](handleError(_0x49a532,null));};exports[_0x8b1a('0x45')]=function(_0x5a467a,_0x24ef4f){return db[_0x8b1a('0x29')][_0x8b1a('0x45')]()['then'](respondWithResult(_0x24ef4f,null))['catch'](handleError(_0x24ef4f,null));}; \ No newline at end of file +var _0x11a4=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','SAProductPricesList','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','include','rows','catch','show','params','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xb3eb73,_0x49d849){var _0xca1a5a=function(_0x5050ed){while(--_0x5050ed){_0xb3eb73['push'](_0xb3eb73['shift']());}};_0xca1a5a(++_0x49d849);}(_0x11a4,0x178));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x411a('0x0'));var emlformat=require(_0x411a('0x1'));var rimraf=require(_0x411a('0x2'));var zipdir=require(_0x411a('0x3'));var jsonpatch=require(_0x411a('0x4'));var rp=require(_0x411a('0x5'));var moment=require(_0x411a('0x6'));var BPromise=require(_0x411a('0x7'));var Mustache=require(_0x411a('0x8'));var util=require(_0x411a('0x9'));var path=require(_0x411a('0xa'));var sox=require(_0x411a('0xb'));var csv=require(_0x411a('0xc'));var ejs=require(_0x411a('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x411a('0xe'));var jsforce=require(_0x411a('0xf'));var deskjs=require(_0x411a('0x10'));var toCsv=require(_0x411a('0xc'));var querystring=require(_0x411a('0x11'));var Papa=require(_0x411a('0x12'));var Redis=require(_0x411a('0x13'));var authService=require(_0x411a('0x14'));var qs=require(_0x411a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x411a('0x16'))(_0x411a('0x17'));var utils=require(_0x411a('0x18'));var config=require(_0x411a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd922df,_0x1545f2){_0x1545f2=_0x1545f2||0xcc;return function(_0x12c96b){if(_0x12c96b){return _0xd922df[_0x411a('0x1a')](_0x1545f2);}return _0xd922df[_0x411a('0x1b')](_0x1545f2)[_0x411a('0x1c')]();};}function respondWithResult(_0xe40bbb,_0x38fc4c){_0x38fc4c=_0x38fc4c||0xc8;return function(_0x2dc39f){if(_0x2dc39f){return _0xe40bbb['status'](_0x38fc4c)[_0x411a('0x1d')](_0x2dc39f);}};}function respondWithFilteredResult(_0x238a63,_0x5a85ea){return function(_0x11754c){if(_0x11754c){var _0x1a4449=_0x11754c[_0x411a('0x1e')],_0x193225=_0x5a85ea[_0x411a('0x1f')],_0x16b349=_0x5a85ea[_0x411a('0x1f')]+_0x5a85ea[_0x411a('0x20')],_0x1e719b;if(_0x16b349>=_0x1a4449){_0x16b349=_0x1a4449;_0x1e719b=0xc8;}else{_0x1e719b=0xce;}_0x238a63[_0x411a('0x1b')](_0x1e719b);return _0x238a63[_0x411a('0x21')](_0x411a('0x22'),_0x193225+'-'+_0x16b349+'/'+_0x1a4449)[_0x411a('0x1d')](_0x11754c);}return null;};}function patchUpdates(_0x1acb02){return function(_0x50c92b){try{jsonpatch[_0x411a('0x23')](_0x50c92b,_0x1acb02,!![]);}catch(_0xafa8d5){return BPromise[_0x411a('0x24')](_0xafa8d5);}return _0x50c92b[_0x411a('0x25')]();};}function saveUpdates(_0x267850,_0x462c71){return function(_0x469ab5){if(_0x469ab5){return _0x469ab5[_0x411a('0x26')](_0x267850)[_0x411a('0x27')](function(_0x251127){return _0x251127;});}return null;};}function removeEntity(_0x4e0b14,_0x4d0641){return function(_0x4dc11c){if(_0x4dc11c){return _0x4dc11c[_0x411a('0x28')]()['then'](function(){_0x4e0b14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cddc6,_0x1543c8){return function(_0x57780c){if(!_0x57780c){_0x1cddc6[_0x411a('0x1a')](0x194);}return _0x57780c;};}function handleError(_0x37db3d,_0x789d5){_0x789d5=_0x789d5||0x1f4;return function(_0xf9a45){logger[_0x411a('0x29')](_0xf9a45[_0x411a('0x2a')]);if(_0xf9a45['name']){delete _0xf9a45['name'];}_0x37db3d[_0x411a('0x1b')](_0x789d5)[_0x411a('0x2b')](_0xf9a45);};}exports[_0x411a('0x2c')]=function(_0x2801c9,_0x3adf26){var _0x39795e={},_0x550113={},_0x1ba79a={'count':0x0,'rows':[]};var _0x859705=db[_0x411a('0x2d')][_0x411a('0x2e')];_0x550113[_0x411a('0x2f')]=_[_0x411a('0x30')](_0x859705);_0x550113['query']=_[_0x411a('0x30')](_0x2801c9['query']);_0x550113[_0x411a('0x31')]=_[_0x411a('0x32')](_0x550113[_0x411a('0x2f')],_0x550113[_0x411a('0x33')]);_0x39795e['attributes']=_['intersection'](_0x550113[_0x411a('0x2f')],qs[_0x411a('0x34')](_0x2801c9['query'][_0x411a('0x34')]));_0x39795e[_0x411a('0x35')]=_0x39795e[_0x411a('0x35')][_0x411a('0x36')]?_0x39795e[_0x411a('0x35')]:_0x550113[_0x411a('0x2f')];if(!_0x2801c9['query']['hasOwnProperty'](_0x411a('0x37'))){_0x39795e[_0x411a('0x20')]=qs[_0x411a('0x20')](_0x2801c9[_0x411a('0x33')][_0x411a('0x20')]);_0x39795e[_0x411a('0x1f')]=qs['offset'](_0x2801c9[_0x411a('0x33')]['offset']);}_0x39795e[_0x411a('0x38')]=qs[_0x411a('0x39')](_0x2801c9[_0x411a('0x33')][_0x411a('0x39')]);_0x39795e[_0x411a('0x3a')]=qs['filters'](_[_0x411a('0x3b')](_0x2801c9[_0x411a('0x33')],_0x550113[_0x411a('0x31')]));if(_0x2801c9[_0x411a('0x33')][_0x411a('0x3c')]){_0x39795e[_0x411a('0x3a')]=_[_0x411a('0x3d')](_0x39795e[_0x411a('0x3a')],{'$or':_[_0x411a('0x3e')](_0x859705,function(_0x30fd10){if(_0x30fd10[_0x411a('0x3f')]['key']!==_0x411a('0x40')){var _0x35851d={};_0x35851d[_0x30fd10[_0x411a('0x41')]]={'$like':'%'+_0x2801c9[_0x411a('0x33')]['filter']+'%'};return _0x35851d;}})});}_0x39795e=_[_0x411a('0x3d')]({},_0x39795e,_0x2801c9['options']);var _0x302ec5={'where':_0x39795e[_0x411a('0x3a')]};return db[_0x411a('0x2d')]['count'](_0x302ec5)[_0x411a('0x27')](function(_0x137b23){_0x1ba79a['count']=_0x137b23;if(_0x2801c9[_0x411a('0x33')]['includeAll']){_0x39795e[_0x411a('0x42')]=[{'all':!![]}];}return db[_0x411a('0x2d')]['findAll'](_0x39795e);})[_0x411a('0x27')](function(_0x18b6a2){_0x1ba79a[_0x411a('0x43')]=_0x18b6a2;return _0x1ba79a;})[_0x411a('0x27')](respondWithFilteredResult(_0x3adf26,_0x39795e))[_0x411a('0x44')](handleError(_0x3adf26,null));};exports[_0x411a('0x45')]=function(_0x1888eb,_0x306e92){var _0x127686={'raw':![],'where':{'id':_0x1888eb[_0x411a('0x46')]['id']}},_0x24f22c={};_0x24f22c[_0x411a('0x2f')]=_['keys'](db[_0x411a('0x2d')]['rawAttributes']);_0x24f22c[_0x411a('0x33')]=_[_0x411a('0x30')](_0x1888eb['query']);_0x24f22c[_0x411a('0x31')]=_[_0x411a('0x32')](_0x24f22c[_0x411a('0x2f')],_0x24f22c['query']);_0x127686['attributes']=_[_0x411a('0x32')](_0x24f22c['model'],qs[_0x411a('0x34')](_0x1888eb[_0x411a('0x33')][_0x411a('0x34')]));_0x127686[_0x411a('0x35')]=_0x127686['attributes']['length']?_0x127686[_0x411a('0x35')]:_0x24f22c[_0x411a('0x2f')];if(_0x1888eb[_0x411a('0x33')][_0x411a('0x47')]){_0x127686[_0x411a('0x42')]=[{'all':!![]}];}_0x127686=_[_0x411a('0x3d')]({},_0x127686,_0x1888eb[_0x411a('0x48')]);return db['SAProductPricesList'][_0x411a('0x49')](_0x127686)[_0x411a('0x27')](handleEntityNotFound(_0x306e92,null))[_0x411a('0x27')](respondWithResult(_0x306e92,null))[_0x411a('0x44')](handleError(_0x306e92,null));};exports['create']=function(_0x4480a5,_0x4d4972){return db['SAProductPricesList'][_0x411a('0x4a')](_0x4480a5[_0x411a('0x4b')],{})[_0x411a('0x27')](respondWithResult(_0x4d4972,0xc9))['catch'](handleError(_0x4d4972,null));};exports[_0x411a('0x26')]=function(_0x5d016e,_0x1921cf){if(_0x5d016e['body']['id']){delete _0x5d016e[_0x411a('0x4b')]['id'];}return db[_0x411a('0x2d')][_0x411a('0x49')]({'where':{'id':_0x5d016e[_0x411a('0x46')]['id']}})[_0x411a('0x27')](handleEntityNotFound(_0x1921cf,null))[_0x411a('0x27')](saveUpdates(_0x5d016e[_0x411a('0x4b')],null))[_0x411a('0x27')](respondWithResult(_0x1921cf,null))['catch'](handleError(_0x1921cf,null));};exports[_0x411a('0x28')]=function(_0x443b02,_0x2b3ad1){return db[_0x411a('0x2d')][_0x411a('0x49')]({'where':{'id':_0x443b02['params']['id']}})[_0x411a('0x27')](handleEntityNotFound(_0x2b3ad1,null))[_0x411a('0x27')](removeEntity(_0x2b3ad1,null))[_0x411a('0x44')](handleError(_0x2b3ad1,null));};exports[_0x411a('0x4c')]=function(_0xadca22,_0x48a58b){return db[_0x411a('0x2d')][_0x411a('0x4c')]()[_0x411a('0x27')](respondWithResult(_0x48a58b,null))[_0x411a('0x44')](handleError(_0x48a58b,null));}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.model.js b/server/api/saProductPricesList/saProductPricesList.model.js index e1e36a7..dd1a715 100644 --- a/server/api/saProductPricesList/saProductPricesList.model.js +++ b/server/api/saProductPricesList/saProductPricesList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5309=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger'];(function(_0x3b5990,_0x2cad7f){var _0x2e2af7=function(_0x45b1a9){while(--_0x45b1a9){_0x3b5990['push'](_0x3b5990['shift']());}};_0x2e2af7(++_0x2cad7f);}(_0x5309,0x1aa));var _0x9530=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x5309[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0x9530('0x0'));var util=require(_0x9530('0x1'));var logger=require(_0x9530('0x2'))(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require(_0x9530('0x5'));var rp=require(_0x9530('0x6'));var fs=require('fs');var path=require(_0x9530('0x7'));var rimraf=require(_0x9530('0x8'));var config=require(_0x9530('0x9'));var attributes=require('./saProductPricesList.attributes');module['exports']=function(_0x1cb512,_0x187678){return _0x1cb512[_0x9530('0xa')]('SAProductPricesList',attributes,{'tableName':'sa_product_has_price_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x057a=['./saProductPricesList.attributes','define','SAProductPricesList','sa_product_has_price_lists','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x057a,0x1a6));var _0xa057=function(_0x3b94f5,_0x3da3e5){_0x3b94f5=_0x3b94f5-0x0;var _0x461016=_0x057a[_0x3b94f5];return _0x461016;};'use strict';var _=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var logger=require(_0xa057('0x2'))('api');var moment=require(_0xa057('0x3'));var BPromise=require('bluebird');var rp=require(_0xa057('0x4'));var fs=require('fs');var path=require(_0xa057('0x5'));var rimraf=require('rimraf');var config=require(_0xa057('0x6'));var attributes=require(_0xa057('0x7'));module['exports']=function(_0x55b99c,_0x466f7d){return _0x55b99c[_0xa057('0x8')](_0xa057('0x9'),attributes,{'tableName':_0xa057('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.rpc.js b/server/api/saProductPricesList/saProductPricesList.rpc.js index 0abb9a4..983c22e 100644 --- a/server/api/saProductPricesList/saProductPricesList.rpc.js +++ b/server/api/saProductPricesList/saProductPricesList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9004=['info','request\x20sent','debug','stringify','error','message','SAProductPricesList,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x50eaba,_0x32d312){var _0x7721f5=function(_0xa4aedc){while(--_0xa4aedc){_0x50eaba['push'](_0x50eaba['shift']());}};_0x7721f5(++_0x32d312);}(_0x9004,0x1eb));var _0x4900=function(_0x45eec4,_0x14f443){_0x45eec4=_0x45eec4-0x0;var _0x5b8a51=_0x9004[_0x45eec4];return _0x5b8a51;};'use strict';var _=require(_0x4900('0x0'));var util=require(_0x4900('0x1'));var moment=require(_0x4900('0x2'));var BPromise=require(_0x4900('0x3'));var rs=require(_0x4900('0x4'));var fs=require('fs');var Redis=require(_0x4900('0x5'));var db=require(_0x4900('0x6'))['db'];var utils=require(_0x4900('0x7'));var logger=require(_0x4900('0x8'))(_0x4900('0x9'));var config=require(_0x4900('0xa'));var jayson=require(_0x4900('0xb'));var client=jayson[_0x4900('0xc')][_0x4900('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3513ed,_0x3e5fa0,_0x5cea88){return new BPromise(function(_0x477df7,_0x56ec3f){return client[_0x4900('0xe')](_0x3513ed,_0x5cea88)['then'](function(_0x3739a8){logger[_0x4900('0xf')]('SAProductPricesList,\x20%s,\x20%s',_0x3e5fa0,_0x4900('0x10'));logger[_0x4900('0x11')]('SAProductPricesList,\x20%s,\x20%s,\x20%s',_0x3e5fa0,_0x4900('0x10'),JSON[_0x4900('0x12')](_0x3739a8));if(_0x3739a8[_0x4900('0x13')]){if(_0x3739a8[_0x4900('0x13')]['code']===0x1f4){logger['error']('SAProductPricesList,\x20%s,\x20%s',_0x3e5fa0,_0x3739a8['error']['message']);return _0x56ec3f(_0x3739a8['error'][_0x4900('0x14')]);}logger[_0x4900('0x13')](_0x4900('0x15'),_0x3e5fa0,_0x3739a8['error'][_0x4900('0x14')]);return _0x477df7(_0x3739a8['error'][_0x4900('0x14')]);}else{logger['info'](_0x4900('0x15'),_0x3e5fa0,_0x4900('0x10'));_0x477df7(_0x3739a8['result'][_0x4900('0x14')]);}})['catch'](function(_0x470293){logger[_0x4900('0x13')](_0x4900('0x15'),_0x3e5fa0,_0x470293);_0x56ec3f(_0x470293);});});} \ No newline at end of file +var _0x1dec=['jayson/promise','then','SAProductPricesList,\x20%s,\x20%s','request\x20sent','debug','SAProductPricesList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4d2c5f,_0x12d4f6){var _0x1614c5=function(_0x3b00ff){while(--_0x3b00ff){_0x4d2c5f['push'](_0x4d2c5f['shift']());}};_0x1614c5(++_0x12d4f6);}(_0x1dec,0x157));var _0xc1de=function(_0x463c51,_0x2c3628){_0x463c51=_0x463c51-0x0;var _0x43bbfe=_0x1dec[_0x463c51];return _0x43bbfe;};'use strict';var _=require(_0xc1de('0x0'));var util=require(_0xc1de('0x1'));var moment=require(_0xc1de('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1de('0x3'));var fs=require('fs');var Redis=require(_0xc1de('0x4'));var db=require(_0xc1de('0x5'))['db'];var utils=require(_0xc1de('0x6'));var logger=require(_0xc1de('0x7'))('rpc');var config=require(_0xc1de('0x8'));var jayson=require(_0xc1de('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8f4c20,_0x68e4ff,_0x3af1bd){return new BPromise(function(_0x3054a5,_0x58508c){return client['request'](_0x8f4c20,_0x3af1bd)[_0xc1de('0xa')](function(_0x521f1e){logger['info'](_0xc1de('0xb'),_0x68e4ff,_0xc1de('0xc'));logger[_0xc1de('0xd')](_0xc1de('0xe'),_0x68e4ff,_0xc1de('0xc'),JSON[_0xc1de('0xf')](_0x521f1e));if(_0x521f1e[_0xc1de('0x10')]){if(_0x521f1e[_0xc1de('0x10')][_0xc1de('0x11')]===0x1f4){logger[_0xc1de('0x10')](_0xc1de('0xb'),_0x68e4ff,_0x521f1e[_0xc1de('0x10')][_0xc1de('0x12')]);return _0x58508c(_0x521f1e[_0xc1de('0x10')][_0xc1de('0x12')]);}logger[_0xc1de('0x10')]('SAProductPricesList,\x20%s,\x20%s',_0x68e4ff,_0x521f1e[_0xc1de('0x10')]['message']);return _0x3054a5(_0x521f1e[_0xc1de('0x10')][_0xc1de('0x12')]);}else{logger[_0xc1de('0x13')](_0xc1de('0xb'),_0x68e4ff,_0xc1de('0xc'));_0x3054a5(_0x521f1e[_0xc1de('0x14')]['message']);}})[_0xc1de('0x15')](function(_0x3d5773){logger[_0xc1de('0x10')]('SAProductPricesList,\x20%s,\x20%s',_0x68e4ff,_0x3d5773);_0x58508c(_0x3d5773);});});} \ No newline at end of file diff --git a/server/api/saProductQuotation/index.js b/server/api/saProductQuotation/index.js index e51765f..a5e0ec8 100644 --- a/server/api/saProductQuotation/index.js +++ b/server/api/saProductQuotation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbbb=['updateBulk','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','post','/:id/automaticInvoice','automaticInvoice','/:id/automaticProforma','automaticProforma','put','update'];(function(_0x3e948f,_0x19484d){var _0x4cc3de=function(_0x335e95){while(--_0x335e95){_0x3e948f['push'](_0x3e948f['shift']());}};_0x4cc3de(++_0x19484d);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x49e6b4,_0x2f453c){_0x49e6b4=_0x49e6b4-0x0;var _0x20c17f=_0xfbbb[_0x49e6b4];return _0x20c17f;};'use strict';var multer=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var path=require(_0xbfbb('0x2'));var timeout=require(_0xbfbb('0x3'));var express=require(_0xbfbb('0x4'));var router=express[_0xbfbb('0x5')]();var auth=require(_0xbfbb('0x6'));var interaction=require(_0xbfbb('0x7'));var config=require(_0xbfbb('0x8'));var controller=require('./saProductQuotation.controller');router['get']('/',auth[_0xbfbb('0x9')](),controller['index']);router[_0xbfbb('0xa')](_0xbfbb('0xb'),auth[_0xbfbb('0x9')](),controller['describe']);router[_0xbfbb('0xa')](_0xbfbb('0xc'),auth[_0xbfbb('0x9')](),controller[_0xbfbb('0xd')]);router[_0xbfbb('0xe')]('/',auth[_0xbfbb('0x9')](),controller['create']);router[_0xbfbb('0xe')](_0xbfbb('0xf'),auth[_0xbfbb('0x9')](),controller[_0xbfbb('0x10')]);router['post'](_0xbfbb('0x11'),auth[_0xbfbb('0x9')](),controller[_0xbfbb('0x12')]);router[_0xbfbb('0x13')](_0xbfbb('0xc'),auth[_0xbfbb('0x9')](),controller[_0xbfbb('0x14')]);router[_0xbfbb('0x13')]('/:id/updateBulk',auth[_0xbfbb('0x9')](),controller[_0xbfbb('0x15')]);router[_0xbfbb('0x16')](_0xbfbb('0xc'),auth[_0xbfbb('0x9')](),controller['destroy']);module[_0xbfbb('0x17')]=router; \ No newline at end of file +var _0xdec3=['automaticProforma','put','/:id','update','updateBulk','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductQuotation.controller','isAuthenticated','index','get','/describe','describe','show','/:id/automaticInvoice','post','/:id/automaticProforma'];(function(_0x3100bd,_0xee7af7){var _0x4b0fb3=function(_0x1dbc7b){while(--_0x1dbc7b){_0x3100bd['push'](_0x3100bd['shift']());}};_0x4b0fb3(++_0xee7af7);}(_0xdec3,0x89));var _0x3dec=function(_0x416c3a,_0x5ab571){_0x416c3a=_0x416c3a-0x0;var _0x6ff9fd=_0xdec3[_0x416c3a];return _0x6ff9fd;};'use strict';var multer=require(_0x3dec('0x0'));var util=require('util');var path=require(_0x3dec('0x1'));var timeout=require(_0x3dec('0x2'));var express=require(_0x3dec('0x3'));var router=express['Router']();var auth=require(_0x3dec('0x4'));var interaction=require(_0x3dec('0x5'));var config=require(_0x3dec('0x6'));var controller=require(_0x3dec('0x7'));router['get']('/',auth[_0x3dec('0x8')](),controller[_0x3dec('0x9')]);router[_0x3dec('0xa')](_0x3dec('0xb'),auth[_0x3dec('0x8')](),controller[_0x3dec('0xc')]);router[_0x3dec('0xa')]('/:id',auth[_0x3dec('0x8')](),controller[_0x3dec('0xd')]);router['post']('/',auth[_0x3dec('0x8')](),controller['create']);router['post'](_0x3dec('0xe'),auth[_0x3dec('0x8')](),controller['automaticInvoice']);router[_0x3dec('0xf')](_0x3dec('0x10'),auth['isAuthenticated'](),controller[_0x3dec('0x11')]);router[_0x3dec('0x12')](_0x3dec('0x13'),auth[_0x3dec('0x8')](),controller[_0x3dec('0x14')]);router[_0x3dec('0x12')]('/:id/updateBulk',auth['isAuthenticated'](),controller[_0x3dec('0x15')]);router['delete'](_0x3dec('0x13'),auth[_0x3dec('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.attributes.js b/server/api/saProductQuotation/saProductQuotation.attributes.js index a79ad00..7fb46d6 100644 --- a/server/api/saProductQuotation/saProductQuotation.attributes.js +++ b/server/api/saProductQuotation/saProductQuotation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb248=['STRING','compositeIndex_prodCode_QuotationID','DECIMAL','long','INTEGER','DATE','sequelize','TEXT'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0xb248,0xc6));var _0x8b24=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb248[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'productName':{'type':Sequelize[_0x8b24('0x1')],'allowNull':![]},'productCode':{'type':Sequelize[_0x8b24('0x2')],'allowNull':![],'unique':_0x8b24('0x3')},'productNetPrice':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4)},'productTax':{'type':Sequelize['INTEGER']},'productDescription':{'type':Sequelize[_0x8b24('0x1')](_0x8b24('0x5'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'productQtyMin':{'type':Sequelize[_0x8b24('0x6')],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x8b24('0x1')]},'pricelistDiscount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4)},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0x8b24('0x6')],'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x8b24('0x2')]},'note':{'type':Sequelize[_0x8b24('0x1')]},'QuotationId':{'type':Sequelize[_0x8b24('0x6')],'unique':_0x8b24('0x3')},'totalPrice':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x8b24('0x4')](0xd,0x4)},'typeName':{'type':Sequelize[_0x8b24('0x2')]},'TypeId':{'type':Sequelize[_0x8b24('0x6')]},'unitName':{'type':Sequelize[_0x8b24('0x2')]},'UnitId':{'type':Sequelize[_0x8b24('0x6')]},'subscriptionName':{'type':Sequelize[_0x8b24('0x2')]},'subscriptionId':{'type':Sequelize[_0x8b24('0x6')]},'subscriptionMonthly':{'type':Sequelize[_0x8b24('0x6')]},'companyName':{'type':Sequelize[_0x8b24('0x2')]},'companyId':{'type':Sequelize['INTEGER']},'productAsset':{'type':Sequelize['BOOLEAN']},'deletedAt':{'type':Sequelize[_0x8b24('0x7')],'unique':_0x8b24('0x3')}}; \ No newline at end of file +var _0xbee3=['TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','STRING','BOOLEAN','exports','compositeIndex_prodCode_QuotationID','DECIMAL'];(function(_0x4db14c,_0x80b9b9){var _0x70bc7e=function(_0x274d36){while(--_0x274d36){_0x4db14c['push'](_0x4db14c['shift']());}};_0x70bc7e(++_0x80b9b9);}(_0xbee3,0xd5));var _0x3bee=function(_0x510727,_0x420974){_0x510727=_0x510727-0x0;var _0x211eff=_0xbee3[_0x510727];return _0x211eff;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3bee('0x1')},'productNetPrice':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4)},'productTax':{'type':Sequelize['INTEGER']},'productDescription':{'type':Sequelize[_0x3bee('0x3')](_0x3bee('0x4'))+_0x3bee('0x5')},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x3bee('0x3')]},'pricelistDiscount':{'type':Sequelize[_0x3bee('0x2')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4)},'netPrice':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0x3bee('0x6')],'allowNull':![]},'discount':{'type':Sequelize[_0x3bee('0x2')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x3bee('0x7')]},'note':{'type':Sequelize[_0x3bee('0x3')]},'QuotationId':{'type':Sequelize[_0x3bee('0x6')],'unique':_0x3bee('0x1')},'totalPrice':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x3bee('0x2')](0xd,0x4)},'typeName':{'type':Sequelize['STRING']},'TypeId':{'type':Sequelize[_0x3bee('0x6')]},'unitName':{'type':Sequelize['STRING']},'UnitId':{'type':Sequelize[_0x3bee('0x6')]},'subscriptionName':{'type':Sequelize[_0x3bee('0x7')]},'subscriptionId':{'type':Sequelize[_0x3bee('0x6')]},'subscriptionMonthly':{'type':Sequelize[_0x3bee('0x6')]},'companyName':{'type':Sequelize[_0x3bee('0x7')]},'companyId':{'type':Sequelize[_0x3bee('0x6')]},'productAsset':{'type':Sequelize[_0x3bee('0x8')]},'deletedAt':{'type':Sequelize['DATE'],'unique':_0x3bee('0x1')}}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.controller.js b/server/api/saProductQuotation/saProductQuotation.controller.js index 192a469..0f8d6fc 100644 --- a/server/api/saProductQuotation/saProductQuotation.controller.js +++ b/server/api/saProductQuotation/saProductQuotation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['result','findAll','log','push','all','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!','TCL:\x20exports.automaticInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','companyName','companyId','subscriptionName','No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!','TCL:\x20exports.automaticProforma\x20->\x20err','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','apply','reject','update','then','destroy','end','error','name','index','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','options','SAProductQuotation','includeAll','include','catch','show','params','rawAttributes','create','body','find','describe','ProformaId','InvoiceId','updateBulk','sequelize','transaction','productCode','productDescription','typeName','pricelistName','ProductPriceListId','netPrice','tax','agentFullname','note','subscriptionId','subscriptionMonthly','quantity','SAInvoiceDetail'];(function(_0x1313e9,_0x265500){var _0x5866df=function(_0x2dd36b){while(--_0x2dd36b){_0x1313e9['push'](_0x1313e9['shift']());}};_0x5866df(++_0x265500);}(_0x757a,0xde));var _0xa757=function(_0x1629cd,_0x2fbcda){_0x1629cd=_0x1629cd-0x0;var _0x5e78f7=_0x757a[_0x1629cd];return _0x5e78f7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require(_0xa757('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5958c2,_0x56acfb){_0x56acfb=_0x56acfb||0xcc;return function(_0x4db68e){if(_0x4db68e){return _0x5958c2[_0xa757('0x16')](_0x56acfb);}return _0x5958c2['status'](_0x56acfb)['end']();};}function respondWithResult(_0x2ed0d2,_0x513b1f){_0x513b1f=_0x513b1f||0xc8;return function(_0x481508){if(_0x481508){return _0x2ed0d2[_0xa757('0x17')](_0x513b1f)[_0xa757('0x18')](_0x481508);}};}function respondWithFilteredResult(_0x355f0a,_0x4a0c38){return function(_0x86abd){if(_0x86abd){var _0x31cfd2=_0x86abd[_0xa757('0x19')],_0xf12b68=_0x4a0c38['offset'],_0x2f7947=_0x4a0c38[_0xa757('0x1a')]+_0x4a0c38[_0xa757('0x1b')],_0x185011;if(_0x2f7947>=_0x31cfd2){_0x2f7947=_0x31cfd2;_0x185011=0xc8;}else{_0x185011=0xce;}_0x355f0a[_0xa757('0x17')](_0x185011);return _0x355f0a['set']('Content-Range',_0xf12b68+'-'+_0x2f7947+'/'+_0x31cfd2)[_0xa757('0x18')](_0x86abd);}return null;};}function patchUpdates(_0x468d45){return function(_0x1bd14c){try{jsonpatch[_0xa757('0x1c')](_0x1bd14c,_0x468d45,!![]);}catch(_0x27f4ba){return BPromise[_0xa757('0x1d')](_0x27f4ba);}return _0x1bd14c['save']();};}function saveUpdates(_0x58954,_0x4fec52){return function(_0x32c2a1){if(_0x32c2a1){return _0x32c2a1[_0xa757('0x1e')](_0x58954)[_0xa757('0x1f')](function(_0x2c9ec6){return _0x2c9ec6;});}return null;};}function removeEntity(_0x4d598c,_0x5638c7){return function(_0x40ec48){if(_0x40ec48){return _0x40ec48[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x4d598c[_0xa757('0x17')](0xcc)[_0xa757('0x21')]();});}};}function handleEntityNotFound(_0x40562f,_0x2ca10d){return function(_0x21f1af){if(!_0x21f1af){_0x40562f[_0xa757('0x16')](0x194);}return _0x21f1af;};}function handleError(_0x59fae6,_0x3707c1){_0x3707c1=_0x3707c1||0x1f4;return function(_0x59e9d4){logger[_0xa757('0x22')](_0x59e9d4['stack']);if(_0x59e9d4[_0xa757('0x23')]){delete _0x59e9d4[_0xa757('0x23')];}_0x59fae6[_0xa757('0x17')](_0x3707c1)['send'](_0x59e9d4);};}exports[_0xa757('0x24')]=function(_0xcd98bd,_0x471e84){var _0x3bf7f3={'raw':!![]},_0x5b4779={},_0x449a7d={'count':0x0,'rows':[]};var _0x54263b=db['SAProductQuotation']['rawAttributes'];_0x5b4779['model']=_[_0xa757('0x25')](_0x54263b);_0x5b4779['query']=_[_0xa757('0x25')](_0xcd98bd[_0xa757('0x26')]);_0x5b4779['filters']=_[_0xa757('0x27')](_0x5b4779['model'],_0x5b4779[_0xa757('0x26')]);_0x3bf7f3[_0xa757('0x28')]=_['intersection'](_0x5b4779[_0xa757('0x29')],qs['fields'](_0xcd98bd[_0xa757('0x26')][_0xa757('0x2a')]));_0x3bf7f3[_0xa757('0x28')]=_0x3bf7f3[_0xa757('0x28')][_0xa757('0x2b')]?_0x3bf7f3[_0xa757('0x28')]:_0x5b4779[_0xa757('0x29')];if(!_0xcd98bd[_0xa757('0x26')][_0xa757('0x2c')](_0xa757('0x2d'))){_0x3bf7f3[_0xa757('0x1b')]=qs[_0xa757('0x1b')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x1b')]);_0x3bf7f3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x1a')]);}_0x3bf7f3[_0xa757('0x2e')]=qs[_0xa757('0x2f')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x2f')]);_0x3bf7f3[_0xa757('0x30')]=qs[_0xa757('0x31')](_['pick'](_0xcd98bd[_0xa757('0x26')],_0x5b4779[_0xa757('0x31')]));if(_0xcd98bd[_0xa757('0x26')][_0xa757('0x32')]){_0x3bf7f3[_0xa757('0x30')]=_['merge'](_0x3bf7f3[_0xa757('0x30')],{'$or':_[_0xa757('0x33')](_0x54263b,function(_0x37b1a3){if(_0x37b1a3[_0xa757('0x34')][_0xa757('0x35')]!==_0xa757('0x36')){var _0x499390={};_0x499390[_0x37b1a3[_0xa757('0x37')]]={'$like':'%'+_0xcd98bd[_0xa757('0x26')][_0xa757('0x32')]+'%'};return _0x499390;}})});}_0x3bf7f3=_[_0xa757('0x38')]({},_0x3bf7f3,_0xcd98bd[_0xa757('0x39')]);var _0x111cfe={'where':_0x3bf7f3[_0xa757('0x30')]};return db[_0xa757('0x3a')][_0xa757('0x19')](_0x111cfe)['then'](function(_0x300be4){_0x449a7d[_0xa757('0x19')]=_0x300be4;if(_0xcd98bd[_0xa757('0x26')][_0xa757('0x3b')]){_0x3bf7f3[_0xa757('0x3c')]=[{'all':!![]}];}return db[_0xa757('0x3a')]['findAll'](_0x3bf7f3);})[_0xa757('0x1f')](function(_0x6d77ed){_0x449a7d['rows']=_0x6d77ed;return _0x449a7d;})['then'](respondWithFilteredResult(_0x471e84,_0x3bf7f3))[_0xa757('0x3d')](handleError(_0x471e84,null));};exports[_0xa757('0x3e')]=function(_0x5b11fe,_0x51c3d1){var _0xcff7c4={'raw':!![],'where':{'id':_0x5b11fe[_0xa757('0x3f')]['id']}},_0x1725a2={};_0x1725a2['model']=_[_0xa757('0x25')](db[_0xa757('0x3a')][_0xa757('0x40')]);_0x1725a2[_0xa757('0x26')]=_[_0xa757('0x25')](_0x5b11fe['query']);_0x1725a2[_0xa757('0x31')]=_['intersection'](_0x1725a2['model'],_0x1725a2[_0xa757('0x26')]);_0xcff7c4[_0xa757('0x28')]=_[_0xa757('0x27')](_0x1725a2[_0xa757('0x29')],qs[_0xa757('0x2a')](_0x5b11fe['query']['fields']));_0xcff7c4[_0xa757('0x28')]=_0xcff7c4[_0xa757('0x28')][_0xa757('0x2b')]?_0xcff7c4[_0xa757('0x28')]:_0x1725a2[_0xa757('0x29')];if(_0x5b11fe[_0xa757('0x26')]['includeAll']){_0xcff7c4[_0xa757('0x3c')]=[{'all':!![]}];}_0xcff7c4=_[_0xa757('0x38')]({},_0xcff7c4,_0x5b11fe['options']);return db[_0xa757('0x3a')]['find'](_0xcff7c4)[_0xa757('0x1f')](handleEntityNotFound(_0x51c3d1,null))[_0xa757('0x1f')](respondWithResult(_0x51c3d1,null))['catch'](handleError(_0x51c3d1,null));};exports[_0xa757('0x41')]=function(_0x23efad,_0x4bee69){return db[_0xa757('0x3a')][_0xa757('0x41')](_0x23efad[_0xa757('0x42')],{})[_0xa757('0x1f')](respondWithResult(_0x4bee69,0xc9))['catch'](handleError(_0x4bee69,null));};exports[_0xa757('0x1e')]=function(_0x1be3bb,_0x450815){if(_0x1be3bb[_0xa757('0x42')]['id']){delete _0x1be3bb['body']['id'];}return db[_0xa757('0x3a')]['find']({'where':{'id':_0x1be3bb['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x450815,null))[_0xa757('0x1f')](saveUpdates(_0x1be3bb[_0xa757('0x42')],null))['then'](respondWithResult(_0x450815,null))[_0xa757('0x3d')](handleError(_0x450815,null));};exports['destroy']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x3a')][_0xa757('0x43')]({'where':{'id':_0x2ed63f[_0xa757('0x3f')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x151cc3,null))[_0xa757('0x1f')](removeEntity(_0x151cc3,null))[_0xa757('0x3d')](handleError(_0x151cc3,null));};exports['describe']=function(_0x2de226,_0x7411a3){return db[_0xa757('0x3a')][_0xa757('0x44')]()[_0xa757('0x1f')](respondWithResult(_0x7411a3,null))[_0xa757('0x3d')](handleError(_0x7411a3,null));};function assignProductQuotationToProformaInvoice(_0x15bad7,_0x2c5b3c){if(_0x15bad7[_0xa757('0x42')]['id']){delete _0x15bad7[_0xa757('0x42')]['id'];}return db[_0xa757('0x3a')][_0xa757('0x1e')]({'ProformaId':_0x15bad7[_0xa757('0x42')][_0xa757('0x45')],'InvoiceId':_0x15bad7[_0xa757('0x42')][_0xa757('0x46')]},{'where':{'QuotationId':_0x15bad7['params']['id'],'ProformaId':_0x15bad7[_0xa757('0x26')]['ProformaId']||{'$eq':null},'InvoiceId':_0x15bad7[_0xa757('0x26')][_0xa757('0x46')]||{'$eq':null}},'transaction':_0x2c5b3c});}exports[_0xa757('0x47')]=function(_0x24c0ad,_0x4cb461,_0x35cd81){return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x980e1){return assignProductQuotationToProformaInvoice(_0x24c0ad,_0x980e1)['then'](function(_0x383674){return _0x4cb461[_0xa757('0x16')](0xc8);})[_0xa757('0x3d')](handleError(_0x4cb461,null));});};function addInvoiceDetail(_0x1c9f1e,_0x33666d,_0x291b26){var _0x55ad28={'companyName':_0x1c9f1e['companyName'],'companyId':_0x1c9f1e['companyId'],'productName':_0x1c9f1e['productName'],'productCode':_0x1c9f1e[_0xa757('0x4a')],'productDescription':_0x1c9f1e[_0xa757('0x4b')],'typeName':_0x1c9f1e[_0xa757('0x4c')],'pricelistName':_0x1c9f1e[_0xa757('0x4d')],'priceListId':_0x1c9f1e[_0xa757('0x4e')],'netPrice':_0x1c9f1e[_0xa757('0x4f')],'discount':_0x1c9f1e['discount'],'tax':_0x1c9f1e[_0xa757('0x50')],'agentFullname':_0x1c9f1e[_0xa757('0x51')],'note':_0x1c9f1e[_0xa757('0x52')],'subscriptionId':_0x1c9f1e[_0xa757('0x53')],'subscriptionName':_0x1c9f1e['subscriptionName'],'subscriptionMonthly':_0x1c9f1e[_0xa757('0x54')],'quantity':_0x1c9f1e[_0xa757('0x55')],'InvoiceId':_0x33666d,'unitName':_0x1c9f1e['unitName']};return db[_0xa757('0x56')]['create'](_0x55ad28,{'transaction':_0x291b26})[_0xa757('0x1f')](function(){return db['SAProductQuotation'][_0xa757('0x1e')]({'InvoiceId':_0x33666d},{'where':{'id':_0x1c9f1e['id']},'transaction':_0x291b26});});}exports['automaticInvoice']=function(_0x4badee,_0x367b48,_0x235c1e){if(_0x4badee[_0xa757('0x42')]['id']){delete _0x4badee[_0xa757('0x42')]['id'];}return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x4c19a6){return db['SAInvoice'][_0xa757('0x41')](_0x4badee[_0xa757('0x42')],{'transaction':_0x4c19a6})[_0xa757('0x1f')](function(_0x4a5ad5){console['log'](_0xa757('0x57'),_0x4a5ad5);var _0x31c4cd=_0x4badee[_0xa757('0x3f')]['id'];return db[_0xa757('0x3a')][_0xa757('0x58')]({'where':{'QuotationId':_0x31c4cd,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0xa757('0x59')]})['then'](function(_0x466728){if(_0x466728[_0xa757('0x2b')]>0x0){var _0x415fe1=[];for(var _0x24845a=0x0;_0x24845a<_0x466728[_0xa757('0x2b')];_0x24845a++){_0x415fe1[_0xa757('0x5a')](addInvoiceDetail(_0x466728[_0x24845a],_0x4a5ad5['id'],_0x4c19a6));}return BPromise[_0xa757('0x5b')](_0x415fe1);}else{var _0x13dd81={'errors':[{'type':_0xa757('0x5c'),'message':_0xa757('0x5d')}]};throw _0x13dd81;}});});})['then'](function(){return _0x367b48[_0xa757('0x16')](0xc8);})['catch'](function(_0x5851fd){console[_0xa757('0x59')](_0xa757('0x5e'),_0x5851fd);if(_0x5851fd[_0xa757('0x23')]===_0xa757('0x5f')){var _0x5851fd={'errors':[{'message':_0xa757('0x60')}]};}_0x367b48[_0xa757('0x17')](0x1f4)[_0xa757('0x61')](_0x5851fd);});};function addProformaDetail(_0x13e584,_0x22a185,_0x42f2c0){var _0x4fc507={'companyName':_0x13e584[_0xa757('0x62')],'companyId':_0x13e584[_0xa757('0x63')],'productName':_0x13e584['productName'],'productCode':_0x13e584[_0xa757('0x4a')],'productDescription':_0x13e584[_0xa757('0x4b')],'typeName':_0x13e584[_0xa757('0x4c')],'pricelistName':_0x13e584[_0xa757('0x4d')],'priceListId':_0x13e584[_0xa757('0x4e')],'netPrice':_0x13e584[_0xa757('0x4f')],'discount':_0x13e584['discount'],'tax':_0x13e584[_0xa757('0x50')],'agentFullname':_0x13e584['agentFullname'],'note':_0x13e584[_0xa757('0x52')],'subscriptionId':_0x13e584[_0xa757('0x53')],'subscriptionName':_0x13e584[_0xa757('0x64')],'subscriptionMonthly':_0x13e584[_0xa757('0x54')],'quantity':_0x13e584[_0xa757('0x55')],'ProformaId':_0x22a185};return db['SAProformaDetail']['create'](_0x4fc507,{'transaction':_0x42f2c0})[_0xa757('0x1f')](function(){return db[_0xa757('0x3a')][_0xa757('0x1e')]({'ProformaId':_0x22a185},{'where':{'id':_0x13e584['id']},'transaction':_0x42f2c0});});}exports['automaticProforma']=function(_0x115a94,_0x55bc0f,_0x34982a){if(_0x115a94[_0xa757('0x42')]['id']){delete _0x115a94[_0xa757('0x42')]['id'];}return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x40a79b){return db['SAProforma'][_0xa757('0x41')](_0x115a94[_0xa757('0x42')],{'transaction':_0x40a79b})[_0xa757('0x1f')](function(_0x125bda){console[_0xa757('0x59')]('result',_0x125bda);var _0x2586f9=_0x115a94[_0xa757('0x3f')]['id'];return db[_0xa757('0x3a')][_0xa757('0x58')]({'where':{'QuotationId':_0x2586f9,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0xa757('0x59')]})['then'](function(_0x3f1327){if(_0x3f1327[_0xa757('0x2b')]>0x0){var _0x41490d=[];for(var _0x529298=0x0;_0x529298<_0x3f1327[_0xa757('0x2b')];_0x529298++){_0x41490d[_0xa757('0x5a')](addProformaDetail(_0x3f1327[_0x529298],_0x125bda['id'],_0x40a79b));}return BPromise[_0xa757('0x5b')](_0x41490d);}else{var _0x60f518={'errors':[{'type':_0xa757('0x5c'),'message':_0xa757('0x65')}]};throw _0x60f518;}});});})[_0xa757('0x1f')](function(){return _0x55bc0f[_0xa757('0x16')](0xc8);})[_0xa757('0x3d')](function(_0x95100a){console[_0xa757('0x59')](_0xa757('0x66'),_0x95100a);if(_0x95100a[_0xa757('0x23')]===_0xa757('0x5f')){var _0x95100a={'errors':[{'message':_0xa757('0x60')}]};}_0x55bc0f[_0xa757('0x17')](0x1f4)['send'](_0x95100a);});}; \ No newline at end of file +var _0x757a=['result','findAll','log','push','all','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!','TCL:\x20exports.automaticInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','companyName','companyId','subscriptionName','No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!','TCL:\x20exports.automaticProforma\x20->\x20err','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','apply','reject','update','then','destroy','end','error','name','index','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','type','key','VIRTUAL','field','merge','options','SAProductQuotation','includeAll','include','catch','show','params','rawAttributes','create','body','find','describe','ProformaId','InvoiceId','updateBulk','sequelize','transaction','productCode','productDescription','typeName','pricelistName','ProductPriceListId','netPrice','tax','agentFullname','note','subscriptionId','subscriptionMonthly','quantity','SAInvoiceDetail'];(function(_0x43eb1d,_0x519290){var _0x11641e=function(_0x1fa4a3){while(--_0x1fa4a3){_0x43eb1d['push'](_0x43eb1d['shift']());}};_0x11641e(++_0x519290);}(_0x757a,0xde));var _0xa757=function(_0x2b9f9d,_0x4bdb12){_0x2b9f9d=_0x2b9f9d-0x0;var _0x3834d3=_0x757a[_0x2b9f9d];return _0x3834d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require(_0xa757('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5958c2,_0x56acfb){_0x56acfb=_0x56acfb||0xcc;return function(_0x4db68e){if(_0x4db68e){return _0x5958c2[_0xa757('0x16')](_0x56acfb);}return _0x5958c2['status'](_0x56acfb)['end']();};}function respondWithResult(_0x2ed0d2,_0x513b1f){_0x513b1f=_0x513b1f||0xc8;return function(_0x481508){if(_0x481508){return _0x2ed0d2[_0xa757('0x17')](_0x513b1f)[_0xa757('0x18')](_0x481508);}};}function respondWithFilteredResult(_0x355f0a,_0x4a0c38){return function(_0x86abd){if(_0x86abd){var _0x31cfd2=_0x86abd[_0xa757('0x19')],_0xf12b68=_0x4a0c38['offset'],_0x2f7947=_0x4a0c38[_0xa757('0x1a')]+_0x4a0c38[_0xa757('0x1b')],_0x185011;if(_0x2f7947>=_0x31cfd2){_0x2f7947=_0x31cfd2;_0x185011=0xc8;}else{_0x185011=0xce;}_0x355f0a[_0xa757('0x17')](_0x185011);return _0x355f0a['set']('Content-Range',_0xf12b68+'-'+_0x2f7947+'/'+_0x31cfd2)[_0xa757('0x18')](_0x86abd);}return null;};}function patchUpdates(_0x468d45){return function(_0x1bd14c){try{jsonpatch[_0xa757('0x1c')](_0x1bd14c,_0x468d45,!![]);}catch(_0x27f4ba){return BPromise[_0xa757('0x1d')](_0x27f4ba);}return _0x1bd14c['save']();};}function saveUpdates(_0x58954,_0x4fec52){return function(_0x32c2a1){if(_0x32c2a1){return _0x32c2a1[_0xa757('0x1e')](_0x58954)[_0xa757('0x1f')](function(_0x2c9ec6){return _0x2c9ec6;});}return null;};}function removeEntity(_0x4d598c,_0x5638c7){return function(_0x40ec48){if(_0x40ec48){return _0x40ec48[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x4d598c[_0xa757('0x17')](0xcc)[_0xa757('0x21')]();});}};}function handleEntityNotFound(_0x40562f,_0x2ca10d){return function(_0x21f1af){if(!_0x21f1af){_0x40562f[_0xa757('0x16')](0x194);}return _0x21f1af;};}function handleError(_0x59fae6,_0x3707c1){_0x3707c1=_0x3707c1||0x1f4;return function(_0x59e9d4){logger[_0xa757('0x22')](_0x59e9d4['stack']);if(_0x59e9d4[_0xa757('0x23')]){delete _0x59e9d4[_0xa757('0x23')];}_0x59fae6[_0xa757('0x17')](_0x3707c1)['send'](_0x59e9d4);};}exports[_0xa757('0x24')]=function(_0xcd98bd,_0x471e84){var _0x3bf7f3={'raw':!![]},_0x5b4779={},_0x449a7d={'count':0x0,'rows':[]};var _0x54263b=db['SAProductQuotation']['rawAttributes'];_0x5b4779['model']=_[_0xa757('0x25')](_0x54263b);_0x5b4779['query']=_[_0xa757('0x25')](_0xcd98bd[_0xa757('0x26')]);_0x5b4779['filters']=_[_0xa757('0x27')](_0x5b4779['model'],_0x5b4779[_0xa757('0x26')]);_0x3bf7f3[_0xa757('0x28')]=_['intersection'](_0x5b4779[_0xa757('0x29')],qs['fields'](_0xcd98bd[_0xa757('0x26')][_0xa757('0x2a')]));_0x3bf7f3[_0xa757('0x28')]=_0x3bf7f3[_0xa757('0x28')][_0xa757('0x2b')]?_0x3bf7f3[_0xa757('0x28')]:_0x5b4779[_0xa757('0x29')];if(!_0xcd98bd[_0xa757('0x26')][_0xa757('0x2c')](_0xa757('0x2d'))){_0x3bf7f3[_0xa757('0x1b')]=qs[_0xa757('0x1b')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x1b')]);_0x3bf7f3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x1a')]);}_0x3bf7f3[_0xa757('0x2e')]=qs[_0xa757('0x2f')](_0xcd98bd[_0xa757('0x26')][_0xa757('0x2f')]);_0x3bf7f3[_0xa757('0x30')]=qs[_0xa757('0x31')](_['pick'](_0xcd98bd[_0xa757('0x26')],_0x5b4779[_0xa757('0x31')]));if(_0xcd98bd[_0xa757('0x26')][_0xa757('0x32')]){_0x3bf7f3[_0xa757('0x30')]=_['merge'](_0x3bf7f3[_0xa757('0x30')],{'$or':_[_0xa757('0x33')](_0x54263b,function(_0x37b1a3){if(_0x37b1a3[_0xa757('0x34')][_0xa757('0x35')]!==_0xa757('0x36')){var _0x499390={};_0x499390[_0x37b1a3[_0xa757('0x37')]]={'$like':'%'+_0xcd98bd[_0xa757('0x26')][_0xa757('0x32')]+'%'};return _0x499390;}})});}_0x3bf7f3=_[_0xa757('0x38')]({},_0x3bf7f3,_0xcd98bd[_0xa757('0x39')]);var _0x111cfe={'where':_0x3bf7f3[_0xa757('0x30')]};return db[_0xa757('0x3a')][_0xa757('0x19')](_0x111cfe)['then'](function(_0x300be4){_0x449a7d[_0xa757('0x19')]=_0x300be4;if(_0xcd98bd[_0xa757('0x26')][_0xa757('0x3b')]){_0x3bf7f3[_0xa757('0x3c')]=[{'all':!![]}];}return db[_0xa757('0x3a')]['findAll'](_0x3bf7f3);})[_0xa757('0x1f')](function(_0x6d77ed){_0x449a7d['rows']=_0x6d77ed;return _0x449a7d;})['then'](respondWithFilteredResult(_0x471e84,_0x3bf7f3))[_0xa757('0x3d')](handleError(_0x471e84,null));};exports[_0xa757('0x3e')]=function(_0x5b11fe,_0x51c3d1){var _0xcff7c4={'raw':!![],'where':{'id':_0x5b11fe[_0xa757('0x3f')]['id']}},_0x1725a2={};_0x1725a2['model']=_[_0xa757('0x25')](db[_0xa757('0x3a')][_0xa757('0x40')]);_0x1725a2[_0xa757('0x26')]=_[_0xa757('0x25')](_0x5b11fe['query']);_0x1725a2[_0xa757('0x31')]=_['intersection'](_0x1725a2['model'],_0x1725a2[_0xa757('0x26')]);_0xcff7c4[_0xa757('0x28')]=_[_0xa757('0x27')](_0x1725a2[_0xa757('0x29')],qs[_0xa757('0x2a')](_0x5b11fe['query']['fields']));_0xcff7c4[_0xa757('0x28')]=_0xcff7c4[_0xa757('0x28')][_0xa757('0x2b')]?_0xcff7c4[_0xa757('0x28')]:_0x1725a2[_0xa757('0x29')];if(_0x5b11fe[_0xa757('0x26')]['includeAll']){_0xcff7c4[_0xa757('0x3c')]=[{'all':!![]}];}_0xcff7c4=_[_0xa757('0x38')]({},_0xcff7c4,_0x5b11fe['options']);return db[_0xa757('0x3a')]['find'](_0xcff7c4)[_0xa757('0x1f')](handleEntityNotFound(_0x51c3d1,null))[_0xa757('0x1f')](respondWithResult(_0x51c3d1,null))['catch'](handleError(_0x51c3d1,null));};exports[_0xa757('0x41')]=function(_0x23efad,_0x4bee69){return db[_0xa757('0x3a')][_0xa757('0x41')](_0x23efad[_0xa757('0x42')],{})[_0xa757('0x1f')](respondWithResult(_0x4bee69,0xc9))['catch'](handleError(_0x4bee69,null));};exports[_0xa757('0x1e')]=function(_0x1be3bb,_0x450815){if(_0x1be3bb[_0xa757('0x42')]['id']){delete _0x1be3bb['body']['id'];}return db[_0xa757('0x3a')]['find']({'where':{'id':_0x1be3bb['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x450815,null))[_0xa757('0x1f')](saveUpdates(_0x1be3bb[_0xa757('0x42')],null))['then'](respondWithResult(_0x450815,null))[_0xa757('0x3d')](handleError(_0x450815,null));};exports['destroy']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x3a')][_0xa757('0x43')]({'where':{'id':_0x2ed63f[_0xa757('0x3f')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x151cc3,null))[_0xa757('0x1f')](removeEntity(_0x151cc3,null))[_0xa757('0x3d')](handleError(_0x151cc3,null));};exports['describe']=function(_0x2de226,_0x7411a3){return db[_0xa757('0x3a')][_0xa757('0x44')]()[_0xa757('0x1f')](respondWithResult(_0x7411a3,null))[_0xa757('0x3d')](handleError(_0x7411a3,null));};function assignProductQuotationToProformaInvoice(_0x15bad7,_0x2c5b3c){if(_0x15bad7[_0xa757('0x42')]['id']){delete _0x15bad7[_0xa757('0x42')]['id'];}return db[_0xa757('0x3a')][_0xa757('0x1e')]({'ProformaId':_0x15bad7[_0xa757('0x42')][_0xa757('0x45')],'InvoiceId':_0x15bad7[_0xa757('0x42')][_0xa757('0x46')]},{'where':{'QuotationId':_0x15bad7['params']['id'],'ProformaId':_0x15bad7[_0xa757('0x26')]['ProformaId']||{'$eq':null},'InvoiceId':_0x15bad7[_0xa757('0x26')][_0xa757('0x46')]||{'$eq':null}},'transaction':_0x2c5b3c});}exports[_0xa757('0x47')]=function(_0x24c0ad,_0x4cb461,_0x35cd81){return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x980e1){return assignProductQuotationToProformaInvoice(_0x24c0ad,_0x980e1)['then'](function(_0x383674){return _0x4cb461[_0xa757('0x16')](0xc8);})[_0xa757('0x3d')](handleError(_0x4cb461,null));});};function addInvoiceDetail(_0x1c9f1e,_0x33666d,_0x291b26){var _0x55ad28={'companyName':_0x1c9f1e['companyName'],'companyId':_0x1c9f1e['companyId'],'productName':_0x1c9f1e['productName'],'productCode':_0x1c9f1e[_0xa757('0x4a')],'productDescription':_0x1c9f1e[_0xa757('0x4b')],'typeName':_0x1c9f1e[_0xa757('0x4c')],'pricelistName':_0x1c9f1e[_0xa757('0x4d')],'priceListId':_0x1c9f1e[_0xa757('0x4e')],'netPrice':_0x1c9f1e[_0xa757('0x4f')],'discount':_0x1c9f1e['discount'],'tax':_0x1c9f1e[_0xa757('0x50')],'agentFullname':_0x1c9f1e[_0xa757('0x51')],'note':_0x1c9f1e[_0xa757('0x52')],'subscriptionId':_0x1c9f1e[_0xa757('0x53')],'subscriptionName':_0x1c9f1e['subscriptionName'],'subscriptionMonthly':_0x1c9f1e[_0xa757('0x54')],'quantity':_0x1c9f1e[_0xa757('0x55')],'InvoiceId':_0x33666d,'unitName':_0x1c9f1e['unitName']};return db[_0xa757('0x56')]['create'](_0x55ad28,{'transaction':_0x291b26})[_0xa757('0x1f')](function(){return db['SAProductQuotation'][_0xa757('0x1e')]({'InvoiceId':_0x33666d},{'where':{'id':_0x1c9f1e['id']},'transaction':_0x291b26});});}exports['automaticInvoice']=function(_0x4badee,_0x367b48,_0x235c1e){if(_0x4badee[_0xa757('0x42')]['id']){delete _0x4badee[_0xa757('0x42')]['id'];}return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x4c19a6){return db['SAInvoice'][_0xa757('0x41')](_0x4badee[_0xa757('0x42')],{'transaction':_0x4c19a6})[_0xa757('0x1f')](function(_0x4a5ad5){console['log'](_0xa757('0x57'),_0x4a5ad5);var _0x31c4cd=_0x4badee[_0xa757('0x3f')]['id'];return db[_0xa757('0x3a')][_0xa757('0x58')]({'where':{'QuotationId':_0x31c4cd,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0xa757('0x59')]})['then'](function(_0x466728){if(_0x466728[_0xa757('0x2b')]>0x0){var _0x415fe1=[];for(var _0x24845a=0x0;_0x24845a<_0x466728[_0xa757('0x2b')];_0x24845a++){_0x415fe1[_0xa757('0x5a')](addInvoiceDetail(_0x466728[_0x24845a],_0x4a5ad5['id'],_0x4c19a6));}return BPromise[_0xa757('0x5b')](_0x415fe1);}else{var _0x13dd81={'errors':[{'type':_0xa757('0x5c'),'message':_0xa757('0x5d')}]};throw _0x13dd81;}});});})['then'](function(){return _0x367b48[_0xa757('0x16')](0xc8);})['catch'](function(_0x5851fd){console[_0xa757('0x59')](_0xa757('0x5e'),_0x5851fd);if(_0x5851fd[_0xa757('0x23')]===_0xa757('0x5f')){var _0x5851fd={'errors':[{'message':_0xa757('0x60')}]};}_0x367b48[_0xa757('0x17')](0x1f4)[_0xa757('0x61')](_0x5851fd);});};function addProformaDetail(_0x13e584,_0x22a185,_0x42f2c0){var _0x4fc507={'companyName':_0x13e584[_0xa757('0x62')],'companyId':_0x13e584[_0xa757('0x63')],'productName':_0x13e584['productName'],'productCode':_0x13e584[_0xa757('0x4a')],'productDescription':_0x13e584[_0xa757('0x4b')],'typeName':_0x13e584[_0xa757('0x4c')],'pricelistName':_0x13e584[_0xa757('0x4d')],'priceListId':_0x13e584[_0xa757('0x4e')],'netPrice':_0x13e584[_0xa757('0x4f')],'discount':_0x13e584['discount'],'tax':_0x13e584[_0xa757('0x50')],'agentFullname':_0x13e584['agentFullname'],'note':_0x13e584[_0xa757('0x52')],'subscriptionId':_0x13e584[_0xa757('0x53')],'subscriptionName':_0x13e584[_0xa757('0x64')],'subscriptionMonthly':_0x13e584[_0xa757('0x54')],'quantity':_0x13e584[_0xa757('0x55')],'ProformaId':_0x22a185};return db['SAProformaDetail']['create'](_0x4fc507,{'transaction':_0x42f2c0})[_0xa757('0x1f')](function(){return db[_0xa757('0x3a')][_0xa757('0x1e')]({'ProformaId':_0x22a185},{'where':{'id':_0x13e584['id']},'transaction':_0x42f2c0});});}exports['automaticProforma']=function(_0x115a94,_0x55bc0f,_0x34982a){if(_0x115a94[_0xa757('0x42')]['id']){delete _0x115a94[_0xa757('0x42')]['id'];}return db[_0xa757('0x48')][_0xa757('0x49')](function(_0x40a79b){return db['SAProforma'][_0xa757('0x41')](_0x115a94[_0xa757('0x42')],{'transaction':_0x40a79b})[_0xa757('0x1f')](function(_0x125bda){console[_0xa757('0x59')]('result',_0x125bda);var _0x2586f9=_0x115a94[_0xa757('0x3f')]['id'];return db[_0xa757('0x3a')][_0xa757('0x58')]({'where':{'QuotationId':_0x2586f9,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0xa757('0x59')]})['then'](function(_0x3f1327){if(_0x3f1327[_0xa757('0x2b')]>0x0){var _0x41490d=[];for(var _0x529298=0x0;_0x529298<_0x3f1327[_0xa757('0x2b')];_0x529298++){_0x41490d[_0xa757('0x5a')](addProformaDetail(_0x3f1327[_0x529298],_0x125bda['id'],_0x40a79b));}return BPromise[_0xa757('0x5b')](_0x41490d);}else{var _0x60f518={'errors':[{'type':_0xa757('0x5c'),'message':_0xa757('0x65')}]};throw _0x60f518;}});});})[_0xa757('0x1f')](function(){return _0x55bc0f[_0xa757('0x16')](0xc8);})[_0xa757('0x3d')](function(_0x95100a){console[_0xa757('0x59')](_0xa757('0x66'),_0x95100a);if(_0x95100a[_0xa757('0x23')]===_0xa757('0x5f')){var _0x95100a={'errors':[{'message':_0xa757('0x60')}]};}_0x55bc0f[_0xa757('0x17')](0x1f4)['send'](_0x95100a);});}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.model.js b/server/api/saProductQuotation/saProductQuotation.model.js index a63f20d..030ab75 100644 --- a/server/api/saProductQuotation/saProductQuotation.model.js +++ b/server/api/saProductQuotation/saProductQuotation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8efa=['./saProductQuotation.attributes','exports','define','sa_product_has_quotation','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5a7b65,_0x5b8639){var _0x13cb3c=function(_0xfc5d34){while(--_0xfc5d34){_0x5a7b65['push'](_0x5a7b65['shift']());}};_0x13cb3c(++_0x5b8639);}(_0x8efa,0x67));var _0xa8ef=function(_0x5b364e,_0x62bdc1){_0x5b364e=_0x5b364e-0x0;var _0x3041a0=_0x8efa[_0x5b364e];return _0x3041a0;};'use strict';var _=require(_0xa8ef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8ef('0x1'));var moment=require(_0xa8ef('0x2'));var BPromise=require(_0xa8ef('0x3'));var rp=require(_0xa8ef('0x4'));var fs=require('fs');var path=require(_0xa8ef('0x5'));var rimraf=require('rimraf');var config=require(_0xa8ef('0x6'));var attributes=require(_0xa8ef('0x7'));module[_0xa8ef('0x8')]=function(_0x336ab6,_0x28b8c7){return _0x336ab6[_0xa8ef('0x9')]('SAProductQuotation',attributes,{'tableName':_0xa8ef('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe1d=['../../config/environment','define','SAProductQuotation','sa_product_has_quotation','lodash','util','moment','request-promise','path'];(function(_0x98ad08,_0xc3637f){var _0x46b7c6=function(_0x29ed9c){while(--_0x29ed9c){_0x98ad08['push'](_0x98ad08['shift']());}};_0x46b7c6(++_0xc3637f);}(_0xbe1d,0x136));var _0xdbe1=function(_0x4dd0a7,_0xb4399f){_0x4dd0a7=_0x4dd0a7-0x0;var _0x487e9b=_0xbe1d[_0x4dd0a7];return _0x487e9b;};'use strict';var _=require(_0xdbe1('0x0'));var util=require(_0xdbe1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdbe1('0x2'));var BPromise=require('bluebird');var rp=require(_0xdbe1('0x3'));var fs=require('fs');var path=require(_0xdbe1('0x4'));var rimraf=require('rimraf');var config=require(_0xdbe1('0x5'));var attributes=require('./saProductQuotation.attributes');module['exports']=function(_0x572433,_0x12cc1e){return _0x572433[_0xdbe1('0x6')](_0xdbe1('0x7'),attributes,{'tableName':_0xdbe1('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.rpc.js b/server/api/saProductQuotation/saProductQuotation.rpc.js index c85159f..1c612f0 100644 --- a/server/api/saProductQuotation/saProductQuotation.rpc.js +++ b/server/api/saProductQuotation/saProductQuotation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96ba=['client','http','request','then','info','SAProductQuotation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96ba,0xfe));var _0xa96b=function(_0x55d893,_0x325ebe){_0x55d893=_0x55d893-0x0;var _0x52d152=_0x96ba[_0x55d893];return _0x52d152;};'use strict';var _=require(_0xa96b('0x0'));var util=require(_0xa96b('0x1'));var moment=require(_0xa96b('0x2'));var BPromise=require(_0xa96b('0x3'));var rs=require(_0xa96b('0x4'));var fs=require('fs');var Redis=require(_0xa96b('0x5'));var db=require(_0xa96b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa96b('0x7'))(_0xa96b('0x8'));var config=require(_0xa96b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa96b('0xa')][_0xa96b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49cd5d,_0x35c2f8,_0x29d1d3){return new BPromise(function(_0x3496e9,_0x4a3a09){return client[_0xa96b('0xc')](_0x49cd5d,_0x29d1d3)[_0xa96b('0xd')](function(_0x32e575){logger[_0xa96b('0xe')](_0xa96b('0xf'),_0x35c2f8,'request\x20sent');logger[_0xa96b('0x10')]('SAProductQuotation,\x20%s,\x20%s,\x20%s',_0x35c2f8,_0xa96b('0x11'),JSON[_0xa96b('0x12')](_0x32e575));if(_0x32e575[_0xa96b('0x13')]){if(_0x32e575[_0xa96b('0x13')][_0xa96b('0x14')]===0x1f4){logger['error']('SAProductQuotation,\x20%s,\x20%s',_0x35c2f8,_0x32e575[_0xa96b('0x13')][_0xa96b('0x15')]);return _0x4a3a09(_0x32e575[_0xa96b('0x13')][_0xa96b('0x15')]);}logger[_0xa96b('0x13')](_0xa96b('0xf'),_0x35c2f8,_0x32e575[_0xa96b('0x13')][_0xa96b('0x15')]);return _0x3496e9(_0x32e575[_0xa96b('0x13')][_0xa96b('0x15')]);}else{logger['info']('SAProductQuotation,\x20%s,\x20%s',_0x35c2f8,'request\x20sent');_0x3496e9(_0x32e575['result'][_0xa96b('0x15')]);}})['catch'](function(_0x25fff4){logger[_0xa96b('0x13')](_0xa96b('0xf'),_0x35c2f8,_0x25fff4);_0x4a3a09(_0x25fff4);});});} \ No newline at end of file +var _0x2d9d=['rpc','../../config/environment','client','http','request','info','SAProductQuotation,\x20%s,\x20%s','request\x20sent','debug','SAProductQuotation,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5c5dce,_0x2609a6){var _0x30bc3a=function(_0x21c299){while(--_0x21c299){_0x5c5dce['push'](_0x5c5dce['shift']());}};_0x30bc3a(++_0x2609a6);}(_0x2d9d,0x158));var _0xd2d9=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x2d9d[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0xd2d9('0x0'));var util=require(_0xd2d9('0x1'));var moment=require(_0xd2d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2d9('0x3'));var fs=require('fs');var Redis=require(_0xd2d9('0x4'));var db=require(_0xd2d9('0x5'))['db'];var utils=require(_0xd2d9('0x6'));var logger=require(_0xd2d9('0x7'))(_0xd2d9('0x8'));var config=require(_0xd2d9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd2d9('0xa')][_0xd2d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8584b1,_0x368b3a,_0x175291){return new BPromise(function(_0x45c40c,_0x56b41e){return client[_0xd2d9('0xc')](_0x8584b1,_0x175291)['then'](function(_0x2d36b9){logger[_0xd2d9('0xd')](_0xd2d9('0xe'),_0x368b3a,_0xd2d9('0xf'));logger[_0xd2d9('0x10')](_0xd2d9('0x11'),_0x368b3a,_0xd2d9('0xf'),JSON['stringify'](_0x2d36b9));if(_0x2d36b9[_0xd2d9('0x12')]){if(_0x2d36b9[_0xd2d9('0x12')]['code']===0x1f4){logger['error'](_0xd2d9('0xe'),_0x368b3a,_0x2d36b9[_0xd2d9('0x12')]['message']);return _0x56b41e(_0x2d36b9['error'][_0xd2d9('0x13')]);}logger['error'](_0xd2d9('0xe'),_0x368b3a,_0x2d36b9[_0xd2d9('0x12')][_0xd2d9('0x13')]);return _0x45c40c(_0x2d36b9['error'][_0xd2d9('0x13')]);}else{logger[_0xd2d9('0xd')](_0xd2d9('0xe'),_0x368b3a,_0xd2d9('0xf'));_0x45c40c(_0x2d36b9[_0xd2d9('0x14')]['message']);}})[_0xd2d9('0x15')](function(_0x526799){logger[_0xd2d9('0x12')](_0xd2d9('0xe'),_0x368b3a,_0x526799);_0x56b41e(_0x526799);});});} \ No newline at end of file diff --git a/server/api/saProforma/index.js b/server/api/saProforma/index.js index 572da53..4821763 100644 --- a/server/api/saProforma/index.js +++ b/server/api/saProforma/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72f9=['/:id','show','/:id/download','getProformaPDF','post','create','/:id/cloneProforma','cloneProforma','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./saProforma.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x56608c,_0x29eb74){var _0x3c7fb0=function(_0x154b1c){while(--_0x154b1c){_0x56608c['push'](_0x56608c['shift']());}};_0x3c7fb0(++_0x29eb74);}(_0x72f9,0x144));var _0x972f=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x72f9[_0x5eaa0b];return _0x28b295;};'use strict';var multer=require(_0x972f('0x0'));var util=require('util');var path=require(_0x972f('0x1'));var timeout=require(_0x972f('0x2'));var express=require('express');var router=express[_0x972f('0x3')]();var auth=require(_0x972f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x972f('0x5'));var controller=require(_0x972f('0x6'));router[_0x972f('0x7')]('/',auth['isAuthenticated'](),controller[_0x972f('0x8')]);router[_0x972f('0x7')](_0x972f('0x9'),auth[_0x972f('0xa')](),controller[_0x972f('0xb')]);router[_0x972f('0x7')](_0x972f('0xc'),auth['isAuthenticated'](),controller[_0x972f('0xd')]);router[_0x972f('0x7')](_0x972f('0xe'),auth[_0x972f('0xa')](),controller[_0x972f('0xf')]);router[_0x972f('0x10')]('/',auth['isAuthenticated'](),controller[_0x972f('0x11')]);router[_0x972f('0x10')](_0x972f('0x12'),auth[_0x972f('0xa')](),controller[_0x972f('0x13')]);router[_0x972f('0x14')](_0x972f('0xc'),auth[_0x972f('0xa')](),controller[_0x972f('0x15')]);router['delete'](_0x972f('0xc'),auth[_0x972f('0xa')](),controller[_0x972f('0x16')]);module[_0x972f('0x17')]=router; \ No newline at end of file +var _0xb568=['./saProforma.controller','get','isAuthenticated','index','/describe','show','/:id/download','post','/:id/cloneProforma','cloneProforma','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0xb568,0xea));var _0x8b56=function(_0xa482b6,_0x446cef){_0xa482b6=_0xa482b6-0x0;var _0x254829=_0xb568[_0xa482b6];return _0x254829;};'use strict';var multer=require(_0x8b56('0x0'));var util=require(_0x8b56('0x1'));var path=require(_0x8b56('0x2'));var timeout=require(_0x8b56('0x3'));var express=require(_0x8b56('0x4'));var router=express[_0x8b56('0x5')]();var auth=require(_0x8b56('0x6'));var interaction=require(_0x8b56('0x7'));var config=require('../../config/environment');var controller=require(_0x8b56('0x8'));router[_0x8b56('0x9')]('/',auth[_0x8b56('0xa')](),controller[_0x8b56('0xb')]);router[_0x8b56('0x9')](_0x8b56('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x8b56('0x9')]('/:id',auth[_0x8b56('0xa')](),controller[_0x8b56('0xd')]);router[_0x8b56('0x9')](_0x8b56('0xe'),auth[_0x8b56('0xa')](),controller['getProformaPDF']);router[_0x8b56('0xf')]('/',auth[_0x8b56('0xa')](),controller['create']);router[_0x8b56('0xf')](_0x8b56('0x10'),auth[_0x8b56('0xa')](),controller[_0x8b56('0x11')]);router['put'](_0x8b56('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x8b56('0x13')](_0x8b56('0x12'),auth[_0x8b56('0xa')](),controller[_0x8b56('0x14')]);module[_0x8b56('0x15')]=router; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.attributes.js b/server/api/saProforma/saProforma.attributes.js index 6e32400..0b6f594 100644 --- a/server/api/saProforma/saProforma.attributes.js +++ b/server/api/saProforma/saProforma.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa29e=['INTEGER','BOOLEAN','DATE','sequelize','exports','STRING','TEXT'];(function(_0x232b44,_0x26e618){var _0x4830e9=function(_0x4d7f00){while(--_0x4d7f00){_0x232b44['push'](_0x232b44['shift']());}};_0x4830e9(++_0x26e618);}(_0xa29e,0x1a0));var _0xea29=function(_0x265cf6,_0x26f1d8){_0x265cf6=_0x265cf6-0x0;var _0x3f2737=_0xa29e[_0x265cf6];return _0x3f2737;};'use strict';var Sequelize=require(_0xea29('0x0'));module[_0xea29('0x1')]={'name':{'type':Sequelize[_0xea29('0x2')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0xea29('0x2')]},'status':{'type':Sequelize[_0xea29('0x3')]},'companyName':{'type':Sequelize[_0xea29('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0xea29('0x4')],'allowNull':![]},'authorized':{'type':Sequelize['BOOLEAN']},'clientCode':{'type':Sequelize[_0xea29('0x2')]},'discount':{'type':Sequelize['DECIMAL'](0xd,0x4)},'paid':{'type':Sequelize[_0xea29('0x4')],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0xea29('0x2')]},'receivingPostalCode':{'type':Sequelize['STRING']},'receivingCity':{'type':Sequelize[_0xea29('0x2')]},'receivingCountry':{'type':Sequelize[_0xea29('0x2')]},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize[_0xea29('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0xea29('0x2')](0x32)},'receivingSDICode':{'type':Sequelize[_0xea29('0x2')](0x15)},'receivingFiscalMessage':{'type':Sequelize['STRING']},'receivingExpiryDay':{'type':Sequelize[_0xea29('0x4')]},'receivingEurope':{'type':Sequelize[_0xea29('0x5')]},'receivingSocCap':{'type':Sequelize[_0xea29('0x2')](0xff)},'issuerName':{'type':Sequelize[_0xea29('0x2')]},'issuerStreet':{'type':Sequelize['STRING']},'issuerPostalCode':{'type':Sequelize[_0xea29('0x2')]},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize['STRING']},'issuerISOCode':{'type':Sequelize[_0xea29('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize['STRING'](0x32)},'issuerPIVA':{'type':Sequelize['STRING'](0x32)},'issuerSDICode':{'type':Sequelize[_0xea29('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0xea29('0x2')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0xea29('0x4')]},'issuerEurope':{'type':Sequelize[_0xea29('0x5')]},'issuerSocCap':{'type':Sequelize[_0xea29('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0xea29('0x2')](0xff)},'issuerBankName':{'type':Sequelize[_0xea29('0x2')](0xff)},'issuerBankStreet':{'type':Sequelize[_0xea29('0x2')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0xea29('0x2')]},'issuerBankCountry':{'type':Sequelize[_0xea29('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0xea29('0x2')]},'issuerBankIBAN':{'type':Sequelize[_0xea29('0x2')]},'issuerPhone':{'type':Sequelize[_0xea29('0x2')]},'issuerFax':{'type':Sequelize[_0xea29('0x2')]},'issuerEmail':{'type':Sequelize[_0xea29('0x2')]},'issuerWeb':{'type':Sequelize[_0xea29('0x2')]},'issuerABI':{'type':Sequelize['STRING']},'issuerCAB':{'type':Sequelize[_0xea29('0x2')]},'issuerPayPal':{'type':Sequelize[_0xea29('0x2')]},'clientCode':{'type':Sequelize[_0xea29('0x2')]},'startDate':{'type':Sequelize[_0xea29('0x6')]},'endDate':{'type':Sequelize['DATE']},'number':{'type':Sequelize[_0xea29('0x4')]},'beginningCompetence':{'type':Sequelize[_0xea29('0x6')]},'endCompetence':{'type':Sequelize[_0xea29('0x6')]}}; \ No newline at end of file +var _0x7a24=['exports','STRING','TEXT','INTEGER','BOOLEAN','DECIMAL','DATE'];(function(_0x4fde57,_0x32f025){var _0x236ad7=function(_0x3db675){while(--_0x3db675){_0x4fde57['push'](_0x4fde57['shift']());}};_0x236ad7(++_0x32f025);}(_0x7a24,0xf5));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x47a2('0x0')]={'name':{'type':Sequelize[_0x47a2('0x1')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0x47a2('0x1')]},'status':{'type':Sequelize[_0x47a2('0x2')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x47a2('0x3')],'allowNull':![]},'authorized':{'type':Sequelize[_0x47a2('0x4')]},'clientCode':{'type':Sequelize['STRING']},'discount':{'type':Sequelize[_0x47a2('0x5')](0xd,0x4)},'paid':{'type':Sequelize[_0x47a2('0x3')],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0x47a2('0x1')]},'receivingPostalCode':{'type':Sequelize[_0x47a2('0x1')]},'receivingCity':{'type':Sequelize[_0x47a2('0x1')]},'receivingCountry':{'type':Sequelize[_0x47a2('0x1')]},'receivingISOCode':{'type':Sequelize[_0x47a2('0x1')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x47a2('0x1')](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0x47a2('0x1')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x47a2('0x1')]},'receivingExpiryDay':{'type':Sequelize[_0x47a2('0x3')]},'receivingEurope':{'type':Sequelize[_0x47a2('0x4')]},'receivingSocCap':{'type':Sequelize[_0x47a2('0x1')](0xff)},'issuerName':{'type':Sequelize[_0x47a2('0x1')]},'issuerStreet':{'type':Sequelize[_0x47a2('0x1')]},'issuerPostalCode':{'type':Sequelize[_0x47a2('0x1')]},'issuerCity':{'type':Sequelize[_0x47a2('0x1')]},'issuerCountry':{'type':Sequelize[_0x47a2('0x1')]},'issuerISOCode':{'type':Sequelize[_0x47a2('0x1')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x47a2('0x1')](0x32)},'issuerPIVA':{'type':Sequelize[_0x47a2('0x1')](0x32)},'issuerSDICode':{'type':Sequelize['STRING'](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x47a2('0x1')](0x3e8)},'issuerExpiryDay':{'type':Sequelize['INTEGER']},'issuerEurope':{'type':Sequelize[_0x47a2('0x4')]},'issuerSocCap':{'type':Sequelize[_0x47a2('0x1')](0xff)},'issuerBankAccount':{'type':Sequelize['STRING'](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize['STRING']},'issuerBankPostalCode':{'type':Sequelize[_0x47a2('0x1')]},'issuerBankCity':{'type':Sequelize[_0x47a2('0x1')]},'issuerBankCountry':{'type':Sequelize[_0x47a2('0x1')]},'issuerBankBICSWIFT':{'type':Sequelize['STRING']},'issuerBankIBAN':{'type':Sequelize[_0x47a2('0x1')]},'issuerPhone':{'type':Sequelize[_0x47a2('0x1')]},'issuerFax':{'type':Sequelize[_0x47a2('0x1')]},'issuerEmail':{'type':Sequelize[_0x47a2('0x1')]},'issuerWeb':{'type':Sequelize[_0x47a2('0x1')]},'issuerABI':{'type':Sequelize[_0x47a2('0x1')]},'issuerCAB':{'type':Sequelize[_0x47a2('0x1')]},'issuerPayPal':{'type':Sequelize[_0x47a2('0x1')]},'clientCode':{'type':Sequelize['STRING']},'startDate':{'type':Sequelize[_0x47a2('0x6')]},'endDate':{'type':Sequelize[_0x47a2('0x6')]},'number':{'type':Sequelize['INTEGER']},'beginningCompetence':{'type':Sequelize[_0x47a2('0x6')]},'endCompetence':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.controller.js b/server/api/saProforma/saProforma.controller.js index bbc1cb6..5407f49 100644 --- a/server/api/saProforma/saProforma.controller.js +++ b/server/api/saProforma/saProforma.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x258f=['','','Phone','Telefono','Fax','Email','VAT\x20number','P.IVA','Tax\x20code','C.F.','Soc.Cap.\x20fp','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Articolo','Hrs/Qty','Ore/Qta','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Subtotal','Tax','Tasse','Total','Please\x20send\x20PAYMENT\x20to','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','receivingCountry','Italy','\x20','\x20%s
','issuerName','%s
','issuerPostalCode','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','fax','issuerFax','email','issuerEmail','piva','issuerFiscalCode','sdi','issuerSDICode','','','%s','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingFiscalCode','receivingPIVA','receivingSDICode','','','','\x20N.%d','%s,\x20','DD/MM/YYYY','add','saExpiryDay','days','','duedate','','','','description','hrsqty','unitprice','subtotal','netPrice','discount','tax','quantity','%s','productName','','toFixed','\x20€','','isNil','receivingFiscalMessage','indexOf','split\x20payment','','','total','','','\x20',' ','','\x20%s\x20','replace','','','sendpayment','issuerBankAccount','accountholder',':\x20','bankname','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','','abi','cab','issuerABI','issuerCAB','swif','issuerBankBICSWIFT','issuerPayPal','thank1','','thank2','paid','\x22\x20width=\x22180\x22>','','','toFile','log','TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName','download','err','addCloneDetail->>','ProformaId','cloneProforma','cloneProforma\x20req.params.id:','sequelize','transaction','result','cloneProforma\x20productsProforma:','push','WARNING','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','TCL:\x20exports.cloneProforma\x20->\x20err','Duplicate\x20entry.','html-pdf','rimraf','fast-json-patch','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','options','SAProforma','findAll','rows','catch','show','params','includeAll','find','create','body','describe','getProformaPDF','unix','toString','join','root','server','files','tmp','logo-invoice.png','images','logos','paid-invoice.png','format','Proforma_%s-%s.pdf','proforma','SAProformaDetail','details','portrait','1cm','10mm','{{page}}/{{pages}}','footer','contents','default','','issuerWeb',''];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x258f,0xa8));var _0xf258=function(_0x1c629b,_0x5eaf2a){_0x1c629b=_0x1c629b-0x0;var _0x583efa=_0x258f[_0x1c629b];return _0x583efa;};'use strict';var pdf=require(_0xf258('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf258('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf258('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf258('0x3'));var util=require('util');var path=require(_0xf258('0x4'));var sox=require(_0xf258('0x5'));var csv=require(_0xf258('0x6'));var ejs=require(_0xf258('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf258('0x8'));var crypto=require(_0xf258('0x9'));var jsforce=require(_0xf258('0xa'));var deskjs=require(_0xf258('0xb'));var toCsv=require(_0xf258('0x6'));var querystring=require(_0xf258('0xc'));var Papa=require(_0xf258('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf258('0xe'));var hardwareService=require(_0xf258('0xf'));var logger=require(_0xf258('0x10'))(_0xf258('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf258('0x12'))['db'];function respondWithStatusCode(_0x41124e,_0x44e25d){_0x44e25d=_0x44e25d||0xcc;return function(_0x4457cf){if(_0x4457cf){return _0x41124e[_0xf258('0x13')](_0x44e25d);}return _0x41124e['status'](_0x44e25d)['end']();};}function respondWithResult(_0x3c2429,_0x511ce5){_0x511ce5=_0x511ce5||0xc8;return function(_0x1916f6){if(_0x1916f6){return _0x3c2429[_0xf258('0x14')](_0x511ce5)[_0xf258('0x15')](_0x1916f6);}};}function respondWithFilteredResult(_0x12392b,_0x383e7e){return function(_0x5b8023){if(_0x5b8023){var _0x2e1b6c=_0x5b8023[_0xf258('0x16')],_0x4d9de0=_0x383e7e['offset'],_0x3168a2=_0x383e7e['offset']+_0x383e7e[_0xf258('0x17')],_0x3a99b6;if(_0x3168a2>=_0x2e1b6c){_0x3168a2=_0x2e1b6c;_0x3a99b6=0xc8;}else{_0x3a99b6=0xce;}_0x12392b['status'](_0x3a99b6);return _0x12392b[_0xf258('0x18')](_0xf258('0x19'),_0x4d9de0+'-'+_0x3168a2+'/'+_0x2e1b6c)['json'](_0x5b8023);}return null;};}function patchUpdates(_0x175a31){return function(_0x405460){try{jsonpatch[_0xf258('0x1a')](_0x405460,_0x175a31,!![]);}catch(_0x3b49c9){return BPromise[_0xf258('0x1b')](_0x3b49c9);}return _0x405460[_0xf258('0x1c')]();};}function saveUpdates(_0xabaf18,_0x5375b7){return function(_0x535870){if(_0x535870){return _0x535870[_0xf258('0x1d')](_0xabaf18)[_0xf258('0x1e')](function(_0x240d84){return _0x240d84;});}return null;};}function removeEntity(_0x584e18,_0x95d0d7){return function(_0x49eaa4){if(_0x49eaa4){return _0x49eaa4[_0xf258('0x1f')]()[_0xf258('0x1e')](function(){_0x584e18[_0xf258('0x14')](0xcc)[_0xf258('0x20')]();});}};}function handleEntityNotFound(_0x350aae,_0x34b206){return function(_0x18f951){if(!_0x18f951){_0x350aae[_0xf258('0x13')](0x194);}return _0x18f951;};}function handleError(_0x4042e6,_0x21d6a3){_0x21d6a3=_0x21d6a3||0x1f4;return function(_0x2c7d17){logger[_0xf258('0x21')](_0x2c7d17[_0xf258('0x22')]);if(_0x2c7d17['name']){delete _0x2c7d17[_0xf258('0x23')];}_0x4042e6['status'](_0x21d6a3)[_0xf258('0x24')](_0x2c7d17);};}exports[_0xf258('0x25')]=function(_0x1562d4,_0xc5077c){var _0x29189e={},_0x4368fd={},_0xbf1e64={'count':0x0,'rows':[]};var _0x4d0745=db['SAProforma'][_0xf258('0x26')];_0x4368fd[_0xf258('0x27')]=_[_0xf258('0x28')](_0x4d0745);_0x4368fd[_0xf258('0x29')]=_[_0xf258('0x28')](_0x1562d4[_0xf258('0x29')]);_0x4368fd[_0xf258('0x2a')]=_[_0xf258('0x2b')](_0x4368fd[_0xf258('0x27')],_0x4368fd[_0xf258('0x29')]);_0x29189e[_0xf258('0x2c')]=_[_0xf258('0x2b')](_0x4368fd[_0xf258('0x27')],qs['fields'](_0x1562d4[_0xf258('0x29')][_0xf258('0x2d')]));_0x29189e[_0xf258('0x2c')]=_0x29189e['attributes'][_0xf258('0x2e')]?_0x29189e[_0xf258('0x2c')]:_0x4368fd[_0xf258('0x27')];if(!_0x1562d4[_0xf258('0x29')][_0xf258('0x2f')](_0xf258('0x30'))){_0x29189e[_0xf258('0x17')]=qs[_0xf258('0x17')](_0x1562d4[_0xf258('0x29')][_0xf258('0x17')]);_0x29189e[_0xf258('0x31')]=qs[_0xf258('0x31')](_0x1562d4['query'][_0xf258('0x31')]);}_0x29189e[_0xf258('0x32')]=qs[_0xf258('0x33')](_0x1562d4['query'][_0xf258('0x33')]);_0x29189e[_0xf258('0x34')]=qs['filters'](_[_0xf258('0x35')](_0x1562d4['query'],_0x4368fd[_0xf258('0x2a')]));if(_0x1562d4[_0xf258('0x29')][_0xf258('0x36')]){_0x29189e['where']=_[_0xf258('0x37')](_0x29189e[_0xf258('0x34')],{'$or':_[_0xf258('0x38')](_0x4d0745,function(_0x23ee1a){if(_0x23ee1a[_0xf258('0x39')][_0xf258('0x3a')]!=='VIRTUAL'){var _0x2d9921={};_0x2d9921[_0x23ee1a['field']]={'$like':'%'+_0x1562d4[_0xf258('0x29')][_0xf258('0x36')]+'%'};return _0x2d9921;}})});}_0x29189e=_['merge']({},_0x29189e,_0x1562d4[_0xf258('0x3b')]);var _0x2433a3={'where':_0x29189e['where']};return db[_0xf258('0x3c')][_0xf258('0x16')](_0x2433a3)[_0xf258('0x1e')](function(_0x399c4f){_0xbf1e64[_0xf258('0x16')]=_0x399c4f;if(_0x1562d4[_0xf258('0x29')]['includeAll']){_0x29189e['include']=[{'all':!![]}];}return db[_0xf258('0x3c')][_0xf258('0x3d')](_0x29189e);})[_0xf258('0x1e')](function(_0x61ba3e){_0xbf1e64[_0xf258('0x3e')]=_0x61ba3e;return _0xbf1e64;})['then'](respondWithFilteredResult(_0xc5077c,_0x29189e))[_0xf258('0x3f')](handleError(_0xc5077c,null));};exports[_0xf258('0x40')]=function(_0x291dd3,_0x4a8855){var _0xa174={'raw':![],'where':{'id':_0x291dd3[_0xf258('0x41')]['id']}},_0x1ba260={};_0x1ba260[_0xf258('0x27')]=_[_0xf258('0x28')](db[_0xf258('0x3c')][_0xf258('0x26')]);_0x1ba260[_0xf258('0x29')]=_[_0xf258('0x28')](_0x291dd3[_0xf258('0x29')]);_0x1ba260[_0xf258('0x2a')]=_['intersection'](_0x1ba260['model'],_0x1ba260['query']);_0xa174[_0xf258('0x2c')]=_[_0xf258('0x2b')](_0x1ba260['model'],qs['fields'](_0x291dd3[_0xf258('0x29')][_0xf258('0x2d')]));_0xa174[_0xf258('0x2c')]=_0xa174[_0xf258('0x2c')][_0xf258('0x2e')]?_0xa174['attributes']:_0x1ba260[_0xf258('0x27')];if(_0x291dd3[_0xf258('0x29')][_0xf258('0x42')]){_0xa174['include']=[{'all':!![]}];}_0xa174=_[_0xf258('0x37')]({},_0xa174,_0x291dd3['options']);return db[_0xf258('0x3c')][_0xf258('0x43')](_0xa174)['then'](handleEntityNotFound(_0x4a8855,null))['then'](respondWithResult(_0x4a8855,null))[_0xf258('0x3f')](handleError(_0x4a8855,null));};exports[_0xf258('0x44')]=function(_0x3f2e4b,_0xfcb32d){return db[_0xf258('0x3c')][_0xf258('0x44')](_0x3f2e4b[_0xf258('0x45')],{})[_0xf258('0x1e')](respondWithResult(_0xfcb32d,0xc9))['catch'](handleError(_0xfcb32d,null));};exports[_0xf258('0x1d')]=function(_0x3f67bd,_0x5d7e32){if(_0x3f67bd[_0xf258('0x45')]['id']){delete _0x3f67bd['body']['id'];}return db[_0xf258('0x3c')][_0xf258('0x43')]({'where':{'id':_0x3f67bd[_0xf258('0x41')]['id']}})[_0xf258('0x1e')](handleEntityNotFound(_0x5d7e32,null))['then'](saveUpdates(_0x3f67bd[_0xf258('0x45')],null))[_0xf258('0x1e')](respondWithResult(_0x5d7e32,null))[_0xf258('0x3f')](handleError(_0x5d7e32,null));};exports[_0xf258('0x1f')]=function(_0x349b4e,_0x4e3020){return db[_0xf258('0x3c')][_0xf258('0x43')]({'where':{'id':_0x349b4e['params']['id']}})[_0xf258('0x1e')](handleEntityNotFound(_0x4e3020,null))[_0xf258('0x1e')](removeEntity(_0x4e3020,null))[_0xf258('0x3f')](handleError(_0x4e3020,null));};exports['describe']=function(_0x1a3b7c,_0x5e2217){return db[_0xf258('0x3c')][_0xf258('0x46')]()[_0xf258('0x1e')](respondWithResult(_0x5e2217,null))[_0xf258('0x3f')](handleError(_0x5e2217,null));};exports[_0xf258('0x47')]=function(_0x19284a,_0x21956f){var _0x480ad2=moment()[_0xf258('0x48')]()[_0xf258('0x49')]();var _0x580358=path[_0xf258('0x4a')](config[_0xf258('0x4b')],_0xf258('0x4c'),_0xf258('0x4d'),_0xf258('0x4e'));var _0x53b8f7=path[_0xf258('0x4a')](config[_0xf258('0x4b')],_0xf258('0x4c'),'files','images','logos',_0xf258('0x4f'));var _0x4f7c16=path['join'](config['root'],_0xf258('0x4c'),_0xf258('0x4d'),_0xf258('0x50'),_0xf258('0x51'),_0xf258('0x52'));var _0x26b81a=path['join'](_0x580358,_0x480ad2);var _0xa8efea=util[_0xf258('0x53')](_0xf258('0x54'),_0x19284a['params']['id'],_0x480ad2);var _0x3f27d6=path[_0xf258('0x4a')](_0x26b81a,_0xa8efea);var _0x4a2af3=![];var _0xc61900={};return db[_0xf258('0x3c')][_0xf258('0x43')]({'where':{'id':_0x19284a[_0xf258('0x41')]['id']},'raw':!![]})[_0xf258('0x1e')](handleEntityNotFound(_0x21956f,null))[_0xf258('0x1e')](function(_0xc00890){if(_0xc00890){_0xc61900[_0xf258('0x55')]=_0xc00890;return db[_0xf258('0x56')][_0xf258('0x3d')]({'where':{'ProformaId':_0xc00890['id']},'raw':!![]})['then'](function(_0x53c962){_0xc61900[_0xf258('0x57')]=_0x53c962;_0x4a2af3=!![];var _0xe741ef='';var _0x3d20ab={'format':'A4','orientation':_0xf258('0x58'),'border':_0xf258('0x59'),'footer':{'height':_0xf258('0x5a'),'contents':{'default':_0xf258('0x5b')}}};_0x3d20ab[_0xf258('0x5c')][_0xf258('0x5d')]['default']=_0x3d20ab[_0xf258('0x5c')][_0xf258('0x5d')][_0xf258('0x5e')]+_0xf258('0x5f')+_0xc61900['proforma'][_0xf258('0x60')]+_0xf258('0x61');fs['mkdirSync'](_0x26b81a);_0xe741ef=_0xf258('0x62');_0xe741ef+='\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}';_0xe741ef+=_0xf258('0x63');var _0x47116f={'phone':{'en':_0xf258('0x64'),'it':_0xf258('0x65')},'fax':{'en':_0xf258('0x66'),'it':_0xf258('0x66')},'email':{'en':_0xf258('0x67'),'it':_0xf258('0x67')},'piva':{'en':_0xf258('0x68'),'it':_0xf258('0x69')},'cf':{'en':_0xf258('0x6a'),'it':_0xf258('0x6b')},'sdi':{'en':'I.S.\x20code','it':'Codice\x20S.D.I.'},'cs':{'en':_0xf258('0x6c'),'it':'Cap.Soc.\x20iv'},'invoice':{'en':_0xf258('0x6d'),'it':_0xf258('0x6e')},'proforma':{'en':_0xf258('0x6f'),'it':_0xf258('0x6f')},'creditnote':{'en':_0xf258('0x70'),'it':_0xf258('0x71')},'duedate':{'en':_0xf258('0x72'),'it':'Scadenza'},'item':{'en':'Item','it':_0xf258('0x73')},'description':{'en':'Description','it':'Descrizione'},'hrsqty':{'en':_0xf258('0x74'),'it':_0xf258('0x75')},'unitprice':{'en':'Unit\x20Price','it':_0xf258('0x76')},'subtotal':{'en':_0xf258('0x77'),'it':_0xf258('0x78')},'discount':{'en':_0xf258('0x79'),'it':'Sconto'},'total':{'en':_0xf258('0x7a'),'it':'Imponibile'},'tax':{'en':_0xf258('0x7b'),'it':_0xf258('0x7c')},'nettopay':{'en':_0xf258('0x7d'),'it':'Totale'},'sendpayment':{'en':_0xf258('0x7e'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':_0xf258('0x7f'),'it':_0xf258('0x80')},'bankname':{'en':_0xf258('0x81'),'it':_0xf258('0x82')},'bankaddress':{'en':_0xf258('0x83'),'it':_0xf258('0x84')},'abi':{'en':'ABI','it':_0xf258('0x85')},'cab':{'en':'CAB','it':_0xf258('0x86')},'bic':{'en':'BIC','it':_0xf258('0x87')},'swif':{'en':_0xf258('0x88'),'it':'SWIF'},'iban':{'en':_0xf258('0x89'),'it':_0xf258('0x89')},'paypal':{'en':_0xf258('0x8a'),'it':_0xf258('0x8b')},'thank1':{'en':_0xf258('0x8c'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0xf258('0x8d'),'it':'\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.'}};var _0xe0f2a7='it';if(_0xc61900[_0xf258('0x55')][_0xf258('0x8e')]!==_0xf258('0x8f')){_0xe0f2a7='en';}_0xe741ef+='';_0xe741ef+=_0xf258('0x90')+_0x53b8f7+'\x22\x20width=\x22180\x22>';_0xe741ef+=_0xf258('0x91');_0xe741ef+=util['format'](_0xf258('0x92'),_0xc61900[_0xf258('0x55')][_0xf258('0x93')]);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0x94'),_0xc61900[_0xf258('0x55')]['issuerStreet']);_0xe741ef+=util[_0xf258('0x53')]('%s',_0xc61900[_0xf258('0x55')][_0xf258('0x95')]);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0x96'),_0xc61900[_0xf258('0x55')][_0xf258('0x97')]);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0x98'),_0xc61900[_0xf258('0x55')][_0xf258('0x99')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0x9a')][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')]['issuerPhone']);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0x9c')][_0xe0f2a7]+':\x20%s
',_0xc61900['proforma'][_0xf258('0x9d')]);_0xe741ef+=util['format'](_0x47116f[_0xf258('0x9e')][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')][_0xf258('0x9f')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0xa0')][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900['proforma']['issuerPIVA']);_0xe741ef+=util['format'](_0x47116f['cf'][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')][_0xf258('0xa1')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0xa2')][_0xe0f2a7]+':\x20%s
',_0xc61900['proforma'][_0xf258('0xa3')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f['cs'][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900['proforma']['issuerSocCap']);_0xe741ef+=_0xf258('0xa4');_0xe741ef+=_0xf258('0xa5');_0xe741ef+='';_0xe741ef+=util[_0xf258('0x53')](_0xf258('0xa6'),_0xc61900['proforma'][_0xf258('0xa7')]);_0xe741ef+=util['format']('%s
',_0xc61900['proforma'][_0xf258('0xa8')]);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0xa9'),_0xc61900[_0xf258('0x55')][_0xf258('0xaa')]);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0x94'),_0xc61900[_0xf258('0x55')][_0xf258('0xab')]);_0xe741ef+=util['format'](_0xf258('0x94'),_0xc61900[_0xf258('0x55')][_0xf258('0x8e')]);_0xe741ef+=util['format'](_0xf258('0xac')+_0x47116f['cf'][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')][_0xf258('0xad')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0xa0')][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')][_0xf258('0xae')]);_0xe741ef+=util[_0xf258('0x53')](_0x47116f[_0xf258('0xa2')][_0xe0f2a7]+_0xf258('0x9b'),_0xc61900[_0xf258('0x55')][_0xf258('0xaf')]);_0xe741ef+=_0xf258('0xb0');_0xe741ef+='';_0xe741ef+='
';_0xe741ef+=_0xf258('0xb1');_0xe741ef+=util[_0xf258('0x53')](_0xf258('0xb2')+_0x47116f[_0xf258('0x55')][_0xe0f2a7]+_0xf258('0xb3'),_0xc00890['id']);_0xe741ef+=util[_0xf258('0x53')](_0xf258('0xb4'),_0xc61900[_0xf258('0x55')][_0xf258('0x97')]);var _0x2a32ee=moment(_0xc61900[_0xf258('0x55')]['updatedAt'])[_0xf258('0x53')](_0xf258('0xb5'));_0xe741ef+=util[_0xf258('0x53')]('%s\x20',_0x2a32ee);var _0x35938f=moment(_0xc61900[_0xf258('0x55')]['updatedAt'])[_0xf258('0xb6')](_0xc61900[_0xf258('0x55')][_0xf258('0xb7')],_0xf258('0xb8'))[_0xf258('0x53')]('DD/MM/YYYY');_0xe741ef+=util['format'](_0xf258('0xb9')+_0x47116f[_0xf258('0xba')][_0xe0f2a7]+':\x20%s',_0x35938f);_0xe741ef+=_0xf258('0xbb');_0xe741ef+=_0xf258('0x91');_0xe741ef+=_0xf258('0xb1');_0xe741ef+='';_0xe741ef+=_0xf258('0x91');_0xe741ef+=_0xf258('0xbc')+_0x47116f['item'][_0xe0f2a7]+_0xf258('0xbd');_0xe741ef+=_0xf258('0xbc')+_0x47116f[_0xf258('0xbe')][_0xe0f2a7]+_0xf258('0xbd');_0xe741ef+=''+_0x47116f[_0xf258('0xbf')][_0xe0f2a7]+'';_0xe741ef+=_0xf258('0xbc')+_0x47116f[_0xf258('0xc0')][_0xe0f2a7]+_0xf258('0xbd');_0xe741ef+=_0xf258('0xbc')+_0x47116f[_0xf258('0xc1')][_0xe0f2a7]+_0xf258('0xbd');_0xe741ef+=_0xf258('0xbb');var _0x229be5=0x0;var _0x3986e6=0x0;for(var _0x2486c6=0x0;_0x2486c6<_0xc61900[_0xf258('0x57')][_0xf258('0x2e')];_0x2486c6++){var _0x2f6fd6=0x0;var _0x3e7077=0x0;var _0x3be318=0x0;var _0x1dfdfa=0x0;_0x2f6fd6=_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc2')]-_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc2')]/0x64*_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc3')];_0x3e7077=_0x2f6fd6/0x64*_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc4')];_0x3be318=_0x2f6fd6*_0xc61900[_0xf258('0x57')][_0x2486c6]['quantity'];_0x1dfdfa=_0x3e7077*_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc5')];_0xe741ef+=_0xf258('0x91');_0xe741ef+=util[_0xf258('0x53')](_0xf258('0xc6'),_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc7')]);_0xe741ef+=util[_0xf258('0x53')]('',_0xc61900[_0xf258('0x57')][_0x2486c6]['productDescription']);_0xe741ef+=util['format']('%d',_0xc61900[_0xf258('0x57')][_0x2486c6][_0xf258('0xc5')]);_0xe741ef+=_0xf258('0xc8')+_0x2f6fd6[_0xf258('0xc9')](0x2)+_0xf258('0xca');_0xe741ef+=''+_0x3be318[_0xf258('0xc9')](0x2)+_0xf258('0xca');_0xe741ef+=_0xf258('0xbb');_0x229be5+=_0x3be318;_0x3986e6+=_0x1dfdfa;}_0xe741ef+=_0xf258('0xcb');if(!_[_0xf258('0xcc')](_0xc61900[_0xf258('0x55')][_0xf258('0xc3')])){var _0x3e2348=0x0;var _0x36122d=0x0;var _0xfa4724=_0xc61900['proforma'][_0xf258('0xc3')]*0x64/_0x229be5;for(var _0x2486c6=0x0;_0x2486c6<_0xc61900[_0xf258('0x57')][_0xf258('0x2e')];_0x2486c6++){var _0x198467=0x0;var _0x47f3b6=0x0;var _0x20ad50=0x0;_0x2f6fd6=_0xc61900['details'][_0x2486c6][_0xf258('0xc2')]-_0xc61900['details'][_0x2486c6][_0xf258('0xc2')]/0x64*_0xc61900['details'][_0x2486c6][_0xf258('0xc3')];_0x198467=_0x2f6fd6/0x64*_0xfa4724;_0x47f3b6=_0x2f6fd6-_0x198467;_0x20ad50=_0x47f3b6*_0xc61900[_0xf258('0x57')][_0x2486c6]['quantity'];_0x3e2348+=_0x20ad50;_0x36122d+=_0x20ad50/0x64*_0xc61900[_0xf258('0x57')][_0x2486c6]['tax'];}}var _0x1b37a6=0x0;var _0x54117e=0x0;var _0xbe204f=![];var _0x66b206=_0xc61900['proforma'][_0xf258('0xcd')];if(_0x66b206[_0xf258('0xce')](_0xf258('0xcf'))!=-0x1){_0xbe204f=!![];}if(!_[_0xf258('0xcc')](_0xc61900[_0xf258('0x55')]['discount'])){_0xe741ef+='';if(_0xc61900['proforma'][_0xf258('0xc3')]>0x0){_0xe741ef+=_0xf258('0xd0')+_0x47116f[_0xf258('0xc3')][_0xe0f2a7]+_0xf258('0xa4');_0xe741ef+=_0xf258('0xc8')+_0xc61900['proforma'][_0xf258('0xc3')][_0xf258('0xc9')](0x2)+_0xf258('0xca');}_0xe741ef+=_0xf258('0xbb');_0x1b37a6=_0x36122d;_0x54117e=_0x3e2348;}else{_0x1b37a6=_0x3986e6;_0x54117e=_0x229be5;}if(_0x1b37a6>0x0||_0xc61900['proforma'][_0xf258('0xc3')]>0x0){_0xe741ef+=_0xf258('0x91');_0xe741ef+=_0xf258('0xd1')+_0x47116f[_0xf258('0xd2')][_0xe0f2a7]+_0xf258('0xa4');_0xe741ef+=_0xf258('0xc8')+_0x54117e[_0xf258('0xc9')](0x2)+'\x20€';_0xe741ef+=_0xf258('0xbb');}if(_0x1b37a6>0x0){_0xe741ef+=_0xf258('0x91');_0xe741ef+=_0xf258('0xd1')+_0x47116f['tax'][_0xe0f2a7]+_0xf258('0xa4');_0xe741ef+=_0xf258('0xc8')+_0x1b37a6[_0xf258('0xc9')](0x2)+_0xf258('0xca');_0xe741ef+=_0xf258('0xbb');}_0xe741ef+=_0xf258('0x91');var _0x2a26f1;if(_0xbe204f){_0x2a26f1=_0x54117e;}else{_0x2a26f1=_0x54117e+_0x1b37a6;}_0xe741ef+=_0xf258('0xd3')+_0x47116f['nettopay'][_0xe0f2a7]+_0xf258('0xd4')+_0x2a26f1[_0xf258('0xc9')](0x2)+_0xf258('0xca');_0xe741ef+=_0xf258('0xd5');_0xe741ef+=_0xf258('0xbb');_0xe741ef+=_0xf258('0xd6');_0xe741ef+=_0xf258('0xd7');_0xe741ef+=_0xf258('0x91');_0xe741ef+=util['format'](_0xf258('0xd8'),_0xc61900['proforma'][_0xf258('0xcd')][_0xf258('0xd9')](new RegExp(String['fromCharCode'](0xd),'g'),_0xf258('0xda')));_0xe741ef+=_0xf258('0xbb');_0xe741ef+=_0xf258('0x91');_0xe741ef+=_0xf258('0xb1');_0xe741ef+=_0xf258('0xdb')+_0x47116f[_0xf258('0xdc')][_0xe0f2a7]+_0xf258('0x61');if(!_['isNil'](_0xc61900[_0xf258('0x55')][_0xf258('0xdd')])){_0xe741ef+=_0xf258('0xdb')+_0x47116f[_0xf258('0xde')][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900[_0xf258('0x55')][_0xf258('0xdd')]+'';_0xe741ef+=_0xf258('0xdb')+_0x47116f[_0xf258('0xe0')][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900[_0xf258('0x55')][_0xf258('0xe1')]+_0xf258('0xe2');_0xe741ef+=''+_0x47116f[_0xf258('0xe3')][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900[_0xf258('0x55')][_0xf258('0xe4')]+',\x20'+_0xc61900[_0xf258('0x55')][_0xf258('0xe5')]+_0xf258('0xe6')+_0xc61900['proforma'][_0xf258('0xe7')]+'\x20('+_0xc61900[_0xf258('0x55')][_0xf258('0xe8')]+')'+_0xf258('0xe9');_0xe741ef+=''+_0x47116f[_0xf258('0xea')][_0xe0f2a7]+'/'+_0x47116f[_0xf258('0xeb')][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900[_0xf258('0x55')][_0xf258('0xec')]+'/'+_0xc61900[_0xf258('0x55')][_0xf258('0xed')]+_0xf258('0xe9');_0xe741ef+=''+_0x47116f['bic'][_0xe0f2a7]+'/'+_0x47116f[_0xf258('0xee')][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900['proforma'][_0xf258('0xef')]+_0xf258('0xe9');_0xe741ef+=_0xf258('0xdb')+_0x47116f['iban'][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900['proforma']['issuerBankIBAN']+_0xf258('0xe9');}if(!_[_0xf258('0xcc')](_0xc61900[_0xf258('0x55')][_0xf258('0xf0')])){_0xe741ef+=_0xf258('0xdb')+_0x47116f['paypal'][_0xe0f2a7]+_0xf258('0xdf')+_0xc61900[_0xf258('0x55')][_0xf258('0xf0')]+_0xf258('0xe9');}_0xe741ef+=''+_0x47116f[_0xf258('0xf1')][_0xe0f2a7]+_0xf258('0xf2')+_0x35938f+''+_0x47116f[_0xf258('0xf3')][_0xe0f2a7]+_0xf258('0x61');_0xe741ef+=_0xf258('0xa4');_0xe741ef+=_0xf258('0xbb');if(_0xc61900[_0xf258('0x55')][_0xf258('0xf4')]===0x1){_0xe741ef+=_0xf258('0x90')+_0x4f7c16+_0xf258('0xf5');}_0xe741ef+='
%s
';_0xe741ef+=_0xf258('0xf6');_0xe741ef+=_0xf258('0xf7');return new BPromise(function(_0x1b0cce,_0xe1db47){pdf['create'](_0xe741ef,_0x3d20ab)[_0xf258('0xf8')](path[_0xf258('0x4a')](_0x26b81a,_0xa8efea),function(_0x2895b1,_0xa1c6a0){if(_0x2895b1)return _0xe1db47(_0x2895b1);_0x1b0cce(_0xa1c6a0);});});});}})[_0xf258('0x1e')](function(){if(_0x4a2af3){console[_0xf258('0xf9')](_0xf258('0xfa'),_0x3f27d6,_0xa8efea);return _0x21956f[_0xf258('0xfb')](_0x3f27d6,_0xa8efea,function(_0x5af8bd){if(_0x5af8bd){console[_0xf258('0xf9')](_0xf258('0xfc'),_0x5af8bd);}else{console[_0xf258('0xf9')]('foldername',_0x26b81a);rimraf(_0x26b81a,function(){});}});}else{return _0x21956f[_0xf258('0x13')](0xc8);}})[_0xf258('0x3f')](handleError(_0x21956f,null));};function addCloneDetail(_0x1f044b,_0x416e26,_0x2a8a6b){console['log'](_0xf258('0xfd'),_0x1f044b);_0x1f044b[_0xf258('0xfe')]=_0x416e26;delete _0x1f044b['id'];return db[_0xf258('0x56')][_0xf258('0x44')](_0x1f044b,{'transaction':_0x2a8a6b});}exports[_0xf258('0xff')]=function(_0x4d4adf,_0x5dc1e8,_0x4f31c9){var _0x36658a;if(_0x4d4adf[_0xf258('0x45')]['id']){delete _0x4d4adf[_0xf258('0x45')]['id'];}console[_0xf258('0xf9')](_0xf258('0x100'),_0x4d4adf[_0xf258('0x41')]['id']);return db[_0xf258('0x101')][_0xf258('0x102')](function(_0x2348b9){return db[_0xf258('0x3c')][_0xf258('0x44')](_0x4d4adf[_0xf258('0x45')],{'transaction':_0x2348b9,'logging':console[_0xf258('0xf9')]})[_0xf258('0x1e')](function(_0x214216){console['log'](_0xf258('0x103'),_0x214216);_0x36658a=_0x214216;var _0x47fa94=_0x4d4adf[_0xf258('0x41')]['id'];return db[_0xf258('0x56')][_0xf258('0x3d')]({'where':{'ProformaId':_0x47fa94},'raw':!![]});})['then'](function(_0x3c01ed){console[_0xf258('0xf9')](_0xf258('0x104'),_0x3c01ed);if(_0x3c01ed['length']>0x0){var _0x5ad893=[];for(var _0xd63247=0x0;_0xd63247<_0x3c01ed[_0xf258('0x2e')];_0xd63247++){_0x5ad893[_0xf258('0x105')](addCloneDetail(_0x3c01ed[_0xd63247],_0x36658a['id'],_0x2348b9));}return BPromise['all'](_0x5ad893);}else{var _0x634221={'errors':[{'type':_0xf258('0x106'),'message':_0xf258('0x107')}]};throw _0x634221;}});})[_0xf258('0x1e')](function(){return _0x5dc1e8['sendStatus'](0xc8);})[_0xf258('0x3f')](function(_0x50a7ac){console[_0xf258('0xf9')](_0xf258('0x108'),_0x50a7ac);if(_0x50a7ac['name']==='SequelizeUniqueConstraintError'){var _0x50a7ac={'errors':[{'message':_0xf258('0x109')}]};}_0x5dc1e8['status'](0x1f4)['send'](_0x50a7ac);});}; \ No newline at end of file +var _0x0565=['model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','map','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','getProformaPDF','unix','join','root','server','files','images','logos','paid-invoice.png','format','proforma','SAProformaDetail','details','portrait','1cm','10mm','{{page}}
/{{pages}}','footer','contents','default','issuerWeb','mkdirSync','','\x20\x20body{font-family:\x20Verdana,\x20Geneva,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2012px;}.issuerData{font-weight:\x20normal}.issuerFiled{font-weight:\x20bold;\x20font-size:\x2010px;\x20padding-left:\x2010px;}.issuerFiledWeb{font-weight:\x20bold;\x20text-align:\x20center;}.receiperInfo{text-align:\x20right;\x20font-size:\x2012px}.receiperCompanyName{font-weight:\x20bold;\x20padding-top:\x2010px;\x20padding-bottom:\x2015px;\x20font-size:\x2016px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;}table.center{margin-left:\x20auto;\x20margin-right:\x20auto;\x20width:\x2090%;}.total{background-color:\x20lightgray;\x20font-size:\x2018px;\x20font-weight:\x20bold;}.totalText{background-color:\x20lightgray;\x20text-align:\x20right;\x20font-size:\x2016px;\x20padding-right:\x2010px;}.totalEmpty{background-color:\x20#ffffff;}.invoiceNumber{font-weight:\x20bolder;\x20font-size:\x2024px;\x20padding-bottom:\x2020px;}.invoiceNumber{font-weight:\x20bold;\x20font-size:\x2018px;}.createdDate{font-size:\x2014px;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;}.duedDate{font-size:\x2014px;\x20padding-bottom:\x2010px;}.TFtable{width:\x20100%;\x20font-size:\x2010px;\x20border-collapse:\x20collapse;}.TFtable\x20td{padding:\x207px;}.TFtable\x20tr:nth-child(even){background:\x20#ffffff;}.TFtable\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.numberRight{text-align:\x20right;}.numberCenter{text-align:\x20center}.currency{text-align:\x20left;}table.roundedCorners{border:\x202px\x20solid\x20lightgray;\x20border-radius:\x205px;\x20border-spacing:\x200;\x20width:\x20100%;\x20font-size:\x2010px;}table.roundedCorners\x20td,\x20table.roundedCorners\x20th{border-bottom:\x201px\x20solid\x20lightgray;\x20padding:\x2010px;}table.roundedCorners\x20tr:last-child\x20>\x20td{border-bottom:\x20none;}table.roundedCorners\x20tr:nth-child(even){background:\x20#ffffff;}table.roundedCorners\x20tr:nth-child(odd){background:\x20rgb(237,\x20232,\x20232);}.lex{padding-left:\x2010px;font-size:\x2010px;padding-bottom:\x2020px;}.divTotal{float:\x20right;\x20border-radius:\x205px;\x20border:\x202px\x20solid\x20lightgray;\x20padding:\x2010px;\x20margin-top:30px;}.itemTotal{width:\x20200px;\x20line-height:\x2030px;}.tabTotal{border-collapse:\x20collapse;}','','Phone','Fax','Email','P.IVA','Tax\x20code','C.F.','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Credit\x20note','Due\x20date','Scadenza','Articolo','Description','Sub\x20Total','Sconto','Imponibile','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Conto\x20intestato\x20a','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20','Italy','','\x20','issuerName','%s
','issuerStreet','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerFax','email','issuerEmail','piva','issuerPIVA','issuerFiscalCode','sdi','issuerSDICode','issuerSocCap','','','','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCountry','receivingFiscalCode','receivingSDICode','','','','updatedAt','DD/MM/YYYY','add','days','',':\x20%s','','','item','','description','hrsqty','unitprice','subtotal','netPrice','discount','quantity','%s','productName','productDescription','toFixed','\x20€','','','isNil','tax','receivingFiscalMessage','indexOf','split\x20payment','','','',' ','','replace','fromCharCode','','','sendpayment','','issuerBankAccount','accountholder','','bankname',':\x20','issuerBankName','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','cab','issuerABI','issuerCAB','bic','swif','issuerBankIBAN','issuerPayPal','paypal','','','thank2','paid','\x22\x20width=\x22180\x22>','
','','','toFile','log','TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName','sendStatus','addCloneDetail->>','ProformaId','cloneProforma','cloneProforma\x20req.params.id:','sequelize','transaction','result','cloneProforma\x20productsProforma:','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','TCL:\x20exports.cloneProforma\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','SAProforma','rawAttributes'];(function(_0x501679,_0x23c35c){var _0x187ebe=function(_0x25f3ae){while(--_0x25f3ae){_0x501679['push'](_0x501679['shift']());}};_0x187ebe(++_0x23c35c);}(_0x0565,0x1ca));var _0x5056=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x0565[_0x710815];return _0x5b3b89;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var Mustache=require(_0x5056('0x6'));var util=require('util');var path=require(_0x5056('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5056('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5056('0x9'));var crypto=require('crypto');var jsforce=require(_0x5056('0xa'));var deskjs=require(_0x5056('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5056('0xc'));var authService=require(_0x5056('0xd'));var qs=require(_0x5056('0xe'));var hardwareService=require(_0x5056('0xf'));var logger=require(_0x5056('0x10'))('api');var utils=require(_0x5056('0x11'));var config=require('../../config/environment');var db=require(_0x5056('0x12'))['db'];function respondWithStatusCode(_0x21fde8,_0x297355){_0x297355=_0x297355||0xcc;return function(_0x4540ac){if(_0x4540ac){return _0x21fde8['sendStatus'](_0x297355);}return _0x21fde8['status'](_0x297355)[_0x5056('0x13')]();};}function respondWithResult(_0x1861be,_0x1a901e){_0x1a901e=_0x1a901e||0xc8;return function(_0x3c48c6){if(_0x3c48c6){return _0x1861be[_0x5056('0x14')](_0x1a901e)[_0x5056('0x15')](_0x3c48c6);}};}function respondWithFilteredResult(_0x31e060,_0x2992aa){return function(_0x3beadb){if(_0x3beadb){var _0x1ed7fc=_0x3beadb[_0x5056('0x16')],_0xe8dd13=_0x2992aa[_0x5056('0x17')],_0x12e659=_0x2992aa[_0x5056('0x17')]+_0x2992aa['limit'],_0x14d5cf;if(_0x12e659>=_0x1ed7fc){_0x12e659=_0x1ed7fc;_0x14d5cf=0xc8;}else{_0x14d5cf=0xce;}_0x31e060['status'](_0x14d5cf);return _0x31e060[_0x5056('0x18')](_0x5056('0x19'),_0xe8dd13+'-'+_0x12e659+'/'+_0x1ed7fc)[_0x5056('0x15')](_0x3beadb);}return null;};}function patchUpdates(_0x39655a){return function(_0x279499){try{jsonpatch[_0x5056('0x1a')](_0x279499,_0x39655a,!![]);}catch(_0x147799){return BPromise[_0x5056('0x1b')](_0x147799);}return _0x279499[_0x5056('0x1c')]();};}function saveUpdates(_0xd6206f,_0x1c86d4){return function(_0x551a03){if(_0x551a03){return _0x551a03[_0x5056('0x1d')](_0xd6206f)['then'](function(_0x40d301){return _0x40d301;});}return null;};}function removeEntity(_0x183ed1,_0x7eab55){return function(_0x11a6ff){if(_0x11a6ff){return _0x11a6ff[_0x5056('0x1e')]()[_0x5056('0x1f')](function(){_0x183ed1[_0x5056('0x14')](0xcc)[_0x5056('0x13')]();});}};}function handleEntityNotFound(_0x1f900c,_0x2290e7){return function(_0x4bfa40){if(!_0x4bfa40){_0x1f900c['sendStatus'](0x194);}return _0x4bfa40;};}function handleError(_0x31c9b9,_0x37d3b0){_0x37d3b0=_0x37d3b0||0x1f4;return function(_0x1eadaf){logger[_0x5056('0x20')](_0x1eadaf[_0x5056('0x21')]);if(_0x1eadaf[_0x5056('0x22')]){delete _0x1eadaf['name'];}_0x31c9b9['status'](_0x37d3b0)['send'](_0x1eadaf);};}exports[_0x5056('0x23')]=function(_0x23ad8c,_0xcbe3b1){var _0x5ea698={},_0x212988={},_0x4916b1={'count':0x0,'rows':[]};var _0x53a7c9=db[_0x5056('0x24')][_0x5056('0x25')];_0x212988[_0x5056('0x26')]=_['keys'](_0x53a7c9);_0x212988['query']=_[_0x5056('0x27')](_0x23ad8c[_0x5056('0x28')]);_0x212988[_0x5056('0x29')]=_[_0x5056('0x2a')](_0x212988[_0x5056('0x26')],_0x212988[_0x5056('0x28')]);_0x5ea698[_0x5056('0x2b')]=_[_0x5056('0x2a')](_0x212988[_0x5056('0x26')],qs[_0x5056('0x2c')](_0x23ad8c['query']['fields']));_0x5ea698[_0x5056('0x2b')]=_0x5ea698[_0x5056('0x2b')]['length']?_0x5ea698['attributes']:_0x212988[_0x5056('0x26')];if(!_0x23ad8c['query'][_0x5056('0x2d')]('nolimit')){_0x5ea698['limit']=qs[_0x5056('0x2e')](_0x23ad8c[_0x5056('0x28')][_0x5056('0x2e')]);_0x5ea698['offset']=qs[_0x5056('0x17')](_0x23ad8c[_0x5056('0x28')][_0x5056('0x17')]);}_0x5ea698[_0x5056('0x2f')]=qs[_0x5056('0x30')](_0x23ad8c['query']['sort']);_0x5ea698[_0x5056('0x31')]=qs[_0x5056('0x29')](_[_0x5056('0x32')](_0x23ad8c[_0x5056('0x28')],_0x212988[_0x5056('0x29')]));if(_0x23ad8c[_0x5056('0x28')]['filter']){_0x5ea698[_0x5056('0x31')]=_['merge'](_0x5ea698[_0x5056('0x31')],{'$or':_[_0x5056('0x33')](_0x53a7c9,function(_0x25c969){if(_0x25c969[_0x5056('0x34')]['key']!==_0x5056('0x35')){var _0x3e8499={};_0x3e8499[_0x25c969['field']]={'$like':'%'+_0x23ad8c[_0x5056('0x28')][_0x5056('0x36')]+'%'};return _0x3e8499;}})});}_0x5ea698=_[_0x5056('0x37')]({},_0x5ea698,_0x23ad8c['options']);var _0x4280c9={'where':_0x5ea698[_0x5056('0x31')]};return db[_0x5056('0x24')][_0x5056('0x16')](_0x4280c9)[_0x5056('0x1f')](function(_0x1b31f2){_0x4916b1[_0x5056('0x16')]=_0x1b31f2;if(_0x23ad8c[_0x5056('0x28')][_0x5056('0x38')]){_0x5ea698[_0x5056('0x39')]=[{'all':!![]}];}return db[_0x5056('0x24')][_0x5056('0x3a')](_0x5ea698);})[_0x5056('0x1f')](function(_0x1c71fe){_0x4916b1[_0x5056('0x3b')]=_0x1c71fe;return _0x4916b1;})['then'](respondWithFilteredResult(_0xcbe3b1,_0x5ea698))[_0x5056('0x3c')](handleError(_0xcbe3b1,null));};exports[_0x5056('0x3d')]=function(_0x577d59,_0x11ae4e){var _0x118768={'raw':![],'where':{'id':_0x577d59[_0x5056('0x3e')]['id']}},_0xe8e7bb={};_0xe8e7bb['model']=_['keys'](db[_0x5056('0x24')][_0x5056('0x25')]);_0xe8e7bb[_0x5056('0x28')]=_[_0x5056('0x27')](_0x577d59[_0x5056('0x28')]);_0xe8e7bb[_0x5056('0x29')]=_[_0x5056('0x2a')](_0xe8e7bb[_0x5056('0x26')],_0xe8e7bb[_0x5056('0x28')]);_0x118768['attributes']=_['intersection'](_0xe8e7bb[_0x5056('0x26')],qs[_0x5056('0x2c')](_0x577d59[_0x5056('0x28')][_0x5056('0x2c')]));_0x118768[_0x5056('0x2b')]=_0x118768[_0x5056('0x2b')][_0x5056('0x3f')]?_0x118768[_0x5056('0x2b')]:_0xe8e7bb[_0x5056('0x26')];if(_0x577d59[_0x5056('0x28')][_0x5056('0x38')]){_0x118768['include']=[{'all':!![]}];}_0x118768=_[_0x5056('0x37')]({},_0x118768,_0x577d59['options']);return db[_0x5056('0x24')][_0x5056('0x40')](_0x118768)[_0x5056('0x1f')](handleEntityNotFound(_0x11ae4e,null))[_0x5056('0x1f')](respondWithResult(_0x11ae4e,null))['catch'](handleError(_0x11ae4e,null));};exports[_0x5056('0x41')]=function(_0x2640a9,_0x5ead90){return db[_0x5056('0x24')]['create'](_0x2640a9[_0x5056('0x42')],{})[_0x5056('0x1f')](respondWithResult(_0x5ead90,0xc9))[_0x5056('0x3c')](handleError(_0x5ead90,null));};exports[_0x5056('0x1d')]=function(_0x3cf1ba,_0x357723){if(_0x3cf1ba['body']['id']){delete _0x3cf1ba[_0x5056('0x42')]['id'];}return db[_0x5056('0x24')][_0x5056('0x40')]({'where':{'id':_0x3cf1ba[_0x5056('0x3e')]['id']}})[_0x5056('0x1f')](handleEntityNotFound(_0x357723,null))[_0x5056('0x1f')](saveUpdates(_0x3cf1ba[_0x5056('0x42')],null))[_0x5056('0x1f')](respondWithResult(_0x357723,null))[_0x5056('0x3c')](handleError(_0x357723,null));};exports[_0x5056('0x1e')]=function(_0x3f58c9,_0x484194){return db[_0x5056('0x24')][_0x5056('0x40')]({'where':{'id':_0x3f58c9[_0x5056('0x3e')]['id']}})[_0x5056('0x1f')](handleEntityNotFound(_0x484194,null))[_0x5056('0x1f')](removeEntity(_0x484194,null))['catch'](handleError(_0x484194,null));};exports['describe']=function(_0x3c354b,_0x5b86fe){return db[_0x5056('0x24')][_0x5056('0x43')]()[_0x5056('0x1f')](respondWithResult(_0x5b86fe,null))['catch'](handleError(_0x5b86fe,null));};exports[_0x5056('0x44')]=function(_0x24cef3,_0x91ed9c){var _0x407445=moment()[_0x5056('0x45')]()['toString']();var _0x3ede3e=path[_0x5056('0x46')](config['root'],'server','files','tmp');var _0x1dd842=path[_0x5056('0x46')](config[_0x5056('0x47')],_0x5056('0x48'),_0x5056('0x49'),_0x5056('0x4a'),_0x5056('0x4b'),'logo-invoice.png');var _0x38c2ee=path[_0x5056('0x46')](config[_0x5056('0x47')],_0x5056('0x48'),_0x5056('0x49'),_0x5056('0x4a'),'logos',_0x5056('0x4c'));var _0x1ea0ed=path[_0x5056('0x46')](_0x3ede3e,_0x407445);var _0xcb2888=util[_0x5056('0x4d')]('Proforma_%s-%s.pdf',_0x24cef3['params']['id'],_0x407445);var _0x4a134d=path[_0x5056('0x46')](_0x1ea0ed,_0xcb2888);var _0x5d41bb=![];var _0x523a2e={};return db['SAProforma'][_0x5056('0x40')]({'where':{'id':_0x24cef3[_0x5056('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x91ed9c,null))[_0x5056('0x1f')](function(_0x1aced7){if(_0x1aced7){_0x523a2e[_0x5056('0x4e')]=_0x1aced7;return db[_0x5056('0x4f')][_0x5056('0x3a')]({'where':{'ProformaId':_0x1aced7['id']},'raw':!![]})[_0x5056('0x1f')](function(_0xf0e514){_0x523a2e[_0x5056('0x50')]=_0xf0e514;_0x5d41bb=!![];var _0x48ce0b='';var _0x58339d={'format':'A4','orientation':_0x5056('0x51'),'border':_0x5056('0x52'),'footer':{'height':_0x5056('0x53'),'contents':{'default':_0x5056('0x54')}}};_0x58339d[_0x5056('0x55')][_0x5056('0x56')]['default']=_0x58339d[_0x5056('0x55')]['contents'][_0x5056('0x57')]+''+_0x523a2e['proforma'][_0x5056('0x58')]+'';fs[_0x5056('0x59')](_0x1ea0ed);_0x48ce0b=_0x5056('0x5a');_0x48ce0b+=_0x5056('0x5b');_0x48ce0b+=_0x5056('0x5c');var _0x2be79f={'phone':{'en':_0x5056('0x5d'),'it':'Telefono'},'fax':{'en':_0x5056('0x5e'),'it':'Fax'},'email':{'en':_0x5056('0x5f'),'it':_0x5056('0x5f')},'piva':{'en':'VAT\x20number','it':_0x5056('0x60')},'cf':{'en':_0x5056('0x61'),'it':_0x5056('0x62')},'sdi':{'en':'I.S.\x20code','it':_0x5056('0x63')},'cs':{'en':_0x5056('0x64'),'it':_0x5056('0x65')},'invoice':{'en':_0x5056('0x66'),'it':_0x5056('0x67')},'proforma':{'en':_0x5056('0x68'),'it':_0x5056('0x68')},'creditnote':{'en':_0x5056('0x69'),'it':'Nota\x20di\x20credito'},'duedate':{'en':_0x5056('0x6a'),'it':_0x5056('0x6b')},'item':{'en':'Item','it':_0x5056('0x6c')},'description':{'en':_0x5056('0x6d'),'it':'Descrizione'},'hrsqty':{'en':'Hrs/Qty','it':'Ore/Qta'},'unitprice':{'en':'Unit\x20Price','it':'Prezzo\x20Unitario'},'subtotal':{'en':_0x5056('0x6e'),'it':'Sub\x20Totale'},'discount':{'en':'Discount','it':_0x5056('0x6f')},'total':{'en':'Subtotal','it':_0x5056('0x70')},'tax':{'en':'Tax','it':_0x5056('0x71')},'nettopay':{'en':_0x5056('0x72'),'it':_0x5056('0x73')},'sendpayment':{'en':_0x5056('0x74'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':'Account\x20Holder','it':_0x5056('0x75')},'bankname':{'en':'Bank\x20name','it':_0x5056('0x76')},'bankaddress':{'en':_0x5056('0x77'),'it':_0x5056('0x78')},'abi':{'en':_0x5056('0x79'),'it':'ABI'},'cab':{'en':_0x5056('0x7a'),'it':_0x5056('0x7a')},'bic':{'en':_0x5056('0x7b'),'it':_0x5056('0x7b')},'swif':{'en':_0x5056('0x7c'),'it':_0x5056('0x7c')},'iban':{'en':_0x5056('0x7d'),'it':_0x5056('0x7d')},'paypal':{'en':_0x5056('0x7e'),'it':_0x5056('0x7f')},'thank1':{'en':_0x5056('0x80'),'it':_0x5056('0x81')},'thank2':{'en':',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','it':'\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.'}};var _0x10d575='it';if(_0x523a2e[_0x5056('0x4e')]['receivingCountry']!==_0x5056('0x82')){_0x10d575='en';}_0x48ce0b+=_0x5056('0x83');_0x48ce0b+=_0x5056('0x84')+_0x1dd842+'\x22\x20width=\x22180\x22>';_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=util[_0x5056('0x4d')]('\x20%s
',_0x523a2e['proforma'][_0x5056('0x86')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0x87'),_0x523a2e['proforma'][_0x5056('0x88')]);_0x48ce0b+=util[_0x5056('0x4d')]('%s',_0x523a2e[_0x5056('0x4e')]['issuerPostalCode']);_0x48ce0b+=util[_0x5056('0x4d')]('\x20%s',_0x523a2e['proforma'][_0x5056('0x89')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0x8a'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x8b')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f[_0x5056('0x8c')][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')]['issuerPhone']);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f['fax'][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x8e')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f[_0x5056('0x8f')][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x90')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f[_0x5056('0x91')][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x92')]);_0x48ce0b+=util['format'](_0x2be79f['cf'][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x93')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f[_0x5056('0x94')][_0x10d575]+_0x5056('0x8d'),_0x523a2e['proforma'][_0x5056('0x95')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f['cs'][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x96')]);_0x48ce0b+=_0x5056('0x97');_0x48ce0b+=_0x5056('0x98');_0x48ce0b+=_0x5056('0x99');_0x48ce0b+=util[_0x5056('0x4d')]('%s',_0x523a2e[_0x5056('0x4e')][_0x5056('0x9a')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0x87'),_0x523a2e['proforma'][_0x5056('0x9b')]);_0x48ce0b+=util['format'](_0x5056('0x9c'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x9d')]);_0x48ce0b+=util[_0x5056('0x4d')]('%s
',_0x523a2e[_0x5056('0x4e')]['receivingCity']);_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0x87'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x9e')]);_0x48ce0b+=util[_0x5056('0x4d')](''+_0x2be79f['cf'][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')][_0x5056('0x9f')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f['piva'][_0x10d575]+_0x5056('0x8d'),_0x523a2e[_0x5056('0x4e')]['receivingPIVA']);_0x48ce0b+=util[_0x5056('0x4d')](_0x2be79f[_0x5056('0x94')][_0x10d575]+':\x20%s
',_0x523a2e[_0x5056('0x4e')][_0x5056('0xa0')]);_0x48ce0b+=_0x5056('0xa1');_0x48ce0b+=_0x5056('0xa2');_0x48ce0b+='';_0x48ce0b+=_0x5056('0xa3');_0x48ce0b+=util[_0x5056('0x4d')](''+_0x2be79f[_0x5056('0x4e')][_0x10d575]+'\x20N.%d',_0x1aced7['id']);_0x48ce0b+=util['format']('%s,\x20',_0x523a2e[_0x5056('0x4e')][_0x5056('0x89')]);var _0x41d952=moment(_0x523a2e[_0x5056('0x4e')][_0x5056('0xa4')])[_0x5056('0x4d')](_0x5056('0xa5'));_0x48ce0b+=util[_0x5056('0x4d')]('%s\x20',_0x41d952);var _0x4e65af=moment(_0x523a2e[_0x5056('0x4e')][_0x5056('0xa4')])[_0x5056('0xa6')](_0x523a2e['proforma']['saExpiryDay'],_0x5056('0xa7'))['format'](_0x5056('0xa5'));_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0xa8')+_0x2be79f['duedate'][_0x10d575]+_0x5056('0xa9'),_0x4e65af);_0x48ce0b+=_0x5056('0xa2');_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=_0x5056('0xa3');_0x48ce0b+=_0x5056('0xaa');_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=_0x5056('0xab')+_0x2be79f[_0x5056('0xac')][_0x10d575]+_0x5056('0xad');_0x48ce0b+=_0x5056('0xab')+_0x2be79f[_0x5056('0xae')][_0x10d575]+'';_0x48ce0b+=_0x5056('0xab')+_0x2be79f[_0x5056('0xaf')][_0x10d575]+_0x5056('0xad');_0x48ce0b+=''+_0x2be79f[_0x5056('0xb0')][_0x10d575]+_0x5056('0xad');_0x48ce0b+=_0x5056('0xab')+_0x2be79f[_0x5056('0xb1')][_0x10d575]+_0x5056('0xad');_0x48ce0b+=_0x5056('0xa2');var _0x5778ec=0x0;var _0x2e4bd5=0x0;for(var _0x3bd58d=0x0;_0x3bd58d<_0x523a2e['details'][_0x5056('0x3f')];_0x3bd58d++){var _0x39ee2e=0x0;var _0x2c902e=0x0;var _0x383ccd=0x0;var _0x18c6d6=0x0;_0x39ee2e=_0x523a2e[_0x5056('0x50')][_0x3bd58d]['netPrice']-_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb2')]/0x64*_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb3')];_0x2c902e=_0x39ee2e/0x64*_0x523a2e[_0x5056('0x50')][_0x3bd58d]['tax'];_0x383ccd=_0x39ee2e*_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb4')];_0x18c6d6=_0x2c902e*_0x523a2e['details'][_0x3bd58d]['quantity'];_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0xb5'),_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb6')]);_0x48ce0b+=util[_0x5056('0x4d')](_0x5056('0xb5'),_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb7')]);_0x48ce0b+=util[_0x5056('0x4d')]('%d',_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb4')]);_0x48ce0b+=''+_0x39ee2e[_0x5056('0xb8')](0x2)+_0x5056('0xb9');_0x48ce0b+=_0x5056('0xba')+_0x383ccd['toFixed'](0x2)+'\x20€';_0x48ce0b+=_0x5056('0xa2');_0x5778ec+=_0x383ccd;_0x2e4bd5+=_0x18c6d6;}_0x48ce0b+=_0x5056('0xbb');if(!_[_0x5056('0xbc')](_0x523a2e[_0x5056('0x4e')][_0x5056('0xb3')])){var _0x57211a=0x0;var _0x4ede36=0x0;var _0x4a74b0=_0x523a2e[_0x5056('0x4e')]['discount']*0x64/_0x5778ec;for(var _0x3bd58d=0x0;_0x3bd58d<_0x523a2e[_0x5056('0x50')][_0x5056('0x3f')];_0x3bd58d++){var _0x45e67d=0x0;var _0x2c119b=0x0;var _0x306ee5=0x0;_0x39ee2e=_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb2')]-_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb2')]/0x64*_0x523a2e['details'][_0x3bd58d][_0x5056('0xb3')];_0x45e67d=_0x39ee2e/0x64*_0x4a74b0;_0x2c119b=_0x39ee2e-_0x45e67d;_0x306ee5=_0x2c119b*_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xb4')];_0x57211a+=_0x306ee5;_0x4ede36+=_0x306ee5/0x64*_0x523a2e[_0x5056('0x50')][_0x3bd58d][_0x5056('0xbd')];}}var _0x386d26=0x0;var _0x19ed75=0x0;var _0x2fa82c=![];var _0x159c87=_0x523a2e[_0x5056('0x4e')][_0x5056('0xbe')];if(_0x159c87[_0x5056('0xbf')](_0x5056('0xc0'))!=-0x1){_0x2fa82c=!![];}if(!_[_0x5056('0xbc')](_0x523a2e[_0x5056('0x4e')][_0x5056('0xb3')])){_0x48ce0b+=_0x5056('0x85');if(_0x523a2e['proforma'][_0x5056('0xb3')]>0x0){_0x48ce0b+=_0x5056('0xc1')+_0x2be79f[_0x5056('0xb3')][_0x10d575]+'';_0x48ce0b+=''+_0x523a2e[_0x5056('0x4e')][_0x5056('0xb3')][_0x5056('0xb8')](0x2)+_0x5056('0xb9');}_0x48ce0b+=_0x5056('0xa2');_0x386d26=_0x4ede36;_0x19ed75=_0x57211a;}else{_0x386d26=_0x2e4bd5;_0x19ed75=_0x5778ec;}if(_0x386d26>0x0||_0x523a2e[_0x5056('0x4e')][_0x5056('0xb3')]>0x0){_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=_0x5056('0xc2')+_0x2be79f['total'][_0x10d575]+_0x5056('0x97');_0x48ce0b+=_0x5056('0xba')+_0x19ed75[_0x5056('0xb8')](0x2)+'\x20€';_0x48ce0b+=_0x5056('0xa2');}if(_0x386d26>0x0){_0x48ce0b+=_0x5056('0x85');_0x48ce0b+=''+_0x2be79f[_0x5056('0xbd')][_0x10d575]+'';_0x48ce0b+=_0x5056('0xba')+_0x386d26[_0x5056('0xb8')](0x2)+'\x20€';_0x48ce0b+=_0x5056('0xa2');}_0x48ce0b+=_0x5056('0x85');var _0x3c4824;if(_0x2fa82c){_0x3c4824=_0x19ed75;}else{_0x3c4824=_0x19ed75+_0x386d26;}_0x48ce0b+=''+_0x2be79f['nettopay'][_0x10d575]+_0x5056('0xc3')+_0x3c4824['toFixed'](0x2)+'\x20€';_0x48ce0b+='\x20';_0x48ce0b+=_0x5056('0xa2');_0x48ce0b+=_0x5056('0xc4');_0x48ce0b+=_0x5056('0xc5');_0x48ce0b+='';_0x48ce0b+=util[_0x5056('0x4d')]('\x20%s\x20',_0x523a2e[_0x5056('0x4e')][_0x5056('0xbe')][_0x5056('0xc6')](new RegExp(String[_0x5056('0xc7')](0xd),'g'),_0x5056('0xc8')));_0x48ce0b+=_0x5056('0xa2');_0x48ce0b+='';_0x48ce0b+='';_0x48ce0b+=_0x5056('0xc9')+_0x2be79f[_0x5056('0xca')][_0x10d575]+_0x5056('0xcb');if(!_[_0x5056('0xbc')](_0x523a2e[_0x5056('0x4e')][_0x5056('0xcc')])){_0x48ce0b+=''+_0x2be79f[_0x5056('0xcd')][_0x10d575]+':\x20'+_0x523a2e['proforma'][_0x5056('0xcc')]+_0x5056('0xce');_0x48ce0b+=''+_0x2be79f[_0x5056('0xcf')][_0x10d575]+_0x5056('0xd0')+_0x523a2e[_0x5056('0x4e')][_0x5056('0xd1')]+'\x20';_0x48ce0b+=_0x5056('0xc9')+_0x2be79f[_0x5056('0xd2')][_0x10d575]+_0x5056('0xd0')+_0x523a2e[_0x5056('0x4e')][_0x5056('0xd3')]+',\x20'+_0x523a2e[_0x5056('0x4e')][_0x5056('0xd4')]+_0x5056('0xd5')+_0x523a2e[_0x5056('0x4e')][_0x5056('0xd6')]+'\x20('+_0x523a2e['proforma'][_0x5056('0xd7')]+')'+_0x5056('0xce');_0x48ce0b+=_0x5056('0xc9')+_0x2be79f['abi'][_0x10d575]+'/'+_0x2be79f[_0x5056('0xd8')][_0x10d575]+_0x5056('0xd0')+_0x523a2e[_0x5056('0x4e')][_0x5056('0xd9')]+'/'+_0x523a2e['proforma'][_0x5056('0xda')]+_0x5056('0xce');_0x48ce0b+=_0x5056('0xc9')+_0x2be79f[_0x5056('0xdb')][_0x10d575]+'/'+_0x2be79f[_0x5056('0xdc')][_0x10d575]+_0x5056('0xd0')+_0x523a2e[_0x5056('0x4e')]['issuerBankBICSWIFT']+_0x5056('0xce');_0x48ce0b+=_0x5056('0xc9')+_0x2be79f['iban'][_0x10d575]+':\x20'+_0x523a2e['proforma'][_0x5056('0xdd')]+_0x5056('0xce');}if(!_[_0x5056('0xbc')](_0x523a2e[_0x5056('0x4e')][_0x5056('0xde')])){_0x48ce0b+=''+_0x2be79f[_0x5056('0xdf')][_0x10d575]+_0x5056('0xd0')+_0x523a2e['proforma'][_0x5056('0xde')]+'';}_0x48ce0b+=_0x5056('0xc9')+_0x2be79f['thank1'][_0x10d575]+_0x5056('0xe0')+_0x4e65af+_0x5056('0xe1')+_0x2be79f[_0x5056('0xe2')][_0x10d575]+'';_0x48ce0b+='';_0x48ce0b+=_0x5056('0xa2');if(_0x523a2e[_0x5056('0x4e')][_0x5056('0xe3')]===0x1){_0x48ce0b+=_0x5056('0x84')+_0x38c2ee+_0x5056('0xe4');}_0x48ce0b+=_0x5056('0xe5');_0x48ce0b+=_0x5056('0xe6');_0x48ce0b+=_0x5056('0xe7');return new BPromise(function(_0x277913,_0x193d4d){pdf['create'](_0x48ce0b,_0x58339d)[_0x5056('0xe8')](path[_0x5056('0x46')](_0x1ea0ed,_0xcb2888),function(_0x2637ee,_0x594a05){if(_0x2637ee)return _0x193d4d(_0x2637ee);_0x277913(_0x594a05);});});});}})[_0x5056('0x1f')](function(){if(_0x5d41bb){console[_0x5056('0xe9')](_0x5056('0xea'),_0x4a134d,_0xcb2888);return _0x91ed9c['download'](_0x4a134d,_0xcb2888,function(_0x5e75d0){if(_0x5e75d0){console[_0x5056('0xe9')]('err',_0x5e75d0);}else{console[_0x5056('0xe9')]('foldername',_0x1ea0ed);rimraf(_0x1ea0ed,function(){});}});}else{return _0x91ed9c[_0x5056('0xeb')](0xc8);}})[_0x5056('0x3c')](handleError(_0x91ed9c,null));};function addCloneDetail(_0x759ddc,_0x1b0138,_0x41ffd0){console[_0x5056('0xe9')](_0x5056('0xec'),_0x759ddc);_0x759ddc[_0x5056('0xed')]=_0x1b0138;delete _0x759ddc['id'];return db['SAProformaDetail'][_0x5056('0x41')](_0x759ddc,{'transaction':_0x41ffd0});}exports[_0x5056('0xee')]=function(_0x3cf1fa,_0x2143eb,_0x3edd02){var _0x217989;if(_0x3cf1fa['body']['id']){delete _0x3cf1fa[_0x5056('0x42')]['id'];}console['log'](_0x5056('0xef'),_0x3cf1fa['params']['id']);return db[_0x5056('0xf0')][_0x5056('0xf1')](function(_0x28764a){return db[_0x5056('0x24')][_0x5056('0x41')](_0x3cf1fa[_0x5056('0x42')],{'transaction':_0x28764a,'logging':console[_0x5056('0xe9')]})[_0x5056('0x1f')](function(_0x23bf06){console['log'](_0x5056('0xf2'),_0x23bf06);_0x217989=_0x23bf06;var _0x590499=_0x3cf1fa[_0x5056('0x3e')]['id'];return db['SAProformaDetail'][_0x5056('0x3a')]({'where':{'ProformaId':_0x590499},'raw':!![]});})[_0x5056('0x1f')](function(_0x518c99){console[_0x5056('0xe9')](_0x5056('0xf3'),_0x518c99);if(_0x518c99[_0x5056('0x3f')]>0x0){var _0x2f5842=[];for(var _0x5976da=0x0;_0x5976da<_0x518c99[_0x5056('0x3f')];_0x5976da++){_0x2f5842['push'](addCloneDetail(_0x518c99[_0x5976da],_0x217989['id'],_0x28764a));}return BPromise['all'](_0x2f5842);}else{var _0x1622a7={'errors':[{'type':'WARNING','message':_0x5056('0xf4')}]};throw _0x1622a7;}});})[_0x5056('0x1f')](function(){return _0x2143eb[_0x5056('0xeb')](0xc8);})['catch'](function(_0x305770){console[_0x5056('0xe9')](_0x5056('0xf5'),_0x305770);if(_0x305770['name']===_0x5056('0xf6')){var _0x305770={'errors':[{'message':_0x5056('0xf7')}]};}_0x2143eb['status'](0x1f4)['send'](_0x305770);});}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.model.js b/server/api/saProforma/saProforma.model.js index d5220aa..9830746 100644 --- a/server/api/saProforma/saProforma.model.js +++ b/server/api/saProforma/saProforma.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x692e=['request-promise','rimraf','../../config/environment','exports','define','SAProforma','lodash','../../config/logger','moment'];(function(_0x1261ad,_0x616968){var _0x5ac02c=function(_0x241e37){while(--_0x241e37){_0x1261ad['push'](_0x1261ad['shift']());}};_0x5ac02c(++_0x616968);}(_0x692e,0x96));var _0xe692=function(_0x16bff0,_0x3a777a){_0x16bff0=_0x16bff0-0x0;var _0x378812=_0x692e[_0x16bff0];return _0x378812;};'use strict';var _=require(_0xe692('0x0'));var util=require('util');var logger=require(_0xe692('0x1'))('api');var moment=require(_0xe692('0x2'));var BPromise=require('bluebird');var rp=require(_0xe692('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe692('0x4'));var config=require(_0xe692('0x5'));var attributes=require('./saProforma.attributes');module[_0xe692('0x6')]=function(_0x40399e,_0x29cd91){return _0x40399e[_0xe692('0x7')](_0xe692('0x8'),attributes,{'tableName':'sa_proformas','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f07=['bluebird','request-promise','path','rimraf','../../config/environment','./saProforma.attributes','exports','define','SAProforma','sa_proformas','lodash','util','../../config/logger','api','moment'];(function(_0x568b1f,_0x15b484){var _0x4f4c59=function(_0x559279){while(--_0x559279){_0x568b1f['push'](_0x568b1f['shift']());}};_0x4f4c59(++_0x15b484);}(_0x9f07,0x64));var _0x79f0=function(_0x2add3c,_0x891236){_0x2add3c=_0x2add3c-0x0;var _0x259ece=_0x9f07[_0x2add3c];return _0x259ece;};'use strict';var _=require(_0x79f0('0x0'));var util=require(_0x79f0('0x1'));var logger=require(_0x79f0('0x2'))(_0x79f0('0x3'));var moment=require(_0x79f0('0x4'));var BPromise=require(_0x79f0('0x5'));var rp=require(_0x79f0('0x6'));var fs=require('fs');var path=require(_0x79f0('0x7'));var rimraf=require(_0x79f0('0x8'));var config=require(_0x79f0('0x9'));var attributes=require(_0x79f0('0xa'));module[_0x79f0('0xb')]=function(_0x4ba9de,_0xae2858){return _0x4ba9de[_0x79f0('0xc')](_0x79f0('0xd'),attributes,{'tableName':_0x79f0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.rpc.js b/server/api/saProforma/saProforma.rpc.js index 795684e..a2e55b6 100644 --- a/server/api/saProforma/saProforma.rpc.js +++ b/server/api/saProforma/saProforma.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a1f=['SAProforma,\x20%s,\x20%s','request\x20sent','SAProforma,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0x9a1f,0x183));var _0xf9a1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x9a1f[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xf9a1('0x0'));var util=require(_0xf9a1('0x1'));var moment=require('moment');var BPromise=require(_0xf9a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9a1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9a1('0x4'));var logger=require(_0xf9a1('0x5'))(_0xf9a1('0x6'));var config=require(_0xf9a1('0x7'));var jayson=require(_0xf9a1('0x8'));var client=jayson[_0xf9a1('0x9')][_0xf9a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34a51f,_0x340ea9,_0x2c5d51){return new BPromise(function(_0x3af871,_0x219b39){return client[_0xf9a1('0xb')](_0x34a51f,_0x2c5d51)['then'](function(_0x3c5cca){logger[_0xf9a1('0xc')](_0xf9a1('0xd'),_0x340ea9,_0xf9a1('0xe'));logger['debug'](_0xf9a1('0xf'),_0x340ea9,_0xf9a1('0xe'),JSON[_0xf9a1('0x10')](_0x3c5cca));if(_0x3c5cca[_0xf9a1('0x11')]){if(_0x3c5cca[_0xf9a1('0x11')][_0xf9a1('0x12')]===0x1f4){logger[_0xf9a1('0x11')](_0xf9a1('0xd'),_0x340ea9,_0x3c5cca[_0xf9a1('0x11')][_0xf9a1('0x13')]);return _0x219b39(_0x3c5cca[_0xf9a1('0x11')][_0xf9a1('0x13')]);}logger[_0xf9a1('0x11')]('SAProforma,\x20%s,\x20%s',_0x340ea9,_0x3c5cca[_0xf9a1('0x11')][_0xf9a1('0x13')]);return _0x3af871(_0x3c5cca['error'][_0xf9a1('0x13')]);}else{logger[_0xf9a1('0xc')](_0xf9a1('0xd'),_0x340ea9,_0xf9a1('0xe'));_0x3af871(_0x3c5cca['result'][_0xf9a1('0x13')]);}})['catch'](function(_0x5f3342){logger['error'](_0xf9a1('0xd'),_0x340ea9,_0x5f3342);_0x219b39(_0x5f3342);});});} \ No newline at end of file +var _0x73bf=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SAProforma,\x20%s,\x20%s','request\x20sent','debug','SAProforma,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util'];(function(_0x1945a5,_0x50de54){var _0x5817a5=function(_0x2a5a93){while(--_0x2a5a93){_0x1945a5['push'](_0x1945a5['shift']());}};_0x5817a5(++_0x50de54);}(_0x73bf,0xb2));var _0xf73b=function(_0x27fab1,_0x3e9b9e){_0x27fab1=_0x27fab1-0x0;var _0x20093a=_0x73bf[_0x27fab1];return _0x20093a;};'use strict';var _=require(_0xf73b('0x0'));var util=require(_0xf73b('0x1'));var moment=require(_0xf73b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf73b('0x3'))['db'];var utils=require(_0xf73b('0x4'));var logger=require(_0xf73b('0x5'))(_0xf73b('0x6'));var config=require(_0xf73b('0x7'));var jayson=require(_0xf73b('0x8'));var client=jayson[_0xf73b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b240e,_0x4dc5d2,_0x4e5a3b){return new BPromise(function(_0x3d9e38,_0x4065fe){return client[_0xf73b('0xa')](_0x2b240e,_0x4e5a3b)[_0xf73b('0xb')](function(_0x490fb9){logger[_0xf73b('0xc')](_0xf73b('0xd'),_0x4dc5d2,_0xf73b('0xe'));logger[_0xf73b('0xf')](_0xf73b('0x10'),_0x4dc5d2,_0xf73b('0xe'),JSON['stringify'](_0x490fb9));if(_0x490fb9[_0xf73b('0x11')]){if(_0x490fb9['error'][_0xf73b('0x12')]===0x1f4){logger[_0xf73b('0x11')]('SAProforma,\x20%s,\x20%s',_0x4dc5d2,_0x490fb9[_0xf73b('0x11')][_0xf73b('0x13')]);return _0x4065fe(_0x490fb9[_0xf73b('0x11')][_0xf73b('0x13')]);}logger[_0xf73b('0x11')](_0xf73b('0xd'),_0x4dc5d2,_0x490fb9[_0xf73b('0x11')]['message']);return _0x3d9e38(_0x490fb9[_0xf73b('0x11')]['message']);}else{logger['info'](_0xf73b('0xd'),_0x4dc5d2,_0xf73b('0xe'));_0x3d9e38(_0x490fb9['result'][_0xf73b('0x13')]);}})['catch'](function(_0x62f1ae){logger[_0xf73b('0x11')]('SAProforma,\x20%s,\x20%s',_0x4dc5d2,_0x62f1ae);_0x4065fe(_0x62f1ae);});});} \ No newline at end of file diff --git a/server/api/saProformaDetail/index.js b/server/api/saProformaDetail/index.js index b4b7c42..e6d81f0 100644 --- a/server/api/saProformaDetail/index.js +++ b/server/api/saProformaDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProformaDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','automaticProformaInvoice'];(function(_0x44471c,_0x193efc){var _0x350549=function(_0x1ee9c2){while(--_0x1ee9c2){_0x44471c['push'](_0x44471c['shift']());}};_0x350549(++_0x193efc);}(_0xb10b,0x12a));var _0xbb10=function(_0x389a03,_0x380e6c){_0x389a03=_0x389a03-0x0;var _0xaf19ea=_0xb10b[_0x389a03];return _0xaf19ea;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['post']('/:id/automaticProformaInvoice',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['update']);router[_0xbb10('0x12')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x13')]);module[_0xbb10('0x14')]=router; \ No newline at end of file +var _0xb10b=['put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProformaDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','automaticProformaInvoice'];(function(_0x334151,_0x18269f){var _0x2717d3=function(_0x73eb80){while(--_0x73eb80){_0x334151['push'](_0x334151['shift']());}};_0x2717d3(++_0x18269f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bd6da,_0x3f7ac8){_0x5bd6da=_0x5bd6da-0x0;var _0x5e6b8=_0xb10b[_0x5bd6da];return _0x5e6b8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['post']('/:id/automaticProformaInvoice',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['update']);router[_0xbb10('0x12')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x13')]);module[_0xbb10('0x14')]=router; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.attributes.js b/server/api/saProformaDetail/saProformaDetail.attributes.js index 27c7c5b..0fe91f7 100644 --- a/server/api/saProformaDetail/saProformaDetail.attributes.js +++ b/server/api/saProformaDetail/saProformaDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cfe=['STRING','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','DECIMAL','sequelize','exports'];(function(_0x4bb2b1,_0x37e6f1){var _0x5c3081=function(_0x639e99){while(--_0x639e99){_0x4bb2b1['push'](_0x4bb2b1['shift']());}};_0x5c3081(++_0x37e6f1);}(_0x8cfe,0x6e));var _0xe8cf=function(_0x39aa30,_0x12dec8){_0x39aa30=_0x39aa30-0x0;var _0x1b1fa6=_0x8cfe[_0x39aa30];return _0x1b1fa6;};'use strict';var Sequelize=require(_0xe8cf('0x0'));module[_0xe8cf('0x1')]={'companyName':{'type':Sequelize[_0xe8cf('0x2')],'allowNull':![]},'companyId':{'type':Sequelize['INTEGER'],'allowNull':![]},'productName':{'type':Sequelize[_0xe8cf('0x3')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize[_0xe8cf('0x3')](_0xe8cf('0x4'))+_0xe8cf('0x5')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0xe8cf('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize[_0xe8cf('0x6')],'allowNull':![]},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xe8cf('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0xe8cf('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xe8cf('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0xe8cf('0x3')]},'subscriptionId':{'type':Sequelize[_0xe8cf('0x6')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0xe8cf('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0xe8cf('0x6')],'allowNull':![]},'quantity':{'type':Sequelize[_0xe8cf('0x6')],'allowNull':![]},'ProductQuotationId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3853=['DECIMAL','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x3853,0xfd));var _0x3385=function(_0x27154b,_0x5ac79d){_0x27154b=_0x27154b-0x0;var _0x41be5c=_0x3853[_0x27154b];return _0x41be5c;};'use strict';var Sequelize=require(_0x3385('0x0'));module[_0x3385('0x1')]={'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x3385('0x2')],'allowNull':![]},'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT']('long')+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'typeName':{'type':Sequelize[_0x3385('0x3')],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x3385('0x4')],'allowNull':![]},'priceListId':{'type':Sequelize[_0x3385('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x3385('0x5')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x3385('0x5')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x3385('0x3')],'allowNull':![]},'note':{'type':Sequelize[_0x3385('0x4')]},'subscriptionId':{'type':Sequelize[_0x3385('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x3385('0x3')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x3385('0x2')],'allowNull':![]},'quantity':{'type':Sequelize[_0x3385('0x2')],'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x3385('0x2')]}}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.controller.js b/server/api/saProformaDetail/saProformaDetail.controller.js index 1d6912c..f8c7281 100644 --- a/server/api/saProformaDetail/saProformaDetail.controller.js +++ b/server/api/saProformaDetail/saProformaDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa731=['merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','update','body','describe','log','addProformaInvoiceDetail->>','companyName','productCode','productDescription','typeName','priceListId','discount','tax','agentFullname','note','subscriptionId','subscriptionName','subscriptionMonthly','quantity','SAInvoiceDetail','ProformaId','SAInvoice','push','all','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','html-pdf','eml-format','rimraf','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','then','error','stack','name','index','SAProformaDetail','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where'];(function(_0x4a5972,_0x22541e){var _0x49a63c=function(_0x4e1d39){while(--_0x4e1d39){_0x4a5972['push'](_0x4a5972['shift']());}};_0x49a63c(++_0x22541e);}(_0xa731,0x1b2));var _0x1a73=function(_0x38f851,_0x47b388){_0x38f851=_0x38f851-0x0;var _0x15d58a=_0xa731[_0x38f851];return _0x15d58a;};'use strict';var pdf=require(_0x1a73('0x0'));var emlformat=require(_0x1a73('0x1'));var rimraf=require(_0x1a73('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1a73('0x3'));var BPromise=require(_0x1a73('0x4'));var Mustache=require('mustache');var util=require(_0x1a73('0x5'));var path=require(_0x1a73('0x6'));var sox=require('sox');var csv=require(_0x1a73('0x7'));var ejs=require(_0x1a73('0x8'));var fs=require('fs');var _=require(_0x1a73('0x9'));var squel=require(_0x1a73('0xa'));var crypto=require('crypto');var jsforce=require(_0x1a73('0xb'));var deskjs=require(_0x1a73('0xc'));var toCsv=require(_0x1a73('0x7'));var querystring=require(_0x1a73('0xd'));var Papa=require(_0x1a73('0xe'));var Redis=require(_0x1a73('0xf'));var authService=require(_0x1a73('0x10'));var qs=require(_0x1a73('0x11'));var hardwareService=require(_0x1a73('0x12'));var logger=require(_0x1a73('0x13'))(_0x1a73('0x14'));var utils=require(_0x1a73('0x15'));var config=require(_0x1a73('0x16'));var db=require(_0x1a73('0x17'))['db'];function respondWithStatusCode(_0x24feeb,_0x38e94b){_0x38e94b=_0x38e94b||0xcc;return function(_0x13e808){if(_0x13e808){return _0x24feeb[_0x1a73('0x18')](_0x38e94b);}return _0x24feeb['status'](_0x38e94b)[_0x1a73('0x19')]();};}function respondWithResult(_0x8156d5,_0x396acf){_0x396acf=_0x396acf||0xc8;return function(_0x3895a7){if(_0x3895a7){return _0x8156d5['status'](_0x396acf)[_0x1a73('0x1a')](_0x3895a7);}};}function respondWithFilteredResult(_0x171bdc,_0x5c8662){return function(_0x15709d){if(_0x15709d){var _0x2c1908=_0x15709d[_0x1a73('0x1b')],_0x4cbef4=_0x5c8662[_0x1a73('0x1c')],_0x5b102d=_0x5c8662[_0x1a73('0x1c')]+_0x5c8662['limit'],_0x3c422f;if(_0x5b102d>=_0x2c1908){_0x5b102d=_0x2c1908;_0x3c422f=0xc8;}else{_0x3c422f=0xce;}_0x171bdc[_0x1a73('0x1d')](_0x3c422f);return _0x171bdc['set'](_0x1a73('0x1e'),_0x4cbef4+'-'+_0x5b102d+'/'+_0x2c1908)[_0x1a73('0x1a')](_0x15709d);}return null;};}function patchUpdates(_0x6dd869){return function(_0xffd16e){try{jsonpatch[_0x1a73('0x1f')](_0xffd16e,_0x6dd869,!![]);}catch(_0x16b32f){return BPromise[_0x1a73('0x20')](_0x16b32f);}return _0xffd16e[_0x1a73('0x21')]();};}function saveUpdates(_0x4e9fa4,_0x579f99){return function(_0x1fd2fe){if(_0x1fd2fe){return _0x1fd2fe['update'](_0x4e9fa4)[_0x1a73('0x22')](function(_0x1bffb2){return _0x1bffb2;});}return null;};}function removeEntity(_0xb9d806,_0x2afd9b){return function(_0x47f7fd){if(_0x47f7fd){return _0x47f7fd['destroy']()[_0x1a73('0x22')](function(){_0xb9d806[_0x1a73('0x1d')](0xcc)[_0x1a73('0x19')]();});}};}function handleEntityNotFound(_0x557bd9,_0x116927){return function(_0x5776c6){if(!_0x5776c6){_0x557bd9['sendStatus'](0x194);}return _0x5776c6;};}function handleError(_0x4fc82b,_0x253056){_0x253056=_0x253056||0x1f4;return function(_0x122494){logger[_0x1a73('0x23')](_0x122494[_0x1a73('0x24')]);if(_0x122494[_0x1a73('0x25')]){delete _0x122494[_0x1a73('0x25')];}_0x4fc82b[_0x1a73('0x1d')](_0x253056)['send'](_0x122494);};}exports[_0x1a73('0x26')]=function(_0x1c4dbe,_0x5ef441){var _0x1b0c0e={},_0x5328d1={},_0x12df9e={'count':0x0,'rows':[]};var _0x353e18=db[_0x1a73('0x27')][_0x1a73('0x28')];_0x5328d1[_0x1a73('0x29')]=_[_0x1a73('0x2a')](_0x353e18);_0x5328d1[_0x1a73('0x2b')]=_['keys'](_0x1c4dbe[_0x1a73('0x2b')]);_0x5328d1[_0x1a73('0x2c')]=_[_0x1a73('0x2d')](_0x5328d1['model'],_0x5328d1[_0x1a73('0x2b')]);_0x1b0c0e[_0x1a73('0x2e')]=_[_0x1a73('0x2d')](_0x5328d1['model'],qs[_0x1a73('0x2f')](_0x1c4dbe[_0x1a73('0x2b')][_0x1a73('0x2f')]));_0x1b0c0e[_0x1a73('0x2e')]=_0x1b0c0e['attributes'][_0x1a73('0x30')]?_0x1b0c0e[_0x1a73('0x2e')]:_0x5328d1[_0x1a73('0x29')];if(!_0x1c4dbe[_0x1a73('0x2b')][_0x1a73('0x31')]('nolimit')){_0x1b0c0e['limit']=qs['limit'](_0x1c4dbe['query'][_0x1a73('0x32')]);_0x1b0c0e[_0x1a73('0x1c')]=qs[_0x1a73('0x1c')](_0x1c4dbe['query'][_0x1a73('0x1c')]);}_0x1b0c0e[_0x1a73('0x33')]=qs[_0x1a73('0x34')](_0x1c4dbe['query'][_0x1a73('0x34')]);_0x1b0c0e['where']=qs[_0x1a73('0x2c')](_[_0x1a73('0x35')](_0x1c4dbe[_0x1a73('0x2b')],_0x5328d1[_0x1a73('0x2c')]));if(_0x1c4dbe[_0x1a73('0x2b')][_0x1a73('0x36')]){_0x1b0c0e[_0x1a73('0x37')]=_[_0x1a73('0x38')](_0x1b0c0e[_0x1a73('0x37')],{'$or':_[_0x1a73('0x39')](_0x353e18,function(_0x1a2b18){if(_0x1a2b18['type'][_0x1a73('0x3a')]!==_0x1a73('0x3b')){var _0x3d18f0={};_0x3d18f0[_0x1a2b18[_0x1a73('0x3c')]]={'$like':'%'+_0x1c4dbe['query']['filter']+'%'};return _0x3d18f0;}})});}_0x1b0c0e=_[_0x1a73('0x38')]({},_0x1b0c0e,_0x1c4dbe[_0x1a73('0x3d')]);var _0x2f8962={'where':_0x1b0c0e[_0x1a73('0x37')]};return db[_0x1a73('0x27')][_0x1a73('0x1b')](_0x2f8962)[_0x1a73('0x22')](function(_0x5066ee){_0x12df9e['count']=_0x5066ee;if(_0x1c4dbe['query'][_0x1a73('0x3e')]){_0x1b0c0e[_0x1a73('0x3f')]=[{'all':!![]}];}return db[_0x1a73('0x27')][_0x1a73('0x40')](_0x1b0c0e);})[_0x1a73('0x22')](function(_0x274173){_0x12df9e[_0x1a73('0x41')]=_0x274173;return _0x12df9e;})[_0x1a73('0x22')](respondWithFilteredResult(_0x5ef441,_0x1b0c0e))[_0x1a73('0x42')](handleError(_0x5ef441,null));};exports['show']=function(_0x51b90b,_0xa35018){var _0xc641b0={'raw':![],'where':{'id':_0x51b90b[_0x1a73('0x43')]['id']}},_0x1047a9={};_0x1047a9['model']=_['keys'](db['SAProformaDetail'][_0x1a73('0x28')]);_0x1047a9['query']=_['keys'](_0x51b90b[_0x1a73('0x2b')]);_0x1047a9[_0x1a73('0x2c')]=_[_0x1a73('0x2d')](_0x1047a9[_0x1a73('0x29')],_0x1047a9['query']);_0xc641b0[_0x1a73('0x2e')]=_[_0x1a73('0x2d')](_0x1047a9[_0x1a73('0x29')],qs[_0x1a73('0x2f')](_0x51b90b[_0x1a73('0x2b')]['fields']));_0xc641b0[_0x1a73('0x2e')]=_0xc641b0['attributes'][_0x1a73('0x30')]?_0xc641b0[_0x1a73('0x2e')]:_0x1047a9[_0x1a73('0x29')];if(_0x51b90b[_0x1a73('0x2b')][_0x1a73('0x3e')]){_0xc641b0[_0x1a73('0x3f')]=[{'all':!![]}];}_0xc641b0=_['merge']({},_0xc641b0,_0x51b90b[_0x1a73('0x3d')]);return db[_0x1a73('0x27')][_0x1a73('0x44')](_0xc641b0)[_0x1a73('0x22')](handleEntityNotFound(_0xa35018,null))[_0x1a73('0x22')](respondWithResult(_0xa35018,null))['catch'](handleError(_0xa35018,null));};exports[_0x1a73('0x45')]=function(_0x3414d0,_0x191936){return db[_0x1a73('0x27')][_0x1a73('0x45')](_0x3414d0['body'],{})[_0x1a73('0x22')](respondWithResult(_0x191936,0xc9))[_0x1a73('0x42')](handleError(_0x191936,null));};exports[_0x1a73('0x46')]=function(_0x333d22,_0x1aa22c){if(_0x333d22['body']['id']){delete _0x333d22[_0x1a73('0x47')]['id'];}return db[_0x1a73('0x27')][_0x1a73('0x44')]({'where':{'id':_0x333d22[_0x1a73('0x43')]['id']}})[_0x1a73('0x22')](handleEntityNotFound(_0x1aa22c,null))[_0x1a73('0x22')](saveUpdates(_0x333d22[_0x1a73('0x47')],null))[_0x1a73('0x22')](respondWithResult(_0x1aa22c,null))[_0x1a73('0x42')](handleError(_0x1aa22c,null));};exports['destroy']=function(_0x8ba93f,_0x47e9ed){return db[_0x1a73('0x27')]['find']({'where':{'id':_0x8ba93f[_0x1a73('0x43')]['id']}})[_0x1a73('0x22')](handleEntityNotFound(_0x47e9ed,null))[_0x1a73('0x22')](removeEntity(_0x47e9ed,null))[_0x1a73('0x42')](handleError(_0x47e9ed,null));};exports[_0x1a73('0x48')]=function(_0x525340,_0x17e4b3){return db['SAProformaDetail'][_0x1a73('0x48')]()['then'](respondWithResult(_0x17e4b3,null))[_0x1a73('0x42')](handleError(_0x17e4b3,null));};function addProformaInvoiceDetail(_0x1c9d39,_0x7062aa,_0x184d7e){console[_0x1a73('0x49')](_0x1a73('0x4a'),_0x1c9d39);var _0x18a9e8={'companyName':_0x1c9d39[_0x1a73('0x4b')],'companyId':_0x1c9d39['companyId'],'productName':_0x1c9d39['productName'],'productCode':_0x1c9d39[_0x1a73('0x4c')],'productDescription':_0x1c9d39[_0x1a73('0x4d')],'typeName':_0x1c9d39[_0x1a73('0x4e')],'pricelistName':_0x1c9d39['pricelistName'],'priceListId':_0x1c9d39[_0x1a73('0x4f')],'netPrice':_0x1c9d39['netPrice'],'discount':_0x1c9d39[_0x1a73('0x50')],'tax':_0x1c9d39[_0x1a73('0x51')],'agentFullname':_0x1c9d39[_0x1a73('0x52')],'note':_0x1c9d39[_0x1a73('0x53')],'subscriptionId':_0x1c9d39[_0x1a73('0x54')],'subscriptionName':_0x1c9d39[_0x1a73('0x55')],'subscriptionMonthly':_0x1c9d39[_0x1a73('0x56')],'quantity':_0x1c9d39[_0x1a73('0x57')],'InvoiceId':_0x7062aa};return db[_0x1a73('0x58')][_0x1a73('0x45')](_0x18a9e8,{'transaction':_0x184d7e})[_0x1a73('0x22')](function(){return db['SAProductQuotation']['update']({'InvoiceId':_0x7062aa},{'where':{'ProductPriceListId':_0x1c9d39['priceListId'],'productCode':_0x1c9d39['productCode'],'ProformaId':_0x1c9d39[_0x1a73('0x59')]},'transaction':_0x184d7e});});}exports['automaticProformaInvoice']=function(_0x1f9c27,_0x4359c2,_0x2b1102){var _0x4e0985;if(_0x1f9c27[_0x1a73('0x47')]['id']){delete _0x1f9c27['body']['id'];}console[_0x1a73('0x49')](_0x1f9c27);return db['sequelize']['transaction'](function(_0x59d7ef){return db[_0x1a73('0x5a')]['create'](_0x1f9c27['body'],{'transaction':_0x59d7ef,'logging':console['log']})[_0x1a73('0x22')](function(_0x5928ca){_0x4e0985=_0x5928ca;var _0x2d16bc=_0x1f9c27[_0x1a73('0x43')]['id'];return db['SAProformaDetail'][_0x1a73('0x40')]({'where':{'ProformaId':_0x2d16bc},'raw':!![],'logging':console['log']});})[_0x1a73('0x22')](function(_0x55a592){if(_0x55a592[_0x1a73('0x30')]>0x0){var _0x345818=[];for(var _0x44d782=0x0;_0x44d782<_0x55a592[_0x1a73('0x30')];_0x44d782++){_0x345818[_0x1a73('0x5b')](addProformaInvoiceDetail(_0x55a592[_0x44d782],_0x4e0985['id'],_0x59d7ef));}return BPromise[_0x1a73('0x5c')](_0x345818);}else{var _0xae7ec2={'errors':[{'type':_0x1a73('0x5d'),'message':_0x1a73('0x5e')}]};throw _0xae7ec2;}});})[_0x1a73('0x22')](function(){return _0x4359c2['sendStatus'](0xc8);})[_0x1a73('0x42')](function(_0x22f1a7){console[_0x1a73('0x49')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x22f1a7);if(_0x22f1a7[_0x1a73('0x25')]===_0x1a73('0x5f')){var _0x22f1a7={'errors':[{'message':_0x1a73('0x60')}]};}_0x4359c2[_0x1a73('0x1d')](0x1f4)[_0x1a73('0x61')](_0x22f1a7);});}; \ No newline at end of file +var _0xec1b=['offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','index','SAProformaDetail','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','map','type','key','field','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','productName','productCode','typeName','pricelistName','priceListId','netPrice','tax','agentFullname','note','subscriptionName','subscriptionMonthly','SAInvoiceDetail','ProformaId','transaction','SAInvoice','log','push','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','send','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x226945,_0xa6dedc){var _0x4712b7=function(_0x104107){while(--_0x104107){_0x226945['push'](_0x226945['shift']());}};_0x4712b7(++_0xa6dedc);}(_0xec1b,0x150));var _0xbec1=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xec1b[_0x581249];return _0x284bae;};'use strict';var pdf=require(_0xbec1('0x0'));var emlformat=require(_0xbec1('0x1'));var rimraf=require(_0xbec1('0x2'));var zipdir=require(_0xbec1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec1('0x4'));var moment=require(_0xbec1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbec1('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbec1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbec1('0x8'));var crypto=require(_0xbec1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbec1('0xa'));var toCsv=require(_0xbec1('0xb'));var querystring=require(_0xbec1('0xc'));var Papa=require('papaparse');var Redis=require(_0xbec1('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbec1('0xe'));var logger=require(_0xbec1('0xf'))('api');var utils=require(_0xbec1('0x10'));var config=require(_0xbec1('0x11'));var db=require(_0xbec1('0x12'))['db'];function respondWithStatusCode(_0x26a521,_0x3d60af){_0x3d60af=_0x3d60af||0xcc;return function(_0x554210){if(_0x554210){return _0x26a521[_0xbec1('0x13')](_0x3d60af);}return _0x26a521[_0xbec1('0x14')](_0x3d60af)[_0xbec1('0x15')]();};}function respondWithResult(_0x10d79b,_0x18c86b){_0x18c86b=_0x18c86b||0xc8;return function(_0x1ec581){if(_0x1ec581){return _0x10d79b[_0xbec1('0x14')](_0x18c86b)[_0xbec1('0x16')](_0x1ec581);}};}function respondWithFilteredResult(_0x233323,_0x21f14e){return function(_0x36f350){if(_0x36f350){var _0x428f5=_0x36f350[_0xbec1('0x17')],_0x316c0b=_0x21f14e[_0xbec1('0x18')],_0x15dc48=_0x21f14e[_0xbec1('0x18')]+_0x21f14e[_0xbec1('0x19')],_0x4a4f3a;if(_0x15dc48>=_0x428f5){_0x15dc48=_0x428f5;_0x4a4f3a=0xc8;}else{_0x4a4f3a=0xce;}_0x233323[_0xbec1('0x14')](_0x4a4f3a);return _0x233323[_0xbec1('0x1a')](_0xbec1('0x1b'),_0x316c0b+'-'+_0x15dc48+'/'+_0x428f5)[_0xbec1('0x16')](_0x36f350);}return null;};}function patchUpdates(_0x38045f){return function(_0x292dd8){try{jsonpatch[_0xbec1('0x1c')](_0x292dd8,_0x38045f,!![]);}catch(_0x562e9b){return BPromise[_0xbec1('0x1d')](_0x562e9b);}return _0x292dd8['save']();};}function saveUpdates(_0xcf862b,_0x2fa0b8){return function(_0x433778){if(_0x433778){return _0x433778[_0xbec1('0x1e')](_0xcf862b)[_0xbec1('0x1f')](function(_0x491c13){return _0x491c13;});}return null;};}function removeEntity(_0x43fe88,_0x3cc804){return function(_0x126f54){if(_0x126f54){return _0x126f54[_0xbec1('0x20')]()['then'](function(){_0x43fe88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x217a0e,_0x5e69b3){return function(_0xbdfaa1){if(!_0xbdfaa1){_0x217a0e[_0xbec1('0x13')](0x194);}return _0xbdfaa1;};}function handleError(_0xba2424,_0x2ab527){_0x2ab527=_0x2ab527||0x1f4;return function(_0x1ff956){logger[_0xbec1('0x21')](_0x1ff956[_0xbec1('0x22')]);if(_0x1ff956['name']){delete _0x1ff956['name'];}_0xba2424[_0xbec1('0x14')](_0x2ab527)['send'](_0x1ff956);};}exports[_0xbec1('0x23')]=function(_0x4969e9,_0x4d41ee){var _0x397339={},_0x552e76={},_0x49135d={'count':0x0,'rows':[]};var _0x278545=db[_0xbec1('0x24')]['rawAttributes'];_0x552e76[_0xbec1('0x25')]=_['keys'](_0x278545);_0x552e76['query']=_[_0xbec1('0x26')](_0x4969e9[_0xbec1('0x27')]);_0x552e76[_0xbec1('0x28')]=_[_0xbec1('0x29')](_0x552e76['model'],_0x552e76[_0xbec1('0x27')]);_0x397339[_0xbec1('0x2a')]=_[_0xbec1('0x29')](_0x552e76[_0xbec1('0x25')],qs[_0xbec1('0x2b')](_0x4969e9['query'][_0xbec1('0x2b')]));_0x397339['attributes']=_0x397339['attributes'][_0xbec1('0x2c')]?_0x397339['attributes']:_0x552e76[_0xbec1('0x25')];if(!_0x4969e9['query']['hasOwnProperty'](_0xbec1('0x2d'))){_0x397339['limit']=qs[_0xbec1('0x19')](_0x4969e9[_0xbec1('0x27')]['limit']);_0x397339['offset']=qs[_0xbec1('0x18')](_0x4969e9[_0xbec1('0x27')][_0xbec1('0x18')]);}_0x397339['order']=qs[_0xbec1('0x2e')](_0x4969e9[_0xbec1('0x27')][_0xbec1('0x2e')]);_0x397339[_0xbec1('0x2f')]=qs[_0xbec1('0x28')](_[_0xbec1('0x30')](_0x4969e9['query'],_0x552e76[_0xbec1('0x28')]));if(_0x4969e9['query'][_0xbec1('0x31')]){_0x397339[_0xbec1('0x2f')]=_['merge'](_0x397339['where'],{'$or':_[_0xbec1('0x32')](_0x278545,function(_0x1e2fcb){if(_0x1e2fcb[_0xbec1('0x33')][_0xbec1('0x34')]!=='VIRTUAL'){var _0x45bee2={};_0x45bee2[_0x1e2fcb[_0xbec1('0x35')]]={'$like':'%'+_0x4969e9[_0xbec1('0x27')][_0xbec1('0x31')]+'%'};return _0x45bee2;}})});}_0x397339=_[_0xbec1('0x36')]({},_0x397339,_0x4969e9['options']);var _0x428ea4={'where':_0x397339[_0xbec1('0x2f')]};return db[_0xbec1('0x24')][_0xbec1('0x17')](_0x428ea4)[_0xbec1('0x1f')](function(_0x42ae45){_0x49135d[_0xbec1('0x17')]=_0x42ae45;if(_0x4969e9[_0xbec1('0x27')][_0xbec1('0x37')]){_0x397339[_0xbec1('0x38')]=[{'all':!![]}];}return db[_0xbec1('0x24')][_0xbec1('0x39')](_0x397339);})[_0xbec1('0x1f')](function(_0x4aaebe){_0x49135d[_0xbec1('0x3a')]=_0x4aaebe;return _0x49135d;})['then'](respondWithFilteredResult(_0x4d41ee,_0x397339))['catch'](handleError(_0x4d41ee,null));};exports[_0xbec1('0x3b')]=function(_0xec1b15,_0x2d9b10){var _0x1cf0f8={'raw':![],'where':{'id':_0xec1b15[_0xbec1('0x3c')]['id']}},_0x41967e={};_0x41967e['model']=_[_0xbec1('0x26')](db[_0xbec1('0x24')][_0xbec1('0x3d')]);_0x41967e[_0xbec1('0x27')]=_['keys'](_0xec1b15['query']);_0x41967e['filters']=_[_0xbec1('0x29')](_0x41967e[_0xbec1('0x25')],_0x41967e[_0xbec1('0x27')]);_0x1cf0f8[_0xbec1('0x2a')]=_[_0xbec1('0x29')](_0x41967e['model'],qs[_0xbec1('0x2b')](_0xec1b15[_0xbec1('0x27')][_0xbec1('0x2b')]));_0x1cf0f8[_0xbec1('0x2a')]=_0x1cf0f8[_0xbec1('0x2a')]['length']?_0x1cf0f8[_0xbec1('0x2a')]:_0x41967e[_0xbec1('0x25')];if(_0xec1b15[_0xbec1('0x27')][_0xbec1('0x37')]){_0x1cf0f8[_0xbec1('0x38')]=[{'all':!![]}];}_0x1cf0f8=_[_0xbec1('0x36')]({},_0x1cf0f8,_0xec1b15[_0xbec1('0x3e')]);return db[_0xbec1('0x24')][_0xbec1('0x3f')](_0x1cf0f8)['then'](handleEntityNotFound(_0x2d9b10,null))[_0xbec1('0x1f')](respondWithResult(_0x2d9b10,null))[_0xbec1('0x40')](handleError(_0x2d9b10,null));};exports['create']=function(_0x3cf2b8,_0x4bb042){return db[_0xbec1('0x24')][_0xbec1('0x41')](_0x3cf2b8[_0xbec1('0x42')],{})[_0xbec1('0x1f')](respondWithResult(_0x4bb042,0xc9))[_0xbec1('0x40')](handleError(_0x4bb042,null));};exports[_0xbec1('0x1e')]=function(_0x52efb9,_0x6b7df0){if(_0x52efb9[_0xbec1('0x42')]['id']){delete _0x52efb9[_0xbec1('0x42')]['id'];}return db['SAProformaDetail'][_0xbec1('0x3f')]({'where':{'id':_0x52efb9[_0xbec1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x6b7df0,null))[_0xbec1('0x1f')](saveUpdates(_0x52efb9['body'],null))[_0xbec1('0x1f')](respondWithResult(_0x6b7df0,null))[_0xbec1('0x40')](handleError(_0x6b7df0,null));};exports['destroy']=function(_0x37a0c4,_0x3cedc3){return db[_0xbec1('0x24')][_0xbec1('0x3f')]({'where':{'id':_0x37a0c4[_0xbec1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3cedc3,null))[_0xbec1('0x1f')](removeEntity(_0x3cedc3,null))[_0xbec1('0x40')](handleError(_0x3cedc3,null));};exports[_0xbec1('0x43')]=function(_0x1a75da,_0x1e3f0d){return db[_0xbec1('0x24')]['describe']()[_0xbec1('0x1f')](respondWithResult(_0x1e3f0d,null))[_0xbec1('0x40')](handleError(_0x1e3f0d,null));};function addProformaInvoiceDetail(_0x5ca22f,_0x486205,_0x5cf76){console['log']('addProformaInvoiceDetail->>',_0x5ca22f);var _0x539751={'companyName':_0x5ca22f['companyName'],'companyId':_0x5ca22f['companyId'],'productName':_0x5ca22f[_0xbec1('0x44')],'productCode':_0x5ca22f[_0xbec1('0x45')],'productDescription':_0x5ca22f['productDescription'],'typeName':_0x5ca22f[_0xbec1('0x46')],'pricelistName':_0x5ca22f[_0xbec1('0x47')],'priceListId':_0x5ca22f[_0xbec1('0x48')],'netPrice':_0x5ca22f[_0xbec1('0x49')],'discount':_0x5ca22f['discount'],'tax':_0x5ca22f[_0xbec1('0x4a')],'agentFullname':_0x5ca22f[_0xbec1('0x4b')],'note':_0x5ca22f[_0xbec1('0x4c')],'subscriptionId':_0x5ca22f['subscriptionId'],'subscriptionName':_0x5ca22f[_0xbec1('0x4d')],'subscriptionMonthly':_0x5ca22f[_0xbec1('0x4e')],'quantity':_0x5ca22f['quantity'],'InvoiceId':_0x486205};return db[_0xbec1('0x4f')][_0xbec1('0x41')](_0x539751,{'transaction':_0x5cf76})['then'](function(){return db['SAProductQuotation']['update']({'InvoiceId':_0x486205},{'where':{'ProductPriceListId':_0x5ca22f[_0xbec1('0x48')],'productCode':_0x5ca22f[_0xbec1('0x45')],'ProformaId':_0x5ca22f[_0xbec1('0x50')]},'transaction':_0x5cf76});});}exports['automaticProformaInvoice']=function(_0x16e923,_0x3f80b4,_0x2278dd){var _0x4ffe5a;if(_0x16e923[_0xbec1('0x42')]['id']){delete _0x16e923[_0xbec1('0x42')]['id'];}console['log'](_0x16e923);return db['sequelize'][_0xbec1('0x51')](function(_0xb36845){return db[_0xbec1('0x52')][_0xbec1('0x41')](_0x16e923[_0xbec1('0x42')],{'transaction':_0xb36845,'logging':console[_0xbec1('0x53')]})[_0xbec1('0x1f')](function(_0x1f96df){_0x4ffe5a=_0x1f96df;var _0x3ab01a=_0x16e923['params']['id'];return db['SAProformaDetail'][_0xbec1('0x39')]({'where':{'ProformaId':_0x3ab01a},'raw':!![],'logging':console[_0xbec1('0x53')]});})['then'](function(_0xb5b02d){if(_0xb5b02d[_0xbec1('0x2c')]>0x0){var _0x2acc36=[];for(var _0x2d78d6=0x0;_0x2d78d6<_0xb5b02d[_0xbec1('0x2c')];_0x2d78d6++){_0x2acc36[_0xbec1('0x54')](addProformaInvoiceDetail(_0xb5b02d[_0x2d78d6],_0x4ffe5a['id'],_0xb36845));}return BPromise['all'](_0x2acc36);}else{var _0x21bc5a={'errors':[{'type':_0xbec1('0x55'),'message':_0xbec1('0x56')}]};throw _0x21bc5a;}});})[_0xbec1('0x1f')](function(){return _0x3f80b4[_0xbec1('0x13')](0xc8);})[_0xbec1('0x40')](function(_0x249948){console[_0xbec1('0x53')](_0xbec1('0x57'),_0x249948);if(_0x249948['name']===_0xbec1('0x58')){var _0x249948={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x3f80b4['status'](0x1f4)[_0xbec1('0x59')](_0x249948);});}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.model.js b/server/api/saProformaDetail/saProformaDetail.model.js index 6d5a68a..377922d 100644 --- a/server/api/saProformaDetail/saProformaDetail.model.js +++ b/server/api/saProformaDetail/saProformaDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x776b=['util','../../config/logger','api','moment','request-promise','path','rimraf','./saProformaDetail.attributes','exports','define','SAProformaDetail','lodash'];(function(_0x272149,_0x54498f){var _0x521d60=function(_0x1a7726){while(--_0x1a7726){_0x272149['push'](_0x272149['shift']());}};_0x521d60(++_0x54498f);}(_0x776b,0x12b));var _0xb776=function(_0x32ad18,_0x5cb82f){_0x32ad18=_0x32ad18-0x0;var _0xc68f9d=_0x776b[_0x32ad18];return _0xc68f9d;};'use strict';var _=require(_0xb776('0x0'));var util=require(_0xb776('0x1'));var logger=require(_0xb776('0x2'))(_0xb776('0x3'));var moment=require(_0xb776('0x4'));var BPromise=require('bluebird');var rp=require(_0xb776('0x5'));var fs=require('fs');var path=require(_0xb776('0x6'));var rimraf=require(_0xb776('0x7'));var config=require('../../config/environment');var attributes=require(_0xb776('0x8'));module[_0xb776('0x9')]=function(_0x384a96,_0x4ec98a){return _0x384a96[_0xb776('0xa')](_0xb776('0xb'),attributes,{'tableName':'sa_proforma_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf629=['../../config/logger','moment','bluebird','request-promise','path','./saProformaDetail.attributes','SAProformaDetail','sa_proforma_details','lodash'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf629,0xd7));var _0x9f62=function(_0x266d29,_0x2b6b29){_0x266d29=_0x266d29-0x0;var _0x33bbbd=_0xf629[_0x266d29];return _0x33bbbd;};'use strict';var _=require(_0x9f62('0x0'));var util=require('util');var logger=require(_0x9f62('0x1'))('api');var moment=require(_0x9f62('0x2'));var BPromise=require(_0x9f62('0x3'));var rp=require(_0x9f62('0x4'));var fs=require('fs');var path=require(_0x9f62('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f62('0x6'));module['exports']=function(_0x50c6f0,_0x1f2980){return _0x50c6f0['define'](_0x9f62('0x7'),attributes,{'tableName':_0x9f62('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.rpc.js b/server/api/saProformaDetail/saProformaDetail.rpc.js index 19cc780..c4ef8a6 100644 --- a/server/api/saProformaDetail/saProformaDetail.rpc.js +++ b/server/api/saProformaDetail/saProformaDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SAProformaDetail,\x20%s,\x20%s','request\x20sent','debug','SAProformaDetail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4248f6,_0x3c0b1f){var _0x4db8e9=function(_0x70240){while(--_0x70240){_0x4248f6['push'](_0x4248f6['shift']());}};_0x4db8e9(++_0x3c0b1f);}(_0x34e8,0x12c));var _0x834e=function(_0x29e424,_0x3b08ee){_0x29e424=_0x29e424-0x0;var _0x486ff4=_0x34e8[_0x29e424];return _0x486ff4;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('SAProformaDetail,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('SAProformaDetail,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xa9e0=['http','info','SAProformaDetail,\x20%s,\x20%s','request\x20sent','debug','SAProformaDetail,\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(_0xa592e3,_0x4ec348){var _0x5186b3=function(_0x58683a){while(--_0x58683a){_0xa592e3['push'](_0xa592e3['shift']());}};_0x5186b3(++_0x4ec348);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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/saQuotation/index.js b/server/api/saQuotation/index.js index 1268acd..0b4f31e 100644 --- a/server/api/saQuotation/index.js +++ b/server/api/saQuotation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2414=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saQuotation.controller','get','/describe','isAuthenticated','/:id','show','post','create','moveQuotationAsset','put'];(function(_0x35f25f,_0x1ec58d){var _0x3ed9aa=function(_0x5ae4d8){while(--_0x5ae4d8){_0x35f25f['push'](_0x35f25f['shift']());}};_0x3ed9aa(++_0x1ec58d);}(_0x2414,0x118));var _0x4241=function(_0x14f4f0,_0x363e98){_0x14f4f0=_0x14f4f0-0x0;var _0x4e1d50=_0x2414[_0x14f4f0];return _0x4e1d50;};'use strict';var multer=require(_0x4241('0x0'));var util=require(_0x4241('0x1'));var path=require(_0x4241('0x2'));var timeout=require(_0x4241('0x3'));var express=require(_0x4241('0x4'));var router=express[_0x4241('0x5')]();var auth=require(_0x4241('0x6'));var interaction=require(_0x4241('0x7'));var config=require(_0x4241('0x8'));var controller=require(_0x4241('0x9'));router[_0x4241('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4241('0xa')](_0x4241('0xb'),auth[_0x4241('0xc')](),controller['describe']);router['get'](_0x4241('0xd'),auth[_0x4241('0xc')](),controller[_0x4241('0xe')]);router[_0x4241('0xf')]('/',auth[_0x4241('0xc')](),controller[_0x4241('0x10')]);router[_0x4241('0xf')]('/:id/movequotationassets',auth[_0x4241('0xc')](),controller[_0x4241('0x11')]);router[_0x4241('0x12')](_0x4241('0xd'),auth[_0x4241('0xc')](),controller[_0x4241('0x13')]);router[_0x4241('0x14')](_0x4241('0xd'),auth[_0x4241('0xc')](),controller[_0x4241('0x15')]);module[_0x4241('0x16')]=router; \ No newline at end of file +var _0xe09b=['put','/:id','update','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./saQuotation.controller','get','isAuthenticated','index','/describe','show','post','moveQuotationAsset'];(function(_0xae03ec,_0x126329){var _0x26b415=function(_0x287564){while(--_0x287564){_0xae03ec['push'](_0xae03ec['shift']());}};_0x26b415(++_0x126329);}(_0xe09b,0x1c7));var _0xbe09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe09b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbe09('0x0'));var util=require(_0xbe09('0x1'));var path=require('path');var timeout=require(_0xbe09('0x2'));var express=require(_0xbe09('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbe09('0x4'));var controller=require(_0xbe09('0x5'));router[_0xbe09('0x6')]('/',auth[_0xbe09('0x7')](),controller[_0xbe09('0x8')]);router['get'](_0xbe09('0x9'),auth[_0xbe09('0x7')](),controller['describe']);router[_0xbe09('0x6')]('/:id',auth[_0xbe09('0x7')](),controller[_0xbe09('0xa')]);router[_0xbe09('0xb')]('/',auth[_0xbe09('0x7')](),controller['create']);router['post']('/:id/movequotationassets',auth[_0xbe09('0x7')](),controller[_0xbe09('0xc')]);router[_0xbe09('0xd')](_0xbe09('0xe'),auth[_0xbe09('0x7')](),controller[_0xbe09('0xf')]);router['delete'](_0xbe09('0xe'),auth[_0xbe09('0x7')](),controller[_0xbe09('0x10')]);module[_0xbe09('0x11')]=router; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.attributes.js b/server/api/saQuotation/saQuotation.attributes.js index 4cc9c68..7a1c5cf 100644 --- a/server/api/saQuotation/saQuotation.attributes.js +++ b/server/api/saQuotation/saQuotation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ae6=['TEXT','INTEGER','sequelize','exports','STRING'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x9ae6,0x1d8));var _0x69ae=function(_0x52de9b,_0x19df61){_0x52de9b=_0x52de9b-0x0;var _0x1ad0c7=_0x9ae6[_0x52de9b];return _0x1ad0c7;};'use strict';var Sequelize=require(_0x69ae('0x0'));module[_0x69ae('0x1')]={'name':{'type':Sequelize[_0x69ae('0x2')],'unique':'name'},'note':{'type':Sequelize[_0x69ae('0x3')]},'agentFullname':{'type':Sequelize[_0x69ae('0x2')]},'status':{'type':Sequelize['TEXT']},'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x69ae('0x4')]}}; \ No newline at end of file +var _0x9599=['STRING','name','TEXT'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9599,0x189));var _0x9959=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x9599[_0x39157f];return _0x1ae4e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9959('0x0')],'unique':_0x9959('0x1')},'note':{'type':Sequelize[_0x9959('0x2')]},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9959('0x2')]},'companyName':{'type':Sequelize[_0x9959('0x0')]},'companyId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.controller.js b/server/api/saQuotation/saQuotation.controller.js index 8185d34..0f7581c 100644 --- a/server/api/saQuotation/saQuotation.controller.js +++ b/server/api/saQuotation/saQuotation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bc8=['bulkCreate','SAProductQuotation','sequelize','clone','all','No\x20product\x20to\x20move.','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','limit','status','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','SAQuotation','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','update','describe','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','companyId','SAAsset','subscriptionId','ProductPriceListId','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice','findOne','abs','quantity','slice','map','value','WARNING','There\x20are\x20not\x20enough\x20products\x20to\x20cancel.','companyName','productName','productCode','productDescription','typeName','netPrice','note','tax','subscriptionName','subscriptionMonthly'];(function(_0x20200b,_0x17c2bf){var _0x2bd0a5=function(_0x5392e0){while(--_0x5392e0){_0x20200b['push'](_0x20200b['shift']());}};_0x2bd0a5(++_0x17c2bf);}(_0x7bc8,0xda));var _0x87bc=function(_0x3955eb,_0x5b43f1){_0x3955eb=_0x3955eb-0x0;var _0x268cdd=_0x7bc8[_0x3955eb];return _0x268cdd;};'use strict';var pdf=require(_0x87bc('0x0'));var emlformat=require(_0x87bc('0x1'));var rimraf=require(_0x87bc('0x2'));var zipdir=require(_0x87bc('0x3'));var jsonpatch=require(_0x87bc('0x4'));var rp=require(_0x87bc('0x5'));var moment=require('moment');var BPromise=require(_0x87bc('0x6'));var Mustache=require(_0x87bc('0x7'));var util=require(_0x87bc('0x8'));var path=require(_0x87bc('0x9'));var sox=require(_0x87bc('0xa'));var csv=require(_0x87bc('0xb'));var ejs=require(_0x87bc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x87bc('0xd'));var jsforce=require(_0x87bc('0xe'));var deskjs=require(_0x87bc('0xf'));var toCsv=require(_0x87bc('0xb'));var querystring=require(_0x87bc('0x10'));var Papa=require(_0x87bc('0x11'));var Redis=require(_0x87bc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x87bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87bc('0x14'))(_0x87bc('0x15'));var utils=require(_0x87bc('0x16'));var config=require(_0x87bc('0x17'));var db=require(_0x87bc('0x18'))['db'];function respondWithStatusCode(_0x1e3c43,_0x2f5969){_0x2f5969=_0x2f5969||0xcc;return function(_0x5ab584){if(_0x5ab584){return _0x1e3c43[_0x87bc('0x19')](_0x2f5969);}return _0x1e3c43['status'](_0x2f5969)['end']();};}function respondWithResult(_0x594752,_0x33fe81){_0x33fe81=_0x33fe81||0xc8;return function(_0x48f277){if(_0x48f277){return _0x594752['status'](_0x33fe81)['json'](_0x48f277);}};}function respondWithFilteredResult(_0x4cffb7,_0x1d3399){return function(_0x46cbc3){if(_0x46cbc3){var _0x3d54aa=_0x46cbc3['count'],_0xaa3c7e=_0x1d3399[_0x87bc('0x1a')],_0x2fad19=_0x1d3399['offset']+_0x1d3399[_0x87bc('0x1b')],_0x17a3a2;if(_0x2fad19>=_0x3d54aa){_0x2fad19=_0x3d54aa;_0x17a3a2=0xc8;}else{_0x17a3a2=0xce;}_0x4cffb7[_0x87bc('0x1c')](_0x17a3a2);return _0x4cffb7['set'](_0x87bc('0x1d'),_0xaa3c7e+'-'+_0x2fad19+'/'+_0x3d54aa)[_0x87bc('0x1e')](_0x46cbc3);}return null;};}function patchUpdates(_0x24dd3a){return function(_0x40f0f5){try{jsonpatch[_0x87bc('0x1f')](_0x40f0f5,_0x24dd3a,!![]);}catch(_0x184efc){return BPromise[_0x87bc('0x20')](_0x184efc);}return _0x40f0f5['save']();};}function saveUpdates(_0xc14dfb,_0x175c00){return function(_0x25448f){if(_0x25448f){return _0x25448f['update'](_0xc14dfb)[_0x87bc('0x21')](function(_0x185aca){return _0x185aca;});}return null;};}function removeEntity(_0x9aac86,_0xf4e6f){return function(_0xc5e5f4){if(_0xc5e5f4){return _0xc5e5f4[_0x87bc('0x22')]()['then'](function(){_0x9aac86[_0x87bc('0x1c')](0xcc)[_0x87bc('0x23')]();});}};}function handleEntityNotFound(_0x1e6204,_0x379755){return function(_0x4ad5fe){if(!_0x4ad5fe){_0x1e6204[_0x87bc('0x19')](0x194);}return _0x4ad5fe;};}function handleError(_0x3e1b44,_0xcf3556){_0xcf3556=_0xcf3556||0x1f4;return function(_0x146d7b){logger[_0x87bc('0x24')](_0x146d7b[_0x87bc('0x25')]);if(_0x146d7b[_0x87bc('0x26')]){delete _0x146d7b[_0x87bc('0x26')];}_0x3e1b44[_0x87bc('0x1c')](_0xcf3556)[_0x87bc('0x27')](_0x146d7b);};}exports[_0x87bc('0x28')]=function(_0x1ede1a,_0x3e7096){var _0xee16be={},_0x4e77aa={},_0x3b75c6={'count':0x0,'rows':[]};var _0x5890ac=db[_0x87bc('0x29')]['rawAttributes'];_0x4e77aa[_0x87bc('0x2a')]=_[_0x87bc('0x2b')](_0x5890ac);_0x4e77aa[_0x87bc('0x2c')]=_[_0x87bc('0x2b')](_0x1ede1a[_0x87bc('0x2c')]);_0x4e77aa[_0x87bc('0x2d')]=_[_0x87bc('0x2e')](_0x4e77aa[_0x87bc('0x2a')],_0x4e77aa[_0x87bc('0x2c')]);_0xee16be['attributes']=_['intersection'](_0x4e77aa[_0x87bc('0x2a')],qs['fields'](_0x1ede1a[_0x87bc('0x2c')][_0x87bc('0x2f')]));_0xee16be[_0x87bc('0x30')]=_0xee16be[_0x87bc('0x30')]['length']?_0xee16be[_0x87bc('0x30')]:_0x4e77aa[_0x87bc('0x2a')];if(!_0x1ede1a[_0x87bc('0x2c')]['hasOwnProperty'](_0x87bc('0x31'))){_0xee16be[_0x87bc('0x1b')]=qs['limit'](_0x1ede1a['query'][_0x87bc('0x1b')]);_0xee16be[_0x87bc('0x1a')]=qs[_0x87bc('0x1a')](_0x1ede1a[_0x87bc('0x2c')][_0x87bc('0x1a')]);}_0xee16be[_0x87bc('0x32')]=qs[_0x87bc('0x33')](_0x1ede1a[_0x87bc('0x2c')]['sort']);_0xee16be[_0x87bc('0x34')]=qs[_0x87bc('0x2d')](_[_0x87bc('0x35')](_0x1ede1a['query'],_0x4e77aa['filters']));if(_0x1ede1a[_0x87bc('0x2c')][_0x87bc('0x36')]){_0xee16be['where']=_[_0x87bc('0x37')](_0xee16be[_0x87bc('0x34')],{'$or':_['map'](_0x5890ac,function(_0x3052f2){if(_0x3052f2['type'][_0x87bc('0x38')]!==_0x87bc('0x39')){var _0xb3eb36={};_0xb3eb36[_0x3052f2[_0x87bc('0x3a')]]={'$like':'%'+_0x1ede1a['query'][_0x87bc('0x36')]+'%'};return _0xb3eb36;}})});}_0xee16be=_[_0x87bc('0x37')]({},_0xee16be,_0x1ede1a[_0x87bc('0x3b')]);var _0x21b623={'where':_0xee16be[_0x87bc('0x34')]};return db[_0x87bc('0x29')][_0x87bc('0x3c')](_0x21b623)[_0x87bc('0x21')](function(_0x37ab46){_0x3b75c6[_0x87bc('0x3c')]=_0x37ab46;if(_0x1ede1a['query'][_0x87bc('0x3d')]){_0xee16be['include']=[{'all':!![]}];}return db[_0x87bc('0x29')][_0x87bc('0x3e')](_0xee16be);})[_0x87bc('0x21')](function(_0x28fad9){_0x3b75c6[_0x87bc('0x3f')]=_0x28fad9;return _0x3b75c6;})[_0x87bc('0x21')](respondWithFilteredResult(_0x3e7096,_0xee16be))['catch'](handleError(_0x3e7096,null));};exports[_0x87bc('0x40')]=function(_0x3b70fa,_0x3d7622){var _0x3cbfd4={'raw':![],'where':{'id':_0x3b70fa[_0x87bc('0x41')]['id']}},_0x439b9b={};_0x439b9b[_0x87bc('0x2a')]=_['keys'](db[_0x87bc('0x29')][_0x87bc('0x42')]);_0x439b9b['query']=_[_0x87bc('0x2b')](_0x3b70fa['query']);_0x439b9b[_0x87bc('0x2d')]=_[_0x87bc('0x2e')](_0x439b9b[_0x87bc('0x2a')],_0x439b9b['query']);_0x3cbfd4[_0x87bc('0x30')]=_['intersection'](_0x439b9b['model'],qs[_0x87bc('0x2f')](_0x3b70fa[_0x87bc('0x2c')][_0x87bc('0x2f')]));_0x3cbfd4[_0x87bc('0x30')]=_0x3cbfd4[_0x87bc('0x30')][_0x87bc('0x43')]?_0x3cbfd4['attributes']:_0x439b9b[_0x87bc('0x2a')];if(_0x3b70fa[_0x87bc('0x2c')][_0x87bc('0x3d')]){_0x3cbfd4['include']=[{'all':!![]}];}_0x3cbfd4=_[_0x87bc('0x37')]({},_0x3cbfd4,_0x3b70fa['options']);return db[_0x87bc('0x29')][_0x87bc('0x44')](_0x3cbfd4)[_0x87bc('0x21')](handleEntityNotFound(_0x3d7622,null))['then'](respondWithResult(_0x3d7622,null))[_0x87bc('0x45')](handleError(_0x3d7622,null));};exports['create']=function(_0x4786e0,_0x5dce55){return db[_0x87bc('0x29')][_0x87bc('0x46')](_0x4786e0[_0x87bc('0x47')],{})[_0x87bc('0x21')](respondWithResult(_0x5dce55,0xc9))[_0x87bc('0x45')](handleError(_0x5dce55,null));};exports[_0x87bc('0x48')]=function(_0x5e63d5,_0x3f2680){if(_0x5e63d5[_0x87bc('0x47')]['id']){delete _0x5e63d5[_0x87bc('0x47')]['id'];}return db[_0x87bc('0x29')]['find']({'where':{'id':_0x5e63d5[_0x87bc('0x41')]['id']}})[_0x87bc('0x21')](handleEntityNotFound(_0x3f2680,null))[_0x87bc('0x21')](saveUpdates(_0x5e63d5[_0x87bc('0x47')],null))['then'](respondWithResult(_0x3f2680,null))[_0x87bc('0x45')](handleError(_0x3f2680,null));};exports[_0x87bc('0x22')]=function(_0x314319,_0x443cf7){return db[_0x87bc('0x29')][_0x87bc('0x44')]({'where':{'id':_0x314319['params']['id']}})['then'](handleEntityNotFound(_0x443cf7,null))[_0x87bc('0x21')](removeEntity(_0x443cf7,null))[_0x87bc('0x45')](handleError(_0x443cf7,null));};exports[_0x87bc('0x49')]=function(_0x3de4a8,_0x20d700){return db['SAQuotation'][_0x87bc('0x49')]()[_0x87bc('0x21')](respondWithResult(_0x20d700,null))['catch'](handleError(_0x20d700,null));};function manageProductQuotationIntoAsset(_0x472ecd,_0x4d40a8){console[_0x87bc('0x4a')](_0x87bc('0x4b'),_0x472ecd);var _0x2bff8d=_0x472ecd[_0x87bc('0x4c')];var _0x12fc12=[];return db[_0x87bc('0x4d')][_0x87bc('0x3e')]({'where':{'companyId':_0x2bff8d,'SubscriptionId':_0x472ecd[_0x87bc('0x4e')],'pricelistId':_0x472ecd[_0x87bc('0x4f')],'productCode':_0x472ecd['productCode'],'deleted':{'$or':[0x0,null]}},'raw':!![]})['then'](function(_0xc24a32){console[_0x87bc('0x4a')]('TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset',_0xc24a32);_0x12fc12=_0xc24a32;console[_0x87bc('0x4a')](_0x87bc('0x50'),_0x12fc12);if(_0x12fc12&&_0x12fc12[_0x87bc('0x43')]>0x0){var _0x266dcf=_0x12fc12[0x0][_0x87bc('0x51')];var _0x45af46=_0x12fc12[_0x87bc('0x43')];return[_0x266dcf,_0x45af46];}else{return db[_0x87bc('0x4d')][_0x87bc('0x52')]({'where':{'companyId':_0x2bff8d,'SubscriptionId':_0x472ecd[_0x87bc('0x4e')],'pricelistId':_0x472ecd[_0x87bc('0x4f')]},'raw':!![]})[_0x87bc('0x21')](function(_0x23c48e){var _0x44c422=new Date();if(_0x23c48e){_0x44c422=_0x23c48e[_0x87bc('0x51')];}return[_0x44c422,0x0];});}})['spread'](function(_0x51f6b7,_0x469a2f){var _0xedd9f0=Math[_0x87bc('0x53')](_0x472ecd[_0x87bc('0x54')]);if(_0x472ecd[_0x87bc('0x54')]<0x0&&_0xedd9f0<=_0x469a2f){var _0x1498a2=_(_0x12fc12)[_0x87bc('0x55')](0x0,_0xedd9f0)[_0x87bc('0x56')]('id')[_0x87bc('0x57')]();return db['SAAsset']['update']({'deleted':0x1},{'where':{'id':_0x1498a2}});}if(_0x472ecd['quantity']<0x0&&Math['abs'](_0x472ecd['quantity'])>_0x469a2f){var _0x431f1e={'errors':[{'type':_0x87bc('0x58'),'message':_0x87bc('0x59')}]};throw _0x431f1e;}if(_0x472ecd[_0x87bc('0x54')]>0x0){var _0x238117=new Array();for(var _0x5d85b2=0x0;_0x5d85b2<_0x472ecd['quantity'];_0x5d85b2++){var _0x441025={'companyName':_0x472ecd[_0x87bc('0x5a')],'companyId':_0x472ecd[_0x87bc('0x4c')],'productName':_0x472ecd[_0x87bc('0x5b')],'productCode':_0x472ecd[_0x87bc('0x5c')],'productTax':_0x472ecd['productTax'],'productDescription':_0x472ecd[_0x87bc('0x5d')],'typeName':_0x472ecd[_0x87bc('0x5e')],'pricelistName':_0x472ecd['pricelistName'],'pricelistId':_0x472ecd[_0x87bc('0x4f')],'netPrice':_0x472ecd[_0x87bc('0x5f')],'discount':_0x472ecd['discount'],'agentFullname':_0x472ecd['agentFullname'],'note':_0x472ecd[_0x87bc('0x60')],'tax':_0x472ecd[_0x87bc('0x61')],'subscriptionId':_0x472ecd[_0x87bc('0x4e')],'subscriptionName':_0x472ecd[_0x87bc('0x62')],'subscriptionMonthly':_0x472ecd[_0x87bc('0x63')]};_0x441025['dateNextInvoice']=_0x51f6b7;_0x441025['companyId']=_0x2bff8d;_0x238117['push'](_0x441025);}return db[_0x87bc('0x4d')][_0x87bc('0x64')](_0x238117,{'transaction':_0x4d40a8})[_0x87bc('0x21')](function(){return db[_0x87bc('0x65')][_0x87bc('0x48')]({'productAsset':0x1},{'where':{'id':_0x472ecd['id']},'transaction':_0x4d40a8});});}});}exports['moveQuotationAsset']=function(_0x1a8508,_0x1a0788,_0x475897){var _0x4ace54=_0x1a8508[_0x87bc('0x41')]['id'];return db[_0x87bc('0x65')][_0x87bc('0x3e')]({'where':{'QuotationId':_0x4ace54,'productAsset':null},'raw':!![],'logging':console['log']})[_0x87bc('0x21')](function(_0x1ed3b0){if(_0x1ed3b0[_0x87bc('0x43')]>0x0){return db[_0x87bc('0x66')]['transaction'](function(_0xbb447d){var _0x216d59=new Array();for(var _0x4466e4=0x0;_0x4466e4<_0x1ed3b0[_0x87bc('0x43')];_0x4466e4++){var _0x507632=_[_0x87bc('0x67')](_0x1ed3b0[_0x4466e4]);_0x216d59['push'](manageProductQuotationIntoAsset(_0x507632,_0xbb447d));}return BPromise[_0x87bc('0x68')](_0x216d59);});}else{var _0x382017={'errors':[{'type':_0x87bc('0x58'),'message':_0x87bc('0x69')}]};throw _0x382017;}})[_0x87bc('0x21')](handleEntityNotFound(_0x1a0788,null))[_0x87bc('0x21')](respondWithStatusCode(_0x1a0788,0xc8))[_0x87bc('0x45')](handleError(_0x1a0788,null));}; \ No newline at end of file +var _0xf5fc=['No\x20product\x20to\x20move.','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','field','SAQuotation','count','include','findAll','rows','show','params','find','catch','create','body','describe','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','companyId','SAAsset','subscriptionId','ProductPriceListId','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice','spread','quantity','slice','map','abs','WARNING','companyName','productName','productCode','productTax','productDescription','typeName','pricelistName','netPrice','agentFullname','note','tax','subscriptionName','subscriptionMonthly','bulkCreate','SAProductQuotation','moveQuotationAsset','transaction','push','all'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf5fc,0x6a));var _0xcf5f=function(_0x403112,_0x2c1dc3){_0x403112=_0x403112-0x0;var _0x91f216=_0xf5fc[_0x403112];return _0x91f216;};'use strict';var pdf=require(_0xcf5f('0x0'));var emlformat=require(_0xcf5f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcf5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf5f('0x3'));var moment=require(_0xcf5f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf5f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcf5f('0x6'));var ejs=require(_0xcf5f('0x7'));var fs=require('fs');var _=require(_0xcf5f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf5f('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf5f('0xa'));var Papa=require(_0xcf5f('0xb'));var Redis=require(_0xcf5f('0xc'));var authService=require(_0xcf5f('0xd'));var qs=require(_0xcf5f('0xe'));var hardwareService=require(_0xcf5f('0xf'));var logger=require(_0xcf5f('0x10'))(_0xcf5f('0x11'));var utils=require(_0xcf5f('0x12'));var config=require(_0xcf5f('0x13'));var db=require(_0xcf5f('0x14'))['db'];function respondWithStatusCode(_0x285059,_0x253ab8){_0x253ab8=_0x253ab8||0xcc;return function(_0x502e0b){if(_0x502e0b){return _0x285059['sendStatus'](_0x253ab8);}return _0x285059[_0xcf5f('0x15')](_0x253ab8)['end']();};}function respondWithResult(_0x3b6b04,_0xa0d3ce){_0xa0d3ce=_0xa0d3ce||0xc8;return function(_0x3f3f0c){if(_0x3f3f0c){return _0x3b6b04[_0xcf5f('0x15')](_0xa0d3ce)[_0xcf5f('0x16')](_0x3f3f0c);}};}function respondWithFilteredResult(_0x21f072,_0x10dc26){return function(_0x91750e){if(_0x91750e){var _0x32e900=_0x91750e['count'],_0x31acb4=_0x10dc26[_0xcf5f('0x17')],_0x3a6348=_0x10dc26[_0xcf5f('0x17')]+_0x10dc26[_0xcf5f('0x18')],_0x7842b;if(_0x3a6348>=_0x32e900){_0x3a6348=_0x32e900;_0x7842b=0xc8;}else{_0x7842b=0xce;}_0x21f072['status'](_0x7842b);return _0x21f072[_0xcf5f('0x19')](_0xcf5f('0x1a'),_0x31acb4+'-'+_0x3a6348+'/'+_0x32e900)[_0xcf5f('0x16')](_0x91750e);}return null;};}function patchUpdates(_0x8a868d){return function(_0x1a5641){try{jsonpatch[_0xcf5f('0x1b')](_0x1a5641,_0x8a868d,!![]);}catch(_0x35d95c){return BPromise[_0xcf5f('0x1c')](_0x35d95c);}return _0x1a5641[_0xcf5f('0x1d')]();};}function saveUpdates(_0x6ca6c9,_0x2017e6){return function(_0x4c813c){if(_0x4c813c){return _0x4c813c[_0xcf5f('0x1e')](_0x6ca6c9)[_0xcf5f('0x1f')](function(_0x297440){return _0x297440;});}return null;};}function removeEntity(_0x5b1b5f,_0x49d203){return function(_0x59e22b){if(_0x59e22b){return _0x59e22b[_0xcf5f('0x20')]()[_0xcf5f('0x1f')](function(){_0x5b1b5f[_0xcf5f('0x15')](0xcc)[_0xcf5f('0x21')]();});}};}function handleEntityNotFound(_0x25afcb,_0x156c77){return function(_0x26a4ef){if(!_0x26a4ef){_0x25afcb[_0xcf5f('0x22')](0x194);}return _0x26a4ef;};}function handleError(_0x251631,_0x2843f5){_0x2843f5=_0x2843f5||0x1f4;return function(_0x4896f0){logger[_0xcf5f('0x23')](_0x4896f0['stack']);if(_0x4896f0[_0xcf5f('0x24')]){delete _0x4896f0['name'];}_0x251631[_0xcf5f('0x15')](_0x2843f5)[_0xcf5f('0x25')](_0x4896f0);};}exports[_0xcf5f('0x26')]=function(_0x465808,_0x641636){var _0x4431d0={},_0xf41fa8={},_0x37816e={'count':0x0,'rows':[]};var _0x49afad=db['SAQuotation'][_0xcf5f('0x27')];_0xf41fa8[_0xcf5f('0x28')]=_[_0xcf5f('0x29')](_0x49afad);_0xf41fa8[_0xcf5f('0x2a')]=_['keys'](_0x465808[_0xcf5f('0x2a')]);_0xf41fa8['filters']=_['intersection'](_0xf41fa8[_0xcf5f('0x28')],_0xf41fa8['query']);_0x4431d0['attributes']=_[_0xcf5f('0x2b')](_0xf41fa8[_0xcf5f('0x28')],qs['fields'](_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x2c')]));_0x4431d0[_0xcf5f('0x2d')]=_0x4431d0[_0xcf5f('0x2d')][_0xcf5f('0x2e')]?_0x4431d0[_0xcf5f('0x2d')]:_0xf41fa8[_0xcf5f('0x28')];if(!_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x2f')](_0xcf5f('0x30'))){_0x4431d0[_0xcf5f('0x18')]=qs[_0xcf5f('0x18')](_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x18')]);_0x4431d0[_0xcf5f('0x17')]=qs[_0xcf5f('0x17')](_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x17')]);}_0x4431d0[_0xcf5f('0x31')]=qs['sort'](_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x32')]);_0x4431d0[_0xcf5f('0x33')]=qs[_0xcf5f('0x34')](_['pick'](_0x465808['query'],_0xf41fa8[_0xcf5f('0x34')]));if(_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x35')]){_0x4431d0['where']=_[_0xcf5f('0x36')](_0x4431d0[_0xcf5f('0x33')],{'$or':_['map'](_0x49afad,function(_0x3378ee){if(_0x3378ee[_0xcf5f('0x37')][_0xcf5f('0x38')]!==_0xcf5f('0x39')){var _0x1a03f8={};_0x1a03f8[_0x3378ee[_0xcf5f('0x3a')]]={'$like':'%'+_0x465808[_0xcf5f('0x2a')][_0xcf5f('0x35')]+'%'};return _0x1a03f8;}})});}_0x4431d0=_['merge']({},_0x4431d0,_0x465808['options']);var _0x521dd6={'where':_0x4431d0[_0xcf5f('0x33')]};return db[_0xcf5f('0x3b')]['count'](_0x521dd6)[_0xcf5f('0x1f')](function(_0x5a7867){_0x37816e[_0xcf5f('0x3c')]=_0x5a7867;if(_0x465808[_0xcf5f('0x2a')]['includeAll']){_0x4431d0[_0xcf5f('0x3d')]=[{'all':!![]}];}return db[_0xcf5f('0x3b')][_0xcf5f('0x3e')](_0x4431d0);})[_0xcf5f('0x1f')](function(_0x1ba8da){_0x37816e[_0xcf5f('0x3f')]=_0x1ba8da;return _0x37816e;})['then'](respondWithFilteredResult(_0x641636,_0x4431d0))['catch'](handleError(_0x641636,null));};exports[_0xcf5f('0x40')]=function(_0x1f6ef8,_0x547c2e){var _0xfdc630={'raw':![],'where':{'id':_0x1f6ef8[_0xcf5f('0x41')]['id']}},_0x147907={};_0x147907[_0xcf5f('0x28')]=_[_0xcf5f('0x29')](db[_0xcf5f('0x3b')][_0xcf5f('0x27')]);_0x147907['query']=_[_0xcf5f('0x29')](_0x1f6ef8[_0xcf5f('0x2a')]);_0x147907['filters']=_[_0xcf5f('0x2b')](_0x147907[_0xcf5f('0x28')],_0x147907[_0xcf5f('0x2a')]);_0xfdc630['attributes']=_[_0xcf5f('0x2b')](_0x147907[_0xcf5f('0x28')],qs['fields'](_0x1f6ef8[_0xcf5f('0x2a')][_0xcf5f('0x2c')]));_0xfdc630[_0xcf5f('0x2d')]=_0xfdc630[_0xcf5f('0x2d')][_0xcf5f('0x2e')]?_0xfdc630[_0xcf5f('0x2d')]:_0x147907[_0xcf5f('0x28')];if(_0x1f6ef8[_0xcf5f('0x2a')]['includeAll']){_0xfdc630[_0xcf5f('0x3d')]=[{'all':!![]}];}_0xfdc630=_[_0xcf5f('0x36')]({},_0xfdc630,_0x1f6ef8['options']);return db[_0xcf5f('0x3b')][_0xcf5f('0x42')](_0xfdc630)[_0xcf5f('0x1f')](handleEntityNotFound(_0x547c2e,null))[_0xcf5f('0x1f')](respondWithResult(_0x547c2e,null))[_0xcf5f('0x43')](handleError(_0x547c2e,null));};exports[_0xcf5f('0x44')]=function(_0x4a61d3,_0x11a85a){return db[_0xcf5f('0x3b')][_0xcf5f('0x44')](_0x4a61d3[_0xcf5f('0x45')],{})[_0xcf5f('0x1f')](respondWithResult(_0x11a85a,0xc9))[_0xcf5f('0x43')](handleError(_0x11a85a,null));};exports[_0xcf5f('0x1e')]=function(_0x4d71bd,_0x3111ba){if(_0x4d71bd[_0xcf5f('0x45')]['id']){delete _0x4d71bd[_0xcf5f('0x45')]['id'];}return db[_0xcf5f('0x3b')][_0xcf5f('0x42')]({'where':{'id':_0x4d71bd['params']['id']}})[_0xcf5f('0x1f')](handleEntityNotFound(_0x3111ba,null))[_0xcf5f('0x1f')](saveUpdates(_0x4d71bd[_0xcf5f('0x45')],null))[_0xcf5f('0x1f')](respondWithResult(_0x3111ba,null))['catch'](handleError(_0x3111ba,null));};exports[_0xcf5f('0x20')]=function(_0x2946d0,_0x50a9e0){return db[_0xcf5f('0x3b')]['find']({'where':{'id':_0x2946d0[_0xcf5f('0x41')]['id']}})['then'](handleEntityNotFound(_0x50a9e0,null))[_0xcf5f('0x1f')](removeEntity(_0x50a9e0,null))['catch'](handleError(_0x50a9e0,null));};exports['describe']=function(_0x5af444,_0x36d57d){return db[_0xcf5f('0x3b')][_0xcf5f('0x46')]()[_0xcf5f('0x1f')](respondWithResult(_0x36d57d,null))[_0xcf5f('0x43')](handleError(_0x36d57d,null));};function manageProductQuotationIntoAsset(_0x40d240,_0x1f4697){console[_0xcf5f('0x47')](_0xcf5f('0x48'),_0x40d240);var _0x3747cf=_0x40d240[_0xcf5f('0x49')];var _0x30f82e=[];return db[_0xcf5f('0x4a')][_0xcf5f('0x3e')]({'where':{'companyId':_0x3747cf,'SubscriptionId':_0x40d240[_0xcf5f('0x4b')],'pricelistId':_0x40d240[_0xcf5f('0x4c')],'productCode':_0x40d240['productCode'],'deleted':{'$or':[0x0,null]}},'raw':!![]})[_0xcf5f('0x1f')](function(_0x5771fa){console[_0xcf5f('0x47')]('TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset',_0x5771fa);_0x30f82e=_0x5771fa;console[_0xcf5f('0x47')](_0xcf5f('0x4d'),_0x30f82e);if(_0x30f82e&&_0x30f82e[_0xcf5f('0x2e')]>0x0){var _0x2ff8ce=_0x30f82e[0x0][_0xcf5f('0x4e')];var _0x241ce4=_0x30f82e[_0xcf5f('0x2e')];return[_0x2ff8ce,_0x241ce4];}else{return db[_0xcf5f('0x4a')]['findOne']({'where':{'companyId':_0x3747cf,'SubscriptionId':_0x40d240['subscriptionId'],'pricelistId':_0x40d240[_0xcf5f('0x4c')]},'raw':!![]})[_0xcf5f('0x1f')](function(_0x33bbeb){var _0x442e1f=new Date();if(_0x33bbeb){_0x442e1f=_0x33bbeb[_0xcf5f('0x4e')];}return[_0x442e1f,0x0];});}})[_0xcf5f('0x4f')](function(_0x233605,_0x544f65){var _0x11433e=Math['abs'](_0x40d240[_0xcf5f('0x50')]);if(_0x40d240[_0xcf5f('0x50')]<0x0&&_0x11433e<=_0x544f65){var _0x1bd981=_(_0x30f82e)[_0xcf5f('0x51')](0x0,_0x11433e)[_0xcf5f('0x52')]('id')['value']();return db[_0xcf5f('0x4a')]['update']({'deleted':0x1},{'where':{'id':_0x1bd981}});}if(_0x40d240[_0xcf5f('0x50')]<0x0&&Math[_0xcf5f('0x53')](_0x40d240[_0xcf5f('0x50')])>_0x544f65){var _0x45fa2c={'errors':[{'type':_0xcf5f('0x54'),'message':'There\x20are\x20not\x20enough\x20products\x20to\x20cancel.'}]};throw _0x45fa2c;}if(_0x40d240[_0xcf5f('0x50')]>0x0){var _0x5da930=new Array();for(var _0x156709=0x0;_0x156709<_0x40d240[_0xcf5f('0x50')];_0x156709++){var _0x5d16c4={'companyName':_0x40d240[_0xcf5f('0x55')],'companyId':_0x40d240[_0xcf5f('0x49')],'productName':_0x40d240[_0xcf5f('0x56')],'productCode':_0x40d240[_0xcf5f('0x57')],'productTax':_0x40d240[_0xcf5f('0x58')],'productDescription':_0x40d240[_0xcf5f('0x59')],'typeName':_0x40d240[_0xcf5f('0x5a')],'pricelistName':_0x40d240[_0xcf5f('0x5b')],'pricelistId':_0x40d240[_0xcf5f('0x4c')],'netPrice':_0x40d240[_0xcf5f('0x5c')],'discount':_0x40d240['discount'],'agentFullname':_0x40d240[_0xcf5f('0x5d')],'note':_0x40d240[_0xcf5f('0x5e')],'tax':_0x40d240[_0xcf5f('0x5f')],'subscriptionId':_0x40d240[_0xcf5f('0x4b')],'subscriptionName':_0x40d240[_0xcf5f('0x60')],'subscriptionMonthly':_0x40d240[_0xcf5f('0x61')]};_0x5d16c4['dateNextInvoice']=_0x233605;_0x5d16c4[_0xcf5f('0x49')]=_0x3747cf;_0x5da930['push'](_0x5d16c4);}return db['SAAsset'][_0xcf5f('0x62')](_0x5da930,{'transaction':_0x1f4697})[_0xcf5f('0x1f')](function(){return db[_0xcf5f('0x63')]['update']({'productAsset':0x1},{'where':{'id':_0x40d240['id']},'transaction':_0x1f4697});});}});}exports[_0xcf5f('0x64')]=function(_0x46bd6c,_0x2e4578,_0x215118){var _0x48251a=_0x46bd6c[_0xcf5f('0x41')]['id'];return db[_0xcf5f('0x63')][_0xcf5f('0x3e')]({'where':{'QuotationId':_0x48251a,'productAsset':null},'raw':!![],'logging':console[_0xcf5f('0x47')]})['then'](function(_0x592b2f){if(_0x592b2f['length']>0x0){return db['sequelize'][_0xcf5f('0x65')](function(_0x109684){var _0x4a59ea=new Array();for(var _0x35a393=0x0;_0x35a393<_0x592b2f[_0xcf5f('0x2e')];_0x35a393++){var _0x190496=_['clone'](_0x592b2f[_0x35a393]);_0x4a59ea[_0xcf5f('0x66')](manageProductQuotationIntoAsset(_0x190496,_0x109684));}return BPromise[_0xcf5f('0x67')](_0x4a59ea);});}else{var _0x25fc8a={'errors':[{'type':'WARNING','message':_0xcf5f('0x68')}]};throw _0x25fc8a;}})['then'](handleEntityNotFound(_0x2e4578,null))['then'](respondWithStatusCode(_0x2e4578,0xc8))[_0xcf5f('0x43')](handleError(_0x2e4578,null));}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.model.js b/server/api/saQuotation/saQuotation.model.js index 937bbac..360ec42 100644 --- a/server/api/saQuotation/saQuotation.model.js +++ b/server/api/saQuotation/saQuotation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0565=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5dcd40,_0x5b24ec){var _0x250a57=function(_0x4bba46){while(--_0x4bba46){_0x5dcd40['push'](_0x5dcd40['shift']());}};_0x250a57(++_0x5b24ec);}(_0x0565,0xf2));var _0x5056=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x0565[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./saQuotation.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('SAQuotation',attributes,{'tableName':'sa_quotations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7af2=['../../config/environment','./saQuotation.attributes','exports','define','sa_quotations','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x12eee6,_0x526ffd){var _0xe63341=function(_0x1838b4){while(--_0x1838b4){_0x12eee6['push'](_0x12eee6['shift']());}};_0xe63341(++_0x526ffd);}(_0x7af2,0x119));var _0x27af=function(_0x30987c,_0x5dd7ae){_0x30987c=_0x30987c-0x0;var _0x3acb1f=_0x7af2[_0x30987c];return _0x3acb1f;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var moment=require(_0x27af('0x3'));var BPromise=require('bluebird');var rp=require(_0x27af('0x4'));var fs=require('fs');var path=require(_0x27af('0x5'));var rimraf=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var attributes=require(_0x27af('0x8'));module[_0x27af('0x9')]=function(_0x350532,_0x184630){return _0x350532[_0x27af('0xa')]('SAQuotation',attributes,{'tableName':_0x27af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.rpc.js b/server/api/saQuotation/saQuotation.rpc.js index d9fc788..11ea3ba 100644 --- a/server/api/saQuotation/saQuotation.rpc.js +++ b/server/api/saQuotation/saQuotation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0455=['then','info','SAQuotation,\x20%s,\x20%s','debug','SAQuotation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x0455,0xac));var _0x5045=function(_0x48f64b,_0x5eb1bd){_0x48f64b=_0x48f64b-0x0;var _0x42c947=_0x0455[_0x48f64b];return _0x42c947;};'use strict';var _=require(_0x5045('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5045('0x1'));var rs=require(_0x5045('0x2'));var fs=require('fs');var Redis=require(_0x5045('0x3'));var db=require(_0x5045('0x4'))['db'];var utils=require(_0x5045('0x5'));var logger=require(_0x5045('0x6'))(_0x5045('0x7'));var config=require(_0x5045('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5045('0x9')][_0x5045('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x203d5b,_0x6f5045,_0x268b78){return new BPromise(function(_0x1be88f,_0x306667){return client[_0x5045('0xb')](_0x203d5b,_0x268b78)[_0x5045('0xc')](function(_0x225422){logger[_0x5045('0xd')](_0x5045('0xe'),_0x6f5045,'request\x20sent');logger[_0x5045('0xf')](_0x5045('0x10'),_0x6f5045,_0x5045('0x11'),JSON[_0x5045('0x12')](_0x225422));if(_0x225422[_0x5045('0x13')]){if(_0x225422[_0x5045('0x13')]['code']===0x1f4){logger['error'](_0x5045('0xe'),_0x6f5045,_0x225422['error'][_0x5045('0x14')]);return _0x306667(_0x225422[_0x5045('0x13')][_0x5045('0x14')]);}logger[_0x5045('0x13')](_0x5045('0xe'),_0x6f5045,_0x225422[_0x5045('0x13')][_0x5045('0x14')]);return _0x1be88f(_0x225422[_0x5045('0x13')][_0x5045('0x14')]);}else{logger['info'](_0x5045('0xe'),_0x6f5045,_0x5045('0x11'));_0x1be88f(_0x225422[_0x5045('0x15')][_0x5045('0x14')]);}})[_0x5045('0x16')](function(_0x4dfc8f){logger[_0x5045('0x13')](_0x5045('0xe'),_0x6f5045,_0x4dfc8f);_0x306667(_0x4dfc8f);});});} \ No newline at end of file +var _0x1849=['request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','SAQuotation,\x20%s,\x20%s','debug','SAQuotation,\x20%s,\x20%s,\x20%s'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x1849,0x156));var _0x9184=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1849[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x9184('0x0'));var moment=require('moment');var BPromise=require(_0x9184('0x1'));var rs=require(_0x9184('0x2'));var fs=require('fs');var Redis=require(_0x9184('0x3'));var db=require(_0x9184('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9184('0x5'))(_0x9184('0x6'));var config=require(_0x9184('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9184('0x8')][_0x9184('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57d545,_0x142931,_0x1170d8){return new BPromise(function(_0x1c93ed,_0x2d3b69){return client['request'](_0x57d545,_0x1170d8)[_0x9184('0xa')](function(_0x474be7){logger[_0x9184('0xb')](_0x9184('0xc'),_0x142931,'request\x20sent');logger[_0x9184('0xd')](_0x9184('0xe'),_0x142931,_0x9184('0xf'),JSON['stringify'](_0x474be7));if(_0x474be7[_0x9184('0x10')]){if(_0x474be7[_0x9184('0x10')][_0x9184('0x11')]===0x1f4){logger['error'](_0x9184('0xc'),_0x142931,_0x474be7[_0x9184('0x10')][_0x9184('0x12')]);return _0x2d3b69(_0x474be7['error'][_0x9184('0x12')]);}logger[_0x9184('0x10')](_0x9184('0xc'),_0x142931,_0x474be7[_0x9184('0x10')]['message']);return _0x1c93ed(_0x474be7[_0x9184('0x10')][_0x9184('0x12')]);}else{logger[_0x9184('0xb')](_0x9184('0xc'),_0x142931,'request\x20sent');_0x1c93ed(_0x474be7[_0x9184('0x13')][_0x9184('0x12')]);}})[_0x9184('0x14')](function(_0x35be94){logger[_0x9184('0x10')](_0x9184('0xc'),_0x142931,_0x35be94);_0x2d3b69(_0x35be94);});});} \ No newline at end of file diff --git a/server/api/saRequest/index.js b/server/api/saRequest/index.js index 91cb90b..56e1d77 100644 --- a/server/api/saRequest/index.js +++ b/server/api/saRequest/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf989=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','update'];(function(_0x21dcf7,_0x460712){var _0x22f534=function(_0x419e31){while(--_0x419e31){_0x21dcf7['push'](_0x21dcf7['shift']());}};_0x22f534(++_0x460712);}(_0xf989,0xec));var _0x9f98=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xf989[_0x43a6cd];return _0x5acb36;};'use strict';var multer=require(_0x9f98('0x0'));var util=require(_0x9f98('0x1'));var path=require(_0x9f98('0x2'));var timeout=require(_0x9f98('0x3'));var express=require(_0x9f98('0x4'));var router=express[_0x9f98('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9f98('0x6'));var config=require(_0x9f98('0x7'));var controller=require('./saRequest.controller');router[_0x9f98('0x8')]('/',auth[_0x9f98('0x9')](),controller[_0x9f98('0xa')]);router[_0x9f98('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x9f98('0xb')]);router[_0x9f98('0x8')](_0x9f98('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9f98('0xd')]('/',auth['isAuthenticated'](),controller[_0x9f98('0xe')]);router['put'](_0x9f98('0xc'),auth[_0x9f98('0x9')](),controller[_0x9f98('0xf')]);router[_0x9f98('0x10')](_0x9f98('0xc'),auth[_0x9f98('0x9')](),controller[_0x9f98('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6650=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./saRequest.controller','get','/describe','describe','isAuthenticated','show','post','put','/:id','update','destroy','multer'];(function(_0x4aa1b2,_0x3f38b6){var _0x3a1a7c=function(_0x2b8686){while(--_0x2b8686){_0x4aa1b2['push'](_0x4aa1b2['shift']());}};_0x3a1a7c(++_0x3f38b6);}(_0x6650,0x19d));var _0x0665=function(_0x7f17f0,_0x10b1a1){_0x7f17f0=_0x7f17f0-0x0;var _0x335ad2=_0x6650[_0x7f17f0];return _0x335ad2;};'use strict';var multer=require(_0x0665('0x0'));var util=require(_0x0665('0x1'));var path=require(_0x0665('0x2'));var timeout=require('connect-timeout');var express=require(_0x0665('0x3'));var router=express[_0x0665('0x4')]();var auth=require(_0x0665('0x5'));var interaction=require(_0x0665('0x6'));var config=require('../../config/environment');var controller=require(_0x0665('0x7'));router[_0x0665('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0665('0x8')](_0x0665('0x9'),auth['isAuthenticated'](),controller[_0x0665('0xa')]);router[_0x0665('0x8')]('/:id',auth[_0x0665('0xb')](),controller[_0x0665('0xc')]);router[_0x0665('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0665('0xe')](_0x0665('0xf'),auth[_0x0665('0xb')](),controller[_0x0665('0x10')]);router['delete'](_0x0665('0xf'),auth[_0x0665('0xb')](),controller[_0x0665('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.attributes.js b/server/api/saRequest/saRequest.attributes.js index e8723cb..58d9484 100644 --- a/server/api/saRequest/saRequest.attributes.js +++ b/server/api/saRequest/saRequest.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9860=['exports','DATE','name','STRING','TEXT','sequelize'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x9860,0x1d3));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0986('0x0'));module[_0x0986('0x1')]={'endAt':{'type':Sequelize[_0x0986('0x2')]},'name':{'type':Sequelize['STRING'],'unique':_0x0986('0x3')},'agentFullname':{'type':Sequelize[_0x0986('0x4')]},'note':{'type':Sequelize[_0x0986('0x5')]}}; \ No newline at end of file +var _0x9ca1=['STRING','name','TEXT','sequelize','exports','DATE'];(function(_0x15a4bc,_0x59bd7a){var _0x206fb6=function(_0x232372){while(--_0x232372){_0x15a4bc['push'](_0x15a4bc['shift']());}};_0x206fb6(++_0x59bd7a);}(_0x9ca1,0x19b));var _0x19ca=function(_0x34a981,_0x1eb76c){_0x34a981=_0x34a981-0x0;var _0x82f5b8=_0x9ca1[_0x34a981];return _0x82f5b8;};'use strict';var Sequelize=require(_0x19ca('0x0'));module[_0x19ca('0x1')]={'endAt':{'type':Sequelize[_0x19ca('0x2')]},'name':{'type':Sequelize[_0x19ca('0x3')],'unique':_0x19ca('0x4')},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x19ca('0x5')]}}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.controller.js b/server/api/saRequest/saRequest.controller.js index 6fa266d..ff8f467 100644 --- a/server/api/saRequest/saRequest.controller.js +++ b/server/api/saRequest/saRequest.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','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/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','SARequest','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x86a1ff,_0x278cea){var _0xfaae0e=function(_0x4d58b2){while(--_0x4d58b2){_0x86a1ff['push'](_0x86a1ff['shift']());}};_0xfaae0e(++_0x278cea);}(_0xb10b,0x12a));var _0xbb10=function(_0x5fe69a,_0x5484f5){_0x5fe69a=_0x5fe69a-0x0;var _0x3f1aee=_0xb10b[_0x5fe69a];return _0x3f1aee;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['SARequest']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','SARequest','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x39d1fc,_0x39fc68){var _0x327303=function(_0x1779a0){while(--_0x1779a0){_0x39d1fc['push'](_0x39d1fc['shift']());}};_0x327303(++_0x39fc68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['SARequest'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SARequest']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['SARequest'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.model.js b/server/api/saRequest/saRequest.model.js index 26009bd..8fb6084 100644 --- a/server/api/saRequest/saRequest.model.js +++ b/server/api/saRequest/saRequest.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./saRequest.attributes','exports','define','SARequest','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x111269,_0x3395ff){var _0x364732=function(_0x4097c2){while(--_0x4097c2){_0x111269['push'](_0x111269['shift']());}};_0x364732(++_0x3395ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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':'sa_requests','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./saRequest.attributes','exports','define','SARequest','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x28f7b6,_0x4e3281){var _0x20ea59=function(_0x42f46e){while(--_0x42f46e){_0x28f7b6['push'](_0x28f7b6['shift']());}};_0x20ea59(++_0x4e3281);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sa_requests','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.rpc.js b/server/api/saRequest/saRequest.rpc.js index 835e4d9..34984f9 100644 --- a/server/api/saRequest/saRequest.rpc.js +++ b/server/api/saRequest/saRequest.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc721=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SARequest,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xc721,0x101));var _0x1c72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc721[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1c72('0x0'));var util=require(_0x1c72('0x1'));var moment=require(_0x1c72('0x2'));var BPromise=require(_0x1c72('0x3'));var rs=require(_0x1c72('0x4'));var fs=require('fs');var Redis=require(_0x1c72('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c72('0x6'));var logger=require(_0x1c72('0x7'))(_0x1c72('0x8'));var config=require('../../config/environment');var jayson=require(_0x1c72('0x9'));var client=jayson[_0x1c72('0xa')][_0x1c72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4250e9,_0x5767d0,_0x2f195b){return new BPromise(function(_0x522daf,_0x3f30d1){return client[_0x1c72('0xc')](_0x4250e9,_0x2f195b)[_0x1c72('0xd')](function(_0x51c39c){logger[_0x1c72('0xe')](_0x1c72('0xf'),_0x5767d0,_0x1c72('0x10'));logger['debug']('SARequest,\x20%s,\x20%s,\x20%s',_0x5767d0,'request\x20sent',JSON['stringify'](_0x51c39c));if(_0x51c39c[_0x1c72('0x11')]){if(_0x51c39c['error'][_0x1c72('0x12')]===0x1f4){logger[_0x1c72('0x11')](_0x1c72('0xf'),_0x5767d0,_0x51c39c[_0x1c72('0x11')][_0x1c72('0x13')]);return _0x3f30d1(_0x51c39c['error'][_0x1c72('0x13')]);}logger[_0x1c72('0x11')](_0x1c72('0xf'),_0x5767d0,_0x51c39c['error']['message']);return _0x522daf(_0x51c39c[_0x1c72('0x11')]['message']);}else{logger['info'](_0x1c72('0xf'),_0x5767d0,_0x1c72('0x10'));_0x522daf(_0x51c39c[_0x1c72('0x14')][_0x1c72('0x13')]);}})[_0x1c72('0x15')](function(_0x1dd4a4){logger[_0x1c72('0x11')](_0x1c72('0xf'),_0x5767d0,_0x1dd4a4);_0x3f30d1(_0x1dd4a4);});});} \ No newline at end of file +var _0xaed5=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SARequest,\x20%s,\x20%s','request\x20sent','debug','SARequest,\x20%s,\x20%s,\x20%s'];(function(_0x4a79bd,_0x3f7827){var _0x26fd6a=function(_0x193ee6){while(--_0x193ee6){_0x4a79bd['push'](_0x4a79bd['shift']());}};_0x26fd6a(++_0x3f7827);}(_0xaed5,0x65));var _0x5aed=function(_0x41dc43,_0x270632){_0x41dc43=_0x41dc43-0x0;var _0x55aec4=_0xaed5[_0x41dc43];return _0x55aec4;};'use strict';var _=require(_0x5aed('0x0'));var util=require(_0x5aed('0x1'));var moment=require(_0x5aed('0x2'));var BPromise=require(_0x5aed('0x3'));var rs=require(_0x5aed('0x4'));var fs=require('fs');var Redis=require(_0x5aed('0x5'));var db=require(_0x5aed('0x6'))['db'];var utils=require(_0x5aed('0x7'));var logger=require(_0x5aed('0x8'))(_0x5aed('0x9'));var config=require(_0x5aed('0xa'));var jayson=require(_0x5aed('0xb'));var client=jayson[_0x5aed('0xc')][_0x5aed('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2f0cbd,_0x8bbaa4,_0x2bf879){return new BPromise(function(_0x4e00a9,_0x249278){return client['request'](_0x2f0cbd,_0x2bf879)['then'](function(_0x4669da){logger[_0x5aed('0xe')](_0x5aed('0xf'),_0x8bbaa4,_0x5aed('0x10'));logger[_0x5aed('0x11')](_0x5aed('0x12'),_0x8bbaa4,_0x5aed('0x10'),JSON[_0x5aed('0x13')](_0x4669da));if(_0x4669da[_0x5aed('0x14')]){if(_0x4669da[_0x5aed('0x14')]['code']===0x1f4){logger[_0x5aed('0x14')](_0x5aed('0xf'),_0x8bbaa4,_0x4669da[_0x5aed('0x14')][_0x5aed('0x15')]);return _0x249278(_0x4669da[_0x5aed('0x14')][_0x5aed('0x15')]);}logger[_0x5aed('0x14')]('SARequest,\x20%s,\x20%s',_0x8bbaa4,_0x4669da[_0x5aed('0x14')][_0x5aed('0x15')]);return _0x4e00a9(_0x4669da[_0x5aed('0x14')]['message']);}else{logger[_0x5aed('0xe')](_0x5aed('0xf'),_0x8bbaa4,_0x5aed('0x10'));_0x4e00a9(_0x4669da[_0x5aed('0x16')]['message']);}})[_0x5aed('0x17')](function(_0x47a560){logger[_0x5aed('0x14')]('SARequest,\x20%s,\x20%s',_0x8bbaa4,_0x47a560);_0x249278(_0x47a560);});});} \ No newline at end of file diff --git a/server/api/saSalesCondition/index.js b/server/api/saSalesCondition/index.js index 4000f02..d9282f6 100644 --- a/server/api/saSalesCondition/index.js +++ b/server/api/saSalesCondition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7f6=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./saSalesCondition.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xf7f6,0xb4));var _0x6f7f=function(_0x12f155,_0x16a21d){_0x12f155=_0x12f155-0x0;var _0x452490=_0xf7f6[_0x12f155];return _0x452490;};'use strict';var multer=require(_0x6f7f('0x0'));var util=require(_0x6f7f('0x1'));var path=require('path');var timeout=require(_0x6f7f('0x2'));var express=require(_0x6f7f('0x3'));var router=express[_0x6f7f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6f7f('0x5'));var config=require(_0x6f7f('0x6'));var controller=require(_0x6f7f('0x7'));router['get']('/',auth[_0x6f7f('0x8')](),controller[_0x6f7f('0x9')]);router[_0x6f7f('0xa')](_0x6f7f('0xb'),auth[_0x6f7f('0x8')](),controller[_0x6f7f('0xc')]);router[_0x6f7f('0xd')]('/',auth['isAuthenticated'](),controller[_0x6f7f('0xe')]);module['exports']=router; \ No newline at end of file +var _0x068c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saSalesCondition.controller','get','index','/:id','isAuthenticated','show','create','exports'];(function(_0x5351d2,_0x3b6c20){var _0xe805ba=function(_0x406f2b){while(--_0x406f2b){_0x5351d2['push'](_0x5351d2['shift']());}};_0xe805ba(++_0x3b6c20);}(_0x068c,0xcc));var _0xc068=function(_0x529031,_0x1e2823){_0x529031=_0x529031-0x0;var _0x5e1264=_0x068c[_0x529031];return _0x5e1264;};'use strict';var multer=require(_0xc068('0x0'));var util=require(_0xc068('0x1'));var path=require(_0xc068('0x2'));var timeout=require(_0xc068('0x3'));var express=require(_0xc068('0x4'));var router=express[_0xc068('0x5')]();var auth=require(_0xc068('0x6'));var interaction=require(_0xc068('0x7'));var config=require(_0xc068('0x8'));var controller=require(_0xc068('0x9'));router[_0xc068('0xa')]('/',auth['isAuthenticated'](),controller[_0xc068('0xb')]);router[_0xc068('0xa')](_0xc068('0xc'),auth[_0xc068('0xd')](),controller[_0xc068('0xe')]);router['post']('/',auth[_0xc068('0xd')](),controller[_0xc068('0xf')]);module[_0xc068('0x10')]=router; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.attributes.js b/server/api/saSalesCondition/saSalesCondition.attributes.js index 9fb47ad..87aa3d1 100644 --- a/server/api/saSalesCondition/saSalesCondition.attributes.js +++ b/server/api/saSalesCondition/saSalesCondition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5636=['sequelize','exports'];(function(_0x53e695,_0x475ae8){var _0x1d244f=function(_0x77e23d){while(--_0x77e23d){_0x53e695['push'](_0x53e695['shift']());}};_0x1d244f(++_0x475ae8);}(_0x5636,0x102));var _0x6563=function(_0x2e4c2d,_0x4e1f45){_0x2e4c2d=_0x2e4c2d-0x0;var _0x365484=_0x5636[_0x2e4c2d];return _0x365484;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'momthlysubscription':{'type':Sequelize['INTEGER'],'allowNull':![]}}; \ No newline at end of file +var _0xfd28=['INTEGER','exports','STRING'];(function(_0x484c98,_0x248bfa){var _0x31838e=function(_0x409678){while(--_0x409678){_0x484c98['push'](_0x484c98['shift']());}};_0x31838e(++_0x248bfa);}(_0xfd28,0x148));var _0x8fd2=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xfd28[_0x504df1];return _0x1063b5;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')],'allowNull':![],'unique':'name'},'momthlysubscription':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.controller.js b/server/api/saSalesCondition/saSalesCondition.controller.js index 5c4a300..06226d2 100644 --- a/server/api/saSalesCondition/saSalesCondition.controller.js +++ b/server/api/saSalesCondition/saSalesCondition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa43b=['field','options','count','includeAll','include','findAll','catch','show','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','SASalesCondition','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL'];(function(_0x18a772,_0x1a4d3f){var _0xbaac04=function(_0x467aa6){while(--_0x467aa6){_0x18a772['push'](_0x18a772['shift']());}};_0xbaac04(++_0x1a4d3f);}(_0xa43b,0x12e));var _0xba43=function(_0x3aa640,_0x430b73){_0x3aa640=_0x3aa640-0x0;var _0x1cabbc=_0xa43b[_0x3aa640];return _0x1cabbc;};'use strict';var pdf=require(_0xba43('0x0'));var emlformat=require(_0xba43('0x1'));var rimraf=require(_0xba43('0x2'));var zipdir=require(_0xba43('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba43('0x4'));var moment=require(_0xba43('0x5'));var BPromise=require(_0xba43('0x6'));var Mustache=require(_0xba43('0x7'));var util=require(_0xba43('0x8'));var path=require('path');var sox=require(_0xba43('0x9'));var csv=require(_0xba43('0xa'));var ejs=require(_0xba43('0xb'));var fs=require('fs');var _=require(_0xba43('0xc'));var squel=require(_0xba43('0xd'));var crypto=require('crypto');var jsforce=require(_0xba43('0xe'));var deskjs=require(_0xba43('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba43('0x10'));var Redis=require(_0xba43('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xba43('0x12'));var logger=require(_0xba43('0x13'))(_0xba43('0x14'));var utils=require(_0xba43('0x15'));var config=require(_0xba43('0x16'));var db=require(_0xba43('0x17'))['db'];function respondWithStatusCode(_0x3ccd2b,_0x276c1f){_0x276c1f=_0x276c1f||0xcc;return function(_0x529868){if(_0x529868){return _0x3ccd2b['sendStatus'](_0x276c1f);}return _0x3ccd2b[_0xba43('0x18')](_0x276c1f)[_0xba43('0x19')]();};}function respondWithResult(_0xe434ef,_0x284af5){_0x284af5=_0x284af5||0xc8;return function(_0x1ded4b){if(_0x1ded4b){return _0xe434ef['status'](_0x284af5)[_0xba43('0x1a')](_0x1ded4b);}};}function respondWithFilteredResult(_0x418d8b,_0x1d49c1){return function(_0x636803){if(_0x636803){var _0x4a41d0=_0x636803['count'],_0x5584f4=_0x1d49c1[_0xba43('0x1b')],_0x44bcff=_0x1d49c1[_0xba43('0x1b')]+_0x1d49c1[_0xba43('0x1c')],_0x3f2312;if(_0x44bcff>=_0x4a41d0){_0x44bcff=_0x4a41d0;_0x3f2312=0xc8;}else{_0x3f2312=0xce;}_0x418d8b[_0xba43('0x18')](_0x3f2312);return _0x418d8b['set'](_0xba43('0x1d'),_0x5584f4+'-'+_0x44bcff+'/'+_0x4a41d0)[_0xba43('0x1a')](_0x636803);}return null;};}function patchUpdates(_0x14c7a4){return function(_0x2b8aad){try{jsonpatch[_0xba43('0x1e')](_0x2b8aad,_0x14c7a4,!![]);}catch(_0x216b40){return BPromise['reject'](_0x216b40);}return _0x2b8aad[_0xba43('0x1f')]();};}function saveUpdates(_0x46ff98,_0x6bf9c4){return function(_0x2c4d19){if(_0x2c4d19){return _0x2c4d19[_0xba43('0x20')](_0x46ff98)['then'](function(_0x4aa66f){return _0x4aa66f;});}return null;};}function removeEntity(_0x157e63,_0xee7ad6){return function(_0x56f93f){if(_0x56f93f){return _0x56f93f[_0xba43('0x21')]()[_0xba43('0x22')](function(){_0x157e63[_0xba43('0x18')](0xcc)[_0xba43('0x19')]();});}};}function handleEntityNotFound(_0x5b5e9d,_0xceaa3e){return function(_0x3c364b){if(!_0x3c364b){_0x5b5e9d[_0xba43('0x23')](0x194);}return _0x3c364b;};}function handleError(_0x210970,_0x2a0c35){_0x2a0c35=_0x2a0c35||0x1f4;return function(_0x239ea0){logger[_0xba43('0x24')](_0x239ea0[_0xba43('0x25')]);if(_0x239ea0[_0xba43('0x26')]){delete _0x239ea0[_0xba43('0x26')];}_0x210970['status'](_0x2a0c35)[_0xba43('0x27')](_0x239ea0);};}exports[_0xba43('0x28')]=function(_0x5e40ab,_0x20f98d){var _0x52843f={'raw':!![]},_0x3676fe={},_0x24815c={'count':0x0,'rows':[]};var _0x51ebec=db[_0xba43('0x29')][_0xba43('0x2a')];_0x3676fe[_0xba43('0x2b')]=_[_0xba43('0x2c')](_0x51ebec);_0x3676fe[_0xba43('0x2d')]=_[_0xba43('0x2c')](_0x5e40ab[_0xba43('0x2d')]);_0x3676fe[_0xba43('0x2e')]=_[_0xba43('0x2f')](_0x3676fe[_0xba43('0x2b')],_0x3676fe['query']);_0x52843f['attributes']=_[_0xba43('0x2f')](_0x3676fe[_0xba43('0x2b')],qs[_0xba43('0x30')](_0x5e40ab['query'][_0xba43('0x30')]));_0x52843f[_0xba43('0x31')]=_0x52843f[_0xba43('0x31')][_0xba43('0x32')]?_0x52843f['attributes']:_0x3676fe[_0xba43('0x2b')];if(!_0x5e40ab[_0xba43('0x2d')][_0xba43('0x33')](_0xba43('0x34'))){_0x52843f['limit']=qs['limit'](_0x5e40ab[_0xba43('0x2d')][_0xba43('0x1c')]);_0x52843f[_0xba43('0x1b')]=qs[_0xba43('0x1b')](_0x5e40ab[_0xba43('0x2d')]['offset']);}_0x52843f[_0xba43('0x35')]=qs[_0xba43('0x36')](_0x5e40ab['query'][_0xba43('0x36')]);_0x52843f[_0xba43('0x37')]=qs[_0xba43('0x2e')](_[_0xba43('0x38')](_0x5e40ab['query'],_0x3676fe[_0xba43('0x2e')]));if(_0x5e40ab[_0xba43('0x2d')][_0xba43('0x39')]){_0x52843f[_0xba43('0x37')]=_[_0xba43('0x3a')](_0x52843f['where'],{'$or':_[_0xba43('0x3b')](_0x51ebec,function(_0x25c155){if(_0x25c155[_0xba43('0x3c')][_0xba43('0x3d')]!==_0xba43('0x3e')){var _0x135746={};_0x135746[_0x25c155[_0xba43('0x3f')]]={'$like':'%'+_0x5e40ab['query'][_0xba43('0x39')]+'%'};return _0x135746;}})});}_0x52843f=_['merge']({},_0x52843f,_0x5e40ab[_0xba43('0x40')]);var _0x35ce53={'where':_0x52843f[_0xba43('0x37')]};return db[_0xba43('0x29')][_0xba43('0x41')](_0x35ce53)[_0xba43('0x22')](function(_0x39a737){_0x24815c['count']=_0x39a737;if(_0x5e40ab[_0xba43('0x2d')][_0xba43('0x42')]){_0x52843f[_0xba43('0x43')]=[{'all':!![]}];}return db[_0xba43('0x29')][_0xba43('0x44')](_0x52843f);})[_0xba43('0x22')](function(_0x41feea){_0x24815c['rows']=_0x41feea;return _0x24815c;})['then'](respondWithFilteredResult(_0x20f98d,_0x52843f))[_0xba43('0x45')](handleError(_0x20f98d,null));};exports[_0xba43('0x46')]=function(_0x27ca0e,_0x6664a5){var _0x50e43a={'raw':!![],'where':{'id':_0x27ca0e['params']['id']}},_0x3f7e01={};_0x3f7e01[_0xba43('0x2b')]=_[_0xba43('0x2c')](db[_0xba43('0x29')]['rawAttributes']);_0x3f7e01[_0xba43('0x2d')]=_[_0xba43('0x2c')](_0x27ca0e[_0xba43('0x2d')]);_0x3f7e01[_0xba43('0x2e')]=_[_0xba43('0x2f')](_0x3f7e01['model'],_0x3f7e01[_0xba43('0x2d')]);_0x50e43a[_0xba43('0x31')]=_['intersection'](_0x3f7e01[_0xba43('0x2b')],qs['fields'](_0x27ca0e[_0xba43('0x2d')][_0xba43('0x30')]));_0x50e43a['attributes']=_0x50e43a[_0xba43('0x31')]['length']?_0x50e43a['attributes']:_0x3f7e01[_0xba43('0x2b')];if(_0x27ca0e[_0xba43('0x2d')][_0xba43('0x42')]){_0x50e43a[_0xba43('0x43')]=[{'all':!![]}];}_0x50e43a=_[_0xba43('0x3a')]({},_0x50e43a,_0x27ca0e['options']);return db[_0xba43('0x29')]['find'](_0x50e43a)['then'](handleEntityNotFound(_0x6664a5,null))['then'](respondWithResult(_0x6664a5,null))['catch'](handleError(_0x6664a5,null));};exports[_0xba43('0x47')]=function(_0x385a78,_0x15ac7a){return db[_0xba43('0x29')][_0xba43('0x47')](_0x385a78[_0xba43('0x48')],{})[_0xba43('0x22')](respondWithResult(_0x15ac7a,0xc9))['catch'](handleError(_0x15ac7a,null));}; \ No newline at end of file +var _0xa817=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','SASalesCondition','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','type','key','field','options','include','rows','catch','show','params','includeAll','find','create','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x52e02f,_0x506dd2){var _0x32699e=function(_0x3d8a07){while(--_0x3d8a07){_0x52e02f['push'](_0x52e02f['shift']());}};_0x32699e(++_0x506dd2);}(_0xa817,0x7b));var _0x7a81=function(_0x5ca1b2,_0x191598){_0x5ca1b2=_0x5ca1b2-0x0;var _0x2154cd=_0xa817[_0x5ca1b2];return _0x2154cd;};'use strict';var pdf=require(_0x7a81('0x0'));var emlformat=require(_0x7a81('0x1'));var rimraf=require(_0x7a81('0x2'));var zipdir=require(_0x7a81('0x3'));var jsonpatch=require(_0x7a81('0x4'));var rp=require(_0x7a81('0x5'));var moment=require(_0x7a81('0x6'));var BPromise=require(_0x7a81('0x7'));var Mustache=require(_0x7a81('0x8'));var util=require('util');var path=require(_0x7a81('0x9'));var sox=require(_0x7a81('0xa'));var csv=require('to-csv');var ejs=require(_0x7a81('0xb'));var fs=require('fs');var _=require(_0x7a81('0xc'));var squel=require(_0x7a81('0xd'));var crypto=require(_0x7a81('0xe'));var jsforce=require(_0x7a81('0xf'));var deskjs=require(_0x7a81('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7a81('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7a81('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7a81('0x13'));var logger=require(_0x7a81('0x14'))(_0x7a81('0x15'));var utils=require(_0x7a81('0x16'));var config=require(_0x7a81('0x17'));var db=require(_0x7a81('0x18'))['db'];function respondWithStatusCode(_0x2bea43,_0x4c632e){_0x4c632e=_0x4c632e||0xcc;return function(_0x12a089){if(_0x12a089){return _0x2bea43[_0x7a81('0x19')](_0x4c632e);}return _0x2bea43[_0x7a81('0x1a')](_0x4c632e)['end']();};}function respondWithResult(_0x39e1d0,_0xd1e099){_0xd1e099=_0xd1e099||0xc8;return function(_0x2977a9){if(_0x2977a9){return _0x39e1d0[_0x7a81('0x1a')](_0xd1e099)[_0x7a81('0x1b')](_0x2977a9);}};}function respondWithFilteredResult(_0x2487fd,_0x54507c){return function(_0x4aef24){if(_0x4aef24){var _0x1ce514=_0x4aef24[_0x7a81('0x1c')],_0x208a7b=_0x54507c[_0x7a81('0x1d')],_0x584c0c=_0x54507c[_0x7a81('0x1d')]+_0x54507c[_0x7a81('0x1e')],_0x1fad3;if(_0x584c0c>=_0x1ce514){_0x584c0c=_0x1ce514;_0x1fad3=0xc8;}else{_0x1fad3=0xce;}_0x2487fd[_0x7a81('0x1a')](_0x1fad3);return _0x2487fd[_0x7a81('0x1f')](_0x7a81('0x20'),_0x208a7b+'-'+_0x584c0c+'/'+_0x1ce514)[_0x7a81('0x1b')](_0x4aef24);}return null;};}function patchUpdates(_0x220da9){return function(_0x3c3c59){try{jsonpatch[_0x7a81('0x21')](_0x3c3c59,_0x220da9,!![]);}catch(_0x1aefdf){return BPromise['reject'](_0x1aefdf);}return _0x3c3c59[_0x7a81('0x22')]();};}function saveUpdates(_0x3b17cd,_0x2c714c){return function(_0x3087c0){if(_0x3087c0){return _0x3087c0[_0x7a81('0x23')](_0x3b17cd)[_0x7a81('0x24')](function(_0x34dd0b){return _0x34dd0b;});}return null;};}function removeEntity(_0x374f02,_0x177301){return function(_0x596a8c){if(_0x596a8c){return _0x596a8c[_0x7a81('0x25')]()[_0x7a81('0x24')](function(){_0x374f02[_0x7a81('0x1a')](0xcc)[_0x7a81('0x26')]();});}};}function handleEntityNotFound(_0x26556b,_0x15a1cd){return function(_0x249ae1){if(!_0x249ae1){_0x26556b[_0x7a81('0x19')](0x194);}return _0x249ae1;};}function handleError(_0x5ac0ae,_0x434b37){_0x434b37=_0x434b37||0x1f4;return function(_0x574208){logger['error'](_0x574208[_0x7a81('0x27')]);if(_0x574208[_0x7a81('0x28')]){delete _0x574208[_0x7a81('0x28')];}_0x5ac0ae['status'](_0x434b37)[_0x7a81('0x29')](_0x574208);};}exports[_0x7a81('0x2a')]=function(_0x87e708,_0x2d49ed){var _0x16ea00={'raw':!![]},_0x507276={},_0x38de7c={'count':0x0,'rows':[]};var _0x33ac1f=db[_0x7a81('0x2b')][_0x7a81('0x2c')];_0x507276[_0x7a81('0x2d')]=_[_0x7a81('0x2e')](_0x33ac1f);_0x507276[_0x7a81('0x2f')]=_['keys'](_0x87e708[_0x7a81('0x2f')]);_0x507276['filters']=_[_0x7a81('0x30')](_0x507276[_0x7a81('0x2d')],_0x507276[_0x7a81('0x2f')]);_0x16ea00['attributes']=_[_0x7a81('0x30')](_0x507276['model'],qs['fields'](_0x87e708[_0x7a81('0x2f')][_0x7a81('0x31')]));_0x16ea00[_0x7a81('0x32')]=_0x16ea00[_0x7a81('0x32')][_0x7a81('0x33')]?_0x16ea00['attributes']:_0x507276[_0x7a81('0x2d')];if(!_0x87e708[_0x7a81('0x2f')][_0x7a81('0x34')](_0x7a81('0x35'))){_0x16ea00[_0x7a81('0x1e')]=qs[_0x7a81('0x1e')](_0x87e708[_0x7a81('0x2f')]['limit']);_0x16ea00[_0x7a81('0x1d')]=qs[_0x7a81('0x1d')](_0x87e708[_0x7a81('0x2f')]['offset']);}_0x16ea00[_0x7a81('0x36')]=qs[_0x7a81('0x37')](_0x87e708[_0x7a81('0x2f')][_0x7a81('0x37')]);_0x16ea00['where']=qs[_0x7a81('0x38')](_[_0x7a81('0x39')](_0x87e708[_0x7a81('0x2f')],_0x507276[_0x7a81('0x38')]));if(_0x87e708[_0x7a81('0x2f')]['filter']){_0x16ea00[_0x7a81('0x3a')]=_[_0x7a81('0x3b')](_0x16ea00[_0x7a81('0x3a')],{'$or':_[_0x7a81('0x3c')](_0x33ac1f,function(_0x23a747){if(_0x23a747[_0x7a81('0x3d')][_0x7a81('0x3e')]!=='VIRTUAL'){var _0x51acd1={};_0x51acd1[_0x23a747[_0x7a81('0x3f')]]={'$like':'%'+_0x87e708[_0x7a81('0x2f')]['filter']+'%'};return _0x51acd1;}})});}_0x16ea00=_[_0x7a81('0x3b')]({},_0x16ea00,_0x87e708[_0x7a81('0x40')]);var _0x1d128c={'where':_0x16ea00['where']};return db[_0x7a81('0x2b')][_0x7a81('0x1c')](_0x1d128c)['then'](function(_0x287478){_0x38de7c[_0x7a81('0x1c')]=_0x287478;if(_0x87e708[_0x7a81('0x2f')]['includeAll']){_0x16ea00[_0x7a81('0x41')]=[{'all':!![]}];}return db[_0x7a81('0x2b')]['findAll'](_0x16ea00);})[_0x7a81('0x24')](function(_0x315db1){_0x38de7c[_0x7a81('0x42')]=_0x315db1;return _0x38de7c;})[_0x7a81('0x24')](respondWithFilteredResult(_0x2d49ed,_0x16ea00))[_0x7a81('0x43')](handleError(_0x2d49ed,null));};exports[_0x7a81('0x44')]=function(_0x4723ea,_0x49759c){var _0x4e3430={'raw':!![],'where':{'id':_0x4723ea[_0x7a81('0x45')]['id']}},_0x180fe7={};_0x180fe7[_0x7a81('0x2d')]=_[_0x7a81('0x2e')](db[_0x7a81('0x2b')][_0x7a81('0x2c')]);_0x180fe7[_0x7a81('0x2f')]=_[_0x7a81('0x2e')](_0x4723ea[_0x7a81('0x2f')]);_0x180fe7['filters']=_[_0x7a81('0x30')](_0x180fe7[_0x7a81('0x2d')],_0x180fe7['query']);_0x4e3430[_0x7a81('0x32')]=_['intersection'](_0x180fe7['model'],qs[_0x7a81('0x31')](_0x4723ea[_0x7a81('0x2f')][_0x7a81('0x31')]));_0x4e3430[_0x7a81('0x32')]=_0x4e3430[_0x7a81('0x32')][_0x7a81('0x33')]?_0x4e3430[_0x7a81('0x32')]:_0x180fe7[_0x7a81('0x2d')];if(_0x4723ea[_0x7a81('0x2f')][_0x7a81('0x46')]){_0x4e3430[_0x7a81('0x41')]=[{'all':!![]}];}_0x4e3430=_[_0x7a81('0x3b')]({},_0x4e3430,_0x4723ea[_0x7a81('0x40')]);return db['SASalesCondition'][_0x7a81('0x47')](_0x4e3430)[_0x7a81('0x24')](handleEntityNotFound(_0x49759c,null))[_0x7a81('0x24')](respondWithResult(_0x49759c,null))[_0x7a81('0x43')](handleError(_0x49759c,null));};exports[_0x7a81('0x48')]=function(_0x5090a5,_0x136906){return db[_0x7a81('0x2b')][_0x7a81('0x48')](_0x5090a5['body'],{})[_0x7a81('0x24')](respondWithResult(_0x136906,0xc9))[_0x7a81('0x43')](handleError(_0x136906,null));}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.model.js b/server/api/saSalesCondition/saSalesCondition.model.js index 4c0ce82..1c88383 100644 --- a/server/api/saSalesCondition/saSalesCondition.model.js +++ b/server/api/saSalesCondition/saSalesCondition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fa2=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','SASalesCondition','sa_sales_conditions'];(function(_0x385cac,_0x196617){var _0xc0e067=function(_0x1bd36f){while(--_0x1bd36f){_0x385cac['push'](_0x385cac['shift']());}};_0xc0e067(++_0x196617);}(_0x8fa2,0x1d6));var _0x28fa=function(_0x1621f3,_0x58795a){_0x1621f3=_0x1621f3-0x0;var _0x315c7d=_0x8fa2[_0x1621f3];return _0x315c7d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28fa('0x0'))(_0x28fa('0x1'));var moment=require('moment');var BPromise=require(_0x28fa('0x2'));var rp=require(_0x28fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28fa('0x4'));var config=require(_0x28fa('0x5'));var attributes=require('./saSalesCondition.attributes');module[_0x28fa('0x6')]=function(_0x52eea2,_0x1c4827){return _0x52eea2[_0x28fa('0x7')](_0x28fa('0x8'),attributes,{'tableName':_0x28fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16ad=['exports','SASalesCondition','sa_sales_conditions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x480f88,_0x583497){var _0xe1152b=function(_0x416d0f){while(--_0x416d0f){_0x480f88['push'](_0x480f88['shift']());}};_0xe1152b(++_0x583497);}(_0x16ad,0xbe));var _0xd16a=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0x16ad[_0x2673a4];return _0x5e3a6a;};'use strict';var _=require(_0xd16a('0x0'));var util=require(_0xd16a('0x1'));var logger=require(_0xd16a('0x2'))('api');var moment=require(_0xd16a('0x3'));var BPromise=require(_0xd16a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd16a('0x5'));var rimraf=require(_0xd16a('0x6'));var config=require(_0xd16a('0x7'));var attributes=require('./saSalesCondition.attributes');module[_0xd16a('0x8')]=function(_0xaa9dc2,_0x2d9f8e){return _0xaa9dc2['define'](_0xd16a('0x9'),attributes,{'tableName':_0xd16a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.rpc.js b/server/api/saSalesCondition/saSalesCondition.rpc.js index f0225ae..0a8685e 100644 --- a/server/api/saSalesCondition/saSalesCondition.rpc.js +++ b/server/api/saSalesCondition/saSalesCondition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4315=['then','info','request\x20sent','SASalesCondition,\x20%s,\x20%s,\x20%s','stringify','error','code','SASalesCondition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4093d3,_0x2e2841){var _0x9cc73a=function(_0x261217){while(--_0x261217){_0x4093d3['push'](_0x4093d3['shift']());}};_0x9cc73a(++_0x2e2841);}(_0x4315,0xbb));var _0x5431=function(_0x25b274,_0x578748){_0x25b274=_0x25b274-0x0;var _0x367046=_0x4315[_0x25b274];return _0x367046;};'use strict';var _=require(_0x5431('0x0'));var util=require(_0x5431('0x1'));var moment=require(_0x5431('0x2'));var BPromise=require('bluebird');var rs=require(_0x5431('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5431('0x4'));var logger=require(_0x5431('0x5'))(_0x5431('0x6'));var config=require(_0x5431('0x7'));var jayson=require(_0x5431('0x8'));var client=jayson[_0x5431('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab30a,_0x4b7aec,_0x401a95){return new BPromise(function(_0x124be9,_0x4cefae){return client[_0x5431('0xa')](_0x3ab30a,_0x401a95)[_0x5431('0xb')](function(_0x2a28eb){logger[_0x5431('0xc')]('SASalesCondition,\x20%s,\x20%s',_0x4b7aec,_0x5431('0xd'));logger['debug'](_0x5431('0xe'),_0x4b7aec,_0x5431('0xd'),JSON[_0x5431('0xf')](_0x2a28eb));if(_0x2a28eb[_0x5431('0x10')]){if(_0x2a28eb[_0x5431('0x10')][_0x5431('0x11')]===0x1f4){logger[_0x5431('0x10')](_0x5431('0x12'),_0x4b7aec,_0x2a28eb[_0x5431('0x10')][_0x5431('0x13')]);return _0x4cefae(_0x2a28eb[_0x5431('0x10')][_0x5431('0x13')]);}logger['error']('SASalesCondition,\x20%s,\x20%s',_0x4b7aec,_0x2a28eb[_0x5431('0x10')]['message']);return _0x124be9(_0x2a28eb[_0x5431('0x10')]['message']);}else{logger[_0x5431('0xc')](_0x5431('0x12'),_0x4b7aec,_0x5431('0xd'));_0x124be9(_0x2a28eb[_0x5431('0x14')][_0x5431('0x13')]);}})[_0x5431('0x15')](function(_0x424b11){logger[_0x5431('0x10')]('SASalesCondition,\x20%s,\x20%s',_0x4b7aec,_0x424b11);_0x4cefae(_0x424b11);});});} \ No newline at end of file +var _0x8384=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','SASalesCondition,\x20%s,\x20%s','request\x20sent','debug','SASalesCondition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x232658,_0x58f7f6){var _0x872c12=function(_0x3a2d80){while(--_0x3a2d80){_0x232658['push'](_0x232658['shift']());}};_0x872c12(++_0x58f7f6);}(_0x8384,0x14c));var _0x4838=function(_0x215797,_0x49d505){_0x215797=_0x215797-0x0;var _0x4a3697=_0x8384[_0x215797];return _0x4a3697;};'use strict';var _=require(_0x4838('0x0'));var util=require('util');var moment=require(_0x4838('0x1'));var BPromise=require(_0x4838('0x2'));var rs=require(_0x4838('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4838('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4838('0x5'));var config=require(_0x4838('0x6'));var jayson=require(_0x4838('0x7'));var client=jayson[_0x4838('0x8')][_0x4838('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dd419,_0x3ba74d,_0x110da8){return new BPromise(function(_0x1f4db6,_0x348cab){return client['request'](_0x2dd419,_0x110da8)['then'](function(_0x1075d7){logger[_0x4838('0xa')](_0x4838('0xb'),_0x3ba74d,_0x4838('0xc'));logger[_0x4838('0xd')](_0x4838('0xe'),_0x3ba74d,_0x4838('0xc'),JSON[_0x4838('0xf')](_0x1075d7));if(_0x1075d7['error']){if(_0x1075d7[_0x4838('0x10')][_0x4838('0x11')]===0x1f4){logger['error'](_0x4838('0xb'),_0x3ba74d,_0x1075d7[_0x4838('0x10')][_0x4838('0x12')]);return _0x348cab(_0x1075d7[_0x4838('0x10')]['message']);}logger[_0x4838('0x10')]('SASalesCondition,\x20%s,\x20%s',_0x3ba74d,_0x1075d7['error']['message']);return _0x1f4db6(_0x1075d7[_0x4838('0x10')]['message']);}else{logger['info']('SASalesCondition,\x20%s,\x20%s',_0x3ba74d,_0x4838('0xc'));_0x1f4db6(_0x1075d7[_0x4838('0x13')][_0x4838('0x12')]);}})[_0x4838('0x14')](function(_0x32f42f){logger[_0x4838('0x10')]('SASalesCondition,\x20%s,\x20%s',_0x3ba74d,_0x32f42f);_0x348cab(_0x32f42f);});});} \ No newline at end of file diff --git a/server/api/saTypeProduct/index.js b/server/api/saTypeProduct/index.js index 1ee9791..37c55c3 100644 --- a/server/api/saTypeProduct/index.js +++ b/server/api/saTypeProduct/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4209=['update','delete','/:id','destroy','exports','multer','connect-timeout','express','../../config/environment','./saTypeProduct.controller','get','index','isAuthenticated','show','create','put'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4209,0x155));var _0x9420=function(_0x4c4cbf,_0x1e6e6){_0x4c4cbf=_0x4c4cbf-0x0;var _0xa65774=_0x4209[_0x4c4cbf];return _0xa65774;};'use strict';var multer=require(_0x9420('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9420('0x1'));var express=require(_0x9420('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9420('0x3'));var controller=require(_0x9420('0x4'));router[_0x9420('0x5')]('/',auth['isAuthenticated'](),controller[_0x9420('0x6')]);router[_0x9420('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9420('0x5')]('/:id',auth[_0x9420('0x7')](),controller[_0x9420('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9420('0x9')]);router[_0x9420('0xa')]('/:id',auth[_0x9420('0x7')](),controller[_0x9420('0xb')]);router[_0x9420('0xc')](_0x9420('0xd'),auth[_0x9420('0x7')](),controller[_0x9420('0xe')]);module[_0x9420('0xf')]=router; \ No newline at end of file +var _0x065f=['../../config/environment','get','index','/describe','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service'];(function(_0x537fce,_0x9907dc){var _0x1c6fc3=function(_0x54627b){while(--_0x54627b){_0x537fce['push'](_0x537fce['shift']());}};_0x1c6fc3(++_0x9907dc);}(_0x065f,0x1a4));var _0xf065=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x065f[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xf065('0x0'));var util=require(_0xf065('0x1'));var path=require(_0xf065('0x2'));var timeout=require('connect-timeout');var express=require(_0xf065('0x3'));var router=express['Router']();var auth=require(_0xf065('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf065('0x5'));var controller=require('./saTypeProduct.controller');router[_0xf065('0x6')]('/',auth['isAuthenticated'](),controller[_0xf065('0x7')]);router[_0xf065('0x6')](_0xf065('0x8'),auth[_0xf065('0x9')](),controller['describe']);router['get'](_0xf065('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf065('0x9')](),controller[_0xf065('0xb')]);router[_0xf065('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xf065('0xd')]);router[_0xf065('0xe')]('/:id',auth[_0xf065('0x9')](),controller[_0xf065('0xf')]);module[_0xf065('0x10')]=router; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.attributes.js b/server/api/saTypeProduct/saTypeProduct.attributes.js index e96798c..36dc39c 100644 --- a/server/api/saTypeProduct/saTypeProduct.attributes.js +++ b/server/api/saTypeProduct/saTypeProduct.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6251=['STRING','exports'];(function(_0x5949ad,_0x58a438){var _0x26ef21=function(_0x36b337){while(--_0x36b337){_0x5949ad['push'](_0x5949ad['shift']());}};_0x26ef21(++_0x58a438);}(_0x6251,0x85));var _0x1625=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0x6251[_0x4801a0];return _0x338e26;};'use strict';var Sequelize=require('sequelize');module[_0x1625('0x0')]={'name':{'type':Sequelize[_0x1625('0x1')],'allowNull':![],'unique':'name'}}; \ No newline at end of file +var _0x29cb=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29cb,0x107));var _0xb29c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x29cb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xb29c('0x0'));module[_0xb29c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'}}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.controller.js b/server/api/saTypeProduct/saTypeProduct.controller.js index 221dec5..972bb60 100644 --- a/server/api/saTypeProduct/saTypeProduct.controller.js +++ b/server/api/saTypeProduct/saTypeProduct.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xceb5=['to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','SATypeProduct','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','includeAll','catch','show','params','fields','length','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3a01c1,_0x116056){var _0xc6fb88=function(_0x57c9fa){while(--_0x57c9fa){_0x3a01c1['push'](_0x3a01c1['shift']());}};_0xc6fb88(++_0x116056);}(_0xceb5,0x1f4));var _0x5ceb=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xceb5[_0x1406ae];return _0x23a076;};'use strict';var pdf=require(_0x5ceb('0x0'));var emlformat=require(_0x5ceb('0x1'));var rimraf=require(_0x5ceb('0x2'));var zipdir=require(_0x5ceb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ceb('0x4'));var moment=require(_0x5ceb('0x5'));var BPromise=require(_0x5ceb('0x6'));var Mustache=require(_0x5ceb('0x7'));var util=require(_0x5ceb('0x8'));var path=require(_0x5ceb('0x9'));var sox=require(_0x5ceb('0xa'));var csv=require(_0x5ceb('0xb'));var ejs=require(_0x5ceb('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ceb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ceb('0xe'));var Papa=require(_0x5ceb('0xf'));var Redis=require(_0x5ceb('0x10'));var authService=require(_0x5ceb('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5ceb('0x12'));var logger=require(_0x5ceb('0x13'))(_0x5ceb('0x14'));var utils=require(_0x5ceb('0x15'));var config=require(_0x5ceb('0x16'));var db=require(_0x5ceb('0x17'))['db'];function respondWithStatusCode(_0x56f345,_0x234759){_0x234759=_0x234759||0xcc;return function(_0x2556ad){if(_0x2556ad){return _0x56f345[_0x5ceb('0x18')](_0x234759);}return _0x56f345[_0x5ceb('0x19')](_0x234759)[_0x5ceb('0x1a')]();};}function respondWithResult(_0x30bc20,_0x414f17){_0x414f17=_0x414f17||0xc8;return function(_0x1835aa){if(_0x1835aa){return _0x30bc20['status'](_0x414f17)[_0x5ceb('0x1b')](_0x1835aa);}};}function respondWithFilteredResult(_0x216cbf,_0x11e893){return function(_0x2200b1){if(_0x2200b1){var _0x41d6c3=_0x2200b1[_0x5ceb('0x1c')],_0x29a384=_0x11e893[_0x5ceb('0x1d')],_0x38b15f=_0x11e893[_0x5ceb('0x1d')]+_0x11e893[_0x5ceb('0x1e')],_0x328d2a;if(_0x38b15f>=_0x41d6c3){_0x38b15f=_0x41d6c3;_0x328d2a=0xc8;}else{_0x328d2a=0xce;}_0x216cbf[_0x5ceb('0x19')](_0x328d2a);return _0x216cbf[_0x5ceb('0x1f')](_0x5ceb('0x20'),_0x29a384+'-'+_0x38b15f+'/'+_0x41d6c3)['json'](_0x2200b1);}return null;};}function patchUpdates(_0x2cea16){return function(_0x5cb294){try{jsonpatch[_0x5ceb('0x21')](_0x5cb294,_0x2cea16,!![]);}catch(_0x782ef){return BPromise[_0x5ceb('0x22')](_0x782ef);}return _0x5cb294['save']();};}function saveUpdates(_0x1db4d7,_0xf1338a){return function(_0x79c151){if(_0x79c151){return _0x79c151[_0x5ceb('0x23')](_0x1db4d7)[_0x5ceb('0x24')](function(_0x5910c1){return _0x5910c1;});}return null;};}function removeEntity(_0x4dd255,_0x2efe14){return function(_0x44dd8b){if(_0x44dd8b){return _0x44dd8b[_0x5ceb('0x25')]()[_0x5ceb('0x24')](function(){_0x4dd255[_0x5ceb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2443cd,_0x2facb9){return function(_0x4ac2cb){if(!_0x4ac2cb){_0x2443cd[_0x5ceb('0x18')](0x194);}return _0x4ac2cb;};}function handleError(_0xfe8f6e,_0x30f23e){_0x30f23e=_0x30f23e||0x1f4;return function(_0x1b904e){logger[_0x5ceb('0x26')](_0x1b904e[_0x5ceb('0x27')]);if(_0x1b904e['name']){delete _0x1b904e[_0x5ceb('0x28')];}_0xfe8f6e[_0x5ceb('0x19')](_0x30f23e)['send'](_0x1b904e);};}exports['index']=function(_0xab5abf,_0x1eaa69){var _0x4dc152={},_0x5970e6={},_0x3a338b={'count':0x0,'rows':[]};var _0x3e520c=db[_0x5ceb('0x29')][_0x5ceb('0x2a')];_0x5970e6[_0x5ceb('0x2b')]=_[_0x5ceb('0x2c')](_0x3e520c);_0x5970e6[_0x5ceb('0x2d')]=_[_0x5ceb('0x2c')](_0xab5abf['query']);_0x5970e6[_0x5ceb('0x2e')]=_[_0x5ceb('0x2f')](_0x5970e6['model'],_0x5970e6[_0x5ceb('0x2d')]);_0x4dc152[_0x5ceb('0x30')]=_[_0x5ceb('0x2f')](_0x5970e6[_0x5ceb('0x2b')],qs['fields'](_0xab5abf[_0x5ceb('0x2d')]['fields']));_0x4dc152[_0x5ceb('0x30')]=_0x4dc152[_0x5ceb('0x30')]['length']?_0x4dc152[_0x5ceb('0x30')]:_0x5970e6[_0x5ceb('0x2b')];if(!_0xab5abf[_0x5ceb('0x2d')][_0x5ceb('0x31')](_0x5ceb('0x32'))){_0x4dc152['limit']=qs[_0x5ceb('0x1e')](_0xab5abf['query'][_0x5ceb('0x1e')]);_0x4dc152[_0x5ceb('0x1d')]=qs['offset'](_0xab5abf[_0x5ceb('0x2d')][_0x5ceb('0x1d')]);}_0x4dc152[_0x5ceb('0x33')]=qs[_0x5ceb('0x34')](_0xab5abf[_0x5ceb('0x2d')][_0x5ceb('0x34')]);_0x4dc152['where']=qs['filters'](_['pick'](_0xab5abf[_0x5ceb('0x2d')],_0x5970e6['filters']));if(_0xab5abf[_0x5ceb('0x2d')]['filter']){_0x4dc152[_0x5ceb('0x35')]=_[_0x5ceb('0x36')](_0x4dc152['where'],{'$or':_[_0x5ceb('0x37')](_0x3e520c,function(_0x3537a3){if(_0x3537a3[_0x5ceb('0x38')][_0x5ceb('0x39')]!==_0x5ceb('0x3a')){var _0x476b97={};_0x476b97[_0x3537a3[_0x5ceb('0x3b')]]={'$like':'%'+_0xab5abf[_0x5ceb('0x2d')][_0x5ceb('0x3c')]+'%'};return _0x476b97;}})});}_0x4dc152=_[_0x5ceb('0x36')]({},_0x4dc152,_0xab5abf['options']);var _0x4ad78b={'where':_0x4dc152[_0x5ceb('0x35')]};return db['SATypeProduct'][_0x5ceb('0x1c')](_0x4ad78b)[_0x5ceb('0x24')](function(_0x354ab8){_0x3a338b[_0x5ceb('0x1c')]=_0x354ab8;if(_0xab5abf[_0x5ceb('0x2d')][_0x5ceb('0x3d')]){_0x4dc152['include']=[{'all':!![]}];}return db[_0x5ceb('0x29')]['findAll'](_0x4dc152);})['then'](function(_0x4ab558){_0x3a338b['rows']=_0x4ab558;return _0x3a338b;})[_0x5ceb('0x24')](respondWithFilteredResult(_0x1eaa69,_0x4dc152))[_0x5ceb('0x3e')](handleError(_0x1eaa69,null));};exports[_0x5ceb('0x3f')]=function(_0x4b54a3,_0x2212f1){var _0x2a264a={'raw':![],'where':{'id':_0x4b54a3[_0x5ceb('0x40')]['id']}},_0x5e7a51={};_0x5e7a51[_0x5ceb('0x2b')]=_[_0x5ceb('0x2c')](db[_0x5ceb('0x29')][_0x5ceb('0x2a')]);_0x5e7a51['query']=_[_0x5ceb('0x2c')](_0x4b54a3[_0x5ceb('0x2d')]);_0x5e7a51[_0x5ceb('0x2e')]=_[_0x5ceb('0x2f')](_0x5e7a51[_0x5ceb('0x2b')],_0x5e7a51['query']);_0x2a264a[_0x5ceb('0x30')]=_[_0x5ceb('0x2f')](_0x5e7a51['model'],qs['fields'](_0x4b54a3[_0x5ceb('0x2d')][_0x5ceb('0x41')]));_0x2a264a[_0x5ceb('0x30')]=_0x2a264a[_0x5ceb('0x30')][_0x5ceb('0x42')]?_0x2a264a[_0x5ceb('0x30')]:_0x5e7a51[_0x5ceb('0x2b')];if(_0x4b54a3['query'][_0x5ceb('0x3d')]){_0x2a264a[_0x5ceb('0x43')]=[{'all':!![]}];}_0x2a264a=_[_0x5ceb('0x36')]({},_0x2a264a,_0x4b54a3[_0x5ceb('0x44')]);return db['SATypeProduct'][_0x5ceb('0x45')](_0x2a264a)[_0x5ceb('0x24')](handleEntityNotFound(_0x2212f1,null))[_0x5ceb('0x24')](respondWithResult(_0x2212f1,null))['catch'](handleError(_0x2212f1,null));};exports[_0x5ceb('0x46')]=function(_0x266f78,_0x339a72){return db[_0x5ceb('0x29')][_0x5ceb('0x46')](_0x266f78[_0x5ceb('0x47')],{})[_0x5ceb('0x24')](respondWithResult(_0x339a72,0xc9))[_0x5ceb('0x3e')](handleError(_0x339a72,null));};exports[_0x5ceb('0x23')]=function(_0x592e7e,_0xaf521a){if(_0x592e7e[_0x5ceb('0x47')]['id']){delete _0x592e7e['body']['id'];}return db[_0x5ceb('0x29')][_0x5ceb('0x45')]({'where':{'id':_0x592e7e[_0x5ceb('0x40')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0xaf521a,null))[_0x5ceb('0x24')](saveUpdates(_0x592e7e['body'],null))[_0x5ceb('0x24')](respondWithResult(_0xaf521a,null))[_0x5ceb('0x3e')](handleError(_0xaf521a,null));};exports[_0x5ceb('0x25')]=function(_0x5c95cf,_0x36cb10){return db[_0x5ceb('0x29')][_0x5ceb('0x45')]({'where':{'id':_0x5c95cf[_0x5ceb('0x40')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x36cb10,null))['then'](removeEntity(_0x36cb10,null))['catch'](handleError(_0x36cb10,null));};exports[_0x5ceb('0x48')]=function(_0x5d2fc5,_0x52aa78){return db[_0x5ceb('0x29')][_0x5ceb('0x48')]()[_0x5ceb('0x24')](respondWithResult(_0x52aa78,null))['catch'](handleError(_0x52aa78,null));}; \ No newline at end of file +var _0xa7a9=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','stack','name','send','SATypeProduct','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa7a9,0xcb));var _0x9a7a=function(_0x1a6671,_0x906d53){_0x1a6671=_0x1a6671-0x0;var _0x30b248=_0xa7a9[_0x1a6671];return _0x30b248;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a7a('0x0'));var rimraf=require(_0x9a7a('0x1'));var zipdir=require(_0x9a7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a7a('0x3'));var moment=require('moment');var BPromise=require(_0x9a7a('0x4'));var Mustache=require(_0x9a7a('0x5'));var util=require(_0x9a7a('0x6'));var path=require(_0x9a7a('0x7'));var sox=require(_0x9a7a('0x8'));var csv=require(_0x9a7a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9a7a('0xa'));var squel=require('squel');var crypto=require(_0x9a7a('0xb'));var jsforce=require(_0x9a7a('0xc'));var deskjs=require(_0x9a7a('0xd'));var toCsv=require(_0x9a7a('0x9'));var querystring=require(_0x9a7a('0xe'));var Papa=require(_0x9a7a('0xf'));var Redis=require('ioredis');var authService=require(_0x9a7a('0x10'));var qs=require(_0x9a7a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9a7a('0x12'));var utils=require(_0x9a7a('0x13'));var config=require(_0x9a7a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bb8af,_0x304586){_0x304586=_0x304586||0xcc;return function(_0x11bf31){if(_0x11bf31){return _0x2bb8af[_0x9a7a('0x15')](_0x304586);}return _0x2bb8af[_0x9a7a('0x16')](_0x304586)[_0x9a7a('0x17')]();};}function respondWithResult(_0x2997a8,_0xa3f9c4){_0xa3f9c4=_0xa3f9c4||0xc8;return function(_0x5e1a50){if(_0x5e1a50){return _0x2997a8['status'](_0xa3f9c4)[_0x9a7a('0x18')](_0x5e1a50);}};}function respondWithFilteredResult(_0xcae8e6,_0x4c3920){return function(_0x931c2d){if(_0x931c2d){var _0x133945=_0x931c2d[_0x9a7a('0x19')],_0x9f233f=_0x4c3920[_0x9a7a('0x1a')],_0x16f73f=_0x4c3920[_0x9a7a('0x1a')]+_0x4c3920[_0x9a7a('0x1b')],_0x5f0e20;if(_0x16f73f>=_0x133945){_0x16f73f=_0x133945;_0x5f0e20=0xc8;}else{_0x5f0e20=0xce;}_0xcae8e6[_0x9a7a('0x16')](_0x5f0e20);return _0xcae8e6[_0x9a7a('0x1c')]('Content-Range',_0x9f233f+'-'+_0x16f73f+'/'+_0x133945)[_0x9a7a('0x18')](_0x931c2d);}return null;};}function patchUpdates(_0x3010a7){return function(_0x325777){try{jsonpatch['apply'](_0x325777,_0x3010a7,!![]);}catch(_0x406bc9){return BPromise['reject'](_0x406bc9);}return _0x325777[_0x9a7a('0x1d')]();};}function saveUpdates(_0x4dc6b4,_0x219a00){return function(_0x4d1de1){if(_0x4d1de1){return _0x4d1de1[_0x9a7a('0x1e')](_0x4dc6b4)[_0x9a7a('0x1f')](function(_0x2f677c){return _0x2f677c;});}return null;};}function removeEntity(_0x43ac0e,_0x9cda44){return function(_0x4ca1cc){if(_0x4ca1cc){return _0x4ca1cc[_0x9a7a('0x20')]()[_0x9a7a('0x1f')](function(){_0x43ac0e[_0x9a7a('0x16')](0xcc)[_0x9a7a('0x17')]();});}};}function handleEntityNotFound(_0x4cf490,_0x4823e7){return function(_0x2f7841){if(!_0x2f7841){_0x4cf490[_0x9a7a('0x15')](0x194);}return _0x2f7841;};}function handleError(_0xa6409,_0x3b7610){_0x3b7610=_0x3b7610||0x1f4;return function(_0x2c194a){logger['error'](_0x2c194a[_0x9a7a('0x21')]);if(_0x2c194a[_0x9a7a('0x22')]){delete _0x2c194a['name'];}_0xa6409[_0x9a7a('0x16')](_0x3b7610)[_0x9a7a('0x23')](_0x2c194a);};}exports['index']=function(_0x5ed721,_0x1eb173){var _0x3e9d9d={},_0xc73831={},_0x4f4540={'count':0x0,'rows':[]};var _0x5d03ab=db[_0x9a7a('0x24')]['rawAttributes'];_0xc73831[_0x9a7a('0x25')]=_[_0x9a7a('0x26')](_0x5d03ab);_0xc73831[_0x9a7a('0x27')]=_[_0x9a7a('0x26')](_0x5ed721[_0x9a7a('0x27')]);_0xc73831[_0x9a7a('0x28')]=_['intersection'](_0xc73831[_0x9a7a('0x25')],_0xc73831[_0x9a7a('0x27')]);_0x3e9d9d[_0x9a7a('0x29')]=_[_0x9a7a('0x2a')](_0xc73831[_0x9a7a('0x25')],qs[_0x9a7a('0x2b')](_0x5ed721[_0x9a7a('0x27')]['fields']));_0x3e9d9d[_0x9a7a('0x29')]=_0x3e9d9d[_0x9a7a('0x29')][_0x9a7a('0x2c')]?_0x3e9d9d[_0x9a7a('0x29')]:_0xc73831['model'];if(!_0x5ed721[_0x9a7a('0x27')][_0x9a7a('0x2d')](_0x9a7a('0x2e'))){_0x3e9d9d[_0x9a7a('0x1b')]=qs[_0x9a7a('0x1b')](_0x5ed721[_0x9a7a('0x27')]['limit']);_0x3e9d9d['offset']=qs['offset'](_0x5ed721[_0x9a7a('0x27')][_0x9a7a('0x1a')]);}_0x3e9d9d[_0x9a7a('0x2f')]=qs[_0x9a7a('0x30')](_0x5ed721[_0x9a7a('0x27')]['sort']);_0x3e9d9d[_0x9a7a('0x31')]=qs[_0x9a7a('0x28')](_[_0x9a7a('0x32')](_0x5ed721[_0x9a7a('0x27')],_0xc73831['filters']));if(_0x5ed721[_0x9a7a('0x27')][_0x9a7a('0x33')]){_0x3e9d9d[_0x9a7a('0x31')]=_['merge'](_0x3e9d9d[_0x9a7a('0x31')],{'$or':_[_0x9a7a('0x34')](_0x5d03ab,function(_0x11ab7a){if(_0x11ab7a[_0x9a7a('0x35')][_0x9a7a('0x36')]!==_0x9a7a('0x37')){var _0x35434c={};_0x35434c[_0x11ab7a[_0x9a7a('0x38')]]={'$like':'%'+_0x5ed721[_0x9a7a('0x27')][_0x9a7a('0x33')]+'%'};return _0x35434c;}})});}_0x3e9d9d=_['merge']({},_0x3e9d9d,_0x5ed721[_0x9a7a('0x39')]);var _0x5c8c29={'where':_0x3e9d9d[_0x9a7a('0x31')]};return db[_0x9a7a('0x24')][_0x9a7a('0x19')](_0x5c8c29)[_0x9a7a('0x1f')](function(_0x1a3393){_0x4f4540[_0x9a7a('0x19')]=_0x1a3393;if(_0x5ed721[_0x9a7a('0x27')][_0x9a7a('0x3a')]){_0x3e9d9d[_0x9a7a('0x3b')]=[{'all':!![]}];}return db['SATypeProduct'][_0x9a7a('0x3c')](_0x3e9d9d);})[_0x9a7a('0x1f')](function(_0x15f8a1){_0x4f4540[_0x9a7a('0x3d')]=_0x15f8a1;return _0x4f4540;})['then'](respondWithFilteredResult(_0x1eb173,_0x3e9d9d))[_0x9a7a('0x3e')](handleError(_0x1eb173,null));};exports[_0x9a7a('0x3f')]=function(_0x4adf39,_0x54e94b){var _0x10fe57={'raw':![],'where':{'id':_0x4adf39[_0x9a7a('0x40')]['id']}},_0x390f81={};_0x390f81['model']=_['keys'](db[_0x9a7a('0x24')][_0x9a7a('0x41')]);_0x390f81[_0x9a7a('0x27')]=_[_0x9a7a('0x26')](_0x4adf39['query']);_0x390f81[_0x9a7a('0x28')]=_[_0x9a7a('0x2a')](_0x390f81[_0x9a7a('0x25')],_0x390f81[_0x9a7a('0x27')]);_0x10fe57['attributes']=_[_0x9a7a('0x2a')](_0x390f81[_0x9a7a('0x25')],qs[_0x9a7a('0x2b')](_0x4adf39[_0x9a7a('0x27')][_0x9a7a('0x2b')]));_0x10fe57[_0x9a7a('0x29')]=_0x10fe57[_0x9a7a('0x29')]['length']?_0x10fe57[_0x9a7a('0x29')]:_0x390f81[_0x9a7a('0x25')];if(_0x4adf39[_0x9a7a('0x27')][_0x9a7a('0x3a')]){_0x10fe57[_0x9a7a('0x3b')]=[{'all':!![]}];}_0x10fe57=_[_0x9a7a('0x42')]({},_0x10fe57,_0x4adf39[_0x9a7a('0x39')]);return db[_0x9a7a('0x24')][_0x9a7a('0x43')](_0x10fe57)[_0x9a7a('0x1f')](handleEntityNotFound(_0x54e94b,null))['then'](respondWithResult(_0x54e94b,null))['catch'](handleError(_0x54e94b,null));};exports[_0x9a7a('0x44')]=function(_0xc55380,_0x22befb){return db[_0x9a7a('0x24')][_0x9a7a('0x44')](_0xc55380[_0x9a7a('0x45')],{})[_0x9a7a('0x1f')](respondWithResult(_0x22befb,0xc9))[_0x9a7a('0x3e')](handleError(_0x22befb,null));};exports[_0x9a7a('0x1e')]=function(_0x4385c9,_0x35919b){if(_0x4385c9[_0x9a7a('0x45')]['id']){delete _0x4385c9[_0x9a7a('0x45')]['id'];}return db[_0x9a7a('0x24')][_0x9a7a('0x43')]({'where':{'id':_0x4385c9['params']['id']}})['then'](handleEntityNotFound(_0x35919b,null))[_0x9a7a('0x1f')](saveUpdates(_0x4385c9[_0x9a7a('0x45')],null))[_0x9a7a('0x1f')](respondWithResult(_0x35919b,null))[_0x9a7a('0x3e')](handleError(_0x35919b,null));};exports[_0x9a7a('0x20')]=function(_0x116119,_0x490ef7){return db['SATypeProduct']['find']({'where':{'id':_0x116119['params']['id']}})['then'](handleEntityNotFound(_0x490ef7,null))['then'](removeEntity(_0x490ef7,null))[_0x9a7a('0x3e')](handleError(_0x490ef7,null));};exports['describe']=function(_0x177571,_0x1c01a8){return db['SATypeProduct'][_0x9a7a('0x46')]()[_0x9a7a('0x1f')](respondWithResult(_0x1c01a8,null))[_0x9a7a('0x3e')](handleError(_0x1c01a8,null));}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.model.js b/server/api/saTypeProduct/saTypeProduct.model.js index 5847f0e..89a2c86 100644 --- a/server/api/saTypeProduct/saTypeProduct.model.js +++ b/server/api/saTypeProduct/saTypeProduct.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8304=['SATypeProduct','sa_type_products','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saTypeProduct.attributes','define'];(function(_0x61872c,_0xc740c0){var _0x3107a4=function(_0x790632){while(--_0x790632){_0x61872c['push'](_0x61872c['shift']());}};_0x3107a4(++_0xc740c0);}(_0x8304,0x16a));var _0x4830=function(_0x1b5fdd,_0x5cf4e5){_0x1b5fdd=_0x1b5fdd-0x0;var _0x234c76=_0x8304[_0x1b5fdd];return _0x234c76;};'use strict';var _=require(_0x4830('0x0'));var util=require('util');var logger=require(_0x4830('0x1'))('api');var moment=require(_0x4830('0x2'));var BPromise=require(_0x4830('0x3'));var rp=require(_0x4830('0x4'));var fs=require('fs');var path=require(_0x4830('0x5'));var rimraf=require(_0x4830('0x6'));var config=require(_0x4830('0x7'));var attributes=require(_0x4830('0x8'));module['exports']=function(_0x16b087,_0x15af8d){return _0x16b087[_0x4830('0x9')](_0x4830('0xa'),attributes,{'tableName':_0x4830('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16a4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./saTypeProduct.attributes','exports','SATypeProduct','lodash','../../config/logger'];(function(_0x20ab0b,_0x371581){var _0x4f1284=function(_0x321861){while(--_0x321861){_0x20ab0b['push'](_0x20ab0b['shift']());}};_0x4f1284(++_0x371581);}(_0x16a4,0x127));var _0x416a=function(_0x156f0c,_0x589d06){_0x156f0c=_0x156f0c-0x0;var _0x446991=_0x16a4[_0x156f0c];return _0x446991;};'use strict';var _=require(_0x416a('0x0'));var util=require('util');var logger=require(_0x416a('0x1'))('api');var moment=require(_0x416a('0x2'));var BPromise=require(_0x416a('0x3'));var rp=require(_0x416a('0x4'));var fs=require('fs');var path=require(_0x416a('0x5'));var rimraf=require(_0x416a('0x6'));var config=require(_0x416a('0x7'));var attributes=require(_0x416a('0x8'));module[_0x416a('0x9')]=function(_0x39ed78,_0xed5bda){return _0x39ed78['define'](_0x416a('0xa'),attributes,{'tableName':'sa_type_products','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.rpc.js b/server/api/saTypeProduct/saTypeProduct.rpc.js index 4886ef3..abccbf4 100644 --- a/server/api/saTypeProduct/saTypeProduct.rpc.js +++ b/server/api/saTypeProduct/saTypeProduct.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf59=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SATypeProduct,\x20%s,\x20%s','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1c7f6f,_0x208f3e){var _0x148a84=function(_0x4bdb76){while(--_0x4bdb76){_0x1c7f6f['push'](_0x1c7f6f['shift']());}};_0x148a84(++_0x208f3e);}(_0xcf59,0x128));var _0x9cf5=function(_0x4dccfb,_0x5c9f92){_0x4dccfb=_0x4dccfb-0x0;var _0x20bc89=_0xcf59[_0x4dccfb];return _0x20bc89;};'use strict';var _=require(_0x9cf5('0x0'));var util=require('util');var moment=require(_0x9cf5('0x1'));var BPromise=require(_0x9cf5('0x2'));var rs=require(_0x9cf5('0x3'));var fs=require('fs');var Redis=require(_0x9cf5('0x4'));var db=require(_0x9cf5('0x5'))['db'];var utils=require(_0x9cf5('0x6'));var logger=require(_0x9cf5('0x7'))(_0x9cf5('0x8'));var config=require(_0x9cf5('0x9'));var jayson=require(_0x9cf5('0xa'));var client=jayson[_0x9cf5('0xb')][_0x9cf5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cdf31,_0x1c72d6,_0x2e391d){return new BPromise(function(_0x3f73ba,_0x10b95a){return client['request'](_0x5cdf31,_0x2e391d)[_0x9cf5('0xd')](function(_0x36474c){logger['info'](_0x9cf5('0xe'),_0x1c72d6,'request\x20sent');logger[_0x9cf5('0xf')](_0x9cf5('0x10'),_0x1c72d6,_0x9cf5('0x11'),JSON[_0x9cf5('0x12')](_0x36474c));if(_0x36474c['error']){if(_0x36474c[_0x9cf5('0x13')][_0x9cf5('0x14')]===0x1f4){logger[_0x9cf5('0x13')](_0x9cf5('0xe'),_0x1c72d6,_0x36474c[_0x9cf5('0x13')][_0x9cf5('0x15')]);return _0x10b95a(_0x36474c[_0x9cf5('0x13')][_0x9cf5('0x15')]);}logger['error'](_0x9cf5('0xe'),_0x1c72d6,_0x36474c[_0x9cf5('0x13')][_0x9cf5('0x15')]);return _0x3f73ba(_0x36474c[_0x9cf5('0x13')][_0x9cf5('0x15')]);}else{logger[_0x9cf5('0x16')](_0x9cf5('0xe'),_0x1c72d6,'request\x20sent');_0x3f73ba(_0x36474c[_0x9cf5('0x17')]['message']);}})[_0x9cf5('0x18')](function(_0x5f44e6){logger[_0x9cf5('0x13')](_0x9cf5('0xe'),_0x1c72d6,_0x5f44e6);_0x10b95a(_0x5f44e6);});});} \ No newline at end of file +var _0x8cb3=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','SATypeProduct,\x20%s,\x20%s','request\x20sent','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x8cb3,0x6c));var _0x38cb=function(_0x108ad8,_0x2c2380){_0x108ad8=_0x108ad8-0x0;var _0x7fc5fa=_0x8cb3[_0x108ad8];return _0x7fc5fa;};'use strict';var _=require(_0x38cb('0x0'));var util=require(_0x38cb('0x1'));var moment=require('moment');var BPromise=require(_0x38cb('0x2'));var rs=require(_0x38cb('0x3'));var fs=require('fs');var Redis=require(_0x38cb('0x4'));var db=require(_0x38cb('0x5'))['db'];var utils=require(_0x38cb('0x6'));var logger=require(_0x38cb('0x7'))(_0x38cb('0x8'));var config=require('../../config/environment');var jayson=require(_0x38cb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5816f7,_0x1186ab,_0x3fd150){return new BPromise(function(_0x55331f,_0x148fbd){return client[_0x38cb('0xa')](_0x5816f7,_0x3fd150)['then'](function(_0x5c94d9){logger[_0x38cb('0xb')](_0x38cb('0xc'),_0x1186ab,_0x38cb('0xd'));logger[_0x38cb('0xe')](_0x38cb('0xf'),_0x1186ab,_0x38cb('0xd'),JSON[_0x38cb('0x10')](_0x5c94d9));if(_0x5c94d9[_0x38cb('0x11')]){if(_0x5c94d9['error']['code']===0x1f4){logger[_0x38cb('0x11')](_0x38cb('0xc'),_0x1186ab,_0x5c94d9[_0x38cb('0x11')][_0x38cb('0x12')]);return _0x148fbd(_0x5c94d9[_0x38cb('0x11')][_0x38cb('0x12')]);}logger['error'](_0x38cb('0xc'),_0x1186ab,_0x5c94d9['error']['message']);return _0x55331f(_0x5c94d9[_0x38cb('0x11')]['message']);}else{logger[_0x38cb('0xb')](_0x38cb('0xc'),_0x1186ab,'request\x20sent');_0x55331f(_0x5c94d9[_0x38cb('0x13')]['message']);}})[_0x38cb('0x14')](function(_0x42756a){logger['error'](_0x38cb('0xc'),_0x1186ab,_0x42756a);_0x148fbd(_0x42756a);});});} \ No newline at end of file diff --git a/server/api/saUnitMeasure/index.js b/server/api/saUnitMeasure/index.js index 42ce89f..8fb781d 100644 --- a/server/api/saUnitMeasure/index.js +++ b/server/api/saUnitMeasure/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6baa=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saUnitMeasure.controller','get','isAuthenticated','/describe','describe','show','post','put','update','delete','/:id','destroy','multer','util'];(function(_0x39ae60,_0x5b6664){var _0x2d8630=function(_0xd71c4e){while(--_0xd71c4e){_0x39ae60['push'](_0x39ae60['shift']());}};_0x2d8630(++_0x5b6664);}(_0x6baa,0x102));var _0xa6ba=function(_0x4975be,_0x77c086){_0x4975be=_0x4975be-0x0;var _0xa10adf=_0x6baa[_0x4975be];return _0xa10adf;};'use strict';var multer=require(_0xa6ba('0x0'));var util=require(_0xa6ba('0x1'));var path=require(_0xa6ba('0x2'));var timeout=require(_0xa6ba('0x3'));var express=require(_0xa6ba('0x4'));var router=express['Router']();var auth=require(_0xa6ba('0x5'));var interaction=require(_0xa6ba('0x6'));var config=require(_0xa6ba('0x7'));var controller=require(_0xa6ba('0x8'));router[_0xa6ba('0x9')]('/',auth[_0xa6ba('0xa')](),controller['index']);router[_0xa6ba('0x9')](_0xa6ba('0xb'),auth[_0xa6ba('0xa')](),controller[_0xa6ba('0xc')]);router[_0xa6ba('0x9')]('/:id',auth[_0xa6ba('0xa')](),controller[_0xa6ba('0xd')]);router[_0xa6ba('0xe')]('/',auth[_0xa6ba('0xa')](),controller['create']);router[_0xa6ba('0xf')]('/:id',auth[_0xa6ba('0xa')](),controller[_0xa6ba('0x10')]);router[_0xa6ba('0x11')](_0xa6ba('0x12'),auth['isAuthenticated'](),controller[_0xa6ba('0x13')]);module['exports']=router; \ No newline at end of file +var _0xedf1=['path','connect-timeout','express','Router','../../components/auth/service','./saUnitMeasure.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x1a66d0,_0x187b54){var _0x5acf3a=function(_0x4249ee){while(--_0x4249ee){_0x1a66d0['push'](_0x1a66d0['shift']());}};_0x5acf3a(++_0x187b54);}(_0xedf1,0x11c));var _0x1edf=function(_0x406301,_0x46a6ff){_0x406301=_0x406301-0x0;var _0x4d7c4b=_0xedf1[_0x406301];return _0x4d7c4b;};'use strict';var multer=require(_0x1edf('0x0'));var util=require('util');var path=require(_0x1edf('0x1'));var timeout=require(_0x1edf('0x2'));var express=require(_0x1edf('0x3'));var router=express[_0x1edf('0x4')]();var auth=require(_0x1edf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1edf('0x6'));router['get']('/',auth[_0x1edf('0x7')](),controller['index']);router[_0x1edf('0x8')](_0x1edf('0x9'),auth[_0x1edf('0x7')](),controller[_0x1edf('0xa')]);router[_0x1edf('0x8')](_0x1edf('0xb'),auth[_0x1edf('0x7')](),controller[_0x1edf('0xc')]);router[_0x1edf('0xd')]('/',auth[_0x1edf('0x7')](),controller['create']);router[_0x1edf('0xe')](_0x1edf('0xb'),auth['isAuthenticated'](),controller[_0x1edf('0xf')]);router[_0x1edf('0x10')](_0x1edf('0xb'),auth['isAuthenticated'](),controller[_0x1edf('0x11')]);module[_0x1edf('0x12')]=router; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.attributes.js b/server/api/saUnitMeasure/saUnitMeasure.attributes.js index 4e5a0dd..86592f8 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.attributes.js +++ b/server/api/saUnitMeasure/saUnitMeasure.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0829=['exports','CHAR','sequelize'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x0829,0xd7));var _0x9082=function(_0x560bac,_0x28a289){_0x560bac=_0x560bac-0x0;var _0xcf7ea2=_0x0829[_0x560bac];return _0xcf7ea2;};'use strict';var Sequelize=require(_0x9082('0x0'));module[_0x9082('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'abbreviation':{'type':Sequelize[_0x9082('0x2')](0x3),'allowNull':![],'unique':'abbreviation'}}; \ No newline at end of file +var _0x9269=['sequelize','STRING','name'];(function(_0x13602c,_0x2e5218){var _0x730ea3=function(_0x2f99ec){while(--_0x2f99ec){_0x13602c['push'](_0x13602c['shift']());}};_0x730ea3(++_0x2e5218);}(_0x9269,0x1d4));var _0x9926=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x9269[_0x46e523];return _0x5da0ee;};'use strict';var Sequelize=require(_0x9926('0x0'));module['exports']={'name':{'type':Sequelize[_0x9926('0x1')],'allowNull':![],'unique':_0x9926('0x2')},'abbreviation':{'type':Sequelize['CHAR'](0x3),'allowNull':![],'unique':'abbreviation'}}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.controller.js b/server/api/saUnitMeasure/saUnitMeasure.controller.js index 3b13ac7..77eedd3 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.controller.js +++ b/server/api/saUnitMeasure/saUnitMeasure.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90f6=['merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','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/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','SAUnitMeasure','rawAttributes','keys','query','filters','attributes','model','fields','length','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field'];(function(_0x1f62de,_0x1ef9c3){var _0x271a2b=function(_0xb914ff){while(--_0xb914ff){_0x1f62de['push'](_0x1f62de['shift']());}};_0x271a2b(++_0x1ef9c3);}(_0x90f6,0xee));var _0x690f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90f6[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x690f('0x0'));var emlformat=require(_0x690f('0x1'));var rimraf=require(_0x690f('0x2'));var zipdir=require(_0x690f('0x3'));var jsonpatch=require(_0x690f('0x4'));var rp=require(_0x690f('0x5'));var moment=require(_0x690f('0x6'));var BPromise=require(_0x690f('0x7'));var Mustache=require(_0x690f('0x8'));var util=require(_0x690f('0x9'));var path=require(_0x690f('0xa'));var sox=require('sox');var csv=require(_0x690f('0xb'));var ejs=require(_0x690f('0xc'));var fs=require('fs');var _=require(_0x690f('0xd'));var squel=require('squel');var crypto=require(_0x690f('0xe'));var jsforce=require(_0x690f('0xf'));var deskjs=require(_0x690f('0x10'));var toCsv=require(_0x690f('0xb'));var querystring=require(_0x690f('0x11'));var Papa=require(_0x690f('0x12'));var Redis=require(_0x690f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x690f('0x14'));var hardwareService=require(_0x690f('0x15'));var logger=require(_0x690f('0x16'))('api');var utils=require(_0x690f('0x17'));var config=require(_0x690f('0x18'));var db=require(_0x690f('0x19'))['db'];function respondWithStatusCode(_0x136256,_0x11d88e){_0x11d88e=_0x11d88e||0xcc;return function(_0x1f5dc1){if(_0x1f5dc1){return _0x136256[_0x690f('0x1a')](_0x11d88e);}return _0x136256['status'](_0x11d88e)[_0x690f('0x1b')]();};}function respondWithResult(_0x35a9fa,_0x947e27){_0x947e27=_0x947e27||0xc8;return function(_0x38de35){if(_0x38de35){return _0x35a9fa[_0x690f('0x1c')](_0x947e27)['json'](_0x38de35);}};}function respondWithFilteredResult(_0x1f246d,_0x478154){return function(_0x2ebaed){if(_0x2ebaed){var _0x3faf4d=_0x2ebaed[_0x690f('0x1d')],_0x123688=_0x478154[_0x690f('0x1e')],_0x4ffe36=_0x478154[_0x690f('0x1e')]+_0x478154[_0x690f('0x1f')],_0x3d6ac7;if(_0x4ffe36>=_0x3faf4d){_0x4ffe36=_0x3faf4d;_0x3d6ac7=0xc8;}else{_0x3d6ac7=0xce;}_0x1f246d[_0x690f('0x1c')](_0x3d6ac7);return _0x1f246d[_0x690f('0x20')](_0x690f('0x21'),_0x123688+'-'+_0x4ffe36+'/'+_0x3faf4d)['json'](_0x2ebaed);}return null;};}function patchUpdates(_0x235ee2){return function(_0x263f89){try{jsonpatch[_0x690f('0x22')](_0x263f89,_0x235ee2,!![]);}catch(_0x412deb){return BPromise['reject'](_0x412deb);}return _0x263f89[_0x690f('0x23')]();};}function saveUpdates(_0x4d4da0,_0x5e505d){return function(_0x1c10a2){if(_0x1c10a2){return _0x1c10a2[_0x690f('0x24')](_0x4d4da0)[_0x690f('0x25')](function(_0x16a687){return _0x16a687;});}return null;};}function removeEntity(_0x36e700,_0x2b59b3){return function(_0x18f580){if(_0x18f580){return _0x18f580[_0x690f('0x26')]()[_0x690f('0x25')](function(){_0x36e700[_0x690f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x484878,_0x319542){return function(_0x5a526f){if(!_0x5a526f){_0x484878[_0x690f('0x1a')](0x194);}return _0x5a526f;};}function handleError(_0x48725d,_0x2f1cb4){_0x2f1cb4=_0x2f1cb4||0x1f4;return function(_0x4c58b1){logger[_0x690f('0x27')](_0x4c58b1['stack']);if(_0x4c58b1['name']){delete _0x4c58b1[_0x690f('0x28')];}_0x48725d['status'](_0x2f1cb4)[_0x690f('0x29')](_0x4c58b1);};}exports[_0x690f('0x2a')]=function(_0x47aaa8,_0x179d7a){var _0x550b5f={},_0x1cd7da={},_0xe0afe2={'count':0x0,'rows':[]};var _0xf8ca16=db[_0x690f('0x2b')][_0x690f('0x2c')];_0x1cd7da['model']=_[_0x690f('0x2d')](_0xf8ca16);_0x1cd7da['query']=_[_0x690f('0x2d')](_0x47aaa8[_0x690f('0x2e')]);_0x1cd7da[_0x690f('0x2f')]=_['intersection'](_0x1cd7da['model'],_0x1cd7da[_0x690f('0x2e')]);_0x550b5f[_0x690f('0x30')]=_['intersection'](_0x1cd7da[_0x690f('0x31')],qs[_0x690f('0x32')](_0x47aaa8[_0x690f('0x2e')][_0x690f('0x32')]));_0x550b5f[_0x690f('0x30')]=_0x550b5f['attributes'][_0x690f('0x33')]?_0x550b5f[_0x690f('0x30')]:_0x1cd7da[_0x690f('0x31')];if(!_0x47aaa8[_0x690f('0x2e')]['hasOwnProperty'](_0x690f('0x34'))){_0x550b5f[_0x690f('0x1f')]=qs[_0x690f('0x1f')](_0x47aaa8[_0x690f('0x2e')][_0x690f('0x1f')]);_0x550b5f[_0x690f('0x1e')]=qs['offset'](_0x47aaa8[_0x690f('0x2e')][_0x690f('0x1e')]);}_0x550b5f[_0x690f('0x35')]=qs[_0x690f('0x36')](_0x47aaa8[_0x690f('0x2e')][_0x690f('0x36')]);_0x550b5f[_0x690f('0x37')]=qs[_0x690f('0x2f')](_['pick'](_0x47aaa8[_0x690f('0x2e')],_0x1cd7da[_0x690f('0x2f')]));if(_0x47aaa8[_0x690f('0x2e')][_0x690f('0x38')]){_0x550b5f[_0x690f('0x37')]=_['merge'](_0x550b5f[_0x690f('0x37')],{'$or':_[_0x690f('0x39')](_0xf8ca16,function(_0x4acea3){if(_0x4acea3[_0x690f('0x3a')][_0x690f('0x3b')]!==_0x690f('0x3c')){var _0x1038da={};_0x1038da[_0x4acea3[_0x690f('0x3d')]]={'$like':'%'+_0x47aaa8[_0x690f('0x2e')][_0x690f('0x38')]+'%'};return _0x1038da;}})});}_0x550b5f=_[_0x690f('0x3e')]({},_0x550b5f,_0x47aaa8[_0x690f('0x3f')]);var _0x6e25c1={'where':_0x550b5f['where']};return db['SAUnitMeasure']['count'](_0x6e25c1)[_0x690f('0x25')](function(_0x145a63){_0xe0afe2[_0x690f('0x1d')]=_0x145a63;if(_0x47aaa8[_0x690f('0x2e')][_0x690f('0x40')]){_0x550b5f[_0x690f('0x41')]=[{'all':!![]}];}return db[_0x690f('0x2b')]['findAll'](_0x550b5f);})[_0x690f('0x25')](function(_0xf0e1e1){_0xe0afe2[_0x690f('0x42')]=_0xf0e1e1;return _0xe0afe2;})[_0x690f('0x25')](respondWithFilteredResult(_0x179d7a,_0x550b5f))[_0x690f('0x43')](handleError(_0x179d7a,null));};exports[_0x690f('0x44')]=function(_0x55f651,_0x452232){var _0xde5367={'raw':![],'where':{'id':_0x55f651[_0x690f('0x45')]['id']}},_0x396eb5={};_0x396eb5['model']=_[_0x690f('0x2d')](db[_0x690f('0x2b')]['rawAttributes']);_0x396eb5['query']=_[_0x690f('0x2d')](_0x55f651[_0x690f('0x2e')]);_0x396eb5[_0x690f('0x2f')]=_[_0x690f('0x46')](_0x396eb5[_0x690f('0x31')],_0x396eb5['query']);_0xde5367[_0x690f('0x30')]=_[_0x690f('0x46')](_0x396eb5[_0x690f('0x31')],qs[_0x690f('0x32')](_0x55f651['query'][_0x690f('0x32')]));_0xde5367['attributes']=_0xde5367[_0x690f('0x30')][_0x690f('0x33')]?_0xde5367[_0x690f('0x30')]:_0x396eb5[_0x690f('0x31')];if(_0x55f651[_0x690f('0x2e')][_0x690f('0x40')]){_0xde5367['include']=[{'all':!![]}];}_0xde5367=_[_0x690f('0x3e')]({},_0xde5367,_0x55f651[_0x690f('0x3f')]);return db[_0x690f('0x2b')][_0x690f('0x47')](_0xde5367)[_0x690f('0x25')](handleEntityNotFound(_0x452232,null))[_0x690f('0x25')](respondWithResult(_0x452232,null))[_0x690f('0x43')](handleError(_0x452232,null));};exports['create']=function(_0x3e7626,_0x4457fa){return db[_0x690f('0x2b')][_0x690f('0x48')](_0x3e7626[_0x690f('0x49')],{})[_0x690f('0x25')](respondWithResult(_0x4457fa,0xc9))['catch'](handleError(_0x4457fa,null));};exports[_0x690f('0x24')]=function(_0x2979f0,_0x399e73){if(_0x2979f0[_0x690f('0x49')]['id']){delete _0x2979f0[_0x690f('0x49')]['id'];}return db['SAUnitMeasure']['find']({'where':{'id':_0x2979f0[_0x690f('0x45')]['id']}})['then'](handleEntityNotFound(_0x399e73,null))[_0x690f('0x25')](saveUpdates(_0x2979f0[_0x690f('0x49')],null))['then'](respondWithResult(_0x399e73,null))[_0x690f('0x43')](handleError(_0x399e73,null));};exports[_0x690f('0x26')]=function(_0x1dd21c,_0x3d646e){return db[_0x690f('0x2b')][_0x690f('0x47')]({'where':{'id':_0x1dd21c[_0x690f('0x45')]['id']}})[_0x690f('0x25')](handleEntityNotFound(_0x3d646e,null))[_0x690f('0x25')](removeEntity(_0x3d646e,null))[_0x690f('0x43')](handleError(_0x3d646e,null));};exports[_0x690f('0x4a')]=function(_0x7ba3b5,_0x1eba11){return db[_0x690f('0x2b')][_0x690f('0x4a')]()['then'](respondWithResult(_0x1eba11,null))[_0x690f('0x43')](handleError(_0x1eba11,null));}; \ No newline at end of file +var _0x2bc0=['body','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','includeAll','include','SAUnitMeasure','findAll','show','params','options','find','catch','create'];(function(_0x4a05a4,_0x1f558e){var _0x349ce4=function(_0x50dc88){while(--_0x50dc88){_0x4a05a4['push'](_0x4a05a4['shift']());}};_0x349ce4(++_0x1f558e);}(_0x2bc0,0x1c4));var _0x02bc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2bc0[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x02bc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x02bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x02bc('0x2'));var moment=require(_0x02bc('0x3'));var BPromise=require(_0x02bc('0x4'));var Mustache=require(_0x02bc('0x5'));var util=require(_0x02bc('0x6'));var path=require(_0x02bc('0x7'));var sox=require(_0x02bc('0x8'));var csv=require(_0x02bc('0x9'));var ejs=require(_0x02bc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x02bc('0xb'));var crypto=require(_0x02bc('0xc'));var jsforce=require(_0x02bc('0xd'));var deskjs=require(_0x02bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x02bc('0xf'));var Papa=require(_0x02bc('0x10'));var Redis=require('ioredis');var authService=require(_0x02bc('0x11'));var qs=require(_0x02bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x02bc('0x13'))('api');var utils=require(_0x02bc('0x14'));var config=require(_0x02bc('0x15'));var db=require(_0x02bc('0x16'))['db'];function respondWithStatusCode(_0x2155cc,_0x3abe20){_0x3abe20=_0x3abe20||0xcc;return function(_0x3eeb01){if(_0x3eeb01){return _0x2155cc[_0x02bc('0x17')](_0x3abe20);}return _0x2155cc[_0x02bc('0x18')](_0x3abe20)[_0x02bc('0x19')]();};}function respondWithResult(_0x1c3dcf,_0x183513){_0x183513=_0x183513||0xc8;return function(_0xf1a34d){if(_0xf1a34d){return _0x1c3dcf[_0x02bc('0x18')](_0x183513)[_0x02bc('0x1a')](_0xf1a34d);}};}function respondWithFilteredResult(_0xf8ab9b,_0x3cecd6){return function(_0x545d99){if(_0x545d99){var _0x2f9900=_0x545d99[_0x02bc('0x1b')],_0x17c394=_0x3cecd6['offset'],_0x3503cd=_0x3cecd6[_0x02bc('0x1c')]+_0x3cecd6[_0x02bc('0x1d')],_0x58b8b0;if(_0x3503cd>=_0x2f9900){_0x3503cd=_0x2f9900;_0x58b8b0=0xc8;}else{_0x58b8b0=0xce;}_0xf8ab9b[_0x02bc('0x18')](_0x58b8b0);return _0xf8ab9b[_0x02bc('0x1e')](_0x02bc('0x1f'),_0x17c394+'-'+_0x3503cd+'/'+_0x2f9900)[_0x02bc('0x1a')](_0x545d99);}return null;};}function patchUpdates(_0x35d05b){return function(_0x14a1b7){try{jsonpatch[_0x02bc('0x20')](_0x14a1b7,_0x35d05b,!![]);}catch(_0x2d74d5){return BPromise[_0x02bc('0x21')](_0x2d74d5);}return _0x14a1b7['save']();};}function saveUpdates(_0xfe0d6f,_0x2a9f68){return function(_0x32e509){if(_0x32e509){return _0x32e509[_0x02bc('0x22')](_0xfe0d6f)[_0x02bc('0x23')](function(_0x2ff764){return _0x2ff764;});}return null;};}function removeEntity(_0x48f164,_0x10f9da){return function(_0x5137a3){if(_0x5137a3){return _0x5137a3[_0x02bc('0x24')]()[_0x02bc('0x23')](function(){_0x48f164['status'](0xcc)[_0x02bc('0x19')]();});}};}function handleEntityNotFound(_0xbb970c,_0x1d3df9){return function(_0xdf9182){if(!_0xdf9182){_0xbb970c[_0x02bc('0x17')](0x194);}return _0xdf9182;};}function handleError(_0x5514dd,_0x14cb18){_0x14cb18=_0x14cb18||0x1f4;return function(_0x4f3f43){logger[_0x02bc('0x25')](_0x4f3f43[_0x02bc('0x26')]);if(_0x4f3f43['name']){delete _0x4f3f43[_0x02bc('0x27')];}_0x5514dd['status'](_0x14cb18)[_0x02bc('0x28')](_0x4f3f43);};}exports[_0x02bc('0x29')]=function(_0x25d7ec,_0x2b0f9d){var _0x3abfd6={},_0x1a109e={},_0x2a6841={'count':0x0,'rows':[]};var _0x43dd0f=db['SAUnitMeasure'][_0x02bc('0x2a')];_0x1a109e[_0x02bc('0x2b')]=_[_0x02bc('0x2c')](_0x43dd0f);_0x1a109e[_0x02bc('0x2d')]=_['keys'](_0x25d7ec[_0x02bc('0x2d')]);_0x1a109e[_0x02bc('0x2e')]=_[_0x02bc('0x2f')](_0x1a109e[_0x02bc('0x2b')],_0x1a109e['query']);_0x3abfd6[_0x02bc('0x30')]=_['intersection'](_0x1a109e[_0x02bc('0x2b')],qs[_0x02bc('0x31')](_0x25d7ec[_0x02bc('0x2d')][_0x02bc('0x31')]));_0x3abfd6['attributes']=_0x3abfd6[_0x02bc('0x30')][_0x02bc('0x32')]?_0x3abfd6[_0x02bc('0x30')]:_0x1a109e[_0x02bc('0x2b')];if(!_0x25d7ec[_0x02bc('0x2d')][_0x02bc('0x33')]('nolimit')){_0x3abfd6[_0x02bc('0x1d')]=qs[_0x02bc('0x1d')](_0x25d7ec['query'][_0x02bc('0x1d')]);_0x3abfd6[_0x02bc('0x1c')]=qs[_0x02bc('0x1c')](_0x25d7ec['query']['offset']);}_0x3abfd6[_0x02bc('0x34')]=qs[_0x02bc('0x35')](_0x25d7ec[_0x02bc('0x2d')][_0x02bc('0x35')]);_0x3abfd6['where']=qs['filters'](_[_0x02bc('0x36')](_0x25d7ec[_0x02bc('0x2d')],_0x1a109e[_0x02bc('0x2e')]));if(_0x25d7ec[_0x02bc('0x2d')]['filter']){_0x3abfd6[_0x02bc('0x37')]=_[_0x02bc('0x38')](_0x3abfd6['where'],{'$or':_[_0x02bc('0x39')](_0x43dd0f,function(_0x2dfd14){if(_0x2dfd14[_0x02bc('0x3a')][_0x02bc('0x3b')]!==_0x02bc('0x3c')){var _0x533580={};_0x533580[_0x2dfd14[_0x02bc('0x3d')]]={'$like':'%'+_0x25d7ec[_0x02bc('0x2d')][_0x02bc('0x3e')]+'%'};return _0x533580;}})});}_0x3abfd6=_[_0x02bc('0x38')]({},_0x3abfd6,_0x25d7ec['options']);var _0x2d5fd2={'where':_0x3abfd6[_0x02bc('0x37')]};return db['SAUnitMeasure'][_0x02bc('0x1b')](_0x2d5fd2)[_0x02bc('0x23')](function(_0x3c821b){_0x2a6841[_0x02bc('0x1b')]=_0x3c821b;if(_0x25d7ec[_0x02bc('0x2d')][_0x02bc('0x3f')]){_0x3abfd6[_0x02bc('0x40')]=[{'all':!![]}];}return db[_0x02bc('0x41')][_0x02bc('0x42')](_0x3abfd6);})[_0x02bc('0x23')](function(_0x14d84e){_0x2a6841['rows']=_0x14d84e;return _0x2a6841;})[_0x02bc('0x23')](respondWithFilteredResult(_0x2b0f9d,_0x3abfd6))['catch'](handleError(_0x2b0f9d,null));};exports[_0x02bc('0x43')]=function(_0x2e2ae6,_0x223672){var _0x1608fb={'raw':![],'where':{'id':_0x2e2ae6[_0x02bc('0x44')]['id']}},_0x222888={};_0x222888[_0x02bc('0x2b')]=_[_0x02bc('0x2c')](db[_0x02bc('0x41')][_0x02bc('0x2a')]);_0x222888[_0x02bc('0x2d')]=_[_0x02bc('0x2c')](_0x2e2ae6[_0x02bc('0x2d')]);_0x222888[_0x02bc('0x2e')]=_['intersection'](_0x222888[_0x02bc('0x2b')],_0x222888[_0x02bc('0x2d')]);_0x1608fb[_0x02bc('0x30')]=_['intersection'](_0x222888[_0x02bc('0x2b')],qs['fields'](_0x2e2ae6['query']['fields']));_0x1608fb['attributes']=_0x1608fb[_0x02bc('0x30')][_0x02bc('0x32')]?_0x1608fb['attributes']:_0x222888[_0x02bc('0x2b')];if(_0x2e2ae6[_0x02bc('0x2d')][_0x02bc('0x3f')]){_0x1608fb['include']=[{'all':!![]}];}_0x1608fb=_['merge']({},_0x1608fb,_0x2e2ae6[_0x02bc('0x45')]);return db['SAUnitMeasure'][_0x02bc('0x46')](_0x1608fb)[_0x02bc('0x23')](handleEntityNotFound(_0x223672,null))[_0x02bc('0x23')](respondWithResult(_0x223672,null))[_0x02bc('0x47')](handleError(_0x223672,null));};exports['create']=function(_0x49d0f4,_0x3887b5){return db[_0x02bc('0x41')][_0x02bc('0x48')](_0x49d0f4[_0x02bc('0x49')],{})['then'](respondWithResult(_0x3887b5,0xc9))[_0x02bc('0x47')](handleError(_0x3887b5,null));};exports['update']=function(_0x30bfde,_0x426058){if(_0x30bfde[_0x02bc('0x49')]['id']){delete _0x30bfde['body']['id'];}return db[_0x02bc('0x41')][_0x02bc('0x46')]({'where':{'id':_0x30bfde[_0x02bc('0x44')]['id']}})[_0x02bc('0x23')](handleEntityNotFound(_0x426058,null))[_0x02bc('0x23')](saveUpdates(_0x30bfde[_0x02bc('0x49')],null))[_0x02bc('0x23')](respondWithResult(_0x426058,null))[_0x02bc('0x47')](handleError(_0x426058,null));};exports[_0x02bc('0x24')]=function(_0x4f1fb5,_0x1e9bb3){return db[_0x02bc('0x41')][_0x02bc('0x46')]({'where':{'id':_0x4f1fb5[_0x02bc('0x44')]['id']}})[_0x02bc('0x23')](handleEntityNotFound(_0x1e9bb3,null))[_0x02bc('0x23')](removeEntity(_0x1e9bb3,null))['catch'](handleError(_0x1e9bb3,null));};exports[_0x02bc('0x4a')]=function(_0x4d653e,_0x43f33b){return db['SAUnitMeasure'][_0x02bc('0x4a')]()[_0x02bc('0x23')](respondWithResult(_0x43f33b,null))['catch'](handleError(_0x43f33b,null));}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.model.js b/server/api/saUnitMeasure/saUnitMeasure.model.js index ecd3c69..62efe81 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.model.js +++ b/server/api/saUnitMeasure/saUnitMeasure.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a37=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saUnitMeasure.attributes','SAUnitMeasure','sa_unit_measures','lodash'];(function(_0xce1284,_0x4ed591){var _0x5d177c=function(_0x48db7e){while(--_0x48db7e){_0xce1284['push'](_0xce1284['shift']());}};_0x5d177c(++_0x4ed591);}(_0x9a37,0xb5));var _0x79a3=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0x9a37[_0x486008];return _0x2fefc7;};'use strict';var _=require(_0x79a3('0x0'));var util=require(_0x79a3('0x1'));var logger=require(_0x79a3('0x2'))(_0x79a3('0x3'));var moment=require(_0x79a3('0x4'));var BPromise=require(_0x79a3('0x5'));var rp=require(_0x79a3('0x6'));var fs=require('fs');var path=require(_0x79a3('0x7'));var rimraf=require(_0x79a3('0x8'));var config=require(_0x79a3('0x9'));var attributes=require(_0x79a3('0xa'));module['exports']=function(_0x3127ce,_0xfbc85c){return _0x3127ce['define'](_0x79a3('0xb'),attributes,{'tableName':_0x79a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba6d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saUnitMeasure.attributes','define','SAUnitMeasure','sa_unit_measures'];(function(_0x4b872f,_0x32eb64){var _0x125b3b=function(_0x418899){while(--_0x418899){_0x4b872f['push'](_0x4b872f['shift']());}};_0x125b3b(++_0x32eb64);}(_0xba6d,0xc4));var _0xdba6=function(_0xf01016,_0x1ce928){_0xf01016=_0xf01016-0x0;var _0x1fdee6=_0xba6d[_0xf01016];return _0x1fdee6;};'use strict';var _=require(_0xdba6('0x0'));var util=require(_0xdba6('0x1'));var logger=require(_0xdba6('0x2'))(_0xdba6('0x3'));var moment=require(_0xdba6('0x4'));var BPromise=require(_0xdba6('0x5'));var rp=require(_0xdba6('0x6'));var fs=require('fs');var path=require(_0xdba6('0x7'));var rimraf=require(_0xdba6('0x8'));var config=require(_0xdba6('0x9'));var attributes=require(_0xdba6('0xa'));module['exports']=function(_0x4372fb,_0x319395){return _0x4372fb[_0xdba6('0xb')](_0xdba6('0xc'),attributes,{'tableName':_0xdba6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.rpc.js b/server/api/saUnitMeasure/saUnitMeasure.rpc.js index d2067a8..0b2b4b2 100644 --- a/server/api/saUnitMeasure/saUnitMeasure.rpc.js +++ b/server/api/saUnitMeasure/saUnitMeasure.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ae1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SAUnitMeasure,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x425b72,_0x40be8d){var _0x3af242=function(_0x4dad98){while(--_0x4dad98){_0x425b72['push'](_0x425b72['shift']());}};_0x3af242(++_0x40be8d);}(_0x4ae1,0x131));var _0x14ae=function(_0x4dd063,_0x386d0c){_0x4dd063=_0x4dd063-0x0;var _0x2b8747=_0x4ae1[_0x4dd063];return _0x2b8747;};'use strict';var _=require(_0x14ae('0x0'));var util=require(_0x14ae('0x1'));var moment=require('moment');var BPromise=require(_0x14ae('0x2'));var rs=require(_0x14ae('0x3'));var fs=require('fs');var Redis=require(_0x14ae('0x4'));var db=require(_0x14ae('0x5'))['db'];var utils=require(_0x14ae('0x6'));var logger=require(_0x14ae('0x7'))('rpc');var config=require(_0x14ae('0x8'));var jayson=require(_0x14ae('0x9'));var client=jayson[_0x14ae('0xa')][_0x14ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x507863,_0x1fbc46,_0x1bbef8){return new BPromise(function(_0x1254e5,_0x7617d5){return client['request'](_0x507863,_0x1bbef8)[_0x14ae('0xc')](function(_0x505af0){logger[_0x14ae('0xd')](_0x14ae('0xe'),_0x1fbc46,_0x14ae('0xf'));logger['debug']('SAUnitMeasure,\x20%s,\x20%s,\x20%s',_0x1fbc46,_0x14ae('0xf'),JSON[_0x14ae('0x10')](_0x505af0));if(_0x505af0[_0x14ae('0x11')]){if(_0x505af0[_0x14ae('0x11')][_0x14ae('0x12')]===0x1f4){logger[_0x14ae('0x11')](_0x14ae('0xe'),_0x1fbc46,_0x505af0['error'][_0x14ae('0x13')]);return _0x7617d5(_0x505af0[_0x14ae('0x11')][_0x14ae('0x13')]);}logger['error'](_0x14ae('0xe'),_0x1fbc46,_0x505af0[_0x14ae('0x11')][_0x14ae('0x13')]);return _0x1254e5(_0x505af0[_0x14ae('0x11')][_0x14ae('0x13')]);}else{logger[_0x14ae('0xd')](_0x14ae('0xe'),_0x1fbc46,_0x14ae('0xf'));_0x1254e5(_0x505af0[_0x14ae('0x14')][_0x14ae('0x13')]);}})[_0x14ae('0x15')](function(_0x4e16d8){logger[_0x14ae('0x11')]('SAUnitMeasure,\x20%s,\x20%s',_0x1fbc46,_0x4e16d8);_0x7617d5(_0x4e16d8);});});} \ No newline at end of file +var _0x6bf4=['SAUnitMeasure,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','error'];(function(_0x26f664,_0x44c591){var _0x24a73b=function(_0x2e9143){while(--_0x2e9143){_0x26f664['push'](_0x26f664['shift']());}};_0x24a73b(++_0x44c591);}(_0x6bf4,0x1f0));var _0x46bf=function(_0x24875f,_0x48eaac){_0x24875f=_0x24875f-0x0;var _0x354ba4=_0x6bf4[_0x24875f];return _0x354ba4;};'use strict';var _=require(_0x46bf('0x0'));var util=require('util');var moment=require(_0x46bf('0x1'));var BPromise=require('bluebird');var rs=require(_0x46bf('0x2'));var fs=require('fs');var Redis=require(_0x46bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x46bf('0x4'));var logger=require(_0x46bf('0x5'))(_0x46bf('0x6'));var config=require(_0x46bf('0x7'));var jayson=require(_0x46bf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x574163,_0x4aec70,_0x446782){return new BPromise(function(_0x38b8b5,_0x1f32bf){return client[_0x46bf('0x9')](_0x574163,_0x446782)['then'](function(_0x5c571a){logger[_0x46bf('0xa')]('SAUnitMeasure,\x20%s,\x20%s',_0x4aec70,_0x46bf('0xb'));logger[_0x46bf('0xc')]('SAUnitMeasure,\x20%s,\x20%s,\x20%s',_0x4aec70,_0x46bf('0xb'),JSON['stringify'](_0x5c571a));if(_0x5c571a[_0x46bf('0xd')]){if(_0x5c571a[_0x46bf('0xd')]['code']===0x1f4){logger['error'](_0x46bf('0xe'),_0x4aec70,_0x5c571a[_0x46bf('0xd')][_0x46bf('0xf')]);return _0x1f32bf(_0x5c571a['error'][_0x46bf('0xf')]);}logger[_0x46bf('0xd')]('SAUnitMeasure,\x20%s,\x20%s',_0x4aec70,_0x5c571a[_0x46bf('0xd')][_0x46bf('0xf')]);return _0x38b8b5(_0x5c571a[_0x46bf('0xd')][_0x46bf('0xf')]);}else{logger[_0x46bf('0xa')](_0x46bf('0xe'),_0x4aec70,_0x46bf('0xb'));_0x38b8b5(_0x5c571a[_0x46bf('0x10')][_0x46bf('0xf')]);}})['catch'](function(_0x1d518c){logger['error'](_0x46bf('0xe'),_0x4aec70,_0x1d518c);_0x1f32bf(_0x1d518c);});});} \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ed71e7b..7f4f0a5 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 _0xf9ae=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','create'];(function(_0x2bf835,_0x52b0ea){var _0x2383cc=function(_0x25501b){while(--_0x25501b){_0x2bf835['push'](_0x2bf835['shift']());}};_0x2383cc(++_0x52b0ea);}(_0xf9ae,0x132));var _0xef9a=function(_0x1026b3,_0x51a0b1){_0x1026b3=_0x1026b3-0x0;var _0x5bf0eb=_0xf9ae[_0x1026b3];return _0x5bf0eb;};'use strict';var multer=require(_0xef9a('0x0'));var util=require(_0xef9a('0x1'));var path=require(_0xef9a('0x2'));var timeout=require(_0xef9a('0x3'));var express=require(_0xef9a('0x4'));var router=express[_0xef9a('0x5')]();var auth=require(_0xef9a('0x6'));var interaction=require(_0xef9a('0x7'));var config=require(_0xef9a('0x8'));var controller=require(_0xef9a('0x9'));router[_0xef9a('0xa')]('/',auth['isAuthenticated'](),controller[_0xef9a('0xb')]);router['get'](_0xef9a('0xc'),auth[_0xef9a('0xd')](),controller[_0xef9a('0xe')]);router['get'](_0xef9a('0xf'),auth[_0xef9a('0xd')](),controller['run']);router['post']('/',auth[_0xef9a('0xd')](),controller[_0xef9a('0x10')]);router['put'](_0xef9a('0xc'),auth[_0xef9a('0xd')](),controller[_0xef9a('0x11')]);router['delete']('/:id',auth[_0xef9a('0xd')](),controller['destroy']);module[_0xef9a('0x12')]=router; \ No newline at end of file +var _0x8a02=['../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xd01d30,_0x263bd7){var _0x2e6f11=function(_0x454bdc){while(--_0x454bdc){_0xd01d30['push'](_0xd01d30['shift']());}};_0x2e6f11(++_0x263bd7);}(_0x8a02,0x123));var _0x28a0=function(_0x3698bb,_0x249146){_0x3698bb=_0x3698bb-0x0;var _0x3c3cc9=_0x8a02[_0x3698bb];return _0x3c3cc9;};'use strict';var multer=require(_0x28a0('0x0'));var util=require(_0x28a0('0x1'));var path=require(_0x28a0('0x2'));var timeout=require(_0x28a0('0x3'));var express=require(_0x28a0('0x4'));var router=express[_0x28a0('0x5')]();var auth=require(_0x28a0('0x6'));var interaction=require(_0x28a0('0x7'));var config=require(_0x28a0('0x8'));var controller=require(_0x28a0('0x9'));router[_0x28a0('0xa')]('/',auth['isAuthenticated'](),controller[_0x28a0('0xb')]);router[_0x28a0('0xa')](_0x28a0('0xc'),auth[_0x28a0('0xd')](),controller[_0x28a0('0xe')]);router[_0x28a0('0xa')](_0x28a0('0xf'),auth[_0x28a0('0xd')](),controller[_0x28a0('0x10')]);router['post']('/',auth[_0x28a0('0xd')](),controller[_0x28a0('0x11')]);router[_0x28a0('0x12')](_0x28a0('0xc'),auth[_0x28a0('0xd')](),controller[_0x28a0('0x13')]);router[_0x28a0('0x14')](_0x28a0('0xc'),auth[_0x28a0('0xd')](),controller[_0x28a0('0x15')]);module[_0x28a0('0x16')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d4529a9..ea02058 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 _0x69a5=['quarters','months','days','hours','minutes','csv','default','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x290554,_0x1870d1){var _0x2481d5=function(_0x43c31a){while(--_0x43c31a){_0x290554['push'](_0x290554['shift']());}};_0x2481d5(++_0x1870d1);}(_0x69a5,0x1c3));var _0x569a=function(_0x376aa5,_0x125226){_0x376aa5=_0x376aa5-0x0;var _0x2fa161=_0x69a5[_0x376aa5];return _0x2fa161;};'use strict';var Sequelize=require('sequelize');module[_0x569a('0x0')]={'name':{'type':Sequelize[_0x569a('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x569a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x569a('0x1')],'allowNull':![],'defaultValue':_0x569a('0x3')},'startAt':{'type':Sequelize[_0x569a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x569a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x569a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x569a('0x6')](_0x569a('0x7'),_0x569a('0x8'),_0x569a('0x9'),'weeks',_0x569a('0xa'),_0x569a('0xb'),_0x569a('0xc')),'allowNull':![],'defaultValue':_0x569a('0xa')},'output':{'type':Sequelize[_0x569a('0x6')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x569a('0xd')},'type':{'type':Sequelize['ENUM']('custom',_0x569a('0xe')),'allowNull':![],'defaultValue':_0x569a('0xf')},'sendMail':{'type':Sequelize[_0x569a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x569a('0x1')]},'cc':{'type':Sequelize[_0x569a('0x10')]},'bcc':{'type':Sequelize[_0x569a('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x569a('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb2d4=['quarters','weeks','days','hours','minutes','csv','default','custom','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb2d4,0xb2));var _0x4b2d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xb2d4[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x4b2d('0x0'));module[_0x4b2d('0x1')]={'name':{'type':Sequelize[_0x4b2d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4b2d('0x2')]},'active':{'type':Sequelize[_0x4b2d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4b2d('0x2')],'allowNull':![],'defaultValue':_0x4b2d('0x4')},'startAt':{'type':Sequelize[_0x4b2d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4b2d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4b2d('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4b2d('0x7')](_0x4b2d('0x8'),_0x4b2d('0x9'),'months',_0x4b2d('0xa'),_0x4b2d('0xb'),_0x4b2d('0xc'),_0x4b2d('0xd')),'allowNull':![],'defaultValue':_0x4b2d('0xb')},'output':{'type':Sequelize[_0x4b2d('0x7')](_0x4b2d('0xe'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x4b2d('0xe')},'type':{'type':Sequelize[_0x4b2d('0x7')]('custom',_0x4b2d('0xf')),'allowNull':![],'defaultValue':_0x4b2d('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4b2d('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x4b2d('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 32fb7f1..2453857 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 _0x8fd0=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','Schedule','includeAll','include','findAll','rows','show','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','get','Scheduler','destroy','error','stack','name','send','index','rawAttributes','model','keys','query'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8fd0,0x166));var _0x08fd=function(_0x5cc9ae,_0x116739){_0x5cc9ae=_0x5cc9ae-0x0;var _0xef9aa1=_0x8fd0[_0x5cc9ae];return _0xef9aa1;};'use strict';var pdf=require(_0x08fd('0x0'));var emlformat=require(_0x08fd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x08fd('0x2'));var jsonpatch=require(_0x08fd('0x3'));var rp=require(_0x08fd('0x4'));var moment=require(_0x08fd('0x5'));var BPromise=require(_0x08fd('0x6'));var Mustache=require(_0x08fd('0x7'));var util=require(_0x08fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x08fd('0x9'));var ejs=require(_0x08fd('0xa'));var fs=require('fs');var _=require(_0x08fd('0xb'));var squel=require('squel');var crypto=require(_0x08fd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08fd('0xd'));var Papa=require(_0x08fd('0xe'));var Redis=require('ioredis');var authService=require(_0x08fd('0xf'));var qs=require(_0x08fd('0x10'));var hardwareService=require(_0x08fd('0x11'));var logger=require(_0x08fd('0x12'))(_0x08fd('0x13'));var utils=require(_0x08fd('0x14'));var config=require(_0x08fd('0x15'));var db=require(_0x08fd('0x16'))['db'];function respondWithStatusCode(_0x5e5f23,_0x4f9fa6){_0x4f9fa6=_0x4f9fa6||0xcc;return function(_0x2b981a){if(_0x2b981a){return _0x5e5f23[_0x08fd('0x17')](_0x4f9fa6);}return _0x5e5f23[_0x08fd('0x18')](_0x4f9fa6)[_0x08fd('0x19')]();};}function respondWithResult(_0x310b90,_0x45fba9){_0x45fba9=_0x45fba9||0xc8;return function(_0x419c68){if(_0x419c68){return _0x310b90[_0x08fd('0x18')](_0x45fba9)['json'](_0x419c68);}};}function respondWithFilteredResult(_0x471322,_0x4fa10f){return function(_0x4610cc){if(_0x4610cc){var _0x531bbc=_0x4610cc[_0x08fd('0x1a')],_0x17b1e2=_0x4fa10f[_0x08fd('0x1b')],_0x373844=_0x4fa10f[_0x08fd('0x1b')]+_0x4fa10f[_0x08fd('0x1c')],_0x3b4153;if(_0x373844>=_0x531bbc){_0x373844=_0x531bbc;_0x3b4153=0xc8;}else{_0x3b4153=0xce;}_0x471322[_0x08fd('0x18')](_0x3b4153);return _0x471322[_0x08fd('0x1d')](_0x08fd('0x1e'),_0x17b1e2+'-'+_0x373844+'/'+_0x531bbc)[_0x08fd('0x1f')](_0x4610cc);}return null;};}function patchUpdates(_0x3976ae){return function(_0x5b94eb){try{jsonpatch[_0x08fd('0x20')](_0x5b94eb,_0x3976ae,!![]);}catch(_0x3dc93f){return BPromise['reject'](_0x3dc93f);}return _0x5b94eb['save']();};}function saveUpdates(_0x182f6c,_0x5beb16){return function(_0x32462d){if(_0x32462d){return _0x32462d[_0x08fd('0x21')](_0x182f6c)['then'](function(_0x4ffb6c){return _0x4ffb6c;});}return null;};}function removeEntity(_0x5a5ec9,_0x538abd){return function(_0x1bd719){if(_0x1bd719){return _0x1bd719['destroy']()[_0x08fd('0x22')](function(){var _0x34d3b0=_0x1bd719[_0x08fd('0x23')]({'plain':!![]});var _0x13a85b=_0x08fd('0x24');return db['UserProfileResource'][_0x08fd('0x25')]({'where':{'type':_0x13a85b,'resourceId':_0x34d3b0['id']}})[_0x08fd('0x22')](function(){return _0x1bd719;});})[_0x08fd('0x22')](function(){_0x5a5ec9[_0x08fd('0x18')](0xcc)[_0x08fd('0x19')]();});}};}function handleEntityNotFound(_0x21fd32,_0x5cf971){return function(_0x2c5100){if(!_0x2c5100){_0x21fd32[_0x08fd('0x17')](0x194);}return _0x2c5100;};}function handleError(_0x26a4a6,_0x112a73){_0x112a73=_0x112a73||0x1f4;return function(_0x8c10df){logger[_0x08fd('0x26')](_0x8c10df[_0x08fd('0x27')]);if(_0x8c10df[_0x08fd('0x28')]){delete _0x8c10df[_0x08fd('0x28')];}_0x26a4a6[_0x08fd('0x18')](_0x112a73)[_0x08fd('0x29')](_0x8c10df);};}exports[_0x08fd('0x2a')]=function(_0x734b98,_0x1fe4f0){var _0x21d942={},_0x4844f3={},_0x522017={'count':0x0,'rows':[]};var _0x4b1155=db['Schedule'][_0x08fd('0x2b')];_0x4844f3[_0x08fd('0x2c')]=_[_0x08fd('0x2d')](_0x4b1155);_0x4844f3['query']=_[_0x08fd('0x2d')](_0x734b98[_0x08fd('0x2e')]);_0x4844f3[_0x08fd('0x2f')]=_['intersection'](_0x4844f3[_0x08fd('0x2c')],_0x4844f3['query']);_0x21d942['attributes']=_[_0x08fd('0x30')](_0x4844f3[_0x08fd('0x2c')],qs[_0x08fd('0x31')](_0x734b98['query'][_0x08fd('0x31')]));_0x21d942[_0x08fd('0x32')]=_0x21d942[_0x08fd('0x32')][_0x08fd('0x33')]?_0x21d942[_0x08fd('0x32')]:_0x4844f3['model'];if(!_0x734b98[_0x08fd('0x2e')][_0x08fd('0x34')]('nolimit')){_0x21d942['limit']=qs[_0x08fd('0x1c')](_0x734b98[_0x08fd('0x2e')][_0x08fd('0x1c')]);_0x21d942[_0x08fd('0x1b')]=qs['offset'](_0x734b98[_0x08fd('0x2e')]['offset']);}_0x21d942[_0x08fd('0x35')]=qs[_0x08fd('0x36')](_0x734b98[_0x08fd('0x2e')][_0x08fd('0x36')]);_0x21d942[_0x08fd('0x37')]=qs[_0x08fd('0x2f')](_[_0x08fd('0x38')](_0x734b98[_0x08fd('0x2e')],_0x4844f3[_0x08fd('0x2f')]));if(_0x734b98[_0x08fd('0x2e')][_0x08fd('0x39')]){_0x21d942[_0x08fd('0x37')]=_[_0x08fd('0x3a')](_0x21d942[_0x08fd('0x37')],{'$or':_[_0x08fd('0x3b')](_0x4b1155,function(_0x386fed){if(_0x386fed[_0x08fd('0x3c')]['key']!=='VIRTUAL'){var _0x22346b={};_0x22346b[_0x386fed['field']]={'$like':'%'+_0x734b98['query'][_0x08fd('0x39')]+'%'};return _0x22346b;}})});}_0x21d942=_[_0x08fd('0x3a')]({},_0x21d942,_0x734b98['options']);var _0x32fbac={'where':_0x21d942[_0x08fd('0x37')]};return db[_0x08fd('0x3d')][_0x08fd('0x1a')](_0x32fbac)['then'](function(_0x24eda1){_0x522017[_0x08fd('0x1a')]=_0x24eda1;if(_0x734b98['query'][_0x08fd('0x3e')]){_0x21d942[_0x08fd('0x3f')]=[{'all':!![]}];}return db[_0x08fd('0x3d')][_0x08fd('0x40')](_0x21d942);})[_0x08fd('0x22')](function(_0x24161d){_0x522017[_0x08fd('0x41')]=_0x24161d;return _0x522017;})['then'](respondWithFilteredResult(_0x1fe4f0,_0x21d942))['catch'](handleError(_0x1fe4f0,null));};exports[_0x08fd('0x42')]=function(_0x267a72,_0x152659){var _0x1ca1cc={'raw':![],'where':{'id':_0x267a72['params']['id']}},_0x513005={};_0x513005[_0x08fd('0x2c')]=_[_0x08fd('0x2d')](db[_0x08fd('0x3d')][_0x08fd('0x2b')]);_0x513005[_0x08fd('0x2e')]=_['keys'](_0x267a72[_0x08fd('0x2e')]);_0x513005[_0x08fd('0x2f')]=_['intersection'](_0x513005['model'],_0x513005[_0x08fd('0x2e')]);_0x1ca1cc[_0x08fd('0x32')]=_[_0x08fd('0x30')](_0x513005[_0x08fd('0x2c')],qs['fields'](_0x267a72[_0x08fd('0x2e')][_0x08fd('0x31')]));_0x1ca1cc[_0x08fd('0x32')]=_0x1ca1cc[_0x08fd('0x32')][_0x08fd('0x33')]?_0x1ca1cc['attributes']:_0x513005[_0x08fd('0x2c')];if(_0x267a72[_0x08fd('0x2e')][_0x08fd('0x3e')]){_0x1ca1cc[_0x08fd('0x3f')]=[{'all':!![]}];}_0x1ca1cc=_[_0x08fd('0x3a')]({},_0x1ca1cc,_0x267a72[_0x08fd('0x43')]);return db[_0x08fd('0x3d')][_0x08fd('0x44')](_0x1ca1cc)[_0x08fd('0x22')](handleEntityNotFound(_0x152659,null))[_0x08fd('0x22')](respondWithResult(_0x152659,null))[_0x08fd('0x45')](handleError(_0x152659,null));};exports[_0x08fd('0x46')]=function(_0x628997,_0x41bf7f){return db[_0x08fd('0x3d')][_0x08fd('0x46')](_0x628997['body'],{})[_0x08fd('0x22')](function(_0x598ef5){var _0x12c0cd=_0x628997[_0x08fd('0x47')][_0x08fd('0x23')]({'plain':!![]});if(!_0x12c0cd)throw new Error(_0x08fd('0x48'));if(_0x12c0cd[_0x08fd('0x49')]==='user'){var _0x29d883=_0x598ef5[_0x08fd('0x23')]({'plain':!![]});var _0x5b8ca5=_0x08fd('0x24');return db['UserProfileSection'][_0x08fd('0x44')]({'where':{'name':_0x5b8ca5,'userProfileId':_0x12c0cd[_0x08fd('0x4a')]},'raw':!![]})['then'](function(_0x50e70b){if(_0x50e70b&&_0x50e70b[_0x08fd('0x4b')]===0x0){return db[_0x08fd('0x4c')][_0x08fd('0x46')]({'name':_0x29d883[_0x08fd('0x28')],'resourceId':_0x29d883['id'],'type':_0x50e70b[_0x08fd('0x28')],'sectionId':_0x50e70b['id']},{})[_0x08fd('0x22')](function(){return _0x598ef5;});}else{return _0x598ef5;}})['catch'](function(_0x26eb61){logger[_0x08fd('0x26')](_0x08fd('0x4d'),_0x26eb61);throw _0x26eb61;});}return _0x598ef5;})[_0x08fd('0x22')](respondWithResult(_0x41bf7f,0xc9))['catch'](handleError(_0x41bf7f,null));};exports[_0x08fd('0x21')]=function(_0x11e195,_0x1ea1bc){if(_0x11e195[_0x08fd('0x4e')]['id']){delete _0x11e195[_0x08fd('0x4e')]['id'];}return db[_0x08fd('0x3d')][_0x08fd('0x44')]({'where':{'id':_0x11e195[_0x08fd('0x4f')]['id']}})[_0x08fd('0x22')](handleEntityNotFound(_0x1ea1bc,null))[_0x08fd('0x22')](saveUpdates(_0x11e195[_0x08fd('0x4e')],null))[_0x08fd('0x22')](respondWithResult(_0x1ea1bc,null))[_0x08fd('0x45')](handleError(_0x1ea1bc,null));};exports[_0x08fd('0x25')]=function(_0x455c15,_0x50e801){return db['Schedule'][_0x08fd('0x44')]({'where':{'id':_0x455c15[_0x08fd('0x4f')]['id']}})[_0x08fd('0x22')](handleEntityNotFound(_0x50e801,null))[_0x08fd('0x22')](removeEntity(_0x50e801,null))[_0x08fd('0x45')](handleError(_0x50e801,null));};exports[_0x08fd('0x50')]=function(_0x390316,_0x19da7c,_0x250f42){var _0x7be18a=require('../../config/schedule');return db[_0x08fd('0x3d')]['find']({'where':{'id':_0x390316[_0x08fd('0x4f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x19da7c,null))[_0x08fd('0x22')](function(){_0x7be18a[_0x08fd('0x50')](_0x390316[_0x08fd('0x4f')]['id']);})[_0x08fd('0x22')](respondWithStatusCode(_0x19da7c,null))['catch'](handleError(_0x19da7c,null));}; \ No newline at end of file +var _0x1b40=['then','destroy','get','UserProfileResource','error','stack','name','send','index','Schedule','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','field','options','includeAll','include','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x1b40,0x7e));var _0x01b4=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x1b40[_0x174ef5];return _0x1cc379;};'use strict';var pdf=require(_0x01b4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x01b4('0x1'));var zipdir=require(_0x01b4('0x2'));var jsonpatch=require(_0x01b4('0x3'));var rp=require(_0x01b4('0x4'));var moment=require(_0x01b4('0x5'));var BPromise=require(_0x01b4('0x6'));var Mustache=require(_0x01b4('0x7'));var util=require(_0x01b4('0x8'));var path=require(_0x01b4('0x9'));var sox=require(_0x01b4('0xa'));var csv=require(_0x01b4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x01b4('0xc'));var squel=require(_0x01b4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x01b4('0xe'));var toCsv=require(_0x01b4('0xb'));var querystring=require(_0x01b4('0xf'));var Papa=require(_0x01b4('0x10'));var Redis=require(_0x01b4('0x11'));var authService=require(_0x01b4('0x12'));var qs=require(_0x01b4('0x13'));var hardwareService=require(_0x01b4('0x14'));var logger=require('../../config/logger')(_0x01b4('0x15'));var utils=require(_0x01b4('0x16'));var config=require(_0x01b4('0x17'));var db=require(_0x01b4('0x18'))['db'];function respondWithStatusCode(_0x1637b1,_0x55a72e){_0x55a72e=_0x55a72e||0xcc;return function(_0x943bc6){if(_0x943bc6){return _0x1637b1[_0x01b4('0x19')](_0x55a72e);}return _0x1637b1[_0x01b4('0x1a')](_0x55a72e)[_0x01b4('0x1b')]();};}function respondWithResult(_0x5e8738,_0x2f06a1){_0x2f06a1=_0x2f06a1||0xc8;return function(_0x55bb30){if(_0x55bb30){return _0x5e8738[_0x01b4('0x1a')](_0x2f06a1)['json'](_0x55bb30);}};}function respondWithFilteredResult(_0x22ce33,_0x126acb){return function(_0x5e651e){if(_0x5e651e){var _0x3a7395=_0x5e651e[_0x01b4('0x1c')],_0x273528=_0x126acb[_0x01b4('0x1d')],_0x2815eb=_0x126acb[_0x01b4('0x1d')]+_0x126acb[_0x01b4('0x1e')],_0x5c67f6;if(_0x2815eb>=_0x3a7395){_0x2815eb=_0x3a7395;_0x5c67f6=0xc8;}else{_0x5c67f6=0xce;}_0x22ce33[_0x01b4('0x1a')](_0x5c67f6);return _0x22ce33['set'](_0x01b4('0x1f'),_0x273528+'-'+_0x2815eb+'/'+_0x3a7395)['json'](_0x5e651e);}return null;};}function patchUpdates(_0x34f7f6){return function(_0x395b64){try{jsonpatch[_0x01b4('0x20')](_0x395b64,_0x34f7f6,!![]);}catch(_0x4b5759){return BPromise[_0x01b4('0x21')](_0x4b5759);}return _0x395b64['save']();};}function saveUpdates(_0x297a43,_0x2d8c0d){return function(_0x372fb3){if(_0x372fb3){return _0x372fb3['update'](_0x297a43)[_0x01b4('0x22')](function(_0x3065f7){return _0x3065f7;});}return null;};}function removeEntity(_0x1a7443,_0x2ddc89){return function(_0x459534){if(_0x459534){return _0x459534[_0x01b4('0x23')]()[_0x01b4('0x22')](function(){var _0x566be3=_0x459534[_0x01b4('0x24')]({'plain':!![]});var _0x15cf4e='Scheduler';return db[_0x01b4('0x25')][_0x01b4('0x23')]({'where':{'type':_0x15cf4e,'resourceId':_0x566be3['id']}})[_0x01b4('0x22')](function(){return _0x459534;});})[_0x01b4('0x22')](function(){_0x1a7443[_0x01b4('0x1a')](0xcc)[_0x01b4('0x1b')]();});}};}function handleEntityNotFound(_0xa1138f,_0x109b2a){return function(_0x57300a){if(!_0x57300a){_0xa1138f[_0x01b4('0x19')](0x194);}return _0x57300a;};}function handleError(_0x5d5a03,_0x34c9a6){_0x34c9a6=_0x34c9a6||0x1f4;return function(_0x553c2f){logger[_0x01b4('0x26')](_0x553c2f[_0x01b4('0x27')]);if(_0x553c2f[_0x01b4('0x28')]){delete _0x553c2f['name'];}_0x5d5a03['status'](_0x34c9a6)[_0x01b4('0x29')](_0x553c2f);};}exports[_0x01b4('0x2a')]=function(_0x51cec6,_0x4ec8a6){var _0x361830={},_0x9c1edc={},_0xff2de9={'count':0x0,'rows':[]};var _0x3db8ee=db[_0x01b4('0x2b')][_0x01b4('0x2c')];_0x9c1edc[_0x01b4('0x2d')]=_['keys'](_0x3db8ee);_0x9c1edc[_0x01b4('0x2e')]=_[_0x01b4('0x2f')](_0x51cec6[_0x01b4('0x2e')]);_0x9c1edc[_0x01b4('0x30')]=_[_0x01b4('0x31')](_0x9c1edc[_0x01b4('0x2d')],_0x9c1edc[_0x01b4('0x2e')]);_0x361830['attributes']=_[_0x01b4('0x31')](_0x9c1edc[_0x01b4('0x2d')],qs[_0x01b4('0x32')](_0x51cec6[_0x01b4('0x2e')][_0x01b4('0x32')]));_0x361830[_0x01b4('0x33')]=_0x361830[_0x01b4('0x33')][_0x01b4('0x34')]?_0x361830[_0x01b4('0x33')]:_0x9c1edc[_0x01b4('0x2d')];if(!_0x51cec6[_0x01b4('0x2e')]['hasOwnProperty'](_0x01b4('0x35'))){_0x361830[_0x01b4('0x1e')]=qs[_0x01b4('0x1e')](_0x51cec6['query'][_0x01b4('0x1e')]);_0x361830[_0x01b4('0x1d')]=qs[_0x01b4('0x1d')](_0x51cec6[_0x01b4('0x2e')][_0x01b4('0x1d')]);}_0x361830[_0x01b4('0x36')]=qs[_0x01b4('0x37')](_0x51cec6['query'][_0x01b4('0x37')]);_0x361830[_0x01b4('0x38')]=qs['filters'](_['pick'](_0x51cec6[_0x01b4('0x2e')],_0x9c1edc[_0x01b4('0x30')]));if(_0x51cec6[_0x01b4('0x2e')][_0x01b4('0x39')]){_0x361830[_0x01b4('0x38')]=_[_0x01b4('0x3a')](_0x361830[_0x01b4('0x38')],{'$or':_['map'](_0x3db8ee,function(_0x2b8a62){if(_0x2b8a62[_0x01b4('0x3b')]['key']!==_0x01b4('0x3c')){var _0x4fc408={};_0x4fc408[_0x2b8a62[_0x01b4('0x3d')]]={'$like':'%'+_0x51cec6['query'][_0x01b4('0x39')]+'%'};return _0x4fc408;}})});}_0x361830=_[_0x01b4('0x3a')]({},_0x361830,_0x51cec6[_0x01b4('0x3e')]);var _0x1778ec={'where':_0x361830[_0x01b4('0x38')]};return db[_0x01b4('0x2b')][_0x01b4('0x1c')](_0x1778ec)[_0x01b4('0x22')](function(_0x5f49f2){_0xff2de9[_0x01b4('0x1c')]=_0x5f49f2;if(_0x51cec6[_0x01b4('0x2e')][_0x01b4('0x3f')]){_0x361830[_0x01b4('0x40')]=[{'all':!![]}];}return db[_0x01b4('0x2b')]['findAll'](_0x361830);})[_0x01b4('0x22')](function(_0xd71dcf){_0xff2de9['rows']=_0xd71dcf;return _0xff2de9;})['then'](respondWithFilteredResult(_0x4ec8a6,_0x361830))[_0x01b4('0x41')](handleError(_0x4ec8a6,null));};exports[_0x01b4('0x42')]=function(_0xe612f9,_0x5eca16){var _0xb9d3d0={'raw':![],'where':{'id':_0xe612f9[_0x01b4('0x43')]['id']}},_0x265f5d={};_0x265f5d['model']=_[_0x01b4('0x2f')](db[_0x01b4('0x2b')][_0x01b4('0x2c')]);_0x265f5d[_0x01b4('0x2e')]=_[_0x01b4('0x2f')](_0xe612f9['query']);_0x265f5d[_0x01b4('0x30')]=_[_0x01b4('0x31')](_0x265f5d['model'],_0x265f5d[_0x01b4('0x2e')]);_0xb9d3d0[_0x01b4('0x33')]=_['intersection'](_0x265f5d['model'],qs[_0x01b4('0x32')](_0xe612f9['query'][_0x01b4('0x32')]));_0xb9d3d0[_0x01b4('0x33')]=_0xb9d3d0[_0x01b4('0x33')][_0x01b4('0x34')]?_0xb9d3d0[_0x01b4('0x33')]:_0x265f5d[_0x01b4('0x2d')];if(_0xe612f9[_0x01b4('0x2e')]['includeAll']){_0xb9d3d0['include']=[{'all':!![]}];}_0xb9d3d0=_[_0x01b4('0x3a')]({},_0xb9d3d0,_0xe612f9[_0x01b4('0x3e')]);return db['Schedule'][_0x01b4('0x44')](_0xb9d3d0)[_0x01b4('0x22')](handleEntityNotFound(_0x5eca16,null))['then'](respondWithResult(_0x5eca16,null))[_0x01b4('0x41')](handleError(_0x5eca16,null));};exports['create']=function(_0x1e7b86,_0x1cb7f6){return db[_0x01b4('0x2b')][_0x01b4('0x45')](_0x1e7b86['body'],{})[_0x01b4('0x22')](function(_0x3a54b6){var _0x5f02dd=_0x1e7b86[_0x01b4('0x46')]['get']({'plain':!![]});if(!_0x5f02dd)throw new Error(_0x01b4('0x47'));if(_0x5f02dd['role']==='user'){var _0x446efe=_0x3a54b6[_0x01b4('0x24')]({'plain':!![]});var _0x3b91d7='Scheduler';return db[_0x01b4('0x48')]['find']({'where':{'name':_0x3b91d7,'userProfileId':_0x5f02dd[_0x01b4('0x49')]},'raw':!![]})['then'](function(_0x43730a){if(_0x43730a&&_0x43730a[_0x01b4('0x4a')]===0x0){return db[_0x01b4('0x25')][_0x01b4('0x45')]({'name':_0x446efe[_0x01b4('0x28')],'resourceId':_0x446efe['id'],'type':_0x43730a['name'],'sectionId':_0x43730a['id']},{})['then'](function(){return _0x3a54b6;});}else{return _0x3a54b6;}})['catch'](function(_0x40a6fb){logger[_0x01b4('0x26')](_0x01b4('0x4b'),_0x40a6fb);throw _0x40a6fb;});}return _0x3a54b6;})['then'](respondWithResult(_0x1cb7f6,0xc9))['catch'](handleError(_0x1cb7f6,null));};exports[_0x01b4('0x4c')]=function(_0x4325eb,_0x44ed36){if(_0x4325eb[_0x01b4('0x4d')]['id']){delete _0x4325eb['body']['id'];}return db['Schedule'][_0x01b4('0x44')]({'where':{'id':_0x4325eb[_0x01b4('0x43')]['id']}})[_0x01b4('0x22')](handleEntityNotFound(_0x44ed36,null))['then'](saveUpdates(_0x4325eb[_0x01b4('0x4d')],null))[_0x01b4('0x22')](respondWithResult(_0x44ed36,null))['catch'](handleError(_0x44ed36,null));};exports[_0x01b4('0x23')]=function(_0x4bcc8c,_0x344630){return db[_0x01b4('0x2b')][_0x01b4('0x44')]({'where':{'id':_0x4bcc8c[_0x01b4('0x43')]['id']}})[_0x01b4('0x22')](handleEntityNotFound(_0x344630,null))['then'](removeEntity(_0x344630,null))[_0x01b4('0x41')](handleError(_0x344630,null));};exports[_0x01b4('0x4e')]=function(_0xe165c0,_0x736eca,_0x38badd){var _0xacaa48=require(_0x01b4('0x4f'));return db[_0x01b4('0x2b')][_0x01b4('0x44')]({'where':{'id':_0xe165c0[_0x01b4('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x736eca,null))[_0x01b4('0x22')](function(){_0xacaa48['run'](_0xe165c0[_0x01b4('0x43')]['id']);})[_0x01b4('0x22')](respondWithStatusCode(_0x736eca,null))[_0x01b4('0x41')](handleError(_0x736eca,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f861685..e2bc765 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 _0x0da5=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0da5,0xd6));var _0x50da=function(_0x2d1962,_0x4583a0){_0x2d1962=_0x2d1962-0x0;var _0x2ac4d0=_0x0da5[_0x2d1962];return _0x2ac4d0;};'use strict';var _=require(_0x50da('0x0'));var util=require(_0x50da('0x1'));var logger=require(_0x50da('0x2'))(_0x50da('0x3'));var moment=require('moment');var BPromise=require(_0x50da('0x4'));var rp=require(_0x50da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50da('0x6'));var config=require(_0x50da('0x7'));var attributes=require(_0x50da('0x8'));module[_0x50da('0x9')]=function(_0x2b2968,_0x5340fd){return _0x2b2968[_0x50da('0xa')](_0x50da('0xb'),attributes,{'tableName':_0x50da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x609d=['define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x609d,0xab));var _0xd609=function(_0x54cda0,_0x3bf6e9){_0x54cda0=_0x54cda0-0x0;var _0x26f2c2=_0x609d[_0x54cda0];return _0x26f2c2;};'use strict';var _=require(_0xd609('0x0'));var util=require(_0xd609('0x1'));var logger=require(_0xd609('0x2'))(_0xd609('0x3'));var moment=require(_0xd609('0x4'));var BPromise=require('bluebird');var rp=require(_0xd609('0x5'));var fs=require('fs');var path=require(_0xd609('0x6'));var rimraf=require(_0xd609('0x7'));var config=require(_0xd609('0x8'));var attributes=require(_0xd609('0x9'));module[_0xd609('0xa')]=function(_0xb86c15,_0x1c37d9){return _0xb86c15[_0xd609('0xb')](_0xd609('0xc'),attributes,{'tableName':_0xd609('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8e84663..e645ffc 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 _0xa21d=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Schedule,\x20%s,\x20%s','message','catch','util'];(function(_0x4f539b,_0x4181c3){var _0xde4cb9=function(_0x18e03e){while(--_0x18e03e){_0x4f539b['push'](_0x4f539b['shift']());}};_0xde4cb9(++_0x4181c3);}(_0xa21d,0x18f));var _0xda21=function(_0x51e0df,_0x48d457){_0x51e0df=_0x51e0df-0x0;var _0x3495de=_0xa21d[_0x51e0df];return _0x3495de;};'use strict';var _=require('lodash');var util=require(_0xda21('0x0'));var moment=require(_0xda21('0x1'));var BPromise=require(_0xda21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda21('0x4'));var logger=require(_0xda21('0x5'))(_0xda21('0x6'));var config=require(_0xda21('0x7'));var jayson=require(_0xda21('0x8'));var client=jayson['client'][_0xda21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34d2b0,_0x520f4a,_0x25e8c8){return new BPromise(function(_0x58af25,_0x4341b2){return client[_0xda21('0xa')](_0x34d2b0,_0x25e8c8)['then'](function(_0x3f4172){logger[_0xda21('0xb')]('Schedule,\x20%s,\x20%s',_0x520f4a,'request\x20sent');logger[_0xda21('0xc')](_0xda21('0xd'),_0x520f4a,_0xda21('0xe'),JSON[_0xda21('0xf')](_0x3f4172));if(_0x3f4172['error']){if(_0x3f4172[_0xda21('0x10')]['code']===0x1f4){logger[_0xda21('0x10')]('Schedule,\x20%s,\x20%s',_0x520f4a,_0x3f4172[_0xda21('0x10')]['message']);return _0x4341b2(_0x3f4172[_0xda21('0x10')]['message']);}logger[_0xda21('0x10')](_0xda21('0x11'),_0x520f4a,_0x3f4172[_0xda21('0x10')][_0xda21('0x12')]);return _0x58af25(_0x3f4172[_0xda21('0x10')][_0xda21('0x12')]);}else{logger[_0xda21('0xb')](_0xda21('0x11'),_0x520f4a,_0xda21('0xe'));_0x58af25(_0x3f4172['result'][_0xda21('0x12')]);}})[_0xda21('0x13')](function(_0x2331a5){logger[_0xda21('0x10')]('Schedule,\x20%s,\x20%s',_0x520f4a,_0x2331a5);_0x4341b2(_0x2331a5);});});} \ No newline at end of file +var _0xaac6=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x567ecd,_0xc0fa35){var _0x3a757=function(_0x1fa543){while(--_0x1fa543){_0x567ecd['push'](_0x567ecd['shift']());}};_0x3a757(++_0xc0fa35);}(_0xaac6,0x95));var _0x6aac=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xaac6[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x6aac('0x0'));var util=require('util');var moment=require(_0x6aac('0x1'));var BPromise=require(_0x6aac('0x2'));var rs=require(_0x6aac('0x3'));var fs=require('fs');var Redis=require(_0x6aac('0x4'));var db=require(_0x6aac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6aac('0x6'))(_0x6aac('0x7'));var config=require(_0x6aac('0x8'));var jayson=require(_0x6aac('0x9'));var client=jayson[_0x6aac('0xa')][_0x6aac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bf644,_0x573d29,_0x174289){return new BPromise(function(_0x4db268,_0x5d323d){return client[_0x6aac('0xc')](_0x5bf644,_0x174289)[_0x6aac('0xd')](function(_0xa0828f){logger[_0x6aac('0xe')](_0x6aac('0xf'),_0x573d29,_0x6aac('0x10'));logger['debug'](_0x6aac('0x11'),_0x573d29,_0x6aac('0x10'),JSON[_0x6aac('0x12')](_0xa0828f));if(_0xa0828f[_0x6aac('0x13')]){if(_0xa0828f[_0x6aac('0x13')][_0x6aac('0x14')]===0x1f4){logger[_0x6aac('0x13')]('Schedule,\x20%s,\x20%s',_0x573d29,_0xa0828f[_0x6aac('0x13')][_0x6aac('0x15')]);return _0x5d323d(_0xa0828f[_0x6aac('0x13')]['message']);}logger[_0x6aac('0x13')](_0x6aac('0xf'),_0x573d29,_0xa0828f[_0x6aac('0x13')][_0x6aac('0x15')]);return _0x4db268(_0xa0828f['error'][_0x6aac('0x15')]);}else{logger[_0x6aac('0xe')]('Schedule,\x20%s,\x20%s',_0x573d29,_0x6aac('0x10'));_0x4db268(_0xa0828f[_0x6aac('0x16')][_0x6aac('0x15')]);}})[_0x6aac('0x17')](function(_0x1f863b){logger[_0x6aac('0x13')](_0x6aac('0xf'),_0x573d29,_0x1f863b);_0x5d323d(_0x1f863b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8c189d0..9d059cd 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 _0xf934=['isAuthenticated','index','get','/describe','describe','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./screenRecording.controller'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xf934,0x7d));var _0x4f93=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf934[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x4f93('0x0'));var util=require(_0x4f93('0x1'));var path=require(_0x4f93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f93('0x3'));var router=express['Router']();var auth=require(_0x4f93('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f93('0x5'));var controller=require(_0x4f93('0x6'));router['get']('/',auth[_0x4f93('0x7')](),controller[_0x4f93('0x8')]);router[_0x4f93('0x9')](_0x4f93('0xa'),auth[_0x4f93('0x7')](),controller[_0x4f93('0xb')]);router[_0x4f93('0x9')]('/:id',auth[_0x4f93('0x7')](),controller['show']);router[_0x4f93('0x9')](_0x4f93('0xc'),auth[_0x4f93('0x7')](),controller[_0x4f93('0xd')]);router[_0x4f93('0xe')]('/',auth['isAuthenticated'](),controller[_0x4f93('0xf')]);router[_0x4f93('0x10')](_0x4f93('0x11'),auth[_0x4f93('0x7')](),controller[_0x4f93('0x12')]);router[_0x4f93('0x13')](_0x4f93('0x11'),auth['isAuthenticated'](),controller[_0x4f93('0x14')]);module[_0x4f93('0x15')]=router; \ No newline at end of file +var _0xfd16=['update','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put'];(function(_0x141c01,_0x590d1b){var _0x175717=function(_0x4733b0){while(--_0x4733b0){_0x141c01['push'](_0x141c01['shift']());}};_0x175717(++_0x590d1b);}(_0xfd16,0x113));var _0x6fd1=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xfd16[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x6fd1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6fd1('0x1'));var router=express[_0x6fd1('0x2')]();var auth=require(_0x6fd1('0x3'));var interaction=require(_0x6fd1('0x4'));var config=require(_0x6fd1('0x5'));var controller=require(_0x6fd1('0x6'));router[_0x6fd1('0x7')]('/',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x9')]);router[_0x6fd1('0x7')](_0x6fd1('0xa'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xb')]);router[_0x6fd1('0x7')](_0x6fd1('0xc'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xd')]);router[_0x6fd1('0x7')](_0x6fd1('0xe'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xf')]);router[_0x6fd1('0x10')]('/',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x11')]);router[_0x6fd1('0x12')]('/:id',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x13')]);router['delete'](_0x6fd1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6fd1('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5820c6b..3198811 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 _0x5f11=['moment','path','exports','VIRTUAL','value','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5f11,0x98));var _0x15f1=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x5f11[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x15f1('0x0'));var moment=require(_0x15f1('0x1'));var path=require(_0x15f1('0x2'));var config=require('../../config/environment');module[_0x15f1('0x3')]={'format':{'type':Sequelize[_0x15f1('0x4')],'get':function(){return this['getDataValue'](_0x15f1('0x5'))?path['extname'](this[_0x15f1('0x6')](_0x15f1('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x15f1('0x7')]},'channel':{'type':Sequelize[_0x15f1('0x7')]},'value':{'type':Sequelize[_0x15f1('0x7')],'set':function(_0x26c2df){var _0x5b98d2=_0x26c2df['replace'](/\\/g,'/');this[_0x15f1('0x8')](_0x15f1('0x5'),_0x5b98d2);}},'rating':{'type':Sequelize[_0x15f1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x15f1('0x9')],'set':function(_0x5780bc){this['setDataValue'](_0x15f1('0xa'),moment()['subtract'](_0x5780bc,'ms'));this[_0x15f1('0x8')](_0x15f1('0xb'),moment());this[_0x15f1('0x8')]('duration',_0x5780bc);}},'startedAt':{'type':Sequelize[_0x15f1('0xc')],'get':function(){return moment(this[_0x15f1('0x6')](_0x15f1('0xa')))[_0x15f1('0xd')](_0x15f1('0xe'))[_0x15f1('0xf')]();}},'closedAt':{'type':Sequelize[_0x15f1('0xc')],'get':function(){return moment(this[_0x15f1('0x6')](_0x15f1('0xb')))[_0x15f1('0xd')](_0x15f1('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x15f1('0x6')]('createdAt'))[_0x15f1('0xd')](_0x15f1('0xe'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x15f1('0x6')](_0x15f1('0x10')))[_0x15f1('0xd')](_0x15f1('0xe'))[_0x15f1('0xf')]();}}}; \ No newline at end of file +var _0x9e2a=['subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0x9e2a,0xe1));var _0xa9e2=function(_0x55e54c,_0x3697bf){_0x55e54c=_0x55e54c-0x0;var _0x33ec5f=_0x9e2a[_0x55e54c];return _0x33ec5f;};'use strict';var Sequelize=require(_0xa9e2('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0xa9e2('0x1')],'get':function(){return this[_0xa9e2('0x2')](_0xa9e2('0x3'))?path[_0xa9e2('0x4')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa9e2('0x5')]},'value':{'type':Sequelize[_0xa9e2('0x5')],'set':function(_0xde042e){var _0x205f5c=_0xde042e[_0xa9e2('0x6')](/\\/g,'/');this[_0xa9e2('0x7')]('value',_0x205f5c);}},'rating':{'type':Sequelize[_0xa9e2('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5e44d6){this[_0xa9e2('0x7')]('startedAt',moment()[_0xa9e2('0x9')](_0x5e44d6,'ms'));this[_0xa9e2('0x7')](_0xa9e2('0xa'),moment());this['setDataValue'](_0xa9e2('0xb'),_0x5e44d6);}},'startedAt':{'type':Sequelize[_0xa9e2('0xc')],'get':function(){return moment(this[_0xa9e2('0x2')]('startedAt'))[_0xa9e2('0xd')](_0xa9e2('0xe'))[_0xa9e2('0xf')]();}},'closedAt':{'type':Sequelize[_0xa9e2('0xc')],'get':function(){return moment(this[_0xa9e2('0x2')](_0xa9e2('0xa')))[_0xa9e2('0xd')](_0xa9e2('0xe'))[_0xa9e2('0xf')]();}},'createdAt':{'type':Sequelize[_0xa9e2('0xc')],'get':function(){return moment(this['getDataValue'](_0xa9e2('0x10')))['format']('MM-DD-YYYY\x20HH:mm')[_0xa9e2('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xa9e2('0x11')))[_0xa9e2('0xd')](_0xa9e2('0xe'))[_0xa9e2('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index e80c642..5d22be2 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 _0x1bc1=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','destroy','then','error','stack','name','send','ScreenRecording','rawAttributes','model','differenceBy','format','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','fields','include','find','body','update','createdAt','closedAt','value','params','describe','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x1250fd,_0x195dd4){var _0x467027=function(_0x1795b6){while(--_0x1795b6){_0x1250fd['push'](_0x1250fd['shift']());}};_0x467027(++_0x195dd4);}(_0x1bc1,0x128));var _0x11bc=function(_0x26707f,_0x2bcfd5){_0x26707f=_0x26707f-0x0;var _0x3a19df=_0x1bc1[_0x26707f];return _0x3a19df;};'use strict';var pdf=require(_0x11bc('0x0'));var emlformat=require(_0x11bc('0x1'));var rimraf=require(_0x11bc('0x2'));var zipdir=require(_0x11bc('0x3'));var jsonpatch=require(_0x11bc('0x4'));var rp=require(_0x11bc('0x5'));var moment=require(_0x11bc('0x6'));var BPromise=require(_0x11bc('0x7'));var Mustache=require(_0x11bc('0x8'));var util=require(_0x11bc('0x9'));var path=require(_0x11bc('0xa'));var sox=require(_0x11bc('0xb'));var csv=require(_0x11bc('0xc'));var ejs=require(_0x11bc('0xd'));var fs=require('fs');var _=require(_0x11bc('0xe'));var squel=require(_0x11bc('0xf'));var crypto=require(_0x11bc('0x10'));var jsforce=require(_0x11bc('0x11'));var deskjs=require(_0x11bc('0x12'));var toCsv=require(_0x11bc('0xc'));var querystring=require(_0x11bc('0x13'));var Papa=require(_0x11bc('0x14'));var Redis=require(_0x11bc('0x15'));var authService=require(_0x11bc('0x16'));var qs=require(_0x11bc('0x17'));var hardwareService=require(_0x11bc('0x18'));var logger=require(_0x11bc('0x19'))(_0x11bc('0x1a'));var utils=require('../../config/utils');var config=require(_0x11bc('0x1b'));var db=require(_0x11bc('0x1c'))['db'];function respondWithStatusCode(_0x592bc9,_0x1d4278){_0x1d4278=_0x1d4278||0xcc;return function(_0x5f326c){if(_0x5f326c){return _0x592bc9[_0x11bc('0x1d')](_0x1d4278);}return _0x592bc9[_0x11bc('0x1e')](_0x1d4278)[_0x11bc('0x1f')]();};}function respondWithResult(_0xf12bd6,_0x2dd5fa){_0x2dd5fa=_0x2dd5fa||0xc8;return function(_0x44b286){if(_0x44b286){return _0xf12bd6[_0x11bc('0x1e')](_0x2dd5fa)[_0x11bc('0x20')](_0x44b286);}};}function respondWithFilteredResult(_0x304c79,_0x348cda){return function(_0x26da77){if(_0x26da77){var _0x3f695a=_0x26da77[_0x11bc('0x21')],_0x5d002a=_0x348cda[_0x11bc('0x22')],_0x159a37=_0x348cda[_0x11bc('0x22')]+_0x348cda[_0x11bc('0x23')],_0x40e365;if(_0x159a37>=_0x3f695a){_0x159a37=_0x3f695a;_0x40e365=0xc8;}else{_0x40e365=0xce;}_0x304c79[_0x11bc('0x1e')](_0x40e365);return _0x304c79['set']('Content-Range',_0x5d002a+'-'+_0x159a37+'/'+_0x3f695a)[_0x11bc('0x20')](_0x26da77);}return null;};}function patchUpdates(_0x543bee){return function(_0x94d02d){try{jsonpatch[_0x11bc('0x24')](_0x94d02d,_0x543bee,!![]);}catch(_0x544e23){return BPromise['reject'](_0x544e23);}return _0x94d02d[_0x11bc('0x25')]();};}function saveUpdates(_0x4ac299,_0x2c5bfe){return function(_0x456a69){if(_0x456a69){return _0x456a69['update'](_0x4ac299)['then'](function(_0x21e91a){return _0x21e91a;});}return null;};}function removeEntity(_0x45bfb5,_0x4815db){return function(_0x252545){if(_0x252545){return _0x252545[_0x11bc('0x26')]()[_0x11bc('0x27')](function(){_0x45bfb5['status'](0xcc)[_0x11bc('0x1f')]();});}};}function handleEntityNotFound(_0x599be6,_0x53c6aa){return function(_0x5cb7ec){if(!_0x5cb7ec){_0x599be6[_0x11bc('0x1d')](0x194);}return _0x5cb7ec;};}function handleError(_0x560634,_0x4d8053){_0x4d8053=_0x4d8053||0x1f4;return function(_0x4867f9){logger[_0x11bc('0x28')](_0x4867f9[_0x11bc('0x29')]);if(_0x4867f9[_0x11bc('0x2a')]){delete _0x4867f9[_0x11bc('0x2a')];}_0x560634[_0x11bc('0x1e')](_0x4d8053)[_0x11bc('0x2b')](_0x4867f9);};}exports['index']=function(_0x3c9640,_0x392ddc){var _0x34f4c9={},_0x28021a={},_0x212e1f={'count':0x0,'rows':[]};var _0x10096f=db[_0x11bc('0x2c')][_0x11bc('0x2d')];_0x28021a[_0x11bc('0x2e')]=_[_0x11bc('0x2f')](_['keys'](_0x10096f),[_0x11bc('0x30')]);_0x28021a['query']=_[_0x11bc('0x31')](_0x3c9640[_0x11bc('0x32')]);_0x28021a['filters']=_['intersection'](_0x28021a[_0x11bc('0x2e')],_0x28021a['query']);_0x34f4c9[_0x11bc('0x33')]=_[_0x11bc('0x34')](_0x28021a[_0x11bc('0x2e')],qs['fields'](_0x3c9640[_0x11bc('0x32')]['fields']));_0x34f4c9[_0x11bc('0x33')]=_0x34f4c9[_0x11bc('0x33')][_0x11bc('0x35')]?_0x34f4c9[_0x11bc('0x33')]:_0x28021a['model'];if(!_0x3c9640[_0x11bc('0x32')][_0x11bc('0x36')](_0x11bc('0x37'))){_0x34f4c9[_0x11bc('0x23')]=qs[_0x11bc('0x23')](_0x3c9640[_0x11bc('0x32')]['limit']);_0x34f4c9[_0x11bc('0x22')]=qs['offset'](_0x3c9640[_0x11bc('0x32')][_0x11bc('0x22')]);}_0x34f4c9[_0x11bc('0x38')]=qs[_0x11bc('0x39')](_0x3c9640[_0x11bc('0x32')][_0x11bc('0x39')]);_0x34f4c9[_0x11bc('0x3a')]=qs[_0x11bc('0x3b')](_[_0x11bc('0x3c')](_0x3c9640[_0x11bc('0x32')],_0x28021a[_0x11bc('0x3b')]));if(_0x3c9640[_0x11bc('0x32')][_0x11bc('0x3d')]){_0x34f4c9[_0x11bc('0x3a')]=_[_0x11bc('0x3e')](_0x34f4c9[_0x11bc('0x3a')],{'$or':_[_0x11bc('0x3f')](_0x10096f,function(_0x44d178){if(_0x44d178[_0x11bc('0x40')][_0x11bc('0x41')]!=='VIRTUAL'){var _0x582695={};_0x582695[_0x44d178[_0x11bc('0x42')]]={'$like':'%'+_0x3c9640['query'][_0x11bc('0x3d')]+'%'};return _0x582695;}})});}_0x34f4c9=_[_0x11bc('0x3e')]({},_0x34f4c9,_0x3c9640[_0x11bc('0x43')]);var _0x51f083={'where':_0x34f4c9['where']};return db[_0x11bc('0x2c')]['count'](_0x51f083)['then'](function(_0xe25f5e){_0x212e1f[_0x11bc('0x21')]=_0xe25f5e;if(_0x3c9640[_0x11bc('0x32')][_0x11bc('0x44')]){_0x34f4c9['include']=[{'all':!![]}];}return db[_0x11bc('0x2c')][_0x11bc('0x45')](_0x34f4c9);})['then'](function(_0x14995a){_0x212e1f[_0x11bc('0x46')]=_0x14995a;return _0x212e1f;})[_0x11bc('0x27')](respondWithFilteredResult(_0x392ddc,_0x34f4c9))[_0x11bc('0x47')](handleError(_0x392ddc,null));};exports[_0x11bc('0x48')]=function(_0x43cb9c,_0x3dad5){var _0x513157={'raw':![],'where':{'id':_0x43cb9c['params']['id']}},_0x1a8107={};_0x1a8107[_0x11bc('0x2e')]=_[_0x11bc('0x31')](db['ScreenRecording'][_0x11bc('0x2d')]);_0x1a8107['query']=_[_0x11bc('0x31')](_0x43cb9c[_0x11bc('0x32')]);_0x1a8107[_0x11bc('0x3b')]=_[_0x11bc('0x34')](_0x1a8107[_0x11bc('0x2e')],_0x1a8107['query']);_0x513157[_0x11bc('0x33')]=_[_0x11bc('0x34')](_0x1a8107[_0x11bc('0x2e')],qs['fields'](_0x43cb9c[_0x11bc('0x32')][_0x11bc('0x49')]));_0x513157[_0x11bc('0x33')]=_0x513157[_0x11bc('0x33')]['length']?_0x513157[_0x11bc('0x33')]:_0x1a8107[_0x11bc('0x2e')];if(_0x43cb9c[_0x11bc('0x32')][_0x11bc('0x44')]){_0x513157[_0x11bc('0x4a')]=[{'all':!![]}];}_0x513157=_[_0x11bc('0x3e')]({},_0x513157,_0x43cb9c[_0x11bc('0x43')]);return db[_0x11bc('0x2c')][_0x11bc('0x4b')](_0x513157)[_0x11bc('0x27')](handleEntityNotFound(_0x3dad5,null))['then'](respondWithResult(_0x3dad5,null))[_0x11bc('0x47')](handleError(_0x3dad5,null));};exports['create']=function(_0x54c557,_0x3604cf){return db['ScreenRecording']['create'](_0x54c557[_0x11bc('0x4c')],{})[_0x11bc('0x27')](respondWithResult(_0x3604cf,0xc9))[_0x11bc('0x47')](handleError(_0x3604cf,null));};exports[_0x11bc('0x4d')]=function(_0x3aeedc,_0x1aa110){if(_0x3aeedc['body']['id']){delete _0x3aeedc[_0x11bc('0x4c')]['id'];}delete _0x3aeedc[_0x11bc('0x4c')]['duration'];delete _0x3aeedc[_0x11bc('0x4c')][_0x11bc('0x4e')];delete _0x3aeedc[_0x11bc('0x4c')][_0x11bc('0x4f')];delete _0x3aeedc[_0x11bc('0x4c')][_0x11bc('0x50')];return db[_0x11bc('0x2c')][_0x11bc('0x4b')]({'where':{'id':_0x3aeedc['params']['id']}})['then'](handleEntityNotFound(_0x1aa110,null))[_0x11bc('0x27')](saveUpdates(_0x3aeedc[_0x11bc('0x4c')],null))[_0x11bc('0x27')](respondWithResult(_0x1aa110,null))['catch'](handleError(_0x1aa110,null));};exports['destroy']=function(_0x308821,_0x3e7fd2){return db[_0x11bc('0x2c')][_0x11bc('0x4b')]({'where':{'id':_0x308821[_0x11bc('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e7fd2,null))[_0x11bc('0x27')](removeEntity(_0x3e7fd2,null))[_0x11bc('0x47')](handleError(_0x3e7fd2,null));};exports[_0x11bc('0x52')]=function(_0x82254a,_0xdb6a51){return db[_0x11bc('0x2c')][_0x11bc('0x52')]()[_0x11bc('0x27')](respondWithResult(_0xdb6a51,null))[_0x11bc('0x47')](handleError(_0xdb6a51,null));};exports['download']=function(_0x27e04a,_0x7c049b,_0x80b510){var _0x2fe32e=require(_0x11bc('0x53'));var _0x1794a0=![];var _0x499b03={};if(_0x27e04a[_0x11bc('0x32')][_0x11bc('0x40')]&&_0x27e04a['query'][_0x11bc('0x40')]==='uniqueid'){_0x499b03[_0x11bc('0x54')]=_0x27e04a[_0x11bc('0x51')]['id'];}else{_0x499b03['id']=_0x27e04a[_0x11bc('0x51')]['id'];}return db[_0x11bc('0x2c')][_0x11bc('0x4b')]({'where':_0x499b03,'attributes':['id',_0x11bc('0x50')],'raw':!![]})[_0x11bc('0x27')](handleEntityNotFound(_0x7c049b,null))[_0x11bc('0x27')](function(_0x467302){if(_0x467302){var _0x8fdbcb=path[_0x11bc('0x55')](config['root'],_0x11bc('0x56'),_0x467302[_0x11bc('0x50')]);var _0x23c8b6=util[_0x11bc('0x30')](_0x11bc('0x57'),_0x8fdbcb);if(fs[_0x11bc('0x58')](_0x23c8b6)){_0x1794a0=!![];return _0x2fe32e[_0x11bc('0x59')](_0x23c8b6,_0x8fdbcb,config[_0x11bc('0x5a')]['recording'])[_0x11bc('0x27')](function(){return _0x467302;});}return _0x467302;}})[_0x11bc('0x27')](function(_0x7bce9f){if(_0x7bce9f){var _0x51e152=path[_0x11bc('0x55')](config['root'],_0x11bc('0x56'),_0x7bce9f[_0x11bc('0x50')]);if(!fs['existsSync'](_0x51e152)){throw new db[(_0x11bc('0x5b'))][(_0x11bc('0x5c'))](_0x11bc('0x5d'));}if(_0x7bce9f[_0x11bc('0x5e')]){return _0x7c049b[_0x11bc('0x5f')](_0x51e152,_0x7bce9f[_0x11bc('0x5e')]+path[_0x11bc('0x60')](_0x51e152),function(){if(_0x1794a0){fs[_0x11bc('0x61')](_0x51e152);}});}else{return _0x7c049b['download'](_0x51e152,function(_0x2de622){if(_0x1794a0){fs['unlink'](_0x51e152);}});}}})[_0x11bc('0x47')](function(_0x13e6cf){if(_0x13e6cf[_0x11bc('0x62')]===_0x11bc('0x5d')){_0x7c049b['status'](0x194)['send'](_0x11bc('0x63'));}else{return handleError(_0x7c049b,null);}});}; \ No newline at end of file +var _0x953a=['name','send','ScreenRecording','rawAttributes','differenceBy','keys','format','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','duration','closedAt','value','describe','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x953a,0xf6));var _0xa953=function(_0x484606,_0x1b79a6){_0x484606=_0x484606-0x0;var _0x213c74=_0x953a[_0x484606];return _0x213c74;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa953('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa953('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa953('0x2'));var moment=require(_0xa953('0x3'));var BPromise=require(_0xa953('0x4'));var Mustache=require(_0xa953('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa953('0x6'));var csv=require(_0xa953('0x7'));var ejs=require(_0xa953('0x8'));var fs=require('fs');var _=require(_0xa953('0x9'));var squel=require(_0xa953('0xa'));var crypto=require(_0xa953('0xb'));var jsforce=require(_0xa953('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa953('0x7'));var querystring=require(_0xa953('0xd'));var Papa=require(_0xa953('0xe'));var Redis=require(_0xa953('0xf'));var authService=require(_0xa953('0x10'));var qs=require(_0xa953('0x11'));var hardwareService=require(_0xa953('0x12'));var logger=require(_0xa953('0x13'))(_0xa953('0x14'));var utils=require(_0xa953('0x15'));var config=require(_0xa953('0x16'));var db=require(_0xa953('0x17'))['db'];function respondWithStatusCode(_0x5450ef,_0x5bed95){_0x5bed95=_0x5bed95||0xcc;return function(_0x45d123){if(_0x45d123){return _0x5450ef[_0xa953('0x18')](_0x5bed95);}return _0x5450ef[_0xa953('0x19')](_0x5bed95)[_0xa953('0x1a')]();};}function respondWithResult(_0x17ebfa,_0x47804f){_0x47804f=_0x47804f||0xc8;return function(_0x5642a4){if(_0x5642a4){return _0x17ebfa[_0xa953('0x19')](_0x47804f)[_0xa953('0x1b')](_0x5642a4);}};}function respondWithFilteredResult(_0x587cfe,_0x553be7){return function(_0x345dbd){if(_0x345dbd){var _0x3162a2=_0x345dbd['count'],_0x2ab4e4=_0x553be7[_0xa953('0x1c')],_0x4d3bbe=_0x553be7[_0xa953('0x1c')]+_0x553be7['limit'],_0xbac620;if(_0x4d3bbe>=_0x3162a2){_0x4d3bbe=_0x3162a2;_0xbac620=0xc8;}else{_0xbac620=0xce;}_0x587cfe['status'](_0xbac620);return _0x587cfe[_0xa953('0x1d')](_0xa953('0x1e'),_0x2ab4e4+'-'+_0x4d3bbe+'/'+_0x3162a2)[_0xa953('0x1b')](_0x345dbd);}return null;};}function patchUpdates(_0x3e1954){return function(_0x26abdd){try{jsonpatch[_0xa953('0x1f')](_0x26abdd,_0x3e1954,!![]);}catch(_0x39de58){return BPromise[_0xa953('0x20')](_0x39de58);}return _0x26abdd[_0xa953('0x21')]();};}function saveUpdates(_0x3c6387,_0x9e4b65){return function(_0x44cddc){if(_0x44cddc){return _0x44cddc[_0xa953('0x22')](_0x3c6387)['then'](function(_0x41dc2b){return _0x41dc2b;});}return null;};}function removeEntity(_0x5f56e9,_0x249a00){return function(_0x533f07){if(_0x533f07){return _0x533f07[_0xa953('0x23')]()[_0xa953('0x24')](function(){_0x5f56e9[_0xa953('0x19')](0xcc)[_0xa953('0x1a')]();});}};}function handleEntityNotFound(_0x425ecc,_0x4ce3ee){return function(_0x871b0a){if(!_0x871b0a){_0x425ecc['sendStatus'](0x194);}return _0x871b0a;};}function handleError(_0x159574,_0x232269){_0x232269=_0x232269||0x1f4;return function(_0x47c9fd){logger[_0xa953('0x25')](_0x47c9fd[_0xa953('0x26')]);if(_0x47c9fd[_0xa953('0x27')]){delete _0x47c9fd[_0xa953('0x27')];}_0x159574[_0xa953('0x19')](_0x232269)[_0xa953('0x28')](_0x47c9fd);};}exports['index']=function(_0x48453a,_0x3d04b5){var _0x3bf9f9={},_0x585656={},_0x590e86={'count':0x0,'rows':[]};var _0x32af2c=db[_0xa953('0x29')][_0xa953('0x2a')];_0x585656['model']=_[_0xa953('0x2b')](_[_0xa953('0x2c')](_0x32af2c),[_0xa953('0x2d')]);_0x585656[_0xa953('0x2e')]=_[_0xa953('0x2c')](_0x48453a[_0xa953('0x2e')]);_0x585656['filters']=_['intersection'](_0x585656['model'],_0x585656[_0xa953('0x2e')]);_0x3bf9f9[_0xa953('0x2f')]=_[_0xa953('0x30')](_0x585656[_0xa953('0x31')],qs['fields'](_0x48453a[_0xa953('0x2e')][_0xa953('0x32')]));_0x3bf9f9[_0xa953('0x2f')]=_0x3bf9f9['attributes'][_0xa953('0x33')]?_0x3bf9f9[_0xa953('0x2f')]:_0x585656['model'];if(!_0x48453a[_0xa953('0x2e')][_0xa953('0x34')](_0xa953('0x35'))){_0x3bf9f9[_0xa953('0x36')]=qs['limit'](_0x48453a[_0xa953('0x2e')][_0xa953('0x36')]);_0x3bf9f9['offset']=qs[_0xa953('0x1c')](_0x48453a['query'][_0xa953('0x1c')]);}_0x3bf9f9['order']=qs[_0xa953('0x37')](_0x48453a['query']['sort']);_0x3bf9f9[_0xa953('0x38')]=qs[_0xa953('0x39')](_[_0xa953('0x3a')](_0x48453a[_0xa953('0x2e')],_0x585656[_0xa953('0x39')]));if(_0x48453a[_0xa953('0x2e')]['filter']){_0x3bf9f9[_0xa953('0x38')]=_['merge'](_0x3bf9f9[_0xa953('0x38')],{'$or':_['map'](_0x32af2c,function(_0x2c04eb){if(_0x2c04eb[_0xa953('0x3b')][_0xa953('0x3c')]!==_0xa953('0x3d')){var _0x5749dd={};_0x5749dd[_0x2c04eb[_0xa953('0x3e')]]={'$like':'%'+_0x48453a[_0xa953('0x2e')][_0xa953('0x3f')]+'%'};return _0x5749dd;}})});}_0x3bf9f9=_[_0xa953('0x40')]({},_0x3bf9f9,_0x48453a[_0xa953('0x41')]);var _0x58b0fb={'where':_0x3bf9f9['where']};return db[_0xa953('0x29')][_0xa953('0x42')](_0x58b0fb)[_0xa953('0x24')](function(_0x1653b1){_0x590e86[_0xa953('0x42')]=_0x1653b1;if(_0x48453a['query'][_0xa953('0x43')]){_0x3bf9f9[_0xa953('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xa953('0x45')](_0x3bf9f9);})[_0xa953('0x24')](function(_0x2ebb8d){_0x590e86[_0xa953('0x46')]=_0x2ebb8d;return _0x590e86;})['then'](respondWithFilteredResult(_0x3d04b5,_0x3bf9f9))[_0xa953('0x47')](handleError(_0x3d04b5,null));};exports['show']=function(_0x35cf40,_0x34dcc7){var _0x96eac7={'raw':![],'where':{'id':_0x35cf40[_0xa953('0x48')]['id']}},_0x3da722={};_0x3da722[_0xa953('0x31')]=_[_0xa953('0x2c')](db[_0xa953('0x29')][_0xa953('0x2a')]);_0x3da722[_0xa953('0x2e')]=_[_0xa953('0x2c')](_0x35cf40[_0xa953('0x2e')]);_0x3da722[_0xa953('0x39')]=_[_0xa953('0x30')](_0x3da722[_0xa953('0x31')],_0x3da722[_0xa953('0x2e')]);_0x96eac7[_0xa953('0x2f')]=_[_0xa953('0x30')](_0x3da722[_0xa953('0x31')],qs[_0xa953('0x32')](_0x35cf40[_0xa953('0x2e')][_0xa953('0x32')]));_0x96eac7[_0xa953('0x2f')]=_0x96eac7['attributes']['length']?_0x96eac7[_0xa953('0x2f')]:_0x3da722[_0xa953('0x31')];if(_0x35cf40[_0xa953('0x2e')][_0xa953('0x43')]){_0x96eac7[_0xa953('0x44')]=[{'all':!![]}];}_0x96eac7=_['merge']({},_0x96eac7,_0x35cf40['options']);return db[_0xa953('0x29')][_0xa953('0x49')](_0x96eac7)[_0xa953('0x24')](handleEntityNotFound(_0x34dcc7,null))['then'](respondWithResult(_0x34dcc7,null))[_0xa953('0x47')](handleError(_0x34dcc7,null));};exports[_0xa953('0x4a')]=function(_0x3115a7,_0x105d24){return db['ScreenRecording'][_0xa953('0x4a')](_0x3115a7[_0xa953('0x4b')],{})[_0xa953('0x24')](respondWithResult(_0x105d24,0xc9))[_0xa953('0x47')](handleError(_0x105d24,null));};exports[_0xa953('0x22')]=function(_0x338b15,_0x19cada){if(_0x338b15[_0xa953('0x4b')]['id']){delete _0x338b15['body']['id'];}delete _0x338b15[_0xa953('0x4b')][_0xa953('0x4c')];delete _0x338b15[_0xa953('0x4b')]['createdAt'];delete _0x338b15[_0xa953('0x4b')][_0xa953('0x4d')];delete _0x338b15[_0xa953('0x4b')][_0xa953('0x4e')];return db[_0xa953('0x29')][_0xa953('0x49')]({'where':{'id':_0x338b15[_0xa953('0x48')]['id']}})[_0xa953('0x24')](handleEntityNotFound(_0x19cada,null))[_0xa953('0x24')](saveUpdates(_0x338b15[_0xa953('0x4b')],null))[_0xa953('0x24')](respondWithResult(_0x19cada,null))['catch'](handleError(_0x19cada,null));};exports['destroy']=function(_0xf08874,_0x15f90b){return db[_0xa953('0x29')][_0xa953('0x49')]({'where':{'id':_0xf08874[_0xa953('0x48')]['id']}})[_0xa953('0x24')](handleEntityNotFound(_0x15f90b,null))['then'](removeEntity(_0x15f90b,null))[_0xa953('0x47')](handleError(_0x15f90b,null));};exports['describe']=function(_0x30757a,_0x5e84e2){return db[_0xa953('0x29')][_0xa953('0x4f')]()[_0xa953('0x24')](respondWithResult(_0x5e84e2,null))[_0xa953('0x47')](handleError(_0x5e84e2,null));};exports['download']=function(_0x5c6dff,_0x48fba4,_0x48615e){var _0x42491e=require('../../components/encryptor');var _0x2c2928=![];var _0x12ccf4={};if(_0x5c6dff[_0xa953('0x2e')]['type']&&_0x5c6dff['query'][_0xa953('0x3b')]===_0xa953('0x50')){_0x12ccf4['uniqueid']=_0x5c6dff[_0xa953('0x48')]['id'];}else{_0x12ccf4['id']=_0x5c6dff[_0xa953('0x48')]['id'];}return db[_0xa953('0x29')][_0xa953('0x49')]({'where':_0x12ccf4,'attributes':['id','value'],'raw':!![]})[_0xa953('0x24')](handleEntityNotFound(_0x48fba4,null))[_0xa953('0x24')](function(_0x162e10){if(_0x162e10){var _0xf3d402=path[_0xa953('0x51')](config[_0xa953('0x52')],_0xa953('0x53'),_0x162e10[_0xa953('0x4e')]);var _0x2ea595=util[_0xa953('0x2d')]('%s.cypher',_0xf3d402);if(fs[_0xa953('0x54')](_0x2ea595)){_0x2c2928=!![];return _0x42491e[_0xa953('0x55')](_0x2ea595,_0xf3d402,config[_0xa953('0x56')][_0xa953('0x57')])['then'](function(){return _0x162e10;});}return _0x162e10;}})[_0xa953('0x24')](function(_0x552936){if(_0x552936){var _0x316da6=path[_0xa953('0x51')](config[_0xa953('0x52')],'server/files/screen_recordings',_0x552936['value']);if(!fs[_0xa953('0x54')](_0x316da6)){throw new db['Sequelize']['ValidationError'](_0xa953('0x58'));}if(_0x552936[_0xa953('0x59')]){return _0x48fba4['download'](_0x316da6,_0x552936[_0xa953('0x59')]+path[_0xa953('0x5a')](_0x316da6),function(){if(_0x2c2928){fs[_0xa953('0x5b')](_0x316da6);}});}else{return _0x48fba4[_0xa953('0x5c')](_0x316da6,function(_0x5dbe9d){if(_0x2c2928){fs[_0xa953('0x5b')](_0x316da6);}});}}})[_0xa953('0x47')](function(_0x34569f){if(_0x34569f[_0xa953('0x5d')]===_0xa953('0x58')){_0x48fba4[_0xa953('0x19')](0x194)[_0xa953('0x28')](_0xa953('0x5e'));}else{return handleError(_0x48fba4,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 15f4c98..0716540 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 _0x3877=['server','files','existsSync','log','catch','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','isNil','value','join'];(function(_0x2bc400,_0x27208f){var _0x36ab53=function(_0x257660){while(--_0x257660){_0x2bc400['push'](_0x2bc400['shift']());}};_0x36ab53(++_0x27208f);}(_0x3877,0xcc));var _0x7387=function(_0x3d5bfa,_0xf9b44a){_0x3d5bfa=_0x3d5bfa-0x0;var _0x422190=_0x3877[_0x3d5bfa];return _0x422190;};'use strict';var _=require(_0x7387('0x0'));var util=require(_0x7387('0x1'));var logger=require(_0x7387('0x2'))(_0x7387('0x3'));var moment=require(_0x7387('0x4'));var BPromise=require(_0x7387('0x5'));var rp=require(_0x7387('0x6'));var fs=require('fs');var path=require(_0x7387('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7387('0x8'));module[_0x7387('0x9')]=function(_0x443448,_0x134ad2){return _0x443448['define'](_0x7387('0xa'),attributes,{'tableName':_0x7387('0xb'),'paranoid':![],'indexes':[{'name':_0x7387('0xc'),'fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x3f3990,_0x166443,_0x3af416){return new BPromise(function(_0x27da3b,_0x2464d1){if(!_[_0x7387('0xd')](_0x3f3990[_0x7387('0xe')])){var _0x324196=path[_0x7387('0xf')](config['root'],_0x7387('0x10'),_0x7387('0x11'),_0x7387('0xb'),_0x3f3990[_0x7387('0xe')]);if(fs[_0x7387('0x12')](_0x324196)){rimraf(_0x324196,function(_0x33014e){if(_0x33014e){console[_0x7387('0x13')](_0x33014e);}});}}_0x27da3b();})[_0x7387('0x14')](function(_0x267a9d){BPromise['resolve']();})[_0x7387('0x15')](function(){_0x3af416();});}}});}; \ No newline at end of file +var _0x8671=['resolve','finally','lodash','../../config/logger','moment','request-promise','path','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','isNil','value','root','server','files','existsSync','log','catch'];(function(_0x11ba04,_0x4f8074){var _0x18bb27=function(_0x559bf8){while(--_0x559bf8){_0x11ba04['push'](_0x11ba04['shift']());}};_0x18bb27(++_0x4f8074);}(_0x8671,0x178));var _0x1867=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8671[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x1867('0x0'));var util=require('util');var logger=require(_0x1867('0x1'))('api');var moment=require(_0x1867('0x2'));var BPromise=require('bluebird');var rp=require(_0x1867('0x3'));var fs=require('fs');var path=require(_0x1867('0x4'));var rimraf=require(_0x1867('0x5'));var config=require('../../config/environment');var attributes=require(_0x1867('0x6'));module[_0x1867('0x7')]=function(_0x213f32,_0xf25f6){return _0x213f32[_0x1867('0x8')](_0x1867('0x9'),attributes,{'tableName':_0x1867('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x1867('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x13b1a9,_0x3a305b,_0x149dfa){return new BPromise(function(_0x3ed9ff,_0xf7d799){if(!_[_0x1867('0xc')](_0x13b1a9[_0x1867('0xd')])){var _0x3c7ae4=path['join'](config[_0x1867('0xe')],_0x1867('0xf'),_0x1867('0x10'),_0x1867('0xa'),_0x13b1a9[_0x1867('0xd')]);if(fs[_0x1867('0x11')](_0x3c7ae4)){rimraf(_0x3c7ae4,function(_0x2c0379){if(_0x2c0379){console[_0x1867('0x12')](_0x2c0379);}});}}_0x3ed9ff();})[_0x1867('0x13')](function(_0xaf6dbe){BPromise[_0x1867('0x14')]();})[_0x1867('0x15')](function(){_0x149dfa();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a8d434a..c1d0947 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1fb7c9,_0xb14ddf){_0x1fb7c9=_0x1fb7c9-0x0;var _0x5f0c3a=_0xcb99[_0x1fb7c9];return _0x5f0c3a;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('ScreenRecording,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0x57d4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x302579,_0x15820f){var _0x3f4cbc=function(_0x22eacf){while(--_0x22eacf){_0x302579['push'](_0x302579['shift']());}};_0x3f4cbc(++_0x15820f);}(_0x57d4,0x78));var _0x457d=function(_0x31925d,_0x139bcb){_0x31925d=_0x31925d-0x0;var _0x40230b=_0x57d4[_0x31925d];return _0x40230b;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6816,_0x1fc199,_0x381e22){return new BPromise(function(_0x4e32c0,_0x5dff56){return client[_0x457d('0xd')](_0x5c6816,_0x381e22)[_0x457d('0xe')](function(_0x127b89){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x1fc199,'request\x20sent');logger[_0x457d('0xf')](_0x457d('0x10'),_0x1fc199,_0x457d('0x11'),JSON[_0x457d('0x12')](_0x127b89));if(_0x127b89[_0x457d('0x13')]){if(_0x127b89[_0x457d('0x13')][_0x457d('0x14')]===0x1f4){logger[_0x457d('0x13')](_0x457d('0x15'),_0x1fc199,_0x127b89['error'][_0x457d('0x16')]);return _0x5dff56(_0x127b89[_0x457d('0x13')]['message']);}logger['error'](_0x457d('0x15'),_0x1fc199,_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);return _0x4e32c0(_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);}else{logger[_0x457d('0x17')](_0x457d('0x15'),_0x1fc199,_0x457d('0x11'));_0x4e32c0(_0x127b89['result'][_0x457d('0x16')]);}})[_0x457d('0x18')](function(_0x2c05ca){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1fc199,_0x2c05ca);_0x5dff56(_0x2c05ca);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 8989859..8665dad 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 _0xb409=['put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','/:id/logo','single','addLogo','logologin','post','file','addLogoLogin','join','preferred','/:id/preferred','addPreferred'];(function(_0x372204,_0x1f3cf9){var _0x53e192=function(_0x56e378){while(--_0x56e378){_0x372204['push'](_0x372204['shift']());}};_0x53e192(++_0x1f3cf9);}(_0xb409,0x174));var _0x9b40=function(_0x44a0b8,_0x4d9270){_0x44a0b8=_0x44a0b8-0x0;var _0xe9e735=_0xb409[_0x44a0b8];return _0xe9e735;};'use strict';var multer=require(_0x9b40('0x0'));var util=require(_0x9b40('0x1'));var path=require(_0x9b40('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b40('0x3'));var router=express[_0x9b40('0x4')]();var auth=require(_0x9b40('0x5'));var interaction=require(_0x9b40('0x6'));var config=require(_0x9b40('0x7'));var controller=require(_0x9b40('0x8'));router[_0x9b40('0x9')]('/',auth[_0x9b40('0xa')](),controller['index']);router[_0x9b40('0x9')](_0x9b40('0xb'),controller[_0x9b40('0xc')]);router[_0x9b40('0x9')]('/:id/logo',controller[_0x9b40('0xd')]);router['get'](_0x9b40('0xe'),controller[_0x9b40('0xf')]);router[_0x9b40('0x9')](_0x9b40('0x10'),controller[_0x9b40('0x11')]);router['get']('/:id/preferred',controller[_0x9b40('0x12')]);var upload=multer({'storage':multer[_0x9b40('0x13')]({'destination':function(_0x171b26,_0x48d2e8,_0x54330d){_0x54330d(null,path['join'](config[_0x9b40('0x14')],_0x9b40('0x15')));},'filename':function(_0x38c3ce,_0x4e8f91,_0x54a8fb){_0x54a8fb(null,util[_0x9b40('0x16')](_0x9b40('0x17'),_0x9b40('0x18'),path[_0x9b40('0x19')](_0x4e8f91[_0x9b40('0x1a')])));}})});router['post'](_0x9b40('0x1b'),upload[_0x9b40('0x1c')]('file'),controller[_0x9b40('0x1d')]);var upload=multer({'storage':multer[_0x9b40('0x13')]({'destination':function(_0xffdade,_0x31d4fb,_0x253c83){_0x253c83(null,path['join'](config[_0x9b40('0x14')],_0x9b40('0x15')));},'filename':function(_0x20c813,_0x58e5f0,_0x430bef){_0x430bef(null,util['format'](_0x9b40('0x17'),_0x9b40('0x1e'),path[_0x9b40('0x19')](_0x58e5f0['originalname'])));}})});router[_0x9b40('0x1f')](_0x9b40('0xe'),upload[_0x9b40('0x1c')](_0x9b40('0x20')),controller[_0x9b40('0x21')]);var upload=multer({'storage':multer[_0x9b40('0x13')]({'destination':function(_0x4e608a,_0x38ab5e,_0x30ed93){_0x30ed93(null,path[_0x9b40('0x22')](config[_0x9b40('0x14')],_0x9b40('0x15')));},'filename':function(_0x407bae,_0x8abcfe,_0x2f4852){_0x2f4852(null,util[_0x9b40('0x16')](_0x9b40('0x17'),_0x9b40('0x23'),path[_0x9b40('0x19')](_0x8abcfe['originalname'])));}})});router[_0x9b40('0x1f')](_0x9b40('0x24'),upload[_0x9b40('0x1c')]('file'),controller[_0x9b40('0x25')]);router[_0x9b40('0x26')](_0x9b40('0xb'),auth[_0x9b40('0xa')](),controller[_0x9b40('0x27')]);module[_0x9b40('0x28')]=router; \ No newline at end of file +var _0xc76b=['root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','addLogo','logologin','post','file','addLogoLogin','preferred','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','diskStorage','join'];(function(_0x1938f4,_0x5c0c98){var _0x37f4db=function(_0x5bec0c){while(--_0x5bec0c){_0x1938f4['push'](_0x1938f4['shift']());}};_0x37f4db(++_0x5c0c98);}(_0xc76b,0x1e4));var _0xbc76=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc76b[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xbc76('0x0'));var util=require(_0xbc76('0x1'));var path=require(_0xbc76('0x2'));var timeout=require(_0xbc76('0x3'));var express=require(_0xbc76('0x4'));var router=express[_0xbc76('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbc76('0x6'));var config=require(_0xbc76('0x7'));var controller=require(_0xbc76('0x8'));router[_0xbc76('0x9')]('/',auth[_0xbc76('0xa')](),controller['index']);router['get']('/:id',controller['show']);router[_0xbc76('0x9')](_0xbc76('0xb'),controller[_0xbc76('0xc')]);router['get'](_0xbc76('0xd'),controller[_0xbc76('0xe')]);router['get'](_0xbc76('0xf'),controller[_0xbc76('0x10')]);router[_0xbc76('0x9')](_0xbc76('0x11'),controller['getPreferred']);var upload=multer({'storage':multer[_0xbc76('0x12')]({'destination':function(_0x33dfd3,_0x1e7f11,_0x1e8d25){_0x1e8d25(null,path[_0xbc76('0x13')](config[_0xbc76('0x14')],_0xbc76('0x15')));},'filename':function(_0x4b7216,_0xaa8365,_0x449bde){_0x449bde(null,util[_0xbc76('0x16')](_0xbc76('0x17'),_0xbc76('0x18'),path[_0xbc76('0x19')](_0xaa8365[_0xbc76('0x1a')])));}})});router['post']('/:id/logo',upload[_0xbc76('0x1b')]('file'),controller[_0xbc76('0x1c')]);var upload=multer({'storage':multer[_0xbc76('0x12')]({'destination':function(_0x5efdc2,_0x97943a,_0x2c8aa2){_0x2c8aa2(null,path[_0xbc76('0x13')](config['root'],_0xbc76('0x15')));},'filename':function(_0xfcc35d,_0x165899,_0x26a877){_0x26a877(null,util['format'](_0xbc76('0x17'),_0xbc76('0x1d'),path[_0xbc76('0x19')](_0x165899['originalname'])));}})});router[_0xbc76('0x1e')](_0xbc76('0xd'),upload[_0xbc76('0x1b')](_0xbc76('0x1f')),controller[_0xbc76('0x20')]);var upload=multer({'storage':multer[_0xbc76('0x12')]({'destination':function(_0x55dd56,_0xc4495c,_0x4e150d){_0x4e150d(null,path[_0xbc76('0x13')](config['root'],_0xbc76('0x15')));},'filename':function(_0x345fda,_0xdc567b,_0x157776){_0x157776(null,util[_0xbc76('0x16')](_0xbc76('0x17'),_0xbc76('0x21'),path[_0xbc76('0x19')](_0xdc567b['originalname'])));}})});router[_0xbc76('0x1e')]('/:id/preferred',upload[_0xbc76('0x1b')](_0xbc76('0x1f')),controller['addPreferred']);router['put']('/:id',auth[_0xbc76('0xa')](),controller[_0xbc76('0x22')]);module[_0xbc76('0x23')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8302490..0b071fd 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 _0x2fe3=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','STRING','BOOLEAN'];(function(_0x753026,_0x34dc5c){var _0x443ddf=function(_0x499149){while(--_0x499149){_0x753026['push'](_0x753026['shift']());}};_0x443ddf(++_0x34dc5c);}(_0x2fe3,0x87));var _0x32fe=function(_0x260dac,_0x4cf98d){_0x260dac=_0x260dac-0x0;var _0x513356=_0x2fe3[_0x260dac];return _0x513356;};'use strict';var Sequelize=require(_0x32fe('0x0'));module[_0x32fe('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32fe('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x32fe('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x32fe('0x3')]},'defaultLogo':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x32fe('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32fe('0x3')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x32fe('0x3')]},'turnpassword':{'type':Sequelize[_0x32fe('0x3')]},'pageTitle':{'type':Sequelize[_0x32fe('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32fe('0x3')],'defaultValue':_0x32fe('0x5')},'enableEmailPreview':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32fe('0x3')],'defaultValue':_0x32fe('0x6')},'chatTimeout':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x32fe('0x3')]},'defaultPreferred':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32fe('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x32fe('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x97e7=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x2bd62b,_0x4df645){var _0x4c3a52=function(_0x4af77d){while(--_0x4af77d){_0x2bd62b['push'](_0x2bd62b['shift']());}};_0x4c3a52(++_0x4df645);}(_0x97e7,0x1a1));var _0x797e=function(_0x3cbd84,_0xea3669){_0x3cbd84=_0x3cbd84-0x0;var _0x1aa334=_0x97e7[_0x3cbd84];return _0x1aa334;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'min_internal':{'type':Sequelize[_0x797e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x797e('0x2')](0xb),'unique':_0x797e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x797e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x797e('0x4')],'defaultValue':_0x797e('0x5')},'logo':{'type':Sequelize[_0x797e('0x4')]},'defaultLogo':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x797e('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x797e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x797e('0x4')]},'turnaddr':{'type':Sequelize[_0x797e('0x4')]},'turnusername':{'type':Sequelize[_0x797e('0x4')]},'turnpassword':{'type':Sequelize[_0x797e('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x797e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x797e('0x4')],'defaultValue':_0x797e('0x7')},'enableEmailPreview':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x797e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x797e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x797e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x797e('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x797e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x797e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x797e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 18324be..4fb278d 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 _0x11ea=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','count','offset','status','set','Content-Range','json','apply','save','update','then','stack','name','send','index','Setting','rawAttributes','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where','type','key','VIRTUAL','merge','options','includeAll','rows','intersection','include','find','body','get','readFileSync','join','root','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','filename','logo','params','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','loginLogo','preferred','defaultLogo','defaultLoginLogo','existsSync','toLower','default_logo.png','upperFirst','Sequelize','ValidationError','Logo\x20not\x20found','getLicense','defaultPreferred','default','download','gdpr','addPreferred','custom','default_preferred.png','eml-format','rimraf'];(function(_0x15c65b,_0x506df3){var _0x256424=function(_0x15b381){while(--_0x15b381){_0x15c65b['push'](_0x15c65b['shift']());}};_0x256424(++_0x506df3);}(_0x11ea,0x77));var _0xa11e=function(_0x51bff7,_0xe0cc0d){_0x51bff7=_0x51bff7-0x0;var _0x11c59d=_0x11ea[_0x51bff7];return _0x11c59d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa11e('0x0'));var rimraf=require(_0xa11e('0x1'));var zipdir=require(_0xa11e('0x2'));var jsonpatch=require(_0xa11e('0x3'));var rp=require(_0xa11e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa11e('0x5'));var util=require(_0xa11e('0x6'));var path=require(_0xa11e('0x7'));var sox=require(_0xa11e('0x8'));var csv=require(_0xa11e('0x9'));var ejs=require(_0xa11e('0xa'));var fs=require('fs');var _=require(_0xa11e('0xb'));var squel=require(_0xa11e('0xc'));var crypto=require(_0xa11e('0xd'));var jsforce=require(_0xa11e('0xe'));var deskjs=require(_0xa11e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa11e('0x10'));var Papa=require(_0xa11e('0x11'));var Redis=require(_0xa11e('0x12'));var authService=require(_0xa11e('0x13'));var qs=require(_0xa11e('0x14'));var hardwareService=require(_0xa11e('0x15'));var logger=require(_0xa11e('0x16'))('api');var utils=require(_0xa11e('0x17'));var config=require(_0xa11e('0x18'));var db=require(_0xa11e('0x19'))['db'];var jayson=require(_0xa11e('0x1a'));var client=jayson['client'][_0xa11e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x22dd35,_0x1ad97e,_0x11e10d){if(_0x11e10d){var _0x4a80c4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a80c4[_0xa11e('0x1c')](_0x1ad97e)){return _0x22dd35;}else{throw new Error(_0xa11e('0x1d'));}}else{return _0x22dd35;}}function respondWithRpcPromise(_0x13fc3c,_0x249685,_0x20f40c,_0x4f3b37){return new BPromise(function(_0x49f0ca,_0x38335d){var _0x32d2bf=_0x4f3b37||client;return _0x32d2bf['request'](_0x13fc3c,_0x20f40c)['then'](function(_0x400582){logger[_0xa11e('0x1e')](_0xa11e('0x1f'),_0x249685,_0xa11e('0x20'));logger['debug'](_0xa11e('0x21'),_0x249685,_0xa11e('0x20'),JSON[_0xa11e('0x22')](_0x400582));if(_0x400582['error']){if(_0x400582[_0xa11e('0x23')][_0xa11e('0x24')]===0x1f4){logger[_0xa11e('0x23')](_0xa11e('0x1f'),_0x249685,_0x400582[_0xa11e('0x23')][_0xa11e('0x25')]);return _0x38335d(_0x400582[_0xa11e('0x23')][_0xa11e('0x25')]);}logger[_0xa11e('0x23')](_0xa11e('0x1f'),_0x249685,_0x400582['error'][_0xa11e('0x25')]);return _0x49f0ca(_0x400582[_0xa11e('0x23')][_0xa11e('0x25')]);}else{logger[_0xa11e('0x1e')](_0xa11e('0x1f'),_0x249685,_0xa11e('0x20'));_0x49f0ca(_0x400582[_0xa11e('0x26')][_0xa11e('0x25')]);}})[_0xa11e('0x27')](function(_0x1eba56){logger[_0xa11e('0x23')](_0xa11e('0x1f'),_0x249685,_0x1eba56);_0x38335d(_0x1eba56);});});}function respondWithStatusCode(_0x5ca940,_0x415024){_0x415024=_0x415024||0xcc;return function(_0x247149){if(_0x247149){return _0x5ca940[_0xa11e('0x28')](_0x415024);}return _0x5ca940['status'](_0x415024)[_0xa11e('0x29')]();};}function respondWithResult(_0x13e793,_0x574706){_0x574706=_0x574706||0xc8;return function(_0x1a1a04){if(_0x1a1a04){return _0x13e793['status'](_0x574706)['json'](_0x1a1a04);}};}function respondWithFilteredResult(_0x1f68fd,_0x5631e8){return function(_0x16e205){if(_0x16e205){var _0x5613e8=_0x16e205[_0xa11e('0x2a')],_0x9bb04b=_0x5631e8[_0xa11e('0x2b')],_0x3c48e7=_0x5631e8['offset']+_0x5631e8['limit'],_0x5d84b7;if(_0x3c48e7>=_0x5613e8){_0x3c48e7=_0x5613e8;_0x5d84b7=0xc8;}else{_0x5d84b7=0xce;}_0x1f68fd[_0xa11e('0x2c')](_0x5d84b7);return _0x1f68fd[_0xa11e('0x2d')](_0xa11e('0x2e'),_0x9bb04b+'-'+_0x3c48e7+'/'+_0x5613e8)[_0xa11e('0x2f')](_0x16e205);}return null;};}function patchUpdates(_0x43f179){return function(_0x5235f8){try{jsonpatch[_0xa11e('0x30')](_0x5235f8,_0x43f179,!![]);}catch(_0x47174c){return BPromise['reject'](_0x47174c);}return _0x5235f8[_0xa11e('0x31')]();};}function saveUpdates(_0x528bb6,_0x3e9d19){return function(_0x457a81){if(_0x457a81){return _0x457a81[_0xa11e('0x32')](_0x528bb6)['then'](function(_0x4a0a0d){return _0x4a0a0d;});}return null;};}function removeEntity(_0x2cc36b,_0x1069e8){return function(_0x18e81e){if(_0x18e81e){return _0x18e81e['destroy']()[_0xa11e('0x33')](function(){_0x2cc36b[_0xa11e('0x2c')](0xcc)[_0xa11e('0x29')]();});}};}function handleEntityNotFound(_0x2f4c25,_0x656573){return function(_0x45e24b){if(!_0x45e24b){_0x2f4c25['sendStatus'](0x194);}return _0x45e24b;};}function handleError(_0x5d513e,_0x5a5b06){_0x5a5b06=_0x5a5b06||0x1f4;return function(_0x59cdc2){logger[_0xa11e('0x23')](_0x59cdc2[_0xa11e('0x34')]);if(_0x59cdc2[_0xa11e('0x35')]){delete _0x59cdc2[_0xa11e('0x35')];}_0x5d513e[_0xa11e('0x2c')](_0x5a5b06)[_0xa11e('0x36')](_0x59cdc2);};}exports[_0xa11e('0x37')]=function(_0x2c4d1b,_0x32bc04){var _0x541bc8={},_0x5579c9={},_0x581797={'count':0x0,'rows':[]};var _0x17239c=db[_0xa11e('0x38')][_0xa11e('0x39')];_0x5579c9[_0xa11e('0x3a')]=_['keys'](_0x17239c);_0x5579c9[_0xa11e('0x3b')]=_[_0xa11e('0x3c')](_0x2c4d1b[_0xa11e('0x3b')]);_0x5579c9['filters']=_['intersection'](_0x5579c9[_0xa11e('0x3a')],_0x5579c9[_0xa11e('0x3b')]);_0x541bc8['attributes']=_['intersection'](_0x5579c9['model'],qs['fields'](_0x2c4d1b[_0xa11e('0x3b')][_0xa11e('0x3d')]));_0x541bc8[_0xa11e('0x3e')]=_0x541bc8[_0xa11e('0x3e')][_0xa11e('0x3f')]?_0x541bc8[_0xa11e('0x3e')]:_0x5579c9[_0xa11e('0x3a')];if(!_0x2c4d1b[_0xa11e('0x3b')][_0xa11e('0x40')](_0xa11e('0x41'))){_0x541bc8['limit']=qs[_0xa11e('0x42')](_0x2c4d1b['query'][_0xa11e('0x42')]);_0x541bc8[_0xa11e('0x2b')]=qs['offset'](_0x2c4d1b[_0xa11e('0x3b')][_0xa11e('0x2b')]);}_0x541bc8['order']=qs[_0xa11e('0x43')](_0x2c4d1b[_0xa11e('0x3b')][_0xa11e('0x43')]);_0x541bc8['where']=qs[_0xa11e('0x44')](_[_0xa11e('0x45')](_0x2c4d1b['query'],_0x5579c9[_0xa11e('0x44')]));if(_0x2c4d1b[_0xa11e('0x3b')]['filter']){_0x541bc8[_0xa11e('0x46')]=_['merge'](_0x541bc8[_0xa11e('0x46')],{'$or':_['map'](_0x17239c,function(_0x1d0d15){if(_0x1d0d15[_0xa11e('0x47')][_0xa11e('0x48')]!==_0xa11e('0x49')){var _0x234ded={};_0x234ded[_0x1d0d15['field']]={'$like':'%'+_0x2c4d1b[_0xa11e('0x3b')]['filter']+'%'};return _0x234ded;}})});}_0x541bc8=_[_0xa11e('0x4a')]({},_0x541bc8,_0x2c4d1b[_0xa11e('0x4b')]);var _0x5834a6={'where':_0x541bc8['where']};return db[_0xa11e('0x38')][_0xa11e('0x2a')](_0x5834a6)[_0xa11e('0x33')](function(_0x4c187e){_0x581797[_0xa11e('0x2a')]=_0x4c187e;if(_0x2c4d1b[_0xa11e('0x3b')][_0xa11e('0x4c')]){_0x541bc8['include']=[{'all':!![]}];}return db[_0xa11e('0x38')]['findAll'](_0x541bc8);})[_0xa11e('0x33')](function(_0x429287){_0x581797[_0xa11e('0x4d')]=_0x429287;return _0x581797;})['then'](respondWithFilteredResult(_0x32bc04,_0x541bc8))[_0xa11e('0x27')](handleError(_0x32bc04,null));};exports['show']=function(_0x60360e,_0x5e3bc2){var _0xea784={'raw':![],'where':{'id':_0x60360e['params']['id']}},_0x4754ad={};_0x4754ad[_0xa11e('0x3a')]=_[_0xa11e('0x3c')](db[_0xa11e('0x38')][_0xa11e('0x39')]);_0x4754ad[_0xa11e('0x3b')]=_[_0xa11e('0x3c')](_0x60360e['query']);_0x4754ad['filters']=_[_0xa11e('0x4e')](_0x4754ad[_0xa11e('0x3a')],_0x4754ad[_0xa11e('0x3b')]);_0xea784['attributes']=_[_0xa11e('0x4e')](_0x4754ad[_0xa11e('0x3a')],qs[_0xa11e('0x3d')](_0x60360e['query'][_0xa11e('0x3d')]));_0xea784[_0xa11e('0x3e')]=_0xea784['attributes'][_0xa11e('0x3f')]?_0xea784[_0xa11e('0x3e')]:_0x4754ad[_0xa11e('0x3a')];if(_0x60360e[_0xa11e('0x3b')][_0xa11e('0x4c')]){_0xea784[_0xa11e('0x4f')]=[{'all':!![]}];}_0xea784=_[_0xa11e('0x4a')]({},_0xea784,_0x60360e['options']);return db[_0xa11e('0x38')][_0xa11e('0x50')](_0xea784)[_0xa11e('0x33')](handleEntityNotFound(_0x5e3bc2,null))[_0xa11e('0x33')](respondWithResult(_0x5e3bc2,null))[_0xa11e('0x27')](handleError(_0x5e3bc2,null));};exports[_0xa11e('0x32')]=function(_0x18008f,_0x57d000,_0x27ee49){var _0x13667f;return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x18008f['params']['id']}})[_0xa11e('0x33')](handleEntityNotFound(_0x57d000,null))[_0xa11e('0x33')](saveUpdates(_0x18008f[_0xa11e('0x51')],null))['then'](function(_0x144e4e){if(_0x144e4e){_0x13667f=_0x144e4e[_0xa11e('0x52')]({'plain':!![]});var _0x222fd5=fs[_0xa11e('0x53')](path['join'](config['root'],'server/files/templates/stun.ejs'),'utf8');var _0x163fd2=ejs['render'](_0x222fd5,_0x13667f);var _0x5d14ea=fs['readFileSync'](path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0xa11e('0x56')),_0xa11e('0x57'));var _0x12dcaa=ejs['render'](_0x5d14ea,_0x13667f);fs[_0xa11e('0x58')](_0xa11e('0x59'),_0x163fd2);fs[_0xa11e('0x58')](_0xa11e('0x5a'),_0x12dcaa);return respondWithRpcPromise(_0xa11e('0x5b'),'update',{'module':_0xa11e('0x5c')});}})['then'](function(){return respondWithRpcPromise(_0xa11e('0x5b'),_0xa11e('0x32'),{'module':_0xa11e('0x5d')});})[_0xa11e('0x33')](function(){return _0x13667f||null;})[_0xa11e('0x33')](respondWithResult(_0x57d000,null))[_0xa11e('0x27')](handleError(_0x57d000,null));};exports['addLogo']=function(_0x49c4e6,_0x42925a,_0x5c0a4a){if(_0x49c4e6[_0xa11e('0x5e')]&&_0x49c4e6[_0xa11e('0x5e')][_0xa11e('0x5f')]){_0x49c4e6[_0xa11e('0x51')][_0xa11e('0x60')]=_0x49c4e6['file']['filename'];}return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x49c4e6[_0xa11e('0x61')]['id']}})[_0xa11e('0x33')](handleEntityNotFound(_0x42925a,null))[_0xa11e('0x33')](saveUpdates(_0x49c4e6[_0xa11e('0x51')],null))['then'](respondWithResult(_0x42925a,null))[_0xa11e('0x27')](handleError(_0x42925a,null));};exports[_0xa11e('0x62')]=function(_0x47c7c7,_0x56c068,_0x114ae4){if(_0x47c7c7[_0xa11e('0x5e')]&&_0x47c7c7[_0xa11e('0x5e')][_0xa11e('0x5f')]){_0x47c7c7[_0xa11e('0x51')]['loginLogo']=_0x47c7c7[_0xa11e('0x5e')][_0xa11e('0x5f')];}return db[_0xa11e('0x38')]['find']({'where':{'id':_0x47c7c7[_0xa11e('0x61')]['id']}})[_0xa11e('0x33')](handleEntityNotFound(_0x56c068,null))[_0xa11e('0x33')](saveUpdates(_0x47c7c7[_0xa11e('0x51')],null))[_0xa11e('0x33')](respondWithResult(_0x56c068,null))[_0xa11e('0x27')](handleError(_0x56c068,null));};var utilLicense=require(_0xa11e('0x63'));exports[_0xa11e('0x64')]=function(_0x231dbf,_0x2b2871,_0x187217){var _0x506e05=_0xa11e('0x65');var _0x5d2982={'custom':![]};return utilLicense['getLicense']()[_0xa11e('0x33')](function(_0xe02774){if(_0xe02774){_0x5d2982=_0xe02774;}return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x231dbf[_0xa11e('0x61')]['id']},'attributes':[_0xa11e('0x60'),_0xa11e('0x66'),_0xa11e('0x67'),_0xa11e('0x68'),_0xa11e('0x69'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x2b2871,null))[_0xa11e('0x33')](function(_0x49b2c2){if(_0x49b2c2){var _0x57c8a0=_0x49b2c2[_0xa11e('0x60')]&&fs[_0xa11e('0x6a')](path['join'](config[_0xa11e('0x55')],_0x506e05,_[_0xa11e('0x6b')](_0x49b2c2[_0xa11e('0x60')])))?path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0x506e05,_[_0xa11e('0x6b')](_0x49b2c2[_0xa11e('0x60')])):path[_0xa11e('0x54')](config['root'],_0x506e05,_[_0xa11e('0x6b')](_0xa11e('0x6c')));var _0x5acce7='default'+_[_0xa11e('0x6d')]('logo');if(_0x49b2c2[_0x5acce7]||!_0x5d2982['custom']){_0x57c8a0=path['join'](config[_0xa11e('0x55')],_0x506e05,_[_0xa11e('0x6b')]('default_logo.png'));}if(!fs[_0xa11e('0x6a')](_0x57c8a0)){throw new db[(_0xa11e('0x6e'))][(_0xa11e('0x6f'))](_0xa11e('0x70'));}return _0x2b2871['download'](_0x57c8a0);}})[_0xa11e('0x27')](handleError(_0x2b2871,null));};var utilLicense=require(_0xa11e('0x63'));exports['getLogoLogin']=function(_0x411368,_0x1f39b7,_0x543ffd){var _0xb8fe47=_0xa11e('0x65');var _0x2dee71={'custom':![]};return utilLicense[_0xa11e('0x71')]()[_0xa11e('0x33')](function(_0x26f97b){if(_0x26f97b){_0x2dee71=_0x26f97b;}return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x411368[_0xa11e('0x61')]['id']},'attributes':[_0xa11e('0x60'),_0xa11e('0x66'),'preferred',_0xa11e('0x68'),'defaultLoginLogo',_0xa11e('0x72')],'raw':!![]});})['then'](handleEntityNotFound(_0x1f39b7,null))[_0xa11e('0x33')](function(_0x1b12c5){if(_0x1b12c5){var _0x16ad32=_0x1b12c5[_0xa11e('0x66')]&&fs[_0xa11e('0x6a')](path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0xb8fe47,_[_0xa11e('0x6b')](_0x1b12c5[_0xa11e('0x66')])))?path[_0xa11e('0x54')](config['root'],_0xb8fe47,_['toLower'](_0x1b12c5['loginLogo'])):path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0xb8fe47,_['toLower']('default_loginLogo.png'));var _0x552e8a=_0xa11e('0x73')+_['upperFirst'](_0xa11e('0x66'));if(_0x1b12c5[_0x552e8a]||!_0x2dee71['custom']){_0x16ad32=path['join'](config[_0xa11e('0x55')],_0xb8fe47,_['toLower']('default_loginLogo.png'));}if(!fs['existsSync'](_0x16ad32)){throw new db[(_0xa11e('0x6e'))][(_0xa11e('0x6f'))](_0xa11e('0x70'));}return _0x1f39b7[_0xa11e('0x74')](_0x16ad32);}})[_0xa11e('0x27')](handleError(_0x1f39b7,null));};exports[_0xa11e('0x75')]=function(_0x31b520,_0x24ba27){return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x31b520[_0xa11e('0x61')]['id']},'attributes':['securePassword']})[_0xa11e('0x33')](respondWithResult(_0x24ba27,null))[_0xa11e('0x27')](handleError(_0x24ba27,null));};exports[_0xa11e('0x76')]=function(_0x31e5fb,_0x404074,_0x36f5e2){if(_0x31e5fb[_0xa11e('0x5e')]&&_0x31e5fb['file']['filename']){_0x31e5fb[_0xa11e('0x51')][_0xa11e('0x67')]=_0x31e5fb[_0xa11e('0x5e')][_0xa11e('0x5f')];}return db[_0xa11e('0x38')][_0xa11e('0x50')]({'where':{'id':_0x31e5fb[_0xa11e('0x61')]['id']}})[_0xa11e('0x33')](handleEntityNotFound(_0x404074,null))[_0xa11e('0x33')](saveUpdates(_0x31e5fb[_0xa11e('0x51')],null))['then'](respondWithResult(_0x404074,null))[_0xa11e('0x27')](handleError(_0x404074,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x5da5d5,_0x188092,_0x2b93a9){var _0x4f7ab1=_0xa11e('0x65');var _0x150006={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5a2e38){if(_0x5a2e38){_0x150006=_0x5a2e38;}return db[_0xa11e('0x38')]['find']({'where':{'id':_0x5da5d5[_0xa11e('0x61')]['id']},'attributes':[_0xa11e('0x60'),_0xa11e('0x66'),_0xa11e('0x67'),_0xa11e('0x68'),_0xa11e('0x69'),_0xa11e('0x72')],'raw':!![]});})[_0xa11e('0x33')](handleEntityNotFound(_0x188092,null))[_0xa11e('0x33')](function(_0x208306){if(_0x208306){var _0x5da95d=_0x208306[_0xa11e('0x67')]&&fs[_0xa11e('0x6a')](path[_0xa11e('0x54')](config['root'],_0x4f7ab1,_[_0xa11e('0x6b')](_0x208306[_0xa11e('0x67')])))?path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0x4f7ab1,_[_0xa11e('0x6b')](_0x208306['preferred'])):path[_0xa11e('0x54')](config[_0xa11e('0x55')],_0x4f7ab1,_[_0xa11e('0x6b')]('default_preferred.png'));var _0x21bc07=_0xa11e('0x73')+_['upperFirst'](_0xa11e('0x67'));if(_0x208306[_0x21bc07]||!_0x150006[_0xa11e('0x77')]||!_0x150006[_0xa11e('0x67')]){_0x5da95d=path['join'](config['root'],_0x4f7ab1,_['toLower'](_0xa11e('0x78')));}if(!fs['existsSync'](_0x5da95d)){throw new db[(_0xa11e('0x6e'))][(_0xa11e('0x6f'))](_0xa11e('0x70'));}return _0x188092['download'](_0x5da95d);}})[_0xa11e('0x27')](handleError(_0x188092,null));}; \ No newline at end of file +var _0xeedd=['limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','Setting','count','include','findAll','rows','catch','show','params','includeAll','find','update','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','server/files/templates/turn.ejs','writeFileSync','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultPreferred','toLower','default_logo.png','default','custom','existsSync','Sequelize','ValidationError','Logo\x20not\x20found','download','defaultLoginLogo','upperFirst','default_loginLogo.png','securePassword','getPreferred','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','status','offset','json','apply','reject','save','then','destroy','end','stack','name','send','index','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0xeedd,0x127));var _0xdeed=function(_0x2e5184,_0x2a255c){_0x2e5184=_0x2e5184-0x0;var _0x4ed8ab=_0xeedd[_0x2e5184];return _0x4ed8ab;};'use strict';var pdf=require(_0xdeed('0x0'));var emlformat=require(_0xdeed('0x1'));var rimraf=require(_0xdeed('0x2'));var zipdir=require(_0xdeed('0x3'));var jsonpatch=require(_0xdeed('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdeed('0x5'));var util=require(_0xdeed('0x6'));var path=require('path');var sox=require(_0xdeed('0x7'));var csv=require(_0xdeed('0x8'));var ejs=require(_0xdeed('0x9'));var fs=require('fs');var _=require(_0xdeed('0xa'));var squel=require(_0xdeed('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdeed('0xc'));var toCsv=require(_0xdeed('0x8'));var querystring=require(_0xdeed('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdeed('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdeed('0xf'));var logger=require('../../config/logger')(_0xdeed('0x10'));var utils=require(_0xdeed('0x11'));var config=require(_0xdeed('0x12'));var db=require(_0xdeed('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xdeed('0x14')]({'port':0x232a});function checkPasswordPattern(_0x43392d,_0x2470aa,_0x53f4d9){if(_0x53f4d9){var _0x1ef7b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ef7b5['test'](_0x2470aa)){return _0x43392d;}else{throw new Error(_0xdeed('0x15'));}}else{return _0x43392d;}}function respondWithRpcPromise(_0x47d09c,_0x24e486,_0x4dd0f1,_0x507675){return new BPromise(function(_0x1e407d,_0x68a67c){var _0x5e5988=_0x507675||client;return _0x5e5988[_0xdeed('0x16')](_0x47d09c,_0x4dd0f1)['then'](function(_0x39e58f){logger['info'](_0xdeed('0x17'),_0x24e486,_0xdeed('0x18'));logger[_0xdeed('0x19')](_0xdeed('0x1a'),_0x24e486,_0xdeed('0x18'),JSON[_0xdeed('0x1b')](_0x39e58f));if(_0x39e58f[_0xdeed('0x1c')]){if(_0x39e58f[_0xdeed('0x1c')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x24e486,_0x39e58f['error'][_0xdeed('0x1d')]);return _0x68a67c(_0x39e58f[_0xdeed('0x1c')][_0xdeed('0x1d')]);}logger[_0xdeed('0x1c')](_0xdeed('0x17'),_0x24e486,_0x39e58f[_0xdeed('0x1c')][_0xdeed('0x1d')]);return _0x1e407d(_0x39e58f[_0xdeed('0x1c')][_0xdeed('0x1d')]);}else{logger[_0xdeed('0x1e')](_0xdeed('0x17'),_0x24e486,'request\x20sent');_0x1e407d(_0x39e58f['result'][_0xdeed('0x1d')]);}})['catch'](function(_0x235fa2){logger['error'](_0xdeed('0x17'),_0x24e486,_0x235fa2);_0x68a67c(_0x235fa2);});});}function respondWithStatusCode(_0x58eff1,_0x4285e8){_0x4285e8=_0x4285e8||0xcc;return function(_0x2c8632){if(_0x2c8632){return _0x58eff1[_0xdeed('0x1f')](_0x4285e8);}return _0x58eff1[_0xdeed('0x20')](_0x4285e8)['end']();};}function respondWithResult(_0x18d6c5,_0x244b97){_0x244b97=_0x244b97||0xc8;return function(_0x1c11ae){if(_0x1c11ae){return _0x18d6c5[_0xdeed('0x20')](_0x244b97)['json'](_0x1c11ae);}};}function respondWithFilteredResult(_0x217710,_0x3fab49){return function(_0xd87548){if(_0xd87548){var _0x31a9d5=_0xd87548['count'],_0x39bbcf=_0x3fab49[_0xdeed('0x21')],_0x42fcdf=_0x3fab49[_0xdeed('0x21')]+_0x3fab49['limit'],_0x53740a;if(_0x42fcdf>=_0x31a9d5){_0x42fcdf=_0x31a9d5;_0x53740a=0xc8;}else{_0x53740a=0xce;}_0x217710[_0xdeed('0x20')](_0x53740a);return _0x217710['set']('Content-Range',_0x39bbcf+'-'+_0x42fcdf+'/'+_0x31a9d5)[_0xdeed('0x22')](_0xd87548);}return null;};}function patchUpdates(_0x456ef4){return function(_0x210d5a){try{jsonpatch[_0xdeed('0x23')](_0x210d5a,_0x456ef4,!![]);}catch(_0x315eb2){return BPromise[_0xdeed('0x24')](_0x315eb2);}return _0x210d5a[_0xdeed('0x25')]();};}function saveUpdates(_0x1ce2cb,_0x40fa51){return function(_0x6412e6){if(_0x6412e6){return _0x6412e6['update'](_0x1ce2cb)[_0xdeed('0x26')](function(_0x26b072){return _0x26b072;});}return null;};}function removeEntity(_0x7edf1c,_0x3d3c3b){return function(_0x1e8cc6){if(_0x1e8cc6){return _0x1e8cc6[_0xdeed('0x27')]()[_0xdeed('0x26')](function(){_0x7edf1c[_0xdeed('0x20')](0xcc)[_0xdeed('0x28')]();});}};}function handleEntityNotFound(_0x5ab384,_0x2b8203){return function(_0x566307){if(!_0x566307){_0x5ab384[_0xdeed('0x1f')](0x194);}return _0x566307;};}function handleError(_0xb9b6f5,_0x545eb0){_0x545eb0=_0x545eb0||0x1f4;return function(_0x4832c8){logger[_0xdeed('0x1c')](_0x4832c8[_0xdeed('0x29')]);if(_0x4832c8['name']){delete _0x4832c8[_0xdeed('0x2a')];}_0xb9b6f5['status'](_0x545eb0)[_0xdeed('0x2b')](_0x4832c8);};}exports[_0xdeed('0x2c')]=function(_0x20b42b,_0xfb9db1){var _0x209c2d={},_0x638903={},_0x4158fb={'count':0x0,'rows':[]};var _0x2561bf=db['Setting'][_0xdeed('0x2d')];_0x638903['model']=_[_0xdeed('0x2e')](_0x2561bf);_0x638903[_0xdeed('0x2f')]=_[_0xdeed('0x2e')](_0x20b42b[_0xdeed('0x2f')]);_0x638903[_0xdeed('0x30')]=_[_0xdeed('0x31')](_0x638903['model'],_0x638903['query']);_0x209c2d[_0xdeed('0x32')]=_[_0xdeed('0x31')](_0x638903[_0xdeed('0x33')],qs[_0xdeed('0x34')](_0x20b42b['query'][_0xdeed('0x34')]));_0x209c2d[_0xdeed('0x32')]=_0x209c2d[_0xdeed('0x32')][_0xdeed('0x35')]?_0x209c2d[_0xdeed('0x32')]:_0x638903[_0xdeed('0x33')];if(!_0x20b42b[_0xdeed('0x2f')][_0xdeed('0x36')](_0xdeed('0x37'))){_0x209c2d[_0xdeed('0x38')]=qs[_0xdeed('0x38')](_0x20b42b[_0xdeed('0x2f')][_0xdeed('0x38')]);_0x209c2d[_0xdeed('0x21')]=qs[_0xdeed('0x21')](_0x20b42b[_0xdeed('0x2f')][_0xdeed('0x21')]);}_0x209c2d[_0xdeed('0x39')]=qs[_0xdeed('0x3a')](_0x20b42b[_0xdeed('0x2f')]['sort']);_0x209c2d[_0xdeed('0x3b')]=qs[_0xdeed('0x30')](_[_0xdeed('0x3c')](_0x20b42b[_0xdeed('0x2f')],_0x638903[_0xdeed('0x30')]));if(_0x20b42b['query'][_0xdeed('0x3d')]){_0x209c2d[_0xdeed('0x3b')]=_[_0xdeed('0x3e')](_0x209c2d[_0xdeed('0x3b')],{'$or':_['map'](_0x2561bf,function(_0x35aa5a){if(_0x35aa5a[_0xdeed('0x3f')][_0xdeed('0x40')]!==_0xdeed('0x41')){var _0x355fbd={};_0x355fbd[_0x35aa5a[_0xdeed('0x42')]]={'$like':'%'+_0x20b42b['query'][_0xdeed('0x3d')]+'%'};return _0x355fbd;}})});}_0x209c2d=_[_0xdeed('0x3e')]({},_0x209c2d,_0x20b42b['options']);var _0x41886c={'where':_0x209c2d[_0xdeed('0x3b')]};return db[_0xdeed('0x43')][_0xdeed('0x44')](_0x41886c)[_0xdeed('0x26')](function(_0x4a586c){_0x4158fb[_0xdeed('0x44')]=_0x4a586c;if(_0x20b42b[_0xdeed('0x2f')]['includeAll']){_0x209c2d[_0xdeed('0x45')]=[{'all':!![]}];}return db[_0xdeed('0x43')][_0xdeed('0x46')](_0x209c2d);})[_0xdeed('0x26')](function(_0x7f037){_0x4158fb[_0xdeed('0x47')]=_0x7f037;return _0x4158fb;})['then'](respondWithFilteredResult(_0xfb9db1,_0x209c2d))[_0xdeed('0x48')](handleError(_0xfb9db1,null));};exports[_0xdeed('0x49')]=function(_0x480ac8,_0x4714b0){var _0x2773c7={'raw':![],'where':{'id':_0x480ac8[_0xdeed('0x4a')]['id']}},_0x25ac36={};_0x25ac36[_0xdeed('0x33')]=_[_0xdeed('0x2e')](db[_0xdeed('0x43')][_0xdeed('0x2d')]);_0x25ac36[_0xdeed('0x2f')]=_[_0xdeed('0x2e')](_0x480ac8['query']);_0x25ac36[_0xdeed('0x30')]=_[_0xdeed('0x31')](_0x25ac36['model'],_0x25ac36[_0xdeed('0x2f')]);_0x2773c7[_0xdeed('0x32')]=_[_0xdeed('0x31')](_0x25ac36[_0xdeed('0x33')],qs[_0xdeed('0x34')](_0x480ac8[_0xdeed('0x2f')]['fields']));_0x2773c7[_0xdeed('0x32')]=_0x2773c7[_0xdeed('0x32')][_0xdeed('0x35')]?_0x2773c7[_0xdeed('0x32')]:_0x25ac36[_0xdeed('0x33')];if(_0x480ac8[_0xdeed('0x2f')][_0xdeed('0x4b')]){_0x2773c7[_0xdeed('0x45')]=[{'all':!![]}];}_0x2773c7=_[_0xdeed('0x3e')]({},_0x2773c7,_0x480ac8['options']);return db[_0xdeed('0x43')][_0xdeed('0x4c')](_0x2773c7)['then'](handleEntityNotFound(_0x4714b0,null))['then'](respondWithResult(_0x4714b0,null))[_0xdeed('0x48')](handleError(_0x4714b0,null));};exports[_0xdeed('0x4d')]=function(_0x449bb2,_0x4fb621,_0x2a5e5c){var _0x53ba09;return db['Setting'][_0xdeed('0x4c')]({'where':{'id':_0x449bb2['params']['id']}})[_0xdeed('0x26')](handleEntityNotFound(_0x4fb621,null))[_0xdeed('0x26')](saveUpdates(_0x449bb2[_0xdeed('0x4e')],null))['then'](function(_0x443213){if(_0x443213){_0x53ba09=_0x443213['get']({'plain':!![]});var _0x4cb097=fs[_0xdeed('0x4f')](path[_0xdeed('0x50')](config['root'],_0xdeed('0x51')),_0xdeed('0x52'));var _0x5bc27e=ejs['render'](_0x4cb097,_0x53ba09);var _0x31642a=fs[_0xdeed('0x4f')](path['join'](config[_0xdeed('0x53')],_0xdeed('0x54')),_0xdeed('0x52'));var _0x5d7eaf=ejs['render'](_0x31642a,_0x53ba09);fs[_0xdeed('0x55')]('/etc/asterisk/stun_xcally.conf',_0x5bc27e);fs[_0xdeed('0x55')]('/etc/asterisk/turn_xcally.conf',_0x5d7eaf);return respondWithRpcPromise(_0xdeed('0x56'),'update',{'module':_0xdeed('0x57')});}})[_0xdeed('0x26')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xdeed('0x58')});})[_0xdeed('0x26')](function(){return _0x53ba09||null;})[_0xdeed('0x26')](respondWithResult(_0x4fb621,null))[_0xdeed('0x48')](handleError(_0x4fb621,null));};exports[_0xdeed('0x59')]=function(_0x324867,_0x52e1a9,_0x347a74){if(_0x324867[_0xdeed('0x5a')]&&_0x324867[_0xdeed('0x5a')][_0xdeed('0x5b')]){_0x324867[_0xdeed('0x4e')][_0xdeed('0x5c')]=_0x324867['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x324867[_0xdeed('0x4a')]['id']}})[_0xdeed('0x26')](handleEntityNotFound(_0x52e1a9,null))['then'](saveUpdates(_0x324867[_0xdeed('0x4e')],null))[_0xdeed('0x26')](respondWithResult(_0x52e1a9,null))[_0xdeed('0x48')](handleError(_0x52e1a9,null));};exports[_0xdeed('0x5d')]=function(_0x153cbc,_0x1a3cba,_0x1337e3){if(_0x153cbc[_0xdeed('0x5a')]&&_0x153cbc['file'][_0xdeed('0x5b')]){_0x153cbc['body'][_0xdeed('0x5e')]=_0x153cbc[_0xdeed('0x5a')][_0xdeed('0x5b')];}return db[_0xdeed('0x43')][_0xdeed('0x4c')]({'where':{'id':_0x153cbc[_0xdeed('0x4a')]['id']}})[_0xdeed('0x26')](handleEntityNotFound(_0x1a3cba,null))[_0xdeed('0x26')](saveUpdates(_0x153cbc['body'],null))['then'](respondWithResult(_0x1a3cba,null))[_0xdeed('0x48')](handleError(_0x1a3cba,null));};var utilLicense=require(_0xdeed('0x5f'));exports[_0xdeed('0x60')]=function(_0x44b1c9,_0x1d8ab1,_0x8b3fa8){var _0x59f551=_0xdeed('0x61');var _0x4f5035={'custom':![]};return utilLicense[_0xdeed('0x62')]()[_0xdeed('0x26')](function(_0x46c4e9){if(_0x46c4e9){_0x4f5035=_0x46c4e9;}return db[_0xdeed('0x43')][_0xdeed('0x4c')]({'where':{'id':_0x44b1c9[_0xdeed('0x4a')]['id']},'attributes':[_0xdeed('0x5c'),_0xdeed('0x5e'),_0xdeed('0x63'),_0xdeed('0x64'),'defaultLoginLogo',_0xdeed('0x65')],'raw':!![]});})[_0xdeed('0x26')](handleEntityNotFound(_0x1d8ab1,null))['then'](function(_0x4cba6f){if(_0x4cba6f){var _0x17f35c=_0x4cba6f[_0xdeed('0x5c')]&&fs['existsSync'](path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x59f551,_['toLower'](_0x4cba6f[_0xdeed('0x5c')])))?path['join'](config['root'],_0x59f551,_[_0xdeed('0x66')](_0x4cba6f[_0xdeed('0x5c')])):path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x59f551,_['toLower'](_0xdeed('0x67')));var _0x5d4f16=_0xdeed('0x68')+_['upperFirst']('logo');if(_0x4cba6f[_0x5d4f16]||!_0x4f5035[_0xdeed('0x69')]){_0x17f35c=path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x59f551,_[_0xdeed('0x66')](_0xdeed('0x67')));}if(!fs[_0xdeed('0x6a')](_0x17f35c)){throw new db[(_0xdeed('0x6b'))][(_0xdeed('0x6c'))](_0xdeed('0x6d'));}return _0x1d8ab1[_0xdeed('0x6e')](_0x17f35c);}})[_0xdeed('0x48')](handleError(_0x1d8ab1,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x3381f7,_0x2842c0,_0x57e7f6){var _0x24a2a0=_0xdeed('0x61');var _0x508902={'custom':![]};return utilLicense['getLicense']()[_0xdeed('0x26')](function(_0x4b8396){if(_0x4b8396){_0x508902=_0x4b8396;}return db['Setting'][_0xdeed('0x4c')]({'where':{'id':_0x3381f7[_0xdeed('0x4a')]['id']},'attributes':[_0xdeed('0x5c'),_0xdeed('0x5e'),_0xdeed('0x63'),_0xdeed('0x64'),_0xdeed('0x6f'),_0xdeed('0x65')],'raw':!![]});})[_0xdeed('0x26')](handleEntityNotFound(_0x2842c0,null))[_0xdeed('0x26')](function(_0x3da451){if(_0x3da451){var _0x53c074=_0x3da451['loginLogo']&&fs['existsSync'](path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x24a2a0,_[_0xdeed('0x66')](_0x3da451[_0xdeed('0x5e')])))?path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x24a2a0,_[_0xdeed('0x66')](_0x3da451['loginLogo'])):path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x24a2a0,_[_0xdeed('0x66')]('default_loginLogo.png'));var _0x528987=_0xdeed('0x68')+_[_0xdeed('0x70')](_0xdeed('0x5e'));if(_0x3da451[_0x528987]||!_0x508902[_0xdeed('0x69')]){_0x53c074=path['join'](config['root'],_0x24a2a0,_[_0xdeed('0x66')](_0xdeed('0x71')));}if(!fs[_0xdeed('0x6a')](_0x53c074)){throw new db[(_0xdeed('0x6b'))][(_0xdeed('0x6c'))](_0xdeed('0x6d'));}return _0x2842c0[_0xdeed('0x6e')](_0x53c074);}})[_0xdeed('0x48')](handleError(_0x2842c0,null));};exports['gdpr']=function(_0x46b814,_0x33f715){return db[_0xdeed('0x43')][_0xdeed('0x4c')]({'where':{'id':_0x46b814[_0xdeed('0x4a')]['id']},'attributes':[_0xdeed('0x72')]})[_0xdeed('0x26')](respondWithResult(_0x33f715,null))[_0xdeed('0x48')](handleError(_0x33f715,null));};exports['addPreferred']=function(_0x265042,_0x42d109,_0x1f0803){if(_0x265042['file']&&_0x265042[_0xdeed('0x5a')][_0xdeed('0x5b')]){_0x265042['body'][_0xdeed('0x63')]=_0x265042[_0xdeed('0x5a')][_0xdeed('0x5b')];}return db[_0xdeed('0x43')][_0xdeed('0x4c')]({'where':{'id':_0x265042[_0xdeed('0x4a')]['id']}})[_0xdeed('0x26')](handleEntityNotFound(_0x42d109,null))[_0xdeed('0x26')](saveUpdates(_0x265042['body'],null))[_0xdeed('0x26')](respondWithResult(_0x42d109,null))[_0xdeed('0x48')](handleError(_0x42d109,null));};var utilLicense=require(_0xdeed('0x5f'));exports[_0xdeed('0x73')]=function(_0x306fc4,_0x533042,_0x61eb6){var _0x1572b6=_0xdeed('0x61');var _0x499cdc={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3646ba){if(_0x3646ba){_0x499cdc=_0x3646ba;}return db[_0xdeed('0x43')]['find']({'where':{'id':_0x306fc4[_0xdeed('0x4a')]['id']},'attributes':['logo',_0xdeed('0x5e'),_0xdeed('0x63'),_0xdeed('0x64'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x533042,null))[_0xdeed('0x26')](function(_0x85d18a){if(_0x85d18a){var _0x42c420=_0x85d18a['preferred']&&fs['existsSync'](path[_0xdeed('0x50')](config['root'],_0x1572b6,_['toLower'](_0x85d18a[_0xdeed('0x63')])))?path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x1572b6,_[_0xdeed('0x66')](_0x85d18a[_0xdeed('0x63')])):path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x1572b6,_['toLower'](_0xdeed('0x74')));var _0x5a8423='default'+_['upperFirst']('preferred');if(_0x85d18a[_0x5a8423]||!_0x499cdc[_0xdeed('0x69')]||!_0x499cdc[_0xdeed('0x63')]){_0x42c420=path[_0xdeed('0x50')](config[_0xdeed('0x53')],_0x1572b6,_['toLower'](_0xdeed('0x74')));}if(!fs[_0xdeed('0x6a')](_0x42c420)){throw new db[(_0xdeed('0x6b'))][(_0xdeed('0x6c'))]('Logo\x20not\x20found');}return _0x533042[_0xdeed('0x6e')](_0x42c420);}})[_0xdeed('0x48')](handleError(_0x533042,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 399f273..6e31c28 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 _0x00c5=['api','moment','bluebird','path','../../config/environment','./setting.attributes','define','Setting','lodash'];(function(_0x5a73a6,_0x23d43f){var _0x3a41ce=function(_0x2ab84d){while(--_0x2ab84d){_0x5a73a6['push'](_0x5a73a6['shift']());}};_0x3a41ce(++_0x23d43f);}(_0x00c5,0x1a6));var _0x500c=function(_0x5c79b3,_0x3c4999){_0x5c79b3=_0x5c79b3-0x0;var _0x2d5ac8=_0x00c5[_0x5c79b3];return _0x2d5ac8;};'use strict';var _=require(_0x500c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x500c('0x1'));var moment=require(_0x500c('0x2'));var BPromise=require(_0x500c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x500c('0x4'));var rimraf=require('rimraf');var config=require(_0x500c('0x5'));var attributes=require(_0x500c('0x6'));module['exports']=function(_0x1773fc,_0x3830bc){return _0x1773fc[_0x500c('0x7')](_0x500c('0x8'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9652=['./setting.attributes','exports','define','Setting','lodash','util','moment','rimraf'];(function(_0x4bc4f3,_0x5704d9){var _0xcdd806=function(_0x1ab7f5){while(--_0x1ab7f5){_0x4bc4f3['push'](_0x4bc4f3['shift']());}};_0xcdd806(++_0x5704d9);}(_0x9652,0x16c));var _0x2965=function(_0x121709,_0xf73b35){_0x121709=_0x121709-0x0;var _0x36bec9=_0x9652[_0x121709];return _0x36bec9;};'use strict';var _=require(_0x2965('0x0'));var util=require(_0x2965('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2965('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2965('0x3'));var config=require('../../config/environment');var attributes=require(_0x2965('0x4'));module[_0x2965('0x5')]=function(_0x4f1a79,_0x457ba9){return _0x4f1a79[_0x2965('0x6')](_0x2965('0x7'),attributes,{'tableName':'settings','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 788df2b..7025b4a 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 _0x6017=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6017,0x12d));var _0x7601=function(_0x557090,_0x46c116){_0x557090=_0x557090-0x0;var _0x3e0fa1=_0x6017[_0x557090];return _0x3e0fa1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7601('0x0'));var BPromise=require(_0x7601('0x1'));var rs=require(_0x7601('0x2'));var fs=require('fs');var Redis=require(_0x7601('0x3'));var db=require(_0x7601('0x4'))['db'];var utils=require(_0x7601('0x5'));var logger=require('../../config/logger')(_0x7601('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7601('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2d4a,_0x6cc743,_0x4ea5c6){return new BPromise(function(_0x4b6403,_0x23c8e8){return client[_0x7601('0x8')](_0x5b2d4a,_0x4ea5c6)[_0x7601('0x9')](function(_0x1bdd44){logger[_0x7601('0xa')](_0x7601('0xb'),_0x6cc743,_0x7601('0xc'));logger['debug'](_0x7601('0xd'),_0x6cc743,_0x7601('0xc'),JSON[_0x7601('0xe')](_0x1bdd44));if(_0x1bdd44['error']){if(_0x1bdd44[_0x7601('0xf')][_0x7601('0x10')]===0x1f4){logger[_0x7601('0xf')](_0x7601('0xb'),_0x6cc743,_0x1bdd44['error'][_0x7601('0x11')]);return _0x23c8e8(_0x1bdd44[_0x7601('0xf')][_0x7601('0x11')]);}logger[_0x7601('0xf')](_0x7601('0xb'),_0x6cc743,_0x1bdd44[_0x7601('0xf')][_0x7601('0x11')]);return _0x4b6403(_0x1bdd44[_0x7601('0xf')][_0x7601('0x11')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x6cc743,'request\x20sent');_0x4b6403(_0x1bdd44[_0x7601('0x12')][_0x7601('0x11')]);}})[_0x7601('0x13')](function(_0x52f32b){logger['error']('Setting,\x20%s,\x20%s',_0x6cc743,_0x52f32b);_0x23c8e8(_0x52f32b);});});} \ No newline at end of file +var _0x1ea6=['moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util'];(function(_0x5392df,_0x393bc5){var _0x4ddcc6=function(_0x55ddf9){while(--_0x55ddf9){_0x5392df['push'](_0x5392df['shift']());}};_0x4ddcc6(++_0x393bc5);}(_0x1ea6,0x12f));var _0x61ea=function(_0x523225,_0x252cb4){_0x523225=_0x523225-0x0;var _0x5a66dd=_0x1ea6[_0x523225];return _0x5a66dd;};'use strict';var _=require('lodash');var util=require(_0x61ea('0x0'));var moment=require(_0x61ea('0x1'));var BPromise=require('bluebird');var rs=require(_0x61ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x61ea('0x3'));var logger=require(_0x61ea('0x4'))('rpc');var config=require(_0x61ea('0x5'));var jayson=require(_0x61ea('0x6'));var client=jayson[_0x61ea('0x7')][_0x61ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38b5a9,_0x353e7b,_0x2f5185){return new BPromise(function(_0x38f893,_0x2ff551){return client['request'](_0x38b5a9,_0x2f5185)[_0x61ea('0x9')](function(_0x270be2){logger[_0x61ea('0xa')](_0x61ea('0xb'),_0x353e7b,_0x61ea('0xc'));logger[_0x61ea('0xd')](_0x61ea('0xe'),_0x353e7b,'request\x20sent',JSON[_0x61ea('0xf')](_0x270be2));if(_0x270be2[_0x61ea('0x10')]){if(_0x270be2['error']['code']===0x1f4){logger[_0x61ea('0x10')]('Setting,\x20%s,\x20%s',_0x353e7b,_0x270be2[_0x61ea('0x10')]['message']);return _0x2ff551(_0x270be2['error'][_0x61ea('0x11')]);}logger[_0x61ea('0x10')](_0x61ea('0xb'),_0x353e7b,_0x270be2['error'][_0x61ea('0x11')]);return _0x38f893(_0x270be2[_0x61ea('0x10')]['message']);}else{logger[_0x61ea('0xa')](_0x61ea('0xb'),_0x353e7b,'request\x20sent');_0x38f893(_0x270be2[_0x61ea('0x12')][_0x61ea('0x11')]);}})['catch'](function(_0x4e8670){logger[_0x61ea('0x10')](_0x61ea('0xb'),_0x353e7b,_0x4e8670);_0x2ff551(_0x4e8670);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index fc36d07..f454893 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 _0xf1f4=['getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','/:id','/:id/dispositions'];(function(_0x57baae,_0x4fbee0){var _0x33dde6=function(_0xb00c7b){while(--_0xb00c7b){_0x57baae['push'](_0x57baae['shift']());}};_0x33dde6(++_0x4fbee0);}(_0xf1f4,0x13e));var _0x4f1f=function(_0x3efb68,_0x268c1f){_0x3efb68=_0x3efb68-0x0;var _0x348320=_0xf1f4[_0x3efb68];return _0x348320;};'use strict';var multer=require(_0x4f1f('0x0'));var util=require(_0x4f1f('0x1'));var path=require(_0x4f1f('0x2'));var timeout=require(_0x4f1f('0x3'));var express=require(_0x4f1f('0x4'));var router=express[_0x4f1f('0x5')]();var auth=require(_0x4f1f('0x6'));var interaction=require(_0x4f1f('0x7'));var config=require(_0x4f1f('0x8'));var controller=require(_0x4f1f('0x9'));router[_0x4f1f('0xa')]('/',auth[_0x4f1f('0xb')](),controller['index']);router['get'](_0x4f1f('0xc'),auth[_0x4f1f('0xb')](),controller['describe']);router[_0x4f1f('0xa')](_0x4f1f('0xd'),auth[_0x4f1f('0xb')](),controller['show']);router[_0x4f1f('0xa')](_0x4f1f('0xe'),auth['isAuthenticated'](),controller[_0x4f1f('0xf')]);router[_0x4f1f('0xa')](_0x4f1f('0x10'),auth[_0x4f1f('0xb')](),controller['getAnswers']);router[_0x4f1f('0xa')](_0x4f1f('0x11'),auth['isAuthenticated'](),controller[_0x4f1f('0x12')]);router[_0x4f1f('0xa')](_0x4f1f('0x13'),auth['isAuthenticated'](),controller[_0x4f1f('0x14')]);router[_0x4f1f('0xa')](_0x4f1f('0x15'),controller['statusGet']);router['get'](_0x4f1f('0x16'),auth[_0x4f1f('0xb')](),controller['getAgents']);router[_0x4f1f('0x17')]('/',auth[_0x4f1f('0xb')](),controller[_0x4f1f('0x18')]);router[_0x4f1f('0x17')]('/:id/dispositions',auth[_0x4f1f('0xb')](),controller['addDisposition']);router[_0x4f1f('0x17')](_0x4f1f('0x10'),auth[_0x4f1f('0xb')](),controller[_0x4f1f('0x19')]);router[_0x4f1f('0x17')](_0x4f1f('0x1a'),controller[_0x4f1f('0x1b')]);router[_0x4f1f('0x17')](_0x4f1f('0x11'),auth[_0x4f1f('0xb')](),controller['addApplications']);router[_0x4f1f('0x17')](_0x4f1f('0x1c'),auth['isAuthenticated'](),controller[_0x4f1f('0x1d')]);router[_0x4f1f('0x17')](_0x4f1f('0x15'),controller[_0x4f1f('0x1e')]);router['post'](_0x4f1f('0x16'),auth[_0x4f1f('0xb')](),controller[_0x4f1f('0x1f')]);router[_0x4f1f('0x20')](_0x4f1f('0xd'),auth[_0x4f1f('0xb')](),controller[_0x4f1f('0x21')]);router[_0x4f1f('0x22')](_0x4f1f('0xd'),auth[_0x4f1f('0xb')](),controller['destroy']);router[_0x4f1f('0x22')](_0x4f1f('0xe'),auth['isAuthenticated'](),controller[_0x4f1f('0x23')]);router[_0x4f1f('0x22')](_0x4f1f('0x10'),auth[_0x4f1f('0xb')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x4f1f('0xb')](),controller['removeAgents']);module[_0x4f1f('0x24')]=router; \ No newline at end of file +var _0xfa59=['isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/notify','/:id/send','send','addAgents','put','/:id','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','./smsAccount.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfa59,0x121));var _0x9fa5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfa59[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9fa5('0x0'));var timeout=require(_0x9fa5('0x1'));var express=require(_0x9fa5('0x2'));var router=express[_0x9fa5('0x3')]();var auth=require(_0x9fa5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9fa5('0x5'));router[_0x9fa5('0x6')]('/',auth[_0x9fa5('0x7')](),controller['index']);router['get'](_0x9fa5('0x8'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x9')]);router['get']('/:id',auth[_0x9fa5('0x7')](),controller[_0x9fa5('0xa')]);router['get'](_0x9fa5('0xb'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0xc')]);router[_0x9fa5('0x6')](_0x9fa5('0xd'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0xe')]);router[_0x9fa5('0x6')](_0x9fa5('0xf'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x10')]);router[_0x9fa5('0x6')](_0x9fa5('0x11'),auth[_0x9fa5('0x7')](),controller['getInteractions']);router[_0x9fa5('0x6')](_0x9fa5('0x12'),controller[_0x9fa5('0x13')]);router[_0x9fa5('0x6')](_0x9fa5('0x14'),auth['isAuthenticated'](),controller[_0x9fa5('0x15')]);router[_0x9fa5('0x16')]('/',auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x17')]);router[_0x9fa5('0x16')]('/:id/dispositions',auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x18')]);router['post'](_0x9fa5('0xd'),auth[_0x9fa5('0x7')](),controller['addAnswer']);router[_0x9fa5('0x16')](_0x9fa5('0x19'),controller['notify']);router[_0x9fa5('0x16')](_0x9fa5('0xf'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x9fa5('0x1a'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x1b')]);router['post'](_0x9fa5('0x12'),controller['status']);router[_0x9fa5('0x16')](_0x9fa5('0x14'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x1c')]);router[_0x9fa5('0x1d')](_0x9fa5('0x1e'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x1f')]);router[_0x9fa5('0x20')](_0x9fa5('0xb'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x21')]);router['delete'](_0x9fa5('0xd'),auth['isAuthenticated'](),controller[_0x9fa5('0x22')]);router[_0x9fa5('0x20')](_0x9fa5('0x14'),auth[_0x9fa5('0x7')](),controller[_0x9fa5('0x23')]);module[_0x9fa5('0x24')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7a95e7e..4a267e4 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 _0x91bb=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','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'];(function(_0x1ce50d,_0x1a7b77){var _0x4028b2=function(_0x47331b){while(--_0x47331b){_0x1ce50d['push'](_0x1ce50d['shift']());}};_0x4028b2(++_0x1a7b77);}(_0x91bb,0x192));var _0xb91b=function(_0x4cb03b,_0x47d402){_0x4cb03b=_0x4cb03b-0x0;var _0x132ba4=_0x91bb[_0x4cb03b];return _0x132ba4;};'use strict';var Sequelize=require(_0xb91b('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb91b('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xb91b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb91b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb91b('0x2')],'defaultValue':function(){return rs[_0xb91b('0x3')]();}},'phone':{'type':Sequelize[_0xb91b('0x2')]},'type':{'type':Sequelize[_0xb91b('0x4')](_0xb91b('0x5'),'skebby',_0xb91b('0x6'),_0xb91b('0x7'),_0xb91b('0x8'),_0xb91b('0x9'),_0xb91b('0xa'),_0xb91b('0xb'),_0xb91b('0xc'))},'accountSid':{'type':Sequelize[_0xb91b('0x2')]},'authId':{'type':Sequelize[_0xb91b('0x2')]},'authToken':{'type':Sequelize[_0xb91b('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xb91b('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xb91b('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xb91b('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb91b('0xe')],'defaultValue':function(){return _0xb91b('0xf');}},'notificationSound':{'type':Sequelize[_0xb91b('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb91b('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb91b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb91b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb91b('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb91b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb91b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb91b('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xb91b('0xd')],'defaultValue':![],'comment':_0xb91b('0x12'),'set':function(_0x2f5cc6){if(!_0x2f5cc6)this['setDataValue'](_0xb91b('0x13'),null);this['setDataValue'](_0xb91b('0x14'),_0x2f5cc6);}}}; \ No newline at end of file +var _0x4d03=['csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell'];(function(_0x1d3c8d,_0x8ffc2c){var _0x4b80aa=function(_0x224497){while(--_0x224497){_0x1d3c8d['push'](_0x1d3c8d['shift']());}};_0x4b80aa(++_0x8ffc2c);}(_0x4d03,0x10e));var _0x34d0=function(_0x2029d1,_0xcc62a9){_0x2029d1=_0x2029d1-0x0;var _0x3ef10f=_0x4d03[_0x2029d1];return _0x3ef10f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x34d0('0x0'));module['exports']={'name':{'type':Sequelize[_0x34d0('0x1')],'unique':_0x34d0('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x34d0('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x34d0('0x3')]();}},'phone':{'type':Sequelize[_0x34d0('0x1')]},'type':{'type':Sequelize[_0x34d0('0x4')](_0x34d0('0x5'),_0x34d0('0x6'),'connectel',_0x34d0('0x7'),_0x34d0('0x8'),_0x34d0('0x9'),_0x34d0('0xa'),_0x34d0('0xb'),_0x34d0('0xc'))},'accountSid':{'type':Sequelize[_0x34d0('0x1')]},'authId':{'type':Sequelize[_0x34d0('0x1')]},'authToken':{'type':Sequelize[_0x34d0('0x1')]},'smsMethod':{'type':Sequelize[_0x34d0('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x34d0('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x34d0('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x34d0('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x34d0('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x34d0('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x34d0('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x34d0('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x34d0('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x34d0('0xf')],'comment':_0x34d0('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x34d0('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b19f5){if(!_0x1b19f5)this[_0x34d0('0x11')](_0x34d0('0x12'),null);this[_0x34d0('0x11')](_0x34d0('0x13'),_0x1b19f5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 644ab63..e695555 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 _0x42cc=['VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','SmsAccountId','Disposition','getDispositions','rawAttributes','merge','removeDispositions','ids','addAnswer','CannedAnswer','findOne','notify','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','from','From','skebby','sender','text','messageId','plivo','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','SmsInteraction','interaction','created','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','sequelize','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','clicksend','message_id','DELIVERED','groupName','redif','connectel','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','csc','state','message-id','addAgents','spread','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','get','SmsAccounts','destroy','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','key'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x42cc,0x8d));var _0xc42c=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x42cc[_0x5e8eae];return _0xdd09cd;};'use strict';var pdf=require(_0xc42c('0x0'));var emlformat=require(_0xc42c('0x1'));var rimraf=require(_0xc42c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc42c('0x3'));var rp=require('request-promise');var moment=require(_0xc42c('0x4'));var BPromise=require(_0xc42c('0x5'));var Mustache=require(_0xc42c('0x6'));var util=require(_0xc42c('0x7'));var path=require('path');var sox=require(_0xc42c('0x8'));var csv=require('to-csv');var ejs=require(_0xc42c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc42c('0xa'));var crypto=require(_0xc42c('0xb'));var jsforce=require(_0xc42c('0xc'));var deskjs=require(_0xc42c('0xd'));var toCsv=require(_0xc42c('0xe'));var querystring=require(_0xc42c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc42c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc42c('0x11'));var db=require('../../mysqldb')['db'];config[_0xc42c('0x12')]=_[_0xc42c('0x13')](config[_0xc42c('0x12')],{'host':_0xc42c('0x14'),'port':0x18eb});var socket=require(_0xc42c('0x15'))(new Redis(config[_0xc42c('0x12')]));require(_0xc42c('0x16'))[_0xc42c('0x17')](socket);var jayson=require(_0xc42c('0x18'));var client=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x4459e0,_0x5741ba,_0x44b641){if(_0x44b641){var _0x2ad36c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ad36c['test'](_0x5741ba)){return _0x4459e0;}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 _0x4459e0;}}function respondWithRpcPromise(_0x1877e1,_0x12e9d5,_0x10d1ad,_0xed66d3){return new BPromise(function(_0x3b5321,_0x41eed4){var _0x5ce54d=_0xed66d3||client;return _0x5ce54d[_0xc42c('0x19')](_0x1877e1,_0x10d1ad)[_0xc42c('0x1a')](function(_0x495740){logger[_0xc42c('0x1b')](_0xc42c('0x1c'),_0x12e9d5,_0xc42c('0x1d'));logger[_0xc42c('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x12e9d5,'request\x20sent',JSON[_0xc42c('0x1f')](_0x495740));if(_0x495740[_0xc42c('0x20')]){if(_0x495740['error'][_0xc42c('0x21')]===0x1f4){logger[_0xc42c('0x20')](_0xc42c('0x1c'),_0x12e9d5,_0x495740['error'][_0xc42c('0x22')]);return _0x41eed4(_0x495740[_0xc42c('0x20')][_0xc42c('0x22')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x12e9d5,_0x495740['error'][_0xc42c('0x22')]);return _0x3b5321(_0x495740[_0xc42c('0x20')][_0xc42c('0x22')]);}else{logger[_0xc42c('0x1b')](_0xc42c('0x1c'),_0x12e9d5,_0xc42c('0x1d'));_0x3b5321(_0x495740['result'][_0xc42c('0x22')]);}})['catch'](function(_0x37227){logger[_0xc42c('0x20')](_0xc42c('0x1c'),_0x12e9d5,_0x37227);_0x41eed4(_0x37227);});});}function respondWithStatusCode(_0x4b5e6d,_0x1141bf){_0x1141bf=_0x1141bf||0xcc;return function(_0x584cd4){if(_0x584cd4){return _0x4b5e6d[_0xc42c('0x23')](_0x1141bf);}return _0x4b5e6d['status'](_0x1141bf)[_0xc42c('0x24')]();};}function respondWithResult(_0x4433e0,_0x4dba6e){_0x4dba6e=_0x4dba6e||0xc8;return function(_0x89dce5){if(_0x89dce5){return _0x4433e0[_0xc42c('0x25')](_0x4dba6e)[_0xc42c('0x26')](_0x89dce5);}};}function respondWithFilteredResult(_0x51ad84,_0x570e07){return function(_0xf89f2b){if(_0xf89f2b){var _0x170aa4=_0xf89f2b[_0xc42c('0x27')],_0x330ab5=_0x570e07['offset'],_0x5596f6=_0x570e07[_0xc42c('0x28')]+_0x570e07['limit'],_0x1ad36b;if(_0x5596f6>=_0x170aa4){_0x5596f6=_0x170aa4;_0x1ad36b=0xc8;}else{_0x1ad36b=0xce;}_0x51ad84[_0xc42c('0x25')](_0x1ad36b);return _0x51ad84[_0xc42c('0x29')](_0xc42c('0x2a'),_0x330ab5+'-'+_0x5596f6+'/'+_0x170aa4)[_0xc42c('0x26')](_0xf89f2b);}return null;};}function patchUpdates(_0x378c0f){return function(_0x39c6a7){try{jsonpatch['apply'](_0x39c6a7,_0x378c0f,!![]);}catch(_0x223c09){return BPromise[_0xc42c('0x2b')](_0x223c09);}return _0x39c6a7[_0xc42c('0x2c')]();};}function saveUpdates(_0xb45196,_0x50a806){return function(_0x26c24e){if(_0x26c24e){return _0x26c24e[_0xc42c('0x2d')](_0xb45196)[_0xc42c('0x1a')](function(_0x3600ac){return _0x3600ac;});}return null;};}function removeEntity(_0xbc77df,_0x232904){return function(_0xe69676){if(_0xe69676){return _0xe69676['destroy']()[_0xc42c('0x1a')](function(){var _0x42967e=_0xe69676[_0xc42c('0x2e')]({'plain':!![]});var _0x4e3475=_0xc42c('0x2f');return db['UserProfileResource'][_0xc42c('0x30')]({'where':{'type':_0x4e3475,'resourceId':_0x42967e['id']}})[_0xc42c('0x1a')](function(){return _0xe69676;});})['then'](function(){_0xbc77df[_0xc42c('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44082f,_0x2f1644){return function(_0x4c58ac){if(!_0x4c58ac){_0x44082f[_0xc42c('0x23')](0x194);}return _0x4c58ac;};}function handleError(_0x45d8c7,_0x1b3eb9){_0x1b3eb9=_0x1b3eb9||0x1f4;return function(_0x2f7a7d){logger[_0xc42c('0x20')](_0x2f7a7d[_0xc42c('0x31')]);if(_0x2f7a7d[_0xc42c('0x32')]){delete _0x2f7a7d['name'];}_0x45d8c7[_0xc42c('0x25')](_0x1b3eb9)['send'](_0x2f7a7d);};}exports[_0xc42c('0x33')]=function(_0x146593,_0x59740c){var _0x55549b={'include':[{'model':db[_0xc42c('0x34')],'as':_0xc42c('0x35')}]},_0x2bc337={},_0x4b77d4={'count':0x0,'rows':[]};var _0x263d68=db[_0xc42c('0x36')]['rawAttributes'];_0x2bc337[_0xc42c('0x37')]=_[_0xc42c('0x38')](_0x263d68);_0x2bc337[_0xc42c('0x39')]=_[_0xc42c('0x38')](_0x146593['query']);_0x2bc337[_0xc42c('0x3a')]=_[_0xc42c('0x3b')](_0x2bc337['model'],_0x2bc337[_0xc42c('0x39')]);_0x55549b['attributes']=_[_0xc42c('0x3b')](_0x2bc337[_0xc42c('0x37')],qs[_0xc42c('0x3c')](_0x146593[_0xc42c('0x39')][_0xc42c('0x3c')]));_0x55549b[_0xc42c('0x3d')]=_0x55549b[_0xc42c('0x3d')]['length']?_0x55549b[_0xc42c('0x3d')]:_0x2bc337[_0xc42c('0x37')];if(!_0x146593[_0xc42c('0x39')][_0xc42c('0x3e')](_0xc42c('0x3f'))){_0x55549b[_0xc42c('0x40')]=qs['limit'](_0x146593[_0xc42c('0x39')]['limit']);_0x55549b['offset']=qs[_0xc42c('0x28')](_0x146593[_0xc42c('0x39')][_0xc42c('0x28')]);}_0x55549b[_0xc42c('0x41')]=qs[_0xc42c('0x42')](_0x146593[_0xc42c('0x39')][_0xc42c('0x42')]);_0x55549b['where']=qs[_0xc42c('0x3a')](_[_0xc42c('0x43')](_0x146593[_0xc42c('0x39')],_0x2bc337['filters']));if(_0x146593['query'][_0xc42c('0x44')]){_0x55549b['where']=_['merge'](_0x55549b[_0xc42c('0x45')],{'$or':_[_0xc42c('0x46')](_0x263d68,function(_0x2e9eb0){if(_0x2e9eb0['type'][_0xc42c('0x47')]!==_0xc42c('0x48')){var _0x388175={};_0x388175[_0x2e9eb0[_0xc42c('0x49')]]={'$like':'%'+_0x146593['query'][_0xc42c('0x44')]+'%'};return _0x388175;}})});}_0x55549b=_['merge']({},_0x55549b,_0x146593[_0xc42c('0x4a')]);var _0x12c319={'where':_0x55549b[_0xc42c('0x45')]};return db['SmsAccount'][_0xc42c('0x27')](_0x12c319)[_0xc42c('0x1a')](function(_0x221df3){_0x4b77d4['count']=_0x221df3;if(_0x146593[_0xc42c('0x39')][_0xc42c('0x4b')]){_0x55549b[_0xc42c('0x4c')]=[{'all':!![]}];}return db['SmsAccount'][_0xc42c('0x4d')](_0x55549b);})[_0xc42c('0x1a')](function(_0x5ed332){_0x4b77d4[_0xc42c('0x4e')]=_0x5ed332;return _0x4b77d4;})[_0xc42c('0x1a')](respondWithFilteredResult(_0x59740c,_0x55549b))[_0xc42c('0x4f')](handleError(_0x59740c,null));};exports[_0xc42c('0x50')]=function(_0x1449bc,_0x4865b2){var _0x190b12={'raw':![],'where':{'id':_0x1449bc[_0xc42c('0x51')]['id']},'include':[{'model':db[_0xc42c('0x34')],'as':_0xc42c('0x35')}]},_0x5e35da={};_0x5e35da[_0xc42c('0x37')]=_[_0xc42c('0x38')](db['SmsAccount']['rawAttributes']);_0x5e35da[_0xc42c('0x39')]=_[_0xc42c('0x38')](_0x1449bc[_0xc42c('0x39')]);_0x5e35da[_0xc42c('0x3a')]=_[_0xc42c('0x3b')](_0x5e35da[_0xc42c('0x37')],_0x5e35da[_0xc42c('0x39')]);_0x190b12['attributes']=_[_0xc42c('0x3b')](_0x5e35da[_0xc42c('0x37')],qs[_0xc42c('0x3c')](_0x1449bc[_0xc42c('0x39')]['fields']));_0x190b12[_0xc42c('0x3d')]=_0x190b12[_0xc42c('0x3d')][_0xc42c('0x52')]?_0x190b12[_0xc42c('0x3d')]:_0x5e35da[_0xc42c('0x37')];if(_0x1449bc['query'][_0xc42c('0x4b')]){_0x190b12[_0xc42c('0x4c')]=[{'all':!![]}];}_0x190b12=_['merge']({},_0x190b12,_0x1449bc[_0xc42c('0x4a')]);return db[_0xc42c('0x36')]['find'](_0x190b12)[_0xc42c('0x1a')](handleEntityNotFound(_0x4865b2,null))[_0xc42c('0x1a')](respondWithResult(_0x4865b2,null))[_0xc42c('0x4f')](handleError(_0x4865b2,null));};exports[_0xc42c('0x53')]=function(_0x7baaee,_0x28292a){return db[_0xc42c('0x36')]['create'](_0x7baaee[_0xc42c('0x54')],{})[_0xc42c('0x1a')](function(_0x4e91fd){var _0x7be98b=_0x7baaee[_0xc42c('0x55')][_0xc42c('0x2e')]({'plain':!![]});if(!_0x7be98b)throw new Error(_0xc42c('0x56'));if(_0x7be98b[_0xc42c('0x57')]===_0xc42c('0x55')){var _0x3277de=_0x4e91fd['get']({'plain':!![]});var _0x857bff='SmsAccounts';return db[_0xc42c('0x58')]['find']({'where':{'name':_0x857bff,'userProfileId':_0x7be98b[_0xc42c('0x59')]},'raw':!![]})[_0xc42c('0x1a')](function(_0x2f50ca){if(_0x2f50ca&&_0x2f50ca[_0xc42c('0x5a')]===0x0){return db[_0xc42c('0x5b')][_0xc42c('0x53')]({'name':_0x3277de['name'],'resourceId':_0x3277de['id'],'type':_0x2f50ca[_0xc42c('0x32')],'sectionId':_0x2f50ca['id']},{})[_0xc42c('0x1a')](function(){return _0x4e91fd;});}else{return _0x4e91fd;}})['catch'](function(_0x243418){logger[_0xc42c('0x20')](_0xc42c('0x5c'),_0x243418);throw _0x243418;});}return _0x4e91fd;})[_0xc42c('0x1a')](respondWithResult(_0x28292a,0xc9))[_0xc42c('0x4f')](handleError(_0x28292a,null));};exports[_0xc42c('0x2d')]=function(_0x3db584,_0x1b8584){if(_0x3db584[_0xc42c('0x54')]['id']){delete _0x3db584['body']['id'];}return db[_0xc42c('0x36')]['find']({'where':{'id':_0x3db584['params']['id']},'include':[{'model':db[_0xc42c('0x34')],'as':_0xc42c('0x35')}]})[_0xc42c('0x1a')](handleEntityNotFound(_0x1b8584,null))[_0xc42c('0x1a')](saveUpdates(_0x3db584[_0xc42c('0x54')],null))[_0xc42c('0x1a')](respondWithResult(_0x1b8584,null))[_0xc42c('0x4f')](handleError(_0x1b8584,null));};exports['destroy']=function(_0x1e96e0,_0x5be875){return db['SmsAccount'][_0xc42c('0x5d')]({'where':{'id':_0x1e96e0[_0xc42c('0x51')]['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x5be875,null))[_0xc42c('0x1a')](removeEntity(_0x5be875,null))['catch'](handleError(_0x5be875,null));};exports[_0xc42c('0x5e')]=function(_0x4f8ced,_0x25b46f){return db[_0xc42c('0x36')][_0xc42c('0x5e')]()[_0xc42c('0x1a')](respondWithResult(_0x25b46f,null))[_0xc42c('0x4f')](handleError(_0x25b46f,null));};exports['addDisposition']=function(_0x3d0787,_0x163c9f,_0x26d66b){if(_0x3d0787[_0xc42c('0x54')]['id']){delete _0x3d0787[_0xc42c('0x54')]['id'];}return db[_0xc42c('0x36')]['find']({'where':{'id':_0x3d0787['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x163c9f,null))[_0xc42c('0x1a')](function(_0x3fa330){if(_0x3fa330){_0x3d0787[_0xc42c('0x54')][_0xc42c('0x5f')]=_0x3fa330['id'];return db[_0xc42c('0x60')][_0xc42c('0x53')](_0x3d0787[_0xc42c('0x54')]);}})['then'](respondWithResult(_0x163c9f,null))[_0xc42c('0x4f')](handleError(_0x163c9f,null));};exports[_0xc42c('0x61')]=function(_0x98a08e,_0x5bdca7,_0x44fd79){var _0x319be3={'raw':![],'where':{}};var _0x230996={};var _0x1d5647={'count':0x0,'rows':[]};return db[_0xc42c('0x36')]['findOne']({'where':{'id':_0x98a08e['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x5bdca7,null))['then'](function(_0x197cfb){if(_0x197cfb){_0x230996['model']=_['keys'](db[_0xc42c('0x60')][_0xc42c('0x62')]);_0x230996['query']=_[_0xc42c('0x38')](_0x98a08e[_0xc42c('0x39')]);_0x230996[_0xc42c('0x3a')]=_[_0xc42c('0x3b')](_0x230996['model'],_0x230996[_0xc42c('0x39')]);_0x319be3[_0xc42c('0x3d')]=_['intersection'](_0x230996[_0xc42c('0x37')],qs[_0xc42c('0x3c')](_0x98a08e['query'][_0xc42c('0x3c')]));_0x319be3[_0xc42c('0x3d')]=_0x319be3[_0xc42c('0x3d')][_0xc42c('0x52')]?_0x319be3[_0xc42c('0x3d')]:_0x230996[_0xc42c('0x37')];if(!_0x98a08e[_0xc42c('0x39')][_0xc42c('0x3e')](_0xc42c('0x3f'))){_0x319be3[_0xc42c('0x40')]=qs['limit'](_0x98a08e[_0xc42c('0x39')][_0xc42c('0x40')]);_0x319be3[_0xc42c('0x28')]=qs['offset'](_0x98a08e[_0xc42c('0x39')]['offset']);}_0x319be3[_0xc42c('0x41')]=qs[_0xc42c('0x42')](_0x98a08e[_0xc42c('0x39')][_0xc42c('0x42')]);_0x319be3[_0xc42c('0x45')]=qs[_0xc42c('0x3a')](_[_0xc42c('0x43')](_0x98a08e[_0xc42c('0x39')],_0x230996[_0xc42c('0x3a')]));_0x319be3[_0xc42c('0x45')][_0xc42c('0x5f')]=_0x197cfb['id'];if(_0x98a08e[_0xc42c('0x39')]['filter']){_0x319be3[_0xc42c('0x45')]=_[_0xc42c('0x63')](_0x319be3[_0xc42c('0x45')],{'$or':_['map'](_0x319be3[_0xc42c('0x3d')],function(_0x3a74f6){var _0x233bbd={};_0x233bbd[_0x3a74f6]={'$like':'%'+_0x98a08e[_0xc42c('0x39')]['filter']+'%'};return _0x233bbd;})});}_0x319be3=_[_0xc42c('0x63')]({},_0x319be3,_0x98a08e[_0xc42c('0x4a')]);return db['Disposition']['count']({'where':_0x319be3[_0xc42c('0x45')]})['then'](function(_0x1cd126){_0x1d5647['count']=_0x1cd126;if(_0x98a08e[_0xc42c('0x39')]['includeAll']){_0x319be3['include']=[{'all':!![]}];}return db[_0xc42c('0x60')][_0xc42c('0x4d')](_0x319be3);})[_0xc42c('0x1a')](function(_0x7d788){_0x1d5647[_0xc42c('0x4e')]=_0x7d788;return _0x1d5647;});}})[_0xc42c('0x1a')](respondWithFilteredResult(_0x5bdca7,_0x319be3))[_0xc42c('0x4f')](handleError(_0x5bdca7,null));};exports[_0xc42c('0x64')]=function(_0x5a0ad5,_0x595874,_0x3a5880){return db['SmsAccount'][_0xc42c('0x5d')]({'where':{'id':_0x5a0ad5[_0xc42c('0x51')]['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x595874,null))[_0xc42c('0x1a')](function(_0x3d027b){if(_0x3d027b){return _0x3d027b[_0xc42c('0x64')](_0x5a0ad5[_0xc42c('0x39')][_0xc42c('0x65')]);}})[_0xc42c('0x1a')](respondWithStatusCode(_0x595874,null))[_0xc42c('0x4f')](handleError(_0x595874,null));};exports[_0xc42c('0x66')]=function(_0x3e09a7,_0x47ecca,_0x3d9770){if(_0x3e09a7['body']['id']){delete _0x3e09a7[_0xc42c('0x54')]['id'];}return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x3e09a7['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x47ecca,null))[_0xc42c('0x1a')](function(_0x46f5c9){if(_0x46f5c9){_0x3e09a7['body'][_0xc42c('0x5f')]=_0x46f5c9['id'];return db[_0xc42c('0x67')][_0xc42c('0x53')](_0x3e09a7[_0xc42c('0x54')]);}})[_0xc42c('0x1a')](respondWithResult(_0x47ecca,null))['catch'](handleError(_0x47ecca,null));};exports['getAnswers']=function(_0x24bd19,_0x264c54,_0x473d84){var _0x3437c2={'raw':![],'where':{}};var _0x57e745={};var _0x48e8ea={'count':0x0,'rows':[]};return db[_0xc42c('0x36')][_0xc42c('0x68')]({'where':{'id':_0x24bd19['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x264c54,null))[_0xc42c('0x1a')](function(_0x1647f2){if(_0x1647f2){_0x57e745[_0xc42c('0x37')]=_[_0xc42c('0x38')](db['CannedAnswer'][_0xc42c('0x62')]);_0x57e745[_0xc42c('0x39')]=_[_0xc42c('0x38')](_0x24bd19['query']);_0x57e745['filters']=_[_0xc42c('0x3b')](_0x57e745[_0xc42c('0x37')],_0x57e745[_0xc42c('0x39')]);_0x3437c2['attributes']=_['intersection'](_0x57e745['model'],qs['fields'](_0x24bd19[_0xc42c('0x39')][_0xc42c('0x3c')]));_0x3437c2[_0xc42c('0x3d')]=_0x3437c2['attributes'][_0xc42c('0x52')]?_0x3437c2[_0xc42c('0x3d')]:_0x57e745[_0xc42c('0x37')];if(!_0x24bd19[_0xc42c('0x39')][_0xc42c('0x3e')](_0xc42c('0x3f'))){_0x3437c2[_0xc42c('0x40')]=qs[_0xc42c('0x40')](_0x24bd19[_0xc42c('0x39')][_0xc42c('0x40')]);_0x3437c2[_0xc42c('0x28')]=qs[_0xc42c('0x28')](_0x24bd19[_0xc42c('0x39')]['offset']);}_0x3437c2['order']=qs[_0xc42c('0x42')](_0x24bd19[_0xc42c('0x39')][_0xc42c('0x42')]);_0x3437c2[_0xc42c('0x45')]=qs[_0xc42c('0x3a')](_[_0xc42c('0x43')](_0x24bd19[_0xc42c('0x39')],_0x57e745['filters']));_0x3437c2['where'][_0xc42c('0x5f')]=_0x1647f2['id'];if(_0x24bd19['query']['filter']){_0x3437c2[_0xc42c('0x45')]=_['merge'](_0x3437c2[_0xc42c('0x45')],{'$or':_[_0xc42c('0x46')](_0x3437c2[_0xc42c('0x3d')],function(_0x576ac1){var _0x1774b7={};_0x1774b7[_0x576ac1]={'$like':'%'+_0x24bd19[_0xc42c('0x39')]['filter']+'%'};return _0x1774b7;})});}_0x3437c2=_[_0xc42c('0x63')]({},_0x3437c2,_0x24bd19[_0xc42c('0x4a')]);return db[_0xc42c('0x67')]['count']({'where':_0x3437c2['where']})['then'](function(_0x1f7b04){_0x48e8ea[_0xc42c('0x27')]=_0x1f7b04;if(_0x24bd19[_0xc42c('0x39')]['includeAll']){_0x3437c2[_0xc42c('0x4c')]=[{'all':!![]}];}return db[_0xc42c('0x67')][_0xc42c('0x4d')](_0x3437c2);})[_0xc42c('0x1a')](function(_0x28b8ec){_0x48e8ea['rows']=_0x28b8ec;return _0x48e8ea;});}})[_0xc42c('0x1a')](respondWithFilteredResult(_0x264c54,_0x3437c2))[_0xc42c('0x4f')](handleError(_0x264c54,null));};exports['removeAnswers']=function(_0xf40b9a,_0x485d4d,_0xf5630){return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0xf40b9a['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x485d4d,null))[_0xc42c('0x1a')](function(_0x41f26f){if(_0x41f26f){return _0x41f26f['removeAnswers'](_0xf40b9a['query'][_0xc42c('0x65')]);}})['then'](respondWithStatusCode(_0x485d4d,null))[_0xc42c('0x4f')](handleError(_0x485d4d,null));};exports[_0xc42c('0x69')]=function(_0x292b89,_0x476c20,_0x422b9a){var _0x1d5f6d={'channel':'sms'};var _0x27efc7=[];var _0x350946=[];var _0x246e30={};return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x292b89['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0xc42c('0x6a')}]})['then'](handleEntityNotFound(_0x476c20,null))[_0xc42c('0x1a')](function(_0x3183cd){_0x1d5f6d[_0xc42c('0x6b')]=_0x3183cd;_0x1d5f6d[_0xc42c('0x6c')]=_['orderBy'](_0x3183cd['Applications'],['priority'],[_0xc42c('0x6d')]);if(_0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0x6a')]){delete _0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0x6a')];}return db[_0xc42c('0x6e')]['describe']();})['then'](function(_0x6ae1e6){if(!_0x6ae1e6){throw new db[(_0xc42c('0x6f'))][(_0xc42c('0x70'))](_0xc42c('0x71'));}_0x27efc7=_[_0xc42c('0x72')](_['keys'](_0x6ae1e6),[_0xc42c('0x73'),'updatedAt']);_0x350946=_[_0xc42c('0x72')](_[_0xc42c('0x38')](_0x6ae1e6),[_0xc42c('0x73'),_0xc42c('0x74'),_0xc42c('0x75'),_0xc42c('0x76')]);_0x1d5f6d[_0xc42c('0x54')]={'mapKey':_0xc42c('0x77')};if(_0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0x78')]){switch(_0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0x78')]){case _0xc42c('0x79'):_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')]=_0x292b89['body'][_0xc42c('0x7b')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')]['Body'];_0x1d5f6d['body']['messageId']=_0x292b89['body']['MessageSid'];break;case _0xc42c('0x7c'):_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')]='+'+_0x292b89[_0xc42c('0x54')][_0xc42c('0x7d')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7e')];break;case'connectel':_0x1d5f6d[_0xc42c('0x54')]['from']=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7a')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')]['message'];break;case'clicksend':_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7a')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')]['body'];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7f')]=_0x292b89[_0xc42c('0x54')]['message_id'];break;case _0xc42c('0x80'):_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7b')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')]['Text'];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7f')]=_0x292b89['body'][_0xc42c('0x81')];break;case _0xc42c('0x82'):_0x1d5f6d['body'][_0xc42c('0x7a')]='+'+_0x292b89['body'][_0xc42c('0x83')][0x0]['from'];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')]['results'][0x0][_0xc42c('0x7e')];_0x1d5f6d['body'][_0xc42c('0x7f')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x83')][0x0][_0xc42c('0x7f')];break;case'csc':_0x1d5f6d[_0xc42c('0x54')]['from']=_0x292b89[_0xc42c('0x54')][_0xc42c('0x84')];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x85')][_0xc42c('0x22')];break;case _0xc42c('0x86'):_0x1d5f6d['body'][_0xc42c('0x7a')]=_0x292b89[_0xc42c('0x54')]['fromNumber'];_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7e')];_0x1d5f6d[_0xc42c('0x54')]['messageId']=_0x292b89['body'][_0xc42c('0x87')];break;case _0xc42c('0x88'):_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x7a')];_0x1d5f6d['body'][_0xc42c('0x54')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x22')];_0x1d5f6d['body'][_0xc42c('0x7f')]=_0x292b89[_0xc42c('0x54')][_0xc42c('0x89')];break;}}if(_0x1d5f6d['body']['id']){delete _0x1d5f6d[_0xc42c('0x54')]['id'];}if(_[_0xc42c('0x8a')](_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')])){throw new db[(_0xc42c('0x6f'))][(_0xc42c('0x70'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')])||_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')]===''){throw new db[(_0xc42c('0x6f'))][(_0xc42c('0x70'))](_0xc42c('0x8b'));}if(_[_0xc42c('0x8a')](_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x8c')])){throw new db['Sequelize'][(_0xc42c('0x70'))](_0xc42c('0x8d')+_0x350946);}if(!_[_0xc42c('0x8e')](_0x350946,_0x1d5f6d['body'][_0xc42c('0x8c')])){throw new db[(_0xc42c('0x6f'))][(_0xc42c('0x70'))](_0xc42c('0x8f')+_0x350946);}_0x246e30[_0x1d5f6d['body'][_0xc42c('0x8c')]]=_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')];return db[_0xc42c('0x90')]['find']({'where':{'id':_0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0x76')]},'include':[{'model':db[_0xc42c('0x6e')],'as':_0xc42c('0x91'),'where':_0x246e30,'limit':0x1,'order':[[_0xc42c('0x74'),'DESC']]}]});})[_0xc42c('0x1a')](handleEntityNotFound(_0x476c20,null))['then'](function(_0x3e370f){if(_0x3e370f){_0x1d5f6d[_0xc42c('0x92')]=_['omit'](_0x3e370f,['Contacts']);if(_0x3e370f['Contacts']['length']){return _0x3e370f[_0xc42c('0x91')][0x0];}var _0x2d77c1=_[_0xc42c('0x13')](_0x1d5f6d[_0xc42c('0x54')],{'firstName':_0x1d5f6d['body']['from'],'ListId':_0x3e370f['id']});_0x2d77c1[_0x1d5f6d['body'][_0xc42c('0x8c')]]=_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7a')];return db[_0xc42c('0x6e')][_0xc42c('0x53')](_0x2d77c1,{'fields':_0x27efc7,'raw':!![]});}})[_0xc42c('0x1a')](handleEntityNotFound(_0x476c20,null))[_0xc42c('0x1a')](function(_0x187a53){if(_0x187a53){_0x1d5f6d[_0xc42c('0x93')]=_0x187a53;var _0x33af33={'ContactId':_0x187a53['id'],'phone':_0x1d5f6d['body'][_0xc42c('0x7a')],'SmsAccountId':_0x292b89[_0xc42c('0x51')]['id']};var _0x525ace={'ContactId':_0x187a53['id'],'SmsAccountId':_0x292b89['params']['id'],'closed':![]};return db[_0xc42c('0x94')]['find']({'where':_0x525ace})['then'](function(_0x17cee3){if(_0x17cee3){return[_0x17cee3,![]];}return db[_0xc42c('0x94')][_0xc42c('0x53')](_0x33af33)['then'](function(_0x4d2b0d){return[_0x4d2b0d,!![]];});});}})['spread'](function(_0x52b524,_0x4ea69f){_0x1d5f6d[_0xc42c('0x95')]=_0x52b524[_0xc42c('0x2e')]({'plain':!![]});_0x1d5f6d[_0xc42c('0x95')][_0xc42c('0x96')]=![];if(_0x4ea69f){if(_0x1d5f6d[_0xc42c('0x6b')]['autoclose']){_0x1d5f6d[_0xc42c('0x6c')]['push']({'id':0x0,'priority':_0x1d5f6d[_0xc42c('0x6c')][_0xc42c('0x52')]+0x1,'app':_0xc42c('0x97'),'appdata':'unmanaged','interval':_0xc42c('0x98')});}_0x1d5f6d[_0xc42c('0x95')][_0xc42c('0x96')]=!![];}return db[_0xc42c('0x99')]['create']({'phone':_0x1d5f6d['body']['from'],'messageId':_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x7f')],'body':_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x54')],'SmsAccountId':_0x292b89[_0xc42c('0x51')]['id'],'SmsInteractionId':_0x52b524['id'],'direction':'in','ContactId':_0x52b524[_0xc42c('0x9a')],'AttachmentId':_0x1d5f6d[_0xc42c('0x54')][_0xc42c('0x9b')]});})[_0xc42c('0x1a')](function(_0x2f3ac5){_0x1d5f6d[_0xc42c('0x22')]=_0x2f3ac5;if(_0x1d5f6d[_0xc42c('0x95')]['UserId']){return db[_0xc42c('0x9c')][_0xc42c('0x5d')]({'attributes':['id',_0xc42c('0x32')],'where':{'id':_0x1d5f6d[_0xc42c('0x95')][_0xc42c('0x9d')]}})[_0xc42c('0x1a')](function(_0x414bcb){if(_0x414bcb){_0x1d5f6d[_0xc42c('0x6c')][_0xc42c('0x9e')]({'id':0x0,'priority':0x0,'app':_0xc42c('0x9f'),'appdata':_0x414bcb['name']+','+(_0x1d5f6d[_0xc42c('0x6b')][_0xc42c('0xa0')]||0xa),'interval':_0xc42c('0x98')});}return respondWithRpcPromise(_0xc42c('0xa1'),_0xc42c('0xa2'),_0x1d5f6d);});}return respondWithRpcPromise('Start',_0xc42c('0xa2'),_0x1d5f6d);})[_0xc42c('0x1a')](function(_0x446c2a){if(_0x446c2a){var _0x3ea55f=0xc8;var _0x5ba20d=_0xc42c('0xa3');logger[_0xc42c('0x1b')](_0xc42c('0xa4'),_0x5ba20d,_0x3ea55f,'entity\x20found');logger[_0xc42c('0x1e')](_0xc42c('0xa5'),_0x5ba20d,_0x3ea55f,'entity\x20found',JSON['stringify'](_0x446c2a));if(_0x1d5f6d[_0xc42c('0x6b')]['type']===_0xc42c('0x79')){return _0x476c20[_0xc42c('0x25')](_0x3ea55f)['set'](_0xc42c('0xa6'),_0xc42c('0xa7'))[_0xc42c('0xa8')]('\x0a');}else{return _0x476c20['status'](_0x3ea55f)[_0xc42c('0x26')](_0x446c2a);}}})[_0xc42c('0x4f')](handleError(_0x476c20,null));};exports['addApplications']=function(_0x8c1fa0,_0xfdbc26,_0xf2c11e){return db['SmsAccount'][_0xc42c('0x68')]({'where':{'id':_0x8c1fa0[_0xc42c('0x51')]['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0xfdbc26,null))[_0xc42c('0x1a')](function(_0x2d88fd){if(_0x2d88fd){return db[_0xc42c('0xa9')]['transaction'](function(_0xc6b147){return db['SmsApplication'][_0xc42c('0x30')]({'where':{'SmsAccountId':_0x8c1fa0['params']['id']},'transaction':_0xc6b147})['then'](function(_0x5c32b4){var _0x985c2f=_['map'](_0x8c1fa0[_0xc42c('0x54')],function(_0x5f5032){_0x5f5032[_0xc42c('0x5f')]=_0x8c1fa0[_0xc42c('0x51')]['id'];return _0x5f5032;});return db[_0xc42c('0xaa')][_0xc42c('0xab')](_0x985c2f,{'transaction':_0xc6b147});});})[_0xc42c('0x1a')](function(){return db[_0xc42c('0xaa')][_0xc42c('0xac')]({'where':{'SmsAccountId':_0x8c1fa0[_0xc42c('0x51')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xfdbc26,null))[_0xc42c('0x4f')](handleError(_0xfdbc26,null));};exports[_0xc42c('0xad')]=function(_0x23fcb9,_0x142cbe,_0x56a74b){var _0x48b721={};var _0x18966c={};var _0x37e55f;var _0x3625bf;return db['SmsAccount'][_0xc42c('0x68')]({'where':{'id':_0x23fcb9['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x142cbe,null))[_0xc42c('0x1a')](function(_0x295af0){if(_0x295af0){_0x37e55f=_0x295af0;_0x18966c['model']=_[_0xc42c('0x38')](db[_0xc42c('0xaa')][_0xc42c('0x62')]);_0x18966c[_0xc42c('0x39')]=_['keys'](_0x23fcb9[_0xc42c('0x39')]);_0x18966c[_0xc42c('0x3a')]=_[_0xc42c('0x3b')](_0x18966c[_0xc42c('0x37')],_0x18966c[_0xc42c('0x39')]);_0x48b721['attributes']=_[_0xc42c('0x3b')](_0x18966c[_0xc42c('0x37')],qs['fields'](_0x23fcb9[_0xc42c('0x39')][_0xc42c('0x3c')]));_0x48b721[_0xc42c('0x3d')]=_0x48b721[_0xc42c('0x3d')][_0xc42c('0x52')]?_0x48b721['attributes']:_0x18966c['model'];_0x48b721[_0xc42c('0x41')]=qs[_0xc42c('0x42')](_0x23fcb9[_0xc42c('0x39')][_0xc42c('0x42')]);_0x48b721[_0xc42c('0x45')]=qs[_0xc42c('0x3a')](_[_0xc42c('0x43')](_0x23fcb9[_0xc42c('0x39')],_0x18966c[_0xc42c('0x3a')]));if(_0x23fcb9[_0xc42c('0x39')][_0xc42c('0x44')]){_0x48b721[_0xc42c('0x45')]=_[_0xc42c('0x63')](_0x48b721['where'],{'$or':_[_0xc42c('0x46')](_0x48b721['attributes'],function(_0x4b1ab7){var _0x557d85={};_0x557d85[_0x4b1ab7]={'$like':'%'+_0x23fcb9[_0xc42c('0x39')][_0xc42c('0x44')]+'%'};return _0x557d85;})});}_0x48b721=_[_0xc42c('0x63')]({},_0x48b721,_0x23fcb9[_0xc42c('0x4a')]);return _0x37e55f['getApplications'](_0x48b721);}})['then'](function(_0x413da5){if(_0x413da5){_0x3625bf=_0x413da5[_0xc42c('0x52')];if(!_0x23fcb9['query'][_0xc42c('0x3e')]('nolimit')){_0x48b721[_0xc42c('0x40')]=qs[_0xc42c('0x40')](_0x23fcb9[_0xc42c('0x39')][_0xc42c('0x40')]);_0x48b721['offset']=qs[_0xc42c('0x28')](_0x23fcb9['query'][_0xc42c('0x28')]);}return _0x37e55f['getApplications'](_0x48b721);}})['then'](function(_0x310480){if(_0x310480){return _0x310480?{'count':_0x3625bf,'rows':_0x310480}:null;}})[_0xc42c('0x1a')](respondWithResult(_0x142cbe,null))[_0xc42c('0x4f')](handleError(_0x142cbe,null));};exports[_0xc42c('0xae')]=function(_0x553c0f,_0x5f605,_0xb00cdc){var _0x59bdfd={'raw':![],'where':{}};var _0x5847cd={};var _0x2b1d94={'count':0x0,'rows':[]};return db[_0xc42c('0x36')][_0xc42c('0x68')]({'where':{'id':_0x553c0f['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x5f605,null))[_0xc42c('0x1a')](function(_0x506e71){if(_0x506e71){_0x5847cd[_0xc42c('0x37')]=_[_0xc42c('0x38')](db[_0xc42c('0x94')][_0xc42c('0x62')]);_0x5847cd[_0xc42c('0x39')]=_['keys'](_0x553c0f[_0xc42c('0x39')]);_0x5847cd[_0xc42c('0x3a')]=_[_0xc42c('0x3b')](_0x5847cd[_0xc42c('0x37')],_0x5847cd[_0xc42c('0x39')]);_0x59bdfd['attributes']=_[_0xc42c('0x3b')](_0x5847cd[_0xc42c('0x37')],qs[_0xc42c('0x3c')](_0x553c0f[_0xc42c('0x39')][_0xc42c('0x3c')]));_0x59bdfd[_0xc42c('0x3d')]=_0x59bdfd[_0xc42c('0x3d')]['length']?_0x59bdfd[_0xc42c('0x3d')]:_0x5847cd[_0xc42c('0x37')];if(!_0x553c0f[_0xc42c('0x39')]['hasOwnProperty'](_0xc42c('0x3f'))){_0x59bdfd[_0xc42c('0x40')]=qs[_0xc42c('0x40')](_0x553c0f[_0xc42c('0x39')][_0xc42c('0x40')]);_0x59bdfd[_0xc42c('0x28')]=qs['offset'](_0x553c0f[_0xc42c('0x39')][_0xc42c('0x28')]);}_0x59bdfd[_0xc42c('0x41')]=qs[_0xc42c('0x42')](_0x553c0f['query'][_0xc42c('0x42')]);_0x59bdfd['where']=qs['filters'](_[_0xc42c('0x43')](_0x553c0f[_0xc42c('0x39')],_0x5847cd[_0xc42c('0x3a')]));_0x59bdfd[_0xc42c('0x45')][_0xc42c('0x5f')]=_0x506e71['id'];if(_0x553c0f[_0xc42c('0x39')][_0xc42c('0x44')]){_0x59bdfd[_0xc42c('0x45')]=_[_0xc42c('0x63')](_0x59bdfd['where'],{'$or':_[_0xc42c('0x46')](_0x59bdfd[_0xc42c('0x3d')],function(_0x1f6c00){var _0x32d8db={};_0x32d8db[_0x1f6c00]={'$like':'%'+_0x553c0f[_0xc42c('0x39')][_0xc42c('0x44')]+'%'};return _0x32d8db;})});}_0x59bdfd=_[_0xc42c('0x63')]({},_0x59bdfd,_0x553c0f['options']);return db[_0xc42c('0x94')][_0xc42c('0x27')]({'where':_0x59bdfd['where']})[_0xc42c('0x1a')](function(_0x5b70bb){_0x2b1d94[_0xc42c('0x27')]=_0x5b70bb;if(_0x553c0f[_0xc42c('0x39')][_0xc42c('0x4b')]){_0x59bdfd[_0xc42c('0x4c')]=[{'model':db[_0xc42c('0x6e')],'as':_0xc42c('0xaf'),'required':![]},{'model':db['User'],'as':_0xc42c('0xb0'),'attributes':['name',_0xc42c('0xb1'),_0xc42c('0xb2')],'required':![]},{'model':db[_0xc42c('0xb3')],'as':'Tags','attributes':['id','name',_0xc42c('0xb4')],'where':_0x553c0f[_0xc42c('0x39')][_0xc42c('0xb5')]?{'id':_0x553c0f[_0xc42c('0x39')][_0xc42c('0xb5')]}:undefined,'required':_0x553c0f['query'][_0xc42c('0xb5')]?!![]:![]}];}return db[_0xc42c('0x94')][_0xc42c('0x4d')](_0x59bdfd);})[_0xc42c('0x1a')](function(_0x5626df){_0x2b1d94[_0xc42c('0x4e')]=_0x5626df;return _0x2b1d94;});}})['then'](respondWithFilteredResult(_0x5f605,_0x59bdfd))[_0xc42c('0x4f')](handleError(_0x5f605,null));};exports[_0xc42c('0xa8')]=function(_0x1f720d,_0x4b9be2,_0x309133){var _0x2ab725,_0x71a13c,_0x1cd499;if(_[_0xc42c('0x8a')](_0x1f720d['body'][_0xc42c('0x54')])||_0x1f720d[_0xc42c('0x54')][_0xc42c('0x54')]===''){throw new db[(_0xc42c('0x6f'))][(_0xc42c('0x70'))](_0xc42c('0x8b'));}if(_[_0xc42c('0x8a')](_0x1f720d[_0xc42c('0x54')]['to'])){throw new db['Sequelize'][(_0xc42c('0x70'))](_0xc42c('0xb6'));}_0x2ab725=_0x1f720d[_0xc42c('0x54')]['to'];return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x1f720d[_0xc42c('0x51')]['id']},'include':[{'model':db[_0xc42c('0x90')],'as':_0xc42c('0xb7'),'include':[{'model':db['CmContact'],'as':_0xc42c('0x91'),'where':{'mobile':_0x2ab725},'limit':0x1,'order':[['updatedAt',_0xc42c('0xb8')]]}]}]})[_0xc42c('0x1a')](handleEntityNotFound(_0x4b9be2,null))['then'](function(_0x1b4f59){if(_0x1b4f59&&_0x1b4f59['List']){_0x71a13c=_0x1b4f59[_0xc42c('0x2e')]({'plain':!![]});if(_0x71a13c['List']&&_0x71a13c[_0xc42c('0xb7')][_0xc42c('0x91')][_0xc42c('0x52')]){return _0x71a13c[_0xc42c('0xb7')][_0xc42c('0x91')][0x0];}return db[_0xc42c('0x6e')][_0xc42c('0x53')](_[_0xc42c('0x13')](_0x1f720d['body'],{'firstName':_0x2ab725,'mobile':_0x2ab725,'phone':_0x2ab725,'ListId':_0x71a13c['ListId']}));}})[_0xc42c('0x1a')](handleEntityNotFound(_0x4b9be2,null))[_0xc42c('0x1a')](function(_0x436137){if(_0x436137){_0x1cd499=_0x436137;return db[_0xc42c('0x94')]['find']({'where':{'ContactId':_0x1cd499['id'],'closed':![],'SmsAccountId':_0x71a13c['id']}})['then'](function(_0x393585){if(_0x393585){return[_0x393585,![]];}return db['SmsInteraction'][_0xc42c('0x53')]({'UserId':_0x1f720d[_0xc42c('0x55')]['id'],'ContactId':_0x1cd499['id'],'SmsAccountId':_0x71a13c['id'],'phone':_0x2ab725,'firstMsgDirection':_0xc42c('0xb9'),'Messages':[_['merge'](_0x1f720d['body'],{'read':![],'body':_0x1f720d['body'][_0xc42c('0x54')],'phone':_0x2ab725,'SmsAccountId':_0x71a13c['id'],'UserId':_0x1f720d[_0xc42c('0x55')]['id'],'ContactId':_0x1cd499['id']})]},{'include':[{'model':db[_0xc42c('0x99')],'as':'Messages'}]})[_0xc42c('0x1a')](function(_0x533fad){return[_0x533fad,!![]];});});}})['spread'](function(_0x35c6c1,_0x3bc594){if(_0x3bc594){return _0x35c6c1;}return db[_0xc42c('0x99')][_0xc42c('0x53')](_[_0xc42c('0x63')](_0x1f720d[_0xc42c('0x54')],{'read':![],'body':_0x1f720d[_0xc42c('0x54')][_0xc42c('0x54')],'phone':_0x2ab725,'SmsAccountId':_0x71a13c['id'],'SmsInteractionId':_0x35c6c1['id'],'UserId':_0x1f720d[_0xc42c('0x55')]['id'],'ContactId':_0x1cd499['id']}))[_0xc42c('0x1a')](function(_0x346538){_0x35c6c1['dataValues'][_0xc42c('0xba')]=[];_0x35c6c1['dataValues'][_0xc42c('0xba')]['push'](_0x346538[_0xc42c('0xbb')]);return _0x35c6c1;});})[_0xc42c('0x1a')](respondWithResult(_0x4b9be2,null))['catch'](handleError(_0x4b9be2,null));};exports['status']=function(_0x3c29eb,_0x3f788c,_0x468600){if(_0x3c29eb[_0xc42c('0x54')]['id']){delete _0x3c29eb[_0xc42c('0x54')]['id'];}console[_0xc42c('0xbc')](_0xc42c('0xbd'),_0x3c29eb[_0xc42c('0x54')]);var _0x45a76a,_0x3bfde8,_0x1fb859;return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x3c29eb['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x3f788c,null))['then'](function(_0x450a79){if(_0x450a79){_0x1fb859=_0x450a79;logger['debug'](_0xc42c('0xa4'),'status',_0xc42c('0xbe'),_0x450a79['type'],util[_0xc42c('0xbf')](_0x3c29eb[_0xc42c('0x54')],{'showHidden':![],'depth':null}));switch(_0x450a79[_0xc42c('0x78')]){case _0xc42c('0x7c'):if(_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc0')]&&_0x3c29eb['body'][_0xc42c('0x25')]){_0x3bfde8=_0x3c29eb['body'][_0xc42c('0x25')];return db['SmsMessage'][_0xc42c('0x5d')]({'where':{'messageId':_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc0')]}});}break;case'connectel':if(_0x3c29eb[_0xc42c('0x54')]['requestid']&&_0x3c29eb['body']['statusInt']){_0x3bfde8=_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc1')];return db[_0xc42c('0x99')][_0xc42c('0x5d')]({'where':{'messageId':_0x3c29eb['body']['requestid']}});}break;case _0xc42c('0xc2'):if(_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc3')]&&_0x3c29eb[_0xc42c('0x54')]['status_code']){_0x3bfde8=_0x3c29eb['body']['status_code'];return db['SmsMessage']['find']({'where':{'messageId':_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc3')]}});}break;case _0xc42c('0x82'):var _0x57df0c=_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x83')][0x0];if(_0x57df0c[_0xc42c('0x7f')]&&_0x57df0c['status']['groupName']===_0xc42c('0xc4')){_0x3bfde8=_0x57df0c[_0xc42c('0x25')][_0xc42c('0xc5')];return db['SmsMessage'][_0xc42c('0x5d')]({'where':{'messageId':_0x57df0c[_0xc42c('0x7f')]}});}break;case _0xc42c('0x86'):if(_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x7f')]&&_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x25')]){_0x3bfde8=_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x25')];return db[_0xc42c('0x99')]['find']({'where':{'messageId':_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x7f')]}});}break;case _0xc42c('0x88'):if(_0x3c29eb[_0xc42c('0x54')]['redif']&&_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x25')]){_0x3bfde8=_0x3c29eb[_0xc42c('0x54')][_0xc42c('0x25')];return db[_0xc42c('0x99')][_0xc42c('0x5d')]({'where':{'messageId':_0x3c29eb[_0xc42c('0x54')][_0xc42c('0xc6')]}});}break;}}})[_0xc42c('0x1a')](handleEntityNotFound(_0x3f788c,null))[_0xc42c('0x1a')](function(_0xc91259){if(_0xc91259){_0x45a76a=_0xc91259;switch(_0x1fb859[_0xc42c('0x78')]){case _0xc42c('0x7c'):if(_0x3bfde8===_0xc42c('0xc4')){return _0x45a76a[_0xc42c('0x2d')]({'read':!![]});}else{logger[_0xc42c('0x20')](_0xc42c('0xa4'),_0xc42c('0x25'),_0xc42c('0x7c'),util[_0xc42c('0xbf')](_0x3c29eb['body'],{'showHidden':![],'depth':null}));}break;case _0xc42c('0xc7'):if(_0x3bfde8==='1'){return _0x45a76a[_0xc42c('0x2d')]({'read':!![]});}else{logger[_0xc42c('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc42c('0x25'),_0xc42c('0x7c'),util['inspect'](_0x3c29eb['body'],{'showHidden':![],'depth':null}));}break;case _0xc42c('0xc2'):if(!_0x3c29eb[_0xc42c('0x54')]['error_code']&&_0x3bfde8>=0xc8&&_0x3bfde8<=0xce){return _0x45a76a[_0xc42c('0x2d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc42c('0xc2'),util[_0xc42c('0xbf')](_0x3c29eb['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1b1d84=_0x3c29eb[_0xc42c('0x54')]['results'][0x0];if(_0x1b1d84['status'][_0xc42c('0xc5')]===_0xc42c('0xc4')){return _0x45a76a[_0xc42c('0x2d')]({'read':!![]});}else{logger['error'](_0xc42c('0xa4'),_0xc42c('0x25'),'infobip',util[_0xc42c('0xbf')](_0x3c29eb['body'],{'showHidden':![],'depth':null}));}break;case _0xc42c('0x86'):if(_0x3bfde8==_0xc42c('0xc8')||_0x3bfde8==_0xc42c('0xc9')){return _0x45a76a[_0xc42c('0x2d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc42c('0x25'),_0xc42c('0x86'),util[_0xc42c('0xbf')](_0x3c29eb[_0xc42c('0x54')],{'showHidden':![],'depth':null}));}break;case _0xc42c('0x88'):if(_0x3bfde8===_0xc42c('0xca')||_0x3bfde8==='ACCEPTD'){return _0x45a76a['update']({'read':!![]});}else{logger[_0xc42c('0x20')](_0xc42c('0xa4'),_0xc42c('0x25'),_0xc42c('0x88'),util[_0xc42c('0xbf')](_0x3c29eb[_0xc42c('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x45a76a;}})[_0xc42c('0x1a')](respondWithResult(_0x3f788c,null))[_0xc42c('0x4f')](handleError(_0x3f788c,null));};exports[_0xc42c('0xcb')]=function(_0x44c574,_0x240e8b,_0x5f2dac){var _0x5056e1,_0x5a7df0,_0x4776cd;return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x44c574[_0xc42c('0x51')]['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x240e8b,null))[_0xc42c('0x1a')](function(_0x17c353){if(_0x17c353){_0x4776cd=_0x17c353;logger[_0xc42c('0x1e')](_0xc42c('0xa4'),_0xc42c('0x25'),_0xc42c('0xbe'),_0x17c353['type'],util[_0xc42c('0xbf')](_0x44c574[_0xc42c('0x39')],{'showHidden':![],'depth':null}));switch(_0x17c353[_0xc42c('0x78')]){case _0xc42c('0xcc'):if(_0x44c574[_0xc42c('0x39')]['message-id']&&_0x44c574[_0xc42c('0x39')][_0xc42c('0xcd')]){_0x5a7df0=_0x44c574['query'][_0xc42c('0xcd')];return db[_0xc42c('0x99')][_0xc42c('0x5d')]({'where':{'messageId':_0x44c574[_0xc42c('0x39')][_0xc42c('0xce')]}});}break;}}})[_0xc42c('0x1a')](handleEntityNotFound(_0x240e8b,null))['then'](function(_0xfa0542){if(_0xfa0542){_0x5056e1=_0xfa0542;switch(_0x4776cd[_0xc42c('0x78')]){case _0xc42c('0xcc'):if(_0x5a7df0==='2'||_0x5a7df0==='6'){return _0x5056e1[_0xc42c('0x2d')]({'read':!![]});}else{logger[_0xc42c('0x20')](_0xc42c('0xa4'),'status',_0xc42c('0xcc'),util['inspect'](_0x44c574['query'],{'showHidden':![],'depth':null}));};break;}return _0x5056e1;}})['then'](respondWithResult(_0x240e8b,null))[_0xc42c('0x4f')](handleError(_0x240e8b,null));};exports[_0xc42c('0xcf')]=function(_0x3b9add,_0x5d771c,_0x499f4a){return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0x3b9add[_0xc42c('0x51')]['id']}})['then'](handleEntityNotFound(_0x5d771c,null))[_0xc42c('0x1a')](function(_0x4fe20c){if(_0x4fe20c){return _0x4fe20c[_0xc42c('0xcf')](_0x3b9add[_0xc42c('0x54')][_0xc42c('0x65')],_['omit'](_0x3b9add['body'],[_0xc42c('0x65'),'id'])||{})[_0xc42c('0xd0')](function(_0xd2df0d){for(var _0x432a24=0x0;_0x432a24<_0x3b9add[_0xc42c('0x54')][_0xc42c('0x65')]['length'];_0x432a24+=0x1){socket[_0xc42c('0xd1')]('userSmsAccount:save',{'UserId':_0x3b9add[_0xc42c('0x54')][_0xc42c('0x65')][_0x432a24],'SmsAccountId':_0x3b9add[_0xc42c('0x51')]['id']});}return _0xd2df0d;});}})['then'](respondWithResult(_0x5d771c,null))[_0xc42c('0x4f')](handleError(_0x5d771c,null));};exports[_0xc42c('0xd2')]=function(_0xfe2d12,_0x2e0818,_0x27b75e){return db[_0xc42c('0x36')][_0xc42c('0x5d')]({'where':{'id':_0xfe2d12[_0xc42c('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e0818,null))[_0xc42c('0x1a')](function(_0x5896eb){if(_0x5896eb){return _0x5896eb[_0xc42c('0xd2')](_0xfe2d12[_0xc42c('0x39')][_0xc42c('0x65')])['then'](function(){if(_['isArray'](_0xfe2d12[_0xc42c('0x39')]['ids'])){for(var _0x216f6b=0x0;_0x216f6b<_0xfe2d12[_0xc42c('0x39')][_0xc42c('0x65')][_0xc42c('0x52')];_0x216f6b+=0x1){socket['emit'](_0xc42c('0xd3'),{'UserId':Number(_0xfe2d12[_0xc42c('0x39')][_0xc42c('0x65')][_0x216f6b]),'SmsAccountId':Number(_0xfe2d12['params']['id'])});}}else{socket[_0xc42c('0xd1')](_0xc42c('0xd3'),{'UserId':Number(_0xfe2d12['query'][_0xc42c('0x65')]),'SmsAccountId':Number(_0xfe2d12[_0xc42c('0x51')]['id'])});}});}})[_0xc42c('0x1a')](respondWithStatusCode(_0x2e0818,null))[_0xc42c('0x4f')](handleError(_0x2e0818,null));};exports[_0xc42c('0xd4')]=function(_0x3e8174,_0x178701,_0xe39f70){var _0x56879d={};var _0x3e1395={};var _0x5711c9;var _0x3f0a0a;return db[_0xc42c('0x36')]['findOne']({'where':{'id':_0x3e8174['params']['id']}})[_0xc42c('0x1a')](handleEntityNotFound(_0x178701,null))['then'](function(_0x539630){if(_0x539630){_0x5711c9=_0x539630;_0x3e1395[_0xc42c('0x37')]=_[_0xc42c('0x38')](db[_0xc42c('0x9c')][_0xc42c('0x62')]);_0x3e1395['query']=_[_0xc42c('0x38')](_0x3e8174[_0xc42c('0x39')]);_0x3e1395['filters']=_[_0xc42c('0x3b')](_0x3e1395[_0xc42c('0x37')],_0x3e1395['query']);_0x56879d[_0xc42c('0x3d')]=_[_0xc42c('0x3b')](_0x3e1395[_0xc42c('0x37')],qs[_0xc42c('0x3c')](_0x3e8174[_0xc42c('0x39')][_0xc42c('0x3c')]));_0x56879d[_0xc42c('0x3d')]=_0x56879d[_0xc42c('0x3d')][_0xc42c('0x52')]?_0x56879d[_0xc42c('0x3d')]:_0x3e1395[_0xc42c('0x37')];_0x56879d[_0xc42c('0x41')]=qs[_0xc42c('0x42')](_0x3e8174[_0xc42c('0x39')][_0xc42c('0x42')]);_0x56879d['where']=qs[_0xc42c('0x3a')](_[_0xc42c('0x43')](_0x3e8174[_0xc42c('0x39')],_0x3e1395[_0xc42c('0x3a')]));if(_0x3e8174[_0xc42c('0x39')][_0xc42c('0x44')]){_0x56879d[_0xc42c('0x45')]=_['merge'](_0x56879d[_0xc42c('0x45')],{'$or':_['map'](_0x56879d[_0xc42c('0x3d')],function(_0x8f5a2f){var _0x2f1fda={};_0x2f1fda[_0x8f5a2f]={'$like':'%'+_0x3e8174[_0xc42c('0x39')][_0xc42c('0x44')]+'%'};return _0x2f1fda;})});}_0x56879d=_[_0xc42c('0x63')]({},_0x56879d,_0x3e8174[_0xc42c('0x4a')]);return _0x5711c9[_0xc42c('0xd4')](_0x56879d);}})[_0xc42c('0x1a')](function(_0x55a57c){if(_0x55a57c){_0x3f0a0a=_0x55a57c[_0xc42c('0x52')];if(!_0x3e8174['query'][_0xc42c('0x3e')](_0xc42c('0x3f'))){_0x56879d[_0xc42c('0x40')]=qs[_0xc42c('0x40')](_0x3e8174[_0xc42c('0x39')][_0xc42c('0x40')]);_0x56879d['offset']=qs[_0xc42c('0x28')](_0x3e8174['query']['offset']);}return _0x5711c9['getAgents'](_0x56879d);}})[_0xc42c('0x1a')](function(_0x5bbfc7){if(_0x5bbfc7){return _0x5bbfc7?{'count':_0x3f0a0a,'rows':_0x5bbfc7}:null;}})[_0xc42c('0x1a')](respondWithResult(_0x178701,null))[_0xc42c('0x4f')](handleError(_0x178701,null));}; \ No newline at end of file +var _0x7c06=['includes','CmList','Contacts','list','omit','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','bulkCreate','getApplications','order','getInteractions','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','SmsMessage','Messages','spread','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','limit','set','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','rows','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','sms','SmsApplication','applications','orderBy','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','text','connectel','clicksend','message_id','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x7c06,0x12e));var _0x67c0=function(_0xbd681,_0x370aee){_0xbd681=_0xbd681-0x0;var _0x147fcb=_0x7c06[_0xbd681];return _0x147fcb;};'use strict';var pdf=require(_0x67c0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x67c0('0x1'));var zipdir=require(_0x67c0('0x2'));var jsonpatch=require(_0x67c0('0x3'));var rp=require(_0x67c0('0x4'));var moment=require('moment');var BPromise=require(_0x67c0('0x5'));var Mustache=require(_0x67c0('0x6'));var util=require(_0x67c0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x67c0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x67c0('0x9'));var squel=require(_0x67c0('0xa'));var crypto=require(_0x67c0('0xb'));var jsforce=require(_0x67c0('0xc'));var deskjs=require(_0x67c0('0xd'));var toCsv=require(_0x67c0('0x8'));var querystring=require('querystring');var Papa=require(_0x67c0('0xe'));var Redis=require(_0x67c0('0xf'));var authService=require(_0x67c0('0x10'));var qs=require(_0x67c0('0x11'));var hardwareService=require(_0x67c0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x67c0('0x13'));var config=require(_0x67c0('0x14'));var db=require(_0x67c0('0x15'))['db'];config[_0x67c0('0x16')]=_[_0x67c0('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x67c0('0x18'))(new Redis(config['redis']));require(_0x67c0('0x19'))[_0x67c0('0x1a')](socket);var jayson=require(_0x67c0('0x1b'));var client=jayson[_0x67c0('0x1c')][_0x67c0('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x4a17d9,_0x1c05b5,_0x41b335){if(_0x41b335){var _0x3786c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3786c7[_0x67c0('0x1e')](_0x1c05b5)){return _0x4a17d9;}else{throw new Error(_0x67c0('0x1f'));}}else{return _0x4a17d9;}}function respondWithRpcPromise(_0x56cdba,_0x45934e,_0x58671b,_0x3143f3){return new BPromise(function(_0x31dec0,_0x530c23){var _0x1136be=_0x3143f3||client;return _0x1136be[_0x67c0('0x20')](_0x56cdba,_0x58671b)['then'](function(_0x18cf96){logger[_0x67c0('0x21')](_0x67c0('0x22'),_0x45934e,_0x67c0('0x23'));logger[_0x67c0('0x24')](_0x67c0('0x25'),_0x45934e,_0x67c0('0x23'),JSON[_0x67c0('0x26')](_0x18cf96));if(_0x18cf96['error']){if(_0x18cf96[_0x67c0('0x27')][_0x67c0('0x28')]===0x1f4){logger[_0x67c0('0x27')]('SmsAccount,\x20%s,\x20%s',_0x45934e,_0x18cf96[_0x67c0('0x27')][_0x67c0('0x29')]);return _0x530c23(_0x18cf96[_0x67c0('0x27')]['message']);}logger[_0x67c0('0x27')]('SmsAccount,\x20%s,\x20%s',_0x45934e,_0x18cf96['error'][_0x67c0('0x29')]);return _0x31dec0(_0x18cf96[_0x67c0('0x27')]['message']);}else{logger[_0x67c0('0x21')]('SmsAccount,\x20%s,\x20%s',_0x45934e,_0x67c0('0x23'));_0x31dec0(_0x18cf96[_0x67c0('0x2a')]['message']);}})[_0x67c0('0x2b')](function(_0x20044b){logger[_0x67c0('0x27')](_0x67c0('0x22'),_0x45934e,_0x20044b);_0x530c23(_0x20044b);});});}function respondWithStatusCode(_0x3ef15b,_0x1368dd){_0x1368dd=_0x1368dd||0xcc;return function(_0x6dd448){if(_0x6dd448){return _0x3ef15b[_0x67c0('0x2c')](_0x1368dd);}return _0x3ef15b[_0x67c0('0x2d')](_0x1368dd)['end']();};}function respondWithResult(_0x16a64d,_0x35943c){_0x35943c=_0x35943c||0xc8;return function(_0x1ade90){if(_0x1ade90){return _0x16a64d['status'](_0x35943c)[_0x67c0('0x2e')](_0x1ade90);}};}function respondWithFilteredResult(_0x5f8c08,_0x50a20c){return function(_0x1f3f2c){if(_0x1f3f2c){var _0x28897a=_0x1f3f2c[_0x67c0('0x2f')],_0x1f6945=_0x50a20c['offset'],_0x3876d4=_0x50a20c['offset']+_0x50a20c[_0x67c0('0x30')],_0x37b876;if(_0x3876d4>=_0x28897a){_0x3876d4=_0x28897a;_0x37b876=0xc8;}else{_0x37b876=0xce;}_0x5f8c08['status'](_0x37b876);return _0x5f8c08[_0x67c0('0x31')]('Content-Range',_0x1f6945+'-'+_0x3876d4+'/'+_0x28897a)[_0x67c0('0x2e')](_0x1f3f2c);}return null;};}function patchUpdates(_0x1ffab9){return function(_0x5af9ef){try{jsonpatch['apply'](_0x5af9ef,_0x1ffab9,!![]);}catch(_0x159f0f){return BPromise[_0x67c0('0x32')](_0x159f0f);}return _0x5af9ef[_0x67c0('0x33')]();};}function saveUpdates(_0x22b11b,_0x2e86f3){return function(_0xb5249e){if(_0xb5249e){return _0xb5249e[_0x67c0('0x34')](_0x22b11b)[_0x67c0('0x35')](function(_0x34f555){return _0x34f555;});}return null;};}function removeEntity(_0x2a2ea9,_0x2883bf){return function(_0x34ed5d){if(_0x34ed5d){return _0x34ed5d['destroy']()[_0x67c0('0x35')](function(){var _0x1613ef=_0x34ed5d[_0x67c0('0x36')]({'plain':!![]});var _0x34add9=_0x67c0('0x37');return db[_0x67c0('0x38')][_0x67c0('0x39')]({'where':{'type':_0x34add9,'resourceId':_0x1613ef['id']}})[_0x67c0('0x35')](function(){return _0x34ed5d;});})['then'](function(){_0x2a2ea9['status'](0xcc)[_0x67c0('0x3a')]();});}};}function handleEntityNotFound(_0x1a3d4e,_0x3c4283){return function(_0x13f695){if(!_0x13f695){_0x1a3d4e['sendStatus'](0x194);}return _0x13f695;};}function handleError(_0x1c992c,_0x3039fd){_0x3039fd=_0x3039fd||0x1f4;return function(_0x219474){logger[_0x67c0('0x27')](_0x219474[_0x67c0('0x3b')]);if(_0x219474[_0x67c0('0x3c')]){delete _0x219474[_0x67c0('0x3c')];}_0x1c992c[_0x67c0('0x2d')](_0x3039fd)[_0x67c0('0x3d')](_0x219474);};}exports['index']=function(_0x404481,_0x552bcd){var _0x376b13={'include':[{'model':db[_0x67c0('0x3e')],'as':_0x67c0('0x3f')}]},_0x14daf5={},_0x52834f={'count':0x0,'rows':[]};var _0x457148=db[_0x67c0('0x40')][_0x67c0('0x41')];_0x14daf5[_0x67c0('0x42')]=_[_0x67c0('0x43')](_0x457148);_0x14daf5[_0x67c0('0x44')]=_['keys'](_0x404481[_0x67c0('0x44')]);_0x14daf5[_0x67c0('0x45')]=_[_0x67c0('0x46')](_0x14daf5['model'],_0x14daf5['query']);_0x376b13[_0x67c0('0x47')]=_[_0x67c0('0x46')](_0x14daf5[_0x67c0('0x42')],qs[_0x67c0('0x48')](_0x404481[_0x67c0('0x44')][_0x67c0('0x48')]));_0x376b13['attributes']=_0x376b13[_0x67c0('0x47')][_0x67c0('0x49')]?_0x376b13[_0x67c0('0x47')]:_0x14daf5[_0x67c0('0x42')];if(!_0x404481[_0x67c0('0x44')][_0x67c0('0x4a')](_0x67c0('0x4b'))){_0x376b13[_0x67c0('0x30')]=qs[_0x67c0('0x30')](_0x404481[_0x67c0('0x44')][_0x67c0('0x30')]);_0x376b13[_0x67c0('0x4c')]=qs['offset'](_0x404481['query']['offset']);}_0x376b13['order']=qs[_0x67c0('0x4d')](_0x404481[_0x67c0('0x44')][_0x67c0('0x4d')]);_0x376b13[_0x67c0('0x4e')]=qs[_0x67c0('0x45')](_[_0x67c0('0x4f')](_0x404481[_0x67c0('0x44')],_0x14daf5[_0x67c0('0x45')]));if(_0x404481[_0x67c0('0x44')]['filter']){_0x376b13['where']=_[_0x67c0('0x50')](_0x376b13[_0x67c0('0x4e')],{'$or':_[_0x67c0('0x51')](_0x457148,function(_0x43ddb2){if(_0x43ddb2[_0x67c0('0x52')][_0x67c0('0x53')]!==_0x67c0('0x54')){var _0x503296={};_0x503296[_0x43ddb2['field']]={'$like':'%'+_0x404481[_0x67c0('0x44')][_0x67c0('0x55')]+'%'};return _0x503296;}})});}_0x376b13=_[_0x67c0('0x50')]({},_0x376b13,_0x404481['options']);var _0x552e2a={'where':_0x376b13[_0x67c0('0x4e')]};return db[_0x67c0('0x40')][_0x67c0('0x2f')](_0x552e2a)[_0x67c0('0x35')](function(_0xcb171c){_0x52834f[_0x67c0('0x2f')]=_0xcb171c;if(_0x404481[_0x67c0('0x44')][_0x67c0('0x56')]){_0x376b13[_0x67c0('0x57')]=[{'all':!![]}];}return db[_0x67c0('0x40')]['findAll'](_0x376b13);})[_0x67c0('0x35')](function(_0x33a961){_0x52834f[_0x67c0('0x58')]=_0x33a961;return _0x52834f;})[_0x67c0('0x35')](respondWithFilteredResult(_0x552bcd,_0x376b13))['catch'](handleError(_0x552bcd,null));};exports[_0x67c0('0x59')]=function(_0x1e7334,_0x1710ad){var _0x5b8b83={'raw':![],'where':{'id':_0x1e7334[_0x67c0('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x67c0('0x3f')}]},_0x40c17b={};_0x40c17b[_0x67c0('0x42')]=_['keys'](db['SmsAccount'][_0x67c0('0x41')]);_0x40c17b[_0x67c0('0x44')]=_['keys'](_0x1e7334[_0x67c0('0x44')]);_0x40c17b[_0x67c0('0x45')]=_[_0x67c0('0x46')](_0x40c17b['model'],_0x40c17b[_0x67c0('0x44')]);_0x5b8b83['attributes']=_[_0x67c0('0x46')](_0x40c17b[_0x67c0('0x42')],qs[_0x67c0('0x48')](_0x1e7334[_0x67c0('0x44')]['fields']));_0x5b8b83[_0x67c0('0x47')]=_0x5b8b83['attributes'][_0x67c0('0x49')]?_0x5b8b83[_0x67c0('0x47')]:_0x40c17b['model'];if(_0x1e7334[_0x67c0('0x44')]['includeAll']){_0x5b8b83[_0x67c0('0x57')]=[{'all':!![]}];}_0x5b8b83=_[_0x67c0('0x50')]({},_0x5b8b83,_0x1e7334[_0x67c0('0x5b')]);return db[_0x67c0('0x40')][_0x67c0('0x5c')](_0x5b8b83)[_0x67c0('0x35')](handleEntityNotFound(_0x1710ad,null))['then'](respondWithResult(_0x1710ad,null))['catch'](handleError(_0x1710ad,null));};exports[_0x67c0('0x5d')]=function(_0x531778,_0x2e0ea3){return db[_0x67c0('0x40')][_0x67c0('0x5d')](_0x531778[_0x67c0('0x5e')],{})[_0x67c0('0x35')](function(_0x732d0c){var _0x5241ac=_0x531778['user'][_0x67c0('0x36')]({'plain':!![]});if(!_0x5241ac)throw new Error(_0x67c0('0x5f'));if(_0x5241ac[_0x67c0('0x60')]===_0x67c0('0x61')){var _0x3b0c44=_0x732d0c['get']({'plain':!![]});var _0x4bfe8b=_0x67c0('0x37');return db[_0x67c0('0x62')]['find']({'where':{'name':_0x4bfe8b,'userProfileId':_0x5241ac[_0x67c0('0x63')]},'raw':!![]})[_0x67c0('0x35')](function(_0x2dade2){if(_0x2dade2&&_0x2dade2[_0x67c0('0x64')]===0x0){return db[_0x67c0('0x38')]['create']({'name':_0x3b0c44[_0x67c0('0x3c')],'resourceId':_0x3b0c44['id'],'type':_0x2dade2[_0x67c0('0x3c')],'sectionId':_0x2dade2['id']},{})[_0x67c0('0x35')](function(){return _0x732d0c;});}else{return _0x732d0c;}})[_0x67c0('0x2b')](function(_0x177de6){logger[_0x67c0('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x177de6);throw _0x177de6;});}return _0x732d0c;})[_0x67c0('0x35')](respondWithResult(_0x2e0ea3,0xc9))['catch'](handleError(_0x2e0ea3,null));};exports[_0x67c0('0x34')]=function(_0x2fbc8c,_0x264b66){if(_0x2fbc8c[_0x67c0('0x5e')]['id']){delete _0x2fbc8c[_0x67c0('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2fbc8c[_0x67c0('0x5a')]['id']},'include':[{'model':db[_0x67c0('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x264b66,null))['then'](saveUpdates(_0x2fbc8c['body'],null))['then'](respondWithResult(_0x264b66,null))['catch'](handleError(_0x264b66,null));};exports[_0x67c0('0x39')]=function(_0x563a6a,_0x1207c1){return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x563a6a['params']['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x1207c1,null))['then'](removeEntity(_0x1207c1,null))['catch'](handleError(_0x1207c1,null));};exports['describe']=function(_0x2efa5f,_0x39cecb){return db[_0x67c0('0x40')][_0x67c0('0x65')]()[_0x67c0('0x35')](respondWithResult(_0x39cecb,null))['catch'](handleError(_0x39cecb,null));};exports[_0x67c0('0x66')]=function(_0x2d3459,_0x24877a,_0x4afd0c){if(_0x2d3459[_0x67c0('0x5e')]['id']){delete _0x2d3459[_0x67c0('0x5e')]['id'];}return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x2d3459[_0x67c0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x24877a,null))['then'](function(_0x109525){if(_0x109525){_0x2d3459[_0x67c0('0x5e')][_0x67c0('0x67')]=_0x109525['id'];return db[_0x67c0('0x68')][_0x67c0('0x5d')](_0x2d3459[_0x67c0('0x5e')]);}})[_0x67c0('0x35')](respondWithResult(_0x24877a,null))[_0x67c0('0x2b')](handleError(_0x24877a,null));};exports[_0x67c0('0x69')]=function(_0x461b50,_0x3f27f3,_0x4b3cf7){var _0x554597={'raw':![],'where':{}};var _0x4a8e2f={};var _0x94ff7e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x67c0('0x6a')]({'where':{'id':_0x461b50[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x3f27f3,null))[_0x67c0('0x35')](function(_0x2ea02b){if(_0x2ea02b){_0x4a8e2f[_0x67c0('0x42')]=_[_0x67c0('0x43')](db[_0x67c0('0x68')]['rawAttributes']);_0x4a8e2f[_0x67c0('0x44')]=_[_0x67c0('0x43')](_0x461b50[_0x67c0('0x44')]);_0x4a8e2f['filters']=_['intersection'](_0x4a8e2f[_0x67c0('0x42')],_0x4a8e2f[_0x67c0('0x44')]);_0x554597['attributes']=_[_0x67c0('0x46')](_0x4a8e2f[_0x67c0('0x42')],qs[_0x67c0('0x48')](_0x461b50[_0x67c0('0x44')][_0x67c0('0x48')]));_0x554597[_0x67c0('0x47')]=_0x554597[_0x67c0('0x47')][_0x67c0('0x49')]?_0x554597[_0x67c0('0x47')]:_0x4a8e2f[_0x67c0('0x42')];if(!_0x461b50[_0x67c0('0x44')]['hasOwnProperty'](_0x67c0('0x4b'))){_0x554597['limit']=qs[_0x67c0('0x30')](_0x461b50[_0x67c0('0x44')][_0x67c0('0x30')]);_0x554597[_0x67c0('0x4c')]=qs[_0x67c0('0x4c')](_0x461b50[_0x67c0('0x44')][_0x67c0('0x4c')]);}_0x554597['order']=qs['sort'](_0x461b50[_0x67c0('0x44')][_0x67c0('0x4d')]);_0x554597['where']=qs[_0x67c0('0x45')](_[_0x67c0('0x4f')](_0x461b50[_0x67c0('0x44')],_0x4a8e2f[_0x67c0('0x45')]));_0x554597[_0x67c0('0x4e')][_0x67c0('0x67')]=_0x2ea02b['id'];if(_0x461b50['query'][_0x67c0('0x55')]){_0x554597[_0x67c0('0x4e')]=_[_0x67c0('0x50')](_0x554597[_0x67c0('0x4e')],{'$or':_[_0x67c0('0x51')](_0x554597[_0x67c0('0x47')],function(_0x3897ab){var _0x569609={};_0x569609[_0x3897ab]={'$like':'%'+_0x461b50[_0x67c0('0x44')][_0x67c0('0x55')]+'%'};return _0x569609;})});}_0x554597=_[_0x67c0('0x50')]({},_0x554597,_0x461b50['options']);return db[_0x67c0('0x68')][_0x67c0('0x2f')]({'where':_0x554597[_0x67c0('0x4e')]})['then'](function(_0x5c9eb8){_0x94ff7e[_0x67c0('0x2f')]=_0x5c9eb8;if(_0x461b50[_0x67c0('0x44')][_0x67c0('0x56')]){_0x554597[_0x67c0('0x57')]=[{'all':!![]}];}return db[_0x67c0('0x68')]['findAll'](_0x554597);})[_0x67c0('0x35')](function(_0x1ec253){_0x94ff7e[_0x67c0('0x58')]=_0x1ec253;return _0x94ff7e;});}})['then'](respondWithFilteredResult(_0x3f27f3,_0x554597))['catch'](handleError(_0x3f27f3,null));};exports['removeDispositions']=function(_0x529ae7,_0x522d7d,_0x281d10){return db['SmsAccount'][_0x67c0('0x5c')]({'where':{'id':_0x529ae7[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x522d7d,null))[_0x67c0('0x35')](function(_0x166de2){if(_0x166de2){return _0x166de2[_0x67c0('0x6b')](_0x529ae7[_0x67c0('0x44')][_0x67c0('0x6c')]);}})[_0x67c0('0x35')](respondWithStatusCode(_0x522d7d,null))[_0x67c0('0x2b')](handleError(_0x522d7d,null));};exports[_0x67c0('0x6d')]=function(_0x3e6227,_0x550676,_0x1f5ad8){if(_0x3e6227[_0x67c0('0x5e')]['id']){delete _0x3e6227[_0x67c0('0x5e')]['id'];}return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x3e6227[_0x67c0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x550676,null))['then'](function(_0x164191){if(_0x164191){_0x3e6227[_0x67c0('0x5e')]['SmsAccountId']=_0x164191['id'];return db[_0x67c0('0x6e')][_0x67c0('0x5d')](_0x3e6227['body']);}})[_0x67c0('0x35')](respondWithResult(_0x550676,null))[_0x67c0('0x2b')](handleError(_0x550676,null));};exports[_0x67c0('0x6f')]=function(_0x4e006e,_0x3be088,_0x40a56d){var _0x1bbcaa={'raw':![],'where':{}};var _0x2f55b0={};var _0x2824fa={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4e006e[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x3be088,null))[_0x67c0('0x35')](function(_0x467654){if(_0x467654){_0x2f55b0[_0x67c0('0x42')]=_[_0x67c0('0x43')](db[_0x67c0('0x6e')][_0x67c0('0x41')]);_0x2f55b0[_0x67c0('0x44')]=_['keys'](_0x4e006e[_0x67c0('0x44')]);_0x2f55b0['filters']=_[_0x67c0('0x46')](_0x2f55b0[_0x67c0('0x42')],_0x2f55b0['query']);_0x1bbcaa['attributes']=_[_0x67c0('0x46')](_0x2f55b0[_0x67c0('0x42')],qs['fields'](_0x4e006e['query'][_0x67c0('0x48')]));_0x1bbcaa['attributes']=_0x1bbcaa[_0x67c0('0x47')][_0x67c0('0x49')]?_0x1bbcaa['attributes']:_0x2f55b0[_0x67c0('0x42')];if(!_0x4e006e[_0x67c0('0x44')][_0x67c0('0x4a')]('nolimit')){_0x1bbcaa[_0x67c0('0x30')]=qs[_0x67c0('0x30')](_0x4e006e[_0x67c0('0x44')][_0x67c0('0x30')]);_0x1bbcaa['offset']=qs['offset'](_0x4e006e['query'][_0x67c0('0x4c')]);}_0x1bbcaa['order']=qs['sort'](_0x4e006e[_0x67c0('0x44')][_0x67c0('0x4d')]);_0x1bbcaa[_0x67c0('0x4e')]=qs[_0x67c0('0x45')](_[_0x67c0('0x4f')](_0x4e006e['query'],_0x2f55b0[_0x67c0('0x45')]));_0x1bbcaa[_0x67c0('0x4e')][_0x67c0('0x67')]=_0x467654['id'];if(_0x4e006e['query'][_0x67c0('0x55')]){_0x1bbcaa[_0x67c0('0x4e')]=_[_0x67c0('0x50')](_0x1bbcaa[_0x67c0('0x4e')],{'$or':_[_0x67c0('0x51')](_0x1bbcaa['attributes'],function(_0x5e72de){var _0x48ee61={};_0x48ee61[_0x5e72de]={'$like':'%'+_0x4e006e[_0x67c0('0x44')][_0x67c0('0x55')]+'%'};return _0x48ee61;})});}_0x1bbcaa=_[_0x67c0('0x50')]({},_0x1bbcaa,_0x4e006e[_0x67c0('0x5b')]);return db['CannedAnswer'][_0x67c0('0x2f')]({'where':_0x1bbcaa[_0x67c0('0x4e')]})[_0x67c0('0x35')](function(_0x1d5592){_0x2824fa[_0x67c0('0x2f')]=_0x1d5592;if(_0x4e006e[_0x67c0('0x44')][_0x67c0('0x56')]){_0x1bbcaa[_0x67c0('0x57')]=[{'all':!![]}];}return db[_0x67c0('0x6e')][_0x67c0('0x70')](_0x1bbcaa);})[_0x67c0('0x35')](function(_0x12668f){_0x2824fa[_0x67c0('0x58')]=_0x12668f;return _0x2824fa;});}})[_0x67c0('0x35')](respondWithFilteredResult(_0x3be088,_0x1bbcaa))[_0x67c0('0x2b')](handleError(_0x3be088,null));};exports[_0x67c0('0x71')]=function(_0x42903d,_0x1b64f2,_0x3b143d){return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x42903d[_0x67c0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b64f2,null))[_0x67c0('0x35')](function(_0x3d1f90){if(_0x3d1f90){return _0x3d1f90[_0x67c0('0x71')](_0x42903d[_0x67c0('0x44')][_0x67c0('0x6c')]);}})['then'](respondWithStatusCode(_0x1b64f2,null))[_0x67c0('0x2b')](handleError(_0x1b64f2,null));};exports['notify']=function(_0x59f5d2,_0x5a6403,_0x4c482f){var _0x48db00={'channel':_0x67c0('0x72')};var _0x199323=[];var _0x5c439b=[];var _0x4bcfa6={};return db['SmsAccount'][_0x67c0('0x5c')]({'where':{'id':_0x59f5d2['params']['id']},'include':[{'model':db[_0x67c0('0x73')],'as':'Applications'}]})[_0x67c0('0x35')](handleEntityNotFound(_0x5a6403,null))[_0x67c0('0x35')](function(_0x32fa4d){_0x48db00['account']=_0x32fa4d;_0x48db00[_0x67c0('0x74')]=_[_0x67c0('0x75')](_0x32fa4d[_0x67c0('0x76')],[_0x67c0('0x77')],[_0x67c0('0x78')]);if(_0x48db00[_0x67c0('0x79')][_0x67c0('0x76')]){delete _0x48db00[_0x67c0('0x79')][_0x67c0('0x76')];}return db[_0x67c0('0x7a')][_0x67c0('0x65')]();})[_0x67c0('0x35')](function(_0x2e2a6d){if(!_0x2e2a6d){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))](_0x67c0('0x7d'));}_0x199323=_[_0x67c0('0x7e')](_[_0x67c0('0x43')](_0x2e2a6d),['createdAt',_0x67c0('0x7f')]);_0x5c439b=_[_0x67c0('0x7e')](_['keys'](_0x2e2a6d),[_0x67c0('0x80'),_0x67c0('0x7f'),_0x67c0('0x81'),_0x67c0('0x82')]);_0x48db00[_0x67c0('0x5e')]={'mapKey':'mobile'};if(_0x48db00['account']['type']){switch(_0x48db00[_0x67c0('0x79')][_0x67c0('0x52')]){case _0x67c0('0x83'):_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2['body'][_0x67c0('0x85')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x86')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x88')];break;case'skebby':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]='+'+_0x59f5d2[_0x67c0('0x5e')]['sender'];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2['body'][_0x67c0('0x89')];break;case _0x67c0('0x8a'):_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2[_0x67c0('0x5e')]['from'];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x29')];break;case _0x67c0('0x8b'):_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x84')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x5e')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x8c')];break;case'plivo':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x85')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')]['Text'];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x8d')];break;case _0x67c0('0x8e'):_0x48db00[_0x67c0('0x5e')]['from']='+'+_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x8f')][0x0][_0x67c0('0x84')];_0x48db00['body'][_0x67c0('0x5e')]=_0x59f5d2['body'][_0x67c0('0x8f')][0x0][_0x67c0('0x89')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x8f')][0x0][_0x67c0('0x87')];break;case _0x67c0('0x90'):_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x91')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x92')][_0x67c0('0x29')];break;case _0x67c0('0x93'):_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')]=_0x59f5d2['body']['fromNumber'];_0x48db00[_0x67c0('0x5e')]['body']=_0x59f5d2[_0x67c0('0x5e')]['text'];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x94')];break;case _0x67c0('0x95'):_0x48db00[_0x67c0('0x5e')]['from']=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x84')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x29')];_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')]=_0x59f5d2[_0x67c0('0x5e')][_0x67c0('0x96')];break;}}if(_0x48db00[_0x67c0('0x5e')]['id']){delete _0x48db00[_0x67c0('0x5e')]['id'];}if(_[_0x67c0('0x97')](_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')])){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))](_0x67c0('0x98'));}if(_[_0x67c0('0x97')](_0x48db00['body'][_0x67c0('0x5e')])||_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')]===''){throw new db[(_0x67c0('0x7b'))]['ValidationError'](_0x67c0('0x99'));}if(_['isNil'](_0x48db00[_0x67c0('0x5e')][_0x67c0('0x9a')])){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))](_0x67c0('0x9b')+_0x5c439b);}if(!_[_0x67c0('0x9c')](_0x5c439b,_0x48db00[_0x67c0('0x5e')][_0x67c0('0x9a')])){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c439b);}_0x4bcfa6[_0x48db00[_0x67c0('0x5e')]['mapKey']]=_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')];return db[_0x67c0('0x9d')][_0x67c0('0x5c')]({'where':{'id':_0x48db00[_0x67c0('0x79')][_0x67c0('0x82')]},'include':[{'model':db[_0x67c0('0x7a')],'as':_0x67c0('0x9e'),'where':_0x4bcfa6,'limit':0x1,'order':[[_0x67c0('0x7f'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5a6403,null))[_0x67c0('0x35')](function(_0x1f2eda){if(_0x1f2eda){_0x48db00[_0x67c0('0x9f')]=_[_0x67c0('0xa0')](_0x1f2eda,[_0x67c0('0x9e')]);if(_0x1f2eda[_0x67c0('0x9e')][_0x67c0('0x49')]){return _0x1f2eda['Contacts'][0x0];}var _0x22ad89=_[_0x67c0('0x17')](_0x48db00[_0x67c0('0x5e')],{'firstName':_0x48db00['body'][_0x67c0('0x84')],'ListId':_0x1f2eda['id']});_0x22ad89[_0x48db00['body'][_0x67c0('0x9a')]]=_0x48db00[_0x67c0('0x5e')]['from'];return db[_0x67c0('0x7a')][_0x67c0('0x5d')](_0x22ad89,{'fields':_0x199323,'raw':!![]});}})[_0x67c0('0x35')](handleEntityNotFound(_0x5a6403,null))[_0x67c0('0x35')](function(_0x165210){if(_0x165210){_0x48db00['contact']=_0x165210;var _0x2e9f10={'ContactId':_0x165210['id'],'phone':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')],'SmsAccountId':_0x59f5d2['params']['id']};var _0x23fb61={'ContactId':_0x165210['id'],'SmsAccountId':_0x59f5d2['params']['id'],'closed':![]};return db[_0x67c0('0xa1')][_0x67c0('0x5c')]({'where':_0x23fb61})[_0x67c0('0x35')](function(_0x37c5bb){if(_0x37c5bb){return[_0x37c5bb,![]];}return db[_0x67c0('0xa1')]['create'](_0x2e9f10)['then'](function(_0x310a55){return[_0x310a55,!![]];});});}})['spread'](function(_0x42b549,_0x15dbd0){_0x48db00[_0x67c0('0xa2')]=_0x42b549[_0x67c0('0x36')]({'plain':!![]});_0x48db00[_0x67c0('0xa2')][_0x67c0('0xa3')]=![];if(_0x15dbd0){if(_0x48db00[_0x67c0('0x79')][_0x67c0('0xa4')]){_0x48db00['applications'][_0x67c0('0xa5')]({'id':0x0,'priority':_0x48db00[_0x67c0('0x74')][_0x67c0('0x49')]+0x1,'app':_0x67c0('0xa6'),'appdata':_0x67c0('0xa7'),'interval':_0x67c0('0xa8')});}_0x48db00[_0x67c0('0xa2')][_0x67c0('0xa3')]=!![];}return db['SmsMessage']['create']({'phone':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x84')],'messageId':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x87')],'body':_0x48db00[_0x67c0('0x5e')][_0x67c0('0x5e')],'SmsAccountId':_0x59f5d2['params']['id'],'SmsInteractionId':_0x42b549['id'],'direction':'in','ContactId':_0x42b549[_0x67c0('0xa9')],'AttachmentId':_0x48db00[_0x67c0('0x5e')][_0x67c0('0xaa')]});})[_0x67c0('0x35')](function(_0x78a8e3){_0x48db00['message']=_0x78a8e3;if(_0x48db00['interaction']['UserId']){return db[_0x67c0('0xab')]['find']({'attributes':['id',_0x67c0('0x3c')],'where':{'id':_0x48db00[_0x67c0('0xa2')][_0x67c0('0xac')]}})[_0x67c0('0x35')](function(_0x475c8b){if(_0x475c8b){_0x48db00[_0x67c0('0x74')][_0x67c0('0xad')]({'id':0x0,'priority':0x0,'app':_0x67c0('0xae'),'appdata':_0x475c8b[_0x67c0('0x3c')]+','+(_0x48db00[_0x67c0('0x79')][_0x67c0('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x67c0('0xb0'),_0x67c0('0xb1'),_0x48db00);});}return respondWithRpcPromise(_0x67c0('0xb0'),'startRouting',_0x48db00);})[_0x67c0('0x35')](function(_0x537789){if(_0x537789){var _0x305106=0xc8;var _0x569631=_0x67c0('0xb2');logger[_0x67c0('0x21')](_0x67c0('0x25'),_0x569631,_0x305106,_0x67c0('0xb3'));logger['debug'](_0x67c0('0xb4'),_0x569631,_0x305106,_0x67c0('0xb3'),JSON['stringify'](_0x537789));if(_0x48db00[_0x67c0('0x79')][_0x67c0('0x52')]===_0x67c0('0x83')){return _0x5a6403[_0x67c0('0x2d')](_0x305106)[_0x67c0('0x31')](_0x67c0('0xb5'),_0x67c0('0xb6'))[_0x67c0('0x3d')]('\x0a');}else{return _0x5a6403[_0x67c0('0x2d')](_0x305106)[_0x67c0('0x2e')](_0x537789);}}})[_0x67c0('0x2b')](handleError(_0x5a6403,null));};exports[_0x67c0('0xb7')]=function(_0x386f07,_0x1d193b,_0x1676a4){return db[_0x67c0('0x40')]['findOne']({'where':{'id':_0x386f07[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x1d193b,null))[_0x67c0('0x35')](function(_0x313e18){if(_0x313e18){return db[_0x67c0('0xb8')][_0x67c0('0xb9')](function(_0x309146){return db[_0x67c0('0x73')][_0x67c0('0x39')]({'where':{'SmsAccountId':_0x386f07['params']['id']},'transaction':_0x309146})[_0x67c0('0x35')](function(_0x5889da){var _0x38a534=_[_0x67c0('0x51')](_0x386f07['body'],function(_0xa60003){_0xa60003[_0x67c0('0x67')]=_0x386f07[_0x67c0('0x5a')]['id'];return _0xa60003;});return db[_0x67c0('0x73')][_0x67c0('0xba')](_0x38a534,{'transaction':_0x309146});});})['then'](function(){return db[_0x67c0('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x386f07['params']['id']},'order':'priority'});});}})[_0x67c0('0x35')](respondWithResult(_0x1d193b,null))[_0x67c0('0x2b')](handleError(_0x1d193b,null));};exports[_0x67c0('0xbb')]=function(_0xdc7d6d,_0xbb5b07,_0x203706){var _0x4588ce={};var _0x440917={};var _0x4c3eb1;var _0x140e70;return db[_0x67c0('0x40')][_0x67c0('0x6a')]({'where':{'id':_0xdc7d6d[_0x67c0('0x5a')]['id']}})['then'](handleEntityNotFound(_0xbb5b07,null))['then'](function(_0x202410){if(_0x202410){_0x4c3eb1=_0x202410;_0x440917[_0x67c0('0x42')]=_['keys'](db[_0x67c0('0x73')]['rawAttributes']);_0x440917[_0x67c0('0x44')]=_['keys'](_0xdc7d6d[_0x67c0('0x44')]);_0x440917[_0x67c0('0x45')]=_[_0x67c0('0x46')](_0x440917['model'],_0x440917[_0x67c0('0x44')]);_0x4588ce[_0x67c0('0x47')]=_['intersection'](_0x440917['model'],qs[_0x67c0('0x48')](_0xdc7d6d[_0x67c0('0x44')]['fields']));_0x4588ce[_0x67c0('0x47')]=_0x4588ce[_0x67c0('0x47')]['length']?_0x4588ce[_0x67c0('0x47')]:_0x440917[_0x67c0('0x42')];_0x4588ce[_0x67c0('0xbc')]=qs[_0x67c0('0x4d')](_0xdc7d6d['query'][_0x67c0('0x4d')]);_0x4588ce[_0x67c0('0x4e')]=qs['filters'](_[_0x67c0('0x4f')](_0xdc7d6d[_0x67c0('0x44')],_0x440917['filters']));if(_0xdc7d6d[_0x67c0('0x44')][_0x67c0('0x55')]){_0x4588ce['where']=_[_0x67c0('0x50')](_0x4588ce[_0x67c0('0x4e')],{'$or':_['map'](_0x4588ce[_0x67c0('0x47')],function(_0x516cc3){var _0x24342f={};_0x24342f[_0x516cc3]={'$like':'%'+_0xdc7d6d[_0x67c0('0x44')]['filter']+'%'};return _0x24342f;})});}_0x4588ce=_[_0x67c0('0x50')]({},_0x4588ce,_0xdc7d6d[_0x67c0('0x5b')]);return _0x4c3eb1[_0x67c0('0xbb')](_0x4588ce);}})[_0x67c0('0x35')](function(_0x58afc4){if(_0x58afc4){_0x140e70=_0x58afc4['length'];if(!_0xdc7d6d[_0x67c0('0x44')][_0x67c0('0x4a')](_0x67c0('0x4b'))){_0x4588ce['limit']=qs[_0x67c0('0x30')](_0xdc7d6d[_0x67c0('0x44')][_0x67c0('0x30')]);_0x4588ce[_0x67c0('0x4c')]=qs['offset'](_0xdc7d6d[_0x67c0('0x44')][_0x67c0('0x4c')]);}return _0x4c3eb1[_0x67c0('0xbb')](_0x4588ce);}})[_0x67c0('0x35')](function(_0x2e0488){if(_0x2e0488){return _0x2e0488?{'count':_0x140e70,'rows':_0x2e0488}:null;}})[_0x67c0('0x35')](respondWithResult(_0xbb5b07,null))[_0x67c0('0x2b')](handleError(_0xbb5b07,null));};exports[_0x67c0('0xbd')]=function(_0x1ed393,_0xbd2d60,_0x49b15e){var _0x11df84={'raw':![],'where':{}};var _0x59bd7c={};var _0x26d064={'count':0x0,'rows':[]};return db[_0x67c0('0x40')][_0x67c0('0x6a')]({'where':{'id':_0x1ed393[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0xbd2d60,null))[_0x67c0('0x35')](function(_0x174863){if(_0x174863){_0x59bd7c[_0x67c0('0x42')]=_[_0x67c0('0x43')](db[_0x67c0('0xa1')][_0x67c0('0x41')]);_0x59bd7c[_0x67c0('0x44')]=_['keys'](_0x1ed393[_0x67c0('0x44')]);_0x59bd7c[_0x67c0('0x45')]=_[_0x67c0('0x46')](_0x59bd7c['model'],_0x59bd7c[_0x67c0('0x44')]);_0x11df84[_0x67c0('0x47')]=_[_0x67c0('0x46')](_0x59bd7c[_0x67c0('0x42')],qs[_0x67c0('0x48')](_0x1ed393[_0x67c0('0x44')][_0x67c0('0x48')]));_0x11df84[_0x67c0('0x47')]=_0x11df84['attributes'][_0x67c0('0x49')]?_0x11df84[_0x67c0('0x47')]:_0x59bd7c[_0x67c0('0x42')];if(!_0x1ed393[_0x67c0('0x44')]['hasOwnProperty'](_0x67c0('0x4b'))){_0x11df84[_0x67c0('0x30')]=qs[_0x67c0('0x30')](_0x1ed393[_0x67c0('0x44')]['limit']);_0x11df84['offset']=qs[_0x67c0('0x4c')](_0x1ed393[_0x67c0('0x44')][_0x67c0('0x4c')]);}_0x11df84[_0x67c0('0xbc')]=qs[_0x67c0('0x4d')](_0x1ed393[_0x67c0('0x44')][_0x67c0('0x4d')]);_0x11df84[_0x67c0('0x4e')]=qs[_0x67c0('0x45')](_[_0x67c0('0x4f')](_0x1ed393[_0x67c0('0x44')],_0x59bd7c[_0x67c0('0x45')]));_0x11df84[_0x67c0('0x4e')][_0x67c0('0x67')]=_0x174863['id'];if(_0x1ed393[_0x67c0('0x44')]['filter']){_0x11df84[_0x67c0('0x4e')]=_[_0x67c0('0x50')](_0x11df84[_0x67c0('0x4e')],{'$or':_[_0x67c0('0x51')](_0x11df84[_0x67c0('0x47')],function(_0x26825a){var _0x37e558={};_0x37e558[_0x26825a]={'$like':'%'+_0x1ed393[_0x67c0('0x44')]['filter']+'%'};return _0x37e558;})});}_0x11df84=_['merge']({},_0x11df84,_0x1ed393[_0x67c0('0x5b')]);return db[_0x67c0('0xa1')][_0x67c0('0x2f')]({'where':_0x11df84[_0x67c0('0x4e')]})[_0x67c0('0x35')](function(_0x58d699){_0x26d064[_0x67c0('0x2f')]=_0x58d699;if(_0x1ed393[_0x67c0('0x44')][_0x67c0('0x56')]){_0x11df84['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x67c0('0xab')],'as':'Owner','attributes':[_0x67c0('0x3c'),_0x67c0('0xbe'),_0x67c0('0xbf')],'required':![]},{'model':db[_0x67c0('0xc0')],'as':_0x67c0('0xc1'),'attributes':['id',_0x67c0('0x3c'),_0x67c0('0xc2')],'where':_0x1ed393[_0x67c0('0x44')][_0x67c0('0xc3')]?{'id':_0x1ed393['query'][_0x67c0('0xc3')]}:undefined,'required':_0x1ed393[_0x67c0('0x44')][_0x67c0('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0x67c0('0x70')](_0x11df84);})[_0x67c0('0x35')](function(_0x1ae13d){_0x26d064[_0x67c0('0x58')]=_0x1ae13d;return _0x26d064;});}})['then'](respondWithFilteredResult(_0xbd2d60,_0x11df84))[_0x67c0('0x2b')](handleError(_0xbd2d60,null));};exports[_0x67c0('0x3d')]=function(_0x16fb40,_0x51fd24,_0x574ed7){var _0x4f98ac,_0x2c72d0,_0x433451;if(_[_0x67c0('0x97')](_0x16fb40['body'][_0x67c0('0x5e')])||_0x16fb40[_0x67c0('0x5e')]['body']===''){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))](_0x67c0('0x99'));}if(_[_0x67c0('0x97')](_0x16fb40[_0x67c0('0x5e')]['to'])){throw new db[(_0x67c0('0x7b'))][(_0x67c0('0x7c'))](_0x67c0('0xc4'));}_0x4f98ac=_0x16fb40[_0x67c0('0x5e')]['to'];return db[_0x67c0('0x40')]['find']({'where':{'id':_0x16fb40[_0x67c0('0x5a')]['id']},'include':[{'model':db[_0x67c0('0x9d')],'as':_0x67c0('0xc5'),'include':[{'model':db[_0x67c0('0x7a')],'as':_0x67c0('0x9e'),'where':{'mobile':_0x4f98ac},'limit':0x1,'order':[['updatedAt',_0x67c0('0xc6')]]}]}]})['then'](handleEntityNotFound(_0x51fd24,null))[_0x67c0('0x35')](function(_0x3a6c9a){if(_0x3a6c9a&&_0x3a6c9a[_0x67c0('0xc5')]){_0x2c72d0=_0x3a6c9a[_0x67c0('0x36')]({'plain':!![]});if(_0x2c72d0[_0x67c0('0xc5')]&&_0x2c72d0[_0x67c0('0xc5')][_0x67c0('0x9e')]['length']){return _0x2c72d0[_0x67c0('0xc5')][_0x67c0('0x9e')][0x0];}return db[_0x67c0('0x7a')]['create'](_[_0x67c0('0x17')](_0x16fb40[_0x67c0('0x5e')],{'firstName':_0x4f98ac,'mobile':_0x4f98ac,'phone':_0x4f98ac,'ListId':_0x2c72d0[_0x67c0('0x82')]}));}})[_0x67c0('0x35')](handleEntityNotFound(_0x51fd24,null))[_0x67c0('0x35')](function(_0x2a1a62){if(_0x2a1a62){_0x433451=_0x2a1a62;return db[_0x67c0('0xa1')][_0x67c0('0x5c')]({'where':{'ContactId':_0x433451['id'],'closed':![],'SmsAccountId':_0x2c72d0['id']}})[_0x67c0('0x35')](function(_0x16215b){if(_0x16215b){return[_0x16215b,![]];}return db[_0x67c0('0xa1')][_0x67c0('0x5d')]({'UserId':_0x16fb40['user']['id'],'ContactId':_0x433451['id'],'SmsAccountId':_0x2c72d0['id'],'phone':_0x4f98ac,'firstMsgDirection':_0x67c0('0xc7'),'Messages':[_[_0x67c0('0x50')](_0x16fb40[_0x67c0('0x5e')],{'read':![],'body':_0x16fb40[_0x67c0('0x5e')][_0x67c0('0x5e')],'phone':_0x4f98ac,'SmsAccountId':_0x2c72d0['id'],'UserId':_0x16fb40[_0x67c0('0x61')]['id'],'ContactId':_0x433451['id']})]},{'include':[{'model':db[_0x67c0('0xc8')],'as':_0x67c0('0xc9')}]})[_0x67c0('0x35')](function(_0x2a2892){return[_0x2a2892,!![]];});});}})[_0x67c0('0xca')](function(_0x47edbb,_0x5c4ed7){if(_0x5c4ed7){return _0x47edbb;}return db[_0x67c0('0xc8')]['create'](_[_0x67c0('0x50')](_0x16fb40['body'],{'read':![],'body':_0x16fb40['body'][_0x67c0('0x5e')],'phone':_0x4f98ac,'SmsAccountId':_0x2c72d0['id'],'SmsInteractionId':_0x47edbb['id'],'UserId':_0x16fb40[_0x67c0('0x61')]['id'],'ContactId':_0x433451['id']}))[_0x67c0('0x35')](function(_0x1af61b){_0x47edbb[_0x67c0('0xcb')][_0x67c0('0xc9')]=[];_0x47edbb[_0x67c0('0xcb')][_0x67c0('0xc9')]['push'](_0x1af61b[_0x67c0('0xcb')]);return _0x47edbb;});})[_0x67c0('0x35')](respondWithResult(_0x51fd24,null))['catch'](handleError(_0x51fd24,null));};exports['status']=function(_0x3acebd,_0x1f4fd6,_0x44aaa6){if(_0x3acebd[_0x67c0('0x5e')]['id']){delete _0x3acebd[_0x67c0('0x5e')]['id'];}console[_0x67c0('0xcc')](_0x67c0('0xcd'),_0x3acebd['body']);var _0x1828ef,_0x2878b7,_0x6c2a2d;return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x3acebd[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x1f4fd6,null))['then'](function(_0x255db1){if(_0x255db1){_0x6c2a2d=_0x255db1;logger[_0x67c0('0x24')](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0xce'),_0x255db1[_0x67c0('0x52')],util[_0x67c0('0xcf')](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));switch(_0x255db1['type']){case _0x67c0('0xd0'):if(_0x3acebd['body']['skebby_dispatch_id']&&_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x2d')]){_0x2878b7=_0x3acebd[_0x67c0('0x5e')]['status'];return db[_0x67c0('0xc8')][_0x67c0('0x5c')]({'where':{'messageId':_0x3acebd['body'][_0x67c0('0xd1')]}});}break;case _0x67c0('0x8a'):if(_0x3acebd[_0x67c0('0x5e')][_0x67c0('0xd2')]&&_0x3acebd[_0x67c0('0x5e')][_0x67c0('0xd3')]){_0x2878b7=_0x3acebd['body'][_0x67c0('0xd3')];return db[_0x67c0('0xc8')][_0x67c0('0x5c')]({'where':{'messageId':_0x3acebd['body'][_0x67c0('0xd2')]}});}break;case _0x67c0('0x8b'):if(_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x8c')]&&_0x3acebd['body'][_0x67c0('0xd4')]){_0x2878b7=_0x3acebd['body'][_0x67c0('0xd4')];return db['SmsMessage'][_0x67c0('0x5c')]({'where':{'messageId':_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x8c')]}});}break;case _0x67c0('0x8e'):var _0x1f8a0a=_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x8f')][0x0];if(_0x1f8a0a[_0x67c0('0x87')]&&_0x1f8a0a[_0x67c0('0x2d')][_0x67c0('0xd5')]===_0x67c0('0xd6')){_0x2878b7=_0x1f8a0a[_0x67c0('0x2d')]['groupName'];return db['SmsMessage'][_0x67c0('0x5c')]({'where':{'messageId':_0x1f8a0a[_0x67c0('0x87')]}});}break;case'clickatell':if(_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x87')]&&_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x2d')]){_0x2878b7=_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x2d')];return db['SmsMessage'][_0x67c0('0x5c')]({'where':{'messageId':_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x87')]}});}break;case _0x67c0('0x95'):if(_0x3acebd[_0x67c0('0x5e')][_0x67c0('0xd7')]&&_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x2d')]){_0x2878b7=_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x2d')];return db[_0x67c0('0xc8')][_0x67c0('0x5c')]({'where':{'messageId':_0x3acebd[_0x67c0('0x5e')][_0x67c0('0xd7')]}});}break;}}})[_0x67c0('0x35')](handleEntityNotFound(_0x1f4fd6,null))[_0x67c0('0x35')](function(_0x24d95a){if(_0x24d95a){_0x1828ef=_0x24d95a;switch(_0x6c2a2d[_0x67c0('0x52')]){case _0x67c0('0xd0'):if(_0x2878b7===_0x67c0('0xd6')){return _0x1828ef[_0x67c0('0x34')]({'read':!![]});}else{logger[_0x67c0('0x27')](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0xd0'),util[_0x67c0('0xcf')](_0x3acebd['body'],{'showHidden':![],'depth':null}));}break;case _0x67c0('0x8a'):if(_0x2878b7==='1'){return _0x1828ef[_0x67c0('0x34')]({'read':!![]});}else{logger['error'](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0xd0'),util['inspect'](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x67c0('0x8b'):if(!_0x3acebd[_0x67c0('0x5e')][_0x67c0('0xd8')]&&_0x2878b7>=0xc8&&_0x2878b7<=0xce){return _0x1828ef[_0x67c0('0x34')]({'read':!![]});}else{logger['error'](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0x8b'),util[_0x67c0('0xcf')](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x67c0('0x8e'):var _0x374ab5=_0x3acebd[_0x67c0('0x5e')][_0x67c0('0x8f')][0x0];if(_0x374ab5[_0x67c0('0x2d')]['groupName']===_0x67c0('0xd6')){return _0x1828ef[_0x67c0('0x34')]({'read':!![]});}else{logger[_0x67c0('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x67c0('0x2d'),_0x67c0('0x8e'),util['inspect'](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x67c0('0x93'):if(_0x2878b7=='DELIVERED_TO_GATEWAY'||_0x2878b7==_0x67c0('0xd9')){return _0x1828ef['update']({'read':!![]});}else{logger[_0x67c0('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x67c0('0x2d'),_0x67c0('0x93'),util[_0x67c0('0xcf')](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x67c0('0x95'):if(_0x2878b7===_0x67c0('0xda')||_0x2878b7===_0x67c0('0xdb')){return _0x1828ef['update']({'read':!![]});}else{logger['error'](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0x95'),util[_0x67c0('0xcf')](_0x3acebd[_0x67c0('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1828ef;}})[_0x67c0('0x35')](respondWithResult(_0x1f4fd6,null))[_0x67c0('0x2b')](handleError(_0x1f4fd6,null));};exports[_0x67c0('0xdc')]=function(_0x2a4f32,_0x214445,_0x28f817){var _0x55db0c,_0x548ed9,_0x3993e1;return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x2a4f32[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x214445,null))['then'](function(_0x3cd356){if(_0x3cd356){_0x3993e1=_0x3cd356;logger['debug'](_0x67c0('0x25'),_0x67c0('0x2d'),_0x67c0('0xce'),_0x3cd356[_0x67c0('0x52')],util[_0x67c0('0xcf')](_0x2a4f32['query'],{'showHidden':![],'depth':null}));switch(_0x3cd356[_0x67c0('0x52')]){case _0x67c0('0x90'):if(_0x2a4f32[_0x67c0('0x44')]['message-id']&&_0x2a4f32['query'][_0x67c0('0xdd')]){_0x548ed9=_0x2a4f32[_0x67c0('0x44')][_0x67c0('0xdd')];return db[_0x67c0('0xc8')]['find']({'where':{'messageId':_0x2a4f32[_0x67c0('0x44')][_0x67c0('0xde')]}});}break;}}})[_0x67c0('0x35')](handleEntityNotFound(_0x214445,null))[_0x67c0('0x35')](function(_0x2633c4){if(_0x2633c4){_0x55db0c=_0x2633c4;switch(_0x3993e1[_0x67c0('0x52')]){case _0x67c0('0x90'):if(_0x548ed9==='2'||_0x548ed9==='6'){return _0x55db0c[_0x67c0('0x34')]({'read':!![]});}else{logger[_0x67c0('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x67c0('0x2d'),_0x67c0('0x90'),util[_0x67c0('0xcf')](_0x2a4f32[_0x67c0('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x55db0c;}})[_0x67c0('0x35')](respondWithResult(_0x214445,null))[_0x67c0('0x2b')](handleError(_0x214445,null));};exports[_0x67c0('0xdf')]=function(_0x385b13,_0x5769a6,_0x365d35){return db[_0x67c0('0x40')][_0x67c0('0x5c')]({'where':{'id':_0x385b13[_0x67c0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5769a6,null))['then'](function(_0x5391df){if(_0x5391df){return _0x5391df['addAgents'](_0x385b13[_0x67c0('0x5e')][_0x67c0('0x6c')],_[_0x67c0('0xa0')](_0x385b13['body'],[_0x67c0('0x6c'),'id'])||{})[_0x67c0('0xca')](function(_0x4efc55){for(var _0x1912b5=0x0;_0x1912b5<_0x385b13[_0x67c0('0x5e')]['ids'][_0x67c0('0x49')];_0x1912b5+=0x1){socket[_0x67c0('0xe0')]('userSmsAccount:save',{'UserId':_0x385b13['body'][_0x67c0('0x6c')][_0x1912b5],'SmsAccountId':_0x385b13[_0x67c0('0x5a')]['id']});}return _0x4efc55;});}})[_0x67c0('0x35')](respondWithResult(_0x5769a6,null))['catch'](handleError(_0x5769a6,null));};exports[_0x67c0('0xe1')]=function(_0x5895cc,_0x23d86d,_0x24adb7){return db['SmsAccount'][_0x67c0('0x5c')]({'where':{'id':_0x5895cc['params']['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x23d86d,null))['then'](function(_0x497ce5){if(_0x497ce5){return _0x497ce5[_0x67c0('0xe1')](_0x5895cc['query'][_0x67c0('0x6c')])['then'](function(){if(_[_0x67c0('0xe2')](_0x5895cc[_0x67c0('0x44')][_0x67c0('0x6c')])){for(var _0x532c3d=0x0;_0x532c3d<_0x5895cc[_0x67c0('0x44')][_0x67c0('0x6c')]['length'];_0x532c3d+=0x1){socket['emit'](_0x67c0('0xe3'),{'UserId':Number(_0x5895cc[_0x67c0('0x44')][_0x67c0('0x6c')][_0x532c3d]),'SmsAccountId':Number(_0x5895cc[_0x67c0('0x5a')]['id'])});}}else{socket['emit'](_0x67c0('0xe3'),{'UserId':Number(_0x5895cc[_0x67c0('0x44')]['ids']),'SmsAccountId':Number(_0x5895cc['params']['id'])});}});}})['then'](respondWithStatusCode(_0x23d86d,null))['catch'](handleError(_0x23d86d,null));};exports[_0x67c0('0xe4')]=function(_0x1cbbde,_0x10d18b,_0x401e03){var _0x39d47b={};var _0x1fd40a={};var _0x2f0623;var _0x1e1dad;return db[_0x67c0('0x40')][_0x67c0('0x6a')]({'where':{'id':_0x1cbbde[_0x67c0('0x5a')]['id']}})[_0x67c0('0x35')](handleEntityNotFound(_0x10d18b,null))[_0x67c0('0x35')](function(_0x27b26b){if(_0x27b26b){_0x2f0623=_0x27b26b;_0x1fd40a['model']=_[_0x67c0('0x43')](db['User'][_0x67c0('0x41')]);_0x1fd40a['query']=_['keys'](_0x1cbbde[_0x67c0('0x44')]);_0x1fd40a[_0x67c0('0x45')]=_['intersection'](_0x1fd40a[_0x67c0('0x42')],_0x1fd40a[_0x67c0('0x44')]);_0x39d47b[_0x67c0('0x47')]=_['intersection'](_0x1fd40a['model'],qs['fields'](_0x1cbbde['query'][_0x67c0('0x48')]));_0x39d47b['attributes']=_0x39d47b[_0x67c0('0x47')]['length']?_0x39d47b[_0x67c0('0x47')]:_0x1fd40a[_0x67c0('0x42')];_0x39d47b[_0x67c0('0xbc')]=qs[_0x67c0('0x4d')](_0x1cbbde[_0x67c0('0x44')][_0x67c0('0x4d')]);_0x39d47b[_0x67c0('0x4e')]=qs[_0x67c0('0x45')](_[_0x67c0('0x4f')](_0x1cbbde[_0x67c0('0x44')],_0x1fd40a[_0x67c0('0x45')]));if(_0x1cbbde[_0x67c0('0x44')][_0x67c0('0x55')]){_0x39d47b[_0x67c0('0x4e')]=_[_0x67c0('0x50')](_0x39d47b[_0x67c0('0x4e')],{'$or':_[_0x67c0('0x51')](_0x39d47b[_0x67c0('0x47')],function(_0x9bd9c6){var _0x47d481={};_0x47d481[_0x9bd9c6]={'$like':'%'+_0x1cbbde[_0x67c0('0x44')][_0x67c0('0x55')]+'%'};return _0x47d481;})});}_0x39d47b=_[_0x67c0('0x50')]({},_0x39d47b,_0x1cbbde[_0x67c0('0x5b')]);return _0x2f0623[_0x67c0('0xe4')](_0x39d47b);}})[_0x67c0('0x35')](function(_0x1aa419){if(_0x1aa419){_0x1e1dad=_0x1aa419[_0x67c0('0x49')];if(!_0x1cbbde['query']['hasOwnProperty']('nolimit')){_0x39d47b['limit']=qs[_0x67c0('0x30')](_0x1cbbde['query'][_0x67c0('0x30')]);_0x39d47b[_0x67c0('0x4c')]=qs[_0x67c0('0x4c')](_0x1cbbde[_0x67c0('0x44')]['offset']);}return _0x2f0623['getAgents'](_0x39d47b);}})[_0x67c0('0x35')](function(_0x474839){if(_0x474839){return _0x474839?{'count':_0x1e1dad,'rows':_0x474839}:null;}})[_0x67c0('0x35')](respondWithResult(_0x10d18b,null))[_0x67c0('0x2b')](handleError(_0x10d18b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 006fac0..ac4eecb 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 _0x0845=['setMaxListeners','save','update','remove','emit','events'];(function(_0x49c576,_0x724bf){var _0x2627f2=function(_0x1ff24d){while(--_0x1ff24d){_0x49c576['push'](_0x49c576['shift']());}};_0x2627f2(++_0x724bf);}(_0x0845,0x125));var _0x5084=function(_0x644d7b,_0xad365c){_0x644d7b=_0x644d7b-0x0;var _0x2d5f44=_0x0845[_0x644d7b];return _0x2d5f44;};'use strict';var EventEmitter=require(_0x5084('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5084('0x1')](0x0);var events={'afterCreate':_0x5084('0x2'),'afterUpdate':_0x5084('0x3'),'afterDestroy':_0x5084('0x4')};function emitEvent(_0x41255e){return function(_0x26a738,_0x4ec3e3,_0xd1319d){SmsAccountEvents[_0x5084('0x5')](_0x41255e+':'+_0x26a738['id'],_0x26a738);SmsAccountEvents[_0x5084('0x5')](_0x41255e,_0x26a738);_0xd1319d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xcca7=['../../mysqldb','SmsAccount','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x211530,_0x3ea767){var _0x3b5427=function(_0x23a878){while(--_0x23a878){_0x211530['push'](_0x211530['shift']());}};_0x3b5427(++_0x3ea767);}(_0xcca7,0x1aa));var _0x7cca=function(_0x6b87cd,_0x1f7ab2){_0x6b87cd=_0x6b87cd-0x0;var _0x337068=_0xcca7[_0x6b87cd];return _0x337068;};'use strict';var EventEmitter=require(_0x7cca('0x0'));var SmsAccount=require(_0x7cca('0x1'))['db'][_0x7cca('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7cca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7cca('0x4')};function emitEvent(_0x533b00){return function(_0x3b86a4,_0x9523f7,_0x2126f7){SmsAccountEvents[_0x7cca('0x5')](_0x533b00+':'+_0x3b86a4['id'],_0x3b86a4);SmsAccountEvents[_0x7cca('0x5')](_0x533b00,_0x3b86a4);_0x2126f7(null);};}for(var e in events){if(events[_0x7cca('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index cdac6ae..8b208e5 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 _0xfd63=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x4c88ed,_0x36e3ba){var _0x5025cf=function(_0x2a7ba5){while(--_0x2a7ba5){_0x4c88ed['push'](_0x4c88ed['shift']());}};_0x5025cf(++_0x36e3ba);}(_0xfd63,0x1ad));var _0x3fd6=function(_0x2f5b5b,_0x751295){_0x2f5b5b=_0x2f5b5b-0x0;var _0x5eb968=_0xfd63[_0x2f5b5b];return _0x5eb968;};'use strict';var _=require(_0x3fd6('0x0'));var util=require(_0x3fd6('0x1'));var logger=require('../../config/logger')(_0x3fd6('0x2'));var moment=require(_0x3fd6('0x3'));var BPromise=require(_0x3fd6('0x4'));var rp=require(_0x3fd6('0x5'));var fs=require('fs');var path=require(_0x3fd6('0x6'));var rimraf=require(_0x3fd6('0x7'));var config=require(_0x3fd6('0x8'));var attributes=require(_0x3fd6('0x9'));module[_0x3fd6('0xa')]=function(_0x1999f9,_0x531a5b){return _0x1999f9[_0x3fd6('0xb')]('SmsAccount',attributes,{'tableName':_0x3fd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc345=['sms_accounts','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount'];(function(_0x48ff5f,_0x134535){var _0x3c0cd7=function(_0x5c076b){while(--_0x5c076b){_0x48ff5f['push'](_0x48ff5f['shift']());}};_0x3c0cd7(++_0x134535);}(_0xc345,0x1e5));var _0x5c34=function(_0x425c5b,_0x5a23a5){_0x425c5b=_0x425c5b-0x0;var _0x3ec47a=_0xc345[_0x425c5b];return _0x3ec47a;};'use strict';var _=require(_0x5c34('0x0'));var util=require('util');var logger=require(_0x5c34('0x1'))(_0x5c34('0x2'));var moment=require(_0x5c34('0x3'));var BPromise=require(_0x5c34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c34('0x5'));var config=require(_0x5c34('0x6'));var attributes=require(_0x5c34('0x7'));module[_0x5c34('0x8')]=function(_0x5ebaa2,_0x361aeb){return _0x5ebaa2['define'](_0x5c34('0x9'),attributes,{'tableName':_0x5c34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 02ba74d..bd2017c 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 _0x2c14=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','request','info','request\x20sent','debug','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','SmsAccount','find','options','raw','attributes','include','map','model','then','ShowSmsAccount','util','bluebird'];(function(_0x362399,_0x27b8d5){var _0x201db5=function(_0x3c82e8){while(--_0x3c82e8){_0x362399['push'](_0x362399['shift']());}};_0x201db5(++_0x27b8d5);}(_0x2c14,0xf3));var _0x42c1=function(_0x4e32d1,_0x1f1b9a){_0x4e32d1=_0x4e32d1-0x0;var _0x5e99cf=_0x2c14[_0x4e32d1];return _0x5e99cf;};'use strict';var _=require('lodash');var util=require(_0x42c1('0x0'));var moment=require('moment');var BPromise=require(_0x42c1('0x1'));var rs=require(_0x42c1('0x2'));var fs=require('fs');var Redis=require(_0x42c1('0x3'));var db=require(_0x42c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42c1('0x5'));var config=require(_0x42c1('0x6'));var jayson=require(_0x42c1('0x7'));var client=jayson[_0x42c1('0x8')][_0x42c1('0x9')]({'port':0x232a});config['redis']=_[_0x42c1('0xa')](config['redis'],{'host':_0x42c1('0xb'),'port':0x18eb});var socket=require(_0x42c1('0xc'))(new Redis(config[_0x42c1('0xd')]));require(_0x42c1('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e79c3,_0x5b8366,_0x3dd021){return new BPromise(function(_0x1aadda,_0x884c69){return client[_0x42c1('0xf')](_0x1e79c3,_0x3dd021)['then'](function(_0x34f619){logger[_0x42c1('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5b8366,_0x42c1('0x11'));logger[_0x42c1('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5b8366,'request\x20sent',JSON[_0x42c1('0x13')](_0x34f619));if(_0x34f619[_0x42c1('0x14')]){if(_0x34f619[_0x42c1('0x14')][_0x42c1('0x15')]===0x1f4){logger[_0x42c1('0x14')](_0x42c1('0x16'),_0x5b8366,_0x34f619[_0x42c1('0x14')]['message']);return _0x884c69(_0x34f619[_0x42c1('0x14')][_0x42c1('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x5b8366,_0x34f619[_0x42c1('0x14')][_0x42c1('0x17')]);return _0x1aadda(_0x34f619[_0x42c1('0x14')][_0x42c1('0x17')]);}else{logger[_0x42c1('0x10')](_0x42c1('0x16'),_0x5b8366,_0x42c1('0x11'));_0x1aadda(_0x34f619['result'][_0x42c1('0x17')]);}})[_0x42c1('0x18')](function(_0x253216){logger[_0x42c1('0x14')](_0x42c1('0x16'),_0x5b8366,_0x253216);_0x884c69(_0x253216);});});}exports['ShowSmsAccount']=function(_0x439a95){var _0x44fbf9=this;return new Promise(function(_0x138b48,_0x4b1b5f){return db[_0x42c1('0x19')][_0x42c1('0x1a')]({'raw':_0x439a95[_0x42c1('0x1b')]?_0x439a95['options'][_0x42c1('0x1c')]===undefined?!![]:![]:!![],'where':_0x439a95[_0x42c1('0x1b')]?_0x439a95['options']['where']||null:null,'attributes':_0x439a95[_0x42c1('0x1b')]?_0x439a95[_0x42c1('0x1b')][_0x42c1('0x1d')]||null:null,'include':_0x439a95['options']?_0x439a95['options'][_0x42c1('0x1e')]?_[_0x42c1('0x1f')](_0x439a95['options']['include'],function(_0x41fbb6){return{'model':db[_0x41fbb6[_0x42c1('0x20')]],'as':_0x41fbb6['as'],'attributes':_0x41fbb6[_0x42c1('0x1d')],'include':_0x41fbb6[_0x42c1('0x1e')]?_[_0x42c1('0x1f')](_0x41fbb6[_0x42c1('0x1e')],function(_0x2a0538){return{'model':db[_0x2a0538[_0x42c1('0x20')]],'as':_0x2a0538['as'],'attributes':_0x2a0538[_0x42c1('0x1d')],'include':_0x2a0538[_0x42c1('0x1e')]?_['map'](_0x2a0538[_0x42c1('0x1e')],function(_0x1e3953){return{'model':db[_0x1e3953[_0x42c1('0x20')]],'as':_0x1e3953['as'],'attributes':_0x1e3953[_0x42c1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x42c1('0x21')](function(_0x5204f2){logger[_0x42c1('0x10')](_0x42c1('0x22'),_0x439a95);logger[_0x42c1('0x12')](_0x42c1('0x22'),_0x439a95,JSON[_0x42c1('0x13')](_0x5204f2));_0x138b48(_0x5204f2);})[_0x42c1('0x18')](function(_0x3e2dbb){logger[_0x42c1('0x14')]('ShowSmsAccount',_0x3e2dbb[_0x42c1('0x17')],_0x439a95);_0x4b1b5f(_0x44fbf9[_0x42c1('0x14')](0x1f4,_0x3e2dbb[_0x42c1('0x17')]));});});}; \ No newline at end of file +var _0x9329=['redis','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x8e708f,_0x1b1747){var _0x55c329=function(_0x43c8b7){while(--_0x43c8b7){_0x8e708f['push'](_0x8e708f['shift']());}};_0x55c329(++_0x1b1747);}(_0x9329,0xea));var _0x9932=function(_0x5522ac,_0x1fc97f){_0x5522ac=_0x5522ac-0x0;var _0x21bac1=_0x9329[_0x5522ac];return _0x21bac1;};'use strict';var _=require(_0x9932('0x0'));var util=require(_0x9932('0x1'));var moment=require(_0x9932('0x2'));var BPromise=require(_0x9932('0x3'));var rs=require(_0x9932('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9932('0x5'));var logger=require(_0x9932('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9932('0x7'));var client=jayson[_0x9932('0x8')][_0x9932('0x9')]({'port':0x232a});config['redis']=_[_0x9932('0xa')](config[_0x9932('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9932('0xb')]));require(_0x9932('0xc'))[_0x9932('0xd')](socket);function respondWithRpcPromise(_0x35ecbc,_0x489a5b,_0x112f02){return new BPromise(function(_0x2d7597,_0x326e0e){return client['request'](_0x35ecbc,_0x112f02)[_0x9932('0xe')](function(_0x26063d){logger[_0x9932('0xf')](_0x9932('0x10'),_0x489a5b,_0x9932('0x11'));logger['debug'](_0x9932('0x12'),_0x489a5b,_0x9932('0x11'),JSON[_0x9932('0x13')](_0x26063d));if(_0x26063d[_0x9932('0x14')]){if(_0x26063d['error'][_0x9932('0x15')]===0x1f4){logger[_0x9932('0x14')](_0x9932('0x10'),_0x489a5b,_0x26063d['error'][_0x9932('0x16')]);return _0x326e0e(_0x26063d[_0x9932('0x14')][_0x9932('0x16')]);}logger[_0x9932('0x14')]('SmsAccount,\x20%s,\x20%s',_0x489a5b,_0x26063d[_0x9932('0x14')][_0x9932('0x16')]);return _0x2d7597(_0x26063d[_0x9932('0x14')][_0x9932('0x16')]);}else{logger[_0x9932('0xf')]('SmsAccount,\x20%s,\x20%s',_0x489a5b,_0x9932('0x11'));_0x2d7597(_0x26063d[_0x9932('0x17')][_0x9932('0x16')]);}})[_0x9932('0x18')](function(_0x562f4e){logger[_0x9932('0x14')]('SmsAccount,\x20%s,\x20%s',_0x489a5b,_0x562f4e);_0x326e0e(_0x562f4e);});});}exports['ShowSmsAccount']=function(_0x1bfffd){var _0x2ff80f=this;return new Promise(function(_0x488103,_0x4d1253){return db['SmsAccount'][_0x9932('0x19')]({'raw':_0x1bfffd['options']?_0x1bfffd[_0x9932('0x1a')][_0x9932('0x1b')]===undefined?!![]:![]:!![],'where':_0x1bfffd[_0x9932('0x1a')]?_0x1bfffd[_0x9932('0x1a')][_0x9932('0x1c')]||null:null,'attributes':_0x1bfffd[_0x9932('0x1a')]?_0x1bfffd['options'][_0x9932('0x1d')]||null:null,'include':_0x1bfffd[_0x9932('0x1a')]?_0x1bfffd['options'][_0x9932('0x1e')]?_[_0x9932('0x1f')](_0x1bfffd['options'][_0x9932('0x1e')],function(_0x4ec5d3){return{'model':db[_0x4ec5d3['model']],'as':_0x4ec5d3['as'],'attributes':_0x4ec5d3[_0x9932('0x1d')],'include':_0x4ec5d3[_0x9932('0x1e')]?_[_0x9932('0x1f')](_0x4ec5d3[_0x9932('0x1e')],function(_0x3fda75){return{'model':db[_0x3fda75[_0x9932('0x20')]],'as':_0x3fda75['as'],'attributes':_0x3fda75['attributes'],'include':_0x3fda75['include']?_[_0x9932('0x1f')](_0x3fda75[_0x9932('0x1e')],function(_0x5c81bc){return{'model':db[_0x5c81bc[_0x9932('0x20')]],'as':_0x5c81bc['as'],'attributes':_0x5c81bc[_0x9932('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9932('0xe')](function(_0x5a892d){logger['info'](_0x9932('0x21'),_0x1bfffd);logger[_0x9932('0x22')]('ShowSmsAccount',_0x1bfffd,JSON['stringify'](_0x5a892d));_0x488103(_0x5a892d);})[_0x9932('0x18')](function(_0x3f1ac5){logger[_0x9932('0x14')](_0x9932('0x21'),_0x3f1ac5['message'],_0x1bfffd);_0x4d1253(_0x2ff80f[_0x9932('0x14')](0x1f4,_0x3f1ac5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 2a440c5..8d02ddd 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 _0xec53=['update','emit','removeListener','register','length','./smsAccount.events','save','remove'];(function(_0x2fcefe,_0x2052db){var _0x112031=function(_0x2e849e){while(--_0x2e849e){_0x2fcefe['push'](_0x2fcefe['shift']());}};_0x112031(++_0x2052db);}(_0xec53,0xed));var _0x3ec5=function(_0x1ea66c,_0x52c9b6){_0x1ea66c=_0x1ea66c-0x0;var _0xe6317a=_0xec53[_0x1ea66c];return _0xe6317a;};'use strict';var SmsAccountEvents=require(_0x3ec5('0x0'));var events=[_0x3ec5('0x1'),_0x3ec5('0x2'),_0x3ec5('0x3')];function createListener(_0x49c6bc,_0x7cf2cb){return function(_0x2831db){_0x7cf2cb[_0x3ec5('0x4')](_0x49c6bc,_0x2831db);};}function removeListener(_0x21eb50,_0x493e35){return function(){SmsAccountEvents[_0x3ec5('0x5')](_0x21eb50,_0x493e35);};}exports[_0x3ec5('0x6')]=function(_0x569bdb){for(var _0x29e659=0x0,_0x3b4619=events[_0x3ec5('0x7')];_0x29e659<_0x3b4619;_0x29e659++){var _0x161827=events[_0x29e659];var _0x31aa28=createListener('smsAccount:'+_0x161827,_0x569bdb);SmsAccountEvents['on'](_0x161827,_0x31aa28);}}; \ No newline at end of file +var _0x387f=['update','emit','register','length','./smsAccount.events','save','remove'];(function(_0x3601a7,_0x4c3985){var _0x50ba77=function(_0x562368){while(--_0x562368){_0x3601a7['push'](_0x3601a7['shift']());}};_0x50ba77(++_0x4c3985);}(_0x387f,0x131));var _0xf387=function(_0x41ade1,_0x34af04){_0x41ade1=_0x41ade1-0x0;var _0x465d5f=_0x387f[_0x41ade1];return _0x465d5f;};'use strict';var SmsAccountEvents=require(_0xf387('0x0'));var events=[_0xf387('0x1'),_0xf387('0x2'),_0xf387('0x3')];function createListener(_0x3d88df,_0x2a5919){return function(_0x145114){_0x2a5919[_0xf387('0x4')](_0x3d88df,_0x145114);};}function removeListener(_0x2583b3,_0x3527ed){return function(){SmsAccountEvents['removeListener'](_0x2583b3,_0x3527ed);};}exports[_0xf387('0x5')]=function(_0x1bc188){for(var _0x55815a=0x0,_0x4646ef=events[_0xf387('0x6')];_0x55815a<_0x4646ef;_0x55815a++){var _0x2cc30a=events[_0x55815a];var _0x17918b=createListener('smsAccount:'+_0x2cc30a,_0x1bc188);SmsAccountEvents['on'](_0x2cc30a,_0x17918b);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index e291359..ad438ff 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 _0xb85f=['delete','exports','multer','util','path','Router','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','post','put','/:id','update'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0xb85f,0xc2));var _0xfb85=function(_0x5be52d,_0x31f79f){_0x5be52d=_0x5be52d-0x0;var _0x1c0454=_0xb85f[_0x5be52d];return _0x1c0454;};'use strict';var multer=require(_0xfb85('0x0'));var util=require(_0xfb85('0x1'));var path=require(_0xfb85('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb85('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb85('0x4'));var controller=require(_0xfb85('0x5'));router[_0xfb85('0x6')]('/',auth[_0xfb85('0x7')](),controller[_0xfb85('0x8')]);router[_0xfb85('0x6')]('/:id',auth[_0xfb85('0x7')](),controller[_0xfb85('0x9')]);router[_0xfb85('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfb85('0xb')](_0xfb85('0xc'),auth[_0xfb85('0x7')](),controller[_0xfb85('0xd')]);router[_0xfb85('0xe')](_0xfb85('0xc'),auth[_0xfb85('0x7')](),controller['destroy']);module[_0xfb85('0xf')]=router; \ No newline at end of file +var _0x159f=['create','put','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x579541,_0x3751e2){var _0x45bace=function(_0x1c61e8){while(--_0x1c61e8){_0x579541['push'](_0x579541['shift']());}};_0x45bace(++_0x3751e2);}(_0x159f,0xb8));var _0xf159=function(_0x5c140d,_0x4cf333){_0x5c140d=_0x5c140d-0x0;var _0x3a84a2=_0x159f[_0x5c140d];return _0x3a84a2;};'use strict';var multer=require('multer');var util=require(_0xf159('0x0'));var path=require(_0xf159('0x1'));var timeout=require('connect-timeout');var express=require(_0xf159('0x2'));var router=express[_0xf159('0x3')]();var auth=require(_0xf159('0x4'));var interaction=require(_0xf159('0x5'));var config=require(_0xf159('0x6'));var controller=require(_0xf159('0x7'));router[_0xf159('0x8')]('/',auth[_0xf159('0x9')](),controller[_0xf159('0xa')]);router[_0xf159('0x8')](_0xf159('0xb'),auth[_0xf159('0x9')](),controller[_0xf159('0xc')]);router[_0xf159('0xd')]('/',auth[_0xf159('0x9')](),controller[_0xf159('0xe')]);router[_0xf159('0xf')](_0xf159('0xb'),auth[_0xf159('0x9')](),controller[_0xf159('0x10')]);router['delete'](_0xf159('0xb'),auth[_0xf159('0x9')](),controller['destroy']);module[_0xf159('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f8d1070..804906f 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 _0x8fcd=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x4e518c,_0x23682c){var _0x13ca1c=function(_0x176f93){while(--_0x176f93){_0x4e518c['push'](_0x4e518c['shift']());}};_0x13ca1c(++_0x23682c);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x29a82f,_0x7c0932){_0x29a82f=_0x29a82f-0x0;var _0x36d82d=_0x8fcd[_0x29a82f];return _0x36d82d;};'use strict';var Sequelize=require(_0xd8fc('0x0'));module[_0xd8fc('0x1')]={'priority':{'type':Sequelize[_0xd8fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd8fc('0x3')],'allowNull':![],'defaultValue':_0xd8fc('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd8fc('0x3')],'defaultValue':_0xd8fc('0x5')}}; \ No newline at end of file +var _0x3940=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x27c2f6,_0x4abe1d){var _0x5a0256=function(_0x329e70){while(--_0x329e70){_0x27c2f6['push'](_0x27c2f6['shift']());}};_0x5a0256(++_0x4abe1d);}(_0x3940,0xa6));var _0x0394=function(_0x47368f,_0x3c510f){_0x47368f=_0x47368f-0x0;var _0x2e7bfe=_0x3940[_0x47368f];return _0x2e7bfe;};'use strict';var Sequelize=require(_0x0394('0x0'));module[_0x0394('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0394('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0394('0x3')]()},'description':{'type':Sequelize[_0x0394('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0394('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 01deefe..bfdb1d9 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 _0x4fe0=['limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','SmsApplication','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','map','key','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x5d732b,_0x1a60c2){var _0x3538c7=function(_0x2804fd){while(--_0x2804fd){_0x5d732b['push'](_0x5d732b['shift']());}};_0x3538c7(++_0x1a60c2);}(_0x4fe0,0x74));var _0x04fe=function(_0x26a9e0,_0x535544){_0x26a9e0=_0x26a9e0-0x0;var _0x4aa13d=_0x4fe0[_0x26a9e0];return _0x4aa13d;};'use strict';var pdf=require(_0x04fe('0x0'));var emlformat=require(_0x04fe('0x1'));var rimraf=require(_0x04fe('0x2'));var zipdir=require(_0x04fe('0x3'));var jsonpatch=require(_0x04fe('0x4'));var rp=require(_0x04fe('0x5'));var moment=require(_0x04fe('0x6'));var BPromise=require(_0x04fe('0x7'));var Mustache=require('mustache');var util=require(_0x04fe('0x8'));var path=require(_0x04fe('0x9'));var sox=require(_0x04fe('0xa'));var csv=require(_0x04fe('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x04fe('0xc'));var squel=require(_0x04fe('0xd'));var crypto=require(_0x04fe('0xe'));var jsforce=require(_0x04fe('0xf'));var deskjs=require(_0x04fe('0x10'));var toCsv=require(_0x04fe('0xb'));var querystring=require('querystring');var Papa=require(_0x04fe('0x11'));var Redis=require(_0x04fe('0x12'));var authService=require(_0x04fe('0x13'));var qs=require(_0x04fe('0x14'));var hardwareService=require(_0x04fe('0x15'));var logger=require(_0x04fe('0x16'))(_0x04fe('0x17'));var utils=require(_0x04fe('0x18'));var config=require(_0x04fe('0x19'));var db=require(_0x04fe('0x1a'))['db'];function respondWithStatusCode(_0x345e67,_0x39386f){_0x39386f=_0x39386f||0xcc;return function(_0xfe0f30){if(_0xfe0f30){return _0x345e67[_0x04fe('0x1b')](_0x39386f);}return _0x345e67['status'](_0x39386f)['end']();};}function respondWithResult(_0x235fd8,_0x17f67c){_0x17f67c=_0x17f67c||0xc8;return function(_0x4d4b50){if(_0x4d4b50){return _0x235fd8[_0x04fe('0x1c')](_0x17f67c)[_0x04fe('0x1d')](_0x4d4b50);}};}function respondWithFilteredResult(_0xa12d24,_0x5226d0){return function(_0x3bdc1a){if(_0x3bdc1a){var _0xea5b65=_0x3bdc1a[_0x04fe('0x1e')],_0x25fd43=_0x5226d0[_0x04fe('0x1f')],_0x1644fe=_0x5226d0[_0x04fe('0x1f')]+_0x5226d0[_0x04fe('0x20')],_0x1cf5b1;if(_0x1644fe>=_0xea5b65){_0x1644fe=_0xea5b65;_0x1cf5b1=0xc8;}else{_0x1cf5b1=0xce;}_0xa12d24[_0x04fe('0x1c')](_0x1cf5b1);return _0xa12d24[_0x04fe('0x21')](_0x04fe('0x22'),_0x25fd43+'-'+_0x1644fe+'/'+_0xea5b65)[_0x04fe('0x1d')](_0x3bdc1a);}return null;};}function patchUpdates(_0x43a7c8){return function(_0x3d1c6a){try{jsonpatch['apply'](_0x3d1c6a,_0x43a7c8,!![]);}catch(_0x26b3f5){return BPromise['reject'](_0x26b3f5);}return _0x3d1c6a[_0x04fe('0x23')]();};}function saveUpdates(_0x114680,_0x5c92d3){return function(_0x5e39c3){if(_0x5e39c3){return _0x5e39c3[_0x04fe('0x24')](_0x114680)[_0x04fe('0x25')](function(_0x2ce60a){return _0x2ce60a;});}return null;};}function removeEntity(_0x2ca909,_0x4e768a){return function(_0x5a7b88){if(_0x5a7b88){return _0x5a7b88[_0x04fe('0x26')]()[_0x04fe('0x25')](function(){_0x2ca909[_0x04fe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1247a6,_0x59fc59){return function(_0x3ed87d){if(!_0x3ed87d){_0x1247a6['sendStatus'](0x194);}return _0x3ed87d;};}function handleError(_0x397968,_0x1ca968){_0x1ca968=_0x1ca968||0x1f4;return function(_0x33dbbf){logger['error'](_0x33dbbf[_0x04fe('0x27')]);if(_0x33dbbf[_0x04fe('0x28')]){delete _0x33dbbf[_0x04fe('0x28')];}_0x397968[_0x04fe('0x1c')](_0x1ca968)[_0x04fe('0x29')](_0x33dbbf);};}exports[_0x04fe('0x2a')]=function(_0x2ae0fe,_0x1a36cb){var _0x41733b={},_0x29dd56={},_0x3b87c5={'count':0x0,'rows':[]};var _0x447608=db[_0x04fe('0x2b')]['rawAttributes'];_0x29dd56[_0x04fe('0x2c')]=_['keys'](_0x447608);_0x29dd56[_0x04fe('0x2d')]=_[_0x04fe('0x2e')](_0x2ae0fe[_0x04fe('0x2d')]);_0x29dd56['filters']=_['intersection'](_0x29dd56['model'],_0x29dd56[_0x04fe('0x2d')]);_0x41733b[_0x04fe('0x2f')]=_[_0x04fe('0x30')](_0x29dd56[_0x04fe('0x2c')],qs[_0x04fe('0x31')](_0x2ae0fe[_0x04fe('0x2d')]['fields']));_0x41733b[_0x04fe('0x2f')]=_0x41733b['attributes'][_0x04fe('0x32')]?_0x41733b['attributes']:_0x29dd56['model'];if(!_0x2ae0fe[_0x04fe('0x2d')][_0x04fe('0x33')](_0x04fe('0x34'))){_0x41733b['limit']=qs[_0x04fe('0x20')](_0x2ae0fe[_0x04fe('0x2d')][_0x04fe('0x20')]);_0x41733b['offset']=qs[_0x04fe('0x1f')](_0x2ae0fe[_0x04fe('0x2d')]['offset']);}_0x41733b[_0x04fe('0x35')]=qs[_0x04fe('0x36')](_0x2ae0fe[_0x04fe('0x2d')][_0x04fe('0x36')]);_0x41733b['where']=qs[_0x04fe('0x37')](_['pick'](_0x2ae0fe[_0x04fe('0x2d')],_0x29dd56['filters']));if(_0x2ae0fe[_0x04fe('0x2d')]['filter']){_0x41733b['where']=_[_0x04fe('0x38')](_0x41733b['where'],{'$or':_[_0x04fe('0x39')](_0x447608,function(_0xd858ec){if(_0xd858ec['type'][_0x04fe('0x3a')]!==_0x04fe('0x3b')){var _0x502070={};_0x502070[_0xd858ec['field']]={'$like':'%'+_0x2ae0fe['query'][_0x04fe('0x3c')]+'%'};return _0x502070;}})});}_0x41733b=_[_0x04fe('0x38')]({},_0x41733b,_0x2ae0fe[_0x04fe('0x3d')]);var _0x500e9a={'where':_0x41733b[_0x04fe('0x3e')]};return db[_0x04fe('0x2b')][_0x04fe('0x1e')](_0x500e9a)[_0x04fe('0x25')](function(_0x1a1cc8){_0x3b87c5[_0x04fe('0x1e')]=_0x1a1cc8;if(_0x2ae0fe['query'][_0x04fe('0x3f')]){_0x41733b[_0x04fe('0x40')]=[{'all':!![]}];}return db[_0x04fe('0x2b')][_0x04fe('0x41')](_0x41733b);})[_0x04fe('0x25')](function(_0x476cca){_0x3b87c5[_0x04fe('0x42')]=_0x476cca;return _0x3b87c5;})[_0x04fe('0x25')](respondWithFilteredResult(_0x1a36cb,_0x41733b))[_0x04fe('0x43')](handleError(_0x1a36cb,null));};exports[_0x04fe('0x44')]=function(_0x2a32db,_0x4b3fda){var _0x277de0={'raw':!![],'where':{'id':_0x2a32db['params']['id']}},_0x1755d1={};_0x1755d1[_0x04fe('0x2c')]=_[_0x04fe('0x2e')](db['SmsApplication'][_0x04fe('0x45')]);_0x1755d1['query']=_[_0x04fe('0x2e')](_0x2a32db[_0x04fe('0x2d')]);_0x1755d1[_0x04fe('0x37')]=_[_0x04fe('0x30')](_0x1755d1['model'],_0x1755d1['query']);_0x277de0[_0x04fe('0x2f')]=_[_0x04fe('0x30')](_0x1755d1['model'],qs[_0x04fe('0x31')](_0x2a32db['query'][_0x04fe('0x31')]));_0x277de0[_0x04fe('0x2f')]=_0x277de0[_0x04fe('0x2f')][_0x04fe('0x32')]?_0x277de0['attributes']:_0x1755d1[_0x04fe('0x2c')];if(_0x2a32db[_0x04fe('0x2d')][_0x04fe('0x3f')]){_0x277de0['include']=[{'all':!![]}];}_0x277de0=_['merge']({},_0x277de0,_0x2a32db[_0x04fe('0x3d')]);return db[_0x04fe('0x2b')][_0x04fe('0x46')](_0x277de0)[_0x04fe('0x25')](handleEntityNotFound(_0x4b3fda,null))['then'](respondWithResult(_0x4b3fda,null))['catch'](handleError(_0x4b3fda,null));};exports[_0x04fe('0x47')]=function(_0x4f2d5c,_0x579937){return db[_0x04fe('0x2b')][_0x04fe('0x47')](_0x4f2d5c['body'],{})[_0x04fe('0x25')](respondWithResult(_0x579937,0xc9))[_0x04fe('0x43')](handleError(_0x579937,null));};exports[_0x04fe('0x24')]=function(_0x2ce575,_0x4347a4){if(_0x2ce575[_0x04fe('0x48')]['id']){delete _0x2ce575[_0x04fe('0x48')]['id'];}return db[_0x04fe('0x2b')][_0x04fe('0x46')]({'where':{'id':_0x2ce575[_0x04fe('0x49')]['id']}})[_0x04fe('0x25')](handleEntityNotFound(_0x4347a4,null))['then'](saveUpdates(_0x2ce575[_0x04fe('0x48')],null))[_0x04fe('0x25')](respondWithResult(_0x4347a4,null))[_0x04fe('0x43')](handleError(_0x4347a4,null));};exports[_0x04fe('0x26')]=function(_0x3db089,_0x3eab37){return db['SmsApplication'][_0x04fe('0x46')]({'where':{'id':_0x3db089[_0x04fe('0x49')]['id']}})[_0x04fe('0x25')](handleEntityNotFound(_0x3eab37,null))[_0x04fe('0x25')](removeEntity(_0x3eab37,null))[_0x04fe('0x43')](handleError(_0x3eab37,null));}; \ No newline at end of file +var _0xabd8=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','type','VIRTUAL','filter','options','include','findAll','rows','params','merge','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','SmsApplication'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xabd8,0x1c0));var _0x8abd=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xabd8[_0x5678b5];return _0x4c09a5;};'use strict';var pdf=require(_0x8abd('0x0'));var emlformat=require(_0x8abd('0x1'));var rimraf=require(_0x8abd('0x2'));var zipdir=require(_0x8abd('0x3'));var jsonpatch=require(_0x8abd('0x4'));var rp=require('request-promise');var moment=require(_0x8abd('0x5'));var BPromise=require(_0x8abd('0x6'));var Mustache=require(_0x8abd('0x7'));var util=require('util');var path=require(_0x8abd('0x8'));var sox=require(_0x8abd('0x9'));var csv=require(_0x8abd('0xa'));var ejs=require(_0x8abd('0xb'));var fs=require('fs');var _=require(_0x8abd('0xc'));var squel=require(_0x8abd('0xd'));var crypto=require(_0x8abd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8abd('0xf'));var toCsv=require(_0x8abd('0xa'));var querystring=require(_0x8abd('0x10'));var Papa=require(_0x8abd('0x11'));var Redis=require(_0x8abd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8abd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8abd('0x14'))(_0x8abd('0x15'));var utils=require(_0x8abd('0x16'));var config=require('../../config/environment');var db=require(_0x8abd('0x17'))['db'];function respondWithStatusCode(_0x47a027,_0x54ff3e){_0x54ff3e=_0x54ff3e||0xcc;return function(_0xefa68){if(_0xefa68){return _0x47a027[_0x8abd('0x18')](_0x54ff3e);}return _0x47a027[_0x8abd('0x19')](_0x54ff3e)['end']();};}function respondWithResult(_0x36076d,_0x1a25d2){_0x1a25d2=_0x1a25d2||0xc8;return function(_0x1b789b){if(_0x1b789b){return _0x36076d['status'](_0x1a25d2)[_0x8abd('0x1a')](_0x1b789b);}};}function respondWithFilteredResult(_0x264c19,_0x1319b5){return function(_0x8c10e5){if(_0x8c10e5){var _0x5c66ba=_0x8c10e5[_0x8abd('0x1b')],_0x59bfac=_0x1319b5['offset'],_0x36e102=_0x1319b5[_0x8abd('0x1c')]+_0x1319b5['limit'],_0x58f7d6;if(_0x36e102>=_0x5c66ba){_0x36e102=_0x5c66ba;_0x58f7d6=0xc8;}else{_0x58f7d6=0xce;}_0x264c19[_0x8abd('0x19')](_0x58f7d6);return _0x264c19['set'](_0x8abd('0x1d'),_0x59bfac+'-'+_0x36e102+'/'+_0x5c66ba)[_0x8abd('0x1a')](_0x8c10e5);}return null;};}function patchUpdates(_0x2ebe1b){return function(_0x3fa730){try{jsonpatch[_0x8abd('0x1e')](_0x3fa730,_0x2ebe1b,!![]);}catch(_0x545359){return BPromise[_0x8abd('0x1f')](_0x545359);}return _0x3fa730[_0x8abd('0x20')]();};}function saveUpdates(_0x518a69,_0x5a74d5){return function(_0x3b03fe){if(_0x3b03fe){return _0x3b03fe[_0x8abd('0x21')](_0x518a69)[_0x8abd('0x22')](function(_0x2937dd){return _0x2937dd;});}return null;};}function removeEntity(_0x2a2189,_0xbce5cd){return function(_0x8db03f){if(_0x8db03f){return _0x8db03f[_0x8abd('0x23')]()[_0x8abd('0x22')](function(){_0x2a2189['status'](0xcc)[_0x8abd('0x24')]();});}};}function handleEntityNotFound(_0x31890a,_0x1f227a){return function(_0x433ae3){if(!_0x433ae3){_0x31890a[_0x8abd('0x18')](0x194);}return _0x433ae3;};}function handleError(_0x2192a7,_0x47ee2a){_0x47ee2a=_0x47ee2a||0x1f4;return function(_0x2a2397){logger['error'](_0x2a2397[_0x8abd('0x25')]);if(_0x2a2397[_0x8abd('0x26')]){delete _0x2a2397[_0x8abd('0x26')];}_0x2192a7[_0x8abd('0x19')](_0x47ee2a)[_0x8abd('0x27')](_0x2a2397);};}exports[_0x8abd('0x28')]=function(_0x271ad3,_0x32778e){var _0x3fffce={},_0x3e166a={},_0x3a3f06={'count':0x0,'rows':[]};var _0x115d36=db[_0x8abd('0x29')][_0x8abd('0x2a')];_0x3e166a[_0x8abd('0x2b')]=_[_0x8abd('0x2c')](_0x115d36);_0x3e166a['query']=_[_0x8abd('0x2c')](_0x271ad3[_0x8abd('0x2d')]);_0x3e166a[_0x8abd('0x2e')]=_[_0x8abd('0x2f')](_0x3e166a['model'],_0x3e166a['query']);_0x3fffce[_0x8abd('0x30')]=_[_0x8abd('0x2f')](_0x3e166a[_0x8abd('0x2b')],qs[_0x8abd('0x31')](_0x271ad3[_0x8abd('0x2d')][_0x8abd('0x31')]));_0x3fffce[_0x8abd('0x30')]=_0x3fffce[_0x8abd('0x30')][_0x8abd('0x32')]?_0x3fffce['attributes']:_0x3e166a[_0x8abd('0x2b')];if(!_0x271ad3[_0x8abd('0x2d')]['hasOwnProperty'](_0x8abd('0x33'))){_0x3fffce[_0x8abd('0x34')]=qs[_0x8abd('0x34')](_0x271ad3[_0x8abd('0x2d')][_0x8abd('0x34')]);_0x3fffce['offset']=qs[_0x8abd('0x1c')](_0x271ad3[_0x8abd('0x2d')]['offset']);}_0x3fffce[_0x8abd('0x35')]=qs[_0x8abd('0x36')](_0x271ad3['query']['sort']);_0x3fffce[_0x8abd('0x37')]=qs[_0x8abd('0x2e')](_[_0x8abd('0x38')](_0x271ad3[_0x8abd('0x2d')],_0x3e166a[_0x8abd('0x2e')]));if(_0x271ad3[_0x8abd('0x2d')]['filter']){_0x3fffce['where']=_['merge'](_0x3fffce[_0x8abd('0x37')],{'$or':_['map'](_0x115d36,function(_0x286bdb){if(_0x286bdb[_0x8abd('0x39')]['key']!==_0x8abd('0x3a')){var _0x137d1d={};_0x137d1d[_0x286bdb['field']]={'$like':'%'+_0x271ad3[_0x8abd('0x2d')][_0x8abd('0x3b')]+'%'};return _0x137d1d;}})});}_0x3fffce=_['merge']({},_0x3fffce,_0x271ad3[_0x8abd('0x3c')]);var _0x1c8b0e={'where':_0x3fffce[_0x8abd('0x37')]};return db['SmsApplication'][_0x8abd('0x1b')](_0x1c8b0e)[_0x8abd('0x22')](function(_0x20ac20){_0x3a3f06[_0x8abd('0x1b')]=_0x20ac20;if(_0x271ad3[_0x8abd('0x2d')]['includeAll']){_0x3fffce[_0x8abd('0x3d')]=[{'all':!![]}];}return db[_0x8abd('0x29')][_0x8abd('0x3e')](_0x3fffce);})[_0x8abd('0x22')](function(_0x14a985){_0x3a3f06[_0x8abd('0x3f')]=_0x14a985;return _0x3a3f06;})[_0x8abd('0x22')](respondWithFilteredResult(_0x32778e,_0x3fffce))['catch'](handleError(_0x32778e,null));};exports['show']=function(_0x40d665,_0x216cbf){var _0x196f4d={'raw':!![],'where':{'id':_0x40d665[_0x8abd('0x40')]['id']}},_0xd1f73c={};_0xd1f73c[_0x8abd('0x2b')]=_['keys'](db['SmsApplication'][_0x8abd('0x2a')]);_0xd1f73c[_0x8abd('0x2d')]=_['keys'](_0x40d665[_0x8abd('0x2d')]);_0xd1f73c['filters']=_['intersection'](_0xd1f73c[_0x8abd('0x2b')],_0xd1f73c[_0x8abd('0x2d')]);_0x196f4d[_0x8abd('0x30')]=_[_0x8abd('0x2f')](_0xd1f73c[_0x8abd('0x2b')],qs['fields'](_0x40d665[_0x8abd('0x2d')]['fields']));_0x196f4d[_0x8abd('0x30')]=_0x196f4d[_0x8abd('0x30')]['length']?_0x196f4d[_0x8abd('0x30')]:_0xd1f73c[_0x8abd('0x2b')];if(_0x40d665[_0x8abd('0x2d')]['includeAll']){_0x196f4d['include']=[{'all':!![]}];}_0x196f4d=_[_0x8abd('0x41')]({},_0x196f4d,_0x40d665[_0x8abd('0x3c')]);return db['SmsApplication'][_0x8abd('0x42')](_0x196f4d)['then'](handleEntityNotFound(_0x216cbf,null))['then'](respondWithResult(_0x216cbf,null))[_0x8abd('0x43')](handleError(_0x216cbf,null));};exports[_0x8abd('0x44')]=function(_0x5eeea0,_0x26e64e){return db[_0x8abd('0x29')][_0x8abd('0x44')](_0x5eeea0[_0x8abd('0x45')],{})[_0x8abd('0x22')](respondWithResult(_0x26e64e,0xc9))['catch'](handleError(_0x26e64e,null));};exports[_0x8abd('0x21')]=function(_0x4fcabc,_0x4f37ac){if(_0x4fcabc[_0x8abd('0x45')]['id']){delete _0x4fcabc[_0x8abd('0x45')]['id'];}return db[_0x8abd('0x29')][_0x8abd('0x42')]({'where':{'id':_0x4fcabc[_0x8abd('0x40')]['id']}})['then'](handleEntityNotFound(_0x4f37ac,null))[_0x8abd('0x22')](saveUpdates(_0x4fcabc[_0x8abd('0x45')],null))[_0x8abd('0x22')](respondWithResult(_0x4f37ac,null))[_0x8abd('0x43')](handleError(_0x4f37ac,null));};exports[_0x8abd('0x23')]=function(_0x37be9e,_0x26c0ee){return db[_0x8abd('0x29')]['find']({'where':{'id':_0x37be9e['params']['id']}})[_0x8abd('0x22')](handleEntityNotFound(_0x26c0ee,null))[_0x8abd('0x22')](removeEntity(_0x26c0ee,null))[_0x8abd('0x43')](handleError(_0x26c0ee,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e06eb56..d0b4e2a 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 _0x57ca=['define','SmsApplication','sms_applications','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports'];(function(_0x12418c,_0x5c4995){var _0x237b99=function(_0x5524a8){while(--_0x5524a8){_0x12418c['push'](_0x12418c['shift']());}};_0x237b99(++_0x5c4995);}(_0x57ca,0x108));var _0xa57c=function(_0x38a61f,_0x462afe){_0x38a61f=_0x38a61f-0x0;var _0x5b0e6a=_0x57ca[_0x38a61f];return _0x5b0e6a;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa57c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x66fa=['rimraf','../../config/environment','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x21db85,_0x13d65e){var _0xa4db3e=function(_0x56131b){while(--_0x56131b){_0x21db85['push'](_0x21db85['shift']());}};_0xa4db3e(++_0x13d65e);}(_0x66fa,0x117));var _0xa66f=function(_0x380e30,_0x2418df){_0x380e30=_0x380e30-0x0;var _0x500ba6=_0x66fa[_0x380e30];return _0x500ba6;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa66f('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index a7cfa44..5320bab 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 _0x30bc=['../../config/logger','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e8556,_0x2919a6){var _0xa6d570=function(_0x14915b){while(--_0x14915b){_0x1e8556['push'](_0x1e8556['shift']());}};_0xa6d570(++_0x2919a6);}(_0x30bc,0x19b));var _0xc30b=function(_0x3d8776,_0x5305dc){_0x3d8776=_0x3d8776-0x0;var _0x51d331=_0x30bc[_0x3d8776];return _0x51d331;};'use strict';var _=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var moment=require('moment');var BPromise=require(_0xc30b('0x2'));var rs=require(_0xc30b('0x3'));var fs=require('fs');var Redis=require(_0xc30b('0x4'));var db=require(_0xc30b('0x5'))['db'];var utils=require(_0xc30b('0x6'));var logger=require(_0xc30b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc30b('0x8'));var client=jayson[_0xc30b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e41e9,_0x296723,_0x41d370){return new BPromise(function(_0x45e258,_0x3f746d){return client[_0xc30b('0xa')](_0x2e41e9,_0x41d370)[_0xc30b('0xb')](function(_0x1f326c){logger[_0xc30b('0xc')](_0xc30b('0xd'),_0x296723,_0xc30b('0xe'));logger['debug'](_0xc30b('0xf'),_0x296723,'request\x20sent',JSON[_0xc30b('0x10')](_0x1f326c));if(_0x1f326c['error']){if(_0x1f326c['error'][_0xc30b('0x11')]===0x1f4){logger['error'](_0xc30b('0xd'),_0x296723,_0x1f326c[_0xc30b('0x12')]['message']);return _0x3f746d(_0x1f326c['error'][_0xc30b('0x13')]);}logger[_0xc30b('0x12')](_0xc30b('0xd'),_0x296723,_0x1f326c[_0xc30b('0x12')][_0xc30b('0x13')]);return _0x45e258(_0x1f326c[_0xc30b('0x12')]['message']);}else{logger[_0xc30b('0xc')](_0xc30b('0xd'),_0x296723,_0xc30b('0xe'));_0x45e258(_0x1f326c[_0xc30b('0x14')][_0xc30b('0x13')]);}})[_0xc30b('0x15')](function(_0x38e2a4){logger[_0xc30b('0x12')](_0xc30b('0xd'),_0x296723,_0x38e2a4);_0x3f746d(_0x38e2a4);});});} \ No newline at end of file +var _0xaf0a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xaf0a,0x187));var _0xaaf0=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xaf0a[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0xaaf0('0x0'));var util=require(_0xaaf0('0x1'));var moment=require(_0xaaf0('0x2'));var BPromise=require(_0xaaf0('0x3'));var rs=require(_0xaaf0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaf0('0x5'))['db'];var utils=require(_0xaaf0('0x6'));var logger=require(_0xaaf0('0x7'))(_0xaaf0('0x8'));var config=require(_0xaaf0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaaf0('0xa')][_0xaaf0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f9260,_0x380149,_0x90dc68){return new BPromise(function(_0x26c116,_0x53e035){return client[_0xaaf0('0xc')](_0x2f9260,_0x90dc68)['then'](function(_0x16e9b3){logger['info'](_0xaaf0('0xd'),_0x380149,'request\x20sent');logger[_0xaaf0('0xe')](_0xaaf0('0xf'),_0x380149,_0xaaf0('0x10'),JSON[_0xaaf0('0x11')](_0x16e9b3));if(_0x16e9b3[_0xaaf0('0x12')]){if(_0x16e9b3['error']['code']===0x1f4){logger[_0xaaf0('0x12')](_0xaaf0('0xd'),_0x380149,_0x16e9b3[_0xaaf0('0x12')][_0xaaf0('0x13')]);return _0x53e035(_0x16e9b3[_0xaaf0('0x12')]['message']);}logger[_0xaaf0('0x12')](_0xaaf0('0xd'),_0x380149,_0x16e9b3['error'][_0xaaf0('0x13')]);return _0x26c116(_0x16e9b3['error']['message']);}else{logger[_0xaaf0('0x14')](_0xaaf0('0xd'),_0x380149,'request\x20sent');_0x26c116(_0x16e9b3[_0xaaf0('0x15')][_0xaaf0('0x13')]);}})[_0xaaf0('0x16')](function(_0x2dcbc3){logger[_0xaaf0('0x12')](_0xaaf0('0xd'),_0x380149,_0x2dcbc3);_0x53e035(_0x2dcbc3);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ad6beec..0888e34 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 _0xdfec=['./smsInteraction.controller','isAuthenticated','/describe','describe','show','get','/:id/messages','create','addMessage','post','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdfec,0x161));var _0xcdfe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdfec[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xcdfe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcdfe('0x1'));var express=require(_0xcdfe('0x2'));var router=express[_0xcdfe('0x3')]();var auth=require(_0xcdfe('0x4'));var interaction=require(_0xcdfe('0x5'));var config=require(_0xcdfe('0x6'));var controller=require(_0xcdfe('0x7'));router['get']('/',auth[_0xcdfe('0x8')](),controller['index']);router['get'](_0xcdfe('0x9'),auth['isAuthenticated'](),controller[_0xcdfe('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcdfe('0xb')]);router[_0xcdfe('0xc')](_0xcdfe('0xd'),auth[_0xcdfe('0x8')](),controller['getMessages']);router[_0xcdfe('0xc')]('/:id/download',auth[_0xcdfe('0x8')](),controller['download']);router['post']('/',auth[_0xcdfe('0x8')](),controller[_0xcdfe('0xe')]);router['post'](_0xcdfe('0xd'),auth[_0xcdfe('0x8')](),controller[_0xcdfe('0xf')]);router[_0xcdfe('0x10')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xcdfe('0x11')](_0xcdfe('0x12'),_0xcdfe('0x13')),controller[_0xcdfe('0x14')]);router[_0xcdfe('0x15')](_0xcdfe('0x16'),auth[_0xcdfe('0x8')](),interaction[_0xcdfe('0x11')](_0xcdfe('0x12'),_0xcdfe('0x17')),controller['update']);router['delete'](_0xcdfe('0x16'),auth[_0xcdfe('0x8')](),interaction['tracked']('sms',_0xcdfe('0x18')),controller[_0xcdfe('0x19')]);router[_0xcdfe('0x1a')](_0xcdfe('0x1b'),auth[_0xcdfe('0x8')](),controller[_0xcdfe('0x1c')]);module[_0xcdfe('0x1d')]=router; \ No newline at end of file +var _0xddff=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','sms','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0xa0e661,_0x4de17c){var _0x66372c=function(_0x15615a){while(--_0x15615a){_0xa0e661['push'](_0xa0e661['shift']());}};_0x66372c(++_0x4de17c);}(_0xddff,0xba));var _0xfddf=function(_0x26bbd1,_0xb274f3){_0x26bbd1=_0x26bbd1-0x0;var _0x26b1eb=_0xddff[_0x26bbd1];return _0x26b1eb;};'use strict';var multer=require(_0xfddf('0x0'));var util=require(_0xfddf('0x1'));var path=require(_0xfddf('0x2'));var timeout=require(_0xfddf('0x3'));var express=require(_0xfddf('0x4'));var router=express[_0xfddf('0x5')]();var auth=require(_0xfddf('0x6'));var interaction=require(_0xfddf('0x7'));var config=require(_0xfddf('0x8'));var controller=require(_0xfddf('0x9'));router[_0xfddf('0xa')]('/',auth[_0xfddf('0xb')](),controller[_0xfddf('0xc')]);router[_0xfddf('0xa')]('/describe',auth[_0xfddf('0xb')](),controller[_0xfddf('0xd')]);router[_0xfddf('0xa')]('/:id',auth[_0xfddf('0xb')](),controller['show']);router[_0xfddf('0xa')](_0xfddf('0xe'),auth[_0xfddf('0xb')](),controller[_0xfddf('0xf')]);router[_0xfddf('0xa')](_0xfddf('0x10'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x11')]);router[_0xfddf('0x12')]('/',auth['isAuthenticated'](),controller[_0xfddf('0x13')]);router[_0xfddf('0x12')](_0xfddf('0xe'),auth['isAuthenticated'](),controller[_0xfddf('0x14')]);router[_0xfddf('0x12')](_0xfddf('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xfddf('0x16'),'smsinteraction:addtags'),controller['addTags']);router[_0xfddf('0x17')](_0xfddf('0x18'),auth[_0xfddf('0xb')](),interaction[_0xfddf('0x19')]('sms',_0xfddf('0x1a')),controller[_0xfddf('0x1b')]);router['delete'](_0xfddf('0x18'),auth[_0xfddf('0xb')](),interaction[_0xfddf('0x19')](_0xfddf('0x16'),_0xfddf('0x1c')),controller[_0xfddf('0x1d')]);router[_0xfddf('0x1e')]('/:id/tags',auth[_0xfddf('0xb')](),controller[_0xfddf('0x1f')]);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 f9b2d00..69022ec 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 _0x11e3=['ENUM','out','DATE','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x3f71df,_0xf4b3a7){var _0x2bcd00=function(_0x3a305b){while(--_0x3a305b){_0x3f71df['push'](_0x3f71df['shift']());}};_0x2bcd00(++_0xf4b3a7);}(_0x11e3,0x17b));var _0x311e=function(_0x1386d7,_0x29b82c){_0x1386d7=_0x1386d7-0x0;var _0x5b3972=_0x11e3[_0x1386d7];return _0x5b3972;};'use strict';var Sequelize=require(_0x311e('0x0'));var moment=require(_0x311e('0x1'));module[_0x311e('0x2')]={'closed':{'type':Sequelize[_0x311e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x311e('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x311e('0x5')]('in',_0x311e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x311e('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x311e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0d05=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x0d05,0x1ac));var _0x50d0=function(_0x56d970,_0x42c6e6){_0x56d970=_0x56d970-0x0;var _0x9180e6=_0x0d05[_0x56d970];return _0x9180e6;};'use strict';var Sequelize=require(_0x50d0('0x0'));var moment=require(_0x50d0('0x1'));module[_0x50d0('0x2')]={'closed':{'type':Sequelize[_0x50d0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x50d0('0x4')]},'disposition':{'type':Sequelize[_0x50d0('0x5')]},'note':{'type':Sequelize[_0x50d0('0x5')]},'phone':{'type':Sequelize[_0x50d0('0x5')]},'read1stAt':{'type':Sequelize[_0x50d0('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x50d0('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x50d0('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ff25e61..0d2e326 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 _0x5155=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','unreadMessages','SmsMessage','map','TagIds','split','forEach','push','catch','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','COUNT(*)','from','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','parse','advancedFilter','startOf','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','isArray','c.firstName','c.email','\x20<\x20?','filter','isNil','isEmpty','SmsAccountId','concat','createdAt','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','QueryTypes','SELECT','read','%s\x20=\x200','having','%s\x20>\x200','`Messages.count`\x20>\x200','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','`Messages.count`\x20=\x200','sequelize','keyBy','merge','a.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','all','show','params','SmsInteraction','options','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsInteractionId','includeAll','include','findAll','rows','addTags','setTags','spread','smsInteractionTags:save','removeTags','join','server','files','tmp','root','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Contact','lastName','SmsAccount','Account','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Sms','YYYY-MM-DD','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end'];(function(_0x260d17,_0x41db16){var _0x11dc8d=function(_0x1f0492){while(--_0x1f0492){_0x260d17['push'](_0x260d17['shift']());}};_0x11dc8d(++_0x41db16);}(_0x5155,0xc5));var _0x5515=function(_0x4e0403,_0x23bb0a){_0x4e0403=_0x4e0403-0x0;var _0xb4ab4f=_0x5155[_0x4e0403];return _0xb4ab4f;};'use strict';var pdf=require(_0x5515('0x0'));var emlformat=require(_0x5515('0x1'));var rimraf=require(_0x5515('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5515('0x3'));var rp=require(_0x5515('0x4'));var moment=require(_0x5515('0x5'));var BPromise=require(_0x5515('0x6'));var Mustache=require(_0x5515('0x7'));var util=require(_0x5515('0x8'));var path=require(_0x5515('0x9'));var sox=require(_0x5515('0xa'));var csv=require(_0x5515('0xb'));var ejs=require(_0x5515('0xc'));var fs=require('fs');var _=require(_0x5515('0xd'));var squel=require('squel');var crypto=require(_0x5515('0xe'));var jsforce=require(_0x5515('0xf'));var deskjs=require(_0x5515('0x10'));var toCsv=require(_0x5515('0xb'));var querystring=require('querystring');var Papa=require(_0x5515('0x11'));var Redis=require('ioredis');var authService=require(_0x5515('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5515('0x13'))(_0x5515('0x14'));var utils=require(_0x5515('0x15'));var config=require(_0x5515('0x16'));var db=require('../../mysqldb')['db'];config[_0x5515('0x17')]=_[_0x5515('0x18')](config['redis'],{'host':_0x5515('0x19'),'port':0x18eb});var socket=require(_0x5515('0x1a'))(new Redis(config['redis']));require(_0x5515('0x1b'))[_0x5515('0x1c')](socket);function respondWithStatusCode(_0x174ef7,_0x4a9fc6){_0x4a9fc6=_0x4a9fc6||0xcc;return function(_0x475c89){if(_0x475c89){return _0x174ef7[_0x5515('0x1d')](_0x4a9fc6);}return _0x174ef7[_0x5515('0x1e')](_0x4a9fc6)[_0x5515('0x1f')]();};}function respondWithResult(_0x2fc817,_0x218ffe){_0x218ffe=_0x218ffe||0xc8;return function(_0x88cb54){if(_0x88cb54){return _0x2fc817[_0x5515('0x1e')](_0x218ffe)[_0x5515('0x20')](_0x88cb54);}};}function respondWithFilteredResult(_0x2d3189,_0xad5bc2){return function(_0x9cfc77){if(_0x9cfc77){var _0x545c19=_0x9cfc77[_0x5515('0x21')],_0x360da1=_0xad5bc2[_0x5515('0x22')],_0x29392d=_0xad5bc2['offset']+_0xad5bc2[_0x5515('0x23')],_0x48b450;if(_0x29392d>=_0x545c19){_0x29392d=_0x545c19;_0x48b450=0xc8;}else{_0x48b450=0xce;}_0x2d3189[_0x5515('0x1e')](_0x48b450);return _0x2d3189[_0x5515('0x24')](_0x5515('0x25'),_0x360da1+'-'+_0x29392d+'/'+_0x545c19)[_0x5515('0x20')](_0x9cfc77);}return null;};}function patchUpdates(_0x30ef0b){return function(_0x3a55fd){try{jsonpatch[_0x5515('0x26')](_0x3a55fd,_0x30ef0b,!![]);}catch(_0x139e0f){return BPromise[_0x5515('0x27')](_0x139e0f);}return _0x3a55fd[_0x5515('0x28')]();};}function saveUpdates(_0xb6dd15,_0x2eb47c){return function(_0x5955b6){if(_0x5955b6){return _0x5955b6[_0x5515('0x29')](_0xb6dd15)['then'](function(_0x225bec){return _0x225bec;});}return null;};}function removeEntity(_0x157fa9,_0x3e45b6){return function(_0xf54b4b){if(_0xf54b4b){return _0xf54b4b[_0x5515('0x2a')]()[_0x5515('0x2b')](function(){_0x157fa9[_0x5515('0x1e')](0xcc)[_0x5515('0x1f')]();});}};}function handleEntityNotFound(_0x1885db,_0x1beaf7){return function(_0x49a30e){if(!_0x49a30e){_0x1885db[_0x5515('0x1d')](0x194);}return _0x49a30e;};}function handleError(_0x1ce532,_0x2c5e32){_0x2c5e32=_0x2c5e32||0x1f4;return function(_0x48654a){logger[_0x5515('0x2c')](_0x48654a[_0x5515('0x2d')]);if(_0x48654a[_0x5515('0x2e')]){delete _0x48654a[_0x5515('0x2e')];}_0x1ce532[_0x5515('0x1e')](_0x2c5e32)[_0x5515('0x2f')](_0x48654a);};}function getInteractionUnreadMessages(_0x598d19){return new BPromise(function(_0x1f5b6,_0x145271){try{if(_0x598d19['closed']){_0x598d19[_0x5515('0x30')]=0x0;_0x1f5b6(_0x598d19);}else{return db[_0x5515('0x31')][_0x5515('0x21')]({'where':{'SmsInteractionId':_0x598d19['id'],'direction':'in','read':![]}})['then'](function(_0xd9308){_0x598d19[_0x5515('0x30')]=_0xd9308;_0x1f5b6(_0x598d19);});}}catch(_0x486890){_0x145271(_0x486890);}});}function getInteractionUsers(_0x4a7ea4,_0x48fd68){return new BPromise(function(_0x322e28,_0x2780c5){try{if(_0x48fd68[_0x4a7ea4['id']]){_0x4a7ea4['Users']=_[_0x5515('0x32')](_0x48fd68[_0x4a7ea4['id']],function(_0x1d258b){return{'id':_0x1d258b['id']};});}}catch(_0x2a88c5){_0x2780c5(_0x2a88c5);}_0x322e28(_0x4a7ea4);});}function getInteractionTags(_0x13b816,_0xe44b54){return new BPromise(function(_0x540b96,_0x447b18){try{if(_0x13b816[_0x5515('0x33')]){_0x13b816['Tags']=[];_0x13b816[_0x5515('0x33')][_0x5515('0x34')](',')[_0x5515('0x35')](function(_0x5981c4){_0x13b816['Tags'][_0x5515('0x36')](_0xe44b54[_0x5981c4]);});}delete _0x13b816[_0x5515('0x33')];}catch(_0x8e5b69){_0x447b18(_0x8e5b69);}_0x540b96(_0x13b816);});}function updateSmsInteraction(_0x2705ec,_0x4d9430,_0x41cb06){return new BPromise(function(_0x2d9584,_0x244087){return getInteractionUnreadMessages(_0x2705ec)[_0x5515('0x2b')](function(_0x352c67){return getInteractionUsers(_0x352c67,_0x41cb06);})[_0x5515('0x2b')](function(_0x139932){return getInteractionTags(_0x139932,_0x4d9430);})['then'](function(_0x41a568){_0x2d9584(_0x41a568);})[_0x5515('0x37')](function(_0x3a96dd){_0x244087(_0x3a96dd);});});}exports['index']=function(_0x5021e0,_0x53f720){var _0x5a4312={},_0x7bbc07={},_0x3ab475={'count':0x0,'rows':[]};var _0x80d15d=db['SmsInteraction'][_0x5515('0x38')];_0x7bbc07[_0x5515('0x39')]=_[_0x5515('0x3a')](_0x80d15d);_0x7bbc07['query']=_['keys'](_0x5021e0[_0x5515('0x3b')]);_0x7bbc07[_0x5515('0x3c')]=_['intersection'](_0x7bbc07[_0x5515('0x39')],_0x7bbc07[_0x5515('0x3b')]);_0x5a4312[_0x5515('0x3d')]=_[_0x5515('0x3e')](_0x7bbc07[_0x5515('0x39')],qs[_0x5515('0x3f')](_0x5021e0[_0x5515('0x3b')]['fields']));_0x5a4312[_0x5515('0x3d')]=_0x5a4312[_0x5515('0x3d')][_0x5515('0x40')]?_0x5a4312['attributes']:_0x7bbc07[_0x5515('0x39')];if(!_0x5021e0[_0x5515('0x3b')][_0x5515('0x41')](_0x5515('0x42'))){_0x5a4312['limit']=qs[_0x5515('0x23')](_0x5021e0[_0x5515('0x3b')][_0x5515('0x23')]);_0x5a4312[_0x5515('0x22')]=qs[_0x5515('0x22')](_0x5021e0['query']['offset']);}_0x5a4312[_0x5515('0x43')]=qs[_0x5515('0x44')](_0x5021e0['query']['sort']);_0x5a4312[_0x5515('0x45')]=qs['filters'](_[_0x5515('0x46')](_0x5021e0[_0x5515('0x3b')],_0x7bbc07['filters']));var _0x509db3=[];var _0x5212d3=squel[_0x5515('0x47')]()[_0x5515('0x48')]('id')[_0x5515('0x48')](_0x5515('0x2e'))[_0x5515('0x48')](_0x5515('0x49'))['from'](_0x5515('0x4a'));var _0x3dfda5=squel[_0x5515('0x47')]()[_0x5515('0x48')](_0x5515('0x4b'))[_0x5515('0x4c')](_0x5515('0x4d'),'me')['where'](_0x5515('0x4e'))[_0x5515('0x45')]('me.direction\x20=\x20\x27in\x27')[_0x5515('0x45')](_0x5515('0x4f'));var _0x297921=squel['select']()[_0x5515('0x48')](_0x5515('0x50'))[_0x5515('0x48')](_0x5515('0x51'))[_0x5515('0x4c')](_0x5515('0x52'),'ui')['left_join'](_0x5515('0x53'),'u',_0x5515('0x54'));var _0x3aa869=squel[_0x5515('0x47')]()[_0x5515('0x4c')]('sms_interactions','i')[_0x5515('0x55')](_0x5515('0x56'),'c',_0x5515('0x57'))[_0x5515('0x55')]('users','o',_0x5515('0x58'))['left_join'](_0x5515('0x59'),'a',_0x5515('0x5a'))[_0x5515('0x55')](_0x5515('0x4d'),'me',_0x5515('0x4e'));var _0xbd47d3=squel[_0x5515('0x5b')]();if(_0x5021e0[_0x5515('0x3b')]['advancedFilter']){var _0x2eaebf=JSON[_0x5515('0x5c')](_0x5021e0[_0x5515('0x3b')][_0x5515('0x5d')]);_[_0x5515('0x3a')](_0x2eaebf)[_0x5515('0x35')](function(_0x24de4d){var _0x425c87=_0x2eaebf[_0x24de4d];if(_0x24de4d==='createdAt'){var _0x2b93af=moment(_0x425c87['value']['dateStart'])[_0x5515('0x5e')]('day')[_0x5515('0x5f')]()[_0x5515('0x60')]();var _0x367cbb=moment(_0x367cbb)[_0x5515('0x5f')]()[_0x5515('0x61')]('day')[_0x5515('0x60')]();_0xbd47d3[_0x5515('0x62')](_0x5515('0x63'),_0x2b93af,_0x367cbb);}else{if(_['isArray'](_0x425c87[_0x5515('0x64')])){_0x425c87[_0x5515('0x64')][_0x5515('0x35')](function(_0x5ef19b){switch(_0x425c87[_0x5515('0x64')][_0x5515('0x65')]){case'IS':if(_0x24de4d!==_0x5515('0x66')&&_0x24de4d!==_0x5515('0x67')){if(_['isArray'](_0x425c87[_0x5515('0x65')])&&_0x425c87[_0x5515('0x65')][_0x5515('0x40')]>0x1){_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x69'),_0x425c87['value']);}else{_0xbd47d3['and'](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6a'),_0x425c87['value'][0x0]);}}break;case'=':_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6a'),_0x425c87[_0x5515('0x65')]);break;case _0x5515('0x6b'):if(_0x24de4d===_0x5515('0x6c')){_0xbd47d3[_0x5515('0x62')]('c.firstName'+_0x5515('0x6d'),'%'+_0x425c87[_0x5515('0x65')]+'%');_0xbd47d3['or'](_0x5515('0x6e')+_0x5515('0x6d'),'%'+_0x425c87[_0x5515('0x65')]+'%');_0xbd47d3['or']('c.email'+_0x5515('0x6d'),'%'+_0x425c87[_0x5515('0x65')]+'%');}else{_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6d'),'%'+_0x425c87[_0x5515('0x65')]+'%');}break;case'>':_0xbd47d3[_0x5515('0x62')](_0x425c87['tableAlias']+'.'+_0x24de4d+_0x5515('0x6f'),_0x425c87[_0x5515('0x65')]);break;case'<':_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+'\x20<\x20?',_0x425c87[_0x5515('0x65')]);break;}});}else{switch(_0x425c87[_0x5515('0x64')][_0x5515('0x65')]){case'IS':if(_0x24de4d!==_0x5515('0x66')&&_0x24de4d!==_0x5515('0x67')){if(_[_0x5515('0x70')](_0x425c87['value'])&&_0x425c87['value'][_0x5515('0x40')]>0x1){_0xbd47d3['and'](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x69'),_0x425c87['value']);}else{_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6a'),_0x425c87[_0x5515('0x65')][0x0]);}}break;case'=':_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6a'),_0x425c87['value']);break;case'LIKE':if(_0x24de4d===_0x5515('0x6c')){_0xbd47d3[_0x5515('0x62')](_0x5515('0x71')+_0x5515('0x6d'),'%'+_0x425c87[_0x5515('0x65')]+'%');_0xbd47d3['or'](_0x5515('0x6e')+'\x20LIKE\x20?','%'+_0x425c87['value']+'%');_0xbd47d3['or'](_0x5515('0x72')+'\x20LIKE\x20?','%'+_0x425c87[_0x5515('0x65')]+'%');}else{_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+'\x20LIKE\x20?','%'+_0x425c87[_0x5515('0x65')]+'%');}break;case'>':_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x6f'),_0x425c87['value']);break;case'<':_0xbd47d3[_0x5515('0x62')](_0x425c87[_0x5515('0x68')]+'.'+_0x24de4d+_0x5515('0x73'),_0x425c87['value']);break;}}}});}else{var _0x465749=_(Object['keys'](_0x5021e0['query']))[_0x5515('0x32')](function(_0x3e6642){return _0x80d15d['hasOwnProperty'](_0x3e6642)?_0x3e6642:undefined;})[_0x5515('0x74')](function(_0x36cd41){return!_[_0x5515('0x75')](_0x36cd41);})[_0x5515('0x65')]();if(!_[_0x5515('0x76')](_0x465749)){_0x465749[_0x5515('0x35')](function(_0x11f1a5){if(_0x11f1a5===_0x5515('0x77')){_0x3aa869[_0x5515('0x45')]('i.SmsAccountId\x20IN\x20?',[][_0x5515('0x78')](_0x5021e0[_0x5515('0x3b')][_0x11f1a5]));}else if(_0x11f1a5===_0x5515('0x79')){var _0x3704e3=JSON['parse'](_0x5021e0[_0x5515('0x3b')][_0x11f1a5])[_0x5515('0x7a')];var _0x30792b=JSON[_0x5515('0x5c')](_0x5021e0['query'][_0x11f1a5])[_0x5515('0x7b')];_0x3aa869[_0x5515('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3704e3,_0x30792b);}else{if(_0x5021e0['query'][_0x11f1a5]==='null'){_0x3aa869[_0x5515('0x45')]('i.'+_0x11f1a5+_0x5515('0x7c'));}else{_0x3aa869['where']('i.'+_0x11f1a5+'\x20=\x20?',_0x5021e0[_0x5515('0x3b')][_0x11f1a5]);}}});}if(_0x5021e0[_0x5515('0x3b')][_0x5515('0x74')]){var _0x43bb03=_0x5021e0[_0x5515('0x3b')][_0x5515('0x74')][_0x5515('0x7d')]('\x5c','\x5c\x5c')[_0x5515('0x7d')]('\x27\x27',_0x5515('0x7e'));if(qs[_0x5515('0x7f')](_0x43bb03)){_0xbd47d3['or'](_0x5515('0x80'),_0x43bb03+'%')['or'](_0x5515('0x81'),_0x43bb03+'%');}else{var _0x38a361=[];_0x43bb03[_0x5515('0x34')]('\x20')[_0x5515('0x35')](function(_0x107cc6){_0x38a361['push']('+'+_0x107cc6[_0x5515('0x82')]());});var _0x13ceb8=_0x38a361['join']('\x20');_0xbd47d3['or'](_0x5515('0x83'),_0x13ceb8)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x43bb03+'%');}}}_0x3aa869['where'](_0xbd47d3);if(_0x5a4312[_0x5515('0x43')]){_0x5a4312[_0x5515('0x43')]['forEach'](function(_0x159336){_0x3aa869[_0x5515('0x43')]('i.'+_0x159336[0x0],_0x159336[0x1]===_0x5515('0x84')?![]:!![]);});}_0x3aa869[_0x5515('0x85')](_0x5515('0x86'));var _0x32f614={'type':db[_0x5515('0x87')][_0x5515('0x88')][_0x5515('0x89')],'raw':!![]};var _0x515376=_0x3aa869['clone']()[_0x5515('0x48')](_0x5515('0x4b'));if(!_0x5021e0[_0x5515('0x3b')][_0x5515('0x5d')]){if(_0x5021e0[_0x5515('0x3b')][_0x5515('0x8a')]){if(_0x5021e0[_0x5515('0x3b')][_0x5515('0x8a')]==0x1){_0x515376[_0x5515('0x45')](util[_0x5515('0x60')](_0x5515('0x8b'),_0x3dfda5[_0x5515('0x82')]()));_0x3aa869[_0x5515('0x8c')]('`Messages.count`\x20=\x200');}else{_0x515376['where'](util['format'](_0x5515('0x8d'),_0x3dfda5[_0x5515('0x82')]()));_0x3aa869[_0x5515('0x8c')](_0x5515('0x8e'));}}if(_0x5021e0[_0x5515('0x3b')][_0x5515('0x8f')]){var _0xdeff96=_[_0x5515('0x70')](_0x5021e0[_0x5515('0x3b')]['tag'])?_0x5021e0[_0x5515('0x3b')][_0x5515('0x8f')]:new Array(_0x5021e0['query'][_0x5515('0x8f')]);var _0x4a4f29=squel[_0x5515('0x5b')]();_0xdeff96[_0x5515('0x35')](function(_0x45a912){_0x4a4f29['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x45a912+',%');});_0x3aa869[_0x5515('0x8c')](_0x4a4f29);_0x515376[_0x5515('0x55')](_0x5515('0x90'),'it',_0x5515('0x91'));_0x515376[_0x5515('0x55')](_0x5515('0x4a'),'t',_0x5515('0x92'));_0x515376['where'](_0x5515('0x93'),_0xdeff96);}}else{var _0x2eaebf=JSON['parse'](_0x5021e0[_0x5515('0x3b')][_0x5515('0x5d')]);_[_0x5515('0x3a')](_0x2eaebf)[_0x5515('0x35')](function(_0x1896fc){var _0x329d12=_0x2eaebf[_0x1896fc];if(_0x1896fc===_0x5515('0x66')){var _0x75afce=_0x329d12[_0x5515('0x65')];var _0x1d68c3=squel['expr']();_0x75afce[_0x5515('0x35')](function(_0x58b612){_0x1d68c3['or'](_0x5515('0x94'),'%,'+_0x58b612+',%');});_0x3aa869[_0x5515('0x8c')](_0x1d68c3);_0x515376[_0x5515('0x55')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x515376[_0x5515('0x55')](_0x5515('0x4a'),'t',_0x5515('0x92'));_0x515376[_0x5515('0x45')](_0x5515('0x93'),_0x75afce);}else if(_0x1896fc===_0x5515('0x67')){if(_0x329d12[_0x5515('0x65')][_0x5515('0x40')]===0x1){if(_0x329d12[_0x5515('0x65')][0x0]===0x1){_0x515376[_0x5515('0x45')](util[_0x5515('0x60')](_0x5515('0x8b'),_0x3dfda5[_0x5515('0x82')]()));_0x3aa869[_0x5515('0x8c')](_0x5515('0x95'));}else{_0x515376['where'](util[_0x5515('0x60')](_0x5515('0x8d'),_0x3dfda5['toString']()));_0x3aa869[_0x5515('0x8c')]('`Messages.count`\x20>\x200');}}}});}db[_0x5515('0x96')][_0x5515('0x3b')](_0x515376[_0x5515('0x82')](),_0x32f614)[_0x5515('0x2b')](function(_0x5ed7a3){_0x3ab475['count']=_0x5ed7a3[_0x5515('0x40')];if(_0x3ab475[_0x5515('0x21')]===0x0)return[];return db[_0x5515('0x96')][_0x5515('0x3b')](_0x5212d3['toString'](),_0x32f614)['then'](function(_0x180931){_0x509db3=_[_0x5515('0x97')](_0x180931,'id');_0x32f614=_[_0x5515('0x98')](_0x32f614,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3aa869[_0x5515('0x48')](_0x5515('0x99'),'Account.key');_0x3aa869[_0x5515('0x48')]('i.*');_0x3aa869[_0x5515('0x48')]('c.firstName',_0x5515('0x9a'));_0x3aa869[_0x5515('0x48')](_0x5515('0x6e'),_0x5515('0x9b'));_0x3aa869[_0x5515('0x48')](_0x5515('0x72'),_0x5515('0x9c'));_0x3aa869['field'](_0x5515('0x9d'),_0x5515('0x9e'));_0x3aa869[_0x5515('0x48')](_0x5515('0x9f'),_0x5515('0xa0'));_0x3aa869[_0x5515('0x48')](_0x5515('0xa1'),_0x5515('0xa2'));_0x3aa869[_0x5515('0x48')](_0x5515('0xa3'),_0x5515('0x33'));_0x3aa869[_0x5515('0x55')](_0x5515('0x90'),'it',_0x5515('0x91'));_0x3aa869['left_join'](_0x5515('0x4a'),'t','t.id\x20=\x20it.TagId');_0x3aa869[_0x5515('0x23')](_0x5a4312[_0x5515('0x23')]);_0x3aa869[_0x5515('0x22')](_0x5a4312[_0x5515('0x22')]);return db[_0x5515('0x96')][_0x5515('0x3b')](_0x3aa869['toString'](),_0x32f614);})[_0x5515('0x2b')](function(_0x1c75c4){_0x297921['where'](_0x5515('0xa4'),_['map'](_0x1c75c4,'id'));return db['sequelize'][_0x5515('0x3b')](_0x297921[_0x5515('0x82')](),_0x32f614)[_0x5515('0x2b')](function(_0x1cb070){var _0x33aeff=_['groupBy'](_0x1cb070,'SmsInteractionId');var _0x1a1515=[];_0x1c75c4[_0x5515('0x35')](function(_0x334b1a){_0x1a1515[_0x5515('0x36')](updateSmsInteraction(_0x334b1a,_0x509db3,_0x33aeff));});return BPromise[_0x5515('0xa5')](_0x1a1515);});});})[_0x5515('0x2b')](function(_0x35dbac){_0x3ab475['rows']=_0x35dbac;return _0x3ab475;})[_0x5515('0x2b')](respondWithFilteredResult(_0x53f720,_0x5a4312))[_0x5515('0x37')](handleError(_0x53f720,null));};exports[_0x5515('0xa6')]=function(_0x2369a6,_0x598de7){var _0x301842={'raw':![],'where':{'id':_0x2369a6[_0x5515('0xa7')]['id']}},_0x158475={};_0x158475[_0x5515('0x39')]=_[_0x5515('0x3a')](db[_0x5515('0xa8')][_0x5515('0x38')]);_0x158475[_0x5515('0x3b')]=_[_0x5515('0x3a')](_0x2369a6[_0x5515('0x3b')]);_0x158475[_0x5515('0x3c')]=_[_0x5515('0x3e')](_0x158475['model'],_0x158475[_0x5515('0x3b')]);_0x301842[_0x5515('0x3d')]=_[_0x5515('0x3e')](_0x158475[_0x5515('0x39')],qs[_0x5515('0x3f')](_0x2369a6[_0x5515('0x3b')]['fields']));_0x301842[_0x5515('0x3d')]=_0x301842[_0x5515('0x3d')][_0x5515('0x40')]?_0x301842[_0x5515('0x3d')]:_0x158475['model'];if(_0x2369a6[_0x5515('0x3b')]['includeAll']){_0x301842['include']=[{'all':!![]}];}_0x301842=_['merge']({},_0x301842,_0x2369a6[_0x5515('0xa9')]);return db[_0x5515('0xa8')][_0x5515('0xaa')](_0x301842)['then'](handleEntityNotFound(_0x598de7,null))[_0x5515('0x2b')](respondWithResult(_0x598de7,null))[_0x5515('0x37')](handleError(_0x598de7,null));};exports[_0x5515('0xab')]=function(_0x116ae3,_0x1a76ad){return db[_0x5515('0xa8')]['create'](_0x116ae3['body'],{})['then'](respondWithResult(_0x1a76ad,0xc9))[_0x5515('0x37')](handleError(_0x1a76ad,null));};exports['update']=function(_0x51cff0,_0x926280){if(_0x51cff0['body']['id']){delete _0x51cff0[_0x5515('0xac')]['id'];}return db['SmsInteraction'][_0x5515('0xaa')]({'where':{'id':_0x51cff0['params']['id']}})[_0x5515('0x2b')](handleEntityNotFound(_0x926280,null))[_0x5515('0x2b')](saveUpdates(_0x51cff0[_0x5515('0xac')],null))[_0x5515('0x2b')](respondWithResult(_0x926280,null))['catch'](handleError(_0x926280,null));};exports['destroy']=function(_0x153ce3,_0x59fd22){return db[_0x5515('0xa8')]['find']({'where':{'id':_0x153ce3[_0x5515('0xa7')]['id']}})[_0x5515('0x2b')](handleEntityNotFound(_0x59fd22,null))['then'](removeEntity(_0x59fd22,null))['catch'](handleError(_0x59fd22,null));};exports[_0x5515('0xad')]=function(_0x3ec494,_0x23821f){return db[_0x5515('0xa8')][_0x5515('0xad')]()['then'](respondWithResult(_0x23821f,null))[_0x5515('0x37')](handleError(_0x23821f,null));};exports[_0x5515('0xae')]=function(_0x401cbe,_0x2d6aa1,_0x2db6cb){return db[_0x5515('0x31')]['find']({'where':{'id':_0x401cbe[_0x5515('0xa7')]['id']}})['then'](handleEntityNotFound(_0x2d6aa1,null))[_0x5515('0x2b')](function(_0x45fdf4){if(_0x45fdf4){return _0x45fdf4[_0x5515('0xae')](_0x401cbe[_0x5515('0xac')]['ids'],_[_0x5515('0xaf')](_0x401cbe[_0x5515('0xac')],[_0x5515('0xb0'),'id'])||{});}})[_0x5515('0x2b')](respondWithResult(_0x2d6aa1,null))[_0x5515('0x37')](handleError(_0x2d6aa1,null));};exports[_0x5515('0xb1')]=function(_0x2d66ff,_0x1795ca,_0x14d480){var _0x4873ac={'raw':![],'where':{}};var _0x4f4db8={};var _0x32755e={'count':0x0,'rows':[]};return db[_0x5515('0xa8')][_0x5515('0xb2')]({'where':{'id':_0x2d66ff[_0x5515('0xa7')]['id']}})[_0x5515('0x2b')](handleEntityNotFound(_0x1795ca,null))[_0x5515('0x2b')](function(_0x2893e3){if(_0x2893e3){_0x4f4db8['model']=_['keys'](db[_0x5515('0x31')][_0x5515('0x38')]);_0x4f4db8[_0x5515('0x3b')]=_[_0x5515('0x3a')](_0x2d66ff['query']);_0x4f4db8['filters']=_[_0x5515('0x3e')](_0x4f4db8[_0x5515('0x39')],_0x4f4db8[_0x5515('0x3b')]);_0x4873ac[_0x5515('0x3d')]=_[_0x5515('0x3e')](_0x4f4db8[_0x5515('0x39')],qs[_0x5515('0x3f')](_0x2d66ff['query'][_0x5515('0x3f')]));_0x4873ac[_0x5515('0x3d')]=_0x4873ac['attributes'][_0x5515('0x40')]?_0x4873ac[_0x5515('0x3d')]:_0x4f4db8['model'];if(!_0x2d66ff[_0x5515('0x3b')][_0x5515('0x41')](_0x5515('0x42'))){_0x4873ac[_0x5515('0x23')]=qs[_0x5515('0x23')](_0x2d66ff[_0x5515('0x3b')]['limit']);_0x4873ac[_0x5515('0x22')]=qs[_0x5515('0x22')](_0x2d66ff['query']['offset']);}_0x4873ac[_0x5515('0x43')]=qs[_0x5515('0x44')](_0x2d66ff['query'][_0x5515('0x44')]);_0x4873ac[_0x5515('0x45')]=qs['filters'](_[_0x5515('0x46')](_0x2d66ff['query'],_0x4f4db8[_0x5515('0x3c')]));_0x4873ac[_0x5515('0x45')][_0x5515('0xb3')]=_0x2893e3['id'];if(_0x2d66ff['query'][_0x5515('0x74')]){_0x4873ac['where']=_[_0x5515('0x98')](_0x4873ac[_0x5515('0x45')],{'$or':_[_0x5515('0x32')](_0x4873ac[_0x5515('0x3d')],function(_0x5f5d13){var _0x59d656={};_0x59d656[_0x5f5d13]={'$like':'%'+_0x2d66ff['query'][_0x5515('0x74')]+'%'};return _0x59d656;})});}if(_0x2d66ff[_0x5515('0x3b')][_0x5515('0x7a')]){var _0x9a301f=_0x2d66ff[_0x5515('0x3b')][_0x5515('0x7a')][_0x5515('0x34')](',');var _0x28d79b={};_0x28d79b[_0x9a301f[0x0]]={'$gte':moment(_0x9a301f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4873ac['where']=_['merge'](_0x4873ac['where'],_0x28d79b);}_0x4873ac=_[_0x5515('0x98')]({},_0x4873ac,_0x2d66ff[_0x5515('0xa9')]);return db[_0x5515('0x31')][_0x5515('0x21')]({'where':_0x4873ac[_0x5515('0x45')]})[_0x5515('0x2b')](function(_0x26d88d){_0x32755e['count']=_0x26d88d;if(_0x2d66ff['query'][_0x5515('0xb4')]){_0x4873ac[_0x5515('0xb5')]=[{'all':!![]}];}return db[_0x5515('0x31')][_0x5515('0xb6')](_0x4873ac);})['then'](function(_0x4b2b1c){_0x32755e[_0x5515('0xb7')]=_0x4b2b1c;return _0x32755e;});}})['then'](respondWithFilteredResult(_0x1795ca,_0x4873ac))[_0x5515('0x37')](handleError(_0x1795ca,null));};exports[_0x5515('0xb8')]=function(_0x5c96a1,_0x27af17,_0x2c7b83){return db[_0x5515('0xa8')]['find']({'where':{'id':_0x5c96a1[_0x5515('0xa7')]['id']}})[_0x5515('0x2b')](handleEntityNotFound(_0x27af17,null))['then'](function(_0x25e57b){if(_0x25e57b){return _0x25e57b[_0x5515('0xb9')](_0x5c96a1[_0x5515('0xac')][_0x5515('0xb0')],_['omit'](_0x5c96a1['body'],[_0x5515('0xb0'),'id'])||{})[_0x5515('0xba')](function(){return db['Tag'][_0x5515('0xb6')]({'attributes':['id',_0x5515('0x2e'),_0x5515('0x49')],'where':{'id':_0x5c96a1[_0x5515('0xac')][_0x5515('0xb0')]}});})[_0x5515('0x2b')](function(_0x40fcdf){socket['emit'](_0x5515('0xbb'),{'id':Number(_0x5c96a1[_0x5515('0xa7')]['id']),'tags':_0x40fcdf||[]});return{'id':Number(_0x5c96a1[_0x5515('0xa7')]['id']),'tags':_0x40fcdf||[]};});}})['then'](respondWithResult(_0x27af17,null))['catch'](handleError(_0x27af17,null));};exports[_0x5515('0xbc')]=function(_0x2b228f,_0x46c82b,_0x104830){return db['SmsInteraction'][_0x5515('0xaa')]({'where':{'id':_0x2b228f[_0x5515('0xa7')]['id']}})[_0x5515('0x2b')](handleEntityNotFound(_0x46c82b,null))[_0x5515('0x2b')](function(_0x23594d){if(_0x23594d){return _0x23594d[_0x5515('0xbc')](_0x2b228f[_0x5515('0x3b')]['ids']);}})[_0x5515('0x2b')](respondWithStatusCode(_0x46c82b,null))['catch'](handleError(_0x46c82b,null));};exports['download']=function(_0x9316f5,_0x3a68f9){var _0x1d14f3=moment()['unix']()[_0x5515('0x82')]();var _0x27a2c3=path[_0x5515('0xbd')](config['root'],_0x5515('0xbe'),_0x5515('0xbf'),_0x5515('0xc0'));var _0x5c026c=path['join'](config[_0x5515('0xc1')],'server',_0x5515('0xbf'),'attachments');var _0x421f22=path['join'](_0x27a2c3,_0x1d14f3);var _0x2da84b=util['format'](_0x5515('0xc2'),_0x9316f5[_0x5515('0xa7')]['id'],_0x1d14f3);var _0x3d1492=path['join'](_0x27a2c3,_0x2da84b);var _0x2104c4=![];return db[_0x5515('0xa8')][_0x5515('0xaa')]({'where':{'id':_0x9316f5[_0x5515('0xa7')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x5515('0xc3'),'attributes':['id',_0x5515('0xac'),_0x5515('0x79'),_0x5515('0xc4'),_0x5515('0xc5')],'include':[{'model':db[_0x5515('0xc6')],'as':_0x5515('0xc6'),'attributes':['id',_0x5515('0xc7')],'raw':!![]},{'model':db[_0x5515('0xc8')],'as':_0x5515('0xc9'),'attributes':['id','firstName',_0x5515('0xca')],'raw':!![]}]},{'model':db[_0x5515('0xcb')],'as':_0x5515('0xcc'),'attributes':['id',_0x5515('0x2e')]},{'model':db[_0x5515('0xc6')],'as':'Owner','attributes':['id',_0x5515('0xc7')]}]})['then'](handleEntityNotFound(_0x3a68f9,null))['then'](function(_0x2625b4){if(_0x2625b4){var _0x5922aa=_0x2625b4[_0x5515('0xcd')]({'plain':!![]});_0x2104c4=!![];var _0x4534c7={'format':'A4','border':_0x5515('0xce'),'header':{'height':_0x5515('0xcf'),'contents':{'first':_0x5515('0xd0')}},'footer':{'height':_0x5515('0xd1'),'contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format'](_0x5515('0xd2'),_0x5515('0xd3'),_0x5922aa['id']),moment()[_0x5515('0x60')](_0x5515('0xd4'))[_0x5515('0x82')]())}}};fs['mkdirSync'](_0x421f22);var _0x1d9314={'channel':'Sms','account':_0x5922aa[_0x5515('0xcc')][_0x5515('0x2e')],'agent':_0x5922aa[_0x5515('0xd5')]?_0x5922aa['Owner'][_0x5515('0xc7')]:_0x5515('0xd6'),'createdAt':moment(_0x5922aa['createdAt'])[_0x5515('0x60')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5515('0x82')](),'closedAt':_0x5922aa['closed']?moment(_0x5922aa['closedAt'])[_0x5515('0x60')](_0x5515('0xd7'))[_0x5515('0x82')]():'','disposition':_0x5922aa[_0x5515('0xd8')],'messages':_(_0x5922aa[_0x5515('0xc3')])[_0x5515('0x74')]({'secret':![]})[_0x5515('0x32')](function(_0x419978){return{'date':moment(_0x419978[_0x5515('0x79')])[_0x5515('0x60')](_0x5515('0xd7'))[_0x5515('0x82')](),'sender':_0x419978[_0x5515('0xc4')]===_0x5515('0xd9')?_0x419978[_0x5515('0xc6')]?_0x419978[_0x5515('0xc6')][_0x5515('0xc7')]:_0x5515('0xda'):_0x419978[_0x5515('0xc9')]['firstName']+(_0x419978[_0x5515('0xc9')][_0x5515('0xca')]?'\x20'+_0x419978['Contact'][_0x5515('0xca')]:''),'body':_0x419978[_0x5515('0xac')],'direction':_0x419978[_0x5515('0xc4')]===_0x5515('0xd9')?'A':'C','secret':_0x419978['secret']};})[_0x5515('0x65')]()};return ejs[_0x5515('0xdb')](path[_0x5515('0xbd')](config[_0x5515('0xc1')],_0x5515('0xbe'),_0x5515('0xdc'),_0x5515('0xdd')),{'interaction':_0x1d9314})['then'](function(_0x494d9f){return new BPromise(function(_0x4ff037,_0x1b1b81){pdf[_0x5515('0xab')](_0x494d9f,_0x4534c7)[_0x5515('0xde')](path[_0x5515('0xbd')](_0x421f22,_0x5515('0xdf')+_0x5922aa['id']+'-'+_0x1d14f3+_0x5515('0xe0')),function(_0x43833d,_0x4b66df){if(_0x43833d)return _0x1b1b81(_0x43833d);_0x4ff037(_0x4b66df);});});});}})[_0x5515('0x2b')](function(){if(_0x2104c4){return new BPromise(function(_0x25123f,_0x3d1751){zipdir(_0x421f22,{'saveTo':_0x3d1492},function(_0x3a76c1,_0x1c8a47){if(_0x3a76c1)return _0x3d1751(_0x3a76c1);return _0x25123f(_0x1c8a47);});})[_0x5515('0x2b')](function(){return new BPromise(function(_0x31e16e,_0x484d15){rimraf(_0x421f22,function(_0x4d1cfa){if(_0x4d1cfa)_0x484d15(_0x4d1cfa);return _0x31e16e();});});})[_0x5515('0x2b')](function(){return _0x3a68f9[_0x5515('0xe1')](_0x3d1492,_0x2da84b,function(_0x33ed24){if(_0x33ed24){console[_0x5515('0xe2')](_0x5515('0xe3'),_0x33ed24);}else{fs[_0x5515('0xe4')](_0x3d1492);}});});}else{return _0x3a68f9[_0x5515('0x1d')](0xc8);}})[_0x5515('0x37')](handleError(_0x3a68f9,null));}; \ No newline at end of file +var _0xe860=['../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','closed','unreadMessages','SmsMessage','count','Users','TagIds','forEach','push','index','SmsInteraction','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','select','field','color','from','COUNT(*)','sms_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','expr','advancedFilter','parse','createdAt','value','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','Messages.count','map','filter','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','split','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','i.id','QueryTypes','clone','read','%s\x20=\x200','`Messages.count`\x20=\x200','%s\x20>\x200','having','`Messages.count`\x20>\x200','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','a.key','Account.key','i.*','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','params','rawAttributes','include','options','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','Messages','direction','secret','User','fullname','CmContact','Contact','firstName','SmsAccount','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','YYYY-MM-DD','mkdirSync','Sms','closedAt','disposition','out','System','lastName','renderFile','views','downloadInteraction.html','toFile','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x773b5d,_0x4aebab){var _0x39aff0=function(_0x1fc6d0){while(--_0x1fc6d0){_0x773b5d['push'](_0x773b5d['shift']());}};_0x39aff0(++_0x4aebab);}(_0xe860,0xd3));var _0x0e86=function(_0x3110ab,_0x5b6a7a){_0x3110ab=_0x3110ab-0x0;var _0x24c310=_0xe860[_0x3110ab];return _0x24c310;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e86('0x3'));var BPromise=require(_0x0e86('0x4'));var Mustache=require(_0x0e86('0x5'));var util=require('util');var path=require(_0x0e86('0x6'));var sox=require(_0x0e86('0x7'));var csv=require(_0x0e86('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0e86('0x9'));var crypto=require(_0x0e86('0xa'));var jsforce=require(_0x0e86('0xb'));var deskjs=require(_0x0e86('0xc'));var toCsv=require(_0x0e86('0x8'));var querystring=require(_0x0e86('0xd'));var Papa=require(_0x0e86('0xe'));var Redis=require('ioredis');var authService=require(_0x0e86('0xf'));var qs=require(_0x0e86('0x10'));var hardwareService=require(_0x0e86('0x11'));var logger=require(_0x0e86('0x12'))(_0x0e86('0x13'));var utils=require(_0x0e86('0x14'));var config=require('../../config/environment');var db=require(_0x0e86('0x15'))['db'];config['redis']=_[_0x0e86('0x16')](config[_0x0e86('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e86('0x18'))(new Redis(config[_0x0e86('0x17')]));require(_0x0e86('0x19'))[_0x0e86('0x1a')](socket);function respondWithStatusCode(_0x2d3d80,_0x30b61b){_0x30b61b=_0x30b61b||0xcc;return function(_0x3df7c9){if(_0x3df7c9){return _0x2d3d80[_0x0e86('0x1b')](_0x30b61b);}return _0x2d3d80[_0x0e86('0x1c')](_0x30b61b)[_0x0e86('0x1d')]();};}function respondWithResult(_0x17257b,_0x21c879){_0x21c879=_0x21c879||0xc8;return function(_0x1a79ee){if(_0x1a79ee){return _0x17257b[_0x0e86('0x1c')](_0x21c879)[_0x0e86('0x1e')](_0x1a79ee);}};}function respondWithFilteredResult(_0x3903fb,_0x38d4ab){return function(_0x1490de){if(_0x1490de){var _0x371bee=_0x1490de['count'],_0x52929b=_0x38d4ab['offset'],_0x153ec2=_0x38d4ab[_0x0e86('0x1f')]+_0x38d4ab[_0x0e86('0x20')],_0x3dcceb;if(_0x153ec2>=_0x371bee){_0x153ec2=_0x371bee;_0x3dcceb=0xc8;}else{_0x3dcceb=0xce;}_0x3903fb['status'](_0x3dcceb);return _0x3903fb[_0x0e86('0x21')]('Content-Range',_0x52929b+'-'+_0x153ec2+'/'+_0x371bee)[_0x0e86('0x1e')](_0x1490de);}return null;};}function patchUpdates(_0x500965){return function(_0x542cd6){try{jsonpatch['apply'](_0x542cd6,_0x500965,!![]);}catch(_0x5d698e){return BPromise[_0x0e86('0x22')](_0x5d698e);}return _0x542cd6[_0x0e86('0x23')]();};}function saveUpdates(_0x3ff67e,_0x46658b){return function(_0x41773a){if(_0x41773a){return _0x41773a[_0x0e86('0x24')](_0x3ff67e)[_0x0e86('0x25')](function(_0x3af8ae){return _0x3af8ae;});}return null;};}function removeEntity(_0x1eb15b,_0x1181b6){return function(_0x276fd4){if(_0x276fd4){return _0x276fd4[_0x0e86('0x26')]()[_0x0e86('0x25')](function(){_0x1eb15b[_0x0e86('0x1c')](0xcc)[_0x0e86('0x1d')]();});}};}function handleEntityNotFound(_0x3948e0,_0x4cf1c3){return function(_0x504ece){if(!_0x504ece){_0x3948e0[_0x0e86('0x1b')](0x194);}return _0x504ece;};}function handleError(_0x56e6d5,_0x4794a7){_0x4794a7=_0x4794a7||0x1f4;return function(_0x28a37a){logger[_0x0e86('0x27')](_0x28a37a[_0x0e86('0x28')]);if(_0x28a37a[_0x0e86('0x29')]){delete _0x28a37a[_0x0e86('0x29')];}_0x56e6d5[_0x0e86('0x1c')](_0x4794a7)[_0x0e86('0x2a')](_0x28a37a);};}function getInteractionUnreadMessages(_0x12d218){return new BPromise(function(_0x277d24,_0x1d7268){try{if(_0x12d218[_0x0e86('0x2b')]){_0x12d218[_0x0e86('0x2c')]=0x0;_0x277d24(_0x12d218);}else{return db[_0x0e86('0x2d')][_0x0e86('0x2e')]({'where':{'SmsInteractionId':_0x12d218['id'],'direction':'in','read':![]}})[_0x0e86('0x25')](function(_0x8a6266){_0x12d218[_0x0e86('0x2c')]=_0x8a6266;_0x277d24(_0x12d218);});}}catch(_0x119d13){_0x1d7268(_0x119d13);}});}function getInteractionUsers(_0x3fbacd,_0x3a5f37){return new BPromise(function(_0x3a49cf,_0xd95967){try{if(_0x3a5f37[_0x3fbacd['id']]){_0x3fbacd[_0x0e86('0x2f')]=_['map'](_0x3a5f37[_0x3fbacd['id']],function(_0x39661c){return{'id':_0x39661c['id']};});}}catch(_0x4b6bfe){_0xd95967(_0x4b6bfe);}_0x3a49cf(_0x3fbacd);});}function getInteractionTags(_0x20e8d0,_0x27762b){return new BPromise(function(_0x346afc,_0x21267d){try{if(_0x20e8d0[_0x0e86('0x30')]){_0x20e8d0['Tags']=[];_0x20e8d0[_0x0e86('0x30')]['split'](',')[_0x0e86('0x31')](function(_0x4c3670){_0x20e8d0['Tags'][_0x0e86('0x32')](_0x27762b[_0x4c3670]);});}delete _0x20e8d0[_0x0e86('0x30')];}catch(_0x17e350){_0x21267d(_0x17e350);}_0x346afc(_0x20e8d0);});}function updateSmsInteraction(_0x7e600c,_0x3d4989,_0x2031b6){return new BPromise(function(_0xd02467,_0x44f48c){return getInteractionUnreadMessages(_0x7e600c)[_0x0e86('0x25')](function(_0x4fef58){return getInteractionUsers(_0x4fef58,_0x2031b6);})[_0x0e86('0x25')](function(_0x52a819){return getInteractionTags(_0x52a819,_0x3d4989);})['then'](function(_0x4174c8){_0xd02467(_0x4174c8);})['catch'](function(_0xe3c755){_0x44f48c(_0xe3c755);});});}exports[_0x0e86('0x33')]=function(_0x22a72c,_0x4b9c2f){var _0x302bd4={},_0x2998f6={},_0x399706={'count':0x0,'rows':[]};var _0x4e3bb3=db[_0x0e86('0x34')]['rawAttributes'];_0x2998f6[_0x0e86('0x35')]=_[_0x0e86('0x36')](_0x4e3bb3);_0x2998f6[_0x0e86('0x37')]=_[_0x0e86('0x36')](_0x22a72c[_0x0e86('0x37')]);_0x2998f6['filters']=_[_0x0e86('0x38')](_0x2998f6[_0x0e86('0x35')],_0x2998f6['query']);_0x302bd4[_0x0e86('0x39')]=_[_0x0e86('0x38')](_0x2998f6[_0x0e86('0x35')],qs[_0x0e86('0x3a')](_0x22a72c['query'][_0x0e86('0x3a')]));_0x302bd4[_0x0e86('0x39')]=_0x302bd4[_0x0e86('0x39')][_0x0e86('0x3b')]?_0x302bd4[_0x0e86('0x39')]:_0x2998f6[_0x0e86('0x35')];if(!_0x22a72c[_0x0e86('0x37')][_0x0e86('0x3c')]('nolimit')){_0x302bd4[_0x0e86('0x20')]=qs[_0x0e86('0x20')](_0x22a72c['query'][_0x0e86('0x20')]);_0x302bd4[_0x0e86('0x1f')]=qs[_0x0e86('0x1f')](_0x22a72c[_0x0e86('0x37')][_0x0e86('0x1f')]);}_0x302bd4[_0x0e86('0x3d')]=qs[_0x0e86('0x3e')](_0x22a72c[_0x0e86('0x37')][_0x0e86('0x3e')]);_0x302bd4[_0x0e86('0x3f')]=qs['filters'](_[_0x0e86('0x40')](_0x22a72c[_0x0e86('0x37')],_0x2998f6[_0x0e86('0x41')]));var _0x660d7e=[];var _0x2c0047=squel[_0x0e86('0x42')]()[_0x0e86('0x43')]('id')[_0x0e86('0x43')](_0x0e86('0x29'))[_0x0e86('0x43')](_0x0e86('0x44'))[_0x0e86('0x45')]('tools_tags');var _0x4eedc9=squel['select']()[_0x0e86('0x43')](_0x0e86('0x46'))['from'](_0x0e86('0x47'),'me')[_0x0e86('0x3f')]('me.SmsInteractionId\x20=\x20i.id')[_0x0e86('0x3f')](_0x0e86('0x48'))[_0x0e86('0x3f')](_0x0e86('0x49'));var _0x41ce6f=squel['select']()[_0x0e86('0x43')](_0x0e86('0x4a'))[_0x0e86('0x43')](_0x0e86('0x4b'))[_0x0e86('0x45')](_0x0e86('0x4c'),'ui')[_0x0e86('0x4d')](_0x0e86('0x4e'),'u',_0x0e86('0x4f'));var _0x2856d7=squel[_0x0e86('0x42')]()[_0x0e86('0x45')](_0x0e86('0x50'),'i')['left_join']('cm_contacts','c',_0x0e86('0x51'))[_0x0e86('0x4d')](_0x0e86('0x4e'),'o',_0x0e86('0x52'))[_0x0e86('0x4d')](_0x0e86('0x53'),'a',_0x0e86('0x54'))[_0x0e86('0x4d')](_0x0e86('0x47'),'me',_0x0e86('0x55'));var _0x15deea=squel[_0x0e86('0x56')]();if(_0x22a72c[_0x0e86('0x37')][_0x0e86('0x57')]){var _0x5cbc87=JSON[_0x0e86('0x58')](_0x22a72c[_0x0e86('0x37')][_0x0e86('0x57')]);_[_0x0e86('0x36')](_0x5cbc87)[_0x0e86('0x31')](function(_0x4d9f58){var _0x6a304a=_0x5cbc87[_0x4d9f58];if(_0x4d9f58===_0x0e86('0x59')){var _0xb64253=moment(_0x6a304a[_0x0e86('0x5a')]['dateStart'])['startOf'](_0x0e86('0x5b'))[_0x0e86('0x5c')]()[_0x0e86('0x5d')]();var _0x3ee6f3=moment(_0x3ee6f3)['utc']()['endOf'](_0x0e86('0x5b'))[_0x0e86('0x5d')]();_0x15deea[_0x0e86('0x5e')](_0x0e86('0x5f'),_0xb64253,_0x3ee6f3);}else{if(_['isArray'](_0x6a304a[_0x0e86('0x60')])){_0x6a304a[_0x0e86('0x60')][_0x0e86('0x31')](function(_0x3f79ba){switch(_0x6a304a['condition']['value']){case'IS':if(_0x4d9f58!==_0x0e86('0x61')&&_0x4d9f58!=='Messages.count'){if(_[_0x0e86('0x62')](_0x6a304a[_0x0e86('0x5a')])&&_0x6a304a['value']['length']>0x1){_0x15deea['and'](_0x6a304a['tableAlias']+'.'+_0x4d9f58+_0x0e86('0x63'),_0x6a304a[_0x0e86('0x5a')]);}else{_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x65'),_0x6a304a[_0x0e86('0x5a')][0x0]);}}break;case'=':_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x65'),_0x6a304a[_0x0e86('0x5a')]);break;case _0x0e86('0x66'):if(_0x4d9f58===_0x0e86('0x67')){_0x15deea[_0x0e86('0x5e')](_0x0e86('0x68')+_0x0e86('0x69'),'%'+_0x6a304a[_0x0e86('0x5a')]+'%');_0x15deea['or'](_0x0e86('0x6a')+'\x20LIKE\x20?','%'+_0x6a304a[_0x0e86('0x5a')]+'%');_0x15deea['or'](_0x0e86('0x6b')+_0x0e86('0x69'),'%'+_0x6a304a['value']+'%');}else{_0x15deea['and'](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x69'),'%'+_0x6a304a[_0x0e86('0x5a')]+'%');}break;case'>':_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x6c'),_0x6a304a['value']);break;case'<':_0x15deea['and'](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x6d'),_0x6a304a[_0x0e86('0x5a')]);break;}});}else{switch(_0x6a304a[_0x0e86('0x60')]['value']){case'IS':if(_0x4d9f58!==_0x0e86('0x61')&&_0x4d9f58!==_0x0e86('0x6e')){if(_[_0x0e86('0x62')](_0x6a304a['value'])&&_0x6a304a[_0x0e86('0x5a')][_0x0e86('0x3b')]>0x1){_0x15deea['and'](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x63'),_0x6a304a[_0x0e86('0x5a')]);}else{_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x65'),_0x6a304a[_0x0e86('0x5a')][0x0]);}}break;case'=':_0x15deea['and'](_0x6a304a['tableAlias']+'.'+_0x4d9f58+_0x0e86('0x65'),_0x6a304a[_0x0e86('0x5a')]);break;case'LIKE':if(_0x4d9f58==='ContactId'){_0x15deea['and'](_0x0e86('0x68')+_0x0e86('0x69'),'%'+_0x6a304a['value']+'%');_0x15deea['or'](_0x0e86('0x6a')+_0x0e86('0x69'),'%'+_0x6a304a[_0x0e86('0x5a')]+'%');_0x15deea['or']('c.email'+_0x0e86('0x69'),'%'+_0x6a304a[_0x0e86('0x5a')]+'%');}else{_0x15deea['and'](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x69'),'%'+_0x6a304a['value']+'%');}break;case'>':_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x6c'),_0x6a304a[_0x0e86('0x5a')]);break;case'<':_0x15deea[_0x0e86('0x5e')](_0x6a304a[_0x0e86('0x64')]+'.'+_0x4d9f58+_0x0e86('0x6d'),_0x6a304a[_0x0e86('0x5a')]);break;}}}});}else{var _0x2d66f0=_(Object[_0x0e86('0x36')](_0x22a72c[_0x0e86('0x37')]))[_0x0e86('0x6f')](function(_0x29b9cd){return _0x4e3bb3[_0x0e86('0x3c')](_0x29b9cd)?_0x29b9cd:undefined;})[_0x0e86('0x70')](function(_0x4feea3){return!_[_0x0e86('0x71')](_0x4feea3);})['value']();if(!_[_0x0e86('0x72')](_0x2d66f0)){_0x2d66f0[_0x0e86('0x31')](function(_0x4f441f){if(_0x4f441f===_0x0e86('0x73')){_0x2856d7[_0x0e86('0x3f')](_0x0e86('0x74'),[][_0x0e86('0x75')](_0x22a72c['query'][_0x4f441f]));}else if(_0x4f441f===_0x0e86('0x59')){var _0x3c0c4e=JSON[_0x0e86('0x58')](_0x22a72c[_0x0e86('0x37')][_0x4f441f])['$gte'];var _0x4d501a=JSON['parse'](_0x22a72c['query'][_0x4f441f])[_0x0e86('0x76')];_0x2856d7[_0x0e86('0x3f')](_0x0e86('0x5f'),_0x3c0c4e,_0x4d501a);}else{if(_0x22a72c[_0x0e86('0x37')][_0x4f441f]===_0x0e86('0x77')){_0x2856d7['where']('i.'+_0x4f441f+_0x0e86('0x78'));}else{_0x2856d7[_0x0e86('0x3f')]('i.'+_0x4f441f+_0x0e86('0x65'),_0x22a72c['query'][_0x4f441f]);}}});}if(_0x22a72c[_0x0e86('0x37')][_0x0e86('0x70')]){var _0x25a4ed=_0x22a72c[_0x0e86('0x37')][_0x0e86('0x70')][_0x0e86('0x79')]('\x5c','\x5c\x5c')[_0x0e86('0x79')]('\x27\x27',_0x0e86('0x7a'));if(qs[_0x0e86('0x7b')](_0x25a4ed)){_0x15deea['or'](_0x0e86('0x7c'),_0x25a4ed+'%')['or'](_0x0e86('0x7d'),_0x25a4ed+'%');}else{var _0x43c47f=[];_0x25a4ed[_0x0e86('0x7e')]('\x20')[_0x0e86('0x31')](function(_0x5ef337){_0x43c47f[_0x0e86('0x32')]('+'+_0x5ef337[_0x0e86('0x7f')]());});var _0x4f1adc=_0x43c47f['join']('\x20');_0x15deea['or'](_0x0e86('0x80'),_0x4f1adc)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x25a4ed+'%');}}}_0x2856d7[_0x0e86('0x3f')](_0x15deea);if(_0x302bd4[_0x0e86('0x3d')]){_0x302bd4['order'][_0x0e86('0x31')](function(_0x57f2a7){_0x2856d7[_0x0e86('0x3d')]('i.'+_0x57f2a7[0x0],_0x57f2a7[0x1]===_0x0e86('0x81')?![]:!![]);});}_0x2856d7['group'](_0x0e86('0x82'));var _0x45d202={'type':db['Sequelize'][_0x0e86('0x83')]['SELECT'],'raw':!![]};var _0x447c0c=_0x2856d7[_0x0e86('0x84')]()[_0x0e86('0x43')](_0x0e86('0x46'));if(!_0x22a72c[_0x0e86('0x37')][_0x0e86('0x57')]){if(_0x22a72c['query'][_0x0e86('0x85')]){if(_0x22a72c[_0x0e86('0x37')][_0x0e86('0x85')]==0x1){_0x447c0c[_0x0e86('0x3f')](util[_0x0e86('0x5d')](_0x0e86('0x86'),_0x4eedc9['toString']()));_0x2856d7['having'](_0x0e86('0x87'));}else{_0x447c0c[_0x0e86('0x3f')](util[_0x0e86('0x5d')](_0x0e86('0x88'),_0x4eedc9[_0x0e86('0x7f')]()));_0x2856d7[_0x0e86('0x89')](_0x0e86('0x8a'));}}if(_0x22a72c[_0x0e86('0x37')][_0x0e86('0x8b')]){var _0x32c054=_[_0x0e86('0x62')](_0x22a72c['query'][_0x0e86('0x8b')])?_0x22a72c[_0x0e86('0x37')][_0x0e86('0x8b')]:new Array(_0x22a72c[_0x0e86('0x37')][_0x0e86('0x8b')]);var _0x18ce83=squel[_0x0e86('0x56')]();_0x32c054['forEach'](function(_0x2be8ce){_0x18ce83['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2be8ce+',%');});_0x2856d7[_0x0e86('0x89')](_0x18ce83);_0x447c0c[_0x0e86('0x4d')](_0x0e86('0x8c'),'it',_0x0e86('0x8d'));_0x447c0c['left_join'](_0x0e86('0x8e'),'t',_0x0e86('0x8f'));_0x447c0c[_0x0e86('0x3f')]('t.id\x20IN\x20?',_0x32c054);}}else{var _0x5cbc87=JSON['parse'](_0x22a72c['query']['advancedFilter']);_[_0x0e86('0x36')](_0x5cbc87)['forEach'](function(_0x66bd70){var _0x53d412=_0x5cbc87[_0x66bd70];if(_0x66bd70===_0x0e86('0x61')){var _0x914efc=_0x53d412[_0x0e86('0x5a')];var _0x1382bf=squel[_0x0e86('0x56')]();_0x914efc[_0x0e86('0x31')](function(_0x2ad16d){_0x1382bf['or'](_0x0e86('0x90'),'%,'+_0x2ad16d+',%');});_0x2856d7[_0x0e86('0x89')](_0x1382bf);_0x447c0c[_0x0e86('0x4d')](_0x0e86('0x91'),'it',_0x0e86('0x92'));_0x447c0c[_0x0e86('0x4d')](_0x0e86('0x8e'),'t','t.id\x20=\x20it.TagId');_0x447c0c[_0x0e86('0x3f')](_0x0e86('0x93'),_0x914efc);}else if(_0x66bd70==='Messages.count'){if(_0x53d412['value'][_0x0e86('0x3b')]===0x1){if(_0x53d412[_0x0e86('0x5a')][0x0]===0x1){_0x447c0c[_0x0e86('0x3f')](util['format'](_0x0e86('0x86'),_0x4eedc9[_0x0e86('0x7f')]()));_0x2856d7[_0x0e86('0x89')]('`Messages.count`\x20=\x200');}else{_0x447c0c[_0x0e86('0x3f')](util[_0x0e86('0x5d')](_0x0e86('0x88'),_0x4eedc9['toString']()));_0x2856d7[_0x0e86('0x89')](_0x0e86('0x8a'));}}}});}db[_0x0e86('0x94')][_0x0e86('0x37')](_0x447c0c[_0x0e86('0x7f')](),_0x45d202)[_0x0e86('0x25')](function(_0xc66dc){_0x399706['count']=_0xc66dc[_0x0e86('0x3b')];if(_0x399706[_0x0e86('0x2e')]===0x0)return[];return db['sequelize'][_0x0e86('0x37')](_0x2c0047[_0x0e86('0x7f')](),_0x45d202)[_0x0e86('0x25')](function(_0x4b9ecc){_0x660d7e=_[_0x0e86('0x95')](_0x4b9ecc,'id');_0x45d202=_['merge'](_0x45d202,{'model':db[_0x0e86('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2856d7[_0x0e86('0x43')](_0x0e86('0x96'),_0x0e86('0x97'));_0x2856d7[_0x0e86('0x43')](_0x0e86('0x98'));_0x2856d7[_0x0e86('0x43')]('c.firstName','Contact.firstName');_0x2856d7['field']('c.lastName',_0x0e86('0x99'));_0x2856d7[_0x0e86('0x43')]('c.email','Contact.email');_0x2856d7[_0x0e86('0x43')](_0x0e86('0x9a'),_0x0e86('0x9b'));_0x2856d7[_0x0e86('0x43')](_0x0e86('0x9c'),_0x0e86('0x9d'));_0x2856d7[_0x0e86('0x43')](_0x0e86('0x9e'),_0x0e86('0x9f'));_0x2856d7[_0x0e86('0x43')](_0x0e86('0xa0'),_0x0e86('0x30'));_0x2856d7[_0x0e86('0x4d')](_0x0e86('0x8c'),'it','it.SmsInteractionId\x20=\x20i.id');_0x2856d7['left_join'](_0x0e86('0x8e'),'t',_0x0e86('0x8f'));_0x2856d7['limit'](_0x302bd4[_0x0e86('0x20')]);_0x2856d7[_0x0e86('0x1f')](_0x302bd4[_0x0e86('0x1f')]);return db['sequelize'][_0x0e86('0x37')](_0x2856d7['toString'](),_0x45d202);})[_0x0e86('0x25')](function(_0x2debc5){_0x41ce6f[_0x0e86('0x3f')](_0x0e86('0xa1'),_[_0x0e86('0x6f')](_0x2debc5,'id'));return db[_0x0e86('0x94')][_0x0e86('0x37')](_0x41ce6f['toString'](),_0x45d202)[_0x0e86('0x25')](function(_0x18a768){var _0xe344cf=_[_0x0e86('0xa2')](_0x18a768,_0x0e86('0xa3'));var _0x312ceb=[];_0x2debc5[_0x0e86('0x31')](function(_0x11262a){_0x312ceb['push'](updateSmsInteraction(_0x11262a,_0x660d7e,_0xe344cf));});return BPromise[_0x0e86('0xa4')](_0x312ceb);});});})['then'](function(_0x261ba8){_0x399706[_0x0e86('0xa5')]=_0x261ba8;return _0x399706;})[_0x0e86('0x25')](respondWithFilteredResult(_0x4b9c2f,_0x302bd4))[_0x0e86('0xa6')](handleError(_0x4b9c2f,null));};exports['show']=function(_0x3544f6,_0x128206){var _0x3cd21e={'raw':![],'where':{'id':_0x3544f6[_0x0e86('0xa7')]['id']}},_0x4e36fa={};_0x4e36fa['model']=_[_0x0e86('0x36')](db[_0x0e86('0x34')][_0x0e86('0xa8')]);_0x4e36fa['query']=_[_0x0e86('0x36')](_0x3544f6[_0x0e86('0x37')]);_0x4e36fa[_0x0e86('0x41')]=_[_0x0e86('0x38')](_0x4e36fa[_0x0e86('0x35')],_0x4e36fa['query']);_0x3cd21e[_0x0e86('0x39')]=_['intersection'](_0x4e36fa[_0x0e86('0x35')],qs[_0x0e86('0x3a')](_0x3544f6[_0x0e86('0x37')][_0x0e86('0x3a')]));_0x3cd21e[_0x0e86('0x39')]=_0x3cd21e[_0x0e86('0x39')][_0x0e86('0x3b')]?_0x3cd21e[_0x0e86('0x39')]:_0x4e36fa[_0x0e86('0x35')];if(_0x3544f6[_0x0e86('0x37')]['includeAll']){_0x3cd21e[_0x0e86('0xa9')]=[{'all':!![]}];}_0x3cd21e=_['merge']({},_0x3cd21e,_0x3544f6[_0x0e86('0xaa')]);return db[_0x0e86('0x34')]['find'](_0x3cd21e)['then'](handleEntityNotFound(_0x128206,null))['then'](respondWithResult(_0x128206,null))[_0x0e86('0xa6')](handleError(_0x128206,null));};exports[_0x0e86('0xab')]=function(_0x4daeba,_0x48d98a){return db['SmsInteraction'][_0x0e86('0xab')](_0x4daeba[_0x0e86('0xac')],{})[_0x0e86('0x25')](respondWithResult(_0x48d98a,0xc9))[_0x0e86('0xa6')](handleError(_0x48d98a,null));};exports[_0x0e86('0x24')]=function(_0x272267,_0x5c83e8){if(_0x272267['body']['id']){delete _0x272267[_0x0e86('0xac')]['id'];}return db[_0x0e86('0x34')][_0x0e86('0xad')]({'where':{'id':_0x272267[_0x0e86('0xa7')]['id']}})['then'](handleEntityNotFound(_0x5c83e8,null))[_0x0e86('0x25')](saveUpdates(_0x272267[_0x0e86('0xac')],null))[_0x0e86('0x25')](respondWithResult(_0x5c83e8,null))[_0x0e86('0xa6')](handleError(_0x5c83e8,null));};exports[_0x0e86('0x26')]=function(_0x5c2957,_0x1b323b){return db[_0x0e86('0x34')]['find']({'where':{'id':_0x5c2957[_0x0e86('0xa7')]['id']}})[_0x0e86('0x25')](handleEntityNotFound(_0x1b323b,null))[_0x0e86('0x25')](removeEntity(_0x1b323b,null))[_0x0e86('0xa6')](handleError(_0x1b323b,null));};exports[_0x0e86('0xae')]=function(_0x4df65d,_0x2f9248){return db[_0x0e86('0x34')][_0x0e86('0xae')]()[_0x0e86('0x25')](respondWithResult(_0x2f9248,null))[_0x0e86('0xa6')](handleError(_0x2f9248,null));};exports[_0x0e86('0xaf')]=function(_0x1f5bf0,_0x4ebb4a,_0xb31683){return db[_0x0e86('0x2d')]['find']({'where':{'id':_0x1f5bf0['params']['id']}})[_0x0e86('0x25')](handleEntityNotFound(_0x4ebb4a,null))[_0x0e86('0x25')](function(_0x5c1a4f){if(_0x5c1a4f){return _0x5c1a4f['addMessage'](_0x1f5bf0[_0x0e86('0xac')][_0x0e86('0xb0')],_[_0x0e86('0xb1')](_0x1f5bf0[_0x0e86('0xac')],[_0x0e86('0xb0'),'id'])||{});}})['then'](respondWithResult(_0x4ebb4a,null))['catch'](handleError(_0x4ebb4a,null));};exports[_0x0e86('0xb2')]=function(_0x1de247,_0x2491dc,_0x3d66c4){var _0x4d57d1={'raw':![],'where':{}};var _0x45db43={};var _0x158f01={'count':0x0,'rows':[]};return db[_0x0e86('0x34')][_0x0e86('0xb3')]({'where':{'id':_0x1de247[_0x0e86('0xa7')]['id']}})['then'](handleEntityNotFound(_0x2491dc,null))[_0x0e86('0x25')](function(_0x5ea381){if(_0x5ea381){_0x45db43[_0x0e86('0x35')]=_[_0x0e86('0x36')](db[_0x0e86('0x2d')][_0x0e86('0xa8')]);_0x45db43['query']=_[_0x0e86('0x36')](_0x1de247[_0x0e86('0x37')]);_0x45db43[_0x0e86('0x41')]=_['intersection'](_0x45db43[_0x0e86('0x35')],_0x45db43['query']);_0x4d57d1[_0x0e86('0x39')]=_[_0x0e86('0x38')](_0x45db43[_0x0e86('0x35')],qs[_0x0e86('0x3a')](_0x1de247[_0x0e86('0x37')][_0x0e86('0x3a')]));_0x4d57d1['attributes']=_0x4d57d1[_0x0e86('0x39')]['length']?_0x4d57d1['attributes']:_0x45db43[_0x0e86('0x35')];if(!_0x1de247[_0x0e86('0x37')][_0x0e86('0x3c')]('nolimit')){_0x4d57d1[_0x0e86('0x20')]=qs[_0x0e86('0x20')](_0x1de247[_0x0e86('0x37')][_0x0e86('0x20')]);_0x4d57d1[_0x0e86('0x1f')]=qs['offset'](_0x1de247[_0x0e86('0x37')]['offset']);}_0x4d57d1[_0x0e86('0x3d')]=qs['sort'](_0x1de247['query'][_0x0e86('0x3e')]);_0x4d57d1['where']=qs[_0x0e86('0x41')](_[_0x0e86('0x40')](_0x1de247[_0x0e86('0x37')],_0x45db43[_0x0e86('0x41')]));_0x4d57d1[_0x0e86('0x3f')][_0x0e86('0xa3')]=_0x5ea381['id'];if(_0x1de247[_0x0e86('0x37')][_0x0e86('0x70')]){_0x4d57d1['where']=_[_0x0e86('0xb4')](_0x4d57d1[_0x0e86('0x3f')],{'$or':_[_0x0e86('0x6f')](_0x4d57d1[_0x0e86('0x39')],function(_0x57c988){var _0xfb4dcd={};_0xfb4dcd[_0x57c988]={'$like':'%'+_0x1de247['query'][_0x0e86('0x70')]+'%'};return _0xfb4dcd;})});}if(_0x1de247[_0x0e86('0x37')][_0x0e86('0xb5')]){var _0x118266=_0x1de247['query']['$gte'][_0x0e86('0x7e')](',');var _0x1a6efb={};_0x1a6efb[_0x118266[0x0]]={'$gte':moment(_0x118266[0x1])[_0x0e86('0x5d')](_0x0e86('0xb6'))};_0x4d57d1['where']=_[_0x0e86('0xb4')](_0x4d57d1[_0x0e86('0x3f')],_0x1a6efb);}_0x4d57d1=_['merge']({},_0x4d57d1,_0x1de247[_0x0e86('0xaa')]);return db[_0x0e86('0x2d')][_0x0e86('0x2e')]({'where':_0x4d57d1[_0x0e86('0x3f')]})['then'](function(_0x559c10){_0x158f01[_0x0e86('0x2e')]=_0x559c10;if(_0x1de247['query'][_0x0e86('0xb7')]){_0x4d57d1[_0x0e86('0xa9')]=[{'all':!![]}];}return db['SmsMessage'][_0x0e86('0xb8')](_0x4d57d1);})[_0x0e86('0x25')](function(_0xb5722d){_0x158f01['rows']=_0xb5722d;return _0x158f01;});}})['then'](respondWithFilteredResult(_0x2491dc,_0x4d57d1))[_0x0e86('0xa6')](handleError(_0x2491dc,null));};exports['addTags']=function(_0x296374,_0x19f0c8,_0x252d10){return db[_0x0e86('0x34')][_0x0e86('0xad')]({'where':{'id':_0x296374[_0x0e86('0xa7')]['id']}})[_0x0e86('0x25')](handleEntityNotFound(_0x19f0c8,null))[_0x0e86('0x25')](function(_0x3109d2){if(_0x3109d2){return _0x3109d2[_0x0e86('0xb9')](_0x296374['body'][_0x0e86('0xb0')],_['omit'](_0x296374[_0x0e86('0xac')],[_0x0e86('0xb0'),'id'])||{})[_0x0e86('0xba')](function(){return db[_0x0e86('0xbb')][_0x0e86('0xb8')]({'attributes':['id',_0x0e86('0x29'),'color'],'where':{'id':_0x296374['body'][_0x0e86('0xb0')]}});})[_0x0e86('0x25')](function(_0x4eb5fb){socket[_0x0e86('0xbc')](_0x0e86('0xbd'),{'id':Number(_0x296374[_0x0e86('0xa7')]['id']),'tags':_0x4eb5fb||[]});return{'id':Number(_0x296374[_0x0e86('0xa7')]['id']),'tags':_0x4eb5fb||[]};});}})['then'](respondWithResult(_0x19f0c8,null))[_0x0e86('0xa6')](handleError(_0x19f0c8,null));};exports[_0x0e86('0xbe')]=function(_0x4e7994,_0x5bccd1,_0x549dcf){return db[_0x0e86('0x34')][_0x0e86('0xad')]({'where':{'id':_0x4e7994['params']['id']}})[_0x0e86('0x25')](handleEntityNotFound(_0x5bccd1,null))[_0x0e86('0x25')](function(_0x35467d){if(_0x35467d){return _0x35467d[_0x0e86('0xbe')](_0x4e7994[_0x0e86('0x37')][_0x0e86('0xb0')]);}})[_0x0e86('0x25')](respondWithStatusCode(_0x5bccd1,null))[_0x0e86('0xa6')](handleError(_0x5bccd1,null));};exports[_0x0e86('0xbf')]=function(_0x427fe7,_0x29da26){var _0x5ca130=moment()[_0x0e86('0xc0')]()[_0x0e86('0x7f')]();var _0xa08fbb=path[_0x0e86('0xc1')](config[_0x0e86('0xc2')],_0x0e86('0xc3'),_0x0e86('0xc4'),_0x0e86('0xc5'));var _0x145a3c=path[_0x0e86('0xc1')](config[_0x0e86('0xc2')],_0x0e86('0xc3'),'files',_0x0e86('0xc6'));var _0x48225b=path['join'](_0xa08fbb,_0x5ca130);var _0x159600=util[_0x0e86('0x5d')]('transcript-%d-%s.zip',_0x427fe7[_0x0e86('0xa7')]['id'],_0x5ca130);var _0x29ea7e=path['join'](_0xa08fbb,_0x159600);var _0x4e4476=![];return db[_0x0e86('0x34')][_0x0e86('0xad')]({'where':{'id':_0x427fe7[_0x0e86('0xa7')]['id']},'include':[{'model':db[_0x0e86('0x2d')],'as':_0x0e86('0xc7'),'attributes':['id','body',_0x0e86('0x59'),_0x0e86('0xc8'),_0x0e86('0xc9')],'include':[{'model':db[_0x0e86('0xca')],'as':_0x0e86('0xca'),'attributes':['id',_0x0e86('0xcb')],'raw':!![]},{'model':db[_0x0e86('0xcc')],'as':_0x0e86('0xcd'),'attributes':['id',_0x0e86('0xce'),'lastName'],'raw':!![]}]},{'model':db[_0x0e86('0xcf')],'as':_0x0e86('0xd0'),'attributes':['id',_0x0e86('0x29')]},{'model':db[_0x0e86('0xca')],'as':_0x0e86('0xd1'),'attributes':['id',_0x0e86('0xcb')]}]})[_0x0e86('0x25')](handleEntityNotFound(_0x29da26,null))['then'](function(_0x273f62){if(_0x273f62){var _0x4e7897=_0x273f62[_0x0e86('0xd2')]({'plain':!![]});_0x4e4476=!![];var _0xa9c552={'format':'A4','border':_0x0e86('0xd3'),'header':{'height':_0x0e86('0xd4'),'contents':{'first':_0x0e86('0xd5')}},'footer':{'height':_0x0e86('0xd6'),'contents':{'default':util[_0x0e86('0x5d')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x0e86('0x5d')]('%s\x20#%d','Sms',_0x4e7897['id']),moment()[_0x0e86('0x5d')](_0x0e86('0xd7'))[_0x0e86('0x7f')]())}}};fs[_0x0e86('0xd8')](_0x48225b);var _0x443cf3={'channel':_0x0e86('0xd9'),'account':_0x4e7897[_0x0e86('0xd0')][_0x0e86('0x29')],'agent':_0x4e7897[_0x0e86('0xd1')]?_0x4e7897['Owner'][_0x0e86('0xcb')]:'N.A.','createdAt':moment(_0x4e7897[_0x0e86('0x59')])[_0x0e86('0x5d')](_0x0e86('0xb6'))[_0x0e86('0x7f')](),'closedAt':_0x4e7897[_0x0e86('0x2b')]?moment(_0x4e7897[_0x0e86('0xda')])[_0x0e86('0x5d')](_0x0e86('0xb6'))['toString']():'','disposition':_0x4e7897[_0x0e86('0xdb')],'messages':_(_0x4e7897[_0x0e86('0xc7')])[_0x0e86('0x70')]({'secret':![]})[_0x0e86('0x6f')](function(_0x3ed4f9){return{'date':moment(_0x3ed4f9['createdAt'])[_0x0e86('0x5d')](_0x0e86('0xb6'))[_0x0e86('0x7f')](),'sender':_0x3ed4f9[_0x0e86('0xc8')]===_0x0e86('0xdc')?_0x3ed4f9[_0x0e86('0xca')]?_0x3ed4f9[_0x0e86('0xca')]['fullname']:_0x0e86('0xdd'):_0x3ed4f9[_0x0e86('0xcd')][_0x0e86('0xce')]+(_0x3ed4f9[_0x0e86('0xcd')]['lastName']?'\x20'+_0x3ed4f9[_0x0e86('0xcd')][_0x0e86('0xde')]:''),'body':_0x3ed4f9[_0x0e86('0xac')],'direction':_0x3ed4f9[_0x0e86('0xc8')]==='out'?'A':'C','secret':_0x3ed4f9[_0x0e86('0xc9')]};})[_0x0e86('0x5a')]()};return ejs[_0x0e86('0xdf')](path[_0x0e86('0xc1')](config[_0x0e86('0xc2')],_0x0e86('0xc3'),_0x0e86('0xe0'),_0x0e86('0xe1')),{'interaction':_0x443cf3})[_0x0e86('0x25')](function(_0x11a1fe){return new BPromise(function(_0x52f686,_0x16c4e0){pdf[_0x0e86('0xab')](_0x11a1fe,_0xa9c552)[_0x0e86('0xe2')](path['join'](_0x48225b,'transcript-'+_0x4e7897['id']+'-'+_0x5ca130+'.pdf'),function(_0x42aa3e,_0x22285d){if(_0x42aa3e)return _0x16c4e0(_0x42aa3e);_0x52f686(_0x22285d);});});});}})[_0x0e86('0x25')](function(){if(_0x4e4476){return new BPromise(function(_0xeab92,_0x528a19){zipdir(_0x48225b,{'saveTo':_0x29ea7e},function(_0x42d57a,_0x508164){if(_0x42d57a)return _0x528a19(_0x42d57a);return _0xeab92(_0x508164);});})[_0x0e86('0x25')](function(){return new BPromise(function(_0x4e22b3,_0x174f7d){rimraf(_0x48225b,function(_0x389331){if(_0x389331)_0x174f7d(_0x389331);return _0x4e22b3();});});})[_0x0e86('0x25')](function(){return _0x29da26[_0x0e86('0xbf')](_0x29ea7e,_0x159600,function(_0x447244){if(_0x447244){console['log'](_0x0e86('0xe3'),_0x447244);}else{fs[_0x0e86('0xe4')](_0x29ea7e);}});});}else{return _0x29da26[_0x0e86('0x1b')](0xc8);}})[_0x0e86('0xa6')](handleError(_0x29da26,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 86bee66..8d13476 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 _0xcf8f=['exports','events','../../mysqldb','SmsInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x492e92,_0x2296d2){var _0x5c133f=function(_0x5a8b0d){while(--_0x5a8b0d){_0x492e92['push'](_0x492e92['shift']());}};_0x5c133f(++_0x2296d2);}(_0xcf8f,0x19f));var _0xfcf8=function(_0x1007b6,_0x4b4607){_0x1007b6=_0x1007b6-0x0;var _0x37b6ed=_0xcf8f[_0x1007b6];return _0x37b6ed;};'use strict';var EventEmitter=require(_0xfcf8('0x0'));var SmsInteraction=require(_0xfcf8('0x1'))['db'][_0xfcf8('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfcf8('0x3'),'afterUpdate':_0xfcf8('0x4'),'afterDestroy':_0xfcf8('0x5')};function emitEvent(_0x28c812){return function(_0x5e5115,_0x165026,_0x196ccd){_0x5e5115[_0xfcf8('0x6')]({'attributes':['id'],'raw':!![]})[_0xfcf8('0x7')](function(_0x238158){_0x5e5115[_0xfcf8('0x8')](_0xfcf8('0x9'),_0x238158[_0xfcf8('0xa')](function(_0x157e03){return{'id':_0x157e03['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x5e5115['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5dfed9){_0x5e5115[_0xfcf8('0x8')](_0xfcf8('0xb'),_0x5dfed9[_0xfcf8('0xc')]);SmsInteractionEvents[_0xfcf8('0xd')](_0x28c812+':'+_0x5e5115['id'],_0x5e5115);SmsInteractionEvents[_0xfcf8('0xd')](_0x28c812,_0x5e5115);_0x196ccd(null);})[_0xfcf8('0xe')](_0x196ccd(null));};}for(var e in events){if(events[_0xfcf8('0xf')](e)){var event=events[e];SmsInteraction[_0xfcf8('0x10')](e,emitEvent(event));}}module[_0xfcf8('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x0c1d=['remove','setDataValue','Users','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x11e165,_0x5d47cc){var _0x4515ce=function(_0x10cca8){while(--_0x10cca8){_0x11e165['push'](_0x11e165['shift']());}};_0x4515ce(++_0x5d47cc);}(_0x0c1d,0x81));var _0xd0c1=function(_0x594700,_0x4d7c3e){_0x594700=_0x594700-0x0;var _0x2c0ef7=_0x0c1d[_0x594700];return _0x2c0ef7;};'use strict';var EventEmitter=require(_0xd0c1('0x0'));var SmsInteraction=require(_0xd0c1('0x1'))['db'][_0xd0c1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xd0c1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xd0c1('0x4')](0x0);var events={'afterCreate':_0xd0c1('0x5'),'afterUpdate':'update','afterDestroy':_0xd0c1('0x6')};function emitEvent(_0x1eb67a){return function(_0x50f40d,_0x1c167a,_0x590199){_0x50f40d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x511b25){_0x50f40d[_0xd0c1('0x7')](_0xd0c1('0x8'),_0x511b25['map'](function(_0x133c81){return{'id':_0x133c81['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x50f40d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd0c1('0x9')](function(_0x1cffff){_0x50f40d[_0xd0c1('0x7')](_0xd0c1('0xa'),_0x1cffff['length']);SmsInteractionEvents[_0xd0c1('0xb')](_0x1eb67a+':'+_0x50f40d['id'],_0x50f40d);SmsInteractionEvents[_0xd0c1('0xb')](_0x1eb67a,_0x50f40d);_0x590199(null);})[_0xd0c1('0xc')](_0x590199(null));};}for(var e in events){if(events[_0xd0c1('0xd')](e)){var event=events[e];SmsInteraction[_0xd0c1('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index beedd30..612ebde 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 _0x57fc=['SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes','exports'];(function(_0x49488e,_0x3cb4b8){var _0x205de0=function(_0x261f0e){while(--_0x261f0e){_0x49488e['push'](_0x49488e['shift']());}};_0x205de0(++_0x3cb4b8);}(_0x57fc,0x1c0));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc57f('0x0'));var moment=require(_0xc57f('0x1'));var BPromise=require(_0xc57f('0x2'));var rp=require(_0xc57f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc57f('0x4'));var config=require('../../config/environment');var attributes=require(_0xc57f('0x5'));module[_0xc57f('0x6')]=function(_0x32982d,_0x5ea2bc){return _0x32982d['define'](_0xc57f('0x7'),attributes,{'tableName':_0xc57f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34a5a6,_0x526e64,_0x3050f3){if(_0x34a5a6['changed'](_0xc57f('0x9'))){_0x34a5a6[_0xc57f('0xa')]=moment()[_0xc57f('0xb')](_0xc57f('0xc'));}_0x3050f3(null,_0x34a5a6);}}});}; \ No newline at end of file +var _0xc875=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','format'];(function(_0x105c72,_0x52c05a){var _0x367c23=function(_0x37c7ba){while(--_0x37c7ba){_0x105c72['push'](_0x105c72['shift']());}};_0x367c23(++_0x52c05a);}(_0xc875,0xc4));var _0x5c87=function(_0x4b9aed,_0x26641c){_0x4b9aed=_0x4b9aed-0x0;var _0x4eaee0=_0xc875[_0x4b9aed];return _0x4eaee0;};'use strict';var _=require(_0x5c87('0x0'));var util=require(_0x5c87('0x1'));var logger=require(_0x5c87('0x2'))(_0x5c87('0x3'));var moment=require('moment');var BPromise=require(_0x5c87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c87('0x5'));var rimraf=require(_0x5c87('0x6'));var config=require(_0x5c87('0x7'));var attributes=require(_0x5c87('0x8'));module['exports']=function(_0x2b6fcb,_0x48b4b4){return _0x2b6fcb['define'](_0x5c87('0x9'),attributes,{'tableName':_0x5c87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ea13a,_0x676b2c,_0x550883){if(_0x2ea13a[_0x5c87('0xb')]('closed')){_0x2ea13a[_0x5c87('0xc')]=moment()[_0x5c87('0xd')](_0x5c87('0xe'));}_0x550883(null,_0x2ea13a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 6fb4bd9..07e0a59 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 _0x119b=['lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','options','raw','where','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','body','ids','spread','AddTags'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x119b,0x172));var _0xb119=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x119b[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xb119('0x0'));var util=require(_0xb119('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb119('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb119('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb119('0x4'))('rpc');var config=require(_0xb119('0x5'));var jayson=require(_0xb119('0x6'));var client=jayson['client'][_0xb119('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb119('0x8'))(new Redis(config[_0xb119('0x9')]));require(_0xb119('0xa'))[_0xb119('0xb')](socket);function respondWithRpcPromise(_0x4307ff,_0x5ab15f,_0x1a1898){return new BPromise(function(_0x54a6e4,_0x549108){return client[_0xb119('0xc')](_0x4307ff,_0x1a1898)[_0xb119('0xd')](function(_0x27dec5){logger[_0xb119('0xe')](_0xb119('0xf'),_0x5ab15f,'request\x20sent');logger[_0xb119('0x10')](_0xb119('0x11'),_0x5ab15f,'request\x20sent',JSON[_0xb119('0x12')](_0x27dec5));if(_0x27dec5['error']){if(_0x27dec5[_0xb119('0x13')][_0xb119('0x14')]===0x1f4){logger[_0xb119('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5ab15f,_0x27dec5['error'][_0xb119('0x15')]);return _0x549108(_0x27dec5['error'][_0xb119('0x15')]);}logger[_0xb119('0x13')](_0xb119('0xf'),_0x5ab15f,_0x27dec5[_0xb119('0x13')][_0xb119('0x15')]);return _0x54a6e4(_0x27dec5['error']['message']);}else{logger[_0xb119('0xe')](_0xb119('0xf'),_0x5ab15f,'request\x20sent');_0x54a6e4(_0x27dec5[_0xb119('0x16')][_0xb119('0x15')]);}})[_0xb119('0x17')](function(_0x583901){logger[_0xb119('0x13')](_0xb119('0xf'),_0x5ab15f,_0x583901);_0x549108(_0x583901);});});}exports['UpdateSmsInteraction']=function(_0x2f94b7){var _0x2bae3c=this;return new Promise(function(_0x277dff,_0x2fac65){return db[_0xb119('0x18')][_0xb119('0x19')](_0x2f94b7['body'],{'raw':_0x2f94b7[_0xb119('0x1a')]?_0x2f94b7[_0xb119('0x1a')][_0xb119('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f94b7[_0xb119('0x1a')]?_0x2f94b7[_0xb119('0x1a')][_0xb119('0x1c')]||null:null,'attributes':_0x2f94b7['options']?_0x2f94b7[_0xb119('0x1a')]['attributes']||null:null,'limit':_0x2f94b7[_0xb119('0x1a')]?_0x2f94b7[_0xb119('0x1a')][_0xb119('0x1d')]||null:null})[_0xb119('0xd')](function(_0x1f2950){logger[_0xb119('0xe')](_0xb119('0x1e'),_0x2f94b7);logger[_0xb119('0x10')](_0xb119('0x1e'),_0x2f94b7,JSON[_0xb119('0x12')](_0x1f2950));_0x277dff(_0x1f2950);})[_0xb119('0x17')](function(_0x40ec47){logger[_0xb119('0x13')](_0xb119('0x1e'),_0x40ec47[_0xb119('0x15')],_0x2f94b7);_0x2fac65(_0x2bae3c[_0xb119('0x13')](0x1f4,_0x40ec47['message']));});});};exports[_0xb119('0x1f')]=function(_0x5e746f){return new Promise(function(_0x3dc48e,_0x4cf716){return db[_0xb119('0x18')][_0xb119('0x20')]({'where':_0x5e746f[_0xb119('0x1a')]?_0x5e746f[_0xb119('0x1a')][_0xb119('0x1c')]||null:null})[_0xb119('0xd')](function(_0x18e65d){if(_0x18e65d){return _0x18e65d['addTags'](_0x5e746f[_0xb119('0x21')][_0xb119('0x22')],_['omit'](_0x5e746f['body'],[_0xb119('0x22'),'id'])||{});}})[_0xb119('0x23')](function(_0x2b345d){logger[_0xb119('0xe')](_0xb119('0x24'),_0x5e746f);logger[_0xb119('0x10')](_0xb119('0x24'),_0x5e746f,JSON[_0xb119('0x12')](_0x2b345d));_0x3dc48e(_0x2b345d);})[_0xb119('0x17')](function(_0x559921){logger[_0xb119('0x13')]('AddTags',_0x559921[_0xb119('0x15')],_0x5e746f);_0x4cf716(_this[_0xb119('0x13')](0x1f4,_0x559921[_0xb119('0x15')]));});});}; \ No newline at end of file +var _0x0319=['UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','then','debug','AddTagsToSmsInteraction','find','addTags','omit','AddTags','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch'];(function(_0x5db034,_0x1d2f4d){var _0x5170cd=function(_0x411e43){while(--_0x411e43){_0x5db034['push'](_0x5db034['shift']());}};_0x5170cd(++_0x1d2f4d);}(_0x0319,0xa7));var _0x9031=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0319[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x9031('0x0'));var util=require('util');var moment=require(_0x9031('0x1'));var BPromise=require('bluebird');var rs=require(_0x9031('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9031('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9031('0x4'));var config=require(_0x9031('0x5'));var jayson=require(_0x9031('0x6'));var client=jayson['client'][_0x9031('0x7')]({'port':0x232a});config[_0x9031('0x8')]=_['defaults'](config[_0x9031('0x8')],{'host':_0x9031('0x9'),'port':0x18eb});var socket=require(_0x9031('0xa'))(new Redis(config[_0x9031('0x8')]));require(_0x9031('0xb'))['register'](socket);function respondWithRpcPromise(_0x3b13cc,_0x27d915,_0x54df3d){return new BPromise(function(_0x429911,_0x4b7f6b){return client[_0x9031('0xc')](_0x3b13cc,_0x54df3d)['then'](function(_0x59085d){logger[_0x9031('0xd')]('SmsInteraction,\x20%s,\x20%s',_0x27d915,_0x9031('0xe'));logger['debug'](_0x9031('0xf'),_0x27d915,'request\x20sent',JSON[_0x9031('0x10')](_0x59085d));if(_0x59085d[_0x9031('0x11')]){if(_0x59085d[_0x9031('0x11')][_0x9031('0x12')]===0x1f4){logger['error'](_0x9031('0x13'),_0x27d915,_0x59085d[_0x9031('0x11')][_0x9031('0x14')]);return _0x4b7f6b(_0x59085d[_0x9031('0x11')][_0x9031('0x14')]);}logger[_0x9031('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x27d915,_0x59085d[_0x9031('0x11')][_0x9031('0x14')]);return _0x429911(_0x59085d[_0x9031('0x11')]['message']);}else{logger[_0x9031('0xd')](_0x9031('0x13'),_0x27d915,'request\x20sent');_0x429911(_0x59085d[_0x9031('0x15')][_0x9031('0x14')]);}})[_0x9031('0x16')](function(_0xf9013c){logger[_0x9031('0x11')](_0x9031('0x13'),_0x27d915,_0xf9013c);_0x4b7f6b(_0xf9013c);});});}exports[_0x9031('0x17')]=function(_0x5c2454){var _0x1a7a40=this;return new Promise(function(_0x5252e7,_0x51b7d2){return db[_0x9031('0x18')]['update'](_0x5c2454[_0x9031('0x19')],{'raw':_0x5c2454[_0x9031('0x1a')]?_0x5c2454[_0x9031('0x1a')][_0x9031('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2454[_0x9031('0x1a')]?_0x5c2454[_0x9031('0x1a')][_0x9031('0x1c')]||null:null,'attributes':_0x5c2454['options']?_0x5c2454[_0x9031('0x1a')][_0x9031('0x1d')]||null:null,'limit':_0x5c2454[_0x9031('0x1a')]?_0x5c2454['options'][_0x9031('0x1e')]||null:null})[_0x9031('0x1f')](function(_0x2a2d34){logger[_0x9031('0xd')](_0x9031('0x17'),_0x5c2454);logger[_0x9031('0x20')](_0x9031('0x17'),_0x5c2454,JSON[_0x9031('0x10')](_0x2a2d34));_0x5252e7(_0x2a2d34);})[_0x9031('0x16')](function(_0x2dcc40){logger[_0x9031('0x11')](_0x9031('0x17'),_0x2dcc40[_0x9031('0x14')],_0x5c2454);_0x51b7d2(_0x1a7a40[_0x9031('0x11')](0x1f4,_0x2dcc40[_0x9031('0x14')]));});});};exports[_0x9031('0x21')]=function(_0x5a0a0a){return new Promise(function(_0x510823,_0x4db77d){return db[_0x9031('0x18')][_0x9031('0x22')]({'where':_0x5a0a0a[_0x9031('0x1a')]?_0x5a0a0a[_0x9031('0x1a')]['where']||null:null})[_0x9031('0x1f')](function(_0x8a4ae5){if(_0x8a4ae5){return _0x8a4ae5[_0x9031('0x23')](_0x5a0a0a['body']['ids'],_[_0x9031('0x24')](_0x5a0a0a[_0x9031('0x19')],['ids','id'])||{});}})['spread'](function(_0x4fee23){logger[_0x9031('0xd')](_0x9031('0x25'),_0x5a0a0a);logger[_0x9031('0x20')](_0x9031('0x25'),_0x5a0a0a,JSON[_0x9031('0x10')](_0x4fee23));_0x510823(_0x4fee23);})[_0x9031('0x16')](function(_0x1c0246){logger[_0x9031('0x11')]('AddTags',_0x1c0246[_0x9031('0x14')],_0x5a0a0a);_0x4db77d(_this['error'](0x1f4,_0x1c0246['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1751e86..c8e200f 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 _0x3896=['./smsInteraction.events','save','remove','update','emit','register','length','smsInteraction:'];(function(_0x3a0be9,_0x214ee4){var _0xc1ec3e=function(_0x4e04ad){while(--_0x4e04ad){_0x3a0be9['push'](_0x3a0be9['shift']());}};_0xc1ec3e(++_0x214ee4);}(_0x3896,0x198));var _0x6389=function(_0x455d3f,_0x56af34){_0x455d3f=_0x455d3f-0x0;var _0x4d20bc=_0x3896[_0x455d3f];return _0x4d20bc;};'use strict';var SmsInteractionEvents=require(_0x6389('0x0'));var events=[_0x6389('0x1'),_0x6389('0x2'),_0x6389('0x3')];function createListener(_0x5e35a8,_0x8a17f7){return function(_0x38c7b1){_0x8a17f7[_0x6389('0x4')](_0x5e35a8,_0x38c7b1);};}function removeListener(_0x13c4e6,_0x38bc51){return function(){SmsInteractionEvents['removeListener'](_0x13c4e6,_0x38bc51);};}exports[_0x6389('0x5')]=function(_0x4c0c5a){for(var _0x173c14=0x0,_0xa42885=events[_0x6389('0x6')];_0x173c14<_0xa42885;_0x173c14++){var _0x5384eb=events[_0x173c14];var _0x1058b4=createListener(_0x6389('0x7')+_0x5384eb,_0x4c0c5a);SmsInteractionEvents['on'](_0x5384eb,_0x1058b4);}}; \ No newline at end of file +var _0x3e9a=['./smsInteraction.events','save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x5a9130,_0x1a32f3){var _0x53580d=function(_0x357363){while(--_0x357363){_0x5a9130['push'](_0x5a9130['shift']());}};_0x53580d(++_0x1a32f3);}(_0x3e9a,0x1c8));var _0xa3e9=function(_0x858382,_0xda09c9){_0x858382=_0x858382-0x0;var _0xca7a0b=_0x3e9a[_0x858382];return _0xca7a0b;};'use strict';var SmsInteractionEvents=require(_0xa3e9('0x0'));var events=[_0xa3e9('0x1'),_0xa3e9('0x2'),_0xa3e9('0x3')];function createListener(_0x115893,_0x573edd){return function(_0x5324c4){_0x573edd['emit'](_0x115893,_0x5324c4);};}function removeListener(_0x659233,_0x3358bf){return function(){SmsInteractionEvents[_0xa3e9('0x4')](_0x659233,_0x3358bf);};}exports[_0xa3e9('0x5')]=function(_0x15187e){for(var _0x36cc7b=0x0,_0x4e1a3a=events[_0xa3e9('0x6')];_0x36cc7b<_0x4e1a3a;_0x36cc7b++){var _0x275485=events[_0x36cc7b];var _0x1f2779=createListener(_0xa3e9('0x7')+_0x275485,_0x15187e);SmsInteractionEvents['on'](_0x275485,_0x1f2779);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 60a25ac..63ac8ca 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 _0x98ad=['describe','/:id','show','tracked','sms','smsmessage:create','create','/:id/status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x98ad,0x1c1));var _0xd98a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x98ad[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xd98a('0x0'));var util=require('util');var path=require(_0xd98a('0x1'));var timeout=require('connect-timeout');var express=require(_0xd98a('0x2'));var router=express[_0xd98a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd98a('0x4'));var config=require(_0xd98a('0x5'));var controller=require(_0xd98a('0x6'));router[_0xd98a('0x7')]('/',auth[_0xd98a('0x8')](),controller['index']);router[_0xd98a('0x7')](_0xd98a('0x9'),auth[_0xd98a('0x8')](),controller[_0xd98a('0xa')]);router['get'](_0xd98a('0xb'),auth['isAuthenticated'](),controller[_0xd98a('0xc')]);router['post']('/',auth[_0xd98a('0x8')](),interaction[_0xd98a('0xd')](_0xd98a('0xe'),_0xd98a('0xf')),controller[_0xd98a('0x10')]);router['post'](_0xd98a('0x11'),controller['status']);router['put'](_0xd98a('0xb'),auth[_0xd98a('0x8')](),controller[_0xd98a('0x12')]);router['put'](_0xd98a('0x13'),auth[_0xd98a('0x8')](),controller[_0xd98a('0x14')]);router[_0xd98a('0x15')](_0xd98a('0x16'),auth['isAuthenticated'](),controller[_0xd98a('0x17')]);router[_0xd98a('0x18')](_0xd98a('0xb'),auth['isAuthenticated'](),controller[_0xd98a('0x19')]);module[_0xd98a('0x1a')]=router; \ No newline at end of file +var _0xf288=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','/:id/status','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','connect-timeout','Router'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0xf288,0xd7));var _0x8f28=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0xf288[_0x190c49];return _0x475b9a;};'use strict';var multer=require(_0x8f28('0x0'));var util=require(_0x8f28('0x1'));var path=require(_0x8f28('0x2'));var timeout=require(_0x8f28('0x3'));var express=require('express');var router=express[_0x8f28('0x4')]();var auth=require(_0x8f28('0x5'));var interaction=require(_0x8f28('0x6'));var config=require(_0x8f28('0x7'));var controller=require(_0x8f28('0x8'));router[_0x8f28('0x9')]('/',auth[_0x8f28('0xa')](),controller[_0x8f28('0xb')]);router[_0x8f28('0x9')](_0x8f28('0xc'),auth[_0x8f28('0xa')](),controller['describe']);router[_0x8f28('0x9')](_0x8f28('0xd'),auth[_0x8f28('0xa')](),controller[_0x8f28('0xe')]);router[_0x8f28('0xf')]('/',auth[_0x8f28('0xa')](),interaction['tracked']('sms','smsmessage:create'),controller['create']);router[_0x8f28('0xf')](_0x8f28('0x10'),controller['status']);router[_0x8f28('0x11')](_0x8f28('0xd'),auth[_0x8f28('0xa')](),controller['update']);router[_0x8f28('0x11')](_0x8f28('0x12'),auth[_0x8f28('0xa')](),controller[_0x8f28('0x13')]);router[_0x8f28('0x11')](_0x8f28('0x14'),auth[_0x8f28('0xa')](),controller['reject']);router['delete'](_0x8f28('0xd'),auth[_0x8f28('0xa')](),controller['destroy']);module[_0x8f28('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index c46950a..56c6110 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 _0xea31=['out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x776377,_0x30b9ee){var _0x4c8fe8=function(_0x55e8f1){while(--_0x55e8f1){_0x776377['push'](_0x776377['shift']());}};_0x4c8fe8(++_0x30b9ee);}(_0xea31,0x6b));var _0x1ea3=function(_0x450ebd,_0x415fb7){_0x450ebd=_0x450ebd-0x0;var _0x3c56c2=_0xea31[_0x450ebd];return _0x3c56c2;};'use strict';var Sequelize=require(_0x1ea3('0x0'));module['exports']={'body':{'type':Sequelize[_0x1ea3('0x1')](_0x1ea3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1ea3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ea3('0x4')]('in',_0x1ea3('0x5')),'defaultValue':_0x1ea3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1ea3('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1ea3('0x7')]},'secret':{'type':Sequelize[_0x1ea3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6f44=['STRING','DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x2e0722,_0x181c55){var _0x3c899a=function(_0x194db4){while(--_0x194db4){_0x2e0722['push'](_0x2e0722['shift']());}};_0x3c899a(++_0x181c55);}(_0x6f44,0x1ea));var _0x46f4=function(_0x1b7abf,_0x17a63c){_0x1b7abf=_0x1b7abf-0x0;var _0x776b3b=_0x6f44[_0x1b7abf];return _0x776b3b;};'use strict';var Sequelize=require(_0x46f4('0x0'));module[_0x46f4('0x1')]={'body':{'type':Sequelize['TEXT'](_0x46f4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x46f4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x46f4('0x4')]('in',_0x46f4('0x5')),'defaultValue':_0x46f4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x46f4('0x6')](0xbe)},'phone':{'type':Sequelize[_0x46f4('0x6')]},'readAt':{'type':Sequelize[_0x46f4('0x7')]},'secret':{'type':Sequelize[_0x46f4('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index db35801..e2084cd 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 _0x24fd=['twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','plivio','results','groupName','DELIVERED','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','SmsMessage','count','includeAll','include','findAll','find','create','body','update','params','describe','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','RejectMessage','rejectMessage','interface','SmsAccount','SmsAccountId','inspect'];(function(_0x4ee89a,_0x56d642){var _0x42aca9=function(_0xa1f425){while(--_0xa1f425){_0x4ee89a['push'](_0x4ee89a['shift']());}};_0x42aca9(++_0x56d642);}(_0x24fd,0x117));var _0xd24f=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x24fd[_0xc67528];return _0x38e26d;};'use strict';var pdf=require(_0xd24f('0x0'));var emlformat=require(_0xd24f('0x1'));var rimraf=require(_0xd24f('0x2'));var zipdir=require(_0xd24f('0x3'));var jsonpatch=require(_0xd24f('0x4'));var rp=require(_0xd24f('0x5'));var moment=require(_0xd24f('0x6'));var BPromise=require(_0xd24f('0x7'));var Mustache=require(_0xd24f('0x8'));var util=require(_0xd24f('0x9'));var path=require(_0xd24f('0xa'));var sox=require(_0xd24f('0xb'));var csv=require(_0xd24f('0xc'));var ejs=require(_0xd24f('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd24f('0xe'));var crypto=require(_0xd24f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd24f('0x10'));var toCsv=require(_0xd24f('0xc'));var querystring=require('querystring');var Papa=require(_0xd24f('0x11'));var Redis=require(_0xd24f('0x12'));var authService=require(_0xd24f('0x13'));var qs=require(_0xd24f('0x14'));var hardwareService=require(_0xd24f('0x15'));var logger=require(_0xd24f('0x16'))(_0xd24f('0x17'));var utils=require(_0xd24f('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd24f('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd24f('0x19')]));require(_0xd24f('0x1a'))[_0xd24f('0x1b')](socket);var jayson=require(_0xd24f('0x1c'));var client=jayson[_0xd24f('0x1d')][_0xd24f('0x1e')]({'port':0x232c});var client9002=jayson[_0xd24f('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x202480,_0x1f4391,_0x485a7c){if(_0x485a7c){var _0x86dfce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x86dfce[_0xd24f('0x1f')](_0x1f4391)){return _0x202480;}else{throw new Error(_0xd24f('0x20'));}}else{return _0x202480;}}function respondWithRpcPromise(_0x147449,_0x30e22d,_0xc3c467,_0x176de){return new BPromise(function(_0x54c402,_0x2254b2){var _0x3aa1f9=_0x176de||client;return _0x3aa1f9['request'](_0x147449,_0xc3c467)[_0xd24f('0x21')](function(_0x6746f8){logger[_0xd24f('0x22')](_0xd24f('0x23'),_0x30e22d,_0xd24f('0x24'));logger['debug'](_0xd24f('0x25'),_0x30e22d,_0xd24f('0x24'),JSON[_0xd24f('0x26')](_0x6746f8));if(_0x6746f8[_0xd24f('0x27')]){if(_0x6746f8[_0xd24f('0x27')]['code']===0x1f4){logger[_0xd24f('0x27')](_0xd24f('0x23'),_0x30e22d,_0x6746f8[_0xd24f('0x27')]['message']);return _0x2254b2(_0x6746f8[_0xd24f('0x27')][_0xd24f('0x28')]);}logger['error'](_0xd24f('0x23'),_0x30e22d,_0x6746f8[_0xd24f('0x27')][_0xd24f('0x28')]);return _0x54c402(_0x6746f8[_0xd24f('0x27')][_0xd24f('0x28')]);}else{logger[_0xd24f('0x22')](_0xd24f('0x23'),_0x30e22d,_0xd24f('0x24'));_0x54c402(_0x6746f8[_0xd24f('0x29')][_0xd24f('0x28')]);}})[_0xd24f('0x2a')](function(_0x12703b){logger['error']('SmsMessage,\x20%s,\x20%s',_0x30e22d,_0x12703b);_0x2254b2(_0x12703b);});});}function respondWithStatusCode(_0x3332b3,_0x46ae46){_0x46ae46=_0x46ae46||0xcc;return function(_0x401ed4){if(_0x401ed4){return _0x3332b3[_0xd24f('0x2b')](_0x46ae46);}return _0x3332b3[_0xd24f('0x2c')](_0x46ae46)[_0xd24f('0x2d')]();};}function respondWithResult(_0x191542,_0x1ae4fc){_0x1ae4fc=_0x1ae4fc||0xc8;return function(_0x1a8c7d){if(_0x1a8c7d){return _0x191542[_0xd24f('0x2c')](_0x1ae4fc)[_0xd24f('0x2e')](_0x1a8c7d);}};}function respondWithFilteredResult(_0xc61700,_0x2ca76c){return function(_0x39b44b){if(_0x39b44b){var _0x64f62c=_0x39b44b['count'],_0x3067e6=_0x2ca76c[_0xd24f('0x2f')],_0x671fe7=_0x2ca76c['offset']+_0x2ca76c[_0xd24f('0x30')],_0x3c0311;if(_0x671fe7>=_0x64f62c){_0x671fe7=_0x64f62c;_0x3c0311=0xc8;}else{_0x3c0311=0xce;}_0xc61700[_0xd24f('0x2c')](_0x3c0311);return _0xc61700[_0xd24f('0x31')](_0xd24f('0x32'),_0x3067e6+'-'+_0x671fe7+'/'+_0x64f62c)[_0xd24f('0x2e')](_0x39b44b);}return null;};}function patchUpdates(_0x4c49a4){return function(_0x55ab5d){try{jsonpatch[_0xd24f('0x33')](_0x55ab5d,_0x4c49a4,!![]);}catch(_0x45c587){return BPromise['reject'](_0x45c587);}return _0x55ab5d[_0xd24f('0x34')]();};}function saveUpdates(_0x258759,_0x23e410){return function(_0x59969d){if(_0x59969d){return _0x59969d['update'](_0x258759)['then'](function(_0x1a8a57){return _0x1a8a57;});}return null;};}function removeEntity(_0x559d90,_0x728815){return function(_0x397c29){if(_0x397c29){return _0x397c29[_0xd24f('0x35')]()[_0xd24f('0x21')](function(){_0x559d90[_0xd24f('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b259,_0x38d607){return function(_0x25cc45){if(!_0x25cc45){_0x42b259[_0xd24f('0x2b')](0x194);}return _0x25cc45;};}function handleError(_0x50d6b4,_0x50feae){_0x50feae=_0x50feae||0x1f4;return function(_0x41b117){logger[_0xd24f('0x27')](_0x41b117[_0xd24f('0x36')]);if(_0x41b117[_0xd24f('0x37')]){delete _0x41b117[_0xd24f('0x37')];}_0x50d6b4[_0xd24f('0x2c')](_0x50feae)[_0xd24f('0x38')](_0x41b117);};}exports[_0xd24f('0x39')]=function(_0x65618e,_0x30c2bc){var _0x3bf2b0={},_0x2b68bb={},_0x4c7e63={'count':0x0,'rows':[]};var _0x5bb610=db['SmsMessage'][_0xd24f('0x3a')];_0x2b68bb[_0xd24f('0x3b')]=_[_0xd24f('0x3c')](_0x5bb610);_0x2b68bb['query']=_[_0xd24f('0x3c')](_0x65618e[_0xd24f('0x3d')]);_0x2b68bb[_0xd24f('0x3e')]=_[_0xd24f('0x3f')](_0x2b68bb[_0xd24f('0x3b')],_0x2b68bb[_0xd24f('0x3d')]);_0x3bf2b0[_0xd24f('0x40')]=_[_0xd24f('0x3f')](_0x2b68bb[_0xd24f('0x3b')],qs['fields'](_0x65618e['query'][_0xd24f('0x41')]));_0x3bf2b0[_0xd24f('0x40')]=_0x3bf2b0[_0xd24f('0x40')][_0xd24f('0x42')]?_0x3bf2b0['attributes']:_0x2b68bb[_0xd24f('0x3b')];if(!_0x65618e[_0xd24f('0x3d')][_0xd24f('0x43')]('nolimit')){_0x3bf2b0[_0xd24f('0x30')]=qs['limit'](_0x65618e[_0xd24f('0x3d')][_0xd24f('0x30')]);_0x3bf2b0[_0xd24f('0x2f')]=qs['offset'](_0x65618e['query'][_0xd24f('0x2f')]);}_0x3bf2b0[_0xd24f('0x44')]=qs[_0xd24f('0x45')](_0x65618e['query'][_0xd24f('0x45')]);_0x3bf2b0[_0xd24f('0x46')]=qs[_0xd24f('0x3e')](_[_0xd24f('0x47')](_0x65618e[_0xd24f('0x3d')],_0x2b68bb[_0xd24f('0x3e')]));if(_0x65618e['query'][_0xd24f('0x48')]){_0x3bf2b0[_0xd24f('0x46')]=_[_0xd24f('0x49')](_0x3bf2b0[_0xd24f('0x46')],{'$or':_[_0xd24f('0x4a')](_0x5bb610,function(_0x33352f){if(_0x33352f['type'][_0xd24f('0x4b')]!==_0xd24f('0x4c')){var _0x405a5c={};_0x405a5c[_0x33352f['field']]={'$like':'%'+_0x65618e[_0xd24f('0x3d')]['filter']+'%'};return _0x405a5c;}})});}_0x3bf2b0=_[_0xd24f('0x49')]({},_0x3bf2b0,_0x65618e[_0xd24f('0x4d')]);var _0xbdda0a={'where':_0x3bf2b0[_0xd24f('0x46')]};return db[_0xd24f('0x4e')]['count'](_0xbdda0a)[_0xd24f('0x21')](function(_0x40e19b){_0x4c7e63[_0xd24f('0x4f')]=_0x40e19b;if(_0x65618e[_0xd24f('0x3d')][_0xd24f('0x50')]){_0x3bf2b0[_0xd24f('0x51')]=[{'all':!![]}];}return db[_0xd24f('0x4e')][_0xd24f('0x52')](_0x3bf2b0);})[_0xd24f('0x21')](function(_0x328932){_0x4c7e63['rows']=_0x328932;return _0x4c7e63;})[_0xd24f('0x21')](respondWithFilteredResult(_0x30c2bc,_0x3bf2b0))[_0xd24f('0x2a')](handleError(_0x30c2bc,null));};exports['show']=function(_0x2ae295,_0x23a37b){var _0x245792={'raw':!![],'where':{'id':_0x2ae295['params']['id']}},_0x363b7e={};_0x363b7e['model']=_['keys'](db['SmsMessage'][_0xd24f('0x3a')]);_0x363b7e['query']=_[_0xd24f('0x3c')](_0x2ae295[_0xd24f('0x3d')]);_0x363b7e['filters']=_[_0xd24f('0x3f')](_0x363b7e[_0xd24f('0x3b')],_0x363b7e['query']);_0x245792['attributes']=_['intersection'](_0x363b7e[_0xd24f('0x3b')],qs[_0xd24f('0x41')](_0x2ae295[_0xd24f('0x3d')][_0xd24f('0x41')]));_0x245792[_0xd24f('0x40')]=_0x245792['attributes'][_0xd24f('0x42')]?_0x245792[_0xd24f('0x40')]:_0x363b7e[_0xd24f('0x3b')];if(_0x2ae295[_0xd24f('0x3d')][_0xd24f('0x50')]){_0x245792['include']=[{'all':!![]}];}_0x245792=_[_0xd24f('0x49')]({},_0x245792,_0x2ae295[_0xd24f('0x4d')]);return db['SmsMessage'][_0xd24f('0x53')](_0x245792)[_0xd24f('0x21')](handleEntityNotFound(_0x23a37b,null))[_0xd24f('0x21')](respondWithResult(_0x23a37b,null))['catch'](handleError(_0x23a37b,null));};exports['create']=function(_0x3d581a,_0x5065f8){return db[_0xd24f('0x4e')][_0xd24f('0x54')](_0x3d581a[_0xd24f('0x55')],{})['then'](respondWithResult(_0x5065f8,0xc9))[_0xd24f('0x2a')](handleError(_0x5065f8,null));};exports[_0xd24f('0x56')]=function(_0x26af8a,_0x251073){if(_0x26af8a[_0xd24f('0x55')]['id']){delete _0x26af8a[_0xd24f('0x55')]['id'];}return db[_0xd24f('0x4e')][_0xd24f('0x53')]({'where':{'id':_0x26af8a[_0xd24f('0x57')]['id']}})[_0xd24f('0x21')](handleEntityNotFound(_0x251073,null))[_0xd24f('0x21')](saveUpdates(_0x26af8a['body'],null))[_0xd24f('0x21')](respondWithResult(_0x251073,null))['catch'](handleError(_0x251073,null));};exports[_0xd24f('0x35')]=function(_0xccab82,_0x3a4716){return db['SmsMessage'][_0xd24f('0x53')]({'where':{'id':_0xccab82['params']['id']}})[_0xd24f('0x21')](handleEntityNotFound(_0x3a4716,null))[_0xd24f('0x21')](removeEntity(_0x3a4716,null))[_0xd24f('0x2a')](handleError(_0x3a4716,null));};exports[_0xd24f('0x58')]=function(_0x1aee39,_0x44631a){return db['SmsMessage'][_0xd24f('0x58')]()[_0xd24f('0x21')](respondWithResult(_0x44631a,null))[_0xd24f('0x2a')](handleError(_0x44631a,null));};var interaction_log=require(_0xd24f('0x16'))(_0xd24f('0x59'));exports[_0xd24f('0x5a')]=function(_0x25dc54,_0x355358,_0x3d17c1){var _0x38ce12={'channel':_0xd24f('0x5b')};if(_0x25dc54[_0xd24f('0x55')]['id']){delete _0x25dc54['body']['id'];}_0x25dc54[_0xd24f('0x55')]['read']=!![];_0x25dc54[_0xd24f('0x55')][_0xd24f('0x5c')]=moment()[_0xd24f('0x5d')](_0xd24f('0x5e'));_0x25dc54['body'][_0xd24f('0x5f')]=_0x25dc54[_0xd24f('0x55')][_0xd24f('0x5f')]||_0x25dc54[_0xd24f('0x60')]['id'];return db[_0xd24f('0x4e')][_0xd24f('0x53')]({'where':{'id':_0x25dc54['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xd24f('0x61')}]})[_0xd24f('0x21')](handleEntityNotFound(_0x355358,null))[_0xd24f('0x21')](saveUpdates(_0x25dc54[_0xd24f('0x55')],null))[_0xd24f('0x21')](function(_0x2c45c5){if(_0x2c45c5){_0x38ce12[_0xd24f('0x28')]=_0x2c45c5[_0xd24f('0x62')]({'plain':!![]});return db[_0xd24f('0x63')][_0xd24f('0x53')]({'where':{'id':_0x2c45c5[_0xd24f('0x64')]}});}return null;})[_0xd24f('0x21')](handleEntityNotFound(_0x355358,null))[_0xd24f('0x21')](function(_0x54d7e0){if(_0x54d7e0){return _0x54d7e0[_0xd24f('0x56')]({'UserId':_0x25dc54[_0xd24f('0x55')][_0xd24f('0x5f')],'read1stAt':_['isNil'](_0x54d7e0[_0xd24f('0x65')])?moment()[_0xd24f('0x5d')](_0xd24f('0x5e')):undefined});}return null;})[_0xd24f('0x21')](function(_0x2e1a12){if(_0x2e1a12){_0x38ce12[_0xd24f('0x66')]=_0x2e1a12[_0xd24f('0x62')]({'plain':!![]});interaction_log[_0xd24f('0x22')](_0xd24f('0x67'),_0x25dc54[_0xd24f('0x60')]['id'],_0x25dc54[_0xd24f('0x60')][_0xd24f('0x37')],_0x25dc54[_0xd24f('0x60')][_0xd24f('0x68')],_0x38ce12[_0xd24f('0x66')]['id'],_0x25dc54['body']?JSON['stringify'](_0x25dc54[_0xd24f('0x55')]):_0xd24f('0x69'));return respondWithRpcPromise('AcceptMessage',_0xd24f('0x6a'),_0x38ce12);}return null;})['then'](function(_0x16bdf4){if(_0x16bdf4){if(_0x25dc54[_0xd24f('0x55')]['manual']){_0x38ce12[_0xd24f('0x28')]['interface']=util[_0xd24f('0x5d')](_0xd24f('0x6b'),_0x25dc54[_0xd24f('0x60')]['name']);_0x38ce12[_0xd24f('0x28')][_0xd24f('0x6c')]=_0x38ce12[_0xd24f('0x6c')];_0x38ce12[_0xd24f('0x28')][_0xd24f('0x6d')]='accept';return respondWithRpcPromise(_0xd24f('0x6e'),'EventManager',{'event':_0xd24f('0x6f'),'message':_0x38ce12[_0xd24f('0x28')]},client9002)['then'](function(){return _0x38ce12;});}return _0x38ce12;}return null;})[_0xd24f('0x21')](respondWithResult(_0x355358,null))[_0xd24f('0x2a')](handleError(_0x355358,null));};var interaction_log=require(_0xd24f('0x16'))(_0xd24f('0x59'));exports[_0xd24f('0x70')]=function(_0x2814c2,_0xa5e4a1,_0x187dec){var _0x3c085d={'agent':{},'channel':'sms'};if(_0x2814c2[_0xd24f('0x55')]['id']){delete _0x2814c2['body']['id'];}_0x2814c2[_0xd24f('0x55')][_0xd24f('0x5f')]=_0x2814c2[_0xd24f('0x55')][_0xd24f('0x5f')]||_0x2814c2[_0xd24f('0x60')]['id'];_0x3c085d[_0xd24f('0x71')]['id']=_0x2814c2[_0xd24f('0x55')]['UserId'];return db[_0xd24f('0x4e')][_0xd24f('0x53')]({'where':{'id':_0x2814c2[_0xd24f('0x57')]['id'],'UserId':null}})[_0xd24f('0x21')](handleEntityNotFound(_0xa5e4a1,null))[_0xd24f('0x21')](function(_0x14784d){if(_0x14784d){_0x3c085d[_0xd24f('0x28')]=_0x14784d[_0xd24f('0x62')]({'plain':!![]});return db[_0xd24f('0x63')]['find']({'where':{'id':_0x14784d['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xa5e4a1,null))['then'](function(_0x3ec527){if(_0x3ec527){_0x3c085d[_0xd24f('0x66')]=_0x3ec527[_0xd24f('0x62')]({'plain':!![]});interaction_log[_0xd24f('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2814c2['user']['id'],_0x2814c2[_0xd24f('0x60')]['name'],_0x2814c2[_0xd24f('0x60')]['role'],_0x3c085d[_0xd24f('0x66')]['id'],_0x2814c2[_0xd24f('0x55')]?JSON[_0xd24f('0x26')](_0x2814c2[_0xd24f('0x55')]):'null');return respondWithRpcPromise(_0xd24f('0x72'),_0xd24f('0x73'),_0x3c085d);}return null;})[_0xd24f('0x21')](function(_0x2a7b5e){if(_0x2a7b5e){_0x2a7b5e[_0xd24f('0x28')][_0xd24f('0x74')]=util[_0xd24f('0x5d')](_0xd24f('0x6b'),_0x2814c2[_0xd24f('0x60')]['name']);_0x2a7b5e[_0xd24f('0x28')][_0xd24f('0x6c')]=_0x3c085d[_0xd24f('0x6c')];_0x2a7b5e[_0xd24f('0x28')][_0xd24f('0x6d')]=_0xd24f('0x70');respondWithRpcPromise(_0xd24f('0x6e'),'EventManager',{'event':'rejectmessage','message':_0x2a7b5e[_0xd24f('0x28')]},client9002);return _0x3c085d;}return null;})[_0xd24f('0x21')](respondWithResult(_0xa5e4a1,null))[_0xd24f('0x2a')](handleError(_0xa5e4a1,null));};exports['status']=function(_0x181f4f,_0x3d5f3b,_0x5ed89b){if(_0x181f4f[_0xd24f('0x55')]['id']){delete _0x181f4f[_0xd24f('0x55')]['id'];}var _0x3875d6;return db[_0xd24f('0x4e')]['find']({'where':{'id':_0x181f4f[_0xd24f('0x57')]['id']}})[_0xd24f('0x21')](handleEntityNotFound(_0x3d5f3b,null))[_0xd24f('0x21')](function(_0x430f76){if(_0x430f76){_0x3875d6=_0x430f76;return db[_0xd24f('0x75')]['find']({'where':{'id':_0x430f76[_0xd24f('0x76')]}});}})['then'](handleEntityNotFound(_0x3d5f3b,null))[_0xd24f('0x21')](function(_0x5297ff){if(_0x5297ff){logger['debug'](_0xd24f('0x25'),_0xd24f('0x2c'),'received\x20delivery\x20report\x20from',_0x5297ff['type'],util[_0xd24f('0x77')](_0x181f4f[_0xd24f('0x55')],{'showHidden':![],'depth':null}));switch(_0x5297ff['type']){case _0xd24f('0x78'):if(_0x181f4f['body'][_0xd24f('0x79')]&&_0x181f4f['body']['MessageSid']===_0x3875d6[_0xd24f('0x7a')]){return _0x3875d6[_0xd24f('0x56')]({'read':!![]});}else{logger[_0xd24f('0x27')](_0xd24f('0x7b'),_0xd24f('0x2c'),_0xd24f('0x78'),util['inspect'](_0x181f4f[_0xd24f('0x55')],{'showHidden':![],'depth':null}));}break;case _0xd24f('0x7c'):if(_0x181f4f[_0xd24f('0x55')][_0xd24f('0x7d')]&&_0x181f4f[_0xd24f('0x55')][_0xd24f('0x7d')]===_0x3875d6[_0xd24f('0x7a')]&&_[_0xd24f('0x7e')](['sent',_0xd24f('0x7f')],_0x181f4f[_0xd24f('0x55')][_0xd24f('0x80')])>=0x0){return _0x3875d6[_0xd24f('0x56')]({'read':!![]});}else{logger[_0xd24f('0x27')](_0xd24f('0x7b'),'status',_0xd24f('0x81'),util[_0xd24f('0x77')](_0x181f4f[_0xd24f('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x10ce17=_0x181f4f['body'][_0xd24f('0x82')][0x0];if(_0x10ce17[_0xd24f('0x2c')][_0xd24f('0x83')]===_0xd24f('0x84')){return _0x3875d6[_0xd24f('0x56')]({'read':!![]});}else{logger[_0xd24f('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0xd24f('0x77')](_0x181f4f[_0xd24f('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x3875d6;}})[_0xd24f('0x21')](respondWithResult(_0x3d5f3b,null))['catch'](handleError(_0x3d5f3b,null));}; \ No newline at end of file +var _0xffdc=['SmsAccountId','inspect','twilio','MessageSid','messageId','update','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','delivered','Status','plivio','results','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./smsMessage.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','end','sendStatus','stack','name','index','SmsMessage','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','SmsInteraction','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','accept','EventManager','acceptmessage','sms-interactions','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','event','rejectmessage','SmsAccount'];(function(_0x57fa39,_0x8a2279){var _0x183327=function(_0x4ee1fd){while(--_0x4ee1fd){_0x57fa39['push'](_0x57fa39['shift']());}};_0x183327(++_0x8a2279);}(_0xffdc,0x112));var _0xcffd=function(_0x5668e1,_0x2c817e){_0x5668e1=_0x5668e1-0x0;var _0x1ae525=_0xffdc[_0x5668e1];return _0x1ae525;};'use strict';var pdf=require(_0xcffd('0x0'));var emlformat=require(_0xcffd('0x1'));var rimraf=require(_0xcffd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcffd('0x3'));var moment=require(_0xcffd('0x4'));var BPromise=require(_0xcffd('0x5'));var Mustache=require(_0xcffd('0x6'));var util=require(_0xcffd('0x7'));var path=require('path');var sox=require(_0xcffd('0x8'));var csv=require(_0xcffd('0x9'));var ejs=require(_0xcffd('0xa'));var fs=require('fs');var _=require(_0xcffd('0xb'));var squel=require('squel');var crypto=require(_0xcffd('0xc'));var jsforce=require(_0xcffd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcffd('0xe'));var Papa=require(_0xcffd('0xf'));var Redis=require('ioredis');var authService=require(_0xcffd('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcffd('0x11'));var logger=require(_0xcffd('0x12'))(_0xcffd('0x13'));var utils=require(_0xcffd('0x14'));var config=require(_0xcffd('0x15'));var db=require(_0xcffd('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcffd('0x17'),'port':0x18eb});var socket=require(_0xcffd('0x18'))(new Redis(config[_0xcffd('0x19')]));require(_0xcffd('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xcffd('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xcffd('0x1b')][_0xcffd('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1a10ba,_0x1d46fb,_0x4868d3){if(_0x4868d3){var _0x18d174=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18d174[_0xcffd('0x1d')](_0x1d46fb)){return _0x1a10ba;}else{throw new Error(_0xcffd('0x1e'));}}else{return _0x1a10ba;}}function respondWithRpcPromise(_0x47b6ea,_0xa46afb,_0x2fdf0a,_0x4ce31d){return new BPromise(function(_0x122c00,_0xbacd98){var _0x315811=_0x4ce31d||client;return _0x315811[_0xcffd('0x1f')](_0x47b6ea,_0x2fdf0a)[_0xcffd('0x20')](function(_0x307588){logger[_0xcffd('0x21')](_0xcffd('0x22'),_0xa46afb,_0xcffd('0x23'));logger[_0xcffd('0x24')](_0xcffd('0x25'),_0xa46afb,_0xcffd('0x23'),JSON[_0xcffd('0x26')](_0x307588));if(_0x307588[_0xcffd('0x27')]){if(_0x307588[_0xcffd('0x27')][_0xcffd('0x28')]===0x1f4){logger[_0xcffd('0x27')](_0xcffd('0x22'),_0xa46afb,_0x307588[_0xcffd('0x27')][_0xcffd('0x29')]);return _0xbacd98(_0x307588[_0xcffd('0x27')][_0xcffd('0x29')]);}logger[_0xcffd('0x27')](_0xcffd('0x22'),_0xa46afb,_0x307588[_0xcffd('0x27')]['message']);return _0x122c00(_0x307588[_0xcffd('0x27')]['message']);}else{logger[_0xcffd('0x21')](_0xcffd('0x22'),_0xa46afb,'request\x20sent');_0x122c00(_0x307588[_0xcffd('0x2a')][_0xcffd('0x29')]);}})[_0xcffd('0x2b')](function(_0x3b2e77){logger[_0xcffd('0x27')](_0xcffd('0x22'),_0xa46afb,_0x3b2e77);_0xbacd98(_0x3b2e77);});});}function respondWithStatusCode(_0x4d5f09,_0x5b838c){_0x5b838c=_0x5b838c||0xcc;return function(_0x501904){if(_0x501904){return _0x4d5f09['sendStatus'](_0x5b838c);}return _0x4d5f09['status'](_0x5b838c)['end']();};}function respondWithResult(_0x579940,_0x442149){_0x442149=_0x442149||0xc8;return function(_0x5b8618){if(_0x5b8618){return _0x579940[_0xcffd('0x2c')](_0x442149)[_0xcffd('0x2d')](_0x5b8618);}};}function respondWithFilteredResult(_0x3cd250,_0x5a43d8){return function(_0x49d70f){if(_0x49d70f){var _0x4a356b=_0x49d70f[_0xcffd('0x2e')],_0x4cceca=_0x5a43d8[_0xcffd('0x2f')],_0x58c201=_0x5a43d8[_0xcffd('0x2f')]+_0x5a43d8[_0xcffd('0x30')],_0x18ab20;if(_0x58c201>=_0x4a356b){_0x58c201=_0x4a356b;_0x18ab20=0xc8;}else{_0x18ab20=0xce;}_0x3cd250['status'](_0x18ab20);return _0x3cd250[_0xcffd('0x31')](_0xcffd('0x32'),_0x4cceca+'-'+_0x58c201+'/'+_0x4a356b)[_0xcffd('0x2d')](_0x49d70f);}return null;};}function patchUpdates(_0x36557b){return function(_0x3e7353){try{jsonpatch['apply'](_0x3e7353,_0x36557b,!![]);}catch(_0x3b687e){return BPromise[_0xcffd('0x33')](_0x3b687e);}return _0x3e7353[_0xcffd('0x34')]();};}function saveUpdates(_0x5609a9,_0x22ca51){return function(_0x5344b6){if(_0x5344b6){return _0x5344b6['update'](_0x5609a9)[_0xcffd('0x20')](function(_0x2ba090){return _0x2ba090;});}return null;};}function removeEntity(_0xc2a53d,_0x36d16f){return function(_0x2c174e){if(_0x2c174e){return _0x2c174e[_0xcffd('0x35')]()['then'](function(){_0xc2a53d[_0xcffd('0x2c')](0xcc)[_0xcffd('0x36')]();});}};}function handleEntityNotFound(_0x1e500d,_0x571572){return function(_0x244c05){if(!_0x244c05){_0x1e500d[_0xcffd('0x37')](0x194);}return _0x244c05;};}function handleError(_0x25ab72,_0x1d7c0d){_0x1d7c0d=_0x1d7c0d||0x1f4;return function(_0x215d27){logger[_0xcffd('0x27')](_0x215d27[_0xcffd('0x38')]);if(_0x215d27[_0xcffd('0x39')]){delete _0x215d27[_0xcffd('0x39')];}_0x25ab72[_0xcffd('0x2c')](_0x1d7c0d)['send'](_0x215d27);};}exports[_0xcffd('0x3a')]=function(_0x3727f6,_0x50a00b){var _0x2916b1={},_0x1d1f5a={},_0x39071f={'count':0x0,'rows':[]};var _0x17f1e8=db[_0xcffd('0x3b')]['rawAttributes'];_0x1d1f5a['model']=_[_0xcffd('0x3c')](_0x17f1e8);_0x1d1f5a[_0xcffd('0x3d')]=_[_0xcffd('0x3c')](_0x3727f6[_0xcffd('0x3d')]);_0x1d1f5a[_0xcffd('0x3e')]=_[_0xcffd('0x3f')](_0x1d1f5a[_0xcffd('0x40')],_0x1d1f5a[_0xcffd('0x3d')]);_0x2916b1['attributes']=_[_0xcffd('0x3f')](_0x1d1f5a[_0xcffd('0x40')],qs[_0xcffd('0x41')](_0x3727f6[_0xcffd('0x3d')][_0xcffd('0x41')]));_0x2916b1[_0xcffd('0x42')]=_0x2916b1[_0xcffd('0x42')]['length']?_0x2916b1['attributes']:_0x1d1f5a[_0xcffd('0x40')];if(!_0x3727f6['query'][_0xcffd('0x43')]('nolimit')){_0x2916b1['limit']=qs['limit'](_0x3727f6[_0xcffd('0x3d')][_0xcffd('0x30')]);_0x2916b1['offset']=qs[_0xcffd('0x2f')](_0x3727f6[_0xcffd('0x3d')][_0xcffd('0x2f')]);}_0x2916b1[_0xcffd('0x44')]=qs[_0xcffd('0x45')](_0x3727f6['query'][_0xcffd('0x45')]);_0x2916b1[_0xcffd('0x46')]=qs[_0xcffd('0x3e')](_[_0xcffd('0x47')](_0x3727f6[_0xcffd('0x3d')],_0x1d1f5a[_0xcffd('0x3e')]));if(_0x3727f6['query']['filter']){_0x2916b1['where']=_[_0xcffd('0x48')](_0x2916b1[_0xcffd('0x46')],{'$or':_[_0xcffd('0x49')](_0x17f1e8,function(_0x5b7ad7){if(_0x5b7ad7[_0xcffd('0x4a')][_0xcffd('0x4b')]!==_0xcffd('0x4c')){var _0x48a8d3={};_0x48a8d3[_0x5b7ad7['field']]={'$like':'%'+_0x3727f6[_0xcffd('0x3d')][_0xcffd('0x4d')]+'%'};return _0x48a8d3;}})});}_0x2916b1=_[_0xcffd('0x48')]({},_0x2916b1,_0x3727f6['options']);var _0x12add0={'where':_0x2916b1[_0xcffd('0x46')]};return db['SmsMessage'][_0xcffd('0x2e')](_0x12add0)[_0xcffd('0x20')](function(_0x293c58){_0x39071f[_0xcffd('0x2e')]=_0x293c58;if(_0x3727f6[_0xcffd('0x3d')][_0xcffd('0x4e')]){_0x2916b1[_0xcffd('0x4f')]=[{'all':!![]}];}return db[_0xcffd('0x3b')][_0xcffd('0x50')](_0x2916b1);})[_0xcffd('0x20')](function(_0x353d9d){_0x39071f[_0xcffd('0x51')]=_0x353d9d;return _0x39071f;})[_0xcffd('0x20')](respondWithFilteredResult(_0x50a00b,_0x2916b1))[_0xcffd('0x2b')](handleError(_0x50a00b,null));};exports[_0xcffd('0x52')]=function(_0x21b760,_0x9173de){var _0x3e3725={'raw':!![],'where':{'id':_0x21b760[_0xcffd('0x53')]['id']}},_0x211c4d={};_0x211c4d[_0xcffd('0x40')]=_[_0xcffd('0x3c')](db['SmsMessage']['rawAttributes']);_0x211c4d[_0xcffd('0x3d')]=_[_0xcffd('0x3c')](_0x21b760[_0xcffd('0x3d')]);_0x211c4d[_0xcffd('0x3e')]=_[_0xcffd('0x3f')](_0x211c4d[_0xcffd('0x40')],_0x211c4d[_0xcffd('0x3d')]);_0x3e3725[_0xcffd('0x42')]=_[_0xcffd('0x3f')](_0x211c4d[_0xcffd('0x40')],qs[_0xcffd('0x41')](_0x21b760['query'][_0xcffd('0x41')]));_0x3e3725[_0xcffd('0x42')]=_0x3e3725[_0xcffd('0x42')][_0xcffd('0x54')]?_0x3e3725[_0xcffd('0x42')]:_0x211c4d[_0xcffd('0x40')];if(_0x21b760[_0xcffd('0x3d')][_0xcffd('0x4e')]){_0x3e3725[_0xcffd('0x4f')]=[{'all':!![]}];}_0x3e3725=_[_0xcffd('0x48')]({},_0x3e3725,_0x21b760['options']);return db[_0xcffd('0x3b')]['find'](_0x3e3725)[_0xcffd('0x20')](handleEntityNotFound(_0x9173de,null))[_0xcffd('0x20')](respondWithResult(_0x9173de,null))[_0xcffd('0x2b')](handleError(_0x9173de,null));};exports[_0xcffd('0x55')]=function(_0x11e7d7,_0x37533d){return db['SmsMessage'][_0xcffd('0x55')](_0x11e7d7[_0xcffd('0x56')],{})[_0xcffd('0x20')](respondWithResult(_0x37533d,0xc9))['catch'](handleError(_0x37533d,null));};exports['update']=function(_0x9a90e1,_0x570976){if(_0x9a90e1[_0xcffd('0x56')]['id']){delete _0x9a90e1[_0xcffd('0x56')]['id'];}return db[_0xcffd('0x3b')]['find']({'where':{'id':_0x9a90e1[_0xcffd('0x53')]['id']}})[_0xcffd('0x20')](handleEntityNotFound(_0x570976,null))[_0xcffd('0x20')](saveUpdates(_0x9a90e1[_0xcffd('0x56')],null))[_0xcffd('0x20')](respondWithResult(_0x570976,null))[_0xcffd('0x2b')](handleError(_0x570976,null));};exports[_0xcffd('0x35')]=function(_0x12f649,_0x3e0afc){return db['SmsMessage'][_0xcffd('0x57')]({'where':{'id':_0x12f649[_0xcffd('0x53')]['id']}})[_0xcffd('0x20')](handleEntityNotFound(_0x3e0afc,null))[_0xcffd('0x20')](removeEntity(_0x3e0afc,null))[_0xcffd('0x2b')](handleError(_0x3e0afc,null));};exports[_0xcffd('0x58')]=function(_0x2ab13d,_0x3091c1){return db[_0xcffd('0x3b')]['describe']()[_0xcffd('0x20')](respondWithResult(_0x3091c1,null))[_0xcffd('0x2b')](handleError(_0x3091c1,null));};var interaction_log=require(_0xcffd('0x12'))('sms-interactions');exports['accept']=function(_0x41636b,_0x96d750,_0xd4aaf5){var _0x31dd66={'channel':'sms'};if(_0x41636b[_0xcffd('0x56')]['id']){delete _0x41636b[_0xcffd('0x56')]['id'];}_0x41636b[_0xcffd('0x56')]['read']=!![];_0x41636b['body'][_0xcffd('0x59')]=moment()[_0xcffd('0x5a')](_0xcffd('0x5b'));_0x41636b[_0xcffd('0x56')][_0xcffd('0x5c')]=_0x41636b[_0xcffd('0x56')][_0xcffd('0x5c')]||_0x41636b['user']['id'];return db[_0xcffd('0x3b')]['find']({'where':{'id':_0x41636b['params']['id'],'UserId':null},'include':[{'model':db[_0xcffd('0x5d')],'as':'Contact'}]})[_0xcffd('0x20')](handleEntityNotFound(_0x96d750,null))[_0xcffd('0x20')](saveUpdates(_0x41636b[_0xcffd('0x56')],null))[_0xcffd('0x20')](function(_0x968bd0){if(_0x968bd0){_0x31dd66['message']=_0x968bd0[_0xcffd('0x5e')]({'plain':!![]});return db[_0xcffd('0x5f')]['find']({'where':{'id':_0x968bd0['SmsInteractionId']}});}return null;})[_0xcffd('0x20')](handleEntityNotFound(_0x96d750,null))[_0xcffd('0x20')](function(_0x3fa2d8){if(_0x3fa2d8){return _0x3fa2d8['update']({'UserId':_0x41636b[_0xcffd('0x56')][_0xcffd('0x5c')],'read1stAt':_['isNil'](_0x3fa2d8[_0xcffd('0x60')])?moment()[_0xcffd('0x5a')](_0xcffd('0x5b')):undefined});}return null;})[_0xcffd('0x20')](function(_0xb452ba){if(_0xb452ba){_0x31dd66['interaction']=_0xb452ba[_0xcffd('0x5e')]({'plain':!![]});interaction_log['info'](_0xcffd('0x61'),_0x41636b[_0xcffd('0x62')]['id'],_0x41636b['user'][_0xcffd('0x39')],_0x41636b[_0xcffd('0x62')][_0xcffd('0x63')],_0x31dd66[_0xcffd('0x64')]['id'],_0x41636b[_0xcffd('0x56')]?JSON['stringify'](_0x41636b[_0xcffd('0x56')]):_0xcffd('0x65'));return respondWithRpcPromise(_0xcffd('0x66'),_0xcffd('0x67'),_0x31dd66);}return null;})[_0xcffd('0x20')](function(_0x3ef555){if(_0x3ef555){if(_0x41636b[_0xcffd('0x56')][_0xcffd('0x68')]){_0x31dd66[_0xcffd('0x29')][_0xcffd('0x69')]=util[_0xcffd('0x5a')](_0xcffd('0x6a'),_0x41636b[_0xcffd('0x62')][_0xcffd('0x39')]);_0x31dd66['message']['channel']=_0x31dd66['channel'];_0x31dd66[_0xcffd('0x29')]['event']=_0xcffd('0x6b');return respondWithRpcPromise(_0xcffd('0x6c'),_0xcffd('0x6c'),{'event':_0xcffd('0x6d'),'message':_0x31dd66[_0xcffd('0x29')]},client9002)[_0xcffd('0x20')](function(){return _0x31dd66;});}return _0x31dd66;}return null;})[_0xcffd('0x20')](respondWithResult(_0x96d750,null))[_0xcffd('0x2b')](handleError(_0x96d750,null));};var interaction_log=require(_0xcffd('0x12'))(_0xcffd('0x6e'));exports[_0xcffd('0x33')]=function(_0xdbdd76,_0x164506,_0x4c241e){var _0x495c81={'agent':{},'channel':'sms'};if(_0xdbdd76['body']['id']){delete _0xdbdd76[_0xcffd('0x56')]['id'];}_0xdbdd76[_0xcffd('0x56')][_0xcffd('0x5c')]=_0xdbdd76[_0xcffd('0x56')]['UserId']||_0xdbdd76[_0xcffd('0x62')]['id'];_0x495c81['agent']['id']=_0xdbdd76[_0xcffd('0x56')][_0xcffd('0x5c')];return db[_0xcffd('0x3b')][_0xcffd('0x57')]({'where':{'id':_0xdbdd76['params']['id'],'UserId':null}})[_0xcffd('0x20')](handleEntityNotFound(_0x164506,null))[_0xcffd('0x20')](function(_0x25e38b){if(_0x25e38b){_0x495c81[_0xcffd('0x29')]=_0x25e38b[_0xcffd('0x5e')]({'plain':!![]});return db[_0xcffd('0x5f')][_0xcffd('0x57')]({'where':{'id':_0x25e38b[_0xcffd('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0x164506,null))[_0xcffd('0x20')](function(_0x492815){if(_0x492815){_0x495c81['interaction']=_0x492815[_0xcffd('0x5e')]({'plain':!![]});interaction_log['info'](_0xcffd('0x70'),_0xdbdd76[_0xcffd('0x62')]['id'],_0xdbdd76['user'][_0xcffd('0x39')],_0xdbdd76[_0xcffd('0x62')][_0xcffd('0x63')],_0x495c81[_0xcffd('0x64')]['id'],_0xdbdd76[_0xcffd('0x56')]?JSON[_0xcffd('0x26')](_0xdbdd76[_0xcffd('0x56')]):'null');return respondWithRpcPromise(_0xcffd('0x71'),_0xcffd('0x72'),_0x495c81);}return null;})[_0xcffd('0x20')](function(_0x143b36){if(_0x143b36){_0x143b36['message'][_0xcffd('0x69')]=util[_0xcffd('0x5a')](_0xcffd('0x6a'),_0xdbdd76[_0xcffd('0x62')][_0xcffd('0x39')]);_0x143b36[_0xcffd('0x29')][_0xcffd('0x73')]=_0x495c81['channel'];_0x143b36[_0xcffd('0x29')][_0xcffd('0x74')]=_0xcffd('0x33');respondWithRpcPromise(_0xcffd('0x6c'),_0xcffd('0x6c'),{'event':_0xcffd('0x75'),'message':_0x143b36[_0xcffd('0x29')]},client9002);return _0x495c81;}return null;})[_0xcffd('0x20')](respondWithResult(_0x164506,null))[_0xcffd('0x2b')](handleError(_0x164506,null));};exports[_0xcffd('0x2c')]=function(_0x3425ef,_0x9f5d11,_0x50b0b5){if(_0x3425ef[_0xcffd('0x56')]['id']){delete _0x3425ef['body']['id'];}var _0x4bf5a2;return db['SmsMessage']['find']({'where':{'id':_0x3425ef[_0xcffd('0x53')]['id']}})[_0xcffd('0x20')](handleEntityNotFound(_0x9f5d11,null))[_0xcffd('0x20')](function(_0x4b7f9e){if(_0x4b7f9e){_0x4bf5a2=_0x4b7f9e;return db[_0xcffd('0x76')][_0xcffd('0x57')]({'where':{'id':_0x4b7f9e[_0xcffd('0x77')]}});}})[_0xcffd('0x20')](handleEntityNotFound(_0x9f5d11,null))['then'](function(_0x1f9a45){if(_0x1f9a45){logger[_0xcffd('0x24')](_0xcffd('0x25'),_0xcffd('0x2c'),'received\x20delivery\x20report\x20from',_0x1f9a45[_0xcffd('0x4a')],util[_0xcffd('0x78')](_0x3425ef[_0xcffd('0x56')],{'showHidden':![],'depth':null}));switch(_0x1f9a45[_0xcffd('0x4a')]){case _0xcffd('0x79'):if(_0x3425ef['body']['MessageSid']&&_0x3425ef[_0xcffd('0x56')][_0xcffd('0x7a')]===_0x4bf5a2[_0xcffd('0x7b')]){return _0x4bf5a2[_0xcffd('0x7c')]({'read':!![]});}else{logger[_0xcffd('0x27')](_0xcffd('0x7d'),_0xcffd('0x2c'),_0xcffd('0x79'),util[_0xcffd('0x78')](_0x3425ef[_0xcffd('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3425ef[_0xcffd('0x56')][_0xcffd('0x7e')]&&_0x3425ef[_0xcffd('0x56')][_0xcffd('0x7e')]===_0x4bf5a2[_0xcffd('0x7b')]&&_['indexOf'](['sent',_0xcffd('0x7f')],_0x3425ef['body'][_0xcffd('0x80')])>=0x0){return _0x4bf5a2['update']({'read':!![]});}else{logger[_0xcffd('0x27')](_0xcffd('0x7d'),_0xcffd('0x2c'),_0xcffd('0x81'),util[_0xcffd('0x78')](_0x3425ef['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5e2990=_0x3425ef[_0xcffd('0x56')][_0xcffd('0x82')][0x0];if(_0x5e2990['status']['groupName']==='DELIVERED'){return _0x4bf5a2['update']({'read':!![]});}else{logger['error'](_0xcffd('0x7d'),_0xcffd('0x2c'),'infobip',util['inspect'](_0x3425ef[_0xcffd('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4bf5a2;}})[_0xcffd('0x20')](respondWithResult(_0x9f5d11,null))['catch'](handleError(_0x9f5d11,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4d54b75..b52d32d 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 _0x4213=['../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x41376e,_0x3b1ae6){var _0x2a5c67=function(_0x403074){while(--_0x403074){_0x41376e['push'](_0x41376e['shift']());}};_0x2a5c67(++_0x3b1ae6);}(_0x4213,0x77));var _0x3421=function(_0x2f04fa,_0x291fd0){_0x2f04fa=_0x2f04fa-0x0;var _0x404717=_0x4213[_0x2f04fa];return _0x404717;};'use strict';var EventEmitter=require(_0x3421('0x0'));var SmsMessage=require(_0x3421('0x1'))['db'][_0x3421('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3421('0x3')](0x0);var events={'afterCreate':_0x3421('0x4'),'afterUpdate':_0x3421('0x5'),'afterDestroy':_0x3421('0x6')};function emitEvent(_0x5a303d){return function(_0xdbd54e,_0x5c3719,_0x459c5e){SmsMessageEvents[_0x3421('0x7')](_0x5a303d+':'+_0xdbd54e['id'],_0xdbd54e);SmsMessageEvents[_0x3421('0x7')](_0x5a303d,_0xdbd54e);_0x459c5e(null);};}for(var e in events){if(events[_0x3421('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x3421('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xa699=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x11c0cb,_0x4476aa){var _0x3dbf20=function(_0x58f366){while(--_0x58f366){_0x11c0cb['push'](_0x11c0cb['shift']());}};_0x3dbf20(++_0x4476aa);}(_0xa699,0x6b));var _0x9a69=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0xa699[_0x5093e9];return _0x4c9a22;};'use strict';var EventEmitter=require(_0x9a69('0x0'));var SmsMessage=require(_0x9a69('0x1'))['db'][_0x9a69('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9a69('0x3')](0x0);var events={'afterCreate':_0x9a69('0x4'),'afterUpdate':_0x9a69('0x5'),'afterDestroy':_0x9a69('0x6')};function emitEvent(_0x2d3e1f){return function(_0xadacc9,_0x3edccc,_0x143c4f){SmsMessageEvents[_0x9a69('0x7')](_0x2d3e1f+':'+_0xadacc9['id'],_0xadacc9);SmsMessageEvents[_0x9a69('0x7')](_0x2d3e1f,_0xadacc9);_0x143c4f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x9a69('0x8')](e,emitEvent(event));}}module[_0x9a69('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 91ff72c..6d998cd 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 _0xa12a=['models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','then','createdAt','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','/api/sms/messages/','/status?token=','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','http_code','data','queued_count','head','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','md5','hex','signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','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','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT'];(function(_0xa4b885,_0x1e725a){var _0x2be448=function(_0x57cacb){while(--_0x57cacb){_0xa4b885['push'](_0xa4b885['shift']());}};_0x2be448(++_0x1e725a);}(_0xa12a,0x147));var _0xaa12=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa12a[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xaa12('0x0'));var util=require(_0xaa12('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa12('0x2'));var BPromise=require(_0xaa12('0x3'));var rp=require(_0xaa12('0x4'));var fs=require('fs');var path=require(_0xaa12('0x5'));var rimraf=require(_0xaa12('0x6'));var config=require(_0xaa12('0x7'));var attributes=require(_0xaa12('0x8'));module['exports']=function(_0x385c61,_0x32bdc3){return _0x385c61[_0xaa12('0x9')](_0xaa12('0xa'),attributes,{'tableName':_0xaa12('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xaa12('0xc')]},{'name':_0xaa12('0xd'),'fields':['body'],'type':_0xaa12('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4db38e,_0x1d27f8,_0x113952){var _0x5394ee=_0x385c61[_0xaa12('0xf')];var _0x3e437f=_0x4db38e[_0xaa12('0x10')]({'plain':!![]});if(_0x3e437f[_0xaa12('0x11')]['toLowerCase']()==='in'||_0x3e437f['direction'][_0xaa12('0x12')]()==='out'&&!_0x3e437f[_0xaa12('0x13')]&&!_[_0xaa12('0x14')](_0x3e437f[_0xaa12('0x15')])){_0x5394ee[_0xaa12('0x16')]['findOne']({'where':{'id':_0x3e437f['SmsInteractionId']}})[_0xaa12('0x17')](function(_0x2b0b0d){if(_0x2b0b0d){_0x2b0b0d['update']({'lastMsgAt':_0x3e437f[_0xaa12('0x18')],'lastMsgDirection':_0x3e437f[_0xaa12('0x11')][_0xaa12('0x12')]()});}})['catch'](function(_0x39e7ff){console[_0xaa12('0x19')](_0x39e7ff);});}if(_0x3e437f[_0xaa12('0x11')]==='out'&&!_0x3e437f[_0xaa12('0x13')]){var _0xd36092;_0x5394ee[_0xaa12('0x1a')][_0xaa12('0x1b')]({'where':{'id':_0x3e437f[_0xaa12('0x1c')]},'raw':!![]})['then'](function(_0x3e87d5){_0xd36092=_0x3e87d5;if(_0xd36092&&_0xd36092[_0xaa12('0x1d')]){switch(_0xd36092[_0xaa12('0x1d')]){case _0xaa12('0x1e'):var _0x371310=require(_0xaa12('0x1e'));if(_0xd36092[_0xaa12('0x1f')]&&_0xd36092[_0xaa12('0x20')]&&_0xd36092[_0xaa12('0x21')]){var _0x37ce0c=new _0x371310(_0xd36092[_0xaa12('0x1f')],_0xd36092[_0xaa12('0x20')]);_0x37ce0c[_0xaa12('0x22')][_0xaa12('0x23')]({'body':_0x3e437f[_0xaa12('0x24')],'to':_0x3e437f[_0xaa12('0x21')],'from':_0xd36092['phone'],'statusCallback':_0xd36092['remote']+_0xaa12('0x25')+_0x3e437f['id']+_0xaa12('0x26')+_0xd36092[_0xaa12('0x27')]})['then'](function(_0x415e04){if(_0x415e04[_0xaa12('0x28')]){return _0x4db38e[_0xaa12('0x29')]({'messageId':_0x415e04['sid']});}})[_0xaa12('0x2a')](function(_0x952b7d){logger['error'](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x1e'),util['inspect'](_0x952b7d,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa12('0x2c'),_0xaa12('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xaa12('0x2d'):var _0x1738d5=_0xaa12('0x2e');if(_0xd36092[_0xaa12('0x2f')]&&_0xd36092[_0xaa12('0x30')]){var _0x44e0e9={'recipient':[_0x3e437f[_0xaa12('0x21')]],'message':_0x3e437f[_0xaa12('0x24')],'message_type':_0xd36092[_0xaa12('0x31')]};if(_0xd36092[_0xaa12('0x31')]&&_0xd36092['smsMethod']!=='SI'){_0x44e0e9[_0xaa12('0x32')]=_0xd36092[_0xaa12('0x21')];}var _0x3b4081={'url':_0x1738d5+'login?username='+_0xd36092[_0xaa12('0x2f')]+'&password='+_0xd36092[_0xaa12('0x30')],'method':'GET'};rp(_0x3b4081)['then'](function(_0xbf0747){var _0x2c2f1c=_0xbf0747[_0xaa12('0x33')](';');var _0x5be384={'user_key':_0x2c2f1c[0x0],'session_key':_0x2c2f1c[0x1]};_0x3b4081={'url':_0x1738d5+_0xaa12('0x34'),'method':'POST','headers':{'user_key':_0x5be384[_0xaa12('0x35')],'Session_key':_0x5be384[_0xaa12('0x36')]},'json':!![],'body':_0x44e0e9};return rp(_0x3b4081);})['then'](function(_0x5c5e5a){if(_0x5c5e5a[_0xaa12('0x37')]>=0x1){var _0x1df954={'messageId':_0x5c5e5a[_0xaa12('0x38')]};if(_0xd36092[_0xaa12('0x31')]!=='GP'||!_0xd36092[_0xaa12('0x39')]){_0x1df954['read']=!![];}return _0x4db38e['update'](_0x1df954);}else{return logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x2d'),util[_0xaa12('0x3a')](_0x5c5e5a,{'showHidden':![],'depth':null}));}})[_0xaa12('0x2a')](function(_0x3c4988){return logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x2d'),util['inspect'](_0x3c4988,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x2d'),_0xaa12('0x3b'));}break;case _0xaa12('0x3c'):if(_0xd36092[_0xaa12('0x20')]){var _0x15a542={'recipient':_0x3e437f[_0xaa12('0x21')],'message':_0x3e437f[_0xaa12('0x24')],'sender':_0xd36092[_0xaa12('0x3d')]||_0xd36092[_0xaa12('0x21')],'authorization':_0xd36092['authToken']};var _0x1d27f8={'method':_0xaa12('0x3e'),'uri':_0xaa12('0x3f'),'body':_0x15a542,'json':!![]};rp(_0x1d27f8)[_0xaa12('0x17')](function(_0x1caa39){var _0x50eb5c={'messageId':_0x1caa39[_0xaa12('0x40')]};if(!_0xd36092[_0xaa12('0x39')]){_0x50eb5c[_0xaa12('0x41')]=!![];}return _0x4db38e[_0xaa12('0x29')](_0x50eb5c);})[_0xaa12('0x2a')](function(_0x4c5cdf){logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x3c'),util[_0xaa12('0x3a')](_0x4c5cdf,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaa12('0x3c'),_0xaa12('0x42'));}break;case _0xaa12('0x43'):if(_0xd36092[_0xaa12('0x2f')]&&_0xd36092[_0xaa12('0x30')]){var _0x15a542={'messages':[{'source':'xCALLY\x20Motion','to':_0x3e437f['phone'],'body':_0x3e437f[_0xaa12('0x24')],'from':_0xd36092[_0xaa12('0x3d')]||_0xd36092[_0xaa12('0x21')]}]};var _0x34320a=util[_0xaa12('0x44')](_0xaa12('0x45'),_0xd36092[_0xaa12('0x2f')],_0xd36092[_0xaa12('0x30')]);var _0x1d27f8={'method':_0xaa12('0x3e'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x15a542,'headers':{'Authorization':util[_0xaa12('0x44')](_0xaa12('0x46'),new Buffer(_0x34320a)['toString']('base64'))},'json':!![]};rp(_0x1d27f8)[_0xaa12('0x17')](function(_0x2b4471){if(_0x2b4471[_0xaa12('0x47')]>=0xc8&&_0x2b4471['http_code']<=0xce){if(_0x2b4471[_0xaa12('0x48')]&&_0x2b4471[_0xaa12('0x48')][_0xaa12('0x49')]>0x0){var _0x3fa94d=_[_0xaa12('0x4a')](_0x2b4471[_0xaa12('0x48')][_0xaa12('0x22')]);var _0x574a0f={'messageId':_0x3fa94d['message_id']};if(!_0xd36092[_0xaa12('0x39')]){_0x574a0f['read']=!![];}return _0x4db38e[_0xaa12('0x29')](_0x574a0f);}else{logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x4b'),util[_0xaa12('0x3a')](_0x2b4471,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa12('0x2c'),_0xaa12('0x4b'),util[_0xaa12('0x3a')](_0x2b4471,{'showHidden':![],'depth':null}));}})[_0xaa12('0x2a')](function(_0x34a179){logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),'clickSend',util[_0xaa12('0x3a')](_0x34a179,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x4b'),_0xaa12('0x3b'));}break;case'plivo':if(_0xd36092[_0xaa12('0x4c')]&&_0xd36092[_0xaa12('0x20')]){var _0x15a542={'dst':_0x3e437f['phone'],'text':_0x3e437f[_0xaa12('0x24')],'src':_0xd36092[_0xaa12('0x3d')]||_0xd36092[_0xaa12('0x21')],'url':_0xd36092['remote']+_0xaa12('0x25')+_0x3e437f['id']+'/status?token='+_0xd36092['token']};var _0x34320a=util[_0xaa12('0x44')](_0xaa12('0x45'),_0xd36092[_0xaa12('0x4c')],_0xd36092['authToken']);var _0x1d27f8={'method':_0xaa12('0x3e'),'uri':util['format'](_0xaa12('0x4d'),_0xd36092[_0xaa12('0x4c')]),'body':_0x15a542,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x34320a)[_0xaa12('0x4e')]('base64'))},'json':!![]};rp(_0x1d27f8)[_0xaa12('0x17')](function(_0x4d73f7){var _0x521b3e={'messageId':_0x4d73f7[_0xaa12('0x4f')][0x0]};return _0x4db38e[_0xaa12('0x29')](_0x521b3e);})['catch'](function(_0x5cdd0a){logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x50'),util['inspect'](_0x5cdd0a,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa12('0x2c'),_0xaa12('0x50'),_0xaa12('0x51'));}break;case _0xaa12('0x52'):if(_0xd36092[_0xaa12('0x2f')]&&_0xd36092[_0xaa12('0x30')]){if(_0xd36092[_0xaa12('0x53')]){var _0x11b3d5={'method':_0xaa12('0x3e'),'uri':_0xd36092[_0xaa12('0x53')]+_0xaa12('0x54'),'body':{'username':_0xd36092[_0xaa12('0x2f')],'password':_0xd36092['password']},'json':!![]};return rp(_0x11b3d5)[_0xaa12('0x17')](function(_0x55e9a4){var _0x58e89d={'method':_0xaa12('0x3e'),'uri':_0xd36092[_0xaa12('0x53')]+_0xaa12('0x55'),'body':{'messages':[{'from':_0xd36092[_0xaa12('0x21')],'destinations':[{'to':_0x3e437f[_0xaa12('0x21')]}],'text':_0x3e437f[_0xaa12('0x24')],'notifyUrl':_0xd36092['remote']+_0xaa12('0x25')+_0x3e437f['id']+_0xaa12('0x26')+_0xd36092['token'],'notifyContentType':_0xaa12('0x56'),'callbackData':_0xd36092[_0xaa12('0x21')]+';'+_0x3e437f[_0xaa12('0x24')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x55e9a4[_0xaa12('0x27')]},'json':!![]};return rp(_0x58e89d)[_0xaa12('0x17')](function(_0x4ae895){if(_0x4ae895[_0xaa12('0x22')]){var _0x4dae9a={'messageId':_0x4ae895[_0xaa12('0x22')][0x0][_0xaa12('0xc')]};if(!_0xd36092[_0xaa12('0x39')]){_0x4dae9a[_0xaa12('0x41')]=!![];}return _0x4db38e[_0xaa12('0x29')](_0x4dae9a);}else{return logger[_0xaa12('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaa12('0x52'),util[_0xaa12('0x3a')](_0x4ae895,{'showHidden':![],'depth':null}));}});})[_0xaa12('0x2a')](function(_0x30beb3){return logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x52'),util[_0xaa12('0x3a')](_0x30beb3,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x52'),_0xaa12('0x57'));}}else{logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x52'),_0xaa12('0x3b'));}break;case _0xaa12('0x58'):var _0x4a148f=require(_0xaa12('0x59'));if(_0xd36092[_0xaa12('0x5a')]){var _0x533470={};_0x533470[_0xaa12('0x5b')]=_0xd36092[_0xaa12('0x2f')];_0x533470[_0xaa12('0x21')]=_0x3e437f[_0xaa12('0x21')];_0x533470['sender']=_0xd36092[_0xaa12('0x21')];_0x533470[_0xaa12('0x5c')]=_0x3e437f[_0xaa12('0x24')];_0x533470[_0xaa12('0x5d')]=+new Date();var _0x19327a='';var _0x39aedd='';var _0x554377=Object[_0xaa12('0x5e')](_0x533470);_0x554377['sort']();for(var _0x3d7204=0x0;_0x3d7204<_0x554377[_0xaa12('0x5f')];_0x3d7204++){if(_0x19327a!=''){_0x19327a+='&';}_0x19327a+=_0x554377[_0x3d7204]+'='+encodeURIComponent(_0x533470[_0x554377[_0x3d7204]]);_0x39aedd+=_0x533470[_0x554377[_0x3d7204]];}_0x39aedd+=_0xd36092[_0xaa12('0x5a')];_0x39aedd=_0x4a148f['createHash'](_0xaa12('0x60'))['update'](_0x39aedd)['digest'](_0xaa12('0x61'));if(_0x19327a!==''){_0x19327a+='&';}_0x19327a+=_0xaa12('0x62')+_0x39aedd;var _0x3b4081={'method':_0xaa12('0x63'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x19327a,'json':!![]};return rp(_0x3b4081)[_0xaa12('0x17')](function(_0x5ae204){var _0x1ef0ca=Object[_0xaa12('0x5e')](_0x5ae204);if(_0x5ae204[_0x1ef0ca[0x0]][_0xaa12('0x19')]&&parseInt(_0x5ae204[_0x1ef0ca[0x0]][_0xaa12('0x19')])===0x0){var _0x23aed7={'messageId':_0x5ae204[_0x1ef0ca[0x0]][_0xaa12('0x64')]};if(!_0xd36092['deliveryReport']){_0x23aed7[_0xaa12('0x41')]=!![];}return _0x4db38e[_0xaa12('0x29')](_0x23aed7);}else{return logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x58'),util[_0xaa12('0x3a')](_0x5ae204[_0xaa12('0x19')],{'showHidden':![],'depth':null}));}})[_0xaa12('0x2a')](function(_0x5e30de){return logger[_0xaa12('0x19')](_0xaa12('0x2b'),'afterCreate',_0xaa12('0x58'),util[_0xaa12('0x3a')](_0x5e30de,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x58'),_0xaa12('0x65'));}break;case _0xaa12('0x66'):if(_0xd36092['apiKey']){var _0x2ae714={'method':_0xaa12('0x3e'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xd36092[_0xaa12('0x5a')]},'body':{'content':_0x3e437f[_0xaa12('0x24')],'to':[_0x3e437f[_0xaa12('0x21')]],'from':_0xd36092[_0xaa12('0x21')],'binary':![],'clientMessageId':_0xaa12('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x2ae714)[_0xaa12('0x17')](function(_0x44d4f7){if(!_0x44d4f7[_0xaa12('0x19')]){var _0x219ff2={'messageId':_0x44d4f7[_0xaa12('0x22')][0x0]['apiMessageId']};if(!_0xd36092[_0xaa12('0x39')]){_0x219ff2[_0xaa12('0x41')]=!![];}return _0x4db38e[_0xaa12('0x29')](_0x219ff2);}else{return logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),'clickatell',util[_0xaa12('0x3a')](_0x44d4f7[_0xaa12('0x19')],{'showHidden':![],'depth':null}));}})[_0xaa12('0x2a')](function(_0x2f9b5b){return logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x66'),util[_0xaa12('0x3a')](_0x2f9b5b,{'showHidden':![],'depth':null}));});}else{logger[_0xaa12('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa12('0x2c'),'clickatell',_0xaa12('0x65'));}break;case _0xaa12('0x68'):if(_0xd36092[_0xaa12('0x5a')]){var _0x51c3a5={};var _0x3b4081={'method':_0xaa12('0x3e'),'uri':_0xaa12('0x69'),'headers':{'Authorization':_0xaa12('0x6a')+_0xd36092[_0xaa12('0x5a')],'Content-Type':_0xaa12('0x56')},'body':{'from':_0xd36092[_0xaa12('0x21')],'to':_0x3e437f[_0xaa12('0x21')],'text':_0x3e437f[_0xaa12('0x24')]},'json':!![]};return rp(_0x3b4081)[_0xaa12('0x17')](function(_0x24abe9){if(_0x24abe9['code']==0xca){_0x51c3a5[_0xaa12('0x6b')]=_0x24abe9;var _0x102091={'method':_0xaa12('0x3e'),'uri':_0xaa12('0x6c'),'headers':{'Authorization':_0xaa12('0x6a')+_0xd36092[_0xaa12('0x5a')],'Content-Type':_0xaa12('0x56')},'body':{'refid':_0x51c3a5[_0xaa12('0x6b')][_0xaa12('0x6d')]},'json':!![]};return rp(_0x102091)[_0xaa12('0x17')](function(_0x387498){_0x51c3a5[_0xaa12('0x6e')]=_0x387498;var _0x2378e0={'messageId':_0x51c3a5[_0xaa12('0x6b')][_0xaa12('0x6d')],'read':!![]};return _0x4db38e[_0xaa12('0x29')](_0x2378e0);});}else{return logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x68'),util[_0xaa12('0x3a')](_0x24abe9,{'showHidden':![],'depth':null}));}})[_0xaa12('0x2a')](function(_0x28e773){return logger[_0xaa12('0x19')](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x68'),util[_0xaa12('0x3a')](_0x28e773,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xaa12('0x2b'),_0xaa12('0x2c'),_0xaa12('0x68'),_0xaa12('0x6f'));}break;}}})[_0xaa12('0x70')](function(){_0x113952();});}else{_0x113952();}}},'charset':'utf8mb4','collate':_0xaa12('0x71')});}; \ No newline at end of file +var _0xba53=['fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','findOne','SmsInteractionId','update','createdAt','catch','secret','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote','/api/sms/messages/','/status?token=','token','sid','error','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','password','smsMethod','sender','login?username=','username','split','sms','user_key','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','messages','read','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','message','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId'];(function(_0x1a879d,_0x1bb6d9){var _0x4885a3=function(_0xef15d5){while(--_0xef15d5){_0x1a879d['push'](_0x1a879d['shift']());}};_0x4885a3(++_0x1bb6d9);}(_0xba53,0x1da));var _0x3ba5=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xba53[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x3ba5('0x0'));var util=require(_0x3ba5('0x1'));var logger=require(_0x3ba5('0x2'))(_0x3ba5('0x3'));var moment=require(_0x3ba5('0x4'));var BPromise=require(_0x3ba5('0x5'));var rp=require(_0x3ba5('0x6'));var fs=require('fs');var path=require(_0x3ba5('0x7'));var rimraf=require(_0x3ba5('0x8'));var config=require(_0x3ba5('0x9'));var attributes=require(_0x3ba5('0xa'));module[_0x3ba5('0xb')]=function(_0x23ea4d,_0x253be9){return _0x23ea4d['define']('SmsMessage',attributes,{'tableName':_0x3ba5('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x3ba5('0xd')]},{'name':_0x3ba5('0xe'),'fields':[_0x3ba5('0xf')],'type':_0x3ba5('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24836f,_0x20bc38,_0x26dab6){var _0x2746cb=_0x23ea4d[_0x3ba5('0x11')];var _0x415443=_0x24836f[_0x3ba5('0x12')]({'plain':!![]});if(_0x415443['direction']['toLowerCase']()==='in'||_0x415443[_0x3ba5('0x13')][_0x3ba5('0x14')]()===_0x3ba5('0x15')&&!_0x415443['secret']&&!_['isNil'](_0x415443[_0x3ba5('0x16')])){_0x2746cb['SmsInteraction'][_0x3ba5('0x17')]({'where':{'id':_0x415443[_0x3ba5('0x18')]}})['then'](function(_0x308f90){if(_0x308f90){_0x308f90[_0x3ba5('0x19')]({'lastMsgAt':_0x415443[_0x3ba5('0x1a')],'lastMsgDirection':_0x415443[_0x3ba5('0x13')][_0x3ba5('0x14')]()});}})[_0x3ba5('0x1b')](function(_0x2249aa){console['error'](_0x2249aa);});}if(_0x415443['direction']===_0x3ba5('0x15')&&!_0x415443[_0x3ba5('0x1c')]){var _0x28a12f;_0x2746cb['SmsAccount'][_0x3ba5('0x1d')]({'where':{'id':_0x415443[_0x3ba5('0x1e')]},'raw':!![]})[_0x3ba5('0x1f')](function(_0x2e1ad6){_0x28a12f=_0x2e1ad6;if(_0x28a12f&&_0x28a12f[_0x3ba5('0x20')]){switch(_0x28a12f['type']){case _0x3ba5('0x21'):var _0x28a7f2=require('twilio');if(_0x28a12f[_0x3ba5('0x22')]&&_0x28a12f['authToken']&&_0x28a12f[_0x3ba5('0x23')]){var _0x3fcbc9=new _0x28a7f2(_0x28a12f['accountSid'],_0x28a12f[_0x3ba5('0x24')]);_0x3fcbc9['messages'][_0x3ba5('0x25')]({'body':_0x415443['body'],'to':_0x415443[_0x3ba5('0x23')],'from':_0x28a12f[_0x3ba5('0x23')],'statusCallback':_0x28a12f[_0x3ba5('0x26')]+_0x3ba5('0x27')+_0x415443['id']+_0x3ba5('0x28')+_0x28a12f[_0x3ba5('0x29')]})[_0x3ba5('0x1f')](function(_0x219a7e){if(_0x219a7e[_0x3ba5('0x2a')]){return _0x24836f['update']({'messageId':_0x219a7e[_0x3ba5('0x2a')]});}})['catch'](function(_0x384e75){logger[_0x3ba5('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ba5('0x21'),util[_0x3ba5('0x2c')](_0x384e75,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x3ba5('0x2f'):var _0x103e89='https://api.skebby.it/API/v1.0/REST/';if(_0x28a12f['username']&&_0x28a12f[_0x3ba5('0x30')]){var _0x4801d4={'recipient':[_0x415443[_0x3ba5('0x23')]],'message':_0x415443[_0x3ba5('0xf')],'message_type':_0x28a12f['smsMethod']};if(_0x28a12f[_0x3ba5('0x31')]&&_0x28a12f[_0x3ba5('0x31')]!=='SI'){_0x4801d4[_0x3ba5('0x32')]=_0x28a12f['phone'];}var _0x1af3da={'url':_0x103e89+_0x3ba5('0x33')+_0x28a12f[_0x3ba5('0x34')]+'&password='+_0x28a12f[_0x3ba5('0x30')],'method':'GET'};rp(_0x1af3da)['then'](function(_0x3eb544){var _0x2c3784=_0x3eb544[_0x3ba5('0x35')](';');var _0x1974cd={'user_key':_0x2c3784[0x0],'session_key':_0x2c3784[0x1]};_0x1af3da={'url':_0x103e89+_0x3ba5('0x36'),'method':'POST','headers':{'user_key':_0x1974cd[_0x3ba5('0x37')],'Session_key':_0x1974cd['session_key']},'json':!![],'body':_0x4801d4};return rp(_0x1af3da);})[_0x3ba5('0x1f')](function(_0x39b18b){if(_0x39b18b['total_sent']>=0x1){var _0x46af4c={'messageId':_0x39b18b['internal_order_id']};if(_0x28a12f[_0x3ba5('0x31')]!=='GP'||!_0x28a12f[_0x3ba5('0x38')]){_0x46af4c['read']=!![];}return _0x24836f[_0x3ba5('0x19')](_0x46af4c);}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x2f'),util[_0x3ba5('0x2c')](_0x39b18b,{'showHidden':![],'depth':null}));}})[_0x3ba5('0x1b')](function(_0x556150){return logger['error'](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x2f'),util['inspect'](_0x556150,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ba5('0x2e'),_0x3ba5('0x2f'),_0x3ba5('0x39'));}break;case _0x3ba5('0x3a'):if(_0x28a12f[_0x3ba5('0x24')]){var _0x515c86={'recipient':_0x415443[_0x3ba5('0x23')],'message':_0x415443[_0x3ba5('0xf')],'sender':_0x28a12f[_0x3ba5('0x3b')]||_0x28a12f[_0x3ba5('0x23')],'authorization':_0x28a12f[_0x3ba5('0x24')]};var _0x20bc38={'method':_0x3ba5('0x3c'),'uri':_0x3ba5('0x3d'),'body':_0x515c86,'json':!![]};rp(_0x20bc38)['then'](function(_0x4e922c){var _0x37eb1d={'messageId':_0x4e922c[_0x3ba5('0x3e')]};if(!_0x28a12f['deliveryReport']){_0x37eb1d['read']=!![];}return _0x24836f[_0x3ba5('0x19')](_0x37eb1d);})[_0x3ba5('0x1b')](function(_0x164869){logger['error'](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x3a'),util[_0x3ba5('0x2c')](_0x164869,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),'connectel',_0x3ba5('0x3f'));}break;case _0x3ba5('0x40'):if(_0x28a12f['username']&&_0x28a12f['password']){var _0x515c86={'messages':[{'source':'xCALLY\x20Motion','to':_0x415443['phone'],'body':_0x415443['body'],'from':_0x28a12f[_0x3ba5('0x3b')]||_0x28a12f[_0x3ba5('0x23')]}]};var _0x26ecd1=util[_0x3ba5('0x41')](_0x3ba5('0x42'),_0x28a12f[_0x3ba5('0x34')],_0x28a12f[_0x3ba5('0x30')]);var _0x20bc38={'method':_0x3ba5('0x3c'),'uri':_0x3ba5('0x43'),'body':_0x515c86,'headers':{'Authorization':util[_0x3ba5('0x41')]('Basic\x20%s',new Buffer(_0x26ecd1)['toString'](_0x3ba5('0x44')))},'json':!![]};rp(_0x20bc38)['then'](function(_0x1b882e){if(_0x1b882e[_0x3ba5('0x45')]>=0xc8&&_0x1b882e[_0x3ba5('0x45')]<=0xce){if(_0x1b882e['data']&&_0x1b882e[_0x3ba5('0x46')][_0x3ba5('0x47')]>0x0){var _0x522ee9=_[_0x3ba5('0x48')](_0x1b882e['data'][_0x3ba5('0x49')]);var _0x4f5335={'messageId':_0x522ee9['message_id']};if(!_0x28a12f['deliveryReport']){_0x4f5335[_0x3ba5('0x4a')]=!![];}return _0x24836f[_0x3ba5('0x19')](_0x4f5335);}else{logger[_0x3ba5('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ba5('0x2e'),'clickSend',util[_0x3ba5('0x2c')](_0x1b882e,{'showHidden':![],'depth':null}));}}else{logger[_0x3ba5('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ba5('0x2e'),'clickSend',util[_0x3ba5('0x2c')](_0x1b882e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x573890){logger['error'](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x4b'),util[_0x3ba5('0x2c')](_0x573890,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),'afterCreate','clickSend',_0x3ba5('0x39'));}break;case _0x3ba5('0x4c'):if(_0x28a12f[_0x3ba5('0x4d')]&&_0x28a12f[_0x3ba5('0x24')]){var _0x515c86={'dst':_0x415443['phone'],'text':_0x415443['body'],'src':_0x28a12f[_0x3ba5('0x3b')]||_0x28a12f[_0x3ba5('0x23')],'url':_0x28a12f['remote']+_0x3ba5('0x27')+_0x415443['id']+_0x3ba5('0x28')+_0x28a12f[_0x3ba5('0x29')]};var _0x26ecd1=util['format']('%s:%s',_0x28a12f[_0x3ba5('0x4d')],_0x28a12f[_0x3ba5('0x24')]);var _0x20bc38={'method':_0x3ba5('0x3c'),'uri':util[_0x3ba5('0x41')](_0x3ba5('0x4e'),_0x28a12f[_0x3ba5('0x4d')]),'body':_0x515c86,'headers':{'Authorization':util[_0x3ba5('0x41')](_0x3ba5('0x4f'),new Buffer(_0x26ecd1)[_0x3ba5('0x50')](_0x3ba5('0x44')))},'json':!![]};rp(_0x20bc38)[_0x3ba5('0x1f')](function(_0x378c1d){var _0x3f46d3={'messageId':_0x378c1d[_0x3ba5('0x51')][0x0]};return _0x24836f['update'](_0x3f46d3);})[_0x3ba5('0x1b')](function(_0x59bc4c){logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),'afterCreate',_0x3ba5('0x4c'),util[_0x3ba5('0x2c')](_0x59bc4c,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x4c'),_0x3ba5('0x52'));}break;case _0x3ba5('0x53'):if(_0x28a12f['username']&&_0x28a12f[_0x3ba5('0x30')]){if(_0x28a12f[_0x3ba5('0x54')]){var _0x1ec422={'method':_0x3ba5('0x3c'),'uri':_0x28a12f[_0x3ba5('0x54')]+_0x3ba5('0x55'),'body':{'username':_0x28a12f['username'],'password':_0x28a12f[_0x3ba5('0x30')]},'json':!![]};return rp(_0x1ec422)[_0x3ba5('0x1f')](function(_0x4fd315){var _0x384f76={'method':_0x3ba5('0x3c'),'uri':_0x28a12f[_0x3ba5('0x54')]+_0x3ba5('0x56'),'body':{'messages':[{'from':_0x28a12f['phone'],'destinations':[{'to':_0x415443[_0x3ba5('0x23')]}],'text':_0x415443[_0x3ba5('0xf')],'notifyUrl':_0x28a12f[_0x3ba5('0x26')]+_0x3ba5('0x27')+_0x415443['id']+_0x3ba5('0x28')+_0x28a12f[_0x3ba5('0x29')],'notifyContentType':_0x3ba5('0x57'),'callbackData':_0x28a12f[_0x3ba5('0x23')]+';'+_0x415443[_0x3ba5('0xf')]}]},'headers':{'Authorization':_0x3ba5('0x58')+_0x4fd315[_0x3ba5('0x29')]},'json':!![]};return rp(_0x384f76)['then'](function(_0x5203be){if(_0x5203be[_0x3ba5('0x49')]){var _0x241380={'messageId':_0x5203be['messages'][0x0]['messageId']};if(!_0x28a12f[_0x3ba5('0x38')]){_0x241380[_0x3ba5('0x4a')]=!![];}return _0x24836f[_0x3ba5('0x19')](_0x241380);}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x53'),util['inspect'](_0x5203be,{'showHidden':![],'depth':null}));}});})[_0x3ba5('0x1b')](function(_0x4534a0){return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),'infobip',util[_0x3ba5('0x2c')](_0x4534a0,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x53'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x3ba5('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ba5('0x2e'),_0x3ba5('0x53'),_0x3ba5('0x39'));}break;case _0x3ba5('0x59'):var _0x2f46fc=require(_0x3ba5('0x5a'));if(_0x28a12f[_0x3ba5('0x5b')]){var _0x3ad955={};_0x3ad955[_0x3ba5('0x5c')]=_0x28a12f[_0x3ba5('0x34')];_0x3ad955[_0x3ba5('0x23')]=_0x415443[_0x3ba5('0x23')];_0x3ad955[_0x3ba5('0x32')]=_0x28a12f['phone'];_0x3ad955[_0x3ba5('0x5d')]=_0x415443['body'];_0x3ad955[_0x3ba5('0x5e')]=+new Date();var _0xa114be='';var _0x483b36='';var _0x23c8c2=Object[_0x3ba5('0x5f')](_0x3ad955);_0x23c8c2[_0x3ba5('0x60')]();for(var _0x260b9e=0x0;_0x260b9e<_0x23c8c2[_0x3ba5('0x61')];_0x260b9e++){if(_0xa114be!=''){_0xa114be+='&';}_0xa114be+=_0x23c8c2[_0x260b9e]+'='+encodeURIComponent(_0x3ad955[_0x23c8c2[_0x260b9e]]);_0x483b36+=_0x3ad955[_0x23c8c2[_0x260b9e]];}_0x483b36+=_0x28a12f[_0x3ba5('0x5b')];_0x483b36=_0x2f46fc[_0x3ba5('0x62')](_0x3ba5('0x63'))[_0x3ba5('0x19')](_0x483b36)[_0x3ba5('0x64')](_0x3ba5('0x65'));if(_0xa114be!==''){_0xa114be+='&';}_0xa114be+=_0x3ba5('0x66')+_0x483b36;var _0x1af3da={'method':'GET','uri':_0x3ba5('0x67')+_0xa114be,'json':!![]};return rp(_0x1af3da)[_0x3ba5('0x1f')](function(_0x392653){var _0x100735=Object[_0x3ba5('0x5f')](_0x392653);if(_0x392653[_0x100735[0x0]][_0x3ba5('0x2b')]&&parseInt(_0x392653[_0x100735[0x0]][_0x3ba5('0x2b')])===0x0){var _0x3d8e93={'messageId':_0x392653[_0x100735[0x0]][_0x3ba5('0x68')]};if(!_0x28a12f['deliveryReport']){_0x3d8e93[_0x3ba5('0x4a')]=!![];}return _0x24836f[_0x3ba5('0x19')](_0x3d8e93);}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x59'),util[_0x3ba5('0x2c')](_0x392653['error'],{'showHidden':![],'depth':null}));}})[_0x3ba5('0x1b')](function(_0x41db6e){return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x59'),util[_0x3ba5('0x2c')](_0x41db6e,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x59'),_0x3ba5('0x69'));}break;case _0x3ba5('0x6a'):if(_0x28a12f[_0x3ba5('0x5b')]){var _0xd6a927={'method':_0x3ba5('0x3c'),'uri':_0x3ba5('0x6b'),'headers':{'Authorization':_0x28a12f['apiKey']},'body':{'content':_0x415443['body'],'to':[_0x415443[_0x3ba5('0x23')]],'from':_0x28a12f[_0x3ba5('0x23')],'binary':![],'clientMessageId':_0x3ba5('0x6c'),'charset':_0x3ba5('0x6d')},'json':!![]};rp(_0xd6a927)[_0x3ba5('0x1f')](function(_0x2b3d84){if(!_0x2b3d84[_0x3ba5('0x2b')]){var _0x41a02a={'messageId':_0x2b3d84[_0x3ba5('0x49')][0x0][_0x3ba5('0x6e')]};if(!_0x28a12f[_0x3ba5('0x38')]){_0x41a02a['read']=!![];}return _0x24836f[_0x3ba5('0x19')](_0x41a02a);}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),'afterCreate',_0x3ba5('0x6a'),util[_0x3ba5('0x2c')](_0x2b3d84['error'],{'showHidden':![],'depth':null}));}})[_0x3ba5('0x1b')](function(_0x285e8b){return logger['error'](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x6a'),util[_0x3ba5('0x2c')](_0x285e8b,{'showHidden':![],'depth':null}));});}else{logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x6a'),_0x3ba5('0x69'));}break;case _0x3ba5('0x6f'):if(_0x28a12f['apiKey']){var _0x5ec92f={};var _0x1af3da={'method':_0x3ba5('0x3c'),'uri':_0x3ba5('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x28a12f['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x28a12f[_0x3ba5('0x23')],'to':_0x415443[_0x3ba5('0x23')],'text':_0x415443[_0x3ba5('0xf')]},'json':!![]};return rp(_0x1af3da)[_0x3ba5('0x1f')](function(_0x218416){if(_0x218416[_0x3ba5('0x71')]==0xca){_0x5ec92f['message']=_0x218416;var _0x17f7bb={'method':'POST','uri':_0x3ba5('0x72'),'headers':{'Authorization':_0x3ba5('0x73')+_0x28a12f['apiKey'],'Content-Type':_0x3ba5('0x57')},'body':{'refid':_0x5ec92f['message'][_0x3ba5('0x74')]},'json':!![]};return rp(_0x17f7bb)[_0x3ba5('0x1f')](function(_0x4bef00){_0x5ec92f['status']=_0x4bef00;var _0x4be30b={'messageId':_0x5ec92f[_0x3ba5('0x75')][_0x3ba5('0x74')],'read':!![]};return _0x24836f[_0x3ba5('0x19')](_0x4be30b);});}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),'intelepeer',util['inspect'](_0x218416,{'showHidden':![],'depth':null}));}})[_0x3ba5('0x1b')](function(_0x3b0ffe){return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),_0x3ba5('0x6f'),util[_0x3ba5('0x2c')](_0x3b0ffe,{'showHidden':![],'depth':null}));});}else{return logger[_0x3ba5('0x2b')](_0x3ba5('0x2d'),_0x3ba5('0x2e'),'intelepeer',_0x3ba5('0x76'));}break;}}})[_0x3ba5('0x77')](function(){_0x26dab6();});}else{_0x26dab6();}}},'charset':_0x3ba5('0x78'),'collate':_0x3ba5('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a2a9e56..643c910 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 _0xae2e=['defaults','redis','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSmsMessage','SmsMessage','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xcd8769,_0x2887d7){var _0x19e231=function(_0x384c1b){while(--_0x384c1b){_0xcd8769['push'](_0xcd8769['shift']());}};_0x19e231(++_0x2887d7);}(_0xae2e,0x17a));var _0xeae2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xae2e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var moment=require(_0xeae2('0x2'));var BPromise=require('bluebird');var rs=require(_0xeae2('0x3'));var fs=require('fs');var Redis=require(_0xeae2('0x4'));var db=require(_0xeae2('0x5'))['db'];var utils=require(_0xeae2('0x6'));var logger=require(_0xeae2('0x7'))(_0xeae2('0x8'));var config=require(_0xeae2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeae2('0xa')][_0xeae2('0xb')]({'port':0x232a});config['redis']=_[_0xeae2('0xc')](config[_0xeae2('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeae2('0xe'))['register'](socket);function respondWithRpcPromise(_0x4eccbc,_0x4a8795,_0x383abe){return new BPromise(function(_0x1fbc26,_0x5ecf5b){return client[_0xeae2('0xf')](_0x4eccbc,_0x383abe)[_0xeae2('0x10')](function(_0x572726){logger[_0xeae2('0x11')](_0xeae2('0x12'),_0x4a8795,'request\x20sent');logger[_0xeae2('0x13')](_0xeae2('0x14'),_0x4a8795,'request\x20sent',JSON[_0xeae2('0x15')](_0x572726));if(_0x572726['error']){if(_0x572726['error']['code']===0x1f4){logger[_0xeae2('0x16')](_0xeae2('0x12'),_0x4a8795,_0x572726[_0xeae2('0x16')][_0xeae2('0x17')]);return _0x5ecf5b(_0x572726['error'][_0xeae2('0x17')]);}logger[_0xeae2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x4a8795,_0x572726[_0xeae2('0x16')][_0xeae2('0x17')]);return _0x1fbc26(_0x572726[_0xeae2('0x16')][_0xeae2('0x17')]);}else{logger['info'](_0xeae2('0x12'),_0x4a8795,_0xeae2('0x18'));_0x1fbc26(_0x572726[_0xeae2('0x19')][_0xeae2('0x17')]);}})[_0xeae2('0x1a')](function(_0x3f94d2){logger[_0xeae2('0x16')](_0xeae2('0x12'),_0x4a8795,_0x3f94d2);_0x5ecf5b(_0x3f94d2);});});}exports[_0xeae2('0x1b')]=function(_0x3e0216){var _0xc34477=this;return new Promise(function(_0x37329e,_0x239852){return db[_0xeae2('0x1c')]['create'](_0x3e0216['body'],{'raw':_0x3e0216['options']?_0x3e0216[_0xeae2('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xeae2('0x10')](function(_0x1abfe2){logger[_0xeae2('0x11')](_0xeae2('0x1b'),_0x3e0216);logger[_0xeae2('0x13')](_0xeae2('0x1b'),_0x3e0216,JSON[_0xeae2('0x15')](_0x1abfe2));_0x37329e(_0x1abfe2);})[_0xeae2('0x1a')](function(_0x488f7c){logger['error'](_0xeae2('0x1b'),_0x488f7c[_0xeae2('0x17')],_0x3e0216);_0x239852(_0xc34477[_0xeae2('0x16')](0x1f4,_0x488f7c[_0xeae2('0x17')]));});});}; \ No newline at end of file +var _0xfd55=['stringify','error','message','result','CreateSmsMessage','SmsMessage','create','body','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d94a3,_0x1f6ba1){var _0x172046=function(_0x1131c8){while(--_0x1131c8){_0x2d94a3['push'](_0x2d94a3['shift']());}};_0x172046(++_0x1f6ba1);}(_0xfd55,0x134));var _0x5fd5=function(_0x3b2f28,_0xef1370){_0x3b2f28=_0x3b2f28-0x0;var _0x192dd4=_0xfd55[_0x3b2f28];return _0x192dd4;};'use strict';var _=require(_0x5fd5('0x0'));var util=require(_0x5fd5('0x1'));var moment=require(_0x5fd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fd5('0x3'));var fs=require('fs');var Redis=require(_0x5fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fd5('0x5'));var logger=require(_0x5fd5('0x6'))(_0x5fd5('0x7'));var config=require(_0x5fd5('0x8'));var jayson=require(_0x5fd5('0x9'));var client=jayson[_0x5fd5('0xa')][_0x5fd5('0xb')]({'port':0x232a});config[_0x5fd5('0xc')]=_[_0x5fd5('0xd')](config[_0x5fd5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5fd5('0xe'))(new Redis(config[_0x5fd5('0xc')]));require(_0x5fd5('0xf'))[_0x5fd5('0x10')](socket);function respondWithRpcPromise(_0x38bb1e,_0x4f4640,_0x491855){return new BPromise(function(_0x9988cd,_0x40f167){return client['request'](_0x38bb1e,_0x491855)[_0x5fd5('0x11')](function(_0xb36c45){logger[_0x5fd5('0x12')](_0x5fd5('0x13'),_0x4f4640,_0x5fd5('0x14'));logger[_0x5fd5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f4640,_0x5fd5('0x14'),JSON[_0x5fd5('0x16')](_0xb36c45));if(_0xb36c45[_0x5fd5('0x17')]){if(_0xb36c45['error']['code']===0x1f4){logger[_0x5fd5('0x17')](_0x5fd5('0x13'),_0x4f4640,_0xb36c45[_0x5fd5('0x17')][_0x5fd5('0x18')]);return _0x40f167(_0xb36c45['error'][_0x5fd5('0x18')]);}logger[_0x5fd5('0x17')](_0x5fd5('0x13'),_0x4f4640,_0xb36c45[_0x5fd5('0x17')][_0x5fd5('0x18')]);return _0x9988cd(_0xb36c45['error'][_0x5fd5('0x18')]);}else{logger[_0x5fd5('0x12')]('SmsMessage,\x20%s,\x20%s',_0x4f4640,_0x5fd5('0x14'));_0x9988cd(_0xb36c45[_0x5fd5('0x19')][_0x5fd5('0x18')]);}})['catch'](function(_0xbe0b4d){logger['error'](_0x5fd5('0x13'),_0x4f4640,_0xbe0b4d);_0x40f167(_0xbe0b4d);});});}exports[_0x5fd5('0x1a')]=function(_0x43b47b){var _0x39a018=this;return new Promise(function(_0x5ebc38,_0x139f85){return db[_0x5fd5('0x1b')][_0x5fd5('0x1c')](_0x43b47b[_0x5fd5('0x1d')],{'raw':_0x43b47b['options']?_0x43b47b['options']['raw']===undefined?!![]:![]:!![]})[_0x5fd5('0x11')](function(_0x4ea56d){logger['info']('CreateSmsMessage',_0x43b47b);logger['debug'](_0x5fd5('0x1a'),_0x43b47b,JSON[_0x5fd5('0x16')](_0x4ea56d));_0x5ebc38(_0x4ea56d);})['catch'](function(_0x5e1a7d){logger[_0x5fd5('0x17')](_0x5fd5('0x1a'),_0x5e1a7d[_0x5fd5('0x18')],_0x43b47b);_0x139f85(_0x39a018[_0x5fd5('0x17')](0x1f4,_0x5e1a7d[_0x5fd5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9295371..ce19bd2 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 _0xecd2=['length','smsMessage:','./smsMessage.events','save','remove','emit'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0xecd2,0xe6));var _0x2ecd=function(_0x403b12,_0x656d9e){_0x403b12=_0x403b12-0x0;var _0x4f9ee6=_0xecd2[_0x403b12];return _0x4f9ee6;};'use strict';var SmsMessageEvents=require(_0x2ecd('0x0'));var events=[_0x2ecd('0x1'),_0x2ecd('0x2'),'update'];function createListener(_0x24dda8,_0x7e37f6){return function(_0x2e714c){_0x7e37f6[_0x2ecd('0x3')](_0x24dda8,_0x2e714c);};}function removeListener(_0xcff50,_0x1e1388){return function(){SmsMessageEvents['removeListener'](_0xcff50,_0x1e1388);};}exports['register']=function(_0x3fc634){for(var _0x1bc519=0x0,_0x3fc063=events[_0x2ecd('0x4')];_0x1bc519<_0x3fc063;_0x1bc519++){var _0x5532ec=events[_0x1bc519];var _0x28e7ba=createListener(_0x2ecd('0x5')+_0x5532ec,_0x3fc634);SmsMessageEvents['on'](_0x5532ec,_0x28e7ba);}}; \ No newline at end of file +var _0xdacf=['length','save','remove','update','emit','removeListener','register'];(function(_0x5c9f9e,_0x750bb0){var _0x1c957e=function(_0x488c04){while(--_0x488c04){_0x5c9f9e['push'](_0x5c9f9e['shift']());}};_0x1c957e(++_0x750bb0);}(_0xdacf,0x7f));var _0xfdac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdacf[_0x321bb2];return _0x9c12ed;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xfdac('0x0'),_0xfdac('0x1'),_0xfdac('0x2')];function createListener(_0x548cac,_0xd25e28){return function(_0x5e70b0){_0xd25e28[_0xfdac('0x3')](_0x548cac,_0x5e70b0);};}function removeListener(_0x2c17fb,_0x1f5d4b){return function(){SmsMessageEvents[_0xfdac('0x4')](_0x2c17fb,_0x1f5d4b);};}exports[_0xfdac('0x5')]=function(_0x5d8174){for(var _0x380919=0x0,_0x545bb5=events[_0xfdac('0x6')];_0x380919<_0x545bb5;_0x380919++){var _0x3a48cf=events[_0x380919];var _0x91b0b0=createListener('smsMessage:'+_0x3a48cf,_0x5d8174);SmsMessageEvents['on'](_0x3a48cf,_0x91b0b0);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 034e7d3..733e797 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 _0x2375=['removeTeams','removeAgents','exports','util','path','connect-timeout','Router','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams','addAgents','update','destroy','delete'];(function(_0x1ed779,_0x30c297){var _0x1d2375=function(_0x6d5ab5){while(--_0x6d5ab5){_0x1ed779['push'](_0x1ed779['shift']());}};_0x1d2375(++_0x30c297);}(_0x2375,0x1ac));var _0x5237=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x2375[_0x243b59];return _0x3e1676;};'use strict';var multer=require('multer');var util=require(_0x5237('0x0'));var path=require(_0x5237('0x1'));var timeout=require(_0x5237('0x2'));var express=require('express');var router=express[_0x5237('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5237('0x4'));var controller=require(_0x5237('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x5237('0x6')]);router[_0x5237('0x7')](_0x5237('0x8'),auth[_0x5237('0x9')](),controller['describe']);router['get'](_0x5237('0xa'),auth[_0x5237('0x9')](),controller[_0x5237('0xb')]);router[_0x5237('0x7')](_0x5237('0xc'),auth[_0x5237('0x9')](),controller[_0x5237('0xd')]);router[_0x5237('0x7')](_0x5237('0xe'),auth[_0x5237('0x9')](),controller[_0x5237('0xf')]);router[_0x5237('0x7')](_0x5237('0x10'),auth[_0x5237('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x5237('0x11')]);router['post']('/:id/users',auth[_0x5237('0x9')](),controller[_0x5237('0x12')]);router['put'](_0x5237('0xa'),auth[_0x5237('0x9')](),controller[_0x5237('0x13')]);router['delete'](_0x5237('0xa'),auth['isAuthenticated'](),controller[_0x5237('0x14')]);router[_0x5237('0x15')](_0x5237('0xe'),auth['isAuthenticated'](),controller[_0x5237('0x16')]);router[_0x5237('0x15')](_0x5237('0x10'),auth[_0x5237('0x9')](),controller[_0x5237('0x17')]);module[_0x5237('0x18')]=router; \ No newline at end of file +var _0xf874=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','removeTeams','delete','removeAgents','exports','util','path','express'];(function(_0x5d9b4d,_0x460bd8){var _0x493eb8=function(_0x13a234){while(--_0x13a234){_0x5d9b4d['push'](_0x5d9b4d['shift']());}};_0x493eb8(++_0x460bd8);}(_0xf874,0xa5));var _0x4f87=function(_0x18d77a,_0x3cf590){_0x18d77a=_0x18d77a-0x0;var _0x495ffd=_0xf874[_0x18d77a];return _0x495ffd;};'use strict';var multer=require('multer');var util=require(_0x4f87('0x0'));var path=require(_0x4f87('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f87('0x2'));var router=express[_0x4f87('0x3')]();var auth=require(_0x4f87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f87('0x5'));var controller=require('./smsQueue.controller');router[_0x4f87('0x6')]('/',auth[_0x4f87('0x7')](),controller[_0x4f87('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4f87('0x9')]);router[_0x4f87('0x6')](_0x4f87('0xa'),auth['isAuthenticated'](),controller[_0x4f87('0xb')]);router[_0x4f87('0x6')](_0x4f87('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x4f87('0x6')]('/:id/teams',auth[_0x4f87('0x7')](),controller[_0x4f87('0xd')]);router[_0x4f87('0x6')](_0x4f87('0xe'),auth[_0x4f87('0x7')](),controller[_0x4f87('0xf')]);router[_0x4f87('0x10')]('/',auth[_0x4f87('0x7')](),controller['create']);router['post']('/:id/teams',auth[_0x4f87('0x7')](),controller[_0x4f87('0x11')]);router[_0x4f87('0x10')](_0x4f87('0xe'),auth[_0x4f87('0x7')](),controller[_0x4f87('0x12')]);router['put'](_0x4f87('0xa'),auth['isAuthenticated'](),controller[_0x4f87('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth[_0x4f87('0x7')](),controller[_0x4f87('0x14')]);router[_0x4f87('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x4f87('0x16')]);module[_0x4f87('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ecc8bce..8c409bc 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 _0x66cb=['STRING','name','INTEGER','ENUM','beepall','sequelize','exports'];(function(_0x2db3d1,_0x836e3){var _0x1754b7=function(_0x1a62e9){while(--_0x1a62e9){_0x2db3d1['push'](_0x2db3d1['shift']());}};_0x1754b7(++_0x836e3);}(_0x66cb,0xa6));var _0xb66c=function(_0x4c2b1a,_0x194add){_0x4c2b1a=_0x4c2b1a-0x0;var _0x234a8d=_0x66cb[_0x4c2b1a];return _0x234a8d;};'use strict';var Sequelize=require(_0xb66c('0x0'));module[_0xb66c('0x1')]={'name':{'type':Sequelize[_0xb66c('0x2')],'unique':_0xb66c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb66c('0x2')]},'timeout':{'type':Sequelize[_0xb66c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb66c('0x5')]('rrmemory',_0xb66c('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x4500=['STRING','name','INTEGER','ENUM','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x4500,0x7c));var _0x0450=function(_0x113afc,_0x2c7d5a){_0x113afc=_0x113afc-0x0;var _0x3a9219=_0x4500[_0x113afc];return _0x3a9219;};'use strict';var Sequelize=require('sequelize');module[_0x0450('0x0')]={'name':{'type':Sequelize[_0x0450('0x1')],'unique':_0x0450('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0450('0x1')]},'timeout':{'type':Sequelize[_0x0450('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0450('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 60495ed..a734857 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 _0xff16=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','status','end','count','offset','limit','set','json','apply','reject','save','then','destroy','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','map','key','VIRTUAL','options','SmsQueue','findAll','rows','catch','params','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','nolimit','User','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','teams','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xff16,0x7f));var _0x6ff1=function(_0x191381,_0x4e0396){_0x191381=_0x191381-0x0;var _0x1e0221=_0xff16[_0x191381];return _0x1e0221;};'use strict';var pdf=require(_0x6ff1('0x0'));var emlformat=require(_0x6ff1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6ff1('0x2'));var jsonpatch=require(_0x6ff1('0x3'));var rp=require(_0x6ff1('0x4'));var moment=require(_0x6ff1('0x5'));var BPromise=require(_0x6ff1('0x6'));var Mustache=require(_0x6ff1('0x7'));var util=require(_0x6ff1('0x8'));var path=require(_0x6ff1('0x9'));var sox=require('sox');var csv=require(_0x6ff1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6ff1('0xb'));var squel=require(_0x6ff1('0xc'));var crypto=require(_0x6ff1('0xd'));var jsforce=require(_0x6ff1('0xe'));var deskjs=require(_0x6ff1('0xf'));var toCsv=require(_0x6ff1('0xa'));var querystring=require(_0x6ff1('0x10'));var Papa=require(_0x6ff1('0x11'));var Redis=require('ioredis');var authService=require(_0x6ff1('0x12'));var qs=require(_0x6ff1('0x13'));var hardwareService=require(_0x6ff1('0x14'));var logger=require(_0x6ff1('0x15'))(_0x6ff1('0x16'));var utils=require(_0x6ff1('0x17'));var config=require(_0x6ff1('0x18'));var db=require(_0x6ff1('0x19'))['db'];config[_0x6ff1('0x1a')]=_[_0x6ff1('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ff1('0x1c'))(new Redis(config['redis']));require(_0x6ff1('0x1d'))[_0x6ff1('0x1e')](socket);function respondWithStatusCode(_0x1451af,_0x543e07){_0x543e07=_0x543e07||0xcc;return function(_0x58952d){if(_0x58952d){return _0x1451af['sendStatus'](_0x543e07);}return _0x1451af[_0x6ff1('0x1f')](_0x543e07)[_0x6ff1('0x20')]();};}function respondWithResult(_0x23112d,_0x29e6c7){_0x29e6c7=_0x29e6c7||0xc8;return function(_0x36fa15){if(_0x36fa15){return _0x23112d[_0x6ff1('0x1f')](_0x29e6c7)['json'](_0x36fa15);}};}function respondWithFilteredResult(_0x155d26,_0x2b4142){return function(_0x4751b9){if(_0x4751b9){var _0x146c75=_0x4751b9[_0x6ff1('0x21')],_0xe5d26e=_0x2b4142[_0x6ff1('0x22')],_0x3ac8f8=_0x2b4142[_0x6ff1('0x22')]+_0x2b4142[_0x6ff1('0x23')],_0x5041d7;if(_0x3ac8f8>=_0x146c75){_0x3ac8f8=_0x146c75;_0x5041d7=0xc8;}else{_0x5041d7=0xce;}_0x155d26[_0x6ff1('0x1f')](_0x5041d7);return _0x155d26[_0x6ff1('0x24')]('Content-Range',_0xe5d26e+'-'+_0x3ac8f8+'/'+_0x146c75)[_0x6ff1('0x25')](_0x4751b9);}return null;};}function patchUpdates(_0x54c961){return function(_0x328325){try{jsonpatch[_0x6ff1('0x26')](_0x328325,_0x54c961,!![]);}catch(_0x2d3131){return BPromise[_0x6ff1('0x27')](_0x2d3131);}return _0x328325[_0x6ff1('0x28')]();};}function saveUpdates(_0x47fd1f,_0x56027f){return function(_0x561bcd){if(_0x561bcd){return _0x561bcd['update'](_0x47fd1f)[_0x6ff1('0x29')](function(_0xbdd73e){return _0xbdd73e;});}return null;};}function removeEntity(_0x4b3d22,_0x41b160){return function(_0x1ec4f1){if(_0x1ec4f1){return _0x1ec4f1[_0x6ff1('0x2a')]()[_0x6ff1('0x29')](function(){var _0x35f395=_0x1ec4f1['get']({'plain':!![]});var _0x13acb3=_0x6ff1('0x2b');return db[_0x6ff1('0x2c')]['destroy']({'where':{'type':_0x13acb3,'resourceId':_0x35f395['id']}})['then'](function(){return _0x1ec4f1;});})[_0x6ff1('0x29')](function(){_0x4b3d22[_0x6ff1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfda3d8,_0xc46904){return function(_0x5cc00f){if(!_0x5cc00f){_0xfda3d8[_0x6ff1('0x2d')](0x194);}return _0x5cc00f;};}function handleError(_0x3b9d53,_0x492973){_0x492973=_0x492973||0x1f4;return function(_0x3cc69e){logger[_0x6ff1('0x2e')](_0x3cc69e[_0x6ff1('0x2f')]);if(_0x3cc69e[_0x6ff1('0x30')]){delete _0x3cc69e['name'];}_0x3b9d53[_0x6ff1('0x1f')](_0x492973)[_0x6ff1('0x31')](_0x3cc69e);};}exports[_0x6ff1('0x32')]=function(_0x4683c6,_0x224967){var _0x597278={},_0xfd1863={},_0x28cfd8={'count':0x0,'rows':[]};var _0x105a27=db['SmsQueue'][_0x6ff1('0x33')];_0xfd1863['model']=_[_0x6ff1('0x34')](_0x105a27);_0xfd1863[_0x6ff1('0x35')]=_[_0x6ff1('0x34')](_0x4683c6[_0x6ff1('0x35')]);_0xfd1863[_0x6ff1('0x36')]=_[_0x6ff1('0x37')](_0xfd1863[_0x6ff1('0x38')],_0xfd1863['query']);_0x597278['attributes']=_[_0x6ff1('0x37')](_0xfd1863[_0x6ff1('0x38')],qs[_0x6ff1('0x39')](_0x4683c6[_0x6ff1('0x35')][_0x6ff1('0x39')]));_0x597278[_0x6ff1('0x3a')]=_0x597278['attributes'][_0x6ff1('0x3b')]?_0x597278[_0x6ff1('0x3a')]:_0xfd1863[_0x6ff1('0x38')];if(!_0x4683c6['query'][_0x6ff1('0x3c')]('nolimit')){_0x597278[_0x6ff1('0x23')]=qs['limit'](_0x4683c6[_0x6ff1('0x35')][_0x6ff1('0x23')]);_0x597278['offset']=qs['offset'](_0x4683c6['query'][_0x6ff1('0x22')]);}_0x597278[_0x6ff1('0x3d')]=qs[_0x6ff1('0x3e')](_0x4683c6[_0x6ff1('0x35')][_0x6ff1('0x3e')]);_0x597278['where']=qs[_0x6ff1('0x36')](_['pick'](_0x4683c6[_0x6ff1('0x35')],_0xfd1863['filters']));if(_0x4683c6['query'][_0x6ff1('0x3f')]){_0x597278[_0x6ff1('0x40')]=_[_0x6ff1('0x41')](_0x597278[_0x6ff1('0x40')],{'$or':_[_0x6ff1('0x42')](_0x105a27,function(_0x136d08){if(_0x136d08['type'][_0x6ff1('0x43')]!==_0x6ff1('0x44')){var _0x589890={};_0x589890[_0x136d08['field']]={'$like':'%'+_0x4683c6[_0x6ff1('0x35')]['filter']+'%'};return _0x589890;}})});}_0x597278=_[_0x6ff1('0x41')]({},_0x597278,_0x4683c6[_0x6ff1('0x45')]);var _0x44bf61={'where':_0x597278[_0x6ff1('0x40')]};return db[_0x6ff1('0x46')][_0x6ff1('0x21')](_0x44bf61)['then'](function(_0x4979a5){_0x28cfd8[_0x6ff1('0x21')]=_0x4979a5;if(_0x4683c6['query']['includeAll']){_0x597278['include']=[{'all':!![]}];}return db[_0x6ff1('0x46')][_0x6ff1('0x47')](_0x597278);})[_0x6ff1('0x29')](function(_0x5f7999){_0x28cfd8[_0x6ff1('0x48')]=_0x5f7999;return _0x28cfd8;})[_0x6ff1('0x29')](respondWithFilteredResult(_0x224967,_0x597278))[_0x6ff1('0x49')](handleError(_0x224967,null));};exports['show']=function(_0x3f76c6,_0x2a2df6){var _0x1d8793={'raw':!![],'where':{'id':_0x3f76c6[_0x6ff1('0x4a')]['id']}},_0x30d281={};_0x30d281['model']=_[_0x6ff1('0x34')](db[_0x6ff1('0x46')][_0x6ff1('0x33')]);_0x30d281[_0x6ff1('0x35')]=_[_0x6ff1('0x34')](_0x3f76c6[_0x6ff1('0x35')]);_0x30d281['filters']=_[_0x6ff1('0x37')](_0x30d281[_0x6ff1('0x38')],_0x30d281['query']);_0x1d8793[_0x6ff1('0x3a')]=_['intersection'](_0x30d281[_0x6ff1('0x38')],qs[_0x6ff1('0x39')](_0x3f76c6[_0x6ff1('0x35')][_0x6ff1('0x39')]));_0x1d8793['attributes']=_0x1d8793['attributes'][_0x6ff1('0x3b')]?_0x1d8793['attributes']:_0x30d281[_0x6ff1('0x38')];if(_0x3f76c6['query']['includeAll']){_0x1d8793[_0x6ff1('0x4b')]=[{'all':!![]}];}_0x1d8793=_[_0x6ff1('0x41')]({},_0x1d8793,_0x3f76c6[_0x6ff1('0x45')]);return db[_0x6ff1('0x46')]['find'](_0x1d8793)[_0x6ff1('0x29')](handleEntityNotFound(_0x2a2df6,null))['then'](respondWithResult(_0x2a2df6,null))['catch'](handleError(_0x2a2df6,null));};exports[_0x6ff1('0x4c')]=function(_0x2da127,_0x46cc46){return db[_0x6ff1('0x46')][_0x6ff1('0x4c')](_0x2da127[_0x6ff1('0x4d')],{})['then'](function(_0x143492){var _0x4dc16a=_0x2da127[_0x6ff1('0x4e')][_0x6ff1('0x4f')]({'plain':!![]});if(!_0x4dc16a)throw new Error(_0x6ff1('0x50'));if(_0x4dc16a[_0x6ff1('0x51')]==='user'){var _0x5e1b95=_0x143492['get']({'plain':!![]});var _0x32f757=_0x6ff1('0x2b');return db[_0x6ff1('0x52')][_0x6ff1('0x53')]({'where':{'name':_0x32f757,'userProfileId':_0x4dc16a[_0x6ff1('0x54')]},'raw':!![]})[_0x6ff1('0x29')](function(_0x5a2768){if(_0x5a2768&&_0x5a2768['autoAssociation']===0x0){return db['UserProfileResource'][_0x6ff1('0x4c')]({'name':_0x5e1b95[_0x6ff1('0x30')],'resourceId':_0x5e1b95['id'],'type':_0x5a2768[_0x6ff1('0x30')],'sectionId':_0x5a2768['id']},{})[_0x6ff1('0x29')](function(){return _0x143492;});}else{return _0x143492;}})['catch'](function(_0x2275ff){logger[_0x6ff1('0x2e')](_0x6ff1('0x55'),_0x2275ff);throw _0x2275ff;});}return _0x143492;})['then'](respondWithResult(_0x46cc46,0xc9))[_0x6ff1('0x49')](handleError(_0x46cc46,null));};exports[_0x6ff1('0x56')]=function(_0x51a663,_0xd8bd64){if(_0x51a663[_0x6ff1('0x4d')]['id']){delete _0x51a663['body']['id'];}return db[_0x6ff1('0x46')]['find']({'where':{'id':_0x51a663[_0x6ff1('0x4a')]['id']}})[_0x6ff1('0x29')](handleEntityNotFound(_0xd8bd64,null))['then'](saveUpdates(_0x51a663['body'],null))[_0x6ff1('0x29')](respondWithResult(_0xd8bd64,null))[_0x6ff1('0x49')](handleError(_0xd8bd64,null));};exports['destroy']=function(_0x7faf2a,_0x5d10be){return db[_0x6ff1('0x46')][_0x6ff1('0x53')]({'where':{'id':_0x7faf2a[_0x6ff1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d10be,null))[_0x6ff1('0x29')](removeEntity(_0x5d10be,null))[_0x6ff1('0x49')](handleError(_0x5d10be,null));};exports[_0x6ff1('0x57')]=function(_0x36ed1b,_0x46c49c){return db['SmsQueue'][_0x6ff1('0x57')]()[_0x6ff1('0x29')](respondWithResult(_0x46c49c,null))[_0x6ff1('0x49')](handleError(_0x46c49c,null));};exports[_0x6ff1('0x58')]=function(_0x18cd26,_0x175567,_0x588b49){var _0x4dac7a={'raw':!![],'where':{}},_0x5a991a={},_0x4a13be;return db[_0x6ff1('0x46')][_0x6ff1('0x59')]({'where':{'id':_0x18cd26[_0x6ff1('0x4a')]['id']}})[_0x6ff1('0x29')](handleEntityNotFound(_0x175567,null))['then'](function(_0x4a3038){if(_0x4a3038){_0x4a13be=_0x4a3038[_0x6ff1('0x4f')]({'plain':!![]});_0x5a991a[_0x6ff1('0x38')]=_[_0x6ff1('0x34')](db[_0x6ff1('0x5a')][_0x6ff1('0x33')]);_0x5a991a[_0x6ff1('0x35')]=_[_0x6ff1('0x34')](_0x18cd26['query']);_0x5a991a[_0x6ff1('0x36')]=_['intersection'](_0x5a991a[_0x6ff1('0x38')],_0x5a991a[_0x6ff1('0x35')]);_0x4dac7a['attributes']=_[_0x6ff1('0x37')](_0x5a991a['model'],qs[_0x6ff1('0x39')](_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x39')]));_0x4dac7a['attributes']=_0x4dac7a[_0x6ff1('0x3a')][_0x6ff1('0x3b')]?_0x4dac7a[_0x6ff1('0x3a')]:_0x5a991a[_0x6ff1('0x38')];if(!_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x3c')](_0x6ff1('0x5b'))){_0x4dac7a[_0x6ff1('0x23')]=qs['limit'](_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x23')]);_0x4dac7a[_0x6ff1('0x22')]=qs[_0x6ff1('0x22')](_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x22')]);}_0x4dac7a[_0x6ff1('0x3d')]=qs[_0x6ff1('0x3e')](_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x3e')]);_0x4dac7a['where']=qs[_0x6ff1('0x36')](_['pick'](_0x18cd26[_0x6ff1('0x35')],_0x5a991a[_0x6ff1('0x36')]));_0x4dac7a['where']['SmsQueueId']=_0x4a3038['id'];if(_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x3f')]){_0x4dac7a[_0x6ff1('0x40')]=_[_0x6ff1('0x41')](_0x4dac7a[_0x6ff1('0x40')],{'$or':_[_0x6ff1('0x42')](_0x4dac7a[_0x6ff1('0x3a')],function(_0x59d6e2){var _0x3b0807={};_0x3b0807[_0x59d6e2]={'$like':'%'+_0x18cd26[_0x6ff1('0x35')][_0x6ff1('0x3f')]+'%'};return _0x3b0807;})});}_0x4dac7a=_[_0x6ff1('0x41')]({},_0x4dac7a,_0x18cd26['options']);return db[_0x6ff1('0x5a')][_0x6ff1('0x47')](_0x4dac7a);}})['then'](function(_0x4d88b0){if(_0x4d88b0){return db[_0x6ff1('0x5c')]['findAndCountAll']({'where':{'id':_[_0x6ff1('0x42')](_0x4d88b0,_0x6ff1('0x5d')),'role':_0x6ff1('0x5e')},'attributes':['id',_0x6ff1('0x30'),_0x6ff1('0x5f'),'updatedAt',_0x6ff1('0x60')]});}})[_0x6ff1('0x29')](function(_0x35eee9){if(_0x35eee9){return{'count':_0x35eee9['count'],'rows':_[_0x6ff1('0x42')](_0x35eee9['rows'],function(_0xa920b5){return{'membername':_0xa920b5[_0x6ff1('0x30')],'UserId':_0xa920b5['id'],'queue_name':_0x4a13be['name'],'SmsQueueId':_0x4a13be['id'],'interface':util[_0x6ff1('0x61')](_0x6ff1('0x62'),_0x6ff1('0x63'),_0xa920b5['name']),'penalty':0x0,'paused':_0xa920b5[_0x6ff1('0x5f')],'createdAt':_0xa920b5[_0x6ff1('0x60')],'updatedAt':_0xa920b5[_0x6ff1('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ff1('0x29')](respondWithFilteredResult(_0x175567,_0x4dac7a))[_0x6ff1('0x49')](handleError(_0x175567,null));};exports['getTeams']=function(_0x12f3f2,_0x26e4d4,_0x4fd838){var _0x52e4fb={};var _0x4190fe={};var _0x249575;var _0x2c800b;return db[_0x6ff1('0x46')][_0x6ff1('0x59')]({'where':{'id':_0x12f3f2['params']['id']}})[_0x6ff1('0x29')](handleEntityNotFound(_0x26e4d4,null))[_0x6ff1('0x29')](function(_0x3ece3f){if(_0x3ece3f){_0x249575=_0x3ece3f;_0x4190fe[_0x6ff1('0x38')]=_['keys'](db[_0x6ff1('0x65')]['rawAttributes']);_0x4190fe[_0x6ff1('0x35')]=_['keys'](_0x12f3f2[_0x6ff1('0x35')]);_0x4190fe[_0x6ff1('0x36')]=_[_0x6ff1('0x37')](_0x4190fe['model'],_0x4190fe[_0x6ff1('0x35')]);_0x52e4fb[_0x6ff1('0x3a')]=_[_0x6ff1('0x37')](_0x4190fe[_0x6ff1('0x38')],qs[_0x6ff1('0x39')](_0x12f3f2['query'][_0x6ff1('0x39')]));_0x52e4fb['attributes']=_0x52e4fb[_0x6ff1('0x3a')][_0x6ff1('0x3b')]?_0x52e4fb['attributes']:_0x4190fe[_0x6ff1('0x38')];_0x52e4fb[_0x6ff1('0x3d')]=qs[_0x6ff1('0x3e')](_0x12f3f2[_0x6ff1('0x35')]['sort']);_0x52e4fb[_0x6ff1('0x40')]=qs[_0x6ff1('0x36')](_['pick'](_0x12f3f2[_0x6ff1('0x35')],_0x4190fe[_0x6ff1('0x36')]));if(_0x12f3f2[_0x6ff1('0x35')][_0x6ff1('0x3f')]){_0x52e4fb[_0x6ff1('0x40')]=_[_0x6ff1('0x41')](_0x52e4fb[_0x6ff1('0x40')],{'$or':_[_0x6ff1('0x42')](_0x52e4fb[_0x6ff1('0x3a')],function(_0x23eb8b){var _0x3a94fe={};_0x3a94fe[_0x23eb8b]={'$like':'%'+_0x12f3f2[_0x6ff1('0x35')][_0x6ff1('0x3f')]+'%'};return _0x3a94fe;})});}_0x52e4fb=_[_0x6ff1('0x41')]({},_0x52e4fb,_0x12f3f2[_0x6ff1('0x45')]);return _0x249575[_0x6ff1('0x66')](_0x52e4fb);}})[_0x6ff1('0x29')](function(_0x264470){if(_0x264470){_0x2c800b=_0x264470[_0x6ff1('0x3b')];if(!_0x12f3f2['query'][_0x6ff1('0x3c')](_0x6ff1('0x5b'))){_0x52e4fb[_0x6ff1('0x23')]=qs[_0x6ff1('0x23')](_0x12f3f2[_0x6ff1('0x35')][_0x6ff1('0x23')]);_0x52e4fb[_0x6ff1('0x22')]=qs[_0x6ff1('0x22')](_0x12f3f2[_0x6ff1('0x35')][_0x6ff1('0x22')]);}return _0x249575[_0x6ff1('0x66')](_0x52e4fb);}})[_0x6ff1('0x29')](function(_0x36e9db){if(_0x36e9db){return _0x36e9db?{'count':_0x2c800b,'rows':_0x36e9db}:null;}})['then'](respondWithResult(_0x26e4d4,null))[_0x6ff1('0x49')](handleError(_0x26e4d4,null));};exports[_0x6ff1('0x67')]=function(_0xcca2f,_0x489949,_0x195a00){var _0x492eaf=_0xcca2f[_0x6ff1('0x4d')][_0x6ff1('0x68')];return db[_0x6ff1('0x65')][_0x6ff1('0x47')]({'where':{'id':_[_0x6ff1('0x42')](_0x492eaf,'id')},'attributes':['id'],'include':[{'model':db[_0x6ff1('0x5c')],'as':_0x6ff1('0x69'),'attributes':['id',_0x6ff1('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0x6ff1('0x29')](function(_0xc2670b){if(_0xc2670b){var _0x275d4c=_['flatMap'](_0xc2670b,function(_0xf6e70c){var _0xa3fb06=_0xf6e70c[_0x6ff1('0x4f')]({'plain':!![]});return _0xa3fb06['Agents'];});return db[_0x6ff1('0x46')][_0x6ff1('0x53')]({'where':{'id':_0xcca2f['params']['id']}})[_0x6ff1('0x29')](function(_0x58e16f){return db[_0x6ff1('0x6a')][_0x6ff1('0x6b')](function(_0x9fbb19){return _0x58e16f['addTeams'](_[_0x6ff1('0x42')](_0x492eaf,'id'),{'transaction':_0x9fbb19})[_0x6ff1('0x29')](function(){return BPromise[_0x6ff1('0x6c')](_0x275d4c,function(_0x5b6e20){return db[_0x6ff1('0x5a')][_0x6ff1('0x6d')]({'where':{'UserId':_0x5b6e20['id'],'SmsQueueId':_0xcca2f['params']['id']},'transaction':_0x9fbb19});});})[_0x6ff1('0x29')](function(){_0x275d4c[_0x6ff1('0x6e')](function(_0xadfbb7){socket[_0x6ff1('0x6f')](_0x6ff1('0x70'),{'UserId':_0xadfbb7['id'],'SmsQueueId':_0x58e16f['id']});});});});});}})[_0x6ff1('0x29')](respondWithStatusCode(_0x489949,null))[_0x6ff1('0x49')](handleError(_0x489949,null));};exports[_0x6ff1('0x71')]=function(_0x2ec134,_0x9f9d10,_0x40403e){return db[_0x6ff1('0x65')]['findAll']({'where':{'id':_0x2ec134[_0x6ff1('0x35')][_0x6ff1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x6ff1('0x5c')],'as':_0x6ff1('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6ff1('0x29')](handleEntityNotFound(_0x9f9d10,null))['then'](function(_0x33cb97){var _0x154b70=_[_0x6ff1('0x42')](_0x33cb97,'id');var _0x3ef704=[];var _0x5b9c22=[];var _0x545f1c=squel[_0x6ff1('0x73')]();_0x545f1c[_0x6ff1('0x74')](_0x6ff1('0x75'))[_0x6ff1('0x76')](_0x6ff1('0x77'),'tq')[_0x6ff1('0x78')](_0x6ff1('0x79'),'ut',_0x6ff1('0x7a'))[_0x6ff1('0x40')](_0x6ff1('0x7b'),_0x2ec134[_0x6ff1('0x4a')]['id']);for(var _0x86c419=0x0;_0x86c419<_0x33cb97[_0x6ff1('0x3b')];_0x86c419+=0x1){let _0x155c29=_0x33cb97[_0x86c419];for(var _0x2930ce=0x0;_0x2930ce<_0x155c29[_0x6ff1('0x69')][_0x6ff1('0x3b')];_0x2930ce+=0x1){let _0x156e81=_0x155c29[_0x6ff1('0x69')][_0x2930ce];var _0x2e6e07=_0x545f1c[_0x6ff1('0x7c')]();_0x2e6e07[_0x6ff1('0x40')](_0x6ff1('0x7d'),_0x156e81['id']);_0x5b9c22[_0x6ff1('0x7e')](db[_0x6ff1('0x6a')][_0x6ff1('0x35')](_0x2e6e07[_0x6ff1('0x7f')](),{'type':db['sequelize'][_0x6ff1('0x80')][_0x6ff1('0x81')]})[_0x6ff1('0x29')](function(_0x2ec593){if(_0x2ec593['length']===0x1){return _0x156e81['id'];}else{var _0x114102=_['every'](_[_0x6ff1('0x42')](_0x2ec593,'TeamId'),function(_0x3a1208){return _[_0x6ff1('0x82')](_0x154b70,_0x3a1208);});if(_0x114102){return _0x156e81['id'];}}}));}}return BPromise[_0x6ff1('0x83')](_0x5b9c22)[_0x6ff1('0x29')](function(_0x8b470e){_0x3ef704=_(_0x3ef704)[_0x6ff1('0x84')](_0x8b470e)[_0x6ff1('0x85')]()[_0x6ff1('0x86')]();return db[_0x6ff1('0x46')][_0x6ff1('0x53')]({'where':{'id':_0x2ec134[_0x6ff1('0x4a')]['id']}})['then'](function(_0xc8768f){return db[_0x6ff1('0x6a')][_0x6ff1('0x6b')](function(_0x11e0a5){return _0xc8768f[_0x6ff1('0x71')](_0x2ec134[_0x6ff1('0x35')][_0x6ff1('0x72')],{'transaction':_0x11e0a5})[_0x6ff1('0x29')](function(){if(!_[_0x6ff1('0x87')](_0x3ef704)){return _0xc8768f[_0x6ff1('0x88')](_0x3ef704,{'transaction':_0x11e0a5});}})[_0x6ff1('0x29')](function(){_0x3ef704['forEach'](function(_0x1f4852){socket[_0x6ff1('0x6f')](_0x6ff1('0x89'),{'UserId':_0x1f4852,'SmsQueueId':_0xc8768f['id']});});});});});});})[_0x6ff1('0x29')](respondWithStatusCode(_0x9f9d10,null))['catch'](handleError(_0x9f9d10,null));};exports['addAgents']=function(_0x28d900,_0x4fec75,_0x1a5cfd){return db[_0x6ff1('0x46')][_0x6ff1('0x53')]({'where':{'id':_0x28d900[_0x6ff1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fec75,null))[_0x6ff1('0x29')](function(_0x215108){if(_0x215108){return _0x215108[_0x6ff1('0x8a')](_0x28d900[_0x6ff1('0x4d')][_0x6ff1('0x72')],_[_0x6ff1('0x8b')](_0x28d900['body'],[_0x6ff1('0x72'),'id'])||{})[_0x6ff1('0x8c')](function(_0x281ad8){for(var _0x55d5ab=0x0;_0x55d5ab<_0x28d900[_0x6ff1('0x4d')][_0x6ff1('0x72')]['length'];_0x55d5ab+=0x1){socket[_0x6ff1('0x6f')]('userSmsQueue:save',{'UserId':_0x28d900[_0x6ff1('0x4d')][_0x6ff1('0x72')][_0x55d5ab],'SmsQueueId':_0x28d900[_0x6ff1('0x4a')]['id']});}return _0x281ad8;});}})[_0x6ff1('0x29')](respondWithResult(_0x4fec75,null))['catch'](handleError(_0x4fec75,null));};exports[_0x6ff1('0x88')]=function(_0x31600e,_0x507fc3,_0x351700){return db[_0x6ff1('0x46')][_0x6ff1('0x53')]({'where':{'id':_0x31600e[_0x6ff1('0x4a')]['id']}})[_0x6ff1('0x29')](handleEntityNotFound(_0x507fc3,null))[_0x6ff1('0x29')](function(_0x2f1011){if(_0x2f1011){return _0x2f1011['removeAgents'](_0x31600e[_0x6ff1('0x35')][_0x6ff1('0x72')])[_0x6ff1('0x29')](function(){if(_[_0x6ff1('0x8d')](_0x31600e[_0x6ff1('0x35')][_0x6ff1('0x72')])){for(var _0x4125d2=0x0;_0x4125d2<_0x31600e[_0x6ff1('0x35')][_0x6ff1('0x72')]['length'];_0x4125d2+=0x1){socket[_0x6ff1('0x6f')](_0x6ff1('0x89'),{'UserId':Number(_0x31600e[_0x6ff1('0x35')][_0x6ff1('0x72')][_0x4125d2]),'SmsQueueId':Number(_0x31600e[_0x6ff1('0x4a')]['id'])});}}else{socket[_0x6ff1('0x6f')](_0x6ff1('0x89'),{'UserId':Number(_0x31600e[_0x6ff1('0x35')][_0x6ff1('0x72')]),'SmsQueueId':Number(_0x31600e['params']['id'])});}});}})[_0x6ff1('0x29')](respondWithStatusCode(_0x507fc3,null))['catch'](handleError(_0x507fc3,null));};exports[_0x6ff1('0x8e')]=function(_0x314c9d,_0x44d4fc,_0x4ae4ef){var _0x2c79ee={};var _0x5b97e6={};var _0x36bcc7;var _0x145017;return db[_0x6ff1('0x46')][_0x6ff1('0x59')]({'where':{'id':_0x314c9d[_0x6ff1('0x4a')]['id']}})[_0x6ff1('0x29')](handleEntityNotFound(_0x44d4fc,null))[_0x6ff1('0x29')](function(_0x47beee){if(_0x47beee){_0x36bcc7=_0x47beee;_0x5b97e6[_0x6ff1('0x38')]=_[_0x6ff1('0x34')](db[_0x6ff1('0x5c')][_0x6ff1('0x33')]);_0x5b97e6[_0x6ff1('0x35')]=_[_0x6ff1('0x34')](_0x314c9d[_0x6ff1('0x35')]);_0x5b97e6['filters']=_['intersection'](_0x5b97e6['model'],_0x5b97e6[_0x6ff1('0x35')]);_0x2c79ee[_0x6ff1('0x3a')]=_[_0x6ff1('0x37')](_0x5b97e6[_0x6ff1('0x38')],qs[_0x6ff1('0x39')](_0x314c9d[_0x6ff1('0x35')][_0x6ff1('0x39')]));_0x2c79ee[_0x6ff1('0x3a')]=_0x2c79ee['attributes'][_0x6ff1('0x3b')]?_0x2c79ee[_0x6ff1('0x3a')]:_0x5b97e6[_0x6ff1('0x38')];_0x2c79ee[_0x6ff1('0x3d')]=qs[_0x6ff1('0x3e')](_0x314c9d[_0x6ff1('0x35')][_0x6ff1('0x3e')]);_0x2c79ee['where']=qs[_0x6ff1('0x36')](_[_0x6ff1('0x8f')](_0x314c9d[_0x6ff1('0x35')],_0x5b97e6[_0x6ff1('0x36')]));if(_0x314c9d['query']['filter']){_0x2c79ee[_0x6ff1('0x40')]=_[_0x6ff1('0x41')](_0x2c79ee['where'],{'$or':_[_0x6ff1('0x42')](_0x2c79ee['attributes'],function(_0x9e5e5b){var _0x11b9f0={};_0x11b9f0[_0x9e5e5b]={'$like':'%'+_0x314c9d[_0x6ff1('0x35')]['filter']+'%'};return _0x11b9f0;})});}_0x2c79ee=_[_0x6ff1('0x41')]({},_0x2c79ee,_0x314c9d['options']);return _0x36bcc7['getAgents'](_0x2c79ee);}})[_0x6ff1('0x29')](function(_0x3aaa98){if(_0x3aaa98){_0x145017=_0x3aaa98[_0x6ff1('0x3b')];if(!_0x314c9d['query'][_0x6ff1('0x3c')](_0x6ff1('0x5b'))){_0x2c79ee[_0x6ff1('0x23')]=qs[_0x6ff1('0x23')](_0x314c9d['query'][_0x6ff1('0x23')]);_0x2c79ee['offset']=qs['offset'](_0x314c9d[_0x6ff1('0x35')][_0x6ff1('0x22')]);}return _0x36bcc7[_0x6ff1('0x8e')](_0x2c79ee);}})[_0x6ff1('0x29')](function(_0x2a7600){if(_0x2a7600){return _0x2a7600?{'count':_0x145017,'rows':_0x2a7600}:null;}})[_0x6ff1('0x29')](respondWithResult(_0x44d4fc,null))['catch'](handleError(_0x44d4fc,null));}; \ No newline at end of file +var _0xe4b8=['index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','sequelize','transaction','each','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','omit','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0xe4b8,0x179));var _0x8e4b=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xe4b8[_0x47aa64];return _0x549c7a;};'use strict';var pdf=require(_0x8e4b('0x0'));var emlformat=require(_0x8e4b('0x1'));var rimraf=require(_0x8e4b('0x2'));var zipdir=require(_0x8e4b('0x3'));var jsonpatch=require(_0x8e4b('0x4'));var rp=require(_0x8e4b('0x5'));var moment=require(_0x8e4b('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e4b('0x7'));var path=require(_0x8e4b('0x8'));var sox=require(_0x8e4b('0x9'));var csv=require('to-csv');var ejs=require(_0x8e4b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e4b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e4b('0xc'));var Redis=require('ioredis');var authService=require(_0x8e4b('0xd'));var qs=require(_0x8e4b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e4b('0xf'))(_0x8e4b('0x10'));var utils=require(_0x8e4b('0x11'));var config=require('../../config/environment');var db=require(_0x8e4b('0x12'))['db'];config[_0x8e4b('0x13')]=_[_0x8e4b('0x14')](config[_0x8e4b('0x13')],{'host':_0x8e4b('0x15'),'port':0x18eb});var socket=require(_0x8e4b('0x16'))(new Redis(config[_0x8e4b('0x13')]));require(_0x8e4b('0x17'))['register'](socket);function respondWithStatusCode(_0x5f56fb,_0x2e8e71){_0x2e8e71=_0x2e8e71||0xcc;return function(_0x261e76){if(_0x261e76){return _0x5f56fb[_0x8e4b('0x18')](_0x2e8e71);}return _0x5f56fb[_0x8e4b('0x19')](_0x2e8e71)[_0x8e4b('0x1a')]();};}function respondWithResult(_0x4d10fd,_0x4b0197){_0x4b0197=_0x4b0197||0xc8;return function(_0xfff6b){if(_0xfff6b){return _0x4d10fd['status'](_0x4b0197)['json'](_0xfff6b);}};}function respondWithFilteredResult(_0x417e71,_0x572c0f){return function(_0x38cbf5){if(_0x38cbf5){var _0x512c2a=_0x38cbf5['count'],_0x444c19=_0x572c0f[_0x8e4b('0x1b')],_0x139118=_0x572c0f[_0x8e4b('0x1b')]+_0x572c0f[_0x8e4b('0x1c')],_0x4b2458;if(_0x139118>=_0x512c2a){_0x139118=_0x512c2a;_0x4b2458=0xc8;}else{_0x4b2458=0xce;}_0x417e71[_0x8e4b('0x19')](_0x4b2458);return _0x417e71[_0x8e4b('0x1d')](_0x8e4b('0x1e'),_0x444c19+'-'+_0x139118+'/'+_0x512c2a)[_0x8e4b('0x1f')](_0x38cbf5);}return null;};}function patchUpdates(_0x27f816){return function(_0x9eeb68){try{jsonpatch[_0x8e4b('0x20')](_0x9eeb68,_0x27f816,!![]);}catch(_0x123017){return BPromise[_0x8e4b('0x21')](_0x123017);}return _0x9eeb68['save']();};}function saveUpdates(_0xa4c5ad,_0x16ff18){return function(_0x5f3043){if(_0x5f3043){return _0x5f3043[_0x8e4b('0x22')](_0xa4c5ad)[_0x8e4b('0x23')](function(_0x54b17e){return _0x54b17e;});}return null;};}function removeEntity(_0x2bd4e7,_0x719300){return function(_0x5e8915){if(_0x5e8915){return _0x5e8915[_0x8e4b('0x24')]()[_0x8e4b('0x23')](function(){var _0x56597d=_0x5e8915[_0x8e4b('0x25')]({'plain':!![]});var _0x2b29a4=_0x8e4b('0x26');return db[_0x8e4b('0x27')][_0x8e4b('0x24')]({'where':{'type':_0x2b29a4,'resourceId':_0x56597d['id']}})[_0x8e4b('0x23')](function(){return _0x5e8915;});})['then'](function(){_0x2bd4e7[_0x8e4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7126,_0x1f9aba){return function(_0x10e08c){if(!_0x10e08c){_0x4f7126['sendStatus'](0x194);}return _0x10e08c;};}function handleError(_0x1f1aa2,_0x546133){_0x546133=_0x546133||0x1f4;return function(_0x6d7fbd){logger['error'](_0x6d7fbd[_0x8e4b('0x28')]);if(_0x6d7fbd[_0x8e4b('0x29')]){delete _0x6d7fbd[_0x8e4b('0x29')];}_0x1f1aa2[_0x8e4b('0x19')](_0x546133)[_0x8e4b('0x2a')](_0x6d7fbd);};}exports[_0x8e4b('0x2b')]=function(_0x2924c1,_0x3573d8){var _0x4f823c={},_0x5d1b05={},_0x2661f7={'count':0x0,'rows':[]};var _0x309dc0=db[_0x8e4b('0x2c')][_0x8e4b('0x2d')];_0x5d1b05[_0x8e4b('0x2e')]=_[_0x8e4b('0x2f')](_0x309dc0);_0x5d1b05[_0x8e4b('0x30')]=_[_0x8e4b('0x2f')](_0x2924c1['query']);_0x5d1b05[_0x8e4b('0x31')]=_[_0x8e4b('0x32')](_0x5d1b05[_0x8e4b('0x2e')],_0x5d1b05[_0x8e4b('0x30')]);_0x4f823c[_0x8e4b('0x33')]=_['intersection'](_0x5d1b05[_0x8e4b('0x2e')],qs[_0x8e4b('0x34')](_0x2924c1[_0x8e4b('0x30')][_0x8e4b('0x34')]));_0x4f823c[_0x8e4b('0x33')]=_0x4f823c[_0x8e4b('0x33')][_0x8e4b('0x35')]?_0x4f823c[_0x8e4b('0x33')]:_0x5d1b05['model'];if(!_0x2924c1[_0x8e4b('0x30')][_0x8e4b('0x36')](_0x8e4b('0x37'))){_0x4f823c[_0x8e4b('0x1c')]=qs[_0x8e4b('0x1c')](_0x2924c1[_0x8e4b('0x30')][_0x8e4b('0x1c')]);_0x4f823c[_0x8e4b('0x1b')]=qs[_0x8e4b('0x1b')](_0x2924c1[_0x8e4b('0x30')][_0x8e4b('0x1b')]);}_0x4f823c[_0x8e4b('0x38')]=qs[_0x8e4b('0x39')](_0x2924c1['query'][_0x8e4b('0x39')]);_0x4f823c['where']=qs[_0x8e4b('0x31')](_[_0x8e4b('0x3a')](_0x2924c1['query'],_0x5d1b05[_0x8e4b('0x31')]));if(_0x2924c1['query'][_0x8e4b('0x3b')]){_0x4f823c[_0x8e4b('0x3c')]=_[_0x8e4b('0x3d')](_0x4f823c[_0x8e4b('0x3c')],{'$or':_[_0x8e4b('0x3e')](_0x309dc0,function(_0x48f96a){if(_0x48f96a['type'][_0x8e4b('0x3f')]!==_0x8e4b('0x40')){var _0xa89e8={};_0xa89e8[_0x48f96a[_0x8e4b('0x41')]]={'$like':'%'+_0x2924c1[_0x8e4b('0x30')][_0x8e4b('0x3b')]+'%'};return _0xa89e8;}})});}_0x4f823c=_[_0x8e4b('0x3d')]({},_0x4f823c,_0x2924c1['options']);var _0x34870d={'where':_0x4f823c['where']};return db[_0x8e4b('0x2c')]['count'](_0x34870d)[_0x8e4b('0x23')](function(_0x504ece){_0x2661f7[_0x8e4b('0x42')]=_0x504ece;if(_0x2924c1['query'][_0x8e4b('0x43')]){_0x4f823c[_0x8e4b('0x44')]=[{'all':!![]}];}return db[_0x8e4b('0x2c')][_0x8e4b('0x45')](_0x4f823c);})['then'](function(_0x13d68c){_0x2661f7[_0x8e4b('0x46')]=_0x13d68c;return _0x2661f7;})[_0x8e4b('0x23')](respondWithFilteredResult(_0x3573d8,_0x4f823c))[_0x8e4b('0x47')](handleError(_0x3573d8,null));};exports[_0x8e4b('0x48')]=function(_0x2a850f,_0x1b8493){var _0x3115e1={'raw':!![],'where':{'id':_0x2a850f[_0x8e4b('0x49')]['id']}},_0x456e1d={};_0x456e1d[_0x8e4b('0x2e')]=_['keys'](db[_0x8e4b('0x2c')][_0x8e4b('0x2d')]);_0x456e1d[_0x8e4b('0x30')]=_[_0x8e4b('0x2f')](_0x2a850f[_0x8e4b('0x30')]);_0x456e1d[_0x8e4b('0x31')]=_[_0x8e4b('0x32')](_0x456e1d['model'],_0x456e1d[_0x8e4b('0x30')]);_0x3115e1[_0x8e4b('0x33')]=_[_0x8e4b('0x32')](_0x456e1d[_0x8e4b('0x2e')],qs[_0x8e4b('0x34')](_0x2a850f[_0x8e4b('0x30')][_0x8e4b('0x34')]));_0x3115e1[_0x8e4b('0x33')]=_0x3115e1[_0x8e4b('0x33')][_0x8e4b('0x35')]?_0x3115e1[_0x8e4b('0x33')]:_0x456e1d[_0x8e4b('0x2e')];if(_0x2a850f[_0x8e4b('0x30')][_0x8e4b('0x43')]){_0x3115e1[_0x8e4b('0x44')]=[{'all':!![]}];}_0x3115e1=_[_0x8e4b('0x3d')]({},_0x3115e1,_0x2a850f[_0x8e4b('0x4a')]);return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')](_0x3115e1)[_0x8e4b('0x23')](handleEntityNotFound(_0x1b8493,null))[_0x8e4b('0x23')](respondWithResult(_0x1b8493,null))[_0x8e4b('0x47')](handleError(_0x1b8493,null));};exports['create']=function(_0x2c56bb,_0x282ad4){return db[_0x8e4b('0x2c')][_0x8e4b('0x4c')](_0x2c56bb[_0x8e4b('0x4d')],{})[_0x8e4b('0x23')](function(_0x3b7447){var _0x36a554=_0x2c56bb[_0x8e4b('0x4e')][_0x8e4b('0x25')]({'plain':!![]});if(!_0x36a554)throw new Error(_0x8e4b('0x4f'));if(_0x36a554[_0x8e4b('0x50')]==='user'){var _0x3cd943=_0x3b7447[_0x8e4b('0x25')]({'plain':!![]});var _0x163bfc=_0x8e4b('0x26');return db['UserProfileSection'][_0x8e4b('0x4b')]({'where':{'name':_0x163bfc,'userProfileId':_0x36a554[_0x8e4b('0x51')]},'raw':!![]})[_0x8e4b('0x23')](function(_0x589a3e){if(_0x589a3e&&_0x589a3e[_0x8e4b('0x52')]===0x0){return db[_0x8e4b('0x27')][_0x8e4b('0x4c')]({'name':_0x3cd943[_0x8e4b('0x29')],'resourceId':_0x3cd943['id'],'type':_0x589a3e[_0x8e4b('0x29')],'sectionId':_0x589a3e['id']},{})[_0x8e4b('0x23')](function(){return _0x3b7447;});}else{return _0x3b7447;}})[_0x8e4b('0x47')](function(_0x5eea7c){logger[_0x8e4b('0x53')](_0x8e4b('0x54'),_0x5eea7c);throw _0x5eea7c;});}return _0x3b7447;})[_0x8e4b('0x23')](respondWithResult(_0x282ad4,0xc9))[_0x8e4b('0x47')](handleError(_0x282ad4,null));};exports[_0x8e4b('0x22')]=function(_0x3ec0c8,_0x46315f){if(_0x3ec0c8['body']['id']){delete _0x3ec0c8[_0x8e4b('0x4d')]['id'];}return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')]({'where':{'id':_0x3ec0c8[_0x8e4b('0x49')]['id']}})[_0x8e4b('0x23')](handleEntityNotFound(_0x46315f,null))[_0x8e4b('0x23')](saveUpdates(_0x3ec0c8['body'],null))['then'](respondWithResult(_0x46315f,null))['catch'](handleError(_0x46315f,null));};exports['destroy']=function(_0x3d2434,_0x210a97){return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')]({'where':{'id':_0x3d2434['params']['id']}})['then'](handleEntityNotFound(_0x210a97,null))[_0x8e4b('0x23')](removeEntity(_0x210a97,null))[_0x8e4b('0x47')](handleError(_0x210a97,null));};exports[_0x8e4b('0x55')]=function(_0x118f7c,_0x3e4096){return db['SmsQueue'][_0x8e4b('0x55')]()['then'](respondWithResult(_0x3e4096,null))['catch'](handleError(_0x3e4096,null));};exports['getMembers']=function(_0x59209e,_0x2d29ad,_0x439386){var _0x2cb445={'raw':!![],'where':{}},_0x2d1410={},_0x185b62;return db['SmsQueue'][_0x8e4b('0x56')]({'where':{'id':_0x59209e['params']['id']}})[_0x8e4b('0x23')](handleEntityNotFound(_0x2d29ad,null))[_0x8e4b('0x23')](function(_0x592836){if(_0x592836){_0x185b62=_0x592836[_0x8e4b('0x25')]({'plain':!![]});_0x2d1410['model']=_['keys'](db[_0x8e4b('0x57')]['rawAttributes']);_0x2d1410[_0x8e4b('0x30')]=_[_0x8e4b('0x2f')](_0x59209e['query']);_0x2d1410[_0x8e4b('0x31')]=_[_0x8e4b('0x32')](_0x2d1410[_0x8e4b('0x2e')],_0x2d1410[_0x8e4b('0x30')]);_0x2cb445[_0x8e4b('0x33')]=_[_0x8e4b('0x32')](_0x2d1410[_0x8e4b('0x2e')],qs[_0x8e4b('0x34')](_0x59209e[_0x8e4b('0x30')][_0x8e4b('0x34')]));_0x2cb445[_0x8e4b('0x33')]=_0x2cb445[_0x8e4b('0x33')]['length']?_0x2cb445[_0x8e4b('0x33')]:_0x2d1410['model'];if(!_0x59209e['query'][_0x8e4b('0x36')]('nolimit')){_0x2cb445['limit']=qs[_0x8e4b('0x1c')](_0x59209e['query'][_0x8e4b('0x1c')]);_0x2cb445[_0x8e4b('0x1b')]=qs[_0x8e4b('0x1b')](_0x59209e[_0x8e4b('0x30')][_0x8e4b('0x1b')]);}_0x2cb445['order']=qs['sort'](_0x59209e[_0x8e4b('0x30')][_0x8e4b('0x39')]);_0x2cb445['where']=qs[_0x8e4b('0x31')](_[_0x8e4b('0x3a')](_0x59209e[_0x8e4b('0x30')],_0x2d1410['filters']));_0x2cb445[_0x8e4b('0x3c')][_0x8e4b('0x58')]=_0x592836['id'];if(_0x59209e['query'][_0x8e4b('0x3b')]){_0x2cb445[_0x8e4b('0x3c')]=_[_0x8e4b('0x3d')](_0x2cb445[_0x8e4b('0x3c')],{'$or':_[_0x8e4b('0x3e')](_0x2cb445['attributes'],function(_0x4b8a97){var _0xc987bf={};_0xc987bf[_0x4b8a97]={'$like':'%'+_0x59209e['query'][_0x8e4b('0x3b')]+'%'};return _0xc987bf;})});}_0x2cb445=_['merge']({},_0x2cb445,_0x59209e[_0x8e4b('0x4a')]);return db['UserSmsQueue'][_0x8e4b('0x45')](_0x2cb445);}})[_0x8e4b('0x23')](function(_0xdb82d7){if(_0xdb82d7){return db['User'][_0x8e4b('0x59')]({'where':{'id':_[_0x8e4b('0x3e')](_0xdb82d7,_0x8e4b('0x5a')),'role':_0x8e4b('0x5b')},'attributes':['id',_0x8e4b('0x29'),_0x8e4b('0x5c'),_0x8e4b('0x5d'),_0x8e4b('0x5e')]});}})[_0x8e4b('0x23')](function(_0x43b805){if(_0x43b805){return{'count':_0x43b805[_0x8e4b('0x42')],'rows':_[_0x8e4b('0x3e')](_0x43b805['rows'],function(_0x53d08f){return{'membername':_0x53d08f['name'],'UserId':_0x53d08f['id'],'queue_name':_0x185b62[_0x8e4b('0x29')],'SmsQueueId':_0x185b62['id'],'interface':util[_0x8e4b('0x5f')](_0x8e4b('0x60'),_0x8e4b('0x61'),_0x53d08f[_0x8e4b('0x29')]),'penalty':0x0,'paused':_0x53d08f[_0x8e4b('0x5c')],'createdAt':_0x53d08f[_0x8e4b('0x5e')],'updatedAt':_0x53d08f[_0x8e4b('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d29ad,_0x2cb445))[_0x8e4b('0x47')](handleError(_0x2d29ad,null));};exports[_0x8e4b('0x62')]=function(_0x58558e,_0x5d350b,_0x4abb5c){var _0x180dec={};var _0x59bf37={};var _0x5e0365;var _0x47ef4b;return db[_0x8e4b('0x2c')]['findOne']({'where':{'id':_0x58558e['params']['id']}})[_0x8e4b('0x23')](handleEntityNotFound(_0x5d350b,null))[_0x8e4b('0x23')](function(_0x5e20c9){if(_0x5e20c9){_0x5e0365=_0x5e20c9;_0x59bf37[_0x8e4b('0x2e')]=_[_0x8e4b('0x2f')](db[_0x8e4b('0x63')][_0x8e4b('0x2d')]);_0x59bf37[_0x8e4b('0x30')]=_[_0x8e4b('0x2f')](_0x58558e['query']);_0x59bf37[_0x8e4b('0x31')]=_['intersection'](_0x59bf37[_0x8e4b('0x2e')],_0x59bf37[_0x8e4b('0x30')]);_0x180dec[_0x8e4b('0x33')]=_[_0x8e4b('0x32')](_0x59bf37['model'],qs[_0x8e4b('0x34')](_0x58558e['query']['fields']));_0x180dec[_0x8e4b('0x33')]=_0x180dec[_0x8e4b('0x33')][_0x8e4b('0x35')]?_0x180dec[_0x8e4b('0x33')]:_0x59bf37[_0x8e4b('0x2e')];_0x180dec[_0x8e4b('0x38')]=qs[_0x8e4b('0x39')](_0x58558e[_0x8e4b('0x30')][_0x8e4b('0x39')]);_0x180dec['where']=qs[_0x8e4b('0x31')](_[_0x8e4b('0x3a')](_0x58558e['query'],_0x59bf37[_0x8e4b('0x31')]));if(_0x58558e[_0x8e4b('0x30')]['filter']){_0x180dec['where']=_[_0x8e4b('0x3d')](_0x180dec[_0x8e4b('0x3c')],{'$or':_[_0x8e4b('0x3e')](_0x180dec[_0x8e4b('0x33')],function(_0x1aaeef){var _0x2d02dd={};_0x2d02dd[_0x1aaeef]={'$like':'%'+_0x58558e[_0x8e4b('0x30')]['filter']+'%'};return _0x2d02dd;})});}_0x180dec=_[_0x8e4b('0x3d')]({},_0x180dec,_0x58558e[_0x8e4b('0x4a')]);return _0x5e0365[_0x8e4b('0x62')](_0x180dec);}})[_0x8e4b('0x23')](function(_0x97e25c){if(_0x97e25c){_0x47ef4b=_0x97e25c['length'];if(!_0x58558e[_0x8e4b('0x30')][_0x8e4b('0x36')]('nolimit')){_0x180dec[_0x8e4b('0x1c')]=qs[_0x8e4b('0x1c')](_0x58558e[_0x8e4b('0x30')]['limit']);_0x180dec[_0x8e4b('0x1b')]=qs[_0x8e4b('0x1b')](_0x58558e[_0x8e4b('0x30')][_0x8e4b('0x1b')]);}return _0x5e0365[_0x8e4b('0x62')](_0x180dec);}})[_0x8e4b('0x23')](function(_0x5946ba){if(_0x5946ba){return _0x5946ba?{'count':_0x47ef4b,'rows':_0x5946ba}:null;}})['then'](respondWithResult(_0x5d350b,null))[_0x8e4b('0x47')](handleError(_0x5d350b,null));};exports[_0x8e4b('0x64')]=function(_0x46234e,_0x370b41,_0x5c3796){var _0xc72f9e=_0x46234e['body'][_0x8e4b('0x65')];return db[_0x8e4b('0x63')][_0x8e4b('0x45')]({'where':{'id':_['map'](_0xc72f9e,'id')},'attributes':['id'],'include':[{'model':db[_0x8e4b('0x66')],'as':_0x8e4b('0x67'),'attributes':['id',_0x8e4b('0x29'),_0x8e4b('0x68'),_0x8e4b('0x69'),'interface'],'raw':!![]}]})['then'](function(_0x56bb90){if(_0x56bb90){var _0x51494a=_['flatMap'](_0x56bb90,function(_0x3fef59){var _0x2e4d5d=_0x3fef59[_0x8e4b('0x25')]({'plain':!![]});return _0x2e4d5d[_0x8e4b('0x67')];});return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')]({'where':{'id':_0x46234e[_0x8e4b('0x49')]['id']}})['then'](function(_0x171bb2){return db[_0x8e4b('0x6a')][_0x8e4b('0x6b')](function(_0x1b0465){return _0x171bb2[_0x8e4b('0x64')](_[_0x8e4b('0x3e')](_0xc72f9e,'id'),{'transaction':_0x1b0465})[_0x8e4b('0x23')](function(){return BPromise[_0x8e4b('0x6c')](_0x51494a,function(_0x7f3911){return db[_0x8e4b('0x57')]['findOrCreate']({'where':{'UserId':_0x7f3911['id'],'SmsQueueId':_0x46234e[_0x8e4b('0x49')]['id']},'transaction':_0x1b0465});});})[_0x8e4b('0x23')](function(){_0x51494a['forEach'](function(_0x47c53c){socket['emit'](_0x8e4b('0x6d'),{'UserId':_0x47c53c['id'],'SmsQueueId':_0x171bb2['id']});});});});});}})[_0x8e4b('0x23')](respondWithStatusCode(_0x370b41,null))[_0x8e4b('0x47')](handleError(_0x370b41,null));};exports[_0x8e4b('0x6e')]=function(_0x533df4,_0x3d157f,_0x3cccbc){return db[_0x8e4b('0x63')][_0x8e4b('0x45')]({'where':{'id':_0x533df4[_0x8e4b('0x30')][_0x8e4b('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x8e4b('0x66')],'as':_0x8e4b('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3d157f,null))[_0x8e4b('0x23')](function(_0x5e271a){var _0x4cfdac=_[_0x8e4b('0x3e')](_0x5e271a,'id');var _0x31a75b=[];var _0x4e2f8c=[];var _0x90f1d5=squel[_0x8e4b('0x70')]();_0x90f1d5[_0x8e4b('0x41')](_0x8e4b('0x71'))[_0x8e4b('0x72')](_0x8e4b('0x73'),'tq')[_0x8e4b('0x74')](_0x8e4b('0x75'),'ut',_0x8e4b('0x76'))[_0x8e4b('0x3c')](_0x8e4b('0x77'),_0x533df4['params']['id']);for(var _0x2bc6ef=0x0;_0x2bc6ef<_0x5e271a[_0x8e4b('0x35')];_0x2bc6ef+=0x1){let _0x55a766=_0x5e271a[_0x2bc6ef];for(var _0x480075=0x0;_0x480075<_0x55a766['Agents'][_0x8e4b('0x35')];_0x480075+=0x1){let _0x3816e5=_0x55a766[_0x8e4b('0x67')][_0x480075];var _0x1296bb=_0x90f1d5[_0x8e4b('0x78')]();_0x1296bb[_0x8e4b('0x3c')]('ut.UserId\x20=\x20?',_0x3816e5['id']);_0x4e2f8c[_0x8e4b('0x79')](db['sequelize']['query'](_0x1296bb[_0x8e4b('0x7a')](),{'type':db[_0x8e4b('0x6a')][_0x8e4b('0x7b')][_0x8e4b('0x7c')]})['then'](function(_0x1377e9){if(_0x1377e9[_0x8e4b('0x35')]===0x1){return _0x3816e5['id'];}else{var _0x13a646=_[_0x8e4b('0x7d')](_['map'](_0x1377e9,_0x8e4b('0x7e')),function(_0x2c1932){return _[_0x8e4b('0x7f')](_0x4cfdac,_0x2c1932);});if(_0x13a646){return _0x3816e5['id'];}}}));}}return BPromise['all'](_0x4e2f8c)[_0x8e4b('0x23')](function(_0x154c77){_0x31a75b=_(_0x31a75b)[_0x8e4b('0x80')](_0x154c77)[_0x8e4b('0x81')]()[_0x8e4b('0x82')]();return db[_0x8e4b('0x2c')]['find']({'where':{'id':_0x533df4[_0x8e4b('0x49')]['id']}})[_0x8e4b('0x23')](function(_0xd534c0){return db[_0x8e4b('0x6a')][_0x8e4b('0x6b')](function(_0x29e558){return _0xd534c0[_0x8e4b('0x6e')](_0x533df4['query'][_0x8e4b('0x6f')],{'transaction':_0x29e558})[_0x8e4b('0x23')](function(){if(!_[_0x8e4b('0x83')](_0x31a75b)){return _0xd534c0[_0x8e4b('0x84')](_0x31a75b,{'transaction':_0x29e558});}})[_0x8e4b('0x23')](function(){_0x31a75b[_0x8e4b('0x85')](function(_0x27bcf5){socket[_0x8e4b('0x86')]('userSmsQueue:remove',{'UserId':_0x27bcf5,'SmsQueueId':_0xd534c0['id']});});});});});});})[_0x8e4b('0x23')](respondWithStatusCode(_0x3d157f,null))[_0x8e4b('0x47')](handleError(_0x3d157f,null));};exports[_0x8e4b('0x87')]=function(_0x4521bf,_0x311970,_0x39249f){return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')]({'where':{'id':_0x4521bf[_0x8e4b('0x49')]['id']}})[_0x8e4b('0x23')](handleEntityNotFound(_0x311970,null))[_0x8e4b('0x23')](function(_0x27bb6f){if(_0x27bb6f){return _0x27bb6f[_0x8e4b('0x87')](_0x4521bf['body'][_0x8e4b('0x6f')],_[_0x8e4b('0x88')](_0x4521bf[_0x8e4b('0x4d')],['ids','id'])||{})['spread'](function(_0x24d517){for(var _0xdc0210=0x0;_0xdc0210<_0x4521bf[_0x8e4b('0x4d')][_0x8e4b('0x6f')][_0x8e4b('0x35')];_0xdc0210+=0x1){socket[_0x8e4b('0x86')](_0x8e4b('0x6d'),{'UserId':_0x4521bf[_0x8e4b('0x4d')][_0x8e4b('0x6f')][_0xdc0210],'SmsQueueId':_0x4521bf[_0x8e4b('0x49')]['id']});}return _0x24d517;});}})[_0x8e4b('0x23')](respondWithResult(_0x311970,null))['catch'](handleError(_0x311970,null));};exports[_0x8e4b('0x84')]=function(_0x572d46,_0x456247,_0xff5ba1){return db[_0x8e4b('0x2c')][_0x8e4b('0x4b')]({'where':{'id':_0x572d46[_0x8e4b('0x49')]['id']}})['then'](handleEntityNotFound(_0x456247,null))['then'](function(_0x20f67b){if(_0x20f67b){return _0x20f67b[_0x8e4b('0x84')](_0x572d46[_0x8e4b('0x30')][_0x8e4b('0x6f')])[_0x8e4b('0x23')](function(){if(_[_0x8e4b('0x89')](_0x572d46[_0x8e4b('0x30')]['ids'])){for(var _0x58a5f6=0x0;_0x58a5f6<_0x572d46[_0x8e4b('0x30')]['ids'][_0x8e4b('0x35')];_0x58a5f6+=0x1){socket['emit'](_0x8e4b('0x8a'),{'UserId':Number(_0x572d46[_0x8e4b('0x30')]['ids'][_0x58a5f6]),'SmsQueueId':Number(_0x572d46[_0x8e4b('0x49')]['id'])});}}else{socket['emit'](_0x8e4b('0x8a'),{'UserId':Number(_0x572d46['query'][_0x8e4b('0x6f')]),'SmsQueueId':Number(_0x572d46[_0x8e4b('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x456247,null))[_0x8e4b('0x47')](handleError(_0x456247,null));};exports[_0x8e4b('0x8b')]=function(_0x2e8e24,_0x21af88,_0x4670b2){var _0x3b9cae={};var _0x3fd459={};var _0x271c8a;var _0x28d5d2;return db['SmsQueue'][_0x8e4b('0x56')]({'where':{'id':_0x2e8e24['params']['id']}})['then'](handleEntityNotFound(_0x21af88,null))[_0x8e4b('0x23')](function(_0x5bd89d){if(_0x5bd89d){_0x271c8a=_0x5bd89d;_0x3fd459[_0x8e4b('0x2e')]=_[_0x8e4b('0x2f')](db['User'][_0x8e4b('0x2d')]);_0x3fd459[_0x8e4b('0x30')]=_['keys'](_0x2e8e24[_0x8e4b('0x30')]);_0x3fd459[_0x8e4b('0x31')]=_[_0x8e4b('0x32')](_0x3fd459[_0x8e4b('0x2e')],_0x3fd459['query']);_0x3b9cae['attributes']=_[_0x8e4b('0x32')](_0x3fd459[_0x8e4b('0x2e')],qs[_0x8e4b('0x34')](_0x2e8e24['query']['fields']));_0x3b9cae[_0x8e4b('0x33')]=_0x3b9cae[_0x8e4b('0x33')][_0x8e4b('0x35')]?_0x3b9cae[_0x8e4b('0x33')]:_0x3fd459[_0x8e4b('0x2e')];_0x3b9cae[_0x8e4b('0x38')]=qs[_0x8e4b('0x39')](_0x2e8e24[_0x8e4b('0x30')][_0x8e4b('0x39')]);_0x3b9cae['where']=qs[_0x8e4b('0x31')](_[_0x8e4b('0x3a')](_0x2e8e24['query'],_0x3fd459[_0x8e4b('0x31')]));if(_0x2e8e24['query'][_0x8e4b('0x3b')]){_0x3b9cae[_0x8e4b('0x3c')]=_['merge'](_0x3b9cae[_0x8e4b('0x3c')],{'$or':_[_0x8e4b('0x3e')](_0x3b9cae[_0x8e4b('0x33')],function(_0x10d149){var _0xa7e796={};_0xa7e796[_0x10d149]={'$like':'%'+_0x2e8e24[_0x8e4b('0x30')]['filter']+'%'};return _0xa7e796;})});}_0x3b9cae=_['merge']({},_0x3b9cae,_0x2e8e24[_0x8e4b('0x4a')]);return _0x271c8a[_0x8e4b('0x8b')](_0x3b9cae);}})[_0x8e4b('0x23')](function(_0x76df15){if(_0x76df15){_0x28d5d2=_0x76df15['length'];if(!_0x2e8e24['query'][_0x8e4b('0x36')](_0x8e4b('0x37'))){_0x3b9cae[_0x8e4b('0x1c')]=qs[_0x8e4b('0x1c')](_0x2e8e24['query'][_0x8e4b('0x1c')]);_0x3b9cae[_0x8e4b('0x1b')]=qs[_0x8e4b('0x1b')](_0x2e8e24[_0x8e4b('0x30')]['offset']);}return _0x271c8a['getAgents'](_0x3b9cae);}})[_0x8e4b('0x23')](function(_0x8bb5a9){if(_0x8bb5a9){return _0x8bb5a9?{'count':_0x28d5d2,'rows':_0x8bb5a9}:null;}})[_0x8e4b('0x23')](respondWithResult(_0x21af88,null))[_0x8e4b('0x47')](handleError(_0x21af88,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 3af913d..ad0a95c 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 _0x39c7=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x39c7,0x1e5));var _0x739c=function(_0x23651b,_0x5741ae){_0x23651b=_0x23651b-0x0;var _0xd5c714=_0x39c7[_0x23651b];return _0xd5c714;};'use strict';var EventEmitter=require(_0x739c('0x0'));var SmsQueue=require(_0x739c('0x1'))['db'][_0x739c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x739c('0x3')](0x0);var events={'afterCreate':_0x739c('0x4'),'afterUpdate':_0x739c('0x5'),'afterDestroy':_0x739c('0x6')};function emitEvent(_0x276a7d){return function(_0x2042ec,_0x575ab3,_0x31ad64){SmsQueueEvents[_0x739c('0x7')](_0x276a7d+':'+_0x2042ec['id'],_0x2042ec);SmsQueueEvents[_0x739c('0x7')](_0x276a7d,_0x2042ec);_0x31ad64(null);};}for(var e in events){if(events[_0x739c('0x8')](e)){var event=events[e];SmsQueue[_0x739c('0x9')](e,emitEvent(event));}}module[_0x739c('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0x1a3d=['exports','../../mysqldb','save','update','remove','emit','hook'];(function(_0x3b4e3c,_0x36590f){var _0x4054ae=function(_0x1af4e8){while(--_0x1af4e8){_0x3b4e3c['push'](_0x3b4e3c['shift']());}};_0x4054ae(++_0x36590f);}(_0x1a3d,0x166));var _0xd1a3=function(_0x611a10,_0xb24706){_0x611a10=_0x611a10-0x0;var _0x5cb612=_0x1a3d[_0x611a10];return _0x5cb612;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd1a3('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd1a3('0x1'),'afterUpdate':_0xd1a3('0x2'),'afterDestroy':_0xd1a3('0x3')};function emitEvent(_0x260bd9){return function(_0x31946a,_0x4f13ee,_0x2b67e5){SmsQueueEvents[_0xd1a3('0x4')](_0x260bd9+':'+_0x31946a['id'],_0x31946a);SmsQueueEvents['emit'](_0x260bd9,_0x31946a);_0x2b67e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xd1a3('0x5')](e,emitEvent(event));}}module[_0xd1a3('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 008305e..22608a6 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 _0x06ae=['path','rimraf','../../config/environment','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5de83e,_0x58dc33){var _0x20559a=function(_0x15af49){while(--_0x15af49){_0x5de83e['push'](_0x5de83e['shift']());}};_0x20559a(++_0x58dc33);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var logger=require(_0xe06a('0x1'))(_0xe06a('0x2'));var moment=require(_0xe06a('0x3'));var BPromise=require(_0xe06a('0x4'));var rp=require(_0xe06a('0x5'));var fs=require('fs');var path=require(_0xe06a('0x6'));var rimraf=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x50e6cf,_0x1df79f){return _0x50e6cf[_0xe06a('0x9')](_0xe06a('0xa'),attributes,{'tableName':_0xe06a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['define','SmsQueue','util','../../config/logger','api','moment','bluebird','./smsQueue.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x27a0,0xbf));var _0x027a=function(_0x50da3f,_0x54d5ae){_0x50da3f=_0x50da3f-0x0;var _0x15e02c=_0x27a0[_0x50da3f];return _0x15e02c;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));module[_0x027a('0x6')]=function(_0x137b09,_0x639bec){return _0x137b09[_0x027a('0x7')](_0x027a('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 07d200a..a347b06 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 _0xe43d=['find','model','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','ShowSmsQueue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe43d,0x75));var _0xde43=function(_0x49ee70,_0x115b1e){_0x49ee70=_0x49ee70-0x0;var _0x3a7254=_0xe43d[_0x49ee70];return _0x3a7254;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xde43('0x0'));var BPromise=require(_0xde43('0x1'));var rs=require(_0xde43('0x2'));var fs=require('fs');var Redis=require(_0xde43('0x3'));var db=require(_0xde43('0x4'))['db'];var utils=require(_0xde43('0x5'));var logger=require(_0xde43('0x6'))(_0xde43('0x7'));var config=require(_0xde43('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xde43('0x9')]=_[_0xde43('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xde43('0xb'))(new Redis(config['redis']));require(_0xde43('0xc'))['register'](socket);function respondWithRpcPromise(_0x5967ee,_0x2061ca,_0x19c642){return new BPromise(function(_0x327652,_0x1aeea9){return client[_0xde43('0xd')](_0x5967ee,_0x19c642)[_0xde43('0xe')](function(_0x55333b){logger[_0xde43('0xf')](_0xde43('0x10'),_0x2061ca,_0xde43('0x11'));logger[_0xde43('0x12')](_0xde43('0x13'),_0x2061ca,'request\x20sent',JSON['stringify'](_0x55333b));if(_0x55333b[_0xde43('0x14')]){if(_0x55333b['error'][_0xde43('0x15')]===0x1f4){logger[_0xde43('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2061ca,_0x55333b[_0xde43('0x14')][_0xde43('0x16')]);return _0x1aeea9(_0x55333b[_0xde43('0x14')]['message']);}logger[_0xde43('0x14')](_0xde43('0x10'),_0x2061ca,_0x55333b[_0xde43('0x14')][_0xde43('0x16')]);return _0x327652(_0x55333b[_0xde43('0x14')][_0xde43('0x16')]);}else{logger[_0xde43('0xf')](_0xde43('0x10'),_0x2061ca,_0xde43('0x11'));_0x327652(_0x55333b[_0xde43('0x17')]['message']);}})[_0xde43('0x18')](function(_0x11f642){logger[_0xde43('0x14')](_0xde43('0x10'),_0x2061ca,_0x11f642);_0x1aeea9(_0x11f642);});});}exports[_0xde43('0x19')]=function(_0xa44ed2){var _0x3934e5=this;return new Promise(function(_0x5c36c3,_0x40c11c){return db[_0xde43('0x1a')][_0xde43('0x1b')]({'raw':_0xa44ed2[_0xde43('0x1c')]?_0xa44ed2[_0xde43('0x1c')][_0xde43('0x1d')]===undefined?!![]:![]:!![],'where':_0xa44ed2[_0xde43('0x1c')]?_0xa44ed2['options'][_0xde43('0x1e')]||null:null,'attributes':_0xa44ed2['options']?_0xa44ed2[_0xde43('0x1c')][_0xde43('0x1f')]||null:null,'limit':_0xa44ed2[_0xde43('0x1c')]?_0xa44ed2[_0xde43('0x1c')]['limit']||null:null,'include':_0xa44ed2[_0xde43('0x1c')]?_0xa44ed2[_0xde43('0x1c')][_0xde43('0x20')]?_[_0xde43('0x21')](_0xa44ed2[_0xde43('0x1c')][_0xde43('0x20')],function(_0x3cc6f9){return{'model':db[_0x3cc6f9['model']],'as':_0x3cc6f9['as'],'attributes':_0x3cc6f9[_0xde43('0x1f')],'include':_0x3cc6f9['include']?_[_0xde43('0x21')](_0x3cc6f9[_0xde43('0x20')],function(_0x2dbe79){return{'model':db[_0x2dbe79['model']],'as':_0x2dbe79['as'],'attributes':_0x2dbe79['attributes'],'include':_0x2dbe79[_0xde43('0x20')]?_['map'](_0x2dbe79[_0xde43('0x20')],function(_0x298496){return{'model':db[_0x298496['model']],'as':_0x298496['as'],'attributes':_0x298496[_0xde43('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xde43('0xe')](function(_0x5b57f2){logger[_0xde43('0xf')]('GetSmsQueue',_0xa44ed2);logger[_0xde43('0x12')](_0xde43('0x19'),_0xa44ed2,JSON['stringify'](_0x5b57f2));_0x5c36c3(_0x5b57f2);})[_0xde43('0x18')](function(_0x126715){logger[_0xde43('0x14')](_0xde43('0x19'),_0x126715[_0xde43('0x16')],_0xa44ed2);_0x40c11c(_0x3934e5[_0xde43('0x14')](0x1f4,_0x126715['message']));});});};exports[_0xde43('0x22')]=function(_0x222a8f){var _0x5040dc=this;return new Promise(function(_0x15863d,_0x295a88){return db[_0xde43('0x1a')][_0xde43('0x23')]({'raw':_0x222a8f[_0xde43('0x1c')]?_0x222a8f[_0xde43('0x1c')][_0xde43('0x1d')]===undefined?!![]:![]:!![],'where':_0x222a8f[_0xde43('0x1c')]?_0x222a8f[_0xde43('0x1c')]['where']||null:null,'attributes':_0x222a8f[_0xde43('0x1c')]?_0x222a8f[_0xde43('0x1c')][_0xde43('0x1f')]||null:null,'include':_0x222a8f[_0xde43('0x1c')]?_0x222a8f[_0xde43('0x1c')][_0xde43('0x20')]?_[_0xde43('0x21')](_0x222a8f[_0xde43('0x1c')]['include'],function(_0x218a69){return{'model':db[_0x218a69['model']],'as':_0x218a69['as'],'attributes':_0x218a69[_0xde43('0x1f')],'include':_0x218a69[_0xde43('0x20')]?_[_0xde43('0x21')](_0x218a69[_0xde43('0x20')],function(_0x678dfd){return{'model':db[_0x678dfd[_0xde43('0x24')]],'as':_0x678dfd['as'],'attributes':_0x678dfd[_0xde43('0x1f')],'include':_0x678dfd[_0xde43('0x20')]?_['map'](_0x678dfd[_0xde43('0x20')],function(_0x21cf0c){return{'model':db[_0x21cf0c[_0xde43('0x24')]],'as':_0x21cf0c['as'],'attributes':_0x21cf0c[_0xde43('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xde43('0xe')](function(_0x56562a){logger['info']('ShowSmsQueue',_0x222a8f);logger[_0xde43('0x12')](_0xde43('0x22'),_0x222a8f,JSON[_0xde43('0x25')](_0x56562a));_0x15863d(_0x56562a);})['catch'](function(_0x5233e0){logger[_0xde43('0x14')](_0xde43('0x22'),_0x5233e0[_0xde43('0x16')],_0x222a8f);_0x295a88(_0x5040dc[_0xde43('0x14')](0x1f4,_0x5233e0[_0xde43('0x16')]));});});}; \ No newline at end of file +var _0x4134=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsQueue','findAll','options','where','limit','include','model','map','attributes','GetSmsQueue','find','raw','ShowSmsQueue','lodash','util'];(function(_0x1a062b,_0x1a0e56){var _0x5c16ad=function(_0x674456){while(--_0x674456){_0x1a062b['push'](_0x1a062b['shift']());}};_0x5c16ad(++_0x1a0e56);}(_0x4134,0x1ac));var _0x4413=function(_0x3c4b8b,_0x27f026){_0x3c4b8b=_0x3c4b8b-0x0;var _0x1046dd=_0x4134[_0x3c4b8b];return _0x1046dd;};'use strict';var _=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var moment=require(_0x4413('0x2'));var BPromise=require(_0x4413('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4413('0x4'));var db=require(_0x4413('0x5'))['db'];var utils=require(_0x4413('0x6'));var logger=require('../../config/logger')(_0x4413('0x7'));var config=require(_0x4413('0x8'));var jayson=require(_0x4413('0x9'));var client=jayson[_0x4413('0xa')]['http']({'port':0x232a});config[_0x4413('0xb')]=_[_0x4413('0xc')](config[_0x4413('0xb')],{'host':_0x4413('0xd'),'port':0x18eb});var socket=require(_0x4413('0xe'))(new Redis(config[_0x4413('0xb')]));require(_0x4413('0xf'))[_0x4413('0x10')](socket);function respondWithRpcPromise(_0x4cc8e4,_0x28687f,_0x5b5d51){return new BPromise(function(_0x4288e9,_0x2c4dbe){return client[_0x4413('0x11')](_0x4cc8e4,_0x5b5d51)[_0x4413('0x12')](function(_0x318d13){logger[_0x4413('0x13')](_0x4413('0x14'),_0x28687f,'request\x20sent');logger[_0x4413('0x15')](_0x4413('0x16'),_0x28687f,_0x4413('0x17'),JSON[_0x4413('0x18')](_0x318d13));if(_0x318d13[_0x4413('0x19')]){if(_0x318d13['error'][_0x4413('0x1a')]===0x1f4){logger[_0x4413('0x19')]('SmsQueue,\x20%s,\x20%s',_0x28687f,_0x318d13['error'][_0x4413('0x1b')]);return _0x2c4dbe(_0x318d13[_0x4413('0x19')]['message']);}logger[_0x4413('0x19')]('SmsQueue,\x20%s,\x20%s',_0x28687f,_0x318d13['error'][_0x4413('0x1b')]);return _0x4288e9(_0x318d13[_0x4413('0x19')][_0x4413('0x1b')]);}else{logger[_0x4413('0x13')](_0x4413('0x14'),_0x28687f,'request\x20sent');_0x4288e9(_0x318d13[_0x4413('0x1c')][_0x4413('0x1b')]);}})[_0x4413('0x1d')](function(_0x160deb){logger['error'](_0x4413('0x14'),_0x28687f,_0x160deb);_0x2c4dbe(_0x160deb);});});}exports['GetSmsQueue']=function(_0x4a405e){var _0x161639=this;return new Promise(function(_0x3459a2,_0x17fad3){return db[_0x4413('0x1e')][_0x4413('0x1f')]({'raw':_0x4a405e[_0x4413('0x20')]?_0x4a405e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a405e[_0x4413('0x20')]?_0x4a405e[_0x4413('0x20')][_0x4413('0x21')]||null:null,'attributes':_0x4a405e[_0x4413('0x20')]?_0x4a405e[_0x4413('0x20')]['attributes']||null:null,'limit':_0x4a405e['options']?_0x4a405e[_0x4413('0x20')][_0x4413('0x22')]||null:null,'include':_0x4a405e['options']?_0x4a405e[_0x4413('0x20')]['include']?_['map'](_0x4a405e[_0x4413('0x20')][_0x4413('0x23')],function(_0x547157){return{'model':db[_0x547157[_0x4413('0x24')]],'as':_0x547157['as'],'attributes':_0x547157['attributes'],'include':_0x547157[_0x4413('0x23')]?_[_0x4413('0x25')](_0x547157[_0x4413('0x23')],function(_0x4b4314){return{'model':db[_0x4b4314[_0x4413('0x24')]],'as':_0x4b4314['as'],'attributes':_0x4b4314[_0x4413('0x26')],'include':_0x4b4314[_0x4413('0x23')]?_['map'](_0x4b4314[_0x4413('0x23')],function(_0x3be7b1){return{'model':db[_0x3be7b1['model']],'as':_0x3be7b1['as'],'attributes':_0x3be7b1[_0x4413('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a456d){logger[_0x4413('0x13')](_0x4413('0x27'),_0x4a405e);logger[_0x4413('0x15')](_0x4413('0x27'),_0x4a405e,JSON['stringify'](_0x3a456d));_0x3459a2(_0x3a456d);})[_0x4413('0x1d')](function(_0x558f71){logger['error'](_0x4413('0x27'),_0x558f71['message'],_0x4a405e);_0x17fad3(_0x161639['error'](0x1f4,_0x558f71[_0x4413('0x1b')]));});});};exports['ShowSmsQueue']=function(_0x293775){var _0x2b720b=this;return new Promise(function(_0x47347d,_0x39bb79){return db[_0x4413('0x1e')][_0x4413('0x28')]({'raw':_0x293775[_0x4413('0x20')]?_0x293775['options'][_0x4413('0x29')]===undefined?!![]:![]:!![],'where':_0x293775[_0x4413('0x20')]?_0x293775[_0x4413('0x20')][_0x4413('0x21')]||null:null,'attributes':_0x293775[_0x4413('0x20')]?_0x293775['options']['attributes']||null:null,'include':_0x293775[_0x4413('0x20')]?_0x293775['options'][_0x4413('0x23')]?_[_0x4413('0x25')](_0x293775['options'][_0x4413('0x23')],function(_0x7e0796){return{'model':db[_0x7e0796[_0x4413('0x24')]],'as':_0x7e0796['as'],'attributes':_0x7e0796['attributes'],'include':_0x7e0796[_0x4413('0x23')]?_[_0x4413('0x25')](_0x7e0796['include'],function(_0x5300de){return{'model':db[_0x5300de['model']],'as':_0x5300de['as'],'attributes':_0x5300de[_0x4413('0x26')],'include':_0x5300de['include']?_[_0x4413('0x25')](_0x5300de[_0x4413('0x23')],function(_0x3208e6){return{'model':db[_0x3208e6['model']],'as':_0x3208e6['as'],'attributes':_0x3208e6[_0x4413('0x26')]};}):[]};}):[]};}):[]:[]})[_0x4413('0x12')](function(_0x3fa615){logger[_0x4413('0x13')](_0x4413('0x2a'),_0x293775);logger[_0x4413('0x15')](_0x4413('0x2a'),_0x293775,JSON[_0x4413('0x18')](_0x3fa615));_0x47347d(_0x3fa615);})[_0x4413('0x1d')](function(_0x23dce7){logger[_0x4413('0x19')](_0x4413('0x2a'),_0x23dce7['message'],_0x293775);_0x39bb79(_0x2b720b[_0x4413('0x19')](0x1f4,_0x23dce7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c22ea18..fcd7039 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 _0xa23f=['save','emit','register','smsQueue:','./smsQueue.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa23f,0x7c));var _0xfa23=function(_0x4cb222,_0x1cef20){_0x4cb222=_0x4cb222-0x0;var _0x4936cb=_0xa23f[_0x4cb222];return _0x4936cb;};'use strict';var SmsQueueEvents=require(_0xfa23('0x0'));var events=[_0xfa23('0x1'),'remove','update'];function createListener(_0xb81edf,_0x3f714c){return function(_0x1c85a9){_0x3f714c[_0xfa23('0x2')](_0xb81edf,_0x1c85a9);};}function removeListener(_0x5643b1,_0x86778e){return function(){SmsQueueEvents['removeListener'](_0x5643b1,_0x86778e);};}exports[_0xfa23('0x3')]=function(_0x2df2f5){for(var _0x4c3f4=0x0,_0x3696ef=events['length'];_0x4c3f4<_0x3696ef;_0x4c3f4++){var _0x5a7882=events[_0x4c3f4];var _0x59d53e=createListener(_0xfa23('0x4')+_0x5a7882,_0x2df2f5);SmsQueueEvents['on'](_0x5a7882,_0x59d53e);}}; \ No newline at end of file +var _0x24ce=['register','smsQueue:','save','remove','update','emit','removeListener'];(function(_0x64377d,_0x3b6018){var _0x498afc=function(_0xe89f3c){while(--_0xe89f3c){_0x64377d['push'](_0x64377d['shift']());}};_0x498afc(++_0x3b6018);}(_0x24ce,0x1de));var _0xe24c=function(_0x5c5d51,_0x4200ed){_0x5c5d51=_0x5c5d51-0x0;var _0x23eea4=_0x24ce[_0x5c5d51];return _0x23eea4;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe24c('0x0'),_0xe24c('0x1'),_0xe24c('0x2')];function createListener(_0x1ce128,_0x493bd8){return function(_0x5d60b2){_0x493bd8[_0xe24c('0x3')](_0x1ce128,_0x5d60b2);};}function removeListener(_0x48f802,_0x4d6727){return function(){SmsQueueEvents[_0xe24c('0x4')](_0x48f802,_0x4d6727);};}exports[_0xe24c('0x5')]=function(_0x6f92e0){for(var _0x1ac59c=0x0,_0xe1d970=events['length'];_0x1ac59c<_0xe1d970;_0x1ac59c++){var _0x6d00e=events[_0x1ac59c];var _0x2d8dde=createListener(_0xe24c('0x6')+_0x6d00e,_0x6f92e0);SmsQueueEvents['on'](_0x6d00e,_0x2d8dde);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index dd7c3c9..a73ce49 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 _0xe7de=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x1d80c0,_0x5d3b74){var _0x197c50=function(_0xb2f812){while(--_0xb2f812){_0x1d80c0['push'](_0x1d80c0['shift']());}};_0x197c50(++_0x5d3b74);}(_0xe7de,0x165));var _0xee7d=function(_0x851c30,_0x5bb969){_0x851c30=_0x851c30-0x0;var _0x1aad45=_0xe7de[_0x851c30];return _0x1aad45;};'use strict';var multer=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var path=require(_0xee7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee7d('0x3')]();var auth=require(_0xee7d('0x4'));var interaction=require(_0xee7d('0x5'));var config=require(_0xee7d('0x6'));var controller=require(_0xee7d('0x7'));router[_0xee7d('0x8')]('/',auth[_0xee7d('0x9')](),controller[_0xee7d('0xa')]);router[_0xee7d('0x8')](_0xee7d('0xb'),auth[_0xee7d('0x9')](),controller[_0xee7d('0xc')]);router[_0xee7d('0x8')](_0xee7d('0xd'),auth['isAuthenticated'](),controller[_0xee7d('0xe')]);router[_0xee7d('0xf')]('/',auth[_0xee7d('0x9')](),controller[_0xee7d('0x10')]);router[_0xee7d('0x11')](_0xee7d('0xd'),auth['isAuthenticated'](),controller[_0xee7d('0x12')]);router['delete'](_0xee7d('0xd'),auth[_0xee7d('0x9')](),controller[_0xee7d('0x13')]);module[_0xee7d('0x14')]=router; \ No newline at end of file +var _0x07d7=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','delete'];(function(_0x44acab,_0x49efcb){var _0x17b16c=function(_0x4c2894){while(--_0x4c2894){_0x44acab['push'](_0x44acab['shift']());}};_0x17b16c(++_0x49efcb);}(_0x07d7,0x85));var _0x707d=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x07d7[_0x469ac7];return _0x22f3b0;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var auth=require(_0x707d('0x6'));var interaction=require(_0x707d('0x7'));var config=require(_0x707d('0x8'));var controller=require(_0x707d('0x9'));router[_0x707d('0xa')]('/',auth[_0x707d('0xb')](),controller[_0x707d('0xc')]);router[_0x707d('0xa')](_0x707d('0xd'),auth[_0x707d('0xb')](),controller['describe']);router['get'](_0x707d('0xe'),auth[_0x707d('0xb')](),controller[_0x707d('0xf')]);router[_0x707d('0x10')]('/',auth[_0x707d('0xb')](),controller['create']);router[_0x707d('0x11')](_0x707d('0xe'),auth[_0x707d('0xb')](),controller['update']);router[_0x707d('0x12')](_0x707d('0xe'),auth[_0x707d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0679ce8..d618b7b 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 _0xd1a1=['moment','sequelize','exports','STRING','DATE'];(function(_0x45dbd6,_0x28f307){var _0x29d2c8=function(_0x27b00e){while(--_0x27b00e){_0x45dbd6['push'](_0x45dbd6['shift']());}};_0x29d2c8(++_0x28f307);}(_0xd1a1,0x181));var _0x1d1a=function(_0xd4c31e,_0x4d2703){_0xd4c31e=_0xd4c31e-0x0;var _0x224d47=_0xd1a1[_0xd4c31e];return _0x224d47;};'use strict';var moment=require(_0x1d1a('0x0'));var Sequelize=require(_0x1d1a('0x1'));module[_0x1d1a('0x2')]={'uniqueid':{'type':Sequelize[_0x1d1a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1d1a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1d1a('0x4')]},'acceptAt':{'type':Sequelize[_0x1d1a('0x4')]},'exitAt':{'type':Sequelize[_0x1d1a('0x4')]},'reason':{'type':Sequelize[_0x1d1a('0x3')]}}; \ No newline at end of file +var _0x56a4=['moment','sequelize','exports','STRING','DATE'];(function(_0x53f396,_0x53737f){var _0x402f4f=function(_0x14e9f5){while(--_0x14e9f5){_0x53f396['push'](_0x53f396['shift']());}};_0x402f4f(++_0x53737f);}(_0x56a4,0x69));var _0x456a=function(_0x271474,_0x248441){_0x271474=_0x271474-0x0;var _0x72f117=_0x56a4[_0x271474];return _0x72f117;};'use strict';var moment=require(_0x456a('0x0'));var Sequelize=require(_0x456a('0x1'));module[_0x456a('0x2')]={'uniqueid':{'type':Sequelize[_0x456a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x456a('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x456a('0x4')]},'exitAt':{'type':Sequelize[_0x456a('0x4')]},'reason':{'type':Sequelize[_0x456a('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b2000bc..eb8f09f 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 _0xeecc=['SmsQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','key','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index'];(function(_0x36ee37,_0x23f939){var _0x285864=function(_0x54ffef){while(--_0x54ffef){_0x36ee37['push'](_0x36ee37['shift']());}};_0x285864(++_0x23f939);}(_0xeecc,0x12d));var _0xceec=function(_0x45652a,_0x4c5850){_0x45652a=_0x45652a-0x0;var _0x134929=_0xeecc[_0x45652a];return _0x134929;};'use strict';var pdf=require(_0xceec('0x0'));var emlformat=require(_0xceec('0x1'));var rimraf=require(_0xceec('0x2'));var zipdir=require(_0xceec('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceec('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xceec('0x5'));var path=require(_0xceec('0x6'));var sox=require(_0xceec('0x7'));var csv=require(_0xceec('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xceec('0x9'));var squel=require('squel');var crypto=require(_0xceec('0xa'));var jsforce=require(_0xceec('0xb'));var deskjs=require(_0xceec('0xc'));var toCsv=require(_0xceec('0x8'));var querystring=require(_0xceec('0xd'));var Papa=require(_0xceec('0xe'));var Redis=require(_0xceec('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xceec('0x10'));var hardwareService=require(_0xceec('0x11'));var logger=require(_0xceec('0x12'))(_0xceec('0x13'));var utils=require(_0xceec('0x14'));var config=require('../../config/environment');var db=require(_0xceec('0x15'))['db'];function respondWithStatusCode(_0x299583,_0x37ce83){_0x37ce83=_0x37ce83||0xcc;return function(_0x417594){if(_0x417594){return _0x299583[_0xceec('0x16')](_0x37ce83);}return _0x299583['status'](_0x37ce83)[_0xceec('0x17')]();};}function respondWithResult(_0x5b8216,_0x1df290){_0x1df290=_0x1df290||0xc8;return function(_0x11b183){if(_0x11b183){return _0x5b8216[_0xceec('0x18')](_0x1df290)['json'](_0x11b183);}};}function respondWithFilteredResult(_0x578e51,_0x119110){return function(_0x51f24d){if(_0x51f24d){var _0x303ab3=_0x51f24d[_0xceec('0x19')],_0x228629=_0x119110[_0xceec('0x1a')],_0x14566b=_0x119110[_0xceec('0x1a')]+_0x119110[_0xceec('0x1b')],_0x4206de;if(_0x14566b>=_0x303ab3){_0x14566b=_0x303ab3;_0x4206de=0xc8;}else{_0x4206de=0xce;}_0x578e51[_0xceec('0x18')](_0x4206de);return _0x578e51[_0xceec('0x1c')](_0xceec('0x1d'),_0x228629+'-'+_0x14566b+'/'+_0x303ab3)['json'](_0x51f24d);}return null;};}function patchUpdates(_0x19696){return function(_0x1c0cfc){try{jsonpatch[_0xceec('0x1e')](_0x1c0cfc,_0x19696,!![]);}catch(_0x47162c){return BPromise[_0xceec('0x1f')](_0x47162c);}return _0x1c0cfc[_0xceec('0x20')]();};}function saveUpdates(_0x230c88,_0x422e25){return function(_0x32778b){if(_0x32778b){return _0x32778b[_0xceec('0x21')](_0x230c88)['then'](function(_0xd2a397){return _0xd2a397;});}return null;};}function removeEntity(_0x59922b,_0x2b8fd5){return function(_0x3d628f){if(_0x3d628f){return _0x3d628f['destroy']()[_0xceec('0x22')](function(){_0x59922b['status'](0xcc)[_0xceec('0x17')]();});}};}function handleEntityNotFound(_0x133a83,_0x3600cb){return function(_0x1a7fd){if(!_0x1a7fd){_0x133a83[_0xceec('0x16')](0x194);}return _0x1a7fd;};}function handleError(_0x217c72,_0x35ce70){_0x35ce70=_0x35ce70||0x1f4;return function(_0x505b99){logger[_0xceec('0x23')](_0x505b99['stack']);if(_0x505b99[_0xceec('0x24')]){delete _0x505b99[_0xceec('0x24')];}_0x217c72[_0xceec('0x18')](_0x35ce70)[_0xceec('0x25')](_0x505b99);};}exports[_0xceec('0x26')]=function(_0x2cb07d,_0x591fe2){var _0x2cebb0={},_0x55506f={},_0x1eddcc={'count':0x0,'rows':[]};var _0x3b3923=db[_0xceec('0x27')][_0xceec('0x28')];_0x55506f[_0xceec('0x29')]=_[_0xceec('0x2a')](_0x3b3923);_0x55506f[_0xceec('0x2b')]=_[_0xceec('0x2a')](_0x2cb07d[_0xceec('0x2b')]);_0x55506f['filters']=_[_0xceec('0x2c')](_0x55506f[_0xceec('0x29')],_0x55506f[_0xceec('0x2b')]);_0x2cebb0[_0xceec('0x2d')]=_[_0xceec('0x2c')](_0x55506f[_0xceec('0x29')],qs[_0xceec('0x2e')](_0x2cb07d[_0xceec('0x2b')]['fields']));_0x2cebb0[_0xceec('0x2d')]=_0x2cebb0[_0xceec('0x2d')][_0xceec('0x2f')]?_0x2cebb0['attributes']:_0x55506f['model'];if(!_0x2cb07d[_0xceec('0x2b')]['hasOwnProperty'](_0xceec('0x30'))){_0x2cebb0['limit']=qs[_0xceec('0x1b')](_0x2cb07d[_0xceec('0x2b')][_0xceec('0x1b')]);_0x2cebb0[_0xceec('0x1a')]=qs['offset'](_0x2cb07d['query'][_0xceec('0x1a')]);}_0x2cebb0[_0xceec('0x31')]=qs['sort'](_0x2cb07d['query'][_0xceec('0x32')]);_0x2cebb0[_0xceec('0x33')]=qs[_0xceec('0x34')](_['pick'](_0x2cb07d[_0xceec('0x2b')],_0x55506f['filters']));if(_0x2cb07d['query'][_0xceec('0x35')]){_0x2cebb0['where']=_[_0xceec('0x36')](_0x2cebb0[_0xceec('0x33')],{'$or':_['map'](_0x3b3923,function(_0x783cf7){if(_0x783cf7['type'][_0xceec('0x37')]!==_0xceec('0x38')){var _0x54ae24={};_0x54ae24[_0x783cf7['field']]={'$like':'%'+_0x2cb07d[_0xceec('0x2b')][_0xceec('0x35')]+'%'};return _0x54ae24;}})});}_0x2cebb0=_[_0xceec('0x36')]({},_0x2cebb0,_0x2cb07d[_0xceec('0x39')]);var _0x50ca22={'where':_0x2cebb0[_0xceec('0x33')]};return db[_0xceec('0x27')][_0xceec('0x19')](_0x50ca22)[_0xceec('0x22')](function(_0x308d37){_0x1eddcc[_0xceec('0x19')]=_0x308d37;if(_0x2cb07d[_0xceec('0x2b')][_0xceec('0x3a')]){_0x2cebb0['include']=[{'all':!![]}];}return db[_0xceec('0x27')]['findAll'](_0x2cebb0);})['then'](function(_0x479178){_0x1eddcc[_0xceec('0x3b')]=_0x479178;return _0x1eddcc;})[_0xceec('0x22')](respondWithFilteredResult(_0x591fe2,_0x2cebb0))[_0xceec('0x3c')](handleError(_0x591fe2,null));};exports[_0xceec('0x3d')]=function(_0xcd3c9c,_0x42036d){var _0x231b39={'raw':!![],'where':{'id':_0xcd3c9c[_0xceec('0x3e')]['id']}},_0x5f26eb={};_0x5f26eb[_0xceec('0x29')]=_[_0xceec('0x2a')](db[_0xceec('0x27')][_0xceec('0x28')]);_0x5f26eb[_0xceec('0x2b')]=_[_0xceec('0x2a')](_0xcd3c9c['query']);_0x5f26eb[_0xceec('0x34')]=_[_0xceec('0x2c')](_0x5f26eb['model'],_0x5f26eb[_0xceec('0x2b')]);_0x231b39[_0xceec('0x2d')]=_[_0xceec('0x2c')](_0x5f26eb[_0xceec('0x29')],qs[_0xceec('0x2e')](_0xcd3c9c[_0xceec('0x2b')][_0xceec('0x2e')]));_0x231b39[_0xceec('0x2d')]=_0x231b39[_0xceec('0x2d')][_0xceec('0x2f')]?_0x231b39[_0xceec('0x2d')]:_0x5f26eb[_0xceec('0x29')];if(_0xcd3c9c['query']['includeAll']){_0x231b39[_0xceec('0x3f')]=[{'all':!![]}];}_0x231b39=_['merge']({},_0x231b39,_0xcd3c9c[_0xceec('0x39')]);return db['SmsQueueReport'][_0xceec('0x40')](_0x231b39)[_0xceec('0x22')](handleEntityNotFound(_0x42036d,null))[_0xceec('0x22')](respondWithResult(_0x42036d,null))[_0xceec('0x3c')](handleError(_0x42036d,null));};exports['create']=function(_0x2dccdb,_0x24aa6f){return db[_0xceec('0x27')]['create'](_0x2dccdb[_0xceec('0x41')],{})[_0xceec('0x22')](respondWithResult(_0x24aa6f,0xc9))[_0xceec('0x3c')](handleError(_0x24aa6f,null));};exports[_0xceec('0x21')]=function(_0x30dad2,_0x53f9ab){if(_0x30dad2[_0xceec('0x41')]['id']){delete _0x30dad2[_0xceec('0x41')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x30dad2[_0xceec('0x3e')]['id']}})[_0xceec('0x22')](handleEntityNotFound(_0x53f9ab,null))['then'](saveUpdates(_0x30dad2[_0xceec('0x41')],null))['then'](respondWithResult(_0x53f9ab,null))[_0xceec('0x3c')](handleError(_0x53f9ab,null));};exports[_0xceec('0x42')]=function(_0x3b9206,_0x42811b){return db[_0xceec('0x27')][_0xceec('0x40')]({'where':{'id':_0x3b9206[_0xceec('0x3e')]['id']}})[_0xceec('0x22')](handleEntityNotFound(_0x42811b,null))[_0xceec('0x22')](removeEntity(_0x42811b,null))[_0xceec('0x3c')](handleError(_0x42811b,null));};exports[_0xceec('0x43')]=function(_0x15f0e4,_0x3b690a){return db[_0xceec('0x27')]['describe']()[_0xceec('0x22')](respondWithResult(_0x3b690a,null))[_0xceec('0x3c')](handleError(_0x3b690a,null));}; \ No newline at end of file +var _0x24ca=['show','find','create','body','update','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','reject','save','then','destroy','end','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','SmsQueueReport','count','includeAll','include','findAll','rows','catch'];(function(_0x5a8043,_0x5070ab){var _0xf9e523=function(_0x5e27c6){while(--_0x5e27c6){_0x5a8043['push'](_0x5a8043['shift']());}};_0xf9e523(++_0x5070ab);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0x24ca[_0x3ccdf8];return _0x243dab;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa24c('0x1'));var zipdir=require(_0xa24c('0x2'));var jsonpatch=require(_0xa24c('0x3'));var rp=require('request-promise');var moment=require(_0xa24c('0x4'));var BPromise=require(_0xa24c('0x5'));var Mustache=require(_0xa24c('0x6'));var util=require(_0xa24c('0x7'));var path=require(_0xa24c('0x8'));var sox=require(_0xa24c('0x9'));var csv=require(_0xa24c('0xa'));var ejs=require(_0xa24c('0xb'));var fs=require('fs');var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0xa'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var hardwareService=require(_0xa24c('0x14'));var logger=require(_0xa24c('0x15'))(_0xa24c('0x16'));var utils=require(_0xa24c('0x17'));var config=require(_0xa24c('0x18'));var db=require(_0xa24c('0x19'))['db'];function respondWithStatusCode(_0x5aa811,_0x43bcd3){_0x43bcd3=_0x43bcd3||0xcc;return function(_0x11090c){if(_0x11090c){return _0x5aa811[_0xa24c('0x1a')](_0x43bcd3);}return _0x5aa811[_0xa24c('0x1b')](_0x43bcd3)['end']();};}function respondWithResult(_0x3ad0bf,_0x3c23fc){_0x3c23fc=_0x3c23fc||0xc8;return function(_0x26ff28){if(_0x26ff28){return _0x3ad0bf[_0xa24c('0x1b')](_0x3c23fc)[_0xa24c('0x1c')](_0x26ff28);}};}function respondWithFilteredResult(_0x2d185c,_0x448275){return function(_0x5d4727){if(_0x5d4727){var _0x47a063=_0x5d4727['count'],_0xb80781=_0x448275[_0xa24c('0x1d')],_0x87aa90=_0x448275[_0xa24c('0x1d')]+_0x448275['limit'],_0x49ce53;if(_0x87aa90>=_0x47a063){_0x87aa90=_0x47a063;_0x49ce53=0xc8;}else{_0x49ce53=0xce;}_0x2d185c[_0xa24c('0x1b')](_0x49ce53);return _0x2d185c['set'](_0xa24c('0x1e'),_0xb80781+'-'+_0x87aa90+'/'+_0x47a063)[_0xa24c('0x1c')](_0x5d4727);}return null;};}function patchUpdates(_0x1fcd4b){return function(_0xefdbd9){try{jsonpatch['apply'](_0xefdbd9,_0x1fcd4b,!![]);}catch(_0x16d363){return BPromise[_0xa24c('0x1f')](_0x16d363);}return _0xefdbd9[_0xa24c('0x20')]();};}function saveUpdates(_0x4d4bab,_0x48a768){return function(_0x506424){if(_0x506424){return _0x506424['update'](_0x4d4bab)[_0xa24c('0x21')](function(_0x174b69){return _0x174b69;});}return null;};}function removeEntity(_0x26e9c3,_0x180297){return function(_0x51a275){if(_0x51a275){return _0x51a275[_0xa24c('0x22')]()['then'](function(){_0x26e9c3[_0xa24c('0x1b')](0xcc)[_0xa24c('0x23')]();});}};}function handleEntityNotFound(_0x4a1cda,_0x346ee8){return function(_0x363d52){if(!_0x363d52){_0x4a1cda[_0xa24c('0x1a')](0x194);}return _0x363d52;};}function handleError(_0x188ee2,_0x14cc65){_0x14cc65=_0x14cc65||0x1f4;return function(_0x47e0eb){logger[_0xa24c('0x24')](_0x47e0eb['stack']);if(_0x47e0eb[_0xa24c('0x25')]){delete _0x47e0eb[_0xa24c('0x25')];}_0x188ee2[_0xa24c('0x1b')](_0x14cc65)['send'](_0x47e0eb);};}exports[_0xa24c('0x26')]=function(_0x31c4d9,_0x14fd5a){var _0x314121={},_0x11e4e0={},_0x3ad0e6={'count':0x0,'rows':[]};var _0x39609a=db['SmsQueueReport'][_0xa24c('0x27')];_0x11e4e0[_0xa24c('0x28')]=_[_0xa24c('0x29')](_0x39609a);_0x11e4e0[_0xa24c('0x2a')]=_['keys'](_0x31c4d9[_0xa24c('0x2a')]);_0x11e4e0[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],_0x11e4e0[_0xa24c('0x2a')]);_0x314121[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],qs[_0xa24c('0x2e')](_0x31c4d9['query'][_0xa24c('0x2e')]));_0x314121[_0xa24c('0x2d')]=_0x314121[_0xa24c('0x2d')]['length']?_0x314121[_0xa24c('0x2d')]:_0x11e4e0[_0xa24c('0x28')];if(!_0x31c4d9[_0xa24c('0x2a')]['hasOwnProperty'](_0xa24c('0x2f'))){_0x314121['limit']=qs[_0xa24c('0x30')](_0x31c4d9[_0xa24c('0x2a')]['limit']);_0x314121['offset']=qs[_0xa24c('0x1d')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x1d')]);}_0x314121[_0xa24c('0x31')]=qs[_0xa24c('0x32')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x32')]);_0x314121['where']=qs[_0xa24c('0x2b')](_[_0xa24c('0x33')](_0x31c4d9[_0xa24c('0x2a')],_0x11e4e0[_0xa24c('0x2b')]));if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x34')]){_0x314121[_0xa24c('0x35')]=_[_0xa24c('0x36')](_0x314121[_0xa24c('0x35')],{'$or':_[_0xa24c('0x37')](_0x39609a,function(_0x4c7a30){if(_0x4c7a30[_0xa24c('0x38')][_0xa24c('0x39')]!==_0xa24c('0x3a')){var _0x1b0757={};_0x1b0757[_0x4c7a30['field']]={'$like':'%'+_0x31c4d9['query'][_0xa24c('0x34')]+'%'};return _0x1b0757;}})});}_0x314121=_['merge']({},_0x314121,_0x31c4d9[_0xa24c('0x3b')]);var _0x13f272={'where':_0x314121[_0xa24c('0x35')]};return db[_0xa24c('0x3c')][_0xa24c('0x3d')](_0x13f272)['then'](function(_0x532875){_0x3ad0e6[_0xa24c('0x3d')]=_0x532875;if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x314121[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x3c')][_0xa24c('0x40')](_0x314121);})['then'](function(_0x56f392){_0x3ad0e6[_0xa24c('0x41')]=_0x56f392;return _0x3ad0e6;})[_0xa24c('0x21')](respondWithFilteredResult(_0x14fd5a,_0x314121))[_0xa24c('0x42')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x43')]=function(_0x43beff,_0x4c5b7e){var _0x171c51={'raw':!![],'where':{'id':_0x43beff['params']['id']}},_0x7895e={};_0x7895e['model']=_[_0xa24c('0x29')](db[_0xa24c('0x3c')][_0xa24c('0x27')]);_0x7895e['query']=_['keys'](_0x43beff[_0xa24c('0x2a')]);_0x7895e[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],_0x7895e[_0xa24c('0x2a')]);_0x171c51[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],qs['fields'](_0x43beff['query'][_0xa24c('0x2e')]));_0x171c51[_0xa24c('0x2d')]=_0x171c51[_0xa24c('0x2d')]['length']?_0x171c51[_0xa24c('0x2d')]:_0x7895e[_0xa24c('0x28')];if(_0x43beff[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x171c51[_0xa24c('0x3f')]=[{'all':!![]}];}_0x171c51=_[_0xa24c('0x36')]({},_0x171c51,_0x43beff[_0xa24c('0x3b')]);return db[_0xa24c('0x3c')][_0xa24c('0x44')](_0x171c51)[_0xa24c('0x21')](handleEntityNotFound(_0x4c5b7e,null))['then'](respondWithResult(_0x4c5b7e,null))[_0xa24c('0x42')](handleError(_0x4c5b7e,null));};exports[_0xa24c('0x45')]=function(_0x39a6cd,_0x5aa2b2){return db[_0xa24c('0x3c')][_0xa24c('0x45')](_0x39a6cd[_0xa24c('0x46')],{})[_0xa24c('0x21')](respondWithResult(_0x5aa2b2,0xc9))[_0xa24c('0x42')](handleError(_0x5aa2b2,null));};exports[_0xa24c('0x47')]=function(_0x1a20bd,_0x46f725){if(_0x1a20bd[_0xa24c('0x46')]['id']){delete _0x1a20bd[_0xa24c('0x46')]['id'];}return db[_0xa24c('0x3c')]['find']({'where':{'id':_0x1a20bd[_0xa24c('0x48')]['id']}})[_0xa24c('0x21')](handleEntityNotFound(_0x46f725,null))[_0xa24c('0x21')](saveUpdates(_0x1a20bd[_0xa24c('0x46')],null))[_0xa24c('0x21')](respondWithResult(_0x46f725,null))[_0xa24c('0x42')](handleError(_0x46f725,null));};exports[_0xa24c('0x22')]=function(_0x2250b9,_0x184179){return db['SmsQueueReport']['find']({'where':{'id':_0x2250b9[_0xa24c('0x48')]['id']}})['then'](handleEntityNotFound(_0x184179,null))[_0xa24c('0x21')](removeEntity(_0x184179,null))[_0xa24c('0x42')](handleError(_0x184179,null));};exports['describe']=function(_0x24b3df,_0x2bf401){return db[_0xa24c('0x3c')]['describe']()['then'](respondWithResult(_0x2bf401,null))[_0xa24c('0x42')](handleError(_0x2bf401,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 287bd29..69e914a 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 _0xd371=['define','SmsQueueReport','report_sms_queue','uniqueid','moment','path','rimraf'];(function(_0x43139e,_0x762629){var _0x2bc838=function(_0x593ec3){while(--_0x593ec3){_0x43139e['push'](_0x43139e['shift']());}};_0x2bc838(++_0x762629);}(_0xd371,0x1d2));var _0x1d37=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xd371[_0x544072];return _0x590bf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1d37('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d37('0x1'));var rimraf=require(_0x1d37('0x2'));var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x14c2db,_0x4b3df0){return _0x14c2db[_0x1d37('0x3')](_0x1d37('0x4'),attributes,{'tableName':_0x1d37('0x5'),'paranoid':![],'indexes':[{'name':_0x1d37('0x6'),'fields':[_0x1d37('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0428=['report_sms_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','define'];(function(_0xe07326,_0x1ec941){var _0x541223=function(_0x1e071f){while(--_0x1e071f){_0xe07326['push'](_0xe07326['shift']());}};_0x541223(++_0x1ec941);}(_0x0428,0x1be));var _0x8042=function(_0x4f9879,_0x39c123){_0x4f9879=_0x4f9879-0x0;var _0x34cc96=_0x0428[_0x4f9879];return _0x34cc96;};'use strict';var _=require(_0x8042('0x0'));var util=require(_0x8042('0x1'));var logger=require(_0x8042('0x2'))('api');var moment=require(_0x8042('0x3'));var BPromise=require(_0x8042('0x4'));var rp=require(_0x8042('0x5'));var fs=require('fs');var path=require(_0x8042('0x6'));var rimraf=require(_0x8042('0x7'));var config=require('../../config/environment');var attributes=require(_0x8042('0x8'));module['exports']=function(_0x3475ae,_0x56eb3b){return _0x3475ae[_0x8042('0x9')]('SmsQueueReport',attributes,{'tableName':_0x8042('0xa'),'paranoid':![],'indexes':[{'name':_0x8042('0xb'),'fields':[_0x8042('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 139dc15..a9acda2 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 _0xc604=['SmsQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateSmsQueueReport','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','CreateSmsQueueReport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc604,0x113));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c60('0x0'));var util=require(_0x4c60('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c60('0x2'));var fs=require('fs');var Redis=require(_0x4c60('0x3'));var db=require(_0x4c60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c60('0x5'))(_0x4c60('0x6'));var config=require(_0x4c60('0x7'));var jayson=require(_0x4c60('0x8'));var client=jayson[_0x4c60('0x9')][_0x4c60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e429f,_0x335c62,_0x16d5bf){return new BPromise(function(_0x526f6b,_0x361a9a){return client[_0x4c60('0xb')](_0x4e429f,_0x16d5bf)[_0x4c60('0xc')](function(_0x3f70f9){logger[_0x4c60('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x335c62,'request\x20sent');logger[_0x4c60('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x335c62,'request\x20sent',JSON[_0x4c60('0xf')](_0x3f70f9));if(_0x3f70f9[_0x4c60('0x10')]){if(_0x3f70f9[_0x4c60('0x10')][_0x4c60('0x11')]===0x1f4){logger[_0x4c60('0x10')](_0x4c60('0x12'),_0x335c62,_0x3f70f9[_0x4c60('0x10')]['message']);return _0x361a9a(_0x3f70f9[_0x4c60('0x10')]['message']);}logger[_0x4c60('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x335c62,_0x3f70f9['error'][_0x4c60('0x13')]);return _0x526f6b(_0x3f70f9[_0x4c60('0x10')][_0x4c60('0x13')]);}else{logger[_0x4c60('0xd')](_0x4c60('0x12'),_0x335c62,_0x4c60('0x14'));_0x526f6b(_0x3f70f9['result'][_0x4c60('0x13')]);}})['catch'](function(_0x2daf3c){logger[_0x4c60('0x10')](_0x4c60('0x12'),_0x335c62,_0x2daf3c);_0x361a9a(_0x2daf3c);});});}exports[_0x4c60('0x15')]=function(_0x52feb7){var _0x1413e9=this;return new Promise(function(_0x5c5852,_0x1867fd){return db[_0x4c60('0x16')][_0x4c60('0x17')](_0x52feb7[_0x4c60('0x18')],{'raw':_0x52feb7[_0x4c60('0x19')]?_0x52feb7['options'][_0x4c60('0x1a')]===undefined?!![]:![]:!![]})[_0x4c60('0xc')](function(_0x400dac){logger[_0x4c60('0xd')]('CreateSmsQueueReport',_0x52feb7);logger['debug'](_0x4c60('0x15'),_0x52feb7,JSON[_0x4c60('0xf')](_0x400dac));_0x5c5852(_0x400dac);})['catch'](function(_0x13dfbe){logger[_0x4c60('0x10')](_0x4c60('0x15'),_0x13dfbe[_0x4c60('0x13')],_0x52feb7);_0x1867fd(_0x1413e9[_0x4c60('0x10')](0x1f4,_0x13dfbe[_0x4c60('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x57017c){var _0x6506c4=this;return new Promise(function(_0x7ac4e8,_0x4894b3){return db['SmsQueueReport'][_0x4c60('0x1b')](_0x57017c['body'],{'raw':_0x57017c[_0x4c60('0x19')]?_0x57017c[_0x4c60('0x19')][_0x4c60('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57017c[_0x4c60('0x19')]?_0x57017c[_0x4c60('0x19')][_0x4c60('0x1c')]||null:null,'attributes':_0x57017c[_0x4c60('0x19')]?_0x57017c[_0x4c60('0x19')][_0x4c60('0x1d')]||null:null,'limit':_0x57017c[_0x4c60('0x19')]?_0x57017c['options'][_0x4c60('0x1e')]||null:null})['then'](function(_0x106588){logger[_0x4c60('0xd')](_0x4c60('0x1f'),_0x57017c);logger[_0x4c60('0xe')](_0x4c60('0x1f'),_0x57017c,JSON[_0x4c60('0xf')](_0x106588));_0x7ac4e8(_0x106588);})[_0x4c60('0x20')](function(_0x36185c){logger[_0x4c60('0x10')](_0x4c60('0x1f'),_0x36185c[_0x4c60('0x13')],_0x57017c);_0x4894b3(_0x6506c4[_0x4c60('0x10')](0x1f4,_0x36185c[_0x4c60('0x13')]));});});}; \ No newline at end of file +var _0xe19c=['stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','catch','UpdateSmsQueueReport','update','raw','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe19c,0x1ee));var _0xce19=function(_0x30505b,_0x3b6c06){_0x30505b=_0x30505b-0x0;var _0x4f7466=_0xe19c[_0x30505b];return _0x4f7466;};'use strict';var _=require(_0xce19('0x0'));var util=require(_0xce19('0x1'));var moment=require('moment');var BPromise=require(_0xce19('0x2'));var rs=require(_0xce19('0x3'));var fs=require('fs');var Redis=require(_0xce19('0x4'));var db=require(_0xce19('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce19('0x6'))(_0xce19('0x7'));var config=require(_0xce19('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce19('0x9')][_0xce19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4944ab,_0x55beb8,_0x2aae29){return new BPromise(function(_0x294cb1,_0x3d315e){return client[_0xce19('0xb')](_0x4944ab,_0x2aae29)[_0xce19('0xc')](function(_0x4cb636){logger[_0xce19('0xd')](_0xce19('0xe'),_0x55beb8,_0xce19('0xf'));logger[_0xce19('0x10')](_0xce19('0x11'),_0x55beb8,_0xce19('0xf'),JSON[_0xce19('0x12')](_0x4cb636));if(_0x4cb636[_0xce19('0x13')]){if(_0x4cb636[_0xce19('0x13')]['code']===0x1f4){logger[_0xce19('0x13')](_0xce19('0xe'),_0x55beb8,_0x4cb636[_0xce19('0x13')][_0xce19('0x14')]);return _0x3d315e(_0x4cb636[_0xce19('0x13')][_0xce19('0x14')]);}logger[_0xce19('0x13')](_0xce19('0xe'),_0x55beb8,_0x4cb636[_0xce19('0x13')][_0xce19('0x14')]);return _0x294cb1(_0x4cb636['error'][_0xce19('0x14')]);}else{logger['info'](_0xce19('0xe'),_0x55beb8,'request\x20sent');_0x294cb1(_0x4cb636[_0xce19('0x15')]['message']);}})['catch'](function(_0x5e4237){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x55beb8,_0x5e4237);_0x3d315e(_0x5e4237);});});}exports[_0xce19('0x16')]=function(_0x56b2f9){var _0x47a9cd=this;return new Promise(function(_0x50b269,_0x599872){return db[_0xce19('0x17')][_0xce19('0x18')](_0x56b2f9[_0xce19('0x19')],{'raw':_0x56b2f9['options']?_0x56b2f9[_0xce19('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x140d80){logger[_0xce19('0xd')](_0xce19('0x16'),_0x56b2f9);logger[_0xce19('0x10')](_0xce19('0x16'),_0x56b2f9,JSON[_0xce19('0x12')](_0x140d80));_0x50b269(_0x140d80);})[_0xce19('0x1b')](function(_0x685f2c){logger[_0xce19('0x13')]('CreateSmsQueueReport',_0x685f2c[_0xce19('0x14')],_0x56b2f9);_0x599872(_0x47a9cd[_0xce19('0x13')](0x1f4,_0x685f2c[_0xce19('0x14')]));});});};exports[_0xce19('0x1c')]=function(_0x348708){var _0x408052=this;return new Promise(function(_0x2da900,_0x2f2079){return db[_0xce19('0x17')][_0xce19('0x1d')](_0x348708[_0xce19('0x19')],{'raw':_0x348708['options']?_0x348708[_0xce19('0x1a')][_0xce19('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x348708[_0xce19('0x1a')]?_0x348708[_0xce19('0x1a')]['where']||null:null,'attributes':_0x348708[_0xce19('0x1a')]?_0x348708[_0xce19('0x1a')][_0xce19('0x1f')]||null:null,'limit':_0x348708[_0xce19('0x1a')]?_0x348708[_0xce19('0x1a')]['limit']||null:null})[_0xce19('0xc')](function(_0x432f61){logger['info'](_0xce19('0x1c'),_0x348708);logger['debug'](_0xce19('0x1c'),_0x348708,JSON[_0xce19('0x12')](_0x432f61));_0x2da900(_0x432f61);})[_0xce19('0x1b')](function(_0x4c8ac4){logger['error'](_0xce19('0x1c'),_0x4c8ac4[_0xce19('0x14')],_0x348708);_0x2f2079(_0x408052[_0xce19('0x13')](0x1f4,_0x4c8ac4[_0xce19('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index e6c29d6..9e5c261 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 _0xc546=['isAuthenticated','index','/describe','describe','show','create','/:id','update','delete','exports','path','connect-timeout','express','Router','../../config/environment','get'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xc546,0x6a));var _0x6c54=function(_0x138024,_0x181ed6){_0x138024=_0x138024-0x0;var _0x247bcd=_0xc546[_0x138024];return _0x247bcd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6c54('0x0'));var timeout=require(_0x6c54('0x1'));var express=require(_0x6c54('0x2'));var router=express[_0x6c54('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c54('0x4'));var controller=require('./smsTransferReport.controller');router[_0x6c54('0x5')]('/',auth[_0x6c54('0x6')](),controller[_0x6c54('0x7')]);router[_0x6c54('0x5')](_0x6c54('0x8'),auth[_0x6c54('0x6')](),controller[_0x6c54('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6c54('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6c54('0xb')]);router['put'](_0x6c54('0xc'),auth[_0x6c54('0x6')](),controller[_0x6c54('0xd')]);router[_0x6c54('0xe')](_0x6c54('0xc'),auth[_0x6c54('0x6')](),controller['destroy']);module[_0x6c54('0xf')]=router; \ No newline at end of file +var _0xa1d1=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x455fe5,_0x23ea26){var _0x12b810=function(_0x2cbd0f){while(--_0x2cbd0f){_0x455fe5['push'](_0x455fe5['shift']());}};_0x12b810(++_0x23ea26);}(_0xa1d1,0x151));var _0x1a1d=function(_0x4db8c5,_0xc14895){_0x4db8c5=_0x4db8c5-0x0;var _0x3fe9c7=_0xa1d1[_0x4db8c5];return _0x3fe9c7;};'use strict';var multer=require(_0x1a1d('0x0'));var util=require(_0x1a1d('0x1'));var path=require(_0x1a1d('0x2'));var timeout=require(_0x1a1d('0x3'));var express=require(_0x1a1d('0x4'));var router=express[_0x1a1d('0x5')]();var auth=require(_0x1a1d('0x6'));var interaction=require(_0x1a1d('0x7'));var config=require('../../config/environment');var controller=require(_0x1a1d('0x8'));router[_0x1a1d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1a1d('0xa'),auth[_0x1a1d('0xb')](),controller['describe']);router['get'](_0x1a1d('0xc'),auth[_0x1a1d('0xb')](),controller[_0x1a1d('0xd')]);router[_0x1a1d('0xe')]('/',auth['isAuthenticated'](),controller[_0x1a1d('0xf')]);router['put'](_0x1a1d('0xc'),auth[_0x1a1d('0xb')](),controller[_0x1a1d('0x10')]);router[_0x1a1d('0x11')](_0x1a1d('0xc'),auth[_0x1a1d('0xb')](),controller[_0x1a1d('0x12')]);module[_0x1a1d('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index bab46d2..04ea45d 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 _0x9b9a=['account','agent','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x18d872,_0x36a840){var _0x1f4a8a=function(_0x1e8841){while(--_0x1e8841){_0x18d872['push'](_0x18d872['shift']());}};_0x1f4a8a(++_0x36a840);}(_0x9b9a,0x125));var _0xa9b9=function(_0xde2e2e,_0x5000c3){_0xde2e2e=_0xde2e2e-0x0;var _0x7be9b4=_0x9b9a[_0xde2e2e];return _0x7be9b4;};'use strict';var moment=require('moment');var Sequelize=require(_0xa9b9('0x0'));module[_0xa9b9('0x1')]={'uniqueid':{'type':Sequelize[_0xa9b9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa9b9('0x3')](_0xa9b9('0x4'),_0xa9b9('0x5'),_0xa9b9('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xa9b9('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xa9b9('0x8')]}}; \ No newline at end of file +var _0xa501=['STRING','ENUM','account','queue','DATE','NOW','moment','exports'];(function(_0x579629,_0x33dda5){var _0x1591cb=function(_0x5a799f){while(--_0x5a799f){_0x579629['push'](_0x579629['shift']());}};_0x1591cb(++_0x33dda5);}(_0xa501,0x1ae));var _0x1a50=function(_0x12fede,_0x2e0c84){_0x12fede=_0x12fede-0x0;var _0x5673ef=_0xa501[_0x12fede];return _0x5673ef;};'use strict';var moment=require(_0x1a50('0x0'));var Sequelize=require('sequelize');module[_0x1a50('0x1')]={'uniqueid':{'type':Sequelize[_0x1a50('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1a50('0x3')](_0x1a50('0x4'),'agent',_0x1a50('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x1a50('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x1a50('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f02ff19..fe3bbbb 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 _0x322d=['key','VIRTUAL','field','SmsTransferReport','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','then','error','name','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type'];(function(_0x14431e,_0xa070f9){var _0x5ebc5b=function(_0x3c65e8){while(--_0x3c65e8){_0x14431e['push'](_0x14431e['shift']());}};_0x5ebc5b(++_0xa070f9);}(_0x322d,0x175));var _0xd322=function(_0x1edf39,_0x34dd64){_0x1edf39=_0x1edf39-0x0;var _0x5c842b=_0x322d[_0x1edf39];return _0x5c842b;};'use strict';var pdf=require(_0xd322('0x0'));var emlformat=require(_0xd322('0x1'));var rimraf=require(_0xd322('0x2'));var zipdir=require(_0xd322('0x3'));var jsonpatch=require(_0xd322('0x4'));var rp=require(_0xd322('0x5'));var moment=require(_0xd322('0x6'));var BPromise=require(_0xd322('0x7'));var Mustache=require(_0xd322('0x8'));var util=require(_0xd322('0x9'));var path=require(_0xd322('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd322('0xb'));var fs=require('fs');var _=require(_0xd322('0xc'));var squel=require(_0xd322('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd322('0xe'));var toCsv=require(_0xd322('0xf'));var querystring=require(_0xd322('0x10'));var Papa=require('papaparse');var Redis=require(_0xd322('0x11'));var authService=require(_0xd322('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd322('0x13'));var logger=require('../../config/logger')(_0xd322('0x14'));var utils=require(_0xd322('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f2d8,_0x9fdc8e){_0x9fdc8e=_0x9fdc8e||0xcc;return function(_0x57d662){if(_0x57d662){return _0x14f2d8[_0xd322('0x16')](_0x9fdc8e);}return _0x14f2d8[_0xd322('0x17')](_0x9fdc8e)[_0xd322('0x18')]();};}function respondWithResult(_0x11ef01,_0x57edc8){_0x57edc8=_0x57edc8||0xc8;return function(_0x36d297){if(_0x36d297){return _0x11ef01[_0xd322('0x17')](_0x57edc8)['json'](_0x36d297);}};}function respondWithFilteredResult(_0x50a536,_0x1386af){return function(_0x19877f){if(_0x19877f){var _0x8031e2=_0x19877f[_0xd322('0x19')],_0x35fe9d=_0x1386af[_0xd322('0x1a')],_0x23238e=_0x1386af[_0xd322('0x1a')]+_0x1386af[_0xd322('0x1b')],_0x52fc55;if(_0x23238e>=_0x8031e2){_0x23238e=_0x8031e2;_0x52fc55=0xc8;}else{_0x52fc55=0xce;}_0x50a536[_0xd322('0x17')](_0x52fc55);return _0x50a536[_0xd322('0x1c')](_0xd322('0x1d'),_0x35fe9d+'-'+_0x23238e+'/'+_0x8031e2)[_0xd322('0x1e')](_0x19877f);}return null;};}function patchUpdates(_0x5eba7d){return function(_0x26a8c6){try{jsonpatch['apply'](_0x26a8c6,_0x5eba7d,!![]);}catch(_0x498a21){return BPromise['reject'](_0x498a21);}return _0x26a8c6[_0xd322('0x1f')]();};}function saveUpdates(_0x1cf37c,_0x186a2a){return function(_0x2f5434){if(_0x2f5434){return _0x2f5434['update'](_0x1cf37c)[_0xd322('0x20')](function(_0x11722d){return _0x11722d;});}return null;};}function removeEntity(_0x1dd4da,_0x2eaa2a){return function(_0x3a59a6){if(_0x3a59a6){return _0x3a59a6['destroy']()[_0xd322('0x20')](function(){_0x1dd4da[_0xd322('0x17')](0xcc)[_0xd322('0x18')]();});}};}function handleEntityNotFound(_0x48b6d6,_0x985920){return function(_0x1a4157){if(!_0x1a4157){_0x48b6d6[_0xd322('0x16')](0x194);}return _0x1a4157;};}function handleError(_0x105955,_0x71c6ef){_0x71c6ef=_0x71c6ef||0x1f4;return function(_0x4c30c7){logger[_0xd322('0x21')](_0x4c30c7['stack']);if(_0x4c30c7['name']){delete _0x4c30c7[_0xd322('0x22')];}_0x105955['status'](_0x71c6ef)['send'](_0x4c30c7);};}exports['index']=function(_0x1f1ade,_0x4d8e06){var _0x4165ec={},_0x3c1b22={},_0x197a0d={'count':0x0,'rows':[]};var _0x2b70f5=db['SmsTransferReport'][_0xd322('0x23')];_0x3c1b22['model']=_[_0xd322('0x24')](_0x2b70f5);_0x3c1b22[_0xd322('0x25')]=_[_0xd322('0x24')](_0x1f1ade[_0xd322('0x25')]);_0x3c1b22[_0xd322('0x26')]=_[_0xd322('0x27')](_0x3c1b22['model'],_0x3c1b22['query']);_0x4165ec['attributes']=_[_0xd322('0x27')](_0x3c1b22[_0xd322('0x28')],qs['fields'](_0x1f1ade[_0xd322('0x25')][_0xd322('0x29')]));_0x4165ec[_0xd322('0x2a')]=_0x4165ec[_0xd322('0x2a')][_0xd322('0x2b')]?_0x4165ec[_0xd322('0x2a')]:_0x3c1b22[_0xd322('0x28')];if(!_0x1f1ade['query']['hasOwnProperty'](_0xd322('0x2c'))){_0x4165ec[_0xd322('0x1b')]=qs[_0xd322('0x1b')](_0x1f1ade[_0xd322('0x25')]['limit']);_0x4165ec[_0xd322('0x1a')]=qs[_0xd322('0x1a')](_0x1f1ade[_0xd322('0x25')]['offset']);}_0x4165ec[_0xd322('0x2d')]=qs['sort'](_0x1f1ade['query'][_0xd322('0x2e')]);_0x4165ec[_0xd322('0x2f')]=qs[_0xd322('0x26')](_[_0xd322('0x30')](_0x1f1ade[_0xd322('0x25')],_0x3c1b22[_0xd322('0x26')]));if(_0x1f1ade[_0xd322('0x25')][_0xd322('0x31')]){_0x4165ec[_0xd322('0x2f')]=_[_0xd322('0x32')](_0x4165ec[_0xd322('0x2f')],{'$or':_[_0xd322('0x33')](_0x2b70f5,function(_0x37e0fc){if(_0x37e0fc[_0xd322('0x34')][_0xd322('0x35')]!==_0xd322('0x36')){var _0xfaaa7={};_0xfaaa7[_0x37e0fc[_0xd322('0x37')]]={'$like':'%'+_0x1f1ade[_0xd322('0x25')]['filter']+'%'};return _0xfaaa7;}})});}_0x4165ec=_[_0xd322('0x32')]({},_0x4165ec,_0x1f1ade['options']);var _0x23abde={'where':_0x4165ec['where']};return db[_0xd322('0x38')][_0xd322('0x19')](_0x23abde)[_0xd322('0x20')](function(_0x452ef2){_0x197a0d[_0xd322('0x19')]=_0x452ef2;if(_0x1f1ade[_0xd322('0x25')][_0xd322('0x39')]){_0x4165ec[_0xd322('0x3a')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xd322('0x3b')](_0x4165ec);})[_0xd322('0x20')](function(_0x38f0b4){_0x197a0d[_0xd322('0x3c')]=_0x38f0b4;return _0x197a0d;})['then'](respondWithFilteredResult(_0x4d8e06,_0x4165ec))[_0xd322('0x3d')](handleError(_0x4d8e06,null));};exports[_0xd322('0x3e')]=function(_0x237bbe,_0x44e91c){var _0x97ca72={'raw':!![],'where':{'id':_0x237bbe['params']['id']}},_0x47a200={};_0x47a200[_0xd322('0x28')]=_[_0xd322('0x24')](db[_0xd322('0x38')][_0xd322('0x23')]);_0x47a200[_0xd322('0x25')]=_[_0xd322('0x24')](_0x237bbe[_0xd322('0x25')]);_0x47a200['filters']=_[_0xd322('0x27')](_0x47a200[_0xd322('0x28')],_0x47a200[_0xd322('0x25')]);_0x97ca72[_0xd322('0x2a')]=_[_0xd322('0x27')](_0x47a200[_0xd322('0x28')],qs[_0xd322('0x29')](_0x237bbe[_0xd322('0x25')]['fields']));_0x97ca72[_0xd322('0x2a')]=_0x97ca72[_0xd322('0x2a')][_0xd322('0x2b')]?_0x97ca72['attributes']:_0x47a200[_0xd322('0x28')];if(_0x237bbe[_0xd322('0x25')][_0xd322('0x39')]){_0x97ca72['include']=[{'all':!![]}];}_0x97ca72=_[_0xd322('0x32')]({},_0x97ca72,_0x237bbe[_0xd322('0x3f')]);return db[_0xd322('0x38')][_0xd322('0x40')](_0x97ca72)[_0xd322('0x20')](handleEntityNotFound(_0x44e91c,null))[_0xd322('0x20')](respondWithResult(_0x44e91c,null))[_0xd322('0x3d')](handleError(_0x44e91c,null));};exports[_0xd322('0x41')]=function(_0x19f399,_0x481043){return db[_0xd322('0x38')][_0xd322('0x41')](_0x19f399[_0xd322('0x42')],{})['then'](respondWithResult(_0x481043,0xc9))[_0xd322('0x3d')](handleError(_0x481043,null));};exports[_0xd322('0x43')]=function(_0x38cb5b,_0x1d0ccb){if(_0x38cb5b[_0xd322('0x42')]['id']){delete _0x38cb5b[_0xd322('0x42')]['id'];}return db[_0xd322('0x38')]['find']({'where':{'id':_0x38cb5b[_0xd322('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d0ccb,null))['then'](saveUpdates(_0x38cb5b[_0xd322('0x42')],null))[_0xd322('0x20')](respondWithResult(_0x1d0ccb,null))['catch'](handleError(_0x1d0ccb,null));};exports[_0xd322('0x45')]=function(_0x153e4e,_0x4915e9){return db[_0xd322('0x38')][_0xd322('0x40')]({'where':{'id':_0x153e4e[_0xd322('0x44')]['id']}})[_0xd322('0x20')](handleEntityNotFound(_0x4915e9,null))[_0xd322('0x20')](removeEntity(_0x4915e9,null))[_0xd322('0x3d')](handleError(_0x4915e9,null));};exports[_0xd322('0x46')]=function(_0x3cf605,_0x4b0e15){return db[_0xd322('0x38')]['describe']()[_0xd322('0x20')](respondWithResult(_0x4b0e15,null))[_0xd322('0x3d')](handleError(_0x4b0e15,null));}; \ No newline at end of file +var _0x2c7c=['fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','field','count','findAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','SmsTransferReport','model','keys','query','filters','intersection'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x2c7c,0x1b8));var _0xc2c7=function(_0x53d4d5,_0xbeffd3){_0x53d4d5=_0x53d4d5-0x0;var _0x352055=_0x2c7c[_0x53d4d5];return _0x352055;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc2c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2c7('0x1'));var jsonpatch=require(_0xc2c7('0x2'));var rp=require(_0xc2c7('0x3'));var moment=require('moment');var BPromise=require(_0xc2c7('0x4'));var Mustache=require(_0xc2c7('0x5'));var util=require(_0xc2c7('0x6'));var path=require(_0xc2c7('0x7'));var sox=require('sox');var csv=require(_0xc2c7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc2c7('0x9'));var crypto=require(_0xc2c7('0xa'));var jsforce=require(_0xc2c7('0xb'));var deskjs=require(_0xc2c7('0xc'));var toCsv=require(_0xc2c7('0x8'));var querystring=require('querystring');var Papa=require(_0xc2c7('0xd'));var Redis=require(_0xc2c7('0xe'));var authService=require(_0xc2c7('0xf'));var qs=require(_0xc2c7('0x10'));var hardwareService=require(_0xc2c7('0x11'));var logger=require('../../config/logger')(_0xc2c7('0x12'));var utils=require('../../config/utils');var config=require(_0xc2c7('0x13'));var db=require(_0xc2c7('0x14'))['db'];function respondWithStatusCode(_0x18fdee,_0x25d583){_0x25d583=_0x25d583||0xcc;return function(_0x3b53b3){if(_0x3b53b3){return _0x18fdee[_0xc2c7('0x15')](_0x25d583);}return _0x18fdee[_0xc2c7('0x16')](_0x25d583)['end']();};}function respondWithResult(_0x3280a3,_0x4ea027){_0x4ea027=_0x4ea027||0xc8;return function(_0xd35b39){if(_0xd35b39){return _0x3280a3[_0xc2c7('0x16')](_0x4ea027)[_0xc2c7('0x17')](_0xd35b39);}};}function respondWithFilteredResult(_0x19163c,_0x28ea59){return function(_0x1971e0){if(_0x1971e0){var _0x5a03e1=_0x1971e0['count'],_0x152bc0=_0x28ea59['offset'],_0x3e966a=_0x28ea59[_0xc2c7('0x18')]+_0x28ea59['limit'],_0x3d549c;if(_0x3e966a>=_0x5a03e1){_0x3e966a=_0x5a03e1;_0x3d549c=0xc8;}else{_0x3d549c=0xce;}_0x19163c[_0xc2c7('0x16')](_0x3d549c);return _0x19163c[_0xc2c7('0x19')](_0xc2c7('0x1a'),_0x152bc0+'-'+_0x3e966a+'/'+_0x5a03e1)[_0xc2c7('0x17')](_0x1971e0);}return null;};}function patchUpdates(_0x234c7a){return function(_0x491bf5){try{jsonpatch[_0xc2c7('0x1b')](_0x491bf5,_0x234c7a,!![]);}catch(_0x3ed8b4){return BPromise['reject'](_0x3ed8b4);}return _0x491bf5[_0xc2c7('0x1c')]();};}function saveUpdates(_0x3272c2,_0x5f15fa){return function(_0x4b33a8){if(_0x4b33a8){return _0x4b33a8[_0xc2c7('0x1d')](_0x3272c2)[_0xc2c7('0x1e')](function(_0x2b8b6a){return _0x2b8b6a;});}return null;};}function removeEntity(_0x399565,_0x347b9b){return function(_0x560a71){if(_0x560a71){return _0x560a71[_0xc2c7('0x1f')]()['then'](function(){_0x399565[_0xc2c7('0x16')](0xcc)[_0xc2c7('0x20')]();});}};}function handleEntityNotFound(_0x36e851,_0x2263bd){return function(_0x12bb15){if(!_0x12bb15){_0x36e851[_0xc2c7('0x15')](0x194);}return _0x12bb15;};}function handleError(_0x86498d,_0x23193a){_0x23193a=_0x23193a||0x1f4;return function(_0x539a0c){logger[_0xc2c7('0x21')](_0x539a0c['stack']);if(_0x539a0c[_0xc2c7('0x22')]){delete _0x539a0c[_0xc2c7('0x22')];}_0x86498d[_0xc2c7('0x16')](_0x23193a)[_0xc2c7('0x23')](_0x539a0c);};}exports[_0xc2c7('0x24')]=function(_0x2523c8,_0x15c8aa){var _0x559da6={},_0x23f764={},_0x1081e7={'count':0x0,'rows':[]};var _0x39d25b=db[_0xc2c7('0x25')]['rawAttributes'];_0x23f764[_0xc2c7('0x26')]=_[_0xc2c7('0x27')](_0x39d25b);_0x23f764['query']=_[_0xc2c7('0x27')](_0x2523c8[_0xc2c7('0x28')]);_0x23f764[_0xc2c7('0x29')]=_[_0xc2c7('0x2a')](_0x23f764[_0xc2c7('0x26')],_0x23f764['query']);_0x559da6['attributes']=_[_0xc2c7('0x2a')](_0x23f764['model'],qs[_0xc2c7('0x2b')](_0x2523c8['query'][_0xc2c7('0x2b')]));_0x559da6[_0xc2c7('0x2c')]=_0x559da6[_0xc2c7('0x2c')][_0xc2c7('0x2d')]?_0x559da6['attributes']:_0x23f764[_0xc2c7('0x26')];if(!_0x2523c8[_0xc2c7('0x28')][_0xc2c7('0x2e')](_0xc2c7('0x2f'))){_0x559da6[_0xc2c7('0x30')]=qs[_0xc2c7('0x30')](_0x2523c8['query'][_0xc2c7('0x30')]);_0x559da6[_0xc2c7('0x18')]=qs[_0xc2c7('0x18')](_0x2523c8[_0xc2c7('0x28')]['offset']);}_0x559da6[_0xc2c7('0x31')]=qs[_0xc2c7('0x32')](_0x2523c8[_0xc2c7('0x28')][_0xc2c7('0x32')]);_0x559da6[_0xc2c7('0x33')]=qs[_0xc2c7('0x29')](_[_0xc2c7('0x34')](_0x2523c8[_0xc2c7('0x28')],_0x23f764[_0xc2c7('0x29')]));if(_0x2523c8[_0xc2c7('0x28')][_0xc2c7('0x35')]){_0x559da6['where']=_[_0xc2c7('0x36')](_0x559da6[_0xc2c7('0x33')],{'$or':_['map'](_0x39d25b,function(_0x6ba7b4){if(_0x6ba7b4['type']['key']!=='VIRTUAL'){var _0x521c00={};_0x521c00[_0x6ba7b4[_0xc2c7('0x37')]]={'$like':'%'+_0x2523c8[_0xc2c7('0x28')][_0xc2c7('0x35')]+'%'};return _0x521c00;}})});}_0x559da6=_[_0xc2c7('0x36')]({},_0x559da6,_0x2523c8['options']);var _0xdd28f4={'where':_0x559da6[_0xc2c7('0x33')]};return db[_0xc2c7('0x25')][_0xc2c7('0x38')](_0xdd28f4)['then'](function(_0x216460){_0x1081e7['count']=_0x216460;if(_0x2523c8['query']['includeAll']){_0x559da6['include']=[{'all':!![]}];}return db[_0xc2c7('0x25')][_0xc2c7('0x39')](_0x559da6);})['then'](function(_0x183a77){_0x1081e7[_0xc2c7('0x3a')]=_0x183a77;return _0x1081e7;})[_0xc2c7('0x1e')](respondWithFilteredResult(_0x15c8aa,_0x559da6))['catch'](handleError(_0x15c8aa,null));};exports[_0xc2c7('0x3b')]=function(_0x603f9e,_0x3715f7){var _0x24bab0={'raw':!![],'where':{'id':_0x603f9e[_0xc2c7('0x3c')]['id']}},_0x336ce1={};_0x336ce1[_0xc2c7('0x26')]=_[_0xc2c7('0x27')](db[_0xc2c7('0x25')][_0xc2c7('0x3d')]);_0x336ce1[_0xc2c7('0x28')]=_[_0xc2c7('0x27')](_0x603f9e['query']);_0x336ce1[_0xc2c7('0x29')]=_['intersection'](_0x336ce1[_0xc2c7('0x26')],_0x336ce1['query']);_0x24bab0[_0xc2c7('0x2c')]=_[_0xc2c7('0x2a')](_0x336ce1[_0xc2c7('0x26')],qs[_0xc2c7('0x2b')](_0x603f9e[_0xc2c7('0x28')][_0xc2c7('0x2b')]));_0x24bab0[_0xc2c7('0x2c')]=_0x24bab0[_0xc2c7('0x2c')][_0xc2c7('0x2d')]?_0x24bab0[_0xc2c7('0x2c')]:_0x336ce1[_0xc2c7('0x26')];if(_0x603f9e[_0xc2c7('0x28')]['includeAll']){_0x24bab0[_0xc2c7('0x3e')]=[{'all':!![]}];}_0x24bab0=_[_0xc2c7('0x36')]({},_0x24bab0,_0x603f9e[_0xc2c7('0x3f')]);return db[_0xc2c7('0x25')][_0xc2c7('0x40')](_0x24bab0)['then'](handleEntityNotFound(_0x3715f7,null))[_0xc2c7('0x1e')](respondWithResult(_0x3715f7,null))[_0xc2c7('0x41')](handleError(_0x3715f7,null));};exports[_0xc2c7('0x42')]=function(_0x47bbf9,_0x4de26d){return db['SmsTransferReport']['create'](_0x47bbf9['body'],{})[_0xc2c7('0x1e')](respondWithResult(_0x4de26d,0xc9))[_0xc2c7('0x41')](handleError(_0x4de26d,null));};exports[_0xc2c7('0x1d')]=function(_0x15c8fa,_0x3796d8){if(_0x15c8fa[_0xc2c7('0x43')]['id']){delete _0x15c8fa['body']['id'];}return db[_0xc2c7('0x25')][_0xc2c7('0x40')]({'where':{'id':_0x15c8fa[_0xc2c7('0x3c')]['id']}})[_0xc2c7('0x1e')](handleEntityNotFound(_0x3796d8,null))[_0xc2c7('0x1e')](saveUpdates(_0x15c8fa[_0xc2c7('0x43')],null))[_0xc2c7('0x1e')](respondWithResult(_0x3796d8,null))['catch'](handleError(_0x3796d8,null));};exports[_0xc2c7('0x1f')]=function(_0x5aa195,_0xbe606){return db['SmsTransferReport'][_0xc2c7('0x40')]({'where':{'id':_0x5aa195[_0xc2c7('0x3c')]['id']}})['then'](handleEntityNotFound(_0xbe606,null))[_0xc2c7('0x1e')](removeEntity(_0xbe606,null))['catch'](handleError(_0xbe606,null));};exports[_0xc2c7('0x44')]=function(_0x4cc4d0,_0x44d392){return db[_0xc2c7('0x25')]['describe']()['then'](respondWithResult(_0x44d392,null))[_0xc2c7('0x41')](handleError(_0x44d392,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2f06534..e948c7f 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 _0x58b7=['path','rimraf','../../config/environment','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x22f20e,_0x41a707){var _0x2215ea=function(_0x321944){while(--_0x321944){_0x22f20e['push'](_0x22f20e['shift']());}};_0x2215ea(++_0x41a707);}(_0x58b7,0x162));var _0x758b=function(_0x40e3f1,_0x15444d){_0x40e3f1=_0x40e3f1-0x0;var _0x542631=_0x58b7[_0x40e3f1];return _0x542631;};'use strict';var _=require(_0x758b('0x0'));var util=require(_0x758b('0x1'));var logger=require(_0x758b('0x2'))(_0x758b('0x3'));var moment=require(_0x758b('0x4'));var BPromise=require(_0x758b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x758b('0x6'));var rimraf=require(_0x758b('0x7'));var config=require(_0x758b('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x4a6436,_0x86ed5){return _0x4a6436[_0x758b('0x9')](_0x758b('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x758b('0xb'),'fields':[_0x758b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57c2=['define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x57c2,0x1f0));var _0x257c=function(_0x20cc85,_0x24d409){_0x20cc85=_0x20cc85-0x0;var _0x4be86d=_0x57c2[_0x20cc85];return _0x4be86d;};'use strict';var _=require('lodash');var util=require(_0x257c('0x0'));var logger=require(_0x257c('0x1'))(_0x257c('0x2'));var moment=require('moment');var BPromise=require(_0x257c('0x3'));var rp=require(_0x257c('0x4'));var fs=require('fs');var path=require(_0x257c('0x5'));var rimraf=require('rimraf');var config=require(_0x257c('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x257c('0x7')]=function(_0x421492,_0x2f6cc5){return _0x421492[_0x257c('0x8')](_0x257c('0x9'),attributes,{'tableName':_0x257c('0xa'),'paranoid':![],'indexes':[{'name':_0x257c('0xb'),'fields':[_0x257c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 59e895e..a5c77d6 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 _0x3f96=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x3f96,0x1d3));var _0x63f9=function(_0x55f111,_0x555a0e){_0x55f111=_0x55f111-0x0;var _0xbc1b14=_0x3f96[_0x55f111];return _0xbc1b14;};'use strict';var _=require(_0x63f9('0x0'));var util=require(_0x63f9('0x1'));var moment=require(_0x63f9('0x2'));var BPromise=require(_0x63f9('0x3'));var rs=require(_0x63f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63f9('0x5'))['db'];var utils=require(_0x63f9('0x6'));var logger=require(_0x63f9('0x7'))(_0x63f9('0x8'));var config=require(_0x63f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x63f9('0xa')][_0x63f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ca178,_0x3819ad,_0x494484){return new BPromise(function(_0x131280,_0x258200){return client[_0x63f9('0xc')](_0x1ca178,_0x494484)[_0x63f9('0xd')](function(_0x45cb1f){logger[_0x63f9('0xe')](_0x63f9('0xf'),_0x3819ad,_0x63f9('0x10'));logger['debug'](_0x63f9('0x11'),_0x3819ad,_0x63f9('0x10'),JSON['stringify'](_0x45cb1f));if(_0x45cb1f[_0x63f9('0x12')]){if(_0x45cb1f[_0x63f9('0x12')][_0x63f9('0x13')]===0x1f4){logger['error'](_0x63f9('0xf'),_0x3819ad,_0x45cb1f[_0x63f9('0x12')][_0x63f9('0x14')]);return _0x258200(_0x45cb1f[_0x63f9('0x12')][_0x63f9('0x14')]);}logger[_0x63f9('0x12')](_0x63f9('0xf'),_0x3819ad,_0x45cb1f['error'][_0x63f9('0x14')]);return _0x131280(_0x45cb1f['error'][_0x63f9('0x14')]);}else{logger['info'](_0x63f9('0xf'),_0x3819ad,_0x63f9('0x10'));_0x131280(_0x45cb1f[_0x63f9('0x15')][_0x63f9('0x14')]);}})[_0x63f9('0x16')](function(_0x1da33e){logger[_0x63f9('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3819ad,_0x1da33e);_0x258200(_0x1da33e);});});} \ No newline at end of file +var _0x6d38=['request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x14dd62,_0x149552){var _0x3ee652=function(_0x59e4ed){while(--_0x59e4ed){_0x14dd62['push'](_0x14dd62['shift']());}};_0x3ee652(++_0x149552);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index c241e20..16179d7 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 _0x7dea=['index','/:id','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated'];(function(_0x51a123,_0x4df9f4){var _0x8b201a=function(_0x1e895b){while(--_0x1e895b){_0x51a123['push'](_0x51a123['shift']());}};_0x8b201a(++_0x4df9f4);}(_0x7dea,0x71));var _0xa7de=function(_0x1df899,_0x4f3cf6){_0x1df899=_0x1df899-0x0;var _0x3dd147=_0x7dea[_0x1df899];return _0x3dd147;};'use strict';var multer=require(_0xa7de('0x0'));var util=require('util');var path=require(_0xa7de('0x1'));var timeout=require(_0xa7de('0x2'));var express=require(_0xa7de('0x3'));var router=express[_0xa7de('0x4')]();var auth=require(_0xa7de('0x5'));var interaction=require(_0xa7de('0x6'));var config=require(_0xa7de('0x7'));var controller=require(_0xa7de('0x8'));router[_0xa7de('0x9')]('/',auth[_0xa7de('0xa')](),controller[_0xa7de('0xb')]);router[_0xa7de('0x9')](_0xa7de('0xc'),auth['isAuthenticated'](),controller[_0xa7de('0xd')]);router[_0xa7de('0x9')](_0xa7de('0xe'),auth[_0xa7de('0xa')](),controller[_0xa7de('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f5f0f,_0x4350b2,_0x50bba6){_0x50bba6(null,path[_0xa7de('0x10')](config[_0xa7de('0x11')],_0xa7de('0x12')));},'filename':function(_0x58ee69,_0x578594,_0x29f2ca){_0x578594[_0xa7de('0x13')]=_0x578594[_0xa7de('0x13')][_0xa7de('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29f2ca(null,util[_0xa7de('0x15')](_0xa7de('0x16'),path[_0xa7de('0x17')](_0x578594[_0xa7de('0x13')],path[_0xa7de('0x18')](_0x578594[_0xa7de('0x13')])),Date[_0xa7de('0x19')](),path['extname'](_0x578594['originalname'])));}})});router[_0xa7de('0x1a')]('/',upload['single']('file'),controller['create']);router[_0xa7de('0x1b')](_0xa7de('0xc'),auth[_0xa7de('0xa')](),controller[_0xa7de('0x1c')]);router[_0xa7de('0x1d')](_0xa7de('0xc'),auth[_0xa7de('0xa')](),controller[_0xa7de('0x1d')]);module[_0xa7de('0x1e')]=router; \ No newline at end of file +var _0x29e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','post','single','file','create','put','/:id','update','delete','exports','path','connect-timeout','express'];(function(_0x43c24f,_0x50f615){var _0x337ec5=function(_0x1fdb76){while(--_0x1fdb76){_0x43c24f['push'](_0x43c24f['shift']());}};_0x337ec5(++_0x50f615);}(_0x29e9,0x71));var _0x929e=function(_0x2e9af2,_0x1c70be){_0x2e9af2=_0x2e9af2-0x0;var _0x39cbe3=_0x29e9[_0x2e9af2];return _0x39cbe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x929e('0x0'));var timeout=require(_0x929e('0x1'));var express=require(_0x929e('0x2'));var router=express['Router']();var auth=require(_0x929e('0x3'));var interaction=require(_0x929e('0x4'));var config=require(_0x929e('0x5'));var controller=require('./sound.controller');router[_0x929e('0x6')]('/',auth[_0x929e('0x7')](),controller[_0x929e('0x8')]);router['get']('/:id',auth[_0x929e('0x7')](),controller[_0x929e('0x9')]);router[_0x929e('0x6')](_0x929e('0xa'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x929e('0xb')]({'destination':function(_0x3e474a,_0x59f0b6,_0x2a28d4){_0x2a28d4(null,path[_0x929e('0xc')](config[_0x929e('0xd')],_0x929e('0xe')));},'filename':function(_0x3eafbc,_0x3b3a0d,_0x51e513){_0x3b3a0d[_0x929e('0xf')]=_0x3b3a0d[_0x929e('0xf')][_0x929e('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x51e513(null,util['format'](_0x929e('0x11'),path['basename'](_0x3b3a0d['originalname'],path[_0x929e('0x12')](_0x3b3a0d[_0x929e('0xf')])),Date[_0x929e('0x13')](),path[_0x929e('0x12')](_0x3b3a0d[_0x929e('0xf')])));}})});router[_0x929e('0x14')]('/',upload[_0x929e('0x15')](_0x929e('0x16')),controller[_0x929e('0x17')]);router[_0x929e('0x18')](_0x929e('0x19'),auth[_0x929e('0x7')](),controller[_0x929e('0x1a')]);router[_0x929e('0x1b')](_0x929e('0x19'),auth[_0x929e('0x7')](),controller[_0x929e('0x1b')]);module[_0x929e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2667408..3f8b60b 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 _0x8064=['INTEGER','name','STRING','FLOAT','BIGINT'];(function(_0x52d231,_0x37bc71){var _0x550ac5=function(_0x5215c2){while(--_0x5215c2){_0x52d231['push'](_0x52d231['shift']());}};_0x550ac5(++_0x37bc71);}(_0x8064,0x6a));var _0x4806=function(_0x189156,_0x3fdc0e){_0x189156=_0x189156-0x0;var _0x2924be=_0x8064[_0x189156];return _0x2924be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4806('0x0'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4806('0x1')]},'display_name':{'type':Sequelize[_0x4806('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x4806('0x1')]},'original_format':{'type':Sequelize[_0x4806('0x1')]},'original_duration':{'type':Sequelize[_0x4806('0x2')]},'original_sampleCount':{'type':Sequelize[_0x4806('0x3')]},'original_channelCount':{'type':Sequelize[_0x4806('0x4')]},'original_bitRate':{'type':Sequelize[_0x4806('0x3')]},'original_sampleRate':{'type':Sequelize[_0x4806('0x4')]},'converted_format':{'type':Sequelize[_0x4806('0x1')]},'converted_duration':{'type':Sequelize[_0x4806('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x4806('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x91b1=['FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x3dd329,_0x4e5951){var _0x40ad32=function(_0x38c4b1){while(--_0x38c4b1){_0x3dd329['push'](_0x3dd329['shift']());}};_0x40ad32(++_0x4e5951);}(_0x91b1,0x67));var _0x191b=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0x91b1[_0x4e9274];return _0x8b474c;};'use strict';var Sequelize=require(_0x191b('0x0'));module['exports']={'name':{'type':Sequelize[_0x191b('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x191b('0x1')]},'display_name':{'type':Sequelize[_0x191b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x191b('0x1')]},'original_format':{'type':Sequelize[_0x191b('0x1')]},'original_duration':{'type':Sequelize[_0x191b('0x2')]},'original_sampleCount':{'type':Sequelize[_0x191b('0x3')]},'original_channelCount':{'type':Sequelize[_0x191b('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x191b('0x4')]},'converted_format':{'type':Sequelize[_0x191b('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x191b('0x3')]},'converted_channelCount':{'type':Sequelize[_0x191b('0x4')]},'converted_bitRate':{'type':Sequelize[_0x191b('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x191b('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index aa945bf..c076342 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 _0x9b89=['find','save_name','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','download','root','%s.%s','converted_format','format','create','file','basename','filename','extname','originalname','wav','join','server/files/sounds/original','info','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','Sound','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','field','merge','options','includeAll','include','findAll','rows','catch','show','params','length'];(function(_0x1ac58e,_0xe0cb6c){var _0x50065e=function(_0x2d246a){while(--_0x2d246a){_0x1ac58e['push'](_0x1ac58e['shift']());}};_0x50065e(++_0xe0cb6c);}(_0x9b89,0xa6));var _0x99b8=function(_0x5964e0,_0x2957ee){_0x5964e0=_0x5964e0-0x0;var _0x3266e5=_0x9b89[_0x5964e0];return _0x3266e5;};'use strict';var pdf=require(_0x99b8('0x0'));var emlformat=require(_0x99b8('0x1'));var rimraf=require(_0x99b8('0x2'));var zipdir=require(_0x99b8('0x3'));var jsonpatch=require(_0x99b8('0x4'));var rp=require(_0x99b8('0x5'));var moment=require('moment');var BPromise=require(_0x99b8('0x6'));var Mustache=require(_0x99b8('0x7'));var util=require('util');var path=require(_0x99b8('0x8'));var sox=require(_0x99b8('0x9'));var csv=require('to-csv');var ejs=require(_0x99b8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x99b8('0xb'));var crypto=require(_0x99b8('0xc'));var jsforce=require(_0x99b8('0xd'));var deskjs=require(_0x99b8('0xe'));var toCsv=require(_0x99b8('0xf'));var querystring=require('querystring');var Papa=require(_0x99b8('0x10'));var Redis=require('ioredis');var authService=require(_0x99b8('0x11'));var qs=require(_0x99b8('0x12'));var hardwareService=require(_0x99b8('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x99b8('0x14'));var db=require(_0x99b8('0x15'))['db'];function respondWithStatusCode(_0x5c6d4a,_0x44c4a7){_0x44c4a7=_0x44c4a7||0xcc;return function(_0x421e6d){if(_0x421e6d){return _0x5c6d4a[_0x99b8('0x16')](_0x44c4a7);}return _0x5c6d4a[_0x99b8('0x17')](_0x44c4a7)[_0x99b8('0x18')]();};}function respondWithResult(_0x618bf3,_0x4eb6ff){_0x4eb6ff=_0x4eb6ff||0xc8;return function(_0x4221bd){if(_0x4221bd){return _0x618bf3['status'](_0x4eb6ff)[_0x99b8('0x19')](_0x4221bd);}};}function respondWithFilteredResult(_0x18a23b,_0x286007){return function(_0x4df845){if(_0x4df845){var _0x22ceec=_0x4df845[_0x99b8('0x1a')],_0x22e060=_0x286007['offset'],_0x4c5a70=_0x286007[_0x99b8('0x1b')]+_0x286007[_0x99b8('0x1c')],_0x468458;if(_0x4c5a70>=_0x22ceec){_0x4c5a70=_0x22ceec;_0x468458=0xc8;}else{_0x468458=0xce;}_0x18a23b[_0x99b8('0x17')](_0x468458);return _0x18a23b[_0x99b8('0x1d')](_0x99b8('0x1e'),_0x22e060+'-'+_0x4c5a70+'/'+_0x22ceec)[_0x99b8('0x19')](_0x4df845);}return null;};}function patchUpdates(_0x2bf41){return function(_0x7eec93){try{jsonpatch[_0x99b8('0x1f')](_0x7eec93,_0x2bf41,!![]);}catch(_0x2ec89c){return BPromise[_0x99b8('0x20')](_0x2ec89c);}return _0x7eec93[_0x99b8('0x21')]();};}function saveUpdates(_0x13b88a,_0x420bdb){return function(_0x1fc34a){if(_0x1fc34a){return _0x1fc34a[_0x99b8('0x22')](_0x13b88a)[_0x99b8('0x23')](function(_0x3792cd){return _0x3792cd;});}return null;};}function removeEntity(_0x69645,_0x4be416){return function(_0x376e20){if(_0x376e20){return _0x376e20[_0x99b8('0x24')]()[_0x99b8('0x23')](function(){var _0x91343b=_0x376e20['get']({'plain':!![]});var _0x1fac13=_0x99b8('0x25');return db[_0x99b8('0x26')][_0x99b8('0x24')]({'where':{'type':_0x1fac13,'resourceId':_0x91343b['id']}})[_0x99b8('0x23')](function(){return _0x376e20;});})[_0x99b8('0x23')](function(){_0x69645['status'](0xcc)[_0x99b8('0x18')]();});}};}function handleEntityNotFound(_0x1773ac,_0x32fc60){return function(_0x1ef246){if(!_0x1ef246){_0x1773ac['sendStatus'](0x194);}return _0x1ef246;};}function handleError(_0x575378,_0x4d41ff){_0x4d41ff=_0x4d41ff||0x1f4;return function(_0x505726){logger[_0x99b8('0x27')](_0x505726[_0x99b8('0x28')]);if(_0x505726[_0x99b8('0x29')]){delete _0x505726[_0x99b8('0x29')];}_0x575378[_0x99b8('0x17')](_0x4d41ff)[_0x99b8('0x2a')](_0x505726);};}exports['index']=function(_0xa6cefe,_0x117a14){var _0x137a05={},_0x23d0c5={},_0x89cd72={'count':0x0,'rows':[]};var _0x3b2b7b=db[_0x99b8('0x2b')][_0x99b8('0x2c')];_0x23d0c5['model']=_[_0x99b8('0x2d')](_0x3b2b7b);_0x23d0c5[_0x99b8('0x2e')]=_['keys'](_0xa6cefe[_0x99b8('0x2e')]);_0x23d0c5['filters']=_[_0x99b8('0x2f')](_0x23d0c5[_0x99b8('0x30')],_0x23d0c5[_0x99b8('0x2e')]);_0x137a05[_0x99b8('0x31')]=_[_0x99b8('0x2f')](_0x23d0c5['model'],qs[_0x99b8('0x32')](_0xa6cefe[_0x99b8('0x2e')][_0x99b8('0x32')]));_0x137a05[_0x99b8('0x31')]=_0x137a05[_0x99b8('0x31')]['length']?_0x137a05[_0x99b8('0x31')]:_0x23d0c5[_0x99b8('0x30')];if(!_0xa6cefe[_0x99b8('0x2e')][_0x99b8('0x33')](_0x99b8('0x34'))){_0x137a05[_0x99b8('0x1c')]=qs[_0x99b8('0x1c')](_0xa6cefe[_0x99b8('0x2e')]['limit']);_0x137a05['offset']=qs[_0x99b8('0x1b')](_0xa6cefe[_0x99b8('0x2e')]['offset']);}_0x137a05[_0x99b8('0x35')]=qs[_0x99b8('0x36')](_0xa6cefe[_0x99b8('0x2e')]['sort']);_0x137a05[_0x99b8('0x37')]=qs['filters'](_['pick'](_0xa6cefe[_0x99b8('0x2e')],_0x23d0c5[_0x99b8('0x38')]));if(_0xa6cefe[_0x99b8('0x2e')][_0x99b8('0x39')]){_0x137a05['where']=_['merge'](_0x137a05[_0x99b8('0x37')],{'$or':_['map'](_0x3b2b7b,function(_0x456c8f){if(_0x456c8f[_0x99b8('0x3a')]['key']!=='VIRTUAL'){var _0x374110={};_0x374110[_0x456c8f[_0x99b8('0x3b')]]={'$like':'%'+_0xa6cefe['query'][_0x99b8('0x39')]+'%'};return _0x374110;}})});}_0x137a05=_[_0x99b8('0x3c')]({},_0x137a05,_0xa6cefe[_0x99b8('0x3d')]);var _0x4f8f27={'where':_0x137a05[_0x99b8('0x37')]};return db['Sound'][_0x99b8('0x1a')](_0x4f8f27)[_0x99b8('0x23')](function(_0x1296dd){_0x89cd72[_0x99b8('0x1a')]=_0x1296dd;if(_0xa6cefe[_0x99b8('0x2e')][_0x99b8('0x3e')]){_0x137a05[_0x99b8('0x3f')]=[{'all':!![]}];}return db[_0x99b8('0x2b')][_0x99b8('0x40')](_0x137a05);})[_0x99b8('0x23')](function(_0x11429d){_0x89cd72[_0x99b8('0x41')]=_0x11429d;return _0x89cd72;})[_0x99b8('0x23')](respondWithFilteredResult(_0x117a14,_0x137a05))[_0x99b8('0x42')](handleError(_0x117a14,null));};exports[_0x99b8('0x43')]=function(_0x56bc03,_0x2fa3ba){var _0x577dd2={'raw':!![],'where':{'id':_0x56bc03[_0x99b8('0x44')]['id']}},_0x54309c={};_0x54309c['model']=_[_0x99b8('0x2d')](db['Sound'][_0x99b8('0x2c')]);_0x54309c['query']=_[_0x99b8('0x2d')](_0x56bc03[_0x99b8('0x2e')]);_0x54309c[_0x99b8('0x38')]=_['intersection'](_0x54309c[_0x99b8('0x30')],_0x54309c[_0x99b8('0x2e')]);_0x577dd2[_0x99b8('0x31')]=_['intersection'](_0x54309c[_0x99b8('0x30')],qs[_0x99b8('0x32')](_0x56bc03[_0x99b8('0x2e')]['fields']));_0x577dd2[_0x99b8('0x31')]=_0x577dd2[_0x99b8('0x31')][_0x99b8('0x45')]?_0x577dd2[_0x99b8('0x31')]:_0x54309c[_0x99b8('0x30')];if(_0x56bc03[_0x99b8('0x2e')][_0x99b8('0x3e')]){_0x577dd2['include']=[{'all':!![]}];}_0x577dd2=_['merge']({},_0x577dd2,_0x56bc03['options']);return db[_0x99b8('0x2b')]['find'](_0x577dd2)[_0x99b8('0x23')](handleEntityNotFound(_0x2fa3ba,null))[_0x99b8('0x23')](respondWithResult(_0x2fa3ba,null))[_0x99b8('0x42')](handleError(_0x2fa3ba,null));};exports['download']=function(_0x229642,_0x11b45a,_0x26af29){return db[_0x99b8('0x2b')][_0x99b8('0x46')]({'where':{'id':_0x229642['params']['id']},'attributes':['name',_0x99b8('0x47'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x11b45a,null))[_0x99b8('0x23')](function(_0x47f13a){if(_0x47f13a){if(!fs['existsSync'](path['join'](config['root'],_0x99b8('0x48'),_0x47f13a[_0x99b8('0x47')]+'.'+_0x47f13a['converted_format']))){throw new db[(_0x99b8('0x49'))]['ValidationError'](_0x99b8('0x4a'));}return _0x11b45a[_0x99b8('0x4b')](path['join'](config[_0x99b8('0x4c')],_0x99b8('0x48'),util['format'](_0x99b8('0x4d'),_0x47f13a['save_name'],_0x47f13a[_0x99b8('0x4e')])),util[_0x99b8('0x4f')](_0x99b8('0x4d'),_0x47f13a[_0x99b8('0x29')],_0x47f13a[_0x99b8('0x4e')]));}return null;})['catch'](handleError(_0x11b45a,null));};exports[_0x99b8('0x50')]=function(_0x16bcd1,_0x555b1e,_0x3cbd8d){var _0x4f6291={'name':path['basename'](_0x16bcd1[_0x99b8('0x51')]['originalname'],path['extname'](_0x16bcd1[_0x99b8('0x51')]['originalname'])),'save_name':path[_0x99b8('0x52')](_0x16bcd1[_0x99b8('0x51')][_0x99b8('0x53')],path[_0x99b8('0x54')](_0x16bcd1[_0x99b8('0x51')]['filename'])),'original_format':path[_0x99b8('0x54')](_0x16bcd1[_0x99b8('0x51')][_0x99b8('0x55')])['substring'](0x1),'converted_format':_0x99b8('0x56')};var _0x24bba2=path[_0x99b8('0x57')](config[_0x99b8('0x4c')],_0x99b8('0x58'),_0x16bcd1['file'][_0x99b8('0x53')]);var _0x17b267=path[_0x99b8('0x57')](config[_0x99b8('0x4c')],'server/files/sounds/converted',util[_0x99b8('0x4f')](_0x99b8('0x4d'),path[_0x99b8('0x52')](_0x16bcd1[_0x99b8('0x51')][_0x99b8('0x53')],path[_0x99b8('0x54')](_0x16bcd1[_0x99b8('0x51')][_0x99b8('0x53')])),_0x4f6291['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x24bba2);logger[_0x99b8('0x59')]('Sound\x20upload\x20destination:\x20%s',_0x17b267);try{fs[_0x99b8('0x5a')](_0x24bba2,parseInt(_0x99b8('0x5b'),0x8));var _0x3355ed=sox[_0x99b8('0x5c')](_0x24bba2,_0x17b267,{'sampleRate':0x1f40,'format':_0x99b8('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3355ed['on'](_0x99b8('0x27'),function(_0x42e0f0){fs[_0x99b8('0x5d')](_0x24bba2);_0x555b1e[_0x99b8('0x17')](0x1f4)[_0x99b8('0x2a')](_0x42e0f0);});_0x3355ed['on'](_0x99b8('0x5e'),function(_0x5724cc){_0x4f6291['original_duration']=isNaN(_0x5724cc[_0x99b8('0x5f')])?null:_0x5724cc[_0x99b8('0x5f')]*0x3e8;_0x4f6291['original_sampleCount']=isNaN(_0x5724cc[_0x99b8('0x60')])?null:_0x5724cc[_0x99b8('0x60')];_0x4f6291[_0x99b8('0x61')]=isNaN(_0x5724cc[_0x99b8('0x62')])?null:_0x5724cc[_0x99b8('0x62')];_0x4f6291[_0x99b8('0x63')]=isNaN(_0x5724cc['bitRate'])?null:_0x5724cc['bitRate'];_0x4f6291[_0x99b8('0x64')]=isNaN(_0x5724cc[_0x99b8('0x65')])?null:_0x5724cc['sampleRate'];});_0x3355ed['on']('dest',function(_0x1ad90c){_0x4f6291[_0x99b8('0x66')]=isNaN(_0x1ad90c[_0x99b8('0x5f')])?null:_0x1ad90c[_0x99b8('0x5f')]*0x3e8;_0x4f6291[_0x99b8('0x67')]=isNaN(_0x1ad90c['sampleCount'])?null:_0x1ad90c[_0x99b8('0x60')];_0x4f6291[_0x99b8('0x68')]=isNaN(_0x1ad90c['channelCount'])?null:_0x1ad90c[_0x99b8('0x62')];_0x4f6291[_0x99b8('0x69')]=isNaN(_0x1ad90c[_0x99b8('0x6a')])?null:_0x1ad90c[_0x99b8('0x6a')];_0x4f6291[_0x99b8('0x6b')]=isNaN(_0x1ad90c[_0x99b8('0x65')])?null:_0x1ad90c['sampleRate'];});_0x3355ed['on'](_0x99b8('0x18'),function(){fs[_0x99b8('0x5a')](_0x17b267,parseInt(_0x99b8('0x5b'),0x8));return db[_0x99b8('0x2b')][_0x99b8('0x50')](_0x4f6291)[_0x99b8('0x23')](function(_0x5efeb7){var _0x1761cd={'role':_0x16bcd1[_0x99b8('0x6c')][_0x99b8('0x6d')],'userProfileId':_0x16bcd1['body']['userProfileId']};if(!_0x1761cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1761cd[_0x99b8('0x6d')]===_0x99b8('0x6e')){var _0x5add7f=_0x5efeb7['get']({'plain':!![]});return db[_0x99b8('0x6f')]['find']({'where':{'name':'Sounds','userProfileId':_0x1761cd[_0x99b8('0x70')]},'raw':!![]})[_0x99b8('0x23')](function(_0x286bab){if(_0x286bab&&_0x286bab[_0x99b8('0x71')]===0x0){return db[_0x99b8('0x26')]['create']({'name':_0x5add7f[_0x99b8('0x29')],'resourceId':_0x5add7f['id'],'type':_0x286bab[_0x99b8('0x29')],'sectionId':_0x286bab['id']},{})[_0x99b8('0x23')](function(){return _0x5efeb7;});}else{return _0x5efeb7;}})['catch'](function(_0x551161){logger[_0x99b8('0x27')](_0x99b8('0x72'),_0x551161);throw _0x551161;});}return _0x5efeb7;})[_0x99b8('0x23')](respondWithResult(_0x555b1e,null))[_0x99b8('0x42')](handleError(_0x555b1e,null));});_0x3355ed[_0x99b8('0x73')]();}catch(_0xc28d3){_0x555b1e[_0x99b8('0x17')](0x1f4)[_0x99b8('0x2a')](_0xc28d3);}};exports[_0x99b8('0x22')]=function(_0x371378,_0x3c3c7a,_0xc07d7a){return db[_0x99b8('0x2b')][_0x99b8('0x46')]({'where':{'id':_0x371378[_0x99b8('0x44')]['id']}})[_0x99b8('0x23')](handleEntityNotFound(_0x3c3c7a,null))[_0x99b8('0x23')](saveUpdates(_['pick'](_0x371378['body'],[_0x99b8('0x29'),_0x99b8('0x74')]),null))['then'](respondWithResult(_0x3c3c7a,null))[_0x99b8('0x42')](handleError(_0x3c3c7a,null));};exports['delete']=function(_0x4e407f,_0x46a9d0,_0x240b62){return db['Sound'][_0x99b8('0x46')]({'where':{'id':_0x4e407f[_0x99b8('0x44')]['id']}})[_0x99b8('0x23')](function(_0x4f9381){if(_0x4f9381){return _0x4f9381[_0x99b8('0x24')]();}})['then'](function(_0x41d624){var _0x4feb1f=path[_0x99b8('0x57')](config[_0x99b8('0x4c')],'server/files/sounds/original',util[_0x99b8('0x4f')](_0x99b8('0x4d'),_0x41d624[_0x99b8('0x47')],_0x41d624[_0x99b8('0x75')]));var _0x11b8d5=path[_0x99b8('0x57')](config[_0x99b8('0x4c')],_0x99b8('0x48'),util[_0x99b8('0x4f')]('%s.%s',_0x41d624['save_name'],_0x41d624[_0x99b8('0x4e')]));fs[_0x99b8('0x5d')](_0x4feb1f);fs[_0x99b8('0x5d')](_0x11b8d5);return _0x41d624;})[_0x99b8('0x23')](function(_0x193295){if(_0x193295){return _0x46a9d0[_0x99b8('0x17')](0xcc)['end']();}})[_0x99b8('0x23')](handleEntityNotFound(_0x46a9d0,null))[_0x99b8('0x42')](handleError(_0x46a9d0,null));}; \ No newline at end of file +var _0x8782=['original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','Sound','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate'];(function(_0x32a838,_0x257672){var _0x4d7d9f=function(_0x32d96c){while(--_0x32d96c){_0x32a838['push'](_0x32a838['shift']());}};_0x4d7d9f(++_0x257672);}(_0x8782,0x104));var _0x2878=function(_0x1d0990,_0x18779e){_0x1d0990=_0x1d0990-0x0;var _0x2e6b66=_0x8782[_0x1d0990];return _0x2e6b66;};'use strict';var pdf=require(_0x2878('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2878('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2878('0x2'));var rp=require(_0x2878('0x3'));var moment=require(_0x2878('0x4'));var BPromise=require(_0x2878('0x5'));var Mustache=require(_0x2878('0x6'));var util=require(_0x2878('0x7'));var path=require(_0x2878('0x8'));var sox=require(_0x2878('0x9'));var csv=require(_0x2878('0xa'));var ejs=require(_0x2878('0xb'));var fs=require('fs');var _=require(_0x2878('0xc'));var squel=require(_0x2878('0xd'));var crypto=require(_0x2878('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2878('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2878('0x10'));var Redis=require('ioredis');var authService=require(_0x2878('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2878('0x12'));var logger=require(_0x2878('0x13'))('api');var utils=require(_0x2878('0x14'));var config=require(_0x2878('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb5b7,_0x3d3444){_0x3d3444=_0x3d3444||0xcc;return function(_0x44c358){if(_0x44c358){return _0x2eb5b7[_0x2878('0x16')](_0x3d3444);}return _0x2eb5b7[_0x2878('0x17')](_0x3d3444)[_0x2878('0x18')]();};}function respondWithResult(_0x57fb66,_0x425c39){_0x425c39=_0x425c39||0xc8;return function(_0x1ca69c){if(_0x1ca69c){return _0x57fb66[_0x2878('0x17')](_0x425c39)[_0x2878('0x19')](_0x1ca69c);}};}function respondWithFilteredResult(_0x35d3d5,_0x1d7519){return function(_0x1821a6){if(_0x1821a6){var _0x52f29d=_0x1821a6[_0x2878('0x1a')],_0x4c4a33=_0x1d7519[_0x2878('0x1b')],_0x3b7e6a=_0x1d7519[_0x2878('0x1b')]+_0x1d7519['limit'],_0x84ca00;if(_0x3b7e6a>=_0x52f29d){_0x3b7e6a=_0x52f29d;_0x84ca00=0xc8;}else{_0x84ca00=0xce;}_0x35d3d5['status'](_0x84ca00);return _0x35d3d5[_0x2878('0x1c')](_0x2878('0x1d'),_0x4c4a33+'-'+_0x3b7e6a+'/'+_0x52f29d)[_0x2878('0x19')](_0x1821a6);}return null;};}function patchUpdates(_0x486e3d){return function(_0x2c7aa0){try{jsonpatch[_0x2878('0x1e')](_0x2c7aa0,_0x486e3d,!![]);}catch(_0xb6b0ea){return BPromise['reject'](_0xb6b0ea);}return _0x2c7aa0['save']();};}function saveUpdates(_0x45ba30,_0x153bf6){return function(_0x6cc09d){if(_0x6cc09d){return _0x6cc09d[_0x2878('0x1f')](_0x45ba30)[_0x2878('0x20')](function(_0x3fc575){return _0x3fc575;});}return null;};}function removeEntity(_0x309fa6,_0x1384a7){return function(_0x1d5b49){if(_0x1d5b49){return _0x1d5b49[_0x2878('0x21')]()[_0x2878('0x20')](function(){var _0x30178f=_0x1d5b49[_0x2878('0x22')]({'plain':!![]});var _0x112740=_0x2878('0x23');return db[_0x2878('0x24')]['destroy']({'where':{'type':_0x112740,'resourceId':_0x30178f['id']}})['then'](function(){return _0x1d5b49;});})[_0x2878('0x20')](function(){_0x309fa6[_0x2878('0x17')](0xcc)[_0x2878('0x18')]();});}};}function handleEntityNotFound(_0x579a05,_0x29512f){return function(_0x196640){if(!_0x196640){_0x579a05[_0x2878('0x16')](0x194);}return _0x196640;};}function handleError(_0x5d89ee,_0x68349d){_0x68349d=_0x68349d||0x1f4;return function(_0x30ab67){logger[_0x2878('0x25')](_0x30ab67[_0x2878('0x26')]);if(_0x30ab67[_0x2878('0x27')]){delete _0x30ab67['name'];}_0x5d89ee['status'](_0x68349d)[_0x2878('0x28')](_0x30ab67);};}exports[_0x2878('0x29')]=function(_0x4482e1,_0x3de4ee){var _0x19d2b4={},_0x2f3781={},_0x2748dd={'count':0x0,'rows':[]};var _0x289f1d=db[_0x2878('0x2a')]['rawAttributes'];_0x2f3781[_0x2878('0x2b')]=_['keys'](_0x289f1d);_0x2f3781[_0x2878('0x2c')]=_[_0x2878('0x2d')](_0x4482e1[_0x2878('0x2c')]);_0x2f3781[_0x2878('0x2e')]=_[_0x2878('0x2f')](_0x2f3781[_0x2878('0x2b')],_0x2f3781[_0x2878('0x2c')]);_0x19d2b4[_0x2878('0x30')]=_[_0x2878('0x2f')](_0x2f3781[_0x2878('0x2b')],qs[_0x2878('0x31')](_0x4482e1[_0x2878('0x2c')][_0x2878('0x31')]));_0x19d2b4[_0x2878('0x30')]=_0x19d2b4[_0x2878('0x30')][_0x2878('0x32')]?_0x19d2b4[_0x2878('0x30')]:_0x2f3781[_0x2878('0x2b')];if(!_0x4482e1['query']['hasOwnProperty'](_0x2878('0x33'))){_0x19d2b4[_0x2878('0x34')]=qs['limit'](_0x4482e1[_0x2878('0x2c')][_0x2878('0x34')]);_0x19d2b4[_0x2878('0x1b')]=qs[_0x2878('0x1b')](_0x4482e1[_0x2878('0x2c')][_0x2878('0x1b')]);}_0x19d2b4[_0x2878('0x35')]=qs[_0x2878('0x36')](_0x4482e1[_0x2878('0x2c')][_0x2878('0x36')]);_0x19d2b4[_0x2878('0x37')]=qs[_0x2878('0x2e')](_[_0x2878('0x38')](_0x4482e1[_0x2878('0x2c')],_0x2f3781[_0x2878('0x2e')]));if(_0x4482e1[_0x2878('0x2c')][_0x2878('0x39')]){_0x19d2b4['where']=_[_0x2878('0x3a')](_0x19d2b4['where'],{'$or':_[_0x2878('0x3b')](_0x289f1d,function(_0x264b7d){if(_0x264b7d[_0x2878('0x3c')]['key']!==_0x2878('0x3d')){var _0x36e2e6={};_0x36e2e6[_0x264b7d[_0x2878('0x3e')]]={'$like':'%'+_0x4482e1['query'][_0x2878('0x39')]+'%'};return _0x36e2e6;}})});}_0x19d2b4=_[_0x2878('0x3a')]({},_0x19d2b4,_0x4482e1[_0x2878('0x3f')]);var _0x24d822={'where':_0x19d2b4[_0x2878('0x37')]};return db[_0x2878('0x2a')]['count'](_0x24d822)[_0x2878('0x20')](function(_0x1f7d7b){_0x2748dd[_0x2878('0x1a')]=_0x1f7d7b;if(_0x4482e1[_0x2878('0x2c')][_0x2878('0x40')]){_0x19d2b4['include']=[{'all':!![]}];}return db[_0x2878('0x2a')][_0x2878('0x41')](_0x19d2b4);})[_0x2878('0x20')](function(_0x366b7d){_0x2748dd[_0x2878('0x42')]=_0x366b7d;return _0x2748dd;})['then'](respondWithFilteredResult(_0x3de4ee,_0x19d2b4))[_0x2878('0x43')](handleError(_0x3de4ee,null));};exports[_0x2878('0x44')]=function(_0x5189cb,_0xff77d2){var _0x1d47b5={'raw':!![],'where':{'id':_0x5189cb[_0x2878('0x45')]['id']}},_0x1c60d1={};_0x1c60d1[_0x2878('0x2b')]=_[_0x2878('0x2d')](db[_0x2878('0x2a')][_0x2878('0x46')]);_0x1c60d1[_0x2878('0x2c')]=_[_0x2878('0x2d')](_0x5189cb['query']);_0x1c60d1['filters']=_['intersection'](_0x1c60d1[_0x2878('0x2b')],_0x1c60d1[_0x2878('0x2c')]);_0x1d47b5['attributes']=_[_0x2878('0x2f')](_0x1c60d1[_0x2878('0x2b')],qs[_0x2878('0x31')](_0x5189cb[_0x2878('0x2c')][_0x2878('0x31')]));_0x1d47b5[_0x2878('0x30')]=_0x1d47b5[_0x2878('0x30')]['length']?_0x1d47b5['attributes']:_0x1c60d1[_0x2878('0x2b')];if(_0x5189cb[_0x2878('0x2c')]['includeAll']){_0x1d47b5['include']=[{'all':!![]}];}_0x1d47b5=_[_0x2878('0x3a')]({},_0x1d47b5,_0x5189cb['options']);return db['Sound'][_0x2878('0x47')](_0x1d47b5)['then'](handleEntityNotFound(_0xff77d2,null))[_0x2878('0x20')](respondWithResult(_0xff77d2,null))['catch'](handleError(_0xff77d2,null));};exports[_0x2878('0x48')]=function(_0x24329f,_0x1615ee,_0x562976){return db['Sound'][_0x2878('0x47')]({'where':{'id':_0x24329f['params']['id']},'attributes':[_0x2878('0x27'),'save_name',_0x2878('0x49')],'raw':!![]})[_0x2878('0x20')](handleEntityNotFound(_0x1615ee,null))[_0x2878('0x20')](function(_0xd67698){if(_0xd67698){if(!fs['existsSync'](path[_0x2878('0x4a')](config[_0x2878('0x4b')],_0x2878('0x4c'),_0xd67698[_0x2878('0x4d')]+'.'+_0xd67698['converted_format']))){throw new db[(_0x2878('0x4e'))]['ValidationError'](_0x2878('0x4f'));}return _0x1615ee[_0x2878('0x48')](path['join'](config[_0x2878('0x4b')],'server/files/sounds/converted',util[_0x2878('0x50')](_0x2878('0x51'),_0xd67698[_0x2878('0x4d')],_0xd67698[_0x2878('0x49')])),util[_0x2878('0x50')](_0x2878('0x51'),_0xd67698[_0x2878('0x27')],_0xd67698[_0x2878('0x49')]));}return null;})[_0x2878('0x43')](handleError(_0x1615ee,null));};exports[_0x2878('0x52')]=function(_0x39dc61,_0x1f4618,_0x1e4dd1){var _0x3922b2={'name':path[_0x2878('0x53')](_0x39dc61['file'][_0x2878('0x54')],path[_0x2878('0x55')](_0x39dc61[_0x2878('0x56')][_0x2878('0x54')])),'save_name':path[_0x2878('0x53')](_0x39dc61[_0x2878('0x56')][_0x2878('0x57')],path[_0x2878('0x55')](_0x39dc61[_0x2878('0x56')][_0x2878('0x57')])),'original_format':path[_0x2878('0x55')](_0x39dc61[_0x2878('0x56')][_0x2878('0x54')])[_0x2878('0x58')](0x1),'converted_format':'wav'};var _0x38ff46=path[_0x2878('0x4a')](config[_0x2878('0x4b')],_0x2878('0x59'),_0x39dc61[_0x2878('0x56')][_0x2878('0x57')]);var _0x88367a=path['join'](config[_0x2878('0x4b')],'server/files/sounds/converted',util[_0x2878('0x50')]('%s.%s',path[_0x2878('0x53')](_0x39dc61[_0x2878('0x56')][_0x2878('0x57')],path['extname'](_0x39dc61['file'][_0x2878('0x57')])),_0x3922b2['converted_format']));logger[_0x2878('0x5a')](_0x2878('0x5b'),_0x38ff46);logger['info'](_0x2878('0x5c'),_0x88367a);try{fs['chmodSync'](_0x38ff46,parseInt(_0x2878('0x5d'),0x8));var _0x17bed7=sox[_0x2878('0x5e')](_0x38ff46,_0x88367a,{'sampleRate':0x1f40,'format':_0x2878('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17bed7['on'](_0x2878('0x25'),function(_0x280a37){fs[_0x2878('0x60')](_0x38ff46);_0x1f4618[_0x2878('0x17')](0x1f4)['send'](_0x280a37);});_0x17bed7['on']('src',function(_0x2c08ef){_0x3922b2['original_duration']=isNaN(_0x2c08ef[_0x2878('0x61')])?null:_0x2c08ef['duration']*0x3e8;_0x3922b2['original_sampleCount']=isNaN(_0x2c08ef[_0x2878('0x62')])?null:_0x2c08ef[_0x2878('0x62')];_0x3922b2[_0x2878('0x63')]=isNaN(_0x2c08ef[_0x2878('0x64')])?null:_0x2c08ef[_0x2878('0x64')];_0x3922b2[_0x2878('0x65')]=isNaN(_0x2c08ef[_0x2878('0x66')])?null:_0x2c08ef['bitRate'];_0x3922b2[_0x2878('0x67')]=isNaN(_0x2c08ef[_0x2878('0x68')])?null:_0x2c08ef[_0x2878('0x68')];});_0x17bed7['on'](_0x2878('0x69'),function(_0x11a455){_0x3922b2['converted_duration']=isNaN(_0x11a455[_0x2878('0x61')])?null:_0x11a455['duration']*0x3e8;_0x3922b2[_0x2878('0x6a')]=isNaN(_0x11a455[_0x2878('0x62')])?null:_0x11a455['sampleCount'];_0x3922b2[_0x2878('0x6b')]=isNaN(_0x11a455[_0x2878('0x64')])?null:_0x11a455[_0x2878('0x64')];_0x3922b2['converted_bitRate']=isNaN(_0x11a455[_0x2878('0x66')])?null:_0x11a455[_0x2878('0x66')];_0x3922b2[_0x2878('0x6c')]=isNaN(_0x11a455['sampleRate'])?null:_0x11a455['sampleRate'];});_0x17bed7['on']('end',function(){fs[_0x2878('0x6d')](_0x88367a,parseInt('0777',0x8));return db[_0x2878('0x2a')]['create'](_0x3922b2)['then'](function(_0x18e666){var _0x4db22b={'role':_0x39dc61[_0x2878('0x6e')]['role'],'userProfileId':_0x39dc61[_0x2878('0x6e')][_0x2878('0x6f')]};if(!_0x4db22b)throw new Error(_0x2878('0x70'));if(_0x4db22b[_0x2878('0x71')]==='user'){var _0x1edba0=_0x18e666[_0x2878('0x22')]({'plain':!![]});return db[_0x2878('0x72')][_0x2878('0x47')]({'where':{'name':'Sounds','userProfileId':_0x4db22b[_0x2878('0x6f')]},'raw':!![]})[_0x2878('0x20')](function(_0x48b2f3){if(_0x48b2f3&&_0x48b2f3[_0x2878('0x73')]===0x0){return db['UserProfileResource'][_0x2878('0x52')]({'name':_0x1edba0['name'],'resourceId':_0x1edba0['id'],'type':_0x48b2f3['name'],'sectionId':_0x48b2f3['id']},{})[_0x2878('0x20')](function(){return _0x18e666;});}else{return _0x18e666;}})[_0x2878('0x43')](function(_0x2e2257){logger[_0x2878('0x25')](_0x2878('0x74'),_0x2e2257);throw _0x2e2257;});}return _0x18e666;})[_0x2878('0x20')](respondWithResult(_0x1f4618,null))[_0x2878('0x43')](handleError(_0x1f4618,null));});_0x17bed7[_0x2878('0x75')]();}catch(_0x132066){_0x1f4618[_0x2878('0x17')](0x1f4)[_0x2878('0x28')](_0x132066);}};exports[_0x2878('0x1f')]=function(_0x1d7a85,_0x203df2,_0x14256a){return db[_0x2878('0x2a')][_0x2878('0x47')]({'where':{'id':_0x1d7a85['params']['id']}})[_0x2878('0x20')](handleEntityNotFound(_0x203df2,null))[_0x2878('0x20')](saveUpdates(_['pick'](_0x1d7a85[_0x2878('0x6e')],[_0x2878('0x27'),_0x2878('0x76')]),null))[_0x2878('0x20')](respondWithResult(_0x203df2,null))['catch'](handleError(_0x203df2,null));};exports[_0x2878('0x77')]=function(_0x3e90b0,_0x10ca92,_0x16546a){return db[_0x2878('0x2a')][_0x2878('0x47')]({'where':{'id':_0x3e90b0['params']['id']}})['then'](function(_0x4e2a05){if(_0x4e2a05){return _0x4e2a05[_0x2878('0x21')]();}})[_0x2878('0x20')](function(_0xabacc5){var _0x97bac2=path['join'](config['root'],_0x2878('0x59'),util[_0x2878('0x50')](_0x2878('0x51'),_0xabacc5[_0x2878('0x4d')],_0xabacc5[_0x2878('0x78')]));var _0x1dbfa1=path[_0x2878('0x4a')](config[_0x2878('0x4b')],_0x2878('0x4c'),util[_0x2878('0x50')]('%s.%s',_0xabacc5[_0x2878('0x4d')],_0xabacc5['converted_format']));fs['unlinkSync'](_0x97bac2);fs[_0x2878('0x60')](_0x1dbfa1);return _0xabacc5;})[_0x2878('0x20')](function(_0xe325){if(_0xe325){return _0x10ca92[_0x2878('0x17')](0xcc)[_0x2878('0x18')]();}})[_0x2878('0x20')](handleEntityNotFound(_0x10ca92,null))['catch'](handleError(_0x10ca92,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2501c42..c7a2e9a 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 _0xea66=['tools_sounds','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x57810c,_0x45b5c4){var _0x4762e0=function(_0x37ec49){while(--_0x37ec49){_0x57810c['push'](_0x57810c['shift']());}};_0x4762e0(++_0x45b5c4);}(_0xea66,0x83));var _0x6ea6=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0xea66[_0x5a7d5f];return _0x5dcded;};'use strict';var _=require(_0x6ea6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ea6('0x1'));var moment=require(_0x6ea6('0x2'));var BPromise=require(_0x6ea6('0x3'));var rp=require(_0x6ea6('0x4'));var fs=require('fs');var path=require(_0x6ea6('0x5'));var rimraf=require(_0x6ea6('0x6'));var config=require(_0x6ea6('0x7'));var attributes=require(_0x6ea6('0x8'));module[_0x6ea6('0x9')]=function(_0x4c1978,_0x1c579e){return _0x4c1978[_0x6ea6('0xa')](_0x6ea6('0xb'),attributes,{'tableName':_0x6ea6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c24=['exports','define','Sound','tools_sounds','util','../../config/logger','api','request-promise','../../config/environment','./sound.attributes'];(function(_0x1499bd,_0x33ba6e){var _0x16ff07=function(_0x59b478){while(--_0x59b478){_0x1499bd['push'](_0x1499bd['shift']());}};_0x16ff07(++_0x33ba6e);}(_0x7c24,0x144));var _0x47c2=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x7c24[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x47c2('0x0'));var logger=require(_0x47c2('0x1'))(_0x47c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x47c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x47c2('0x4'));var attributes=require(_0x47c2('0x5'));module[_0x47c2('0x6')]=function(_0x20fcc9,_0xb8bf0e){return _0x20fcc9[_0x47c2('0x7')](_0x47c2('0x8'),attributes,{'tableName':_0x47c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index a2b224c..2da7941 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 _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_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 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['ShowSound']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x4259d0,_0x1beea1){var _0x3745a2=function(_0x52db45){while(--_0x52db45){_0x4259d0['push'](_0x4259d0['shift']());}};_0x3745a2(++_0x1beea1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 6e23761..68cd0ab 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 _0x9d11=['get','index','isAuthenticated','show','post','/:id','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller'];(function(_0x5d813a,_0x2989db){var _0x4a7f61=function(_0x3da61b){while(--_0x3da61b){_0x5d813a['push'](_0x5d813a['shift']());}};_0x4a7f61(++_0x2989db);}(_0x9d11,0xb7));var _0x19d1=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x9d11[_0x35b7d4];return _0x4e8cee;};'use strict';var multer=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var path=require(_0x19d1('0x2'));var timeout=require(_0x19d1('0x3'));var express=require('express');var router=express[_0x19d1('0x4')]();var auth=require(_0x19d1('0x5'));var interaction=require(_0x19d1('0x6'));var config=require(_0x19d1('0x7'));var controller=require(_0x19d1('0x8'));router[_0x19d1('0x9')]('/',auth['isAuthenticated'](),controller[_0x19d1('0xa')]);router[_0x19d1('0x9')]('/:id',auth[_0x19d1('0xb')](),controller[_0x19d1('0xc')]);router[_0x19d1('0xd')]('/',auth[_0x19d1('0xb')](),controller['create']);router['put'](_0x19d1('0xe'),auth[_0x19d1('0xb')](),controller['update']);router[_0x19d1('0xf')](_0x19d1('0xe'),auth[_0x19d1('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x566f=['./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28dea0,_0x51cc61){var _0x6546a=function(_0x43f13b){while(--_0x43f13b){_0x28dea0['push'](_0x28dea0['shift']());}};_0x6546a(++_0x51cc61);}(_0x566f,0x124));var _0xf566=function(_0x26ddce,_0x3d258f){_0x26ddce=_0x26ddce-0x0;var _0x4d6167=_0x566f[_0x26ddce];return _0x4d6167;};'use strict';var multer=require(_0xf566('0x0'));var util=require(_0xf566('0x1'));var path=require(_0xf566('0x2'));var timeout=require(_0xf566('0x3'));var express=require(_0xf566('0x4'));var router=express[_0xf566('0x5')]();var auth=require(_0xf566('0x6'));var interaction=require(_0xf566('0x7'));var config=require('../../config/environment');var controller=require(_0xf566('0x8'));router[_0xf566('0x9')]('/',auth[_0xf566('0xa')](),controller[_0xf566('0xb')]);router['get'](_0xf566('0xc'),auth[_0xf566('0xa')](),controller[_0xf566('0xd')]);router[_0xf566('0xe')]('/',auth['isAuthenticated'](),controller[_0xf566('0xf')]);router['put'](_0xf566('0xc'),auth[_0xf566('0xa')](),controller[_0xf566('0x10')]);router[_0xf566('0x11')]('/:id',auth[_0xf566('0xa')](),controller[_0xf566('0x12')]);module[_0xf566('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c634cc9..092d569 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 _0xcbea=['sequelize','ENUM','out'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0xcbea,0x189));var _0xacbe=function(_0x39bfb1,_0x2183d5){_0x39bfb1=_0x39bfb1-0x0;var _0x3e8a55=_0xcbea[_0x39bfb1];return _0x3e8a55;};'use strict';var Sequelize=require(_0xacbe('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xacbe('0x1')]('in',_0xacbe('0x2')),'defaultValue':_0xacbe('0x2'),'allowNull':![]}}; \ No newline at end of file +var _0xcab2=['ENUM','out','sequelize','TEXT','medium'];(function(_0x1b8ad8,_0x281f0b){var _0x5a5123=function(_0x214edf){while(--_0x214edf){_0x1b8ad8['push'](_0x1b8ad8['shift']());}};_0x5a5123(++_0x281f0b);}(_0xcab2,0xac));var _0x2cab=function(_0x388aac,_0x1fac02){_0x388aac=_0x388aac-0x0;var _0x43805f=_0xcab2[_0x388aac];return _0x43805f;};'use strict';var Sequelize=require(_0x2cab('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x2cab('0x1')](_0x2cab('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2cab('0x3')]('in',_0x2cab('0x4')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 84d5bbf..2d1bfc2 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 _0x84a0=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','SquareMessage','includeAll','include','findAll','rows','show','params','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','query','filters','intersection','attributes'];(function(_0x2a9be2,_0xc7c386){var _0x160b91=function(_0x45eb0a){while(--_0x45eb0a){_0x2a9be2['push'](_0x2a9be2['shift']());}};_0x160b91(++_0xc7c386);}(_0x84a0,0x66));var _0x084a=function(_0x1dc34f,_0x7de556){_0x1dc34f=_0x1dc34f-0x0;var _0x3d906c=_0x84a0[_0x1dc34f];return _0x3d906c;};'use strict';var pdf=require(_0x084a('0x0'));var emlformat=require(_0x084a('0x1'));var rimraf=require(_0x084a('0x2'));var zipdir=require(_0x084a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x084a('0x4'));var moment=require(_0x084a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x084a('0x6'));var path=require(_0x084a('0x7'));var sox=require('sox');var csv=require(_0x084a('0x8'));var ejs=require(_0x084a('0x9'));var fs=require('fs');var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0x8'));var querystring=require(_0x084a('0xe'));var Papa=require(_0x084a('0xf'));var Redis=require(_0x084a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x084a('0x11'));var logger=require(_0x084a('0x12'))(_0x084a('0x13'));var utils=require(_0x084a('0x14'));var config=require(_0x084a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ef41f,_0xc451b1){_0xc451b1=_0xc451b1||0xcc;return function(_0x3ca72f){if(_0x3ca72f){return _0x4ef41f[_0x084a('0x16')](_0xc451b1);}return _0x4ef41f[_0x084a('0x17')](_0xc451b1)[_0x084a('0x18')]();};}function respondWithResult(_0x414b05,_0x3ff351){_0x3ff351=_0x3ff351||0xc8;return function(_0x3a76d1){if(_0x3a76d1){return _0x414b05['status'](_0x3ff351)[_0x084a('0x19')](_0x3a76d1);}};}function respondWithFilteredResult(_0x4b9cc5,_0x225de0){return function(_0x3ccaca){if(_0x3ccaca){var _0x366624=_0x3ccaca[_0x084a('0x1a')],_0x2d35b8=_0x225de0['offset'],_0xd20527=_0x225de0[_0x084a('0x1b')]+_0x225de0[_0x084a('0x1c')],_0x4cbd16;if(_0xd20527>=_0x366624){_0xd20527=_0x366624;_0x4cbd16=0xc8;}else{_0x4cbd16=0xce;}_0x4b9cc5['status'](_0x4cbd16);return _0x4b9cc5[_0x084a('0x1d')](_0x084a('0x1e'),_0x2d35b8+'-'+_0xd20527+'/'+_0x366624)[_0x084a('0x19')](_0x3ccaca);}return null;};}function patchUpdates(_0x14bb19){return function(_0x33d3a6){try{jsonpatch[_0x084a('0x1f')](_0x33d3a6,_0x14bb19,!![]);}catch(_0x447a19){return BPromise[_0x084a('0x20')](_0x447a19);}return _0x33d3a6[_0x084a('0x21')]();};}function saveUpdates(_0xcb5356,_0x3c7fd6){return function(_0x279e25){if(_0x279e25){return _0x279e25[_0x084a('0x22')](_0xcb5356)[_0x084a('0x23')](function(_0xf0dd98){return _0xf0dd98;});}return null;};}function removeEntity(_0x506f71,_0x343c5c){return function(_0x1ad257){if(_0x1ad257){return _0x1ad257[_0x084a('0x24')]()[_0x084a('0x23')](function(){_0x506f71[_0x084a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x755c24,_0x288e9e){return function(_0x6346a5){if(!_0x6346a5){_0x755c24[_0x084a('0x16')](0x194);}return _0x6346a5;};}function handleError(_0x18b43d,_0x3cdc1e){_0x3cdc1e=_0x3cdc1e||0x1f4;return function(_0x5be167){logger[_0x084a('0x25')](_0x5be167[_0x084a('0x26')]);if(_0x5be167[_0x084a('0x27')]){delete _0x5be167['name'];}_0x18b43d[_0x084a('0x17')](_0x3cdc1e)[_0x084a('0x28')](_0x5be167);};}exports[_0x084a('0x29')]=function(_0x4c5658,_0x5596ac){var _0x4874fe={},_0x52227a={},_0x33b88f={'count':0x0,'rows':[]};var _0x5c5efb=db['SquareMessage']['rawAttributes'];_0x52227a[_0x084a('0x2a')]=_[_0x084a('0x2b')](_0x5c5efb);_0x52227a[_0x084a('0x2c')]=_[_0x084a('0x2b')](_0x4c5658[_0x084a('0x2c')]);_0x52227a[_0x084a('0x2d')]=_[_0x084a('0x2e')](_0x52227a[_0x084a('0x2a')],_0x52227a['query']);_0x4874fe[_0x084a('0x2f')]=_[_0x084a('0x2e')](_0x52227a['model'],qs[_0x084a('0x30')](_0x4c5658[_0x084a('0x2c')][_0x084a('0x30')]));_0x4874fe[_0x084a('0x2f')]=_0x4874fe[_0x084a('0x2f')][_0x084a('0x31')]?_0x4874fe[_0x084a('0x2f')]:_0x52227a[_0x084a('0x2a')];if(!_0x4c5658[_0x084a('0x2c')][_0x084a('0x32')](_0x084a('0x33'))){_0x4874fe[_0x084a('0x1c')]=qs[_0x084a('0x1c')](_0x4c5658['query']['limit']);_0x4874fe[_0x084a('0x1b')]=qs[_0x084a('0x1b')](_0x4c5658[_0x084a('0x2c')][_0x084a('0x1b')]);}_0x4874fe[_0x084a('0x34')]=qs['sort'](_0x4c5658[_0x084a('0x2c')][_0x084a('0x35')]);_0x4874fe[_0x084a('0x36')]=qs['filters'](_[_0x084a('0x37')](_0x4c5658[_0x084a('0x2c')],_0x52227a[_0x084a('0x2d')]));if(_0x4c5658['query']['filter']){_0x4874fe['where']=_[_0x084a('0x38')](_0x4874fe[_0x084a('0x36')],{'$or':_[_0x084a('0x39')](_0x5c5efb,function(_0x4e594f){if(_0x4e594f[_0x084a('0x3a')][_0x084a('0x3b')]!==_0x084a('0x3c')){var _0x28b199={};_0x28b199[_0x4e594f[_0x084a('0x3d')]]={'$like':'%'+_0x4c5658[_0x084a('0x2c')][_0x084a('0x3e')]+'%'};return _0x28b199;}})});}_0x4874fe=_[_0x084a('0x38')]({},_0x4874fe,_0x4c5658[_0x084a('0x3f')]);var _0x44490d={'where':_0x4874fe[_0x084a('0x36')]};return db[_0x084a('0x40')][_0x084a('0x1a')](_0x44490d)[_0x084a('0x23')](function(_0x10983f){_0x33b88f['count']=_0x10983f;if(_0x4c5658[_0x084a('0x2c')][_0x084a('0x41')]){_0x4874fe[_0x084a('0x42')]=[{'all':!![]}];}return db[_0x084a('0x40')][_0x084a('0x43')](_0x4874fe);})[_0x084a('0x23')](function(_0xa7b652){_0x33b88f[_0x084a('0x44')]=_0xa7b652;return _0x33b88f;})[_0x084a('0x23')](respondWithFilteredResult(_0x5596ac,_0x4874fe))['catch'](handleError(_0x5596ac,null));};exports[_0x084a('0x45')]=function(_0x3d1aa5,_0x25a081){var _0x432eb7={'raw':!![],'where':{'id':_0x3d1aa5[_0x084a('0x46')]['id']}},_0x256008={};_0x256008['model']=_[_0x084a('0x2b')](db[_0x084a('0x40')]['rawAttributes']);_0x256008[_0x084a('0x2c')]=_[_0x084a('0x2b')](_0x3d1aa5[_0x084a('0x2c')]);_0x256008['filters']=_[_0x084a('0x2e')](_0x256008[_0x084a('0x2a')],_0x256008['query']);_0x432eb7[_0x084a('0x2f')]=_[_0x084a('0x2e')](_0x256008['model'],qs['fields'](_0x3d1aa5[_0x084a('0x2c')][_0x084a('0x30')]));_0x432eb7[_0x084a('0x2f')]=_0x432eb7[_0x084a('0x2f')][_0x084a('0x31')]?_0x432eb7[_0x084a('0x2f')]:_0x256008[_0x084a('0x2a')];if(_0x3d1aa5[_0x084a('0x2c')][_0x084a('0x41')]){_0x432eb7[_0x084a('0x42')]=[{'all':!![]}];}_0x432eb7=_[_0x084a('0x38')]({},_0x432eb7,_0x3d1aa5['options']);return db['SquareMessage'][_0x084a('0x47')](_0x432eb7)[_0x084a('0x23')](handleEntityNotFound(_0x25a081,null))[_0x084a('0x23')](respondWithResult(_0x25a081,null))['catch'](handleError(_0x25a081,null));};exports[_0x084a('0x48')]=function(_0x1598c4,_0x3092ea){return db[_0x084a('0x40')][_0x084a('0x48')](_0x1598c4['body'],{})[_0x084a('0x23')](respondWithResult(_0x3092ea,0xc9))['catch'](handleError(_0x3092ea,null));};exports[_0x084a('0x22')]=function(_0x4f98c6,_0x1ffd20){if(_0x4f98c6['body']['id']){delete _0x4f98c6['body']['id'];}return db[_0x084a('0x40')][_0x084a('0x47')]({'where':{'id':_0x4f98c6['params']['id']}})[_0x084a('0x23')](handleEntityNotFound(_0x1ffd20,null))[_0x084a('0x23')](saveUpdates(_0x4f98c6[_0x084a('0x49')],null))[_0x084a('0x23')](respondWithResult(_0x1ffd20,null))['catch'](handleError(_0x1ffd20,null));};exports[_0x084a('0x24')]=function(_0x865368,_0x31677b){return db[_0x084a('0x40')]['find']({'where':{'id':_0x865368[_0x084a('0x46')]['id']}})[_0x084a('0x23')](handleEntityNotFound(_0x31677b,null))[_0x084a('0x23')](removeEntity(_0x31677b,null))[_0x084a('0x4a')](handleError(_0x31677b,null));}; \ No newline at end of file +var _0xe205=['sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','body','catch','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','then','error','stack','name','send','SquareMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0xc70653,_0x1185c1){var _0x1ee7ae=function(_0xef1bc7){while(--_0xef1bc7){_0xc70653['push'](_0xc70653['shift']());}};_0x1ee7ae(++_0x1185c1);}(_0xe205,0xa7));var _0x5e20=function(_0x306594,_0x3c54fa){_0x306594=_0x306594-0x0;var _0x2bd846=_0xe205[_0x306594];return _0x2bd846;};'use strict';var pdf=require(_0x5e20('0x0'));var emlformat=require(_0x5e20('0x1'));var rimraf=require(_0x5e20('0x2'));var zipdir=require(_0x5e20('0x3'));var jsonpatch=require(_0x5e20('0x4'));var rp=require(_0x5e20('0x5'));var moment=require(_0x5e20('0x6'));var BPromise=require(_0x5e20('0x7'));var Mustache=require(_0x5e20('0x8'));var util=require('util');var path=require(_0x5e20('0x9'));var sox=require(_0x5e20('0xa'));var csv=require(_0x5e20('0xb'));var ejs=require(_0x5e20('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xb'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var hardwareService=require(_0x5e20('0x12'));var logger=require('../../config/logger')(_0x5e20('0x13'));var utils=require(_0x5e20('0x14'));var config=require(_0x5e20('0x15'));var db=require(_0x5e20('0x16'))['db'];function respondWithStatusCode(_0x165824,_0x296dfd){_0x296dfd=_0x296dfd||0xcc;return function(_0x54deee){if(_0x54deee){return _0x165824[_0x5e20('0x17')](_0x296dfd);}return _0x165824[_0x5e20('0x18')](_0x296dfd)[_0x5e20('0x19')]();};}function respondWithResult(_0x5868c0,_0x1dc92e){_0x1dc92e=_0x1dc92e||0xc8;return function(_0x5d827e){if(_0x5d827e){return _0x5868c0[_0x5e20('0x18')](_0x1dc92e)['json'](_0x5d827e);}};}function respondWithFilteredResult(_0x15587b,_0x330cdf){return function(_0x275026){if(_0x275026){var _0x148ada=_0x275026[_0x5e20('0x1a')],_0x294df8=_0x330cdf[_0x5e20('0x1b')],_0x542b3c=_0x330cdf[_0x5e20('0x1b')]+_0x330cdf[_0x5e20('0x1c')],_0xeaeb77;if(_0x542b3c>=_0x148ada){_0x542b3c=_0x148ada;_0xeaeb77=0xc8;}else{_0xeaeb77=0xce;}_0x15587b[_0x5e20('0x18')](_0xeaeb77);return _0x15587b[_0x5e20('0x1d')](_0x5e20('0x1e'),_0x294df8+'-'+_0x542b3c+'/'+_0x148ada)['json'](_0x275026);}return null;};}function patchUpdates(_0x434686){return function(_0xd38d1f){try{jsonpatch['apply'](_0xd38d1f,_0x434686,!![]);}catch(_0x295eb3){return BPromise[_0x5e20('0x1f')](_0x295eb3);}return _0xd38d1f[_0x5e20('0x20')]();};}function saveUpdates(_0x2d373d,_0x4a45bd){return function(_0x2954fc){if(_0x2954fc){return _0x2954fc['update'](_0x2d373d)['then'](function(_0x57c7c5){return _0x57c7c5;});}return null;};}function removeEntity(_0x5d0d1a,_0xe562ba){return function(_0x5cca90){if(_0x5cca90){return _0x5cca90[_0x5e20('0x21')]()[_0x5e20('0x22')](function(){_0x5d0d1a[_0x5e20('0x18')](0xcc)[_0x5e20('0x19')]();});}};}function handleEntityNotFound(_0x3ef7fa,_0x2d4614){return function(_0x4c5732){if(!_0x4c5732){_0x3ef7fa[_0x5e20('0x17')](0x194);}return _0x4c5732;};}function handleError(_0x5a755f,_0x52d4f5){_0x52d4f5=_0x52d4f5||0x1f4;return function(_0x33993a){logger[_0x5e20('0x23')](_0x33993a[_0x5e20('0x24')]);if(_0x33993a[_0x5e20('0x25')]){delete _0x33993a[_0x5e20('0x25')];}_0x5a755f[_0x5e20('0x18')](_0x52d4f5)[_0x5e20('0x26')](_0x33993a);};}exports['index']=function(_0x3bf4f4,_0x420f63){var _0x238758={},_0x3032ef={},_0x4c799d={'count':0x0,'rows':[]};var _0x3a0f06=db[_0x5e20('0x27')][_0x5e20('0x28')];_0x3032ef[_0x5e20('0x29')]=_[_0x5e20('0x2a')](_0x3a0f06);_0x3032ef[_0x5e20('0x2b')]=_['keys'](_0x3bf4f4[_0x5e20('0x2b')]);_0x3032ef[_0x5e20('0x2c')]=_['intersection'](_0x3032ef[_0x5e20('0x29')],_0x3032ef[_0x5e20('0x2b')]);_0x238758[_0x5e20('0x2d')]=_[_0x5e20('0x2e')](_0x3032ef[_0x5e20('0x29')],qs[_0x5e20('0x2f')](_0x3bf4f4['query'][_0x5e20('0x2f')]));_0x238758[_0x5e20('0x2d')]=_0x238758[_0x5e20('0x2d')][_0x5e20('0x30')]?_0x238758[_0x5e20('0x2d')]:_0x3032ef[_0x5e20('0x29')];if(!_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x31')](_0x5e20('0x32'))){_0x238758[_0x5e20('0x1c')]=qs[_0x5e20('0x1c')](_0x3bf4f4['query'][_0x5e20('0x1c')]);_0x238758[_0x5e20('0x1b')]=qs[_0x5e20('0x1b')](_0x3bf4f4['query'][_0x5e20('0x1b')]);}_0x238758[_0x5e20('0x33')]=qs[_0x5e20('0x34')](_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x34')]);_0x238758[_0x5e20('0x35')]=qs[_0x5e20('0x2c')](_[_0x5e20('0x36')](_0x3bf4f4[_0x5e20('0x2b')],_0x3032ef[_0x5e20('0x2c')]));if(_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x37')]){_0x238758[_0x5e20('0x35')]=_[_0x5e20('0x38')](_0x238758['where'],{'$or':_[_0x5e20('0x39')](_0x3a0f06,function(_0x53cf9c){if(_0x53cf9c['type'][_0x5e20('0x3a')]!==_0x5e20('0x3b')){var _0x4e3307={};_0x4e3307[_0x53cf9c[_0x5e20('0x3c')]]={'$like':'%'+_0x3bf4f4[_0x5e20('0x2b')]['filter']+'%'};return _0x4e3307;}})});}_0x238758=_[_0x5e20('0x38')]({},_0x238758,_0x3bf4f4[_0x5e20('0x3d')]);var _0x20dc98={'where':_0x238758[_0x5e20('0x35')]};return db[_0x5e20('0x27')][_0x5e20('0x1a')](_0x20dc98)[_0x5e20('0x22')](function(_0x3d9354){_0x4c799d[_0x5e20('0x1a')]=_0x3d9354;if(_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x3e')]){_0x238758[_0x5e20('0x3f')]=[{'all':!![]}];}return db[_0x5e20('0x27')][_0x5e20('0x40')](_0x238758);})[_0x5e20('0x22')](function(_0x3d618c){_0x4c799d[_0x5e20('0x41')]=_0x3d618c;return _0x4c799d;})[_0x5e20('0x22')](respondWithFilteredResult(_0x420f63,_0x238758))['catch'](handleError(_0x420f63,null));};exports[_0x5e20('0x42')]=function(_0x29215f,_0x377afc){var _0xb3394d={'raw':!![],'where':{'id':_0x29215f['params']['id']}},_0x39018d={};_0x39018d[_0x5e20('0x29')]=_[_0x5e20('0x2a')](db[_0x5e20('0x27')][_0x5e20('0x28')]);_0x39018d[_0x5e20('0x2b')]=_[_0x5e20('0x2a')](_0x29215f['query']);_0x39018d[_0x5e20('0x2c')]=_[_0x5e20('0x2e')](_0x39018d[_0x5e20('0x29')],_0x39018d['query']);_0xb3394d[_0x5e20('0x2d')]=_[_0x5e20('0x2e')](_0x39018d[_0x5e20('0x29')],qs[_0x5e20('0x2f')](_0x29215f[_0x5e20('0x2b')][_0x5e20('0x2f')]));_0xb3394d[_0x5e20('0x2d')]=_0xb3394d[_0x5e20('0x2d')]['length']?_0xb3394d[_0x5e20('0x2d')]:_0x39018d[_0x5e20('0x29')];if(_0x29215f[_0x5e20('0x2b')]['includeAll']){_0xb3394d[_0x5e20('0x3f')]=[{'all':!![]}];}_0xb3394d=_['merge']({},_0xb3394d,_0x29215f[_0x5e20('0x3d')]);return db[_0x5e20('0x27')][_0x5e20('0x43')](_0xb3394d)[_0x5e20('0x22')](handleEntityNotFound(_0x377afc,null))[_0x5e20('0x22')](respondWithResult(_0x377afc,null))['catch'](handleError(_0x377afc,null));};exports[_0x5e20('0x44')]=function(_0x59ee49,_0x49e42f){return db[_0x5e20('0x27')][_0x5e20('0x44')](_0x59ee49[_0x5e20('0x45')],{})[_0x5e20('0x22')](respondWithResult(_0x49e42f,0xc9))[_0x5e20('0x46')](handleError(_0x49e42f,null));};exports[_0x5e20('0x47')]=function(_0x57c794,_0x59c79f){if(_0x57c794['body']['id']){delete _0x57c794[_0x5e20('0x45')]['id'];}return db[_0x5e20('0x27')]['find']({'where':{'id':_0x57c794[_0x5e20('0x48')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x59c79f,null))[_0x5e20('0x22')](saveUpdates(_0x57c794[_0x5e20('0x45')],null))[_0x5e20('0x22')](respondWithResult(_0x59c79f,null))['catch'](handleError(_0x59c79f,null));};exports[_0x5e20('0x21')]=function(_0x245b52,_0x25491e){return db[_0x5e20('0x27')][_0x5e20('0x43')]({'where':{'id':_0x245b52[_0x5e20('0x48')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x25491e,null))[_0x5e20('0x22')](removeEntity(_0x25491e,null))['catch'](handleError(_0x25491e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ced8a4d..f1fee04 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 _0x830e=['path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','util','moment','bluebird','request-promise'];(function(_0x539105,_0x4792d5){var _0xacc9a3=function(_0x571ed3){while(--_0x571ed3){_0x539105['push'](_0x539105['shift']());}};_0xacc9a3(++_0x4792d5);}(_0x830e,0xf8));var _0xe830=function(_0x3adec7,_0xca7db9){_0x3adec7=_0x3adec7-0x0;var _0x2b080c=_0x830e[_0x3adec7];return _0x2b080c;};'use strict';var _=require(_0xe830('0x0'));var util=require(_0xe830('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe830('0x2'));var BPromise=require(_0xe830('0x3'));var rp=require(_0xe830('0x4'));var fs=require('fs');var path=require(_0xe830('0x5'));var rimraf=require(_0xe830('0x6'));var config=require(_0xe830('0x7'));var attributes=require(_0xe830('0x8'));module['exports']=function(_0x1eb4e6,_0x208f1b){return _0x1eb4e6[_0xe830('0x9')](_0xe830('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa354=['exports','define','square_messages','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xa354,0x1c5));var _0x4a35=function(_0xe82b8a,_0x1afff3){_0xe82b8a=_0xe82b8a-0x0;var _0x589445=_0xa354[_0xe82b8a];return _0x589445;};'use strict';var _=require('lodash');var util=require(_0x4a35('0x0'));var logger=require(_0x4a35('0x1'))('api');var moment=require(_0x4a35('0x2'));var BPromise=require('bluebird');var rp=require(_0x4a35('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a35('0x4'));var config=require(_0x4a35('0x5'));var attributes=require(_0x4a35('0x6'));module[_0x4a35('0x7')]=function(_0x40efa3,_0x460bcc){return _0x40efa3[_0x4a35('0x8')]('SquareMessage',attributes,{'tableName':_0x4a35('0x9'),'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 80c12a7..f8bddc1 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 _0x083f=['message','result','CreateSquareMessage','SquareMessage','create','body','options','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x13ad16,_0x54be96){var _0x232358=function(_0x517849){while(--_0x517849){_0x13ad16['push'](_0x13ad16['shift']());}};_0x232358(++_0x54be96);}(_0x083f,0xf2));var _0xf083=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x083f[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xf083('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf083('0x2'));var db=require(_0xf083('0x3'))['db'];var utils=require(_0xf083('0x4'));var logger=require('../../config/logger')(_0xf083('0x5'));var config=require(_0xf083('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf083('0x7')][_0xf083('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x413bc1,_0x5667cb,_0x51378f){return new BPromise(function(_0x5182d6,_0x51915e){return client[_0xf083('0x9')](_0x413bc1,_0x51378f)[_0xf083('0xa')](function(_0x27ec09){logger[_0xf083('0xb')](_0xf083('0xc'),_0x5667cb,_0xf083('0xd'));logger[_0xf083('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5667cb,_0xf083('0xd'),JSON[_0xf083('0xf')](_0x27ec09));if(_0x27ec09[_0xf083('0x10')]){if(_0x27ec09[_0xf083('0x10')][_0xf083('0x11')]===0x1f4){logger[_0xf083('0x10')]('SquareMessage,\x20%s,\x20%s',_0x5667cb,_0x27ec09['error'][_0xf083('0x12')]);return _0x51915e(_0x27ec09['error'][_0xf083('0x12')]);}logger[_0xf083('0x10')](_0xf083('0xc'),_0x5667cb,_0x27ec09['error'][_0xf083('0x12')]);return _0x5182d6(_0x27ec09['error'][_0xf083('0x12')]);}else{logger['info'](_0xf083('0xc'),_0x5667cb,'request\x20sent');_0x5182d6(_0x27ec09[_0xf083('0x13')][_0xf083('0x12')]);}})['catch'](function(_0x21ed0a){logger[_0xf083('0x10')](_0xf083('0xc'),_0x5667cb,_0x21ed0a);_0x51915e(_0x21ed0a);});});}exports[_0xf083('0x14')]=function(_0x3d9521){var _0xe4f58a=this;return new Promise(function(_0x4b52b0,_0x23c7c2){return db[_0xf083('0x15')][_0xf083('0x16')](_0x3d9521[_0xf083('0x17')],{'raw':_0x3d9521['options']?_0x3d9521[_0xf083('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf083('0xa')](function(_0x3f374e){logger[_0xf083('0xb')](_0xf083('0x14'),_0x3d9521);logger['debug'](_0xf083('0x14'),_0x3d9521,JSON['stringify'](_0x3f374e));_0x4b52b0(_0x3f374e);})[_0xf083('0x19')](function(_0x23ced2){logger[_0xf083('0x10')](_0xf083('0x14'),_0x23ced2[_0xf083('0x12')],_0x3d9521);_0x23c7c2(_0xe4f58a[_0xf083('0x10')](0x1f4,_0x23ced2[_0xf083('0x12')]));});});}; \ No newline at end of file +var _0xd9b2=['message','result','catch','CreateSquareMessage','SquareMessage','create','body','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x106086,_0x2d8dbf){var _0x188a50=function(_0x45f637){while(--_0x45f637){_0x106086['push'](_0x106086['shift']());}};_0x188a50(++_0x2d8dbf);}(_0xd9b2,0xe9));var _0x2d9b=function(_0x5a3f92,_0x23e7df){_0x5a3f92=_0x5a3f92-0x0;var _0x467063=_0xd9b2[_0x5a3f92];return _0x467063;};'use strict';var _=require(_0x2d9b('0x0'));var util=require(_0x2d9b('0x1'));var moment=require(_0x2d9b('0x2'));var BPromise=require(_0x2d9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d9b('0x4'));var db=require(_0x2d9b('0x5'))['db'];var utils=require(_0x2d9b('0x6'));var logger=require('../../config/logger')(_0x2d9b('0x7'));var config=require(_0x2d9b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2d9b('0x9')][_0x2d9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x347097,_0x3bc6cf,_0x3cc78e){return new BPromise(function(_0x59fc7e,_0x213354){return client[_0x2d9b('0xb')](_0x347097,_0x3cc78e)[_0x2d9b('0xc')](function(_0x22fcbf){logger[_0x2d9b('0xd')]('SquareMessage,\x20%s,\x20%s',_0x3bc6cf,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3bc6cf,_0x2d9b('0xe'),JSON[_0x2d9b('0xf')](_0x22fcbf));if(_0x22fcbf[_0x2d9b('0x10')]){if(_0x22fcbf[_0x2d9b('0x10')][_0x2d9b('0x11')]===0x1f4){logger[_0x2d9b('0x10')](_0x2d9b('0x12'),_0x3bc6cf,_0x22fcbf['error'][_0x2d9b('0x13')]);return _0x213354(_0x22fcbf[_0x2d9b('0x10')][_0x2d9b('0x13')]);}logger['error'](_0x2d9b('0x12'),_0x3bc6cf,_0x22fcbf[_0x2d9b('0x10')][_0x2d9b('0x13')]);return _0x59fc7e(_0x22fcbf[_0x2d9b('0x10')][_0x2d9b('0x13')]);}else{logger[_0x2d9b('0xd')]('SquareMessage,\x20%s,\x20%s',_0x3bc6cf,'request\x20sent');_0x59fc7e(_0x22fcbf[_0x2d9b('0x14')][_0x2d9b('0x13')]);}})[_0x2d9b('0x15')](function(_0x42481c){logger[_0x2d9b('0x10')](_0x2d9b('0x12'),_0x3bc6cf,_0x42481c);_0x213354(_0x42481c);});});}exports[_0x2d9b('0x16')]=function(_0x4ac5e4){var _0x303757=this;return new Promise(function(_0x4cba6f,_0x2a00d2){return db[_0x2d9b('0x17')][_0x2d9b('0x18')](_0x4ac5e4[_0x2d9b('0x19')],{'raw':_0x4ac5e4['options']?_0x4ac5e4['options'][_0x2d9b('0x1a')]===undefined?!![]:![]:!![]})[_0x2d9b('0xc')](function(_0x91a9a8){logger[_0x2d9b('0xd')](_0x2d9b('0x16'),_0x4ac5e4);logger[_0x2d9b('0x1b')](_0x2d9b('0x16'),_0x4ac5e4,JSON[_0x2d9b('0xf')](_0x91a9a8));_0x4cba6f(_0x91a9a8);})[_0x2d9b('0x15')](function(_0x597dff){logger['error']('CreateSquareMessage',_0x597dff[_0x2d9b('0x13')],_0x4ac5e4);_0x2a00d2(_0x303757[_0x2d9b('0x10')](0x1f4,_0x597dff[_0x2d9b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 63576ed..c196860 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 _0x93e7=['15s','test','post','create','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/test','isAuthenticated'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x93e7,0x9e));var _0x793e=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0x93e7[_0x1ce9ea];return _0x2a95b9;};'use strict';var multer=require(_0x793e('0x0'));var util=require('util');var path=require(_0x793e('0x1'));var timeout=require(_0x793e('0x2'));var express=require('express');var router=express[_0x793e('0x3')]();var auth=require(_0x793e('0x4'));var interaction=require(_0x793e('0x5'));var config=require(_0x793e('0x6'));var controller=require('./squareOdbc.controller');router[_0x793e('0x7')]('/',auth['isAuthenticated'](),controller[_0x793e('0x8')]);router['get'](_0x793e('0x9'),auth['isAuthenticated'](),controller[_0x793e('0xa')]);router[_0x793e('0x7')](_0x793e('0xb'),auth[_0x793e('0xc')](),timeout(_0x793e('0xd')),controller[_0x793e('0xe')]);router[_0x793e('0xf')]('/',auth[_0x793e('0xc')](),controller[_0x793e('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x793e('0x11')]);router['delete']('/:id',auth[_0x793e('0xc')](),controller[_0x793e('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc79f=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','post','create','put','update','delete','destroy','multer','util'];(function(_0x202c53,_0x17352e){var _0x406d9f=function(_0x26ad0b){while(--_0x26ad0b){_0x202c53['push'](_0x202c53['shift']());}};_0x406d9f(++_0x17352e);}(_0xc79f,0x82));var _0xfc79=function(_0x493720,_0x2e7724){_0x493720=_0x493720-0x0;var _0x3cfc8e=_0xc79f[_0x493720];return _0x3cfc8e;};'use strict';var multer=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var path=require(_0xfc79('0x2'));var timeout=require(_0xfc79('0x3'));var express=require(_0xfc79('0x4'));var router=express['Router']();var auth=require(_0xfc79('0x5'));var interaction=require(_0xfc79('0x6'));var config=require(_0xfc79('0x7'));var controller=require(_0xfc79('0x8'));router[_0xfc79('0x9')]('/',auth[_0xfc79('0xa')](),controller[_0xfc79('0xb')]);router[_0xfc79('0x9')](_0xfc79('0xc'),auth['isAuthenticated'](),controller[_0xfc79('0xd')]);router['get'](_0xfc79('0xe'),auth[_0xfc79('0xa')](),timeout(_0xfc79('0xf')),controller['test']);router[_0xfc79('0x10')]('/',auth[_0xfc79('0xa')](),controller[_0xfc79('0x11')]);router[_0xfc79('0x12')]('/:id',auth[_0xfc79('0xa')](),controller[_0xfc79('0x13')]);router[_0xfc79('0x14')]('/:id',auth[_0xfc79('0xa')](),controller[_0xfc79('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5516b53..9889aa4 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 _0xd70a=['name','sequelize','exports','STRING'];(function(_0x12cd87,_0x4a9fbc){var _0x4ee7b9=function(_0x374d9a){while(--_0x374d9a){_0x12cd87['push'](_0x12cd87['shift']());}};_0x4ee7b9(++_0x4a9fbc);}(_0xd70a,0x89));var _0xad70=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xd70a[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0xad70('0x0'));module[_0xad70('0x1')]={'name':{'type':Sequelize[_0xad70('0x2')],'unique':_0xad70('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x896a=['name','sequelize','exports','STRING'];(function(_0x308b9d,_0x11db54){var _0x301d31=function(_0x51cb03){while(--_0x51cb03){_0x308b9d['push'](_0x308b9d['shift']());}};_0x301d31(++_0x11db54);}(_0x896a,0xa9));var _0xa896=function(_0x5ae179,_0x355f67){_0x5ae179=_0x5ae179-0x0;var _0x40bc08=_0x896a[_0x5ae179];return _0x40bc08;};'use strict';var Sequelize=require(_0xa896('0x0'));module[_0xa896('0x1')]={'name':{'type':Sequelize[_0xa896('0x2')],'unique':_0xa896('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa896('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cf2773c..31af387 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 _0xa9e0=['limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','SquareOdbc','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','test','dsn','openSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset'];(function(_0x1a50b6,_0x38927c){var _0x2ca6bb=function(_0x5d1e30){while(--_0x5d1e30){_0x1a50b6['push'](_0x1a50b6['shift']());}};_0x2ca6bb(++_0x38927c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='ODBC';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['SquareOdbc'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['SquareOdbc']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['SquareOdbc'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='ODBC';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['SquareOdbc'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){var _0x1bf38a;return db['SquareOdbc']['find']({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']},'attributes':['id',_0x0a9e('0x4d')]})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){var _0x211ef9=require('odbc')();_0x211ef9[_0x0a9e('0x4e')](_0x5ce9ac['dsn']);_0x211ef9['closeSync']();return _0x5ce9ac;}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));}; \ No newline at end of file +var _0xa9e0=['limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','SquareOdbc','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','test','dsn','openSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset'];(function(_0x590bf0,_0x446f5a){var _0x26b4c1=function(_0x3dc3f8){while(--_0x3dc3f8){_0x590bf0['push'](_0x590bf0['shift']());}};_0x26b4c1(++_0x446f5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='ODBC';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['SquareOdbc'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['SquareOdbc']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['SquareOdbc'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='ODBC';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['SquareOdbc'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){var _0x1bf38a;return db['SquareOdbc']['find']({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']},'attributes':['id',_0x0a9e('0x4d')]})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){var _0x211ef9=require('odbc')();_0x211ef9[_0x0a9e('0x4e')](_0x5ce9ac['dsn']);_0x211ef9['closeSync']();return _0x5ce9ac;}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index cd3f5fe..aa8395a 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 _0x07fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api'];(function(_0x1f1d95,_0x270481){var _0x1b1b82=function(_0x99e490){while(--_0x99e490){_0x1f1d95['push'](_0x1f1d95['shift']());}};_0x1b1b82(++_0x270481);}(_0x07fe,0x177));var _0xe07f=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x07fe[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xe07f('0x0'));var util=require(_0xe07f('0x1'));var logger=require('../../config/logger')(_0xe07f('0x2'));var moment=require(_0xe07f('0x3'));var BPromise=require(_0xe07f('0x4'));var rp=require(_0xe07f('0x5'));var fs=require('fs');var path=require(_0xe07f('0x6'));var rimraf=require(_0xe07f('0x7'));var config=require(_0xe07f('0x8'));var attributes=require(_0xe07f('0x9'));module[_0xe07f('0xa')]=function(_0xc05328,_0x280c7c){return _0xc05328[_0xe07f('0xb')](_0xe07f('0xc'),attributes,{'tableName':_0xe07f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ce=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','../../config/logger','moment'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0xb2ce,0x17a));var _0xeb2c=function(_0x953a7e,_0xa2aed0){_0x953a7e=_0x953a7e-0x0;var _0x34cf54=_0xb2ce[_0x953a7e];return _0x34cf54;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb2c('0x0'))('api');var moment=require(_0xeb2c('0x1'));var BPromise=require('bluebird');var rp=require(_0xeb2c('0x2'));var fs=require('fs');var path=require(_0xeb2c('0x3'));var rimraf=require(_0xeb2c('0x4'));var config=require(_0xeb2c('0x5'));var attributes=require(_0xeb2c('0x6'));module[_0xeb2c('0x7')]=function(_0x59f5eb,_0x4c778d){return _0x59f5eb[_0xeb2c('0x8')](_0xeb2c('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 4c9b6b2..ae8b783 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 _0xd1d6=['jayson/promise','client','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x52e021,_0x2d3b29){var _0x42c0cf=function(_0x38fb10){while(--_0x38fb10){_0x52e021['push'](_0x52e021['shift']());}};_0x42c0cf(++_0x2d3b29);}(_0xd1d6,0xa4));var _0x6d1d=function(_0x523aca,_0x3badd1){_0x523aca=_0x523aca-0x0;var _0x33e844=_0xd1d6[_0x523aca];return _0x33e844;};'use strict';var _=require(_0x6d1d('0x0'));var util=require(_0x6d1d('0x1'));var moment=require(_0x6d1d('0x2'));var BPromise=require(_0x6d1d('0x3'));var rs=require(_0x6d1d('0x4'));var fs=require('fs');var Redis=require(_0x6d1d('0x5'));var db=require(_0x6d1d('0x6'))['db'];var utils=require(_0x6d1d('0x7'));var logger=require(_0x6d1d('0x8'))(_0x6d1d('0x9'));var config=require(_0x6d1d('0xa'));var jayson=require(_0x6d1d('0xb'));var client=jayson[_0x6d1d('0xc')][_0x6d1d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xabed77,_0x5593eb,_0x47e41a){return new BPromise(function(_0x1250ee,_0x10459d){return client[_0x6d1d('0xe')](_0xabed77,_0x47e41a)[_0x6d1d('0xf')](function(_0x2ca98a){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x5593eb,_0x6d1d('0x10'));logger[_0x6d1d('0x11')](_0x6d1d('0x12'),_0x5593eb,'request\x20sent',JSON[_0x6d1d('0x13')](_0x2ca98a));if(_0x2ca98a[_0x6d1d('0x14')]){if(_0x2ca98a[_0x6d1d('0x14')][_0x6d1d('0x15')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x5593eb,_0x2ca98a[_0x6d1d('0x14')][_0x6d1d('0x16')]);return _0x10459d(_0x2ca98a[_0x6d1d('0x14')]['message']);}logger[_0x6d1d('0x14')](_0x6d1d('0x17'),_0x5593eb,_0x2ca98a['error'][_0x6d1d('0x16')]);return _0x1250ee(_0x2ca98a[_0x6d1d('0x14')]['message']);}else{logger['info'](_0x6d1d('0x17'),_0x5593eb,'request\x20sent');_0x1250ee(_0x2ca98a[_0x6d1d('0x18')][_0x6d1d('0x16')]);}})[_0x6d1d('0x19')](function(_0x21aef7){logger[_0x6d1d('0x14')](_0x6d1d('0x17'),_0x5593eb,_0x21aef7);_0x10459d(_0x21aef7);});});}exports[_0x6d1d('0x1a')]=function(_0x302a9e){var _0x224690=this;return new Promise(function(_0x1a7ebc,_0x3fe3a2){return db[_0x6d1d('0x1b')]['find']({'raw':_0x302a9e[_0x6d1d('0x1c')]?_0x302a9e['options'][_0x6d1d('0x1d')]===undefined?!![]:![]:!![],'where':_0x302a9e[_0x6d1d('0x1c')]?_0x302a9e[_0x6d1d('0x1c')][_0x6d1d('0x1e')]||null:null,'attributes':_0x302a9e[_0x6d1d('0x1c')]?_0x302a9e[_0x6d1d('0x1c')][_0x6d1d('0x1f')]||null:null,'include':_0x302a9e[_0x6d1d('0x1c')]?_0x302a9e[_0x6d1d('0x1c')]['include']?_[_0x6d1d('0x20')](_0x302a9e[_0x6d1d('0x1c')][_0x6d1d('0x21')],function(_0x4927d1){return{'model':db[_0x4927d1['model']],'as':_0x4927d1['as'],'attributes':_0x4927d1[_0x6d1d('0x1f')],'include':_0x4927d1[_0x6d1d('0x21')]?_['map'](_0x4927d1[_0x6d1d('0x21')],function(_0x56f4c4){return{'model':db[_0x56f4c4[_0x6d1d('0x22')]],'as':_0x56f4c4['as'],'attributes':_0x56f4c4['attributes'],'include':_0x56f4c4['include']?_[_0x6d1d('0x20')](_0x56f4c4[_0x6d1d('0x21')],function(_0x1a77c9){return{'model':db[_0x1a77c9['model']],'as':_0x1a77c9['as'],'attributes':_0x1a77c9[_0x6d1d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6d1d('0xf')](function(_0x1d2784){logger['info'](_0x6d1d('0x1a'),_0x302a9e);logger['debug'](_0x6d1d('0x1a'),_0x302a9e,JSON[_0x6d1d('0x13')](_0x1d2784));_0x1a7ebc(_0x1d2784);})[_0x6d1d('0x19')](function(_0x576513){logger['error'](_0x6d1d('0x1a'),_0x576513['message'],_0x302a9e);_0x3fe3a2(_0x224690['error'](0x1f4,_0x576513[_0x6d1d('0x16')]));});});}; \ No newline at end of file +var _0xd69c=['client','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','map','include','model','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e63f1,_0x34a2db){var _0xdbd910=function(_0x40261f){while(--_0x40261f){_0x4e63f1['push'](_0x4e63f1['shift']());}};_0xdbd910(++_0x34a2db);}(_0xd69c,0x14b));var _0xcd69=function(_0x573200,_0x42b24f){_0x573200=_0x573200-0x0;var _0x2d0ceb=_0xd69c[_0x573200];return _0x2d0ceb;};'use strict';var _=require(_0xcd69('0x0'));var util=require(_0xcd69('0x1'));var moment=require(_0xcd69('0x2'));var BPromise=require('bluebird');var rs=require(_0xcd69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd69('0x4'))['db'];var utils=require(_0xcd69('0x5'));var logger=require(_0xcd69('0x6'))(_0xcd69('0x7'));var config=require(_0xcd69('0x8'));var jayson=require(_0xcd69('0x9'));var client=jayson[_0xcd69('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad0a3,_0x58e3bd,_0x1d04c5){return new BPromise(function(_0x13c41f,_0x33911f){return client['request'](_0x1ad0a3,_0x1d04c5)[_0xcd69('0xb')](function(_0x5be380){logger[_0xcd69('0xc')](_0xcd69('0xd'),_0x58e3bd,'request\x20sent');logger[_0xcd69('0xe')](_0xcd69('0xf'),_0x58e3bd,'request\x20sent',JSON[_0xcd69('0x10')](_0x5be380));if(_0x5be380[_0xcd69('0x11')]){if(_0x5be380[_0xcd69('0x11')][_0xcd69('0x12')]===0x1f4){logger[_0xcd69('0x11')](_0xcd69('0xd'),_0x58e3bd,_0x5be380['error'][_0xcd69('0x13')]);return _0x33911f(_0x5be380['error'][_0xcd69('0x13')]);}logger[_0xcd69('0x11')](_0xcd69('0xd'),_0x58e3bd,_0x5be380[_0xcd69('0x11')]['message']);return _0x13c41f(_0x5be380[_0xcd69('0x11')]['message']);}else{logger['info'](_0xcd69('0xd'),_0x58e3bd,'request\x20sent');_0x13c41f(_0x5be380[_0xcd69('0x14')]['message']);}})[_0xcd69('0x15')](function(_0x49ec31){logger[_0xcd69('0x11')](_0xcd69('0xd'),_0x58e3bd,_0x49ec31);_0x33911f(_0x49ec31);});});}exports[_0xcd69('0x16')]=function(_0x12f390){var _0x3bffad=this;return new Promise(function(_0x5f3eea,_0x3e169c){return db[_0xcd69('0x17')][_0xcd69('0x18')]({'raw':_0x12f390[_0xcd69('0x19')]?_0x12f390[_0xcd69('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12f390[_0xcd69('0x19')]?_0x12f390['options'][_0xcd69('0x1a')]||null:null,'attributes':_0x12f390['options']?_0x12f390[_0xcd69('0x19')]['attributes']||null:null,'include':_0x12f390[_0xcd69('0x19')]?_0x12f390[_0xcd69('0x19')]['include']?_[_0xcd69('0x1b')](_0x12f390[_0xcd69('0x19')][_0xcd69('0x1c')],function(_0x2e7938){return{'model':db[_0x2e7938[_0xcd69('0x1d')]],'as':_0x2e7938['as'],'attributes':_0x2e7938[_0xcd69('0x1e')],'include':_0x2e7938[_0xcd69('0x1c')]?_['map'](_0x2e7938[_0xcd69('0x1c')],function(_0x46dab7){return{'model':db[_0x46dab7[_0xcd69('0x1d')]],'as':_0x46dab7['as'],'attributes':_0x46dab7[_0xcd69('0x1e')],'include':_0x46dab7[_0xcd69('0x1c')]?_[_0xcd69('0x1b')](_0x46dab7['include'],function(_0x7507fc){return{'model':db[_0x7507fc[_0xcd69('0x1d')]],'as':_0x7507fc['as'],'attributes':_0x7507fc[_0xcd69('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39d38a){logger[_0xcd69('0xc')](_0xcd69('0x16'),_0x12f390);logger[_0xcd69('0xe')](_0xcd69('0x16'),_0x12f390,JSON['stringify'](_0x39d38a));_0x5f3eea(_0x39d38a);})[_0xcd69('0x15')](function(_0x26cc79){logger[_0xcd69('0x11')]('ShowSquareOdbc',_0x26cc79[_0xcd69('0x13')],_0x12f390);_0x3e169c(_0x3bffad[_0xcd69('0x11')](0x1f4,_0x26cc79[_0xcd69('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 94d0269..1789a76 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 _0x3180=['get','/:id','isAuthenticated','getUsers','create','post','/:id/users','put','update','delete','destroy','removeUsers','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x3180,0x19b));var _0x0318=function(_0x27466a,_0x4c0b5b){_0x27466a=_0x27466a-0x0;var _0x5c2d64=_0x3180[_0x27466a];return _0x5c2d64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0318('0x0'));var timeout=require(_0x0318('0x1'));var express=require(_0x0318('0x2'));var router=express['Router']();var auth=require(_0x0318('0x3'));var interaction=require(_0x0318('0x4'));var config=require(_0x0318('0x5'));var controller=require(_0x0318('0x6'));router[_0x0318('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0318('0x8'),auth[_0x0318('0x9')](),controller['show']);router[_0x0318('0x7')]('/:id/users',auth[_0x0318('0x9')](),controller[_0x0318('0xa')]);router['post']('/',auth[_0x0318('0x9')](),controller[_0x0318('0xb')]);router[_0x0318('0xc')](_0x0318('0xd'),auth['isAuthenticated'](),controller['addUsers']);router[_0x0318('0xe')](_0x0318('0x8'),auth[_0x0318('0x9')](),controller[_0x0318('0xf')]);router[_0x0318('0x10')]('/:id',auth[_0x0318('0x9')](),controller[_0x0318('0x11')]);router['delete'](_0x0318('0xd'),auth[_0x0318('0x9')](),controller[_0x0318('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1f26=['update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','/:id/users','getUsers','post','create','addUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f26,0xec));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x61f2('0x0'));var util=require(_0x61f2('0x1'));var path=require(_0x61f2('0x2'));var timeout=require(_0x61f2('0x3'));var express=require(_0x61f2('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x61f2('0x5'));var config=require(_0x61f2('0x6'));var controller=require(_0x61f2('0x7'));router[_0x61f2('0x8')]('/',auth[_0x61f2('0x9')](),controller['index']);router[_0x61f2('0x8')](_0x61f2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x61f2('0x8')](_0x61f2('0xb'),auth['isAuthenticated'](),controller[_0x61f2('0xc')]);router[_0x61f2('0xd')]('/',auth[_0x61f2('0x9')](),controller[_0x61f2('0xe')]);router[_0x61f2('0xd')]('/:id/users',auth['isAuthenticated'](),controller[_0x61f2('0xf')]);router['put'](_0x61f2('0xa'),auth[_0x61f2('0x9')](),controller[_0x61f2('0x10')]);router[_0x61f2('0x11')](_0x61f2('0xa'),auth[_0x61f2('0x9')](),controller[_0x61f2('0x12')]);router[_0x61f2('0x11')](_0x61f2('0xb'),auth['isAuthenticated'](),controller[_0x61f2('0x13')]);module[_0x61f2('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4b74004..aed7896 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 _0xa992=['sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0xc3f66b,_0x436c69){var _0x40715f=function(_0x112577){while(--_0x112577){_0xc3f66b['push'](_0xc3f66b['shift']());}};_0x40715f(++_0x436c69);}(_0xa992,0x18c));var _0x2a99=function(_0x3521e7,_0x2981d7){_0x3521e7=_0x3521e7-0x0;var _0x29f64a=_0xa992[_0x3521e7];return _0x29f64a;};'use strict';var Sequelize=require(_0x2a99('0x0'));module[_0x2a99('0x1')]={'name':{'type':Sequelize[_0x2a99('0x2')],'unique':_0x2a99('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x2a99('0x4')]},'preproduction':{'type':Sequelize[_0x2a99('0x5')](_0x2a99('0x6')),'get':function(){if(this[_0x2a99('0x7')](_0x2a99('0x8'))){return this[_0x2a99('0x7')](_0x2a99('0x8'))[_0x2a99('0x9')](_0x2a99('0xa'));}}},'production':{'type':Sequelize[_0x2a99('0x5')]('long'),'get':function(){if(this[_0x2a99('0x7')](_0x2a99('0xb'))){return this[_0x2a99('0x7')](_0x2a99('0xb'))[_0x2a99('0x9')](_0x2a99('0xa'));}}}}; \ No newline at end of file +var _0xd6bb=['name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','sequelize','STRING'];(function(_0x45d38a,_0x3dae53){var _0x31113e=function(_0x3d484b){while(--_0x3d484b){_0x45d38a['push'](_0x45d38a['shift']());}};_0x31113e(++_0x3dae53);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xd6bb[_0xdeefbd];return _0x4ff63f;};'use strict';var Sequelize=require(_0xbd6b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd6b('0x1')],'unique':_0xbd6b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xbd6b('0x1')]},'notes':{'type':Sequelize[_0xbd6b('0x3')]},'preproduction':{'type':Sequelize[_0xbd6b('0x4')]('long'),'get':function(){if(this[_0xbd6b('0x5')](_0xbd6b('0x6'))){return this[_0xbd6b('0x5')]('preproduction')[_0xbd6b('0x7')](_0xbd6b('0x8'));}}},'production':{'type':Sequelize[_0xbd6b('0x4')](_0xbd6b('0x9')),'get':function(){if(this[_0xbd6b('0x5')](_0xbd6b('0xa'))){return this[_0xbd6b('0x5')](_0xbd6b('0xa'))[_0xbd6b('0x7')](_0xbd6b('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9dc77c8..9d2f67b 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 _0x1f75=['fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','SquareProject','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','order','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','set','json','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','keys','query','intersection','attributes','model'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x1f75,0x1c1));var _0x51f7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1f75[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x51f7('0x0'));var emlformat=require(_0x51f7('0x1'));var rimraf=require(_0x51f7('0x2'));var zipdir=require(_0x51f7('0x3'));var jsonpatch=require(_0x51f7('0x4'));var rp=require(_0x51f7('0x5'));var moment=require(_0x51f7('0x6'));var BPromise=require(_0x51f7('0x7'));var Mustache=require(_0x51f7('0x8'));var util=require(_0x51f7('0x9'));var path=require(_0x51f7('0xa'));var sox=require(_0x51f7('0xb'));var csv=require(_0x51f7('0xc'));var ejs=require(_0x51f7('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51f7('0xe'));var crypto=require(_0x51f7('0xf'));var jsforce=require(_0x51f7('0x10'));var deskjs=require(_0x51f7('0x11'));var toCsv=require(_0x51f7('0xc'));var querystring=require(_0x51f7('0x12'));var Papa=require(_0x51f7('0x13'));var Redis=require(_0x51f7('0x14'));var authService=require(_0x51f7('0x15'));var qs=require(_0x51f7('0x16'));var hardwareService=require(_0x51f7('0x17'));var logger=require(_0x51f7('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x51f7('0x19'))['db'];config[_0x51f7('0x1a')]=_[_0x51f7('0x1b')](config['redis'],{'host':_0x51f7('0x1c'),'port':0x18eb});var socket=require(_0x51f7('0x1d'))(new Redis(config[_0x51f7('0x1a')]));require(_0x51f7('0x1e'))[_0x51f7('0x1f')](socket);function respondWithStatusCode(_0x1405a4,_0x49cf77){_0x49cf77=_0x49cf77||0xcc;return function(_0xb3d0b1){if(_0xb3d0b1){return _0x1405a4[_0x51f7('0x20')](_0x49cf77);}return _0x1405a4[_0x51f7('0x21')](_0x49cf77)[_0x51f7('0x22')]();};}function respondWithResult(_0x1dd987,_0xc5062f){_0xc5062f=_0xc5062f||0xc8;return function(_0x13680f){if(_0x13680f){return _0x1dd987[_0x51f7('0x21')](_0xc5062f)['json'](_0x13680f);}};}function respondWithFilteredResult(_0x42a46e,_0x42af97){return function(_0x3906b0){if(_0x3906b0){var _0x40e8ca=_0x3906b0[_0x51f7('0x23')],_0x5468a0=_0x42af97[_0x51f7('0x24')],_0x442697=_0x42af97[_0x51f7('0x24')]+_0x42af97[_0x51f7('0x25')],_0x12b0cd;if(_0x442697>=_0x40e8ca){_0x442697=_0x40e8ca;_0x12b0cd=0xc8;}else{_0x12b0cd=0xce;}_0x42a46e[_0x51f7('0x21')](_0x12b0cd);return _0x42a46e[_0x51f7('0x26')]('Content-Range',_0x5468a0+'-'+_0x442697+'/'+_0x40e8ca)[_0x51f7('0x27')](_0x3906b0);}return null;};}function patchUpdates(_0x1ecc20){return function(_0x14cd24){try{jsonpatch['apply'](_0x14cd24,_0x1ecc20,!![]);}catch(_0x2e4ace){return BPromise[_0x51f7('0x28')](_0x2e4ace);}return _0x14cd24['save']();};}function saveUpdates(_0x2794c3,_0x1da3b3){return function(_0x29d673){if(_0x29d673){return _0x29d673[_0x51f7('0x29')](_0x2794c3)[_0x51f7('0x2a')](function(_0x4dbc21){return _0x4dbc21;});}return null;};}function removeEntity(_0x454abc,_0x1db1b2){return function(_0x28bd02){if(_0x28bd02){return _0x28bd02[_0x51f7('0x2b')]()['then'](function(){var _0x57c03d=_0x28bd02[_0x51f7('0x2c')]({'plain':!![]});var _0x5bcd87='SquareProjects';return db[_0x51f7('0x2d')]['destroy']({'where':{'type':_0x5bcd87,'resourceId':_0x57c03d['id']}})[_0x51f7('0x2a')](function(){return _0x28bd02;});})[_0x51f7('0x2a')](function(){_0x454abc[_0x51f7('0x21')](0xcc)[_0x51f7('0x22')]();});}};}function handleEntityNotFound(_0x3a879d,_0x11763d){return function(_0x383aaa){if(!_0x383aaa){_0x3a879d[_0x51f7('0x20')](0x194);}return _0x383aaa;};}function handleError(_0x3a3801,_0x1819fc){_0x1819fc=_0x1819fc||0x1f4;return function(_0x592bf4){logger[_0x51f7('0x2e')](_0x592bf4[_0x51f7('0x2f')]);if(_0x592bf4[_0x51f7('0x30')]){delete _0x592bf4[_0x51f7('0x30')];}_0x3a3801[_0x51f7('0x21')](_0x1819fc)[_0x51f7('0x31')](_0x592bf4);};}exports[_0x51f7('0x32')]=function(_0x408a29,_0x2ffb8c){var _0x3a51a1={},_0x2baf86={},_0x373b23={'count':0x0,'rows':[]};var _0x40a1bc=db['SquareProject']['rawAttributes'];_0x2baf86['model']=_[_0x51f7('0x33')](_0x40a1bc);_0x2baf86[_0x51f7('0x34')]=_[_0x51f7('0x33')](_0x408a29['query']);_0x2baf86['filters']=_[_0x51f7('0x35')](_0x2baf86['model'],_0x2baf86['query']);_0x3a51a1[_0x51f7('0x36')]=_[_0x51f7('0x35')](_0x2baf86[_0x51f7('0x37')],qs[_0x51f7('0x38')](_0x408a29[_0x51f7('0x34')]['fields']));_0x3a51a1[_0x51f7('0x36')]=_0x3a51a1['attributes']['length']?_0x3a51a1[_0x51f7('0x36')]:_0x2baf86[_0x51f7('0x37')];if(!_0x408a29['query'][_0x51f7('0x39')](_0x51f7('0x3a'))){_0x3a51a1[_0x51f7('0x25')]=qs[_0x51f7('0x25')](_0x408a29[_0x51f7('0x34')]['limit']);_0x3a51a1[_0x51f7('0x24')]=qs['offset'](_0x408a29['query']['offset']);}_0x3a51a1['order']=qs['sort'](_0x408a29['query'][_0x51f7('0x3b')]);_0x3a51a1[_0x51f7('0x3c')]=qs[_0x51f7('0x3d')](_[_0x51f7('0x3e')](_0x408a29[_0x51f7('0x34')],_0x2baf86[_0x51f7('0x3d')]));if(_0x408a29[_0x51f7('0x34')]['filter']){_0x3a51a1[_0x51f7('0x3c')]=_[_0x51f7('0x3f')](_0x3a51a1['where'],{'$or':_['map'](_0x40a1bc,function(_0x494e88){if(_0x494e88[_0x51f7('0x40')][_0x51f7('0x41')]!==_0x51f7('0x42')){var _0x4a1dba={};_0x4a1dba[_0x494e88[_0x51f7('0x43')]]={'$like':'%'+_0x408a29[_0x51f7('0x34')][_0x51f7('0x44')]+'%'};return _0x4a1dba;}})});}_0x3a51a1=_['merge']({},_0x3a51a1,_0x408a29[_0x51f7('0x45')]);var _0x2b0e18={'where':_0x3a51a1[_0x51f7('0x3c')]};return db[_0x51f7('0x46')][_0x51f7('0x23')](_0x2b0e18)[_0x51f7('0x2a')](function(_0x2bbf96){_0x373b23['count']=_0x2bbf96;if(_0x408a29['query']['includeAll']){_0x3a51a1['include']=[{'all':!![]}];}return db[_0x51f7('0x46')][_0x51f7('0x47')](_0x3a51a1);})[_0x51f7('0x2a')](function(_0x365a42){_0x373b23[_0x51f7('0x48')]=_0x365a42;return _0x373b23;})[_0x51f7('0x2a')](respondWithFilteredResult(_0x2ffb8c,_0x3a51a1))[_0x51f7('0x49')](handleError(_0x2ffb8c,null));};exports[_0x51f7('0x4a')]=function(_0x259dd1,_0x437e94){var _0x57050b={'raw':![],'where':{'id':_0x259dd1[_0x51f7('0x4b')]['id']}},_0xe73071={};_0xe73071['model']=_[_0x51f7('0x33')](db[_0x51f7('0x46')][_0x51f7('0x4c')]);_0xe73071['query']=_['keys'](_0x259dd1['query']);_0xe73071['filters']=_[_0x51f7('0x35')](_0xe73071['model'],_0xe73071['query']);_0x57050b[_0x51f7('0x36')]=_['intersection'](_0xe73071[_0x51f7('0x37')],qs[_0x51f7('0x38')](_0x259dd1[_0x51f7('0x34')][_0x51f7('0x38')]));_0x57050b[_0x51f7('0x36')]=_0x57050b[_0x51f7('0x36')][_0x51f7('0x4d')]?_0x57050b[_0x51f7('0x36')]:_0xe73071['model'];if(_0x259dd1[_0x51f7('0x34')]['includeAll']){_0x57050b[_0x51f7('0x4e')]=[{'all':!![]}];}_0x57050b=_[_0x51f7('0x3f')]({},_0x57050b,_0x259dd1['options']);return db[_0x51f7('0x46')][_0x51f7('0x4f')](_0x57050b)[_0x51f7('0x2a')](handleEntityNotFound(_0x437e94,null))[_0x51f7('0x2a')](respondWithResult(_0x437e94,null))['catch'](handleError(_0x437e94,null));};exports[_0x51f7('0x50')]=function(_0x255231,_0x10bb33){return db[_0x51f7('0x46')][_0x51f7('0x50')](_0x255231[_0x51f7('0x51')],{})['then'](function(_0x525854){var _0x4db19a=_0x255231[_0x51f7('0x52')][_0x51f7('0x2c')]({'plain':!![]});if(!_0x4db19a)throw new Error(_0x51f7('0x53'));if(_0x4db19a[_0x51f7('0x54')]===_0x51f7('0x52')){var _0x33ec27=_0x525854[_0x51f7('0x2c')]({'plain':!![]});var _0x3c83e9=_0x51f7('0x55');return db[_0x51f7('0x56')]['find']({'where':{'name':_0x3c83e9,'userProfileId':_0x4db19a[_0x51f7('0x57')]},'raw':!![]})[_0x51f7('0x2a')](function(_0x210b9e){if(_0x210b9e&&_0x210b9e[_0x51f7('0x58')]===0x0){return db[_0x51f7('0x2d')][_0x51f7('0x50')]({'name':_0x33ec27[_0x51f7('0x30')],'resourceId':_0x33ec27['id'],'type':_0x210b9e[_0x51f7('0x30')],'sectionId':_0x210b9e['id']},{})[_0x51f7('0x2a')](function(){return _0x525854;});}else{return _0x525854;}})[_0x51f7('0x49')](function(_0x3f9d67){logger[_0x51f7('0x2e')](_0x51f7('0x59'),_0x3f9d67);throw _0x3f9d67;});}return _0x525854;})[_0x51f7('0x2a')](respondWithResult(_0x10bb33,0xc9))[_0x51f7('0x49')](handleError(_0x10bb33,null));};exports[_0x51f7('0x29')]=function(_0x306eb9,_0x4279e4){if(_0x306eb9[_0x51f7('0x51')]['id']){delete _0x306eb9[_0x51f7('0x51')]['id'];}return db[_0x51f7('0x46')][_0x51f7('0x4f')]({'where':{'id':_0x306eb9['params']['id']}})[_0x51f7('0x2a')](handleEntityNotFound(_0x4279e4,null))[_0x51f7('0x2a')](saveUpdates(_0x306eb9[_0x51f7('0x51')],null))[_0x51f7('0x2a')](respondWithResult(_0x4279e4,null))[_0x51f7('0x49')](handleError(_0x4279e4,null));};exports[_0x51f7('0x2b')]=function(_0x62554c,_0x12fec0){return db[_0x51f7('0x46')][_0x51f7('0x4f')]({'where':{'id':_0x62554c[_0x51f7('0x4b')]['id']}})[_0x51f7('0x2a')](handleEntityNotFound(_0x12fec0,null))[_0x51f7('0x2a')](removeEntity(_0x12fec0,null))[_0x51f7('0x49')](handleError(_0x12fec0,null));};exports['addUsers']=function(_0x9b22e0,_0x33c4d8,_0x3c6f49){return db[_0x51f7('0x46')][_0x51f7('0x4f')]({'where':{'id':_0x9b22e0[_0x51f7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33c4d8,null))[_0x51f7('0x2a')](function(_0x56dc2c){if(_0x56dc2c){return _0x56dc2c[_0x51f7('0x5a')](_0x9b22e0[_0x51f7('0x51')][_0x51f7('0x5b')],_[_0x51f7('0x5c')](_0x9b22e0[_0x51f7('0x51')],[_0x51f7('0x5b'),'id'])||{});}})[_0x51f7('0x2a')](respondWithResult(_0x33c4d8,null))[_0x51f7('0x49')](handleError(_0x33c4d8,null));};exports[_0x51f7('0x5d')]=function(_0x2e69e1,_0x51ce2f,_0x142b15){return db['SquareProject']['find']({'where':{'id':_0x2e69e1[_0x51f7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51ce2f,null))[_0x51f7('0x2a')](function(_0x5409b5){if(_0x5409b5){return _0x5409b5[_0x51f7('0x5d')](_0x2e69e1[_0x51f7('0x34')][_0x51f7('0x5b')])[_0x51f7('0x2a')](function(){if(_[_0x51f7('0x5e')](_0x2e69e1[_0x51f7('0x34')]['ids'])){for(var _0x1241fc=0x0;_0x1241fc<_0x2e69e1[_0x51f7('0x34')][_0x51f7('0x5b')][_0x51f7('0x4d')];_0x1241fc+=0x1){socket[_0x51f7('0x5f')](_0x51f7('0x60'),{'UserId':Number(_0x2e69e1[_0x51f7('0x34')][_0x51f7('0x5b')][_0x1241fc]),'SquareProjectId':Number(_0x2e69e1[_0x51f7('0x4b')]['id'])});}}else{socket[_0x51f7('0x5f')]('userSquareProject:remove',{'UserId':Number(_0x2e69e1[_0x51f7('0x34')][_0x51f7('0x5b')]),'SquareProjectId':Number(_0x2e69e1[_0x51f7('0x4b')]['id'])});}});}})[_0x51f7('0x2a')](respondWithStatusCode(_0x51ce2f,null))['catch'](handleError(_0x51ce2f,null));};exports[_0x51f7('0x61')]=function(_0x30f46c,_0x44dae2,_0x297b28){var _0x3448b4={};var _0x2234d4={};var _0x139be2;var _0x4683a0;return db[_0x51f7('0x46')][_0x51f7('0x62')]({'where':{'id':_0x30f46c['params']['id']}})[_0x51f7('0x2a')](handleEntityNotFound(_0x44dae2,null))[_0x51f7('0x2a')](function(_0x119bb2){if(_0x119bb2){_0x139be2=_0x119bb2;_0x2234d4['model']=_['keys'](db['User'][_0x51f7('0x4c')]);_0x2234d4['query']=_[_0x51f7('0x33')](_0x30f46c[_0x51f7('0x34')]);_0x2234d4[_0x51f7('0x3d')]=_['intersection'](_0x2234d4[_0x51f7('0x37')],_0x2234d4['query']);_0x3448b4[_0x51f7('0x36')]=_[_0x51f7('0x35')](_0x2234d4[_0x51f7('0x37')],qs[_0x51f7('0x38')](_0x30f46c[_0x51f7('0x34')][_0x51f7('0x38')]));_0x3448b4[_0x51f7('0x36')]=_0x3448b4[_0x51f7('0x36')]['length']?_0x3448b4[_0x51f7('0x36')]:_0x2234d4['model'];_0x3448b4[_0x51f7('0x63')]=qs[_0x51f7('0x3b')](_0x30f46c[_0x51f7('0x34')][_0x51f7('0x3b')]);_0x3448b4[_0x51f7('0x3c')]=qs[_0x51f7('0x3d')](_[_0x51f7('0x3e')](_0x30f46c['query'],_0x2234d4['filters']));if(_0x30f46c[_0x51f7('0x34')][_0x51f7('0x44')]){_0x3448b4[_0x51f7('0x3c')]=_[_0x51f7('0x3f')](_0x3448b4[_0x51f7('0x3c')],{'$or':_[_0x51f7('0x64')](_0x3448b4[_0x51f7('0x36')],function(_0x2c40ae){var _0x3d954b={};_0x3d954b[_0x2c40ae]={'$like':'%'+_0x30f46c[_0x51f7('0x34')]['filter']+'%'};return _0x3d954b;})});}_0x3448b4=_[_0x51f7('0x3f')]({},_0x3448b4,_0x30f46c[_0x51f7('0x45')]);return _0x139be2[_0x51f7('0x61')](_0x3448b4);}})[_0x51f7('0x2a')](function(_0x10f885){if(_0x10f885){_0x4683a0=_0x10f885[_0x51f7('0x4d')];if(!_0x30f46c[_0x51f7('0x34')][_0x51f7('0x39')](_0x51f7('0x3a'))){_0x3448b4['limit']=qs[_0x51f7('0x25')](_0x30f46c[_0x51f7('0x34')][_0x51f7('0x25')]);_0x3448b4[_0x51f7('0x24')]=qs[_0x51f7('0x24')](_0x30f46c['query'][_0x51f7('0x24')]);}return _0x139be2[_0x51f7('0x61')](_0x3448b4);}})[_0x51f7('0x2a')](function(_0x16fd88){if(_0x16fd88){return _0x16fd88?{'count':_0x4683a0,'rows':_0x16fd88}:null;}})[_0x51f7('0x2a')](respondWithResult(_0x44dae2,null))[_0x51f7('0x49')](handleError(_0x44dae2,null));}; \ No newline at end of file +var _0x02a7=['Content-Range','apply','update','then','destroy','SquareProjects','UserProfileResource','stack','name','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','field','options','SquareProject','includeAll','include','findAll','catch','show','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','isArray','emit','userSquareProject:remove','getUsers','User','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit'];(function(_0x52e77f,_0x368694){var _0x3aad87=function(_0x2a4f2e){while(--_0x2a4f2e){_0x52e77f['push'](_0x52e77f['shift']());}};_0x3aad87(++_0x368694);}(_0x02a7,0xe4));var _0x702a=function(_0xd4caa2,_0x5e8bc6){_0xd4caa2=_0xd4caa2-0x0;var _0x51fb5a=_0x02a7[_0xd4caa2];return _0x51fb5a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x702a('0x1'));var rp=require(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var Mustache=require(_0x702a('0x5'));var util=require(_0x702a('0x6'));var path=require('path');var sox=require(_0x702a('0x7'));var csv=require(_0x702a('0x8'));var ejs=require(_0x702a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x702a('0xa'));var jsforce=require(_0x702a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x702a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x702a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x702a('0xd'));var hardwareService=require(_0x702a('0xe'));var logger=require(_0x702a('0xf'))(_0x702a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x702a('0x11'))['db'];config[_0x702a('0x12')]=_[_0x702a('0x13')](config[_0x702a('0x12')],{'host':_0x702a('0x14'),'port':0x18eb});var socket=require(_0x702a('0x15'))(new Redis(config[_0x702a('0x12')]));require('./squareProject.socket')[_0x702a('0x16')](socket);function respondWithStatusCode(_0x22c848,_0x447c5e){_0x447c5e=_0x447c5e||0xcc;return function(_0x1f5c09){if(_0x1f5c09){return _0x22c848[_0x702a('0x17')](_0x447c5e);}return _0x22c848[_0x702a('0x18')](_0x447c5e)[_0x702a('0x19')]();};}function respondWithResult(_0x36a130,_0x18db6a){_0x18db6a=_0x18db6a||0xc8;return function(_0x1933fd){if(_0x1933fd){return _0x36a130[_0x702a('0x18')](_0x18db6a)[_0x702a('0x1a')](_0x1933fd);}};}function respondWithFilteredResult(_0x1b0c45,_0x573d05){return function(_0x20def1){if(_0x20def1){var _0x354fc4=_0x20def1[_0x702a('0x1b')],_0x29c268=_0x573d05[_0x702a('0x1c')],_0x3cc707=_0x573d05[_0x702a('0x1c')]+_0x573d05[_0x702a('0x1d')],_0x4f455a;if(_0x3cc707>=_0x354fc4){_0x3cc707=_0x354fc4;_0x4f455a=0xc8;}else{_0x4f455a=0xce;}_0x1b0c45[_0x702a('0x18')](_0x4f455a);return _0x1b0c45['set'](_0x702a('0x1e'),_0x29c268+'-'+_0x3cc707+'/'+_0x354fc4)[_0x702a('0x1a')](_0x20def1);}return null;};}function patchUpdates(_0x45403a){return function(_0x5b9e05){try{jsonpatch[_0x702a('0x1f')](_0x5b9e05,_0x45403a,!![]);}catch(_0x1777a9){return BPromise['reject'](_0x1777a9);}return _0x5b9e05['save']();};}function saveUpdates(_0x28e210,_0x41470c){return function(_0x41ed10){if(_0x41ed10){return _0x41ed10[_0x702a('0x20')](_0x28e210)[_0x702a('0x21')](function(_0x2a32c5){return _0x2a32c5;});}return null;};}function removeEntity(_0x5e12e7,_0x490baf){return function(_0x573b8e){if(_0x573b8e){return _0x573b8e[_0x702a('0x22')]()['then'](function(){var _0xb9bbda=_0x573b8e['get']({'plain':!![]});var _0x33ce46=_0x702a('0x23');return db[_0x702a('0x24')][_0x702a('0x22')]({'where':{'type':_0x33ce46,'resourceId':_0xb9bbda['id']}})['then'](function(){return _0x573b8e;});})['then'](function(){_0x5e12e7[_0x702a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6466,_0x5e8c85){return function(_0x534aab){if(!_0x534aab){_0x5e6466['sendStatus'](0x194);}return _0x534aab;};}function handleError(_0x239a12,_0x47bcf4){_0x47bcf4=_0x47bcf4||0x1f4;return function(_0x50b1ac){logger['error'](_0x50b1ac[_0x702a('0x25')]);if(_0x50b1ac[_0x702a('0x26')]){delete _0x50b1ac[_0x702a('0x26')];}_0x239a12[_0x702a('0x18')](_0x47bcf4)['send'](_0x50b1ac);};}exports[_0x702a('0x27')]=function(_0x4b3793,_0x3488dc){var _0x2f7357={},_0x19e714={},_0x4cdcf2={'count':0x0,'rows':[]};var _0x1af971=db['SquareProject'][_0x702a('0x28')];_0x19e714[_0x702a('0x29')]=_['keys'](_0x1af971);_0x19e714['query']=_[_0x702a('0x2a')](_0x4b3793[_0x702a('0x2b')]);_0x19e714['filters']=_['intersection'](_0x19e714[_0x702a('0x29')],_0x19e714[_0x702a('0x2b')]);_0x2f7357[_0x702a('0x2c')]=_[_0x702a('0x2d')](_0x19e714[_0x702a('0x29')],qs[_0x702a('0x2e')](_0x4b3793['query'][_0x702a('0x2e')]));_0x2f7357['attributes']=_0x2f7357[_0x702a('0x2c')][_0x702a('0x2f')]?_0x2f7357[_0x702a('0x2c')]:_0x19e714[_0x702a('0x29')];if(!_0x4b3793[_0x702a('0x2b')][_0x702a('0x30')](_0x702a('0x31'))){_0x2f7357[_0x702a('0x1d')]=qs['limit'](_0x4b3793[_0x702a('0x2b')]['limit']);_0x2f7357[_0x702a('0x1c')]=qs[_0x702a('0x1c')](_0x4b3793[_0x702a('0x2b')][_0x702a('0x1c')]);}_0x2f7357[_0x702a('0x32')]=qs[_0x702a('0x33')](_0x4b3793[_0x702a('0x2b')][_0x702a('0x33')]);_0x2f7357['where']=qs[_0x702a('0x34')](_[_0x702a('0x35')](_0x4b3793['query'],_0x19e714['filters']));if(_0x4b3793[_0x702a('0x2b')][_0x702a('0x36')]){_0x2f7357['where']=_[_0x702a('0x37')](_0x2f7357[_0x702a('0x38')],{'$or':_[_0x702a('0x39')](_0x1af971,function(_0x2fdbe9){if(_0x2fdbe9[_0x702a('0x3a')]['key']!=='VIRTUAL'){var _0x6467b={};_0x6467b[_0x2fdbe9[_0x702a('0x3b')]]={'$like':'%'+_0x4b3793[_0x702a('0x2b')][_0x702a('0x36')]+'%'};return _0x6467b;}})});}_0x2f7357=_[_0x702a('0x37')]({},_0x2f7357,_0x4b3793[_0x702a('0x3c')]);var _0x263bce={'where':_0x2f7357[_0x702a('0x38')]};return db[_0x702a('0x3d')]['count'](_0x263bce)['then'](function(_0x1b4f88){_0x4cdcf2[_0x702a('0x1b')]=_0x1b4f88;if(_0x4b3793[_0x702a('0x2b')][_0x702a('0x3e')]){_0x2f7357[_0x702a('0x3f')]=[{'all':!![]}];}return db['SquareProject'][_0x702a('0x40')](_0x2f7357);})[_0x702a('0x21')](function(_0x2231d2){_0x4cdcf2['rows']=_0x2231d2;return _0x4cdcf2;})['then'](respondWithFilteredResult(_0x3488dc,_0x2f7357))[_0x702a('0x41')](handleError(_0x3488dc,null));};exports[_0x702a('0x42')]=function(_0x1f7273,_0x5d8c60){var _0x2f0226={'raw':![],'where':{'id':_0x1f7273['params']['id']}},_0xea74e={};_0xea74e[_0x702a('0x29')]=_['keys'](db[_0x702a('0x3d')][_0x702a('0x28')]);_0xea74e['query']=_[_0x702a('0x2a')](_0x1f7273[_0x702a('0x2b')]);_0xea74e[_0x702a('0x34')]=_['intersection'](_0xea74e[_0x702a('0x29')],_0xea74e['query']);_0x2f0226[_0x702a('0x2c')]=_[_0x702a('0x2d')](_0xea74e['model'],qs[_0x702a('0x2e')](_0x1f7273[_0x702a('0x2b')]['fields']));_0x2f0226[_0x702a('0x2c')]=_0x2f0226['attributes']['length']?_0x2f0226['attributes']:_0xea74e[_0x702a('0x29')];if(_0x1f7273[_0x702a('0x2b')][_0x702a('0x3e')]){_0x2f0226['include']=[{'all':!![]}];}_0x2f0226=_[_0x702a('0x37')]({},_0x2f0226,_0x1f7273[_0x702a('0x3c')]);return db[_0x702a('0x3d')][_0x702a('0x43')](_0x2f0226)[_0x702a('0x21')](handleEntityNotFound(_0x5d8c60,null))['then'](respondWithResult(_0x5d8c60,null))[_0x702a('0x41')](handleError(_0x5d8c60,null));};exports[_0x702a('0x44')]=function(_0x51aa9b,_0xfa177a){return db[_0x702a('0x3d')][_0x702a('0x44')](_0x51aa9b[_0x702a('0x45')],{})['then'](function(_0x478a15){var _0x1b1446=_0x51aa9b[_0x702a('0x46')][_0x702a('0x47')]({'plain':!![]});if(!_0x1b1446)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b1446[_0x702a('0x48')]===_0x702a('0x46')){var _0x5438af=_0x478a15[_0x702a('0x47')]({'plain':!![]});var _0x14b785=_0x702a('0x23');return db[_0x702a('0x49')]['find']({'where':{'name':_0x14b785,'userProfileId':_0x1b1446[_0x702a('0x4a')]},'raw':!![]})[_0x702a('0x21')](function(_0x334723){if(_0x334723&&_0x334723[_0x702a('0x4b')]===0x0){return db[_0x702a('0x24')][_0x702a('0x44')]({'name':_0x5438af[_0x702a('0x26')],'resourceId':_0x5438af['id'],'type':_0x334723[_0x702a('0x26')],'sectionId':_0x334723['id']},{})[_0x702a('0x21')](function(){return _0x478a15;});}else{return _0x478a15;}})[_0x702a('0x41')](function(_0x348f2b){logger[_0x702a('0x4c')](_0x702a('0x4d'),_0x348f2b);throw _0x348f2b;});}return _0x478a15;})[_0x702a('0x21')](respondWithResult(_0xfa177a,0xc9))[_0x702a('0x41')](handleError(_0xfa177a,null));};exports[_0x702a('0x20')]=function(_0x178d85,_0x492fd1){if(_0x178d85[_0x702a('0x45')]['id']){delete _0x178d85['body']['id'];}return db[_0x702a('0x3d')][_0x702a('0x43')]({'where':{'id':_0x178d85[_0x702a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x492fd1,null))[_0x702a('0x21')](saveUpdates(_0x178d85[_0x702a('0x45')],null))[_0x702a('0x21')](respondWithResult(_0x492fd1,null))['catch'](handleError(_0x492fd1,null));};exports[_0x702a('0x22')]=function(_0x1733a7,_0x9665ba){return db[_0x702a('0x3d')]['find']({'where':{'id':_0x1733a7[_0x702a('0x4e')]['id']}})[_0x702a('0x21')](handleEntityNotFound(_0x9665ba,null))['then'](removeEntity(_0x9665ba,null))['catch'](handleError(_0x9665ba,null));};exports['addUsers']=function(_0x1d086c,_0x30bd1a,_0x7307e5){return db['SquareProject']['find']({'where':{'id':_0x1d086c[_0x702a('0x4e')]['id']}})[_0x702a('0x21')](handleEntityNotFound(_0x30bd1a,null))[_0x702a('0x21')](function(_0x10f6fd){if(_0x10f6fd){return _0x10f6fd[_0x702a('0x4f')](_0x1d086c['body'][_0x702a('0x50')],_['omit'](_0x1d086c[_0x702a('0x45')],[_0x702a('0x50'),'id'])||{});}})['then'](respondWithResult(_0x30bd1a,null))['catch'](handleError(_0x30bd1a,null));};exports['removeUsers']=function(_0x474cd1,_0x42a01c,_0x41a8e3){return db[_0x702a('0x3d')][_0x702a('0x43')]({'where':{'id':_0x474cd1[_0x702a('0x4e')]['id']}})[_0x702a('0x21')](handleEntityNotFound(_0x42a01c,null))[_0x702a('0x21')](function(_0x5b44f5){if(_0x5b44f5){return _0x5b44f5['removeUsers'](_0x474cd1[_0x702a('0x2b')]['ids'])['then'](function(){if(_[_0x702a('0x51')](_0x474cd1['query'][_0x702a('0x50')])){for(var _0x5d9a0e=0x0;_0x5d9a0e<_0x474cd1['query']['ids'][_0x702a('0x2f')];_0x5d9a0e+=0x1){socket[_0x702a('0x52')](_0x702a('0x53'),{'UserId':Number(_0x474cd1['query'][_0x702a('0x50')][_0x5d9a0e]),'SquareProjectId':Number(_0x474cd1[_0x702a('0x4e')]['id'])});}}else{socket['emit'](_0x702a('0x53'),{'UserId':Number(_0x474cd1[_0x702a('0x2b')]['ids']),'SquareProjectId':Number(_0x474cd1[_0x702a('0x4e')]['id'])});}});}})[_0x702a('0x21')](respondWithStatusCode(_0x42a01c,null))['catch'](handleError(_0x42a01c,null));};exports[_0x702a('0x54')]=function(_0x4a8185,_0x563010,_0x5731a5){var _0x13be4f={};var _0x15dcb3={};var _0x3f81e7;var _0x2272c5;return db[_0x702a('0x3d')]['findOne']({'where':{'id':_0x4a8185['params']['id']}})[_0x702a('0x21')](handleEntityNotFound(_0x563010,null))['then'](function(_0x5ed129){if(_0x5ed129){_0x3f81e7=_0x5ed129;_0x15dcb3[_0x702a('0x29')]=_[_0x702a('0x2a')](db[_0x702a('0x55')][_0x702a('0x28')]);_0x15dcb3[_0x702a('0x2b')]=_[_0x702a('0x2a')](_0x4a8185[_0x702a('0x2b')]);_0x15dcb3[_0x702a('0x34')]=_['intersection'](_0x15dcb3[_0x702a('0x29')],_0x15dcb3['query']);_0x13be4f[_0x702a('0x2c')]=_['intersection'](_0x15dcb3[_0x702a('0x29')],qs['fields'](_0x4a8185[_0x702a('0x2b')][_0x702a('0x2e')]));_0x13be4f['attributes']=_0x13be4f[_0x702a('0x2c')][_0x702a('0x2f')]?_0x13be4f['attributes']:_0x15dcb3['model'];_0x13be4f[_0x702a('0x32')]=qs['sort'](_0x4a8185[_0x702a('0x2b')][_0x702a('0x33')]);_0x13be4f[_0x702a('0x38')]=qs['filters'](_['pick'](_0x4a8185['query'],_0x15dcb3['filters']));if(_0x4a8185[_0x702a('0x2b')]['filter']){_0x13be4f['where']=_[_0x702a('0x37')](_0x13be4f[_0x702a('0x38')],{'$or':_['map'](_0x13be4f[_0x702a('0x2c')],function(_0x684edf){var _0x24898b={};_0x24898b[_0x684edf]={'$like':'%'+_0x4a8185[_0x702a('0x2b')]['filter']+'%'};return _0x24898b;})});}_0x13be4f=_[_0x702a('0x37')]({},_0x13be4f,_0x4a8185['options']);return _0x3f81e7[_0x702a('0x54')](_0x13be4f);}})[_0x702a('0x21')](function(_0x54fd9c){if(_0x54fd9c){_0x2272c5=_0x54fd9c[_0x702a('0x2f')];if(!_0x4a8185['query'][_0x702a('0x30')](_0x702a('0x31'))){_0x13be4f[_0x702a('0x1d')]=qs[_0x702a('0x1d')](_0x4a8185['query'][_0x702a('0x1d')]);_0x13be4f[_0x702a('0x1c')]=qs[_0x702a('0x1c')](_0x4a8185['query'][_0x702a('0x1c')]);}return _0x3f81e7[_0x702a('0x54')](_0x13be4f);}})[_0x702a('0x21')](function(_0xb5f755){if(_0xb5f755){return _0xb5f755?{'count':_0x2272c5,'rows':_0xb5f755}:null;}})[_0x702a('0x21')](respondWithResult(_0x563010,null))[_0x702a('0x41')](handleError(_0x563010,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 68ae155..5d8c0b1 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 _0xee6d=['exports','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x13e64b,_0x458b05){var _0x58855c=function(_0x3b6b66){while(--_0x3b6b66){_0x13e64b['push'](_0x13e64b['shift']());}};_0x58855c(++_0x458b05);}(_0xee6d,0x1d6));var _0xdee6=function(_0x5bc293,_0x120044){_0x5bc293=_0x5bc293-0x0;var _0x13a373=_0xee6d[_0x5bc293];return _0x13a373;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xdee6('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xdee6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdee6('0x2')};function emitEvent(_0x7e3ca7){return function(_0x389ab5,_0x59ed77,_0xb08950){SquareProjectEvents[_0xdee6('0x3')](_0x7e3ca7+':'+_0x389ab5['id'],_0x389ab5);SquareProjectEvents[_0xdee6('0x3')](_0x7e3ca7,_0x389ab5);_0xb08950(null);};}for(var e in events){if(events[_0xdee6('0x4')](e)){var event=events[e];SquareProject[_0xdee6('0x5')](e,emitEvent(event));}}module[_0xdee6('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x7baf=['update','emit','hasOwnProperty','exports','setMaxListeners','save'];(function(_0x1e8db2,_0xa9c7aa){var _0x247392=function(_0x54c55b){while(--_0x54c55b){_0x1e8db2['push'](_0x1e8db2['shift']());}};_0x247392(++_0xa9c7aa);}(_0x7baf,0x82));var _0xf7ba=function(_0x1cde5d,_0x575b61){_0x1cde5d=_0x1cde5d-0x0;var _0x50f9be=_0x7baf[_0x1cde5d];return _0x50f9be;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf7ba('0x0')](0x0);var events={'afterCreate':_0xf7ba('0x1'),'afterUpdate':_0xf7ba('0x2'),'afterDestroy':'remove'};function emitEvent(_0x150303){return function(_0x2744bf,_0x2d6fb5,_0x5bf732){SquareProjectEvents['emit'](_0x150303+':'+_0x2744bf['id'],_0x2744bf);SquareProjectEvents[_0xf7ba('0x3')](_0x150303,_0x2744bf);_0x5bf732(null);};}for(var e in events){if(events[_0xf7ba('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xf7ba('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 47070e4..bc720ec 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 _0xe37d=['exports','SquareProject','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x358aa5,_0x30e661){var _0x398506=function(_0x40eb42){while(--_0x40eb42){_0x358aa5['push'](_0x358aa5['shift']());}};_0x398506(++_0x30e661);}(_0xe37d,0x106));var _0xde37=function(_0x5614e8,_0x30aa3e){_0x5614e8=_0x5614e8-0x0;var _0x522ee3=_0xe37d[_0x5614e8];return _0x522ee3;};'use strict';var _=require(_0xde37('0x0'));var util=require(_0xde37('0x1'));var logger=require(_0xde37('0x2'))('api');var moment=require(_0xde37('0x3'));var BPromise=require('bluebird');var rp=require(_0xde37('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde37('0x5'));var config=require(_0xde37('0x6'));var attributes=require(_0xde37('0x7'));module[_0xde37('0x8')]=function(_0x4d2782,_0x4c7407){return _0x4d2782['define'](_0xde37('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe704=['request-promise','rimraf','../../config/environment','exports','square_projects','lodash','util','../../config/logger','api','bluebird'];(function(_0x2ada6a,_0x49cece){var _0x42b8fa=function(_0x503f4f){while(--_0x503f4f){_0x2ada6a['push'](_0x2ada6a['shift']());}};_0x42b8fa(++_0x49cece);}(_0xe704,0x145));var _0x4e70=function(_0x381b99,_0x85a907){_0x381b99=_0x381b99-0x0;var _0x4b07e8=_0xe704[_0x381b99];return _0x4b07e8;};'use strict';var _=require(_0x4e70('0x0'));var util=require(_0x4e70('0x1'));var logger=require(_0x4e70('0x2'))(_0x4e70('0x3'));var moment=require('moment');var BPromise=require(_0x4e70('0x4'));var rp=require(_0x4e70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e70('0x6'));var config=require(_0x4e70('0x7'));var attributes=require('./squareProject.attributes');module[_0x4e70('0x8')]=function(_0x45f1ef,_0x444f37){return _0x45f1ef['define']('SquareProject',attributes,{'tableName':_0x4e70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1c2a27d..2707623 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1783b0,_0x3cc23c){var _0xbc205a=function(_0x53a294){while(--_0x53a294){_0x1783b0['push'](_0x1783b0['shift']());}};_0xbc205a(++_0x3cc23c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x545f8d,_0x818a71){var _0x11929f=function(_0x1e53a6){while(--_0x1e53a6){_0x545f8d['push'](_0x545f8d['shift']());}};_0x11929f(++_0x818a71);}(_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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f09f819..1447629 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 _0x5455=['remove','update','emit','removeListener','register','length','squareProject:','save'];(function(_0x582809,_0x2ccb6c){var _0x5300b0=function(_0x4a93dc){while(--_0x4a93dc){_0x582809['push'](_0x582809['shift']());}};_0x5300b0(++_0x2ccb6c);}(_0x5455,0x197));var _0x5545=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5455[_0x2641f9];return _0x585741;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x5545('0x0'),_0x5545('0x1'),_0x5545('0x2')];function createListener(_0x414d1c,_0xba68b3){return function(_0x38b608){_0xba68b3[_0x5545('0x3')](_0x414d1c,_0x38b608);};}function removeListener(_0x4cd466,_0x48fce5){return function(){SquareProjectEvents[_0x5545('0x4')](_0x4cd466,_0x48fce5);};}exports[_0x5545('0x5')]=function(_0x5c22f1){for(var _0x5a6ac7=0x0,_0x2ea57f=events[_0x5545('0x6')];_0x5a6ac7<_0x2ea57f;_0x5a6ac7++){var _0x5c2476=events[_0x5a6ac7];var _0x9cbb0d=createListener(_0x5545('0x7')+_0x5c2476,_0x5c22f1);SquareProjectEvents['on'](_0x5c2476,_0x9cbb0d);}}; \ No newline at end of file +var _0x9a62=['remove','removeListener','register','squareProject:','save'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x9a62,0x1bc));var _0x29a6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9a62[_0x40a045];return _0x1a687c;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x29a6('0x0'),_0x29a6('0x1'),'update'];function createListener(_0x14ca27,_0x2d49a0){return function(_0x585d58){_0x2d49a0['emit'](_0x14ca27,_0x585d58);};}function removeListener(_0x19b33c,_0x29f220){return function(){SquareProjectEvents[_0x29a6('0x2')](_0x19b33c,_0x29f220);};}exports[_0x29a6('0x3')]=function(_0x1ced6f){for(var _0x19127c=0x0,_0x316d9e=events['length'];_0x19127c<_0x316d9e;_0x19127c++){var _0x5b325a=events[_0x19127c];var _0x72dde2=createListener(_0x29a6('0x4')+_0x5b325a,_0x1ced6f);SquareProjectEvents['on'](_0x5b325a,_0x72dde2);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f9396b7..a663922 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 _0xa7d8=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','create','update','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa7d8,0x94));var _0x8a7d=function(_0x595368,_0x11ef02){_0x595368=_0x595368-0x0;var _0x325015=_0xa7d8[_0x595368];return _0x325015;};'use strict';var multer=require(_0x8a7d('0x0'));var util=require('util');var path=require(_0x8a7d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a7d('0x2'));var router=express[_0x8a7d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8a7d('0x4'));var config=require(_0x8a7d('0x5'));var controller=require(_0x8a7d('0x6'));router[_0x8a7d('0x7')]('/',auth[_0x8a7d('0x8')](),controller[_0x8a7d('0x9')]);router['get'](_0x8a7d('0xa'),auth[_0x8a7d('0x8')](),controller['show']);router[_0x8a7d('0x7')]('/:id/download',auth[_0x8a7d('0x8')](),controller[_0x8a7d('0xb')]);router[_0x8a7d('0xc')]('/',auth[_0x8a7d('0x8')](),controller[_0x8a7d('0xd')]);router['put'](_0x8a7d('0xa'),auth['isAuthenticated'](),controller[_0x8a7d('0xe')]);router[_0x8a7d('0xf')](_0x8a7d('0xa'),auth[_0x8a7d('0x8')](),controller['destroy']);module[_0x8a7d('0x10')]=router; \ No newline at end of file +var _0xd765=['isAuthenticated','show','download','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareRecording.controller','get','index','/:id'];(function(_0x58c233,_0x5a38aa){var _0x5631fd=function(_0x2f5fdc){while(--_0x2f5fdc){_0x58c233['push'](_0x58c233['shift']());}};_0x5631fd(++_0x5a38aa);}(_0xd765,0xdf));var _0x5d76=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd765[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var path=require(_0x5d76('0x2'));var timeout=require(_0x5d76('0x3'));var express=require(_0x5d76('0x4'));var router=express[_0x5d76('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5d76('0x6'));var config=require('../../config/environment');var controller=require(_0x5d76('0x7'));router[_0x5d76('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d76('0x9')]);router[_0x5d76('0x8')](_0x5d76('0xa'),auth[_0x5d76('0xb')](),controller[_0x5d76('0xc')]);router[_0x5d76('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5d76('0xd')]);router[_0x5d76('0xe')]('/',auth[_0x5d76('0xb')](),controller[_0x5d76('0xf')]);router['put']('/:id',auth[_0x5d76('0xb')](),controller[_0x5d76('0x10')]);router[_0x5d76('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 0f69c1f..739a653 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 _0xd285=['exports','STRING','sequelize'];(function(_0x593baf,_0x1d8428){var _0x4787dd=function(_0x1522c9){while(--_0x1522c9){_0x593baf['push'](_0x593baf['shift']());}};_0x4787dd(++_0x1d8428);}(_0xd285,0x18b));var _0x5d28=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0xd285[_0x349148];return _0x2f2b0f;};'use strict';var Sequelize=require(_0x5d28('0x0'));module[_0x5d28('0x1')]={'uniqueid':{'type':Sequelize[_0x5d28('0x2')]},'callerid':{'type':Sequelize[_0x5d28('0x2')]},'calleridname':{'type':Sequelize[_0x5d28('0x2')]},'context':{'type':Sequelize[_0x5d28('0x2')]},'extension':{'type':Sequelize[_0x5d28('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5d28('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5d28('0x2')]},'saveName':{'type':Sequelize[_0x5d28('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5d28('0x2')]}}; \ No newline at end of file +var _0xab12=['exports','STRING','sequelize'];(function(_0x49748c,_0x3d2005){var _0xedf6b6=function(_0x11628d){while(--_0x11628d){_0x49748c['push'](_0x49748c['shift']());}};_0xedf6b6(++_0x3d2005);}(_0xab12,0x14c));var _0x2ab1=function(_0x1f6ace,_0x12f82a){_0x1f6ace=_0x1f6ace-0x0;var _0x4f8b16=_0xab12[_0x1f6ace];return _0x4f8b16;};'use strict';var Sequelize=require(_0x2ab1('0x0'));module[_0x2ab1('0x1')]={'uniqueid':{'type':Sequelize[_0x2ab1('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2ab1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2ab1('0x2')]},'priority':{'type':Sequelize[_0x2ab1('0x2')]},'accountcode':{'type':Sequelize[_0x2ab1('0x2')]},'dnid':{'type':Sequelize[_0x2ab1('0x2')]},'projectName':{'type':Sequelize[_0x2ab1('0x2')]},'saveName':{'type':Sequelize[_0x2ab1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3bad4f7..d4b020c 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 _0x37b4=['util','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','Content-Range','json','update','error','stack','name','send','index','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','then','SquareRecording','findAll','rows','show','params','rawAttributes','includeAll','include','find','create','body','catch','destroy','download','../../components/encryptor','uniqueid','savePath','filename','format','decryptFile','recording','existsSync','Sequelize','extname','message','SquareRecording\x20not\x20found','Not\x20found','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x37b4,0xef));var _0x437b=function(_0x53d0f2,_0x461fff){_0x53d0f2=_0x53d0f2-0x0;var _0x4039fe=_0x37b4[_0x53d0f2];return _0x4039fe;};'use strict';var pdf=require(_0x437b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x437b('0x1'));var zipdir=require(_0x437b('0x2'));var jsonpatch=require(_0x437b('0x3'));var rp=require('request-promise');var moment=require(_0x437b('0x4'));var BPromise=require(_0x437b('0x5'));var Mustache=require(_0x437b('0x6'));var util=require(_0x437b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x437b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x437b('0x9'));var squel=require('squel');var crypto=require(_0x437b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x437b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x437b('0xc'));var Redis=require(_0x437b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x437b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x437b('0xf'));var utils=require(_0x437b('0x10'));var config=require(_0x437b('0x11'));var db=require(_0x437b('0x12'))['db'];function respondWithStatusCode(_0x5eb5b4,_0x472b80){_0x472b80=_0x472b80||0xcc;return function(_0x36ffa7){if(_0x36ffa7){return _0x5eb5b4[_0x437b('0x13')](_0x472b80);}return _0x5eb5b4['status'](_0x472b80)[_0x437b('0x14')]();};}function respondWithResult(_0x40c6ee,_0x42bcf9){_0x42bcf9=_0x42bcf9||0xc8;return function(_0x4d72ec){if(_0x4d72ec){return _0x40c6ee[_0x437b('0x15')](_0x42bcf9)['json'](_0x4d72ec);}};}function respondWithFilteredResult(_0x368067,_0x2ddbe0){return function(_0x3cea79){if(_0x3cea79){var _0x5f328b=_0x3cea79[_0x437b('0x16')],_0x287886=_0x2ddbe0[_0x437b('0x17')],_0x159076=_0x2ddbe0[_0x437b('0x17')]+_0x2ddbe0['limit'],_0x466ace;if(_0x159076>=_0x5f328b){_0x159076=_0x5f328b;_0x466ace=0xc8;}else{_0x466ace=0xce;}_0x368067[_0x437b('0x15')](_0x466ace);return _0x368067['set'](_0x437b('0x18'),_0x287886+'-'+_0x159076+'/'+_0x5f328b)[_0x437b('0x19')](_0x3cea79);}return null;};}function patchUpdates(_0x1c91bc){return function(_0x3958df){try{jsonpatch['apply'](_0x3958df,_0x1c91bc,!![]);}catch(_0x504c9c){return BPromise['reject'](_0x504c9c);}return _0x3958df['save']();};}function saveUpdates(_0x1ea596,_0x14abab){return function(_0x4a5eac){if(_0x4a5eac){return _0x4a5eac[_0x437b('0x1a')](_0x1ea596)['then'](function(_0x434899){return _0x434899;});}return null;};}function removeEntity(_0x2f232c,_0x31418b){return function(_0x549a04){if(_0x549a04){return _0x549a04['destroy']()['then'](function(){_0x2f232c[_0x437b('0x15')](0xcc)[_0x437b('0x14')]();});}};}function handleEntityNotFound(_0x2f6d5f,_0x4440e6){return function(_0x8c5852){if(!_0x8c5852){_0x2f6d5f[_0x437b('0x13')](0x194);}return _0x8c5852;};}function handleError(_0x249a02,_0x18869f){_0x18869f=_0x18869f||0x1f4;return function(_0x25c242){logger[_0x437b('0x1b')](_0x25c242[_0x437b('0x1c')]);if(_0x25c242['name']){delete _0x25c242[_0x437b('0x1d')];}_0x249a02[_0x437b('0x15')](_0x18869f)[_0x437b('0x1e')](_0x25c242);};}exports[_0x437b('0x1f')]=function(_0x17092c,_0x586df9){var _0x14f755={},_0x2dbeb6={},_0x4a7d0b={'count':0x0,'rows':[]};var _0x70078f=db['SquareRecording']['rawAttributes'];_0x2dbeb6['model']=_[_0x437b('0x20')](_0x70078f);_0x2dbeb6['query']=_[_0x437b('0x20')](_0x17092c[_0x437b('0x21')]);_0x2dbeb6[_0x437b('0x22')]=_['intersection'](_0x2dbeb6['model'],_0x2dbeb6[_0x437b('0x21')]);_0x14f755[_0x437b('0x23')]=_[_0x437b('0x24')](_0x2dbeb6[_0x437b('0x25')],qs[_0x437b('0x26')](_0x17092c[_0x437b('0x21')][_0x437b('0x26')]));_0x14f755[_0x437b('0x23')]=_0x14f755[_0x437b('0x23')][_0x437b('0x27')]?_0x14f755[_0x437b('0x23')]:_0x2dbeb6['model'];if(!_0x17092c[_0x437b('0x21')][_0x437b('0x28')](_0x437b('0x29'))){_0x14f755['limit']=qs[_0x437b('0x2a')](_0x17092c[_0x437b('0x21')][_0x437b('0x2a')]);_0x14f755['offset']=qs[_0x437b('0x17')](_0x17092c['query'][_0x437b('0x17')]);}_0x14f755[_0x437b('0x2b')]=qs[_0x437b('0x2c')](_0x17092c[_0x437b('0x21')][_0x437b('0x2c')]);_0x14f755[_0x437b('0x2d')]=qs['filters'](_[_0x437b('0x2e')](_0x17092c[_0x437b('0x21')],_0x2dbeb6[_0x437b('0x22')]));if(_0x17092c[_0x437b('0x21')][_0x437b('0x2f')]){_0x14f755[_0x437b('0x2d')]=_[_0x437b('0x30')](_0x14f755[_0x437b('0x2d')],{'$or':_[_0x437b('0x31')](_0x70078f,function(_0x1690f7){if(_0x1690f7[_0x437b('0x32')]['key']!==_0x437b('0x33')){var _0x4e48f2={};_0x4e48f2[_0x1690f7[_0x437b('0x34')]]={'$like':'%'+_0x17092c['query']['filter']+'%'};return _0x4e48f2;}})});}_0x14f755=_[_0x437b('0x30')]({},_0x14f755,_0x17092c[_0x437b('0x35')]);var _0x3c1615={'where':_0x14f755[_0x437b('0x2d')]};return db['SquareRecording'][_0x437b('0x16')](_0x3c1615)[_0x437b('0x36')](function(_0xf81e6a){_0x4a7d0b[_0x437b('0x16')]=_0xf81e6a;if(_0x17092c['query']['includeAll']){_0x14f755['include']=[{'all':!![]}];}return db[_0x437b('0x37')][_0x437b('0x38')](_0x14f755);})[_0x437b('0x36')](function(_0x282d73){_0x4a7d0b[_0x437b('0x39')]=_0x282d73;return _0x4a7d0b;})[_0x437b('0x36')](respondWithFilteredResult(_0x586df9,_0x14f755))['catch'](handleError(_0x586df9,null));};exports[_0x437b('0x3a')]=function(_0x14fe18,_0x339de6){var _0x588efa={'raw':!![],'where':{'id':_0x14fe18[_0x437b('0x3b')]['id']}},_0x34aee7={};_0x34aee7['model']=_['keys'](db['SquareRecording'][_0x437b('0x3c')]);_0x34aee7[_0x437b('0x21')]=_['keys'](_0x14fe18['query']);_0x34aee7[_0x437b('0x22')]=_['intersection'](_0x34aee7[_0x437b('0x25')],_0x34aee7['query']);_0x588efa['attributes']=_[_0x437b('0x24')](_0x34aee7[_0x437b('0x25')],qs['fields'](_0x14fe18[_0x437b('0x21')]['fields']));_0x588efa[_0x437b('0x23')]=_0x588efa[_0x437b('0x23')]['length']?_0x588efa[_0x437b('0x23')]:_0x34aee7[_0x437b('0x25')];if(_0x14fe18['query'][_0x437b('0x3d')]){_0x588efa[_0x437b('0x3e')]=[{'all':!![]}];}_0x588efa=_[_0x437b('0x30')]({},_0x588efa,_0x14fe18[_0x437b('0x35')]);return db['SquareRecording'][_0x437b('0x3f')](_0x588efa)[_0x437b('0x36')](handleEntityNotFound(_0x339de6,null))[_0x437b('0x36')](respondWithResult(_0x339de6,null))['catch'](handleError(_0x339de6,null));};exports['create']=function(_0x457997,_0x52f6e2){return db['SquareRecording'][_0x437b('0x40')](_0x457997[_0x437b('0x41')],{})[_0x437b('0x36')](respondWithResult(_0x52f6e2,0xc9))[_0x437b('0x42')](handleError(_0x52f6e2,null));};exports[_0x437b('0x1a')]=function(_0x49b019,_0x1b5c71){if(_0x49b019[_0x437b('0x41')]['id']){delete _0x49b019[_0x437b('0x41')]['id'];}return db[_0x437b('0x37')][_0x437b('0x3f')]({'where':{'id':_0x49b019[_0x437b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1b5c71,null))['then'](saveUpdates(_0x49b019[_0x437b('0x41')],null))['then'](respondWithResult(_0x1b5c71,null))[_0x437b('0x42')](handleError(_0x1b5c71,null));};exports[_0x437b('0x43')]=function(_0x4f8f76,_0x1aa7e1){return db[_0x437b('0x37')]['find']({'where':{'id':_0x4f8f76[_0x437b('0x3b')]['id']}})[_0x437b('0x36')](handleEntityNotFound(_0x1aa7e1,null))[_0x437b('0x36')](removeEntity(_0x1aa7e1,null))[_0x437b('0x42')](handleError(_0x1aa7e1,null));};exports[_0x437b('0x44')]=function(_0x484827,_0x22abaa,_0xd832ec){var _0x5c0cbe=require(_0x437b('0x45'));var _0x2b5d80=![];var _0x4a6153={};if(_0x484827['query'][_0x437b('0x32')]&&_0x484827[_0x437b('0x21')][_0x437b('0x32')]===_0x437b('0x46')){_0x4a6153['uniqueid']=_0x484827[_0x437b('0x3b')]['id'];}else{_0x4a6153['id']=_0x484827[_0x437b('0x3b')]['id'];}return db[_0x437b('0x37')][_0x437b('0x3f')]({'where':_0x4a6153,'attributes':['id',_0x437b('0x47'),_0x437b('0x48')],'raw':!![]})[_0x437b('0x36')](handleEntityNotFound(_0x22abaa,null))['then'](function(_0x361bde){if(_0x361bde){var _0x1aea4a=_0x361bde['savePath'];var _0x3b93bc=util[_0x437b('0x49')]('%s.cypher',_0x1aea4a);if(fs['existsSync'](_0x3b93bc)){_0x2b5d80=!![];return _0x5c0cbe[_0x437b('0x4a')](_0x3b93bc,_0x1aea4a,config['secrets'][_0x437b('0x4b')])['then'](function(){return _0x361bde;});}return _0x361bde;}})['then'](function(_0x49652e){if(_0x49652e){var _0x10b7d4=_0x49652e[_0x437b('0x47')];if(!fs[_0x437b('0x4c')](_0x10b7d4)){throw new db[(_0x437b('0x4d'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x49652e[_0x437b('0x48')]){return _0x22abaa['download'](_0x10b7d4,_0x49652e[_0x437b('0x48')]+path[_0x437b('0x4e')](_0x10b7d4),function(){if(_0x2b5d80){fs['unlink'](_0x10b7d4);}});}else{return _0x22abaa['download'](_0x10b7d4,function(_0x138b41){if(_0x2b5d80){fs['unlink'](_0x10b7d4);}});}}})[_0x437b('0x42')](function(_0x3b065e){if(_0x3b065e[_0x437b('0x4f')]===_0x437b('0x50')){_0x22abaa[_0x437b('0x15')](0x194)[_0x437b('0x1e')](_0x437b('0x51'));}else{return handleError(_0x22abaa,null);}});}; \ No newline at end of file +var _0xc817=['map','type','field','SquareRecording','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x510299,_0xa7d236){var _0x463422=function(_0x3aec77){while(--_0x3aec77){_0x510299['push'](_0x510299['shift']());}};_0x463422(++_0xa7d236);}(_0xc817,0x75));var _0x7c81=function(_0x5b3cfc,_0x2f441a){_0x5b3cfc=_0x5b3cfc-0x0;var _0x262928=_0xc817[_0x5b3cfc];return _0x262928;};'use strict';var pdf=require(_0x7c81('0x0'));var emlformat=require(_0x7c81('0x1'));var rimraf=require(_0x7c81('0x2'));var zipdir=require(_0x7c81('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c81('0x4'));var moment=require(_0x7c81('0x5'));var BPromise=require(_0x7c81('0x6'));var Mustache=require(_0x7c81('0x7'));var util=require(_0x7c81('0x8'));var path=require(_0x7c81('0x9'));var sox=require('sox');var csv=require(_0x7c81('0xa'));var ejs=require(_0x7c81('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c81('0xc'));var crypto=require(_0x7c81('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c81('0xe'));var toCsv=require(_0x7c81('0xa'));var querystring=require(_0x7c81('0xf'));var Papa=require(_0x7c81('0x10'));var Redis=require(_0x7c81('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7c81('0x12'));var hardwareService=require(_0x7c81('0x13'));var logger=require(_0x7c81('0x14'))(_0x7c81('0x15'));var utils=require(_0x7c81('0x16'));var config=require(_0x7c81('0x17'));var db=require(_0x7c81('0x18'))['db'];function respondWithStatusCode(_0x17f3ad,_0x1d13ee){_0x1d13ee=_0x1d13ee||0xcc;return function(_0x1f7771){if(_0x1f7771){return _0x17f3ad[_0x7c81('0x19')](_0x1d13ee);}return _0x17f3ad[_0x7c81('0x1a')](_0x1d13ee)[_0x7c81('0x1b')]();};}function respondWithResult(_0x236395,_0x2c4434){_0x2c4434=_0x2c4434||0xc8;return function(_0xebb73){if(_0xebb73){return _0x236395[_0x7c81('0x1a')](_0x2c4434)[_0x7c81('0x1c')](_0xebb73);}};}function respondWithFilteredResult(_0xbf32dd,_0x5ed7d7){return function(_0x439b1c){if(_0x439b1c){var _0x18aefa=_0x439b1c[_0x7c81('0x1d')],_0x2f3de2=_0x5ed7d7[_0x7c81('0x1e')],_0x1021f8=_0x5ed7d7[_0x7c81('0x1e')]+_0x5ed7d7[_0x7c81('0x1f')],_0x3b36c9;if(_0x1021f8>=_0x18aefa){_0x1021f8=_0x18aefa;_0x3b36c9=0xc8;}else{_0x3b36c9=0xce;}_0xbf32dd['status'](_0x3b36c9);return _0xbf32dd[_0x7c81('0x20')](_0x7c81('0x21'),_0x2f3de2+'-'+_0x1021f8+'/'+_0x18aefa)[_0x7c81('0x1c')](_0x439b1c);}return null;};}function patchUpdates(_0x182a2e){return function(_0x5d1aa5){try{jsonpatch[_0x7c81('0x22')](_0x5d1aa5,_0x182a2e,!![]);}catch(_0x2e2b44){return BPromise[_0x7c81('0x23')](_0x2e2b44);}return _0x5d1aa5[_0x7c81('0x24')]();};}function saveUpdates(_0xe8ede1,_0x49cde6){return function(_0x679b81){if(_0x679b81){return _0x679b81[_0x7c81('0x25')](_0xe8ede1)[_0x7c81('0x26')](function(_0x35761d){return _0x35761d;});}return null;};}function removeEntity(_0xed8e33,_0x5f554c){return function(_0x887753){if(_0x887753){return _0x887753[_0x7c81('0x27')]()[_0x7c81('0x26')](function(){_0xed8e33[_0x7c81('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bdca5,_0x53bdb2){return function(_0x4ecf3b){if(!_0x4ecf3b){_0x3bdca5['sendStatus'](0x194);}return _0x4ecf3b;};}function handleError(_0x38092c,_0x4d64f6){_0x4d64f6=_0x4d64f6||0x1f4;return function(_0x4a01fb){logger['error'](_0x4a01fb[_0x7c81('0x28')]);if(_0x4a01fb['name']){delete _0x4a01fb[_0x7c81('0x29')];}_0x38092c[_0x7c81('0x1a')](_0x4d64f6)[_0x7c81('0x2a')](_0x4a01fb);};}exports['index']=function(_0xaedec,_0x150e6d){var _0x39d36d={},_0x26e2bc={},_0x1645bf={'count':0x0,'rows':[]};var _0x4131b6=db['SquareRecording'][_0x7c81('0x2b')];_0x26e2bc['model']=_[_0x7c81('0x2c')](_0x4131b6);_0x26e2bc['query']=_[_0x7c81('0x2c')](_0xaedec[_0x7c81('0x2d')]);_0x26e2bc[_0x7c81('0x2e')]=_['intersection'](_0x26e2bc[_0x7c81('0x2f')],_0x26e2bc[_0x7c81('0x2d')]);_0x39d36d['attributes']=_[_0x7c81('0x30')](_0x26e2bc['model'],qs['fields'](_0xaedec[_0x7c81('0x2d')][_0x7c81('0x31')]));_0x39d36d[_0x7c81('0x32')]=_0x39d36d[_0x7c81('0x32')][_0x7c81('0x33')]?_0x39d36d[_0x7c81('0x32')]:_0x26e2bc[_0x7c81('0x2f')];if(!_0xaedec[_0x7c81('0x2d')]['hasOwnProperty'](_0x7c81('0x34'))){_0x39d36d[_0x7c81('0x1f')]=qs['limit'](_0xaedec[_0x7c81('0x2d')][_0x7c81('0x1f')]);_0x39d36d[_0x7c81('0x1e')]=qs['offset'](_0xaedec[_0x7c81('0x2d')][_0x7c81('0x1e')]);}_0x39d36d[_0x7c81('0x35')]=qs[_0x7c81('0x36')](_0xaedec[_0x7c81('0x2d')][_0x7c81('0x36')]);_0x39d36d[_0x7c81('0x37')]=qs[_0x7c81('0x2e')](_[_0x7c81('0x38')](_0xaedec[_0x7c81('0x2d')],_0x26e2bc[_0x7c81('0x2e')]));if(_0xaedec[_0x7c81('0x2d')][_0x7c81('0x39')]){_0x39d36d['where']=_[_0x7c81('0x3a')](_0x39d36d[_0x7c81('0x37')],{'$or':_[_0x7c81('0x3b')](_0x4131b6,function(_0x30e121){if(_0x30e121[_0x7c81('0x3c')]['key']!=='VIRTUAL'){var _0x1a175b={};_0x1a175b[_0x30e121[_0x7c81('0x3d')]]={'$like':'%'+_0xaedec[_0x7c81('0x2d')][_0x7c81('0x39')]+'%'};return _0x1a175b;}})});}_0x39d36d=_[_0x7c81('0x3a')]({},_0x39d36d,_0xaedec['options']);var _0x816e41={'where':_0x39d36d[_0x7c81('0x37')]};return db[_0x7c81('0x3e')]['count'](_0x816e41)[_0x7c81('0x26')](function(_0x3f9b7d){_0x1645bf[_0x7c81('0x1d')]=_0x3f9b7d;if(_0xaedec['query'][_0x7c81('0x3f')]){_0x39d36d[_0x7c81('0x40')]=[{'all':!![]}];}return db['SquareRecording'][_0x7c81('0x41')](_0x39d36d);})[_0x7c81('0x26')](function(_0x157cb8){_0x1645bf[_0x7c81('0x42')]=_0x157cb8;return _0x1645bf;})['then'](respondWithFilteredResult(_0x150e6d,_0x39d36d))[_0x7c81('0x43')](handleError(_0x150e6d,null));};exports[_0x7c81('0x44')]=function(_0x5911cd,_0x1a10ee){var _0x2cd932={'raw':!![],'where':{'id':_0x5911cd['params']['id']}},_0x415c30={};_0x415c30['model']=_[_0x7c81('0x2c')](db['SquareRecording'][_0x7c81('0x2b')]);_0x415c30[_0x7c81('0x2d')]=_[_0x7c81('0x2c')](_0x5911cd[_0x7c81('0x2d')]);_0x415c30['filters']=_[_0x7c81('0x30')](_0x415c30[_0x7c81('0x2f')],_0x415c30[_0x7c81('0x2d')]);_0x2cd932[_0x7c81('0x32')]=_[_0x7c81('0x30')](_0x415c30['model'],qs[_0x7c81('0x31')](_0x5911cd[_0x7c81('0x2d')][_0x7c81('0x31')]));_0x2cd932[_0x7c81('0x32')]=_0x2cd932[_0x7c81('0x32')]['length']?_0x2cd932[_0x7c81('0x32')]:_0x415c30[_0x7c81('0x2f')];if(_0x5911cd[_0x7c81('0x2d')]['includeAll']){_0x2cd932[_0x7c81('0x40')]=[{'all':!![]}];}_0x2cd932=_[_0x7c81('0x3a')]({},_0x2cd932,_0x5911cd['options']);return db['SquareRecording'][_0x7c81('0x45')](_0x2cd932)[_0x7c81('0x26')](handleEntityNotFound(_0x1a10ee,null))[_0x7c81('0x26')](respondWithResult(_0x1a10ee,null))[_0x7c81('0x43')](handleError(_0x1a10ee,null));};exports[_0x7c81('0x46')]=function(_0x372119,_0x10e54b){return db['SquareRecording'][_0x7c81('0x46')](_0x372119['body'],{})[_0x7c81('0x26')](respondWithResult(_0x10e54b,0xc9))[_0x7c81('0x43')](handleError(_0x10e54b,null));};exports[_0x7c81('0x25')]=function(_0x3a1c4b,_0x78421d){if(_0x3a1c4b[_0x7c81('0x47')]['id']){delete _0x3a1c4b[_0x7c81('0x47')]['id'];}return db[_0x7c81('0x3e')][_0x7c81('0x45')]({'where':{'id':_0x3a1c4b[_0x7c81('0x48')]['id']}})[_0x7c81('0x26')](handleEntityNotFound(_0x78421d,null))[_0x7c81('0x26')](saveUpdates(_0x3a1c4b[_0x7c81('0x47')],null))[_0x7c81('0x26')](respondWithResult(_0x78421d,null))[_0x7c81('0x43')](handleError(_0x78421d,null));};exports[_0x7c81('0x27')]=function(_0x4b47a2,_0xeb1033){return db['SquareRecording'][_0x7c81('0x45')]({'where':{'id':_0x4b47a2[_0x7c81('0x48')]['id']}})[_0x7c81('0x26')](handleEntityNotFound(_0xeb1033,null))['then'](removeEntity(_0xeb1033,null))['catch'](handleError(_0xeb1033,null));};exports[_0x7c81('0x49')]=function(_0x5b3131,_0x2c2684,_0x215272){var _0x29198c=require(_0x7c81('0x4a'));var _0x208166=![];var _0x14cd68={};if(_0x5b3131[_0x7c81('0x2d')]['type']&&_0x5b3131[_0x7c81('0x2d')][_0x7c81('0x3c')]==='uniqueid'){_0x14cd68[_0x7c81('0x4b')]=_0x5b3131['params']['id'];}else{_0x14cd68['id']=_0x5b3131['params']['id'];}return db[_0x7c81('0x3e')][_0x7c81('0x45')]({'where':_0x14cd68,'attributes':['id',_0x7c81('0x4c'),_0x7c81('0x4d')],'raw':!![]})[_0x7c81('0x26')](handleEntityNotFound(_0x2c2684,null))['then'](function(_0x463cee){if(_0x463cee){var _0x54d0c7=_0x463cee[_0x7c81('0x4c')];var _0x44bda1=util[_0x7c81('0x4e')](_0x7c81('0x4f'),_0x54d0c7);if(fs[_0x7c81('0x50')](_0x44bda1)){_0x208166=!![];return _0x29198c['decryptFile'](_0x44bda1,_0x54d0c7,config['secrets'][_0x7c81('0x51')])[_0x7c81('0x26')](function(){return _0x463cee;});}return _0x463cee;}})[_0x7c81('0x26')](function(_0x47a6fd){if(_0x47a6fd){var _0x3bee32=_0x47a6fd['savePath'];if(!fs[_0x7c81('0x50')](_0x3bee32)){throw new db['Sequelize'][(_0x7c81('0x52'))](_0x7c81('0x53'));}if(_0x47a6fd['filename']){return _0x2c2684[_0x7c81('0x49')](_0x3bee32,_0x47a6fd['filename']+path[_0x7c81('0x54')](_0x3bee32),function(){if(_0x208166){fs[_0x7c81('0x55')](_0x3bee32);}});}else{return _0x2c2684[_0x7c81('0x49')](_0x3bee32,function(_0xfdf887){if(_0x208166){fs[_0x7c81('0x55')](_0x3bee32);}});}}})[_0x7c81('0x43')](function(_0x53f034){if(_0x53f034[_0x7c81('0x56')]===_0x7c81('0x53')){_0x2c2684[_0x7c81('0x1a')](0x194)['send'](_0x7c81('0x57'));}else{return handleError(_0x2c2684,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 3bb5725..f3b292d 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 _0x1b1b=['path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10e4c1,_0x273149){var _0x2c074b=function(_0x7fff7d){while(--_0x7fff7d){_0x10e4c1['push'](_0x10e4c1['shift']());}};_0x2c074b(++_0x273149);}(_0x1b1b,0x180));var _0xb1b1=function(_0x289874,_0x1b6752){_0x289874=_0x289874-0x0;var _0x2f8bbb=_0x1b1b[_0x289874];return _0x2f8bbb;};'use strict';var _=require(_0xb1b1('0x0'));var util=require(_0xb1b1('0x1'));var logger=require(_0xb1b1('0x2'))(_0xb1b1('0x3'));var moment=require(_0xb1b1('0x4'));var BPromise=require(_0xb1b1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1b1('0x6'));var rimraf=require('rimraf');var config=require(_0xb1b1('0x7'));var attributes=require(_0xb1b1('0x8'));module[_0xb1b1('0x9')]=function(_0x4064d9,_0xe5e50b){return _0x4064d9[_0xb1b1('0xa')](_0xb1b1('0xb'),attributes,{'tableName':_0xb1b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39a1=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x442646,_0x5d2f4c){var _0x15c28b=function(_0x1ed6d3){while(--_0x1ed6d3){_0x442646['push'](_0x442646['shift']());}};_0x15c28b(++_0x5d2f4c);}(_0x39a1,0x14d));var _0x139a=function(_0x2b6d38,_0x42b3cd){_0x2b6d38=_0x2b6d38-0x0;var _0x4342bb=_0x39a1[_0x2b6d38];return _0x4342bb;};'use strict';var _=require('lodash');var util=require(_0x139a('0x0'));var logger=require(_0x139a('0x1'))('api');var moment=require(_0x139a('0x2'));var BPromise=require(_0x139a('0x3'));var rp=require(_0x139a('0x4'));var fs=require('fs');var path=require(_0x139a('0x5'));var rimraf=require(_0x139a('0x6'));var config=require(_0x139a('0x7'));var attributes=require(_0x139a('0x8'));module[_0x139a('0x9')]=function(_0x400c63,_0x2e67fe){return _0x400c63[_0x139a('0xa')](_0x139a('0xb'),attributes,{'tableName':_0x139a('0xc'),'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 b5989b0..230d4b6 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 _0x0d34=['jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x2cdb23,_0x51e932){var _0x2bc82a=function(_0x3a3439){while(--_0x3a3439){_0x2cdb23['push'](_0x2cdb23['shift']());}};_0x2bc82a(++_0x51e932);}(_0x0d34,0x13d));var _0x40d3=function(_0x34c775,_0x5e3806){_0x34c775=_0x34c775-0x0;var _0x31b59c=_0x0d34[_0x34c775];return _0x31b59c;};'use strict';var _=require(_0x40d3('0x0'));var util=require(_0x40d3('0x1'));var moment=require(_0x40d3('0x2'));var BPromise=require(_0x40d3('0x3'));var rs=require(_0x40d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x40d3('0x6'));var config=require('../../config/environment');var jayson=require(_0x40d3('0x7'));var client=jayson[_0x40d3('0x8')][_0x40d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x234bdd,_0x313afd,_0x50eee8){return new BPromise(function(_0x480085,_0x397ac7){return client[_0x40d3('0xa')](_0x234bdd,_0x50eee8)[_0x40d3('0xb')](function(_0x3a9965){logger[_0x40d3('0xc')](_0x40d3('0xd'),_0x313afd,_0x40d3('0xe'));logger[_0x40d3('0xf')](_0x40d3('0x10'),_0x313afd,_0x40d3('0xe'),JSON[_0x40d3('0x11')](_0x3a9965));if(_0x3a9965[_0x40d3('0x12')]){if(_0x3a9965[_0x40d3('0x12')][_0x40d3('0x13')]===0x1f4){logger[_0x40d3('0x12')](_0x40d3('0xd'),_0x313afd,_0x3a9965[_0x40d3('0x12')]['message']);return _0x397ac7(_0x3a9965[_0x40d3('0x12')][_0x40d3('0x14')]);}logger['error'](_0x40d3('0xd'),_0x313afd,_0x3a9965['error'][_0x40d3('0x14')]);return _0x480085(_0x3a9965[_0x40d3('0x12')]['message']);}else{logger[_0x40d3('0xc')](_0x40d3('0xd'),_0x313afd,_0x40d3('0xe'));_0x480085(_0x3a9965['result']['message']);}})[_0x40d3('0x15')](function(_0x12972d){logger[_0x40d3('0x12')]('SquareRecording,\x20%s,\x20%s',_0x313afd,_0x12972d);_0x397ac7(_0x12972d);});});}exports[_0x40d3('0x16')]=function(_0x49ec0f){var _0x3ace41=this;return new Promise(function(_0x12cc65,_0x4d5f99){return db[_0x40d3('0x17')][_0x40d3('0x18')](_0x49ec0f['body'],{'raw':_0x49ec0f[_0x40d3('0x19')]?_0x49ec0f[_0x40d3('0x19')][_0x40d3('0x1a')]===undefined?!![]:![]:!![]})[_0x40d3('0xb')](function(_0x2c827d){logger['info'](_0x40d3('0x16'),_0x49ec0f);logger['debug'](_0x40d3('0x16'),_0x49ec0f,JSON['stringify'](_0x2c827d));_0x12cc65(_0x2c827d);})[_0x40d3('0x15')](function(_0x21d4bf){logger[_0x40d3('0x12')](_0x40d3('0x16'),_0x21d4bf[_0x40d3('0x14')],_0x49ec0f);_0x4d5f99(_0x3ace41[_0x40d3('0x12')](0x1f4,_0x21d4bf[_0x40d3('0x14')]));});});}; \ No newline at end of file +var _0x09d3=['message','info','SquareRecording','create','body','options','raw','debug','CreateSquareRecording','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x09d3,0x176));var _0x309d=function(_0x438ff1,_0x1d84fa){_0x438ff1=_0x438ff1-0x0;var _0x1302fd=_0x09d3[_0x438ff1];return _0x1302fd;};'use strict';var _=require(_0x309d('0x0'));var util=require('util');var moment=require(_0x309d('0x1'));var BPromise=require(_0x309d('0x2'));var rs=require(_0x309d('0x3'));var fs=require('fs');var Redis=require(_0x309d('0x4'));var db=require(_0x309d('0x5'))['db'];var utils=require(_0x309d('0x6'));var logger=require(_0x309d('0x7'))(_0x309d('0x8'));var config=require(_0x309d('0x9'));var jayson=require(_0x309d('0xa'));var client=jayson['client'][_0x309d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c03b,_0x527892,_0x130aa3){return new BPromise(function(_0x5c03a3,_0x27c1af){return client['request'](_0x44c03b,_0x130aa3)[_0x309d('0xc')](function(_0x581660){logger['info'](_0x309d('0xd'),_0x527892,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x527892,_0x309d('0xe'),JSON[_0x309d('0xf')](_0x581660));if(_0x581660[_0x309d('0x10')]){if(_0x581660['error'][_0x309d('0x11')]===0x1f4){logger[_0x309d('0x10')](_0x309d('0xd'),_0x527892,_0x581660[_0x309d('0x10')][_0x309d('0x12')]);return _0x27c1af(_0x581660['error'][_0x309d('0x12')]);}logger['error'](_0x309d('0xd'),_0x527892,_0x581660[_0x309d('0x10')]['message']);return _0x5c03a3(_0x581660[_0x309d('0x10')][_0x309d('0x12')]);}else{logger[_0x309d('0x13')](_0x309d('0xd'),_0x527892,'request\x20sent');_0x5c03a3(_0x581660['result'][_0x309d('0x12')]);}})['catch'](function(_0x3d3000){logger[_0x309d('0x10')]('SquareRecording,\x20%s,\x20%s',_0x527892,_0x3d3000);_0x27c1af(_0x3d3000);});});}exports['CreateSquareRecording']=function(_0x18254e){var _0x5225cb=this;return new Promise(function(_0x4fcd9b,_0x4dba43){return db[_0x309d('0x14')][_0x309d('0x15')](_0x18254e[_0x309d('0x16')],{'raw':_0x18254e[_0x309d('0x17')]?_0x18254e[_0x309d('0x17')][_0x309d('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x441a52){logger['info']('CreateSquareRecording',_0x18254e);logger[_0x309d('0x19')](_0x309d('0x1a'),_0x18254e,JSON[_0x309d('0xf')](_0x441a52));_0x4fcd9b(_0x441a52);})[_0x309d('0x1b')](function(_0x15dc95){logger[_0x309d('0x10')](_0x309d('0x1a'),_0x15dc95['message'],_0x18254e);_0x4dba43(_0x5225cb[_0x309d('0x10')](0x1f4,_0x15dc95[_0x309d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 67b0a17..b565eb5 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 _0x5498=['describe','/:id','show','post','create','update','delete','exports','multer','util','express','Router','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','/describe'];(function(_0xa9438f,_0x1fa056){var _0x3fb0e5=function(_0x152e40){while(--_0x152e40){_0xa9438f['push'](_0xa9438f['shift']());}};_0x3fb0e5(++_0x1fa056);}(_0x5498,0x98));var _0x8549=function(_0x2470fe,_0x412eec){_0x2470fe=_0x2470fe-0x0;var _0x3c933b=_0x5498[_0x2470fe];return _0x3c933b;};'use strict';var multer=require(_0x8549('0x0'));var util=require(_0x8549('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8549('0x2'));var router=express[_0x8549('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8549('0x4'));var config=require('../../config/environment');var controller=require(_0x8549('0x5'));router[_0x8549('0x6')]('/',auth[_0x8549('0x7')](),controller[_0x8549('0x8')]);router['get'](_0x8549('0x9'),auth[_0x8549('0x7')](),controller[_0x8549('0xa')]);router['get'](_0x8549('0xb'),auth[_0x8549('0x7')](),controller[_0x8549('0xc')]);router[_0x8549('0xd')]('/',auth[_0x8549('0x7')](),controller[_0x8549('0xe')]);router['put'](_0x8549('0xb'),auth[_0x8549('0x7')](),controller[_0x8549('0xf')]);router[_0x8549('0x10')](_0x8549('0xb'),auth[_0x8549('0x7')](),controller['destroy']);module[_0x8549('0x11')]=router; \ No newline at end of file +var _0xce59=['post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xce59,0x1aa));var _0x9ce5=function(_0x3c0edc,_0x4ba422){_0x3c0edc=_0x3c0edc-0x0;var _0x1fa59d=_0xce59[_0x3c0edc];return _0x1fa59d;};'use strict';var multer=require(_0x9ce5('0x0'));var util=require('util');var path=require(_0x9ce5('0x1'));var timeout=require(_0x9ce5('0x2'));var express=require(_0x9ce5('0x3'));var router=express[_0x9ce5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9ce5('0x5'));var config=require(_0x9ce5('0x6'));var controller=require(_0x9ce5('0x7'));router[_0x9ce5('0x8')]('/',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0xa')]);router[_0x9ce5('0x8')](_0x9ce5('0xb'),auth[_0x9ce5('0x9')](),controller[_0x9ce5('0xc')]);router[_0x9ce5('0x8')](_0x9ce5('0xd'),auth['isAuthenticated'](),controller[_0x9ce5('0xe')]);router[_0x9ce5('0xf')]('/',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0x10')]);router[_0x9ce5('0x11')](_0x9ce5('0xd'),auth['isAuthenticated'](),controller[_0x9ce5('0x12')]);router[_0x9ce5('0x13')](_0x9ce5('0xd'),auth[_0x9ce5('0x9')](),controller[_0x9ce5('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a1f2f65..fb8d676 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 _0xa739=['DATE','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa739,0x1e1));var _0x9a73=function(_0x5787c2,_0x4b561d){_0x5787c2=_0x5787c2-0x0;var _0x4d7724=_0xa739[_0x5787c2];return _0x4d7724;};'use strict';var Sequelize=require('sequelize');module[_0x9a73('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x9a73('0x1')]},'request':{'type':Sequelize[_0x9a73('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9a73('0x1')]},'type':{'type':Sequelize[_0x9a73('0x1')]},'uniqueid':{'type':Sequelize[_0x9a73('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9a73('0x1')]},'calleridname':{'type':Sequelize[_0x9a73('0x1')]},'callingpres':{'type':Sequelize[_0x9a73('0x1')]},'callingani2':{'type':Sequelize[_0x9a73('0x1')]},'callington':{'type':Sequelize[_0x9a73('0x1')]},'callingtns':{'type':Sequelize[_0x9a73('0x1')]},'dnid':{'type':Sequelize[_0x9a73('0x1')]},'rdnis':{'type':Sequelize[_0x9a73('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9a73('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x9a73('0x1')]},'accountcode':{'type':Sequelize[_0x9a73('0x1')]},'threadid':{'type':Sequelize[_0x9a73('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9a73('0x2')]},'leaveAt':{'type':Sequelize[_0x9a73('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe799=['STRING','DATE','sequelize'];(function(_0x4de1c3,_0xbe77b9){var _0x26acfe=function(_0x2c9df4){while(--_0x2c9df4){_0x4de1c3['push'](_0x4de1c3['shift']());}};_0x26acfe(++_0xbe77b9);}(_0xe799,0x170));var _0x9e79=function(_0x3c09b9,_0x467b3c){_0x3c09b9=_0x3c09b9-0x0;var _0x4d2673=_0xe799[_0x3c09b9];return _0x4d2673;};'use strict';var Sequelize=require(_0x9e79('0x0'));module['exports']={'network':{'type':Sequelize[_0x9e79('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x9e79('0x1')]},'channel':{'type':Sequelize[_0x9e79('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9e79('0x1')]},'uniqueid':{'type':Sequelize[_0x9e79('0x1')]},'version':{'type':Sequelize[_0x9e79('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9e79('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x9e79('0x1')]},'callington':{'type':Sequelize[_0x9e79('0x1')]},'callingtns':{'type':Sequelize[_0x9e79('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x9e79('0x1')]},'context':{'type':Sequelize[_0x9e79('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9e79('0x1')]},'enhanced':{'type':Sequelize[_0x9e79('0x1')]},'accountcode':{'type':Sequelize[_0x9e79('0x1')]},'threadid':{'type':Sequelize[_0x9e79('0x1')]},'project_name':{'type':Sequelize[_0x9e79('0x1')]},'joinAt':{'type':Sequelize[_0x9e79('0x2')]},'leaveAt':{'type':Sequelize[_0x9e79('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 418ab31..7d2bf10 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 _0x0055=['merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','index','SquareReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','limit','order','sort','where'];(function(_0x4093c0,_0x1d3754){var _0x3668c9=function(_0x3f6ce5){while(--_0x3f6ce5){_0x4093c0['push'](_0x4093c0['shift']());}};_0x3668c9(++_0x1d3754);}(_0x0055,0x16b));var _0x5005=function(_0x347372,_0x40590c){_0x347372=_0x347372-0x0;var _0x2f365c=_0x0055[_0x347372];return _0x2f365c;};'use strict';var pdf=require(_0x5005('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5005('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5005('0x2'));var moment=require(_0x5005('0x3'));var BPromise=require(_0x5005('0x4'));var Mustache=require('mustache');var util=require(_0x5005('0x5'));var path=require(_0x5005('0x6'));var sox=require(_0x5005('0x7'));var csv=require('to-csv');var ejs=require(_0x5005('0x8'));var fs=require('fs');var _=require(_0x5005('0x9'));var squel=require(_0x5005('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5005('0xb'));var toCsv=require(_0x5005('0xc'));var querystring=require(_0x5005('0xd'));var Papa=require('papaparse');var Redis=require(_0x5005('0xe'));var authService=require(_0x5005('0xf'));var qs=require(_0x5005('0x10'));var hardwareService=require(_0x5005('0x11'));var logger=require('../../config/logger')(_0x5005('0x12'));var utils=require('../../config/utils');var config=require(_0x5005('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db009,_0x5a9b9f){_0x5a9b9f=_0x5a9b9f||0xcc;return function(_0x36c444){if(_0x36c444){return _0x4db009['sendStatus'](_0x5a9b9f);}return _0x4db009[_0x5005('0x14')](_0x5a9b9f)[_0x5005('0x15')]();};}function respondWithResult(_0x5177d8,_0x422dfc){_0x422dfc=_0x422dfc||0xc8;return function(_0x412abf){if(_0x412abf){return _0x5177d8['status'](_0x422dfc)['json'](_0x412abf);}};}function respondWithFilteredResult(_0x1d9268,_0x98c5fb){return function(_0x3848f8){if(_0x3848f8){var _0x2cb683=_0x3848f8[_0x5005('0x16')],_0x341db6=_0x98c5fb[_0x5005('0x17')],_0x331436=_0x98c5fb[_0x5005('0x17')]+_0x98c5fb['limit'],_0x5f4651;if(_0x331436>=_0x2cb683){_0x331436=_0x2cb683;_0x5f4651=0xc8;}else{_0x5f4651=0xce;}_0x1d9268[_0x5005('0x14')](_0x5f4651);return _0x1d9268[_0x5005('0x18')](_0x5005('0x19'),_0x341db6+'-'+_0x331436+'/'+_0x2cb683)[_0x5005('0x1a')](_0x3848f8);}return null;};}function patchUpdates(_0x5891d0){return function(_0x59ee79){try{jsonpatch[_0x5005('0x1b')](_0x59ee79,_0x5891d0,!![]);}catch(_0x209d97){return BPromise[_0x5005('0x1c')](_0x209d97);}return _0x59ee79[_0x5005('0x1d')]();};}function saveUpdates(_0x4272c9,_0x2303ce){return function(_0x4de397){if(_0x4de397){return _0x4de397[_0x5005('0x1e')](_0x4272c9)[_0x5005('0x1f')](function(_0x375bda){return _0x375bda;});}return null;};}function removeEntity(_0x264e6f,_0x144bc9){return function(_0x3d2dc2){if(_0x3d2dc2){return _0x3d2dc2['destroy']()[_0x5005('0x1f')](function(){_0x264e6f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af54b,_0x4ad201){return function(_0x3d7fde){if(!_0x3d7fde){_0x3af54b[_0x5005('0x20')](0x194);}return _0x3d7fde;};}function handleError(_0x3fb282,_0x241018){_0x241018=_0x241018||0x1f4;return function(_0x597454){logger[_0x5005('0x21')](_0x597454[_0x5005('0x22')]);if(_0x597454[_0x5005('0x23')]){delete _0x597454[_0x5005('0x23')];}_0x3fb282[_0x5005('0x14')](_0x241018)['send'](_0x597454);};}exports[_0x5005('0x24')]=function(_0x20f886,_0x919995){var _0x245da1={},_0x112f57={},_0x3a00ce={'count':0x0,'rows':[]};var _0x361dfe=db[_0x5005('0x25')][_0x5005('0x26')];_0x112f57[_0x5005('0x27')]=_[_0x5005('0x28')](_0x361dfe);_0x112f57['query']=_[_0x5005('0x28')](_0x20f886[_0x5005('0x29')]);_0x112f57[_0x5005('0x2a')]=_['intersection'](_0x112f57[_0x5005('0x27')],_0x112f57[_0x5005('0x29')]);_0x245da1[_0x5005('0x2b')]=_[_0x5005('0x2c')](_0x112f57[_0x5005('0x27')],qs[_0x5005('0x2d')](_0x20f886['query']['fields']));_0x245da1['attributes']=_0x245da1[_0x5005('0x2b')][_0x5005('0x2e')]?_0x245da1[_0x5005('0x2b')]:_0x112f57[_0x5005('0x27')];if(!_0x20f886[_0x5005('0x29')]['hasOwnProperty']('nolimit')){_0x245da1[_0x5005('0x2f')]=qs[_0x5005('0x2f')](_0x20f886['query'][_0x5005('0x2f')]);_0x245da1[_0x5005('0x17')]=qs[_0x5005('0x17')](_0x20f886[_0x5005('0x29')]['offset']);}_0x245da1[_0x5005('0x30')]=qs[_0x5005('0x31')](_0x20f886[_0x5005('0x29')][_0x5005('0x31')]);_0x245da1[_0x5005('0x32')]=qs[_0x5005('0x2a')](_['pick'](_0x20f886['query'],_0x112f57[_0x5005('0x2a')]));if(_0x20f886['query']['filter']){_0x245da1['where']=_[_0x5005('0x33')](_0x245da1[_0x5005('0x32')],{'$or':_[_0x5005('0x34')](_0x361dfe,function(_0x58d937){if(_0x58d937['type'][_0x5005('0x35')]!==_0x5005('0x36')){var _0x2febb3={};_0x2febb3[_0x58d937[_0x5005('0x37')]]={'$like':'%'+_0x20f886['query'][_0x5005('0x38')]+'%'};return _0x2febb3;}})});}_0x245da1=_[_0x5005('0x33')]({},_0x245da1,_0x20f886['options']);var _0x453de1={'where':_0x245da1[_0x5005('0x32')]};return db['SquareReport'][_0x5005('0x16')](_0x453de1)[_0x5005('0x1f')](function(_0x19b201){_0x3a00ce['count']=_0x19b201;if(_0x20f886[_0x5005('0x29')][_0x5005('0x39')]){_0x245da1[_0x5005('0x3a')]=[{'all':!![]}];}return db['SquareReport'][_0x5005('0x3b')](_0x245da1);})['then'](function(_0xf3f8c0){_0x3a00ce[_0x5005('0x3c')]=_0xf3f8c0;return _0x3a00ce;})[_0x5005('0x1f')](respondWithFilteredResult(_0x919995,_0x245da1))[_0x5005('0x3d')](handleError(_0x919995,null));};exports[_0x5005('0x3e')]=function(_0x6a03c2,_0x2e9163){var _0x3b3335={'raw':!![],'where':{'id':_0x6a03c2[_0x5005('0x3f')]['id']}},_0x180425={};_0x180425[_0x5005('0x27')]=_[_0x5005('0x28')](db[_0x5005('0x25')]['rawAttributes']);_0x180425[_0x5005('0x29')]=_[_0x5005('0x28')](_0x6a03c2[_0x5005('0x29')]);_0x180425[_0x5005('0x2a')]=_[_0x5005('0x2c')](_0x180425[_0x5005('0x27')],_0x180425[_0x5005('0x29')]);_0x3b3335['attributes']=_[_0x5005('0x2c')](_0x180425[_0x5005('0x27')],qs[_0x5005('0x2d')](_0x6a03c2[_0x5005('0x29')][_0x5005('0x2d')]));_0x3b3335[_0x5005('0x2b')]=_0x3b3335[_0x5005('0x2b')][_0x5005('0x2e')]?_0x3b3335[_0x5005('0x2b')]:_0x180425[_0x5005('0x27')];if(_0x6a03c2[_0x5005('0x29')][_0x5005('0x39')]){_0x3b3335['include']=[{'all':!![]}];}_0x3b3335=_[_0x5005('0x33')]({},_0x3b3335,_0x6a03c2[_0x5005('0x40')]);return db['SquareReport'][_0x5005('0x41')](_0x3b3335)['then'](handleEntityNotFound(_0x2e9163,null))['then'](respondWithResult(_0x2e9163,null))[_0x5005('0x3d')](handleError(_0x2e9163,null));};exports[_0x5005('0x42')]=function(_0x569971,_0x177f41){return db[_0x5005('0x25')][_0x5005('0x42')](_0x569971['body'],{})[_0x5005('0x1f')](respondWithResult(_0x177f41,0xc9))['catch'](handleError(_0x177f41,null));};exports['update']=function(_0x430e6e,_0x231af8){if(_0x430e6e[_0x5005('0x43')]['id']){delete _0x430e6e['body']['id'];}return db[_0x5005('0x25')]['find']({'where':{'id':_0x430e6e['params']['id']}})[_0x5005('0x1f')](handleEntityNotFound(_0x231af8,null))[_0x5005('0x1f')](saveUpdates(_0x430e6e[_0x5005('0x43')],null))['then'](respondWithResult(_0x231af8,null))[_0x5005('0x3d')](handleError(_0x231af8,null));};exports['destroy']=function(_0x3502fa,_0xa277af){return db[_0x5005('0x25')][_0x5005('0x41')]({'where':{'id':_0x3502fa[_0x5005('0x3f')]['id']}})[_0x5005('0x1f')](handleEntityNotFound(_0xa277af,null))[_0x5005('0x1f')](removeEntity(_0xa277af,null))[_0x5005('0x3d')](handleError(_0xa277af,null));};exports[_0x5005('0x44')]=function(_0x21143a,_0x489e19){return db['SquareReport'][_0x5005('0x44')]()[_0x5005('0x1f')](respondWithResult(_0x489e19,null))[_0x5005('0x3d')](handleError(_0x489e19,null));}; \ No newline at end of file +var _0x9106=['offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','filter','SquareReport','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count'];(function(_0x56e75b,_0x44162e){var _0x494e6d=function(_0x5aae42){while(--_0x5aae42){_0x56e75b['push'](_0x56e75b['shift']());}};_0x494e6d(++_0x44162e);}(_0x9106,0x10a));var _0x6910=function(_0x410344,_0x11c039){_0x410344=_0x410344-0x0;var _0x210ff4=_0x9106[_0x410344];return _0x210ff4;};'use strict';var pdf=require(_0x6910('0x0'));var emlformat=require(_0x6910('0x1'));var rimraf=require(_0x6910('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6910('0x3'));var rp=require('request-promise');var moment=require(_0x6910('0x4'));var BPromise=require(_0x6910('0x5'));var Mustache=require(_0x6910('0x6'));var util=require('util');var path=require(_0x6910('0x7'));var sox=require(_0x6910('0x8'));var csv=require(_0x6910('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6910('0xa'));var squel=require(_0x6910('0xb'));var crypto=require(_0x6910('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6910('0x9'));var querystring=require(_0x6910('0xd'));var Papa=require(_0x6910('0xe'));var Redis=require('ioredis');var authService=require(_0x6910('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6910('0x10'));var logger=require(_0x6910('0x11'))(_0x6910('0x12'));var utils=require(_0x6910('0x13'));var config=require(_0x6910('0x14'));var db=require(_0x6910('0x15'))['db'];function respondWithStatusCode(_0x4e6a6e,_0x4b6d0b){_0x4b6d0b=_0x4b6d0b||0xcc;return function(_0x492aed){if(_0x492aed){return _0x4e6a6e[_0x6910('0x16')](_0x4b6d0b);}return _0x4e6a6e[_0x6910('0x17')](_0x4b6d0b)['end']();};}function respondWithResult(_0x222eca,_0x5527f7){_0x5527f7=_0x5527f7||0xc8;return function(_0xb781e3){if(_0xb781e3){return _0x222eca[_0x6910('0x17')](_0x5527f7)[_0x6910('0x18')](_0xb781e3);}};}function respondWithFilteredResult(_0x49fc92,_0x13a68d){return function(_0x21f228){if(_0x21f228){var _0x15f0e6=_0x21f228[_0x6910('0x19')],_0x163cd3=_0x13a68d['offset'],_0x5c18e6=_0x13a68d[_0x6910('0x1a')]+_0x13a68d[_0x6910('0x1b')],_0x2c8ac6;if(_0x5c18e6>=_0x15f0e6){_0x5c18e6=_0x15f0e6;_0x2c8ac6=0xc8;}else{_0x2c8ac6=0xce;}_0x49fc92[_0x6910('0x17')](_0x2c8ac6);return _0x49fc92[_0x6910('0x1c')](_0x6910('0x1d'),_0x163cd3+'-'+_0x5c18e6+'/'+_0x15f0e6)['json'](_0x21f228);}return null;};}function patchUpdates(_0x8c64e4){return function(_0x1634ff){try{jsonpatch[_0x6910('0x1e')](_0x1634ff,_0x8c64e4,!![]);}catch(_0x41d3e8){return BPromise[_0x6910('0x1f')](_0x41d3e8);}return _0x1634ff[_0x6910('0x20')]();};}function saveUpdates(_0x5710d8,_0x2914bc){return function(_0x432ba4){if(_0x432ba4){return _0x432ba4[_0x6910('0x21')](_0x5710d8)[_0x6910('0x22')](function(_0x49404c){return _0x49404c;});}return null;};}function removeEntity(_0xe607b6,_0x15eec2){return function(_0x634924){if(_0x634924){return _0x634924['destroy']()[_0x6910('0x22')](function(){_0xe607b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e53fe,_0x5bee76){return function(_0x56aa0e){if(!_0x56aa0e){_0x3e53fe[_0x6910('0x16')](0x194);}return _0x56aa0e;};}function handleError(_0x3497b7,_0x3994d9){_0x3994d9=_0x3994d9||0x1f4;return function(_0x4bf02e){logger[_0x6910('0x23')](_0x4bf02e[_0x6910('0x24')]);if(_0x4bf02e['name']){delete _0x4bf02e[_0x6910('0x25')];}_0x3497b7[_0x6910('0x17')](_0x3994d9)['send'](_0x4bf02e);};}exports[_0x6910('0x26')]=function(_0x440ae4,_0x224732){var _0x1ab41b={},_0x4bfec6={},_0x1abefd={'count':0x0,'rows':[]};var _0x393d1a=db['SquareReport'][_0x6910('0x27')];_0x4bfec6[_0x6910('0x28')]=_[_0x6910('0x29')](_0x393d1a);_0x4bfec6[_0x6910('0x2a')]=_[_0x6910('0x29')](_0x440ae4[_0x6910('0x2a')]);_0x4bfec6[_0x6910('0x2b')]=_['intersection'](_0x4bfec6['model'],_0x4bfec6[_0x6910('0x2a')]);_0x1ab41b['attributes']=_[_0x6910('0x2c')](_0x4bfec6[_0x6910('0x28')],qs[_0x6910('0x2d')](_0x440ae4[_0x6910('0x2a')]['fields']));_0x1ab41b[_0x6910('0x2e')]=_0x1ab41b[_0x6910('0x2e')]['length']?_0x1ab41b['attributes']:_0x4bfec6['model'];if(!_0x440ae4[_0x6910('0x2a')][_0x6910('0x2f')](_0x6910('0x30'))){_0x1ab41b[_0x6910('0x1b')]=qs[_0x6910('0x1b')](_0x440ae4[_0x6910('0x2a')][_0x6910('0x1b')]);_0x1ab41b[_0x6910('0x1a')]=qs[_0x6910('0x1a')](_0x440ae4[_0x6910('0x2a')][_0x6910('0x1a')]);}_0x1ab41b['order']=qs['sort'](_0x440ae4[_0x6910('0x2a')][_0x6910('0x31')]);_0x1ab41b[_0x6910('0x32')]=qs[_0x6910('0x2b')](_[_0x6910('0x33')](_0x440ae4[_0x6910('0x2a')],_0x4bfec6[_0x6910('0x2b')]));if(_0x440ae4[_0x6910('0x2a')]['filter']){_0x1ab41b[_0x6910('0x32')]=_[_0x6910('0x34')](_0x1ab41b[_0x6910('0x32')],{'$or':_['map'](_0x393d1a,function(_0x165e72){if(_0x165e72[_0x6910('0x35')][_0x6910('0x36')]!==_0x6910('0x37')){var _0xea556={};_0xea556[_0x165e72[_0x6910('0x38')]]={'$like':'%'+_0x440ae4[_0x6910('0x2a')][_0x6910('0x39')]+'%'};return _0xea556;}})});}_0x1ab41b=_[_0x6910('0x34')]({},_0x1ab41b,_0x440ae4['options']);var _0x547cf3={'where':_0x1ab41b['where']};return db[_0x6910('0x3a')][_0x6910('0x19')](_0x547cf3)[_0x6910('0x22')](function(_0x486442){_0x1abefd[_0x6910('0x19')]=_0x486442;if(_0x440ae4[_0x6910('0x2a')][_0x6910('0x3b')]){_0x1ab41b[_0x6910('0x3c')]=[{'all':!![]}];}return db[_0x6910('0x3a')][_0x6910('0x3d')](_0x1ab41b);})[_0x6910('0x22')](function(_0x3d7bdb){_0x1abefd[_0x6910('0x3e')]=_0x3d7bdb;return _0x1abefd;})[_0x6910('0x22')](respondWithFilteredResult(_0x224732,_0x1ab41b))['catch'](handleError(_0x224732,null));};exports[_0x6910('0x3f')]=function(_0x48db3e,_0x5e492b){var _0x4a055e={'raw':!![],'where':{'id':_0x48db3e[_0x6910('0x40')]['id']}},_0x46dbbe={};_0x46dbbe[_0x6910('0x28')]=_[_0x6910('0x29')](db[_0x6910('0x3a')]['rawAttributes']);_0x46dbbe[_0x6910('0x2a')]=_[_0x6910('0x29')](_0x48db3e['query']);_0x46dbbe[_0x6910('0x2b')]=_[_0x6910('0x2c')](_0x46dbbe[_0x6910('0x28')],_0x46dbbe[_0x6910('0x2a')]);_0x4a055e[_0x6910('0x2e')]=_[_0x6910('0x2c')](_0x46dbbe['model'],qs[_0x6910('0x2d')](_0x48db3e[_0x6910('0x2a')]['fields']));_0x4a055e[_0x6910('0x2e')]=_0x4a055e['attributes'][_0x6910('0x41')]?_0x4a055e[_0x6910('0x2e')]:_0x46dbbe[_0x6910('0x28')];if(_0x48db3e[_0x6910('0x2a')][_0x6910('0x3b')]){_0x4a055e[_0x6910('0x3c')]=[{'all':!![]}];}_0x4a055e=_['merge']({},_0x4a055e,_0x48db3e[_0x6910('0x42')]);return db[_0x6910('0x3a')]['find'](_0x4a055e)[_0x6910('0x22')](handleEntityNotFound(_0x5e492b,null))[_0x6910('0x22')](respondWithResult(_0x5e492b,null))[_0x6910('0x43')](handleError(_0x5e492b,null));};exports[_0x6910('0x44')]=function(_0x46ebea,_0x3a5369){return db[_0x6910('0x3a')][_0x6910('0x44')](_0x46ebea[_0x6910('0x45')],{})[_0x6910('0x22')](respondWithResult(_0x3a5369,0xc9))['catch'](handleError(_0x3a5369,null));};exports[_0x6910('0x21')]=function(_0x5350f2,_0x3e1387){if(_0x5350f2[_0x6910('0x45')]['id']){delete _0x5350f2[_0x6910('0x45')]['id'];}return db[_0x6910('0x3a')][_0x6910('0x46')]({'where':{'id':_0x5350f2[_0x6910('0x40')]['id']}})[_0x6910('0x22')](handleEntityNotFound(_0x3e1387,null))[_0x6910('0x22')](saveUpdates(_0x5350f2['body'],null))[_0x6910('0x22')](respondWithResult(_0x3e1387,null))[_0x6910('0x43')](handleError(_0x3e1387,null));};exports[_0x6910('0x47')]=function(_0x160c15,_0x1a29b2){return db['SquareReport'][_0x6910('0x46')]({'where':{'id':_0x160c15[_0x6910('0x40')]['id']}})[_0x6910('0x22')](handleEntityNotFound(_0x1a29b2,null))[_0x6910('0x22')](removeEntity(_0x1a29b2,null))[_0x6910('0x43')](handleError(_0x1a29b2,null));};exports[_0x6910('0x48')]=function(_0x2ea98f,_0x2918c3){return db[_0x6910('0x3a')][_0x6910('0x48')]()[_0x6910('0x22')](respondWithResult(_0x2918c3,null))['catch'](handleError(_0x2918c3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9e4e7b6..61e117d 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 _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x59cbc9,_0x41d483){var _0x985dfe=function(_0x57b347){while(--_0x57b347){_0x59cbc9['push'](_0x59cbc9['shift']());}};_0x985dfe(++_0x41d483);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x240dda,_0x5d4dd4){var _0x3ddcac=function(_0x2fb0fe){while(--_0x2fb0fe){_0x240dda['push'](_0x240dda['shift']());}};_0x3ddcac(++_0x5d4dd4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index dad348f..1e2300e 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 _0x0055=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','create','body','options','raw','debug','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','util'];(function(_0x3267cb,_0x126cc9){var _0x200925=function(_0x2d96e3){while(--_0x2d96e3){_0x3267cb['push'](_0x3267cb['shift']());}};_0x200925(++_0x126cc9);}(_0x0055,0x1ed));var _0x5005=function(_0x7fb279,_0x4e333a){_0x7fb279=_0x7fb279-0x0;var _0x4344de=_0x0055[_0x7fb279];return _0x4344de;};'use strict';var _=require(_0x5005('0x0'));var util=require(_0x5005('0x1'));var moment=require('moment');var BPromise=require(_0x5005('0x2'));var rs=require(_0x5005('0x3'));var fs=require('fs');var Redis=require(_0x5005('0x4'));var db=require(_0x5005('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5005('0x6'))(_0x5005('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5005('0x8')][_0x5005('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf0e49,_0x5aa804,_0x36a3d9){return new BPromise(function(_0x5e79b3,_0x556097){return client[_0x5005('0xa')](_0xdf0e49,_0x36a3d9)[_0x5005('0xb')](function(_0x11e575){logger[_0x5005('0xc')](_0x5005('0xd'),_0x5aa804,_0x5005('0xe'));logger['debug'](_0x5005('0xf'),_0x5aa804,'request\x20sent',JSON[_0x5005('0x10')](_0x11e575));if(_0x11e575[_0x5005('0x11')]){if(_0x11e575['error']['code']===0x1f4){logger[_0x5005('0x11')](_0x5005('0xd'),_0x5aa804,_0x11e575[_0x5005('0x11')][_0x5005('0x12')]);return _0x556097(_0x11e575['error'][_0x5005('0x12')]);}logger[_0x5005('0x11')](_0x5005('0xd'),_0x5aa804,_0x11e575[_0x5005('0x11')]['message']);return _0x5e79b3(_0x11e575['error'][_0x5005('0x12')]);}else{logger[_0x5005('0xc')]('SquareReport,\x20%s,\x20%s',_0x5aa804,_0x5005('0xe'));_0x5e79b3(_0x11e575[_0x5005('0x13')][_0x5005('0x12')]);}})[_0x5005('0x14')](function(_0x510bab){logger[_0x5005('0x11')](_0x5005('0xd'),_0x5aa804,_0x510bab);_0x556097(_0x510bab);});});}exports[_0x5005('0x15')]=function(_0x1ac578){var _0x6e11be=this;return new Promise(function(_0x5bc486,_0x1b42e4){return db['SquareReport'][_0x5005('0x16')](_0x1ac578[_0x5005('0x17')],{'raw':_0x1ac578[_0x5005('0x18')]?_0x1ac578[_0x5005('0x18')][_0x5005('0x19')]===undefined?!![]:![]:!![]})[_0x5005('0xb')](function(_0x473648){logger['info'](_0x5005('0x15'),_0x1ac578);logger[_0x5005('0x1a')](_0x5005('0x15'),_0x1ac578,JSON[_0x5005('0x10')](_0x473648));_0x5bc486(_0x473648);})[_0x5005('0x14')](function(_0x47d65a){logger[_0x5005('0x11')](_0x5005('0x15'),_0x47d65a[_0x5005('0x12')],_0x1ac578);_0x1b42e4(_0x6e11be[_0x5005('0x11')](0x1f4,_0x47d65a['message']));});});};exports[_0x5005('0x1b')]=function(_0x5333be){var _0x365097=this;return new Promise(function(_0x15eb7f,_0x47d287){return db[_0x5005('0x1c')][_0x5005('0x1d')](_0x5333be[_0x5005('0x17')],{'raw':_0x5333be['options']?_0x5333be['options'][_0x5005('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5333be[_0x5005('0x18')]?_0x5333be['options'][_0x5005('0x1e')]||null:null,'attributes':_0x5333be[_0x5005('0x18')]?_0x5333be['options'][_0x5005('0x1f')]||null:null,'limit':_0x5333be[_0x5005('0x18')]?_0x5333be['options'][_0x5005('0x20')]||null:null})['then'](function(_0x1f820c){logger[_0x5005('0xc')](_0x5005('0x1b'),_0x5333be);logger[_0x5005('0x1a')]('UpdateSquareReport',_0x5333be,JSON[_0x5005('0x10')](_0x1f820c));_0x15eb7f(_0x1f820c);})[_0x5005('0x14')](function(_0x382cb0){logger[_0x5005('0x11')](_0x5005('0x1b'),_0x382cb0['message'],_0x5333be);_0x47d287(_0x365097[_0x5005('0x11')](0x1f4,_0x382cb0[_0x5005('0x12')]));});});}; \ No newline at end of file +var _0x92b3=['client','http','request','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateSquareReport','SquareReport','body','options','raw','debug','catch','update','where','limit','then','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92b3,0x97));var _0x392b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x92b3[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var util=require(_0x392b('0x0'));var moment=require(_0x392b('0x1'));var BPromise=require(_0x392b('0x2'));var rs=require(_0x392b('0x3'));var fs=require('fs');var Redis=require(_0x392b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x392b('0x5'));var logger=require(_0x392b('0x6'))(_0x392b('0x7'));var config=require('../../config/environment');var jayson=require(_0x392b('0x8'));var client=jayson[_0x392b('0x9')][_0x392b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334452,_0x1d5546,_0x389873){return new BPromise(function(_0x15e5e1,_0x3b8dc7){return client[_0x392b('0xb')](_0x334452,_0x389873)['then'](function(_0x2c4f26){logger[_0x392b('0xc')](_0x392b('0xd'),_0x1d5546,'request\x20sent');logger['debug'](_0x392b('0xe'),_0x1d5546,_0x392b('0xf'),JSON['stringify'](_0x2c4f26));if(_0x2c4f26[_0x392b('0x10')]){if(_0x2c4f26[_0x392b('0x10')][_0x392b('0x11')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x1d5546,_0x2c4f26[_0x392b('0x10')][_0x392b('0x12')]);return _0x3b8dc7(_0x2c4f26[_0x392b('0x10')][_0x392b('0x12')]);}logger[_0x392b('0x10')](_0x392b('0xd'),_0x1d5546,_0x2c4f26[_0x392b('0x10')][_0x392b('0x12')]);return _0x15e5e1(_0x2c4f26[_0x392b('0x10')][_0x392b('0x12')]);}else{logger[_0x392b('0xc')](_0x392b('0xd'),_0x1d5546,_0x392b('0xf'));_0x15e5e1(_0x2c4f26[_0x392b('0x13')][_0x392b('0x12')]);}})['catch'](function(_0x2938a8){logger[_0x392b('0x10')]('SquareReport,\x20%s,\x20%s',_0x1d5546,_0x2938a8);_0x3b8dc7(_0x2938a8);});});}exports[_0x392b('0x14')]=function(_0x37c9ad){var _0x1d35b0=this;return new Promise(function(_0x5c6b66,_0x50ad10){return db[_0x392b('0x15')]['create'](_0x37c9ad[_0x392b('0x16')],{'raw':_0x37c9ad[_0x392b('0x17')]?_0x37c9ad[_0x392b('0x17')][_0x392b('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9655e0){logger['info'](_0x392b('0x14'),_0x37c9ad);logger[_0x392b('0x19')]('CreateSquareReport',_0x37c9ad,JSON['stringify'](_0x9655e0));_0x5c6b66(_0x9655e0);})[_0x392b('0x1a')](function(_0x414615){logger[_0x392b('0x10')]('CreateSquareReport',_0x414615['message'],_0x37c9ad);_0x50ad10(_0x1d35b0['error'](0x1f4,_0x414615['message']));});});};exports['UpdateSquareReport']=function(_0x522051){var _0x2e893e=this;return new Promise(function(_0x4e8fb6,_0x1a8147){return db[_0x392b('0x15')][_0x392b('0x1b')](_0x522051[_0x392b('0x16')],{'raw':_0x522051['options']?_0x522051[_0x392b('0x17')][_0x392b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x522051[_0x392b('0x17')]?_0x522051['options'][_0x392b('0x1c')]||null:null,'attributes':_0x522051[_0x392b('0x17')]?_0x522051[_0x392b('0x17')]['attributes']||null:null,'limit':_0x522051[_0x392b('0x17')]?_0x522051['options'][_0x392b('0x1d')]||null:null})[_0x392b('0x1e')](function(_0x36a701){logger['info'](_0x392b('0x1f'),_0x522051);logger[_0x392b('0x19')](_0x392b('0x1f'),_0x522051,JSON['stringify'](_0x36a701));_0x4e8fb6(_0x36a701);})['catch'](function(_0x276d42){logger[_0x392b('0x10')](_0x392b('0x1f'),_0x276d42[_0x392b('0x12')],_0x522051);_0x1a8147(_0x2e893e[_0x392b('0x10')](0x1f4,_0x276d42[_0x392b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index dd19dd5..b844048 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 _0x5205=['isAuthenticated','put','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','index','/describe','describe','show','post'];(function(_0x37182c,_0x33ea12){var _0x31c5f9=function(_0x2e62fb){while(--_0x2e62fb){_0x37182c['push'](_0x37182c['shift']());}};_0x31c5f9(++_0x33ea12);}(_0x5205,0x1e0));var _0x5520=function(_0xdc9365,_0x12d294){_0xdc9365=_0xdc9365-0x0;var _0xe9a138=_0x5205[_0xdc9365];return _0xe9a138;};'use strict';var multer=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var path=require(_0x5520('0x2'));var timeout=require(_0x5520('0x3'));var express=require('express');var router=express[_0x5520('0x4')]();var auth=require(_0x5520('0x5'));var interaction=require(_0x5520('0x6'));var config=require('../../config/environment');var controller=require(_0x5520('0x7'));router[_0x5520('0x8')]('/',auth['isAuthenticated'](),controller[_0x5520('0x9')]);router[_0x5520('0x8')](_0x5520('0xa'),auth['isAuthenticated'](),controller[_0x5520('0xb')]);router[_0x5520('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5520('0xc')]);router[_0x5520('0xd')]('/',auth[_0x5520('0xe')](),controller['create']);router[_0x5520('0xf')](_0x5520('0x10'),auth[_0x5520('0xe')](),controller[_0x5520('0x11')]);router['delete'](_0x5520('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x5520('0x12')]=router; \ No newline at end of file +var _0x20c2=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id'];(function(_0xfef6ba,_0x398cee){var _0x2dfada=function(_0x954917){while(--_0x954917){_0xfef6ba['push'](_0xfef6ba['shift']());}};_0x2dfada(++_0x398cee);}(_0x20c2,0xc6));var _0x220c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x20c2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x220c('0x0'));var timeout=require(_0x220c('0x1'));var express=require(_0x220c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x220c('0x3'));var config=require(_0x220c('0x4'));var controller=require(_0x220c('0x5'));router[_0x220c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x220c('0x6')](_0x220c('0x7'),auth[_0x220c('0x8')](),controller[_0x220c('0x9')]);router[_0x220c('0x6')](_0x220c('0xa'),auth[_0x220c('0x8')](),controller[_0x220c('0xb')]);router[_0x220c('0xc')]('/',auth['isAuthenticated'](),controller[_0x220c('0xd')]);router[_0x220c('0xe')](_0x220c('0xa'),auth[_0x220c('0x8')](),controller[_0x220c('0xf')]);router[_0x220c('0x10')](_0x220c('0xa'),auth[_0x220c('0x8')](),controller[_0x220c('0x11')]);module[_0x220c('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 72497d4..c6fc2d4 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 _0xa176=['STRING','exports'];(function(_0x2ac22e,_0x53fed4){var _0x5c8c38=function(_0x191916){while(--_0x191916){_0x2ac22e['push'](_0x2ac22e['shift']());}};_0x5c8c38(++_0x53fed4);}(_0xa176,0x113));var _0x6a17=function(_0x4c1f85,_0x57bbfb){_0x4c1f85=_0x4c1f85-0x0;var _0x4a2b60=_0xa176[_0x4c1f85];return _0x4a2b60;};'use strict';var Sequelize=require('sequelize');module[_0x6a17('0x0')]={'uniqueid':{'type':Sequelize[_0x6a17('0x1')]},'node':{'type':Sequelize[_0x6a17('0x1')]},'application':{'type':Sequelize[_0x6a17('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x6a17('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x424e=['TEXT','exports','STRING'];(function(_0x3b07d7,_0x374e44){var _0x2a9b53=function(_0x11a0e5){while(--_0x11a0e5){_0x3b07d7['push'](_0x3b07d7['shift']());}};_0x2a9b53(++_0x374e44);}(_0x424e,0xf1));var _0xe424=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x424e[_0x599e60];return _0x468e19;};'use strict';var Sequelize=require('sequelize');module[_0xe424('0x0')]={'uniqueid':{'type':Sequelize[_0xe424('0x1')]},'node':{'type':Sequelize[_0xe424('0x1')]},'application':{'type':Sequelize[_0xe424('0x1')]},'data':{'type':Sequelize[_0xe424('0x2')]},'project_name':{'type':Sequelize[_0xe424('0x1')]},'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 70ccf43..cff095b 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 _0x64a1=['length','nolimit','limit','sort','pick','where','merge','map','key','field','filter','options','count','includeAll','include','findAll','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','SquareDetailsReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x64a1,0x12f));var _0x164a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x64a1[_0x1e4360];return _0x31e6b4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x164a('0x0'));var rimraf=require(_0x164a('0x1'));var zipdir=require(_0x164a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x164a('0x3'));var moment=require(_0x164a('0x4'));var BPromise=require(_0x164a('0x5'));var Mustache=require(_0x164a('0x6'));var util=require(_0x164a('0x7'));var path=require(_0x164a('0x8'));var sox=require(_0x164a('0x9'));var csv=require(_0x164a('0xa'));var ejs=require(_0x164a('0xb'));var fs=require('fs');var _=require(_0x164a('0xc'));var squel=require(_0x164a('0xd'));var crypto=require(_0x164a('0xe'));var jsforce=require(_0x164a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x164a('0xa'));var querystring=require('querystring');var Papa=require(_0x164a('0x10'));var Redis=require(_0x164a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x164a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x164a('0x13'))(_0x164a('0x14'));var utils=require(_0x164a('0x15'));var config=require(_0x164a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e1bab,_0x4233c2){_0x4233c2=_0x4233c2||0xcc;return function(_0x637544){if(_0x637544){return _0x2e1bab[_0x164a('0x17')](_0x4233c2);}return _0x2e1bab[_0x164a('0x18')](_0x4233c2)[_0x164a('0x19')]();};}function respondWithResult(_0x161f94,_0x2e7f29){_0x2e7f29=_0x2e7f29||0xc8;return function(_0x5919e6){if(_0x5919e6){return _0x161f94['status'](_0x2e7f29)['json'](_0x5919e6);}};}function respondWithFilteredResult(_0x4f11b6,_0x2cd859){return function(_0xe9740){if(_0xe9740){var _0x464322=_0xe9740['count'],_0x443054=_0x2cd859[_0x164a('0x1a')],_0x2cb545=_0x2cd859[_0x164a('0x1a')]+_0x2cd859['limit'],_0x40e74f;if(_0x2cb545>=_0x464322){_0x2cb545=_0x464322;_0x40e74f=0xc8;}else{_0x40e74f=0xce;}_0x4f11b6[_0x164a('0x18')](_0x40e74f);return _0x4f11b6['set'](_0x164a('0x1b'),_0x443054+'-'+_0x2cb545+'/'+_0x464322)[_0x164a('0x1c')](_0xe9740);}return null;};}function patchUpdates(_0x49d7a7){return function(_0x4820d6){try{jsonpatch[_0x164a('0x1d')](_0x4820d6,_0x49d7a7,!![]);}catch(_0x469407){return BPromise[_0x164a('0x1e')](_0x469407);}return _0x4820d6[_0x164a('0x1f')]();};}function saveUpdates(_0x38fd0c,_0x3cd9cb){return function(_0x376573){if(_0x376573){return _0x376573['update'](_0x38fd0c)[_0x164a('0x20')](function(_0x39c93a){return _0x39c93a;});}return null;};}function removeEntity(_0x50ec36,_0x1bc093){return function(_0x24e2bf){if(_0x24e2bf){return _0x24e2bf[_0x164a('0x21')]()['then'](function(){_0x50ec36[_0x164a('0x18')](0xcc)[_0x164a('0x19')]();});}};}function handleEntityNotFound(_0x2aec7b,_0x4a5f25){return function(_0x1a6c19){if(!_0x1a6c19){_0x2aec7b['sendStatus'](0x194);}return _0x1a6c19;};}function handleError(_0x148159,_0x40ccd2){_0x40ccd2=_0x40ccd2||0x1f4;return function(_0x4616a4){logger[_0x164a('0x22')](_0x4616a4[_0x164a('0x23')]);if(_0x4616a4[_0x164a('0x24')]){delete _0x4616a4['name'];}_0x148159[_0x164a('0x18')](_0x40ccd2)['send'](_0x4616a4);};}exports[_0x164a('0x25')]=function(_0x21e7f7,_0x30721c){var _0x48be04={},_0x26d73e={},_0x2d5d7b={'count':0x0,'rows':[]};var _0x573f43=db[_0x164a('0x26')][_0x164a('0x27')];_0x26d73e['model']=_[_0x164a('0x28')](_0x573f43);_0x26d73e[_0x164a('0x29')]=_['keys'](_0x21e7f7[_0x164a('0x29')]);_0x26d73e[_0x164a('0x2a')]=_[_0x164a('0x2b')](_0x26d73e['model'],_0x26d73e[_0x164a('0x29')]);_0x48be04[_0x164a('0x2c')]=_['intersection'](_0x26d73e[_0x164a('0x2d')],qs['fields'](_0x21e7f7['query'][_0x164a('0x2e')]));_0x48be04[_0x164a('0x2c')]=_0x48be04[_0x164a('0x2c')][_0x164a('0x2f')]?_0x48be04[_0x164a('0x2c')]:_0x26d73e[_0x164a('0x2d')];if(!_0x21e7f7[_0x164a('0x29')]['hasOwnProperty'](_0x164a('0x30'))){_0x48be04[_0x164a('0x31')]=qs[_0x164a('0x31')](_0x21e7f7['query'][_0x164a('0x31')]);_0x48be04['offset']=qs[_0x164a('0x1a')](_0x21e7f7[_0x164a('0x29')][_0x164a('0x1a')]);}_0x48be04['order']=qs[_0x164a('0x32')](_0x21e7f7[_0x164a('0x29')][_0x164a('0x32')]);_0x48be04['where']=qs[_0x164a('0x2a')](_[_0x164a('0x33')](_0x21e7f7[_0x164a('0x29')],_0x26d73e[_0x164a('0x2a')]));if(_0x21e7f7['query']['filter']){_0x48be04[_0x164a('0x34')]=_[_0x164a('0x35')](_0x48be04[_0x164a('0x34')],{'$or':_[_0x164a('0x36')](_0x573f43,function(_0x43a350){if(_0x43a350['type'][_0x164a('0x37')]!=='VIRTUAL'){var _0x1bcbad={};_0x1bcbad[_0x43a350[_0x164a('0x38')]]={'$like':'%'+_0x21e7f7[_0x164a('0x29')][_0x164a('0x39')]+'%'};return _0x1bcbad;}})});}_0x48be04=_[_0x164a('0x35')]({},_0x48be04,_0x21e7f7[_0x164a('0x3a')]);var _0x170951={'where':_0x48be04[_0x164a('0x34')]};return db[_0x164a('0x26')][_0x164a('0x3b')](_0x170951)[_0x164a('0x20')](function(_0xa2ce7b){_0x2d5d7b[_0x164a('0x3b')]=_0xa2ce7b;if(_0x21e7f7['query'][_0x164a('0x3c')]){_0x48be04[_0x164a('0x3d')]=[{'all':!![]}];}return db[_0x164a('0x26')][_0x164a('0x3e')](_0x48be04);})[_0x164a('0x20')](function(_0x3637cc){_0x2d5d7b['rows']=_0x3637cc;return _0x2d5d7b;})[_0x164a('0x20')](respondWithFilteredResult(_0x30721c,_0x48be04))[_0x164a('0x3f')](handleError(_0x30721c,null));};exports['show']=function(_0x27f9c1,_0x38416e){var _0xa0b984={'raw':!![],'where':{'id':_0x27f9c1[_0x164a('0x40')]['id']}},_0x13efe6={};_0x13efe6[_0x164a('0x2d')]=_[_0x164a('0x28')](db[_0x164a('0x26')][_0x164a('0x27')]);_0x13efe6[_0x164a('0x29')]=_[_0x164a('0x28')](_0x27f9c1[_0x164a('0x29')]);_0x13efe6[_0x164a('0x2a')]=_[_0x164a('0x2b')](_0x13efe6[_0x164a('0x2d')],_0x13efe6[_0x164a('0x29')]);_0xa0b984[_0x164a('0x2c')]=_['intersection'](_0x13efe6[_0x164a('0x2d')],qs[_0x164a('0x2e')](_0x27f9c1[_0x164a('0x29')][_0x164a('0x2e')]));_0xa0b984[_0x164a('0x2c')]=_0xa0b984['attributes'][_0x164a('0x2f')]?_0xa0b984[_0x164a('0x2c')]:_0x13efe6[_0x164a('0x2d')];if(_0x27f9c1['query'][_0x164a('0x3c')]){_0xa0b984[_0x164a('0x3d')]=[{'all':!![]}];}_0xa0b984=_['merge']({},_0xa0b984,_0x27f9c1[_0x164a('0x3a')]);return db['SquareDetailsReport'][_0x164a('0x41')](_0xa0b984)[_0x164a('0x20')](handleEntityNotFound(_0x38416e,null))[_0x164a('0x20')](respondWithResult(_0x38416e,null))['catch'](handleError(_0x38416e,null));};exports[_0x164a('0x42')]=function(_0x2f587c,_0x568148){return db[_0x164a('0x26')][_0x164a('0x42')](_0x2f587c[_0x164a('0x43')],{})[_0x164a('0x20')](respondWithResult(_0x568148,0xc9))['catch'](handleError(_0x568148,null));};exports[_0x164a('0x44')]=function(_0x760134,_0x54ac8e){if(_0x760134['body']['id']){delete _0x760134[_0x164a('0x43')]['id'];}return db[_0x164a('0x26')]['find']({'where':{'id':_0x760134[_0x164a('0x40')]['id']}})['then'](handleEntityNotFound(_0x54ac8e,null))[_0x164a('0x20')](saveUpdates(_0x760134[_0x164a('0x43')],null))[_0x164a('0x20')](respondWithResult(_0x54ac8e,null))[_0x164a('0x3f')](handleError(_0x54ac8e,null));};exports[_0x164a('0x21')]=function(_0x3e7368,_0x484328){return db[_0x164a('0x26')][_0x164a('0x41')]({'where':{'id':_0x3e7368[_0x164a('0x40')]['id']}})[_0x164a('0x20')](handleEntityNotFound(_0x484328,null))[_0x164a('0x20')](removeEntity(_0x484328,null))[_0x164a('0x3f')](handleError(_0x484328,null));};exports[_0x164a('0x45')]=function(_0x435e7c,_0x4aba22){return db[_0x164a('0x26')]['describe']()[_0x164a('0x20')](respondWithResult(_0x4aba22,null))[_0x164a('0x3f')](handleError(_0x4aba22,null));}; \ No newline at end of file +var _0x8d3b=['stack','name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','json','apply','reject','update','then','error'];(function(_0x156a5b,_0x17ebbd){var _0x3adf76=function(_0x4d1fb9){while(--_0x4d1fb9){_0x156a5b['push'](_0x156a5b['shift']());}};_0x3adf76(++_0x17ebbd);}(_0x8d3b,0x192));var _0xb8d3=function(_0x2c9905,_0x3c017b){_0x2c9905=_0x2c9905-0x0;var _0x3ece98=_0x8d3b[_0x2c9905];return _0x3ece98;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb8d3('0x0'));var zipdir=require(_0xb8d3('0x1'));var jsonpatch=require(_0xb8d3('0x2'));var rp=require(_0xb8d3('0x3'));var moment=require('moment');var BPromise=require(_0xb8d3('0x4'));var Mustache=require(_0xb8d3('0x5'));var util=require(_0xb8d3('0x6'));var path=require(_0xb8d3('0x7'));var sox=require(_0xb8d3('0x8'));var csv=require(_0xb8d3('0x9'));var ejs=require(_0xb8d3('0xa'));var fs=require('fs');var _=require(_0xb8d3('0xb'));var squel=require(_0xb8d3('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8d3('0xd'));var deskjs=require(_0xb8d3('0xe'));var toCsv=require(_0xb8d3('0x9'));var querystring=require(_0xb8d3('0xf'));var Papa=require('papaparse');var Redis=require(_0xb8d3('0x10'));var authService=require(_0xb8d3('0x11'));var qs=require(_0xb8d3('0x12'));var hardwareService=require(_0xb8d3('0x13'));var logger=require('../../config/logger')(_0xb8d3('0x14'));var utils=require(_0xb8d3('0x15'));var config=require(_0xb8d3('0x16'));var db=require(_0xb8d3('0x17'))['db'];function respondWithStatusCode(_0x31c309,_0x40ec91){_0x40ec91=_0x40ec91||0xcc;return function(_0x56d559){if(_0x56d559){return _0x31c309[_0xb8d3('0x18')](_0x40ec91);}return _0x31c309['status'](_0x40ec91)[_0xb8d3('0x19')]();};}function respondWithResult(_0x4d7370,_0x329db7){_0x329db7=_0x329db7||0xc8;return function(_0x44a449){if(_0x44a449){return _0x4d7370['status'](_0x329db7)['json'](_0x44a449);}};}function respondWithFilteredResult(_0x46e025,_0x792c8f){return function(_0x5a38e8){if(_0x5a38e8){var _0x278488=_0x5a38e8[_0xb8d3('0x1a')],_0x409326=_0x792c8f['offset'],_0x34de40=_0x792c8f[_0xb8d3('0x1b')]+_0x792c8f[_0xb8d3('0x1c')],_0x5588ab;if(_0x34de40>=_0x278488){_0x34de40=_0x278488;_0x5588ab=0xc8;}else{_0x5588ab=0xce;}_0x46e025[_0xb8d3('0x1d')](_0x5588ab);return _0x46e025['set']('Content-Range',_0x409326+'-'+_0x34de40+'/'+_0x278488)[_0xb8d3('0x1e')](_0x5a38e8);}return null;};}function patchUpdates(_0x1cc9ea){return function(_0x4bbed5){try{jsonpatch[_0xb8d3('0x1f')](_0x4bbed5,_0x1cc9ea,!![]);}catch(_0x4669e2){return BPromise[_0xb8d3('0x20')](_0x4669e2);}return _0x4bbed5['save']();};}function saveUpdates(_0x4473d9,_0x2bd91e){return function(_0x3b0a1c){if(_0x3b0a1c){return _0x3b0a1c[_0xb8d3('0x21')](_0x4473d9)[_0xb8d3('0x22')](function(_0x451090){return _0x451090;});}return null;};}function removeEntity(_0xadb762,_0x244c8c){return function(_0x104b50){if(_0x104b50){return _0x104b50['destroy']()[_0xb8d3('0x22')](function(){_0xadb762['status'](0xcc)[_0xb8d3('0x19')]();});}};}function handleEntityNotFound(_0x4971d7,_0x28db70){return function(_0xc67bb1){if(!_0xc67bb1){_0x4971d7['sendStatus'](0x194);}return _0xc67bb1;};}function handleError(_0x436e7d,_0x45a610){_0x45a610=_0x45a610||0x1f4;return function(_0x28822b){logger[_0xb8d3('0x23')](_0x28822b[_0xb8d3('0x24')]);if(_0x28822b[_0xb8d3('0x25')]){delete _0x28822b[_0xb8d3('0x25')];}_0x436e7d['status'](_0x45a610)[_0xb8d3('0x26')](_0x28822b);};}exports[_0xb8d3('0x27')]=function(_0x4e8e1e,_0x4f61cc){var _0x47591b={},_0x330563={},_0x3b210a={'count':0x0,'rows':[]};var _0x35e319=db[_0xb8d3('0x28')][_0xb8d3('0x29')];_0x330563[_0xb8d3('0x2a')]=_[_0xb8d3('0x2b')](_0x35e319);_0x330563[_0xb8d3('0x2c')]=_['keys'](_0x4e8e1e[_0xb8d3('0x2c')]);_0x330563[_0xb8d3('0x2d')]=_[_0xb8d3('0x2e')](_0x330563[_0xb8d3('0x2a')],_0x330563['query']);_0x47591b[_0xb8d3('0x2f')]=_['intersection'](_0x330563[_0xb8d3('0x2a')],qs['fields'](_0x4e8e1e['query'][_0xb8d3('0x30')]));_0x47591b[_0xb8d3('0x2f')]=_0x47591b[_0xb8d3('0x2f')][_0xb8d3('0x31')]?_0x47591b[_0xb8d3('0x2f')]:_0x330563[_0xb8d3('0x2a')];if(!_0x4e8e1e[_0xb8d3('0x2c')]['hasOwnProperty'](_0xb8d3('0x32'))){_0x47591b['limit']=qs['limit'](_0x4e8e1e['query']['limit']);_0x47591b['offset']=qs[_0xb8d3('0x1b')](_0x4e8e1e['query'][_0xb8d3('0x1b')]);}_0x47591b[_0xb8d3('0x33')]=qs[_0xb8d3('0x34')](_0x4e8e1e[_0xb8d3('0x2c')][_0xb8d3('0x34')]);_0x47591b[_0xb8d3('0x35')]=qs[_0xb8d3('0x2d')](_[_0xb8d3('0x36')](_0x4e8e1e[_0xb8d3('0x2c')],_0x330563[_0xb8d3('0x2d')]));if(_0x4e8e1e[_0xb8d3('0x2c')][_0xb8d3('0x37')]){_0x47591b[_0xb8d3('0x35')]=_[_0xb8d3('0x38')](_0x47591b['where'],{'$or':_[_0xb8d3('0x39')](_0x35e319,function(_0x2d1323){if(_0x2d1323[_0xb8d3('0x3a')][_0xb8d3('0x3b')]!==_0xb8d3('0x3c')){var _0x37d434={};_0x37d434[_0x2d1323[_0xb8d3('0x3d')]]={'$like':'%'+_0x4e8e1e['query'][_0xb8d3('0x37')]+'%'};return _0x37d434;}})});}_0x47591b=_['merge']({},_0x47591b,_0x4e8e1e[_0xb8d3('0x3e')]);var _0x1e6e5f={'where':_0x47591b[_0xb8d3('0x35')]};return db[_0xb8d3('0x28')][_0xb8d3('0x1a')](_0x1e6e5f)['then'](function(_0x4ec258){_0x3b210a[_0xb8d3('0x1a')]=_0x4ec258;if(_0x4e8e1e[_0xb8d3('0x2c')][_0xb8d3('0x3f')]){_0x47591b[_0xb8d3('0x40')]=[{'all':!![]}];}return db[_0xb8d3('0x28')][_0xb8d3('0x41')](_0x47591b);})['then'](function(_0x2afa9e){_0x3b210a[_0xb8d3('0x42')]=_0x2afa9e;return _0x3b210a;})[_0xb8d3('0x22')](respondWithFilteredResult(_0x4f61cc,_0x47591b))['catch'](handleError(_0x4f61cc,null));};exports['show']=function(_0x502203,_0xfa8e36){var _0x27e232={'raw':!![],'where':{'id':_0x502203[_0xb8d3('0x43')]['id']}},_0x40f2ba={};_0x40f2ba[_0xb8d3('0x2a')]=_[_0xb8d3('0x2b')](db[_0xb8d3('0x28')][_0xb8d3('0x29')]);_0x40f2ba[_0xb8d3('0x2c')]=_[_0xb8d3('0x2b')](_0x502203[_0xb8d3('0x2c')]);_0x40f2ba[_0xb8d3('0x2d')]=_[_0xb8d3('0x2e')](_0x40f2ba[_0xb8d3('0x2a')],_0x40f2ba[_0xb8d3('0x2c')]);_0x27e232['attributes']=_[_0xb8d3('0x2e')](_0x40f2ba[_0xb8d3('0x2a')],qs[_0xb8d3('0x30')](_0x502203['query'][_0xb8d3('0x30')]));_0x27e232[_0xb8d3('0x2f')]=_0x27e232[_0xb8d3('0x2f')]['length']?_0x27e232[_0xb8d3('0x2f')]:_0x40f2ba[_0xb8d3('0x2a')];if(_0x502203[_0xb8d3('0x2c')][_0xb8d3('0x3f')]){_0x27e232[_0xb8d3('0x40')]=[{'all':!![]}];}_0x27e232=_[_0xb8d3('0x38')]({},_0x27e232,_0x502203[_0xb8d3('0x3e')]);return db[_0xb8d3('0x28')][_0xb8d3('0x44')](_0x27e232)[_0xb8d3('0x22')](handleEntityNotFound(_0xfa8e36,null))[_0xb8d3('0x22')](respondWithResult(_0xfa8e36,null))[_0xb8d3('0x45')](handleError(_0xfa8e36,null));};exports[_0xb8d3('0x46')]=function(_0x518004,_0x1383a2){return db[_0xb8d3('0x28')][_0xb8d3('0x46')](_0x518004['body'],{})[_0xb8d3('0x22')](respondWithResult(_0x1383a2,0xc9))['catch'](handleError(_0x1383a2,null));};exports[_0xb8d3('0x21')]=function(_0x20a11a,_0x4b0b6d){if(_0x20a11a['body']['id']){delete _0x20a11a['body']['id'];}return db[_0xb8d3('0x28')][_0xb8d3('0x44')]({'where':{'id':_0x20a11a[_0xb8d3('0x43')]['id']}})[_0xb8d3('0x22')](handleEntityNotFound(_0x4b0b6d,null))[_0xb8d3('0x22')](saveUpdates(_0x20a11a[_0xb8d3('0x47')],null))[_0xb8d3('0x22')](respondWithResult(_0x4b0b6d,null))[_0xb8d3('0x45')](handleError(_0x4b0b6d,null));};exports[_0xb8d3('0x48')]=function(_0x44e59d,_0x56e8b4){return db[_0xb8d3('0x28')][_0xb8d3('0x44')]({'where':{'id':_0x44e59d['params']['id']}})[_0xb8d3('0x22')](handleEntityNotFound(_0x56e8b4,null))['then'](removeEntity(_0x56e8b4,null))['catch'](handleError(_0x56e8b4,null));};exports['describe']=function(_0x33bdfa,_0x1de140){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x1de140,null))['catch'](handleError(_0x1de140,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c787a5b..c5b5d4d 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 _0x9576=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x9576,0x182));var _0x6957=function(_0x193847,_0x45c099){_0x193847=_0x193847-0x0;var _0x57b948=_0x9576[_0x193847];return _0x57b948;};'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 _0x2bd8=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x284664,_0x455bfa){var _0x2e5d22=function(_0x40f40b){while(--_0x40f40b){_0x284664['push'](_0x284664['shift']());}};_0x2e5d22(++_0x455bfa);}(_0x2bd8,0x130));var _0x82bd=function(_0x54b1e8,_0x46abf8){_0x54b1e8=_0x54b1e8-0x0;var _0x16d32f=_0x2bd8[_0x54b1e8];return _0x16d32f;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index e608182..8884f0e 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 _0x5183=['../../config/logger','jayson/promise','client','http','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SquareDetailsReport','create','body','options','raw','info','CreateSquareDetailsReport','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ae8f1,_0x58098e){var _0x4ac982=function(_0x469656){while(--_0x469656){_0x5ae8f1['push'](_0x5ae8f1['shift']());}};_0x4ac982(++_0x58098e);}(_0x5183,0x13e));var _0x3518=function(_0x38cb51,_0x27ed8f){_0x38cb51=_0x38cb51-0x0;var _0x8f951b=_0x5183[_0x38cb51];return _0x8f951b;};'use strict';var _=require(_0x3518('0x0'));var util=require(_0x3518('0x1'));var moment=require(_0x3518('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3518('0x3'));var db=require(_0x3518('0x4'))['db'];var utils=require(_0x3518('0x5'));var logger=require(_0x3518('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3518('0x7'));var client=jayson[_0x3518('0x8')][_0x3518('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482b2d,_0x5cd139,_0x488c52){return new BPromise(function(_0x147b59,_0x33e66c){return client[_0x3518('0xa')](_0x482b2d,_0x488c52)['then'](function(_0x12530b){logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));logger[_0x3518('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5cd139,_0x3518('0xc'),JSON[_0x3518('0xe')](_0x12530b));if(_0x12530b['error']){if(_0x12530b[_0x3518('0xf')][_0x3518('0x10')]===0x1f4){logger[_0x3518('0xf')](_0x3518('0xb'),_0x5cd139,_0x12530b['error']['message']);return _0x33e66c(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}logger[_0x3518('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x5cd139,_0x12530b['error'][_0x3518('0x11')]);return _0x147b59(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}else{logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));_0x147b59(_0x12530b[_0x3518('0x12')][_0x3518('0x11')]);}})['catch'](function(_0xc7f658){logger['error'](_0x3518('0xb'),_0x5cd139,_0xc7f658);_0x33e66c(_0xc7f658);});});}exports['CreateSquareDetailsReport']=function(_0x3f67b6){var _0x1cefa7=this;return new Promise(function(_0x4b9a06,_0x3df948){return db[_0x3518('0x13')][_0x3518('0x14')](_0x3f67b6[_0x3518('0x15')],{'raw':_0x3f67b6[_0x3518('0x16')]?_0x3f67b6['options'][_0x3518('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x29e696){logger[_0x3518('0x18')](_0x3518('0x19'),_0x3f67b6);logger['debug'](_0x3518('0x19'),_0x3f67b6,JSON[_0x3518('0xe')](_0x29e696));_0x4b9a06(_0x29e696);})[_0x3518('0x1a')](function(_0x1e25a9){logger[_0x3518('0xf')]('CreateSquareDetailsReport',_0x1e25a9[_0x3518('0x11')],_0x3f67b6);_0x3df948(_0x1cefa7[_0x3518('0xf')](0x1f4,_0x1e25a9[_0x3518('0x11')]));});});}; \ No newline at end of file +var _0xca8d=['then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0xca8d,0x172));var _0xdca8=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0xca8d[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var moment=require(_0xdca8('0x2'));var BPromise=require(_0xdca8('0x3'));var rs=require(_0xdca8('0x4'));var fs=require('fs');var Redis=require(_0xdca8('0x5'));var db=require(_0xdca8('0x6'))['db'];var utils=require(_0xdca8('0x7'));var logger=require(_0xdca8('0x8'))(_0xdca8('0x9'));var config=require(_0xdca8('0xa'));var jayson=require(_0xdca8('0xb'));var client=jayson['client'][_0xdca8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d18ba,_0x5e5d55,_0x2f034e){return new BPromise(function(_0x152d05,_0x50c8fe){return client[_0xdca8('0xd')](_0x1d18ba,_0x2f034e)[_0xdca8('0xe')](function(_0x21c234){logger['info'](_0xdca8('0xf'),_0x5e5d55,_0xdca8('0x10'));logger[_0xdca8('0x11')](_0xdca8('0x12'),_0x5e5d55,_0xdca8('0x10'),JSON[_0xdca8('0x13')](_0x21c234));if(_0x21c234[_0xdca8('0x14')]){if(_0x21c234[_0xdca8('0x14')][_0xdca8('0x15')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5e5d55,_0x21c234[_0xdca8('0x14')][_0xdca8('0x16')]);return _0x50c8fe(_0x21c234[_0xdca8('0x14')][_0xdca8('0x16')]);}logger[_0xdca8('0x14')](_0xdca8('0xf'),_0x5e5d55,_0x21c234[_0xdca8('0x14')][_0xdca8('0x16')]);return _0x152d05(_0x21c234[_0xdca8('0x14')][_0xdca8('0x16')]);}else{logger[_0xdca8('0x17')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e5d55,'request\x20sent');_0x152d05(_0x21c234[_0xdca8('0x18')]['message']);}})['catch'](function(_0x13c269){logger['error'](_0xdca8('0xf'),_0x5e5d55,_0x13c269);_0x50c8fe(_0x13c269);});});}exports[_0xdca8('0x19')]=function(_0x278d9e){var _0x490650=this;return new Promise(function(_0x5778f9,_0xf803a8){return db[_0xdca8('0x1a')][_0xdca8('0x1b')](_0x278d9e[_0xdca8('0x1c')],{'raw':_0x278d9e['options']?_0x278d9e[_0xdca8('0x1d')][_0xdca8('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x10dd28){logger[_0xdca8('0x17')](_0xdca8('0x19'),_0x278d9e);logger['debug']('CreateSquareDetailsReport',_0x278d9e,JSON[_0xdca8('0x13')](_0x10dd28));_0x5778f9(_0x10dd28);})[_0xdca8('0x1f')](function(_0x2284e0){logger[_0xdca8('0x14')](_0xdca8('0x19'),_0x2284e0[_0xdca8('0x16')],_0x278d9e);_0xf803a8(_0x490650[_0xdca8('0x14')](0x1f4,_0x2284e0['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 71a174e..ac37abd 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 _0xc1f4=['../../components/auth/service','index','/process/:pid/kill','isAuthenticated','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1f4,0x137));var _0x4c1f=function(_0x402eff,_0x2525f2){_0x402eff=_0x402eff-0x0;var _0x2eb371=_0xc1f4[_0x402eff];return _0x2eb371;};'use strict';var express=require(_0x4c1f('0x0'));var router=express['Router']();var auth=require(_0x4c1f('0x1'));var controller=require('./system.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4c1f('0x2')]);router['get'](_0x4c1f('0x3'),auth[_0x4c1f('0x4')](),controller['killProcess']);module[_0x4c1f('0x5')]=router; \ No newline at end of file +var _0xb2f4=['Router','../../components/auth/service','./system.controller','isAuthenticated','index','get','exports'];(function(_0xc27d3b,_0x622636){var _0x15c8fa=function(_0x158edd){while(--_0x158edd){_0xc27d3b['push'](_0xc27d3b['shift']());}};_0x15c8fa(++_0x622636);}(_0xb2f4,0xa1));var _0x4b2f=function(_0x1f2f61,_0x586f2f){_0x1f2f61=_0x1f2f61-0x0;var _0x10dabc=_0xb2f4[_0x1f2f61];return _0x10dabc;};'use strict';var express=require('express');var router=express[_0x4b2f('0x0')]();var auth=require(_0x4b2f('0x1'));var controller=require(_0x4b2f('0x2'));router['get']('/',auth[_0x4b2f('0x3')](),controller[_0x4b2f('0x4')]);router[_0x4b2f('0x5')]('/process/:pid/kill',auth[_0x4b2f('0x3')](),controller['killProcess']);module[_0x4b2f('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 5121214..d7a9315 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 _0xf538=['api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','json','killProcess','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','systeminformation','exec'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf538,0xc6));var _0x8f53=function(_0x1fd6cd,_0x67b90f){_0x1fd6cd=_0x1fd6cd-0x0;var _0x1b85a7=_0xf538[_0x1fd6cd];return _0x1b85a7;};'use strict';var info=require(_0x8f53('0x0'));var exec=require('child_process')[_0x8f53('0x1')];var logger=require('../../config/logger')(_0x8f53('0x2'));var util=require(_0x8f53('0x3'));var BPromise=require(_0x8f53('0x4'));var _=require('lodash');function handleError(_0x5af047,_0x793b4e,_0x1634c8){_0x793b4e=_0x793b4e||0x1f4;return function(_0x4ce55f){logger[_0x8f53('0x5')](_0x8f53('0x6'),_0x1634c8,_0x793b4e,util[_0x8f53('0x7')](_0x4ce55f,{'showHidden':![],'depth':null}));delete _0x4ce55f[_0x8f53('0x8')];_0x5af047[_0x8f53('0x9')](_0x793b4e)[_0x8f53('0xa')](_0x4ce55f);};}exports[_0x8f53('0xb')]=function(_0x4c62ca,_0x2bb755){return info[_0x8f53('0xc')]()[_0x8f53('0xd')](function(_0x12415e){return _0x2bb755[_0x8f53('0x9')](0xc8)['json'](_0x12415e);})[_0x8f53('0xe')](function(_0x3ddf37){return _0x2bb755['status'](0x1f4)[_0x8f53('0xf')](_0x3ddf37);});};exports[_0x8f53('0x10')]=function(_0x1a8701,_0x39ce87){var _0xa61944=['components/import/cm'];return new BPromise(function(_0x3e03ce,_0x2dfd5a){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1a8701['params'][_0x8f53('0x11')]),function(_0xbb087b,_0x3798de,_0xf23849){if(_0xbb087b){return _0x2dfd5a(_0xbb087b);}return _0x3e03ce(_0x3798de);});})['then'](function(_0x3d2de5){var _0x4839c8=![];var _0x15aea5=_0x3d2de5[_0x8f53('0x12')](/\n/);for(var _0x43da1c=0x0,_0xda90f0=_0xa61944[_0x8f53('0x13')];_0x43da1c<_0xda90f0,_0x4839c8===![];_0x43da1c+=0x1){if(_0x3d2de5[_0x8f53('0x14')](_0xa61944[_0x43da1c])>=0x0){_0x4839c8=!![];}}if(!_0x4839c8){throw new Error(util[_0x8f53('0x15')](_0x8f53('0x16'),_0x1a8701[_0x8f53('0x17')]['pid']));}process[_0x8f53('0x18')](_0x1a8701['params']['pid'],'SIGINT');return _0x39ce87[_0x8f53('0x9')](0xc8)[_0x8f53('0xf')]({'message':util[_0x8f53('0x15')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1a8701[_0x8f53('0x17')][_0x8f53('0x11')])});})[_0x8f53('0xe')](handleError(_0x39ce87,null,_0x8f53('0x10')));}; \ No newline at end of file +var _0xd398=['params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x18aa28,_0x1b38e5){var _0x446eed=function(_0x366e1c){while(--_0x366e1c){_0x18aa28['push'](_0x18aa28['shift']());}};_0x446eed(++_0x1b38e5);}(_0xd398,0xb0));var _0x8d39=function(_0x5473f9,_0x14083a){_0x5473f9=_0x5473f9-0x0;var _0x2ca5c0=_0xd398[_0x5473f9];return _0x2ca5c0;};'use strict';var info=require(_0x8d39('0x0'));var exec=require('child_process')[_0x8d39('0x1')];var logger=require(_0x8d39('0x2'))(_0x8d39('0x3'));var util=require(_0x8d39('0x4'));var BPromise=require(_0x8d39('0x5'));var _=require('lodash');function handleError(_0x1c1e5e,_0x516f49,_0x39b361){_0x516f49=_0x516f49||0x1f4;return function(_0x296ab6){logger[_0x8d39('0x6')](_0x8d39('0x7'),_0x39b361,_0x516f49,util[_0x8d39('0x8')](_0x296ab6,{'showHidden':![],'depth':null}));delete _0x296ab6[_0x8d39('0x9')];_0x1c1e5e[_0x8d39('0xa')](_0x516f49)[_0x8d39('0xb')](_0x296ab6);};}exports[_0x8d39('0xc')]=function(_0x2fd704,_0x146974){return info[_0x8d39('0xd')]()[_0x8d39('0xe')](function(_0x452885){return _0x146974[_0x8d39('0xa')](0xc8)['json'](_0x452885);})['catch'](function(_0x2ac56c){return _0x146974[_0x8d39('0xa')](0x1f4)[_0x8d39('0xf')](_0x2ac56c);});};exports[_0x8d39('0x10')]=function(_0x401cfd,_0x432033){var _0x293e81=[_0x8d39('0x11')];return new BPromise(function(_0x188b02,_0x206089){return exec(util[_0x8d39('0x12')](_0x8d39('0x13'),_0x401cfd[_0x8d39('0x14')]['pid']),function(_0x1daa96,_0x155276,_0x37f528){if(_0x1daa96){return _0x206089(_0x1daa96);}return _0x188b02(_0x155276);});})[_0x8d39('0xe')](function(_0x5a7edb){var _0x556897=![];var _0x335c63=_0x5a7edb[_0x8d39('0x15')](/\n/);for(var _0x13e19c=0x0,_0x1d8d47=_0x293e81[_0x8d39('0x16')];_0x13e19c<_0x1d8d47,_0x556897===![];_0x13e19c+=0x1){if(_0x5a7edb[_0x8d39('0x17')](_0x293e81[_0x13e19c])>=0x0){_0x556897=!![];}}if(!_0x556897){throw new Error(util['format'](_0x8d39('0x18'),_0x401cfd[_0x8d39('0x14')][_0x8d39('0x19')]));}process['kill'](_0x401cfd[_0x8d39('0x14')][_0x8d39('0x19')],_0x8d39('0x1a'));return _0x432033[_0x8d39('0xa')](0xc8)[_0x8d39('0xf')]({'message':util[_0x8d39('0x12')](_0x8d39('0x1b'),_0x401cfd[_0x8d39('0x14')][_0x8d39('0x19')])});})['catch'](handleError(_0x432033,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index ed9f299..0ec559f 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 _0x9ffd=['/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','get','index'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4bddb3,_0x484288){_0x4bddb3=_0x4bddb3-0x0;var _0x155bf8=_0x9ffd[_0x4bddb3];return _0x155bf8;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0xd')]('/',auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router[_0xd9ff('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x10')]);module[_0xd9ff('0x11')]=router; \ No newline at end of file +var _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x28094e,_0x177dea){var _0x391994=function(_0x5a9b1a){while(--_0x5a9b1a){_0x28094e['push'](_0x28094e['shift']());}};_0x391994(++_0x177dea);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0x5eb8[_0x19ef2b];return _0x4df537;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['put'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index e11acbe..67cdcbd 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 _0x6f8b=['name','#0091EA','sequelize','exports','STRING'];(function(_0x94c1c5,_0x405600){var _0x25e40f=function(_0xd02b2f){while(--_0xd02b2f){_0x94c1c5['push'](_0x94c1c5['shift']());}};_0x25e40f(++_0x405600);}(_0x6f8b,0xa7));var _0xb6f8=function(_0x110397,_0x56c16e){_0x110397=_0x110397-0x0;var _0x388d9c=_0x6f8b[_0x110397];return _0x388d9c;};'use strict';var Sequelize=require(_0xb6f8('0x0'));module[_0xb6f8('0x1')]={'name':{'type':Sequelize[_0xb6f8('0x2')],'unique':_0xb6f8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb6f8('0x2')],'defaultValue':_0xb6f8('0x4')},'description':{'type':Sequelize[_0xb6f8('0x2')]}}; \ No newline at end of file +var _0x08d1=['exports','#0091EA','STRING','sequelize'];(function(_0x3ab5bd,_0x85273b){var _0x4a505c=function(_0xe64acd){while(--_0xe64acd){_0x3ab5bd['push'](_0x3ab5bd['shift']());}};_0x4a505c(++_0x85273b);}(_0x08d1,0xeb));var _0x108d=function(_0x5f2c75,_0x189d3f){_0x5f2c75=_0x5f2c75-0x0;var _0x3fa924=_0x08d1[_0x5f2c75];return _0x3fa924;};'use strict';var Sequelize=require(_0x108d('0x0'));module[_0x108d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x108d('0x2')},'description':{'type':Sequelize[_0x108d('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4eb846b..39a64fa 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 _0x8756=['filters','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','Tag','findAll','rows','catch','params','length','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','get','Tags','UserProfileResource','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','order','sort'];(function(_0x410ba1,_0xd00a96){var _0x2a425e=function(_0x190622){while(--_0x190622){_0x410ba1['push'](_0x410ba1['shift']());}};_0x2a425e(++_0xd00a96);}(_0x8756,0xc2));var _0x6875=function(_0x5a8dcb,_0x3d8c69){_0x5a8dcb=_0x5a8dcb-0x0;var _0x4ed049=_0x8756[_0x5a8dcb];return _0x4ed049;};'use strict';var pdf=require(_0x6875('0x0'));var emlformat=require(_0x6875('0x1'));var rimraf=require(_0x6875('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6875('0x3'));var rp=require(_0x6875('0x4'));var moment=require(_0x6875('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6875('0x6'));var util=require(_0x6875('0x7'));var path=require(_0x6875('0x8'));var sox=require(_0x6875('0x9'));var csv=require(_0x6875('0xa'));var ejs=require(_0x6875('0xb'));var fs=require('fs');var _=require(_0x6875('0xc'));var squel=require(_0x6875('0xd'));var crypto=require(_0x6875('0xe'));var jsforce=require(_0x6875('0xf'));var deskjs=require(_0x6875('0x10'));var toCsv=require(_0x6875('0xa'));var querystring=require(_0x6875('0x11'));var Papa=require(_0x6875('0x12'));var Redis=require(_0x6875('0x13'));var authService=require(_0x6875('0x14'));var qs=require(_0x6875('0x15'));var hardwareService=require(_0x6875('0x16'));var logger=require(_0x6875('0x17'))(_0x6875('0x18'));var utils=require(_0x6875('0x19'));var config=require(_0x6875('0x1a'));var db=require(_0x6875('0x1b'))['db'];function respondWithStatusCode(_0x143717,_0x5b6520){_0x5b6520=_0x5b6520||0xcc;return function(_0x3ce663){if(_0x3ce663){return _0x143717['sendStatus'](_0x5b6520);}return _0x143717[_0x6875('0x1c')](_0x5b6520)[_0x6875('0x1d')]();};}function respondWithResult(_0x28e55a,_0x428c65){_0x428c65=_0x428c65||0xc8;return function(_0x4e1792){if(_0x4e1792){return _0x28e55a['status'](_0x428c65)[_0x6875('0x1e')](_0x4e1792);}};}function respondWithFilteredResult(_0x26db6d,_0x46b519){return function(_0x2e8b32){if(_0x2e8b32){var _0x56474d=_0x2e8b32[_0x6875('0x1f')],_0x5473db=_0x46b519[_0x6875('0x20')],_0xade476=_0x46b519[_0x6875('0x20')]+_0x46b519[_0x6875('0x21')],_0xf38915;if(_0xade476>=_0x56474d){_0xade476=_0x56474d;_0xf38915=0xc8;}else{_0xf38915=0xce;}_0x26db6d[_0x6875('0x1c')](_0xf38915);return _0x26db6d[_0x6875('0x22')]('Content-Range',_0x5473db+'-'+_0xade476+'/'+_0x56474d)[_0x6875('0x1e')](_0x2e8b32);}return null;};}function patchUpdates(_0x2b7ba){return function(_0x405c95){try{jsonpatch[_0x6875('0x23')](_0x405c95,_0x2b7ba,!![]);}catch(_0x5d32a5){return BPromise[_0x6875('0x24')](_0x5d32a5);}return _0x405c95['save']();};}function saveUpdates(_0x26fb03,_0x4cf88c){return function(_0x4d298f){if(_0x4d298f){return _0x4d298f[_0x6875('0x25')](_0x26fb03)[_0x6875('0x26')](function(_0x5bb6d0){return _0x5bb6d0;});}return null;};}function removeEntity(_0x404526,_0x264bc5){return function(_0x34a550){if(_0x34a550){return _0x34a550['destroy']()[_0x6875('0x26')](function(){var _0x2c2af1=_0x34a550[_0x6875('0x27')]({'plain':!![]});var _0x3e3699=_0x6875('0x28');return db[_0x6875('0x29')][_0x6875('0x2a')]({'where':{'type':_0x3e3699,'resourceId':_0x2c2af1['id']}})[_0x6875('0x26')](function(){return _0x34a550;});})[_0x6875('0x26')](function(){_0x404526['status'](0xcc)[_0x6875('0x1d')]();});}};}function handleEntityNotFound(_0x49ca2f,_0xed604e){return function(_0x211fab){if(!_0x211fab){_0x49ca2f[_0x6875('0x2b')](0x194);}return _0x211fab;};}function handleError(_0x352024,_0x39c586){_0x39c586=_0x39c586||0x1f4;return function(_0x1c9cbf){logger[_0x6875('0x2c')](_0x1c9cbf['stack']);if(_0x1c9cbf['name']){delete _0x1c9cbf[_0x6875('0x2d')];}_0x352024[_0x6875('0x1c')](_0x39c586)[_0x6875('0x2e')](_0x1c9cbf);};}exports[_0x6875('0x2f')]=function(_0x32dfd6,_0x277ce3){var _0x4dfa14={},_0x37b2c1={},_0x3d41d1={'count':0x0,'rows':[]};var _0x49b7a0=db['Tag'][_0x6875('0x30')];_0x37b2c1[_0x6875('0x31')]=_[_0x6875('0x32')](_0x49b7a0);_0x37b2c1['query']=_[_0x6875('0x32')](_0x32dfd6['query']);_0x37b2c1['filters']=_['intersection'](_0x37b2c1[_0x6875('0x31')],_0x37b2c1[_0x6875('0x33')]);_0x4dfa14[_0x6875('0x34')]=_[_0x6875('0x35')](_0x37b2c1[_0x6875('0x31')],qs[_0x6875('0x36')](_0x32dfd6['query'][_0x6875('0x36')]));_0x4dfa14['attributes']=_0x4dfa14[_0x6875('0x34')]['length']?_0x4dfa14[_0x6875('0x34')]:_0x37b2c1['model'];if(!_0x32dfd6[_0x6875('0x33')]['hasOwnProperty'](_0x6875('0x37'))){_0x4dfa14[_0x6875('0x21')]=qs[_0x6875('0x21')](_0x32dfd6[_0x6875('0x33')][_0x6875('0x21')]);_0x4dfa14[_0x6875('0x20')]=qs[_0x6875('0x20')](_0x32dfd6[_0x6875('0x33')]['offset']);}_0x4dfa14[_0x6875('0x38')]=qs[_0x6875('0x39')](_0x32dfd6[_0x6875('0x33')][_0x6875('0x39')]);_0x4dfa14['where']=qs[_0x6875('0x3a')](_[_0x6875('0x3b')](_0x32dfd6['query'],_0x37b2c1[_0x6875('0x3a')]));if(_0x32dfd6[_0x6875('0x33')][_0x6875('0x3c')]){_0x4dfa14[_0x6875('0x3d')]=_[_0x6875('0x3e')](_0x4dfa14[_0x6875('0x3d')],{'$or':_[_0x6875('0x3f')](_0x49b7a0,function(_0x1eac59){if(_0x1eac59[_0x6875('0x40')]['key']!==_0x6875('0x41')){var _0x5775ea={};_0x5775ea[_0x1eac59[_0x6875('0x42')]]={'$like':'%'+_0x32dfd6[_0x6875('0x33')]['filter']+'%'};return _0x5775ea;}})});}_0x4dfa14=_[_0x6875('0x3e')]({},_0x4dfa14,_0x32dfd6[_0x6875('0x43')]);var _0x55d750={'where':_0x4dfa14[_0x6875('0x3d')]};return db['Tag']['count'](_0x55d750)[_0x6875('0x26')](function(_0x32cff0){_0x3d41d1[_0x6875('0x1f')]=_0x32cff0;if(_0x32dfd6[_0x6875('0x33')][_0x6875('0x44')]){_0x4dfa14[_0x6875('0x45')]=[{'all':!![]}];}return db[_0x6875('0x46')][_0x6875('0x47')](_0x4dfa14);})['then'](function(_0x2b02dd){_0x3d41d1[_0x6875('0x48')]=_0x2b02dd;return _0x3d41d1;})[_0x6875('0x26')](respondWithFilteredResult(_0x277ce3,_0x4dfa14))[_0x6875('0x49')](handleError(_0x277ce3,null));};exports['show']=function(_0x4ce06d,_0x562d91){var _0x576c32={'raw':!![],'where':{'id':_0x4ce06d[_0x6875('0x4a')]['id']}},_0x531e93={};_0x531e93[_0x6875('0x31')]=_[_0x6875('0x32')](db[_0x6875('0x46')][_0x6875('0x30')]);_0x531e93[_0x6875('0x33')]=_['keys'](_0x4ce06d[_0x6875('0x33')]);_0x531e93[_0x6875('0x3a')]=_[_0x6875('0x35')](_0x531e93['model'],_0x531e93[_0x6875('0x33')]);_0x576c32[_0x6875('0x34')]=_[_0x6875('0x35')](_0x531e93[_0x6875('0x31')],qs['fields'](_0x4ce06d['query'][_0x6875('0x36')]));_0x576c32[_0x6875('0x34')]=_0x576c32[_0x6875('0x34')][_0x6875('0x4b')]?_0x576c32[_0x6875('0x34')]:_0x531e93[_0x6875('0x31')];if(_0x4ce06d[_0x6875('0x33')][_0x6875('0x44')]){_0x576c32[_0x6875('0x45')]=[{'all':!![]}];}_0x576c32=_[_0x6875('0x3e')]({},_0x576c32,_0x4ce06d[_0x6875('0x43')]);return db['Tag'][_0x6875('0x4c')](_0x576c32)[_0x6875('0x26')](handleEntityNotFound(_0x562d91,null))[_0x6875('0x26')](respondWithResult(_0x562d91,null))[_0x6875('0x49')](handleError(_0x562d91,null));};exports[_0x6875('0x4d')]=function(_0x1b522c,_0x4a5de3){return db['Tag'][_0x6875('0x4d')](_0x1b522c['body'],{})[_0x6875('0x26')](function(_0x3acbc8){var _0x30d340=_0x1b522c[_0x6875('0x4e')][_0x6875('0x27')]({'plain':!![]});if(!_0x30d340)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30d340[_0x6875('0x4f')]===_0x6875('0x4e')){var _0x29c147=_0x3acbc8[_0x6875('0x27')]({'plain':!![]});var _0x303542=_0x6875('0x28');return db[_0x6875('0x50')][_0x6875('0x4c')]({'where':{'name':_0x303542,'userProfileId':_0x30d340[_0x6875('0x51')]},'raw':!![]})[_0x6875('0x26')](function(_0x21566c){if(_0x21566c&&_0x21566c[_0x6875('0x52')]===0x0){return db['UserProfileResource'][_0x6875('0x4d')]({'name':_0x29c147[_0x6875('0x2d')],'resourceId':_0x29c147['id'],'type':_0x21566c['name'],'sectionId':_0x21566c['id']},{})[_0x6875('0x26')](function(){return _0x3acbc8;});}else{return _0x3acbc8;}})[_0x6875('0x49')](function(_0x15665e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15665e);throw _0x15665e;});}return _0x3acbc8;})[_0x6875('0x26')](respondWithResult(_0x4a5de3,0xc9))['catch'](handleError(_0x4a5de3,null));};exports[_0x6875('0x25')]=function(_0x6113bf,_0x422b3e){if(_0x6113bf['body']['id']){delete _0x6113bf[_0x6875('0x53')]['id'];}return db[_0x6875('0x46')][_0x6875('0x4c')]({'where':{'id':_0x6113bf[_0x6875('0x4a')]['id']}})[_0x6875('0x26')](handleEntityNotFound(_0x422b3e,null))[_0x6875('0x26')](saveUpdates(_0x6113bf[_0x6875('0x53')],null))['then'](respondWithResult(_0x422b3e,null))[_0x6875('0x49')](handleError(_0x422b3e,null));};exports[_0x6875('0x2a')]=function(_0x918325,_0x2121a4){return db[_0x6875('0x46')]['find']({'where':{'id':_0x918325[_0x6875('0x4a')]['id']}})[_0x6875('0x26')](handleEntityNotFound(_0x2121a4,null))['then'](removeEntity(_0x2121a4,null))[_0x6875('0x49')](handleError(_0x2121a4,null));}; \ No newline at end of file +var _0xb066=['params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Tags','UserProfileResource','sendStatus','error','name','send','Tag','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','options','include','findAll','catch','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x13a73a,_0x46cf87){var _0x32949b=function(_0x1f7ab2){while(--_0x1f7ab2){_0x13a73a['push'](_0x13a73a['shift']());}};_0x32949b(++_0x46cf87);}(_0xb066,0x1c9));var _0x6b06=function(_0x2b9db7,_0x3905fc){_0x2b9db7=_0x2b9db7-0x0;var _0x2e44db=_0xb066[_0x2b9db7];return _0x2e44db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6b06('0x0'));var rimraf=require(_0x6b06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b06('0x2'));var moment=require(_0x6b06('0x3'));var BPromise=require(_0x6b06('0x4'));var Mustache=require(_0x6b06('0x5'));var util=require(_0x6b06('0x6'));var path=require(_0x6b06('0x7'));var sox=require(_0x6b06('0x8'));var csv=require(_0x6b06('0x9'));var ejs=require(_0x6b06('0xa'));var fs=require('fs');var _=require(_0x6b06('0xb'));var squel=require('squel');var crypto=require(_0x6b06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b06('0x9'));var querystring=require(_0x6b06('0xd'));var Papa=require(_0x6b06('0xe'));var Redis=require('ioredis');var authService=require(_0x6b06('0xf'));var qs=require(_0x6b06('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b06('0x11'))(_0x6b06('0x12'));var utils=require(_0x6b06('0x13'));var config=require(_0x6b06('0x14'));var db=require(_0x6b06('0x15'))['db'];function respondWithStatusCode(_0x415df5,_0x5af4b3){_0x5af4b3=_0x5af4b3||0xcc;return function(_0xeccd10){if(_0xeccd10){return _0x415df5['sendStatus'](_0x5af4b3);}return _0x415df5[_0x6b06('0x16')](_0x5af4b3)[_0x6b06('0x17')]();};}function respondWithResult(_0x123da8,_0x3743b5){_0x3743b5=_0x3743b5||0xc8;return function(_0x24c833){if(_0x24c833){return _0x123da8[_0x6b06('0x16')](_0x3743b5)[_0x6b06('0x18')](_0x24c833);}};}function respondWithFilteredResult(_0x49540d,_0x9c5c6f){return function(_0x23e93f){if(_0x23e93f){var _0x485024=_0x23e93f[_0x6b06('0x19')],_0x4ccd87=_0x9c5c6f[_0x6b06('0x1a')],_0x33907c=_0x9c5c6f[_0x6b06('0x1a')]+_0x9c5c6f[_0x6b06('0x1b')],_0x1a48a2;if(_0x33907c>=_0x485024){_0x33907c=_0x485024;_0x1a48a2=0xc8;}else{_0x1a48a2=0xce;}_0x49540d['status'](_0x1a48a2);return _0x49540d['set'](_0x6b06('0x1c'),_0x4ccd87+'-'+_0x33907c+'/'+_0x485024)[_0x6b06('0x18')](_0x23e93f);}return null;};}function patchUpdates(_0x401107){return function(_0xde5737){try{jsonpatch[_0x6b06('0x1d')](_0xde5737,_0x401107,!![]);}catch(_0x516f4e){return BPromise[_0x6b06('0x1e')](_0x516f4e);}return _0xde5737[_0x6b06('0x1f')]();};}function saveUpdates(_0x5765d3,_0x4b2bc8){return function(_0x172a7f){if(_0x172a7f){return _0x172a7f[_0x6b06('0x20')](_0x5765d3)['then'](function(_0x1ac4c1){return _0x1ac4c1;});}return null;};}function removeEntity(_0x3c692d,_0x985f21){return function(_0x545ebf){if(_0x545ebf){return _0x545ebf[_0x6b06('0x21')]()[_0x6b06('0x22')](function(){var _0x49b388=_0x545ebf[_0x6b06('0x23')]({'plain':!![]});var _0x235290=_0x6b06('0x24');return db[_0x6b06('0x25')][_0x6b06('0x21')]({'where':{'type':_0x235290,'resourceId':_0x49b388['id']}})[_0x6b06('0x22')](function(){return _0x545ebf;});})[_0x6b06('0x22')](function(){_0x3c692d[_0x6b06('0x16')](0xcc)[_0x6b06('0x17')]();});}};}function handleEntityNotFound(_0x18796a,_0x592565){return function(_0x2a1e55){if(!_0x2a1e55){_0x18796a[_0x6b06('0x26')](0x194);}return _0x2a1e55;};}function handleError(_0xa7b039,_0x2cfbe7){_0x2cfbe7=_0x2cfbe7||0x1f4;return function(_0x49bb29){logger[_0x6b06('0x27')](_0x49bb29['stack']);if(_0x49bb29[_0x6b06('0x28')]){delete _0x49bb29[_0x6b06('0x28')];}_0xa7b039['status'](_0x2cfbe7)[_0x6b06('0x29')](_0x49bb29);};}exports['index']=function(_0x59a568,_0x2dd344){var _0x1bc98e={},_0x5c9b62={},_0x205083={'count':0x0,'rows':[]};var _0x41dccf=db[_0x6b06('0x2a')]['rawAttributes'];_0x5c9b62[_0x6b06('0x2b')]=_['keys'](_0x41dccf);_0x5c9b62[_0x6b06('0x2c')]=_[_0x6b06('0x2d')](_0x59a568[_0x6b06('0x2c')]);_0x5c9b62[_0x6b06('0x2e')]=_[_0x6b06('0x2f')](_0x5c9b62[_0x6b06('0x2b')],_0x5c9b62[_0x6b06('0x2c')]);_0x1bc98e[_0x6b06('0x30')]=_[_0x6b06('0x2f')](_0x5c9b62[_0x6b06('0x2b')],qs['fields'](_0x59a568['query'][_0x6b06('0x31')]));_0x1bc98e[_0x6b06('0x30')]=_0x1bc98e[_0x6b06('0x30')]['length']?_0x1bc98e[_0x6b06('0x30')]:_0x5c9b62[_0x6b06('0x2b')];if(!_0x59a568[_0x6b06('0x2c')][_0x6b06('0x32')](_0x6b06('0x33'))){_0x1bc98e['limit']=qs[_0x6b06('0x1b')](_0x59a568[_0x6b06('0x2c')][_0x6b06('0x1b')]);_0x1bc98e[_0x6b06('0x1a')]=qs[_0x6b06('0x1a')](_0x59a568[_0x6b06('0x2c')][_0x6b06('0x1a')]);}_0x1bc98e[_0x6b06('0x34')]=qs[_0x6b06('0x35')](_0x59a568['query']['sort']);_0x1bc98e[_0x6b06('0x36')]=qs['filters'](_[_0x6b06('0x37')](_0x59a568['query'],_0x5c9b62[_0x6b06('0x2e')]));if(_0x59a568[_0x6b06('0x2c')][_0x6b06('0x38')]){_0x1bc98e[_0x6b06('0x36')]=_['merge'](_0x1bc98e[_0x6b06('0x36')],{'$or':_['map'](_0x41dccf,function(_0x2dfefe){if(_0x2dfefe[_0x6b06('0x39')][_0x6b06('0x3a')]!==_0x6b06('0x3b')){var _0x331f20={};_0x331f20[_0x2dfefe['field']]={'$like':'%'+_0x59a568[_0x6b06('0x2c')][_0x6b06('0x38')]+'%'};return _0x331f20;}})});}_0x1bc98e=_['merge']({},_0x1bc98e,_0x59a568[_0x6b06('0x3c')]);var _0x293ae8={'where':_0x1bc98e[_0x6b06('0x36')]};return db[_0x6b06('0x2a')][_0x6b06('0x19')](_0x293ae8)[_0x6b06('0x22')](function(_0x25992a){_0x205083[_0x6b06('0x19')]=_0x25992a;if(_0x59a568[_0x6b06('0x2c')]['includeAll']){_0x1bc98e[_0x6b06('0x3d')]=[{'all':!![]}];}return db[_0x6b06('0x2a')][_0x6b06('0x3e')](_0x1bc98e);})[_0x6b06('0x22')](function(_0x575856){_0x205083['rows']=_0x575856;return _0x205083;})['then'](respondWithFilteredResult(_0x2dd344,_0x1bc98e))[_0x6b06('0x3f')](handleError(_0x2dd344,null));};exports['show']=function(_0x4d323c,_0x4a48a1){var _0x34ecef={'raw':!![],'where':{'id':_0x4d323c['params']['id']}},_0x58379d={};_0x58379d[_0x6b06('0x2b')]=_['keys'](db['Tag'][_0x6b06('0x40')]);_0x58379d[_0x6b06('0x2c')]=_['keys'](_0x4d323c[_0x6b06('0x2c')]);_0x58379d['filters']=_['intersection'](_0x58379d['model'],_0x58379d[_0x6b06('0x2c')]);_0x34ecef['attributes']=_['intersection'](_0x58379d['model'],qs['fields'](_0x4d323c[_0x6b06('0x2c')]['fields']));_0x34ecef[_0x6b06('0x30')]=_0x34ecef['attributes']['length']?_0x34ecef[_0x6b06('0x30')]:_0x58379d[_0x6b06('0x2b')];if(_0x4d323c[_0x6b06('0x2c')][_0x6b06('0x41')]){_0x34ecef['include']=[{'all':!![]}];}_0x34ecef=_['merge']({},_0x34ecef,_0x4d323c[_0x6b06('0x3c')]);return db['Tag']['find'](_0x34ecef)['then'](handleEntityNotFound(_0x4a48a1,null))[_0x6b06('0x22')](respondWithResult(_0x4a48a1,null))[_0x6b06('0x3f')](handleError(_0x4a48a1,null));};exports[_0x6b06('0x42')]=function(_0x59a48b,_0x47da6f){return db[_0x6b06('0x2a')]['create'](_0x59a48b[_0x6b06('0x43')],{})['then'](function(_0x54fa71){var _0x69194b=_0x59a48b['user'][_0x6b06('0x23')]({'plain':!![]});if(!_0x69194b)throw new Error(_0x6b06('0x44'));if(_0x69194b['role']===_0x6b06('0x45')){var _0x4dea69=_0x54fa71[_0x6b06('0x23')]({'plain':!![]});var _0x4716c0=_0x6b06('0x24');return db[_0x6b06('0x46')]['find']({'where':{'name':_0x4716c0,'userProfileId':_0x69194b[_0x6b06('0x47')]},'raw':!![]})[_0x6b06('0x22')](function(_0x3a820e){if(_0x3a820e&&_0x3a820e[_0x6b06('0x48')]===0x0){return db[_0x6b06('0x25')][_0x6b06('0x42')]({'name':_0x4dea69[_0x6b06('0x28')],'resourceId':_0x4dea69['id'],'type':_0x3a820e[_0x6b06('0x28')],'sectionId':_0x3a820e['id']},{})['then'](function(){return _0x54fa71;});}else{return _0x54fa71;}})['catch'](function(_0x3addbb){logger[_0x6b06('0x27')](_0x6b06('0x49'),_0x3addbb);throw _0x3addbb;});}return _0x54fa71;})['then'](respondWithResult(_0x47da6f,0xc9))[_0x6b06('0x3f')](handleError(_0x47da6f,null));};exports[_0x6b06('0x20')]=function(_0x4ed8cf,_0xff3185){if(_0x4ed8cf[_0x6b06('0x43')]['id']){delete _0x4ed8cf[_0x6b06('0x43')]['id'];}return db['Tag'][_0x6b06('0x4a')]({'where':{'id':_0x4ed8cf[_0x6b06('0x4b')]['id']}})[_0x6b06('0x22')](handleEntityNotFound(_0xff3185,null))['then'](saveUpdates(_0x4ed8cf[_0x6b06('0x43')],null))[_0x6b06('0x22')](respondWithResult(_0xff3185,null))[_0x6b06('0x3f')](handleError(_0xff3185,null));};exports['destroy']=function(_0x292629,_0x596be4){return db['Tag'][_0x6b06('0x4a')]({'where':{'id':_0x292629[_0x6b06('0x4b')]['id']}})[_0x6b06('0x22')](handleEntityNotFound(_0x596be4,null))[_0x6b06('0x22')](removeEntity(_0x596be4,null))[_0x6b06('0x3f')](handleError(_0x596be4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 19d54cb..1521752 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 _0x4074=['tools_tags','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','Tag'];(function(_0x26da12,_0xbe7135){var _0x8d1bb1=function(_0x203b89){while(--_0x203b89){_0x26da12['push'](_0x26da12['shift']());}};_0x8d1bb1(++_0xbe7135);}(_0x4074,0x1a5));var _0x4407=function(_0x25828d,_0xdda70e){_0x25828d=_0x25828d-0x0;var _0x2288ff=_0x4074[_0x25828d];return _0x2288ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4407('0x0'))(_0x4407('0x1'));var moment=require(_0x4407('0x2'));var BPromise=require('bluebird');var rp=require(_0x4407('0x3'));var fs=require('fs');var path=require(_0x4407('0x4'));var rimraf=require(_0x4407('0x5'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x4407('0x6')]=function(_0x542ee3,_0x3b8331){return _0x542ee3[_0x4407('0x7')](_0x4407('0x8'),attributes,{'tableName':_0x4407('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x254f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Tag','lodash'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x254f,0x18b));var _0xf254=function(_0x3f2904,_0x148340){_0x3f2904=_0x3f2904-0x0;var _0x161d06=_0x254f[_0x3f2904];return _0x161d06;};'use strict';var _=require(_0xf254('0x0'));var util=require('util');var logger=require(_0xf254('0x1'))(_0xf254('0x2'));var moment=require(_0xf254('0x3'));var BPromise=require(_0xf254('0x4'));var rp=require(_0xf254('0x5'));var fs=require('fs');var path=require(_0xf254('0x6'));var rimraf=require('rimraf');var config=require(_0xf254('0x7'));var attributes=require('./tag.attributes');module[_0xf254('0x8')]=function(_0x53218d,_0x5b01ad){return _0x53218d[_0xf254('0x9')](_0xf254('0xa'),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 9b73a0c..f49640d 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 _0x9ec6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Tag,\x20%s,\x20%s,\x20%s','error','message','Tag,\x20%s,\x20%s','request\x20sent','result','catch','bluebird','randomstring'];(function(_0x3a7941,_0x55edac){var _0x1aa996=function(_0x3a3d50){while(--_0x3a3d50){_0x3a7941['push'](_0x3a7941['shift']());}};_0x1aa996(++_0x55edac);}(_0x9ec6,0x1c0));var _0x69ec=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x9ec6[_0x3a6efd];return _0x487b9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x69ec('0x0'));var rs=require(_0x69ec('0x1'));var fs=require('fs');var Redis=require(_0x69ec('0x2'));var db=require(_0x69ec('0x3'))['db'];var utils=require(_0x69ec('0x4'));var logger=require('../../config/logger')(_0x69ec('0x5'));var config=require(_0x69ec('0x6'));var jayson=require(_0x69ec('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44a4fa,_0x573da6,_0xcd71fe){return new BPromise(function(_0x4e9b7b,_0x5cdba9){return client[_0x69ec('0x8')](_0x44a4fa,_0xcd71fe)[_0x69ec('0x9')](function(_0x34238a){logger[_0x69ec('0xa')]('Tag,\x20%s,\x20%s',_0x573da6,'request\x20sent');logger['debug'](_0x69ec('0xb'),_0x573da6,'request\x20sent',JSON['stringify'](_0x34238a));if(_0x34238a[_0x69ec('0xc')]){if(_0x34238a[_0x69ec('0xc')]['code']===0x1f4){logger[_0x69ec('0xc')]('Tag,\x20%s,\x20%s',_0x573da6,_0x34238a['error'][_0x69ec('0xd')]);return _0x5cdba9(_0x34238a[_0x69ec('0xc')][_0x69ec('0xd')]);}logger[_0x69ec('0xc')]('Tag,\x20%s,\x20%s',_0x573da6,_0x34238a[_0x69ec('0xc')][_0x69ec('0xd')]);return _0x4e9b7b(_0x34238a[_0x69ec('0xc')][_0x69ec('0xd')]);}else{logger[_0x69ec('0xa')](_0x69ec('0xe'),_0x573da6,_0x69ec('0xf'));_0x4e9b7b(_0x34238a[_0x69ec('0x10')][_0x69ec('0xd')]);}})[_0x69ec('0x11')](function(_0x250124){logger[_0x69ec('0xc')](_0x69ec('0xe'),_0x573da6,_0x250124);_0x5cdba9(_0x250124);});});} \ No newline at end of file +var _0xb2d8=['jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x148e58,_0x3160a2){var _0x13f183=function(_0x4d1ec0){while(--_0x4d1ec0){_0x148e58['push'](_0x148e58['shift']());}};_0x13f183(++_0x3160a2);}(_0xb2d8,0x138));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8b2d('0x0'));var util=require(_0x8b2d('0x1'));var moment=require(_0x8b2d('0x2'));var BPromise=require(_0x8b2d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b2d('0x4'));var db=require(_0x8b2d('0x5'))['db'];var utils=require(_0x8b2d('0x6'));var logger=require(_0x8b2d('0x7'))(_0x8b2d('0x8'));var config=require(_0x8b2d('0x9'));var jayson=require(_0x8b2d('0xa'));var client=jayson['client'][_0x8b2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f5308,_0x35c9ab,_0x7223d1){return new BPromise(function(_0x13fc7a,_0x12397f){return client[_0x8b2d('0xc')](_0x1f5308,_0x7223d1)[_0x8b2d('0xd')](function(_0x43e53d){logger[_0x8b2d('0xe')](_0x8b2d('0xf'),_0x35c9ab,_0x8b2d('0x10'));logger[_0x8b2d('0x11')](_0x8b2d('0x12'),_0x35c9ab,'request\x20sent',JSON['stringify'](_0x43e53d));if(_0x43e53d[_0x8b2d('0x13')]){if(_0x43e53d['error']['code']===0x1f4){logger[_0x8b2d('0x13')](_0x8b2d('0xf'),_0x35c9ab,_0x43e53d[_0x8b2d('0x13')][_0x8b2d('0x14')]);return _0x12397f(_0x43e53d[_0x8b2d('0x13')][_0x8b2d('0x14')]);}logger[_0x8b2d('0x13')](_0x8b2d('0xf'),_0x35c9ab,_0x43e53d['error'][_0x8b2d('0x14')]);return _0x13fc7a(_0x43e53d[_0x8b2d('0x13')]['message']);}else{logger[_0x8b2d('0xe')](_0x8b2d('0xf'),_0x35c9ab,_0x8b2d('0x10'));_0x13fc7a(_0x43e53d[_0x8b2d('0x15')]['message']);}})[_0x8b2d('0x16')](function(_0xd57800){logger[_0x8b2d('0x13')]('Tag,\x20%s,\x20%s',_0x35c9ab,_0xd57800);_0x12397f(_0xd57800);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 8df3e35..06bf0ce 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 _0x2c65=['addQueues','addAgents','put','/:id','destroy','delete','removeAgents','multer','util','path','Router','../../components/interaction/service','../../config/environment','./team.controller','get','index','show','/:id/queues','isAuthenticated','/:id/users','getAgents','post'];(function(_0x58af6f,_0x58eb00){var _0x1ff163=function(_0x26190e){while(--_0x26190e){_0x58af6f['push'](_0x58af6f['shift']());}};_0x1ff163(++_0x58eb00);}(_0x2c65,0x1a9));var _0x52c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c65[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x52c6('0x0'));var util=require(_0x52c6('0x1'));var path=require(_0x52c6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x52c6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x52c6('0x4'));var config=require(_0x52c6('0x5'));var controller=require(_0x52c6('0x6'));router[_0x52c6('0x7')]('/',auth['isAuthenticated'](),controller[_0x52c6('0x8')]);router[_0x52c6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x52c6('0x9')]);router[_0x52c6('0x7')](_0x52c6('0xa'),auth[_0x52c6('0xb')](),controller['getQueues']);router[_0x52c6('0x7')](_0x52c6('0xc'),auth[_0x52c6('0xb')](),controller[_0x52c6('0xd')]);router[_0x52c6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52c6('0xe')]('/:id/queues',auth[_0x52c6('0xb')](),controller[_0x52c6('0xf')]);router[_0x52c6('0xe')](_0x52c6('0xc'),auth['isAuthenticated'](),controller[_0x52c6('0x10')]);router[_0x52c6('0x11')](_0x52c6('0x12'),auth[_0x52c6('0xb')](),controller['update']);router['delete']('/:id',auth[_0x52c6('0xb')](),controller[_0x52c6('0x13')]);router[_0x52c6('0x14')](_0x52c6('0xa'),auth[_0x52c6('0xb')](),controller['removeQueues']);router[_0x52c6('0x14')](_0x52c6('0xc'),auth['isAuthenticated'](),controller[_0x52c6('0x15')]);module['exports']=router; \ No newline at end of file +var _0x71cf=['../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','getQueues','/:id/users','post','create','/:id/queues','addQueues','addAgents','update','destroy','delete','removeQueues','util','path','express','Router'];(function(_0x5b4504,_0x3a4927){var _0x2bc732=function(_0x12f6ca){while(--_0x12f6ca){_0x5b4504['push'](_0x5b4504['shift']());}};_0x2bc732(++_0x3a4927);}(_0x71cf,0xf9));var _0xf71c=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x71cf[_0x4d7a70];return _0x3aafbb;};'use strict';var multer=require('multer');var util=require(_0xf71c('0x0'));var path=require(_0xf71c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf71c('0x2'));var router=express[_0xf71c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf71c('0x4'));var config=require(_0xf71c('0x5'));var controller=require(_0xf71c('0x6'));router[_0xf71c('0x7')]('/',auth[_0xf71c('0x8')](),controller[_0xf71c('0x9')]);router[_0xf71c('0x7')](_0xf71c('0xa'),auth[_0xf71c('0x8')](),controller[_0xf71c('0xb')]);router[_0xf71c('0x7')]('/:id/queues',auth[_0xf71c('0x8')](),controller[_0xf71c('0xc')]);router[_0xf71c('0x7')](_0xf71c('0xd'),auth[_0xf71c('0x8')](),controller['getAgents']);router[_0xf71c('0xe')]('/',auth[_0xf71c('0x8')](),controller[_0xf71c('0xf')]);router[_0xf71c('0xe')](_0xf71c('0x10'),auth[_0xf71c('0x8')](),controller[_0xf71c('0x11')]);router[_0xf71c('0xe')](_0xf71c('0xd'),auth[_0xf71c('0x8')](),controller[_0xf71c('0x12')]);router['put']('/:id',auth[_0xf71c('0x8')](),controller[_0xf71c('0x13')]);router['delete'](_0xf71c('0xa'),auth[_0xf71c('0x8')](),controller[_0xf71c('0x14')]);router[_0xf71c('0x15')](_0xf71c('0x10'),auth[_0xf71c('0x8')](),controller[_0xf71c('0x16')]);router['delete']('/:id/users',auth[_0xf71c('0x8')](),controller['removeAgents']);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 53ce426..b84e2ee 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 _0xf009=['name','sequelize','exports','STRING'];(function(_0x3e152b,_0x1979db){var _0x9b78ab=function(_0x2d7d08){while(--_0x2d7d08){_0x3e152b['push'](_0x3e152b['shift']());}};_0x9b78ab(++_0x1979db);}(_0xf009,0xed));var _0x9f00=function(_0xb96f50,_0xa21d9b){_0xb96f50=_0xb96f50-0x0;var _0x1caf5d=_0xf009[_0xb96f50];return _0x1caf5d;};'use strict';var Sequelize=require(_0x9f00('0x0'));module[_0x9f00('0x1')]={'name':{'type':Sequelize[_0x9f00('0x2')],'allowNull':![],'unique':_0x9f00('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a96=['sequelize','STRING','name'];(function(_0x1ff1b0,_0x5ad623){var _0x5b774e=function(_0x26a489){while(--_0x26a489){_0x1ff1b0['push'](_0x1ff1b0['shift']());}};_0x5b774e(++_0x5ad623);}(_0x4a96,0x117));var _0x64a9=function(_0x3a2d75,_0x30636d){_0x3a2d75=_0x3a2d75-0x0;var _0x87ca32=_0x4a96[_0x3a2d75];return _0x87ca32;};'use strict';var Sequelize=require(_0x64a9('0x0'));module['exports']={'name':{'type':Sequelize[_0x64a9('0x1')],'allowNull':![],'unique':_0x64a9('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index d0ab86c..c4e9be2 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 _0xedb8=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Teams','UserProfileResource','error','name','send','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','filters','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','length','pick','toLowerCase','Queues','addQueues','isValidChannel','Sequelize','ids','removeQueues','remove','addAgents','Mail','Sms','Fax','Openchannel','User','interface','each','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','omit','spread','userTeam:save','removeAgents','voice','chat','mail','sms','fax','isArray','userTeam:remove','emit','getAgents','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x37f957,_0x3e70a0){var _0x34d611=function(_0x17e159){while(--_0x17e159){_0x37f957['push'](_0x37f957['shift']());}};_0x34d611(++_0x3e70a0);}(_0xedb8,0x104));var _0x8edb=function(_0x2e997e,_0x4edf31){_0x2e997e=_0x2e997e-0x0;var _0x5a6cb1=_0xedb8[_0x2e997e];return _0x5a6cb1;};'use strict';var pdf=require(_0x8edb('0x0'));var emlformat=require(_0x8edb('0x1'));var rimraf=require(_0x8edb('0x2'));var zipdir=require(_0x8edb('0x3'));var jsonpatch=require(_0x8edb('0x4'));var rp=require(_0x8edb('0x5'));var moment=require(_0x8edb('0x6'));var BPromise=require(_0x8edb('0x7'));var Mustache=require(_0x8edb('0x8'));var util=require(_0x8edb('0x9'));var path=require(_0x8edb('0xa'));var sox=require(_0x8edb('0xb'));var csv=require('to-csv');var ejs=require(_0x8edb('0xc'));var fs=require('fs');var _=require(_0x8edb('0xd'));var squel=require(_0x8edb('0xe'));var crypto=require(_0x8edb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8edb('0x10'));var toCsv=require(_0x8edb('0x11'));var querystring=require('querystring');var Papa=require(_0x8edb('0x12'));var Redis=require(_0x8edb('0x13'));var authService=require(_0x8edb('0x14'));var qs=require(_0x8edb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8edb('0x16'))(_0x8edb('0x17'));var utils=require('../../config/utils');var config=require(_0x8edb('0x18'));var db=require(_0x8edb('0x19'))['db'];config[_0x8edb('0x1a')]=_[_0x8edb('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8edb('0x1c'))(new Redis(config[_0x8edb('0x1a')]));require(_0x8edb('0x1d'))[_0x8edb('0x1e')](socket);function respondWithStatusCode(_0x43ee82,_0x51470b){_0x51470b=_0x51470b||0xcc;return function(_0x32c1f8){if(_0x32c1f8){return _0x43ee82[_0x8edb('0x1f')](_0x51470b);}return _0x43ee82[_0x8edb('0x20')](_0x51470b)[_0x8edb('0x21')]();};}function respondWithResult(_0x10da48,_0x5241dc){_0x5241dc=_0x5241dc||0xc8;return function(_0x4d3fb6){if(_0x4d3fb6){return _0x10da48['status'](_0x5241dc)['json'](_0x4d3fb6);}};}function respondWithFilteredResult(_0x1a7cd1,_0x1767e5){return function(_0xbe7669){if(_0xbe7669){var _0x3ebc43=_0xbe7669[_0x8edb('0x22')],_0xd06a32=_0x1767e5[_0x8edb('0x23')],_0x8c374d=_0x1767e5[_0x8edb('0x23')]+_0x1767e5['limit'],_0x31adb8;if(_0x8c374d>=_0x3ebc43){_0x8c374d=_0x3ebc43;_0x31adb8=0xc8;}else{_0x31adb8=0xce;}_0x1a7cd1[_0x8edb('0x20')](_0x31adb8);return _0x1a7cd1[_0x8edb('0x24')](_0x8edb('0x25'),_0xd06a32+'-'+_0x8c374d+'/'+_0x3ebc43)[_0x8edb('0x26')](_0xbe7669);}return null;};}function patchUpdates(_0x23cca6){return function(_0x1db587){try{jsonpatch[_0x8edb('0x27')](_0x1db587,_0x23cca6,!![]);}catch(_0x2e6d32){return BPromise[_0x8edb('0x28')](_0x2e6d32);}return _0x1db587[_0x8edb('0x29')]();};}function saveUpdates(_0xc87639,_0x2809c8){return function(_0x448b39){if(_0x448b39){return _0x448b39[_0x8edb('0x2a')](_0xc87639)[_0x8edb('0x2b')](function(_0xb66fa2){return _0xb66fa2;});}return null;};}function removeEntity(_0x481631,_0x44a023){return function(_0x54366a){if(_0x54366a){return _0x54366a[_0x8edb('0x2c')]()['then'](function(){var _0x44155f=_0x54366a[_0x8edb('0x2d')]({'plain':!![]});var _0x55ce18=_0x8edb('0x2e');return db[_0x8edb('0x2f')]['destroy']({'where':{'type':_0x55ce18,'resourceId':_0x44155f['id']}})[_0x8edb('0x2b')](function(){return _0x54366a;});})[_0x8edb('0x2b')](function(){_0x481631[_0x8edb('0x20')](0xcc)[_0x8edb('0x21')]();});}};}function handleEntityNotFound(_0x49fd32,_0x12782f){return function(_0x1fe063){if(!_0x1fe063){_0x49fd32[_0x8edb('0x1f')](0x194);}return _0x1fe063;};}function handleError(_0x5f66e3,_0x30ede2){_0x30ede2=_0x30ede2||0x1f4;return function(_0x144368){logger[_0x8edb('0x30')](_0x144368['stack']);if(_0x144368['name']){delete _0x144368[_0x8edb('0x31')];}_0x5f66e3[_0x8edb('0x20')](_0x30ede2)[_0x8edb('0x32')](_0x144368);};}exports[_0x8edb('0x33')]=function(_0x582ed7,_0xe6ac3){var _0x2bf607={},_0x574ebf={},_0x18b109={'count':0x0,'rows':[]};var _0x5ca797=db[_0x8edb('0x34')][_0x8edb('0x35')];_0x574ebf[_0x8edb('0x36')]=_[_0x8edb('0x37')](_0x5ca797);_0x574ebf[_0x8edb('0x38')]=_[_0x8edb('0x37')](_0x582ed7[_0x8edb('0x38')]);_0x574ebf['filters']=_[_0x8edb('0x39')](_0x574ebf[_0x8edb('0x36')],_0x574ebf[_0x8edb('0x38')]);_0x2bf607[_0x8edb('0x3a')]=_['intersection'](_0x574ebf[_0x8edb('0x36')],qs[_0x8edb('0x3b')](_0x582ed7[_0x8edb('0x38')][_0x8edb('0x3b')]));_0x2bf607[_0x8edb('0x3a')]=_0x2bf607[_0x8edb('0x3a')]['length']?_0x2bf607['attributes']:_0x574ebf['model'];if(!_0x582ed7[_0x8edb('0x38')][_0x8edb('0x3c')](_0x8edb('0x3d'))){_0x2bf607[_0x8edb('0x3e')]=qs[_0x8edb('0x3e')](_0x582ed7['query'][_0x8edb('0x3e')]);_0x2bf607[_0x8edb('0x23')]=qs[_0x8edb('0x23')](_0x582ed7['query'][_0x8edb('0x23')]);}_0x2bf607[_0x8edb('0x3f')]=qs['sort'](_0x582ed7[_0x8edb('0x38')][_0x8edb('0x40')]);_0x2bf607[_0x8edb('0x41')]=qs['filters'](_['pick'](_0x582ed7[_0x8edb('0x38')],_0x574ebf['filters']));if(_0x582ed7[_0x8edb('0x38')][_0x8edb('0x42')]){_0x2bf607[_0x8edb('0x41')]=_[_0x8edb('0x43')](_0x2bf607[_0x8edb('0x41')],{'$or':_[_0x8edb('0x44')](_0x5ca797,function(_0x443350){if(_0x443350[_0x8edb('0x45')][_0x8edb('0x46')]!==_0x8edb('0x47')){var _0x5e3b1f={};_0x5e3b1f[_0x443350[_0x8edb('0x48')]]={'$like':'%'+_0x582ed7[_0x8edb('0x38')][_0x8edb('0x42')]+'%'};return _0x5e3b1f;}})});}_0x2bf607=_[_0x8edb('0x43')]({},_0x2bf607,_0x582ed7[_0x8edb('0x49')]);var _0x3eb929={'where':_0x2bf607['where']};return db[_0x8edb('0x34')][_0x8edb('0x22')](_0x3eb929)[_0x8edb('0x2b')](function(_0x89b2ef){_0x18b109[_0x8edb('0x22')]=_0x89b2ef;if(_0x582ed7['query'][_0x8edb('0x4a')]){_0x2bf607['include']=[{'all':!![]}];}return db[_0x8edb('0x34')][_0x8edb('0x4b')](_0x2bf607);})[_0x8edb('0x2b')](function(_0x2fc9b4){_0x18b109['rows']=_0x2fc9b4;return _0x18b109;})[_0x8edb('0x2b')](respondWithFilteredResult(_0xe6ac3,_0x2bf607))[_0x8edb('0x4c')](handleError(_0xe6ac3,null));};exports[_0x8edb('0x4d')]=function(_0x5115bf,_0x14ba04){var _0x399e8a={'raw':![],'where':{'id':_0x5115bf[_0x8edb('0x4e')]['id']}},_0x562b95={};_0x562b95[_0x8edb('0x36')]=_['keys'](db[_0x8edb('0x34')]['rawAttributes']);_0x562b95[_0x8edb('0x38')]=_[_0x8edb('0x37')](_0x5115bf[_0x8edb('0x38')]);_0x562b95[_0x8edb('0x4f')]=_[_0x8edb('0x39')](_0x562b95[_0x8edb('0x36')],_0x562b95[_0x8edb('0x38')]);_0x399e8a[_0x8edb('0x3a')]=_['intersection'](_0x562b95[_0x8edb('0x36')],qs['fields'](_0x5115bf['query'][_0x8edb('0x3b')]));_0x399e8a[_0x8edb('0x3a')]=_0x399e8a[_0x8edb('0x3a')]['length']?_0x399e8a[_0x8edb('0x3a')]:_0x562b95[_0x8edb('0x36')];if(_0x5115bf[_0x8edb('0x38')][_0x8edb('0x4a')]){_0x399e8a[_0x8edb('0x50')]=[{'all':!![]}];}_0x399e8a=_[_0x8edb('0x43')]({},_0x399e8a,_0x5115bf[_0x8edb('0x49')]);return db[_0x8edb('0x34')]['find'](_0x399e8a)[_0x8edb('0x2b')](handleEntityNotFound(_0x14ba04,null))[_0x8edb('0x2b')](respondWithResult(_0x14ba04,null))[_0x8edb('0x4c')](handleError(_0x14ba04,null));};exports[_0x8edb('0x51')]=function(_0x36cc08,_0x2b4033){return db['Team'][_0x8edb('0x51')](_0x36cc08[_0x8edb('0x52')],{})[_0x8edb('0x2b')](function(_0x23d5eb){var _0x322792=_0x36cc08[_0x8edb('0x53')][_0x8edb('0x2d')]({'plain':!![]});if(!_0x322792)throw new Error(_0x8edb('0x54'));if(_0x322792[_0x8edb('0x55')]===_0x8edb('0x53')){var _0x5a1f82=_0x23d5eb[_0x8edb('0x2d')]({'plain':!![]});var _0x3baa92=_0x8edb('0x2e');return db[_0x8edb('0x56')][_0x8edb('0x57')]({'where':{'name':_0x3baa92,'userProfileId':_0x322792[_0x8edb('0x58')]},'raw':!![]})[_0x8edb('0x2b')](function(_0x54c542){if(_0x54c542&&_0x54c542['autoAssociation']===0x0){return db[_0x8edb('0x2f')][_0x8edb('0x51')]({'name':_0x5a1f82[_0x8edb('0x31')],'resourceId':_0x5a1f82['id'],'type':_0x54c542[_0x8edb('0x31')],'sectionId':_0x54c542['id']},{})[_0x8edb('0x2b')](function(){return _0x23d5eb;});}else{return _0x23d5eb;}})[_0x8edb('0x4c')](function(_0x1d1485){logger['error'](_0x8edb('0x59'),_0x1d1485);throw _0x1d1485;});}return _0x23d5eb;})['then'](respondWithResult(_0x2b4033,0xc9))['catch'](handleError(_0x2b4033,null));};exports[_0x8edb('0x2a')]=function(_0x36fa29,_0x3b33ac){if(_0x36fa29[_0x8edb('0x52')]['id']){delete _0x36fa29[_0x8edb('0x52')]['id'];}return db[_0x8edb('0x34')][_0x8edb('0x57')]({'where':{'id':_0x36fa29['params']['id']}})[_0x8edb('0x2b')](handleEntityNotFound(_0x3b33ac,null))[_0x8edb('0x2b')](saveUpdates(_0x36fa29[_0x8edb('0x52')],null))[_0x8edb('0x2b')](respondWithResult(_0x3b33ac,null))[_0x8edb('0x4c')](handleError(_0x3b33ac,null));};exports[_0x8edb('0x2c')]=function(_0x341e61,_0x4cbeb0){return db['Team']['find']({'where':{'id':_0x341e61[_0x8edb('0x4e')]['id']}})[_0x8edb('0x2b')](handleEntityNotFound(_0x4cbeb0,null))[_0x8edb('0x2b')](removeEntity(_0x4cbeb0,null))[_0x8edb('0x4c')](handleError(_0x4cbeb0,null));};exports[_0x8edb('0x5a')]=function(_0x23e758,_0x1bdafe,_0x3fc11b){return db[_0x8edb('0x34')][_0x8edb('0x5b')]({'where':{'id':_0x23e758[_0x8edb('0x4e')]['id']}})[_0x8edb('0x2b')](handleEntityNotFound(_0x1bdafe,null))['then'](function(_0x1b8bea){if(!_0x23e758[_0x8edb('0x38')][_0x8edb('0x5c')]||!utils['isValidChannel'](_0x23e758[_0x8edb('0x38')]['channel'])){throw new db['Sequelize'][(_0x8edb('0x5d'))](_0x8edb('0x5e'));}var _0x69c518={};var _0x2d3855={};_0x2d3855[_0x8edb('0x36')]=_[_0x8edb('0x37')](db[_[_0x8edb('0x5f')](_0x23e758[_0x8edb('0x38')]['channel']['toLowerCase']())+'Queue'][_0x8edb('0x35')]);_0x2d3855[_0x8edb('0x38')]=_['keys'](_0x23e758[_0x8edb('0x38')]);_0x2d3855[_0x8edb('0x4f')]=_['intersection'](_0x2d3855[_0x8edb('0x36')],_0x2d3855[_0x8edb('0x38')]);_0x69c518[_0x8edb('0x3a')]=_[_0x8edb('0x39')](_0x2d3855['model'],qs[_0x8edb('0x3b')](_0x23e758[_0x8edb('0x38')][_0x8edb('0x3b')]));_0x69c518[_0x8edb('0x3a')]=_0x69c518[_0x8edb('0x3a')][_0x8edb('0x60')]?_0x69c518[_0x8edb('0x3a')]:_0x2d3855['model'];_0x69c518[_0x8edb('0x3e')]=qs[_0x8edb('0x3e')](_0x23e758[_0x8edb('0x38')]['limit']);_0x69c518[_0x8edb('0x23')]=qs['offset'](_0x23e758[_0x8edb('0x38')]['offset']);_0x69c518[_0x8edb('0x3f')]=qs[_0x8edb('0x40')](_0x23e758['query'][_0x8edb('0x40')]);_0x69c518[_0x8edb('0x41')]=qs[_0x8edb('0x4f')](_[_0x8edb('0x61')](_0x23e758[_0x8edb('0x38')],_0x2d3855[_0x8edb('0x4f')]));_0x69c518=_['merge']({},_0x69c518,_0x23e758[_0x8edb('0x49')]);return _0x1b8bea[_0x8edb('0x2d')+_[_0x8edb('0x5f')](_0x23e758[_0x8edb('0x38')][_0x8edb('0x5c')][_0x8edb('0x62')]())+_0x8edb('0x63')](_0x69c518);})['then'](respondWithResult(_0x1bdafe,null))[_0x8edb('0x4c')](handleError(_0x1bdafe,null));};exports[_0x8edb('0x64')]=function(_0x198b97,_0x149b8a,_0x37a034){return db['Team']['findOne']({'where':{'id':_0x198b97[_0x8edb('0x4e')]['id']}})[_0x8edb('0x2b')](function(_0x314c31){if(_0x314c31){if(!_0x198b97[_0x8edb('0x52')][_0x8edb('0x5c')]||!utils[_0x8edb('0x65')](_0x198b97[_0x8edb('0x52')]['channel'])){throw new db[(_0x8edb('0x66'))]['ValidationError'](_0x8edb('0x5e'));}return _0x314c31['add'+_['capitalize'](_0x198b97[_0x8edb('0x52')][_0x8edb('0x5c')][_0x8edb('0x62')]())+_0x8edb('0x63')](_0x198b97[_0x8edb('0x52')][_0x8edb('0x67')]);}return null;})[_0x8edb('0x2b')](handleEntityNotFound(_0x149b8a,null))['then'](respondWithStatusCode(_0x149b8a,null))[_0x8edb('0x4c')](handleError(_0x149b8a,null));};exports[_0x8edb('0x68')]=function(_0x433669,_0x1649d9,_0x143bf0){return db[_0x8edb('0x34')][_0x8edb('0x5b')]({'where':{'id':_0x433669[_0x8edb('0x4e')]['id']}})[_0x8edb('0x2b')](function(_0x27ea32){if(_0x27ea32){if(!_0x433669[_0x8edb('0x38')]['channel']||!utils['isValidChannel'](_0x433669[_0x8edb('0x38')][_0x8edb('0x5c')])){throw new db[(_0x8edb('0x66'))][(_0x8edb('0x5d'))](_0x8edb('0x5e'));}return _0x27ea32[_0x8edb('0x69')+_[_0x8edb('0x5f')](_0x433669[_0x8edb('0x38')]['channel'][_0x8edb('0x62')]())+_0x8edb('0x63')](_0x433669[_0x8edb('0x38')][_0x8edb('0x67')]);}return null;})['then'](handleEntityNotFound(_0x1649d9,null))[_0x8edb('0x2b')](respondWithStatusCode(_0x1649d9,null))[_0x8edb('0x4c')](handleError(_0x1649d9,null));};exports[_0x8edb('0x6a')]=function(_0x41a4c5,_0x59b893,_0x9fa836){return db[_0x8edb('0x34')][_0x8edb('0x57')]({'where':{'id':_0x41a4c5[_0x8edb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59b893,null))[_0x8edb('0x2b')](function(_0x4d8b5e){if(_0x4d8b5e){var _0x35e511=['Voice','Chat',_0x8edb('0x6b'),_0x8edb('0x6c'),_0x8edb('0x6d'),_0x8edb('0x6e')];return BPromise['each'](_0x35e511,function(_0x5531ab){return _0x4d8b5e[_0x8edb('0x2d')+_0x5531ab+_0x8edb('0x63')]({'attributes':['id',_0x8edb('0x31')]})['then'](function(_0x397313){return BPromise['each'](_0x397313,function(_0x5e5837){return _0x5e5837[_0x8edb('0x6a')](_0x41a4c5[_0x8edb('0x52')][_0x8edb('0x67')])[_0x8edb('0x2b')](function(){if(_0x5531ab==='Voice'){return db[_0x8edb('0x6f')][_0x8edb('0x4b')]({'where':{'id':_0x41a4c5[_0x8edb('0x52')]['ids']},'attributes':['id',_0x8edb('0x31'),'online','voicePause',_0x8edb('0x70')],'raw':!![]})[_0x8edb('0x2b')](function(_0x2855a7){return BPromise[_0x8edb('0x71')](_[_0x8edb('0x42')](_0x2855a7,{'online':0x1}),function(_0x30c16d){return db[_0x8edb('0x72')]['upsert']({'membername':_0x30c16d[_0x8edb('0x31')],'UserId':_0x30c16d['id'],'queue_name':_0x5e5837[_0x8edb('0x31')],'VoiceQueueId':_0x5e5837['id'],'interface':_[_0x8edb('0x73')](_0x30c16d[_0x8edb('0x70')])?util[_0x8edb('0x74')](_0x8edb('0x75'),_0x30c16d[_0x8edb('0x31')]):_0x30c16d[_0x8edb('0x70')],'paused':_0x30c16d[_0x8edb('0x76')]||![],'penalty':0x0});});});}});});})[_0x8edb('0x2b')](function(){return _0x4d8b5e;});})[_0x8edb('0x2b')](function(){return _0x4d8b5e;});}})['then'](function(_0x484f8f){if(_0x484f8f){return _0x484f8f['addAgents'](_0x41a4c5[_0x8edb('0x52')][_0x8edb('0x67')],_[_0x8edb('0x77')](_0x41a4c5['body'],[_0x8edb('0x67'),'id'])||{})[_0x8edb('0x78')](function(_0x43efff){for(var _0x3cee70=0x0;_0x3cee70<_0x41a4c5['body']['ids']['length'];_0x3cee70+=0x1){socket['emit'](_0x8edb('0x79'),{'UserId':_0x41a4c5[_0x8edb('0x52')][_0x8edb('0x67')][_0x3cee70],'TeamId':_0x41a4c5[_0x8edb('0x4e')]['id']});}return _0x43efff;});}})['then'](respondWithResult(_0x59b893,null))['catch'](handleError(_0x59b893,null));};exports[_0x8edb('0x7a')]=function(_0x2f767f,_0x15a152,_0x260c6e){return db[_0x8edb('0x34')][_0x8edb('0x57')]({'where':{'id':_0x2f767f[_0x8edb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x15a152,null))['then'](function(_0x9b0f7a){if(_0x9b0f7a){return BPromise[_0x8edb('0x71')]([_0x8edb('0x7b'),_0x8edb('0x7c'),_0x8edb('0x7d'),_0x8edb('0x7e'),_0x8edb('0x7f'),'openchannel'],function(_0x4501e7){return _0x9b0f7a[_0x8edb('0x2d')+_[_0x8edb('0x5f')](_0x4501e7)+_0x8edb('0x63')]({'attributes':['id',_0x8edb('0x31')]})[_0x8edb('0x2b')](function(_0x2bd706){return BPromise['each'](_0x2bd706,function(_0x30b3a5){return _0x30b3a5[_0x8edb('0x7a')](_0x2f767f[_0x8edb('0x38')][_0x8edb('0x67')])[_0x8edb('0x2b')](function(){if(_0x4501e7==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x30b3a5['id'],'UserId':_0x2f767f[_0x8edb('0x38')][_0x8edb('0x67')]}});}});});})[_0x8edb('0x2b')](function(){return _0x9b0f7a;});})[_0x8edb('0x2b')](function(){return _0x9b0f7a;});}})[_0x8edb('0x2b')](function(_0x4d51e8){if(_0x4d51e8){return _0x4d51e8[_0x8edb('0x7a')](_0x2f767f['query'][_0x8edb('0x67')])[_0x8edb('0x2b')](function(){if(_[_0x8edb('0x80')](_0x2f767f['query'][_0x8edb('0x67')])){for(var _0x16b512=0x0;_0x16b512<_0x2f767f[_0x8edb('0x38')][_0x8edb('0x67')][_0x8edb('0x60')];_0x16b512+=0x1){socket['emit'](_0x8edb('0x81'),{'UserId':Number(_0x2f767f[_0x8edb('0x38')][_0x8edb('0x67')][_0x16b512]),'TeamId':Number(_0x2f767f[_0x8edb('0x4e')]['id'])});}}else{socket[_0x8edb('0x82')](_0x8edb('0x81'),{'UserId':Number(_0x2f767f['query'][_0x8edb('0x67')]),'TeamId':Number(_0x2f767f['params']['id'])});}});}})[_0x8edb('0x2b')](respondWithStatusCode(_0x15a152,null))['catch'](handleError(_0x15a152,null));};exports[_0x8edb('0x83')]=function(_0x3c2f84,_0x39b0a5,_0x1e4873){var _0x42d4a9={};var _0x51ab31={};var _0x29645e;var _0x3d65ea;return db[_0x8edb('0x34')]['findOne']({'where':{'id':_0x3c2f84['params']['id']}})[_0x8edb('0x2b')](handleEntityNotFound(_0x39b0a5,null))[_0x8edb('0x2b')](function(_0x59a6f9){if(_0x59a6f9){_0x29645e=_0x59a6f9;_0x51ab31['model']=_['keys'](db['User'][_0x8edb('0x35')]);_0x51ab31['query']=_[_0x8edb('0x37')](_0x3c2f84['query']);_0x51ab31[_0x8edb('0x4f')]=_['intersection'](_0x51ab31['model'],_0x51ab31[_0x8edb('0x38')]);_0x42d4a9[_0x8edb('0x3a')]=_[_0x8edb('0x39')](_0x51ab31[_0x8edb('0x36')],qs[_0x8edb('0x3b')](_0x3c2f84[_0x8edb('0x38')][_0x8edb('0x3b')]));_0x42d4a9['attributes']=_0x42d4a9[_0x8edb('0x3a')][_0x8edb('0x60')]?_0x42d4a9[_0x8edb('0x3a')]:_0x51ab31[_0x8edb('0x36')];_0x42d4a9[_0x8edb('0x3f')]=qs[_0x8edb('0x40')](_0x3c2f84['query']['sort']);_0x42d4a9['where']=qs[_0x8edb('0x4f')](_['pick'](_0x3c2f84[_0x8edb('0x38')],_0x51ab31['filters']));if(_0x3c2f84['query'][_0x8edb('0x42')]){_0x42d4a9[_0x8edb('0x41')]=_[_0x8edb('0x43')](_0x42d4a9[_0x8edb('0x41')],{'$or':_['map'](_0x42d4a9[_0x8edb('0x3a')],function(_0x1c8eca){var _0x131dd4={};_0x131dd4[_0x1c8eca]={'$like':'%'+_0x3c2f84[_0x8edb('0x38')][_0x8edb('0x42')]+'%'};return _0x131dd4;})});}_0x42d4a9=_[_0x8edb('0x43')]({},_0x42d4a9,_0x3c2f84[_0x8edb('0x49')]);return _0x29645e['getAgents'](_0x42d4a9);}})[_0x8edb('0x2b')](function(_0x15e831){if(_0x15e831){_0x3d65ea=_0x15e831[_0x8edb('0x60')];if(!_0x3c2f84[_0x8edb('0x38')]['hasOwnProperty'](_0x8edb('0x3d'))){_0x42d4a9[_0x8edb('0x3e')]=qs[_0x8edb('0x3e')](_0x3c2f84[_0x8edb('0x38')][_0x8edb('0x3e')]);_0x42d4a9[_0x8edb('0x23')]=qs[_0x8edb('0x23')](_0x3c2f84[_0x8edb('0x38')][_0x8edb('0x23')]);}return _0x29645e[_0x8edb('0x83')](_0x42d4a9);}})[_0x8edb('0x2b')](function(_0x3a3a44){if(_0x3a3a44){return _0x3a3a44?{'count':_0x3d65ea,'rows':_0x3a3a44}:null;}})[_0x8edb('0x2b')](respondWithResult(_0x39b0a5,null))[_0x8edb('0x4c')](handleError(_0x39b0a5,null));}; \ No newline at end of file +var _0x682f=['interface','UserVoiceQueueRt','upsert','spread','emit','userTeam:save','removeAgents','voice','mail','openchannel','userTeam:remove','User','map','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','Teams','UserProfileResource','sendStatus','stack','send','index','Team','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','Sequelize','Unknown\x20channel','channel','toLowerCase','get','capitalize','Queues','isValidChannel','ValidationError','add','ids','removeQueues','remove','addAgents','Mail','Sms','Fax','Openchannel','each','Voice','online','voicePause'];(function(_0x7a3904,_0x4c2a1f){var _0x1491ed=function(_0x52fdfb){while(--_0x52fdfb){_0x7a3904['push'](_0x7a3904['shift']());}};_0x1491ed(++_0x4c2a1f);}(_0x682f,0x8c));var _0xf682=function(_0x2c1260,_0x1c8079){_0x2c1260=_0x2c1260-0x0;var _0x4ee486=_0x682f[_0x2c1260];return _0x4ee486;};'use strict';var pdf=require(_0xf682('0x0'));var emlformat=require(_0xf682('0x1'));var rimraf=require(_0xf682('0x2'));var zipdir=require(_0xf682('0x3'));var jsonpatch=require(_0xf682('0x4'));var rp=require(_0xf682('0x5'));var moment=require(_0xf682('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf682('0x7'));var util=require(_0xf682('0x8'));var path=require(_0xf682('0x9'));var sox=require('sox');var csv=require(_0xf682('0xa'));var ejs=require(_0xf682('0xb'));var fs=require('fs');var _=require(_0xf682('0xc'));var squel=require(_0xf682('0xd'));var crypto=require(_0xf682('0xe'));var jsforce=require(_0xf682('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf682('0x10'));var Papa=require(_0xf682('0x11'));var Redis=require(_0xf682('0x12'));var authService=require(_0xf682('0x13'));var qs=require(_0xf682('0x14'));var hardwareService=require(_0xf682('0x15'));var logger=require(_0xf682('0x16'))(_0xf682('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf682('0x18'))['db'];config[_0xf682('0x19')]=_['defaults'](config[_0xf682('0x19')],{'host':_0xf682('0x1a'),'port':0x18eb});var socket=require(_0xf682('0x1b'))(new Redis(config[_0xf682('0x19')]));require(_0xf682('0x1c'))[_0xf682('0x1d')](socket);function respondWithStatusCode(_0x5615aa,_0xc5c838){_0xc5c838=_0xc5c838||0xcc;return function(_0x2a201c){if(_0x2a201c){return _0x5615aa['sendStatus'](_0xc5c838);}return _0x5615aa[_0xf682('0x1e')](_0xc5c838)[_0xf682('0x1f')]();};}function respondWithResult(_0x5ad95c,_0x1a792e){_0x1a792e=_0x1a792e||0xc8;return function(_0x1c7135){if(_0x1c7135){return _0x5ad95c[_0xf682('0x1e')](_0x1a792e)[_0xf682('0x20')](_0x1c7135);}};}function respondWithFilteredResult(_0x843bf9,_0x10d3d2){return function(_0x20e391){if(_0x20e391){var _0x32abed=_0x20e391['count'],_0x3934fc=_0x10d3d2[_0xf682('0x21')],_0x2cf9de=_0x10d3d2['offset']+_0x10d3d2[_0xf682('0x22')],_0x29ff52;if(_0x2cf9de>=_0x32abed){_0x2cf9de=_0x32abed;_0x29ff52=0xc8;}else{_0x29ff52=0xce;}_0x843bf9[_0xf682('0x1e')](_0x29ff52);return _0x843bf9[_0xf682('0x23')](_0xf682('0x24'),_0x3934fc+'-'+_0x2cf9de+'/'+_0x32abed)[_0xf682('0x20')](_0x20e391);}return null;};}function patchUpdates(_0x2dcec5){return function(_0x3f558f){try{jsonpatch['apply'](_0x3f558f,_0x2dcec5,!![]);}catch(_0x33813d){return BPromise['reject'](_0x33813d);}return _0x3f558f[_0xf682('0x25')]();};}function saveUpdates(_0xcc6e97,_0xd3d253){return function(_0xaf3a95){if(_0xaf3a95){return _0xaf3a95[_0xf682('0x26')](_0xcc6e97)[_0xf682('0x27')](function(_0x3ff463){return _0x3ff463;});}return null;};}function removeEntity(_0x3b9d37,_0x125ca7){return function(_0x31f6fd){if(_0x31f6fd){return _0x31f6fd[_0xf682('0x28')]()[_0xf682('0x27')](function(){var _0x54cc16=_0x31f6fd['get']({'plain':!![]});var _0x288a38=_0xf682('0x29');return db[_0xf682('0x2a')][_0xf682('0x28')]({'where':{'type':_0x288a38,'resourceId':_0x54cc16['id']}})[_0xf682('0x27')](function(){return _0x31f6fd;});})[_0xf682('0x27')](function(){_0x3b9d37[_0xf682('0x1e')](0xcc)[_0xf682('0x1f')]();});}};}function handleEntityNotFound(_0x4bc270,_0x30cee3){return function(_0x1dffc3){if(!_0x1dffc3){_0x4bc270[_0xf682('0x2b')](0x194);}return _0x1dffc3;};}function handleError(_0x619862,_0x405ddf){_0x405ddf=_0x405ddf||0x1f4;return function(_0x44282f){logger['error'](_0x44282f[_0xf682('0x2c')]);if(_0x44282f['name']){delete _0x44282f['name'];}_0x619862['status'](_0x405ddf)[_0xf682('0x2d')](_0x44282f);};}exports[_0xf682('0x2e')]=function(_0x276d1f,_0x4ed242){var _0xb5397={},_0x3e7fb3={},_0x5979ba={'count':0x0,'rows':[]};var _0x2483dd=db[_0xf682('0x2f')][_0xf682('0x30')];_0x3e7fb3['model']=_[_0xf682('0x31')](_0x2483dd);_0x3e7fb3['query']=_[_0xf682('0x31')](_0x276d1f[_0xf682('0x32')]);_0x3e7fb3['filters']=_[_0xf682('0x33')](_0x3e7fb3[_0xf682('0x34')],_0x3e7fb3[_0xf682('0x32')]);_0xb5397[_0xf682('0x35')]=_[_0xf682('0x33')](_0x3e7fb3['model'],qs['fields'](_0x276d1f[_0xf682('0x32')][_0xf682('0x36')]));_0xb5397[_0xf682('0x35')]=_0xb5397[_0xf682('0x35')]['length']?_0xb5397[_0xf682('0x35')]:_0x3e7fb3['model'];if(!_0x276d1f['query'][_0xf682('0x37')](_0xf682('0x38'))){_0xb5397[_0xf682('0x22')]=qs[_0xf682('0x22')](_0x276d1f[_0xf682('0x32')][_0xf682('0x22')]);_0xb5397[_0xf682('0x21')]=qs[_0xf682('0x21')](_0x276d1f[_0xf682('0x32')][_0xf682('0x21')]);}_0xb5397[_0xf682('0x39')]=qs[_0xf682('0x3a')](_0x276d1f['query'][_0xf682('0x3a')]);_0xb5397['where']=qs[_0xf682('0x3b')](_[_0xf682('0x3c')](_0x276d1f[_0xf682('0x32')],_0x3e7fb3['filters']));if(_0x276d1f[_0xf682('0x32')][_0xf682('0x3d')]){_0xb5397['where']=_[_0xf682('0x3e')](_0xb5397[_0xf682('0x3f')],{'$or':_['map'](_0x2483dd,function(_0x43b301){if(_0x43b301[_0xf682('0x40')][_0xf682('0x41')]!==_0xf682('0x42')){var _0x3078a0={};_0x3078a0[_0x43b301[_0xf682('0x43')]]={'$like':'%'+_0x276d1f['query']['filter']+'%'};return _0x3078a0;}})});}_0xb5397=_[_0xf682('0x3e')]({},_0xb5397,_0x276d1f[_0xf682('0x44')]);var _0x5d18ba={'where':_0xb5397[_0xf682('0x3f')]};return db['Team']['count'](_0x5d18ba)[_0xf682('0x27')](function(_0x5ca767){_0x5979ba['count']=_0x5ca767;if(_0x276d1f['query'][_0xf682('0x45')]){_0xb5397['include']=[{'all':!![]}];}return db['Team'][_0xf682('0x46')](_0xb5397);})[_0xf682('0x27')](function(_0x5984e7){_0x5979ba[_0xf682('0x47')]=_0x5984e7;return _0x5979ba;})[_0xf682('0x27')](respondWithFilteredResult(_0x4ed242,_0xb5397))[_0xf682('0x48')](handleError(_0x4ed242,null));};exports[_0xf682('0x49')]=function(_0x2fb179,_0x3944b0){var _0x41da99={'raw':![],'where':{'id':_0x2fb179[_0xf682('0x4a')]['id']}},_0x41290c={};_0x41290c[_0xf682('0x34')]=_['keys'](db[_0xf682('0x2f')][_0xf682('0x30')]);_0x41290c['query']=_[_0xf682('0x31')](_0x2fb179[_0xf682('0x32')]);_0x41290c['filters']=_[_0xf682('0x33')](_0x41290c[_0xf682('0x34')],_0x41290c[_0xf682('0x32')]);_0x41da99[_0xf682('0x35')]=_[_0xf682('0x33')](_0x41290c[_0xf682('0x34')],qs[_0xf682('0x36')](_0x2fb179[_0xf682('0x32')]['fields']));_0x41da99['attributes']=_0x41da99['attributes'][_0xf682('0x4b')]?_0x41da99[_0xf682('0x35')]:_0x41290c[_0xf682('0x34')];if(_0x2fb179[_0xf682('0x32')][_0xf682('0x45')]){_0x41da99['include']=[{'all':!![]}];}_0x41da99=_[_0xf682('0x3e')]({},_0x41da99,_0x2fb179[_0xf682('0x44')]);return db[_0xf682('0x2f')][_0xf682('0x4c')](_0x41da99)[_0xf682('0x27')](handleEntityNotFound(_0x3944b0,null))[_0xf682('0x27')](respondWithResult(_0x3944b0,null))[_0xf682('0x48')](handleError(_0x3944b0,null));};exports[_0xf682('0x4d')]=function(_0x13e67d,_0x47f5d2){return db[_0xf682('0x2f')][_0xf682('0x4d')](_0x13e67d['body'],{})[_0xf682('0x27')](function(_0x5d4e05){var _0x26c615=_0x13e67d['user']['get']({'plain':!![]});if(!_0x26c615)throw new Error(_0xf682('0x4e'));if(_0x26c615[_0xf682('0x4f')]===_0xf682('0x50')){var _0x254fcf=_0x5d4e05['get']({'plain':!![]});var _0x574a2d=_0xf682('0x29');return db[_0xf682('0x51')][_0xf682('0x4c')]({'where':{'name':_0x574a2d,'userProfileId':_0x26c615[_0xf682('0x52')]},'raw':!![]})[_0xf682('0x27')](function(_0x4ee445){if(_0x4ee445&&_0x4ee445[_0xf682('0x53')]===0x0){return db[_0xf682('0x2a')][_0xf682('0x4d')]({'name':_0x254fcf['name'],'resourceId':_0x254fcf['id'],'type':_0x4ee445[_0xf682('0x54')],'sectionId':_0x4ee445['id']},{})[_0xf682('0x27')](function(){return _0x5d4e05;});}else{return _0x5d4e05;}})['catch'](function(_0x33fa49){logger[_0xf682('0x55')](_0xf682('0x56'),_0x33fa49);throw _0x33fa49;});}return _0x5d4e05;})['then'](respondWithResult(_0x47f5d2,0xc9))['catch'](handleError(_0x47f5d2,null));};exports[_0xf682('0x26')]=function(_0x146744,_0x2bc9c7){if(_0x146744[_0xf682('0x57')]['id']){delete _0x146744[_0xf682('0x57')]['id'];}return db[_0xf682('0x2f')][_0xf682('0x4c')]({'where':{'id':_0x146744[_0xf682('0x4a')]['id']}})[_0xf682('0x27')](handleEntityNotFound(_0x2bc9c7,null))[_0xf682('0x27')](saveUpdates(_0x146744[_0xf682('0x57')],null))['then'](respondWithResult(_0x2bc9c7,null))[_0xf682('0x48')](handleError(_0x2bc9c7,null));};exports[_0xf682('0x28')]=function(_0x1adf10,_0x31d51b){return db['Team'][_0xf682('0x4c')]({'where':{'id':_0x1adf10['params']['id']}})['then'](handleEntityNotFound(_0x31d51b,null))[_0xf682('0x27')](removeEntity(_0x31d51b,null))['catch'](handleError(_0x31d51b,null));};exports[_0xf682('0x58')]=function(_0xa6795c,_0x556ed9,_0x1014e4){return db[_0xf682('0x2f')][_0xf682('0x59')]({'where':{'id':_0xa6795c['params']['id']}})[_0xf682('0x27')](handleEntityNotFound(_0x556ed9,null))['then'](function(_0x2e3f18){if(!_0xa6795c[_0xf682('0x32')]['channel']||!utils['isValidChannel'](_0xa6795c[_0xf682('0x32')]['channel'])){throw new db[(_0xf682('0x5a'))]['ValidationError'](_0xf682('0x5b'));}var _0x53893d={};var _0x117841={};_0x117841['model']=_[_0xf682('0x31')](db[_['capitalize'](_0xa6795c['query'][_0xf682('0x5c')][_0xf682('0x5d')]())+'Queue'][_0xf682('0x30')]);_0x117841[_0xf682('0x32')]=_[_0xf682('0x31')](_0xa6795c[_0xf682('0x32')]);_0x117841[_0xf682('0x3b')]=_[_0xf682('0x33')](_0x117841[_0xf682('0x34')],_0x117841[_0xf682('0x32')]);_0x53893d['attributes']=_[_0xf682('0x33')](_0x117841[_0xf682('0x34')],qs[_0xf682('0x36')](_0xa6795c[_0xf682('0x32')][_0xf682('0x36')]));_0x53893d[_0xf682('0x35')]=_0x53893d[_0xf682('0x35')][_0xf682('0x4b')]?_0x53893d[_0xf682('0x35')]:_0x117841[_0xf682('0x34')];_0x53893d['limit']=qs['limit'](_0xa6795c[_0xf682('0x32')][_0xf682('0x22')]);_0x53893d[_0xf682('0x21')]=qs[_0xf682('0x21')](_0xa6795c[_0xf682('0x32')][_0xf682('0x21')]);_0x53893d['order']=qs['sort'](_0xa6795c[_0xf682('0x32')][_0xf682('0x3a')]);_0x53893d['where']=qs['filters'](_['pick'](_0xa6795c[_0xf682('0x32')],_0x117841['filters']));_0x53893d=_[_0xf682('0x3e')]({},_0x53893d,_0xa6795c[_0xf682('0x44')]);return _0x2e3f18[_0xf682('0x5e')+_[_0xf682('0x5f')](_0xa6795c[_0xf682('0x32')][_0xf682('0x5c')][_0xf682('0x5d')]())+_0xf682('0x60')](_0x53893d);})[_0xf682('0x27')](respondWithResult(_0x556ed9,null))['catch'](handleError(_0x556ed9,null));};exports['addQueues']=function(_0x305c78,_0x305bd2,_0x5b31a2){return db[_0xf682('0x2f')][_0xf682('0x59')]({'where':{'id':_0x305c78['params']['id']}})['then'](function(_0x140602){if(_0x140602){if(!_0x305c78['body'][_0xf682('0x5c')]||!utils[_0xf682('0x61')](_0x305c78[_0xf682('0x57')][_0xf682('0x5c')])){throw new db['Sequelize'][(_0xf682('0x62'))]('Unknown\x20channel');}return _0x140602[_0xf682('0x63')+_['capitalize'](_0x305c78[_0xf682('0x57')]['channel'][_0xf682('0x5d')]())+_0xf682('0x60')](_0x305c78[_0xf682('0x57')][_0xf682('0x64')]);}return null;})[_0xf682('0x27')](handleEntityNotFound(_0x305bd2,null))[_0xf682('0x27')](respondWithStatusCode(_0x305bd2,null))[_0xf682('0x48')](handleError(_0x305bd2,null));};exports[_0xf682('0x65')]=function(_0x573c45,_0x116148,_0x1e6eb0){return db[_0xf682('0x2f')][_0xf682('0x59')]({'where':{'id':_0x573c45[_0xf682('0x4a')]['id']}})[_0xf682('0x27')](function(_0x11a139){if(_0x11a139){if(!_0x573c45[_0xf682('0x32')][_0xf682('0x5c')]||!utils[_0xf682('0x61')](_0x573c45[_0xf682('0x32')][_0xf682('0x5c')])){throw new db['Sequelize'][(_0xf682('0x62'))](_0xf682('0x5b'));}return _0x11a139[_0xf682('0x66')+_[_0xf682('0x5f')](_0x573c45['query'][_0xf682('0x5c')]['toLowerCase']())+_0xf682('0x60')](_0x573c45[_0xf682('0x32')][_0xf682('0x64')]);}return null;})[_0xf682('0x27')](handleEntityNotFound(_0x116148,null))[_0xf682('0x27')](respondWithStatusCode(_0x116148,null))[_0xf682('0x48')](handleError(_0x116148,null));};exports[_0xf682('0x67')]=function(_0x156317,_0x52ca48,_0x33cd5b){return db[_0xf682('0x2f')][_0xf682('0x4c')]({'where':{'id':_0x156317[_0xf682('0x4a')]['id']}})[_0xf682('0x27')](handleEntityNotFound(_0x52ca48,null))[_0xf682('0x27')](function(_0x4547e0){if(_0x4547e0){var _0x158ffa=['Voice','Chat',_0xf682('0x68'),_0xf682('0x69'),_0xf682('0x6a'),_0xf682('0x6b')];return BPromise[_0xf682('0x6c')](_0x158ffa,function(_0x198725){return _0x4547e0[_0xf682('0x5e')+_0x198725+_0xf682('0x60')]({'attributes':['id',_0xf682('0x54')]})[_0xf682('0x27')](function(_0x20877a){return BPromise[_0xf682('0x6c')](_0x20877a,function(_0x3f5cc3){return _0x3f5cc3[_0xf682('0x67')](_0x156317[_0xf682('0x57')][_0xf682('0x64')])[_0xf682('0x27')](function(){if(_0x198725===_0xf682('0x6d')){return db['User']['findAll']({'where':{'id':_0x156317[_0xf682('0x57')]['ids']},'attributes':['id',_0xf682('0x54'),_0xf682('0x6e'),_0xf682('0x6f'),_0xf682('0x70')],'raw':!![]})[_0xf682('0x27')](function(_0x45a945){return BPromise[_0xf682('0x6c')](_[_0xf682('0x3d')](_0x45a945,{'online':0x1}),function(_0x2b7b4b){return db[_0xf682('0x71')][_0xf682('0x72')]({'membername':_0x2b7b4b[_0xf682('0x54')],'UserId':_0x2b7b4b['id'],'queue_name':_0x3f5cc3[_0xf682('0x54')],'VoiceQueueId':_0x3f5cc3['id'],'interface':_['isNil'](_0x2b7b4b['interface'])?util['format']('SIP/%s',_0x2b7b4b['name']):_0x2b7b4b[_0xf682('0x70')],'paused':_0x2b7b4b[_0xf682('0x6f')]||![],'penalty':0x0});});});}});});})[_0xf682('0x27')](function(){return _0x4547e0;});})['then'](function(){return _0x4547e0;});}})['then'](function(_0x3a2249){if(_0x3a2249){return _0x3a2249['addAgents'](_0x156317[_0xf682('0x57')][_0xf682('0x64')],_['omit'](_0x156317[_0xf682('0x57')],[_0xf682('0x64'),'id'])||{})[_0xf682('0x73')](function(_0x3af621){for(var _0x2347c9=0x0;_0x2347c9<_0x156317['body'][_0xf682('0x64')][_0xf682('0x4b')];_0x2347c9+=0x1){socket[_0xf682('0x74')](_0xf682('0x75'),{'UserId':_0x156317[_0xf682('0x57')][_0xf682('0x64')][_0x2347c9],'TeamId':_0x156317[_0xf682('0x4a')]['id']});}return _0x3af621;});}})[_0xf682('0x27')](respondWithResult(_0x52ca48,null))[_0xf682('0x48')](handleError(_0x52ca48,null));};exports[_0xf682('0x76')]=function(_0x210934,_0x591f92,_0x11d44c){return db['Team'][_0xf682('0x4c')]({'where':{'id':_0x210934[_0xf682('0x4a')]['id']}})['then'](handleEntityNotFound(_0x591f92,null))[_0xf682('0x27')](function(_0x49db3c){if(_0x49db3c){return BPromise['each']([_0xf682('0x77'),'chat',_0xf682('0x78'),'sms','fax',_0xf682('0x79')],function(_0x48c296){return _0x49db3c['get'+_[_0xf682('0x5f')](_0x48c296)+_0xf682('0x60')]({'attributes':['id',_0xf682('0x54')]})[_0xf682('0x27')](function(_0x1cc725){return BPromise[_0xf682('0x6c')](_0x1cc725,function(_0x44a1a7){return _0x44a1a7['removeAgents'](_0x210934[_0xf682('0x32')][_0xf682('0x64')])[_0xf682('0x27')](function(){if(_0x48c296===_0xf682('0x77')){return db['UserVoiceQueueRt'][_0xf682('0x28')]({'where':{'VoiceQueueId':_0x44a1a7['id'],'UserId':_0x210934[_0xf682('0x32')]['ids']}});}});});})[_0xf682('0x27')](function(){return _0x49db3c;});})[_0xf682('0x27')](function(){return _0x49db3c;});}})['then'](function(_0x55df98){if(_0x55df98){return _0x55df98[_0xf682('0x76')](_0x210934['query'][_0xf682('0x64')])[_0xf682('0x27')](function(){if(_['isArray'](_0x210934[_0xf682('0x32')][_0xf682('0x64')])){for(var _0x44cc1e=0x0;_0x44cc1e<_0x210934[_0xf682('0x32')][_0xf682('0x64')][_0xf682('0x4b')];_0x44cc1e+=0x1){socket[_0xf682('0x74')]('userTeam:remove',{'UserId':Number(_0x210934[_0xf682('0x32')][_0xf682('0x64')][_0x44cc1e]),'TeamId':Number(_0x210934[_0xf682('0x4a')]['id'])});}}else{socket[_0xf682('0x74')](_0xf682('0x7a'),{'UserId':Number(_0x210934[_0xf682('0x32')][_0xf682('0x64')]),'TeamId':Number(_0x210934['params']['id'])});}});}})[_0xf682('0x27')](respondWithStatusCode(_0x591f92,null))[_0xf682('0x48')](handleError(_0x591f92,null));};exports['getAgents']=function(_0x14255b,_0x15cc80,_0x14723b){var _0xc0dda5={};var _0x441eef={};var _0x1bf5e6;var _0x346069;return db['Team']['findOne']({'where':{'id':_0x14255b[_0xf682('0x4a')]['id']}})[_0xf682('0x27')](handleEntityNotFound(_0x15cc80,null))[_0xf682('0x27')](function(_0x366a03){if(_0x366a03){_0x1bf5e6=_0x366a03;_0x441eef[_0xf682('0x34')]=_[_0xf682('0x31')](db[_0xf682('0x7b')][_0xf682('0x30')]);_0x441eef['query']=_[_0xf682('0x31')](_0x14255b[_0xf682('0x32')]);_0x441eef[_0xf682('0x3b')]=_['intersection'](_0x441eef[_0xf682('0x34')],_0x441eef[_0xf682('0x32')]);_0xc0dda5[_0xf682('0x35')]=_['intersection'](_0x441eef[_0xf682('0x34')],qs[_0xf682('0x36')](_0x14255b[_0xf682('0x32')]['fields']));_0xc0dda5['attributes']=_0xc0dda5[_0xf682('0x35')][_0xf682('0x4b')]?_0xc0dda5['attributes']:_0x441eef[_0xf682('0x34')];_0xc0dda5['order']=qs[_0xf682('0x3a')](_0x14255b[_0xf682('0x32')]['sort']);_0xc0dda5[_0xf682('0x3f')]=qs[_0xf682('0x3b')](_[_0xf682('0x3c')](_0x14255b[_0xf682('0x32')],_0x441eef[_0xf682('0x3b')]));if(_0x14255b[_0xf682('0x32')][_0xf682('0x3d')]){_0xc0dda5[_0xf682('0x3f')]=_[_0xf682('0x3e')](_0xc0dda5[_0xf682('0x3f')],{'$or':_[_0xf682('0x7c')](_0xc0dda5[_0xf682('0x35')],function(_0x169eb9){var _0x48a92e={};_0x48a92e[_0x169eb9]={'$like':'%'+_0x14255b[_0xf682('0x32')]['filter']+'%'};return _0x48a92e;})});}_0xc0dda5=_['merge']({},_0xc0dda5,_0x14255b['options']);return _0x1bf5e6[_0xf682('0x7d')](_0xc0dda5);}})[_0xf682('0x27')](function(_0x194dc1){if(_0x194dc1){_0x346069=_0x194dc1['length'];if(!_0x14255b[_0xf682('0x32')][_0xf682('0x37')]('nolimit')){_0xc0dda5['limit']=qs[_0xf682('0x22')](_0x14255b['query'][_0xf682('0x22')]);_0xc0dda5[_0xf682('0x21')]=qs['offset'](_0x14255b[_0xf682('0x32')][_0xf682('0x21')]);}return _0x1bf5e6[_0xf682('0x7d')](_0xc0dda5);}})['then'](function(_0x2e557a){if(_0x2e557a){return _0x2e557a?{'count':_0x346069,'rows':_0x2e557a}:null;}})[_0xf682('0x27')](respondWithResult(_0x15cc80,null))[_0xf682('0x48')](handleError(_0x15cc80,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6c86b12..d4c5807 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 _0x964b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1232b4,_0x59f94b){var _0x2263cf=function(_0x216413){while(--_0x216413){_0x1232b4['push'](_0x1232b4['shift']());}};_0x2263cf(++_0x59f94b);}(_0x964b,0x112));var _0xb964=function(_0x577250,_0x112d13){_0x577250=_0x577250-0x0;var _0x37c3ca=_0x964b[_0x577250];return _0x37c3ca;};'use strict';var EventEmitter=require(_0xb964('0x0'));var Team=require(_0xb964('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xb964('0x2')](0x0);var events={'afterCreate':_0xb964('0x3'),'afterUpdate':_0xb964('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c4f01){return function(_0x2c4686,_0x48b771,_0x4760b2){TeamEvents[_0xb964('0x5')](_0x5c4f01+':'+_0x2c4686['id'],_0x2c4686);TeamEvents[_0xb964('0x5')](_0x5c4f01,_0x2c4686);_0x4760b2(null);};}for(var e in events){if(events[_0xb964('0x6')](e)){var event=events[e];Team[_0xb964('0x7')](e,emitEvent(event));}}module[_0xb964('0x8')]=TeamEvents; \ No newline at end of file +var _0x0af5=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','exports'];(function(_0x1c673a,_0x4eaa6e){var _0xca51=function(_0x4a2509){while(--_0x4a2509){_0x1c673a['push'](_0x1c673a['shift']());}};_0xca51(++_0x4eaa6e);}(_0x0af5,0x158));var _0x50af=function(_0x1edab7,_0x10c2d3){_0x1edab7=_0x1edab7-0x0;var _0x43cca2=_0x0af5[_0x1edab7];return _0x43cca2;};'use strict';var EventEmitter=require('events');var Team=require(_0x50af('0x0'))['db'][_0x50af('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x50af('0x2')](0x0);var events={'afterCreate':_0x50af('0x3'),'afterUpdate':_0x50af('0x4'),'afterDestroy':_0x50af('0x5')};function emitEvent(_0x19fcad){return function(_0x3733b7,_0x34e045,_0x1cfefa){TeamEvents[_0x50af('0x6')](_0x19fcad+':'+_0x3733b7['id'],_0x3733b7);TeamEvents[_0x50af('0x6')](_0x19fcad,_0x3733b7);_0x1cfefa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x50af('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 47e6c53..6dc0c2f 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 _0xb197=['exports','define','Team','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xf273f9,_0x486198){var _0xb4abcc=function(_0x2f9418){while(--_0x2f9418){_0xf273f9['push'](_0xf273f9['shift']());}};_0xb4abcc(++_0x486198);}(_0xb197,0xa3));var _0x7b19=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0xb197[_0x29ae80];return _0x5d6d71;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b19('0x0'));var BPromise=require(_0x7b19('0x1'));var rp=require(_0x7b19('0x2'));var fs=require('fs');var path=require(_0x7b19('0x3'));var rimraf=require('rimraf');var config=require(_0x7b19('0x4'));var attributes=require('./team.attributes');module[_0x7b19('0x5')]=function(_0xcea5ac,_0x591eed){return _0xcea5ac[_0x7b19('0x6')](_0x7b19('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef48=['define','Team','teams','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4a2983,_0x4ef371){var _0x2d801c=function(_0x3b5acd){while(--_0x3b5acd){_0x4a2983['push'](_0x4a2983['shift']());}};_0x2d801c(++_0x4ef371);}(_0xef48,0x7b));var _0x8ef4=function(_0x201b3b,_0x473038){_0x201b3b=_0x201b3b-0x0;var _0x151957=_0xef48[_0x201b3b];return _0x151957;};'use strict';var _=require(_0x8ef4('0x0'));var util=require(_0x8ef4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8ef4('0x2'));var BPromise=require(_0x8ef4('0x3'));var rp=require(_0x8ef4('0x4'));var fs=require('fs');var path=require(_0x8ef4('0x5'));var rimraf=require(_0x8ef4('0x6'));var config=require(_0x8ef4('0x7'));var attributes=require('./team.attributes');module[_0x8ef4('0x8')]=function(_0x11c6e1,_0x3ef835){return _0x11c6e1[_0x8ef4('0x9')](_0x8ef4('0xa'),attributes,{'tableName':_0x8ef4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 8c90028..40d10fa 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 _0xc1a8=['defaults','socket.io-emitter','./team.socket','register','request','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Team,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0xaa19aa,_0x517fc5){var _0x5ad07b=function(_0x716a67){while(--_0x716a67){_0xaa19aa['push'](_0xaa19aa['shift']());}};_0x5ad07b(++_0x517fc5);}(_0xc1a8,0x189));var _0x8c1a=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xc1a8[_0x1f83a5];return _0x45edf0;};'use strict';var _=require('lodash');var util=require(_0x8c1a('0x0'));var moment=require(_0x8c1a('0x1'));var BPromise=require(_0x8c1a('0x2'));var rs=require(_0x8c1a('0x3'));var fs=require('fs');var Redis=require(_0x8c1a('0x4'));var db=require(_0x8c1a('0x5'))['db'];var utils=require(_0x8c1a('0x6'));var logger=require('../../config/logger')(_0x8c1a('0x7'));var config=require(_0x8c1a('0x8'));var jayson=require(_0x8c1a('0x9'));var client=jayson['client'][_0x8c1a('0xa')]({'port':0x232a});config[_0x8c1a('0xb')]=_[_0x8c1a('0xc')](config[_0x8c1a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c1a('0xd'))(new Redis(config[_0x8c1a('0xb')]));require(_0x8c1a('0xe'))[_0x8c1a('0xf')](socket);function respondWithRpcPromise(_0x5b93ba,_0x31a88a,_0x1e1b85){return new BPromise(function(_0x105f49,_0x5cf701){return client[_0x8c1a('0x10')](_0x5b93ba,_0x1e1b85)['then'](function(_0x2d8436){logger[_0x8c1a('0x11')]('Team,\x20%s,\x20%s',_0x31a88a,'request\x20sent');logger[_0x8c1a('0x12')](_0x8c1a('0x13'),_0x31a88a,_0x8c1a('0x14'),JSON[_0x8c1a('0x15')](_0x2d8436));if(_0x2d8436[_0x8c1a('0x16')]){if(_0x2d8436['error'][_0x8c1a('0x17')]===0x1f4){logger[_0x8c1a('0x16')](_0x8c1a('0x18'),_0x31a88a,_0x2d8436[_0x8c1a('0x16')][_0x8c1a('0x19')]);return _0x5cf701(_0x2d8436[_0x8c1a('0x16')][_0x8c1a('0x19')]);}logger['error'](_0x8c1a('0x18'),_0x31a88a,_0x2d8436[_0x8c1a('0x16')][_0x8c1a('0x19')]);return _0x105f49(_0x2d8436[_0x8c1a('0x16')][_0x8c1a('0x19')]);}else{logger[_0x8c1a('0x11')](_0x8c1a('0x18'),_0x31a88a,_0x8c1a('0x14'));_0x105f49(_0x2d8436['result']['message']);}})[_0x8c1a('0x1a')](function(_0x22e2a8){logger['error'](_0x8c1a('0x18'),_0x31a88a,_0x22e2a8);_0x5cf701(_0x22e2a8);});});} \ No newline at end of file +var _0x5e7e=['redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3adf8b,_0x3cc3e0){var _0x236a4e=function(_0x4c119a){while(--_0x4c119a){_0x3adf8b['push'](_0x3adf8b['shift']());}};_0x236a4e(++_0x3cc3e0);}(_0x5e7e,0x197));var _0xe5e7=function(_0x38958b,_0x4c9764){_0x38958b=_0x38958b-0x0;var _0x1be38b=_0x5e7e[_0x38958b];return _0x1be38b;};'use strict';var _=require(_0xe5e7('0x0'));var util=require(_0xe5e7('0x1'));var moment=require(_0xe5e7('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5e7('0x3'));var fs=require('fs');var Redis=require(_0xe5e7('0x4'));var db=require(_0xe5e7('0x5'))['db'];var utils=require(_0xe5e7('0x6'));var logger=require(_0xe5e7('0x7'))(_0xe5e7('0x8'));var config=require(_0xe5e7('0x9'));var jayson=require(_0xe5e7('0xa'));var client=jayson[_0xe5e7('0xb')][_0xe5e7('0xc')]({'port':0x232a});config[_0xe5e7('0xd')]=_[_0xe5e7('0xe')](config[_0xe5e7('0xd')],{'host':_0xe5e7('0xf'),'port':0x18eb});var socket=require(_0xe5e7('0x10'))(new Redis(config['redis']));require(_0xe5e7('0x11'))[_0xe5e7('0x12')](socket);function respondWithRpcPromise(_0x3c0169,_0x81c706,_0x2bf6e6){return new BPromise(function(_0x41af6c,_0x206f2e){return client[_0xe5e7('0x13')](_0x3c0169,_0x2bf6e6)[_0xe5e7('0x14')](function(_0x42b562){logger[_0xe5e7('0x15')](_0xe5e7('0x16'),_0x81c706,'request\x20sent');logger[_0xe5e7('0x17')](_0xe5e7('0x18'),_0x81c706,_0xe5e7('0x19'),JSON['stringify'](_0x42b562));if(_0x42b562[_0xe5e7('0x1a')]){if(_0x42b562[_0xe5e7('0x1a')]['code']===0x1f4){logger[_0xe5e7('0x1a')]('Team,\x20%s,\x20%s',_0x81c706,_0x42b562[_0xe5e7('0x1a')][_0xe5e7('0x1b')]);return _0x206f2e(_0x42b562[_0xe5e7('0x1a')][_0xe5e7('0x1b')]);}logger['error'](_0xe5e7('0x16'),_0x81c706,_0x42b562[_0xe5e7('0x1a')][_0xe5e7('0x1b')]);return _0x41af6c(_0x42b562['error'][_0xe5e7('0x1b')]);}else{logger[_0xe5e7('0x15')](_0xe5e7('0x16'),_0x81c706,_0xe5e7('0x19'));_0x41af6c(_0x42b562[_0xe5e7('0x1c')][_0xe5e7('0x1b')]);}})[_0xe5e7('0x1d')](function(_0x46a7a1){logger['error'](_0xe5e7('0x16'),_0x81c706,_0x46a7a1);_0x206f2e(_0x46a7a1);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 799fc48..d8f5887 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 _0x2e56=['save','remove','update','emit','removeListener','length','./team.events'];(function(_0xc4743b,_0x5d8f4e){var _0x317924=function(_0x24c82a){while(--_0x24c82a){_0xc4743b['push'](_0xc4743b['shift']());}};_0x317924(++_0x5d8f4e);}(_0x2e56,0x109));var _0x62e5=function(_0x27c3f0,_0x198aa2){_0x27c3f0=_0x27c3f0-0x0;var _0x11e51c=_0x2e56[_0x27c3f0];return _0x11e51c;};'use strict';var TeamEvents=require(_0x62e5('0x0'));var events=[_0x62e5('0x1'),_0x62e5('0x2'),_0x62e5('0x3')];function createListener(_0x275d3d,_0x298c4a){return function(_0x42bae7){_0x298c4a[_0x62e5('0x4')](_0x275d3d,_0x42bae7);};}function removeListener(_0x46850e,_0x3e4e34){return function(){TeamEvents[_0x62e5('0x5')](_0x46850e,_0x3e4e34);};}exports['register']=function(_0x643079){for(var _0x5ac729=0x0,_0x2987a4=events[_0x62e5('0x6')];_0x5ac729<_0x2987a4;_0x5ac729++){var _0x417151=events[_0x5ac729];var _0x2b9c85=createListener('team:'+_0x417151,_0x643079);TeamEvents['on'](_0x417151,_0x2b9c85);}}; \ No newline at end of file +var _0x1060=['length','remove','register'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0x1060,0xcd));var _0x0106=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x1060[_0x50a0c2];return _0x5ebadd;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x0106('0x0'),'update'];function createListener(_0x191d43,_0x5d0f59){return function(_0x5f28df){_0x5d0f59['emit'](_0x191d43,_0x5f28df);};}function removeListener(_0x565dbb,_0x43ab6d){return function(){TeamEvents['removeListener'](_0x565dbb,_0x43ab6d);};}exports[_0x0106('0x1')]=function(_0x1dab14){for(var _0x23fe31=0x0,_0x5d55b0=events[_0x0106('0x2')];_0x23fe31<_0x5d55b0;_0x23fe31++){var _0x319341=events[_0x23fe31];var _0x34d673=createListener('team:'+_0x319341,_0x1dab14);TeamEvents['on'](_0x319341,_0x34d673);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index e49d085..d0e84c9 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 _0x6083=['get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x137787,_0x34e148){var _0x29a645=function(_0x376f49){while(--_0x376f49){_0x137787['push'](_0x137787['shift']());}};_0x29a645(++_0x34e148);}(_0x6083,0x1ea));var _0x3608=function(_0x36530f,_0x167770){_0x36530f=_0x36530f-0x0;var _0x11745a=_0x6083[_0x36530f];return _0x11745a;};'use strict';var multer=require('multer');var util=require(_0x3608('0x0'));var path=require(_0x3608('0x1'));var timeout=require(_0x3608('0x2'));var express=require('express');var router=express[_0x3608('0x3')]();var auth=require(_0x3608('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3608('0x5'));var controller=require('./template.controller');router[_0x3608('0x6')]('/',auth[_0x3608('0x7')](),controller[_0x3608('0x8')]);router['get'](_0x3608('0x9'),auth['isAuthenticated'](),controller[_0x3608('0xa')]);router[_0x3608('0xb')]('/',auth[_0x3608('0x7')](),controller[_0x3608('0xc')]);router[_0x3608('0xd')](_0x3608('0x9'),auth[_0x3608('0x7')](),controller['update']);router['delete'](_0x3608('0x9'),auth[_0x3608('0x7')](),controller[_0x3608('0xe')]);module[_0x3608('0xf')]=router; \ No newline at end of file +var _0x4930=['../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1a5819,_0x2b5cb2){var _0xcc1294=function(_0x2dd47b){while(--_0x2dd47b){_0x1a5819['push'](_0x1a5819['shift']());}};_0xcc1294(++_0x2b5cb2);}(_0x4930,0x1b1));var _0x0493=function(_0x3afb49,_0x4d5cd0){_0x3afb49=_0x3afb49-0x0;var _0x5c3ad2=_0x4930[_0x3afb49];return _0x5c3ad2;};'use strict';var multer=require(_0x0493('0x0'));var util=require(_0x0493('0x1'));var path=require('path');var timeout=require(_0x0493('0x2'));var express=require(_0x0493('0x3'));var router=express[_0x0493('0x4')]();var auth=require(_0x0493('0x5'));var interaction=require(_0x0493('0x6'));var config=require(_0x0493('0x7'));var controller=require(_0x0493('0x8'));router[_0x0493('0x9')]('/',auth[_0x0493('0xa')](),controller[_0x0493('0xb')]);router[_0x0493('0x9')](_0x0493('0xc'),auth['isAuthenticated'](),controller[_0x0493('0xd')]);router[_0x0493('0xe')]('/',auth[_0x0493('0xa')](),controller[_0x0493('0xf')]);router[_0x0493('0x10')](_0x0493('0xc'),auth[_0x0493('0xa')](),controller[_0x0493('0x11')]);router[_0x0493('0x12')](_0x0493('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0493('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ad72299..cd2137c 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 _0x93a6=['TEXT','sequelize','exports','STRING'];(function(_0x118ec3,_0x50d8a6){var _0x542fa6=function(_0x176f12){while(--_0x176f12){_0x118ec3['push'](_0x118ec3['shift']());}};_0x542fa6(++_0x50d8a6);}(_0x93a6,0x6d));var _0x693a=function(_0x3d6785,_0x492ea3){_0x3d6785=_0x3d6785-0x0;var _0x39a624=_0x93a6[_0x3d6785];return _0x39a624;};'use strict';var Sequelize=require(_0x693a('0x0'));module[_0x693a('0x1')]={'name':{'type':Sequelize[_0x693a('0x2')]},'description':{'type':Sequelize[_0x693a('0x2')]},'html':{'type':Sequelize[_0x693a('0x3')]}}; \ No newline at end of file +var _0x196d=['STRING','TEXT'];(function(_0x2ff0d6,_0xbff1e6){var _0x2ede7c=function(_0x5f400c){while(--_0x5f400c){_0x2ff0d6['push'](_0x2ff0d6['shift']());}};_0x2ede7c(++_0xbff1e6);}(_0x196d,0x13c));var _0xd196=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x196d[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd196('0x0')]},'description':{'type':Sequelize[_0xd196('0x0')]},'html':{'type':Sequelize[_0xd196('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 5c5e12d..312b329 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 _0x7a3e=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','status','json','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','name','send','index','Template','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x445d20,_0x39643f){var _0x26e5f2=function(_0x1f1e53){while(--_0x1f1e53){_0x445d20['push'](_0x445d20['shift']());}};_0x26e5f2(++_0x39643f);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x51c4a8,_0x2a9ace){_0x51c4a8=_0x51c4a8-0x0;var _0x427d2b=_0x7a3e[_0x51c4a8];return _0x427d2b;};'use strict';var pdf=require(_0xe7a3('0x0'));var emlformat=require(_0xe7a3('0x1'));var rimraf=require(_0xe7a3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7a3('0x3'));var rp=require(_0xe7a3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe7a3('0x5'));var util=require(_0xe7a3('0x6'));var path=require(_0xe7a3('0x7'));var sox=require('sox');var csv=require(_0xe7a3('0x8'));var ejs=require(_0xe7a3('0x9'));var fs=require('fs');var _=require(_0xe7a3('0xa'));var squel=require(_0xe7a3('0xb'));var crypto=require(_0xe7a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7a3('0xd'));var toCsv=require(_0xe7a3('0x8'));var querystring=require(_0xe7a3('0xe'));var Papa=require(_0xe7a3('0xf'));var Redis=require('ioredis');var authService=require(_0xe7a3('0x10'));var qs=require(_0xe7a3('0x11'));var hardwareService=require(_0xe7a3('0x12'));var logger=require(_0xe7a3('0x13'))(_0xe7a3('0x14'));var utils=require(_0xe7a3('0x15'));var config=require(_0xe7a3('0x16'));var db=require(_0xe7a3('0x17'))['db'];function respondWithStatusCode(_0x1193c4,_0x2fcb86){_0x2fcb86=_0x2fcb86||0xcc;return function(_0x355a0e){if(_0x355a0e){return _0x1193c4[_0xe7a3('0x18')](_0x2fcb86);}return _0x1193c4['status'](_0x2fcb86)[_0xe7a3('0x19')]();};}function respondWithResult(_0x591a5b,_0x407791){_0x407791=_0x407791||0xc8;return function(_0x12798a){if(_0x12798a){return _0x591a5b['status'](_0x407791)['json'](_0x12798a);}};}function respondWithFilteredResult(_0x1eba8f,_0x100a2b){return function(_0x3b7ac6){if(_0x3b7ac6){var _0x194c34=_0x3b7ac6[_0xe7a3('0x1a')],_0xb53629=_0x100a2b[_0xe7a3('0x1b')],_0x2c8d77=_0x100a2b[_0xe7a3('0x1b')]+_0x100a2b['limit'],_0x3da8ba;if(_0x2c8d77>=_0x194c34){_0x2c8d77=_0x194c34;_0x3da8ba=0xc8;}else{_0x3da8ba=0xce;}_0x1eba8f[_0xe7a3('0x1c')](_0x3da8ba);return _0x1eba8f['set']('Content-Range',_0xb53629+'-'+_0x2c8d77+'/'+_0x194c34)[_0xe7a3('0x1d')](_0x3b7ac6);}return null;};}function patchUpdates(_0x535f0c){return function(_0x1795e3){try{jsonpatch[_0xe7a3('0x1e')](_0x1795e3,_0x535f0c,!![]);}catch(_0x486b53){return BPromise[_0xe7a3('0x1f')](_0x486b53);}return _0x1795e3[_0xe7a3('0x20')]();};}function saveUpdates(_0x4713a6,_0x59de24){return function(_0x2db060){if(_0x2db060){return _0x2db060[_0xe7a3('0x21')](_0x4713a6)[_0xe7a3('0x22')](function(_0x47a934){return _0x47a934;});}return null;};}function removeEntity(_0x17ed4b,_0x558e24){return function(_0x1ca41b){if(_0x1ca41b){return _0x1ca41b[_0xe7a3('0x23')]()[_0xe7a3('0x22')](function(){var _0x2d7e5e=_0x1ca41b[_0xe7a3('0x24')]({'plain':!![]});var _0x3917a1=_0xe7a3('0x25');return db[_0xe7a3('0x26')]['destroy']({'where':{'type':_0x3917a1,'resourceId':_0x2d7e5e['id']}})[_0xe7a3('0x22')](function(){return _0x1ca41b;});})[_0xe7a3('0x22')](function(){_0x17ed4b[_0xe7a3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afeaf,_0x2d7cd2){return function(_0x4535ed){if(!_0x4535ed){_0x1afeaf[_0xe7a3('0x18')](0x194);}return _0x4535ed;};}function handleError(_0x31e27c,_0x58e43b){_0x58e43b=_0x58e43b||0x1f4;return function(_0x27a96e){logger[_0xe7a3('0x27')](_0x27a96e['stack']);if(_0x27a96e[_0xe7a3('0x28')]){delete _0x27a96e['name'];}_0x31e27c[_0xe7a3('0x1c')](_0x58e43b)[_0xe7a3('0x29')](_0x27a96e);};}exports[_0xe7a3('0x2a')]=function(_0xf952e5,_0x54cfbc){var _0x385b38={},_0x36fa2e={},_0x1456ee={'count':0x0,'rows':[]};var _0x3a4253=db[_0xe7a3('0x2b')][_0xe7a3('0x2c')];_0x36fa2e[_0xe7a3('0x2d')]=_[_0xe7a3('0x2e')](_0x3a4253);_0x36fa2e[_0xe7a3('0x2f')]=_[_0xe7a3('0x2e')](_0xf952e5[_0xe7a3('0x2f')]);_0x36fa2e[_0xe7a3('0x30')]=_['intersection'](_0x36fa2e[_0xe7a3('0x2d')],_0x36fa2e[_0xe7a3('0x2f')]);_0x385b38['attributes']=_[_0xe7a3('0x31')](_0x36fa2e['model'],qs['fields'](_0xf952e5['query'][_0xe7a3('0x32')]));_0x385b38[_0xe7a3('0x33')]=_0x385b38[_0xe7a3('0x33')][_0xe7a3('0x34')]?_0x385b38['attributes']:_0x36fa2e[_0xe7a3('0x2d')];if(!_0xf952e5[_0xe7a3('0x2f')][_0xe7a3('0x35')](_0xe7a3('0x36'))){_0x385b38['limit']=qs[_0xe7a3('0x37')](_0xf952e5[_0xe7a3('0x2f')][_0xe7a3('0x37')]);_0x385b38[_0xe7a3('0x1b')]=qs['offset'](_0xf952e5[_0xe7a3('0x2f')][_0xe7a3('0x1b')]);}_0x385b38['order']=qs[_0xe7a3('0x38')](_0xf952e5[_0xe7a3('0x2f')][_0xe7a3('0x38')]);_0x385b38[_0xe7a3('0x39')]=qs[_0xe7a3('0x30')](_[_0xe7a3('0x3a')](_0xf952e5[_0xe7a3('0x2f')],_0x36fa2e[_0xe7a3('0x30')]));if(_0xf952e5[_0xe7a3('0x2f')]['filter']){_0x385b38[_0xe7a3('0x39')]=_[_0xe7a3('0x3b')](_0x385b38[_0xe7a3('0x39')],{'$or':_[_0xe7a3('0x3c')](_0x3a4253,function(_0x5b89c0){if(_0x5b89c0[_0xe7a3('0x3d')][_0xe7a3('0x3e')]!==_0xe7a3('0x3f')){var _0x5e3085={};_0x5e3085[_0x5b89c0['field']]={'$like':'%'+_0xf952e5[_0xe7a3('0x2f')][_0xe7a3('0x40')]+'%'};return _0x5e3085;}})});}_0x385b38=_[_0xe7a3('0x3b')]({},_0x385b38,_0xf952e5[_0xe7a3('0x41')]);var _0x1875e3={'where':_0x385b38[_0xe7a3('0x39')]};return db[_0xe7a3('0x2b')][_0xe7a3('0x1a')](_0x1875e3)[_0xe7a3('0x22')](function(_0x483b59){_0x1456ee[_0xe7a3('0x1a')]=_0x483b59;if(_0xf952e5[_0xe7a3('0x2f')]['includeAll']){_0x385b38[_0xe7a3('0x42')]=[{'all':!![]}];}return db[_0xe7a3('0x2b')][_0xe7a3('0x43')](_0x385b38);})[_0xe7a3('0x22')](function(_0x5161bf){_0x1456ee[_0xe7a3('0x44')]=_0x5161bf;return _0x1456ee;})[_0xe7a3('0x22')](respondWithFilteredResult(_0x54cfbc,_0x385b38))[_0xe7a3('0x45')](handleError(_0x54cfbc,null));};exports[_0xe7a3('0x46')]=function(_0x3d7bca,_0x261820){var _0x246320={'raw':!![],'where':{'id':_0x3d7bca[_0xe7a3('0x47')]['id']}},_0x56251f={};_0x56251f['model']=_[_0xe7a3('0x2e')](db[_0xe7a3('0x2b')][_0xe7a3('0x2c')]);_0x56251f[_0xe7a3('0x2f')]=_[_0xe7a3('0x2e')](_0x3d7bca[_0xe7a3('0x2f')]);_0x56251f['filters']=_[_0xe7a3('0x31')](_0x56251f['model'],_0x56251f[_0xe7a3('0x2f')]);_0x246320[_0xe7a3('0x33')]=_[_0xe7a3('0x31')](_0x56251f['model'],qs[_0xe7a3('0x32')](_0x3d7bca['query']['fields']));_0x246320['attributes']=_0x246320[_0xe7a3('0x33')][_0xe7a3('0x34')]?_0x246320[_0xe7a3('0x33')]:_0x56251f[_0xe7a3('0x2d')];if(_0x3d7bca[_0xe7a3('0x2f')][_0xe7a3('0x48')]){_0x246320[_0xe7a3('0x42')]=[{'all':!![]}];}_0x246320=_[_0xe7a3('0x3b')]({},_0x246320,_0x3d7bca['options']);return db[_0xe7a3('0x2b')][_0xe7a3('0x49')](_0x246320)[_0xe7a3('0x22')](handleEntityNotFound(_0x261820,null))['then'](respondWithResult(_0x261820,null))[_0xe7a3('0x45')](handleError(_0x261820,null));};exports[_0xe7a3('0x4a')]=function(_0x3fb9e1,_0x26de65){return db[_0xe7a3('0x2b')][_0xe7a3('0x4a')](_0x3fb9e1[_0xe7a3('0x4b')],{})['then'](function(_0x561f5b){var _0x1887a5=_0x3fb9e1[_0xe7a3('0x4c')][_0xe7a3('0x24')]({'plain':!![]});if(!_0x1887a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1887a5[_0xe7a3('0x4d')]==='user'){var _0x1bcd17=_0x561f5b[_0xe7a3('0x24')]({'plain':!![]});var _0x13594c='Templates';return db[_0xe7a3('0x4e')][_0xe7a3('0x49')]({'where':{'name':_0x13594c,'userProfileId':_0x1887a5[_0xe7a3('0x4f')]},'raw':!![]})[_0xe7a3('0x22')](function(_0x4d170c){if(_0x4d170c&&_0x4d170c[_0xe7a3('0x50')]===0x0){return db[_0xe7a3('0x26')][_0xe7a3('0x4a')]({'name':_0x1bcd17[_0xe7a3('0x28')],'resourceId':_0x1bcd17['id'],'type':_0x4d170c[_0xe7a3('0x28')],'sectionId':_0x4d170c['id']},{})['then'](function(){return _0x561f5b;});}else{return _0x561f5b;}})[_0xe7a3('0x45')](function(_0x1da55f){logger[_0xe7a3('0x27')](_0xe7a3('0x51'),_0x1da55f);throw _0x1da55f;});}return _0x561f5b;})[_0xe7a3('0x22')](respondWithResult(_0x26de65,0xc9))[_0xe7a3('0x45')](handleError(_0x26de65,null));};exports[_0xe7a3('0x21')]=function(_0x5357a9,_0x1fcd78){if(_0x5357a9[_0xe7a3('0x4b')]['id']){delete _0x5357a9['body']['id'];}return db[_0xe7a3('0x2b')]['find']({'where':{'id':_0x5357a9[_0xe7a3('0x47')]['id']}})[_0xe7a3('0x22')](handleEntityNotFound(_0x1fcd78,null))['then'](saveUpdates(_0x5357a9[_0xe7a3('0x4b')],null))[_0xe7a3('0x22')](respondWithResult(_0x1fcd78,null))[_0xe7a3('0x45')](handleError(_0x1fcd78,null));};exports[_0xe7a3('0x23')]=function(_0x1f2643,_0x57a394){return db[_0xe7a3('0x2b')][_0xe7a3('0x49')]({'where':{'id':_0x1f2643['params']['id']}})[_0xe7a3('0x22')](handleEntityNotFound(_0x57a394,null))[_0xe7a3('0x22')](removeEntity(_0x57a394,null))[_0xe7a3('0x45')](handleError(_0x57a394,null));}; \ No newline at end of file +var _0xf163=['update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','Template','findAll','rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf163,0x129));var _0x3f16=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xf163[_0x2c1114];return _0x2b877c;};'use strict';var pdf=require(_0x3f16('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f16('0x1'));var zipdir=require(_0x3f16('0x2'));var jsonpatch=require(_0x3f16('0x3'));var rp=require(_0x3f16('0x4'));var moment=require(_0x3f16('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3f16('0x6'));var util=require(_0x3f16('0x7'));var path=require('path');var sox=require(_0x3f16('0x8'));var csv=require(_0x3f16('0x9'));var ejs=require(_0x3f16('0xa'));var fs=require('fs');var _=require(_0x3f16('0xb'));var squel=require(_0x3f16('0xc'));var crypto=require(_0x3f16('0xd'));var jsforce=require(_0x3f16('0xe'));var deskjs=require(_0x3f16('0xf'));var toCsv=require(_0x3f16('0x9'));var querystring=require(_0x3f16('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f16('0x11'));var authService=require(_0x3f16('0x12'));var qs=require(_0x3f16('0x13'));var hardwareService=require(_0x3f16('0x14'));var logger=require(_0x3f16('0x15'))(_0x3f16('0x16'));var utils=require('../../config/utils');var config=require(_0x3f16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d611,_0x254ca7){_0x254ca7=_0x254ca7||0xcc;return function(_0xd36fd0){if(_0xd36fd0){return _0x33d611[_0x3f16('0x18')](_0x254ca7);}return _0x33d611[_0x3f16('0x19')](_0x254ca7)[_0x3f16('0x1a')]();};}function respondWithResult(_0x52175d,_0x421dc1){_0x421dc1=_0x421dc1||0xc8;return function(_0x36a20b){if(_0x36a20b){return _0x52175d[_0x3f16('0x19')](_0x421dc1)[_0x3f16('0x1b')](_0x36a20b);}};}function respondWithFilteredResult(_0xb28281,_0x479eaf){return function(_0x461d4e){if(_0x461d4e){var _0x5b0b3f=_0x461d4e[_0x3f16('0x1c')],_0x23e0e4=_0x479eaf[_0x3f16('0x1d')],_0x24c077=_0x479eaf[_0x3f16('0x1d')]+_0x479eaf[_0x3f16('0x1e')],_0x11a5d1;if(_0x24c077>=_0x5b0b3f){_0x24c077=_0x5b0b3f;_0x11a5d1=0xc8;}else{_0x11a5d1=0xce;}_0xb28281[_0x3f16('0x19')](_0x11a5d1);return _0xb28281[_0x3f16('0x1f')](_0x3f16('0x20'),_0x23e0e4+'-'+_0x24c077+'/'+_0x5b0b3f)[_0x3f16('0x1b')](_0x461d4e);}return null;};}function patchUpdates(_0x46b4da){return function(_0x19191e){try{jsonpatch[_0x3f16('0x21')](_0x19191e,_0x46b4da,!![]);}catch(_0x198372){return BPromise[_0x3f16('0x22')](_0x198372);}return _0x19191e['save']();};}function saveUpdates(_0x169cd2,_0x4dc797){return function(_0x27166c){if(_0x27166c){return _0x27166c[_0x3f16('0x23')](_0x169cd2)[_0x3f16('0x24')](function(_0x1f7020){return _0x1f7020;});}return null;};}function removeEntity(_0x4e76de,_0x27bba9){return function(_0xd451c6){if(_0xd451c6){return _0xd451c6[_0x3f16('0x25')]()[_0x3f16('0x24')](function(){var _0x18a18a=_0xd451c6[_0x3f16('0x26')]({'plain':!![]});var _0xa2a3b7=_0x3f16('0x27');return db[_0x3f16('0x28')][_0x3f16('0x25')]({'where':{'type':_0xa2a3b7,'resourceId':_0x18a18a['id']}})['then'](function(){return _0xd451c6;});})[_0x3f16('0x24')](function(){_0x4e76de['status'](0xcc)[_0x3f16('0x1a')]();});}};}function handleEntityNotFound(_0x42c8c4,_0x3916b6){return function(_0x2d9346){if(!_0x2d9346){_0x42c8c4['sendStatus'](0x194);}return _0x2d9346;};}function handleError(_0x5ae024,_0x44b8a6){_0x44b8a6=_0x44b8a6||0x1f4;return function(_0x20261f){logger[_0x3f16('0x29')](_0x20261f[_0x3f16('0x2a')]);if(_0x20261f[_0x3f16('0x2b')]){delete _0x20261f[_0x3f16('0x2b')];}_0x5ae024[_0x3f16('0x19')](_0x44b8a6)['send'](_0x20261f);};}exports[_0x3f16('0x2c')]=function(_0xb90034,_0x48227f){var _0x5ee64e={},_0xc5823a={},_0x14e7ad={'count':0x0,'rows':[]};var _0x5eff4f=db['Template'][_0x3f16('0x2d')];_0xc5823a[_0x3f16('0x2e')]=_['keys'](_0x5eff4f);_0xc5823a['query']=_[_0x3f16('0x2f')](_0xb90034[_0x3f16('0x30')]);_0xc5823a[_0x3f16('0x31')]=_[_0x3f16('0x32')](_0xc5823a[_0x3f16('0x2e')],_0xc5823a[_0x3f16('0x30')]);_0x5ee64e['attributes']=_[_0x3f16('0x32')](_0xc5823a[_0x3f16('0x2e')],qs[_0x3f16('0x33')](_0xb90034[_0x3f16('0x30')][_0x3f16('0x33')]));_0x5ee64e[_0x3f16('0x34')]=_0x5ee64e[_0x3f16('0x34')][_0x3f16('0x35')]?_0x5ee64e[_0x3f16('0x34')]:_0xc5823a['model'];if(!_0xb90034['query'][_0x3f16('0x36')](_0x3f16('0x37'))){_0x5ee64e['limit']=qs[_0x3f16('0x1e')](_0xb90034[_0x3f16('0x30')][_0x3f16('0x1e')]);_0x5ee64e[_0x3f16('0x1d')]=qs[_0x3f16('0x1d')](_0xb90034[_0x3f16('0x30')]['offset']);}_0x5ee64e[_0x3f16('0x38')]=qs[_0x3f16('0x39')](_0xb90034[_0x3f16('0x30')][_0x3f16('0x39')]);_0x5ee64e[_0x3f16('0x3a')]=qs[_0x3f16('0x31')](_[_0x3f16('0x3b')](_0xb90034[_0x3f16('0x30')],_0xc5823a[_0x3f16('0x31')]));if(_0xb90034[_0x3f16('0x30')][_0x3f16('0x3c')]){_0x5ee64e[_0x3f16('0x3a')]=_['merge'](_0x5ee64e[_0x3f16('0x3a')],{'$or':_[_0x3f16('0x3d')](_0x5eff4f,function(_0x3dccde){if(_0x3dccde[_0x3f16('0x3e')][_0x3f16('0x3f')]!==_0x3f16('0x40')){var _0x1ca2f2={};_0x1ca2f2[_0x3dccde[_0x3f16('0x41')]]={'$like':'%'+_0xb90034['query'][_0x3f16('0x3c')]+'%'};return _0x1ca2f2;}})});}_0x5ee64e=_[_0x3f16('0x42')]({},_0x5ee64e,_0xb90034[_0x3f16('0x43')]);var _0x173a9f={'where':_0x5ee64e[_0x3f16('0x3a')]};return db['Template'][_0x3f16('0x1c')](_0x173a9f)[_0x3f16('0x24')](function(_0x30c708){_0x14e7ad[_0x3f16('0x1c')]=_0x30c708;if(_0xb90034['query'][_0x3f16('0x44')]){_0x5ee64e[_0x3f16('0x45')]=[{'all':!![]}];}return db[_0x3f16('0x46')][_0x3f16('0x47')](_0x5ee64e);})['then'](function(_0x4ad275){_0x14e7ad[_0x3f16('0x48')]=_0x4ad275;return _0x14e7ad;})[_0x3f16('0x24')](respondWithFilteredResult(_0x48227f,_0x5ee64e))[_0x3f16('0x49')](handleError(_0x48227f,null));};exports[_0x3f16('0x4a')]=function(_0x37c5d8,_0x3207c8){var _0x3d17b8={'raw':!![],'where':{'id':_0x37c5d8[_0x3f16('0x4b')]['id']}},_0x5262a9={};_0x5262a9['model']=_[_0x3f16('0x2f')](db[_0x3f16('0x46')][_0x3f16('0x2d')]);_0x5262a9[_0x3f16('0x30')]=_[_0x3f16('0x2f')](_0x37c5d8['query']);_0x5262a9[_0x3f16('0x31')]=_[_0x3f16('0x32')](_0x5262a9[_0x3f16('0x2e')],_0x5262a9[_0x3f16('0x30')]);_0x3d17b8[_0x3f16('0x34')]=_['intersection'](_0x5262a9[_0x3f16('0x2e')],qs[_0x3f16('0x33')](_0x37c5d8[_0x3f16('0x30')]['fields']));_0x3d17b8['attributes']=_0x3d17b8[_0x3f16('0x34')]['length']?_0x3d17b8[_0x3f16('0x34')]:_0x5262a9[_0x3f16('0x2e')];if(_0x37c5d8[_0x3f16('0x30')][_0x3f16('0x44')]){_0x3d17b8['include']=[{'all':!![]}];}_0x3d17b8=_[_0x3f16('0x42')]({},_0x3d17b8,_0x37c5d8['options']);return db[_0x3f16('0x46')]['find'](_0x3d17b8)[_0x3f16('0x24')](handleEntityNotFound(_0x3207c8,null))[_0x3f16('0x24')](respondWithResult(_0x3207c8,null))['catch'](handleError(_0x3207c8,null));};exports['create']=function(_0x8482cc,_0x3d5e55){return db[_0x3f16('0x46')]['create'](_0x8482cc[_0x3f16('0x4c')],{})[_0x3f16('0x24')](function(_0xcb3511){var _0x1b38b4=_0x8482cc[_0x3f16('0x4d')]['get']({'plain':!![]});if(!_0x1b38b4)throw new Error(_0x3f16('0x4e'));if(_0x1b38b4['role']==='user'){var _0x59d583=_0xcb3511['get']({'plain':!![]});var _0x1df867=_0x3f16('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x1df867,'userProfileId':_0x1b38b4[_0x3f16('0x4f')]},'raw':!![]})[_0x3f16('0x24')](function(_0x357b3b){if(_0x357b3b&&_0x357b3b[_0x3f16('0x50')]===0x0){return db[_0x3f16('0x28')]['create']({'name':_0x59d583[_0x3f16('0x2b')],'resourceId':_0x59d583['id'],'type':_0x357b3b[_0x3f16('0x2b')],'sectionId':_0x357b3b['id']},{})[_0x3f16('0x24')](function(){return _0xcb3511;});}else{return _0xcb3511;}})['catch'](function(_0x14939e){logger[_0x3f16('0x29')](_0x3f16('0x51'),_0x14939e);throw _0x14939e;});}return _0xcb3511;})['then'](respondWithResult(_0x3d5e55,0xc9))[_0x3f16('0x49')](handleError(_0x3d5e55,null));};exports[_0x3f16('0x23')]=function(_0x6576de,_0xfa354b){if(_0x6576de[_0x3f16('0x4c')]['id']){delete _0x6576de[_0x3f16('0x4c')]['id'];}return db['Template'][_0x3f16('0x52')]({'where':{'id':_0x6576de[_0x3f16('0x4b')]['id']}})[_0x3f16('0x24')](handleEntityNotFound(_0xfa354b,null))['then'](saveUpdates(_0x6576de[_0x3f16('0x4c')],null))[_0x3f16('0x24')](respondWithResult(_0xfa354b,null))['catch'](handleError(_0xfa354b,null));};exports['destroy']=function(_0x403307,_0x2991ab){return db[_0x3f16('0x46')][_0x3f16('0x52')]({'where':{'id':_0x403307['params']['id']}})[_0x3f16('0x24')](handleEntityNotFound(_0x2991ab,null))[_0x3f16('0x24')](removeEntity(_0x2991ab,null))[_0x3f16('0x49')](handleError(_0x2991ab,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index d4731fa..ac4dc2d 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 _0x3423=['Template','tools_templates','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x1383ff,_0x7c6f31){var _0x2edd17=function(_0x44ed17){while(--_0x44ed17){_0x1383ff['push'](_0x1383ff['shift']());}};_0x2edd17(++_0x7c6f31);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','util'];(function(_0x4c4d10,_0x385ce5){var _0x573457=function(_0x387e4d){while(--_0x387e4d){_0x4c4d10['push'](_0x4c4d10['shift']());}};_0x573457(++_0x385ce5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index abedfbf..730c490 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 _0x92ff=['catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92ff,0x11b));var _0xf92f=function(_0x987ca1,_0x25b789){_0x987ca1=_0x987ca1-0x0;var _0x1467ff=_0x92ff[_0x987ca1];return _0x1467ff;};'use strict';var _=require(_0xf92f('0x0'));var util=require('util');var moment=require(_0xf92f('0x1'));var BPromise=require(_0xf92f('0x2'));var rs=require(_0xf92f('0x3'));var fs=require('fs');var Redis=require(_0xf92f('0x4'));var db=require(_0xf92f('0x5'))['db'];var utils=require(_0xf92f('0x6'));var logger=require(_0xf92f('0x7'))(_0xf92f('0x8'));var config=require(_0xf92f('0x9'));var jayson=require(_0xf92f('0xa'));var client=jayson['client'][_0xf92f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49731d,_0x5751c0,_0x4945e9){return new BPromise(function(_0x281d4e,_0x23217b){return client[_0xf92f('0xc')](_0x49731d,_0x4945e9)[_0xf92f('0xd')](function(_0xc76840){logger[_0xf92f('0xe')](_0xf92f('0xf'),_0x5751c0,_0xf92f('0x10'));logger[_0xf92f('0x11')](_0xf92f('0x12'),_0x5751c0,'request\x20sent',JSON['stringify'](_0xc76840));if(_0xc76840['error']){if(_0xc76840['error'][_0xf92f('0x13')]===0x1f4){logger[_0xf92f('0x14')]('Template,\x20%s,\x20%s',_0x5751c0,_0xc76840[_0xf92f('0x14')][_0xf92f('0x15')]);return _0x23217b(_0xc76840[_0xf92f('0x14')][_0xf92f('0x15')]);}logger['error'](_0xf92f('0xf'),_0x5751c0,_0xc76840[_0xf92f('0x14')]['message']);return _0x281d4e(_0xc76840[_0xf92f('0x14')][_0xf92f('0x15')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x5751c0,_0xf92f('0x10'));_0x281d4e(_0xc76840[_0xf92f('0x16')][_0xf92f('0x15')]);}})[_0xf92f('0x17')](function(_0x2519c1){logger[_0xf92f('0x14')](_0xf92f('0xf'),_0x5751c0,_0x2519c1);_0x23217b(_0x2519c1);});});}exports[_0xf92f('0x18')]=function(_0x37b07a){var _0x48ac44=this;return new Promise(function(_0x4aaa3e,_0x4b357d){return db['Template'][_0xf92f('0x19')]({'raw':_0x37b07a[_0xf92f('0x1a')]?_0x37b07a[_0xf92f('0x1a')][_0xf92f('0x1b')]===undefined?!![]:![]:!![],'where':_0x37b07a[_0xf92f('0x1a')]?_0x37b07a['options'][_0xf92f('0x1c')]||null:null,'attributes':_0x37b07a[_0xf92f('0x1a')]?_0x37b07a[_0xf92f('0x1a')][_0xf92f('0x1d')]||null:null,'limit':_0x37b07a[_0xf92f('0x1a')]?_0x37b07a[_0xf92f('0x1a')][_0xf92f('0x1e')]||null:null,'include':_0x37b07a[_0xf92f('0x1a')]?_0x37b07a[_0xf92f('0x1a')][_0xf92f('0x1f')]?_[_0xf92f('0x20')](_0x37b07a[_0xf92f('0x1a')][_0xf92f('0x1f')],function(_0x1a23d3){return{'model':db[_0x1a23d3['model']],'as':_0x1a23d3['as'],'attributes':_0x1a23d3[_0xf92f('0x1d')],'include':_0x1a23d3['include']?_[_0xf92f('0x20')](_0x1a23d3[_0xf92f('0x1f')],function(_0x298612){return{'model':db[_0x298612[_0xf92f('0x21')]],'as':_0x298612['as'],'attributes':_0x298612[_0xf92f('0x1d')],'include':_0x298612[_0xf92f('0x1f')]?_[_0xf92f('0x20')](_0x298612['include'],function(_0xb963d1){return{'model':db[_0xb963d1[_0xf92f('0x21')]],'as':_0xb963d1['as'],'attributes':_0xb963d1[_0xf92f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf92f('0xd')](function(_0x20bf71){logger[_0xf92f('0xe')](_0xf92f('0x18'),_0x37b07a);logger[_0xf92f('0x11')](_0xf92f('0x18'),_0x37b07a,JSON['stringify'](_0x20bf71));_0x4aaa3e(_0x20bf71);})[_0xf92f('0x17')](function(_0x248ef9){logger[_0xf92f('0x14')](_0xf92f('0x18'),_0x248ef9[_0xf92f('0x15')],_0x37b07a);_0x4b357d(_0x48ac44['error'](0x1f4,_0x248ef9[_0xf92f('0x15')]));});});}; \ No newline at end of file +var _0x0e8b=['Template','options','where','attributes','limit','include','map','model','then','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x0e8b,0x18f));var _0xb0e8=function(_0x322297,_0x511ed1){_0x322297=_0x322297-0x0;var _0x1b73f7=_0x0e8b[_0x322297];return _0x1b73f7;};'use strict';var _=require(_0xb0e8('0x0'));var util=require(_0xb0e8('0x1'));var moment=require('moment');var BPromise=require(_0xb0e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0e8('0x3'));var db=require(_0xb0e8('0x4'))['db'];var utils=require(_0xb0e8('0x5'));var logger=require(_0xb0e8('0x6'))(_0xb0e8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb0e8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3570c2,_0x354331,_0x3fe428){return new BPromise(function(_0x3e983d,_0x10304f){return client[_0xb0e8('0x9')](_0x3570c2,_0x3fe428)['then'](function(_0x5a0efa){logger[_0xb0e8('0xa')]('Template,\x20%s,\x20%s',_0x354331,_0xb0e8('0xb'));logger[_0xb0e8('0xc')](_0xb0e8('0xd'),_0x354331,_0xb0e8('0xb'),JSON[_0xb0e8('0xe')](_0x5a0efa));if(_0x5a0efa[_0xb0e8('0xf')]){if(_0x5a0efa['error']['code']===0x1f4){logger['error'](_0xb0e8('0x10'),_0x354331,_0x5a0efa['error'][_0xb0e8('0x11')]);return _0x10304f(_0x5a0efa[_0xb0e8('0xf')][_0xb0e8('0x11')]);}logger[_0xb0e8('0xf')](_0xb0e8('0x10'),_0x354331,_0x5a0efa[_0xb0e8('0xf')]['message']);return _0x3e983d(_0x5a0efa[_0xb0e8('0xf')][_0xb0e8('0x11')]);}else{logger['info'](_0xb0e8('0x10'),_0x354331,_0xb0e8('0xb'));_0x3e983d(_0x5a0efa[_0xb0e8('0x12')][_0xb0e8('0x11')]);}})[_0xb0e8('0x13')](function(_0x5a736f){logger[_0xb0e8('0xf')](_0xb0e8('0x10'),_0x354331,_0x5a736f);_0x10304f(_0x5a736f);});});}exports[_0xb0e8('0x14')]=function(_0x17f920){var _0x18c161=this;return new Promise(function(_0x4c20e3,_0x3b04fb){return db[_0xb0e8('0x15')]['findAll']({'raw':_0x17f920[_0xb0e8('0x16')]?_0x17f920['options']['raw']===undefined?!![]:![]:!![],'where':_0x17f920[_0xb0e8('0x16')]?_0x17f920[_0xb0e8('0x16')][_0xb0e8('0x17')]||null:null,'attributes':_0x17f920[_0xb0e8('0x16')]?_0x17f920[_0xb0e8('0x16')][_0xb0e8('0x18')]||null:null,'limit':_0x17f920['options']?_0x17f920[_0xb0e8('0x16')][_0xb0e8('0x19')]||null:null,'include':_0x17f920[_0xb0e8('0x16')]?_0x17f920['options'][_0xb0e8('0x1a')]?_[_0xb0e8('0x1b')](_0x17f920[_0xb0e8('0x16')][_0xb0e8('0x1a')],function(_0x184c60){return{'model':db[_0x184c60[_0xb0e8('0x1c')]],'as':_0x184c60['as'],'attributes':_0x184c60[_0xb0e8('0x18')],'include':_0x184c60[_0xb0e8('0x1a')]?_[_0xb0e8('0x1b')](_0x184c60[_0xb0e8('0x1a')],function(_0x2e4f75){return{'model':db[_0x2e4f75['model']],'as':_0x2e4f75['as'],'attributes':_0x2e4f75[_0xb0e8('0x18')],'include':_0x2e4f75['include']?_[_0xb0e8('0x1b')](_0x2e4f75[_0xb0e8('0x1a')],function(_0x527ad1){return{'model':db[_0x527ad1[_0xb0e8('0x1c')]],'as':_0x527ad1['as'],'attributes':_0x527ad1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0e8('0x1d')](function(_0x5eec03){logger[_0xb0e8('0xa')](_0xb0e8('0x14'),_0x17f920);logger[_0xb0e8('0xc')](_0xb0e8('0x14'),_0x17f920,JSON[_0xb0e8('0xe')](_0x5eec03));_0x4c20e3(_0x5eec03);})[_0xb0e8('0x13')](function(_0x268427){logger[_0xb0e8('0xf')]('GetTemplate',_0x268427[_0xb0e8('0x11')],_0x17f920);_0x3b04fb(_0x18c161['error'](0x1f4,_0x268427[_0xb0e8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2388827..fd6a485 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x2f3cb3,_0x6315c3){var _0x2ec620=function(_0x5c1bf6){while(--_0x5c1bf6){_0x2f3cb3['push'](_0x2f3cb3['shift']());}};_0x2ec620(++_0x6315c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x4a146b,_0x1284eb){var _0x51ef35=function(_0x22c146){while(--_0x22c146){_0x4a146b['push'](_0x4a146b['shift']());}};_0x51ef35(++_0x1284eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 299bd2a..eaa376f 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 _0xd800=['exports','STRING','sequelize'];(function(_0x5cc5b2,_0xc7635e){var _0x16fff8=function(_0x6a7890){while(--_0x6a7890){_0x5cc5b2['push'](_0x5cc5b2['shift']());}};_0x16fff8(++_0xc7635e);}(_0xd800,0x1be));var _0x0d80=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xd800[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x0d80('0x0'));module[_0x0d80('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0d80('0x2')]},'description':{'type':Sequelize[_0x0d80('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x62c5=['sequelize','STRING','BOOLEAN'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x62c5,0xf3));var _0x562c=function(_0x2575eb,_0x456f3f){_0x2575eb=_0x2575eb-0x0;var _0x1c49da=_0x62c5[_0x2575eb];return _0x1c49da;};'use strict';var Sequelize=require(_0x562c('0x0'));module['exports']={'name':{'type':Sequelize[_0x562c('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x562c('0x1')]},'status':{'type':Sequelize[_0x562c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b37e8a4..51401df 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 _0x74dd=['status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','error','stack','send','index','Trigger','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','hasOwnProperty','nolimit','getAnyConditions','findOne','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x12e645,_0x4455fc){var _0x346ea0=function(_0x56053d){while(--_0x56053d){_0x12e645['push'](_0x12e645['shift']());}};_0x346ea0(++_0x4455fc);}(_0x74dd,0x154));var _0xd74d=function(_0x294b6,_0x2907ae){_0x294b6=_0x294b6-0x0;var _0x38bb97=_0x74dd[_0x294b6];return _0x38bb97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd74d('0x0'));var zipdir=require(_0xd74d('0x1'));var jsonpatch=require(_0xd74d('0x2'));var rp=require(_0xd74d('0x3'));var moment=require('moment');var BPromise=require(_0xd74d('0x4'));var Mustache=require(_0xd74d('0x5'));var util=require('util');var path=require(_0xd74d('0x6'));var sox=require(_0xd74d('0x7'));var csv=require(_0xd74d('0x8'));var ejs=require(_0xd74d('0x9'));var fs=require('fs');var _=require(_0xd74d('0xa'));var squel=require('squel');var crypto=require(_0xd74d('0xb'));var jsforce=require(_0xd74d('0xc'));var deskjs=require(_0xd74d('0xd'));var toCsv=require(_0xd74d('0x8'));var querystring=require('querystring');var Papa=require(_0xd74d('0xe'));var Redis=require(_0xd74d('0xf'));var authService=require(_0xd74d('0x10'));var qs=require(_0xd74d('0x11'));var hardwareService=require(_0xd74d('0x12'));var logger=require('../../config/logger')(_0xd74d('0x13'));var utils=require(_0xd74d('0x14'));var config=require(_0xd74d('0x15'));var db=require(_0xd74d('0x16'))['db'];function respondWithStatusCode(_0x254e4a,_0x162b95){_0x162b95=_0x162b95||0xcc;return function(_0x21f7e3){if(_0x21f7e3){return _0x254e4a[_0xd74d('0x17')](_0x162b95);}return _0x254e4a[_0xd74d('0x18')](_0x162b95)['end']();};}function respondWithResult(_0xb7a6fa,_0x39d899){_0x39d899=_0x39d899||0xc8;return function(_0x53331c){if(_0x53331c){return _0xb7a6fa[_0xd74d('0x18')](_0x39d899)[_0xd74d('0x19')](_0x53331c);}};}function respondWithFilteredResult(_0x515820,_0x4a296b){return function(_0x263de2){if(_0x263de2){var _0x290ed5=_0x263de2[_0xd74d('0x1a')],_0x145d3f=_0x4a296b[_0xd74d('0x1b')],_0x259a0d=_0x4a296b[_0xd74d('0x1b')]+_0x4a296b[_0xd74d('0x1c')],_0xd32649;if(_0x259a0d>=_0x290ed5){_0x259a0d=_0x290ed5;_0xd32649=0xc8;}else{_0xd32649=0xce;}_0x515820[_0xd74d('0x18')](_0xd32649);return _0x515820[_0xd74d('0x1d')]('Content-Range',_0x145d3f+'-'+_0x259a0d+'/'+_0x290ed5)[_0xd74d('0x19')](_0x263de2);}return null;};}function patchUpdates(_0x55621d){return function(_0x8cbacb){try{jsonpatch[_0xd74d('0x1e')](_0x8cbacb,_0x55621d,!![]);}catch(_0x7e2ad1){return BPromise[_0xd74d('0x1f')](_0x7e2ad1);}return _0x8cbacb[_0xd74d('0x20')]();};}function saveUpdates(_0x4fdd73,_0x5a757d){return function(_0x10a825){if(_0x10a825){return _0x10a825[_0xd74d('0x21')](_0x4fdd73)[_0xd74d('0x22')](function(_0x1fc3cb){return _0x1fc3cb;});}return null;};}function removeEntity(_0x4aa084,_0x1b4be9){return function(_0x109c81){if(_0x109c81){return _0x109c81[_0xd74d('0x23')]()[_0xd74d('0x22')](function(){var _0x21197a=_0x109c81[_0xd74d('0x24')]({'plain':!![]});var _0x4c5528='Triggers';return db['UserProfileResource'][_0xd74d('0x23')]({'where':{'type':_0x4c5528,'resourceId':_0x21197a['id']}})[_0xd74d('0x22')](function(){return _0x109c81;});})['then'](function(){_0x4aa084[_0xd74d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x558760,_0x3db974){return function(_0x17f2ed){if(!_0x17f2ed){_0x558760[_0xd74d('0x17')](0x194);}return _0x17f2ed;};}function handleError(_0x3353f2,_0x1aa671){_0x1aa671=_0x1aa671||0x1f4;return function(_0x3920bc){logger[_0xd74d('0x25')](_0x3920bc[_0xd74d('0x26')]);if(_0x3920bc['name']){delete _0x3920bc['name'];}_0x3353f2[_0xd74d('0x18')](_0x1aa671)[_0xd74d('0x27')](_0x3920bc);};}exports[_0xd74d('0x28')]=function(_0x32fbca,_0x3b86c3){var _0x57b14b={},_0x43d03b={},_0x1c6931={'count':0x0,'rows':[]};var _0x17c0d5=db[_0xd74d('0x29')][_0xd74d('0x2a')];_0x43d03b[_0xd74d('0x2b')]=_[_0xd74d('0x2c')](_0x17c0d5);_0x43d03b['query']=_[_0xd74d('0x2c')](_0x32fbca[_0xd74d('0x2d')]);_0x43d03b[_0xd74d('0x2e')]=_[_0xd74d('0x2f')](_0x43d03b['model'],_0x43d03b[_0xd74d('0x2d')]);_0x57b14b[_0xd74d('0x30')]=_[_0xd74d('0x2f')](_0x43d03b['model'],qs[_0xd74d('0x31')](_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x31')]));_0x57b14b[_0xd74d('0x30')]=_0x57b14b[_0xd74d('0x30')][_0xd74d('0x32')]?_0x57b14b[_0xd74d('0x30')]:_0x43d03b[_0xd74d('0x2b')];if(!_0x32fbca[_0xd74d('0x2d')]['hasOwnProperty']('nolimit')){_0x57b14b[_0xd74d('0x1c')]=qs[_0xd74d('0x1c')](_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x1c')]);_0x57b14b[_0xd74d('0x1b')]=qs[_0xd74d('0x1b')](_0x32fbca['query']['offset']);}_0x57b14b[_0xd74d('0x33')]=qs[_0xd74d('0x34')](_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x34')]);_0x57b14b['where']=qs[_0xd74d('0x2e')](_[_0xd74d('0x35')](_0x32fbca['query'],_0x43d03b[_0xd74d('0x2e')]));if(_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x36')]){_0x57b14b[_0xd74d('0x37')]=_[_0xd74d('0x38')](_0x57b14b[_0xd74d('0x37')],{'$or':_[_0xd74d('0x39')](_0x17c0d5,function(_0x2add7d){if(_0x2add7d[_0xd74d('0x3a')]['key']!==_0xd74d('0x3b')){var _0x3b7eb4={};_0x3b7eb4[_0x2add7d[_0xd74d('0x3c')]]={'$like':'%'+_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x36')]+'%'};return _0x3b7eb4;}})});}_0x57b14b=_[_0xd74d('0x38')]({},_0x57b14b,_0x32fbca[_0xd74d('0x3d')]);var _0x1cce05={'where':_0x57b14b[_0xd74d('0x37')]};return db[_0xd74d('0x29')]['count'](_0x1cce05)[_0xd74d('0x22')](function(_0x23ecfd){_0x1c6931[_0xd74d('0x1a')]=_0x23ecfd;if(_0x32fbca[_0xd74d('0x2d')][_0xd74d('0x3e')]){_0x57b14b['include']=[{'all':!![]}];}return db[_0xd74d('0x29')][_0xd74d('0x3f')](_0x57b14b);})[_0xd74d('0x22')](function(_0x344273){_0x1c6931[_0xd74d('0x40')]=_0x344273;return _0x1c6931;})[_0xd74d('0x22')](respondWithFilteredResult(_0x3b86c3,_0x57b14b))['catch'](handleError(_0x3b86c3,null));};exports[_0xd74d('0x41')]=function(_0x1b5096,_0x40722b){var _0x46f1e6={'raw':![],'where':{'id':_0x1b5096['params']['id']}},_0x74cca3={};_0x74cca3[_0xd74d('0x2b')]=_['keys'](db[_0xd74d('0x29')][_0xd74d('0x2a')]);_0x74cca3[_0xd74d('0x2d')]=_[_0xd74d('0x2c')](_0x1b5096[_0xd74d('0x2d')]);_0x74cca3['filters']=_['intersection'](_0x74cca3[_0xd74d('0x2b')],_0x74cca3[_0xd74d('0x2d')]);_0x46f1e6[_0xd74d('0x30')]=_[_0xd74d('0x2f')](_0x74cca3[_0xd74d('0x2b')],qs[_0xd74d('0x31')](_0x1b5096['query']['fields']));_0x46f1e6[_0xd74d('0x30')]=_0x46f1e6[_0xd74d('0x30')]['length']?_0x46f1e6['attributes']:_0x74cca3['model'];if(_0x1b5096[_0xd74d('0x2d')][_0xd74d('0x3e')]){_0x46f1e6[_0xd74d('0x42')]=[{'all':!![]}];}_0x46f1e6=_['merge']({},_0x46f1e6,_0x1b5096[_0xd74d('0x3d')]);return db[_0xd74d('0x29')][_0xd74d('0x43')](_0x46f1e6)['then'](handleEntityNotFound(_0x40722b,null))[_0xd74d('0x22')](respondWithResult(_0x40722b,null))[_0xd74d('0x44')](handleError(_0x40722b,null));};exports[_0xd74d('0x45')]=function(_0x16cf05,_0x5e9ffd){return db[_0xd74d('0x29')][_0xd74d('0x45')](_0x16cf05[_0xd74d('0x46')],{})[_0xd74d('0x22')](function(_0x43f97b){var _0x5cc21d=_0x16cf05[_0xd74d('0x47')][_0xd74d('0x24')]({'plain':!![]});if(!_0x5cc21d)throw new Error(_0xd74d('0x48'));if(_0x5cc21d[_0xd74d('0x49')]===_0xd74d('0x47')){var _0x57898c=_0x43f97b['get']({'plain':!![]});var _0x5bedfa='Triggers';return db[_0xd74d('0x4a')][_0xd74d('0x43')]({'where':{'name':_0x5bedfa,'userProfileId':_0x5cc21d['userProfileId']},'raw':!![]})['then'](function(_0x4178c3){if(_0x4178c3&&_0x4178c3[_0xd74d('0x4b')]===0x0){return db[_0xd74d('0x4c')][_0xd74d('0x45')]({'name':_0x57898c['name'],'resourceId':_0x57898c['id'],'type':_0x4178c3['name'],'sectionId':_0x4178c3['id']},{})[_0xd74d('0x22')](function(){return _0x43f97b;});}else{return _0x43f97b;}})[_0xd74d('0x44')](function(_0x260c65){logger['error'](_0xd74d('0x4d'),_0x260c65);throw _0x260c65;});}return _0x43f97b;})['then'](respondWithResult(_0x5e9ffd,0xc9))[_0xd74d('0x44')](handleError(_0x5e9ffd,null));};exports[_0xd74d('0x21')]=function(_0x5e4342,_0x4b84ef){if(_0x5e4342[_0xd74d('0x46')]['id']){delete _0x5e4342[_0xd74d('0x46')]['id'];}return db[_0xd74d('0x29')]['find']({'where':{'id':_0x5e4342[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0x4b84ef,null))[_0xd74d('0x22')](saveUpdates(_0x5e4342[_0xd74d('0x46')],null))['then'](respondWithResult(_0x4b84ef,null))['catch'](handleError(_0x4b84ef,null));};exports[_0xd74d('0x23')]=function(_0x292ec0,_0x244737){return db[_0xd74d('0x29')]['find']({'where':{'id':_0x292ec0[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0x244737,null))[_0xd74d('0x22')](removeEntity(_0x244737,null))['catch'](handleError(_0x244737,null));};exports[_0xd74d('0x4f')]=function(_0x3024bf,_0xd70120,_0x382498){if(_0x3024bf[_0xd74d('0x46')]['id']){delete _0x3024bf[_0xd74d('0x46')]['id'];}return db['Trigger'][_0xd74d('0x43')]({'where':{'id':_0x3024bf[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0xd70120,null))[_0xd74d('0x22')](function(_0x66ba59){if(_0x66ba59){_0x3024bf['body'][_0xd74d('0x50')]=_0x66ba59['id'];return db[_0xd74d('0x51')][_0xd74d('0x45')](_0x3024bf[_0xd74d('0x46')]);}})[_0xd74d('0x22')](respondWithResult(_0xd70120,null))[_0xd74d('0x44')](handleError(_0xd70120,null));};exports[_0xd74d('0x52')]=function(_0x22df42,_0xf04357,_0x36e455){if(_0x22df42['body']['id']){delete _0x22df42[_0xd74d('0x46')]['id'];}return db[_0xd74d('0x29')]['find']({'where':{'id':_0x22df42[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0xf04357,null))['then'](function(_0x3664dd){if(_0x3664dd){_0x22df42[_0xd74d('0x46')][_0xd74d('0x53')]=_0x3664dd['id'];return db[_0xd74d('0x51')][_0xd74d('0x45')](_0x22df42[_0xd74d('0x46')]);}})[_0xd74d('0x22')](respondWithResult(_0xf04357,null))[_0xd74d('0x44')](handleError(_0xf04357,null));};exports['getAllConditions']=function(_0x31086d,_0x2f4ea3,_0x51276c){var _0x43b7a4={};var _0x355a11={};var _0x2e61a2;var _0x30befc;return db['Trigger']['findOne']({'where':{'id':_0x31086d[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0x2f4ea3,null))[_0xd74d('0x22')](function(_0xc5b7b2){if(_0xc5b7b2){_0x2e61a2=_0xc5b7b2;_0x355a11['model']=_['keys'](db[_0xd74d('0x51')]['rawAttributes']);_0x355a11[_0xd74d('0x2d')]=_[_0xd74d('0x2c')](_0x31086d[_0xd74d('0x2d')]);_0x355a11[_0xd74d('0x2e')]=_[_0xd74d('0x2f')](_0x355a11[_0xd74d('0x2b')],_0x355a11[_0xd74d('0x2d')]);_0x43b7a4[_0xd74d('0x30')]=_['intersection'](_0x355a11[_0xd74d('0x2b')],qs['fields'](_0x31086d['query'][_0xd74d('0x31')]));_0x43b7a4[_0xd74d('0x30')]=_0x43b7a4[_0xd74d('0x30')][_0xd74d('0x32')]?_0x43b7a4['attributes']:_0x355a11[_0xd74d('0x2b')];_0x43b7a4[_0xd74d('0x33')]=qs[_0xd74d('0x34')](_0x31086d[_0xd74d('0x2d')]['sort']);_0x43b7a4[_0xd74d('0x37')]=qs['filters'](_['pick'](_0x31086d['query'],_0x355a11['filters']));if(_0x31086d[_0xd74d('0x2d')][_0xd74d('0x36')]){_0x43b7a4[_0xd74d('0x37')]=_[_0xd74d('0x38')](_0x43b7a4[_0xd74d('0x37')],{'$or':_[_0xd74d('0x39')](_0x43b7a4[_0xd74d('0x30')],function(_0x3f33ab){var _0x28a45a={};_0x28a45a[_0x3f33ab]={'$like':'%'+_0x31086d[_0xd74d('0x2d')][_0xd74d('0x36')]+'%'};return _0x28a45a;})});}_0x43b7a4=_[_0xd74d('0x38')]({},_0x43b7a4,_0x31086d['options']);return _0x2e61a2['getAllConditions'](_0x43b7a4);}})['then'](function(_0x15cb68){if(_0x15cb68){_0x30befc=_0x15cb68[_0xd74d('0x32')];if(!_0x31086d[_0xd74d('0x2d')][_0xd74d('0x54')](_0xd74d('0x55'))){_0x43b7a4['limit']=qs[_0xd74d('0x1c')](_0x31086d['query']['limit']);_0x43b7a4['offset']=qs[_0xd74d('0x1b')](_0x31086d['query'][_0xd74d('0x1b')]);}return _0x2e61a2['getAllConditions'](_0x43b7a4);}})[_0xd74d('0x22')](function(_0x1c19a7){if(_0x1c19a7){return _0x1c19a7?{'count':_0x30befc,'rows':_0x1c19a7}:null;}})[_0xd74d('0x22')](respondWithResult(_0x2f4ea3,null))[_0xd74d('0x44')](handleError(_0x2f4ea3,null));};exports[_0xd74d('0x56')]=function(_0x2c325d,_0x36603d,_0x2caa2d){var _0x55354d={};var _0x4b8e21={};var _0x4805ea;var _0x2a61e7;return db[_0xd74d('0x29')][_0xd74d('0x57')]({'where':{'id':_0x2c325d[_0xd74d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36603d,null))[_0xd74d('0x22')](function(_0x219caa){if(_0x219caa){_0x4805ea=_0x219caa;_0x4b8e21['model']=_[_0xd74d('0x2c')](db[_0xd74d('0x51')]['rawAttributes']);_0x4b8e21[_0xd74d('0x2d')]=_[_0xd74d('0x2c')](_0x2c325d[_0xd74d('0x2d')]);_0x4b8e21['filters']=_[_0xd74d('0x2f')](_0x4b8e21[_0xd74d('0x2b')],_0x4b8e21[_0xd74d('0x2d')]);_0x55354d[_0xd74d('0x30')]=_['intersection'](_0x4b8e21[_0xd74d('0x2b')],qs[_0xd74d('0x31')](_0x2c325d[_0xd74d('0x2d')]['fields']));_0x55354d[_0xd74d('0x30')]=_0x55354d['attributes'][_0xd74d('0x32')]?_0x55354d[_0xd74d('0x30')]:_0x4b8e21[_0xd74d('0x2b')];_0x55354d['order']=qs[_0xd74d('0x34')](_0x2c325d[_0xd74d('0x2d')][_0xd74d('0x34')]);_0x55354d[_0xd74d('0x37')]=qs[_0xd74d('0x2e')](_[_0xd74d('0x35')](_0x2c325d[_0xd74d('0x2d')],_0x4b8e21[_0xd74d('0x2e')]));if(_0x2c325d[_0xd74d('0x2d')][_0xd74d('0x36')]){_0x55354d[_0xd74d('0x37')]=_['merge'](_0x55354d[_0xd74d('0x37')],{'$or':_[_0xd74d('0x39')](_0x55354d[_0xd74d('0x30')],function(_0x39d31c){var _0x224d54={};_0x224d54[_0x39d31c]={'$like':'%'+_0x2c325d[_0xd74d('0x2d')]['filter']+'%'};return _0x224d54;})});}_0x55354d=_['merge']({},_0x55354d,_0x2c325d[_0xd74d('0x3d')]);return _0x4805ea[_0xd74d('0x56')](_0x55354d);}})[_0xd74d('0x22')](function(_0x2ed275){if(_0x2ed275){_0x2a61e7=_0x2ed275[_0xd74d('0x32')];if(!_0x2c325d[_0xd74d('0x2d')][_0xd74d('0x54')]('nolimit')){_0x55354d[_0xd74d('0x1c')]=qs[_0xd74d('0x1c')](_0x2c325d[_0xd74d('0x2d')][_0xd74d('0x1c')]);_0x55354d[_0xd74d('0x1b')]=qs['offset'](_0x2c325d[_0xd74d('0x2d')]['offset']);}return _0x4805ea['getAnyConditions'](_0x55354d);}})[_0xd74d('0x22')](function(_0x242510){if(_0x242510){return _0x242510?{'count':_0x2a61e7,'rows':_0x242510}:null;}})[_0xd74d('0x22')](respondWithResult(_0x36603d,null))[_0xd74d('0x44')](handleError(_0x36603d,null));};exports[_0xd74d('0x58')]=function(_0x3cc08c,_0x5448f7,_0x44e55f){if(_0x3cc08c[_0xd74d('0x46')]['id']){delete _0x3cc08c[_0xd74d('0x46')]['id'];}return db[_0xd74d('0x29')]['find']({'where':{'id':_0x3cc08c[_0xd74d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5448f7,null))['then'](function(_0x44bcfc){if(_0x44bcfc){_0x3cc08c['body']['TriggerId']=_0x44bcfc['id'];return db[_0xd74d('0x59')][_0xd74d('0x45')](_0x3cc08c[_0xd74d('0x46')]);}})['then'](respondWithResult(_0x5448f7,null))[_0xd74d('0x44')](handleError(_0x5448f7,null));};exports[_0xd74d('0x5a')]=function(_0x54568e,_0x9153cc,_0x1e930a){var _0x15e98a={};var _0x21a108={};var _0x4c67e8;var _0x2f5170;return db[_0xd74d('0x29')][_0xd74d('0x57')]({'where':{'id':_0x54568e[_0xd74d('0x4e')]['id']}})[_0xd74d('0x22')](handleEntityNotFound(_0x9153cc,null))[_0xd74d('0x22')](function(_0x171716){if(_0x171716){_0x4c67e8=_0x171716;_0x21a108['model']=_[_0xd74d('0x2c')](db[_0xd74d('0x59')][_0xd74d('0x2a')]);_0x21a108['query']=_[_0xd74d('0x2c')](_0x54568e[_0xd74d('0x2d')]);_0x21a108[_0xd74d('0x2e')]=_['intersection'](_0x21a108[_0xd74d('0x2b')],_0x21a108[_0xd74d('0x2d')]);_0x15e98a['attributes']=_[_0xd74d('0x2f')](_0x21a108[_0xd74d('0x2b')],qs[_0xd74d('0x31')](_0x54568e[_0xd74d('0x2d')][_0xd74d('0x31')]));_0x15e98a[_0xd74d('0x30')]=_0x15e98a[_0xd74d('0x30')]['length']?_0x15e98a[_0xd74d('0x30')]:_0x21a108[_0xd74d('0x2b')];_0x15e98a[_0xd74d('0x33')]=qs['sort'](_0x54568e['query'][_0xd74d('0x34')]);_0x15e98a[_0xd74d('0x37')]=qs['filters'](_['pick'](_0x54568e[_0xd74d('0x2d')],_0x21a108[_0xd74d('0x2e')]));if(_0x54568e[_0xd74d('0x2d')][_0xd74d('0x36')]){_0x15e98a['where']=_['merge'](_0x15e98a[_0xd74d('0x37')],{'$or':_[_0xd74d('0x39')](_0x15e98a[_0xd74d('0x30')],function(_0x1cdd52){var _0x33f4a4={};_0x33f4a4[_0x1cdd52]={'$like':'%'+_0x54568e['query'][_0xd74d('0x36')]+'%'};return _0x33f4a4;})});}_0x15e98a=_[_0xd74d('0x38')]({},_0x15e98a,_0x54568e[_0xd74d('0x3d')]);return _0x4c67e8[_0xd74d('0x5a')](_0x15e98a);}})[_0xd74d('0x22')](function(_0x56c5aa){if(_0x56c5aa){_0x2f5170=_0x56c5aa['length'];if(!_0x54568e['query'][_0xd74d('0x54')]('nolimit')){_0x15e98a[_0xd74d('0x1c')]=qs[_0xd74d('0x1c')](_0x54568e[_0xd74d('0x2d')][_0xd74d('0x1c')]);_0x15e98a[_0xd74d('0x1b')]=qs['offset'](_0x54568e[_0xd74d('0x2d')][_0xd74d('0x1b')]);}return _0x4c67e8[_0xd74d('0x5a')](_0x15e98a);}})['then'](function(_0x3f9dc7){if(_0x3f9dc7){return _0x3f9dc7?{'count':_0x2f5170,'rows':_0x3f9dc7}:null;}})[_0xd74d('0x22')](respondWithResult(_0x9153cc,null))[_0xd74d('0x44')](handleError(_0x9153cc,null));}; \ No newline at end of file +var _0x75a9=['sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','index','Trigger','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','findOne','order','filter','map','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x75a9,0x156));var _0x975a=function(_0x152e0a,_0x435d78){_0x152e0a=_0x152e0a-0x0;var _0x9d67b8=_0x75a9[_0x152e0a];return _0x9d67b8;};'use strict';var pdf=require(_0x975a('0x0'));var emlformat=require(_0x975a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x975a('0x2'));var jsonpatch=require(_0x975a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x975a('0x4'));var Mustache=require(_0x975a('0x5'));var util=require(_0x975a('0x6'));var path=require('path');var sox=require(_0x975a('0x7'));var csv=require(_0x975a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x975a('0x9'));var squel=require('squel');var crypto=require(_0x975a('0xa'));var jsforce=require(_0x975a('0xb'));var deskjs=require(_0x975a('0xc'));var toCsv=require(_0x975a('0x8'));var querystring=require(_0x975a('0xd'));var Papa=require(_0x975a('0xe'));var Redis=require('ioredis');var authService=require(_0x975a('0xf'));var qs=require(_0x975a('0x10'));var hardwareService=require(_0x975a('0x11'));var logger=require(_0x975a('0x12'))('api');var utils=require(_0x975a('0x13'));var config=require(_0x975a('0x14'));var db=require(_0x975a('0x15'))['db'];function respondWithStatusCode(_0x3f27ae,_0x103410){_0x103410=_0x103410||0xcc;return function(_0x1a06da){if(_0x1a06da){return _0x3f27ae[_0x975a('0x16')](_0x103410);}return _0x3f27ae['status'](_0x103410)[_0x975a('0x17')]();};}function respondWithResult(_0x16d740,_0x16c07e){_0x16c07e=_0x16c07e||0xc8;return function(_0x20cc64){if(_0x20cc64){return _0x16d740[_0x975a('0x18')](_0x16c07e)[_0x975a('0x19')](_0x20cc64);}};}function respondWithFilteredResult(_0x594a3d,_0x3061db){return function(_0x542763){if(_0x542763){var _0x47505d=_0x542763[_0x975a('0x1a')],_0x6e330d=_0x3061db[_0x975a('0x1b')],_0x5d74c6=_0x3061db[_0x975a('0x1b')]+_0x3061db[_0x975a('0x1c')],_0xca0027;if(_0x5d74c6>=_0x47505d){_0x5d74c6=_0x47505d;_0xca0027=0xc8;}else{_0xca0027=0xce;}_0x594a3d[_0x975a('0x18')](_0xca0027);return _0x594a3d['set'](_0x975a('0x1d'),_0x6e330d+'-'+_0x5d74c6+'/'+_0x47505d)[_0x975a('0x19')](_0x542763);}return null;};}function patchUpdates(_0x416564){return function(_0x1e8959){try{jsonpatch[_0x975a('0x1e')](_0x1e8959,_0x416564,!![]);}catch(_0x51a1ec){return BPromise[_0x975a('0x1f')](_0x51a1ec);}return _0x1e8959[_0x975a('0x20')]();};}function saveUpdates(_0x39826c,_0x24330d){return function(_0x1073f4){if(_0x1073f4){return _0x1073f4[_0x975a('0x21')](_0x39826c)[_0x975a('0x22')](function(_0x4f980f){return _0x4f980f;});}return null;};}function removeEntity(_0x30cbe5,_0x348e26){return function(_0x4dc40a){if(_0x4dc40a){return _0x4dc40a[_0x975a('0x23')]()[_0x975a('0x22')](function(){var _0x44deaf=_0x4dc40a['get']({'plain':!![]});var _0x11af3a='Triggers';return db[_0x975a('0x24')]['destroy']({'where':{'type':_0x11af3a,'resourceId':_0x44deaf['id']}})['then'](function(){return _0x4dc40a;});})[_0x975a('0x22')](function(){_0x30cbe5['status'](0xcc)[_0x975a('0x17')]();});}};}function handleEntityNotFound(_0x35e086,_0x49f1a1){return function(_0x95c5fa){if(!_0x95c5fa){_0x35e086[_0x975a('0x16')](0x194);}return _0x95c5fa;};}function handleError(_0x56414e,_0x1bbb08){_0x1bbb08=_0x1bbb08||0x1f4;return function(_0x26b5d7){logger[_0x975a('0x25')](_0x26b5d7[_0x975a('0x26')]);if(_0x26b5d7['name']){delete _0x26b5d7['name'];}_0x56414e['status'](_0x1bbb08)['send'](_0x26b5d7);};}exports[_0x975a('0x27')]=function(_0x24a68e,_0x5ddb23){var _0x245a33={},_0x3d87bf={},_0xe10850={'count':0x0,'rows':[]};var _0x52eb6f=db[_0x975a('0x28')]['rawAttributes'];_0x3d87bf['model']=_[_0x975a('0x29')](_0x52eb6f);_0x3d87bf[_0x975a('0x2a')]=_['keys'](_0x24a68e[_0x975a('0x2a')]);_0x3d87bf['filters']=_[_0x975a('0x2b')](_0x3d87bf[_0x975a('0x2c')],_0x3d87bf[_0x975a('0x2a')]);_0x245a33['attributes']=_[_0x975a('0x2b')](_0x3d87bf[_0x975a('0x2c')],qs[_0x975a('0x2d')](_0x24a68e[_0x975a('0x2a')][_0x975a('0x2d')]));_0x245a33[_0x975a('0x2e')]=_0x245a33['attributes'][_0x975a('0x2f')]?_0x245a33[_0x975a('0x2e')]:_0x3d87bf[_0x975a('0x2c')];if(!_0x24a68e[_0x975a('0x2a')][_0x975a('0x30')](_0x975a('0x31'))){_0x245a33['limit']=qs['limit'](_0x24a68e[_0x975a('0x2a')]['limit']);_0x245a33[_0x975a('0x1b')]=qs[_0x975a('0x1b')](_0x24a68e[_0x975a('0x2a')][_0x975a('0x1b')]);}_0x245a33['order']=qs[_0x975a('0x32')](_0x24a68e['query']['sort']);_0x245a33[_0x975a('0x33')]=qs[_0x975a('0x34')](_[_0x975a('0x35')](_0x24a68e['query'],_0x3d87bf['filters']));if(_0x24a68e[_0x975a('0x2a')]['filter']){_0x245a33[_0x975a('0x33')]=_[_0x975a('0x36')](_0x245a33[_0x975a('0x33')],{'$or':_['map'](_0x52eb6f,function(_0x4335c4){if(_0x4335c4['type'][_0x975a('0x37')]!==_0x975a('0x38')){var _0x31a20b={};_0x31a20b[_0x4335c4[_0x975a('0x39')]]={'$like':'%'+_0x24a68e[_0x975a('0x2a')]['filter']+'%'};return _0x31a20b;}})});}_0x245a33=_['merge']({},_0x245a33,_0x24a68e[_0x975a('0x3a')]);var _0x302224={'where':_0x245a33[_0x975a('0x33')]};return db[_0x975a('0x28')][_0x975a('0x1a')](_0x302224)['then'](function(_0x125fbf){_0xe10850[_0x975a('0x1a')]=_0x125fbf;if(_0x24a68e[_0x975a('0x2a')][_0x975a('0x3b')]){_0x245a33[_0x975a('0x3c')]=[{'all':!![]}];}return db[_0x975a('0x28')][_0x975a('0x3d')](_0x245a33);})['then'](function(_0x1dda4f){_0xe10850[_0x975a('0x3e')]=_0x1dda4f;return _0xe10850;})[_0x975a('0x22')](respondWithFilteredResult(_0x5ddb23,_0x245a33))['catch'](handleError(_0x5ddb23,null));};exports[_0x975a('0x3f')]=function(_0x475b79,_0x8a6b5e){var _0x291d1f={'raw':![],'where':{'id':_0x475b79[_0x975a('0x40')]['id']}},_0x3c9174={};_0x3c9174[_0x975a('0x2c')]=_[_0x975a('0x29')](db['Trigger'][_0x975a('0x41')]);_0x3c9174[_0x975a('0x2a')]=_[_0x975a('0x29')](_0x475b79[_0x975a('0x2a')]);_0x3c9174['filters']=_[_0x975a('0x2b')](_0x3c9174[_0x975a('0x2c')],_0x3c9174[_0x975a('0x2a')]);_0x291d1f['attributes']=_[_0x975a('0x2b')](_0x3c9174['model'],qs[_0x975a('0x2d')](_0x475b79[_0x975a('0x2a')][_0x975a('0x2d')]));_0x291d1f[_0x975a('0x2e')]=_0x291d1f['attributes']['length']?_0x291d1f['attributes']:_0x3c9174[_0x975a('0x2c')];if(_0x475b79[_0x975a('0x2a')][_0x975a('0x3b')]){_0x291d1f[_0x975a('0x3c')]=[{'all':!![]}];}_0x291d1f=_[_0x975a('0x36')]({},_0x291d1f,_0x475b79[_0x975a('0x3a')]);return db[_0x975a('0x28')]['find'](_0x291d1f)[_0x975a('0x22')](handleEntityNotFound(_0x8a6b5e,null))[_0x975a('0x22')](respondWithResult(_0x8a6b5e,null))[_0x975a('0x42')](handleError(_0x8a6b5e,null));};exports[_0x975a('0x43')]=function(_0x5c3ced,_0xab66ad){return db[_0x975a('0x28')][_0x975a('0x43')](_0x5c3ced[_0x975a('0x44')],{})[_0x975a('0x22')](function(_0x4527d1){var _0x45f39b=_0x5c3ced[_0x975a('0x45')][_0x975a('0x46')]({'plain':!![]});if(!_0x45f39b)throw new Error(_0x975a('0x47'));if(_0x45f39b[_0x975a('0x48')]===_0x975a('0x45')){var _0x4808ab=_0x4527d1[_0x975a('0x46')]({'plain':!![]});var _0x121623='Triggers';return db[_0x975a('0x49')][_0x975a('0x4a')]({'where':{'name':_0x121623,'userProfileId':_0x45f39b['userProfileId']},'raw':!![]})['then'](function(_0x207e76){if(_0x207e76&&_0x207e76['autoAssociation']===0x0){return db[_0x975a('0x24')][_0x975a('0x43')]({'name':_0x4808ab['name'],'resourceId':_0x4808ab['id'],'type':_0x207e76[_0x975a('0x4b')],'sectionId':_0x207e76['id']},{})[_0x975a('0x22')](function(){return _0x4527d1;});}else{return _0x4527d1;}})[_0x975a('0x42')](function(_0x4e6125){logger[_0x975a('0x25')](_0x975a('0x4c'),_0x4e6125);throw _0x4e6125;});}return _0x4527d1;})[_0x975a('0x22')](respondWithResult(_0xab66ad,0xc9))[_0x975a('0x42')](handleError(_0xab66ad,null));};exports[_0x975a('0x21')]=function(_0xf39b47,_0x4d2b17){if(_0xf39b47[_0x975a('0x44')]['id']){delete _0xf39b47[_0x975a('0x44')]['id'];}return db['Trigger'][_0x975a('0x4a')]({'where':{'id':_0xf39b47[_0x975a('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d2b17,null))[_0x975a('0x22')](saveUpdates(_0xf39b47[_0x975a('0x44')],null))[_0x975a('0x22')](respondWithResult(_0x4d2b17,null))[_0x975a('0x42')](handleError(_0x4d2b17,null));};exports[_0x975a('0x23')]=function(_0x4eb18b,_0x230320){return db['Trigger'][_0x975a('0x4a')]({'where':{'id':_0x4eb18b[_0x975a('0x40')]['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x230320,null))['then'](removeEntity(_0x230320,null))[_0x975a('0x42')](handleError(_0x230320,null));};exports[_0x975a('0x4d')]=function(_0x2bd506,_0x2ad4c0,_0x509be2){if(_0x2bd506['body']['id']){delete _0x2bd506['body']['id'];}return db['Trigger'][_0x975a('0x4a')]({'where':{'id':_0x2bd506[_0x975a('0x40')]['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x2ad4c0,null))[_0x975a('0x22')](function(_0x182263){if(_0x182263){_0x2bd506[_0x975a('0x44')][_0x975a('0x4e')]=_0x182263['id'];return db[_0x975a('0x4f')][_0x975a('0x43')](_0x2bd506[_0x975a('0x44')]);}})[_0x975a('0x22')](respondWithResult(_0x2ad4c0,null))['catch'](handleError(_0x2ad4c0,null));};exports['addAnyCondition']=function(_0x1c4ffb,_0x3eae23,_0x4e8fa2){if(_0x1c4ffb[_0x975a('0x44')]['id']){delete _0x1c4ffb[_0x975a('0x44')]['id'];}return db[_0x975a('0x28')][_0x975a('0x4a')]({'where':{'id':_0x1c4ffb[_0x975a('0x40')]['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x3eae23,null))[_0x975a('0x22')](function(_0x571f89){if(_0x571f89){_0x1c4ffb[_0x975a('0x44')][_0x975a('0x50')]=_0x571f89['id'];return db[_0x975a('0x4f')][_0x975a('0x43')](_0x1c4ffb['body']);}})[_0x975a('0x22')](respondWithResult(_0x3eae23,null))[_0x975a('0x42')](handleError(_0x3eae23,null));};exports['getAllConditions']=function(_0x58cf6e,_0x29ac67,_0x41002e){var _0x52de61={};var _0x808f7b={};var _0x536535;var _0x516da8;return db['Trigger'][_0x975a('0x51')]({'where':{'id':_0x58cf6e[_0x975a('0x40')]['id']}})['then'](handleEntityNotFound(_0x29ac67,null))[_0x975a('0x22')](function(_0x55d9dc){if(_0x55d9dc){_0x536535=_0x55d9dc;_0x808f7b[_0x975a('0x2c')]=_[_0x975a('0x29')](db['Condition']['rawAttributes']);_0x808f7b[_0x975a('0x2a')]=_[_0x975a('0x29')](_0x58cf6e['query']);_0x808f7b[_0x975a('0x34')]=_['intersection'](_0x808f7b[_0x975a('0x2c')],_0x808f7b[_0x975a('0x2a')]);_0x52de61[_0x975a('0x2e')]=_[_0x975a('0x2b')](_0x808f7b[_0x975a('0x2c')],qs[_0x975a('0x2d')](_0x58cf6e[_0x975a('0x2a')][_0x975a('0x2d')]));_0x52de61['attributes']=_0x52de61[_0x975a('0x2e')][_0x975a('0x2f')]?_0x52de61[_0x975a('0x2e')]:_0x808f7b['model'];_0x52de61[_0x975a('0x52')]=qs[_0x975a('0x32')](_0x58cf6e[_0x975a('0x2a')][_0x975a('0x32')]);_0x52de61[_0x975a('0x33')]=qs[_0x975a('0x34')](_['pick'](_0x58cf6e[_0x975a('0x2a')],_0x808f7b[_0x975a('0x34')]));if(_0x58cf6e[_0x975a('0x2a')][_0x975a('0x53')]){_0x52de61[_0x975a('0x33')]=_[_0x975a('0x36')](_0x52de61[_0x975a('0x33')],{'$or':_[_0x975a('0x54')](_0x52de61[_0x975a('0x2e')],function(_0x2ec476){var _0x548d42={};_0x548d42[_0x2ec476]={'$like':'%'+_0x58cf6e[_0x975a('0x2a')][_0x975a('0x53')]+'%'};return _0x548d42;})});}_0x52de61=_[_0x975a('0x36')]({},_0x52de61,_0x58cf6e[_0x975a('0x3a')]);return _0x536535[_0x975a('0x55')](_0x52de61);}})[_0x975a('0x22')](function(_0x2ebc52){if(_0x2ebc52){_0x516da8=_0x2ebc52[_0x975a('0x2f')];if(!_0x58cf6e['query']['hasOwnProperty']('nolimit')){_0x52de61[_0x975a('0x1c')]=qs[_0x975a('0x1c')](_0x58cf6e['query'][_0x975a('0x1c')]);_0x52de61[_0x975a('0x1b')]=qs['offset'](_0x58cf6e[_0x975a('0x2a')][_0x975a('0x1b')]);}return _0x536535[_0x975a('0x55')](_0x52de61);}})['then'](function(_0x294ad0){if(_0x294ad0){return _0x294ad0?{'count':_0x516da8,'rows':_0x294ad0}:null;}})['then'](respondWithResult(_0x29ac67,null))[_0x975a('0x42')](handleError(_0x29ac67,null));};exports[_0x975a('0x56')]=function(_0x2c269b,_0x319a66,_0x2762cb){var _0x15b81={};var _0x3921a7={};var _0x3da073;var _0x2d03ff;return db['Trigger'][_0x975a('0x51')]({'where':{'id':_0x2c269b[_0x975a('0x40')]['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x319a66,null))[_0x975a('0x22')](function(_0x5303d0){if(_0x5303d0){_0x3da073=_0x5303d0;_0x3921a7[_0x975a('0x2c')]=_[_0x975a('0x29')](db[_0x975a('0x4f')]['rawAttributes']);_0x3921a7[_0x975a('0x2a')]=_[_0x975a('0x29')](_0x2c269b['query']);_0x3921a7[_0x975a('0x34')]=_['intersection'](_0x3921a7[_0x975a('0x2c')],_0x3921a7[_0x975a('0x2a')]);_0x15b81[_0x975a('0x2e')]=_[_0x975a('0x2b')](_0x3921a7[_0x975a('0x2c')],qs[_0x975a('0x2d')](_0x2c269b[_0x975a('0x2a')][_0x975a('0x2d')]));_0x15b81['attributes']=_0x15b81[_0x975a('0x2e')]['length']?_0x15b81[_0x975a('0x2e')]:_0x3921a7[_0x975a('0x2c')];_0x15b81['order']=qs[_0x975a('0x32')](_0x2c269b[_0x975a('0x2a')][_0x975a('0x32')]);_0x15b81[_0x975a('0x33')]=qs[_0x975a('0x34')](_['pick'](_0x2c269b[_0x975a('0x2a')],_0x3921a7['filters']));if(_0x2c269b[_0x975a('0x2a')][_0x975a('0x53')]){_0x15b81[_0x975a('0x33')]=_[_0x975a('0x36')](_0x15b81[_0x975a('0x33')],{'$or':_[_0x975a('0x54')](_0x15b81[_0x975a('0x2e')],function(_0x4b006a){var _0x319a2e={};_0x319a2e[_0x4b006a]={'$like':'%'+_0x2c269b[_0x975a('0x2a')][_0x975a('0x53')]+'%'};return _0x319a2e;})});}_0x15b81=_[_0x975a('0x36')]({},_0x15b81,_0x2c269b[_0x975a('0x3a')]);return _0x3da073[_0x975a('0x56')](_0x15b81);}})[_0x975a('0x22')](function(_0x629dab){if(_0x629dab){_0x2d03ff=_0x629dab[_0x975a('0x2f')];if(!_0x2c269b[_0x975a('0x2a')][_0x975a('0x30')]('nolimit')){_0x15b81[_0x975a('0x1c')]=qs[_0x975a('0x1c')](_0x2c269b[_0x975a('0x2a')][_0x975a('0x1c')]);_0x15b81['offset']=qs[_0x975a('0x1b')](_0x2c269b['query'][_0x975a('0x1b')]);}return _0x3da073['getAnyConditions'](_0x15b81);}})[_0x975a('0x22')](function(_0x53ad3a){if(_0x53ad3a){return _0x53ad3a?{'count':_0x2d03ff,'rows':_0x53ad3a}:null;}})['then'](respondWithResult(_0x319a66,null))[_0x975a('0x42')](handleError(_0x319a66,null));};exports[_0x975a('0x57')]=function(_0x1e2241,_0x11a9c7,_0x937dce){if(_0x1e2241[_0x975a('0x44')]['id']){delete _0x1e2241[_0x975a('0x44')]['id'];}return db[_0x975a('0x28')][_0x975a('0x4a')]({'where':{'id':_0x1e2241['params']['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x11a9c7,null))[_0x975a('0x22')](function(_0x20c373){if(_0x20c373){_0x1e2241[_0x975a('0x44')][_0x975a('0x58')]=_0x20c373['id'];return db[_0x975a('0x59')][_0x975a('0x43')](_0x1e2241['body']);}})[_0x975a('0x22')](respondWithResult(_0x11a9c7,null))['catch'](handleError(_0x11a9c7,null));};exports['getActions']=function(_0x59e5a5,_0x75bc14,_0x3f81f6){var _0x1d733e={};var _0x4bdb6a={};var _0x4daa1c;var _0x1c8cf1;return db[_0x975a('0x28')][_0x975a('0x51')]({'where':{'id':_0x59e5a5[_0x975a('0x40')]['id']}})[_0x975a('0x22')](handleEntityNotFound(_0x75bc14,null))['then'](function(_0x238ab3){if(_0x238ab3){_0x4daa1c=_0x238ab3;_0x4bdb6a[_0x975a('0x2c')]=_[_0x975a('0x29')](db[_0x975a('0x59')]['rawAttributes']);_0x4bdb6a[_0x975a('0x2a')]=_[_0x975a('0x29')](_0x59e5a5['query']);_0x4bdb6a['filters']=_[_0x975a('0x2b')](_0x4bdb6a['model'],_0x4bdb6a[_0x975a('0x2a')]);_0x1d733e[_0x975a('0x2e')]=_[_0x975a('0x2b')](_0x4bdb6a[_0x975a('0x2c')],qs[_0x975a('0x2d')](_0x59e5a5['query'][_0x975a('0x2d')]));_0x1d733e[_0x975a('0x2e')]=_0x1d733e['attributes'][_0x975a('0x2f')]?_0x1d733e[_0x975a('0x2e')]:_0x4bdb6a[_0x975a('0x2c')];_0x1d733e[_0x975a('0x52')]=qs['sort'](_0x59e5a5[_0x975a('0x2a')][_0x975a('0x32')]);_0x1d733e[_0x975a('0x33')]=qs['filters'](_[_0x975a('0x35')](_0x59e5a5[_0x975a('0x2a')],_0x4bdb6a['filters']));if(_0x59e5a5[_0x975a('0x2a')][_0x975a('0x53')]){_0x1d733e[_0x975a('0x33')]=_['merge'](_0x1d733e['where'],{'$or':_['map'](_0x1d733e[_0x975a('0x2e')],function(_0x2f6a6f){var _0x242134={};_0x242134[_0x2f6a6f]={'$like':'%'+_0x59e5a5[_0x975a('0x2a')][_0x975a('0x53')]+'%'};return _0x242134;})});}_0x1d733e=_[_0x975a('0x36')]({},_0x1d733e,_0x59e5a5[_0x975a('0x3a')]);return _0x4daa1c[_0x975a('0x5a')](_0x1d733e);}})[_0x975a('0x22')](function(_0x1ef0cf){if(_0x1ef0cf){_0x1c8cf1=_0x1ef0cf['length'];if(!_0x59e5a5[_0x975a('0x2a')][_0x975a('0x30')]('nolimit')){_0x1d733e[_0x975a('0x1c')]=qs['limit'](_0x59e5a5['query'][_0x975a('0x1c')]);_0x1d733e[_0x975a('0x1b')]=qs['offset'](_0x59e5a5[_0x975a('0x2a')][_0x975a('0x1b')]);}return _0x4daa1c[_0x975a('0x5a')](_0x1d733e);}})[_0x975a('0x22')](function(_0x49f722){if(_0x49f722){return _0x49f722?{'count':_0x1c8cf1,'rows':_0x49f722}:null;}})['then'](respondWithResult(_0x75bc14,null))[_0x975a('0x42')](handleError(_0x75bc14,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 757eb35..b055085 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 _0xa9e0=['../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1c0522,_0x3b909b){var _0x343256=function(_0x173601){while(--_0x173601){_0x1c0522['push'](_0x1c0522['shift']());}};_0x343256(++_0x3b909b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x468cc7,_0x3096d8){var _0x329cc6=function(_0x1938b6){while(--_0x1938b6){_0x468cc7['push'](_0x468cc7['shift']());}};_0x329cc6(++_0x3096d8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index d8a00e9..2afff6f 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 _0x16c6=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','findAll','options','attributes','limit','include','model','map','ShowTrigger','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24487f,_0x9b3ea0){var _0x456456=function(_0x2ba373){while(--_0x2ba373){_0x24487f['push'](_0x24487f['shift']());}};_0x456456(++_0x9b3ea0);}(_0x16c6,0xa2));var _0x616c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x16c6[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x616c('0x0'));var moment=require(_0x616c('0x1'));var BPromise=require(_0x616c('0x2'));var rs=require(_0x616c('0x3'));var fs=require('fs');var Redis=require(_0x616c('0x4'));var db=require(_0x616c('0x5'))['db'];var utils=require(_0x616c('0x6'));var logger=require(_0x616c('0x7'))(_0x616c('0x8'));var config=require(_0x616c('0x9'));var jayson=require(_0x616c('0xa'));var client=jayson[_0x616c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce7548,_0x4c3546,_0x38eddd){return new BPromise(function(_0x34f41d,_0x1976ff){return client[_0x616c('0xc')](_0xce7548,_0x38eddd)[_0x616c('0xd')](function(_0x5146b8){logger[_0x616c('0xe')](_0x616c('0xf'),_0x4c3546,_0x616c('0x10'));logger[_0x616c('0x11')](_0x616c('0x12'),_0x4c3546,_0x616c('0x10'),JSON[_0x616c('0x13')](_0x5146b8));if(_0x5146b8[_0x616c('0x14')]){if(_0x5146b8[_0x616c('0x14')]['code']===0x1f4){logger[_0x616c('0x14')]('Trigger,\x20%s,\x20%s',_0x4c3546,_0x5146b8['error']['message']);return _0x1976ff(_0x5146b8[_0x616c('0x14')]['message']);}logger[_0x616c('0x14')](_0x616c('0xf'),_0x4c3546,_0x5146b8[_0x616c('0x14')][_0x616c('0x15')]);return _0x34f41d(_0x5146b8[_0x616c('0x14')]['message']);}else{logger['info'](_0x616c('0xf'),_0x4c3546,_0x616c('0x10'));_0x34f41d(_0x5146b8[_0x616c('0x16')]['message']);}})[_0x616c('0x17')](function(_0xfc8e1a){logger[_0x616c('0x14')](_0x616c('0xf'),_0x4c3546,_0xfc8e1a);_0x1976ff(_0xfc8e1a);});});}exports[_0x616c('0x18')]=function(_0x202de7){var _0x94655a=this;return new Promise(function(_0x349f01,_0x1fef11){return db[_0x616c('0x19')][_0x616c('0x1a')]({'raw':_0x202de7[_0x616c('0x1b')]?_0x202de7[_0x616c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x202de7['options']?_0x202de7[_0x616c('0x1b')]['where']||null:null,'attributes':_0x202de7[_0x616c('0x1b')]?_0x202de7[_0x616c('0x1b')][_0x616c('0x1c')]||null:null,'limit':_0x202de7[_0x616c('0x1b')]?_0x202de7['options'][_0x616c('0x1d')]||null:null,'include':_0x202de7['options']?_0x202de7[_0x616c('0x1b')][_0x616c('0x1e')]?_['map'](_0x202de7['options'][_0x616c('0x1e')],function(_0x3322cb){return{'model':db[_0x3322cb[_0x616c('0x1f')]],'as':_0x3322cb['as'],'attributes':_0x3322cb[_0x616c('0x1c')],'include':_0x3322cb[_0x616c('0x1e')]?_[_0x616c('0x20')](_0x3322cb['include'],function(_0x2c00c9){return{'model':db[_0x2c00c9[_0x616c('0x1f')]],'as':_0x2c00c9['as'],'attributes':_0x2c00c9['attributes'],'include':_0x2c00c9['include']?_[_0x616c('0x20')](_0x2c00c9[_0x616c('0x1e')],function(_0x6beba9){return{'model':db[_0x6beba9[_0x616c('0x1f')]],'as':_0x6beba9['as'],'attributes':_0x6beba9['attributes']};}):[]};}):[]};}):[]:[]})[_0x616c('0xd')](function(_0x24607b){logger[_0x616c('0xe')]('GetTrigger',_0x202de7);logger[_0x616c('0x11')](_0x616c('0x18'),_0x202de7,JSON[_0x616c('0x13')](_0x24607b));_0x349f01(_0x24607b);})[_0x616c('0x17')](function(_0x5cb994){logger[_0x616c('0x14')]('GetTrigger',_0x5cb994['message'],_0x202de7);_0x1fef11(_0x94655a[_0x616c('0x14')](0x1f4,_0x5cb994[_0x616c('0x15')]));});});};exports[_0x616c('0x21')]=function(_0x5d3584){var _0x406dc9=this;return new Promise(function(_0x170901,_0x1de4a8){return db[_0x616c('0x19')][_0x616c('0x22')]({'raw':_0x5d3584[_0x616c('0x1b')]?_0x5d3584['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d3584[_0x616c('0x1b')]?_0x5d3584[_0x616c('0x1b')][_0x616c('0x23')]||null:null,'attributes':_0x5d3584[_0x616c('0x1b')]?_0x5d3584[_0x616c('0x1b')][_0x616c('0x1c')]||null:null,'include':_0x5d3584['options']?_0x5d3584['options'][_0x616c('0x1e')]?_[_0x616c('0x20')](_0x5d3584[_0x616c('0x1b')][_0x616c('0x1e')],function(_0x5871f9){return{'model':db[_0x5871f9[_0x616c('0x1f')]],'as':_0x5871f9['as'],'attributes':_0x5871f9[_0x616c('0x1c')],'include':_0x5871f9[_0x616c('0x1e')]?_[_0x616c('0x20')](_0x5871f9[_0x616c('0x1e')],function(_0x24e8f5){return{'model':db[_0x24e8f5[_0x616c('0x1f')]],'as':_0x24e8f5['as'],'attributes':_0x24e8f5[_0x616c('0x1c')],'include':_0x24e8f5['include']?_[_0x616c('0x20')](_0x24e8f5[_0x616c('0x1e')],function(_0x31ad1e){return{'model':db[_0x31ad1e[_0x616c('0x1f')]],'as':_0x31ad1e['as'],'attributes':_0x31ad1e[_0x616c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x616c('0xd')](function(_0x75456){logger['info'](_0x616c('0x21'),_0x5d3584);logger[_0x616c('0x11')](_0x616c('0x21'),_0x5d3584,JSON[_0x616c('0x13')](_0x75456));_0x170901(_0x75456);})[_0x616c('0x17')](function(_0x151379){logger[_0x616c('0x14')](_0x616c('0x21'),_0x151379[_0x616c('0x15')],_0x5d3584);_0x1de4a8(_0x406dc9['error'](0x1f4,_0x151379['message']));});});}; \ No newline at end of file +var _0xd72c=['findAll','options','attributes','include','map','model','debug','catch','find','raw','ShowTrigger','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetTrigger','Trigger'];(function(_0x3e48c8,_0x2e41ab){var _0x1a5536=function(_0x593951){while(--_0x593951){_0x3e48c8['push'](_0x3e48c8['shift']());}};_0x1a5536(++_0x2e41ab);}(_0xd72c,0xeb));var _0xcd72=function(_0x828609,_0x5f366c){_0x828609=_0x828609-0x0;var _0x7e9719=_0xd72c[_0x828609];return _0x7e9719;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcd72('0x0'));var rs=require(_0xcd72('0x1'));var fs=require('fs');var Redis=require(_0xcd72('0x2'));var db=require(_0xcd72('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd72('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd72('0x5'));var client=jayson[_0xcd72('0x6')][_0xcd72('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38b4cb,_0x5c805d,_0x83dbd6){return new BPromise(function(_0x171485,_0xb3b2b){return client[_0xcd72('0x8')](_0x38b4cb,_0x83dbd6)[_0xcd72('0x9')](function(_0x432df9){logger[_0xcd72('0xa')](_0xcd72('0xb'),_0x5c805d,'request\x20sent');logger['debug'](_0xcd72('0xc'),_0x5c805d,'request\x20sent',JSON[_0xcd72('0xd')](_0x432df9));if(_0x432df9[_0xcd72('0xe')]){if(_0x432df9[_0xcd72('0xe')][_0xcd72('0xf')]===0x1f4){logger[_0xcd72('0xe')](_0xcd72('0xb'),_0x5c805d,_0x432df9[_0xcd72('0xe')][_0xcd72('0x10')]);return _0xb3b2b(_0x432df9[_0xcd72('0xe')][_0xcd72('0x10')]);}logger[_0xcd72('0xe')](_0xcd72('0xb'),_0x5c805d,_0x432df9['error'][_0xcd72('0x10')]);return _0x171485(_0x432df9['error'][_0xcd72('0x10')]);}else{logger[_0xcd72('0xa')](_0xcd72('0xb'),_0x5c805d,_0xcd72('0x11'));_0x171485(_0x432df9[_0xcd72('0x12')][_0xcd72('0x10')]);}})['catch'](function(_0x28d830){logger[_0xcd72('0xe')](_0xcd72('0xb'),_0x5c805d,_0x28d830);_0xb3b2b(_0x28d830);});});}exports[_0xcd72('0x13')]=function(_0x91b860){var _0x1e5c97=this;return new Promise(function(_0x4bb815,_0x32e435){return db[_0xcd72('0x14')][_0xcd72('0x15')]({'raw':_0x91b860[_0xcd72('0x16')]?_0x91b860[_0xcd72('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x91b860[_0xcd72('0x16')]?_0x91b860[_0xcd72('0x16')]['where']||null:null,'attributes':_0x91b860[_0xcd72('0x16')]?_0x91b860['options'][_0xcd72('0x17')]||null:null,'limit':_0x91b860[_0xcd72('0x16')]?_0x91b860[_0xcd72('0x16')]['limit']||null:null,'include':_0x91b860[_0xcd72('0x16')]?_0x91b860['options'][_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x91b860[_0xcd72('0x16')][_0xcd72('0x18')],function(_0x1cb15b){return{'model':db[_0x1cb15b['model']],'as':_0x1cb15b['as'],'attributes':_0x1cb15b[_0xcd72('0x17')],'include':_0x1cb15b[_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x1cb15b['include'],function(_0x2d0b36){return{'model':db[_0x2d0b36[_0xcd72('0x1a')]],'as':_0x2d0b36['as'],'attributes':_0x2d0b36['attributes'],'include':_0x2d0b36[_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x2d0b36[_0xcd72('0x18')],function(_0x21980f){return{'model':db[_0x21980f[_0xcd72('0x1a')]],'as':_0x21980f['as'],'attributes':_0x21980f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd72('0x9')](function(_0x4e74d3){logger['info'](_0xcd72('0x13'),_0x91b860);logger[_0xcd72('0x1b')](_0xcd72('0x13'),_0x91b860,JSON[_0xcd72('0xd')](_0x4e74d3));_0x4bb815(_0x4e74d3);})[_0xcd72('0x1c')](function(_0x19b595){logger[_0xcd72('0xe')]('GetTrigger',_0x19b595[_0xcd72('0x10')],_0x91b860);_0x32e435(_0x1e5c97[_0xcd72('0xe')](0x1f4,_0x19b595[_0xcd72('0x10')]));});});};exports['ShowTrigger']=function(_0x5c39d2){var _0x2b4ad9=this;return new Promise(function(_0x73017,_0x14da44){return db[_0xcd72('0x14')][_0xcd72('0x1d')]({'raw':_0x5c39d2[_0xcd72('0x16')]?_0x5c39d2[_0xcd72('0x16')][_0xcd72('0x1e')]===undefined?!![]:![]:!![],'where':_0x5c39d2[_0xcd72('0x16')]?_0x5c39d2[_0xcd72('0x16')]['where']||null:null,'attributes':_0x5c39d2[_0xcd72('0x16')]?_0x5c39d2[_0xcd72('0x16')][_0xcd72('0x17')]||null:null,'include':_0x5c39d2['options']?_0x5c39d2[_0xcd72('0x16')][_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x5c39d2['options']['include'],function(_0x52b4bd){return{'model':db[_0x52b4bd[_0xcd72('0x1a')]],'as':_0x52b4bd['as'],'attributes':_0x52b4bd[_0xcd72('0x17')],'include':_0x52b4bd[_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x52b4bd[_0xcd72('0x18')],function(_0x147d8e){return{'model':db[_0x147d8e['model']],'as':_0x147d8e['as'],'attributes':_0x147d8e[_0xcd72('0x17')],'include':_0x147d8e[_0xcd72('0x18')]?_[_0xcd72('0x19')](_0x147d8e['include'],function(_0xaa5008){return{'model':db[_0xaa5008[_0xcd72('0x1a')]],'as':_0xaa5008['as'],'attributes':_0xaa5008[_0xcd72('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a00ec){logger['info'](_0xcd72('0x1f'),_0x5c39d2);logger['debug'](_0xcd72('0x1f'),_0x5c39d2,JSON['stringify'](_0x1a00ec));_0x73017(_0x1a00ec);})['catch'](function(_0xd9566f){logger[_0xcd72('0xe')](_0xcd72('0x1f'),_0xd9566f[_0xcd72('0x10')],_0x5c39d2);_0x14da44(_0x2b4ad9[_0xcd72('0xe')](0x1f4,_0xd9566f[_0xcd72('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d997e33..fc7e732 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 _0xa5ac=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x12b28f,_0x66f087){var _0x2d1bc8=function(_0x4e9f6a){while(--_0x4e9f6a){_0x12b28f['push'](_0x12b28f['shift']());}};_0x2d1bc8(++_0x66f087);}(_0xa5ac,0x87));var _0xca5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xca5a('0x0'));var util=require(_0xca5a('0x1'));var path=require(_0xca5a('0x2'));var timeout=require(_0xca5a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xca5a('0x4'));var interaction=require(_0xca5a('0x5'));var config=require(_0xca5a('0x6'));var controller=require(_0xca5a('0x7'));router[_0xca5a('0x8')]('/',auth[_0xca5a('0x9')](),controller[_0xca5a('0xa')]);router[_0xca5a('0x8')](_0xca5a('0xb'),auth[_0xca5a('0x9')](),controller['show']);router[_0xca5a('0xc')](_0xca5a('0xd'),auth[_0xca5a('0x9')](),controller[_0xca5a('0xe')]);router[_0xca5a('0xc')]('/',auth['isAuthenticated'](),controller[_0xca5a('0xf')]);router[_0xca5a('0x10')]('/:id',auth[_0xca5a('0x9')](),controller[_0xca5a('0x11')]);router[_0xca5a('0x12')](_0xca5a('0xb'),auth[_0xca5a('0x9')](),controller['destroy']);module[_0xca5a('0x13')]=router; \ No newline at end of file +var _0xe759=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/clone','clone','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xf3d5a0,_0x4c3828){var _0x1c3150=function(_0x4bb41b){while(--_0x4bb41b){_0xf3d5a0['push'](_0xf3d5a0['shift']());}};_0x1c3150(++_0x4c3828);}(_0xe759,0xbb));var _0x9e75=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe759[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x9e75('0x0'));var util=require('util');var path=require(_0x9e75('0x1'));var timeout=require(_0x9e75('0x2'));var express=require(_0x9e75('0x3'));var router=express[_0x9e75('0x4')]();var auth=require(_0x9e75('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e75('0x6'));var controller=require('./trunk.controller');router[_0x9e75('0x7')]('/',auth[_0x9e75('0x8')](),controller[_0x9e75('0x9')]);router[_0x9e75('0x7')](_0x9e75('0xa'),auth['isAuthenticated'](),controller['show']);router['post'](_0x9e75('0xb'),auth[_0x9e75('0x8')](),controller[_0x9e75('0xc')]);router[_0x9e75('0xd')]('/',auth[_0x9e75('0x8')](),controller[_0x9e75('0xe')]);router[_0x9e75('0xf')]('/:id',auth[_0x9e75('0x8')](),controller['update']);router[_0x9e75('0x10')](_0x9e75('0xa'),auth[_0x9e75('0x8')](),controller[_0x9e75('0x11')]);module[_0x9e75('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 4d1de86..57a4800 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 _0x0b0e=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','insecure','yes','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','active','passive','dynamic','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0x0b0e[_0x4d093a];return _0x5d7227;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5')),'allowNull':![],'defaultValue':_0xe0b0('0x3')},'context':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':_0xe0b0('0x6')},'callingpres':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'))},'deny':{'type':Sequelize[_0xe0b0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe0b0('0x1')]},'md5secret':{'type':Sequelize[_0xe0b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0xd'),'set':function(_0x574d96){this[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x574d96?_0x574d96[_0xe0b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xe0b0('0xf'))?this[_0xe0b0('0x11')](_0xe0b0('0xf'))[_0xe0b0('0x12')](','):null;},'comment':_0xe0b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe0b0('0x14'),_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),_0xe0b0('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe0b0('0x2')]('yes','no',_0xe0b0('0x19'),_0xe0b0('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe0b0('0x1')]},'directmediadeny':{'type':Sequelize[_0xe0b0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x46bb44){this['setDataValue']('nat',_0x46bb44?_0x46bb44['join'](','):null);},'get':function(){return this[_0xe0b0('0x11')]('nat')?this['getDataValue'](_0xe0b0('0x1b'))['split'](','):null;},'comment':_0xe0b0('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe0b0('0x1')]},'pickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'language':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12b260){this[_0xe0b0('0xe')]('allow',_0x12b260?_0x12b260[_0xe0b0('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe0b0('0x11')]('allow')?this[_0xe0b0('0x11')]('allow')[_0xe0b0('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'port,invite','set':function(_0x362aba){this[_0xe0b0('0xe')](_0xe0b0('0x1d'),_0x362aba?_0x362aba[_0xe0b0('0x10')](','):null);},'get':function(){return this[_0xe0b0('0x11')](_0xe0b0('0x1d'))?this['getDataValue'](_0xe0b0('0x1d'))[_0xe0b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no')},'useclientcode':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe0b0('0x1')]},'callerid':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x20')},'amaflags':{'type':Sequelize[_0xe0b0('0x1')]},'callcounter':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':_0xe0b0('0x1e')},'busylevel':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xe0b0('0x1')]},'template':{'type':Sequelize[_0xe0b0('0x1')]},'videosupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'session_timers':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x23'),'refuse',_0xe0b0('0x24'))},'session_expires':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x25'),_0xe0b0('0x26')),'defaultValue':_0xe0b0('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe0b0('0x21')](0x5)},'qualify':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xe0b0('0x1')]},'defaultuser':{'type':Sequelize[_0xe0b0('0x1')]},'rtptimeout':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe0b0('0x1')]},'callbackextension':{'type':Sequelize[_0xe0b0('0x1')]},'timert1':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'timerb':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe0b0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe0b0('0x1')]},'maxforwards':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'encryption':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'force_avp':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscapath':{'type':Sequelize[_0xe0b0('0x1')]},'dtlssetup':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x29'),_0xe0b0('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe0b0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe0b0('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe0b0('0x1')]},'parkinglot':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize[_0xe0b0('0x1')]},'host':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe0b0('0x1')]},'active':{'type':Sequelize[_0xe0b0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0b0e=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','insecure','yes','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','active','passive','dynamic','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x7d4dc8,_0x14d70e){var _0x20b216=function(_0x3575b0){while(--_0x3575b0){_0x7d4dc8['push'](_0x7d4dc8['shift']());}};_0x20b216(++_0x14d70e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x0b0e[_0x48a836];return _0x249dc8;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5')),'allowNull':![],'defaultValue':_0xe0b0('0x3')},'context':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':_0xe0b0('0x6')},'callingpres':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'))},'deny':{'type':Sequelize[_0xe0b0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe0b0('0x1')]},'md5secret':{'type':Sequelize[_0xe0b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0xd'),'set':function(_0x574d96){this[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x574d96?_0x574d96[_0xe0b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xe0b0('0xf'))?this[_0xe0b0('0x11')](_0xe0b0('0xf'))[_0xe0b0('0x12')](','):null;},'comment':_0xe0b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe0b0('0x14'),_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),_0xe0b0('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe0b0('0x2')]('yes','no',_0xe0b0('0x19'),_0xe0b0('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe0b0('0x1')]},'directmediadeny':{'type':Sequelize[_0xe0b0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x46bb44){this['setDataValue']('nat',_0x46bb44?_0x46bb44['join'](','):null);},'get':function(){return this[_0xe0b0('0x11')]('nat')?this['getDataValue'](_0xe0b0('0x1b'))['split'](','):null;},'comment':_0xe0b0('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe0b0('0x1')]},'pickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'language':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12b260){this[_0xe0b0('0xe')]('allow',_0x12b260?_0x12b260[_0xe0b0('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe0b0('0x11')]('allow')?this[_0xe0b0('0x11')]('allow')[_0xe0b0('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'port,invite','set':function(_0x362aba){this[_0xe0b0('0xe')](_0xe0b0('0x1d'),_0x362aba?_0x362aba[_0xe0b0('0x10')](','):null);},'get':function(){return this[_0xe0b0('0x11')](_0xe0b0('0x1d'))?this['getDataValue'](_0xe0b0('0x1d'))[_0xe0b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no')},'useclientcode':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe0b0('0x1')]},'callerid':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x20')},'amaflags':{'type':Sequelize[_0xe0b0('0x1')]},'callcounter':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':_0xe0b0('0x1e')},'busylevel':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xe0b0('0x1')]},'template':{'type':Sequelize[_0xe0b0('0x1')]},'videosupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'session_timers':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x23'),'refuse',_0xe0b0('0x24'))},'session_expires':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x25'),_0xe0b0('0x26')),'defaultValue':_0xe0b0('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe0b0('0x21')](0x5)},'qualify':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xe0b0('0x1')]},'defaultuser':{'type':Sequelize[_0xe0b0('0x1')]},'rtptimeout':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe0b0('0x1')]},'callbackextension':{'type':Sequelize[_0xe0b0('0x1')]},'timert1':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'timerb':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe0b0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe0b0('0x1')]},'maxforwards':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'encryption':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'force_avp':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscapath':{'type':Sequelize[_0xe0b0('0x1')]},'dtlssetup':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x29'),_0xe0b0('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe0b0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe0b0('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe0b0('0x1')]},'parkinglot':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize[_0xe0b0('0x1')]},'host':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe0b0('0x1')]},'active':{'type':Sequelize[_0xe0b0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 072fa60..74269a2 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 _0x274d=['autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','rows','show','params','options','find','clone','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x583771,_0x3778c5){var _0x2d7251=function(_0x2052d4){while(--_0x2052d4){_0x583771['push'](_0x583771['shift']());}};_0x2d7251(++_0x3778c5);}(_0x274d,0x1e4));var _0xd274=function(_0x1d46f7,_0x2dc752){_0x1d46f7=_0x1d46f7-0x0;var _0x51118f=_0x274d[_0x1d46f7];return _0x51118f;};'use strict';var pdf=require(_0xd274('0x0'));var emlformat=require(_0xd274('0x1'));var rimraf=require(_0xd274('0x2'));var zipdir=require(_0xd274('0x3'));var jsonpatch=require(_0xd274('0x4'));var rp=require(_0xd274('0x5'));var moment=require(_0xd274('0x6'));var BPromise=require(_0xd274('0x7'));var Mustache=require(_0xd274('0x8'));var util=require(_0xd274('0x9'));var path=require(_0xd274('0xa'));var sox=require('sox');var csv=require(_0xd274('0xb'));var ejs=require(_0xd274('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd274('0xd'));var crypto=require(_0xd274('0xe'));var jsforce=require(_0xd274('0xf'));var deskjs=require(_0xd274('0x10'));var toCsv=require(_0xd274('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd274('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd274('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd274('0x13'))('api');var utils=require(_0xd274('0x14'));var config=require('../../config/environment');var db=require(_0xd274('0x15'))['db'];var jayson=require(_0xd274('0x16'));var client=jayson[_0xd274('0x17')][_0xd274('0x18')]({'port':0x232a});function checkPasswordPattern(_0x157c25,_0x146812,_0x492f7f){if(_0x492f7f){var _0x55316e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55316e[_0xd274('0x19')](_0x146812)){return _0x157c25;}else{throw new Error(_0xd274('0x1a'));}}else{return _0x157c25;}}function respondWithRpcPromise(_0x5a39c1,_0x322e1c,_0xb1ac20,_0x41dd81){return new BPromise(function(_0x5a6d5e,_0xe64505){var _0x3e9eac=_0x41dd81||client;return _0x3e9eac[_0xd274('0x1b')](_0x5a39c1,_0xb1ac20)[_0xd274('0x1c')](function(_0x2ca6d4){logger[_0xd274('0x1d')](_0xd274('0x1e'),_0x322e1c,'request\x20sent');logger[_0xd274('0x1f')](_0xd274('0x20'),_0x322e1c,_0xd274('0x21'),JSON[_0xd274('0x22')](_0x2ca6d4));if(_0x2ca6d4['error']){if(_0x2ca6d4[_0xd274('0x23')][_0xd274('0x24')]===0x1f4){logger[_0xd274('0x23')](_0xd274('0x1e'),_0x322e1c,_0x2ca6d4['error'][_0xd274('0x25')]);return _0xe64505(_0x2ca6d4[_0xd274('0x23')]['message']);}logger[_0xd274('0x23')](_0xd274('0x1e'),_0x322e1c,_0x2ca6d4[_0xd274('0x23')][_0xd274('0x25')]);return _0x5a6d5e(_0x2ca6d4['error'][_0xd274('0x25')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x322e1c,'request\x20sent');_0x5a6d5e(_0x2ca6d4[_0xd274('0x26')]['message']);}})[_0xd274('0x27')](function(_0x3de6c5){logger[_0xd274('0x23')](_0xd274('0x1e'),_0x322e1c,_0x3de6c5);_0xe64505(_0x3de6c5);});});}function respondWithStatusCode(_0x5b6fd6,_0x3697ea){_0x3697ea=_0x3697ea||0xcc;return function(_0x667bbb){if(_0x667bbb){return _0x5b6fd6[_0xd274('0x28')](_0x3697ea);}return _0x5b6fd6[_0xd274('0x29')](_0x3697ea)[_0xd274('0x2a')]();};}function respondWithResult(_0x36fb36,_0x2467c8){_0x2467c8=_0x2467c8||0xc8;return function(_0x41cf20){if(_0x41cf20){return _0x36fb36[_0xd274('0x29')](_0x2467c8)['json'](_0x41cf20);}};}function respondWithFilteredResult(_0x430201,_0x91506){return function(_0xf6e73f){if(_0xf6e73f){var _0x10303a=_0xf6e73f[_0xd274('0x2b')],_0x341231=_0x91506[_0xd274('0x2c')],_0x5e21e9=_0x91506['offset']+_0x91506[_0xd274('0x2d')],_0x2a5e67;if(_0x5e21e9>=_0x10303a){_0x5e21e9=_0x10303a;_0x2a5e67=0xc8;}else{_0x2a5e67=0xce;}_0x430201[_0xd274('0x29')](_0x2a5e67);return _0x430201[_0xd274('0x2e')](_0xd274('0x2f'),_0x341231+'-'+_0x5e21e9+'/'+_0x10303a)[_0xd274('0x30')](_0xf6e73f);}return null;};}function patchUpdates(_0x4ebfcd){return function(_0xf9bc93){try{jsonpatch[_0xd274('0x31')](_0xf9bc93,_0x4ebfcd,!![]);}catch(_0x95e109){return BPromise[_0xd274('0x32')](_0x95e109);}return _0xf9bc93[_0xd274('0x33')]();};}function saveUpdates(_0x3f741f,_0x19bbd3){return function(_0x4cb96b){if(_0x4cb96b){return _0x4cb96b[_0xd274('0x34')](_0x3f741f)[_0xd274('0x1c')](function(_0x2957a1){return _0x2957a1;});}return null;};}function removeEntity(_0x2acdff,_0x157036){return function(_0x48ea02){if(_0x48ea02){return _0x48ea02[_0xd274('0x35')]()[_0xd274('0x1c')](function(){var _0xd105e1=_0x48ea02[_0xd274('0x36')]({'plain':!![]});var _0x54b387=_0xd274('0x37');return db[_0xd274('0x38')][_0xd274('0x35')]({'where':{'type':_0x54b387,'resourceId':_0xd105e1['id']}})['then'](function(){return _0x48ea02;});})[_0xd274('0x1c')](function(){_0x2acdff[_0xd274('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28bf9a,_0xa9a6eb){return function(_0x34247e){if(!_0x34247e){_0x28bf9a[_0xd274('0x28')](0x194);}return _0x34247e;};}function handleError(_0x35a6ea,_0xa1a1b1){_0xa1a1b1=_0xa1a1b1||0x1f4;return function(_0x5ec484){logger['error'](_0x5ec484[_0xd274('0x39')]);if(_0x5ec484[_0xd274('0x3a')]){delete _0x5ec484[_0xd274('0x3a')];}_0x35a6ea[_0xd274('0x29')](_0xa1a1b1)[_0xd274('0x3b')](_0x5ec484);};}exports[_0xd274('0x3c')]=function(_0x4cbeb4,_0x5f5cd0){var _0x1fbce2={},_0x4c1ca0={},_0x448891={'count':0x0,'rows':[]};var _0xb746a=db[_0xd274('0x3d')][_0xd274('0x3e')];_0x4c1ca0[_0xd274('0x3f')]=_[_0xd274('0x40')](_0xb746a);_0x4c1ca0[_0xd274('0x41')]=_[_0xd274('0x40')](_0x4cbeb4[_0xd274('0x41')]);_0x4c1ca0['filters']=_[_0xd274('0x42')](_0x4c1ca0['model'],_0x4c1ca0[_0xd274('0x41')]);_0x1fbce2[_0xd274('0x43')]=_['intersection'](_0x4c1ca0[_0xd274('0x3f')],qs[_0xd274('0x44')](_0x4cbeb4[_0xd274('0x41')][_0xd274('0x44')]));_0x1fbce2[_0xd274('0x43')]=_0x1fbce2[_0xd274('0x43')][_0xd274('0x45')]?_0x1fbce2[_0xd274('0x43')]:_0x4c1ca0[_0xd274('0x3f')];if(!_0x4cbeb4[_0xd274('0x41')][_0xd274('0x46')](_0xd274('0x47'))){_0x1fbce2['limit']=qs[_0xd274('0x2d')](_0x4cbeb4[_0xd274('0x41')][_0xd274('0x2d')]);_0x1fbce2[_0xd274('0x2c')]=qs[_0xd274('0x2c')](_0x4cbeb4['query'][_0xd274('0x2c')]);}_0x1fbce2[_0xd274('0x48')]=qs['sort'](_0x4cbeb4[_0xd274('0x41')][_0xd274('0x49')]);_0x1fbce2[_0xd274('0x4a')]=qs[_0xd274('0x4b')](_[_0xd274('0x4c')](_0x4cbeb4[_0xd274('0x41')],_0x4c1ca0['filters']));if(_0x4cbeb4[_0xd274('0x41')][_0xd274('0x4d')]){_0x1fbce2[_0xd274('0x4a')]=_[_0xd274('0x4e')](_0x1fbce2['where'],{'$or':_['map'](_0xb746a,function(_0x4759a2){if(_0x4759a2[_0xd274('0x4f')][_0xd274('0x50')]!==_0xd274('0x51')){var _0x2d9a2f={};_0x2d9a2f[_0x4759a2[_0xd274('0x52')]]={'$like':'%'+_0x4cbeb4['query'][_0xd274('0x4d')]+'%'};return _0x2d9a2f;}})});}_0x1fbce2=_[_0xd274('0x4e')]({},_0x1fbce2,_0x4cbeb4['options']);var _0x49da0a={'where':_0x1fbce2[_0xd274('0x4a')]};return db[_0xd274('0x3d')][_0xd274('0x2b')](_0x49da0a)[_0xd274('0x1c')](function(_0x66a4d1){_0x448891[_0xd274('0x2b')]=_0x66a4d1;if(_0x4cbeb4[_0xd274('0x41')][_0xd274('0x53')]){_0x1fbce2[_0xd274('0x54')]=[{'all':!![]}];}return db[_0xd274('0x3d')]['findAll'](_0x1fbce2);})['then'](function(_0x157f20){_0x448891[_0xd274('0x55')]=_0x157f20;return _0x448891;})[_0xd274('0x1c')](respondWithFilteredResult(_0x5f5cd0,_0x1fbce2))[_0xd274('0x27')](handleError(_0x5f5cd0,null));};exports[_0xd274('0x56')]=function(_0x5086ff,_0xad5ced){var _0x40681e={'raw':![],'where':{'id':_0x5086ff[_0xd274('0x57')]['id']}},_0x5d5764={};_0x5d5764[_0xd274('0x3f')]=_[_0xd274('0x40')](db[_0xd274('0x3d')]['rawAttributes']);_0x5d5764[_0xd274('0x41')]=_[_0xd274('0x40')](_0x5086ff[_0xd274('0x41')]);_0x5d5764[_0xd274('0x4b')]=_['intersection'](_0x5d5764[_0xd274('0x3f')],_0x5d5764[_0xd274('0x41')]);_0x40681e[_0xd274('0x43')]=_[_0xd274('0x42')](_0x5d5764['model'],qs['fields'](_0x5086ff['query'][_0xd274('0x44')]));_0x40681e[_0xd274('0x43')]=_0x40681e[_0xd274('0x43')][_0xd274('0x45')]?_0x40681e[_0xd274('0x43')]:_0x5d5764[_0xd274('0x3f')];if(_0x5086ff[_0xd274('0x41')][_0xd274('0x53')]){_0x40681e['include']=[{'all':!![]}];}_0x40681e=_['merge']({},_0x40681e,_0x5086ff[_0xd274('0x58')]);return db['Trunk'][_0xd274('0x59')](_0x40681e)['then'](handleEntityNotFound(_0xad5ced,null))[_0xd274('0x1c')](respondWithResult(_0xad5ced,null))[_0xd274('0x27')](handleError(_0xad5ced,null));};exports[_0xd274('0x5a')]=function(_0x2ab3cb,_0x58f9cd){var _0x2323bd={'raw':![],'where':{'id':_0x2ab3cb[_0xd274('0x57')]['id']}},_0x47d4b6={};_0x47d4b6[_0xd274('0x3f')]=_[_0xd274('0x40')](db[_0xd274('0x3d')][_0xd274('0x3e')]);_0x2323bd[_0xd274('0x43')]=_[_0xd274('0x42')](_0x47d4b6[_0xd274('0x3f')],qs[_0xd274('0x44')](_0x2ab3cb['query'][_0xd274('0x44')]));_0x2323bd[_0xd274('0x43')]=_0x2323bd[_0xd274('0x43')]['length']?_0x2323bd[_0xd274('0x43')]:_0x47d4b6[_0xd274('0x3f')];if(_0x2ab3cb['query'][_0xd274('0x53')]){_0x2323bd[_0xd274('0x54')]=[{'all':!![]}];}_0x2323bd=_['merge']({},_0x2323bd,_0x2ab3cb['options']);return db[_0xd274('0x3d')][_0xd274('0x59')](_0x2323bd)[_0xd274('0x1c')](handleEntityNotFound(_0x58f9cd,null))[_0xd274('0x1c')](function(_0x1f1f56){if(_0x1f1f56){var _0xd75e53=_0x1f1f56[_0xd274('0x36')]({'plain':!![]});_0xd75e53=qs[_0xd274('0x5b')](_0xd75e53,['id',_0xd274('0x5c'),'updatedAt']);_0x2ab3cb[_0xd274('0x5d')]=_[_0xd274('0x5b')](_0x2ab3cb[_0xd274('0x5d')],['id',_0xd274('0x5c'),_0xd274('0x5e')]);return db[_0xd274('0x3d')][_0xd274('0x5f')](_['merge'](_0xd75e53,_0x2ab3cb[_0xd274('0x5d')]),{'include':_0x2ab3cb['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd274('0x1c')](function(_0x313925){var _0x425210=_0x2ab3cb[_0xd274('0x60')][_0xd274('0x36')]({'plain':!![]});if(!_0x425210)throw new Error(_0xd274('0x61'));if(_0x425210[_0xd274('0x62')]===_0xd274('0x60')){var _0x216d68=_0x313925[_0xd274('0x36')]({'plain':!![]});var _0x382387='Trunks';return db[_0xd274('0x63')][_0xd274('0x59')]({'where':{'name':_0x382387,'userProfileId':_0x425210[_0xd274('0x64')]},'raw':!![]})[_0xd274('0x1c')](function(_0x4c2c48){if(_0x4c2c48&&_0x4c2c48[_0xd274('0x65')]===0x0){return db[_0xd274('0x38')][_0xd274('0x5f')]({'name':_0x216d68['name'],'resourceId':_0x216d68['id'],'type':_0x4c2c48[_0xd274('0x3a')],'sectionId':_0x4c2c48['id']},{})['then'](function(){return _0x313925;});}else{return _0x313925;}})[_0xd274('0x27')](function(_0x547694){logger[_0xd274('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x547694);throw _0x547694;});}return _0x313925;});}})[_0xd274('0x1c')](respondWithResult(_0x58f9cd,0xc9))[_0xd274('0x27')](handleError(_0x58f9cd,null));};exports['create']=function(_0xf1c756,_0x11ba6a,_0x52dcf9){var _0x590135;return db['Trunk'][_0xd274('0x5f')](_0xf1c756[_0xd274('0x5d')],{'raw':!![]})[_0xd274('0x1c')](function(_0x23426b){_0x590135=_0x23426b;return db[_0xd274('0x3d')][_0xd274('0x66')]({'raw':!![]});})['then'](function(_0x93f8ad){var _0x3df0b3=fs[_0xd274('0x67')](path['join'](config[_0xd274('0x68')],_0xd274('0x69')),_0xd274('0x6a'));var _0x2da0f8=fs[_0xd274('0x67')](path[_0xd274('0x6b')](config['root'],_0xd274('0x6c')),_0xd274('0x6a'));var _0x15dd4a=ejs[_0xd274('0x6d')](_0x3df0b3,{'trunks':_0x93f8ad||[]});fs['writeFileSync'](_0xd274('0x6e'),_0x15dd4a);if(_0x590135[_0xd274('0x6f')]){var _0x1ad8f2=ejs[_0xd274('0x6d')](_0x2da0f8,{'trunks':_0x93f8ad||[]});fs[_0xd274('0x70')]('/etc/asterisk/sip_xcally_registers.conf',_0x1ad8f2);}})[_0xd274('0x1c')](function(){return respondWithRpcPromise(_0xd274('0x71'),'create',{'module':_0xd274('0x72')});})[_0xd274('0x1c')](function(){var _0x35a413=_0xf1c756['user'][_0xd274('0x36')]({'plain':!![]});if(!_0x35a413)throw new Error(_0xd274('0x61'));if(_0x35a413[_0xd274('0x62')]===_0xd274('0x60')){var _0x1d0e49=_0x590135['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xd274('0x37'),'userProfileId':_0x35a413[_0xd274('0x64')]},'raw':!![]})['then'](function(_0xdce3d1){if(_0xdce3d1&&_0xdce3d1[_0xd274('0x65')]===0x0){return db[_0xd274('0x38')][_0xd274('0x5f')]({'name':_0x1d0e49[_0xd274('0x3a')],'resourceId':_0x1d0e49['id'],'type':_0xdce3d1[_0xd274('0x3a')],'sectionId':_0xdce3d1['id']},{})['then'](function(){return _0x590135;});}else{return _0x590135;}})[_0xd274('0x27')](function(_0x5d7e33){logger[_0xd274('0x23')](_0xd274('0x73'),_0x5d7e33);throw _0x5d7e33;});}return _0x590135;})[_0xd274('0x1c')](respondWithResult(_0x11ba6a,0xc9))[_0xd274('0x27')](handleError(_0x11ba6a,null));};exports[_0xd274('0x34')]=function(_0x2e4148,_0x13a628,_0x3c513d){var _0x1cd540;return db[_0xd274('0x3d')][_0xd274('0x59')]({'where':{'id':_0x2e4148['params']['id']}})[_0xd274('0x1c')](handleEntityNotFound(_0x13a628,null))[_0xd274('0x1c')](saveUpdates(_0x2e4148[_0xd274('0x5d')],null))['then'](function(_0x15a47d){if(_0x15a47d){_0x1cd540=_0x15a47d;return db['Trunk'][_0xd274('0x66')]({'raw':!![]});}})[_0xd274('0x1c')](function(_0x5866dd){if(_0x5866dd){var _0x3c30e4=fs[_0xd274('0x67')](path[_0xd274('0x6b')](config['root'],_0xd274('0x69')),_0xd274('0x6a'));var _0x40fef3=fs[_0xd274('0x67')](path[_0xd274('0x6b')](config[_0xd274('0x68')],'server/files/templates/registry.ejs'),'utf8');var _0x16f81b=ejs[_0xd274('0x6d')](_0x3c30e4,{'trunks':_0x5866dd||[]});fs[_0xd274('0x70')](_0xd274('0x6e'),_0x16f81b);var _0x3fa6dd=ejs[_0xd274('0x6d')](_0x40fef3,{'trunks':_0x5866dd||[]});fs['writeFileSync'](_0xd274('0x74'),_0x3fa6dd);return respondWithRpcPromise(_0xd274('0x71'),_0xd274('0x34'),{'module':_0xd274('0x72')});}return null;})[_0xd274('0x1c')](function(_0x5ec3f1){if(_0x5ec3f1){return _0x1cd540;}})['then'](respondWithResult(_0x13a628,null))[_0xd274('0x27')](handleError(_0x13a628,null));};exports[_0xd274('0x35')]=function(_0xde7baf,_0x34e4d8,_0x29b8cc){var _0x167a4d;return db['Trunk'][_0xd274('0x59')]({'where':{'id':_0xde7baf[_0xd274('0x57')]['id']}})['then'](handleEntityNotFound(_0x34e4d8,null))[_0xd274('0x1c')](removeEntity(_0x34e4d8,null))[_0xd274('0x1c')](function(){return db['Trunk'][_0xd274('0x66')]({'raw':!![]});})[_0xd274('0x1c')](function(_0x29fe8e){var _0x185709=fs[_0xd274('0x67')](path['join'](config[_0xd274('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x55fc52=fs[_0xd274('0x67')](path['join'](config['root'],_0xd274('0x6c')),'utf8');var _0x262b87=ejs[_0xd274('0x6d')](_0x185709,{'trunks':_0x29fe8e});var _0x1ffeb6=ejs[_0xd274('0x6d')](_0x55fc52,{'trunks':_0x29fe8e});fs[_0xd274('0x70')](_0xd274('0x6e'),_0x262b87);fs[_0xd274('0x70')](_0xd274('0x74'),_0x1ffeb6);return respondWithRpcPromise(_0xd274('0x71'),'destroy',{'module':_0xd274('0x72')});})['catch'](handleError(_0x34e4d8,null));}; \ No newline at end of file +var _0x511e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/trunk.ejs','Reload','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','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','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','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','catch','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','name','index','Trunk','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','key','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','find','clone','omit','createdAt','updatedAt','body','user','UserProfileSection','userProfileId','autoAssociation','create','readFileSync','join','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x511e,0xea));var _0xe511=function(_0x19d7bf,_0x265436){_0x19d7bf=_0x19d7bf-0x0;var _0x46494c=_0x511e[_0x19d7bf];return _0x46494c;};'use strict';var pdf=require(_0xe511('0x0'));var emlformat=require(_0xe511('0x1'));var rimraf=require(_0xe511('0x2'));var zipdir=require(_0xe511('0x3'));var jsonpatch=require(_0xe511('0x4'));var rp=require(_0xe511('0x5'));var moment=require('moment');var BPromise=require(_0xe511('0x6'));var Mustache=require(_0xe511('0x7'));var util=require(_0xe511('0x8'));var path=require('path');var sox=require(_0xe511('0x9'));var csv=require(_0xe511('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe511('0xb'));var crypto=require(_0xe511('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe511('0xd'));var toCsv=require(_0xe511('0xa'));var querystring=require(_0xe511('0xe'));var Papa=require(_0xe511('0xf'));var Redis=require(_0xe511('0x10'));var authService=require(_0xe511('0x11'));var qs=require(_0xe511('0x12'));var hardwareService=require(_0xe511('0x13'));var logger=require(_0xe511('0x14'))(_0xe511('0x15'));var utils=require(_0xe511('0x16'));var config=require(_0xe511('0x17'));var db=require(_0xe511('0x18'))['db'];var jayson=require(_0xe511('0x19'));var client=jayson[_0xe511('0x1a')][_0xe511('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4444cc,_0x4abb48,_0x1f0059){if(_0x1f0059){var _0x431048=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x431048['test'](_0x4abb48)){return _0x4444cc;}else{throw new Error(_0xe511('0x1c'));}}else{return _0x4444cc;}}function respondWithRpcPromise(_0x3ade8b,_0x254090,_0xb98850,_0xee7daf){return new BPromise(function(_0x521d32,_0x10e4b8){var _0xb666a3=_0xee7daf||client;return _0xb666a3[_0xe511('0x1d')](_0x3ade8b,_0xb98850)[_0xe511('0x1e')](function(_0x4726d8){logger[_0xe511('0x1f')](_0xe511('0x20'),_0x254090,_0xe511('0x21'));logger[_0xe511('0x22')](_0xe511('0x23'),_0x254090,_0xe511('0x21'),JSON['stringify'](_0x4726d8));if(_0x4726d8['error']){if(_0x4726d8['error'][_0xe511('0x24')]===0x1f4){logger[_0xe511('0x25')]('Trunk,\x20%s,\x20%s',_0x254090,_0x4726d8[_0xe511('0x25')][_0xe511('0x26')]);return _0x10e4b8(_0x4726d8[_0xe511('0x25')]['message']);}logger[_0xe511('0x25')](_0xe511('0x20'),_0x254090,_0x4726d8[_0xe511('0x25')]['message']);return _0x521d32(_0x4726d8[_0xe511('0x25')][_0xe511('0x26')]);}else{logger[_0xe511('0x1f')](_0xe511('0x20'),_0x254090,_0xe511('0x21'));_0x521d32(_0x4726d8['result']['message']);}})[_0xe511('0x27')](function(_0x1672b4){logger['error']('Trunk,\x20%s,\x20%s',_0x254090,_0x1672b4);_0x10e4b8(_0x1672b4);});});}function respondWithStatusCode(_0x11f545,_0x2e2cbf){_0x2e2cbf=_0x2e2cbf||0xcc;return function(_0x5c63ba){if(_0x5c63ba){return _0x11f545['sendStatus'](_0x2e2cbf);}return _0x11f545['status'](_0x2e2cbf)[_0xe511('0x28')]();};}function respondWithResult(_0x38c762,_0x561b5c){_0x561b5c=_0x561b5c||0xc8;return function(_0x1ae313){if(_0x1ae313){return _0x38c762[_0xe511('0x29')](_0x561b5c)['json'](_0x1ae313);}};}function respondWithFilteredResult(_0x4e5ec9,_0x4d3aca){return function(_0x1fb46b){if(_0x1fb46b){var _0x4eab61=_0x1fb46b[_0xe511('0x2a')],_0x58a347=_0x4d3aca[_0xe511('0x2b')],_0x4d695d=_0x4d3aca['offset']+_0x4d3aca['limit'],_0x541fe6;if(_0x4d695d>=_0x4eab61){_0x4d695d=_0x4eab61;_0x541fe6=0xc8;}else{_0x541fe6=0xce;}_0x4e5ec9['status'](_0x541fe6);return _0x4e5ec9[_0xe511('0x2c')](_0xe511('0x2d'),_0x58a347+'-'+_0x4d695d+'/'+_0x4eab61)[_0xe511('0x2e')](_0x1fb46b);}return null;};}function patchUpdates(_0x34840f){return function(_0x17f126){try{jsonpatch[_0xe511('0x2f')](_0x17f126,_0x34840f,!![]);}catch(_0x29b97c){return BPromise[_0xe511('0x30')](_0x29b97c);}return _0x17f126[_0xe511('0x31')]();};}function saveUpdates(_0x2d06ae,_0x18e590){return function(_0x8f858c){if(_0x8f858c){return _0x8f858c[_0xe511('0x32')](_0x2d06ae)['then'](function(_0x171fb0){return _0x171fb0;});}return null;};}function removeEntity(_0x58919b,_0x351fa4){return function(_0x2a659f){if(_0x2a659f){return _0x2a659f[_0xe511('0x33')]()['then'](function(){var _0xbf936d=_0x2a659f[_0xe511('0x34')]({'plain':!![]});var _0x4b6848=_0xe511('0x35');return db[_0xe511('0x36')][_0xe511('0x33')]({'where':{'type':_0x4b6848,'resourceId':_0xbf936d['id']}})[_0xe511('0x1e')](function(){return _0x2a659f;});})[_0xe511('0x1e')](function(){_0x58919b['status'](0xcc)[_0xe511('0x28')]();});}};}function handleEntityNotFound(_0x80d894,_0x576294){return function(_0x22e85c){if(!_0x22e85c){_0x80d894[_0xe511('0x37')](0x194);}return _0x22e85c;};}function handleError(_0x2db699,_0x47bf97){_0x47bf97=_0x47bf97||0x1f4;return function(_0x4021c0){logger[_0xe511('0x25')](_0x4021c0['stack']);if(_0x4021c0[_0xe511('0x38')]){delete _0x4021c0[_0xe511('0x38')];}_0x2db699[_0xe511('0x29')](_0x47bf97)['send'](_0x4021c0);};}exports[_0xe511('0x39')]=function(_0x5132f9,_0xdadc04){var _0x209438={},_0x3b90ba={},_0x490889={'count':0x0,'rows':[]};var _0x34b641=db[_0xe511('0x3a')][_0xe511('0x3b')];_0x3b90ba[_0xe511('0x3c')]=_[_0xe511('0x3d')](_0x34b641);_0x3b90ba[_0xe511('0x3e')]=_[_0xe511('0x3d')](_0x5132f9[_0xe511('0x3e')]);_0x3b90ba[_0xe511('0x3f')]=_['intersection'](_0x3b90ba[_0xe511('0x3c')],_0x3b90ba[_0xe511('0x3e')]);_0x209438[_0xe511('0x40')]=_[_0xe511('0x41')](_0x3b90ba[_0xe511('0x3c')],qs[_0xe511('0x42')](_0x5132f9['query'][_0xe511('0x42')]));_0x209438[_0xe511('0x40')]=_0x209438[_0xe511('0x40')][_0xe511('0x43')]?_0x209438['attributes']:_0x3b90ba[_0xe511('0x3c')];if(!_0x5132f9[_0xe511('0x3e')][_0xe511('0x44')](_0xe511('0x45'))){_0x209438['limit']=qs[_0xe511('0x46')](_0x5132f9[_0xe511('0x3e')]['limit']);_0x209438[_0xe511('0x2b')]=qs[_0xe511('0x2b')](_0x5132f9['query']['offset']);}_0x209438[_0xe511('0x47')]=qs[_0xe511('0x48')](_0x5132f9[_0xe511('0x3e')]['sort']);_0x209438['where']=qs[_0xe511('0x3f')](_[_0xe511('0x49')](_0x5132f9[_0xe511('0x3e')],_0x3b90ba[_0xe511('0x3f')]));if(_0x5132f9['query'][_0xe511('0x4a')]){_0x209438[_0xe511('0x4b')]=_[_0xe511('0x4c')](_0x209438[_0xe511('0x4b')],{'$or':_['map'](_0x34b641,function(_0x500c90){if(_0x500c90['type'][_0xe511('0x4d')]!==_0xe511('0x4e')){var _0x51e4e8={};_0x51e4e8[_0x500c90[_0xe511('0x4f')]]={'$like':'%'+_0x5132f9[_0xe511('0x3e')][_0xe511('0x4a')]+'%'};return _0x51e4e8;}})});}_0x209438=_[_0xe511('0x4c')]({},_0x209438,_0x5132f9[_0xe511('0x50')]);var _0x4f1ccf={'where':_0x209438[_0xe511('0x4b')]};return db[_0xe511('0x3a')][_0xe511('0x2a')](_0x4f1ccf)[_0xe511('0x1e')](function(_0x53ba12){_0x490889['count']=_0x53ba12;if(_0x5132f9[_0xe511('0x3e')]['includeAll']){_0x209438[_0xe511('0x51')]=[{'all':!![]}];}return db['Trunk'][_0xe511('0x52')](_0x209438);})[_0xe511('0x1e')](function(_0x1ad4cb){_0x490889[_0xe511('0x53')]=_0x1ad4cb;return _0x490889;})['then'](respondWithFilteredResult(_0xdadc04,_0x209438))[_0xe511('0x27')](handleError(_0xdadc04,null));};exports[_0xe511('0x54')]=function(_0x2b979d,_0x275a22){var _0x55882e={'raw':![],'where':{'id':_0x2b979d[_0xe511('0x55')]['id']}},_0x8b39de={};_0x8b39de[_0xe511('0x3c')]=_[_0xe511('0x3d')](db['Trunk'][_0xe511('0x3b')]);_0x8b39de[_0xe511('0x3e')]=_[_0xe511('0x3d')](_0x2b979d[_0xe511('0x3e')]);_0x8b39de['filters']=_[_0xe511('0x41')](_0x8b39de[_0xe511('0x3c')],_0x8b39de[_0xe511('0x3e')]);_0x55882e['attributes']=_[_0xe511('0x41')](_0x8b39de[_0xe511('0x3c')],qs[_0xe511('0x42')](_0x2b979d['query'][_0xe511('0x42')]));_0x55882e['attributes']=_0x55882e['attributes'][_0xe511('0x43')]?_0x55882e['attributes']:_0x8b39de[_0xe511('0x3c')];if(_0x2b979d['query'][_0xe511('0x56')]){_0x55882e[_0xe511('0x51')]=[{'all':!![]}];}_0x55882e=_[_0xe511('0x4c')]({},_0x55882e,_0x2b979d[_0xe511('0x50')]);return db[_0xe511('0x3a')][_0xe511('0x57')](_0x55882e)['then'](handleEntityNotFound(_0x275a22,null))[_0xe511('0x1e')](respondWithResult(_0x275a22,null))[_0xe511('0x27')](handleError(_0x275a22,null));};exports[_0xe511('0x58')]=function(_0x5c9f07,_0x67c9d3){var _0x45b47b={'raw':![],'where':{'id':_0x5c9f07[_0xe511('0x55')]['id']}},_0x4a56d6={};_0x4a56d6[_0xe511('0x3c')]=_[_0xe511('0x3d')](db['Trunk'][_0xe511('0x3b')]);_0x45b47b[_0xe511('0x40')]=_['intersection'](_0x4a56d6[_0xe511('0x3c')],qs[_0xe511('0x42')](_0x5c9f07[_0xe511('0x3e')][_0xe511('0x42')]));_0x45b47b['attributes']=_0x45b47b[_0xe511('0x40')][_0xe511('0x43')]?_0x45b47b['attributes']:_0x4a56d6['model'];if(_0x5c9f07['query']['includeAll']){_0x45b47b[_0xe511('0x51')]=[{'all':!![]}];}_0x45b47b=_[_0xe511('0x4c')]({},_0x45b47b,_0x5c9f07['options']);return db[_0xe511('0x3a')]['find'](_0x45b47b)['then'](handleEntityNotFound(_0x67c9d3,null))['then'](function(_0x4871ca){if(_0x4871ca){var _0x5e85ee=_0x4871ca[_0xe511('0x34')]({'plain':!![]});_0x5e85ee=qs[_0xe511('0x59')](_0x5e85ee,['id',_0xe511('0x5a'),_0xe511('0x5b')]);_0x5c9f07[_0xe511('0x5c')]=_[_0xe511('0x59')](_0x5c9f07[_0xe511('0x5c')],['id','createdAt',_0xe511('0x5b')]);return db[_0xe511('0x3a')]['create'](_['merge'](_0x5e85ee,_0x5c9f07[_0xe511('0x5c')]),{'include':_0x5c9f07[_0xe511('0x3e')][_0xe511('0x56')]?[{'all':!![]}]:undefined})[_0xe511('0x1e')](function(_0x1b3d29){var _0x3b1d95=_0x5c9f07[_0xe511('0x5d')][_0xe511('0x34')]({'plain':!![]});if(!_0x3b1d95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b1d95['role']===_0xe511('0x5d')){var _0xa0c400=_0x1b3d29[_0xe511('0x34')]({'plain':!![]});var _0x403757='Trunks';return db[_0xe511('0x5e')]['find']({'where':{'name':_0x403757,'userProfileId':_0x3b1d95[_0xe511('0x5f')]},'raw':!![]})[_0xe511('0x1e')](function(_0x4a0744){if(_0x4a0744&&_0x4a0744[_0xe511('0x60')]===0x0){return db[_0xe511('0x36')]['create']({'name':_0xa0c400[_0xe511('0x38')],'resourceId':_0xa0c400['id'],'type':_0x4a0744['name'],'sectionId':_0x4a0744['id']},{})[_0xe511('0x1e')](function(){return _0x1b3d29;});}else{return _0x1b3d29;}})['catch'](function(_0x8703c3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8703c3);throw _0x8703c3;});}return _0x1b3d29;});}})[_0xe511('0x1e')](respondWithResult(_0x67c9d3,0xc9))[_0xe511('0x27')](handleError(_0x67c9d3,null));};exports[_0xe511('0x61')]=function(_0x28b2bf,_0x34cae9,_0x5aa4f3){var _0x9e488c;return db[_0xe511('0x3a')][_0xe511('0x61')](_0x28b2bf[_0xe511('0x5c')],{'raw':!![]})[_0xe511('0x1e')](function(_0xcf2aec){_0x9e488c=_0xcf2aec;return db[_0xe511('0x3a')]['findAll']({'raw':!![]});})[_0xe511('0x1e')](function(_0x2c514f){var _0x4d4ece=fs[_0xe511('0x62')](path[_0xe511('0x63')](config['root'],'server/files/templates/trunk.ejs'),_0xe511('0x64'));var _0x4e575e=fs[_0xe511('0x62')](path[_0xe511('0x63')](config['root'],_0xe511('0x65')),_0xe511('0x64'));var _0x56cc58=ejs[_0xe511('0x66')](_0x4d4ece,{'trunks':_0x2c514f||[]});fs['writeFileSync'](_0xe511('0x67'),_0x56cc58);if(_0x9e488c[_0xe511('0x68')]){var _0x3f778b=ejs[_0xe511('0x66')](_0x4e575e,{'trunks':_0x2c514f||[]});fs[_0xe511('0x69')](_0xe511('0x6a'),_0x3f778b);}})[_0xe511('0x1e')](function(){return respondWithRpcPromise('Reload',_0xe511('0x61'),{'module':_0xe511('0x6b')});})[_0xe511('0x1e')](function(){var _0x50ddb5=_0x28b2bf[_0xe511('0x5d')][_0xe511('0x34')]({'plain':!![]});if(!_0x50ddb5)throw new Error(_0xe511('0x6c'));if(_0x50ddb5[_0xe511('0x6d')]===_0xe511('0x5d')){var _0x3a82b3=_0x9e488c[_0xe511('0x34')]({'plain':!![]});return db[_0xe511('0x5e')][_0xe511('0x57')]({'where':{'name':'Trunks','userProfileId':_0x50ddb5[_0xe511('0x5f')]},'raw':!![]})[_0xe511('0x1e')](function(_0x4c2616){if(_0x4c2616&&_0x4c2616[_0xe511('0x60')]===0x0){return db[_0xe511('0x36')][_0xe511('0x61')]({'name':_0x3a82b3[_0xe511('0x38')],'resourceId':_0x3a82b3['id'],'type':_0x4c2616[_0xe511('0x38')],'sectionId':_0x4c2616['id']},{})[_0xe511('0x1e')](function(){return _0x9e488c;});}else{return _0x9e488c;}})[_0xe511('0x27')](function(_0x2b55e2){logger['error'](_0xe511('0x6e'),_0x2b55e2);throw _0x2b55e2;});}return _0x9e488c;})[_0xe511('0x1e')](respondWithResult(_0x34cae9,0xc9))[_0xe511('0x27')](handleError(_0x34cae9,null));};exports[_0xe511('0x32')]=function(_0x4e5d32,_0x357a07,_0xabbe07){var _0x1dd9ff;return db[_0xe511('0x3a')]['find']({'where':{'id':_0x4e5d32[_0xe511('0x55')]['id']}})[_0xe511('0x1e')](handleEntityNotFound(_0x357a07,null))[_0xe511('0x1e')](saveUpdates(_0x4e5d32[_0xe511('0x5c')],null))[_0xe511('0x1e')](function(_0x3e8746){if(_0x3e8746){_0x1dd9ff=_0x3e8746;return db[_0xe511('0x3a')][_0xe511('0x52')]({'raw':!![]});}})[_0xe511('0x1e')](function(_0x5a008b){if(_0x5a008b){var _0xaf2527=fs[_0xe511('0x62')](path['join'](config[_0xe511('0x6f')],_0xe511('0x70')),_0xe511('0x64'));var _0x3d343e=fs[_0xe511('0x62')](path[_0xe511('0x63')](config[_0xe511('0x6f')],_0xe511('0x65')),_0xe511('0x64'));var _0x262101=ejs[_0xe511('0x66')](_0xaf2527,{'trunks':_0x5a008b||[]});fs[_0xe511('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x262101);var _0x1fccd0=ejs[_0xe511('0x66')](_0x3d343e,{'trunks':_0x5a008b||[]});fs[_0xe511('0x69')](_0xe511('0x6a'),_0x1fccd0);return respondWithRpcPromise(_0xe511('0x71'),_0xe511('0x32'),{'module':_0xe511('0x6b')});}return null;})[_0xe511('0x1e')](function(_0x145878){if(_0x145878){return _0x1dd9ff;}})[_0xe511('0x1e')](respondWithResult(_0x357a07,null))[_0xe511('0x27')](handleError(_0x357a07,null));};exports[_0xe511('0x33')]=function(_0x51d0a1,_0x3229c7,_0x29ac49){var _0x2afc92;return db[_0xe511('0x3a')][_0xe511('0x57')]({'where':{'id':_0x51d0a1['params']['id']}})[_0xe511('0x1e')](handleEntityNotFound(_0x3229c7,null))[_0xe511('0x1e')](removeEntity(_0x3229c7,null))[_0xe511('0x1e')](function(){return db[_0xe511('0x3a')]['findAll']({'raw':!![]});})[_0xe511('0x1e')](function(_0x3b7a83){var _0x1c79bd=fs['readFileSync'](path[_0xe511('0x63')](config[_0xe511('0x6f')],'server/files/templates/trunk.ejs'),_0xe511('0x64'));var _0x38e8d5=fs[_0xe511('0x62')](path[_0xe511('0x63')](config[_0xe511('0x6f')],_0xe511('0x65')),_0xe511('0x64'));var _0xb04df9=ejs['render'](_0x1c79bd,{'trunks':_0x3b7a83});var _0x124895=ejs[_0xe511('0x66')](_0x38e8d5,{'trunks':_0x3b7a83});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0xb04df9);fs['writeFileSync'](_0xe511('0x6a'),_0x124895);return respondWithRpcPromise(_0xe511('0x71'),'destroy',{'module':_0xe511('0x6b')});})[_0xe511('0x27')](handleError(_0x3229c7,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9c4eb8f..bef67c6 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 _0x950a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','lodash','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x950a,0x111));var _0xa950=function(_0x5a61e5,_0x504666){_0x5a61e5=_0x5a61e5-0x0;var _0x45b29e=_0x950a[_0x5a61e5];return _0x45b29e;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var logger=require(_0xa950('0x2'))(_0xa950('0x3'));var moment=require('moment');var BPromise=require(_0xa950('0x4'));var rp=require(_0xa950('0x5'));var fs=require('fs');var path=require(_0xa950('0x6'));var rimraf=require(_0xa950('0x7'));var config=require('../../config/environment');var attributes=require(_0xa950('0x8'));module[_0xa950('0x9')]=function(_0x512c0e,_0x14b4ac){return _0x512c0e[_0xa950('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x303a=['bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','../../config/logger','api','moment'];(function(_0x19cdd5,_0x106b9c){var _0x40107a=function(_0x2272da){while(--_0x2272da){_0x19cdd5['push'](_0x19cdd5['shift']());}};_0x40107a(++_0x106b9c);}(_0x303a,0x1a0));var _0xa303=function(_0x21f98f,_0x3a67da){_0x21f98f=_0x21f98f-0x0;var _0x48fc8d=_0x303a[_0x21f98f];return _0x48fc8d;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'tools_trunks','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 e10575f..087b201 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 _0xe7c8=['debug','GetTrunk','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk','options','raw','attributes','include','map','model'];(function(_0x16435a,_0x594b8d){var _0x3ad31d=function(_0x57975c){while(--_0x57975c){_0x16435a['push'](_0x16435a['shift']());}};_0x3ad31d(++_0x594b8d);}(_0xe7c8,0x8c));var _0x8e7c=function(_0x101cd1,_0x9e28ef){_0x101cd1=_0x101cd1-0x0;var _0x2e50b0=_0xe7c8[_0x101cd1];return _0x2e50b0;};'use strict';var _=require(_0x8e7c('0x0'));var util=require(_0x8e7c('0x1'));var moment=require(_0x8e7c('0x2'));var BPromise=require(_0x8e7c('0x3'));var rs=require(_0x8e7c('0x4'));var fs=require('fs');var Redis=require(_0x8e7c('0x5'));var db=require(_0x8e7c('0x6'))['db'];var utils=require(_0x8e7c('0x7'));var logger=require('../../config/logger')(_0x8e7c('0x8'));var config=require(_0x8e7c('0x9'));var jayson=require(_0x8e7c('0xa'));var client=jayson[_0x8e7c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x366dd4,_0x5456a4,_0x394600){return new BPromise(function(_0x27a583,_0x1f0f67){return client[_0x8e7c('0xc')](_0x366dd4,_0x394600)[_0x8e7c('0xd')](function(_0x4f88a8){logger[_0x8e7c('0xe')](_0x8e7c('0xf'),_0x5456a4,_0x8e7c('0x10'));logger['debug'](_0x8e7c('0x11'),_0x5456a4,_0x8e7c('0x10'),JSON[_0x8e7c('0x12')](_0x4f88a8));if(_0x4f88a8[_0x8e7c('0x13')]){if(_0x4f88a8['error']['code']===0x1f4){logger[_0x8e7c('0x13')](_0x8e7c('0xf'),_0x5456a4,_0x4f88a8['error'][_0x8e7c('0x14')]);return _0x1f0f67(_0x4f88a8[_0x8e7c('0x13')][_0x8e7c('0x14')]);}logger[_0x8e7c('0x13')](_0x8e7c('0xf'),_0x5456a4,_0x4f88a8[_0x8e7c('0x13')][_0x8e7c('0x14')]);return _0x27a583(_0x4f88a8[_0x8e7c('0x13')][_0x8e7c('0x14')]);}else{logger['info'](_0x8e7c('0xf'),_0x5456a4,_0x8e7c('0x10'));_0x27a583(_0x4f88a8[_0x8e7c('0x15')][_0x8e7c('0x14')]);}})[_0x8e7c('0x16')](function(_0x1210f5){logger[_0x8e7c('0x13')](_0x8e7c('0xf'),_0x5456a4,_0x1210f5);_0x1f0f67(_0x1210f5);});});}exports['GetTrunk']=function(_0x8f17b9){var _0x188644=this;return new Promise(function(_0x5a0f7e,_0x4b6888){return db[_0x8e7c('0x17')]['findAll']({'raw':_0x8f17b9[_0x8e7c('0x18')]?_0x8f17b9[_0x8e7c('0x18')][_0x8e7c('0x19')]===undefined?!![]:![]:!![],'where':_0x8f17b9[_0x8e7c('0x18')]?_0x8f17b9[_0x8e7c('0x18')]['where']||null:null,'attributes':_0x8f17b9['options']?_0x8f17b9[_0x8e7c('0x18')][_0x8e7c('0x1a')]||null:null,'limit':_0x8f17b9['options']?_0x8f17b9[_0x8e7c('0x18')]['limit']||null:null,'include':_0x8f17b9[_0x8e7c('0x18')]?_0x8f17b9[_0x8e7c('0x18')][_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x8f17b9[_0x8e7c('0x18')][_0x8e7c('0x1b')],function(_0x51f41d){return{'model':db[_0x51f41d[_0x8e7c('0x1d')]],'as':_0x51f41d['as'],'attributes':_0x51f41d[_0x8e7c('0x1a')],'include':_0x51f41d[_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x51f41d[_0x8e7c('0x1b')],function(_0x249e2d){return{'model':db[_0x249e2d[_0x8e7c('0x1d')]],'as':_0x249e2d['as'],'attributes':_0x249e2d[_0x8e7c('0x1a')],'include':_0x249e2d[_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x249e2d[_0x8e7c('0x1b')],function(_0x2807f2){return{'model':db[_0x2807f2[_0x8e7c('0x1d')]],'as':_0x2807f2['as'],'attributes':_0x2807f2[_0x8e7c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54fbba){logger[_0x8e7c('0xe')]('GetTrunk',_0x8f17b9);logger[_0x8e7c('0x1e')](_0x8e7c('0x1f'),_0x8f17b9,JSON['stringify'](_0x54fbba));_0x5a0f7e(_0x54fbba);})['catch'](function(_0x4d8551){logger[_0x8e7c('0x13')]('GetTrunk',_0x4d8551[_0x8e7c('0x14')],_0x8f17b9);_0x4b6888(_0x188644[_0x8e7c('0x13')](0x1f4,_0x4d8551[_0x8e7c('0x14')]));});});};exports[_0x8e7c('0x20')]=function(_0x258782){var _0x5b39fd=this;return new Promise(function(_0x300ac8,_0x3061d9){return db[_0x8e7c('0x17')]['find']({'raw':_0x258782['options']?_0x258782[_0x8e7c('0x18')][_0x8e7c('0x19')]===undefined?!![]:![]:!![],'where':_0x258782[_0x8e7c('0x18')]?_0x258782[_0x8e7c('0x18')][_0x8e7c('0x21')]||null:null,'attributes':_0x258782['options']?_0x258782[_0x8e7c('0x18')][_0x8e7c('0x1a')]||null:null,'include':_0x258782[_0x8e7c('0x18')]?_0x258782[_0x8e7c('0x18')][_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x258782[_0x8e7c('0x18')][_0x8e7c('0x1b')],function(_0x41ae8e){return{'model':db[_0x41ae8e[_0x8e7c('0x1d')]],'as':_0x41ae8e['as'],'attributes':_0x41ae8e['attributes'],'include':_0x41ae8e[_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x41ae8e[_0x8e7c('0x1b')],function(_0x1e943c){return{'model':db[_0x1e943c['model']],'as':_0x1e943c['as'],'attributes':_0x1e943c[_0x8e7c('0x1a')],'include':_0x1e943c[_0x8e7c('0x1b')]?_[_0x8e7c('0x1c')](_0x1e943c[_0x8e7c('0x1b')],function(_0x3377eb){return{'model':db[_0x3377eb[_0x8e7c('0x1d')]],'as':_0x3377eb['as'],'attributes':_0x3377eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e7c('0xd')](function(_0x24d3b0){logger[_0x8e7c('0xe')](_0x8e7c('0x20'),_0x258782);logger[_0x8e7c('0x1e')](_0x8e7c('0x20'),_0x258782,JSON[_0x8e7c('0x12')](_0x24d3b0));_0x300ac8(_0x24d3b0);})[_0x8e7c('0x16')](function(_0x43ffe1){logger[_0x8e7c('0x13')](_0x8e7c('0x20'),_0x43ffe1[_0x8e7c('0x14')],_0x258782);_0x3061d9(_0x5b39fd[_0x8e7c('0x13')](0x1f4,_0x43ffe1[_0x8e7c('0x14')]));});});}; \ No newline at end of file +var _0x70f2=['where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','options','raw','limit','include','map','model','attributes','then','ShowTrunk'];(function(_0x414b51,_0x2418e0){var _0x23f66a=function(_0x9596a6){while(--_0x9596a6){_0x414b51['push'](_0x414b51['shift']());}};_0x23f66a(++_0x2418e0);}(_0x70f2,0x1e1));var _0x270f=function(_0xc54d75,_0x449c91){_0xc54d75=_0xc54d75-0x0;var _0x4ae4ff=_0x70f2[_0xc54d75];return _0x4ae4ff;};'use strict';var _=require(_0x270f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x270f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x270f('0x2'));var db=require(_0x270f('0x3'))['db'];var utils=require(_0x270f('0x4'));var logger=require(_0x270f('0x5'))('rpc');var config=require(_0x270f('0x6'));var jayson=require(_0x270f('0x7'));var client=jayson['client'][_0x270f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ed62c,_0x12bc63,_0x37abb0){return new BPromise(function(_0x333327,_0x5a54f3){return client[_0x270f('0x9')](_0x1ed62c,_0x37abb0)['then'](function(_0x18c435){logger[_0x270f('0xa')]('Trunk,\x20%s,\x20%s',_0x12bc63,'request\x20sent');logger[_0x270f('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x12bc63,_0x270f('0xc'),JSON[_0x270f('0xd')](_0x18c435));if(_0x18c435['error']){if(_0x18c435[_0x270f('0xe')][_0x270f('0xf')]===0x1f4){logger['error'](_0x270f('0x10'),_0x12bc63,_0x18c435[_0x270f('0xe')]['message']);return _0x5a54f3(_0x18c435['error'][_0x270f('0x11')]);}logger[_0x270f('0xe')]('Trunk,\x20%s,\x20%s',_0x12bc63,_0x18c435[_0x270f('0xe')][_0x270f('0x11')]);return _0x333327(_0x18c435[_0x270f('0xe')][_0x270f('0x11')]);}else{logger[_0x270f('0xa')](_0x270f('0x10'),_0x12bc63,_0x270f('0xc'));_0x333327(_0x18c435[_0x270f('0x12')]['message']);}})[_0x270f('0x13')](function(_0x4baa0a){logger[_0x270f('0xe')](_0x270f('0x10'),_0x12bc63,_0x4baa0a);_0x5a54f3(_0x4baa0a);});});}exports[_0x270f('0x14')]=function(_0xafbaaf){var _0x3d677d=this;return new Promise(function(_0x114329,_0x3b5fa2){return db[_0x270f('0x15')]['findAll']({'raw':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')][_0x270f('0x17')]===undefined?!![]:![]:!![],'where':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')]['where']||null:null,'attributes':_0xafbaaf[_0x270f('0x16')]?_0xafbaaf[_0x270f('0x16')]['attributes']||null:null,'limit':_0xafbaaf[_0x270f('0x16')]?_0xafbaaf[_0x270f('0x16')][_0x270f('0x18')]||null:null,'include':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')][_0x270f('0x19')]?_[_0x270f('0x1a')](_0xafbaaf['options'][_0x270f('0x19')],function(_0x111ed3){return{'model':db[_0x111ed3[_0x270f('0x1b')]],'as':_0x111ed3['as'],'attributes':_0x111ed3['attributes'],'include':_0x111ed3[_0x270f('0x19')]?_[_0x270f('0x1a')](_0x111ed3[_0x270f('0x19')],function(_0x58cc8a){return{'model':db[_0x58cc8a['model']],'as':_0x58cc8a['as'],'attributes':_0x58cc8a[_0x270f('0x1c')],'include':_0x58cc8a[_0x270f('0x19')]?_[_0x270f('0x1a')](_0x58cc8a[_0x270f('0x19')],function(_0x164668){return{'model':db[_0x164668[_0x270f('0x1b')]],'as':_0x164668['as'],'attributes':_0x164668[_0x270f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x270f('0x1d')](function(_0xcb5bd6){logger[_0x270f('0xa')](_0x270f('0x14'),_0xafbaaf);logger['debug'](_0x270f('0x14'),_0xafbaaf,JSON['stringify'](_0xcb5bd6));_0x114329(_0xcb5bd6);})[_0x270f('0x13')](function(_0x51996f){logger[_0x270f('0xe')](_0x270f('0x14'),_0x51996f[_0x270f('0x11')],_0xafbaaf);_0x3b5fa2(_0x3d677d['error'](0x1f4,_0x51996f[_0x270f('0x11')]));});});};exports[_0x270f('0x1e')]=function(_0x413081){var _0x35d0d3=this;return new Promise(function(_0x3cd773,_0x522614){return db['Trunk']['find']({'raw':_0x413081[_0x270f('0x16')]?_0x413081['options'][_0x270f('0x17')]===undefined?!![]:![]:!![],'where':_0x413081['options']?_0x413081[_0x270f('0x16')][_0x270f('0x1f')]||null:null,'attributes':_0x413081[_0x270f('0x16')]?_0x413081['options'][_0x270f('0x1c')]||null:null,'include':_0x413081['options']?_0x413081[_0x270f('0x16')][_0x270f('0x19')]?_['map'](_0x413081['options'][_0x270f('0x19')],function(_0x129dae){return{'model':db[_0x129dae['model']],'as':_0x129dae['as'],'attributes':_0x129dae['attributes'],'include':_0x129dae['include']?_[_0x270f('0x1a')](_0x129dae['include'],function(_0xa2112a){return{'model':db[_0xa2112a[_0x270f('0x1b')]],'as':_0xa2112a['as'],'attributes':_0xa2112a[_0x270f('0x1c')],'include':_0xa2112a['include']?_[_0x270f('0x1a')](_0xa2112a[_0x270f('0x19')],function(_0x5f2b94){return{'model':db[_0x5f2b94[_0x270f('0x1b')]],'as':_0x5f2b94['as'],'attributes':_0x5f2b94[_0x270f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fec80){logger[_0x270f('0xa')](_0x270f('0x1e'),_0x413081);logger[_0x270f('0xb')]('ShowTrunk',_0x413081,JSON['stringify'](_0x1fec80));_0x3cd773(_0x1fec80);})[_0x270f('0x13')](function(_0xba1650){logger[_0x270f('0xe')](_0x270f('0x1e'),_0xba1650[_0x270f('0x11')],_0x413081);_0x522614(_0x35d0d3[_0x270f('0xe')](0x1f4,_0xba1650['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f4ded73..365f689 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 _0xc547=['/:id/lists','getLists','/:id/agents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','addQueues','join','root','server/files/images/','%s-%s','originalname','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','util','connect-timeout','Router','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc547,0x153));var _0x7c54=function(_0x582538,_0x561bc6){_0x582538=_0x582538-0x0;var _0x84d3ee=_0xc547[_0x582538];return _0x84d3ee;};'use strict';var multer=require('multer');var util=require(_0x7c54('0x0'));var path=require('path');var timeout=require(_0x7c54('0x1'));var express=require('express');var router=express[_0x7c54('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c54('0x3'));var controller=require(_0x7c54('0x4'));router[_0x7c54('0x5')]('/',auth[_0x7c54('0x6')](),controller[_0x7c54('0x7')]);router['get']('/describe',auth[_0x7c54('0x6')](),controller[_0x7c54('0x8')]);router[_0x7c54('0x5')](_0x7c54('0x9'),auth['isAuthenticated'](),controller[_0x7c54('0xa')]);router['get'](_0x7c54('0xb'),controller['getAvatar']);router[_0x7c54('0x5')](_0x7c54('0xc'),auth[_0x7c54('0x6')](),controller[_0x7c54('0xd')]);router['get'](_0x7c54('0xe'),auth[_0x7c54('0x6')](),controller['getQueues']);router['get'](_0x7c54('0xf'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x10')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller[_0x7c54('0x11')]);router['get'](_0x7c54('0x12'),auth['isAuthenticated'](),controller[_0x7c54('0x13')]);router['get']('/:id/screen_recordings',auth[_0x7c54('0x6')](),controller['getScreenRecordings']);router[_0x7c54('0x5')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x7c54('0x14')]);router[_0x7c54('0x5')](_0x7c54('0x15'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x16')]);router[_0x7c54('0x5')](_0x7c54('0x17'),auth['isAuthenticated'](),controller[_0x7c54('0x18')]);router['get']('/:id/sms/interactions',auth[_0x7c54('0x6')](),controller[_0x7c54('0x19')]);router[_0x7c54('0x5')](_0x7c54('0x1a'),auth['isAuthenticated'](),controller[_0x7c54('0x1b')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x7c54('0x1c')]);router[_0x7c54('0x5')](_0x7c54('0x1d'),auth['isAuthenticated'](),controller[_0x7c54('0x1e')]);router[_0x7c54('0x5')](_0x7c54('0x1f'),auth[_0x7c54('0x6')](),controller['getAgents']);router['get'](_0x7c54('0x20'),auth[_0x7c54('0x6')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7c54('0x21')]);router['get'](_0x7c54('0x22'),auth['isAuthenticated'](),controller[_0x7c54('0x23')]);router['get'](_0x7c54('0x24'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x25')]);router[_0x7c54('0x5')](_0x7c54('0x26'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x27')]);router['get']('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x7c54('0x5')](_0x7c54('0x28'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x29')]);router[_0x7c54('0x5')]('/:id/scheduled_calls',auth[_0x7c54('0x6')](),controller[_0x7c54('0x2a')]);router[_0x7c54('0x5')](_0x7c54('0x2b'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x2c')]);router[_0x7c54('0x2d')](_0x7c54('0x2e'),auth['isAuthenticated'](),controller[_0x7c54('0x2f')]);router[_0x7c54('0x2d')](_0x7c54('0xc'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x30')]);router[_0x7c54('0x2d')]('/',auth[_0x7c54('0x6')](),controller['create']);router[_0x7c54('0x2d')](_0x7c54('0xe'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4acb3b,_0xaf989e,_0x261287){_0x261287(null,path[_0x7c54('0x32')](config[_0x7c54('0x33')],_0x7c54('0x34')));},'filename':function(_0x5b9916,_0x1400c8,_0x2d70b5){_0x2d70b5(null,util['format'](_0x7c54('0x35'),Date['now'](),_0x1400c8[_0x7c54('0x36')]));}})});router[_0x7c54('0x2d')](_0x7c54('0xb'),upload['single']('file'),controller[_0x7c54('0x37')]);router[_0x7c54('0x2d')]('/:id/login',auth['isAuthenticated'](),controller[_0x7c54('0x38')]);router[_0x7c54('0x2d')]('/:id/logout',auth['isAuthenticated'](),controller[_0x7c54('0x39')]);router[_0x7c54('0x2d')](_0x7c54('0x3a'),auth['isAuthenticated'](),controller[_0x7c54('0x3b')]);router['post'](_0x7c54('0x3c'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x3d')]);router[_0x7c54('0x2d')](_0x7c54('0x3e'),auth[_0x7c54('0x6')](),controller['addTeams']);router[_0x7c54('0x2d')](_0x7c54('0x3f'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x40')]);router[_0x7c54('0x2d')](_0x7c54('0x41'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x42')]);router['post']('/:id/fax_interactions',auth[_0x7c54('0x6')](),controller['addFaxInteractions']);router[_0x7c54('0x2d')](_0x7c54('0x43'),auth['isAuthenticated'](),controller[_0x7c54('0x44')]);router['post']('/:id/openchannel_interactions',auth[_0x7c54('0x6')](),controller['addOpenchannelInteractions']);router[_0x7c54('0x2d')](_0x7c54('0x45'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x46')]);router[_0x7c54('0x2d')](_0x7c54('0x22'),auth['isAuthenticated'](),controller[_0x7c54('0x47')]);router[_0x7c54('0x2d')](_0x7c54('0x24'),auth[_0x7c54('0x6')](),controller['addOpenchannelAccounts']);router['post'](_0x7c54('0x26'),auth[_0x7c54('0x6')](),controller['addSmsAccounts']);router[_0x7c54('0x2d')](_0x7c54('0x48'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x49')]);router[_0x7c54('0x2d')](_0x7c54('0x28'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x4a')]);router['post']('/:id/api_key',auth[_0x7c54('0x6')](),controller[_0x7c54('0x4b')]);router[_0x7c54('0x4c')]('/:id',auth[_0x7c54('0x6')](),controller[_0x7c54('0x4d')]);router['put'](_0x7c54('0x4e'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x4f')]);router[_0x7c54('0x50')](_0x7c54('0xe'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x51')]);router[_0x7c54('0x50')](_0x7c54('0x3e'),auth[_0x7c54('0x6')](),controller['removeTeams']);router['delete'](_0x7c54('0x9'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x52')]);router[_0x7c54('0x50')](_0x7c54('0x3f'),auth[_0x7c54('0x6')](),controller['removeChatInteractions']);router[_0x7c54('0x50')](_0x7c54('0x41'),auth[_0x7c54('0x6')](),controller['removeMailInteractions']);router[_0x7c54('0x50')](_0x7c54('0x53'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x54')]);router[_0x7c54('0x50')]('/:id/sms_interactions',auth[_0x7c54('0x6')](),controller[_0x7c54('0x55')]);router[_0x7c54('0x50')]('/:id/openchannel_interactions',auth[_0x7c54('0x6')](),controller['removeOpenchannelInteractions']);router[_0x7c54('0x50')](_0x7c54('0x45'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x56')]);router[_0x7c54('0x50')](_0x7c54('0x22'),auth[_0x7c54('0x6')](),controller['removeMailAccounts']);router['delete'](_0x7c54('0x24'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x57')]);router[_0x7c54('0x50')](_0x7c54('0x26'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x58')]);router[_0x7c54('0x50')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x7c54('0x59')]);router[_0x7c54('0x50')](_0x7c54('0x28'),auth['isAuthenticated'](),controller[_0x7c54('0x5a')]);router[_0x7c54('0x50')](_0x7c54('0x2b'),auth[_0x7c54('0x6')](),controller[_0x7c54('0x5b')]);module['exports']=router; \ No newline at end of file +var _0x057f=['bulkCreate','addContacts','create','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','addChatWebsites','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','show','getAvatar','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getScheduledCalls','getApiKey','post','/create_many'];(function(_0x2dd6e3,_0xace026){var _0x396274=function(_0x32d7ad){while(--_0x32d7ad){_0x2dd6e3['push'](_0x2dd6e3['shift']());}};_0x396274(++_0xace026);}(_0x057f,0x1d7));var _0xf057=function(_0x558cc3,_0x4b428f){_0x558cc3=_0x558cc3-0x0;var _0x23e7b9=_0x057f[_0x558cc3];return _0x23e7b9;};'use strict';var multer=require(_0xf057('0x0'));var util=require('util');var path=require(_0xf057('0x1'));var timeout=require(_0xf057('0x2'));var express=require(_0xf057('0x3'));var router=express['Router']();var auth=require(_0xf057('0x4'));var interaction=require(_0xf057('0x5'));var config=require(_0xf057('0x6'));var controller=require(_0xf057('0x7'));router[_0xf057('0x8')]('/',auth[_0xf057('0x9')](),controller[_0xf057('0xa')]);router[_0xf057('0x8')](_0xf057('0xb'),auth[_0xf057('0x9')](),controller[_0xf057('0xc')]);router[_0xf057('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf057('0xd')]);router[_0xf057('0x8')]('/:id/avatar',controller[_0xf057('0xe')]);router['get'](_0xf057('0xf'),auth[_0xf057('0x9')](),controller[_0xf057('0x10')]);router[_0xf057('0x8')]('/:id/queues',auth[_0xf057('0x9')](),controller[_0xf057('0x11')]);router[_0xf057('0x8')](_0xf057('0x12'),auth['isAuthenticated'](),controller[_0xf057('0x13')]);router['get'](_0xf057('0x14'),auth['isAuthenticated'](),controller[_0xf057('0x15')]);router[_0xf057('0x8')](_0xf057('0x16'),auth[_0xf057('0x9')](),controller[_0xf057('0x17')]);router[_0xf057('0x8')](_0xf057('0x18'),auth[_0xf057('0x9')](),controller['getScreenRecordings']);router[_0xf057('0x8')]('/:id/chat/interactions',auth[_0xf057('0x9')](),controller[_0xf057('0x19')]);router['get'](_0xf057('0x1a'),auth[_0xf057('0x9')](),controller[_0xf057('0x1b')]);router[_0xf057('0x8')](_0xf057('0x1c'),auth[_0xf057('0x9')](),controller['getMailInteractions']);router[_0xf057('0x8')]('/:id/sms/interactions',auth[_0xf057('0x9')](),controller[_0xf057('0x1d')]);router[_0xf057('0x8')]('/:id/fax/interactions',auth[_0xf057('0x9')](),controller[_0xf057('0x1e')]);router[_0xf057('0x8')](_0xf057('0x1f'),auth[_0xf057('0x9')](),controller['getTeams']);router[_0xf057('0x8')](_0xf057('0x20'),auth[_0xf057('0x9')](),controller[_0xf057('0x21')]);router[_0xf057('0x8')](_0xf057('0x22'),auth[_0xf057('0x9')](),controller[_0xf057('0x23')]);router[_0xf057('0x8')](_0xf057('0x24'),auth[_0xf057('0x9')](),controller[_0xf057('0x25')]);router[_0xf057('0x8')](_0xf057('0x26'),auth[_0xf057('0x9')](),controller[_0xf057('0x27')]);router[_0xf057('0x8')](_0xf057('0x28'),auth[_0xf057('0x9')](),controller['getMailAccounts']);router[_0xf057('0x8')](_0xf057('0x29'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xf057('0x8')](_0xf057('0x2a'),auth[_0xf057('0x9')](),controller['getSmsAccounts']);router[_0xf057('0x8')](_0xf057('0x2b'),auth[_0xf057('0x9')](),controller[_0xf057('0x2c')]);router[_0xf057('0x8')]('/:id/square_projects',auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xf057('0x8')]('/:id/scheduled_calls',auth[_0xf057('0x9')](),controller[_0xf057('0x2d')]);router[_0xf057('0x8')]('/:id/api_key',auth[_0xf057('0x9')](),controller[_0xf057('0x2e')]);router[_0xf057('0x2f')](_0xf057('0x30'),auth[_0xf057('0x9')](),controller[_0xf057('0x31')]);router[_0xf057('0x2f')](_0xf057('0xf'),auth[_0xf057('0x9')](),controller[_0xf057('0x32')]);router[_0xf057('0x2f')]('/',auth[_0xf057('0x9')](),controller[_0xf057('0x33')]);router[_0xf057('0x2f')]('/:id/queues',auth[_0xf057('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xf057('0x34')]({'destination':function(_0x39249d,_0x105d7e,_0x3bb9e3){_0x3bb9e3(null,path[_0xf057('0x35')](config[_0xf057('0x36')],_0xf057('0x37')));},'filename':function(_0x2978d5,_0x37843f,_0x3edda1){_0x3edda1(null,util[_0xf057('0x38')](_0xf057('0x39'),Date['now'](),_0x37843f[_0xf057('0x3a')]));}})});router[_0xf057('0x2f')](_0xf057('0x3b'),upload[_0xf057('0x3c')](_0xf057('0x3d')),controller[_0xf057('0x3e')]);router['post'](_0xf057('0x3f'),auth[_0xf057('0x9')](),controller[_0xf057('0x40')]);router['post'](_0xf057('0x41'),auth[_0xf057('0x9')](),controller[_0xf057('0x42')]);router[_0xf057('0x2f')](_0xf057('0x43'),auth[_0xf057('0x9')](),controller[_0xf057('0x44')]);router[_0xf057('0x2f')](_0xf057('0x45'),auth[_0xf057('0x9')](),controller[_0xf057('0x46')]);router[_0xf057('0x2f')](_0xf057('0x1f'),auth[_0xf057('0x9')](),controller[_0xf057('0x47')]);router[_0xf057('0x2f')](_0xf057('0x48'),auth[_0xf057('0x9')](),controller[_0xf057('0x49')]);router[_0xf057('0x2f')](_0xf057('0x4a'),auth['isAuthenticated'](),controller[_0xf057('0x4b')]);router[_0xf057('0x2f')](_0xf057('0x4c'),auth[_0xf057('0x9')](),controller['addFaxInteractions']);router['post'](_0xf057('0x4d'),auth[_0xf057('0x9')](),controller[_0xf057('0x4e')]);router[_0xf057('0x2f')](_0xf057('0x4f'),auth[_0xf057('0x9')](),controller[_0xf057('0x50')]);router[_0xf057('0x2f')](_0xf057('0x26'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post']('/:id/mail_accounts',auth[_0xf057('0x9')](),controller[_0xf057('0x51')]);router['post'](_0xf057('0x29'),auth['isAuthenticated'](),controller[_0xf057('0x52')]);router[_0xf057('0x2f')](_0xf057('0x2a'),auth[_0xf057('0x9')](),controller['addSmsAccounts']);router[_0xf057('0x2f')](_0xf057('0x2b'),auth['isAuthenticated'](),controller[_0xf057('0x53')]);router[_0xf057('0x2f')](_0xf057('0x54'),auth[_0xf057('0x9')](),controller[_0xf057('0x55')]);router[_0xf057('0x2f')](_0xf057('0x56'),auth[_0xf057('0x9')](),controller[_0xf057('0x57')]);router[_0xf057('0x58')]('/:id',auth[_0xf057('0x9')](),controller['update']);router[_0xf057('0x58')](_0xf057('0x59'),auth[_0xf057('0x9')](),controller[_0xf057('0x5a')]);router[_0xf057('0x5b')]('/:id/queues',auth[_0xf057('0x9')](),controller[_0xf057('0x5c')]);router[_0xf057('0x5b')]('/:id/teams',auth[_0xf057('0x9')](),controller[_0xf057('0x5d')]);router[_0xf057('0x5b')](_0xf057('0x5e'),auth['isAuthenticated'](),controller[_0xf057('0x5f')]);router[_0xf057('0x5b')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete'](_0xf057('0x4c'),auth['isAuthenticated'](),controller[_0xf057('0x60')]);router[_0xf057('0x5b')](_0xf057('0x4d'),auth['isAuthenticated'](),controller[_0xf057('0x61')]);router[_0xf057('0x5b')]('/:id/openchannel_interactions',auth[_0xf057('0x9')](),controller[_0xf057('0x62')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xf057('0x63')]);router[_0xf057('0x5b')](_0xf057('0x28'),auth['isAuthenticated'](),controller[_0xf057('0x64')]);router[_0xf057('0x5b')](_0xf057('0x29'),auth[_0xf057('0x9')](),controller[_0xf057('0x65')]);router[_0xf057('0x5b')](_0xf057('0x2a'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0xf057('0x2b'),auth['isAuthenticated'](),controller[_0xf057('0x66')]);router[_0xf057('0x5b')](_0xf057('0x54'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0xf057('0x5b')](_0xf057('0x56'),auth[_0xf057('0x9')](),controller[_0xf057('0x67')]);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 17443b8..f4061c0 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 _0xbaf0=['wss','encryption','avpf','icesupport','dtlsenable','rtcp_mux','force_avp','dtlsverify','dtlssetup','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','get'];(function(_0x42f0f7,_0x15cd68){var _0x56daf4=function(_0x16c42f){while(--_0x16c42f){_0x42f0f7['push'](_0x42f0f7['shift']());}};_0x56daf4(++_0x15cd68);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var _=require(_0x0baf('0x2'));module[_0x0baf('0x3')]={'name':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5a3e42){this[_0x0baf('0x6')](_0x0baf('0x5'),_0x5a3e42);this[_0x0baf('0x6')](_0x0baf('0x7'),_0x5a3e42);},'comment':_0x0baf('0x8')},'fullname':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'set':function(_0x1a10b1){this[_0x0baf('0x6')](_0x0baf('0x9'),_0x1a10b1);this['setDataValue'](_0x0baf('0xa'),util['format'](_0x0baf('0xb'),_0x1a10b1,this[_0x0baf('0xc')](_0x0baf('0xd'))));}},'alias':{'type':Sequelize[_0x0baf('0x4')]},'email':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0xe'),'validate':{'isEmail':!![]},'set':function(_0x41cead){if(_0x41cead){this[_0x0baf('0x6')](_0x0baf('0xe'),_0x41cead[_0x0baf('0xf')]());}}},'role':{'type':Sequelize[_0x0baf('0x10')]('admin','user',_0x0baf('0x11'),_0x0baf('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x1c76a8){this[_0x0baf('0x6')](_0x0baf('0xd'),_0x1c76a8);this[_0x0baf('0x6')](_0x0baf('0x14'),_0x1c76a8);this[_0x0baf('0x6')]('callerid',util['format'](_0x0baf('0xb'),this[_0x0baf('0xc')](_0x0baf('0x9')),_0x1c76a8));}},'salt':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize[_0x0baf('0x4')]},'mobile':{'type':Sequelize[_0x0baf('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x0baf('0x4')]},'userpic':{'type':Sequelize[_0x0baf('0x4')]},'city':{'type':Sequelize[_0x0baf('0x4')]},'country':{'type':Sequelize[_0x0baf('0x4')]},'online':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0baf('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':_0x0baf('0x17')},'lastPauseAt':{'type':Sequelize[_0x0baf('0x16')]},'chatCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0baf('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0baf('0x10')]('friend',_0x0baf('0x19'),_0x0baf('0x1a')),'allowNull':!![],'defaultValue':_0x0baf('0x1b')},'context':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x1c'),'ALLOWED_PASSED_SCREEN',_0x0baf('0x1d'),_0x0baf('0x1e'),_0x0baf('0x1f'),_0x0baf('0x20'),_0x0baf('0x21'),_0x0baf('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x23'),'set':function(_0x275ea1){this[_0x0baf('0x6')](_0x0baf('0x24'),_0x275ea1?_0x275ea1[_0x0baf('0x25')](','):null);},'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x24'))?this[_0x0baf('0xc')](_0x0baf('0x24'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0baf('0x10')]('rfc2833',_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'),_0x0baf('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no','nonat',_0x0baf('0x2c'),_0x0baf('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x2e'),'set':function(_0x4aa6ed){this[_0x0baf('0x6')](_0x0baf('0x2f'),_0x4aa6ed?_0x4aa6ed['join'](','):null);},'get':function(){return this[_0x0baf('0xc')]('nat')?this['getDataValue'](_0x0baf('0x2f'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0baf('0x4')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'language':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x4')]},'disallow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x30')},'allow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x31'),'set':function(_0x36c6d2){this[_0x0baf('0x6')](_0x0baf('0x32'),_0x36c6d2?_0x36c6d2[_0x0baf('0x25')](';'):_0x0baf('0x31'));},'get':function(){return this['getDataValue'](_0x0baf('0x32'))?this[_0x0baf('0xc')]('allow')[_0x0baf('0x26')](';'):null;},'comment':_0x0baf('0x33')},'autoframing':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'set':function(_0x456d0b){this['setDataValue'](_0x0baf('0x34'),_0x456d0b?_0x456d0b[_0x0baf('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x0baf('0x34'))?this[_0x0baf('0xc')](_0x0baf('0x34'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x36')},'amaflags':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'busylevel':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no',_0x0baf('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3b'),_0x0baf('0x3c')),'allowNull':!![],'defaultValue':_0x0baf('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0baf('0x10')]('yes','no',_0x0baf('0x3d'),_0x0baf('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3f'),_0x0baf('0x40'),_0x0baf('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x42'),_0x0baf('0x2c'),_0x0baf('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0baf('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0,'set':function(_0x27f580){this[_0x0baf('0x6')](_0x0baf('0x44'),_0x27f580);var _0x1c7d88=this[_0x0baf('0x45')]({'plain':!![]});switch(_0x27f580){case 0x0:case 0x1:var _0x14e6d0=_0x1c7d88[_0x0baf('0x24')]?_['isArray'](_0x1c7d88[_0x0baf('0x24')])?_0x1c7d88['transport'][_0x0baf('0x25')]():_0x1c7d88['transport']:'udp';if(_0x14e6d0===_0x0baf('0x46')){_0x14e6d0='udp';}this[_0x0baf('0x6')](_0x0baf('0x24'),_0x14e6d0);this['setDataValue'](_0x0baf('0x47'),'no');this[_0x0baf('0x6')](_0x0baf('0x48'),null);this['setDataValue']('force_avp',null);this[_0x0baf('0x6')](_0x0baf('0x49'),null);this[_0x0baf('0x6')](_0x0baf('0x4a'),null);this[_0x0baf('0x6')]('dtlsverify',null);this[_0x0baf('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x0baf('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x0baf('0x4b'),'no');break;case 0x2:this[_0x0baf('0x6')](_0x0baf('0x24'),_0x0baf('0x46'));this[_0x0baf('0x6')](_0x0baf('0x47'),'yes');this[_0x0baf('0x6')](_0x0baf('0x48'),_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4c'),_0x0baf('0x2b'));this['setDataValue'](_0x0baf('0x49'),_0x0baf('0x2b'));this[_0x0baf('0x6')]('dtlsenable',_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4d'),'no');this[_0x0baf('0x6')](_0x0baf('0x4e'),_0x0baf('0x41'));this[_0x0baf('0x6')]('dtlscertfile',_0x1c7d88['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x0baf('0x6')](_0x0baf('0x4f'),_0x1c7d88[_0x0baf('0x4f')]||_0x0baf('0x50'));this[_0x0baf('0x6')](_0x0baf('0x4b'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x34c1f4){this['setDataValue'](_0x0baf('0x51'),_0x34c1f4?_0x34c1f4[_0x0baf('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x0baf('0x51'))?_[_0x0baf('0x52')](this[_0x0baf('0xc')](_0x0baf('0x51'))[_0x0baf('0x26')](','),function(_0x33a5af){return parseInt(_0x33a5af,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0baf('0x53')],'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x54'))?this[_0x0baf('0xc')](_0x0baf('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x97d385){if(typeof _0x97d385===_0x0baf('0x55')){var _0x421ca0=_0x97d385==='1'?!![]:_0x97d385==='0'?![]:_0x97d385===_0x0baf('0x56')?!![]:_0x97d385===_0x0baf('0x57')?![]:![];this['setDataValue']('screenrecording',_0x421ca0);}else{this[_0x0baf('0x6')](_0x0baf('0x58'),_0x97d385);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x28bc1c){this[_0x0baf('0x6')](_0x0baf('0x59'),_0x28bc1c);if(_0x28bc1c===!![]){this['setDataValue'](_0x0baf('0x5a'),moment());this[_0x0baf('0x6')](_0x0baf('0x5b'),0x0);}else{this['setDataValue'](_0x0baf('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0xb10b=['refuse','originate','uac','uas','fingerprint','certificate','active','actpass','showWebBar','encryption','avpf','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blockedAt','loginAttempts','sequelize','util','lodash','exports','name','setDataValue','defaultuser','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','agent','telephone','local','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','never','\x22\x22\x20<>','always','accept'];(function(_0x2226b2,_0x559998){var _0x5672d6=function(_0x56b395){while(--_0x56b395){_0x2226b2['push'](_0x2226b2['shift']());}};_0x5672d6(++_0x559998);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c5231,_0x51913c){_0x2c5231=_0x2c5231-0x0;var _0x569090=_0xb10b[_0x2c5231];return _0x569090;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var _=require(_0xbb10('0x2'));module[_0xbb10('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb10('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x9bbed){this[_0xbb10('0x5')](_0xbb10('0x4'),_0x9bbed);this[_0xbb10('0x5')](_0xbb10('0x6'),_0x9bbed);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xbb10('0x7')],'allowNull':![],'set':function(_0x3cdd53){this['setDataValue'](_0xbb10('0x8'),_0x3cdd53);this[_0xbb10('0x5')](_0xbb10('0x9'),util[_0xbb10('0xa')](_0xbb10('0xb'),_0x3cdd53,this[_0xbb10('0xc')](_0xbb10('0xd'))));}},'alias':{'type':Sequelize[_0xbb10('0x7')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x20bd61){if(_0x20bd61){this[_0xbb10('0x5')](_0xbb10('0xe'),_0x20bd61['toLowerCase']());}}},'role':{'type':Sequelize[_0xbb10('0xf')]('admin',_0xbb10('0x10'),_0xbb10('0x11'),_0xbb10('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xbb10('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xbb10('0x7')],'defaultValue':_0xbb10('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xbb10('0xd'),'set':function(_0x42d7e4){this[_0xbb10('0x5')](_0xbb10('0xd'),_0x42d7e4);this[_0xbb10('0x5')](_0xbb10('0x14'),_0x42d7e4);this[_0xbb10('0x5')](_0xbb10('0x9'),util[_0xbb10('0xa')](_0xbb10('0xb'),this['getDataValue'](_0xbb10('0x8')),_0x42d7e4));}},'salt':{'type':Sequelize[_0xbb10('0x7')]},'phone':{'type':Sequelize[_0xbb10('0x7')]},'mobile':{'type':Sequelize[_0xbb10('0x7')]},'address':{'type':Sequelize[_0xbb10('0x7')]},'zipcode':{'type':Sequelize[_0xbb10('0x7')]},'userpic':{'type':Sequelize[_0xbb10('0x7')]},'city':{'type':Sequelize[_0xbb10('0x7')]},'country':{'type':Sequelize[_0xbb10('0x7')]},'online':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x16')},'lastPauseAt':{'type':Sequelize[_0xbb10('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbb10('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xbb10('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0xbb10('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x19'),_0xbb10('0x10'),_0xbb10('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![],'defaultValue':_0xbb10('0x1b')},'callingpres':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x1c'),_0xbb10('0x1d'),_0xbb10('0x1e'),'ALLOWED',_0xbb10('0x1f'),'PROHIB_PASSED_SCREEN',_0xbb10('0x20'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![],'defaultValue':_0xbb10('0x21'),'set':function(_0x4f590d){this[_0xbb10('0x5')](_0xbb10('0x22'),_0x4f590d?_0x4f590d[_0xbb10('0x23')](','):null);},'get':function(){return this[_0xbb10('0xc')](_0xbb10('0x22'))?this[_0xbb10('0xc')](_0xbb10('0x22'))['split'](','):null;},'comment':_0xbb10('0x24')},'dtmfmode':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x25'),_0xbb10('0x26'),_0xbb10('0x27'),_0xbb10('0x28'),_0xbb10('0x29')),'allowNull':!![],'defaultValue':_0xbb10('0x25')},'directmedia':{'type':Sequelize[_0xbb10('0xf')]('yes','no',_0xbb10('0x2a'),_0xbb10('0x2b'),_0xbb10('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbb10('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbb10('0x2d'),'set':function(_0x40c164){this[_0xbb10('0x5')](_0xbb10('0x2e'),_0x40c164?_0x40c164[_0xbb10('0x23')](','):null);},'get':function(){return this[_0xbb10('0xc')]('nat')?this[_0xbb10('0xc')](_0xbb10('0x2e'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbb10('0x7')]},'pickupgroup':{'type':Sequelize[_0xbb10('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbb10('0x7')]},'disallow':{'type':Sequelize[_0xbb10('0x7')],'allowNull':![],'defaultValue':_0xbb10('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb10('0x30'),'set':function(_0x12238a){this[_0xbb10('0x5')](_0xbb10('0x31'),_0x12238a?_0x12238a['join'](';'):_0xbb10('0x30'));},'get':function(){return this[_0xbb10('0xc')]('allow')?this[_0xbb10('0xc')](_0xbb10('0x31'))[_0xbb10('0x32')](';'):null;},'comment':_0xbb10('0x33')},'autoframing':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1e8f79){this[_0xbb10('0x5')](_0xbb10('0x35'),_0x1e8f79?_0x1e8f79[_0xbb10('0x23')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x35'))?this[_0xbb10('0xc')](_0xbb10('0x35'))[_0xbb10('0x32')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0xf')]('yes','no',_0xbb10('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xbb10('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![],'defaultValue':_0xbb10('0x37')},'amaflags':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':_0xbb10('0x34')},'busylevel':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbb10('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no',_0xbb10('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xbb10('0x39'),_0xbb10('0x3a'),_0xbb10('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x3c'),_0xbb10('0x3d')),'allowNull':!![],'defaultValue':_0xbb10('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no',_0xbb10('0x3e'),_0xbb10('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x40'),'passive',_0xbb10('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xbb10('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xbb10('0xf')](_0xbb10('0x34'),'no',_0xbb10('0x2a'),_0xbb10('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbb10('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xbb10('0x17')]},'showWebBar':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x0,'set':function(_0x2dd150){this[_0xbb10('0x5')](_0xbb10('0x42'),_0x2dd150);var _0x45c0dc=this['get']({'plain':!![]});switch(_0x2dd150){case 0x0:case 0x1:var _0x117e84=_0x45c0dc[_0xbb10('0x22')]?_['isArray'](_0x45c0dc['transport'])?_0x45c0dc['transport'][_0xbb10('0x23')]():_0x45c0dc[_0xbb10('0x22')]:_0xbb10('0x21');if(_0x117e84==='wss'){_0x117e84='udp';}this['setDataValue'](_0xbb10('0x22'),_0x117e84);this[_0xbb10('0x5')](_0xbb10('0x43'),'no');this['setDataValue'](_0xbb10('0x44'),null);this[_0xbb10('0x5')]('force_avp',null);this['setDataValue'](_0xbb10('0x45'),null);this[_0xbb10('0x5')](_0xbb10('0x46'),null);this[_0xbb10('0x5')]('dtlsverify',null);this[_0xbb10('0x5')](_0xbb10('0x47'),null);this[_0xbb10('0x5')]('dtlscertfile',null);this[_0xbb10('0x5')](_0xbb10('0x48'),null);this[_0xbb10('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xbb10('0x5')](_0xbb10('0x22'),_0xbb10('0x49'));this[_0xbb10('0x5')]('encryption',_0xbb10('0x34'));this[_0xbb10('0x5')](_0xbb10('0x44'),_0xbb10('0x34'));this['setDataValue'](_0xbb10('0x4a'),_0xbb10('0x34'));this[_0xbb10('0x5')](_0xbb10('0x45'),_0xbb10('0x34'));this[_0xbb10('0x5')](_0xbb10('0x46'),'yes');this['setDataValue']('dtlsverify','no');this[_0xbb10('0x5')](_0xbb10('0x47'),_0xbb10('0x41'));this['setDataValue']('dtlscertfile',_0x45c0dc[_0xbb10('0x4b')]||_0xbb10('0x4c'));this[_0xbb10('0x5')](_0xbb10('0x48'),_0x45c0dc[_0xbb10('0x48')]||_0xbb10('0x4d'));this['setDataValue'](_0xbb10('0x4e'),_0xbb10('0x34'));break;default:}}},'permissions':{'type':Sequelize[_0xbb10('0x4f')],'set':function(_0x14f16b){this[_0xbb10('0x5')]('permissions',_0x14f16b?_0x14f16b['join'](','):[]);},'get':function(){return this['getDataValue'](_0xbb10('0x50'))?_[_0xbb10('0x51')](this[_0xbb10('0xc')](_0xbb10('0x50'))[_0xbb10('0x32')](','),function(_0x1d40b8){return parseInt(_0x1d40b8,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xbb10('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbb10('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xbb10('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbb10('0x7')]},'passwordResetAt':{'type':Sequelize[_0xbb10('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xbb10('0x52')],'get':function(){return this[_0xbb10('0xc')](_0xbb10('0x53'))?this[_0xbb10('0xc')](_0xbb10('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xbb10('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xbb10('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![],'set':function(_0x172be3){if(typeof _0x172be3===_0xbb10('0x54')){var _0x312a08=_0x172be3==='1'?!![]:_0x172be3==='0'?![]:_0x172be3==='true'?!![]:_0x172be3===_0xbb10('0x55')?![]:![];this[_0xbb10('0x5')](_0xbb10('0x56'),_0x312a08);}else{this['setDataValue']('screenrecording',_0x172be3);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x23286d){this['setDataValue']('blocked',_0x23286d);if(_0x23286d===!![]){this[_0xbb10('0x5')](_0xbb10('0x57'),moment());this[_0xbb10('0x5')](_0xbb10('0x58'),0x0);}else{this[_0xbb10('0x5')](_0xbb10('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xbb10('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xbb10('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbb10('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 830fea1..b9eb01a 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 _0x00c1=['offset','limit','Content-Range','json','reject','update','destroy','Agents','agent','Telephones','telephone','filter','ignore','map','value','name','UserProfileResource','User','model','differenceBy','keys','salt','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','key','VIRTUAL','sequelize','lower','field','options','include','show','rawAttributes','password','includeAll','find','bulkCreate','body','role','params','describe','addContacts','ids','omit','agent\x20role','user','../../config/license/util','users','isNil','format','count\x20%s:\x20%s','create','internal','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','email','permissions','103','104','105','106','107','108','109','100','VoiceMail','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','Setting','findOne','addQueues','online','loginInPause','interface','isValidChannel','Unknown\x20channel','capitalize','Queues','penalty','spread','toLowerCase','QueueId','emit','Queue:save','findAll','SIP/%s','voicePause','each','UserVoiceQueueRt','removeQueues','channel','remove','Queue:remove','voice','addAvatar','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getContacts','CmContact','hasOwnProperty','CmList','List','Tags','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','rows','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','phone','mobile','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','push','UserVoiceQueue.penalty','upsert','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','lastPauseAt','mail','chat','sms','manual','set','%s%s','Pause','getTeams','addTeams','removeTeams','getLists','getVoiceQueues','send','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','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','apiKeyIat','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','html-pdf','zip-dir','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./user.socket','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','count'];(function(_0x2b6eae,_0xd45fa9){var _0x2ed981=function(_0x4d3103){while(--_0x4d3103){_0x2b6eae['push'](_0x2b6eae['shift']());}};_0x2ed981(++_0xd45fa9);}(_0x00c1,0x11f));var _0x100c=function(_0x411e73,_0xd28256){_0x411e73=_0x411e73-0x0;var _0x194477=_0x00c1[_0x411e73];return _0x194477;};'use strict';var pdf=require(_0x100c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x100c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x100c('0x2'));var BPromise=require(_0x100c('0x3'));var Mustache=require(_0x100c('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x100c('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x100c('0x6'));var squel=require(_0x100c('0x7'));var crypto=require(_0x100c('0x8'));var jsforce=require(_0x100c('0x9'));var deskjs=require(_0x100c('0xa'));var toCsv=require(_0x100c('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x100c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x100c('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x100c('0xd'))(_0x100c('0xe'));var utils=require(_0x100c('0xf'));var config=require(_0x100c('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x100c('0x11')](config[_0x100c('0x12')],{'host':_0x100c('0x13'),'port':0x18eb});var socket=require(_0x100c('0x14'))(new Redis(config[_0x100c('0x12')]));require(_0x100c('0x15'))['register'](socket);var jayson=require(_0x100c('0x16'));var client=jayson['client'][_0x100c('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2d49c0,_0x23bed4,_0x228677){if(_0x228677){var _0xb90e82=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb90e82[_0x100c('0x18')](_0x23bed4)){return _0x2d49c0;}else{throw new Error(_0x100c('0x19'));}}else{return _0x2d49c0;}}function respondWithRpcPromise(_0x5be637,_0x4a7286,_0x1309d8,_0xe404df){return new BPromise(function(_0x479b47,_0x1103ad){var _0x3c5c55=_0xe404df||client;return _0x3c5c55[_0x100c('0x1a')](_0x5be637,_0x1309d8)[_0x100c('0x1b')](function(_0x4653c7){logger[_0x100c('0x1c')](_0x100c('0x1d'),_0x4a7286,_0x100c('0x1e'));logger['debug'](_0x100c('0x1f'),_0x4a7286,_0x100c('0x1e'),JSON['stringify'](_0x4653c7));if(_0x4653c7[_0x100c('0x20')]){if(_0x4653c7[_0x100c('0x20')]['code']===0x1f4){logger[_0x100c('0x20')]('User,\x20%s,\x20%s',_0x4a7286,_0x4653c7['error'][_0x100c('0x21')]);return _0x1103ad(_0x4653c7[_0x100c('0x20')][_0x100c('0x21')]);}logger['error']('User,\x20%s,\x20%s',_0x4a7286,_0x4653c7[_0x100c('0x20')]['message']);return _0x479b47(_0x4653c7[_0x100c('0x20')][_0x100c('0x21')]);}else{logger[_0x100c('0x1c')](_0x100c('0x1d'),_0x4a7286,'request\x20sent');_0x479b47(_0x4653c7[_0x100c('0x22')][_0x100c('0x21')]);}})[_0x100c('0x23')](function(_0x3bab6b){logger[_0x100c('0x20')](_0x100c('0x1d'),_0x4a7286,_0x3bab6b);_0x1103ad(_0x3bab6b);});});}function respondWithStatusCode(_0x181d36,_0xeae2a){_0xeae2a=_0xeae2a||0xcc;return function(_0x9d7b82){if(_0x9d7b82){return _0x181d36[_0x100c('0x24')](_0xeae2a);}return _0x181d36['status'](_0xeae2a)[_0x100c('0x25')]();};}function respondWithResult(_0x51c24e,_0x5419f3){_0x5419f3=_0x5419f3||0xc8;return function(_0x582a3a){if(_0x582a3a){return _0x51c24e[_0x100c('0x26')](_0x5419f3)['json'](_0x582a3a);}};}function respondWithFilteredResult(_0x2dfb78,_0x554450){return function(_0x437d88){if(_0x437d88){var _0x4d317e=_0x437d88[_0x100c('0x27')],_0x4fa6da=_0x554450[_0x100c('0x28')],_0x52533b=_0x554450[_0x100c('0x28')]+_0x554450[_0x100c('0x29')],_0x3f5102;if(_0x52533b>=_0x4d317e){_0x52533b=_0x4d317e;_0x3f5102=0xc8;}else{_0x3f5102=0xce;}_0x2dfb78[_0x100c('0x26')](_0x3f5102);return _0x2dfb78['set'](_0x100c('0x2a'),_0x4fa6da+'-'+_0x52533b+'/'+_0x4d317e)[_0x100c('0x2b')](_0x437d88);}return null;};}function patchUpdates(_0x5f5b40){return function(_0x2f579d){try{jsonpatch['apply'](_0x2f579d,_0x5f5b40,!![]);}catch(_0xce69fb){return BPromise[_0x100c('0x2c')](_0xce69fb);}return _0x2f579d['save']();};}function saveUpdates(_0x2cb211,_0x53dde4){return function(_0x7b5487){if(_0x7b5487){return _0x7b5487[_0x100c('0x2d')](_0x2cb211)[_0x100c('0x1b')](function(_0x19321d){return _0x19321d;});}return null;};}function removeEntity(_0x566922,_0x40808c){return function(_0x165ab3){if(_0x165ab3){return _0x165ab3[_0x100c('0x2e')]()[_0x100c('0x1b')](function(){var _0x312b74=_0x165ab3['get']({'plain':!![]});var _0x12416e=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x100c('0x2f'),'value':_0x100c('0x30'),'ignore':![]},{'name':_0x100c('0x31'),'value':_0x100c('0x32'),'ignore':![]}];var _0x1c106e=_(_0x12416e)[_0x100c('0x33')](_0x100c('0x34'))[_0x100c('0x35')](_0x100c('0x36'))['value']();if(_['includes'](_0x1c106e,_0x312b74['role'])){return;}var _0x3c509c=_['find'](_0x12416e,[_0x100c('0x36'),_0x312b74['role']])[_0x100c('0x37')];return db[_0x100c('0x38')][_0x100c('0x2e')]({'where':{'type':_0x3c509c,'resourceId':_0x312b74['id']}})['then'](function(){return _0x165ab3;});})[_0x100c('0x1b')](function(){_0x566922['status'](0xcc)[_0x100c('0x25')]();});}};}function handleEntityNotFound(_0x51ab00,_0xb1f2c7){return function(_0x16c4e9){if(!_0x16c4e9){_0x51ab00[_0x100c('0x24')](0x194);}return _0x16c4e9;};}function handleError(_0x3774c0,_0x479a01){_0x479a01=_0x479a01||0x1f4;return function(_0xf9e64a){logger[_0x100c('0x20')](_0xf9e64a['stack']);if(_0xf9e64a['name']){delete _0xf9e64a[_0x100c('0x37')];}_0x3774c0['status'](_0x479a01)['send'](_0xf9e64a);};}exports['index']=function(_0x4a3f43,_0x26926d){var _0x940457={},_0x2a9a12={},_0x98f649={'count':0x0,'rows':[]};var _0x151ac8=db[_0x100c('0x39')]['rawAttributes'];_0x2a9a12[_0x100c('0x3a')]=_[_0x100c('0x3b')](_[_0x100c('0x3c')](_0x151ac8),['password',_0x100c('0x3d')]);_0x2a9a12['query']=_[_0x100c('0x3c')](_0x4a3f43[_0x100c('0x3e')]);_0x2a9a12[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x2a9a12[_0x100c('0x3a')],_0x2a9a12[_0x100c('0x3e')]);_0x940457['attributes']=_[_0x100c('0x40')](_0x2a9a12[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x4a3f43[_0x100c('0x3e')][_0x100c('0x41')]));_0x940457[_0x100c('0x42')]=_0x940457['attributes'][_0x100c('0x43')]?_0x940457['attributes']:_0x2a9a12['model'];if(!_0x4a3f43[_0x100c('0x3e')]['hasOwnProperty'](_0x100c('0x44'))){_0x940457[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x4a3f43[_0x100c('0x3e')][_0x100c('0x29')]);_0x940457[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x4a3f43[_0x100c('0x3e')][_0x100c('0x28')]);}_0x940457[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x4a3f43[_0x100c('0x3e')][_0x100c('0x46')]);_0x940457[_0x100c('0x47')]=qs[_0x100c('0x3f')](_[_0x100c('0x48')](_0x4a3f43['query'],_0x2a9a12[_0x100c('0x3f')]));if(_0x4a3f43[_0x100c('0x3e')][_0x100c('0x33')]){_0x940457[_0x100c('0x47')]=_[_0x100c('0x49')](_0x940457['where'],{'$or':_[_0x100c('0x35')](_0x151ac8,function(_0x1f8739){if(_0x1f8739['type'][_0x100c('0x4a')]!==_0x100c('0x4b')){return db[_0x100c('0x4c')][_0x100c('0x47')](db['sequelize']['fn'](_0x100c('0x4d'),db['sequelize']['col'](_0x1f8739[_0x100c('0x4e')])),{'$like':db[_0x100c('0x4c')]['fn'](_0x100c('0x4d'),'%'+_0x4a3f43[_0x100c('0x3e')]['filter']+'%')});}})});}_0x940457=_[_0x100c('0x49')]({},_0x940457,_0x4a3f43[_0x100c('0x4f')]);var _0x2874ae={'where':_0x940457[_0x100c('0x47')]};return db['User'][_0x100c('0x27')](_0x2874ae)[_0x100c('0x1b')](function(_0x3c9e88){_0x98f649[_0x100c('0x27')]=_0x3c9e88;if(_0x4a3f43['query']['includeAll']){_0x940457[_0x100c('0x50')]=[{'all':!![]}];}return db[_0x100c('0x39')]['findAll'](_0x940457);})['then'](function(_0x34dc06){_0x98f649['rows']=_0x34dc06;return _0x98f649;})[_0x100c('0x1b')](respondWithFilteredResult(_0x26926d,_0x940457))['catch'](handleError(_0x26926d,null));};exports[_0x100c('0x51')]=function(_0x2c34ea,_0x2f2939){var _0x11817f={'raw':![],'where':{'id':_0x2c34ea['params']['id']}},_0x370d50={};_0x370d50[_0x100c('0x3a')]=_['differenceBy'](_[_0x100c('0x3c')](db[_0x100c('0x39')][_0x100c('0x52')]),[_0x100c('0x53'),_0x100c('0x3d')]);_0x370d50[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x2c34ea['query']);_0x370d50[_0x100c('0x3f')]=_['intersection'](_0x370d50[_0x100c('0x3a')],_0x370d50['query']);_0x11817f[_0x100c('0x42')]=_['intersection'](_0x370d50[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x2c34ea[_0x100c('0x3e')][_0x100c('0x41')]));_0x11817f[_0x100c('0x42')]=_0x11817f[_0x100c('0x42')][_0x100c('0x43')]?_0x11817f[_0x100c('0x42')]:_0x370d50['model'];if(_0x2c34ea[_0x100c('0x3e')][_0x100c('0x54')]){_0x11817f[_0x100c('0x50')]=[{'all':!![]}];}_0x11817f=_['merge']({},_0x11817f,_0x2c34ea[_0x100c('0x4f')]);return db[_0x100c('0x39')][_0x100c('0x55')](_0x11817f)[_0x100c('0x1b')](handleEntityNotFound(_0x2f2939,null))[_0x100c('0x1b')](respondWithResult(_0x2f2939,null))[_0x100c('0x23')](handleError(_0x2f2939,null));};exports[_0x100c('0x56')]=function(_0x5b9dc5,_0x2bc802){return db[_0x100c('0x39')]['bulkCreate'](_0x5b9dc5[_0x100c('0x57')],{'raw':![],'individualHooks':!![]})[_0x100c('0x1b')](respondWithResult(_0x2bc802,0xc9))['catch'](handleError(_0x2bc802,null));};exports[_0x100c('0x2d')]=function(_0x57f8f2,_0x3d450a){if(_0x57f8f2['body']['id']){delete _0x57f8f2[_0x100c('0x57')]['id'];}delete _0x57f8f2[_0x100c('0x57')][_0x100c('0x58')];return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x57f8f2[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x3d450a,null))[_0x100c('0x1b')](saveUpdates(_0x57f8f2[_0x100c('0x57')],null))['then'](respondWithResult(_0x3d450a,null))[_0x100c('0x23')](handleError(_0x3d450a,null));};exports[_0x100c('0x5a')]=function(_0x5a97f7,_0x2819c3){return db[_0x100c('0x39')][_0x100c('0x5a')]()[_0x100c('0x1b')](respondWithResult(_0x2819c3,null))[_0x100c('0x23')](handleError(_0x2819c3,null));};exports[_0x100c('0x5b')]=function(_0x52c226,_0x17edf9,_0x3fd2a6){return db['User']['find']({'where':{'id':_0x52c226[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x17edf9,null))[_0x100c('0x1b')](function(_0x132243){if(_0x132243){return _0x132243[_0x100c('0x5b')](_0x52c226[_0x100c('0x57')][_0x100c('0x5c')],_[_0x100c('0x5d')](_0x52c226[_0x100c('0x57')],[_0x100c('0x5c'),'id'])||{});}})[_0x100c('0x1b')](respondWithResult(_0x17edf9,null))[_0x100c('0x23')](handleError(_0x17edf9,null));};var getLicense=function(_0x147b9e){return new BPromise(function(_0x4abc66,_0x5c00cc){var _0x3d53c7=0x0;_0x147b9e[_0x100c('0x57')][_0x100c('0x58')]===_0x100c('0x30')&&_0x4abc66(_0x100c('0x5e'));return db[_0x100c('0x39')][_0x100c('0x27')]({'where':{'$or':[{'role':_0x147b9e[_0x100c('0x57')][_0x100c('0x58')]===_0x100c('0x32')?_0x100c('0x32'):['admin',_0x100c('0x5f')]}]}})[_0x100c('0x1b')](function(_0xa80240){_0x3d53c7=_0xa80240;return require(_0x100c('0x60'))['getLicense']();})[_0x100c('0x1b')](function(_0x211c03){var _0x599935=_0x147b9e[_0x100c('0x57')][_0x100c('0x58')]===_0x100c('0x32')?'telephones':_0x100c('0x61');if(!_[_0x100c('0x62')](_0x211c03[_0x599935])&&_0x3d53c7>=_0x211c03[_0x599935]){return _0x5c00cc({'message':'License\x20limit\x20reached'});}return _0x4abc66(util[_0x100c('0x63')](_0x100c('0x64'),_0x599935,_0x3d53c7));})[_0x100c('0x23')](function(_0x170919){return _0x5c00cc(_0x170919);});});};exports[_0x100c('0x65')]=function(_0x499df2,_0x3e5b69){return getLicense(_0x499df2)['then'](function(_0xd94509){if(!_0x499df2[_0x100c('0x57')][_0x100c('0x66')]){var _0x5afcef;return db['Setting']['findById'](0x1)[_0x100c('0x1b')](function(_0x544a9e){_0x544a9e[_0x100c('0x67')]=!![];return checkPasswordPattern(_0x544a9e,_0x499df2['body'][_0x100c('0x53')],_0x544a9e[_0x100c('0x67')]);})[_0x100c('0x1b')](function(_0x37a31d){_0x5afcef=_0x37a31d[_0x100c('0x68')];return db['User'][_0x100c('0x69')]('internal');})[_0x100c('0x1b')](function(_0x2f4865){if(_[_0x100c('0x62')](_0x2f4865)){if(_0x5afcef){_0x499df2[_0x100c('0x57')][_0x100c('0x66')]=_0x5afcef;}else{_0x499df2[_0x100c('0x57')]['internal']=0x1;}}else{if(_['isNil'](_0x5afcef)||_0x5afcef==_0x2f4865){_0x499df2[_0x100c('0x57')][_0x100c('0x66')]=_0x2f4865+0x1;}else if(_0x5afcef>_0x2f4865){_0x499df2[_0x100c('0x57')]['internal']=_0x5afcef;}else{return db['sequelize'][_0x100c('0x3e')](_0x100c('0x6a'),{'type':db[_0x100c('0x4c')]['QueryTypes'][_0x100c('0x6b')]})['then'](function(_0x247392){if(_0x247392&&_0x247392[_0x100c('0x43')]){for(var _0x17c436=0x0,_0x2664f2=_0x247392[_0x100c('0x43')];_0x17c436<_0x2664f2&&_[_0x100c('0x62')](_0x499df2[_0x100c('0x57')][_0x100c('0x66')]);_0x17c436++){if(_0x5afcef<=_0x247392[_0x17c436][_0x100c('0x6c')]){_0x499df2[_0x100c('0x57')]['internal']=_0x247392[_0x17c436][_0x100c('0x6c')];}else if(_0x5afcef>_0x247392[_0x17c436][_0x100c('0x6c')]&&_0x5afcef<=_0x247392[_0x17c436]['to']){_0x499df2['body'][_0x100c('0x66')]=_0x5afcef;}}}if(_[_0x100c('0x62')](_0x499df2[_0x100c('0x57')]['internal'])){_0x499df2['body'][_0x100c('0x66')]=_0x2f4865+0x1;}});}}});}})[_0x100c('0x1b')](function(){if(_0x499df2[_0x100c('0x57')][_0x100c('0x6d')]){_0x499df2[_0x100c('0x57')]['mailbox']=_0x499df2['body'][_0x100c('0x66')];_0x499df2[_0x100c('0x57')]['VoiceMail']={'mailbox':_0x499df2[_0x100c('0x57')][_0x100c('0x66')],'password':_0x499df2['body'][_0x100c('0x53')],'fullname':_0x499df2[_0x100c('0x57')]['fullname'],'email':_0x499df2[_0x100c('0x57')][_0x100c('0x6e')]};}if(_0x499df2[_0x100c('0x57')]&&_0x499df2[_0x100c('0x57')][_0x100c('0x58')]===_0x100c('0x30')){_0x499df2[_0x100c('0x57')][_0x100c('0x6f')]=['101','102',_0x100c('0x70'),'110',_0x100c('0x71'),_0x100c('0x72'),_0x100c('0x73'),_0x100c('0x74'),_0x100c('0x75'),_0x100c('0x76'),_0x100c('0x77'),'111'];}return db[_0x100c('0x39')][_0x100c('0x65')](_0x499df2[_0x100c('0x57')],{'include':[{'model':db[_0x100c('0x78')],'as':_0x100c('0x78')}]});})[_0x100c('0x1b')](function(_0x43c1ca){if(_0x499df2['body']['role']===_0x100c('0x5f'))return _0x43c1ca;var _0x4813d7=_0x499df2[_0x100c('0x5f')][_0x100c('0x79')]({'plain':!![]});if(!_0x4813d7)throw new Error(_0x100c('0x7a'));if(_0x4813d7['role']===_0x100c('0x5f')){var _0x180aec=_0x43c1ca[_0x100c('0x79')]({'plain':!![]});var _0x1cc1aa=[{'name':_0x100c('0x2f'),'value':_0x100c('0x30')},{'name':'Telephones','value':_0x100c('0x32')}];var _0x150032=_['find'](_0x1cc1aa,[_0x100c('0x36'),_0x180aec[_0x100c('0x58')]])[_0x100c('0x37')];return db[_0x100c('0x7b')][_0x100c('0x55')]({'where':{'name':_0x150032,'userProfileId':_0x4813d7[_0x100c('0x7c')]},'raw':!![]})[_0x100c('0x1b')](function(_0x52604e){if(_0x52604e&&_0x52604e[_0x100c('0x7d')]===0x0){return db[_0x100c('0x38')]['create']({'name':_0x180aec[_0x100c('0x37')],'resourceId':_0x180aec['id'],'type':_0x52604e[_0x100c('0x37')],'sectionId':_0x52604e['id']},{})[_0x100c('0x1b')](function(){return _0x43c1ca;});}else{return _0x43c1ca;}})[_0x100c('0x23')](function(_0x287856){logger[_0x100c('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x287856);throw _0x287856;});}return _0x43c1ca;})['then'](respondWithResult(_0x3e5b69,0xc9))[_0x100c('0x23')](handleError(_0x3e5b69,null));};exports['changePassword']=function(_0x2da240,_0x511f8e,_0x2890c7){var _0x2e7b10=![];if(_0x2da240[_0x100c('0x57')]['id']){delete _0x2da240['body']['id'];}if(!_['isNil'](_0x2da240[_0x100c('0x57')]['oldPassword'])){if(_0x2da240[_0x100c('0x57')][_0x100c('0x7e')]===_0x2da240[_0x100c('0x57')][_0x100c('0x7f')]){throw new Error(_0x100c('0x80'));}}return db[_0x100c('0x39')]['find']({'where':{'id':_0x2da240[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](function(_0x28531c){if(_0x28531c){if(_0x28531c['id']==_0x2da240['user']['id']){if(!_0x2da240[_0x100c('0x57')][_0x100c('0x7e')]||!_0x2da240[_0x100c('0x57')][_0x100c('0x7f')]){throw new db[(_0x100c('0x81'))]['ValidationError'](_0x100c('0x82'));}if(!_0x28531c['authenticate'](_0x2da240[_0x100c('0x57')][_0x100c('0x7e')])){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))](_0x100c('0x84'));}if(_0x2da240[_0x100c('0x57')][_0x100c('0x7e')]==_0x2da240[_0x100c('0x57')]['newPassword']){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))](_0x100c('0x85'));}return _0x28531c;}else if(_0x2da240[_0x100c('0x5f')]['role']==_0x100c('0x86')){if(!_0x2da240[_0x100c('0x57')][_0x100c('0x7f')]){throw new db['Sequelize'][(_0x100c('0x83'))](_0x100c('0x87'));}return _0x28531c;}else if(_0x2da240[_0x100c('0x5f')]['role']==_0x100c('0x5f')){if(!_0x2da240[_0x100c('0x57')][_0x100c('0x7f')]){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x28531c['role']!=_0x100c('0x30')){throw new db['Sequelize'][(_0x100c('0x83'))]('Unauthorized');}return _0x28531c;}else{throw new db['Sequelize'][(_0x100c('0x83'))](_0x100c('0x88'));}}return null;})[_0x100c('0x1b')](handleEntityNotFound(_0x511f8e,null))['then'](function(_0x466b7a){return db[_0x100c('0x89')][_0x100c('0x8a')]({'attributes':['id',_0x100c('0x67')]})[_0x100c('0x1b')](function(_0x227fb8){_0x2e7b10=_0x227fb8[_0x100c('0x67')];return checkPasswordPattern(_0x466b7a,_0x2da240[_0x100c('0x57')][_0x100c('0x7f')],_0x2e7b10);});})['then'](saveUpdates({'password':_0x2da240[_0x100c('0x57')][_0x100c('0x7f')],'passwordResetAt':_0x2da240[_0x100c('0x5f')]['id']==_0x2da240[_0x100c('0x59')]['id']?moment():null},null))[_0x100c('0x1b')](respondWithResult(_0x511f8e,null))['catch'](handleError(_0x511f8e,null));};exports[_0x100c('0x8b')]=function(_0x1d202d,_0x39415b,_0x28027d){var _0xaae08e=_0x1d202d[_0x100c('0x57')]['channel'];return db[_0x100c('0x39')]['find']({'where':{'id':_0x1d202d[_0x100c('0x59')]['id']},'attributes':['id','name',_0x100c('0x58'),_0x100c('0x8c'),_0x100c('0x8d'),'voicePause',_0x100c('0x8e')]})[_0x100c('0x1b')](handleEntityNotFound(_0x39415b,null))[_0x100c('0x1b')](function(_0x1f8b63){if(_0x1f8b63){if(!utils[_0x100c('0x8f')](_0xaae08e)){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))](_0x100c('0x90'));}return _0x1f8b63['add'+_[_0x100c('0x91')](_0xaae08e['toLowerCase']())+_0x100c('0x92')](_0x1d202d['body']['ids'],{'penalty':_0x1d202d[_0x100c('0x57')][_0x100c('0x93')]||0x0})[_0x100c('0x94')](function(_0x385e56){for(var _0xd51b5=0x0;_0xd51b5<_0x1d202d[_0x100c('0x57')][_0x100c('0x5c')]['length'];_0xd51b5+=0x1){var _0x298c29={'UserId':_0x1d202d['params']['id']};_0x298c29[_[_0x100c('0x91')](_0xaae08e[_0x100c('0x95')]())+_0x100c('0x96')]=_0x1d202d[_0x100c('0x57')][_0x100c('0x5c')][_0xd51b5];socket[_0x100c('0x97')](_0x100c('0x5f')+_[_0x100c('0x91')](_0xaae08e[_0x100c('0x95')]())+_0x100c('0x98'),_0x298c29);}return _0x385e56;})[_0x100c('0x1b')](function(){if(_0xaae08e==='voice'){return db['VoiceQueue'][_0x100c('0x99')]({'where':{'id':_0x1d202d[_0x100c('0x57')][_0x100c('0x5c')]||[]},'raw':!![],'attributes':['id',_0x100c('0x37')]});}})[_0x100c('0x1b')](function(_0x4f6972){var _0x4eefca=_0x1f8b63['get']({'plain':!![]});var _0x1f44ee=[];if(_0xaae08e==='voice'&&_0x4eefca[_0x100c('0x58')]===_0x100c('0x30')&&_0x4eefca[_0x100c('0x8c')]){for(var _0x489649=0x0;_0x489649<_0x4f6972[_0x100c('0x43')];_0x489649+=0x1){_0x1f44ee['push']({'membername':_0x4eefca[_0x100c('0x37')],'UserId':_0x4eefca['id'],'queue_name':_0x4f6972[_0x489649][_0x100c('0x37')],'VoiceQueueId':_0x4f6972[_0x489649]['id'],'interface':_[_0x100c('0x62')](_0x4eefca['interface'])?util[_0x100c('0x63')](_0x100c('0x9a'),_0x4eefca[_0x100c('0x37')]):_0x4eefca[_0x100c('0x8e')],'paused':_0x4eefca[_0x100c('0x9b')]||![],'penalty':_0x1d202d[_0x100c('0x57')][_0x100c('0x93')]||0x0});}return BPromise[_0x100c('0x9c')](_0x1f44ee,function(_0x202ef0){return db[_0x100c('0x9d')]['upsert'](_0x202ef0);});}return _0x1f8b63;});}})[_0x100c('0x1b')](respondWithStatusCode(_0x39415b,null))[_0x100c('0x23')](handleError(_0x39415b,null));};exports[_0x100c('0x9e')]=function(_0x5ce450,_0x2a48f3,_0x179cb1){var _0x31a95d;return db[_0x100c('0x39')]['find']({'where':{'id':_0x5ce450['params']['id']},'attributes':['id','name',_0x100c('0x58')]})[_0x100c('0x1b')](handleEntityNotFound(_0x2a48f3,null))[_0x100c('0x1b')](function(_0x35fd08){if(_0x35fd08){_0x31a95d=_0x35fd08;if(!_0x5ce450[_0x100c('0x3e')][_0x100c('0x9f')]||!utils[_0x100c('0x8f')](_0x5ce450[_0x100c('0x3e')][_0x100c('0x9f')])){throw new db['Sequelize']['ValidationError'](_0x100c('0x90'));}return _0x35fd08[_0x100c('0xa0')+_[_0x100c('0x91')](_0x5ce450['query'][_0x100c('0x9f')][_0x100c('0x95')]())+_0x100c('0x92')](_0x5ce450[_0x100c('0x3e')]['ids']);}})[_0x100c('0x1b')](function(_0x1151fb){for(var _0x4b99d0=0x0;_0x4b99d0<_0x5ce450[_0x100c('0x3e')][_0x100c('0x5c')][_0x100c('0x43')];_0x4b99d0+=0x1){var _0x5774fc={'UserId':_0x5ce450['params']['id']};_0x5774fc[_[_0x100c('0x91')](_0x5ce450['query']['channel'][_0x100c('0x95')]())+_0x100c('0x96')]=_0x5ce450[_0x100c('0x3e')]['ids'][_0x4b99d0];socket[_0x100c('0x97')]('user'+_[_0x100c('0x91')](_0x5ce450[_0x100c('0x3e')][_0x100c('0x9f')]['toLowerCase']())+_0x100c('0xa1'),_0x5774fc);}return _0x1151fb;})[_0x100c('0x1b')](function(){if(_0x5ce450[_0x100c('0x3e')][_0x100c('0x9f')]===_0x100c('0xa2')){return db[_0x100c('0x9d')][_0x100c('0x2e')]({'where':{'UserId':_0x5ce450[_0x100c('0x59')]['id'],'VoiceQueueId':_0x5ce450[_0x100c('0x3e')][_0x100c('0x5c')]},'individualHooks':!![]})[_0x100c('0x1b')](function(){return _0x31a95d;});}return _0x31a95d;})[_0x100c('0x1b')](respondWithStatusCode(_0x2a48f3,null))['catch'](handleError(_0x2a48f3,null));};exports[_0x100c('0xa3')]=function(_0x154ced,_0x3b3659,_0x2694b2){_0x154ced['body']['userpic']=_0x154ced[_0x100c('0xa4')]['filename'];return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x154ced['params']['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x3b3659,null))[_0x100c('0x1b')](saveUpdates(_0x154ced[_0x100c('0x57')],null))[_0x100c('0x1b')](respondWithResult(_0x3b3659,null))[_0x100c('0x23')](handleError(_0x3b3659,null));};exports[_0x100c('0xa5')]=function(_0x4a45de,_0x25d207,_0x28e83d){var _0x3a94e3=path[_0x100c('0xa6')](config[_0x100c('0xa7')],_0x100c('0xa8'));return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x4a45de[_0x100c('0x59')]['id']},'attributes':['id',_0x100c('0xa9')],'raw':!![]})['then'](handleEntityNotFound(_0x25d207,null))[_0x100c('0x1b')](function(_0x32b4bd){if(_0x32b4bd){if(_[_0x100c('0x62')](_0x32b4bd[_0x100c('0xa9')])){return _0x25d207[_0x100c('0xaa')](_0x3a94e3);}else{if(!fs[_0x100c('0xab')](path['join'](config[_0x100c('0xa7')],_0x100c('0xac'),_0x32b4bd['userpic']))){return _0x25d207[_0x100c('0xaa')](_0x3a94e3);}return _0x25d207[_0x100c('0xaa')](path[_0x100c('0xa6')](config[_0x100c('0xa7')],_0x100c('0xac'),_0x32b4bd[_0x100c('0xa9')]));}}})['catch'](handleError(_0x25d207,null));};exports[_0x100c('0xad')]=function(_0x45e799,_0x5c15ab,_0x19b4f5){var _0x1d4dd9={};var _0x31b96f={};var _0x3fd4c3;var _0x12a422;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x45e799['params']['id']}})['then'](handleEntityNotFound(_0x5c15ab,null))['then'](function(_0x2e45e2){if(_0x2e45e2){_0x3fd4c3=_0x2e45e2;_0x31b96f[_0x100c('0x3a')]=_[_0x100c('0x3c')](db[_0x100c('0xae')][_0x100c('0x52')]);_0x31b96f['query']=_[_0x100c('0x3c')](_0x45e799[_0x100c('0x3e')]);_0x31b96f[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x31b96f['model'],_0x31b96f['query']);_0x1d4dd9[_0x100c('0x42')]=_[_0x100c('0x40')](_0x31b96f['model'],qs[_0x100c('0x41')](_0x45e799[_0x100c('0x3e')]['fields']));_0x1d4dd9[_0x100c('0x42')]=_0x1d4dd9[_0x100c('0x42')][_0x100c('0x43')]?_0x1d4dd9[_0x100c('0x42')]:_0x31b96f[_0x100c('0x3a')];_0x1d4dd9[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x45e799[_0x100c('0x3e')][_0x100c('0x46')]);_0x1d4dd9[_0x100c('0x47')]=qs[_0x100c('0x3f')](_['pick'](_0x45e799[_0x100c('0x3e')],_0x31b96f['filters']));if(_0x45e799[_0x100c('0x3e')][_0x100c('0x33')]){_0x1d4dd9[_0x100c('0x47')]=_[_0x100c('0x49')](_0x1d4dd9[_0x100c('0x47')],{'$or':_['map'](_0x1d4dd9[_0x100c('0x42')],function(_0x414839){var _0xdd9b4f={};_0xdd9b4f[_0x414839]={'$like':'%'+_0x45e799[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0xdd9b4f;})});}_0x1d4dd9=_[_0x100c('0x49')]({},_0x1d4dd9,_0x45e799[_0x100c('0x4f')]);return _0x3fd4c3['getContacts'](_0x1d4dd9);}})['then'](function(_0x47eb26){if(_0x47eb26){_0x12a422=_0x47eb26[_0x100c('0x43')];if(_0x45e799['query'][_0x100c('0xaf')]('includeAll')){_0x1d4dd9[_0x100c('0x50')]=[{'model':db[_0x100c('0xb0')],'as':_0x100c('0xb1'),'required':![]},{'model':db['Tag'],'as':_0x100c('0xb2'),'attributes':['id',_0x100c('0x37'),_0x100c('0xb3')],'where':_0x45e799[_0x100c('0x3e')][_0x100c('0xb4')]?{'id':_0x45e799[_0x100c('0x3e')]['tag']}:undefined,'required':_0x45e799[_0x100c('0x3e')][_0x100c('0xb4')]?!![]:![]}];}if(!_0x45e799[_0x100c('0x3e')][_0x100c('0xaf')](_0x100c('0x44'))){_0x1d4dd9[_0x100c('0x29')]=qs['limit'](_0x45e799[_0x100c('0x3e')][_0x100c('0x29')]);_0x1d4dd9[_0x100c('0x28')]=qs['offset'](_0x45e799[_0x100c('0x3e')][_0x100c('0x28')]);}return _0x3fd4c3[_0x100c('0xad')](_0x1d4dd9);}})[_0x100c('0x1b')](function(_0x3c20f4){if(_0x3c20f4){return _0x3c20f4?{'count':_0x12a422,'rows':_0x3c20f4}:null;}})[_0x100c('0x1b')](respondWithResult(_0x5c15ab,null))['catch'](handleError(_0x5c15ab,null));};exports[_0x100c('0xb5')]=function(_0x3554ef,_0xa17a2d,_0x5c3fff){var _0x7e6876;var _0xcd6c19;var _0x1cd544={};var _0x5cb58f;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x3554ef[_0x100c('0x59')]['id']},'attributes':['id',_0x100c('0x37'),_0x100c('0x58')]})[_0x100c('0x1b')](handleEntityNotFound(_0xa17a2d,null))['then'](function(_0x4566f5){if(!utils[_0x100c('0x8f')](_0x3554ef[_0x100c('0x3e')]['channel'])){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))](_0x100c('0x90'));}_0x7e6876=_0x4566f5;var _0x3f04ba={};_0x3f04ba['model']=_[_0x100c('0x3c')](db[_['capitalize'](_0x3554ef[_0x100c('0x3e')]['channel'])+_0x100c('0xb6')]['rawAttributes']);_0x3f04ba[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x3554ef[_0x100c('0x3e')]);_0x3f04ba['filters']=_[_0x100c('0x40')](_0x3f04ba[_0x100c('0x3a')],_0x3f04ba[_0x100c('0x3e')]);_0x1cd544[_0x100c('0x42')]=_['intersection'](_0x3f04ba[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x3554ef[_0x100c('0x3e')][_0x100c('0x41')]));_0x1cd544[_0x100c('0x42')]=_0x1cd544[_0x100c('0x42')][_0x100c('0x43')]?_0x1cd544[_0x100c('0x42')]:_0x3f04ba[_0x100c('0x3a')];_0x1cd544[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x3554ef[_0x100c('0x3e')]['sort']);_0x1cd544[_0x100c('0x47')]=qs[_0x100c('0x3f')](_[_0x100c('0x48')](_0x3554ef[_0x100c('0x3e')],_0x3f04ba['filters']));if(_0x3554ef['query'][_0x100c('0x33')]){_0x1cd544[_0x100c('0x47')]=_[_0x100c('0x49')](_0x1cd544['where'],{'$or':_[_0x100c('0x35')](_0x1cd544[_0x100c('0x42')],function(_0x25c321){var _0x4b1641={};_0x4b1641[_0x25c321]={'$like':'%'+_0x3554ef['query'][_0x100c('0x33')]+'%'};return _0x4b1641;})});}_0x1cd544=_[_0x100c('0x49')]({},_0x1cd544,_0x3554ef[_0x100c('0x4f')]);switch(_0x7e6876[_0x100c('0x58')]){case'admin':return db[_[_0x100c('0x91')](_0x3554ef[_0x100c('0x3e')][_0x100c('0x9f')])+_0x100c('0xb6')]['findAll'](_0x1cd544);case _0x100c('0x5f'):case _0x100c('0x30'):return _0x7e6876['get'+_['capitalize'](_0x3554ef[_0x100c('0x3e')][_0x100c('0x9f')])+'Queues'](_0x1cd544);default:throw new db['Sequelize']['ValidationError'](_0x100c('0xb7'));}})[_0x100c('0x1b')](function(_0xa50626){_0x5cb58f=_0xa50626['length'];if(!_0x3554ef['query']['hasOwnProperty'](_0x100c('0x44'))){_0x1cd544[_0x100c('0x29')]=qs['limit'](_0x3554ef[_0x100c('0x3e')][_0x100c('0x29')]);_0x1cd544[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x3554ef[_0x100c('0x3e')][_0x100c('0x28')]);}switch(_0x7e6876['role']){case _0x100c('0x86'):return db[_[_0x100c('0x91')](_0x3554ef[_0x100c('0x3e')][_0x100c('0x9f')])+_0x100c('0xb6')]['findAll'](_0x1cd544);case'user':case _0x100c('0x30'):return _0x7e6876[_0x100c('0x79')+_[_0x100c('0x91')](_0x3554ef['query'][_0x100c('0x9f')])+'Queues'](_0x1cd544);}})[_0x100c('0x1b')](function(_0x3f0611){return{'count':_0x5cb58f,'rows':_0x3f0611};})[_0x100c('0x1b')](respondWithResult(_0xa17a2d,null))[_0x100c('0x23')](handleError(_0xa17a2d,null));};exports[_0x100c('0xb8')]=function(_0x1bc5b4,_0xcf06cd,_0x49d9fd){var _0x738d7f={};var _0x5d93d8={};var _0x57a8bf;var _0x48060c;return db['User'][_0x100c('0x8a')]({'where':{'id':_0x1bc5b4['params']['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0xcf06cd,null))[_0x100c('0x1b')](function(_0x58877a){if(_0x58877a){_0x57a8bf=_0x58877a;_0x5d93d8[_0x100c('0x3a')]=_['keys'](db[_0x100c('0x9d')]['rawAttributes']);_0x5d93d8[_0x100c('0x3e')]=_['keys'](_0x1bc5b4[_0x100c('0x3e')]);_0x5d93d8[_0x100c('0x3f')]=_['intersection'](_0x5d93d8[_0x100c('0x3a')],_0x5d93d8['query']);_0x738d7f[_0x100c('0x42')]=_[_0x100c('0x40')](_0x5d93d8[_0x100c('0x3a')],qs['fields'](_0x1bc5b4[_0x100c('0x3e')][_0x100c('0x41')]));_0x738d7f[_0x100c('0x42')]=_0x738d7f['attributes'][_0x100c('0x43')]?_0x738d7f[_0x100c('0x42')]:_0x5d93d8[_0x100c('0x3a')];_0x738d7f[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x1bc5b4[_0x100c('0x3e')]['sort']);_0x738d7f['where']=qs['filters'](_[_0x100c('0x48')](_0x1bc5b4[_0x100c('0x3e')],_0x5d93d8['filters']));if(_0x1bc5b4[_0x100c('0x3e')]['filter']){_0x738d7f[_0x100c('0x47')]=_[_0x100c('0x49')](_0x738d7f[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x738d7f[_0x100c('0x42')],function(_0x1ec969){var _0x1c2117={};_0x1c2117[_0x1ec969]={'$like':'%'+_0x1bc5b4['query'][_0x100c('0x33')]+'%'};return _0x1c2117;})});}_0x738d7f=_['merge']({},_0x738d7f,_0x1bc5b4[_0x100c('0x4f')]);return _0x57a8bf[_0x100c('0xb8')](_0x738d7f);}})[_0x100c('0x1b')](function(_0x200901){if(_0x200901){_0x48060c=_0x200901[_0x100c('0x43')];if(!_0x1bc5b4[_0x100c('0x3e')]['hasOwnProperty'](_0x100c('0x44'))){_0x738d7f[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x1bc5b4[_0x100c('0x3e')]['limit']);_0x738d7f[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x1bc5b4[_0x100c('0x3e')][_0x100c('0x28')]);}return _0x57a8bf[_0x100c('0xb8')](_0x738d7f);}})[_0x100c('0x1b')](function(_0x487350){if(_0x487350){return _0x487350?{'count':_0x48060c,'rows':_0x487350}:null;}})[_0x100c('0x1b')](respondWithResult(_0xcf06cd,null))['catch'](handleError(_0xcf06cd,null));};exports[_0x100c('0xb9')]=function(_0x430bce,_0x3d6a92,_0x243531){var _0x40f9cb={};var _0x58c190={};var _0x101c34;var _0xe46bd;return db[_0x100c('0x39')]['findOne']({'where':{'id':_0x430bce[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x3d6a92,null))[_0x100c('0x1b')](function(_0x31c77c){if(_0x31c77c){_0x101c34=_0x31c77c;_0x58c190[_0x100c('0x3a')]=_['keys'](db['ChatGroup'][_0x100c('0x52')]);_0x58c190[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x430bce['query']);_0x58c190[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x58c190[_0x100c('0x3a')],_0x58c190['query']);_0x40f9cb['attributes']=_[_0x100c('0x40')](_0x58c190[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x430bce[_0x100c('0x3e')][_0x100c('0x41')]));_0x40f9cb[_0x100c('0x42')]=_0x40f9cb[_0x100c('0x42')][_0x100c('0x43')]?_0x40f9cb[_0x100c('0x42')]:_0x58c190[_0x100c('0x3a')];_0x40f9cb['order']=qs[_0x100c('0x46')](_0x430bce[_0x100c('0x3e')][_0x100c('0x46')]);_0x40f9cb[_0x100c('0x47')]=qs['filters'](_[_0x100c('0x48')](_0x430bce['query'],_0x58c190[_0x100c('0x3f')]));if(_0x430bce[_0x100c('0x3e')][_0x100c('0x33')]){_0x40f9cb[_0x100c('0x47')]=_[_0x100c('0x49')](_0x40f9cb[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x40f9cb[_0x100c('0x42')],function(_0x399497){var _0x50f40a={};_0x50f40a[_0x399497]={'$like':'%'+_0x430bce[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x50f40a;})});}_0x40f9cb=_[_0x100c('0x49')]({},_0x40f9cb,_0x430bce[_0x100c('0x4f')]);return _0x101c34[_0x100c('0xb9')](_0x40f9cb);}})['then'](function(_0x50ed02){if(_0x50ed02){_0xe46bd=_0x50ed02['length'];if(!_0x430bce[_0x100c('0x3e')][_0x100c('0xaf')]('nolimit')){_0x40f9cb[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x430bce[_0x100c('0x3e')][_0x100c('0x29')]);_0x40f9cb['offset']=qs[_0x100c('0x28')](_0x430bce[_0x100c('0x3e')]['offset']);}return _0x101c34[_0x100c('0xb9')](_0x40f9cb);}})[_0x100c('0x1b')](function(_0x2c47aa){if(_0x2c47aa){return _0x2c47aa?{'count':_0xe46bd,'rows':_0x2c47aa}:null;}})[_0x100c('0x1b')](respondWithResult(_0x3d6a92,null))[_0x100c('0x23')](handleError(_0x3d6a92,null));};exports[_0x100c('0xba')]=function(_0x2e65c7,_0x48ba06,_0x5d0a5d){var _0xe2b6f5={'raw':!![],'where':{}};var _0x18b4c8={};var _0x2a9d05={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x2e65c7['params']['id']}})['then'](handleEntityNotFound(_0x48ba06,null))['then'](function(_0x204ae8){if(_0x204ae8){_0x18b4c8[_0x100c('0x3a')]=_['keys'](db['VoiceRecording'][_0x100c('0x52')]);_0x18b4c8[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x2e65c7['query']);_0x18b4c8['filters']=_['intersection'](_0x18b4c8[_0x100c('0x3a')],_0x18b4c8[_0x100c('0x3e')]);_0xe2b6f5[_0x100c('0x42')]=_[_0x100c('0x40')](_0x18b4c8[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x2e65c7[_0x100c('0x3e')][_0x100c('0x41')]));_0xe2b6f5['attributes']=_0xe2b6f5[_0x100c('0x42')][_0x100c('0x43')]?_0xe2b6f5[_0x100c('0x42')]:_0x18b4c8[_0x100c('0x3a')];if(!_0x2e65c7[_0x100c('0x3e')]['hasOwnProperty'](_0x100c('0x44'))){_0xe2b6f5['limit']=qs[_0x100c('0x29')](_0x2e65c7[_0x100c('0x3e')][_0x100c('0x29')]);_0xe2b6f5[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x2e65c7[_0x100c('0x3e')]['offset']);}_0xe2b6f5[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x2e65c7[_0x100c('0x3e')][_0x100c('0x46')]);_0xe2b6f5['where']=qs[_0x100c('0x3f')](_[_0x100c('0x48')](_0x2e65c7[_0x100c('0x3e')],_0x18b4c8[_0x100c('0x3f')]));_0xe2b6f5[_0x100c('0x47')][_0x100c('0xbb')]=_0x204ae8['id'];if(_0x2e65c7[_0x100c('0x3e')]['filter']){_0xe2b6f5[_0x100c('0x47')]=_[_0x100c('0x49')](_0xe2b6f5[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0xe2b6f5['attributes'],function(_0xc42f41){var _0x344c01={};_0x344c01[_0xc42f41]={'$like':'%'+_0x2e65c7[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x344c01;})});}_0xe2b6f5=_[_0x100c('0x49')]({},_0xe2b6f5,_0x2e65c7[_0x100c('0x4f')]);return db['VoiceRecording'][_0x100c('0x27')]({'where':_0xe2b6f5[_0x100c('0x47')]})['then'](function(_0x434a3a){_0x2a9d05[_0x100c('0x27')]=_0x434a3a;if(_0x2e65c7[_0x100c('0x3e')][_0x100c('0x54')]){_0xe2b6f5['include']=[{'all':!![]}];}return db[_0x100c('0xbc')]['findAll'](_0xe2b6f5);})[_0x100c('0x1b')](function(_0x24540a){_0x2a9d05[_0x100c('0xbd')]=_0x24540a;return _0x2a9d05;});}})[_0x100c('0x1b')](respondWithFilteredResult(_0x48ba06,_0xe2b6f5))[_0x100c('0x23')](handleError(_0x48ba06,null));};exports[_0x100c('0xbe')]=function(_0x2709db,_0x1a97d1,_0x425e1a){var _0x984d69={'raw':!![],'where':{}};var _0x4fb1ba={};var _0x2a5f51={'count':0x0,'rows':[]};return db[_0x100c('0x39')]['findOne']({'where':{'id':_0x2709db[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x1a97d1,null))[_0x100c('0x1b')](function(_0x228d15){if(_0x228d15){_0x4fb1ba[_0x100c('0x3a')]=_[_0x100c('0x3c')](db[_0x100c('0xbf')][_0x100c('0x52')]);_0x4fb1ba[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x2709db[_0x100c('0x3e')]);_0x4fb1ba[_0x100c('0x3f')]=_['intersection'](_0x4fb1ba['model'],_0x4fb1ba[_0x100c('0x3e')]);_0x984d69[_0x100c('0x42')]=_['intersection'](_0x4fb1ba[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x2709db[_0x100c('0x3e')][_0x100c('0x41')]));_0x984d69[_0x100c('0x42')]=_0x984d69['attributes']['length']?_0x984d69[_0x100c('0x42')]:_0x4fb1ba[_0x100c('0x3a')];if(!_0x2709db[_0x100c('0x3e')][_0x100c('0xaf')]('nolimit')){_0x984d69[_0x100c('0x29')]=qs['limit'](_0x2709db[_0x100c('0x3e')]['limit']);_0x984d69[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x2709db[_0x100c('0x3e')][_0x100c('0x28')]);}_0x984d69[_0x100c('0x45')]=qs['sort'](_0x2709db[_0x100c('0x3e')][_0x100c('0x46')]);_0x984d69[_0x100c('0x47')]=qs['filters'](_[_0x100c('0x48')](_0x2709db[_0x100c('0x3e')],_0x4fb1ba[_0x100c('0x3f')]));_0x984d69[_0x100c('0x47')]['UserId']=_0x228d15['id'];if(_0x2709db['query'][_0x100c('0x33')]){_0x984d69['where']=_[_0x100c('0x49')](_0x984d69[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x984d69[_0x100c('0x42')],function(_0x4a9bcf){var _0x5c0c14={};_0x5c0c14[_0x4a9bcf]={'$like':'%'+_0x2709db[_0x100c('0x3e')]['filter']+'%'};return _0x5c0c14;})});}_0x984d69=_[_0x100c('0x49')]({},_0x984d69,_0x2709db['options']);return db['ScreenRecording'][_0x100c('0x27')]({'where':_0x984d69[_0x100c('0x47')]})[_0x100c('0x1b')](function(_0x113573){_0x2a5f51[_0x100c('0x27')]=_0x113573;if(_0x2709db[_0x100c('0x3e')][_0x100c('0x54')]){_0x984d69[_0x100c('0x50')]=[{'all':!![]}];}return db[_0x100c('0xbf')]['findAll'](_0x984d69);})[_0x100c('0x1b')](function(_0x28d480){_0x2a5f51['rows']=_0x28d480;return _0x2a5f51;});}})[_0x100c('0x1b')](respondWithFilteredResult(_0x1a97d1,_0x984d69))[_0x100c('0x23')](handleError(_0x1a97d1,null));};exports[_0x100c('0xc0')]=function(_0x2eb5ef,_0x9c047e,_0x4ef262){var _0x5610dc={};var _0x1cb7b8={};var _0x2c0e8c;var _0x956766;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x2eb5ef[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x9c047e,null))[_0x100c('0x1b')](function(_0x4dc84a){if(_0x4dc84a){_0x2c0e8c=_0x4dc84a;_0x1cb7b8[_0x100c('0x3a')]=_['keys'](db[_0x100c('0xc1')]['rawAttributes']);_0x1cb7b8['query']=_['keys'](_0x2eb5ef[_0x100c('0x3e')]);_0x1cb7b8[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x1cb7b8[_0x100c('0x3a')],_0x1cb7b8[_0x100c('0x3e')]);_0x5610dc[_0x100c('0x42')]=_[_0x100c('0x40')](_0x1cb7b8[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x2eb5ef[_0x100c('0x3e')]['fields']));_0x5610dc[_0x100c('0x42')]=_0x5610dc[_0x100c('0x42')]['length']?_0x5610dc[_0x100c('0x42')]:_0x1cb7b8[_0x100c('0x3a')];_0x5610dc[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x2eb5ef['query'][_0x100c('0x46')]);_0x5610dc[_0x100c('0x47')]=qs['filters'](_[_0x100c('0x48')](_0x2eb5ef[_0x100c('0x3e')],_0x1cb7b8[_0x100c('0x3f')]));if(_0x2eb5ef[_0x100c('0x3e')][_0x100c('0x33')]){_0x5610dc[_0x100c('0x47')]=_[_0x100c('0x49')](_0x5610dc[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x5610dc['attributes'],function(_0x28a3d0){var _0x21570f={};_0x21570f[_0x28a3d0]={'$like':'%'+_0x2eb5ef[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x21570f;})});}_0x5610dc=_['merge']({},_0x5610dc,_0x2eb5ef[_0x100c('0x4f')]);return _0x2c0e8c[_0x100c('0xc0')](_0x5610dc);}})[_0x100c('0x1b')](function(_0x47c032){if(_0x47c032){_0x956766=_0x47c032[_0x100c('0x43')];if(!_0x2eb5ef[_0x100c('0x3e')][_0x100c('0xaf')](_0x100c('0x44'))){_0x5610dc['limit']=qs['limit'](_0x2eb5ef[_0x100c('0x3e')][_0x100c('0x29')]);_0x5610dc['offset']=qs[_0x100c('0x28')](_0x2eb5ef['query']['offset']);}return _0x2c0e8c[_0x100c('0xc0')](_0x5610dc);}})[_0x100c('0x1b')](function(_0x2b3d96){if(_0x2b3d96){return _0x2b3d96?{'count':_0x956766,'rows':_0x2b3d96}:null;}})['then'](respondWithResult(_0x9c047e,null))['catch'](handleError(_0x9c047e,null));};exports[_0x100c('0xc2')]=function(_0x546652,_0x288e38,_0x347d79){var _0x4ccf1e={};var _0xd34c28={};var _0x43a047;var _0x2c7c49;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x546652[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x288e38,null))[_0x100c('0x1b')](function(_0x3d8474){if(_0x3d8474){_0x43a047=_0x3d8474;_0xd34c28[_0x100c('0x3a')]=_[_0x100c('0x3c')](db[_0x100c('0xc3')][_0x100c('0x52')]);_0xd34c28[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x546652[_0x100c('0x3e')]);_0xd34c28[_0x100c('0x3f')]=_[_0x100c('0x40')](_0xd34c28[_0x100c('0x3a')],_0xd34c28[_0x100c('0x3e')]);_0x4ccf1e[_0x100c('0x42')]=_['intersection'](_0xd34c28[_0x100c('0x3a')],qs['fields'](_0x546652[_0x100c('0x3e')][_0x100c('0x41')]));_0x4ccf1e[_0x100c('0x42')]=_0x4ccf1e['attributes'][_0x100c('0x43')]?_0x4ccf1e[_0x100c('0x42')]:_0xd34c28[_0x100c('0x3a')];_0x4ccf1e['order']=qs['sort'](_0x546652['query']['sort']);_0x4ccf1e[_0x100c('0x47')]=qs[_0x100c('0x3f')](_['pick'](_0x546652[_0x100c('0x3e')],_0xd34c28['filters']));if(_0x546652[_0x100c('0x3e')][_0x100c('0x33')]){_0x4ccf1e[_0x100c('0x47')]=_[_0x100c('0x49')](_0x4ccf1e[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x4ccf1e['attributes'],function(_0x572e6a){var _0x1a9f0b={};_0x1a9f0b[_0x572e6a]={'$like':'%'+_0x546652[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x1a9f0b;})});}_0x4ccf1e=_[_0x100c('0x49')]({},_0x4ccf1e,_0x546652[_0x100c('0x4f')]);return _0x43a047[_0x100c('0xc2')](_0x4ccf1e);}})['then'](function(_0x3f9ed1){if(_0x3f9ed1){_0x2c7c49=_0x3f9ed1['length'];if(!_0x546652[_0x100c('0x3e')][_0x100c('0xaf')](_0x100c('0x44'))){_0x4ccf1e['limit']=qs[_0x100c('0x29')](_0x546652[_0x100c('0x3e')]['limit']);_0x4ccf1e[_0x100c('0x28')]=qs['offset'](_0x546652[_0x100c('0x3e')]['offset']);}return _0x43a047['getOpenchannelInteractions'](_0x4ccf1e);}})[_0x100c('0x1b')](function(_0x1b52c4){if(_0x1b52c4){return _0x1b52c4?{'count':_0x2c7c49,'rows':_0x1b52c4}:null;}})[_0x100c('0x1b')](respondWithResult(_0x288e38,null))['catch'](handleError(_0x288e38,null));};exports['getMailInteractions']=function(_0x2b49ad,_0x4f0a49,_0x2579c9){var _0xdac980={'raw':!![],'where':{}};var _0x5a0dd5={};var _0x1ac4f9={'count':0x0,'rows':[]};return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x2b49ad[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x4f0a49,null))[_0x100c('0x1b')](function(_0x31e881){if(_0x31e881){_0x5a0dd5[_0x100c('0x3a')]=_[_0x100c('0x3c')](db['MailInteraction'][_0x100c('0x52')]);_0x5a0dd5[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x2b49ad[_0x100c('0x3e')]);_0x5a0dd5[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x5a0dd5[_0x100c('0x3a')],_0x5a0dd5[_0x100c('0x3e')]);_0xdac980['attributes']=_[_0x100c('0x40')](_0x5a0dd5['model'],qs[_0x100c('0x41')](_0x2b49ad[_0x100c('0x3e')][_0x100c('0x41')]));_0xdac980[_0x100c('0x42')]=_0xdac980['attributes']['length']?_0xdac980['attributes']:_0x5a0dd5[_0x100c('0x3a')];if(!_0x2b49ad[_0x100c('0x3e')][_0x100c('0xaf')](_0x100c('0x44'))){_0xdac980[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x2b49ad[_0x100c('0x3e')][_0x100c('0x29')]);_0xdac980[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x2b49ad[_0x100c('0x3e')][_0x100c('0x28')]);}_0xdac980[_0x100c('0x45')]=qs['sort'](_0x2b49ad['query']['sort']);_0xdac980[_0x100c('0x47')]=qs['filters'](_['pick'](_0x2b49ad[_0x100c('0x3e')],_0x5a0dd5[_0x100c('0x3f')]));_0xdac980[_0x100c('0x47')][_0x100c('0xbb')]=_0x31e881['id'];if(_0x2b49ad[_0x100c('0x3e')][_0x100c('0x33')]){_0xdac980[_0x100c('0x47')]=_[_0x100c('0x49')](_0xdac980[_0x100c('0x47')],{'$or':_['map'](_0xdac980[_0x100c('0x42')],function(_0x1cfacf){var _0x703e78={};_0x703e78[_0x1cfacf]={'$like':'%'+_0x2b49ad['query'][_0x100c('0x33')]+'%'};return _0x703e78;})});}_0xdac980=_[_0x100c('0x49')]({},_0xdac980,_0x2b49ad[_0x100c('0x4f')]);return db['MailInteraction'][_0x100c('0x27')]({'where':_0xdac980[_0x100c('0x47')]})[_0x100c('0x1b')](function(_0x22f720){_0x1ac4f9[_0x100c('0x27')]=_0x22f720;if(_0x2b49ad[_0x100c('0x3e')][_0x100c('0x54')]){_0xdac980[_0x100c('0x50')]=[{'all':!![]}];}return db[_0x100c('0xc4')]['findAll'](_0xdac980);})[_0x100c('0x1b')](function(_0x4890b6){_0x1ac4f9[_0x100c('0xbd')]=_0x4890b6;return _0x1ac4f9;});}})[_0x100c('0x1b')](respondWithFilteredResult(_0x4f0a49,_0xdac980))['catch'](handleError(_0x4f0a49,null));};exports['getSmsInteractions']=function(_0x45d5ae,_0x13d2c1,_0x536924){var _0x34c4a3={};var _0x3b7f6d={};var _0x510b99;var _0x2097ab;return db[_0x100c('0x39')]['findOne']({'where':{'id':_0x45d5ae[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x13d2c1,null))[_0x100c('0x1b')](function(_0x4c5aa1){if(_0x4c5aa1){_0x510b99=_0x4c5aa1;_0x3b7f6d[_0x100c('0x3a')]=_[_0x100c('0x3c')](db[_0x100c('0xc5')][_0x100c('0x52')]);_0x3b7f6d['query']=_[_0x100c('0x3c')](_0x45d5ae[_0x100c('0x3e')]);_0x3b7f6d[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x3b7f6d[_0x100c('0x3a')],_0x3b7f6d[_0x100c('0x3e')]);_0x34c4a3[_0x100c('0x42')]=_[_0x100c('0x40')](_0x3b7f6d[_0x100c('0x3a')],qs['fields'](_0x45d5ae[_0x100c('0x3e')][_0x100c('0x41')]));_0x34c4a3[_0x100c('0x42')]=_0x34c4a3[_0x100c('0x42')][_0x100c('0x43')]?_0x34c4a3[_0x100c('0x42')]:_0x3b7f6d[_0x100c('0x3a')];_0x34c4a3['order']=qs['sort'](_0x45d5ae[_0x100c('0x3e')][_0x100c('0x46')]);_0x34c4a3[_0x100c('0x47')]=qs['filters'](_['pick'](_0x45d5ae[_0x100c('0x3e')],_0x3b7f6d['filters']));if(_0x45d5ae['query'][_0x100c('0x33')]){_0x34c4a3[_0x100c('0x47')]=_[_0x100c('0x49')](_0x34c4a3[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x34c4a3[_0x100c('0x42')],function(_0x618a33){var _0x38be43={};_0x38be43[_0x618a33]={'$like':'%'+_0x45d5ae[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x38be43;})});}_0x34c4a3=_[_0x100c('0x49')]({},_0x34c4a3,_0x45d5ae[_0x100c('0x4f')]);return _0x510b99[_0x100c('0xc6')](_0x34c4a3);}})[_0x100c('0x1b')](function(_0x4eb616){if(_0x4eb616){_0x2097ab=_0x4eb616['length'];if(!_0x45d5ae[_0x100c('0x3e')][_0x100c('0xaf')](_0x100c('0x44'))){_0x34c4a3['limit']=qs[_0x100c('0x29')](_0x45d5ae[_0x100c('0x3e')]['limit']);_0x34c4a3[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x45d5ae[_0x100c('0x3e')]['offset']);}return _0x510b99[_0x100c('0xc6')](_0x34c4a3);}})[_0x100c('0x1b')](function(_0x359044){if(_0x359044){return _0x359044?{'count':_0x2097ab,'rows':_0x359044}:null;}})[_0x100c('0x1b')](respondWithResult(_0x13d2c1,null))['catch'](handleError(_0x13d2c1,null));};exports[_0x100c('0xc7')]=function(_0x582c9f,_0x1fd7c0,_0xa84cb7){var _0xb9bf60={};var _0x41d105={};var _0x497d86;var _0x4734ce;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x582c9f[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x1fd7c0,null))[_0x100c('0x1b')](function(_0x18f3d0){if(_0x18f3d0){_0x497d86=_0x18f3d0;_0x41d105[_0x100c('0x3a')]=_[_0x100c('0x3c')](db[_0x100c('0xc8')][_0x100c('0x52')]);_0x41d105[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x582c9f['query']);_0x41d105['filters']=_[_0x100c('0x40')](_0x41d105[_0x100c('0x3a')],_0x41d105[_0x100c('0x3e')]);_0xb9bf60['attributes']=_[_0x100c('0x40')](_0x41d105[_0x100c('0x3a')],qs['fields'](_0x582c9f[_0x100c('0x3e')][_0x100c('0x41')]));_0xb9bf60[_0x100c('0x42')]=_0xb9bf60[_0x100c('0x42')]['length']?_0xb9bf60[_0x100c('0x42')]:_0x41d105['model'];_0xb9bf60[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x582c9f[_0x100c('0x3e')]['sort']);_0xb9bf60['where']=qs[_0x100c('0x3f')](_[_0x100c('0x48')](_0x582c9f[_0x100c('0x3e')],_0x41d105[_0x100c('0x3f')]));if(_0x582c9f[_0x100c('0x3e')][_0x100c('0x33')]){_0xb9bf60[_0x100c('0x47')]=_['merge'](_0xb9bf60['where'],{'$or':_[_0x100c('0x35')](_0xb9bf60[_0x100c('0x42')],function(_0x1a4f73){var _0x3104b5={};_0x3104b5[_0x1a4f73]={'$like':'%'+_0x582c9f['query'][_0x100c('0x33')]+'%'};return _0x3104b5;})});}_0xb9bf60=_[_0x100c('0x49')]({},_0xb9bf60,_0x582c9f[_0x100c('0x4f')]);return _0x497d86['getFaxInteractions'](_0xb9bf60);}})[_0x100c('0x1b')](function(_0x16ad71){if(_0x16ad71){_0x4734ce=_0x16ad71[_0x100c('0x43')];if(!_0x582c9f[_0x100c('0x3e')]['hasOwnProperty'](_0x100c('0x44'))){_0xb9bf60[_0x100c('0x29')]=qs['limit'](_0x582c9f[_0x100c('0x3e')][_0x100c('0x29')]);_0xb9bf60[_0x100c('0x28')]=qs['offset'](_0x582c9f['query']['offset']);}return _0x497d86['getFaxInteractions'](_0xb9bf60);}})[_0x100c('0x1b')](function(_0x436ca0){if(_0x436ca0){return _0x436ca0?{'count':_0x4734ce,'rows':_0x436ca0}:null;}})[_0x100c('0x1b')](respondWithResult(_0x1fd7c0,null))[_0x100c('0x23')](handleError(_0x1fd7c0,null));};exports[_0x100c('0xc9')]=function(_0x213aaa,_0x277329,_0x54f23c){var _0x4c4e2b;var _0x3e8291;var _0x12b169;var _0x170478=!_[_0x100c('0x62')](_0x213aaa['params']['id'])?_0x213aaa[_0x100c('0x59')]['id']:!_[_0x100c('0x62')](_0x213aaa[_0x100c('0x5f')]['id'])?_0x213aaa[_0x100c('0x5f')]['id']:null;return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x170478,'role':_0x100c('0x30')},'attributes':['id',_0x100c('0x37'),_0x100c('0xca'),_0x100c('0xcb'),_0x100c('0x58'),_0x100c('0x66'),_0x100c('0x8d')]})['then'](handleEntityNotFound(_0x277329,null))['then'](function(_0x5d4dda){if(_0x5d4dda){_0x4c4e2b=_0x5d4dda;if(_0x213aaa[_0x100c('0x57')][_0x100c('0x8e')]){_0x12b169=util[_0x100c('0x63')]('LOCAL/%s@from-sip/n',_0x4c4e2b[_0x213aaa[_0x100c('0x57')]['interface']]);}else if(_0x213aaa['body'][_0x100c('0xcc')]){_0x12b169=util[_0x100c('0x63')]('SIP/%s',_0x213aaa[_0x100c('0x57')][_0x100c('0xcc')]);}else{_0x12b169=util[_0x100c('0x63')](_0x100c('0x9a'),_0x4c4e2b['name']);}socket['to'](util[_0x100c('0x63')](_0x100c('0xcd'),_0x4c4e2b[_0x100c('0x37')]))['emit'](_0x100c('0xce'),{'ip':_0x213aaa[_0x100c('0xcf')][_0x100c('0xd0')]||_0x213aaa[_0x100c('0xd1')][_0x100c('0xd2')]||_0x213aaa[_0x100c('0xd3')][_0x100c('0xd2')]||_0x213aaa[_0x100c('0xd1')][_0x100c('0xd3')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4c4e2b[_0x100c('0x37')]},'individualHooks':!![]});}})[_0x100c('0x1b')](function(_0x15725d){if(_0x4c4e2b){return _0x4c4e2b['getVoiceQueues']({'raw':!![]});}})[_0x100c('0x1b')](function(_0x35018f){var _0x508d9b=[];if(_0x35018f){_0x3e8291=_0x35018f;if(_0x3e8291[_0x100c('0x43')]){for(var _0x168cbe=0x0;_0x168cbe<_0x3e8291[_0x100c('0x43')];_0x168cbe++){_0x508d9b[_0x100c('0xd4')]({'membername':_0x4c4e2b['name'],'UserId':_0x4c4e2b['id'],'queue_name':_0x3e8291[_0x168cbe][_0x100c('0x37')],'VoiceQueueId':_0x3e8291[_0x168cbe]['id'],'interface':_0x12b169,'paused':_0x4c4e2b[_0x100c('0x8d')]||![],'penalty':_0x3e8291[_0x168cbe][_0x100c('0xd5')]||0x0});}return BPromise[_0x100c('0x9c')](_0x508d9b,function(_0x294596){return db[_0x100c('0x9d')][_0x100c('0xd6')](_0x294596);});}}})[_0x100c('0x1b')](function(){return db[_0x100c('0xd7')][_0x100c('0x99')]({'where':{'membername':_0x4c4e2b['name'],'exitAt':null}});})['then'](function(_0x556f6e){var _0x5898d4=[];_0x556f6e[_0x100c('0xd8')](function(_0x511687){_0x5898d4[_0x100c('0xd4')](_0x511687['update']({'exitAt':moment()[_0x100c('0x63')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x100c('0xd9')](_0x5898d4);})[_0x100c('0x1b')](function(){var _0x51aa6e=[];var _0x1f66e5=[];var _0xbe5792=utils[_0x100c('0xda')]();var _0x1b1bf6={'membername':_0x4c4e2b[_0x100c('0x37')],'interface':_0x12b169,'enterAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'role':_0x4c4e2b[_0x100c('0x58')],'internal':_0x4c4e2b[_0x100c('0x66')]};_0xbe5792[_0x100c('0xd8')](function(_0x3644d1){_0x51aa6e[_0x100c('0xd4')](_[_0x100c('0x49')]({'channel':_0x3644d1,'type':'LOGIN','data1':_0x213aaa[_0x100c('0x57')][_0x100c('0xdc')],'data2':_0x12b169},_0x1b1bf6));if(_0x4c4e2b[_0x100c('0x8d')]){_0x1f66e5[_0x100c('0xd4')](_['merge']({'channel':_0x3644d1,'type':'PAUSE','data1':_0x100c('0xdd')},_0x1b1bf6));}});return db[_0x100c('0xd7')]['bulkCreate'](_0x51aa6e[_0x100c('0xde')](_0x1f66e5),{'individualHooks':!![]});})[_0x100c('0x1b')](function(){return _0x4c4e2b[_0x100c('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'voicePause':_0x4c4e2b['loginInPause']||![],'mailPause':_0x4c4e2b[_0x100c('0x8d')]||![],'chatPause':_0x4c4e2b[_0x100c('0x8d')]||![],'faxPause':_0x4c4e2b[_0x100c('0x8d')]||![],'smsPause':_0x4c4e2b[_0x100c('0x8d')]||![],'openchannelPause':_0x4c4e2b['loginInPause']||![],'pauseType':_0x4c4e2b[_0x100c('0x8d')]?_0x100c('0xdd'):null,'interface':_0x12b169,'lastPauseAt':moment()['format'](_0x100c('0xdb'))});})['then'](function(_0x424601){if(_0x213aaa[_0x100c('0xdf')]){return _0x54f23c();}else{return BPromise[_0x100c('0xe0')](_0x424601)[_0x100c('0x1b')](respondWithResult(_0x277329,null));}})[_0x100c('0x23')](handleError(_0x277329,null));};exports[_0x100c('0xe1')]=function(_0x1878ed,_0x4f55b,_0x2d4831){var _0x3c1bbb;return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x1878ed[_0x100c('0x59')]['id'],'role':'agent'},'attributes':['id',_0x100c('0x37'),_0x100c('0x58')]})[_0x100c('0x1b')](handleEntityNotFound(_0x4f55b,null))[_0x100c('0x1b')](function(_0x48a507){if(_0x48a507){_0x3c1bbb=_0x48a507;return db[_0x100c('0x9d')]['destroy']({'where':{'membername':_0x3c1bbb[_0x100c('0x37')]},'individualHooks':!![]});}})[_0x100c('0x1b')](function(){return db['MemberReport'][_0x100c('0x99')]({'where':{'membername':_0x3c1bbb[_0x100c('0x37')],'exitAt':null}});})[_0x100c('0x1b')](function(_0x266e30){var _0x1fb99b=[];_0x266e30['forEach'](function(_0x5a2190){_0x1fb99b[_0x100c('0xd4')](_0x5a2190[_0x100c('0x2d')]({'exitAt':moment()[_0x100c('0x63')](_0x100c('0xdb'))}));});return BPromise[_0x100c('0xd9')](_0x1fb99b);})[_0x100c('0x1b')](function(){return _0x3c1bbb[_0x100c('0x2d')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x100c('0x1b')](respondWithResult(_0x4f55b,null))['catch'](handleError(_0x4f55b,null));};exports[_0x100c('0xe2')]=function(_0x2fd44f,_0x1480ba,_0x27220c){var _0x425499;return db[_0x100c('0x9d')][_0x100c('0x2d')]({'paused':0x1},{'where':{'UserId':_0x2fd44f[_0x100c('0x59')]['id']},'individualHooks':!![]})[_0x100c('0x1b')](function(){return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x2fd44f[_0x100c('0x59')]['id'],'role':'agent'},'attributes':['id','name',_0x100c('0x58'),'internal',_0x100c('0x8e')]});})['then'](handleEntityNotFound(_0x1480ba,null))[_0x100c('0x1b')](function(_0x46bd11){if(_0x46bd11){_0x425499=_0x46bd11;return respondWithRpcPromise(_0x100c('0xe3'),_0x100c('0xe2'),{'id':_0x425499['id'],'name':_0x425499['name'],'pause':!![]});}})[_0x100c('0x1b')](function(){if(_0x425499){return db['MemberReport'][_0x100c('0x99')]({'where':{'membername':_0x425499['name'],'type':_0x100c('0xe4'),'exitAt':null}});}})[_0x100c('0x1b')](function(_0x158ff1){if(_0x158ff1[_0x100c('0x43')]){var _0x160559=moment()[_0x100c('0x63')](_0x100c('0xdb'));for(var _0x5c4335=0x0,_0x441b04=_0x158ff1['length'];_0x5c4335<_0x441b04;_0x5c4335++){_0x158ff1[_0x5c4335][_0x100c('0xe5')]({'exitAt':_0x160559});}}})[_0x100c('0x1b')](function(){var _0x4658dd=[];var _0x354e3e=utils['getChannels']();_0x354e3e[_0x100c('0xd8')](function(_0x3b5625){_0x4658dd[_0x100c('0xd4')]({'channel':_0x3b5625,'membername':_0x425499[_0x100c('0x37')],'interface':_[_0x100c('0x62')](_0x425499[_0x100c('0x8e')])?util[_0x100c('0x63')](_0x100c('0x9a'),_0x425499[_0x100c('0x37')]):_0x425499[_0x100c('0x8e')],'type':_0x100c('0xe4'),'enterAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'data1':_0x2fd44f[_0x100c('0x57')][_0x100c('0xe6')]||'DEFAULT\x20PAUSE','role':_0x425499[_0x100c('0x58')],'internal':_0x425499[_0x100c('0x66')]});});return db['MemberReport'][_0x100c('0x56')](_0x4658dd,{'individualHooks':!![]});})[_0x100c('0x1b')](function(){return _0x425499['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2fd44f[_0x100c('0x57')][_0x100c('0xe6')]||_0x100c('0xe7'),'lastPauseAt':moment()[_0x100c('0x63')](_0x100c('0xdb'))});})[_0x100c('0x1b')](respondWithResult(_0x1480ba,null))['catch'](handleError(_0x1480ba,null));};exports[_0x100c('0xe8')]=function(_0x255e96,_0x10b59d,_0x3600f8){var _0x2bc554;return db['User'][_0x100c('0x55')]({'where':{'id':_0x255e96['params']['id']},'attributes':['id','name',_0x100c('0x58'),_0x100c('0x9b'),_0x100c('0xe9'),_0x100c('0xea'),'faxPause',_0x100c('0xeb'),'smsPause','pauseType',_0x100c('0xec')]})['then'](handleEntityNotFound(_0x10b59d,null))[_0x100c('0x1b')](function(_0x1653d8){if(_0x1653d8){_0x2bc554=_0x1653d8;if(_0x255e96[_0x100c('0x57')]['channel']&&!utils[_0x100c('0x8f')](_0x255e96[_0x100c('0x57')][_0x100c('0x9f')])){throw new db[(_0x100c('0x81'))][(_0x100c('0x83'))](_0x100c('0x90'));}switch(_0x255e96['body'][_0x100c('0x9f')]){case _0x100c('0xa2'):return respondWithRpcPromise(_0x100c('0xe3'),_0x100c('0xe8'),{'id':_0x2bc554['id'],'name':_0x2bc554['name'],'pause':![]})[_0x100c('0x1b')](function(){return db['UserVoiceQueueRt'][_0x100c('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2bc554['id']},'individualHooks':!![]});})[_0x100c('0x1b')](function(){return db[_0x100c('0xd7')][_0x100c('0x55')]({'where':{'channel':_0x255e96[_0x100c('0x57')][_0x100c('0x9f')],'membername':_0x2bc554[_0x100c('0x37')],'type':_0x100c('0xe4'),'exitAt':null}});})[_0x100c('0x1b')](function(_0xc989a9){if(_0xc989a9){return _0xc989a9[_0x100c('0x2d')]({'exitAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x100c('0x1b')](function(){return _0x2bc554[_0x100c('0x2d')]({'voicePause':![]});});case _0x100c('0xed'):case _0x100c('0xee'):case'fax':case _0x100c('0xef'):case'openchannel':return db[_0x100c('0xd7')]['find']({'where':{'channel':_0x255e96['body'][_0x100c('0x9f')],'membername':_0x2bc554[_0x100c('0x37')],'type':_0x100c('0xe4'),'exitAt':null}})[_0x100c('0x1b')](function(_0x47f617){if(_0x47f617){return _0x47f617['update']({'exitAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'data2':_0x100c('0xf0')},{'individualHooks':!![]});}return null;})[_0x100c('0x1b')](function(){var _0x18beb0={};_[_0x100c('0xf1')](_0x18beb0,util[_0x100c('0x63')](_0x100c('0xf2'),_0x255e96['body']['channel'],_0x100c('0xf3')),![]);return _0x2bc554['update'](_0x18beb0);});default:return respondWithRpcPromise(_0x100c('0xe3'),_0x100c('0xe8'),{'id':_0x2bc554['id'],'name':_0x2bc554[_0x100c('0x37')],'pause':![]})[_0x100c('0x1b')](function(){return db[_0x100c('0x9d')]['update']({'paused':0x0},{'where':{'UserId':_0x2bc554['id']}});})[_0x100c('0x1b')](function(){return db[_0x100c('0xd7')]['findAll']({'where':{'membername':_0x2bc554[_0x100c('0x37')],'type':_0x100c('0xe4'),'exitAt':null}});})[_0x100c('0x1b')](function(_0x1bb9e2){var _0x26eac1=[];_0x1bb9e2[_0x100c('0xd8')](function(_0x117d03){_0x26eac1[_0x100c('0xd4')](_0x117d03[_0x100c('0x2d')]({'exitAt':moment()[_0x100c('0x63')](_0x100c('0xdb')),'data2':_0x100c('0xf0')}));});return BPromise[_0x100c('0xd9')](_0x26eac1);})['then'](function(){return _0x2bc554[_0x100c('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x100c('0x1b')](respondWithResult(_0x10b59d,null))[_0x100c('0x23')](handleError(_0x10b59d,null));};exports[_0x100c('0xf4')]=function(_0x36381d,_0xa1f756,_0x137901){var _0x366da8={};var _0x17a8ae={};var _0x3e651c;var _0x456385;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x36381d[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0xa1f756,null))['then'](function(_0x5a6d5c){if(_0x5a6d5c){_0x3e651c=_0x5a6d5c;_0x17a8ae[_0x100c('0x3a')]=_[_0x100c('0x3c')](db['Team'][_0x100c('0x52')]);_0x17a8ae[_0x100c('0x3e')]=_['keys'](_0x36381d[_0x100c('0x3e')]);_0x17a8ae[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x17a8ae[_0x100c('0x3a')],_0x17a8ae[_0x100c('0x3e')]);_0x366da8['attributes']=_[_0x100c('0x40')](_0x17a8ae[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x36381d[_0x100c('0x3e')][_0x100c('0x41')]));_0x366da8[_0x100c('0x42')]=_0x366da8[_0x100c('0x42')][_0x100c('0x43')]?_0x366da8[_0x100c('0x42')]:_0x17a8ae[_0x100c('0x3a')];_0x366da8['order']=qs[_0x100c('0x46')](_0x36381d[_0x100c('0x3e')][_0x100c('0x46')]);_0x366da8[_0x100c('0x47')]=qs['filters'](_[_0x100c('0x48')](_0x36381d[_0x100c('0x3e')],_0x17a8ae[_0x100c('0x3f')]));if(_0x36381d[_0x100c('0x3e')][_0x100c('0x33')]){_0x366da8[_0x100c('0x47')]=_[_0x100c('0x49')](_0x366da8['where'],{'$or':_[_0x100c('0x35')](_0x366da8[_0x100c('0x42')],function(_0x2800db){var _0x586493={};_0x586493[_0x2800db]={'$like':'%'+_0x36381d[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x586493;})});}_0x366da8=_[_0x100c('0x49')]({},_0x366da8,_0x36381d[_0x100c('0x4f')]);return _0x3e651c[_0x100c('0xf4')](_0x366da8);}})[_0x100c('0x1b')](function(_0x5d16d2){if(_0x5d16d2){_0x456385=_0x5d16d2[_0x100c('0x43')];if(!_0x36381d['query'][_0x100c('0xaf')]('nolimit')){_0x366da8[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x36381d[_0x100c('0x3e')][_0x100c('0x29')]);_0x366da8[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x36381d[_0x100c('0x3e')][_0x100c('0x28')]);}return _0x3e651c['getTeams'](_0x366da8);}})[_0x100c('0x1b')](function(_0x39edf3){if(_0x39edf3){return _0x39edf3?{'count':_0x456385,'rows':_0x39edf3}:null;}})['then'](respondWithResult(_0xa1f756,null))[_0x100c('0x23')](handleError(_0xa1f756,null));};exports[_0x100c('0xf5')]=function(_0x30e3bf,_0x551bc0,_0x41f830){return db[_0x100c('0x39')]['find']({'where':{'id':_0x30e3bf['params']['id']}})['then'](handleEntityNotFound(_0x551bc0,null))['then'](function(_0x430918){if(_0x430918){return _0x430918[_0x100c('0xf5')](_0x30e3bf[_0x100c('0x57')][_0x100c('0x5c')],_[_0x100c('0x5d')](_0x30e3bf[_0x100c('0x57')],[_0x100c('0x5c'),'id'])||{});}})[_0x100c('0x1b')](respondWithResult(_0x551bc0,null))['catch'](handleError(_0x551bc0,null));};exports['removeTeams']=function(_0x3b937f,_0x30918b,_0x285f17){return db[_0x100c('0x39')][_0x100c('0x55')]({'where':{'id':_0x3b937f[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x30918b,null))[_0x100c('0x1b')](function(_0x25caae){if(_0x25caae){return _0x25caae[_0x100c('0xf6')](_0x3b937f['query'][_0x100c('0x5c')]);}})['then'](respondWithStatusCode(_0x30918b,null))[_0x100c('0x23')](handleError(_0x30918b,null));};exports[_0x100c('0xf7')]=function(_0x1da0e0,_0x30a232,_0x5c0291){var _0x2368ff={};var _0x359e4e={};var _0x31c2ef;var _0x198c47;return db[_0x100c('0x39')][_0x100c('0x8a')]({'where':{'id':_0x1da0e0[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x30a232,null))[_0x100c('0x1b')](function(_0x30bde7){if(_0x30bde7){_0x31c2ef=_0x30bde7;_0x359e4e[_0x100c('0x3a')]=_[_0x100c('0x3c')](db['CmList'][_0x100c('0x52')]);_0x359e4e[_0x100c('0x3e')]=_[_0x100c('0x3c')](_0x1da0e0[_0x100c('0x3e')]);_0x359e4e[_0x100c('0x3f')]=_[_0x100c('0x40')](_0x359e4e[_0x100c('0x3a')],_0x359e4e['query']);_0x2368ff[_0x100c('0x42')]=_[_0x100c('0x40')](_0x359e4e[_0x100c('0x3a')],qs[_0x100c('0x41')](_0x1da0e0[_0x100c('0x3e')][_0x100c('0x41')]));_0x2368ff['attributes']=_0x2368ff[_0x100c('0x42')][_0x100c('0x43')]?_0x2368ff[_0x100c('0x42')]:_0x359e4e['model'];_0x2368ff[_0x100c('0x45')]=qs[_0x100c('0x46')](_0x1da0e0[_0x100c('0x3e')]['sort']);_0x2368ff['where']=qs['filters'](_[_0x100c('0x48')](_0x1da0e0[_0x100c('0x3e')],_0x359e4e['filters']));if(_0x1da0e0[_0x100c('0x3e')][_0x100c('0x33')]){_0x2368ff[_0x100c('0x47')]=_[_0x100c('0x49')](_0x2368ff[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x2368ff[_0x100c('0x42')],function(_0x1550a0){var _0x38fd7a={};_0x38fd7a[_0x1550a0]={'$like':'%'+_0x1da0e0[_0x100c('0x3e')][_0x100c('0x33')]+'%'};return _0x38fd7a;})});}_0x2368ff=_[_0x100c('0x49')]({},_0x2368ff,_0x1da0e0[_0x100c('0x4f')]);return _0x31c2ef[_0x100c('0xf7')](_0x2368ff);}})[_0x100c('0x1b')](function(_0x32fe53){if(_0x32fe53){_0x198c47=_0x32fe53[_0x100c('0x43')];if(!_0x1da0e0['query'][_0x100c('0xaf')](_0x100c('0x44'))){_0x2368ff[_0x100c('0x29')]=qs[_0x100c('0x29')](_0x1da0e0[_0x100c('0x3e')][_0x100c('0x29')]);_0x2368ff[_0x100c('0x28')]=qs[_0x100c('0x28')](_0x1da0e0[_0x100c('0x3e')][_0x100c('0x28')]);}return _0x31c2ef['getLists'](_0x2368ff);}})[_0x100c('0x1b')](function(_0x5ce87b){if(_0x5ce87b){return _0x5ce87b?{'count':_0x198c47,'rows':_0x5ce87b}:null;}})['then'](respondWithResult(_0x30a232,null))[_0x100c('0x23')](handleError(_0x30a232,null));};exports['getAgents']=function(_0x588aee,_0x1254f4,_0x588120){var _0x475f14={};var _0x2c71ce={};var _0xe9cfaa;var _0xd9bf8e;return db['User'][_0x100c('0x8a')]({'where':{'id':_0x588aee[_0x100c('0x59')]['id']}})[_0x100c('0x1b')](handleEntityNotFound(_0x1254f4,null))[_0x100c('0x1b')](function(_0x2e2ad6){if(_0x2e2ad6){_0xe9cfaa=_0x2e2ad6;_0x2c71ce[_0x100c('0x3a')]=_['keys'](db[_0x100c('0x39')][_0x100c('0x52')]);_0x2c71ce['query']=_['keys'](_0x588aee['query']);_0x2c71ce[_0x100c('0x3f')]=_['intersection'](_0x2c71ce['model'],_0x2c71ce[_0x100c('0x3e')]);_0x475f14[_0x100c('0x42')]=_['intersection'](_0x2c71ce['model'],qs[_0x100c('0x41')](_0x588aee[_0x100c('0x3e')]['fields']));_0x475f14[_0x100c('0x42')]=_0x475f14[_0x100c('0x42')][_0x100c('0x43')]?_0x475f14[_0x100c('0x42')]:_0x2c71ce[_0x100c('0x3a')];_0x475f14[_0x100c('0x45')]=qs['sort'](_0x588aee[_0x100c('0x3e')][_0x100c('0x46')]);_0x475f14[_0x100c('0x47')]=qs[_0x100c('0x3f')](_['pick'](_0x588aee[_0x100c('0x3e')],_0x2c71ce['filters']));if(_0x588aee['query'][_0x100c('0x33')]){_0x475f14[_0x100c('0x47')]=_[_0x100c('0x49')](_0x475f14[_0x100c('0x47')],{'$or':_[_0x100c('0x35')](_0x475f14['attributes'],function(_0xb50213){var _0x487c96={};_0x487c96[_0xb50213]={'$like':'%'+_0x588aee['query']['filter']+'%'};return _0x487c96;})});}_0x475f14[_0x100c('0x3a')]=db[_0x100c('0x39')];_0x475f14['as']=_0x100c('0x2f');_0x475f14=_['merge']({},_0x475f14,_0x588aee[_0x100c('0x4f')]);return _0xe9cfaa[_0x100c('0xf8')]({'include':[_0x475f14]});}})['then'](function(_0x5a844b){if(_0x5a844b){var _0x58a9a1={},_0x45e706=[],_0x24214f=0x0;for(var _0x476b06=0x0;_0x476b06<_0x5a844b[_0x100c('0x43')];_0x476b06+=0x1){for(var _0x6e268d=0x0,_0x45bfa2;_0x6e268d<_0x5a844b[_0x476b06]['Agents'][_0x100c('0x43')];_0x6e268d+=0x1){_0x45bfa2=_0x5a844b[_0x476b06][_0x100c('0x2f')][_0x6e268d]['get']({'plain':!![]});_0x58a9a1[_0x45bfa2['id']]=_0x45bfa2;}}_0x58a9a1=_['values'](_0x58a9a1);for(var _0x2d3821=qs[_0x100c('0x28')](_0x588aee['query'][_0x100c('0x28')]);_0x2d3821<_0x58a9a1[_0x100c('0x43')]&&_0x45e706['length']=_0x1ea3a8){_0x1f8f4b=_0x1ea3a8;_0x44daee=0xc8;}else{_0x44daee=0xce;}_0x16418e[_0xec48('0x2c')](_0x44daee);return _0x16418e[_0xec48('0x31')](_0xec48('0x32'),_0x2ac69a+'-'+_0x1f8f4b+'/'+_0x1ea3a8)[_0xec48('0x2e')](_0x1b19ba);}return null;};}function patchUpdates(_0x457fbf){return function(_0x4c3dd2){try{jsonpatch['apply'](_0x4c3dd2,_0x457fbf,!![]);}catch(_0x43b7da){return BPromise['reject'](_0x43b7da);}return _0x4c3dd2[_0xec48('0x33')]();};}function saveUpdates(_0x2c0cf9,_0x1f6763){return function(_0x55d9c2){if(_0x55d9c2){return _0x55d9c2[_0xec48('0x34')](_0x2c0cf9)[_0xec48('0x35')](function(_0x3d05be){return _0x3d05be;});}return null;};}function removeEntity(_0x44c5af,_0x4fdda5){return function(_0x5cda79){if(_0x5cda79){return _0x5cda79[_0xec48('0x36')]()[_0xec48('0x35')](function(){var _0x31f9c3=_0x5cda79[_0xec48('0x37')]({'plain':!![]});var _0x482ee8=[{'name':_0xec48('0x38'),'value':'user','ignore':!![]},{'name':_0xec48('0x39'),'value':_0xec48('0x3a'),'ignore':![]},{'name':_0xec48('0x3b'),'value':_0xec48('0x3c'),'ignore':![]}];var _0x52ef71=_(_0x482ee8)['filter']('ignore')['map'](_0xec48('0x3d'))[_0xec48('0x3d')]();if(_[_0xec48('0x3e')](_0x52ef71,_0x31f9c3['role'])){return;}var _0x4cf77b=_['find'](_0x482ee8,[_0xec48('0x3d'),_0x31f9c3[_0xec48('0x3f')]])[_0xec48('0x40')];return db[_0xec48('0x41')][_0xec48('0x36')]({'where':{'type':_0x4cf77b,'resourceId':_0x31f9c3['id']}})['then'](function(){return _0x5cda79;});})['then'](function(){_0x44c5af[_0xec48('0x2c')](0xcc)[_0xec48('0x2d')]();});}};}function handleEntityNotFound(_0x497fa1,_0x3d147d){return function(_0x5a815e){if(!_0x5a815e){_0x497fa1[_0xec48('0x2b')](0x194);}return _0x5a815e;};}function handleError(_0x531138,_0x20a071){_0x20a071=_0x20a071||0x1f4;return function(_0x235d39){logger[_0xec48('0x28')](_0x235d39[_0xec48('0x42')]);if(_0x235d39[_0xec48('0x40')]){delete _0x235d39[_0xec48('0x40')];}_0x531138[_0xec48('0x2c')](_0x20a071)[_0xec48('0x43')](_0x235d39);};}exports[_0xec48('0x44')]=function(_0x48aae0,_0x361e0b){var _0x5a47cd={},_0x532b0c={},_0x176c6={'count':0x0,'rows':[]};var _0x39a425=db[_0xec48('0x45')][_0xec48('0x46')];_0x532b0c[_0xec48('0x47')]=_['differenceBy'](_[_0xec48('0x48')](_0x39a425),['password',_0xec48('0x49')]);_0x532b0c[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x48aae0['query']);_0x532b0c[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x532b0c[_0xec48('0x47')],_0x532b0c[_0xec48('0x4a')]);_0x5a47cd[_0xec48('0x4d')]=_['intersection'](_0x532b0c[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x48aae0['query']['fields']));_0x5a47cd[_0xec48('0x4d')]=_0x5a47cd[_0xec48('0x4d')][_0xec48('0x4f')]?_0x5a47cd[_0xec48('0x4d')]:_0x532b0c[_0xec48('0x47')];if(!_0x48aae0[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x5a47cd[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x48aae0[_0xec48('0x4a')]['limit']);_0x5a47cd[_0xec48('0x30')]=qs[_0xec48('0x30')](_0x48aae0[_0xec48('0x4a')][_0xec48('0x30')]);}_0x5a47cd[_0xec48('0x53')]=qs['sort'](_0x48aae0['query'][_0xec48('0x54')]);_0x5a47cd[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x48aae0['query'],_0x532b0c[_0xec48('0x4b')]));if(_0x48aae0['query'][_0xec48('0x57')]){_0x5a47cd[_0xec48('0x55')]=_[_0xec48('0x58')](_0x5a47cd[_0xec48('0x55')],{'$or':_['map'](_0x39a425,function(_0x53c109){if(_0x53c109[_0xec48('0x59')][_0xec48('0x5a')]!==_0xec48('0x5b')){return db[_0xec48('0x5c')][_0xec48('0x55')](db[_0xec48('0x5c')]['fn'](_0xec48('0x5d'),db[_0xec48('0x5c')][_0xec48('0x5e')](_0x53c109[_0xec48('0x5f')])),{'$like':db[_0xec48('0x5c')]['fn'](_0xec48('0x5d'),'%'+_0x48aae0[_0xec48('0x4a')][_0xec48('0x57')]+'%')});}})});}_0x5a47cd=_[_0xec48('0x58')]({},_0x5a47cd,_0x48aae0[_0xec48('0x60')]);var _0x5d1193={'where':_0x5a47cd[_0xec48('0x55')]};return db[_0xec48('0x45')][_0xec48('0x2f')](_0x5d1193)[_0xec48('0x35')](function(_0x5c13ed){_0x176c6[_0xec48('0x2f')]=_0x5c13ed;if(_0x48aae0['query'][_0xec48('0x61')]){_0x5a47cd[_0xec48('0x62')]=[{'all':!![]}];}return db[_0xec48('0x45')]['findAll'](_0x5a47cd);})[_0xec48('0x35')](function(_0x65a0c1){_0x176c6['rows']=_0x65a0c1;return _0x176c6;})['then'](respondWithFilteredResult(_0x361e0b,_0x5a47cd))[_0xec48('0x63')](handleError(_0x361e0b,null));};exports[_0xec48('0x64')]=function(_0x421816,_0x26efd0){var _0x1d3f50={'raw':![],'where':{'id':_0x421816[_0xec48('0x65')]['id']}},_0x5aa4ec={};_0x5aa4ec['model']=_['differenceBy'](_[_0xec48('0x48')](db[_0xec48('0x45')][_0xec48('0x46')]),['password','salt']);_0x5aa4ec[_0xec48('0x4a')]=_['keys'](_0x421816[_0xec48('0x4a')]);_0x5aa4ec[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x5aa4ec['model'],_0x5aa4ec[_0xec48('0x4a')]);_0x1d3f50['attributes']=_[_0xec48('0x4c')](_0x5aa4ec[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x421816['query'][_0xec48('0x4e')]));_0x1d3f50[_0xec48('0x4d')]=_0x1d3f50[_0xec48('0x4d')][_0xec48('0x4f')]?_0x1d3f50['attributes']:_0x5aa4ec[_0xec48('0x47')];if(_0x421816[_0xec48('0x4a')][_0xec48('0x61')]){_0x1d3f50[_0xec48('0x62')]=[{'all':!![]}];}_0x1d3f50=_['merge']({},_0x1d3f50,_0x421816[_0xec48('0x60')]);return db['User'][_0xec48('0x66')](_0x1d3f50)['then'](handleEntityNotFound(_0x26efd0,null))[_0xec48('0x35')](respondWithResult(_0x26efd0,null))[_0xec48('0x63')](handleError(_0x26efd0,null));};exports[_0xec48('0x67')]=function(_0x5955ca,_0x591131){return db['User'][_0xec48('0x67')](_0x5955ca[_0xec48('0x68')],{'raw':![],'individualHooks':!![]})[_0xec48('0x35')](respondWithResult(_0x591131,0xc9))['catch'](handleError(_0x591131,null));};exports[_0xec48('0x34')]=function(_0xe31ddc,_0x13f0d7){if(_0xe31ddc[_0xec48('0x68')]['id']){delete _0xe31ddc[_0xec48('0x68')]['id'];}delete _0xe31ddc[_0xec48('0x68')][_0xec48('0x3f')];return db['User'][_0xec48('0x66')]({'where':{'id':_0xe31ddc['params']['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x13f0d7,null))[_0xec48('0x35')](saveUpdates(_0xe31ddc[_0xec48('0x68')],null))[_0xec48('0x35')](respondWithResult(_0x13f0d7,null))['catch'](handleError(_0x13f0d7,null));};exports[_0xec48('0x69')]=function(_0x249bad,_0x21ac6a){return db['User'][_0xec48('0x69')]()[_0xec48('0x35')](respondWithResult(_0x21ac6a,null))['catch'](handleError(_0x21ac6a,null));};exports[_0xec48('0x6a')]=function(_0x4f4b17,_0x5888ca,_0x5246ac){return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x4f4b17['params']['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x5888ca,null))['then'](function(_0x277e82){if(_0x277e82){return _0x277e82[_0xec48('0x6a')](_0x4f4b17[_0xec48('0x68')]['ids'],_['omit'](_0x4f4b17[_0xec48('0x68')],[_0xec48('0x6b'),'id'])||{});}})[_0xec48('0x35')](respondWithResult(_0x5888ca,null))[_0xec48('0x63')](handleError(_0x5888ca,null));};var getLicense=function(_0x2349dc){return new BPromise(function(_0xd3e607,_0x22c143){var _0x1bf904=0x0;_0x2349dc[_0xec48('0x68')][_0xec48('0x3f')]===_0xec48('0x3a')&&_0xd3e607(_0xec48('0x6c'));return db[_0xec48('0x45')][_0xec48('0x2f')]({'where':{'$or':[{'role':_0x2349dc[_0xec48('0x68')][_0xec48('0x3f')]===_0xec48('0x3c')?_0xec48('0x3c'):[_0xec48('0x6d'),_0xec48('0x6e')]}]}})[_0xec48('0x35')](function(_0x4ed66a){_0x1bf904=_0x4ed66a;return require(_0xec48('0x6f'))['getLicense']();})['then'](function(_0x62e1e9){var _0x5f54f5=_0x2349dc[_0xec48('0x68')][_0xec48('0x3f')]===_0xec48('0x3c')?'telephones':'users';if(!_[_0xec48('0x70')](_0x62e1e9[_0x5f54f5])&&_0x1bf904>=_0x62e1e9[_0x5f54f5]){return _0x22c143({'message':'License\x20limit\x20reached'});}return _0xd3e607(util[_0xec48('0x71')]('count\x20%s:\x20%s',_0x5f54f5,_0x1bf904));})[_0xec48('0x63')](function(_0x3baedb){return _0x22c143(_0x3baedb);});});};exports[_0xec48('0x72')]=function(_0x4abeea,_0xb0e6db){return getLicense(_0x4abeea)['then'](function(_0x5c8fbf){if(!_0x4abeea[_0xec48('0x68')][_0xec48('0x73')]){var _0x67f1b7;return db[_0xec48('0x74')]['findById'](0x1)[_0xec48('0x35')](function(_0x543836){_0x543836[_0xec48('0x75')]=!![];return checkPasswordPattern(_0x543836,_0x4abeea[_0xec48('0x68')][_0xec48('0x76')],_0x543836[_0xec48('0x75')]);})[_0xec48('0x35')](function(_0x17d27d){_0x67f1b7=_0x17d27d[_0xec48('0x77')];return db[_0xec48('0x45')][_0xec48('0x78')](_0xec48('0x73'));})[_0xec48('0x35')](function(_0x4fc20a){if(_[_0xec48('0x70')](_0x4fc20a)){if(_0x67f1b7){_0x4abeea[_0xec48('0x68')]['internal']=_0x67f1b7;}else{_0x4abeea[_0xec48('0x68')][_0xec48('0x73')]=0x1;}}else{if(_[_0xec48('0x70')](_0x67f1b7)||_0x67f1b7==_0x4fc20a){_0x4abeea['body'][_0xec48('0x73')]=_0x4fc20a+0x1;}else if(_0x67f1b7>_0x4fc20a){_0x4abeea[_0xec48('0x68')]['internal']=_0x67f1b7;}else{return db[_0xec48('0x5c')][_0xec48('0x4a')](_0xec48('0x79'),{'type':db[_0xec48('0x5c')][_0xec48('0x7a')][_0xec48('0x7b')]})['then'](function(_0x4081af){if(_0x4081af&&_0x4081af[_0xec48('0x4f')]){for(var _0x4f3868=0x0,_0x4cf71c=_0x4081af['length'];_0x4f3868<_0x4cf71c&&_['isNil'](_0x4abeea['body']['internal']);_0x4f3868++){if(_0x67f1b7<=_0x4081af[_0x4f3868]['from']){_0x4abeea[_0xec48('0x68')][_0xec48('0x73')]=_0x4081af[_0x4f3868][_0xec48('0x7c')];}else if(_0x67f1b7>_0x4081af[_0x4f3868][_0xec48('0x7c')]&&_0x67f1b7<=_0x4081af[_0x4f3868]['to']){_0x4abeea['body'][_0xec48('0x73')]=_0x67f1b7;}}}if(_['isNil'](_0x4abeea['body'][_0xec48('0x73')])){_0x4abeea['body'][_0xec48('0x73')]=_0x4fc20a+0x1;}});}}});}})[_0xec48('0x35')](function(){if(_0x4abeea[_0xec48('0x68')]['voicemail']){_0x4abeea[_0xec48('0x68')][_0xec48('0x7d')]=_0x4abeea[_0xec48('0x68')][_0xec48('0x73')];_0x4abeea[_0xec48('0x68')][_0xec48('0x7e')]={'mailbox':_0x4abeea[_0xec48('0x68')]['internal'],'password':_0x4abeea[_0xec48('0x68')][_0xec48('0x76')],'fullname':_0x4abeea[_0xec48('0x68')]['fullname'],'email':_0x4abeea[_0xec48('0x68')][_0xec48('0x7f')]};}if(_0x4abeea[_0xec48('0x68')]&&_0x4abeea[_0xec48('0x68')][_0xec48('0x3f')]==='agent'){_0x4abeea[_0xec48('0x68')]['permissions']=[_0xec48('0x80'),_0xec48('0x81'),_0xec48('0x82'),_0xec48('0x83'),_0xec48('0x84'),_0xec48('0x85'),'106',_0xec48('0x86'),_0xec48('0x87'),_0xec48('0x88'),_0xec48('0x89'),_0xec48('0x8a')];}return db[_0xec48('0x45')][_0xec48('0x72')](_0x4abeea[_0xec48('0x68')],{'include':[{'model':db[_0xec48('0x7e')],'as':'VoiceMail'}]});})[_0xec48('0x35')](function(_0x41dc51){if(_0x4abeea[_0xec48('0x68')][_0xec48('0x3f')]===_0xec48('0x6e'))return _0x41dc51;var _0xd9c708=_0x4abeea[_0xec48('0x6e')]['get']({'plain':!![]});if(!_0xd9c708)throw new Error(_0xec48('0x8b'));if(_0xd9c708['role']===_0xec48('0x6e')){var _0xcf368d=_0x41dc51[_0xec48('0x37')]({'plain':!![]});var _0x29ec82=[{'name':_0xec48('0x39'),'value':'agent'},{'name':_0xec48('0x3b'),'value':'telephone'}];var _0x111881=_[_0xec48('0x66')](_0x29ec82,[_0xec48('0x3d'),_0xcf368d[_0xec48('0x3f')]])[_0xec48('0x40')];return db[_0xec48('0x8c')][_0xec48('0x66')]({'where':{'name':_0x111881,'userProfileId':_0xd9c708[_0xec48('0x8d')]},'raw':!![]})['then'](function(_0x427fb9){if(_0x427fb9&&_0x427fb9['autoAssociation']===0x0){return db[_0xec48('0x41')][_0xec48('0x72')]({'name':_0xcf368d[_0xec48('0x40')],'resourceId':_0xcf368d['id'],'type':_0x427fb9['name'],'sectionId':_0x427fb9['id']},{})[_0xec48('0x35')](function(){return _0x41dc51;});}else{return _0x41dc51;}})[_0xec48('0x63')](function(_0x52c02c){logger[_0xec48('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52c02c);throw _0x52c02c;});}return _0x41dc51;})[_0xec48('0x35')](respondWithResult(_0xb0e6db,0xc9))[_0xec48('0x63')](handleError(_0xb0e6db,null));};exports[_0xec48('0x8e')]=function(_0x3624e4,_0x488d05,_0x1bd985){var _0x4764f9=![];if(_0x3624e4[_0xec48('0x68')]['id']){delete _0x3624e4[_0xec48('0x68')]['id'];}if(!_[_0xec48('0x70')](_0x3624e4[_0xec48('0x68')][_0xec48('0x8f')])){if(_0x3624e4[_0xec48('0x68')][_0xec48('0x8f')]===_0x3624e4[_0xec48('0x68')][_0xec48('0x90')]){throw new Error(_0xec48('0x91'));}}return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x3624e4[_0xec48('0x65')]['id']}})[_0xec48('0x35')](function(_0x2b5c3d){if(_0x2b5c3d){if(_0x2b5c3d['id']==_0x3624e4[_0xec48('0x6e')]['id']){if(!_0x3624e4[_0xec48('0x68')][_0xec48('0x8f')]||!_0x3624e4['body']['newPassword']){throw new db[(_0xec48('0x92'))][(_0xec48('0x93'))](_0xec48('0x94'));}if(!_0x2b5c3d[_0xec48('0x95')](_0x3624e4[_0xec48('0x68')]['oldPassword'])){throw new db[(_0xec48('0x92'))]['ValidationError']('Wrong\x20credentials');}if(_0x3624e4[_0xec48('0x68')]['oldPassword']==_0x3624e4[_0xec48('0x68')][_0xec48('0x90')]){throw new db[(_0xec48('0x92'))][(_0xec48('0x93'))](_0xec48('0x96'));}return _0x2b5c3d;}else if(_0x3624e4[_0xec48('0x6e')][_0xec48('0x3f')]==_0xec48('0x6d')){if(!_0x3624e4[_0xec48('0x68')][_0xec48('0x90')]){throw new db[(_0xec48('0x92'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x2b5c3d;}else if(_0x3624e4[_0xec48('0x6e')][_0xec48('0x3f')]==_0xec48('0x6e')){if(!_0x3624e4['body']['newPassword']){throw new db[(_0xec48('0x92'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2b5c3d[_0xec48('0x3f')]!='agent'){throw new db['Sequelize'][(_0xec48('0x93'))](_0xec48('0x97'));}return _0x2b5c3d;}else{throw new db[(_0xec48('0x92'))][(_0xec48('0x93'))]('Unauthorized');}}return null;})[_0xec48('0x35')](handleEntityNotFound(_0x488d05,null))[_0xec48('0x35')](function(_0x553182){return db[_0xec48('0x74')][_0xec48('0x98')]({'attributes':['id',_0xec48('0x75')]})[_0xec48('0x35')](function(_0x3d1871){_0x4764f9=_0x3d1871['securePassword'];return checkPasswordPattern(_0x553182,_0x3624e4[_0xec48('0x68')][_0xec48('0x90')],_0x4764f9);});})[_0xec48('0x35')](saveUpdates({'password':_0x3624e4[_0xec48('0x68')]['newPassword'],'passwordResetAt':_0x3624e4['user']['id']==_0x3624e4[_0xec48('0x65')]['id']?moment():null},null))[_0xec48('0x35')](respondWithResult(_0x488d05,null))[_0xec48('0x63')](handleError(_0x488d05,null));};exports[_0xec48('0x99')]=function(_0x513c56,_0x5ae098,_0x5292d7){var _0x40a4d1=_0x513c56[_0xec48('0x68')]['channel'];return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x513c56[_0xec48('0x65')]['id']},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f'),_0xec48('0x9a'),_0xec48('0x9b'),_0xec48('0x9c'),_0xec48('0x9d')]})['then'](handleEntityNotFound(_0x5ae098,null))[_0xec48('0x35')](function(_0xf7fcf6){if(_0xf7fcf6){if(!utils[_0xec48('0x9e')](_0x40a4d1)){throw new db[(_0xec48('0x92'))]['ValidationError']('Unknown\x20channel');}return _0xf7fcf6[_0xec48('0x9f')+_[_0xec48('0xa0')](_0x40a4d1['toLowerCase']())+_0xec48('0xa1')](_0x513c56[_0xec48('0x68')][_0xec48('0x6b')],{'penalty':_0x513c56[_0xec48('0x68')]['penalty']||0x0})['spread'](function(_0x3b815f){for(var _0x2f2aa7=0x0;_0x2f2aa7<_0x513c56['body']['ids'][_0xec48('0x4f')];_0x2f2aa7+=0x1){var _0x387247={'UserId':_0x513c56[_0xec48('0x65')]['id']};_0x387247[_[_0xec48('0xa0')](_0x40a4d1[_0xec48('0xa2')]())+'QueueId']=_0x513c56[_0xec48('0x68')][_0xec48('0x6b')][_0x2f2aa7];socket[_0xec48('0xa3')](_0xec48('0x6e')+_[_0xec48('0xa0')](_0x40a4d1[_0xec48('0xa2')]())+'Queue:save',_0x387247);}return _0x3b815f;})[_0xec48('0x35')](function(){if(_0x40a4d1==='voice'){return db[_0xec48('0xa4')][_0xec48('0xa5')]({'where':{'id':_0x513c56[_0xec48('0x68')]['ids']||[]},'raw':!![],'attributes':['id',_0xec48('0x40')]});}})[_0xec48('0x35')](function(_0x29bc1c){var _0x348498=_0xf7fcf6['get']({'plain':!![]});var _0x26cdb2=[];if(_0x40a4d1==='voice'&&_0x348498[_0xec48('0x3f')]===_0xec48('0x3a')&&_0x348498[_0xec48('0x9a')]){for(var _0x481b66=0x0;_0x481b66<_0x29bc1c[_0xec48('0x4f')];_0x481b66+=0x1){_0x26cdb2[_0xec48('0xa6')]({'membername':_0x348498[_0xec48('0x40')],'UserId':_0x348498['id'],'queue_name':_0x29bc1c[_0x481b66][_0xec48('0x40')],'VoiceQueueId':_0x29bc1c[_0x481b66]['id'],'interface':_[_0xec48('0x70')](_0x348498[_0xec48('0x9d')])?util['format'](_0xec48('0xa7'),_0x348498[_0xec48('0x40')]):_0x348498['interface'],'paused':_0x348498[_0xec48('0x9c')]||![],'penalty':_0x513c56[_0xec48('0x68')][_0xec48('0xa8')]||0x0});}return BPromise[_0xec48('0xa9')](_0x26cdb2,function(_0x4715fb){return db[_0xec48('0xaa')][_0xec48('0xab')](_0x4715fb);});}return _0xf7fcf6;});}})[_0xec48('0x35')](respondWithStatusCode(_0x5ae098,null))['catch'](handleError(_0x5ae098,null));};exports[_0xec48('0xac')]=function(_0x40f9a4,_0x567263,_0x4e567b){var _0x101f62;return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x40f9a4[_0xec48('0x65')]['id']},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f')]})[_0xec48('0x35')](handleEntityNotFound(_0x567263,null))['then'](function(_0x397d7b){if(_0x397d7b){_0x101f62=_0x397d7b;if(!_0x40f9a4[_0xec48('0x4a')]['channel']||!utils[_0xec48('0x9e')](_0x40f9a4[_0xec48('0x4a')][_0xec48('0xad')])){throw new db[(_0xec48('0x92'))][(_0xec48('0x93'))](_0xec48('0xae'));}return _0x397d7b['remove'+_[_0xec48('0xa0')](_0x40f9a4[_0xec48('0x4a')][_0xec48('0xad')]['toLowerCase']())+_0xec48('0xa1')](_0x40f9a4[_0xec48('0x4a')][_0xec48('0x6b')]);}})[_0xec48('0x35')](function(_0x2cc0c5){for(var _0x345a94=0x0;_0x345a94<_0x40f9a4[_0xec48('0x4a')][_0xec48('0x6b')][_0xec48('0x4f')];_0x345a94+=0x1){var _0x2b4768={'UserId':_0x40f9a4[_0xec48('0x65')]['id']};_0x2b4768[_[_0xec48('0xa0')](_0x40f9a4['query']['channel'][_0xec48('0xa2')]())+_0xec48('0xaf')]=_0x40f9a4[_0xec48('0x4a')][_0xec48('0x6b')][_0x345a94];socket[_0xec48('0xa3')](_0xec48('0x6e')+_['capitalize'](_0x40f9a4[_0xec48('0x4a')][_0xec48('0xad')][_0xec48('0xa2')]())+_0xec48('0xb0'),_0x2b4768);}return _0x2cc0c5;})[_0xec48('0x35')](function(){if(_0x40f9a4['query'][_0xec48('0xad')]===_0xec48('0xb1')){return db[_0xec48('0xaa')][_0xec48('0x36')]({'where':{'UserId':_0x40f9a4[_0xec48('0x65')]['id'],'VoiceQueueId':_0x40f9a4[_0xec48('0x4a')]['ids']},'individualHooks':!![]})[_0xec48('0x35')](function(){return _0x101f62;});}return _0x101f62;})[_0xec48('0x35')](respondWithStatusCode(_0x567263,null))[_0xec48('0x63')](handleError(_0x567263,null));};exports[_0xec48('0xb2')]=function(_0x362c1f,_0x4b5b8a,_0x710096){_0x362c1f[_0xec48('0x68')][_0xec48('0xb3')]=_0x362c1f['file'][_0xec48('0xb4')];return db['User']['find']({'where':{'id':_0x362c1f[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x4b5b8a,null))[_0xec48('0x35')](saveUpdates(_0x362c1f[_0xec48('0x68')],null))[_0xec48('0x35')](respondWithResult(_0x4b5b8a,null))['catch'](handleError(_0x4b5b8a,null));};exports['getAvatar']=function(_0x1a6b06,_0x38a43b,_0x242a0a){var _0x384d9d=path[_0xec48('0xb5')](config[_0xec48('0xb6')],'server/files/images/logos/default_profile.png');return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x1a6b06[_0xec48('0x65')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xec48('0x35')](handleEntityNotFound(_0x38a43b,null))[_0xec48('0x35')](function(_0x5d6fe5){if(_0x5d6fe5){if(_['isNil'](_0x5d6fe5[_0xec48('0xb3')])){return _0x38a43b[_0xec48('0xb7')](_0x384d9d);}else{if(!fs['existsSync'](path[_0xec48('0xb5')](config[_0xec48('0xb6')],_0xec48('0xb8'),_0x5d6fe5['userpic']))){return _0x38a43b['download'](_0x384d9d);}return _0x38a43b['download'](path[_0xec48('0xb5')](config[_0xec48('0xb6')],'server/files/images/',_0x5d6fe5[_0xec48('0xb3')]));}}})[_0xec48('0x63')](handleError(_0x38a43b,null));};exports[_0xec48('0xb9')]=function(_0x4be5d5,_0x4ff72f,_0x3b86b6){var _0x433094={};var _0x2e0ac6={};var _0x6262bf;var _0xb5b613;return db['User'][_0xec48('0x98')]({'where':{'id':_0x4be5d5[_0xec48('0x65')]['id']}})['then'](handleEntityNotFound(_0x4ff72f,null))[_0xec48('0x35')](function(_0x58fbef){if(_0x58fbef){_0x6262bf=_0x58fbef;_0x2e0ac6[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xba')][_0xec48('0x46')]);_0x2e0ac6['query']=_[_0xec48('0x48')](_0x4be5d5[_0xec48('0x4a')]);_0x2e0ac6[_0xec48('0x4b')]=_['intersection'](_0x2e0ac6['model'],_0x2e0ac6[_0xec48('0x4a')]);_0x433094['attributes']=_[_0xec48('0x4c')](_0x2e0ac6[_0xec48('0x47')],qs['fields'](_0x4be5d5['query'][_0xec48('0x4e')]));_0x433094[_0xec48('0x4d')]=_0x433094[_0xec48('0x4d')][_0xec48('0x4f')]?_0x433094['attributes']:_0x2e0ac6[_0xec48('0x47')];_0x433094['order']=qs[_0xec48('0x54')](_0x4be5d5[_0xec48('0x4a')][_0xec48('0x54')]);_0x433094[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x4be5d5[_0xec48('0x4a')],_0x2e0ac6[_0xec48('0x4b')]));if(_0x4be5d5[_0xec48('0x4a')][_0xec48('0x57')]){_0x433094['where']=_[_0xec48('0x58')](_0x433094[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x433094[_0xec48('0x4d')],function(_0x2cb5ce){var _0x22242b={};_0x22242b[_0x2cb5ce]={'$like':'%'+_0x4be5d5[_0xec48('0x4a')][_0xec48('0x57')]+'%'};return _0x22242b;})});}_0x433094=_[_0xec48('0x58')]({},_0x433094,_0x4be5d5['options']);return _0x6262bf[_0xec48('0xb9')](_0x433094);}})[_0xec48('0x35')](function(_0x25542b){if(_0x25542b){_0xb5b613=_0x25542b[_0xec48('0x4f')];if(_0x4be5d5[_0xec48('0x4a')]['hasOwnProperty'](_0xec48('0x61'))){_0x433094[_0xec48('0x62')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xec48('0xbc')],'as':_0xec48('0xbd'),'attributes':['id','name',_0xec48('0xbe')],'where':_0x4be5d5[_0xec48('0x4a')][_0xec48('0xbf')]?{'id':_0x4be5d5[_0xec48('0x4a')][_0xec48('0xbf')]}:undefined,'required':_0x4be5d5[_0xec48('0x4a')][_0xec48('0xbf')]?!![]:![]}];}if(!_0x4be5d5[_0xec48('0x4a')]['hasOwnProperty']('nolimit')){_0x433094['limit']=qs[_0xec48('0x52')](_0x4be5d5['query'][_0xec48('0x52')]);_0x433094['offset']=qs[_0xec48('0x30')](_0x4be5d5[_0xec48('0x4a')][_0xec48('0x30')]);}return _0x6262bf[_0xec48('0xb9')](_0x433094);}})[_0xec48('0x35')](function(_0x464a86){if(_0x464a86){return _0x464a86?{'count':_0xb5b613,'rows':_0x464a86}:null;}})[_0xec48('0x35')](respondWithResult(_0x4ff72f,null))[_0xec48('0x63')](handleError(_0x4ff72f,null));};exports[_0xec48('0xc0')]=function(_0x544ad2,_0x376f58,_0x438ac2){var _0x4b719d;var _0x1e8f2f;var _0x8913ee={};var _0x543991;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x544ad2[_0xec48('0x65')]['id']},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f')]})[_0xec48('0x35')](handleEntityNotFound(_0x376f58,null))[_0xec48('0x35')](function(_0x5e2ee4){if(!utils[_0xec48('0x9e')](_0x544ad2[_0xec48('0x4a')][_0xec48('0xad')])){throw new db['Sequelize'][(_0xec48('0x93'))](_0xec48('0xae'));}_0x4b719d=_0x5e2ee4;var _0x2f37ad={};_0x2f37ad[_0xec48('0x47')]=_['keys'](db[_[_0xec48('0xa0')](_0x544ad2['query'][_0xec48('0xad')])+_0xec48('0xc1')][_0xec48('0x46')]);_0x2f37ad[_0xec48('0x4a')]=_['keys'](_0x544ad2[_0xec48('0x4a')]);_0x2f37ad[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x2f37ad[_0xec48('0x47')],_0x2f37ad['query']);_0x8913ee[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x2f37ad[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x544ad2['query'][_0xec48('0x4e')]));_0x8913ee[_0xec48('0x4d')]=_0x8913ee[_0xec48('0x4d')][_0xec48('0x4f')]?_0x8913ee[_0xec48('0x4d')]:_0x2f37ad[_0xec48('0x47')];_0x8913ee[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x544ad2[_0xec48('0x4a')]['sort']);_0x8913ee['where']=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x544ad2['query'],_0x2f37ad[_0xec48('0x4b')]));if(_0x544ad2['query'][_0xec48('0x57')]){_0x8913ee['where']=_[_0xec48('0x58')](_0x8913ee[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x8913ee[_0xec48('0x4d')],function(_0x4a6bbd){var _0x1e81f2={};_0x1e81f2[_0x4a6bbd]={'$like':'%'+_0x544ad2['query'][_0xec48('0x57')]+'%'};return _0x1e81f2;})});}_0x8913ee=_[_0xec48('0x58')]({},_0x8913ee,_0x544ad2[_0xec48('0x60')]);switch(_0x4b719d['role']){case _0xec48('0x6d'):return db[_['capitalize'](_0x544ad2[_0xec48('0x4a')][_0xec48('0xad')])+'Queue'][_0xec48('0xa5')](_0x8913ee);case'user':case _0xec48('0x3a'):return _0x4b719d[_0xec48('0x37')+_[_0xec48('0xa0')](_0x544ad2[_0xec48('0x4a')][_0xec48('0xad')])+_0xec48('0xa1')](_0x8913ee);default:throw new db[(_0xec48('0x92'))][(_0xec48('0x93'))](_0xec48('0xc2'));}})[_0xec48('0x35')](function(_0x4ec3e5){_0x543991=_0x4ec3e5[_0xec48('0x4f')];if(!_0x544ad2[_0xec48('0x4a')][_0xec48('0x50')]('nolimit')){_0x8913ee[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x544ad2[_0xec48('0x4a')][_0xec48('0x52')]);_0x8913ee[_0xec48('0x30')]=qs[_0xec48('0x30')](_0x544ad2[_0xec48('0x4a')][_0xec48('0x30')]);}switch(_0x4b719d[_0xec48('0x3f')]){case'admin':return db[_[_0xec48('0xa0')](_0x544ad2[_0xec48('0x4a')]['channel'])+_0xec48('0xc1')][_0xec48('0xa5')](_0x8913ee);case'user':case _0xec48('0x3a'):return _0x4b719d[_0xec48('0x37')+_[_0xec48('0xa0')](_0x544ad2[_0xec48('0x4a')][_0xec48('0xad')])+_0xec48('0xa1')](_0x8913ee);}})[_0xec48('0x35')](function(_0x21e162){return{'count':_0x543991,'rows':_0x21e162};})[_0xec48('0x35')](respondWithResult(_0x376f58,null))[_0xec48('0x63')](handleError(_0x376f58,null));};exports['getVoiceQueuesRt']=function(_0x1204b7,_0xd7c9cd,_0x2f5c02){var _0x31ab26={};var _0x2d6dfb={};var _0x1e3866;var _0x400968;return db['User'][_0xec48('0x98')]({'where':{'id':_0x1204b7['params']['id']}})['then'](handleEntityNotFound(_0xd7c9cd,null))[_0xec48('0x35')](function(_0x55e04e){if(_0x55e04e){_0x1e3866=_0x55e04e;_0x2d6dfb[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xaa')][_0xec48('0x46')]);_0x2d6dfb[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x1204b7[_0xec48('0x4a')]);_0x2d6dfb['filters']=_[_0xec48('0x4c')](_0x2d6dfb[_0xec48('0x47')],_0x2d6dfb[_0xec48('0x4a')]);_0x31ab26['attributes']=_[_0xec48('0x4c')](_0x2d6dfb['model'],qs[_0xec48('0x4e')](_0x1204b7[_0xec48('0x4a')][_0xec48('0x4e')]));_0x31ab26[_0xec48('0x4d')]=_0x31ab26[_0xec48('0x4d')][_0xec48('0x4f')]?_0x31ab26[_0xec48('0x4d')]:_0x2d6dfb[_0xec48('0x47')];_0x31ab26['order']=qs['sort'](_0x1204b7[_0xec48('0x4a')][_0xec48('0x54')]);_0x31ab26['where']=qs[_0xec48('0x4b')](_['pick'](_0x1204b7[_0xec48('0x4a')],_0x2d6dfb[_0xec48('0x4b')]));if(_0x1204b7['query'][_0xec48('0x57')]){_0x31ab26[_0xec48('0x55')]=_[_0xec48('0x58')](_0x31ab26[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x31ab26[_0xec48('0x4d')],function(_0x3b145f){var _0x20e175={};_0x20e175[_0x3b145f]={'$like':'%'+_0x1204b7[_0xec48('0x4a')]['filter']+'%'};return _0x20e175;})});}_0x31ab26=_['merge']({},_0x31ab26,_0x1204b7[_0xec48('0x60')]);return _0x1e3866[_0xec48('0xc3')](_0x31ab26);}})[_0xec48('0x35')](function(_0x3928d4){if(_0x3928d4){_0x400968=_0x3928d4[_0xec48('0x4f')];if(!_0x1204b7[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x31ab26[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x1204b7[_0xec48('0x4a')][_0xec48('0x52')]);_0x31ab26['offset']=qs['offset'](_0x1204b7[_0xec48('0x4a')][_0xec48('0x30')]);}return _0x1e3866[_0xec48('0xc3')](_0x31ab26);}})[_0xec48('0x35')](function(_0x37aab2){if(_0x37aab2){return _0x37aab2?{'count':_0x400968,'rows':_0x37aab2}:null;}})['then'](respondWithResult(_0xd7c9cd,null))[_0xec48('0x63')](handleError(_0xd7c9cd,null));};exports['getGroups']=function(_0x316f78,_0x56dbe0,_0x5f5837){var _0x283d96={};var _0x1aec9b={};var _0x4ca94b;var _0x48cd2a;return db[_0xec48('0x45')]['findOne']({'where':{'id':_0x316f78['params']['id']}})['then'](handleEntityNotFound(_0x56dbe0,null))[_0xec48('0x35')](function(_0x4e5f87){if(_0x4e5f87){_0x4ca94b=_0x4e5f87;_0x1aec9b[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xc4')][_0xec48('0x46')]);_0x1aec9b[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x316f78[_0xec48('0x4a')]);_0x1aec9b[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x1aec9b[_0xec48('0x47')],_0x1aec9b[_0xec48('0x4a')]);_0x283d96[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x1aec9b[_0xec48('0x47')],qs['fields'](_0x316f78[_0xec48('0x4a')][_0xec48('0x4e')]));_0x283d96['attributes']=_0x283d96[_0xec48('0x4d')]['length']?_0x283d96[_0xec48('0x4d')]:_0x1aec9b[_0xec48('0x47')];_0x283d96['order']=qs[_0xec48('0x54')](_0x316f78[_0xec48('0x4a')][_0xec48('0x54')]);_0x283d96[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x316f78[_0xec48('0x4a')],_0x1aec9b[_0xec48('0x4b')]));if(_0x316f78[_0xec48('0x4a')][_0xec48('0x57')]){_0x283d96[_0xec48('0x55')]=_[_0xec48('0x58')](_0x283d96['where'],{'$or':_[_0xec48('0xbb')](_0x283d96[_0xec48('0x4d')],function(_0x1374de){var _0xa886b0={};_0xa886b0[_0x1374de]={'$like':'%'+_0x316f78['query']['filter']+'%'};return _0xa886b0;})});}_0x283d96=_[_0xec48('0x58')]({},_0x283d96,_0x316f78['options']);return _0x4ca94b[_0xec48('0xc5')](_0x283d96);}})[_0xec48('0x35')](function(_0xbb939c){if(_0xbb939c){_0x48cd2a=_0xbb939c[_0xec48('0x4f')];if(!_0x316f78[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x283d96[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x316f78[_0xec48('0x4a')][_0xec48('0x52')]);_0x283d96['offset']=qs[_0xec48('0x30')](_0x316f78[_0xec48('0x4a')][_0xec48('0x30')]);}return _0x4ca94b[_0xec48('0xc5')](_0x283d96);}})[_0xec48('0x35')](function(_0x116854){if(_0x116854){return _0x116854?{'count':_0x48cd2a,'rows':_0x116854}:null;}})[_0xec48('0x35')](respondWithResult(_0x56dbe0,null))[_0xec48('0x63')](handleError(_0x56dbe0,null));};exports[_0xec48('0xc6')]=function(_0x2ef529,_0xe1de8c,_0x25eac7){var _0x1384d0={'raw':!![],'where':{}};var _0x5cff54={};var _0x498dc3={'count':0x0,'rows':[]};return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x2ef529['params']['id']}})[_0xec48('0x35')](handleEntityNotFound(_0xe1de8c,null))['then'](function(_0x25ad2f){if(_0x25ad2f){_0x5cff54[_0xec48('0x47')]=_[_0xec48('0x48')](db['VoiceRecording'][_0xec48('0x46')]);_0x5cff54[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x2ef529[_0xec48('0x4a')]);_0x5cff54[_0xec48('0x4b')]=_['intersection'](_0x5cff54['model'],_0x5cff54[_0xec48('0x4a')]);_0x1384d0['attributes']=_['intersection'](_0x5cff54[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x2ef529[_0xec48('0x4a')][_0xec48('0x4e')]));_0x1384d0[_0xec48('0x4d')]=_0x1384d0['attributes'][_0xec48('0x4f')]?_0x1384d0[_0xec48('0x4d')]:_0x5cff54['model'];if(!_0x2ef529[_0xec48('0x4a')]['hasOwnProperty'](_0xec48('0x51'))){_0x1384d0[_0xec48('0x52')]=qs['limit'](_0x2ef529[_0xec48('0x4a')][_0xec48('0x52')]);_0x1384d0[_0xec48('0x30')]=qs[_0xec48('0x30')](_0x2ef529[_0xec48('0x4a')][_0xec48('0x30')]);}_0x1384d0[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x2ef529[_0xec48('0x4a')][_0xec48('0x54')]);_0x1384d0[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x2ef529[_0xec48('0x4a')],_0x5cff54[_0xec48('0x4b')]));_0x1384d0[_0xec48('0x55')]['UserId']=_0x25ad2f['id'];if(_0x2ef529['query'][_0xec48('0x57')]){_0x1384d0[_0xec48('0x55')]=_['merge'](_0x1384d0[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x1384d0[_0xec48('0x4d')],function(_0x5e9f37){var _0x49f48a={};_0x49f48a[_0x5e9f37]={'$like':'%'+_0x2ef529[_0xec48('0x4a')][_0xec48('0x57')]+'%'};return _0x49f48a;})});}_0x1384d0=_[_0xec48('0x58')]({},_0x1384d0,_0x2ef529['options']);return db['VoiceRecording']['count']({'where':_0x1384d0['where']})['then'](function(_0xa4b1aa){_0x498dc3[_0xec48('0x2f')]=_0xa4b1aa;if(_0x2ef529[_0xec48('0x4a')][_0xec48('0x61')]){_0x1384d0[_0xec48('0x62')]=[{'all':!![]}];}return db['VoiceRecording'][_0xec48('0xa5')](_0x1384d0);})[_0xec48('0x35')](function(_0x23a98c){_0x498dc3[_0xec48('0xc7')]=_0x23a98c;return _0x498dc3;});}})[_0xec48('0x35')](respondWithFilteredResult(_0xe1de8c,_0x1384d0))['catch'](handleError(_0xe1de8c,null));};exports['getScreenRecordings']=function(_0x406f0a,_0x20ab08,_0xd8e06){var _0x172e2d={'raw':!![],'where':{}};var _0x1c6083={};var _0x428b2f={'count':0x0,'rows':[]};return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x406f0a[_0xec48('0x65')]['id']}})['then'](handleEntityNotFound(_0x20ab08,null))[_0xec48('0x35')](function(_0x38108d){if(_0x38108d){_0x1c6083[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xc8')][_0xec48('0x46')]);_0x1c6083[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x406f0a[_0xec48('0x4a')]);_0x1c6083[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x1c6083['model'],_0x1c6083['query']);_0x172e2d['attributes']=_[_0xec48('0x4c')](_0x1c6083[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x406f0a[_0xec48('0x4a')][_0xec48('0x4e')]));_0x172e2d[_0xec48('0x4d')]=_0x172e2d[_0xec48('0x4d')]['length']?_0x172e2d[_0xec48('0x4d')]:_0x1c6083[_0xec48('0x47')];if(!_0x406f0a[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x172e2d[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x406f0a[_0xec48('0x4a')][_0xec48('0x52')]);_0x172e2d['offset']=qs[_0xec48('0x30')](_0x406f0a['query'][_0xec48('0x30')]);}_0x172e2d[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x406f0a['query'][_0xec48('0x54')]);_0x172e2d[_0xec48('0x55')]=qs['filters'](_[_0xec48('0x56')](_0x406f0a['query'],_0x1c6083['filters']));_0x172e2d[_0xec48('0x55')][_0xec48('0xc9')]=_0x38108d['id'];if(_0x406f0a[_0xec48('0x4a')]['filter']){_0x172e2d['where']=_['merge'](_0x172e2d['where'],{'$or':_[_0xec48('0xbb')](_0x172e2d[_0xec48('0x4d')],function(_0x4be41e){var _0x2f0f5b={};_0x2f0f5b[_0x4be41e]={'$like':'%'+_0x406f0a[_0xec48('0x4a')][_0xec48('0x57')]+'%'};return _0x2f0f5b;})});}_0x172e2d=_['merge']({},_0x172e2d,_0x406f0a['options']);return db['ScreenRecording'][_0xec48('0x2f')]({'where':_0x172e2d[_0xec48('0x55')]})['then'](function(_0x7c4f9c){_0x428b2f[_0xec48('0x2f')]=_0x7c4f9c;if(_0x406f0a['query'][_0xec48('0x61')]){_0x172e2d['include']=[{'all':!![]}];}return db[_0xec48('0xc8')][_0xec48('0xa5')](_0x172e2d);})[_0xec48('0x35')](function(_0x7fd3b0){_0x428b2f[_0xec48('0xc7')]=_0x7fd3b0;return _0x428b2f;});}})[_0xec48('0x35')](respondWithFilteredResult(_0x20ab08,_0x172e2d))[_0xec48('0x63')](handleError(_0x20ab08,null));};exports[_0xec48('0xca')]=function(_0x545736,_0x35ccd6,_0x42d052){var _0x486677={};var _0x55e044={};var _0x5c63e1;var _0x25aa82;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x545736[_0xec48('0x65')]['id']}})['then'](handleEntityNotFound(_0x35ccd6,null))[_0xec48('0x35')](function(_0x194b5d){if(_0x194b5d){_0x5c63e1=_0x194b5d;_0x55e044[_0xec48('0x47')]=_['keys'](db[_0xec48('0xcb')][_0xec48('0x46')]);_0x55e044['query']=_[_0xec48('0x48')](_0x545736[_0xec48('0x4a')]);_0x55e044[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x55e044['model'],_0x55e044[_0xec48('0x4a')]);_0x486677[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x55e044['model'],qs[_0xec48('0x4e')](_0x545736['query'][_0xec48('0x4e')]));_0x486677['attributes']=_0x486677[_0xec48('0x4d')][_0xec48('0x4f')]?_0x486677[_0xec48('0x4d')]:_0x55e044[_0xec48('0x47')];_0x486677[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x545736[_0xec48('0x4a')][_0xec48('0x54')]);_0x486677[_0xec48('0x55')]=qs['filters'](_[_0xec48('0x56')](_0x545736['query'],_0x55e044[_0xec48('0x4b')]));if(_0x545736[_0xec48('0x4a')][_0xec48('0x57')]){_0x486677[_0xec48('0x55')]=_['merge'](_0x486677[_0xec48('0x55')],{'$or':_['map'](_0x486677[_0xec48('0x4d')],function(_0x33850e){var _0x36767a={};_0x36767a[_0x33850e]={'$like':'%'+_0x545736[_0xec48('0x4a')]['filter']+'%'};return _0x36767a;})});}_0x486677=_[_0xec48('0x58')]({},_0x486677,_0x545736[_0xec48('0x60')]);return _0x5c63e1[_0xec48('0xca')](_0x486677);}})['then'](function(_0x53badf){if(_0x53badf){_0x25aa82=_0x53badf[_0xec48('0x4f')];if(!_0x545736[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x486677[_0xec48('0x52')]=qs['limit'](_0x545736['query'][_0xec48('0x52')]);_0x486677['offset']=qs[_0xec48('0x30')](_0x545736['query'][_0xec48('0x30')]);}return _0x5c63e1[_0xec48('0xca')](_0x486677);}})[_0xec48('0x35')](function(_0x362c5d){if(_0x362c5d){return _0x362c5d?{'count':_0x25aa82,'rows':_0x362c5d}:null;}})[_0xec48('0x35')](respondWithResult(_0x35ccd6,null))[_0xec48('0x63')](handleError(_0x35ccd6,null));};exports[_0xec48('0xcc')]=function(_0x294f4d,_0x2a9812,_0x40e821){var _0x2226ef={};var _0x2794f7={};var _0x5f0341;var _0xbb2e12;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x294f4d[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x2a9812,null))[_0xec48('0x35')](function(_0x86fa95){if(_0x86fa95){_0x5f0341=_0x86fa95;_0x2794f7[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xcd')]['rawAttributes']);_0x2794f7[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x294f4d[_0xec48('0x4a')]);_0x2794f7[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x2794f7[_0xec48('0x47')],_0x2794f7['query']);_0x2226ef['attributes']=_[_0xec48('0x4c')](_0x2794f7['model'],qs['fields'](_0x294f4d[_0xec48('0x4a')][_0xec48('0x4e')]));_0x2226ef[_0xec48('0x4d')]=_0x2226ef['attributes'][_0xec48('0x4f')]?_0x2226ef['attributes']:_0x2794f7[_0xec48('0x47')];_0x2226ef[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x294f4d['query'][_0xec48('0x54')]);_0x2226ef[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x294f4d[_0xec48('0x4a')],_0x2794f7[_0xec48('0x4b')]));if(_0x294f4d['query'][_0xec48('0x57')]){_0x2226ef[_0xec48('0x55')]=_[_0xec48('0x58')](_0x2226ef['where'],{'$or':_[_0xec48('0xbb')](_0x2226ef[_0xec48('0x4d')],function(_0x4af8be){var _0x22386e={};_0x22386e[_0x4af8be]={'$like':'%'+_0x294f4d[_0xec48('0x4a')]['filter']+'%'};return _0x22386e;})});}_0x2226ef=_[_0xec48('0x58')]({},_0x2226ef,_0x294f4d[_0xec48('0x60')]);return _0x5f0341[_0xec48('0xcc')](_0x2226ef);}})[_0xec48('0x35')](function(_0x3e8055){if(_0x3e8055){_0xbb2e12=_0x3e8055[_0xec48('0x4f')];if(!_0x294f4d[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x2226ef[_0xec48('0x52')]=qs['limit'](_0x294f4d['query'][_0xec48('0x52')]);_0x2226ef[_0xec48('0x30')]=qs['offset'](_0x294f4d[_0xec48('0x4a')]['offset']);}return _0x5f0341[_0xec48('0xcc')](_0x2226ef);}})['then'](function(_0x101df3){if(_0x101df3){return _0x101df3?{'count':_0xbb2e12,'rows':_0x101df3}:null;}})[_0xec48('0x35')](respondWithResult(_0x2a9812,null))[_0xec48('0x63')](handleError(_0x2a9812,null));};exports[_0xec48('0xce')]=function(_0x56c86d,_0x155334,_0x1b4fac){var _0x3566b9={'raw':!![],'where':{}};var _0x45535e={};var _0x33c1b9={'count':0x0,'rows':[]};return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x56c86d['params']['id']}})['then'](handleEntityNotFound(_0x155334,null))[_0xec48('0x35')](function(_0x38bdca){if(_0x38bdca){_0x45535e[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xcf')][_0xec48('0x46')]);_0x45535e[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x56c86d['query']);_0x45535e['filters']=_[_0xec48('0x4c')](_0x45535e[_0xec48('0x47')],_0x45535e[_0xec48('0x4a')]);_0x3566b9[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x45535e[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x56c86d['query'][_0xec48('0x4e')]));_0x3566b9['attributes']=_0x3566b9['attributes'][_0xec48('0x4f')]?_0x3566b9[_0xec48('0x4d')]:_0x45535e['model'];if(!_0x56c86d[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x3566b9[_0xec48('0x52')]=qs['limit'](_0x56c86d[_0xec48('0x4a')]['limit']);_0x3566b9[_0xec48('0x30')]=qs['offset'](_0x56c86d[_0xec48('0x4a')]['offset']);}_0x3566b9[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x56c86d[_0xec48('0x4a')][_0xec48('0x54')]);_0x3566b9['where']=qs[_0xec48('0x4b')](_['pick'](_0x56c86d['query'],_0x45535e[_0xec48('0x4b')]));_0x3566b9[_0xec48('0x55')][_0xec48('0xc9')]=_0x38bdca['id'];if(_0x56c86d[_0xec48('0x4a')][_0xec48('0x57')]){_0x3566b9[_0xec48('0x55')]=_[_0xec48('0x58')](_0x3566b9['where'],{'$or':_['map'](_0x3566b9['attributes'],function(_0x312b48){var _0x5186d1={};_0x5186d1[_0x312b48]={'$like':'%'+_0x56c86d[_0xec48('0x4a')][_0xec48('0x57')]+'%'};return _0x5186d1;})});}_0x3566b9=_['merge']({},_0x3566b9,_0x56c86d['options']);return db['MailInteraction']['count']({'where':_0x3566b9[_0xec48('0x55')]})[_0xec48('0x35')](function(_0x4abbf5){_0x33c1b9[_0xec48('0x2f')]=_0x4abbf5;if(_0x56c86d[_0xec48('0x4a')][_0xec48('0x61')]){_0x3566b9[_0xec48('0x62')]=[{'all':!![]}];}return db[_0xec48('0xcf')][_0xec48('0xa5')](_0x3566b9);})['then'](function(_0x32f48e){_0x33c1b9['rows']=_0x32f48e;return _0x33c1b9;});}})[_0xec48('0x35')](respondWithFilteredResult(_0x155334,_0x3566b9))[_0xec48('0x63')](handleError(_0x155334,null));};exports[_0xec48('0xd0')]=function(_0x127ea6,_0x4c2391,_0x192cfa){var _0x56872b={};var _0x16c0ad={};var _0xc3fcf;var _0x48f388;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x127ea6[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x4c2391,null))['then'](function(_0x5579b8){if(_0x5579b8){_0xc3fcf=_0x5579b8;_0x16c0ad[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xd1')][_0xec48('0x46')]);_0x16c0ad['query']=_[_0xec48('0x48')](_0x127ea6[_0xec48('0x4a')]);_0x16c0ad['filters']=_[_0xec48('0x4c')](_0x16c0ad[_0xec48('0x47')],_0x16c0ad[_0xec48('0x4a')]);_0x56872b[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x16c0ad[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x127ea6['query'][_0xec48('0x4e')]));_0x56872b[_0xec48('0x4d')]=_0x56872b['attributes']['length']?_0x56872b['attributes']:_0x16c0ad[_0xec48('0x47')];_0x56872b[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x127ea6[_0xec48('0x4a')]['sort']);_0x56872b[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x127ea6['query'],_0x16c0ad[_0xec48('0x4b')]));if(_0x127ea6[_0xec48('0x4a')][_0xec48('0x57')]){_0x56872b['where']=_[_0xec48('0x58')](_0x56872b[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x56872b[_0xec48('0x4d')],function(_0x18e8c9){var _0xccfe42={};_0xccfe42[_0x18e8c9]={'$like':'%'+_0x127ea6['query'][_0xec48('0x57')]+'%'};return _0xccfe42;})});}_0x56872b=_[_0xec48('0x58')]({},_0x56872b,_0x127ea6[_0xec48('0x60')]);return _0xc3fcf[_0xec48('0xd0')](_0x56872b);}})['then'](function(_0x429e54){if(_0x429e54){_0x48f388=_0x429e54[_0xec48('0x4f')];if(!_0x127ea6[_0xec48('0x4a')][_0xec48('0x50')](_0xec48('0x51'))){_0x56872b[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x127ea6['query']['limit']);_0x56872b[_0xec48('0x30')]=qs['offset'](_0x127ea6['query'][_0xec48('0x30')]);}return _0xc3fcf[_0xec48('0xd0')](_0x56872b);}})['then'](function(_0x5b9892){if(_0x5b9892){return _0x5b9892?{'count':_0x48f388,'rows':_0x5b9892}:null;}})['then'](respondWithResult(_0x4c2391,null))[_0xec48('0x63')](handleError(_0x4c2391,null));};exports['getFaxInteractions']=function(_0x1209ef,_0x377df3,_0x3004f9){var _0x55316d={};var _0x31e3f1={};var _0x38ddbf;var _0x6e59d9;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x1209ef[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x377df3,null))[_0xec48('0x35')](function(_0x6e1077){if(_0x6e1077){_0x38ddbf=_0x6e1077;_0x31e3f1[_0xec48('0x47')]=_[_0xec48('0x48')](db[_0xec48('0xd2')][_0xec48('0x46')]);_0x31e3f1[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x1209ef['query']);_0x31e3f1['filters']=_[_0xec48('0x4c')](_0x31e3f1[_0xec48('0x47')],_0x31e3f1['query']);_0x55316d[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x31e3f1['model'],qs[_0xec48('0x4e')](_0x1209ef[_0xec48('0x4a')][_0xec48('0x4e')]));_0x55316d['attributes']=_0x55316d['attributes'][_0xec48('0x4f')]?_0x55316d[_0xec48('0x4d')]:_0x31e3f1[_0xec48('0x47')];_0x55316d[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x1209ef[_0xec48('0x4a')]['sort']);_0x55316d[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x1209ef[_0xec48('0x4a')],_0x31e3f1[_0xec48('0x4b')]));if(_0x1209ef[_0xec48('0x4a')][_0xec48('0x57')]){_0x55316d[_0xec48('0x55')]=_['merge'](_0x55316d[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x55316d[_0xec48('0x4d')],function(_0x23e507){var _0x1a02d1={};_0x1a02d1[_0x23e507]={'$like':'%'+_0x1209ef['query']['filter']+'%'};return _0x1a02d1;})});}_0x55316d=_['merge']({},_0x55316d,_0x1209ef['options']);return _0x38ddbf[_0xec48('0xd3')](_0x55316d);}})[_0xec48('0x35')](function(_0x219413){if(_0x219413){_0x6e59d9=_0x219413[_0xec48('0x4f')];if(!_0x1209ef[_0xec48('0x4a')]['hasOwnProperty']('nolimit')){_0x55316d['limit']=qs[_0xec48('0x52')](_0x1209ef[_0xec48('0x4a')][_0xec48('0x52')]);_0x55316d[_0xec48('0x30')]=qs[_0xec48('0x30')](_0x1209ef[_0xec48('0x4a')]['offset']);}return _0x38ddbf[_0xec48('0xd3')](_0x55316d);}})[_0xec48('0x35')](function(_0x372b30){if(_0x372b30){return _0x372b30?{'count':_0x6e59d9,'rows':_0x372b30}:null;}})[_0xec48('0x35')](respondWithResult(_0x377df3,null))[_0xec48('0x63')](handleError(_0x377df3,null));};exports[_0xec48('0xd4')]=function(_0x1b4d0b,_0x36300f,_0xd944e8){var _0x3c801c;var _0x301e6b;var _0x128804;var _0x39cafe=!_[_0xec48('0x70')](_0x1b4d0b[_0xec48('0x65')]['id'])?_0x1b4d0b['params']['id']:!_[_0xec48('0x70')](_0x1b4d0b[_0xec48('0x6e')]['id'])?_0x1b4d0b[_0xec48('0x6e')]['id']:null;return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x39cafe,'role':_0xec48('0x3a')},'attributes':['id',_0xec48('0x40'),_0xec48('0xd5'),_0xec48('0xd6'),_0xec48('0x3f'),_0xec48('0x73'),_0xec48('0x9b')]})[_0xec48('0x35')](handleEntityNotFound(_0x36300f,null))[_0xec48('0x35')](function(_0x5d2930){if(_0x5d2930){_0x3c801c=_0x5d2930;if(_0x1b4d0b[_0xec48('0x68')]['interface']){_0x128804=util[_0xec48('0x71')](_0xec48('0xd7'),_0x3c801c[_0x1b4d0b[_0xec48('0x68')][_0xec48('0x9d')]]);}else if(_0x1b4d0b[_0xec48('0x68')][_0xec48('0xd8')]){_0x128804=util[_0xec48('0x71')](_0xec48('0xa7'),_0x1b4d0b[_0xec48('0x68')][_0xec48('0xd8')]);}else{_0x128804=util[_0xec48('0x71')]('SIP/%s',_0x3c801c[_0xec48('0x40')]);}socket['to'](util[_0xec48('0x71')](_0xec48('0xd9'),_0x3c801c[_0xec48('0x40')]))[_0xec48('0xa3')](_0xec48('0xda'),{'ip':_0x1b4d0b['headers'][_0xec48('0xdb')]||_0x1b4d0b[_0xec48('0xdc')][_0xec48('0xdd')]||_0x1b4d0b[_0xec48('0xde')]['remoteAddress']||_0x1b4d0b[_0xec48('0xdc')][_0xec48('0xde')][_0xec48('0xdd')]});return db[_0xec48('0xaa')]['destroy']({'where':{'membername':_0x3c801c[_0xec48('0x40')]},'individualHooks':!![]});}})[_0xec48('0x35')](function(_0x2a1275){if(_0x3c801c){return _0x3c801c[_0xec48('0xdf')]({'raw':!![]});}})[_0xec48('0x35')](function(_0xf031b4){var _0x1df941=[];if(_0xf031b4){_0x301e6b=_0xf031b4;if(_0x301e6b[_0xec48('0x4f')]){for(var _0x349ebb=0x0;_0x349ebb<_0x301e6b[_0xec48('0x4f')];_0x349ebb++){_0x1df941[_0xec48('0xa6')]({'membername':_0x3c801c['name'],'UserId':_0x3c801c['id'],'queue_name':_0x301e6b[_0x349ebb]['name'],'VoiceQueueId':_0x301e6b[_0x349ebb]['id'],'interface':_0x128804,'paused':_0x3c801c[_0xec48('0x9b')]||![],'penalty':_0x301e6b[_0x349ebb][_0xec48('0xe0')]||0x0});}return BPromise[_0xec48('0xa9')](_0x1df941,function(_0x57ff63){return db['UserVoiceQueueRt'][_0xec48('0xab')](_0x57ff63);});}}})[_0xec48('0x35')](function(){return db[_0xec48('0xe1')][_0xec48('0xa5')]({'where':{'membername':_0x3c801c[_0xec48('0x40')],'exitAt':null}});})['then'](function(_0x1c778c){var _0x17b04a=[];_0x1c778c[_0xec48('0xe2')](function(_0x5e9411){_0x17b04a[_0xec48('0xa6')](_0x5e9411[_0xec48('0x34')]({'exitAt':moment()[_0xec48('0x71')](_0xec48('0xe3'))}));});return BPromise[_0xec48('0xe4')](_0x17b04a);})['then'](function(){var _0x38c058=[];var _0x971587=[];var _0x1dca52=utils[_0xec48('0xe5')]();var _0x55ce43={'membername':_0x3c801c[_0xec48('0x40')],'interface':_0x128804,'enterAt':moment()['format'](_0xec48('0xe3')),'role':_0x3c801c[_0xec48('0x3f')],'internal':_0x3c801c[_0xec48('0x73')]};_0x1dca52[_0xec48('0xe2')](function(_0x321d3c){_0x38c058[_0xec48('0xa6')](_['merge']({'channel':_0x321d3c,'type':_0xec48('0xe6'),'data1':_0x1b4d0b[_0xec48('0x68')][_0xec48('0xe7')],'data2':_0x128804},_0x55ce43));if(_0x3c801c[_0xec48('0x9b')]){_0x971587[_0xec48('0xa6')](_[_0xec48('0x58')]({'channel':_0x321d3c,'type':_0xec48('0xe8'),'data1':_0xec48('0xe9')},_0x55ce43));}});return db['MemberReport'][_0xec48('0x67')](_0x38c058[_0xec48('0xea')](_0x971587),{'individualHooks':!![]});})[_0xec48('0x35')](function(){return _0x3c801c[_0xec48('0x34')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3c801c['loginInPause']||![],'mailPause':_0x3c801c['loginInPause']||![],'chatPause':_0x3c801c[_0xec48('0x9b')]||![],'faxPause':_0x3c801c[_0xec48('0x9b')]||![],'smsPause':_0x3c801c[_0xec48('0x9b')]||![],'openchannelPause':_0x3c801c[_0xec48('0x9b')]||![],'pauseType':_0x3c801c[_0xec48('0x9b')]?_0xec48('0xe9'):null,'interface':_0x128804,'lastPauseAt':moment()['format'](_0xec48('0xe3'))});})[_0xec48('0x35')](function(_0x4262ea){if(_0x1b4d0b[_0xec48('0xeb')]){return _0xd944e8();}else{return BPromise[_0xec48('0xec')](_0x4262ea)[_0xec48('0x35')](respondWithResult(_0x36300f,null));}})[_0xec48('0x63')](handleError(_0x36300f,null));};exports[_0xec48('0xed')]=function(_0x518c32,_0x595479,_0x485900){var _0x53d638;return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x518c32['params']['id'],'role':_0xec48('0x3a')},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f')]})[_0xec48('0x35')](handleEntityNotFound(_0x595479,null))[_0xec48('0x35')](function(_0x31a8ae){if(_0x31a8ae){_0x53d638=_0x31a8ae;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x53d638[_0xec48('0x40')]},'individualHooks':!![]});}})[_0xec48('0x35')](function(){return db[_0xec48('0xe1')][_0xec48('0xa5')]({'where':{'membername':_0x53d638[_0xec48('0x40')],'exitAt':null}});})[_0xec48('0x35')](function(_0x21d363){var _0x532418=[];_0x21d363['forEach'](function(_0x1d8e18){_0x532418['push'](_0x1d8e18[_0xec48('0x34')]({'exitAt':moment()['format'](_0xec48('0xe3'))}));});return BPromise['all'](_0x532418);})[_0xec48('0x35')](function(){return _0x53d638[_0xec48('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xec48('0x35')](respondWithResult(_0x595479,null))[_0xec48('0x63')](handleError(_0x595479,null));};exports['pause']=function(_0x820d51,_0x51d76a,_0x156ffc){var _0x5dee67;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x820d51[_0xec48('0x65')]['id']},'individualHooks':!![]})[_0xec48('0x35')](function(){return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x820d51[_0xec48('0x65')]['id'],'role':'agent'},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f'),'internal',_0xec48('0x9d')]});})['then'](handleEntityNotFound(_0x51d76a,null))['then'](function(_0x757f41){if(_0x757f41){_0x5dee67=_0x757f41;return respondWithRpcPromise(_0xec48('0xee'),_0xec48('0xef'),{'id':_0x5dee67['id'],'name':_0x5dee67[_0xec48('0x40')],'pause':!![]});}})[_0xec48('0x35')](function(){if(_0x5dee67){return db['MemberReport'][_0xec48('0xa5')]({'where':{'membername':_0x5dee67[_0xec48('0x40')],'type':_0xec48('0xe8'),'exitAt':null}});}})[_0xec48('0x35')](function(_0x3460ba){if(_0x3460ba['length']){var _0x5a43f9=moment()[_0xec48('0x71')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x62333f=0x0,_0x2a3f93=_0x3460ba[_0xec48('0x4f')];_0x62333f<_0x2a3f93;_0x62333f++){_0x3460ba[_0x62333f]['updateAttributes']({'exitAt':_0x5a43f9});}}})['then'](function(){var _0x4d328d=[];var _0x4ed18b=utils['getChannels']();_0x4ed18b[_0xec48('0xe2')](function(_0x4c2034){_0x4d328d['push']({'channel':_0x4c2034,'membername':_0x5dee67['name'],'interface':_['isNil'](_0x5dee67[_0xec48('0x9d')])?util['format'](_0xec48('0xa7'),_0x5dee67[_0xec48('0x40')]):_0x5dee67['interface'],'type':_0xec48('0xe8'),'enterAt':moment()[_0xec48('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x820d51[_0xec48('0x68')]['type']||_0xec48('0xf0'),'role':_0x5dee67[_0xec48('0x3f')],'internal':_0x5dee67[_0xec48('0x73')]});});return db['MemberReport']['bulkCreate'](_0x4d328d,{'individualHooks':!![]});})[_0xec48('0x35')](function(){return _0x5dee67[_0xec48('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x820d51['body']['type']||_0xec48('0xf0'),'lastPauseAt':moment()['format'](_0xec48('0xe3'))});})['then'](respondWithResult(_0x51d76a,null))['catch'](handleError(_0x51d76a,null));};exports[_0xec48('0xf1')]=function(_0xd371d2,_0x227ab0,_0xfa9de2){var _0x8f2d19;return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0xd371d2['params']['id']},'attributes':['id',_0xec48('0x40'),_0xec48('0x3f'),'voicePause',_0xec48('0xf2'),_0xec48('0xf3'),_0xec48('0xf4'),_0xec48('0xf5'),'smsPause',_0xec48('0xf6'),_0xec48('0xf7')]})[_0xec48('0x35')](handleEntityNotFound(_0x227ab0,null))['then'](function(_0x162d0c){if(_0x162d0c){_0x8f2d19=_0x162d0c;if(_0xd371d2[_0xec48('0x68')][_0xec48('0xad')]&&!utils[_0xec48('0x9e')](_0xd371d2[_0xec48('0x68')]['channel'])){throw new db[(_0xec48('0x92'))]['ValidationError'](_0xec48('0xae'));}switch(_0xd371d2[_0xec48('0x68')][_0xec48('0xad')]){case'voice':return respondWithRpcPromise(_0xec48('0xee'),'unpause',{'id':_0x8f2d19['id'],'name':_0x8f2d19[_0xec48('0x40')],'pause':![]})['then'](function(){return db[_0xec48('0xaa')][_0xec48('0x34')]({'paused':0x0},{'where':{'UserId':_0x8f2d19['id']},'individualHooks':!![]});})['then'](function(){return db[_0xec48('0xe1')][_0xec48('0x66')]({'where':{'channel':_0xd371d2[_0xec48('0x68')][_0xec48('0xad')],'membername':_0x8f2d19[_0xec48('0x40')],'type':_0xec48('0xe8'),'exitAt':null}});})[_0xec48('0x35')](function(_0x204384){if(_0x204384){return _0x204384['update']({'exitAt':moment()[_0xec48('0x71')](_0xec48('0xe3')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x8f2d19[_0xec48('0x34')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0xec48('0xf8'):case _0xec48('0xf9'):return db[_0xec48('0xe1')][_0xec48('0x66')]({'where':{'channel':_0xd371d2[_0xec48('0x68')]['channel'],'membername':_0x8f2d19[_0xec48('0x40')],'type':'PAUSE','exitAt':null}})[_0xec48('0x35')](function(_0x2cd0e4){if(_0x2cd0e4){return _0x2cd0e4[_0xec48('0x34')]({'exitAt':moment()[_0xec48('0x71')](_0xec48('0xe3')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xec48('0x35')](function(){var _0x77a4ff={};_[_0xec48('0x31')](_0x77a4ff,util[_0xec48('0x71')](_0xec48('0xfa'),_0xd371d2[_0xec48('0x68')]['channel'],_0xec48('0xfb')),![]);return _0x8f2d19[_0xec48('0x34')](_0x77a4ff);});default:return respondWithRpcPromise(_0xec48('0xee'),_0xec48('0xf1'),{'id':_0x8f2d19['id'],'name':_0x8f2d19[_0xec48('0x40')],'pause':![]})[_0xec48('0x35')](function(){return db['UserVoiceQueueRt'][_0xec48('0x34')]({'paused':0x0},{'where':{'UserId':_0x8f2d19['id']}});})['then'](function(){return db['MemberReport'][_0xec48('0xa5')]({'where':{'membername':_0x8f2d19[_0xec48('0x40')],'type':_0xec48('0xe8'),'exitAt':null}});})[_0xec48('0x35')](function(_0x356970){var _0x1f0c07=[];_0x356970[_0xec48('0xe2')](function(_0x3b81dc){_0x1f0c07[_0xec48('0xa6')](_0x3b81dc['update']({'exitAt':moment()[_0xec48('0x71')](_0xec48('0xe3')),'data2':_0xec48('0xfc')}));});return BPromise[_0xec48('0xe4')](_0x1f0c07);})[_0xec48('0x35')](function(){return _0x8f2d19[_0xec48('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x227ab0,null))[_0xec48('0x63')](handleError(_0x227ab0,null));};exports['getTeams']=function(_0x52c43c,_0x3ed455,_0x551931){var _0xf2e67c={};var _0x4e4e95={};var _0x1d1748;var _0xb87f36;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x52c43c[_0xec48('0x65')]['id']}})['then'](handleEntityNotFound(_0x3ed455,null))['then'](function(_0x108161){if(_0x108161){_0x1d1748=_0x108161;_0x4e4e95['model']=_[_0xec48('0x48')](db['Team']['rawAttributes']);_0x4e4e95[_0xec48('0x4a')]=_[_0xec48('0x48')](_0x52c43c['query']);_0x4e4e95[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x4e4e95[_0xec48('0x47')],_0x4e4e95['query']);_0xf2e67c[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x4e4e95[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x52c43c[_0xec48('0x4a')][_0xec48('0x4e')]));_0xf2e67c[_0xec48('0x4d')]=_0xf2e67c['attributes']['length']?_0xf2e67c['attributes']:_0x4e4e95[_0xec48('0x47')];_0xf2e67c[_0xec48('0x53')]=qs['sort'](_0x52c43c[_0xec48('0x4a')]['sort']);_0xf2e67c[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x52c43c['query'],_0x4e4e95[_0xec48('0x4b')]));if(_0x52c43c[_0xec48('0x4a')]['filter']){_0xf2e67c[_0xec48('0x55')]=_[_0xec48('0x58')](_0xf2e67c[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0xf2e67c['attributes'],function(_0x16f936){var _0x53790e={};_0x53790e[_0x16f936]={'$like':'%'+_0x52c43c['query']['filter']+'%'};return _0x53790e;})});}_0xf2e67c=_[_0xec48('0x58')]({},_0xf2e67c,_0x52c43c[_0xec48('0x60')]);return _0x1d1748['getTeams'](_0xf2e67c);}})[_0xec48('0x35')](function(_0x152912){if(_0x152912){_0xb87f36=_0x152912[_0xec48('0x4f')];if(!_0x52c43c['query'][_0xec48('0x50')](_0xec48('0x51'))){_0xf2e67c[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x52c43c[_0xec48('0x4a')][_0xec48('0x52')]);_0xf2e67c['offset']=qs[_0xec48('0x30')](_0x52c43c[_0xec48('0x4a')][_0xec48('0x30')]);}return _0x1d1748[_0xec48('0xfd')](_0xf2e67c);}})[_0xec48('0x35')](function(_0x1e2f19){if(_0x1e2f19){return _0x1e2f19?{'count':_0xb87f36,'rows':_0x1e2f19}:null;}})[_0xec48('0x35')](respondWithResult(_0x3ed455,null))[_0xec48('0x63')](handleError(_0x3ed455,null));};exports[_0xec48('0xfe')]=function(_0x25c37c,_0x168bb8,_0x18bcf0){return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x25c37c[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x168bb8,null))[_0xec48('0x35')](function(_0x380da8){if(_0x380da8){return _0x380da8[_0xec48('0xfe')](_0x25c37c[_0xec48('0x68')][_0xec48('0x6b')],_[_0xec48('0xff')](_0x25c37c[_0xec48('0x68')],[_0xec48('0x6b'),'id'])||{});}})[_0xec48('0x35')](respondWithResult(_0x168bb8,null))[_0xec48('0x63')](handleError(_0x168bb8,null));};exports[_0xec48('0x100')]=function(_0x7598f5,_0x29eb16,_0x9e4e0c){return db[_0xec48('0x45')][_0xec48('0x66')]({'where':{'id':_0x7598f5[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x29eb16,null))['then'](function(_0x4c8af0){if(_0x4c8af0){return _0x4c8af0[_0xec48('0x100')](_0x7598f5[_0xec48('0x4a')][_0xec48('0x6b')]);}})[_0xec48('0x35')](respondWithStatusCode(_0x29eb16,null))[_0xec48('0x63')](handleError(_0x29eb16,null));};exports['getLists']=function(_0x143320,_0x35cf62,_0x38d1ab){var _0x10549f={};var _0x29df70={};var _0x2590d1;var _0x253d9d;return db['User']['findOne']({'where':{'id':_0x143320[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x35cf62,null))[_0xec48('0x35')](function(_0x30b791){if(_0x30b791){_0x2590d1=_0x30b791;_0x29df70['model']=_[_0xec48('0x48')](db['CmList'][_0xec48('0x46')]);_0x29df70[_0xec48('0x4a')]=_['keys'](_0x143320[_0xec48('0x4a')]);_0x29df70['filters']=_['intersection'](_0x29df70['model'],_0x29df70[_0xec48('0x4a')]);_0x10549f[_0xec48('0x4d')]=_['intersection'](_0x29df70['model'],qs['fields'](_0x143320[_0xec48('0x4a')][_0xec48('0x4e')]));_0x10549f['attributes']=_0x10549f[_0xec48('0x4d')]['length']?_0x10549f[_0xec48('0x4d')]:_0x29df70[_0xec48('0x47')];_0x10549f[_0xec48('0x53')]=qs[_0xec48('0x54')](_0x143320['query'][_0xec48('0x54')]);_0x10549f['where']=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x143320[_0xec48('0x4a')],_0x29df70[_0xec48('0x4b')]));if(_0x143320[_0xec48('0x4a')][_0xec48('0x57')]){_0x10549f[_0xec48('0x55')]=_[_0xec48('0x58')](_0x10549f[_0xec48('0x55')],{'$or':_[_0xec48('0xbb')](_0x10549f[_0xec48('0x4d')],function(_0x5a02a5){var _0x748c09={};_0x748c09[_0x5a02a5]={'$like':'%'+_0x143320['query'][_0xec48('0x57')]+'%'};return _0x748c09;})});}_0x10549f=_[_0xec48('0x58')]({},_0x10549f,_0x143320['options']);return _0x2590d1[_0xec48('0x101')](_0x10549f);}})['then'](function(_0x31e8e8){if(_0x31e8e8){_0x253d9d=_0x31e8e8[_0xec48('0x4f')];if(!_0x143320[_0xec48('0x4a')][_0xec48('0x50')]('nolimit')){_0x10549f[_0xec48('0x52')]=qs[_0xec48('0x52')](_0x143320[_0xec48('0x4a')]['limit']);_0x10549f[_0xec48('0x30')]=qs['offset'](_0x143320[_0xec48('0x4a')][_0xec48('0x30')]);}return _0x2590d1[_0xec48('0x101')](_0x10549f);}})['then'](function(_0x24a245){if(_0x24a245){return _0x24a245?{'count':_0x253d9d,'rows':_0x24a245}:null;}})[_0xec48('0x35')](respondWithResult(_0x35cf62,null))[_0xec48('0x63')](handleError(_0x35cf62,null));};exports['getAgents']=function(_0x26b833,_0x20b9b0,_0x387628){var _0x562070={};var _0x27a372={};var _0x371b05;var _0x15732a;return db[_0xec48('0x45')][_0xec48('0x98')]({'where':{'id':_0x26b833[_0xec48('0x65')]['id']}})[_0xec48('0x35')](handleEntityNotFound(_0x20b9b0,null))[_0xec48('0x35')](function(_0x2837f9){if(_0x2837f9){_0x371b05=_0x2837f9;_0x27a372[_0xec48('0x47')]=_['keys'](db[_0xec48('0x45')][_0xec48('0x46')]);_0x27a372[_0xec48('0x4a')]=_['keys'](_0x26b833[_0xec48('0x4a')]);_0x27a372[_0xec48('0x4b')]=_[_0xec48('0x4c')](_0x27a372[_0xec48('0x47')],_0x27a372['query']);_0x562070[_0xec48('0x4d')]=_[_0xec48('0x4c')](_0x27a372[_0xec48('0x47')],qs[_0xec48('0x4e')](_0x26b833[_0xec48('0x4a')]['fields']));_0x562070[_0xec48('0x4d')]=_0x562070[_0xec48('0x4d')][_0xec48('0x4f')]?_0x562070[_0xec48('0x4d')]:_0x27a372[_0xec48('0x47')];_0x562070[_0xec48('0x53')]=qs['sort'](_0x26b833['query'][_0xec48('0x54')]);_0x562070[_0xec48('0x55')]=qs[_0xec48('0x4b')](_[_0xec48('0x56')](_0x26b833[_0xec48('0x4a')],_0x27a372[_0xec48('0x4b')]));if(_0x26b833[_0xec48('0x4a')]['filter']){_0x562070[_0xec48('0x55')]=_[_0xec48('0x58')](_0x562070[_0xec48('0x55')],{'$or':_['map'](_0x562070[_0xec48('0x4d')],function(_0x5d2606){var _0x303492={};_0x303492[_0x5d2606]={'$like':'%'+_0x26b833[_0xec48('0x4a')][_0xec48('0x57')]+'%'};return _0x303492;})});}_0x562070[_0xec48('0x47')]=db['User'];_0x562070['as']=_0xec48('0x39');_0x562070=_[_0xec48('0x58')]({},_0x562070,_0x26b833[_0xec48('0x60')]);return _0x371b05[_0xec48('0xdf')]({'include':[_0x562070]});}})['then'](function(_0x692f15){if(_0x692f15){var _0x2cf47a={},_0xc82b7a=[],_0x48e403=0x0;for(var _0x3c74e0=0x0;_0x3c74e0<_0x692f15[_0xec48('0x4f')];_0x3c74e0+=0x1){for(var _0x7183c8=0x0,_0x4eb29c;_0x7183c8<_0x692f15[_0x3c74e0][_0xec48('0x39')]['length'];_0x7183c8+=0x1){_0x4eb29c=_0x692f15[_0x3c74e0]['Agents'][_0x7183c8][_0xec48('0x37')]({'plain':!![]});_0x2cf47a[_0x4eb29c['id']]=_0x4eb29c;}}_0x2cf47a=_[_0xec48('0x102')](_0x2cf47a);for(var _0x486063=qs[_0xec48('0x30')](_0x26b833[_0xec48('0x4a')]['offset']);_0x486063<_0x2cf47a[_0xec48('0x4f')]&&_0xc82b7a['length']=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0x5f2f=['set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','mobile','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','find','ShowUser','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','MemberReport','bulkCreate','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel'];(function(_0x15c6b0,_0x233f4b){var _0x1151b0=function(_0x4bace0){while(--_0x4bace0){_0x15c6b0['push'](_0x15c6b0['shift']());}};_0x1151b0(++_0x233f4b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d407f,_0xae041c){_0x5d407f=_0x5d407f-0x0;var _0x3dbf71=_0x5f2f[_0x5d407f];return _0x3dbf71;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./user.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['GetUser']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')]({'raw':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'limit':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x23')]||null:null,'include':_0x34706d['options']?_0x34706d['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x24')],function(_0xf6c58d){return{'model':db[_0xf6c58d[_0xf5f2('0x26')]],'as':_0xf6c58d['as'],'attributes':_0xf6c58d[_0xf5f2('0x22')],'include':_0xf6c58d[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xf6c58d['include'],function(_0xaa2602){return{'model':db[_0xaa2602[_0xf5f2('0x26')]],'as':_0xaa2602['as'],'attributes':_0xaa2602[_0xf5f2('0x22')],'include':_0xaa2602[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xaa2602[_0xf5f2('0x24')],function(_0x5b6672){return{'model':db[_0x5b6672['model']],'as':_0x5b6672['as'],'attributes':_0x5b6672[_0xf5f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x11c771){logger['info']('GetUser',_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x27'),_0x34706d,JSON[_0xf5f2('0x16')](_0x11c771));_0x49dac2(_0x11c771);})[_0xf5f2('0x1c')](function(_0x1b381e){logger['error']('GetUser',_0x1b381e[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e['error'](0x1f4,_0x1b381e[_0xf5f2('0x19')]));});});};exports['ShowUser']=function(_0x45b643){var _0x31087c=this;return new Promise(function(_0x7b6817,_0x428770){return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'raw':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'include':_0x45b643[_0xf5f2('0x1f')]?_0x45b643['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x45b643['options'][_0xf5f2('0x24')],function(_0x4b8c42){return{'model':db[_0x4b8c42[_0xf5f2('0x26')]],'as':_0x4b8c42['as'],'attributes':_0x4b8c42[_0xf5f2('0x22')],'include':_0x4b8c42[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x4b8c42['include'],function(_0x5a98d7){return{'model':db[_0x5a98d7[_0xf5f2('0x26')]],'as':_0x5a98d7['as'],'attributes':_0x5a98d7[_0xf5f2('0x22')],'include':_0x5a98d7[_0xf5f2('0x24')]?_['map'](_0x5a98d7[_0xf5f2('0x24')],function(_0x4f7f80){return{'model':db[_0x4f7f80[_0xf5f2('0x26')]],'as':_0x4f7f80['as'],'attributes':_0x4f7f80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x456764){logger['info'](_0xf5f2('0x29'),_0x45b643);logger[_0xf5f2('0x14')](_0xf5f2('0x29'),_0x45b643,JSON[_0xf5f2('0x16')](_0x456764));_0x7b6817(_0x456764);})['catch'](function(_0x5d2d82){logger[_0xf5f2('0x17')](_0xf5f2('0x29'),_0x5d2d82[_0xf5f2('0x19')],_0x45b643);_0x428770(_0x31087c[_0xf5f2('0x17')](0x1f4,_0x5d2d82[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x2a')]=function(_0x2bc20e){var _0x4c0ac7=this;return new Promise(function(_0x110fe5,_0x3b4ea6){var _0x536501;return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'where':_0x2bc20e[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x2d'),_0xf5f2('0x2e')]})['then'](function(_0x31c3c){if(_0x31c3c){_0x536501=_0x31c3c;return db[_0xf5f2('0x2f')][_0xf5f2('0x30')]({'paused':0x1},{'where':{'UserId':_0x536501['id']},'individualHooks':!![]});}})['then'](function(){if(_0x536501){return db['MemberReport']['findAll']({'where':{'membername':_0x536501[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});}})['then'](function(_0x106272){if(_0x536501){if(_0x106272&&_0x106272[_0xf5f2('0x32')]){var _0x28e33f=moment()[_0xf5f2('0x33')](_0xf5f2('0x34'));for(var _0x2b3b1c=0x0,_0x1a6ec1=_0x106272[_0xf5f2('0x32')];_0x2b3b1c<_0x1a6ec1;_0x2b3b1c++){_0x106272[_0x2b3b1c][_0xf5f2('0x35')]({'exitAt':_0x28e33f});}}}})[_0xf5f2('0x11')](function(){if(_0x536501){var _0x444317=[];var _0x4773cd=utils[_0xf5f2('0x36')]();_0x4773cd[_0xf5f2('0x37')](function(_0x4faeed){_0x444317[_0xf5f2('0x38')]({'channel':_0x4faeed,'membername':_0x536501['name'],'interface':_[_0xf5f2('0x39')](_0x536501[_0xf5f2('0x2e')])?util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x536501[_0xf5f2('0x2b')]):_0x536501[_0xf5f2('0x2e')],'type':'PAUSE','enterAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data1':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'role':_0x536501[_0xf5f2('0x2c')],'internal':_0x536501[_0xf5f2('0x2d')],'uniqueid':_0x2bc20e[_0xf5f2('0x3b')]['uniqueid']||null});});return db[_0xf5f2('0x3e')][_0xf5f2('0x3f')](_0x444317,{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x536501){return _0x536501['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2bc20e[_0xf5f2('0x3b')][_0xf5f2('0x3c')]||_0xf5f2('0x3d'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf5f2('0x11')](function(_0x27c472){_0x110fe5(_0x27c472);})['catch'](function(_0x14aa81){_0x3b4ea6(_0x4c0ac7['error'](0x1f4,_0x14aa81[_0xf5f2('0x19')]));});});};exports['UnpauseUser']=function(_0x2cbd9d){var _0x5d9120=this;return new Promise(function(_0x2d9017,_0xb8ea3a){var _0xbb658c;return db[_0xf5f2('0x1d')]['findOne']({'where':_0x2cbd9d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})['then'](function(_0xc3d4f){if(_0xc3d4f){_0xbb658c=_0xc3d4f;if(_0x2cbd9d[_0xf5f2('0x3b')]['channel']&&!utils[_0xf5f2('0x40')](_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')])){throw new Error(_0xf5f2('0x42'));}switch(_0x2cbd9d['body']['channel']){case _0xf5f2('0x43'):return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0x59e8ef){if(_0x59e8ef){return _0x59e8ef[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':_0xf5f2('0x44')},{'individualHooks':!![]});}return null;})[_0xf5f2('0x11')](function(){return _0xbb658c['update']({'voicePause':![]});});case _0xf5f2('0x45'):case _0xf5f2('0x46'):case _0xf5f2('0x47'):case'sms':case _0xf5f2('0x48'):return db['MemberReport'][_0xf5f2('0x28')]({'where':{'channel':_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],'membername':_0xbb658c[_0xf5f2('0x2b')],'type':'PAUSE','exitAt':null}})['then'](function(_0x756f1f){return _0x756f1f['update']({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34')),'data2':'system'},{'individualHooks':!![]});})[_0xf5f2('0x11')](function(){var _0xa4c0be={};_[_0xf5f2('0x49')](_0xa4c0be,util['format'](_0xf5f2('0x4a'),_0x2cbd9d[_0xf5f2('0x3b')][_0xf5f2('0x41')],_0xf5f2('0x4b')),![]);return _0xbb658c['update'](_0xa4c0be);});default:return db[_0xf5f2('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0xbb658c['id']}})[_0xf5f2('0x11')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0xbb658c[_0xf5f2('0x2b')],'type':_0xf5f2('0x31'),'exitAt':null}});})['then'](function(_0xda8dda){var _0xacd80=[];_0xda8dda[_0xf5f2('0x37')](function(_0x212639){_0xacd80[_0xf5f2('0x38')](_0x212639['update']({'exitAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0xf5f2('0x4c')](_0xacd80);})['then'](function(){return _0xbb658c[_0xf5f2('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xf5f2('0x11')](function(_0x420784){_0x2d9017(_0x420784);})[_0xf5f2('0x1c')](function(_0x5767fc){_0xb8ea3a(_0x5d9120[_0xf5f2('0x17')](0x1f4,_0x5767fc[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x4d')]=function(_0x18c41f){var _0x15b680=this;return new Promise(function(_0x35d868,_0x158768){var _0x4a7be9;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x18c41f[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id','name']})[_0xf5f2('0x11')](function(_0x4cce08){if(_0x4cce08){_0x4a7be9=_0x4cce08;return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x4a7be9['name']},'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x4a7be9){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x4a7be9[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x4bd113){if(_0x4a7be9){if(_0x4bd113&&_0x4bd113[_0xf5f2('0x32')]){var _0x21c107=[];_0x4bd113[_0xf5f2('0x37')](function(_0xbf9f55){_0x21c107[_0xf5f2('0x38')](_0xbf9f55[_0xf5f2('0x30')]({'exitAt':moment()['format'](_0xf5f2('0x34'))}));});return BPromise[_0xf5f2('0x4c')](_0x21c107);}}})['then'](function(){if(_0x4a7be9){return _0x4a7be9[_0xf5f2('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf5f2('0x11')](function(_0x377aad){_0x35d868(_0x377aad);})['catch'](function(_0x551cc9){_0x158768(_0x15b680['error'](0x1f4,_0x551cc9[_0xf5f2('0x19')]));});});};exports[_0xf5f2('0x50')]=function(_0x35f6a2){var _0x450691=this;return new Promise(function(_0x55da4d,_0x4d878e){var _0x278b76;var _0x3a98b4;var _0xc10cf3;var _0xe8a9b7;return db[_0xf5f2('0x1d')][_0xf5f2('0x4e')]({'where':_0x35f6a2[_0xf5f2('0x1f')][_0xf5f2('0x21')]||{},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x2c'),_0xf5f2('0x51'),'phone','internal','loginInPause',_0xf5f2('0x2e')]})[_0xf5f2('0x11')](function(_0x3d3181){if(_0x3d3181){_0x278b76=_0x3d3181;_0xe8a9b7=_0x35f6a2[_0xf5f2('0x3b')][_0xf5f2('0x2e')]?_0x35f6a2['body'][_0xf5f2('0x2e')]:util[_0xf5f2('0x33')](_0xf5f2('0x3a'),_0x278b76[_0xf5f2('0x2b')]);return db[_0xf5f2('0x1d')]['count']({'where':{'role':_0xf5f2('0x52'),'online':!![],'id':{'$ne':_0x278b76['id']}}});}})[_0xf5f2('0x11')](function(_0x517c15){if(_0x517c15){_0xc10cf3=_0x517c15;return require(_0xf5f2('0x53'))[_0xf5f2('0x54')]();}})[_0xf5f2('0x11')](function(_0x30ac41){if(_0x30ac41&&_0x30ac41['agents']&&_0xc10cf3>=_0x30ac41[_0xf5f2('0x55')]){throw new Error(_0xf5f2('0x56'));}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x2f')][_0xf5f2('0x4f')]({'where':{'membername':_0x278b76['name']},'individualHooks':!![]});}})['then'](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x57')]({'raw':!![]});}})[_0xf5f2('0x11')](function(_0x17eb69){if(_0x278b76){if(_0x17eb69){var _0xe3ea1e=[];_0x3a98b4=_0x17eb69;if(_0x3a98b4['length']){for(var _0x5a2f9f=0x0;_0x5a2f9f<_0x3a98b4[_0xf5f2('0x32')];_0x5a2f9f++){_0xe3ea1e['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x278b76['name'],'UserId':_0x278b76['id'],'queue_name':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x2b')],'VoiceQueueId':_0x3a98b4[_0x5a2f9f]['id'],'interface':_0xe8a9b7,'paused':_0x278b76[_0xf5f2('0x58')]||![],'penalty':_0x3a98b4[_0x5a2f9f][_0xf5f2('0x59')]||0x0}));}return BPromise[_0xf5f2('0x4c')](_0xe3ea1e);}}}})[_0xf5f2('0x11')](function(){if(_0x278b76){return db[_0xf5f2('0x3e')][_0xf5f2('0x1e')]({'where':{'membername':_0x278b76[_0xf5f2('0x2b')],'exitAt':null}});}})[_0xf5f2('0x11')](function(_0x26b251){if(_0x278b76){if(_0x26b251&&_0x26b251[_0xf5f2('0x32')]){var _0x2afeac=[];_0x26b251[_0xf5f2('0x37')](function(_0x1680a6){_0x2afeac[_0xf5f2('0x38')](_0x1680a6[_0xf5f2('0x30')]({'exitAt':moment()[_0xf5f2('0x33')](_0xf5f2('0x34'))}));});return BPromise['all'](_0x2afeac);}}})[_0xf5f2('0x11')](function(_0x35299d){if(_0x278b76){var _0x21043b=[];var _0x2811ad=[];var _0x18c353=utils[_0xf5f2('0x36')]();var _0x16491c={'membername':_0x278b76[_0xf5f2('0x2b')],'interface':_0xe8a9b7,'enterAt':moment()['format'](_0xf5f2('0x34')),'role':_0x278b76['role'],'internal':_0x278b76['internal']};_0x18c353['forEach'](function(_0x53449e){_0x21043b['push'](_['merge']({'channel':_0x53449e,'type':_0xf5f2('0x5a'),'data1':_0xf5f2('0x5b'),'data2':_0xe8a9b7},_0x16491c));if(_0x278b76[_0xf5f2('0x58')]){_0x2811ad[_0xf5f2('0x38')](_[_0xf5f2('0x5c')]({'channel':_0x53449e,'type':_0xf5f2('0x31'),'data1':'LOGININPAUSE'},_0x16491c));}});return db['MemberReport'][_0xf5f2('0x3f')](_0x21043b['concat'](_0x2811ad),{'individualHooks':!![]});}})[_0xf5f2('0x11')](function(){if(_0x278b76){return _0x278b76[_0xf5f2('0x30')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x278b76[_0xf5f2('0x58')]||![],'mailPause':_0x278b76[_0xf5f2('0x58')]||![],'chatPause':_0x278b76['loginInPause']||![],'faxPause':_0x278b76[_0xf5f2('0x58')]||![],'smsPause':_0x278b76[_0xf5f2('0x58')]||![],'openchannelPause':_0x278b76['loginInPause']||![],'pauseType':_0x278b76[_0xf5f2('0x58')]?_0xf5f2('0x5d'):null,'lastPauseAt':moment()[_0xf5f2('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0xe8a9b7});}})[_0xf5f2('0x11')](function(_0xc28adc){_0x55da4d(_0xc28adc);})[_0xf5f2('0x1c')](function(_0x3247c4){_0x4d878e(_0x450691[_0xf5f2('0x17')](0x1f4,_0x3247c4[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index fee6b04..a5d4f22 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 _0x800f=['user:','./user.events','save','remove','update','emit','removeListener','register','length'];(function(_0x20ed00,_0x2232cc){var _0x3053da=function(_0x489b5b){while(--_0x489b5b){_0x20ed00['push'](_0x20ed00['shift']());}};_0x3053da(++_0x2232cc);}(_0x800f,0x12a));var _0xf800=function(_0x56f20a,_0x6caa6a){_0x56f20a=_0x56f20a-0x0;var _0x55e98a=_0x800f[_0x56f20a];return _0x55e98a;};'use strict';var UserEvents=require(_0xf800('0x0'));var events=[_0xf800('0x1'),_0xf800('0x2'),_0xf800('0x3')];function createListener(_0x43c65c,_0x451167){return function(_0x28ecf6){_0x451167[_0xf800('0x4')](_0x43c65c,_0x28ecf6);};}function removeListener(_0x5c7027,_0x35f000){return function(){UserEvents[_0xf800('0x5')](_0x5c7027,_0x35f000);};}exports[_0xf800('0x6')]=function(_0xa388e8){for(var _0x36d640=0x0,_0x1345a4=events[_0xf800('0x7')];_0x36d640<_0x1345a4;_0x36d640++){var _0x2330b2=events[_0x36d640];var _0x47f16c=createListener(_0xf800('0x8')+_0x2330b2,_0xa388e8);UserEvents['on'](_0x2330b2,_0x47f16c);}}; \ No newline at end of file +var _0x19ce=['register','user:','save','remove','emit','removeListener'];(function(_0x3036b4,_0x31d286){var _0x18d3f6=function(_0x2a44b3){while(--_0x2a44b3){_0x3036b4['push'](_0x3036b4['shift']());}};_0x18d3f6(++_0x31d286);}(_0x19ce,0xe0));var _0xe19c=function(_0x5aa43d,_0x590c4c){_0x5aa43d=_0x5aa43d-0x0;var _0x43395a=_0x19ce[_0x5aa43d];return _0x43395a;};'use strict';var UserEvents=require('./user.events');var events=[_0xe19c('0x0'),_0xe19c('0x1'),'update'];function createListener(_0x4b9de7,_0x572692){return function(_0x5c95be){_0x572692[_0xe19c('0x2')](_0x4b9de7,_0x5c95be);};}function removeListener(_0x5a3dd3,_0x50f18b){return function(){UserEvents[_0xe19c('0x3')](_0x5a3dd3,_0x50f18b);};}exports[_0xe19c('0x4')]=function(_0x35da52){for(var _0xe268f4=0x0,_0x14aa23=events['length'];_0xe268f4<_0x14aa23;_0xe268f4++){var _0x589c46=events[_0xe268f4];var _0x236c15=createListener(_0xe19c('0x5')+_0x589c46,_0x35da52);UserEvents['on'](_0x589c46,_0x236c15);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 99f9154..9302cf0 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 _0x8ace=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x188650,_0xc40d8){_0x188650=_0x188650-0x0;var _0x4db216=_0x8ace[_0x188650];return _0x4db216;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var auth=require(_0xe8ac('0x6'));var interaction=require(_0xe8ac('0x7'));var config=require(_0xe8ac('0x8'));module[_0xe8ac('0x9')]=router; \ No newline at end of file +var _0xacf4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacf4,0xe7));var _0x4acf=function(_0xb358eb,_0x1c49c8){_0xb358eb=_0xb358eb-0x0;var _0x486599=_0xacf4[_0xb358eb];return _0x486599;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var auth=require(_0x4acf('0x4'));var interaction=require(_0x4acf('0x5'));var config=require(_0x4acf('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 6ba5a33..0f92e0e 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 _0xd26a=['exports'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0xd26a,0x164));var _0xad26=function(_0x55c31d,_0x343c9c){_0x55c31d=_0x55c31d-0x0;var _0x4315a5=_0xd26a[_0x55c31d];return _0x4315a5;};'use strict';var Sequelize=require('sequelize');module[_0xad26('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa670=['exports'];(function(_0xdcbd19,_0x22f540){var _0x58c39a=function(_0x3945c8){while(--_0x3945c8){_0xdcbd19['push'](_0xdcbd19['shift']());}};_0x58c39a(++_0x22f540);}(_0xa670,0x19b));var _0x0a67=function(_0x386863,_0x1359a6){_0x386863=_0x386863-0x0;var _0x539f12=_0xa670[_0x386863];return _0x539f12;};'use strict';var Sequelize=require('sequelize');module[_0x0a67('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index a560320..2fc1d6f 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 _0x8e04=['request-promise','rimraf','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','../../config/logger','api','bluebird'];(function(_0x548912,_0x53ecdc){var _0x535454=function(_0x1fab63){while(--_0x1fab63){_0x548912['push'](_0x548912['shift']());}};_0x535454(++_0x53ecdc);}(_0x8e04,0x1e3));var _0x48e0=function(_0x2bc8e0,_0x38204a){_0x2bc8e0=_0x2bc8e0-0x0;var _0xca8f97=_0x8e04[_0x2bc8e0];return _0xca8f97;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x48e0('0x0'))(_0x48e0('0x1'));var moment=require('moment');var BPromise=require(_0x48e0('0x2'));var rp=require(_0x48e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48e0('0x4'));var config=require('../../config/environment');var attributes=require(_0x48e0('0x5'));module['exports']=function(_0x2c15fa,_0x3a898c){return _0x2c15fa[_0x48e0('0x6')](_0x48e0('0x7'),attributes,{'tableName':_0x48e0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dac=['rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0x6dac,0x155));var _0xc6da=function(_0x407f43,_0x3a6bf4){_0x407f43=_0x407f43-0x0;var _0x2022cb=_0x6dac[_0x407f43];return _0x2022cb;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require('moment');var BPromise=require(_0xc6da('0x4'));var rp=require(_0xc6da('0x5'));var fs=require('fs');var path=require(_0xc6da('0x6'));var rimraf=require(_0xc6da('0x7'));var config=require(_0xc6da('0x8'));var attributes=require(_0xc6da('0x9'));module['exports']=function(_0x39db8f,_0x3479a0){return _0x39db8f[_0xc6da('0xa')](_0xc6da('0xb'),attributes,{'tableName':'user_has_chat_queues','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 0e70d73..6753fe0 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 _0x25d5=['../../config/environment','jayson/promise','http','request','then','UserChatQueue,\x20%s,\x20%s','debug','error','message','info','request\x20sent','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2f4408,_0x317c92){var _0x394be0=function(_0x2207a5){while(--_0x2207a5){_0x2f4408['push'](_0x2f4408['shift']());}};_0x394be0(++_0x317c92);}(_0x25d5,0x91));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x525d('0x0'));var util=require('util');var moment=require(_0x525d('0x1'));var BPromise=require('bluebird');var rs=require(_0x525d('0x2'));var fs=require('fs');var Redis=require(_0x525d('0x3'));var db=require(_0x525d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x525d('0x5'))(_0x525d('0x6'));var config=require(_0x525d('0x7'));var jayson=require(_0x525d('0x8'));var client=jayson['client'][_0x525d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x273141,_0x1a0233,_0x260f76){return new BPromise(function(_0x289b02,_0x119257){return client[_0x525d('0xa')](_0x273141,_0x260f76)[_0x525d('0xb')](function(_0x127ecf){logger['info'](_0x525d('0xc'),_0x1a0233,'request\x20sent');logger[_0x525d('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1a0233,'request\x20sent',JSON['stringify'](_0x127ecf));if(_0x127ecf[_0x525d('0xe')]){if(_0x127ecf[_0x525d('0xe')]['code']===0x1f4){logger[_0x525d('0xe')](_0x525d('0xc'),_0x1a0233,_0x127ecf[_0x525d('0xe')]['message']);return _0x119257(_0x127ecf[_0x525d('0xe')][_0x525d('0xf')]);}logger[_0x525d('0xe')](_0x525d('0xc'),_0x1a0233,_0x127ecf['error'][_0x525d('0xf')]);return _0x289b02(_0x127ecf[_0x525d('0xe')][_0x525d('0xf')]);}else{logger[_0x525d('0x10')](_0x525d('0xc'),_0x1a0233,_0x525d('0x11'));_0x289b02(_0x127ecf[_0x525d('0x12')][_0x525d('0xf')]);}})['catch'](function(_0x51dfca){logger[_0x525d('0xe')](_0x525d('0xc'),_0x1a0233,_0x51dfca);_0x119257(_0x51dfca);});});} \ No newline at end of file +var _0x27d1=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x263cc0,_0xf81a11){var _0x619e43=function(_0xca22aa){while(--_0xca22aa){_0x263cc0['push'](_0x263cc0['shift']());}};_0x619e43(++_0xf81a11);}(_0x27d1,0x132));var _0x127d=function(_0x6c58e5,_0x12d6b0){_0x6c58e5=_0x6c58e5-0x0;var _0x5bfc2a=_0x27d1[_0x6c58e5];return _0x5bfc2a;};'use strict';var _=require(_0x127d('0x0'));var util=require(_0x127d('0x1'));var moment=require(_0x127d('0x2'));var BPromise=require(_0x127d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x127d('0x4'));var db=require(_0x127d('0x5'))['db'];var utils=require(_0x127d('0x6'));var logger=require(_0x127d('0x7'))(_0x127d('0x8'));var config=require(_0x127d('0x9'));var jayson=require(_0x127d('0xa'));var client=jayson[_0x127d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x92839f,_0x288f06,_0x331b46){return new BPromise(function(_0x223994,_0x1b9da3){return client['request'](_0x92839f,_0x331b46)[_0x127d('0xc')](function(_0x4e2e8a){logger[_0x127d('0xd')](_0x127d('0xe'),_0x288f06,_0x127d('0xf'));logger[_0x127d('0x10')](_0x127d('0x11'),_0x288f06,_0x127d('0xf'),JSON[_0x127d('0x12')](_0x4e2e8a));if(_0x4e2e8a[_0x127d('0x13')]){if(_0x4e2e8a['error']['code']===0x1f4){logger['error'](_0x127d('0xe'),_0x288f06,_0x4e2e8a[_0x127d('0x13')][_0x127d('0x14')]);return _0x1b9da3(_0x4e2e8a[_0x127d('0x13')][_0x127d('0x14')]);}logger[_0x127d('0x13')](_0x127d('0xe'),_0x288f06,_0x4e2e8a['error'][_0x127d('0x14')]);return _0x223994(_0x4e2e8a[_0x127d('0x13')][_0x127d('0x14')]);}else{logger[_0x127d('0xd')](_0x127d('0xe'),_0x288f06,'request\x20sent');_0x223994(_0x4e2e8a[_0x127d('0x15')][_0x127d('0x14')]);}})[_0x127d('0x16')](function(_0x2ef30c){logger[_0x127d('0x13')](_0x127d('0xe'),_0x288f06,_0x2ef30c);_0x1b9da3(_0x2ef30c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 553b47d..d0e412d 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 _0xe9e7=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x4d74fd,_0x2f27d0){_0x4d74fd=_0x4d74fd-0x0;var _0x4fb861=_0xe9e7[_0x4d74fd];return _0x4fb861;};'use strict';var multer=require(_0x7e9e('0x0'));var util=require(_0x7e9e('0x1'));var path=require(_0x7e9e('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e9e('0x3'));var router=express[_0x7e9e('0x4')]();var auth=require(_0x7e9e('0x5'));var interaction=require(_0x7e9e('0x6'));var config=require(_0x7e9e('0x7'));module[_0x7e9e('0x8')]=router; \ No newline at end of file +var _0x3fc6=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x3aeb5d,_0x4356be){var _0x1a5960=function(_0x35313b){while(--_0x35313b){_0x3aeb5d['push'](_0x3aeb5d['shift']());}};_0x1a5960(++_0x4356be);}(_0x3fc6,0x115));var _0x63fc=function(_0x32de4a,_0x1a248f){_0x32de4a=_0x32de4a-0x0;var _0x30678e=_0x3fc6[_0x32de4a];return _0x30678e;};'use strict';var multer=require(_0x63fc('0x0'));var util=require('util');var path=require(_0x63fc('0x1'));var timeout=require(_0x63fc('0x2'));var express=require(_0x63fc('0x3'));var router=express[_0x63fc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x63fc('0x5'));var config=require(_0x63fc('0x6'));module[_0x63fc('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c4c6c37..08575aa 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 _0xb8dc=['sequelize','exports','INTEGER'];(function(_0x1f2488,_0x2ff33b){var _0x2434ac=function(_0x2e92ba){while(--_0x2e92ba){_0x1f2488['push'](_0x1f2488['shift']());}};_0x2434ac(++_0x2ff33b);}(_0xb8dc,0x159));var _0xcb8d=function(_0x5869dc,_0x3fa849){_0x5869dc=_0x5869dc-0x0;var _0x98ce9c=_0xb8dc[_0x5869dc];return _0x98ce9c;};'use strict';var Sequelize=require(_0xcb8d('0x0'));module[_0xcb8d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcb8d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x35b3=['sequelize','INTEGER','STRING'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x35b3,0xb1));var _0x335b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35b3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x335b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x335b('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x335b('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x335b('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 62c73d6..6ffebf2 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 _0x5326=['exports','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x5326,0x1d6));var _0x6532=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0x5326[_0x16b55f];return _0x391c2f;};'use strict';var _=require(_0x6532('0x0'));var util=require(_0x6532('0x1'));var logger=require(_0x6532('0x2'))(_0x6532('0x3'));var moment=require(_0x6532('0x4'));var BPromise=require(_0x6532('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6532('0x6'));var rimraf=require(_0x6532('0x7'));var config=require(_0x6532('0x8'));var attributes=require(_0x6532('0x9'));module[_0x6532('0xa')]=function(_0x3cd199,_0x15ec5c){return _0x3cd199['define'](_0x6532('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a64=['bluebird','rimraf','../../config/environment','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x70b06f,_0x57d602){var _0x2a1404=function(_0x16aac1){while(--_0x16aac1){_0x70b06f['push'](_0x70b06f['shift']());}};_0x2a1404(++_0x57d602);}(_0x6a64,0xed));var _0x46a6=function(_0x5569da,_0x1aa5df){_0x5569da=_0x5569da-0x0;var _0x48dfb2=_0x6a64[_0x5569da];return _0x48dfb2;};'use strict';var _=require(_0x46a6('0x0'));var util=require(_0x46a6('0x1'));var logger=require(_0x46a6('0x2'))(_0x46a6('0x3'));var moment=require(_0x46a6('0x4'));var BPromise=require(_0x46a6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x46a6('0x6'));var config=require(_0x46a6('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x46a6('0x8')]=function(_0x14e063,_0x143a76){return _0x14e063['define'](_0x46a6('0x9'),attributes,{'tableName':_0x46a6('0xa'),'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 7bf3151..19add6d 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 _0x9952=['UserFaxQueue,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xca8132,_0xeffaf9){var _0x5ceee0=function(_0x1b9f23){while(--_0x1b9f23){_0xca8132['push'](_0xca8132['shift']());}};_0x5ceee0(++_0xeffaf9);}(_0x9952,0x11c));var _0x2995=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x9952[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x2995('0x0'));var util=require(_0x2995('0x1'));var moment=require(_0x2995('0x2'));var BPromise=require(_0x2995('0x3'));var rs=require(_0x2995('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2995('0x5'))['db'];var utils=require(_0x2995('0x6'));var logger=require(_0x2995('0x7'))(_0x2995('0x8'));var config=require(_0x2995('0x9'));var jayson=require(_0x2995('0xa'));var client=jayson[_0x2995('0xb')][_0x2995('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x355d73,_0x32de11,_0x28863d){return new BPromise(function(_0x1ac14a,_0x12ba0f){return client['request'](_0x355d73,_0x28863d)[_0x2995('0xd')](function(_0xff8244){logger[_0x2995('0xe')](_0x2995('0xf'),_0x32de11,'request\x20sent');logger[_0x2995('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x32de11,'request\x20sent',JSON[_0x2995('0x11')](_0xff8244));if(_0xff8244[_0x2995('0x12')]){if(_0xff8244[_0x2995('0x12')]['code']===0x1f4){logger[_0x2995('0x12')](_0x2995('0xf'),_0x32de11,_0xff8244[_0x2995('0x12')][_0x2995('0x13')]);return _0x12ba0f(_0xff8244['error'][_0x2995('0x13')]);}logger[_0x2995('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x32de11,_0xff8244[_0x2995('0x12')][_0x2995('0x13')]);return _0x1ac14a(_0xff8244[_0x2995('0x12')]['message']);}else{logger[_0x2995('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x32de11,_0x2995('0x14'));_0x1ac14a(_0xff8244[_0x2995('0x15')][_0x2995('0x13')]);}})[_0x2995('0x16')](function(_0xf7c818){logger[_0x2995('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x32de11,_0xf7c818);_0x12ba0f(_0xf7c818);});});} \ No newline at end of file +var _0x92b1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92b1,0x137));var _0x192b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x92b1[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x192b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x192b('0x1'));var rs=require(_0x192b('0x2'));var fs=require('fs');var Redis=require(_0x192b('0x3'));var db=require(_0x192b('0x4'))['db'];var utils=require(_0x192b('0x5'));var logger=require(_0x192b('0x6'))(_0x192b('0x7'));var config=require(_0x192b('0x8'));var jayson=require(_0x192b('0x9'));var client=jayson[_0x192b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f439b,_0x3cbcca,_0x4c60b3){return new BPromise(function(_0x480d2c,_0x1dcdc5){return client[_0x192b('0xb')](_0x2f439b,_0x4c60b3)[_0x192b('0xc')](function(_0x38711a){logger['info'](_0x192b('0xd'),_0x3cbcca,_0x192b('0xe'));logger[_0x192b('0xf')](_0x192b('0x10'),_0x3cbcca,_0x192b('0xe'),JSON[_0x192b('0x11')](_0x38711a));if(_0x38711a[_0x192b('0x12')]){if(_0x38711a['error']['code']===0x1f4){logger[_0x192b('0x12')](_0x192b('0xd'),_0x3cbcca,_0x38711a['error'][_0x192b('0x13')]);return _0x1dcdc5(_0x38711a[_0x192b('0x12')][_0x192b('0x13')]);}logger[_0x192b('0x12')](_0x192b('0xd'),_0x3cbcca,_0x38711a[_0x192b('0x12')][_0x192b('0x13')]);return _0x480d2c(_0x38711a['error'][_0x192b('0x13')]);}else{logger[_0x192b('0x14')](_0x192b('0xd'),_0x3cbcca,_0x192b('0xe'));_0x480d2c(_0x38711a['result'][_0x192b('0x13')]);}})['catch'](function(_0x4efc1e){logger[_0x192b('0x12')](_0x192b('0xd'),_0x3cbcca,_0x4efc1e);_0x1dcdc5(_0x4efc1e);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8c7d654..0c72d37 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 _0x84e7=['../../components/interaction/service','../../config/environment','exports','util','path','express','Router'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x84e7,0x122));var _0x784e=function(_0xccbd69,_0x500cc0){_0xccbd69=_0xccbd69-0x0;var _0x2791bd=_0x84e7[_0xccbd69];return _0x2791bd;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x784e('0x4'));var config=require(_0x784e('0x5'));module[_0x784e('0x6')]=router; \ No newline at end of file +var _0x6691=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x6691,0x12d));var _0x1669=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6691[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var path=require(_0x1669('0x2'));var timeout=require(_0x1669('0x3'));var express=require(_0x1669('0x4'));var router=express[_0x1669('0x5')]();var auth=require(_0x1669('0x6'));var interaction=require(_0x1669('0x7'));var config=require(_0x1669('0x8'));module[_0x1669('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 74d9e0f..e13cfc3 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 _0xcbb0=['exports','INTEGER','sequelize'];(function(_0x5238b0,_0x318fc5){var _0x44ba69=function(_0x4e3306){while(--_0x4e3306){_0x5238b0['push'](_0x5238b0['shift']());}};_0x44ba69(++_0x318fc5);}(_0xcbb0,0x86));var _0x0cbb=function(_0x108349,_0x3029c2){_0x108349=_0x108349-0x0;var _0x450e2d=_0xcbb0[_0x108349];return _0x450e2d;};'use strict';var Sequelize=require(_0x0cbb('0x0'));module[_0x0cbb('0x1')]={'penalty':{'type':Sequelize[_0x0cbb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8434=['INTEGER','sequelize','exports'];(function(_0x44ca68,_0x286ef0){var _0x2175d4=function(_0x1aeeab){while(--_0x1aeeab){_0x44ca68['push'](_0x44ca68['shift']());}};_0x2175d4(++_0x286ef0);}(_0x8434,0xaf));var _0x4843=function(_0x585b12,_0x37215b){_0x585b12=_0x585b12-0x0;var _0x23fc48=_0x8434[_0x585b12];return _0x23fc48;};'use strict';var Sequelize=require(_0x4843('0x0'));module[_0x4843('0x1')]={'penalty':{'type':Sequelize[_0x4843('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 1460170..098d29a 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 _0xc1c6=['moment','request-promise','path','rimraf','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x30dba7,_0x2fb710){var _0x1a9a83=function(_0x1a2043){while(--_0x1a2043){_0x30dba7['push'](_0x30dba7['shift']());}};_0x1a9a83(++_0x2fb710);}(_0xc1c6,0xf7));var _0x6c1c=function(_0xbd6700,_0x554bf1){_0xbd6700=_0xbd6700-0x0;var _0x533f02=_0xc1c6[_0xbd6700];return _0x533f02;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue'];(function(_0x1db658,_0x8f4920){var _0x39e7c5=function(_0x5cb3c2){while(--_0x5cb3c2){_0x1db658['push'](_0x1db658['shift']());}};_0x39e7c5(++_0x8f4920);}(_0x6d38,0x1ef));var _0x86d3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6d38[_0x21a9d9];return _0x46adce;};'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':'user_has_mail_queues','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 8c806dd..79c6253 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 _0x23ab=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x23ab,0x141));var _0xb23a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x23ab[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xb23a('0x0'));var util=require(_0xb23a('0x1'));var moment=require(_0xb23a('0x2'));var BPromise=require(_0xb23a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb23a('0x4'));var db=require(_0xb23a('0x5'))['db'];var utils=require(_0xb23a('0x6'));var logger=require('../../config/logger')(_0xb23a('0x7'));var config=require(_0xb23a('0x8'));var jayson=require(_0xb23a('0x9'));var client=jayson[_0xb23a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a68e6,_0x4e9ffd,_0xf11b8){return new BPromise(function(_0x5d120b,_0x59559e){return client[_0xb23a('0xb')](_0x4a68e6,_0xf11b8)['then'](function(_0x3bfcde){logger[_0xb23a('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x4e9ffd,_0xb23a('0xd'));logger[_0xb23a('0xe')](_0xb23a('0xf'),_0x4e9ffd,_0xb23a('0xd'),JSON[_0xb23a('0x10')](_0x3bfcde));if(_0x3bfcde[_0xb23a('0x11')]){if(_0x3bfcde[_0xb23a('0x11')][_0xb23a('0x12')]===0x1f4){logger[_0xb23a('0x11')](_0xb23a('0x13'),_0x4e9ffd,_0x3bfcde[_0xb23a('0x11')][_0xb23a('0x14')]);return _0x59559e(_0x3bfcde[_0xb23a('0x11')]['message']);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x4e9ffd,_0x3bfcde[_0xb23a('0x11')][_0xb23a('0x14')]);return _0x5d120b(_0x3bfcde[_0xb23a('0x11')]['message']);}else{logger[_0xb23a('0xc')](_0xb23a('0x13'),_0x4e9ffd,_0xb23a('0xd'));_0x5d120b(_0x3bfcde[_0xb23a('0x15')][_0xb23a('0x14')]);}})[_0xb23a('0x16')](function(_0x1d70ce){logger[_0xb23a('0x11')](_0xb23a('0x13'),_0x4e9ffd,_0x1d70ce);_0x59559e(_0x1d70ce);});});} \ No newline at end of file +var _0xe9ad=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x59bde8,_0x4e6fbc){var _0x27cb44=function(_0x29275e){while(--_0x29275e){_0x59bde8['push'](_0x59bde8['shift']());}};_0x27cb44(++_0x4e6fbc);}(_0xe9ad,0x19f));var _0xde9a=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe9ad[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xde9a('0x0'));var moment=require(_0xde9a('0x1'));var BPromise=require(_0xde9a('0x2'));var rs=require(_0xde9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde9a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde9a('0x5'))('rpc');var config=require(_0xde9a('0x6'));var jayson=require(_0xde9a('0x7'));var client=jayson['client'][_0xde9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4af542,_0x2dc9ae,_0x5c11f8){return new BPromise(function(_0x1dbcad,_0x3b5a47){return client[_0xde9a('0x9')](_0x4af542,_0x5c11f8)[_0xde9a('0xa')](function(_0x66bcd6){logger[_0xde9a('0xb')](_0xde9a('0xc'),_0x2dc9ae,_0xde9a('0xd'));logger[_0xde9a('0xe')](_0xde9a('0xf'),_0x2dc9ae,_0xde9a('0xd'),JSON[_0xde9a('0x10')](_0x66bcd6));if(_0x66bcd6[_0xde9a('0x11')]){if(_0x66bcd6[_0xde9a('0x11')]['code']===0x1f4){logger[_0xde9a('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x2dc9ae,_0x66bcd6[_0xde9a('0x11')][_0xde9a('0x12')]);return _0x3b5a47(_0x66bcd6[_0xde9a('0x11')][_0xde9a('0x12')]);}logger[_0xde9a('0x11')](_0xde9a('0xc'),_0x2dc9ae,_0x66bcd6[_0xde9a('0x11')][_0xde9a('0x12')]);return _0x1dbcad(_0x66bcd6[_0xde9a('0x11')]['message']);}else{logger[_0xde9a('0xb')](_0xde9a('0xc'),_0x2dc9ae,'request\x20sent');_0x1dbcad(_0x66bcd6[_0xde9a('0x13')][_0xde9a('0x12')]);}})[_0xde9a('0x14')](function(_0x440f01){logger[_0xde9a('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x2dc9ae,_0x440f01);_0x3b5a47(_0x440f01);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 276d92e..038699e 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 _0x5785=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2c3458,_0x1f7efd){var _0x3f7e02=function(_0x261040){while(--_0x261040){_0x2c3458['push'](_0x2c3458['shift']());}};_0x3f7e02(++_0x1f7efd);}(_0x5785,0x119));var _0x5578=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5785[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var path=require(_0x5578('0x2'));var timeout=require(_0x5578('0x3'));var express=require(_0x5578('0x4'));var router=express['Router']();var auth=require(_0x5578('0x5'));var interaction=require(_0x5578('0x6'));var config=require(_0x5578('0x7'));module[_0x5578('0x8')]=router; \ No newline at end of file +var _0x565e=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x226e37,_0x2aa91f){var _0x2ea61b=function(_0x48a0be){while(--_0x48a0be){_0x226e37['push'](_0x226e37['shift']());}};_0x2ea61b(++_0x2aa91f);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe565('0x0'));var util=require('util');var path=require(_0xe565('0x1'));var timeout=require(_0xe565('0x2'));var express=require(_0xe565('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe565('0x4'));var config=require(_0xe565('0x5'));module[_0xe565('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 7a5d5f0..8a97157 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 _0x29e1=['sequelize','INTEGER'];(function(_0x4e46e5,_0x1a9f55){var _0x1ec9ab=function(_0x1cf81b){while(--_0x1cf81b){_0x4e46e5['push'](_0x4e46e5['shift']());}};_0x1ec9ab(++_0x1a9f55);}(_0x29e1,0x104));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x129e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x129e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ade=['sequelize','exports','INTEGER'];(function(_0x185a07,_0x4e5375){var _0x383013=function(_0x43ffc8){while(--_0x43ffc8){_0x185a07['push'](_0x185a07['shift']());}};_0x383013(++_0x4e5375);}(_0x4ade,0x11a));var _0xe4ad=function(_0x2c54e1,_0x3ffd5c){_0x2c54e1=_0x2c54e1-0x0;var _0x48ac03=_0x4ade[_0x2c54e1];return _0x48ac03;};'use strict';var Sequelize=require(_0xe4ad('0x0'));module[_0xe4ad('0x1')]={'penalty':{'type':Sequelize[_0xe4ad('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 d9bbb2e..0c60172 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 _0x37ce=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x58c50e,_0x573495){var _0x4a8199=function(_0x2f237c){while(--_0x2f237c){_0x58c50e['push'](_0x58c50e['shift']());}};_0x4a8199(++_0x573495);}(_0x37ce,0xae));var _0xe37c=function(_0xefa698,_0x6d9541){_0xefa698=_0xefa698-0x0;var _0x11a62f=_0x37ce[_0xefa698];return _0x11a62f;};'use strict';var _=require(_0xe37c('0x0'));var util=require(_0xe37c('0x1'));var logger=require(_0xe37c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe37c('0x3'));var rp=require(_0xe37c('0x4'));var fs=require('fs');var path=require(_0xe37c('0x5'));var rimraf=require(_0xe37c('0x6'));var config=require(_0xe37c('0x7'));var attributes=require(_0xe37c('0x8'));module['exports']=function(_0x36c9d2,_0xceef3a){return _0x36c9d2[_0xe37c('0x9')](_0xe37c('0xa'),attributes,{'tableName':_0xe37c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76e0=['moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','util','../../config/logger','api'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0x76e0,0xc5));var _0x076e=function(_0x450541,_0xcab9bc){_0x450541=_0x450541-0x0;var _0x54910=_0x76e0[_0x450541];return _0x54910;};'use strict';var _=require('lodash');var util=require(_0x076e('0x0'));var logger=require(_0x076e('0x1'))(_0x076e('0x2'));var moment=require(_0x076e('0x3'));var BPromise=require(_0x076e('0x4'));var rp=require(_0x076e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x076e('0x6'));var config=require(_0x076e('0x7'));var attributes=require(_0x076e('0x8'));module['exports']=function(_0x1edad6,_0x1a9028){return _0x1edad6['define'](_0x076e('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 8ba3ddd..0105ba8 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 _0xcffe=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xcffe,0x65));var _0xecff=function(_0x4f7fc6,_0x554d2f){_0x4f7fc6=_0x4f7fc6-0x0;var _0x235170=_0xcffe[_0x4f7fc6];return _0x235170;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var moment=require('moment');var BPromise=require(_0xecff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecff('0x3'));var db=require(_0xecff('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecff('0x5'));var config=require(_0xecff('0x6'));var jayson=require(_0xecff('0x7'));var client=jayson[_0xecff('0x8')][_0xecff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a660a,_0x543a97,_0x10c795){return new BPromise(function(_0x4ca6b8,_0x468887){return client[_0xecff('0xa')](_0x2a660a,_0x10c795)[_0xecff('0xb')](function(_0x463705){logger[_0xecff('0xc')](_0xecff('0xd'),_0x543a97,'request\x20sent');logger[_0xecff('0xe')](_0xecff('0xf'),_0x543a97,_0xecff('0x10'),JSON[_0xecff('0x11')](_0x463705));if(_0x463705['error']){if(_0x463705[_0xecff('0x12')][_0xecff('0x13')]===0x1f4){logger['error'](_0xecff('0xd'),_0x543a97,_0x463705[_0xecff('0x12')]['message']);return _0x468887(_0x463705[_0xecff('0x12')]['message']);}logger['error'](_0xecff('0xd'),_0x543a97,_0x463705['error']['message']);return _0x4ca6b8(_0x463705[_0xecff('0x12')][_0xecff('0x14')]);}else{logger[_0xecff('0xc')](_0xecff('0xd'),_0x543a97,'request\x20sent');_0x4ca6b8(_0x463705['result'][_0xecff('0x14')]);}})[_0xecff('0x15')](function(_0x20ffbe){logger[_0xecff('0x12')](_0xecff('0xd'),_0x543a97,_0x20ffbe);_0x468887(_0x20ffbe);});});} \ No newline at end of file +var _0x9753=['../../config/utils','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9753,0x94));var _0x3975=function(_0x3e5595,_0xbe4275){_0x3e5595=_0x3e5595-0x0;var _0x3fd3a6=_0x9753[_0x3e5595];return _0x3fd3a6;};'use strict';var _=require('lodash');var util=require(_0x3975('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3975('0x1'));var fs=require('fs');var Redis=require(_0x3975('0x2'));var db=require(_0x3975('0x3'))['db'];var utils=require(_0x3975('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3975('0x5'));var client=jayson[_0x3975('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27952e,_0x369e25,_0x11f5b9){return new BPromise(function(_0x3851e1,_0xe7b6d8){return client[_0x3975('0x7')](_0x27952e,_0x11f5b9)['then'](function(_0x2b7a5d){logger[_0x3975('0x8')](_0x3975('0x9'),_0x369e25,_0x3975('0xa'));logger[_0x3975('0xb')](_0x3975('0xc'),_0x369e25,_0x3975('0xa'),JSON[_0x3975('0xd')](_0x2b7a5d));if(_0x2b7a5d['error']){if(_0x2b7a5d[_0x3975('0xe')][_0x3975('0xf')]===0x1f4){logger[_0x3975('0xe')](_0x3975('0x9'),_0x369e25,_0x2b7a5d[_0x3975('0xe')][_0x3975('0x10')]);return _0xe7b6d8(_0x2b7a5d[_0x3975('0xe')]['message']);}logger[_0x3975('0xe')](_0x3975('0x9'),_0x369e25,_0x2b7a5d['error'][_0x3975('0x10')]);return _0x3851e1(_0x2b7a5d['error'][_0x3975('0x10')]);}else{logger[_0x3975('0x8')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x369e25,_0x3975('0xa'));_0x3851e1(_0x2b7a5d[_0x3975('0x11')][_0x3975('0x10')]);}})[_0x3975('0x12')](function(_0x2c4073){logger['error'](_0x3975('0x9'),_0x369e25,_0x2c4073);_0xe7b6d8(_0x2c4073);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 270d66e..f6ac2c5 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 _0x62f1=['/describe','/:id','show','/:id/resources','post','create','clone','addSections','addResources','put','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','./userProfile.controller','get','isAuthenticated','index'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x62f1,0x1c1));var _0x162f=function(_0x236a4a,_0x1bf351){_0x236a4a=_0x236a4a-0x0;var _0x5a2b58=_0x62f1[_0x236a4a];return _0x5a2b58;};'use strict';var multer=require(_0x162f('0x0'));var util=require(_0x162f('0x1'));var path=require(_0x162f('0x2'));var timeout=require(_0x162f('0x3'));var express=require(_0x162f('0x4'));var router=express[_0x162f('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x162f('0x6'));router[_0x162f('0x7')]('/',auth[_0x162f('0x8')](),controller[_0x162f('0x9')]);router[_0x162f('0x7')](_0x162f('0xa'),auth[_0x162f('0x8')](),controller['describe']);router[_0x162f('0x7')](_0x162f('0xb'),auth['isAuthenticated'](),controller[_0x162f('0xc')]);router[_0x162f('0x7')](_0x162f('0xd'),auth[_0x162f('0x8')](),controller['getResources']);router[_0x162f('0xe')]('/',auth[_0x162f('0x8')](),controller[_0x162f('0xf')]);router[_0x162f('0xe')]('/:id/clone',auth[_0x162f('0x8')](),controller[_0x162f('0x10')]);router[_0x162f('0xe')]('/:id/sections',auth['isAuthenticated'](),controller[_0x162f('0x11')]);router['post'](_0x162f('0xd'),auth[_0x162f('0x8')](),controller[_0x162f('0x12')]);router[_0x162f('0x13')](_0x162f('0xb'),auth[_0x162f('0x8')](),controller[_0x162f('0x14')]);router[_0x162f('0x15')](_0x162f('0xb'),auth['isAuthenticated'](),controller[_0x162f('0x16')]);router[_0x162f('0x15')](_0x162f('0x17'),auth[_0x162f('0x8')](),controller[_0x162f('0x18')]);router['delete']('/:id/resources',auth[_0x162f('0x8')](),controller[_0x162f('0x19')]);module[_0x162f('0x1a')]=router; \ No newline at end of file +var _0x89ce=['update','delete','removeSections','removeResources','exports','util','path','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id/resources','getResources','post','create','/:id/clone','/:id/sections','addSections','addResources','/:id'];(function(_0x1788f8,_0x1a5c0c){var _0x31330d=function(_0xf81409){while(--_0xf81409){_0x1788f8['push'](_0x1788f8['shift']());}};_0x31330d(++_0x1a5c0c);}(_0x89ce,0x13d));var _0xe89c=function(_0x2ee0b6,_0x376780){_0x2ee0b6=_0x2ee0b6-0x0;var _0x196a19=_0x89ce[_0x2ee0b6];return _0x196a19;};'use strict';var multer=require('multer');var util=require(_0xe89c('0x0'));var path=require(_0xe89c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe89c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe89c('0x3'));var controller=require(_0xe89c('0x4'));router['get']('/',auth[_0xe89c('0x5')](),controller[_0xe89c('0x6')]);router[_0xe89c('0x7')](_0xe89c('0x8'),auth['isAuthenticated'](),controller[_0xe89c('0x9')]);router[_0xe89c('0x7')]('/:id',auth[_0xe89c('0x5')](),controller['show']);router['get'](_0xe89c('0xa'),auth[_0xe89c('0x5')](),controller[_0xe89c('0xb')]);router[_0xe89c('0xc')]('/',auth['isAuthenticated'](),controller[_0xe89c('0xd')]);router['post'](_0xe89c('0xe'),auth[_0xe89c('0x5')](),controller['clone']);router[_0xe89c('0xc')](_0xe89c('0xf'),auth[_0xe89c('0x5')](),controller[_0xe89c('0x10')]);router[_0xe89c('0xc')](_0xe89c('0xa'),auth[_0xe89c('0x5')](),controller[_0xe89c('0x11')]);router['put'](_0xe89c('0x12'),auth[_0xe89c('0x5')](),controller[_0xe89c('0x13')]);router[_0xe89c('0x14')](_0xe89c('0x12'),auth[_0xe89c('0x5')](),controller['destroy']);router[_0xe89c('0x14')]('/:id/sections',auth[_0xe89c('0x5')](),controller[_0xe89c('0x15')]);router['delete'](_0xe89c('0xa'),auth[_0xe89c('0x5')](),controller[_0xe89c('0x16')]);module[_0xe89c('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index cd6b20a..4bf56d9 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 _0x29a0=['setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x29a0,0xf2));var _0x029a=function(_0x1eee8a,_0x287f65){_0x1eee8a=_0x1eee8a-0x0;var _0x3b9381=_0x29a0[_0x1eee8a];return _0x3b9381;};'use strict';var Sequelize=require(_0x029a('0x0'));module[_0x029a('0x1')]={'name':{'type':Sequelize[_0x029a('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x029a('0x2')],'set':function(_0x4a74fd){this[_0x029a('0x3')](_0x029a('0x4'),_0x4a74fd?_0x4a74fd[_0x029a('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x029a('0x4'))?this[_0x029a('0x6')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x029a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa457=['STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3abef9,_0x42fcd6){var _0x197797=function(_0xf4c14d){while(--_0xf4c14d){_0x3abef9['push'](_0x3abef9['shift']());}};_0x197797(++_0x42fcd6);}(_0xa457,0xb4));var _0x7a45=function(_0x477e3b,_0x207251){_0x477e3b=_0x477e3b-0x0;var _0x4dda3e=_0xa457[_0x477e3b];return _0x4dda3e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7a45('0x0')],'allowNull':![],'unique':_0x7a45('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x13c709){this[_0x7a45('0x2')](_0x7a45('0x3'),_0x13c709?_0x13c709[_0x7a45('0x4')](''):[]);},'get':function(){return this[_0x7a45('0x5')]('crudPermissions')?this['getDataValue'](_0x7a45('0x3'))['split'](''):[];},'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 ceea163..bcd2637 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 _0xcd4e=['then','stack','name','index','UserProfile','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','key','field','count','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','get','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','map','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','addResources','sequelize','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','ignore','union','nolimit','pick','VIRTUAL','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','CustomReports','CmContact','Tags','color','Tag','ThroughTags','tag','value','resourceId','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','chatwebsites','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','teams','Team','voicequeues','VoiceQueues','users','telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','CannedAnswer','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','templates','triggers','Trigger','trunks','Variable','plugins','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0xcd4e,0x187));var _0xecd4=function(_0x514ae5,_0x13e1cc){_0x514ae5=_0x514ae5-0x0;var _0x13ee2b=_0xcd4e[_0x514ae5];return _0x13ee2b;};'use strict';var pdf=require(_0xecd4('0x0'));var emlformat=require(_0xecd4('0x1'));var rimraf=require(_0xecd4('0x2'));var zipdir=require(_0xecd4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xecd4('0x4'));var BPromise=require(_0xecd4('0x5'));var Mustache=require('mustache');var util=require(_0xecd4('0x6'));var path=require('path');var sox=require(_0xecd4('0x7'));var csv=require('to-csv');var ejs=require(_0xecd4('0x8'));var fs=require('fs');var _=require(_0xecd4('0x9'));var squel=require(_0xecd4('0xa'));var crypto=require(_0xecd4('0xb'));var jsforce=require(_0xecd4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xecd4('0xd'));var querystring=require(_0xecd4('0xe'));var Papa=require('papaparse');var Redis=require(_0xecd4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xecd4('0x10'));var hardwareService=require(_0xecd4('0x11'));var logger=require(_0xecd4('0x12'))('api');var utils=require(_0xecd4('0x13'));var config=require(_0xecd4('0x14'));var db=require('../../mysqldb')['db'];config[_0xecd4('0x15')]=_['defaults'](config[_0xecd4('0x15')],{'host':_0xecd4('0x16'),'port':0x18eb});var socket=require(_0xecd4('0x17'))(new Redis(config[_0xecd4('0x15')]));require(_0xecd4('0x18'))['register'](socket);function respondWithStatusCode(_0x3645d1,_0x21cb7b){_0x21cb7b=_0x21cb7b||0xcc;return function(_0x15dddc){if(_0x15dddc){return _0x3645d1[_0xecd4('0x19')](_0x21cb7b);}return _0x3645d1[_0xecd4('0x1a')](_0x21cb7b)[_0xecd4('0x1b')]();};}function respondWithResult(_0x2add6f,_0x39d681){_0x39d681=_0x39d681||0xc8;return function(_0x1fb460){if(_0x1fb460){return _0x2add6f['status'](_0x39d681)[_0xecd4('0x1c')](_0x1fb460);}};}function respondWithFilteredResult(_0x10d1e7,_0x41d3c6){return function(_0x2b542c){if(_0x2b542c){var _0x3eb6d0=_0x2b542c['count'],_0x2470ec=_0x41d3c6[_0xecd4('0x1d')],_0x4e11f3=_0x41d3c6[_0xecd4('0x1d')]+_0x41d3c6[_0xecd4('0x1e')],_0x703bb4;if(_0x4e11f3>=_0x3eb6d0){_0x4e11f3=_0x3eb6d0;_0x703bb4=0xc8;}else{_0x703bb4=0xce;}_0x10d1e7[_0xecd4('0x1a')](_0x703bb4);return _0x10d1e7[_0xecd4('0x1f')](_0xecd4('0x20'),_0x2470ec+'-'+_0x4e11f3+'/'+_0x3eb6d0)[_0xecd4('0x1c')](_0x2b542c);}return null;};}function patchUpdates(_0x26bb76){return function(_0x21d7d1){try{jsonpatch[_0xecd4('0x21')](_0x21d7d1,_0x26bb76,!![]);}catch(_0x14d24c){return BPromise['reject'](_0x14d24c);}return _0x21d7d1[_0xecd4('0x22')]();};}function saveUpdates(_0x353f13,_0x269451){return function(_0x588f0b){if(_0x588f0b){return _0x588f0b[_0xecd4('0x23')](_0x353f13)['then'](function(_0x57ae55){return _0x57ae55;});}return null;};}function removeEntity(_0x2e5a0a,_0x11c791){return function(_0x104507){if(_0x104507){return _0x104507[_0xecd4('0x24')]()[_0xecd4('0x25')](function(){_0x2e5a0a[_0xecd4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2910e1,_0x38b6da){return function(_0x1b76d7){if(!_0x1b76d7){_0x2910e1['sendStatus'](0x194);}return _0x1b76d7;};}function handleError(_0x2d0a43,_0x3941d4){_0x3941d4=_0x3941d4||0x1f4;return function(_0x3ccb67){logger['error'](_0x3ccb67[_0xecd4('0x26')]);if(_0x3ccb67[_0xecd4('0x27')]){delete _0x3ccb67['name'];}_0x2d0a43[_0xecd4('0x1a')](_0x3941d4)['send'](_0x3ccb67);};}exports[_0xecd4('0x28')]=function(_0x40b76f,_0x40d0a2){var _0x5e509a={},_0x3b1ef0={},_0x48e059={'count':0x0,'rows':[]};var _0x220ec5=db[_0xecd4('0x29')]['rawAttributes'];_0x3b1ef0[_0xecd4('0x2a')]=_[_0xecd4('0x2b')](_0x220ec5);_0x3b1ef0[_0xecd4('0x2c')]=_[_0xecd4('0x2b')](_0x40b76f[_0xecd4('0x2c')]);_0x3b1ef0[_0xecd4('0x2d')]=_['intersection'](_0x3b1ef0[_0xecd4('0x2a')],_0x3b1ef0[_0xecd4('0x2c')]);_0x5e509a['attributes']=_[_0xecd4('0x2e')](_0x3b1ef0[_0xecd4('0x2a')],qs['fields'](_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x2f')]));_0x5e509a[_0xecd4('0x30')]=_0x5e509a[_0xecd4('0x30')][_0xecd4('0x31')]?_0x5e509a[_0xecd4('0x30')]:_0x3b1ef0[_0xecd4('0x2a')];if(!_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x32')]('nolimit')){_0x5e509a[_0xecd4('0x1e')]=qs[_0xecd4('0x1e')](_0x40b76f[_0xecd4('0x2c')]['limit']);_0x5e509a[_0xecd4('0x1d')]=qs[_0xecd4('0x1d')](_0x40b76f['query']['offset']);}_0x5e509a[_0xecd4('0x33')]=qs['sort'](_0x40b76f['query'][_0xecd4('0x34')]);_0x5e509a[_0xecd4('0x35')]=qs[_0xecd4('0x2d')](_['pick'](_0x40b76f['query'],_0x3b1ef0[_0xecd4('0x2d')]));if(_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x36')]){_0x5e509a[_0xecd4('0x35')]=_[_0xecd4('0x37')](_0x5e509a[_0xecd4('0x35')],{'$or':_['map'](_0x220ec5,function(_0x4a648f){if(_0x4a648f[_0xecd4('0x38')][_0xecd4('0x39')]!=='VIRTUAL'){var _0x2cc276={};_0x2cc276[_0x4a648f[_0xecd4('0x3a')]]={'$like':'%'+_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x36')]+'%'};return _0x2cc276;}})});}_0x5e509a=_['merge']({},_0x5e509a,_0x40b76f['options']);var _0xd8a55b={'where':_0x5e509a[_0xecd4('0x35')]};return db[_0xecd4('0x29')][_0xecd4('0x3b')](_0xd8a55b)[_0xecd4('0x25')](function(_0x32c1db){_0x48e059['count']=_0x32c1db;if(_0x40b76f['query']['includeAll']){_0x5e509a[_0xecd4('0x3c')]=[{'all':!![]}];}return db['UserProfile'][_0xecd4('0x3d')](_0x5e509a);})['then'](function(_0x3a30b4){_0x48e059[_0xecd4('0x3e')]=_0x3a30b4;return _0x48e059;})['then'](respondWithFilteredResult(_0x40d0a2,_0x5e509a))['catch'](handleError(_0x40d0a2,null));};exports[_0xecd4('0x3f')]=function(_0x107dcb,_0x38da48){var _0x4dad07={'raw':![],'where':{'id':_0x107dcb[_0xecd4('0x40')]['id']}},_0x127feb={};_0x127feb[_0xecd4('0x2a')]=_['keys'](db[_0xecd4('0x29')][_0xecd4('0x41')]);_0x127feb[_0xecd4('0x2c')]=_[_0xecd4('0x2b')](_0x107dcb[_0xecd4('0x2c')]);_0x127feb[_0xecd4('0x2d')]=_['intersection'](_0x127feb[_0xecd4('0x2a')],_0x127feb[_0xecd4('0x2c')]);_0x4dad07[_0xecd4('0x30')]=_['intersection'](_0x127feb[_0xecd4('0x2a')],qs[_0xecd4('0x2f')](_0x107dcb['query'][_0xecd4('0x2f')]));_0x4dad07['attributes']=_0x4dad07[_0xecd4('0x30')][_0xecd4('0x31')]?_0x4dad07[_0xecd4('0x30')]:_0x127feb[_0xecd4('0x2a')];if(_0x107dcb[_0xecd4('0x2c')][_0xecd4('0x42')]){_0x4dad07[_0xecd4('0x3c')]=[{'all':!![]}];}_0x4dad07=_[_0xecd4('0x37')]({},_0x4dad07,_0x107dcb['options']);return db['UserProfile'][_0xecd4('0x43')](_0x4dad07)[_0xecd4('0x25')](handleEntityNotFound(_0x38da48,null))[_0xecd4('0x25')](respondWithResult(_0x38da48,null))[_0xecd4('0x44')](handleError(_0x38da48,null));};exports[_0xecd4('0x45')]=function(_0x3df41d,_0x580bd2){return db[_0xecd4('0x29')][_0xecd4('0x45')](_0x3df41d[_0xecd4('0x46')],{})[_0xecd4('0x25')](respondWithResult(_0x580bd2,0xc9))[_0xecd4('0x44')](handleError(_0x580bd2,null));};exports['clone']=function(_0x483483,_0x35888c){var _0x3074a8={'raw':![],'where':{'id':_0x483483[_0xecd4('0x40')]['id']}},_0x52baf3={};_0x52baf3[_0xecd4('0x2a')]=_[_0xecd4('0x2b')](db[_0xecd4('0x29')][_0xecd4('0x41')]);_0x3074a8[_0xecd4('0x30')]=_['intersection'](_0x52baf3['model'],qs[_0xecd4('0x2f')](_0x483483[_0xecd4('0x2c')][_0xecd4('0x2f')]));_0x3074a8[_0xecd4('0x30')]=_0x3074a8[_0xecd4('0x30')]['length']?_0x3074a8[_0xecd4('0x30')]:_0x52baf3[_0xecd4('0x2a')];if(_0x483483[_0xecd4('0x2c')][_0xecd4('0x42')]){_0x3074a8[_0xecd4('0x3c')]=[{'all':!![]}];}_0x3074a8=_['merge']({},_0x3074a8,_0x483483['options']);return db['UserProfile']['find'](_0x3074a8)[_0xecd4('0x25')](handleEntityNotFound(_0x35888c,null))['then'](function(_0x1af2ab){if(_0x1af2ab){var _0xb17fee=_0x1af2ab[_0xecd4('0x47')]({'plain':!![]});_0xb17fee=qs[_0xecd4('0x48')](_0xb17fee,['id','createdAt',_0xecd4('0x49'),_0xecd4('0x4a')]);_0x483483[_0xecd4('0x46')]=_[_0xecd4('0x48')](_0x483483[_0xecd4('0x46')],['id',_0xecd4('0x4b'),_0xecd4('0x49')]);return db['sequelize'][_0xecd4('0x4c')](function(_0x547688){return db['UserProfile'][_0xecd4('0x45')](_[_0xecd4('0x37')](_0xb17fee,_0x483483[_0xecd4('0x46')]),{'include':_0x483483['query'][_0xecd4('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x547688})['then'](function(_0xca6077){var _0x5f0ff3=_0xca6077[_0xecd4('0x47')]({'plain':!![]});return db[_0xecd4('0x4d')]['findAll']({'where':{'userProfileId':_0x483483['params']['id']},'raw':!![]})[_0xecd4('0x25')](function(_0x4914f2){if(_0x4914f2){return BPromise[_0xecd4('0x4e')](_0x4914f2,function(_0x332877){return new BPromise(function(_0x389c51,_0x52ca85){if(_0x332877[_0xecd4('0x4f')]===null||_0x332877[_0xecd4('0x4f')]===0x1)_0x389c51(null);return db[_0xecd4('0x50')][_0xecd4('0x3d')]({'where':{'sectionId':_0x332877['id']},'raw':!![]})['then'](function(_0x354de9){var _0x106a2a=_[_0xecd4('0x51')](_0x354de9,function(_0x2e87f1){return qs['omit'](_0x2e87f1,['id',_0xecd4('0x4b'),'updatedAt',_0xecd4('0x52')]);});_0x389c51(_0x106a2a);})[_0xecd4('0x44')](function(_0x508c07){_0x52ca85(_0x508c07);});})[_0xecd4('0x25')](function(_0x12852e){var _0xb59285=qs[_0xecd4('0x48')](_0x332877,['id','createdAt',_0xecd4('0x49')]);_0xb59285[_0xecd4('0x53')]=_0x5f0ff3['id'];if(_0x12852e)_0xb59285['Resources']=_0x12852e;return _0xb59285;})[_0xecd4('0x25')](function(_0x2c95cc){return db[_0xecd4('0x4d')][_0xecd4('0x45')](_0x2c95cc,{'include':[{'model':db[_0xecd4('0x50')],'as':_0xecd4('0x54')}],'raw':!![],'transaction':_0x547688});});})[_0xecd4('0x25')](function(){return _0x5f0ff3;});}});});});}})[_0xecd4('0x25')](respondWithResult(_0x35888c,0xc9))[_0xecd4('0x44')](handleError(_0x35888c,null));};exports[_0xecd4('0x23')]=function(_0x3352ae,_0x26263c){if(_0x3352ae[_0xecd4('0x46')]['id']){delete _0x3352ae['body']['id'];}return db['UserProfile'][_0xecd4('0x43')]({'where':{'id':_0x3352ae[_0xecd4('0x40')]['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x26263c,null))['then'](saveUpdates(_0x3352ae[_0xecd4('0x46')],null))[_0xecd4('0x25')](respondWithResult(_0x26263c,null))['catch'](handleError(_0x26263c,null));};exports['destroy']=function(_0x295eb4,_0x4188b8){return db[_0xecd4('0x29')][_0xecd4('0x43')]({'where':{'id':_0x295eb4['params']['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x4188b8,null))[_0xecd4('0x25')](removeEntity(_0x4188b8,null))[_0xecd4('0x44')](handleError(_0x4188b8,null));};exports[_0xecd4('0x55')]=function(_0x1fe33a,_0xc813dc){return db['UserProfile'][_0xecd4('0x55')]()[_0xecd4('0x25')](respondWithResult(_0xc813dc,null))[_0xecd4('0x44')](handleError(_0xc813dc,null));};exports[_0xecd4('0x56')]=function(_0x12b840,_0x363f8c){var _0x1f5622=_0x12b840[_0xecd4('0x46')];return db['UserProfile'][_0xecd4('0x43')]({'where':{'id':_0x12b840[_0xecd4('0x40')]['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x363f8c,null))[_0xecd4('0x25')](function(_0x53479c){if(_0x53479c){return db['sequelize']['transaction'](function(_0x6553f5){return db[_0xecd4('0x4d')][_0xecd4('0x24')]({'where':{'userProfileId':_0x12b840['params']['id'],'sectionId':_[_0xecd4('0x51')](_0x1f5622,function(_0x15ae5e){return _0x15ae5e[_0xecd4('0x52')];})},'transaction':_0x6553f5})[_0xecd4('0x25')](function(){var _0x56777b=_[_0xecd4('0x51')](_0x1f5622,function(_0x1c5fbf){_0x1c5fbf[_0xecd4('0x53')]=_0x12b840[_0xecd4('0x40')]['id'];return _0x1c5fbf;});var _0x176952=[];return BPromise['each'](_0x56777b,function(_0x561cff){return db[_0xecd4('0x4d')]['create'](_0x561cff,{'include':[{'model':db[_0xecd4('0x50')],'as':'Resources'}],'raw':!![],'transaction':_0x6553f5})[_0xecd4('0x25')](function(_0x31f4fa){_0x176952[_0xecd4('0x57')](_0x31f4fa[_0xecd4('0x47')]({'plain':!![]}));});})[_0xecd4('0x25')](function(){return _0x176952;});});});}})[_0xecd4('0x25')](function(_0x48f1d5){return _0x48f1d5;})[_0xecd4('0x25')](respondWithResult(_0x363f8c,null))[_0xecd4('0x44')](handleError(_0x363f8c,null));};exports[_0xecd4('0x58')]=function(_0x154a43,_0x2ca8d7){var _0x21624b;return db['UserProfile'][_0xecd4('0x43')]({'where':{'id':_0x154a43[_0xecd4('0x40')]['id']},'attributes':['id',_0xecd4('0x27')]})['then'](handleEntityNotFound(_0x2ca8d7,null))[_0xecd4('0x25')](function(_0x2ed5be){if(_0x2ed5be){_0x21624b=_0x2ed5be;return db[_0xecd4('0x4d')][_0xecd4('0x24')]({'where':{'userProfileId':_0x154a43[_0xecd4('0x40')]['id'],'sectionId':_0x154a43[_0xecd4('0x2c')][_0xecd4('0x59')]}});}})[_0xecd4('0x25')](function(){return _0x21624b;})[_0xecd4('0x25')](respondWithStatusCode(_0x2ca8d7,null))[_0xecd4('0x44')](handleError(_0x2ca8d7,null));};exports[_0xecd4('0x5a')]=function(_0x339bf3,_0x3a654a){return db[_0xecd4('0x29')][_0xecd4('0x43')]({'where':{'id':_0x339bf3[_0xecd4('0x40')]['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x3a654a,null))[_0xecd4('0x25')](function(_0x19bc17){if(_0x19bc17){return db[_0xecd4('0x5b')][_0xecd4('0x4c')](function(_0x1ad74c){return db[_0xecd4('0x4d')]['findAll']({'where':{'userProfileId':_0x339bf3[_0xecd4('0x40')]['id']},'attributes':['id'],'raw':!![]})[_0xecd4('0x25')](function(_0x32e6df){if(_0x32e6df){return db[_0xecd4('0x4d')][_0xecd4('0x24')]({'where':{'userProfileId':_0x339bf3[_0xecd4('0x40')]['id'],'id':_['map'](_0x32e6df,function(_0x51b6a2){return _0x51b6a2['id'];})},'transaction':_0x1ad74c});}})[_0xecd4('0x25')](function(_0x3a6aa3){var _0x46060d=_[_0xecd4('0x51')](_0x339bf3[_0xecd4('0x46')],function(_0x5b3a6c){_0x5b3a6c[_0xecd4('0x53')]=_0x339bf3[_0xecd4('0x40')]['id'];return _0x5b3a6c;});return db[_0xecd4('0x4d')]['bulkCreate'](_0x46060d,{'raw':!![],'transaction':_0x1ad74c});})['then'](function(_0x4842f8){var _0x57c9ce=_[_0xecd4('0x36')](_['map'](_0x4842f8,function(_0x216bc6){return _0x216bc6[_0xecd4('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x57c9ce){return db[_0xecd4('0x4d')]['findAll']({'where':{'userProfileId':_0x339bf3[_0xecd4('0x40')]['id'],'sectionId':_[_0xecd4('0x51')](_0x57c9ce,function(_0x838c6e){return _0x838c6e[_0xecd4('0x52')];})},'attributes':['id',_0xecd4('0x52')],'raw':!![]})[_0xecd4('0x25')](function(_0x47ade6){var _0x4b1345=_[_0xecd4('0x51')](_0x339bf3['body'],function(_0x104e6a){_0x104e6a[_0xecd4('0x53')]=_0x339bf3[_0xecd4('0x40')]['id'];return _0x104e6a;});return db[_0xecd4('0x50')][_0xecd4('0x5c')](_0x4b1345,{'raw':!![],'transaction':_0x1ad74c});});}})[_0xecd4('0x44')](handleError(_0x3a654a,null));});}})[_0xecd4('0x25')](function(_0x5590bc){var _0x31391b=_[_0xecd4('0x51')](_0x5590bc,function(_0x20ee7e){return _0x20ee7e[_0xecd4('0x47')]({'plain':!![]});});})[_0xecd4('0x25')](respondWithResult(_0x3a654a,null))[_0xecd4('0x44')](handleError(_0x3a654a,null));};exports[_0xecd4('0x5d')]=function(_0x56362e,_0x8b3961,_0xd89f38){return db[_0xecd4('0x29')]['find']({'where':{'id':_0x56362e[_0xecd4('0x40')]['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x8b3961,null))[_0xecd4('0x25')](function(_0x692bbf){if(_0x692bbf){return _0x692bbf[_0xecd4('0x5d')](_0x56362e['query'][_0xecd4('0x59')]);}})[_0xecd4('0x25')](respondWithStatusCode(_0x8b3961,null))[_0xecd4('0x44')](handleError(_0x8b3961,null));};exports[_0xecd4('0x5e')]=function(_0x833d47,_0x2235b0){var _0x44309f={'raw':![],'where':{}};var _0x489697={};var _0x5c263c={'count':0x0,'rows':[]};var _0x13461c=_0x833d47['query']['section'];if(typeof _0x13461c===_0xecd4('0x5f')){throw new db[(_0xecd4('0x60'))][(_0xecd4('0x61'))]('Unknown\x20section');}var _0x534456=_0x833d47[_0xecd4('0x2c')][_0xecd4('0x62')]||![];var _0x32a599=getQueryModels(_0x13461c,_0x534456);if(typeof _0x32a599[_0xecd4('0x63')]===_0xecd4('0x5f')){throw new db[(_0xecd4('0x60'))][(_0xecd4('0x61'))](_0xecd4('0x64')+_0x13461c+'\x27');}var _0x3d75af=[];if(!_[_0xecd4('0x65')](_0x32a599['parentSections'])){_0x3d75af=_0x32a599[_0xecd4('0x66')];}else{_0x3d75af=[{'name':_0x13461c}];}return db[_0xecd4('0x29')][_0xecd4('0x67')]({'where':{'id':_0x833d47[_0xecd4('0x40')]['id']}})[_0xecd4('0x25')](handleEntityNotFound(_0x2235b0,null))[_0xecd4('0x25')](function(_0x50e99c){if(_0x50e99c){var _0x17ca9a=[];for(var _0x45cc14=0x0;_0x45cc14<_0x3d75af['length'];_0x45cc14++){_0x17ca9a['push'](db[_0xecd4('0x4d')][_0xecd4('0x67')]({'where':{'userProfileId':_0x50e99c['id'],'name':_0x3d75af[_0x45cc14]['name']},'raw':!![]}));}return BPromise['all'](_0x17ca9a);}})[_0xecd4('0x25')](function(_0x18888e){var _0x327c0f=_[_0xecd4('0x36')](_0x18888e,function(_0x4240ad){return _0x4240ad?_0x4240ad:undefined;});var _0x54daba=_[_0xecd4('0x36')](_0x3d75af,[_0xecd4('0x68'),!![]]);var _0x28d8e2=_[_0xecd4('0x65')](_0x327c0f)&&_[_0xecd4('0x65')](_0x54daba)?null:_[_0xecd4('0x69')](_0x54daba,_0x327c0f);if(_0x28d8e2){var _0xbefb6a=[];for(var _0x4d727d=0x0;_0x4d727d<_0x28d8e2[_0xecd4('0x31')];_0x4d727d++){var _0x5a5e91=_[_0xecd4('0x43')](_0x3d75af,function(_0x4e6459){return _0x28d8e2[_0x4d727d]?_0x4e6459[_0xecd4('0x27')]===_0x28d8e2[_0x4d727d]['name']:null;});if(_0x5a5e91){if(_0x28d8e2[_0x4d727d]['ignore']){_0xbefb6a[_0xecd4('0x57')](getAllResources(_0x32a599['childModel'],_0x28d8e2[_0x4d727d]));}else{if(!_0x28d8e2[_0x4d727d][_0xecd4('0x4f')]){_0xbefb6a[_0xecd4('0x57')](getAllowedResources(_0x5a5e91,_0x28d8e2[_0x4d727d],_0x32a599[_0xecd4('0x63')]));}else{if(_0x5a5e91[_0xecd4('0x2a')]){_0xbefb6a['push'](getAllFilteredResources(_0x5a5e91,_0x28d8e2[_0x4d727d]));}}}}}return BPromise['all'](_0xbefb6a);}else{return null;}})[_0xecd4('0x25')](function(_0x1c9e12){var _0x445b28=_0x1c9e12;var _0xe61df0=null;if(_0x445b28){_0xe61df0=_0x445b28[_0xecd4('0x31')]===0x1?_0x445b28[0x0]:null;}if(_0xe61df0||_0x445b28){var _0x2ab325=db[_0x32a599[_0xecd4('0x63')]]['rawAttributes'];_0x489697[_0xecd4('0x2a')]=_[_0xecd4('0x2b')](_0x2ab325);_0x489697[_0xecd4('0x2c')]=_['keys'](_0x833d47[_0xecd4('0x2c')]);_0x489697[_0xecd4('0x2d')]=_[_0xecd4('0x2e')](_0x489697[_0xecd4('0x2a')],_0x489697['query']);_0x44309f[_0xecd4('0x30')]=_[_0xecd4('0x2e')](_0x489697[_0xecd4('0x2a')],qs[_0xecd4('0x2f')](_0x833d47[_0xecd4('0x2c')][_0xecd4('0x2f')]));_0x44309f[_0xecd4('0x30')]=_0x44309f[_0xecd4('0x30')][_0xecd4('0x31')]?_0x44309f['attributes']:_0x489697['model'];if(!_0x833d47['query'][_0xecd4('0x32')](_0xecd4('0x6a'))){_0x44309f[_0xecd4('0x1e')]=qs[_0xecd4('0x1e')](_0x833d47[_0xecd4('0x2c')][_0xecd4('0x1e')]);_0x44309f[_0xecd4('0x1d')]=qs['offset'](_0x833d47[_0xecd4('0x2c')]['offset']);}_0x44309f[_0xecd4('0x33')]=qs[_0xecd4('0x34')](_0x833d47[_0xecd4('0x2c')][_0xecd4('0x34')]);_0x44309f[_0xecd4('0x35')]=qs[_0xecd4('0x2d')](_[_0xecd4('0x6b')](_0x833d47[_0xecd4('0x2c')],_0x489697['filters']));if(_0x833d47['query'][_0xecd4('0x36')]){_0x44309f[_0xecd4('0x35')]=_['merge'](_0x44309f[_0xecd4('0x35')],{'$or':_[_0xecd4('0x51')](_0x2ab325,function(_0xc6082){if(_0xc6082[_0xecd4('0x38')]['key']!==_0xecd4('0x6c')){var _0x453ef1={};_0x453ef1[_0xc6082['field']]={'$like':'%'+_0x833d47[_0xecd4('0x2c')][_0xecd4('0x36')]+'%'};return _0x453ef1;}})});}var _0x63bb54=[];if(_0xe61df0){var _0x1f6920=_[_0xecd4('0x43')](_0x3d75af,['name',_0xe61df0[_0xecd4('0x27')]]);if(_0x1f6920[_0xecd4('0x3a')]){var _0x10336e={};if(_0x32a599[_0xecd4('0x63')]===_0xecd4('0x6d')){_0x10336e[_0x1f6920['foreignKey']]=_[_0xecd4('0x51')](_0xe61df0['associatedResources'],'id');}else{_0x10336e[_0x1f6920[_0xecd4('0x6e')]]=_0xe61df0[_0xecd4('0x6f')];}_0x63bb54[_0xecd4('0x57')](_0x10336e);}else{_0x44309f['where']['id']=_0xe61df0[_0xecd4('0x6f')];}}else{for(var _0x13ba21=0x0;_0x13ba21<_0x445b28[_0xecd4('0x31')];_0x13ba21++){var _0x1f6920=_[_0xecd4('0x43')](_0x3d75af,[_0xecd4('0x27'),_0x445b28[_0x13ba21][_0xecd4('0x27')]]);if(_0x1f6920[_0xecd4('0x3a')]){var _0x10336e={};_0x10336e[_0x1f6920[_0xecd4('0x6e')]]=_0x445b28[_0x13ba21][_0xecd4('0x6f')];_0x63bb54[_0xecd4('0x57')](_0x10336e);}else{if(!_0x44309f[_0xecd4('0x35')]['id'])_0x44309f[_0xecd4('0x35')]['id']=[];_0x445b28[_0x13ba21][_0xecd4('0x6f')][_0xecd4('0x70')](function(_0x30f56c){_0x44309f['where']['id'][_0xecd4('0x57')](_0x30f56c);});}}}if(!_[_0xecd4('0x65')](_0x63bb54)){_0x44309f[_0xecd4('0x35')]=_[_0xecd4('0x37')](_0x44309f[_0xecd4('0x35')],{'$and':{'$or':_0x63bb54}});}_0x44309f=_[_0xecd4('0x37')]({},_0x44309f,_0x833d47['options']);if(_0xe61df0&&!_0xe61df0['autoAssociation']&&_0x32a599[_0xecd4('0x63')]===_0xecd4('0x6d')){if(_0x833d47['query']['includeAll']){_0x44309f[_0xecd4('0x3c')]=[{'all':!![]}];}return db[_0x32a599[_0xecd4('0x63')]][_0xecd4('0x3d')](_0x44309f)['then'](function(_0x546dfd){var _0x44453d=[];_0x546dfd[_0xecd4('0x70')](function(_0xb2fde6){var _0xeca94;switch(_0xb2fde6[_0xecd4('0x71')]){case _0xecd4('0x72'):_0xeca94=_[_0xecd4('0x43')](_0xe61df0['associatedResources'],function(_0x3f64be){return _0x3f64be['id']===_0xb2fde6[_0xecd4('0x73')]&&_0x3f64be[_0xecd4('0x38')]===_0xecd4('0x74');});break;case'custom':_0xeca94=_[_0xecd4('0x43')](_0xe61df0[_0xecd4('0x6f')],function(_0x3c8714){return _0x3c8714['id']===_0xb2fde6[_0xecd4('0x73')]&&_0x3c8714[_0xecd4('0x38')]===_0xecd4('0x75');});break;}if(_0xeca94)_0x44453d[_0xecd4('0x57')](_0xb2fde6);});_0x5c263c[_0xecd4('0x3b')]=_0x44453d[_0xecd4('0x31')];_0x5c263c['rows']=_0x44453d;return _0x5c263c;});}else{return db[_0x32a599[_0xecd4('0x63')]]['count']({'where':_0x44309f[_0xecd4('0x35')]})['then'](function(_0x5bd35a){_0x5c263c['count']=_0x5bd35a;if(_0x833d47[_0xecd4('0x2c')][_0xecd4('0x42')]){if(_0x32a599[_0xecd4('0x63')]===_0xecd4('0x76')){_0x44309f[_0xecd4('0x3c')]=[{'model':db['Tag'],'as':_0xecd4('0x77'),'attributes':['id',_0xecd4('0x27'),_0xecd4('0x78')],'required':_0x833d47[_0xecd4('0x2c')]['tag']?!![]:![]},{'model':db[_0xecd4('0x79')],'as':_0xecd4('0x7a'),'attributes':['id',_0xecd4('0x27'),_0xecd4('0x78')],'through':_0x833d47[_0xecd4('0x2c')][_0xecd4('0x7b')]?{'attributes':[],'where':{'TagId':_0x833d47[_0xecd4('0x2c')][_0xecd4('0x7b')]||undefined}}:{},'required':_0x833d47[_0xecd4('0x2c')][_0xecd4('0x7b')]?!![]:![]}];}else{_0x44309f['include']=[{'all':!![]}];}}return db[_0x32a599['childModel']]['findAll'](_0x44309f);})[_0xecd4('0x25')](function(_0x2c81ba){_0x5c263c[_0xecd4('0x3e')]=_0x2c81ba;return _0x5c263c;});}}else{return _0x5c263c;}})[_0xecd4('0x25')](respondWithFilteredResult(_0x2235b0,_0x44309f))[_0xecd4('0x44')](handleError(_0x2235b0,null));};function getAllResources(_0x3dac1f,_0x50fb56){return new BPromise(function(_0x2b4abf,_0xb5dbbd){if(_0x50fb56){var _0x2249ea=_0x50fb56[_0xecd4('0x36')]?{[_0x50fb56['filter'][_0xecd4('0x3a')]]:_0x50fb56[_0xecd4('0x36')][_0xecd4('0x7c')]}:undefined;return db[_0x3dac1f]['findAll']({'where':_0x2249ea,'raw':!![]})[_0xecd4('0x25')](function(_0x4e81d2){_0x50fb56[_0xecd4('0x6f')]=_[_0xecd4('0x51')](_0x4e81d2,'id');_0x2b4abf(_0x50fb56);})['catch'](function(_0x123716){_0xb5dbbd(_0x123716);});}else{_0x2b4abf(null);}});}function getAllFilteredResources(_0x4cadc7,_0x439cea){return new BPromise(function(_0x559f79,_0x5c1b54){var _0x733128=_0x4cadc7[_0xecd4('0x36')]?{[_0x4cadc7[_0xecd4('0x36')][_0xecd4('0x3a')]]:_0x4cadc7[_0xecd4('0x36')][_0xecd4('0x7c')]}:undefined;return db[_0x4cadc7[_0xecd4('0x2a')]][_0xecd4('0x3d')]({'where':_0x733128,'raw':!![]})[_0xecd4('0x25')](function(_0x2a2ccf){_0x439cea['associatedResources']=_[_0xecd4('0x51')](_0x2a2ccf,function(_0x52daac){return _0x52daac[_0xecd4('0x27')];});_0x559f79(_0x439cea);})['catch'](function(_0x209b78){_0x5c1b54(_0x209b78);});});}function getAllowedResources(_0x22d750,_0x275c02,_0x3002c5){return new BPromise(function(_0x2e320e,_0x262bbc){if(_0x275c02){return db[_0xecd4('0x50')][_0xecd4('0x3d')]({'where':{'sectionId':_0x275c02['id']},'raw':!![]})[_0xecd4('0x25')](function(_0x32946e){if(_0x22d750[_0xecd4('0x3a')]&&_0x22d750[_0xecd4('0x3a')]!=='id'){_0x275c02[_0xecd4('0x6f')]=_['map'](_0x32946e,function(_0x2ccad3){return _0x2ccad3[_0x22d750[_0xecd4('0x3a')]];});}else{if(_0x3002c5===_0xecd4('0x6d')){_0x275c02[_0xecd4('0x6f')]=_[_0xecd4('0x51')](_0x32946e,function(_0x3f16fc){return{'id':_0x3f16fc[_0xecd4('0x7d')],'type':_0x3f16fc['type']};});}else{_0x275c02[_0xecd4('0x6f')]=_[_0xecd4('0x51')](_0x32946e,function(_0x2b124f){return _0x2b124f[_0xecd4('0x7d')];});}}_0x2e320e(_0x275c02);})[_0xecd4('0x44')](function(_0x4e0927){_0x262bbc(_0x4e0927);});}else{_0x2e320e(null);}});}function getQueryModels(_0x11da8c,_0x4bed69){var _0x37c5d7=_0x11da8c[_0xecd4('0x7e')]();var _0x23f549={'childModel':undefined,'parentSections':[]};switch(_0x37c5d7){case'squareprojects':_0x23f549[_0xecd4('0x63')]=_0xecd4('0x7f');break;case _0xecd4('0x80'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x81');break;case _0xecd4('0x82'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x83');_0x23f549[_0xecd4('0x66')]=[{'name':_0xecd4('0x84'),'field':_0xecd4('0x27'),'foreignKey':'projectName'}];break;case _0xecd4('0x85'):_0x23f549[_0xecd4('0x63')]='JscriptyProject';break;case _0xecd4('0x86'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x76');_0x23f549['parentSections']=[{'name':_0xecd4('0x87'),'field':'id','foreignKey':_0xecd4('0x88')}];break;case _0xecd4('0x89'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x8a');break;case _0xecd4('0x8b'):_0x23f549[_0xecd4('0x63')]='CmCompany';break;case _0xecd4('0x8c'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x8d');break;case _0xecd4('0x8e'):_0x23f549[_0xecd4('0x63')]='ChatQueue';break;case _0xecd4('0x8f'):_0x23f549[_0xecd4('0x63')]='ChatWebsite';break;case _0xecd4('0x90'):_0x23f549[_0xecd4('0x63')]='FaxQueue';break;case'faxaccounts':_0x23f549['childModel']='FaxAccount';break;case _0xecd4('0x91'):case _0xecd4('0x92'):case _0xecd4('0x93'):_0x23f549['childModel']=_0xecd4('0x94');break;case _0xecd4('0x95'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x96');break;case _0xecd4('0x97'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0x98');break;case _0xecd4('0x99'):_0x23f549['childModel']=_0xecd4('0x9a');_0x23f549['parentSections']=[{'name':_0xecd4('0x9b'),'field':_0xecd4('0x27'),'foreignKey':_0xecd4('0x9c'),'model':_0xecd4('0x9d'),'filter':{'field':_0xecd4('0x9e'),'value':[_0xecd4('0x9f')]}},{'name':_0xecd4('0xa0'),'field':_0xecd4('0x27'),'foreignKey':_0xecd4('0x9c'),'model':'User','filter':{'field':_0xecd4('0x9e'),'value':['telephone']}},{'name':'VoiceQueues','field':_0xecd4('0x27'),'foreignKey':_0xecd4('0xa1'),'model':_0xecd4('0xa2'),'filter':{'field':_0xecd4('0x38'),'value':[_0xecd4('0xa3')]}},{'name':'QueueCampaigns','field':_0xecd4('0x27'),'foreignKey':'queue','model':_0xecd4('0xa2'),'filter':{'field':'type','value':[_0xecd4('0xa4')]}}];break;case _0xecd4('0xa5'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xa6');break;case _0xecd4('0xa7'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xa8');break;case _0xecd4('0xa9'):_0x23f549[_0xecd4('0x63')]='VoicePrefix';break;case _0xecd4('0xaa'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xab');break;case'mailqueues':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xac');break;case _0xecd4('0xad'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xae');break;case'mailsubstatuses':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xaf');break;case _0xecd4('0xb0'):_0x23f549['childModel']='OpenchannelQueue';break;case _0xecd4('0xb1'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xb2');break;case'smsqueues':_0x23f549[_0xecd4('0x63')]='SmsQueue';break;case _0xecd4('0xb3'):_0x23f549[_0xecd4('0x63')]='SmsAccount';break;case _0xecd4('0xb4'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xb5');break;case _0xecd4('0xb6'):case'queuecampaigns':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xa2');if(_0x4bed69){_0x23f549[_0xecd4('0x66')]=[{'name':_0xecd4('0xb7')},{'name':'QueueCampaigns'}];}break;case _0xecd4('0xb8'):case'agents':case _0xecd4('0xb9'):_0x23f549[_0xecd4('0x63')]='User';if(_0x4bed69){_0x23f549['parentSections']=[{'name':'Users','filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xecd4('0xba'):_0x23f549['childModel']=_0xecd4('0xbb');break;case _0xecd4('0xbc'):_0x23f549['childModel']=_0xecd4('0xbd');break;case'freshdeskaccounts':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xbe');break;case _0xecd4('0xbf'):_0x23f549['childModel']=_0xecd4('0xc0');break;case'deskaccounts':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xc1');break;case _0xecd4('0xc2'):_0x23f549[_0xecd4('0x63')]='ZohoAccount';break;case'vtigeraccounts':_0x23f549['childModel']='User';break;case'cannedanswers':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xc3');break;case'dispositions':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xc4');break;case _0xecd4('0xc5'):_0x23f549[_0xecd4('0x63')]='Dashboard';break;case'intervals':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xc6');break;case _0xecd4('0xc7'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xc8');break;case _0xecd4('0xc9'):_0x23f549['childModel']=_0xecd4('0xca');break;case _0xecd4('0xcb'):_0x23f549[_0xecd4('0x63')]='Sound';break;case _0xecd4('0xcc'):_0x23f549['childModel']=_0xecd4('0x79');break;case _0xecd4('0xcd'):_0x23f549[_0xecd4('0x63')]='Template';break;case _0xecd4('0xce'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xcf');break;case _0xecd4('0xd0'):_0x23f549[_0xecd4('0x63')]='Trunk';break;case'variables':_0x23f549[_0xecd4('0x63')]=_0xecd4('0xd1');break;case _0xecd4('0xd2'):_0x23f549[_0xecd4('0x63')]='Plugin';break;case'extractedreports':_0x23f549[_0xecd4('0x63')]=_0xecd4('0x6d');_0x23f549[_0xecd4('0x66')]=[{'name':_0xecd4('0xd3'),'field':'id','foreignKey':'reportId'}];break;case _0xecd4('0xd4'):_0x23f549[_0xecd4('0x63')]=_0xecd4('0xd5');break;default:return _0x23f549;}return _0x23f549;} \ No newline at end of file +var _0xf4dd=['length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','map','key','VIRTUAL','field','UserProfile','count','includeAll','include','findAll','rows','show','params','merge','find','catch','create','options','get','omit','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','destroy','describe','push','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','union','type','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','CmContact','Tag','Tags','ThroughTags','color','tag','value','resourceId','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','openchannelqueues','OpenchannelQueue','OpenchannelAccount','SmsQueue','SmsAccount','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','rawAttributes','model','keys','query','intersection','attributes','fields'];(function(_0x46cbc3,_0x4de7f2){var _0x393d44=function(_0x56926b){while(--_0x56926b){_0x46cbc3['push'](_0x46cbc3['shift']());}};_0x393d44(++_0x4de7f2);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x461587,_0x1ab500){_0x461587=_0x461587-0x0;var _0x1427d7=_0xf4dd[_0x461587];return _0x1427d7;};'use strict';var pdf=require(_0xdf4d('0x0'));var emlformat=require(_0xdf4d('0x1'));var rimraf=require(_0xdf4d('0x2'));var zipdir=require(_0xdf4d('0x3'));var jsonpatch=require(_0xdf4d('0x4'));var rp=require(_0xdf4d('0x5'));var moment=require(_0xdf4d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xdf4d('0x7'));var util=require('util');var path=require(_0xdf4d('0x8'));var sox=require('sox');var csv=require(_0xdf4d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf4d('0xa'));var squel=require('squel');var crypto=require(_0xdf4d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdf4d('0xc'));var toCsv=require(_0xdf4d('0x9'));var querystring=require(_0xdf4d('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf4d('0xe'));var authService=require(_0xdf4d('0xf'));var qs=require(_0xdf4d('0x10'));var hardwareService=require(_0xdf4d('0x11'));var logger=require(_0xdf4d('0x12'))(_0xdf4d('0x13'));var utils=require(_0xdf4d('0x14'));var config=require(_0xdf4d('0x15'));var db=require(_0xdf4d('0x16'))['db'];config['redis']=_[_0xdf4d('0x17')](config[_0xdf4d('0x18')],{'host':_0xdf4d('0x19'),'port':0x18eb});var socket=require(_0xdf4d('0x1a'))(new Redis(config[_0xdf4d('0x18')]));require(_0xdf4d('0x1b'))[_0xdf4d('0x1c')](socket);function respondWithStatusCode(_0x401b54,_0x380d5c){_0x380d5c=_0x380d5c||0xcc;return function(_0x16b3ac){if(_0x16b3ac){return _0x401b54[_0xdf4d('0x1d')](_0x380d5c);}return _0x401b54[_0xdf4d('0x1e')](_0x380d5c)[_0xdf4d('0x1f')]();};}function respondWithResult(_0x6cf76b,_0x2ec82d){_0x2ec82d=_0x2ec82d||0xc8;return function(_0x363c45){if(_0x363c45){return _0x6cf76b[_0xdf4d('0x1e')](_0x2ec82d)[_0xdf4d('0x20')](_0x363c45);}};}function respondWithFilteredResult(_0x357a70,_0x53c3c2){return function(_0x49f737){if(_0x49f737){var _0x41a7cc=_0x49f737['count'],_0x95b106=_0x53c3c2['offset'],_0x4f88c3=_0x53c3c2[_0xdf4d('0x21')]+_0x53c3c2['limit'],_0x4e02f8;if(_0x4f88c3>=_0x41a7cc){_0x4f88c3=_0x41a7cc;_0x4e02f8=0xc8;}else{_0x4e02f8=0xce;}_0x357a70[_0xdf4d('0x1e')](_0x4e02f8);return _0x357a70[_0xdf4d('0x22')](_0xdf4d('0x23'),_0x95b106+'-'+_0x4f88c3+'/'+_0x41a7cc)['json'](_0x49f737);}return null;};}function patchUpdates(_0x1a9031){return function(_0x112ead){try{jsonpatch[_0xdf4d('0x24')](_0x112ead,_0x1a9031,!![]);}catch(_0x2f44da){return BPromise[_0xdf4d('0x25')](_0x2f44da);}return _0x112ead[_0xdf4d('0x26')]();};}function saveUpdates(_0x264816,_0x3acc2d){return function(_0x176aad){if(_0x176aad){return _0x176aad[_0xdf4d('0x27')](_0x264816)[_0xdf4d('0x28')](function(_0x3556dc){return _0x3556dc;});}return null;};}function removeEntity(_0x3c67c4,_0x3e96a0){return function(_0x150096){if(_0x150096){return _0x150096['destroy']()[_0xdf4d('0x28')](function(){_0x3c67c4['status'](0xcc)[_0xdf4d('0x1f')]();});}};}function handleEntityNotFound(_0x5e6009,_0x3a8a1c){return function(_0x507bda){if(!_0x507bda){_0x5e6009['sendStatus'](0x194);}return _0x507bda;};}function handleError(_0x3e727b,_0xe65528){_0xe65528=_0xe65528||0x1f4;return function(_0x34eed9){logger[_0xdf4d('0x29')](_0x34eed9['stack']);if(_0x34eed9[_0xdf4d('0x2a')]){delete _0x34eed9[_0xdf4d('0x2a')];}_0x3e727b[_0xdf4d('0x1e')](_0xe65528)[_0xdf4d('0x2b')](_0x34eed9);};}exports['index']=function(_0x46d140,_0x292eab){var _0x470b38={},_0x44e031={},_0xcc737f={'count':0x0,'rows':[]};var _0xccf69d=db['UserProfile'][_0xdf4d('0x2c')];_0x44e031[_0xdf4d('0x2d')]=_[_0xdf4d('0x2e')](_0xccf69d);_0x44e031[_0xdf4d('0x2f')]=_[_0xdf4d('0x2e')](_0x46d140['query']);_0x44e031['filters']=_[_0xdf4d('0x30')](_0x44e031[_0xdf4d('0x2d')],_0x44e031[_0xdf4d('0x2f')]);_0x470b38[_0xdf4d('0x31')]=_[_0xdf4d('0x30')](_0x44e031['model'],qs[_0xdf4d('0x32')](_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x32')]));_0x470b38[_0xdf4d('0x31')]=_0x470b38[_0xdf4d('0x31')][_0xdf4d('0x33')]?_0x470b38['attributes']:_0x44e031[_0xdf4d('0x2d')];if(!_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x34')](_0xdf4d('0x35'))){_0x470b38[_0xdf4d('0x36')]=qs[_0xdf4d('0x36')](_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x36')]);_0x470b38['offset']=qs[_0xdf4d('0x21')](_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x21')]);}_0x470b38[_0xdf4d('0x37')]=qs['sort'](_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x38')]);_0x470b38['where']=qs[_0xdf4d('0x39')](_[_0xdf4d('0x3a')](_0x46d140[_0xdf4d('0x2f')],_0x44e031['filters']));if(_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x3b')]){_0x470b38[_0xdf4d('0x3c')]=_['merge'](_0x470b38[_0xdf4d('0x3c')],{'$or':_[_0xdf4d('0x3d')](_0xccf69d,function(_0x2d332b){if(_0x2d332b['type'][_0xdf4d('0x3e')]!==_0xdf4d('0x3f')){var _0x8e54d8={};_0x8e54d8[_0x2d332b[_0xdf4d('0x40')]]={'$like':'%'+_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x3b')]+'%'};return _0x8e54d8;}})});}_0x470b38=_['merge']({},_0x470b38,_0x46d140['options']);var _0x315bfb={'where':_0x470b38[_0xdf4d('0x3c')]};return db[_0xdf4d('0x41')][_0xdf4d('0x42')](_0x315bfb)['then'](function(_0x339304){_0xcc737f[_0xdf4d('0x42')]=_0x339304;if(_0x46d140[_0xdf4d('0x2f')][_0xdf4d('0x43')]){_0x470b38[_0xdf4d('0x44')]=[{'all':!![]}];}return db[_0xdf4d('0x41')][_0xdf4d('0x45')](_0x470b38);})['then'](function(_0xf65d01){_0xcc737f[_0xdf4d('0x46')]=_0xf65d01;return _0xcc737f;})[_0xdf4d('0x28')](respondWithFilteredResult(_0x292eab,_0x470b38))['catch'](handleError(_0x292eab,null));};exports[_0xdf4d('0x47')]=function(_0x45100d,_0x4cf396){var _0x25f309={'raw':![],'where':{'id':_0x45100d[_0xdf4d('0x48')]['id']}},_0x170243={};_0x170243['model']=_[_0xdf4d('0x2e')](db[_0xdf4d('0x41')][_0xdf4d('0x2c')]);_0x170243[_0xdf4d('0x2f')]=_[_0xdf4d('0x2e')](_0x45100d[_0xdf4d('0x2f')]);_0x170243['filters']=_[_0xdf4d('0x30')](_0x170243['model'],_0x170243[_0xdf4d('0x2f')]);_0x25f309[_0xdf4d('0x31')]=_[_0xdf4d('0x30')](_0x170243['model'],qs[_0xdf4d('0x32')](_0x45100d[_0xdf4d('0x2f')][_0xdf4d('0x32')]));_0x25f309[_0xdf4d('0x31')]=_0x25f309['attributes'][_0xdf4d('0x33')]?_0x25f309[_0xdf4d('0x31')]:_0x170243['model'];if(_0x45100d[_0xdf4d('0x2f')]['includeAll']){_0x25f309[_0xdf4d('0x44')]=[{'all':!![]}];}_0x25f309=_[_0xdf4d('0x49')]({},_0x25f309,_0x45100d['options']);return db['UserProfile'][_0xdf4d('0x4a')](_0x25f309)[_0xdf4d('0x28')](handleEntityNotFound(_0x4cf396,null))[_0xdf4d('0x28')](respondWithResult(_0x4cf396,null))[_0xdf4d('0x4b')](handleError(_0x4cf396,null));};exports[_0xdf4d('0x4c')]=function(_0x3bc248,_0x260c8b){return db[_0xdf4d('0x41')]['create'](_0x3bc248['body'],{})[_0xdf4d('0x28')](respondWithResult(_0x260c8b,0xc9))[_0xdf4d('0x4b')](handleError(_0x260c8b,null));};exports['clone']=function(_0xe091b1,_0x24af04){var _0xfb6985={'raw':![],'where':{'id':_0xe091b1[_0xdf4d('0x48')]['id']}},_0xab5b3b={};_0xab5b3b[_0xdf4d('0x2d')]=_[_0xdf4d('0x2e')](db['UserProfile']['rawAttributes']);_0xfb6985[_0xdf4d('0x31')]=_[_0xdf4d('0x30')](_0xab5b3b['model'],qs[_0xdf4d('0x32')](_0xe091b1['query'][_0xdf4d('0x32')]));_0xfb6985[_0xdf4d('0x31')]=_0xfb6985[_0xdf4d('0x31')][_0xdf4d('0x33')]?_0xfb6985[_0xdf4d('0x31')]:_0xab5b3b[_0xdf4d('0x2d')];if(_0xe091b1[_0xdf4d('0x2f')]['includeAll']){_0xfb6985[_0xdf4d('0x44')]=[{'all':!![]}];}_0xfb6985=_[_0xdf4d('0x49')]({},_0xfb6985,_0xe091b1[_0xdf4d('0x4d')]);return db[_0xdf4d('0x41')]['find'](_0xfb6985)['then'](handleEntityNotFound(_0x24af04,null))[_0xdf4d('0x28')](function(_0x54847){if(_0x54847){var _0x112690=_0x54847[_0xdf4d('0x4e')]({'plain':!![]});_0x112690=qs[_0xdf4d('0x4f')](_0x112690,['id','createdAt',_0xdf4d('0x50'),_0xdf4d('0x51')]);_0xe091b1[_0xdf4d('0x52')]=_[_0xdf4d('0x4f')](_0xe091b1[_0xdf4d('0x52')],['id','createdAt',_0xdf4d('0x50')]);return db[_0xdf4d('0x53')][_0xdf4d('0x54')](function(_0x202320){return db[_0xdf4d('0x41')][_0xdf4d('0x4c')](_[_0xdf4d('0x49')](_0x112690,_0xe091b1[_0xdf4d('0x52')]),{'include':_0xe091b1[_0xdf4d('0x2f')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x202320})['then'](function(_0x52ca60){var _0x38f721=_0x52ca60[_0xdf4d('0x4e')]({'plain':!![]});return db[_0xdf4d('0x55')][_0xdf4d('0x45')]({'where':{'userProfileId':_0xe091b1[_0xdf4d('0x48')]['id']},'raw':!![]})['then'](function(_0x3ccb6c){if(_0x3ccb6c){return BPromise[_0xdf4d('0x56')](_0x3ccb6c,function(_0x5b107a){return new BPromise(function(_0x174002,_0x5008e1){if(_0x5b107a[_0xdf4d('0x57')]===null||_0x5b107a[_0xdf4d('0x57')]===0x1)_0x174002(null);return db[_0xdf4d('0x58')][_0xdf4d('0x45')]({'where':{'sectionId':_0x5b107a['id']},'raw':!![]})[_0xdf4d('0x28')](function(_0x2927de){var _0x50cf77=_[_0xdf4d('0x3d')](_0x2927de,function(_0x33e643){return qs[_0xdf4d('0x4f')](_0x33e643,['id',_0xdf4d('0x59'),'updatedAt',_0xdf4d('0x5a')]);});_0x174002(_0x50cf77);})[_0xdf4d('0x4b')](function(_0x4bd66a){_0x5008e1(_0x4bd66a);});})[_0xdf4d('0x28')](function(_0x21f88f){var _0x5ad0c4=qs[_0xdf4d('0x4f')](_0x5b107a,['id','createdAt','updatedAt']);_0x5ad0c4[_0xdf4d('0x5b')]=_0x38f721['id'];if(_0x21f88f)_0x5ad0c4[_0xdf4d('0x5c')]=_0x21f88f;return _0x5ad0c4;})[_0xdf4d('0x28')](function(_0x1b5ca8){return db['UserProfileSection'][_0xdf4d('0x4c')](_0x1b5ca8,{'include':[{'model':db[_0xdf4d('0x58')],'as':_0xdf4d('0x5c')}],'raw':!![],'transaction':_0x202320});});})[_0xdf4d('0x28')](function(){return _0x38f721;});}});});});}})[_0xdf4d('0x28')](respondWithResult(_0x24af04,0xc9))[_0xdf4d('0x4b')](handleError(_0x24af04,null));};exports[_0xdf4d('0x27')]=function(_0xb02379,_0x3ea85f){if(_0xb02379['body']['id']){delete _0xb02379[_0xdf4d('0x52')]['id'];}return db[_0xdf4d('0x41')][_0xdf4d('0x4a')]({'where':{'id':_0xb02379[_0xdf4d('0x48')]['id']}})[_0xdf4d('0x28')](handleEntityNotFound(_0x3ea85f,null))['then'](saveUpdates(_0xb02379['body'],null))[_0xdf4d('0x28')](respondWithResult(_0x3ea85f,null))['catch'](handleError(_0x3ea85f,null));};exports[_0xdf4d('0x5d')]=function(_0x3c285e,_0x3957ab){return db['UserProfile'][_0xdf4d('0x4a')]({'where':{'id':_0x3c285e['params']['id']}})[_0xdf4d('0x28')](handleEntityNotFound(_0x3957ab,null))['then'](removeEntity(_0x3957ab,null))[_0xdf4d('0x4b')](handleError(_0x3957ab,null));};exports['describe']=function(_0x1c47b3,_0x25cc3c){return db['UserProfile'][_0xdf4d('0x5e')]()[_0xdf4d('0x28')](respondWithResult(_0x25cc3c,null))['catch'](handleError(_0x25cc3c,null));};exports['addSections']=function(_0x49bc60,_0x11c522){var _0x51ac2f=_0x49bc60[_0xdf4d('0x52')];return db[_0xdf4d('0x41')][_0xdf4d('0x4a')]({'where':{'id':_0x49bc60[_0xdf4d('0x48')]['id']}})[_0xdf4d('0x28')](handleEntityNotFound(_0x11c522,null))[_0xdf4d('0x28')](function(_0x129f4f){if(_0x129f4f){return db[_0xdf4d('0x53')][_0xdf4d('0x54')](function(_0x38ab2e){return db[_0xdf4d('0x55')]['destroy']({'where':{'userProfileId':_0x49bc60[_0xdf4d('0x48')]['id'],'sectionId':_['map'](_0x51ac2f,function(_0x57f86b){return _0x57f86b['sectionId'];})},'transaction':_0x38ab2e})['then'](function(){var _0x4d2757=_[_0xdf4d('0x3d')](_0x51ac2f,function(_0x3c5e87){_0x3c5e87[_0xdf4d('0x5b')]=_0x49bc60[_0xdf4d('0x48')]['id'];return _0x3c5e87;});var _0xa0ef15=[];return BPromise[_0xdf4d('0x56')](_0x4d2757,function(_0x41e61a){return db[_0xdf4d('0x55')][_0xdf4d('0x4c')](_0x41e61a,{'include':[{'model':db[_0xdf4d('0x58')],'as':_0xdf4d('0x5c')}],'raw':!![],'transaction':_0x38ab2e})['then'](function(_0x30d456){_0xa0ef15[_0xdf4d('0x5f')](_0x30d456[_0xdf4d('0x4e')]({'plain':!![]}));});})[_0xdf4d('0x28')](function(){return _0xa0ef15;});});});}})[_0xdf4d('0x28')](function(_0x2fbe62){return _0x2fbe62;})[_0xdf4d('0x28')](respondWithResult(_0x11c522,null))[_0xdf4d('0x4b')](handleError(_0x11c522,null));};exports[_0xdf4d('0x60')]=function(_0x57aa5e,_0x9c3bfc){var _0x4025b4;return db[_0xdf4d('0x41')][_0xdf4d('0x4a')]({'where':{'id':_0x57aa5e[_0xdf4d('0x48')]['id']},'attributes':['id',_0xdf4d('0x2a')]})[_0xdf4d('0x28')](handleEntityNotFound(_0x9c3bfc,null))['then'](function(_0x16925b){if(_0x16925b){_0x4025b4=_0x16925b;return db[_0xdf4d('0x55')]['destroy']({'where':{'userProfileId':_0x57aa5e['params']['id'],'sectionId':_0x57aa5e[_0xdf4d('0x2f')][_0xdf4d('0x61')]}});}})[_0xdf4d('0x28')](function(){return _0x4025b4;})[_0xdf4d('0x28')](respondWithStatusCode(_0x9c3bfc,null))[_0xdf4d('0x4b')](handleError(_0x9c3bfc,null));};exports[_0xdf4d('0x62')]=function(_0x3af3d1,_0x377e3f){return db[_0xdf4d('0x41')][_0xdf4d('0x4a')]({'where':{'id':_0x3af3d1['params']['id']}})[_0xdf4d('0x28')](handleEntityNotFound(_0x377e3f,null))[_0xdf4d('0x28')](function(_0x48794d){if(_0x48794d){return db[_0xdf4d('0x53')]['transaction'](function(_0x1bfd59){return db[_0xdf4d('0x55')][_0xdf4d('0x45')]({'where':{'userProfileId':_0x3af3d1[_0xdf4d('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xdf4d('0x28')](function(_0x501726){if(_0x501726){return db['UserProfileSection'][_0xdf4d('0x5d')]({'where':{'userProfileId':_0x3af3d1[_0xdf4d('0x48')]['id'],'id':_[_0xdf4d('0x3d')](_0x501726,function(_0x5d8eac){return _0x5d8eac['id'];})},'transaction':_0x1bfd59});}})[_0xdf4d('0x28')](function(_0x721141){var _0x59137b=_[_0xdf4d('0x3d')](_0x3af3d1['body'],function(_0x48a2db){_0x48a2db[_0xdf4d('0x5b')]=_0x3af3d1['params']['id'];return _0x48a2db;});return db[_0xdf4d('0x55')][_0xdf4d('0x63')](_0x59137b,{'raw':!![],'transaction':_0x1bfd59});})['then'](function(_0x16b6e6){var _0x1d1cd8=_[_0xdf4d('0x3b')](_[_0xdf4d('0x3d')](_0x16b6e6,function(_0x2ba0c1){return _0x2ba0c1[_0xdf4d('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x1d1cd8){return db['UserProfileSection'][_0xdf4d('0x45')]({'where':{'userProfileId':_0x3af3d1[_0xdf4d('0x48')]['id'],'sectionId':_[_0xdf4d('0x3d')](_0x1d1cd8,function(_0x22fa08){return _0x22fa08[_0xdf4d('0x5a')];})},'attributes':['id',_0xdf4d('0x5a')],'raw':!![]})[_0xdf4d('0x28')](function(_0x42ffac){var _0x3210d8=_[_0xdf4d('0x3d')](_0x3af3d1[_0xdf4d('0x52')],function(_0x49b1e7){_0x49b1e7['userProfileId']=_0x3af3d1[_0xdf4d('0x48')]['id'];return _0x49b1e7;});return db['UserProfileResource'][_0xdf4d('0x63')](_0x3210d8,{'raw':!![],'transaction':_0x1bfd59});});}})[_0xdf4d('0x4b')](handleError(_0x377e3f,null));});}})['then'](function(_0x42a500){var _0xa96adf=_['map'](_0x42a500,function(_0x3781d3){return _0x3781d3['get']({'plain':!![]});});})['then'](respondWithResult(_0x377e3f,null))['catch'](handleError(_0x377e3f,null));};exports[_0xdf4d('0x64')]=function(_0xa47325,_0x3373ae,_0x27d383){return db[_0xdf4d('0x41')]['find']({'where':{'id':_0xa47325[_0xdf4d('0x48')]['id']}})[_0xdf4d('0x28')](handleEntityNotFound(_0x3373ae,null))[_0xdf4d('0x28')](function(_0x5512c4){if(_0x5512c4){return _0x5512c4[_0xdf4d('0x64')](_0xa47325['query'][_0xdf4d('0x61')]);}})['then'](respondWithStatusCode(_0x3373ae,null))[_0xdf4d('0x4b')](handleError(_0x3373ae,null));};exports[_0xdf4d('0x65')]=function(_0x3d0ddf,_0x2d2df5){var _0x4809fe={'raw':![],'where':{}};var _0x9d6fbf={};var _0x2d5dfe={'count':0x0,'rows':[]};var _0x5bc8b5=_0x3d0ddf['query'][_0xdf4d('0x66')];if(typeof _0x5bc8b5===_0xdf4d('0x67')){throw new db[(_0xdf4d('0x68'))][(_0xdf4d('0x69'))]('Unknown\x20section');}var _0x1ac9ad=_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x6a')]||![];var _0x3fada8=getQueryModels(_0x5bc8b5,_0x1ac9ad);if(typeof _0x3fada8[_0xdf4d('0x6b')]==='undefined'){throw new db[(_0xdf4d('0x68'))][(_0xdf4d('0x69'))](_0xdf4d('0x6c')+_0x5bc8b5+'\x27');}var _0x175463=[];if(!_[_0xdf4d('0x6d')](_0x3fada8[_0xdf4d('0x6e')])){_0x175463=_0x3fada8[_0xdf4d('0x6e')];}else{_0x175463=[{'name':_0x5bc8b5}];}return db[_0xdf4d('0x41')]['findOne']({'where':{'id':_0x3d0ddf[_0xdf4d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d2df5,null))[_0xdf4d('0x28')](function(_0x33130e){if(_0x33130e){var _0x4885da=[];for(var _0x167a39=0x0;_0x167a39<_0x175463[_0xdf4d('0x33')];_0x167a39++){_0x4885da[_0xdf4d('0x5f')](db[_0xdf4d('0x55')][_0xdf4d('0x6f')]({'where':{'userProfileId':_0x33130e['id'],'name':_0x175463[_0x167a39][_0xdf4d('0x2a')]},'raw':!![]}));}return BPromise[_0xdf4d('0x70')](_0x4885da);}})[_0xdf4d('0x28')](function(_0x23a0fb){var _0x69c73d=_['filter'](_0x23a0fb,function(_0x844ac1){return _0x844ac1?_0x844ac1:undefined;});var _0x593cf6=_[_0xdf4d('0x3b')](_0x175463,[_0xdf4d('0x71'),!![]]);var _0x45262e=_[_0xdf4d('0x6d')](_0x69c73d)&&_[_0xdf4d('0x6d')](_0x593cf6)?null:_[_0xdf4d('0x72')](_0x593cf6,_0x69c73d);if(_0x45262e){var _0x581892=[];for(var _0x1f6ebf=0x0;_0x1f6ebf<_0x45262e[_0xdf4d('0x33')];_0x1f6ebf++){var _0x3be9a1=_['find'](_0x175463,function(_0x55005c){return _0x45262e[_0x1f6ebf]?_0x55005c['name']===_0x45262e[_0x1f6ebf][_0xdf4d('0x2a')]:null;});if(_0x3be9a1){if(_0x45262e[_0x1f6ebf][_0xdf4d('0x71')]){_0x581892['push'](getAllResources(_0x3fada8[_0xdf4d('0x6b')],_0x45262e[_0x1f6ebf]));}else{if(!_0x45262e[_0x1f6ebf][_0xdf4d('0x57')]){_0x581892[_0xdf4d('0x5f')](getAllowedResources(_0x3be9a1,_0x45262e[_0x1f6ebf],_0x3fada8[_0xdf4d('0x6b')]));}else{if(_0x3be9a1[_0xdf4d('0x2d')]){_0x581892[_0xdf4d('0x5f')](getAllFilteredResources(_0x3be9a1,_0x45262e[_0x1f6ebf]));}}}}}return BPromise[_0xdf4d('0x70')](_0x581892);}else{return null;}})[_0xdf4d('0x28')](function(_0x312bd4){var _0x3a9f82=_0x312bd4;var _0x59c922=null;if(_0x3a9f82){_0x59c922=_0x3a9f82['length']===0x1?_0x3a9f82[0x0]:null;}if(_0x59c922||_0x3a9f82){var _0x29111b=db[_0x3fada8['childModel']][_0xdf4d('0x2c')];_0x9d6fbf['model']=_[_0xdf4d('0x2e')](_0x29111b);_0x9d6fbf['query']=_[_0xdf4d('0x2e')](_0x3d0ddf['query']);_0x9d6fbf[_0xdf4d('0x39')]=_[_0xdf4d('0x30')](_0x9d6fbf['model'],_0x9d6fbf[_0xdf4d('0x2f')]);_0x4809fe['attributes']=_[_0xdf4d('0x30')](_0x9d6fbf[_0xdf4d('0x2d')],qs[_0xdf4d('0x32')](_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x32')]));_0x4809fe[_0xdf4d('0x31')]=_0x4809fe['attributes']['length']?_0x4809fe['attributes']:_0x9d6fbf['model'];if(!_0x3d0ddf['query'][_0xdf4d('0x34')](_0xdf4d('0x35'))){_0x4809fe[_0xdf4d('0x36')]=qs['limit'](_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x36')]);_0x4809fe[_0xdf4d('0x21')]=qs[_0xdf4d('0x21')](_0x3d0ddf[_0xdf4d('0x2f')]['offset']);}_0x4809fe[_0xdf4d('0x37')]=qs[_0xdf4d('0x38')](_0x3d0ddf[_0xdf4d('0x2f')]['sort']);_0x4809fe['where']=qs[_0xdf4d('0x39')](_[_0xdf4d('0x3a')](_0x3d0ddf['query'],_0x9d6fbf[_0xdf4d('0x39')]));if(_0x3d0ddf[_0xdf4d('0x2f')]['filter']){_0x4809fe[_0xdf4d('0x3c')]=_[_0xdf4d('0x49')](_0x4809fe['where'],{'$or':_[_0xdf4d('0x3d')](_0x29111b,function(_0x1f762f){if(_0x1f762f[_0xdf4d('0x73')][_0xdf4d('0x3e')]!==_0xdf4d('0x3f')){var _0x458e3a={};_0x458e3a[_0x1f762f[_0xdf4d('0x40')]]={'$like':'%'+_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x3b')]+'%'};return _0x458e3a;}})});}var _0x3e8c87=[];if(_0x59c922){var _0x350a2c=_['find'](_0x175463,['name',_0x59c922[_0xdf4d('0x2a')]]);if(_0x350a2c[_0xdf4d('0x40')]){var _0x29a50a={};if(_0x3fada8[_0xdf4d('0x6b')]===_0xdf4d('0x74')){_0x29a50a[_0x350a2c[_0xdf4d('0x75')]]=_['map'](_0x59c922['associatedResources'],'id');}else{_0x29a50a[_0x350a2c[_0xdf4d('0x75')]]=_0x59c922['associatedResources'];}_0x3e8c87['push'](_0x29a50a);}else{_0x4809fe['where']['id']=_0x59c922['associatedResources'];}}else{for(var _0x14fb6f=0x0;_0x14fb6f<_0x3a9f82[_0xdf4d('0x33')];_0x14fb6f++){var _0x350a2c=_['find'](_0x175463,['name',_0x3a9f82[_0x14fb6f][_0xdf4d('0x2a')]]);if(_0x350a2c['field']){var _0x29a50a={};_0x29a50a[_0x350a2c[_0xdf4d('0x75')]]=_0x3a9f82[_0x14fb6f][_0xdf4d('0x76')];_0x3e8c87[_0xdf4d('0x5f')](_0x29a50a);}else{if(!_0x4809fe[_0xdf4d('0x3c')]['id'])_0x4809fe[_0xdf4d('0x3c')]['id']=[];_0x3a9f82[_0x14fb6f]['associatedResources']['forEach'](function(_0x43065e){_0x4809fe[_0xdf4d('0x3c')]['id'][_0xdf4d('0x5f')](_0x43065e);});}}}if(!_[_0xdf4d('0x6d')](_0x3e8c87)){_0x4809fe['where']=_[_0xdf4d('0x49')](_0x4809fe[_0xdf4d('0x3c')],{'$and':{'$or':_0x3e8c87}});}_0x4809fe=_['merge']({},_0x4809fe,_0x3d0ddf['options']);if(_0x59c922&&!_0x59c922[_0xdf4d('0x57')]&&_0x3fada8['childModel']==='AnalyticExtractedReport'){if(_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x43')]){_0x4809fe['include']=[{'all':!![]}];}return db[_0x3fada8[_0xdf4d('0x6b')]][_0xdf4d('0x45')](_0x4809fe)[_0xdf4d('0x28')](function(_0x271ccf){var _0x4fb964=[];_0x271ccf[_0xdf4d('0x77')](function(_0x7348ed){var _0x4e107c;switch(_0x7348ed[_0xdf4d('0x78')]){case _0xdf4d('0x79'):_0x4e107c=_[_0xdf4d('0x4a')](_0x59c922['associatedResources'],function(_0xffb063){return _0xffb063['id']===_0x7348ed[_0xdf4d('0x7a')]&&_0xffb063['type']===_0xdf4d('0x7b');});break;case'custom':_0x4e107c=_['find'](_0x59c922[_0xdf4d('0x76')],function(_0x25754f){return _0x25754f['id']===_0x7348ed[_0xdf4d('0x7a')]&&_0x25754f['type']==='CustomReports';});break;}if(_0x4e107c)_0x4fb964[_0xdf4d('0x5f')](_0x7348ed);});_0x2d5dfe[_0xdf4d('0x42')]=_0x4fb964[_0xdf4d('0x33')];_0x2d5dfe['rows']=_0x4fb964;return _0x2d5dfe;});}else{return db[_0x3fada8['childModel']][_0xdf4d('0x42')]({'where':_0x4809fe[_0xdf4d('0x3c')]})[_0xdf4d('0x28')](function(_0x3fc464){_0x2d5dfe[_0xdf4d('0x42')]=_0x3fc464;if(_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x43')]){if(_0x3fada8[_0xdf4d('0x6b')]===_0xdf4d('0x7c')){_0x4809fe[_0xdf4d('0x44')]=[{'model':db[_0xdf4d('0x7d')],'as':_0xdf4d('0x7e'),'attributes':['id',_0xdf4d('0x2a'),'color'],'required':_0x3d0ddf[_0xdf4d('0x2f')]['tag']?!![]:![]},{'model':db[_0xdf4d('0x7d')],'as':_0xdf4d('0x7f'),'attributes':['id',_0xdf4d('0x2a'),_0xdf4d('0x80')],'through':_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x81')]?{'attributes':[],'where':{'TagId':_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x81')]||undefined}}:{},'required':_0x3d0ddf[_0xdf4d('0x2f')][_0xdf4d('0x81')]?!![]:![]}];}else{_0x4809fe[_0xdf4d('0x44')]=[{'all':!![]}];}}return db[_0x3fada8[_0xdf4d('0x6b')]]['findAll'](_0x4809fe);})['then'](function(_0x3ba07b){_0x2d5dfe[_0xdf4d('0x46')]=_0x3ba07b;return _0x2d5dfe;});}}else{return _0x2d5dfe;}})['then'](respondWithFilteredResult(_0x2d2df5,_0x4809fe))['catch'](handleError(_0x2d2df5,null));};function getAllResources(_0x516d0d,_0x29f3f8){return new BPromise(function(_0x1718e6,_0x3f722d){if(_0x29f3f8){var _0x12b5bd=_0x29f3f8['filter']?{[_0x29f3f8['filter'][_0xdf4d('0x40')]]:_0x29f3f8[_0xdf4d('0x3b')][_0xdf4d('0x82')]}:undefined;return db[_0x516d0d][_0xdf4d('0x45')]({'where':_0x12b5bd,'raw':!![]})[_0xdf4d('0x28')](function(_0x50d7e8){_0x29f3f8[_0xdf4d('0x76')]=_[_0xdf4d('0x3d')](_0x50d7e8,'id');_0x1718e6(_0x29f3f8);})['catch'](function(_0x1f5e4a){_0x3f722d(_0x1f5e4a);});}else{_0x1718e6(null);}});}function getAllFilteredResources(_0x34d490,_0x229ced){return new BPromise(function(_0x3078d2,_0x91940b){var _0x120c1a=_0x34d490['filter']?{[_0x34d490['filter'][_0xdf4d('0x40')]]:_0x34d490[_0xdf4d('0x3b')]['value']}:undefined;return db[_0x34d490[_0xdf4d('0x2d')]][_0xdf4d('0x45')]({'where':_0x120c1a,'raw':!![]})['then'](function(_0x27a045){_0x229ced[_0xdf4d('0x76')]=_[_0xdf4d('0x3d')](_0x27a045,function(_0x46af4d){return _0x46af4d['name'];});_0x3078d2(_0x229ced);})[_0xdf4d('0x4b')](function(_0x227d50){_0x91940b(_0x227d50);});});}function getAllowedResources(_0x7d8475,_0x1d97f0,_0x201b6c){return new BPromise(function(_0x2bb411,_0x59ef68){if(_0x1d97f0){return db[_0xdf4d('0x58')]['findAll']({'where':{'sectionId':_0x1d97f0['id']},'raw':!![]})[_0xdf4d('0x28')](function(_0x1f009f){if(_0x7d8475['field']&&_0x7d8475[_0xdf4d('0x40')]!=='id'){_0x1d97f0[_0xdf4d('0x76')]=_[_0xdf4d('0x3d')](_0x1f009f,function(_0x5672ee){return _0x5672ee[_0x7d8475[_0xdf4d('0x40')]];});}else{if(_0x201b6c===_0xdf4d('0x74')){_0x1d97f0[_0xdf4d('0x76')]=_[_0xdf4d('0x3d')](_0x1f009f,function(_0x30e2c7){return{'id':_0x30e2c7[_0xdf4d('0x83')],'type':_0x30e2c7['type']};});}else{_0x1d97f0[_0xdf4d('0x76')]=_[_0xdf4d('0x3d')](_0x1f009f,function(_0x16cc7d){return _0x16cc7d[_0xdf4d('0x83')];});}}_0x2bb411(_0x1d97f0);})[_0xdf4d('0x4b')](function(_0x22a1b0){_0x59ef68(_0x22a1b0);});}else{_0x2bb411(null);}});}function getQueryModels(_0x411dd2,_0xb84f0e){var _0x131b32=_0x411dd2[_0xdf4d('0x84')]();var _0x3aa0fe={'childModel':undefined,'parentSections':[]};switch(_0x131b32){case _0xdf4d('0x85'):_0x3aa0fe[_0xdf4d('0x6b')]='SquareProject';break;case _0xdf4d('0x86'):_0x3aa0fe['childModel']=_0xdf4d('0x87');break;case _0xdf4d('0x88'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x89');_0x3aa0fe[_0xdf4d('0x6e')]=[{'name':_0xdf4d('0x8a'),'field':'name','foreignKey':_0xdf4d('0x8b')}];break;case'projects':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x8c');break;case _0xdf4d('0x8d'):_0x3aa0fe['childModel']=_0xdf4d('0x7c');_0x3aa0fe[_0xdf4d('0x6e')]=[{'name':_0xdf4d('0x8e'),'field':'id','foreignKey':_0xdf4d('0x8f')}];break;case _0xdf4d('0x90'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x91');break;case _0xdf4d('0x92'):_0x3aa0fe['childModel']=_0xdf4d('0x93');break;case _0xdf4d('0x94'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x95');break;case _0xdf4d('0x96'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x97');break;case _0xdf4d('0x98'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x99');break;case'faxqueues':_0x3aa0fe['childModel']='FaxQueue';break;case'faxaccounts':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x9a');break;case _0xdf4d('0x9b'):case _0xdf4d('0x9c'):case _0xdf4d('0x9d'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x9e');break;case'contexts':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0x9f');break;case _0xdf4d('0xa0'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xa1');break;case'voicerecordings':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xa2');_0x3aa0fe[_0xdf4d('0x6e')]=[{'name':'Agents','field':_0xdf4d('0x2a'),'foreignKey':'membername','model':_0xdf4d('0xa3'),'filter':{'field':_0xdf4d('0xa4'),'value':[_0xdf4d('0xa5')]}},{'name':_0xdf4d('0xa6'),'field':_0xdf4d('0x2a'),'foreignKey':'membername','model':_0xdf4d('0xa3'),'filter':{'field':'role','value':[_0xdf4d('0xa7')]}},{'name':_0xdf4d('0xa8'),'field':'name','foreignKey':'queue','model':_0xdf4d('0xa9'),'filter':{'field':_0xdf4d('0x73'),'value':[_0xdf4d('0xaa')]}},{'name':_0xdf4d('0xab'),'field':'name','foreignKey':_0xdf4d('0xac'),'model':_0xdf4d('0xa9'),'filter':{'field':_0xdf4d('0x73'),'value':[_0xdf4d('0xad')]}}];break;case _0xdf4d('0xae'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xaf');break;case _0xdf4d('0xb0'):_0x3aa0fe[_0xdf4d('0x6b')]='VoiceChanSpy';break;case _0xdf4d('0xb1'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xb2');break;case _0xdf4d('0xb3'):_0x3aa0fe['childModel']=_0xdf4d('0xb4');break;case _0xdf4d('0xb5'):_0x3aa0fe['childModel']=_0xdf4d('0xb6');break;case _0xdf4d('0xb7'):_0x3aa0fe[_0xdf4d('0x6b')]='MailAccount';break;case'mailsubstatuses':_0x3aa0fe['childModel']='MailSubstatus';break;case _0xdf4d('0xb8'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xb9');break;case'openchannelaccounts':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xba');break;case'smsqueues':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xbb');break;case'smsaccounts':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xbc');break;case'teams':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xbd');break;case _0xdf4d('0xbe'):case'queuecampaigns':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xa9');if(_0xb84f0e){_0x3aa0fe[_0xdf4d('0x6e')]=[{'name':_0xdf4d('0xa8')},{'name':_0xdf4d('0xab')}];}break;case _0xdf4d('0xbf'):case _0xdf4d('0xc0'):case'telephones':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xa3');if(_0xb84f0e){_0x3aa0fe[_0xdf4d('0x6e')]=[{'name':_0xdf4d('0xc1'),'filter':{'field':_0xdf4d('0xa4'),'value':[_0xdf4d('0xc2'),_0xdf4d('0xc3')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xdf4d('0xc4'):_0x3aa0fe['childModel']=_0xdf4d('0xc5');break;case'salesforceaccounts':_0x3aa0fe['childModel']=_0xdf4d('0xc6');break;case _0xdf4d('0xc7'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xc8');break;case _0xdf4d('0xc9'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xca');break;case'deskaccounts':_0x3aa0fe['childModel']=_0xdf4d('0xcb');break;case _0xdf4d('0xcc'):_0x3aa0fe['childModel']=_0xdf4d('0xcd');break;case _0xdf4d('0xce'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xa3');break;case _0xdf4d('0xcf'):_0x3aa0fe['childModel']=_0xdf4d('0xd0');break;case _0xdf4d('0xd1'):_0x3aa0fe['childModel']=_0xdf4d('0xd2');break;case _0xdf4d('0xd3'):_0x3aa0fe[_0xdf4d('0x6b')]='Dashboard';break;case _0xdf4d('0xd4'):_0x3aa0fe[_0xdf4d('0x6b')]='Interval';break;case _0xdf4d('0xd5'):_0x3aa0fe[_0xdf4d('0x6b')]='Pause';break;case _0xdf4d('0xd6'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xd7');break;case _0xdf4d('0xd8'):_0x3aa0fe['childModel']=_0xdf4d('0xd9');break;case _0xdf4d('0xda'):_0x3aa0fe['childModel']=_0xdf4d('0x7d');break;case _0xdf4d('0xdb'):_0x3aa0fe['childModel']=_0xdf4d('0xdc');break;case _0xdf4d('0xdd'):_0x3aa0fe[_0xdf4d('0x6b')]='Trigger';break;case _0xdf4d('0xde'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xdf');break;case _0xdf4d('0xe0'):_0x3aa0fe['childModel']=_0xdf4d('0xe1');break;case _0xdf4d('0xe2'):_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xe3');break;case _0xdf4d('0xe4'):_0x3aa0fe[_0xdf4d('0x6b')]='AnalyticExtractedReport';_0x3aa0fe['parentSections']=[{'name':_0xdf4d('0xe5'),'field':'id','foreignKey':_0xdf4d('0x7a')}];break;case'metrics':_0x3aa0fe[_0xdf4d('0x6b')]=_0xdf4d('0xe6');break;default:return _0x3aa0fe;}return _0x3aa0fe;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d874a1f..0be753e 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','UserProfile','setMaxListeners'];(function(_0x13561d,_0x279aab){var _0x5c2031=function(_0x3e7668){while(--_0x3e7668){_0x13561d['push'](_0x13561d['shift']());}};_0x5c2031(++_0x279aab);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xcb91[_0x2ff762];return _0x158b02;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x1cb9('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){UserProfileEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);UserProfileEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];UserProfile[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x2e54=['update','remove','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x1de880,_0x5d2596){var _0x226f3e=function(_0x586d6e){while(--_0x586d6e){_0x1de880['push'](_0x1de880['shift']());}};_0x226f3e(++_0x5d2596);}(_0x2e54,0x1dd));var _0x42e5=function(_0x7b7091,_0x5887da){_0x7b7091=_0x7b7091-0x0;var _0x54325d=_0x2e54[_0x7b7091];return _0x54325d;};'use strict';var EventEmitter=require(_0x42e5('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x42e5('0x1')](0x0);var events={'afterCreate':_0x42e5('0x2'),'afterUpdate':_0x42e5('0x3'),'afterDestroy':_0x42e5('0x4')};function emitEvent(_0x326371){return function(_0x153440,_0x42736b,_0x528772){UserProfileEvents[_0x42e5('0x5')](_0x326371+':'+_0x153440['id'],_0x153440);UserProfileEvents[_0x42e5('0x5')](_0x326371,_0x153440);_0x528772(null);};}for(var e in events){if(events[_0x42e5('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x42e5('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index e699929..38f0369 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 _0x88f2=['../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x26f97b,_0x64602f){var _0x29c0a8=function(_0x14b520){while(--_0x14b520){_0x26f97b['push'](_0x26f97b['shift']());}};_0x29c0a8(++_0x64602f);}(_0x88f2,0x10a));var _0x288f=function(_0x36128b,_0x5665f3){_0x36128b=_0x36128b-0x0;var _0x2f0ab9=_0x88f2[_0x36128b];return _0x2f0ab9;};'use strict';var _=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var logger=require(_0x288f('0x2'))(_0x288f('0x3'));var moment=require('moment');var BPromise=require(_0x288f('0x4'));var rp=require(_0x288f('0x5'));var fs=require('fs');var path=require(_0x288f('0x6'));var rimraf=require('rimraf');var config=require(_0x288f('0x7'));var attributes=require(_0x288f('0x8'));module[_0x288f('0x9')]=function(_0x41e6df,_0x1c7da9){return _0x41e6df[_0x288f('0xa')](_0x288f('0xb'),attributes,{'tableName':_0x288f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fa3=['path','rimraf','../../config/environment','exports','define','UserProfile','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2c9e4c,_0x3141f9){var _0xf28fb0=function(_0x5b4479){while(--_0x5b4479){_0x2c9e4c['push'](_0x2c9e4c['shift']());}};_0xf28fb0(++_0x3141f9);}(_0x9fa3,0x1e6));var _0x39fa=function(_0x45b3b9,_0x2af160){_0x45b3b9=_0x45b3b9-0x0;var _0x196d76=_0x9fa3[_0x45b3b9];return _0x196d76;};'use strict';var _=require(_0x39fa('0x0'));var util=require(_0x39fa('0x1'));var logger=require(_0x39fa('0x2'))(_0x39fa('0x3'));var moment=require(_0x39fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x39fa('0x5'));var fs=require('fs');var path=require(_0x39fa('0x6'));var rimraf=require(_0x39fa('0x7'));var config=require(_0x39fa('0x8'));var attributes=require('./userProfile.attributes');module[_0x39fa('0x9')]=function(_0xe2b559,_0x5157ae){return _0xe2b559[_0x39fa('0xa')](_0x39fa('0xb'),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 1651db2..bd0760f 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 _0x7bf7=['code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xb8a1de,_0x35ff0d){var _0x2b1ad8=function(_0x4cbbe9){while(--_0x4cbbe9){_0xb8a1de['push'](_0xb8a1de['shift']());}};_0x2b1ad8(++_0x35ff0d);}(_0x7bf7,0x16c));var _0x77bf=function(_0x245e2c,_0x1042cb){_0x245e2c=_0x245e2c-0x0;var _0x19fddd=_0x7bf7[_0x245e2c];return _0x19fddd;};'use strict';var _=require(_0x77bf('0x0'));var util=require(_0x77bf('0x1'));var moment=require(_0x77bf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77bf('0x3'));var db=require(_0x77bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77bf('0x5'))(_0x77bf('0x6'));var config=require(_0x77bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77bf('0x8')]['http']({'port':0x232a});config[_0x77bf('0x9')]=_[_0x77bf('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77bf('0x9')]));require(_0x77bf('0xb'))[_0x77bf('0xc')](socket);function respondWithRpcPromise(_0xf6caf0,_0x36e363,_0x10aad8){return new BPromise(function(_0x58cbf3,_0x170b63){return client['request'](_0xf6caf0,_0x10aad8)['then'](function(_0x45fc33){logger[_0x77bf('0xd')](_0x77bf('0xe'),_0x36e363,'request\x20sent');logger[_0x77bf('0xf')](_0x77bf('0x10'),_0x36e363,_0x77bf('0x11'),JSON[_0x77bf('0x12')](_0x45fc33));if(_0x45fc33[_0x77bf('0x13')]){if(_0x45fc33[_0x77bf('0x13')][_0x77bf('0x14')]===0x1f4){logger['error'](_0x77bf('0xe'),_0x36e363,_0x45fc33[_0x77bf('0x13')][_0x77bf('0x15')]);return _0x170b63(_0x45fc33[_0x77bf('0x13')][_0x77bf('0x15')]);}logger[_0x77bf('0x13')]('UserProfile,\x20%s,\x20%s',_0x36e363,_0x45fc33[_0x77bf('0x13')][_0x77bf('0x15')]);return _0x58cbf3(_0x45fc33[_0x77bf('0x13')][_0x77bf('0x15')]);}else{logger[_0x77bf('0xd')](_0x77bf('0xe'),_0x36e363,_0x77bf('0x11'));_0x58cbf3(_0x45fc33[_0x77bf('0x16')][_0x77bf('0x15')]);}})[_0x77bf('0x17')](function(_0x5b962c){logger[_0x77bf('0x13')](_0x77bf('0xe'),_0x36e363,_0x5b962c);_0x170b63(_0x5b962c);});});} \ No newline at end of file +var _0xf1ed=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird'];(function(_0x49b0f1,_0xc3ef15){var _0x3402fa=function(_0x190cf9){while(--_0x190cf9){_0x49b0f1['push'](_0x49b0f1['shift']());}};_0x3402fa(++_0xc3ef15);}(_0xf1ed,0x75));var _0xdf1e=function(_0x236748,_0x14b58d){_0x236748=_0x236748-0x0;var _0x5d02e0=_0xf1ed[_0x236748];return _0x5d02e0;};'use strict';var _=require(_0xdf1e('0x0'));var util=require(_0xdf1e('0x1'));var moment=require('moment');var BPromise=require(_0xdf1e('0x2'));var rs=require(_0xdf1e('0x3'));var fs=require('fs');var Redis=require(_0xdf1e('0x4'));var db=require(_0xdf1e('0x5'))['db'];var utils=require(_0xdf1e('0x6'));var logger=require(_0xdf1e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdf1e('0x8'));var client=jayson[_0xdf1e('0x9')]['http']({'port':0x232a});config[_0xdf1e('0xa')]=_[_0xdf1e('0xb')](config[_0xdf1e('0xa')],{'host':_0xdf1e('0xc'),'port':0x18eb});var socket=require(_0xdf1e('0xd'))(new Redis(config[_0xdf1e('0xa')]));require('./userProfile.socket')[_0xdf1e('0xe')](socket);function respondWithRpcPromise(_0x51dfef,_0x563657,_0x1f8160){return new BPromise(function(_0x346ee2,_0x133566){return client['request'](_0x51dfef,_0x1f8160)[_0xdf1e('0xf')](function(_0x27875f){logger[_0xdf1e('0x10')](_0xdf1e('0x11'),_0x563657,_0xdf1e('0x12'));logger['debug'](_0xdf1e('0x13'),_0x563657,_0xdf1e('0x12'),JSON['stringify'](_0x27875f));if(_0x27875f[_0xdf1e('0x14')]){if(_0x27875f[_0xdf1e('0x14')]['code']===0x1f4){logger[_0xdf1e('0x14')](_0xdf1e('0x11'),_0x563657,_0x27875f['error'][_0xdf1e('0x15')]);return _0x133566(_0x27875f[_0xdf1e('0x14')][_0xdf1e('0x15')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x563657,_0x27875f[_0xdf1e('0x14')]['message']);return _0x346ee2(_0x27875f[_0xdf1e('0x14')][_0xdf1e('0x15')]);}else{logger[_0xdf1e('0x10')](_0xdf1e('0x11'),_0x563657,_0xdf1e('0x12'));_0x346ee2(_0x27875f[_0xdf1e('0x16')][_0xdf1e('0x15')]);}})[_0xdf1e('0x17')](function(_0x1c66fc){logger['error'](_0xdf1e('0x11'),_0x563657,_0x1c66fc);_0x133566(_0x1c66fc);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 7f43f08..511e128 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 _0xb4e6=['./userProfile.events','save','remove','update','emit','removeListener','register','length','userProfile:'];(function(_0x959177,_0x4998ba){var _0x486342=function(_0x3a0561){while(--_0x3a0561){_0x959177['push'](_0x959177['shift']());}};_0x486342(++_0x4998ba);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0xb4e6[_0x401ccd];return _0x5a57ad;};'use strict';var UserProfileEvents=require(_0x6b4e('0x0'));var events=[_0x6b4e('0x1'),_0x6b4e('0x2'),_0x6b4e('0x3')];function createListener(_0x15d7bb,_0x16b379){return function(_0x567f47){_0x16b379[_0x6b4e('0x4')](_0x15d7bb,_0x567f47);};}function removeListener(_0x55df8c,_0x1f75ee){return function(){UserProfileEvents[_0x6b4e('0x5')](_0x55df8c,_0x1f75ee);};}exports[_0x6b4e('0x6')]=function(_0x431dde){for(var _0x5ad54e=0x0,_0x4091d6=events[_0x6b4e('0x7')];_0x5ad54e<_0x4091d6;_0x5ad54e++){var _0x471c1e=events[_0x5ad54e];var _0x187c7d=createListener(_0x6b4e('0x8')+_0x471c1e,_0x431dde);UserProfileEvents['on'](_0x471c1e,_0x187c7d);}}; \ No newline at end of file +var _0xc1fa=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x377b88,_0x1ba59c){var _0xb1f50f=function(_0x49d9e7){while(--_0x49d9e7){_0x377b88['push'](_0x377b88['shift']());}};_0xb1f50f(++_0x1ba59c);}(_0xc1fa,0x83));var _0xac1f=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xc1fa[_0x3ff685];return _0x2046c9;};'use strict';var UserProfileEvents=require(_0xac1f('0x0'));var events=[_0xac1f('0x1'),_0xac1f('0x2'),_0xac1f('0x3')];function createListener(_0x1adcd5,_0x171cd7){return function(_0x565d7f){_0x171cd7[_0xac1f('0x4')](_0x1adcd5,_0x565d7f);};}function removeListener(_0x3ad940,_0x22cf15){return function(){UserProfileEvents[_0xac1f('0x5')](_0x3ad940,_0x22cf15);};}exports[_0xac1f('0x6')]=function(_0x4342a5){for(var _0x38bd1d=0x0,_0x406495=events[_0xac1f('0x7')];_0x38bd1d<_0x406495;_0x38bd1d++){var _0xef0b44=events[_0x38bd1d];var _0x33d385=createListener(_0xac1f('0x8')+_0xef0b44,_0x4342a5);UserProfileEvents['on'](_0xef0b44,_0x33d385);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 7aeb4da..17d9040 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 _0x42f4=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x42f4,0x19d));var _0x442f=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x42f4[_0x36de10];return _0x58100f;};'use strict';var multer=require(_0x442f('0x0'));var util=require('util');var path=require(_0x442f('0x1'));var timeout=require(_0x442f('0x2'));var express=require(_0x442f('0x3'));var router=express[_0x442f('0x4')]();var auth=require(_0x442f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x442f('0x6')]('/',auth[_0x442f('0x7')](),controller['index']);router[_0x442f('0x6')](_0x442f('0x8'),auth[_0x442f('0x7')](),controller[_0x442f('0x9')]);router[_0x442f('0x6')](_0x442f('0xa'),auth['isAuthenticated'](),controller[_0x442f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x442f('0xc')](_0x442f('0xa'),auth[_0x442f('0x7')](),controller[_0x442f('0xd')]);router[_0x442f('0xe')](_0x442f('0xa'),auth[_0x442f('0x7')](),controller[_0x442f('0xf')]);module[_0x442f('0x10')]=router; \ No newline at end of file +var _0x0f97=['show','post','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','isAuthenticated','describe'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0x0f97,0x196));var _0x70f9=function(_0x3fb07b,_0x2920ca){_0x3fb07b=_0x3fb07b-0x0;var _0x15cdb4=_0x0f97[_0x3fb07b];return _0x15cdb4;};'use strict';var multer=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var timeout=require(_0x70f9('0x3'));var express=require(_0x70f9('0x4'));var router=express[_0x70f9('0x5')]();var auth=require(_0x70f9('0x6'));var interaction=require(_0x70f9('0x7'));var config=require(_0x70f9('0x8'));var controller=require(_0x70f9('0x9'));router[_0x70f9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x70f9('0xa')](_0x70f9('0xb'),auth[_0x70f9('0xc')](),controller[_0x70f9('0xd')]);router['get']('/:id',auth[_0x70f9('0xc')](),controller[_0x70f9('0xe')]);router[_0x70f9('0xf')]('/',auth[_0x70f9('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70f9('0x10')]);router[_0x70f9('0x11')](_0x70f9('0x12'),auth[_0x70f9('0xc')](),controller['destroy']);module[_0x70f9('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index cb81e03..78b10a2 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 _0xa43b=['STRING','INTEGER'];(function(_0x4527d8,_0x59e349){var _0x1ec91d=function(_0x1ec598){while(--_0x1ec598){_0x4527d8['push'](_0x4527d8['shift']());}};_0x1ec91d(++_0x59e349);}(_0xa43b,0x66));var _0xba43=function(_0x2bdf00,_0x494ed2){_0x2bdf00=_0x2bdf00-0x0;var _0x39752e=_0xa43b[_0x2bdf00];return _0x39752e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xba43('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xba43('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6a3f=['INTEGER','sequelize','exports','STRING'];(function(_0x89cb3a,_0x385fd1){var _0x407cf1=function(_0x61fa77){while(--_0x61fa77){_0x89cb3a['push'](_0x89cb3a['shift']());}};_0x407cf1(++_0x385fd1);}(_0x6a3f,0x1b1));var _0xf6a3=function(_0x1ce8bf,_0x192b51){_0x1ce8bf=_0x1ce8bf-0x0;var _0x486002=_0x6a3f[_0x1ce8bf];return _0x486002;};'use strict';var Sequelize=require(_0xf6a3('0x0'));module[_0xf6a3('0x1')]={'name':{'type':Sequelize[_0xf6a3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf6a3('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 8b6933b..c1deac2 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 _0x3679=['ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','count','include','UserProfileResource','findAll','rows','catch','params','length','includeAll','options','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','querystring','papaparse'];(function(_0x569f7f,_0x36dc49){var _0x4973d9=function(_0x41db7f){while(--_0x41db7f){_0x569f7f['push'](_0x569f7f['shift']());}};_0x4973d9(++_0x36dc49);}(_0x3679,0x7b));var _0x9367=function(_0x2e39d2,_0x5c8c74){_0x2e39d2=_0x2e39d2-0x0;var _0x22941e=_0x3679[_0x2e39d2];return _0x22941e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9367('0x0'));var rimraf=require(_0x9367('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9367('0x2'));var moment=require(_0x9367('0x3'));var BPromise=require(_0x9367('0x4'));var Mustache=require(_0x9367('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9367('0x6'));var csv=require(_0x9367('0x7'));var ejs=require(_0x9367('0x8'));var fs=require('fs');var _=require(_0x9367('0x9'));var squel=require(_0x9367('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9367('0x7'));var querystring=require(_0x9367('0xb'));var Papa=require(_0x9367('0xc'));var Redis=require(_0x9367('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9367('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9367('0xf'));var utils=require('../../config/utils');var config=require(_0x9367('0x10'));var db=require(_0x9367('0x11'))['db'];function respondWithStatusCode(_0x572bd2,_0x2d6445){_0x2d6445=_0x2d6445||0xcc;return function(_0x2e2923){if(_0x2e2923){return _0x572bd2[_0x9367('0x12')](_0x2d6445);}return _0x572bd2[_0x9367('0x13')](_0x2d6445)[_0x9367('0x14')]();};}function respondWithResult(_0x490a72,_0x41e469){_0x41e469=_0x41e469||0xc8;return function(_0x4fe26c){if(_0x4fe26c){return _0x490a72[_0x9367('0x13')](_0x41e469)[_0x9367('0x15')](_0x4fe26c);}};}function respondWithFilteredResult(_0x79b710,_0x2054a2){return function(_0xd8b291){if(_0xd8b291){var _0x5edc9b=_0xd8b291['count'],_0x5a7347=_0x2054a2[_0x9367('0x16')],_0x366d9b=_0x2054a2[_0x9367('0x16')]+_0x2054a2[_0x9367('0x17')],_0x37e15d;if(_0x366d9b>=_0x5edc9b){_0x366d9b=_0x5edc9b;_0x37e15d=0xc8;}else{_0x37e15d=0xce;}_0x79b710[_0x9367('0x13')](_0x37e15d);return _0x79b710[_0x9367('0x18')](_0x9367('0x19'),_0x5a7347+'-'+_0x366d9b+'/'+_0x5edc9b)[_0x9367('0x15')](_0xd8b291);}return null;};}function patchUpdates(_0x479ddb){return function(_0x1198be){try{jsonpatch[_0x9367('0x1a')](_0x1198be,_0x479ddb,!![]);}catch(_0x896b7c){return BPromise[_0x9367('0x1b')](_0x896b7c);}return _0x1198be['save']();};}function saveUpdates(_0x3aa5c9,_0x4a616f){return function(_0x163182){if(_0x163182){return _0x163182[_0x9367('0x1c')](_0x3aa5c9)[_0x9367('0x1d')](function(_0x214c69){return _0x214c69;});}return null;};}function removeEntity(_0x1f8632,_0x26c43d){return function(_0x12de3b){if(_0x12de3b){return _0x12de3b[_0x9367('0x1e')]()[_0x9367('0x1d')](function(){_0x1f8632[_0x9367('0x13')](0xcc)[_0x9367('0x14')]();});}};}function handleEntityNotFound(_0x50d1bc,_0x16e895){return function(_0x50f0f0){if(!_0x50f0f0){_0x50d1bc[_0x9367('0x12')](0x194);}return _0x50f0f0;};}function handleError(_0x2b4423,_0x11bff3){_0x11bff3=_0x11bff3||0x1f4;return function(_0x275797){logger['error'](_0x275797[_0x9367('0x1f')]);if(_0x275797[_0x9367('0x20')]){delete _0x275797[_0x9367('0x20')];}_0x2b4423[_0x9367('0x13')](_0x11bff3)[_0x9367('0x21')](_0x275797);};}exports[_0x9367('0x22')]=function(_0x1e5176,_0x9f00a3){var _0x1be331={},_0x241a24={},_0x49a395={'count':0x0,'rows':[]};var _0x371329=db['UserProfileResource'][_0x9367('0x23')];_0x241a24['model']=_[_0x9367('0x24')](_0x371329);_0x241a24[_0x9367('0x25')]=_[_0x9367('0x24')](_0x1e5176[_0x9367('0x25')]);_0x241a24['filters']=_[_0x9367('0x26')](_0x241a24[_0x9367('0x27')],_0x241a24[_0x9367('0x25')]);_0x1be331[_0x9367('0x28')]=_[_0x9367('0x26')](_0x241a24[_0x9367('0x27')],qs[_0x9367('0x29')](_0x1e5176[_0x9367('0x25')][_0x9367('0x29')]));_0x1be331['attributes']=_0x1be331[_0x9367('0x28')]['length']?_0x1be331[_0x9367('0x28')]:_0x241a24[_0x9367('0x27')];if(!_0x1e5176[_0x9367('0x25')][_0x9367('0x2a')](_0x9367('0x2b'))){_0x1be331[_0x9367('0x17')]=qs[_0x9367('0x17')](_0x1e5176[_0x9367('0x25')][_0x9367('0x17')]);_0x1be331[_0x9367('0x16')]=qs['offset'](_0x1e5176[_0x9367('0x25')]['offset']);}_0x1be331[_0x9367('0x2c')]=qs[_0x9367('0x2d')](_0x1e5176[_0x9367('0x25')][_0x9367('0x2d')]);_0x1be331[_0x9367('0x2e')]=qs[_0x9367('0x2f')](_[_0x9367('0x30')](_0x1e5176[_0x9367('0x25')],_0x241a24[_0x9367('0x2f')]));if(_0x1e5176['query'][_0x9367('0x31')]){_0x1be331[_0x9367('0x2e')]=_[_0x9367('0x32')](_0x1be331['where'],{'$or':_['map'](_0x371329,function(_0x291cfb){if(_0x291cfb[_0x9367('0x33')]['key']!==_0x9367('0x34')){var _0x241e6a={};_0x241e6a[_0x291cfb[_0x9367('0x35')]]={'$like':'%'+_0x1e5176[_0x9367('0x25')][_0x9367('0x31')]+'%'};return _0x241e6a;}})});}_0x1be331=_[_0x9367('0x32')]({},_0x1be331,_0x1e5176['options']);var _0x35894a={'where':_0x1be331['where']};return db['UserProfileResource'][_0x9367('0x36')](_0x35894a)[_0x9367('0x1d')](function(_0x21780c){_0x49a395[_0x9367('0x36')]=_0x21780c;if(_0x1e5176[_0x9367('0x25')]['includeAll']){_0x1be331[_0x9367('0x37')]=[{'all':!![]}];}return db[_0x9367('0x38')][_0x9367('0x39')](_0x1be331);})['then'](function(_0xc65776){_0x49a395[_0x9367('0x3a')]=_0xc65776;return _0x49a395;})[_0x9367('0x1d')](respondWithFilteredResult(_0x9f00a3,_0x1be331))[_0x9367('0x3b')](handleError(_0x9f00a3,null));};exports['show']=function(_0xbab77b,_0x126007){var _0x16c70e={'raw':![],'where':{'id':_0xbab77b[_0x9367('0x3c')]['id']}},_0x1a2fee={};_0x1a2fee[_0x9367('0x27')]=_[_0x9367('0x24')](db['UserProfileResource'][_0x9367('0x23')]);_0x1a2fee[_0x9367('0x25')]=_[_0x9367('0x24')](_0xbab77b[_0x9367('0x25')]);_0x1a2fee[_0x9367('0x2f')]=_[_0x9367('0x26')](_0x1a2fee['model'],_0x1a2fee[_0x9367('0x25')]);_0x16c70e['attributes']=_[_0x9367('0x26')](_0x1a2fee['model'],qs['fields'](_0xbab77b[_0x9367('0x25')]['fields']));_0x16c70e['attributes']=_0x16c70e[_0x9367('0x28')][_0x9367('0x3d')]?_0x16c70e[_0x9367('0x28')]:_0x1a2fee[_0x9367('0x27')];if(_0xbab77b[_0x9367('0x25')][_0x9367('0x3e')]){_0x16c70e[_0x9367('0x37')]=[{'all':!![]}];}_0x16c70e=_[_0x9367('0x32')]({},_0x16c70e,_0xbab77b[_0x9367('0x3f')]);return db[_0x9367('0x38')]['find'](_0x16c70e)[_0x9367('0x1d')](handleEntityNotFound(_0x126007,null))[_0x9367('0x1d')](respondWithResult(_0x126007,null))[_0x9367('0x3b')](handleError(_0x126007,null));};exports[_0x9367('0x40')]=function(_0x1a5613,_0x277a86){return db[_0x9367('0x38')][_0x9367('0x40')](_0x1a5613[_0x9367('0x41')],{})[_0x9367('0x1d')](respondWithResult(_0x277a86,0xc9))[_0x9367('0x3b')](handleError(_0x277a86,null));};exports[_0x9367('0x1c')]=function(_0x17ca5d,_0x3e8449){if(_0x17ca5d[_0x9367('0x41')]['id']){delete _0x17ca5d[_0x9367('0x41')]['id'];}return db['UserProfileResource'][_0x9367('0x42')]({'where':{'id':_0x17ca5d[_0x9367('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3e8449,null))['then'](saveUpdates(_0x17ca5d[_0x9367('0x41')],null))[_0x9367('0x1d')](respondWithResult(_0x3e8449,null))[_0x9367('0x3b')](handleError(_0x3e8449,null));};exports[_0x9367('0x1e')]=function(_0x4852fb,_0x452926){return db[_0x9367('0x38')][_0x9367('0x42')]({'where':{'id':_0x4852fb[_0x9367('0x3c')]['id']}})[_0x9367('0x1d')](handleEntityNotFound(_0x452926,null))[_0x9367('0x1d')](removeEntity(_0x452926,null))['catch'](handleError(_0x452926,null));};exports[_0x9367('0x43')]=function(_0x1b034c,_0x1a17a2){return db['UserProfileResource'][_0x9367('0x43')]()['then'](respondWithResult(_0x1a17a2,null))[_0x9367('0x3b')](handleError(_0x1a17a2,null));}; \ No newline at end of file +var _0x9b7d=['VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','end','error','name','send','UserProfileResource','rawAttributes','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type'];(function(_0xa35666,_0x19fb8a){var _0x4b2d2f=function(_0x5d3fca){while(--_0x5d3fca){_0xa35666['push'](_0xa35666['shift']());}};_0x4b2d2f(++_0x19fb8a);}(_0x9b7d,0x179));var _0xd9b7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9b7d[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xd9b7('0x0'));var emlformat=require(_0xd9b7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd9b7('0x2'));var jsonpatch=require(_0xd9b7('0x3'));var rp=require(_0xd9b7('0x4'));var moment=require(_0xd9b7('0x5'));var BPromise=require(_0xd9b7('0x6'));var Mustache=require(_0xd9b7('0x7'));var util=require(_0xd9b7('0x8'));var path=require(_0xd9b7('0x9'));var sox=require(_0xd9b7('0xa'));var csv=require(_0xd9b7('0xb'));var ejs=require(_0xd9b7('0xc'));var fs=require('fs');var _=require(_0xd9b7('0xd'));var squel=require(_0xd9b7('0xe'));var crypto=require(_0xd9b7('0xf'));var jsforce=require(_0xd9b7('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd9b7('0x11'));var Papa=require(_0xd9b7('0x12'));var Redis=require(_0xd9b7('0x13'));var authService=require(_0xd9b7('0x14'));var qs=require(_0xd9b7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9b7('0x16'))(_0xd9b7('0x17'));var utils=require(_0xd9b7('0x18'));var config=require(_0xd9b7('0x19'));var db=require(_0xd9b7('0x1a'))['db'];function respondWithStatusCode(_0xc2ab5e,_0x48581f){_0x48581f=_0x48581f||0xcc;return function(_0x3f04b3){if(_0x3f04b3){return _0xc2ab5e[_0xd9b7('0x1b')](_0x48581f);}return _0xc2ab5e[_0xd9b7('0x1c')](_0x48581f)['end']();};}function respondWithResult(_0xa24bd4,_0x3cb873){_0x3cb873=_0x3cb873||0xc8;return function(_0x4228a3){if(_0x4228a3){return _0xa24bd4[_0xd9b7('0x1c')](_0x3cb873)[_0xd9b7('0x1d')](_0x4228a3);}};}function respondWithFilteredResult(_0x57dabb,_0x930e80){return function(_0x3d62cc){if(_0x3d62cc){var _0x1eaf77=_0x3d62cc[_0xd9b7('0x1e')],_0x1517aa=_0x930e80[_0xd9b7('0x1f')],_0x383707=_0x930e80[_0xd9b7('0x1f')]+_0x930e80[_0xd9b7('0x20')],_0x318bbb;if(_0x383707>=_0x1eaf77){_0x383707=_0x1eaf77;_0x318bbb=0xc8;}else{_0x318bbb=0xce;}_0x57dabb[_0xd9b7('0x1c')](_0x318bbb);return _0x57dabb[_0xd9b7('0x21')](_0xd9b7('0x22'),_0x1517aa+'-'+_0x383707+'/'+_0x1eaf77)['json'](_0x3d62cc);}return null;};}function patchUpdates(_0x589122){return function(_0x4f13be){try{jsonpatch['apply'](_0x4f13be,_0x589122,!![]);}catch(_0x13a7f5){return BPromise[_0xd9b7('0x23')](_0x13a7f5);}return _0x4f13be[_0xd9b7('0x24')]();};}function saveUpdates(_0x3b8b83,_0x36092d){return function(_0x55d153){if(_0x55d153){return _0x55d153[_0xd9b7('0x25')](_0x3b8b83)[_0xd9b7('0x26')](function(_0x493e1f){return _0x493e1f;});}return null;};}function removeEntity(_0x3753fa,_0x5bb4e3){return function(_0x2b7b28){if(_0x2b7b28){return _0x2b7b28['destroy']()[_0xd9b7('0x26')](function(){_0x3753fa[_0xd9b7('0x1c')](0xcc)[_0xd9b7('0x27')]();});}};}function handleEntityNotFound(_0x432876,_0x35590f){return function(_0x1e18e1){if(!_0x1e18e1){_0x432876[_0xd9b7('0x1b')](0x194);}return _0x1e18e1;};}function handleError(_0x1bfaa0,_0x5d30e1){_0x5d30e1=_0x5d30e1||0x1f4;return function(_0x3e8b31){logger[_0xd9b7('0x28')](_0x3e8b31['stack']);if(_0x3e8b31['name']){delete _0x3e8b31[_0xd9b7('0x29')];}_0x1bfaa0[_0xd9b7('0x1c')](_0x5d30e1)[_0xd9b7('0x2a')](_0x3e8b31);};}exports['index']=function(_0x543ac8,_0x15fbeb){var _0x409e14={},_0x1cd19e={},_0xdc0f76={'count':0x0,'rows':[]};var _0x305c0a=db[_0xd9b7('0x2b')][_0xd9b7('0x2c')];_0x1cd19e['model']=_['keys'](_0x305c0a);_0x1cd19e['query']=_[_0xd9b7('0x2d')](_0x543ac8[_0xd9b7('0x2e')]);_0x1cd19e[_0xd9b7('0x2f')]=_['intersection'](_0x1cd19e[_0xd9b7('0x30')],_0x1cd19e[_0xd9b7('0x2e')]);_0x409e14[_0xd9b7('0x31')]=_[_0xd9b7('0x32')](_0x1cd19e[_0xd9b7('0x30')],qs[_0xd9b7('0x33')](_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x33')]));_0x409e14[_0xd9b7('0x31')]=_0x409e14[_0xd9b7('0x31')]['length']?_0x409e14[_0xd9b7('0x31')]:_0x1cd19e['model'];if(!_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x34')](_0xd9b7('0x35'))){_0x409e14[_0xd9b7('0x20')]=qs[_0xd9b7('0x20')](_0x543ac8['query'][_0xd9b7('0x20')]);_0x409e14[_0xd9b7('0x1f')]=qs[_0xd9b7('0x1f')](_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x1f')]);}_0x409e14[_0xd9b7('0x36')]=qs['sort'](_0x543ac8['query'][_0xd9b7('0x37')]);_0x409e14[_0xd9b7('0x38')]=qs[_0xd9b7('0x2f')](_['pick'](_0x543ac8[_0xd9b7('0x2e')],_0x1cd19e[_0xd9b7('0x2f')]));if(_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x39')]){_0x409e14[_0xd9b7('0x38')]=_[_0xd9b7('0x3a')](_0x409e14['where'],{'$or':_[_0xd9b7('0x3b')](_0x305c0a,function(_0x556947){if(_0x556947[_0xd9b7('0x3c')]['key']!==_0xd9b7('0x3d')){var _0x352475={};_0x352475[_0x556947['field']]={'$like':'%'+_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x39')]+'%'};return _0x352475;}})});}_0x409e14=_[_0xd9b7('0x3a')]({},_0x409e14,_0x543ac8[_0xd9b7('0x3e')]);var _0x370a5f={'where':_0x409e14[_0xd9b7('0x38')]};return db[_0xd9b7('0x2b')][_0xd9b7('0x1e')](_0x370a5f)['then'](function(_0x5f3d58){_0xdc0f76['count']=_0x5f3d58;if(_0x543ac8[_0xd9b7('0x2e')][_0xd9b7('0x3f')]){_0x409e14['include']=[{'all':!![]}];}return db[_0xd9b7('0x2b')][_0xd9b7('0x40')](_0x409e14);})[_0xd9b7('0x26')](function(_0x3982b4){_0xdc0f76[_0xd9b7('0x41')]=_0x3982b4;return _0xdc0f76;})[_0xd9b7('0x26')](respondWithFilteredResult(_0x15fbeb,_0x409e14))[_0xd9b7('0x42')](handleError(_0x15fbeb,null));};exports['show']=function(_0x435d3c,_0x35cec5){var _0x37b0a8={'raw':![],'where':{'id':_0x435d3c[_0xd9b7('0x43')]['id']}},_0x44b29d={};_0x44b29d['model']=_['keys'](db[_0xd9b7('0x2b')][_0xd9b7('0x2c')]);_0x44b29d[_0xd9b7('0x2e')]=_['keys'](_0x435d3c[_0xd9b7('0x2e')]);_0x44b29d[_0xd9b7('0x2f')]=_[_0xd9b7('0x32')](_0x44b29d[_0xd9b7('0x30')],_0x44b29d[_0xd9b7('0x2e')]);_0x37b0a8['attributes']=_[_0xd9b7('0x32')](_0x44b29d[_0xd9b7('0x30')],qs['fields'](_0x435d3c[_0xd9b7('0x2e')][_0xd9b7('0x33')]));_0x37b0a8[_0xd9b7('0x31')]=_0x37b0a8[_0xd9b7('0x31')]['length']?_0x37b0a8[_0xd9b7('0x31')]:_0x44b29d[_0xd9b7('0x30')];if(_0x435d3c[_0xd9b7('0x2e')]['includeAll']){_0x37b0a8['include']=[{'all':!![]}];}_0x37b0a8=_[_0xd9b7('0x3a')]({},_0x37b0a8,_0x435d3c['options']);return db['UserProfileResource'][_0xd9b7('0x44')](_0x37b0a8)[_0xd9b7('0x26')](handleEntityNotFound(_0x35cec5,null))[_0xd9b7('0x26')](respondWithResult(_0x35cec5,null))[_0xd9b7('0x42')](handleError(_0x35cec5,null));};exports['create']=function(_0x3acc6b,_0x5ddb74){return db['UserProfileResource'][_0xd9b7('0x45')](_0x3acc6b[_0xd9b7('0x46')],{})['then'](respondWithResult(_0x5ddb74,0xc9))['catch'](handleError(_0x5ddb74,null));};exports[_0xd9b7('0x25')]=function(_0x614509,_0x337af4){if(_0x614509['body']['id']){delete _0x614509[_0xd9b7('0x46')]['id'];}return db[_0xd9b7('0x2b')][_0xd9b7('0x44')]({'where':{'id':_0x614509[_0xd9b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x337af4,null))[_0xd9b7('0x26')](saveUpdates(_0x614509[_0xd9b7('0x46')],null))[_0xd9b7('0x26')](respondWithResult(_0x337af4,null))[_0xd9b7('0x42')](handleError(_0x337af4,null));};exports[_0xd9b7('0x47')]=function(_0x568f9c,_0x54074e){return db['UserProfileResource'][_0xd9b7('0x44')]({'where':{'id':_0x568f9c[_0xd9b7('0x43')]['id']}})[_0xd9b7('0x26')](handleEntityNotFound(_0x54074e,null))[_0xd9b7('0x26')](removeEntity(_0x54074e,null))[_0xd9b7('0x42')](handleError(_0x54074e,null));};exports[_0xd9b7('0x48')]=function(_0x4f00f2,_0x4fc8a0){return db[_0xd9b7('0x2b')][_0xd9b7('0x48')]()['then'](respondWithResult(_0x4fc8a0,null))[_0xd9b7('0x42')](handleError(_0x4fc8a0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0805406..4293083 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 _0xb287=['resourceId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources'];(function(_0x4a0ecf,_0x49d5bc){var _0x24057e=function(_0x54267b){while(--_0x54267b){_0x4a0ecf['push'](_0x4a0ecf['shift']());}};_0x24057e(++_0x49d5bc);}(_0xb287,0x69));var _0x7b28=function(_0x407130,_0x3f1939){_0x407130=_0x407130-0x0;var _0x53fc27=_0xb287[_0x407130];return _0x53fc27;};'use strict';var _=require(_0x7b28('0x0'));var util=require('util');var logger=require(_0x7b28('0x1'))('api');var moment=require(_0x7b28('0x2'));var BPromise=require(_0x7b28('0x3'));var rp=require(_0x7b28('0x4'));var fs=require('fs');var path=require(_0x7b28('0x5'));var rimraf=require(_0x7b28('0x6'));var config=require(_0x7b28('0x7'));var attributes=require(_0x7b28('0x8'));module[_0x7b28('0x9')]=function(_0x187655,_0x4851dd){return _0x187655['define'](_0x7b28('0xa'),attributes,{'tableName':_0x7b28('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7b28('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e60=['../../config/logger','api','moment','bluebird','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x8e60,0x14f));var _0x08e6=function(_0x3e32d6,_0x37c0bb){_0x3e32d6=_0x3e32d6-0x0;var _0x52af90=_0x8e60[_0x3e32d6];return _0x52af90;};'use strict';var _=require(_0x08e6('0x0'));var util=require('util');var logger=require(_0x08e6('0x1'))(_0x08e6('0x2'));var moment=require(_0x08e6('0x3'));var BPromise=require(_0x08e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08e6('0x5'));var rimraf=require(_0x08e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x08e6('0x7'));module[_0x08e6('0x8')]=function(_0x499938,_0x217b69){return _0x499938[_0x08e6('0x9')](_0x08e6('0xa'),attributes,{'tableName':_0x08e6('0xb'),'paranoid':![],'indexes':[{'name':_0x08e6('0xc'),'fields':['resourceId',_0x08e6('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 2741306..bf446db 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 _0xef17=['client','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2282e1,_0x1f26b4){var _0x16ffcd=function(_0x45771e){while(--_0x45771e){_0x2282e1['push'](_0x2282e1['shift']());}};_0x16ffcd(++_0x1f26b4);}(_0xef17,0x136));var _0x7ef1=function(_0x54b3fb,_0x521358){_0x54b3fb=_0x54b3fb-0x0;var _0x114c6e=_0xef17[_0x54b3fb];return _0x114c6e;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var moment=require(_0x7ef1('0x2'));var BPromise=require(_0x7ef1('0x3'));var rs=require(_0x7ef1('0x4'));var fs=require('fs');var Redis=require(_0x7ef1('0x5'));var db=require(_0x7ef1('0x6'))['db'];var utils=require(_0x7ef1('0x7'));var logger=require(_0x7ef1('0x8'))('rpc');var config=require(_0x7ef1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ef1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a040,_0x4ba2f0,_0x5aec63){return new BPromise(function(_0x10c896,_0x3398a6){return client['request'](_0x34a040,_0x5aec63)[_0x7ef1('0xb')](function(_0x1d5b33){logger[_0x7ef1('0xc')](_0x7ef1('0xd'),_0x4ba2f0,_0x7ef1('0xe'));logger[_0x7ef1('0xf')](_0x7ef1('0x10'),_0x4ba2f0,'request\x20sent',JSON['stringify'](_0x1d5b33));if(_0x1d5b33[_0x7ef1('0x11')]){if(_0x1d5b33['error']['code']===0x1f4){logger['error'](_0x7ef1('0xd'),_0x4ba2f0,_0x1d5b33['error'][_0x7ef1('0x12')]);return _0x3398a6(_0x1d5b33[_0x7ef1('0x11')][_0x7ef1('0x12')]);}logger[_0x7ef1('0x11')](_0x7ef1('0xd'),_0x4ba2f0,_0x1d5b33[_0x7ef1('0x11')][_0x7ef1('0x12')]);return _0x10c896(_0x1d5b33[_0x7ef1('0x11')]['message']);}else{logger['info'](_0x7ef1('0xd'),_0x4ba2f0,'request\x20sent');_0x10c896(_0x1d5b33[_0x7ef1('0x13')][_0x7ef1('0x12')]);}})['catch'](function(_0x4e26d1){logger['error'](_0x7ef1('0xd'),_0x4ba2f0,_0x4e26d1);_0x3398a6(_0x4e26d1);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x4f7031,_0x23c2ae){var _0xe4ac5d=function(_0xd0311e){while(--_0xd0311e){_0x4f7031['push'](_0x4f7031['shift']());}};_0xe4ac5d(++_0x23c2ae);}(_0x4819,0xcd));var _0x9481=function(_0x36fa31,_0x33ddeb){_0x36fa31=_0x36fa31-0x0;var _0x191e7d=_0x4819[_0x36fa31];return _0x191e7d;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f560b5e..7f65c1c 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 _0x0de9=['show','post','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x1c4e14,_0x39b95e){var _0x18f7a3=function(_0x1cf5a2){while(--_0x1cf5a2){_0x1c4e14['push'](_0x1c4e14['shift']());}};_0x18f7a3(++_0x39b95e);}(_0x0de9,0x182));var _0x90de=function(_0x1a3978,_0x1f20ff){_0x1a3978=_0x1a3978-0x0;var _0x1a1ef5=_0x0de9[_0x1a3978];return _0x1a1ef5;};'use strict';var multer=require(_0x90de('0x0'));var util=require(_0x90de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90de('0x2')]();var auth=require(_0x90de('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90de('0x4'));router[_0x90de('0x5')]('/',auth[_0x90de('0x6')](),controller[_0x90de('0x7')]);router['get'](_0x90de('0x8'),auth[_0x90de('0x6')](),controller['describe']);router[_0x90de('0x5')](_0x90de('0x9'),auth[_0x90de('0x6')](),controller[_0x90de('0xa')]);router[_0x90de('0xb')]('/',auth[_0x90de('0x6')](),controller[_0x90de('0xc')]);router[_0x90de('0xd')]('/:id',auth[_0x90de('0x6')](),controller[_0x90de('0xe')]);router[_0x90de('0xf')](_0x90de('0x9'),auth['isAuthenticated'](),controller[_0x90de('0x10')]);module[_0x90de('0x11')]=router; \ No newline at end of file +var _0xdbab=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xdbab,0x66));var _0xbdba=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xdbab[_0x53b133];return _0x5647e0;};'use strict';var multer=require(_0xbdba('0x0'));var util=require(_0xbdba('0x1'));var path=require(_0xbdba('0x2'));var timeout=require(_0xbdba('0x3'));var express=require(_0xbdba('0x4'));var router=express[_0xbdba('0x5')]();var auth=require(_0xbdba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbdba('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbdba('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xbdba('0x9')](_0xbdba('0xa'),auth[_0xbdba('0xb')](),controller[_0xbdba('0xc')]);router['post']('/',auth[_0xbdba('0xb')](),controller[_0xbdba('0xd')]);router[_0xbdba('0xe')](_0xbdba('0xa'),auth[_0xbdba('0xb')](),controller['update']);router[_0xbdba('0xf')](_0xbdba('0xa'),auth[_0xbdba('0xb')](),controller[_0xbdba('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 74a6b08..b0ae66c 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 _0xa9e0=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x25d39a,_0x641da8){var _0x25d1e6=function(_0x1bb3bf){while(--_0x1bb3bf){_0x25d39a['push'](_0x25d39a['shift']());}};_0x25d1e6(++_0x641da8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0a9e('0x2')],'set':function(_0x432180){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x432180?_0x432180[_0x0a9e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x0a9e('0x5'))?this[_0x0a9e('0x7')](_0x0a9e('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x008c=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x4e71ac,_0x42aced){var _0x11d76c=function(_0xcf5279){while(--_0xcf5279){_0x4e71ac['push'](_0x4e71ac['shift']());}};_0x11d76c(++_0x42aced);}(_0x008c,0x188));var _0xc008=function(_0x16851c,_0x2f22fc){_0x16851c=_0x16851c-0x0;var _0x4cd143=_0x008c[_0x16851c];return _0x4cd143;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xc008('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc008('0x2')],'set':function(_0x10b33c){this[_0xc008('0x5')](_0xc008('0x6'),_0x10b33c?_0x10b33c[_0xc008('0x7')](''):[]);},'get':function(){return this[_0xc008('0x8')](_0xc008('0x6'))?this[_0xc008('0x8')]('crudPermissions')[_0xc008('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7bae7c6..80be7ae 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 _0xadb5=['then','sendStatus','error','name','send','index','UserProfileSection','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','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','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy'];(function(_0x4a7dea,_0x20570b){var _0x163953=function(_0x456c9d){while(--_0x456c9d){_0x4a7dea['push'](_0x4a7dea['shift']());}};_0x163953(++_0x20570b);}(_0xadb5,0xad));var _0x5adb=function(_0x281913,_0x3de353){_0x281913=_0x281913-0x0;var _0x3d92d3=_0xadb5[_0x281913];return _0x3d92d3;};'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 hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f0d5,_0x56012f){_0x56012f=_0x56012f||0xcc;return function(_0x2a0b70){if(_0x2a0b70){return _0x29f0d5['sendStatus'](_0x56012f);}return _0x29f0d5[_0x5adb('0x17')](_0x56012f)[_0x5adb('0x18')]();};}function respondWithResult(_0x44abe3,_0x5c929a){_0x5c929a=_0x5c929a||0xc8;return function(_0x2a545b){if(_0x2a545b){return _0x44abe3[_0x5adb('0x17')](_0x5c929a)[_0x5adb('0x19')](_0x2a545b);}};}function respondWithFilteredResult(_0x5263ec,_0x2312de){return function(_0x518823){if(_0x518823){var _0x367d82=_0x518823[_0x5adb('0x1a')],_0x42a482=_0x2312de[_0x5adb('0x1b')],_0x30614e=_0x2312de[_0x5adb('0x1b')]+_0x2312de[_0x5adb('0x1c')],_0x304784;if(_0x30614e>=_0x367d82){_0x30614e=_0x367d82;_0x304784=0xc8;}else{_0x304784=0xce;}_0x5263ec[_0x5adb('0x17')](_0x304784);return _0x5263ec['set'](_0x5adb('0x1d'),_0x42a482+'-'+_0x30614e+'/'+_0x367d82)['json'](_0x518823);}return null;};}function patchUpdates(_0x1d9e86){return function(_0x558f76){try{jsonpatch[_0x5adb('0x1e')](_0x558f76,_0x1d9e86,!![]);}catch(_0x50e84f){return BPromise['reject'](_0x50e84f);}return _0x558f76[_0x5adb('0x1f')]();};}function saveUpdates(_0x1bed20,_0x438671){return function(_0x1fd4a7){if(_0x1fd4a7){return _0x1fd4a7[_0x5adb('0x20')](_0x1bed20)['then'](function(_0x3255b3){return _0x3255b3;});}return null;};}function removeEntity(_0x5c296e,_0x4e9f16){return function(_0x3754cc){if(_0x3754cc){return _0x3754cc[_0x5adb('0x21')]()[_0x5adb('0x22')](function(){_0x5c296e[_0x5adb('0x17')](0xcc)[_0x5adb('0x18')]();});}};}function handleEntityNotFound(_0x413911,_0xfd9bb9){return function(_0x4ca150){if(!_0x4ca150){_0x413911[_0x5adb('0x23')](0x194);}return _0x4ca150;};}function handleError(_0x373cc3,_0x3220cd){_0x3220cd=_0x3220cd||0x1f4;return function(_0x3839fb){logger[_0x5adb('0x24')](_0x3839fb['stack']);if(_0x3839fb[_0x5adb('0x25')]){delete _0x3839fb[_0x5adb('0x25')];}_0x373cc3['status'](_0x3220cd)[_0x5adb('0x26')](_0x3839fb);};}exports[_0x5adb('0x27')]=function(_0x1a0acd,_0x55b40a){var _0x13ad1d={},_0xbe21b1={},_0x3a4fca={'count':0x0,'rows':[]};var _0x2c64a3=db[_0x5adb('0x28')][_0x5adb('0x29')];_0xbe21b1['model']=_['keys'](_0x2c64a3);_0xbe21b1['query']=_[_0x5adb('0x2a')](_0x1a0acd[_0x5adb('0x2b')]);_0xbe21b1[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0xbe21b1[_0x5adb('0x2e')],_0xbe21b1['query']);_0x13ad1d[_0x5adb('0x2f')]=_[_0x5adb('0x2d')](_0xbe21b1[_0x5adb('0x2e')],qs[_0x5adb('0x30')](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x30')]));_0x13ad1d[_0x5adb('0x2f')]=_0x13ad1d[_0x5adb('0x2f')][_0x5adb('0x31')]?_0x13ad1d[_0x5adb('0x2f')]:_0xbe21b1['model'];if(!_0x1a0acd[_0x5adb('0x2b')]['hasOwnProperty'](_0x5adb('0x32'))){_0x13ad1d[_0x5adb('0x1c')]=qs['limit'](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x1c')]);_0x13ad1d[_0x5adb('0x1b')]=qs['offset'](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x1b')]);}_0x13ad1d['order']=qs['sort'](_0x1a0acd[_0x5adb('0x2b')]['sort']);_0x13ad1d[_0x5adb('0x33')]=qs[_0x5adb('0x2c')](_[_0x5adb('0x34')](_0x1a0acd[_0x5adb('0x2b')],_0xbe21b1[_0x5adb('0x2c')]));if(_0x1a0acd['query'][_0x5adb('0x35')]){_0x13ad1d[_0x5adb('0x33')]=_[_0x5adb('0x36')](_0x13ad1d['where'],{'$or':_['map'](_0x2c64a3,function(_0x32eb69){if(_0x32eb69[_0x5adb('0x37')]['key']!==_0x5adb('0x38')){var _0x4a4260={};_0x4a4260[_0x32eb69[_0x5adb('0x39')]]={'$like':'%'+_0x1a0acd['query'][_0x5adb('0x35')]+'%'};return _0x4a4260;}})});}_0x13ad1d=_['merge']({},_0x13ad1d,_0x1a0acd[_0x5adb('0x3a')]);var _0x23a1db={'where':_0x13ad1d['where']};return db[_0x5adb('0x28')]['count'](_0x23a1db)[_0x5adb('0x22')](function(_0x34e828){_0x3a4fca[_0x5adb('0x1a')]=_0x34e828;if(_0x1a0acd['query'][_0x5adb('0x3b')]){_0x13ad1d[_0x5adb('0x3c')]=[{'all':!![]}];}return db[_0x5adb('0x28')][_0x5adb('0x3d')](_0x13ad1d);})[_0x5adb('0x22')](function(_0x52d74f){_0x3a4fca['rows']=_0x52d74f;return _0x3a4fca;})['then'](respondWithFilteredResult(_0x55b40a,_0x13ad1d))['catch'](handleError(_0x55b40a,null));};exports[_0x5adb('0x3e')]=function(_0x2fbe14,_0x3a104a){var _0x399489={'raw':![],'where':{'id':_0x2fbe14[_0x5adb('0x3f')]['id']}},_0x130e18={};_0x130e18[_0x5adb('0x2e')]=_[_0x5adb('0x2a')](db['UserProfileSection']['rawAttributes']);_0x130e18[_0x5adb('0x2b')]=_['keys'](_0x2fbe14[_0x5adb('0x2b')]);_0x130e18[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x130e18[_0x5adb('0x2e')],_0x130e18[_0x5adb('0x2b')]);_0x399489['attributes']=_[_0x5adb('0x2d')](_0x130e18[_0x5adb('0x2e')],qs['fields'](_0x2fbe14[_0x5adb('0x2b')][_0x5adb('0x30')]));_0x399489['attributes']=_0x399489[_0x5adb('0x2f')][_0x5adb('0x31')]?_0x399489[_0x5adb('0x2f')]:_0x130e18[_0x5adb('0x2e')];if(_0x2fbe14[_0x5adb('0x2b')][_0x5adb('0x3b')]){_0x399489[_0x5adb('0x3c')]=[{'all':!![]}];}_0x399489=_['merge']({},_0x399489,_0x2fbe14['options']);return db[_0x5adb('0x28')][_0x5adb('0x40')](_0x399489)[_0x5adb('0x22')](handleEntityNotFound(_0x3a104a,null))[_0x5adb('0x22')](respondWithResult(_0x3a104a,null))['catch'](handleError(_0x3a104a,null));};exports['create']=function(_0xaa32e4,_0x4d7d86){return db[_0x5adb('0x28')][_0x5adb('0x41')](_0xaa32e4[_0x5adb('0x42')],{})['then'](respondWithResult(_0x4d7d86,0xc9))[_0x5adb('0x43')](handleError(_0x4d7d86,null));};exports[_0x5adb('0x20')]=function(_0x5b574c,_0x7786c4){if(_0x5b574c[_0x5adb('0x42')]['id']){delete _0x5b574c[_0x5adb('0x42')]['id'];}return db[_0x5adb('0x28')][_0x5adb('0x40')]({'where':{'id':_0x5b574c[_0x5adb('0x3f')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x7786c4,null))[_0x5adb('0x22')](saveUpdates(_0x5b574c['body'],null))[_0x5adb('0x22')](respondWithResult(_0x7786c4,null))['catch'](handleError(_0x7786c4,null));};exports['destroy']=function(_0x5015ee,_0x3cd211){return db[_0x5adb('0x28')][_0x5adb('0x40')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))['then'](removeEntity(_0x3cd211,null))[_0x5adb('0x43')](handleError(_0x3cd211,null));};exports[_0x5adb('0x44')]=function(_0x3f9dc7,_0x541537){return db[_0x5adb('0x28')]['describe']()[_0x5adb('0x22')](respondWithResult(_0x541537,null))[_0x5adb('0x43')](handleError(_0x541537,null));}; \ No newline at end of file +var _0x5f2f=['json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','key','options','includeAll','include','findAll','catch','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x325d1b,_0x555da4){var _0x43a7cb=function(_0x2f9421){while(--_0x2f9421){_0x325d1b['push'](_0x325d1b['shift']());}};_0x43a7cb(++_0x555da4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a3196,_0x38d436){_0x3a3196=_0x3a3196-0x0;var _0x295b5c=_0x5f2f[_0x3a3196];return _0x295b5c;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336f6b,_0x14b51f){_0x14b51f=_0x14b51f||0xcc;return function(_0x331482){if(_0x331482){return _0x336f6b[_0xf5f2('0x16')](_0x14b51f);}return _0x336f6b[_0xf5f2('0x17')](_0x14b51f)[_0xf5f2('0x18')]();};}function respondWithResult(_0x5c01b8,_0x5850f4){_0x5850f4=_0x5850f4||0xc8;return function(_0xea612c){if(_0xea612c){return _0x5c01b8[_0xf5f2('0x17')](_0x5850f4)[_0xf5f2('0x19')](_0xea612c);}};}function respondWithFilteredResult(_0x422b55,_0x4d97fc){return function(_0xafe430){if(_0xafe430){var _0x286197=_0xafe430[_0xf5f2('0x1a')],_0x17d656=_0x4d97fc[_0xf5f2('0x1b')],_0x1b6dd2=_0x4d97fc[_0xf5f2('0x1b')]+_0x4d97fc[_0xf5f2('0x1c')],_0x23e23a;if(_0x1b6dd2>=_0x286197){_0x1b6dd2=_0x286197;_0x23e23a=0xc8;}else{_0x23e23a=0xce;}_0x422b55[_0xf5f2('0x17')](_0x23e23a);return _0x422b55[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x17d656+'-'+_0x1b6dd2+'/'+_0x286197)[_0xf5f2('0x19')](_0xafe430);}return null;};}function patchUpdates(_0x3ee69){return function(_0x3cf5ea){try{jsonpatch[_0xf5f2('0x1f')](_0x3cf5ea,_0x3ee69,!![]);}catch(_0x1bf655){return BPromise['reject'](_0x1bf655);}return _0x3cf5ea[_0xf5f2('0x20')]();};}function saveUpdates(_0x47101e,_0x49dac2){return function(_0x47acfc){if(_0x47acfc){return _0x47acfc[_0xf5f2('0x21')](_0x47101e)[_0xf5f2('0x22')](function(_0x4ae323){return _0x4ae323;});}return null;};}function removeEntity(_0x45b74f,_0x170042){return function(_0x39e44a){if(_0x39e44a){return _0x39e44a[_0xf5f2('0x23')]()[_0xf5f2('0x22')](function(){_0x45b74f['status'](0xcc)[_0xf5f2('0x18')]();});}};}function handleEntityNotFound(_0x4669a6,_0x4e8bda){return function(_0x2833fe){if(!_0x2833fe){_0x4669a6[_0xf5f2('0x16')](0x194);}return _0x2833fe;};}function handleError(_0x5bdf4a,_0x529f07){_0x529f07=_0x529f07||0x1f4;return function(_0x5f1124){logger[_0xf5f2('0x24')](_0x5f1124[_0xf5f2('0x25')]);if(_0x5f1124[_0xf5f2('0x26')]){delete _0x5f1124[_0xf5f2('0x26')];}_0x5bdf4a[_0xf5f2('0x17')](_0x529f07)[_0xf5f2('0x27')](_0x5f1124);};}exports[_0xf5f2('0x28')]=function(_0x294414,_0x4ab014){var _0xaa2602={},_0x102449={},_0x375ca8={'count':0x0,'rows':[]};var _0x31bfcb=db[_0xf5f2('0x29')][_0xf5f2('0x2a')];_0x102449['model']=_['keys'](_0x31bfcb);_0x102449[_0xf5f2('0x2b')]=_[_0xf5f2('0x2c')](_0x294414[_0xf5f2('0x2b')]);_0x102449['filters']=_['intersection'](_0x102449[_0xf5f2('0x2d')],_0x102449[_0xf5f2('0x2b')]);_0xaa2602[_0xf5f2('0x2e')]=_[_0xf5f2('0x2f')](_0x102449[_0xf5f2('0x2d')],qs['fields'](_0x294414['query'][_0xf5f2('0x30')]));_0xaa2602['attributes']=_0xaa2602[_0xf5f2('0x2e')]['length']?_0xaa2602[_0xf5f2('0x2e')]:_0x102449[_0xf5f2('0x2d')];if(!_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x31')](_0xf5f2('0x32'))){_0xaa2602[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x294414[_0xf5f2('0x2b')]['limit']);_0xaa2602[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x1b')]);}_0xaa2602[_0xf5f2('0x33')]=qs[_0xf5f2('0x34')](_0x294414[_0xf5f2('0x2b')]['sort']);_0xaa2602[_0xf5f2('0x35')]=qs[_0xf5f2('0x36')](_['pick'](_0x294414[_0xf5f2('0x2b')],_0x102449['filters']));if(_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x37')]){_0xaa2602[_0xf5f2('0x35')]=_[_0xf5f2('0x38')](_0xaa2602['where'],{'$or':_['map'](_0x31bfcb,function(_0x41088b){if(_0x41088b[_0xf5f2('0x39')][_0xf5f2('0x3a')]!=='VIRTUAL'){var _0x41447f={};_0x41447f[_0x41088b['field']]={'$like':'%'+_0x294414[_0xf5f2('0x2b')]['filter']+'%'};return _0x41447f;}})});}_0xaa2602=_[_0xf5f2('0x38')]({},_0xaa2602,_0x294414[_0xf5f2('0x3b')]);var _0x5337a6={'where':_0xaa2602[_0xf5f2('0x35')]};return db[_0xf5f2('0x29')][_0xf5f2('0x1a')](_0x5337a6)[_0xf5f2('0x22')](function(_0x542cd6){_0x375ca8['count']=_0x542cd6;if(_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x3c')]){_0xaa2602[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0xaa2602);})[_0xf5f2('0x22')](function(_0x2bc20e){_0x375ca8['rows']=_0x2bc20e;return _0x375ca8;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x4ab014,_0xaa2602))[_0xf5f2('0x3f')](handleError(_0x4ab014,null));};exports['show']=function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'raw':![],'where':{'id':_0xc6a1ae[_0xf5f2('0x40')]['id']}},_0x85b6d0={};_0x85b6d0[_0xf5f2('0x2d')]=_[_0xf5f2('0x2c')](db[_0xf5f2('0x29')]['rawAttributes']);_0x85b6d0[_0xf5f2('0x2b')]=_[_0xf5f2('0x2c')](_0xc6a1ae[_0xf5f2('0x2b')]);_0x85b6d0['filters']=_['intersection'](_0x85b6d0['model'],_0x85b6d0[_0xf5f2('0x2b')]);_0x71b0e7[_0xf5f2('0x2e')]=_['intersection'](_0x85b6d0[_0xf5f2('0x2d')],qs[_0xf5f2('0x30')](_0xc6a1ae[_0xf5f2('0x2b')][_0xf5f2('0x30')]));_0x71b0e7[_0xf5f2('0x2e')]=_0x71b0e7[_0xf5f2('0x2e')][_0xf5f2('0x41')]?_0x71b0e7[_0xf5f2('0x2e')]:_0x85b6d0[_0xf5f2('0x2d')];if(_0xc6a1ae[_0xf5f2('0x2b')][_0xf5f2('0x3c')]){_0x71b0e7[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x71b0e7=_[_0xf5f2('0x38')]({},_0x71b0e7,_0xc6a1ae[_0xf5f2('0x3b')]);return db['UserProfileSection'][_0xf5f2('0x42')](_0x71b0e7)['then'](handleEntityNotFound(_0x3f3895,null))[_0xf5f2('0x22')](respondWithResult(_0x3f3895,null))[_0xf5f2('0x3f')](handleError(_0x3f3895,null));};exports[_0xf5f2('0x43')]=function(_0x36a4b0,_0x31bf0e){return db[_0xf5f2('0x29')]['create'](_0x36a4b0[_0xf5f2('0x44')],{})[_0xf5f2('0x22')](respondWithResult(_0x31bf0e,0xc9))[_0xf5f2('0x3f')](handleError(_0x31bf0e,null));};exports[_0xf5f2('0x21')]=function(_0x12124d,_0x10753a){if(_0x12124d[_0xf5f2('0x44')]['id']){delete _0x12124d[_0xf5f2('0x44')]['id'];}return db['UserProfileSection'][_0xf5f2('0x42')]({'where':{'id':_0x12124d[_0xf5f2('0x40')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x10753a,null))['then'](saveUpdates(_0x12124d[_0xf5f2('0x44')],null))[_0xf5f2('0x22')](respondWithResult(_0x10753a,null))[_0xf5f2('0x3f')](handleError(_0x10753a,null));};exports['destroy']=function(_0x57a7cb,_0x7bb942){return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x22')](removeEntity(_0x7bb942,null))['catch'](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x5d9120,_0x2d9017){return db[_0xf5f2('0x29')][_0xf5f2('0x45')]()[_0xf5f2('0x22')](respondWithResult(_0x2d9017,null))['catch'](handleError(_0x2d9017,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 558c199..cdcf7f0 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 _0x26be=['util','api','moment','bluebird','rimraf','../../config/environment','./userProfileSection.attributes','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x26be,0x108));var _0xe26b=function(_0x58466c,_0x56d428){_0x58466c=_0x58466c-0x0;var _0x6f27a8=_0x26be[_0x58466c];return _0x6f27a8;};'use strict';var _=require('lodash');var util=require(_0xe26b('0x0'));var logger=require('../../config/logger')(_0xe26b('0x1'));var moment=require(_0xe26b('0x2'));var BPromise=require(_0xe26b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe26b('0x4'));var config=require(_0xe26b('0x5'));var attributes=require(_0xe26b('0x6'));module['exports']=function(_0x398ce5,_0x22bf26){return _0x398ce5[_0xe26b('0x7')]('UserProfileSection',attributes,{'tableName':_0xe26b('0x8'),'paranoid':![],'indexes':[{'name':_0xe26b('0x9'),'fields':[_0xe26b('0xa'),_0xe26b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2a5=['sectionId','userProfileId','util','../../config/logger','path','rimraf','../../config/environment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x17c0cd,_0x162d35){var _0x29e983=function(_0x3b982d){while(--_0x3b982d){_0x17c0cd['push'](_0x17c0cd['shift']());}};_0x29e983(++_0x162d35);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x393508,_0x3fdf23){_0x393508=_0x393508-0x0;var _0xaccf15=_0xf2a5[_0x393508];return _0xaccf15;};'use strict';var _=require('lodash');var util=require(_0x5f2a('0x0'));var logger=require(_0x5f2a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f2a('0x2'));var rimraf=require(_0x5f2a('0x3'));var config=require(_0x5f2a('0x4'));var attributes=require(_0x5f2a('0x5'));module['exports']=function(_0x3fbcb9,_0x38d4e6){return _0x3fbcb9['define'](_0x5f2a('0x6'),attributes,{'tableName':_0x5f2a('0x7'),'paranoid':![],'indexes':[{'name':_0x5f2a('0x8'),'fields':[_0x5f2a('0x9'),_0x5f2a('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 8c10e0e..ea13dba 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 _0x565e=['stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x3ad634,_0x57aa61){var _0x2c5a32=function(_0x24a546){while(--_0x24a546){_0x3ad634['push'](_0x3ad634['shift']());}};_0x2c5a32(++_0x57aa61);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var moment=require(_0xe565('0x1'));var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe565('0x4'));var logger=require(_0xe565('0x5'))(_0xe565('0x6'));var config=require(_0xe565('0x7'));var jayson=require(_0xe565('0x8'));var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9d48,_0x470daf,_0x359a05){return new BPromise(function(_0x1204c8,_0x14f3df){return client[_0xe565('0xb')](_0x1a9d48,_0x359a05)[_0xe565('0xc')](function(_0x1d3d48){logger[_0xe565('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));logger[_0xe565('0xf')](_0xe565('0x10'),_0x470daf,'request\x20sent',JSON[_0xe565('0x11')](_0x1d3d48));if(_0x1d3d48[_0xe565('0x12')]){if(_0x1d3d48[_0xe565('0x12')][_0xe565('0x13')]===0x1f4){logger['error'](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x14f3df(_0x1d3d48['error'][_0xe565('0x15')]);}logger[_0xe565('0x12')](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x1204c8(_0x1d3d48[_0xe565('0x12')][_0xe565('0x15')]);}else{logger[_0xe565('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));_0x1204c8(_0x1d3d48[_0xe565('0x16')][_0xe565('0x15')]);}})[_0xe565('0x17')](function(_0x3899de){logger[_0xe565('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x470daf,_0x3899de);_0x14f3df(_0x3899de);});});} \ No newline at end of file +var _0xbeea=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x369a51,_0x54d3bd){var _0x10bafe=function(_0x5c3828){while(--_0x5c3828){_0x369a51['push'](_0x369a51['shift']());}};_0x10bafe(++_0x54d3bd);}(_0xbeea,0x144));var _0xabee=function(_0x37d3e0,_0x51d1f4){_0x37d3e0=_0x37d3e0-0x0;var _0x5512a3=_0xbeea[_0x37d3e0];return _0x5512a3;};'use strict';var _=require(_0xabee('0x0'));var util=require('util');var moment=require(_0xabee('0x1'));var BPromise=require('bluebird');var rs=require(_0xabee('0x2'));var fs=require('fs');var Redis=require(_0xabee('0x3'));var db=require(_0xabee('0x4'))['db'];var utils=require(_0xabee('0x5'));var logger=require('../../config/logger')(_0xabee('0x6'));var config=require(_0xabee('0x7'));var jayson=require(_0xabee('0x8'));var client=jayson[_0xabee('0x9')][_0xabee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22f28f,_0x38b09e,_0x4e7121){return new BPromise(function(_0x1c6c94,_0xb9155b){return client['request'](_0x22f28f,_0x4e7121)[_0xabee('0xb')](function(_0x272732){logger[_0xabee('0xc')](_0xabee('0xd'),_0x38b09e,'request\x20sent');logger[_0xabee('0xe')](_0xabee('0xf'),_0x38b09e,_0xabee('0x10'),JSON[_0xabee('0x11')](_0x272732));if(_0x272732[_0xabee('0x12')]){if(_0x272732[_0xabee('0x12')][_0xabee('0x13')]===0x1f4){logger[_0xabee('0x12')](_0xabee('0xd'),_0x38b09e,_0x272732[_0xabee('0x12')][_0xabee('0x14')]);return _0xb9155b(_0x272732[_0xabee('0x12')][_0xabee('0x14')]);}logger[_0xabee('0x12')](_0xabee('0xd'),_0x38b09e,_0x272732[_0xabee('0x12')][_0xabee('0x14')]);return _0x1c6c94(_0x272732[_0xabee('0x12')][_0xabee('0x14')]);}else{logger[_0xabee('0xc')](_0xabee('0xd'),_0x38b09e,_0xabee('0x10'));_0x1c6c94(_0x272732[_0xabee('0x15')][_0xabee('0x14')]);}})[_0xabee('0x16')](function(_0x38d6e6){logger[_0xabee('0x12')](_0xabee('0xd'),_0x38b09e,_0x38d6e6);_0xb9155b(_0x38d6e6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 88512b9..d111e25 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 _0x0ec6=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x572f29,_0x440636){var _0x5d170b=function(_0x48dc71){while(--_0x48dc71){_0x572f29['push'](_0x572f29['shift']());}};_0x5d170b(++_0x440636);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x18d9c4,_0x21a8cd){_0x18d9c4=_0x18d9c4-0x0;var _0x2b7ca6=_0x0ec6[_0x18d9c4];return _0x2b7ca6;};'use strict';var multer=require(_0x60ec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x60ec('0x1'));var express=require(_0x60ec('0x2'));var router=express[_0x60ec('0x3')]();var auth=require(_0x60ec('0x4'));var interaction=require(_0x60ec('0x5'));var config=require(_0x60ec('0x6'));module[_0x60ec('0x7')]=router; \ No newline at end of file +var _0x5430=['Router','../../config/environment','multer','util','path','connect-timeout','express'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5430,0x10c));var _0x0543=function(_0x3d92ca,_0x78ea6f){_0x3d92ca=_0x3d92ca-0x0;var _0x16b9d6=_0x5430[_0x3d92ca];return _0x16b9d6;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0543('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4020cac..8418b4d 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 _0x2160=['INTEGER','sequelize','exports'];(function(_0xee209,_0x4858f4){var _0x48cd8c=function(_0x5e3eda){while(--_0x5e3eda){_0xee209['push'](_0xee209['shift']());}};_0x48cd8c(++_0x4858f4);}(_0x2160,0xf4));var _0x0216=function(_0x419d52,_0x22c8b2){_0x419d52=_0x419d52-0x0;var _0x546335=_0x2160[_0x419d52];return _0x546335;};'use strict';var Sequelize=require(_0x0216('0x0'));module[_0x0216('0x1')]={'penalty':{'type':Sequelize[_0x0216('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7f9a=['sequelize','exports','INTEGER'];(function(_0x3aba0a,_0x3dac0c){var _0x54dcfa=function(_0x285b99){while(--_0x285b99){_0x3aba0a['push'](_0x3aba0a['shift']());}};_0x54dcfa(++_0x3dac0c);}(_0x7f9a,0x177));var _0xa7f9=function(_0x590959,_0x95d26f){_0x590959=_0x590959-0x0;var _0x4dccd7=_0x7f9a[_0x590959];return _0x4dccd7;};'use strict';var Sequelize=require(_0xa7f9('0x0'));module[_0xa7f9('0x1')]={'penalty':{'type':Sequelize[_0xa7f9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 2494272..3e1eed2 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 _0xd8fb=['lodash','util','../../config/logger','api','path','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0xacfe5e,_0x326d83){var _0x1f5861=function(_0x54f7e4){while(--_0x54f7e4){_0xacfe5e['push'](_0xacfe5e['shift']());}};_0x1f5861(++_0x326d83);}(_0xd8fb,0x99));var _0xbd8f=function(_0x257db0,_0x184c03){_0x257db0=_0x257db0-0x0;var _0xbe54ab=_0xd8fb[_0x257db0];return _0xbe54ab;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1d3=['../../config/environment','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xe1d3,0x159));var _0x3e1d=function(_0x469e99,_0x3b1b67){_0x469e99=_0x469e99-0x0;var _0x28c559=_0xe1d3[_0x469e99];return _0x28c559;};'use strict';var _=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var logger=require(_0x3e1d('0x2'))(_0x3e1d('0x3'));var moment=require(_0x3e1d('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1d('0x6'));var config=require(_0x3e1d('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4594cf,_0x44d676){return _0x4594cf[_0x3e1d('0x8')](_0x3e1d('0x9'),attributes,{'tableName':_0x3e1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 69d7e8d..cdd0149 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 _0xf7e6=['bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x5dd7ef,_0x32d4a1){var _0x1d04dc=function(_0x1a1f1f){while(--_0x1a1f1f){_0x5dd7ef['push'](_0x5dd7ef['shift']());}};_0x1d04dc(++_0x32d4a1);}(_0xf7e6,0x13d));var _0x6f7e=function(_0x5f2742,_0x27b605){_0x5f2742=_0x5f2742-0x0;var _0x60104d=_0xf7e6[_0x5f2742];return _0x60104d;};'use strict';var _=require(_0x6f7e('0x0'));var util=require(_0x6f7e('0x1'));var moment=require(_0x6f7e('0x2'));var BPromise=require(_0x6f7e('0x3'));var rs=require(_0x6f7e('0x4'));var fs=require('fs');var Redis=require(_0x6f7e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6f7e('0x6'));var jayson=require(_0x6f7e('0x7'));var client=jayson[_0x6f7e('0x8')][_0x6f7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2069c7,_0x5d298c,_0x3aa18c){return new BPromise(function(_0x867343,_0x378b50){return client[_0x6f7e('0xa')](_0x2069c7,_0x3aa18c)[_0x6f7e('0xb')](function(_0x543214){logger[_0x6f7e('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x5d298c,'request\x20sent');logger['debug'](_0x6f7e('0xd'),_0x5d298c,_0x6f7e('0xe'),JSON[_0x6f7e('0xf')](_0x543214));if(_0x543214[_0x6f7e('0x10')]){if(_0x543214['error']['code']===0x1f4){logger[_0x6f7e('0x10')](_0x6f7e('0x11'),_0x5d298c,_0x543214[_0x6f7e('0x10')][_0x6f7e('0x12')]);return _0x378b50(_0x543214[_0x6f7e('0x10')][_0x6f7e('0x12')]);}logger[_0x6f7e('0x10')](_0x6f7e('0x11'),_0x5d298c,_0x543214[_0x6f7e('0x10')]['message']);return _0x867343(_0x543214[_0x6f7e('0x10')][_0x6f7e('0x12')]);}else{logger['info'](_0x6f7e('0x11'),_0x5d298c,_0x6f7e('0xe'));_0x867343(_0x543214['result'][_0x6f7e('0x12')]);}})[_0x6f7e('0x13')](function(_0x5c1953){logger['error'](_0x6f7e('0x11'),_0x5d298c,_0x5c1953);_0x378b50(_0x5c1953);});});} \ No newline at end of file +var _0x1387=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xa6fa17,_0x2e5e5c){var _0x9f4a7=function(_0x4bbd22){while(--_0x4bbd22){_0xa6fa17['push'](_0xa6fa17['shift']());}};_0x9f4a7(++_0x2e5e5c);}(_0x1387,0x149));var _0x7138=function(_0x22e2e9,_0x62f6b1){_0x22e2e9=_0x22e2e9-0x0;var _0x56322a=_0x1387[_0x22e2e9];return _0x56322a;};'use strict';var _=require('lodash');var util=require(_0x7138('0x0'));var moment=require(_0x7138('0x1'));var BPromise=require('bluebird');var rs=require(_0x7138('0x2'));var fs=require('fs');var Redis=require(_0x7138('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7138('0x4'))(_0x7138('0x5'));var config=require(_0x7138('0x6'));var jayson=require(_0x7138('0x7'));var client=jayson['client'][_0x7138('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19e9fa,_0x3e1498,_0x3a3d65){return new BPromise(function(_0x56e1dd,_0x27beeb){return client[_0x7138('0x9')](_0x19e9fa,_0x3a3d65)[_0x7138('0xa')](function(_0x14a00d){logger[_0x7138('0xb')](_0x7138('0xc'),_0x3e1498,_0x7138('0xd'));logger[_0x7138('0xe')](_0x7138('0xf'),_0x3e1498,'request\x20sent',JSON[_0x7138('0x10')](_0x14a00d));if(_0x14a00d[_0x7138('0x11')]){if(_0x14a00d['error'][_0x7138('0x12')]===0x1f4){logger[_0x7138('0x11')](_0x7138('0xc'),_0x3e1498,_0x14a00d[_0x7138('0x11')]['message']);return _0x27beeb(_0x14a00d[_0x7138('0x11')]['message']);}logger['error'](_0x7138('0xc'),_0x3e1498,_0x14a00d[_0x7138('0x11')][_0x7138('0x13')]);return _0x56e1dd(_0x14a00d[_0x7138('0x11')]['message']);}else{logger[_0x7138('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x3e1498,'request\x20sent');_0x56e1dd(_0x14a00d['result'][_0x7138('0x13')]);}})['catch'](function(_0x96c546){logger[_0x7138('0x11')](_0x7138('0xc'),_0x3e1498,_0x96c546);_0x27beeb(_0x96c546);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 4ba76b6..3d0694b 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 _0x5e0e=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x5e0e,0x89));var _0xe5e0=function(_0x8269ae,_0xcd8119){_0x8269ae=_0x8269ae-0x0;var _0x1e733d=_0x5e0e[_0x8269ae];return _0x1e733d;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var auth=require(_0xe5e0('0x5'));var interaction=require(_0xe5e0('0x6'));var config=require('../../config/environment');module[_0xe5e0('0x7')]=router; \ No newline at end of file +var _0xbedb=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x2d9ece,_0x282f1c){var _0x4e2c19=function(_0x14ff16){while(--_0x14ff16){_0x2d9ece['push'](_0x2d9ece['shift']());}};_0x4e2c19(++_0x282f1c);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbbed('0x0'));var util=require('util');var path=require(_0xbbed('0x1'));var timeout=require(_0xbbed('0x2'));var express=require(_0xbbed('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbbed('0x4'));var config=require(_0xbbed('0x5'));module[_0xbbed('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 45e0327..461b73c 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 _0x64ee=['sequelize','INTEGER'];(function(_0x5e95c,_0x5d0943){var _0x3ff5b8=function(_0x389c15){while(--_0x389c15){_0x5e95c['push'](_0x5e95c['shift']());}};_0x3ff5b8(++_0x5d0943);}(_0x64ee,0x14a));var _0xe64e=function(_0x3f3a6a,_0x3020d5){_0x3f3a6a=_0x3f3a6a-0x0;var _0x507c7b=_0x64ee[_0x3f3a6a];return _0x507c7b;};'use strict';var Sequelize=require(_0xe64e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe64e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa444=['exports'];(function(_0x505294,_0x1ed00d){var _0x1969bb=function(_0x1cfb4b){while(--_0x1cfb4b){_0x505294['push'](_0x505294['shift']());}};_0x1969bb(++_0x1ed00d);}(_0xa444,0x1a8));var _0x4a44=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa444[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x4a44('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index b2a5628..81bd817 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 _0x603f=['../../config/logger','api','moment','request-promise','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','util'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0x603f,0x8b));var _0xf603=function(_0x28d3f4,_0x2a26f3){_0x28d3f4=_0x28d3f4-0x0;var _0x43596c=_0x603f[_0x28d3f4];return _0x43596c;};'use strict';var _=require('lodash');var util=require(_0xf603('0x0'));var logger=require(_0xf603('0x1'))(_0xf603('0x2'));var moment=require(_0xf603('0x3'));var BPromise=require('bluebird');var rp=require(_0xf603('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf603('0x5'));var attributes=require(_0xf603('0x6'));module['exports']=function(_0x1710a3,_0x54eb52){return _0x1710a3[_0xf603('0x7')](_0xf603('0x8'),attributes,{'tableName':_0xf603('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4394=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','user_has_voice_queues','lodash','util'];(function(_0x294f41,_0x14f314){var _0xe686d9=function(_0x4a06e5){while(--_0x4a06e5){_0x294f41['push'](_0x294f41['shift']());}};_0xe686d9(++_0x14f314);}(_0x4394,0xae));var _0x4439=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0x4394[_0x2ce9c3];return _0x109b3a;};'use strict';var _=require(_0x4439('0x0'));var util=require(_0x4439('0x1'));var logger=require(_0x4439('0x2'))(_0x4439('0x3'));var moment=require(_0x4439('0x4'));var BPromise=require(_0x4439('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4439('0x6'));var rimraf=require(_0x4439('0x7'));var config=require(_0x4439('0x8'));var attributes=require(_0x4439('0x9'));module['exports']=function(_0x17512a,_0x360e37){return _0x17512a['define']('UserVoiceQueue',attributes,{'tableName':_0x4439('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 7bfd4b6..7b3655b 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 _0x2d55=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e84c0,_0x2dfdd8){var _0x3a07be=function(_0x33e496){while(--_0x33e496){_0x2e84c0['push'](_0x2e84c0['shift']());}};_0x3a07be(++_0x2dfdd8);}(_0x2d55,0xa8));var _0x52d5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2d55[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x52d5('0x0'));var util=require(_0x52d5('0x1'));var moment=require(_0x52d5('0x2'));var BPromise=require(_0x52d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52d5('0x4'));var db=require(_0x52d5('0x5'))['db'];var utils=require(_0x52d5('0x6'));var logger=require(_0x52d5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x52d5('0x8'));var client=jayson[_0x52d5('0x9')][_0x52d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c008d,_0x190c1f,_0xfb8ea8){return new BPromise(function(_0x4f9154,_0x2b7694){return client[_0x52d5('0xb')](_0x3c008d,_0xfb8ea8)[_0x52d5('0xc')](function(_0xd2efa2){logger['info'](_0x52d5('0xd'),_0x190c1f,_0x52d5('0xe'));logger[_0x52d5('0xf')](_0x52d5('0x10'),_0x190c1f,_0x52d5('0xe'),JSON[_0x52d5('0x11')](_0xd2efa2));if(_0xd2efa2['error']){if(_0xd2efa2[_0x52d5('0x12')]['code']===0x1f4){logger[_0x52d5('0x12')](_0x52d5('0xd'),_0x190c1f,_0xd2efa2[_0x52d5('0x12')][_0x52d5('0x13')]);return _0x2b7694(_0xd2efa2['error'][_0x52d5('0x13')]);}logger[_0x52d5('0x12')](_0x52d5('0xd'),_0x190c1f,_0xd2efa2['error'][_0x52d5('0x13')]);return _0x4f9154(_0xd2efa2[_0x52d5('0x12')][_0x52d5('0x13')]);}else{logger[_0x52d5('0x14')](_0x52d5('0xd'),_0x190c1f,_0x52d5('0xe'));_0x4f9154(_0xd2efa2[_0x52d5('0x15')][_0x52d5('0x13')]);}})[_0x52d5('0x16')](function(_0x313fa1){logger[_0x52d5('0x12')](_0x52d5('0xd'),_0x190c1f,_0x313fa1);_0x2b7694(_0x313fa1);});});} \ No newline at end of file +var _0x61f8=['http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x34dfb3,_0x401d83){var _0x224c88=function(_0x13a24a){while(--_0x13a24a){_0x34dfb3['push'](_0x34dfb3['shift']());}};_0x224c88(++_0x401d83);}(_0x61f8,0xa7));var _0x861f=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x61f8[_0x55d829];return _0x52163b;};'use strict';var _=require(_0x861f('0x0'));var util=require(_0x861f('0x1'));var moment=require('moment');var BPromise=require(_0x861f('0x2'));var rs=require(_0x861f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x861f('0x4'))['db'];var utils=require(_0x861f('0x5'));var logger=require(_0x861f('0x6'))('rpc');var config=require(_0x861f('0x7'));var jayson=require(_0x861f('0x8'));var client=jayson['client'][_0x861f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4213e7,_0x53fe64,_0x3e653d){return new BPromise(function(_0xf49a7,_0x458711){return client[_0x861f('0xa')](_0x4213e7,_0x3e653d)[_0x861f('0xb')](function(_0x2fcc02){logger[_0x861f('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x53fe64,_0x861f('0xd'));logger[_0x861f('0xe')](_0x861f('0xf'),_0x53fe64,_0x861f('0xd'),JSON[_0x861f('0x10')](_0x2fcc02));if(_0x2fcc02[_0x861f('0x11')]){if(_0x2fcc02['error'][_0x861f('0x12')]===0x1f4){logger[_0x861f('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x53fe64,_0x2fcc02[_0x861f('0x11')][_0x861f('0x13')]);return _0x458711(_0x2fcc02[_0x861f('0x11')][_0x861f('0x13')]);}logger[_0x861f('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x53fe64,_0x2fcc02[_0x861f('0x11')][_0x861f('0x13')]);return _0xf49a7(_0x2fcc02[_0x861f('0x11')][_0x861f('0x13')]);}else{logger[_0x861f('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x53fe64,_0x861f('0xd'));_0xf49a7(_0x2fcc02[_0x861f('0x14')][_0x861f('0x13')]);}})[_0x861f('0x15')](function(_0x362851){logger[_0x861f('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x53fe64,_0x362851);_0x458711(_0x362851);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e442f90..bff1cfc 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 _0x5d17=['../../components/auth/service','../../config/environment','exports','multer','util','express','Router'];(function(_0x1fd4a7,_0x4fec53){var _0x456e64=function(_0x76aa3c){while(--_0x76aa3c){_0x1fd4a7['push'](_0x1fd4a7['shift']());}};_0x456e64(++_0x4fec53);}(_0x5d17,0x114));var _0x75d1=function(_0x3050b5,_0x182c6a){_0x3050b5=_0x3050b5-0x0;var _0x37cceb=_0x5d17[_0x3050b5];return _0x37cceb;};'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'));module[_0x75d1('0x6')]=router; \ No newline at end of file +var _0x0295=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','connect-timeout'];(function(_0x33314d,_0x499628){var _0x4ffe8e=function(_0xb1ec35){while(--_0xb1ec35){_0x33314d['push'](_0x33314d['shift']());}};_0x4ffe8e(++_0x499628);}(_0x0295,0x1f0));var _0x5029=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x0295[_0x3337b6];return _0x568270;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));module[_0x5029('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 e3acff3..f66d5a8 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 _0x7fe2=['sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x43ea2c,_0x458e54){var _0x4bcd5d=function(_0x2d82e5){while(--_0x2d82e5){_0x43ea2c['push'](_0x43ea2c['shift']());}};_0x4bcd5d(++_0x458e54);}(_0x7fe2,0x84));var _0x27fe=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x7fe2[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0x27fe('0x0'));module[_0x27fe('0x1')]={'uniqueid':{'type':Sequelize[_0x27fe('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x27fe('0x3')],'allowNull':![],'comment':_0x27fe('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x27fe('0x3')],'allowNull':![],'unique':_0x27fe('0x5'),'comment':_0x27fe('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x27fe('0x3')],'allowNull':![],'unique':_0x27fe('0x5'),'comment':_0x27fe('0x4')},'penalty':{'type':Sequelize[_0x27fe('0x2')](0xb),'defaultValue':0x0,'comment':_0x27fe('0x4')},'paused':{'type':Sequelize[_0x27fe('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x123d=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x2fcec9,_0xf4196b){var _0x5037b9=function(_0x5af87b){while(--_0x5af87b){_0x2fcec9['push'](_0x2fcec9['shift']());}};_0x5037b9(++_0xf4196b);}(_0x123d,0x109));var _0xd123=function(_0x9812a3,_0x6c4dd8){_0x9812a3=_0x9812a3-0x0;var _0x115bf9=_0x123d[_0x9812a3];return _0x115bf9;};'use strict';var Sequelize=require('sequelize');module[_0xd123('0x0')]={'uniqueid':{'type':Sequelize[_0xd123('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xd123('0x2')],'allowNull':![],'comment':_0xd123('0x3')},'UserId':{'type':Sequelize[_0xd123('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd123('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xd123('0x3')},'VoiceQueueId':{'type':Sequelize[_0xd123('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xd123('0x2')],'allowNull':![],'unique':_0xd123('0x4'),'comment':_0xd123('0x3')},'penalty':{'type':Sequelize[_0xd123('0x1')](0xb),'defaultValue':0x0,'comment':_0xd123('0x3')},'paused':{'type':Sequelize[_0xd123('0x1')](0xb),'defaultValue':0x0,'comment':_0xd123('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6664d37..d5368e8 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 _0x0abf=['hook','events','UserVoiceQueueRt','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4f1d63,_0x2b395d){var _0x2a5699=function(_0x233377){while(--_0x233377){_0x4f1d63['push'](_0x4f1d63['shift']());}};_0x2a5699(++_0x2b395d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xf0ab('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf0ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0ab('0x3')};function emitEvent(_0x4889fb){return function(_0x7ea4e0,_0x3be05e,_0x2efe43){UserVoiceQueueRtEvents[_0xf0ab('0x4')](_0x4889fb+':'+_0x7ea4e0['id'],_0x7ea4e0);UserVoiceQueueRtEvents[_0xf0ab('0x4')](_0x4889fb,_0x7ea4e0);_0x2efe43(null);};}for(var e in events){if(events[_0xf0ab('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xf0ab('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x9f0e=['UserVoiceQueueRt','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3adec2,_0x46d34c){_0x3adec2=_0x3adec2-0x0;var _0xc1b731=_0x9f0e[_0x3adec2];return _0xc1b731;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var UserVoiceQueueRt=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe9f0('0x3')](0x0);var events={'afterCreate':_0xe9f0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2325c6){return function(_0x150a03,_0x3c589d,_0x202d69){UserVoiceQueueRtEvents[_0xe9f0('0x5')](_0x2325c6+':'+_0x150a03['id'],_0x150a03);UserVoiceQueueRtEvents['emit'](_0x2325c6,_0x150a03);_0x202d69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xe9f0('0x6')](e,emitEvent(event));}}module[_0xe9f0('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 4ef42c8..cf87540 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 _0xb8fb=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x2375eb,_0x279c89){var _0x883d24=function(_0x11a31c){while(--_0x11a31c){_0x2375eb['push'](_0x2375eb['shift']());}};_0x883d24(++_0x279c89);}(_0xb8fb,0x135));var _0xbb8f=function(_0x3a912a,_0x37b8a1){_0x3a912a=_0x3a912a-0x0;var _0x30b5ba=_0xb8fb[_0x3a912a];return _0x30b5ba;};'use strict';var _=require(_0xbb8f('0x0'));var util=require(_0xbb8f('0x1'));var logger=require(_0xbb8f('0x2'))(_0xbb8f('0x3'));var moment=require(_0xbb8f('0x4'));var BPromise=require(_0xbb8f('0x5'));var rp=require(_0xbb8f('0x6'));var fs=require('fs');var path=require(_0xbb8f('0x7'));var rimraf=require(_0xbb8f('0x8'));var config=require('../../config/environment');var attributes=require(_0xbb8f('0x9'));module[_0xbb8f('0xa')]=function(_0x11d322,_0x50ed8e){return _0x11d322[_0xbb8f('0xb')](_0xbb8f('0xc'),attributes,{'tableName':_0xbb8f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x827d=['util','../../config/logger','moment','bluebird','request-promise','path','./userVoiceQueueRt.attributes','UserVoiceQueueRt','lodash'];(function(_0x1488df,_0x4b3ec2){var _0x2ad5d6=function(_0x215e9d){while(--_0x215e9d){_0x1488df['push'](_0x1488df['shift']());}};_0x2ad5d6(++_0x4b3ec2);}(_0x827d,0xce));var _0xd827=function(_0xbcdd85,_0x4143a7){_0xbcdd85=_0xbcdd85-0x0;var _0xaefbb0=_0x827d[_0xbcdd85];return _0xaefbb0;};'use strict';var _=require(_0xd827('0x0'));var util=require(_0xd827('0x1'));var logger=require(_0xd827('0x2'))('api');var moment=require(_0xd827('0x3'));var BPromise=require(_0xd827('0x4'));var rp=require(_0xd827('0x5'));var fs=require('fs');var path=require(_0xd827('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd827('0x7'));module['exports']=function(_0x42e6e7,_0x36fa71){return _0x42e6e7['define'](_0xd827('0x8'),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 3c61107..9f1dc2d 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 _0xf094=['../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','./userVoiceQueueRt.socket','register','request','info','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','util','moment','bluebird','randomstring','ioredis'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xf094,0x187));var _0x4f09=function(_0x12e73c,_0x2cbe1d){_0x12e73c=_0x12e73c-0x0;var _0x4c41cb=_0xf094[_0x12e73c];return _0x4c41cb;};'use strict';var _=require('lodash');var util=require(_0x4f09('0x0'));var moment=require(_0x4f09('0x1'));var BPromise=require(_0x4f09('0x2'));var rs=require(_0x4f09('0x3'));var fs=require('fs');var Redis=require(_0x4f09('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f09('0x5'));var logger=require('../../config/logger')(_0x4f09('0x6'));var config=require(_0x4f09('0x7'));var jayson=require(_0x4f09('0x8'));var client=jayson['client'][_0x4f09('0x9')]({'port':0x232a});config[_0x4f09('0xa')]=_[_0x4f09('0xb')](config[_0x4f09('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f09('0xa')]));require(_0x4f09('0xc'))[_0x4f09('0xd')](socket);function respondWithRpcPromise(_0x558b3f,_0x5227f5,_0x3d9e71){return new BPromise(function(_0x246dac,_0x391c54){return client[_0x4f09('0xe')](_0x558b3f,_0x3d9e71)['then'](function(_0x3e86df){logger[_0x4f09('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5227f5,_0x4f09('0x10'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5227f5,_0x4f09('0x10'),JSON[_0x4f09('0x11')](_0x3e86df));if(_0x3e86df[_0x4f09('0x12')]){if(_0x3e86df[_0x4f09('0x12')][_0x4f09('0x13')]===0x1f4){logger[_0x4f09('0x12')](_0x4f09('0x14'),_0x5227f5,_0x3e86df[_0x4f09('0x12')]['message']);return _0x391c54(_0x3e86df[_0x4f09('0x12')][_0x4f09('0x15')]);}logger['error'](_0x4f09('0x14'),_0x5227f5,_0x3e86df['error'][_0x4f09('0x15')]);return _0x246dac(_0x3e86df[_0x4f09('0x12')][_0x4f09('0x15')]);}else{logger[_0x4f09('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5227f5,_0x4f09('0x10'));_0x246dac(_0x3e86df[_0x4f09('0x16')][_0x4f09('0x15')]);}})[_0x4f09('0x17')](function(_0x3abed2){logger[_0x4f09('0x12')](_0x4f09('0x14'),_0x5227f5,_0x3abed2);_0x391c54(_0x3abed2);});});}exports[_0x4f09('0x18')]=function(_0x145ed7){var _0x330d45=this;return new Promise(function(_0x32cd08,_0xc2724f){return db[_0x4f09('0x19')][_0x4f09('0x1a')]({'raw':_0x145ed7[_0x4f09('0x1b')]?_0x145ed7['options']['raw']===undefined?!![]:![]:!![],'where':_0x145ed7[_0x4f09('0x1b')]?_0x145ed7[_0x4f09('0x1b')][_0x4f09('0x1c')]||null:null,'attributes':[[db[_0x4f09('0x1d')]['fn'](_0x4f09('0x1e'),db[_0x4f09('0x1d')]['fn']('IF',db[_0x4f09('0x1d')][_0x4f09('0x1f')](_0x4f09('0x20')))),_0x4f09('0x21')]]})[_0x4f09('0x22')](function(_0x29503d){logger[_0x4f09('0xf')](_0x4f09('0x18'),_0x145ed7);logger[_0x4f09('0x23')](_0x4f09('0x18'),_0x145ed7,JSON[_0x4f09('0x11')](_0x29503d));_0x32cd08(_0x29503d);})[_0x4f09('0x17')](function(_0x5c27d7){logger[_0x4f09('0x12')](_0x4f09('0x18'),_0x5c27d7[_0x4f09('0x15')],_0x145ed7);_0xc2724f(_0x330d45[_0x4f09('0x12')](0x1f4,_0x5c27d7[_0x4f09('0x15')]));});});}; \ No newline at end of file +var _0xde89=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xde89,0x108));var _0x9de8=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0xde89[_0x211632];return _0x5a1da1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9de8('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9de8('0x1'));var db=require(_0x9de8('0x2'))['db'];var utils=require(_0x9de8('0x3'));var logger=require('../../config/logger')(_0x9de8('0x4'));var config=require(_0x9de8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9de8('0x6')]['http']({'port':0x232a});config['redis']=_[_0x9de8('0x7')](config['redis'],{'host':_0x9de8('0x8'),'port':0x18eb});var socket=require(_0x9de8('0x9'))(new Redis(config[_0x9de8('0xa')]));require(_0x9de8('0xb'))[_0x9de8('0xc')](socket);function respondWithRpcPromise(_0x3253e8,_0x2d3609,_0x131ed7){return new BPromise(function(_0x467cf7,_0x284dbe){return client['request'](_0x3253e8,_0x131ed7)['then'](function(_0x5d9f37){logger[_0x9de8('0xd')](_0x9de8('0xe'),_0x2d3609,'request\x20sent');logger[_0x9de8('0xf')](_0x9de8('0x10'),_0x2d3609,'request\x20sent',JSON[_0x9de8('0x11')](_0x5d9f37));if(_0x5d9f37[_0x9de8('0x12')]){if(_0x5d9f37[_0x9de8('0x12')][_0x9de8('0x13')]===0x1f4){logger['error'](_0x9de8('0xe'),_0x2d3609,_0x5d9f37[_0x9de8('0x12')][_0x9de8('0x14')]);return _0x284dbe(_0x5d9f37['error'][_0x9de8('0x14')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d3609,_0x5d9f37[_0x9de8('0x12')]['message']);return _0x467cf7(_0x5d9f37['error']['message']);}else{logger[_0x9de8('0xd')](_0x9de8('0xe'),_0x2d3609,_0x9de8('0x15'));_0x467cf7(_0x5d9f37['result'][_0x9de8('0x14')]);}})[_0x9de8('0x16')](function(_0x2799b5){logger[_0x9de8('0x12')](_0x9de8('0xe'),_0x2d3609,_0x2799b5);_0x284dbe(_0x2799b5);});});}exports[_0x9de8('0x17')]=function(_0x39a5f2){var _0x56e6b2=this;return new Promise(function(_0xc9d641,_0x2a3df2){return db[_0x9de8('0x18')][_0x9de8('0x19')]({'raw':_0x39a5f2[_0x9de8('0x1a')]?_0x39a5f2[_0x9de8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x39a5f2['options']?_0x39a5f2[_0x9de8('0x1a')][_0x9de8('0x1b')]||null:null,'attributes':[[db[_0x9de8('0x1c')]['fn'](_0x9de8('0x1d'),db[_0x9de8('0x1c')]['fn']('IF',db[_0x9de8('0x1c')][_0x9de8('0x1e')](_0x9de8('0x1f')))),_0x9de8('0x20')]]})['then'](function(_0x22c2cd){logger['info'](_0x9de8('0x17'),_0x39a5f2);logger['debug'](_0x9de8('0x17'),_0x39a5f2,JSON[_0x9de8('0x11')](_0x22c2cd));_0xc9d641(_0x22c2cd);})[_0x9de8('0x16')](function(_0x10ddff){logger[_0x9de8('0x12')](_0x9de8('0x17'),_0x10ddff[_0x9de8('0x14')],_0x39a5f2);_0x2a3df2(_0x56e6b2['error'](0x1f4,_0x10ddff[_0x9de8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 28599da..ae82bd6 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 _0xb138=['update','removeListener','length','./userVoiceQueueRt.events','save','remove'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb138,0x1dd));var _0x8b13=function(_0x144357,_0x4cda2f){_0x144357=_0x144357-0x0;var _0xf2526d=_0xb138[_0x144357];return _0xf2526d;};'use strict';var UserVoiceQueueRtEvents=require(_0x8b13('0x0'));var events=[_0x8b13('0x1'),_0x8b13('0x2'),_0x8b13('0x3')];function createListener(_0xadad70,_0x185752){return function(_0x20c65c){_0x185752['emit'](_0xadad70,_0x20c65c);};}function removeListener(_0x4411a0,_0x241acb){return function(){UserVoiceQueueRtEvents[_0x8b13('0x4')](_0x4411a0,_0x241acb);};}exports['register']=function(_0xd19a0f){for(var _0x13f7bd=0x0,_0x5d51b1=events[_0x8b13('0x5')];_0x13f7bd<_0x5d51b1;_0x13f7bd++){var _0x33d1a7=events[_0x13f7bd];var _0x22e157=createListener('userVoiceQueueRt:'+_0x33d1a7,_0xd19a0f);UserVoiceQueueRtEvents['on'](_0x33d1a7,_0x22e157);}}; \ No newline at end of file +var _0x5ad3=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4ddc7e,_0xcb9b8){_0x4ddc7e=_0x4ddc7e-0x0;var _0xfbf0ec=_0x5ad3[_0x4ddc7e];return _0xfbf0ec;};'use strict';var UserVoiceQueueRtEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){UserVoiceQueueRtEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);UserVoiceQueueRtEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 737d218..0b82d5f 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 _0x9c00=['/:id','show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x4d171e,_0x8933a7){var _0x3a89d4=function(_0x2092c2){while(--_0x2092c2){_0x4d171e['push'](_0x4d171e['shift']());}};_0x3a89d4(++_0x8933a7);}(_0x9c00,0x1a0));var _0x09c0=function(_0x309991,_0x457e73){_0x309991=_0x309991-0x0;var _0x4ca94d=_0x9c00[_0x309991];return _0x4ca94d;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0xb')]('/',auth[_0x09c0('0x8')](),controller['create']);router[_0x09c0('0xc')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);module[_0x09c0('0x10')]=router; \ No newline at end of file +var _0x153f=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x153f,0x15b));var _0xf153=function(_0x1fa817,_0xfcf8f5){_0x1fa817=_0x1fa817-0x0;var _0x35c0d5=_0x153f[_0x1fa817];return _0x35c0d5;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var auth=require(_0xf153('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf153('0x7'));var controller=require('./variable.controller');router[_0xf153('0x8')]('/',auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x8')](_0xf153('0xb'),auth['isAuthenticated'](),controller[_0xf153('0xc')]);router[_0xf153('0xd')]('/',auth[_0xf153('0x9')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')](_0xf153('0xb'),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')](_0xf153('0xb'),auth['isAuthenticated'](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 9053a0f..38528a8 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 _0x6ced=['STRING','name'];(function(_0x9182be,_0x3ea490){var _0x3d0348=function(_0x4bb178){while(--_0x4bb178){_0x9182be['push'](_0x9182be['shift']());}};_0x3d0348(++_0x3ea490);}(_0x6ced,0x116));var _0xd6ce=function(_0xe5760e,_0x34c9df){_0xe5760e=_0xe5760e-0x0;var _0x5acbc8=_0x6ced[_0xe5760e];return _0x5acbc8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6ce('0x0')],'unique':_0xd6ce('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2882=['name','sequelize','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2882,0x1db));var _0x2288=function(_0x5a984f,_0x3a03e6){_0x5a984f=_0x5a984f-0x0;var _0x2f89ce=_0x2882[_0x5a984f];return _0x2f89ce;};'use strict';var Sequelize=require(_0x2288('0x0'));module['exports']={'name':{'type':Sequelize[_0x2288('0x1')],'unique':_0x2288('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2288('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3431433..a54500d 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 _0x4187=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','Variable','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x5056a4,_0x50b522){var _0x25141e=function(_0x36eeac){while(--_0x36eeac){_0x5056a4['push'](_0x5056a4['shift']());}};_0x25141e(++_0x50b522);}(_0x4187,0x1a7));var _0x7418=function(_0xc46be6,_0x5d03a7){_0xc46be6=_0xc46be6-0x0;var _0xee7585=_0x4187[_0xc46be6];return _0xee7585;};'use strict';var pdf=require(_0x7418('0x0'));var emlformat=require(_0x7418('0x1'));var rimraf=require(_0x7418('0x2'));var zipdir=require(_0x7418('0x3'));var jsonpatch=require(_0x7418('0x4'));var rp=require(_0x7418('0x5'));var moment=require(_0x7418('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7418('0x7'));var util=require(_0x7418('0x8'));var path=require(_0x7418('0x9'));var sox=require('sox');var csv=require(_0x7418('0xa'));var ejs=require(_0x7418('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7418('0xc'));var crypto=require(_0x7418('0xd'));var jsforce=require(_0x7418('0xe'));var deskjs=require(_0x7418('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7418('0x10'));var Papa=require(_0x7418('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7418('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7418('0x13'))(_0x7418('0x14'));var utils=require(_0x7418('0x15'));var config=require(_0x7418('0x16'));var db=require(_0x7418('0x17'))['db'];function respondWithStatusCode(_0x3b33d0,_0x2ed4a4){_0x2ed4a4=_0x2ed4a4||0xcc;return function(_0x239139){if(_0x239139){return _0x3b33d0['sendStatus'](_0x2ed4a4);}return _0x3b33d0[_0x7418('0x18')](_0x2ed4a4)[_0x7418('0x19')]();};}function respondWithResult(_0xc4f2ce,_0x5b6f3c){_0x5b6f3c=_0x5b6f3c||0xc8;return function(_0x41ace4){if(_0x41ace4){return _0xc4f2ce[_0x7418('0x18')](_0x5b6f3c)[_0x7418('0x1a')](_0x41ace4);}};}function respondWithFilteredResult(_0x50372a,_0x58e8b7){return function(_0x5d441d){if(_0x5d441d){var _0x20c53e=_0x5d441d[_0x7418('0x1b')],_0x409409=_0x58e8b7[_0x7418('0x1c')],_0x369388=_0x58e8b7[_0x7418('0x1c')]+_0x58e8b7[_0x7418('0x1d')],_0x225f66;if(_0x369388>=_0x20c53e){_0x369388=_0x20c53e;_0x225f66=0xc8;}else{_0x225f66=0xce;}_0x50372a[_0x7418('0x18')](_0x225f66);return _0x50372a[_0x7418('0x1e')](_0x7418('0x1f'),_0x409409+'-'+_0x369388+'/'+_0x20c53e)[_0x7418('0x1a')](_0x5d441d);}return null;};}function patchUpdates(_0x3f1f8e){return function(_0x5dc1e4){try{jsonpatch[_0x7418('0x20')](_0x5dc1e4,_0x3f1f8e,!![]);}catch(_0x3ede22){return BPromise[_0x7418('0x21')](_0x3ede22);}return _0x5dc1e4[_0x7418('0x22')]();};}function saveUpdates(_0x3b0777,_0x4e53e3){return function(_0x238254){if(_0x238254){return _0x238254[_0x7418('0x23')](_0x3b0777)[_0x7418('0x24')](function(_0x3fd31f){return _0x3fd31f;});}return null;};}function removeEntity(_0x1e2a4f,_0x25be4e){return function(_0x12c0da){if(_0x12c0da){return _0x12c0da[_0x7418('0x25')]()[_0x7418('0x24')](function(){var _0x565250=_0x12c0da[_0x7418('0x26')]({'plain':!![]});var _0x2a1509='Variables';return db[_0x7418('0x27')][_0x7418('0x25')]({'where':{'type':_0x2a1509,'resourceId':_0x565250['id']}})[_0x7418('0x24')](function(){return _0x12c0da;});})[_0x7418('0x24')](function(){_0x1e2a4f['status'](0xcc)[_0x7418('0x19')]();});}};}function handleEntityNotFound(_0x13cf76,_0x25e7ef){return function(_0x445d38){if(!_0x445d38){_0x13cf76[_0x7418('0x28')](0x194);}return _0x445d38;};}function handleError(_0x5e4450,_0xf0f362){_0xf0f362=_0xf0f362||0x1f4;return function(_0x42b1f5){logger[_0x7418('0x29')](_0x42b1f5[_0x7418('0x2a')]);if(_0x42b1f5[_0x7418('0x2b')]){delete _0x42b1f5[_0x7418('0x2b')];}_0x5e4450[_0x7418('0x18')](_0xf0f362)[_0x7418('0x2c')](_0x42b1f5);};}exports['index']=function(_0xf5fb7a,_0x36574a){var _0x285fda={},_0x48b6cc={},_0x96faa7={'count':0x0,'rows':[]};var _0x5b7c29=db[_0x7418('0x2d')]['rawAttributes'];_0x48b6cc[_0x7418('0x2e')]=_[_0x7418('0x2f')](_0x5b7c29);_0x48b6cc['query']=_[_0x7418('0x2f')](_0xf5fb7a[_0x7418('0x30')]);_0x48b6cc[_0x7418('0x31')]=_[_0x7418('0x32')](_0x48b6cc[_0x7418('0x2e')],_0x48b6cc['query']);_0x285fda[_0x7418('0x33')]=_[_0x7418('0x32')](_0x48b6cc[_0x7418('0x2e')],qs[_0x7418('0x34')](_0xf5fb7a[_0x7418('0x30')][_0x7418('0x34')]));_0x285fda[_0x7418('0x33')]=_0x285fda['attributes'][_0x7418('0x35')]?_0x285fda['attributes']:_0x48b6cc[_0x7418('0x2e')];if(!_0xf5fb7a['query'][_0x7418('0x36')](_0x7418('0x37'))){_0x285fda['limit']=qs[_0x7418('0x1d')](_0xf5fb7a[_0x7418('0x30')][_0x7418('0x1d')]);_0x285fda[_0x7418('0x1c')]=qs[_0x7418('0x1c')](_0xf5fb7a[_0x7418('0x30')][_0x7418('0x1c')]);}_0x285fda[_0x7418('0x38')]=qs['sort'](_0xf5fb7a['query'][_0x7418('0x39')]);_0x285fda[_0x7418('0x3a')]=qs[_0x7418('0x31')](_['pick'](_0xf5fb7a['query'],_0x48b6cc[_0x7418('0x31')]));if(_0xf5fb7a[_0x7418('0x30')][_0x7418('0x3b')]){_0x285fda[_0x7418('0x3a')]=_[_0x7418('0x3c')](_0x285fda['where'],{'$or':_[_0x7418('0x3d')](_0x5b7c29,function(_0x8de18a){if(_0x8de18a[_0x7418('0x3e')]['key']!==_0x7418('0x3f')){var _0x1265f4={};_0x1265f4[_0x8de18a[_0x7418('0x40')]]={'$like':'%'+_0xf5fb7a['query'][_0x7418('0x3b')]+'%'};return _0x1265f4;}})});}_0x285fda=_[_0x7418('0x3c')]({},_0x285fda,_0xf5fb7a[_0x7418('0x41')]);var _0x466ca={'where':_0x285fda[_0x7418('0x3a')]};return db[_0x7418('0x2d')][_0x7418('0x1b')](_0x466ca)[_0x7418('0x24')](function(_0x5e38f8){_0x96faa7[_0x7418('0x1b')]=_0x5e38f8;if(_0xf5fb7a[_0x7418('0x30')][_0x7418('0x42')]){_0x285fda[_0x7418('0x43')]=[{'all':!![]}];}return db[_0x7418('0x2d')][_0x7418('0x44')](_0x285fda);})[_0x7418('0x24')](function(_0x39fd7b){_0x96faa7[_0x7418('0x45')]=_0x39fd7b;return _0x96faa7;})[_0x7418('0x24')](respondWithFilteredResult(_0x36574a,_0x285fda))[_0x7418('0x46')](handleError(_0x36574a,null));};exports[_0x7418('0x47')]=function(_0x482e47,_0x3bc8f6){var _0x551b65={'raw':!![],'where':{'id':_0x482e47[_0x7418('0x48')]['id']}},_0x2e4d86={};_0x2e4d86[_0x7418('0x2e')]=_[_0x7418('0x2f')](db[_0x7418('0x2d')][_0x7418('0x49')]);_0x2e4d86[_0x7418('0x30')]=_[_0x7418('0x2f')](_0x482e47['query']);_0x2e4d86['filters']=_[_0x7418('0x32')](_0x2e4d86[_0x7418('0x2e')],_0x2e4d86['query']);_0x551b65[_0x7418('0x33')]=_[_0x7418('0x32')](_0x2e4d86[_0x7418('0x2e')],qs[_0x7418('0x34')](_0x482e47['query']['fields']));_0x551b65['attributes']=_0x551b65[_0x7418('0x33')][_0x7418('0x35')]?_0x551b65[_0x7418('0x33')]:_0x2e4d86[_0x7418('0x2e')];if(_0x482e47[_0x7418('0x30')][_0x7418('0x42')]){_0x551b65[_0x7418('0x43')]=[{'all':!![]}];}_0x551b65=_['merge']({},_0x551b65,_0x482e47['options']);return db['Variable'][_0x7418('0x4a')](_0x551b65)[_0x7418('0x24')](handleEntityNotFound(_0x3bc8f6,null))[_0x7418('0x24')](respondWithResult(_0x3bc8f6,null))['catch'](handleError(_0x3bc8f6,null));};exports[_0x7418('0x4b')]=function(_0xf07782,_0x1c2949){return db[_0x7418('0x2d')][_0x7418('0x4b')](_0xf07782['body'],{})[_0x7418('0x24')](function(_0xa3f04d){var _0x5124d4=_0xf07782['user']['get']({'plain':!![]});if(!_0x5124d4)throw new Error(_0x7418('0x4c'));if(_0x5124d4[_0x7418('0x4d')]==='user'){var _0x49a328=_0xa3f04d[_0x7418('0x26')]({'plain':!![]});var _0x3e0afe=_0x7418('0x4e');return db['UserProfileSection'][_0x7418('0x4a')]({'where':{'name':_0x3e0afe,'userProfileId':_0x5124d4[_0x7418('0x4f')]},'raw':!![]})[_0x7418('0x24')](function(_0xc08487){if(_0xc08487&&_0xc08487[_0x7418('0x50')]===0x0){return db[_0x7418('0x27')][_0x7418('0x4b')]({'name':_0x49a328[_0x7418('0x2b')],'resourceId':_0x49a328['id'],'type':_0xc08487[_0x7418('0x2b')],'sectionId':_0xc08487['id']},{})[_0x7418('0x24')](function(){return _0xa3f04d;});}else{return _0xa3f04d;}})['catch'](function(_0x55bc2f){logger[_0x7418('0x29')](_0x7418('0x51'),_0x55bc2f);throw _0x55bc2f;});}return _0xa3f04d;})['then'](respondWithResult(_0x1c2949,0xc9))['catch'](handleError(_0x1c2949,null));};exports[_0x7418('0x23')]=function(_0xe6eda2,_0x507857){if(_0xe6eda2[_0x7418('0x52')]['id']){delete _0xe6eda2['body']['id'];}return db['Variable']['find']({'where':{'id':_0xe6eda2[_0x7418('0x48')]['id']}})[_0x7418('0x24')](handleEntityNotFound(_0x507857,null))['then'](saveUpdates(_0xe6eda2['body'],null))[_0x7418('0x24')](respondWithResult(_0x507857,null))[_0x7418('0x46')](handleError(_0x507857,null));};exports[_0x7418('0x25')]=function(_0x4a2e48,_0x786f00){return db[_0x7418('0x2d')][_0x7418('0x4a')]({'where':{'id':_0x4a2e48[_0x7418('0x48')]['id']}})[_0x7418('0x24')](handleEntityNotFound(_0x786f00,null))[_0x7418('0x24')](removeEntity(_0x786f00,null))[_0x7418('0x46')](handleError(_0x786f00,null));}; \ No newline at end of file +var _0x8ec3=['field','options','findAll','rows','catch','params','include','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','key'];(function(_0x2f54ad,_0x12676f){var _0x3e5380=function(_0x1d3a0b){while(--_0x1d3a0b){_0x2f54ad['push'](_0x2f54ad['shift']());}};_0x3e5380(++_0x12676f);}(_0x8ec3,0x14f));var _0x38ec=function(_0x58c489,_0x2f20d7){_0x58c489=_0x58c489-0x0;var _0x49b67c=_0x8ec3[_0x58c489];return _0x49b67c;};'use strict';var pdf=require(_0x38ec('0x0'));var emlformat=require(_0x38ec('0x1'));var rimraf=require(_0x38ec('0x2'));var zipdir=require(_0x38ec('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38ec('0x4'));var moment=require(_0x38ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x38ec('0x6'));var util=require(_0x38ec('0x7'));var path=require(_0x38ec('0x8'));var sox=require(_0x38ec('0x9'));var csv=require(_0x38ec('0xa'));var ejs=require(_0x38ec('0xb'));var fs=require('fs');var _=require(_0x38ec('0xc'));var squel=require(_0x38ec('0xd'));var crypto=require(_0x38ec('0xe'));var jsforce=require(_0x38ec('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x38ec('0xa'));var querystring=require(_0x38ec('0x10'));var Papa=require(_0x38ec('0x11'));var Redis=require(_0x38ec('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x38ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38ec('0x14'))('api');var utils=require(_0x38ec('0x15'));var config=require(_0x38ec('0x16'));var db=require(_0x38ec('0x17'))['db'];function respondWithStatusCode(_0x2312f1,_0x5d96a7){_0x5d96a7=_0x5d96a7||0xcc;return function(_0x5410c9){if(_0x5410c9){return _0x2312f1[_0x38ec('0x18')](_0x5d96a7);}return _0x2312f1[_0x38ec('0x19')](_0x5d96a7)[_0x38ec('0x1a')]();};}function respondWithResult(_0x26c8b3,_0xdbe710){_0xdbe710=_0xdbe710||0xc8;return function(_0x4ef335){if(_0x4ef335){return _0x26c8b3[_0x38ec('0x19')](_0xdbe710)[_0x38ec('0x1b')](_0x4ef335);}};}function respondWithFilteredResult(_0x594ff2,_0x2e1f80){return function(_0x5e4fd0){if(_0x5e4fd0){var _0x3b7e09=_0x5e4fd0[_0x38ec('0x1c')],_0x17523b=_0x2e1f80[_0x38ec('0x1d')],_0x3d9b0c=_0x2e1f80[_0x38ec('0x1d')]+_0x2e1f80[_0x38ec('0x1e')],_0x818fc;if(_0x3d9b0c>=_0x3b7e09){_0x3d9b0c=_0x3b7e09;_0x818fc=0xc8;}else{_0x818fc=0xce;}_0x594ff2[_0x38ec('0x19')](_0x818fc);return _0x594ff2['set']('Content-Range',_0x17523b+'-'+_0x3d9b0c+'/'+_0x3b7e09)[_0x38ec('0x1b')](_0x5e4fd0);}return null;};}function patchUpdates(_0x1891b8){return function(_0x1db644){try{jsonpatch[_0x38ec('0x1f')](_0x1db644,_0x1891b8,!![]);}catch(_0x417bdd){return BPromise[_0x38ec('0x20')](_0x417bdd);}return _0x1db644[_0x38ec('0x21')]();};}function saveUpdates(_0x3af52b,_0x44a8ab){return function(_0x176bd9){if(_0x176bd9){return _0x176bd9[_0x38ec('0x22')](_0x3af52b)[_0x38ec('0x23')](function(_0x5f3280){return _0x5f3280;});}return null;};}function removeEntity(_0x25941d,_0xbfab44){return function(_0x1c76da){if(_0x1c76da){return _0x1c76da[_0x38ec('0x24')]()['then'](function(){var _0x59bda3=_0x1c76da[_0x38ec('0x25')]({'plain':!![]});var _0x232770='Variables';return db['UserProfileResource'][_0x38ec('0x24')]({'where':{'type':_0x232770,'resourceId':_0x59bda3['id']}})['then'](function(){return _0x1c76da;});})[_0x38ec('0x23')](function(){_0x25941d[_0x38ec('0x19')](0xcc)[_0x38ec('0x1a')]();});}};}function handleEntityNotFound(_0xeec9e,_0x172e18){return function(_0x4dfccb){if(!_0x4dfccb){_0xeec9e[_0x38ec('0x18')](0x194);}return _0x4dfccb;};}function handleError(_0x4a6409,_0x51c6b5){_0x51c6b5=_0x51c6b5||0x1f4;return function(_0x35f612){logger[_0x38ec('0x26')](_0x35f612[_0x38ec('0x27')]);if(_0x35f612['name']){delete _0x35f612[_0x38ec('0x28')];}_0x4a6409[_0x38ec('0x19')](_0x51c6b5)[_0x38ec('0x29')](_0x35f612);};}exports[_0x38ec('0x2a')]=function(_0x2d4589,_0x406d40){var _0x2000bd={},_0x48953a={},_0x32126c={'count':0x0,'rows':[]};var _0x1bbb8e=db[_0x38ec('0x2b')][_0x38ec('0x2c')];_0x48953a[_0x38ec('0x2d')]=_[_0x38ec('0x2e')](_0x1bbb8e);_0x48953a[_0x38ec('0x2f')]=_[_0x38ec('0x2e')](_0x2d4589[_0x38ec('0x2f')]);_0x48953a[_0x38ec('0x30')]=_[_0x38ec('0x31')](_0x48953a[_0x38ec('0x2d')],_0x48953a[_0x38ec('0x2f')]);_0x2000bd[_0x38ec('0x32')]=_[_0x38ec('0x31')](_0x48953a[_0x38ec('0x2d')],qs[_0x38ec('0x33')](_0x2d4589['query'][_0x38ec('0x33')]));_0x2000bd[_0x38ec('0x32')]=_0x2000bd['attributes'][_0x38ec('0x34')]?_0x2000bd['attributes']:_0x48953a['model'];if(!_0x2d4589['query']['hasOwnProperty'](_0x38ec('0x35'))){_0x2000bd['limit']=qs[_0x38ec('0x1e')](_0x2d4589[_0x38ec('0x2f')][_0x38ec('0x1e')]);_0x2000bd[_0x38ec('0x1d')]=qs['offset'](_0x2d4589[_0x38ec('0x2f')]['offset']);}_0x2000bd['order']=qs[_0x38ec('0x36')](_0x2d4589[_0x38ec('0x2f')]['sort']);_0x2000bd[_0x38ec('0x37')]=qs[_0x38ec('0x30')](_['pick'](_0x2d4589['query'],_0x48953a[_0x38ec('0x30')]));if(_0x2d4589[_0x38ec('0x2f')][_0x38ec('0x38')]){_0x2000bd[_0x38ec('0x37')]=_[_0x38ec('0x39')](_0x2000bd['where'],{'$or':_['map'](_0x1bbb8e,function(_0x5a68ab){if(_0x5a68ab[_0x38ec('0x3a')][_0x38ec('0x3b')]!=='VIRTUAL'){var _0x18f1b2={};_0x18f1b2[_0x5a68ab[_0x38ec('0x3c')]]={'$like':'%'+_0x2d4589[_0x38ec('0x2f')][_0x38ec('0x38')]+'%'};return _0x18f1b2;}})});}_0x2000bd=_[_0x38ec('0x39')]({},_0x2000bd,_0x2d4589[_0x38ec('0x3d')]);var _0x3d1f26={'where':_0x2000bd['where']};return db[_0x38ec('0x2b')][_0x38ec('0x1c')](_0x3d1f26)['then'](function(_0x2542d4){_0x32126c[_0x38ec('0x1c')]=_0x2542d4;if(_0x2d4589['query']['includeAll']){_0x2000bd['include']=[{'all':!![]}];}return db[_0x38ec('0x2b')][_0x38ec('0x3e')](_0x2000bd);})['then'](function(_0x4bbb61){_0x32126c[_0x38ec('0x3f')]=_0x4bbb61;return _0x32126c;})[_0x38ec('0x23')](respondWithFilteredResult(_0x406d40,_0x2000bd))[_0x38ec('0x40')](handleError(_0x406d40,null));};exports['show']=function(_0x4d5a3b,_0x4e5e03){var _0x39214a={'raw':!![],'where':{'id':_0x4d5a3b[_0x38ec('0x41')]['id']}},_0x165706={};_0x165706[_0x38ec('0x2d')]=_[_0x38ec('0x2e')](db[_0x38ec('0x2b')]['rawAttributes']);_0x165706[_0x38ec('0x2f')]=_['keys'](_0x4d5a3b[_0x38ec('0x2f')]);_0x165706['filters']=_[_0x38ec('0x31')](_0x165706[_0x38ec('0x2d')],_0x165706[_0x38ec('0x2f')]);_0x39214a[_0x38ec('0x32')]=_[_0x38ec('0x31')](_0x165706[_0x38ec('0x2d')],qs['fields'](_0x4d5a3b[_0x38ec('0x2f')][_0x38ec('0x33')]));_0x39214a[_0x38ec('0x32')]=_0x39214a[_0x38ec('0x32')][_0x38ec('0x34')]?_0x39214a['attributes']:_0x165706[_0x38ec('0x2d')];if(_0x4d5a3b[_0x38ec('0x2f')]['includeAll']){_0x39214a[_0x38ec('0x42')]=[{'all':!![]}];}_0x39214a=_[_0x38ec('0x39')]({},_0x39214a,_0x4d5a3b['options']);return db['Variable'][_0x38ec('0x43')](_0x39214a)['then'](handleEntityNotFound(_0x4e5e03,null))[_0x38ec('0x23')](respondWithResult(_0x4e5e03,null))['catch'](handleError(_0x4e5e03,null));};exports['create']=function(_0xa997cf,_0x27475f){return db[_0x38ec('0x2b')]['create'](_0xa997cf['body'],{})[_0x38ec('0x23')](function(_0x5a42a5){var _0x32a47d=_0xa997cf[_0x38ec('0x44')]['get']({'plain':!![]});if(!_0x32a47d)throw new Error(_0x38ec('0x45'));if(_0x32a47d[_0x38ec('0x46')]==='user'){var _0xaed6ad=_0x5a42a5[_0x38ec('0x25')]({'plain':!![]});var _0x89047b=_0x38ec('0x47');return db[_0x38ec('0x48')][_0x38ec('0x43')]({'where':{'name':_0x89047b,'userProfileId':_0x32a47d[_0x38ec('0x49')]},'raw':!![]})[_0x38ec('0x23')](function(_0x2ced4d){if(_0x2ced4d&&_0x2ced4d[_0x38ec('0x4a')]===0x0){return db[_0x38ec('0x4b')][_0x38ec('0x4c')]({'name':_0xaed6ad[_0x38ec('0x28')],'resourceId':_0xaed6ad['id'],'type':_0x2ced4d[_0x38ec('0x28')],'sectionId':_0x2ced4d['id']},{})[_0x38ec('0x23')](function(){return _0x5a42a5;});}else{return _0x5a42a5;}})[_0x38ec('0x40')](function(_0x45ae20){logger['error'](_0x38ec('0x4d'),_0x45ae20);throw _0x45ae20;});}return _0x5a42a5;})[_0x38ec('0x23')](respondWithResult(_0x27475f,0xc9))[_0x38ec('0x40')](handleError(_0x27475f,null));};exports[_0x38ec('0x22')]=function(_0x4dc385,_0x34e6dc){if(_0x4dc385[_0x38ec('0x4e')]['id']){delete _0x4dc385['body']['id'];}return db[_0x38ec('0x2b')][_0x38ec('0x43')]({'where':{'id':_0x4dc385[_0x38ec('0x41')]['id']}})[_0x38ec('0x23')](handleEntityNotFound(_0x34e6dc,null))['then'](saveUpdates(_0x4dc385[_0x38ec('0x4e')],null))[_0x38ec('0x23')](respondWithResult(_0x34e6dc,null))[_0x38ec('0x40')](handleError(_0x34e6dc,null));};exports[_0x38ec('0x24')]=function(_0x3b0cd4,_0x3690d3){return db[_0x38ec('0x2b')][_0x38ec('0x43')]({'where':{'id':_0x3b0cd4[_0x38ec('0x41')]['id']}})['then'](handleEntityNotFound(_0x3690d3,null))[_0x38ec('0x23')](removeEntity(_0x3690d3,null))[_0x38ec('0x40')](handleError(_0x3690d3,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f96dfac..7b2038d 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 _0xf562=['moment','bluebird','request-promise','path','rimraf','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x591d0d,_0x45ebb5){var _0x88ff5e=function(_0x4aca8e){while(--_0x4aca8e){_0x591d0d['push'](_0x591d0d['shift']());}};_0x88ff5e(++_0x45ebb5);}(_0xf562,0x100));var _0x2f56=function(_0x5dffc0,_0x38a88d){_0x5dffc0=_0x5dffc0-0x0;var _0x2b47ef=_0xf562[_0x5dffc0];return _0x2b47ef;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var logger=require(_0x2f56('0x2'))(_0x2f56('0x3'));var moment=require(_0x2f56('0x4'));var BPromise=require(_0x2f56('0x5'));var rp=require(_0x2f56('0x6'));var fs=require('fs');var path=require(_0x2f56('0x7'));var rimraf=require(_0x2f56('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f56('0x9'));module['exports']=function(_0x14436b,_0x5b3784){return _0x14436b[_0x2f56('0xa')](_0x2f56('0xb'),attributes,{'tableName':_0x2f56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6c0=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xc6c0[_0x487ab4];return _0x3bef77;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var logger=require(_0x0c6c('0x1'))(_0x0c6c('0x2'));var moment=require(_0x0c6c('0x3'));var BPromise=require(_0x0c6c('0x4'));var rp=require(_0x0c6c('0x5'));var fs=require('fs');var path=require(_0x0c6c('0x6'));var rimraf=require(_0x0c6c('0x7'));var config=require(_0x0c6c('0x8'));var attributes=require(_0x0c6c('0x9'));module[_0x0c6c('0xa')]=function(_0x493c56,_0x526739){return _0x493c56[_0x0c6c('0xb')](_0x0c6c('0xc'),attributes,{'tableName':_0x0c6c('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 18c0831..b999a9d 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 _0x824e=['find','options','raw','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x824e,0x8d));var _0xe824=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x824e[_0x4bfcbe];return _0x5b65e6;};'use strict';var _=require(_0xe824('0x0'));var util=require(_0xe824('0x1'));var moment=require(_0xe824('0x2'));var BPromise=require(_0xe824('0x3'));var rs=require(_0xe824('0x4'));var fs=require('fs');var Redis=require(_0xe824('0x5'));var db=require(_0xe824('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe824('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe824('0x8'));var client=jayson[_0xe824('0x9')][_0xe824('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99b691,_0x528982,_0x1d3103){return new BPromise(function(_0x272b19,_0x49aa52){return client[_0xe824('0xb')](_0x99b691,_0x1d3103)[_0xe824('0xc')](function(_0x52e9a8){logger[_0xe824('0xd')](_0xe824('0xe'),_0x528982,_0xe824('0xf'));logger[_0xe824('0x10')]('Variable,\x20%s,\x20%s,\x20%s',_0x528982,'request\x20sent',JSON['stringify'](_0x52e9a8));if(_0x52e9a8['error']){if(_0x52e9a8[_0xe824('0x11')][_0xe824('0x12')]===0x1f4){logger['error'](_0xe824('0xe'),_0x528982,_0x52e9a8[_0xe824('0x11')]['message']);return _0x49aa52(_0x52e9a8[_0xe824('0x11')][_0xe824('0x13')]);}logger[_0xe824('0x11')](_0xe824('0xe'),_0x528982,_0x52e9a8[_0xe824('0x11')][_0xe824('0x13')]);return _0x272b19(_0x52e9a8[_0xe824('0x11')][_0xe824('0x13')]);}else{logger[_0xe824('0xd')](_0xe824('0xe'),_0x528982,_0xe824('0xf'));_0x272b19(_0x52e9a8[_0xe824('0x14')][_0xe824('0x13')]);}})[_0xe824('0x15')](function(_0x26a057){logger[_0xe824('0x11')]('Variable,\x20%s,\x20%s',_0x528982,_0x26a057);_0x49aa52(_0x26a057);});});}exports[_0xe824('0x16')]=function(_0x360aba){var _0x1e1efa=this;return new Promise(function(_0x392698,_0x33c4d0){return db[_0xe824('0x17')][_0xe824('0x18')]({'raw':_0x360aba[_0xe824('0x19')]?_0x360aba['options'][_0xe824('0x1a')]===undefined?!![]:![]:!![],'where':_0x360aba[_0xe824('0x19')]?_0x360aba[_0xe824('0x19')][_0xe824('0x1b')]||null:null,'attributes':_0x360aba[_0xe824('0x19')]?_0x360aba[_0xe824('0x19')][_0xe824('0x1c')]||null:null,'include':_0x360aba[_0xe824('0x19')]?_0x360aba[_0xe824('0x19')][_0xe824('0x1d')]?_['map'](_0x360aba[_0xe824('0x19')]['include'],function(_0x4498ff){return{'model':db[_0x4498ff[_0xe824('0x1e')]],'as':_0x4498ff['as'],'attributes':_0x4498ff[_0xe824('0x1c')],'include':_0x4498ff[_0xe824('0x1d')]?_[_0xe824('0x1f')](_0x4498ff[_0xe824('0x1d')],function(_0x1bc2d9){return{'model':db[_0x1bc2d9[_0xe824('0x1e')]],'as':_0x1bc2d9['as'],'attributes':_0x1bc2d9['attributes'],'include':_0x1bc2d9['include']?_[_0xe824('0x1f')](_0x1bc2d9[_0xe824('0x1d')],function(_0x376c24){return{'model':db[_0x376c24[_0xe824('0x1e')]],'as':_0x376c24['as'],'attributes':_0x376c24['attributes']};}):[]};}):[]};}):[]:[]})[_0xe824('0xc')](function(_0x4264b5){logger[_0xe824('0xd')](_0xe824('0x16'),_0x360aba);logger[_0xe824('0x10')](_0xe824('0x16'),_0x360aba,JSON[_0xe824('0x20')](_0x4264b5));_0x392698(_0x4264b5);})[_0xe824('0x15')](function(_0x4bb486){logger[_0xe824('0x11')]('ShowVariable',_0x4bb486[_0xe824('0x13')],_0x360aba);_0x33c4d0(_0x1e1efa[_0xe824('0x11')](0x1f4,_0x4bb486[_0xe824('0x13')]));});});}; \ No newline at end of file +var _0x9c8b=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','Variable,\x20%s,\x20%s','message','result','catch','ShowVariable','options','raw','attributes','include','map','model','lodash','util'];(function(_0x25705f,_0x11fd3b){var _0x35c752=function(_0x15e606){while(--_0x15e606){_0x25705f['push'](_0x25705f['shift']());}};_0x35c752(++_0x11fd3b);}(_0x9c8b,0x11e));var _0xb9c8=function(_0x45fa67,_0x54f9c8){_0x45fa67=_0x45fa67-0x0;var _0x2eddaf=_0x9c8b[_0x45fa67];return _0x2eddaf;};'use strict';var _=require(_0xb9c8('0x0'));var util=require(_0xb9c8('0x1'));var moment=require(_0xb9c8('0x2'));var BPromise=require('bluebird');var rs=require(_0xb9c8('0x3'));var fs=require('fs');var Redis=require(_0xb9c8('0x4'));var db=require(_0xb9c8('0x5'))['db'];var utils=require(_0xb9c8('0x6'));var logger=require(_0xb9c8('0x7'))('rpc');var config=require(_0xb9c8('0x8'));var jayson=require(_0xb9c8('0x9'));var client=jayson[_0xb9c8('0xa')][_0xb9c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cd9a,_0x43ad04,_0xc84e1d){return new BPromise(function(_0x4c45e9,_0x2acd6f){return client[_0xb9c8('0xc')](_0x25cd9a,_0xc84e1d)[_0xb9c8('0xd')](function(_0x389842){logger[_0xb9c8('0xe')]('Variable,\x20%s,\x20%s',_0x43ad04,_0xb9c8('0xf'));logger[_0xb9c8('0x10')](_0xb9c8('0x11'),_0x43ad04,'request\x20sent',JSON[_0xb9c8('0x12')](_0x389842));if(_0x389842[_0xb9c8('0x13')]){if(_0x389842['error'][_0xb9c8('0x14')]===0x1f4){logger[_0xb9c8('0x13')](_0xb9c8('0x15'),_0x43ad04,_0x389842['error'][_0xb9c8('0x16')]);return _0x2acd6f(_0x389842[_0xb9c8('0x13')][_0xb9c8('0x16')]);}logger[_0xb9c8('0x13')](_0xb9c8('0x15'),_0x43ad04,_0x389842[_0xb9c8('0x13')][_0xb9c8('0x16')]);return _0x4c45e9(_0x389842['error']['message']);}else{logger[_0xb9c8('0xe')](_0xb9c8('0x15'),_0x43ad04,_0xb9c8('0xf'));_0x4c45e9(_0x389842[_0xb9c8('0x17')][_0xb9c8('0x16')]);}})[_0xb9c8('0x18')](function(_0x5ba20e){logger[_0xb9c8('0x13')](_0xb9c8('0x15'),_0x43ad04,_0x5ba20e);_0x2acd6f(_0x5ba20e);});});}exports[_0xb9c8('0x19')]=function(_0x46e05f){var _0x4f69f=this;return new Promise(function(_0x4adfd8,_0x8cc55c){return db['Variable']['find']({'raw':_0x46e05f[_0xb9c8('0x1a')]?_0x46e05f[_0xb9c8('0x1a')][_0xb9c8('0x1b')]===undefined?!![]:![]:!![],'where':_0x46e05f[_0xb9c8('0x1a')]?_0x46e05f[_0xb9c8('0x1a')]['where']||null:null,'attributes':_0x46e05f[_0xb9c8('0x1a')]?_0x46e05f[_0xb9c8('0x1a')][_0xb9c8('0x1c')]||null:null,'include':_0x46e05f[_0xb9c8('0x1a')]?_0x46e05f[_0xb9c8('0x1a')][_0xb9c8('0x1d')]?_[_0xb9c8('0x1e')](_0x46e05f['options']['include'],function(_0x48ac1d){return{'model':db[_0x48ac1d[_0xb9c8('0x1f')]],'as':_0x48ac1d['as'],'attributes':_0x48ac1d[_0xb9c8('0x1c')],'include':_0x48ac1d[_0xb9c8('0x1d')]?_[_0xb9c8('0x1e')](_0x48ac1d[_0xb9c8('0x1d')],function(_0x2fbc5a){return{'model':db[_0x2fbc5a[_0xb9c8('0x1f')]],'as':_0x2fbc5a['as'],'attributes':_0x2fbc5a[_0xb9c8('0x1c')],'include':_0x2fbc5a[_0xb9c8('0x1d')]?_[_0xb9c8('0x1e')](_0x2fbc5a[_0xb9c8('0x1d')],function(_0x1797fa){return{'model':db[_0x1797fa['model']],'as':_0x1797fa['as'],'attributes':_0x1797fa[_0xb9c8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb9c8('0xd')](function(_0x27f411){logger[_0xb9c8('0xe')](_0xb9c8('0x19'),_0x46e05f);logger[_0xb9c8('0x10')](_0xb9c8('0x19'),_0x46e05f,JSON[_0xb9c8('0x12')](_0x27f411));_0x4adfd8(_0x27f411);})[_0xb9c8('0x18')](function(_0xd468fa){logger['error'](_0xb9c8('0x19'),_0xd468fa['message'],_0x46e05f);_0x8cc55c(_0x4f69f['error'](0x1f4,_0xd468fa[_0xb9c8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3c51512..c401a09 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 _0x5002=['./version.controller','get','/fetch','isAuthenticated','canUpdate','/reset','/pull','pull','/restart','restart','/migrations','migrations','exports'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x5002,0xea));var _0x2500=function(_0x1a14c4,_0x2dabb0){_0x1a14c4=_0x1a14c4-0x0;var _0x2a407d=_0x5002[_0x1a14c4];return _0x2a407d;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x2500('0x0'));router[_0x2500('0x1')]('/',controller['index']);router[_0x2500('0x1')](_0x2500('0x2'),auth[_0x2500('0x3')](),auth[_0x2500('0x4')](),controller['fetch']);router[_0x2500('0x1')](_0x2500('0x5'),auth['isAuthenticated'](),auth[_0x2500('0x4')](),controller['reset']);router[_0x2500('0x1')](_0x2500('0x6'),auth[_0x2500('0x3')](),auth['canUpdate'](),controller[_0x2500('0x7')]);router[_0x2500('0x1')](_0x2500('0x8'),auth['isAuthenticated'](),controller[_0x2500('0x9')]);router['get'](_0x2500('0xa'),controller[_0x2500('0xb')]);module[_0x2500('0xc')]=router; \ No newline at end of file +var _0x67e5=['/reset','/pull','/restart','/migrations','migrations','Router','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x3ee771,_0x2b8251){var _0x1e99fa=function(_0x25dcd4){while(--_0x25dcd4){_0x3ee771['push'](_0x3ee771['shift']());}};_0x1e99fa(++_0x2b8251);}(_0x67e5,0xa1));var _0x567e=function(_0x41a892,_0x15dfb0){_0x41a892=_0x41a892-0x0;var _0x40bca1=_0x67e5[_0x41a892];return _0x40bca1;};'use strict';var express=require('express');var router=express[_0x567e('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x567e('0x1'));router['get']('/',controller[_0x567e('0x2')]);router[_0x567e('0x3')](_0x567e('0x4'),auth[_0x567e('0x5')](),auth[_0x567e('0x6')](),controller[_0x567e('0x7')]);router[_0x567e('0x3')](_0x567e('0x8'),auth[_0x567e('0x5')](),auth[_0x567e('0x6')](),controller['reset']);router[_0x567e('0x3')](_0x567e('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0x567e('0x3')](_0x567e('0xa'),auth[_0x567e('0x5')](),controller['restart']);router[_0x567e('0x3')](_0x567e('0xb'),controller[_0x567e('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e59e4f6..f773ad8 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 _0x7ee1=['join','server','migrations','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully'];(function(_0x10f88b,_0x1218cf){var _0x10717f=function(_0x3a7b41){while(--_0x3a7b41){_0x10f88b['push'](_0x10f88b['shift']());}};_0x10717f(++_0x1218cf);}(_0x7ee1,0xab));var _0x17ee=function(_0x28cad7,_0x24abfe){_0x28cad7=_0x28cad7-0x0;var _0xa8767a=_0x7ee1[_0x28cad7];return _0xa8767a;};'use strict';var Umzug=require(_0x17ee('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x17ee('0x1'));var pkginfo=require(_0x17ee('0x2'))(module,_0x17ee('0x3'));var compareVersions=require(_0x17ee('0x4'));var exec=require(_0x17ee('0x5'))['exec'];var db=require(_0x17ee('0x6'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x17ee('0x7'))(_0x17ee('0x8'));var git=require(_0x17ee('0x9'))(config[_0x17ee('0xa')]);exports[_0x17ee('0xb')]=function(_0x59b876,_0x314088){var _0x59a51e={'current':module[_0x17ee('0xc')][_0x17ee('0x3')],'phonebar':0x2};if(_0x59b876['query']&&_0x59b876[_0x17ee('0xd')][_0x17ee('0xe')]){return git[_0x17ee('0xf')]()[_0x17ee('0x10')](function(_0x3ac76a,_0x352d60){_0x59a51e[_0x17ee('0xe')]=(_0x3ac76a?module[_0x17ee('0xc')][_0x17ee('0x3')]:_0x352d60[_0x17ee('0xe')])||_0x17ee('0x11');return _0x314088[_0x17ee('0x12')](0xc8)['json'](_0x59a51e);});}else{return _0x314088[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')](_0x59a51e);}};exports['fetch']=function(_0x1b3857,_0x53a2c2){return git[_0x17ee('0xf')]([_0x17ee('0x14'),_0x17ee('0x15')],function(_0x206f85){if(_0x206f85){logger['error'](_0x206f85);return _0x53a2c2[_0x17ee('0x12')](0x1f4)[_0x17ee('0x13')](_0x206f85);}logger[_0x17ee('0x16')]('git\x20fetch');return _0x53a2c2[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x17ee('0x17')});});};exports[_0x17ee('0x18')]=function(_0x42b403,_0x3785ed){return git[_0x17ee('0x18')](['--hard','FETCH_HEAD'],function(_0x24d546){if(_0x24d546){logger[_0x17ee('0x19')](_0x24d546);return _0x3785ed[_0x17ee('0x12')](0x1f4)[_0x17ee('0x13')](_0x24d546);}logger['info'](_0x17ee('0x1a'));return _0x3785ed[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x17ee('0x1b')});});};exports['pull']=function(_0x2354a5,_0x3d9120){exec(_0x17ee('0x1c'),function(_0x54daae,_0x3672df,_0x2d0297){logger[_0x17ee('0x16')](_0x3672df);logger[_0x17ee('0x16')](_0x2d0297);if(_0x54daae){logger[_0x17ee('0x19')](_0x54daae);return _0x3d9120['status'](0x1f4)[_0x17ee('0x13')](_0x54daae);}return _0x3d9120[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x3672df});});};exports[_0x17ee('0x1d')]=function(_0x88a4af,_0x16a0ea){return pm2[_0x17ee('0x1d')](_0x17ee('0x1e'))['then'](function(_0x284fbc){logger[_0x17ee('0x16')](_0x17ee('0x1f'),_0x284fbc);return _0x16a0ea[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x17ee('0x20')});})['catch'](function(_0x4ba675){logger[_0x17ee('0x19')](_0x4ba675);return _0x16a0ea[_0x17ee('0x12')](0x1f4)[_0x17ee('0x13')](_0x4ba675);});};exports['migrations']=function(_0x393231,_0x34b003){var _0x954455=fs['readdirSync'](path[_0x17ee('0x21')](config[_0x17ee('0xa')],_0x17ee('0x22'),_0x17ee('0x23')));var _0x4dfb63=[];for(var _0x3aa7fe=0x0;_0x3aa7fe<_0x954455[_0x17ee('0x24')];_0x3aa7fe++){var _0x3bdb0b=_0x954455[_0x3aa7fe]['replace'](_0x17ee('0x25'),'');if(compareVersions(module['exports'][_0x17ee('0x3')],_0x3bdb0b)===-0x1){_0x4dfb63[_0x17ee('0x26')](_0x3bdb0b);}}if(_0x4dfb63[_0x17ee('0x24')]){var _0x5d0171=_0x4dfb63[_0x17ee('0x27')](compareVersions);var _0x48a522=new Umzug({'storage':_0x17ee('0x28'),'storageOptions':{'model':db[_0x17ee('0x29')],'modelName':_0x17ee('0x29'),'columnName':_0x17ee('0x3')},'migrations':{'params':[db['sequelize'][_0x17ee('0x2a')](),db[_0x17ee('0x28')][_0x17ee('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[_0x17ee('0x21')](config[_0x17ee('0xa')],_0x17ee('0x22'),'migrations'),'pattern':/\.js$/}});_0x48a522['up']({'migrations':_[_0x17ee('0x2c')](_0x5d0171,function(_0x387a22){return _0x387a22+_0x17ee('0x25');})})[_0x17ee('0x2d')](function(){return _0x34b003[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x17ee('0x2e')+module[_0x17ee('0xc')][_0x17ee('0x3')]+_0x17ee('0x2f')+_['last'](_0x5d0171),'migrations':_[_0x17ee('0x21')](_0x5d0171)});})[_0x17ee('0x30')](function(_0x1614fd){if(_0x1614fd instanceof db[_0x17ee('0x28')][_0x17ee('0x31')]){return _0x34b003[_0x17ee('0x12')](0xc8)[_0x17ee('0x13')]({'output':_0x17ee('0x32')});}else{return _0x34b003[_0x17ee('0x12')](0x1f4)[_0x17ee('0x13')](_0x1614fd);}});}else{return _0x34b003[_0x17ee('0x12')](0xc8)['json']({'output':_0x17ee('0x32')});}}; \ No newline at end of file +var _0x23f2=['fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','join','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','latest'];(function(_0x330589,_0x30958e){var _0x37db1b=function(_0x4431a6){while(--_0x4431a6){_0x330589['push'](_0x330589['shift']());}};_0x37db1b(++_0x30958e);}(_0x23f2,0x171));var _0x223f=function(_0x44f370,_0x472545){_0x44f370=_0x44f370-0x0;var _0x198360=_0x23f2[_0x44f370];return _0x198360;};'use strict';var Umzug=require(_0x223f('0x0'));var path=require(_0x223f('0x1'));var fs=require('fs');var _=require(_0x223f('0x2'));var pkginfo=require(_0x223f('0x3'))(module,_0x223f('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x223f('0x5'))[_0x223f('0x6')];var db=require(_0x223f('0x7'))['db'];var config=require(_0x223f('0x8'));var pm2=require(_0x223f('0x9'));var logger=require('../../config/logger')(_0x223f('0xa'));var git=require('simple-git')(config[_0x223f('0xb')]);exports[_0x223f('0xc')]=function(_0x1aab2f,_0x56af3a){var _0x5a0d26={'current':module[_0x223f('0xd')][_0x223f('0x4')],'phonebar':0x2};if(_0x1aab2f[_0x223f('0xe')]&&_0x1aab2f[_0x223f('0xe')][_0x223f('0xf')]){return git[_0x223f('0x10')]()[_0x223f('0x11')](function(_0x47c65f,_0x50241d){_0x5a0d26[_0x223f('0xf')]=(_0x47c65f?module[_0x223f('0xd')][_0x223f('0x4')]:_0x50241d['latest'])||_0x223f('0x12');return _0x56af3a[_0x223f('0x13')](0xc8)['json'](_0x5a0d26);});}else{return _0x56af3a[_0x223f('0x13')](0xc8)[_0x223f('0x14')](_0x5a0d26);}};exports['fetch']=function(_0x236735,_0x42e2fc){return git['fetch']([_0x223f('0x15'),'master'],function(_0x41749f){if(_0x41749f){logger[_0x223f('0x16')](_0x41749f);return _0x42e2fc[_0x223f('0x13')](0x1f4)[_0x223f('0x14')](_0x41749f);}logger[_0x223f('0x17')](_0x223f('0x18'));return _0x42e2fc['status'](0xc8)[_0x223f('0x14')]({'output':_0x223f('0x19')});});};exports[_0x223f('0x1a')]=function(_0x416f6f,_0x1d26ad){return git[_0x223f('0x1a')]([_0x223f('0x1b'),'FETCH_HEAD'],function(_0xcf1dd6){if(_0xcf1dd6){logger[_0x223f('0x16')](_0xcf1dd6);return _0x1d26ad[_0x223f('0x13')](0x1f4)['json'](_0xcf1dd6);}logger[_0x223f('0x17')](_0x223f('0x1c'));return _0x1d26ad[_0x223f('0x13')](0xc8)[_0x223f('0x14')]({'output':_0x223f('0x1d')});});};exports[_0x223f('0x1e')]=function(_0x5de8f9,_0x368877){exec('npm\x20install\x20--production',function(_0x5c869e,_0x1bcaa2,_0x559364){logger[_0x223f('0x17')](_0x1bcaa2);logger[_0x223f('0x17')](_0x559364);if(_0x5c869e){logger['error'](_0x5c869e);return _0x368877[_0x223f('0x13')](0x1f4)[_0x223f('0x14')](_0x5c869e);}return _0x368877['status'](0xc8)[_0x223f('0x14')]({'output':_0x1bcaa2});});};exports[_0x223f('0x1f')]=function(_0x7888ef,_0x24eb17){return pm2[_0x223f('0x1f')](_0x223f('0x20'))[_0x223f('0x21')](function(_0x53bf41){logger[_0x223f('0x17')](_0x223f('0x22'),_0x53bf41);return _0x24eb17[_0x223f('0x13')](0xc8)['json']({'output':_0x223f('0x23')});})[_0x223f('0x24')](function(_0x4c07bd){logger[_0x223f('0x16')](_0x4c07bd);return _0x24eb17[_0x223f('0x13')](0x1f4)['json'](_0x4c07bd);});};exports['migrations']=function(_0x15f97a,_0x151f04){var _0x44fc1f=fs[_0x223f('0x25')](path['join'](config[_0x223f('0xb')],_0x223f('0x26'),'migrations'));var _0x290527=[];for(var _0x1b8057=0x0;_0x1b8057<_0x44fc1f[_0x223f('0x27')];_0x1b8057++){var _0x54d94c=_0x44fc1f[_0x1b8057][_0x223f('0x28')](_0x223f('0x29'),'');if(compareVersions(module[_0x223f('0xd')]['version'],_0x54d94c)===-0x1){_0x290527[_0x223f('0x2a')](_0x54d94c);}}if(_0x290527['length']){var _0x51e747=_0x290527[_0x223f('0x2b')](compareVersions);var _0x3e2ab4=new Umzug({'storage':_0x223f('0x2c'),'storageOptions':{'model':db[_0x223f('0x2d')],'modelName':_0x223f('0x2d'),'columnName':_0x223f('0x4')},'migrations':{'params':[db[_0x223f('0x2c')][_0x223f('0x2e')](),db['sequelize']['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x223f('0x2f')](config[_0x223f('0xb')],'server',_0x223f('0x30')),'pattern':/\.js$/}});_0x3e2ab4['up']({'migrations':_[_0x223f('0x31')](_0x51e747,function(_0x374560){return _0x374560+_0x223f('0x29');})})[_0x223f('0x21')](function(){return _0x151f04[_0x223f('0x13')](0xc8)[_0x223f('0x14')]({'output':_0x223f('0x32')+module[_0x223f('0xd')][_0x223f('0x4')]+_0x223f('0x33')+_[_0x223f('0x34')](_0x51e747),'migrations':_[_0x223f('0x2f')](_0x51e747)});})['catch'](function(_0x557f2a){if(_0x557f2a instanceof db[_0x223f('0x2c')][_0x223f('0x35')]){return _0x151f04[_0x223f('0x13')](0xc8)[_0x223f('0x14')]({'output':_0x223f('0x36')});}else{return _0x151f04[_0x223f('0x13')](0x1f4)['json'](_0x557f2a);}});}else{return _0x151f04[_0x223f('0x13')](0xc8)[_0x223f('0x14')]({'output':_0x223f('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f0ff472..3027896 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 _0xdf55=['post','put','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x4a94b1,_0x4f2518){var _0x20949f=function(_0x1c4aa6){while(--_0x1c4aa6){_0x4a94b1['push'](_0x4a94b1['shift']());}};_0x20949f(++_0x4f2518);}(_0xdf55,0x83));var _0x5df5=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0xdf55[_0x27125a];return _0x391f7a;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var auth=require(_0x5df5('0x4'));var interaction=require(_0x5df5('0x5'));var config=require(_0x5df5('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x5df5('0x7')]('/',auth[_0x5df5('0x8')](),controller[_0x5df5('0x9')]);router[_0x5df5('0x7')](_0x5df5('0xa'),auth[_0x5df5('0x8')](),controller[_0x5df5('0xb')]);router[_0x5df5('0x7')]('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0xc')]);router[_0x5df5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5df5('0xe')]('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0xf')]);router['delete']('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file +var _0xf61e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x5a335d,_0x148b8c){var _0x235b68=function(_0x5ed82b){while(--_0x5ed82b){_0x5a335d['push'](_0x5a335d['shift']());}};_0x235b68(++_0x148b8c);}(_0xf61e,0x191));var _0xef61=function(_0x434cfd,_0x22785e){_0x434cfd=_0x434cfd-0x0;var _0x71d57f=_0xf61e[_0x434cfd];return _0x71d57f;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var auth=require(_0xef61('0x6'));var interaction=require(_0xef61('0x7'));var config=require(_0xef61('0x8'));var controller=require(_0xef61('0x9'));router[_0xef61('0xa')]('/',auth[_0xef61('0xb')](),controller['index']);router[_0xef61('0xa')](_0xef61('0xc'),auth['isAuthenticated'](),controller[_0xef61('0xd')]);router[_0xef61('0xa')](_0xef61('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xef61('0xf')]('/',auth[_0xef61('0xb')](),controller[_0xef61('0x10')]);router[_0xef61('0x11')](_0xef61('0xe'),auth[_0xef61('0xb')](),controller[_0xef61('0x12')]);router[_0xef61('0x13')](_0xef61('0xe'),auth[_0xef61('0xb')](),controller[_0xef61('0x14')]);module[_0xef61('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index df13404..682ae9c 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 _0x335f=['STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x1a8cf6,_0x3220ef){var _0x4a786c=function(_0x283964){while(--_0x283964){_0x1a8cf6['push'](_0x1a8cf6['shift']());}};_0x4a786c(++_0x3220ef);}(_0x335f,0x10f));var _0xf335=function(_0x50be80,_0x3615b5){_0x50be80=_0x50be80-0x0;var _0x389403=_0x335f[_0x50be80];return _0x389403;};'use strict';var Sequelize=require(_0xf335('0x0'));module[_0xf335('0x1')]={'type':{'type':Sequelize[_0xf335('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf335('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf335('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xf335('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xf335('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xf335('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf335('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf335('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf335('0x5')]},'agentacw':{'type':Sequelize[_0xf335('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf335('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xf335('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf335('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf335('0x2')]},'connectedlinename':{'type':Sequelize[_0xf335('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf335('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf335('0x2')]},'priority':{'type':Sequelize[_0xf335('0x2')]},'destchannel':{'type':Sequelize[_0xf335('0x2')]},'destchannelstate':{'type':Sequelize[_0xf335('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xf335('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf335('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf335('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf335('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf335('0x2')]},'destcontext':{'type':Sequelize[_0xf335('0x2')]},'destexten':{'type':Sequelize[_0xf335('0x2')]},'destpriority':{'type':Sequelize[_0xf335('0x2')]},'destuniqueid':{'type':Sequelize[_0xf335('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf335('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xf335('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf335('0x2')],'comment':_0xf335('0x6')},'transferexten':{'type':Sequelize[_0xf335('0x2')]},'transferuniqueid':{'type':Sequelize[_0xf335('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7c25=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x3efdb9,_0x59d97d){var _0x22d2cc=function(_0x168c13){while(--_0x168c13){_0x3efdb9['push'](_0x3efdb9['shift']());}};_0x22d2cc(++_0x59d97d);}(_0x7c25,0x82));var _0x57c2=function(_0x52483c,_0x161936){_0x52483c=_0x52483c-0x0;var _0x31380=_0x7c25[_0x52483c];return _0x31380;};'use strict';var Sequelize=require(_0x57c2('0x0'));module[_0x57c2('0x1')]={'type':{'type':Sequelize[_0x57c2('0x2')]},'uniqueid':{'type':Sequelize[_0x57c2('0x2')]},'calleridnum':{'type':Sequelize[_0x57c2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x57c2('0x2')]},'agentcalledAt':{'type':Sequelize[_0x57c2('0x3')]},'agentconnectAt':{'type':Sequelize[_0x57c2('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x57c2('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x57c2('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x57c2('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x57c2('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x57c2('0x2')]},'channel':{'type':Sequelize[_0x57c2('0x2')]},'channelstate':{'type':Sequelize[_0x57c2('0x5')]},'channelstatedesc':{'type':Sequelize[_0x57c2('0x2')]},'connectedlinenum':{'type':Sequelize[_0x57c2('0x2')]},'connectedlinename':{'type':Sequelize[_0x57c2('0x2')]},'language':{'type':Sequelize[_0x57c2('0x2')]},'accountcode':{'type':Sequelize[_0x57c2('0x2')]},'context':{'type':Sequelize[_0x57c2('0x2')]},'exten':{'type':Sequelize[_0x57c2('0x2')]},'priority':{'type':Sequelize[_0x57c2('0x2')]},'destchannel':{'type':Sequelize[_0x57c2('0x2')]},'destchannelstate':{'type':Sequelize[_0x57c2('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x57c2('0x2')]},'destcalleridnum':{'type':Sequelize[_0x57c2('0x2')]},'destcalleridname':{'type':Sequelize[_0x57c2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x57c2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x57c2('0x2')]},'destlanguage':{'type':Sequelize[_0x57c2('0x2')]},'destaccountcode':{'type':Sequelize[_0x57c2('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x57c2('0x2')]},'destpriority':{'type':Sequelize[_0x57c2('0x2')]},'destuniqueid':{'type':Sequelize[_0x57c2('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x57c2('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x57c2('0x2')]},'transfer':{'type':Sequelize[_0x57c2('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x57c2('0x2')],'comment':_0x57c2('0x6')},'transferexten':{'type':Sequelize[_0x57c2('0x2')]},'transferuniqueid':{'type':Sequelize[_0x57c2('0x2')]},'agententerreason':{'type':Sequelize[_0x57c2('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 7353146..0af0b8d 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 _0x52a2=['bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','update','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment'];(function(_0x5d503a,_0x564d74){var _0x4e9a13=function(_0x2ae833){while(--_0x2ae833){_0x5d503a['push'](_0x5d503a['shift']());}};_0x4e9a13(++_0x564d74);}(_0x52a2,0x1de));var _0x252a=function(_0x126121,_0x35e290){_0x126121=_0x126121-0x0;var _0x57d413=_0x52a2[_0x126121];return _0x57d413;};'use strict';var pdf=require(_0x252a('0x0'));var emlformat=require(_0x252a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x252a('0x2'));var rp=require(_0x252a('0x3'));var moment=require(_0x252a('0x4'));var BPromise=require(_0x252a('0x5'));var Mustache=require('mustache');var util=require(_0x252a('0x6'));var path=require(_0x252a('0x7'));var sox=require(_0x252a('0x8'));var csv=require(_0x252a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x252a('0xa'));var crypto=require(_0x252a('0xb'));var jsforce=require(_0x252a('0xc'));var deskjs=require(_0x252a('0xd'));var toCsv=require(_0x252a('0x9'));var querystring=require(_0x252a('0xe'));var Papa=require(_0x252a('0xf'));var Redis=require('ioredis');var authService=require(_0x252a('0x10'));var qs=require(_0x252a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x252a('0x12'));var db=require(_0x252a('0x13'))['db'];function respondWithStatusCode(_0x5692b6,_0x5d11cb){_0x5d11cb=_0x5d11cb||0xcc;return function(_0x23b634){if(_0x23b634){return _0x5692b6[_0x252a('0x14')](_0x5d11cb);}return _0x5692b6[_0x252a('0x15')](_0x5d11cb)[_0x252a('0x16')]();};}function respondWithResult(_0x27c809,_0x46ce78){_0x46ce78=_0x46ce78||0xc8;return function(_0x3c142c){if(_0x3c142c){return _0x27c809[_0x252a('0x15')](_0x46ce78)[_0x252a('0x17')](_0x3c142c);}};}function respondWithFilteredResult(_0x3d5a22,_0x511878){return function(_0x5d6443){if(_0x5d6443){var _0x346542=_0x5d6443[_0x252a('0x18')],_0x166c18=_0x511878[_0x252a('0x19')],_0x50692e=_0x511878[_0x252a('0x19')]+_0x511878[_0x252a('0x1a')],_0x151a53;if(_0x50692e>=_0x346542){_0x50692e=_0x346542;_0x151a53=0xc8;}else{_0x151a53=0xce;}_0x3d5a22[_0x252a('0x15')](_0x151a53);return _0x3d5a22[_0x252a('0x1b')]('Content-Range',_0x166c18+'-'+_0x50692e+'/'+_0x346542)['json'](_0x5d6443);}return null;};}function patchUpdates(_0x3d9f67){return function(_0x4447f8){try{jsonpatch[_0x252a('0x1c')](_0x4447f8,_0x3d9f67,!![]);}catch(_0x21fcd5){return BPromise[_0x252a('0x1d')](_0x21fcd5);}return _0x4447f8[_0x252a('0x1e')]();};}function saveUpdates(_0x17c809,_0x57e80b){return function(_0x20df75){if(_0x20df75){return _0x20df75['update'](_0x17c809)[_0x252a('0x1f')](function(_0x2535f1){return _0x2535f1;});}return null;};}function removeEntity(_0x66ce9f,_0x3135fa){return function(_0x2b6a13){if(_0x2b6a13){return _0x2b6a13[_0x252a('0x20')]()[_0x252a('0x1f')](function(){_0x66ce9f[_0x252a('0x15')](0xcc)[_0x252a('0x16')]();});}};}function handleEntityNotFound(_0x5948ef,_0x30296c){return function(_0x4fd320){if(!_0x4fd320){_0x5948ef['sendStatus'](0x194);}return _0x4fd320;};}function handleError(_0x2be448,_0x412063){_0x412063=_0x412063||0x1f4;return function(_0x4f0863){logger[_0x252a('0x21')](_0x4f0863[_0x252a('0x22')]);if(_0x4f0863[_0x252a('0x23')]){delete _0x4f0863[_0x252a('0x23')];}_0x2be448[_0x252a('0x15')](_0x412063)[_0x252a('0x24')](_0x4f0863);};}exports[_0x252a('0x25')]=function(_0x48e687,_0x176830){var _0x5d4d42={},_0x3473d4={},_0x2b7aa8={'count':0x0,'rows':[]};var _0x3f0f82=db[_0x252a('0x26')][_0x252a('0x27')];_0x3473d4[_0x252a('0x28')]=_[_0x252a('0x29')](_0x3f0f82);_0x3473d4[_0x252a('0x2a')]=_[_0x252a('0x29')](_0x48e687[_0x252a('0x2a')]);_0x3473d4[_0x252a('0x2b')]=_[_0x252a('0x2c')](_0x3473d4[_0x252a('0x28')],_0x3473d4['query']);_0x5d4d42[_0x252a('0x2d')]=_['intersection'](_0x3473d4[_0x252a('0x28')],qs['fields'](_0x48e687['query'][_0x252a('0x2e')]));_0x5d4d42[_0x252a('0x2d')]=_0x5d4d42['attributes']['length']?_0x5d4d42[_0x252a('0x2d')]:_0x3473d4[_0x252a('0x28')];if(!_0x48e687[_0x252a('0x2a')][_0x252a('0x2f')](_0x252a('0x30'))){_0x5d4d42[_0x252a('0x1a')]=qs['limit'](_0x48e687[_0x252a('0x2a')][_0x252a('0x1a')]);_0x5d4d42[_0x252a('0x19')]=qs[_0x252a('0x19')](_0x48e687[_0x252a('0x2a')][_0x252a('0x19')]);}_0x5d4d42[_0x252a('0x31')]=qs[_0x252a('0x32')](_0x48e687[_0x252a('0x2a')][_0x252a('0x32')]);_0x5d4d42['where']=qs[_0x252a('0x2b')](_['pick'](_0x48e687[_0x252a('0x2a')],_0x3473d4[_0x252a('0x2b')]));if(_0x48e687[_0x252a('0x2a')]['filter']){_0x5d4d42[_0x252a('0x33')]=_['merge'](_0x5d4d42[_0x252a('0x33')],{'$or':_[_0x252a('0x34')](_0x3f0f82,function(_0x4bd97d){if(_0x4bd97d[_0x252a('0x35')]['key']!==_0x252a('0x36')){var _0x10aea5={};_0x10aea5[_0x4bd97d['field']]={'$like':'%'+_0x48e687[_0x252a('0x2a')]['filter']+'%'};return _0x10aea5;}})});}_0x5d4d42=_['merge']({},_0x5d4d42,_0x48e687[_0x252a('0x37')]);var _0x2ad6d9={'where':_0x5d4d42['where']};return db['VoiceAgentReport'][_0x252a('0x18')](_0x2ad6d9)[_0x252a('0x1f')](function(_0x24d9df){_0x2b7aa8['count']=_0x24d9df;if(_0x48e687['query'][_0x252a('0x38')]){_0x5d4d42[_0x252a('0x39')]=[{'all':!![]}];}return db[_0x252a('0x26')][_0x252a('0x3a')](_0x5d4d42);})[_0x252a('0x1f')](function(_0x24f947){_0x2b7aa8[_0x252a('0x3b')]=_0x24f947;return _0x2b7aa8;})[_0x252a('0x1f')](respondWithFilteredResult(_0x176830,_0x5d4d42))[_0x252a('0x3c')](handleError(_0x176830,null));};exports[_0x252a('0x3d')]=function(_0x4c8c8f,_0xd3c4b1){var _0x107142={'raw':![],'where':{'id':_0x4c8c8f[_0x252a('0x3e')]['id']}},_0x1367f8={};_0x1367f8[_0x252a('0x28')]=_[_0x252a('0x29')](db['VoiceAgentReport']['rawAttributes']);_0x1367f8[_0x252a('0x2a')]=_[_0x252a('0x29')](_0x4c8c8f[_0x252a('0x2a')]);_0x1367f8[_0x252a('0x2b')]=_[_0x252a('0x2c')](_0x1367f8[_0x252a('0x28')],_0x1367f8['query']);_0x107142['attributes']=_[_0x252a('0x2c')](_0x1367f8[_0x252a('0x28')],qs[_0x252a('0x2e')](_0x4c8c8f[_0x252a('0x2a')][_0x252a('0x2e')]));_0x107142['attributes']=_0x107142['attributes']['length']?_0x107142[_0x252a('0x2d')]:_0x1367f8[_0x252a('0x28')];if(_0x4c8c8f[_0x252a('0x2a')][_0x252a('0x38')]){_0x107142[_0x252a('0x39')]=[{'all':!![]}];}_0x107142=_[_0x252a('0x3f')]({},_0x107142,_0x4c8c8f[_0x252a('0x37')]);return db[_0x252a('0x26')]['find'](_0x107142)['then'](handleEntityNotFound(_0xd3c4b1,null))[_0x252a('0x1f')](respondWithResult(_0xd3c4b1,null))['catch'](handleError(_0xd3c4b1,null));};exports[_0x252a('0x40')]=function(_0x5087c9,_0x2c6305){return db['VoiceAgentReport']['create'](_0x5087c9[_0x252a('0x41')],{})[_0x252a('0x1f')](respondWithResult(_0x2c6305,0xc9))[_0x252a('0x3c')](handleError(_0x2c6305,null));};exports[_0x252a('0x42')]=function(_0x4158f6,_0x58f9fd){if(_0x4158f6['body']['id']){delete _0x4158f6[_0x252a('0x41')]['id'];}return db['VoiceAgentReport'][_0x252a('0x43')]({'where':{'id':_0x4158f6[_0x252a('0x3e')]['id']}})[_0x252a('0x1f')](handleEntityNotFound(_0x58f9fd,null))[_0x252a('0x1f')](saveUpdates(_0x4158f6[_0x252a('0x41')],null))[_0x252a('0x1f')](respondWithResult(_0x58f9fd,null))['catch'](handleError(_0x58f9fd,null));};exports[_0x252a('0x20')]=function(_0x5084a2,_0x1bb70c){return db[_0x252a('0x26')][_0x252a('0x43')]({'where':{'id':_0x5084a2[_0x252a('0x3e')]['id']}})[_0x252a('0x1f')](handleEntityNotFound(_0x1bb70c,null))['then'](removeEntity(_0x1bb70c,null))['catch'](handleError(_0x1bb70c,null));};exports[_0x252a('0x44')]=function(_0x51e821,_0x1a26fc){return db['VoiceAgentReport']['describe']()[_0x252a('0x1f')](respondWithResult(_0x1a26fc,null))[_0x252a('0x3c')](handleError(_0x1a26fc,null));}; \ No newline at end of file +var _0xdbf4=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','error','name','send','index','VoiceAgentReport','model','query'];(function(_0x915f52,_0xae330a){var _0x2baabe=function(_0x260da7){while(--_0x260da7){_0x915f52['push'](_0x915f52['shift']());}};_0x2baabe(++_0xae330a);}(_0xdbf4,0x67));var _0x4dbf=function(_0x516e13,_0x2f12ad){_0x516e13=_0x516e13-0x0;var _0x594930=_0xdbf4[_0x516e13];return _0x594930;};'use strict';var pdf=require(_0x4dbf('0x0'));var emlformat=require(_0x4dbf('0x1'));var rimraf=require(_0x4dbf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4dbf('0x3'));var rp=require(_0x4dbf('0x4'));var moment=require('moment');var BPromise=require(_0x4dbf('0x5'));var Mustache=require(_0x4dbf('0x6'));var util=require(_0x4dbf('0x7'));var path=require(_0x4dbf('0x8'));var sox=require(_0x4dbf('0x9'));var csv=require(_0x4dbf('0xa'));var ejs=require(_0x4dbf('0xb'));var fs=require('fs');var _=require(_0x4dbf('0xc'));var squel=require(_0x4dbf('0xd'));var crypto=require('crypto');var jsforce=require(_0x4dbf('0xe'));var deskjs=require(_0x4dbf('0xf'));var toCsv=require(_0x4dbf('0xa'));var querystring=require(_0x4dbf('0x10'));var Papa=require(_0x4dbf('0x11'));var Redis=require(_0x4dbf('0x12'));var authService=require(_0x4dbf('0x13'));var qs=require(_0x4dbf('0x14'));var hardwareService=require(_0x4dbf('0x15'));var logger=require(_0x4dbf('0x16'))(_0x4dbf('0x17'));var utils=require(_0x4dbf('0x18'));var config=require('../../config/environment');var db=require(_0x4dbf('0x19'))['db'];function respondWithStatusCode(_0xa5bbfe,_0x40d6b2){_0x40d6b2=_0x40d6b2||0xcc;return function(_0x5abd05){if(_0x5abd05){return _0xa5bbfe[_0x4dbf('0x1a')](_0x40d6b2);}return _0xa5bbfe[_0x4dbf('0x1b')](_0x40d6b2)[_0x4dbf('0x1c')]();};}function respondWithResult(_0x2da9b7,_0xe4c8a9){_0xe4c8a9=_0xe4c8a9||0xc8;return function(_0x1afe6c){if(_0x1afe6c){return _0x2da9b7[_0x4dbf('0x1b')](_0xe4c8a9)[_0x4dbf('0x1d')](_0x1afe6c);}};}function respondWithFilteredResult(_0x5d1ba3,_0x570352){return function(_0x5d7702){if(_0x5d7702){var _0x39e818=_0x5d7702['count'],_0x33e6b8=_0x570352[_0x4dbf('0x1e')],_0x4ae7d7=_0x570352[_0x4dbf('0x1e')]+_0x570352[_0x4dbf('0x1f')],_0x46f8a0;if(_0x4ae7d7>=_0x39e818){_0x4ae7d7=_0x39e818;_0x46f8a0=0xc8;}else{_0x46f8a0=0xce;}_0x5d1ba3['status'](_0x46f8a0);return _0x5d1ba3['set'](_0x4dbf('0x20'),_0x33e6b8+'-'+_0x4ae7d7+'/'+_0x39e818)['json'](_0x5d7702);}return null;};}function patchUpdates(_0x1ea001){return function(_0x51396b){try{jsonpatch['apply'](_0x51396b,_0x1ea001,!![]);}catch(_0x57c2ae){return BPromise[_0x4dbf('0x21')](_0x57c2ae);}return _0x51396b[_0x4dbf('0x22')]();};}function saveUpdates(_0x435d14,_0x377b38){return function(_0x538f58){if(_0x538f58){return _0x538f58[_0x4dbf('0x23')](_0x435d14)[_0x4dbf('0x24')](function(_0x215475){return _0x215475;});}return null;};}function removeEntity(_0x4fe625,_0x25da8d){return function(_0xebfe39){if(_0xebfe39){return _0xebfe39[_0x4dbf('0x25')]()[_0x4dbf('0x24')](function(){_0x4fe625[_0x4dbf('0x1b')](0xcc)[_0x4dbf('0x1c')]();});}};}function handleEntityNotFound(_0x2d4700,_0x9f91e2){return function(_0x148dd3){if(!_0x148dd3){_0x2d4700[_0x4dbf('0x1a')](0x194);}return _0x148dd3;};}function handleError(_0x52cfd0,_0x2d71e1){_0x2d71e1=_0x2d71e1||0x1f4;return function(_0x1f8ce7){logger[_0x4dbf('0x26')](_0x1f8ce7['stack']);if(_0x1f8ce7[_0x4dbf('0x27')]){delete _0x1f8ce7[_0x4dbf('0x27')];}_0x52cfd0[_0x4dbf('0x1b')](_0x2d71e1)[_0x4dbf('0x28')](_0x1f8ce7);};}exports[_0x4dbf('0x29')]=function(_0x2034a3,_0x58df4f){var _0x5df86c={},_0x7ed526={},_0x204ae9={'count':0x0,'rows':[]};var _0x23bda5=db[_0x4dbf('0x2a')]['rawAttributes'];_0x7ed526[_0x4dbf('0x2b')]=_['keys'](_0x23bda5);_0x7ed526[_0x4dbf('0x2c')]=_[_0x4dbf('0x2d')](_0x2034a3[_0x4dbf('0x2c')]);_0x7ed526[_0x4dbf('0x2e')]=_[_0x4dbf('0x2f')](_0x7ed526['model'],_0x7ed526[_0x4dbf('0x2c')]);_0x5df86c['attributes']=_[_0x4dbf('0x2f')](_0x7ed526[_0x4dbf('0x2b')],qs[_0x4dbf('0x30')](_0x2034a3[_0x4dbf('0x2c')][_0x4dbf('0x30')]));_0x5df86c[_0x4dbf('0x31')]=_0x5df86c['attributes'][_0x4dbf('0x32')]?_0x5df86c['attributes']:_0x7ed526[_0x4dbf('0x2b')];if(!_0x2034a3[_0x4dbf('0x2c')][_0x4dbf('0x33')](_0x4dbf('0x34'))){_0x5df86c['limit']=qs[_0x4dbf('0x1f')](_0x2034a3['query'][_0x4dbf('0x1f')]);_0x5df86c[_0x4dbf('0x1e')]=qs[_0x4dbf('0x1e')](_0x2034a3['query']['offset']);}_0x5df86c[_0x4dbf('0x35')]=qs[_0x4dbf('0x36')](_0x2034a3[_0x4dbf('0x2c')]['sort']);_0x5df86c[_0x4dbf('0x37')]=qs['filters'](_[_0x4dbf('0x38')](_0x2034a3[_0x4dbf('0x2c')],_0x7ed526['filters']));if(_0x2034a3[_0x4dbf('0x2c')][_0x4dbf('0x39')]){_0x5df86c[_0x4dbf('0x37')]=_[_0x4dbf('0x3a')](_0x5df86c[_0x4dbf('0x37')],{'$or':_['map'](_0x23bda5,function(_0x4c2c79){if(_0x4c2c79[_0x4dbf('0x3b')]['key']!=='VIRTUAL'){var _0x31590a={};_0x31590a[_0x4c2c79[_0x4dbf('0x3c')]]={'$like':'%'+_0x2034a3['query']['filter']+'%'};return _0x31590a;}})});}_0x5df86c=_[_0x4dbf('0x3a')]({},_0x5df86c,_0x2034a3[_0x4dbf('0x3d')]);var _0x50a901={'where':_0x5df86c[_0x4dbf('0x37')]};return db[_0x4dbf('0x2a')]['count'](_0x50a901)['then'](function(_0x276bd1){_0x204ae9[_0x4dbf('0x3e')]=_0x276bd1;if(_0x2034a3[_0x4dbf('0x2c')][_0x4dbf('0x3f')]){_0x5df86c[_0x4dbf('0x40')]=[{'all':!![]}];}return db[_0x4dbf('0x2a')][_0x4dbf('0x41')](_0x5df86c);})['then'](function(_0x5131fa){_0x204ae9[_0x4dbf('0x42')]=_0x5131fa;return _0x204ae9;})[_0x4dbf('0x24')](respondWithFilteredResult(_0x58df4f,_0x5df86c))[_0x4dbf('0x43')](handleError(_0x58df4f,null));};exports[_0x4dbf('0x44')]=function(_0x4f7b24,_0x25b4db){var _0x3cecdf={'raw':![],'where':{'id':_0x4f7b24[_0x4dbf('0x45')]['id']}},_0xfb4a0e={};_0xfb4a0e['model']=_[_0x4dbf('0x2d')](db['VoiceAgentReport']['rawAttributes']);_0xfb4a0e[_0x4dbf('0x2c')]=_['keys'](_0x4f7b24[_0x4dbf('0x2c')]);_0xfb4a0e[_0x4dbf('0x2e')]=_['intersection'](_0xfb4a0e[_0x4dbf('0x2b')],_0xfb4a0e[_0x4dbf('0x2c')]);_0x3cecdf['attributes']=_['intersection'](_0xfb4a0e[_0x4dbf('0x2b')],qs[_0x4dbf('0x30')](_0x4f7b24[_0x4dbf('0x2c')][_0x4dbf('0x30')]));_0x3cecdf[_0x4dbf('0x31')]=_0x3cecdf[_0x4dbf('0x31')][_0x4dbf('0x32')]?_0x3cecdf['attributes']:_0xfb4a0e[_0x4dbf('0x2b')];if(_0x4f7b24[_0x4dbf('0x2c')][_0x4dbf('0x3f')]){_0x3cecdf[_0x4dbf('0x40')]=[{'all':!![]}];}_0x3cecdf=_[_0x4dbf('0x3a')]({},_0x3cecdf,_0x4f7b24[_0x4dbf('0x3d')]);return db[_0x4dbf('0x2a')][_0x4dbf('0x46')](_0x3cecdf)[_0x4dbf('0x24')](handleEntityNotFound(_0x25b4db,null))['then'](respondWithResult(_0x25b4db,null))['catch'](handleError(_0x25b4db,null));};exports['create']=function(_0x103ea5,_0x2be842){return db[_0x4dbf('0x2a')][_0x4dbf('0x47')](_0x103ea5['body'],{})['then'](respondWithResult(_0x2be842,0xc9))['catch'](handleError(_0x2be842,null));};exports[_0x4dbf('0x23')]=function(_0x1f94cc,_0x356d7a){if(_0x1f94cc[_0x4dbf('0x48')]['id']){delete _0x1f94cc[_0x4dbf('0x48')]['id'];}return db[_0x4dbf('0x2a')][_0x4dbf('0x46')]({'where':{'id':_0x1f94cc['params']['id']}})[_0x4dbf('0x24')](handleEntityNotFound(_0x356d7a,null))['then'](saveUpdates(_0x1f94cc[_0x4dbf('0x48')],null))[_0x4dbf('0x24')](respondWithResult(_0x356d7a,null))[_0x4dbf('0x43')](handleError(_0x356d7a,null));};exports[_0x4dbf('0x25')]=function(_0x473467,_0x244ca4){return db['VoiceAgentReport'][_0x4dbf('0x46')]({'where':{'id':_0x473467[_0x4dbf('0x45')]['id']}})[_0x4dbf('0x24')](handleEntityNotFound(_0x244ca4,null))[_0x4dbf('0x24')](removeEntity(_0x244ca4,null))[_0x4dbf('0x43')](handleError(_0x244ca4,null));};exports[_0x4dbf('0x49')]=function(_0x26e4a6,_0x13bb3d){return db['VoiceAgentReport'][_0x4dbf('0x49')]()[_0x4dbf('0x24')](respondWithResult(_0x13bb3d,null))[_0x4dbf('0x43')](handleError(_0x13bb3d,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index f7c4cee..f3977eb 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 _0x8568=['request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1cc47a,_0x16bbe2){var _0x41b8ec=function(_0x1da1e3){while(--_0x1da1e3){_0x1cc47a['push'](_0x1cc47a['shift']());}};_0x41b8ec(++_0x16bbe2);}(_0x8568,0x1e5));var _0x8856=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x8568[_0x237da8];return _0x558825;};'use strict';var _=require(_0x8856('0x0'));var util=require('util');var logger=require(_0x8856('0x1'))(_0x8856('0x2'));var moment=require(_0x8856('0x3'));var BPromise=require(_0x8856('0x4'));var rp=require(_0x8856('0x5'));var fs=require('fs');var path=require(_0x8856('0x6'));var rimraf=require('rimraf');var config=require(_0x8856('0x7'));var attributes=require(_0x8856('0x8'));module[_0x8856('0x9')]=function(_0x3a1d58,_0x36376b){return _0x3a1d58[_0x8856('0xa')](_0x8856('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x8856('0xc'),_0x8856('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ae0=['destuniqueid','lodash','util','api','moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid'];(function(_0x581bd3,_0x3c7746){var _0x5502d8=function(_0x354227){while(--_0x354227){_0x581bd3['push'](_0x581bd3['shift']());}};_0x5502d8(++_0x3c7746);}(_0x0ae0,0x146));var _0x00ae=function(_0x2bcb6c,_0x5246b1){_0x2bcb6c=_0x2bcb6c-0x0;var _0x2585cf=_0x0ae0[_0x2bcb6c];return _0x2585cf;};'use strict';var _=require(_0x00ae('0x0'));var util=require(_0x00ae('0x1'));var logger=require('../../config/logger')(_0x00ae('0x2'));var moment=require(_0x00ae('0x3'));var BPromise=require(_0x00ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x00ae('0x5'));var rimraf=require('rimraf');var config=require(_0x00ae('0x6'));var attributes=require(_0x00ae('0x7'));module[_0x00ae('0x8')]=function(_0x38984b,_0x25cdc7){return _0x38984b[_0x00ae('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x00ae('0xa'),'paranoid':![],'indexes':[{'fields':[_0x00ae('0xb'),_0x00ae('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index abb7725..42b5b78 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x5173b3,_0x26273d){var _0x16d4d7=function(_0x205197){while(--_0x205197){_0x5173b3['push'](_0x5173b3['shift']());}};_0x16d4d7(++_0x26273d);}(_0x814b,0x1a2));var _0xb814=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0x814b[_0x347399];return _0x24e7be;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x3e72da,_0x7909e3){var _0x20a27d=function(_0x2ce453){while(--_0x2ce453){_0x3e72da['push'](_0x3e72da['shift']());}};_0x20a27d(++_0x7909e3);}(_0x814b,0x1a2));var _0xb814=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x814b[_0x589aee];return _0x2f5ed4;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index feffae9..95aa6dd 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 _0x3afc=['update','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id'];(function(_0x578465,_0x1a7e5e){var _0x5eaa8e=function(_0x3ba95d){while(--_0x3ba95d){_0x578465['push'](_0x578465['shift']());}};_0x5eaa8e(++_0x1a7e5e);}(_0x3afc,0x1dd));var _0xc3af=function(_0x1f3b8d,_0x527c76){_0x1f3b8d=_0x1f3b8d-0x0;var _0x35b42c=_0x3afc[_0x1f3b8d];return _0x35b42c;};'use strict';var multer=require(_0xc3af('0x0'));var util=require(_0xc3af('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3af('0x2'));var router=express[_0xc3af('0x3')]();var auth=require(_0xc3af('0x4'));var interaction=require(_0xc3af('0x5'));var config=require(_0xc3af('0x6'));var controller=require('./voiceCallReport.controller');router[_0xc3af('0x7')]('/',auth[_0xc3af('0x8')](),controller[_0xc3af('0x9')]);router[_0xc3af('0x7')](_0xc3af('0xa'),auth[_0xc3af('0x8')](),controller[_0xc3af('0xb')]);router[_0xc3af('0x7')]('/:id',auth[_0xc3af('0x8')](),controller[_0xc3af('0xc')]);router[_0xc3af('0xd')]('/',auth['isAuthenticated'](),controller[_0xc3af('0xe')]);router['put'](_0xc3af('0xf'),auth[_0xc3af('0x8')](),controller[_0xc3af('0x10')]);router['delete'](_0xc3af('0xf'),auth[_0xc3af('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f02=['index','get','/describe','describe','/:id','show','post','put','delete','destroy','exports','util','path','express','Router','../../config/environment','./voiceCallReport.controller','isAuthenticated'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0x5f02,0x1a9));var _0x25f0=function(_0x5afdf9,_0x192c9d){_0x5afdf9=_0x5afdf9-0x0;var _0x3fc91e=_0x5f02[_0x5afdf9];return _0x3fc91e;};'use strict';var multer=require('multer');var util=require(_0x25f0('0x0'));var path=require(_0x25f0('0x1'));var timeout=require('connect-timeout');var express=require(_0x25f0('0x2'));var router=express[_0x25f0('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x25f0('0x4'));var controller=require(_0x25f0('0x5'));router['get']('/',auth[_0x25f0('0x6')](),controller[_0x25f0('0x7')]);router[_0x25f0('0x8')](_0x25f0('0x9'),auth[_0x25f0('0x6')](),controller[_0x25f0('0xa')]);router[_0x25f0('0x8')](_0x25f0('0xb'),auth[_0x25f0('0x6')](),controller[_0x25f0('0xc')]);router[_0x25f0('0xd')]('/',auth[_0x25f0('0x6')](),controller['create']);router[_0x25f0('0xe')](_0x25f0('0xb'),auth[_0x25f0('0x6')](),controller['update']);router[_0x25f0('0xf')]('/:id',auth[_0x25f0('0x6')](),controller[_0x25f0('0x10')]);module[_0x25f0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index bfa0b48..c86ac62 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 _0x2b27=['inbound','internal','outbound','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b27,0x125));var _0x72b2=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x2b27[_0x1ae4a9];return _0x54d0b0;};'use strict';var Sequelize=require(_0x72b2('0x0'));module[_0x72b2('0x1')]={'uniqueid':{'type':Sequelize[_0x72b2('0x2')]},'type':{'type':Sequelize[_0x72b2('0x3')](_0x72b2('0x4'),_0x72b2('0x5'),_0x72b2('0x6'),'inbound-fax','outbound-fax',_0x72b2('0x7'))},'tag':{'type':Sequelize[_0x72b2('0x2')]},'accountcode':{'type':Sequelize[_0x72b2('0x2')]},'source':{'type':Sequelize[_0x72b2('0x2')]},'destination':{'type':Sequelize[_0x72b2('0x2')]},'destinationcontext':{'type':Sequelize[_0x72b2('0x2')]},'callerid':{'type':Sequelize[_0x72b2('0x2')]},'channel':{'type':Sequelize[_0x72b2('0x2')]},'destinationchannel':{'type':Sequelize[_0x72b2('0x2')]},'lastapplication':{'type':Sequelize[_0x72b2('0x2')]},'lastdata':{'type':Sequelize[_0x72b2('0x8')]},'starttime':{'type':Sequelize[_0x72b2('0x9')]},'systemanswertime':{'type':Sequelize[_0x72b2('0x9')]},'answertime':{'type':Sequelize[_0x72b2('0x9')]},'endtime':{'type':Sequelize[_0x72b2('0x9')]},'duration':{'type':Sequelize[_0x72b2('0xa')]},'billableseconds':{'type':Sequelize[_0x72b2('0xa')]},'mohtime':{'type':Sequelize[_0x72b2('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x72b2('0x2')]},'amaflags':{'type':Sequelize[_0x72b2('0x2')]},'userfield':{'type':Sequelize[_0x72b2('0x2')]},'userDisposition':{'type':Sequelize[_0x72b2('0x2')]},'note':{'type':Sequelize[_0x72b2('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x72b2('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2d63=['INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','dialer','STRING','TEXT','DATE'];(function(_0x1bfe96,_0x333ea6){var _0x4bcb4b=function(_0x3f0a51){while(--_0x3f0a51){_0x1bfe96['push'](_0x1bfe96['shift']());}};_0x4bcb4b(++_0x333ea6);}(_0x2d63,0x1a5));var _0x32d6=function(_0x4d7743,_0x59f259){_0x4d7743=_0x4d7743-0x0;var _0x5e09bc=_0x2d63[_0x4d7743];return _0x5e09bc;};'use strict';var Sequelize=require(_0x32d6('0x0'));module[_0x32d6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x32d6('0x2')](_0x32d6('0x3'),_0x32d6('0x4'),_0x32d6('0x5'),_0x32d6('0x6'),'outbound-fax',_0x32d6('0x7'))},'tag':{'type':Sequelize[_0x32d6('0x8')]},'accountcode':{'type':Sequelize[_0x32d6('0x8')]},'source':{'type':Sequelize[_0x32d6('0x8')]},'destination':{'type':Sequelize[_0x32d6('0x8')]},'destinationcontext':{'type':Sequelize[_0x32d6('0x8')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x32d6('0x8')]},'destinationchannel':{'type':Sequelize[_0x32d6('0x8')]},'lastapplication':{'type':Sequelize[_0x32d6('0x8')]},'lastdata':{'type':Sequelize[_0x32d6('0x9')]},'starttime':{'type':Sequelize[_0x32d6('0xa')]},'systemanswertime':{'type':Sequelize[_0x32d6('0xa')]},'answertime':{'type':Sequelize[_0x32d6('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x32d6('0xb')]},'billableseconds':{'type':Sequelize[_0x32d6('0xb')]},'mohtime':{'type':Sequelize[_0x32d6('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x32d6('0x8')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x32d6('0x8')]},'note':{'type':Sequelize[_0x32d6('0x8')]},'prefix':{'type':Sequelize[_0x32d6('0x8')]},'routeid':{'type':Sequelize[_0x32d6('0xb')]},'sipcallid':{'type':Sequelize[_0x32d6('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b973425..83fe762 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 _0x174d=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','fullname','alias','findAll','rows','catch','show','find','create','body','params','describe','uniqueid','user','eml-format'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0x174d,0x9b));var _0xd174=function(_0x31bcb2,_0x23cc0e){_0x31bcb2=_0x31bcb2-0x0;var _0x3f150c=_0x174d[_0x31bcb2];return _0x3f150c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd174('0x0'));var rimraf=require(_0xd174('0x1'));var zipdir=require(_0xd174('0x2'));var jsonpatch=require(_0xd174('0x3'));var rp=require(_0xd174('0x4'));var moment=require(_0xd174('0x5'));var BPromise=require(_0xd174('0x6'));var Mustache=require(_0xd174('0x7'));var util=require(_0xd174('0x8'));var path=require(_0xd174('0x9'));var sox=require(_0xd174('0xa'));var csv=require(_0xd174('0xb'));var ejs=require(_0xd174('0xc'));var fs=require('fs');var _=require(_0xd174('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd174('0xe'));var deskjs=require(_0xd174('0xf'));var toCsv=require(_0xd174('0xb'));var querystring=require('querystring');var Papa=require(_0xd174('0x10'));var Redis=require(_0xd174('0x11'));var authService=require(_0xd174('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd174('0x13'));var logger=require(_0xd174('0x14'))('api');var utils=require(_0xd174('0x15'));var config=require(_0xd174('0x16'));var db=require(_0xd174('0x17'))['db'];function respondWithStatusCode(_0x238710,_0x46d3bd){_0x46d3bd=_0x46d3bd||0xcc;return function(_0x2a6f02){if(_0x2a6f02){return _0x238710[_0xd174('0x18')](_0x46d3bd);}return _0x238710[_0xd174('0x19')](_0x46d3bd)[_0xd174('0x1a')]();};}function respondWithResult(_0xd29b17,_0x310826){_0x310826=_0x310826||0xc8;return function(_0x3cbc9f){if(_0x3cbc9f){return _0xd29b17[_0xd174('0x19')](_0x310826)[_0xd174('0x1b')](_0x3cbc9f);}};}function respondWithFilteredResult(_0x141a52,_0x59ebd8){return function(_0x54c380){if(_0x54c380){var _0x3f88ed=_0x54c380['count'],_0x29a58b=_0x59ebd8['offset'],_0x5d8c9e=_0x59ebd8[_0xd174('0x1c')]+_0x59ebd8[_0xd174('0x1d')],_0x499f5f;if(_0x5d8c9e>=_0x3f88ed){_0x5d8c9e=_0x3f88ed;_0x499f5f=0xc8;}else{_0x499f5f=0xce;}_0x141a52[_0xd174('0x19')](_0x499f5f);return _0x141a52[_0xd174('0x1e')](_0xd174('0x1f'),_0x29a58b+'-'+_0x5d8c9e+'/'+_0x3f88ed)['json'](_0x54c380);}return null;};}function patchUpdates(_0x11c49d){return function(_0xe998d7){try{jsonpatch[_0xd174('0x20')](_0xe998d7,_0x11c49d,!![]);}catch(_0x2138eb){return BPromise[_0xd174('0x21')](_0x2138eb);}return _0xe998d7[_0xd174('0x22')]();};}function saveUpdates(_0x2b75ba,_0x1a7d4c){return function(_0x474943){if(_0x474943){return _0x474943['update'](_0x2b75ba)[_0xd174('0x23')](function(_0x740419){return _0x740419;});}return null;};}function removeEntity(_0xccb613,_0x328b89){return function(_0x1dbe43){if(_0x1dbe43){return _0x1dbe43[_0xd174('0x24')]()['then'](function(){_0xccb613[_0xd174('0x19')](0xcc)[_0xd174('0x1a')]();});}};}function handleEntityNotFound(_0x4f8308,_0x35d68f){return function(_0xcf83a3){if(!_0xcf83a3){_0x4f8308[_0xd174('0x18')](0x194);}return _0xcf83a3;};}function handleError(_0x10ab7f,_0x2796c8){_0x2796c8=_0x2796c8||0x1f4;return function(_0x3ae043){logger[_0xd174('0x25')](_0x3ae043[_0xd174('0x26')]);if(_0x3ae043[_0xd174('0x27')]){delete _0x3ae043[_0xd174('0x27')];}_0x10ab7f[_0xd174('0x19')](_0x2796c8)[_0xd174('0x28')](_0x3ae043);};}exports[_0xd174('0x29')]=function(_0x3b11d7,_0x44d91b){var _0x1325c2={},_0x1c696d={},_0x260b9d={'count':0x0,'rows':[]};var _0x12837d=db[_0xd174('0x2a')][_0xd174('0x2b')];_0x1c696d[_0xd174('0x2c')]=_[_0xd174('0x2d')](_0x12837d);_0x1c696d['query']=_[_0xd174('0x2d')](_0x3b11d7[_0xd174('0x2e')]);_0x1c696d[_0xd174('0x2f')]=_[_0xd174('0x30')](_0x1c696d['model'],_0x1c696d[_0xd174('0x2e')]);_0x1325c2[_0xd174('0x31')]=_[_0xd174('0x30')](_0x1c696d['model'],qs['fields'](_0x3b11d7[_0xd174('0x2e')][_0xd174('0x32')]));_0x1325c2[_0xd174('0x31')]=_0x1325c2[_0xd174('0x31')][_0xd174('0x33')]?_0x1325c2['attributes']:_0x1c696d[_0xd174('0x2c')];if(!_0x3b11d7[_0xd174('0x2e')][_0xd174('0x34')]('nolimit')){_0x1325c2['limit']=qs[_0xd174('0x1d')](_0x3b11d7[_0xd174('0x2e')][_0xd174('0x1d')]);_0x1325c2[_0xd174('0x1c')]=qs['offset'](_0x3b11d7['query'][_0xd174('0x1c')]);}_0x1325c2[_0xd174('0x35')]=qs[_0xd174('0x36')](_0x3b11d7['query'][_0xd174('0x36')]);_0x1325c2[_0xd174('0x37')]=qs[_0xd174('0x2f')](_['pick'](_0x3b11d7['query'],_0x1c696d['filters']));if(_0x3b11d7['query'][_0xd174('0x38')]){_0x1325c2['where']=_[_0xd174('0x39')](_0x1325c2[_0xd174('0x37')],{'$or':_[_0xd174('0x3a')](_0x12837d,function(_0x1736f8){if(_0x1736f8[_0xd174('0x3b')]['key']!==_0xd174('0x3c')){var _0x9cbb34={};_0x9cbb34[_0x1736f8['field']]={'$like':'%'+_0x3b11d7['query']['filter']+'%'};return _0x9cbb34;}})});}_0x1325c2=_['merge']({},_0x1325c2,_0x3b11d7[_0xd174('0x3d')]);var _0x44fab7={'where':_0x1325c2[_0xd174('0x37')]};return db['VoiceCallReport'][_0xd174('0x3e')](_0x44fab7)[_0xd174('0x23')](function(_0x17bfc0){_0x260b9d[_0xd174('0x3e')]=_0x17bfc0;if(_0x3b11d7[_0xd174('0x2e')][_0xd174('0x3f')]){_0x1325c2[_0xd174('0x40')]=[{'attributes':['id',_0xd174('0x27'),_0xd174('0x41'),_0xd174('0x42')],'model':db['User'],'as':'User'}];}return db[_0xd174('0x2a')][_0xd174('0x43')](_0x1325c2);})[_0xd174('0x23')](function(_0x2b7481){_0x260b9d[_0xd174('0x44')]=_0x2b7481;return _0x260b9d;})[_0xd174('0x23')](respondWithFilteredResult(_0x44d91b,_0x1325c2))[_0xd174('0x45')](handleError(_0x44d91b,null));};exports[_0xd174('0x46')]=function(_0x321f51,_0x3d7a5e){var _0x2849c3={'raw':!![],'where':{'id':_0x321f51['params']['id']}},_0x3998d0={};_0x3998d0[_0xd174('0x2c')]=_[_0xd174('0x2d')](db['VoiceCallReport'][_0xd174('0x2b')]);_0x3998d0['query']=_[_0xd174('0x2d')](_0x321f51['query']);_0x3998d0[_0xd174('0x2f')]=_[_0xd174('0x30')](_0x3998d0[_0xd174('0x2c')],_0x3998d0[_0xd174('0x2e')]);_0x2849c3[_0xd174('0x31')]=_['intersection'](_0x3998d0['model'],qs['fields'](_0x321f51['query'][_0xd174('0x32')]));_0x2849c3['attributes']=_0x2849c3[_0xd174('0x31')][_0xd174('0x33')]?_0x2849c3[_0xd174('0x31')]:_0x3998d0[_0xd174('0x2c')];if(_0x321f51[_0xd174('0x2e')][_0xd174('0x3f')]){_0x2849c3[_0xd174('0x40')]=[{'all':!![]}];}_0x2849c3=_['merge']({},_0x2849c3,_0x321f51['options']);return db[_0xd174('0x2a')][_0xd174('0x47')](_0x2849c3)[_0xd174('0x23')](handleEntityNotFound(_0x3d7a5e,null))['then'](respondWithResult(_0x3d7a5e,null))[_0xd174('0x45')](handleError(_0x3d7a5e,null));};exports[_0xd174('0x48')]=function(_0x2fbda9,_0x256386){return db['VoiceCallReport'][_0xd174('0x48')](_0x2fbda9[_0xd174('0x49')],{})['then'](respondWithResult(_0x256386,0xc9))[_0xd174('0x45')](handleError(_0x256386,null));};exports[_0xd174('0x24')]=function(_0x21bd5f,_0x19fbc5){return db[_0xd174('0x2a')][_0xd174('0x47')]({'where':{'id':_0x21bd5f[_0xd174('0x4a')]['id']}})[_0xd174('0x23')](handleEntityNotFound(_0x19fbc5,null))[_0xd174('0x23')](removeEntity(_0x19fbc5,null))[_0xd174('0x45')](handleError(_0x19fbc5,null));};exports[_0xd174('0x4b')]=function(_0x2164cd,_0x1a16d8){return db['VoiceCallReport']['describe']()['then'](respondWithResult(_0x1a16d8,null))['catch'](handleError(_0x1a16d8,null));};exports['update']=function(_0x395c05,_0x532445){if(_0x395c05[_0xd174('0x49')][_0xd174('0x4c')]){delete _0x395c05[_0xd174('0x49')][_0xd174('0x4c')];}return db['VoiceCallReport'][_0xd174('0x47')]({'where':{'uniqueid':_0x395c05[_0xd174('0x4a')]['id'],'UserId':{'$or':[null,_0x395c05[_0xd174('0x4d')]['id']]}}})[_0xd174('0x23')](handleEntityNotFound(_0x532445,null))[_0xd174('0x23')](saveUpdates(_0x395c05[_0xd174('0x49')],null))[_0xd174('0x23')](respondWithResult(_0x532445,null))['catch'](handleError(_0x532445,null));}; \ No newline at end of file +var _0xc34f=['body','describe','uniqueid','user','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceCallReport','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','sort','where','pick','filter','merge','map','type','VIRTUAL','field','include','fullname','User','findAll','rows','catch','show','params','includeAll','options','find','create'];(function(_0x1e8cba,_0x29a703){var _0x214cfb=function(_0x1fcf30){while(--_0x1fcf30){_0x1e8cba['push'](_0x1e8cba['shift']());}};_0x214cfb(++_0x29a703);}(_0xc34f,0x1cc));var _0xfc34=function(_0x18c86c,_0x3a5dd7){_0x18c86c=_0x18c86c-0x0;var _0x2a3480=_0xc34f[_0x18c86c];return _0x2a3480;};'use strict';var pdf=require(_0xfc34('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc34('0x2'));var rp=require(_0xfc34('0x3'));var moment=require(_0xfc34('0x4'));var BPromise=require(_0xfc34('0x5'));var Mustache=require(_0xfc34('0x6'));var util=require(_0xfc34('0x7'));var path=require(_0xfc34('0x8'));var sox=require(_0xfc34('0x9'));var csv=require(_0xfc34('0xa'));var ejs=require(_0xfc34('0xb'));var fs=require('fs');var _=require(_0xfc34('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc34('0xd'));var toCsv=require(_0xfc34('0xa'));var querystring=require(_0xfc34('0xe'));var Papa=require(_0xfc34('0xf'));var Redis=require(_0xfc34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfc34('0x11'));var hardwareService=require(_0xfc34('0x12'));var logger=require('../../config/logger')(_0xfc34('0x13'));var utils=require(_0xfc34('0x14'));var config=require(_0xfc34('0x15'));var db=require(_0xfc34('0x16'))['db'];function respondWithStatusCode(_0x13d9b9,_0x199d72){_0x199d72=_0x199d72||0xcc;return function(_0x3833eb){if(_0x3833eb){return _0x13d9b9[_0xfc34('0x17')](_0x199d72);}return _0x13d9b9[_0xfc34('0x18')](_0x199d72)['end']();};}function respondWithResult(_0x3da6f7,_0x3d5d54){_0x3d5d54=_0x3d5d54||0xc8;return function(_0x7ed633){if(_0x7ed633){return _0x3da6f7['status'](_0x3d5d54)[_0xfc34('0x19')](_0x7ed633);}};}function respondWithFilteredResult(_0xd62f29,_0x20a883){return function(_0x383742){if(_0x383742){var _0x5bfa38=_0x383742['count'],_0x3a5485=_0x20a883['offset'],_0x45e1ad=_0x20a883[_0xfc34('0x1a')]+_0x20a883[_0xfc34('0x1b')],_0x20e439;if(_0x45e1ad>=_0x5bfa38){_0x45e1ad=_0x5bfa38;_0x20e439=0xc8;}else{_0x20e439=0xce;}_0xd62f29[_0xfc34('0x18')](_0x20e439);return _0xd62f29[_0xfc34('0x1c')](_0xfc34('0x1d'),_0x3a5485+'-'+_0x45e1ad+'/'+_0x5bfa38)[_0xfc34('0x19')](_0x383742);}return null;};}function patchUpdates(_0x1a2585){return function(_0x367fcc){try{jsonpatch[_0xfc34('0x1e')](_0x367fcc,_0x1a2585,!![]);}catch(_0x448b2f){return BPromise[_0xfc34('0x1f')](_0x448b2f);}return _0x367fcc[_0xfc34('0x20')]();};}function saveUpdates(_0x4b7d36,_0x3c7b2b){return function(_0x204c19){if(_0x204c19){return _0x204c19[_0xfc34('0x21')](_0x4b7d36)[_0xfc34('0x22')](function(_0x62864b){return _0x62864b;});}return null;};}function removeEntity(_0x9567d1,_0x5cc938){return function(_0x5156c2){if(_0x5156c2){return _0x5156c2[_0xfc34('0x23')]()['then'](function(){_0x9567d1[_0xfc34('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe9b7,_0x53c408){return function(_0x5ba455){if(!_0x5ba455){_0x4fe9b7[_0xfc34('0x17')](0x194);}return _0x5ba455;};}function handleError(_0x596d10,_0x5d9416){_0x5d9416=_0x5d9416||0x1f4;return function(_0x725b2d){logger[_0xfc34('0x24')](_0x725b2d[_0xfc34('0x25')]);if(_0x725b2d['name']){delete _0x725b2d[_0xfc34('0x26')];}_0x596d10[_0xfc34('0x18')](_0x5d9416)[_0xfc34('0x27')](_0x725b2d);};}exports[_0xfc34('0x28')]=function(_0x55fdfb,_0x5bb557){var _0x3ce554={},_0x7010ef={},_0x19e0ae={'count':0x0,'rows':[]};var _0x1a8f81=db[_0xfc34('0x29')][_0xfc34('0x2a')];_0x7010ef['model']=_[_0xfc34('0x2b')](_0x1a8f81);_0x7010ef[_0xfc34('0x2c')]=_[_0xfc34('0x2b')](_0x55fdfb[_0xfc34('0x2c')]);_0x7010ef[_0xfc34('0x2d')]=_['intersection'](_0x7010ef['model'],_0x7010ef['query']);_0x3ce554[_0xfc34('0x2e')]=_[_0xfc34('0x2f')](_0x7010ef[_0xfc34('0x30')],qs['fields'](_0x55fdfb[_0xfc34('0x2c')][_0xfc34('0x31')]));_0x3ce554[_0xfc34('0x2e')]=_0x3ce554[_0xfc34('0x2e')][_0xfc34('0x32')]?_0x3ce554['attributes']:_0x7010ef[_0xfc34('0x30')];if(!_0x55fdfb[_0xfc34('0x2c')]['hasOwnProperty']('nolimit')){_0x3ce554['limit']=qs[_0xfc34('0x1b')](_0x55fdfb[_0xfc34('0x2c')][_0xfc34('0x1b')]);_0x3ce554[_0xfc34('0x1a')]=qs[_0xfc34('0x1a')](_0x55fdfb['query'][_0xfc34('0x1a')]);}_0x3ce554['order']=qs[_0xfc34('0x33')](_0x55fdfb[_0xfc34('0x2c')][_0xfc34('0x33')]);_0x3ce554[_0xfc34('0x34')]=qs[_0xfc34('0x2d')](_[_0xfc34('0x35')](_0x55fdfb[_0xfc34('0x2c')],_0x7010ef[_0xfc34('0x2d')]));if(_0x55fdfb[_0xfc34('0x2c')][_0xfc34('0x36')]){_0x3ce554[_0xfc34('0x34')]=_[_0xfc34('0x37')](_0x3ce554[_0xfc34('0x34')],{'$or':_[_0xfc34('0x38')](_0x1a8f81,function(_0x5a4403){if(_0x5a4403[_0xfc34('0x39')]['key']!==_0xfc34('0x3a')){var _0x18fcfb={};_0x18fcfb[_0x5a4403[_0xfc34('0x3b')]]={'$like':'%'+_0x55fdfb[_0xfc34('0x2c')][_0xfc34('0x36')]+'%'};return _0x18fcfb;}})});}_0x3ce554=_[_0xfc34('0x37')]({},_0x3ce554,_0x55fdfb['options']);var _0x5ee68e={'where':_0x3ce554[_0xfc34('0x34')]};return db[_0xfc34('0x29')]['count'](_0x5ee68e)[_0xfc34('0x22')](function(_0x1c3e28){_0x19e0ae['count']=_0x1c3e28;if(_0x55fdfb[_0xfc34('0x2c')]['includeAll']){_0x3ce554[_0xfc34('0x3c')]=[{'attributes':['id',_0xfc34('0x26'),_0xfc34('0x3d'),'alias'],'model':db['User'],'as':_0xfc34('0x3e')}];}return db[_0xfc34('0x29')][_0xfc34('0x3f')](_0x3ce554);})[_0xfc34('0x22')](function(_0x37e7e2){_0x19e0ae[_0xfc34('0x40')]=_0x37e7e2;return _0x19e0ae;})['then'](respondWithFilteredResult(_0x5bb557,_0x3ce554))[_0xfc34('0x41')](handleError(_0x5bb557,null));};exports[_0xfc34('0x42')]=function(_0x5436ca,_0x1d6e0f){var _0x2d5587={'raw':!![],'where':{'id':_0x5436ca[_0xfc34('0x43')]['id']}},_0x51dda5={};_0x51dda5[_0xfc34('0x30')]=_['keys'](db[_0xfc34('0x29')][_0xfc34('0x2a')]);_0x51dda5[_0xfc34('0x2c')]=_[_0xfc34('0x2b')](_0x5436ca[_0xfc34('0x2c')]);_0x51dda5['filters']=_[_0xfc34('0x2f')](_0x51dda5[_0xfc34('0x30')],_0x51dda5[_0xfc34('0x2c')]);_0x2d5587[_0xfc34('0x2e')]=_[_0xfc34('0x2f')](_0x51dda5[_0xfc34('0x30')],qs['fields'](_0x5436ca[_0xfc34('0x2c')][_0xfc34('0x31')]));_0x2d5587['attributes']=_0x2d5587[_0xfc34('0x2e')][_0xfc34('0x32')]?_0x2d5587[_0xfc34('0x2e')]:_0x51dda5['model'];if(_0x5436ca['query'][_0xfc34('0x44')]){_0x2d5587[_0xfc34('0x3c')]=[{'all':!![]}];}_0x2d5587=_[_0xfc34('0x37')]({},_0x2d5587,_0x5436ca[_0xfc34('0x45')]);return db['VoiceCallReport'][_0xfc34('0x46')](_0x2d5587)[_0xfc34('0x22')](handleEntityNotFound(_0x1d6e0f,null))['then'](respondWithResult(_0x1d6e0f,null))[_0xfc34('0x41')](handleError(_0x1d6e0f,null));};exports['create']=function(_0x1904f3,_0x33ccd9){return db[_0xfc34('0x29')][_0xfc34('0x47')](_0x1904f3[_0xfc34('0x48')],{})[_0xfc34('0x22')](respondWithResult(_0x33ccd9,0xc9))['catch'](handleError(_0x33ccd9,null));};exports[_0xfc34('0x23')]=function(_0x7ee629,_0x3a0e63){return db[_0xfc34('0x29')][_0xfc34('0x46')]({'where':{'id':_0x7ee629[_0xfc34('0x43')]['id']}})[_0xfc34('0x22')](handleEntityNotFound(_0x3a0e63,null))[_0xfc34('0x22')](removeEntity(_0x3a0e63,null))[_0xfc34('0x41')](handleError(_0x3a0e63,null));};exports[_0xfc34('0x49')]=function(_0x2109c1,_0xcea525){return db[_0xfc34('0x29')]['describe']()[_0xfc34('0x22')](respondWithResult(_0xcea525,null))[_0xfc34('0x41')](handleError(_0xcea525,null));};exports[_0xfc34('0x21')]=function(_0x17822b,_0x57ba78){if(_0x17822b[_0xfc34('0x48')][_0xfc34('0x4a')]){delete _0x17822b[_0xfc34('0x48')][_0xfc34('0x4a')];}return db['VoiceCallReport'][_0xfc34('0x46')]({'where':{'uniqueid':_0x17822b[_0xfc34('0x43')]['id'],'UserId':{'$or':[null,_0x17822b[_0xfc34('0x4b')]['id']]}}})[_0xfc34('0x22')](handleEntityNotFound(_0x57ba78,null))[_0xfc34('0x22')](saveUpdates(_0x17822b[_0xfc34('0x48')],null))[_0xfc34('0x22')](respondWithResult(_0x57ba78,null))['catch'](handleError(_0x57ba78,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index fbaae6f..06347a2 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 _0x3b1a=['define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x16dacd,_0x4d8722){var _0x1f8166=function(_0x539d5a){while(--_0x539d5a){_0x16dacd['push'](_0x16dacd['shift']());}};_0x1f8166(++_0x4d8722);}(_0x3b1a,0x79));var _0xa3b1=function(_0x13b70f,_0x5c1116){_0x13b70f=_0x13b70f-0x0;var _0x51427c=_0x3b1a[_0x13b70f];return _0x51427c;};'use strict';var _=require(_0xa3b1('0x0'));var util=require('util');var logger=require(_0xa3b1('0x1'))('api');var moment=require(_0xa3b1('0x2'));var BPromise=require('bluebird');var rp=require(_0xa3b1('0x3'));var fs=require('fs');var path=require(_0xa3b1('0x4'));var rimraf=require(_0xa3b1('0x5'));var config=require(_0xa3b1('0x6'));var attributes=require(_0xa3b1('0x7'));module[_0xa3b1('0x8')]=function(_0x444be0,_0x18f249){return _0x444be0[_0xa3b1('0x9')](_0xa3b1('0xa'),attributes,{'tableName':_0xa3b1('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa3b1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x697d=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','report_call','uniqueid','lodash','util'];(function(_0x336bc8,_0xb250a5){var _0x5054fb=function(_0x3b7806){while(--_0x3b7806){_0x336bc8['push'](_0x336bc8['shift']());}};_0x5054fb(++_0xb250a5);}(_0x697d,0x195));var _0xd697=function(_0x3284a8,_0x3c1c33){_0x3284a8=_0x3284a8-0x0;var _0x51854b=_0x697d[_0x3284a8];return _0x51854b;};'use strict';var _=require(_0xd697('0x0'));var util=require(_0xd697('0x1'));var logger=require(_0xd697('0x2'))('api');var moment=require(_0xd697('0x3'));var BPromise=require(_0xd697('0x4'));var rp=require(_0xd697('0x5'));var fs=require('fs');var path=require(_0xd697('0x6'));var rimraf=require('rimraf');var config=require(_0xd697('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x13e441,_0x214bb3){return _0x13e441[_0xd697('0x8')]('VoiceCallReport',attributes,{'tableName':_0xd697('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd697('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index db60514..b1a2707 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 _0xcc51=['catch','VoiceCallReport','options','where','attributes','limit','include','model','map','GetVoiceCallReport','stringify','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x24bc80,_0x288946){var _0x29cc74=function(_0x5d136e){while(--_0x5d136e){_0x24bc80['push'](_0x24bc80['shift']());}};_0x29cc74(++_0x288946);}(_0xcc51,0x98));var _0x1cc5=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xcc51[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x1cc5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1cc5('0x1'));var rs=require(_0x1cc5('0x2'));var fs=require('fs');var Redis=require(_0x1cc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cc5('0x4'));var logger=require(_0x1cc5('0x5'))(_0x1cc5('0x6'));var config=require('../../config/environment');var jayson=require(_0x1cc5('0x7'));var client=jayson[_0x1cc5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9b1e,_0x5c2cf3,_0xd2c87f){return new BPromise(function(_0x27dee2,_0x5d1a28){return client['request'](_0x4c9b1e,_0xd2c87f)[_0x1cc5('0x9')](function(_0x3c763d){logger[_0x1cc5('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x5c2cf3,_0x1cc5('0xb'));logger[_0x1cc5('0xc')](_0x1cc5('0xd'),_0x5c2cf3,_0x1cc5('0xb'),JSON['stringify'](_0x3c763d));if(_0x3c763d[_0x1cc5('0xe')]){if(_0x3c763d[_0x1cc5('0xe')][_0x1cc5('0xf')]===0x1f4){logger[_0x1cc5('0xe')](_0x1cc5('0x10'),_0x5c2cf3,_0x3c763d[_0x1cc5('0xe')]['message']);return _0x5d1a28(_0x3c763d['error']['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5c2cf3,_0x3c763d[_0x1cc5('0xe')]['message']);return _0x27dee2(_0x3c763d[_0x1cc5('0xe')][_0x1cc5('0x11')]);}else{logger[_0x1cc5('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x5c2cf3,_0x1cc5('0xb'));_0x27dee2(_0x3c763d['result']['message']);}})[_0x1cc5('0x12')](function(_0x561a66){logger[_0x1cc5('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x5c2cf3,_0x561a66);_0x5d1a28(_0x561a66);});});}exports['GetVoiceCallReport']=function(_0x4c5f97){var _0xd2d766=this;return new Promise(function(_0x3f099a,_0x2bc67a){return db[_0x1cc5('0x13')]['findAll']({'raw':_0x4c5f97[_0x1cc5('0x14')]?_0x4c5f97['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c5f97[_0x1cc5('0x14')]?_0x4c5f97['options'][_0x1cc5('0x15')]||null:null,'attributes':_0x4c5f97['options']?_0x4c5f97['options'][_0x1cc5('0x16')]||null:null,'limit':_0x4c5f97[_0x1cc5('0x14')]?_0x4c5f97[_0x1cc5('0x14')][_0x1cc5('0x17')]||null:null,'include':_0x4c5f97[_0x1cc5('0x14')]?_0x4c5f97[_0x1cc5('0x14')][_0x1cc5('0x18')]?_['map'](_0x4c5f97[_0x1cc5('0x14')][_0x1cc5('0x18')],function(_0x1b25d9){return{'model':db[_0x1b25d9[_0x1cc5('0x19')]],'as':_0x1b25d9['as'],'attributes':_0x1b25d9[_0x1cc5('0x16')],'include':_0x1b25d9[_0x1cc5('0x18')]?_[_0x1cc5('0x1a')](_0x1b25d9[_0x1cc5('0x18')],function(_0x92f672){return{'model':db[_0x92f672['model']],'as':_0x92f672['as'],'attributes':_0x92f672['attributes'],'include':_0x92f672[_0x1cc5('0x18')]?_[_0x1cc5('0x1a')](_0x92f672[_0x1cc5('0x18')],function(_0x4b1aed){return{'model':db[_0x4b1aed[_0x1cc5('0x19')]],'as':_0x4b1aed['as'],'attributes':_0x4b1aed[_0x1cc5('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d7966){logger[_0x1cc5('0xa')](_0x1cc5('0x1b'),_0x4c5f97);logger['debug'](_0x1cc5('0x1b'),_0x4c5f97,JSON[_0x1cc5('0x1c')](_0x5d7966));_0x3f099a(_0x5d7966);})[_0x1cc5('0x12')](function(_0x1f8ace){logger[_0x1cc5('0xe')](_0x1cc5('0x1b'),_0x1f8ace[_0x1cc5('0x11')],_0x4c5f97);_0x2bc67a(_0xd2d766[_0x1cc5('0xe')](0x1f4,_0x1f8ace['message']));});});};exports[_0x1cc5('0x1d')]=function(_0x1ce515){var _0x210779=this;return new Promise(function(_0x1d9c8e,_0x339fdc){return db[_0x1cc5('0x13')][_0x1cc5('0x1e')](_0x1ce515[_0x1cc5('0x1f')],{'raw':_0x1ce515[_0x1cc5('0x14')]?_0x1ce515[_0x1cc5('0x14')][_0x1cc5('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1f632c){logger['info'](_0x1cc5('0x1d'),_0x1ce515);logger[_0x1cc5('0xc')](_0x1cc5('0x1d'),_0x1ce515,JSON[_0x1cc5('0x1c')](_0x1f632c));_0x1d9c8e(_0x1f632c);})[_0x1cc5('0x12')](function(_0x5c0026){logger[_0x1cc5('0xe')](_0x1cc5('0x1d'),_0x5c0026['message'],_0x1ce515);_0x339fdc(_0x210779[_0x1cc5('0xe')](0x1f4,_0x5c0026['message']));});});};exports[_0x1cc5('0x21')]=function(_0x7e7e69){var _0x27f258=this;return new Promise(function(_0x17f1b2,_0x52efe6){return db[_0x1cc5('0x13')]['update'](_0x7e7e69['body'],{'raw':_0x7e7e69['options']?_0x7e7e69[_0x1cc5('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7e7e69[_0x1cc5('0x14')]?_0x7e7e69['options'][_0x1cc5('0x15')]||null:null,'attributes':_0x7e7e69['options']?_0x7e7e69[_0x1cc5('0x14')][_0x1cc5('0x16')]||null:null,'limit':_0x7e7e69['options']?_0x7e7e69['options'][_0x1cc5('0x17')]||null:null})[_0x1cc5('0x9')](function(_0x2aa662){logger['info'](_0x1cc5('0x21'),_0x7e7e69);logger[_0x1cc5('0xc')](_0x1cc5('0x21'),_0x7e7e69,JSON[_0x1cc5('0x1c')](_0x2aa662));_0x17f1b2(_0x2aa662);})[_0x1cc5('0x12')](function(_0x3629fc){logger[_0x1cc5('0xe')]('UpdateVoiceCallReport',_0x3629fc['message'],_0x7e7e69);_0x52efe6(_0x27f258['error'](0x1f4,_0x3629fc[_0x1cc5('0x11')]));});});}; \ No newline at end of file +var _0xc320=['util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','stringify','lodash'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0xc320,0xdd));var _0x0c32=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc320[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x0c32('0x0'));var util=require(_0x0c32('0x1'));var moment=require(_0x0c32('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c32('0x3'));var fs=require('fs');var Redis=require(_0x0c32('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c32('0x5'));var logger=require('../../config/logger')(_0x0c32('0x6'));var config=require(_0x0c32('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c32('0x8')][_0x0c32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569dc7,_0x455319,_0x4cbaf3){return new BPromise(function(_0x4d3f4a,_0x517b3e){return client[_0x0c32('0xa')](_0x569dc7,_0x4cbaf3)[_0x0c32('0xb')](function(_0x2deb57){logger[_0x0c32('0xc')](_0x0c32('0xd'),_0x455319,'request\x20sent');logger[_0x0c32('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x455319,_0x0c32('0xf'),JSON['stringify'](_0x2deb57));if(_0x2deb57[_0x0c32('0x10')]){if(_0x2deb57[_0x0c32('0x10')][_0x0c32('0x11')]===0x1f4){logger[_0x0c32('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x455319,_0x2deb57[_0x0c32('0x10')][_0x0c32('0x12')]);return _0x517b3e(_0x2deb57['error']['message']);}logger[_0x0c32('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x455319,_0x2deb57['error']['message']);return _0x4d3f4a(_0x2deb57[_0x0c32('0x10')]['message']);}else{logger[_0x0c32('0xc')](_0x0c32('0xd'),_0x455319,_0x0c32('0xf'));_0x4d3f4a(_0x2deb57['result'][_0x0c32('0x12')]);}})[_0x0c32('0x13')](function(_0x50661c){logger[_0x0c32('0x10')](_0x0c32('0xd'),_0x455319,_0x50661c);_0x517b3e(_0x50661c);});});}exports[_0x0c32('0x14')]=function(_0x150783){var _0x422a90=this;return new Promise(function(_0x17b95f,_0x48c448){return db[_0x0c32('0x15')][_0x0c32('0x16')]({'raw':_0x150783[_0x0c32('0x17')]?_0x150783[_0x0c32('0x17')][_0x0c32('0x18')]===undefined?!![]:![]:!![],'where':_0x150783[_0x0c32('0x17')]?_0x150783[_0x0c32('0x17')][_0x0c32('0x19')]||null:null,'attributes':_0x150783[_0x0c32('0x17')]?_0x150783[_0x0c32('0x17')][_0x0c32('0x1a')]||null:null,'limit':_0x150783[_0x0c32('0x17')]?_0x150783[_0x0c32('0x17')][_0x0c32('0x1b')]||null:null,'include':_0x150783[_0x0c32('0x17')]?_0x150783[_0x0c32('0x17')][_0x0c32('0x1c')]?_['map'](_0x150783[_0x0c32('0x17')][_0x0c32('0x1c')],function(_0x291759){return{'model':db[_0x291759['model']],'as':_0x291759['as'],'attributes':_0x291759[_0x0c32('0x1a')],'include':_0x291759[_0x0c32('0x1c')]?_[_0x0c32('0x1d')](_0x291759[_0x0c32('0x1c')],function(_0x4bc590){return{'model':db[_0x4bc590[_0x0c32('0x1e')]],'as':_0x4bc590['as'],'attributes':_0x4bc590[_0x0c32('0x1a')],'include':_0x4bc590[_0x0c32('0x1c')]?_['map'](_0x4bc590[_0x0c32('0x1c')],function(_0x12a29c){return{'model':db[_0x12a29c[_0x0c32('0x1e')]],'as':_0x12a29c['as'],'attributes':_0x12a29c[_0x0c32('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0c32('0xb')](function(_0x320fed){logger['info'](_0x0c32('0x14'),_0x150783);logger[_0x0c32('0xe')]('GetVoiceCallReport',_0x150783,JSON['stringify'](_0x320fed));_0x17b95f(_0x320fed);})['catch'](function(_0x259a26){logger['error'](_0x0c32('0x14'),_0x259a26[_0x0c32('0x12')],_0x150783);_0x48c448(_0x422a90[_0x0c32('0x10')](0x1f4,_0x259a26[_0x0c32('0x12')]));});});};exports[_0x0c32('0x1f')]=function(_0x23b3aa){var _0x12b7c6=this;return new Promise(function(_0x3d1c1a,_0x4d1c39){return db[_0x0c32('0x15')][_0x0c32('0x20')](_0x23b3aa[_0x0c32('0x21')],{'raw':_0x23b3aa[_0x0c32('0x17')]?_0x23b3aa[_0x0c32('0x17')][_0x0c32('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x356b47){logger[_0x0c32('0xc')](_0x0c32('0x1f'),_0x23b3aa);logger['debug'](_0x0c32('0x1f'),_0x23b3aa,JSON['stringify'](_0x356b47));_0x3d1c1a(_0x356b47);})[_0x0c32('0x13')](function(_0x3ca0cc){logger[_0x0c32('0x10')](_0x0c32('0x1f'),_0x3ca0cc[_0x0c32('0x12')],_0x23b3aa);_0x4d1c39(_0x12b7c6[_0x0c32('0x10')](0x1f4,_0x3ca0cc[_0x0c32('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x134fb4){var _0x1172fd=this;return new Promise(function(_0x139ee0,_0x3a7fad){return db[_0x0c32('0x15')][_0x0c32('0x22')](_0x134fb4[_0x0c32('0x21')],{'raw':_0x134fb4[_0x0c32('0x17')]?_0x134fb4[_0x0c32('0x17')][_0x0c32('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134fb4[_0x0c32('0x17')]?_0x134fb4['options']['where']||null:null,'attributes':_0x134fb4[_0x0c32('0x17')]?_0x134fb4[_0x0c32('0x17')][_0x0c32('0x1a')]||null:null,'limit':_0x134fb4[_0x0c32('0x17')]?_0x134fb4[_0x0c32('0x17')][_0x0c32('0x1b')]||null:null})['then'](function(_0xc44af7){logger[_0x0c32('0xc')](_0x0c32('0x23'),_0x134fb4);logger['debug'](_0x0c32('0x23'),_0x134fb4,JSON[_0x0c32('0x24')](_0xc44af7));_0x139ee0(_0xc44af7);})[_0x0c32('0x13')](function(_0x4f2ccc){logger['error'](_0x0c32('0x23'),_0x4f2ccc[_0x0c32('0x12')],_0x134fb4);_0x3a7fad(_0x1172fd[_0x0c32('0x10')](0x1f4,_0x4f2ccc[_0x0c32('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d936c24..4ec2b28 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 _0xc369=['isAuthenticated','show','create','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id'];(function(_0x500944,_0xcb4f26){var _0x2ba81a=function(_0x517afb){while(--_0x517afb){_0x500944['push'](_0x500944['shift']());}};_0x2ba81a(++_0xcb4f26);}(_0xc369,0x140));var _0x9c36=function(_0x1a8a11,_0x2fc864){_0x1a8a11=_0x1a8a11-0x0;var _0x41f1e0=_0xc369[_0x1a8a11];return _0x41f1e0;};'use strict';var multer=require(_0x9c36('0x0'));var util=require('util');var path=require(_0x9c36('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c36('0x2'));var router=express[_0x9c36('0x3')]();var auth=require(_0x9c36('0x4'));var interaction=require(_0x9c36('0x5'));var config=require(_0x9c36('0x6'));var controller=require(_0x9c36('0x7'));router[_0x9c36('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9c36('0x8')](_0x9c36('0x9'),auth[_0x9c36('0xa')](),controller[_0x9c36('0xb')]);router['post']('/',auth[_0x9c36('0xa')](),controller[_0x9c36('0xc')]);router['put'](_0x9c36('0x9'),auth[_0x9c36('0xa')](),controller[_0x9c36('0xd')]);router['delete'](_0x9c36('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c36('0xe')]=router; \ No newline at end of file +var _0x9192=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','isAuthenticated','show','create','update','multer','util','path'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x9192,0xf9));var _0x2919=function(_0x576139,_0x4d401d){_0x576139=_0x576139-0x0;var _0x3519cc=_0x9192[_0x576139];return _0x3519cc;};'use strict';var multer=require(_0x2919('0x0'));var util=require(_0x2919('0x1'));var path=require(_0x2919('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2919('0x3')]();var auth=require(_0x2919('0x4'));var interaction=require(_0x2919('0x5'));var config=require(_0x2919('0x6'));var controller=require(_0x2919('0x7'));router[_0x2919('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2919('0x8')](_0x2919('0x9'),auth[_0x2919('0xa')](),controller[_0x2919('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2919('0xc')]);router['put'](_0x2919('0x9'),auth[_0x2919('0xa')](),controller[_0x2919('0xd')]);router['delete'](_0x2919('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 0f55ef5..064217f 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 _0x22a0=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x22a0,0x17b));var _0x022a=function(_0x112489,_0x1049a7){_0x112489=_0x112489-0x0;var _0x3aa08c=_0x22a0[_0x112489];return _0x3aa08c;};'use strict';var Sequelize=require(_0x022a('0x0'));module[_0x022a('0x1')]={'name':{'type':Sequelize[_0x022a('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x022a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x022a('0x2')],'set':function(_0xc22291){this[_0x022a('0x4')](_0x022a('0x5'),_0xc22291?_0xc22291[_0x022a('0x6')](''):[]);},'get':function(){return this[_0x022a('0x7')]('options')?this[_0x022a('0x7')](_0x022a('0x5'))[_0x022a('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x022a('0x2')]},'record':{'type':Sequelize[_0x022a('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x022a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0958=['sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x4cd5a1,_0x46898a){var _0x2f9d36=function(_0x10f62c){while(--_0x10f62c){_0x4cd5a1['push'](_0x4cd5a1['shift']());}};_0x2f9d36(++_0x46898a);}(_0x0958,0x129));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8095('0x0'));module[_0x8095('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8095('0x2')],'unique':_0x8095('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x8095('0x2')],'set':function(_0x1cfa39){this[_0x8095('0x4')](_0x8095('0x5'),_0x1cfa39?_0x1cfa39[_0x8095('0x6')](''):[]);},'get':function(){return this[_0x8095('0x7')]('options')?this['getDataValue'](_0x8095('0x5'))[_0x8095('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x8095('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8095('0x2')]},'description':{'type':Sequelize[_0x8095('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 020fc56..0a209fe 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 _0xcc14=['update','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','ChanSpies','error','name','send','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','type','field','VoiceChanSpy','includeAll','include','findAll','catch','show','params','keys','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1465b3,_0x3c99f2){var _0x5484e4=function(_0x53fbd4){while(--_0x53fbd4){_0x1465b3['push'](_0x1465b3['shift']());}};_0x5484e4(++_0x3c99f2);}(_0xcc14,0x1c4));var _0x4cc1=function(_0x164993,_0xeaec8a){_0x164993=_0x164993-0x0;var _0x4feb96=_0xcc14[_0x164993];return _0x4feb96;};'use strict';var pdf=require(_0x4cc1('0x0'));var emlformat=require(_0x4cc1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4cc1('0x2'));var jsonpatch=require(_0x4cc1('0x3'));var rp=require(_0x4cc1('0x4'));var moment=require(_0x4cc1('0x5'));var BPromise=require(_0x4cc1('0x6'));var Mustache=require(_0x4cc1('0x7'));var util=require(_0x4cc1('0x8'));var path=require(_0x4cc1('0x9'));var sox=require(_0x4cc1('0xa'));var csv=require(_0x4cc1('0xb'));var ejs=require(_0x4cc1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4cc1('0xd'));var jsforce=require(_0x4cc1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4cc1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4cc1('0xf'));var authService=require(_0x4cc1('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4cc1('0x11'));var logger=require(_0x4cc1('0x12'))(_0x4cc1('0x13'));var utils=require('../../config/utils');var config=require(_0x4cc1('0x14'));var db=require(_0x4cc1('0x15'))['db'];function respondWithStatusCode(_0xf76709,_0x39a345){_0x39a345=_0x39a345||0xcc;return function(_0x46bfd0){if(_0x46bfd0){return _0xf76709[_0x4cc1('0x16')](_0x39a345);}return _0xf76709[_0x4cc1('0x17')](_0x39a345)[_0x4cc1('0x18')]();};}function respondWithResult(_0x3dd9d2,_0x2042bc){_0x2042bc=_0x2042bc||0xc8;return function(_0x550cfb){if(_0x550cfb){return _0x3dd9d2[_0x4cc1('0x17')](_0x2042bc)['json'](_0x550cfb);}};}function respondWithFilteredResult(_0x70fc23,_0x40c1fb){return function(_0xc7f300){if(_0xc7f300){var _0x293178=_0xc7f300[_0x4cc1('0x19')],_0x37a763=_0x40c1fb['offset'],_0x26f70c=_0x40c1fb[_0x4cc1('0x1a')]+_0x40c1fb[_0x4cc1('0x1b')],_0x415b3e;if(_0x26f70c>=_0x293178){_0x26f70c=_0x293178;_0x415b3e=0xc8;}else{_0x415b3e=0xce;}_0x70fc23['status'](_0x415b3e);return _0x70fc23[_0x4cc1('0x1c')](_0x4cc1('0x1d'),_0x37a763+'-'+_0x26f70c+'/'+_0x293178)['json'](_0xc7f300);}return null;};}function patchUpdates(_0x58e52a){return function(_0x1bb4bd){try{jsonpatch['apply'](_0x1bb4bd,_0x58e52a,!![]);}catch(_0x25ef24){return BPromise[_0x4cc1('0x1e')](_0x25ef24);}return _0x1bb4bd[_0x4cc1('0x1f')]();};}function saveUpdates(_0x3fa1a2,_0x2f211d){return function(_0x2e233c){if(_0x2e233c){return _0x2e233c['update'](_0x3fa1a2)[_0x4cc1('0x20')](function(_0x4babff){return _0x4babff;});}return null;};}function removeEntity(_0xdf5795,_0x400839){return function(_0x9f57bb){if(_0x9f57bb){return _0x9f57bb[_0x4cc1('0x21')]()['then'](function(){var _0x50d3e3=_0x9f57bb[_0x4cc1('0x22')]({'plain':!![]});var _0x5699e0=_0x4cc1('0x23');return db['UserProfileResource'][_0x4cc1('0x21')]({'where':{'type':_0x5699e0,'resourceId':_0x50d3e3['id']}})[_0x4cc1('0x20')](function(){return _0x9f57bb;});})[_0x4cc1('0x20')](function(){_0xdf5795[_0x4cc1('0x17')](0xcc)[_0x4cc1('0x18')]();});}};}function handleEntityNotFound(_0x1954eb,_0x2aa5a7){return function(_0x4d6c95){if(!_0x4d6c95){_0x1954eb[_0x4cc1('0x16')](0x194);}return _0x4d6c95;};}function handleError(_0x4bd1c9,_0x285e2f){_0x285e2f=_0x285e2f||0x1f4;return function(_0x13befd){logger[_0x4cc1('0x24')](_0x13befd['stack']);if(_0x13befd[_0x4cc1('0x25')]){delete _0x13befd['name'];}_0x4bd1c9['status'](_0x285e2f)[_0x4cc1('0x26')](_0x13befd);};}exports['index']=function(_0x57e7d8,_0x46057c){var _0x3b27b1={},_0x1a192b={},_0x5a2bef={'count':0x0,'rows':[]};var _0x382563=db['VoiceChanSpy']['rawAttributes'];_0x1a192b['model']=_['keys'](_0x382563);_0x1a192b[_0x4cc1('0x27')]=_['keys'](_0x57e7d8[_0x4cc1('0x27')]);_0x1a192b[_0x4cc1('0x28')]=_['intersection'](_0x1a192b[_0x4cc1('0x29')],_0x1a192b[_0x4cc1('0x27')]);_0x3b27b1[_0x4cc1('0x2a')]=_[_0x4cc1('0x2b')](_0x1a192b[_0x4cc1('0x29')],qs[_0x4cc1('0x2c')](_0x57e7d8['query']['fields']));_0x3b27b1[_0x4cc1('0x2a')]=_0x3b27b1[_0x4cc1('0x2a')][_0x4cc1('0x2d')]?_0x3b27b1[_0x4cc1('0x2a')]:_0x1a192b[_0x4cc1('0x29')];if(!_0x57e7d8[_0x4cc1('0x27')]['hasOwnProperty'](_0x4cc1('0x2e'))){_0x3b27b1[_0x4cc1('0x1b')]=qs['limit'](_0x57e7d8[_0x4cc1('0x27')]['limit']);_0x3b27b1[_0x4cc1('0x1a')]=qs['offset'](_0x57e7d8[_0x4cc1('0x27')]['offset']);}_0x3b27b1['order']=qs['sort'](_0x57e7d8[_0x4cc1('0x27')][_0x4cc1('0x2f')]);_0x3b27b1[_0x4cc1('0x30')]=qs['filters'](_[_0x4cc1('0x31')](_0x57e7d8[_0x4cc1('0x27')],_0x1a192b['filters']));if(_0x57e7d8[_0x4cc1('0x27')][_0x4cc1('0x32')]){_0x3b27b1[_0x4cc1('0x30')]=_[_0x4cc1('0x33')](_0x3b27b1[_0x4cc1('0x30')],{'$or':_['map'](_0x382563,function(_0x3b7382){if(_0x3b7382[_0x4cc1('0x34')]['key']!=='VIRTUAL'){var _0xdf67d2={};_0xdf67d2[_0x3b7382[_0x4cc1('0x35')]]={'$like':'%'+_0x57e7d8['query'][_0x4cc1('0x32')]+'%'};return _0xdf67d2;}})});}_0x3b27b1=_[_0x4cc1('0x33')]({},_0x3b27b1,_0x57e7d8['options']);var _0xb5ffcb={'where':_0x3b27b1[_0x4cc1('0x30')]};return db[_0x4cc1('0x36')][_0x4cc1('0x19')](_0xb5ffcb)[_0x4cc1('0x20')](function(_0x158b99){_0x5a2bef['count']=_0x158b99;if(_0x57e7d8[_0x4cc1('0x27')][_0x4cc1('0x37')]){_0x3b27b1[_0x4cc1('0x38')]=[{'all':!![]}];}return db[_0x4cc1('0x36')][_0x4cc1('0x39')](_0x3b27b1);})[_0x4cc1('0x20')](function(_0x3e9296){_0x5a2bef['rows']=_0x3e9296;return _0x5a2bef;})[_0x4cc1('0x20')](respondWithFilteredResult(_0x46057c,_0x3b27b1))[_0x4cc1('0x3a')](handleError(_0x46057c,null));};exports[_0x4cc1('0x3b')]=function(_0x3e45d1,_0x4daeb7){var _0x24f854={'raw':![],'where':{'id':_0x3e45d1[_0x4cc1('0x3c')]['id']}},_0x430c04={};_0x430c04[_0x4cc1('0x29')]=_[_0x4cc1('0x3d')](db[_0x4cc1('0x36')][_0x4cc1('0x3e')]);_0x430c04['query']=_['keys'](_0x3e45d1[_0x4cc1('0x27')]);_0x430c04['filters']=_['intersection'](_0x430c04[_0x4cc1('0x29')],_0x430c04[_0x4cc1('0x27')]);_0x24f854['attributes']=_[_0x4cc1('0x2b')](_0x430c04[_0x4cc1('0x29')],qs[_0x4cc1('0x2c')](_0x3e45d1[_0x4cc1('0x27')]['fields']));_0x24f854[_0x4cc1('0x2a')]=_0x24f854['attributes'][_0x4cc1('0x2d')]?_0x24f854['attributes']:_0x430c04['model'];if(_0x3e45d1[_0x4cc1('0x27')][_0x4cc1('0x37')]){_0x24f854['include']=[{'all':!![]}];}_0x24f854=_[_0x4cc1('0x33')]({},_0x24f854,_0x3e45d1[_0x4cc1('0x3f')]);return db['VoiceChanSpy']['find'](_0x24f854)[_0x4cc1('0x20')](handleEntityNotFound(_0x4daeb7,null))['then'](respondWithResult(_0x4daeb7,null))[_0x4cc1('0x3a')](handleError(_0x4daeb7,null));};exports[_0x4cc1('0x40')]=function(_0xedfa97,_0x52c76b){return db[_0x4cc1('0x36')]['create'](_0xedfa97[_0x4cc1('0x41')],{})[_0x4cc1('0x20')](function(_0x4f46be){var _0x4c3131=_0xedfa97['user'][_0x4cc1('0x22')]({'plain':!![]});if(!_0x4c3131)throw new Error(_0x4cc1('0x42'));if(_0x4c3131[_0x4cc1('0x43')]===_0x4cc1('0x44')){var _0x485f40=_0x4f46be[_0x4cc1('0x22')]({'plain':!![]});var _0x1e26de=_0x4cc1('0x23');return db[_0x4cc1('0x45')]['find']({'where':{'name':_0x1e26de,'userProfileId':_0x4c3131['userProfileId']},'raw':!![]})[_0x4cc1('0x20')](function(_0x3d1c8f){if(_0x3d1c8f&&_0x3d1c8f[_0x4cc1('0x46')]===0x0){return db[_0x4cc1('0x47')][_0x4cc1('0x40')]({'name':_0x485f40[_0x4cc1('0x25')],'resourceId':_0x485f40['id'],'type':_0x3d1c8f[_0x4cc1('0x25')],'sectionId':_0x3d1c8f['id']},{})[_0x4cc1('0x20')](function(){return _0x4f46be;});}else{return _0x4f46be;}})[_0x4cc1('0x3a')](function(_0x4f236f){logger[_0x4cc1('0x24')](_0x4cc1('0x48'),_0x4f236f);throw _0x4f236f;});}return _0x4f46be;})[_0x4cc1('0x20')](respondWithResult(_0x52c76b,0xc9))[_0x4cc1('0x3a')](handleError(_0x52c76b,null));};exports[_0x4cc1('0x49')]=function(_0x2f759b,_0x33b4d6){if(_0x2f759b[_0x4cc1('0x41')]['id']){delete _0x2f759b['body']['id'];}return db['VoiceChanSpy'][_0x4cc1('0x4a')]({'where':{'id':_0x2f759b[_0x4cc1('0x3c')]['id']}})[_0x4cc1('0x20')](handleEntityNotFound(_0x33b4d6,null))[_0x4cc1('0x20')](saveUpdates(_0x2f759b['body'],null))['then'](respondWithResult(_0x33b4d6,null))[_0x4cc1('0x3a')](handleError(_0x33b4d6,null));};exports[_0x4cc1('0x21')]=function(_0x2792ee,_0xe7c78c){return db[_0x4cc1('0x36')][_0x4cc1('0x4a')]({'where':{'id':_0x2792ee[_0x4cc1('0x3c')]['id']}})[_0x4cc1('0x20')](handleEntityNotFound(_0xe7c78c,null))[_0x4cc1('0x20')](removeEntity(_0xe7c78c,null))[_0x4cc1('0x3a')](handleError(_0xe7c78c,null));}; \ No newline at end of file +var _0x8ac3=['UserProfileResource','destroy','then','error','name','send','index','VoiceChanSpy','rawAttributes','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','rows','catch','show','params','keys','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','save','update','get'];(function(_0x3f40e0,_0x556dab){var _0x506afa=function(_0x306d09){while(--_0x306d09){_0x3f40e0['push'](_0x3f40e0['shift']());}};_0x506afa(++_0x556dab);}(_0x8ac3,0x1ce));var _0x38ac=function(_0x443b72,_0x5003f4){_0x443b72=_0x443b72-0x0;var _0x5664ea=_0x8ac3[_0x443b72];return _0x5664ea;};'use strict';var pdf=require(_0x38ac('0x0'));var emlformat=require(_0x38ac('0x1'));var rimraf=require(_0x38ac('0x2'));var zipdir=require(_0x38ac('0x3'));var jsonpatch=require(_0x38ac('0x4'));var rp=require('request-promise');var moment=require(_0x38ac('0x5'));var BPromise=require(_0x38ac('0x6'));var Mustache=require(_0x38ac('0x7'));var util=require(_0x38ac('0x8'));var path=require(_0x38ac('0x9'));var sox=require(_0x38ac('0xa'));var csv=require(_0x38ac('0xb'));var ejs=require(_0x38ac('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x38ac('0xd'));var crypto=require('crypto');var jsforce=require(_0x38ac('0xe'));var deskjs=require(_0x38ac('0xf'));var toCsv=require(_0x38ac('0xb'));var querystring=require(_0x38ac('0x10'));var Papa=require(_0x38ac('0x11'));var Redis=require(_0x38ac('0x12'));var authService=require(_0x38ac('0x13'));var qs=require(_0x38ac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38ac('0x15'))(_0x38ac('0x16'));var utils=require('../../config/utils');var config=require(_0x38ac('0x17'));var db=require(_0x38ac('0x18'))['db'];function respondWithStatusCode(_0x5830b7,_0x3783d7){_0x3783d7=_0x3783d7||0xcc;return function(_0x263e0d){if(_0x263e0d){return _0x5830b7[_0x38ac('0x19')](_0x3783d7);}return _0x5830b7[_0x38ac('0x1a')](_0x3783d7)[_0x38ac('0x1b')]();};}function respondWithResult(_0x4a6873,_0x192939){_0x192939=_0x192939||0xc8;return function(_0x13de01){if(_0x13de01){return _0x4a6873[_0x38ac('0x1a')](_0x192939)['json'](_0x13de01);}};}function respondWithFilteredResult(_0x43a259,_0x337aaf){return function(_0x163bd9){if(_0x163bd9){var _0x499552=_0x163bd9[_0x38ac('0x1c')],_0x270f55=_0x337aaf[_0x38ac('0x1d')],_0x4e537d=_0x337aaf['offset']+_0x337aaf[_0x38ac('0x1e')],_0x46cff4;if(_0x4e537d>=_0x499552){_0x4e537d=_0x499552;_0x46cff4=0xc8;}else{_0x46cff4=0xce;}_0x43a259[_0x38ac('0x1a')](_0x46cff4);return _0x43a259['set'](_0x38ac('0x1f'),_0x270f55+'-'+_0x4e537d+'/'+_0x499552)[_0x38ac('0x20')](_0x163bd9);}return null;};}function patchUpdates(_0x19624b){return function(_0x22c2c6){try{jsonpatch['apply'](_0x22c2c6,_0x19624b,!![]);}catch(_0x2b3df5){return BPromise['reject'](_0x2b3df5);}return _0x22c2c6[_0x38ac('0x21')]();};}function saveUpdates(_0x1d071e,_0x3ad410){return function(_0x144cd){if(_0x144cd){return _0x144cd[_0x38ac('0x22')](_0x1d071e)['then'](function(_0x402f03){return _0x402f03;});}return null;};}function removeEntity(_0x542952,_0x11ddb5){return function(_0x9629f8){if(_0x9629f8){return _0x9629f8['destroy']()['then'](function(){var _0x5273e9=_0x9629f8[_0x38ac('0x23')]({'plain':!![]});var _0xa8ef80='ChanSpies';return db[_0x38ac('0x24')][_0x38ac('0x25')]({'where':{'type':_0xa8ef80,'resourceId':_0x5273e9['id']}})[_0x38ac('0x26')](function(){return _0x9629f8;});})[_0x38ac('0x26')](function(){_0x542952['status'](0xcc)[_0x38ac('0x1b')]();});}};}function handleEntityNotFound(_0x205a44,_0x1540d1){return function(_0x380d13){if(!_0x380d13){_0x205a44[_0x38ac('0x19')](0x194);}return _0x380d13;};}function handleError(_0x3895a5,_0x1d8088){_0x1d8088=_0x1d8088||0x1f4;return function(_0x544a4e){logger[_0x38ac('0x27')](_0x544a4e['stack']);if(_0x544a4e[_0x38ac('0x28')]){delete _0x544a4e[_0x38ac('0x28')];}_0x3895a5[_0x38ac('0x1a')](_0x1d8088)[_0x38ac('0x29')](_0x544a4e);};}exports[_0x38ac('0x2a')]=function(_0x2daab1,_0x4f600a){var _0x4f36d5={},_0x1f1a52={},_0xa8a180={'count':0x0,'rows':[]};var _0x30c105=db[_0x38ac('0x2b')][_0x38ac('0x2c')];_0x1f1a52['model']=_['keys'](_0x30c105);_0x1f1a52[_0x38ac('0x2d')]=_['keys'](_0x2daab1[_0x38ac('0x2d')]);_0x1f1a52[_0x38ac('0x2e')]=_[_0x38ac('0x2f')](_0x1f1a52['model'],_0x1f1a52[_0x38ac('0x2d')]);_0x4f36d5[_0x38ac('0x30')]=_[_0x38ac('0x2f')](_0x1f1a52[_0x38ac('0x31')],qs[_0x38ac('0x32')](_0x2daab1[_0x38ac('0x2d')][_0x38ac('0x32')]));_0x4f36d5[_0x38ac('0x30')]=_0x4f36d5[_0x38ac('0x30')][_0x38ac('0x33')]?_0x4f36d5[_0x38ac('0x30')]:_0x1f1a52[_0x38ac('0x31')];if(!_0x2daab1['query'][_0x38ac('0x34')](_0x38ac('0x35'))){_0x4f36d5[_0x38ac('0x1e')]=qs[_0x38ac('0x1e')](_0x2daab1[_0x38ac('0x2d')][_0x38ac('0x1e')]);_0x4f36d5[_0x38ac('0x1d')]=qs[_0x38ac('0x1d')](_0x2daab1[_0x38ac('0x2d')][_0x38ac('0x1d')]);}_0x4f36d5[_0x38ac('0x36')]=qs[_0x38ac('0x37')](_0x2daab1[_0x38ac('0x2d')][_0x38ac('0x37')]);_0x4f36d5[_0x38ac('0x38')]=qs[_0x38ac('0x2e')](_[_0x38ac('0x39')](_0x2daab1['query'],_0x1f1a52[_0x38ac('0x2e')]));if(_0x2daab1[_0x38ac('0x2d')]['filter']){_0x4f36d5[_0x38ac('0x38')]=_[_0x38ac('0x3a')](_0x4f36d5['where'],{'$or':_[_0x38ac('0x3b')](_0x30c105,function(_0xc677b8){if(_0xc677b8[_0x38ac('0x3c')][_0x38ac('0x3d')]!==_0x38ac('0x3e')){var _0x45e037={};_0x45e037[_0xc677b8[_0x38ac('0x3f')]]={'$like':'%'+_0x2daab1[_0x38ac('0x2d')][_0x38ac('0x40')]+'%'};return _0x45e037;}})});}_0x4f36d5=_['merge']({},_0x4f36d5,_0x2daab1[_0x38ac('0x41')]);var _0x291c06={'where':_0x4f36d5[_0x38ac('0x38')]};return db[_0x38ac('0x2b')]['count'](_0x291c06)[_0x38ac('0x26')](function(_0x13331c){_0xa8a180[_0x38ac('0x1c')]=_0x13331c;if(_0x2daab1[_0x38ac('0x2d')]['includeAll']){_0x4f36d5['include']=[{'all':!![]}];}return db[_0x38ac('0x2b')]['findAll'](_0x4f36d5);})[_0x38ac('0x26')](function(_0x5cd1d7){_0xa8a180[_0x38ac('0x42')]=_0x5cd1d7;return _0xa8a180;})[_0x38ac('0x26')](respondWithFilteredResult(_0x4f600a,_0x4f36d5))[_0x38ac('0x43')](handleError(_0x4f600a,null));};exports[_0x38ac('0x44')]=function(_0x191c9a,_0x48d93c){var _0x325918={'raw':![],'where':{'id':_0x191c9a[_0x38ac('0x45')]['id']}},_0x5774c9={};_0x5774c9[_0x38ac('0x31')]=_['keys'](db[_0x38ac('0x2b')][_0x38ac('0x2c')]);_0x5774c9['query']=_[_0x38ac('0x46')](_0x191c9a[_0x38ac('0x2d')]);_0x5774c9[_0x38ac('0x2e')]=_[_0x38ac('0x2f')](_0x5774c9[_0x38ac('0x31')],_0x5774c9[_0x38ac('0x2d')]);_0x325918[_0x38ac('0x30')]=_[_0x38ac('0x2f')](_0x5774c9['model'],qs[_0x38ac('0x32')](_0x191c9a['query'][_0x38ac('0x32')]));_0x325918[_0x38ac('0x30')]=_0x325918[_0x38ac('0x30')][_0x38ac('0x33')]?_0x325918['attributes']:_0x5774c9[_0x38ac('0x31')];if(_0x191c9a['query'][_0x38ac('0x47')]){_0x325918[_0x38ac('0x48')]=[{'all':!![]}];}_0x325918=_[_0x38ac('0x3a')]({},_0x325918,_0x191c9a[_0x38ac('0x41')]);return db['VoiceChanSpy'][_0x38ac('0x49')](_0x325918)[_0x38ac('0x26')](handleEntityNotFound(_0x48d93c,null))[_0x38ac('0x26')](respondWithResult(_0x48d93c,null))[_0x38ac('0x43')](handleError(_0x48d93c,null));};exports['create']=function(_0x104cb9,_0x2d04c7){return db[_0x38ac('0x2b')][_0x38ac('0x4a')](_0x104cb9[_0x38ac('0x4b')],{})[_0x38ac('0x26')](function(_0x427061){var _0x118b27=_0x104cb9['user'][_0x38ac('0x23')]({'plain':!![]});if(!_0x118b27)throw new Error(_0x38ac('0x4c'));if(_0x118b27['role']===_0x38ac('0x4d')){var _0x1db290=_0x427061[_0x38ac('0x23')]({'plain':!![]});var _0x42402e=_0x38ac('0x4e');return db[_0x38ac('0x4f')][_0x38ac('0x49')]({'where':{'name':_0x42402e,'userProfileId':_0x118b27[_0x38ac('0x50')]},'raw':!![]})[_0x38ac('0x26')](function(_0x39d68e){if(_0x39d68e&&_0x39d68e[_0x38ac('0x51')]===0x0){return db[_0x38ac('0x24')]['create']({'name':_0x1db290[_0x38ac('0x28')],'resourceId':_0x1db290['id'],'type':_0x39d68e['name'],'sectionId':_0x39d68e['id']},{})[_0x38ac('0x26')](function(){return _0x427061;});}else{return _0x427061;}})[_0x38ac('0x43')](function(_0x55c5ea){logger[_0x38ac('0x27')](_0x38ac('0x52'),_0x55c5ea);throw _0x55c5ea;});}return _0x427061;})[_0x38ac('0x26')](respondWithResult(_0x2d04c7,0xc9))[_0x38ac('0x43')](handleError(_0x2d04c7,null));};exports[_0x38ac('0x22')]=function(_0x5e871b,_0x309278){if(_0x5e871b[_0x38ac('0x4b')]['id']){delete _0x5e871b[_0x38ac('0x4b')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x5e871b[_0x38ac('0x45')]['id']}})[_0x38ac('0x26')](handleEntityNotFound(_0x309278,null))['then'](saveUpdates(_0x5e871b[_0x38ac('0x4b')],null))[_0x38ac('0x26')](respondWithResult(_0x309278,null))[_0x38ac('0x43')](handleError(_0x309278,null));};exports[_0x38ac('0x25')]=function(_0x191f47,_0x9d2a11){return db[_0x38ac('0x2b')][_0x38ac('0x49')]({'where':{'id':_0x191f47[_0x38ac('0x45')]['id']}})['then'](handleEntityNotFound(_0x9d2a11,null))[_0x38ac('0x26')](removeEntity(_0x9d2a11,null))[_0x38ac('0x43')](handleError(_0x9d2a11,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c02dc77..86936c2 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 _0xbcbe=['chanspy','record','merge','MixMonitor','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','system','push','Set','CDR(type)=%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));var BPromise=require(_0xebcb('0x2'));var attributes=require(_0xebcb('0x3'));var getUserApplications=function(_0x40b2ad,_0x9f1e7,_0x48a20a){var _0x508cb8=0x1;var _0x1d11cc=[];var _0x287f02={'context':_0x9f1e7['context']||'from-sip','exten':util[_0xebcb('0x4')](_0xebcb('0x5'),_0x40b2ad[_0xebcb('0x6')],_0x48a20a),'type':_0xebcb('0x7'),'isApp':![],'ChanSpyId':_0x40b2ad['id'],'UserId':_0x9f1e7['id']};_0x1d11cc[_0xebcb('0x8')](_['merge']({'app':_0xebcb('0x9'),'appdata':util[_0xebcb('0x4')](_0xebcb('0xa'),_0xebcb('0xb')),'priority':_0x508cb8++},_0x287f02));if(_0x40b2ad[_0xebcb('0xc')]){_0x1d11cc[_0xebcb('0x8')](_[_0xebcb('0xd')]({'app':_0xebcb('0xe'),'appdata':util[_0xebcb('0x4')]('${UNIQUEID}.%s,ab',_0x40b2ad[_0xebcb('0xf')]),'priority':_0x508cb8++},_0x287f02));}if(_0x40b2ad['auth']){_0x1d11cc[_0xebcb('0x8')](_[_0xebcb('0xd')]({'app':'Authenticate','appdata':_0x40b2ad[_0xebcb('0x10')],'priority':_0x508cb8++},_0x287f02));}_0x1d11cc[_0xebcb('0x8')](_['merge']({'app':_0xebcb('0x11'),'appdata':util[_0xebcb('0x4')](_0xebcb('0x12'),_0x9f1e7[_0xebcb('0x13')],_0x40b2ad[_0xebcb('0x14')]?_0x40b2ad[_0xebcb('0x14')][_0xebcb('0x15')](''):''),'priority':_0x508cb8++},_0x287f02));if(_0x40b2ad[_0xebcb('0xc')]){_0x1d11cc[_0xebcb('0x8')](_[_0xebcb('0xd')]({'app':_0xebcb('0x16'),'priority':_0x508cb8++},_0x287f02));}return _0x1d11cc;};var getChanSpyApplications=function(_0x180158,_0xbacc6c){var _0x3f3ccb=[];for(var _0x287292=0x0,_0x2e9761=0x1;_0x287292<_0xbacc6c['length'];_0x287292++,_0x2e9761=0x1){_0x3f3ccb=_0x3f3ccb[_0xebcb('0x17')](getUserApplications(_0x180158,_0xbacc6c[_0x287292],_0xbacc6c[_0x287292][_0xebcb('0x18')]));if(_0xbacc6c[_0x287292][_0xebcb('0x18')]!=_0xbacc6c[_0x287292]['name']){_0x3f3ccb=_0x3f3ccb[_0xebcb('0x17')](getUserApplications(_0x180158,_0xbacc6c[_0x287292],_0xbacc6c[_0x287292][_0xebcb('0x13')]));}}return _0x3f3ccb;};var getChanSpyPromise=function(_0x45b3cb,_0x2046e8){return new BPromise(function(_0x1e7e92,_0x3b5e00){return _0x45b3cb[_0xebcb('0x19')][_0xebcb('0x1a')]({'attributes':['id',_0xebcb('0x13'),_0xebcb('0x18')],'where':{'role':_0xebcb('0x1b'),'chanspy':!![]},'raw':!![]})[_0xebcb('0x1c')](function(_0x18b3d6){if(_0x18b3d6){return _0x1e7e92(getChanSpyApplications(_0x2046e8,_0x18b3d6));}return _0x1e7e92([]);})[_0xebcb('0x1d')](function(_0x2a229d){_0x3b5e00(_0x2a229d);});});};module[_0xebcb('0x1e')]=function(_0x52951b,_0x253bd0){var _0x2f81e4=_0x52951b[_0xebcb('0x1f')];return _0x52951b['define'](_0xebcb('0x20'),attributes,{'tableName':_0xebcb('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x247738,_0x2f92a3,_0xcd0dac){return getChanSpyPromise(_0x2f81e4,_0x247738)[_0xebcb('0x1c')](function(_0x3804dd){if(_0x3804dd&&_0x3804dd[_0xebcb('0x22')]){return _0x2f81e4[_0xebcb('0x23')]['bulkCreate'](_0x3804dd);}})[_0xebcb('0x1c')](function(){_0xcd0dac();})['catch'](function(_0xd84aad){_0xcd0dac(_0xd84aad);});},'afterUpdate':function(_0x133b8f,_0x4bad3c,_0x2a8ef8){return _0x2f81e4[_0xebcb('0x23')][_0xebcb('0x24')]({'where':{'ChanSpyId':_0x133b8f['id']}})[_0xebcb('0x1c')](function(){return getChanSpyPromise(_0x2f81e4,_0x133b8f);})[_0xebcb('0x1c')](function(_0x4e835c){if(_0x4e835c&&_0x4e835c[_0xebcb('0x22')]){return _0x2f81e4[_0xebcb('0x23')][_0xebcb('0x25')](_0x4e835c);}})[_0xebcb('0x1c')](function(){_0x2a8ef8();})[_0xebcb('0x1d')](function(_0x1d351f){_0x2a8ef8(_0x1d351f);});},'afterDestroy':function(_0x426d15,_0x15356b,_0x1a2707){return _0x2f81e4[_0xebcb('0x23')]['destroy']({'where':{'ChanSpyId':_0x426d15['id']}})[_0xebcb('0x1c')](function(){_0x1a2707();})['catch'](function(_0x29e73e){_0x1a2707(_0x29e73e);});}}});}; \ No newline at end of file +var _0x9649=['length','concat','internal','User','findAll','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','merge','password','ChanSpy','name','options','join','StopMixMonitor'];(function(_0x15ab76,_0x86ca10){var _0x3a7d17=function(_0x26f3a6){while(--_0x26f3a6){_0x15ab76['push'](_0x15ab76['shift']());}};_0x3a7d17(++_0x86ca10);}(_0x9649,0x19f));var _0x9964=function(_0x33974e,_0x424f44){_0x33974e=_0x33974e-0x0;var _0x15bb18=_0x9649[_0x33974e];return _0x15bb18;};'use strict';var _=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var BPromise=require(_0x9964('0x2'));var attributes=require(_0x9964('0x3'));var getUserApplications=function(_0x5e1430,_0x457627,_0x644029){var _0x48790a=0x1;var _0x18402a=[];var _0x4b5a66={'context':_0x457627[_0x9964('0x4')]||_0x9964('0x5'),'exten':util[_0x9964('0x6')](_0x9964('0x7'),_0x5e1430[_0x9964('0x8')],_0x644029),'type':_0x9964('0x9'),'isApp':![],'ChanSpyId':_0x5e1430['id'],'UserId':_0x457627['id']};_0x18402a[_0x9964('0xa')](_['merge']({'app':_0x9964('0xb'),'appdata':util[_0x9964('0x6')]('CDR(type)=%s',_0x9964('0xc')),'priority':_0x48790a++},_0x4b5a66));if(_0x5e1430[_0x9964('0xd')]){_0x18402a['push'](_['merge']({'app':_0x9964('0xe'),'appdata':util[_0x9964('0x6')](_0x9964('0xf'),_0x5e1430[_0x9964('0x10')]),'priority':_0x48790a++},_0x4b5a66));}if(_0x5e1430[_0x9964('0x11')]){_0x18402a['push'](_[_0x9964('0x12')]({'app':'Authenticate','appdata':_0x5e1430[_0x9964('0x13')],'priority':_0x48790a++},_0x4b5a66));}_0x18402a[_0x9964('0xa')](_['merge']({'app':_0x9964('0x14'),'appdata':util[_0x9964('0x6')]('SIP/%s,%s',_0x457627[_0x9964('0x15')],_0x5e1430[_0x9964('0x16')]?_0x5e1430[_0x9964('0x16')][_0x9964('0x17')](''):''),'priority':_0x48790a++},_0x4b5a66));if(_0x5e1430[_0x9964('0xd')]){_0x18402a['push'](_[_0x9964('0x12')]({'app':_0x9964('0x18'),'priority':_0x48790a++},_0x4b5a66));}return _0x18402a;};var getChanSpyApplications=function(_0x57b330,_0x2fd50d){var _0x3fe796=[];for(var _0x57fe55=0x0,_0x40178=0x1;_0x57fe55<_0x2fd50d[_0x9964('0x19')];_0x57fe55++,_0x40178=0x1){_0x3fe796=_0x3fe796[_0x9964('0x1a')](getUserApplications(_0x57b330,_0x2fd50d[_0x57fe55],_0x2fd50d[_0x57fe55][_0x9964('0x1b')]));if(_0x2fd50d[_0x57fe55]['internal']!=_0x2fd50d[_0x57fe55][_0x9964('0x15')]){_0x3fe796=_0x3fe796[_0x9964('0x1a')](getUserApplications(_0x57b330,_0x2fd50d[_0x57fe55],_0x2fd50d[_0x57fe55]['name']));}}return _0x3fe796;};var getChanSpyPromise=function(_0x2eb3a8,_0x3f6472){return new BPromise(function(_0x25ab32,_0x1477b5){return _0x2eb3a8[_0x9964('0x1c')][_0x9964('0x1d')]({'attributes':['id',_0x9964('0x15'),_0x9964('0x1b')],'where':{'role':_0x9964('0x1e'),'chanspy':!![]},'raw':!![]})[_0x9964('0x1f')](function(_0x4f625e){if(_0x4f625e){return _0x25ab32(getChanSpyApplications(_0x3f6472,_0x4f625e));}return _0x25ab32([]);})[_0x9964('0x20')](function(_0x447026){_0x1477b5(_0x447026);});});};module['exports']=function(_0x2b03a8,_0x47912c){var _0x242e0a=_0x2b03a8[_0x9964('0x21')];return _0x2b03a8[_0x9964('0x22')](_0x9964('0x23'),attributes,{'tableName':_0x9964('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x62eda6,_0x5f30e8,_0x452c96){return getChanSpyPromise(_0x242e0a,_0x62eda6)[_0x9964('0x1f')](function(_0x5961e9){if(_0x5961e9&&_0x5961e9[_0x9964('0x19')]){return _0x242e0a[_0x9964('0x25')][_0x9964('0x26')](_0x5961e9);}})[_0x9964('0x1f')](function(){_0x452c96();})[_0x9964('0x20')](function(_0x5a5793){_0x452c96(_0x5a5793);});},'afterUpdate':function(_0x13df3d,_0x4c2b44,_0x44cb60){return _0x242e0a['VoiceExtension'][_0x9964('0x27')]({'where':{'ChanSpyId':_0x13df3d['id']}})['then'](function(){return getChanSpyPromise(_0x242e0a,_0x13df3d);})[_0x9964('0x1f')](function(_0x162b83){if(_0x162b83&&_0x162b83[_0x9964('0x19')]){return _0x242e0a[_0x9964('0x25')][_0x9964('0x26')](_0x162b83);}})[_0x9964('0x1f')](function(){_0x44cb60();})[_0x9964('0x20')](function(_0x2f6068){_0x44cb60(_0x2f6068);});},'afterDestroy':function(_0x46c57d,_0x58ce2c,_0x498014){return _0x242e0a['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x46c57d['id']}})[_0x9964('0x1f')](function(){_0x498014();})[_0x9964('0x20')](function(_0x4efb43){_0x498014(_0x4efb43);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 78b06ac..3f58bc1 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 _0x81e9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x81e9,0x104));var _0x981e=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x81e9[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x981e('0x0'));var util=require(_0x981e('0x1'));var moment=require(_0x981e('0x2'));var BPromise=require(_0x981e('0x3'));var rs=require(_0x981e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x981e('0x5'))['db'];var utils=require(_0x981e('0x6'));var logger=require(_0x981e('0x7'))(_0x981e('0x8'));var config=require(_0x981e('0x9'));var jayson=require(_0x981e('0xa'));var client=jayson[_0x981e('0xb')][_0x981e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1df03f,_0x11dad0,_0x265834){return new BPromise(function(_0x3b97e5,_0x43164e){return client['request'](_0x1df03f,_0x265834)[_0x981e('0xd')](function(_0x19f347){logger[_0x981e('0xe')](_0x981e('0xf'),_0x11dad0,_0x981e('0x10'));logger[_0x981e('0x11')](_0x981e('0x12'),_0x11dad0,_0x981e('0x10'),JSON[_0x981e('0x13')](_0x19f347));if(_0x19f347[_0x981e('0x14')]){if(_0x19f347[_0x981e('0x14')]['code']===0x1f4){logger[_0x981e('0x14')](_0x981e('0xf'),_0x11dad0,_0x19f347[_0x981e('0x14')][_0x981e('0x15')]);return _0x43164e(_0x19f347['error']['message']);}logger[_0x981e('0x14')](_0x981e('0xf'),_0x11dad0,_0x19f347[_0x981e('0x14')][_0x981e('0x15')]);return _0x3b97e5(_0x19f347[_0x981e('0x14')][_0x981e('0x15')]);}else{logger[_0x981e('0xe')](_0x981e('0xf'),_0x11dad0,_0x981e('0x10'));_0x3b97e5(_0x19f347[_0x981e('0x16')]['message']);}})[_0x981e('0x17')](function(_0x2c962e){logger[_0x981e('0x14')](_0x981e('0xf'),_0x11dad0,_0x2c962e);_0x43164e(_0x2c962e);});});} \ No newline at end of file +var _0x4cbc=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x45dd0e,_0x28e603){var _0x50e5ca=function(_0x46a412){while(--_0x46a412){_0x45dd0e['push'](_0x45dd0e['shift']());}};_0x50e5ca(++_0x28e603);}(_0x4cbc,0x1cf));var _0xc4cb=function(_0x2ef822,_0x5b8acb){_0x2ef822=_0x2ef822-0x0;var _0x2d193e=_0x4cbc[_0x2ef822];return _0x2d193e;};'use strict';var _=require(_0xc4cb('0x0'));var util=require(_0xc4cb('0x1'));var moment=require(_0xc4cb('0x2'));var BPromise=require(_0xc4cb('0x3'));var rs=require(_0xc4cb('0x4'));var fs=require('fs');var Redis=require(_0xc4cb('0x5'));var db=require(_0xc4cb('0x6'))['db'];var utils=require(_0xc4cb('0x7'));var logger=require(_0xc4cb('0x8'))(_0xc4cb('0x9'));var config=require(_0xc4cb('0xa'));var jayson=require(_0xc4cb('0xb'));var client=jayson['client'][_0xc4cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x538ba1,_0x414c38,_0x593715){return new BPromise(function(_0x58d100,_0x24a32b){return client[_0xc4cb('0xd')](_0x538ba1,_0x593715)['then'](function(_0x28b264){logger[_0xc4cb('0xe')](_0xc4cb('0xf'),_0x414c38,_0xc4cb('0x10'));logger[_0xc4cb('0x11')](_0xc4cb('0x12'),_0x414c38,'request\x20sent',JSON['stringify'](_0x28b264));if(_0x28b264[_0xc4cb('0x13')]){if(_0x28b264['error'][_0xc4cb('0x14')]===0x1f4){logger[_0xc4cb('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x414c38,_0x28b264[_0xc4cb('0x13')][_0xc4cb('0x15')]);return _0x24a32b(_0x28b264[_0xc4cb('0x13')][_0xc4cb('0x15')]);}logger[_0xc4cb('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x414c38,_0x28b264[_0xc4cb('0x13')][_0xc4cb('0x15')]);return _0x58d100(_0x28b264[_0xc4cb('0x13')][_0xc4cb('0x15')]);}else{logger['info'](_0xc4cb('0xf'),_0x414c38,_0xc4cb('0x10'));_0x58d100(_0x28b264[_0xc4cb('0x16')][_0xc4cb('0x15')]);}})[_0xc4cb('0x17')](function(_0x5f3cee){logger[_0xc4cb('0x13')](_0xc4cb('0xf'),_0x414c38,_0x5f3cee);_0x24a32b(_0x5f3cee);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index beb570a..87e3b18 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 _0xdeb3=['get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x2bbe1a,_0x180994){var _0x57714b=function(_0x4656f9){while(--_0x4656f9){_0x2bbe1a['push'](_0x2bbe1a['shift']());}};_0x57714b(++_0x180994);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x3deb('0x0'));var path=require(_0x3deb('0x1'));var timeout=require(_0x3deb('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3deb('0x3'));var interaction=require(_0x3deb('0x4'));var config=require(_0x3deb('0x5'));var controller=require(_0x3deb('0x6'));router[_0x3deb('0x7')]('/',auth['isAuthenticated'](),controller[_0x3deb('0x8')]);router['get'](_0x3deb('0x9'),auth['isAuthenticated'](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')]('/',auth[_0x3deb('0xc')](),controller[_0x3deb('0xd')]);router[_0x3deb('0xe')](_0x3deb('0x9'),auth[_0x3deb('0xc')](),controller[_0x3deb('0xf')]);router[_0x3deb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3deb('0x11')]);module[_0x3deb('0x12')]=router; \ No newline at end of file +var _0x94e6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x2db58c,_0x2a0920){var _0x14df3a=function(_0x27bef0){while(--_0x27bef0){_0x2db58c['push'](_0x2db58c['shift']());}};_0x14df3a(++_0x2a0920);}(_0x94e6,0x194));var _0x694e=function(_0x544ce6,_0x2cb3e9){_0x544ce6=_0x544ce6-0x0;var _0x32ca32=_0x94e6[_0x544ce6];return _0x32ca32;};'use strict';var multer=require(_0x694e('0x0'));var util=require('util');var path=require(_0x694e('0x1'));var timeout=require(_0x694e('0x2'));var express=require(_0x694e('0x3'));var router=express[_0x694e('0x4')]();var auth=require(_0x694e('0x5'));var interaction=require(_0x694e('0x6'));var config=require('../../config/environment');var controller=require(_0x694e('0x7'));router[_0x694e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x694e('0x8')](_0x694e('0x9'),auth[_0x694e('0xa')](),controller['show']);router['post']('/',auth[_0x694e('0xa')](),controller['create']);router['put']('/:id',auth[_0x694e('0xa')](),controller[_0x694e('0xb')]);router[_0x694e('0xc')](_0x694e('0x9'),auth['isAuthenticated'](),controller[_0x694e('0xd')]);module[_0x694e('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 10a88cc..eb91877 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 _0x059a=['name','BOOLEAN','sequelize','exports'];(function(_0x13161e,_0x5f34ff){var _0x360d68=function(_0x57111d){while(--_0x57111d){_0x13161e['push'](_0x13161e['shift']());}};_0x360d68(++_0x5f34ff);}(_0x059a,0x126));var _0xa059=function(_0x375c0b,_0x567d67){_0x375c0b=_0x375c0b-0x0;var _0x4c4bec=_0x059a[_0x375c0b];return _0x4c4bec;};'use strict';var Sequelize=require(_0xa059('0x0'));module[_0xa059('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa059('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa059('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1244=['BOOLEAN','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1244,0x149));var _0x4124=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1244[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4124('0x0')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4124('0x1')],'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 912f874..1f635c4 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 _0x1883=['offset','limit','set','json','apply','reject','save','update','destroy','get','Contexts','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','VoiceContext','includeAll','include','findAll','rows','show','params','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','writeFileSync','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x1883,0xab));var _0x3188=function(_0xd0a593,_0x3b2721){_0xd0a593=_0xd0a593-0x0;var _0x35eefc=_0x1883[_0xd0a593];return _0x35eefc;};'use strict';var pdf=require(_0x3188('0x0'));var emlformat=require(_0x3188('0x1'));var rimraf=require(_0x3188('0x2'));var zipdir=require(_0x3188('0x3'));var jsonpatch=require(_0x3188('0x4'));var rp=require(_0x3188('0x5'));var moment=require(_0x3188('0x6'));var BPromise=require(_0x3188('0x7'));var Mustache=require(_0x3188('0x8'));var util=require(_0x3188('0x9'));var path=require(_0x3188('0xa'));var sox=require(_0x3188('0xb'));var csv=require(_0x3188('0xc'));var ejs=require(_0x3188('0xd'));var fs=require('fs');var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xc'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var hardwareService=require(_0x3188('0x15'));var logger=require(_0x3188('0x16'))('api');var utils=require(_0x3188('0x17'));var config=require(_0x3188('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x3188('0x19')][_0x3188('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x20fef6,_0x3ae228,_0x4bb424){if(_0x4bb424){var _0xc01ce6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc01ce6['test'](_0x3ae228)){return _0x20fef6;}else{throw new Error(_0x3188('0x1b'));}}else{return _0x20fef6;}}function respondWithRpcPromise(_0x5e0044,_0x4a2f36,_0x1b8a18,_0x53668b){return new BPromise(function(_0x54a87f,_0x32c239){var _0x1beead=_0x53668b||client;return _0x1beead[_0x3188('0x1c')](_0x5e0044,_0x1b8a18)[_0x3188('0x1d')](function(_0x145293){logger[_0x3188('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4a2f36,_0x3188('0x1f'));logger[_0x3188('0x20')](_0x3188('0x21'),_0x4a2f36,_0x3188('0x1f'),JSON[_0x3188('0x22')](_0x145293));if(_0x145293[_0x3188('0x23')]){if(_0x145293[_0x3188('0x23')][_0x3188('0x24')]===0x1f4){logger['error'](_0x3188('0x25'),_0x4a2f36,_0x145293[_0x3188('0x23')]['message']);return _0x32c239(_0x145293['error']['message']);}logger[_0x3188('0x23')](_0x3188('0x25'),_0x4a2f36,_0x145293[_0x3188('0x23')]['message']);return _0x54a87f(_0x145293['error'][_0x3188('0x26')]);}else{logger[_0x3188('0x1e')](_0x3188('0x25'),_0x4a2f36,_0x3188('0x1f'));_0x54a87f(_0x145293[_0x3188('0x27')]['message']);}})[_0x3188('0x28')](function(_0x33f882){logger['error'](_0x3188('0x25'),_0x4a2f36,_0x33f882);_0x32c239(_0x33f882);});});}function respondWithStatusCode(_0x4be6c3,_0x5c69be){_0x5c69be=_0x5c69be||0xcc;return function(_0x45ae2f){if(_0x45ae2f){return _0x4be6c3[_0x3188('0x29')](_0x5c69be);}return _0x4be6c3[_0x3188('0x2a')](_0x5c69be)[_0x3188('0x2b')]();};}function respondWithResult(_0x336be5,_0x2cd060){_0x2cd060=_0x2cd060||0xc8;return function(_0xe57f73){if(_0xe57f73){return _0x336be5[_0x3188('0x2a')](_0x2cd060)['json'](_0xe57f73);}};}function respondWithFilteredResult(_0x2cc5d9,_0x2d000a){return function(_0x52bb13){if(_0x52bb13){var _0xd3ee40=_0x52bb13[_0x3188('0x2c')],_0x14299b=_0x2d000a[_0x3188('0x2d')],_0x43399d=_0x2d000a[_0x3188('0x2d')]+_0x2d000a[_0x3188('0x2e')],_0x44db9a;if(_0x43399d>=_0xd3ee40){_0x43399d=_0xd3ee40;_0x44db9a=0xc8;}else{_0x44db9a=0xce;}_0x2cc5d9['status'](_0x44db9a);return _0x2cc5d9[_0x3188('0x2f')]('Content-Range',_0x14299b+'-'+_0x43399d+'/'+_0xd3ee40)[_0x3188('0x30')](_0x52bb13);}return null;};}function patchUpdates(_0x5623f1){return function(_0x3f82ce){try{jsonpatch[_0x3188('0x31')](_0x3f82ce,_0x5623f1,!![]);}catch(_0x3be4f7){return BPromise[_0x3188('0x32')](_0x3be4f7);}return _0x3f82ce[_0x3188('0x33')]();};}function saveUpdates(_0x263892,_0x2461e2){return function(_0x279069){if(_0x279069){return _0x279069[_0x3188('0x34')](_0x263892)[_0x3188('0x1d')](function(_0x7c23b1){return _0x7c23b1;});}return null;};}function removeEntity(_0x2d86fa,_0x2c1d68){return function(_0x461c3d){if(_0x461c3d){return _0x461c3d[_0x3188('0x35')]()[_0x3188('0x1d')](function(){var _0x244f58=_0x461c3d[_0x3188('0x36')]({'plain':!![]});var _0x5866bd=_0x3188('0x37');return db['UserProfileResource'][_0x3188('0x35')]({'where':{'type':_0x5866bd,'resourceId':_0x244f58['id']}})[_0x3188('0x1d')](function(){return _0x461c3d;});})['then'](function(){_0x2d86fa[_0x3188('0x2a')](0xcc)[_0x3188('0x2b')]();});}};}function handleEntityNotFound(_0x1d5695,_0x6d503d){return function(_0xa14c93){if(!_0xa14c93){_0x1d5695[_0x3188('0x29')](0x194);}return _0xa14c93;};}function handleError(_0x2bef8e,_0x51b7a9){_0x51b7a9=_0x51b7a9||0x1f4;return function(_0x4e4710){logger[_0x3188('0x23')](_0x4e4710[_0x3188('0x38')]);if(_0x4e4710[_0x3188('0x39')]){delete _0x4e4710[_0x3188('0x39')];}_0x2bef8e['status'](_0x51b7a9)[_0x3188('0x3a')](_0x4e4710);};}exports[_0x3188('0x3b')]=function(_0x25ad4c,_0x2dc80b){var _0x4fbc25={},_0x201ef2={},_0x4a290f={'count':0x0,'rows':[]};var _0x130e73=db['VoiceContext'][_0x3188('0x3c')];_0x201ef2[_0x3188('0x3d')]=_[_0x3188('0x3e')](_0x130e73);_0x201ef2[_0x3188('0x3f')]=_[_0x3188('0x3e')](_0x25ad4c[_0x3188('0x3f')]);_0x201ef2[_0x3188('0x40')]=_[_0x3188('0x41')](_0x201ef2[_0x3188('0x3d')],_0x201ef2[_0x3188('0x3f')]);_0x4fbc25['attributes']=_[_0x3188('0x41')](_0x201ef2[_0x3188('0x3d')],qs[_0x3188('0x42')](_0x25ad4c[_0x3188('0x3f')][_0x3188('0x42')]));_0x4fbc25[_0x3188('0x43')]=_0x4fbc25['attributes'][_0x3188('0x44')]?_0x4fbc25['attributes']:_0x201ef2[_0x3188('0x3d')];if(!_0x25ad4c[_0x3188('0x3f')][_0x3188('0x45')](_0x3188('0x46'))){_0x4fbc25[_0x3188('0x2e')]=qs['limit'](_0x25ad4c['query']['limit']);_0x4fbc25['offset']=qs['offset'](_0x25ad4c[_0x3188('0x3f')][_0x3188('0x2d')]);}_0x4fbc25[_0x3188('0x47')]=qs[_0x3188('0x48')](_0x25ad4c[_0x3188('0x3f')]['sort']);_0x4fbc25[_0x3188('0x49')]=qs['filters'](_[_0x3188('0x4a')](_0x25ad4c[_0x3188('0x3f')],_0x201ef2[_0x3188('0x40')]));if(_0x25ad4c[_0x3188('0x3f')]['filter']){_0x4fbc25[_0x3188('0x49')]=_[_0x3188('0x4b')](_0x4fbc25[_0x3188('0x49')],{'$or':_[_0x3188('0x4c')](_0x130e73,function(_0x42d365){if(_0x42d365['type']['key']!==_0x3188('0x4d')){var _0x24bc8a={};_0x24bc8a[_0x42d365['field']]={'$like':'%'+_0x25ad4c[_0x3188('0x3f')][_0x3188('0x4e')]+'%'};return _0x24bc8a;}})});}_0x4fbc25=_['merge']({},_0x4fbc25,_0x25ad4c[_0x3188('0x4f')]);var _0x16a9d3={'where':_0x4fbc25[_0x3188('0x49')]};return db[_0x3188('0x50')][_0x3188('0x2c')](_0x16a9d3)['then'](function(_0x467ead){_0x4a290f['count']=_0x467ead;if(_0x25ad4c[_0x3188('0x3f')][_0x3188('0x51')]){_0x4fbc25[_0x3188('0x52')]=[{'all':!![]}];}return db[_0x3188('0x50')][_0x3188('0x53')](_0x4fbc25);})[_0x3188('0x1d')](function(_0x2aa232){_0x4a290f[_0x3188('0x54')]=_0x2aa232;return _0x4a290f;})[_0x3188('0x1d')](respondWithFilteredResult(_0x2dc80b,_0x4fbc25))[_0x3188('0x28')](handleError(_0x2dc80b,null));};exports[_0x3188('0x55')]=function(_0x50c08d,_0x50fd56){var _0x1b012d={'raw':![],'where':{'id':_0x50c08d[_0x3188('0x56')]['id']}},_0x494c60={};_0x494c60[_0x3188('0x3d')]=_['keys'](db[_0x3188('0x50')][_0x3188('0x3c')]);_0x494c60[_0x3188('0x3f')]=_[_0x3188('0x3e')](_0x50c08d[_0x3188('0x3f')]);_0x494c60[_0x3188('0x40')]=_[_0x3188('0x41')](_0x494c60[_0x3188('0x3d')],_0x494c60['query']);_0x1b012d[_0x3188('0x43')]=_[_0x3188('0x41')](_0x494c60['model'],qs[_0x3188('0x42')](_0x50c08d['query'][_0x3188('0x42')]));_0x1b012d[_0x3188('0x43')]=_0x1b012d[_0x3188('0x43')]['length']?_0x1b012d['attributes']:_0x494c60['model'];if(_0x50c08d['query']['includeAll']){_0x1b012d[_0x3188('0x52')]=[{'all':!![]}];}_0x1b012d=_[_0x3188('0x4b')]({},_0x1b012d,_0x50c08d['options']);return db[_0x3188('0x50')][_0x3188('0x57')](_0x1b012d)['then'](handleEntityNotFound(_0x50fd56,null))['then'](respondWithResult(_0x50fd56,null))['catch'](handleError(_0x50fd56,null));};exports['create']=function(_0x502c42,_0x28717a,_0x4763a5){var _0x9860ab;return db[_0x3188('0x50')][_0x3188('0x58')](_0x502c42['body'],{'raw':!![]})[_0x3188('0x1d')](function(_0x2363bf){_0x9860ab=_0x2363bf;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x176da0){var _0x4168fe=fs[_0x3188('0x59')](path['join'](config[_0x3188('0x5a')],_0x3188('0x5b')),_0x3188('0x5c'));var _0x1dfdbf=ejs[_0x3188('0x5d')](_0x4168fe,{'contexts':_0x176da0||[]});fs['writeFileSync'](_0x3188('0x5e'),_0x1dfdbf);})[_0x3188('0x1d')](function(){return respondWithRpcPromise(_0x3188('0x5f'),'create',{'module':_0x3188('0x60')});})[_0x3188('0x1d')](function(){var _0x29eb0d=_0x502c42[_0x3188('0x61')]['get']({'plain':!![]});if(!_0x29eb0d)throw new Error(_0x3188('0x62'));if(_0x29eb0d[_0x3188('0x63')]===_0x3188('0x61')){var _0x19a36b=_0x9860ab[_0x3188('0x36')]({'plain':!![]});return db[_0x3188('0x64')][_0x3188('0x57')]({'where':{'name':'Contexts','userProfileId':_0x29eb0d[_0x3188('0x65')]},'raw':!![]})[_0x3188('0x1d')](function(_0x24eb76){if(_0x24eb76&&_0x24eb76[_0x3188('0x66')]===0x0){return db[_0x3188('0x67')][_0x3188('0x58')]({'name':_0x19a36b[_0x3188('0x39')],'resourceId':_0x19a36b['id'],'type':_0x24eb76['name'],'sectionId':_0x24eb76['id']},{})[_0x3188('0x1d')](function(){return _0x9860ab;});}else{return _0x9860ab;}})[_0x3188('0x28')](function(_0xc4a8c9){logger[_0x3188('0x23')](_0x3188('0x68'),_0xc4a8c9);throw _0xc4a8c9;});}return _0x9860ab;})['then'](respondWithResult(_0x28717a,0xc9))[_0x3188('0x28')](handleError(_0x28717a,null));};exports[_0x3188('0x34')]=function(_0x51a541,_0x4e4d50,_0xe888de){var _0x3631ec;return db[_0x3188('0x50')][_0x3188('0x57')]({'where':{'id':_0x51a541[_0x3188('0x56')]['id']}})[_0x3188('0x1d')](handleEntityNotFound(_0x4e4d50,null))[_0x3188('0x1d')](saveUpdates(_0x51a541[_0x3188('0x69')],null))[_0x3188('0x1d')](function(_0x248fce){if(_0x248fce){_0x3631ec=_0x248fce;return db['VoiceContext'][_0x3188('0x53')]({'raw':!![]});}})['then'](function(_0x4c90ff){var _0x4ad2c6=fs['readFileSync'](path[_0x3188('0x6a')](config[_0x3188('0x5a')],_0x3188('0x5b')),_0x3188('0x5c'));var _0x1aebe7=ejs[_0x3188('0x5d')](_0x4ad2c6,{'contexts':_0x4c90ff||[]});fs['writeFileSync'](_0x3188('0x5e'),_0x1aebe7);})[_0x3188('0x1d')](function(){return respondWithRpcPromise('Reload',_0x3188('0x34'),{'module':_0x3188('0x60')});})[_0x3188('0x1d')](function(){return _0x3631ec;})[_0x3188('0x1d')](respondWithResult(_0x4e4d50,null))[_0x3188('0x28')](handleError(_0x4e4d50,null));};exports[_0x3188('0x35')]=function(_0x54f790,_0x1ac95b,_0xf0b9eb){var _0x57bb84;return db[_0x3188('0x50')][_0x3188('0x57')]({'where':{'id':_0x54f790[_0x3188('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ac95b,null))[_0x3188('0x1d')](removeEntity(_0x1ac95b,null))[_0x3188('0x1d')](function(){return db[_0x3188('0x50')][_0x3188('0x53')]({'raw':!![]});})[_0x3188('0x1d')](function(_0x1bfd9b){var _0x192874=fs['readFileSync'](path['join'](config['root'],'server/files/templates/context.ejs'),_0x3188('0x5c'));var _0x693395=ejs[_0x3188('0x5d')](_0x192874,{'contexts':_0x1bfd9b});fs[_0x3188('0x6b')](_0x3188('0x5e'),_0x693395);return respondWithRpcPromise('Reload',_0x3188('0x35'),{'module':'chan_sip.so'});})[_0x3188('0x28')](handleError(_0x1ac95b,null));}; \ No newline at end of file +var _0x2eb2=['map','field','options','VoiceContext','includeAll','show','params','include','find','create','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','sendStatus','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x566f4a,_0x296de1){var _0x50e902=function(_0x229711){while(--_0x229711){_0x566f4a['push'](_0x566f4a['shift']());}};_0x50e902(++_0x296de1);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x2eb2[_0x1d9aa0];return _0x226868;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x22eb('0x0'));var rimraf=require(_0x22eb('0x1'));var zipdir=require(_0x22eb('0x2'));var jsonpatch=require(_0x22eb('0x3'));var rp=require(_0x22eb('0x4'));var moment=require(_0x22eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22eb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x22eb('0x7'));var csv=require(_0x22eb('0x8'));var ejs=require(_0x22eb('0x9'));var fs=require('fs');var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x8'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x22eb('0x13'));var utils=require('../../config/utils');var config=require(_0x22eb('0x14'));var db=require(_0x22eb('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x22eb('0x16')]({'port':0x232a});function checkPasswordPattern(_0x189f05,_0x128d43,_0x1e2a53){if(_0x1e2a53){var _0x427439=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x427439['test'](_0x128d43)){return _0x189f05;}else{throw new Error(_0x22eb('0x17'));}}else{return _0x189f05;}}function respondWithRpcPromise(_0x53f14e,_0x1f5089,_0x55ede8,_0x40c8cb){return new BPromise(function(_0x84c668,_0x53abbf){var _0x48b63c=_0x40c8cb||client;return _0x48b63c['request'](_0x53f14e,_0x55ede8)[_0x22eb('0x18')](function(_0x5245fe){logger['info'](_0x22eb('0x19'),_0x1f5089,'request\x20sent');logger['debug'](_0x22eb('0x1a'),_0x1f5089,_0x22eb('0x1b'),JSON[_0x22eb('0x1c')](_0x5245fe));if(_0x5245fe[_0x22eb('0x1d')]){if(_0x5245fe[_0x22eb('0x1d')]['code']===0x1f4){logger[_0x22eb('0x1d')](_0x22eb('0x19'),_0x1f5089,_0x5245fe[_0x22eb('0x1d')][_0x22eb('0x1e')]);return _0x53abbf(_0x5245fe[_0x22eb('0x1d')]['message']);}logger[_0x22eb('0x1d')](_0x22eb('0x19'),_0x1f5089,_0x5245fe[_0x22eb('0x1d')]['message']);return _0x84c668(_0x5245fe['error'][_0x22eb('0x1e')]);}else{logger[_0x22eb('0x1f')](_0x22eb('0x19'),_0x1f5089,_0x22eb('0x1b'));_0x84c668(_0x5245fe[_0x22eb('0x20')][_0x22eb('0x1e')]);}})[_0x22eb('0x21')](function(_0x4e7e69){logger[_0x22eb('0x1d')](_0x22eb('0x19'),_0x1f5089,_0x4e7e69);_0x53abbf(_0x4e7e69);});});}function respondWithStatusCode(_0x3ffa9e,_0x3031b3){_0x3031b3=_0x3031b3||0xcc;return function(_0x420d4f){if(_0x420d4f){return _0x3ffa9e['sendStatus'](_0x3031b3);}return _0x3ffa9e[_0x22eb('0x22')](_0x3031b3)[_0x22eb('0x23')]();};}function respondWithResult(_0x2f3b39,_0x5a001e){_0x5a001e=_0x5a001e||0xc8;return function(_0xe0783c){if(_0xe0783c){return _0x2f3b39[_0x22eb('0x22')](_0x5a001e)['json'](_0xe0783c);}};}function respondWithFilteredResult(_0x32a4b6,_0x222ef3){return function(_0x1e3015){if(_0x1e3015){var _0x2924f6=_0x1e3015[_0x22eb('0x24')],_0x2da5c6=_0x222ef3[_0x22eb('0x25')],_0x4f4f56=_0x222ef3[_0x22eb('0x25')]+_0x222ef3[_0x22eb('0x26')],_0x49dd59;if(_0x4f4f56>=_0x2924f6){_0x4f4f56=_0x2924f6;_0x49dd59=0xc8;}else{_0x49dd59=0xce;}_0x32a4b6[_0x22eb('0x22')](_0x49dd59);return _0x32a4b6[_0x22eb('0x27')](_0x22eb('0x28'),_0x2da5c6+'-'+_0x4f4f56+'/'+_0x2924f6)[_0x22eb('0x29')](_0x1e3015);}return null;};}function patchUpdates(_0x382784){return function(_0x39cec1){try{jsonpatch[_0x22eb('0x2a')](_0x39cec1,_0x382784,!![]);}catch(_0x5a37f8){return BPromise['reject'](_0x5a37f8);}return _0x39cec1[_0x22eb('0x2b')]();};}function saveUpdates(_0x4e3604,_0x1dd660){return function(_0x1e035a){if(_0x1e035a){return _0x1e035a[_0x22eb('0x2c')](_0x4e3604)[_0x22eb('0x18')](function(_0x351ed8){return _0x351ed8;});}return null;};}function removeEntity(_0x158cfa,_0x35fb89){return function(_0x476cdb){if(_0x476cdb){return _0x476cdb[_0x22eb('0x2d')]()[_0x22eb('0x18')](function(){var _0x509bb7=_0x476cdb['get']({'plain':!![]});var _0x239a41='Contexts';return db['UserProfileResource'][_0x22eb('0x2d')]({'where':{'type':_0x239a41,'resourceId':_0x509bb7['id']}})[_0x22eb('0x18')](function(){return _0x476cdb;});})[_0x22eb('0x18')](function(){_0x158cfa[_0x22eb('0x22')](0xcc)[_0x22eb('0x23')]();});}};}function handleEntityNotFound(_0x332e9a,_0x3855df){return function(_0x42a6d6){if(!_0x42a6d6){_0x332e9a[_0x22eb('0x2e')](0x194);}return _0x42a6d6;};}function handleError(_0x21e66b,_0x5e8167){_0x5e8167=_0x5e8167||0x1f4;return function(_0x9c8193){logger['error'](_0x9c8193['stack']);if(_0x9c8193[_0x22eb('0x2f')]){delete _0x9c8193[_0x22eb('0x2f')];}_0x21e66b['status'](_0x5e8167)[_0x22eb('0x30')](_0x9c8193);};}exports[_0x22eb('0x31')]=function(_0x236def,_0x353356){var _0x2712a7={},_0x574555={},_0x25f140={'count':0x0,'rows':[]};var _0x1aea5f=db['VoiceContext'][_0x22eb('0x32')];_0x574555[_0x22eb('0x33')]=_[_0x22eb('0x34')](_0x1aea5f);_0x574555[_0x22eb('0x35')]=_[_0x22eb('0x34')](_0x236def['query']);_0x574555['filters']=_[_0x22eb('0x36')](_0x574555[_0x22eb('0x33')],_0x574555['query']);_0x2712a7[_0x22eb('0x37')]=_[_0x22eb('0x36')](_0x574555[_0x22eb('0x33')],qs['fields'](_0x236def[_0x22eb('0x35')][_0x22eb('0x38')]));_0x2712a7[_0x22eb('0x37')]=_0x2712a7[_0x22eb('0x37')][_0x22eb('0x39')]?_0x2712a7[_0x22eb('0x37')]:_0x574555['model'];if(!_0x236def[_0x22eb('0x35')][_0x22eb('0x3a')]('nolimit')){_0x2712a7[_0x22eb('0x26')]=qs[_0x22eb('0x26')](_0x236def[_0x22eb('0x35')][_0x22eb('0x26')]);_0x2712a7[_0x22eb('0x25')]=qs[_0x22eb('0x25')](_0x236def[_0x22eb('0x35')][_0x22eb('0x25')]);}_0x2712a7[_0x22eb('0x3b')]=qs[_0x22eb('0x3c')](_0x236def[_0x22eb('0x35')][_0x22eb('0x3c')]);_0x2712a7[_0x22eb('0x3d')]=qs[_0x22eb('0x3e')](_[_0x22eb('0x3f')](_0x236def[_0x22eb('0x35')],_0x574555[_0x22eb('0x3e')]));if(_0x236def[_0x22eb('0x35')]['filter']){_0x2712a7[_0x22eb('0x3d')]=_[_0x22eb('0x40')](_0x2712a7['where'],{'$or':_[_0x22eb('0x41')](_0x1aea5f,function(_0x3af5dc){if(_0x3af5dc['type']['key']!=='VIRTUAL'){var _0xada312={};_0xada312[_0x3af5dc[_0x22eb('0x42')]]={'$like':'%'+_0x236def['query']['filter']+'%'};return _0xada312;}})});}_0x2712a7=_[_0x22eb('0x40')]({},_0x2712a7,_0x236def[_0x22eb('0x43')]);var _0x326b24={'where':_0x2712a7[_0x22eb('0x3d')]};return db[_0x22eb('0x44')][_0x22eb('0x24')](_0x326b24)[_0x22eb('0x18')](function(_0x147ca0){_0x25f140['count']=_0x147ca0;if(_0x236def['query'][_0x22eb('0x45')]){_0x2712a7['include']=[{'all':!![]}];}return db[_0x22eb('0x44')]['findAll'](_0x2712a7);})[_0x22eb('0x18')](function(_0x5c41c0){_0x25f140['rows']=_0x5c41c0;return _0x25f140;})['then'](respondWithFilteredResult(_0x353356,_0x2712a7))['catch'](handleError(_0x353356,null));};exports[_0x22eb('0x46')]=function(_0x4b5c03,_0x320211){var _0x3b35c6={'raw':![],'where':{'id':_0x4b5c03[_0x22eb('0x47')]['id']}},_0x490bef={};_0x490bef['model']=_[_0x22eb('0x34')](db[_0x22eb('0x44')][_0x22eb('0x32')]);_0x490bef[_0x22eb('0x35')]=_[_0x22eb('0x34')](_0x4b5c03[_0x22eb('0x35')]);_0x490bef[_0x22eb('0x3e')]=_[_0x22eb('0x36')](_0x490bef[_0x22eb('0x33')],_0x490bef['query']);_0x3b35c6[_0x22eb('0x37')]=_[_0x22eb('0x36')](_0x490bef['model'],qs[_0x22eb('0x38')](_0x4b5c03[_0x22eb('0x35')][_0x22eb('0x38')]));_0x3b35c6[_0x22eb('0x37')]=_0x3b35c6['attributes'][_0x22eb('0x39')]?_0x3b35c6[_0x22eb('0x37')]:_0x490bef[_0x22eb('0x33')];if(_0x4b5c03[_0x22eb('0x35')][_0x22eb('0x45')]){_0x3b35c6[_0x22eb('0x48')]=[{'all':!![]}];}_0x3b35c6=_['merge']({},_0x3b35c6,_0x4b5c03[_0x22eb('0x43')]);return db['VoiceContext'][_0x22eb('0x49')](_0x3b35c6)['then'](handleEntityNotFound(_0x320211,null))[_0x22eb('0x18')](respondWithResult(_0x320211,null))[_0x22eb('0x21')](handleError(_0x320211,null));};exports[_0x22eb('0x4a')]=function(_0x2c1b87,_0x3f03df,_0x4aa0c5){var _0x4896ed;return db[_0x22eb('0x44')][_0x22eb('0x4a')](_0x2c1b87['body'],{'raw':!![]})[_0x22eb('0x18')](function(_0xdf9531){_0x4896ed=_0xdf9531;return db[_0x22eb('0x44')][_0x22eb('0x4b')]({'raw':!![]});})[_0x22eb('0x18')](function(_0x27756b){var _0x3a8588=fs[_0x22eb('0x4c')](path[_0x22eb('0x4d')](config[_0x22eb('0x4e')],_0x22eb('0x4f')),'utf8');var _0x19cadf=ejs[_0x22eb('0x50')](_0x3a8588,{'contexts':_0x27756b||[]});fs[_0x22eb('0x51')](_0x22eb('0x52'),_0x19cadf);})[_0x22eb('0x18')](function(){return respondWithRpcPromise(_0x22eb('0x53'),_0x22eb('0x4a'),{'module':_0x22eb('0x54')});})[_0x22eb('0x18')](function(){var _0x9f8465=_0x2c1b87[_0x22eb('0x55')][_0x22eb('0x56')]({'plain':!![]});if(!_0x9f8465)throw new Error(_0x22eb('0x57'));if(_0x9f8465[_0x22eb('0x58')]==='user'){var _0x597497=_0x4896ed[_0x22eb('0x56')]({'plain':!![]});return db[_0x22eb('0x59')][_0x22eb('0x49')]({'where':{'name':_0x22eb('0x5a'),'userProfileId':_0x9f8465[_0x22eb('0x5b')]},'raw':!![]})['then'](function(_0x294c8c){if(_0x294c8c&&_0x294c8c[_0x22eb('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x597497[_0x22eb('0x2f')],'resourceId':_0x597497['id'],'type':_0x294c8c[_0x22eb('0x2f')],'sectionId':_0x294c8c['id']},{})[_0x22eb('0x18')](function(){return _0x4896ed;});}else{return _0x4896ed;}})[_0x22eb('0x21')](function(_0x445ec5){logger[_0x22eb('0x1d')](_0x22eb('0x5d'),_0x445ec5);throw _0x445ec5;});}return _0x4896ed;})[_0x22eb('0x18')](respondWithResult(_0x3f03df,0xc9))[_0x22eb('0x21')](handleError(_0x3f03df,null));};exports[_0x22eb('0x2c')]=function(_0x164645,_0x3c68f9,_0x1fdae5){var _0x1d4aa1;return db['VoiceContext'][_0x22eb('0x49')]({'where':{'id':_0x164645[_0x22eb('0x47')]['id']}})[_0x22eb('0x18')](handleEntityNotFound(_0x3c68f9,null))['then'](saveUpdates(_0x164645[_0x22eb('0x5e')],null))['then'](function(_0x27b082){if(_0x27b082){_0x1d4aa1=_0x27b082;return db['VoiceContext'][_0x22eb('0x4b')]({'raw':!![]});}})[_0x22eb('0x18')](function(_0x4a8f0d){var _0x1f8707=fs[_0x22eb('0x4c')](path['join'](config['root'],_0x22eb('0x4f')),_0x22eb('0x5f'));var _0x1984f0=ejs[_0x22eb('0x50')](_0x1f8707,{'contexts':_0x4a8f0d||[]});fs[_0x22eb('0x51')](_0x22eb('0x52'),_0x1984f0);})['then'](function(){return respondWithRpcPromise(_0x22eb('0x53'),'update',{'module':'chan_sip.so'});})[_0x22eb('0x18')](function(){return _0x1d4aa1;})[_0x22eb('0x18')](respondWithResult(_0x3c68f9,null))[_0x22eb('0x21')](handleError(_0x3c68f9,null));};exports[_0x22eb('0x2d')]=function(_0x300e45,_0x797700,_0x400dbe){var _0x109f7f;return db['VoiceContext']['find']({'where':{'id':_0x300e45[_0x22eb('0x47')]['id']}})[_0x22eb('0x18')](handleEntityNotFound(_0x797700,null))['then'](removeEntity(_0x797700,null))[_0x22eb('0x18')](function(){return db[_0x22eb('0x44')][_0x22eb('0x4b')]({'raw':!![]});})[_0x22eb('0x18')](function(_0x40faf6){var _0x3ff700=fs['readFileSync'](path[_0x22eb('0x4d')](config[_0x22eb('0x4e')],_0x22eb('0x4f')),'utf8');var _0x4fcc2c=ejs[_0x22eb('0x50')](_0x3ff700,{'contexts':_0x40faf6});fs[_0x22eb('0x51')](_0x22eb('0x52'),_0x4fcc2c);return respondWithRpcPromise('Reload',_0x22eb('0x2d'),{'module':'chan_sip.so'});})[_0x22eb('0x21')](handleError(_0x797700,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 6b57344..51d9311 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 _0xc052=['bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','voice_contexts','lodash','util','../../config/logger','moment'];(function(_0x5093c2,_0x438dc8){var _0x8bf2f9=function(_0xb0189d){while(--_0xb0189d){_0x5093c2['push'](_0x5093c2['shift']());}};_0x8bf2f9(++_0x438dc8);}(_0xc052,0x15c));var _0x2c05=function(_0x362e0b,_0x12b2ec){_0x362e0b=_0x362e0b-0x0;var _0x5b593a=_0xc052[_0x362e0b];return _0x5b593a;};'use strict';var _=require(_0x2c05('0x0'));var util=require(_0x2c05('0x1'));var logger=require(_0x2c05('0x2'))('api');var moment=require(_0x2c05('0x3'));var BPromise=require(_0x2c05('0x4'));var rp=require(_0x2c05('0x5'));var fs=require('fs');var path=require(_0x2c05('0x6'));var rimraf=require('rimraf');var config=require(_0x2c05('0x7'));var attributes=require(_0x2c05('0x8'));module[_0x2c05('0x9')]=function(_0x4b1506,_0x4fb93e){return _0x4b1506['define']('VoiceContext',attributes,{'tableName':_0x2c05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf309=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xf309,0xbc));var _0x9f30=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf309[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9f30('0x0'));var util=require(_0x9f30('0x1'));var logger=require(_0x9f30('0x2'))('api');var moment=require(_0x9f30('0x3'));var BPromise=require(_0x9f30('0x4'));var rp=require(_0x9f30('0x5'));var fs=require('fs');var path=require(_0x9f30('0x6'));var rimraf=require(_0x9f30('0x7'));var config=require(_0x9f30('0x8'));var attributes=require(_0x9f30('0x9'));module[_0x9f30('0xa')]=function(_0x2369a6,_0x736cad){return _0x2369a6[_0x9f30('0xb')](_0x9f30('0xc'),attributes,{'tableName':_0x9f30('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index bba76f1..e7675ab 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 _0x8066=['http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0xaeff8a,_0x506724){var _0x8a6ce3=function(_0x237855){while(--_0x237855){_0xaeff8a['push'](_0xaeff8a['shift']());}};_0x8a6ce3(++_0x506724);}(_0x8066,0x1c4));var _0x6806=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x8066[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rs=require(_0x6806('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6806('0x5'))['db'];var utils=require(_0x6806('0x6'));var logger=require('../../config/logger')(_0x6806('0x7'));var config=require(_0x6806('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6806('0x9')][_0x6806('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213473,_0x274943,_0x49450c){return new BPromise(function(_0x2efee8,_0x2d19b3){return client[_0x6806('0xb')](_0x213473,_0x49450c)['then'](function(_0x16232a){logger[_0x6806('0xc')](_0x6806('0xd'),_0x274943,_0x6806('0xe'));logger[_0x6806('0xf')](_0x6806('0x10'),_0x274943,_0x6806('0xe'),JSON[_0x6806('0x11')](_0x16232a));if(_0x16232a[_0x6806('0x12')]){if(_0x16232a[_0x6806('0x12')][_0x6806('0x13')]===0x1f4){logger[_0x6806('0x12')]('VoiceContext,\x20%s,\x20%s',_0x274943,_0x16232a['error'][_0x6806('0x14')]);return _0x2d19b3(_0x16232a['error'][_0x6806('0x14')]);}logger['error'](_0x6806('0xd'),_0x274943,_0x16232a[_0x6806('0x12')]['message']);return _0x2efee8(_0x16232a['error'][_0x6806('0x14')]);}else{logger['info'](_0x6806('0xd'),_0x274943,_0x6806('0xe'));_0x2efee8(_0x16232a['result'][_0x6806('0x14')]);}})[_0x6806('0x15')](function(_0x4d57cf){logger['error'](_0x6806('0xd'),_0x274943,_0x4d57cf);_0x2d19b3(_0x4d57cf);});});} \ No newline at end of file +var _0xe624=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x5b73ff,_0x1cba4d){var _0x1c4ba4=function(_0x319db1){while(--_0x319db1){_0x5b73ff['push'](_0x5b73ff['shift']());}};_0x1c4ba4(++_0x1cba4d);}(_0xe624,0x1ec));var _0x4e62=function(_0x3e3f27,_0x2c2ecf){_0x3e3f27=_0x3e3f27-0x0;var _0x15c868=_0xe624[_0x3e3f27];return _0x15c868;};'use strict';var _=require('lodash');var util=require(_0x4e62('0x0'));var moment=require(_0x4e62('0x1'));var BPromise=require(_0x4e62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e62('0x3'));var logger=require(_0x4e62('0x4'))(_0x4e62('0x5'));var config=require(_0x4e62('0x6'));var jayson=require(_0x4e62('0x7'));var client=jayson[_0x4e62('0x8')][_0x4e62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27f9b5,_0x497b0a,_0x48d78f){return new BPromise(function(_0x1252b6,_0x35af0a){return client[_0x4e62('0xa')](_0x27f9b5,_0x48d78f)['then'](function(_0x2400bd){logger[_0x4e62('0xb')](_0x4e62('0xc'),_0x497b0a,_0x4e62('0xd'));logger[_0x4e62('0xe')](_0x4e62('0xf'),_0x497b0a,_0x4e62('0xd'),JSON[_0x4e62('0x10')](_0x2400bd));if(_0x2400bd['error']){if(_0x2400bd['error'][_0x4e62('0x11')]===0x1f4){logger[_0x4e62('0x12')](_0x4e62('0xc'),_0x497b0a,_0x2400bd[_0x4e62('0x12')][_0x4e62('0x13')]);return _0x35af0a(_0x2400bd[_0x4e62('0x12')][_0x4e62('0x13')]);}logger[_0x4e62('0x12')](_0x4e62('0xc'),_0x497b0a,_0x2400bd[_0x4e62('0x12')][_0x4e62('0x13')]);return _0x1252b6(_0x2400bd[_0x4e62('0x12')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x497b0a,'request\x20sent');_0x1252b6(_0x2400bd[_0x4e62('0x14')][_0x4e62('0x13')]);}})[_0x4e62('0x15')](function(_0x3011dc){logger[_0x4e62('0x12')](_0x4e62('0xc'),_0x497b0a,_0x3011dc);_0x35af0a(_0x3011dc);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a16e7eb..e919d04 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 _0x7e79=['destroy','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x7e79,0x1ee));var _0x97e7=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7e79[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x97e7('0x0'));var util=require(_0x97e7('0x1'));var path=require('path');var timeout=require(_0x97e7('0x2'));var express=require(_0x97e7('0x3'));var router=express[_0x97e7('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x97e7('0x5'));var controller=require('./voiceDialReport.controller');router[_0x97e7('0x6')]('/',auth[_0x97e7('0x7')](),controller[_0x97e7('0x8')]);router[_0x97e7('0x6')](_0x97e7('0x9'),auth[_0x97e7('0x7')](),controller[_0x97e7('0xa')]);router['get']('/:id',auth[_0x97e7('0x7')](),controller['show']);router['post']('/',auth[_0x97e7('0x7')](),controller[_0x97e7('0xb')]);router[_0x97e7('0xc')](_0x97e7('0xd'),auth[_0x97e7('0x7')](),controller[_0x97e7('0xe')]);router[_0x97e7('0xf')](_0x97e7('0xd'),auth[_0x97e7('0x7')](),controller[_0x97e7('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe943=['../../components/interaction/service','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x543e6b,_0x218c9a){var _0xffb501=function(_0x8e7b6b){while(--_0x8e7b6b){_0x543e6b['push'](_0x543e6b['shift']());}};_0xffb501(++_0x218c9a);}(_0xe943,0x12a));var _0x3e94=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xe943[_0x1bb58c];return _0x277586;};'use strict';var multer=require(_0x3e94('0x0'));var util=require(_0x3e94('0x1'));var path=require('path');var timeout=require(_0x3e94('0x2'));var express=require(_0x3e94('0x3'));var router=express[_0x3e94('0x4')]();var auth=require(_0x3e94('0x5'));var interaction=require(_0x3e94('0x6'));var config=require('../../config/environment');var controller=require(_0x3e94('0x7'));router[_0x3e94('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e94('0x9')]);router[_0x3e94('0x8')](_0x3e94('0xa'),auth[_0x3e94('0xb')](),controller[_0x3e94('0xc')]);router[_0x3e94('0x8')]('/:id',auth[_0x3e94('0xb')](),controller['show']);router[_0x3e94('0xd')]('/',auth['isAuthenticated'](),controller[_0x3e94('0xe')]);router[_0x3e94('0xf')](_0x3e94('0x10'),auth['isAuthenticated'](),controller[_0x3e94('0x11')]);router['delete'](_0x3e94('0x10'),auth[_0x3e94('0xb')](),controller['destroy']);module[_0x3e94('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index b772bc7..f131a45 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 _0xad94=['called,connect,complete','STRING','INTEGER','DATE'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xad94,0x99));var _0x4ad9=function(_0x3f7004,_0x41fd2f){_0x3f7004=_0x3f7004-0x0;var _0x2529b0=_0xad94[_0x3f7004];return _0x2529b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x4ad9('0x0')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4ad9('0x1')]},'channelstatedesc':{'type':Sequelize[_0x4ad9('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4ad9('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4ad9('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4ad9('0x0')]},'exten':{'type':Sequelize[_0x4ad9('0x0')]},'priority':{'type':Sequelize[_0x4ad9('0x1')]},'uniqueid':{'type':Sequelize[_0x4ad9('0x0')]},'linkedid':{'type':Sequelize[_0x4ad9('0x0')]},'destchannel':{'type':Sequelize[_0x4ad9('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4ad9('0x0')]},'destcalleridnum':{'type':Sequelize[_0x4ad9('0x0')]},'destcalleridname':{'type':Sequelize[_0x4ad9('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x4ad9('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4ad9('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4ad9('0x0')]},'destcontext':{'type':Sequelize[_0x4ad9('0x0')]},'destexten':{'type':Sequelize[_0x4ad9('0x0')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x4ad9('0x0')]},'destlinkedid':{'type':Sequelize[_0x4ad9('0x0')]},'dialstring':{'type':Sequelize[_0x4ad9('0x0')]},'dialstatus':{'type':Sequelize[_0x4ad9('0x0')]},'starttime':{'type':Sequelize[_0x4ad9('0x2')]},'answertime':{'type':Sequelize[_0x4ad9('0x2')]},'endtime':{'type':Sequelize[_0x4ad9('0x2')]},'lastevent':{'type':Sequelize[_0x4ad9('0x0')],'comment':_0x4ad9('0x3')},'routeId':{'type':Sequelize[_0x4ad9('0x1')]},'duration':{'type':Sequelize[_0x4ad9('0x1')]},'holdtime':{'type':Sequelize[_0x4ad9('0x1')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x34c0=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2d6f37,_0x59a4ca){var _0x1e5f40=function(_0x47b824){while(--_0x47b824){_0x2d6f37['push'](_0x2d6f37['shift']());}};_0x1e5f40(++_0x59a4ca);}(_0x34c0,0x66));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x034c('0x0'));module[_0x034c('0x1')]={'privilege':{'type':Sequelize[_0x034c('0x2')]},'channel':{'type':Sequelize[_0x034c('0x2')]},'channelstate':{'type':Sequelize[_0x034c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x034c('0x2')]},'calleridnum':{'type':Sequelize[_0x034c('0x2')]},'calleridname':{'type':Sequelize[_0x034c('0x2')]},'connectedlinenum':{'type':Sequelize[_0x034c('0x2')]},'connectedlinename':{'type':Sequelize[_0x034c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x034c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x034c('0x2')]},'priority':{'type':Sequelize[_0x034c('0x3')]},'uniqueid':{'type':Sequelize[_0x034c('0x2')]},'linkedid':{'type':Sequelize[_0x034c('0x2')]},'destchannel':{'type':Sequelize[_0x034c('0x2')]},'destchannelstate':{'type':Sequelize[_0x034c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x034c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x034c('0x2')]},'destcalleridname':{'type':Sequelize[_0x034c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x034c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x034c('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x034c('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x034c('0x2')]},'destlinkedid':{'type':Sequelize[_0x034c('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x034c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x034c('0x4')]},'lastevent':{'type':Sequelize[_0x034c('0x2')],'comment':_0x034c('0x5')},'routeId':{'type':Sequelize[_0x034c('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x034c('0x3')]},'billableseconds':{'type':Sequelize[_0x034c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index dad365d..bd280e6 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 _0x5430=['include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','VoiceDialReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','params'];(function(_0x4aabf3,_0x1047c8){var _0x74ae71=function(_0x236ea7){while(--_0x236ea7){_0x4aabf3['push'](_0x4aabf3['shift']());}};_0x74ae71(++_0x1047c8);}(_0x5430,0x12e));var _0x0543=function(_0x3c6e3a,_0x5d8ec3){_0x3c6e3a=_0x3c6e3a-0x0;var _0x38c558=_0x5430[_0x3c6e3a];return _0x38c558;};'use strict';var pdf=require(_0x0543('0x0'));var emlformat=require(_0x0543('0x1'));var rimraf=require(_0x0543('0x2'));var zipdir=require(_0x0543('0x3'));var jsonpatch=require(_0x0543('0x4'));var rp=require(_0x0543('0x5'));var moment=require(_0x0543('0x6'));var BPromise=require(_0x0543('0x7'));var Mustache=require(_0x0543('0x8'));var util=require(_0x0543('0x9'));var path=require(_0x0543('0xa'));var sox=require(_0x0543('0xb'));var csv=require(_0x0543('0xc'));var ejs=require(_0x0543('0xd'));var fs=require('fs');var _=require(_0x0543('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0543('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0543('0x10'));var Papa=require(_0x0543('0x11'));var Redis=require(_0x0543('0x12'));var authService=require(_0x0543('0x13'));var qs=require(_0x0543('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x15'))(_0x0543('0x16'));var utils=require(_0x0543('0x17'));var config=require(_0x0543('0x18'));var db=require(_0x0543('0x19'))['db'];function respondWithStatusCode(_0x30a558,_0x1a2925){_0x1a2925=_0x1a2925||0xcc;return function(_0x461469){if(_0x461469){return _0x30a558[_0x0543('0x1a')](_0x1a2925);}return _0x30a558[_0x0543('0x1b')](_0x1a2925)[_0x0543('0x1c')]();};}function respondWithResult(_0x41b475,_0x10f32b){_0x10f32b=_0x10f32b||0xc8;return function(_0x3ca4ca){if(_0x3ca4ca){return _0x41b475[_0x0543('0x1b')](_0x10f32b)[_0x0543('0x1d')](_0x3ca4ca);}};}function respondWithFilteredResult(_0x2f47c2,_0x53c00c){return function(_0x1dd93f){if(_0x1dd93f){var _0x1c4d74=_0x1dd93f[_0x0543('0x1e')],_0x151ae8=_0x53c00c[_0x0543('0x1f')],_0x55eac7=_0x53c00c[_0x0543('0x1f')]+_0x53c00c[_0x0543('0x20')],_0x2a2ef5;if(_0x55eac7>=_0x1c4d74){_0x55eac7=_0x1c4d74;_0x2a2ef5=0xc8;}else{_0x2a2ef5=0xce;}_0x2f47c2[_0x0543('0x1b')](_0x2a2ef5);return _0x2f47c2['set'](_0x0543('0x21'),_0x151ae8+'-'+_0x55eac7+'/'+_0x1c4d74)[_0x0543('0x1d')](_0x1dd93f);}return null;};}function patchUpdates(_0x44f6a4){return function(_0x157c69){try{jsonpatch[_0x0543('0x22')](_0x157c69,_0x44f6a4,!![]);}catch(_0x4655a0){return BPromise[_0x0543('0x23')](_0x4655a0);}return _0x157c69[_0x0543('0x24')]();};}function saveUpdates(_0x5d73a6,_0x350966){return function(_0x5a7562){if(_0x5a7562){return _0x5a7562[_0x0543('0x25')](_0x5d73a6)[_0x0543('0x26')](function(_0x232be5){return _0x232be5;});}return null;};}function removeEntity(_0x3614b2,_0x432f72){return function(_0x405753){if(_0x405753){return _0x405753['destroy']()[_0x0543('0x26')](function(){_0x3614b2[_0x0543('0x1b')](0xcc)[_0x0543('0x1c')]();});}};}function handleEntityNotFound(_0x2d8078,_0xb0bde7){return function(_0x5031c6){if(!_0x5031c6){_0x2d8078[_0x0543('0x1a')](0x194);}return _0x5031c6;};}function handleError(_0x3497f6,_0x2c7c7d){_0x2c7c7d=_0x2c7c7d||0x1f4;return function(_0x9fe7ab){logger[_0x0543('0x27')](_0x9fe7ab[_0x0543('0x28')]);if(_0x9fe7ab[_0x0543('0x29')]){delete _0x9fe7ab[_0x0543('0x29')];}_0x3497f6['status'](_0x2c7c7d)['send'](_0x9fe7ab);};}exports[_0x0543('0x2a')]=function(_0xb6e427,_0x3882a1){var _0x5bb709={},_0x8bf5b7={},_0x2cdcf6={'count':0x0,'rows':[]};var _0x208451=db[_0x0543('0x2b')]['rawAttributes'];_0x8bf5b7[_0x0543('0x2c')]=_[_0x0543('0x2d')](_0x208451);_0x8bf5b7['query']=_[_0x0543('0x2d')](_0xb6e427[_0x0543('0x2e')]);_0x8bf5b7[_0x0543('0x2f')]=_[_0x0543('0x30')](_0x8bf5b7['model'],_0x8bf5b7[_0x0543('0x2e')]);_0x5bb709[_0x0543('0x31')]=_[_0x0543('0x30')](_0x8bf5b7[_0x0543('0x2c')],qs[_0x0543('0x32')](_0xb6e427[_0x0543('0x2e')][_0x0543('0x32')]));_0x5bb709[_0x0543('0x31')]=_0x5bb709['attributes'][_0x0543('0x33')]?_0x5bb709[_0x0543('0x31')]:_0x8bf5b7['model'];if(!_0xb6e427[_0x0543('0x2e')][_0x0543('0x34')](_0x0543('0x35'))){_0x5bb709[_0x0543('0x20')]=qs[_0x0543('0x20')](_0xb6e427['query'][_0x0543('0x20')]);_0x5bb709[_0x0543('0x1f')]=qs[_0x0543('0x1f')](_0xb6e427['query'][_0x0543('0x1f')]);}_0x5bb709['order']=qs[_0x0543('0x36')](_0xb6e427['query'][_0x0543('0x36')]);_0x5bb709[_0x0543('0x37')]=qs[_0x0543('0x2f')](_[_0x0543('0x38')](_0xb6e427[_0x0543('0x2e')],_0x8bf5b7[_0x0543('0x2f')]));if(_0xb6e427[_0x0543('0x2e')][_0x0543('0x39')]){_0x5bb709[_0x0543('0x37')]=_[_0x0543('0x3a')](_0x5bb709['where'],{'$or':_[_0x0543('0x3b')](_0x208451,function(_0x3fe107){if(_0x3fe107[_0x0543('0x3c')]['key']!==_0x0543('0x3d')){var _0x5a015d={};_0x5a015d[_0x3fe107['field']]={'$like':'%'+_0xb6e427['query'][_0x0543('0x39')]+'%'};return _0x5a015d;}})});}_0x5bb709=_[_0x0543('0x3a')]({},_0x5bb709,_0xb6e427[_0x0543('0x3e')]);var _0x44fdbe={'where':_0x5bb709[_0x0543('0x37')]};return db[_0x0543('0x2b')][_0x0543('0x1e')](_0x44fdbe)['then'](function(_0x31eb62){_0x2cdcf6['count']=_0x31eb62;if(_0xb6e427[_0x0543('0x2e')][_0x0543('0x3f')]){_0x5bb709['include']=[{'all':!![]}];}return db[_0x0543('0x2b')][_0x0543('0x40')](_0x5bb709);})['then'](function(_0x558b22){_0x2cdcf6[_0x0543('0x41')]=_0x558b22;return _0x2cdcf6;})['then'](respondWithFilteredResult(_0x3882a1,_0x5bb709))[_0x0543('0x42')](handleError(_0x3882a1,null));};exports['show']=function(_0x564213,_0x53a8c4){var _0x1fb6a9={'raw':!![],'where':{'id':_0x564213[_0x0543('0x43')]['id']}},_0x5637d5={};_0x5637d5['model']=_[_0x0543('0x2d')](db[_0x0543('0x2b')]['rawAttributes']);_0x5637d5[_0x0543('0x2e')]=_['keys'](_0x564213[_0x0543('0x2e')]);_0x5637d5[_0x0543('0x2f')]=_[_0x0543('0x30')](_0x5637d5[_0x0543('0x2c')],_0x5637d5['query']);_0x1fb6a9['attributes']=_['intersection'](_0x5637d5[_0x0543('0x2c')],qs[_0x0543('0x32')](_0x564213['query']['fields']));_0x1fb6a9[_0x0543('0x31')]=_0x1fb6a9[_0x0543('0x31')][_0x0543('0x33')]?_0x1fb6a9['attributes']:_0x5637d5[_0x0543('0x2c')];if(_0x564213[_0x0543('0x2e')][_0x0543('0x3f')]){_0x1fb6a9[_0x0543('0x44')]=[{'all':!![]}];}_0x1fb6a9=_[_0x0543('0x3a')]({},_0x1fb6a9,_0x564213[_0x0543('0x3e')]);return db[_0x0543('0x2b')][_0x0543('0x45')](_0x1fb6a9)[_0x0543('0x26')](handleEntityNotFound(_0x53a8c4,null))[_0x0543('0x26')](respondWithResult(_0x53a8c4,null))['catch'](handleError(_0x53a8c4,null));};exports['create']=function(_0x1bf3e8,_0x4b1f43){return db[_0x0543('0x2b')][_0x0543('0x46')](_0x1bf3e8[_0x0543('0x47')],{})['then'](respondWithResult(_0x4b1f43,0xc9))['catch'](handleError(_0x4b1f43,null));};exports[_0x0543('0x25')]=function(_0x503e01,_0x497477){if(_0x503e01[_0x0543('0x47')]['id']){delete _0x503e01['body']['id'];}return db[_0x0543('0x2b')][_0x0543('0x45')]({'where':{'id':_0x503e01[_0x0543('0x43')]['id']}})[_0x0543('0x26')](handleEntityNotFound(_0x497477,null))[_0x0543('0x26')](saveUpdates(_0x503e01[_0x0543('0x47')],null))[_0x0543('0x26')](respondWithResult(_0x497477,null))[_0x0543('0x42')](handleError(_0x497477,null));};exports[_0x0543('0x48')]=function(_0x3d41fd,_0x48c26e){return db['VoiceDialReport'][_0x0543('0x45')]({'where':{'id':_0x3d41fd['params']['id']}})[_0x0543('0x26')](handleEntityNotFound(_0x48c26e,null))[_0x0543('0x26')](removeEntity(_0x48c26e,null))[_0x0543('0x42')](handleError(_0x48c26e,null));};exports[_0x0543('0x49')]=function(_0x47806a,_0x2f0fb0){return db[_0x0543('0x2b')][_0x0543('0x49')]()[_0x0543('0x26')](respondWithResult(_0x2f0fb0,null))['catch'](handleError(_0x2f0fb0,null));}; \ No newline at end of file +var _0xc03d=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','VoiceDialReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','type','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x545c72,_0x1c7b93){var _0x4b8d04=function(_0x406f14){while(--_0x406f14){_0x545c72['push'](_0x545c72['shift']());}};_0x4b8d04(++_0x1c7b93);}(_0xc03d,0x1be));var _0xdc03=function(_0x409d27,_0x9ba356){_0x409d27=_0x409d27-0x0;var _0x3ef1fa=_0xc03d[_0x409d27];return _0x3ef1fa;};'use strict';var pdf=require(_0xdc03('0x0'));var emlformat=require(_0xdc03('0x1'));var rimraf=require(_0xdc03('0x2'));var zipdir=require(_0xdc03('0x3'));var jsonpatch=require(_0xdc03('0x4'));var rp=require(_0xdc03('0x5'));var moment=require(_0xdc03('0x6'));var BPromise=require(_0xdc03('0x7'));var Mustache=require(_0xdc03('0x8'));var util=require('util');var path=require(_0xdc03('0x9'));var sox=require(_0xdc03('0xa'));var csv=require(_0xdc03('0xb'));var ejs=require(_0xdc03('0xc'));var fs=require('fs');var _=require(_0xdc03('0xd'));var squel=require(_0xdc03('0xe'));var crypto=require('crypto');var jsforce=require(_0xdc03('0xf'));var deskjs=require(_0xdc03('0x10'));var toCsv=require(_0xdc03('0xb'));var querystring=require(_0xdc03('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdc03('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdc03('0x13'));var logger=require(_0xdc03('0x14'))(_0xdc03('0x15'));var utils=require(_0xdc03('0x16'));var config=require(_0xdc03('0x17'));var db=require(_0xdc03('0x18'))['db'];function respondWithStatusCode(_0x4a1a00,_0x3eacc1){_0x3eacc1=_0x3eacc1||0xcc;return function(_0xad581f){if(_0xad581f){return _0x4a1a00[_0xdc03('0x19')](_0x3eacc1);}return _0x4a1a00[_0xdc03('0x1a')](_0x3eacc1)[_0xdc03('0x1b')]();};}function respondWithResult(_0x1b990d,_0x2e4013){_0x2e4013=_0x2e4013||0xc8;return function(_0x3ba1da){if(_0x3ba1da){return _0x1b990d[_0xdc03('0x1a')](_0x2e4013)[_0xdc03('0x1c')](_0x3ba1da);}};}function respondWithFilteredResult(_0x823e6,_0x12486a){return function(_0x2cb6ad){if(_0x2cb6ad){var _0x2e105d=_0x2cb6ad[_0xdc03('0x1d')],_0xd65623=_0x12486a[_0xdc03('0x1e')],_0x5aab48=_0x12486a[_0xdc03('0x1e')]+_0x12486a[_0xdc03('0x1f')],_0x991ea1;if(_0x5aab48>=_0x2e105d){_0x5aab48=_0x2e105d;_0x991ea1=0xc8;}else{_0x991ea1=0xce;}_0x823e6['status'](_0x991ea1);return _0x823e6[_0xdc03('0x20')](_0xdc03('0x21'),_0xd65623+'-'+_0x5aab48+'/'+_0x2e105d)[_0xdc03('0x1c')](_0x2cb6ad);}return null;};}function patchUpdates(_0x4bb4f2){return function(_0x52a4a6){try{jsonpatch[_0xdc03('0x22')](_0x52a4a6,_0x4bb4f2,!![]);}catch(_0xda16d7){return BPromise[_0xdc03('0x23')](_0xda16d7);}return _0x52a4a6[_0xdc03('0x24')]();};}function saveUpdates(_0x60fdef,_0x37f18e){return function(_0x3f0dce){if(_0x3f0dce){return _0x3f0dce[_0xdc03('0x25')](_0x60fdef)[_0xdc03('0x26')](function(_0x315796){return _0x315796;});}return null;};}function removeEntity(_0x4f6186,_0x1c629e){return function(_0x2b6fa0){if(_0x2b6fa0){return _0x2b6fa0['destroy']()['then'](function(){_0x4f6186['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ba53,_0x6199f){return function(_0x517f28){if(!_0x517f28){_0x45ba53[_0xdc03('0x19')](0x194);}return _0x517f28;};}function handleError(_0x2467cf,_0x5f54d6){_0x5f54d6=_0x5f54d6||0x1f4;return function(_0x336fce){logger[_0xdc03('0x27')](_0x336fce[_0xdc03('0x28')]);if(_0x336fce[_0xdc03('0x29')]){delete _0x336fce[_0xdc03('0x29')];}_0x2467cf[_0xdc03('0x1a')](_0x5f54d6)['send'](_0x336fce);};}exports[_0xdc03('0x2a')]=function(_0x59c490,_0x102ed2){var _0x2eaf1d={},_0x9fb3f1={},_0x45abbf={'count':0x0,'rows':[]};var _0x2d9944=db[_0xdc03('0x2b')][_0xdc03('0x2c')];_0x9fb3f1[_0xdc03('0x2d')]=_[_0xdc03('0x2e')](_0x2d9944);_0x9fb3f1[_0xdc03('0x2f')]=_['keys'](_0x59c490['query']);_0x9fb3f1[_0xdc03('0x30')]=_[_0xdc03('0x31')](_0x9fb3f1['model'],_0x9fb3f1['query']);_0x2eaf1d[_0xdc03('0x32')]=_['intersection'](_0x9fb3f1[_0xdc03('0x2d')],qs[_0xdc03('0x33')](_0x59c490[_0xdc03('0x2f')][_0xdc03('0x33')]));_0x2eaf1d[_0xdc03('0x32')]=_0x2eaf1d[_0xdc03('0x32')]['length']?_0x2eaf1d[_0xdc03('0x32')]:_0x9fb3f1[_0xdc03('0x2d')];if(!_0x59c490['query']['hasOwnProperty'](_0xdc03('0x34'))){_0x2eaf1d[_0xdc03('0x1f')]=qs[_0xdc03('0x1f')](_0x59c490['query'][_0xdc03('0x1f')]);_0x2eaf1d[_0xdc03('0x1e')]=qs[_0xdc03('0x1e')](_0x59c490[_0xdc03('0x2f')][_0xdc03('0x1e')]);}_0x2eaf1d[_0xdc03('0x35')]=qs['sort'](_0x59c490[_0xdc03('0x2f')]['sort']);_0x2eaf1d[_0xdc03('0x36')]=qs[_0xdc03('0x30')](_[_0xdc03('0x37')](_0x59c490[_0xdc03('0x2f')],_0x9fb3f1[_0xdc03('0x30')]));if(_0x59c490['query'][_0xdc03('0x38')]){_0x2eaf1d[_0xdc03('0x36')]=_[_0xdc03('0x39')](_0x2eaf1d[_0xdc03('0x36')],{'$or':_['map'](_0x2d9944,function(_0x3a7030){if(_0x3a7030[_0xdc03('0x3a')][_0xdc03('0x3b')]!==_0xdc03('0x3c')){var _0x4d3636={};_0x4d3636[_0x3a7030['field']]={'$like':'%'+_0x59c490['query'][_0xdc03('0x38')]+'%'};return _0x4d3636;}})});}_0x2eaf1d=_[_0xdc03('0x39')]({},_0x2eaf1d,_0x59c490['options']);var _0x373b7e={'where':_0x2eaf1d['where']};return db[_0xdc03('0x2b')]['count'](_0x373b7e)[_0xdc03('0x26')](function(_0x25a332){_0x45abbf[_0xdc03('0x1d')]=_0x25a332;if(_0x59c490[_0xdc03('0x2f')][_0xdc03('0x3d')]){_0x2eaf1d[_0xdc03('0x3e')]=[{'all':!![]}];}return db[_0xdc03('0x2b')][_0xdc03('0x3f')](_0x2eaf1d);})['then'](function(_0x1359d8){_0x45abbf[_0xdc03('0x40')]=_0x1359d8;return _0x45abbf;})[_0xdc03('0x26')](respondWithFilteredResult(_0x102ed2,_0x2eaf1d))[_0xdc03('0x41')](handleError(_0x102ed2,null));};exports[_0xdc03('0x42')]=function(_0x26ba28,_0x5d0af0){var _0x14f7c5={'raw':!![],'where':{'id':_0x26ba28[_0xdc03('0x43')]['id']}},_0x5b3e96={};_0x5b3e96[_0xdc03('0x2d')]=_[_0xdc03('0x2e')](db[_0xdc03('0x2b')][_0xdc03('0x2c')]);_0x5b3e96[_0xdc03('0x2f')]=_[_0xdc03('0x2e')](_0x26ba28[_0xdc03('0x2f')]);_0x5b3e96[_0xdc03('0x30')]=_[_0xdc03('0x31')](_0x5b3e96[_0xdc03('0x2d')],_0x5b3e96['query']);_0x14f7c5[_0xdc03('0x32')]=_[_0xdc03('0x31')](_0x5b3e96[_0xdc03('0x2d')],qs[_0xdc03('0x33')](_0x26ba28['query']['fields']));_0x14f7c5[_0xdc03('0x32')]=_0x14f7c5[_0xdc03('0x32')][_0xdc03('0x44')]?_0x14f7c5[_0xdc03('0x32')]:_0x5b3e96[_0xdc03('0x2d')];if(_0x26ba28[_0xdc03('0x2f')][_0xdc03('0x3d')]){_0x14f7c5['include']=[{'all':!![]}];}_0x14f7c5=_[_0xdc03('0x39')]({},_0x14f7c5,_0x26ba28[_0xdc03('0x45')]);return db[_0xdc03('0x2b')][_0xdc03('0x46')](_0x14f7c5)[_0xdc03('0x26')](handleEntityNotFound(_0x5d0af0,null))[_0xdc03('0x26')](respondWithResult(_0x5d0af0,null))[_0xdc03('0x41')](handleError(_0x5d0af0,null));};exports[_0xdc03('0x47')]=function(_0x5b895f,_0x13c2cf){return db[_0xdc03('0x2b')][_0xdc03('0x47')](_0x5b895f[_0xdc03('0x48')],{})[_0xdc03('0x26')](respondWithResult(_0x13c2cf,0xc9))[_0xdc03('0x41')](handleError(_0x13c2cf,null));};exports[_0xdc03('0x25')]=function(_0x2a1b2,_0x205757){if(_0x2a1b2[_0xdc03('0x48')]['id']){delete _0x2a1b2['body']['id'];}return db['VoiceDialReport'][_0xdc03('0x46')]({'where':{'id':_0x2a1b2[_0xdc03('0x43')]['id']}})['then'](handleEntityNotFound(_0x205757,null))[_0xdc03('0x26')](saveUpdates(_0x2a1b2[_0xdc03('0x48')],null))[_0xdc03('0x26')](respondWithResult(_0x205757,null))[_0xdc03('0x41')](handleError(_0x205757,null));};exports[_0xdc03('0x49')]=function(_0x18a6bd,_0xeb3a17){return db[_0xdc03('0x2b')][_0xdc03('0x46')]({'where':{'id':_0x18a6bd[_0xdc03('0x43')]['id']}})[_0xdc03('0x26')](handleEntityNotFound(_0xeb3a17,null))[_0xdc03('0x26')](removeEntity(_0xeb3a17,null))['catch'](handleError(_0xeb3a17,null));};exports[_0xdc03('0x4a')]=function(_0x31b8a5,_0x1818d9){return db['VoiceDialReport'][_0xdc03('0x4a')]()[_0xdc03('0x26')](respondWithResult(_0x1818d9,null))['catch'](handleError(_0x1818d9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c759446..19c5c72 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 _0x0439=['rimraf','../../config/environment','./voiceDialReport.attributes','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd2a556,_0x4064bc){var _0x3121ce=function(_0x2b5c33){while(--_0x2b5c33){_0xd2a556['push'](_0xd2a556['shift']());}};_0x3121ce(++_0x4064bc);}(_0x0439,0xdd));var _0x9043=function(_0x6cdb11,_0x24489f){_0x6cdb11=_0x6cdb11-0x0;var _0x17f70a=_0x0439[_0x6cdb11];return _0x17f70a;};'use strict';var _=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var logger=require(_0x9043('0x2'))(_0x9043('0x3'));var moment=require(_0x9043('0x4'));var BPromise=require(_0x9043('0x5'));var rp=require(_0x9043('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9043('0x7'));var config=require(_0x9043('0x8'));var attributes=require(_0x9043('0x9'));module['exports']=function(_0x3a1c0e,_0x5ea31e){return _0x3a1c0e['define'](_0x9043('0xa'),attributes,{'tableName':_0x9043('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fcf=['VoiceDialReport','uniqueid','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x5d41b6,_0x7d68ec){var _0x1a38da=function(_0x22c5da){while(--_0x22c5da){_0x5d41b6['push'](_0x5d41b6['shift']());}};_0x1a38da(++_0x7d68ec);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x16a84d,_0xf49bd4){_0x16a84d=_0x16a84d-0x0;var _0x175c58=_0x8fcf[_0x16a84d];return _0x175c58;};'use strict';var _=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var logger=require(_0xf8fc('0x2'))('api');var moment=require(_0xf8fc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf8fc('0x4'));var config=require(_0xf8fc('0x5'));var attributes=require(_0xf8fc('0x6'));module[_0xf8fc('0x7')]=function(_0x33fdc1,_0x292131){return _0x33fdc1[_0xf8fc('0x8')](_0xf8fc('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xf8fc('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 9711cbe..39ad547 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 _0xc999=['moment','bluebird','../../config/logger','../../config/environment','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateVoiceDialReport','options','raw','catch','UpdateVoiceDialReport','body','where','util'];(function(_0x53d7a7,_0x4b5bcc){var _0x12f81c=function(_0x4b6486){while(--_0x4b6486){_0x53d7a7['push'](_0x53d7a7['shift']());}};_0x12f81c(++_0x4b5bcc);}(_0xc999,0x176));var _0x9c99=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0xc999[_0xd0cd0b];return _0x59cced;};'use strict';var _=require('lodash');var util=require(_0x9c99('0x0'));var moment=require(_0x9c99('0x1'));var BPromise=require(_0x9c99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9c99('0x3'))('rpc');var config=require(_0x9c99('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9c99('0x5')][_0x9c99('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe80252,_0x47bfaa,_0xfa25e1){return new BPromise(function(_0x323317,_0x326099){return client[_0x9c99('0x7')](_0xe80252,_0xfa25e1)[_0x9c99('0x8')](function(_0xfe5788){logger['info'](_0x9c99('0x9'),_0x47bfaa,_0x9c99('0xa'));logger[_0x9c99('0xb')](_0x9c99('0xc'),_0x47bfaa,'request\x20sent',JSON[_0x9c99('0xd')](_0xfe5788));if(_0xfe5788[_0x9c99('0xe')]){if(_0xfe5788[_0x9c99('0xe')]['code']===0x1f4){logger[_0x9c99('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x47bfaa,_0xfe5788['error'][_0x9c99('0xf')]);return _0x326099(_0xfe5788[_0x9c99('0xe')][_0x9c99('0xf')]);}logger[_0x9c99('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x47bfaa,_0xfe5788[_0x9c99('0xe')]['message']);return _0x323317(_0xfe5788['error']['message']);}else{logger[_0x9c99('0x10')](_0x9c99('0x9'),_0x47bfaa,'request\x20sent');_0x323317(_0xfe5788[_0x9c99('0x11')]['message']);}})['catch'](function(_0x413965){logger[_0x9c99('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x47bfaa,_0x413965);_0x326099(_0x413965);});});}exports[_0x9c99('0x12')]=function(_0x436e43){var _0x5eaa11=this;return new Promise(function(_0x1a6f0e,_0x1cc5ea){return db['VoiceDialReport']['create'](_0x436e43['body'],{'raw':_0x436e43['options']?_0x436e43[_0x9c99('0x13')][_0x9c99('0x14')]===undefined?!![]:![]:!![]})[_0x9c99('0x8')](function(_0x45b1da){logger[_0x9c99('0x10')](_0x9c99('0x12'),_0x436e43);logger['debug'](_0x9c99('0x12'),_0x436e43,JSON[_0x9c99('0xd')](_0x45b1da));_0x1a6f0e(_0x45b1da);})[_0x9c99('0x15')](function(_0x2c299e){logger[_0x9c99('0xe')](_0x9c99('0x12'),_0x2c299e[_0x9c99('0xf')],_0x436e43);_0x1cc5ea(_0x5eaa11[_0x9c99('0xe')](0x1f4,_0x2c299e[_0x9c99('0xf')]));});});};exports[_0x9c99('0x16')]=function(_0x358b43){var _0x10c771=this;return new Promise(function(_0x2688f8,_0x264dfe){return db['VoiceDialReport']['update'](_0x358b43[_0x9c99('0x17')],{'raw':_0x358b43['options']?_0x358b43[_0x9c99('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x358b43[_0x9c99('0x13')]?_0x358b43[_0x9c99('0x13')][_0x9c99('0x18')]||null:null,'attributes':_0x358b43[_0x9c99('0x13')]?_0x358b43[_0x9c99('0x13')]['attributes']||null:null,'limit':_0x358b43[_0x9c99('0x13')]?_0x358b43['options']['limit']||null:null})[_0x9c99('0x8')](function(_0xfe5d3a){logger[_0x9c99('0x10')](_0x9c99('0x16'),_0x358b43);logger[_0x9c99('0xb')](_0x9c99('0x16'),_0x358b43,JSON['stringify'](_0xfe5d3a));_0x2688f8(_0xfe5d3a);})[_0x9c99('0x15')](function(_0x53ca44){logger[_0x9c99('0xe')]('UpdateVoiceDialReport',_0x53ca44[_0x9c99('0xf')],_0x358b43);_0x264dfe(_0x10c771[_0x9c99('0xe')](0x1f4,_0x53ca44[_0x9c99('0xf')]));});});}; \ No newline at end of file +var _0x97a2=['update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','debug','UpdateVoiceDialReport'];(function(_0x3be978,_0x44664c){var _0x18e0cb=function(_0x1d2d19){while(--_0x1d2d19){_0x3be978['push'](_0x3be978['shift']());}};_0x18e0cb(++_0x44664c);}(_0x97a2,0x1b1));var _0x297a=function(_0x5a0adc,_0x40a653){_0x5a0adc=_0x5a0adc-0x0;var _0x120055=_0x97a2[_0x5a0adc];return _0x120055;};'use strict';var _=require(_0x297a('0x0'));var util=require('util');var moment=require(_0x297a('0x1'));var BPromise=require(_0x297a('0x2'));var rs=require(_0x297a('0x3'));var fs=require('fs');var Redis=require(_0x297a('0x4'));var db=require(_0x297a('0x5'))['db'];var utils=require(_0x297a('0x6'));var logger=require(_0x297a('0x7'))(_0x297a('0x8'));var config=require('../../config/environment');var jayson=require(_0x297a('0x9'));var client=jayson[_0x297a('0xa')][_0x297a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8cbc92,_0x43a7d7,_0x3d9c6a){return new BPromise(function(_0x5ab57b,_0x38b066){return client[_0x297a('0xc')](_0x8cbc92,_0x3d9c6a)[_0x297a('0xd')](function(_0xbf6378){logger[_0x297a('0xe')](_0x297a('0xf'),_0x43a7d7,'request\x20sent');logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x43a7d7,_0x297a('0x10'),JSON[_0x297a('0x11')](_0xbf6378));if(_0xbf6378[_0x297a('0x12')]){if(_0xbf6378[_0x297a('0x12')]['code']===0x1f4){logger[_0x297a('0x12')](_0x297a('0xf'),_0x43a7d7,_0xbf6378[_0x297a('0x12')][_0x297a('0x13')]);return _0x38b066(_0xbf6378[_0x297a('0x12')][_0x297a('0x13')]);}logger[_0x297a('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x43a7d7,_0xbf6378['error'][_0x297a('0x13')]);return _0x5ab57b(_0xbf6378['error'][_0x297a('0x13')]);}else{logger[_0x297a('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x43a7d7,_0x297a('0x10'));_0x5ab57b(_0xbf6378[_0x297a('0x14')]['message']);}})[_0x297a('0x15')](function(_0x333868){logger[_0x297a('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x43a7d7,_0x333868);_0x38b066(_0x333868);});});}exports[_0x297a('0x16')]=function(_0x3af847){var _0x29c6d6=this;return new Promise(function(_0x4d6194,_0xba3b73){return db[_0x297a('0x17')]['create'](_0x3af847[_0x297a('0x18')],{'raw':_0x3af847[_0x297a('0x19')]?_0x3af847[_0x297a('0x19')][_0x297a('0x1a')]===undefined?!![]:![]:!![]})[_0x297a('0xd')](function(_0xde6d1c){logger[_0x297a('0xe')](_0x297a('0x16'),_0x3af847);logger[_0x297a('0x1b')](_0x297a('0x16'),_0x3af847,JSON[_0x297a('0x11')](_0xde6d1c));_0x4d6194(_0xde6d1c);})[_0x297a('0x15')](function(_0x481f59){logger['error']('CreateVoiceDialReport',_0x481f59[_0x297a('0x13')],_0x3af847);_0xba3b73(_0x29c6d6[_0x297a('0x12')](0x1f4,_0x481f59['message']));});});};exports[_0x297a('0x1c')]=function(_0x40919d){var _0x2de036=this;return new Promise(function(_0x1cfe08,_0x519f3b){return db[_0x297a('0x17')][_0x297a('0x1d')](_0x40919d[_0x297a('0x18')],{'raw':_0x40919d['options']?_0x40919d[_0x297a('0x19')][_0x297a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40919d[_0x297a('0x19')]?_0x40919d[_0x297a('0x19')][_0x297a('0x1e')]||null:null,'attributes':_0x40919d[_0x297a('0x19')]?_0x40919d[_0x297a('0x19')][_0x297a('0x1f')]||null:null,'limit':_0x40919d[_0x297a('0x19')]?_0x40919d[_0x297a('0x19')][_0x297a('0x20')]||null:null})['then'](function(_0x26e263){logger[_0x297a('0xe')](_0x297a('0x1c'),_0x40919d);logger['debug']('UpdateVoiceDialReport',_0x40919d,JSON[_0x297a('0x11')](_0x26e263));_0x1cfe08(_0x26e263);})[_0x297a('0x15')](function(_0x40cc4d){logger[_0x297a('0x12')](_0x297a('0x1c'),_0x40cc4d[_0x297a('0x13')],_0x40919d);_0x519f3b(_0x2de036['error'](0x1f4,_0x40cc4d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a3b6e57..2f02f9a 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 _0xd4dc=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','addApplications','/:id'];(function(_0x3666dc,_0x18701a){var _0x31c942=function(_0x315164){while(--_0x315164){_0x3666dc['push'](_0x3666dc['shift']());}};_0x31c942(++_0x18701a);}(_0xd4dc,0xff));var _0xcd4d=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xd4dc[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0xcd4d('0x0'));var util=require('util');var path=require(_0xcd4d('0x1'));var timeout=require(_0xcd4d('0x2'));var express=require(_0xcd4d('0x3'));var router=express[_0xcd4d('0x4')]();var auth=require(_0xcd4d('0x5'));var interaction=require(_0xcd4d('0x6'));var config=require(_0xcd4d('0x7'));var controller=require('./voiceExtension.controller');router[_0xcd4d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd4d('0x8')]('/:id',auth[_0xcd4d('0x9')](),controller[_0xcd4d('0xa')]);router[_0xcd4d('0xb')]('/',auth[_0xcd4d('0x9')](),controller[_0xcd4d('0xc')]);router['post']('/:id/applications',auth[_0xcd4d('0x9')](),controller[_0xcd4d('0xd')]);router['put'](_0xcd4d('0xe'),auth[_0xcd4d('0x9')](),controller[_0xcd4d('0xf')]);router['delete'](_0xcd4d('0xe'),auth['isAuthenticated'](),controller[_0xcd4d('0x10')]);module[_0xcd4d('0x11')]=router; \ No newline at end of file +var _0x58a4=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','addApplications','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xef6451,_0x82b597){var _0x1026f0=function(_0x3f736b){while(--_0x3f736b){_0xef6451['push'](_0xef6451['shift']());}};_0x1026f0(++_0x82b597);}(_0x58a4,0xbf));var _0x458a=function(_0x19a72c,_0x2229cb){_0x19a72c=_0x19a72c-0x0;var _0x3c6199=_0x58a4[_0x19a72c];return _0x3c6199;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var auth=require(_0x458a('0x6'));var interaction=require(_0x458a('0x7'));var config=require(_0x458a('0x8'));var controller=require(_0x458a('0x9'));router[_0x458a('0xa')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xc')]);router['get']('/:id',auth[_0x458a('0xb')](),controller[_0x458a('0xd')]);router[_0x458a('0xe')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xf')]);router['post']('/:id/applications',auth[_0x458a('0xb')](),controller[_0x458a('0x10')]);router[_0x458a('0x11')](_0x458a('0x12'),auth[_0x458a('0xb')](),controller['update']);router[_0x458a('0x13')](_0x458a('0x12'),auth['isAuthenticated'](),controller[_0x458a('0x14')]);module[_0x458a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6258265..74475a5 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 _0xb7e7=['BOOLEAN','wav','VIRTUAL','exten','sequelize','STRING','NoOp','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x3ceca6,_0x295de9){var _0x208855=function(_0x164ae9){while(--_0x164ae9){_0x3ceca6['push'](_0x3ceca6['shift']());}};_0x208855(++_0x295de9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x2')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x7b7e('0x3'),_0x7b7e('0x4'),_0x7b7e('0x5'),'inbound-fax',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'interval':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x9')},'IntervalId':{'type':Sequelize[_0x7b7e('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7b7e('0xa')]},'recordingFormat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc')},'answer':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7b7e('0xd')],'get':function(_0xaadda){return this['getDataValue'](_0x7b7e('0xe'));}}}; \ No newline at end of file +var _0xaa88=['NoOp','inbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex'];(function(_0x5a8804,_0x9020ed){var _0x529d33=function(_0x433475){while(--_0x433475){_0x5a8804['push'](_0x5a8804['shift']());}};_0x529d33(++_0x9020ed);}(_0xaa88,0x137));var _0x8aa8=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xaa88[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'context':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'unique':_0x8aa8('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x3')},'priority':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8aa8('0x3')},'tag':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'defaultValue':_0x8aa8('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x5'),'outbound',_0x8aa8('0x6'),_0x8aa8('0x7'),_0x8aa8('0x8'),_0x8aa8('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'interval':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'defaultValue':_0x8aa8('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x8aa8('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8aa8('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x8aa8('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x8aa8('0x2')],'defaultValue':_0x8aa8('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x8aa8('0xd')],'get':function(_0xa691d6){return this[_0x8aa8('0xe')]('exten');}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 6232b74..8491d6e 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 _0xde03=['transaction','VoiceExtensionId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','ignore','map','value','type','find','name','UserProfileResource','sendStatus','stack','send','index','VoiceExtension','model','filters','intersection','fields','query','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','key','field','filter','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','internal','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','params','sequelize'];(function(_0x3975cc,_0x911199){var _0x10dc27=function(_0x47c0fc){while(--_0x47c0fc){_0x3975cc['push'](_0x3975cc['shift']());}};_0x10dc27(++_0x911199);}(_0xde03,0x1a2));var _0x3de0=function(_0xdefc9a,_0xda2293){_0xdefc9a=_0xdefc9a-0x0;var _0x199e77=_0xde03[_0xdefc9a];return _0x199e77;};'use strict';var pdf=require(_0x3de0('0x0'));var emlformat=require(_0x3de0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3de0('0x2'));var jsonpatch=require(_0x3de0('0x3'));var rp=require(_0x3de0('0x4'));var moment=require(_0x3de0('0x5'));var BPromise=require(_0x3de0('0x6'));var Mustache=require(_0x3de0('0x7'));var util=require(_0x3de0('0x8'));var path=require(_0x3de0('0x9'));var sox=require(_0x3de0('0xa'));var csv=require(_0x3de0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3de0('0xc'));var squel=require('squel');var crypto=require(_0x3de0('0xd'));var jsforce=require(_0x3de0('0xe'));var deskjs=require(_0x3de0('0xf'));var toCsv=require(_0x3de0('0xb'));var querystring=require(_0x3de0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3de0('0x11'));var hardwareService=require(_0x3de0('0x12'));var logger=require(_0x3de0('0x13'))(_0x3de0('0x14'));var utils=require(_0x3de0('0x15'));var config=require('../../config/environment');var db=require(_0x3de0('0x16'))['db'];config[_0x3de0('0x17')]=_[_0x3de0('0x18')](config[_0x3de0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3de0('0x19'))(new Redis(config['redis']));require(_0x3de0('0x1a'))['register'](socket);function respondWithStatusCode(_0x365fd5,_0xfd9f13){_0xfd9f13=_0xfd9f13||0xcc;return function(_0x3555ac){if(_0x3555ac){return _0x365fd5['sendStatus'](_0xfd9f13);}return _0x365fd5[_0x3de0('0x1b')](_0xfd9f13)['end']();};}function respondWithResult(_0x3f0cc1,_0x21ded5){_0x21ded5=_0x21ded5||0xc8;return function(_0x3ed388){if(_0x3ed388){return _0x3f0cc1[_0x3de0('0x1b')](_0x21ded5)[_0x3de0('0x1c')](_0x3ed388);}};}function respondWithFilteredResult(_0x57e06a,_0x4baf93){return function(_0x143465){if(_0x143465){var _0x480607=_0x143465[_0x3de0('0x1d')],_0x184209=_0x4baf93['offset'],_0x1b0f69=_0x4baf93[_0x3de0('0x1e')]+_0x4baf93[_0x3de0('0x1f')],_0x3edc4;if(_0x1b0f69>=_0x480607){_0x1b0f69=_0x480607;_0x3edc4=0xc8;}else{_0x3edc4=0xce;}_0x57e06a[_0x3de0('0x1b')](_0x3edc4);return _0x57e06a[_0x3de0('0x20')](_0x3de0('0x21'),_0x184209+'-'+_0x1b0f69+'/'+_0x480607)[_0x3de0('0x1c')](_0x143465);}return null;};}function patchUpdates(_0x128bdf){return function(_0x2e8d03){try{jsonpatch[_0x3de0('0x22')](_0x2e8d03,_0x128bdf,!![]);}catch(_0x3a290d){return BPromise[_0x3de0('0x23')](_0x3a290d);}return _0x2e8d03[_0x3de0('0x24')]();};}function saveUpdates(_0x24d81c,_0x228234){return function(_0x574693){if(_0x574693){return _0x574693['update'](_0x24d81c)['then'](function(_0x13b425){return _0x13b425;});}return null;};}function removeEntity(_0x5598c4,_0x20c0d0){return function(_0x2ed4e4){if(_0x2ed4e4){return _0x2ed4e4[_0x3de0('0x25')]()[_0x3de0('0x26')](function(){var _0x1685ff=_0x2ed4e4[_0x3de0('0x27')]({'plain':!![]});var _0x4a1478=[{'name':_0x3de0('0x28'),'value':_0x3de0('0x29'),'ignore':![]},{'name':'OutboundRoutes','value':_0x3de0('0x2a'),'ignore':![]},{'name':_0x3de0('0x2b'),'value':'internal','ignore':![]}];var _0x37fd81=_(_0x4a1478)['filter'](_0x3de0('0x2c'))[_0x3de0('0x2d')](_0x3de0('0x2e'))[_0x3de0('0x2e')]();if(_['includes'](_0x37fd81,_0x1685ff[_0x3de0('0x2f')])){return;}var _0x55319e=_[_0x3de0('0x30')](_0x4a1478,[_0x3de0('0x2e'),_0x1685ff[_0x3de0('0x2f')]])[_0x3de0('0x31')];return db[_0x3de0('0x32')]['destroy']({'where':{'type':_0x55319e,'resourceId':_0x1685ff['id']}})[_0x3de0('0x26')](function(){return _0x2ed4e4;});})[_0x3de0('0x26')](function(){_0x5598c4[_0x3de0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x125f53,_0x22efd6){return function(_0x4cc0dc){if(!_0x4cc0dc){_0x125f53[_0x3de0('0x33')](0x194);}return _0x4cc0dc;};}function handleError(_0x5f0571,_0xa84b48){_0xa84b48=_0xa84b48||0x1f4;return function(_0x3aa8df){logger['error'](_0x3aa8df[_0x3de0('0x34')]);if(_0x3aa8df[_0x3de0('0x31')]){delete _0x3aa8df[_0x3de0('0x31')];}_0x5f0571[_0x3de0('0x1b')](_0xa84b48)[_0x3de0('0x35')](_0x3aa8df);};}exports[_0x3de0('0x36')]=function(_0x4bc431,_0x27ad63){var _0x1c871f={},_0x297f09={},_0x3ec7ff={'count':0x0,'rows':[]};var _0x41c5c4=db[_0x3de0('0x37')]['rawAttributes'];_0x297f09[_0x3de0('0x38')]=_['keys'](_0x41c5c4);_0x297f09['query']=_['keys'](_0x4bc431['query']);_0x297f09[_0x3de0('0x39')]=_[_0x3de0('0x3a')](_0x297f09[_0x3de0('0x38')],_0x297f09['query']);_0x1c871f['attributes']=_[_0x3de0('0x3a')](_0x297f09['model'],qs[_0x3de0('0x3b')](_0x4bc431[_0x3de0('0x3c')][_0x3de0('0x3b')]));_0x1c871f[_0x3de0('0x3d')]=_0x1c871f[_0x3de0('0x3d')]['length']?_0x1c871f[_0x3de0('0x3d')]:_0x297f09['model'];if(!_0x4bc431[_0x3de0('0x3c')][_0x3de0('0x3e')](_0x3de0('0x3f'))){_0x1c871f[_0x3de0('0x1f')]=qs['limit'](_0x4bc431[_0x3de0('0x3c')][_0x3de0('0x1f')]);_0x1c871f[_0x3de0('0x1e')]=qs[_0x3de0('0x1e')](_0x4bc431['query'][_0x3de0('0x1e')]);}_0x1c871f['order']=qs[_0x3de0('0x40')](_0x4bc431[_0x3de0('0x3c')][_0x3de0('0x40')]);_0x1c871f[_0x3de0('0x41')]=qs['filters'](_[_0x3de0('0x42')](_0x4bc431[_0x3de0('0x3c')],_0x297f09['filters']));if(_0x4bc431[_0x3de0('0x3c')]['filter']){_0x1c871f[_0x3de0('0x41')]=_[_0x3de0('0x43')](_0x1c871f[_0x3de0('0x41')],{'$or':_[_0x3de0('0x2d')](_0x41c5c4,function(_0x18031f){if(_0x18031f[_0x3de0('0x2f')][_0x3de0('0x44')]!=='VIRTUAL'){var _0x1c3dc0={};_0x1c3dc0[_0x18031f[_0x3de0('0x45')]]={'$like':'%'+_0x4bc431[_0x3de0('0x3c')][_0x3de0('0x46')]+'%'};return _0x1c3dc0;}})});}_0x1c871f=_[_0x3de0('0x43')]({},_0x1c871f,_0x4bc431['options']);var _0x57f0f6={'where':_0x1c871f[_0x3de0('0x41')]};return db[_0x3de0('0x37')][_0x3de0('0x1d')](_0x57f0f6)[_0x3de0('0x26')](function(_0x5c95b0){_0x3ec7ff[_0x3de0('0x1d')]=_0x5c95b0;if(_0x4bc431['query'][_0x3de0('0x47')]){_0x1c871f[_0x3de0('0x48')]=[{'all':!![]}];}return db[_0x3de0('0x37')][_0x3de0('0x49')](_0x1c871f);})[_0x3de0('0x26')](function(_0x28f7a3){_0x3ec7ff[_0x3de0('0x4a')]=_0x28f7a3;return _0x3ec7ff;})[_0x3de0('0x26')](respondWithFilteredResult(_0x27ad63,_0x1c871f))[_0x3de0('0x4b')](handleError(_0x27ad63,null));};exports[_0x3de0('0x4c')]=function(_0x5a734c,_0x9b5adb){var _0x46a993={'raw':![],'where':{'id':_0x5a734c['params']['id']}},_0x1958c1={};_0x1958c1['model']=_[_0x3de0('0x4d')](db[_0x3de0('0x37')][_0x3de0('0x4e')]);_0x1958c1[_0x3de0('0x3c')]=_[_0x3de0('0x4d')](_0x5a734c[_0x3de0('0x3c')]);_0x1958c1['filters']=_['intersection'](_0x1958c1[_0x3de0('0x38')],_0x1958c1[_0x3de0('0x3c')]);_0x46a993[_0x3de0('0x3d')]=_['intersection'](_0x1958c1[_0x3de0('0x38')],qs[_0x3de0('0x3b')](_0x5a734c[_0x3de0('0x3c')][_0x3de0('0x3b')]));_0x46a993['attributes']=_0x46a993[_0x3de0('0x3d')][_0x3de0('0x4f')]?_0x46a993['attributes']:_0x1958c1[_0x3de0('0x38')];if(_0x5a734c['query'][_0x3de0('0x47')]){_0x46a993[_0x3de0('0x48')]=[{'all':!![]}];}_0x46a993=_[_0x3de0('0x43')]({},_0x46a993,_0x5a734c['options']);return db[_0x3de0('0x37')][_0x3de0('0x30')](_0x46a993)[_0x3de0('0x26')](handleEntityNotFound(_0x9b5adb,null))[_0x3de0('0x26')](respondWithResult(_0x9b5adb,null))[_0x3de0('0x4b')](handleError(_0x9b5adb,null));};exports[_0x3de0('0x25')]=function(_0x4677ac,_0x31e5f2){return db[_0x3de0('0x37')]['find']({'where':{'id':_0x4677ac['params']['id']}})[_0x3de0('0x26')](handleEntityNotFound(_0x31e5f2,null))[_0x3de0('0x26')](removeEntity(_0x31e5f2,null))[_0x3de0('0x4b')](handleError(_0x31e5f2,null));};exports[_0x3de0('0x50')]=function(_0x367f3b,_0x4f2a12){if(_0x367f3b[_0x3de0('0x51')]['type']==='outbound'&&!_['startsWith'](_0x367f3b['body'][_0x3de0('0x52')],'_')){_0x367f3b[_0x3de0('0x51')][_0x3de0('0x52')]='_'[_0x3de0('0x53')](_0x367f3b[_0x3de0('0x51')][_0x3de0('0x52')]);}return db[_0x3de0('0x37')][_0x3de0('0x50')](_0x367f3b[_0x3de0('0x51')],{'raw':![]})[_0x3de0('0x26')](function(_0x25832c){var _0x807c2c=_0x367f3b[_0x3de0('0x54')][_0x3de0('0x27')]({'plain':!![]});if(!_0x807c2c)throw new Error(_0x3de0('0x55'));if(_0x807c2c[_0x3de0('0x56')]==='user'){var _0x4e1206=_0x25832c[_0x3de0('0x27')]({'plain':!![]});var _0x180770=[{'name':'InboundRoutes','value':_0x3de0('0x29')},{'name':_0x3de0('0x57'),'value':'outbound'},{'name':_0x3de0('0x2b'),'value':_0x3de0('0x58')}];var _0xf6f874=_[_0x3de0('0x30')](_0x180770,[_0x3de0('0x2e'),_0x4e1206[_0x3de0('0x2f')]])[_0x3de0('0x31')];return db['UserProfileSection'][_0x3de0('0x30')]({'where':{'name':_0xf6f874,'userProfileId':_0x807c2c[_0x3de0('0x59')]},'raw':!![]})[_0x3de0('0x26')](function(_0x4e6d19){if(_0x4e6d19&&_0x4e6d19['autoAssociation']===0x0){return db['UserProfileResource'][_0x3de0('0x50')]({'name':_0x4e1206[_0x3de0('0x31')],'resourceId':_0x4e1206['id'],'type':_0x4e6d19[_0x3de0('0x31')],'sectionId':_0x4e6d19['id']},{})[_0x3de0('0x26')](function(){return _0x25832c;});}else{return _0x25832c;}})[_0x3de0('0x4b')](function(_0x4a5190){logger[_0x3de0('0x5a')](_0x3de0('0x5b'),_0x4a5190);throw _0x4a5190;});}return _0x25832c;})[_0x3de0('0x26')](respondWithResult(_0x4f2a12,0xc9))[_0x3de0('0x4b')](handleError(_0x4f2a12,null));};exports[_0x3de0('0x5c')]=function(_0x301d54,_0x259db2){if(_0x301d54[_0x3de0('0x51')]['id']){delete _0x301d54[_0x3de0('0x51')]['id'];}return db[_0x3de0('0x37')][_0x3de0('0x30')]({'where':{'id':_0x301d54['params']['id']}})['then'](handleEntityNotFound(_0x259db2,null))[_0x3de0('0x26')](function(_0x15285c){if(_0x15285c){return db[_0x3de0('0x37')][_0x3de0('0x5c')](_[_0x3de0('0x42')](_0x301d54[_0x3de0('0x51')],[_0x3de0('0x52'),_0x3de0('0x5d'),_0x3de0('0x5e'),_0x3de0('0x5f'),_0x3de0('0x60'),_0x3de0('0x61')]),{'where':{'context':_0x15285c[_0x3de0('0x5d')],'exten':_0x15285c['exten']},'individualHooks':!![]})['then'](function(_0x29bdec){return _0x29bdec;});}return null;})[_0x3de0('0x26')](respondWithStatusCode(_0x259db2,null))['catch'](handleError(_0x259db2,null));};exports[_0x3de0('0x62')]=function(_0x2c1b0f,_0x1c2d2c,_0x1da616){return db[_0x3de0('0x37')][_0x3de0('0x63')]({'where':{'id':_0x2c1b0f[_0x3de0('0x64')]['id']}})[_0x3de0('0x26')](handleEntityNotFound(_0x1c2d2c,null))[_0x3de0('0x26')](function(_0x204b0a){if(_0x204b0a){return db[_0x3de0('0x65')][_0x3de0('0x66')](function(_0x4127a8){return db[_0x3de0('0x37')][_0x3de0('0x25')]({'where':{'VoiceExtensionId':_0x2c1b0f[_0x3de0('0x64')]['id']},'transaction':_0x4127a8})[_0x3de0('0x26')](function(_0x47e8da){var _0x171dab=_[_0x3de0('0x2d')](_0x2c1b0f['body'],function(_0x3791ff){_0x3791ff[_0x3de0('0x67')]=_0x2c1b0f[_0x3de0('0x64')]['id'];return _0x3791ff;});return db[_0x3de0('0x37')]['bulkCreate'](_0x171dab,{'transaction':_0x4127a8});});})[_0x3de0('0x26')](function(){return db[_0x3de0('0x37')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2c1b0f[_0x3de0('0x64')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x3de0('0x26')](respondWithResult(_0x1c2d2c,null))['catch'](handleError(_0x1c2d2c,null));}; \ No newline at end of file +var _0x9d76=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','key','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','options','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','set','Content-Range','reject','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','index','VoiceExtension'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0x9d76,0x95));var _0x69d7=function(_0x3072c6,_0xce93df){_0x3072c6=_0x3072c6-0x0;var _0x393ea9=_0x9d76[_0x3072c6];return _0x393ea9;};'use strict';var pdf=require(_0x69d7('0x0'));var emlformat=require(_0x69d7('0x1'));var rimraf=require(_0x69d7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69d7('0x3'));var moment=require('moment');var BPromise=require(_0x69d7('0x4'));var Mustache=require(_0x69d7('0x5'));var util=require(_0x69d7('0x6'));var path=require(_0x69d7('0x7'));var sox=require(_0x69d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x69d7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x69d7('0xa'));var deskjs=require(_0x69d7('0xb'));var toCsv=require(_0x69d7('0xc'));var querystring=require(_0x69d7('0xd'));var Papa=require(_0x69d7('0xe'));var Redis=require(_0x69d7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x69d7('0x10'));var logger=require(_0x69d7('0x11'))(_0x69d7('0x12'));var utils=require('../../config/utils');var config=require(_0x69d7('0x13'));var db=require(_0x69d7('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x69d7('0x15'),'port':0x18eb});var socket=require(_0x69d7('0x16'))(new Redis(config[_0x69d7('0x17')]));require('./voiceExtension.socket')[_0x69d7('0x18')](socket);function respondWithStatusCode(_0x1466a3,_0x119d89){_0x119d89=_0x119d89||0xcc;return function(_0x20d1db){if(_0x20d1db){return _0x1466a3[_0x69d7('0x19')](_0x119d89);}return _0x1466a3['status'](_0x119d89)[_0x69d7('0x1a')]();};}function respondWithResult(_0x346d37,_0x57f6dd){_0x57f6dd=_0x57f6dd||0xc8;return function(_0x51b720){if(_0x51b720){return _0x346d37[_0x69d7('0x1b')](_0x57f6dd)[_0x69d7('0x1c')](_0x51b720);}};}function respondWithFilteredResult(_0x1050b1,_0x33d960){return function(_0x1947cf){if(_0x1947cf){var _0x3fef25=_0x1947cf['count'],_0x179edd=_0x33d960[_0x69d7('0x1d')],_0x50dd6a=_0x33d960[_0x69d7('0x1d')]+_0x33d960['limit'],_0x3c7f85;if(_0x50dd6a>=_0x3fef25){_0x50dd6a=_0x3fef25;_0x3c7f85=0xc8;}else{_0x3c7f85=0xce;}_0x1050b1['status'](_0x3c7f85);return _0x1050b1[_0x69d7('0x1e')](_0x69d7('0x1f'),_0x179edd+'-'+_0x50dd6a+'/'+_0x3fef25)[_0x69d7('0x1c')](_0x1947cf);}return null;};}function patchUpdates(_0x2381b8){return function(_0x1c0d75){try{jsonpatch['apply'](_0x1c0d75,_0x2381b8,!![]);}catch(_0x2dce3d){return BPromise[_0x69d7('0x20')](_0x2dce3d);}return _0x1c0d75[_0x69d7('0x21')]();};}function saveUpdates(_0x53bf3c,_0x32eba3){return function(_0x1ace34){if(_0x1ace34){return _0x1ace34[_0x69d7('0x22')](_0x53bf3c)['then'](function(_0xc7975e){return _0xc7975e;});}return null;};}function removeEntity(_0x8bf04a,_0x35fc34){return function(_0x925173){if(_0x925173){return _0x925173['destroy']()[_0x69d7('0x23')](function(){var _0x151d9d=_0x925173[_0x69d7('0x24')]({'plain':!![]});var _0x46bf3d=[{'name':_0x69d7('0x25'),'value':_0x69d7('0x26'),'ignore':![]},{'name':_0x69d7('0x27'),'value':_0x69d7('0x28'),'ignore':![]},{'name':_0x69d7('0x29'),'value':_0x69d7('0x2a'),'ignore':![]}];var _0x271c79=_(_0x46bf3d)['filter'](_0x69d7('0x2b'))[_0x69d7('0x2c')](_0x69d7('0x2d'))[_0x69d7('0x2d')]();if(_[_0x69d7('0x2e')](_0x271c79,_0x151d9d[_0x69d7('0x2f')])){return;}var _0x5852f4=_[_0x69d7('0x30')](_0x46bf3d,[_0x69d7('0x2d'),_0x151d9d['type']])[_0x69d7('0x31')];return db[_0x69d7('0x32')][_0x69d7('0x33')]({'where':{'type':_0x5852f4,'resourceId':_0x151d9d['id']}})[_0x69d7('0x23')](function(){return _0x925173;});})[_0x69d7('0x23')](function(){_0x8bf04a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc4b4,_0x5171c1){return function(_0x91ab33){if(!_0x91ab33){_0x2dc4b4['sendStatus'](0x194);}return _0x91ab33;};}function handleError(_0x39f9d9,_0x1b8799){_0x1b8799=_0x1b8799||0x1f4;return function(_0x3d77fa){logger[_0x69d7('0x34')](_0x3d77fa['stack']);if(_0x3d77fa[_0x69d7('0x31')]){delete _0x3d77fa[_0x69d7('0x31')];}_0x39f9d9[_0x69d7('0x1b')](_0x1b8799)['send'](_0x3d77fa);};}exports[_0x69d7('0x35')]=function(_0x3742c2,_0x1928bb){var _0x4d85c8={},_0x49a135={},_0x10131e={'count':0x0,'rows':[]};var _0x1a28e0=db[_0x69d7('0x36')]['rawAttributes'];_0x49a135[_0x69d7('0x37')]=_['keys'](_0x1a28e0);_0x49a135[_0x69d7('0x38')]=_[_0x69d7('0x39')](_0x3742c2[_0x69d7('0x38')]);_0x49a135[_0x69d7('0x3a')]=_[_0x69d7('0x3b')](_0x49a135[_0x69d7('0x37')],_0x49a135[_0x69d7('0x38')]);_0x4d85c8[_0x69d7('0x3c')]=_[_0x69d7('0x3b')](_0x49a135[_0x69d7('0x37')],qs[_0x69d7('0x3d')](_0x3742c2['query'][_0x69d7('0x3d')]));_0x4d85c8[_0x69d7('0x3c')]=_0x4d85c8['attributes'][_0x69d7('0x3e')]?_0x4d85c8[_0x69d7('0x3c')]:_0x49a135[_0x69d7('0x37')];if(!_0x3742c2['query'][_0x69d7('0x3f')](_0x69d7('0x40'))){_0x4d85c8[_0x69d7('0x41')]=qs[_0x69d7('0x41')](_0x3742c2[_0x69d7('0x38')][_0x69d7('0x41')]);_0x4d85c8[_0x69d7('0x1d')]=qs[_0x69d7('0x1d')](_0x3742c2[_0x69d7('0x38')]['offset']);}_0x4d85c8[_0x69d7('0x42')]=qs['sort'](_0x3742c2['query']['sort']);_0x4d85c8[_0x69d7('0x43')]=qs['filters'](_['pick'](_0x3742c2['query'],_0x49a135[_0x69d7('0x3a')]));if(_0x3742c2[_0x69d7('0x38')][_0x69d7('0x44')]){_0x4d85c8[_0x69d7('0x43')]=_['merge'](_0x4d85c8[_0x69d7('0x43')],{'$or':_[_0x69d7('0x2c')](_0x1a28e0,function(_0x349dd1){if(_0x349dd1[_0x69d7('0x2f')][_0x69d7('0x45')]!==_0x69d7('0x46')){var _0x5d1eed={};_0x5d1eed[_0x349dd1['field']]={'$like':'%'+_0x3742c2[_0x69d7('0x38')][_0x69d7('0x44')]+'%'};return _0x5d1eed;}})});}_0x4d85c8=_[_0x69d7('0x47')]({},_0x4d85c8,_0x3742c2['options']);var _0x245beb={'where':_0x4d85c8[_0x69d7('0x43')]};return db[_0x69d7('0x36')][_0x69d7('0x48')](_0x245beb)[_0x69d7('0x23')](function(_0x175049){_0x10131e['count']=_0x175049;if(_0x3742c2['query'][_0x69d7('0x49')]){_0x4d85c8[_0x69d7('0x4a')]=[{'all':!![]}];}return db[_0x69d7('0x36')][_0x69d7('0x4b')](_0x4d85c8);})[_0x69d7('0x23')](function(_0x5dd186){_0x10131e['rows']=_0x5dd186;return _0x10131e;})['then'](respondWithFilteredResult(_0x1928bb,_0x4d85c8))[_0x69d7('0x4c')](handleError(_0x1928bb,null));};exports[_0x69d7('0x4d')]=function(_0xbe042f,_0x297f44){var _0x3e5a8e={'raw':![],'where':{'id':_0xbe042f['params']['id']}},_0x240135={};_0x240135[_0x69d7('0x37')]=_[_0x69d7('0x39')](db[_0x69d7('0x36')]['rawAttributes']);_0x240135[_0x69d7('0x38')]=_[_0x69d7('0x39')](_0xbe042f[_0x69d7('0x38')]);_0x240135[_0x69d7('0x3a')]=_[_0x69d7('0x3b')](_0x240135[_0x69d7('0x37')],_0x240135['query']);_0x3e5a8e[_0x69d7('0x3c')]=_[_0x69d7('0x3b')](_0x240135[_0x69d7('0x37')],qs[_0x69d7('0x3d')](_0xbe042f[_0x69d7('0x38')][_0x69d7('0x3d')]));_0x3e5a8e['attributes']=_0x3e5a8e['attributes'][_0x69d7('0x3e')]?_0x3e5a8e[_0x69d7('0x3c')]:_0x240135[_0x69d7('0x37')];if(_0xbe042f[_0x69d7('0x38')][_0x69d7('0x49')]){_0x3e5a8e['include']=[{'all':!![]}];}_0x3e5a8e=_['merge']({},_0x3e5a8e,_0xbe042f[_0x69d7('0x4e')]);return db[_0x69d7('0x36')][_0x69d7('0x30')](_0x3e5a8e)[_0x69d7('0x23')](handleEntityNotFound(_0x297f44,null))[_0x69d7('0x23')](respondWithResult(_0x297f44,null))['catch'](handleError(_0x297f44,null));};exports[_0x69d7('0x33')]=function(_0x50382a,_0x4a6eed){return db[_0x69d7('0x36')][_0x69d7('0x30')]({'where':{'id':_0x50382a[_0x69d7('0x4f')]['id']}})[_0x69d7('0x23')](handleEntityNotFound(_0x4a6eed,null))[_0x69d7('0x23')](removeEntity(_0x4a6eed,null))[_0x69d7('0x4c')](handleError(_0x4a6eed,null));};exports[_0x69d7('0x50')]=function(_0x222374,_0x5d341e){if(_0x222374[_0x69d7('0x51')][_0x69d7('0x2f')]===_0x69d7('0x28')&&!_[_0x69d7('0x52')](_0x222374['body'][_0x69d7('0x53')],'_')){_0x222374[_0x69d7('0x51')][_0x69d7('0x53')]='_'['concat'](_0x222374['body'][_0x69d7('0x53')]);}return db[_0x69d7('0x36')][_0x69d7('0x50')](_0x222374['body'],{'raw':![]})['then'](function(_0x5ab86f){var _0x9d5e07=_0x222374[_0x69d7('0x54')][_0x69d7('0x24')]({'plain':!![]});if(!_0x9d5e07)throw new Error(_0x69d7('0x55'));if(_0x9d5e07[_0x69d7('0x56')]===_0x69d7('0x54')){var _0x120f87=_0x5ab86f[_0x69d7('0x24')]({'plain':!![]});var _0x4bd31c=[{'name':_0x69d7('0x25'),'value':_0x69d7('0x26')},{'name':_0x69d7('0x27'),'value':_0x69d7('0x28')},{'name':'InternalRoutes','value':_0x69d7('0x2a')}];var _0x28bfc1=_[_0x69d7('0x30')](_0x4bd31c,[_0x69d7('0x2d'),_0x120f87[_0x69d7('0x2f')]])['name'];return db[_0x69d7('0x57')]['find']({'where':{'name':_0x28bfc1,'userProfileId':_0x9d5e07[_0x69d7('0x58')]},'raw':!![]})[_0x69d7('0x23')](function(_0x51f042){if(_0x51f042&&_0x51f042[_0x69d7('0x59')]===0x0){return db['UserProfileResource'][_0x69d7('0x50')]({'name':_0x120f87[_0x69d7('0x31')],'resourceId':_0x120f87['id'],'type':_0x51f042['name'],'sectionId':_0x51f042['id']},{})[_0x69d7('0x23')](function(){return _0x5ab86f;});}else{return _0x5ab86f;}})[_0x69d7('0x4c')](function(_0x5450fa){logger['error'](_0x69d7('0x5a'),_0x5450fa);throw _0x5450fa;});}return _0x5ab86f;})[_0x69d7('0x23')](respondWithResult(_0x5d341e,0xc9))[_0x69d7('0x4c')](handleError(_0x5d341e,null));};exports[_0x69d7('0x22')]=function(_0x2fe8b0,_0x30da08){if(_0x2fe8b0[_0x69d7('0x51')]['id']){delete _0x2fe8b0['body']['id'];}return db[_0x69d7('0x36')][_0x69d7('0x30')]({'where':{'id':_0x2fe8b0[_0x69d7('0x4f')]['id']}})[_0x69d7('0x23')](handleEntityNotFound(_0x30da08,null))[_0x69d7('0x23')](function(_0x4d9ae4){if(_0x4d9ae4){return db[_0x69d7('0x36')][_0x69d7('0x22')](_['pick'](_0x2fe8b0[_0x69d7('0x51')],['exten','context',_0x69d7('0x5b'),'recordingFormat','cutdigits',_0x69d7('0x5c')]),{'where':{'context':_0x4d9ae4[_0x69d7('0x5d')],'exten':_0x4d9ae4['exten']},'individualHooks':!![]})[_0x69d7('0x23')](function(_0x544cee){return _0x544cee;});}return null;})['then'](respondWithStatusCode(_0x30da08,null))['catch'](handleError(_0x30da08,null));};exports[_0x69d7('0x5e')]=function(_0x13ba57,_0xfe2336,_0x9d82e0){return db[_0x69d7('0x36')][_0x69d7('0x5f')]({'where':{'id':_0x13ba57[_0x69d7('0x4f')]['id']}})[_0x69d7('0x23')](handleEntityNotFound(_0xfe2336,null))[_0x69d7('0x23')](function(_0x153b4a){if(_0x153b4a){return db[_0x69d7('0x60')][_0x69d7('0x61')](function(_0x1a9cf3){return db[_0x69d7('0x36')][_0x69d7('0x33')]({'where':{'VoiceExtensionId':_0x13ba57['params']['id']},'transaction':_0x1a9cf3})[_0x69d7('0x23')](function(_0x16a914){var _0x2af791=_['map'](_0x13ba57[_0x69d7('0x51')],function(_0x2e11bb){_0x2e11bb[_0x69d7('0x62')]=_0x13ba57[_0x69d7('0x4f')]['id'];return _0x2e11bb;});return db[_0x69d7('0x36')][_0x69d7('0x63')](_0x2af791,{'transaction':_0x1a9cf3});});})['then'](function(){return db[_0x69d7('0x36')][_0x69d7('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x13ba57[_0x69d7('0x4f')]['id']},'order':_0x69d7('0x65')});});}})[_0x69d7('0x23')](respondWithResult(_0xfe2336,null))[_0x69d7('0x4c')](handleError(_0xfe2336,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d795ca4..f0fad3d 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x55ca,0x126));var _0xa55c=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x55ca[_0x64aff8];return _0x5488a3;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var VoiceExtension=require(_0xa55c('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){VoiceExtensionEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);VoiceExtensionEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];VoiceExtension[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','update','emit'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoiceExtension=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoiceExtensionEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoiceExtensionEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoiceExtension[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c3fac58..1218b85 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 _0x9dac=['exports','define','lodash','util','../../config/logger','api','bluebird','../../config/environment','./voiceExtension.attributes'];(function(_0x15f069,_0x439837){var _0x364f3a=function(_0x4f6751){while(--_0x4f6751){_0x15f069['push'](_0x15f069['shift']());}};_0x364f3a(++_0x439837);}(_0x9dac,0x1a0));var _0xc9da=function(_0x2a5daf,_0x35ca15){_0x2a5daf=_0x2a5daf-0x0;var _0x311681=_0x9dac[_0x2a5daf];return _0x311681;};'use strict';var _=require(_0xc9da('0x0'));var util=require(_0xc9da('0x1'));var logger=require(_0xc9da('0x2'))(_0xc9da('0x3'));var moment=require('moment');var BPromise=require(_0xc9da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9da('0x5'));var attributes=require(_0xc9da('0x6'));module[_0xc9da('0x7')]=function(_0x5df72f,_0xf29be8){return _0x5df72f[_0xc9da('0x8')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc94=['../../config/environment','./voiceExtension.attributes','exports','define','voice_extensions','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x812b2a,_0x585af3){var _0x1b156a=function(_0x4debfc){while(--_0x4debfc){_0x812b2a['push'](_0x812b2a['shift']());}};_0x1b156a(++_0x585af3);}(_0xfc94,0x19d));var _0x4fc9=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xfc94[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x4fc9('0x0'));var util=require(_0x4fc9('0x1'));var logger=require('../../config/logger')(_0x4fc9('0x2'));var moment=require(_0x4fc9('0x3'));var BPromise=require(_0x4fc9('0x4'));var rp=require(_0x4fc9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fc9('0x6'));var config=require(_0x4fc9('0x7'));var attributes=require(_0x4fc9('0x8'));module[_0x4fc9('0x9')]=function(_0x22c26f,_0xfd1c9a){return _0x22c26f[_0x4fc9('0xa')]('VoiceExtension',attributes,{'tableName':_0x4fc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fbc5c4d..64adbc3 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 _0x087b=['map','model','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x087b,0x11a));var _0xb087=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x087b[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});config[_0xb087('0xb')]=_[_0xb087('0xc')](config[_0xb087('0xb')],{'host':_0xb087('0xd'),'port':0x18eb});var socket=require(_0xb087('0xe'))(new Redis(config[_0xb087('0xb')]));require(_0xb087('0xf'))[_0xb087('0x10')](socket);function respondWithRpcPromise(_0x379041,_0x583d25,_0x244abc){return new BPromise(function(_0x108451,_0x903a16){return client[_0xb087('0x11')](_0x379041,_0x244abc)[_0xb087('0x12')](function(_0x2f43e9){logger[_0xb087('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));logger[_0xb087('0x15')](_0xb087('0x16'),_0x583d25,'request\x20sent',JSON[_0xb087('0x17')](_0x2f43e9));if(_0x2f43e9[_0xb087('0x18')]){if(_0x2f43e9[_0xb087('0x18')][_0xb087('0x19')]===0x1f4){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);return _0x903a16(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}logger['error'](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')]['message']);return _0x108451(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}else{logger[_0xb087('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));_0x108451(_0x2f43e9[_0xb087('0x1c')][_0xb087('0x1b')]);}})[_0xb087('0x1d')](function(_0x4e333b){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x4e333b);_0x903a16(_0x4e333b);});});}exports[_0xb087('0x1e')]=function(_0x23c1b6){var _0x5b4ef0=this;return new Promise(function(_0x5aeab1,_0x5ea3dc){return db['VoiceExtension'][_0xb087('0x1f')]({'raw':_0x23c1b6[_0xb087('0x20')]?_0x23c1b6[_0xb087('0x20')][_0xb087('0x21')]===undefined?!![]:![]:!![],'where':_0x23c1b6[_0xb087('0x20')]?_0x23c1b6[_0xb087('0x20')][_0xb087('0x22')]||null:null,'attributes':_0x23c1b6['options']?_0x23c1b6[_0xb087('0x20')][_0xb087('0x23')]||null:null,'limit':_0x23c1b6[_0xb087('0x20')]?_0x23c1b6[_0xb087('0x20')][_0xb087('0x24')]||null:null,'include':_0x23c1b6['options']?_0x23c1b6[_0xb087('0x20')][_0xb087('0x25')]?_['map'](_0x23c1b6['options']['include'],function(_0x598b99){return{'model':db[_0x598b99['model']],'as':_0x598b99['as'],'attributes':_0x598b99[_0xb087('0x23')],'include':_0x598b99[_0xb087('0x25')]?_[_0xb087('0x26')](_0x598b99[_0xb087('0x25')],function(_0xd9ec66){return{'model':db[_0xd9ec66[_0xb087('0x27')]],'as':_0xd9ec66['as'],'attributes':_0xd9ec66[_0xb087('0x23')],'include':_0xd9ec66[_0xb087('0x25')]?_[_0xb087('0x26')](_0xd9ec66[_0xb087('0x25')],function(_0x18058c){return{'model':db[_0x18058c[_0xb087('0x27')]],'as':_0x18058c['as'],'attributes':_0x18058c[_0xb087('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb087('0x12')](function(_0x593b78){logger[_0xb087('0x13')](_0xb087('0x1e'),_0x23c1b6);logger[_0xb087('0x15')](_0xb087('0x1e'),_0x23c1b6,JSON[_0xb087('0x17')](_0x593b78));_0x5aeab1(_0x593b78);})[_0xb087('0x1d')](function(_0x2e1c57){logger[_0xb087('0x18')]('GetVoiceExtension',_0x2e1c57['message'],_0x23c1b6);_0x5ea3dc(_0x5b4ef0[_0xb087('0x18')](0x1f4,_0x2e1c57[_0xb087('0x1b')]));});});}; \ No newline at end of file +var _0x878f=['request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','map','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults'];(function(_0x45dc2b,_0x4dc717){var _0x2587ed=function(_0x5bcf5d){while(--_0x5bcf5d){_0x45dc2b['push'](_0x45dc2b['shift']());}};_0x2587ed(++_0x4dc717);}(_0x878f,0x173));var _0xf878=function(_0xdb8e66,_0x51411b){_0xdb8e66=_0xdb8e66-0x0;var _0x2182a2=_0x878f[_0xdb8e66];return _0x2182a2;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xf878('0xb')]=_[_0xf878('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf878('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x307653,_0x2e6931,_0x223504){return new BPromise(function(_0x52edde,_0xb2863e){return client[_0xf878('0xd')](_0x307653,_0x223504)['then'](function(_0xdf76){logger['info'](_0xf878('0xe'),_0x2e6931,_0xf878('0xf'));logger[_0xf878('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2e6931,_0xf878('0xf'),JSON[_0xf878('0x11')](_0xdf76));if(_0xdf76[_0xf878('0x12')]){if(_0xdf76['error'][_0xf878('0x13')]===0x1f4){logger[_0xf878('0x12')](_0xf878('0xe'),_0x2e6931,_0xdf76['error']['message']);return _0xb2863e(_0xdf76[_0xf878('0x12')][_0xf878('0x14')]);}logger[_0xf878('0x12')](_0xf878('0xe'),_0x2e6931,_0xdf76[_0xf878('0x12')][_0xf878('0x14')]);return _0x52edde(_0xdf76[_0xf878('0x12')][_0xf878('0x14')]);}else{logger[_0xf878('0x15')](_0xf878('0xe'),_0x2e6931,_0xf878('0xf'));_0x52edde(_0xdf76['result'][_0xf878('0x14')]);}})[_0xf878('0x16')](function(_0x412de1){logger[_0xf878('0x12')](_0xf878('0xe'),_0x2e6931,_0x412de1);_0xb2863e(_0x412de1);});});}exports[_0xf878('0x17')]=function(_0x17089c){var _0x5677a8=this;return new Promise(function(_0x73f6bf,_0x140866){return db[_0xf878('0x18')]['findAll']({'raw':_0x17089c[_0xf878('0x19')]?_0x17089c[_0xf878('0x19')][_0xf878('0x1a')]===undefined?!![]:![]:!![],'where':_0x17089c[_0xf878('0x19')]?_0x17089c[_0xf878('0x19')][_0xf878('0x1b')]||null:null,'attributes':_0x17089c[_0xf878('0x19')]?_0x17089c[_0xf878('0x19')][_0xf878('0x1c')]||null:null,'limit':_0x17089c[_0xf878('0x19')]?_0x17089c[_0xf878('0x19')]['limit']||null:null,'include':_0x17089c[_0xf878('0x19')]?_0x17089c['options'][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x17089c[_0xf878('0x19')][_0xf878('0x1d')],function(_0x20449e){return{'model':db[_0x20449e['model']],'as':_0x20449e['as'],'attributes':_0x20449e['attributes'],'include':_0x20449e['include']?_[_0xf878('0x1e')](_0x20449e[_0xf878('0x1d')],function(_0x38fa87){return{'model':db[_0x38fa87['model']],'as':_0x38fa87['as'],'attributes':_0x38fa87[_0xf878('0x1c')],'include':_0x38fa87[_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x38fa87[_0xf878('0x1d')],function(_0x41dd55){return{'model':db[_0x41dd55['model']],'as':_0x41dd55['as'],'attributes':_0x41dd55['attributes']};}):[]};}):[]};}):[]:[]})[_0xf878('0x1f')](function(_0x5d9c97){logger['info'](_0xf878('0x17'),_0x17089c);logger['debug'](_0xf878('0x17'),_0x17089c,JSON['stringify'](_0x5d9c97));_0x73f6bf(_0x5d9c97);})[_0xf878('0x16')](function(_0x49e66a){logger[_0xf878('0x12')]('GetVoiceExtension',_0x49e66a[_0xf878('0x14')],_0x17089c);_0x140866(_0x5677a8[_0xf878('0x12')](0x1f4,_0x49e66a[_0xf878('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b78e14c..48a10a4 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 _0x031f=['./voiceExtension.events','save','remove','update','removeListener','length','voiceExtension:'];(function(_0x76e13f,_0x5c3b98){var _0x4ec18c=function(_0x16db71){while(--_0x16db71){_0x76e13f['push'](_0x76e13f['shift']());}};_0x4ec18c(++_0x5c3b98);}(_0x031f,0x173));var _0xf031=function(_0x56169b,_0x2d0b88){_0x56169b=_0x56169b-0x0;var _0x37a851=_0x031f[_0x56169b];return _0x37a851;};'use strict';var VoiceExtensionEvents=require(_0xf031('0x0'));var events=[_0xf031('0x1'),_0xf031('0x2'),_0xf031('0x3')];function createListener(_0x3c7cd0,_0x13ae8a){return function(_0x53f261){_0x13ae8a['emit'](_0x3c7cd0,_0x53f261);};}function removeListener(_0x53f6dc,_0x4052c5){return function(){VoiceExtensionEvents[_0xf031('0x4')](_0x53f6dc,_0x4052c5);};}exports['register']=function(_0x31747f){for(var _0x1e4bdd=0x0,_0x21e857=events[_0xf031('0x5')];_0x1e4bdd<_0x21e857;_0x1e4bdd++){var _0x5e3d02=events[_0x1e4bdd];var _0x1f2738=createListener(_0xf031('0x6')+_0x5e3d02,_0x31747f);VoiceExtensionEvents['on'](_0x5e3d02,_0x1f2738);}}; \ No newline at end of file +var _0x1f86=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','save','remove','update'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0x1f86,0xbc));var _0x61f8=function(_0x4fa455,_0x4d155a){_0x4fa455=_0x4fa455-0x0;var _0xdc3708=_0x1f86[_0x4fa455];return _0xdc3708;};'use strict';var VoiceExtensionEvents=require(_0x61f8('0x0'));var events=[_0x61f8('0x1'),_0x61f8('0x2'),_0x61f8('0x3')];function createListener(_0x9f4fe2,_0x172732){return function(_0x495177){_0x172732[_0x61f8('0x4')](_0x9f4fe2,_0x495177);};}function removeListener(_0x11b2d5,_0x309e34){return function(){VoiceExtensionEvents[_0x61f8('0x5')](_0x11b2d5,_0x309e34);};}exports[_0x61f8('0x6')]=function(_0x36e52f){for(var _0x2df5b2=0x0,_0x1517d4=events['length'];_0x2df5b2<_0x1517d4;_0x2df5b2++){var _0x529bd5=events[_0x2df5b2];var _0x23aa5a=createListener(_0x61f8('0x7')+_0x529bd5,_0x36e52f);VoiceExtensionEvents['on'](_0x529bd5,_0x23aa5a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8ed63cb..1aa45bd 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 _0x1468=['./voiceMail.controller','isAuthenticated','index','get','show','/:id/messages','getMessages','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x1468,0x139));var _0x8146=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0x1468[_0x144b30];return _0x1bb7bc;};'use strict';var multer=require(_0x8146('0x0'));var util=require(_0x8146('0x1'));var path=require(_0x8146('0x2'));var timeout=require(_0x8146('0x3'));var express=require(_0x8146('0x4'));var router=express[_0x8146('0x5')]();var auth=require(_0x8146('0x6'));var interaction=require(_0x8146('0x7'));var config=require(_0x8146('0x8'));var controller=require(_0x8146('0x9'));router['get']('/',auth[_0x8146('0xa')](),controller[_0x8146('0xb')]);router[_0x8146('0xc')]('/:id',auth[_0x8146('0xa')](),controller[_0x8146('0xd')]);router[_0x8146('0xc')](_0x8146('0xe'),auth['isAuthenticated'](),controller[_0x8146('0xf')]);router['post']('/',auth[_0x8146('0xa')](),controller[_0x8146('0x10')]);router[_0x8146('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8146('0x12')]);router[_0x8146('0x13')](_0x8146('0x14'),auth[_0x8146('0xa')](),controller[_0x8146('0x15')]);module[_0x8146('0x16')]=router; \ No newline at end of file +var _0xee25=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','isAuthenticated','post','update','delete','destroy'];(function(_0x240625,_0x2acf8d){var _0x102545=function(_0x3c4d77){while(--_0x3c4d77){_0x240625['push'](_0x240625['shift']());}};_0x102545(++_0x2acf8d);}(_0xee25,0x1a0));var _0x5ee2=function(_0x2c4ad6,_0x856fda){_0x2c4ad6=_0x2c4ad6-0x0;var _0x3ce483=_0xee25[_0x2c4ad6];return _0x3ce483;};'use strict';var multer=require(_0x5ee2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5ee2('0x1'));var express=require(_0x5ee2('0x2'));var router=express[_0x5ee2('0x3')]();var auth=require(_0x5ee2('0x4'));var interaction=require(_0x5ee2('0x5'));var config=require(_0x5ee2('0x6'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5ee2('0x7')]);router[_0x5ee2('0x8')](_0x5ee2('0x9'),auth['isAuthenticated'](),controller[_0x5ee2('0xa')]);router[_0x5ee2('0x8')]('/:id/messages',auth[_0x5ee2('0xb')](),controller['getMessages']);router[_0x5ee2('0xc')]('/',auth[_0x5ee2('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5ee2('0xd')]);router[_0x5ee2('0xe')](_0x5ee2('0x9'),auth['isAuthenticated'](),controller[_0x5ee2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 3219cdc..f7191f9 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 _0xb4f4=['INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x156995,_0x3e4030){var _0x195cf3=function(_0x318652){while(--_0x318652){_0x156995['push'](_0x156995['shift']());}};_0x195cf3(++_0x3e4030);}(_0xb4f4,0x16e));var _0x4b4f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb4f4[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x4b4f('0x0'));module[_0x4b4f('0x1')]={'customer_id':{'type':Sequelize[_0x4b4f('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4b4f('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4b4f('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4b4f('0x4')},'password':{'type':Sequelize[_0x4b4f('0x2')]},'fullname':{'type':Sequelize[_0x4b4f('0x2')]},'email':{'type':Sequelize[_0x4b4f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x29d44f){this[_0x4b4f('0x5')](_0x4b4f('0x6'),typeof _0x29d44f===_0x4b4f('0x7')&&_0x29d44f[_0x4b4f('0x8')]()?_0x29d44f['trim']():null);}},'pager':{'type':Sequelize[_0x4b4f('0x2')]},'tz':{'type':Sequelize[_0x4b4f('0x2')],'defaultValue':_0x4b4f('0x9')},'attach':{'type':Sequelize[_0x4b4f('0xa')]('yes','no'),'defaultValue':_0x4b4f('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4b4f('0xa')]('yes','no'),'defaultValue':_0x4b4f('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4b4f('0x2')]},'callback':{'type':Sequelize[_0x4b4f('0x2')]},'review':{'type':Sequelize[_0x4b4f('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4b4f('0xa')](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4b4f('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4b4f('0xa')](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4b4f('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4b4f('0xa')](_0x4b4f('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x4b4f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x4b4f('0xb'),'no'),'defaultValue':_0x4b4f('0xb'),'allowNull':![]},'stamp':{'type':_0x4b4f('0xd')},'emailsubject':{'type':Sequelize[_0x4b4f('0x2')]},'emailbody':{'type':Sequelize[_0x4b4f('0x2')]},'maxsecs':{'type':Sequelize[_0x4b4f('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4b4f('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4b4f('0xf')],'get':function(){return this[_0x4b4f('0x10')]('fullname')+_0x4b4f('0x11')+this[_0x4b4f('0x10')](_0x4b4f('0x12'));}}}; \ No newline at end of file +var _0x0508=['getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x20b5d1,_0x350228){var _0x28205b=function(_0xaddbf6){while(--_0xaddbf6){_0x20b5d1['push'](_0x20b5d1['shift']());}};_0x28205b(++_0x350228);}(_0x0508,0xa6));var _0x8050=function(_0x56c3e5,_0x5dce88){_0x56c3e5=_0x56c3e5-0x0;var _0x51268f=_0x0508[_0x56c3e5];return _0x51268f;};'use strict';var Sequelize=require(_0x8050('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8050('0x1')],'defaultValue':'from-voicemail','unique':_0x8050('0x2')},'mailbox':{'type':Sequelize[_0x8050('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x8050('0x1')]},'fullname':{'type':Sequelize[_0x8050('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x9246d7){this[_0x8050('0x3')](_0x8050('0x4'),typeof _0x9246d7===_0x8050('0x5')&&_0x9246d7[_0x8050('0x6')]()?_0x9246d7[_0x8050('0x6')]():null);}},'pager':{'type':Sequelize[_0x8050('0x1')]},'tz':{'type':Sequelize[_0x8050('0x1')],'defaultValue':_0x8050('0x7')},'attach':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':_0x8050('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8050('0x1')]},'callback':{'type':Sequelize[_0x8050('0x1')]},'review':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8050('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8050('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':_0x8050('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8050('0x8')](_0x8050('0x9'),'no'),'defaultValue':_0x8050('0x9'),'allowNull':![]},'stamp':{'type':_0x8050('0xb')},'emailsubject':{'type':Sequelize[_0x8050('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8050('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8050('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8050('0xd')],'get':function(){return this[_0x8050('0xe')](_0x8050('0xf'))+_0x8050('0x10')+this['getDataValue'](_0x8050('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index bc8e323..82fc4e9 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 _0x8af4=['../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','VoiceMail','rawAttributes','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x5df523,_0x6d61d0){var _0x7ad07c=function(_0x525d32){while(--_0x525d32){_0x5df523['push'](_0x5df523['shift']());}};_0x7ad07c(++_0x6d61d0);}(_0x8af4,0xe6));var _0x48af=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0x8af4[_0x22b70f];return _0x100985;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x48af('0x0'));var zipdir=require(_0x48af('0x1'));var jsonpatch=require(_0x48af('0x2'));var rp=require(_0x48af('0x3'));var moment=require(_0x48af('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x48af('0x5'));var path=require(_0x48af('0x6'));var sox=require('sox');var csv=require(_0x48af('0x7'));var ejs=require(_0x48af('0x8'));var fs=require('fs');var _=require(_0x48af('0x9'));var squel=require(_0x48af('0xa'));var crypto=require(_0x48af('0xb'));var jsforce=require(_0x48af('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x48af('0x7'));var querystring=require(_0x48af('0xd'));var Papa=require(_0x48af('0xe'));var Redis=require(_0x48af('0xf'));var authService=require(_0x48af('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x48af('0x11'));var logger=require('../../config/logger')(_0x48af('0x12'));var utils=require(_0x48af('0x13'));var config=require(_0x48af('0x14'));var db=require(_0x48af('0x15'))['db'];function respondWithStatusCode(_0x2383e6,_0xa518dd){_0xa518dd=_0xa518dd||0xcc;return function(_0x509461){if(_0x509461){return _0x2383e6['sendStatus'](_0xa518dd);}return _0x2383e6[_0x48af('0x16')](_0xa518dd)['end']();};}function respondWithResult(_0x433710,_0x4f877f){_0x4f877f=_0x4f877f||0xc8;return function(_0x5f5b83){if(_0x5f5b83){return _0x433710[_0x48af('0x16')](_0x4f877f)['json'](_0x5f5b83);}};}function respondWithFilteredResult(_0x2bc8e4,_0x335bc4){return function(_0x1d72d1){if(_0x1d72d1){var _0x2f6518=_0x1d72d1[_0x48af('0x17')],_0x183b0b=_0x335bc4['offset'],_0x20e1fc=_0x335bc4[_0x48af('0x18')]+_0x335bc4[_0x48af('0x19')],_0x290e97;if(_0x20e1fc>=_0x2f6518){_0x20e1fc=_0x2f6518;_0x290e97=0xc8;}else{_0x290e97=0xce;}_0x2bc8e4[_0x48af('0x16')](_0x290e97);return _0x2bc8e4['set'](_0x48af('0x1a'),_0x183b0b+'-'+_0x20e1fc+'/'+_0x2f6518)[_0x48af('0x1b')](_0x1d72d1);}return null;};}function patchUpdates(_0x1230e8){return function(_0x318b3b){try{jsonpatch[_0x48af('0x1c')](_0x318b3b,_0x1230e8,!![]);}catch(_0x27a83a){return BPromise[_0x48af('0x1d')](_0x27a83a);}return _0x318b3b[_0x48af('0x1e')]();};}function saveUpdates(_0xe59c81,_0x203545){return function(_0x716a9){if(_0x716a9){return _0x716a9[_0x48af('0x1f')](_0xe59c81)[_0x48af('0x20')](function(_0x24d130){return _0x24d130;});}return null;};}function removeEntity(_0x1dc76d,_0x478787){return function(_0x2a46df){if(_0x2a46df){return _0x2a46df[_0x48af('0x21')]()[_0x48af('0x20')](function(){var _0x8d8e18=_0x2a46df[_0x48af('0x22')]({'plain':!![]});var _0x3a8f11=_0x48af('0x23');return db[_0x48af('0x24')][_0x48af('0x21')]({'where':{'type':_0x3a8f11,'resourceId':_0x8d8e18['id']}})[_0x48af('0x20')](function(){return _0x2a46df;});})[_0x48af('0x20')](function(){_0x1dc76d[_0x48af('0x16')](0xcc)[_0x48af('0x25')]();});}};}function handleEntityNotFound(_0x837ad,_0x205c89){return function(_0x18a729){if(!_0x18a729){_0x837ad['sendStatus'](0x194);}return _0x18a729;};}function handleError(_0x2764e3,_0x48dd0a){_0x48dd0a=_0x48dd0a||0x1f4;return function(_0x4552a9){logger[_0x48af('0x26')](_0x4552a9[_0x48af('0x27')]);if(_0x4552a9[_0x48af('0x28')]){delete _0x4552a9[_0x48af('0x28')];}_0x2764e3['status'](_0x48dd0a)[_0x48af('0x29')](_0x4552a9);};}exports[_0x48af('0x2a')]=function(_0x307a76,_0x3c36c4){var _0x2057cc={},_0x2aefec={},_0x3b1d62={'count':0x0,'rows':[]};var _0x4c432d=db[_0x48af('0x2b')][_0x48af('0x2c')];_0x2aefec['model']=_[_0x48af('0x2d')](_0x4c432d);_0x2aefec[_0x48af('0x2e')]=_[_0x48af('0x2d')](_0x307a76[_0x48af('0x2e')]);_0x2aefec[_0x48af('0x2f')]=_[_0x48af('0x30')](_0x2aefec['model'],_0x2aefec[_0x48af('0x2e')]);_0x2057cc[_0x48af('0x31')]=_[_0x48af('0x30')](_0x2aefec['model'],qs[_0x48af('0x32')](_0x307a76[_0x48af('0x2e')]['fields']));_0x2057cc[_0x48af('0x31')]=_0x2057cc[_0x48af('0x31')]['length']?_0x2057cc['attributes']:_0x2aefec[_0x48af('0x33')];if(!_0x307a76[_0x48af('0x2e')][_0x48af('0x34')](_0x48af('0x35'))){_0x2057cc[_0x48af('0x19')]=qs['limit'](_0x307a76[_0x48af('0x2e')]['limit']);_0x2057cc[_0x48af('0x18')]=qs[_0x48af('0x18')](_0x307a76['query'][_0x48af('0x18')]);}_0x2057cc[_0x48af('0x36')]=qs[_0x48af('0x37')](_0x307a76[_0x48af('0x2e')]['sort']);_0x2057cc[_0x48af('0x38')]=qs[_0x48af('0x2f')](_[_0x48af('0x39')](_0x307a76[_0x48af('0x2e')],_0x2aefec[_0x48af('0x2f')]));if(_0x307a76[_0x48af('0x2e')][_0x48af('0x3a')]){_0x2057cc[_0x48af('0x38')]=_[_0x48af('0x3b')](_0x2057cc['where'],{'$or':_['map'](_0x4c432d,function(_0x425c51){if(_0x425c51[_0x48af('0x3c')]['key']!==_0x48af('0x3d')){var _0x320c58={};_0x320c58[_0x425c51[_0x48af('0x3e')]]={'$like':'%'+_0x307a76['query']['filter']+'%'};return _0x320c58;}})});}_0x2057cc=_[_0x48af('0x3b')]({},_0x2057cc,_0x307a76[_0x48af('0x3f')]);var _0x5cecf6={'where':_0x2057cc[_0x48af('0x38')]};return db[_0x48af('0x2b')][_0x48af('0x17')](_0x5cecf6)[_0x48af('0x20')](function(_0x3d4983){_0x3b1d62[_0x48af('0x17')]=_0x3d4983;if(_0x307a76[_0x48af('0x2e')][_0x48af('0x40')]){_0x2057cc[_0x48af('0x41')]=[{'all':!![]}];}return db['VoiceMail'][_0x48af('0x42')](_0x2057cc);})['then'](function(_0x21b1ea){_0x3b1d62[_0x48af('0x43')]=_0x21b1ea;return _0x3b1d62;})[_0x48af('0x20')](respondWithFilteredResult(_0x3c36c4,_0x2057cc))[_0x48af('0x44')](handleError(_0x3c36c4,null));};exports['show']=function(_0x51ca3d,_0x14dfe1){var _0x1e3f03={'raw':!![],'where':{'id':_0x51ca3d['params']['id']}},_0x150c48={};_0x150c48[_0x48af('0x33')]=_['keys'](db['VoiceMail'][_0x48af('0x2c')]);_0x150c48['query']=_['keys'](_0x51ca3d['query']);_0x150c48[_0x48af('0x2f')]=_[_0x48af('0x30')](_0x150c48['model'],_0x150c48['query']);_0x1e3f03[_0x48af('0x31')]=_[_0x48af('0x30')](_0x150c48[_0x48af('0x33')],qs['fields'](_0x51ca3d['query'][_0x48af('0x32')]));_0x1e3f03['attributes']=_0x1e3f03['attributes'][_0x48af('0x45')]?_0x1e3f03[_0x48af('0x31')]:_0x150c48[_0x48af('0x33')];if(_0x51ca3d[_0x48af('0x2e')][_0x48af('0x40')]){_0x1e3f03[_0x48af('0x41')]=[{'all':!![]}];}_0x1e3f03=_[_0x48af('0x3b')]({},_0x1e3f03,_0x51ca3d[_0x48af('0x3f')]);return db[_0x48af('0x2b')]['find'](_0x1e3f03)[_0x48af('0x20')](handleEntityNotFound(_0x14dfe1,null))[_0x48af('0x20')](respondWithResult(_0x14dfe1,null))[_0x48af('0x44')](handleError(_0x14dfe1,null));};exports[_0x48af('0x46')]=function(_0x36a952,_0x2a3237){return db[_0x48af('0x2b')][_0x48af('0x46')](_0x36a952[_0x48af('0x47')],{})[_0x48af('0x20')](function(_0x4b67fa){var _0x303b56=_0x36a952[_0x48af('0x48')][_0x48af('0x22')]({'plain':!![]});if(!_0x303b56)throw new Error(_0x48af('0x49'));if(_0x303b56['role']==='user'){var _0x538743=_0x4b67fa[_0x48af('0x22')]({'plain':!![]});var _0x3597f1=_0x48af('0x23');return db[_0x48af('0x4a')][_0x48af('0x4b')]({'where':{'name':_0x3597f1,'userProfileId':_0x303b56[_0x48af('0x4c')]},'raw':!![]})['then'](function(_0xb7bcf9){if(_0xb7bcf9&&_0xb7bcf9[_0x48af('0x4d')]===0x0){return db['UserProfileResource'][_0x48af('0x46')]({'name':_0x538743[_0x48af('0x28')],'resourceId':_0x538743['id'],'type':_0xb7bcf9[_0x48af('0x28')],'sectionId':_0xb7bcf9['id']},{})[_0x48af('0x20')](function(){return _0x4b67fa;});}else{return _0x4b67fa;}})[_0x48af('0x44')](function(_0x4e05e0){logger[_0x48af('0x26')](_0x48af('0x4e'),_0x4e05e0);throw _0x4e05e0;});}return _0x4b67fa;})['then'](respondWithResult(_0x2a3237,0xc9))[_0x48af('0x44')](handleError(_0x2a3237,null));};exports[_0x48af('0x1f')]=function(_0x352710,_0x4a32a5){if(_0x352710[_0x48af('0x47')]['id']){delete _0x352710['body']['id'];}return db['VoiceMail']['find']({'where':{'id':_0x352710[_0x48af('0x4f')]['id']}})[_0x48af('0x20')](handleEntityNotFound(_0x4a32a5,null))['then'](saveUpdates(_0x352710[_0x48af('0x47')],null))[_0x48af('0x20')](respondWithResult(_0x4a32a5,null))[_0x48af('0x44')](handleError(_0x4a32a5,null));};exports[_0x48af('0x21')]=function(_0x19c3e1,_0x1a62bc){return db[_0x48af('0x2b')][_0x48af('0x4b')]({'where':{'id':_0x19c3e1[_0x48af('0x4f')]['id']}})[_0x48af('0x20')](handleEntityNotFound(_0x1a62bc,null))[_0x48af('0x20')](removeEntity(_0x1a62bc,null))[_0x48af('0x44')](handleError(_0x1a62bc,null));};exports['getMessages']=function(_0xe5ea4e,_0x2d7d47,_0x4b6185){return db[_0x48af('0x2b')]['findOne']({'where':{'id':_0xe5ea4e['params']['id']}})['then'](handleEntityNotFound(_0x2d7d47,null))['then'](function(_0x4cacae){var _0x3bdc92;var _0x54d162={},_0x31becf={};_0x31becf[_0x48af('0x33')]=_['keys'](db[_0x48af('0x50')][_0x48af('0x2c')]);_0x31becf[_0x48af('0x2e')]=_[_0x48af('0x2d')](_0xe5ea4e[_0x48af('0x2e')]);_0x31becf[_0x48af('0x2f')]=_[_0x48af('0x30')](_0x31becf[_0x48af('0x33')],_0x31becf['query']);_0x54d162[_0x48af('0x31')]=_[_0x48af('0x30')](_0x31becf[_0x48af('0x33')],qs[_0x48af('0x32')](_0xe5ea4e[_0x48af('0x2e')]['fields']));_0x54d162[_0x48af('0x31')]=_0x54d162[_0x48af('0x31')][_0x48af('0x45')]?_0x54d162['attributes']:_0x31becf[_0x48af('0x33')];if(!_0xe5ea4e[_0x48af('0x2e')][_0x48af('0x34')](_0x48af('0x35'))){_0x54d162[_0x48af('0x19')]=qs[_0x48af('0x19')](_0xe5ea4e[_0x48af('0x2e')]['limit']);_0x54d162['offset']=qs[_0x48af('0x18')](_0xe5ea4e[_0x48af('0x2e')][_0x48af('0x18')]);}_0x54d162['order']=qs['sort'](_0xe5ea4e[_0x48af('0x2e')]['sort']);_0x54d162[_0x48af('0x38')]=qs[_0x48af('0x2f')](_[_0x48af('0x39')](_0xe5ea4e['query'],_0x31becf[_0x48af('0x2f')]));if(_0xe5ea4e[_0x48af('0x2e')][_0x48af('0x3a')]){_0x54d162[_0x48af('0x38')]=_['merge'](_0x54d162['where'],{'$or':_['map'](_0x54d162[_0x48af('0x31')],function(_0x48f3f1){var _0x26b90c={};_0x26b90c[_0x48f3f1]={'$like':'%'+_0xe5ea4e[_0x48af('0x2e')]['filter']+'%'};return _0x26b90c;})});}_0x54d162[_0x48af('0x38')]=_[_0x48af('0x3b')](_0x54d162[_0x48af('0x38')],{'mailboxuser':_0x4cacae[_0x48af('0x51')]});_0x54d162=_[_0x48af('0x3b')]({},_0x54d162,_0xe5ea4e[_0x48af('0x3f')]);return db['VoiceMailMessage'][_0x48af('0x52')](_0x54d162)['then'](respondWithFilteredResult(_0x2d7d47,_0x54d162));})['catch'](handleError(_0x2d7d47,null));}; \ No newline at end of file +var _0x9e46=['order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','getMessages','findOne','VoiceMailMessage','findAndCountAll','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoiceMail','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x20b221,_0x14b495){var _0x3eb3e9=function(_0xc9e6f5){while(--_0xc9e6f5){_0x20b221['push'](_0x20b221['shift']());}};_0x3eb3e9(++_0x14b495);}(_0x9e46,0x1db));var _0x69e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e46[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x69e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x69e4('0x1'));var zipdir=require(_0x69e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69e4('0x3'));var moment=require(_0x69e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x69e4('0x5'));var util=require('util');var path=require(_0x69e4('0x6'));var sox=require(_0x69e4('0x7'));var csv=require('to-csv');var ejs=require(_0x69e4('0x8'));var fs=require('fs');var _=require(_0x69e4('0x9'));var squel=require(_0x69e4('0xa'));var crypto=require('crypto');var jsforce=require(_0x69e4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x69e4('0xc'));var querystring=require(_0x69e4('0xd'));var Papa=require(_0x69e4('0xe'));var Redis=require('ioredis');var authService=require(_0x69e4('0xf'));var qs=require(_0x69e4('0x10'));var hardwareService=require(_0x69e4('0x11'));var logger=require(_0x69e4('0x12'))(_0x69e4('0x13'));var utils=require(_0x69e4('0x14'));var config=require(_0x69e4('0x15'));var db=require(_0x69e4('0x16'))['db'];function respondWithStatusCode(_0x176aeb,_0x1d3d89){_0x1d3d89=_0x1d3d89||0xcc;return function(_0x413bf8){if(_0x413bf8){return _0x176aeb[_0x69e4('0x17')](_0x1d3d89);}return _0x176aeb['status'](_0x1d3d89)[_0x69e4('0x18')]();};}function respondWithResult(_0x2a7415,_0x51417d){_0x51417d=_0x51417d||0xc8;return function(_0x2725ab){if(_0x2725ab){return _0x2a7415['status'](_0x51417d)['json'](_0x2725ab);}};}function respondWithFilteredResult(_0x984c70,_0x1c1441){return function(_0xf96754){if(_0xf96754){var _0x47f9ce=_0xf96754[_0x69e4('0x19')],_0x32dbe7=_0x1c1441[_0x69e4('0x1a')],_0x2387cb=_0x1c1441['offset']+_0x1c1441[_0x69e4('0x1b')],_0x19ad66;if(_0x2387cb>=_0x47f9ce){_0x2387cb=_0x47f9ce;_0x19ad66=0xc8;}else{_0x19ad66=0xce;}_0x984c70[_0x69e4('0x1c')](_0x19ad66);return _0x984c70[_0x69e4('0x1d')](_0x69e4('0x1e'),_0x32dbe7+'-'+_0x2387cb+'/'+_0x47f9ce)[_0x69e4('0x1f')](_0xf96754);}return null;};}function patchUpdates(_0x58d3ef){return function(_0x2e9935){try{jsonpatch['apply'](_0x2e9935,_0x58d3ef,!![]);}catch(_0x252d05){return BPromise[_0x69e4('0x20')](_0x252d05);}return _0x2e9935[_0x69e4('0x21')]();};}function saveUpdates(_0x31b6c8,_0x52b18c){return function(_0x4fe493){if(_0x4fe493){return _0x4fe493['update'](_0x31b6c8)[_0x69e4('0x22')](function(_0x4124c0){return _0x4124c0;});}return null;};}function removeEntity(_0xc3f12a,_0x5776f2){return function(_0x464246){if(_0x464246){return _0x464246[_0x69e4('0x23')]()[_0x69e4('0x22')](function(){var _0x1bd3ed=_0x464246[_0x69e4('0x24')]({'plain':!![]});var _0x4d1389='Voicemails';return db[_0x69e4('0x25')]['destroy']({'where':{'type':_0x4d1389,'resourceId':_0x1bd3ed['id']}})[_0x69e4('0x22')](function(){return _0x464246;});})[_0x69e4('0x22')](function(){_0xc3f12a[_0x69e4('0x1c')](0xcc)[_0x69e4('0x18')]();});}};}function handleEntityNotFound(_0x10d756,_0x40cd95){return function(_0x28f5f1){if(!_0x28f5f1){_0x10d756['sendStatus'](0x194);}return _0x28f5f1;};}function handleError(_0x1f0029,_0x3470d7){_0x3470d7=_0x3470d7||0x1f4;return function(_0x500c36){logger[_0x69e4('0x26')](_0x500c36[_0x69e4('0x27')]);if(_0x500c36['name']){delete _0x500c36[_0x69e4('0x28')];}_0x1f0029[_0x69e4('0x1c')](_0x3470d7)[_0x69e4('0x29')](_0x500c36);};}exports[_0x69e4('0x2a')]=function(_0x1193d5,_0x461894){var _0x490f8f={},_0x3cd377={},_0x457fb0={'count':0x0,'rows':[]};var _0x13e943=db[_0x69e4('0x2b')]['rawAttributes'];_0x3cd377[_0x69e4('0x2c')]=_[_0x69e4('0x2d')](_0x13e943);_0x3cd377[_0x69e4('0x2e')]=_[_0x69e4('0x2d')](_0x1193d5[_0x69e4('0x2e')]);_0x3cd377['filters']=_['intersection'](_0x3cd377['model'],_0x3cd377[_0x69e4('0x2e')]);_0x490f8f[_0x69e4('0x2f')]=_[_0x69e4('0x30')](_0x3cd377[_0x69e4('0x2c')],qs[_0x69e4('0x31')](_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x31')]));_0x490f8f[_0x69e4('0x2f')]=_0x490f8f[_0x69e4('0x2f')][_0x69e4('0x32')]?_0x490f8f[_0x69e4('0x2f')]:_0x3cd377[_0x69e4('0x2c')];if(!_0x1193d5['query'][_0x69e4('0x33')](_0x69e4('0x34'))){_0x490f8f[_0x69e4('0x1b')]=qs[_0x69e4('0x1b')](_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x1b')]);_0x490f8f['offset']=qs['offset'](_0x1193d5['query'][_0x69e4('0x1a')]);}_0x490f8f[_0x69e4('0x35')]=qs['sort'](_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x36')]);_0x490f8f[_0x69e4('0x37')]=qs[_0x69e4('0x38')](_[_0x69e4('0x39')](_0x1193d5[_0x69e4('0x2e')],_0x3cd377['filters']));if(_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x3a')]){_0x490f8f[_0x69e4('0x37')]=_[_0x69e4('0x3b')](_0x490f8f[_0x69e4('0x37')],{'$or':_[_0x69e4('0x3c')](_0x13e943,function(_0x51ef12){if(_0x51ef12[_0x69e4('0x3d')][_0x69e4('0x3e')]!==_0x69e4('0x3f')){var _0x24eae4={};_0x24eae4[_0x51ef12['field']]={'$like':'%'+_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x3a')]+'%'};return _0x24eae4;}})});}_0x490f8f=_['merge']({},_0x490f8f,_0x1193d5[_0x69e4('0x40')]);var _0x86d00f={'where':_0x490f8f[_0x69e4('0x37')]};return db[_0x69e4('0x2b')][_0x69e4('0x19')](_0x86d00f)[_0x69e4('0x22')](function(_0x40317c){_0x457fb0[_0x69e4('0x19')]=_0x40317c;if(_0x1193d5[_0x69e4('0x2e')][_0x69e4('0x41')]){_0x490f8f[_0x69e4('0x42')]=[{'all':!![]}];}return db[_0x69e4('0x2b')][_0x69e4('0x43')](_0x490f8f);})[_0x69e4('0x22')](function(_0x22ab38){_0x457fb0[_0x69e4('0x44')]=_0x22ab38;return _0x457fb0;})['then'](respondWithFilteredResult(_0x461894,_0x490f8f))['catch'](handleError(_0x461894,null));};exports[_0x69e4('0x45')]=function(_0x4a1f22,_0x26751){var _0x22d226={'raw':!![],'where':{'id':_0x4a1f22['params']['id']}},_0x39f98e={};_0x39f98e[_0x69e4('0x2c')]=_[_0x69e4('0x2d')](db['VoiceMail'][_0x69e4('0x46')]);_0x39f98e[_0x69e4('0x2e')]=_[_0x69e4('0x2d')](_0x4a1f22[_0x69e4('0x2e')]);_0x39f98e['filters']=_[_0x69e4('0x30')](_0x39f98e['model'],_0x39f98e[_0x69e4('0x2e')]);_0x22d226[_0x69e4('0x2f')]=_[_0x69e4('0x30')](_0x39f98e[_0x69e4('0x2c')],qs[_0x69e4('0x31')](_0x4a1f22[_0x69e4('0x2e')][_0x69e4('0x31')]));_0x22d226[_0x69e4('0x2f')]=_0x22d226['attributes'][_0x69e4('0x32')]?_0x22d226[_0x69e4('0x2f')]:_0x39f98e[_0x69e4('0x2c')];if(_0x4a1f22['query']['includeAll']){_0x22d226['include']=[{'all':!![]}];}_0x22d226=_['merge']({},_0x22d226,_0x4a1f22[_0x69e4('0x40')]);return db[_0x69e4('0x2b')][_0x69e4('0x47')](_0x22d226)[_0x69e4('0x22')](handleEntityNotFound(_0x26751,null))[_0x69e4('0x22')](respondWithResult(_0x26751,null))[_0x69e4('0x48')](handleError(_0x26751,null));};exports['create']=function(_0x45d3a7,_0x1a738b){return db[_0x69e4('0x2b')][_0x69e4('0x49')](_0x45d3a7['body'],{})[_0x69e4('0x22')](function(_0xaa183){var _0x19e8b7=_0x45d3a7[_0x69e4('0x4a')][_0x69e4('0x24')]({'plain':!![]});if(!_0x19e8b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19e8b7[_0x69e4('0x4b')]===_0x69e4('0x4a')){var _0xe6dadb=_0xaa183[_0x69e4('0x24')]({'plain':!![]});var _0x2c8ce7=_0x69e4('0x4c');return db[_0x69e4('0x4d')]['find']({'where':{'name':_0x2c8ce7,'userProfileId':_0x19e8b7[_0x69e4('0x4e')]},'raw':!![]})[_0x69e4('0x22')](function(_0x2dc54e){if(_0x2dc54e&&_0x2dc54e[_0x69e4('0x4f')]===0x0){return db['UserProfileResource'][_0x69e4('0x49')]({'name':_0xe6dadb[_0x69e4('0x28')],'resourceId':_0xe6dadb['id'],'type':_0x2dc54e['name'],'sectionId':_0x2dc54e['id']},{})[_0x69e4('0x22')](function(){return _0xaa183;});}else{return _0xaa183;}})[_0x69e4('0x48')](function(_0x354e9e){logger['error'](_0x69e4('0x50'),_0x354e9e);throw _0x354e9e;});}return _0xaa183;})[_0x69e4('0x22')](respondWithResult(_0x1a738b,0xc9))[_0x69e4('0x48')](handleError(_0x1a738b,null));};exports[_0x69e4('0x51')]=function(_0x25f20a,_0x5dc8b6){if(_0x25f20a[_0x69e4('0x52')]['id']){delete _0x25f20a['body']['id'];}return db[_0x69e4('0x2b')]['find']({'where':{'id':_0x25f20a[_0x69e4('0x53')]['id']}})[_0x69e4('0x22')](handleEntityNotFound(_0x5dc8b6,null))[_0x69e4('0x22')](saveUpdates(_0x25f20a[_0x69e4('0x52')],null))[_0x69e4('0x22')](respondWithResult(_0x5dc8b6,null))[_0x69e4('0x48')](handleError(_0x5dc8b6,null));};exports[_0x69e4('0x23')]=function(_0x5e013f,_0x326278){return db[_0x69e4('0x2b')]['find']({'where':{'id':_0x5e013f[_0x69e4('0x53')]['id']}})['then'](handleEntityNotFound(_0x326278,null))['then'](removeEntity(_0x326278,null))[_0x69e4('0x48')](handleError(_0x326278,null));};exports[_0x69e4('0x54')]=function(_0xae3fd8,_0x387657,_0xb0bf2b){return db[_0x69e4('0x2b')][_0x69e4('0x55')]({'where':{'id':_0xae3fd8[_0x69e4('0x53')]['id']}})[_0x69e4('0x22')](handleEntityNotFound(_0x387657,null))[_0x69e4('0x22')](function(_0x4258db){var _0x2ea11a;var _0x460f36={},_0x5ce39f={};_0x5ce39f['model']=_['keys'](db[_0x69e4('0x56')][_0x69e4('0x46')]);_0x5ce39f['query']=_[_0x69e4('0x2d')](_0xae3fd8[_0x69e4('0x2e')]);_0x5ce39f[_0x69e4('0x38')]=_[_0x69e4('0x30')](_0x5ce39f[_0x69e4('0x2c')],_0x5ce39f[_0x69e4('0x2e')]);_0x460f36[_0x69e4('0x2f')]=_[_0x69e4('0x30')](_0x5ce39f['model'],qs[_0x69e4('0x31')](_0xae3fd8[_0x69e4('0x2e')]['fields']));_0x460f36['attributes']=_0x460f36[_0x69e4('0x2f')][_0x69e4('0x32')]?_0x460f36[_0x69e4('0x2f')]:_0x5ce39f['model'];if(!_0xae3fd8['query'][_0x69e4('0x33')](_0x69e4('0x34'))){_0x460f36[_0x69e4('0x1b')]=qs[_0x69e4('0x1b')](_0xae3fd8[_0x69e4('0x2e')]['limit']);_0x460f36['offset']=qs['offset'](_0xae3fd8[_0x69e4('0x2e')]['offset']);}_0x460f36[_0x69e4('0x35')]=qs['sort'](_0xae3fd8[_0x69e4('0x2e')][_0x69e4('0x36')]);_0x460f36['where']=qs[_0x69e4('0x38')](_['pick'](_0xae3fd8[_0x69e4('0x2e')],_0x5ce39f[_0x69e4('0x38')]));if(_0xae3fd8[_0x69e4('0x2e')][_0x69e4('0x3a')]){_0x460f36[_0x69e4('0x37')]=_[_0x69e4('0x3b')](_0x460f36[_0x69e4('0x37')],{'$or':_[_0x69e4('0x3c')](_0x460f36[_0x69e4('0x2f')],function(_0x13ad11){var _0x59727d={};_0x59727d[_0x13ad11]={'$like':'%'+_0xae3fd8[_0x69e4('0x2e')][_0x69e4('0x3a')]+'%'};return _0x59727d;})});}_0x460f36[_0x69e4('0x37')]=_[_0x69e4('0x3b')](_0x460f36[_0x69e4('0x37')],{'mailboxuser':_0x4258db['mailbox']});_0x460f36=_[_0x69e4('0x3b')]({},_0x460f36,_0xae3fd8[_0x69e4('0x40')]);return db[_0x69e4('0x56')][_0x69e4('0x57')](_0x460f36)[_0x69e4('0x22')](respondWithFilteredResult(_0x387657,_0x460f36));})[_0x69e4('0x48')](handleError(_0x387657,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 82f3839..eabc3a1 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 _0xcd31=['lodash','util','api','moment','path','../../config/environment','./voiceMail.attributes','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x53c208,_0x2e925c){var _0x4426b1=function(_0x545355){while(--_0x545355){_0x53c208['push'](_0x53c208['shift']());}};_0x4426b1(++_0x2e925c);}(_0xcd31,0x79));var _0x1cd3=function(_0x2b9f6f,_0x132d97){_0x2b9f6f=_0x2b9f6f-0x0;var _0x2bc9f8=_0xcd31[_0x2b9f6f];return _0x2bc9f8;};'use strict';var _=require(_0x1cd3('0x0'));var util=require(_0x1cd3('0x1'));var logger=require('../../config/logger')(_0x1cd3('0x2'));var moment=require(_0x1cd3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cd3('0x4'));var rimraf=require('rimraf');var config=require(_0x1cd3('0x5'));var attributes=require(_0x1cd3('0x6'));module['exports']=function(_0x557bdc,_0x3ad629){return _0x557bdc['define']('VoiceMail',attributes,{'tableName':_0x1cd3('0x7'),'paranoid':![],'indexes':[{'name':_0x1cd3('0x8'),'fields':[_0x1cd3('0x9'),_0x1cd3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28bb=['exports','define','VoiceMail','voice_voicemail','mailbox_context','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x25069a,_0x38bba9){var _0x1cbaca=function(_0x44132c){while(--_0x44132c){_0x25069a['push'](_0x25069a['shift']());}};_0x1cbaca(++_0x38bba9);}(_0x28bb,0x8c));var _0xb28b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x28bb[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xb28b('0x0'));var util=require(_0xb28b('0x1'));var logger=require('../../config/logger')(_0xb28b('0x2'));var moment=require(_0xb28b('0x3'));var BPromise=require(_0xb28b('0x4'));var rp=require(_0xb28b('0x5'));var fs=require('fs');var path=require(_0xb28b('0x6'));var rimraf=require(_0xb28b('0x7'));var config=require(_0xb28b('0x8'));var attributes=require(_0xb28b('0x9'));module[_0xb28b('0xa')]=function(_0x88837a,_0xf5c42e){return _0x88837a[_0xb28b('0xb')](_0xb28b('0xc'),attributes,{'tableName':_0xb28b('0xd'),'paranoid':![],'indexes':[{'name':_0xb28b('0xe'),'fields':['mailbox','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 b59e214..47224f0 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 _0x54b4=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch'];(function(_0x171ba8,_0x570344){var _0x51e64f=function(_0x1e8d31){while(--_0x1e8d31){_0x171ba8['push'](_0x171ba8['shift']());}};_0x51e64f(++_0x570344);}(_0x54b4,0x111));var _0x454b=function(_0x22e8bb,_0x34fb3e){_0x22e8bb=_0x22e8bb-0x0;var _0x270dca=_0x54b4[_0x22e8bb];return _0x270dca;};'use strict';var _=require(_0x454b('0x0'));var util=require('util');var moment=require(_0x454b('0x1'));var BPromise=require(_0x454b('0x2'));var rs=require(_0x454b('0x3'));var fs=require('fs');var Redis=require(_0x454b('0x4'));var db=require(_0x454b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x454b('0x6'))('rpc');var config=require(_0x454b('0x7'));var jayson=require(_0x454b('0x8'));var client=jayson[_0x454b('0x9')][_0x454b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575f97,_0x234a83,_0x2e7ea6){return new BPromise(function(_0x2e8132,_0x487d98){return client[_0x454b('0xb')](_0x575f97,_0x2e7ea6)['then'](function(_0x321f07){logger[_0x454b('0xc')](_0x454b('0xd'),_0x234a83,'request\x20sent');logger[_0x454b('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x234a83,_0x454b('0xf'),JSON[_0x454b('0x10')](_0x321f07));if(_0x321f07[_0x454b('0x11')]){if(_0x321f07[_0x454b('0x11')][_0x454b('0x12')]===0x1f4){logger[_0x454b('0x11')](_0x454b('0xd'),_0x234a83,_0x321f07[_0x454b('0x11')][_0x454b('0x13')]);return _0x487d98(_0x321f07[_0x454b('0x11')][_0x454b('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x234a83,_0x321f07[_0x454b('0x11')][_0x454b('0x13')]);return _0x2e8132(_0x321f07['error'][_0x454b('0x13')]);}else{logger['info'](_0x454b('0xd'),_0x234a83,_0x454b('0xf'));_0x2e8132(_0x321f07['result']['message']);}})[_0x454b('0x14')](function(_0x44d33f){logger[_0x454b('0x11')](_0x454b('0xd'),_0x234a83,_0x44d33f);_0x487d98(_0x44d33f);});});} \ No newline at end of file +var _0x8c7f=['error','code','VoiceMail,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify'];(function(_0x179fc5,_0x1684d9){var _0x196996=function(_0x56187f){while(--_0x56187f){_0x179fc5['push'](_0x179fc5['shift']());}};_0x196996(++_0x1684d9);}(_0x8c7f,0x194));var _0xf8c7=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x8c7f[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0xf8c7('0x0'));var moment=require(_0xf8c7('0x1'));var BPromise=require(_0xf8c7('0x2'));var rs=require(_0xf8c7('0x3'));var fs=require('fs');var Redis=require(_0xf8c7('0x4'));var db=require(_0xf8c7('0x5'))['db'];var utils=require(_0xf8c7('0x6'));var logger=require(_0xf8c7('0x7'))('rpc');var config=require(_0xf8c7('0x8'));var jayson=require(_0xf8c7('0x9'));var client=jayson[_0xf8c7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b6f6d,_0x10c477,_0x17c717){return new BPromise(function(_0x491f2d,_0x33dbb7){return client[_0xf8c7('0xb')](_0x4b6f6d,_0x17c717)['then'](function(_0x562803){logger[_0xf8c7('0xc')]('VoiceMail,\x20%s,\x20%s',_0x10c477,_0xf8c7('0xd'));logger[_0xf8c7('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x10c477,_0xf8c7('0xd'),JSON[_0xf8c7('0xf')](_0x562803));if(_0x562803[_0xf8c7('0x10')]){if(_0x562803[_0xf8c7('0x10')][_0xf8c7('0x11')]===0x1f4){logger['error'](_0xf8c7('0x12'),_0x10c477,_0x562803['error'][_0xf8c7('0x13')]);return _0x33dbb7(_0x562803[_0xf8c7('0x10')]['message']);}logger[_0xf8c7('0x10')](_0xf8c7('0x12'),_0x10c477,_0x562803[_0xf8c7('0x10')]['message']);return _0x491f2d(_0x562803[_0xf8c7('0x10')][_0xf8c7('0x13')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x10c477,_0xf8c7('0xd'));_0x491f2d(_0x562803['result'][_0xf8c7('0x13')]);}})[_0xf8c7('0x14')](function(_0x1b55ad){logger[_0xf8c7('0x10')](_0xf8c7('0x12'),_0x10c477,_0x1b55ad);_0x33dbb7(_0x1b55ad);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 34bf6f0..e4a59c2 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 _0x9cba=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','put','update','delete'];(function(_0x972692,_0x2a1c56){var _0x542e84=function(_0xe63f21){while(--_0xe63f21){_0x972692['push'](_0x972692['shift']());}};_0x542e84(++_0x2a1c56);}(_0x9cba,0x10a));var _0xa9cb=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9cba[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xa9cb('0x0'));var util=require(_0xa9cb('0x1'));var path=require(_0xa9cb('0x2'));var timeout=require(_0xa9cb('0x3'));var express=require(_0xa9cb('0x4'));var router=express[_0xa9cb('0x5')]();var auth=require(_0xa9cb('0x6'));var interaction=require(_0xa9cb('0x7'));var config=require(_0xa9cb('0x8'));var controller=require(_0xa9cb('0x9'));router[_0xa9cb('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9cb('0xb')]);router[_0xa9cb('0xa')](_0xa9cb('0xc'),auth[_0xa9cb('0xd')](),controller[_0xa9cb('0xe')]);router[_0xa9cb('0xa')](_0xa9cb('0xf'),auth[_0xa9cb('0xd')](),controller[_0xa9cb('0x10')]);router['post']('/',auth[_0xa9cb('0xd')](),controller['create']);router[_0xa9cb('0x11')](_0xa9cb('0xc'),auth[_0xa9cb('0xd')](),controller[_0xa9cb('0x12')]);router[_0xa9cb('0x13')](_0xa9cb('0xc'),auth[_0xa9cb('0xd')](),controller[_0xa9cb('0x14')]);module[_0xa9cb('0x15')]=router; \ No newline at end of file +var _0xec8c=['put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','create'];(function(_0x407a1b,_0x367d65){var _0x54e3e6=function(_0x464a24){while(--_0x464a24){_0x407a1b['push'](_0x407a1b['shift']());}};_0x54e3e6(++_0x367d65);}(_0xec8c,0xac));var _0xcec8=function(_0x1c461e,_0x1b98ff){_0x1c461e=_0x1c461e-0x0;var _0x1dce4f=_0xec8c[_0x1c461e];return _0x1dce4f;};'use strict';var multer=require(_0xcec8('0x0'));var util=require(_0xcec8('0x1'));var path=require(_0xcec8('0x2'));var timeout=require(_0xcec8('0x3'));var express=require(_0xcec8('0x4'));var router=express[_0xcec8('0x5')]();var auth=require(_0xcec8('0x6'));var interaction=require(_0xcec8('0x7'));var config=require(_0xcec8('0x8'));var controller=require(_0xcec8('0x9'));router[_0xcec8('0xa')]('/',auth[_0xcec8('0xb')](),controller[_0xcec8('0xc')]);router[_0xcec8('0xa')]('/:id',auth[_0xcec8('0xb')](),controller[_0xcec8('0xd')]);router['get'](_0xcec8('0xe'),auth[_0xcec8('0xb')](),controller[_0xcec8('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcec8('0x10')]);router[_0xcec8('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcec8('0x12')](_0xcec8('0x13'),auth[_0xcec8('0xb')](),controller[_0xcec8('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3d16ae2..f871e08 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 _0xe6c8=['STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x283865,_0x495c7f){var _0x4d2713=function(_0x32db6b){while(--_0x32db6b){_0x283865['push'](_0x283865['shift']());}};_0x4d2713(++_0x495c7f);}(_0xe6c8,0x1cc));var _0x8e6c=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xe6c8[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x8e6c('0x0'));module[_0x8e6c('0x1')]={'name':{'type':Sequelize[_0x8e6c('0x2')],'get':function(_0x4ffa8b){return this[_0x8e6c('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8e6c('0x5')](_0x8e6c('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x8e6c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x8e6c('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0xad3c=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0xad3c,0x1ee));var _0xcad3=function(_0x25741f,_0x422ef3){_0x25741f=_0x25741f-0x0;var _0x3bf927=_0xad3c[_0x25741f];return _0x3bf927;};'use strict';var Sequelize=require(_0xcad3('0x0'));module[_0xcad3('0x1')]={'name':{'type':Sequelize[_0xcad3('0x2')],'get':function(_0x4c90f3){return this[_0xcad3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xcad3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xcad3('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xcad3('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcad3('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcad3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xcad3('0x6')](_0xcad3('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xcad3('0x5')],'defaultValue':''},'stamp':{'type':_0xcad3('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 264d6e4..3d2eb27 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 _0x9429=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','send','index','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','count','then','includeAll','findAll','rows','catch','show','params','fields','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','rimraf'];(function(_0x133f69,_0x2d4632){var _0x3b67bb=function(_0x203583){while(--_0x203583){_0x133f69['push'](_0x133f69['shift']());}};_0x3b67bb(++_0x2d4632);}(_0x9429,0xa4));var _0x9942=function(_0x520bfe,_0x3fb339){_0x520bfe=_0x520bfe-0x0;var _0x5831d6=_0x9429[_0x520bfe];return _0x5831d6;};'use strict';var pdf=require(_0x9942('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9942('0x1'));var zipdir=require(_0x9942('0x2'));var jsonpatch=require(_0x9942('0x3'));var rp=require(_0x9942('0x4'));var moment=require(_0x9942('0x5'));var BPromise=require(_0x9942('0x6'));var Mustache=require(_0x9942('0x7'));var util=require(_0x9942('0x8'));var path=require(_0x9942('0x9'));var sox=require('sox');var csv=require(_0x9942('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9942('0xb'));var squel=require(_0x9942('0xc'));var crypto=require(_0x9942('0xd'));var jsforce=require(_0x9942('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9942('0xa'));var querystring=require('querystring');var Papa=require(_0x9942('0xf'));var Redis=require(_0x9942('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9942('0x11'));var hardwareService=require(_0x9942('0x12'));var logger=require(_0x9942('0x13'))(_0x9942('0x14'));var utils=require(_0x9942('0x15'));var config=require(_0x9942('0x16'));var db=require(_0x9942('0x17'))['db'];function respondWithStatusCode(_0x5ce830,_0x524242){_0x524242=_0x524242||0xcc;return function(_0x1c13d0){if(_0x1c13d0){return _0x5ce830[_0x9942('0x18')](_0x524242);}return _0x5ce830[_0x9942('0x19')](_0x524242)[_0x9942('0x1a')]();};}function respondWithResult(_0x2803f6,_0x5ed725){_0x5ed725=_0x5ed725||0xc8;return function(_0x3b3646){if(_0x3b3646){return _0x2803f6[_0x9942('0x19')](_0x5ed725)[_0x9942('0x1b')](_0x3b3646);}};}function respondWithFilteredResult(_0x50e7ee,_0x1924b4){return function(_0x453cc4){if(_0x453cc4){var _0x10e1b0=_0x453cc4['count'],_0x6284af=_0x1924b4[_0x9942('0x1c')],_0x39f448=_0x1924b4['offset']+_0x1924b4[_0x9942('0x1d')],_0x4a4407;if(_0x39f448>=_0x10e1b0){_0x39f448=_0x10e1b0;_0x4a4407=0xc8;}else{_0x4a4407=0xce;}_0x50e7ee['status'](_0x4a4407);return _0x50e7ee['set'](_0x9942('0x1e'),_0x6284af+'-'+_0x39f448+'/'+_0x10e1b0)['json'](_0x453cc4);}return null;};}function patchUpdates(_0x44a29a){return function(_0x103017){try{jsonpatch[_0x9942('0x1f')](_0x103017,_0x44a29a,!![]);}catch(_0x170f6b){return BPromise[_0x9942('0x20')](_0x170f6b);}return _0x103017[_0x9942('0x21')]();};}function saveUpdates(_0x19455d,_0x4226c4){return function(_0x19e35a){if(_0x19e35a){return _0x19e35a[_0x9942('0x22')](_0x19455d)['then'](function(_0xb54294){return _0xb54294;});}return null;};}function removeEntity(_0x3f1ee4,_0x263371){return function(_0x146e0c){if(_0x146e0c){return _0x146e0c[_0x9942('0x23')]()['then'](function(){_0x3f1ee4[_0x9942('0x19')](0xcc)[_0x9942('0x1a')]();});}};}function handleEntityNotFound(_0xb31ee5,_0x8a8283){return function(_0xf785ce){if(!_0xf785ce){_0xb31ee5[_0x9942('0x18')](0x194);}return _0xf785ce;};}function handleError(_0x3d0512,_0x3ebd15){_0x3ebd15=_0x3ebd15||0x1f4;return function(_0xaa793e){logger['error'](_0xaa793e[_0x9942('0x24')]);if(_0xaa793e['name']){delete _0xaa793e['name'];}_0x3d0512[_0x9942('0x19')](_0x3ebd15)[_0x9942('0x25')](_0xaa793e);};}exports[_0x9942('0x26')]=function(_0x5cf1fd,_0x3699bf){var _0x407869={},_0x4a0852={},_0x33a1db={'count':0x0,'rows':[]};var _0x1ad138=db[_0x9942('0x27')][_0x9942('0x28')];_0x4a0852[_0x9942('0x29')]=_[_0x9942('0x2a')](_['keys'](_0x1ad138),['name']);_0x4a0852[_0x9942('0x2b')]=_[_0x9942('0x2c')](_0x5cf1fd[_0x9942('0x2b')]);_0x4a0852[_0x9942('0x2d')]=_[_0x9942('0x2e')](_0x4a0852['model'],_0x4a0852[_0x9942('0x2b')]);_0x407869[_0x9942('0x2f')]=_[_0x9942('0x2e')](_0x4a0852[_0x9942('0x29')],qs['fields'](_0x5cf1fd[_0x9942('0x2b')]['fields']));_0x407869[_0x9942('0x2f')]=_0x407869[_0x9942('0x2f')][_0x9942('0x30')]?_0x407869['attributes']:_0x4a0852[_0x9942('0x29')];if(!_0x5cf1fd[_0x9942('0x2b')][_0x9942('0x31')]('nolimit')){_0x407869[_0x9942('0x1d')]=qs['limit'](_0x5cf1fd[_0x9942('0x2b')][_0x9942('0x1d')]);_0x407869[_0x9942('0x1c')]=qs[_0x9942('0x1c')](_0x5cf1fd['query'][_0x9942('0x1c')]);}_0x407869[_0x9942('0x32')]=qs[_0x9942('0x33')](_0x5cf1fd['query'][_0x9942('0x33')]);_0x407869[_0x9942('0x34')]=qs[_0x9942('0x2d')](_[_0x9942('0x35')](_0x5cf1fd['query'],_0x4a0852[_0x9942('0x2d')]));if(_0x5cf1fd['query'][_0x9942('0x36')]){_0x407869['where']=_[_0x9942('0x37')](_0x407869[_0x9942('0x34')],{'$or':_[_0x9942('0x38')](_0x1ad138,function(_0x2ae12a){if(_0x2ae12a[_0x9942('0x39')]['key']!==_0x9942('0x3a')){var _0x476e48={};_0x476e48[_0x2ae12a[_0x9942('0x3b')]]={'$like':'%'+_0x5cf1fd[_0x9942('0x2b')][_0x9942('0x36')]+'%'};return _0x476e48;}})});}_0x407869=_[_0x9942('0x37')]({},_0x407869,_0x5cf1fd[_0x9942('0x3c')]);var _0x21da73={'where':_0x407869[_0x9942('0x34')]};return db[_0x9942('0x27')][_0x9942('0x3d')](_0x21da73)[_0x9942('0x3e')](function(_0x85bada){_0x33a1db[_0x9942('0x3d')]=_0x85bada;if(_0x5cf1fd[_0x9942('0x2b')][_0x9942('0x3f')]){_0x407869['include']=[{'all':!![]}];}return db[_0x9942('0x27')][_0x9942('0x40')](_0x407869);})['then'](function(_0xa2794){_0x33a1db[_0x9942('0x41')]=_0xa2794;return _0x33a1db;})[_0x9942('0x3e')](respondWithFilteredResult(_0x3699bf,_0x407869))[_0x9942('0x42')](handleError(_0x3699bf,null));};exports[_0x9942('0x43')]=function(_0x293567,_0x220fb3){var _0x4581f3={'raw':!![],'where':{'id':_0x293567[_0x9942('0x44')]['id']}},_0x19b0a4={};_0x19b0a4['model']=_['keys'](db[_0x9942('0x27')][_0x9942('0x28')]);_0x19b0a4['query']=_['keys'](_0x293567[_0x9942('0x2b')]);_0x19b0a4[_0x9942('0x2d')]=_[_0x9942('0x2e')](_0x19b0a4[_0x9942('0x29')],_0x19b0a4[_0x9942('0x2b')]);_0x4581f3[_0x9942('0x2f')]=_[_0x9942('0x2e')](_0x19b0a4[_0x9942('0x29')],qs[_0x9942('0x45')](_0x293567[_0x9942('0x2b')][_0x9942('0x45')]));_0x4581f3['attributes']=_0x4581f3['attributes'][_0x9942('0x30')]?_0x4581f3['attributes']:_0x19b0a4[_0x9942('0x29')];if(_0x293567[_0x9942('0x2b')][_0x9942('0x3f')]){_0x4581f3['include']=[{'all':!![]}];}_0x4581f3=_['merge']({},_0x4581f3,_0x293567['options']);return db['VoiceMailMessage'][_0x9942('0x46')](_0x4581f3)[_0x9942('0x3e')](handleEntityNotFound(_0x220fb3,null))[_0x9942('0x3e')](respondWithResult(_0x220fb3,null))[_0x9942('0x42')](handleError(_0x220fb3,null));};exports[_0x9942('0x47')]=function(_0x2c64a7,_0x444c9f){return db[_0x9942('0x27')][_0x9942('0x47')](_0x2c64a7[_0x9942('0x48')],{})['then'](respondWithResult(_0x444c9f,0xc9))[_0x9942('0x42')](handleError(_0x444c9f,null));};exports[_0x9942('0x22')]=function(_0x1356f4,_0x48a2ca){if(_0x1356f4['body']['id']){delete _0x1356f4['body']['id'];}return db[_0x9942('0x27')][_0x9942('0x46')]({'where':{'id':_0x1356f4[_0x9942('0x44')]['id']}})[_0x9942('0x3e')](handleEntityNotFound(_0x48a2ca,null))[_0x9942('0x3e')](saveUpdates(_0x1356f4[_0x9942('0x48')],null))[_0x9942('0x3e')](respondWithResult(_0x48a2ca,null))[_0x9942('0x42')](handleError(_0x48a2ca,null));};exports[_0x9942('0x23')]=function(_0x4132f8,_0x5131cf){return db[_0x9942('0x27')][_0x9942('0x46')]({'where':{'id':_0x4132f8[_0x9942('0x44')]['id']}})[_0x9942('0x3e')](handleEntityNotFound(_0x5131cf,null))[_0x9942('0x3e')](removeEntity(_0x5131cf,null))['catch'](handleError(_0x5131cf,null));};exports[_0x9942('0x49')]=function(_0x59560d,_0x1bc0e5,_0x373dd6){return db[_0x9942('0x27')][_0x9942('0x46')]({'where':{'id':_0x59560d['params']['id']},'attributes':['id',_0x9942('0x4a'),_0x9942('0x4b')]})[_0x9942('0x3e')](handleEntityNotFound(_0x1bc0e5,null))['then'](function(_0x3e05f8){if(_0x3e05f8){if(!_0x3e05f8[_0x9942('0x4a')]){throw new db['Sequelize'][(_0x9942('0x4c'))](_0x9942('0x4d'));}var _0x3869ff={'Content-Type':_0x9942('0x4e'),'Content-Disposition':_0x9942('0x4f')};if(_0x3e05f8[_0x9942('0x4b')]){_0x3869ff[_0x9942('0x50')]=_0x9942('0x51')+_0x3e05f8[_0x9942('0x4b')]+_0x9942('0x52');}_0x1bc0e5['set'](_0x3869ff);return _0x1bc0e5[_0x9942('0x25')](new Buffer(_0x3e05f8[_0x9942('0x4a')]));}})['catch'](handleError(_0x1bc0e5,null));}; \ No newline at end of file +var _0xfda0=['crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','map','type','key','VIRTUAL','field','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','params','keys','create','body','destroy','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel'];(function(_0x31d0ae,_0x5099ea){var _0x3039c2=function(_0x312b9e){while(--_0x312b9e){_0x31d0ae['push'](_0x31d0ae['shift']());}};_0x3039c2(++_0x5099ea);}(_0xfda0,0x174));var _0x0fda=function(_0x27e458,_0x54bdcb){_0x27e458=_0x27e458-0x0;var _0x51dde0=_0xfda0[_0x27e458];return _0x51dde0;};'use strict';var pdf=require(_0x0fda('0x0'));var emlformat=require(_0x0fda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0fda('0x2'));var jsonpatch=require(_0x0fda('0x3'));var rp=require(_0x0fda('0x4'));var moment=require(_0x0fda('0x5'));var BPromise=require(_0x0fda('0x6'));var Mustache=require('mustache');var util=require(_0x0fda('0x7'));var path=require(_0x0fda('0x8'));var sox=require(_0x0fda('0x9'));var csv=require(_0x0fda('0xa'));var ejs=require(_0x0fda('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0fda('0xc'));var crypto=require(_0x0fda('0xd'));var jsforce=require(_0x0fda('0xe'));var deskjs=require(_0x0fda('0xf'));var toCsv=require(_0x0fda('0xa'));var querystring=require('querystring');var Papa=require(_0x0fda('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0fda('0x11'));var logger=require(_0x0fda('0x12'))(_0x0fda('0x13'));var utils=require(_0x0fda('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d82e6,_0x4227b6){_0x4227b6=_0x4227b6||0xcc;return function(_0x535788){if(_0x535788){return _0x5d82e6[_0x0fda('0x15')](_0x4227b6);}return _0x5d82e6[_0x0fda('0x16')](_0x4227b6)[_0x0fda('0x17')]();};}function respondWithResult(_0x181f4f,_0x42dee6){_0x42dee6=_0x42dee6||0xc8;return function(_0x464066){if(_0x464066){return _0x181f4f[_0x0fda('0x16')](_0x42dee6)[_0x0fda('0x18')](_0x464066);}};}function respondWithFilteredResult(_0x54bf4c,_0x6b031){return function(_0x5ba550){if(_0x5ba550){var _0x19d105=_0x5ba550[_0x0fda('0x19')],_0x27c3ce=_0x6b031['offset'],_0x34c84f=_0x6b031[_0x0fda('0x1a')]+_0x6b031[_0x0fda('0x1b')],_0x4fa0cd;if(_0x34c84f>=_0x19d105){_0x34c84f=_0x19d105;_0x4fa0cd=0xc8;}else{_0x4fa0cd=0xce;}_0x54bf4c[_0x0fda('0x16')](_0x4fa0cd);return _0x54bf4c[_0x0fda('0x1c')](_0x0fda('0x1d'),_0x27c3ce+'-'+_0x34c84f+'/'+_0x19d105)[_0x0fda('0x18')](_0x5ba550);}return null;};}function patchUpdates(_0x5816ce){return function(_0x504a07){try{jsonpatch['apply'](_0x504a07,_0x5816ce,!![]);}catch(_0x2b67e0){return BPromise[_0x0fda('0x1e')](_0x2b67e0);}return _0x504a07[_0x0fda('0x1f')]();};}function saveUpdates(_0x5f1126,_0x47ee02){return function(_0x4a3804){if(_0x4a3804){return _0x4a3804[_0x0fda('0x20')](_0x5f1126)[_0x0fda('0x21')](function(_0x2ef039){return _0x2ef039;});}return null;};}function removeEntity(_0x16b079,_0xc791af){return function(_0x41b724){if(_0x41b724){return _0x41b724['destroy']()['then'](function(){_0x16b079[_0x0fda('0x16')](0xcc)[_0x0fda('0x17')]();});}};}function handleEntityNotFound(_0x5953a5,_0x2eebee){return function(_0x977cab){if(!_0x977cab){_0x5953a5[_0x0fda('0x15')](0x194);}return _0x977cab;};}function handleError(_0x2236a7,_0x34d817){_0x34d817=_0x34d817||0x1f4;return function(_0xd21c8a){logger[_0x0fda('0x22')](_0xd21c8a['stack']);if(_0xd21c8a[_0x0fda('0x23')]){delete _0xd21c8a['name'];}_0x2236a7[_0x0fda('0x16')](_0x34d817)['send'](_0xd21c8a);};}exports[_0x0fda('0x24')]=function(_0x2e8ef3,_0x236362){var _0x1a8ef7={},_0x26b0f9={},_0x40f2b1={'count':0x0,'rows':[]};var _0x4695a9=db['VoiceMailMessage'][_0x0fda('0x25')];_0x26b0f9[_0x0fda('0x26')]=_['differenceBy'](_['keys'](_0x4695a9),['name']);_0x26b0f9[_0x0fda('0x27')]=_['keys'](_0x2e8ef3['query']);_0x26b0f9[_0x0fda('0x28')]=_[_0x0fda('0x29')](_0x26b0f9[_0x0fda('0x26')],_0x26b0f9[_0x0fda('0x27')]);_0x1a8ef7[_0x0fda('0x2a')]=_['intersection'](_0x26b0f9[_0x0fda('0x26')],qs['fields'](_0x2e8ef3[_0x0fda('0x27')][_0x0fda('0x2b')]));_0x1a8ef7[_0x0fda('0x2a')]=_0x1a8ef7[_0x0fda('0x2a')][_0x0fda('0x2c')]?_0x1a8ef7[_0x0fda('0x2a')]:_0x26b0f9[_0x0fda('0x26')];if(!_0x2e8ef3[_0x0fda('0x27')]['hasOwnProperty'](_0x0fda('0x2d'))){_0x1a8ef7[_0x0fda('0x1b')]=qs['limit'](_0x2e8ef3[_0x0fda('0x27')][_0x0fda('0x1b')]);_0x1a8ef7['offset']=qs[_0x0fda('0x1a')](_0x2e8ef3['query'][_0x0fda('0x1a')]);}_0x1a8ef7['order']=qs[_0x0fda('0x2e')](_0x2e8ef3[_0x0fda('0x27')][_0x0fda('0x2e')]);_0x1a8ef7[_0x0fda('0x2f')]=qs['filters'](_['pick'](_0x2e8ef3[_0x0fda('0x27')],_0x26b0f9[_0x0fda('0x28')]));if(_0x2e8ef3['query']['filter']){_0x1a8ef7[_0x0fda('0x2f')]=_[_0x0fda('0x30')](_0x1a8ef7[_0x0fda('0x2f')],{'$or':_[_0x0fda('0x31')](_0x4695a9,function(_0x2206fc){if(_0x2206fc[_0x0fda('0x32')][_0x0fda('0x33')]!==_0x0fda('0x34')){var _0x5632c1={};_0x5632c1[_0x2206fc[_0x0fda('0x35')]]={'$like':'%'+_0x2e8ef3[_0x0fda('0x27')]['filter']+'%'};return _0x5632c1;}})});}_0x1a8ef7=_[_0x0fda('0x30')]({},_0x1a8ef7,_0x2e8ef3[_0x0fda('0x36')]);var _0x1fa26f={'where':_0x1a8ef7['where']};return db[_0x0fda('0x37')]['count'](_0x1fa26f)[_0x0fda('0x21')](function(_0x2e8a07){_0x40f2b1[_0x0fda('0x19')]=_0x2e8a07;if(_0x2e8ef3[_0x0fda('0x27')][_0x0fda('0x38')]){_0x1a8ef7[_0x0fda('0x39')]=[{'all':!![]}];}return db[_0x0fda('0x37')][_0x0fda('0x3a')](_0x1a8ef7);})['then'](function(_0x5b7028){_0x40f2b1[_0x0fda('0x3b')]=_0x5b7028;return _0x40f2b1;})[_0x0fda('0x21')](respondWithFilteredResult(_0x236362,_0x1a8ef7))[_0x0fda('0x3c')](handleError(_0x236362,null));};exports['show']=function(_0x46335f,_0x184d26){var _0x542e7e={'raw':!![],'where':{'id':_0x46335f[_0x0fda('0x3d')]['id']}},_0x1aeb71={};_0x1aeb71[_0x0fda('0x26')]=_[_0x0fda('0x3e')](db[_0x0fda('0x37')][_0x0fda('0x25')]);_0x1aeb71[_0x0fda('0x27')]=_[_0x0fda('0x3e')](_0x46335f[_0x0fda('0x27')]);_0x1aeb71[_0x0fda('0x28')]=_[_0x0fda('0x29')](_0x1aeb71[_0x0fda('0x26')],_0x1aeb71['query']);_0x542e7e[_0x0fda('0x2a')]=_[_0x0fda('0x29')](_0x1aeb71[_0x0fda('0x26')],qs[_0x0fda('0x2b')](_0x46335f[_0x0fda('0x27')][_0x0fda('0x2b')]));_0x542e7e[_0x0fda('0x2a')]=_0x542e7e[_0x0fda('0x2a')]['length']?_0x542e7e['attributes']:_0x1aeb71[_0x0fda('0x26')];if(_0x46335f['query']['includeAll']){_0x542e7e[_0x0fda('0x39')]=[{'all':!![]}];}_0x542e7e=_['merge']({},_0x542e7e,_0x46335f[_0x0fda('0x36')]);return db[_0x0fda('0x37')]['find'](_0x542e7e)[_0x0fda('0x21')](handleEntityNotFound(_0x184d26,null))[_0x0fda('0x21')](respondWithResult(_0x184d26,null))['catch'](handleError(_0x184d26,null));};exports[_0x0fda('0x3f')]=function(_0x2e4552,_0x1bf498){return db['VoiceMailMessage']['create'](_0x2e4552[_0x0fda('0x40')],{})[_0x0fda('0x21')](respondWithResult(_0x1bf498,0xc9))['catch'](handleError(_0x1bf498,null));};exports[_0x0fda('0x20')]=function(_0x580429,_0x59ebe7){if(_0x580429[_0x0fda('0x40')]['id']){delete _0x580429[_0x0fda('0x40')]['id'];}return db[_0x0fda('0x37')]['find']({'where':{'id':_0x580429['params']['id']}})[_0x0fda('0x21')](handleEntityNotFound(_0x59ebe7,null))[_0x0fda('0x21')](saveUpdates(_0x580429['body'],null))[_0x0fda('0x21')](respondWithResult(_0x59ebe7,null))['catch'](handleError(_0x59ebe7,null));};exports[_0x0fda('0x41')]=function(_0x518a70,_0x4b7593){return db['VoiceMailMessage'][_0x0fda('0x42')]({'where':{'id':_0x518a70[_0x0fda('0x3d')]['id']}})[_0x0fda('0x21')](handleEntityNotFound(_0x4b7593,null))[_0x0fda('0x21')](removeEntity(_0x4b7593,null))[_0x0fda('0x3c')](handleError(_0x4b7593,null));};exports[_0x0fda('0x43')]=function(_0x2c5e99,_0x4b4883,_0x3f024b){return db['VoiceMailMessage'][_0x0fda('0x42')]({'where':{'id':_0x2c5e99[_0x0fda('0x3d')]['id']},'attributes':['id',_0x0fda('0x44'),_0x0fda('0x45')]})[_0x0fda('0x21')](handleEntityNotFound(_0x4b4883,null))[_0x0fda('0x21')](function(_0x3f9472){if(_0x3f9472){if(!_0x3f9472[_0x0fda('0x44')]){throw new db[(_0x0fda('0x46'))][(_0x0fda('0x47'))](_0x0fda('0x48'));}var _0xf16179={'Content-Type':'audio/wav','Content-Disposition':_0x0fda('0x49')};if(_0x3f9472[_0x0fda('0x45')]){_0xf16179[_0x0fda('0x4a')]='attachment;\x20filename=\x22'+_0x3f9472['msg_id']+_0x0fda('0x4b');}_0x4b4883[_0x0fda('0x1c')](_0xf16179);return _0x4b4883[_0x0fda('0x4c')](new Buffer(_0x3f9472[_0x0fda('0x44')]));}})[_0x0fda('0x3c')](handleError(_0x4b4883,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 10c2dfd..ad1baa4 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 _0x55b3=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir'];(function(_0x144114,_0x5f0b0d){var _0x2d84f5=function(_0x2a71c8){while(--_0x2a71c8){_0x144114['push'](_0x144114['shift']());}};_0x2d84f5(++_0x5f0b0d);}(_0x55b3,0x179));var _0x355b=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x55b3[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x355b('0x0'));var util=require(_0x355b('0x1'));var logger=require('../../config/logger')(_0x355b('0x2'));var moment=require(_0x355b('0x3'));var BPromise=require(_0x355b('0x4'));var rp=require(_0x355b('0x5'));var fs=require('fs');var path=require(_0x355b('0x6'));var rimraf=require(_0x355b('0x7'));var config=require('../../config/environment');var attributes=require(_0x355b('0x8'));module[_0x355b('0x9')]=function(_0x5a744b,_0x8cf0dc){return _0x5a744b[_0x355b('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x355b('0xb'),'paranoid':![],'indexes':[{'name':_0x355b('0xc'),'fields':[_0x355b('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1e93=['define','voice_voicemail_messages','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0x1e93,0x110));var _0x31e9=function(_0x448706,_0x3ab207){_0x448706=_0x448706-0x0;var _0x4fac98=_0x1e93[_0x448706];return _0x4fac98;};'use strict';var _=require(_0x31e9('0x0'));var util=require(_0x31e9('0x1'));var logger=require(_0x31e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x31e9('0x3'));var rp=require(_0x31e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31e9('0x5'));var attributes=require(_0x31e9('0x6'));module['exports']=function(_0x1c90e0,_0x3b77df){return _0x1c90e0[_0x31e9('0x7')]('VoiceMailMessage',attributes,{'tableName':_0x31e9('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b349eb0..f4e2ae7 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 _0x1a65=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result'];(function(_0x2100d6,_0x55362c){var _0x298ddd=function(_0x7435e8){while(--_0x7435e8){_0x2100d6['push'](_0x2100d6['shift']());}};_0x298ddd(++_0x55362c);}(_0x1a65,0x112));var _0x51a6=function(_0x3386e9,_0x256e43){_0x3386e9=_0x3386e9-0x0;var _0x374d1b=_0x1a65[_0x3386e9];return _0x374d1b;};'use strict';var _=require(_0x51a6('0x0'));var util=require('util');var moment=require(_0x51a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x51a6('0x2'));var fs=require('fs');var Redis=require(_0x51a6('0x3'));var db=require(_0x51a6('0x4'))['db'];var utils=require(_0x51a6('0x5'));var logger=require(_0x51a6('0x6'))('rpc');var config=require(_0x51a6('0x7'));var jayson=require(_0x51a6('0x8'));var client=jayson['client'][_0x51a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x108cf7,_0x48201f,_0x3a386e){return new BPromise(function(_0x31f134,_0x5467f7){return client['request'](_0x108cf7,_0x3a386e)[_0x51a6('0xa')](function(_0x4c51b7){logger[_0x51a6('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x48201f,_0x51a6('0xc'));logger['debug'](_0x51a6('0xd'),_0x48201f,_0x51a6('0xc'),JSON[_0x51a6('0xe')](_0x4c51b7));if(_0x4c51b7[_0x51a6('0xf')]){if(_0x4c51b7[_0x51a6('0xf')][_0x51a6('0x10')]===0x1f4){logger['error'](_0x51a6('0x11'),_0x48201f,_0x4c51b7[_0x51a6('0xf')][_0x51a6('0x12')]);return _0x5467f7(_0x4c51b7[_0x51a6('0xf')][_0x51a6('0x12')]);}logger[_0x51a6('0xf')](_0x51a6('0x11'),_0x48201f,_0x4c51b7[_0x51a6('0xf')][_0x51a6('0x12')]);return _0x31f134(_0x4c51b7[_0x51a6('0xf')]['message']);}else{logger[_0x51a6('0xb')](_0x51a6('0x11'),_0x48201f,'request\x20sent');_0x31f134(_0x4c51b7[_0x51a6('0x13')][_0x51a6('0x12')]);}})[_0x51a6('0x14')](function(_0x4da360){logger[_0x51a6('0xf')](_0x51a6('0x11'),_0x48201f,_0x4da360);_0x5467f7(_0x4da360);});});} \ No newline at end of file +var _0x637a=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0xe6a3ec,_0x110b96){var _0x3419fb=function(_0x1c35c4){while(--_0x1c35c4){_0xe6a3ec['push'](_0xe6a3ec['shift']());}};_0x3419fb(++_0x110b96);}(_0x637a,0x1a7));var _0xa637=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x637a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa637('0x0'));var util=require('util');var moment=require(_0xa637('0x1'));var BPromise=require('bluebird');var rs=require(_0xa637('0x2'));var fs=require('fs');var Redis=require(_0xa637('0x3'));var db=require(_0xa637('0x4'))['db'];var utils=require(_0xa637('0x5'));var logger=require(_0xa637('0x6'))(_0xa637('0x7'));var config=require(_0xa637('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa637('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447df5,_0x1e0698,_0x4fc160){return new BPromise(function(_0x3299b7,_0x3dde03){return client[_0xa637('0xa')](_0x447df5,_0x4fc160)[_0xa637('0xb')](function(_0x4c33ec){logger[_0xa637('0xc')](_0xa637('0xd'),_0x1e0698,_0xa637('0xe'));logger[_0xa637('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1e0698,_0xa637('0xe'),JSON['stringify'](_0x4c33ec));if(_0x4c33ec[_0xa637('0x10')]){if(_0x4c33ec['error'][_0xa637('0x11')]===0x1f4){logger[_0xa637('0x10')](_0xa637('0xd'),_0x1e0698,_0x4c33ec['error']['message']);return _0x3dde03(_0x4c33ec[_0xa637('0x10')]['message']);}logger[_0xa637('0x10')](_0xa637('0xd'),_0x1e0698,_0x4c33ec[_0xa637('0x10')][_0xa637('0x12')]);return _0x3299b7(_0x4c33ec[_0xa637('0x10')]['message']);}else{logger[_0xa637('0xc')](_0xa637('0xd'),_0x1e0698,_0xa637('0xe'));_0x3299b7(_0x4c33ec[_0xa637('0x13')]['message']);}})[_0xa637('0x14')](function(_0x3e5a6e){logger[_0xa637('0x10')](_0xa637('0xd'),_0x1e0698,_0x3e5a6e);_0x3dde03(_0x3e5a6e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c728b09..b9f1633 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 _0x2f68=['./voiceMusicOnHold.controller','isAuthenticated','index','/:id/sounds','getSounds','create','addSound','put','/:id','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x2c2054,_0x166eb5){var _0x142cb0=function(_0x3aa67a){while(--_0x3aa67a){_0x2c2054['push'](_0x2c2054['shift']());}};_0x142cb0(++_0x166eb5);}(_0x2f68,0x9a));var _0x82f6=function(_0x150b41,_0x209b14){_0x150b41=_0x150b41-0x0;var _0x10556f=_0x2f68[_0x150b41];return _0x10556f;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var auth=require(_0x82f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82f6('0x5'));var controller=require(_0x82f6('0x6'));router['get']('/',auth[_0x82f6('0x7')](),controller[_0x82f6('0x8')]);router['get']('/:id',auth[_0x82f6('0x7')](),controller['show']);router['get'](_0x82f6('0x9'),auth[_0x82f6('0x7')](),controller[_0x82f6('0xa')]);router['post']('/',auth[_0x82f6('0x7')](),controller[_0x82f6('0xb')]);router['post'](_0x82f6('0x9'),auth[_0x82f6('0x7')](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')](_0x82f6('0xe'),auth[_0x82f6('0x7')](),controller['update']);router[_0x82f6('0xf')](_0x82f6('0xe'),auth['isAuthenticated'](),controller[_0x82f6('0x10')]);router[_0x82f6('0xf')](_0x82f6('0x11'),auth[_0x82f6('0x7')](),controller[_0x82f6('0x12')]);module[_0x82f6('0x13')]=router; \ No newline at end of file +var _0xe14d=['index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x2b62e8,_0x2318aa){var _0xedb182=function(_0x23f2da){while(--_0x23f2da){_0x2b62e8['push'](_0x2b62e8['shift']());}};_0xedb182(++_0x2318aa);}(_0xe14d,0x1ee));var _0xde14=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xe14d[_0x58afd5];return _0x3e503b;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0x8')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0xe')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router['post'](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0x10')]);router[_0xde14('0x11')](_0xde14('0x12'),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);router[_0xde14('0x14')](_0xde14('0x12'),auth[_0xde14('0x9')](),controller[_0xde14('0x15')]);router[_0xde14('0x14')](_0xde14('0x16'),auth[_0xde14('0x9')](),controller[_0xde14('0x17')]);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 83c2911..807491d 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 _0x4604=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','quietmp3nb','quietmp3','files','alpha','TIMESTAMP'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x4604,0x1e1));var _0x4460=function(_0x2318b1,_0x1ed479){_0x2318b1=_0x2318b1-0x0;var _0x569724=_0x4604[_0x2318b1];return _0x569724;};'use strict';var Sequelize=require(_0x4460('0x0'));module[_0x4460('0x1')]={'name':{'type':Sequelize[_0x4460('0x2')],'allowNull':![],'unique':_0x4460('0x3')},'mode':{'type':Sequelize[_0x4460('0x4')](_0x4460('0x5'),'files','mp3nb',_0x4460('0x6'),_0x4460('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x4460('0x8')},'directory':{'type':Sequelize[_0x4460('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4460('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4460('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4460('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4460('0xa')},'defaultEntry':{'type':Sequelize[_0x4460('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5e91=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x5bbae0,_0xa8d42e){var _0x1c4e55=function(_0x5540ef){while(--_0x5540ef){_0x5bbae0['push'](_0x5bbae0['shift']());}};_0x1c4e55(++_0xa8d42e);}(_0x5e91,0x187));var _0x15e9=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0x5e91[_0xb83ec2];return _0x4d2fbf;};'use strict';var Sequelize=require(_0x15e9('0x0'));module[_0x15e9('0x1')]={'name':{'type':Sequelize[_0x15e9('0x2')],'allowNull':![],'unique':_0x15e9('0x3')},'mode':{'type':Sequelize[_0x15e9('0x4')](_0x15e9('0x5'),_0x15e9('0x6'),_0x15e9('0x7'),_0x15e9('0x8'),_0x15e9('0x9'),_0x15e9('0xa')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x15e9('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x15e9('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x15e9('0x2')],'allowNull':!![],'defaultValue':_0x15e9('0xb')},'format':{'type':Sequelize[_0x15e9('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x15e9('0xc')],'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 6707e6d..4683975 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 _0x9090=['type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','options','find','body','params','create','transaction','mode','files','directory','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','join','rmdirSync','Sequelize','ValidationError','addSound','sequelize','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','message','removeSound','createdAt','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','index','VoiceMusicOnHold','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map'];(function(_0x37a698,_0x198a0d){var _0x3bba77=function(_0x320aaf){while(--_0x320aaf){_0x37a698['push'](_0x37a698['shift']());}};_0x3bba77(++_0x198a0d);}(_0x9090,0x17f));var _0x0909=function(_0x2c3969,_0x1b99d8){_0x2c3969=_0x2c3969-0x0;var _0x343f74=_0x9090[_0x2c3969];return _0x343f74;};'use strict';var pdf=require(_0x0909('0x0'));var emlformat=require(_0x0909('0x1'));var rimraf=require(_0x0909('0x2'));var zipdir=require(_0x0909('0x3'));var jsonpatch=require(_0x0909('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0909('0x5'));var Mustache=require(_0x0909('0x6'));var util=require(_0x0909('0x7'));var path=require('path');var sox=require(_0x0909('0x8'));var csv=require(_0x0909('0x9'));var ejs=require(_0x0909('0xa'));var fs=require('fs');var _=require(_0x0909('0xb'));var squel=require(_0x0909('0xc'));var crypto=require(_0x0909('0xd'));var jsforce=require(_0x0909('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0909('0x9'));var querystring=require(_0x0909('0xf'));var Papa=require('papaparse');var Redis=require(_0x0909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0909('0x11'));var hardwareService=require(_0x0909('0x12'));var logger=require(_0x0909('0x13'))(_0x0909('0x14'));var utils=require('../../config/utils');var config=require(_0x0909('0x15'));var db=require(_0x0909('0x16'))['db'];function respondWithStatusCode(_0x335df9,_0x1f92df){_0x1f92df=_0x1f92df||0xcc;return function(_0x4e900a){if(_0x4e900a){return _0x335df9[_0x0909('0x17')](_0x1f92df);}return _0x335df9[_0x0909('0x18')](_0x1f92df)[_0x0909('0x19')]();};}function respondWithResult(_0x2629f5,_0x30a847){_0x30a847=_0x30a847||0xc8;return function(_0xad78e9){if(_0xad78e9){return _0x2629f5[_0x0909('0x18')](_0x30a847)[_0x0909('0x1a')](_0xad78e9);}};}function respondWithFilteredResult(_0x1c56f3,_0x2e9bcf){return function(_0x48ee40){if(_0x48ee40){var _0x2c5892=_0x48ee40[_0x0909('0x1b')],_0x1eb8be=_0x2e9bcf[_0x0909('0x1c')],_0x96edb6=_0x2e9bcf[_0x0909('0x1c')]+_0x2e9bcf[_0x0909('0x1d')],_0x2b4a82;if(_0x96edb6>=_0x2c5892){_0x96edb6=_0x2c5892;_0x2b4a82=0xc8;}else{_0x2b4a82=0xce;}_0x1c56f3['status'](_0x2b4a82);return _0x1c56f3[_0x0909('0x1e')](_0x0909('0x1f'),_0x1eb8be+'-'+_0x96edb6+'/'+_0x2c5892)[_0x0909('0x1a')](_0x48ee40);}return null;};}function patchUpdates(_0x498389){return function(_0x3f7214){try{jsonpatch[_0x0909('0x20')](_0x3f7214,_0x498389,!![]);}catch(_0x11455d){return BPromise['reject'](_0x11455d);}return _0x3f7214['save']();};}function saveUpdates(_0xf61ea1,_0x5bef5b){return function(_0xf0efcb){if(_0xf0efcb){return _0xf0efcb[_0x0909('0x21')](_0xf61ea1)[_0x0909('0x22')](function(_0x3037c1){return _0x3037c1;});}return null;};}function removeEntity(_0x30fbfe,_0x36d573){return function(_0x4eec68){if(_0x4eec68){return _0x4eec68[_0x0909('0x23')]()['then'](function(){var _0x85be47=_0x4eec68[_0x0909('0x24')]({'plain':!![]});var _0x2ea745=_0x0909('0x25');return db[_0x0909('0x26')]['destroy']({'where':{'type':_0x2ea745,'resourceId':_0x85be47['id']}})[_0x0909('0x22')](function(){return _0x4eec68;});})[_0x0909('0x22')](function(){_0x30fbfe[_0x0909('0x18')](0xcc)[_0x0909('0x19')]();});}};}function handleEntityNotFound(_0xc879d8,_0x53d139){return function(_0x17d9a7){if(!_0x17d9a7){_0xc879d8[_0x0909('0x17')](0x194);}return _0x17d9a7;};}function handleError(_0x202b4c,_0x165847){_0x165847=_0x165847||0x1f4;return function(_0x59bee7){logger[_0x0909('0x27')](_0x59bee7['stack']);if(_0x59bee7['name']){delete _0x59bee7[_0x0909('0x28')];}_0x202b4c[_0x0909('0x18')](_0x165847)['send'](_0x59bee7);};}exports[_0x0909('0x29')]=function(_0x33ce47,_0x28daaf){var _0x512d7e={},_0x3c7d32={},_0x2775a4={'count':0x0,'rows':[]};var _0xbc1276=db[_0x0909('0x2a')][_0x0909('0x2b')];_0x3c7d32['model']=_[_0x0909('0x2c')](_0xbc1276);_0x3c7d32['query']=_[_0x0909('0x2c')](_0x33ce47[_0x0909('0x2d')]);_0x3c7d32['filters']=_[_0x0909('0x2e')](_0x3c7d32[_0x0909('0x2f')],_0x3c7d32['query']);_0x512d7e[_0x0909('0x30')]=_[_0x0909('0x2e')](_0x3c7d32[_0x0909('0x2f')],qs[_0x0909('0x31')](_0x33ce47[_0x0909('0x2d')]['fields']));_0x512d7e[_0x0909('0x30')]=_0x512d7e[_0x0909('0x30')][_0x0909('0x32')]?_0x512d7e[_0x0909('0x30')]:_0x3c7d32['model'];if(!_0x33ce47[_0x0909('0x2d')][_0x0909('0x33')](_0x0909('0x34'))){_0x512d7e[_0x0909('0x1d')]=qs[_0x0909('0x1d')](_0x33ce47[_0x0909('0x2d')][_0x0909('0x1d')]);_0x512d7e['offset']=qs['offset'](_0x33ce47[_0x0909('0x2d')][_0x0909('0x1c')]);}_0x512d7e[_0x0909('0x35')]=qs[_0x0909('0x36')](_0x33ce47[_0x0909('0x2d')]['sort']);_0x512d7e[_0x0909('0x37')]=qs['filters'](_[_0x0909('0x38')](_0x33ce47[_0x0909('0x2d')],_0x3c7d32[_0x0909('0x39')]));if(_0x33ce47[_0x0909('0x2d')][_0x0909('0x3a')]){_0x512d7e['where']=_[_0x0909('0x3b')](_0x512d7e['where'],{'$or':_[_0x0909('0x3c')](_0xbc1276,function(_0x3623a1){if(_0x3623a1[_0x0909('0x3d')][_0x0909('0x3e')]!==_0x0909('0x3f')){var _0x3d0897={};_0x3d0897[_0x3623a1[_0x0909('0x40')]]={'$like':'%'+_0x33ce47[_0x0909('0x2d')][_0x0909('0x3a')]+'%'};return _0x3d0897;}})});}_0x512d7e=_[_0x0909('0x3b')]({},_0x512d7e,_0x33ce47['options']);var _0x43155f={'where':_0x512d7e['where']};return db[_0x0909('0x2a')]['count'](_0x43155f)[_0x0909('0x22')](function(_0x31540b){_0x2775a4[_0x0909('0x1b')]=_0x31540b;if(_0x33ce47[_0x0909('0x2d')][_0x0909('0x41')]){_0x512d7e[_0x0909('0x42')]=[{'all':!![]}];}return db[_0x0909('0x2a')][_0x0909('0x43')](_0x512d7e);})[_0x0909('0x22')](function(_0x57f18b){_0x2775a4[_0x0909('0x44')]=_0x57f18b;return _0x2775a4;})['then'](respondWithFilteredResult(_0x28daaf,_0x512d7e))[_0x0909('0x45')](handleError(_0x28daaf,null));};exports['show']=function(_0x347bde,_0x8e3b61){var _0x405a1b={'raw':![],'where':{'id':_0x347bde['params']['id']}},_0x325412={};_0x325412[_0x0909('0x2f')]=_[_0x0909('0x2c')](db[_0x0909('0x2a')][_0x0909('0x2b')]);_0x325412[_0x0909('0x2d')]=_['keys'](_0x347bde[_0x0909('0x2d')]);_0x325412[_0x0909('0x39')]=_['intersection'](_0x325412[_0x0909('0x2f')],_0x325412['query']);_0x405a1b[_0x0909('0x30')]=_['intersection'](_0x325412['model'],qs[_0x0909('0x31')](_0x347bde[_0x0909('0x2d')]['fields']));_0x405a1b['attributes']=_0x405a1b[_0x0909('0x30')]['length']?_0x405a1b[_0x0909('0x30')]:_0x325412[_0x0909('0x2f')];if(_0x347bde['query']['includeAll']){_0x405a1b['include']=[{'all':!![]}];}_0x405a1b=_[_0x0909('0x3b')]({},_0x405a1b,_0x347bde[_0x0909('0x46')]);return db[_0x0909('0x2a')][_0x0909('0x47')](_0x405a1b)['then'](handleEntityNotFound(_0x8e3b61,null))[_0x0909('0x22')](respondWithResult(_0x8e3b61,null))[_0x0909('0x45')](handleError(_0x8e3b61,null));};exports[_0x0909('0x21')]=function(_0x1a40f6,_0x58f5f8){if(_0x1a40f6['body']['id']){delete _0x1a40f6[_0x0909('0x48')]['id'];}return db[_0x0909('0x2a')][_0x0909('0x47')]({'where':{'id':_0x1a40f6[_0x0909('0x49')]['id']}})[_0x0909('0x22')](handleEntityNotFound(_0x58f5f8,null))[_0x0909('0x22')](saveUpdates(_0x1a40f6[_0x0909('0x48')],null))[_0x0909('0x22')](respondWithResult(_0x58f5f8,null))['catch'](handleError(_0x58f5f8,null));};exports[_0x0909('0x4a')]=function(_0x2eaf27,_0x5e8f34,_0x190741){return db['sequelize'][_0x0909('0x4b')](function(_0x3540df){if(_0x2eaf27[_0x0909('0x48')][_0x0909('0x4c')]===_0x0909('0x4d')){_0x2eaf27[_0x0909('0x48')][_0x0909('0x4e')]=path['join'](config[_0x0909('0x4f')],_0x0909('0x50'),_0x2eaf27[_0x0909('0x48')][_0x0909('0x28')]);}return db[_0x0909('0x2a')][_0x0909('0x4a')](_0x2eaf27['body'],{'transaction':_0x3540df})[_0x0909('0x22')](function(_0x578979){if(_0x2eaf27['body']['mode']==='files'){fs[_0x0909('0x51')](_0x578979[_0x0909('0x4e')],parseInt('0777',0x8));}var _0x4e5563=_0x2eaf27[_0x0909('0x52')][_0x0909('0x24')]({'plain':!![]});if(!_0x4e5563)throw new Error(_0x0909('0x53'));if(_0x4e5563[_0x0909('0x54')]===_0x0909('0x52')){var _0x433690=_0x578979[_0x0909('0x24')]({'plain':!![]});return db[_0x0909('0x55')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x4e5563[_0x0909('0x56')]},'raw':!![]})['then'](function(_0x564949){if(_0x564949&&_0x564949[_0x0909('0x57')]===0x0){return db[_0x0909('0x26')][_0x0909('0x4a')]({'name':_0x433690[_0x0909('0x28')],'resourceId':_0x433690['id'],'type':_0x564949[_0x0909('0x28')],'sectionId':_0x564949['id']},{})[_0x0909('0x22')](function(){return _0x578979;});}else{return _0x578979;}})[_0x0909('0x45')](function(_0xe430a2){logger[_0x0909('0x27')](_0x0909('0x58'),_0xe430a2);});}return _0x578979;});})['then'](respondWithResult(_0x5e8f34,0xc9))[_0x0909('0x45')](handleError(_0x5e8f34,null));};exports[_0x0909('0x23')]=function(_0x188114,_0x269fff,_0x4a0e8e){var _0x3a761c;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x188114['params']['id']}})[_0x0909('0x22')](function(_0x16f3cc){if(_0x16f3cc){return db['sequelize']['transaction'](function(_0x5542fd){return _0x16f3cc['destroy']({'transaction':_0x5542fd,'raw':!![]})['then'](function(_0x3a5fb7){if(_0x3a5fb7['directory']){fs[_0x0909('0x59')](_0x3a5fb7[_0x0909('0x4e')])['forEach'](function(_0x4237d8){fs[_0x0909('0x5a')](path[_0x0909('0x5b')](_0x3a5fb7[_0x0909('0x4e')],_0x4237d8));});fs[_0x0909('0x5c')](_0x3a5fb7['directory']);}return _0x3a5fb7;});})[_0x0909('0x45')](function(_0x118dcd){throw new db[(_0x0909('0x5d'))][(_0x0909('0x5e'))](_0x118dcd['message']);});}})[_0x0909('0x22')](handleEntityNotFound(_0x269fff,null))[_0x0909('0x22')](removeEntity(_0x269fff,null))['catch'](handleError(_0x269fff,null));};exports[_0x0909('0x5f')]=function(_0x12c6e9,_0x18ab73,_0x41a018){return db[_0x0909('0x60')][_0x0909('0x4b')](function(_0x4fdca0){var _0x34cf14;return db['VoiceMusicOnHold'][_0x0909('0x47')]({'where':{'id':_0x12c6e9[_0x0909('0x49')]['id']}})['then'](function(_0x30ef54){if(_0x30ef54){_0x34cf14=_0x30ef54;return _0x30ef54['addSound'](_0x12c6e9[_0x0909('0x48')]['id'],{'transaction':_0x4fdca0});}})['then'](function(_0x19c249){if(_0x19c249){return db[_0x0909('0x61')][_0x0909('0x62')]({'where':{'id':_0x12c6e9[_0x0909('0x48')]['id']},'attributes':['id',_0x0909('0x28'),_0x0909('0x63'),_0x0909('0x64'),'createdAt'],'raw':!![]});}})[_0x0909('0x22')](function(_0x4a10b4){if(_0x4a10b4){var _0x20b9b6=path[_0x0909('0x5b')](config['root'],_0x0909('0x65'),util[_0x0909('0x66')]('%s.%s',path[_0x0909('0x67')](_0x4a10b4['save_name'],path[_0x0909('0x68')](_0x4a10b4[_0x0909('0x63')])),_0x4a10b4[_0x0909('0x64')]));var _0x126618=path[_0x0909('0x5b')](config[_0x0909('0x4f')],'server/files/moh',_0x34cf14[_0x0909('0x28')],util['format'](_0x0909('0x69'),_0x4a10b4[_0x0909('0x28')],_0x4a10b4['converted_format']));fs[_0x0909('0x6a')](_0x20b9b6,_0x126618);return _0x4a10b4;}})[_0x0909('0x45')](function(_0x5ea554){throw new db[(_0x0909('0x5d'))][(_0x0909('0x5e'))](_0x5ea554[_0x0909('0x6b')]);});})[_0x0909('0x22')](handleEntityNotFound(_0x18ab73,null))[_0x0909('0x22')](respondWithResult(_0x18ab73,0xc9))[_0x0909('0x45')](handleError(_0x18ab73,null));};exports[_0x0909('0x6c')]=function(_0x3e1e4a,_0xf8890a,_0x1ffc4b){return db['sequelize'][_0x0909('0x4b')](function(_0x3c1d2c){var _0x3bc4ff;return db[_0x0909('0x2a')][_0x0909('0x62')]({'where':{'id':_0x3e1e4a['params']['id']}})[_0x0909('0x22')](handleEntityNotFound(_0xf8890a,null))['then'](function(_0x5272ec){if(_0x5272ec){_0x3bc4ff=_0x5272ec;return _0x5272ec[_0x0909('0x6c')](_0x3e1e4a[_0x0909('0x49')]['id2']);}})[_0x0909('0x22')](function(_0x571ff3){if(_0x571ff3){return db[_0x0909('0x61')]['findOne']({'where':{'id':_0x3e1e4a[_0x0909('0x49')]['id2']},'attributes':['id',_0x0909('0x28'),'save_name',_0x0909('0x64'),_0x0909('0x6d')],'raw':!![]});}})[_0x0909('0x22')](function(_0x20993f){if(_0x20993f){fs[_0x0909('0x5a')](path[_0x0909('0x5b')](_0x3bc4ff['directory'],util[_0x0909('0x66')](_0x0909('0x69'),_0x20993f[_0x0909('0x28')],_0x20993f['converted_format'])));return _0x20993f;}})[_0x0909('0x45')](function(_0x4cd425){throw new db['Sequelize'][(_0x0909('0x5e'))](_0x4cd425['message']);});})[_0x0909('0x22')](handleEntityNotFound(_0xf8890a,null))[_0x0909('0x22')](respondWithStatusCode(_0xf8890a,0xcc))['catch'](handleError(_0xf8890a,null));};exports[_0x0909('0x6e')]=function(_0xa7f6ee,_0x20e17e,_0xb018a4){var _0x149a60={};var _0x2e9013={};var _0x7d8bda;var _0x2301a9;return db['VoiceMusicOnHold'][_0x0909('0x62')]({'where':{'id':_0xa7f6ee[_0x0909('0x49')]['id']}})[_0x0909('0x22')](handleEntityNotFound(_0x20e17e,null))[_0x0909('0x22')](function(_0x1403f8){if(_0x1403f8){_0x7d8bda=_0x1403f8;_0x2e9013['model']=_[_0x0909('0x2c')](db[_0x0909('0x61')][_0x0909('0x2b')]);_0x2e9013[_0x0909('0x2d')]=_[_0x0909('0x2c')](_0xa7f6ee[_0x0909('0x2d')]);_0x2e9013[_0x0909('0x39')]=_[_0x0909('0x2e')](_0x2e9013['model'],_0x2e9013[_0x0909('0x2d')]);_0x149a60['attributes']=_[_0x0909('0x2e')](_0x2e9013[_0x0909('0x2f')],qs[_0x0909('0x31')](_0xa7f6ee[_0x0909('0x2d')][_0x0909('0x31')]));_0x149a60['attributes']=_0x149a60[_0x0909('0x30')][_0x0909('0x32')]?_0x149a60[_0x0909('0x30')]:_0x2e9013[_0x0909('0x2f')];_0x149a60['order']=qs[_0x0909('0x36')](_0xa7f6ee[_0x0909('0x2d')][_0x0909('0x36')]);_0x149a60[_0x0909('0x37')]=qs[_0x0909('0x39')](_[_0x0909('0x38')](_0xa7f6ee[_0x0909('0x2d')],_0x2e9013['filters']));if(_0xa7f6ee[_0x0909('0x2d')]['filter']){_0x149a60[_0x0909('0x37')]=_['merge'](_0x149a60[_0x0909('0x37')],{'$or':_[_0x0909('0x3c')](_0x149a60[_0x0909('0x30')],function(_0x221715){var _0xb81d8={};_0xb81d8[_0x221715]={'$like':'%'+_0xa7f6ee[_0x0909('0x2d')][_0x0909('0x3a')]+'%'};return _0xb81d8;})});}_0x149a60=_[_0x0909('0x3b')]({},_0x149a60,_0xa7f6ee[_0x0909('0x46')]);return _0x7d8bda['getSounds'](_0x149a60);}})[_0x0909('0x22')](function(_0xf66216){if(_0xf66216){_0x2301a9=_0xf66216[_0x0909('0x32')];if(!_0xa7f6ee[_0x0909('0x2d')]['hasOwnProperty'](_0x0909('0x34'))){_0x149a60[_0x0909('0x1d')]=qs[_0x0909('0x1d')](_0xa7f6ee[_0x0909('0x2d')][_0x0909('0x1d')]);_0x149a60[_0x0909('0x1c')]=qs[_0x0909('0x1c')](_0xa7f6ee[_0x0909('0x2d')][_0x0909('0x1c')]);}return _0x7d8bda[_0x0909('0x6e')](_0x149a60);}})[_0x0909('0x22')](function(_0x31e649){if(_0x31e649){return _0x31e649?{'count':_0x2301a9,'rows':_0x31e649}:null;}})[_0x0909('0x22')](respondWithResult(_0x20e17e,null))[_0x0909('0x45')](handleError(_0x20e17e,null));}; \ No newline at end of file +var _0xb575=['message','getSounds','html-pdf','eml-format','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','type','key','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','VoiceMusicOnHold','options','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','Sequelize','removeSound','id2','Sound','findOne','format'];(function(_0x2def6e,_0x2de89c){var _0x150205=function(_0x42bc70){while(--_0x42bc70){_0x2def6e['push'](_0x2def6e['shift']());}};_0x150205(++_0x2de89c);}(_0xb575,0xda));var _0x5b57=function(_0x8b77d7,_0x34b413){_0x8b77d7=_0x8b77d7-0x0;var _0x727762=_0xb575[_0x8b77d7];return _0x727762;};'use strict';var pdf=require(_0x5b57('0x0'));var emlformat=require(_0x5b57('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5b57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b57('0x3'));var Mustache=require(_0x5b57('0x4'));var util=require('util');var path=require(_0x5b57('0x5'));var sox=require(_0x5b57('0x6'));var csv=require(_0x5b57('0x7'));var ejs=require(_0x5b57('0x8'));var fs=require('fs');var _=require(_0x5b57('0x9'));var squel=require('squel');var crypto=require(_0x5b57('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5b57('0xb'));var toCsv=require(_0x5b57('0x7'));var querystring=require(_0x5b57('0xc'));var Papa=require('papaparse');var Redis=require(_0x5b57('0xd'));var authService=require(_0x5b57('0xe'));var qs=require(_0x5b57('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b57('0x10'))(_0x5b57('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5b57('0x12'))['db'];function respondWithStatusCode(_0x4340d0,_0x30437b){_0x30437b=_0x30437b||0xcc;return function(_0xd897ba){if(_0xd897ba){return _0x4340d0[_0x5b57('0x13')](_0x30437b);}return _0x4340d0[_0x5b57('0x14')](_0x30437b)[_0x5b57('0x15')]();};}function respondWithResult(_0x309743,_0x3b728d){_0x3b728d=_0x3b728d||0xc8;return function(_0x42ba90){if(_0x42ba90){return _0x309743['status'](_0x3b728d)[_0x5b57('0x16')](_0x42ba90);}};}function respondWithFilteredResult(_0x3182cf,_0x297c96){return function(_0x4ba858){if(_0x4ba858){var _0x2a0a1b=_0x4ba858[_0x5b57('0x17')],_0x3b4631=_0x297c96[_0x5b57('0x18')],_0x132430=_0x297c96[_0x5b57('0x18')]+_0x297c96[_0x5b57('0x19')],_0x770fc3;if(_0x132430>=_0x2a0a1b){_0x132430=_0x2a0a1b;_0x770fc3=0xc8;}else{_0x770fc3=0xce;}_0x3182cf['status'](_0x770fc3);return _0x3182cf[_0x5b57('0x1a')](_0x5b57('0x1b'),_0x3b4631+'-'+_0x132430+'/'+_0x2a0a1b)[_0x5b57('0x16')](_0x4ba858);}return null;};}function patchUpdates(_0x137899){return function(_0x30f8d4){try{jsonpatch[_0x5b57('0x1c')](_0x30f8d4,_0x137899,!![]);}catch(_0x5f0dc6){return BPromise[_0x5b57('0x1d')](_0x5f0dc6);}return _0x30f8d4[_0x5b57('0x1e')]();};}function saveUpdates(_0x41df30,_0x412b62){return function(_0x53378c){if(_0x53378c){return _0x53378c[_0x5b57('0x1f')](_0x41df30)[_0x5b57('0x20')](function(_0x3cb5c0){return _0x3cb5c0;});}return null;};}function removeEntity(_0x4d8f86,_0xebf383){return function(_0xd8567a){if(_0xd8567a){return _0xd8567a[_0x5b57('0x21')]()[_0x5b57('0x20')](function(){var _0x429146=_0xd8567a[_0x5b57('0x22')]({'plain':!![]});var _0x4a4ed8=_0x5b57('0x23');return db['UserProfileResource'][_0x5b57('0x21')]({'where':{'type':_0x4a4ed8,'resourceId':_0x429146['id']}})[_0x5b57('0x20')](function(){return _0xd8567a;});})['then'](function(){_0x4d8f86['status'](0xcc)[_0x5b57('0x15')]();});}};}function handleEntityNotFound(_0x5eab3d,_0x120dc6){return function(_0xc173a4){if(!_0xc173a4){_0x5eab3d[_0x5b57('0x13')](0x194);}return _0xc173a4;};}function handleError(_0x20a95a,_0x39b2f4){_0x39b2f4=_0x39b2f4||0x1f4;return function(_0x17ac8b){logger[_0x5b57('0x24')](_0x17ac8b[_0x5b57('0x25')]);if(_0x17ac8b[_0x5b57('0x26')]){delete _0x17ac8b[_0x5b57('0x26')];}_0x20a95a[_0x5b57('0x14')](_0x39b2f4)[_0x5b57('0x27')](_0x17ac8b);};}exports[_0x5b57('0x28')]=function(_0x53c81b,_0xc59d9f){var _0x42664f={},_0x3e8bc6={},_0x4da4a8={'count':0x0,'rows':[]};var _0x42b276=db['VoiceMusicOnHold'][_0x5b57('0x29')];_0x3e8bc6[_0x5b57('0x2a')]=_[_0x5b57('0x2b')](_0x42b276);_0x3e8bc6[_0x5b57('0x2c')]=_[_0x5b57('0x2b')](_0x53c81b[_0x5b57('0x2c')]);_0x3e8bc6['filters']=_[_0x5b57('0x2d')](_0x3e8bc6[_0x5b57('0x2a')],_0x3e8bc6[_0x5b57('0x2c')]);_0x42664f[_0x5b57('0x2e')]=_[_0x5b57('0x2d')](_0x3e8bc6['model'],qs[_0x5b57('0x2f')](_0x53c81b['query'][_0x5b57('0x2f')]));_0x42664f['attributes']=_0x42664f[_0x5b57('0x2e')][_0x5b57('0x30')]?_0x42664f[_0x5b57('0x2e')]:_0x3e8bc6[_0x5b57('0x2a')];if(!_0x53c81b[_0x5b57('0x2c')][_0x5b57('0x31')](_0x5b57('0x32'))){_0x42664f[_0x5b57('0x19')]=qs[_0x5b57('0x19')](_0x53c81b[_0x5b57('0x2c')]['limit']);_0x42664f[_0x5b57('0x18')]=qs[_0x5b57('0x18')](_0x53c81b[_0x5b57('0x2c')][_0x5b57('0x18')]);}_0x42664f[_0x5b57('0x33')]=qs[_0x5b57('0x34')](_0x53c81b[_0x5b57('0x2c')][_0x5b57('0x34')]);_0x42664f[_0x5b57('0x35')]=qs[_0x5b57('0x36')](_[_0x5b57('0x37')](_0x53c81b[_0x5b57('0x2c')],_0x3e8bc6[_0x5b57('0x36')]));if(_0x53c81b[_0x5b57('0x2c')]['filter']){_0x42664f[_0x5b57('0x35')]=_['merge'](_0x42664f[_0x5b57('0x35')],{'$or':_[_0x5b57('0x38')](_0x42b276,function(_0x1973f4){if(_0x1973f4[_0x5b57('0x39')][_0x5b57('0x3a')]!==_0x5b57('0x3b')){var _0xc2052d={};_0xc2052d[_0x1973f4['field']]={'$like':'%'+_0x53c81b[_0x5b57('0x2c')][_0x5b57('0x3c')]+'%'};return _0xc2052d;}})});}_0x42664f=_[_0x5b57('0x3d')]({},_0x42664f,_0x53c81b['options']);var _0x10f1fa={'where':_0x42664f[_0x5b57('0x35')]};return db['VoiceMusicOnHold'][_0x5b57('0x17')](_0x10f1fa)[_0x5b57('0x20')](function(_0xa417ce){_0x4da4a8['count']=_0xa417ce;if(_0x53c81b['query'][_0x5b57('0x3e')]){_0x42664f[_0x5b57('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5b57('0x40')](_0x42664f);})['then'](function(_0xd6bda6){_0x4da4a8[_0x5b57('0x41')]=_0xd6bda6;return _0x4da4a8;})['then'](respondWithFilteredResult(_0xc59d9f,_0x42664f))[_0x5b57('0x42')](handleError(_0xc59d9f,null));};exports[_0x5b57('0x43')]=function(_0x16a177,_0x1341dc){var _0x1428b5={'raw':![],'where':{'id':_0x16a177[_0x5b57('0x44')]['id']}},_0x7e02f8={};_0x7e02f8['model']=_['keys'](db[_0x5b57('0x45')]['rawAttributes']);_0x7e02f8[_0x5b57('0x2c')]=_['keys'](_0x16a177[_0x5b57('0x2c')]);_0x7e02f8[_0x5b57('0x36')]=_[_0x5b57('0x2d')](_0x7e02f8[_0x5b57('0x2a')],_0x7e02f8[_0x5b57('0x2c')]);_0x1428b5[_0x5b57('0x2e')]=_[_0x5b57('0x2d')](_0x7e02f8[_0x5b57('0x2a')],qs[_0x5b57('0x2f')](_0x16a177[_0x5b57('0x2c')][_0x5b57('0x2f')]));_0x1428b5[_0x5b57('0x2e')]=_0x1428b5[_0x5b57('0x2e')][_0x5b57('0x30')]?_0x1428b5[_0x5b57('0x2e')]:_0x7e02f8[_0x5b57('0x2a')];if(_0x16a177[_0x5b57('0x2c')][_0x5b57('0x3e')]){_0x1428b5[_0x5b57('0x3f')]=[{'all':!![]}];}_0x1428b5=_['merge']({},_0x1428b5,_0x16a177[_0x5b57('0x46')]);return db[_0x5b57('0x45')][_0x5b57('0x47')](_0x1428b5)['then'](handleEntityNotFound(_0x1341dc,null))[_0x5b57('0x20')](respondWithResult(_0x1341dc,null))[_0x5b57('0x42')](handleError(_0x1341dc,null));};exports[_0x5b57('0x1f')]=function(_0x3f3f64,_0x53937e){if(_0x3f3f64['body']['id']){delete _0x3f3f64['body']['id'];}return db[_0x5b57('0x45')][_0x5b57('0x47')]({'where':{'id':_0x3f3f64['params']['id']}})[_0x5b57('0x20')](handleEntityNotFound(_0x53937e,null))[_0x5b57('0x20')](saveUpdates(_0x3f3f64[_0x5b57('0x48')],null))[_0x5b57('0x20')](respondWithResult(_0x53937e,null))[_0x5b57('0x42')](handleError(_0x53937e,null));};exports[_0x5b57('0x49')]=function(_0x22ea65,_0x2027b4,_0x4179c8){return db[_0x5b57('0x4a')][_0x5b57('0x4b')](function(_0x3ec196){if(_0x22ea65[_0x5b57('0x48')][_0x5b57('0x4c')]===_0x5b57('0x4d')){_0x22ea65[_0x5b57('0x48')][_0x5b57('0x4e')]=path[_0x5b57('0x4f')](config[_0x5b57('0x50')],_0x5b57('0x51'),_0x22ea65[_0x5b57('0x48')][_0x5b57('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x22ea65[_0x5b57('0x48')],{'transaction':_0x3ec196})['then'](function(_0x44fc64){if(_0x22ea65['body'][_0x5b57('0x4c')]===_0x5b57('0x4d')){fs[_0x5b57('0x52')](_0x44fc64['directory'],parseInt('0777',0x8));}var _0x5304c1=_0x22ea65['user'][_0x5b57('0x22')]({'plain':!![]});if(!_0x5304c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5304c1['role']==='user'){var _0x1cc658=_0x44fc64[_0x5b57('0x22')]({'plain':!![]});return db[_0x5b57('0x53')][_0x5b57('0x47')]({'where':{'name':_0x5b57('0x23'),'userProfileId':_0x5304c1[_0x5b57('0x54')]},'raw':!![]})['then'](function(_0x326cb7){if(_0x326cb7&&_0x326cb7[_0x5b57('0x55')]===0x0){return db['UserProfileResource'][_0x5b57('0x49')]({'name':_0x1cc658[_0x5b57('0x26')],'resourceId':_0x1cc658['id'],'type':_0x326cb7[_0x5b57('0x26')],'sectionId':_0x326cb7['id']},{})[_0x5b57('0x20')](function(){return _0x44fc64;});}else{return _0x44fc64;}})['catch'](function(_0x4c90a3){logger[_0x5b57('0x24')](_0x5b57('0x56'),_0x4c90a3);});}return _0x44fc64;});})[_0x5b57('0x20')](respondWithResult(_0x2027b4,0xc9))[_0x5b57('0x42')](handleError(_0x2027b4,null));};exports[_0x5b57('0x21')]=function(_0x4a102a,_0x4f39ac,_0x8f3f34){var _0x17ed9f;return db[_0x5b57('0x45')]['find']({'where':{'id':_0x4a102a['params']['id']}})['then'](function(_0x4a3d25){if(_0x4a3d25){return db[_0x5b57('0x4a')][_0x5b57('0x4b')](function(_0x230cf6){return _0x4a3d25[_0x5b57('0x21')]({'transaction':_0x230cf6,'raw':!![]})[_0x5b57('0x20')](function(_0xc79ba3){if(_0xc79ba3[_0x5b57('0x4e')]){fs[_0x5b57('0x57')](_0xc79ba3['directory'])[_0x5b57('0x58')](function(_0x32c06f){fs[_0x5b57('0x59')](path[_0x5b57('0x4f')](_0xc79ba3['directory'],_0x32c06f));});fs[_0x5b57('0x5a')](_0xc79ba3['directory']);}return _0xc79ba3;});})[_0x5b57('0x42')](function(_0x21a4e4){throw new db['Sequelize'][(_0x5b57('0x5b'))](_0x21a4e4['message']);});}})['then'](handleEntityNotFound(_0x4f39ac,null))['then'](removeEntity(_0x4f39ac,null))[_0x5b57('0x42')](handleError(_0x4f39ac,null));};exports['addSound']=function(_0x2a0945,_0x2f8bc9,_0x8526b4){return db[_0x5b57('0x4a')][_0x5b57('0x4b')](function(_0x3f1b5){var _0x20dc54;return db[_0x5b57('0x45')]['find']({'where':{'id':_0x2a0945[_0x5b57('0x44')]['id']}})[_0x5b57('0x20')](function(_0x1c41eb){if(_0x1c41eb){_0x20dc54=_0x1c41eb;return _0x1c41eb[_0x5b57('0x5c')](_0x2a0945['body']['id'],{'transaction':_0x3f1b5});}})[_0x5b57('0x20')](function(_0x19e63c){if(_0x19e63c){return db['Sound']['findOne']({'where':{'id':_0x2a0945[_0x5b57('0x48')]['id']},'attributes':['id',_0x5b57('0x26'),_0x5b57('0x5d'),_0x5b57('0x5e'),_0x5b57('0x5f')],'raw':!![]});}})[_0x5b57('0x20')](function(_0x56d6f5){if(_0x56d6f5){var _0x41da3e=path[_0x5b57('0x4f')](config[_0x5b57('0x50')],_0x5b57('0x60'),util['format'](_0x5b57('0x61'),path[_0x5b57('0x62')](_0x56d6f5['save_name'],path[_0x5b57('0x63')](_0x56d6f5[_0x5b57('0x5d')])),_0x56d6f5[_0x5b57('0x5e')]));var _0x4e5519=path[_0x5b57('0x4f')](config[_0x5b57('0x50')],_0x5b57('0x51'),_0x20dc54[_0x5b57('0x26')],util['format'](_0x5b57('0x61'),_0x56d6f5['name'],_0x56d6f5[_0x5b57('0x5e')]));fs['symlinkSync'](_0x41da3e,_0x4e5519);return _0x56d6f5;}})['catch'](function(_0x33fb5d){throw new db[(_0x5b57('0x64'))][(_0x5b57('0x5b'))](_0x33fb5d['message']);});})[_0x5b57('0x20')](handleEntityNotFound(_0x2f8bc9,null))[_0x5b57('0x20')](respondWithResult(_0x2f8bc9,0xc9))[_0x5b57('0x42')](handleError(_0x2f8bc9,null));};exports[_0x5b57('0x65')]=function(_0x483fd4,_0x1b1d3a,_0x53bc5e){return db['sequelize'][_0x5b57('0x4b')](function(_0x7aab4){var _0x59d443;return db[_0x5b57('0x45')]['findOne']({'where':{'id':_0x483fd4['params']['id']}})[_0x5b57('0x20')](handleEntityNotFound(_0x1b1d3a,null))['then'](function(_0x4b0caa){if(_0x4b0caa){_0x59d443=_0x4b0caa;return _0x4b0caa['removeSound'](_0x483fd4[_0x5b57('0x44')][_0x5b57('0x66')]);}})[_0x5b57('0x20')](function(_0x2835a4){if(_0x2835a4){return db[_0x5b57('0x67')][_0x5b57('0x68')]({'where':{'id':_0x483fd4[_0x5b57('0x44')][_0x5b57('0x66')]},'attributes':['id',_0x5b57('0x26'),'save_name',_0x5b57('0x5e'),_0x5b57('0x5f')],'raw':!![]});}})[_0x5b57('0x20')](function(_0x272fc7){if(_0x272fc7){fs[_0x5b57('0x59')](path[_0x5b57('0x4f')](_0x59d443['directory'],util[_0x5b57('0x69')](_0x5b57('0x61'),_0x272fc7[_0x5b57('0x26')],_0x272fc7[_0x5b57('0x5e')])));return _0x272fc7;}})[_0x5b57('0x42')](function(_0x3b5530){throw new db[(_0x5b57('0x64'))][(_0x5b57('0x5b'))](_0x3b5530[_0x5b57('0x6a')]);});})[_0x5b57('0x20')](handleEntityNotFound(_0x1b1d3a,null))[_0x5b57('0x20')](respondWithStatusCode(_0x1b1d3a,0xcc))[_0x5b57('0x42')](handleError(_0x1b1d3a,null));};exports[_0x5b57('0x6b')]=function(_0x408aad,_0x11c8af,_0x5ce8ff){var _0xa4ea47={};var _0x3dda13={};var _0x15f8ec;var _0x2d4ce3;return db[_0x5b57('0x45')][_0x5b57('0x68')]({'where':{'id':_0x408aad[_0x5b57('0x44')]['id']}})[_0x5b57('0x20')](handleEntityNotFound(_0x11c8af,null))[_0x5b57('0x20')](function(_0x2e8296){if(_0x2e8296){_0x15f8ec=_0x2e8296;_0x3dda13[_0x5b57('0x2a')]=_[_0x5b57('0x2b')](db[_0x5b57('0x67')][_0x5b57('0x29')]);_0x3dda13[_0x5b57('0x2c')]=_[_0x5b57('0x2b')](_0x408aad['query']);_0x3dda13[_0x5b57('0x36')]=_[_0x5b57('0x2d')](_0x3dda13[_0x5b57('0x2a')],_0x3dda13[_0x5b57('0x2c')]);_0xa4ea47[_0x5b57('0x2e')]=_[_0x5b57('0x2d')](_0x3dda13[_0x5b57('0x2a')],qs[_0x5b57('0x2f')](_0x408aad[_0x5b57('0x2c')][_0x5b57('0x2f')]));_0xa4ea47[_0x5b57('0x2e')]=_0xa4ea47[_0x5b57('0x2e')][_0x5b57('0x30')]?_0xa4ea47[_0x5b57('0x2e')]:_0x3dda13[_0x5b57('0x2a')];_0xa4ea47['order']=qs[_0x5b57('0x34')](_0x408aad[_0x5b57('0x2c')]['sort']);_0xa4ea47['where']=qs['filters'](_[_0x5b57('0x37')](_0x408aad[_0x5b57('0x2c')],_0x3dda13[_0x5b57('0x36')]));if(_0x408aad[_0x5b57('0x2c')][_0x5b57('0x3c')]){_0xa4ea47[_0x5b57('0x35')]=_[_0x5b57('0x3d')](_0xa4ea47[_0x5b57('0x35')],{'$or':_['map'](_0xa4ea47['attributes'],function(_0x103768){var _0x305233={};_0x305233[_0x103768]={'$like':'%'+_0x408aad[_0x5b57('0x2c')][_0x5b57('0x3c')]+'%'};return _0x305233;})});}_0xa4ea47=_[_0x5b57('0x3d')]({},_0xa4ea47,_0x408aad[_0x5b57('0x46')]);return _0x15f8ec[_0x5b57('0x6b')](_0xa4ea47);}})['then'](function(_0x2f0405){if(_0x2f0405){_0x2d4ce3=_0x2f0405[_0x5b57('0x30')];if(!_0x408aad[_0x5b57('0x2c')][_0x5b57('0x31')]('nolimit')){_0xa4ea47['limit']=qs['limit'](_0x408aad['query'][_0x5b57('0x19')]);_0xa4ea47[_0x5b57('0x18')]=qs[_0x5b57('0x18')](_0x408aad[_0x5b57('0x2c')][_0x5b57('0x18')]);}return _0x15f8ec[_0x5b57('0x6b')](_0xa4ea47);}})[_0x5b57('0x20')](function(_0xe3a89d){if(_0xe3a89d){return _0xe3a89d?{'count':_0x2d4ce3,'rows':_0xe3a89d}:null;}})[_0x5b57('0x20')](respondWithResult(_0x11c8af,null))[_0x5b57('0x42')](handleError(_0x11c8af,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index bbc727d..16edc47 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 _0xe25f=['bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xe25f,0x1d1));var _0xfe25=function(_0x505124,_0x34c8ea){_0x505124=_0x505124-0x0;var _0x37f08c=_0xe25f[_0x505124];return _0x37f08c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe25('0x0'))(_0xfe25('0x1'));var moment=require(_0xfe25('0x2'));var BPromise=require(_0xfe25('0x3'));var rp=require(_0xfe25('0x4'));var fs=require('fs');var path=require(_0xfe25('0x5'));var rimraf=require(_0xfe25('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe25('0x7'));module[_0xfe25('0x8')]=function(_0x197ee4,_0xa8095c){return _0x197ee4[_0xfe25('0x9')](_0xfe25('0xa'),attributes,{'tableName':_0xfe25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4ed=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold'];(function(_0xe2de24,_0x4d2d4c){var _0x1f16d2=function(_0x42ac7e){while(--_0x42ac7e){_0xe2de24['push'](_0xe2de24['shift']());}};_0x1f16d2(++_0x4d2d4c);}(_0xc4ed,0x1ad));var _0xdc4e=function(_0x18e875,_0x54fff7){_0x18e875=_0x18e875-0x0;var _0x1643c6=_0xc4ed[_0x18e875];return _0x1643c6;};'use strict';var _=require(_0xdc4e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc4e('0x1'));var moment=require(_0xdc4e('0x2'));var BPromise=require('bluebird');var rp=require(_0xdc4e('0x3'));var fs=require('fs');var path=require(_0xdc4e('0x4'));var rimraf=require(_0xdc4e('0x5'));var config=require(_0xdc4e('0x6'));var attributes=require(_0xdc4e('0x7'));module[_0xdc4e('0x8')]=function(_0x13dede,_0x24b88c){return _0x13dede['define'](_0xdc4e('0x9'),attributes,{'tableName':_0xdc4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index ec9e4f3..e44559f 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 _0x59ec=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x1b665d,_0x2a4946){var _0x3e7e33=function(_0x5f4549){while(--_0x5f4549){_0x1b665d['push'](_0x1b665d['shift']());}};_0x3e7e33(++_0x2a4946);}(_0x59ec,0x192));var _0xc59e=function(_0x1ffa9d,_0x5824f9){_0x1ffa9d=_0x1ffa9d-0x0;var _0x5e704b=_0x59ec[_0x1ffa9d];return _0x5e704b;};'use strict';var _=require(_0xc59e('0x0'));var util=require('util');var moment=require(_0xc59e('0x1'));var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require(_0xc59e('0x5'));var logger=require(_0xc59e('0x6'))('rpc');var config=require(_0xc59e('0x7'));var jayson=require(_0xc59e('0x8'));var client=jayson[_0xc59e('0x9')][_0xc59e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32d323,_0x5ad71a,_0x10e758){return new BPromise(function(_0x50580d,_0x394068){return client['request'](_0x32d323,_0x10e758)['then'](function(_0x58c8e1){logger[_0xc59e('0xb')](_0xc59e('0xc'),_0x5ad71a,_0xc59e('0xd'));logger[_0xc59e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x5ad71a,'request\x20sent',JSON[_0xc59e('0xf')](_0x58c8e1));if(_0x58c8e1['error']){if(_0x58c8e1['error'][_0xc59e('0x10')]===0x1f4){logger[_0xc59e('0x11')](_0xc59e('0xc'),_0x5ad71a,_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);return _0x394068(_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);}logger['error'](_0xc59e('0xc'),_0x5ad71a,_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);return _0x50580d(_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);}else{logger[_0xc59e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ad71a,_0xc59e('0xd'));_0x50580d(_0x58c8e1[_0xc59e('0x13')][_0xc59e('0x12')]);}})[_0xc59e('0x14')](function(_0x49f122){logger[_0xc59e('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ad71a,_0x49f122);_0x394068(_0x49f122);});});} \ No newline at end of file +var _0x4ce6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1bed74,_0x40d5e0){var _0x385eeb=function(_0x5de897){while(--_0x5de897){_0x1bed74['push'](_0x1bed74['shift']());}};_0x385eeb(++_0x40d5e0);}(_0x4ce6,0x15a));var _0x64ce=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x4ce6[_0x2c69a1];return _0x24bb91;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var moment=require(_0x64ce('0x2'));var BPromise=require(_0x64ce('0x3'));var rs=require(_0x64ce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64ce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64ce('0x6'))(_0x64ce('0x7'));var config=require(_0x64ce('0x8'));var jayson=require(_0x64ce('0x9'));var client=jayson[_0x64ce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x424c02,_0x524f24,_0x778ed9){return new BPromise(function(_0x2065d9,_0x469bb7){return client[_0x64ce('0xb')](_0x424c02,_0x778ed9)['then'](function(_0x58baf6){logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x524f24,'request\x20sent');logger[_0x64ce('0xe')](_0x64ce('0xf'),_0x524f24,'request\x20sent',JSON[_0x64ce('0x10')](_0x58baf6));if(_0x58baf6[_0x64ce('0x11')]){if(_0x58baf6['error'][_0x64ce('0x12')]===0x1f4){logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x524f24,_0x58baf6['error']['message']);return _0x469bb7(_0x58baf6[_0x64ce('0x11')][_0x64ce('0x13')]);}logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x524f24,_0x58baf6[_0x64ce('0x11')][_0x64ce('0x13')]);return _0x2065d9(_0x58baf6['error'][_0x64ce('0x13')]);}else{logger['info'](_0x64ce('0xd'),_0x524f24,'request\x20sent');_0x2065d9(_0x58baf6[_0x64ce('0x14')][_0x64ce('0x13')]);}})[_0x64ce('0x15')](function(_0x117f36){logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x524f24,_0x117f36);_0x469bb7(_0x117f36);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8cb506a..172bbe5 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 _0xc4e6=['describe','/:id','show','/:id/users','getAgents','post','addAgents','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x5ba74f,_0x200bf4){_0x5ba74f=_0x5ba74f-0x0;var _0x534d79=_0xc4e6[_0x5ba74f];return _0x534d79;};'use strict';var multer=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var path=require('path');var timeout=require(_0x6c4e('0x2'));var express=require(_0x6c4e('0x3'));var router=express[_0x6c4e('0x4')]();var auth=require(_0x6c4e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c4e('0x6'));var controller=require(_0x6c4e('0x7'));router[_0x6c4e('0x8')]('/',auth['isAuthenticated'](),controller[_0x6c4e('0x9')]);router['get']('/describe',auth[_0x6c4e('0xa')](),controller[_0x6c4e('0xb')]);router[_0x6c4e('0x8')](_0x6c4e('0xc'),auth[_0x6c4e('0xa')](),controller[_0x6c4e('0xd')]);router[_0x6c4e('0x8')](_0x6c4e('0xe'),auth[_0x6c4e('0xa')](),controller[_0x6c4e('0xf')]);router[_0x6c4e('0x10')]('/',auth[_0x6c4e('0xa')](),controller['create']);router['post'](_0x6c4e('0xe'),auth[_0x6c4e('0xa')](),controller[_0x6c4e('0x11')]);router['put'](_0x6c4e('0xc'),auth[_0x6c4e('0xa')](),controller[_0x6c4e('0x12')]);router[_0x6c4e('0x13')]('/:id',auth[_0x6c4e('0xa')](),controller[_0x6c4e('0x14')]);router[_0x6c4e('0x13')](_0x6c4e('0xe'),auth[_0x6c4e('0xa')](),controller['removeAgents']);module[_0x6c4e('0x15')]=router; \ No newline at end of file +var _0xd5b4=['post','addAgents','put','delete','destroy','/:id/users','removeAgents','exports','multer','util','connect-timeout','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/:id','show','getAgents'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0xd5b4,0xa0));var _0x4d5b=function(_0x3ef051,_0x49ea91){_0x3ef051=_0x3ef051-0x0;var _0x5679b3=_0xd5b4[_0x3ef051];return _0x5679b3;};'use strict';var multer=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var path=require('path');var timeout=require(_0x4d5b('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4d5b('0x3'));var config=require('../../config/environment');var controller=require(_0x4d5b('0x4'));router[_0x4d5b('0x5')]('/',auth[_0x4d5b('0x6')](),controller[_0x4d5b('0x7')]);router[_0x4d5b('0x5')]('/describe',auth[_0x4d5b('0x6')](),controller['describe']);router[_0x4d5b('0x5')](_0x4d5b('0x8'),auth['isAuthenticated'](),controller[_0x4d5b('0x9')]);router[_0x4d5b('0x5')]('/:id/users',auth[_0x4d5b('0x6')](),controller[_0x4d5b('0xa')]);router[_0x4d5b('0xb')]('/',auth[_0x4d5b('0x6')](),controller['create']);router[_0x4d5b('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x4d5b('0xc')]);router[_0x4d5b('0xd')]('/:id',auth[_0x4d5b('0x6')](),controller['update']);router[_0x4d5b('0xe')](_0x4d5b('0x8'),auth['isAuthenticated'](),controller[_0x4d5b('0xf')]);router['delete'](_0x4d5b('0x10'),auth[_0x4d5b('0x6')](),controller[_0x4d5b('0x11')]);module[_0x4d5b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3d1dad9..6ba0cc6 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 _0xbff6=['STRING','name','system-','INTEGER','exports'];(function(_0x3f972c,_0x75509f){var _0x52a826=function(_0x421557){while(--_0x421557){_0x3f972c['push'](_0x3f972c['shift']());}};_0x52a826(++_0x75509f);}(_0xbff6,0x10d));var _0x6bff=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xbff6[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require('sequelize');module[_0x6bff('0x0')]={'name':{'type':Sequelize[_0x6bff('0x1')],'allowNull':![],'unique':_0x6bff('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x43784c){return _0x6bff('0x3')+this['getDataValue'](_0x6bff('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x6bff('0x4')]}}; \ No newline at end of file +var _0x71b7=['getDataValue','INTEGER','STRING','VIRTUAL'];(function(_0x2ae47a,_0x323954){var _0x4960cd=function(_0x21b8f3){while(--_0x21b8f3){_0x2ae47a['push'](_0x2ae47a['shift']());}};_0x4960cd(++_0x323954);}(_0x71b7,0x1da));var _0x771b=function(_0xd467d7,_0x2f13cd){_0xd467d7=_0xd467d7-0x0;var _0x23b23d=_0x71b7[_0xd467d7];return _0x23b23d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x771b('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x771b('0x1')],'get':function(_0x25477c){return'system-'+this[_0x771b('0x2')]('name')+'-';}},'description':{'type':Sequelize[_0x771b('0x0')]},'callerIdAll':{'type':Sequelize[_0x771b('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0x771b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5a8418c..004c2f7 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 _0x55ca=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','VoicePrefix','model','keys','query','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x3bca2d,_0x1af8f4){_0x3bca2d=_0x3bca2d-0x0;var _0x144a7c=_0x55ca[_0x3bca2d];return _0x144a7c;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x23')]({'plain':!![]});var _0x190757=_0xa55c('0x24');return db[_0xa55c('0x25')][_0xa55c('0x26')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x22')](function(){return _0x5ba836;});})[_0xa55c('0x22')](function(){_0x1fc828[_0xa55c('0x1a')](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x19')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x1a')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=db[_0xa55c('0x2b')]['rawAttributes'];_0x35c9c2[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1cc53e);_0x35c9c2[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x52d37f[_0xa55c('0x2e')]);_0x35c9c2[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x35c9c2[_0xa55c('0x2c')],_0x35c9c2[_0xa55c('0x2e')]);_0x490b7d[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x35c9c2['model'],qs['fields'](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x490b7d['attributes']=_0x490b7d[_0xa55c('0x31')][_0xa55c('0x33')]?_0x490b7d[_0xa55c('0x31')]:_0x35c9c2[_0xa55c('0x2c')];if(!_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x34')](_0xa55c('0x35'))){_0x490b7d[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x52d37f['query']['limit']);_0x490b7d['offset']=qs[_0xa55c('0x1e')](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x1e')]);}_0x490b7d['order']=qs[_0xa55c('0x36')](_0x52d37f['query'][_0xa55c('0x36')]);_0x490b7d['where']=qs[_0xa55c('0x2f')](_[_0xa55c('0x37')](_0x52d37f[_0xa55c('0x2e')],_0x35c9c2['filters']));if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x490b7d['where']=_[_0xa55c('0x39')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x3b')]['key']!==_0xa55c('0x3c')){var _0x284bcf={};_0x284bcf[_0x529ff8['field']]={'$like':'%'+_0x52d37f['query']['filter']+'%'};return _0x284bcf;}})});}_0x490b7d=_['merge']({},_0x490b7d,_0x52d37f[_0xa55c('0x3d')]);var _0x45bd15={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x2b')][_0xa55c('0x1d')](_0x45bd15)['then'](function(_0x3d52d8){_0x1d730b[_0xa55c('0x1d')]=_0x3d52d8;if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x3e')]){_0x490b7d[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2b')]['findAll'](_0x490b7d);})[_0xa55c('0x22')](function(_0x5ee63d){_0x1d730b['rows']=_0x5ee63d;return _0x1d730b;})[_0xa55c('0x22')](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports['show']=function(_0x2bd98b,_0x508bd3){var _0x5f25f7={'raw':![],'where':{'id':_0x2bd98b[_0xa55c('0x41')]['id']}},_0x2f8449={};_0x2f8449[_0xa55c('0x2c')]=_['keys'](db[_0xa55c('0x2b')][_0xa55c('0x42')]);_0x2f8449['query']=_[_0xa55c('0x2d')](_0x2bd98b['query']);_0x2f8449[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x2f8449['model'],_0x2f8449[_0xa55c('0x2e')]);_0x5f25f7[_0xa55c('0x31')]=_['intersection'](_0x2f8449[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x2bd98b[_0xa55c('0x2e')]['fields']));_0x5f25f7[_0xa55c('0x31')]=_0x5f25f7['attributes'][_0xa55c('0x33')]?_0x5f25f7[_0xa55c('0x31')]:_0x2f8449[_0xa55c('0x2c')];if(_0x2bd98b['query'][_0xa55c('0x3e')]){_0x5f25f7[_0xa55c('0x3f')]=[{'all':!![]}];}_0x5f25f7=_['merge']({},_0x5f25f7,_0x2bd98b[_0xa55c('0x3d')]);return db[_0xa55c('0x2b')]['find'](_0x5f25f7)[_0xa55c('0x22')](handleEntityNotFound(_0x508bd3,null))[_0xa55c('0x22')](respondWithResult(_0x508bd3,null))['catch'](handleError(_0x508bd3,null));};exports[_0xa55c('0x26')]=function(_0x81cee8,_0x219a68){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x41')]['id']}})['then'](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](removeEntity(_0x219a68,null))[_0xa55c('0x40')](handleError(_0x219a68,null));};exports[_0xa55c('0x43')]=function(_0x4a7adc,_0x39bd3d){return db[_0xa55c('0x2b')]['describe']()[_0xa55c('0x22')](respondWithResult(_0x39bd3d,null))[_0xa55c('0x40')](handleError(_0x39bd3d,null));};exports[_0xa55c('0x44')]=function(_0xcd78c5,_0x36b7e9){var _0x1c84d9;return db[_0xa55c('0x45')][_0xa55c('0x46')](function(_0x3c147b){return db[_0xa55c('0x2b')]['create'](_0xcd78c5[_0xa55c('0x47')],{'transaction':_0x3c147b})[_0xa55c('0x22')](function(_0x216de8){_0x1c84d9=_0x216de8['get']({'plain':!![]});return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x1c84d9['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0x4fa412){return createVoicePrefixExtensions(_0x1c84d9,_0x4fa412,_0x3c147b);});});})[_0xa55c('0x22')](function(){var _0x228df4=_0xcd78c5[_0xa55c('0x4a')][_0xa55c('0x23')]({'plain':!![]});if(!_0x228df4)throw new Error(_0xa55c('0x4b'));if(_0x228df4['role']===_0xa55c('0x4a')){var _0x4607ca=_0x1c84d9;return db['UserProfileSection'][_0xa55c('0x49')]({'where':{'name':_0xa55c('0x24'),'userProfileId':_0x228df4[_0xa55c('0x4c')]},'raw':!![]})[_0xa55c('0x22')](function(_0x50176b){if(_0x50176b&&_0x50176b['autoAssociation']===0x0){return db[_0xa55c('0x25')][_0xa55c('0x44')]({'name':_0x4607ca[_0xa55c('0x28')],'resourceId':_0x4607ca['id'],'type':_0x50176b[_0xa55c('0x28')],'sectionId':_0x50176b['id']},{})['then'](function(){return _0x1c84d9;});}else{return _0x1c84d9;}})[_0xa55c('0x40')](function(_0x5ce463){logger[_0xa55c('0x4d')](_0xa55c('0x4e'),_0x5ce463);throw _0x5ce463;});}return _0x1c84d9;})[_0xa55c('0x22')](respondWithResult(_0x36b7e9,null))[_0xa55c('0x40')](handleError(_0x36b7e9,null));};function Extension(_0xec640,_0x53b2f7,_0x1cb73b,_0x54f776){this[_0xa55c('0x4f')]=_0xa55c('0x50');this[_0xa55c('0x51')]=_0xec640;this[_0xa55c('0x52')]=_0x1cb73b;this[_0xa55c('0x3b')]=_0xa55c('0x53');this[_0xa55c('0x54')]='Voice\x20Prefix\x20Extension';this[_0xa55c('0x55')]=_0x53b2f7;this[_0xa55c('0x56')]=_0x54f776;}function createVoicePrefixExtensions(_0x2f2d21,_0x23a30e,_0x3fa00f){return new BPromise(function(_0x5ba2b0,_0xa72718){var _0x3cd40d=new Extension(formatPrefixName(_0x2f2d21[_0xa55c('0x57')]),0x1,_0xa55c('0x58'),_0xa55c('0x59'));_0x3cd40d['VoicePrefixId']=_0x2f2d21['id'];return db[_0xa55c('0x48')][_0xa55c('0x44')](_0x3cd40d,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x16d9b2){var _0x3ba56d=_0x16d9b2['get']({'plain':!![]});var _0x419fc3=_['map'](addVoicePrefixExtensions(_0x2f2d21,_0x23a30e),function(_0x2e482a){_0x2e482a['VoiceExtensionId']=_0x3ba56d['id'];_0x2e482a[_0xa55c('0x5a')]=_0x2f2d21['id'];return _0x2e482a;});return db['VoiceExtension'][_0xa55c('0x5b')](_0x419fc3,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x21d6b4){if(!_0x21d6b4){return _0xa72718(_0xa55c('0x5c'));}else{return _0x5ba2b0(_0x21d6b4);}})[_0xa55c('0x40')](function(_0x3a5a52){return _0xa72718(_0x3a5a52);});});;});};function addVoicePrefixExtensions(_0xafaf8c,_0x2f2226){var _0x14b515=[];var _0x1acf50=formatPrefixName(_0xafaf8c['prefix']);_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x2,_0xa55c('0x5e'),'CDR(prefix)='+_0xafaf8c[_0xa55c('0x28')]));if(_0xafaf8c[_0xa55c('0x5f')]){_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x5e'),_0xa55c('0x60')+_0xafaf8c[_0xa55c('0x5f')]));}else{_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x58'),'No\x20callerid\x20available'));}_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x4,_0xa55c('0x61'),_0x2f2226[_0xa55c('0x4f')]+','+_0xa55c('0x62')+(0x8+_0xafaf8c[_0xa55c('0x28')][_0xa55c('0x33')])+'}'+','+0x1));return _0x14b515;}function formatPrefixName(_0x2f1237){var _0x4249c1='_';for(var _0x25d5a1=0x0;_0x25d5a1<_0x2f1237['length'];_0x25d5a1++){if(_0x2f1237[_0xa55c('0x63')](_0x25d5a1)=='-'){_0x4249c1+=_0x2f1237[_0xa55c('0x63')](_0x25d5a1);}else{_0x4249c1+='['+_0x2f1237[_0xa55c('0x63')](_0x25d5a1)+']';}}_0x4249c1+='.';return _0x4249c1;}exports[_0xa55c('0x21')]=function(_0x3a269d,_0x10e711,_0x3ea755){var _0x3606b2=_0x3a269d[_0xa55c('0x47')];_0x3606b2[_0xa55c('0x57')]=_0xa55c('0x64')+_0x3606b2['name']+'-';return db[_0xa55c('0x45')]['transaction'](function(_0x1228a4){return db[_0xa55c('0x2b')][_0xa55c('0x21')](_0x3606b2,{'where':{'id':_0x3606b2['id']},'transaction':_0x1228a4})['then'](function(){return db['VoiceExtension'][_0xa55c('0x26')]({'where':{'VoicePrefixId':_0x3606b2['id']},'transaction':_0x1228a4})[_0xa55c('0x22')](function(){return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x3606b2['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0xd02251){return createVoicePrefixExtensions(_0x3606b2,_0xd02251,_0x1228a4);});});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2b')][_0xa55c('0x65')](_0x3606b2['id']);})['then'](respondWithResult(_0x10e711,null))['catch'](handleError(_0x10e711,null));};exports[_0xa55c('0x66')]=function(_0x38689e,_0x3f9d0a,_0x36ee32){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x38689e[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x3f9d0a,null))['then'](function(_0x2ce255){if(_0x2ce255){return _0x2ce255[_0xa55c('0x66')](_0x38689e[_0xa55c('0x47')]['ids'],_[_0xa55c('0x67')](_0x38689e[_0xa55c('0x47')],[_0xa55c('0x68'),'id'])||{})[_0xa55c('0x69')](function(_0x232143){for(var _0x506f74=0x0;_0x506f74<_0x38689e[_0xa55c('0x47')][_0xa55c('0x68')]['length'];_0x506f74+=0x1){socket['emit'](_0xa55c('0x6a'),{'UserId':_0x38689e['body'][_0xa55c('0x68')][_0x506f74],'VoicePrefixId':_0x38689e[_0xa55c('0x41')]['id']});}return _0x232143;});}})[_0xa55c('0x22')](respondWithResult(_0x3f9d0a,null))[_0xa55c('0x40')](handleError(_0x3f9d0a,null));};exports[_0xa55c('0x6b')]=function(_0x3f1132,_0x22b06f,_0xff7b1c){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x3f1132[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x22b06f,null))[_0xa55c('0x22')](function(_0x20ddd0){if(_0x20ddd0){return _0x20ddd0['removeAgents'](_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')])[_0xa55c('0x22')](function(){if(_[_0xa55c('0x6c')](_0x3f1132['query']['ids'])){for(var _0x367470=0x0;_0x367470<_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0xa55c('0x33')];_0x367470+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0x367470]),'VoicePrefixId':Number(_0x3f1132[_0xa55c('0x41')]['id'])});}}else{socket[_0xa55c('0x6d')](_0xa55c('0x6e'),{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')]),'VoicePrefixId':Number(_0x3f1132['params']['id'])});}});}})[_0xa55c('0x22')](respondWithStatusCode(_0x22b06f,null))['catch'](handleError(_0x22b06f,null));};exports[_0xa55c('0x6f')]=function(_0x4845c3,_0x36ded7,_0x313cdc){var _0x441c11={};var _0xcc187f={};var _0xe3444f;var _0x402f02;return db[_0xa55c('0x2b')][_0xa55c('0x70')]({'where':{'id':_0x4845c3['params']['id']}})['then'](handleEntityNotFound(_0x36ded7,null))[_0xa55c('0x22')](function(_0x2948b1){if(_0x2948b1){_0xe3444f=_0x2948b1;_0xcc187f[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](db[_0xa55c('0x71')][_0xa55c('0x42')]);_0xcc187f['query']=_[_0xa55c('0x2d')](_0x4845c3[_0xa55c('0x2e')]);_0xcc187f[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0xcc187f[_0xa55c('0x2c')],_0xcc187f[_0xa55c('0x2e')]);_0x441c11[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0xcc187f['model'],qs[_0xa55c('0x32')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x441c11[_0xa55c('0x31')]=_0x441c11[_0xa55c('0x31')]['length']?_0x441c11[_0xa55c('0x31')]:_0xcc187f[_0xa55c('0x2c')];_0x441c11['order']=qs['sort'](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x36')]);_0x441c11['where']=qs['filters'](_['pick'](_0x4845c3['query'],_0xcc187f[_0xa55c('0x2f')]));if(_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x441c11[_0xa55c('0x3a')]=_[_0xa55c('0x39')](_0x441c11[_0xa55c('0x3a')],{'$or':_['map'](_0x441c11[_0xa55c('0x31')],function(_0x3b6abe){var _0x2c89b1={};_0x2c89b1[_0x3b6abe]={'$like':'%'+_0x4845c3[_0xa55c('0x2e')]['filter']+'%'};return _0x2c89b1;})});}_0x441c11=_[_0xa55c('0x39')]({},_0x441c11,_0x4845c3[_0xa55c('0x3d')]);return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})['then'](function(_0x3459fd){if(_0x3459fd){_0x402f02=_0x3459fd['length'];if(!_0x4845c3['query'][_0xa55c('0x34')](_0xa55c('0x35'))){_0x441c11[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x1f')]);_0x441c11[_0xa55c('0x1e')]=qs['offset'](_0x4845c3['query'][_0xa55c('0x1e')]);}return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})[_0xa55c('0x22')](function(_0x1f4bc8){if(_0x1f4bc8){return _0x1f4bc8?{'count':_0x402f02,'rows':_0x1f4bc8}:null;}})[_0xa55c('0x22')](respondWithResult(_0x36ded7,null))[_0xa55c('0x40')](handleError(_0x36ded7,null));}; \ No newline at end of file +var _0x008c=['body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','save','update','then','destroy','get','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','transaction'];(function(_0x3a7a4d,_0x5f1419){var _0xd10fac=function(_0xa1144e){while(--_0xa1144e){_0x3a7a4d['push'](_0x3a7a4d['shift']());}};_0xd10fac(++_0x5f1419);}(_0x008c,0x188));var _0xc008=function(_0xfc5a04,_0xb77332){_0xfc5a04=_0xfc5a04-0x0;var _0x24b690=_0x008c[_0xfc5a04];return _0x24b690;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];config[_0xc008('0x16')]=_[_0xc008('0x17')](config[_0xc008('0x16')],{'host':_0xc008('0x18'),'port':0x18eb});var socket=require(_0xc008('0x19'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xc008('0x1a')](socket);function respondWithStatusCode(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xcc;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x1b')](_0x25e13f);}return _0x50c1ab[_0xc008('0x1c')](_0x25e13f)[_0xc008('0x1d')]();};}function respondWithResult(_0x5ee00b,_0x5e894e){_0x5e894e=_0x5e894e||0xc8;return function(_0x4bd0f4){if(_0x4bd0f4){return _0x5ee00b[_0xc008('0x1c')](_0x5e894e)[_0xc008('0x1e')](_0x4bd0f4);}};}function respondWithFilteredResult(_0x3cafe3,_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){var _0x53b06e=_0x4fe771[_0xc008('0x1f')],_0x540e45=_0x3eb12a['offset'],_0x5c2668=_0x3eb12a[_0xc008('0x20')]+_0x3eb12a['limit'],_0x46042b;if(_0x5c2668>=_0x53b06e){_0x5c2668=_0x53b06e;_0x46042b=0xc8;}else{_0x46042b=0xce;}_0x3cafe3['status'](_0x46042b);return _0x3cafe3['set']('Content-Range',_0x540e45+'-'+_0x5c2668+'/'+_0x53b06e)[_0xc008('0x1e')](_0x4fe771);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x21')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x22')](_0x4777a6)[_0xc008('0x23')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x24')]()[_0xc008('0x23')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x25')]({'plain':!![]});var _0x5410f5='VoicePrefixes';return db['UserProfileResource'][_0xc008('0x24')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x23')](function(){return _0x58a6ea;});})[_0xc008('0x23')](function(){_0x459fd9[_0xc008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x26')]);if(_0x25eae4[_0xc008('0x27')]){delete _0x25eae4[_0xc008('0x27')];}_0x3865c0[_0xc008('0x1c')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x28')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=db[_0xc008('0x29')][_0xc008('0x2a')];_0x539766[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x267abd);_0x539766[_0xc008('0x2d')]=_[_0xc008('0x2c')](_0x2e0b4e[_0xc008('0x2d')]);_0x539766[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x539766[_0xc008('0x2b')],_0x539766['query']);_0x58db82[_0xc008('0x30')]=_[_0xc008('0x2f')](_0x539766['model'],qs[_0xc008('0x31')](_0x2e0b4e[_0xc008('0x2d')][_0xc008('0x31')]));_0x58db82[_0xc008('0x30')]=_0x58db82[_0xc008('0x30')][_0xc008('0x32')]?_0x58db82[_0xc008('0x30')]:_0x539766[_0xc008('0x2b')];if(!_0x2e0b4e[_0xc008('0x2d')]['hasOwnProperty'](_0xc008('0x33'))){_0x58db82[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x2e0b4e[_0xc008('0x2d')][_0xc008('0x34')]);_0x58db82[_0xc008('0x20')]=qs[_0xc008('0x20')](_0x2e0b4e['query'][_0xc008('0x20')]);}_0x58db82[_0xc008('0x35')]=qs['sort'](_0x2e0b4e[_0xc008('0x2d')][_0xc008('0x36')]);_0x58db82['where']=qs[_0xc008('0x2e')](_[_0xc008('0x37')](_0x2e0b4e[_0xc008('0x2d')],_0x539766['filters']));if(_0x2e0b4e['query']['filter']){_0x58db82[_0xc008('0x38')]=_['merge'](_0x58db82[_0xc008('0x38')],{'$or':_[_0xc008('0x39')](_0x267abd,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x3a')][_0xc008('0x3b')]!==_0xc008('0x3c')){var _0x472994={};_0x472994[_0x6a4ccb[_0xc008('0x3d')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2d')][_0xc008('0x3e')]+'%'};return _0x472994;}})});}_0x58db82=_[_0xc008('0x3f')]({},_0x58db82,_0x2e0b4e[_0xc008('0x40')]);var _0x19c8d0={'where':_0x58db82[_0xc008('0x38')]};return db['VoicePrefix'][_0xc008('0x1f')](_0x19c8d0)[_0xc008('0x23')](function(_0x30b7df){_0x1032b2[_0xc008('0x1f')]=_0x30b7df;if(_0x2e0b4e['query'][_0xc008('0x41')]){_0x58db82[_0xc008('0x42')]=[{'all':!![]}];}return db[_0xc008('0x29')][_0xc008('0x43')](_0x58db82);})[_0xc008('0x23')](function(_0x5706bb){_0x1032b2[_0xc008('0x44')]=_0x5706bb;return _0x1032b2;})[_0xc008('0x23')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x45')](handleError(_0x53ed35,null));};exports[_0xc008('0x46')]=function(_0x7279e8,_0x4f93a4){var _0xf4cc4b={'raw':![],'where':{'id':_0x7279e8[_0xc008('0x47')]['id']}},_0x197854={};_0x197854[_0xc008('0x2b')]=_['keys'](db[_0xc008('0x29')][_0xc008('0x2a')]);_0x197854[_0xc008('0x2d')]=_['keys'](_0x7279e8[_0xc008('0x2d')]);_0x197854['filters']=_[_0xc008('0x2f')](_0x197854['model'],_0x197854[_0xc008('0x2d')]);_0xf4cc4b[_0xc008('0x30')]=_['intersection'](_0x197854[_0xc008('0x2b')],qs[_0xc008('0x31')](_0x7279e8[_0xc008('0x2d')]['fields']));_0xf4cc4b[_0xc008('0x30')]=_0xf4cc4b[_0xc008('0x30')][_0xc008('0x32')]?_0xf4cc4b[_0xc008('0x30')]:_0x197854[_0xc008('0x2b')];if(_0x7279e8[_0xc008('0x2d')]['includeAll']){_0xf4cc4b['include']=[{'all':!![]}];}_0xf4cc4b=_['merge']({},_0xf4cc4b,_0x7279e8[_0xc008('0x40')]);return db[_0xc008('0x29')][_0xc008('0x48')](_0xf4cc4b)[_0xc008('0x23')](handleEntityNotFound(_0x4f93a4,null))[_0xc008('0x23')](respondWithResult(_0x4f93a4,null))[_0xc008('0x45')](handleError(_0x4f93a4,null));};exports[_0xc008('0x24')]=function(_0x33be4f,_0x572593){return db['VoicePrefix']['find']({'where':{'id':_0x33be4f[_0xc008('0x47')]['id']}})[_0xc008('0x23')](handleEntityNotFound(_0x572593,null))[_0xc008('0x23')](removeEntity(_0x572593,null))['catch'](handleError(_0x572593,null));};exports[_0xc008('0x49')]=function(_0x2369c4,_0x17ab1a){return db[_0xc008('0x29')][_0xc008('0x49')]()[_0xc008('0x23')](respondWithResult(_0x17ab1a,null))[_0xc008('0x45')](handleError(_0x17ab1a,null));};exports[_0xc008('0x4a')]=function(_0x3fd7d9,_0x3965b7){var _0x52c444;return db['sequelize'][_0xc008('0x4b')](function(_0x51cb14){return db[_0xc008('0x29')][_0xc008('0x4a')](_0x3fd7d9[_0xc008('0x4c')],{'transaction':_0x51cb14})['then'](function(_0x144ab2){_0x52c444=_0x144ab2[_0xc008('0x25')]({'plain':!![]});return db[_0xc008('0x4d')][_0xc008('0x48')]({'where':{'id':_0x52c444[_0xc008('0x4e')]},'raw':!![]})['then'](function(_0x3a7b3b){return createVoicePrefixExtensions(_0x52c444,_0x3a7b3b,_0x51cb14);});});})[_0xc008('0x23')](function(){var _0x4b4c6d=_0x3fd7d9[_0xc008('0x4f')][_0xc008('0x25')]({'plain':!![]});if(!_0x4b4c6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b4c6d['role']===_0xc008('0x4f')){var _0xd47b74=_0x52c444;return db[_0xc008('0x50')][_0xc008('0x48')]({'where':{'name':_0xc008('0x51'),'userProfileId':_0x4b4c6d['userProfileId']},'raw':!![]})['then'](function(_0x34b72a){if(_0x34b72a&&_0x34b72a['autoAssociation']===0x0){return db[_0xc008('0x52')][_0xc008('0x4a')]({'name':_0xd47b74[_0xc008('0x27')],'resourceId':_0xd47b74['id'],'type':_0x34b72a[_0xc008('0x27')],'sectionId':_0x34b72a['id']},{})[_0xc008('0x23')](function(){return _0x52c444;});}else{return _0x52c444;}})[_0xc008('0x45')](function(_0x49d8b0){logger[_0xc008('0x53')](_0xc008('0x54'),_0x49d8b0);throw _0x49d8b0;});}return _0x52c444;})[_0xc008('0x23')](respondWithResult(_0x3965b7,null))[_0xc008('0x45')](handleError(_0x3965b7,null));};function Extension(_0x4424f5,_0x5aa385,_0x41fae3,_0x4fdab4){this['context']='from-sip';this[_0xc008('0x55')]=_0x4424f5;this[_0xc008('0x56')]=_0x41fae3;this[_0xc008('0x3a')]='system';this[_0xc008('0x57')]=_0xc008('0x58');this[_0xc008('0x59')]=_0x5aa385;this['appdata']=_0x4fdab4;}function createVoicePrefixExtensions(_0x3587c3,_0x1092cb,_0x12ba3f){return new BPromise(function(_0x1b5a22,_0x5baff1){var _0x4022dd=new Extension(formatPrefixName(_0x3587c3['prefix']),0x1,_0xc008('0x5a'),_0xc008('0x5b'));_0x4022dd[_0xc008('0x5c')]=_0x3587c3['id'];return db[_0xc008('0x4d')][_0xc008('0x4a')](_0x4022dd,{'transaction':_0x12ba3f})[_0xc008('0x23')](function(_0x4818c7){var _0x375e71=_0x4818c7['get']({'plain':!![]});var _0x5bf4a9=_[_0xc008('0x39')](addVoicePrefixExtensions(_0x3587c3,_0x1092cb),function(_0x30aa1e){_0x30aa1e['VoiceExtensionId']=_0x375e71['id'];_0x30aa1e[_0xc008('0x5c')]=_0x3587c3['id'];return _0x30aa1e;});return db[_0xc008('0x4d')][_0xc008('0x5d')](_0x5bf4a9,{'transaction':_0x12ba3f})[_0xc008('0x23')](function(_0x21ee6d){if(!_0x21ee6d){return _0x5baff1(_0xc008('0x5e'));}else{return _0x1b5a22(_0x21ee6d);}})[_0xc008('0x45')](function(_0x57ce9a){return _0x5baff1(_0x57ce9a);});});;});};function addVoicePrefixExtensions(_0x16e052,_0x462e1e){var _0x3bfb15=[];var _0x2a60e6=formatPrefixName(_0x16e052[_0xc008('0x5f')]);_0x3bfb15[_0xc008('0x60')](new Extension(_0x2a60e6,0x2,_0xc008('0x61'),_0xc008('0x62')+_0x16e052[_0xc008('0x27')]));if(_0x16e052[_0xc008('0x63')]){_0x3bfb15[_0xc008('0x60')](new Extension(_0x2a60e6,0x3,_0xc008('0x61'),_0xc008('0x64')+_0x16e052[_0xc008('0x63')]));}else{_0x3bfb15['push'](new Extension(_0x2a60e6,0x3,_0xc008('0x5a'),_0xc008('0x65')));}_0x3bfb15[_0xc008('0x60')](new Extension(_0x2a60e6,0x4,'goto',_0x462e1e[_0xc008('0x66')]+','+_0xc008('0x67')+(0x8+_0x16e052['name']['length'])+'}'+','+0x1));return _0x3bfb15;}function formatPrefixName(_0x1a03fd){var _0x2a4c2b='_';for(var _0x7bad14=0x0;_0x7bad14<_0x1a03fd[_0xc008('0x32')];_0x7bad14++){if(_0x1a03fd[_0xc008('0x68')](_0x7bad14)=='-'){_0x2a4c2b+=_0x1a03fd[_0xc008('0x68')](_0x7bad14);}else{_0x2a4c2b+='['+_0x1a03fd[_0xc008('0x68')](_0x7bad14)+']';}}_0x2a4c2b+='.';return _0x2a4c2b;}exports[_0xc008('0x22')]=function(_0x39e219,_0x1b059b,_0x383325){var _0x490a60=_0x39e219[_0xc008('0x4c')];_0x490a60[_0xc008('0x5f')]=_0xc008('0x69')+_0x490a60[_0xc008('0x27')]+'-';return db['sequelize'][_0xc008('0x4b')](function(_0x5975de){return db[_0xc008('0x29')][_0xc008('0x22')](_0x490a60,{'where':{'id':_0x490a60['id']},'transaction':_0x5975de})[_0xc008('0x23')](function(){return db['VoiceExtension'][_0xc008('0x24')]({'where':{'VoicePrefixId':_0x490a60['id']},'transaction':_0x5975de})[_0xc008('0x23')](function(){return db[_0xc008('0x4d')]['find']({'where':{'id':_0x490a60[_0xc008('0x4e')]},'raw':!![]})['then'](function(_0x50ee03){return createVoicePrefixExtensions(_0x490a60,_0x50ee03,_0x5975de);});});});})[_0xc008('0x23')](function(){return db[_0xc008('0x29')][_0xc008('0x6a')](_0x490a60['id']);})[_0xc008('0x23')](respondWithResult(_0x1b059b,null))['catch'](handleError(_0x1b059b,null));};exports[_0xc008('0x6b')]=function(_0x3f2342,_0x49493b,_0x3efb77){return db['VoicePrefix'][_0xc008('0x48')]({'where':{'id':_0x3f2342['params']['id']}})[_0xc008('0x23')](handleEntityNotFound(_0x49493b,null))['then'](function(_0x217791){if(_0x217791){return _0x217791[_0xc008('0x6b')](_0x3f2342[_0xc008('0x4c')][_0xc008('0x6c')],_['omit'](_0x3f2342[_0xc008('0x4c')],[_0xc008('0x6c'),'id'])||{})[_0xc008('0x6d')](function(_0x1d49db){for(var _0x321500=0x0;_0x321500<_0x3f2342[_0xc008('0x4c')][_0xc008('0x6c')][_0xc008('0x32')];_0x321500+=0x1){socket['emit'](_0xc008('0x6e'),{'UserId':_0x3f2342['body']['ids'][_0x321500],'VoicePrefixId':_0x3f2342['params']['id']});}return _0x1d49db;});}})[_0xc008('0x23')](respondWithResult(_0x49493b,null))[_0xc008('0x45')](handleError(_0x49493b,null));};exports[_0xc008('0x6f')]=function(_0x233a85,_0xc2f684,_0x2e9646){return db[_0xc008('0x29')][_0xc008('0x48')]({'where':{'id':_0x233a85[_0xc008('0x47')]['id']}})['then'](handleEntityNotFound(_0xc2f684,null))[_0xc008('0x23')](function(_0x1e6055){if(_0x1e6055){return _0x1e6055[_0xc008('0x6f')](_0x233a85[_0xc008('0x2d')][_0xc008('0x6c')])[_0xc008('0x23')](function(){if(_[_0xc008('0x70')](_0x233a85[_0xc008('0x2d')][_0xc008('0x6c')])){for(var _0x41ac2a=0x0;_0x41ac2a<_0x233a85[_0xc008('0x2d')][_0xc008('0x6c')]['length'];_0x41ac2a+=0x1){socket['emit'](_0xc008('0x71'),{'UserId':Number(_0x233a85[_0xc008('0x2d')][_0xc008('0x6c')][_0x41ac2a]),'VoicePrefixId':Number(_0x233a85['params']['id'])});}}else{socket[_0xc008('0x72')](_0xc008('0x71'),{'UserId':Number(_0x233a85['query']['ids']),'VoicePrefixId':Number(_0x233a85['params']['id'])});}});}})[_0xc008('0x23')](respondWithStatusCode(_0xc2f684,null))[_0xc008('0x45')](handleError(_0xc2f684,null));};exports[_0xc008('0x73')]=function(_0x38ca14,_0x1101b8,_0x44f515){var _0x285c09={};var _0x43ba59={};var _0x1161e6;var _0x1e7a11;return db['VoicePrefix']['findOne']({'where':{'id':_0x38ca14[_0xc008('0x47')]['id']}})[_0xc008('0x23')](handleEntityNotFound(_0x1101b8,null))[_0xc008('0x23')](function(_0x3f1e41){if(_0x3f1e41){_0x1161e6=_0x3f1e41;_0x43ba59[_0xc008('0x2b')]=_[_0xc008('0x2c')](db['User']['rawAttributes']);_0x43ba59[_0xc008('0x2d')]=_[_0xc008('0x2c')](_0x38ca14[_0xc008('0x2d')]);_0x43ba59['filters']=_['intersection'](_0x43ba59['model'],_0x43ba59['query']);_0x285c09['attributes']=_['intersection'](_0x43ba59[_0xc008('0x2b')],qs['fields'](_0x38ca14[_0xc008('0x2d')]['fields']));_0x285c09[_0xc008('0x30')]=_0x285c09[_0xc008('0x30')][_0xc008('0x32')]?_0x285c09['attributes']:_0x43ba59['model'];_0x285c09[_0xc008('0x35')]=qs['sort'](_0x38ca14[_0xc008('0x2d')][_0xc008('0x36')]);_0x285c09['where']=qs[_0xc008('0x2e')](_['pick'](_0x38ca14['query'],_0x43ba59[_0xc008('0x2e')]));if(_0x38ca14[_0xc008('0x2d')]['filter']){_0x285c09[_0xc008('0x38')]=_[_0xc008('0x3f')](_0x285c09[_0xc008('0x38')],{'$or':_['map'](_0x285c09[_0xc008('0x30')],function(_0x17c1d8){var _0x1181c5={};_0x1181c5[_0x17c1d8]={'$like':'%'+_0x38ca14[_0xc008('0x2d')][_0xc008('0x3e')]+'%'};return _0x1181c5;})});}_0x285c09=_[_0xc008('0x3f')]({},_0x285c09,_0x38ca14['options']);return _0x1161e6[_0xc008('0x73')](_0x285c09);}})[_0xc008('0x23')](function(_0x2517c6){if(_0x2517c6){_0x1e7a11=_0x2517c6['length'];if(!_0x38ca14[_0xc008('0x2d')][_0xc008('0x74')](_0xc008('0x33'))){_0x285c09['limit']=qs['limit'](_0x38ca14['query'][_0xc008('0x34')]);_0x285c09[_0xc008('0x20')]=qs[_0xc008('0x20')](_0x38ca14[_0xc008('0x2d')][_0xc008('0x20')]);}return _0x1161e6[_0xc008('0x73')](_0x285c09);}})[_0xc008('0x23')](function(_0x226fa0){if(_0x226fa0){return _0x226fa0?{'count':_0x1e7a11,'rows':_0x226fa0}:null;}})['then'](respondWithResult(_0x1101b8,null))[_0xc008('0x45')](handleError(_0x1101b8,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a45dbed..e971f83 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(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x267a8b,_0x12a42b){var _0x22c34f=function(_0x49a0da){while(--_0x49a0da){_0x267a8b['push'](_0x267a8b['shift']());}};_0x22c34f(++_0x12a42b);}(_0xb10b,0x12a));var _0xbb10=function(_0x36ca7f,_0x337025){_0x36ca7f=_0x36ca7f-0x0;var _0x1dedcd=_0xb10b[_0x36ca7f];return _0x1dedcd;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xbb10('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){VoicePrefixEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);VoicePrefixEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];VoicePrefix[_0xbb10('0x7')](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 28d1a80..6882d6b 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 _0xf012=['define','VoicePrefix','voice_prefixes','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x51302c,_0x376113){var _0x20f6c1=function(_0x530cb3){while(--_0x530cb3){_0x51302c['push'](_0x51302c['shift']());}};_0x20f6c1(++_0x376113);}(_0xf012,0x87));var _0x2f01=function(_0x49cf57,_0x428742){_0x49cf57=_0x49cf57-0x0;var _0x15eca3=_0xf012[_0x49cf57];return _0x15eca3;};'use strict';var _=require(_0x2f01('0x0'));var util=require('util');var logger=require(_0x2f01('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2f01('0x2'));var rp=require(_0x2f01('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f01('0x4'));var config=require(_0x2f01('0x5'));var attributes=require(_0x2f01('0x6'));module[_0x2f01('0x7')]=function(_0x119943,_0x2ca58e){return _0x119943[_0x2f01('0x8')](_0x2f01('0x9'),attributes,{'tableName':_0x2f01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53c1=['rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1fa0b6,_0x331a02){var _0x23cfd6=function(_0x14fda9){while(--_0x14fda9){_0x1fa0b6['push'](_0x1fa0b6['shift']());}};_0x23cfd6(++_0x331a02);}(_0x53c1,0x1d5));var _0x153c=function(_0x41f148,_0x506e2c){_0x41f148=_0x41f148-0x0;var _0x4044af=_0x53c1[_0x41f148];return _0x4044af;};'use strict';var _=require(_0x153c('0x0'));var util=require('util');var logger=require(_0x153c('0x1'))(_0x153c('0x2'));var moment=require(_0x153c('0x3'));var BPromise=require(_0x153c('0x4'));var rp=require(_0x153c('0x5'));var fs=require('fs');var path=require(_0x153c('0x6'));var rimraf=require(_0x153c('0x7'));var config=require(_0x153c('0x8'));var attributes=require(_0x153c('0x9'));module[_0x153c('0xa')]=function(_0x3f0c05,_0x450583){return _0x3f0c05[_0x153c('0xb')](_0x153c('0xc'),attributes,{'tableName':_0x153c('0xd'),'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 1777b38..c7338b7 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 _0xfa2f=['jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xfa2f,0xb9));var _0xffa2=function(_0x17080b,_0x446d6f){_0x17080b=_0x17080b-0x0;var _0x437215=_0xfa2f[_0x17080b];return _0x437215;};'use strict';var _=require(_0xffa2('0x0'));var util=require(_0xffa2('0x1'));var moment=require(_0xffa2('0x2'));var BPromise=require(_0xffa2('0x3'));var rs=require(_0xffa2('0x4'));var fs=require('fs');var Redis=require(_0xffa2('0x5'));var db=require(_0xffa2('0x6'))['db'];var utils=require(_0xffa2('0x7'));var logger=require(_0xffa2('0x8'))(_0xffa2('0x9'));var config=require(_0xffa2('0xa'));var jayson=require(_0xffa2('0xb'));var client=jayson[_0xffa2('0xc')]['http']({'port':0x232a});config[_0xffa2('0xd')]=_['defaults'](config[_0xffa2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xffa2('0xe'))(new Redis(config[_0xffa2('0xd')]));require(_0xffa2('0xf'))[_0xffa2('0x10')](socket);function respondWithRpcPromise(_0x3455a4,_0x56cff5,_0x528e26){return new BPromise(function(_0xc7ffec,_0x2e5e82){return client[_0xffa2('0x11')](_0x3455a4,_0x528e26)[_0xffa2('0x12')](function(_0x111be6){logger[_0xffa2('0x13')](_0xffa2('0x14'),_0x56cff5,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x56cff5,_0xffa2('0x15'),JSON[_0xffa2('0x16')](_0x111be6));if(_0x111be6[_0xffa2('0x17')]){if(_0x111be6[_0xffa2('0x17')][_0xffa2('0x18')]===0x1f4){logger[_0xffa2('0x17')](_0xffa2('0x14'),_0x56cff5,_0x111be6[_0xffa2('0x17')][_0xffa2('0x19')]);return _0x2e5e82(_0x111be6[_0xffa2('0x17')]['message']);}logger[_0xffa2('0x17')](_0xffa2('0x14'),_0x56cff5,_0x111be6['error'][_0xffa2('0x19')]);return _0xc7ffec(_0x111be6[_0xffa2('0x17')][_0xffa2('0x19')]);}else{logger['info'](_0xffa2('0x14'),_0x56cff5,_0xffa2('0x15'));_0xc7ffec(_0x111be6[_0xffa2('0x1a')][_0xffa2('0x19')]);}})[_0xffa2('0x1b')](function(_0x8d8135){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x56cff5,_0x8d8135);_0x2e5e82(_0x8d8135);});});} \ No newline at end of file +var _0xd146=['./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3b8266,_0x4bcafc){var _0x34b571=function(_0x463680){while(--_0x463680){_0x3b8266['push'](_0x3b8266['shift']());}};_0x34b571(++_0x4bcafc);}(_0xd146,0x17a));var _0x6d14=function(_0x5345df,_0x39481b){_0x5345df=_0x5345df-0x0;var _0x305a6f=_0xd146[_0x5345df];return _0x305a6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6d14('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d14('0x1'));var db=require(_0x6d14('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d14('0x3'))(_0x6d14('0x4'));var config=require('../../config/environment');var jayson=require(_0x6d14('0x5'));var client=jayson[_0x6d14('0x6')][_0x6d14('0x7')]({'port':0x232a});config[_0x6d14('0x8')]=_[_0x6d14('0x9')](config['redis'],{'host':_0x6d14('0xa'),'port':0x18eb});var socket=require(_0x6d14('0xb'))(new Redis(config[_0x6d14('0x8')]));require(_0x6d14('0xc'))[_0x6d14('0xd')](socket);function respondWithRpcPromise(_0x37ac46,_0x12f2df,_0x1bef3d){return new BPromise(function(_0x490ffa,_0xb0c2f1){return client[_0x6d14('0xe')](_0x37ac46,_0x1bef3d)[_0x6d14('0xf')](function(_0x529a96){logger[_0x6d14('0x10')](_0x6d14('0x11'),_0x12f2df,'request\x20sent');logger['debug'](_0x6d14('0x12'),_0x12f2df,_0x6d14('0x13'),JSON[_0x6d14('0x14')](_0x529a96));if(_0x529a96['error']){if(_0x529a96[_0x6d14('0x15')][_0x6d14('0x16')]===0x1f4){logger[_0x6d14('0x15')](_0x6d14('0x11'),_0x12f2df,_0x529a96[_0x6d14('0x15')][_0x6d14('0x17')]);return _0xb0c2f1(_0x529a96[_0x6d14('0x15')][_0x6d14('0x17')]);}logger[_0x6d14('0x15')](_0x6d14('0x11'),_0x12f2df,_0x529a96['error']['message']);return _0x490ffa(_0x529a96[_0x6d14('0x15')]['message']);}else{logger[_0x6d14('0x10')](_0x6d14('0x11'),_0x12f2df,'request\x20sent');_0x490ffa(_0x529a96[_0x6d14('0x18')]['message']);}})[_0x6d14('0x19')](function(_0xdb7c5b){logger['error'](_0x6d14('0x11'),_0x12f2df,_0xdb7c5b);_0xb0c2f1(_0xdb7c5b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1108d40..9be2b0c 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 _0xb199=['length','voicePrefix:','./voicePrefix.events','remove','emit','removeListener'];(function(_0x819fdf,_0xe970fe){var _0x550044=function(_0x2ed7ad){while(--_0x2ed7ad){_0x819fdf['push'](_0x819fdf['shift']());}};_0x550044(++_0xe970fe);}(_0xb199,0x140));var _0x9b19=function(_0x5641f1,_0x4d5e14){_0x5641f1=_0x5641f1-0x0;var _0x55b5eb=_0xb199[_0x5641f1];return _0x55b5eb;};'use strict';var VoicePrefixEvents=require(_0x9b19('0x0'));var events=['save',_0x9b19('0x1'),'update'];function createListener(_0x11ab55,_0x5ae7fe){return function(_0x499fad){_0x5ae7fe[_0x9b19('0x2')](_0x11ab55,_0x499fad);};}function removeListener(_0x58f28f,_0x10f2f2){return function(){VoicePrefixEvents[_0x9b19('0x3')](_0x58f28f,_0x10f2f2);};}exports['register']=function(_0x2336f5){for(var _0x4364f2=0x0,_0xee69ff=events[_0x9b19('0x4')];_0x4364f2<_0xee69ff;_0x4364f2++){var _0x3ac3ff=events[_0x4364f2];var _0x24801f=createListener(_0x9b19('0x5')+_0x3ac3ff,_0x2336f5);VoicePrefixEvents['on'](_0x3ac3ff,_0x24801f);}}; \ No newline at end of file +var _0xb5b6=['register','length','voicePrefix:','save','remove','update','emit'];(function(_0x57808d,_0x3b6920){var _0x4f4ed1=function(_0x25c875){while(--_0x25c875){_0x57808d['push'](_0x57808d['shift']());}};_0x4f4ed1(++_0x3b6920);}(_0xb5b6,0x114));var _0x6b5b=function(_0x11e957,_0x4b4b3b){_0x11e957=_0x11e957-0x0;var _0x13b871=_0xb5b6[_0x11e957];return _0x13b871;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x6b5b('0x0'),_0x6b5b('0x1'),_0x6b5b('0x2')];function createListener(_0x239f2f,_0x4a95a1){return function(_0x225219){_0x4a95a1[_0x6b5b('0x3')](_0x239f2f,_0x225219);};}function removeListener(_0x523859,_0x203fbb){return function(){VoicePrefixEvents['removeListener'](_0x523859,_0x203fbb);};}exports[_0x6b5b('0x4')]=function(_0x4c76d5){for(var _0x48a263=0x0,_0x572fb0=events[_0x6b5b('0x5')];_0x48a263<_0x572fb0;_0x48a263++){var _0x2a73d4=events[_0x48a263];var _0x527f37=createListener(_0x6b5b('0x6')+_0x2a73d4,_0x4c76d5);VoicePrefixEvents['on'](_0x2a73d4,_0x527f37);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b40b879..a48cf6c 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 _0x98c3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeBlackLists','exports','multer','util','path','connect-timeout','express'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x98c3,0xab));var _0x398c=function(_0x3d4c5a,_0x5139f8){_0x3d4c5a=_0x3d4c5a-0x0;var _0x38f8c3=_0x98c3[_0x3d4c5a];return _0x38f8c3;};'use strict';var multer=require(_0x398c('0x0'));var util=require(_0x398c('0x1'));var path=require(_0x398c('0x2'));var timeout=require(_0x398c('0x3'));var express=require(_0x398c('0x4'));var router=express[_0x398c('0x5')]();var auth=require(_0x398c('0x6'));var interaction=require(_0x398c('0x7'));var config=require(_0x398c('0x8'));var controller=require(_0x398c('0x9'));router[_0x398c('0xa')]('/',auth['isAuthenticated'](),controller[_0x398c('0xb')]);router['get'](_0x398c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x398c('0xa')](_0x398c('0xd'),auth[_0x398c('0xe')](),controller['getHoppers']);router[_0x398c('0xa')](_0x398c('0xf'),auth[_0x398c('0xe')](),controller[_0x398c('0x10')]);router[_0x398c('0xa')](_0x398c('0x11'),auth[_0x398c('0xe')](),controller[_0x398c('0x12')]);router['get'](_0x398c('0x13'),auth[_0x398c('0xe')](),controller[_0x398c('0x14')]);router['get'](_0x398c('0x15'),auth[_0x398c('0xe')](),controller[_0x398c('0x16')]);router[_0x398c('0xa')]('/:id/users',auth[_0x398c('0xe')](),controller[_0x398c('0x17')]);router[_0x398c('0xa')](_0x398c('0x18'),auth[_0x398c('0xe')](),controller['getMembers']);router[_0x398c('0xa')](_0x398c('0x19'),auth['isAuthenticated'](),controller[_0x398c('0x1a')]);router[_0x398c('0xa')](_0x398c('0x1b'),auth[_0x398c('0xe')](),controller[_0x398c('0x1c')]);router[_0x398c('0x1d')]('/',auth['isAuthenticated'](),controller[_0x398c('0x1e')]);router[_0x398c('0x1d')]('/:id/clone',auth[_0x398c('0xe')](),controller[_0x398c('0x1f')]);router[_0x398c('0x1d')](_0x398c('0x15'),auth[_0x398c('0xe')](),controller[_0x398c('0x20')]);router[_0x398c('0x1d')](_0x398c('0x21'),auth['isAuthenticated'](),controller[_0x398c('0x22')]);router['post'](_0x398c('0x19'),auth[_0x398c('0xe')](),controller[_0x398c('0x23')]);router[_0x398c('0x1d')](_0x398c('0x1b'),auth[_0x398c('0xe')](),controller[_0x398c('0x24')]);router[_0x398c('0x25')](_0x398c('0xc'),auth[_0x398c('0xe')](),controller[_0x398c('0x26')]);router[_0x398c('0x27')]('/:id',auth[_0x398c('0xe')](),controller[_0x398c('0x28')]);router[_0x398c('0x27')](_0x398c('0x15'),auth['isAuthenticated'](),controller[_0x398c('0x29')]);router[_0x398c('0x27')](_0x398c('0x21'),auth[_0x398c('0xe')](),controller['removeAgents']);router[_0x398c('0x27')](_0x398c('0x19'),auth['isAuthenticated'](),controller['removeLists']);router[_0x398c('0x27')]('/:id/blacklists',auth[_0x398c('0xe')](),controller[_0x398c('0x2a')]);module[_0x398c('0x2b')]=router; \ No newline at end of file +var _0x9a86=['/:id/blacklists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addTeams','/:id/users'];(function(_0x22f4ff,_0x3122ee){var _0x5a2b3f=function(_0x3b3609){while(--_0x3b3609){_0x22f4ff['push'](_0x22f4ff['shift']());}};_0x5a2b3f(++_0x3122ee);}(_0x9a86,0xae));var _0x69a8=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0x9a86[_0x51ac09];return _0x3f827d;};'use strict';var multer=require(_0x69a8('0x0'));var util=require(_0x69a8('0x1'));var path=require(_0x69a8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x69a8('0x3')]();var auth=require(_0x69a8('0x4'));var interaction=require(_0x69a8('0x5'));var config=require(_0x69a8('0x6'));var controller=require(_0x69a8('0x7'));router[_0x69a8('0x8')]('/',auth[_0x69a8('0x9')](),controller[_0x69a8('0xa')]);router['get'](_0x69a8('0xb'),auth[_0x69a8('0x9')](),controller[_0x69a8('0xc')]);router[_0x69a8('0x8')]('/:id/hoppers',auth[_0x69a8('0x9')](),controller['getHoppers']);router[_0x69a8('0x8')](_0x69a8('0xd'),auth[_0x69a8('0x9')](),controller[_0x69a8('0xe')]);router['get'](_0x69a8('0xf'),auth[_0x69a8('0x9')](),controller['getHopperFinals']);router[_0x69a8('0x8')](_0x69a8('0x10'),auth['isAuthenticated'](),controller[_0x69a8('0x11')]);router[_0x69a8('0x8')](_0x69a8('0x12'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x69a8('0x14')]);router['get'](_0x69a8('0x15'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x16')]);router[_0x69a8('0x8')](_0x69a8('0x17'),auth['isAuthenticated'](),controller[_0x69a8('0x18')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x69a8('0x19')]);router[_0x69a8('0x1a')]('/',auth[_0x69a8('0x9')](),controller['create']);router['post'](_0x69a8('0x1b'),auth['isAuthenticated'](),controller[_0x69a8('0x1c')]);router[_0x69a8('0x1a')](_0x69a8('0x12'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x1d')]);router[_0x69a8('0x1a')](_0x69a8('0x1e'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x69a8('0x17'),auth[_0x69a8('0x9')](),controller['addLists']);router[_0x69a8('0x1a')](_0x69a8('0x1f'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x20')]);router[_0x69a8('0x21')](_0x69a8('0xb'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x22')]);router[_0x69a8('0x23')](_0x69a8('0xb'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x24')]);router['delete'](_0x69a8('0x12'),auth[_0x69a8('0x9')](),controller[_0x69a8('0x25')]);router['delete'](_0x69a8('0x1e'),auth['isAuthenticated'](),controller[_0x69a8('0x26')]);router[_0x69a8('0x23')]('/:id/lists',auth[_0x69a8('0x9')](),controller[_0x69a8('0x27')]);router[_0x69a8('0x23')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x69a8('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index b6ddc16..aebab0a 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 _0xc8b8=['Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#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)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','inbound','default','leastrecent','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','roundrobin','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','booked','progressive'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc8b8,0x1db));var _0x8c8b=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xc8b8[_0x9b3efc];return _0x200f05;};'use strict';var Sequelize=require(_0x8c8b('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c8b('0x1')],'allowNull':![],'unique':_0x8c8b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x8c8b('0x4')},'musiconhold':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':_0x8c8b('0x5')},'announce':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x8c8b('0x6'),'fewestcalls','random',_0x8c8b('0x7'),_0x8c8b('0x8'),_0x8c8b('0x9'),_0x8c8b('0xa')),'allowNull':![],'defaultValue':_0x8c8b('0xb'),'set':function(_0x1c2632){this[_0x8c8b('0xc')](_0x8c8b('0xd'),_0x1c2632?_0x1c2632:_0x8c8b('0x7'));},'get':function(){var _0xa12a9a=this[_0x8c8b('0xe')](_0x8c8b('0xf'));var _0x1a34a3=this['getDataValue'](_0x8c8b('0x10'));var _0x11b002=this[_0x8c8b('0xe')](_0x8c8b('0xd'));if(_0xa12a9a===_0x8c8b('0x4')){return _0x11b002;}if(_0x1a34a3==='booked'&&_0x11b002===_0x8c8b('0x7')||_0x1a34a3==='booked'&&_0x11b002===_0x8c8b('0x11')){return _0x11b002;}if(_0x1a34a3==='progressive'||_0x1a34a3==='predictive'||_0x1a34a3===_0x8c8b('0x12')){return _0x11b002;}return null;}},'servicelevel':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8c8b('0x13')](0xb)},'timeout':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8c8b('0x1')]},'weight':{'type':Sequelize[_0x8c8b('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8c8b('0x14'),'no'),'defaultValue':_0x8c8b('0x14')},'autopause':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8c8b('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8c8b('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x8c8b('0x3')]('yes','no',_0x8c8b('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x8c8b('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8c8b('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8c8b('0x1')]},'queue_quantity1':{'type':Sequelize[_0x8c8b('0x1')]},'queue_quantity2':{'type':Sequelize[_0x8c8b('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x8c8b('0x1')]},'queue_less_than':{'type':Sequelize[_0x8c8b('0x1')]},'periodic_announce':{'type':Sequelize[_0x8c8b('0x16')],'set':function(_0x2a1a15){this[_0x8c8b('0xc')](_0x8c8b('0x17'),_0x2a1a15?_0x2a1a15[_0x8c8b('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x8c8b('0x17'))?this[_0x8c8b('0xe')](_0x8c8b('0x17'))[_0x8c8b('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':_0x8c8b('0x14'),'set':function(_0x25a10a){this['setDataValue'](_0x8c8b('0x1a'),_0x25a10a?_0x25a10a[_0x8c8b('0x18')](','):[]);},'get':function(){return this[_0x8c8b('0xe')]('joinempty')?this[_0x8c8b('0xe')](_0x8c8b('0x1a'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1d1b11){this['setDataValue'](_0x8c8b('0x1b'),_0x1d1b11?_0x1d1b11[_0x8c8b('0x18')](','):[]);},'get':function(){return this[_0x8c8b('0xe')](_0x8c8b('0x1b'))?this[_0x8c8b('0xe')](_0x8c8b('0x1b'))[_0x8c8b('0x19')](','):[];}},'reportholdtime':{'type':Sequelize[_0x8c8b('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8c8b('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c8b('0x1')]},'acw':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':0x0,'set':function(_0x3c9483){this[_0x8c8b('0xc')](_0x8c8b('0x1d'),_0x3c9483);if(_0x3c9483){if(this['getDataValue'](_0x8c8b('0x1e'))<0x2){this['setDataValue'](_0x8c8b('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8c8b('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':0x0,'comment':_0x8c8b('0x1f')},'dialMethod':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x20'),'progressive','power',_0x8c8b('0x21'),_0x8c8b('0x22')),'defaultValue':_0x8c8b('0x23'),'comment':_0x8c8b('0x24')},'dialLimitChannel':{'type':Sequelize[_0x8c8b('0x13')](0x4)[_0x8c8b('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8c8b('0x26')},'dialLimitQueue':{'type':Sequelize[_0x8c8b('0x13')](0x4)[_0x8c8b('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8c8b('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x8c8b('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8c8b('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x8c8b('0x3')](_0x8c8b('0x29'),_0x8c8b('0x2a')),'defaultValue':_0x8c8b('0x2a'),'comment':_0x8c8b('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8c8b('0x2c')](0x2)[_0x8c8b('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8c8b('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8c8b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8c8b('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c8b('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x8c8b('0x2f'),'comment':_0x8c8b('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c8b('0x31')},'dialQueueProject':{'type':Sequelize[_0x8c8b('0x1')],'comment':_0x8c8b('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c8b('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8c8b('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c8b('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c8b('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8c8b('0x13')](0x5)[_0x8c8b('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c8b('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0x3,'comment':_0x8c8b('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8c8b('0x13')](0x5)[_0x8c8b('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x8c8b('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8c8b('0x38')},'dialTimezone':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x8c8b('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8c8b('0x39'),_0x8c8b('0x3a'),_0x8c8b('0x3b')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':0x0,'comment':_0x8c8b('0x3c')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8c8b('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x8c8b('0x13')](0x9)[_0x8c8b('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8c8b('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8c8b('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8c8b('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8c8b('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8c8b('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x8c8b('0x13')](0x9)[_0x8c8b('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8c8b('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8c8b('0x13')](0x9)[_0x8c8b('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8c8b('0x13')](0x9)[_0x8c8b('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8c8b('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8c8b('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8c8b('0x13')](0x9)[_0x8c8b('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':0x0,'comment':_0x8c8b('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8c8b('0x3')]('DESC',_0x8c8b('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x8c8b('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8c8b('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8c8b('0x45')},'dialCutDigit':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8c8b('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8c8b('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8c8b('0x1c')],'defaultValue':![],'comment':_0x8c8b('0x47'),'set':function(_0x1bf7fc){if(!_0x1bf7fc)this['setDataValue'](_0x8c8b('0x48'),null);this['setDataValue']('mandatoryDisposition',_0x1bf7fc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8c8b('0x13')](0x3)[_0x8c8b('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x5bef=['booked','rrmemory','roundrobin','progressive','INTEGER','yes','all','once','TEXT','periodic_announce','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default','ENUM','ringall','leastrecent','random','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x5bef,0xd3));var _0xf5be=function(_0x16eb3d,_0x157803){_0x16eb3d=_0x16eb3d-0x0;var _0x31612a=_0x5bef[_0x16eb3d];return _0x31612a;};'use strict';var Sequelize=require(_0xf5be('0x0'));module[_0xf5be('0x1')]={'name':{'type':Sequelize[_0xf5be('0x2')],'allowNull':![],'unique':_0xf5be('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xf5be('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xf5be('0x4')},'musiconhold':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':_0xf5be('0x5')},'announce':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf5be('0x6')]('rr',_0xf5be('0x7'),_0xf5be('0x8'),'fewestcalls',_0xf5be('0x9'),'rrmemory','linear',_0xf5be('0xa'),_0xf5be('0xb')),'allowNull':![],'defaultValue':_0xf5be('0x7'),'set':function(_0x4e0406){this[_0xf5be('0xc')](_0xf5be('0xd'),_0x4e0406?_0x4e0406:'rrmemory');},'get':function(){var _0x557309=this[_0xf5be('0xe')](_0xf5be('0xf'));var _0x23a148=this[_0xf5be('0xe')](_0xf5be('0x10'));var _0x47d234=this[_0xf5be('0xe')](_0xf5be('0xd'));if(_0x557309===_0xf5be('0x4')){return _0x47d234;}if(_0x23a148===_0xf5be('0x11')&&_0x47d234===_0xf5be('0x12')||_0x23a148===_0xf5be('0x11')&&_0x47d234===_0xf5be('0x13')){return _0x47d234;}if(_0x23a148===_0xf5be('0x14')||_0x23a148==='predictive'||_0x23a148==='power'){return _0x47d234;}return null;}},'servicelevel':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf5be('0x15')](0xb)},'timeout':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf5be('0x2')]},'weight':{'type':Sequelize[_0xf5be('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf5be('0x16'),'no'),'defaultValue':_0xf5be('0x16')},'autopause':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no',_0xf5be('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xf5be('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xf5be('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf5be('0x6')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf5be('0x6')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xf5be('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf5be('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0xf5be('0x16'),'no',_0xf5be('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xf5be('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xf5be('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf5be('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf5be('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf5be('0x2')]},'queue_quantity1':{'type':Sequelize[_0xf5be('0x2')]},'queue_quantity2':{'type':Sequelize[_0xf5be('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xf5be('0x2')]},'queue_less_than':{'type':Sequelize[_0xf5be('0x2')]},'periodic_announce':{'type':Sequelize[_0xf5be('0x19')],'set':function(_0x342c63){this['setDataValue'](_0xf5be('0x1a'),_0x342c63?_0x342c63['join'](','):[]);},'get':function(){return this[_0xf5be('0xe')]('periodic_announce')?this[_0xf5be('0xe')](_0xf5be('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':_0xf5be('0x16'),'set':function(_0xed250a){this[_0xf5be('0xc')](_0xf5be('0x1b'),_0xed250a?_0xed250a['join'](','):[]);},'get':function(){return this[_0xf5be('0xe')]('joinempty')?this[_0xf5be('0xe')](_0xf5be('0x1b'))[_0xf5be('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':'no','set':function(_0x5f1758){this[_0xf5be('0xc')](_0xf5be('0x1d'),_0x5f1758?_0x5f1758['join'](','):[]);},'get':function(){return this[_0xf5be('0xe')](_0xf5be('0x1d'))?this['getDataValue'](_0xf5be('0x1d'))[_0xf5be('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xf5be('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf5be('0x2')]},'description':{'type':Sequelize[_0xf5be('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x4c03c3){this[_0xf5be('0xc')](_0xf5be('0x1e'),_0x4c03c3);if(_0x4c03c3){if(this[_0xf5be('0xe')]('wrapuptime')<0x2){this[_0xf5be('0xc')](_0xf5be('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf5be('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xf5be('0x20')],'defaultValue':0x0,'comment':_0xf5be('0x21')},'dialMethod':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x22'),_0xf5be('0x14'),_0xf5be('0x23'),_0xf5be('0x24'),_0xf5be('0x11')),'defaultValue':_0xf5be('0x14'),'comment':_0xf5be('0x25')},'dialLimitChannel':{'type':Sequelize[_0xf5be('0x15')](0x4)[_0xf5be('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf5be('0x27')},'dialLimitQueue':{'type':Sequelize[_0xf5be('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf5be('0x28')},'dialPowerLevel':{'type':Sequelize[_0xf5be('0x29')](0x2)[_0xf5be('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf5be('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x2b'),'dropRate'),'defaultValue':_0xf5be('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf5be('0x29')](0x2)[_0xf5be('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf5be('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf5be('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf5be('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf5be('0x2f')},'dialQueueOptions':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':_0xf5be('0x30'),'comment':_0xf5be('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xf5be('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf5be('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf5be('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf5be('0x15')](0x5)[_0xf5be('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf5be('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf5be('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf5be('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf5be('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf5be('0x26')],'defaultValue':0x3,'comment':_0xf5be('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf5be('0x15')](0x5)[_0xf5be('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf5be('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':_0xf5be('0x38')},'dialPrefix':{'type':Sequelize[_0xf5be('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x39'),_0xf5be('0x3a'),_0xf5be('0x3b')),'defaultValue':_0xf5be('0x39')},'dialAMDActive':{'type':Sequelize[_0xf5be('0x20')],'defaultValue':0x0,'comment':_0xf5be('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf5be('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf5be('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf5be('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf5be('0x15')](0x9)[_0xf5be('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf5be('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf5be('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf5be('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf5be('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf5be('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xf5be('0x15')](0x5)[_0xf5be('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf5be('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf5be('0x6')](_0xf5be('0x44'),_0xf5be('0x45')),'defaultValue':_0xf5be('0x44')},'dialQueueProject2':{'type':Sequelize[_0xf5be('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf5be('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf5be('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf5be('0x46')},'dialCutDigit':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf5be('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf5be('0x15')],'allowNull':!![],'comment':_0xf5be('0x48')},'mandatoryDisposition':{'type':Sequelize[_0xf5be('0x20')],'defaultValue':![],'comment':_0xf5be('0x49'),'set':function(_0x224927){if(!_0x224927)this[_0xf5be('0xc')](_0xf5be('0x4a'),null);this[_0xf5be('0xc')](_0xf5be('0x4b'),_0x224927);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf5be('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf5be('0x15')](0x3)[_0xf5be('0x26')],'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 707bcae..64864a0 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 _0xc4d0=['spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','phone','ContactId','NOW()','scheduledAt','CmListId','ListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','from','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','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','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','get','inbound','QueueCampaigns','outbound','filter','ignore','value','type','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','includeAll','include','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','user','UserProfileSection','findOne','CmHopper','rawAttributes','VoiceQueueId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents'];(function(_0x4a1052,_0x222370){var _0x454fa7=function(_0x1f6620){while(--_0x1f6620){_0x4a1052['push'](_0x4a1052['shift']());}};_0x454fa7(++_0x222370);}(_0xc4d0,0x194));var _0x0c4d=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xc4d0[_0x3f578f];return _0x32c754;};'use strict';var pdf=require(_0x0c4d('0x0'));var emlformat=require(_0x0c4d('0x1'));var rimraf=require(_0x0c4d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c4d('0x3'));var rp=require(_0x0c4d('0x4'));var moment=require(_0x0c4d('0x5'));var BPromise=require(_0x0c4d('0x6'));var Mustache=require(_0x0c4d('0x7'));var util=require(_0x0c4d('0x8'));var path=require(_0x0c4d('0x9'));var sox=require(_0x0c4d('0xa'));var csv=require(_0x0c4d('0xb'));var ejs=require(_0x0c4d('0xc'));var fs=require('fs');var _=require(_0x0c4d('0xd'));var squel=require(_0x0c4d('0xe'));var crypto=require(_0x0c4d('0xf'));var jsforce=require(_0x0c4d('0x10'));var deskjs=require(_0x0c4d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0c4d('0x12'));var Papa=require('papaparse');var Redis=require(_0x0c4d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0c4d('0x14'));var hardwareService=require(_0x0c4d('0x15'));var logger=require(_0x0c4d('0x16'))('api');var utils=require(_0x0c4d('0x17'));var config=require(_0x0c4d('0x18'));var db=require('../../mysqldb')['db'];config[_0x0c4d('0x19')]=_[_0x0c4d('0x1a')](config[_0x0c4d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c4d('0x1b'))(new Redis(config[_0x0c4d('0x19')]));require(_0x0c4d('0x1c'))[_0x0c4d('0x1d')](socket);function respondWithStatusCode(_0x511027,_0x128b6b){_0x128b6b=_0x128b6b||0xcc;return function(_0x585346){if(_0x585346){return _0x511027[_0x0c4d('0x1e')](_0x128b6b);}return _0x511027['status'](_0x128b6b)[_0x0c4d('0x1f')]();};}function respondWithResult(_0x30185a,_0x331346){_0x331346=_0x331346||0xc8;return function(_0x20fe0f){if(_0x20fe0f){return _0x30185a[_0x0c4d('0x20')](_0x331346)[_0x0c4d('0x21')](_0x20fe0f);}};}function respondWithFilteredResult(_0x25af16,_0x3e6487){return function(_0x5a6803){if(_0x5a6803){var _0x46c7c5=_0x5a6803[_0x0c4d('0x22')],_0x424c93=_0x3e6487[_0x0c4d('0x23')],_0x5cfb2d=_0x3e6487[_0x0c4d('0x23')]+_0x3e6487[_0x0c4d('0x24')],_0x430e23;if(_0x5cfb2d>=_0x46c7c5){_0x5cfb2d=_0x46c7c5;_0x430e23=0xc8;}else{_0x430e23=0xce;}_0x25af16[_0x0c4d('0x20')](_0x430e23);return _0x25af16[_0x0c4d('0x25')]('Content-Range',_0x424c93+'-'+_0x5cfb2d+'/'+_0x46c7c5)[_0x0c4d('0x21')](_0x5a6803);}return null;};}function patchUpdates(_0xc21fdd){return function(_0x50f0dc){try{jsonpatch[_0x0c4d('0x26')](_0x50f0dc,_0xc21fdd,!![]);}catch(_0x590bc1){return BPromise['reject'](_0x590bc1);}return _0x50f0dc[_0x0c4d('0x27')]();};}function saveUpdates(_0x5f1b11,_0x192b9a){return function(_0x47ccb9){if(_0x47ccb9){return _0x47ccb9[_0x0c4d('0x28')](_0x5f1b11)['then'](function(_0x1c083a){return _0x1c083a;});}return null;};}function removeEntity(_0x4df1b6,_0xa0c259){return function(_0x5999ea){if(_0x5999ea){return _0x5999ea['destroy']()[_0x0c4d('0x29')](function(){var _0x5efba6=_0x5999ea[_0x0c4d('0x2a')]({'plain':!![]});var _0x3eb8e5=[{'name':'VoiceQueues','value':_0x0c4d('0x2b'),'ignore':![]},{'name':_0x0c4d('0x2c'),'value':_0x0c4d('0x2d'),'ignore':![]}];var _0x1ffa16=_(_0x3eb8e5)[_0x0c4d('0x2e')](_0x0c4d('0x2f'))['map'](_0x0c4d('0x30'))[_0x0c4d('0x30')]();if(_['includes'](_0x1ffa16,_0x5efba6[_0x0c4d('0x31')])){return;}var _0x10845b=_['find'](_0x3eb8e5,[_0x0c4d('0x30'),_0x5efba6['type']])[_0x0c4d('0x32')];return db[_0x0c4d('0x33')][_0x0c4d('0x34')]({'where':{'type':_0x10845b,'resourceId':_0x5efba6['id']}})[_0x0c4d('0x29')](function(){return _0x5999ea;});})[_0x0c4d('0x29')](function(){_0x4df1b6[_0x0c4d('0x20')](0xcc)[_0x0c4d('0x1f')]();});}};}function handleEntityNotFound(_0xbecdcc,_0xd6f937){return function(_0x584903){if(!_0x584903){_0xbecdcc['sendStatus'](0x194);}return _0x584903;};}function handleError(_0x20c09f,_0x49926e){_0x49926e=_0x49926e||0x1f4;return function(_0x268b8f){logger[_0x0c4d('0x35')](_0x268b8f[_0x0c4d('0x36')]);if(_0x268b8f['name']){delete _0x268b8f[_0x0c4d('0x32')];}_0x20c09f['status'](_0x49926e)['send'](_0x268b8f);};}exports[_0x0c4d('0x37')]=function(_0xf8eb0b,_0x36c679){var _0x5f52cf={},_0x5c7fbe={},_0x4ae020={'count':0x0,'rows':[]};var _0xe8dcdf=db[_0x0c4d('0x38')]['rawAttributes'];_0x5c7fbe['model']=_['keys'](_0xe8dcdf);_0x5c7fbe['query']=_[_0x0c4d('0x39')](_0xf8eb0b[_0x0c4d('0x3a')]);_0x5c7fbe['filters']=_[_0x0c4d('0x3b')](_0x5c7fbe['model'],_0x5c7fbe[_0x0c4d('0x3a')]);_0x5f52cf['attributes']=_['intersection'](_0x5c7fbe[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0xf8eb0b[_0x0c4d('0x3a')]['fields']));_0x5f52cf[_0x0c4d('0x3e')]=_0x5f52cf[_0x0c4d('0x3e')][_0x0c4d('0x3f')]?_0x5f52cf[_0x0c4d('0x3e')]:_0x5c7fbe[_0x0c4d('0x3c')];if(!_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0x5f52cf[_0x0c4d('0x24')]=qs[_0x0c4d('0x24')](_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0x5f52cf[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}_0x5f52cf[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x5f52cf[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_[_0x0c4d('0x46')](_0xf8eb0b[_0x0c4d('0x3a')],_0x5c7fbe[_0x0c4d('0x45')]));if(_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x5f52cf[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x5f52cf[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0xe8dcdf,function(_0x33952a){if(_0x33952a[_0x0c4d('0x31')][_0x0c4d('0x49')]!=='VIRTUAL'){var _0x8aa1f6={};_0x8aa1f6[_0x33952a['field']]={'$like':'%'+_0xf8eb0b[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x8aa1f6;}})});}_0x5f52cf=_[_0x0c4d('0x47')]({},_0x5f52cf,_0xf8eb0b['options']);var _0x87be19={'where':_0x5f52cf[_0x0c4d('0x44')]};return db[_0x0c4d('0x38')][_0x0c4d('0x22')](_0x87be19)[_0x0c4d('0x29')](function(_0x4b475d){_0x4ae020[_0x0c4d('0x22')]=_0x4b475d;if(_0xf8eb0b['query'][_0x0c4d('0x4a')]){_0x5f52cf[_0x0c4d('0x4b')]=[{'all':!![]}];}return db[_0x0c4d('0x38')][_0x0c4d('0x4c')](_0x5f52cf);})['then'](function(_0x1d5582){_0x4ae020['rows']=_0x1d5582;return _0x4ae020;})[_0x0c4d('0x29')](respondWithFilteredResult(_0x36c679,_0x5f52cf))[_0x0c4d('0x4d')](handleError(_0x36c679,null));};exports[_0x0c4d('0x4e')]=function(_0xa4cff0,_0xeea9b5){var _0x206452={'raw':![],'where':{'id':_0xa4cff0[_0x0c4d('0x4f')]['id']}},_0x1a9ab8={};_0x1a9ab8[_0x0c4d('0x3c')]=_[_0x0c4d('0x39')](db[_0x0c4d('0x38')]['rawAttributes']);_0x1a9ab8[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0xa4cff0['query']);_0x1a9ab8[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x1a9ab8[_0x0c4d('0x3c')],_0x1a9ab8[_0x0c4d('0x3a')]);_0x206452[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x1a9ab8[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0xa4cff0[_0x0c4d('0x3a')][_0x0c4d('0x3d')]));_0x206452[_0x0c4d('0x3e')]=_0x206452['attributes'][_0x0c4d('0x3f')]?_0x206452[_0x0c4d('0x3e')]:_0x1a9ab8['model'];if(_0xa4cff0[_0x0c4d('0x3a')][_0x0c4d('0x4a')]){_0x206452[_0x0c4d('0x4b')]=[{'all':!![]}];}_0x206452=_[_0x0c4d('0x47')]({},_0x206452,_0xa4cff0[_0x0c4d('0x50')]);return db[_0x0c4d('0x38')][_0x0c4d('0x51')](_0x206452)['then'](handleEntityNotFound(_0xeea9b5,null))[_0x0c4d('0x29')](respondWithResult(_0xeea9b5,null))[_0x0c4d('0x4d')](handleError(_0xeea9b5,null));};exports['create']=function(_0x4058d7,_0x56869c){return db[_0x0c4d('0x38')][_0x0c4d('0x52')](_0x4058d7[_0x0c4d('0x53')],{})[_0x0c4d('0x29')](function(_0x491f06){var _0x35abb2=_0x4058d7['user'][_0x0c4d('0x2a')]({'plain':!![]});if(!_0x35abb2)throw new Error(_0x0c4d('0x54'));if(_0x35abb2[_0x0c4d('0x55')]==='user'){var _0x5781bc=_0x491f06['get']({'plain':!![]});var _0x11da1c=[{'name':_0x0c4d('0x56'),'value':_0x0c4d('0x2b')},{'name':_0x0c4d('0x2c'),'value':_0x0c4d('0x2d')}];var _0x526042=_['find'](_0x11da1c,[_0x0c4d('0x30'),_0x5781bc['type']])['name'];return db['UserProfileSection'][_0x0c4d('0x51')]({'where':{'name':_0x526042,'userProfileId':_0x35abb2[_0x0c4d('0x57')]},'raw':!![]})[_0x0c4d('0x29')](function(_0x23c4ff){if(_0x23c4ff&&_0x23c4ff[_0x0c4d('0x58')]===0x0){return db['UserProfileResource'][_0x0c4d('0x52')]({'name':_0x5781bc[_0x0c4d('0x32')],'resourceId':_0x5781bc['id'],'type':_0x23c4ff[_0x0c4d('0x32')],'sectionId':_0x23c4ff['id']},{})[_0x0c4d('0x29')](function(){return _0x491f06;});}else{return _0x491f06;}})[_0x0c4d('0x4d')](function(_0x3f4b22){logger[_0x0c4d('0x35')](_0x0c4d('0x59'),_0x3f4b22);throw _0x3f4b22;});}return _0x491f06;})['then'](respondWithResult(_0x56869c,0xc9))['catch'](handleError(_0x56869c,null));};exports[_0x0c4d('0x5a')]=function(_0x295ebf,_0x3b8b5c){var _0x508d6d={'raw':![],'where':{'id':_0x295ebf[_0x0c4d('0x4f')]['id']}},_0x44871a={};_0x44871a['model']=_[_0x0c4d('0x39')](db[_0x0c4d('0x38')]['rawAttributes']);_0x508d6d[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x44871a['model'],qs['fields'](_0x295ebf[_0x0c4d('0x3a')][_0x0c4d('0x3d')]));_0x508d6d[_0x0c4d('0x3e')]=_0x508d6d[_0x0c4d('0x3e')]['length']?_0x508d6d['attributes']:_0x44871a[_0x0c4d('0x3c')];if(_0x295ebf['query'][_0x0c4d('0x4a')]){_0x508d6d[_0x0c4d('0x4b')]=[{'all':!![]}];}_0x508d6d=_[_0x0c4d('0x47')]({},_0x508d6d,_0x295ebf[_0x0c4d('0x50')]);return db[_0x0c4d('0x38')][_0x0c4d('0x51')](_0x508d6d)['then'](handleEntityNotFound(_0x3b8b5c,null))[_0x0c4d('0x29')](function(_0x264428){if(_0x264428){var _0x25d245=_0x264428['get']({'plain':!![]});_0x25d245=qs['omit'](_0x25d245,['id',_0x0c4d('0x5b'),_0x0c4d('0x5c')]);_0x295ebf[_0x0c4d('0x53')]=_[_0x0c4d('0x5d')](_0x295ebf['body'],['id','createdAt',_0x0c4d('0x5c')]);return db['VoiceQueue']['create'](_[_0x0c4d('0x47')](_0x25d245,_0x295ebf[_0x0c4d('0x53')]),{'include':_0x295ebf[_0x0c4d('0x3a')][_0x0c4d('0x4a')]?[{'all':!![]}]:undefined})[_0x0c4d('0x29')](function(_0x17c520){var _0x3631a5=_0x295ebf[_0x0c4d('0x5e')]['get']({'plain':!![]});if(!_0x3631a5)throw new Error(_0x0c4d('0x54'));if(_0x3631a5[_0x0c4d('0x55')]===_0x0c4d('0x5e')){var _0x2a4ebb=_0x17c520[_0x0c4d('0x2a')]({'plain':!![]});var _0x2c68a3=[{'name':_0x0c4d('0x56'),'value':_0x0c4d('0x2b')},{'name':_0x0c4d('0x2c'),'value':_0x0c4d('0x2d')}];var _0x4a8995=_[_0x0c4d('0x51')](_0x2c68a3,['value',_0x2a4ebb[_0x0c4d('0x31')]])['name'];return db[_0x0c4d('0x5f')]['find']({'where':{'name':_0x4a8995,'userProfileId':_0x3631a5[_0x0c4d('0x57')]},'raw':!![]})[_0x0c4d('0x29')](function(_0x23596e){if(_0x23596e&&_0x23596e['autoAssociation']===0x0){return db[_0x0c4d('0x33')][_0x0c4d('0x52')]({'name':_0x2a4ebb['name'],'resourceId':_0x2a4ebb['id'],'type':_0x23596e['name'],'sectionId':_0x23596e['id']},{})[_0x0c4d('0x29')](function(){return _0x17c520;});}else{return _0x17c520;}})[_0x0c4d('0x4d')](function(_0x48eb52){logger[_0x0c4d('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48eb52);throw _0x48eb52;});}return _0x17c520;});}})[_0x0c4d('0x29')](respondWithResult(_0x3b8b5c,0xc9))[_0x0c4d('0x4d')](handleError(_0x3b8b5c,null));};exports[_0x0c4d('0x28')]=function(_0x15cf6f,_0x142c65){if(_0x15cf6f[_0x0c4d('0x53')]['id']){delete _0x15cf6f[_0x0c4d('0x53')]['id'];}return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x15cf6f['params']['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x142c65,null))[_0x0c4d('0x29')](saveUpdates(_0x15cf6f[_0x0c4d('0x53')],null))['then'](respondWithResult(_0x142c65,null))['catch'](handleError(_0x142c65,null));};exports[_0x0c4d('0x34')]=function(_0x4d3b6b,_0x2d2280){return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x4d3b6b[_0x0c4d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2d2280,null))[_0x0c4d('0x29')](removeEntity(_0x2d2280,null))[_0x0c4d('0x4d')](handleError(_0x2d2280,null));};exports['getHoppers']=function(_0x31ed6f,_0x12d243,_0x36e77b){var _0x5a4275={'raw':![],'where':{}};var _0x314d01={};var _0x2411ac={'count':0x0,'rows':[]};return db[_0x0c4d('0x38')][_0x0c4d('0x60')]({'where':{'id':_0x31ed6f[_0x0c4d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12d243,null))[_0x0c4d('0x29')](function(_0x2e910d){if(_0x2e910d){_0x314d01['model']=_['keys'](db[_0x0c4d('0x61')][_0x0c4d('0x62')]);_0x314d01[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0x31ed6f['query']);_0x314d01[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x314d01[_0x0c4d('0x3c')],_0x314d01[_0x0c4d('0x3a')]);_0x5a4275['attributes']=_['intersection'](_0x314d01[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x31ed6f[_0x0c4d('0x3a')]['fields']));_0x5a4275[_0x0c4d('0x3e')]=_0x5a4275[_0x0c4d('0x3e')][_0x0c4d('0x3f')]?_0x5a4275[_0x0c4d('0x3e')]:_0x314d01[_0x0c4d('0x3c')];if(!_0x31ed6f['query'][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0x5a4275[_0x0c4d('0x24')]=qs[_0x0c4d('0x24')](_0x31ed6f['query']['limit']);_0x5a4275[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0x31ed6f[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}_0x5a4275[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0x31ed6f['query'][_0x0c4d('0x43')]);_0x5a4275[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_['pick'](_0x31ed6f['query'],_0x314d01[_0x0c4d('0x45')]));_0x5a4275['where'][_0x0c4d('0x63')]=_0x2e910d['id'];if(_0x31ed6f[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x5a4275[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x5a4275['where'],{'$or':_[_0x0c4d('0x48')](_0x5a4275['attributes'],function(_0x2b9f32){var _0x1fb3cf={};_0x1fb3cf[_0x2b9f32]={'$like':'%'+_0x31ed6f[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x1fb3cf;})});}_0x5a4275=_['merge']({},_0x5a4275,_0x31ed6f['options']);return db[_0x0c4d('0x61')]['count']({'where':_0x5a4275[_0x0c4d('0x44')]})[_0x0c4d('0x29')](function(_0x50e05c){_0x2411ac[_0x0c4d('0x22')]=_0x50e05c;if(_0x31ed6f[_0x0c4d('0x3a')]['includeAll']){_0x5a4275[_0x0c4d('0x4b')]=[{'all':!![]}];}return db[_0x0c4d('0x61')][_0x0c4d('0x4c')](_0x5a4275);})['then'](function(_0x4b2276){_0x2411ac['rows']=_0x4b2276;return _0x2411ac;});}})[_0x0c4d('0x29')](respondWithFilteredResult(_0x12d243,_0x5a4275))[_0x0c4d('0x4d')](handleError(_0x12d243,null));};exports[_0x0c4d('0x64')]=function(_0xdc2caf,_0x1064b0,_0x3fd719){var _0x112783={'raw':!![],'where':{}};var _0x43bd92={};var _0x1cee7f={'count':0x0,'rows':[]};return db[_0x0c4d('0x38')][_0x0c4d('0x60')]({'where':{'id':_0xdc2caf[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x1064b0,null))[_0x0c4d('0x29')](function(_0x15c7f6){if(_0x15c7f6){_0x43bd92[_0x0c4d('0x3c')]=_['keys'](db[_0x0c4d('0x65')][_0x0c4d('0x62')]);_0x43bd92[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0xdc2caf[_0x0c4d('0x3a')]);_0x43bd92[_0x0c4d('0x45')]=_['intersection'](_0x43bd92[_0x0c4d('0x3c')],_0x43bd92[_0x0c4d('0x3a')]);_0x112783[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x43bd92['model'],qs[_0x0c4d('0x3d')](_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x3d')]));_0x112783[_0x0c4d('0x3e')]=_0x112783[_0x0c4d('0x3e')]['length']?_0x112783[_0x0c4d('0x3e')]:_0x43bd92[_0x0c4d('0x3c')];if(!_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0x112783['limit']=qs['limit'](_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0x112783['offset']=qs[_0x0c4d('0x23')](_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}_0x112783[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x112783['where']=qs[_0x0c4d('0x45')](_['pick'](_0xdc2caf[_0x0c4d('0x3a')],_0x43bd92[_0x0c4d('0x45')]));_0x112783[_0x0c4d('0x44')][_0x0c4d('0x63')]=_0x15c7f6['id'];if(_0xdc2caf[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x112783[_0x0c4d('0x44')]=_['merge'](_0x112783[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0x112783[_0x0c4d('0x3e')],function(_0x1ebde6){var _0x5c7fd0={};_0x5c7fd0[_0x1ebde6]={'$like':'%'+_0xdc2caf['query'][_0x0c4d('0x2e')]+'%'};return _0x5c7fd0;})});}_0x112783=_[_0x0c4d('0x47')]({},_0x112783,_0xdc2caf[_0x0c4d('0x50')]);return db[_0x0c4d('0x65')][_0x0c4d('0x22')]({'where':_0x112783[_0x0c4d('0x44')]})[_0x0c4d('0x29')](function(_0x1caf1c){_0x1cee7f[_0x0c4d('0x22')]=_0x1caf1c;if(_0xdc2caf['query']['includeAll']){_0x112783['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0c4d('0x4c')](_0x112783);})['then'](function(_0x4e1609){_0x1cee7f[_0x0c4d('0x66')]=_0x4e1609;return _0x1cee7f;});}})[_0x0c4d('0x29')](respondWithFilteredResult(_0x1064b0,_0x112783))[_0x0c4d('0x4d')](handleError(_0x1064b0,null));};exports[_0x0c4d('0x67')]=function(_0x47ad5e,_0x337fc9,_0xc3d1be){var _0x20c899={'raw':!![],'where':{}};var _0x136592={};var _0x490531={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0c4d('0x60')]({'where':{'id':_0x47ad5e[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x337fc9,null))[_0x0c4d('0x29')](function(_0x43f7f0){if(_0x43f7f0){_0x136592['model']=_[_0x0c4d('0x39')](db[_0x0c4d('0x68')][_0x0c4d('0x62')]);_0x136592[_0x0c4d('0x3a')]=_['keys'](_0x47ad5e[_0x0c4d('0x3a')]);_0x136592[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x136592[_0x0c4d('0x3c')],_0x136592[_0x0c4d('0x3a')]);_0x20c899['attributes']=_['intersection'](_0x136592[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x47ad5e['query']['fields']));_0x20c899[_0x0c4d('0x3e')]=_0x20c899[_0x0c4d('0x3e')]['length']?_0x20c899[_0x0c4d('0x3e')]:_0x136592[_0x0c4d('0x3c')];if(!_0x47ad5e['query']['hasOwnProperty']('nolimit')){_0x20c899[_0x0c4d('0x24')]=qs[_0x0c4d('0x24')](_0x47ad5e['query'][_0x0c4d('0x24')]);_0x20c899[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0x47ad5e[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}_0x20c899['order']=qs[_0x0c4d('0x43')](_0x47ad5e[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x20c899[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_[_0x0c4d('0x46')](_0x47ad5e['query'],_0x136592[_0x0c4d('0x45')]));_0x20c899[_0x0c4d('0x44')][_0x0c4d('0x63')]=_0x43f7f0['id'];if(_0x47ad5e[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x20c899[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x20c899[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0x20c899[_0x0c4d('0x3e')],function(_0x5c28f3){var _0x57b294={};_0x57b294[_0x5c28f3]={'$like':'%'+_0x47ad5e[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x57b294;})});}_0x20c899=_[_0x0c4d('0x47')]({},_0x20c899,_0x47ad5e[_0x0c4d('0x50')]);return db[_0x0c4d('0x68')][_0x0c4d('0x22')]({'where':_0x20c899[_0x0c4d('0x44')]})['then'](function(_0x37304f){_0x490531['count']=_0x37304f;if(_0x47ad5e[_0x0c4d('0x3a')][_0x0c4d('0x4a')]){_0x20c899[_0x0c4d('0x4b')]=[{'all':!![]}];}return db[_0x0c4d('0x68')]['findAll'](_0x20c899);})[_0x0c4d('0x29')](function(_0x398b16){_0x490531[_0x0c4d('0x66')]=_0x398b16;return _0x490531;});}})['then'](respondWithFilteredResult(_0x337fc9,_0x20c899))[_0x0c4d('0x4d')](handleError(_0x337fc9,null));};exports[_0x0c4d('0x69')]=function(_0x10441e,_0x2b3ded,_0x4f1f47){var _0x1fdd04={'raw':!![],'where':{}};var _0x108f8e={};var _0x22031f={'count':0x0,'rows':[]};return db[_0x0c4d('0x38')][_0x0c4d('0x60')]({'where':{'id':_0x10441e[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x2b3ded,null))[_0x0c4d('0x29')](function(_0x20371a){if(_0x20371a){_0x108f8e[_0x0c4d('0x3c')]=_[_0x0c4d('0x39')](db[_0x0c4d('0x6a')]['rawAttributes']);_0x108f8e['query']=_[_0x0c4d('0x39')](_0x10441e[_0x0c4d('0x3a')]);_0x108f8e[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x108f8e[_0x0c4d('0x3c')],_0x108f8e[_0x0c4d('0x3a')]);_0x1fdd04[_0x0c4d('0x3e')]=_['intersection'](_0x108f8e[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x3d')]));_0x1fdd04[_0x0c4d('0x3e')]=_0x1fdd04[_0x0c4d('0x3e')][_0x0c4d('0x3f')]?_0x1fdd04[_0x0c4d('0x3e')]:_0x108f8e[_0x0c4d('0x3c')];if(!_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0x1fdd04[_0x0c4d('0x24')]=qs['limit'](_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0x1fdd04['offset']=qs[_0x0c4d('0x23')](_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}_0x1fdd04[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x1fdd04[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_[_0x0c4d('0x46')](_0x10441e[_0x0c4d('0x3a')],_0x108f8e[_0x0c4d('0x45')]));_0x1fdd04[_0x0c4d('0x44')][_0x0c4d('0x63')]=_0x20371a['id'];if(_0x10441e['query'][_0x0c4d('0x2e')]){_0x1fdd04[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x1fdd04['where'],{'$or':_[_0x0c4d('0x48')](_0x1fdd04[_0x0c4d('0x3e')],function(_0x444b3b){var _0x3cc1c6={};_0x3cc1c6[_0x444b3b]={'$like':'%'+_0x10441e[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x3cc1c6;})});}_0x1fdd04=_['merge']({},_0x1fdd04,_0x10441e[_0x0c4d('0x50')]);return db[_0x0c4d('0x6a')][_0x0c4d('0x22')]({'where':_0x1fdd04[_0x0c4d('0x44')]})[_0x0c4d('0x29')](function(_0x3900c1){_0x22031f[_0x0c4d('0x22')]=_0x3900c1;if(_0x10441e['query'][_0x0c4d('0x4a')]){_0x1fdd04[_0x0c4d('0x4b')]=[{'all':!![]}];}return db[_0x0c4d('0x6a')]['findAll'](_0x1fdd04);})[_0x0c4d('0x29')](function(_0x25316b){_0x22031f[_0x0c4d('0x66')]=_0x25316b;return _0x22031f;});}})[_0x0c4d('0x29')](respondWithFilteredResult(_0x2b3ded,_0x1fdd04))['catch'](handleError(_0x2b3ded,null));};exports[_0x0c4d('0x6b')]=function(_0x473cd6,_0x3d5237,_0x424d20){var _0x12f99e={};var _0x4e7e9c={};var _0x34d0f8;var _0x846e80;return db['VoiceQueue']['findOne']({'where':{'id':_0x473cd6[_0x0c4d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d5237,null))['then'](function(_0x585fba){if(_0x585fba){_0x34d0f8=_0x585fba;_0x4e7e9c[_0x0c4d('0x3c')]=_['keys'](db[_0x0c4d('0x6c')][_0x0c4d('0x62')]);_0x4e7e9c['query']=_[_0x0c4d('0x39')](_0x473cd6['query']);_0x4e7e9c[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x4e7e9c[_0x0c4d('0x3c')],_0x4e7e9c[_0x0c4d('0x3a')]);_0x12f99e[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x4e7e9c[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x473cd6['query'][_0x0c4d('0x3d')]));_0x12f99e[_0x0c4d('0x3e')]=_0x12f99e['attributes'][_0x0c4d('0x3f')]?_0x12f99e[_0x0c4d('0x3e')]:_0x4e7e9c[_0x0c4d('0x3c')];_0x12f99e['order']=qs[_0x0c4d('0x43')](_0x473cd6['query'][_0x0c4d('0x43')]);_0x12f99e[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_[_0x0c4d('0x46')](_0x473cd6[_0x0c4d('0x3a')],_0x4e7e9c[_0x0c4d('0x45')]));if(_0x473cd6[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x12f99e['where']=_[_0x0c4d('0x47')](_0x12f99e[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0x12f99e['attributes'],function(_0x18b0db){var _0x21e1d7={};_0x21e1d7[_0x18b0db]={'$like':'%'+_0x473cd6[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x21e1d7;})});}_0x12f99e=_['merge']({},_0x12f99e,_0x473cd6['options']);return _0x34d0f8[_0x0c4d('0x6b')](_0x12f99e);}})[_0x0c4d('0x29')](function(_0x1627bd){if(_0x1627bd){_0x846e80=_0x1627bd[_0x0c4d('0x3f')];if(!_0x473cd6[_0x0c4d('0x3a')][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0x12f99e[_0x0c4d('0x24')]=qs['limit'](_0x473cd6[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0x12f99e[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0x473cd6[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}return _0x34d0f8[_0x0c4d('0x6b')](_0x12f99e);}})[_0x0c4d('0x29')](function(_0x3bdff6){if(_0x3bdff6){return _0x3bdff6?{'count':_0x846e80,'rows':_0x3bdff6}:null;}})[_0x0c4d('0x29')](respondWithResult(_0x3d5237,null))['catch'](handleError(_0x3d5237,null));};exports[_0x0c4d('0x6d')]=function(_0x338817,_0x358d1b,_0x4bf812){var _0x3bdc6c=_0x338817[_0x0c4d('0x53')]['teams'];return db[_0x0c4d('0x6c')][_0x0c4d('0x4c')]({'where':{'id':_['map'](_0x3bdc6c,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0c4d('0x6e'),'attributes':['id',_0x0c4d('0x32'),_0x0c4d('0x6f'),_0x0c4d('0x70'),'interface'],'raw':!![]}]})[_0x0c4d('0x29')](function(_0x1957b8){if(_0x1957b8){var _0x48fce4=_[_0x0c4d('0x71')](_0x1957b8,function(_0x5114b5){var _0x3ba070=_0x5114b5[_0x0c4d('0x2a')]({'plain':!![]});_0x3ba070[_0x0c4d('0x6e')][_0x0c4d('0x72')](function(_0x2000f1){_0x2000f1[_0x0c4d('0x73')]=_[_0x0c4d('0x51')](_0x3bdc6c,{'id':_0x3ba070['id']})[_0x0c4d('0x73')];});return _0x3ba070[_0x0c4d('0x6e')];});return db[_0x0c4d('0x38')]['find']({'where':{'id':_0x338817[_0x0c4d('0x4f')]['id']}})['then'](function(_0x57122c){return db[_0x0c4d('0x74')][_0x0c4d('0x75')](function(_0x3ca9de){return _0x57122c[_0x0c4d('0x6d')](_[_0x0c4d('0x48')](_0x3bdc6c,'id'),{'transaction':_0x3ca9de})[_0x0c4d('0x29')](function(){return BPromise[_0x0c4d('0x76')](_0x48fce4,function(_0x5c6913){return db[_0x0c4d('0x77')][_0x0c4d('0x78')]({'where':{'UserId':_0x5c6913['id'],'VoiceQueueId':_0x338817[_0x0c4d('0x4f')]['id']},'defaults':{'penalty':_0x5c6913[_0x0c4d('0x73')]},'transaction':_0x3ca9de});});})[_0x0c4d('0x29')](function(){return BPromise[_0x0c4d('0x76')](_[_0x0c4d('0x2e')](_0x48fce4,{'online':!![]}),function(_0xc27a29){return db[_0x0c4d('0x79')][_0x0c4d('0x7a')]({'membername':_0xc27a29[_0x0c4d('0x32')],'UserId':_0xc27a29['id'],'queue_name':_0x57122c[_0x0c4d('0x32')],'VoiceQueueId':_0x57122c['id'],'interface':_[_0x0c4d('0x7b')](_0xc27a29[_0x0c4d('0x7c')])?util[_0x0c4d('0x7d')](_0x0c4d('0x7e'),_0xc27a29['name']):_0xc27a29[_0x0c4d('0x7c')],'paused':_0xc27a29[_0x0c4d('0x70')]||![],'penalty':_0xc27a29[_0x0c4d('0x73')]},{'transaction':_0x3ca9de});});})[_0x0c4d('0x29')](function(){_0x48fce4[_0x0c4d('0x72')](function(_0x40992e){socket[_0x0c4d('0x7f')](_0x0c4d('0x80'),{'UserId':_0x40992e['id'],'VoiceQueueId':_0x57122c['id']});});});});});}})[_0x0c4d('0x29')](respondWithStatusCode(_0x358d1b,null))[_0x0c4d('0x4d')](handleError(_0x358d1b,null));};exports[_0x0c4d('0x81')]=function(_0x213417,_0x593a20,_0x353c77){return db[_0x0c4d('0x6c')][_0x0c4d('0x4c')]({'where':{'id':_0x213417[_0x0c4d('0x3a')][_0x0c4d('0x82')]},'attributes':['id'],'include':[{'model':db[_0x0c4d('0x83')],'as':_0x0c4d('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x0c4d('0x29')](handleEntityNotFound(_0x593a20,null))[_0x0c4d('0x29')](function(_0x1e57dc){var _0x36ab47=_[_0x0c4d('0x48')](_0x1e57dc,'id');var _0x2ec3ea=[];var _0x418492=[];var _0x428a03=squel[_0x0c4d('0x84')]();_0x428a03[_0x0c4d('0x85')](_0x0c4d('0x86'))['from'](_0x0c4d('0x87'),'tq')[_0x0c4d('0x88')](_0x0c4d('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x0c4d('0x8a'),_0x213417[_0x0c4d('0x4f')]['id']);for(var _0x18b6f5=0x0;_0x18b6f5<_0x1e57dc[_0x0c4d('0x3f')];_0x18b6f5+=0x1){let _0x27cc3f=_0x1e57dc[_0x18b6f5];for(var _0x4785b1=0x0;_0x4785b1<_0x27cc3f[_0x0c4d('0x6e')]['length'];_0x4785b1+=0x1){let _0x54f3cd=_0x27cc3f[_0x0c4d('0x6e')][_0x4785b1];var _0x504edd=_0x428a03[_0x0c4d('0x5a')]();_0x504edd[_0x0c4d('0x44')](_0x0c4d('0x8b'),_0x54f3cd['id']);_0x418492[_0x0c4d('0x8c')](db[_0x0c4d('0x74')][_0x0c4d('0x3a')](_0x504edd[_0x0c4d('0x8d')](),{'type':db[_0x0c4d('0x74')][_0x0c4d('0x8e')]['SELECT']})[_0x0c4d('0x29')](function(_0x41caab){if(_0x41caab[_0x0c4d('0x3f')]===0x1){return _0x54f3cd['id'];}else{var _0x3b180c=_[_0x0c4d('0x8f')](_['map'](_0x41caab,_0x0c4d('0x90')),function(_0x225c17){return _[_0x0c4d('0x91')](_0x36ab47,_0x225c17);});if(_0x3b180c){return _0x54f3cd['id'];}}}));}}return BPromise['all'](_0x418492)[_0x0c4d('0x29')](function(_0x2f4ecc){_0x2ec3ea=_(_0x2ec3ea)[_0x0c4d('0x92')](_0x2f4ecc)['compact']()[_0x0c4d('0x30')]();return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x213417[_0x0c4d('0x4f')]['id']}})['then'](function(_0x27eece){return db[_0x0c4d('0x74')][_0x0c4d('0x75')](function(_0x3f069a){return _0x27eece['removeTeams'](_0x213417[_0x0c4d('0x3a')][_0x0c4d('0x82')],{'transaction':_0x3f069a})['then'](function(){if(!_[_0x0c4d('0x93')](_0x2ec3ea)){return _0x27eece[_0x0c4d('0x94')](_0x2ec3ea,{'transaction':_0x3f069a})[_0x0c4d('0x29')](function(){return db[_0x0c4d('0x79')][_0x0c4d('0x34')]({'where':{'VoiceQueueId':_0x213417[_0x0c4d('0x4f')]['id'],'UserId':_0x2ec3ea},'transaction':_0x3f069a});});}})[_0x0c4d('0x29')](function(){_0x2ec3ea['forEach'](function(_0x19923b){socket[_0x0c4d('0x7f')](_0x0c4d('0x95'),{'UserId':_0x19923b,'VoiceQueueId':_0x27eece['id']});});});});});});})[_0x0c4d('0x29')](respondWithStatusCode(_0x593a20,null))[_0x0c4d('0x4d')](handleError(_0x593a20,null));};exports[_0x0c4d('0x96')]=function(_0x6e33a3,_0x50c9b7,_0x1902c3){var _0x29f079,_0x59f1aa;return db[_0x0c4d('0x38')]['find']({'where':{'id':_0x6e33a3[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x50c9b7,null))[_0x0c4d('0x29')](function(_0x47290f){if(_0x47290f){_0x59f1aa=_0x47290f;return _0x47290f[_0x0c4d('0x96')](_0x6e33a3['body'][_0x0c4d('0x82')],_[_0x0c4d('0x5d')](_0x6e33a3[_0x0c4d('0x53')],[_0x0c4d('0x82'),'id'])||{})[_0x0c4d('0x97')](function(_0xbcfbc3){for(var _0x9925b9=0x0;_0x9925b9<_0x6e33a3['body'][_0x0c4d('0x82')][_0x0c4d('0x3f')];_0x9925b9+=0x1){socket[_0x0c4d('0x7f')](_0x0c4d('0x80'),{'UserId':_0x6e33a3[_0x0c4d('0x53')][_0x0c4d('0x82')][_0x9925b9],'VoiceQueueId':_0x6e33a3[_0x0c4d('0x4f')]['id']});}return _0xbcfbc3;});}})[_0x0c4d('0x29')](function(_0x16e595){_0x29f079=_0x16e595||[];if(_0x59f1aa){return db['User'][_0x0c4d('0x4c')]({'where':{'id':_0x6e33a3[_0x0c4d('0x53')][_0x0c4d('0x82')]},'attributes':['id','name',_0x0c4d('0x6f'),'voicePause',_0x0c4d('0x7c')],'raw':!![]});}})['then'](function(_0x2bfb4d){if(!_['isEmpty'](_0x2bfb4d)){var _0x7079f8=[];for(var _0x3d629f=0x0;_0x3d629f<_0x2bfb4d[_0x0c4d('0x3f')];_0x3d629f++){if(_0x2bfb4d[_0x3d629f]['online']){_0x7079f8['push'](db['UserVoiceQueueRt'][_0x0c4d('0x7a')]({'membername':_0x2bfb4d[_0x3d629f][_0x0c4d('0x32')],'UserId':_0x2bfb4d[_0x3d629f]['id'],'queue_name':_0x59f1aa[_0x0c4d('0x32')],'VoiceQueueId':_0x59f1aa['id'],'interface':_['isNil'](_0x2bfb4d[_0x3d629f]['interface'])?util[_0x0c4d('0x7d')](_0x0c4d('0x7e'),_0x2bfb4d[_0x3d629f][_0x0c4d('0x32')]):_0x2bfb4d[_0x3d629f][_0x0c4d('0x7c')],'paused':_0x2bfb4d[_0x3d629f][_0x0c4d('0x70')]||![],'penalty':_0x6e33a3[_0x0c4d('0x53')]['penalty']||0x0}));}}return BPromise['all'](_0x7079f8);}})[_0x0c4d('0x29')](function(){return _0x29f079;})[_0x0c4d('0x29')](respondWithResult(_0x50c9b7,null))['catch'](handleError(_0x50c9b7,null));};exports[_0x0c4d('0x94')]=function(_0x5b0b51,_0x2f9a34,_0x2bd328){return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x5b0b51[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x2f9a34,null))['then'](function(_0xf986b5){if(_0xf986b5){return _0xf986b5[_0x0c4d('0x94')](_0x5b0b51['query']['ids'])['then'](function(){if(_[_0x0c4d('0x98')](_0x5b0b51[_0x0c4d('0x3a')][_0x0c4d('0x82')])){for(var _0x19202d=0x0;_0x19202d<_0x5b0b51['query'][_0x0c4d('0x82')][_0x0c4d('0x3f')];_0x19202d+=0x1){socket[_0x0c4d('0x7f')](_0x0c4d('0x95'),{'UserId':Number(_0x5b0b51[_0x0c4d('0x3a')][_0x0c4d('0x82')][_0x19202d]),'VoiceQueueId':Number(_0x5b0b51[_0x0c4d('0x4f')]['id'])});}}else{socket[_0x0c4d('0x7f')]('userVoiceQueue:remove',{'UserId':Number(_0x5b0b51[_0x0c4d('0x3a')][_0x0c4d('0x82')]),'VoiceQueueId':Number(_0x5b0b51[_0x0c4d('0x4f')]['id'])});}});}})[_0x0c4d('0x29')](function(_0x4f7234){return db['UserVoiceQueueRt'][_0x0c4d('0x34')]({'where':{'VoiceQueueId':_0x5b0b51['params']['id'],'UserId':_0x5b0b51[_0x0c4d('0x3a')][_0x0c4d('0x82')]}})[_0x0c4d('0x29')](function(){return _0x4f7234;});})[_0x0c4d('0x29')](respondWithStatusCode(_0x2f9a34,null))[_0x0c4d('0x4d')](handleError(_0x2f9a34,null));};exports[_0x0c4d('0x99')]=function(_0x321324,_0x346143,_0x516a78){var _0x534c24={};var _0x408e59={};var _0x5f1937;var _0x7403ff;return db[_0x0c4d('0x38')][_0x0c4d('0x60')]({'where':{'id':_0x321324[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x346143,null))[_0x0c4d('0x29')](function(_0x47c7f8){if(_0x47c7f8){_0x5f1937=_0x47c7f8;_0x408e59[_0x0c4d('0x3c')]=_['keys'](db['User']['rawAttributes']);_0x408e59[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0x321324[_0x0c4d('0x3a')]);_0x408e59['filters']=_['intersection'](_0x408e59[_0x0c4d('0x3c')],_0x408e59['query']);_0x534c24['attributes']=_['intersection'](_0x408e59[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x321324['query'][_0x0c4d('0x3d')]));_0x534c24[_0x0c4d('0x3e')]=_0x534c24[_0x0c4d('0x3e')][_0x0c4d('0x3f')]?_0x534c24[_0x0c4d('0x3e')]:_0x408e59[_0x0c4d('0x3c')];_0x534c24[_0x0c4d('0x42')]=qs['sort'](_0x321324[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x534c24['where']=qs['filters'](_[_0x0c4d('0x46')](_0x321324[_0x0c4d('0x3a')],_0x408e59[_0x0c4d('0x45')]));if(_0x321324[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x534c24[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x534c24['where'],{'$or':_[_0x0c4d('0x48')](_0x534c24['attributes'],function(_0x53ff80){var _0x1ca440={};_0x1ca440[_0x53ff80]={'$like':'%'+_0x321324['query'][_0x0c4d('0x2e')]+'%'};return _0x1ca440;})});}_0x534c24=_['merge']({},_0x534c24,_0x321324[_0x0c4d('0x50')]);return _0x5f1937[_0x0c4d('0x99')](_0x534c24);}})[_0x0c4d('0x29')](function(_0x2eed68){if(_0x2eed68){_0x7403ff=_0x2eed68[_0x0c4d('0x3f')];if(!_0x321324[_0x0c4d('0x3a')]['hasOwnProperty']('nolimit')){_0x534c24[_0x0c4d('0x24')]=qs['limit'](_0x321324[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0x534c24[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0x321324[_0x0c4d('0x3a')]['offset']);}return _0x5f1937[_0x0c4d('0x99')](_0x534c24);}})['then'](function(_0xce6ca4){if(_0xce6ca4){return _0xce6ca4?{'count':_0x7403ff,'rows':_0xce6ca4}:null;}})['then'](respondWithResult(_0x346143,null))[_0x0c4d('0x4d')](handleError(_0x346143,null));};exports[_0x0c4d('0x9a')]=function(_0x1be386,_0x5c67a2,_0x557476){var _0x1ddbe8={};var _0x3c465f={};var _0x41e272;var _0x47f8bd;return db['VoiceQueue']['findOne']({'where':{'id':_0x1be386[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x5c67a2,null))['then'](function(_0x11b7fd){if(_0x11b7fd){_0x41e272=_0x11b7fd;_0x3c465f[_0x0c4d('0x3c')]=_[_0x0c4d('0x39')](db[_0x0c4d('0x79')][_0x0c4d('0x62')]);_0x3c465f[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0x1be386[_0x0c4d('0x3a')]);_0x3c465f[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x3c465f[_0x0c4d('0x3c')],_0x3c465f[_0x0c4d('0x3a')]);_0x1ddbe8[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x3c465f[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x1be386[_0x0c4d('0x3a')]['fields']));_0x1ddbe8[_0x0c4d('0x3e')]=_0x1ddbe8[_0x0c4d('0x3e')][_0x0c4d('0x3f')]?_0x1ddbe8[_0x0c4d('0x3e')]:_0x3c465f[_0x0c4d('0x3c')];_0x1ddbe8[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0x1be386['query'][_0x0c4d('0x43')]);_0x1ddbe8['where']=qs[_0x0c4d('0x45')](_[_0x0c4d('0x46')](_0x1be386[_0x0c4d('0x3a')],_0x3c465f[_0x0c4d('0x45')]));if(_0x1be386[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x1ddbe8[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0x1ddbe8[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0x1ddbe8[_0x0c4d('0x3e')],function(_0x13e7d8){var _0x6b4b04={};_0x6b4b04[_0x13e7d8]={'$like':'%'+_0x1be386['query'][_0x0c4d('0x2e')]+'%'};return _0x6b4b04;})});}_0x1ddbe8=_[_0x0c4d('0x47')]({},_0x1ddbe8,_0x1be386[_0x0c4d('0x50')]);return _0x41e272[_0x0c4d('0x9a')](_0x1ddbe8);}})[_0x0c4d('0x29')](function(_0xd8d0a1){if(_0xd8d0a1){_0x47f8bd=_0xd8d0a1['length'];if(!_0x1be386[_0x0c4d('0x3a')]['hasOwnProperty'](_0x0c4d('0x41'))){_0x1ddbe8[_0x0c4d('0x24')]=qs[_0x0c4d('0x24')](_0x1be386['query']['limit']);_0x1ddbe8[_0x0c4d('0x23')]=qs['offset'](_0x1be386[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}return _0x41e272[_0x0c4d('0x9a')](_0x1ddbe8);}})[_0x0c4d('0x29')](function(_0xac7e15){return _0xac7e15?{'count':_0x47f8bd,'rows':_0xac7e15}:null;})[_0x0c4d('0x29')](respondWithResult(_0x5c67a2,null))[_0x0c4d('0x4d')](handleError(_0x5c67a2,null));};exports[_0x0c4d('0x9b')]=function(_0x510857,_0x303118,_0x1ebfe0){var _0x426477={};var _0x68ef56={};var _0x34e4d4;var _0x3e89c3;return db['VoiceQueue'][_0x0c4d('0x60')]({'where':{'id':_0x510857[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x303118,null))[_0x0c4d('0x29')](function(_0x57c408){if(_0x57c408){_0x34e4d4=_0x57c408;_0x68ef56[_0x0c4d('0x3c')]=_[_0x0c4d('0x39')](db[_0x0c4d('0x9c')][_0x0c4d('0x62')]);_0x68ef56[_0x0c4d('0x3a')]=_['keys'](_0x510857['query']);_0x68ef56['filters']=_['intersection'](_0x68ef56['model'],_0x68ef56[_0x0c4d('0x3a')]);_0x426477['attributes']=_[_0x0c4d('0x3b')](_0x68ef56['model'],qs[_0x0c4d('0x3d')](_0x510857['query'][_0x0c4d('0x3d')]));_0x426477[_0x0c4d('0x3e')]=_0x426477[_0x0c4d('0x3e')]['length']?_0x426477[_0x0c4d('0x3e')]:_0x68ef56[_0x0c4d('0x3c')];_0x426477[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0x510857[_0x0c4d('0x3a')][_0x0c4d('0x43')]);_0x426477[_0x0c4d('0x44')]=qs['filters'](_[_0x0c4d('0x46')](_0x510857['query'],_0x68ef56[_0x0c4d('0x45')]));if(_0x510857[_0x0c4d('0x3a')][_0x0c4d('0x2e')]){_0x426477['where']=_[_0x0c4d('0x47')](_0x426477[_0x0c4d('0x44')],{'$or':_[_0x0c4d('0x48')](_0x426477['attributes'],function(_0x52474c){var _0xcbac85={};_0xcbac85[_0x52474c]={'$like':'%'+_0x510857[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0xcbac85;})});}_0x426477=_['merge']({},_0x426477,_0x510857[_0x0c4d('0x50')]);return _0x34e4d4[_0x0c4d('0x9b')](_0x426477);}})[_0x0c4d('0x29')](function(_0x1752be){if(_0x1752be){_0x3e89c3=_0x1752be[_0x0c4d('0x3f')];if(!_0x510857[_0x0c4d('0x3a')][_0x0c4d('0x40')]('nolimit')){_0x426477['limit']=qs[_0x0c4d('0x24')](_0x510857[_0x0c4d('0x3a')]['limit']);_0x426477['offset']=qs[_0x0c4d('0x23')](_0x510857[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}return _0x34e4d4[_0x0c4d('0x9b')](_0x426477);}})['then'](function(_0x517b60){if(_0x517b60){return _0x517b60?{'count':_0x3e89c3,'rows':_0x517b60}:null;}})[_0x0c4d('0x29')](respondWithResult(_0x303118,null))[_0x0c4d('0x4d')](handleError(_0x303118,null));};exports['addLists']=function(_0x28ce99,_0x5178f4,_0x2f5a57){var _0x3a01a7,_0xf547f9;return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x28ce99[_0x0c4d('0x4f')]['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x5178f4,null))[_0x0c4d('0x29')](function(_0x12e1ec){if(_0x12e1ec){_0xf547f9=_0x12e1ec;return _0x12e1ec[_0x0c4d('0x9d')](_0x28ce99[_0x0c4d('0x53')]['ids'],_[_0x0c4d('0x5d')](_0x28ce99[_0x0c4d('0x53')],['ids','id'])||{});}return null;})[_0x0c4d('0x97')](function(_0x18282f){var _0x2146b7;_0x3a01a7=_0x18282f||[];var _0x4b943f=[];if(_0x18282f){for(var _0x85e1fe=0x0;_0x85e1fe<_0x18282f[_0x0c4d('0x3f')];_0x85e1fe+=0x1){var _0x34483e=_0x18282f[_0x85e1fe][_0x0c4d('0x2a')]({'plain':!![]});_0xf547f9[_0x0c4d('0x9e')]=_0x28ce99[_0x0c4d('0x53')][_0x0c4d('0x9e')]?_0x28ce99[_0x0c4d('0x53')][_0x0c4d('0x9e')]:_0xf547f9['dialCheckDuplicateType'];switch(_0xf547f9['dialCheckDuplicateType']){case'always':_0x2146b7=squel[_0x0c4d('0x9f')]()[_0x0c4d('0xa0')](_0x0c4d('0xa1'))['fromQuery']([_0x0c4d('0xa2'),'scheduledAt',_0x0c4d('0xa3'),'ListId',_0x0c4d('0x63'),'createdAt',_0x0c4d('0x5c')],squel[_0x0c4d('0x84')]()['field'](_0x0c4d('0xa2'),_0x0c4d('0xa2'))['field'](_0x0c4d('0xa4'),_0x0c4d('0xa5'))[_0x0c4d('0x85')]('id',_0x0c4d('0xa3'))[_0x0c4d('0x85')](_0x34483e[_0x0c4d('0xa6')][_0x0c4d('0x8d')](),_0x0c4d('0xa7'))[_0x0c4d('0x85')](_0x28ce99[_0x0c4d('0x4f')]['id'][_0x0c4d('0x8d')](),_0x0c4d('0x63'))[_0x0c4d('0x85')]('NOW()',_0x0c4d('0x5b'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5c'))['from'](_0x0c4d('0xa8'))['where']('deletedAt\x20IS\x20NULL')[_0x0c4d('0x44')]('ListId\x20=\x20?',_0x34483e[_0x0c4d('0xa6')]['toString']())[_0x0c4d('0x44')](_0x0c4d('0xa9'))['where'](_0x0c4d('0xaa'),squel[_0x0c4d('0x84')]()[_0x0c4d('0x85')](_0x0c4d('0xab'))['from'](_0x0c4d('0xac'))['where']('VoiceQueueId\x20=\x20?',_0x28ce99[_0x0c4d('0x4f')]['id'][_0x0c4d('0x8d')]()))[_0x0c4d('0x44')](_0x0c4d('0xaa'),squel[_0x0c4d('0x84')]()[_0x0c4d('0x85')](_0x0c4d('0xad'))[_0x0c4d('0xae')](_0x0c4d('0xa1'))['where'](_0x0c4d('0x8a'),_0x28ce99[_0x0c4d('0x4f')]['id'][_0x0c4d('0x8d')]())))['toString']();break;case _0x0c4d('0xaf'):_0x2146b7=squel['insert']()[_0x0c4d('0xa0')](_0x0c4d('0xa1'))[_0x0c4d('0xb0')]([_0x0c4d('0xa2'),_0x0c4d('0xa5'),_0x0c4d('0xa3'),_0x0c4d('0xa7'),'VoiceQueueId',_0x0c4d('0x5b'),_0x0c4d('0x5c')],squel[_0x0c4d('0x84')]()[_0x0c4d('0x85')](_0x0c4d('0xa2'),'phone')['field']('NOW()',_0x0c4d('0xa5'))['field']('id',_0x0c4d('0xa3'))['field'](_0x34483e[_0x0c4d('0xa6')][_0x0c4d('0x8d')](),_0x0c4d('0xa7'))[_0x0c4d('0x85')](_0x28ce99[_0x0c4d('0x4f')]['id'][_0x0c4d('0x8d')](),_0x0c4d('0x63'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5b'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5c'))[_0x0c4d('0xae')](_0x0c4d('0xa8'))[_0x0c4d('0x44')](_0x0c4d('0xb1'))[_0x0c4d('0x44')](_0x0c4d('0xb2'),_0x34483e['CmListId'][_0x0c4d('0x8d')]())[_0x0c4d('0x44')](_0x0c4d('0xa9'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0c4d('0x84')]()['field']('COALESCE(phone,\x27\x27)')[_0x0c4d('0xae')](_0x0c4d('0xa1'))[_0x0c4d('0x44')]('VoiceQueueId\x20=\x20?',_0x28ce99[_0x0c4d('0x4f')]['id'][_0x0c4d('0x8d')]())))[_0x0c4d('0x8d')]();break;default:_0x2146b7=squel[_0x0c4d('0x9f')]()[_0x0c4d('0xa0')](_0x0c4d('0xa1'))[_0x0c4d('0xb0')](['phone','scheduledAt',_0x0c4d('0xa3'),_0x0c4d('0xa7'),_0x0c4d('0x63'),_0x0c4d('0x5b'),_0x0c4d('0x5c')],squel['select']()[_0x0c4d('0x85')](_0x0c4d('0xa2'),_0x0c4d('0xa2'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0xa5'))[_0x0c4d('0x85')]('id','ContactId')['field'](_0x34483e['CmListId'][_0x0c4d('0x8d')](),_0x0c4d('0xa7'))[_0x0c4d('0x85')](_0x28ce99[_0x0c4d('0x4f')]['id']['toString'](),_0x0c4d('0x63'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),'createdAt')[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5c'))['from'](_0x0c4d('0xa8'))[_0x0c4d('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x0c4d('0xb2'),_0x34483e[_0x0c4d('0xa6')][_0x0c4d('0x8d')]())[_0x0c4d('0x44')](_0x0c4d('0xa9')))[_0x0c4d('0x8d')]();}_0x4b943f[_0x0c4d('0x8c')](db['sequelize'][_0x0c4d('0x3a')](_0x2146b7));}return BPromise[_0x0c4d('0xb3')](_0x4b943f);}})[_0x0c4d('0x29')](function(){return _0x3a01a7;})['then'](respondWithResult(_0x5178f4,null))[_0x0c4d('0x4d')](handleError(_0x5178f4,null));};exports[_0x0c4d('0xb4')]=function(_0x443b11,_0x5a56f6,_0x30919d){return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x443b11['params']['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x5a56f6,null))[_0x0c4d('0x29')](function(_0x4561ac){if(_0x4561ac){return _0x4561ac[_0x0c4d('0xb4')](_0x443b11[_0x0c4d('0x3a')][_0x0c4d('0x82')]);}})[_0x0c4d('0x29')](function(_0xd54549){if(_0xd54549){return db[_0x0c4d('0x61')]['destroy']({'where':{'ListId':_0x443b11[_0x0c4d('0x3a')][_0x0c4d('0x82')],'VoiceQueueId':_0x443b11[_0x0c4d('0x4f')]['id']}})['then'](function(){return _0xd54549;});}})[_0x0c4d('0x29')](respondWithStatusCode(_0x5a56f6,null))[_0x0c4d('0x4d')](handleError(_0x5a56f6,null));};exports[_0x0c4d('0xb5')]=function(_0x12c6dc,_0x4425b5,_0x4062e0){var _0xd591c0={};var _0x590dde={};var _0x17f2b7;var _0x93c601;return db[_0x0c4d('0x38')][_0x0c4d('0x60')]({'where':{'id':_0x12c6dc['params']['id']}})[_0x0c4d('0x29')](handleEntityNotFound(_0x4425b5,null))['then'](function(_0x2b3458){if(_0x2b3458){_0x17f2b7=_0x2b3458;_0x590dde[_0x0c4d('0x3c')]=_[_0x0c4d('0x39')](db[_0x0c4d('0x9c')][_0x0c4d('0x62')]);_0x590dde[_0x0c4d('0x3a')]=_[_0x0c4d('0x39')](_0x12c6dc[_0x0c4d('0x3a')]);_0x590dde[_0x0c4d('0x45')]=_[_0x0c4d('0x3b')](_0x590dde['model'],_0x590dde[_0x0c4d('0x3a')]);_0xd591c0[_0x0c4d('0x3e')]=_[_0x0c4d('0x3b')](_0x590dde[_0x0c4d('0x3c')],qs[_0x0c4d('0x3d')](_0x12c6dc[_0x0c4d('0x3a')][_0x0c4d('0x3d')]));_0xd591c0[_0x0c4d('0x3e')]=_0xd591c0['attributes'][_0x0c4d('0x3f')]?_0xd591c0[_0x0c4d('0x3e')]:_0x590dde[_0x0c4d('0x3c')];_0xd591c0[_0x0c4d('0x42')]=qs[_0x0c4d('0x43')](_0x12c6dc[_0x0c4d('0x3a')]['sort']);_0xd591c0[_0x0c4d('0x44')]=qs[_0x0c4d('0x45')](_['pick'](_0x12c6dc[_0x0c4d('0x3a')],_0x590dde[_0x0c4d('0x45')]));if(_0x12c6dc['query'][_0x0c4d('0x2e')]){_0xd591c0[_0x0c4d('0x44')]=_[_0x0c4d('0x47')](_0xd591c0['where'],{'$or':_[_0x0c4d('0x48')](_0xd591c0['attributes'],function(_0x4e3605){var _0x5e189f={};_0x5e189f[_0x4e3605]={'$like':'%'+_0x12c6dc[_0x0c4d('0x3a')][_0x0c4d('0x2e')]+'%'};return _0x5e189f;})});}_0xd591c0=_[_0x0c4d('0x47')]({},_0xd591c0,_0x12c6dc[_0x0c4d('0x50')]);return _0x17f2b7['getBlackLists'](_0xd591c0);}})['then'](function(_0x40a8fa){if(_0x40a8fa){_0x93c601=_0x40a8fa['length'];if(!_0x12c6dc[_0x0c4d('0x3a')][_0x0c4d('0x40')](_0x0c4d('0x41'))){_0xd591c0[_0x0c4d('0x24')]=qs[_0x0c4d('0x24')](_0x12c6dc[_0x0c4d('0x3a')][_0x0c4d('0x24')]);_0xd591c0[_0x0c4d('0x23')]=qs[_0x0c4d('0x23')](_0x12c6dc[_0x0c4d('0x3a')][_0x0c4d('0x23')]);}return _0x17f2b7[_0x0c4d('0xb5')](_0xd591c0);}})[_0x0c4d('0x29')](function(_0x50d08c){if(_0x50d08c){return _0x50d08c?{'count':_0x93c601,'rows':_0x50d08c}:null;}})[_0x0c4d('0x29')](respondWithResult(_0x4425b5,null))[_0x0c4d('0x4d')](handleError(_0x4425b5,null));};exports[_0x0c4d('0xb6')]=function(_0x58b186,_0x1848ca,_0x564c50){var _0x8c315c,_0x4193fb;return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x58b186['params']['id']}})['then'](handleEntityNotFound(_0x1848ca,null))[_0x0c4d('0x29')](function(_0x2bf8d5){if(_0x2bf8d5){_0x4193fb=_0x2bf8d5;return _0x2bf8d5['addBlackLists'](_0x58b186[_0x0c4d('0x53')][_0x0c4d('0x82')],_[_0x0c4d('0x5d')](_0x58b186['body'],[_0x0c4d('0x82'),'id'])||{});}return null;})[_0x0c4d('0x97')](function(_0x32d233){var _0x32386b;_0x8c315c=_0x32d233||[];var _0x5e92a0=[];if(_0x32d233){for(var _0x946125=0x0;_0x946125<_0x32d233[_0x0c4d('0x3f')];_0x946125+=0x1){var _0x12b818=_0x32d233[_0x946125]['get']({'plain':!![]});_0x32386b=squel['insert']()[_0x0c4d('0xa0')](_0x0c4d('0xb7'))[_0x0c4d('0xb0')](['phone',_0x0c4d('0xa3'),_0x0c4d('0xa7'),_0x0c4d('0x63'),'createdAt','updatedAt'],squel['select']()[_0x0c4d('0x85')](_0x0c4d('0xa2'),_0x0c4d('0xa2'))[_0x0c4d('0x85')]('id','ContactId')[_0x0c4d('0x85')](_0x12b818[_0x0c4d('0xa6')]['toString'](),'ListId')[_0x0c4d('0x85')](_0x58b186['params']['id'][_0x0c4d('0x8d')](),_0x0c4d('0x63'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5b'))[_0x0c4d('0x85')](_0x0c4d('0xa4'),_0x0c4d('0x5c'))['from']('cm_contacts')[_0x0c4d('0x44')](_0x0c4d('0xb1'))['where'](_0x0c4d('0xb2'),_0x12b818['CmListId'][_0x0c4d('0x8d')]())[_0x0c4d('0x44')](_0x0c4d('0xa9')))[_0x0c4d('0x8d')]();_0x5e92a0['push'](db['sequelize'][_0x0c4d('0x3a')](_0x32386b));}return BPromise['all'](_0x5e92a0);}})[_0x0c4d('0x29')](function(){return _0x8c315c;})[_0x0c4d('0x29')](respondWithResult(_0x1848ca,null))[_0x0c4d('0x4d')](handleError(_0x1848ca,null));};exports[_0x0c4d('0xb8')]=function(_0x379ca4,_0x36811f,_0x4923cc){return db[_0x0c4d('0x38')][_0x0c4d('0x51')]({'where':{'id':_0x379ca4[_0x0c4d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36811f,null))[_0x0c4d('0x29')](function(_0xae847d){if(_0xae847d){return _0xae847d[_0x0c4d('0xb8')](_0x379ca4[_0x0c4d('0x3a')]['ids']);}})[_0x0c4d('0x29')](function(_0x53030e){if(_0x53030e){return db[_0x0c4d('0x6a')][_0x0c4d('0x34')]({'where':{'ListId':_0x379ca4['query'][_0x0c4d('0x82')],'VoiceQueueId':_0x379ca4['params']['id']}})[_0x0c4d('0x29')](function(){return _0x53030e;});}})['then'](respondWithStatusCode(_0x36811f,null))[_0x0c4d('0x4d')](handleError(_0x36811f,null));}; \ No newline at end of file +var _0x6e57=['CmHopperHistory','CmHopperFinal','map','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','upsert','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','spread','isEmpty','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','into','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','end','stack','send','index','VoiceQueue','rawAttributes','model','keys','query','filters','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','intersection','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','options','omit','createdAt','updatedAt','UserProfileSection','update','findOne','order','VoiceQueueId','CmHopper','findAll'];(function(_0x17f990,_0xbb1e51){var _0x368b4f=function(_0x36619e){while(--_0x36619e){_0x17f990['push'](_0x17f990['shift']());}};_0x368b4f(++_0xbb1e51);}(_0x6e57,0x1c2));var _0x76e5=function(_0x5e7b99,_0x154d54){_0x5e7b99=_0x5e7b99-0x0;var _0x3bca52=_0x6e57[_0x5e7b99];return _0x3bca52;};'use strict';var pdf=require(_0x76e5('0x0'));var emlformat=require(_0x76e5('0x1'));var rimraf=require(_0x76e5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76e5('0x3'));var rp=require('request-promise');var moment=require(_0x76e5('0x4'));var BPromise=require(_0x76e5('0x5'));var Mustache=require(_0x76e5('0x6'));var util=require(_0x76e5('0x7'));var path=require(_0x76e5('0x8'));var sox=require('sox');var csv=require(_0x76e5('0x9'));var ejs=require(_0x76e5('0xa'));var fs=require('fs');var _=require(_0x76e5('0xb'));var squel=require(_0x76e5('0xc'));var crypto=require(_0x76e5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x76e5('0xe'));var toCsv=require(_0x76e5('0x9'));var querystring=require(_0x76e5('0xf'));var Papa=require(_0x76e5('0x10'));var Redis=require(_0x76e5('0x11'));var authService=require(_0x76e5('0x12'));var qs=require(_0x76e5('0x13'));var hardwareService=require(_0x76e5('0x14'));var logger=require(_0x76e5('0x15'))(_0x76e5('0x16'));var utils=require(_0x76e5('0x17'));var config=require(_0x76e5('0x18'));var db=require(_0x76e5('0x19'))['db'];config[_0x76e5('0x1a')]=_[_0x76e5('0x1b')](config[_0x76e5('0x1a')],{'host':_0x76e5('0x1c'),'port':0x18eb});var socket=require(_0x76e5('0x1d'))(new Redis(config[_0x76e5('0x1a')]));require(_0x76e5('0x1e'))['register'](socket);function respondWithStatusCode(_0x337632,_0x2019f9){_0x2019f9=_0x2019f9||0xcc;return function(_0x1a5d1b){if(_0x1a5d1b){return _0x337632[_0x76e5('0x1f')](_0x2019f9);}return _0x337632['status'](_0x2019f9)['end']();};}function respondWithResult(_0x102cd2,_0x156e63){_0x156e63=_0x156e63||0xc8;return function(_0x604b8e){if(_0x604b8e){return _0x102cd2[_0x76e5('0x20')](_0x156e63)[_0x76e5('0x21')](_0x604b8e);}};}function respondWithFilteredResult(_0x1b2474,_0xf96af){return function(_0xb48150){if(_0xb48150){var _0x40a8c0=_0xb48150[_0x76e5('0x22')],_0x5ed1de=_0xf96af['offset'],_0x332de9=_0xf96af[_0x76e5('0x23')]+_0xf96af[_0x76e5('0x24')],_0x6488e7;if(_0x332de9>=_0x40a8c0){_0x332de9=_0x40a8c0;_0x6488e7=0xc8;}else{_0x6488e7=0xce;}_0x1b2474['status'](_0x6488e7);return _0x1b2474[_0x76e5('0x25')](_0x76e5('0x26'),_0x5ed1de+'-'+_0x332de9+'/'+_0x40a8c0)[_0x76e5('0x21')](_0xb48150);}return null;};}function patchUpdates(_0x16cbd0){return function(_0x21fc04){try{jsonpatch[_0x76e5('0x27')](_0x21fc04,_0x16cbd0,!![]);}catch(_0x3d5f8e){return BPromise[_0x76e5('0x28')](_0x3d5f8e);}return _0x21fc04['save']();};}function saveUpdates(_0x997ea0,_0x1b616a){return function(_0x6137dc){if(_0x6137dc){return _0x6137dc['update'](_0x997ea0)[_0x76e5('0x29')](function(_0x2e8a3d){return _0x2e8a3d;});}return null;};}function removeEntity(_0x4ba0dd,_0x103f3b){return function(_0x34a015){if(_0x34a015){return _0x34a015[_0x76e5('0x2a')]()['then'](function(){var _0x361d44=_0x34a015[_0x76e5('0x2b')]({'plain':!![]});var _0x1f39d0=[{'name':_0x76e5('0x2c'),'value':_0x76e5('0x2d'),'ignore':![]},{'name':_0x76e5('0x2e'),'value':_0x76e5('0x2f'),'ignore':![]}];var _0x5a9b5c=_(_0x1f39d0)[_0x76e5('0x30')](_0x76e5('0x31'))['map']('value')[_0x76e5('0x32')]();if(_[_0x76e5('0x33')](_0x5a9b5c,_0x361d44[_0x76e5('0x34')])){return;}var _0x26e672=_[_0x76e5('0x35')](_0x1f39d0,[_0x76e5('0x32'),_0x361d44['type']])[_0x76e5('0x36')];return db[_0x76e5('0x37')][_0x76e5('0x2a')]({'where':{'type':_0x26e672,'resourceId':_0x361d44['id']}})[_0x76e5('0x29')](function(){return _0x34a015;});})['then'](function(){_0x4ba0dd[_0x76e5('0x20')](0xcc)[_0x76e5('0x38')]();});}};}function handleEntityNotFound(_0xc736f7,_0x14724e){return function(_0x4b7847){if(!_0x4b7847){_0xc736f7[_0x76e5('0x1f')](0x194);}return _0x4b7847;};}function handleError(_0x448060,_0x5cd7e6){_0x5cd7e6=_0x5cd7e6||0x1f4;return function(_0x101bb0){logger['error'](_0x101bb0[_0x76e5('0x39')]);if(_0x101bb0[_0x76e5('0x36')]){delete _0x101bb0[_0x76e5('0x36')];}_0x448060[_0x76e5('0x20')](_0x5cd7e6)[_0x76e5('0x3a')](_0x101bb0);};}exports[_0x76e5('0x3b')]=function(_0x3a01f7,_0xcf2e1b){var _0x335922={},_0x226532={},_0x12cadf={'count':0x0,'rows':[]};var _0x118ba2=db[_0x76e5('0x3c')][_0x76e5('0x3d')];_0x226532[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](_0x118ba2);_0x226532[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x3a01f7[_0x76e5('0x40')]);_0x226532[_0x76e5('0x41')]=_['intersection'](_0x226532[_0x76e5('0x3e')],_0x226532[_0x76e5('0x40')]);_0x335922[_0x76e5('0x42')]=_['intersection'](_0x226532[_0x76e5('0x3e')],qs['fields'](_0x3a01f7[_0x76e5('0x40')]['fields']));_0x335922['attributes']=_0x335922[_0x76e5('0x42')]['length']?_0x335922[_0x76e5('0x42')]:_0x226532['model'];if(!_0x3a01f7[_0x76e5('0x40')][_0x76e5('0x43')](_0x76e5('0x44'))){_0x335922['limit']=qs[_0x76e5('0x24')](_0x3a01f7['query'][_0x76e5('0x24')]);_0x335922[_0x76e5('0x23')]=qs[_0x76e5('0x23')](_0x3a01f7['query'][_0x76e5('0x23')]);}_0x335922['order']=qs[_0x76e5('0x45')](_0x3a01f7['query'][_0x76e5('0x45')]);_0x335922[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_[_0x76e5('0x47')](_0x3a01f7['query'],_0x226532[_0x76e5('0x41')]));if(_0x3a01f7[_0x76e5('0x40')][_0x76e5('0x30')]){_0x335922[_0x76e5('0x46')]=_[_0x76e5('0x48')](_0x335922[_0x76e5('0x46')],{'$or':_['map'](_0x118ba2,function(_0x147c08){if(_0x147c08['type'][_0x76e5('0x49')]!==_0x76e5('0x4a')){var _0xb872a0={};_0xb872a0[_0x147c08[_0x76e5('0x4b')]]={'$like':'%'+_0x3a01f7[_0x76e5('0x40')][_0x76e5('0x30')]+'%'};return _0xb872a0;}})});}_0x335922=_[_0x76e5('0x48')]({},_0x335922,_0x3a01f7['options']);var _0x232e35={'where':_0x335922[_0x76e5('0x46')]};return db['VoiceQueue'][_0x76e5('0x22')](_0x232e35)[_0x76e5('0x29')](function(_0x4aa325){_0x12cadf[_0x76e5('0x22')]=_0x4aa325;if(_0x3a01f7[_0x76e5('0x40')][_0x76e5('0x4c')]){_0x335922[_0x76e5('0x4d')]=[{'all':!![]}];}return db[_0x76e5('0x3c')]['findAll'](_0x335922);})[_0x76e5('0x29')](function(_0x25b839){_0x12cadf[_0x76e5('0x4e')]=_0x25b839;return _0x12cadf;})[_0x76e5('0x29')](respondWithFilteredResult(_0xcf2e1b,_0x335922))[_0x76e5('0x4f')](handleError(_0xcf2e1b,null));};exports[_0x76e5('0x50')]=function(_0x28708a,_0x1727e5){var _0xada017={'raw':![],'where':{'id':_0x28708a[_0x76e5('0x51')]['id']}},_0x5748a6={};_0x5748a6['model']=_[_0x76e5('0x3f')](db[_0x76e5('0x3c')][_0x76e5('0x3d')]);_0x5748a6['query']=_['keys'](_0x28708a[_0x76e5('0x40')]);_0x5748a6[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x5748a6['model'],_0x5748a6[_0x76e5('0x40')]);_0xada017[_0x76e5('0x42')]=_['intersection'](_0x5748a6[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x28708a[_0x76e5('0x40')]['fields']));_0xada017[_0x76e5('0x42')]=_0xada017[_0x76e5('0x42')]['length']?_0xada017[_0x76e5('0x42')]:_0x5748a6[_0x76e5('0x3e')];if(_0x28708a[_0x76e5('0x40')][_0x76e5('0x4c')]){_0xada017[_0x76e5('0x4d')]=[{'all':!![]}];}_0xada017=_[_0x76e5('0x48')]({},_0xada017,_0x28708a['options']);return db[_0x76e5('0x3c')][_0x76e5('0x35')](_0xada017)[_0x76e5('0x29')](handleEntityNotFound(_0x1727e5,null))[_0x76e5('0x29')](respondWithResult(_0x1727e5,null))[_0x76e5('0x4f')](handleError(_0x1727e5,null));};exports[_0x76e5('0x54')]=function(_0x4e49c5,_0x6d513a){return db[_0x76e5('0x3c')]['create'](_0x4e49c5[_0x76e5('0x55')],{})[_0x76e5('0x29')](function(_0x48c573){var _0x960f74=_0x4e49c5[_0x76e5('0x56')][_0x76e5('0x2b')]({'plain':!![]});if(!_0x960f74)throw new Error(_0x76e5('0x57'));if(_0x960f74[_0x76e5('0x58')]===_0x76e5('0x56')){var _0x11628c=_0x48c573[_0x76e5('0x2b')]({'plain':!![]});var _0x75ae16=[{'name':'VoiceQueues','value':_0x76e5('0x2d')},{'name':_0x76e5('0x2e'),'value':'outbound'}];var _0x3210aa=_[_0x76e5('0x35')](_0x75ae16,[_0x76e5('0x32'),_0x11628c[_0x76e5('0x34')]])[_0x76e5('0x36')];return db['UserProfileSection'][_0x76e5('0x35')]({'where':{'name':_0x3210aa,'userProfileId':_0x960f74[_0x76e5('0x59')]},'raw':!![]})['then'](function(_0x3ea6c6){if(_0x3ea6c6&&_0x3ea6c6[_0x76e5('0x5a')]===0x0){return db[_0x76e5('0x37')]['create']({'name':_0x11628c[_0x76e5('0x36')],'resourceId':_0x11628c['id'],'type':_0x3ea6c6[_0x76e5('0x36')],'sectionId':_0x3ea6c6['id']},{})[_0x76e5('0x29')](function(){return _0x48c573;});}else{return _0x48c573;}})[_0x76e5('0x4f')](function(_0x30bc3c){logger[_0x76e5('0x5b')](_0x76e5('0x5c'),_0x30bc3c);throw _0x30bc3c;});}return _0x48c573;})[_0x76e5('0x29')](respondWithResult(_0x6d513a,0xc9))[_0x76e5('0x4f')](handleError(_0x6d513a,null));};exports['clone']=function(_0x37aee0,_0x3fee47){var _0x4fc0a1={'raw':![],'where':{'id':_0x37aee0['params']['id']}},_0x893e25={};_0x893e25['model']=_[_0x76e5('0x3f')](db[_0x76e5('0x3c')][_0x76e5('0x3d')]);_0x4fc0a1[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x893e25[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x37aee0[_0x76e5('0x40')][_0x76e5('0x53')]));_0x4fc0a1['attributes']=_0x4fc0a1[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x4fc0a1[_0x76e5('0x42')]:_0x893e25[_0x76e5('0x3e')];if(_0x37aee0[_0x76e5('0x40')][_0x76e5('0x4c')]){_0x4fc0a1[_0x76e5('0x4d')]=[{'all':!![]}];}_0x4fc0a1=_[_0x76e5('0x48')]({},_0x4fc0a1,_0x37aee0[_0x76e5('0x5e')]);return db['VoiceQueue']['find'](_0x4fc0a1)[_0x76e5('0x29')](handleEntityNotFound(_0x3fee47,null))['then'](function(_0x2d066b){if(_0x2d066b){var _0x4f2f36=_0x2d066b[_0x76e5('0x2b')]({'plain':!![]});_0x4f2f36=qs[_0x76e5('0x5f')](_0x4f2f36,['id',_0x76e5('0x60'),'updatedAt']);_0x37aee0[_0x76e5('0x55')]=_[_0x76e5('0x5f')](_0x37aee0[_0x76e5('0x55')],['id','createdAt',_0x76e5('0x61')]);return db[_0x76e5('0x3c')][_0x76e5('0x54')](_[_0x76e5('0x48')](_0x4f2f36,_0x37aee0[_0x76e5('0x55')]),{'include':_0x37aee0[_0x76e5('0x40')][_0x76e5('0x4c')]?[{'all':!![]}]:undefined})[_0x76e5('0x29')](function(_0x5cad6a){var _0x1a29de=_0x37aee0['user'][_0x76e5('0x2b')]({'plain':!![]});if(!_0x1a29de)throw new Error(_0x76e5('0x57'));if(_0x1a29de[_0x76e5('0x58')]===_0x76e5('0x56')){var _0xee621e=_0x5cad6a[_0x76e5('0x2b')]({'plain':!![]});var _0xdf27be=[{'name':'VoiceQueues','value':_0x76e5('0x2d')},{'name':_0x76e5('0x2e'),'value':'outbound'}];var _0x561bcb=_['find'](_0xdf27be,[_0x76e5('0x32'),_0xee621e[_0x76e5('0x34')]])[_0x76e5('0x36')];return db[_0x76e5('0x62')][_0x76e5('0x35')]({'where':{'name':_0x561bcb,'userProfileId':_0x1a29de[_0x76e5('0x59')]},'raw':!![]})[_0x76e5('0x29')](function(_0x19f45f){if(_0x19f45f&&_0x19f45f[_0x76e5('0x5a')]===0x0){return db[_0x76e5('0x37')][_0x76e5('0x54')]({'name':_0xee621e['name'],'resourceId':_0xee621e['id'],'type':_0x19f45f[_0x76e5('0x36')],'sectionId':_0x19f45f['id']},{})[_0x76e5('0x29')](function(){return _0x5cad6a;});}else{return _0x5cad6a;}})[_0x76e5('0x4f')](function(_0x246f29){logger['error'](_0x76e5('0x5c'),_0x246f29);throw _0x246f29;});}return _0x5cad6a;});}})[_0x76e5('0x29')](respondWithResult(_0x3fee47,0xc9))[_0x76e5('0x4f')](handleError(_0x3fee47,null));};exports[_0x76e5('0x63')]=function(_0x1a7b84,_0x37bb86){if(_0x1a7b84['body']['id']){delete _0x1a7b84[_0x76e5('0x55')]['id'];}return db[_0x76e5('0x3c')]['find']({'where':{'id':_0x1a7b84['params']['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x37bb86,null))['then'](saveUpdates(_0x1a7b84['body'],null))[_0x76e5('0x29')](respondWithResult(_0x37bb86,null))[_0x76e5('0x4f')](handleError(_0x37bb86,null));};exports[_0x76e5('0x2a')]=function(_0x3006cc,_0x39b4f6){return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x3006cc[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x39b4f6,null))[_0x76e5('0x29')](removeEntity(_0x39b4f6,null))['catch'](handleError(_0x39b4f6,null));};exports['getHoppers']=function(_0x2d2f37,_0x5030d2,_0x1977b1){var _0x19da63={'raw':![],'where':{}};var _0x5b5285={};var _0x3c02bd={'count':0x0,'rows':[]};return db[_0x76e5('0x3c')][_0x76e5('0x64')]({'where':{'id':_0x2d2f37[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x5030d2,null))[_0x76e5('0x29')](function(_0x3868c5){if(_0x3868c5){_0x5b5285[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](db['CmHopper'][_0x76e5('0x3d')]);_0x5b5285[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x2d2f37[_0x76e5('0x40')]);_0x5b5285['filters']=_[_0x76e5('0x52')](_0x5b5285[_0x76e5('0x3e')],_0x5b5285[_0x76e5('0x40')]);_0x19da63[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x5b5285[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x53')]));_0x19da63[_0x76e5('0x42')]=_0x19da63[_0x76e5('0x42')]['length']?_0x19da63[_0x76e5('0x42')]:_0x5b5285[_0x76e5('0x3e')];if(!_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x43')](_0x76e5('0x44'))){_0x19da63['limit']=qs['limit'](_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x24')]);_0x19da63[_0x76e5('0x23')]=qs[_0x76e5('0x23')](_0x2d2f37['query']['offset']);}_0x19da63[_0x76e5('0x65')]=qs['sort'](_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x45')]);_0x19da63[_0x76e5('0x46')]=qs['filters'](_[_0x76e5('0x47')](_0x2d2f37[_0x76e5('0x40')],_0x5b5285[_0x76e5('0x41')]));_0x19da63[_0x76e5('0x46')][_0x76e5('0x66')]=_0x3868c5['id'];if(_0x2d2f37[_0x76e5('0x40')]['filter']){_0x19da63[_0x76e5('0x46')]=_[_0x76e5('0x48')](_0x19da63[_0x76e5('0x46')],{'$or':_['map'](_0x19da63[_0x76e5('0x42')],function(_0x1b51b4){var _0x39c23c={};_0x39c23c[_0x1b51b4]={'$like':'%'+_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x30')]+'%'};return _0x39c23c;})});}_0x19da63=_['merge']({},_0x19da63,_0x2d2f37[_0x76e5('0x5e')]);return db[_0x76e5('0x67')][_0x76e5('0x22')]({'where':_0x19da63[_0x76e5('0x46')]})['then'](function(_0x4e5512){_0x3c02bd[_0x76e5('0x22')]=_0x4e5512;if(_0x2d2f37[_0x76e5('0x40')][_0x76e5('0x4c')]){_0x19da63[_0x76e5('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x76e5('0x68')](_0x19da63);})[_0x76e5('0x29')](function(_0x9d6f36){_0x3c02bd[_0x76e5('0x4e')]=_0x9d6f36;return _0x3c02bd;});}})[_0x76e5('0x29')](respondWithFilteredResult(_0x5030d2,_0x19da63))['catch'](handleError(_0x5030d2,null));};exports['getHopperHistories']=function(_0x5675f9,_0x5222bd,_0x539ead){var _0x1dc9c5={'raw':!![],'where':{}};var _0x1dfb59={};var _0x1d52b4={'count':0x0,'rows':[]};return db[_0x76e5('0x3c')][_0x76e5('0x64')]({'where':{'id':_0x5675f9[_0x76e5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5222bd,null))[_0x76e5('0x29')](function(_0x437d30){if(_0x437d30){_0x1dfb59['model']=_[_0x76e5('0x3f')](db['CmHopperHistory'][_0x76e5('0x3d')]);_0x1dfb59[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x5675f9['query']);_0x1dfb59[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x1dfb59[_0x76e5('0x3e')],_0x1dfb59['query']);_0x1dc9c5[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x1dfb59[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x5675f9[_0x76e5('0x40')]['fields']));_0x1dc9c5[_0x76e5('0x42')]=_0x1dc9c5[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x1dc9c5[_0x76e5('0x42')]:_0x1dfb59[_0x76e5('0x3e')];if(!_0x5675f9['query']['hasOwnProperty'](_0x76e5('0x44'))){_0x1dc9c5[_0x76e5('0x24')]=qs['limit'](_0x5675f9['query'][_0x76e5('0x24')]);_0x1dc9c5['offset']=qs[_0x76e5('0x23')](_0x5675f9['query']['offset']);}_0x1dc9c5['order']=qs[_0x76e5('0x45')](_0x5675f9[_0x76e5('0x40')][_0x76e5('0x45')]);_0x1dc9c5[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_[_0x76e5('0x47')](_0x5675f9[_0x76e5('0x40')],_0x1dfb59[_0x76e5('0x41')]));_0x1dc9c5[_0x76e5('0x46')]['VoiceQueueId']=_0x437d30['id'];if(_0x5675f9[_0x76e5('0x40')][_0x76e5('0x30')]){_0x1dc9c5[_0x76e5('0x46')]=_[_0x76e5('0x48')](_0x1dc9c5['where'],{'$or':_['map'](_0x1dc9c5[_0x76e5('0x42')],function(_0x561be6){var _0xa9eb4={};_0xa9eb4[_0x561be6]={'$like':'%'+_0x5675f9[_0x76e5('0x40')]['filter']+'%'};return _0xa9eb4;})});}_0x1dc9c5=_[_0x76e5('0x48')]({},_0x1dc9c5,_0x5675f9[_0x76e5('0x5e')]);return db['CmHopperHistory'][_0x76e5('0x22')]({'where':_0x1dc9c5[_0x76e5('0x46')]})[_0x76e5('0x29')](function(_0xbd50bd){_0x1d52b4['count']=_0xbd50bd;if(_0x5675f9['query'][_0x76e5('0x4c')]){_0x1dc9c5['include']=[{'all':!![]}];}return db[_0x76e5('0x69')]['findAll'](_0x1dc9c5);})[_0x76e5('0x29')](function(_0x3dc667){_0x1d52b4[_0x76e5('0x4e')]=_0x3dc667;return _0x1d52b4;});}})[_0x76e5('0x29')](respondWithFilteredResult(_0x5222bd,_0x1dc9c5))[_0x76e5('0x4f')](handleError(_0x5222bd,null));};exports['getHopperFinals']=function(_0x359b3f,_0x5d66fb,_0x2b185a){var _0x2a2026={'raw':!![],'where':{}};var _0x5a1e18={};var _0x19393e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x76e5('0x64')]({'where':{'id':_0x359b3f['params']['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x5d66fb,null))[_0x76e5('0x29')](function(_0x343c95){if(_0x343c95){_0x5a1e18[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](db[_0x76e5('0x6a')]['rawAttributes']);_0x5a1e18['query']=_['keys'](_0x359b3f[_0x76e5('0x40')]);_0x5a1e18[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x5a1e18[_0x76e5('0x3e')],_0x5a1e18['query']);_0x2a2026[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x5a1e18[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x359b3f[_0x76e5('0x40')][_0x76e5('0x53')]));_0x2a2026[_0x76e5('0x42')]=_0x2a2026[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x2a2026[_0x76e5('0x42')]:_0x5a1e18['model'];if(!_0x359b3f[_0x76e5('0x40')][_0x76e5('0x43')]('nolimit')){_0x2a2026[_0x76e5('0x24')]=qs['limit'](_0x359b3f[_0x76e5('0x40')][_0x76e5('0x24')]);_0x2a2026[_0x76e5('0x23')]=qs[_0x76e5('0x23')](_0x359b3f[_0x76e5('0x40')][_0x76e5('0x23')]);}_0x2a2026['order']=qs[_0x76e5('0x45')](_0x359b3f['query'][_0x76e5('0x45')]);_0x2a2026['where']=qs[_0x76e5('0x41')](_['pick'](_0x359b3f[_0x76e5('0x40')],_0x5a1e18[_0x76e5('0x41')]));_0x2a2026[_0x76e5('0x46')][_0x76e5('0x66')]=_0x343c95['id'];if(_0x359b3f[_0x76e5('0x40')][_0x76e5('0x30')]){_0x2a2026[_0x76e5('0x46')]=_['merge'](_0x2a2026[_0x76e5('0x46')],{'$or':_[_0x76e5('0x6b')](_0x2a2026[_0x76e5('0x42')],function(_0x3b60e7){var _0x1f89f4={};_0x1f89f4[_0x3b60e7]={'$like':'%'+_0x359b3f[_0x76e5('0x40')][_0x76e5('0x30')]+'%'};return _0x1f89f4;})});}_0x2a2026=_[_0x76e5('0x48')]({},_0x2a2026,_0x359b3f[_0x76e5('0x5e')]);return db['CmHopperFinal'][_0x76e5('0x22')]({'where':_0x2a2026[_0x76e5('0x46')]})[_0x76e5('0x29')](function(_0x5ebb1d){_0x19393e['count']=_0x5ebb1d;if(_0x359b3f[_0x76e5('0x40')][_0x76e5('0x4c')]){_0x2a2026[_0x76e5('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x76e5('0x68')](_0x2a2026);})[_0x76e5('0x29')](function(_0x383727){_0x19393e[_0x76e5('0x4e')]=_0x383727;return _0x19393e;});}})[_0x76e5('0x29')](respondWithFilteredResult(_0x5d66fb,_0x2a2026))[_0x76e5('0x4f')](handleError(_0x5d66fb,null));};exports[_0x76e5('0x6c')]=function(_0x5bb396,_0x5ae71d,_0x2f24a1){var _0x1e2f94={'raw':!![],'where':{}};var _0x145330={};var _0x40d8fe={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x76e5('0x64')]({'where':{'id':_0x5bb396[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x5ae71d,null))[_0x76e5('0x29')](function(_0x12d87e){if(_0x12d87e){_0x145330[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](db['CmHopperBlack'][_0x76e5('0x3d')]);_0x145330[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x5bb396[_0x76e5('0x40')]);_0x145330[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x145330[_0x76e5('0x3e')],_0x145330['query']);_0x1e2f94[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x145330[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x5bb396[_0x76e5('0x40')][_0x76e5('0x53')]));_0x1e2f94[_0x76e5('0x42')]=_0x1e2f94[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x1e2f94[_0x76e5('0x42')]:_0x145330[_0x76e5('0x3e')];if(!_0x5bb396[_0x76e5('0x40')][_0x76e5('0x43')](_0x76e5('0x44'))){_0x1e2f94[_0x76e5('0x24')]=qs[_0x76e5('0x24')](_0x5bb396[_0x76e5('0x40')][_0x76e5('0x24')]);_0x1e2f94['offset']=qs[_0x76e5('0x23')](_0x5bb396[_0x76e5('0x40')]['offset']);}_0x1e2f94[_0x76e5('0x65')]=qs[_0x76e5('0x45')](_0x5bb396[_0x76e5('0x40')][_0x76e5('0x45')]);_0x1e2f94[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_[_0x76e5('0x47')](_0x5bb396[_0x76e5('0x40')],_0x145330[_0x76e5('0x41')]));_0x1e2f94[_0x76e5('0x46')]['VoiceQueueId']=_0x12d87e['id'];if(_0x5bb396[_0x76e5('0x40')][_0x76e5('0x30')]){_0x1e2f94[_0x76e5('0x46')]=_['merge'](_0x1e2f94[_0x76e5('0x46')],{'$or':_[_0x76e5('0x6b')](_0x1e2f94[_0x76e5('0x42')],function(_0x3fede8){var _0x3074dc={};_0x3074dc[_0x3fede8]={'$like':'%'+_0x5bb396['query'][_0x76e5('0x30')]+'%'};return _0x3074dc;})});}_0x1e2f94=_[_0x76e5('0x48')]({},_0x1e2f94,_0x5bb396[_0x76e5('0x5e')]);return db[_0x76e5('0x6d')][_0x76e5('0x22')]({'where':_0x1e2f94[_0x76e5('0x46')]})['then'](function(_0x1a606a){_0x40d8fe['count']=_0x1a606a;if(_0x5bb396['query']['includeAll']){_0x1e2f94[_0x76e5('0x4d')]=[{'all':!![]}];}return db[_0x76e5('0x6d')][_0x76e5('0x68')](_0x1e2f94);})[_0x76e5('0x29')](function(_0xfb5ac0){_0x40d8fe[_0x76e5('0x4e')]=_0xfb5ac0;return _0x40d8fe;});}})[_0x76e5('0x29')](respondWithFilteredResult(_0x5ae71d,_0x1e2f94))['catch'](handleError(_0x5ae71d,null));};exports[_0x76e5('0x6e')]=function(_0xfc34ee,_0x2ac247,_0x44dad3){var _0x4efb36={};var _0x5392d7={};var _0x4eb9e6;var _0x594baf;return db['VoiceQueue'][_0x76e5('0x64')]({'where':{'id':_0xfc34ee[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x2ac247,null))[_0x76e5('0x29')](function(_0x1e5dda){if(_0x1e5dda){_0x4eb9e6=_0x1e5dda;_0x5392d7['model']=_['keys'](db[_0x76e5('0x6f')][_0x76e5('0x3d')]);_0x5392d7[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0xfc34ee[_0x76e5('0x40')]);_0x5392d7[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x5392d7[_0x76e5('0x3e')],_0x5392d7[_0x76e5('0x40')]);_0x4efb36[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x5392d7['model'],qs['fields'](_0xfc34ee[_0x76e5('0x40')][_0x76e5('0x53')]));_0x4efb36[_0x76e5('0x42')]=_0x4efb36['attributes'][_0x76e5('0x5d')]?_0x4efb36[_0x76e5('0x42')]:_0x5392d7[_0x76e5('0x3e')];_0x4efb36['order']=qs[_0x76e5('0x45')](_0xfc34ee[_0x76e5('0x40')][_0x76e5('0x45')]);_0x4efb36[_0x76e5('0x46')]=qs['filters'](_[_0x76e5('0x47')](_0xfc34ee['query'],_0x5392d7['filters']));if(_0xfc34ee[_0x76e5('0x40')]['filter']){_0x4efb36['where']=_[_0x76e5('0x48')](_0x4efb36['where'],{'$or':_[_0x76e5('0x6b')](_0x4efb36['attributes'],function(_0x1e48c8){var _0x14c3d5={};_0x14c3d5[_0x1e48c8]={'$like':'%'+_0xfc34ee['query'][_0x76e5('0x30')]+'%'};return _0x14c3d5;})});}_0x4efb36=_[_0x76e5('0x48')]({},_0x4efb36,_0xfc34ee[_0x76e5('0x5e')]);return _0x4eb9e6[_0x76e5('0x6e')](_0x4efb36);}})['then'](function(_0xca096f){if(_0xca096f){_0x594baf=_0xca096f[_0x76e5('0x5d')];if(!_0xfc34ee['query'][_0x76e5('0x43')](_0x76e5('0x44'))){_0x4efb36[_0x76e5('0x24')]=qs[_0x76e5('0x24')](_0xfc34ee[_0x76e5('0x40')][_0x76e5('0x24')]);_0x4efb36['offset']=qs[_0x76e5('0x23')](_0xfc34ee[_0x76e5('0x40')][_0x76e5('0x23')]);}return _0x4eb9e6[_0x76e5('0x6e')](_0x4efb36);}})[_0x76e5('0x29')](function(_0x2e46ca){if(_0x2e46ca){return _0x2e46ca?{'count':_0x594baf,'rows':_0x2e46ca}:null;}})[_0x76e5('0x29')](respondWithResult(_0x2ac247,null))['catch'](handleError(_0x2ac247,null));};exports[_0x76e5('0x70')]=function(_0x9a1c37,_0x5b1380,_0xb51763){var _0x3fd81e=_0x9a1c37[_0x76e5('0x55')]['teams'];return db[_0x76e5('0x6f')][_0x76e5('0x68')]({'where':{'id':_['map'](_0x3fd81e,'id')},'attributes':['id'],'include':[{'model':db[_0x76e5('0x71')],'as':_0x76e5('0x72'),'attributes':['id','name',_0x76e5('0x73'),_0x76e5('0x74'),_0x76e5('0x75')],'raw':!![]}]})[_0x76e5('0x29')](function(_0x512c49){if(_0x512c49){var _0x27cc5c=_['flatMap'](_0x512c49,function(_0x5b5034){var _0x2de6fc=_0x5b5034[_0x76e5('0x2b')]({'plain':!![]});_0x2de6fc[_0x76e5('0x72')][_0x76e5('0x76')](function(_0x507f4c){_0x507f4c['penalty']=_[_0x76e5('0x35')](_0x3fd81e,{'id':_0x2de6fc['id']})[_0x76e5('0x77')];});return _0x2de6fc[_0x76e5('0x72')];});return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x9a1c37[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](function(_0x3b3907){return db[_0x76e5('0x78')][_0x76e5('0x79')](function(_0x24a9ce){return _0x3b3907['addTeams'](_[_0x76e5('0x6b')](_0x3fd81e,'id'),{'transaction':_0x24a9ce})[_0x76e5('0x29')](function(){return BPromise[_0x76e5('0x7a')](_0x27cc5c,function(_0x584264){return db[_0x76e5('0x7b')][_0x76e5('0x7c')]({'where':{'UserId':_0x584264['id'],'VoiceQueueId':_0x9a1c37[_0x76e5('0x51')]['id']},'defaults':{'penalty':_0x584264[_0x76e5('0x77')]},'transaction':_0x24a9ce});});})['then'](function(){return BPromise[_0x76e5('0x7a')](_[_0x76e5('0x30')](_0x27cc5c,{'online':!![]}),function(_0x398f92){return db['UserVoiceQueueRt'][_0x76e5('0x7d')]({'membername':_0x398f92['name'],'UserId':_0x398f92['id'],'queue_name':_0x3b3907['name'],'VoiceQueueId':_0x3b3907['id'],'interface':_[_0x76e5('0x7e')](_0x398f92[_0x76e5('0x75')])?util[_0x76e5('0x7f')](_0x76e5('0x80'),_0x398f92['name']):_0x398f92[_0x76e5('0x75')],'paused':_0x398f92[_0x76e5('0x74')]||![],'penalty':_0x398f92['penalty']},{'transaction':_0x24a9ce});});})['then'](function(){_0x27cc5c[_0x76e5('0x76')](function(_0xe6abdf){socket['emit'](_0x76e5('0x81'),{'UserId':_0xe6abdf['id'],'VoiceQueueId':_0x3b3907['id']});});});});});}})[_0x76e5('0x29')](respondWithStatusCode(_0x5b1380,null))[_0x76e5('0x4f')](handleError(_0x5b1380,null));};exports[_0x76e5('0x82')]=function(_0x2986b2,_0x5dd3ac,_0x37d379){return db['Team'][_0x76e5('0x68')]({'where':{'id':_0x2986b2['query'][_0x76e5('0x83')]},'attributes':['id'],'include':[{'model':db[_0x76e5('0x71')],'as':_0x76e5('0x72'),'attributes':['id'],'raw':!![]}]})[_0x76e5('0x29')](handleEntityNotFound(_0x5dd3ac,null))[_0x76e5('0x29')](function(_0x21075e){var _0x434678=_[_0x76e5('0x6b')](_0x21075e,'id');var _0x14e624=[];var _0x4de084=[];var _0x3f0106=squel[_0x76e5('0x84')]();_0x3f0106['field'](_0x76e5('0x85'))[_0x76e5('0x86')]('team_has_voice_queues','tq')[_0x76e5('0x87')](_0x76e5('0x88'),'ut',_0x76e5('0x89'))[_0x76e5('0x46')]('VoiceQueueId\x20=\x20?',_0x2986b2[_0x76e5('0x51')]['id']);for(var _0x40619d=0x0;_0x40619d<_0x21075e[_0x76e5('0x5d')];_0x40619d+=0x1){let _0x36cee9=_0x21075e[_0x40619d];for(var _0x5a7039=0x0;_0x5a7039<_0x36cee9['Agents'][_0x76e5('0x5d')];_0x5a7039+=0x1){let _0x4890ac=_0x36cee9[_0x76e5('0x72')][_0x5a7039];var _0x475e6c=_0x3f0106[_0x76e5('0x8a')]();_0x475e6c[_0x76e5('0x46')](_0x76e5('0x8b'),_0x4890ac['id']);_0x4de084[_0x76e5('0x8c')](db['sequelize']['query'](_0x475e6c[_0x76e5('0x8d')](),{'type':db[_0x76e5('0x78')][_0x76e5('0x8e')][_0x76e5('0x8f')]})[_0x76e5('0x29')](function(_0x4fe1f1){if(_0x4fe1f1[_0x76e5('0x5d')]===0x1){return _0x4890ac['id'];}else{var _0x19b804=_[_0x76e5('0x90')](_[_0x76e5('0x6b')](_0x4fe1f1,'TeamId'),function(_0xa1c7a4){return _['includes'](_0x434678,_0xa1c7a4);});if(_0x19b804){return _0x4890ac['id'];}}}));}}return BPromise[_0x76e5('0x91')](_0x4de084)['then'](function(_0x3b0b29){_0x14e624=_(_0x14e624)[_0x76e5('0x92')](_0x3b0b29)[_0x76e5('0x93')]()['value']();return db[_0x76e5('0x3c')]['find']({'where':{'id':_0x2986b2[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](function(_0x1cab85){return db[_0x76e5('0x78')][_0x76e5('0x79')](function(_0x2d0118){return _0x1cab85[_0x76e5('0x82')](_0x2986b2[_0x76e5('0x40')][_0x76e5('0x83')],{'transaction':_0x2d0118})['then'](function(){if(!_['isEmpty'](_0x14e624)){return _0x1cab85[_0x76e5('0x94')](_0x14e624,{'transaction':_0x2d0118})['then'](function(){return db[_0x76e5('0x95')][_0x76e5('0x2a')]({'where':{'VoiceQueueId':_0x2986b2['params']['id'],'UserId':_0x14e624},'transaction':_0x2d0118});});}})[_0x76e5('0x29')](function(){_0x14e624[_0x76e5('0x76')](function(_0x27fca7){socket[_0x76e5('0x96')](_0x76e5('0x97'),{'UserId':_0x27fca7,'VoiceQueueId':_0x1cab85['id']});});});});});});})['then'](respondWithStatusCode(_0x5dd3ac,null))[_0x76e5('0x4f')](handleError(_0x5dd3ac,null));};exports[_0x76e5('0x98')]=function(_0x465018,_0x568dba,_0x4f3d49){var _0x318a03,_0x8112ee;return db[_0x76e5('0x3c')]['find']({'where':{'id':_0x465018[_0x76e5('0x51')]['id']}})['then'](handleEntityNotFound(_0x568dba,null))[_0x76e5('0x29')](function(_0x55c392){if(_0x55c392){_0x8112ee=_0x55c392;return _0x55c392[_0x76e5('0x98')](_0x465018[_0x76e5('0x55')]['ids'],_[_0x76e5('0x5f')](_0x465018[_0x76e5('0x55')],[_0x76e5('0x83'),'id'])||{})[_0x76e5('0x99')](function(_0x422dc4){for(var _0x3ffba3=0x0;_0x3ffba3<_0x465018[_0x76e5('0x55')]['ids']['length'];_0x3ffba3+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x465018['body'][_0x76e5('0x83')][_0x3ffba3],'VoiceQueueId':_0x465018[_0x76e5('0x51')]['id']});}return _0x422dc4;});}})[_0x76e5('0x29')](function(_0x5cd7c6){_0x318a03=_0x5cd7c6||[];if(_0x8112ee){return db['User'][_0x76e5('0x68')]({'where':{'id':_0x465018[_0x76e5('0x55')][_0x76e5('0x83')]},'attributes':['id',_0x76e5('0x36'),_0x76e5('0x73'),_0x76e5('0x74'),'interface'],'raw':!![]});}})[_0x76e5('0x29')](function(_0x1e42b6){if(!_[_0x76e5('0x9a')](_0x1e42b6)){var _0x2445c4=[];for(var _0x4c8f01=0x0;_0x4c8f01<_0x1e42b6[_0x76e5('0x5d')];_0x4c8f01++){if(_0x1e42b6[_0x4c8f01][_0x76e5('0x73')]){_0x2445c4['push'](db[_0x76e5('0x95')][_0x76e5('0x7d')]({'membername':_0x1e42b6[_0x4c8f01]['name'],'UserId':_0x1e42b6[_0x4c8f01]['id'],'queue_name':_0x8112ee[_0x76e5('0x36')],'VoiceQueueId':_0x8112ee['id'],'interface':_[_0x76e5('0x7e')](_0x1e42b6[_0x4c8f01][_0x76e5('0x75')])?util[_0x76e5('0x7f')]('SIP/%s',_0x1e42b6[_0x4c8f01][_0x76e5('0x36')]):_0x1e42b6[_0x4c8f01][_0x76e5('0x75')],'paused':_0x1e42b6[_0x4c8f01][_0x76e5('0x74')]||![],'penalty':_0x465018[_0x76e5('0x55')]['penalty']||0x0}));}}return BPromise['all'](_0x2445c4);}})[_0x76e5('0x29')](function(){return _0x318a03;})[_0x76e5('0x29')](respondWithResult(_0x568dba,null))[_0x76e5('0x4f')](handleError(_0x568dba,null));};exports[_0x76e5('0x94')]=function(_0x23e6ac,_0x39109e,_0x449eee){return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x23e6ac[_0x76e5('0x51')]['id']}})['then'](handleEntityNotFound(_0x39109e,null))[_0x76e5('0x29')](function(_0xb5d663){if(_0xb5d663){return _0xb5d663[_0x76e5('0x94')](_0x23e6ac['query'][_0x76e5('0x83')])['then'](function(){if(_['isArray'](_0x23e6ac['query'][_0x76e5('0x83')])){for(var _0x451445=0x0;_0x451445<_0x23e6ac[_0x76e5('0x40')][_0x76e5('0x83')]['length'];_0x451445+=0x1){socket[_0x76e5('0x96')](_0x76e5('0x97'),{'UserId':Number(_0x23e6ac['query'][_0x76e5('0x83')][_0x451445]),'VoiceQueueId':Number(_0x23e6ac[_0x76e5('0x51')]['id'])});}}else{socket['emit'](_0x76e5('0x97'),{'UserId':Number(_0x23e6ac['query'][_0x76e5('0x83')]),'VoiceQueueId':Number(_0x23e6ac[_0x76e5('0x51')]['id'])});}});}})[_0x76e5('0x29')](function(_0x185dea){return db[_0x76e5('0x95')][_0x76e5('0x2a')]({'where':{'VoiceQueueId':_0x23e6ac[_0x76e5('0x51')]['id'],'UserId':_0x23e6ac[_0x76e5('0x40')]['ids']}})['then'](function(){return _0x185dea;});})[_0x76e5('0x29')](respondWithStatusCode(_0x39109e,null))['catch'](handleError(_0x39109e,null));};exports[_0x76e5('0x9b')]=function(_0x588f57,_0x5d1bb9,_0x12f892){var _0x3a9308={};var _0x1147b1={};var _0x1c1151;var _0xb59c3b;return db[_0x76e5('0x3c')][_0x76e5('0x64')]({'where':{'id':_0x588f57[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x5d1bb9,null))['then'](function(_0x3c6aa6){if(_0x3c6aa6){_0x1c1151=_0x3c6aa6;_0x1147b1[_0x76e5('0x3e')]=_['keys'](db[_0x76e5('0x71')][_0x76e5('0x3d')]);_0x1147b1[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x588f57[_0x76e5('0x40')]);_0x1147b1[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x1147b1[_0x76e5('0x3e')],_0x1147b1[_0x76e5('0x40')]);_0x3a9308['attributes']=_[_0x76e5('0x52')](_0x1147b1[_0x76e5('0x3e')],qs[_0x76e5('0x53')](_0x588f57['query'][_0x76e5('0x53')]));_0x3a9308[_0x76e5('0x42')]=_0x3a9308['attributes'][_0x76e5('0x5d')]?_0x3a9308[_0x76e5('0x42')]:_0x1147b1['model'];_0x3a9308['order']=qs[_0x76e5('0x45')](_0x588f57['query'][_0x76e5('0x45')]);_0x3a9308[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_['pick'](_0x588f57[_0x76e5('0x40')],_0x1147b1[_0x76e5('0x41')]));if(_0x588f57[_0x76e5('0x40')][_0x76e5('0x30')]){_0x3a9308[_0x76e5('0x46')]=_[_0x76e5('0x48')](_0x3a9308['where'],{'$or':_[_0x76e5('0x6b')](_0x3a9308['attributes'],function(_0x27aabb){var _0x31cf34={};_0x31cf34[_0x27aabb]={'$like':'%'+_0x588f57[_0x76e5('0x40')][_0x76e5('0x30')]+'%'};return _0x31cf34;})});}_0x3a9308=_['merge']({},_0x3a9308,_0x588f57[_0x76e5('0x5e')]);return _0x1c1151['getAgents'](_0x3a9308);}})[_0x76e5('0x29')](function(_0x5103c0){if(_0x5103c0){_0xb59c3b=_0x5103c0[_0x76e5('0x5d')];if(!_0x588f57[_0x76e5('0x40')][_0x76e5('0x43')](_0x76e5('0x44'))){_0x3a9308[_0x76e5('0x24')]=qs['limit'](_0x588f57[_0x76e5('0x40')][_0x76e5('0x24')]);_0x3a9308['offset']=qs[_0x76e5('0x23')](_0x588f57[_0x76e5('0x40')][_0x76e5('0x23')]);}return _0x1c1151['getAgents'](_0x3a9308);}})[_0x76e5('0x29')](function(_0xba2d3){if(_0xba2d3){return _0xba2d3?{'count':_0xb59c3b,'rows':_0xba2d3}:null;}})[_0x76e5('0x29')](respondWithResult(_0x5d1bb9,null))[_0x76e5('0x4f')](handleError(_0x5d1bb9,null));};exports[_0x76e5('0x9c')]=function(_0x49c1c5,_0x191533,_0x489ce3){var _0x443537={};var _0x368d69={};var _0x47a9c1;var _0x16d4e6;return db[_0x76e5('0x3c')][_0x76e5('0x64')]({'where':{'id':_0x49c1c5['params']['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x191533,null))[_0x76e5('0x29')](function(_0x4050b0){if(_0x4050b0){_0x47a9c1=_0x4050b0;_0x368d69[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](db[_0x76e5('0x95')][_0x76e5('0x3d')]);_0x368d69[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x49c1c5[_0x76e5('0x40')]);_0x368d69['filters']=_[_0x76e5('0x52')](_0x368d69['model'],_0x368d69[_0x76e5('0x40')]);_0x443537[_0x76e5('0x42')]=_['intersection'](_0x368d69[_0x76e5('0x3e')],qs['fields'](_0x49c1c5['query']['fields']));_0x443537[_0x76e5('0x42')]=_0x443537[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x443537[_0x76e5('0x42')]:_0x368d69['model'];_0x443537[_0x76e5('0x65')]=qs[_0x76e5('0x45')](_0x49c1c5['query']['sort']);_0x443537[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_[_0x76e5('0x47')](_0x49c1c5[_0x76e5('0x40')],_0x368d69[_0x76e5('0x41')]));if(_0x49c1c5[_0x76e5('0x40')]['filter']){_0x443537['where']=_[_0x76e5('0x48')](_0x443537[_0x76e5('0x46')],{'$or':_[_0x76e5('0x6b')](_0x443537[_0x76e5('0x42')],function(_0x121fc5){var _0x26e767={};_0x26e767[_0x121fc5]={'$like':'%'+_0x49c1c5[_0x76e5('0x40')]['filter']+'%'};return _0x26e767;})});}_0x443537=_[_0x76e5('0x48')]({},_0x443537,_0x49c1c5[_0x76e5('0x5e')]);return _0x47a9c1[_0x76e5('0x9c')](_0x443537);}})[_0x76e5('0x29')](function(_0x5251d2){if(_0x5251d2){_0x16d4e6=_0x5251d2[_0x76e5('0x5d')];if(!_0x49c1c5['query']['hasOwnProperty'](_0x76e5('0x44'))){_0x443537[_0x76e5('0x24')]=qs['limit'](_0x49c1c5[_0x76e5('0x40')]['limit']);_0x443537[_0x76e5('0x23')]=qs[_0x76e5('0x23')](_0x49c1c5[_0x76e5('0x40')][_0x76e5('0x23')]);}return _0x47a9c1[_0x76e5('0x9c')](_0x443537);}})['then'](function(_0x379e25){return _0x379e25?{'count':_0x16d4e6,'rows':_0x379e25}:null;})['then'](respondWithResult(_0x191533,null))[_0x76e5('0x4f')](handleError(_0x191533,null));};exports[_0x76e5('0x9d')]=function(_0x35b211,_0x4f9b81,_0x4accf5){var _0x92dceb={};var _0x3a5223={};var _0x3cb84a;var _0x2285c8;return db[_0x76e5('0x3c')]['findOne']({'where':{'id':_0x35b211[_0x76e5('0x51')]['id']}})['then'](handleEntityNotFound(_0x4f9b81,null))[_0x76e5('0x29')](function(_0x341aef){if(_0x341aef){_0x3cb84a=_0x341aef;_0x3a5223['model']=_[_0x76e5('0x3f')](db[_0x76e5('0x9e')][_0x76e5('0x3d')]);_0x3a5223[_0x76e5('0x40')]=_[_0x76e5('0x3f')](_0x35b211[_0x76e5('0x40')]);_0x3a5223[_0x76e5('0x41')]=_[_0x76e5('0x52')](_0x3a5223[_0x76e5('0x3e')],_0x3a5223[_0x76e5('0x40')]);_0x92dceb[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0x3a5223['model'],qs[_0x76e5('0x53')](_0x35b211[_0x76e5('0x40')]['fields']));_0x92dceb[_0x76e5('0x42')]=_0x92dceb[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x92dceb[_0x76e5('0x42')]:_0x3a5223['model'];_0x92dceb[_0x76e5('0x65')]=qs[_0x76e5('0x45')](_0x35b211[_0x76e5('0x40')][_0x76e5('0x45')]);_0x92dceb[_0x76e5('0x46')]=qs['filters'](_[_0x76e5('0x47')](_0x35b211[_0x76e5('0x40')],_0x3a5223['filters']));if(_0x35b211['query']['filter']){_0x92dceb['where']=_[_0x76e5('0x48')](_0x92dceb[_0x76e5('0x46')],{'$or':_[_0x76e5('0x6b')](_0x92dceb['attributes'],function(_0x380682){var _0x538f7a={};_0x538f7a[_0x380682]={'$like':'%'+_0x35b211['query']['filter']+'%'};return _0x538f7a;})});}_0x92dceb=_[_0x76e5('0x48')]({},_0x92dceb,_0x35b211[_0x76e5('0x5e')]);return _0x3cb84a[_0x76e5('0x9d')](_0x92dceb);}})[_0x76e5('0x29')](function(_0x40b03a){if(_0x40b03a){_0x2285c8=_0x40b03a[_0x76e5('0x5d')];if(!_0x35b211[_0x76e5('0x40')][_0x76e5('0x43')]('nolimit')){_0x92dceb[_0x76e5('0x24')]=qs[_0x76e5('0x24')](_0x35b211['query'][_0x76e5('0x24')]);_0x92dceb['offset']=qs[_0x76e5('0x23')](_0x35b211[_0x76e5('0x40')]['offset']);}return _0x3cb84a[_0x76e5('0x9d')](_0x92dceb);}})[_0x76e5('0x29')](function(_0x46718f){if(_0x46718f){return _0x46718f?{'count':_0x2285c8,'rows':_0x46718f}:null;}})[_0x76e5('0x29')](respondWithResult(_0x4f9b81,null))['catch'](handleError(_0x4f9b81,null));};exports[_0x76e5('0x9f')]=function(_0x58f9a4,_0x530d98,_0x591b8d){var _0x47e4ac,_0x3bd293;return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x58f9a4[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x530d98,null))[_0x76e5('0x29')](function(_0x89ee04){if(_0x89ee04){_0x3bd293=_0x89ee04;return _0x89ee04[_0x76e5('0x9f')](_0x58f9a4['body'][_0x76e5('0x83')],_[_0x76e5('0x5f')](_0x58f9a4[_0x76e5('0x55')],[_0x76e5('0x83'),'id'])||{});}return null;})[_0x76e5('0x99')](function(_0x47b6da){var _0x466dfa;_0x47e4ac=_0x47b6da||[];var _0x53ba58=[];if(_0x47b6da){for(var _0x3c52db=0x0;_0x3c52db<_0x47b6da[_0x76e5('0x5d')];_0x3c52db+=0x1){var _0x10ec7d=_0x47b6da[_0x3c52db]['get']({'plain':!![]});_0x3bd293['dialCheckDuplicateType']=_0x58f9a4[_0x76e5('0x55')]['dialCheckDuplicateType']?_0x58f9a4[_0x76e5('0x55')][_0x76e5('0xa0')]:_0x3bd293[_0x76e5('0xa0')];switch(_0x3bd293[_0x76e5('0xa0')]){case'always':_0x466dfa=squel[_0x76e5('0xa1')]()['into'](_0x76e5('0xa2'))[_0x76e5('0xa3')]([_0x76e5('0xa4'),_0x76e5('0xa5'),_0x76e5('0xa6'),'ListId','VoiceQueueId',_0x76e5('0x60'),_0x76e5('0x61')],squel['select']()['field']('phone','phone')[_0x76e5('0x4b')](_0x76e5('0xa7'),_0x76e5('0xa5'))['field']('id',_0x76e5('0xa6'))[_0x76e5('0x4b')](_0x10ec7d[_0x76e5('0xa8')][_0x76e5('0x8d')](),_0x76e5('0xa9'))[_0x76e5('0x4b')](_0x58f9a4[_0x76e5('0x51')]['id'][_0x76e5('0x8d')](),_0x76e5('0x66'))['field'](_0x76e5('0xa7'),_0x76e5('0x60'))[_0x76e5('0x4b')]('NOW()',_0x76e5('0x61'))['from']('cm_contacts')[_0x76e5('0x46')]('deletedAt\x20IS\x20NULL')[_0x76e5('0x46')]('ListId\x20=\x20?',_0x10ec7d[_0x76e5('0xa8')][_0x76e5('0x8d')]())[_0x76e5('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x76e5('0x46')](_0x76e5('0xaa'),squel['select']()[_0x76e5('0x4b')](_0x76e5('0xab'))[_0x76e5('0x86')](_0x76e5('0xac'))[_0x76e5('0x46')](_0x76e5('0xad'),_0x58f9a4[_0x76e5('0x51')]['id']['toString']()))[_0x76e5('0x46')](_0x76e5('0xaa'),squel[_0x76e5('0x84')]()[_0x76e5('0x4b')](_0x76e5('0xae'))[_0x76e5('0x86')]('cm_hopper')['where'](_0x76e5('0xad'),_0x58f9a4[_0x76e5('0x51')]['id'][_0x76e5('0x8d')]())))[_0x76e5('0x8d')]();break;case _0x76e5('0xaf'):_0x466dfa=squel['insert']()['into'](_0x76e5('0xa2'))['fromQuery']([_0x76e5('0xa4'),_0x76e5('0xa5'),'ContactId',_0x76e5('0xa9'),_0x76e5('0x66'),'createdAt',_0x76e5('0x61')],squel[_0x76e5('0x84')]()[_0x76e5('0x4b')](_0x76e5('0xa4'),_0x76e5('0xa4'))[_0x76e5('0x4b')](_0x76e5('0xa7'),'scheduledAt')[_0x76e5('0x4b')]('id','ContactId')[_0x76e5('0x4b')](_0x10ec7d['CmListId'][_0x76e5('0x8d')](),_0x76e5('0xa9'))['field'](_0x58f9a4[_0x76e5('0x51')]['id']['toString'](),_0x76e5('0x66'))[_0x76e5('0x4b')](_0x76e5('0xa7'),_0x76e5('0x60'))['field'](_0x76e5('0xa7'),_0x76e5('0x61'))[_0x76e5('0x86')](_0x76e5('0xb0'))['where'](_0x76e5('0xb1'))[_0x76e5('0x46')](_0x76e5('0xb2'),_0x10ec7d[_0x76e5('0xa8')]['toString']())[_0x76e5('0x46')](_0x76e5('0xb3'))[_0x76e5('0x46')](_0x76e5('0xaa'),squel[_0x76e5('0x84')]()[_0x76e5('0x4b')](_0x76e5('0xae'))[_0x76e5('0x86')](_0x76e5('0xa2'))[_0x76e5('0x46')](_0x76e5('0xad'),_0x58f9a4['params']['id']['toString']())))['toString']();break;default:_0x466dfa=squel[_0x76e5('0xa1')]()['into'](_0x76e5('0xa2'))[_0x76e5('0xa3')]([_0x76e5('0xa4'),_0x76e5('0xa5'),_0x76e5('0xa6'),'ListId',_0x76e5('0x66'),'createdAt',_0x76e5('0x61')],squel[_0x76e5('0x84')]()[_0x76e5('0x4b')](_0x76e5('0xa4'),'phone')['field'](_0x76e5('0xa7'),_0x76e5('0xa5'))[_0x76e5('0x4b')]('id',_0x76e5('0xa6'))[_0x76e5('0x4b')](_0x10ec7d[_0x76e5('0xa8')][_0x76e5('0x8d')](),_0x76e5('0xa9'))[_0x76e5('0x4b')](_0x58f9a4['params']['id'][_0x76e5('0x8d')](),_0x76e5('0x66'))[_0x76e5('0x4b')](_0x76e5('0xa7'),_0x76e5('0x60'))[_0x76e5('0x4b')](_0x76e5('0xa7'),'updatedAt')[_0x76e5('0x86')](_0x76e5('0xb0'))[_0x76e5('0x46')](_0x76e5('0xb1'))['where'](_0x76e5('0xb2'),_0x10ec7d[_0x76e5('0xa8')][_0x76e5('0x8d')]())[_0x76e5('0x46')](_0x76e5('0xb3')))[_0x76e5('0x8d')]();}_0x53ba58[_0x76e5('0x8c')](db[_0x76e5('0x78')][_0x76e5('0x40')](_0x466dfa));}return BPromise['all'](_0x53ba58);}})['then'](function(){return _0x47e4ac;})[_0x76e5('0x29')](respondWithResult(_0x530d98,null))['catch'](handleError(_0x530d98,null));};exports[_0x76e5('0xb4')]=function(_0x40c148,_0x5f4a05,_0x516e02){return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x40c148[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x5f4a05,null))['then'](function(_0x905092){if(_0x905092){return _0x905092[_0x76e5('0xb4')](_0x40c148[_0x76e5('0x40')][_0x76e5('0x83')]);}})[_0x76e5('0x29')](function(_0x7495eb){if(_0x7495eb){return db[_0x76e5('0x67')][_0x76e5('0x2a')]({'where':{'ListId':_0x40c148[_0x76e5('0x40')][_0x76e5('0x83')],'VoiceQueueId':_0x40c148[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](function(){return _0x7495eb;});}})['then'](respondWithStatusCode(_0x5f4a05,null))[_0x76e5('0x4f')](handleError(_0x5f4a05,null));};exports['getBlackLists']=function(_0x34929a,_0x3fa395,_0x21bece){var _0x248aea={};var _0xa46b02={};var _0x530183;var _0x2e4dea;return db[_0x76e5('0x3c')][_0x76e5('0x64')]({'where':{'id':_0x34929a[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x3fa395,null))[_0x76e5('0x29')](function(_0x4f221e){if(_0x4f221e){_0x530183=_0x4f221e;_0xa46b02[_0x76e5('0x3e')]=_[_0x76e5('0x3f')](db[_0x76e5('0x9e')][_0x76e5('0x3d')]);_0xa46b02['query']=_[_0x76e5('0x3f')](_0x34929a[_0x76e5('0x40')]);_0xa46b02[_0x76e5('0x41')]=_['intersection'](_0xa46b02[_0x76e5('0x3e')],_0xa46b02[_0x76e5('0x40')]);_0x248aea[_0x76e5('0x42')]=_[_0x76e5('0x52')](_0xa46b02[_0x76e5('0x3e')],qs['fields'](_0x34929a[_0x76e5('0x40')][_0x76e5('0x53')]));_0x248aea[_0x76e5('0x42')]=_0x248aea[_0x76e5('0x42')][_0x76e5('0x5d')]?_0x248aea['attributes']:_0xa46b02[_0x76e5('0x3e')];_0x248aea['order']=qs['sort'](_0x34929a[_0x76e5('0x40')][_0x76e5('0x45')]);_0x248aea[_0x76e5('0x46')]=qs[_0x76e5('0x41')](_[_0x76e5('0x47')](_0x34929a['query'],_0xa46b02['filters']));if(_0x34929a[_0x76e5('0x40')][_0x76e5('0x30')]){_0x248aea['where']=_[_0x76e5('0x48')](_0x248aea[_0x76e5('0x46')],{'$or':_['map'](_0x248aea[_0x76e5('0x42')],function(_0x4055c6){var _0x36018f={};_0x36018f[_0x4055c6]={'$like':'%'+_0x34929a['query'][_0x76e5('0x30')]+'%'};return _0x36018f;})});}_0x248aea=_[_0x76e5('0x48')]({},_0x248aea,_0x34929a[_0x76e5('0x5e')]);return _0x530183[_0x76e5('0xb5')](_0x248aea);}})[_0x76e5('0x29')](function(_0xf31f11){if(_0xf31f11){_0x2e4dea=_0xf31f11[_0x76e5('0x5d')];if(!_0x34929a[_0x76e5('0x40')][_0x76e5('0x43')]('nolimit')){_0x248aea[_0x76e5('0x24')]=qs[_0x76e5('0x24')](_0x34929a['query'][_0x76e5('0x24')]);_0x248aea[_0x76e5('0x23')]=qs[_0x76e5('0x23')](_0x34929a[_0x76e5('0x40')][_0x76e5('0x23')]);}return _0x530183[_0x76e5('0xb5')](_0x248aea);}})[_0x76e5('0x29')](function(_0x1c0bef){if(_0x1c0bef){return _0x1c0bef?{'count':_0x2e4dea,'rows':_0x1c0bef}:null;}})[_0x76e5('0x29')](respondWithResult(_0x3fa395,null))[_0x76e5('0x4f')](handleError(_0x3fa395,null));};exports[_0x76e5('0xb6')]=function(_0x3eb128,_0x242a22,_0x2a77e7){var _0x1dce48,_0x13f7e1;return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x3eb128['params']['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x242a22,null))[_0x76e5('0x29')](function(_0x45cda6){if(_0x45cda6){_0x13f7e1=_0x45cda6;return _0x45cda6['addBlackLists'](_0x3eb128[_0x76e5('0x55')]['ids'],_[_0x76e5('0x5f')](_0x3eb128[_0x76e5('0x55')],[_0x76e5('0x83'),'id'])||{});}return null;})['spread'](function(_0x3065c6){var _0x653ec3;_0x1dce48=_0x3065c6||[];var _0x2c26f2=[];if(_0x3065c6){for(var _0x471a03=0x0;_0x471a03<_0x3065c6[_0x76e5('0x5d')];_0x471a03+=0x1){var _0x55444f=_0x3065c6[_0x471a03]['get']({'plain':!![]});_0x653ec3=squel[_0x76e5('0xa1')]()[_0x76e5('0xb7')]('cm_hopper_black')[_0x76e5('0xa3')]([_0x76e5('0xa4'),_0x76e5('0xa6'),_0x76e5('0xa9'),_0x76e5('0x66'),_0x76e5('0x60'),_0x76e5('0x61')],squel[_0x76e5('0x84')]()[_0x76e5('0x4b')](_0x76e5('0xa4'),_0x76e5('0xa4'))[_0x76e5('0x4b')]('id',_0x76e5('0xa6'))['field'](_0x55444f['CmListId'][_0x76e5('0x8d')](),_0x76e5('0xa9'))[_0x76e5('0x4b')](_0x3eb128[_0x76e5('0x51')]['id'][_0x76e5('0x8d')](),_0x76e5('0x66'))[_0x76e5('0x4b')]('NOW()',_0x76e5('0x60'))['field'](_0x76e5('0xa7'),_0x76e5('0x61'))['from'](_0x76e5('0xb0'))['where'](_0x76e5('0xb1'))[_0x76e5('0x46')](_0x76e5('0xb2'),_0x55444f['CmListId']['toString']())[_0x76e5('0x46')]('phone\x20IS\x20NOT\x20NULL'))[_0x76e5('0x8d')]();_0x2c26f2[_0x76e5('0x8c')](db[_0x76e5('0x78')][_0x76e5('0x40')](_0x653ec3));}return BPromise[_0x76e5('0x91')](_0x2c26f2);}})[_0x76e5('0x29')](function(){return _0x1dce48;})[_0x76e5('0x29')](respondWithResult(_0x242a22,null))[_0x76e5('0x4f')](handleError(_0x242a22,null));};exports[_0x76e5('0xb8')]=function(_0x108975,_0x23f1ed,_0xb8eb27){return db[_0x76e5('0x3c')][_0x76e5('0x35')]({'where':{'id':_0x108975[_0x76e5('0x51')]['id']}})[_0x76e5('0x29')](handleEntityNotFound(_0x23f1ed,null))['then'](function(_0x253fdd){if(_0x253fdd){return _0x253fdd[_0x76e5('0xb8')](_0x108975[_0x76e5('0x40')][_0x76e5('0x83')]);}})['then'](function(_0x1eb2f5){if(_0x1eb2f5){return db[_0x76e5('0x6d')]['destroy']({'where':{'ListId':_0x108975['query']['ids'],'VoiceQueueId':_0x108975[_0x76e5('0x51')]['id']}})['then'](function(){return _0x1eb2f5;});}})[_0x76e5('0x29')](respondWithStatusCode(_0x23f1ed,null))[_0x76e5('0x4f')](handleError(_0x23f1ed,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 601bad5..b2a21aa 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 _0x9844=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x4dff81,_0x20a4d1){var _0x2d00a3=function(_0xdc5634){while(--_0xdc5634){_0x4dff81['push'](_0x4dff81['shift']());}};_0x2d00a3(++_0x20a4d1);}(_0x9844,0x9d));var _0x4984=function(_0x3f603b,_0x6c29ba){_0x3f603b=_0x3f603b-0x0;var _0x3f460a=_0x9844[_0x3f603b];return _0x3f460a;};'use strict';var EventEmitter=require(_0x4984('0x0'));var VoiceQueue=require(_0x4984('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4984('0x2')](0x0);var events={'afterCreate':_0x4984('0x3'),'afterUpdate':_0x4984('0x4'),'afterDestroy':_0x4984('0x5')};function emitEvent(_0x4210d1){return function(_0xe4b779,_0x531ffa,_0x5139d3){VoiceQueueEvents[_0x4984('0x6')](_0x4210d1+':'+_0xe4b779['id'],_0xe4b779);VoiceQueueEvents['emit'](_0x4210d1,_0xe4b779);_0x5139d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x4984('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x9acf=['hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x372107,_0x4a7104){var _0x4f0bc0=function(_0x1e194e){while(--_0x1e194e){_0x372107['push'](_0x372107['shift']());}};_0x4f0bc0(++_0x4a7104);}(_0x9acf,0x163));var _0xf9ac=function(_0x5ab637,_0x5b35d6){_0x5ab637=_0x5ab637-0x0;var _0x4727fd=_0x9acf[_0x5ab637];return _0x4727fd;};'use strict';var EventEmitter=require(_0xf9ac('0x0'));var VoiceQueue=require(_0xf9ac('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf9ac('0x2')](0x0);var events={'afterCreate':_0xf9ac('0x3'),'afterUpdate':_0xf9ac('0x4'),'afterDestroy':'remove'};function emitEvent(_0x342b43){return function(_0x250a04,_0x2aa60b,_0x1d8c11){VoiceQueueEvents['emit'](_0x342b43+':'+_0x250a04['id'],_0x250a04);VoiceQueueEvents['emit'](_0x342b43,_0x250a04);_0x1d8c11(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf9ac('0x5')](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 f87b0ce..e45e40d 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 _0x9348=['../../config/environment','./voiceQueue.attributes','exports','define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x296f15,_0x331eb5){var _0xd443d2=function(_0x29dc35){while(--_0x29dc35){_0x296f15['push'](_0x296f15['shift']());}};_0xd443d2(++_0x331eb5);}(_0x9348,0x10d));var _0x8934=function(_0x3696b9,_0xdbd0bf){_0x3696b9=_0x3696b9-0x0;var _0x13ee90=_0x9348[_0x3696b9];return _0x13ee90;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('VoiceQueue',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb5=['define','VoiceQueue','voice_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x0bb5,0x148));var _0x50bb=function(_0x192b6e,_0x1702d4){_0x192b6e=_0x192b6e-0x0;var _0x260be1=_0x0bb5[_0x192b6e];return _0x260be1;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'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 fca15e9..e8cd10e 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x306af3,_0x2fb290){var _0x5a237f=function(_0x53a6b6){while(--_0x53a6b6){_0x306af3['push'](_0x306af3['shift']());}};_0x5a237f(++_0x2fb290);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0xd9fd40,_0x37d572){var _0x244d56=function(_0x4cefbc){while(--_0x4cefbc){_0xd9fd40['push'](_0xd9fd40['shift']());}};_0x244d56(++_0x37d572);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index f844dab..d8cadea 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 _0xb732=['length','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x6f93a4,_0x339a44){var _0x56a021=function(_0x3393a8){while(--_0x3393a8){_0x6f93a4['push'](_0x6f93a4['shift']());}};_0x56a021(++_0x339a44);}(_0xb732,0x1a9));var _0x2b73=function(_0x245c39,_0x849957){_0x245c39=_0x245c39-0x0;var _0x37fd73=_0xb732[_0x245c39];return _0x37fd73;};'use strict';var VoiceQueueEvents=require(_0x2b73('0x0'));var events=[_0x2b73('0x1'),_0x2b73('0x2'),_0x2b73('0x3')];function createListener(_0x26c794,_0x209e07){return function(_0xe31598){_0x209e07[_0x2b73('0x4')](_0x26c794,_0xe31598);};}function removeListener(_0x2ba6c9,_0x1f10e9){return function(){VoiceQueueEvents[_0x2b73('0x5')](_0x2ba6c9,_0x1f10e9);};}exports[_0x2b73('0x6')]=function(_0x2a0c30){for(var _0x58d2b3=0x0,_0x39f7dc=events[_0x2b73('0x7')];_0x58d2b3<_0x39f7dc;_0x58d2b3++){var _0x54b9e8=events[_0x58d2b3];var _0xae17bd=createListener('voiceQueue:'+_0x54b9e8,_0x2a0c30);VoiceQueueEvents['on'](_0x54b9e8,_0xae17bd);}}; \ No newline at end of file +var _0xa998=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x439c7c,_0x3bf2cf){var _0x290304=function(_0x2d3fa2){while(--_0x2d3fa2){_0x439c7c['push'](_0x439c7c['shift']());}};_0x290304(++_0x3bf2cf);}(_0xa998,0x18f));var _0x8a99=function(_0x344813,_0x537fab){_0x344813=_0x344813-0x0;var _0x44f064=_0xa998[_0x344813];return _0x44f064;};'use strict';var VoiceQueueEvents=require(_0x8a99('0x0'));var events=[_0x8a99('0x1'),_0x8a99('0x2'),_0x8a99('0x3')];function createListener(_0xc0ab88,_0x49b357){return function(_0x40f25c){_0x49b357[_0x8a99('0x4')](_0xc0ab88,_0x40f25c);};}function removeListener(_0x22ac49,_0x416a91){return function(){VoiceQueueEvents[_0x8a99('0x5')](_0x22ac49,_0x416a91);};}exports[_0x8a99('0x6')]=function(_0x3781db){for(var _0x1d5a4b=0x0,_0x4b1a05=events[_0x8a99('0x7')];_0x1d5a4b<_0x4b1a05;_0x1d5a4b++){var _0xc6b44a=events[_0x1d5a4b];var _0x5db7e3=createListener(_0x8a99('0x8')+_0xc6b44a,_0x3781db);VoiceQueueEvents['on'](_0xc6b44a,_0x5db7e3);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 304e3fb..a2616a1 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 _0x1c2c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','update','delete','destroy','exports','multer'];(function(_0x4e3a92,_0x409fa2){var _0x52d8b9=function(_0x2d8b12){while(--_0x2d8b12){_0x4e3a92['push'](_0x4e3a92['shift']());}};_0x52d8b9(++_0x409fa2);}(_0x1c2c,0x18e));var _0xc1c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c2c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc1c2('0x0'));var util=require('util');var path=require(_0xc1c2('0x1'));var timeout=require(_0xc1c2('0x2'));var express=require(_0xc1c2('0x3'));var router=express[_0xc1c2('0x4')]();var auth=require(_0xc1c2('0x5'));var interaction=require(_0xc1c2('0x6'));var config=require(_0xc1c2('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xc1c2('0x8')](),controller['index']);router[_0xc1c2('0x9')](_0xc1c2('0xa'),auth[_0xc1c2('0x8')](),controller[_0xc1c2('0xb')]);router['get'](_0xc1c2('0xc'),auth['isAuthenticated'](),controller[_0xc1c2('0xd')]);router[_0xc1c2('0x9')](_0xc1c2('0xe'),auth['isAuthenticated'](),controller[_0xc1c2('0xf')]);router[_0xc1c2('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc1c2('0x11')]);router[_0xc1c2('0x12')](_0xc1c2('0xe'),auth[_0xc1c2('0x8')](),controller[_0xc1c2('0x13')]);module[_0xc1c2('0x14')]=router; \ No newline at end of file +var _0x3883=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0x3883,0xa6));var _0x3388=function(_0x2c834e,_0x5dc6c3){_0x2c834e=_0x2c834e-0x0;var _0x23382a=_0x3883[_0x2c834e];return _0x23382a;};'use strict';var multer=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var path=require(_0x3388('0x2'));var timeout=require(_0x3388('0x3'));var express=require(_0x3388('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3388('0x5'));var config=require(_0x3388('0x6'));var controller=require(_0x3388('0x7'));router[_0x3388('0x8')]('/',auth['isAuthenticated'](),controller[_0x3388('0x9')]);router[_0x3388('0x8')](_0x3388('0xa'),auth['isAuthenticated'](),controller[_0x3388('0xb')]);router['get'](_0x3388('0xc'),auth[_0x3388('0xd')](),controller[_0x3388('0xe')]);router[_0x3388('0x8')](_0x3388('0xf'),auth[_0x3388('0xd')](),controller[_0x3388('0x10')]);router[_0x3388('0x11')]('/',auth['isAuthenticated'](),controller[_0x3388('0x12')]);router[_0x3388('0x13')](_0x3388('0xf'),auth[_0x3388('0xd')](),controller[_0x3388('0x14')]);router[_0x3388('0x15')](_0x3388('0xf'),auth[_0x3388('0xd')](),controller[_0x3388('0x16')]);module[_0x3388('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2cd4588..259b061 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 _0xde8a=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xde8a,0x1d9));var _0xade8=function(_0x41264a,_0xfc747b){_0x41264a=_0x41264a-0x0;var _0x3f52a1=_0xde8a[_0x41264a];return _0x3f52a1;};'use strict';var Sequelize=require(_0xade8('0x0'));var moment=require(_0xade8('0x1'));module[_0xade8('0x2')]={'type':{'type':Sequelize[_0xade8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xade8('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xade8('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xade8('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xade8('0x4')],'set':function(_0x2979cb){var _0x28645b=moment(_0x2979cb);var _0x3caddf=moment(this[_0xade8('0x5')](_0xade8('0x6')))[_0xade8('0x7')](_0xade8('0x8'));var _0x534ece=_0x28645b[_0xade8('0x9')](_0x3caddf,_0xade8('0xa'));this[_0xade8('0xb')](_0xade8('0xc'),_0x2979cb);this[_0xade8('0xb')](_0xade8('0xd'),_0x534ece||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xade8('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xade8('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xade8('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xade8('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xade8('0x4')]},'queuecallerexit':{'type':Sequelize[_0xade8('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xade8('0x3')],'comment':_0xade8('0x10')},'originalposition':{'type':Sequelize[_0xade8('0xe')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xade8('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xade8('0x3')]},'holdtime':{'type':Sequelize[_0xade8('0xe')]},'mohtime':{'type':Sequelize[_0xade8('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xade8('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xade8('0x3')]},'transfer':{'type':Sequelize[_0xade8('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xade8('0x11')},'transferexten':{'type':Sequelize[_0xade8('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xade8('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xade8('0xe')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4d3=['DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc4d3,0x89));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3c4d('0x0'));var moment=require('moment');module[_0x3c4d('0x1')]={'type':{'type':Sequelize[_0x3c4d('0x2')]},'uniqueid':{'type':Sequelize[_0x3c4d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3c4d('0x2')]},'queue':{'type':Sequelize[_0x3c4d('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3c4d('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3c4d('0x3')],'set':function(_0x388747){var _0x8c8bb3=moment(_0x388747);var _0x3e7a53=moment(this['getDataValue'](_0x3c4d('0x4')))['format'](_0x3c4d('0x5'));var _0x18f9df=_0x8c8bb3[_0x3c4d('0x6')](_0x3e7a53,_0x3c4d('0x7'));this['setDataValue'](_0x3c4d('0x8'),_0x388747);this[_0x3c4d('0x9')]('holdtime',_0x18f9df||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x3c4d('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x3c4d('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3c4d('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3c4d('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3c4d('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3c4d('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3c4d('0x2')],'comment':_0x3c4d('0xc')},'originalposition':{'type':Sequelize[_0x3c4d('0xa')]},'channel':{'type':Sequelize[_0x3c4d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3c4d('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3c4d('0x2')]},'exten':{'type':Sequelize[_0x3c4d('0x2')]},'priority':{'type':Sequelize[_0x3c4d('0x2')]},'holdtime':{'type':Sequelize[_0x3c4d('0xa')]},'mohtime':{'type':Sequelize[_0x3c4d('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3c4d('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3c4d('0x2')]},'transfer':{'type':Sequelize[_0x3c4d('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3c4d('0x2')],'comment':_0x3c4d('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3c4d('0x2')]},'disposition':{'type':Sequelize[_0x3c4d('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3c4d('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 19b67ab..4be0f89 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 _0x2eb6=['error','stack','name','index','VoiceQueueReport','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','key','field','options','include','rows','catch','show','params','fields','includeAll','find','body','describe','getVoiceQueuesReport','nolimit','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','redis','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus'];(function(_0xb376de,_0xc6ff08){var _0x73c45a=function(_0x53673c){while(--_0x53673c){_0xb376de['push'](_0xb376de['shift']());}};_0x73c45a(++_0xc6ff08);}(_0x2eb6,0x1ce));var _0x62eb=function(_0x11cf97,_0x1b6768){_0x11cf97=_0x11cf97-0x0;var _0x3743bd=_0x2eb6[_0x11cf97];return _0x3743bd;};'use strict';var pdf=require(_0x62eb('0x0'));var emlformat=require(_0x62eb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62eb('0x2'));var rp=require(_0x62eb('0x3'));var moment=require(_0x62eb('0x4'));var BPromise=require(_0x62eb('0x5'));var Mustache=require(_0x62eb('0x6'));var util=require('util');var path=require(_0x62eb('0x7'));var sox=require(_0x62eb('0x8'));var csv=require(_0x62eb('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x62eb('0xa'));var squel=require(_0x62eb('0xb'));var crypto=require(_0x62eb('0xc'));var jsforce=require(_0x62eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x62eb('0x9'));var querystring=require(_0x62eb('0xe'));var Papa=require('papaparse');var Redis=require(_0x62eb('0xf'));var authService=require(_0x62eb('0x10'));var qs=require(_0x62eb('0x11'));var hardwareService=require(_0x62eb('0x12'));var logger=require('../../config/logger')(_0x62eb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x62eb('0x14'))['db'];config[_0x62eb('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62eb('0x15')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x561870,_0x527593){_0x527593=_0x527593||0xcc;return function(_0x48d0dc){if(_0x48d0dc){return _0x561870['sendStatus'](_0x527593);}return _0x561870[_0x62eb('0x16')](_0x527593)['end']();};}function respondWithResult(_0x219126,_0x22046b){_0x22046b=_0x22046b||0xc8;return function(_0x289050){if(_0x289050){return _0x219126[_0x62eb('0x16')](_0x22046b)[_0x62eb('0x17')](_0x289050);}};}function respondWithFilteredResult(_0x100bf7,_0x3a3470){return function(_0x208f3d){if(_0x208f3d){var _0x8de78f=_0x208f3d[_0x62eb('0x18')],_0xf94e8=_0x3a3470[_0x62eb('0x19')],_0x22c0c8=_0x3a3470[_0x62eb('0x19')]+_0x3a3470['limit'],_0x53cace;if(_0x22c0c8>=_0x8de78f){_0x22c0c8=_0x8de78f;_0x53cace=0xc8;}else{_0x53cace=0xce;}_0x100bf7[_0x62eb('0x16')](_0x53cace);return _0x100bf7['set'](_0x62eb('0x1a'),_0xf94e8+'-'+_0x22c0c8+'/'+_0x8de78f)[_0x62eb('0x17')](_0x208f3d);}return null;};}function patchUpdates(_0x4efbee){return function(_0x5b6da5){try{jsonpatch[_0x62eb('0x1b')](_0x5b6da5,_0x4efbee,!![]);}catch(_0x422e83){return BPromise[_0x62eb('0x1c')](_0x422e83);}return _0x5b6da5[_0x62eb('0x1d')]();};}function saveUpdates(_0x161775,_0x39895b){return function(_0x23189b){if(_0x23189b){return _0x23189b[_0x62eb('0x1e')](_0x161775)[_0x62eb('0x1f')](function(_0x30a27f){return _0x30a27f;});}return null;};}function removeEntity(_0x341625,_0x36b4e0){return function(_0x70fd6e){if(_0x70fd6e){return _0x70fd6e[_0x62eb('0x20')]()['then'](function(){_0x341625['status'](0xcc)[_0x62eb('0x21')]();});}};}function handleEntityNotFound(_0x8a1bf8,_0x162132){return function(_0x273221){if(!_0x273221){_0x8a1bf8[_0x62eb('0x22')](0x194);}return _0x273221;};}function handleError(_0x103d5e,_0x4830af){_0x4830af=_0x4830af||0x1f4;return function(_0x27436a){logger[_0x62eb('0x23')](_0x27436a[_0x62eb('0x24')]);if(_0x27436a['name']){delete _0x27436a[_0x62eb('0x25')];}_0x103d5e['status'](_0x4830af)['send'](_0x27436a);};}exports[_0x62eb('0x26')]=function(_0x37fbb5,_0x9131d){var _0x26221c={},_0x49a5b8={},_0x247d4e={'count':0x0,'rows':[]};var _0x44bc7a=db[_0x62eb('0x27')][_0x62eb('0x28')];_0x49a5b8[_0x62eb('0x29')]=_[_0x62eb('0x2a')](_0x44bc7a);_0x49a5b8[_0x62eb('0x2b')]=_[_0x62eb('0x2a')](_0x37fbb5[_0x62eb('0x2b')]);_0x49a5b8['filters']=_[_0x62eb('0x2c')](_0x49a5b8[_0x62eb('0x29')],_0x49a5b8[_0x62eb('0x2b')]);_0x26221c['attributes']=_[_0x62eb('0x2c')](_0x49a5b8['model'],qs['fields'](_0x37fbb5[_0x62eb('0x2b')]['fields']));_0x26221c[_0x62eb('0x2d')]=_0x26221c[_0x62eb('0x2d')][_0x62eb('0x2e')]?_0x26221c[_0x62eb('0x2d')]:_0x49a5b8[_0x62eb('0x29')];if(!_0x37fbb5[_0x62eb('0x2b')][_0x62eb('0x2f')]('nolimit')){_0x26221c['limit']=qs['limit'](_0x37fbb5[_0x62eb('0x2b')][_0x62eb('0x30')]);_0x26221c['offset']=qs[_0x62eb('0x19')](_0x37fbb5[_0x62eb('0x2b')][_0x62eb('0x19')]);}_0x26221c[_0x62eb('0x31')]=qs[_0x62eb('0x32')](_0x37fbb5['query'][_0x62eb('0x32')]);_0x26221c[_0x62eb('0x33')]=qs['filters'](_['pick'](_0x37fbb5['query'],_0x49a5b8[_0x62eb('0x34')]));if(_0x37fbb5[_0x62eb('0x2b')][_0x62eb('0x35')]){_0x26221c[_0x62eb('0x33')]=_[_0x62eb('0x36')](_0x26221c['where'],{'$or':_[_0x62eb('0x37')](_0x44bc7a,function(_0x497445){if(_0x497445['type'][_0x62eb('0x38')]!=='VIRTUAL'){var _0x28388e={};_0x28388e[_0x497445[_0x62eb('0x39')]]={'$like':'%'+_0x37fbb5[_0x62eb('0x2b')][_0x62eb('0x35')]+'%'};return _0x28388e;}})});}_0x26221c=_['merge']({},_0x26221c,_0x37fbb5[_0x62eb('0x3a')]);var _0x477ed9={'where':_0x26221c[_0x62eb('0x33')]};return db[_0x62eb('0x27')]['count'](_0x477ed9)[_0x62eb('0x1f')](function(_0x1aa21f){_0x247d4e['count']=_0x1aa21f;if(_0x37fbb5[_0x62eb('0x2b')]['includeAll']){_0x26221c[_0x62eb('0x3b')]=[{'all':!![]}];}return db[_0x62eb('0x27')]['findAll'](_0x26221c);})[_0x62eb('0x1f')](function(_0x51a973){_0x247d4e[_0x62eb('0x3c')]=_0x51a973;return _0x247d4e;})['then'](respondWithFilteredResult(_0x9131d,_0x26221c))[_0x62eb('0x3d')](handleError(_0x9131d,null));};exports[_0x62eb('0x3e')]=function(_0x2d3282,_0x576879){var _0x3507ee={'raw':![],'where':{'id':_0x2d3282[_0x62eb('0x3f')]['id']}},_0x12ba5d={};_0x12ba5d[_0x62eb('0x29')]=_[_0x62eb('0x2a')](db[_0x62eb('0x27')][_0x62eb('0x28')]);_0x12ba5d[_0x62eb('0x2b')]=_[_0x62eb('0x2a')](_0x2d3282['query']);_0x12ba5d['filters']=_[_0x62eb('0x2c')](_0x12ba5d[_0x62eb('0x29')],_0x12ba5d['query']);_0x3507ee[_0x62eb('0x2d')]=_['intersection'](_0x12ba5d[_0x62eb('0x29')],qs['fields'](_0x2d3282[_0x62eb('0x2b')][_0x62eb('0x40')]));_0x3507ee[_0x62eb('0x2d')]=_0x3507ee[_0x62eb('0x2d')][_0x62eb('0x2e')]?_0x3507ee['attributes']:_0x12ba5d['model'];if(_0x2d3282[_0x62eb('0x2b')][_0x62eb('0x41')]){_0x3507ee[_0x62eb('0x3b')]=[{'all':!![]}];}_0x3507ee=_[_0x62eb('0x36')]({},_0x3507ee,_0x2d3282[_0x62eb('0x3a')]);return db[_0x62eb('0x27')][_0x62eb('0x42')](_0x3507ee)[_0x62eb('0x1f')](handleEntityNotFound(_0x576879,null))['then'](respondWithResult(_0x576879,null))[_0x62eb('0x3d')](handleError(_0x576879,null));};exports['create']=function(_0x538626,_0x93b079){return db['VoiceQueueReport']['create'](_0x538626[_0x62eb('0x43')],{})[_0x62eb('0x1f')](respondWithResult(_0x93b079,0xc9))[_0x62eb('0x3d')](handleError(_0x93b079,null));};exports[_0x62eb('0x1e')]=function(_0x2f3fd4,_0x1a341b){if(_0x2f3fd4[_0x62eb('0x43')]['id']){delete _0x2f3fd4[_0x62eb('0x43')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x2f3fd4[_0x62eb('0x3f')]['id']}})[_0x62eb('0x1f')](handleEntityNotFound(_0x1a341b,null))['then'](saveUpdates(_0x2f3fd4['body'],null))[_0x62eb('0x1f')](respondWithResult(_0x1a341b,null))[_0x62eb('0x3d')](handleError(_0x1a341b,null));};exports['destroy']=function(_0x3cc3ce,_0x1fadcc){return db[_0x62eb('0x27')]['find']({'where':{'id':_0x3cc3ce[_0x62eb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1fadcc,null))['then'](removeEntity(_0x1fadcc,null))[_0x62eb('0x3d')](handleError(_0x1fadcc,null));};exports[_0x62eb('0x44')]=function(_0x3e0440,_0x360d58){return db['VoiceQueueReport'][_0x62eb('0x44')]()[_0x62eb('0x1f')](respondWithResult(_0x360d58,null))[_0x62eb('0x3d')](handleError(_0x360d58,null));};exports[_0x62eb('0x45')]=function(_0x38b1f6,_0x2c7081){var _0x47ae6c={},_0x5f59d9={},_0x4b997d={'count':0x0,'rows':[]};_0x5f59d9[_0x62eb('0x29')]=_[_0x62eb('0x2a')](db[_0x62eb('0x27')]['rawAttributes']);_0x5f59d9[_0x62eb('0x2b')]=_['keys'](_0x38b1f6[_0x62eb('0x2b')]);_0x5f59d9[_0x62eb('0x34')]=_[_0x62eb('0x2c')](_0x5f59d9[_0x62eb('0x29')],_0x5f59d9[_0x62eb('0x2b')]);_0x47ae6c[_0x62eb('0x2d')]=_[_0x62eb('0x2c')](_0x5f59d9[_0x62eb('0x29')],qs[_0x62eb('0x40')](_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x40')]));_0x47ae6c[_0x62eb('0x2d')]=_0x47ae6c[_0x62eb('0x2d')]['length']?_0x47ae6c[_0x62eb('0x2d')]:_0x5f59d9['model'];if(!_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x2f')](_0x62eb('0x46'))){_0x47ae6c[_0x62eb('0x30')]=qs['limit'](_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x30')]);_0x47ae6c['offset']=qs[_0x62eb('0x19')](_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x19')]);}_0x47ae6c[_0x62eb('0x31')]=qs[_0x62eb('0x32')](_0x38b1f6['query'][_0x62eb('0x32')]);_0x47ae6c[_0x62eb('0x33')]=qs[_0x62eb('0x34')](_['pick'](_0x38b1f6[_0x62eb('0x2b')],_0x5f59d9[_0x62eb('0x34')]));if(_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x35')]){_0x47ae6c['where']=_[_0x62eb('0x36')](_0x47ae6c[_0x62eb('0x33')],{'$or':_[_0x62eb('0x37')](_0x47ae6c['attributes'],function(_0x18e862){var _0x30ecf1={};_0x30ecf1[_0x18e862]={'$like':'%'+_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x35')]+'%'};return _0x30ecf1;})});}_0x47ae6c=_[_0x62eb('0x36')]({},_0x47ae6c,_0x38b1f6[_0x62eb('0x3a')]);var _0x188b29={'where':_0x47ae6c[_0x62eb('0x33')]};return db['VoiceQueueReport'][_0x62eb('0x18')](_0x188b29)[_0x62eb('0x1f')](function(_0x3f4211){_0x4b997d['count']=_0x3f4211;if(_0x38b1f6[_0x62eb('0x2b')][_0x62eb('0x41')]){_0x47ae6c['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x47ae6c);})[_0x62eb('0x1f')](function(_0x1ac334){_0x4b997d['rows']=_0x1ac334;return _0x4b997d;})[_0x62eb('0x1f')](respondWithFilteredResult(_0x2c7081,_0x47ae6c,_0x62eb('0x45')))[_0x62eb('0x3d')](handleError(_0x2c7081,null,_0x62eb('0x45')));}; \ No newline at end of file +var _0x6d8f=['create','body','params','destroy','describe','getVoiceQueuesReport','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','reject','update','then','end','error','stack','name','VoiceQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','order','sort','pick','filters','where','merge','type','key','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','length','find'];(function(_0x181575,_0x58b4d5){var _0x232dc1=function(_0x106e01){while(--_0x106e01){_0x181575['push'](_0x181575['shift']());}};_0x232dc1(++_0x58b4d5);}(_0x6d8f,0xdf));var _0xf6d8=function(_0x55c899,_0x133bc9){_0x55c899=_0x55c899-0x0;var _0x44d1b3=_0x6d8f[_0x55c899];return _0x44d1b3;};'use strict';var pdf=require(_0xf6d8('0x0'));var emlformat=require(_0xf6d8('0x1'));var rimraf=require(_0xf6d8('0x2'));var zipdir=require(_0xf6d8('0x3'));var jsonpatch=require(_0xf6d8('0x4'));var rp=require(_0xf6d8('0x5'));var moment=require(_0xf6d8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf6d8('0x7'));var util=require('util');var path=require(_0xf6d8('0x8'));var sox=require('sox');var csv=require(_0xf6d8('0x9'));var ejs=require(_0xf6d8('0xa'));var fs=require('fs');var _=require(_0xf6d8('0xb'));var squel=require(_0xf6d8('0xc'));var crypto=require(_0xf6d8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf6d8('0xe'));var Papa=require(_0xf6d8('0xf'));var Redis=require(_0xf6d8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf6d8('0x11'));var hardwareService=require(_0xf6d8('0x12'));var logger=require('../../config/logger')(_0xf6d8('0x13'));var utils=require(_0xf6d8('0x14'));var config=require(_0xf6d8('0x15'));var db=require(_0xf6d8('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf6d8('0x17'))(new Redis(config['redis']));require(_0xf6d8('0x18'))[_0xf6d8('0x19')](socket);function respondWithStatusCode(_0x1fe8f1,_0x3f05eb){_0x3f05eb=_0x3f05eb||0xcc;return function(_0x4e4cbf){if(_0x4e4cbf){return _0x1fe8f1[_0xf6d8('0x1a')](_0x3f05eb);}return _0x1fe8f1['status'](_0x3f05eb)['end']();};}function respondWithResult(_0x457aef,_0x5a9d8a){_0x5a9d8a=_0x5a9d8a||0xc8;return function(_0x1494a2){if(_0x1494a2){return _0x457aef[_0xf6d8('0x1b')](_0x5a9d8a)[_0xf6d8('0x1c')](_0x1494a2);}};}function respondWithFilteredResult(_0x403fa7,_0x442fb7){return function(_0x402e44){if(_0x402e44){var _0x34e8d0=_0x402e44['count'],_0x2c61a0=_0x442fb7[_0xf6d8('0x1d')],_0x8ece31=_0x442fb7[_0xf6d8('0x1d')]+_0x442fb7[_0xf6d8('0x1e')],_0x334d4a;if(_0x8ece31>=_0x34e8d0){_0x8ece31=_0x34e8d0;_0x334d4a=0xc8;}else{_0x334d4a=0xce;}_0x403fa7[_0xf6d8('0x1b')](_0x334d4a);return _0x403fa7['set']('Content-Range',_0x2c61a0+'-'+_0x8ece31+'/'+_0x34e8d0)['json'](_0x402e44);}return null;};}function patchUpdates(_0x20a418){return function(_0x2e2b7e){try{jsonpatch['apply'](_0x2e2b7e,_0x20a418,!![]);}catch(_0x9e1e2f){return BPromise[_0xf6d8('0x1f')](_0x9e1e2f);}return _0x2e2b7e['save']();};}function saveUpdates(_0x3d0aa6,_0x28c7bc){return function(_0x18988e){if(_0x18988e){return _0x18988e[_0xf6d8('0x20')](_0x3d0aa6)[_0xf6d8('0x21')](function(_0x159b3b){return _0x159b3b;});}return null;};}function removeEntity(_0x47e440,_0x2de282){return function(_0x57499a){if(_0x57499a){return _0x57499a['destroy']()[_0xf6d8('0x21')](function(){_0x47e440['status'](0xcc)[_0xf6d8('0x22')]();});}};}function handleEntityNotFound(_0x592819,_0x35087d){return function(_0x1ef0fa){if(!_0x1ef0fa){_0x592819[_0xf6d8('0x1a')](0x194);}return _0x1ef0fa;};}function handleError(_0x304d49,_0x248d01){_0x248d01=_0x248d01||0x1f4;return function(_0x25a8d3){logger[_0xf6d8('0x23')](_0x25a8d3[_0xf6d8('0x24')]);if(_0x25a8d3[_0xf6d8('0x25')]){delete _0x25a8d3[_0xf6d8('0x25')];}_0x304d49[_0xf6d8('0x1b')](_0x248d01)['send'](_0x25a8d3);};}exports['index']=function(_0x550725,_0x1639e3){var _0x3cf7cf={},_0x2af9bd={},_0x1d5e4c={'count':0x0,'rows':[]};var _0x351e99=db[_0xf6d8('0x26')][_0xf6d8('0x27')];_0x2af9bd[_0xf6d8('0x28')]=_[_0xf6d8('0x29')](_0x351e99);_0x2af9bd[_0xf6d8('0x2a')]=_[_0xf6d8('0x29')](_0x550725['query']);_0x2af9bd['filters']=_[_0xf6d8('0x2b')](_0x2af9bd[_0xf6d8('0x28')],_0x2af9bd['query']);_0x3cf7cf[_0xf6d8('0x2c')]=_['intersection'](_0x2af9bd[_0xf6d8('0x28')],qs[_0xf6d8('0x2d')](_0x550725[_0xf6d8('0x2a')][_0xf6d8('0x2d')]));_0x3cf7cf['attributes']=_0x3cf7cf[_0xf6d8('0x2c')]['length']?_0x3cf7cf[_0xf6d8('0x2c')]:_0x2af9bd[_0xf6d8('0x28')];if(!_0x550725[_0xf6d8('0x2a')]['hasOwnProperty']('nolimit')){_0x3cf7cf[_0xf6d8('0x1e')]=qs['limit'](_0x550725[_0xf6d8('0x2a')]['limit']);_0x3cf7cf[_0xf6d8('0x1d')]=qs['offset'](_0x550725[_0xf6d8('0x2a')][_0xf6d8('0x1d')]);}_0x3cf7cf[_0xf6d8('0x2e')]=qs[_0xf6d8('0x2f')](_0x550725[_0xf6d8('0x2a')][_0xf6d8('0x2f')]);_0x3cf7cf['where']=qs['filters'](_[_0xf6d8('0x30')](_0x550725[_0xf6d8('0x2a')],_0x2af9bd[_0xf6d8('0x31')]));if(_0x550725[_0xf6d8('0x2a')]['filter']){_0x3cf7cf[_0xf6d8('0x32')]=_[_0xf6d8('0x33')](_0x3cf7cf[_0xf6d8('0x32')],{'$or':_['map'](_0x351e99,function(_0x130e23){if(_0x130e23[_0xf6d8('0x34')][_0xf6d8('0x35')]!==_0xf6d8('0x36')){var _0x7f259c={};_0x7f259c[_0x130e23['field']]={'$like':'%'+_0x550725[_0xf6d8('0x2a')][_0xf6d8('0x37')]+'%'};return _0x7f259c;}})});}_0x3cf7cf=_['merge']({},_0x3cf7cf,_0x550725[_0xf6d8('0x38')]);var _0x46a937={'where':_0x3cf7cf[_0xf6d8('0x32')]};return db['VoiceQueueReport'][_0xf6d8('0x39')](_0x46a937)[_0xf6d8('0x21')](function(_0x4bdd39){_0x1d5e4c[_0xf6d8('0x39')]=_0x4bdd39;if(_0x550725[_0xf6d8('0x2a')][_0xf6d8('0x3a')]){_0x3cf7cf[_0xf6d8('0x3b')]=[{'all':!![]}];}return db[_0xf6d8('0x26')][_0xf6d8('0x3c')](_0x3cf7cf);})['then'](function(_0x8c2f92){_0x1d5e4c[_0xf6d8('0x3d')]=_0x8c2f92;return _0x1d5e4c;})[_0xf6d8('0x21')](respondWithFilteredResult(_0x1639e3,_0x3cf7cf))[_0xf6d8('0x3e')](handleError(_0x1639e3,null));};exports['show']=function(_0xc8b14b,_0x20a5b7){var _0x54832d={'raw':![],'where':{'id':_0xc8b14b['params']['id']}},_0x367f5c={};_0x367f5c['model']=_[_0xf6d8('0x29')](db[_0xf6d8('0x26')][_0xf6d8('0x27')]);_0x367f5c['query']=_[_0xf6d8('0x29')](_0xc8b14b[_0xf6d8('0x2a')]);_0x367f5c[_0xf6d8('0x31')]=_['intersection'](_0x367f5c[_0xf6d8('0x28')],_0x367f5c[_0xf6d8('0x2a')]);_0x54832d[_0xf6d8('0x2c')]=_[_0xf6d8('0x2b')](_0x367f5c[_0xf6d8('0x28')],qs[_0xf6d8('0x2d')](_0xc8b14b[_0xf6d8('0x2a')][_0xf6d8('0x2d')]));_0x54832d['attributes']=_0x54832d[_0xf6d8('0x2c')][_0xf6d8('0x3f')]?_0x54832d[_0xf6d8('0x2c')]:_0x367f5c[_0xf6d8('0x28')];if(_0xc8b14b['query'][_0xf6d8('0x3a')]){_0x54832d['include']=[{'all':!![]}];}_0x54832d=_['merge']({},_0x54832d,_0xc8b14b[_0xf6d8('0x38')]);return db[_0xf6d8('0x26')][_0xf6d8('0x40')](_0x54832d)[_0xf6d8('0x21')](handleEntityNotFound(_0x20a5b7,null))[_0xf6d8('0x21')](respondWithResult(_0x20a5b7,null))['catch'](handleError(_0x20a5b7,null));};exports[_0xf6d8('0x41')]=function(_0x18f296,_0x2045b9){return db[_0xf6d8('0x26')]['create'](_0x18f296[_0xf6d8('0x42')],{})[_0xf6d8('0x21')](respondWithResult(_0x2045b9,0xc9))[_0xf6d8('0x3e')](handleError(_0x2045b9,null));};exports['update']=function(_0x4127e5,_0x4c3008){if(_0x4127e5[_0xf6d8('0x42')]['id']){delete _0x4127e5[_0xf6d8('0x42')]['id'];}return db[_0xf6d8('0x26')][_0xf6d8('0x40')]({'where':{'id':_0x4127e5[_0xf6d8('0x43')]['id']}})[_0xf6d8('0x21')](handleEntityNotFound(_0x4c3008,null))['then'](saveUpdates(_0x4127e5[_0xf6d8('0x42')],null))[_0xf6d8('0x21')](respondWithResult(_0x4c3008,null))[_0xf6d8('0x3e')](handleError(_0x4c3008,null));};exports[_0xf6d8('0x44')]=function(_0x522ac2,_0x5203b2){return db[_0xf6d8('0x26')][_0xf6d8('0x40')]({'where':{'id':_0x522ac2['params']['id']}})[_0xf6d8('0x21')](handleEntityNotFound(_0x5203b2,null))[_0xf6d8('0x21')](removeEntity(_0x5203b2,null))['catch'](handleError(_0x5203b2,null));};exports[_0xf6d8('0x45')]=function(_0x56ed61,_0x1778ae){return db[_0xf6d8('0x26')][_0xf6d8('0x45')]()['then'](respondWithResult(_0x1778ae,null))[_0xf6d8('0x3e')](handleError(_0x1778ae,null));};exports[_0xf6d8('0x46')]=function(_0xd94c89,_0x3d81c0){var _0x48c40e={},_0x2f7bf4={},_0x1dc450={'count':0x0,'rows':[]};_0x2f7bf4[_0xf6d8('0x28')]=_['keys'](db['VoiceQueueReport'][_0xf6d8('0x27')]);_0x2f7bf4[_0xf6d8('0x2a')]=_['keys'](_0xd94c89[_0xf6d8('0x2a')]);_0x2f7bf4[_0xf6d8('0x31')]=_[_0xf6d8('0x2b')](_0x2f7bf4[_0xf6d8('0x28')],_0x2f7bf4['query']);_0x48c40e[_0xf6d8('0x2c')]=_[_0xf6d8('0x2b')](_0x2f7bf4['model'],qs[_0xf6d8('0x2d')](_0xd94c89[_0xf6d8('0x2a')]['fields']));_0x48c40e[_0xf6d8('0x2c')]=_0x48c40e['attributes'][_0xf6d8('0x3f')]?_0x48c40e[_0xf6d8('0x2c')]:_0x2f7bf4['model'];if(!_0xd94c89['query']['hasOwnProperty'](_0xf6d8('0x47'))){_0x48c40e[_0xf6d8('0x1e')]=qs[_0xf6d8('0x1e')](_0xd94c89[_0xf6d8('0x2a')][_0xf6d8('0x1e')]);_0x48c40e[_0xf6d8('0x1d')]=qs[_0xf6d8('0x1d')](_0xd94c89[_0xf6d8('0x2a')][_0xf6d8('0x1d')]);}_0x48c40e[_0xf6d8('0x2e')]=qs[_0xf6d8('0x2f')](_0xd94c89[_0xf6d8('0x2a')][_0xf6d8('0x2f')]);_0x48c40e[_0xf6d8('0x32')]=qs['filters'](_['pick'](_0xd94c89[_0xf6d8('0x2a')],_0x2f7bf4['filters']));if(_0xd94c89[_0xf6d8('0x2a')][_0xf6d8('0x37')]){_0x48c40e[_0xf6d8('0x32')]=_[_0xf6d8('0x33')](_0x48c40e[_0xf6d8('0x32')],{'$or':_['map'](_0x48c40e[_0xf6d8('0x2c')],function(_0xdab39){var _0x1c4776={};_0x1c4776[_0xdab39]={'$like':'%'+_0xd94c89['query'][_0xf6d8('0x37')]+'%'};return _0x1c4776;})});}_0x48c40e=_['merge']({},_0x48c40e,_0xd94c89[_0xf6d8('0x38')]);var _0x11d675={'where':_0x48c40e[_0xf6d8('0x32')]};return db[_0xf6d8('0x26')][_0xf6d8('0x39')](_0x11d675)[_0xf6d8('0x21')](function(_0xa83281){_0x1dc450[_0xf6d8('0x39')]=_0xa83281;if(_0xd94c89['query'][_0xf6d8('0x3a')]){_0x48c40e['include']=[{'all':!![]}];}return db[_0xf6d8('0x26')][_0xf6d8('0x3c')](_0x48c40e);})[_0xf6d8('0x21')](function(_0x334d5c){_0x1dc450[_0xf6d8('0x3d')]=_0x334d5c;return _0x1dc450;})[_0xf6d8('0x21')](respondWithFilteredResult(_0x3d81c0,_0x48c40e,'getVoiceQueuesReport'))[_0xf6d8('0x3e')](handleError(_0x3d81c0,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 e2e92f9..337db05 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 _0xb8ba=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xb8ba,0x6d));var _0xab8b=function(_0x2ed8bc,_0x55206d){_0x2ed8bc=_0x2ed8bc-0x0;var _0x5c090b=_0xb8ba[_0x2ed8bc];return _0x5c090b;};'use strict';var EventEmitter=require(_0xab8b('0x0'));var VoiceQueueReport=require(_0xab8b('0x1'))['db'][_0xab8b('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab8b('0x3'),'afterUpdate':_0xab8b('0x4'),'afterDestroy':_0xab8b('0x5')};function emitEvent(_0x275551){return function(_0x44e775,_0x82247c,_0x1d9664){VoiceQueueReportEvents[_0xab8b('0x6')](_0x275551+':'+_0x44e775['id'],_0x44e775);VoiceQueueReportEvents['emit'](_0x275551,_0x44e775);_0x1d9664(null);};}for(var e in events){if(events[_0xab8b('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xab8b('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x626d=['emit','hasOwnProperty','hook','exports','events','save','remove'];(function(_0x12d08a,_0x42e4f5){var _0xa8c693=function(_0xbefef7){while(--_0xbefef7){_0x12d08a['push'](_0x12d08a['shift']());}};_0xa8c693(++_0x42e4f5);}(_0x626d,0x89));var _0xd626=function(_0xa10d3f,_0x331c9f){_0xa10d3f=_0xa10d3f-0x0;var _0x1faf01=_0x626d[_0xa10d3f];return _0x1faf01;};'use strict';var EventEmitter=require(_0xd626('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd626('0x1'),'afterUpdate':'update','afterDestroy':_0xd626('0x2')};function emitEvent(_0x18d0f3){return function(_0x24e962,_0x278ea4,_0x397909){VoiceQueueReportEvents['emit'](_0x18d0f3+':'+_0x24e962['id'],_0x24e962);VoiceQueueReportEvents[_0xd626('0x3')](_0x18d0f3,_0x24e962);_0x397909(null);};}for(var e in events){if(events[_0xd626('0x4')](e)){var event=events[e];VoiceQueueReport[_0xd626('0x5')](e,emitEvent(event));}}module[_0xd626('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2264791..f5f7283 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 _0x59d9=['../../config/environment','exports','define','report_queue','uniqueid','calleridnum','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c0fcd,_0x18603b){var _0x3daa90=function(_0x264dcd){while(--_0x264dcd){_0x3c0fcd['push'](_0x3c0fcd['shift']());}};_0x3daa90(++_0x18603b);}(_0x59d9,0x88));var _0x959d=function(_0x8665a7,_0x296fa5){_0x8665a7=_0x8665a7-0x0;var _0x77ff17=_0x59d9[_0x8665a7];return _0x77ff17;};'use strict';var _=require(_0x959d('0x0'));var util=require(_0x959d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x959d('0x2'));var BPromise=require(_0x959d('0x3'));var rp=require(_0x959d('0x4'));var fs=require('fs');var path=require(_0x959d('0x5'));var rimraf=require(_0x959d('0x6'));var config=require(_0x959d('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x959d('0x8')]=function(_0x5c8629,_0x10ca35){return _0x5c8629[_0x959d('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x959d('0xa'),'paranoid':![],'indexes':[{'fields':[_0x959d('0xb')]},{'fields':[_0x959d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2de=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','lodash','util','../../config/logger'];(function(_0x3d3dd7,_0x5a7deb){var _0x2e8a42=function(_0x1500c6){while(--_0x1500c6){_0x3d3dd7['push'](_0x3d3dd7['shift']());}};_0x2e8a42(++_0x5a7deb);}(_0xe2de,0x10b));var _0xee2d=function(_0x4e3b7f,_0x171f91){_0x4e3b7f=_0x4e3b7f-0x0;var _0x19a094=_0xe2de[_0x4e3b7f];return _0x19a094;};'use strict';var _=require(_0xee2d('0x0'));var util=require(_0xee2d('0x1'));var logger=require(_0xee2d('0x2'))(_0xee2d('0x3'));var moment=require(_0xee2d('0x4'));var BPromise=require(_0xee2d('0x5'));var rp=require(_0xee2d('0x6'));var fs=require('fs');var path=require(_0xee2d('0x7'));var rimraf=require(_0xee2d('0x8'));var config=require(_0xee2d('0x9'));var attributes=require(_0xee2d('0xa'));module[_0xee2d('0xb')]=function(_0x3e836a,_0x56681b){return _0x3e836a[_0xee2d('0xc')]('VoiceQueueReport',attributes,{'tableName':_0xee2d('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xee2d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 585915a..8ae509f 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 _0xb46a=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b02bd,_0x52d304){var _0x3208b3=function(_0x24e68a){while(--_0x24e68a){_0x2b02bd['push'](_0x2b02bd['shift']());}};_0x3208b3(++_0x52d304);}(_0xb46a,0x81));var _0xab46=function(_0x332699,_0x1e2129){_0x332699=_0x332699-0x0;var _0x47ecf9=_0xb46a[_0x332699];return _0x47ecf9;};'use strict';var _=require(_0xab46('0x0'));var util=require(_0xab46('0x1'));var moment=require(_0xab46('0x2'));var BPromise=require(_0xab46('0x3'));var rs=require(_0xab46('0x4'));var fs=require('fs');var Redis=require(_0xab46('0x5'));var db=require(_0xab46('0x6'))['db'];var utils=require(_0xab46('0x7'));var logger=require(_0xab46('0x8'))('rpc');var config=require(_0xab46('0x9'));var jayson=require(_0xab46('0xa'));var client=jayson[_0xab46('0xb')][_0xab46('0xc')]({'port':0x232a});config[_0xab46('0xd')]=_['defaults'](config['redis'],{'host':_0xab46('0xe'),'port':0x18eb});var socket=require(_0xab46('0xf'))(new Redis(config[_0xab46('0xd')]));require(_0xab46('0x10'))['register'](socket);function respondWithRpcPromise(_0x272b84,_0x36bd4f,_0x12e6e5){return new BPromise(function(_0x35b348,_0x4574e0){return client[_0xab46('0x11')](_0x272b84,_0x12e6e5)[_0xab46('0x12')](function(_0x25f273){logger[_0xab46('0x13')](_0xab46('0x14'),_0x36bd4f,_0xab46('0x15'));logger['debug'](_0xab46('0x16'),_0x36bd4f,_0xab46('0x15'),JSON['stringify'](_0x25f273));if(_0x25f273[_0xab46('0x17')]){if(_0x25f273['error'][_0xab46('0x18')]===0x1f4){logger[_0xab46('0x17')](_0xab46('0x14'),_0x36bd4f,_0x25f273[_0xab46('0x17')]['message']);return _0x4574e0(_0x25f273[_0xab46('0x17')][_0xab46('0x19')]);}logger[_0xab46('0x17')](_0xab46('0x14'),_0x36bd4f,_0x25f273['error'][_0xab46('0x19')]);return _0x35b348(_0x25f273[_0xab46('0x17')][_0xab46('0x19')]);}else{logger[_0xab46('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x36bd4f,_0xab46('0x15'));_0x35b348(_0x25f273[_0xab46('0x1a')][_0xab46('0x19')]);}})['catch'](function(_0x5ba347){logger[_0xab46('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x36bd4f,_0x5ba347);_0x4574e0(_0x5ba347);});});}exports[_0xab46('0x1b')]=function(_0x29124c){var _0x256b12=this;return new Promise(function(_0x3b6b2e,_0x2c9b0a){return db[_0xab46('0x1c')][_0xab46('0x1d')]({'raw':_0x29124c['options']?_0x29124c[_0xab46('0x1e')][_0xab46('0x1f')]===undefined?!![]:![]:!![],'where':_0x29124c[_0xab46('0x1e')]?_0x29124c[_0xab46('0x1e')][_0xab46('0x20')]||null:null,'attributes':_0x29124c[_0xab46('0x1e')]?_0x29124c[_0xab46('0x1e')][_0xab46('0x21')]||null:null,'limit':_0x29124c['options']?_0x29124c['options'][_0xab46('0x22')]||null:null,'include':_0x29124c[_0xab46('0x1e')]?_0x29124c[_0xab46('0x1e')][_0xab46('0x23')]?_['map'](_0x29124c[_0xab46('0x1e')]['include'],function(_0x10eaf6){return{'model':db[_0x10eaf6[_0xab46('0x24')]],'as':_0x10eaf6['as'],'attributes':_0x10eaf6['attributes'],'include':_0x10eaf6['include']?_[_0xab46('0x25')](_0x10eaf6[_0xab46('0x23')],function(_0x52537f){return{'model':db[_0x52537f['model']],'as':_0x52537f['as'],'attributes':_0x52537f[_0xab46('0x21')],'include':_0x52537f[_0xab46('0x23')]?_[_0xab46('0x25')](_0x52537f['include'],function(_0x5073c2){return{'model':db[_0x5073c2[_0xab46('0x24')]],'as':_0x5073c2['as'],'attributes':_0x5073c2[_0xab46('0x21')]};}):[]};}):[]};}):[]:[]})[_0xab46('0x12')](function(_0x14c161){logger['info']('GetVoiceQueueReport',_0x29124c);logger[_0xab46('0x26')]('GetVoiceQueueReport',_0x29124c,JSON[_0xab46('0x27')](_0x14c161));_0x3b6b2e(_0x14c161);})[_0xab46('0x28')](function(_0x5898de){logger[_0xab46('0x17')](_0xab46('0x1b'),_0x5898de[_0xab46('0x19')],_0x29124c);_0x2c9b0a(_0x256b12[_0xab46('0x17')](0x1f4,_0x5898de[_0xab46('0x19')]));});});};exports[_0xab46('0x29')]=function(_0x5d7f0c){var _0x3af832=this;return new Promise(function(_0x25618f,_0x13edeb){return db['VoiceQueueReport'][_0xab46('0x2a')](_0x5d7f0c[_0xab46('0x2b')],{'raw':_0x5d7f0c[_0xab46('0x1e')]?_0x5d7f0c[_0xab46('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xab46('0x12')](function(_0x169aa9){logger[_0xab46('0x13')]('CreateVoiceQueueReport',_0x5d7f0c);logger[_0xab46('0x26')](_0xab46('0x29'),_0x5d7f0c,JSON[_0xab46('0x27')](_0x169aa9));_0x25618f(_0x169aa9);})[_0xab46('0x28')](function(_0xa9d0b1){logger[_0xab46('0x17')](_0xab46('0x29'),_0xa9d0b1[_0xab46('0x19')],_0x5d7f0c);_0x13edeb(_0x3af832['error'](0x1f4,_0xa9d0b1[_0xab46('0x19')]));});});};exports[_0xab46('0x2c')]=function(_0x10ca8f){var _0x2706a8=this;return new Promise(function(_0x5b6628,_0x1ea4b8){return db[_0xab46('0x1c')]['update'](_0x10ca8f[_0xab46('0x2b')],{'raw':_0x10ca8f[_0xab46('0x1e')]?_0x10ca8f[_0xab46('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10ca8f[_0xab46('0x1e')]?_0x10ca8f[_0xab46('0x1e')][_0xab46('0x20')]||null:null,'attributes':_0x10ca8f['options']?_0x10ca8f[_0xab46('0x1e')][_0xab46('0x21')]||null:null,'limit':_0x10ca8f[_0xab46('0x1e')]?_0x10ca8f[_0xab46('0x1e')][_0xab46('0x22')]||null:null})[_0xab46('0x12')](function(_0x38adb1){logger[_0xab46('0x13')](_0xab46('0x2c'),_0x10ca8f);logger[_0xab46('0x26')](_0xab46('0x2c'),_0x10ca8f,JSON['stringify'](_0x38adb1));_0x5b6628(_0x38adb1);})['catch'](function(_0x4794c0){logger['error'](_0xab46('0x2c'),_0x4794c0['message'],_0x10ca8f);_0x1ea4b8(_0x2706a8[_0xab46('0x17')](0x1f4,_0x4794c0[_0xab46('0x19')]));});});}; \ No newline at end of file +var _0x6b35=['info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','limit','include','map','model','attributes','then','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','raw','VoiceQueueReport','update','where','UpdateVoiceQueueReport','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x730192,_0x531aed){var _0x24bd5d=function(_0x53221c){while(--_0x53221c){_0x730192['push'](_0x730192['shift']());}};_0x24bd5d(++_0x531aed);}(_0x6b35,0x16b));var _0x56b3=function(_0x2e2af1,_0x2190eb){_0x2e2af1=_0x2e2af1-0x0;var _0x299275=_0x6b35[_0x2e2af1];return _0x299275;};'use strict';var _=require(_0x56b3('0x0'));var util=require(_0x56b3('0x1'));var moment=require(_0x56b3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56b3('0x3'));var db=require(_0x56b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x56b3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x56b3('0x6')][_0x56b3('0x7')]({'port':0x232a});config['redis']=_[_0x56b3('0x8')](config[_0x56b3('0x9')],{'host':_0x56b3('0xa'),'port':0x18eb});var socket=require(_0x56b3('0xb'))(new Redis(config['redis']));require(_0x56b3('0xc'))[_0x56b3('0xd')](socket);function respondWithRpcPromise(_0x4d6fd6,_0x2d2a28,_0x1b2ec5){return new BPromise(function(_0x4f3086,_0x10ca07){return client[_0x56b3('0xe')](_0x4d6fd6,_0x1b2ec5)['then'](function(_0x1a852a){logger[_0x56b3('0xf')](_0x56b3('0x10'),_0x2d2a28,_0x56b3('0x11'));logger[_0x56b3('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2d2a28,'request\x20sent',JSON[_0x56b3('0x13')](_0x1a852a));if(_0x1a852a[_0x56b3('0x14')]){if(_0x1a852a[_0x56b3('0x14')][_0x56b3('0x15')]===0x1f4){logger[_0x56b3('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x2d2a28,_0x1a852a[_0x56b3('0x14')][_0x56b3('0x16')]);return _0x10ca07(_0x1a852a[_0x56b3('0x14')][_0x56b3('0x16')]);}logger[_0x56b3('0x14')](_0x56b3('0x10'),_0x2d2a28,_0x1a852a[_0x56b3('0x14')][_0x56b3('0x16')]);return _0x4f3086(_0x1a852a['error'][_0x56b3('0x16')]);}else{logger[_0x56b3('0xf')](_0x56b3('0x10'),_0x2d2a28,'request\x20sent');_0x4f3086(_0x1a852a[_0x56b3('0x17')][_0x56b3('0x16')]);}})[_0x56b3('0x18')](function(_0x107feb){logger[_0x56b3('0x14')](_0x56b3('0x10'),_0x2d2a28,_0x107feb);_0x10ca07(_0x107feb);});});}exports['GetVoiceQueueReport']=function(_0x58df39){var _0x3532f4=this;return new Promise(function(_0x3d1ecb,_0x535e5f){return db['VoiceQueueReport'][_0x56b3('0x19')]({'raw':_0x58df39[_0x56b3('0x1a')]?_0x58df39['options']['raw']===undefined?!![]:![]:!![],'where':_0x58df39['options']?_0x58df39[_0x56b3('0x1a')]['where']||null:null,'attributes':_0x58df39[_0x56b3('0x1a')]?_0x58df39[_0x56b3('0x1a')]['attributes']||null:null,'limit':_0x58df39[_0x56b3('0x1a')]?_0x58df39[_0x56b3('0x1a')][_0x56b3('0x1b')]||null:null,'include':_0x58df39['options']?_0x58df39['options'][_0x56b3('0x1c')]?_[_0x56b3('0x1d')](_0x58df39[_0x56b3('0x1a')][_0x56b3('0x1c')],function(_0x5070d8){return{'model':db[_0x5070d8[_0x56b3('0x1e')]],'as':_0x5070d8['as'],'attributes':_0x5070d8[_0x56b3('0x1f')],'include':_0x5070d8['include']?_[_0x56b3('0x1d')](_0x5070d8[_0x56b3('0x1c')],function(_0x41d437){return{'model':db[_0x41d437[_0x56b3('0x1e')]],'as':_0x41d437['as'],'attributes':_0x41d437[_0x56b3('0x1f')],'include':_0x41d437['include']?_[_0x56b3('0x1d')](_0x41d437[_0x56b3('0x1c')],function(_0x32fdab){return{'model':db[_0x32fdab[_0x56b3('0x1e')]],'as':_0x32fdab['as'],'attributes':_0x32fdab['attributes']};}):[]};}):[]};}):[]:[]})[_0x56b3('0x20')](function(_0x495709){logger[_0x56b3('0xf')]('GetVoiceQueueReport',_0x58df39);logger[_0x56b3('0x12')]('GetVoiceQueueReport',_0x58df39,JSON[_0x56b3('0x13')](_0x495709));_0x3d1ecb(_0x495709);})['catch'](function(_0x872b1c){logger[_0x56b3('0x14')](_0x56b3('0x21'),_0x872b1c[_0x56b3('0x16')],_0x58df39);_0x535e5f(_0x3532f4[_0x56b3('0x14')](0x1f4,_0x872b1c[_0x56b3('0x16')]));});});};exports[_0x56b3('0x22')]=function(_0x5332ea){var _0x1415a3=this;return new Promise(function(_0x19edbd,_0x4c8e1f){return db['VoiceQueueReport'][_0x56b3('0x23')](_0x5332ea[_0x56b3('0x24')],{'raw':_0x5332ea[_0x56b3('0x1a')]?_0x5332ea[_0x56b3('0x1a')][_0x56b3('0x25')]===undefined?!![]:![]:!![]})[_0x56b3('0x20')](function(_0xd5c22){logger[_0x56b3('0xf')](_0x56b3('0x22'),_0x5332ea);logger['debug']('CreateVoiceQueueReport',_0x5332ea,JSON[_0x56b3('0x13')](_0xd5c22));_0x19edbd(_0xd5c22);})[_0x56b3('0x18')](function(_0x892b8){logger[_0x56b3('0x14')]('CreateVoiceQueueReport',_0x892b8[_0x56b3('0x16')],_0x5332ea);_0x4c8e1f(_0x1415a3['error'](0x1f4,_0x892b8[_0x56b3('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x5bbea0){var _0x546376=this;return new Promise(function(_0x39b553,_0x4fddce){return db[_0x56b3('0x26')][_0x56b3('0x27')](_0x5bbea0[_0x56b3('0x24')],{'raw':_0x5bbea0[_0x56b3('0x1a')]?_0x5bbea0[_0x56b3('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bbea0[_0x56b3('0x1a')]?_0x5bbea0[_0x56b3('0x1a')][_0x56b3('0x28')]||null:null,'attributes':_0x5bbea0[_0x56b3('0x1a')]?_0x5bbea0[_0x56b3('0x1a')][_0x56b3('0x1f')]||null:null,'limit':_0x5bbea0[_0x56b3('0x1a')]?_0x5bbea0[_0x56b3('0x1a')][_0x56b3('0x1b')]||null:null})['then'](function(_0x2d52f4){logger[_0x56b3('0xf')](_0x56b3('0x29'),_0x5bbea0);logger[_0x56b3('0x12')](_0x56b3('0x29'),_0x5bbea0,JSON[_0x56b3('0x13')](_0x2d52f4));_0x39b553(_0x2d52f4);})[_0x56b3('0x18')](function(_0x262849){logger[_0x56b3('0x14')](_0x56b3('0x29'),_0x262849[_0x56b3('0x16')],_0x5bbea0);_0x4fddce(_0x546376[_0x56b3('0x14')](0x1f4,_0x262849[_0x56b3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 973f43c..5e019db 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 _0xa50f=['./voiceQueueReport.events','update','emit','register','length','voiceQueueReport:'];(function(_0x4d4019,_0x550a3b){var _0x494d15=function(_0x47059c){while(--_0x47059c){_0x4d4019['push'](_0x4d4019['shift']());}};_0x494d15(++_0x550a3b);}(_0xa50f,0x7e));var _0xfa50=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa50f[_0x126558];return _0x1f6d14;};'use strict';var VoiceQueueReportEvents=require(_0xfa50('0x0'));var events=['save','remove',_0xfa50('0x1')];function createListener(_0x210e80,_0x14e94e){return function(_0x66125c){_0x14e94e[_0xfa50('0x2')](_0x210e80,_0x66125c);};}function removeListener(_0x546be7,_0x462161){return function(){VoiceQueueReportEvents['removeListener'](_0x546be7,_0x462161);};}exports[_0xfa50('0x3')]=function(_0x3a48ad){for(var _0xd0d5b9=0x0,_0x1a0dde=events[_0xfa50('0x4')];_0xd0d5b9<_0x1a0dde;_0xd0d5b9++){var _0x5d85a4=events[_0xd0d5b9];var _0x51e8c4=createListener(_0xfa50('0x5')+_0x5d85a4,_0x3a48ad);VoiceQueueReportEvents['on'](_0x5d85a4,_0x51e8c4);}}; \ No newline at end of file +var _0x1798=['save','remove','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x524e8e,_0x2128a0){var _0x3c6030=function(_0x3be8c3){while(--_0x3be8c3){_0x524e8e['push'](_0x524e8e['shift']());}};_0x3c6030(++_0x2128a0);}(_0x1798,0xa7));var _0x8179=function(_0x2a72aa,_0x8f7839){_0x2a72aa=_0x2a72aa-0x0;var _0x3a34ea=_0x1798[_0x2a72aa];return _0x3a34ea;};'use strict';var VoiceQueueReportEvents=require(_0x8179('0x0'));var events=[_0x8179('0x1'),_0x8179('0x2'),'update'];function createListener(_0x4e49ab,_0x2fe453){return function(_0x2864fc){_0x2fe453[_0x8179('0x3')](_0x4e49ab,_0x2864fc);};}function removeListener(_0x15a8f2,_0x26fd77){return function(){VoiceQueueReportEvents[_0x8179('0x4')](_0x15a8f2,_0x26fd77);};}exports[_0x8179('0x5')]=function(_0x3cef93){for(var _0x224de8=0x0,_0x35335b=events[_0x8179('0x6')];_0x224de8<_0x35335b;_0x224de8++){var _0x1ab939=events[_0x224de8];var _0x13e69e=createListener(_0x8179('0x7')+_0x1ab939,_0x3cef93);VoiceQueueReportEvents['on'](_0x1ab939,_0x13e69e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 57aface..ada09f6 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 _0x29b7=['/:id','show','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4305d8,_0x475bc0){var _0x4247ae=function(_0x1b6f12){while(--_0x1b6f12){_0x4305d8['push'](_0x4305d8['shift']());}};_0x4247ae(++_0x475bc0);}(_0x29b7,0x17d));var _0x729b=function(_0x3c9f1c,_0x14a163){_0x3c9f1c=_0x3c9f1c-0x0;var _0x5c0a5d=_0x29b7[_0x3c9f1c];return _0x5c0a5d;};'use strict';var multer=require('multer');var util=require(_0x729b('0x0'));var path=require(_0x729b('0x1'));var timeout=require(_0x729b('0x2'));var express=require(_0x729b('0x3'));var router=express[_0x729b('0x4')]();var auth=require(_0x729b('0x5'));var interaction=require(_0x729b('0x6'));var config=require(_0x729b('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x729b('0x8')]('/',auth[_0x729b('0x9')](),controller['index']);router[_0x729b('0x8')](_0x729b('0xa'),auth[_0x729b('0x9')](),controller[_0x729b('0xb')]);router['post']('/',auth[_0x729b('0x9')](),controller[_0x729b('0xc')]);router[_0x729b('0xd')](_0x729b('0xa'),auth[_0x729b('0x9')](),controller[_0x729b('0xe')]);router['delete'](_0x729b('0xa'),auth['isAuthenticated'](),controller[_0x729b('0xf')]);module[_0x729b('0x10')]=router; \ No newline at end of file +var _0x3d49=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5f3314,_0x105e14){var _0x183eba=function(_0x3c3ec1){while(--_0x3c3ec1){_0x5f3314['push'](_0x5f3314['shift']());}};_0x183eba(++_0x105e14);}(_0x3d49,0x151));var _0x93d4=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0x3d49[_0x14cb58];return _0x5f097e;};'use strict';var multer=require('multer');var util=require(_0x93d4('0x0'));var path=require(_0x93d4('0x1'));var timeout=require(_0x93d4('0x2'));var express=require(_0x93d4('0x3'));var router=express['Router']();var auth=require(_0x93d4('0x4'));var interaction=require(_0x93d4('0x5'));var config=require(_0x93d4('0x6'));var controller=require(_0x93d4('0x7'));router[_0x93d4('0x8')]('/',auth[_0x93d4('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x93d4('0x9')](),controller[_0x93d4('0xa')]);router[_0x93d4('0xb')](_0x93d4('0xc'),auth[_0x93d4('0x9')](),controller[_0x93d4('0xd')]);router[_0x93d4('0xe')](_0x93d4('0xc'),auth[_0x93d4('0x9')](),controller[_0x93d4('0xf')]);module[_0x93d4('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7c3e4bb..a99bf60 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 _0xa630=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x507b32,_0x580116){_0x507b32=_0x507b32-0x0;var _0x54d149=_0xa630[_0x507b32];return _0x54d149;};'use strict';var Sequelize=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0a63('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0a63('0x3')],'allowNull':![],'defaultValue':moment()[_0x0a63('0x4')](_0x0a63('0x5'))}}; \ No newline at end of file +var _0x5fd1=['format','sequelize','exports','STRING','DATE'];(function(_0xb6e4c,_0x42e3bf){var _0x83e9ae=function(_0x5114f3){while(--_0x5114f3){_0xb6e4c['push'](_0xb6e4c['shift']());}};_0x83e9ae(++_0x42e3bf);}(_0x5fd1,0x155));var _0x15fd=function(_0x3d21ef,_0x589d49){_0x3d21ef=_0x3d21ef-0x0;var _0x45bc7d=_0x5fd1[_0x3d21ef];return _0x45bc7d;};'use strict';var Sequelize=require(_0x15fd('0x0'));var moment=require('moment');module[_0x15fd('0x1')]={'time':{'type':Sequelize[_0x15fd('0x2')]},'callid':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x15fd('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x15fd('0x3')],'allowNull':![],'defaultValue':moment()[_0x15fd('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index bea5792..5b98df4 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 _0xcf3d=['status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','VoiceQueuesLog','includeAll','findAll','rows','show','length','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x346e6b,_0x5dfcd7){var _0x59131d=function(_0x254ba5){while(--_0x254ba5){_0x346e6b['push'](_0x346e6b['shift']());}};_0x59131d(++_0x5dfcd7);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x13f402,_0x531c5e){_0x13f402=_0x13f402-0x0;var _0x269eaf=_0xcf3d[_0x13f402];return _0x269eaf;};'use strict';var pdf=require(_0xdcf3('0x0'));var emlformat=require(_0xdcf3('0x1'));var rimraf=require(_0xdcf3('0x2'));var zipdir=require(_0xdcf3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcf3('0x4'));var moment=require('moment');var BPromise=require(_0xdcf3('0x5'));var Mustache=require(_0xdcf3('0x6'));var util=require(_0xdcf3('0x7'));var path=require(_0xdcf3('0x8'));var sox=require(_0xdcf3('0x9'));var csv=require(_0xdcf3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdcf3('0xb'));var squel=require('squel');var crypto=require(_0xdcf3('0xc'));var jsforce=require(_0xdcf3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdcf3('0xe'));var Redis=require(_0xdcf3('0xf'));var authService=require(_0xdcf3('0x10'));var qs=require(_0xdcf3('0x11'));var hardwareService=require(_0xdcf3('0x12'));var logger=require(_0xdcf3('0x13'))(_0xdcf3('0x14'));var utils=require(_0xdcf3('0x15'));var config=require(_0xdcf3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47d006,_0xd1b670){_0xd1b670=_0xd1b670||0xcc;return function(_0x4b1623){if(_0x4b1623){return _0x47d006[_0xdcf3('0x17')](_0xd1b670);}return _0x47d006[_0xdcf3('0x18')](_0xd1b670)[_0xdcf3('0x19')]();};}function respondWithResult(_0xb16991,_0x5c2da7){_0x5c2da7=_0x5c2da7||0xc8;return function(_0x2d0bc2){if(_0x2d0bc2){return _0xb16991[_0xdcf3('0x18')](_0x5c2da7)['json'](_0x2d0bc2);}};}function respondWithFilteredResult(_0x32eb38,_0x4b622c){return function(_0x1b34b4){if(_0x1b34b4){var _0x2ebc69=_0x1b34b4[_0xdcf3('0x1a')],_0x1af727=_0x4b622c[_0xdcf3('0x1b')],_0x2c5436=_0x4b622c['offset']+_0x4b622c[_0xdcf3('0x1c')],_0x5d6a28;if(_0x2c5436>=_0x2ebc69){_0x2c5436=_0x2ebc69;_0x5d6a28=0xc8;}else{_0x5d6a28=0xce;}_0x32eb38[_0xdcf3('0x18')](_0x5d6a28);return _0x32eb38[_0xdcf3('0x1d')](_0xdcf3('0x1e'),_0x1af727+'-'+_0x2c5436+'/'+_0x2ebc69)[_0xdcf3('0x1f')](_0x1b34b4);}return null;};}function patchUpdates(_0x67d338){return function(_0x28844a){try{jsonpatch[_0xdcf3('0x20')](_0x28844a,_0x67d338,!![]);}catch(_0x27a958){return BPromise[_0xdcf3('0x21')](_0x27a958);}return _0x28844a[_0xdcf3('0x22')]();};}function saveUpdates(_0x4bec24,_0x5609d7){return function(_0x3a4512){if(_0x3a4512){return _0x3a4512[_0xdcf3('0x23')](_0x4bec24)['then'](function(_0x4e3e41){return _0x4e3e41;});}return null;};}function removeEntity(_0x43e082,_0x528a88){return function(_0x5622de){if(_0x5622de){return _0x5622de[_0xdcf3('0x24')]()[_0xdcf3('0x25')](function(){_0x43e082[_0xdcf3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b9f1,_0x4d340a){return function(_0x2cc3ce){if(!_0x2cc3ce){_0x40b9f1['sendStatus'](0x194);}return _0x2cc3ce;};}function handleError(_0x72c260,_0x3bfc7f){_0x3bfc7f=_0x3bfc7f||0x1f4;return function(_0x1b600a){logger[_0xdcf3('0x26')](_0x1b600a['stack']);if(_0x1b600a[_0xdcf3('0x27')]){delete _0x1b600a['name'];}_0x72c260[_0xdcf3('0x18')](_0x3bfc7f)[_0xdcf3('0x28')](_0x1b600a);};}exports[_0xdcf3('0x29')]=function(_0x4c7412,_0x53fc07){var _0x115d7f={},_0x5d9320={},_0x5c3ad7={'count':0x0,'rows':[]};var _0x47efc8=db['VoiceQueuesLog'][_0xdcf3('0x2a')];_0x5d9320['model']=_[_0xdcf3('0x2b')](_0x47efc8);_0x5d9320['query']=_[_0xdcf3('0x2b')](_0x4c7412['query']);_0x5d9320[_0xdcf3('0x2c')]=_[_0xdcf3('0x2d')](_0x5d9320[_0xdcf3('0x2e')],_0x5d9320[_0xdcf3('0x2f')]);_0x115d7f[_0xdcf3('0x30')]=_[_0xdcf3('0x2d')](_0x5d9320[_0xdcf3('0x2e')],qs[_0xdcf3('0x31')](_0x4c7412[_0xdcf3('0x2f')][_0xdcf3('0x31')]));_0x115d7f[_0xdcf3('0x30')]=_0x115d7f[_0xdcf3('0x30')]['length']?_0x115d7f[_0xdcf3('0x30')]:_0x5d9320[_0xdcf3('0x2e')];if(!_0x4c7412[_0xdcf3('0x2f')][_0xdcf3('0x32')](_0xdcf3('0x33'))){_0x115d7f[_0xdcf3('0x1c')]=qs[_0xdcf3('0x1c')](_0x4c7412[_0xdcf3('0x2f')][_0xdcf3('0x1c')]);_0x115d7f['offset']=qs[_0xdcf3('0x1b')](_0x4c7412['query'][_0xdcf3('0x1b')]);}_0x115d7f[_0xdcf3('0x34')]=qs[_0xdcf3('0x35')](_0x4c7412[_0xdcf3('0x2f')][_0xdcf3('0x35')]);_0x115d7f[_0xdcf3('0x36')]=qs['filters'](_[_0xdcf3('0x37')](_0x4c7412[_0xdcf3('0x2f')],_0x5d9320['filters']));if(_0x4c7412[_0xdcf3('0x2f')][_0xdcf3('0x38')]){_0x115d7f['where']=_[_0xdcf3('0x39')](_0x115d7f[_0xdcf3('0x36')],{'$or':_[_0xdcf3('0x3a')](_0x47efc8,function(_0x406d65){if(_0x406d65['type'][_0xdcf3('0x3b')]!==_0xdcf3('0x3c')){var _0x56b97d={};_0x56b97d[_0x406d65['field']]={'$like':'%'+_0x4c7412['query'][_0xdcf3('0x38')]+'%'};return _0x56b97d;}})});}_0x115d7f=_[_0xdcf3('0x39')]({},_0x115d7f,_0x4c7412[_0xdcf3('0x3d')]);var _0x477c61={'where':_0x115d7f[_0xdcf3('0x36')]};return db[_0xdcf3('0x3e')][_0xdcf3('0x1a')](_0x477c61)[_0xdcf3('0x25')](function(_0x259a86){_0x5c3ad7['count']=_0x259a86;if(_0x4c7412['query'][_0xdcf3('0x3f')]){_0x115d7f['include']=[{'all':!![]}];}return db[_0xdcf3('0x3e')][_0xdcf3('0x40')](_0x115d7f);})['then'](function(_0x5ba362){_0x5c3ad7[_0xdcf3('0x41')]=_0x5ba362;return _0x5c3ad7;})['then'](respondWithFilteredResult(_0x53fc07,_0x115d7f))['catch'](handleError(_0x53fc07,null));};exports[_0xdcf3('0x42')]=function(_0x5b472c,_0x318669){var _0x67b0bf={'raw':!![],'where':{'id':_0x5b472c['params']['id']}},_0x625212={};_0x625212[_0xdcf3('0x2e')]=_[_0xdcf3('0x2b')](db[_0xdcf3('0x3e')][_0xdcf3('0x2a')]);_0x625212[_0xdcf3('0x2f')]=_[_0xdcf3('0x2b')](_0x5b472c[_0xdcf3('0x2f')]);_0x625212['filters']=_[_0xdcf3('0x2d')](_0x625212[_0xdcf3('0x2e')],_0x625212[_0xdcf3('0x2f')]);_0x67b0bf['attributes']=_[_0xdcf3('0x2d')](_0x625212[_0xdcf3('0x2e')],qs['fields'](_0x5b472c[_0xdcf3('0x2f')][_0xdcf3('0x31')]));_0x67b0bf['attributes']=_0x67b0bf[_0xdcf3('0x30')][_0xdcf3('0x43')]?_0x67b0bf[_0xdcf3('0x30')]:_0x625212[_0xdcf3('0x2e')];if(_0x5b472c['query'][_0xdcf3('0x3f')]){_0x67b0bf['include']=[{'all':!![]}];}_0x67b0bf=_[_0xdcf3('0x39')]({},_0x67b0bf,_0x5b472c[_0xdcf3('0x3d')]);return db[_0xdcf3('0x3e')][_0xdcf3('0x44')](_0x67b0bf)[_0xdcf3('0x25')](handleEntityNotFound(_0x318669,null))[_0xdcf3('0x25')](respondWithResult(_0x318669,null))[_0xdcf3('0x45')](handleError(_0x318669,null));};exports[_0xdcf3('0x46')]=function(_0x4e6f44,_0x4a4bae){return db[_0xdcf3('0x3e')][_0xdcf3('0x46')](_0x4e6f44['body'],{})['then'](respondWithResult(_0x4a4bae,0xc9))[_0xdcf3('0x45')](handleError(_0x4a4bae,null));};exports[_0xdcf3('0x23')]=function(_0x162111,_0x2baefa){if(_0x162111[_0xdcf3('0x47')]['id']){delete _0x162111['body']['id'];}return db[_0xdcf3('0x3e')]['find']({'where':{'id':_0x162111['params']['id']}})[_0xdcf3('0x25')](handleEntityNotFound(_0x2baefa,null))[_0xdcf3('0x25')](saveUpdates(_0x162111[_0xdcf3('0x47')],null))[_0xdcf3('0x25')](respondWithResult(_0x2baefa,null))[_0xdcf3('0x45')](handleError(_0x2baefa,null));};exports[_0xdcf3('0x24')]=function(_0x48abd5,_0x1ebf31){return db[_0xdcf3('0x3e')][_0xdcf3('0x44')]({'where':{'id':_0x48abd5[_0xdcf3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ebf31,null))[_0xdcf3('0x25')](removeEntity(_0x1ebf31,null))[_0xdcf3('0x45')](handleError(_0x1ebf31,null));}; \ No newline at end of file +var _0x4b20=['moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','sort','where','filters','map','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x497dc7,_0x7d8da9){var _0x20ba9f=function(_0x21f335){while(--_0x21f335){_0x497dc7['push'](_0x497dc7['shift']());}};_0x20ba9f(++_0x7d8da9);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x04b2('0x0'));var emlformat=require(_0x04b2('0x1'));var rimraf=require(_0x04b2('0x2'));var zipdir=require(_0x04b2('0x3'));var jsonpatch=require(_0x04b2('0x4'));var rp=require(_0x04b2('0x5'));var moment=require(_0x04b2('0x6'));var BPromise=require(_0x04b2('0x7'));var Mustache=require(_0x04b2('0x8'));var util=require(_0x04b2('0x9'));var path=require(_0x04b2('0xa'));var sox=require('sox');var csv=require(_0x04b2('0xb'));var ejs=require(_0x04b2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x04b2('0xd'));var crypto=require(_0x04b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x04b2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x04b2('0x10'));var Papa=require('papaparse');var Redis=require(_0x04b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04b2('0x12'));var hardwareService=require(_0x04b2('0x13'));var logger=require(_0x04b2('0x14'))(_0x04b2('0x15'));var utils=require(_0x04b2('0x16'));var config=require('../../config/environment');var db=require(_0x04b2('0x17'))['db'];function respondWithStatusCode(_0x279746,_0x5f14bf){_0x5f14bf=_0x5f14bf||0xcc;return function(_0xdeb966){if(_0xdeb966){return _0x279746['sendStatus'](_0x5f14bf);}return _0x279746[_0x04b2('0x18')](_0x5f14bf)[_0x04b2('0x19')]();};}function respondWithResult(_0x33d84e,_0x2b55cc){_0x2b55cc=_0x2b55cc||0xc8;return function(_0x5bb357){if(_0x5bb357){return _0x33d84e[_0x04b2('0x18')](_0x2b55cc)[_0x04b2('0x1a')](_0x5bb357);}};}function respondWithFilteredResult(_0x4c290e,_0xf23959){return function(_0x40c3a4){if(_0x40c3a4){var _0x181c2d=_0x40c3a4[_0x04b2('0x1b')],_0x49c773=_0xf23959[_0x04b2('0x1c')],_0xfdda48=_0xf23959[_0x04b2('0x1c')]+_0xf23959[_0x04b2('0x1d')],_0x218557;if(_0xfdda48>=_0x181c2d){_0xfdda48=_0x181c2d;_0x218557=0xc8;}else{_0x218557=0xce;}_0x4c290e['status'](_0x218557);return _0x4c290e['set'](_0x04b2('0x1e'),_0x49c773+'-'+_0xfdda48+'/'+_0x181c2d)[_0x04b2('0x1a')](_0x40c3a4);}return null;};}function patchUpdates(_0x12b009){return function(_0x41526b){try{jsonpatch[_0x04b2('0x1f')](_0x41526b,_0x12b009,!![]);}catch(_0x6dc675){return BPromise[_0x04b2('0x20')](_0x6dc675);}return _0x41526b[_0x04b2('0x21')]();};}function saveUpdates(_0x311b94,_0x16a042){return function(_0x37fdc6){if(_0x37fdc6){return _0x37fdc6[_0x04b2('0x22')](_0x311b94)['then'](function(_0x3cbdd8){return _0x3cbdd8;});}return null;};}function removeEntity(_0x199656,_0x462e77){return function(_0xbe584a){if(_0xbe584a){return _0xbe584a[_0x04b2('0x23')]()[_0x04b2('0x24')](function(){_0x199656[_0x04b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a70a,_0x4eb4e3){return function(_0x1432b8){if(!_0x1432b8){_0x17a70a[_0x04b2('0x25')](0x194);}return _0x1432b8;};}function handleError(_0xe3060f,_0x5f15d3){_0x5f15d3=_0x5f15d3||0x1f4;return function(_0x19d38c){logger[_0x04b2('0x26')](_0x19d38c['stack']);if(_0x19d38c[_0x04b2('0x27')]){delete _0x19d38c[_0x04b2('0x27')];}_0xe3060f[_0x04b2('0x18')](_0x5f15d3)[_0x04b2('0x28')](_0x19d38c);};}exports[_0x04b2('0x29')]=function(_0x39a4ab,_0x4a6f7e){var _0x3433ce={},_0x3b84af={},_0x1fa60d={'count':0x0,'rows':[]};var _0x555320=db[_0x04b2('0x2a')][_0x04b2('0x2b')];_0x3b84af[_0x04b2('0x2c')]=_[_0x04b2('0x2d')](_0x555320);_0x3b84af[_0x04b2('0x2e')]=_[_0x04b2('0x2d')](_0x39a4ab['query']);_0x3b84af['filters']=_['intersection'](_0x3b84af['model'],_0x3b84af[_0x04b2('0x2e')]);_0x3433ce[_0x04b2('0x2f')]=_[_0x04b2('0x30')](_0x3b84af[_0x04b2('0x2c')],qs[_0x04b2('0x31')](_0x39a4ab['query'][_0x04b2('0x31')]));_0x3433ce[_0x04b2('0x2f')]=_0x3433ce[_0x04b2('0x2f')]['length']?_0x3433ce['attributes']:_0x3b84af['model'];if(!_0x39a4ab[_0x04b2('0x2e')][_0x04b2('0x32')]('nolimit')){_0x3433ce['limit']=qs[_0x04b2('0x1d')](_0x39a4ab[_0x04b2('0x2e')][_0x04b2('0x1d')]);_0x3433ce[_0x04b2('0x1c')]=qs['offset'](_0x39a4ab[_0x04b2('0x2e')]['offset']);}_0x3433ce['order']=qs[_0x04b2('0x33')](_0x39a4ab['query'][_0x04b2('0x33')]);_0x3433ce[_0x04b2('0x34')]=qs[_0x04b2('0x35')](_['pick'](_0x39a4ab[_0x04b2('0x2e')],_0x3b84af['filters']));if(_0x39a4ab['query']['filter']){_0x3433ce[_0x04b2('0x34')]=_['merge'](_0x3433ce['where'],{'$or':_[_0x04b2('0x36')](_0x555320,function(_0x34f9bd){if(_0x34f9bd['type'][_0x04b2('0x37')]!==_0x04b2('0x38')){var _0x4cc740={};_0x4cc740[_0x34f9bd[_0x04b2('0x39')]]={'$like':'%'+_0x39a4ab[_0x04b2('0x2e')][_0x04b2('0x3a')]+'%'};return _0x4cc740;}})});}_0x3433ce=_[_0x04b2('0x3b')]({},_0x3433ce,_0x39a4ab[_0x04b2('0x3c')]);var _0x20dc9e={'where':_0x3433ce['where']};return db['VoiceQueuesLog'][_0x04b2('0x1b')](_0x20dc9e)['then'](function(_0x7110c2){_0x1fa60d['count']=_0x7110c2;if(_0x39a4ab['query'][_0x04b2('0x3d')]){_0x3433ce[_0x04b2('0x3e')]=[{'all':!![]}];}return db[_0x04b2('0x2a')][_0x04b2('0x3f')](_0x3433ce);})[_0x04b2('0x24')](function(_0x313d2c){_0x1fa60d['rows']=_0x313d2c;return _0x1fa60d;})[_0x04b2('0x24')](respondWithFilteredResult(_0x4a6f7e,_0x3433ce))[_0x04b2('0x40')](handleError(_0x4a6f7e,null));};exports[_0x04b2('0x41')]=function(_0x5b2897,_0x18ba05){var _0x5ae9ea={'raw':!![],'where':{'id':_0x5b2897[_0x04b2('0x42')]['id']}},_0x1c77f1={};_0x1c77f1[_0x04b2('0x2c')]=_[_0x04b2('0x2d')](db[_0x04b2('0x2a')][_0x04b2('0x2b')]);_0x1c77f1[_0x04b2('0x2e')]=_[_0x04b2('0x2d')](_0x5b2897['query']);_0x1c77f1[_0x04b2('0x35')]=_['intersection'](_0x1c77f1[_0x04b2('0x2c')],_0x1c77f1[_0x04b2('0x2e')]);_0x5ae9ea[_0x04b2('0x2f')]=_[_0x04b2('0x30')](_0x1c77f1[_0x04b2('0x2c')],qs[_0x04b2('0x31')](_0x5b2897['query'][_0x04b2('0x31')]));_0x5ae9ea[_0x04b2('0x2f')]=_0x5ae9ea[_0x04b2('0x2f')][_0x04b2('0x43')]?_0x5ae9ea[_0x04b2('0x2f')]:_0x1c77f1[_0x04b2('0x2c')];if(_0x5b2897[_0x04b2('0x2e')][_0x04b2('0x3d')]){_0x5ae9ea[_0x04b2('0x3e')]=[{'all':!![]}];}_0x5ae9ea=_['merge']({},_0x5ae9ea,_0x5b2897[_0x04b2('0x3c')]);return db[_0x04b2('0x2a')][_0x04b2('0x44')](_0x5ae9ea)[_0x04b2('0x24')](handleEntityNotFound(_0x18ba05,null))[_0x04b2('0x24')](respondWithResult(_0x18ba05,null))[_0x04b2('0x40')](handleError(_0x18ba05,null));};exports[_0x04b2('0x45')]=function(_0x188766,_0x35354e){return db[_0x04b2('0x2a')][_0x04b2('0x45')](_0x188766[_0x04b2('0x46')],{})[_0x04b2('0x24')](respondWithResult(_0x35354e,0xc9))[_0x04b2('0x40')](handleError(_0x35354e,null));};exports[_0x04b2('0x22')]=function(_0x9a90f6,_0x1d1f01){if(_0x9a90f6[_0x04b2('0x46')]['id']){delete _0x9a90f6[_0x04b2('0x46')]['id'];}return db[_0x04b2('0x2a')]['find']({'where':{'id':_0x9a90f6[_0x04b2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d1f01,null))[_0x04b2('0x24')](saveUpdates(_0x9a90f6['body'],null))[_0x04b2('0x24')](respondWithResult(_0x1d1f01,null))[_0x04b2('0x40')](handleError(_0x1d1f01,null));};exports[_0x04b2('0x23')]=function(_0x4d40ec,_0x1d1192){return db[_0x04b2('0x2a')][_0x04b2('0x44')]({'where':{'id':_0x4d40ec['params']['id']}})[_0x04b2('0x24')](handleEntityNotFound(_0x1d1192,null))['then'](removeEntity(_0x1d1192,null))['catch'](handleError(_0x1d1192,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fe9eab4..8215869 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 _0x4347=['VoiceQueuesLog','voice_queues_log','event_dtm','event','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x204e08,_0x36ca59){var _0x4dd55e=function(_0x57a456){while(--_0x57a456){_0x204e08['push'](_0x204e08['shift']());}};_0x4dd55e(++_0x36ca59);}(_0x4347,0xe4));var _0x7434=function(_0x3af017,_0x6b7516){_0x3af017=_0x3af017-0x0;var _0x104228=_0x4347[_0x3af017];return _0x104228;};'use strict';var _=require('lodash');var util=require(_0x7434('0x0'));var logger=require(_0x7434('0x1'))(_0x7434('0x2'));var moment=require(_0x7434('0x3'));var BPromise=require(_0x7434('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7434('0x5'));var config=require(_0x7434('0x6'));var attributes=require(_0x7434('0x7'));module[_0x7434('0x8')]=function(_0x5dab9f,_0x56fd68){return _0x5dab9f[_0x7434('0x9')](_0x7434('0xa'),attributes,{'tableName':_0x7434('0xb'),'paranoid':![],'indexes':[{'name':_0x7434('0xc'),'fields':[_0x7434('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x5a97=['dtm','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event'];(function(_0x1564ba,_0x9e07e5){var _0x47161f=function(_0x30c544){while(--_0x30c544){_0x1564ba['push'](_0x1564ba['shift']());}};_0x47161f(++_0x9e07e5);}(_0x5a97,0x196));var _0x75a9=function(_0x55648b,_0x3e50e9){_0x55648b=_0x55648b-0x0;var _0x483646=_0x5a97[_0x55648b];return _0x483646;};'use strict';var _=require(_0x75a9('0x0'));var util=require('util');var logger=require(_0x75a9('0x1'))(_0x75a9('0x2'));var moment=require('moment');var BPromise=require(_0x75a9('0x3'));var rp=require(_0x75a9('0x4'));var fs=require('fs');var path=require(_0x75a9('0x5'));var rimraf=require(_0x75a9('0x6'));var config=require(_0x75a9('0x7'));var attributes=require(_0x75a9('0x8'));module[_0x75a9('0x9')]=function(_0x44ecab,_0x1df250){return _0x44ecab[_0x75a9('0xa')](_0x75a9('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x75a9('0xc'),'fields':[_0x75a9('0xd'),_0x75a9('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2edb4d1..d825943 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 _0xa006=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util'];(function(_0xf50fb9,_0x1a0fc9){var _0x2d287e=function(_0x3a28f2){while(--_0x3a28f2){_0xf50fb9['push'](_0xf50fb9['shift']());}};_0x2d287e(++_0x1a0fc9);}(_0xa006,0x17a));var _0x6a00=function(_0x257f29,_0x1bbb2a){_0x257f29=_0x257f29-0x0;var _0x5919a3=_0xa006[_0x257f29];return _0x5919a3;};'use strict';var _=require(_0x6a00('0x0'));var util=require(_0x6a00('0x1'));var moment=require(_0x6a00('0x2'));var BPromise=require(_0x6a00('0x3'));var rs=require(_0x6a00('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a00('0x6'))(_0x6a00('0x7'));var config=require(_0x6a00('0x8'));var jayson=require(_0x6a00('0x9'));var client=jayson[_0x6a00('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d45e,_0x2bba9c,_0x27939a){return new BPromise(function(_0x199af7,_0x497c08){return client[_0x6a00('0xb')](_0x16d45e,_0x27939a)[_0x6a00('0xc')](function(_0x227857){logger['info'](_0x6a00('0xd'),_0x2bba9c,_0x6a00('0xe'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2bba9c,'request\x20sent',JSON['stringify'](_0x227857));if(_0x227857[_0x6a00('0xf')]){if(_0x227857[_0x6a00('0xf')][_0x6a00('0x10')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2bba9c,_0x227857[_0x6a00('0xf')][_0x6a00('0x11')]);return _0x497c08(_0x227857[_0x6a00('0xf')][_0x6a00('0x11')]);}logger[_0x6a00('0xf')](_0x6a00('0xd'),_0x2bba9c,_0x227857[_0x6a00('0xf')][_0x6a00('0x11')]);return _0x199af7(_0x227857[_0x6a00('0xf')][_0x6a00('0x11')]);}else{logger['info'](_0x6a00('0xd'),_0x2bba9c,_0x6a00('0xe'));_0x199af7(_0x227857[_0x6a00('0x12')][_0x6a00('0x11')]);}})['catch'](function(_0x1e105e){logger[_0x6a00('0xf')](_0x6a00('0xd'),_0x2bba9c,_0x1e105e);_0x497c08(_0x1e105e);});});} \ No newline at end of file +var _0xa42d=['request\x20sent','debug','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','info'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xa42d,0x1ed));var _0xda42=function(_0x1ce63e,_0x5a8b07){_0x1ce63e=_0x1ce63e-0x0;var _0x13dc68=_0xa42d[_0x1ce63e];return _0x13dc68;};'use strict';var _=require(_0xda42('0x0'));var util=require(_0xda42('0x1'));var moment=require(_0xda42('0x2'));var BPromise=require(_0xda42('0x3'));var rs=require(_0xda42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda42('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda42('0x6'));var config=require('../../config/environment');var jayson=require(_0xda42('0x7'));var client=jayson[_0xda42('0x8')][_0xda42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x454343,_0x1a8153,_0x166f2d){return new BPromise(function(_0x59e052,_0x4caf9c){return client['request'](_0x454343,_0x166f2d)['then'](function(_0x5ea96d){logger[_0xda42('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1a8153,_0xda42('0xb'));logger[_0xda42('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1a8153,_0xda42('0xb'),JSON[_0xda42('0xd')](_0x5ea96d));if(_0x5ea96d[_0xda42('0xe')]){if(_0x5ea96d[_0xda42('0xe')]['code']===0x1f4){logger[_0xda42('0xe')](_0xda42('0xf'),_0x1a8153,_0x5ea96d[_0xda42('0xe')][_0xda42('0x10')]);return _0x4caf9c(_0x5ea96d['error'][_0xda42('0x10')]);}logger[_0xda42('0xe')](_0xda42('0xf'),_0x1a8153,_0x5ea96d[_0xda42('0xe')][_0xda42('0x10')]);return _0x59e052(_0x5ea96d[_0xda42('0xe')][_0xda42('0x10')]);}else{logger[_0xda42('0xa')](_0xda42('0xf'),_0x1a8153,_0xda42('0xb'));_0x59e052(_0x5ea96d[_0xda42('0x11')][_0xda42('0x10')]);}})['catch'](function(_0x291668){logger[_0xda42('0xe')](_0xda42('0xf'),_0x1a8153,_0x291668);_0x4caf9c(_0x291668);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2fcf5b7..f9116f2 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 _0x2121=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/download','download','downloads','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2121,0x1b4));var _0x1212=function(_0x55f4ed,_0x3eb495){_0x55f4ed=_0x55f4ed-0x0;var _0x51e5dd=_0x2121[_0x55f4ed];return _0x51e5dd;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var auth=require(_0x1212('0x4'));var interaction=require(_0x1212('0x5'));var config=require(_0x1212('0x6'));var controller=require('./voiceRecording.controller');router[_0x1212('0x7')]('/',auth['isAuthenticated'](),controller[_0x1212('0x8')]);router[_0x1212('0x7')](_0x1212('0x9'),auth[_0x1212('0xa')](),controller[_0x1212('0xb')]);router[_0x1212('0x7')]('/:id',auth[_0x1212('0xa')](),controller[_0x1212('0xc')]);router[_0x1212('0x7')](_0x1212('0xd'),auth[_0x1212('0xa')](),controller[_0x1212('0xe')]);router['get']('/:id/downloads',controller[_0x1212('0xf')]);router[_0x1212('0x10')]('/',auth[_0x1212('0xa')](),controller[_0x1212('0x11')]);router['put'](_0x1212('0x12'),auth[_0x1212('0xa')](),controller[_0x1212('0x13')]);router[_0x1212('0x14')](_0x1212('0x12'),auth[_0x1212('0xa')](),controller[_0x1212('0x15')]);module[_0x1212('0x16')]=router; \ No newline at end of file +var _0x524a=['create','put','update','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','/:id/downloads'];(function(_0x5c9499,_0x221b1){var _0x1370d4=function(_0x2a077a){while(--_0x2a077a){_0x5c9499['push'](_0x5c9499['shift']());}};_0x1370d4(++_0x221b1);}(_0x524a,0xf5));var _0xa524=function(_0x29ac3f,_0x469ff3){_0x29ac3f=_0x29ac3f-0x0;var _0x474e6e=_0x524a[_0x29ac3f];return _0x474e6e;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var auth=require(_0xa524('0x5'));var interaction=require(_0xa524('0x6'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xa524('0x7')]('/',auth[_0xa524('0x8')](),controller[_0xa524('0x9')]);router['get'](_0xa524('0xa'),auth['isAuthenticated'](),controller[_0xa524('0xb')]);router[_0xa524('0x7')]('/:id',auth[_0xa524('0x8')](),controller[_0xa524('0xc')]);router[_0xa524('0x7')](_0xa524('0xd'),auth[_0xa524('0x8')](),controller['download']);router[_0xa524('0x7')](_0xa524('0xe'),controller['downloads']);router['post']('/',auth[_0xa524('0x8')](),controller[_0xa524('0xf')]);router[_0xa524('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa524('0x11')]);router['delete'](_0xa524('0x12'),auth['isAuthenticated'](),controller[_0xa524('0x13')]);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 c0f2458..1212fcd 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 _0x78d4=['DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports','VIRTUAL','value','extname','STRING','setDataValue','membername','INTEGER'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x78d4,0x138));var _0x478d=function(_0x31c4ac,_0x153d2c){_0x31c4ac=_0x31c4ac-0x0;var _0x1e1228=_0x78d4[_0x31c4ac];return _0x1e1228;};'use strict';var Sequelize=require(_0x478d('0x0'));var moment=require(_0x478d('0x1'));var path=require(_0x478d('0x2'));module[_0x478d('0x3')]={'format':{'type':Sequelize[_0x478d('0x4')],'get':function(){return this['getDataValue'](_0x478d('0x5'))?path[_0x478d('0x6')](this['getDataValue'](_0x478d('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x478d('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x254cf2){if(_0x254cf2){this[_0x478d('0x8')]('channel',_0x254cf2);this[_0x478d('0x8')](_0x478d('0x9'),_0x254cf2['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x478d('0x7')]},'calleridnum':{'type':Sequelize[_0x478d('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x478d('0x7')]},'connectedlinename':{'type':Sequelize[_0x478d('0x7')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x478d('0x7')]},'exten':{'type':Sequelize[_0x478d('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x478d('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x478d('0x7')]},'userDisposition':{'type':Sequelize[_0x478d('0x7')]},'createdAt':{'type':Sequelize[_0x478d('0xb')],'get':function(){return moment(this[_0x478d('0xc')]('createdAt'))[_0x478d('0xd')](_0x478d('0xe'))[_0x478d('0xf')]();}},'updatedAt':{'type':Sequelize[_0x478d('0xb')],'get':function(){return moment(this[_0x478d('0xc')](_0x478d('0x10')))[_0x478d('0xd')](_0x478d('0xe'))[_0x478d('0xf')]();}}}; \ No newline at end of file +var _0x5f49=['STRING','INTEGER','DATE','createdAt','format','updatedAt','toString','sequelize','moment','path','value','extname','getDataValue','channel','split'];(function(_0x48c62e,_0x3d8cd7){var _0x5f3f75=function(_0x33ae84){while(--_0x33ae84){_0x48c62e['push'](_0x48c62e['shift']());}};_0x5f3f75(++_0x3d8cd7);}(_0x5f49,0x1e7));var _0x95f4=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5f49[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x95f4('0x0'));var moment=require(_0x95f4('0x1'));var path=require(_0x95f4('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x95f4('0x3'))?path[_0x95f4('0x4')](this[_0x95f4('0x5')](_0x95f4('0x3'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING'],'set':function(_0x4c60b6){if(_0x4c60b6){this['setDataValue'](_0x95f4('0x6'),_0x4c60b6);this['setDataValue']('membername',_0x4c60b6[_0x95f4('0x7')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x95f4('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x95f4('0x8')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x95f4('0x8')]},'accountcode':{'type':Sequelize[_0x95f4('0x8')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x95f4('0x8')]},'value':{'type':Sequelize[_0x95f4('0x8')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x95f4('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x95f4('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0x95f4('0xa')],'get':function(){return moment(this[_0x95f4('0x5')](_0x95f4('0xb')))[_0x95f4('0xc')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x95f4('0xa')],'get':function(){return moment(this['getDataValue'](_0x95f4('0xd')))[_0x95f4('0xc')]('MM-DD-YYYY\x20HH:mm')[_0x95f4('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index b1f3904..3d1cd7a 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 _0x5507=['findAll','rows','catch','show','params','find','create','body','describe','download','uniqueid','value','existsSync','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','secrets','recording','extname','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','VoiceRecording','rawAttributes','model','keys','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','includeAll','include'];(function(_0x448fd7,_0x3fcefb){var _0x53a94d=function(_0x44a926){while(--_0x44a926){_0x448fd7['push'](_0x448fd7['shift']());}};_0x53a94d(++_0x3fcefb);}(_0x5507,0x1f0));var _0x7550=function(_0x4754fb,_0x47fdd1){_0x4754fb=_0x4754fb-0x0;var _0x48b29d=_0x5507[_0x4754fb];return _0x48b29d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7550('0x0'));var rimraf=require(_0x7550('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7550('0x2'));var rp=require(_0x7550('0x3'));var moment=require(_0x7550('0x4'));var BPromise=require(_0x7550('0x5'));var Mustache=require(_0x7550('0x6'));var util=require(_0x7550('0x7'));var path=require(_0x7550('0x8'));var sox=require('sox');var csv=require(_0x7550('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7550('0xa'));var squel=require(_0x7550('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7550('0x9'));var querystring=require('querystring');var Papa=require(_0x7550('0xc'));var Redis=require(_0x7550('0xd'));var authService=require(_0x7550('0xe'));var qs=require(_0x7550('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7550('0x10'));var utils=require(_0x7550('0x11'));var config=require(_0x7550('0x12'));var db=require(_0x7550('0x13'))['db'];function respondWithStatusCode(_0x44315a,_0x453509){_0x453509=_0x453509||0xcc;return function(_0xbacf35){if(_0xbacf35){return _0x44315a[_0x7550('0x14')](_0x453509);}return _0x44315a['status'](_0x453509)[_0x7550('0x15')]();};}function respondWithResult(_0x5ed2e1,_0x4b3d71){_0x4b3d71=_0x4b3d71||0xc8;return function(_0x4cdcc4){if(_0x4cdcc4){return _0x5ed2e1[_0x7550('0x16')](_0x4b3d71)[_0x7550('0x17')](_0x4cdcc4);}};}function respondWithFilteredResult(_0x211a79,_0x376dcd){return function(_0x46dcde){if(_0x46dcde){var _0x409fa1=_0x46dcde[_0x7550('0x18')],_0x3b62f6=_0x376dcd[_0x7550('0x19')],_0x2ea608=_0x376dcd[_0x7550('0x19')]+_0x376dcd[_0x7550('0x1a')],_0x4b1360;if(_0x2ea608>=_0x409fa1){_0x2ea608=_0x409fa1;_0x4b1360=0xc8;}else{_0x4b1360=0xce;}_0x211a79[_0x7550('0x16')](_0x4b1360);return _0x211a79['set'](_0x7550('0x1b'),_0x3b62f6+'-'+_0x2ea608+'/'+_0x409fa1)['json'](_0x46dcde);}return null;};}function patchUpdates(_0x18a1df){return function(_0x5bfe9f){try{jsonpatch[_0x7550('0x1c')](_0x5bfe9f,_0x18a1df,!![]);}catch(_0x69935){return BPromise[_0x7550('0x1d')](_0x69935);}return _0x5bfe9f[_0x7550('0x1e')]();};}function saveUpdates(_0x3c7f7c,_0x47e504){return function(_0x58087b){if(_0x58087b){return _0x58087b[_0x7550('0x1f')](_0x3c7f7c)[_0x7550('0x20')](function(_0x2be31b){return _0x2be31b;});}return null;};}function removeEntity(_0x1187f2,_0x253c5b){return function(_0x1466f0){if(_0x1466f0){return _0x1466f0[_0x7550('0x21')]()[_0x7550('0x20')](function(){_0x1187f2[_0x7550('0x16')](0xcc)[_0x7550('0x15')]();});}};}function handleEntityNotFound(_0x2a43ab,_0x15aa62){return function(_0x4de6ed){if(!_0x4de6ed){_0x2a43ab[_0x7550('0x14')](0x194);}return _0x4de6ed;};}function handleError(_0x3d1d27,_0xe264a2){_0xe264a2=_0xe264a2||0x1f4;return function(_0x95058b){logger[_0x7550('0x22')](_0x95058b[_0x7550('0x23')]);if(_0x95058b['name']){delete _0x95058b['name'];}_0x3d1d27[_0x7550('0x16')](_0xe264a2)[_0x7550('0x24')](_0x95058b);};}exports[_0x7550('0x25')]=function(_0x3caa69,_0x47cb41){var _0x3c18db={},_0x341f38={},_0x182fba={'count':0x0,'rows':[]};var _0x5c9df1=db[_0x7550('0x26')][_0x7550('0x27')];_0x341f38[_0x7550('0x28')]=_['differenceBy'](_[_0x7550('0x29')](_0x5c9df1),[_0x7550('0x2a')]);_0x341f38[_0x7550('0x2b')]=_[_0x7550('0x29')](_0x3caa69[_0x7550('0x2b')]);_0x341f38[_0x7550('0x2c')]=_[_0x7550('0x2d')](_0x341f38[_0x7550('0x28')],_0x341f38[_0x7550('0x2b')]);_0x3c18db['attributes']=_[_0x7550('0x2d')](_0x341f38[_0x7550('0x28')],qs[_0x7550('0x2e')](_0x3caa69[_0x7550('0x2b')]['fields']));_0x3c18db[_0x7550('0x2f')]=_0x3c18db[_0x7550('0x2f')][_0x7550('0x30')]?_0x3c18db[_0x7550('0x2f')]:_0x341f38['model'];if(!_0x3caa69['query'][_0x7550('0x31')](_0x7550('0x32'))){_0x3c18db['limit']=qs[_0x7550('0x1a')](_0x3caa69[_0x7550('0x2b')][_0x7550('0x1a')]);_0x3c18db[_0x7550('0x19')]=qs[_0x7550('0x19')](_0x3caa69[_0x7550('0x2b')][_0x7550('0x19')]);}_0x3c18db[_0x7550('0x33')]=qs[_0x7550('0x34')](_0x3caa69[_0x7550('0x2b')][_0x7550('0x34')]);_0x3c18db[_0x7550('0x35')]=qs['filters'](_['pick'](_0x3caa69[_0x7550('0x2b')],_0x341f38[_0x7550('0x2c')]));if(_0x3caa69[_0x7550('0x2b')][_0x7550('0x36')]){_0x3c18db[_0x7550('0x35')]=_[_0x7550('0x37')](_0x3c18db[_0x7550('0x35')],{'$or':_['map'](_0x5c9df1,function(_0x367d6c){if(_0x367d6c[_0x7550('0x38')][_0x7550('0x39')]!==_0x7550('0x3a')){var _0x517eec={};_0x517eec[_0x367d6c['field']]={'$like':'%'+_0x3caa69[_0x7550('0x2b')][_0x7550('0x36')]+'%'};return _0x517eec;}})});}_0x3c18db=_[_0x7550('0x37')]({},_0x3c18db,_0x3caa69[_0x7550('0x3b')]);var _0x312555={'where':_0x3c18db['where']};return db['VoiceRecording']['count'](_0x312555)[_0x7550('0x20')](function(_0x5ba1a1){_0x182fba[_0x7550('0x18')]=_0x5ba1a1;if(_0x3caa69['query'][_0x7550('0x3c')]){_0x3c18db[_0x7550('0x3d')]=[{'all':!![]}];}return db[_0x7550('0x26')][_0x7550('0x3e')](_0x3c18db);})['then'](function(_0x22cdcc){_0x182fba[_0x7550('0x3f')]=_0x22cdcc;return _0x182fba;})[_0x7550('0x20')](respondWithFilteredResult(_0x47cb41,_0x3c18db))[_0x7550('0x40')](handleError(_0x47cb41,null));};exports[_0x7550('0x41')]=function(_0xfdaea,_0x473d52){var _0x222a95={'raw':![],'where':{'id':_0xfdaea[_0x7550('0x42')]['id']}},_0x29b941={};_0x29b941[_0x7550('0x28')]=_['keys'](db[_0x7550('0x26')][_0x7550('0x27')]);_0x29b941[_0x7550('0x2b')]=_['keys'](_0xfdaea[_0x7550('0x2b')]);_0x29b941['filters']=_[_0x7550('0x2d')](_0x29b941['model'],_0x29b941[_0x7550('0x2b')]);_0x222a95[_0x7550('0x2f')]=_[_0x7550('0x2d')](_0x29b941[_0x7550('0x28')],qs[_0x7550('0x2e')](_0xfdaea[_0x7550('0x2b')]['fields']));_0x222a95[_0x7550('0x2f')]=_0x222a95['attributes'][_0x7550('0x30')]?_0x222a95[_0x7550('0x2f')]:_0x29b941[_0x7550('0x28')];if(_0xfdaea[_0x7550('0x2b')][_0x7550('0x3c')]){_0x222a95[_0x7550('0x3d')]=[{'all':!![]}];}_0x222a95=_[_0x7550('0x37')]({},_0x222a95,_0xfdaea[_0x7550('0x3b')]);return db['VoiceRecording'][_0x7550('0x43')](_0x222a95)[_0x7550('0x20')](handleEntityNotFound(_0x473d52,null))['then'](respondWithResult(_0x473d52,null))[_0x7550('0x40')](handleError(_0x473d52,null));};exports['create']=function(_0xa6a0cc,_0x2b5462){return db[_0x7550('0x26')][_0x7550('0x44')](_0xa6a0cc['body'],{})[_0x7550('0x20')](respondWithResult(_0x2b5462,0xc9))[_0x7550('0x40')](handleError(_0x2b5462,null));};exports[_0x7550('0x1f')]=function(_0x3f2772,_0x236dc6){if(_0x3f2772[_0x7550('0x45')]['id']){delete _0x3f2772['body']['id'];}return db[_0x7550('0x26')][_0x7550('0x43')]({'where':{'id':_0x3f2772[_0x7550('0x42')]['id']}})[_0x7550('0x20')](handleEntityNotFound(_0x236dc6,null))[_0x7550('0x20')](saveUpdates(_0x3f2772[_0x7550('0x45')],null))[_0x7550('0x20')](respondWithResult(_0x236dc6,null))[_0x7550('0x40')](handleError(_0x236dc6,null));};exports['destroy']=function(_0x53a12e,_0x991591){return db[_0x7550('0x26')][_0x7550('0x43')]({'where':{'id':_0x53a12e[_0x7550('0x42')]['id']}})[_0x7550('0x20')](handleEntityNotFound(_0x991591,null))[_0x7550('0x20')](removeEntity(_0x991591,null))['catch'](handleError(_0x991591,null));};exports[_0x7550('0x46')]=function(_0x1c95e5,_0x16419e){return db[_0x7550('0x26')][_0x7550('0x46')]()[_0x7550('0x20')](respondWithResult(_0x16419e,null))[_0x7550('0x40')](handleError(_0x16419e,null));};exports[_0x7550('0x47')]=function(_0x2ddc3e,_0x37dfee,_0x2ac229){var _0x453001=require('../../components/encryptor');var _0x1de779=![];var _0x2cdf82={};if(_0x2ddc3e['query']['type']&&_0x2ddc3e[_0x7550('0x2b')][_0x7550('0x38')]===_0x7550('0x48')){_0x2cdf82[_0x7550('0x48')]=_0x2ddc3e[_0x7550('0x42')]['id'];}else{_0x2cdf82['id']=_0x2ddc3e['params']['id'];}return db['VoiceRecording'][_0x7550('0x43')]({'where':_0x2cdf82,'attributes':['id',_0x7550('0x49')],'raw':!![]})[_0x7550('0x20')](handleEntityNotFound(_0x37dfee,null))[_0x7550('0x20')](function(_0x2ed793){if(_0x2ed793){var _0x32d456=_0x2ed793[_0x7550('0x49')];var _0x53990c=util['format']('%s.cypher',_0x32d456);if(fs[_0x7550('0x4a')](_0x53990c)){_0x1de779=!![];return _0x453001[_0x7550('0x4b')](_0x53990c,_0x32d456,config['secrets']['recording'])[_0x7550('0x20')](function(){return _0x2ed793;});}return _0x2ed793;}})[_0x7550('0x20')](function(_0x3c0e9a){if(_0x3c0e9a){var _0x968b5d=_0x3c0e9a[_0x7550('0x49')];if(!fs[_0x7550('0x4a')](_0x968b5d)){throw new db[(_0x7550('0x4c'))][(_0x7550('0x4d'))](_0x7550('0x4e'));}if(_0x3c0e9a[_0x7550('0x4f')]){return _0x37dfee[_0x7550('0x47')](_0x968b5d,_0x3c0e9a[_0x7550('0x4f')]+path['extname'](_0x968b5d),function(){if(_0x1de779){fs['unlink'](_0x968b5d);}});}else{return _0x37dfee[_0x7550('0x47')](_0x968b5d,function(_0x212b16){if(_0x1de779){fs['unlink'](_0x968b5d);}});}}})[_0x7550('0x40')](function(_0x4e60ac){if(_0x4e60ac[_0x7550('0x50')]===_0x7550('0x4e')){_0x37dfee['status'](0x194)[_0x7550('0x24')](_0x7550('0x51'));}else{return handleError(_0x37dfee,null);}});};exports[_0x7550('0x52')]=function(_0x35ff10,_0x505cb3,_0x2eaba5){var _0x321862=require('../../components/encryptor');var _0x4297d8=![];var _0x62e300={'$and':[db[_0x7550('0x53')]['where'](db[_0x7550('0x53')]['fn'](_0x7550('0x54'),db['sequelize'][_0x7550('0x55')]('uniqueid')),_0x35ff10['query'][_0x7550('0x56')])]};if(_0x35ff10[_0x7550('0x2b')]['type']&&_0x35ff10[_0x7550('0x2b')]['type']===_0x7550('0x48')){_0x62e300[_0x7550('0x57')][_0x7550('0x58')]({'uniqueid':_0x35ff10[_0x7550('0x42')]['id']});}else{_0x62e300['$and']['push']({'id':_0x35ff10[_0x7550('0x42')]['id']});}return db[_0x7550('0x26')]['find']({'where':_0x62e300,'attributes':['id','value'],'raw':!![]})[_0x7550('0x20')](handleEntityNotFound(_0x505cb3,null))[_0x7550('0x20')](function(_0x359f17){if(_0x359f17){var _0x8e83cc=util[_0x7550('0x2a')](_0x7550('0x59'),_0x359f17['value']);if(fs[_0x7550('0x4a')](_0x8e83cc)){_0x4297d8=!![];return _0x321862[_0x7550('0x4b')](_0x8e83cc,_0x359f17[_0x7550('0x49')],config[_0x7550('0x5a')][_0x7550('0x5b')])[_0x7550('0x20')](function(){return _0x359f17;});}return _0x359f17;}})[_0x7550('0x20')](function(_0x2efcc1){if(_0x2efcc1){if(!fs[_0x7550('0x4a')](_0x2efcc1[_0x7550('0x49')])){throw new db['Sequelize'][(_0x7550('0x4d'))](_0x7550('0x4e'));}if(_0x2efcc1[_0x7550('0x4f')]){return _0x505cb3[_0x7550('0x47')](_0x2efcc1['value'],_0x2efcc1[_0x7550('0x4f')]+path[_0x7550('0x5c')](_0x2efcc1[_0x7550('0x49')]),function(){if(_0x4297d8){fs['unlink'](_0x2efcc1[_0x7550('0x49')]);}});}else{return _0x505cb3[_0x7550('0x47')](_0x2efcc1['value'],function(_0x20daa4){if(_0x4297d8){fs['unlink'](_0x2efcc1[_0x7550('0x49')]);}});}}})['catch'](handleError(_0x505cb3,null));}; \ No newline at end of file +var _0x6bda=['token','$and','push','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','set','reject','save','update','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','merge','map','key','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','download','type','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','MD5','sequelize'];(function(_0x11253b,_0x378867){var _0x173931=function(_0x7a688f){while(--_0x7a688f){_0x11253b['push'](_0x11253b['shift']());}};_0x173931(++_0x378867);}(_0x6bda,0x177));var _0xa6bd=function(_0x34a721,_0x4f8fe8){_0x34a721=_0x34a721-0x0;var _0x3b6740=_0x6bda[_0x34a721];return _0x3b6740;};'use strict';var pdf=require(_0xa6bd('0x0'));var emlformat=require(_0xa6bd('0x1'));var rimraf=require(_0xa6bd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6bd('0x3'));var rp=require(_0xa6bd('0x4'));var moment=require(_0xa6bd('0x5'));var BPromise=require(_0xa6bd('0x6'));var Mustache=require(_0xa6bd('0x7'));var util=require(_0xa6bd('0x8'));var path=require(_0xa6bd('0x9'));var sox=require(_0xa6bd('0xa'));var csv=require('to-csv');var ejs=require(_0xa6bd('0xb'));var fs=require('fs');var _=require(_0xa6bd('0xc'));var squel=require(_0xa6bd('0xd'));var crypto=require('crypto');var jsforce=require(_0xa6bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa6bd('0xf'));var querystring=require(_0xa6bd('0x10'));var Papa=require(_0xa6bd('0x11'));var Redis=require(_0xa6bd('0x12'));var authService=require(_0xa6bd('0x13'));var qs=require(_0xa6bd('0x14'));var hardwareService=require(_0xa6bd('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa6bd('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5eca27,_0x5b05a9){_0x5b05a9=_0x5b05a9||0xcc;return function(_0x37726a){if(_0x37726a){return _0x5eca27[_0xa6bd('0x17')](_0x5b05a9);}return _0x5eca27[_0xa6bd('0x18')](_0x5b05a9)[_0xa6bd('0x19')]();};}function respondWithResult(_0x241c3b,_0x503659){_0x503659=_0x503659||0xc8;return function(_0x341cda){if(_0x341cda){return _0x241c3b[_0xa6bd('0x18')](_0x503659)[_0xa6bd('0x1a')](_0x341cda);}};}function respondWithFilteredResult(_0xbb1a92,_0x28e336){return function(_0x4abb8a){if(_0x4abb8a){var _0x4f9042=_0x4abb8a['count'],_0x161b71=_0x28e336[_0xa6bd('0x1b')],_0x2ad49e=_0x28e336['offset']+_0x28e336['limit'],_0xea8174;if(_0x2ad49e>=_0x4f9042){_0x2ad49e=_0x4f9042;_0xea8174=0xc8;}else{_0xea8174=0xce;}_0xbb1a92[_0xa6bd('0x18')](_0xea8174);return _0xbb1a92[_0xa6bd('0x1c')]('Content-Range',_0x161b71+'-'+_0x2ad49e+'/'+_0x4f9042)[_0xa6bd('0x1a')](_0x4abb8a);}return null;};}function patchUpdates(_0xbf9f4){return function(_0x1ad360){try{jsonpatch['apply'](_0x1ad360,_0xbf9f4,!![]);}catch(_0x172e4c){return BPromise[_0xa6bd('0x1d')](_0x172e4c);}return _0x1ad360[_0xa6bd('0x1e')]();};}function saveUpdates(_0x2681a2,_0x212eb4){return function(_0x1bda41){if(_0x1bda41){return _0x1bda41[_0xa6bd('0x1f')](_0x2681a2)[_0xa6bd('0x20')](function(_0x3657e1){return _0x3657e1;});}return null;};}function removeEntity(_0x114062,_0x58d06f){return function(_0x34938b){if(_0x34938b){return _0x34938b[_0xa6bd('0x21')]()[_0xa6bd('0x20')](function(){_0x114062[_0xa6bd('0x18')](0xcc)[_0xa6bd('0x19')]();});}};}function handleEntityNotFound(_0x1b8393,_0x319486){return function(_0x403e48){if(!_0x403e48){_0x1b8393['sendStatus'](0x194);}return _0x403e48;};}function handleError(_0x57c820,_0x48a110){_0x48a110=_0x48a110||0x1f4;return function(_0x27e6c0){logger['error'](_0x27e6c0[_0xa6bd('0x22')]);if(_0x27e6c0[_0xa6bd('0x23')]){delete _0x27e6c0[_0xa6bd('0x23')];}_0x57c820[_0xa6bd('0x18')](_0x48a110)[_0xa6bd('0x24')](_0x27e6c0);};}exports[_0xa6bd('0x25')]=function(_0xb939c0,_0x26ea24){var _0x248188={},_0x14052e={},_0x349c30={'count':0x0,'rows':[]};var _0x2470b9=db[_0xa6bd('0x26')][_0xa6bd('0x27')];_0x14052e[_0xa6bd('0x28')]=_['differenceBy'](_['keys'](_0x2470b9),['format']);_0x14052e[_0xa6bd('0x29')]=_[_0xa6bd('0x2a')](_0xb939c0[_0xa6bd('0x29')]);_0x14052e[_0xa6bd('0x2b')]=_[_0xa6bd('0x2c')](_0x14052e[_0xa6bd('0x28')],_0x14052e[_0xa6bd('0x29')]);_0x248188['attributes']=_[_0xa6bd('0x2c')](_0x14052e['model'],qs[_0xa6bd('0x2d')](_0xb939c0[_0xa6bd('0x29')][_0xa6bd('0x2d')]));_0x248188[_0xa6bd('0x2e')]=_0x248188[_0xa6bd('0x2e')]['length']?_0x248188[_0xa6bd('0x2e')]:_0x14052e[_0xa6bd('0x28')];if(!_0xb939c0[_0xa6bd('0x29')][_0xa6bd('0x2f')]('nolimit')){_0x248188[_0xa6bd('0x30')]=qs[_0xa6bd('0x30')](_0xb939c0['query'][_0xa6bd('0x30')]);_0x248188[_0xa6bd('0x1b')]=qs[_0xa6bd('0x1b')](_0xb939c0['query'][_0xa6bd('0x1b')]);}_0x248188['order']=qs[_0xa6bd('0x31')](_0xb939c0[_0xa6bd('0x29')][_0xa6bd('0x31')]);_0x248188[_0xa6bd('0x32')]=qs[_0xa6bd('0x2b')](_[_0xa6bd('0x33')](_0xb939c0[_0xa6bd('0x29')],_0x14052e['filters']));if(_0xb939c0[_0xa6bd('0x29')]['filter']){_0x248188[_0xa6bd('0x32')]=_[_0xa6bd('0x34')](_0x248188['where'],{'$or':_[_0xa6bd('0x35')](_0x2470b9,function(_0x532cca){if(_0x532cca['type'][_0xa6bd('0x36')]!==_0xa6bd('0x37')){var _0x344c46={};_0x344c46[_0x532cca['field']]={'$like':'%'+_0xb939c0[_0xa6bd('0x29')][_0xa6bd('0x38')]+'%'};return _0x344c46;}})});}_0x248188=_[_0xa6bd('0x34')]({},_0x248188,_0xb939c0[_0xa6bd('0x39')]);var _0x46842b={'where':_0x248188[_0xa6bd('0x32')]};return db[_0xa6bd('0x26')][_0xa6bd('0x3a')](_0x46842b)[_0xa6bd('0x20')](function(_0x40f0dd){_0x349c30[_0xa6bd('0x3a')]=_0x40f0dd;if(_0xb939c0[_0xa6bd('0x29')][_0xa6bd('0x3b')]){_0x248188[_0xa6bd('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa6bd('0x3d')](_0x248188);})[_0xa6bd('0x20')](function(_0x537f8d){_0x349c30[_0xa6bd('0x3e')]=_0x537f8d;return _0x349c30;})[_0xa6bd('0x20')](respondWithFilteredResult(_0x26ea24,_0x248188))['catch'](handleError(_0x26ea24,null));};exports[_0xa6bd('0x3f')]=function(_0x5d1869,_0x2a73c0){var _0x147697={'raw':![],'where':{'id':_0x5d1869[_0xa6bd('0x40')]['id']}},_0xf01c={};_0xf01c[_0xa6bd('0x28')]=_[_0xa6bd('0x2a')](db[_0xa6bd('0x26')][_0xa6bd('0x27')]);_0xf01c['query']=_[_0xa6bd('0x2a')](_0x5d1869[_0xa6bd('0x29')]);_0xf01c[_0xa6bd('0x2b')]=_['intersection'](_0xf01c[_0xa6bd('0x28')],_0xf01c['query']);_0x147697[_0xa6bd('0x2e')]=_[_0xa6bd('0x2c')](_0xf01c[_0xa6bd('0x28')],qs[_0xa6bd('0x2d')](_0x5d1869[_0xa6bd('0x29')][_0xa6bd('0x2d')]));_0x147697[_0xa6bd('0x2e')]=_0x147697['attributes']['length']?_0x147697[_0xa6bd('0x2e')]:_0xf01c[_0xa6bd('0x28')];if(_0x5d1869['query'][_0xa6bd('0x3b')]){_0x147697['include']=[{'all':!![]}];}_0x147697=_[_0xa6bd('0x34')]({},_0x147697,_0x5d1869[_0xa6bd('0x39')]);return db['VoiceRecording'][_0xa6bd('0x41')](_0x147697)[_0xa6bd('0x20')](handleEntityNotFound(_0x2a73c0,null))[_0xa6bd('0x20')](respondWithResult(_0x2a73c0,null))['catch'](handleError(_0x2a73c0,null));};exports[_0xa6bd('0x42')]=function(_0x8b58fa,_0x459ab8){return db[_0xa6bd('0x26')][_0xa6bd('0x42')](_0x8b58fa['body'],{})['then'](respondWithResult(_0x459ab8,0xc9))['catch'](handleError(_0x459ab8,null));};exports[_0xa6bd('0x1f')]=function(_0x459ff4,_0x4007cf){if(_0x459ff4[_0xa6bd('0x43')]['id']){delete _0x459ff4[_0xa6bd('0x43')]['id'];}return db['VoiceRecording'][_0xa6bd('0x41')]({'where':{'id':_0x459ff4[_0xa6bd('0x40')]['id']}})[_0xa6bd('0x20')](handleEntityNotFound(_0x4007cf,null))[_0xa6bd('0x20')](saveUpdates(_0x459ff4[_0xa6bd('0x43')],null))['then'](respondWithResult(_0x4007cf,null))['catch'](handleError(_0x4007cf,null));};exports[_0xa6bd('0x21')]=function(_0xd5c3d1,_0xe99ed8){return db[_0xa6bd('0x26')][_0xa6bd('0x41')]({'where':{'id':_0xd5c3d1[_0xa6bd('0x40')]['id']}})[_0xa6bd('0x20')](handleEntityNotFound(_0xe99ed8,null))[_0xa6bd('0x20')](removeEntity(_0xe99ed8,null))[_0xa6bd('0x44')](handleError(_0xe99ed8,null));};exports[_0xa6bd('0x45')]=function(_0x3a4ea0,_0x52f3fd){return db['VoiceRecording'][_0xa6bd('0x45')]()['then'](respondWithResult(_0x52f3fd,null))[_0xa6bd('0x44')](handleError(_0x52f3fd,null));};exports[_0xa6bd('0x46')]=function(_0x782f49,_0x191dec,_0x5ddc2e){var _0x2afd1a=require('../../components/encryptor');var _0xebaafb=![];var _0x4460d6={};if(_0x782f49[_0xa6bd('0x29')][_0xa6bd('0x47')]&&_0x782f49[_0xa6bd('0x29')][_0xa6bd('0x47')]===_0xa6bd('0x48')){_0x4460d6['uniqueid']=_0x782f49[_0xa6bd('0x40')]['id'];}else{_0x4460d6['id']=_0x782f49[_0xa6bd('0x40')]['id'];}return db[_0xa6bd('0x26')][_0xa6bd('0x41')]({'where':_0x4460d6,'attributes':['id','value'],'raw':!![]})[_0xa6bd('0x20')](handleEntityNotFound(_0x191dec,null))[_0xa6bd('0x20')](function(_0x539c50){if(_0x539c50){var _0x397300=_0x539c50[_0xa6bd('0x49')];var _0x2d5725=util[_0xa6bd('0x4a')](_0xa6bd('0x4b'),_0x397300);if(fs[_0xa6bd('0x4c')](_0x2d5725)){_0xebaafb=!![];return _0x2afd1a[_0xa6bd('0x4d')](_0x2d5725,_0x397300,config[_0xa6bd('0x4e')][_0xa6bd('0x4f')])[_0xa6bd('0x20')](function(){return _0x539c50;});}return _0x539c50;}})[_0xa6bd('0x20')](function(_0x257daa){if(_0x257daa){var _0x5d2dbc=_0x257daa[_0xa6bd('0x49')];if(!fs[_0xa6bd('0x4c')](_0x5d2dbc)){throw new db[(_0xa6bd('0x50'))][(_0xa6bd('0x51'))](_0xa6bd('0x52'));}if(_0x257daa[_0xa6bd('0x53')]){return _0x191dec[_0xa6bd('0x46')](_0x5d2dbc,_0x257daa[_0xa6bd('0x53')]+path[_0xa6bd('0x54')](_0x5d2dbc),function(){if(_0xebaafb){fs[_0xa6bd('0x55')](_0x5d2dbc);}});}else{return _0x191dec[_0xa6bd('0x46')](_0x5d2dbc,function(_0x1d5693){if(_0xebaafb){fs['unlink'](_0x5d2dbc);}});}}})[_0xa6bd('0x44')](function(_0x53ee11){if(_0x53ee11[_0xa6bd('0x56')]===_0xa6bd('0x52')){_0x191dec[_0xa6bd('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x191dec,null);}});};exports[_0xa6bd('0x57')]=function(_0x4396e2,_0x3ade3f,_0x3568a5){var _0x313b47=require('../../components/encryptor');var _0x26dbdd=![];var _0x40b518={'$and':[db['sequelize'][_0xa6bd('0x32')](db['sequelize']['fn'](_0xa6bd('0x58'),db[_0xa6bd('0x59')]['col'](_0xa6bd('0x48'))),_0x4396e2[_0xa6bd('0x29')][_0xa6bd('0x5a')])]};if(_0x4396e2[_0xa6bd('0x29')]['type']&&_0x4396e2[_0xa6bd('0x29')][_0xa6bd('0x47')]===_0xa6bd('0x48')){_0x40b518[_0xa6bd('0x5b')][_0xa6bd('0x5c')]({'uniqueid':_0x4396e2[_0xa6bd('0x40')]['id']});}else{_0x40b518[_0xa6bd('0x5b')][_0xa6bd('0x5c')]({'id':_0x4396e2[_0xa6bd('0x40')]['id']});}return db[_0xa6bd('0x26')][_0xa6bd('0x41')]({'where':_0x40b518,'attributes':['id',_0xa6bd('0x49')],'raw':!![]})[_0xa6bd('0x20')](handleEntityNotFound(_0x3ade3f,null))[_0xa6bd('0x20')](function(_0x576e0e){if(_0x576e0e){var _0x32fa37=util[_0xa6bd('0x4a')](_0xa6bd('0x4b'),_0x576e0e[_0xa6bd('0x49')]);if(fs[_0xa6bd('0x4c')](_0x32fa37)){_0x26dbdd=!![];return _0x313b47[_0xa6bd('0x4d')](_0x32fa37,_0x576e0e[_0xa6bd('0x49')],config[_0xa6bd('0x4e')][_0xa6bd('0x4f')])[_0xa6bd('0x20')](function(){return _0x576e0e;});}return _0x576e0e;}})[_0xa6bd('0x20')](function(_0xa9cd8d){if(_0xa9cd8d){if(!fs['existsSync'](_0xa9cd8d[_0xa6bd('0x49')])){throw new db[(_0xa6bd('0x50'))][(_0xa6bd('0x51'))](_0xa6bd('0x52'));}if(_0xa9cd8d[_0xa6bd('0x53')]){return _0x3ade3f[_0xa6bd('0x46')](_0xa9cd8d[_0xa6bd('0x49')],_0xa9cd8d[_0xa6bd('0x53')]+path[_0xa6bd('0x54')](_0xa9cd8d[_0xa6bd('0x49')]),function(){if(_0x26dbdd){fs[_0xa6bd('0x55')](_0xa9cd8d[_0xa6bd('0x49')]);}});}else{return _0x3ade3f['download'](_0xa9cd8d[_0xa6bd('0x49')],function(_0x58734f){if(_0x26dbdd){fs[_0xa6bd('0x55')](_0xa9cd8d[_0xa6bd('0x49')]);}});}}})[_0xa6bd('0x44')](handleError(_0x3ade3f,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7af86ff..47e0f04 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 _0xa021=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash'];(function(_0x46c4e7,_0x4f0fc0){var _0xd5f852=function(_0x447c87){while(--_0x447c87){_0x46c4e7['push'](_0x46c4e7['shift']());}};_0xd5f852(++_0x4f0fc0);}(_0xa021,0x1bb));var _0x1a02=function(_0x24f08d,_0x19ae14){_0x24f08d=_0x24f08d-0x0;var _0x1233ed=_0xa021[_0x24f08d];return _0x1233ed;};'use strict';var _=require(_0x1a02('0x0'));var util=require('util');var logger=require(_0x1a02('0x1'))('api');var moment=require(_0x1a02('0x2'));var BPromise=require(_0x1a02('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a02('0x4'));var rimraf=require(_0x1a02('0x5'));var config=require(_0x1a02('0x6'));var attributes=require(_0x1a02('0x7'));module[_0x1a02('0x8')]=function(_0x5ebd31,_0x139097){return _0x5ebd31[_0x1a02('0x9')]('VoiceRecording',attributes,{'tableName':_0x1a02('0xa'),'paranoid':![],'indexes':[{'name':_0x1a02('0xb'),'fields':[_0x1a02('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d32=['request-promise','exports','VoiceRecording','voice_recordings','uniqueid','api','moment','bluebird'];(function(_0x2cd760,_0x5f2687){var _0x5fa0db=function(_0x404131){while(--_0x404131){_0x2cd760['push'](_0x2cd760['shift']());}};_0x5fa0db(++_0x5f2687);}(_0x3d32,0x12d));var _0x23d3=function(_0x5412c9,_0x3749b2){_0x5412c9=_0x5412c9-0x0;var _0x28b95e=_0x3d32[_0x5412c9];return _0x28b95e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x23d3('0x0'));var moment=require(_0x23d3('0x1'));var BPromise=require(_0x23d3('0x2'));var rp=require(_0x23d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0x23d3('0x4')]=function(_0x3e8239,_0x4a404a){return _0x3e8239['define'](_0x23d3('0x5'),attributes,{'tableName':_0x23d3('0x6'),'paranoid':![],'indexes':[{'name':_0x23d3('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index e6a0066..5037fb8 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 _0xcb50=['randomstring','ioredis','../../config/logger','../../config/environment','client','request','then','request\x20sent','debug','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','VoiceRecording','update','body','options','raw','where','attributes','limit','info','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','unlink','CreateVoiceRecording\x20file\x20encrypted','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb50,0x92));var _0x0cb5=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xcb50[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x0cb5('0x0'));var util=require(_0x0cb5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0cb5('0x2'));var fs=require('fs');var Redis=require(_0x0cb5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0cb5('0x4'))('rpc');var config=require(_0x0cb5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0cb5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55c74d,_0x5a5443,_0x4f2468){return new BPromise(function(_0x3f8a44,_0x1d0443){return client[_0x0cb5('0x7')](_0x55c74d,_0x4f2468)[_0x0cb5('0x8')](function(_0x44d852){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a5443,_0x0cb5('0x9'));logger[_0x0cb5('0xa')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5a5443,'request\x20sent',JSON[_0x0cb5('0xb')](_0x44d852));if(_0x44d852[_0x0cb5('0xc')]){if(_0x44d852[_0x0cb5('0xc')]['code']===0x1f4){logger[_0x0cb5('0xc')](_0x0cb5('0xd'),_0x5a5443,_0x44d852[_0x0cb5('0xc')][_0x0cb5('0xe')]);return _0x1d0443(_0x44d852[_0x0cb5('0xc')]['message']);}logger[_0x0cb5('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x5a5443,_0x44d852[_0x0cb5('0xc')][_0x0cb5('0xe')]);return _0x3f8a44(_0x44d852[_0x0cb5('0xc')][_0x0cb5('0xe')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a5443,'request\x20sent');_0x3f8a44(_0x44d852[_0x0cb5('0xf')][_0x0cb5('0xe')]);}})['catch'](function(_0x4f2e51){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a5443,_0x4f2e51);_0x1d0443(_0x4f2e51);});});}exports['UpdateVoiceRecording']=function(_0x7be4c0){var _0x4446bc=this;return new Promise(function(_0x22c9ba,_0x5aa38d){return db[_0x0cb5('0x10')][_0x0cb5('0x11')](_0x7be4c0[_0x0cb5('0x12')],{'raw':_0x7be4c0[_0x0cb5('0x13')]?_0x7be4c0[_0x0cb5('0x13')][_0x0cb5('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7be4c0[_0x0cb5('0x13')]?_0x7be4c0[_0x0cb5('0x13')][_0x0cb5('0x15')]||null:null,'attributes':_0x7be4c0[_0x0cb5('0x13')]?_0x7be4c0['options'][_0x0cb5('0x16')]||null:null,'limit':_0x7be4c0[_0x0cb5('0x13')]?_0x7be4c0['options'][_0x0cb5('0x17')]||null:null})['then'](function(_0x905b3d){logger[_0x0cb5('0x18')](_0x0cb5('0x19'),_0x7be4c0);logger[_0x0cb5('0xa')](_0x0cb5('0x19'),_0x7be4c0,JSON['stringify'](_0x905b3d));_0x22c9ba(_0x905b3d);})['catch'](function(_0x16313b){logger[_0x0cb5('0xc')](_0x0cb5('0x19'),_0x16313b[_0x0cb5('0xe')],_0x7be4c0);_0x5aa38d(_0x4446bc['error'](0x1f4,_0x16313b[_0x0cb5('0xe')]));});});};exports[_0x0cb5('0x1a')]=function(_0x37b5bc){var _0x5e7f41=this;return new Promise(function(_0x2bef3e,_0x533543){var _0x559d16=require(_0x0cb5('0x1b'));var _0x4ebb1f;return db[_0x0cb5('0x1c')][_0x0cb5('0x1d')]({'attributes':['id',_0x0cb5('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0cb5('0x8')](function(_0x1ea751){_0x4ebb1f=_0x1ea751;return db[_0x0cb5('0x10')][_0x0cb5('0x1f')](_0x37b5bc[_0x0cb5('0x12')]);})[_0x0cb5('0x8')](function(_0x36515e){if(_0x4ebb1f[_0x0cb5('0x1e')]&&fs[_0x0cb5('0x20')](_0x36515e[_0x0cb5('0x21')])){var _0x4d8ab0=util['format']('%s.cypher',_0x36515e['value']);return _0x559d16['encryptFile'](_0x36515e['value'],_0x4d8ab0,config['secrets']['recording'])[_0x0cb5('0x8')](function(){fs[_0x0cb5('0x22')](_0x36515e['value']);logger[_0x0cb5('0x18')](_0x0cb5('0x23'));return _0x36515e;});}return _0x36515e;})[_0x0cb5('0x8')](function(_0x151397){logger[_0x0cb5('0x18')]('CreateVoiceRecording',_0x37b5bc);logger[_0x0cb5('0xa')](_0x0cb5('0x1a'),_0x37b5bc,JSON['stringify'](_0x151397));_0x2bef3e(_0x151397);})[_0x0cb5('0x24')](function(_0x319c08){logger[_0x0cb5('0xc')]('CreateVoiceRecording',_0x319c08[_0x0cb5('0xe')],_0x37b5bc);_0x533543(_0x5e7f41[_0x0cb5('0xc')](0x1f4,_0x319c08[_0x0cb5('0xe')]));});});}; \ No newline at end of file +var _0xa715=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','VoiceRecording','create','callRecordingEncryption','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b9aa1,_0x455e2a){var _0x188653=function(_0xcfe568){while(--_0xcfe568){_0x3b9aa1['push'](_0x3b9aa1['shift']());}};_0x188653(++_0x455e2a);}(_0xa715,0xdb));var _0x5a71=function(_0x40f47a,_0xa744f3){_0x40f47a=_0x40f47a-0x0;var _0x5a152c=_0xa715[_0x40f47a];return _0x5a152c;};'use strict';var _=require(_0x5a71('0x0'));var util=require(_0x5a71('0x1'));var moment=require(_0x5a71('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a71('0x3'));var db=require(_0x5a71('0x4'))['db'];var utils=require(_0x5a71('0x5'));var logger=require(_0x5a71('0x6'))(_0x5a71('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a71('0x8'));var client=jayson[_0x5a71('0x9')][_0x5a71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2061ad,_0x51f680,_0x216b38){return new BPromise(function(_0x2c267b,_0x444e94){return client[_0x5a71('0xb')](_0x2061ad,_0x216b38)[_0x5a71('0xc')](function(_0x56b02c){logger[_0x5a71('0xd')](_0x5a71('0xe'),_0x51f680,_0x5a71('0xf'));logger[_0x5a71('0x10')](_0x5a71('0x11'),_0x51f680,'request\x20sent',JSON[_0x5a71('0x12')](_0x56b02c));if(_0x56b02c[_0x5a71('0x13')]){if(_0x56b02c[_0x5a71('0x13')][_0x5a71('0x14')]===0x1f4){logger[_0x5a71('0x13')](_0x5a71('0xe'),_0x51f680,_0x56b02c[_0x5a71('0x13')][_0x5a71('0x15')]);return _0x444e94(_0x56b02c[_0x5a71('0x13')][_0x5a71('0x15')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x51f680,_0x56b02c[_0x5a71('0x13')][_0x5a71('0x15')]);return _0x2c267b(_0x56b02c['error'][_0x5a71('0x15')]);}else{logger[_0x5a71('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x51f680,_0x5a71('0xf'));_0x2c267b(_0x56b02c[_0x5a71('0x16')][_0x5a71('0x15')]);}})[_0x5a71('0x17')](function(_0x55c887){logger[_0x5a71('0x13')](_0x5a71('0xe'),_0x51f680,_0x55c887);_0x444e94(_0x55c887);});});}exports[_0x5a71('0x18')]=function(_0x4f9928){var _0x2a5a27=this;return new Promise(function(_0x510c0b,_0x5cb1f3){return db['VoiceRecording'][_0x5a71('0x19')](_0x4f9928[_0x5a71('0x1a')],{'raw':_0x4f9928[_0x5a71('0x1b')]?_0x4f9928['options'][_0x5a71('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f9928[_0x5a71('0x1b')]?_0x4f9928[_0x5a71('0x1b')][_0x5a71('0x1d')]||null:null,'attributes':_0x4f9928[_0x5a71('0x1b')]?_0x4f9928[_0x5a71('0x1b')][_0x5a71('0x1e')]||null:null,'limit':_0x4f9928[_0x5a71('0x1b')]?_0x4f9928['options'][_0x5a71('0x1f')]||null:null})[_0x5a71('0xc')](function(_0x100e6f){logger['info'](_0x5a71('0x18'),_0x4f9928);logger['debug'](_0x5a71('0x18'),_0x4f9928,JSON['stringify'](_0x100e6f));_0x510c0b(_0x100e6f);})['catch'](function(_0x27d2af){logger[_0x5a71('0x13')](_0x5a71('0x18'),_0x27d2af[_0x5a71('0x15')],_0x4f9928);_0x5cb1f3(_0x2a5a27[_0x5a71('0x13')](0x1f4,_0x27d2af[_0x5a71('0x15')]));});});};exports[_0x5a71('0x20')]=function(_0x503425){var _0x5eb1c8=this;return new Promise(function(_0x459bfe,_0x53c26e){var _0x465f05=require('../../components/encryptor');var _0x265a8b;return db[_0x5a71('0x21')][_0x5a71('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5a71('0xc')](function(_0x1e8649){_0x265a8b=_0x1e8649;return db[_0x5a71('0x23')][_0x5a71('0x24')](_0x503425[_0x5a71('0x1a')]);})[_0x5a71('0xc')](function(_0x5e50b7){if(_0x265a8b[_0x5a71('0x25')]&&fs[_0x5a71('0x26')](_0x5e50b7['value'])){var _0x2e6d11=util['format']('%s.cypher',_0x5e50b7[_0x5a71('0x27')]);return _0x465f05[_0x5a71('0x28')](_0x5e50b7[_0x5a71('0x27')],_0x2e6d11,config[_0x5a71('0x29')][_0x5a71('0x2a')])[_0x5a71('0xc')](function(){fs[_0x5a71('0x2b')](_0x5e50b7[_0x5a71('0x27')]);logger[_0x5a71('0xd')](_0x5a71('0x2c'));return _0x5e50b7;});}return _0x5e50b7;})['then'](function(_0xed4418){logger[_0x5a71('0xd')](_0x5a71('0x20'),_0x503425);logger[_0x5a71('0x10')](_0x5a71('0x20'),_0x503425,JSON[_0x5a71('0x12')](_0xed4418));_0x459bfe(_0xed4418);})[_0x5a71('0x17')](function(_0x235474){logger['error'](_0x5a71('0x20'),_0x235474['message'],_0x503425);_0x53c26e(_0x5eb1c8[_0x5a71('0x13')](0x1f4,_0x235474[_0x5a71('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index d59a131..8d198b8 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 _0x7e98=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x567293,_0x2ee95){var _0x4c8f9d=function(_0x2477f5){while(--_0x2477f5){_0x567293['push'](_0x567293['shift']());}};_0x4c8f9d(++_0x2ee95);}(_0x7e98,0x1eb));var _0x87e9=function(_0x526997,_0x5905ed){_0x526997=_0x526997-0x0;var _0x1bebdb=_0x7e98[_0x526997];return _0x1bebdb;};'use strict';var multer=require(_0x87e9('0x0'));var util=require(_0x87e9('0x1'));var path=require(_0x87e9('0x2'));var timeout=require(_0x87e9('0x3'));var express=require('express');var router=express[_0x87e9('0x4')]();var auth=require(_0x87e9('0x5'));var interaction=require(_0x87e9('0x6'));var config=require(_0x87e9('0x7'));var controller=require(_0x87e9('0x8'));router[_0x87e9('0x9')]('/',auth[_0x87e9('0xa')](),controller['index']);router[_0x87e9('0x9')](_0x87e9('0xb'),auth['isAuthenticated'](),controller[_0x87e9('0xc')]);router[_0x87e9('0xd')]('/',auth[_0x87e9('0xa')](),controller['create']);router[_0x87e9('0xe')](_0x87e9('0xb'),auth[_0x87e9('0xa')](),controller[_0x87e9('0xf')]);router[_0x87e9('0x10')](_0x87e9('0xb'),auth[_0x87e9('0xa')](),controller[_0x87e9('0x11')]);module[_0x87e9('0x12')]=router; \ No newline at end of file +var _0x856a=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','create','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x37a5ea,_0x3ae755){var _0x57de45=function(_0x20be92){while(--_0x20be92){_0x37a5ea['push'](_0x37a5ea['shift']());}};_0x57de45(++_0x3ae755);}(_0x856a,0xda));var _0xa856=function(_0x37142a,_0x17b42c){_0x37142a=_0x37142a-0x0;var _0x6bb89a=_0x856a[_0x37142a];return _0x6bb89a;};'use strict';var multer=require(_0xa856('0x0'));var util=require(_0xa856('0x1'));var path=require(_0xa856('0x2'));var timeout=require(_0xa856('0x3'));var express=require(_0xa856('0x4'));var router=express[_0xa856('0x5')]();var auth=require(_0xa856('0x6'));var interaction=require(_0xa856('0x7'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xa856('0x8')]('/',auth['isAuthenticated'](),controller[_0xa856('0x9')]);router[_0xa856('0x8')](_0xa856('0xa'),auth[_0xa856('0xb')](),controller[_0xa856('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa856('0xd')]);router['put']('/:id',auth[_0xa856('0xb')](),controller[_0xa856('0xe')]);router['delete'](_0xa856('0xa'),auth['isAuthenticated'](),controller[_0xa856('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 195ec0d..4d4330b 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 _0xf183=['exports','ENUM','blind','STRING','Yes','sequelize','moment'];(function(_0x420858,_0x49e074){var _0x57bbad=function(_0x4c984b){while(--_0x4c984b){_0x420858['push'](_0x420858['shift']());}};_0x57bbad(++_0x49e074);}(_0xf183,0xa6));var _0x3f18=function(_0x2c879b,_0x20d6e1){_0x2c879b=_0x2c879b-0x0;var _0x23cf8d=_0xf183[_0x2c879b];return _0x23cf8d;};'use strict';var Sequelize=require(_0x3f18('0x0'));var moment=require(_0x3f18('0x1'));module[_0x3f18('0x2')]={'type':{'type':Sequelize[_0x3f18('0x3')](_0x3f18('0x4'),'attended')},'result':{'type':Sequelize[_0x3f18('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x3f18('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x3f18('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x3f18('0x5')]},'transferercontext':{'type':Sequelize[_0x3f18('0x5')]},'transfererexten':{'type':Sequelize[_0x3f18('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x3f18('0x5')]},'transfereechannel':{'type':Sequelize[_0x3f18('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x3f18('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x3f18('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x3f18('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x3f18('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x3f18('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x3f18('0x5')]},'isexternal':{'type':Sequelize[_0x3f18('0x3')](_0x3f18('0x6'),'No')},'context':{'type':Sequelize[_0x3f18('0x5')]},'extension':{'type':Sequelize[_0x3f18('0x5')]}}; \ No newline at end of file +var _0x4612=['moment','exports','ENUM','blind','STRING','Yes','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4612,0xdf));var _0x2461=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x4612[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0x2461('0x0'));var moment=require(_0x2461('0x1'));module[_0x2461('0x2')]={'type':{'type':Sequelize[_0x2461('0x3')](_0x2461('0x4'),'attended')},'result':{'type':Sequelize[_0x2461('0x5')]},'transfererchannel':{'type':Sequelize[_0x2461('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x2461('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2461('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2461('0x5')]},'transferercontext':{'type':Sequelize[_0x2461('0x5')]},'transfererexten':{'type':Sequelize[_0x2461('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x2461('0x5')]},'transfereechannel':{'type':Sequelize[_0x2461('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2461('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2461('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x2461('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x2461('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2461('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x2461('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2461('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 2894eff..146b00a 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 _0x4c76=['order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','then','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','reject','save','update','sendStatus','stack','send','VoiceTransferReport','rawAttributes','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit'];(function(_0x32509b,_0xcffd0b){var _0x5be917=function(_0x2901ff){while(--_0x2901ff){_0x32509b['push'](_0x32509b['shift']());}};_0x5be917(++_0xcffd0b);}(_0x4c76,0xa4));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x64c7('0x0'));var emlformat=require(_0x64c7('0x1'));var rimraf=require(_0x64c7('0x2'));var zipdir=require(_0x64c7('0x3'));var jsonpatch=require(_0x64c7('0x4'));var rp=require(_0x64c7('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x64c7('0x6'));var util=require('util');var path=require(_0x64c7('0x7'));var sox=require(_0x64c7('0x8'));var csv=require(_0x64c7('0x9'));var ejs=require(_0x64c7('0xa'));var fs=require('fs');var _=require(_0x64c7('0xb'));var squel=require(_0x64c7('0xc'));var crypto=require(_0x64c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x64c7('0xe'));var toCsv=require(_0x64c7('0x9'));var querystring=require(_0x64c7('0xf'));var Papa=require(_0x64c7('0x10'));var Redis=require(_0x64c7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64c7('0x12'));var hardwareService=require(_0x64c7('0x13'));var logger=require('../../config/logger')(_0x64c7('0x14'));var utils=require(_0x64c7('0x15'));var config=require('../../config/environment');var db=require(_0x64c7('0x16'))['db'];function respondWithStatusCode(_0x32e102,_0x1500a3){_0x1500a3=_0x1500a3||0xcc;return function(_0x4b88ce){if(_0x4b88ce){return _0x32e102['sendStatus'](_0x1500a3);}return _0x32e102[_0x64c7('0x17')](_0x1500a3)[_0x64c7('0x18')]();};}function respondWithResult(_0x424253,_0xd82153){_0xd82153=_0xd82153||0xc8;return function(_0x4052c5){if(_0x4052c5){return _0x424253[_0x64c7('0x17')](_0xd82153)[_0x64c7('0x19')](_0x4052c5);}};}function respondWithFilteredResult(_0x3a9875,_0x2ec226){return function(_0x10c156){if(_0x10c156){var _0x367533=_0x10c156[_0x64c7('0x1a')],_0x4f3e49=_0x2ec226[_0x64c7('0x1b')],_0x171064=_0x2ec226['offset']+_0x2ec226[_0x64c7('0x1c')],_0x50c65f;if(_0x171064>=_0x367533){_0x171064=_0x367533;_0x50c65f=0xc8;}else{_0x50c65f=0xce;}_0x3a9875[_0x64c7('0x17')](_0x50c65f);return _0x3a9875[_0x64c7('0x1d')]('Content-Range',_0x4f3e49+'-'+_0x171064+'/'+_0x367533)['json'](_0x10c156);}return null;};}function patchUpdates(_0x162499){return function(_0x1297eb){try{jsonpatch['apply'](_0x1297eb,_0x162499,!![]);}catch(_0x495603){return BPromise[_0x64c7('0x1e')](_0x495603);}return _0x1297eb[_0x64c7('0x1f')]();};}function saveUpdates(_0x1ac483,_0x5665a8){return function(_0x2786e8){if(_0x2786e8){return _0x2786e8[_0x64c7('0x20')](_0x1ac483)['then'](function(_0xe9a956){return _0xe9a956;});}return null;};}function removeEntity(_0x3f7928,_0x2a7272){return function(_0x23da64){if(_0x23da64){return _0x23da64['destroy']()['then'](function(){_0x3f7928[_0x64c7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d213,_0x4589f2){return function(_0x175b37){if(!_0x175b37){_0x58d213[_0x64c7('0x21')](0x194);}return _0x175b37;};}function handleError(_0x1651dd,_0x80fab3){_0x80fab3=_0x80fab3||0x1f4;return function(_0x567174){logger['error'](_0x567174[_0x64c7('0x22')]);if(_0x567174['name']){delete _0x567174['name'];}_0x1651dd['status'](_0x80fab3)[_0x64c7('0x23')](_0x567174);};}exports['index']=function(_0x73cfa5,_0x20c5f8){var _0xb70775={},_0x221797={},_0x46c02f={'count':0x0,'rows':[]};var _0x514f30=db[_0x64c7('0x24')][_0x64c7('0x25')];_0x221797[_0x64c7('0x26')]=_[_0x64c7('0x27')](_0x514f30);_0x221797['query']=_[_0x64c7('0x27')](_0x73cfa5['query']);_0x221797[_0x64c7('0x28')]=_['intersection'](_0x221797[_0x64c7('0x26')],_0x221797[_0x64c7('0x29')]);_0xb70775[_0x64c7('0x2a')]=_['intersection'](_0x221797[_0x64c7('0x26')],qs[_0x64c7('0x2b')](_0x73cfa5[_0x64c7('0x29')][_0x64c7('0x2b')]));_0xb70775[_0x64c7('0x2a')]=_0xb70775[_0x64c7('0x2a')]['length']?_0xb70775['attributes']:_0x221797[_0x64c7('0x26')];if(!_0x73cfa5[_0x64c7('0x29')][_0x64c7('0x2c')](_0x64c7('0x2d'))){_0xb70775[_0x64c7('0x1c')]=qs[_0x64c7('0x1c')](_0x73cfa5['query'][_0x64c7('0x1c')]);_0xb70775[_0x64c7('0x1b')]=qs['offset'](_0x73cfa5[_0x64c7('0x29')][_0x64c7('0x1b')]);}_0xb70775[_0x64c7('0x2e')]=qs[_0x64c7('0x2f')](_0x73cfa5[_0x64c7('0x29')][_0x64c7('0x2f')]);_0xb70775[_0x64c7('0x30')]=qs[_0x64c7('0x28')](_[_0x64c7('0x31')](_0x73cfa5[_0x64c7('0x29')],_0x221797[_0x64c7('0x28')]));if(_0x73cfa5[_0x64c7('0x29')][_0x64c7('0x32')]){_0xb70775['where']=_[_0x64c7('0x33')](_0xb70775[_0x64c7('0x30')],{'$or':_['map'](_0x514f30,function(_0x289d86){if(_0x289d86[_0x64c7('0x34')]['key']!==_0x64c7('0x35')){var _0x1bbb06={};_0x1bbb06[_0x289d86[_0x64c7('0x36')]]={'$like':'%'+_0x73cfa5['query'][_0x64c7('0x32')]+'%'};return _0x1bbb06;}})});}_0xb70775=_['merge']({},_0xb70775,_0x73cfa5[_0x64c7('0x37')]);var _0x5056ed={'where':_0xb70775[_0x64c7('0x30')]};return db[_0x64c7('0x24')][_0x64c7('0x1a')](_0x5056ed)[_0x64c7('0x38')](function(_0x972a36){_0x46c02f[_0x64c7('0x1a')]=_0x972a36;if(_0x73cfa5['query'][_0x64c7('0x39')]){_0xb70775[_0x64c7('0x3a')]=[{'all':!![]}];}return db[_0x64c7('0x24')][_0x64c7('0x3b')](_0xb70775);})[_0x64c7('0x38')](function(_0x4cae90){_0x46c02f[_0x64c7('0x3c')]=_0x4cae90;return _0x46c02f;})['then'](respondWithFilteredResult(_0x20c5f8,_0xb70775))['catch'](handleError(_0x20c5f8,null));};exports[_0x64c7('0x3d')]=function(_0x332165,_0x3e7727){var _0x15d782={'raw':!![],'where':{'id':_0x332165[_0x64c7('0x3e')]['id']}},_0x45f1f6={};_0x45f1f6[_0x64c7('0x26')]=_['keys'](db[_0x64c7('0x24')]['rawAttributes']);_0x45f1f6[_0x64c7('0x29')]=_['keys'](_0x332165[_0x64c7('0x29')]);_0x45f1f6['filters']=_['intersection'](_0x45f1f6[_0x64c7('0x26')],_0x45f1f6['query']);_0x15d782['attributes']=_[_0x64c7('0x3f')](_0x45f1f6[_0x64c7('0x26')],qs[_0x64c7('0x2b')](_0x332165[_0x64c7('0x29')][_0x64c7('0x2b')]));_0x15d782[_0x64c7('0x2a')]=_0x15d782[_0x64c7('0x2a')][_0x64c7('0x40')]?_0x15d782[_0x64c7('0x2a')]:_0x45f1f6[_0x64c7('0x26')];if(_0x332165[_0x64c7('0x29')]['includeAll']){_0x15d782[_0x64c7('0x3a')]=[{'all':!![]}];}_0x15d782=_[_0x64c7('0x33')]({},_0x15d782,_0x332165[_0x64c7('0x37')]);return db['VoiceTransferReport'][_0x64c7('0x41')](_0x15d782)[_0x64c7('0x38')](handleEntityNotFound(_0x3e7727,null))[_0x64c7('0x38')](respondWithResult(_0x3e7727,null))[_0x64c7('0x42')](handleError(_0x3e7727,null));};exports['create']=function(_0x243348,_0x461dfd){return db[_0x64c7('0x24')][_0x64c7('0x43')](_0x243348['body'],{})[_0x64c7('0x38')](respondWithResult(_0x461dfd,0xc9))[_0x64c7('0x42')](handleError(_0x461dfd,null));};exports['update']=function(_0x7da878,_0x28d156){if(_0x7da878[_0x64c7('0x44')]['id']){delete _0x7da878[_0x64c7('0x44')]['id'];}return db['VoiceTransferReport'][_0x64c7('0x41')]({'where':{'id':_0x7da878[_0x64c7('0x3e')]['id']}})['then'](handleEntityNotFound(_0x28d156,null))[_0x64c7('0x38')](saveUpdates(_0x7da878['body'],null))[_0x64c7('0x38')](respondWithResult(_0x28d156,null))[_0x64c7('0x42')](handleError(_0x28d156,null));};exports[_0x64c7('0x45')]=function(_0x27da17,_0x3019dc){return db[_0x64c7('0x24')][_0x64c7('0x41')]({'where':{'id':_0x27da17['params']['id']}})[_0x64c7('0x38')](handleEntityNotFound(_0x3019dc,null))[_0x64c7('0x38')](removeEntity(_0x3019dc,null))[_0x64c7('0x42')](handleError(_0x3019dc,null));}; \ No newline at end of file +var _0x8f18=['merge','map','type','key','options','count','includeAll','findAll','show','params','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter'];(function(_0x3730f0,_0x5aa641){var _0x893d7e=function(_0x1dabf8){while(--_0x1dabf8){_0x3730f0['push'](_0x3730f0['shift']());}};_0x893d7e(++_0x5aa641);}(_0x8f18,0xe4));var _0x88f1=function(_0x34456c,_0x43fd77){_0x34456c=_0x34456c-0x0;var _0x525079=_0x8f18[_0x34456c];return _0x525079;};'use strict';var pdf=require(_0x88f1('0x0'));var emlformat=require(_0x88f1('0x1'));var rimraf=require(_0x88f1('0x2'));var zipdir=require(_0x88f1('0x3'));var jsonpatch=require(_0x88f1('0x4'));var rp=require('request-promise');var moment=require(_0x88f1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x88f1('0x6'));var path=require(_0x88f1('0x7'));var sox=require(_0x88f1('0x8'));var csv=require(_0x88f1('0x9'));var ejs=require(_0x88f1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x88f1('0xb'));var crypto=require(_0x88f1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x88f1('0xd'));var toCsv=require(_0x88f1('0x9'));var querystring=require(_0x88f1('0xe'));var Papa=require(_0x88f1('0xf'));var Redis=require(_0x88f1('0x10'));var authService=require(_0x88f1('0x11'));var qs=require(_0x88f1('0x12'));var hardwareService=require(_0x88f1('0x13'));var logger=require('../../config/logger')(_0x88f1('0x14'));var utils=require(_0x88f1('0x15'));var config=require(_0x88f1('0x16'));var db=require(_0x88f1('0x17'))['db'];function respondWithStatusCode(_0x1bd7b4,_0x1e0b6d){_0x1e0b6d=_0x1e0b6d||0xcc;return function(_0x282da7){if(_0x282da7){return _0x1bd7b4['sendStatus'](_0x1e0b6d);}return _0x1bd7b4[_0x88f1('0x18')](_0x1e0b6d)[_0x88f1('0x19')]();};}function respondWithResult(_0x38b4f2,_0x389ef7){_0x389ef7=_0x389ef7||0xc8;return function(_0x126c43){if(_0x126c43){return _0x38b4f2[_0x88f1('0x18')](_0x389ef7)[_0x88f1('0x1a')](_0x126c43);}};}function respondWithFilteredResult(_0x15664d,_0x580c14){return function(_0x1837e0){if(_0x1837e0){var _0x2319e5=_0x1837e0['count'],_0xaac240=_0x580c14['offset'],_0x435ba8=_0x580c14[_0x88f1('0x1b')]+_0x580c14[_0x88f1('0x1c')],_0x2bd79c;if(_0x435ba8>=_0x2319e5){_0x435ba8=_0x2319e5;_0x2bd79c=0xc8;}else{_0x2bd79c=0xce;}_0x15664d[_0x88f1('0x18')](_0x2bd79c);return _0x15664d[_0x88f1('0x1d')](_0x88f1('0x1e'),_0xaac240+'-'+_0x435ba8+'/'+_0x2319e5)[_0x88f1('0x1a')](_0x1837e0);}return null;};}function patchUpdates(_0x21ff7f){return function(_0x3f4916){try{jsonpatch[_0x88f1('0x1f')](_0x3f4916,_0x21ff7f,!![]);}catch(_0x1e4a46){return BPromise[_0x88f1('0x20')](_0x1e4a46);}return _0x3f4916[_0x88f1('0x21')]();};}function saveUpdates(_0x120e53,_0x2d1c94){return function(_0x2f5bfd){if(_0x2f5bfd){return _0x2f5bfd[_0x88f1('0x22')](_0x120e53)[_0x88f1('0x23')](function(_0x320296){return _0x320296;});}return null;};}function removeEntity(_0x45c842,_0x3bcb50){return function(_0x1a76c3){if(_0x1a76c3){return _0x1a76c3['destroy']()[_0x88f1('0x23')](function(){_0x45c842[_0x88f1('0x18')](0xcc)[_0x88f1('0x19')]();});}};}function handleEntityNotFound(_0x5a7842,_0x740b25){return function(_0x31febf){if(!_0x31febf){_0x5a7842[_0x88f1('0x24')](0x194);}return _0x31febf;};}function handleError(_0x3497e1,_0x84ecd6){_0x84ecd6=_0x84ecd6||0x1f4;return function(_0x42d617){logger[_0x88f1('0x25')](_0x42d617['stack']);if(_0x42d617['name']){delete _0x42d617[_0x88f1('0x26')];}_0x3497e1[_0x88f1('0x18')](_0x84ecd6)[_0x88f1('0x27')](_0x42d617);};}exports[_0x88f1('0x28')]=function(_0x8d3dec,_0x50494b){var _0x45c1cd={},_0x5bb163={},_0x18cbcd={'count':0x0,'rows':[]};var _0x30f7a0=db[_0x88f1('0x29')][_0x88f1('0x2a')];_0x5bb163[_0x88f1('0x2b')]=_[_0x88f1('0x2c')](_0x30f7a0);_0x5bb163[_0x88f1('0x2d')]=_[_0x88f1('0x2c')](_0x8d3dec[_0x88f1('0x2d')]);_0x5bb163['filters']=_[_0x88f1('0x2e')](_0x5bb163['model'],_0x5bb163[_0x88f1('0x2d')]);_0x45c1cd['attributes']=_[_0x88f1('0x2e')](_0x5bb163[_0x88f1('0x2b')],qs[_0x88f1('0x2f')](_0x8d3dec['query']['fields']));_0x45c1cd[_0x88f1('0x30')]=_0x45c1cd[_0x88f1('0x30')][_0x88f1('0x31')]?_0x45c1cd[_0x88f1('0x30')]:_0x5bb163[_0x88f1('0x2b')];if(!_0x8d3dec[_0x88f1('0x2d')]['hasOwnProperty'](_0x88f1('0x32'))){_0x45c1cd[_0x88f1('0x1c')]=qs[_0x88f1('0x1c')](_0x8d3dec[_0x88f1('0x2d')][_0x88f1('0x1c')]);_0x45c1cd[_0x88f1('0x1b')]=qs[_0x88f1('0x1b')](_0x8d3dec[_0x88f1('0x2d')][_0x88f1('0x1b')]);}_0x45c1cd[_0x88f1('0x33')]=qs['sort'](_0x8d3dec['query'][_0x88f1('0x34')]);_0x45c1cd[_0x88f1('0x35')]=qs[_0x88f1('0x36')](_['pick'](_0x8d3dec['query'],_0x5bb163[_0x88f1('0x36')]));if(_0x8d3dec['query'][_0x88f1('0x37')]){_0x45c1cd[_0x88f1('0x35')]=_[_0x88f1('0x38')](_0x45c1cd[_0x88f1('0x35')],{'$or':_[_0x88f1('0x39')](_0x30f7a0,function(_0x5c4b52){if(_0x5c4b52[_0x88f1('0x3a')][_0x88f1('0x3b')]!=='VIRTUAL'){var _0x2a8b9b={};_0x2a8b9b[_0x5c4b52['field']]={'$like':'%'+_0x8d3dec['query'][_0x88f1('0x37')]+'%'};return _0x2a8b9b;}})});}_0x45c1cd=_['merge']({},_0x45c1cd,_0x8d3dec[_0x88f1('0x3c')]);var _0x54da3d={'where':_0x45c1cd[_0x88f1('0x35')]};return db[_0x88f1('0x29')]['count'](_0x54da3d)[_0x88f1('0x23')](function(_0x339884){_0x18cbcd[_0x88f1('0x3d')]=_0x339884;if(_0x8d3dec[_0x88f1('0x2d')][_0x88f1('0x3e')]){_0x45c1cd['include']=[{'all':!![]}];}return db[_0x88f1('0x29')][_0x88f1('0x3f')](_0x45c1cd);})[_0x88f1('0x23')](function(_0x378c69){_0x18cbcd['rows']=_0x378c69;return _0x18cbcd;})[_0x88f1('0x23')](respondWithFilteredResult(_0x50494b,_0x45c1cd))['catch'](handleError(_0x50494b,null));};exports[_0x88f1('0x40')]=function(_0xfe7ae8,_0x463e94){var _0x446459={'raw':!![],'where':{'id':_0xfe7ae8[_0x88f1('0x41')]['id']}},_0x175192={};_0x175192[_0x88f1('0x2b')]=_['keys'](db['VoiceTransferReport'][_0x88f1('0x2a')]);_0x175192[_0x88f1('0x2d')]=_[_0x88f1('0x2c')](_0xfe7ae8['query']);_0x175192[_0x88f1('0x36')]=_[_0x88f1('0x2e')](_0x175192[_0x88f1('0x2b')],_0x175192[_0x88f1('0x2d')]);_0x446459[_0x88f1('0x30')]=_[_0x88f1('0x2e')](_0x175192[_0x88f1('0x2b')],qs[_0x88f1('0x2f')](_0xfe7ae8[_0x88f1('0x2d')][_0x88f1('0x2f')]));_0x446459[_0x88f1('0x30')]=_0x446459['attributes']['length']?_0x446459[_0x88f1('0x30')]:_0x175192[_0x88f1('0x2b')];if(_0xfe7ae8['query'][_0x88f1('0x3e')]){_0x446459['include']=[{'all':!![]}];}_0x446459=_[_0x88f1('0x38')]({},_0x446459,_0xfe7ae8['options']);return db[_0x88f1('0x29')][_0x88f1('0x42')](_0x446459)[_0x88f1('0x23')](handleEntityNotFound(_0x463e94,null))[_0x88f1('0x23')](respondWithResult(_0x463e94,null))[_0x88f1('0x43')](handleError(_0x463e94,null));};exports[_0x88f1('0x44')]=function(_0x7d7920,_0x10aee3){return db[_0x88f1('0x29')][_0x88f1('0x44')](_0x7d7920[_0x88f1('0x45')],{})[_0x88f1('0x23')](respondWithResult(_0x10aee3,0xc9))['catch'](handleError(_0x10aee3,null));};exports['update']=function(_0x4a1619,_0x19ed57){if(_0x4a1619[_0x88f1('0x45')]['id']){delete _0x4a1619[_0x88f1('0x45')]['id'];}return db['VoiceTransferReport'][_0x88f1('0x42')]({'where':{'id':_0x4a1619[_0x88f1('0x41')]['id']}})[_0x88f1('0x23')](handleEntityNotFound(_0x19ed57,null))[_0x88f1('0x23')](saveUpdates(_0x4a1619[_0x88f1('0x45')],null))[_0x88f1('0x23')](respondWithResult(_0x19ed57,null))['catch'](handleError(_0x19ed57,null));};exports[_0x88f1('0x46')]=function(_0x33b9aa,_0x2941c7){return db['VoiceTransferReport']['find']({'where':{'id':_0x33b9aa[_0x88f1('0x41')]['id']}})['then'](handleEntityNotFound(_0x2941c7,null))[_0x88f1('0x23')](removeEntity(_0x2941c7,null))[_0x88f1('0x43')](handleError(_0x2941c7,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index f680e11..6cef683 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 _0x6b53=['bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api'];(function(_0x460da6,_0x2ba7bd){var _0x445808=function(_0x338dcc){while(--_0x338dcc){_0x460da6['push'](_0x460da6['shift']());}};_0x445808(++_0x2ba7bd);}(_0x6b53,0x105));var _0x36b5=function(_0x40271c,_0x3f60f9){_0x40271c=_0x40271c-0x0;var _0xdcb1e1=_0x6b53[_0x40271c];return _0xdcb1e1;};'use strict';var _=require('lodash');var util=require(_0x36b5('0x0'));var logger=require(_0x36b5('0x1'))(_0x36b5('0x2'));var moment=require('moment');var BPromise=require(_0x36b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36b5('0x4'));var rimraf=require(_0x36b5('0x5'));var config=require(_0x36b5('0x6'));var attributes=require(_0x36b5('0x7'));module[_0x36b5('0x8')]=function(_0x5f5647,_0x383983){return _0x5f5647[_0x36b5('0x9')](_0x36b5('0xa'),attributes,{'tableName':_0x36b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36b8=['bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','../../config/logger','api','moment'];(function(_0x35f0dc,_0x59f3c0){var _0xc83d9a=function(_0x4875fd){while(--_0x4875fd){_0x35f0dc['push'](_0x35f0dc['shift']());}};_0xc83d9a(++_0x59f3c0);}(_0x36b8,0x1b5));var _0x836b=function(_0x25a6bf,_0x27b659){_0x25a6bf=_0x25a6bf-0x0;var _0x2d9084=_0x36b8[_0x25a6bf];return _0x2d9084;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x836b('0x0'))(_0x836b('0x1'));var moment=require(_0x836b('0x2'));var BPromise=require(_0x836b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x836b('0x4'));var config=require(_0x836b('0x5'));var attributes=require(_0x836b('0x6'));module[_0x836b('0x7')]=function(_0xf97387,_0xab7677){return _0xf97387['define'](_0x836b('0x8'),attributes,{'tableName':_0x836b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 310edef..89ebe7d 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 _0x3336=['create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0x310da2,_0x181858){var _0x12bc21=function(_0x559fe7){while(--_0x559fe7){_0x310da2['push'](_0x310da2['shift']());}};_0x12bc21(++_0x181858);}(_0x3336,0x1a8));var _0x6333=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x3336[_0xe3e0af];return _0x4828e9;};'use strict';var _=require(_0x6333('0x0'));var util=require(_0x6333('0x1'));var moment=require(_0x6333('0x2'));var BPromise=require(_0x6333('0x3'));var rs=require(_0x6333('0x4'));var fs=require('fs');var Redis=require(_0x6333('0x5'));var db=require(_0x6333('0x6'))['db'];var utils=require(_0x6333('0x7'));var logger=require('../../config/logger')(_0x6333('0x8'));var config=require(_0x6333('0x9'));var jayson=require(_0x6333('0xa'));var client=jayson[_0x6333('0xb')][_0x6333('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36b586,_0x142452,_0x5963e2){return new BPromise(function(_0x322fdd,_0x5d0d62){return client[_0x6333('0xd')](_0x36b586,_0x5963e2)[_0x6333('0xe')](function(_0x56eeed){logger[_0x6333('0xf')](_0x6333('0x10'),_0x142452,'request\x20sent');logger[_0x6333('0x11')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x142452,'request\x20sent',JSON[_0x6333('0x12')](_0x56eeed));if(_0x56eeed[_0x6333('0x13')]){if(_0x56eeed[_0x6333('0x13')][_0x6333('0x14')]===0x1f4){logger[_0x6333('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x142452,_0x56eeed[_0x6333('0x13')][_0x6333('0x15')]);return _0x5d0d62(_0x56eeed[_0x6333('0x13')][_0x6333('0x15')]);}logger['error'](_0x6333('0x10'),_0x142452,_0x56eeed[_0x6333('0x13')][_0x6333('0x15')]);return _0x322fdd(_0x56eeed[_0x6333('0x13')][_0x6333('0x15')]);}else{logger['info'](_0x6333('0x10'),_0x142452,_0x6333('0x16'));_0x322fdd(_0x56eeed[_0x6333('0x17')][_0x6333('0x15')]);}})['catch'](function(_0x534197){logger[_0x6333('0x13')](_0x6333('0x10'),_0x142452,_0x534197);_0x5d0d62(_0x534197);});});}exports[_0x6333('0x18')]=function(_0x274171){var _0x300772=this;return new Promise(function(_0x2300aa,_0x410f4b){return db[_0x6333('0x19')][_0x6333('0x1a')](_0x274171[_0x6333('0x1b')],{'raw':_0x274171[_0x6333('0x1c')]?_0x274171[_0x6333('0x1c')][_0x6333('0x1d')]===undefined?!![]:![]:!![]})[_0x6333('0xe')](function(_0x4e7cec){logger[_0x6333('0xf')](_0x6333('0x18'),_0x274171);logger[_0x6333('0x11')](_0x6333('0x18'),_0x274171,JSON[_0x6333('0x12')](_0x4e7cec));_0x2300aa(_0x4e7cec);})['catch'](function(_0x142b66){logger['error'](_0x6333('0x18'),_0x142b66[_0x6333('0x15')],_0x274171);_0x410f4b(_0x300772[_0x6333('0x13')](0x1f4,_0x142b66[_0x6333('0x15')]));});});}; \ No newline at end of file +var _0x29c8=['http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x52f8f7,_0x2edb20){var _0x52e18b=function(_0x2b2d46){while(--_0x2b2d46){_0x52f8f7['push'](_0x52f8f7['shift']());}};_0x52e18b(++_0x2edb20);}(_0x29c8,0x1c1));var _0x829c=function(_0x4f4bf2,_0x6b4372){_0x4f4bf2=_0x4f4bf2-0x0;var _0x3d96e1=_0x29c8[_0x4f4bf2];return _0x3d96e1;};'use strict';var _=require('lodash');var util=require(_0x829c('0x0'));var moment=require(_0x829c('0x1'));var BPromise=require(_0x829c('0x2'));var rs=require(_0x829c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x829c('0x4'))['db'];var utils=require(_0x829c('0x5'));var logger=require(_0x829c('0x6'))(_0x829c('0x7'));var config=require('../../config/environment');var jayson=require(_0x829c('0x8'));var client=jayson[_0x829c('0x9')][_0x829c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210a1a,_0x5ed10f,_0x487f30){return new BPromise(function(_0x3026da,_0x4e210d){return client[_0x829c('0xb')](_0x210a1a,_0x487f30)[_0x829c('0xc')](function(_0x368258){logger['info'](_0x829c('0xd'),_0x5ed10f,_0x829c('0xe'));logger[_0x829c('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5ed10f,_0x829c('0xe'),JSON['stringify'](_0x368258));if(_0x368258['error']){if(_0x368258[_0x829c('0x10')][_0x829c('0x11')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5ed10f,_0x368258[_0x829c('0x10')][_0x829c('0x12')]);return _0x4e210d(_0x368258[_0x829c('0x10')][_0x829c('0x12')]);}logger[_0x829c('0x10')](_0x829c('0xd'),_0x5ed10f,_0x368258['error'][_0x829c('0x12')]);return _0x3026da(_0x368258[_0x829c('0x10')][_0x829c('0x12')]);}else{logger[_0x829c('0x13')](_0x829c('0xd'),_0x5ed10f,'request\x20sent');_0x3026da(_0x368258[_0x829c('0x14')][_0x829c('0x12')]);}})[_0x829c('0x15')](function(_0x3273fd){logger['error'](_0x829c('0xd'),_0x5ed10f,_0x3273fd);_0x4e210d(_0x3273fd);});});}exports[_0x829c('0x16')]=function(_0x4f8448){var _0x125dd7=this;return new Promise(function(_0x3a676d,_0xfb09bc){return db[_0x829c('0x17')][_0x829c('0x18')](_0x4f8448['body'],{'raw':_0x4f8448['options']?_0x4f8448[_0x829c('0x19')][_0x829c('0x1a')]===undefined?!![]:![]:!![]})[_0x829c('0xc')](function(_0x2ff0df){logger[_0x829c('0x13')](_0x829c('0x16'),_0x4f8448);logger[_0x829c('0xf')](_0x829c('0x16'),_0x4f8448,JSON['stringify'](_0x2ff0df));_0x3a676d(_0x2ff0df);})[_0x829c('0x15')](function(_0x5028c7){logger[_0x829c('0x10')]('CreateVoiceTransferReport',_0x5028c7[_0x829c('0x12')],_0x4f8448);_0xfb09bc(_0x125dd7['error'](0x1f4,_0x5028c7[_0x829c('0x12')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 159b6b3..3efe024 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddab=['Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','listen','then','info','start','Online\x20apps:','map','online','name','join'];(function(_0x576e92,_0x165314){var _0x24c32e=function(_0x1648b1){while(--_0x1648b1){_0x576e92['push'](_0x576e92['shift']());}};_0x24c32e(++_0x165314);}(_0xddab,0x1e5));var _0xbdda=function(_0x1a2925,_0x1797f1){_0x1a2925=_0x1a2925-0x0;var _0x49b9f7=_0xddab[_0x1a2925];return _0x49b9f7;};'use strict';var _=require(_0xbdda('0x0'));var mysqldb=require(_0xbdda('0x1'));var rpc=require(_0xbdda('0x2'));var config=require('./config/environment');var logger=require('./config/logger')(_0xbdda('0x3'));var pm2=require(_0xbdda('0x4'));var pm2Config=require(_0xbdda('0x5'));var schedule=require(_0xbdda('0x6'));var chat=require(_0xbdda('0x7'));function main(){return mysqldb['db'][_0xbdda('0x8')][_0xbdda('0x9')]()['then'](function(){return rpc[_0xbdda('0xa')]();})[_0xbdda('0xb')](function(_0x1c2ab1){logger[_0xbdda('0xc')](_0x1c2ab1);return chat[_0xbdda('0xd')]();})[_0xbdda('0xb')](function(){return schedule['start']();})[_0xbdda('0xb')](function(_0x599831){logger[_0xbdda('0xc')](_0x599831);return pm2[_0xbdda('0xd')](pm2Config);})[_0xbdda('0xb')](function(_0x109ffc){logger['info'](_0xbdda('0xe'),_[_0xbdda('0xf')](_['filter'](_0x109ffc,{'status':_0xbdda('0x10')}),_0xbdda('0x11'))[_0xbdda('0x12')]());logger[_0xbdda('0xc')](_0xbdda('0x13'),_['map'](_['filter'](_0x109ffc,function(_0x3ef869){return _0x3ef869[_0xbdda('0x14')]!==_0xbdda('0x10');}),_0xbdda('0x11'))[_0xbdda('0x12')]()||_0xbdda('0x15'));config[_0xbdda('0x16')]&&require(_0xbdda('0x17'))[_0xbdda('0x18')]();require(_0xbdda('0x19'))[_0xbdda('0x18')]();})['catch'](function(_0x136ecf){logger['error'](_0xbdda('0x1a'),_0x136ecf);process[_0xbdda('0x1b')](0x1);});}main(); \ No newline at end of file +var _0x9653=['then','info','start','map','filter','online','name','join','status','None','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','listen'];(function(_0x2ae529,_0x4e9ede){var _0x50366b=function(_0x1580d1){while(--_0x1580d1){_0x2ae529['push'](_0x2ae529['shift']());}};_0x50366b(++_0x4e9ede);}(_0x9653,0x17d));var _0x3965=function(_0x4213f8,_0x3572a4){_0x4213f8=_0x4213f8-0x0;var _0x2e690e=_0x9653[_0x4213f8];return _0x2e690e;};'use strict';var _=require(_0x3965('0x0'));var mysqldb=require(_0x3965('0x1'));var rpc=require(_0x3965('0x2'));var config=require(_0x3965('0x3'));var logger=require(_0x3965('0x4'))(_0x3965('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x3965('0x6'));var schedule=require(_0x3965('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize']['sync']()['then'](function(){return rpc[_0x3965('0x8')]();})[_0x3965('0x9')](function(_0x2ac353){logger[_0x3965('0xa')](_0x2ac353);return chat['start']();})[_0x3965('0x9')](function(){return schedule[_0x3965('0xb')]();})['then'](function(_0x573201){logger[_0x3965('0xa')](_0x573201);return pm2[_0x3965('0xb')](pm2Config);})['then'](function(_0x91da){logger[_0x3965('0xa')]('Online\x20apps:',_[_0x3965('0xc')](_[_0x3965('0xd')](_0x91da,{'status':_0x3965('0xe')}),_0x3965('0xf'))[_0x3965('0x10')]());logger[_0x3965('0xa')]('Offline\x20apps:',_[_0x3965('0xc')](_['filter'](_0x91da,function(_0x3c0c33){return _0x3c0c33[_0x3965('0x11')]!==_0x3965('0xe');}),_0x3965('0xf'))[_0x3965('0x10')]()||_0x3965('0x12'));config[_0x3965('0x13')]&&require('./config/seedDB')[_0x3965('0x14')]();require(_0x3965('0x15'))[_0x3965('0x14')]();})[_0x3965('0x16')](function(_0x3ab1fc){logger[_0x3965('0x17')](_0x3965('0x18'),_0x3ab1fc);process[_0x3965('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index dddacc2..4fd0baf 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 _0x9a51=['sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','../../config/license/util','getLicense','update','sign','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','pick','isNil','apiKeyIat','generateApiKey','toString','floor','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','secrets','role','name','internal','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','then','status','disposition','unmanaged','Unmanaged.','catch','headers','startsWith','authorization','Basic','User','find','authenticate','json','Wrong\x20credentials.','Bearer','query','apikey','verify','session','getUuid'];(function(_0x19a550,_0x30df50){var _0x18ecef=function(_0x40768b){while(--_0x40768b){_0x19a550['push'](_0x19a550['shift']());}};_0x18ecef(++_0x30df50);}(_0x9a51,0x15f));var _0x19a5=function(_0x466e6b,_0x4053fd){_0x466e6b=_0x466e6b-0x0;var _0x118deb=_0x9a51[_0x466e6b];return _0x118deb;};'use strict';var db=require(_0x19a5('0x0'))['db'];var config=require(_0x19a5('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0x19a5('0x2'));var jwt=require(_0x19a5('0x3'));var expressJwt=require('express-jwt');var compose=require(_0x19a5('0x4'));var basicAuth=require(_0x19a5('0x5'));var crypto=require('crypto');var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0x19a5('0x6')]['session']});var userAttributes=['id',_0x19a5('0x7'),'fullname',_0x19a5('0x8'),_0x19a5('0x9'),_0x19a5('0xa'),_0x19a5('0xb'),_0x19a5('0xc'),_0x19a5('0xd'),'chatPause',_0x19a5('0xe'),_0x19a5('0xf'),_0x19a5('0x10'),'openchannelPause',_0x19a5('0x11'),_0x19a5('0x12'),_0x19a5('0x13'),_0x19a5('0x14'),'interface',_0x19a5('0x15')];exports[_0x19a5('0x16')]=function(){return isAuthenticated(!![])[_0x19a5('0x17')](function(_0x23c9ce,_0x26da14,_0x5ab750){if(_0x23c9ce[_0x19a5('0x18')]){_0x5ab750();}else{return db[_0x19a5('0x19')]['findOne']({'where':{'id':_0x23c9ce[_0x19a5('0x1a')]['id']},'attributes':['id',_0x19a5('0x1b'),'disposition'],'raw':!![]})[_0x19a5('0x1c')](function(_0x99ea35){if(_0x99ea35&&_0x99ea35[_0x19a5('0x1b')]){return _0x26da14[_0x19a5('0x1d')](_0x99ea35[_0x19a5('0x1e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x99ea35['disposition']===_0x19a5('0x1f')?_0x19a5('0x20'):'Forbidden.'});}else{_0x5ab750();}})[_0x19a5('0x21')](function(_0x2a1bd5){_0x5ab750(_0x2a1bd5);});}});};function isAuthenticated(_0x147c3b){return compose()[_0x19a5('0x17')](function(_0x37b28d,_0x108aff,_0x2c3c34){if(_0x37b28d[_0x19a5('0x22')]['authorization']){if(_[_0x19a5('0x23')](_0x37b28d[_0x19a5('0x22')][_0x19a5('0x24')],_0x19a5('0x25'))){var _0x69fd78=basicAuth(_0x37b28d);db[_0x19a5('0x26')][_0x19a5('0x27')]({'where':{'name':_0x69fd78[_0x19a5('0x8')]}})[_0x19a5('0x1c')](function(_0x3c27d4){if(!_0x3c27d4||!_0x3c27d4[_0x19a5('0x28')](_0x69fd78['pass'])){return _0x108aff[_0x19a5('0x1d')](0x191)[_0x19a5('0x29')]({'message':_0x19a5('0x2a')});}_0x37b28d['user']={'id':_0x3c27d4['id']};_0x2c3c34();})[_0x19a5('0x21')](function(_0x4195f0){_0x2c3c34(_0x4195f0);});}else if(_[_0x19a5('0x23')](_0x37b28d[_0x19a5('0x22')][_0x19a5('0x24')],_0x19a5('0x2b'))){validateJwt(_0x37b28d,_0x108aff,_0x2c3c34);}else{if(_0x147c3b){_0x2c3c34();}else{return _0x108aff[_0x19a5('0x1d')](0x193)[_0x19a5('0x29')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37b28d[_0x19a5('0x2c')][_0x19a5('0x2d')]){try{var _0x2b016e=jwt[_0x19a5('0x2e')](_0x37b28d['query'][_0x19a5('0x2d')],config['secrets'][_0x19a5('0x2f')],{'audience':hardwareConf[_0x19a5('0x30')](),'issuer':hardwareConf[_0x19a5('0x30')]()});db[_0x19a5('0x26')][_0x19a5('0x27')]({'where':{'id':_0x2b016e[_0x19a5('0x31')]}})[_0x19a5('0x1c')](function(_0x32f3db){if(!_0x32f3db||!_[_0x19a5('0x32')](_0x32f3db[_0x19a5('0x33')],_0x2b016e[_0x19a5('0x34')])){return _0x108aff['status'](0x193)[_0x19a5('0x29')]({'message':_0x19a5('0x35')});}_0x37b28d['user']={'id':_0x32f3db['id']};_0x2c3c34();})[_0x19a5('0x21')](function(_0x25620c){_0x2c3c34(_0x25620c);});}catch(_0x3077c9){console['log'](_0x3077c9);return _0x108aff[_0x19a5('0x1d')](0x193)[_0x19a5('0x29')]({'message':_0x19a5('0x36')});}}else if(_0x147c3b){_0x2c3c34();}else{return _0x108aff[_0x19a5('0x1d')](0x193)[_0x19a5('0x29')]({'message':_0x19a5('0x37')});}})['use'](function(_0x59d90e,_0x1b607a,_0x3cc414){if(_0x59d90e['user']){db[_0x19a5('0x26')][_0x19a5('0x27')]({'where':{'id':_0x59d90e['user']['id']},'attributes':userAttributes})[_0x19a5('0x1c')](function(_0x446f90){if(!_0x446f90){return _0x1b607a[_0x19a5('0x1d')](0x194)[_0x19a5('0x29')]({'message':_0x19a5('0x38')});}_0x59d90e['user']=_0x446f90;_0x3cc414();})[_0x19a5('0x21')](function(_0x81cd3f){_0x3cc414(_0x81cd3f);});}else if(_0x147c3b){_0x3cc414();}else{return _0x1b607a['status'](0x194)[_0x19a5('0x29')]({'message':'User\x20object\x20not\x20found.'});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x20e643,_0x3abed2,_0x4462bd){return require(_0x19a5('0x39'))[_0x19a5('0x3a')]()[_0x19a5('0x1c')](function(_0x47fcbe){if(_0x47fcbe[_0x19a5('0x3b')]){_0x4462bd();}else{return _0x3abed2[_0x19a5('0x1d')](0x193)[_0x19a5('0x29')]({'message':'Forbidden'});}})[_0x19a5('0x21')](function(_0x49ba37){_0x4462bd(_0x49ba37);});});}exports['canUpdate']=canUpdate;function signToken(_0x2c24ac,_0x1e0074){return jwt[_0x19a5('0x3c')]({'id':_0x2c24ac,'role':_0x1e0074},config[_0x19a5('0x6')][_0x19a5('0x2f')],{'expiresIn':0x15180});}exports[_0x19a5('0x3d')]=signToken;exports[_0x19a5('0x3e')]=function(_0x2ce6e6){if(!_0x2ce6e6){throw new Error(_0x19a5('0x3f'));}return compose()['use'](isAuthenticated())[_0x19a5('0x17')](function meetsRequirements(_0x3a814f,_0x51febf,_0x4cf753){if(config[_0x19a5('0x40')][_0x19a5('0x41')](_0x3a814f[_0x19a5('0x18')][_0x19a5('0x7')])>=config[_0x19a5('0x40')][_0x19a5('0x41')](_0x2ce6e6)){return _0x4cf753();}else{return _0x51febf[_0x19a5('0x1d')](0x193)[_0x19a5('0x29')]({'message':'Forbidden'});}});};exports['isMiddleware']=function(_0x1aea97,_0x3ae11d,_0xfa5840){_0x1aea97['isMiddleware']=!![];return _0xfa5840();};exports[_0x19a5('0x42')]=function(_0x28d7ca,_0x36fc8a){if(!_0x28d7ca[_0x19a5('0x18')]){return _0x36fc8a[_0x19a5('0x1d')](0x194)[_0x19a5('0x29')]({'message':_0x19a5('0x43')});}var _0x47f4a7=signToken(_0x28d7ca[_0x19a5('0x18')]['id'],_0x28d7ca[_0x19a5('0x18')][_0x19a5('0x7')]);_0x36fc8a[_0x19a5('0x44')](_0x19a5('0x45'),_0x47f4a7);_0x36fc8a['cookie'](_0x19a5('0x46'),JSON['stringify'](_[_0x19a5('0x47')](_0x28d7ca[_0x19a5('0x18')],userAttributes)));_0x36fc8a['redirect']('/dashboards/general');};exports['retrieveApiKey']=function(_0x284e5b){if(_['isNil'](_0x284e5b[_0x19a5('0x33')])||_[_0x19a5('0x48')](_0x284e5b[_0x19a5('0x49')]))return null;else return createJwt(_0x284e5b);};exports[_0x19a5('0x4a')]=function(_0x5a77fe){_0x5a77fe[_0x19a5('0x33')]=crypto['randomBytes'](0x10)[_0x19a5('0x4b')]('hex');_0x5a77fe[_0x19a5('0x49')]=Math[_0x19a5('0x4c')](Date[_0x19a5('0x4d')]()/0x3e8)[_0x19a5('0x4b')]();return createJwt(_0x5a77fe);};exports[_0x19a5('0x4e')]=function(_0x1c17fa,_0x32383a){if(_0x1c17fa['query'][_0x19a5('0x2d')]){jwt[_0x19a5('0x2e')](_0x1c17fa[_0x19a5('0x2c')][_0x19a5('0x2d')],config['secrets'][_0x19a5('0x2f')],{'nonce':_0x32383a[_0x19a5('0x33')],'iat':_0x32383a['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x19a5('0x30')]()});return generateApiKey(_0x32383a);}else{throw{'message':_0x19a5('0x4f')};}};function createJwt(_0x5429e4){return jwt[_0x19a5('0x3c')]({'iat':_0x5429e4[_0x19a5('0x49')],'nonce':_0x5429e4[_0x19a5('0x33')]},config[_0x19a5('0x6')][_0x19a5('0x2f')],{'algorithm':'HS512','subject':_0x5429e4['id'][_0x19a5('0x4b')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x19a5('0x30')]()});} \ No newline at end of file +var _0x5d9e=['authorization','Basic','User','find','then','authenticate','pass','Wrong\x20credentials.','headers','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','sub','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','motion.user','stringify','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','basic-auth','ipaddr.js','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','use','user','ChatInteraction','findOne','closed','disposition','status','json','unmanaged','Forbidden.','catch','startsWith'];(function(_0x5e298d,_0x528819){var _0x4ebc35=function(_0x19688c){while(--_0x19688c){_0x5e298d['push'](_0x5e298d['shift']());}};_0x4ebc35(++_0x528819);}(_0x5d9e,0x196));var _0xe5d9=function(_0x5ed024,_0x5be802){_0x5ed024=_0x5ed024-0x0;var _0x3f64bb=_0x5d9e[_0x5ed024];return _0x3f64bb;};'use strict';var db=require(_0xe5d9('0x0'))['db'];var config=require(_0xe5d9('0x1'));var hardwareConf=require(_0xe5d9('0x2'));var _=require(_0xe5d9('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xe5d9('0x4'));var crypto=require('crypto');var ipaddr=require(_0xe5d9('0x5'));var validateJwt=expressJwt({'secret':config[_0xe5d9('0x6')][_0xe5d9('0x7')]});var userAttributes=['id',_0xe5d9('0x8'),_0xe5d9('0x9'),_0xe5d9('0xa'),_0xe5d9('0xb'),_0xe5d9('0xc'),_0xe5d9('0xd'),_0xe5d9('0xe'),_0xe5d9('0xf'),_0xe5d9('0x10'),_0xe5d9('0x11'),_0xe5d9('0x12'),_0xe5d9('0x13'),_0xe5d9('0x14'),_0xe5d9('0x15'),_0xe5d9('0x16'),_0xe5d9('0x17'),_0xe5d9('0x18'),_0xe5d9('0x19'),_0xe5d9('0x1a')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xe5d9('0x1b')](function(_0x20c057,_0x23e7b5,_0xac48e1){if(_0x20c057[_0xe5d9('0x1c')]){_0xac48e1();}else{return db[_0xe5d9('0x1d')][_0xe5d9('0x1e')]({'where':{'id':_0x20c057['params']['id']},'attributes':['id',_0xe5d9('0x1f'),_0xe5d9('0x20')],'raw':!![]})['then'](function(_0x3b98f3){if(_0x3b98f3&&_0x3b98f3[_0xe5d9('0x1f')]){return _0x23e7b5[_0xe5d9('0x21')](_0x3b98f3[_0xe5d9('0x20')]==='unmanaged'?0x195:0x193)[_0xe5d9('0x22')]({'message':_0x3b98f3[_0xe5d9('0x20')]===_0xe5d9('0x23')?'Unmanaged.':_0xe5d9('0x24')});}else{_0xac48e1();}})[_0xe5d9('0x25')](function(_0x416a3b){_0xac48e1(_0x416a3b);});}});};function isAuthenticated(_0x449d33){return compose()['use'](function(_0x54567f,_0x36ec45,_0x51361c){if(_0x54567f['headers']['authorization']){if(_[_0xe5d9('0x26')](_0x54567f['headers'][_0xe5d9('0x27')],_0xe5d9('0x28'))){var _0x5426ee=basicAuth(_0x54567f);db[_0xe5d9('0x29')][_0xe5d9('0x2a')]({'where':{'name':_0x5426ee[_0xe5d9('0xa')]}})[_0xe5d9('0x2b')](function(_0xea78fe){if(!_0xea78fe||!_0xea78fe[_0xe5d9('0x2c')](_0x5426ee[_0xe5d9('0x2d')])){return _0x36ec45[_0xe5d9('0x21')](0x191)[_0xe5d9('0x22')]({'message':_0xe5d9('0x2e')});}_0x54567f[_0xe5d9('0x1c')]={'id':_0xea78fe['id']};_0x51361c();})[_0xe5d9('0x25')](function(_0x4efe69){_0x51361c(_0x4efe69);});}else if(_[_0xe5d9('0x26')](_0x54567f[_0xe5d9('0x2f')]['authorization'],_0xe5d9('0x30'))){validateJwt(_0x54567f,_0x36ec45,_0x51361c);}else{if(_0x449d33){_0x51361c();}else{return _0x36ec45[_0xe5d9('0x21')](0x193)[_0xe5d9('0x22')]({'message':_0xe5d9('0x31')});}}}else if(_0x54567f[_0xe5d9('0x32')][_0xe5d9('0x33')]){try{var _0x1efc00=jwt[_0xe5d9('0x34')](_0x54567f[_0xe5d9('0x32')]['apikey'],config['secrets'][_0xe5d9('0x7')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xe5d9('0x35')]()});db['User'][_0xe5d9('0x2a')]({'where':{'id':_0x1efc00[_0xe5d9('0x36')]}})[_0xe5d9('0x2b')](function(_0x57f9cd){if(!_0x57f9cd||!_['isEqual'](_0x57f9cd[_0xe5d9('0x37')],_0x1efc00[_0xe5d9('0x38')])){return _0x36ec45[_0xe5d9('0x21')](0x193)[_0xe5d9('0x22')]({'message':_0xe5d9('0x39')});}_0x54567f[_0xe5d9('0x1c')]={'id':_0x57f9cd['id']};_0x51361c();})[_0xe5d9('0x25')](function(_0x310bd1){_0x51361c(_0x310bd1);});}catch(_0x3558f3){console[_0xe5d9('0x3a')](_0x3558f3);return _0x36ec45[_0xe5d9('0x21')](0x193)['json']({'message':_0xe5d9('0x3b')});}}else if(_0x449d33){_0x51361c();}else{return _0x36ec45[_0xe5d9('0x21')](0x193)[_0xe5d9('0x22')]({'message':_0xe5d9('0x31')});}})[_0xe5d9('0x1b')](function(_0x43a766,_0x3f2074,_0x2a5e69){if(_0x43a766[_0xe5d9('0x1c')]){db[_0xe5d9('0x29')][_0xe5d9('0x2a')]({'where':{'id':_0x43a766[_0xe5d9('0x1c')]['id']},'attributes':userAttributes})['then'](function(_0x531aa1){if(!_0x531aa1){return _0x3f2074[_0xe5d9('0x21')](0x194)[_0xe5d9('0x22')]({'message':_0xe5d9('0x3c')});}_0x43a766[_0xe5d9('0x1c')]=_0x531aa1;_0x2a5e69();})['catch'](function(_0x56184c){_0x2a5e69(_0x56184c);});}else if(_0x449d33){_0x2a5e69();}else{return _0x3f2074[_0xe5d9('0x21')](0x194)[_0xe5d9('0x22')]({'message':_0xe5d9('0x3d')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0xe5d9('0x1b')](function(_0x443c0d,_0x378ddb,_0x4310bc){return require('../../config/license/util')[_0xe5d9('0x3e')]()[_0xe5d9('0x2b')](function(_0xf07a3){if(_0xf07a3[_0xe5d9('0x3f')]){_0x4310bc();}else{return _0x378ddb[_0xe5d9('0x21')](0x193)[_0xe5d9('0x22')]({'message':_0xe5d9('0x40')});}})[_0xe5d9('0x25')](function(_0x2f94bf){_0x4310bc(_0x2f94bf);});});}exports[_0xe5d9('0x41')]=canUpdate;function signToken(_0x554e4e,_0x315029){return jwt[_0xe5d9('0x42')]({'id':_0x554e4e,'role':_0x315029},config['secrets'][_0xe5d9('0x7')],{'expiresIn':0x15180});}exports[_0xe5d9('0x43')]=signToken;exports['hasRole']=function(_0x5c71c8){if(!_0x5c71c8){throw new Error(_0xe5d9('0x44'));}return compose()[_0xe5d9('0x1b')](isAuthenticated())[_0xe5d9('0x1b')](function meetsRequirements(_0x3bb870,_0x5e4c4c,_0x5ab1c4){if(config[_0xe5d9('0x45')][_0xe5d9('0x46')](_0x3bb870[_0xe5d9('0x1c')][_0xe5d9('0x8')])>=config['userRoles'][_0xe5d9('0x46')](_0x5c71c8)){return _0x5ab1c4();}else{return _0x5e4c4c['status'](0x193)[_0xe5d9('0x22')]({'message':_0xe5d9('0x40')});}});};exports[_0xe5d9('0x47')]=function(_0x54ba47,_0x544a6c,_0x54ea1c){_0x54ba47[_0xe5d9('0x47')]=!![];return _0x54ea1c();};exports[_0xe5d9('0x48')]=function(_0x39b5c1,_0x598e1f){if(!_0x39b5c1[_0xe5d9('0x1c')]){return _0x598e1f[_0xe5d9('0x21')](0x194)[_0xe5d9('0x22')]({'message':_0xe5d9('0x49')});}var _0x339b20=signToken(_0x39b5c1[_0xe5d9('0x1c')]['id'],_0x39b5c1['user'][_0xe5d9('0x8')]);_0x598e1f['cookie'](_0xe5d9('0x4a'),_0x339b20);_0x598e1f['cookie'](_0xe5d9('0x4b'),JSON[_0xe5d9('0x4c')](_['pick'](_0x39b5c1[_0xe5d9('0x1c')],userAttributes)));_0x598e1f['redirect'](_0xe5d9('0x4d'));};exports[_0xe5d9('0x4e')]=function(_0x10fb9f){if(_['isNil'](_0x10fb9f[_0xe5d9('0x37')])||_[_0xe5d9('0x4f')](_0x10fb9f[_0xe5d9('0x50')]))return null;else return createJwt(_0x10fb9f);};exports[_0xe5d9('0x51')]=function(_0x34e40f){_0x34e40f[_0xe5d9('0x37')]=crypto[_0xe5d9('0x52')](0x10)[_0xe5d9('0x53')](_0xe5d9('0x54'));_0x34e40f[_0xe5d9('0x50')]=Math[_0xe5d9('0x55')](Date[_0xe5d9('0x56')]()/0x3e8)[_0xe5d9('0x53')]();return createJwt(_0x34e40f);};exports[_0xe5d9('0x57')]=function(_0x7d8211,_0x567ad0){if(_0x7d8211[_0xe5d9('0x32')]['apikey']){jwt[_0xe5d9('0x34')](_0x7d8211[_0xe5d9('0x32')]['apikey'],config[_0xe5d9('0x6')][_0xe5d9('0x7')],{'nonce':_0x567ad0[_0xe5d9('0x37')],'iat':_0x567ad0['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xe5d9('0x35')]()});return generateApiKey(_0x567ad0);}else{throw{'message':_0xe5d9('0x58')};}};function createJwt(_0x57e50d){return jwt[_0xe5d9('0x42')]({'iat':_0x57e50d[_0xe5d9('0x50')],'nonce':_0x57e50d['apiKeyNonce']},config[_0xe5d9('0x6')][_0xe5d9('0x7')],{'algorithm':'HS512','subject':_0x57e50d['id'][_0xe5d9('0x53')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xe5d9('0x35')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 7ab2ded..088971b 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 _0x99e1=['bluebird','aes192','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm','data','update','binary','write','final','end','close','unlink','createReadStream','createDecipher','crypto'];(function(_0x13ae43,_0x2afc17){var _0xfd274b=function(_0x1be881){while(--_0x1be881){_0x13ae43['push'](_0x13ae43['shift']());}};_0xfd274b(++_0x2afc17);}(_0x99e1,0xb3));var _0x199e=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x99e1[_0x43776a];return _0x18eb8f;};'use strict';var crypto=require(_0x199e('0x0'));var fs=require('fs');var BPromise=require(_0x199e('0x1'));var defaultOptions={'algorithm':_0x199e('0x2')};function combineOptions(_0xcbaa67){var _0x56987b={};for(var _0x2b6019 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x2b6019)){_0x56987b[_0x2b6019]=defaultOptions[_0x2b6019];}}if(_0xcbaa67){for(var _0x1b0d35 in _0xcbaa67){if(_0xcbaa67[_0x199e('0x3')](_0x1b0d35)){_0x56987b[_0x1b0d35]=_0xcbaa67[_0x1b0d35];}}}return _0x56987b;}exports[_0x199e('0x4')]=function(_0x5a7e9c,_0x26c47b,_0x27a193,_0x99418f){return new BPromise(function(_0x5a087a,_0x4e38ae){_0x99418f=combineOptions(_0x99418f);var _0x5b553d=new Buffer(_0x27a193);var _0x5913f5=fs['createReadStream'](_0x5a7e9c);var _0x59cede=fs[_0x199e('0x5')](_0x26c47b);var _0x53be50=crypto[_0x199e('0x6')](_0x99418f[_0x199e('0x7')],_0x5b553d);_0x5913f5['on'](_0x199e('0x8'),function(_0x280344){var _0x39ac1f=new Buffer(_0x53be50[_0x199e('0x9')](_0x280344),_0x199e('0xa'));_0x59cede[_0x199e('0xb')](_0x39ac1f);});_0x5913f5['on']('end',function(){try{var _0x3c1b56=new Buffer(_0x53be50[_0x199e('0xc')]('binary'),'binary');_0x59cede[_0x199e('0xb')](_0x3c1b56);_0x59cede[_0x199e('0xd')]();_0x59cede['on'](_0x199e('0xe'),function(){return _0x5a087a(_0x26c47b);});}catch(_0x249249){fs[_0x199e('0xf')](_0x26c47b);return _0x4e38ae(_0x249249);}});});};exports['decryptFile']=function(_0x542cde,_0x573543,_0x245cd7,_0x48cab2){return new BPromise(function(_0xd4540d,_0x44fc27){_0x48cab2=combineOptions(_0x48cab2);var _0x5c2939=new Buffer(_0x245cd7);var _0x29f2f1=fs[_0x199e('0x10')](_0x542cde);var _0x2b3af8=fs[_0x199e('0x5')](_0x573543);var _0x367af7=crypto[_0x199e('0x11')](_0x48cab2['algorithm'],_0x5c2939);_0x29f2f1['on']('data',function(_0x53c218){var _0x17736e=new Buffer(_0x367af7[_0x199e('0x9')](_0x53c218),_0x199e('0xa'));_0x2b3af8[_0x199e('0xb')](_0x17736e);});_0x29f2f1['on'](_0x199e('0xd'),function(){try{var _0x549220=new Buffer(_0x367af7[_0x199e('0xc')](_0x199e('0xa')),'binary');_0x2b3af8[_0x199e('0xb')](_0x549220);_0x2b3af8[_0x199e('0xd')]();_0x2b3af8['on'](_0x199e('0xe'),function(){return _0xd4540d(_0x573543);});}catch(_0x50f997){fs['unlink'](_0x573543);return _0x44fc27(_0x50f997);}});});}; \ No newline at end of file +var _0xe853=['createReadStream','createWriteStream','createDecipher','crypto','bluebird','hasOwnProperty','createCipher','algorithm','data','update','write','end','final','binary','close','unlink','decryptFile'];(function(_0x1b1b9c,_0x1644bf){var _0x23700a=function(_0x3f4e24){while(--_0x3f4e24){_0x1b1b9c['push'](_0x1b1b9c['shift']());}};_0x23700a(++_0x1644bf);}(_0xe853,0x8b));var _0x3e85=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe853[_0x6c993a];return _0x27f547;};'use strict';var crypto=require(_0x3e85('0x0'));var fs=require('fs');var BPromise=require(_0x3e85('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x4ad1af){var _0x72b267={};for(var _0x1e099c in defaultOptions){if(defaultOptions[_0x3e85('0x2')](_0x1e099c)){_0x72b267[_0x1e099c]=defaultOptions[_0x1e099c];}}if(_0x4ad1af){for(var _0x1a4bd1 in _0x4ad1af){if(_0x4ad1af[_0x3e85('0x2')](_0x1a4bd1)){_0x72b267[_0x1a4bd1]=_0x4ad1af[_0x1a4bd1];}}}return _0x72b267;}exports['encryptFile']=function(_0x424c21,_0x4aecc3,_0x29ec34,_0x5a9d36){return new BPromise(function(_0x392655,_0x356077){_0x5a9d36=combineOptions(_0x5a9d36);var _0x4f5a39=new Buffer(_0x29ec34);var _0xac2dfe=fs['createReadStream'](_0x424c21);var _0x22ca9b=fs['createWriteStream'](_0x4aecc3);var _0x35ef95=crypto[_0x3e85('0x3')](_0x5a9d36[_0x3e85('0x4')],_0x4f5a39);_0xac2dfe['on'](_0x3e85('0x5'),function(_0x506fe9){var _0x3fcef5=new Buffer(_0x35ef95[_0x3e85('0x6')](_0x506fe9),'binary');_0x22ca9b[_0x3e85('0x7')](_0x3fcef5);});_0xac2dfe['on'](_0x3e85('0x8'),function(){try{var _0x1db858=new Buffer(_0x35ef95[_0x3e85('0x9')](_0x3e85('0xa')),_0x3e85('0xa'));_0x22ca9b[_0x3e85('0x7')](_0x1db858);_0x22ca9b['end']();_0x22ca9b['on'](_0x3e85('0xb'),function(){return _0x392655(_0x4aecc3);});}catch(_0x2f3d8f){fs[_0x3e85('0xc')](_0x4aecc3);return _0x356077(_0x2f3d8f);}});});};exports[_0x3e85('0xd')]=function(_0x47e995,_0x19e6cd,_0x8695e1,_0x22178c){return new BPromise(function(_0x168fe8,_0x165001){_0x22178c=combineOptions(_0x22178c);var _0x25abfa=new Buffer(_0x8695e1);var _0x5a99e3=fs[_0x3e85('0xe')](_0x47e995);var _0x24f3eb=fs[_0x3e85('0xf')](_0x19e6cd);var _0x4ec97d=crypto[_0x3e85('0x10')](_0x22178c['algorithm'],_0x25abfa);_0x5a99e3['on'](_0x3e85('0x5'),function(_0x3399aa){var _0x567afe=new Buffer(_0x4ec97d[_0x3e85('0x6')](_0x3399aa),'binary');_0x24f3eb[_0x3e85('0x7')](_0x567afe);});_0x5a99e3['on'](_0x3e85('0x8'),function(){try{var _0x405ceb=new Buffer(_0x4ec97d[_0x3e85('0x9')](_0x3e85('0xa')),_0x3e85('0xa'));_0x24f3eb[_0x3e85('0x7')](_0x405ceb);_0x24f3eb[_0x3e85('0x8')]();_0x24f3eb['on'](_0x3e85('0xb'),function(){return _0x168fe8(_0x19e6cd);});}catch(_0x27c4b5){fs[_0x3e85('0xc')](_0x19e6cd);return _0x165001(_0x27c4b5);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index d246436..2049ffa 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 _0x4bfb=['CSV','find','split','then','splitSizeCsv','sequelize','query','num','Empty','length','QueryTypes','SELECT','push','dirname','.csv','join','mkdirSync','each','%s.%s','writeFileSync','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','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4bfb,0xdd));var _0xb4bf=function(_0x392be3,_0xf1d603){_0x392be3=_0x392be3-0x0;var _0x1453b2=_0x4bfb[_0x392be3];return _0x1453b2;};'use strict';var util=require('util');var path=require(_0xb4bf('0x0'));var _=require(_0xb4bf('0x1'));var csv=require(_0xb4bf('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xb4bf('0x3'));var db=require(_0xb4bf('0x4'))['db'];var dbH=require('../../mysqldb')[_0xb4bf('0x5')];var logger=require(_0xb4bf('0x6'))(_0xb4bf('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb4bf('0x8')][0x2]);var QUERY=process[_0xb4bf('0x8')][0x3];var PATH=process[_0xb4bf('0x8')][0x4];function analyticExtractedReport(_0x2a3359,_0x297e94){var _0x120f0b={'status':_0x2a3359};var _0x1635d0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x297e94){_0x120f0b['savename']=_0x297e94;}return db[_0xb4bf('0x9')]['update'](_0x120f0b,_0x1635d0);}function main(){var _0x29e9f3=0x1388;var _0x48e63c;logger[_0xb4bf('0xa')](util[_0xb4bf('0xb')](_0xb4bf('0xc'),EXTRACTED_REPORT_ID,_0xb4bf('0xd')));return db['Setting'][_0xb4bf('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb4bf('0xf'),'splitSizeCsv']})[_0xb4bf('0x10')](function(_0xbf7e9){if(_0xbf7e9){_0x48e63c=_0xbf7e9;_0x29e9f3=_0x48e63c[_0xb4bf('0x11')]||0x1388;}})['then'](function(){return dbH[_0xb4bf('0x12')][_0xb4bf('0x13')](util[_0xb4bf('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb4bf('0x12')]['QueryTypes']['SELECT']});})[_0xb4bf('0x10')](function(_0x4a96ff){if(!_0x4a96ff[0x0][_0xb4bf('0x14')]){return analyticExtractedReport(_0xb4bf('0x15'));}var _0x2bd6f5=[];var _0x17f806=0x0;var _0x1636c3=!![];if(_0x4a96ff&&_0x4a96ff[_0xb4bf('0x16')]){var _0x57f760=_0x4a96ff[0x0][_0xb4bf('0x14')]%(_0x17f806+_0x29e9f3);if(_0x48e63c['split']){for(;_0x1636c3;_0x17f806+=_0x29e9f3,_0x57f760=_0x4a96ff[0x0][_0xb4bf('0x14')]%(_0x17f806+_0x29e9f3)){if(_0x57f760==0x0||_0x57f760==_0x4a96ff[0x0][_0xb4bf('0x14')]){_0x1636c3=![];}_0x2bd6f5['push'](dbH[_0xb4bf('0x12')]['query'](util[_0xb4bf('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x29e9f3,_0x17f806),{'type':dbH[_0xb4bf('0x12')][_0xb4bf('0x17')][_0xb4bf('0x18')]}));}}else{_0x2bd6f5[_0xb4bf('0x19')](dbH[_0xb4bf('0x12')][_0xb4bf('0x13')](QUERY,{'type':dbH[_0xb4bf('0x12')][_0xb4bf('0x17')][_0xb4bf('0x18')]}));}}var _0xb5bde3=path[_0xb4bf('0x1a')](PATH);var _0x578d37=path['basename'](PATH,_0xb4bf('0x1b'));var _0x209f9f=_0x48e63c[_0xb4bf('0xf')]&&_0x2bd6f5[_0xb4bf('0x16')]>0x1;var _0x218a8f=[];if(!fs['existsSync'](path[_0xb4bf('0x1c')](_0xb5bde3,_0x578d37))&&_0x209f9f){fs[_0xb4bf('0x1d')](path[_0xb4bf('0x1c')](_0xb5bde3,_0x578d37));}return BPromise[_0xb4bf('0x1e')](_0x2bd6f5,function(_0x515693){_0x218a8f[_0xb4bf('0x19')](_0x515693);})['then'](function(){for(var _0x10b651=0x0;_0x10b651<_0x218a8f[_0xb4bf('0x16')];_0x10b651+=0x1){var _0x465704;var _0x5e6a7c=_0x218a8f[_0x10b651];if(_0x209f9f){_0x465704=path[_0xb4bf('0x1c')](_0xb5bde3,_0x578d37,util['format']('%s%d.%s',_0x578d37,_0x10b651,'csv'));}else{_0x465704=path[_0xb4bf('0x1c')](_0xb5bde3,util[_0xb4bf('0xb')](_0xb4bf('0x1f'),_0x578d37,'csv'));}fs[_0xb4bf('0x20')](_0x465704,csv(_0x5e6a7c));}})['then'](function(){if(_0x209f9f){zipdir(path[_0xb4bf('0x1c')](_0xb5bde3,_0x578d37),{'saveTo':path[_0xb4bf('0x1c')](_0xb5bde3,util[_0xb4bf('0xb')]('%s.%s',_0x578d37,_0xb4bf('0x21')))},function(_0x55263f,_0x202150){});rimraf(path[_0xb4bf('0x1c')](_0xb5bde3,_0x578d37),function(){});}})[_0xb4bf('0x10')](function(){logger[_0xb4bf('0xa')](util['format'](_0xb4bf('0x22'),EXTRACTED_REPORT_ID,_0xb4bf('0xd')));return analyticExtractedReport(_0xb4bf('0x23'),_0x209f9f?util['format'](_0xb4bf('0x1f'),_0x578d37,_0x209f9f?_0xb4bf('0x21'):'csv'):null);});})[_0xb4bf('0x24')](function(_0xddec0d){logger['info'](util[_0xb4bf('0xb')](_0xb4bf('0x25'),EXTRACTED_REPORT_ID,_0xb4bf('0xd')),util[_0xb4bf('0x26')](_0xddec0d,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xd206=['num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x5e8874,_0x134292){var _0x4bf1de=function(_0x941a8e){while(--_0x941a8e){_0x5e8874['push'](_0x5e8874['shift']());}};_0x4bf1de(++_0x134292);}(_0xd206,0xba));var _0x6d20=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xd206[_0x46d0c9];return _0x174506;};'use strict';var util=require('util');var path=require(_0x6d20('0x0'));var _=require(_0x6d20('0x1'));var csv=require(_0x6d20('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x6d20('0x3'));var rimraf=require(_0x6d20('0x4'));var db=require(_0x6d20('0x5'))['db'];var dbH=require(_0x6d20('0x5'))[_0x6d20('0x6')];var logger=require('../../config/logger')(_0x6d20('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6d20('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x50ee8d,_0x5c0418){var _0x2c48db={'status':_0x50ee8d};var _0x5c7927={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c0418){_0x2c48db[_0x6d20('0x9')]=_0x5c0418;}return db['AnalyticExtractedReport'][_0x6d20('0xa')](_0x2c48db,_0x5c7927);}function main(){var _0x4f5828=0x1388;var _0x254080;logger[_0x6d20('0xb')](util[_0x6d20('0xc')](_0x6d20('0xd'),EXTRACTED_REPORT_ID,_0x6d20('0xe')));return db[_0x6d20('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6d20('0x10'),_0x6d20('0x11')]})[_0x6d20('0x12')](function(_0x10f82c){if(_0x10f82c){_0x254080=_0x10f82c;_0x4f5828=_0x254080['splitSizeCsv']||0x1388;}})[_0x6d20('0x12')](function(){return dbH[_0x6d20('0x13')][_0x6d20('0x14')](util['format'](_0x6d20('0x15'),QUERY),{'type':dbH[_0x6d20('0x13')][_0x6d20('0x16')][_0x6d20('0x17')]});})['then'](function(_0x216df0){if(!_0x216df0[0x0][_0x6d20('0x18')]){return analyticExtractedReport('Empty');}var _0x592a36=[];var _0x1cc71c=0x0;var _0x4c675f=!![];if(_0x216df0&&_0x216df0['length']){var _0x2a3ca7=_0x216df0[0x0][_0x6d20('0x18')]%(_0x1cc71c+_0x4f5828);if(_0x254080[_0x6d20('0x10')]){for(;_0x4c675f;_0x1cc71c+=_0x4f5828,_0x2a3ca7=_0x216df0[0x0][_0x6d20('0x18')]%(_0x1cc71c+_0x4f5828)){if(_0x2a3ca7==0x0||_0x2a3ca7==_0x216df0[0x0][_0x6d20('0x18')]){_0x4c675f=![];}_0x592a36[_0x6d20('0x19')](dbH[_0x6d20('0x13')][_0x6d20('0x14')](util[_0x6d20('0xc')](_0x6d20('0x1a'),QUERY,_0x4f5828,_0x1cc71c),{'type':dbH[_0x6d20('0x13')][_0x6d20('0x16')][_0x6d20('0x17')]}));}}else{_0x592a36[_0x6d20('0x19')](dbH['sequelize'][_0x6d20('0x14')](QUERY,{'type':dbH[_0x6d20('0x13')][_0x6d20('0x16')][_0x6d20('0x17')]}));}}var _0xe39af5=path[_0x6d20('0x1b')](PATH);var _0x4119b5=path[_0x6d20('0x1c')](PATH,_0x6d20('0x1d'));var _0x40049a=_0x254080[_0x6d20('0x10')]&&_0x592a36[_0x6d20('0x1e')]>0x1;var _0x552eb8=[];if(!fs['existsSync'](path[_0x6d20('0x1f')](_0xe39af5,_0x4119b5))&&_0x40049a){fs['mkdirSync'](path[_0x6d20('0x1f')](_0xe39af5,_0x4119b5));}return BPromise[_0x6d20('0x20')](_0x592a36,function(_0x3fca43){_0x552eb8[_0x6d20('0x19')](_0x3fca43);})[_0x6d20('0x12')](function(){for(var _0x2e5f78=0x0;_0x2e5f78<_0x552eb8['length'];_0x2e5f78+=0x1){var _0x1e9e5a;var _0x2151d2=_0x552eb8[_0x2e5f78];if(_0x40049a){_0x1e9e5a=path['join'](_0xe39af5,_0x4119b5,util[_0x6d20('0xc')](_0x6d20('0x21'),_0x4119b5,_0x2e5f78,_0x6d20('0x22')));}else{_0x1e9e5a=path['join'](_0xe39af5,util[_0x6d20('0xc')](_0x6d20('0x23'),_0x4119b5,'csv'));}fs[_0x6d20('0x24')](_0x1e9e5a,csv(_0x2151d2));}})['then'](function(){if(_0x40049a){zipdir(path['join'](_0xe39af5,_0x4119b5),{'saveTo':path[_0x6d20('0x1f')](_0xe39af5,util[_0x6d20('0xc')](_0x6d20('0x23'),_0x4119b5,_0x6d20('0x25')))},function(_0xd06708,_0x337fa2){});rimraf(path['join'](_0xe39af5,_0x4119b5),function(){});}})[_0x6d20('0x12')](function(){logger[_0x6d20('0xb')](util['format'](_0x6d20('0x26'),EXTRACTED_REPORT_ID,_0x6d20('0xe')));return analyticExtractedReport('Completed',_0x40049a?util[_0x6d20('0xc')](_0x6d20('0x23'),_0x4119b5,_0x40049a?'zip':_0x6d20('0x22')):null);});})[_0x6d20('0x27')](function(_0x22db45){logger[_0x6d20('0xb')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6d20('0xe')),util[_0x6d20('0x28')](_0x22db45,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6d20('0x29'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5fd0ccf..504bb4a 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 _0xadf7=['sequelize','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','landscape','header','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','join','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','end','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','util','path','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','num','Empty','dirname','.pdf','Setting','find','split','splitSizePdf','then','length'];(function(_0x284f91,_0x490971){var _0x9f9987=function(_0x270e8f){while(--_0x270e8f){_0x284f91['push'](_0x284f91['shift']());}};_0x9f9987(++_0x490971);}(_0xadf7,0xfe));var _0x7adf=function(_0x319c3a,_0x359329){_0x319c3a=_0x319c3a-0x0;var _0x102fa3=_0xadf7[_0x319c3a];return _0x102fa3;};'use strict';var _=require(_0x7adf('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0x7adf('0x1'));var path=require(_0x7adf('0x2'));var moment=require('moment');var PdfPrinter=require(_0x7adf('0x3'));var zipdir=require(_0x7adf('0x4'));var rimraf=require(_0x7adf('0x5'));var db=require(_0x7adf('0x6'))['db'];var dbH=require(_0x7adf('0x6'))[_0x7adf('0x7')];var logger=require('../../config/logger')(_0x7adf('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x7adf('0x9')][0x2]);var QUERY=process[_0x7adf('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x7adf('0x9')][0x5];var FORMAT=_0x7adf('0xa');var _extractedReport;function analyticExtractedReport(_0x5ebdb0,_0x2cd69c){var _0x223356={'status':_0x5ebdb0};var _0x4c5bcc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2cd69c){_0x223356[_0x7adf('0xb')]=_0x2cd69c;}return db[_0x7adf('0xc')][_0x7adf('0xd')](_0x223356,_0x4c5bcc);}function getHeader(_0x4ebd99){var _0x480e38=[];for(var _0x512d86 in _0x4ebd99){if(_0x4ebd99[_0x7adf('0xe')](_0x512d86)){_0x480e38[_0x7adf('0xf')]({'text':_0x512d86,'style':'tableHeader'});}}return _0x480e38;}function extractReport(_0x47e5fb){var _0x50f6b5=0x1388;var _0x3a2952;if(!_0x47e5fb[0x0][_0x7adf('0x10')]){return analyticExtractedReport(_0x7adf('0x11'));}var _0x5267b5=[];var _0x51838a=0x0;var _0x21b56d=!![];var _0x1a7e49=path[_0x7adf('0x12')](PATH);var _0x1547f7=path['basename'](PATH,_0x7adf('0x13'));var _0x56608f=![];var _0x232cac=[];return db[_0x7adf('0x14')][_0x7adf('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7adf('0x16'),_0x7adf('0x17')]})[_0x7adf('0x18')](function(_0x3a5b3b){if(_0x3a5b3b){_0x3a2952=_0x3a5b3b;_0x50f6b5=_0x3a2952[_0x7adf('0x17')]||0x3e8;}})[_0x7adf('0x18')](function(){if(_0x47e5fb&&_0x47e5fb[_0x7adf('0x19')]){var _0x12bcc4=_0x47e5fb[0x0][_0x7adf('0x10')]%(_0x51838a+_0x50f6b5);if(_0x3a2952[_0x7adf('0x16')]){for(;_0x21b56d;_0x51838a+=_0x50f6b5,_0x12bcc4=_0x47e5fb[0x0][_0x7adf('0x10')]%(_0x51838a+_0x50f6b5)){if(_0x12bcc4==0x0||_0x12bcc4==_0x47e5fb[0x0][_0x7adf('0x10')]){_0x21b56d=![];}_0x5267b5[_0x7adf('0xf')](dbH[_0x7adf('0x1a')]['query'](util[_0x7adf('0x1b')](_0x7adf('0x1c'),QUERY,_0x50f6b5,_0x51838a),{'type':dbH[_0x7adf('0x1a')][_0x7adf('0x1d')][_0x7adf('0x1e')]}));}}else{_0x5267b5['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x7adf('0x1a')]['QueryTypes']['SELECT']}));}}_0x56608f=_0x3a2952[_0x7adf('0x16')]&&_0x5267b5['length']>0x1;if(!fs[_0x7adf('0x1f')](path['join'](_0x1a7e49,_0x1547f7))&&_0x56608f){fs[_0x7adf('0x20')](path['join'](_0x1a7e49,_0x1547f7));}return BPromise[_0x7adf('0x21')](_0x5267b5,function(_0x4c7ab0){_0x232cac['push'](_0x4c7ab0);});})[_0x7adf('0x18')](function(){return BPromise[_0x7adf('0x21')](_0x5267b5,function(_0x40c400,_0x5b0d33){var _0x213fd3;var _0x3c289f=util[_0x7adf('0x1b')](_0x7adf('0x22'),NAME,_extractedReport[_0x7adf('0x23')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport['endDate'])['format'](FORMAT));var _0xc7ebda={'pageSize':'A4','pageOrientation':_0x7adf('0x24'),'content':[{'text':_0x3c289f,'style':_0x7adf('0x25')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x25b6ee={'headerRows':0x1,'body':[]};_0x25b6ee[_0x7adf('0x26')][_0x7adf('0xf')](getHeader(_0x40c400[0x0]));var _0x5e5443;for(var _0x55729d=0x0;_0x55729d<_0x40c400[_0x7adf('0x19')];_0x55729d+=0x1){_0x5e5443=[];for(var _0x54f9f6 in _0x40c400[_0x55729d]){if(_0x40c400[_0x55729d][_0x7adf('0xe')](_0x54f9f6)){_0x5e5443['push'](_0x40c400[_0x55729d][_0x54f9f6]?_[_0x7adf('0x27')](_0x40c400[_0x55729d][_0x54f9f6]):'');}}_0x25b6ee[_0x7adf('0x26')][_0x7adf('0xf')](_0x5e5443);}_0xc7ebda[_0x7adf('0x28')][_0x7adf('0xf')]({'table':_0x25b6ee});return new BPromise(function(_0x2a3dcc,_0x200ee8){var _0x170fbc=new PdfPrinter({'Roboto':{'normal':__dirname+_0x7adf('0x29'),'bold':__dirname+_0x7adf('0x2a'),'italics':__dirname+_0x7adf('0x2b'),'bolditalics':__dirname+_0x7adf('0x2c')}});var _0x1b5fdc=_0x170fbc[_0x7adf('0x2d')](_0xc7ebda);if(_0x56608f){_0x213fd3=path[_0x7adf('0x2e')](_0x1a7e49,_0x1547f7,util['format'](_0x7adf('0x2f'),_0x1547f7,_0x5b0d33,_0x7adf('0x30')));}else{_0x213fd3=path[_0x7adf('0x2e')](_0x1a7e49,util[_0x7adf('0x1b')](_0x7adf('0x31'),_0x1547f7,'pdf'));}var _0x18b237=_0x1b5fdc[_0x7adf('0x32')](fs[_0x7adf('0x33')](_0x213fd3));_0x18b237['on'](_0x7adf('0x34'),function(){_0x2a3dcc();});_0x18b237['on'](_0x7adf('0x35'),function(_0x1fe371){console[_0x7adf('0x36')](_0x7adf('0x37'),_0x1fe371);_0x200ee8(_0x1fe371);});_0x1b5fdc[_0x7adf('0x38')]();});});})[_0x7adf('0x18')](function(){if(_0x56608f){return new BPromise(function(_0x1939ee,_0xbd9462){zipdir(path[_0x7adf('0x2e')](_0x1a7e49,_0x1547f7),{'saveTo':path[_0x7adf('0x2e')](_0x1a7e49,util[_0x7adf('0x1b')](_0x7adf('0x31'),_0x1547f7,_0x7adf('0x39')))},function(_0xd22577){if(_0xd22577){_0xbd9462(_0xd22577);}else{_0x1939ee();}});});}})[_0x7adf('0x18')](function(){if(_0x56608f){rimraf(path['join'](_0x1a7e49,_0x1547f7),function(){});}})[_0x7adf('0x18')](function(){logger[_0x7adf('0x3a')](util[_0x7adf('0x1b')](_0x7adf('0x3b'),EXTRACTED_REPORT_ID,_0x7adf('0x3c')));return analyticExtractedReport(_0x7adf('0x3d'),_0x56608f?util[_0x7adf('0x1b')]('%s.%s',_0x1547f7,_0x56608f?'zip':'pdf'):null);});}function main(){logger[_0x7adf('0x3a')](util[_0x7adf('0x1b')](_0x7adf('0x3e'),EXTRACTED_REPORT_ID,_0x7adf('0x3f')));return db[_0x7adf('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7adf('0x18')](function(_0x1fd96b){_extractedReport=_0x1fd96b;return dbH['sequelize'][_0x7adf('0x40')](util[_0x7adf('0x1b')](_0x7adf('0x41'),QUERY),{'type':dbH[_0x7adf('0x1a')][_0x7adf('0x1d')][_0x7adf('0x1e')]});})[_0x7adf('0x18')](extractReport)[_0x7adf('0x42')](function(_0x12e0b2){logger[_0x7adf('0x3a')](util[_0x7adf('0x1b')](_0x7adf('0x43'),EXTRACTED_REPORT_ID,_0x7adf('0x3f')),util[_0x7adf('0x44')](_0x12e0b2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7adf('0x45'));});}main(); \ No newline at end of file +var _0x766f=['push','tableHeader','Empty','basename','.pdf','Setting','splitSizePdf','then','length','num','split','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','header','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','end','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x766f,0xbf));var _0xf766=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x766f[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xf766('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xf766('0x1'));var path=require(_0xf766('0x2'));var moment=require(_0xf766('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xf766('0x4'));var rimraf=require(_0xf766('0x5'));var db=require(_0xf766('0x6'))['db'];var dbH=require(_0xf766('0x6'))[_0xf766('0x7')];var logger=require(_0xf766('0x8'))(_0xf766('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf766('0xa')][0x2]);var QUERY=process[_0xf766('0xa')][0x3];var PATH=process[_0xf766('0xa')][0x4];var NAME=process[_0xf766('0xa')][0x5];var FORMAT=_0xf766('0xb');var _extractedReport;function analyticExtractedReport(_0xcb4c7e,_0x58eefa){var _0x3b2410={'status':_0xcb4c7e};var _0x46b0da={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x58eefa){_0x3b2410[_0xf766('0xc')]=_0x58eefa;}return db[_0xf766('0xd')][_0xf766('0xe')](_0x3b2410,_0x46b0da);}function getHeader(_0x1f8373){var _0x1e45ce=[];for(var _0x45be94 in _0x1f8373){if(_0x1f8373[_0xf766('0xf')](_0x45be94)){_0x1e45ce[_0xf766('0x10')]({'text':_0x45be94,'style':_0xf766('0x11')});}}return _0x1e45ce;}function extractReport(_0x33b516){var _0x26f585=0x1388;var _0x50ddda;if(!_0x33b516[0x0]['num']){return analyticExtractedReport(_0xf766('0x12'));}var _0x33805e=[];var _0x2559a2=0x0;var _0x26da79=!![];var _0x4db69e=path['dirname'](PATH);var _0x3807df=path[_0xf766('0x13')](PATH,_0xf766('0x14'));var _0x104d16=![];var _0x5c3e7f=[];return db[_0xf766('0x15')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf766('0x16')]})[_0xf766('0x17')](function(_0x155281){if(_0x155281){_0x50ddda=_0x155281;_0x26f585=_0x50ddda['splitSizePdf']||0x3e8;}})[_0xf766('0x17')](function(){if(_0x33b516&&_0x33b516[_0xf766('0x18')]){var _0x5db763=_0x33b516[0x0][_0xf766('0x19')]%(_0x2559a2+_0x26f585);if(_0x50ddda[_0xf766('0x1a')]){for(;_0x26da79;_0x2559a2+=_0x26f585,_0x5db763=_0x33b516[0x0]['num']%(_0x2559a2+_0x26f585)){if(_0x5db763==0x0||_0x5db763==_0x33b516[0x0][_0xf766('0x19')]){_0x26da79=![];}_0x33805e[_0xf766('0x10')](dbH[_0xf766('0x1b')][_0xf766('0x1c')](util[_0xf766('0x1d')](_0xf766('0x1e'),QUERY,_0x26f585,_0x2559a2),{'type':dbH[_0xf766('0x1b')][_0xf766('0x1f')][_0xf766('0x20')]}));}}else{_0x33805e['push'](dbH[_0xf766('0x1b')][_0xf766('0x1c')](QUERY,{'type':dbH[_0xf766('0x1b')]['QueryTypes']['SELECT']}));}}_0x104d16=_0x50ddda['split']&&_0x33805e[_0xf766('0x18')]>0x1;if(!fs[_0xf766('0x21')](path[_0xf766('0x22')](_0x4db69e,_0x3807df))&&_0x104d16){fs[_0xf766('0x23')](path[_0xf766('0x22')](_0x4db69e,_0x3807df));}return BPromise[_0xf766('0x24')](_0x33805e,function(_0x30ae99){_0x5c3e7f[_0xf766('0x10')](_0x30ae99);});})[_0xf766('0x17')](function(){return BPromise['each'](_0x33805e,function(_0x5b2ffc,_0x20f4ee){var _0x3396d4;var _0x823173=util[_0xf766('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xf766('0x25')],moment(_extractedReport[_0xf766('0x26')])[_0xf766('0x1d')](FORMAT),moment(_extractedReport[_0xf766('0x27')])['format'](FORMAT));var _0x592698={'pageSize':'A4','pageOrientation':_0xf766('0x28'),'content':[{'text':_0x823173,'style':_0xf766('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf766('0x2a')}}};var _0x48eaed={'headerRows':0x1,'body':[]};_0x48eaed[_0xf766('0x2b')][_0xf766('0x10')](getHeader(_0x5b2ffc[0x0]));var _0x32f8a9;for(var _0x4800d1=0x0;_0x4800d1<_0x5b2ffc[_0xf766('0x18')];_0x4800d1+=0x1){_0x32f8a9=[];for(var _0x41c38e in _0x5b2ffc[_0x4800d1]){if(_0x5b2ffc[_0x4800d1][_0xf766('0xf')](_0x41c38e)){_0x32f8a9[_0xf766('0x10')](_0x5b2ffc[_0x4800d1][_0x41c38e]?_['toString'](_0x5b2ffc[_0x4800d1][_0x41c38e]):'');}}_0x48eaed[_0xf766('0x2b')]['push'](_0x32f8a9);}_0x592698[_0xf766('0x2c')][_0xf766('0x10')]({'table':_0x48eaed});return new BPromise(function(_0x2f1b3e,_0x4c3b08){var _0x4421d9=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xf766('0x2d'),'italics':__dirname+_0xf766('0x2e'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x39a519=_0x4421d9[_0xf766('0x2f')](_0x592698);if(_0x104d16){_0x3396d4=path['join'](_0x4db69e,_0x3807df,util[_0xf766('0x1d')](_0xf766('0x30'),_0x3807df,_0x20f4ee,_0xf766('0x31')));}else{_0x3396d4=path[_0xf766('0x22')](_0x4db69e,util['format'](_0xf766('0x32'),_0x3807df,_0xf766('0x31')));}var _0x350a9b=_0x39a519[_0xf766('0x33')](fs[_0xf766('0x34')](_0x3396d4));_0x350a9b['on'](_0xf766('0x35'),function(){_0x2f1b3e();});_0x350a9b['on'](_0xf766('0x36'),function(_0x128d0b){console[_0xf766('0x37')](_0xf766('0x38'),_0x128d0b);_0x4c3b08(_0x128d0b);});_0x39a519[_0xf766('0x39')]();});});})[_0xf766('0x17')](function(){if(_0x104d16){return new BPromise(function(_0xf6ef5f,_0x841e76){zipdir(path[_0xf766('0x22')](_0x4db69e,_0x3807df),{'saveTo':path['join'](_0x4db69e,util['format'](_0xf766('0x32'),_0x3807df,'zip'))},function(_0x271690){if(_0x271690){_0x841e76(_0x271690);}else{_0xf6ef5f();}});});}})['then'](function(){if(_0x104d16){rimraf(path[_0xf766('0x22')](_0x4db69e,_0x3807df),function(){});}})['then'](function(){logger['info'](util[_0xf766('0x1d')](_0xf766('0x3a'),EXTRACTED_REPORT_ID,_0xf766('0x3b')));return analyticExtractedReport(_0xf766('0x3c'),_0x104d16?util[_0xf766('0x1d')](_0xf766('0x32'),_0x3807df,_0x104d16?_0xf766('0x3d'):_0xf766('0x31')):null);});}function main(){logger[_0xf766('0x3e')](util[_0xf766('0x1d')](_0xf766('0x3f'),EXTRACTED_REPORT_ID,_0xf766('0x40')));return db[_0xf766('0xd')][_0xf766('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf766('0x17')](function(_0x5ebf7a){_extractedReport=_0x5ebf7a;return dbH['sequelize'][_0xf766('0x1c')](util[_0xf766('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xf766('0x1f')]['SELECT']});})[_0xf766('0x17')](extractReport)[_0xf766('0x42')](function(_0x4eea92){logger['info'](util[_0xf766('0x1d')](_0xf766('0x43'),EXTRACTED_REPORT_ID,_0xf766('0x40')),util['inspect'](_0x4eea92,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xf766('0x44'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2cbd9cd..e71d400 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 _0xa9ad=['bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','writeFileSync','binary','%s.%s','zip','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash'];(function(_0x580b90,_0x217808){var _0x16c032=function(_0xb7c318){while(--_0xb7c318){_0x580b90['push'](_0x580b90['shift']());}};_0x16c032(++_0x217808);}(_0xa9ad,0x19b));var _0xda9a=function(_0x4fc49d,_0x26f84f){_0x4fc49d=_0x4fc49d-0x0;var _0x1c4263=_0xa9ad[_0x4fc49d];return _0x1c4263;};'use strict';var util=require(_0xda9a('0x0'));var path=require(_0xda9a('0x1'));var _=require(_0xda9a('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xda9a('0x3'));var zipdir=require(_0xda9a('0x4'));var rimraf=require('rimraf');var db=require(_0xda9a('0x5'))['db'];var dbH=require(_0xda9a('0x5'))[_0xda9a('0x6')];var logger=require(_0xda9a('0x7'))(_0xda9a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xda9a('0x9')][0x2]);var QUERY=process[_0xda9a('0x9')][0x3];var PATH=process[_0xda9a('0x9')][0x4];function analyticExtractedReport(_0x5e0434,_0x2758be){var _0x5e914a={'status':_0x5e0434};var _0x35aeb7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2758be){_0x5e914a['savename']=_0x2758be;}return db[_0xda9a('0xa')]['update'](_0x5e914a,_0x35aeb7);}function main(){var _0x561ac0=0x1388;var _0x44d811;logger[_0xda9a('0xb')](util[_0xda9a('0xc')](_0xda9a('0xd'),EXTRACTED_REPORT_ID,_0xda9a('0xe')));return db[_0xda9a('0xf')][_0xda9a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xda9a('0x11'),_0xda9a('0x12')]})[_0xda9a('0x13')](function(_0x3cf0b9){if(_0x3cf0b9){_0x44d811=_0x3cf0b9;_0x561ac0=_0x44d811['splitSizeXlsx']||0x1388;}})[_0xda9a('0x13')](function(){return dbH[_0xda9a('0x14')]['query'](util['format'](_0xda9a('0x15'),QUERY),{'type':dbH[_0xda9a('0x14')][_0xda9a('0x16')][_0xda9a('0x17')]});})['then'](function(_0x1ed2b8){if(!_0x1ed2b8[0x0]['num']){return analyticExtractedReport(_0xda9a('0x18'));}var _0x3bb997=[];var _0x13132a=0x0;var _0x53fdf6=!![];if(_0x44d811[_0xda9a('0x11')]){if(_0x1ed2b8&&_0x1ed2b8[_0xda9a('0x19')]){var _0x57985c=_0x1ed2b8[0x0][_0xda9a('0x1a')]%(_0x13132a+_0x561ac0);for(;_0x53fdf6;_0x13132a+=_0x561ac0,_0x57985c=_0x1ed2b8[0x0][_0xda9a('0x1a')]%(_0x13132a+_0x561ac0)){if(_0x57985c==0x0||_0x57985c==_0x1ed2b8[0x0]['num']){_0x53fdf6=![];}_0x3bb997[_0xda9a('0x1b')](dbH[_0xda9a('0x14')][_0xda9a('0x1c')](util['format'](_0xda9a('0x1d'),QUERY,_0x561ac0,_0x13132a),{'type':dbH[_0xda9a('0x14')][_0xda9a('0x16')][_0xda9a('0x17')]}));}}}else{_0x3bb997['push'](dbH[_0xda9a('0x14')][_0xda9a('0x1c')](QUERY,{'type':dbH[_0xda9a('0x14')][_0xda9a('0x16')]['SELECT']}));}var _0x48093c=path[_0xda9a('0x1e')](PATH);var _0x5cb18f=path[_0xda9a('0x1f')](PATH,_0xda9a('0x20'));var _0x280058=_0x44d811[_0xda9a('0x11')]&&_0x3bb997[_0xda9a('0x19')]>0x1;var _0x53e343=[];if(!fs[_0xda9a('0x21')](path[_0xda9a('0x22')](_0x48093c,_0x5cb18f))&&_0x280058){fs[_0xda9a('0x23')](path[_0xda9a('0x22')](_0x48093c,_0x5cb18f));}return BPromise[_0xda9a('0x24')](_0x3bb997,function(_0x23a659){_0x53e343[_0xda9a('0x1b')](_0x23a659);})['then'](function(){for(var _0x4f555c=0x0;_0x4f555c<_0x53e343[_0xda9a('0x19')];_0x4f555c+=0x1){var _0x461226;var _0x10949f=_0x53e343[_0x4f555c];if(_0x280058){_0x461226=path[_0xda9a('0x22')](_0x48093c,_0x5cb18f,util[_0xda9a('0xc')](_0xda9a('0x25'),_0x5cb18f,_0x4f555c,'xlsx'));}else{_0x461226=path[_0xda9a('0x22')](_0x48093c,util[_0xda9a('0xc')]('%s.%s',_0x5cb18f,'xlsx'));}fs[_0xda9a('0x26')](_0x461226,json2xls(_0x10949f),_0xda9a('0x27'));}})[_0xda9a('0x13')](function(){if(_0x280058){zipdir(path[_0xda9a('0x22')](_0x48093c,_0x5cb18f),{'saveTo':path[_0xda9a('0x22')](_0x48093c,util[_0xda9a('0xc')](_0xda9a('0x28'),_0x5cb18f,_0xda9a('0x29')))},function(_0x5e3fc0,_0x2bcfc0){});rimraf(path['join'](_0x48093c,_0x5cb18f),function(){});}})[_0xda9a('0x13')](function(){logger[_0xda9a('0xb')](util[_0xda9a('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xda9a('0xe')));return analyticExtractedReport('Completed',_0x280058?util[_0xda9a('0xc')]('%s.%s',_0x5cb18f,_0x280058?_0xda9a('0x29'):_0xda9a('0x2a')):null);});})[_0xda9a('0x2b')](function(_0x32b2ad){logger['info'](util[_0xda9a('0xc')](_0xda9a('0x2c'),EXTRACTED_REPORT_ID,_0xda9a('0xe')),util['inspect'](_0x32b2ad,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xda9a('0x2d'));});}main(); \ No newline at end of file +var _0xb166=['zip','catch','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','XLSX','Setting','find','splitSizeXlsx','then','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','Empty','split','length','num','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary'];(function(_0x5abdcf,_0x461150){var _0x12489d=function(_0x50d613){while(--_0x50d613){_0x5abdcf['push'](_0x5abdcf['shift']());}};_0x12489d(++_0x461150);}(_0xb166,0x190));var _0x6b16=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xb166[_0xdd0313];return _0x2bd7e8;};'use strict';var util=require(_0x6b16('0x0'));var path=require(_0x6b16('0x1'));var _=require(_0x6b16('0x2'));var fs=require('fs');var json2xls=require(_0x6b16('0x3'));var BPromise=require(_0x6b16('0x4'));var zipdir=require(_0x6b16('0x5'));var rimraf=require(_0x6b16('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x6b16('0x7')];var logger=require(_0x6b16('0x8'))(_0x6b16('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x6b16('0xa')][0x2]);var QUERY=process[_0x6b16('0xa')][0x3];var PATH=process[_0x6b16('0xa')][0x4];function analyticExtractedReport(_0x16cb2d,_0xf69a2e){var _0x4e736e={'status':_0x16cb2d};var _0x5f4c7c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf69a2e){_0x4e736e[_0x6b16('0xb')]=_0xf69a2e;}return db[_0x6b16('0xc')]['update'](_0x4e736e,_0x5f4c7c);}function main(){var _0x19a366=0x1388;var _0x320895;logger[_0x6b16('0xd')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6b16('0xe')));return db[_0x6b16('0xf')][_0x6b16('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6b16('0x11')]})[_0x6b16('0x12')](function(_0x551a07){if(_0x551a07){_0x320895=_0x551a07;_0x19a366=_0x320895[_0x6b16('0x11')]||0x1388;}})[_0x6b16('0x12')](function(){return dbH['sequelize']['query'](util[_0x6b16('0x13')](_0x6b16('0x14'),QUERY),{'type':dbH[_0x6b16('0x15')]['QueryTypes'][_0x6b16('0x16')]});})[_0x6b16('0x12')](function(_0xc41131){if(!_0xc41131[0x0]['num']){return analyticExtractedReport(_0x6b16('0x17'));}var _0x4ab754=[];var _0x3995ee=0x0;var _0x1d08b5=!![];if(_0x320895[_0x6b16('0x18')]){if(_0xc41131&&_0xc41131[_0x6b16('0x19')]){var _0x4e1e87=_0xc41131[0x0]['num']%(_0x3995ee+_0x19a366);for(;_0x1d08b5;_0x3995ee+=_0x19a366,_0x4e1e87=_0xc41131[0x0][_0x6b16('0x1a')]%(_0x3995ee+_0x19a366)){if(_0x4e1e87==0x0||_0x4e1e87==_0xc41131[0x0][_0x6b16('0x1a')]){_0x1d08b5=![];}_0x4ab754[_0x6b16('0x1b')](dbH['sequelize'][_0x6b16('0x1c')](util[_0x6b16('0x13')](_0x6b16('0x1d'),QUERY,_0x19a366,_0x3995ee),{'type':dbH[_0x6b16('0x15')][_0x6b16('0x1e')][_0x6b16('0x16')]}));}}}else{_0x4ab754[_0x6b16('0x1b')](dbH['sequelize'][_0x6b16('0x1c')](QUERY,{'type':dbH[_0x6b16('0x15')][_0x6b16('0x1e')]['SELECT']}));}var _0x515aba=path[_0x6b16('0x1f')](PATH);var _0x20f6d2=path[_0x6b16('0x20')](PATH,'.xlsx');var _0x271c24=_0x320895[_0x6b16('0x18')]&&_0x4ab754[_0x6b16('0x19')]>0x1;var _0x17eafa=[];if(!fs['existsSync'](path[_0x6b16('0x21')](_0x515aba,_0x20f6d2))&&_0x271c24){fs['mkdirSync'](path[_0x6b16('0x21')](_0x515aba,_0x20f6d2));}return BPromise[_0x6b16('0x22')](_0x4ab754,function(_0xe9b43a){_0x17eafa[_0x6b16('0x1b')](_0xe9b43a);})[_0x6b16('0x12')](function(){for(var _0x36b89b=0x0;_0x36b89b<_0x17eafa['length'];_0x36b89b+=0x1){var _0x3e72a0;var _0x56ab88=_0x17eafa[_0x36b89b];if(_0x271c24){_0x3e72a0=path[_0x6b16('0x21')](_0x515aba,_0x20f6d2,util['format'](_0x6b16('0x23'),_0x20f6d2,_0x36b89b,_0x6b16('0x24')));}else{_0x3e72a0=path[_0x6b16('0x21')](_0x515aba,util[_0x6b16('0x13')](_0x6b16('0x25'),_0x20f6d2,_0x6b16('0x24')));}fs[_0x6b16('0x26')](_0x3e72a0,json2xls(_0x56ab88),_0x6b16('0x27'));}})[_0x6b16('0x12')](function(){if(_0x271c24){zipdir(path[_0x6b16('0x21')](_0x515aba,_0x20f6d2),{'saveTo':path['join'](_0x515aba,util[_0x6b16('0x13')]('%s.%s',_0x20f6d2,_0x6b16('0x28')))},function(_0x50f02d,_0x2ac1ad){});rimraf(path[_0x6b16('0x21')](_0x515aba,_0x20f6d2),function(){});}})[_0x6b16('0x12')](function(){logger[_0x6b16('0xd')](util[_0x6b16('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6b16('0xe')));return analyticExtractedReport('Completed',_0x271c24?util[_0x6b16('0x13')](_0x6b16('0x25'),_0x20f6d2,_0x271c24?_0x6b16('0x28'):'xlsx'):null);});})[_0x6b16('0x29')](function(_0x21caa3){logger['info'](util[_0x6b16('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6b16('0xe')),util[_0x6b16('0x2a')](_0x21caa3,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6b16('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 6e2bb3a..5e9035e 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 _0x688a=['recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','error','lodash','util','models','Interval','findAll','VoiceExtension','IntervalId','then','filter','exten','queue','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x688a,0x12f));var _0xa688=function(_0x366b39,_0x88906b){_0x366b39=_0x366b39-0x0;var _0xff0a2e=_0x688a[_0x366b39];return _0xff0a2e;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));function rewrite(_0xacd6d8,_0x45f769){var _0x1ffa1f=this;return _0xacd6d8[_0xa688('0x2')][_0xa688('0x3')][_0xa688('0x4')]({'raw':!![]})['then'](function(_0x3dcfc9){_0x1ffa1f['intervals']=_0x3dcfc9;return _0xacd6d8['models'][_0xa688('0x5')]['findAll']({'where':{'IntervalId':_0x45f769[_0xa688('0x6')]},'raw':!![]});})[_0xa688('0x7')](function(_0x158680){return _0xacd6d8[_0xa688('0x2')][_0xa688('0x5')][_0xa688('0x4')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x158680,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x3955a3){var _0x881e5d=_[_0xa688('0x8')](_0x3955a3,{'priority':'1'});var _0x36a305=_[_0xa688('0x8')](_0x3955a3,{'isApp':0x1});var _0x189346=_['groupBy'](_0x36a305,_0xa688('0x9'));var _0x1f7edc=[_0xa688('0xa'),'playback'];var _0x5539b8=[];var _0x11d8b5=[];for(var _0x3de683 in _0x189346){if(_0x189346['hasOwnProperty'](_0x3de683)){_0x1ffa1f[_0xa688('0xb')]=0x2;_0x1ffa1f['extensions']=[];_0x1ffa1f[_0xa688('0xc')]=_[_0xa688('0xd')](_0x881e5d,{'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')]});_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':util[_0xa688('0x12')](_0xa688('0x13'),_0x189346[_0x3de683][0x0][_0xa688('0x10')]),'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});if(_0x189346[_0x3de683][0x0]['type']==='outbound'){if(_0x1ffa1f['extension']){_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':'CDR(destination)='+(_0x1ffa1f[_0xa688('0xc')]['cutdigits']?_0xa688('0x16')+_0x1ffa1f[_0xa688('0xc')]['cutdigits']+'}':_0xa688('0x17')),'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0]['exten'],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});}_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':'Set','appdata':_0xa688('0x18')+_0x189346[_0x3de683][0x0]['VoiceExtensionId'],'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});var _0x3bd584=_0x1ffa1f[_0xa688('0xb')]++;_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x19'),'appdata':_0xa688('0x1a')+(_0x3bd584+0x2)+_0xa688('0x1b')+(_0x3bd584+0x1)+')','context':_0x189346[_0x3de683][0x0]['context'],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x3bd584,'VoiceExtensionId':_0x189346[_0x3de683][0x0]['VoiceExtensionId']});if(_0x1ffa1f['extension']){_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':'Set','appdata':_0x1ffa1f['extension'][_0xa688('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x1ffa1f['extension'][_0xa688('0x1c')]+'}':_0xa688('0x1d'),'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0]['exten'],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});}_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':'Set','appdata':_0xa688('0x1e')+_0x189346[_0x3de683][0x0]['VoiceExtensionId'],'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0]['VoiceExtensionId']});if(_0x1ffa1f['extension']&&_0x1ffa1f['extension'][_0xa688('0x1f')](_0xa688('0x20'))&&_0x1ffa1f[_0xa688('0xc')][_0xa688('0x20')]!=='none'){_0x1ffa1f[_0xa688('0xe')]['push']({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':_0xa688('0x21'),'context':_0x189346[_0x3de683][0x0]['context'],'exten':_0x189346[_0x3de683][0x0]['exten'],'priority':_0x1ffa1f['priority']++,'VoiceExtensionId':_0x189346[_0x3de683][0x0]['VoiceExtensionId']});_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1ffa1f['extension'][_0xa688('0x20')]||_0xa688('0x22'),'context':_0x189346[_0x3de683][0x0]['context'],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});}}_0x1ffa1f[_0xa688('0xe')]['push']({'type':_0x189346[_0x3de683][0x0]['type'],'app':_0xa688('0x11'),'appdata':_0xa688('0x23'),'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0]['type'],'app':_0xa688('0x11'),'appdata':_0xa688('0x24'),'context':_0x189346[_0x3de683][0x0][_0xa688('0x14')],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f['priority']++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});_0x1ffa1f[_0xa688('0xe')][_0xa688('0xf')]({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':'Set','appdata':_0xa688('0x25'),'context':_0x189346[_0x3de683][0x0]['context'],'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'priority':_0x1ffa1f[_0xa688('0xb')]++,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});for(var _0x1a306e=0x0,_0x3b2750=0x0;_0x1a306e<_0x189346[_0x3de683]['length'];_0x1a306e+=0x1,_0x3b2750=0x0){var _0x5b7eef=_0x189346[_0x3de683][_0x1a306e];if(_0x5b7eef[_0xa688('0x10')]){_0x5b7eef['type']=_0x5b7eef[_0xa688('0x10')]['toLowerCase']();}var _0x45dc18=[];var _0x3fe6b2=[];delete _0x5b7eef['id'];delete _0x5b7eef[_0xa688('0x26')];delete _0x5b7eef[_0xa688('0x27')];var _0x2cf624=_0x5b7eef[_0xa688('0x28')]!==_0xa688('0x29')?[_0x5b7eef[_0xa688('0x28')]]:_0x5b7eef[_0xa688('0x6')]?_['map'](_[_0xa688('0x8')](_0x1ffa1f[_0xa688('0x2a')],{'IntervalId':_0x5b7eef[_0xa688('0x6')]}),_0xa688('0x28')):[];if(_0x5b7eef[_0xa688('0x1f')](_0xa688('0x2b'))){if(_0x5b7eef[_0xa688('0x2b')]&&_0x5b7eef[_0xa688('0x2b')]!=='--'){_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':'CDR(tag)='+_0x5b7eef[_0xa688('0x2b')],'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef['exten'],'priority':_0x2cf624[_0xa688('0x2c')]+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef['VoiceExtensionId']});}}if(_0x5b7eef[_0xa688('0x10')]==='outbound'&&_0x5b7eef[_0xa688('0x1f')](_0xa688('0x2d'))){if(_0x5b7eef['callerID']){_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':'ExecIf','appdata':_0xa688('0x2e')+_0x5b7eef[_0xa688('0x2d')]+')','context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef[_0xa688('0x9')],'priority':_0x2cf624['length']+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef['VoiceExtensionId']});}else{_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':_0xa688('0x19'),'appdata':_0xa688('0x2f'),'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef['exten'],'priority':_0x2cf624[_0xa688('0x2c')]+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef[_0xa688('0x15')]});}}if(_0x5b7eef[_0xa688('0x1f')](_0xa688('0x30'))){if(_0x1f7edc[_0xa688('0x31')](_0x5b7eef[_0xa688('0x32')][_0xa688('0x33')]())>=0x0&&_0x5b7eef[_0xa688('0x34')]!==_0xa688('0x35')){if(_0x5b7eef[_0xa688('0x30')]){_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':'ExecIf','appdata':_0xa688('0x36'),'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef[_0xa688('0x9')],'priority':_0x2cf624[_0xa688('0x2c')]+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef[_0xa688('0x15')]});_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':_0xa688('0x11'),'appdata':_0xa688('0x37'),'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef[_0xa688('0x9')],'priority':_0x2cf624['length']+_0x1ffa1f['priority']+_0x3b2750++,'VoiceExtensionId':_0x5b7eef[_0xa688('0x15')]});}else{_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef[_0xa688('0x10')],'app':_0xa688('0x19'),'appdata':_0xa688('0x38'),'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef[_0xa688('0x9')],'priority':_0x2cf624[_0xa688('0x2c')]+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef[_0xa688('0x15')]});_0x45dc18[_0xa688('0xf')]({'type':_0x5b7eef['type'],'app':_0xa688('0x11'),'appdata':_0xa688('0x39'),'context':_0x5b7eef[_0xa688('0x14')],'exten':_0x5b7eef[_0xa688('0x9')],'priority':_0x2cf624[_0xa688('0x2c')]+_0x1ffa1f[_0xa688('0xb')]+_0x3b2750++,'VoiceExtensionId':_0x5b7eef[_0xa688('0x15')]});}}}for(var _0xba3ba9=0x0;_0xba3ba9<_0x2cf624['length'];_0xba3ba9+=0x1){var _0x54ea3f=_0x1ffa1f[_0xa688('0xb')]+_0x2cf624[_0xa688('0x2c')];var _0x1d303c=_0xba3ba9===_0x2cf624[_0xa688('0x2c')]-0x1?_0x1ffa1f['priority']+_0x45dc18['length']+_0x3fe6b2['length']+0x2:_0x1ffa1f[_0xa688('0xb')]+_0xba3ba9+0x1;_0x45dc18[_0xa688('0x3a')](_0xba3ba9,0x0,{'type':_0x5b7eef[_0xa688('0x10')],'app':_0xa688('0x3b'),'appdata':_0x2cf624[_0xba3ba9]+'?'+_0x5b7eef['context']+_0xa688('0x3c')+_0x54ea3f+':'+_0x5b7eef[_0xa688('0x14')]+_0xa688('0x3c')+_0x1d303c,'exten':_0x5b7eef[_0xa688('0x9')],'context':_0x5b7eef[_0xa688('0x14')],'priority':_0x1ffa1f[_0xa688('0xb')]+_0xba3ba9,'VoiceExtensionId':_0x189346[_0x3de683][0x0][_0xa688('0x15')]});}_0x5b7eef['priority']=_0x45dc18[_0xa688('0x2c')]?_[_0xa688('0x3d')](_0x45dc18)[_0xa688('0xb')]+0x1:_0x1ffa1f[_0xa688('0xb')];_0x1ffa1f[_0xa688('0xb')]=(_0x3fe6b2[_0xa688('0x2c')]?_[_0xa688('0x3d')](_0x3fe6b2)[_0xa688('0xb')]:_0x5b7eef[_0xa688('0xb')])+0x1;_0x1ffa1f[_0xa688('0xe')]=_[_0xa688('0x3e')](_0x1ffa1f['extensions'],_0x45dc18,[_0x5b7eef],_0x3fe6b2);}_0x1ffa1f[_0xa688('0xe')]['push']({'type':_0x189346[_0x3de683][0x0][_0xa688('0x10')],'app':_0xa688('0x3f'),'exten':_0x189346[_0x3de683][0x0][_0xa688('0x9')],'context':_0x189346[_0x3de683][0x0]['context'],'priority':_0x1ffa1f[_0xa688('0xb')],'VoiceExtensionId':_0x189346[_0x3de683][0x0]['VoiceExtensionId']});_0x5539b8[_0xa688('0xf')](_0x189346[_0x3de683][0x0][_0xa688('0x15')]);_0x11d8b5=_[_0xa688('0x3e')](_0x11d8b5,_0x1ffa1f[_0xa688('0xe')]);}}return _0xacd6d8[_0xa688('0x40')](function(_0x42ed2f){return _0xacd6d8[_0xa688('0x2')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5539b8}},'transaction':_0x42ed2f})[_0xa688('0x7')](function(_0x41c18a){return _0xacd6d8[_0xa688('0x2')][_0xa688('0x5')][_0xa688('0x41')](_['sortBy'](_0x11d8b5,_0xa688('0xb')),{'transaction':_0x42ed2f});});});})['catch'](function(_0x17b05b){console[_0xa688('0x42')](_0x17b05b);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xfc2f=['):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','intervals','VoiceExtension','IntervalId','then','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0xfc2f,0x1a0));var _0xffc2=function(_0x4dd57c,_0x26ea40){_0x4dd57c=_0x4dd57c-0x0;var _0x3be9bc=_0xfc2f[_0x4dd57c];return _0x3be9bc;};'use strict';var _=require(_0xffc2('0x0'));var util=require(_0xffc2('0x1'));function rewrite(_0x18cf1b,_0x1fec32){var _0x274da0=this;return _0x18cf1b[_0xffc2('0x2')][_0xffc2('0x3')]['findAll']({'raw':!![]})['then'](function(_0x4b8a6f){_0x274da0[_0xffc2('0x4')]=_0x4b8a6f;return _0x18cf1b[_0xffc2('0x2')][_0xffc2('0x5')]['findAll']({'where':{'IntervalId':_0x1fec32[_0xffc2('0x6')]},'raw':!![]});})[_0xffc2('0x7')](function(_0x5c33fc){return _0x18cf1b['models']['VoiceExtension'][_0xffc2('0x8')]({'where':{'exten':{'$in':_[_0xffc2('0x9')](_[_0xffc2('0xa')](_0x5c33fc,_0xffc2('0xb')))}},'order':[{'raw':_0xffc2('0xc')}],'raw':!![]});})[_0xffc2('0x7')](function(_0x4c9d1d){var _0x24e61e=_[_0xffc2('0xd')](_0x4c9d1d,{'priority':'1'});var _0x566eb3=_['filter'](_0x4c9d1d,{'isApp':0x1});var _0x2b60cb=_[_0xffc2('0xe')](_0x566eb3,'exten');var _0x4ab747=['queue',_0xffc2('0xf')];var _0x8440e2=[];var _0x3e0e47=[];for(var _0xf53df2 in _0x2b60cb){if(_0x2b60cb[_0xffc2('0x10')](_0xf53df2)){_0x274da0[_0xffc2('0x11')]=0x2;_0x274da0[_0xffc2('0x12')]=[];_0x274da0[_0xffc2('0x13')]=_[_0xffc2('0x14')](_0x24e61e,{'exten':_0x2b60cb[_0xf53df2][0x0]['exten']});_0x274da0[_0xffc2('0x12')]['push']({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':util[_0xffc2('0x17')](_0xffc2('0x18'),_0x2b60cb[_0xf53df2][0x0]['type']),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});if(_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')]===_0xffc2('0x1b')){if(_0x274da0[_0xffc2('0x13')]){_0x274da0['extensions'][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0]['type'],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x1d')+(_0x274da0[_0xffc2('0x13')][_0xffc2('0x1e')]?_0xffc2('0x1f')+_0x274da0[_0xffc2('0x13')][_0xffc2('0x1e')]+'}':_0xffc2('0x20')),'context':_0x2b60cb[_0xf53df2][0x0]['context'],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});}_0x274da0[_0xffc2('0x12')]['push']({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':'CDR(routeid)='+_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')],'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0]['exten'],'priority':_0x274da0['priority']++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});var _0x42de8e=_0x274da0['priority']++;_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x42de8e+0x2)+_0xffc2('0x22')+(_0x42de8e+0x1)+')','context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x42de8e,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});if(_0x274da0[_0xffc2('0x13')]){_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':'Set','appdata':_0x274da0[_0xffc2('0x13')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x274da0['extension'][_0xffc2('0x1e')]+'}':_0xffc2('0x23'),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0]['exten'],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});}_0x274da0[_0xffc2('0x12')]['push']({'type':_0x2b60cb[_0xf53df2][0x0]['type'],'app':'Set','appdata':_0xffc2('0x24')+_0x2b60cb[_0xf53df2][0x0]['VoiceExtensionId'],'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0['priority']++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});if(_0x274da0[_0xffc2('0x13')]&&_0x274da0[_0xffc2('0x13')][_0xffc2('0x10')](_0xffc2('0x25'))&&_0x274da0['extension'][_0xffc2('0x25')]!==_0xffc2('0x26')){_0x274da0[_0xffc2('0x12')]['push']({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x27'),'context':_0x2b60cb[_0xf53df2][0x0]['context'],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});_0x274da0['extensions'][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0]['type'],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x28')+_0x274da0['extension'][_0xffc2('0x25')]||_0xffc2('0x29'),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});}}_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x2a'),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x2b'),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x15')],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x2c'),'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'exten':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0xb')],'priority':_0x274da0[_0xffc2('0x11')]++,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});for(var _0x3b8830=0x0,_0x1cd68a=0x0;_0x3b8830<_0x2b60cb[_0xf53df2][_0xffc2('0x2d')];_0x3b8830+=0x1,_0x1cd68a=0x0){var _0x509fc8=_0x2b60cb[_0xf53df2][_0x3b8830];if(_0x509fc8[_0xffc2('0x15')]){_0x509fc8[_0xffc2('0x15')]=_0x509fc8[_0xffc2('0x15')][_0xffc2('0x2e')]();}var _0x2b6293=[];var _0x426238=[];delete _0x509fc8['id'];delete _0x509fc8[_0xffc2('0x2f')];delete _0x509fc8[_0xffc2('0x30')];var _0x5333b3=_0x509fc8[_0xffc2('0x31')]!==_0xffc2('0x32')?[_0x509fc8[_0xffc2('0x31')]]:_0x509fc8['IntervalId']?_['map'](_[_0xffc2('0xd')](_0x274da0['intervals'],{'IntervalId':_0x509fc8[_0xffc2('0x6')]}),_0xffc2('0x31')):[];if(_0x509fc8[_0xffc2('0x10')](_0xffc2('0x33'))){if(_0x509fc8[_0xffc2('0x33')]&&_0x509fc8[_0xffc2('0x33')]!=='--'){_0x2b6293[_0xffc2('0x1c')]({'type':_0x509fc8[_0xffc2('0x15')],'app':'Set','appdata':'CDR(tag)='+_0x509fc8['tag'],'context':_0x509fc8[_0xffc2('0x19')],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3[_0xffc2('0x2d')]+_0x274da0['priority']+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});}}if(_0x509fc8[_0xffc2('0x15')]==='outbound'&&_0x509fc8[_0xffc2('0x10')](_0xffc2('0x34'))){if(_0x509fc8[_0xffc2('0x34')]){_0x2b6293[_0xffc2('0x1c')]({'type':_0x509fc8[_0xffc2('0x15')],'app':'ExecIf','appdata':_0xffc2('0x35')+_0x509fc8[_0xffc2('0x34')]+')','context':_0x509fc8['context'],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3[_0xffc2('0x2d')]+_0x274da0[_0xffc2('0x11')]+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});}else{_0x2b6293[_0xffc2('0x1c')]({'type':_0x509fc8[_0xffc2('0x15')],'app':_0xffc2('0x21'),'appdata':_0xffc2('0x36'),'context':_0x509fc8[_0xffc2('0x19')],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3[_0xffc2('0x2d')]+_0x274da0[_0xffc2('0x11')]+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});}}if(_0x509fc8[_0xffc2('0x10')]('answer')){if(_0x4ab747[_0xffc2('0x37')](_0x509fc8[_0xffc2('0x38')][_0xffc2('0x2e')]())>=0x0&&_0x509fc8[_0xffc2('0x39')]!==_0xffc2('0x3a')){if(_0x509fc8[_0xffc2('0x3b')]){_0x2b6293[_0xffc2('0x1c')]({'type':_0x509fc8[_0xffc2('0x15')],'app':_0xffc2('0x21'),'appdata':_0xffc2('0x3c'),'context':_0x509fc8['context'],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3['length']+_0x274da0['priority']+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});_0x2b6293[_0xffc2('0x1c')]({'type':_0x509fc8['type'],'app':_0xffc2('0x16'),'appdata':_0xffc2('0x3d'),'context':_0x509fc8[_0xffc2('0x19')],'exten':_0x509fc8['exten'],'priority':_0x5333b3['length']+_0x274da0[_0xffc2('0x11')]+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});}else{_0x2b6293['push']({'type':_0x509fc8[_0xffc2('0x15')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x509fc8[_0xffc2('0x19')],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3[_0xffc2('0x2d')]+_0x274da0[_0xffc2('0x11')]+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});_0x2b6293['push']({'type':_0x509fc8['type'],'app':'Set','appdata':_0xffc2('0x3e'),'context':_0x509fc8[_0xffc2('0x19')],'exten':_0x509fc8[_0xffc2('0xb')],'priority':_0x5333b3[_0xffc2('0x2d')]+_0x274da0[_0xffc2('0x11')]+_0x1cd68a++,'VoiceExtensionId':_0x509fc8[_0xffc2('0x1a')]});}}}for(var _0x5da638=0x0;_0x5da638<_0x5333b3[_0xffc2('0x2d')];_0x5da638+=0x1){var _0x5749f2=_0x274da0[_0xffc2('0x11')]+_0x5333b3[_0xffc2('0x2d')];var _0x434508=_0x5da638===_0x5333b3['length']-0x1?_0x274da0[_0xffc2('0x11')]+_0x2b6293['length']+_0x426238[_0xffc2('0x2d')]+0x2:_0x274da0[_0xffc2('0x11')]+_0x5da638+0x1;_0x2b6293[_0xffc2('0x3f')](_0x5da638,0x0,{'type':_0x509fc8[_0xffc2('0x15')],'app':_0xffc2('0x40'),'appdata':_0x5333b3[_0x5da638]+'?'+_0x509fc8[_0xffc2('0x19')]+_0xffc2('0x41')+_0x5749f2+':'+_0x509fc8[_0xffc2('0x19')]+_0xffc2('0x41')+_0x434508,'exten':_0x509fc8[_0xffc2('0xb')],'context':_0x509fc8['context'],'priority':_0x274da0['priority']+_0x5da638,'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]});}_0x509fc8['priority']=_0x2b6293[_0xffc2('0x2d')]?_[_0xffc2('0x42')](_0x2b6293)[_0xffc2('0x11')]+0x1:_0x274da0[_0xffc2('0x11')];_0x274da0['priority']=(_0x426238[_0xffc2('0x2d')]?_['last'](_0x426238)['priority']:_0x509fc8[_0xffc2('0x11')])+0x1;_0x274da0[_0xffc2('0x12')]=_[_0xffc2('0x43')](_0x274da0[_0xffc2('0x12')],_0x2b6293,[_0x509fc8],_0x426238);}_0x274da0[_0xffc2('0x12')][_0xffc2('0x1c')]({'type':_0x2b60cb[_0xf53df2][0x0]['type'],'app':_0xffc2('0x44'),'exten':_0x2b60cb[_0xf53df2][0x0]['exten'],'context':_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x19')],'priority':_0x274da0[_0xffc2('0x11')],'VoiceExtensionId':_0x2b60cb[_0xf53df2][0x0]['VoiceExtensionId']});_0x8440e2[_0xffc2('0x1c')](_0x2b60cb[_0xf53df2][0x0][_0xffc2('0x1a')]);_0x3e0e47=_[_0xffc2('0x43')](_0x3e0e47,_0x274da0[_0xffc2('0x12')]);}}return _0x18cf1b[_0xffc2('0x45')](function(_0x5c1915){return _0x18cf1b[_0xffc2('0x2')][_0xffc2('0x5')][_0xffc2('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x8440e2}},'transaction':_0x5c1915})[_0xffc2('0x7')](function(_0x182b52){return _0x18cf1b[_0xffc2('0x2')]['VoiceExtension'][_0xffc2('0x47')](_[_0xffc2('0x48')](_0x3e0e47,_0xffc2('0x11')),{'transaction':_0x5c1915});});});})[_0xffc2('0x49')](function(_0x2a1dd4){console['error'](_0x2a1dd4);});}exports[_0xffc2('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b1dd7c1..ed57234 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 _0x6aae=['from','cm_contacts','where','select','\x20=\x20?','deletedAt\x20IS\x20NULL','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','query','onlyIfOpen','sequelize','all','BlackLists','VoiceQueueId','Campaign','Lists','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','CompanyId','find','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','NOW()','field','toString','updatedAt'];(function(_0x3021b9,_0xdb387c){var _0xd6a1c2=function(_0x2001e5){while(--_0x2001e5){_0x3021b9['push'](_0x3021b9['shift']());}};_0xd6a1c2(++_0xdb387c);}(_0x6aae,0xa0));var _0xe6aa=function(_0x1e4817,_0x4672c9){_0x1e4817=_0x1e4817-0x0;var _0x5a4650=_0x6aae[_0x1e4817];return _0x5a4650;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xe6aa('0x0'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xe6aa('0x1'));var logger=require(_0xe6aa('0x2'))(_0xe6aa('0x3'));config[_0xe6aa('0x4')]=_[_0xe6aa('0x5')](config[_0xe6aa('0x4')],{'host':_0xe6aa('0x6'),'port':0x18eb});var socket=require(_0xe6aa('0x7'))(new Redis(config[_0xe6aa('0x4')]));require(_0xe6aa('0x8'))[_0xe6aa('0x9')](socket);try{if(!process[_0xe6aa('0xa')][0x2]||process['argv'][0x2]===_0xe6aa('0xb')||process[_0xe6aa('0xa')][0x2]==='null'){throw new Error(_0xe6aa('0xc'));}var FILEPATH=process[_0xe6aa('0xa')][0x2];if(!process['argv'][0x3]||process[_0xe6aa('0xa')][0x3]===_0xe6aa('0xb')||process[_0xe6aa('0xa')][0x3]===_0xe6aa('0xd')||!process[_0xe6aa('0xa')][0x4]||process[_0xe6aa('0xa')][0x4]===_0xe6aa('0xb')||process[_0xe6aa('0xa')][0x4]===_0xe6aa('0xd')){throw new Error(_0xe6aa('0xe'));}var FIELDS=_[_0xe6aa('0xf')](process[_0xe6aa('0xa')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0xe6aa('0xa')][0x5]||process[_0xe6aa('0xa')][0x5]===_0xe6aa('0xb')||process[_0xe6aa('0xa')][0x5]===_0xe6aa('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xe6aa('0xa')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xe6aa('0xa')][0x6]!==_0xe6aa('0xb')&&process['argv'][0x6]!=='null'?process[_0xe6aa('0xa')][0x6]:null;var DUPLICATES=process[_0xe6aa('0xa')][0x7]&&process[_0xe6aa('0xa')][0x7]!==_0xe6aa('0xb')&&process[_0xe6aa('0xa')][0x7]!==_0xe6aa('0xd')?process[_0xe6aa('0xa')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0xe6aa('0xa')][0x8]===_0xe6aa('0xd')){throw new Error(_0xe6aa('0x10'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5c4438){logger['error'](_0x5c4438);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(_0x273401,_0x58d9fe,_0x4158eb,_0x57017c){var _0x116a5f={'message':_0x58d9fe};_0x116a5f[_0x273401]=!![];if(_0x4158eb){_0x116a5f[_0xe6aa('0x11')]=_0x4158eb;}if(_0x57017c){_0x116a5f[_0xe6aa('0x12')]=_0x57017c;}return _0x116a5f;}function isEmail(_0x2532b6){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))*$/[_0xe6aa('0x13')](_0x2532b6);}function checkRow(_0x3000e5,_0x1bb578,_0x4af73c){return new BPromise(function(_0x9d0dbb,_0xd2945e){if(_[_0xe6aa('0x14')](_0x3000e5)){return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),_0xe6aa('0x16'),null,_0x4af73c));}if(_0x3000e5['errors']&&_0x3000e5[_0xe6aa('0x17')][_0xe6aa('0x18')]){var _0x183091=_[_0xe6aa('0x19')](_0x3000e5[_0xe6aa('0x17')],_0xe6aa('0x1a'))[_0xe6aa('0x1b')](';');return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),_0x183091,null,_0x4af73c));}var _0x38f970={};for(var _0x1205cb in FIELDS){if(FIELDS[_0xe6aa('0x1c')](_0x1205cb)&&FIELDS[_0x1205cb]){_0x38f970[_0x1205cb]=_0x3000e5['data'][0x0][FIELDS[_0x1205cb]]||_0x3000e5['data'][0x0]['\ufeff'+FIELDS[_0x1205cb]];}}if(!_0x38f970[_0xe6aa('0x1d')]){return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),_0xe6aa('0x1e'),null,_0x4af73c));}if(!_0x38f970[_0xe6aa('0x1f')]){return _0xd2945e(handleCheckRowError('error',_0xe6aa('0x20'),null,_0x4af73c));}if(_0x38f970[_0xe6aa('0x21')]){var _0x448d9c=moment(_0x38f970[_0xe6aa('0x21')],_0xe6aa('0x22'));if(!_0x448d9c[_0xe6aa('0x23')]()){return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),_0xe6aa('0x24'),null,_0x4af73c));}}if(_0x38f970['email']){if(!isEmail(_0x38f970['email'])){return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x4af73c));}}_0x38f970['ListId']=LISTID;_0x38f970[_0xe6aa('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe6aa('0x18')]&&_0x1bb578){var _0x3efbce={};for(var _0x3e3ec5=0x0,_0x8fab54=DUPLICATES[_0xe6aa('0x18')];_0x3e3ec5<_0x8fab54;_0x3e3ec5+=0x1){_0x3efbce[DUPLICATES[_0x3e3ec5]]=_0x38f970[DUPLICATES[_0x3e3ec5]];}var _0x101acd=_[_0xe6aa('0x26')](_0x1bb578,_0x3efbce);if(_0x101acd){return _0xd2945e(handleCheckRowError('duplicate',_0xe6aa('0x27'),_0x101acd,_0x4af73c));}}return db['CmContact'][_0xe6aa('0x28')](_0x38f970,{'raw':!![],'hooks':![],'fields':_['keys'](_0x38f970)})[_0xe6aa('0x29')](function(_0x5c12c2){if(DUPLICATES&&DUPLICATES[_0xe6aa('0x18')]&&_0x1bb578){_0x1bb578[_0xe6aa('0x2a')](_[_0xe6aa('0x2b')](_0x38f970,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c12c2['id'];return _0x9d0dbb();})[_0xe6aa('0x2c')](function(_0x495dec){return _0xd2945e(handleCheckRowError(_0xe6aa('0x15'),_0xe6aa('0x2d')+(_0x495dec[_0xe6aa('0x1a')]||JSON['stringify'](_0x495dec)),null,_0x4af73c));});});}function checkHopper(){function _0x2473e5(){return function(_0x490f40){logger[_0xe6aa('0x15')]('cmContact',_0xe6aa('0x2e'),util[_0xe6aa('0x2f')](_0x490f40,{'showHidden':![],'depth':null}));};}var _0x5b47d2=function(_0x51f621,_0x371a6e){var _0x6acc0f=squel[_0xe6aa('0x30')]()[_0xe6aa('0x31')](_0xe6aa('0x32'))[_0xe6aa('0x33')]([_0xe6aa('0x1f'),_0xe6aa('0x34'),_0xe6aa('0x35'),_0xe6aa('0x36'),_0x371a6e,_0xe6aa('0x37'),'updatedAt'],squel['select']()['field'](_0xe6aa('0x1f'),_0xe6aa('0x1f'))['field'](_0xe6aa('0x38'),_0xe6aa('0x34'))[_0xe6aa('0x39')]('id','ContactId')['field'](LISTID['toString'](),_0xe6aa('0x36'))[_0xe6aa('0x39')](_0x51f621['id'][_0xe6aa('0x3a')](),_0x371a6e)[_0xe6aa('0x39')](_0xe6aa('0x38'),'createdAt')[_0xe6aa('0x39')](_0xe6aa('0x38'),_0xe6aa('0x3b'))[_0xe6aa('0x3c')](_0xe6aa('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xe6aa('0x3e')]('ListId\x20=\x20?',LISTID[_0xe6aa('0x3a')]())[_0xe6aa('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xe6aa('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe6aa('0x3f')]()[_0xe6aa('0x39')](_0xe6aa('0x1f'))[_0xe6aa('0x3c')](_0xe6aa('0x32'))[_0xe6aa('0x3e')](_0x371a6e+_0xe6aa('0x40'),_0x51f621['id'][_0xe6aa('0x3a')]())))[_0xe6aa('0x3a')]();return _0x6acc0f;};var _0x2bae2d=function(_0xc45135,_0x4cc4d7){var _0x2dc0f9=squel[_0xe6aa('0x30')]()[_0xe6aa('0x31')](_0xe6aa('0x32'))['fromQuery']([_0xe6aa('0x1f'),_0xe6aa('0x34'),_0xe6aa('0x35'),'ListId',_0x4cc4d7,_0xe6aa('0x37'),'updatedAt'],squel['select']()[_0xe6aa('0x39')](_0xe6aa('0x1f'),'phone')[_0xe6aa('0x39')](_0xe6aa('0x38'),'scheduledAt')['field']('id',_0xe6aa('0x35'))[_0xe6aa('0x39')](LISTID['toString'](),_0xe6aa('0x36'))[_0xe6aa('0x39')](_0xc45135['id'][_0xe6aa('0x3a')](),_0x4cc4d7)[_0xe6aa('0x39')]('NOW()',_0xe6aa('0x37'))[_0xe6aa('0x39')](_0xe6aa('0x38'),'updatedAt')[_0xe6aa('0x3c')](_0xe6aa('0x3d'))[_0xe6aa('0x3e')](_0xe6aa('0x41'))[_0xe6aa('0x3e')]('ListId\x20=\x20?',LISTID[_0xe6aa('0x3a')]())[_0xe6aa('0x3e')]('id\x20IN\x20?',squel[_0xe6aa('0x42')](hopperContacts))['where'](_0xe6aa('0x43'))[_0xe6aa('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('calleridnum')[_0xe6aa('0x3c')]('cm_hopper_final')[_0xe6aa('0x3e')](_0x4cc4d7+_0xe6aa('0x40'),_0xc45135['id'][_0xe6aa('0x3a')]()))[_0xe6aa('0x3e')](_0xe6aa('0x44'),squel[_0xe6aa('0x3f')]()[_0xe6aa('0x39')]('phone')[_0xe6aa('0x3c')](_0xe6aa('0x32'))[_0xe6aa('0x3e')](_0x4cc4d7+_0xe6aa('0x40'),_0xc45135['id'][_0xe6aa('0x3a')]())))[_0xe6aa('0x3a')]();return _0x2dc0f9;};function _0x5c4aeb(_0x203971,_0x5883d6){var _0x388015=squel[_0xe6aa('0x30')]()[_0xe6aa('0x31')](_0xe6aa('0x32'))[_0xe6aa('0x33')]([_0xe6aa('0x1f'),_0xe6aa('0x34'),_0xe6aa('0x35'),_0xe6aa('0x36'),_0x5883d6,_0xe6aa('0x37'),_0xe6aa('0x3b')],squel[_0xe6aa('0x3f')]()[_0xe6aa('0x39')](_0xe6aa('0x1f'),_0xe6aa('0x1f'))[_0xe6aa('0x39')](_0xe6aa('0x38'),_0xe6aa('0x34'))[_0xe6aa('0x39')]('id',_0xe6aa('0x35'))[_0xe6aa('0x39')](LISTID[_0xe6aa('0x3a')](),'ListId')[_0xe6aa('0x39')](_0x203971['id'][_0xe6aa('0x3a')](),_0x5883d6)[_0xe6aa('0x39')](_0xe6aa('0x38'),'createdAt')[_0xe6aa('0x39')](_0xe6aa('0x38'),_0xe6aa('0x3b'))[_0xe6aa('0x3c')](_0xe6aa('0x3d'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xe6aa('0x45'),LISTID[_0xe6aa('0x3a')]())[_0xe6aa('0x3e')](_0xe6aa('0x46'),squel[_0xe6aa('0x42')](hopperContacts))['where'](_0xe6aa('0x43')))['toString']();return _0x388015;}function _0x33910b(_0x580fd6,_0x2c4f36){var _0x1f410d=squel[_0xe6aa('0x30')]()['into'](_0xe6aa('0x47'))[_0xe6aa('0x33')]([_0xe6aa('0x1f'),_0xe6aa('0x35'),_0xe6aa('0x36'),_0x2c4f36,'createdAt',_0xe6aa('0x3b')],squel[_0xe6aa('0x3f')]()[_0xe6aa('0x39')]('phone',_0xe6aa('0x1f'))[_0xe6aa('0x39')]('id','ContactId')[_0xe6aa('0x39')](LISTID[_0xe6aa('0x3a')](),_0xe6aa('0x36'))[_0xe6aa('0x39')](_0x580fd6['id'][_0xe6aa('0x3a')](),_0x2c4f36)['field'](_0xe6aa('0x38'),_0xe6aa('0x37'))['field'](_0xe6aa('0x38'),_0xe6aa('0x3b'))[_0xe6aa('0x3c')](_0xe6aa('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xe6aa('0x3e')]('ListId\x20=\x20?',LISTID[_0xe6aa('0x3a')]())[_0xe6aa('0x3e')](_0xe6aa('0x46'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe6aa('0x3a')]();return _0x1f410d;}return db[_0xe6aa('0x48')][_0xe6aa('0x49')]({'where':{'type':_0xe6aa('0x4a')},'attributes':['id',_0xe6aa('0x4b')],'include':[{'model':db[_0xe6aa('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0xe6aa('0x29')](function(_0x241f6c){var _0x5e4ba7=[];if(_0x241f6c){var _0xdefc6d;for(var _0x179236=0x0,_0x39d11a;_0x179236<_0x241f6c[_0xe6aa('0x18')];_0x179236+=0x1){_0x39d11a=_0x241f6c[_0x179236][_0xe6aa('0x4d')]({'plain':!![]});switch(_0x39d11a[_0xe6aa('0x4b')]){case'always':_0x5e4ba7[_0xe6aa('0x2a')](db['sequelize'][_0xe6aa('0x4e')](_0x2bae2d(_0x39d11a,'VoiceQueueId'))['then'](function(){})[_0xe6aa('0x2c')](_0x2473e5()));break;case _0xe6aa('0x4f'):_0x5e4ba7[_0xe6aa('0x2a')](db[_0xe6aa('0x50')][_0xe6aa('0x4e')](_0x5b47d2(_0x39d11a,'VoiceQueueId'))[_0xe6aa('0x29')](function(){})[_0xe6aa('0x2c')](_0x2473e5()));break;default:_0x5e4ba7[_0xe6aa('0x2a')](db[_0xe6aa('0x50')][_0xe6aa('0x4e')](_0x5c4aeb(_0x39d11a,'VoiceQueueId'))[_0xe6aa('0x29')](function(){})[_0xe6aa('0x2c')](_0x2473e5()));}}}return _0x5e4ba7;})[_0xe6aa('0x51')]()[_0xe6aa('0x29')](function(){return db['VoiceQueue'][_0xe6aa('0x49')]({'where':{'type':_0xe6aa('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xe6aa('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x504638){var _0x41b8f0=[];if(_0x504638){var _0x307783;for(var _0x26a481=0x0,_0x3b4ffb;_0x26a481<_0x504638[_0xe6aa('0x18')];_0x26a481+=0x1){_0x3b4ffb=_0x504638[_0x26a481][_0xe6aa('0x4d')]({'plain':!![]});_0x41b8f0[_0xe6aa('0x2a')](db['sequelize']['query'](_0x33910b(_0x3b4ffb,_0xe6aa('0x53')))[_0xe6aa('0x29')](function(){})['catch'](_0x2473e5()));}}return _0x41b8f0;})['all']();})['then'](function(){return db[_0xe6aa('0x54')][_0xe6aa('0x49')]({'attributes':['id',_0xe6aa('0x4b')],'include':[{'model':db[_0xe6aa('0x4c')],'as':_0xe6aa('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x37df17){var _0x44ad52=[];if(_0x37df17){for(var _0x41ddb2=0x0,_0x35c3de;_0x41ddb2<_0x37df17[_0xe6aa('0x18')];_0x41ddb2+=0x1){_0x35c3de=_0x37df17[_0x41ddb2][_0xe6aa('0x4d')]({'plain':!![]});switch(_0x35c3de[_0xe6aa('0x4b')]){case _0xe6aa('0x56'):_0x44ad52[_0xe6aa('0x2a')](db[_0xe6aa('0x50')][_0xe6aa('0x4e')](_0x2bae2d(_0x35c3de,_0xe6aa('0x57')))[_0xe6aa('0x29')](function(){})[_0xe6aa('0x2c')](_0x2473e5()));break;case _0xe6aa('0x4f'):_0x44ad52[_0xe6aa('0x2a')](db[_0xe6aa('0x50')]['query'](_0x5b47d2(_0x35c3de,_0xe6aa('0x57')))[_0xe6aa('0x29')](function(){})[_0xe6aa('0x2c')](_0x2473e5()));break;default:_0x44ad52[_0xe6aa('0x2a')](db[_0xe6aa('0x50')]['query'](_0x5c4aeb(_0x35c3de,_0xe6aa('0x57')))[_0xe6aa('0x29')](function(){})[_0xe6aa('0x2c')](_0x2473e5()));}}}return _0x44ad52;})['all']();})[_0xe6aa('0x29')](function(){return db[_0xe6aa('0x54')][_0xe6aa('0x49')]({'attributes':['id'],'include':[{'model':db[_0xe6aa('0x4c')],'as':_0xe6aa('0x52'),'where':{'id':LISTID}}]})[_0xe6aa('0x29')](function(_0x63731e){var _0x1e0025=[];if(_0x63731e){for(var _0x38a18a=0x0,_0x16ece3;_0x38a18a<_0x63731e['length'];_0x38a18a+=0x1){_0x16ece3=_0x63731e[_0x38a18a][_0xe6aa('0x4d')]({'plain':!![]});_0x1e0025[_0xe6aa('0x2a')](db['sequelize'][_0xe6aa('0x4e')](_0x33910b(_0x16ece3,_0xe6aa('0x57')))[_0xe6aa('0x29')](function(){})['catch'](_0x2473e5()));}}return _0x1e0025;})[_0xe6aa('0x51')]();})[_0xe6aa('0x2c')](function(_0x5726f9){logger[_0xe6aa('0x15')](_0xe6aa('0x58'),_0xe6aa('0x59'),_0x5726f9[_0xe6aa('0x1a')]);});}var processPromises=function(_0x40035d){return BPromise[_0xe6aa('0x51')](promises)[_0xe6aa('0x29')](function(_0x48d7b1){})['catch'](function(_0x3743ac){logger[_0xe6aa('0x15')](_0xe6aa('0x5a'),JSON[_0xe6aa('0x5b')](_0x3743ac));})[_0xe6aa('0x5c')](function(){socket['emit'](_0xe6aa('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x40035d){return _0x40035d[_0xe6aa('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xe6aa('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0xe6aa('0x29')](function(){socket[_0xe6aa('0x5f')](_0xe6aa('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe6aa('0x60')](FILEPATH);}catch(_0x4d2196){logger['error'](_0xe6aa('0x61'),JSON[_0xe6aa('0x5b')](_0x4d2196));}finally{process[_0xe6aa('0x62')](0x0);}});};process['on'](_0xe6aa('0x63'),function(){logger['info'](_0xe6aa('0x64'));endCsv();});function main(){return BPromise['resolve']()[_0xe6aa('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe6aa('0x65')](',');return db['CmContact'][_0xe6aa('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x2439b9){var _0x4f2f76=fs[_0xe6aa('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe6aa('0x67')](_0x4f2f76,{'header':!![],'skipEmptyLines':!![],'step':function(_0x136700,_0x1c0cab){total+=0x1;var _0x365ee1=total;promises['push'](checkRow(_0x136700,_0x2439b9,_0x365ee1)[_0xe6aa('0x29')](function(){success+=0x1;})[_0xe6aa('0x2c')](function(_0x50cbd6){if(_0x50cbd6['error']){errors+=0x1;delete _0x50cbd6[_0xe6aa('0x15')];}else if(_0x50cbd6[_0xe6aa('0x68')]){duplicates+=0x1;delete _0x50cbd6[_0xe6aa('0x68')];}rows[_0xe6aa('0x2a')](_0x50cbd6);}));if(total%0xc8===0x0){_0x1c0cab[_0xe6aa('0x69')]();return processPromises(_0x1c0cab);}},'complete':function(){return processPromises()[_0xe6aa('0x29')](function(){logger['info'](_0xe6aa('0x6a'));endCsv();});},'error':function(_0x27a09f,_0x130cea){logger[_0xe6aa('0x6b')](_0xe6aa('0x6c'),JSON[_0xe6aa('0x5b')](_0x27a09f));endCsv();}});})[_0xe6aa('0x2c')](function(_0x214a6c){logger[_0xe6aa('0x15')](_0xe6aa('0x6d'),JSON['stringify'](_0x214a6c));});}main(); \ No newline at end of file +var _0x9921=['from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','insert','select','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','contact','isNil','errors','map','message','join','error','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','Duplicate\x20Contact','CmContact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','into','fromQuery','ContactId','ListId','createdAt','updatedAt','field','scheduledAt','toString','NOW()'];(function(_0x1cb713,_0x2b6dd2){var _0x3d89f5=function(_0x5da58c){while(--_0x5da58c){_0x1cb713['push'](_0x1cb713['shift']());}};_0x3d89f5(++_0x2b6dd2);}(_0x9921,0x16c));var _0x1992=function(_0x802370,_0x23aec6){_0x802370=_0x802370-0x0;var _0xf77652=_0x9921[_0x802370];return _0xf77652;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1992('0x0'));var fs=require('fs');var squel=require(_0x1992('0x1'));var Papa=require(_0x1992('0x2'));var Redis=require(_0x1992('0x3'));var db=require(_0x1992('0x4'))['db'];var config=require(_0x1992('0x5'));var logger=require(_0x1992('0x6'))(_0x1992('0x7'));config[_0x1992('0x8')]=_[_0x1992('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1992('0x8')]));require(_0x1992('0xa'))[_0x1992('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1992('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1992('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x1992('0xc')][0x2];if(!process[_0x1992('0xc')][0x3]||process['argv'][0x3]===_0x1992('0xe')||process['argv'][0x3]===_0x1992('0xd')||!process[_0x1992('0xc')][0x4]||process['argv'][0x4]===_0x1992('0xe')||process[_0x1992('0xc')][0x4]===_0x1992('0xd')){throw new Error(_0x1992('0xf'));}var FIELDS=_[_0x1992('0x10')](process[_0x1992('0xc')][0x3][_0x1992('0x11')](','),process[_0x1992('0xc')][0x4][_0x1992('0x11')](','));if(!process[_0x1992('0xc')][0x5]||process[_0x1992('0xc')][0x5]===_0x1992('0xe')||process['argv'][0x5]===_0x1992('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x1992('0xc')][0x5];var COMPANYID=process[_0x1992('0xc')][0x6]&&process['argv'][0x6]!==_0x1992('0xe')&&process[_0x1992('0xc')][0x6]!==_0x1992('0xd')?process[_0x1992('0xc')][0x6]:null;var DUPLICATES=process[_0x1992('0xc')][0x7]&&process[_0x1992('0xc')][0x7]!==_0x1992('0xe')&&process[_0x1992('0xc')][0x7]!==_0x1992('0xd')?process[_0x1992('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x1992('0xe')||process[_0x1992('0xc')][0x8]===_0x1992('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1992('0xc')][0x8];}catch(_0x6b1f62){logger['error'](_0x6b1f62);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(_0x5ba94b,_0x5f1b46,_0x46a053,_0x5675e3){var _0x74dd06={'message':_0x5f1b46};_0x74dd06[_0x5ba94b]=!![];if(_0x46a053){_0x74dd06[_0x1992('0x12')]=_0x46a053;}if(_0x5675e3){_0x74dd06['index']=_0x5675e3;}return _0x74dd06;}function isEmail(_0x1a9e3d){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'](_0x1a9e3d);}function checkRow(_0x570184,_0x5d8721,_0x273f3c){return new BPromise(function(_0x46df32,_0xfb1df6){if(_[_0x1992('0x13')](_0x570184)){return _0xfb1df6(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x273f3c));}if(_0x570184[_0x1992('0x14')]&&_0x570184[_0x1992('0x14')]['length']){var _0x288c23=_[_0x1992('0x15')](_0x570184['errors'],_0x1992('0x16'))[_0x1992('0x17')](';');return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),_0x288c23,null,_0x273f3c));}var _0x38a7af={};for(var _0x5b7437 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5b7437)&&FIELDS[_0x5b7437]){_0x38a7af[_0x5b7437]=_0x570184['data'][0x0][FIELDS[_0x5b7437]]||_0x570184[_0x1992('0x19')][0x0]['\ufeff'+FIELDS[_0x5b7437]];}}if(!_0x38a7af[_0x1992('0x1a')]){return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),'firstName\x20not\x20specified!',null,_0x273f3c));}if(!_0x38a7af[_0x1992('0x1b')]){return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),_0x1992('0x1c'),null,_0x273f3c));}if(_0x38a7af[_0x1992('0x1d')]){var _0x54948b=moment(_0x38a7af[_0x1992('0x1d')],_0x1992('0x1e'));if(!_0x54948b['isValid']()){return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),_0x1992('0x1f'),null,_0x273f3c));}}if(_0x38a7af[_0x1992('0x20')]){if(!isEmail(_0x38a7af[_0x1992('0x20')])){return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),_0x1992('0x21'),null,_0x273f3c));}}_0x38a7af['ListId']=LISTID;_0x38a7af[_0x1992('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1992('0x23')]&&_0x5d8721){var _0x3d6d2b={};for(var _0x44fa05=0x0,_0x4ca045=DUPLICATES['length'];_0x44fa05<_0x4ca045;_0x44fa05+=0x1){_0x3d6d2b[DUPLICATES[_0x44fa05]]=_0x38a7af[DUPLICATES[_0x44fa05]];}var _0x529293=_[_0x1992('0x24')](_0x5d8721,_0x3d6d2b);if(_0x529293){return _0xfb1df6(handleCheckRowError('duplicate',_0x1992('0x25'),_0x529293,_0x273f3c));}}return db[_0x1992('0x26')][_0x1992('0x27')](_0x38a7af,{'raw':!![],'hooks':![],'fields':_[_0x1992('0x28')](_0x38a7af)})[_0x1992('0x29')](function(_0x33e06e){if(DUPLICATES&&DUPLICATES['length']&&_0x5d8721){_0x5d8721[_0x1992('0x2a')](_['pick'](_0x38a7af,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x33e06e['id'];return _0x46df32();})['catch'](function(_0x480484){return _0xfb1df6(handleCheckRowError(_0x1992('0x18'),_0x1992('0x2b')+(_0x480484[_0x1992('0x16')]||JSON['stringify'](_0x480484)),null,_0x273f3c));});});}function checkHopper(){function _0x39a1e1(){return function(_0x17681b){logger['error'](_0x1992('0x2c'),_0x1992('0x2d'),util['inspect'](_0x17681b,{'showHidden':![],'depth':null}));};}var _0x3a45a6=function(_0x10f2e8,_0x121ef8){var _0x234e4e=squel['insert']()[_0x1992('0x2e')]('cm_hopper')[_0x1992('0x2f')]([_0x1992('0x1b'),'scheduledAt',_0x1992('0x30'),_0x1992('0x31'),_0x121ef8,_0x1992('0x32'),_0x1992('0x33')],squel['select']()['field'](_0x1992('0x1b'),_0x1992('0x1b'))[_0x1992('0x34')]('NOW()',_0x1992('0x35'))[_0x1992('0x34')]('id',_0x1992('0x30'))['field'](LISTID[_0x1992('0x36')](),_0x1992('0x31'))[_0x1992('0x34')](_0x10f2e8['id'][_0x1992('0x36')](),_0x121ef8)[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x32'))[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x33'))[_0x1992('0x38')](_0x1992('0x39'))[_0x1992('0x3a')](_0x1992('0x3b'))[_0x1992('0x3a')](_0x1992('0x3c'),LISTID[_0x1992('0x36')]())[_0x1992('0x3a')](_0x1992('0x3d'))['where'](_0x1992('0x3e'),squel['select']()[_0x1992('0x34')](_0x1992('0x1b'))['from'](_0x1992('0x3f'))['where'](_0x121ef8+_0x1992('0x40'),_0x10f2e8['id'][_0x1992('0x36')]())))[_0x1992('0x36')]();return _0x234e4e;};var _0x3785ae=function(_0x3a4dd8,_0x2c47c8){var _0x1d232a=squel[_0x1992('0x41')]()[_0x1992('0x2e')](_0x1992('0x3f'))[_0x1992('0x2f')](['phone',_0x1992('0x35'),_0x1992('0x30'),_0x1992('0x31'),_0x2c47c8,_0x1992('0x32'),'updatedAt'],squel[_0x1992('0x42')]()[_0x1992('0x34')](_0x1992('0x1b'),_0x1992('0x1b'))[_0x1992('0x34')](_0x1992('0x37'),'scheduledAt')[_0x1992('0x34')]('id',_0x1992('0x30'))[_0x1992('0x34')](LISTID[_0x1992('0x36')](),_0x1992('0x31'))[_0x1992('0x34')](_0x3a4dd8['id'][_0x1992('0x36')](),_0x2c47c8)[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x32'))[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x33'))[_0x1992('0x38')](_0x1992('0x39'))[_0x1992('0x3a')](_0x1992('0x3b'))[_0x1992('0x3a')]('ListId\x20=\x20?',LISTID['toString']())[_0x1992('0x3a')](_0x1992('0x43'),squel[_0x1992('0x44')](hopperContacts))[_0x1992('0x3a')](_0x1992('0x3d'))[_0x1992('0x3a')](_0x1992('0x3e'),squel[_0x1992('0x42')]()[_0x1992('0x34')](_0x1992('0x45'))[_0x1992('0x38')]('cm_hopper_final')['where'](_0x2c47c8+_0x1992('0x40'),_0x3a4dd8['id'][_0x1992('0x36')]()))[_0x1992('0x3a')](_0x1992('0x3e'),squel['select']()['field'](_0x1992('0x1b'))['from'](_0x1992('0x3f'))[_0x1992('0x3a')](_0x2c47c8+_0x1992('0x40'),_0x3a4dd8['id'][_0x1992('0x36')]())))[_0x1992('0x36')]();return _0x1d232a;};function _0x58cb79(_0x26d696,_0x5f1c43){var _0x556a39=squel['insert']()[_0x1992('0x2e')](_0x1992('0x3f'))['fromQuery']([_0x1992('0x1b'),'scheduledAt',_0x1992('0x30'),'ListId',_0x5f1c43,_0x1992('0x32'),'updatedAt'],squel[_0x1992('0x42')]()[_0x1992('0x34')](_0x1992('0x1b'),_0x1992('0x1b'))[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x35'))[_0x1992('0x34')]('id',_0x1992('0x30'))['field'](LISTID[_0x1992('0x36')](),'ListId')[_0x1992('0x34')](_0x26d696['id']['toString'](),_0x5f1c43)['field'](_0x1992('0x37'),'createdAt')[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x33'))[_0x1992('0x38')](_0x1992('0x39'))[_0x1992('0x3a')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x1992('0x36')]())[_0x1992('0x3a')](_0x1992('0x43'),squel[_0x1992('0x44')](hopperContacts))[_0x1992('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x1992('0x36')]();return _0x556a39;}function _0x4d0305(_0x52cff6,_0xecaf41){var _0x2705cb=squel[_0x1992('0x41')]()[_0x1992('0x2e')](_0x1992('0x46'))[_0x1992('0x2f')]([_0x1992('0x1b'),'ContactId',_0x1992('0x31'),_0xecaf41,_0x1992('0x32'),_0x1992('0x33')],squel[_0x1992('0x42')]()[_0x1992('0x34')]('phone','phone')['field']('id',_0x1992('0x30'))[_0x1992('0x34')](LISTID[_0x1992('0x36')](),'ListId')[_0x1992('0x34')](_0x52cff6['id'][_0x1992('0x36')](),_0xecaf41)[_0x1992('0x34')]('NOW()',_0x1992('0x32'))[_0x1992('0x34')](_0x1992('0x37'),_0x1992('0x33'))[_0x1992('0x38')]('cm_contacts')[_0x1992('0x3a')](_0x1992('0x3b'))[_0x1992('0x3a')]('ListId\x20=\x20?',LISTID[_0x1992('0x36')]())[_0x1992('0x3a')](_0x1992('0x43'),squel['str'](hopperContacts))[_0x1992('0x3a')](_0x1992('0x3d')))[_0x1992('0x36')]();return _0x2705cb;}return db[_0x1992('0x47')][_0x1992('0x48')]({'where':{'type':_0x1992('0x49')},'attributes':['id',_0x1992('0x4a')],'include':[{'model':db[_0x1992('0x4b')],'as':_0x1992('0x4c'),'where':{'id':LISTID}}]})[_0x1992('0x29')](function(_0x1a5466){var _0x5832c3=[];if(_0x1a5466){var _0x36ffdc;for(var _0x3f63dc=0x0,_0x306c7a;_0x3f63dc<_0x1a5466[_0x1992('0x23')];_0x3f63dc+=0x1){_0x306c7a=_0x1a5466[_0x3f63dc][_0x1992('0x4d')]({'plain':!![]});switch(_0x306c7a[_0x1992('0x4a')]){case _0x1992('0x4e'):_0x5832c3[_0x1992('0x2a')](db[_0x1992('0x4f')][_0x1992('0x50')](_0x3785ae(_0x306c7a,_0x1992('0x51')))[_0x1992('0x29')](function(){})['catch'](_0x39a1e1()));break;case _0x1992('0x52'):_0x5832c3['push'](db[_0x1992('0x4f')][_0x1992('0x50')](_0x3a45a6(_0x306c7a,_0x1992('0x51')))['then'](function(){})[_0x1992('0x53')](_0x39a1e1()));break;default:_0x5832c3['push'](db[_0x1992('0x4f')][_0x1992('0x50')](_0x58cb79(_0x306c7a,_0x1992('0x51')))['then'](function(){})[_0x1992('0x53')](_0x39a1e1()));}}}return _0x5832c3;})[_0x1992('0x54')]()[_0x1992('0x29')](function(){return db[_0x1992('0x47')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x1992('0x55'),'where':{'id':LISTID}}]})[_0x1992('0x29')](function(_0x5c8bae){var _0x3d8741=[];if(_0x5c8bae){var _0x1ebf31;for(var _0x1fc34f=0x0,_0x2407c1;_0x1fc34f<_0x5c8bae[_0x1992('0x23')];_0x1fc34f+=0x1){_0x2407c1=_0x5c8bae[_0x1fc34f][_0x1992('0x4d')]({'plain':!![]});_0x3d8741[_0x1992('0x2a')](db[_0x1992('0x4f')][_0x1992('0x50')](_0x4d0305(_0x2407c1,_0x1992('0x51')))[_0x1992('0x29')](function(){})[_0x1992('0x53')](_0x39a1e1()));}}return _0x3d8741;})[_0x1992('0x54')]();})['then'](function(){return db[_0x1992('0x56')][_0x1992('0x48')]({'attributes':['id',_0x1992('0x4a')],'include':[{'model':db[_0x1992('0x4b')],'as':'Lists','where':{'id':LISTID}}]})[_0x1992('0x29')](function(_0x4967c7){var _0x9573f0=[];if(_0x4967c7){for(var _0xf34a2d=0x0,_0x4411ff;_0xf34a2d<_0x4967c7[_0x1992('0x23')];_0xf34a2d+=0x1){_0x4411ff=_0x4967c7[_0xf34a2d][_0x1992('0x4d')]({'plain':!![]});switch(_0x4411ff[_0x1992('0x4a')]){case _0x1992('0x4e'):_0x9573f0[_0x1992('0x2a')](db['sequelize']['query'](_0x3785ae(_0x4411ff,_0x1992('0x57')))['then'](function(){})[_0x1992('0x53')](_0x39a1e1()));break;case'onlyIfOpen':_0x9573f0[_0x1992('0x2a')](db[_0x1992('0x4f')]['query'](_0x3a45a6(_0x4411ff,_0x1992('0x57')))[_0x1992('0x29')](function(){})[_0x1992('0x53')](_0x39a1e1()));break;default:_0x9573f0[_0x1992('0x2a')](db[_0x1992('0x4f')][_0x1992('0x50')](_0x58cb79(_0x4411ff,'CampaignId'))[_0x1992('0x29')](function(){})['catch'](_0x39a1e1()));}}}return _0x9573f0;})['all']();})['then'](function(){return db[_0x1992('0x56')][_0x1992('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x23a3f2){var _0x38d49b=[];if(_0x23a3f2){for(var _0x5d78c3=0x0,_0x46f047;_0x5d78c3<_0x23a3f2[_0x1992('0x23')];_0x5d78c3+=0x1){_0x46f047=_0x23a3f2[_0x5d78c3][_0x1992('0x4d')]({'plain':!![]});_0x38d49b[_0x1992('0x2a')](db[_0x1992('0x4f')][_0x1992('0x50')](_0x4d0305(_0x46f047,_0x1992('0x57')))[_0x1992('0x29')](function(){})[_0x1992('0x53')](_0x39a1e1()));}}return _0x38d49b;})[_0x1992('0x54')]();})['catch'](function(_0xb3591f){logger[_0x1992('0x18')](_0x1992('0x58'),'generalCheckHopper',_0xb3591f[_0x1992('0x16')]);});}var processPromises=function(_0x5d5be6){return BPromise[_0x1992('0x54')](promises)['then'](function(_0xeb154e){})[_0x1992('0x53')](function(_0x11ff52){logger[_0x1992('0x18')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x11ff52));})[_0x1992('0x59')](function(){socket['emit'](_0x1992('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5d5be6){return _0x5d5be6['resume']();}});};var endCsv=function(){return BPromise[_0x1992('0x5b')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x1992('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1992('0x5d')](FILEPATH);}catch(_0xf4f478){logger['error'](_0x1992('0x5e'),JSON[_0x1992('0x5f')](_0xf4f478));}finally{process[_0x1992('0x60')](0x0);}});};process['on'](_0x1992('0x61'),function(){logger[_0x1992('0x62')](_0x1992('0x63'));endCsv();});function main(){return BPromise[_0x1992('0x5b')]()[_0x1992('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1992('0x11')](',');return db[_0x1992('0x26')][_0x1992('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1992('0x29')](function(_0x37d308){var _0x99027a=fs[_0x1992('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1992('0x65')](_0x99027a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x47bd29,_0x58af34){total+=0x1;var _0x2be523=total;promises[_0x1992('0x2a')](checkRow(_0x47bd29,_0x37d308,_0x2be523)['then'](function(){success+=0x1;})[_0x1992('0x53')](function(_0x4d30d5){if(_0x4d30d5[_0x1992('0x18')]){errors+=0x1;delete _0x4d30d5[_0x1992('0x18')];}else if(_0x4d30d5[_0x1992('0x66')]){duplicates+=0x1;delete _0x4d30d5['duplicate'];}rows[_0x1992('0x2a')](_0x4d30d5);}));if(total%0xc8===0x0){_0x58af34['pause']();return processPromises(_0x58af34);}},'complete':function(){return processPromises()[_0x1992('0x29')](function(){logger[_0x1992('0x62')](_0x1992('0x67'));endCsv();});},'error':function(_0xd765f6,_0x3ea9c6){logger[_0x1992('0x62')](_0x1992('0x68'),JSON['stringify'](_0xd765f6));endCsv();}});})[_0x1992('0x53')](function(_0x5b8882){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x1992('0x5f')](_0x5b8882));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f117f0d..9a72638 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 _0x4a77=['.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','toString','insert','cm_hopper_black','ListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','stringify','start','socket_timestamp','root','.csv','keys','header','parse','createReadStream','data','length','rows','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','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','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','argv','server/files/tmp','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','select','field','phone','.id\x20=\x20','where','\x20=\x20'];(function(_0x38bc8e,_0x213121){var _0x5ee5fe=function(_0x28d8dc){while(--_0x28d8dc){_0x38bc8e['push'](_0x38bc8e['shift']());}};_0x5ee5fe(++_0x213121);}(_0x4a77,0x164));var _0x74a7=function(_0x1f73c3,_0x4044af){_0x1f73c3=_0x1f73c3-0x0;var _0xff343a=_0x4a77[_0x1f73c3];return _0xff343a;};'use strict';var fs=require('fs');var path=require(_0x74a7('0x0'));var _=require(_0x74a7('0x1'));var Papa=require(_0x74a7('0x2'));var util=require('util');var BPromise=require(_0x74a7('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x74a7('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x74a7('0x5'));var logger=require(_0x74a7('0x6'))('import');config[_0x74a7('0x7')]=_['defaults'](config[_0x74a7('0x7')],{'host':_0x74a7('0x8'),'port':0x18eb});var socket=require(_0x74a7('0x9'))(new Redis(config[_0x74a7('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2f6984){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'](_0x2f6984);}function selectNotIn(_0x5dde60,_0x5b55bc,_0x1adee8,_0x555b37,_0x283b95){return squel[_0x74a7('0xa')]()[_0x74a7('0xb')](_0x74a7('0xc'))['from'](_0x555b37)['join'](_0x5b55bc,null,_0x5b55bc+_0x74a7('0xd')+_0x555b37+'.'+_0x1adee8)[_0x74a7('0xe')](_0x555b37+'.'+_0x1adee8+_0x74a7('0xf')+_0x5dde60+'.'+_0x1adee8)[_0x74a7('0xe')](_0x5b55bc+_0x74a7('0x10')+_0x283b95[_0x74a7('0x11')]()+')');}function insertCmHopper(_0x3bd8ba,_0x43924e,_0x27249c,_0x4d8c7a,_0x1bdea7){var _0x4d2cd1=[_0x74a7('0x12'),_0x74a7('0x13'),_0x74a7('0x14'),_0x74a7('0x15'),_0x43924e+'.'+_0x4d8c7a,_0x74a7('0x16'),_0x74a7('0x17'),_0x74a7('0x18'),_0x74a7('0x19'),'\x22'+_0x1bdea7+'\x22'];return squel['insert']()[_0x74a7('0x1a')]('cm_hopper')[_0x74a7('0x1b')]([_0x74a7('0xc'),_0x74a7('0x1c'),_0x74a7('0x1d'),'ListId',_0x4d8c7a,_0x74a7('0x1e'),_0x74a7('0x1f'),'priority','UserId',_0x74a7('0x20')],squel[_0x74a7('0xa')]()[_0x74a7('0x21')](_0x4d2cd1)[_0x74a7('0x22')](_0x43924e)[_0x74a7('0x11')](_0x74a7('0x23'),null,_0x74a7('0x24')+_0x43924e+_0x74a7('0x25'))['join'](_0x27249c,null,_0x27249c+_0x74a7('0xd')+_0x43924e+'.'+_0x4d8c7a)[_0x74a7('0xe')](_0x43924e+_0x74a7('0x26'),_0x3bd8ba)[_0x74a7('0xe')](_0x74a7('0x27'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43924e,_0x27249c,_0x4d8c7a,_0x74a7('0x28'),[_0x74a7('0x29'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43924e,_0x27249c,_0x4d8c7a,'cm_hopper',[_0x74a7('0x29')])))[_0x74a7('0x2a')]();}function insertCmHopperBlack(_0x5eae61,_0x3b9957,_0x3ed4ed,_0x4beea5){var _0x5d109f=[_0x74a7('0x12'),_0x74a7('0x14'),_0x74a7('0x15'),_0x3b9957+'.'+_0x4beea5,_0x74a7('0x16'),_0x74a7('0x17')];return squel[_0x74a7('0x2b')]()[_0x74a7('0x1a')](_0x74a7('0x2c'))[_0x74a7('0x1b')](['phone','ContactId',_0x74a7('0x2d'),_0x4beea5,_0x74a7('0x1e'),_0x74a7('0x1f')],squel[_0x74a7('0xa')]()['fields'](_0x5d109f)[_0x74a7('0x22')](_0x3b9957)[_0x74a7('0x11')](_0x74a7('0x23'),null,_0x74a7('0x24')+_0x3b9957+_0x74a7('0x25'))[_0x74a7('0x11')](_0x3ed4ed,null,_0x3ed4ed+'.id\x20=\x20'+_0x3b9957+'.'+_0x4beea5)[_0x74a7('0xe')](_0x3b9957+_0x74a7('0x26'),_0x5eae61)[_0x74a7('0xe')](_0x74a7('0x27'),NOW)[_0x74a7('0xe')](_0x74a7('0x2e'),squel[_0x74a7('0xa')]()['field']('phone')[_0x74a7('0x22')](_0x74a7('0x2c'))[_0x74a7('0xe')](_0x74a7('0x2f'),_0x5eae61)[_0x74a7('0xe')](_0x4beea5+_0x74a7('0x30'),_0x3b9957+'.'+_0x4beea5)))['toString']();}function insertCmContact(_0x5bc4a4,_0x59f182,_0x2d2a4a,_0x19f8b7){var _0x11ee60=_[_0x74a7('0x31')](_['keys'](_0x19f8b7),[_0x74a7('0x2d'),_0x74a7('0x32'),_0x74a7('0x1e'),'updatedAt']);return squel[_0x74a7('0x2b')]()[_0x74a7('0x1a')](_0x74a7('0x23'))[_0x74a7('0x1b')](_0x11ee60,squel['select']()[_0x74a7('0x21')](_0x11ee60)[_0x74a7('0x22')](_0x59f182)[_0x74a7('0xe')]('('+_0x2d2a4a[_0x74a7('0x11')](',')+_0x74a7('0x33'),squel['select']()['fields'](_0x2d2a4a)[_0x74a7('0x22')](_0x74a7('0x23'))[_0x74a7('0xe')]('ListId\x20=\x20?',_0x5bc4a4))['where']('id\x20IN\x20?',squel[_0x74a7('0xa')]()[_0x74a7('0xb')](_0x74a7('0x34'),_0x74a7('0x35'))[_0x74a7('0x22')](_0x59f182)['group'](_0x2d2a4a[_0x74a7('0x11')](','))))['toString']();}function handleStop(){logger[_0x74a7('0x36')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3beb9f){logger[_0x74a7('0x37')](_0x3beb9f[_0x74a7('0x38')]);process[_0x74a7('0x39')](0x1);}function handleError(_0x3b11db,_0x398e8c){stats[_0x74a7('0x3a')][_0x74a7('0x3b')]({'name':_0x398e8c[_0x74a7('0x3c')],'message':_0x398e8c[_0x74a7('0x38')],'row':_0x3b11db});}function handleQuery(_0x2c8af5){logger[_0x74a7('0x36')](_0x2c8af5);return db[_0x74a7('0x3d')][_0x74a7('0x3e')](_0x2c8af5)[_0x74a7('0x3f')](function(_0x36fc40){results[_0x74a7('0x3b')](_0x36fc40);})[_0x74a7('0x40')](function(_0x2eba47){logger[_0x74a7('0x37')](_0x2eba47[_0x74a7('0x38')]);});}function main(_0x1896e6,_0x3a2b04,_0x29fcf5,_0x87d40f){logger[_0x74a7('0x36')](_0x74a7('0x41'),_0x1896e6,JSON[_0x74a7('0x42')](_0x3a2b04));process['send'](_0x74a7('0x43'));var _0x58a25c=_0x3a2b04['binding'];var _0x43307b=_0x3a2b04[_0x74a7('0x44')];var _0xd6586e=path[_0x74a7('0x11')](config[_0x74a7('0x45')],'server/files/tmp',_0x43307b+_0x74a7('0x46'));var _0x2a2ee7=_[_0x74a7('0x47')](_0x58a25c)[_0x74a7('0x11')]();logger[_0x74a7('0x36')](_0x74a7('0x48'),_0x2a2ee7);fs['writeFileSync'](_0xd6586e,_0x2a2ee7+'\x0a');Papa[_0x74a7('0x49')](fs[_0x74a7('0x4a')](_0x1896e6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4950c2,_0x431d00){try{for(var _0x15fc70=0x0,_0x3c02a3=[];_0x15fc70<_0x4950c2[_0x74a7('0x4b')][_0x74a7('0x4c')];_0x15fc70++){stats[_0x74a7('0x4d')]+=0x1;if(_0x4950c2['errors'][_0x15fc70]){handleError(_0x4950c2[_0x74a7('0x4b')][_0x15fc70],_0x4950c2['errors'][_0x15fc70]);}else{var _0x2688ca=[];for(var _0x5a9ff6 in _0x58a25c){if(_0x58a25c[_0x74a7('0x4e')](_0x5a9ff6)){if(_0x4950c2[_0x74a7('0x4b')][_0x15fc70][_0x58a25c[_0x5a9ff6]]){var _0x5c62f2=_['trim'](_0x4950c2[_0x74a7('0x4b')][_0x15fc70][_0x58a25c[_0x5a9ff6]]['replace'](/"/g,'\x27'));switch(_0x5a9ff6){case _0x74a7('0x1c'):var _0x2107b1=moment(_0x5c62f2,_0x74a7('0x4f'),!![]);if(_0x2107b1[_0x74a7('0x50')]()){_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5c62f2+'\x22');}else{_0x2688ca[_0x74a7('0x3b')](_0x74a7('0x51'));}break;case'priority':var _0x4ec3ad=parseInt(_0x5c62f2);_0x5c62f2=_['isNaN'](_0x4ec3ad)||_0x4ec3ad<0x0||_0x4ec3ad>0x4?_0x87d40f?0x3:0x2:_0x4ec3ad;_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5c62f2+'\x22');break;case'UserId':var _0x5f4ed6=parseInt(_0x5c62f2);if(_[_0x74a7('0x52')](_0x5f4ed6)&&_[_0x74a7('0x53')](_0x29fcf5,_0x5f4ed6)){_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5f4ed6+'\x22');}else{_0x2688ca[_0x74a7('0x3b')](_0x74a7('0x54'));}break;case'email':if(isEmail(_0x5c62f2)){_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5c62f2+'\x22');}else{_0x2688ca[_0x74a7('0x3b')](_0x74a7('0x55'));}break;case _0x74a7('0x56'):var _0x4f8315=moment(_0x5c62f2,_0x74a7('0x57'),!![]);if(_0x4f8315['isValid']()){_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5c62f2+'\x22');}else{_0x2688ca['push'](_0x74a7('0x58'));}break;default:_0x3c02a3[_0x74a7('0x3b')]('\x22'+_0x5c62f2+'\x22');}}else{switch(_0x5a9ff6){case _0x74a7('0x59'):case'phone':_0x2688ca[_0x74a7('0x3b')](_0x5a9ff6+_0x74a7('0x5a'));break;default:_0x3c02a3[_0x74a7('0x3b')]('\x22\x22');}}}}if(_0x2688ca[_0x74a7('0x4c')]){handleError(_0x4950c2[_0x74a7('0x4b')][_0x15fc70],{'code':_0x74a7('0x5b'),'message':_0x2688ca[_0x74a7('0x11')]()});}else{fs[_0x74a7('0x5c')](_0xd6586e,_0x3c02a3[_0x74a7('0x11')]()+'\x0a');}_0x3c02a3=[];}if(!(stats[_0x74a7('0x4d')]%0xc8)){socket[_0x74a7('0x5d')](_0x74a7('0x5e')+_0x43307b,stats);stats[_0x74a7('0x3a')]=[];}}if(stopped){logger[_0x74a7('0x36')](_0x74a7('0x5f'));_0x431d00[_0x74a7('0x60')]();}}catch(_0x55ea04){handleError(_0x4950c2[_0x74a7('0x4b')][_0x15fc70],{'code':_0x74a7('0x61'),'message':_0x55ea04['message']});logger[_0x74a7('0x37')](_0x74a7('0x62'),_0x55ea04[_0x74a7('0x38')]);}},'complete':function(){try{var _0x23ac69=[];var _0x4daa90=_0x74a7('0x23');if(_0x3a2b04[_0x74a7('0x63')]&&_0x3a2b04[_0x74a7('0x63')][_0x74a7('0x4c')]){_0x4daa90='cm_contacts_'+_0x43307b;_0x23ac69['push'](_0x74a7('0x64')+_0x4daa90+_0x74a7('0x65'));}var _0x156aa8=util['format'](_0x74a7('0x66'),_0xd6586e,_0x4daa90,_0x2a2ee7,_0x3a2b04['ListId'],_0x3a2b04['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x58a25c[_0x74a7('0x1c')])){_0x156aa8+=',\x20scheduledAt\x20=\x20NOW()';}_0x23ac69['push'](_0x156aa8);if(_0x3a2b04[_0x74a7('0x63')]&&_0x3a2b04[_0x74a7('0x63')][_0x74a7('0x4c')]){_0x23ac69[_0x74a7('0x3b')](insertCmContact(_0x3a2b04[_0x74a7('0x2d')],_0x4daa90,_0x3a2b04[_0x74a7('0x63')],_0x58a25c));_0x23ac69[_0x74a7('0x3b')]('DROP\x20TABLE\x20'+_0x4daa90+';');}_0x23ac69[_0x74a7('0x3b')](insertCmHopper(_0x3a2b04[_0x74a7('0x2d')],_0x74a7('0x67'),_0x74a7('0x68'),_0x74a7('0x69'),_0x87d40f));_0x23ac69[_0x74a7('0x3b')](insertCmHopperBlack(_0x3a2b04[_0x74a7('0x2d')],_0x74a7('0x6a'),'voice_queues','VoiceQueueId'));_0x23ac69[_0x74a7('0x3b')](insertCmHopper(_0x3a2b04[_0x74a7('0x2d')],'campaigns_has_cm_lists',_0x74a7('0x6b'),'CampaignId',_0x87d40f));_0x23ac69[_0x74a7('0x3b')](insertCmHopperBlack(_0x3a2b04[_0x74a7('0x2d')],_0x74a7('0x6c'),_0x74a7('0x6b'),_0x74a7('0x6d')));BPromise[_0x74a7('0x6e')](_0x23ac69,handleQuery)[_0x74a7('0x6f')](function(_0x7fe000){stats[_0x74a7('0x70')]=!![];stats['affectedRows']=_0x3a2b04[_0x74a7('0x63')]&&_0x3a2b04['duplicates'][_0x74a7('0x4c')]?results[0x2]['affectedRows']:results[0x0][_0x74a7('0x71')];socket[_0x74a7('0x5d')](_0x74a7('0x5e')+_0x43307b,stats);fs['unlink'](_0x1896e6);fs['unlink'](_0xd6586e);process[_0x74a7('0x39')](0x0);})[_0x74a7('0x40')](function(_0x2d5715){logger[_0x74a7('0x37')](_0x2d5715[_0x74a7('0x38')]);process[_0x74a7('0x39')](0x1);});}catch(_0x5d7cb3){logger['error']('complete',_0x5d7cb3[_0x74a7('0x38')]);process[_0x74a7('0x39')](0x1);}},'error':function(_0x59fa0b,_0x98f18d,_0x5cfe44,_0x276788){throw new Error(_0x276788);}});}function validate(){if(process[_0x74a7('0x72')]&&process[_0x74a7('0x72')][_0x74a7('0x4c')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x21c768=path[_0x74a7('0x11')](config[_0x74a7('0x45')],_0x74a7('0x73'),process[_0x74a7('0x72')][0x2]);if(!fs['existsSync'](_0x21c768)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x11b77b={};try{_0x11b77b=JSON['parse'](process[_0x74a7('0x72')][0x3]);if(!_0x11b77b[_0x74a7('0x74')]){throw new Error(_0x74a7('0x75'));}if(!_0x11b77b[_0x74a7('0x74')][_0x74a7('0xc')]){throw new Error(_0x74a7('0x76'));}if(!_0x11b77b[_0x74a7('0x74')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0xfcea9d=0x0;if(_0x11b77b['binding']['UserId']){_0xfcea9d=0x1;}if(!_0x11b77b['ListId']){throw new Error(_0x74a7('0x77'));}}catch(_0x591e09){throw new Error(_0x74a7('0x78'));}var _0x1d28a5=[];try{_0x1d28a5=_['map'](JSON[_0x74a7('0x49')](process[_0x74a7('0x72')][0x4]),'id');}catch(_0x4a97ae){logger[_0x74a7('0x36')](_0x74a7('0x79'));}main(_0x21c768,_0x11b77b,_0x1d28a5,_0xfcea9d);}validate();process['on'](_0x74a7('0x7a'),handleStop);process['on'](_0x74a7('0x7b'),handleUncaughtException); \ No newline at end of file +var _0xc491=['where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','updatedAt','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','error','message','push','code','sequelize','catch','main','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','rows','errors','data','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','contact:import:','unlink','complete','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20'];(function(_0x188cc9,_0x31a449){var _0x5a684f=function(_0x47c2e3){while(--_0x47c2e3){_0x188cc9['push'](_0x188cc9['shift']());}};_0x5a684f(++_0x31a449);}(_0xc491,0xf5));var _0x1c49=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0xc491[_0x52a857];return _0x4e2aae;};'use strict';var fs=require('fs');var path=require(_0x1c49('0x0'));var _=require(_0x1c49('0x1'));var Papa=require(_0x1c49('0x2'));var util=require('util');var BPromise=require(_0x1c49('0x3'));var moment=require(_0x1c49('0x4'));var squel=require(_0x1c49('0x5'));var Redis=require(_0x1c49('0x6'));var db=require(_0x1c49('0x7'))['db'];var config=require(_0x1c49('0x8'));var logger=require(_0x1c49('0x9'))('import');config['redis']=_[_0x1c49('0xa')](config[_0x1c49('0xb')],{'host':_0x1c49('0xc'),'port':0x18eb});var socket=require(_0x1c49('0xd'))(new Redis(config[_0x1c49('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x1c49('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x46eafd){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'](_0x46eafd);}function selectNotIn(_0x47085c,_0x480636,_0x47463f,_0x8742d,_0x31b29b){return squel[_0x1c49('0xf')]()[_0x1c49('0x10')](_0x1c49('0x11'))[_0x1c49('0x12')](_0x8742d)[_0x1c49('0x13')](_0x480636,null,_0x480636+_0x1c49('0x14')+_0x8742d+'.'+_0x47463f)['where'](_0x8742d+'.'+_0x47463f+'\x20=\x20'+_0x47085c+'.'+_0x47463f)[_0x1c49('0x15')](_0x480636+_0x1c49('0x16')+_0x31b29b['join']()+')');}function insertCmHopper(_0x1570e9,_0xe24153,_0x24005e,_0x3d7bf6,_0x3399e2){var _0x55b2bb=['cm_contacts.phone',_0x1c49('0x17'),_0x1c49('0x18'),_0x1c49('0x19'),_0xe24153+'.'+_0x3d7bf6,_0x1c49('0x1a'),'cm_contacts.updatedAt',_0x1c49('0x1b'),_0x1c49('0x1c'),'\x22'+_0x3399e2+'\x22'];return squel[_0x1c49('0x1d')]()[_0x1c49('0x1e')](_0x1c49('0x1f'))[_0x1c49('0x20')]([_0x1c49('0x11'),_0x1c49('0x21'),_0x1c49('0x22'),_0x1c49('0x23'),_0x3d7bf6,_0x1c49('0x24'),'updatedAt','priority','UserId',_0x1c49('0x25')],squel[_0x1c49('0xf')]()[_0x1c49('0x26')](_0x55b2bb)[_0x1c49('0x12')](_0xe24153)[_0x1c49('0x13')](_0x1c49('0x27'),null,_0x1c49('0x28')+_0xe24153+_0x1c49('0x29'))[_0x1c49('0x13')](_0x24005e,null,_0x24005e+_0x1c49('0x14')+_0xe24153+'.'+_0x3d7bf6)[_0x1c49('0x15')](_0xe24153+'.CmListId\x20=\x20?',_0x1570e9)['where'](_0x1c49('0x2a'),NOW)[_0x1c49('0x15')](_0x1c49('0x2b'),selectNotIn(_0xe24153,_0x24005e,_0x3d7bf6,_0x1c49('0x1f'),['\x22always\x22',_0x1c49('0x2c')]))[_0x1c49('0x15')](_0x1c49('0x2b'),selectNotIn(_0xe24153,_0x24005e,_0x3d7bf6,_0x1c49('0x1f'),[_0x1c49('0x2d')])))[_0x1c49('0x2e')]();}function insertCmHopperBlack(_0x687eb0,_0x4de42b,_0x3b7afe,_0x507928){var _0x14eb44=[_0x1c49('0x2f'),'cm_contacts.id',_0x1c49('0x19'),_0x4de42b+'.'+_0x507928,_0x1c49('0x1a'),'cm_contacts.updatedAt'];return squel[_0x1c49('0x1d')]()[_0x1c49('0x1e')](_0x1c49('0x30'))['fromQuery']([_0x1c49('0x11'),'ContactId','ListId',_0x507928,_0x1c49('0x24'),_0x1c49('0x31')],squel['select']()[_0x1c49('0x26')](_0x14eb44)[_0x1c49('0x12')](_0x4de42b)[_0x1c49('0x13')](_0x1c49('0x27'),null,_0x1c49('0x28')+_0x4de42b+_0x1c49('0x29'))[_0x1c49('0x13')](_0x3b7afe,null,_0x3b7afe+'.id\x20=\x20'+_0x4de42b+'.'+_0x507928)[_0x1c49('0x15')](_0x4de42b+_0x1c49('0x32'),_0x687eb0)['where'](_0x1c49('0x2a'),NOW)['where'](_0x1c49('0x2b'),squel[_0x1c49('0xf')]()[_0x1c49('0x10')]('phone')[_0x1c49('0x12')]('cm_hopper_black')[_0x1c49('0x15')](_0x1c49('0x33'),_0x687eb0)[_0x1c49('0x15')](_0x507928+_0x1c49('0x34'),_0x4de42b+'.'+_0x507928)))[_0x1c49('0x2e')]();}function insertCmContact(_0x34f4d8,_0x54745e,_0x44a8c5,_0x12b435){var _0x5f462f=_[_0x1c49('0x35')](_[_0x1c49('0x36')](_0x12b435),[_0x1c49('0x23'),_0x1c49('0x37'),_0x1c49('0x24'),_0x1c49('0x31')]);return squel[_0x1c49('0x1d')]()[_0x1c49('0x1e')](_0x1c49('0x27'))['fromQuery'](_0x5f462f,squel[_0x1c49('0xf')]()[_0x1c49('0x26')](_0x5f462f)[_0x1c49('0x12')](_0x54745e)[_0x1c49('0x15')]('('+_0x44a8c5[_0x1c49('0x13')](',')+_0x1c49('0x38'),squel[_0x1c49('0xf')]()[_0x1c49('0x26')](_0x44a8c5)[_0x1c49('0x12')](_0x1c49('0x27'))[_0x1c49('0x15')](_0x1c49('0x33'),_0x34f4d8))['where']('id\x20IN\x20?',squel[_0x1c49('0xf')]()[_0x1c49('0x10')](_0x1c49('0x39'),_0x1c49('0x3a'))[_0x1c49('0x12')](_0x54745e)[_0x1c49('0x3b')](_0x44a8c5[_0x1c49('0x13')](','))))[_0x1c49('0x2e')]();}function handleStop(){logger[_0x1c49('0x3c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2ed95b){logger[_0x1c49('0x3d')](_0x2ed95b[_0x1c49('0x3e')]);process['exit'](0x1);}function handleError(_0x5e6323,_0x13998f){stats['errors'][_0x1c49('0x3f')]({'name':_0x13998f[_0x1c49('0x40')],'message':_0x13998f[_0x1c49('0x3e')],'row':_0x5e6323});}function handleQuery(_0x1e075d){logger[_0x1c49('0x3c')](_0x1e075d);return db[_0x1c49('0x41')]['query'](_0x1e075d)['spread'](function(_0x26f345){results[_0x1c49('0x3f')](_0x26f345);})[_0x1c49('0x42')](function(_0x4527bf){logger[_0x1c49('0x3d')](_0x4527bf['message']);});}function main(_0x3b2996,_0x15e722,_0x35524d,_0x5e0725){logger[_0x1c49('0x3c')](_0x1c49('0x43'),_0x3b2996,JSON['stringify'](_0x15e722));process[_0x1c49('0x44')]('start');var _0x5f1ef5=_0x15e722[_0x1c49('0x45')];var _0x4ee97=_0x15e722[_0x1c49('0x46')];var _0x37d8b0=path['join'](config[_0x1c49('0x47')],_0x1c49('0x48'),_0x4ee97+_0x1c49('0x49'));var _0x381bab=_[_0x1c49('0x36')](_0x5f1ef5)[_0x1c49('0x13')]();logger['info'](_0x1c49('0x4a'),_0x381bab);fs[_0x1c49('0x4b')](_0x37d8b0,_0x381bab+'\x0a');Papa[_0x1c49('0x4c')](fs[_0x1c49('0x4d')](_0x3b2996),{'header':!![],'skipEmptyLines':!![],'step':function(_0x421331,_0x34ad0a){try{for(var _0xac4b2c=0x0,_0x2a40a4=[];_0xac4b2c<_0x421331['data']['length'];_0xac4b2c++){stats[_0x1c49('0x4e')]+=0x1;if(_0x421331[_0x1c49('0x4f')][_0xac4b2c]){handleError(_0x421331[_0x1c49('0x50')][_0xac4b2c],_0x421331[_0x1c49('0x4f')][_0xac4b2c]);}else{var _0x3ba2df=[];for(var _0x1129a1 in _0x5f1ef5){if(_0x5f1ef5[_0x1c49('0x51')](_0x1129a1)){if(_0x421331[_0x1c49('0x50')][_0xac4b2c][_0x5f1ef5[_0x1129a1]]){var _0x582aaf=_['trim'](_0x421331[_0x1c49('0x50')][_0xac4b2c][_0x5f1ef5[_0x1129a1]]['replace'](/"/g,'\x27'));switch(_0x1129a1){case'scheduledat':var _0x277577=moment(_0x582aaf,_0x1c49('0x52'),!![]);if(_0x277577[_0x1c49('0x53')]()){_0x2a40a4['push']('\x22'+_0x582aaf+'\x22');}else{_0x3ba2df['push'](_0x1c49('0x54'));}break;case _0x1c49('0x55'):var _0x16add2=parseInt(_0x582aaf);_0x582aaf=_[_0x1c49('0x56')](_0x16add2)||_0x16add2<0x0||_0x16add2>0x4?_0x5e0725?0x3:0x2:_0x16add2;_0x2a40a4[_0x1c49('0x3f')]('\x22'+_0x582aaf+'\x22');break;case _0x1c49('0x57'):var _0x5049ab=parseInt(_0x582aaf);if(_['isNumber'](_0x5049ab)&&_[_0x1c49('0x58')](_0x35524d,_0x5049ab)){_0x2a40a4['push']('\x22'+_0x5049ab+'\x22');}else{_0x3ba2df[_0x1c49('0x3f')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x582aaf)){_0x2a40a4[_0x1c49('0x3f')]('\x22'+_0x582aaf+'\x22');}else{_0x3ba2df['push'](_0x1c49('0x59'));}break;case _0x1c49('0x5a'):var _0x5d4bc4=moment(_0x582aaf,_0x1c49('0x5b'),!![]);if(_0x5d4bc4[_0x1c49('0x53')]()){_0x2a40a4[_0x1c49('0x3f')]('\x22'+_0x582aaf+'\x22');}else{_0x3ba2df[_0x1c49('0x3f')](_0x1c49('0x5c'));}break;default:_0x2a40a4[_0x1c49('0x3f')]('\x22'+_0x582aaf+'\x22');}}else{switch(_0x1129a1){case _0x1c49('0x5d'):case _0x1c49('0x11'):_0x3ba2df['push'](_0x1129a1+_0x1c49('0x5e'));break;default:_0x2a40a4[_0x1c49('0x3f')]('\x22\x22');}}}}if(_0x3ba2df[_0x1c49('0x5f')]){handleError(_0x421331[_0x1c49('0x50')][_0xac4b2c],{'code':_0x1c49('0x60'),'message':_0x3ba2df[_0x1c49('0x13')]()});}else{fs['appendFileSync'](_0x37d8b0,_0x2a40a4[_0x1c49('0x13')]()+'\x0a');}_0x2a40a4=[];}if(!(stats['rows']%0xc8)){socket[_0x1c49('0x61')]('contact:import:'+_0x4ee97,stats);stats[_0x1c49('0x4f')]=[];}}if(stopped){logger[_0x1c49('0x3c')](_0x1c49('0x62'));_0x34ad0a[_0x1c49('0x63')]();}}catch(_0x13fedb){handleError(_0x421331[_0x1c49('0x50')][_0xac4b2c],{'code':_0x1c49('0x64'),'message':_0x13fedb[_0x1c49('0x3e')]});logger[_0x1c49('0x3d')](_0x1c49('0x65'),_0x13fedb[_0x1c49('0x3e')]);}},'complete':function(){try{var _0x48ce18=[];var _0x511539='cm_contacts';if(_0x15e722['duplicates']&&_0x15e722[_0x1c49('0x66')][_0x1c49('0x5f')]){_0x511539=_0x1c49('0x67')+_0x4ee97;_0x48ce18[_0x1c49('0x3f')](_0x1c49('0x68')+_0x511539+'\x20LIKE\x20cm_contacts;');}var _0x16c9a5=util[_0x1c49('0xe')](_0x1c49('0x69'),_0x37d8b0,_0x511539,_0x381bab,_0x15e722[_0x1c49('0x23')],_0x15e722[_0x1c49('0x37')]||null,NOW,NOW);if(_[_0x1c49('0x6a')](_0x5f1ef5[_0x1c49('0x21')])){_0x16c9a5+=_0x1c49('0x6b');}_0x48ce18[_0x1c49('0x3f')](_0x16c9a5);if(_0x15e722[_0x1c49('0x66')]&&_0x15e722[_0x1c49('0x66')]['length']){_0x48ce18[_0x1c49('0x3f')](insertCmContact(_0x15e722[_0x1c49('0x23')],_0x511539,_0x15e722[_0x1c49('0x66')],_0x5f1ef5));_0x48ce18[_0x1c49('0x3f')](_0x1c49('0x6c')+_0x511539+';');}_0x48ce18[_0x1c49('0x3f')](insertCmHopper(_0x15e722[_0x1c49('0x23')],_0x1c49('0x6d'),_0x1c49('0x6e'),_0x1c49('0x6f'),_0x5e0725));_0x48ce18[_0x1c49('0x3f')](insertCmHopperBlack(_0x15e722[_0x1c49('0x23')],_0x1c49('0x70'),_0x1c49('0x6e'),'VoiceQueueId'));_0x48ce18[_0x1c49('0x3f')](insertCmHopper(_0x15e722[_0x1c49('0x23')],_0x1c49('0x71'),_0x1c49('0x72'),_0x1c49('0x73'),_0x5e0725));_0x48ce18[_0x1c49('0x3f')](insertCmHopperBlack(_0x15e722[_0x1c49('0x23')],'campaigns_has_cm_blacklists',_0x1c49('0x72'),_0x1c49('0x73')));BPromise[_0x1c49('0x74')](_0x48ce18,handleQuery)['then'](function(_0x48ec7f){stats['finish']=!![];stats['affectedRows']=_0x15e722['duplicates']&&_0x15e722[_0x1c49('0x66')]['length']?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x1c49('0x75')+_0x4ee97,stats);fs[_0x1c49('0x76')](_0x3b2996);fs[_0x1c49('0x76')](_0x37d8b0);process['exit'](0x0);})[_0x1c49('0x42')](function(_0x36b976){logger[_0x1c49('0x3d')](_0x36b976[_0x1c49('0x3e')]);process['exit'](0x1);});}catch(_0x502657){logger[_0x1c49('0x3d')](_0x1c49('0x77'),_0x502657['message']);process[_0x1c49('0x78')](0x1);}},'error':function(_0xd5aa01,_0x517f28,_0x26de65,_0x3f9db7){throw new Error(_0x3f9db7);}});}function validate(){if(process[_0x1c49('0x79')]&&process['argv'][_0x1c49('0x5f')]<0x4){throw new Error(_0x1c49('0x7a'));}var _0x1cfaa9=path['join'](config[_0x1c49('0x47')],_0x1c49('0x48'),process[_0x1c49('0x79')][0x2]);if(!fs[_0x1c49('0x7b')](_0x1cfaa9)){throw new Error(_0x1c49('0x7c'));}var _0xd46779={};try{_0xd46779=JSON[_0x1c49('0x4c')](process[_0x1c49('0x79')][0x3]);if(!_0xd46779['binding']){throw new Error(_0x1c49('0x7d'));}if(!_0xd46779['binding']['phone']){throw new Error(_0x1c49('0x7e'));}if(!_0xd46779['binding'][_0x1c49('0x5d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x15b9b7=0x0;if(_0xd46779[_0x1c49('0x45')][_0x1c49('0x57')]){_0x15b9b7=0x1;}if(!_0xd46779['ListId']){throw new Error(_0x1c49('0x7f'));}}catch(_0x5a3191){throw new Error(_0x1c49('0x80'));}var _0x526c2a=[];try{_0x526c2a=_[_0x1c49('0x81')](JSON[_0x1c49('0x4c')](process[_0x1c49('0x79')][0x4]),'id');}catch(_0x37f607){logger[_0x1c49('0x3c')](_0x1c49('0x82'));}main(_0x1cfaa9,_0xd46779,_0x526c2a,_0x15b9b7);}validate();process['on'](_0x1c49('0x83'),handleStop);process['on'](_0x1c49('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7423dae..93d30d6 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['destexten','queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','uniqueid','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Call\x20To'];(function(_0x54f108,_0x599264){var _0x346d5e=function(_0x172f38){while(--_0x172f38){_0x54f108['push'](_0x54f108['shift']());}};_0x346d5e(++_0x599264);}(_0x2ef3,0xba));var _0x32ef=function(_0x441a26,_0x2809d1){_0x441a26=_0x441a26-0x0;var _0x160d2=_0x2ef3[_0x441a26];return _0x160d2;};'use strict';exports[_0x32ef('0x0')]=function(_0x11c049,_0x47513a){var _0x26e56e=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x2'),'variableName':null}];switch(_0x11c049['toLowerCase']()){case _0x32ef('0x3'):switch(_0x47513a[_0x32ef('0x4')]()){case'inbound':_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':'queue'});_0x26e56e['push']({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0x7')});break;case _0x32ef('0x8'):_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x1'),'content':_0x32ef('0x9'),'variableName':null});_0x26e56e[_0x32ef('0x5')]({'type':_0x32ef('0x6'),'content':'','variableName':_0x32ef('0xa')});break;}}return _0x26e56e;};exports[_0x32ef('0xb')]=function(_0x56eb42,_0x5780e9){var _0x401d0b=[];switch(_0x56eb42[_0x32ef('0x4')]()){case _0x32ef('0x3'):switch(_0x5780e9[_0x32ef('0x4')]()){case'inbound':_0x401d0b=[{'type':_0x32ef('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x32ef('0x6'),'variableName':'calleridname'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0xd'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0xe')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':_0x32ef('0xf')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x10'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x11'),'keyType':_0x32ef('0x6'),'variableName':'agentcalledAt'},{'type':_0x32ef('0x1'),'content':_0x32ef('0x12'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x32ef('0x13'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x14')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x15'),'keyType':_0x32ef('0x6'),'variableName':'destcalleridnum'},{'type':_0x32ef('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x16'),'keyType':'variable','variableName':_0x32ef('0x17')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x18'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x19'),'keyType':_0x32ef('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x32ef('0x1a'),'keyType':'variable','variableName':'holdtime'},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1b'),'keyType':_0x32ef('0x6'),'variableName':_0x32ef('0x1c')}];break;case _0x32ef('0x8'):_0x401d0b=[{'type':_0x32ef('0x1'),'content':_0x32ef('0x1d'),'variableName':null},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x1e'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0xa')},{'type':_0x32ef('0xc'),'content':'','key':'Member\x20Name','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x1f')},{'type':'keyValue','content':'','key':_0x32ef('0x10'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x20')},{'type':_0x32ef('0xc'),'content':'','key':'Date','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x21')},{'type':_0x32ef('0x1'),'content':_0x32ef('0x22')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x23'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x32ef('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x24')},{'type':'keyValue','content':'','key':_0x32ef('0x25'),'keyType':_0x32ef('0x6'),'keyContent':'','variableName':_0x32ef('0x26')},{'type':_0x32ef('0xc'),'content':'','key':_0x32ef('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x401d0b;}; \ No newline at end of file +var _0x5f2f=['Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','starttime','***\x20Time\x20Info\x20***','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3077ea,_0x1e7f39){_0x3077ea=_0x3077ea-0x0;var _0x2e5ecf=_0x5f2f[_0x3077ea];return _0x2e5ecf;};'use strict';exports[_0xf5f2('0x0')]=function(_0x423dd9,_0x2dcf60){var _0x1a7be1=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x2'),'variableName':null}];switch(_0x423dd9[_0xf5f2('0x3')]()){case _0xf5f2('0x4'):switch(_0x2dcf60['toLowerCase']()){case'inbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x7')});_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x8')});break;case'outbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x1'),'content':_0xf5f2('0x9'),'variableName':null});_0x1a7be1['push']({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0xa')});break;}}return _0x1a7be1;};exports[_0xf5f2('0xb')]=function(_0x4e0e6b,_0x977a59){var _0x4ebbbe=[];switch(_0x4e0e6b['toLowerCase']()){case _0xf5f2('0x4'):switch(_0x977a59[_0xf5f2('0x3')]()){case'inbound':_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0xe'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x8')},{'type':'keyValue','content':'','key':_0xf5f2('0xf'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x10')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x11'),'keyType':'variable','variableName':_0xf5f2('0x12')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x13'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x7')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x15')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x19'),'keyType':'variable','variableName':_0xf5f2('0x1a')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1b'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1c')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1d'),'keyType':_0xf5f2('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0xf5f2('0x1e'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1f')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x20'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x21')}];break;case _0xf5f2('0x22'):_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x23'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x24'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x25')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x26')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xf5f2('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x27')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x28'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x29')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xf5f2('0x2b')}];break;}}return _0x4ebbbe;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index f859d79..ec3a943 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 _0x3f8a=['html','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','Interaction','findOne','then','update','catch','error','tracked','user','query','clone','body','omit'];(function(_0x1c7f36,_0x154f47){var _0x4c1dad=function(_0x2179d8){while(--_0x2179d8){_0x1c7f36['push'](_0x1c7f36['shift']());}};_0x4c1dad(++_0x154f47);}(_0x3f8a,0x1a6));var _0xa3f8=function(_0x150250,_0x2fe1f4){_0x150250=_0x150250-0x0;var _0xc76dcf=_0x3f8a[_0x150250];return _0xc76dcf;};'use strict';var _=require(_0xa3f8('0x0'));var db=require(_0xa3f8('0x1'))['db'];var loggers={'openchannel':require(_0xa3f8('0x2'))(_0xa3f8('0x3')),'mail':require(_0xa3f8('0x2'))(_0xa3f8('0x4')),'fax':require(_0xa3f8('0x2'))(_0xa3f8('0x5')),'sms':require(_0xa3f8('0x2'))(_0xa3f8('0x6')),'chat':require(_0xa3f8('0x2'))(_0xa3f8('0x7'))};function getInteractionId(_0x344f67,_0xf2008a,_0x5e0b7b){if(_0x344f67&&_0x344f67[_['upperFirst'](_0x5e0b7b)+_0xa3f8('0x8')]){return _0x344f67[_['upperFirst'](_0x5e0b7b)+_0xa3f8('0x8')];}else if(_0x344f67&&_0x344f67['id']){return _0x344f67['id'];}else if(_0xf2008a&&_0xf2008a['id']){return _0xf2008a['id'];}else{return _0xa3f8('0x9');}}function log(_0x128704,_0x241732,_0x5684a,_0x2689b2,_0x57d109,_0x5e38c4){loggers[_0x57d109['toLowerCase']()][_0x128704](_0xa3f8('0xa'),_0x5e38c4['toUpperCase'](),_0x241732?_0x241732['id']:null,_0x241732?_0x241732[_0xa3f8('0xb')]:null,_0x241732?_0x241732[_0xa3f8('0xc')]:null,getInteractionId(_0x5684a,_0x2689b2,_0x57d109),_0x5684a?JSON[_0xa3f8('0xd')](_0x5684a):'null');}function updateUser(_0x3464bc,_0x54b7f2,_0x3ed15d,_0x3c46e6,_0x5b26ad){db[_['upperFirst'](_0x3c46e6)+_0xa3f8('0xe')][_0xa3f8('0xf')]({'where':{'id':getInteractionId(_0x54b7f2,_0x3ed15d,_0x3c46e6)}})[_0xa3f8('0x10')](function(_0x1d677f){if(_0x1d677f){return _0x1d677f[_0xa3f8('0x11')]({'UserId':_0x3464bc?_0x3464bc['id']:null});}})[_0xa3f8('0x10')](function(_0x190008){if(_0x190008){log('info',_0x3464bc,_0x54b7f2,_0x3ed15d,_0x3c46e6,_0x5b26ad);}})[_0xa3f8('0x12')](function(){log(_0xa3f8('0x13'),_0x3464bc,_0x54b7f2,_0x3ed15d,_0x3c46e6,_0x5b26ad);});}exports[_0xa3f8('0x14')]=function(_0x33514f,_0x156745){return function(_0xa9c81c,_0x348c4f,_0x17e55e){var _0x5959cb=_0xa9c81c[_0xa3f8('0x15')];var _0x153b60={};var _0x41f10c=_0xa9c81c[_0xa3f8('0x16')];if(_0x153b60){_0x153b60=_[_0xa3f8('0x17')](_0xa9c81c[_0xa3f8('0x18')]);_0x153b60=_[_0xa3f8('0x19')](_0x153b60,[_0xa3f8('0x18'),_0xa3f8('0x1a'),'phone','fax',_0xa3f8('0x1b')]);}updateUser(_0x5959cb,_0x153b60,_0x41f10c,_0x33514f,_0x156745);_0x17e55e(null);};}; \ No newline at end of file +var _0xe152=['omit','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','Interaction','findOne','then','update','catch','error','user','clone'];(function(_0x52f1a7,_0x31d1d2){var _0x38f07e=function(_0x193999){while(--_0x193999){_0x52f1a7['push'](_0x52f1a7['shift']());}};_0x38f07e(++_0x31d1d2);}(_0xe152,0x91));var _0x2e15=function(_0x36c7aa,_0x221652){_0x36c7aa=_0x36c7aa-0x0;var _0xd3ce07=_0xe152[_0x36c7aa];return _0xd3ce07;};'use strict';var _=require(_0x2e15('0x0'));var db=require(_0x2e15('0x1'))['db'];var loggers={'openchannel':require(_0x2e15('0x2'))(_0x2e15('0x3')),'mail':require(_0x2e15('0x2'))(_0x2e15('0x4')),'fax':require(_0x2e15('0x2'))(_0x2e15('0x5')),'sms':require('../../config/logger')(_0x2e15('0x6')),'chat':require(_0x2e15('0x2'))(_0x2e15('0x7'))};function getInteractionId(_0x25c820,_0x39d1f2,_0x7d7680){if(_0x25c820&&_0x25c820[_[_0x2e15('0x8')](_0x7d7680)+_0x2e15('0x9')]){return _0x25c820[_['upperFirst'](_0x7d7680)+_0x2e15('0x9')];}else if(_0x25c820&&_0x25c820['id']){return _0x25c820['id'];}else if(_0x39d1f2&&_0x39d1f2['id']){return _0x39d1f2['id'];}else{return _0x2e15('0xa');}}function log(_0x48568d,_0x8a3c14,_0x2a830e,_0x572ad2,_0x3a3d69,_0x34be7f){loggers[_0x3a3d69[_0x2e15('0xb')]()][_0x48568d]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34be7f[_0x2e15('0xc')](),_0x8a3c14?_0x8a3c14['id']:null,_0x8a3c14?_0x8a3c14[_0x2e15('0xd')]:null,_0x8a3c14?_0x8a3c14[_0x2e15('0xe')]:null,getInteractionId(_0x2a830e,_0x572ad2,_0x3a3d69),_0x2a830e?JSON['stringify'](_0x2a830e):'null');}function updateUser(_0x2f7eba,_0x25edc1,_0x40278d,_0x343860,_0x5a1b02){db[_[_0x2e15('0x8')](_0x343860)+_0x2e15('0xf')][_0x2e15('0x10')]({'where':{'id':getInteractionId(_0x25edc1,_0x40278d,_0x343860)}})[_0x2e15('0x11')](function(_0x2647bf){if(_0x2647bf){return _0x2647bf[_0x2e15('0x12')]({'UserId':_0x2f7eba?_0x2f7eba['id']:null});}})[_0x2e15('0x11')](function(_0x183448){if(_0x183448){log('info',_0x2f7eba,_0x25edc1,_0x40278d,_0x343860,_0x5a1b02);}})[_0x2e15('0x13')](function(){log(_0x2e15('0x14'),_0x2f7eba,_0x25edc1,_0x40278d,_0x343860,_0x5a1b02);});}exports['tracked']=function(_0x213707,_0x2a7312){return function(_0x77d6d5,_0x2a9f96,_0x1dba43){var _0x49955b=_0x77d6d5[_0x2e15('0x15')];var _0x43238b={};var _0x5b545d=_0x77d6d5['query'];if(_0x43238b){_0x43238b=_[_0x2e15('0x16')](_0x77d6d5['body']);_0x43238b=_[_0x2e15('0x17')](_0x43238b,[_0x2e15('0x18'),_0x2e15('0x19'),_0x2e15('0x1a'),'fax',_0x2e15('0x1b')]);}updateUser(_0x49955b,_0x43238b,_0x5b545d,_0x213707,_0x2a7312);_0x1dba43(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d500a34..eca9acd 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 _0xbd49=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','composable-middleware'];(function(_0x3c8c65,_0x2820fa){var _0x34df05=function(_0x49cae8){while(--_0x49cae8){_0x3c8c65['push'](_0x3c8c65['shift']());}};_0x34df05(++_0x2820fa);}(_0xbd49,0x86));var _0x9bd4=function(_0x4ed806,_0x4e8f42){_0x4ed806=_0x4ed806-0x0;var _0x242479=_0xbd49[_0x4ed806];return _0x242479;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x9bd4('0x0'));var db=require(_0x9bd4('0x1'))['db'];var config=require(_0x9bd4('0x2'));function getValueFromLicense(_0x5871af,_0x51972b){if(_0x5871af&&_0x51972b){if(_0x51972b[_0x9bd4('0x3')]&&_0x51972b[_0x9bd4('0x4')]){var _0x11224e=_0x51972b['data1'];var _0x368f79=_0x51972b[_0x9bd4('0x4')];var _0x25567a=_0x11224e[_0x9bd4('0x5')]('-')[0x4];var _0x3e9191=_0x11224e['split']('-')[0x0];var _0x1fcc9b=crypto[_0x9bd4('0x6')](_0x9bd4('0x7'),util[_0x9bd4('0x8')](_0x9bd4('0x9'),_0x25567a,_0x11224e,_0x3e9191));var _0x51e232=_0x1fcc9b[_0x9bd4('0xa')](_0x368f79,'base64','utf8');_0x51e232+=_0x1fcc9b[_0x9bd4('0xb')](_0x9bd4('0xc'));var _0x4180eb=JSON[_0x9bd4('0xd')](_0x51e232);return _0x4180eb[_0x9bd4('0xe')](_0x5871af)?_0x4180eb[_0x5871af]:null;}}return null;}function isLimit(_0x3d0b27,_0x322101,_0x3baca1,_0x1486b7){var _0x35aff9=_0x322101;return compose()[_0x9bd4('0xf')](function(_0x451c9b,_0x4897f6,_0x303cdc){return db[_0x9bd4('0x10')][_0x9bd4('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x313c67){var _0x15e5f2=getValueFromLicense(_0x3d0b27,_0x313c67);return _0x15e5f2?_0x15e5f2:_0x35aff9;})[_0x9bd4('0x12')](function(_0x25fd07){_0x35aff9=_0x25fd07;return _0x3baca1[_0x9bd4('0x13')](_0x1486b7);})[_0x9bd4('0x12')](function(_0x4d4553){if(_0x4d4553>=_0x35aff9){return _0x4897f6[_0x9bd4('0x14')](0x193)['json']({'message':util[_0x9bd4('0x8')](_0x9bd4('0x15'),_0x3d0b27)});}_0x303cdc();})['catch'](function(_0x4f5463){_0x303cdc(_0x4f5463);});});}function isUserLimit(){return isLimit(_0x9bd4('0x16'),0x1,db[_0x9bd4('0x17')],{'where':{'$or':[{'role':_0x9bd4('0x18')},{'role':_0x9bd4('0x19')}]}});}exports[_0x9bd4('0x1a')]=isUserLimit; \ No newline at end of file +var _0x397b=['../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','parse','hasOwnProperty','use','License','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','isUserLimit','util','composable-middleware','../../mysqldb'];(function(_0x351432,_0x2d2722){var _0x31cbda=function(_0x5f3f03){while(--_0x5f3f03){_0x351432['push'](_0x351432['shift']());}};_0x31cbda(++_0x2d2722);}(_0x397b,0x15b));var _0xb397=function(_0x45f8d9,_0x1c1b41){_0x45f8d9=_0x45f8d9-0x0;var _0x24ede6=_0x397b[_0x45f8d9];return _0x24ede6;};'use strict';var crypto=require('crypto');var util=require(_0xb397('0x0'));var compose=require(_0xb397('0x1'));var db=require(_0xb397('0x2'))['db'];var config=require(_0xb397('0x3'));function getValueFromLicense(_0x59b9a9,_0x5ae037){if(_0x59b9a9&&_0x5ae037){if(_0x5ae037[_0xb397('0x4')]&&_0x5ae037[_0xb397('0x5')]){var _0x39ef6e=_0x5ae037[_0xb397('0x4')];var _0xc21d81=_0x5ae037[_0xb397('0x5')];var _0x24216c=_0x39ef6e[_0xb397('0x6')]('-')[0x4];var _0x241bfc=_0x39ef6e['split']('-')[0x0];var _0x387929=crypto[_0xb397('0x7')]('aes-256-ctr',util[_0xb397('0x8')](_0xb397('0x9'),_0x24216c,_0x39ef6e,_0x241bfc));var _0x21bc81=_0x387929[_0xb397('0xa')](_0xc21d81,_0xb397('0xb'),'utf8');_0x21bc81+=_0x387929[_0xb397('0xc')]('utf8');var _0x390389=JSON[_0xb397('0xd')](_0x21bc81);return _0x390389[_0xb397('0xe')](_0x59b9a9)?_0x390389[_0x59b9a9]:null;}}return null;}function isLimit(_0x4c0843,_0x2434f8,_0x1b239a,_0x7e857f){var _0x59df89=_0x2434f8;return compose()[_0xb397('0xf')](function(_0x503921,_0x4419dd,_0x3b56b6){return db[_0xb397('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x2b51d3){var _0x252ce3=getValueFromLicense(_0x4c0843,_0x2b51d3);return _0x252ce3?_0x252ce3:_0x59df89;})['then'](function(_0x505408){_0x59df89=_0x505408;return _0x1b239a[_0xb397('0x11')](_0x7e857f);})[_0xb397('0x12')](function(_0x3f1dc1){if(_0x3f1dc1>=_0x59df89){return _0x4419dd[_0xb397('0x13')](0x193)[_0xb397('0x14')]({'message':util['format'](_0xb397('0x15'),_0x4c0843)});}_0x3b56b6();})[_0xb397('0x16')](function(_0x330e5c){_0x3b56b6(_0x330e5c);});});}function isUserLimit(){return isLimit(_0xb397('0x17'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xb397('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index b5c5645..411e9fa 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 _0xd647=['sequelize','fields','split','filters','forOwn','parse','limit','map','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isEmpty','isArray','length','isObject','unset','isNumeric','^[0-9]*$','match','lodash','moment'];(function(_0x35047c,_0x12eb2c){var _0x5039a6=function(_0x682687){while(--_0x682687){_0x35047c['push'](_0x35047c['shift']());}};_0x5039a6(++_0x12eb2c);}(_0xd647,0x19e));var _0x7d64=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xd647[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x7d64('0x0'));var moment=require(_0x7d64('0x1'));var sequelize=require(_0x7d64('0x2'));var LIMIT_VALUE=0xfa;exports[_0x7d64('0x3')]=function(_0x2a7f3f){var _0x2f7dcf=null;if(_0x2a7f3f){_0x2f7dcf=_0x2a7f3f[_0x7d64('0x4')](',');}return _0x2f7dcf;};exports[_0x7d64('0x5')]=function(_0x3beaa5){var _0x64c75b={};if(!_['isEmpty'](_0x3beaa5)){_0x64c75b={};_[_0x7d64('0x6')](_0x3beaa5,function(_0x51f1f2,_0x4692f9){try{_0x64c75b[_0x4692f9]=_['isArray'](_0x51f1f2)?_0x51f1f2:JSON[_0x7d64('0x7')](_0x51f1f2);}catch(_0x2ac703){_0x64c75b[_0x4692f9]=_0x51f1f2['split'](',');}});}return _0x64c75b;};exports[_0x7d64('0x8')]=function(_0x38708c){_0x38708c=parseInt(_0x38708c,0xa);if(!_0x38708c||_0x38708c<0x0){_0x38708c=LIMIT_VALUE;}return _0x38708c;};exports['offset']=function(_0x218c95){_0x218c95=parseInt(_0x218c95,0xa);if(!_0x218c95||_0x218c95<0x0){_0x218c95=0x0;}return _0x218c95;};exports['sort']=function(_0x29333e){var _0x10fa5e,_0x208322=null;if(_0x29333e){_0x10fa5e=_0x29333e[_0x7d64('0x4')](',');_0x208322=_[_0x7d64('0x9')](_0x10fa5e,function(_0x4057b5){if(_0x4057b5[_0x7d64('0xa')]('-')===0x0){return[_0x4057b5===_0x7d64('0xb')?sequelize[_0x7d64('0xc')](sequelize[_0x7d64('0xd')](_0x7d64('0xb')),_0x7d64('0xe')):_0x4057b5[_0x7d64('0xf')](0x1),'DESC'];}else{return[_0x4057b5===_0x7d64('0xb')?sequelize[_0x7d64('0xc')](sequelize[_0x7d64('0xd')](_0x7d64('0xb')),_0x7d64('0xe')):_0x4057b5,_0x7d64('0x10')];}});}return _0x208322;};exports[_0x7d64('0x11')]=function(_0x4d9397,_0x2e61cc){if(_[_0x7d64('0x12')](_0x4d9397)){return _0x4d9397;}if(_[_0x7d64('0x13')](_0x4d9397)){for(var _0x252b93=0x0;_0x252b93<_0x4d9397[_0x7d64('0x14')];_0x252b93+=0x1){_0x4d9397[_0x252b93]=this[_0x7d64('0x11')](_0x4d9397[_0x252b93],_0x2e61cc);}return _0x4d9397;}if(!_[_0x7d64('0x15')](_0x4d9397)){return _0x4d9397;}if(_['isString'](_0x2e61cc)){_0x2e61cc=[_0x2e61cc];}if(!_[_0x7d64('0x13')](_0x2e61cc)){return _0x4d9397;}for(var _0x1bca57=0x0;_0x1bca57<_0x2e61cc[_0x7d64('0x14')];_0x1bca57+=0x1){_[_0x7d64('0x16')](_0x4d9397,_0x2e61cc[_0x1bca57]);}for(var _0x21c491 in _0x4d9397){if(_0x4d9397['hasOwnProperty'](_0x21c491)){_0x4d9397[_0x21c491]=this[_0x7d64('0x11')](_0x4d9397[_0x21c491],_0x2e61cc);}}return _0x4d9397;};exports[_0x7d64('0x17')]=function(_0x33ad1b){return _0x33ad1b['match'](RegExp(_0x7d64('0x18')))?!![]:![];};exports['isEmail']=function(_0x157e01){return _0x157e01[_0x7d64('0x19')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x68af=['filters','isEmpty','parse','split','limit','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','isArray','length','isString','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','lodash','fields'];(function(_0x18e6a2,_0x28b8f2){var _0x34b01e=function(_0x360277){while(--_0x360277){_0x18e6a2['push'](_0x18e6a2['shift']());}};_0x34b01e(++_0x28b8f2);}(_0x68af,0x1d9));var _0xf68a=function(_0x5b2cee,_0x4bdddd){_0x5b2cee=_0x5b2cee-0x0;var _0x432cd6=_0x68af[_0x5b2cee];return _0x432cd6;};'use strict';var _=require(_0xf68a('0x0'));var moment=require('moment');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xf68a('0x1')]=function(_0x34c32b){var _0x67cc37=null;if(_0x34c32b){_0x67cc37=_0x34c32b['split'](',');}return _0x67cc37;};exports[_0xf68a('0x2')]=function(_0x1d540f){var _0x84d36={};if(!_[_0xf68a('0x3')](_0x1d540f)){_0x84d36={};_['forOwn'](_0x1d540f,function(_0xb87693,_0x2ccac4){try{_0x84d36[_0x2ccac4]=_['isArray'](_0xb87693)?_0xb87693:JSON[_0xf68a('0x4')](_0xb87693);}catch(_0x29f641){_0x84d36[_0x2ccac4]=_0xb87693[_0xf68a('0x5')](',');}});}return _0x84d36;};exports[_0xf68a('0x6')]=function(_0x41830e){_0x41830e=parseInt(_0x41830e,0xa);if(!_0x41830e||_0x41830e<0x0){_0x41830e=LIMIT_VALUE;}return _0x41830e;};exports['offset']=function(_0x44a9de){_0x44a9de=parseInt(_0x44a9de,0xa);if(!_0x44a9de||_0x44a9de<0x0){_0x44a9de=0x0;}return _0x44a9de;};exports[_0xf68a('0x7')]=function(_0x39baa2){var _0x260061,_0x2f2b8a=null;if(_0x39baa2){_0x260061=_0x39baa2[_0xf68a('0x5')](',');_0x2f2b8a=_['map'](_0x260061,function(_0x1164f9){if(_0x1164f9[_0xf68a('0x8')]('-')===0x0){return[_0x1164f9===_0xf68a('0x9')?sequelize[_0xf68a('0xa')](sequelize[_0xf68a('0xb')](_0xf68a('0x9')),_0xf68a('0xc')):_0x1164f9['substr'](0x1),_0xf68a('0xd')];}else{return[_0x1164f9===_0xf68a('0x9')?sequelize[_0xf68a('0xa')](sequelize[_0xf68a('0xb')](_0xf68a('0x9')),_0xf68a('0xc')):_0x1164f9,_0xf68a('0xe')];}});}return _0x2f2b8a;};exports[_0xf68a('0xf')]=function(_0x1cc404,_0x5894db){if(_['isEmpty'](_0x1cc404)){return _0x1cc404;}if(_[_0xf68a('0x10')](_0x1cc404)){for(var _0x19a858=0x0;_0x19a858<_0x1cc404[_0xf68a('0x11')];_0x19a858+=0x1){_0x1cc404[_0x19a858]=this[_0xf68a('0xf')](_0x1cc404[_0x19a858],_0x5894db);}return _0x1cc404;}if(!_['isObject'](_0x1cc404)){return _0x1cc404;}if(_[_0xf68a('0x12')](_0x5894db)){_0x5894db=[_0x5894db];}if(!_[_0xf68a('0x10')](_0x5894db)){return _0x1cc404;}for(var _0x53c7b7=0x0;_0x53c7b7<_0x5894db['length'];_0x53c7b7+=0x1){_[_0xf68a('0x13')](_0x1cc404,_0x5894db[_0x53c7b7]);}for(var _0x2bbb84 in _0x1cc404){if(_0x1cc404[_0xf68a('0x14')](_0x2bbb84)){_0x1cc404[_0x2bbb84]=this[_0xf68a('0xf')](_0x1cc404[_0x2bbb84],_0x5894db);}}return _0x1cc404;};exports[_0xf68a('0x15')]=function(_0x46dccc){return _0x46dccc[_0xf68a('0x16')](RegExp(_0xf68a('0x17')))?!![]:![];};exports[_0xf68a('0x18')]=function(_0x3bcb53){return _0x3bcb53[_0xf68a('0x16')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 5ae6cba..4d80b81 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x90e47a,_0x487ab7){var _0x6c2ea9=function(_0x1db0c0){while(--_0x1db0c0){_0x90e47a['push'](_0x90e47a['shift']());}};_0x6c2ea9(++_0x487ab7);}(_0xe706,0xa3));var _0x6e70=function(_0x15caa5,_0x206c67){_0x15caa5=_0x15caa5-0x0;var _0x1200c7=_0xe706[_0x15caa5];return _0x1200c7;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file +var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x4c79e6,_0x208f40){var _0x29715b=function(_0x46090e){while(--_0x46090e){_0x4c79e6['push'](_0x4c79e6['shift']());}};_0x29715b(++_0x208f40);}(_0xe706,0xa3));var _0x6e70=function(_0x353b4a,_0x4efd0a){_0x353b4a=_0x353b4a-0x0;var _0xd97525=_0xe706[_0x353b4a];return _0xd97525;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6989653..ff671e1 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 _0x36b6=['replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x36b6,0x1bf));var _0x636b=function(_0x2802c2,_0x3ae05e){_0x2802c2=_0x2802c2-0x0;var _0x466800=_0x36b6[_0x2802c2];return _0x466800;};'use strict';var _=require(_0x636b('0x0'));var os=require('os');var crypto=require(_0x636b('0x1'));var machine=require(_0x636b('0x2'));var exec=require('child_process')[_0x636b('0x3')];function getInterfaces(){var _0x3cae26=[];var _0x220adb=os[_0x636b('0x4')]();var _0x2717c0=_[_0x636b('0x5')](_[_0x636b('0x6')](_0x220adb));for(var _0x49b2e2=0x0;_0x49b2e2<_0x2717c0['length'];_0x49b2e2++){var _0x127745=_0x220adb[_0x2717c0[_0x49b2e2]][_0x636b('0x7')](function(_0x3d749d){return _0x3d749d[_0x636b('0x8')]===_0x636b('0x9')&&_0x3d749d['internal']===![];});_0x3cae26=_0x3cae26[_0x636b('0xa')](_0x127745);}return _0x3cae26;}function getFirstInterface(){var _0x3b7f0b=_[_0x636b('0xb')](getInterfaces());return{'macAddress':_0x3b7f0b&&_0x3b7f0b[_0x636b('0xc')]?_0x3b7f0b[_0x636b('0xc')]:_0x636b('0xd'),'ipAddress':_0x3b7f0b&&_0x3b7f0b[_0x636b('0xe')]?_0x3b7f0b[_0x636b('0xe')]:_0x636b('0xf')};}exports[_0x636b('0x10')]=getFirstInterface;function getCPUhash(){var _0x264ca9=_['orderBy'](os['cpus']()['map'](function(_0x1ec435){return _0x1ec435[_0x636b('0x11')];}))[_0x636b('0x12')](':');return crypto[_0x636b('0x13')](_0x636b('0x14'))[_0x636b('0x15')](_0x264ca9)[_0x636b('0x16')](_0x636b('0x17'));}exports[_0x636b('0x18')]=function(){switch(os[_0x636b('0x19')]()){case _0x636b('0x1a'):return exec(_0x636b('0x1b'),{'encoding':_0x636b('0x1c')})[_0x636b('0x1d')]('\x0d\x0a','');default:var _0x1584c7=getFirstInterface();var _0x3db5c0=getCPUhash();var _0x1eeeab=_0x3db5c0+'|'+os[_0x636b('0x1e')]()+'|'+_0x1584c7[_0x636b('0x1f')]+'|'+_0x1584c7[_0x636b('0x20')];var _0x1124fb=crypto['createHash']('md5')['update'](_0x1eeeab)[_0x636b('0x16')]('hex');return _0x1124fb[_0x636b('0x21')](0x0,0x8)+'-'+_0x1124fb[_0x636b('0x21')](0x8,0xc)+'-'+_0x1124fb[_0x636b('0x21')](0xc,0x10)+'-'+_0x1124fb[_0x636b('0x21')](0x10,0x14)+'-'+_0x1124fb[_0x636b('0x21')](0x14);}}; \ No newline at end of file +var _0x677b=['child_process','orderBy','length','filter','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','map','model','join','createHash','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','hostname','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x59cc4d,_0x13ce59){var _0x5021f7=function(_0x27392c){while(--_0x27392c){_0x59cc4d['push'](_0x59cc4d['shift']());}};_0x5021f7(++_0x13ce59);}(_0x677b,0xc8));var _0xb677=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x677b[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require(_0xb677('0x0'));var os=require('os');var crypto=require(_0xb677('0x1'));var machine=require(_0xb677('0x2'));var exec=require(_0xb677('0x3'))['execSync'];function getInterfaces(){var _0x53cc77=[];var _0x4f17ac=os['networkInterfaces']();var _0x2c6728=_[_0xb677('0x4')](_['keys'](_0x4f17ac));for(var _0x5b1663=0x0;_0x5b1663<_0x2c6728[_0xb677('0x5')];_0x5b1663++){var _0x1cb5f9=_0x4f17ac[_0x2c6728[_0x5b1663]][_0xb677('0x6')](function(_0x4a998a){return _0x4a998a['family']===_0xb677('0x7')&&_0x4a998a[_0xb677('0x8')]===![];});_0x53cc77=_0x53cc77[_0xb677('0x9')](_0x1cb5f9);}return _0x53cc77;}function getFirstInterface(){var _0x42b7db=_['head'](getInterfaces());return{'macAddress':_0x42b7db&&_0x42b7db[_0xb677('0xa')]?_0x42b7db[_0xb677('0xa')]:_0xb677('0xb'),'ipAddress':_0x42b7db&&_0x42b7db[_0xb677('0xc')]?_0x42b7db['address']:'127.0.0.1'};}exports[_0xb677('0xd')]=getFirstInterface;function getCPUhash(){var _0x349955=_['orderBy'](os['cpus']()[_0xb677('0xe')](function(_0x16c0e3){return _0x16c0e3[_0xb677('0xf')];}))[_0xb677('0x10')](':');return crypto[_0xb677('0x11')]('md5')[_0xb677('0x12')](_0x349955)[_0xb677('0x13')](_0xb677('0x14'));}exports[_0xb677('0x15')]=function(){switch(os[_0xb677('0x16')]()){case'win32':return exec(_0xb677('0x17'),{'encoding':_0xb677('0x18')})['replace']('\x0d\x0a','');default:var _0x4a4921=getFirstInterface();var _0x50698a=getCPUhash();var _0x5d6f20=_0x50698a+'|'+os[_0xb677('0x19')]()+'|'+_0x4a4921['macAddress']+'|'+_0x4a4921[_0xb677('0x1a')];var _0x59e7e7=crypto['createHash'](_0xb677('0x1b'))[_0xb677('0x12')](_0x5d6f20)[_0xb677('0x13')](_0xb677('0x14'));return _0x59e7e7['substring'](0x0,0x8)+'-'+_0x59e7e7[_0xb677('0x1c')](0x8,0xc)+'-'+_0x59e7e7[_0xb677('0x1c')](0xc,0x10)+'-'+_0x59e7e7[_0xb677('0x1c')](0x10,0x14)+'-'+_0x59e7e7[_0xb677('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8c77275..e56f442 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 _0x4689=['YYYY-MM-DD\x20HH:mm','diff','days','error','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','message','default','util','crypto','moment','request-promise','bluebird','pkginfo','version','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','GET','then','aes-256-ctr','secrets','session','update','base64','createDecipher','utf8','User','findOne','admin','fullname','|reason|','|machineUuid|','|name|','|email|','openIssue','MOTLICENSE','Motion\x20License\x20Alert','email','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','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'];(function(_0x589f05,_0x1c5a16){var _0x3a11b4=function(_0x1ec7fb){while(--_0x1ec7fb){_0x589f05['push'](_0x589f05['shift']());}};_0x3a11b4(++_0x1c5a16);}(_0x4689,0x132));var _0x9468=function(_0x3093b1,_0x29b1f9){_0x3093b1=_0x3093b1-0x0;var _0x31e7ad=_0x4689[_0x3093b1];return _0x31e7ad;};'use strict';var util=require(_0x9468('0x0'));var crypto=require(_0x9468('0x1'));var moment=require(_0x9468('0x2'));var rp=require(_0x9468('0x3'));var BPromise=require(_0x9468('0x4'));var pkginfo=require(_0x9468('0x5'))(module,_0x9468('0x6'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require(_0x9468('0x7'));var logger=require(_0x9468('0x8'))(_0x9468('0x9'));var jira=require(_0x9468('0xa'));var HOST=_0x9468('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x11cd08){return new BPromise(function(_0x4befd,_0x4a67a2){var _0x2c1558=util['format'](_0x9468('0xc'),HOST,_0x11cd08,module['exports'][_0x9468('0x6')]);if(oldToken){_0x2c1558=util[_0x9468('0xd')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x11cd08,module['exports']['version'],oldToken);}var _0x23202a={'uri':_0x2c1558,'method':_0x9468('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x23202a)[_0x9468('0xf')](function(_0x2b8ba8){_0x4befd(_0x2b8ba8);})['catch'](function(_0x28253d){_0x4a67a2(_0x28253d);});});}function encryptDate(_0x54a0de){var _0xb7521c=crypto['createCipher'](_0x9468('0x10'),config[_0x9468('0x11')][_0x9468('0x12')]);var _0x2273fd=_0xb7521c[_0x9468('0x13')](_0x54a0de,'utf8',_0x9468('0x14'));_0x2273fd+=_0xb7521c['final'](_0x9468('0x14'));return _0x2273fd;}function decryptDate(_0x56bd38){var _0x49dce0=crypto[_0x9468('0x15')](_0x9468('0x10'),config[_0x9468('0x11')][_0x9468('0x12')]);var _0x415040=_0x49dce0['update'](_0x56bd38,_0x9468('0x14'),_0x9468('0x16'));_0x415040+=_0x49dce0['final'](_0x9468('0x16'));return _0x415040;}function sendJiraAlert(_0x2538cf,_0x146733,_0x3d3f38){var _0x292042='||FIELD||VALUE||\x0a';return db[_0x9468('0x17')][_0x9468('0x18')]({'where':{'role':_0x9468('0x19')},'attributes':[_0x9468('0x1a'),'email'],'raw':!![]})[_0x9468('0xf')](function(_0x4b5f4d){ADMIN=_0x4b5f4d;_0x292042+=_0x9468('0x1b')+_0x3d3f38+'|\x0a';_0x292042+='|uuid|'+_0x2538cf+'|\x0a';_0x292042+=_0x9468('0x1c')+_0x146733+'|\x0a';_0x292042+=_0x9468('0x1d')+ADMIN[_0x9468('0x1a')]+'|\x0a';_0x292042+=_0x9468('0x1e')+ADMIN['email']+'|\x0a';return _0x292042;})[_0x9468('0xf')](function(_0xa044a9){var _0x30b441=hardware['getFirstInterface']()['ipAddress'];return jira[_0x9468('0x1f')]({'key':_0x9468('0x20'),'summary':_0x9468('0x21'),'description':_0xa044a9,'issuetype':'Alert','oldToken':_0x2538cf,'newToken':_0x146733,'email':ADMIN[_0x9468('0x22')],'name':ADMIN[_0x9468('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x30b441});});}function manageLicense(_0x1267a5,_0x39bc86){var _0xe233c9=_0x39bc86['get']({'plain':!![]});httpRequest(_0x1267a5)[_0x9468('0xf')](function(_0x486558){if(oldToken){oldToken=undefined;}if(_0x486558[_0x9468('0x23')]){if(!_0xe233c9[_0x9468('0x9')]&&_0xe233c9[_0x9468('0x9')]!=_0x486558[_0x9468('0x9')]||_0xe233c9[_0x9468('0x9')]&&_0xe233c9[_0x9468('0x24')]){logger[_0x9468('0x25')](_0x9468('0x26'));}if(_0xe233c9['license']&&!_0xe233c9[_0x9468('0x24')]&&_0xe233c9[_0x9468('0x9')]!=_0x486558[_0x9468('0x9')]){logger[_0x9468('0x25')](_0x9468('0x27'));}if(_0xe233c9[_0x9468('0x9')]&&!_0xe233c9[_0x9468('0x24')]&&_0xe233c9['license']==_0x486558[_0x9468('0x9')]){return _0x39bc86;}return _0x39bc86[_0x9468('0x13')]({'data1':_0x1267a5,'data2':null,'license':_0x486558[_0x9468('0x9')]});}else{if(_0x486558['license']||_0xe233c9['license']){if(!_0xe233c9[_0x9468('0x24')]){if(_0xe233c9[_0x9468('0x28')]==_0x1267a5){GRAY_PERIOD_REASON=_0x9468('0x29');logger[_0x9468('0x25')](_0x9468('0x2a'));}else{GRAY_PERIOD_REASON=_0x9468('0x2b');oldToken=_0xe233c9[_0x9468('0x28')];logger[_0x9468('0x25')](_0x9468('0x2c'),_0xe233c9[_0x9468('0x28')],_0x1267a5);}sendJiraAlert(_0xe233c9[_0x9468('0x28')],_0x486558[_0x9468('0x2d')],GRAY_PERIOD_REASON);logger[_0x9468('0x25')](_0x9468('0x2e'),GRAY_PERIOD_REASON[_0x9468('0x2f')](),moment()[_0x9468('0xd')](_0x9468('0x30')));return _0x39bc86['update']({'data2':encryptDate(moment()['format'](_0x9468('0x30')))});}else{if(moment()[_0x9468('0x31')](decryptDate(_0xe233c9[_0x9468('0x24')]),_0x9468('0x32'))>DAYS){logger[_0x9468('0x25')]('DEMO\x20START\x20AT\x20%s',moment()[_0x9468('0xd')](_0x9468('0x30')));return _0x39bc86['update']({'data1':_0x1267a5,'data2':null,'license':null});}}}else{if(_0xe233c9[_0x9468('0x28')]!=_0x1267a5){logger[_0x9468('0x25')](_0x9468('0x2c'),_0xe233c9['data1'],_0x1267a5);return _0x39bc86['update']({'data1':_0x1267a5,'data2':null,'license':null});}}}return _0x39bc86;})[_0x9468('0xf')](function(_0x4def5a){_0x39bc86=_0x4def5a;})['catch'](function(_0x5c2260){logger[_0x9468('0x33')](_0x5c2260['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9468('0x34')](),_0x39bc86);},TIME);});}function defaultLicense(){var _0x228e97=hardware['getUuid']();if(_0x228e97){return db[_0x9468('0x35')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x228e97}})[_0x9468('0x36')](function(_0x2df606,_0x2bc950){logger[_0x9468('0x25')](_0x9468('0x37'),_0x228e97);manageLicense(_0x228e97,_0x2df606);})[_0x9468('0x38')](function(_0x1ae7b2){logger[_0x9468('0x33')](_0x1ae7b2[_0x9468('0x39')]);});}}exports[_0x9468('0x3a')]=defaultLicense; \ No newline at end of file +var _0x64e3=['final','createDecipher','aes-256-ctr','session','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|machineUuid|','|name|','|email|','ipAddress','Motion\x20License\x20Alert','Alert','get','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','data2','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','catch','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','pkginfo','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','createCipher','secrets','update','utf8','base64'];(function(_0x42ef15,_0x211959){var _0x4a4aad=function(_0x4585cf){while(--_0x4585cf){_0x42ef15['push'](_0x42ef15['shift']());}};_0x4a4aad(++_0x211959);}(_0x64e3,0x124));var _0x364e=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x64e3[_0x5280f4];return _0xba93e7;};'use strict';var util=require(_0x364e('0x0'));var crypto=require(_0x364e('0x1'));var moment=require(_0x364e('0x2'));var rp=require(_0x364e('0x3'));var BPromise=require('bluebird');var pkginfo=require(_0x364e('0x4'))(module,'version');var db=require(_0x364e('0x5'))['db'];var config=require(_0x364e('0x6'));var hardware=require(_0x364e('0x7'));var logger=require(_0x364e('0x8'))(_0x364e('0x9'));var jira=require(_0x364e('0xa'));var HOST=_0x364e('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x471dbb){return new BPromise(function(_0x1d4b92,_0x2831fe){var _0x5eeab3=util[_0x364e('0xc')](_0x364e('0xd'),HOST,_0x471dbb,module['exports'][_0x364e('0xe')]);if(oldToken){_0x5eeab3=util[_0x364e('0xc')](_0x364e('0xf'),HOST,_0x471dbb,module[_0x364e('0x10')]['version'],oldToken);}var _0x3d93db={'uri':_0x5eeab3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3d93db)[_0x364e('0x11')](function(_0x4e167d){_0x1d4b92(_0x4e167d);})['catch'](function(_0x59dd51){_0x2831fe(_0x59dd51);});});}function encryptDate(_0x533bbb){var _0x4e6df8=crypto[_0x364e('0x12')]('aes-256-ctr',config[_0x364e('0x13')]['session']);var _0xb53733=_0x4e6df8[_0x364e('0x14')](_0x533bbb,_0x364e('0x15'),_0x364e('0x16'));_0xb53733+=_0x4e6df8[_0x364e('0x17')]('base64');return _0xb53733;}function decryptDate(_0x2ba973){var _0x4e04b4=crypto[_0x364e('0x18')](_0x364e('0x19'),config[_0x364e('0x13')][_0x364e('0x1a')]);var _0x239581=_0x4e04b4['update'](_0x2ba973,'base64',_0x364e('0x15'));_0x239581+=_0x4e04b4[_0x364e('0x17')](_0x364e('0x15'));return _0x239581;}function sendJiraAlert(_0xd84cd1,_0xaba53,_0x282cca){var _0x3342c0=_0x364e('0x1b');return db[_0x364e('0x1c')][_0x364e('0x1d')]({'where':{'role':_0x364e('0x1e')},'attributes':[_0x364e('0x1f'),_0x364e('0x20')],'raw':!![]})[_0x364e('0x11')](function(_0x2532b4){ADMIN=_0x2532b4;_0x3342c0+=_0x364e('0x21')+_0x282cca+'|\x0a';_0x3342c0+='|uuid|'+_0xd84cd1+'|\x0a';_0x3342c0+=_0x364e('0x22')+_0xaba53+'|\x0a';_0x3342c0+=_0x364e('0x23')+ADMIN[_0x364e('0x1f')]+'|\x0a';_0x3342c0+=_0x364e('0x24')+ADMIN[_0x364e('0x20')]+'|\x0a';return _0x3342c0;})[_0x364e('0x11')](function(_0x3c4790){var _0x3ee937=hardware['getFirstInterface']()[_0x364e('0x25')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0x364e('0x26'),'description':_0x3c4790,'issuetype':_0x364e('0x27'),'oldToken':_0xd84cd1,'newToken':_0xaba53,'email':ADMIN['email'],'name':ADMIN[_0x364e('0x1f')],'reason':GRAY_PERIOD_REASON,'ip':_0x3ee937});});}function manageLicense(_0x5066da,_0x4d4d06){var _0x15085d=_0x4d4d06[_0x364e('0x28')]({'plain':!![]});httpRequest(_0x5066da)['then'](function(_0x534375){if(oldToken){oldToken=undefined;}if(_0x534375[_0x364e('0x29')]){if(!_0x15085d['license']&&_0x15085d[_0x364e('0x9')]!=_0x534375[_0x364e('0x9')]||_0x15085d[_0x364e('0x9')]&&_0x15085d['data2']){logger['info'](_0x364e('0x2a'));}if(_0x15085d['license']&&!_0x15085d['data2']&&_0x15085d[_0x364e('0x9')]!=_0x534375[_0x364e('0x9')]){logger[_0x364e('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x15085d[_0x364e('0x9')]&&!_0x15085d[_0x364e('0x2c')]&&_0x15085d[_0x364e('0x9')]==_0x534375[_0x364e('0x9')]){return _0x4d4d06;}return _0x4d4d06[_0x364e('0x14')]({'data1':_0x5066da,'data2':null,'license':_0x534375[_0x364e('0x9')]});}else{if(_0x534375['license']||_0x15085d['license']){if(!_0x15085d[_0x364e('0x2c')]){if(_0x15085d[_0x364e('0x2d')]==_0x5066da){GRAY_PERIOD_REASON=_0x364e('0x2e');logger[_0x364e('0x2b')](_0x364e('0x2f'));}else{GRAY_PERIOD_REASON=_0x364e('0x30');oldToken=_0x15085d['data1'];logger[_0x364e('0x2b')](_0x364e('0x31'),_0x15085d[_0x364e('0x2d')],_0x5066da);}sendJiraAlert(_0x15085d[_0x364e('0x2d')],_0x534375['uuid'],GRAY_PERIOD_REASON);logger[_0x364e('0x2b')](_0x364e('0x32'),GRAY_PERIOD_REASON[_0x364e('0x33')](),moment()[_0x364e('0xc')](_0x364e('0x34')));return _0x4d4d06[_0x364e('0x14')]({'data2':encryptDate(moment()['format'](_0x364e('0x34')))});}else{if(moment()['diff'](decryptDate(_0x15085d[_0x364e('0x2c')]),_0x364e('0x35'))>DAYS){logger['info'](_0x364e('0x36'),moment()['format'](_0x364e('0x34')));return _0x4d4d06[_0x364e('0x14')]({'data1':_0x5066da,'data2':null,'license':null});}}}else{if(_0x15085d['data1']!=_0x5066da){logger[_0x364e('0x2b')](_0x364e('0x31'),_0x15085d[_0x364e('0x2d')],_0x5066da);return _0x4d4d06[_0x364e('0x14')]({'data1':_0x5066da,'data2':null,'license':null});}}}return _0x4d4d06;})[_0x364e('0x11')](function(_0x230e4a){_0x4d4d06=_0x230e4a;})[_0x364e('0x37')](function(_0x4404ef){logger[_0x364e('0x38')](_0x4404ef[_0x364e('0x39')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x364e('0x3a')](),_0x4d4d06);},TIME);});}function defaultLicense(){var _0x3d2595=hardware[_0x364e('0x3a')]();if(_0x3d2595){return db['License'][_0x364e('0x3b')]({'where':{'id':0x1},'defaults':{'data1':_0x3d2595}})[_0x364e('0x3c')](function(_0x1a3d04,_0x5c851a){logger[_0x364e('0x2b')](_0x364e('0x3d'),_0x3d2595);manageLicense(_0x3d2595,_0x1a3d04);})['catch'](function(_0x43b0f8){logger[_0x364e('0x38')](_0x43b0f8[_0x364e('0x39')]);});}}exports[_0x364e('0x3e')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 336d993..39eef3a 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 _0xa2d1=['license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','uuid','machineUuid','session','gray','deadline','add','days','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getUuid','getLicense','find','defaults','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb'];(function(_0x4d6bae,_0x1bc596){var _0x70b4b8=function(_0x4fd8d3){while(--_0x4fd8d3){_0x4d6bae['push'](_0x4d6bae['shift']());}};_0x70b4b8(++_0x1bc596);}(_0xa2d1,0x1e7));var _0x1a2d=function(_0x48b88f,_0x2e1e94){_0x48b88f=_0x48b88f-0x0;var _0x34d441=_0xa2d1[_0x48b88f];return _0x34d441;};'use strict';var crypto=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var _=require(_0x1a2d('0x2'));var moment=require(_0x1a2d('0x3'));var hardware=require(_0x1a2d('0x4'));var config=require(_0x1a2d('0x5'));var db=require(_0x1a2d('0x6'))['db'];function checkLicense(_0x48b5d6,_0x475379){if(_0x48b5d6){try{var _0x3451ee=_0x475379||_0x48b5d6[_0x1a2d('0x7')];if(_[_0x1a2d('0x8')](_0x3451ee)){throw new Error(_0x1a2d('0x9'));}var _0x394d71=_0x48b5d6[_0x1a2d('0xa')];var _0x30a105=_0x48b5d6['data2'];var _0x4f7f43=_0x394d71[_0x1a2d('0xb')]('-')[0x4];var _0x4411c4=_0x394d71[_0x1a2d('0xb')]('-')[0x0];var _0x36b39e=crypto[_0x1a2d('0xc')](_0x1a2d('0xd'),util[_0x1a2d('0xe')]('%s:%s:%s',_0x4f7f43,_0x394d71,_0x4411c4));var _0x2a3e25=_0x36b39e[_0x1a2d('0xf')](_0x3451ee,_0x1a2d('0x10'),_0x1a2d('0x11'));_0x2a3e25+=_0x36b39e[_0x1a2d('0x12')](_0x1a2d('0x11'));var _0x220c7b=JSON[_0x1a2d('0x13')](_0x2a3e25);_0x220c7b['demo']=![];_0x220c7b[_0x1a2d('0x14')]=_0x394d71;_0x220c7b[_0x1a2d('0x15')]=hardware['getUuid']();if(_0x30a105){var _0x349dae=crypto['createDecipher'](_0x1a2d('0xd'),config['secrets'][_0x1a2d('0x16')]);var _0x57458b=_0x349dae['update'](_0x30a105,_0x1a2d('0x10'),_0x1a2d('0x11'));_0x57458b+=_0x349dae[_0x1a2d('0x12')](_0x1a2d('0x11'));_0x220c7b[_0x1a2d('0x17')]=_0x57458b;_0x220c7b[_0x1a2d('0x18')]=moment(_0x57458b)[_0x1a2d('0x19')](0x7,_0x1a2d('0x1a'))[_0x1a2d('0xe')]();_0x220c7b['grayReason']=_0x220c7b[_0x1a2d('0x14')]!=_0x220c7b['machineUuid']?_0x1a2d('0x1b'):_0x1a2d('0x1c');}return _0x220c7b;}catch(_0x49ad47){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1a2d('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1a2d('0x1e'),'uuid':_0x48b5d6[_0x1a2d('0xa')],'machineUuid':hardware['getUuid'](),'message':_0x49ad47[_0x1a2d('0x1f')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1a2d('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1a2d('0x20'),'uuid':_0x48b5d6[_0x1a2d('0xa')],'machineUuid':hardware[_0x1a2d('0x21')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0x1a2d('0x22')]=function(_0x37724f){return db['License'][_0x1a2d('0x23')](_[_0x1a2d('0x24')](_0x37724f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x8ceac5){return checkLicense(_0x8ceac5,null);});};exports[_0x1a2d('0x25')]=checkLicense; \ No newline at end of file +var _0xf471=['moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','createDecipher','aes-256-ctr','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','update','add','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','License','find','defaults','then','checkLicense','crypto','util'];(function(_0x2dcf8b,_0x477184){var _0x287c68=function(_0x5f1689){while(--_0x5f1689){_0x2dcf8b['push'](_0x2dcf8b['shift']());}};_0x287c68(++_0x477184);}(_0xf471,0x1df));var _0x1f47=function(_0x4db844,_0x222aba){_0x4db844=_0x4db844-0x0;var _0x48d9d2=_0xf471[_0x4db844];return _0x48d9d2;};'use strict';var crypto=require(_0x1f47('0x0'));var util=require(_0x1f47('0x1'));var _=require('lodash');var moment=require(_0x1f47('0x2'));var hardware=require(_0x1f47('0x3'));var config=require(_0x1f47('0x4'));var db=require(_0x1f47('0x5'))['db'];function checkLicense(_0x3283b0,_0x4f3168){if(_0x3283b0){try{var _0x1c7536=_0x4f3168||_0x3283b0[_0x1f47('0x6')];if(_[_0x1f47('0x7')](_0x1c7536)){throw new Error(_0x1f47('0x8'));}var _0x5e429a=_0x3283b0[_0x1f47('0x9')];var _0x21e681=_0x3283b0[_0x1f47('0xa')];var _0x3f6319=_0x5e429a['split']('-')[0x4];var _0xb84d3f=_0x5e429a['split']('-')[0x0];var _0x46e1b7=crypto[_0x1f47('0xb')](_0x1f47('0xc'),util['format']('%s:%s:%s',_0x3f6319,_0x5e429a,_0xb84d3f));var _0xae32f1=_0x46e1b7['update'](_0x1c7536,_0x1f47('0xd'),_0x1f47('0xe'));_0xae32f1+=_0x46e1b7[_0x1f47('0xf')](_0x1f47('0xe'));var _0x3e9f2d=JSON[_0x1f47('0x10')](_0xae32f1);_0x3e9f2d[_0x1f47('0x11')]=![];_0x3e9f2d[_0x1f47('0x12')]=_0x5e429a;_0x3e9f2d[_0x1f47('0x13')]=hardware[_0x1f47('0x14')]();if(_0x21e681){var _0x60d943=crypto['createDecipher'](_0x1f47('0xc'),config[_0x1f47('0x15')][_0x1f47('0x16')]);var _0x2b1d08=_0x60d943[_0x1f47('0x17')](_0x21e681,_0x1f47('0xd'),_0x1f47('0xe'));_0x2b1d08+=_0x60d943['final'](_0x1f47('0xe'));_0x3e9f2d['gray']=_0x2b1d08;_0x3e9f2d['deadline']=moment(_0x2b1d08)[_0x1f47('0x18')](0x7,'days')['format']();_0x3e9f2d[_0x1f47('0x19')]=_0x3e9f2d[_0x1f47('0x12')]!=_0x3e9f2d[_0x1f47('0x13')]?'changed':_0x1f47('0x1a');}return _0x3e9f2d;}catch(_0x142cad){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1f47('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1f47('0x1c'),'uuid':_0x3283b0[_0x1f47('0x9')],'machineUuid':hardware['getUuid'](),'message':_0x142cad[_0x1f47('0x1d')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1f47('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1f47('0x1e'),'uuid':_0x3283b0[_0x1f47('0x9')],'machineUuid':hardware[_0x1f47('0x14')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0x1f47('0x1f')]=function(_0x28ff0c){return db[_0x1f47('0x20')][_0x1f47('0x21')](_[_0x1f47('0x22')](_0x28ff0c,{'raw':!![],'where':{'id':0x1}}))[_0x1f47('0x23')](function(_0x47ef00){return checkLicense(_0x47ef00,null);});};exports[_0x1f47('0x24')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index a7993c2..27fd409 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 _0x1306=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x1306,0x17a));var _0x6130=function(_0x3d0c55,_0x376a70){_0x3d0c55=_0x3d0c55-0x0;var _0x46c6f6=_0x1306[_0x3d0c55];return _0x46c6f6;};'use strict';module[_0x6130('0x0')]={'DOMAIN':_0x6130('0x1'),'SESSION_SECRET':_0x6130('0x2'),'GOOGLE_ID':_0x6130('0x3'),'GOOGLE_SECRET':_0x6130('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xab5b=['app-id','secret','exports','http://localhost:9000'];(function(_0x326655,_0x56bbe0){var _0x556242=function(_0x5e045c){while(--_0x5e045c){_0x326655['push'](_0x326655['shift']());}};_0x556242(++_0x56bbe0);}(_0xab5b,0x11a));var _0xbab5=function(_0x5054dd,_0x584f74){_0x5054dd=_0x5054dd-0x0;var _0x5b297b=_0xab5b[_0x5054dd];return _0x5b297b;};'use strict';module[_0xbab5('0x0')]={'DOMAIN':_0xbab5('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xbab5('0x2'),'GOOGLE_SECRET':_0xbab5('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 7771da1..f2cba0e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6cd=['File','%s-%s','error','transports','info','Console','env','debugLevel','moment','winston','util','INFO','/var','log','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0xc6cd,0xfa));var _0xdc6c=function(_0x5059b7,_0x20a46e){_0x5059b7=_0x5059b7-0x0;var _0x4864e8=_0xc6cd[_0x5059b7];return _0x4864e8;};'use strict';var moment=require(_0xdc6c('0x0'));var winston=require(_0xdc6c('0x1'));var util=require(_0xdc6c('0x2'));var path=require('path');var debugLevel=_0xdc6c('0x3');function filename(_0x2d21de,_0x41179e){return path['join'](_0xdc6c('0x4'),_0xdc6c('0x5'),'xcally',util['format'](_0xdc6c('0x6'),_0x2d21de,_0x41179e));}function formatter(_0x22403d,_0x670d15){return util['format'](_0xdc6c('0x7'),moment()[_0xdc6c('0x8')](_0xdc6c('0x9')),_0x670d15[_0xdc6c('0xa')][_0xdc6c('0xb')](),_0x22403d,_0x670d15[_0xdc6c('0xc')]);}module[_0xdc6c('0xd')]=function(_0xd9b65a){return new winston['Logger']({'transports':[new winston['transports'][(_0xdc6c('0xe'))]({'name':util[_0xdc6c('0x8')](_0xdc6c('0xf'),_0xd9b65a,_0xdc6c('0x10')),'filename':filename(_0xd9b65a,_0xdc6c('0x10')),'level':_0xdc6c('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5126aa){return formatter(_0xd9b65a,_0x5126aa);}}),new winston[(_0xdc6c('0x11'))][(_0xdc6c('0xe'))]({'name':util[_0xdc6c('0x8')](_0xdc6c('0xf'),_0xd9b65a,_0xdc6c('0x12')),'filename':filename(_0xd9b65a,_0xdc6c('0x12')),'level':_0xdc6c('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x534fc4){return formatter(_0xd9b65a,_0x534fc4);}}),new winston[(_0xdc6c('0x11'))][(_0xdc6c('0x13'))]({'level':process[_0xdc6c('0x14')][_0xdc6c('0x15')]||debugLevel,'json':![],'formatter':function(_0xb98b20){return formatter(_0xd9b65a,_0xb98b20);}})]});}; \ No newline at end of file +var _0x8509=['%s-%s.log','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','%s-%s','error','File','info','Console','env','moment','winston','util','path','join','/var','log','xcally'];(function(_0x48606c,_0x443c83){var _0x59711e=function(_0x4acb72){while(--_0x4acb72){_0x48606c['push'](_0x48606c['shift']());}};_0x59711e(++_0x443c83);}(_0x8509,0x123));var _0x9850=function(_0x1f7420,_0x46922d){_0x1f7420=_0x1f7420-0x0;var _0x5574ac=_0x8509[_0x1f7420];return _0x5574ac;};'use strict';var moment=require(_0x9850('0x0'));var winston=require(_0x9850('0x1'));var util=require(_0x9850('0x2'));var path=require(_0x9850('0x3'));var debugLevel='INFO';function filename(_0x3d7d44,_0x123c67){return path[_0x9850('0x4')](_0x9850('0x5'),_0x9850('0x6'),_0x9850('0x7'),util['format'](_0x9850('0x8'),_0x3d7d44,_0x123c67));}function formatter(_0x51946e,_0x10e674){return util[_0x9850('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x9850('0x9')](_0x9850('0xa')),_0x10e674[_0x9850('0xb')][_0x9850('0xc')](),_0x51946e,_0x10e674[_0x9850('0xd')]);}module[_0x9850('0xe')]=function(_0x485e14){return new winston[(_0x9850('0xf'))]({'transports':[new winston[(_0x9850('0x10'))]['File']({'name':util['format'](_0x9850('0x11'),_0x485e14,'error'),'filename':filename(_0x485e14,_0x9850('0x12')),'level':_0x9850('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41d8f0){return formatter(_0x485e14,_0x41d8f0);}}),new winston[(_0x9850('0x10'))][(_0x9850('0x13'))]({'name':util[_0x9850('0x9')](_0x9850('0x11'),_0x485e14,'info'),'filename':filename(_0x485e14,_0x9850('0x14')),'level':_0x9850('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfe5dda){return formatter(_0x485e14,_0xfe5dda);}}),new winston[(_0x9850('0x10'))][(_0x9850('0x15'))]({'level':process[_0x9850('0x16')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4d2fae){return formatter(_0x485e14,_0x4d2fae);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index ebfedf3..3f1699a 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 _0x589e=['agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0xd5f40c,_0x17259d){var _0x3bcf09=function(_0x2e0977){while(--_0x2e0977){_0xd5f40c['push'](_0xd5f40c['shift']());}};_0x3bcf09(++_0x17259d);}(_0x589e,0x127));var _0xe589=function(_0x3d1f3e,_0x1391e5){_0x3d1f3e=_0x3d1f3e-0x0;var _0x17ee42=_0x589e[_0x3d1f3e];return _0x17ee42;};'use strict';var path=require(_0xe589('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xe589('0x1')](__dirname,_0xe589('0x2'))},{'name':_0xe589('0x3'),'script':path['join'](__dirname,_0xe589('0x4'))},{'name':_0xe589('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xe589('0x6'),'script':path[_0xe589('0x1')](__dirname,_0xe589('0x7'))},{'name':_0xe589('0x8'),'script':path[_0xe589('0x1')](__dirname,_0xe589('0x9'))},{'name':_0xe589('0xa'),'script':path[_0xe589('0x1')](__dirname,_0xe589('0xb'))}]};module['exports']=config; \ No newline at end of file +var _0xb4b8=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x2cdc49,_0x51d22f){var _0x50bc67=function(_0xcc1b40){while(--_0xcc1b40){_0x2cdc49['push'](_0x2cdc49['shift']());}};_0x50bc67(++_0x51d22f);}(_0xb4b8,0x1bb));var _0x8b4b=function(_0x2fa93a,_0x18a058){_0x2fa93a=_0x2fa93a-0x0;var _0x40e4d7=_0xb4b8[_0x2fa93a];return _0x40e4d7;};'use strict';var path=require(_0x8b4b('0x0'));var os=require('os');var config={'apps':[{'name':_0x8b4b('0x1'),'script':path[_0x8b4b('0x2')](__dirname,_0x8b4b('0x3'))},{'name':_0x8b4b('0x4'),'script':path[_0x8b4b('0x2')](__dirname,_0x8b4b('0x5'))},{'name':'agi','script':path[_0x8b4b('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x8b4b('0x6'),'script':path[_0x8b4b('0x2')](__dirname,_0x8b4b('0x7'))},{'name':'routing','script':path['join'](__dirname,_0x8b4b('0x8'))},{'name':_0x8b4b('0x9'),'script':path['join'](__dirname,_0x8b4b('0xa'))}]};module[_0x8b4b('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index cad6648..5a9a3cd 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 _0x9957=['stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pm2=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var config=require(_0x7995('0x2'));function connect(){return new BPromise(function(_0x10a05d,_0x5b96eb){return pm2[_0x7995('0x3')](function(_0x3c58eb){if(_0x3c58eb){return _0x5b96eb(_0x3c58eb);}return _0x10a05d(_0x7995('0x4'));});});};exports[_0x7995('0x5')]=function(_0x576d89){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1a36d8,_0x137b6b){return pm2[_0x7995('0x5')](_0x576d89,function(_0xbda126,_0x326741){if(_0xbda126){return _0x137b6b(_0xbda126);}pm2['disconnect']();return _0x1a36d8(_0x326741);});});});};exports[_0x7995('0x7')]=function(_0x1cad37){return connect()['then'](function(){return new BPromise(function(_0xa2e5f0,_0x3116fb){return pm2[_0x7995('0x7')](_0x1cad37,function(_0x35b5fe,_0x3c1d19){if(_0x35b5fe){return _0x3116fb(_0x35b5fe);}pm2[_0x7995('0x8')]();return _0xa2e5f0(_0x3c1d19);});});});};exports[_0x7995('0x9')]=function(_0x524f7b){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x41c652,_0x581f22){return pm2[_0x7995('0x9')](_0x524f7b,function(_0x2cb37a,_0x19a27e){if(_0x2cb37a){return _0x581f22(_0x2cb37a);}pm2[_0x7995('0x8')]();return _0x41c652(_0x19a27e);});});});};exports[_0x7995('0xa')]=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2bbe7a,_0x4cc004){return pm2['list'](function(_0x2b4e94,_0x2233dd){if(_0x2b4e94){return _0x4cc004(_0x2b4e94);}pm2[_0x7995('0x8')]();return _0x2bbe7a(_0x2233dd);});});});};exports[_0x7995('0xb')]=function(_0x3f1d3e){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2202ce,_0x41cbf0){return pm2['describe'](_0x3f1d3e,function(_0x2eeacc,_0x565d97){if(_0x2eeacc){return _0x41cbf0(_0x2eeacc);}pm2[_0x7995('0x8')]();return _0x2202ce(_0x565d97);});});});};exports[_0x7995('0xc')]=function(_0x43d4b8){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1e1415,_0x37a7d4){return pm2['delete'](_0x43d4b8,function(_0x54c9ae,_0x2536c8){if(_0x54c9ae){return _0x37a7d4(_0x54c9ae);}pm2['disconnect']();return _0x1e1415(_0x2536c8);});});});};exports['dump']=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x3d463e,_0x4cbe10){return pm2[_0x7995('0xd')](function(_0x51f276){if(_0x51f276){return _0x4cbe10(_0x51f276);}return _0x3d463e('saved');});});});}; \ No newline at end of file +var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x552132,_0x18ef9e){var _0xcd7b4d=function(_0x3b62c0){while(--_0x3b62c0){_0x552132['push'](_0x552132['shift']());}};_0xcd7b4d(++_0x18ef9e);}(_0xedd9,0xfc));var _0x9edd=function(_0x47708d,_0x4313c8){_0x47708d=_0x47708d-0x0;var _0x5b2c78=_0xedd9[_0x47708d];return _0x5b2c78;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/automaticRenewSubscription.js b/server/config/schedule/automaticRenewSubscription.js index e6af7c9..6694893 100644 --- a/server/config/schedule/automaticRenewSubscription.js +++ b/server/config/schedule/automaticRenewSubscription.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x590a=['chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','then','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','catch','startSubscription','lodash','ioredis','../../mysqldb','../../config/environment','find'];(function(_0x3c1c37,_0x2a1019){var _0x4ca8b6=function(_0x21014e){while(--_0x21014e){_0x3c1c37['push'](_0x3c1c37['shift']());}};_0x4ca8b6(++_0x2a1019);}(_0x590a,0x1db));var _0xa590=function(_0x232254,_0x203f6a){_0x232254=_0x232254-0x0;var _0xffcf9c=_0x590a[_0x232254];return _0xffcf9c;};'use strict';var _=require(_0xa590('0x0'));var moment=require('moment');var Redis=require(_0xa590('0x1'));var db=require(_0xa590('0x2'))['db'];var config=require(_0xa590('0x3'));function subscriptionsAutomatic(){var _0x10f3d9=0x0;var _0x344da2=[];return db['Setting'][_0xa590('0x4')]({'raw':!![],'attributes':['id',_0xa590('0x5')],'where':{'id':0x1}})['then'](function(_0x2815e0){_0x10f3d9=_0x2815e0[_0xa590('0x5')];if(_0x10f3d9){return db[_0xa590('0x6')]['findAll']({'raw':!![],'attributes':['id',_0xa590('0x7')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa590('0x8')](_0x2815e0[_0xa590('0x5')],_0xa590('0x9'))}}});}else{return[];}})[_0xa590('0xa')](function(_0x4cdda4){_0x344da2=_0x4cdda4;if(_0x10f3d9){return db[_0xa590('0x6')]['update']({'closeReason':_0xa590('0xb'),'disposition':_0xa590('0xc'),'closed':!![],'closedAt':moment()[_0xa590('0xd')](_0xa590('0xe'))},{'where':{'id':_[_0xa590('0xf')](_0x344da2||[],'id')}});}})['then'](function(_0x45f817){for(var _0x214ed0=0x0;_0x214ed0<_0x344da2[_0xa590('0x10')];_0x214ed0++){io['emit'](_0xa590('0x11'),{'id':_0x344da2[_0x214ed0]['id'],'closed':!![]});}})[_0xa590('0x12')](function(_0x2c0b9c){console['error'](_0x2c0b9c);});}exports[_0xa590('0x13')]=function(){setInterval(function(){return subscriptionsAutomatic();},0x3c*0x3e8);return subscriptionsAutomatic();}; \ No newline at end of file +var _0x50e9=['Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','update','timeout','map','length','emit','chatInteraction:update','catch','error','startSubscription','moment','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x50e9,0xe2));var _0x950e=function(_0x1ad369,_0x29df9e){_0x1ad369=_0x1ad369-0x0;var _0x131b20=_0x50e9[_0x1ad369];return _0x131b20;};'use strict';var _=require('lodash');var moment=require(_0x950e('0x0'));var Redis=require('ioredis');var db=require(_0x950e('0x1'))['db'];var config=require('../../config/environment');function subscriptionsAutomatic(){var _0x441b49=0x0;var _0x2d29f5=[];return db[_0x950e('0x2')][_0x950e('0x3')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x950e('0x4')](function(_0x24ea9f){_0x441b49=_0x24ea9f[_0x950e('0x5')];if(_0x441b49){return db[_0x950e('0x6')]['findAll']({'raw':!![],'attributes':['id',_0x950e('0x7')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x950e('0x8')](_0x24ea9f['chatTimeout'],_0x950e('0x9'))}}});}else{return[];}})[_0x950e('0x4')](function(_0x266c37){_0x2d29f5=_0x266c37;if(_0x441b49){return db['ChatInteraction'][_0x950e('0xa')]({'closeReason':'system','disposition':_0x950e('0xb'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x950e('0xc')](_0x2d29f5||[],'id')}});}})['then'](function(_0x54d1d5){for(var _0x138baf=0x0;_0x138baf<_0x2d29f5[_0x950e('0xd')];_0x138baf++){io[_0x950e('0xe')](_0x950e('0xf'),{'id':_0x2d29f5[_0x138baf]['id'],'closed':!![]});}})[_0x950e('0x10')](function(_0x5512a7){console[_0x950e('0x11')](_0x5512a7);});}exports[_0x950e('0x12')]=function(){setInterval(function(){return subscriptionsAutomatic();},0x3c*0x3e8);return subscriptionsAutomatic();}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index cb7de24..92b3823 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 _0xb377=['length','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','then'];(function(_0x4115bf,_0x55702a){var _0x300ee1=function(_0x7b4a82){while(--_0x7b4a82){_0x4115bf['push'](_0x4115bf['shift']());}};_0x300ee1(++_0x55702a);}(_0xb377,0x1b6));var _0x7b37=function(_0x5a7e95,_0x5b7cd6){_0x5a7e95=_0x5a7e95-0x0;var _0x2b9200=_0xb377[_0x5a7e95];return _0x2b9200;};'use strict';var _=require(_0x7b37('0x0'));var moment=require(_0x7b37('0x1'));var Redis=require(_0x7b37('0x2'));var db=require(_0x7b37('0x3'))['db'];var config=require(_0x7b37('0x4'));config[_0x7b37('0x5')]=_[_0x7b37('0x6')](config[_0x7b37('0x5')],{'host':_0x7b37('0x7'),'port':0x18eb});var io=require(_0x7b37('0x8'))(new Redis(config[_0x7b37('0x5')]));function closeInteractions(){var _0x38d1b4=0x0;var _0x58edf9=[];return db['Setting'][_0x7b37('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x3de992){_0x38d1b4=_0x3de992[_0x7b37('0xa')];if(_0x38d1b4){return db[_0x7b37('0xb')][_0x7b37('0xc')]({'raw':!![],'attributes':['id',_0x7b37('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7b37('0xe')](_0x3de992[_0x7b37('0xa')],_0x7b37('0xf'))}}});}else{return[];}})['then'](function(_0x22e0a9){_0x58edf9=_0x22e0a9;if(_0x38d1b4){return db[_0x7b37('0xb')]['update']({'closeReason':'system','disposition':_0x7b37('0x10'),'closed':!![],'closedAt':moment()[_0x7b37('0x11')](_0x7b37('0x12'))},{'where':{'id':_[_0x7b37('0x13')](_0x58edf9||[],'id')}});}})[_0x7b37('0x14')](function(_0x1edd5a){for(var _0x28dd9c=0x0;_0x28dd9c<_0x58edf9[_0x7b37('0x15')];_0x28dd9c++){io[_0x7b37('0x16')](_0x7b37('0x17'),{'id':_0x58edf9[_0x28dd9c]['id'],'closed':!![]});}})[_0x7b37('0x18')](function(_0x19ce67){console[_0x7b37('0x19')](_0x19ce67);});}exports[_0x7b37('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfc45=['length','emit','chatInteraction:update','catch','error','start','lodash','../../config/environment','redis','localhost','socket.io-emitter','find','then','chatTimeout','findAll','lastMsgAt','minutes','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map'];(function(_0x4b3897,_0x47befe){var _0x14e2aa=function(_0x268afd){while(--_0x268afd){_0x4b3897['push'](_0x4b3897['shift']());}};_0x14e2aa(++_0x47befe);}(_0xfc45,0x7e));var _0x5fc4=function(_0x3bc450,_0x3f4f9e){_0x3bc450=_0x3bc450-0x0;var _0x2a1497=_0xfc45[_0x3bc450];return _0x2a1497;};'use strict';var _=require(_0x5fc4('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x5fc4('0x1'));config[_0x5fc4('0x2')]=_['defaults'](config[_0x5fc4('0x2')],{'host':_0x5fc4('0x3'),'port':0x18eb});var io=require(_0x5fc4('0x4'))(new Redis(config[_0x5fc4('0x2')]));function closeInteractions(){var _0x42e73b=0x0;var _0x57e189=[];return db['Setting'][_0x5fc4('0x5')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x5fc4('0x6')](function(_0x4c7b64){_0x42e73b=_0x4c7b64[_0x5fc4('0x7')];if(_0x42e73b){return db['ChatInteraction'][_0x5fc4('0x8')]({'raw':!![],'attributes':['id',_0x5fc4('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4c7b64[_0x5fc4('0x7')],_0x5fc4('0xa'))}}});}else{return[];}})[_0x5fc4('0x6')](function(_0x2f0c1f){_0x57e189=_0x2f0c1f;if(_0x42e73b){return db[_0x5fc4('0xb')][_0x5fc4('0xc')]({'closeReason':_0x5fc4('0xd'),'disposition':_0x5fc4('0xe'),'closed':!![],'closedAt':moment()[_0x5fc4('0xf')](_0x5fc4('0x10'))},{'where':{'id':_[_0x5fc4('0x11')](_0x57e189||[],'id')}});}})[_0x5fc4('0x6')](function(_0x50d2be){for(var _0x558ac0=0x0;_0x558ac0<_0x57e189[_0x5fc4('0x12')];_0x558ac0++){io[_0x5fc4('0x13')](_0x5fc4('0x14'),{'id':_0x57e189[_0x558ac0]['id'],'closed':!![]});}})[_0x5fc4('0x15')](function(_0x1b4c77){console[_0x5fc4('0x16')](_0x1b4c77);});}exports[_0x5fc4('0x17')]=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 c41aa81..0df96e7 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 _0x9367=['deleteJob','delete\x20cron','length','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','active','update\x20cron','util','path','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','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','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','keys','jobs','toString','keyBy','intersection','exists','stop'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9367,0x167));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x7936('0x0'));var path=require(_0x7936('0x1'));var _=require(_0x7936('0x2'));var moment=require(_0x7936('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x7936('0x4'));var BPromise=require('bluebird');var logger=require(_0x7936('0x5'))(_0x7936('0x6'));var db=require(_0x7936('0x7'))['db'];var analyticCustomReportController=require(_0x7936('0x8'));var analyticDefaultReportController=require(_0x7936('0x9'));var client=jayson[_0x7936('0xa')][_0x7936('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1ccd31,_0x5e1027){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x1ccd31['email']);var _0x3c9970=!![];var _0x4c35f3={'tls':{'rejectUnauthorized':![]}};if(_0x1ccd31['MailAccount'][_0x7936('0xc')][_0x7936('0xd')]){_0x4c35f3['service']=_0x1ccd31[_0x7936('0xe')][_0x7936('0xc')][_0x7936('0xd')];}else{_0x4c35f3[_0x7936('0xf')]=_0x1ccd31[_0x7936('0xe')][_0x7936('0xc')][_0x7936('0xf')];_0x4c35f3[_0x7936('0x10')]=_0x1ccd31['MailAccount'][_0x7936('0xc')][_0x7936('0x10')];_0x4c35f3[_0x7936('0x11')]=_0x1ccd31['MailAccount'][_0x7936('0xc')][_0x7936('0x11')];}if(_0x1ccd31['MailAccount']['Smtp'][_0x7936('0x12')]){_0x4c35f3[_0x7936('0x13')]={'user':_0x1ccd31['MailAccount']['Smtp'][_0x7936('0x14')],'pass':_0x1ccd31[_0x7936('0xe')][_0x7936('0xc')][_0x7936('0x15')]};}var _0x17c671={'account':_0x4c35f3,'message':{'from':util[_0x7936('0x16')](_0x7936('0x17'),_0x1ccd31['MailAccount'][_0x7936('0x18')],_0x1ccd31[_0x7936('0xe')][_0x7936('0x19')]||_0x1ccd31['MailAccount']['Smtp'][_0x7936('0x14')]),'to':_0x1ccd31[_0x7936('0x19')],'cc':_0x1ccd31['cc'],'bcc':_0x1ccd31[_0x7936('0x1a')],'subject':util[_0x7936('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x5e1027[_0x7936('0x18')],_0x1ccd31[_0x7936('0x1b')],_0x1ccd31[_0x7936('0x1c')])}};var _0x125032=path[_0x7936('0x1d')](__dirname,_0x7936('0x1e'));var _0x154778=_0x5e1027[_0x7936('0x1f')];var _0x586f05=util['format']('%s.%s',path[_0x7936('0x20')](_0x5e1027[_0x7936('0x1f')],path[_0x7936('0x21')](_0x5e1027[_0x7936('0x1f')])),_0x7936('0x22'));var _0x3232c6=path[_0x7936('0x1d')](_0x125032,_0x154778);var _0x1cbd9b=path['join'](_0x125032,_0x586f05);if(fs[_0x7936('0x23')](_0x3232c6)){_0x5e1027[_0x7936('0x24')]=_0x7936('0x25');_0x17c671[_0x7936('0x26')][_0x7936('0x27')]=[{'filename':_0x154778,'path':_0x3232c6}];_0x17c671[_0x7936('0x26')][_0x7936('0x28')]=util[_0x7936('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x7936('0x29')](_0x5e1027,null,0x2));}else if(fs['existsSync'](_0x1cbd9b)){_0x5e1027['status']=_0x7936('0x25');_0x17c671[_0x7936('0x26')][_0x7936('0x27')]=[{'filename':_0x586f05,'path':_0x1cbd9b}];}else{_0x17c671[_0x7936('0x26')][_0x7936('0x28')]=_0x7936('0x2a');if(!_0x1ccd31[_0x7936('0x2b')]){_0x3c9970=![];logger[_0x7936('0x2c')](_0x7936('0x2d'));}}if(_0x3c9970){return client[_0x7936('0x2e')](_0x7936('0x2f'),_0x17c671)[_0x7936('0x30')](function(_0x28a2fb){if(_0x28a2fb['error']){return logger[_0x7936('0x31')](_0x7936('0x32'),JSON[_0x7936('0x29')](_0x28a2fb));}return logger[_0x7936('0x2c')](_0x7936('0x33'));})[_0x7936('0x34')](function(_0x1c5744){return logger['error'](_0x7936('0x32'),JSON[_0x7936('0x29')](_0x1c5744));});}};}function handleError(){return function(_0x4e20a6){return logger['error'](JSON[_0x7936('0x29')](_0x4e20a6));};}function handleResult(_0x3a2caa){return function(_0x183aa2){logger[_0x7936('0x2c')](_0x7936('0x35'),JSON['stringify'](_0x183aa2));if(_0x3a2caa[_0x7936('0xe')]&&_0x3a2caa[_0x7936('0xe')]['Smtp']&&!_[_0x7936('0x36')](_0x3a2caa[_0x7936('0x19')])){setTimeout(handleSendEmail(_0x3a2caa,_0x183aa2),0x3c*0x3e8);}};}function handleJob(_0x1e56a9){return function(){try{if(_['isNil'](_0x1e56a9[_0x7936('0x1b')])){return logger[_0x7936('0x2c')](_0x7936('0x37'));}if(_[_0x7936('0x36')](_0x1e56a9['subtractUnit'])){return logger[_0x7936('0x2c')]('subtractUnit\x20null\x20or\x20undefined');}var _0x1f2131={'startDate':moment()['subtract'](_0x1e56a9[_0x7936('0x1b')],_0x1e56a9[_0x7936('0x1c')])[_0x7936('0x16')](_0x7936('0x38')),'endDate':moment()['format'](_0x7936('0x38')),'type':'scheduled','output':_0x1e56a9[_0x7936('0x39')],'name':_0x1e56a9[_0x7936('0x18')]};if(!_[_0x7936('0x36')](_0x1e56a9[_0x7936('0x3a')])){logger[_0x7936('0x2c')]('exec\x20defaul\x20report\x20id:%s',_0x1e56a9[_0x7936('0x3a')]);return analyticDefaultReportController[_0x7936('0x3b')]({'id':_0x1e56a9['DefaultReportId']},_0x1f2131)[_0x7936('0x30')](handleResult(_0x1e56a9))['catch'](handleError());}if(!_[_0x7936('0x36')](_0x1e56a9[_0x7936('0x3c')])){logger[_0x7936('0x2c')]('exec\x20custom\x20report\x20id:%s',_0x1e56a9['CustomReportId']);return analyticCustomReportController[_0x7936('0x3b')]({'id':_0x1e56a9[_0x7936('0x3c')]},_0x1f2131)[_0x7936('0x30')](handleResult(_0x1e56a9))[_0x7936('0x34')](handleError());}}catch(_0x827364){logger[_0x7936('0x31')](JSON[_0x7936('0x29')](_0x827364));}return logger[_0x7936('0x2c')](_0x7936('0x3d'));};}function getJobs(_0x2e0da6){var _0x5a0d86={};if(_0x2e0da6){_0x5a0d86['id']=_0x2e0da6;}return db['Schedule'][_0x7936('0x3e')]({'where':_0x5a0d86,'include':[{'model':db[_0x7936('0xe')],'attributes':['id',_0x7936('0x18'),'email'],'include':[{'model':db[_0x7936('0x3f')],'as':_0x7936('0xc')}]}]})[_0x7936('0x30')](function(_0x1a898f){var _0x8abbd6=_[_0x7936('0x40')](manager[_0x7936('0x41')]);var _0x7a042c=_['map'](_0x1a898f,function(_0x1f4409){return _0x1f4409['id'][_0x7936('0x42')]();});var _0x50027e=_[_0x7936('0x43')](_0x1a898f,function(_0x55838d){return _0x55838d['id'][_0x7936('0x42')]();});var _0xc3ec7c=_0x2e0da6?_0x7a042c:_['difference'](_0x7a042c,_0x8abbd6);var _0xb8b11c=_[_0x7936('0x44')](_0x7a042c,_0x8abbd6);var _0xe5a1ce=_['difference'](_0x8abbd6,_0x7a042c);var _0x55a894;var _0x39fd96;for(_0x55a894=0x0;_0x55a894<_0xe5a1ce['length']&&!_0x2e0da6;_0x55a894+=0x1){_0x39fd96=_0xe5a1ce[_0x55a894][_0x7936('0x42')]();if(manager[_0x7936('0x45')](_0x39fd96)){manager[_0x7936('0x46')](_0x39fd96);manager[_0x7936('0x47')](_0x39fd96);logger[_0x7936('0x2c')](_0x7936('0x48'),_0x39fd96);}}logger[_0x7936('0x2c')]('toRun',JSON['stringify'](_0xc3ec7c));for(_0x55a894=0x0;_0x55a894<_0xc3ec7c[_0x7936('0x49')];_0x55a894+=0x1){_0x39fd96=_0xc3ec7c[_0x55a894]['toString']();logger[_0x7936('0x2c')]('index',_0x39fd96);if(_0x2e0da6){logger[_0x7936('0x2c')](_0x7936('0x4a'),_0x2e0da6);logger['info'](JSON[_0x7936('0x29')](_0x50027e[_0x39fd96]));BPromise[_0x7936('0x4b')]()[_0x7936('0x30')](handleJob(_0x50027e[_0x39fd96]));logger['info'](_0x7936('0x4c'),_0x50027e[_0x39fd96][_0x7936('0x18')],_0x50027e[_0x39fd96][_0x7936('0x4d')]);}else if(_0x50027e[_0x39fd96][_0x7936('0x4d')]&&_0x50027e[_0x39fd96]['active']&&moment()[_0x7936('0x4e')](_0x50027e[_0x39fd96][_0x7936('0x4f')],_0x50027e[_0x39fd96][_0x7936('0x50')])){manager['add'](_0x39fd96,_0x50027e[_0x39fd96][_0x7936('0x4d')],handleJob(_0x50027e[_0x39fd96]));manager[_0x7936('0x51')](_0x39fd96);logger[_0x7936('0x2c')](_0x7936('0x52'),_0x50027e[_0x39fd96][_0x7936('0x18')],_0x50027e[_0x39fd96]['cron']);}else if(manager[_0x7936('0x45')](_0x39fd96)){manager['stop'](_0x39fd96);manager[_0x7936('0x47')](_0x39fd96);logger[_0x7936('0x2c')](_0x7936('0x53'),_0x50027e[_0x39fd96]['name'],_0x50027e[_0x39fd96][_0x7936('0x4d')]);}}for(_0x55a894=0x0,_0x39fd96;_0x55a894<_0xb8b11c[_0x7936('0x49')]&&!_0x2e0da6;_0x55a894+=0x1){_0x39fd96=_0xb8b11c[_0x55a894]['toString']();if(manager[_0x7936('0x45')](_0x39fd96)){if(_0x50027e[_0x39fd96][_0x7936('0x4d')]&&_0x50027e[_0x39fd96][_0x7936('0x54')]&&moment()[_0x7936('0x4e')](_0x50027e[_0x39fd96][_0x7936('0x4f')],_0x50027e[_0x39fd96]['endAt'])){manager['update'](_0x39fd96,_0x50027e[_0x39fd96]['cron'],handleJob(_0x50027e[_0x39fd96]));logger['info'](_0x7936('0x55'),_0x50027e[_0x39fd96][_0x7936('0x18')],_0x50027e[_0x39fd96][_0x7936('0x4d')]);}else{manager['stop'](_0x39fd96);manager[_0x7936('0x47')](_0x39fd96);logger[_0x7936('0x2c')](_0x7936('0x53'),_0x50027e[_0x39fd96][_0x7936('0x18')],_0x50027e[_0x39fd96][_0x7936('0x4d')]);}}}})[_0x7936('0x34')](function(_0x851964){logger[_0x7936('0x31')](JSON['stringify'](_0x851964));});}exports['run']=function(_0x104f32){return getJobs(_0x104f32);};exports[_0x7936('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb223=['output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','util','path','lodash','moment','cron-job-manager','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','Smtp','service','MailAccount','host','secure','authentication','pass','format','name','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled'];(function(_0x34db7f,_0x3e22f8){var _0x509554=function(_0x112764){while(--_0x112764){_0x34db7f['push'](_0x34db7f['shift']());}};_0x509554(++_0x3e22f8);}(_0xb223,0x1d5));var _0x3b22=function(_0x2dc375,_0x24b1d6){_0x2dc375=_0x2dc375-0x0;var _0x4e9fed=_0xb223[_0x2dc375];return _0x4e9fed;};'use strict';var fs=require('fs');var util=require(_0x3b22('0x0'));var path=require(_0x3b22('0x1'));var _=require(_0x3b22('0x2'));var moment=require(_0x3b22('0x3'));var CronJobManager=require(_0x3b22('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x3b22('0x5'));var logger=require(_0x3b22('0x6'))('schedule');var db=require(_0x3b22('0x7'))['db'];var analyticCustomReportController=require(_0x3b22('0x8'));var analyticDefaultReportController=require(_0x3b22('0x9'));var client=jayson[_0x3b22('0xa')][_0x3b22('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x45f87a,_0x440828){return function(){logger[_0x3b22('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x45f87a[_0x3b22('0xd')]);var _0x47feec=!![];var _0x300dda={'tls':{'rejectUnauthorized':![]}};if(_0x45f87a['MailAccount'][_0x3b22('0xe')][_0x3b22('0xf')]){_0x300dda[_0x3b22('0xf')]=_0x45f87a[_0x3b22('0x10')]['Smtp']['service'];}else{_0x300dda[_0x3b22('0x11')]=_0x45f87a['MailAccount'][_0x3b22('0xe')][_0x3b22('0x11')];_0x300dda['port']=_0x45f87a[_0x3b22('0x10')][_0x3b22('0xe')]['port'];_0x300dda[_0x3b22('0x12')]=_0x45f87a[_0x3b22('0x10')][_0x3b22('0xe')]['secure'];}if(_0x45f87a[_0x3b22('0x10')]['Smtp'][_0x3b22('0x13')]){_0x300dda['auth']={'user':_0x45f87a[_0x3b22('0x10')][_0x3b22('0xe')]['user'],'pass':_0x45f87a[_0x3b22('0x10')][_0x3b22('0xe')][_0x3b22('0x14')]};}var _0x4c0a3c={'account':_0x300dda,'message':{'from':util[_0x3b22('0x15')]('\x22%s\x22\x20<%s>',_0x45f87a['MailAccount'][_0x3b22('0x16')],_0x45f87a['MailAccount'][_0x3b22('0xd')]||_0x45f87a['MailAccount'][_0x3b22('0xe')]['user']),'to':_0x45f87a['email'],'cc':_0x45f87a['cc'],'bcc':_0x45f87a[_0x3b22('0x17')],'subject':util[_0x3b22('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x440828[_0x3b22('0x16')],_0x45f87a[_0x3b22('0x18')],_0x45f87a[_0x3b22('0x19')])}};var _0x3b5854=path[_0x3b22('0x1a')](__dirname,_0x3b22('0x1b'));var _0x54d498=_0x440828[_0x3b22('0x1c')];var _0x2964ea=util[_0x3b22('0x15')](_0x3b22('0x1d'),path[_0x3b22('0x1e')](_0x440828[_0x3b22('0x1c')],path[_0x3b22('0x1f')](_0x440828[_0x3b22('0x1c')])),_0x3b22('0x20'));var _0x4799a5=path['join'](_0x3b5854,_0x54d498);var _0x4a4d56=path[_0x3b22('0x1a')](_0x3b5854,_0x2964ea);if(fs['existsSync'](_0x4799a5)){_0x440828[_0x3b22('0x21')]=_0x3b22('0x22');_0x4c0a3c[_0x3b22('0x23')]['attachments']=[{'filename':_0x54d498,'path':_0x4799a5}];_0x4c0a3c[_0x3b22('0x23')][_0x3b22('0x24')]=util[_0x3b22('0x15')](_0x3b22('0x25'),JSON[_0x3b22('0x26')](_0x440828,null,0x2));}else if(fs[_0x3b22('0x27')](_0x4a4d56)){_0x440828[_0x3b22('0x21')]=_0x3b22('0x22');_0x4c0a3c[_0x3b22('0x23')]['attachments']=[{'filename':_0x2964ea,'path':_0x4a4d56}];}else{_0x4c0a3c[_0x3b22('0x23')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x45f87a[_0x3b22('0x28')]){_0x47feec=![];logger[_0x3b22('0xc')](_0x3b22('0x29'));}}if(_0x47feec){return client[_0x3b22('0x2a')]('SendMail',_0x4c0a3c)[_0x3b22('0x2b')](function(_0x511789){if(_0x511789['error']){return logger[_0x3b22('0x2c')](_0x3b22('0x2d'),JSON[_0x3b22('0x26')](_0x511789));}return logger[_0x3b22('0xc')](_0x3b22('0x2e'));})[_0x3b22('0x2f')](function(_0x5cb2dc){return logger['error']('error\x20mail',JSON['stringify'](_0x5cb2dc));});}};}function handleError(){return function(_0x143687){return logger[_0x3b22('0x2c')](JSON['stringify'](_0x143687));};}function handleResult(_0x122924){return function(_0x309c2b){logger[_0x3b22('0xc')](_0x3b22('0x30'),JSON[_0x3b22('0x26')](_0x309c2b));if(_0x122924['MailAccount']&&_0x122924['MailAccount']['Smtp']&&!_[_0x3b22('0x31')](_0x122924[_0x3b22('0xd')])){setTimeout(handleSendEmail(_0x122924,_0x309c2b),0x3c*0x3e8);}};}function handleJob(_0x4abfcf){return function(){try{if(_[_0x3b22('0x31')](_0x4abfcf[_0x3b22('0x18')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3b22('0x31')](_0x4abfcf[_0x3b22('0x19')])){return logger[_0x3b22('0xc')](_0x3b22('0x32'));}var _0x5ea4b0={'startDate':moment()['subtract'](_0x4abfcf[_0x3b22('0x18')],_0x4abfcf['subtractUnit'])[_0x3b22('0x15')](_0x3b22('0x33')),'endDate':moment()[_0x3b22('0x15')](_0x3b22('0x33')),'type':_0x3b22('0x34'),'output':_0x4abfcf[_0x3b22('0x35')],'name':_0x4abfcf['name']};if(!_['isNil'](_0x4abfcf[_0x3b22('0x36')])){logger[_0x3b22('0xc')](_0x3b22('0x37'),_0x4abfcf[_0x3b22('0x36')]);return analyticDefaultReportController[_0x3b22('0x38')]({'id':_0x4abfcf['DefaultReportId']},_0x5ea4b0)[_0x3b22('0x2b')](handleResult(_0x4abfcf))[_0x3b22('0x2f')](handleError());}if(!_[_0x3b22('0x31')](_0x4abfcf['CustomReportId'])){logger[_0x3b22('0xc')](_0x3b22('0x39'),_0x4abfcf[_0x3b22('0x3a')]);return analyticCustomReportController[_0x3b22('0x38')]({'id':_0x4abfcf[_0x3b22('0x3a')]},_0x5ea4b0)[_0x3b22('0x2b')](handleResult(_0x4abfcf))[_0x3b22('0x2f')](handleError());}}catch(_0x449a6b){logger[_0x3b22('0x2c')](JSON[_0x3b22('0x26')](_0x449a6b));}return logger[_0x3b22('0xc')]('no\x20report\x20id');};}function getJobs(_0x46e960){var _0x462eef={};if(_0x46e960){_0x462eef['id']=_0x46e960;}return db[_0x3b22('0x3b')][_0x3b22('0x3c')]({'where':_0x462eef,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x3b22('0xd')],'include':[{'model':db[_0x3b22('0x3d')],'as':_0x3b22('0xe')}]}]})[_0x3b22('0x2b')](function(_0x527b68){var _0x2a0d75=_[_0x3b22('0x3e')](manager[_0x3b22('0x3f')]);var _0x892d58=_[_0x3b22('0x40')](_0x527b68,function(_0x3d1b6d){return _0x3d1b6d['id'][_0x3b22('0x41')]();});var _0x2ee92d=_[_0x3b22('0x42')](_0x527b68,function(_0x23e2dc){return _0x23e2dc['id'][_0x3b22('0x41')]();});var _0x44f67a=_0x46e960?_0x892d58:_[_0x3b22('0x43')](_0x892d58,_0x2a0d75);var _0x630f05=_['intersection'](_0x892d58,_0x2a0d75);var _0x463b9b=_[_0x3b22('0x43')](_0x2a0d75,_0x892d58);var _0x585426;var _0xfd72ab;for(_0x585426=0x0;_0x585426<_0x463b9b[_0x3b22('0x44')]&&!_0x46e960;_0x585426+=0x1){_0xfd72ab=_0x463b9b[_0x585426][_0x3b22('0x41')]();if(manager[_0x3b22('0x45')](_0xfd72ab)){manager[_0x3b22('0x46')](_0xfd72ab);manager['deleteJob'](_0xfd72ab);logger['info'](_0x3b22('0x47'),_0xfd72ab);}}logger['info'](_0x3b22('0x48'),JSON[_0x3b22('0x26')](_0x44f67a));for(_0x585426=0x0;_0x585426<_0x44f67a[_0x3b22('0x44')];_0x585426+=0x1){_0xfd72ab=_0x44f67a[_0x585426][_0x3b22('0x41')]();logger[_0x3b22('0xc')]('index',_0xfd72ab);if(_0x46e960){logger['info'](_0x3b22('0x49'),_0x46e960);logger['info'](JSON['stringify'](_0x2ee92d[_0xfd72ab]));BPromise[_0x3b22('0x4a')]()[_0x3b22('0x2b')](handleJob(_0x2ee92d[_0xfd72ab]));logger[_0x3b22('0xc')]('run\x20job',_0x2ee92d[_0xfd72ab]['name'],_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]);}else if(_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]&&_0x2ee92d[_0xfd72ab][_0x3b22('0x4c')]&&moment()[_0x3b22('0x4d')](_0x2ee92d[_0xfd72ab][_0x3b22('0x4e')],_0x2ee92d[_0xfd72ab][_0x3b22('0x4f')])){manager[_0x3b22('0x50')](_0xfd72ab,_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')],handleJob(_0x2ee92d[_0xfd72ab]));manager[_0x3b22('0x51')](_0xfd72ab);logger[_0x3b22('0xc')](_0x3b22('0x52'),_0x2ee92d[_0xfd72ab][_0x3b22('0x16')],_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]);}else if(manager[_0x3b22('0x45')](_0xfd72ab)){manager['stop'](_0xfd72ab);manager[_0x3b22('0x53')](_0xfd72ab);logger[_0x3b22('0xc')](_0x3b22('0x54'),_0x2ee92d[_0xfd72ab][_0x3b22('0x16')],_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]);}}for(_0x585426=0x0,_0xfd72ab;_0x585426<_0x630f05[_0x3b22('0x44')]&&!_0x46e960;_0x585426+=0x1){_0xfd72ab=_0x630f05[_0x585426][_0x3b22('0x41')]();if(manager[_0x3b22('0x45')](_0xfd72ab)){if(_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]&&_0x2ee92d[_0xfd72ab][_0x3b22('0x4c')]&&moment()['isBetween'](_0x2ee92d[_0xfd72ab]['startAt'],_0x2ee92d[_0xfd72ab]['endAt'])){manager[_0x3b22('0x55')](_0xfd72ab,_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')],handleJob(_0x2ee92d[_0xfd72ab]));logger[_0x3b22('0xc')](_0x3b22('0x56'),_0x2ee92d[_0xfd72ab][_0x3b22('0x16')],_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]);}else{manager[_0x3b22('0x46')](_0xfd72ab);manager[_0x3b22('0x53')](_0xfd72ab);logger['info'](_0x3b22('0x54'),_0x2ee92d[_0xfd72ab][_0x3b22('0x16')],_0x2ee92d[_0xfd72ab][_0x3b22('0x4b')]);}}}})[_0x3b22('0x2f')](function(_0x57e0d0){logger[_0x3b22('0x2c')](JSON[_0x3b22('0x26')](_0x57e0d0));});}exports['run']=function(_0x151b7b){return getJobs(_0x151b7b);};exports[_0x3b22('0x51')]=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 f5a62b2..a2103c3 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b9=['hopper1','contacts2','hopper2','catch','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','log','contacts1','CmHopper','bulkCreate','finished\x20populating'];(function(_0xe3f1e2,_0x4b8bca){var _0x316d36=function(_0x25c684){while(--_0x25c684){_0xe3f1e2['push'](_0xe3f1e2['shift']());}};_0x316d36(++_0x4b8bca);}(_0x36b9,0x169));var _0x936b=function(_0x2abc23,_0x3520dd){_0x2abc23=_0x2abc23-0x0;var _0x1f52ee=_0x36b9[_0x2abc23];return _0x1f52ee;};'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[_0x936b('0x0')]({'id':i,'firstName':_0x936b('0x1')+i,'lastName':_0x936b('0x2')+i,'phone':0xf879fb460+i,'email':_0x936b('0x3')+i+_0x936b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x936b('0x5')](),'updatedAt':Date[_0x936b('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x936b('0x1')+i,'lastName':_0x936b('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x936b('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x936b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x936b('0x5')](),'updatedAt':Date['now']()});}db[_0x936b('0x6')]['destroy']({'where':{}})[_0x936b('0x7')](function(){return db[_0x936b('0x6')]['bulkCreate'](contacts);})['then'](function(){console[_0x936b('0x8')]('finished\x20populating',_0x936b('0x9'));return db[_0x936b('0xa')]['destroy']({'where':{}});})['then'](function(){return db[_0x936b('0xa')][_0x936b('0xb')](hopper);})['then'](function(){console[_0x936b('0x8')](_0x936b('0xc'),_0x936b('0xd'));return db[_0x936b('0x6')][_0x936b('0xb')](contacts2);})['then'](function(){console['log'](_0x936b('0xc'),_0x936b('0xe'));return db['CmHopper'][_0x936b('0xb')](hopper2);})[_0x936b('0x7')](function(){console[_0x936b('0x8')]('finished\x20populating',_0x936b('0xf'));})[_0x936b('0x10')](function(_0x37e6ca){console['log'](_0x37e6ca);}); \ No newline at end of file +var _0xd00a=['Biondo','@xcally.com','now','innocenzo.biondo','bulkCreate','then','log','finished\x20populating','contacts1','destroy','hopper1','CmContact','contacts2','CmHopper','hopper2','util','../mysqldb','push'];(function(_0x225d6c,_0x2e25b2){var _0x509360=function(_0xdfe9b3){while(--_0xdfe9b3){_0x225d6c['push'](_0x225d6c['shift']());}};_0x509360(++_0x2e25b2);}(_0xd00a,0x1e3));var _0xad00=function(_0x3611b9,_0x11b59a){_0x3611b9=_0x3611b9-0x0;var _0xb7063a=_0xd00a[_0x3611b9];return _0xb7063a;};'use strict';var util=require(_0xad00('0x0'));var db=require(_0xad00('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xad00('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xad00('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xad00('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xad00('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xad00('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad00('0x5')](),'updatedAt':Date[_0xad00('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xad00('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xad00('0x3')+i,'phone':0xf879fb460+i,'email':_0xad00('0x6')+i+_0xad00('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xad00('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xad00('0x5')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db['CmContact'][_0xad00('0x7')](contacts);})[_0xad00('0x8')](function(){console[_0xad00('0x9')](_0xad00('0xa'),_0xad00('0xb'));return db['CmHopper'][_0xad00('0xc')]({'where':{}});})[_0xad00('0x8')](function(){return db['CmHopper'][_0xad00('0x7')](hopper);})[_0xad00('0x8')](function(){console[_0xad00('0x9')](_0xad00('0xa'),_0xad00('0xd'));return db[_0xad00('0xe')][_0xad00('0x7')](contacts2);})[_0xad00('0x8')](function(){console[_0xad00('0x9')](_0xad00('0xa'),_0xad00('0xf'));return db[_0xad00('0x10')]['bulkCreate'](hopper2);})[_0xad00('0x8')](function(){console[_0xad00('0x9')]('finished\x20populating',_0xad00('0x11'));})['catch'](function(_0x49bcbb){console[_0xad00('0x9')](_0x49bcbb);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index d964859..6ba5f4f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb69b=['log','add\x20user','catch','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x40571e,_0x3e6ce8){var _0xcaa958=function(_0x9aaa2e){while(--_0x9aaa2e){_0x40571e['push'](_0x40571e['shift']());}};_0xcaa958(++_0x3e6ce8);}(_0xb69b,0xd4));var _0xbb69=function(_0x3725d7,_0x1ad773){_0x3725d7=_0x3725d7-0x0;var _0x1b85c2=_0xb69b[_0x3725d7];return _0x1b85c2;};'use strict';var util=require('util');var db=require(_0xbb69('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbb69('0x1')]({'name':util['format'](_0xbb69('0x2'),'agent',i),'fullname':util['format'](_0xbb69('0x2'),_0xbb69('0x3'),i),'email':util[_0xbb69('0x4')](_0xbb69('0x5'),_0xbb69('0x3'),i),'role':_0xbb69('0x3'),'password':_0xbb69('0x6'),'internal':0xfa0+i,'type':_0xbb69('0x7'),'transport':[_0xbb69('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0xbb69('0x9')],'defaultuser':util[_0xbb69('0x4')](_0xbb69('0x2'),_0xbb69('0x3'),i),'encryption':_0xbb69('0xa'),'avpf':_0xbb69('0xa'),'force_avp':_0xbb69('0xa'),'icesupport':_0xbb69('0xa'),'dtlsenable':_0xbb69('0xa'),'dtlsverify':'no','dtlscertfile':_0xbb69('0xb'),'dtlsprivatekey':_0xbb69('0xc'),'dtlssetup':_0xbb69('0xd'),'callerid':util[_0xbb69('0x4')](_0xbb69('0xe'),util[_0xbb69('0x4')](_0xbb69('0x2'),_0xbb69('0x3'),i),0xfa0+i)});}db[_0xbb69('0xf')]['bulkCreate'](users)['then'](function(){console[_0xbb69('0x10')](_0xbb69('0x11'));})[_0xbb69('0x12')](function(_0x1f9245){console[_0xbb69('0x10')](_0x1f9245);}); \ No newline at end of file +var _0xd6e3=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','%s%s','format','agent','password','friend','udp','ulaw','yes'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0xd6e3,0x117));var _0x3d6e=function(_0x4c9012,_0x386708){_0x4c9012=_0x4c9012-0x0;var _0x466873=_0xd6e3[_0x4c9012];return _0x466873;};'use strict';var util=require('util');var db=require(_0x3d6e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x3d6e('0x1'),'agent',i),'fullname':util[_0x3d6e('0x2')]('%s%s',_0x3d6e('0x3'),i),'email':util[_0x3d6e('0x2')]('%s%s@xcally.com',_0x3d6e('0x3'),i),'role':_0x3d6e('0x3'),'password':_0x3d6e('0x4'),'internal':0xfa0+i,'type':_0x3d6e('0x5'),'transport':[_0x3d6e('0x6'),'ws','wss'],'disallow':['all'],'allow':[_0x3d6e('0x7')],'defaultuser':util[_0x3d6e('0x2')](_0x3d6e('0x1'),_0x3d6e('0x3'),i),'encryption':_0x3d6e('0x8'),'avpf':_0x3d6e('0x8'),'force_avp':_0x3d6e('0x8'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x3d6e('0x9'),'dtlsprivatekey':_0x3d6e('0xa'),'dtlssetup':_0x3d6e('0xb'),'callerid':util[_0x3d6e('0x2')]('\x22%s\x22\x20<%s>',util[_0x3d6e('0x2')](_0x3d6e('0x1'),_0x3d6e('0x3'),i),0xfa0+i)});}db[_0x3d6e('0xc')][_0x3d6e('0xd')](users)[_0x3d6e('0xe')](function(){console[_0x3d6e('0xf')](_0x3d6e('0x10'));})[_0x3d6e('0x11')](function(_0x1d9a01){console[_0x3d6e('0xf')](_0x1d9a01);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 59df388..f920c00 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb4=['emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueues','FaxQueues','getChatQueues','getFaxQueues','getSmsQueues','all','chat','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x2eb4,0x193));var _0x42eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2eb4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x42eb('0x0'));var util=require(_0x42eb('0x1'));var BPromise=require(_0x42eb('0x2'));var db=require(_0x42eb('0x3'))['db'];var config=require(_0x42eb('0x4'));var queryQueues={'attributes':['id',_0x42eb('0x5')],'include':[{'as':'Agents','model':db[_0x42eb('0x6')],'attributes':['id',_0x42eb('0x5'),_0x42eb('0x7')],'raw':!![],'where':{'role':_0x42eb('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x42eb('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x42eb('0x5')],'where':{'role':_0x42eb('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x42eb('0x9')],'where':{'type':_0x42eb('0xa')}};function getAssociatedResources(_0x20bfd3,_0x3239cd,_0x35471e){return db[_0x42eb('0xb')][_0x42eb('0xc')]({'where':{'name':_0x20bfd3,'userProfileId':_0x3239cd},'raw':!![]})[_0x42eb('0xd')](function(_0x28c090){if(_0x28c090){if(_0x28c090[_0x42eb('0xe')]){switch(_0x20bfd3){case _0x42eb('0xf'):case'ChatQueues':case'FaxQueues':case _0x42eb('0x10'):case _0x42eb('0x11'):case _0x42eb('0x12'):return db[_0x35471e][_0x42eb('0x13')](queryQueues);case _0x42eb('0x14'):return db[_0x35471e][_0x42eb('0x13')](queryTelephones);case _0x42eb('0x15'):return db[_0x35471e][_0x42eb('0x13')](queryTrunks);case _0x42eb('0x16'):return db[_0x35471e]['findAll'](queryCampaigns);}}else{return db[_0x42eb('0x17')][_0x42eb('0x13')]({'attributes':[_0x42eb('0x18')],'where':{'sectionId':_0x28c090['id']},'raw':!![]})[_0x42eb('0xd')](function(_0x5ce708){if(_0x5ce708){var _0x388274={'where':{'id':_[_0x42eb('0x19')](_0x5ce708,_0x42eb('0x18'))},'raw':!![]};switch(_0x35471e){case _0x42eb('0x6'):_0x388274[_0x42eb('0x1a')][_0x42eb('0x7')]=_0x42eb('0x1b');break;case _0x42eb('0x1c'):_0x388274['where'][_0x42eb('0x9')]=_0x42eb('0xa');break;}return db[_0x35471e]['findAll'](_0x388274);}else{return[];}});}}else{return[];}})[_0x42eb('0xd')](function(_0xac592c){return _0xac592c;});}function joinOrLeaveQueues(_0x4f2c6a,_0x56dfb9,_0x25c735,_0x3d1c38){_0x4f2c6a[_0x56dfb9](util[_0x42eb('0x1d')](_0x42eb('0x1e'),_0x25c735,_0x3d1c38['name']));if(_0x3d1c38[_0x42eb('0x1f')]){for(var _0x2a6563=0x0;_0x2a6563<_0x3d1c38[_0x42eb('0x1f')][_0x42eb('0x20')];_0x2a6563+=0x1){_0x4f2c6a[_0x56dfb9](util['format'](_0x42eb('0x21'),_0x3d1c38[_0x42eb('0x1f')][_0x2a6563][_0x42eb('0x5')]));}}}function joinOrLeave(_0x3df25b,_0x2e932f,_0x26b24e){var _0x3ed9b3;if(_0x3df25b[_0x42eb('0x22')][_0x42eb('0x23')]['id']){db[_0x42eb('0x6')]['find']({'attributes':['id',_0x42eb('0x5'),_0x42eb('0x7'),_0x42eb('0x24')],'where':{'id':_0x3df25b[_0x42eb('0x22')][_0x42eb('0x23')]['id']},'include':[{'model':db[_0x42eb('0x25')],'as':_0x42eb('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x42eb('0x27')],'as':_0x42eb('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x42eb('0x29')],'as':_0x42eb('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x42eb('0x2b')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x42eb('0x2c')],'as':_0x42eb('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xf7c7c3){if(_0xf7c7c3){_0x3ed9b3=_0xf7c7c3;_0x3df25b[_0x2e932f](util[_0x42eb('0x1d')]('user:%s',_0xf7c7c3[_0x42eb('0x5')]));var _0x11733a=[];switch(_0xf7c7c3[_0x42eb('0x7')]){case'admin':_0x3df25b[_0x2e932f](_0x42eb('0x2e'));_0x3df25b[_0x2e932f](_0x42eb('0x2f'));if(queryQueues[_0x42eb('0x30')](_0x42eb('0x31'))){delete queryQueues[_0x42eb('0x31')];}_0x11733a['push'](db[_0x42eb('0x32')][_0x42eb('0x13')](queryQueues));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x34')][_0x42eb('0x13')](queryQueues));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x35')][_0x42eb('0x13')](queryQueues));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x36')][_0x42eb('0x13')](queryQueues));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x37')]['findAll'](queryQueues));_0x11733a['push'](db[_0x42eb('0x38')]['findAll'](queryQueues));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x6')][_0x42eb('0x13')](queryTelephones));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x39')][_0x42eb('0x13')](queryTrunks));_0x11733a[_0x42eb('0x33')](db['Campaign'][_0x42eb('0x13')](queryCampaigns));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x6')][_0x42eb('0x13')](queryAgents));break;case _0x42eb('0x3a'):_0x3df25b[_0x2e932f]('voice:inbound');_0x3df25b[_0x2e932f](_0x42eb('0x2f'));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0xf'),_0xf7c7c3[_0x42eb('0x24')],_0x42eb('0x32')));_0x11733a['push'](getAssociatedResources(_0x42eb('0x3b'),_0xf7c7c3[_0x42eb('0x24')],_0x42eb('0x34')));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0x3c'),_0xf7c7c3[_0x42eb('0x24')],_0x42eb('0x35')));_0x11733a[_0x42eb('0x33')](getAssociatedResources('SmsQueues',_0xf7c7c3['userProfileId'],_0x42eb('0x36')));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0x11'),_0xf7c7c3[_0x42eb('0x24')],_0x42eb('0x37')));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0x12'),_0xf7c7c3['userProfileId'],'OpenchannelQueue'));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0x14'),_0xf7c7c3[_0x42eb('0x24')],'User'));_0x11733a['push'](getAssociatedResources(_0x42eb('0x15'),_0xf7c7c3[_0x42eb('0x24')],'Trunk'));_0x11733a[_0x42eb('0x33')](getAssociatedResources(_0x42eb('0x16'),_0xf7c7c3[_0x42eb('0x24')],'Campaign'));_0x11733a[_0x42eb('0x33')](db[_0x42eb('0x6')]['findAll'](queryAgents));break;case _0x42eb('0x8'):_0x3df25b[_0x2e932f](_0x42eb('0x2e'));_0x3df25b[_0x2e932f](_0x42eb('0x2f'));_0x11733a[_0x42eb('0x33')](_0xf7c7c3['getVoiceQueues']({'attributes':['id',_0x42eb('0x5')]}));_0x11733a[_0x42eb('0x33')](_0xf7c7c3[_0x42eb('0x3d')]({'attributes':['id','name']}));_0x11733a['push'](_0xf7c7c3[_0x42eb('0x3e')]({'attributes':['id','name']}));_0x11733a[_0x42eb('0x33')](_0xf7c7c3[_0x42eb('0x3f')]({'attributes':['id',_0x42eb('0x5')]}));_0x11733a[_0x42eb('0x33')](_0xf7c7c3['getMailQueues']({'attributes':['id',_0x42eb('0x5')]}));_0x11733a[_0x42eb('0x33')](_0xf7c7c3['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0x42eb('0x40')](_0x11733a);}})['then'](function(_0x1256f4){if(_0x1256f4&&_0x1256f4[_0x42eb('0x20')]){for(var _0x29abfe=0x0;_0x29abfe<_0x1256f4[_0x42eb('0x20')];_0x29abfe+=0x1){for(var _0x3bd9b6=0x0;_0x3bd9b6<_0x1256f4[_0x29abfe][_0x42eb('0x20')];_0x3bd9b6+=0x1){switch(_0x29abfe){case 0x0:joinOrLeaveQueues(_0x3df25b,_0x2e932f,'voice',_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x1:joinOrLeaveQueues(_0x3df25b,_0x2e932f,_0x42eb('0x41'),_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x2:joinOrLeaveQueues(_0x3df25b,_0x2e932f,'fax',_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x3:joinOrLeaveQueues(_0x3df25b,_0x2e932f,'sms',_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x4:joinOrLeaveQueues(_0x3df25b,_0x2e932f,_0x42eb('0x42'),_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x5:joinOrLeaveQueues(_0x3df25b,_0x2e932f,'openchannel',_0x1256f4[_0x29abfe][_0x3bd9b6]);break;case 0x6:_0x3df25b[_0x2e932f](util['format'](_0x42eb('0x43'),_0x1256f4[_0x29abfe][_0x3bd9b6][_0x42eb('0x5')]));break;case 0x7:_0x3df25b[_0x2e932f](util[_0x42eb('0x1d')](_0x42eb('0x44'),_0x1256f4[_0x29abfe][_0x3bd9b6]['name']));break;case 0x8:_0x3df25b[_0x2e932f](util[_0x42eb('0x1d')](_0x42eb('0x45'),_0x1256f4[_0x29abfe][_0x3bd9b6][_0x42eb('0x9')],_0x1256f4[_0x29abfe][_0x3bd9b6]['name']));break;case 0x9:_0x3df25b[_0x2e932f](util['format']('user:%s',_0x1256f4[_0x29abfe][_0x3bd9b6][_0x42eb('0x5')]));break;}}}}})[_0x42eb('0xd')](function(){if(_0x2e932f===_0x42eb('0x46')){var _0x53d4b4=_[_0x42eb('0x19')](_0x3ed9b3[_0x42eb('0x26')],'id');return _0x3ed9b3[_0x42eb('0x47')](_0x53d4b4)[_0x42eb('0xd')](function(){for(var _0x9d6168=0x0;_0x9d6168<_0x53d4b4[_0x42eb('0x20')];_0x9d6168+=0x1){_0x26b24e[_0x42eb('0x48')](_0x42eb('0x49'),{'ChatInteractionId':Number(_0x53d4b4[_0x9d6168]),'UserId':Number(_0x3ed9b3['id'])});}});}})[_0x42eb('0xd')](function(){if(_0x2e932f===_0x42eb('0x46')){var _0x481615=_[_0x42eb('0x19')](_0x3ed9b3[_0x42eb('0x28')],'id');return _0x3ed9b3['removeMailInteractions'](_0x481615)[_0x42eb('0xd')](function(){for(var _0x37bb6a=0x0;_0x37bb6a<_0x481615['length'];_0x37bb6a+=0x1){_0x26b24e['emit'](_0x42eb('0x4a'),{'MailInteractionId':Number(_0x481615[_0x37bb6a]),'UserId':Number(_0x3ed9b3['id'])});}});}})['then'](function(){if(_0x2e932f===_0x42eb('0x46')){var _0x5025d5=_['map'](_0x3ed9b3[_0x42eb('0x2a')],'id');return _0x3ed9b3['removeFaxInteractions'](_0x5025d5)['then'](function(){for(var _0x3baa69=0x0;_0x3baa69<_0x5025d5[_0x42eb('0x20')];_0x3baa69+=0x1){_0x26b24e[_0x42eb('0x48')](_0x42eb('0x4b'),{'FaxInteractionId':Number(_0x5025d5[_0x3baa69]),'UserId':Number(_0x3ed9b3['id'])});}});}})[_0x42eb('0xd')](function(){if(_0x2e932f===_0x42eb('0x46')){var _0x2da129=_[_0x42eb('0x19')](_0x3ed9b3['SmsInteractions'],'id');return _0x3ed9b3[_0x42eb('0x4c')](_0x2da129)[_0x42eb('0xd')](function(){for(var _0x10eb6c=0x0;_0x10eb6c<_0x2da129['length'];_0x10eb6c+=0x1){_0x26b24e[_0x42eb('0x48')](_0x42eb('0x4d'),{'SmsInteractionId':Number(_0x2da129[_0x10eb6c]),'UserId':Number(_0x3ed9b3['id'])});}});}})['then'](function(){if(_0x2e932f===_0x42eb('0x46')){var _0x5e9d85=_[_0x42eb('0x19')](_0x3ed9b3[_0x42eb('0x2d')],'id');return _0x3ed9b3[_0x42eb('0x4e')](_0x5e9d85)[_0x42eb('0xd')](function(){for(var _0x3d9a70=0x0;_0x3d9a70<_0x5e9d85['length'];_0x3d9a70+=0x1){_0x26b24e[_0x42eb('0x48')](_0x42eb('0x4f'),{'OpenchannelInteractionId':Number(_0x5e9d85[_0x3d9a70]),'UserId':Number(_0x3ed9b3['id'])});}});}})[_0x42eb('0x50')](function(_0x517fb2){_0x3df25b[_0x42eb('0x51')](_0x517fb2);});}}function onDisconnect(_0xffc729,_0x55fdc3){joinOrLeave(_0xffc729,_0x42eb('0x46'),_0x55fdc3);}function onConnect(_0x2fe91b){joinOrLeave(_0x2fe91b,_0x42eb('0x52'));}exports['default']=function(_0x4e630a){_0x4e630a['on'](_0x42eb('0x53'),function(_0x586459){_0x586459[_0x42eb('0x54')](0x0);_0x586459['address']=_0x586459[_0x42eb('0x55')][_0x42eb('0x53')][_0x42eb('0x56')]+':'+_0x586459['request'][_0x42eb('0x53')][_0x42eb('0x57')];_0x586459[_0x42eb('0x58')]=new Date();_0x586459[_0x42eb('0x51')]=function(_0x42c162){console[_0x42eb('0x51')](_0x42eb('0x59')+_0x586459[_0x42eb('0x5a')][_0x42eb('0x5')]+'['+_0x586459[_0x42eb('0x5b')]+']',_0x42c162);};_0x586459['on'](_0x42eb('0x5c'),function(){onDisconnect(_0x586459,_0x4e630a);_0x586459['log'](_0x42eb('0x5d'));});onConnect(_0x586459);_0x586459[_0x42eb('0x51')](_0x42eb('0x5e'));});}; \ No newline at end of file +var _0x0164=['openchannel','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','type','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','User','where','telephone','Campaign','format','%s:queue:%s','length','query','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','FaxQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail'];(function(_0x54b312,_0x4de2d1){var _0xb5e87f=function(_0x408968){while(--_0x408968){_0x54b312['push'](_0x54b312['shift']());}};_0xb5e87f(++_0x4de2d1);}(_0x0164,0x12b));var _0x4016=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x0164[_0x4704dc];return _0x254d81;};'use strict';var _=require(_0x4016('0x0'));var util=require(_0x4016('0x1'));var BPromise=require(_0x4016('0x2'));var db=require(_0x4016('0x3'))['db'];var config=require(_0x4016('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x4016('0x5'),'model':db['User'],'attributes':['id',_0x4016('0x6'),_0x4016('0x7')],'raw':!![],'where':{'role':_0x4016('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4016('0x6')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x4016('0x6')],'where':{'role':_0x4016('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4016('0x6'),_0x4016('0x9')],'where':{'type':_0x4016('0xa')}};function getAssociatedResources(_0x3016b8,_0x1fa52e,_0x42feac){return db['UserProfileSection'][_0x4016('0xb')]({'where':{'name':_0x3016b8,'userProfileId':_0x1fa52e},'raw':!![]})['then'](function(_0x5b4271){if(_0x5b4271){if(_0x5b4271[_0x4016('0xc')]){switch(_0x3016b8){case _0x4016('0xd'):case _0x4016('0xe'):case'FaxQueues':case _0x4016('0xf'):case'MailQueues':case _0x4016('0x10'):return db[_0x42feac][_0x4016('0x11')](queryQueues);case'Telephones':return db[_0x42feac][_0x4016('0x11')](queryTelephones);case _0x4016('0x12'):return db[_0x42feac]['findAll'](queryTrunks);case _0x4016('0x13'):return db[_0x42feac][_0x4016('0x11')](queryCampaigns);}}else{return db[_0x4016('0x14')]['findAll']({'attributes':[_0x4016('0x15')],'where':{'sectionId':_0x5b4271['id']},'raw':!![]})[_0x4016('0x16')](function(_0x4a9583){if(_0x4a9583){var _0x415fa7={'where':{'id':_[_0x4016('0x17')](_0x4a9583,_0x4016('0x15'))},'raw':!![]};switch(_0x42feac){case _0x4016('0x18'):_0x415fa7[_0x4016('0x19')][_0x4016('0x7')]=_0x4016('0x1a');break;case _0x4016('0x1b'):_0x415fa7[_0x4016('0x19')][_0x4016('0x9')]='ivr';break;}return db[_0x42feac][_0x4016('0x11')](_0x415fa7);}else{return[];}});}}else{return[];}})['then'](function(_0x4cd024){return _0x4cd024;});}function joinOrLeaveQueues(_0x5073f7,_0x1c1159,_0x2e1f47,_0x1a1328){_0x5073f7[_0x1c1159](util[_0x4016('0x1c')](_0x4016('0x1d'),_0x2e1f47,_0x1a1328[_0x4016('0x6')]));if(_0x1a1328[_0x4016('0x5')]){for(var _0x3f7f65=0x0;_0x3f7f65<_0x1a1328[_0x4016('0x5')][_0x4016('0x1e')];_0x3f7f65+=0x1){_0x5073f7[_0x1c1159](util[_0x4016('0x1c')]('user:%s',_0x1a1328[_0x4016('0x5')][_0x3f7f65][_0x4016('0x6')]));}}}function joinOrLeave(_0xf450c3,_0x4f2b46,_0x13dd58){var _0x5afd56;if(_0xf450c3['handshake'][_0x4016('0x1f')]['id']){db['User']['find']({'attributes':['id',_0x4016('0x6'),'role',_0x4016('0x20')],'where':{'id':_0xf450c3['handshake'][_0x4016('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x4016('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x4016('0x22')],'as':_0x4016('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4016('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x4016('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4016('0x26')],'as':_0x4016('0x27'),'attributes':['id'],'raw':!![]}]})[_0x4016('0x16')](function(_0x502e2b){if(_0x502e2b){_0x5afd56=_0x502e2b;_0xf450c3[_0x4f2b46](util[_0x4016('0x1c')](_0x4016('0x28'),_0x502e2b[_0x4016('0x6')]));var _0xad4393=[];switch(_0x502e2b[_0x4016('0x7')]){case'admin':_0xf450c3[_0x4f2b46](_0x4016('0x29'));_0xf450c3[_0x4f2b46](_0x4016('0x2a'));if(queryQueues[_0x4016('0x2b')](_0x4016('0x2c'))){delete queryQueues[_0x4016('0x2c')];}_0xad4393[_0x4016('0x2d')](db[_0x4016('0x2e')][_0x4016('0x11')](queryQueues));_0xad4393[_0x4016('0x2d')](db[_0x4016('0x2f')][_0x4016('0x11')](queryQueues));_0xad4393['push'](db[_0x4016('0x30')][_0x4016('0x11')](queryQueues));_0xad4393[_0x4016('0x2d')](db[_0x4016('0x31')]['findAll'](queryQueues));_0xad4393['push'](db[_0x4016('0x32')][_0x4016('0x11')](queryQueues));_0xad4393['push'](db[_0x4016('0x33')][_0x4016('0x11')](queryQueues));_0xad4393[_0x4016('0x2d')](db['User'][_0x4016('0x11')](queryTelephones));_0xad4393['push'](db[_0x4016('0x34')][_0x4016('0x11')](queryTrunks));_0xad4393[_0x4016('0x2d')](db[_0x4016('0x1b')]['findAll'](queryCampaigns));_0xad4393['push'](db['User'][_0x4016('0x11')](queryAgents));break;case _0x4016('0x35'):_0xf450c3[_0x4f2b46](_0x4016('0x29'));_0xf450c3[_0x4f2b46]('voice:outbound');_0xad4393[_0x4016('0x2d')](getAssociatedResources(_0x4016('0xd'),_0x502e2b['userProfileId'],_0x4016('0x2e')));_0xad4393['push'](getAssociatedResources('ChatQueues',_0x502e2b[_0x4016('0x20')],'ChatQueue'));_0xad4393[_0x4016('0x2d')](getAssociatedResources(_0x4016('0x36'),_0x502e2b[_0x4016('0x20')],_0x4016('0x30')));_0xad4393['push'](getAssociatedResources(_0x4016('0xf'),_0x502e2b[_0x4016('0x20')],_0x4016('0x31')));_0xad4393['push'](getAssociatedResources('MailQueues',_0x502e2b[_0x4016('0x20')],_0x4016('0x32')));_0xad4393['push'](getAssociatedResources(_0x4016('0x10'),_0x502e2b[_0x4016('0x20')],_0x4016('0x33')));_0xad4393['push'](getAssociatedResources('Telephones',_0x502e2b[_0x4016('0x20')],_0x4016('0x18')));_0xad4393['push'](getAssociatedResources(_0x4016('0x12'),_0x502e2b[_0x4016('0x20')],_0x4016('0x34')));_0xad4393[_0x4016('0x2d')](getAssociatedResources(_0x4016('0x13'),_0x502e2b[_0x4016('0x20')],'Campaign'));_0xad4393[_0x4016('0x2d')](db[_0x4016('0x18')][_0x4016('0x11')](queryAgents));break;case _0x4016('0x8'):_0xf450c3[_0x4f2b46](_0x4016('0x29'));_0xf450c3[_0x4f2b46](_0x4016('0x2a'));_0xad4393['push'](_0x502e2b['getVoiceQueues']({'attributes':['id','name']}));_0xad4393[_0x4016('0x2d')](_0x502e2b[_0x4016('0x37')]({'attributes':['id',_0x4016('0x6')]}));_0xad4393[_0x4016('0x2d')](_0x502e2b[_0x4016('0x38')]({'attributes':['id',_0x4016('0x6')]}));_0xad4393[_0x4016('0x2d')](_0x502e2b['getSmsQueues']({'attributes':['id',_0x4016('0x6')]}));_0xad4393[_0x4016('0x2d')](_0x502e2b[_0x4016('0x39')]({'attributes':['id','name']}));_0xad4393[_0x4016('0x2d')](_0x502e2b[_0x4016('0x3a')]({'attributes':['id',_0x4016('0x6')]}));break;}return BPromise[_0x4016('0x3b')](_0xad4393);}})[_0x4016('0x16')](function(_0x258064){if(_0x258064&&_0x258064['length']){for(var _0xab6e6a=0x0;_0xab6e6a<_0x258064[_0x4016('0x1e')];_0xab6e6a+=0x1){for(var _0x3e990b=0x0;_0x3e990b<_0x258064[_0xab6e6a]['length'];_0x3e990b+=0x1){switch(_0xab6e6a){case 0x0:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x3c'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x1:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x3d'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x2:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x3e'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x3:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x3f'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x4:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x40'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x5:joinOrLeaveQueues(_0xf450c3,_0x4f2b46,_0x4016('0x41'),_0x258064[_0xab6e6a][_0x3e990b]);break;case 0x6:_0xf450c3[_0x4f2b46](util[_0x4016('0x1c')]('telephone:%s',_0x258064[_0xab6e6a][_0x3e990b]['name']));break;case 0x7:_0xf450c3[_0x4f2b46](util[_0x4016('0x1c')](_0x4016('0x42'),_0x258064[_0xab6e6a][_0x3e990b][_0x4016('0x6')]));break;case 0x8:_0xf450c3[_0x4f2b46](util[_0x4016('0x1c')](_0x4016('0x43'),_0x258064[_0xab6e6a][_0x3e990b]['type'],_0x258064[_0xab6e6a][_0x3e990b][_0x4016('0x6')]));break;case 0x9:_0xf450c3[_0x4f2b46](util[_0x4016('0x1c')]('user:%s',_0x258064[_0xab6e6a][_0x3e990b][_0x4016('0x6')]));break;}}}}})['then'](function(){if(_0x4f2b46===_0x4016('0x44')){var _0x540f06=_[_0x4016('0x17')](_0x5afd56[_0x4016('0x21')],'id');return _0x5afd56['removeChatInteractions'](_0x540f06)[_0x4016('0x16')](function(){for(var _0xbcd084=0x0;_0xbcd084<_0x540f06[_0x4016('0x1e')];_0xbcd084+=0x1){_0x13dd58[_0x4016('0x45')](_0x4016('0x46'),{'ChatInteractionId':Number(_0x540f06[_0xbcd084]),'UserId':Number(_0x5afd56['id'])});}});}})[_0x4016('0x16')](function(){if(_0x4f2b46===_0x4016('0x44')){var _0x27448e=_[_0x4016('0x17')](_0x5afd56[_0x4016('0x23')],'id');return _0x5afd56[_0x4016('0x47')](_0x27448e)[_0x4016('0x16')](function(){for(var _0x16942f=0x0;_0x16942f<_0x27448e[_0x4016('0x1e')];_0x16942f+=0x1){_0x13dd58[_0x4016('0x45')](_0x4016('0x48'),{'MailInteractionId':Number(_0x27448e[_0x16942f]),'UserId':Number(_0x5afd56['id'])});}});}})[_0x4016('0x16')](function(){if(_0x4f2b46===_0x4016('0x44')){var _0x51e088=_[_0x4016('0x17')](_0x5afd56[_0x4016('0x24')],'id');return _0x5afd56[_0x4016('0x49')](_0x51e088)[_0x4016('0x16')](function(){for(var _0x3b7c0c=0x0;_0x3b7c0c<_0x51e088[_0x4016('0x1e')];_0x3b7c0c+=0x1){_0x13dd58[_0x4016('0x45')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x51e088[_0x3b7c0c]),'UserId':Number(_0x5afd56['id'])});}});}})[_0x4016('0x16')](function(){if(_0x4f2b46==='leave'){var _0x26d044=_[_0x4016('0x17')](_0x5afd56[_0x4016('0x25')],'id');return _0x5afd56[_0x4016('0x4a')](_0x26d044)[_0x4016('0x16')](function(){for(var _0x81f048=0x0;_0x81f048<_0x26d044[_0x4016('0x1e')];_0x81f048+=0x1){_0x13dd58[_0x4016('0x45')](_0x4016('0x4b'),{'SmsInteractionId':Number(_0x26d044[_0x81f048]),'UserId':Number(_0x5afd56['id'])});}});}})['then'](function(){if(_0x4f2b46==='leave'){var _0x2e48ee=_[_0x4016('0x17')](_0x5afd56[_0x4016('0x27')],'id');return _0x5afd56[_0x4016('0x4c')](_0x2e48ee)[_0x4016('0x16')](function(){for(var _0x5e05ec=0x0;_0x5e05ec<_0x2e48ee[_0x4016('0x1e')];_0x5e05ec+=0x1){_0x13dd58['emit'](_0x4016('0x4d'),{'OpenchannelInteractionId':Number(_0x2e48ee[_0x5e05ec]),'UserId':Number(_0x5afd56['id'])});}});}})[_0x4016('0x4e')](function(_0x5691a4){_0xf450c3[_0x4016('0x4f')](_0x5691a4);});}}function onDisconnect(_0x3e260e,_0x2c2264){joinOrLeave(_0x3e260e,_0x4016('0x44'),_0x2c2264);}function onConnect(_0x59f3a9){joinOrLeave(_0x59f3a9,_0x4016('0x50'));}exports[_0x4016('0x51')]=function(_0x45ed0d){_0x45ed0d['on'](_0x4016('0x52'),function(_0x1527bc){_0x1527bc['setMaxListeners'](0x0);_0x1527bc[_0x4016('0x53')]=_0x1527bc[_0x4016('0x54')][_0x4016('0x52')][_0x4016('0x55')]+':'+_0x1527bc[_0x4016('0x54')][_0x4016('0x52')][_0x4016('0x56')];_0x1527bc[_0x4016('0x57')]=new Date();_0x1527bc[_0x4016('0x4f')]=function(_0x1eee95){console['log']('SocketIO\x20'+_0x1527bc['nsp'][_0x4016('0x6')]+'['+_0x1527bc['address']+']',_0x1eee95);};_0x1527bc['on'](_0x4016('0x58'),function(){onDisconnect(_0x1527bc,_0x45ed0d);_0x1527bc['log'](_0x4016('0x59'));});onConnect(_0x1527bc);_0x1527bc[_0x4016('0x4f')](_0x4016('0x5a'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 9aa9833..d1b7bad 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 _0x3084=['info','Trigger,\x20%s','error','catch','channel','event','direction','UserId','User','find','name','interface','format','SIP/%s','get','closed','then','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3084,0x7e));var _0x4308=function(_0x5f1882,_0x3125fb){_0x5f1882=_0x5f1882-0x0;var _0x546e6d=_0x3084[_0x5f1882];return _0x546e6d;};'use strict';var util=require(_0x4308('0x0'));var db=require(_0x4308('0x1'))['db'];var jayson=require(_0x4308('0x2'));var logger=require('../logger')(_0x4308('0x3'));var client=jayson[_0x4308('0x4')][_0x4308('0x5')]({'port':0x232a});var triggers=[{'channel':_0x4308('0x6'),'model':_0x4308('0x7'),'event':_0x4308('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4308('0x6'),'model':'ChatInteraction','event':_0x4308('0x9'),'condition':_0x4308('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0x4308('0xb'),'event':_0x4308('0x8'),'condition':_0x4308('0xc'),'callback':afterCreateMessage},{'channel':_0x4308('0xd'),'model':_0x4308('0xe'),'event':_0x4308('0x8'),'condition':_0x4308('0xf'),'callback':afterCreate},{'channel':'Sms','model':_0x4308('0xe'),'event':_0x4308('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x4308('0x10'),'event':_0x4308('0x8'),'condition':_0x4308('0xf'),'callback':afterCreate},{'channel':_0x4308('0x11'),'model':_0x4308('0x10'),'event':_0x4308('0x9'),'condition':_0x4308('0xa'),'callback':afterUpdate},{'channel':'Fax','model':_0x4308('0x12'),'event':_0x4308('0x8'),'condition':_0x4308('0xc'),'callback':afterCreateMessage},{'channel':_0x4308('0x13'),'model':_0x4308('0x14'),'event':'afterCreate','condition':_0x4308('0xf'),'callback':afterCreate},{'channel':_0x4308('0x13'),'model':'MailInteraction','event':_0x4308('0x9'),'condition':_0x4308('0xa'),'callback':afterUpdate},{'channel':_0x4308('0x13'),'model':_0x4308('0x15'),'event':_0x4308('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4308('0x16'),'model':_0x4308('0x17'),'event':'afterCreate','condition':_0x4308('0xf'),'callback':afterCreate},{'channel':'Openchannel','model':_0x4308('0x17'),'event':_0x4308('0x9'),'condition':_0x4308('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x4308('0x18'),'event':_0x4308('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x14867b){return client[_0x4308('0x19')](_0x4308('0x1a'),_0x14867b)['then'](function(_0x5ba8df){logger[_0x4308('0x1b')](_0x4308('0x1c'),'EventManager',_0x5ba8df);if(_0x5ba8df[_0x4308('0x1d')]){if(_0x5ba8df[_0x4308('0x1d')]['code']===0x1f4){logger[_0x4308('0x1d')](_0x4308('0x1c'),_0x4308('0x1a'),_0x5ba8df[_0x4308('0x1d')]);}}})[_0x4308('0x1e')](function(_0x322f0a){logger['error']('Trigger,\x20%s',_0x4308('0x1a'),_0x322f0a);});}function afterCreateMessage(_0x123e0b,_0x4d9a3b){return function(_0x252421,_0xc4e0b8){_0x252421=_0x252421['get']({'plain':!![]});_0x252421[_0x4308('0x1f')]=_0x123e0b;_0x252421[_0x4308('0x20')]=_0x252421[_0x4308('0x21')];if(_0x252421[_0x4308('0x22')]){return db[_0x4308('0x23')][_0x4308('0x24')]({'where':{'id':_0x252421['UserId']},'attributes':['id',_0x4308('0x25')],'raw':!![]})['then'](function(_0x8db45b){_0x252421[_0x4308('0x26')]=util[_0x4308('0x27')](_0x4308('0x28'),_0x8db45b[_0x4308('0x25')]);_0x252421['channel']=_0x123e0b;return request({'event':'incomingmessage','message':_0x252421});})[_0x4308('0x1e')](function(_0x3707e6){console[_0x4308('0x1d')](_0x3707e6);});}else{return request({'event':'outgoingmessage','message':_0x252421});}};}function afterCreate(_0x311b3c,_0x5c5d6f){return function(_0x106390,_0x25871c){_0x106390=_0x106390[_0x4308('0x29')]({'plain':!![]});_0x106390[_0x4308('0x1f')]=_0x311b3c;_0x106390[_0x4308('0x20')]='opened';return request({'event':_0x5c5d6f,'message':_0x106390});};}function afterUpdate(_0x2334b7,_0x3f6e24){return function(_0x181318,_0x176c16){if(_0x181318['changed'](_0x4308('0x2a'))&&_0x181318[_0x4308('0x2a')]){_0x181318=_0x181318[_0x4308('0x29')]({'plain':!![]});_0x181318[_0x4308('0x1f')]=_0x2334b7;_0x181318[_0x4308('0x20')]=_0x4308('0x2a');if(_0x181318[_0x4308('0x22')]){return db[_0x4308('0x23')][_0x4308('0x24')]({'where':{'id':_0x181318[_0x4308('0x22')]},'attributes':['id',_0x4308('0x25')],'raw':!![]})[_0x4308('0x2b')](function(_0x53212c){_0x181318[_0x4308('0x26')]=util[_0x4308('0x27')]('SIP/%s',_0x53212c[_0x4308('0x25')]);return request({'event':_0x3f6e24,'message':_0x181318});})[_0x4308('0x1e')](function(_0x4e3524){console['error'](_0x4e3524);});}else{return request({'event':_0x3f6e24,'message':_0x181318});}}};}exports[_0x4308('0x2c')]=function(){for(var _0x26fae3=0x0;_0x26fae3=_0x4fa10e[_0x90df('0x13')]){throw Error(_0x90df('0x14'));}_0x409cb6(_0x56abd9);})[_0x90df('0x15')](function(_0x2945ae){_0x32ff49(_0x2945ae);});});}; \ No newline at end of file +var _0xc35a=['sms','getChannels','isValidChannel','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','chat'];(function(_0x38a0b4,_0x137b1e){var _0x4ea0e1=function(_0x53442f){while(--_0x53442f){_0x38a0b4['push'](_0x38a0b4['shift']());}};_0x4ea0e1(++_0x137b1e);}(_0xc35a,0x7e));var _0xac35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc35a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac35('0x0'));var BPromise=require('bluebird');var db=require(_0xac35('0x1'))['db'];var util=require(_0xac35('0x2'));var channels=[_0xac35('0x3'),_0xac35('0x4'),_0xac35('0x5'),'fax',_0xac35('0x6'),'openchannel'];exports[_0xac35('0x7')]=function(){return channels;};exports[_0xac35('0x8')]=function(_0x2b8d22){_0x2b8d22=_0x2b8d22['toLowerCase']();return _[_0xac35('0x9')](channels,_0x2b8d22);};exports[_0xac35('0xa')]=function(_0x528cc6,_0x314b78,_0x4037e8,_0x156dcd){var _0x2cec29={'loginAttempts':_0x314b78,'blocked':_0x4037e8};if(!_['isUndefined'](_0x156dcd)){_0x2cec29[_0xac35('0xb')]=_0x156dcd;}return _0x528cc6[_0xac35('0xc')](_0x2cec29);};exports[_0xac35('0xd')]=function(_0x26c38f){return new BPromise(function(_0x914b65,_0x294cc9){var _0x267f86=0x0;if(_0x26c38f[_0xac35('0xe')]!=='agent'){_0x914b65(_0x26c38f);}db[_0xac35('0xf')][_0xac35('0x10')]({'where':{'role':_0xac35('0x11'),'online':!![],'id':{'$ne':_0x26c38f['id']}}})['then'](function(_0x5daa59){_0x267f86=_0x5daa59;return util[_0xac35('0xd')]();})[_0xac35('0x12')](function(_0x1fa75d){if(_0x1fa75d&&_0x1fa75d[_0xac35('0x13')]&&_0x267f86>=_0x1fa75d[_0xac35('0x13')]){throw Error(_0xac35('0x14'));}_0x914b65(_0x26c38f);})[_0xac35('0x15')](function(_0x36b294){_0x294cc9(_0x36b294);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7ee8ad9..73f0cea 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15b5=['status','render','json','exports'];(function(_0x1b5a2d,_0x63c7b){var _0x1a630e=function(_0x2c6a40){while(--_0x2c6a40){_0x1b5a2d['push'](_0x1b5a2d['shift']());}};_0x1a630e(++_0x63c7b);}(_0x15b5,0x9b));var _0x515b=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x15b5[_0x3a6e4b];return _0x36572d;};'use strict';module[_0x515b('0x0')][0x194]=function pageNotFound(_0x5d5b82,_0x58d642){var _0x131bed='404';var _0x2639fd=0x194;var _0x56dfee={'status':_0x2639fd};_0x58d642[_0x515b('0x1')](_0x56dfee[_0x515b('0x1')]);_0x58d642[_0x515b('0x2')](_0x131bed,{},function(_0x2d17ba,_0xbcdf2f){if(_0x2d17ba){return _0x58d642[_0x515b('0x1')](_0x56dfee[_0x515b('0x1')])[_0x515b('0x3')](_0x56dfee);}_0x58d642['send'](_0xbcdf2f);});}; \ No newline at end of file +var _0x0d4d=['404','status','render','json','exports'];(function(_0x558da5,_0x13e646){var _0x36276b=function(_0x5c7c44){while(--_0x5c7c44){_0x558da5['push'](_0x558da5['shift']());}};_0x36276b(++_0x13e646);}(_0x0d4d,0x103));var _0xd0d4=function(_0x2a7c14,_0x28fb0c){_0x2a7c14=_0x2a7c14-0x0;var _0x207875=_0x0d4d[_0x2a7c14];return _0x207875;};'use strict';module[_0xd0d4('0x0')][0x194]=function pageNotFound(_0xf9c6b7,_0x406658){var _0x6784a0=_0xd0d4('0x1');var _0x2c0fb0=0x194;var _0x2369cb={'status':_0x2c0fb0};_0x406658[_0xd0d4('0x2')](_0x2369cb['status']);_0x406658[_0xd0d4('0x3')](_0x6784a0,{},function(_0x544aac,_0xdf0044){if(_0x544aac){return _0x406658[_0xd0d4('0x2')](_0x2369cb[_0xd0d4('0x2')])[_0xd0d4('0x4')](_0x2369cb);}_0x406658['send'](_0xdf0044);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9410f92..bdd839f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda91=['FaxApplications','SmsApplications','Schedule','AnalyticCustomReport','CustomReportId','Mohs','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Description','DescriptionId','Field','Variable','VariableId','Configurations','int_desk_configuration_has_tags','Subject','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','int_vtiger_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','user_has_teams','VoiceQueues','MailQueues','team_has_fax_queues','SmsQueues','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','CrmWorkflowStep','WorkflowId','SADossier','WorkflowStepId','CrmWorkflowNextStep','crm_workflow_steps_has_crm_workflow_steps','TaskId','TypeProductId','SAProductPricesList','ProductId','SaleCondition','TypeSalesConditionId','UnitMeasure','UnitMeasureId','TypeProduct','PriceListId','SAProductQuotation','ProductPriceList','ProductPriceListId','Product','Pricelist','DossierId','Workflow','WorkflowStep','RequestId','Requests','SARequest','Dossier','Quotations','QuotationId','Request','Quotation','ProformaId','SAInvoice','Invoice','Orders','OrderId','Proforma','SAProformaDetail','Order','InvoiceId','Details','CreditNote','CreditNoteId','CompanyRelationship','saCompanyRelationship','path','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8_general_ci','defaultsDeep','sequelizeHistory','name','utf8','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../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','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','Integration','../api/integration/integration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','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/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','CrmNation','../api/crmNation/crmNation.model','CrmWorkflow','../api/crmWorkflow/crmWorkflow.model','../api/crmWorkflowstep/crmWorkflowstep.model','CrmTask','CrmActionsList','SATypeProduct','../api/saTypeProduct/saTypeProduct.model','SAUnitMeasure','SAInvoiceLaw','../api/saInvoiceLaw/saInvoiceLaw.model','SAProduct','SASalesCondition','../api/saSalesCondition/saSalesCondition.model','SAPriceList','../api/saPriceList/saPriceList.model','../api/saProductPricesList/saProductPricesList.model','../api/saRequest/saRequest.model','SAQuotation','../api/saQuotation/saQuotation.model','../api/saProductQuotation/saProductQuotation.model','SAOrder','../api/saOrder/saOrder.model','SAProforma','../api/saInvoice/saInvoice.model','SAAsset','../api/saAsset/saAsset.model','SAInvoiceDetail','../api/saInvoiceDetail/saInvoiceDetail.model','../api/saProformaDetail/saProformaDetail.model','SAPayment','../api/saPayment/saPayment.model','SAPaymentMethod','SACreditNote','../api/saCreditNote/saCreditNote.model','SACreditNoteDetail','../api/saCreditNoteDetail/saCreditNoteDetail.model','SAInvoiceNumber','../api/saInvoiceNumber/saInvoiceNumber.model','SACreditNoteNumber','../api/saCreditNoteNumber/saCreditNoteNumber.model','SACompanyType','../api/saCompanyType/saCompanyType.model','SACompanyRelationship','../api/saCompanyRelationship/saCompanyRelationship.model','hasOne','cascade','UserId','hasMany','Extensions','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_fax_interactions','user_has_openchannel_interactions','VoiceQueue','ChatQueue','ChatQueues','FaxQueue','UserSmsQueue','OpenchannelQueues','UserOpenchannelQueue','user_has_voice_prefixes','ChatWebsites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','CmList','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','List','ListId','Pause','MailQueue','team_has_mail_queues','MailInteractionId','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Account','restrict','TagId','FaxAccountId','Interactions','FaxApplication','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsMessage','SmsAccountId','SmsInteractionId','Owner','sms_interaction_has_tags','user_has_sms_interactions','Interaction','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Website','RelatedCompany','CompanyId','PriceLists','Dossiers','PaymentMethod','saPaymentMethod','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','AutomationAnyId','Actions','Intervals','MailApplications','ChatApplications'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xda91,0x72));var _0x1da9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xda91[_0x3947c9];return _0x2e7871;};'use strict';var path=require(_0x1da9('0x0'));var config=require('../config/environment');var Sequelize=require(_0x1da9('0x1'));var _=require(_0x1da9('0x2'));var jstz=require(_0x1da9('0x3'));var timezone=jstz[_0x1da9('0x4')]();config['sequelize']=_['defaultsDeep'](config[_0x1da9('0x1')],{'database':_0x1da9('0x5'),'username':_0x1da9('0x6'),'password':_0x1da9('0x7'),'options':{'host':_0x1da9('0x8'),'port':0xcea,'dialect':_0x1da9('0x9'),'dialectOptions':{'charset':_0x1da9('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x1da9('0xb')}}});config['sequelizeHistory']=_[_0x1da9('0xc')](config[_0x1da9('0xd')],{'database':'motion2','username':_0x1da9('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x1da9('0x9'),'dialectOptions':{'charset':_0x1da9('0xa')},'logging':![],'timezone':timezone[_0x1da9('0xe')](),'define':{'charset':_0x1da9('0xf'),'collate':_0x1da9('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1da9('0x1')]['database'],config[_0x1da9('0x1')][_0x1da9('0x10')],config[_0x1da9('0x1')][_0x1da9('0x11')],config[_0x1da9('0x1')][_0x1da9('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1da9('0xd')]['database'],config[_0x1da9('0xd')]['username'],config['sequelizeHistory']['password'],config['sequelizeHistory'][_0x1da9('0x12')])};db[_0x1da9('0x13')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x15'));db[_0x1da9('0x16')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x17'));db[_0x1da9('0x18')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x19'));db[_0x1da9('0x1a')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x1da9('0x1b')]=db['sequelize']['import'](_0x1da9('0x1c'));db['VoiceQueue']=db[_0x1da9('0x1')]['import'](_0x1da9('0x1d'));db[_0x1da9('0x1e')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x1f'));db[_0x1da9('0x20')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0x1da9('0x21')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x22'));db['VoiceCallReport']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x23'));db[_0x1da9('0x24')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x25'));db[_0x1da9('0x26')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x1da9('0x27')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x28'));db[_0x1da9('0x29')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x2a'));db[_0x1da9('0x2b')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x2c'));db['VoiceTransferReport']=db[_0x1da9('0x1')]['import'](_0x1da9('0x2d'));db[_0x1da9('0x2e')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x1da9('0x2f')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x30'));db[_0x1da9('0x31')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x32'));db[_0x1da9('0x33')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x34'));db[_0x1da9('0x35')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x36'));db['UserSmsQueue']=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x37'));db['MailServerIn']=db['sequelize'][_0x1da9('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x1da9('0x38')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x39'));db[_0x1da9('0x3a')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x3b'));db['MailQueue']=db[_0x1da9('0x1')]['import'](_0x1da9('0x3c'));db[_0x1da9('0x3d')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x3e'));db[_0x1da9('0x3f')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x40'));db[_0x1da9('0x41')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x42'));db[_0x1da9('0x43')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x44'));db[_0x1da9('0x45')]=db['sequelize']['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x1da9('0x46')]=db[_0x1da9('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x1da9('0x47')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x48'));db[_0x1da9('0x49')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x4a'));db['FaxApplication']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x4b'));db[_0x1da9('0x4c')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x1da9('0x4d')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x1da9('0x1')]['import'](_0x1da9('0x4e'));db[_0x1da9('0x4f')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x50'));db[_0x1da9('0x51')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x52'));db[_0x1da9('0x53')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x54'));db[_0x1da9('0x55')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x56'));db['SmsMessage']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x57'));db[_0x1da9('0x58')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x59'));db[_0x1da9('0x5a')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x5b'));db[_0x1da9('0x5c')]=db[_0x1da9('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0x1da9('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db['sequelize'][_0x1da9('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x1da9('0x5d')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x5e'));db['ChatWebsite']=db['sequelize']['import'](_0x1da9('0x5f'));db['OpenchannelQueueReport']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x60'));db[_0x1da9('0x61')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x62'));db[_0x1da9('0x63')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x64'));db[_0x1da9('0x65')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x66'));db[_0x1da9('0x67')]=db[_0x1da9('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x68'));db[_0x1da9('0x69')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x6a'));db[_0x1da9('0x6b')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x6c'));db[_0x1da9('0x6d')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x6e'));db[_0x1da9('0x6f')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x70'));db[_0x1da9('0x71')]=db['sequelize'][_0x1da9('0x14')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x1da9('0x1')]['import'](_0x1da9('0x72'));db[_0x1da9('0x73')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x74'));db[_0x1da9('0x75')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x76'));db[_0x1da9('0x77')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x78'));db['CmCustomField']=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x1da9('0x79')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x7a'));db[_0x1da9('0x7b')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x7c'));db[_0x1da9('0x7d')]=db[_0x1da9('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x1da9('0x7e')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x7f'));db[_0x1da9('0x80')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x81'));db[_0x1da9('0x82')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x83'));db['Pause']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x84'));db[_0x1da9('0x85')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x86'));db[_0x1da9('0x87')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x88'));db['Schedule']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x89'));db[_0x1da9('0x8a')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x8b'));db[_0x1da9('0x8c')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x8d'));db[_0x1da9('0x8e')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x8f'));db[_0x1da9('0x90')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x91'));db['Variable']=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/variable/variable.model');db['Integration']=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/integration/integration.model');db[_0x1da9('0x92')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x93'));db['AnalyticCustomReport']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x94'));db[_0x1da9('0x95')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x96'));db[_0x1da9('0x97')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x98'));db['AnalyticMetric']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x99'));db[_0x1da9('0x9a')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x9b'));db[_0x1da9('0x9c')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x9d'));db[_0x1da9('0x9e')]=db['sequelize']['import'](_0x1da9('0x9f'));db[_0x1da9('0xa0')]=db['sequelize']['import'](_0x1da9('0xa1'));db[_0x1da9('0xa2')]=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xa3'));db[_0x1da9('0xa4')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xa5'));db[_0x1da9('0xa6')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xa7'));db[_0x1da9('0xa8')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xa9'));db[_0x1da9('0xaa')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xab'));db[_0x1da9('0xac')]=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0x1da9('0xad')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x1da9('0xae')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xaf'));db[_0x1da9('0xb0')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xb1'));db[_0x1da9('0xb2')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x1da9('0xb3')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xb4'));db[_0x1da9('0xb5')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xb6'));db[_0x1da9('0xb7')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xb8'));db[_0x1da9('0xb9')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x1da9('0xba')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xbb'));db['VtigerAccount']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xbc'));db[_0x1da9('0xbd')]=db['sequelize']['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x1da9('0xbe')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x1da9('0xbf')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xc0'));db['ServicenowConfiguration']=db[_0x1da9('0x1')]['import'](_0x1da9('0xc1'));db[_0x1da9('0xc2')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xc3'));db[_0x1da9('0xc4')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xc5'));db[_0x1da9('0xc6')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x1da9('0xc7')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xc8'));db['Network']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xc9'));db[_0x1da9('0xca')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xcb'));db[_0x1da9('0xcc')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xcd'));db[_0x1da9('0xce')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xcf'));db[_0x1da9('0xd0')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x1da9('0xd1')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xd2'));db[_0x1da9('0xd3')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xd4'));db[_0x1da9('0xd5')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xd6'));db[_0x1da9('0xd7')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x1da9('0xd8')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xd9'));db[_0x1da9('0xda')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/setting/setting.model');db[_0x1da9('0xdb')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xdc'));db['SquareProject']=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xdd'));db[_0x1da9('0xde')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xdf'));db['SquareMessage']=db[_0x1da9('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0x1da9('0xe0')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xe1'));db['License']=db[_0x1da9('0x1')]['import'](_0x1da9('0xe2'));db[_0x1da9('0xe3')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xe4'));db[_0x1da9('0xe5')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/migration/migration.model');db[_0x1da9('0xe6')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xe7'));db[_0x1da9('0xe8')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/plugin/plugin.model');db[_0x1da9('0xe9')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xea'));db[_0x1da9('0xeb')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xec'));db[_0x1da9('0xed')]=db[_0x1da9('0x1')]['import'](_0x1da9('0xee'));db[_0x1da9('0xef')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xf0'));db[_0x1da9('0xf1')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xf2'));db['CmList']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xf3'));db[_0x1da9('0xf4')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xf5'));db[_0x1da9('0xf6')]=db['sequelize'][_0x1da9('0x14')]('../api/userProfile/userProfile.model');db[_0x1da9('0xf7')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xf8'));db[_0x1da9('0xf9')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xfa'));db[_0x1da9('0xfb')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0xfc'));db[_0x1da9('0xfd')]=db['sequelize']['import'](_0x1da9('0xfe'));db['CrmWorkflowStep']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0xff'));db[_0x1da9('0x100')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/crmTask/crmTask.model');db[_0x1da9('0x101')]=db[_0x1da9('0x1')]['import']('../api/crmActionsList/crmActionsList.model');db[_0x1da9('0x102')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x103'));db[_0x1da9('0x104')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/saUnitMeasure/saUnitMeasure.model');db[_0x1da9('0x105')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x106'));db[_0x1da9('0x107')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/saProduct/saProduct.model');db[_0x1da9('0x108')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x109'));db[_0x1da9('0x10a')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x10b'));db['SAProductPricesList']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x10c'));db['SADossier']=db[_0x1da9('0x1')]['import']('../api/saDossier/saDossier.model');db['SARequest']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x10d'));db[_0x1da9('0x10e')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x10f'));db['SAProductQuotation']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x110'));db[_0x1da9('0x111')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x112'));db[_0x1da9('0x113')]=db[_0x1da9('0x1')][_0x1da9('0x14')]('../api/saProforma/saProforma.model');db['SAInvoice']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x114'));db[_0x1da9('0x115')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x116'));db[_0x1da9('0x117')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x118'));db['SAProformaDetail']=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x119'));db[_0x1da9('0x11a')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x11b'));db[_0x1da9('0x11c')]=db['sequelize'][_0x1da9('0x14')]('../api/saPaymentMethod/saPaymentMethod.model');db[_0x1da9('0x11d')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x11e'));db[_0x1da9('0x11f')]=db[_0x1da9('0x1')]['import'](_0x1da9('0x120'));db[_0x1da9('0x121')]=db['sequelize'][_0x1da9('0x14')](_0x1da9('0x122'));db[_0x1da9('0x123')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x124'));db[_0x1da9('0x125')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x126'));db[_0x1da9('0x127')]=db[_0x1da9('0x1')][_0x1da9('0x14')](_0x1da9('0x128'));db[_0x1da9('0x13')][_0x1da9('0x129')](db['VoiceMail'],{'as':_0x1da9('0x21'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x1e')],{'as':'Recordings','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')]['hasMany'](db[_0x1da9('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x1a')],{'as':_0x1da9('0x12d'),'onDelete':'cascade','hooks':!![]});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x73')],{'as':'HopperFinals','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x75')],{'as':_0x1da9('0x12e'),'foreignKey':'UserId'});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x12f')],{'as':_0x1da9('0x130'),'foreignKey':_0x1da9('0x12b')});db['User'][_0x1da9('0x12c')](db[_0x1da9('0x63')],{'as':_0x1da9('0x131'),'foreignKey':'UserId'});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x55')],{'as':_0x1da9('0x132'),'foreignKey':'UserId'});db[_0x1da9('0x13')][_0x1da9('0x12c')](db[_0x1da9('0x4c')],{'as':_0x1da9('0x133'),'foreignKey':_0x1da9('0x12b')});db['User'][_0x1da9('0x12c')](db[_0x1da9('0x3f')],{'as':_0x1da9('0x134'),'foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x13')][_0x1da9('0x135')](db[_0x1da9('0xf6')],{'as':_0x1da9('0xf6'),'foreignKey':_0x1da9('0x136')});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x69')],{'as':'Groups','through':_0x1da9('0x138')});db['User'][_0x1da9('0x137')](db['CmContact'],{'as':_0x1da9('0x139'),'through':_0x1da9('0x13a')});db[_0x1da9('0x13')][_0x1da9('0x137')](db['CmList'],{'as':_0x1da9('0x13b'),'through':_0x1da9('0x13c')});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0xe0')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0x1da9('0x3f')],{'as':_0x1da9('0x134'),'through':_0x1da9('0x13d')});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x63')],{'as':_0x1da9('0x131'),'through':'user_has_chat_interactions'});db[_0x1da9('0x13')]['belongsToMany'](db['FaxInteraction'],{'as':_0x1da9('0x133'),'through':_0x1da9('0x13e')});db[_0x1da9('0x13')]['belongsToMany'](db[_0x1da9('0x55')],{'as':_0x1da9('0x132'),'through':'user_has_sms_interactions'});db[_0x1da9('0x13')][_0x1da9('0x137')](db['OpenchannelInteraction'],{'as':_0x1da9('0x130'),'through':_0x1da9('0x13f')});db[_0x1da9('0x13')]['belongsToMany'](db[_0x1da9('0x140')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User'][_0x1da9('0x137')](db['MailQueue'],{'as':'MailQueues','through':_0x1da9('0x33'),'required':![]});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x141')],{'as':_0x1da9('0x142'),'through':_0x1da9('0x31'),'required':![],'hooks':!![]});db[_0x1da9('0x13')]['belongsToMany'](db[_0x1da9('0x143')],{'as':'FaxQueues','through':_0x1da9('0x35'),'required':![]});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x58')],{'as':'SmsQueues','through':_0x1da9('0x144'),'required':![]});db['User']['belongsToMany'](db[_0x1da9('0x5d')],{'as':_0x1da9('0x145'),'through':_0x1da9('0x146'),'required':![]});db[_0x1da9('0x13')][_0x1da9('0x137')](db['CmList'],{'through':_0x1da9('0x13c')});db[_0x1da9('0x13')]['belongsToMany'](db[_0x1da9('0xf4')],{'as':'VoicePrefixes','through':_0x1da9('0x147'),'required':![]});db[_0x1da9('0x13')][_0x1da9('0x137')](db['ChatWebsite'],{'as':_0x1da9('0x148'),'through':'user_has_chat_websites'});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x49')],{'as':_0x1da9('0x149'),'through':'user_has_fax_accounts'});db['User'][_0x1da9('0x137')](db[_0x1da9('0x3a')],{'as':'MailAccounts','through':_0x1da9('0x14a')});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x5a')],{'as':_0x1da9('0x14b'),'through':_0x1da9('0x14c')});db['User']['belongsToMany'](db[_0x1da9('0x51')],{'as':_0x1da9('0x14d'),'through':_0x1da9('0x14e')});db[_0x1da9('0x13')][_0x1da9('0x137')](db[_0x1da9('0x14f')],{'as':_0x1da9('0x150'),'through':_0x1da9('0x151')});db[_0x1da9('0x16')]['hasMany'](db[_0x1da9('0x1a')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x1da9('0x152')});db[_0x1da9('0x18')][_0x1da9('0x12c')](db[_0x1da9('0x1a')],{'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x1a')]['hasMany'](db[_0x1da9('0x1a')],{'as':_0x1da9('0x153'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x1b')][_0x1da9('0x137')](db['Sound'],{'as':_0x1da9('0x154'),'through':_0x1da9('0x155')});db[_0x1da9('0x140')][_0x1da9('0x12c')](db[_0x1da9('0x2e')],{'as':_0x1da9('0x156'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')][_0x1da9('0x12c')](db['CmHopper'],{'as':_0x1da9('0x158'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')][_0x1da9('0x12c')](db['CmHopperFinal'],{'as':_0x1da9('0x159'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')]['hasMany'](db[_0x1da9('0x75')],{'as':_0x1da9('0x15a'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x1da9('0x77')],{'as':_0x1da9('0x77'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')][_0x1da9('0x12c')](db[_0x1da9('0x15b')],{'as':_0x1da9('0x15c'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')][_0x1da9('0x12c')](db[_0x1da9('0xd1')],{'as':_0x1da9('0x15d'),'foreignKey':_0x1da9('0x157')});db[_0x1da9('0x140')][_0x1da9('0x135')](db[_0x1da9('0x2b')],{'as':'Trunk','foreignKey':_0x1da9('0x15e')});db[_0x1da9('0x140')][_0x1da9('0x135')](db[_0x1da9('0x2b')],{'as':'TrunkBackup','foreignKey':_0x1da9('0x15f')});db[_0x1da9('0x140')][_0x1da9('0x135')](db[_0x1da9('0x82')],{'as':'Interval','foreignKey':_0x1da9('0x160')});db[_0x1da9('0x140')][_0x1da9('0x135')](db['Pause'],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db[_0x1da9('0x140')][_0x1da9('0x137')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x1da9('0x140')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':'UserVoiceQueue'});db[_0x1da9('0x140')][_0x1da9('0x137')](db['Team'],{'as':_0x1da9('0x164'),'through':_0x1da9('0x165')});db[_0x1da9('0x140')][_0x1da9('0x137')](db[_0x1da9('0x166')],{'as':_0x1da9('0x167'),'through':_0x1da9('0x168')});db[_0x1da9('0x1e')][_0x1da9('0x135')](db['User'],{'as':_0x1da9('0x13'),'foreignKey':'UserId'});db['ScreenRecording'][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':_0x1da9('0x13'),'foreignKey':_0x1da9('0x12b')});db['VoiceMail']['hasMany'](db[_0x1da9('0x169')],{'as':_0x1da9('0x16a'),'onDelete':'cascade','foreignKey':_0x1da9('0x16b'),'sourceKey':_0x1da9('0x16c')});db['VoiceMailMessage'][_0x1da9('0x135')](db[_0x1da9('0x21')],{'foreignKey':_0x1da9('0x16b'),'targetKey':'mailbox'});db[_0x1da9('0x16d')][_0x1da9('0x12c')](db[_0x1da9('0x27')],{'as':_0x1da9('0x16e'),'foreignKey':_0x1da9('0x16f'),'constraints':![]});db[_0x1da9('0x16d')][_0x1da9('0x12c')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x1da9('0x16f'),'constraints':![]});db[_0x1da9('0x16d')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x16d')][_0x1da9('0x135')](db['CmContact'],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x172')][_0x1da9('0x135')](db['MailAccount'],{'as':_0x1da9('0x3a'),'foreignKey':_0x1da9('0x173')});db[_0x1da9('0x38')][_0x1da9('0x135')](db[_0x1da9('0x3a')],{'as':_0x1da9('0x3a'),'foreignKey':_0x1da9('0x173')});db['MailAccount'][_0x1da9('0x129')](db[_0x1da9('0x172')],{'as':_0x1da9('0x174'),'onDelete':'cascade'});db['MailAccount'][_0x1da9('0x129')](db[_0x1da9('0x38')],{'as':_0x1da9('0x175'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x3a')][_0x1da9('0x12c')](db['Disposition'],{'as':_0x1da9('0x176'),'foreignKey':_0x1da9('0x173')});db[_0x1da9('0x3a')][_0x1da9('0x12c')](db['CannedAnswer'],{'as':_0x1da9('0x177'),'foreignKey':_0x1da9('0x173')});db[_0x1da9('0x3a')][_0x1da9('0x12c')](db[_0x1da9('0x41')],{'as':_0x1da9('0x16a'),'foreignKey':_0x1da9('0x173')});db['MailAccount']['hasMany'](db[_0x1da9('0x3f')],{'as':'Interactions'});db[_0x1da9('0x3a')][_0x1da9('0x12c')](db[_0x1da9('0x43')],{'as':'Applications'});db[_0x1da9('0x3a')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db['MailAccount']['belongsTo'](db[_0x1da9('0x8e')],{'as':_0x1da9('0x8e'),'foreignKey':'TemplateId'});db[_0x1da9('0x3a')][_0x1da9('0x135')](db[_0x1da9('0x17a')],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db[_0x1da9('0x3a')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x14a')});db[_0x1da9('0x17b')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x33')});db[_0x1da9('0x17b')][_0x1da9('0x137')](db['Team'],{'through':_0x1da9('0x17c'),'as':_0x1da9('0x164')});db['MailInteraction'][_0x1da9('0x12c')](db[_0x1da9('0x41')],{'as':_0x1da9('0x16a'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x17d')});db[_0x1da9('0x3f')][_0x1da9('0x135')](db[_0x1da9('0x3a')],{'as':'Account','foreignKey':_0x1da9('0x173')});db[_0x1da9('0x3f')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x1da9('0x171')});db['MailInteraction'][_0x1da9('0x135')](db['User'],{'as':'Owner','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x3f')][_0x1da9('0x137')](db['Tag'],{'through':_0x1da9('0x17e'),'as':_0x1da9('0x17f')});db[_0x1da9('0x3f')][_0x1da9('0x137')](db['Tag'],{'through':_0x1da9('0x17e'),'as':_0x1da9('0x180')});db[_0x1da9('0x3f')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x181'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage'][_0x1da9('0x12c')](db[_0x1da9('0xe6')],{'as':_0x1da9('0x182'),'onDelete':_0x1da9('0x12a')});db['MailMessage'][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':_0x1da9('0x13')});db['MailMessage'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'onDelete':'cascade','as':_0x1da9('0x170')});db[_0x1da9('0x41')][_0x1da9('0x135')](db[_0x1da9('0x3f')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0x1da9('0x41')][_0x1da9('0x135')](db['MailAccount'],{'as':_0x1da9('0x183'),'foreignKey':'MailAccountId'});db[_0x1da9('0x43')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x184')});db['MailApplication']['belongsTo'](db['MailQueue'],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x43')][_0x1da9('0x135')](db[_0x1da9('0x3a')],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x43')][_0x1da9('0x135')](db[_0x1da9('0x82')],{'onDelete':'restrict','foreignKey':_0x1da9('0x160')});db['MailApplication'][_0x1da9('0x135')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x1da9('0x185')});db[_0x1da9('0x45')][_0x1da9('0x135')](db[_0x1da9('0x3a')],{});db[_0x1da9('0x45')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db['MailQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x45')]['belongsTo'](db['MailInteraction'],{});db[_0x1da9('0x45')]['belongsTo'](db[_0x1da9('0x41')],{});db[_0x1da9('0x45')]['belongsTo'](db['User'],{});db[_0x1da9('0x45')][_0x1da9('0x135')](db['MailQueue'],{});db[_0x1da9('0x46')][_0x1da9('0x12c')](db[_0x1da9('0x47')],{'as':'Items','onDelete':_0x1da9('0x12a')});db['FaxAccount']['hasMany'](db[_0x1da9('0x7e')],{'as':_0x1da9('0x176'),'foreignKey':_0x1da9('0x186')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x1da9('0x177'),'foreignKey':_0x1da9('0x186')});db['FaxAccount'][_0x1da9('0x12c')](db[_0x1da9('0x4c')],{'as':_0x1da9('0x187')});db['FaxAccount'][_0x1da9('0x12c')](db[_0x1da9('0x188')],{'as':_0x1da9('0x153')});db[_0x1da9('0x49')][_0x1da9('0x12c')](db[_0x1da9('0x1a')],{'as':'Exntensions','onDelete':'cascade'});db[_0x1da9('0x49')][_0x1da9('0x12c')](db[_0x1da9('0x4d')],{'as':'Messages'});db['FaxAccount'][_0x1da9('0x135')](db['Trunk'],{'as':_0x1da9('0x2b')});db[_0x1da9('0x49')]['belongsTo'](db[_0x1da9('0x166')],{'as':'List','foreignKey':_0x1da9('0x179')});db[_0x1da9('0x49')][_0x1da9('0x135')](db['Pause'],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db[_0x1da9('0x49')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x189')});db['FaxApplication'][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x188')][_0x1da9('0x135')](db[_0x1da9('0x143')],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x188')][_0x1da9('0x135')](db[_0x1da9('0x49')],{'onDelete':'restrict'});db[_0x1da9('0x188')]['belongsTo'](db[_0x1da9('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db['FaxInteraction'][_0x1da9('0x12c')](db[_0x1da9('0x4d')],{'as':_0x1da9('0x16a'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x18a')});db[_0x1da9('0x4c')][_0x1da9('0x135')](db[_0x1da9('0x49')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x186')});db[_0x1da9('0x4c')][_0x1da9('0x135')](db['CmContact'],{'as':_0x1da9('0x170'),'foreignKey':'ContactId'});db[_0x1da9('0x4c')][_0x1da9('0x135')](db['User'],{'as':'Owner','foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x4c')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':_0x1da9('0x18b'),'as':_0x1da9('0x17f')});db[_0x1da9('0x4c')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':'fax_interaction_has_tags','as':_0x1da9('0x180')});db[_0x1da9('0x4c')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x181'),'through':_0x1da9('0x13e'),'foreignKey':'FaxInteractionId'});db[_0x1da9('0x4d')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':'cascade','as':_0x1da9('0x13')});db['FaxMessage'][_0x1da9('0x135')](db[_0x1da9('0x4c')],{'as':'Interaction','foreignKey':_0x1da9('0x18a')});db[_0x1da9('0x4d')][_0x1da9('0x135')](db['CmContact'],{'onDelete':_0x1da9('0x12a'),'as':_0x1da9('0x170')});db['FaxMessage'][_0x1da9('0x135')](db['Attachment'],{'as':'Attachment','foreignKey':_0x1da9('0x18c')});db[_0x1da9('0x4d')][_0x1da9('0x135')](db[_0x1da9('0x49')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x186')});db['FaxQueue']['belongsToMany'](db[_0x1da9('0x13')],{'as':'Agents','through':_0x1da9('0x35')});db[_0x1da9('0x143')][_0x1da9('0x137')](db[_0x1da9('0xe0')],{'through':'team_has_fax_queues','as':_0x1da9('0x164')});db['FaxQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x49')],{});db[_0x1da9('0x4f')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x4f')][_0x1da9('0x135')](db['CmContact'],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x4f')][_0x1da9('0x135')](db[_0x1da9('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x13')],{});db[_0x1da9('0x4f')]['belongsTo'](db['FaxQueue'],{});db[_0x1da9('0x51')]['hasMany'](db[_0x1da9('0x7e')],{'as':_0x1da9('0x176'),'foreignKey':'SmsAccountId'});db[_0x1da9('0x51')][_0x1da9('0x12c')](db[_0x1da9('0x7d')],{'as':_0x1da9('0x177'),'foreignKey':'SmsAccountId'});db[_0x1da9('0x51')][_0x1da9('0x12c')](db[_0x1da9('0x18d')],{'as':'Messages','foreignKey':_0x1da9('0x18e')});db['SmsAccount'][_0x1da9('0x12c')](db[_0x1da9('0x55')],{'as':_0x1da9('0x187')});db[_0x1da9('0x51')]['hasMany'](db['SmsApplication'],{'as':_0x1da9('0x153')});db[_0x1da9('0x51')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':'List','foreignKey':'ListId'});db[_0x1da9('0x51')][_0x1da9('0x135')](db[_0x1da9('0x17a')],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db[_0x1da9('0x51')]['belongsToMany'](db['User'],{'as':_0x1da9('0x163'),'through':_0x1da9('0x14e')});db[_0x1da9('0x53')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x53')][_0x1da9('0x135')](db[_0x1da9('0x58')],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x53')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x1da9('0x184')});db[_0x1da9('0x53')][_0x1da9('0x135')](db[_0x1da9('0x82')],{'onDelete':_0x1da9('0x184'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x53')][_0x1da9('0x135')](db[_0x1da9('0x8c')],{'onDelete':_0x1da9('0x184'),'foreignKey':'TagId'});db[_0x1da9('0x55')][_0x1da9('0x12c')](db[_0x1da9('0x18d')],{'as':'Messages','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x18f')});db[_0x1da9('0x55')][_0x1da9('0x135')](db[_0x1da9('0x51')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x18e')});db[_0x1da9('0x55')][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':'Contact','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x55')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':_0x1da9('0x190'),'foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x55')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':_0x1da9('0x191'),'as':_0x1da9('0x17f')});db[_0x1da9('0x55')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction'][_0x1da9('0x137')](db['User'],{'as':_0x1da9('0x181'),'through':_0x1da9('0x192'),'foreignKey':'SmsInteractionId'});db[_0x1da9('0x18d')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':'User'});db[_0x1da9('0x18d')]['belongsTo'](db[_0x1da9('0x6f')],{'onDelete':_0x1da9('0x12a'),'as':_0x1da9('0x170')});db['SmsMessage'][_0x1da9('0x135')](db[_0x1da9('0x55')],{'onDelete':_0x1da9('0x12a'),'as':_0x1da9('0x193'),'foreignKey':_0x1da9('0x18f')});db[_0x1da9('0x18d')][_0x1da9('0x135')](db['SmsAccount'],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x18e')});db[_0x1da9('0x58')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x144'),'foreignKey':_0x1da9('0x194')});db['SmsQueue'][_0x1da9('0x137')](db[_0x1da9('0xe0')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x1da9('0x5a')][_0x1da9('0x12c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1da9('0x195')});db['OpenchannelAccount'][_0x1da9('0x12c')](db[_0x1da9('0x7d')],{'as':_0x1da9('0x177'),'foreignKey':'OpenchannelAccountId'});db[_0x1da9('0x5a')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1da9('0x187'),'foreignKey':'OpenchannelAccountId'});db[_0x1da9('0x5a')][_0x1da9('0x12c')](db['OpenchannelMessage'],{'as':_0x1da9('0x16a'),'foreignKey':_0x1da9('0x195')});db[_0x1da9('0x5a')]['hasMany'](db[_0x1da9('0x5c')],{'as':_0x1da9('0x153'),'foreignKey':_0x1da9('0x195')});db[_0x1da9('0x5a')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x5a')]['belongsTo'](db[_0x1da9('0x17a')],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db[_0x1da9('0x5a')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':'Agents','through':_0x1da9('0x14c')});db[_0x1da9('0x5c')][_0x1da9('0x135')](db['User'],{'onDelete':'restrict'});db[_0x1da9('0x5c')][_0x1da9('0x135')](db[_0x1da9('0x5d')],{'onDelete':_0x1da9('0x184'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x1da9('0x135')](db[_0x1da9('0x5a')],{'onDelete':_0x1da9('0x184'),'foreignKey':_0x1da9('0x195')});db['OpenchannelApplication'][_0x1da9('0x135')](db[_0x1da9('0x82')],{'onDelete':_0x1da9('0x184'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x5c')][_0x1da9('0x135')](db[_0x1da9('0x8c')],{'onDelete':_0x1da9('0x184'),'foreignKey':_0x1da9('0x185')});db[_0x1da9('0x12f')]['hasMany'](db[_0x1da9('0x196')],{'as':_0x1da9('0x16a'),'onDelete':'cascade','foreignKey':_0x1da9('0x197')});db['OpenchannelInteraction'][_0x1da9('0x135')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x12f')][_0x1da9('0x135')](db['User'],{'as':_0x1da9('0x190'),'foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x12f')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':_0x1da9('0x198'),'as':_0x1da9('0x17f')});db[_0x1da9('0x12f')][_0x1da9('0x137')](db['Tag'],{'through':_0x1da9('0x198'),'as':_0x1da9('0x180')});db[_0x1da9('0x12f')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x181'),'through':_0x1da9('0x13f'),'foreignKey':_0x1da9('0x197')});db[_0x1da9('0x196')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x12a'),'as':'User'});db[_0x1da9('0x196')][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'onDelete':_0x1da9('0x12a'),'as':'Contact'});db['OpenchannelMessage'][_0x1da9('0x135')](db[_0x1da9('0x12f')],{'onDelete':_0x1da9('0x12a'),'as':'Interaction','foreignKey':_0x1da9('0x197')});db['OpenchannelMessage'][_0x1da9('0x135')](db[_0x1da9('0xe6')],{'as':_0x1da9('0xe6'),'foreignKey':_0x1da9('0x18c')});db[_0x1da9('0x196')][_0x1da9('0x135')](db[_0x1da9('0x5a')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x195')});db[_0x1da9('0x5d')][_0x1da9('0x137')](db['User'],{'as':_0x1da9('0x163'),'through':_0x1da9('0x146'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0x1da9('0xe0')],{'through':_0x1da9('0x199'),'as':'Teams'});db[_0x1da9('0x19a')][_0x1da9('0x12c')](db[_0x1da9('0x7e')],{'as':_0x1da9('0x176'),'foreignKey':_0x1da9('0x19b')});db[_0x1da9('0x19a')][_0x1da9('0x12c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x1da9('0x19b')});db[_0x1da9('0x19a')][_0x1da9('0x12c')](db[_0x1da9('0x6b')],{'as':_0x1da9('0x19c')});db[_0x1da9('0x19a')]['hasMany'](db['ChatInteraction'],{'as':_0x1da9('0x187')});db['ChatWebsite'][_0x1da9('0x12c')](db[_0x1da9('0x61')],{'as':_0x1da9('0x153')});db[_0x1da9('0x19a')]['hasMany'](db[_0x1da9('0x65')],{'as':'Messages'});db[_0x1da9('0x19a')][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x19a')][_0x1da9('0x135')](db['Interval'],{'as':_0x1da9('0x82'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x19a')][_0x1da9('0x135')](db['Pause'],{'as':_0x1da9('0x161'),'foreignKey':_0x1da9('0x162')});db['ChatWebsite'][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x19d')});db[_0x1da9('0x19e')][_0x1da9('0x135')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x1da9('0x135')](db['CmList'],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x19e')][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':'Contact','foreignKey':_0x1da9('0x171')});db['OpenchannelQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x12f')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x1da9('0x196')],{});db[_0x1da9('0x19e')][_0x1da9('0x135')](db['User'],{});db[_0x1da9('0x19e')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x1da9('0x61')][_0x1da9('0x135')](db['User'],{'as':_0x1da9('0x19f'),'foreignKey':_0x1da9('0x12b'),'onDelete':'restrict'});db[_0x1da9('0x61')][_0x1da9('0x135')](db[_0x1da9('0x141')],{'as':_0x1da9('0x1a0'),'foreignKey':'ChatQueueId','onDelete':_0x1da9('0x184')});db[_0x1da9('0x61')][_0x1da9('0x135')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x1da9('0x184')});db[_0x1da9('0x61')][_0x1da9('0x135')](db[_0x1da9('0x8c')],{'onDelete':_0x1da9('0x184'),'foreignKey':_0x1da9('0x185')});db['ChatInteraction'][_0x1da9('0x12c')](db[_0x1da9('0x65')],{'as':_0x1da9('0x16a'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1a1')});db[_0x1da9('0x63')][_0x1da9('0x135')](db[_0x1da9('0x19a')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x19b')});db[_0x1da9('0x63')][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':'Contact','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x63')]['belongsTo'](db[_0x1da9('0x13')],{'as':_0x1da9('0x190'),'foreignKey':_0x1da9('0x12b')});db[_0x1da9('0x63')]['belongsToMany'](db[_0x1da9('0x8c')],{'through':_0x1da9('0x1a2'),'as':_0x1da9('0x17f')});db[_0x1da9('0x63')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':'chat_interaction_has_tags','as':_0x1da9('0x180')});db[_0x1da9('0x63')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':'Users','through':_0x1da9('0x1a3'),'foreignKey':_0x1da9('0x1a1')});db[_0x1da9('0x65')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':'cascade','as':_0x1da9('0x13')});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x1da9('0x12a'),'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x65')][_0x1da9('0x135')](db['ChatInteraction'],{'onDelete':_0x1da9('0x12a'),'as':_0x1da9('0x193'),'foreignKey':'ChatInteractionId'});db[_0x1da9('0x65')][_0x1da9('0x135')](db[_0x1da9('0xe6')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x1da9('0x65')][_0x1da9('0x135')](db[_0x1da9('0x19a')],{'as':_0x1da9('0x183'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'onDelete':'cascade','as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x67')][_0x1da9('0x135')](db['ChatWebsite'],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x19b')});db[_0x1da9('0x141')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x1da9('0x31'),'hooks':!![]});db[_0x1da9('0x141')][_0x1da9('0x137')](db[_0x1da9('0xe0')],{'through':_0x1da9('0x1a4'),'as':'Teams'});db[_0x1da9('0x69')][_0x1da9('0x12c')](db[_0x1da9('0xcc')],{'as':_0x1da9('0x16a'),'foreignKey':_0x1da9('0x1a5'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x69')]['belongsToMany'](db[_0x1da9('0x13')],{'as':_0x1da9('0x156'),'through':_0x1da9('0x138')});db[_0x1da9('0x6b')][_0x1da9('0x135')](db['ChatWebsite'],{'as':_0x1da9('0x1a6'),'foreignKey':'ChatWebsiteId'});db[_0x1da9('0x6d')]['hasOne'](db[_0x1da9('0x6d')],{'as':_0x1da9('0x1a7')});db['CmCompany'][_0x1da9('0x12c')](db[_0x1da9('0x6f')],{'as':'Contacts','foreignKey':_0x1da9('0x1a8')});db[_0x1da9('0x6d')][_0x1da9('0x12c')](db[_0x1da9('0x10a')],{'as':_0x1da9('0x1a9'),'foreignKey':_0x1da9('0x1a8')});db['CmCompany']['hasMany'](db['SADossier'],{'as':_0x1da9('0x1aa'),'foreignKey':_0x1da9('0x1a8')});db['CmCompany'][_0x1da9('0x135')](db['SAPaymentMethod'],{'as':_0x1da9('0x1ab'),'foreignKey':_0x1da9('0x1ac')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db[_0x1da9('0x71')],{'as':_0x1da9('0x158'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db[_0x1da9('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x6f')]['hasMany'](db[_0x1da9('0xd1')],{'as':_0x1da9('0x15d'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db[_0x1da9('0x12f')],{'as':'OpenchannelInteractions','foreignKey':_0x1da9('0x171'),'onDelete':'restrict'});db[_0x1da9('0x6f')]['hasMany'](db[_0x1da9('0x63')],{'as':_0x1da9('0x131'),'foreignKey':_0x1da9('0x171'),'onDelete':'restrict'});db['CmContact'][_0x1da9('0x12c')](db['SmsInteraction'],{'as':_0x1da9('0x132'),'foreignKey':_0x1da9('0x171'),'onDelete':_0x1da9('0x184')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db['FaxInteraction'],{'as':_0x1da9('0x133'),'foreignKey':_0x1da9('0x171'),'onDelete':_0x1da9('0x184')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db[_0x1da9('0x3f')],{'as':_0x1da9('0x134'),'foreignKey':_0x1da9('0x171'),'onDelete':_0x1da9('0x184')});db[_0x1da9('0x6f')][_0x1da9('0x12c')](db['SADossier'],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171'),'onDelete':_0x1da9('0x184')});db['CmContact'][_0x1da9('0x135')](db[_0x1da9('0x6d')],{'as':_0x1da9('0x1ad'),'foreignKey':'CompanyId'});db[_0x1da9('0x6f')]['belongsTo'](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':_0x1da9('0x179'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x6f')]['belongsToMany'](db[_0x1da9('0x13')],{'as':_0x1da9('0x181'),'through':'cm_user_has_contacts'});db[_0x1da9('0x6f')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'as':_0x1da9('0x17f'),'through':_0x1da9('0x1ae')});db['CmContact'][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':_0x1da9('0x1ae'),'as':'ThroughTags'});db['CmHopper'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':_0x1da9('0x170'),'foreignKey':'ContactId','onDelete':_0x1da9('0x12a')});db['CmHopper'][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':'ListId','onDelete':_0x1da9('0x12a')});db[_0x1da9('0x71')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':_0x1da9('0x19f'),'foreignKey':'UserId'});db[_0x1da9('0x71')][_0x1da9('0x135')](db[_0x1da9('0x140')],{'as':'Queue','foreignKey':_0x1da9('0x157'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x71')][_0x1da9('0x135')](db[_0x1da9('0xe3')],{'as':_0x1da9('0xe3'),'foreignKey':_0x1da9('0x1af'),'onDelete':'cascade'});db[_0x1da9('0x71')]['belongsTo'](db[_0x1da9('0x13')],{'as':_0x1da9('0x190'),'foreignKey':_0x1da9('0x1b0')});db['CmHopperBlack'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x15b')][_0x1da9('0x135')](db['CmList'],{'as':_0x1da9('0x178'),'foreignKey':'ListId','onDelete':_0x1da9('0x12a')});db[_0x1da9('0x15b')][_0x1da9('0x135')](db['VoiceQueue'],{'as':_0x1da9('0x1a0'),'foreignKey':_0x1da9('0x157'),'onDelete':'cascade'});db[_0x1da9('0x15b')]['belongsTo'](db['Campaign'],{'as':_0x1da9('0xe3'),'foreignKey':_0x1da9('0x1af'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0x7b')][_0x1da9('0x12c')](db[_0x1da9('0x80')],{'as':{'plural':_0x1da9('0x1b1'),'singular':_0x1da9('0x1b2')},'foreignKey':'AutomationAllId','onDelete':_0x1da9('0x12a'),'hooks':!![]});db[_0x1da9('0x7b')]['hasMany'](db[_0x1da9('0x80')],{'as':{'plural':_0x1da9('0x1b3'),'singular':'OneAny'},'foreignKey':_0x1da9('0x1b4'),'onDelete':_0x1da9('0x12a'),'hooks':!![]});db[_0x1da9('0x7b')][_0x1da9('0x12c')](db[_0x1da9('0x79')],{'as':_0x1da9('0x1b5'),'foreignKey':'AutomationId','onDelete':_0x1da9('0x12a'),'hooks':!![]});db[_0x1da9('0x82')][_0x1da9('0x12c')](db[_0x1da9('0x82')],{'as':_0x1da9('0x1b6'),'foreignKey':_0x1da9('0x160'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0x1da9('0x12c')](db[_0x1da9('0x1a')],{'as':_0x1da9('0x12d'),'foreignKey':_0x1da9('0x160'),'onDelete':_0x1da9('0x184')});db['Interval']['hasMany'](db['MailApplication'],{'as':_0x1da9('0x1b7'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x82')]['hasMany'](db[_0x1da9('0x61')],{'as':_0x1da9('0x1b8'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x82')][_0x1da9('0x12c')](db['FaxApplication'],{'as':_0x1da9('0x1b9'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0x82')][_0x1da9('0x12c')](db[_0x1da9('0x53')],{'as':_0x1da9('0x1ba'),'foreignKey':'IntervalId'});db[_0x1da9('0x1bb')][_0x1da9('0x135')](db['MailAccount'],{});db[_0x1da9('0x1bb')][_0x1da9('0x135')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0x1da9('0x1bb')][_0x1da9('0x135')](db[_0x1da9('0x1bc')],{'foreignKey':_0x1da9('0x1bd')});db[_0x1da9('0x8a')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x1da9('0x1be'),'through':_0x1da9('0x155'),'onDelete':'restrict'});db[_0x1da9('0x8c')][_0x1da9('0x137')](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag'][_0x1da9('0x137')](db[_0x1da9('0x63')],{'through':_0x1da9('0x1a2')});db[_0x1da9('0x8c')][_0x1da9('0x137')](db['MailInteraction'],{'through':_0x1da9('0x17e')});db['Tag'][_0x1da9('0x137')](db['SmsInteraction'],{'through':_0x1da9('0x191')});db[_0x1da9('0x8c')][_0x1da9('0x137')](db[_0x1da9('0x4c')],{'through':_0x1da9('0x18b')});db[_0x1da9('0x8c')][_0x1da9('0x137')](db[_0x1da9('0x12f')],{'through':_0x1da9('0x198')});db['Trigger'][_0x1da9('0x12c')](db[_0x1da9('0x80')],{'as':{'plural':'AllConditions','singular':_0x1da9('0x1bf')},'foreignKey':_0x1da9('0x1c0'),'onDelete':_0x1da9('0x12a'),'hooks':!![]});db[_0x1da9('0x90')]['hasMany'](db[_0x1da9('0x80')],{'as':{'plural':_0x1da9('0x1c1'),'singular':'AnyCondition'},'foreignKey':_0x1da9('0x1c2'),'onDelete':_0x1da9('0x12a'),'hooks':!![]});db[_0x1da9('0x90')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0x1da9('0x1c3'),'onDelete':_0x1da9('0x12a'),'hooks':!![]});db['AnalyticCustomReport'][_0x1da9('0x12c')](db[_0x1da9('0x9a')],{'as':_0x1da9('0x1c4'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1bd'),'hooks':!![]});db[_0x1da9('0x95')][_0x1da9('0x12c')](db[_0x1da9('0x9a')],{'as':'Fields','onDelete':_0x1da9('0x12a'),'foreignKey':'DefaultReportId'});db[_0x1da9('0x1c5')][_0x1da9('0x12c')](db['AnalyticFieldReport'],{'as':_0x1da9('0x1c4'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c6')});db['AnalyticFieldReport'][_0x1da9('0x135')](db[_0x1da9('0x1c5')],{'foreignKey':_0x1da9('0x1c6')});db[_0x1da9('0x9e')][_0x1da9('0x12c')](db[_0x1da9('0xa0')],{'as':'Configurations','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xa0')][_0x1da9('0x12c')](db[_0x1da9('0xa2')],{'as':_0x1da9('0x1c8'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xa0')]['hasMany'](db[_0x1da9('0xa2')],{'as':_0x1da9('0x1ca'),'onDelete':_0x1da9('0x12a'),'foreignKey':'DescriptionId'});db[_0x1da9('0xa0')][_0x1da9('0x12c')](db[_0x1da9('0xa2')],{'as':_0x1da9('0x1c4'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cb')});db['SalesforceConfiguration'][_0x1da9('0x135')](db[_0x1da9('0x9e')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xa2')][_0x1da9('0x12c')](db[_0x1da9('0xa2')],{'as':'Subject','foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xa2')]['hasMany'](db[_0x1da9('0xa2')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db['SalesforceField'][_0x1da9('0x12c')](db[_0x1da9('0xa2')],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xa2')][_0x1da9('0x135')](db['Variable'],{'as':_0x1da9('0x1cf'),'foreignKey':_0x1da9('0x1d0')});db['SugarcrmAccount'][_0x1da9('0x12c')](db['SugarcrmConfiguration'],{'as':_0x1da9('0x1d1'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xa4')][_0x1da9('0x12c')](db[_0x1da9('0xa6')],{'as':_0x1da9('0x1c8'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xa4')][_0x1da9('0x12c')](db['SugarcrmField'],{'as':_0x1da9('0x1ca'),'onDelete':_0x1da9('0x12a'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x1da9('0x12c')](db[_0x1da9('0xa6')],{'as':_0x1da9('0x1c4'),'onDelete':'cascade','foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xa4')]['belongsTo'](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xa6')][_0x1da9('0x12c')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xa6')][_0x1da9('0x12c')](db[_0x1da9('0xa6')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xa6')][_0x1da9('0x12c')](db[_0x1da9('0xa6')],{'as':'Field','foreignKey':_0x1da9('0x1cb')});db['SugarcrmField'][_0x1da9('0x135')](db[_0x1da9('0x1cf')],{'as':_0x1da9('0x1cf'),'foreignKey':'VariableId'});db[_0x1da9('0xa8')][_0x1da9('0x12c')](db[_0x1da9('0xaa')],{'as':_0x1da9('0x1d1'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xaa')]['hasMany'](db[_0x1da9('0xac')],{'as':'Subjects','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xaa')][_0x1da9('0x12c')](db[_0x1da9('0xac')],{'as':_0x1da9('0x1ca'),'onDelete':'cascade','foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xaa')]['hasMany'](db[_0x1da9('0xac')],{'as':'Fields','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cb')});db['DeskConfiguration'][_0x1da9('0x135')](db[_0x1da9('0xa8')],{'as':_0x1da9('0x183'),'foreignKey':'AccountId'});db[_0x1da9('0xaa')][_0x1da9('0x137')](db['Tag'],{'through':_0x1da9('0x1d2')});db[_0x1da9('0xac')][_0x1da9('0x12c')](db[_0x1da9('0xac')],{'as':_0x1da9('0x1d3'),'foreignKey':'SubjectId'});db[_0x1da9('0xac')][_0x1da9('0x12c')](db[_0x1da9('0xac')],{'as':_0x1da9('0x1cc'),'foreignKey':'DescriptionId'});db[_0x1da9('0xac')]['hasMany'](db[_0x1da9('0xac')],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xac')]['belongsTo'](db[_0x1da9('0x1cf')],{'as':_0x1da9('0x1cf'),'foreignKey':_0x1da9('0x1d0')});db['ZohoAccount'][_0x1da9('0x12c')](db[_0x1da9('0xae')],{'as':_0x1da9('0x1d1'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db['ZohoConfiguration'][_0x1da9('0x12c')](db[_0x1da9('0xb0')],{'as':_0x1da9('0x1c8'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xae')][_0x1da9('0x12c')](db[_0x1da9('0xb0')],{'as':_0x1da9('0x1ca'),'onDelete':_0x1da9('0x12a'),'foreignKey':'DescriptionId'});db[_0x1da9('0xae')]['hasMany'](db[_0x1da9('0xb0')],{'as':_0x1da9('0x1c4'),'onDelete':_0x1da9('0x12a'),'foreignKey':'FieldId'});db[_0x1da9('0xae')]['belongsTo'](db[_0x1da9('0xad')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xb0')][_0x1da9('0x12c')](db[_0x1da9('0xb0')],{'as':_0x1da9('0x1d3'),'foreignKey':_0x1da9('0x1c9')});db['ZohoField']['hasMany'](db[_0x1da9('0xb0')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xb0')][_0x1da9('0x12c')](db['ZohoField'],{'as':'Field','foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xb0')]['belongsTo'](db[_0x1da9('0x1cf')],{'as':'Variable','foreignKey':_0x1da9('0x1d0')});db[_0x1da9('0xb2')][_0x1da9('0x12c')](db[_0x1da9('0xb3')],{'as':'Configurations','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db['ZendeskConfiguration'][_0x1da9('0x12c')](db[_0x1da9('0xb5')],{'as':_0x1da9('0x1c8'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xb3')][_0x1da9('0x12c')](db['ZendeskField'],{'as':_0x1da9('0x1ca'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xb3')][_0x1da9('0x12c')](db[_0x1da9('0xb5')],{'as':'Fields','foreignKey':_0x1da9('0x1cb')});db['ZendeskConfiguration'][_0x1da9('0x135')](db[_0x1da9('0xb2')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db['ZendeskConfiguration'][_0x1da9('0x137')](db['Tag'],{'through':_0x1da9('0x1d4')});db[_0x1da9('0xb5')][_0x1da9('0x12c')](db[_0x1da9('0xb5')],{'as':'Subject','foreignKey':_0x1da9('0x1c9')});db['ZendeskField'][_0x1da9('0x12c')](db[_0x1da9('0xb5')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xb5')][_0x1da9('0x12c')](db['ZendeskField'],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db['ZendeskField'][_0x1da9('0x135')](db['Variable'],{'as':_0x1da9('0x1cf'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x1da9('0x12c')](db[_0x1da9('0xb9')],{'as':_0x1da9('0x1d1'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xb9')][_0x1da9('0x12c')](db[_0x1da9('0xba')],{'as':_0x1da9('0x1c8'),'onDelete':'cascade','foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xb9')]['hasMany'](db[_0x1da9('0xba')],{'as':_0x1da9('0x1ca'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xb9')][_0x1da9('0x12c')](db['FreshdeskField'],{'as':_0x1da9('0x1c4'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xb9')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xb9')][_0x1da9('0x137')](db[_0x1da9('0x8c')],{'through':_0x1da9('0x1d5')});db[_0x1da9('0xba')][_0x1da9('0x12c')](db[_0x1da9('0xba')],{'as':_0x1da9('0x1d3'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xba')][_0x1da9('0x12c')](db[_0x1da9('0xba')],{'as':_0x1da9('0x1cc'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0x1da9('0x12c')](db['FreshdeskField'],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db['FreshdeskField'][_0x1da9('0x135')](db[_0x1da9('0x1cf')],{'as':'Variable','foreignKey':'VariableId'});db[_0x1da9('0x1d6')][_0x1da9('0x12c')](db[_0x1da9('0xbd')],{'as':'Configurations','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xbd')][_0x1da9('0x12c')](db['VtigerField'],{'as':_0x1da9('0x1c8'),'foreignKey':_0x1da9('0x1c9')});db['VtigerConfiguration'][_0x1da9('0x12c')](db[_0x1da9('0xbe')],{'as':_0x1da9('0x1ca'),'foreignKey':_0x1da9('0x1cd')});db['VtigerConfiguration'][_0x1da9('0x12c')](db[_0x1da9('0xbe')],{'as':_0x1da9('0x1c4'),'foreignKey':'FieldId'});db[_0x1da9('0xbd')]['belongsTo'](db[_0x1da9('0x1d6')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xbd')]['belongsToMany'](db[_0x1da9('0x8c')],{'through':_0x1da9('0x1d7')});db[_0x1da9('0xbe')][_0x1da9('0x12c')](db['VtigerField'],{'as':_0x1da9('0x1d3'),'foreignKey':'SubjectId'});db['VtigerField'][_0x1da9('0x12c')](db[_0x1da9('0xbe')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xbe')]['hasMany'](db[_0x1da9('0xbe')],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db['VtigerField'][_0x1da9('0x135')](db[_0x1da9('0x1cf')],{'as':_0x1da9('0x1cf'),'foreignKey':_0x1da9('0x1d0')});db[_0x1da9('0xbf')][_0x1da9('0x12c')](db[_0x1da9('0x1d8')],{'as':_0x1da9('0x1d1'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0x1d8')]['hasMany'](db[_0x1da9('0xc2')],{'as':_0x1da9('0x1c8'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0x1d8')][_0x1da9('0x12c')](db['ServicenowField'],{'as':_0x1da9('0x1ca'),'foreignKey':'DescriptionId'});db[_0x1da9('0x1d8')][_0x1da9('0x12c')](db[_0x1da9('0xc2')],{'as':'Fields','foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0x1d8')]['belongsTo'](db[_0x1da9('0xbf')],{'as':'Account','foreignKey':_0x1da9('0x1c7')});db['ServicenowField']['hasMany'](db[_0x1da9('0xc2')],{'as':_0x1da9('0x1d3'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xc2')][_0x1da9('0x12c')](db[_0x1da9('0xc2')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db['ServicenowField']['hasMany'](db[_0x1da9('0xc2')],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0xc2')]['belongsTo'](db['Variable'],{'as':_0x1da9('0x1cf'),'foreignKey':'VariableId'});db[_0x1da9('0xc4')][_0x1da9('0x12c')](db['Dynamics365Configuration'],{'as':_0x1da9('0x1d1'),'onDelete':'cascade','foreignKey':'AccountId'});db['Dynamics365Configuration'][_0x1da9('0x12c')](db[_0x1da9('0xc6')],{'as':'Subjects','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1c9')});db['Dynamics365Configuration'][_0x1da9('0x12c')](db['Dynamics365Field'],{'as':_0x1da9('0x1ca'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cd')});db['Dynamics365Configuration'][_0x1da9('0x12c')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1cb')});db[_0x1da9('0x1d9')][_0x1da9('0x135')](db[_0x1da9('0xc4')],{'as':_0x1da9('0x183'),'foreignKey':_0x1da9('0x1c7')});db[_0x1da9('0xc6')]['hasMany'](db[_0x1da9('0xc6')],{'as':_0x1da9('0x1d3'),'foreignKey':_0x1da9('0x1c9')});db[_0x1da9('0xc6')]['hasMany'](db[_0x1da9('0xc6')],{'as':_0x1da9('0x1cc'),'foreignKey':_0x1da9('0x1cd')});db[_0x1da9('0xc6')][_0x1da9('0x12c')](db['Dynamics365Field'],{'as':_0x1da9('0x1ce'),'foreignKey':_0x1da9('0x1cb')});db['Dynamics365Field']['belongsTo'](db[_0x1da9('0x1cf')],{'as':_0x1da9('0x1cf'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x19a')],{});db['ChatQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x166')],{'as':_0x1da9('0x178'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':_0x1da9('0x170'),'foreignKey':_0x1da9('0x171')});db[_0x1da9('0xca')][_0x1da9('0x135')](db[_0x1da9('0x63')],{});db[_0x1da9('0xca')][_0x1da9('0x135')](db[_0x1da9('0x65')],{});db[_0x1da9('0xca')][_0x1da9('0x135')](db[_0x1da9('0x13')],{});db['ChatQueueReport'][_0x1da9('0x135')](db['ChatQueue'],{});db[_0x1da9('0xcc')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1da')});db[_0x1da9('0xcc')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x1db')});db[_0x1da9('0xd1')][_0x1da9('0x12c')](db['JscriptyQuestionReport'],{'foreignKey':_0x1da9('0x1dc'),'onDelete':'cascade'});db[_0x1da9('0xd1')][_0x1da9('0x12c')](db[_0x1da9('0xce')],{'foreignKey':'SessionId','onDelete':_0x1da9('0x12a')});db[_0x1da9('0xd3')][_0x1da9('0x135')](db['SmsAccount'],{});db['SmsQueueReport'][_0x1da9('0x135')](db['CmList'],{'as':_0x1da9('0x178'),'foreignKey':'ListId'});db[_0x1da9('0xd3')][_0x1da9('0x135')](db[_0x1da9('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1da9('0xd3')][_0x1da9('0x135')](db[_0x1da9('0x55')],{});db[_0x1da9('0xd3')][_0x1da9('0x135')](db[_0x1da9('0x18d')],{});db[_0x1da9('0xd3')][_0x1da9('0x135')](db[_0x1da9('0x13')],{});db[_0x1da9('0xd3')]['belongsTo'](db[_0x1da9('0x58')],{});db[_0x1da9('0xd8')][_0x1da9('0x12c')](db[_0x1da9('0xd1')],{'foreignKey':_0x1da9('0x1dd')});db['JscriptyProject'][_0x1da9('0x12c')](db[_0x1da9('0xd0')],{'foreignKey':_0x1da9('0x1dd')});db[_0x1da9('0xd8')][_0x1da9('0x12c')](db['JscriptyAnswerReport'],{'foreignKey':_0x1da9('0x1dd')});db['SquareProject']['belongsToMany'](db[_0x1da9('0x13')],{'as':_0x1da9('0x181'),'through':_0x1da9('0x151')});db[_0x1da9('0xe0')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x1de')});db[_0x1da9('0xe0')]['belongsToMany'](db['VoiceQueue'],{'through':_0x1da9('0x165'),'as':_0x1da9('0x1df')});db['Team'][_0x1da9('0x137')](db[_0x1da9('0x17b')],{'through':_0x1da9('0x17c'),'as':_0x1da9('0x1e0')});db[_0x1da9('0xe0')]['belongsToMany'](db['ChatQueue'],{'through':_0x1da9('0x1a4'),'as':_0x1da9('0x142')});db[_0x1da9('0xe0')][_0x1da9('0x137')](db[_0x1da9('0x143')],{'through':_0x1da9('0x1e1'),'as':'FaxQueues'});db[_0x1da9('0xe0')][_0x1da9('0x137')](db[_0x1da9('0x58')],{'through':'team_has_sms_queues','as':_0x1da9('0x1e2')});db[_0x1da9('0xe0')][_0x1da9('0x137')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x1da9('0x145')});db[_0x1da9('0xe3')][_0x1da9('0x12c')](db['CmHopper'],{'as':_0x1da9('0x158'),'foreignKey':_0x1da9('0x1af')});db['Campaign'][_0x1da9('0x12c')](db['CmHopperFinal'],{'as':_0x1da9('0x159'),'foreignKey':_0x1da9('0x1af')});db[_0x1da9('0xe3')][_0x1da9('0x12c')](db[_0x1da9('0x75')],{'as':_0x1da9('0x15a'),'foreignKey':_0x1da9('0x1af')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0x1da9('0x15c'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x1da9('0x2b')],{'as':_0x1da9('0x2b'),'foreignKey':'TrunkId'});db[_0x1da9('0xe3')][_0x1da9('0x135')](db['Trunk'],{'as':_0x1da9('0x1e3'),'foreignKey':_0x1da9('0x15f')});db[_0x1da9('0xe3')][_0x1da9('0x135')](db[_0x1da9('0x82')],{'as':_0x1da9('0x82'),'foreignKey':_0x1da9('0x160')});db[_0x1da9('0xe3')][_0x1da9('0x135')](db['SquareProject'],{'as':_0x1da9('0x14f'),'foreignKey':'SquareProjectId'});db[_0x1da9('0xe3')][_0x1da9('0x137')](db[_0x1da9('0x166')],{'as':'Lists','through':_0x1da9('0x1e4')});db['Campaign'][_0x1da9('0x137')](db[_0x1da9('0x166')],{'as':_0x1da9('0x167'),'through':_0x1da9('0x1e5')});db[_0x1da9('0xe9')][_0x1da9('0x135')](db[_0x1da9('0x41')],{});db[_0x1da9('0xe9')][_0x1da9('0x135')](db['MailInteraction'],{});db[_0x1da9('0xe9')][_0x1da9('0x135')](db['MailAccount'],{'foreignKey':_0x1da9('0x1e6'),'as':_0x1da9('0x1e7')});db[_0x1da9('0xe9')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1e8'),'as':_0x1da9('0x1e9')});db[_0x1da9('0xe9')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1ea'),'as':_0x1da9('0x1eb')});db[_0x1da9('0xe9')][_0x1da9('0x135')](db[_0x1da9('0x17b')],{'foreignKey':_0x1da9('0x1ec'),'as':_0x1da9('0x1ed')});db[_0x1da9('0xe9')][_0x1da9('0x135')](db[_0x1da9('0x3a')],{'foreignKey':_0x1da9('0x1ee'),'as':_0x1da9('0x1ef')});db['ChatTransferReport'][_0x1da9('0x135')](db['ChatMessage'],{});db[_0x1da9('0xeb')][_0x1da9('0x135')](db[_0x1da9('0x63')],{});db[_0x1da9('0xeb')][_0x1da9('0x135')](db[_0x1da9('0x19a')],{'foreignKey':'FromChatWebsiteId','as':_0x1da9('0x1e7')});db[_0x1da9('0xeb')]['belongsTo'](db['User'],{'foreignKey':_0x1da9('0x1e8'),'as':'FromAgent'});db[_0x1da9('0xeb')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1ea'),'as':'ToAgent'});db[_0x1da9('0xeb')][_0x1da9('0x135')](db[_0x1da9('0x141')],{'foreignKey':'ToChatQueueId','as':_0x1da9('0x1ed')});db['ChatTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x19a')],{'foreignKey':_0x1da9('0x1f0'),'as':_0x1da9('0x1ef')});db[_0x1da9('0xed')][_0x1da9('0x135')](db['FaxMessage'],{});db[_0x1da9('0xed')]['belongsTo'](db[_0x1da9('0x4c')],{});db[_0x1da9('0xed')]['belongsTo'](db[_0x1da9('0x49')],{'foreignKey':_0x1da9('0x1f1'),'as':_0x1da9('0x1e7')});db['FaxTransferReport']['belongsTo'](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1e8'),'as':_0x1da9('0x1e9')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x1da9('0x1ea'),'as':_0x1da9('0x1eb')});db['FaxTransferReport']['belongsTo'](db[_0x1da9('0x143')],{'foreignKey':'ToFaxQueueId','as':_0x1da9('0x1ed')});db[_0x1da9('0xed')][_0x1da9('0x135')](db[_0x1da9('0x49')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x1da9('0xef')][_0x1da9('0x135')](db[_0x1da9('0x196')],{});db[_0x1da9('0xef')]['belongsTo'](db[_0x1da9('0x12f')],{});db[_0x1da9('0xef')][_0x1da9('0x135')](db[_0x1da9('0x5a')],{'foreignKey':_0x1da9('0x1f2'),'as':_0x1da9('0x1e7')});db['OpenchannelTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':'FromUserId','as':_0x1da9('0x1e9')});db[_0x1da9('0xef')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1ea'),'as':_0x1da9('0x1eb')});db[_0x1da9('0xef')][_0x1da9('0x135')](db['OpenchannelQueue'],{'foreignKey':_0x1da9('0x1f3'),'as':_0x1da9('0x1ed')});db['OpenchannelTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x5a')],{'foreignKey':_0x1da9('0x1f4'),'as':_0x1da9('0x1ef')});db['SmsTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x18d')],{});db['SmsTransferReport']['belongsTo'](db[_0x1da9('0x55')],{});db['SmsTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x51')],{'foreignKey':_0x1da9('0x1f5'),'as':_0x1da9('0x1e7')});db['SmsTransferReport'][_0x1da9('0x135')](db['User'],{'foreignKey':'FromUserId','as':_0x1da9('0x1e9')});db[_0x1da9('0xf1')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'foreignKey':_0x1da9('0x1ea'),'as':_0x1da9('0x1eb')});db['SmsTransferReport'][_0x1da9('0x135')](db[_0x1da9('0x58')],{'foreignKey':_0x1da9('0x1f6'),'as':_0x1da9('0x1ed')});db[_0x1da9('0xf1')]['belongsTo'](db[_0x1da9('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x1da9('0x1ef')});db[_0x1da9('0x166')][_0x1da9('0x12c')](db[_0x1da9('0x7e')],{'as':_0x1da9('0x176'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x166')][_0x1da9('0x12c')](db['CmCustomField'],{'as':_0x1da9('0x1f7'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x166')][_0x1da9('0x12c')](db['CmContact'],{'as':_0x1da9('0x139'),'onDelete':_0x1da9('0x12a'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x166')]['hasMany'](db[_0x1da9('0x73')],{'as':_0x1da9('0x159'),'foreignKey':'ListId'});db[_0x1da9('0x166')][_0x1da9('0x12c')](db[_0x1da9('0x75')],{'as':_0x1da9('0x12e'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x166')][_0x1da9('0x12c')](db[_0x1da9('0x77')],{'as':_0x1da9('0x77'),'foreignKey':_0x1da9('0x179')});db[_0x1da9('0x166')]['belongsToMany'](db['VoiceQueue'],{'as':_0x1da9('0x1f8'),'through':_0x1da9('0x1f9')});db[_0x1da9('0x166')][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x1da9('0x1a')],{'as':'Extensions','onDelete':_0x1da9('0x184')});db['VoicePrefix'][_0x1da9('0x137')](db[_0x1da9('0x13')],{'as':_0x1da9('0x163'),'through':_0x1da9('0x147')});db[_0x1da9('0xf6')]['hasMany'](db[_0x1da9('0x13')],{'as':'Users','foreignKey':_0x1da9('0x136')});db[_0x1da9('0xf6')][_0x1da9('0x12c')](db[_0x1da9('0xf7')],{'as':_0x1da9('0x1fa'),'foreignKey':'userProfileId','onDelete':_0x1da9('0x12a')});db[_0x1da9('0xf7')][_0x1da9('0x12c')](db[_0x1da9('0xf9')],{'as':_0x1da9('0x1fb'),'foreignKey':_0x1da9('0x1fc'),'onDelete':_0x1da9('0x12a')});db[_0x1da9('0xfd')][_0x1da9('0x12c')](db[_0x1da9('0x1fd')],{'foreignKey':_0x1da9('0x1fe')});db[_0x1da9('0xfd')][_0x1da9('0x12c')](db[_0x1da9('0x1ff')],{'foreignKey':_0x1da9('0x1fe')});db[_0x1da9('0x1fd')][_0x1da9('0x129')](db[_0x1da9('0x100')],{'foreignKey':_0x1da9('0x200')});db['CrmWorkflowStep'][_0x1da9('0x12c')](db[_0x1da9('0x1ff')],{'foreignKey':_0x1da9('0x200')});db[_0x1da9('0x1fd')]['belongsToMany'](db['CrmWorkflowStep'],{'as':_0x1da9('0x201'),'through':_0x1da9('0x202')});db[_0x1da9('0x100')]['hasMany'](db['CrmActionsList'],{'foreignKey':_0x1da9('0x203')});db['CrmTask']['belongsTo'](db[_0x1da9('0x1fd')],{'foreignKey':_0x1da9('0x200'),'as':_0x1da9('0x1fd')});db[_0x1da9('0x101')][_0x1da9('0x135')](db['CrmTask'],{'foreignKey':'TaskId','as':_0x1da9('0x100')});db[_0x1da9('0x102')][_0x1da9('0x12c')](db[_0x1da9('0x107')],{'foreignKey':_0x1da9('0x204')});db[_0x1da9('0x104')][_0x1da9('0x12c')](db[_0x1da9('0x107')],{'foreignKey':'UnitMeasureId'});db[_0x1da9('0x107')][_0x1da9('0x12c')](db[_0x1da9('0x205')],{'foreignKey':_0x1da9('0x206')});db['SAProduct'][_0x1da9('0x135')](db['SASalesCondition'],{'as':_0x1da9('0x207'),'foreignKey':_0x1da9('0x208')});db[_0x1da9('0x107')][_0x1da9('0x135')](db['SAUnitMeasure'],{'as':_0x1da9('0x209'),'foreignKey':_0x1da9('0x20a')});db[_0x1da9('0x107')][_0x1da9('0x135')](db[_0x1da9('0x102')],{'as':_0x1da9('0x20b'),'foreignKey':'TypeProductId'});db[_0x1da9('0x108')][_0x1da9('0x12c')](db['SAProduct'],{'foreignKey':'TypeSalesConditionId'});db[_0x1da9('0x10a')]['hasMany'](db[_0x1da9('0x205')],{'foreignKey':_0x1da9('0x20c')});db[_0x1da9('0x205')][_0x1da9('0x12c')](db[_0x1da9('0x20d')],{'as':_0x1da9('0x20e'),'foreignKey':_0x1da9('0x20f')});db[_0x1da9('0x205')][_0x1da9('0x135')](db['SAProduct'],{'as':_0x1da9('0x210'),'foreignKey':_0x1da9('0x206')});db[_0x1da9('0x205')][_0x1da9('0x135')](db[_0x1da9('0x10a')],{'as':_0x1da9('0x211'),'foreignKey':_0x1da9('0x20c')});db[_0x1da9('0x1ff')][_0x1da9('0x12c')](db['SARequest'],{'as':_0x1da9('0x1aa'),'foreignKey':_0x1da9('0x212')});db[_0x1da9('0x1ff')]['hasMany'](db[_0x1da9('0x10e')],{'as':_0x1da9('0x1aa'),'foreignKey':_0x1da9('0x212')});db['SADossier'][_0x1da9('0x12c')](db['SAOrder'],{'as':'Dossiers','foreignKey':'DossierId'});db[_0x1da9('0x1ff')][_0x1da9('0x12c')](db[_0x1da9('0x113')],{'as':_0x1da9('0x1aa'),'foreignKey':_0x1da9('0x212')});db[_0x1da9('0x1ff')]['belongsTo'](db[_0x1da9('0x6d')],{'as':_0x1da9('0x1ad'),'foreignKey':_0x1da9('0x1a8')});db[_0x1da9('0x1ff')][_0x1da9('0x135')](db['CmContact'],{'as':'Contact','foreignKey':_0x1da9('0x171')});db[_0x1da9('0x1ff')]['belongsTo'](db[_0x1da9('0xfd')],{'as':_0x1da9('0x213'),'foreignKey':_0x1da9('0x1fe')});db[_0x1da9('0x1ff')][_0x1da9('0x135')](db[_0x1da9('0x1fd')],{'as':_0x1da9('0x214'),'foreignKey':_0x1da9('0x200')});db[_0x1da9('0x1ff')][_0x1da9('0x135')](db[_0x1da9('0x13')],{'as':'User','foreignKey':_0x1da9('0x12b')});db['SARequest'][_0x1da9('0x12c')](db[_0x1da9('0x10e')],{'as':'Requests','foreignKey':_0x1da9('0x215')});db['SARequest'][_0x1da9('0x12c')](db[_0x1da9('0x111')],{'as':_0x1da9('0x216'),'foreignKey':_0x1da9('0x215')});db[_0x1da9('0x217')][_0x1da9('0x12c')](db['SAProforma'],{'as':_0x1da9('0x216'),'foreignKey':_0x1da9('0x215')});db[_0x1da9('0x217')][_0x1da9('0x135')](db['SADossier'],{'as':_0x1da9('0x218'),'foreignKey':_0x1da9('0x212')});db[_0x1da9('0x10e')][_0x1da9('0x12c')](db[_0x1da9('0x20d')],{'as':_0x1da9('0x219'),'foreignKey':'QuotationId'});db['SAQuotation']['hasMany'](db[_0x1da9('0x111')],{'as':_0x1da9('0x219'),'foreignKey':_0x1da9('0x21a')});db['SAQuotation'][_0x1da9('0x12c')](db[_0x1da9('0x113')],{'as':_0x1da9('0x219'),'foreignKey':_0x1da9('0x21a')});db[_0x1da9('0x10e')][_0x1da9('0x135')](db[_0x1da9('0x1ff')],{'as':_0x1da9('0x218'),'foreignKey':_0x1da9('0x212')});db[_0x1da9('0x10e')]['belongsTo'](db[_0x1da9('0x217')],{'as':_0x1da9('0x21b'),'foreignKey':_0x1da9('0x215')});db[_0x1da9('0x20d')]['belongsTo'](db[_0x1da9('0x205')],{'as':'ProductPricesList','foreignKey':_0x1da9('0x20f')});db['SAProductQuotation'][_0x1da9('0x135')](db[_0x1da9('0x10e')],{'as':_0x1da9('0x21c'),'foreignKey':'QuotationId'});db['SAProductQuotation']['belongsTo'](db['SAProforma'],{'as':'Proforma','foreignKey':_0x1da9('0x21d')});db['SAProductQuotation'][_0x1da9('0x135')](db[_0x1da9('0x21e')],{'as':_0x1da9('0x21f'),'foreignKey':'InvoiceId'});db[_0x1da9('0x111')]['hasMany'](db[_0x1da9('0x113')],{'as':_0x1da9('0x220'),'foreignKey':_0x1da9('0x221')});db[_0x1da9('0x111')][_0x1da9('0x135')](db['SADossier'],{'as':_0x1da9('0x218'),'foreignKey':_0x1da9('0x212')});db['SAOrder']['belongsTo'](db[_0x1da9('0x217')],{'as':_0x1da9('0x21b'),'foreignKey':_0x1da9('0x215')});db[_0x1da9('0x111')][_0x1da9('0x135')](db['SAQuotation'],{'as':'Quotation','foreignKey':_0x1da9('0x21a')});db[_0x1da9('0x113')][_0x1da9('0x12c')](db[_0x1da9('0x21e')],{'as':'Proforma','foreignKey':_0x1da9('0x21d')});db['SAProforma']['hasMany'](db[_0x1da9('0x20d')],{'as':_0x1da9('0x222'),'foreignKey':_0x1da9('0x21d')});db[_0x1da9('0x113')]['hasMany'](db[_0x1da9('0x223')],{'as':_0x1da9('0x222'),'foreignKey':'ProformaId'});db[_0x1da9('0x113')][_0x1da9('0x12c')](db[_0x1da9('0x11a')],{'as':_0x1da9('0x222'),'foreignKey':_0x1da9('0x21d')});db['SAProforma']['belongsTo'](db[_0x1da9('0x1ff')],{'as':_0x1da9('0x218'),'foreignKey':'DossierId'});db['SAProforma'][_0x1da9('0x135')](db[_0x1da9('0x217')],{'as':_0x1da9('0x21b'),'foreignKey':_0x1da9('0x215')});db[_0x1da9('0x113')][_0x1da9('0x135')](db[_0x1da9('0x10e')],{'as':_0x1da9('0x21c'),'foreignKey':'QuotationId'});db[_0x1da9('0x113')][_0x1da9('0x135')](db[_0x1da9('0x111')],{'as':_0x1da9('0x224'),'foreignKey':_0x1da9('0x221')});db[_0x1da9('0x21e')][_0x1da9('0x12c')](db[_0x1da9('0x20d')],{'as':_0x1da9('0x219'),'foreignKey':_0x1da9('0x225')});db['SAInvoice'][_0x1da9('0x12c')](db[_0x1da9('0x117')],{'as':_0x1da9('0x226'),'foreignKey':_0x1da9('0x225')});db[_0x1da9('0x21e')][_0x1da9('0x12c')](db[_0x1da9('0x11a')],{'as':'Payments','foreignKey':_0x1da9('0x225')});db[_0x1da9('0x21e')][_0x1da9('0x135')](db[_0x1da9('0x1ff')],{'as':'Dossier','foreignKey':_0x1da9('0x212')});db[_0x1da9('0x21e')]['belongsTo'](db['SARequest'],{'as':'Request','foreignKey':_0x1da9('0x215')});db[_0x1da9('0x21e')]['belongsTo'](db[_0x1da9('0x10e')],{'as':'Quotation','foreignKey':'QuotationId'});db[_0x1da9('0x21e')]['belongsTo'](db[_0x1da9('0x111')],{'as':_0x1da9('0x224'),'foreignKey':_0x1da9('0x221')});db[_0x1da9('0x117')][_0x1da9('0x135')](db['SAInvoice'],{'as':'Invoice','foreignKey':_0x1da9('0x225')});db[_0x1da9('0x223')][_0x1da9('0x135')](db[_0x1da9('0x113')],{'as':_0x1da9('0x222'),'foreignKey':_0x1da9('0x21d')});db[_0x1da9('0x11a')][_0x1da9('0x135')](db[_0x1da9('0x21e')],{'as':_0x1da9('0x21f'),'foreignKey':'InvoiceId'});db[_0x1da9('0x11a')][_0x1da9('0x135')](db[_0x1da9('0x113')],{'as':_0x1da9('0x222'),'foreignKey':_0x1da9('0x21d')});db[_0x1da9('0x11c')][_0x1da9('0x12c')](db[_0x1da9('0x6d')],{'as':'Companies','foreignKey':_0x1da9('0x1ac')});db[_0x1da9('0x11f')][_0x1da9('0x135')](db[_0x1da9('0x11d')],{'as':_0x1da9('0x227'),'foreignKey':_0x1da9('0x228')});db['SACompanyType'][_0x1da9('0x12c')](db[_0x1da9('0x6d')],{'as':'CompanyType','foreignKey':'saCompanyType'});db[_0x1da9('0x127')][_0x1da9('0x12c')](db['CmCompany'],{'as':_0x1da9('0x229'),'foreignKey':_0x1da9('0x22a')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa7a8=['SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','CrmNation','../api/crmWorkflow/crmWorkflow.model','CrmWorkflowStep','../api/crmWorkflowstep/crmWorkflowstep.model','../api/crmTask/crmTask.model','CrmActionsList','../api/saTypeProduct/saTypeProduct.model','SAUnitMeasure','../api/saUnitMeasure/saUnitMeasure.model','../api/saProduct/saProduct.model','SASalesCondition','../api/saSalesCondition/saSalesCondition.model','SAPriceList','../api/saPriceList/saPriceList.model','../api/saProductPricesList/saProductPricesList.model','SADossier','../api/saDossier/saDossier.model','SARequest','SAQuotation','../api/saQuotation/saQuotation.model','SAProductQuotation','../api/saProductQuotation/saProductQuotation.model','SAOrder','../api/saOrder/saOrder.model','SAProforma','../api/saProforma/saProforma.model','SAAsset','SAInvoiceDetail','../api/saInvoiceDetail/saInvoiceDetail.model','../api/saProformaDetail/saProformaDetail.model','../api/saPayment/saPayment.model','SAPaymentMethod','../api/saPaymentMethod/saPaymentMethod.model','SACreditNote','../api/saCreditNote/saCreditNote.model','../api/saCreditNoteDetail/saCreditNoteDetail.model','SAInvoiceNumber','../api/saInvoiceNumber/saInvoiceNumber.model','SACreditNoteNumber','SACompanyType','../api/saCompanyType/saCompanyType.model','SACompanyRelationship','../api/saCompanyRelationship/saCompanyRelationship.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','VoiceExtension','CmHopperFinal','CmHopperHistory','HopperHistory','OpenchannelInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','belongsToMany','cm_user_has_lists','user_has_teams','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserMailQueue','FaxQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkBackup','TrunkBackupId','Interval','IntervalId','Pause','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','ContactId','MailAccountId','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','restrict','TagId','FaxAccountId','Exntensions','mandatoryDispositionPauseId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','Teams','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteraction','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CmCompany','RelatedCompany','CompanyId','PriceLists','Dossiers','saPaymentMethod','HopperHistories','Company','cm_contact_has_tags','CampaignId','All','Any','OneAny','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','AccountId','DeskAccount','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','ToId','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','ChatQueues','team_has_fax_queues','SmsQueues','team_has_openchannel_queues','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','ToAgent','FromFaxAccountId','FromUserId','OpenchannelTransferReport','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','Extensions','UserProfileSections','userProfileId','sectionId','WorkflowId','CrmTask','WorkflowStepId','CrmWorkflowNextStep','crm_workflow_steps_has_crm_workflow_steps','TaskId','TypeProductId','SAProduct','UnitMeasureId','SAProductPricesList','ProductId','SaleCondition','TypeSalesConditionId','SATypeProduct','TypeProduct','PriceListId','ProductPriceList','ProductPriceListId','DossierId','Workflow','RequestId','Requests','Dossier','Quotations','QuotationId','ProductPricesList','Quotation','Proforma','SAInvoice','Invoice','OrderId','Request','ProformaId','SAProformaDetail','SAPayment','Order','InvoiceId','Details','Payments','Companies','SACreditNoteDetail','CreditNote','CompanyType','saCompanyType','CompanyRelationship','exports','path','sequelize','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration'];(function(_0x6b5965,_0x4fe3a8){var _0x615b29=function(_0x39e361){while(--_0x39e361){_0x6b5965['push'](_0x6b5965['shift']());}};_0x615b29(++_0x4fe3a8);}(_0xa7a8,0x183));var _0x8a7a=function(_0x4b0ddb,_0x27bcdb){_0x4b0ddb=_0x4b0ddb-0x0;var _0x38b542=_0xa7a8[_0x4b0ddb];return _0x38b542;};'use strict';var path=require(_0x8a7a('0x0'));var config=require('../config/environment');var Sequelize=require(_0x8a7a('0x1'));var _=require('lodash');var jstz=require(_0x8a7a('0x2'));var timezone=jstz[_0x8a7a('0x3')]();config[_0x8a7a('0x1')]=_[_0x8a7a('0x4')](config[_0x8a7a('0x1')],{'database':_0x8a7a('0x5'),'username':'xcall','password':_0x8a7a('0x6'),'options':{'host':_0x8a7a('0x7'),'port':0xcea,'dialect':_0x8a7a('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8a7a('0x9')](),'define':{'charset':_0x8a7a('0xa'),'collate':_0x8a7a('0xb')}}});config[_0x8a7a('0xc')]=_[_0x8a7a('0x4')](config[_0x8a7a('0xc')],{'database':_0x8a7a('0x5'),'username':_0x8a7a('0xd'),'password':_0x8a7a('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8a7a('0x8'),'dialectOptions':{'charset':_0x8a7a('0xe')},'logging':![],'timezone':timezone[_0x8a7a('0x9')](),'define':{'charset':_0x8a7a('0xa'),'collate':_0x8a7a('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8a7a('0x1')][_0x8a7a('0xf')],config['sequelize'][_0x8a7a('0x10')],config['sequelize'][_0x8a7a('0x11')],config['sequelize'][_0x8a7a('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8a7a('0xc')]['database'],config['sequelizeHistory'][_0x8a7a('0x10')],config[_0x8a7a('0xc')][_0x8a7a('0x11')],config[_0x8a7a('0xc')][_0x8a7a('0x12')])};db[_0x8a7a('0x13')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x15'));db['VoiceChanSpy']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x8a7a('0x16')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x17'));db['VoiceExtension']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x18'));db['VoiceMusicOnHold']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x19'));db[_0x8a7a('0x1a')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x8a7a('0x1b')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x1c'));db[_0x8a7a('0x1d')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x1e'));db[_0x8a7a('0x1f')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x20'));db[_0x8a7a('0x21')]=db['sequelize']['import'](_0x8a7a('0x22'));db[_0x8a7a('0x23')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x24'));db[_0x8a7a('0x25')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x26'));db[_0x8a7a('0x27')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x28'));db[_0x8a7a('0x29')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x2a'));db[_0x8a7a('0x2b')]=db['sequelize'][_0x8a7a('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x8a7a('0x2c')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x2d'));db[_0x8a7a('0x2e')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x8a7a('0x2f')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x30'));db['UserMailQueue']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x8a7a('0x31')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x32'));db[_0x8a7a('0x33')]=db[_0x8a7a('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x8a7a('0x34')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x35'));db[_0x8a7a('0x36')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x37'));db[_0x8a7a('0x38')]=db[_0x8a7a('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x8a7a('0x39')]=db['sequelize']['import'](_0x8a7a('0x3a'));db[_0x8a7a('0x3b')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x3c'));db[_0x8a7a('0x3d')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x8a7a('0x3e')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x3f'));db[_0x8a7a('0x40')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/mailMessage/mailMessage.model');db[_0x8a7a('0x41')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x42'));db[_0x8a7a('0x43')]=db['sequelize'][_0x8a7a('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0x8a7a('0x44')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x45'));db[_0x8a7a('0x46')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x47'));db[_0x8a7a('0x48')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x49'));db[_0x8a7a('0x4a')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x4b'));db[_0x8a7a('0x4c')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x8a7a('0x4d')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x4e'));db[_0x8a7a('0x4f')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x50'));db[_0x8a7a('0x51')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x52'));db[_0x8a7a('0x53')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x54'));db['SmsInteraction']=db[_0x8a7a('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x8a7a('0x55')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x56'));db[_0x8a7a('0x57')]=db['sequelize']['import'](_0x8a7a('0x58'));db[_0x8a7a('0x59')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x5a'));db['OpenchannelApplication']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x5b'));db['OpenchannelInteraction']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x5c'));db['OpenchannelMessage']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x5d'));db[_0x8a7a('0x5e')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x5f'));db['ChatWebsite']=db[_0x8a7a('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db[_0x8a7a('0x60')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x61'));db['ChatApplication']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/chatApplication/chatApplication.model');db[_0x8a7a('0x62')]=db[_0x8a7a('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x8a7a('0x63')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x64'));db[_0x8a7a('0x65')]=db[_0x8a7a('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x8a7a('0x66')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x67'));db[_0x8a7a('0x68')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x69'));db[_0x8a7a('0x6a')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x6b'));db[_0x8a7a('0x6c')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x6d'));db[_0x8a7a('0x6e')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x6f'));db[_0x8a7a('0x70')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x71'));db[_0x8a7a('0x72')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x73'));db[_0x8a7a('0x74')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x75'));db[_0x8a7a('0x76')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x77'));db[_0x8a7a('0x78')]=db['sequelize']['import']('../api/automation/automation.model');db[_0x8a7a('0x79')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x7a'));db[_0x8a7a('0x7b')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x7c'));db[_0x8a7a('0x7d')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x7e'));db['Interval']=db['sequelize'][_0x8a7a('0x14')]('../api/interval/interval.model');db['Pause']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x7f'));db[_0x8a7a('0x80')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x81'));db[_0x8a7a('0x82')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x83'));db['Schedule']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/schedule/schedule.model');db[_0x8a7a('0x84')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x85'));db[_0x8a7a('0x86')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/tag/tag.model');db[_0x8a7a('0x87')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x88'));db[_0x8a7a('0x89')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x8a'));db[_0x8a7a('0x8b')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x8c'));db['Integration']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x8d'));db[_0x8a7a('0x8e')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x8f'));db[_0x8a7a('0x90')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0x91'));db['AnalyticDefaultReport']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x92'));db['AnalyticExtractedReport']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x93'));db[_0x8a7a('0x94')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x95'));db[_0x8a7a('0x96')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x97'));db[_0x8a7a('0x98')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x99'));db['SalesforceAccount']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x9a'));db[_0x8a7a('0x9b')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x8a7a('0x9c')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x8a7a('0x9d')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x9e'));db[_0x8a7a('0x9f')]=db[_0x8a7a('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x8a7a('0xa0')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xa1'));db['DeskAccount']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x8a7a('0xa2')]=db[_0x8a7a('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x8a7a('0xa3')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xa4'));db[_0x8a7a('0xa5')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xa6'));db['ZohoConfiguration']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xa7'));db[_0x8a7a('0xa8')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xa9'));db[_0x8a7a('0xaa')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xab'));db['ZendeskConfiguration']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xac'));db['ZendeskField']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xad'));db['FreshdeskAccount']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xae'));db[_0x8a7a('0xaf')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xb0'));db[_0x8a7a('0xb1')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xb2'));db[_0x8a7a('0xb3')]=db['sequelize'][_0x8a7a('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8a7a('0xb4')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xb5'));db[_0x8a7a('0xb6')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xb7'));db['ServicenowAccount']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xb8'));db['ServicenowConfiguration']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xb9'));db[_0x8a7a('0xba')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xbb'));db['Dynamics365Account']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xbc'));db['Dynamics365Configuration']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xbd'));db[_0x8a7a('0xbe')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xbf'));db['Integration']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x8d'));db[_0x8a7a('0xc0')]=db['sequelize'][_0x8a7a('0x14')]('../api/network/network.model');db[_0x8a7a('0xc1')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xc2'));db[_0x8a7a('0xc3')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xc4'));db[_0x8a7a('0xc5')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x8a7a('0xc6')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xc7'));db[_0x8a7a('0xc8')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x8a7a('0xc9')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x8a7a('0xca')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/squareReport/squareReport.model');db[_0x8a7a('0xcb')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xcc'));db[_0x8a7a('0xcd')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xce'));db[_0x8a7a('0xcf')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xd0'));db[_0x8a7a('0xd1')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xd2'));db['SquareRecording']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xd3'));db['SquareMessage']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xd4'));db[_0x8a7a('0xd5')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xd6'));db['License']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xd7'));db[_0x8a7a('0xd8')]=db['sequelize'][_0x8a7a('0x14')]('../api/campaign/campaign.model');db[_0x8a7a('0xd9')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xda'));db[_0x8a7a('0xdb')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xdc'));db[_0x8a7a('0xdd')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xde'));db[_0x8a7a('0xdf')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xe0'));db['ChatTransferReport']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xe1'));db[_0x8a7a('0xe2')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xe3'));db['SmsTransferReport']=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xe4'));db[_0x8a7a('0xe5')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xe6'));db['VoicePrefix']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xe7'));db[_0x8a7a('0xe8')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xe9'));db[_0x8a7a('0xea')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xeb'));db['UserProfileResource']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xec'));db[_0x8a7a('0xed')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/crmNation/crmNation.model');db['CrmWorkflow']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xee'));db[_0x8a7a('0xef')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xf0'));db['CrmTask']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xf1'));db[_0x8a7a('0xf2')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/crmActionsList/crmActionsList.model');db['SATypeProduct']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xf3'));db[_0x8a7a('0xf4')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xf5'));db['SAInvoiceLaw']=db[_0x8a7a('0x1')][_0x8a7a('0x14')]('../api/saInvoiceLaw/saInvoiceLaw.model');db['SAProduct']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xf6'));db[_0x8a7a('0xf7')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0xf8'));db[_0x8a7a('0xf9')]=db['sequelize']['import'](_0x8a7a('0xfa'));db['SAProductPricesList']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0xfb'));db[_0x8a7a('0xfc')]=db['sequelize'][_0x8a7a('0x14')](_0x8a7a('0xfd'));db[_0x8a7a('0xfe')]=db[_0x8a7a('0x1')]['import']('../api/saRequest/saRequest.model');db[_0x8a7a('0xff')]=db['sequelize']['import'](_0x8a7a('0x100'));db[_0x8a7a('0x101')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x102'));db[_0x8a7a('0x103')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x104'));db[_0x8a7a('0x105')]=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x106'));db['SAInvoice']=db[_0x8a7a('0x1')]['import']('../api/saInvoice/saInvoice.model');db[_0x8a7a('0x107')]=db[_0x8a7a('0x1')]['import']('../api/saAsset/saAsset.model');db[_0x8a7a('0x108')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x109'));db['SAProformaDetail']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x10a'));db['SAPayment']=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x10b'));db[_0x8a7a('0x10c')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x10d'));db[_0x8a7a('0x10e')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x10f'));db['SACreditNoteDetail']=db[_0x8a7a('0x1')]['import'](_0x8a7a('0x110'));db[_0x8a7a('0x111')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x112'));db[_0x8a7a('0x113')]=db['sequelize'][_0x8a7a('0x14')]('../api/saCreditNoteNumber/saCreditNoteNumber.model');db[_0x8a7a('0x114')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x115'));db[_0x8a7a('0x116')]=db[_0x8a7a('0x1')][_0x8a7a('0x14')](_0x8a7a('0x117'));db[_0x8a7a('0x13')][_0x8a7a('0x118')](db['VoiceMail'],{'as':_0x8a7a('0x1f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')]['hasMany'](db[_0x8a7a('0x1b')],{'as':_0x8a7a('0x11b'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db[_0x8a7a('0x2c')],{'as':_0x8a7a('0x11d'),'foreignKey':'UserId'});db[_0x8a7a('0x13')]['hasMany'](db[_0x8a7a('0x11e')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db[_0x8a7a('0x11f')],{'as':'HopperFinals','foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')]['hasMany'](db[_0x8a7a('0x120')],{'as':_0x8a7a('0x121'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db[_0x8a7a('0x72')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db['OpenchannelInteraction'],{'as':_0x8a7a('0x122'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db[_0x8a7a('0x62')],{'as':'ChatInteractions','foreignKey':'UserId'});db['User'][_0x8a7a('0x11c')](db[_0x8a7a('0x123')],{'as':_0x8a7a('0x124'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')]['hasMany'](db['FaxInteraction'],{'as':_0x8a7a('0x125'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x13')][_0x8a7a('0x11c')](db[_0x8a7a('0x3e')],{'as':_0x8a7a('0x126'),'foreignKey':'UserId'});db['User']['belongsTo'](db[_0x8a7a('0xe8')],{'as':_0x8a7a('0xe8'),'foreignKey':'userProfileId'});db[_0x8a7a('0x13')]['belongsToMany'](db[_0x8a7a('0x68')],{'as':_0x8a7a('0x127'),'through':_0x8a7a('0x128')});db[_0x8a7a('0x13')]['belongsToMany'](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x129'),'through':_0x8a7a('0x12a')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0xe5')],{'as':'Lists','through':_0x8a7a('0x12c')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0xd5')],{'through':_0x8a7a('0x12d')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x3e')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x62')],{'as':_0x8a7a('0x12e'),'through':_0x8a7a('0x12f')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x8a7a('0x130')});db['User'][_0x8a7a('0x12b')](db[_0x8a7a('0x123')],{'as':_0x8a7a('0x124'),'through':_0x8a7a('0x131')});db[_0x8a7a('0x13')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x8a7a('0x122'),'through':_0x8a7a('0x132')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x1a')],{'as':_0x8a7a('0x133'),'through':_0x8a7a('0x2e'),'required':![]});db[_0x8a7a('0x13')]['belongsToMany'](db[_0x8a7a('0x3b')],{'as':_0x8a7a('0x134'),'through':_0x8a7a('0x135'),'required':![]});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db['ChatQueue'],{'as':'ChatQueues','through':_0x8a7a('0x2f'),'required':![],'hooks':!![]});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x4f')],{'as':_0x8a7a('0x136'),'through':_0x8a7a('0x31'),'required':![]});db['User'][_0x8a7a('0x12b')](db[_0x8a7a('0x57')],{'as':'SmsQueues','through':_0x8a7a('0x33'),'required':![]});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x5e')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0xe5')],{'through':_0x8a7a('0x12c')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x137')],{'as':_0x8a7a('0x138'),'through':_0x8a7a('0x139'),'required':![]});db['User'][_0x8a7a('0x12b')](db[_0x8a7a('0x13a')],{'as':_0x8a7a('0x13b'),'through':_0x8a7a('0x13c')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db['FaxAccount'],{'as':_0x8a7a('0x13d'),'through':_0x8a7a('0x13e')});db['User'][_0x8a7a('0x12b')](db['MailAccount'],{'as':'MailAccounts','through':_0x8a7a('0x13f')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x59')],{'as':'OpenchannelAccounts','through':_0x8a7a('0x140')});db[_0x8a7a('0x13')][_0x8a7a('0x12b')](db[_0x8a7a('0x51')],{'as':_0x8a7a('0x141'),'through':_0x8a7a('0x142')});db[_0x8a7a('0x13')]['belongsToMany'](db['SquareProject'],{'as':_0x8a7a('0x143'),'through':_0x8a7a('0x144')});db[_0x8a7a('0x145')][_0x8a7a('0x11c')](db['VoiceExtension'],{'as':_0x8a7a('0x146'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x147')});db['VoiceContext']['hasMany'](db[_0x8a7a('0x11e')],{'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x11e')]['hasMany'](db[_0x8a7a('0x11e')],{'as':_0x8a7a('0x148'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x149')][_0x8a7a('0x12b')](db[_0x8a7a('0x84')],{'as':'Sounds','through':_0x8a7a('0x14a')});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0x8a7a('0x14b'),'foreignKey':_0x8a7a('0x14c')});db[_0x8a7a('0x1a')][_0x8a7a('0x11c')](db[_0x8a7a('0x6e')],{'as':_0x8a7a('0x14d'),'foreignKey':_0x8a7a('0x14c')});db['VoiceQueue'][_0x8a7a('0x11c')](db[_0x8a7a('0x11f')],{'as':_0x8a7a('0x14e'),'foreignKey':_0x8a7a('0x14c')});db[_0x8a7a('0x1a')][_0x8a7a('0x11c')](db[_0x8a7a('0x120')],{'as':'HopperHistories','foreignKey':_0x8a7a('0x14c')});db[_0x8a7a('0x1a')]['hasMany'](db[_0x8a7a('0x72')],{'as':_0x8a7a('0x72'),'foreignKey':_0x8a7a('0x14c')});db['VoiceQueue'][_0x8a7a('0x11c')](db[_0x8a7a('0x70')],{'as':_0x8a7a('0x14f'),'foreignKey':_0x8a7a('0x14c')});db[_0x8a7a('0x1a')][_0x8a7a('0x11c')](db['JscriptySessionReport'],{'as':_0x8a7a('0x150'),'foreignKey':_0x8a7a('0x14c')});db['VoiceQueue'][_0x8a7a('0x151')](db[_0x8a7a('0x152')],{'as':_0x8a7a('0x152'),'foreignKey':'TrunkId'});db[_0x8a7a('0x1a')][_0x8a7a('0x151')](db[_0x8a7a('0x152')],{'as':_0x8a7a('0x153'),'foreignKey':_0x8a7a('0x154')});db[_0x8a7a('0x1a')][_0x8a7a('0x151')](db[_0x8a7a('0x155')],{'as':_0x8a7a('0x155'),'foreignKey':_0x8a7a('0x156')});db[_0x8a7a('0x1a')][_0x8a7a('0x151')](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a7a('0x1a')][_0x8a7a('0x12b')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x159'),'through':_0x8a7a('0x15a')});db[_0x8a7a('0x1a')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':'UserVoiceQueue'});db[_0x8a7a('0x1a')]['belongsToMany'](db[_0x8a7a('0xd5')],{'as':'Teams','through':_0x8a7a('0x15c')});db[_0x8a7a('0x1a')]['belongsToMany'](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x15d'),'through':_0x8a7a('0x15e')});db[_0x8a7a('0x1b')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x13'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x1d')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x13'),'foreignKey':_0x8a7a('0x11a')});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x160'),'sourceKey':_0x8a7a('0x161')});db['VoiceMailMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x1f')],{'foreignKey':_0x8a7a('0x160'),'targetKey':_0x8a7a('0x161')});db[_0x8a7a('0x23')][_0x8a7a('0x11c')](db[_0x8a7a('0x27')],{'as':_0x8a7a('0x162'),'foreignKey':'uniqueid','constraints':![]});db[_0x8a7a('0x23')]['hasMany'](db[_0x8a7a('0x163')],{'as':_0x8a7a('0x164'),'foreignKey':_0x8a7a('0x165'),'constraints':![]});db[_0x8a7a('0x23')][_0x8a7a('0x151')](db['User'],{'as':_0x8a7a('0x13'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x23')]['belongsTo'](db[_0x8a7a('0x6c')],{'as':'Contact','foreignKey':_0x8a7a('0x166')});db['MailServerIn'][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{'as':_0x8a7a('0x39'),'foreignKey':_0x8a7a('0x167')});db[_0x8a7a('0x38')][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{'as':_0x8a7a('0x39'),'foreignKey':_0x8a7a('0x167')});db['MailAccount'][_0x8a7a('0x118')](db[_0x8a7a('0x36')],{'as':'Imap','onDelete':'cascade'});db[_0x8a7a('0x39')][_0x8a7a('0x118')](db[_0x8a7a('0x38')],{'as':_0x8a7a('0x168'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x39')][_0x8a7a('0x11c')](db[_0x8a7a('0x7b')],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x167')});db[_0x8a7a('0x39')][_0x8a7a('0x11c')](db['CannedAnswer'],{'as':_0x8a7a('0x16a'),'foreignKey':'MailAccountId'});db[_0x8a7a('0x39')][_0x8a7a('0x11c')](db[_0x8a7a('0x40')],{'as':_0x8a7a('0x15f'),'foreignKey':_0x8a7a('0x167')});db['MailAccount'][_0x8a7a('0x11c')](db['MailInteraction'],{'as':_0x8a7a('0x16b')});db[_0x8a7a('0x39')][_0x8a7a('0x11c')](db[_0x8a7a('0x41')],{'as':_0x8a7a('0x148')});db[_0x8a7a('0x39')]['belongsTo'](db['CmList'],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0x39')]['belongsTo'](db[_0x8a7a('0x87')],{'as':'Template','foreignKey':_0x8a7a('0x16e')});db[_0x8a7a('0x39')][_0x8a7a('0x151')](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a7a('0x39')]['belongsToMany'](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x13f')});db[_0x8a7a('0x3b')]['belongsToMany'](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x135')});db[_0x8a7a('0x3b')][_0x8a7a('0x12b')](db[_0x8a7a('0xd5')],{'through':'team_has_mail_queues','as':'Teams'});db[_0x8a7a('0x3e')][_0x8a7a('0x11c')](db['MailMessage'],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x16f')});db[_0x8a7a('0x3e')][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x167')});db['MailInteraction'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x3e')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x172'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x3e')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x173'),'as':_0x8a7a('0x174')});db[_0x8a7a('0x3e')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':'mail_interaction_has_tags','as':_0x8a7a('0x175')});db[_0x8a7a('0x3e')]['belongsToMany'](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x176'),'through':_0x8a7a('0x177'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db['Attachment'],{'as':_0x8a7a('0x178'),'onDelete':'cascade'});db['MailMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x13')});db['MailMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'onDelete':_0x8a7a('0x119'),'as':_0x8a7a('0x171')});db[_0x8a7a('0x40')][_0x8a7a('0x151')](db['MailInteraction'],{'as':_0x8a7a('0x179'),'foreignKey':_0x8a7a('0x16f')});db['MailMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x167')});db['MailApplication']['belongsTo'](db[_0x8a7a('0x13')],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x41')][_0x8a7a('0x151')](db[_0x8a7a('0x3b')],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x41')][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{'onDelete':_0x8a7a('0x17a')});db['MailApplication'][_0x8a7a('0x151')](db[_0x8a7a('0x155')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':'IntervalId'});db[_0x8a7a('0x41')]['belongsTo'](db[_0x8a7a('0x86')],{'onDelete':'restrict','foreignKey':_0x8a7a('0x17b')});db[_0x8a7a('0x43')][_0x8a7a('0x151')](db['MailAccount'],{});db[_0x8a7a('0x43')][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':'List','foreignKey':'ListId'});db[_0x8a7a('0x43')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x43')][_0x8a7a('0x151')](db[_0x8a7a('0x3e')],{});db['MailQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0x40')],{});db[_0x8a7a('0x43')]['belongsTo'](db['User'],{});db['MailQueueReport'][_0x8a7a('0x151')](db['MailQueue'],{});db['Dashboard']['hasMany'](db[_0x8a7a('0x46')],{'as':'Items','onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x48')][_0x8a7a('0x11c')](db[_0x8a7a('0x7b')],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x17c')});db['FaxAccount'][_0x8a7a('0x11c')](db[_0x8a7a('0x79')],{'as':_0x8a7a('0x16a'),'foreignKey':'FaxAccountId'});db[_0x8a7a('0x48')][_0x8a7a('0x11c')](db[_0x8a7a('0x4c')],{'as':'Interactions'});db[_0x8a7a('0x48')][_0x8a7a('0x11c')](db[_0x8a7a('0x4a')],{'as':_0x8a7a('0x148')});db[_0x8a7a('0x48')][_0x8a7a('0x11c')](db[_0x8a7a('0x11e')],{'as':_0x8a7a('0x17d'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x48')][_0x8a7a('0x11c')](db['FaxMessage'],{'as':_0x8a7a('0x15f')});db['FaxAccount'][_0x8a7a('0x151')](db[_0x8a7a('0x152')],{'as':_0x8a7a('0x152')});db[_0x8a7a('0x48')][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0x48')]['belongsTo'](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':_0x8a7a('0x17e')});db[_0x8a7a('0x48')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x8a7a('0x4a')]['belongsTo'](db[_0x8a7a('0x13')],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x4a')][_0x8a7a('0x151')](db['FaxQueue'],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x4a')][_0x8a7a('0x151')](db[_0x8a7a('0x48')],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x4a')][_0x8a7a('0x151')](db[_0x8a7a('0x86')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':_0x8a7a('0x17b')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x17f')});db[_0x8a7a('0x4c')][_0x8a7a('0x151')](db[_0x8a7a('0x48')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x17c')});db['FaxInteraction'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x172'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x4c')]['belongsToMany'](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x180'),'as':_0x8a7a('0x174')});db[_0x8a7a('0x4c')]['belongsToMany'](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x180'),'as':'ThroughTags'});db[_0x8a7a('0x4c')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':'Users','through':_0x8a7a('0x130'),'foreignKey':_0x8a7a('0x17f')});db[_0x8a7a('0x4d')]['belongsTo'](db[_0x8a7a('0x13')],{'onDelete':_0x8a7a('0x119'),'as':_0x8a7a('0x13')});db['FaxMessage'][_0x8a7a('0x151')](db['FaxInteraction'],{'as':_0x8a7a('0x179'),'foreignKey':_0x8a7a('0x17f')});db[_0x8a7a('0x4d')][_0x8a7a('0x151')](db['CmContact'],{'onDelete':_0x8a7a('0x119'),'as':'Contact'});db[_0x8a7a('0x4d')]['belongsTo'](db[_0x8a7a('0xdb')],{'as':_0x8a7a('0xdb'),'foreignKey':_0x8a7a('0x181')});db[_0x8a7a('0x4d')][_0x8a7a('0x151')](db[_0x8a7a('0x48')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x17c')});db[_0x8a7a('0x4f')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x31')});db['FaxQueue']['belongsToMany'](db[_0x8a7a('0xd5')],{'through':'team_has_fax_queues','as':_0x8a7a('0x182')});db[_0x8a7a('0x183')]['belongsTo'](db[_0x8a7a('0x48')],{});db['FaxQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d')});db['FaxQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':'ContactId'});db[_0x8a7a('0x183')][_0x8a7a('0x151')](db[_0x8a7a('0x4c')],{});db[_0x8a7a('0x183')][_0x8a7a('0x151')](db[_0x8a7a('0x4d')],{});db[_0x8a7a('0x183')]['belongsTo'](db[_0x8a7a('0x13')],{});db[_0x8a7a('0x183')][_0x8a7a('0x151')](db[_0x8a7a('0x4f')],{});db[_0x8a7a('0x51')][_0x8a7a('0x11c')](db[_0x8a7a('0x7b')],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x184')});db[_0x8a7a('0x51')][_0x8a7a('0x11c')](db[_0x8a7a('0x79')],{'as':'Answers','foreignKey':_0x8a7a('0x184')});db[_0x8a7a('0x51')][_0x8a7a('0x11c')](db[_0x8a7a('0x55')],{'as':_0x8a7a('0x15f'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x8a7a('0x11c')](db['SmsInteraction'],{'as':_0x8a7a('0x16b')});db[_0x8a7a('0x51')]['hasMany'](db[_0x8a7a('0x53')],{'as':_0x8a7a('0x148')});db[_0x8a7a('0x51')][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':'ListId'});db[_0x8a7a('0x51')][_0x8a7a('0x151')](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':_0x8a7a('0x17e')});db[_0x8a7a('0x51')]['belongsToMany'](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x142')});db[_0x8a7a('0x53')][_0x8a7a('0x151')](db['User'],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x53')][_0x8a7a('0x151')](db[_0x8a7a('0x57')],{'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x53')][_0x8a7a('0x151')](db[_0x8a7a('0x51')],{'onDelete':_0x8a7a('0x17a')});db['SmsApplication'][_0x8a7a('0x151')](db['Interval'],{'onDelete':_0x8a7a('0x17a'),'foreignKey':_0x8a7a('0x156')});db[_0x8a7a('0x53')][_0x8a7a('0x151')](db[_0x8a7a('0x86')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':_0x8a7a('0x17b')});db['SmsInteraction'][_0x8a7a('0x11c')](db[_0x8a7a('0x55')],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x185')});db['SmsInteraction'][_0x8a7a('0x151')](db['SmsAccount'],{'as':'Account','foreignKey':_0x8a7a('0x184')});db[_0x8a7a('0x123')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x123')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x172'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x123')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction'][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x186'),'as':'ThroughTags'});db[_0x8a7a('0x123')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x8a7a('0x185')});db[_0x8a7a('0x55')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x13')});db[_0x8a7a('0x55')]['belongsTo'](db[_0x8a7a('0x6c')],{'onDelete':'cascade','as':_0x8a7a('0x171')});db['SmsMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x123')],{'onDelete':_0x8a7a('0x119'),'as':_0x8a7a('0x179'),'foreignKey':_0x8a7a('0x185')});db['SmsMessage'][_0x8a7a('0x151')](db['SmsAccount'],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x184')});db[_0x8a7a('0x57')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x33'),'foreignKey':_0x8a7a('0x187')});db[_0x8a7a('0x57')][_0x8a7a('0x12b')](db['Team'],{'through':_0x8a7a('0x188'),'as':'Teams'});db[_0x8a7a('0x59')][_0x8a7a('0x11c')](db[_0x8a7a('0x7b')],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x59')][_0x8a7a('0x11c')](db[_0x8a7a('0x79')],{'as':'Answers','foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x59')][_0x8a7a('0x11c')](db['OpenchannelInteraction'],{'as':_0x8a7a('0x16b'),'foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x59')][_0x8a7a('0x11c')](db[_0x8a7a('0x18a')],{'as':_0x8a7a('0x15f'),'foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x59')][_0x8a7a('0x11c')](db[_0x8a7a('0x18b')],{'as':_0x8a7a('0x148'),'foreignKey':_0x8a7a('0x189')});db['OpenchannelAccount']['belongsTo'](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':'ListId'});db[_0x8a7a('0x59')][_0x8a7a('0x151')](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a7a('0x59')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x140')});db['OpenchannelApplication'][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'onDelete':'restrict'});db[_0x8a7a('0x18b')]['belongsTo'](db[_0x8a7a('0x5e')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x8a7a('0x18b')][_0x8a7a('0x151')](db[_0x8a7a('0x59')],{'onDelete':'restrict','foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x18b')][_0x8a7a('0x151')](db[_0x8a7a('0x155')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':'IntervalId'});db[_0x8a7a('0x18b')]['belongsTo'](db[_0x8a7a('0x86')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':_0x8a7a('0x17b')});db[_0x8a7a('0x18c')][_0x8a7a('0x11c')](db[_0x8a7a('0x18a')],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x18d')});db['OpenchannelInteraction'][_0x8a7a('0x151')](db[_0x8a7a('0x59')],{'as':'Account','foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x18c')]['belongsTo'](db['CmContact'],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x18c')]['belongsTo'](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x172'),'foreignKey':_0x8a7a('0x11a')});db['OpenchannelInteraction'][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x18e'),'as':_0x8a7a('0x174')});db['OpenchannelInteraction'][_0x8a7a('0x12b')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x8a7a('0x175')});db[_0x8a7a('0x18c')]['belongsToMany'](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x8a7a('0x18d')});db[_0x8a7a('0x18a')]['belongsTo'](db[_0x8a7a('0x13')],{'onDelete':_0x8a7a('0x119'),'as':'User'});db['OpenchannelMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'onDelete':'cascade','as':_0x8a7a('0x171')});db['OpenchannelMessage']['belongsTo'](db[_0x8a7a('0x18c')],{'onDelete':_0x8a7a('0x119'),'as':'Interaction','foreignKey':_0x8a7a('0x18d')});db['OpenchannelMessage'][_0x8a7a('0x151')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x59')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x189')});db[_0x8a7a('0x5e')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':'UserOpenchannelQueue','foreignKey':_0x8a7a('0x18f')});db['OpenchannelQueue'][_0x8a7a('0x12b')](db[_0x8a7a('0xd5')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x8a7a('0x13a')][_0x8a7a('0x11c')](db[_0x8a7a('0x7b')],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x190')});db['ChatWebsite'][_0x8a7a('0x11c')](db['CannedAnswer'],{'as':_0x8a7a('0x16a'),'foreignKey':_0x8a7a('0x190')});db[_0x8a7a('0x13a')][_0x8a7a('0x11c')](db['ChatProactiveAction'],{'as':_0x8a7a('0x191')});db[_0x8a7a('0x13a')][_0x8a7a('0x11c')](db[_0x8a7a('0x62')],{'as':_0x8a7a('0x16b')});db[_0x8a7a('0x13a')][_0x8a7a('0x11c')](db['ChatApplication'],{'as':'Applications'});db[_0x8a7a('0x13a')][_0x8a7a('0x11c')](db[_0x8a7a('0x63')],{'as':'Messages'});db[_0x8a7a('0x13a')][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':'ListId'});db['ChatWebsite']['belongsTo'](db[_0x8a7a('0x155')],{'as':_0x8a7a('0x155'),'foreignKey':_0x8a7a('0x156')});db[_0x8a7a('0x13a')][_0x8a7a('0x151')](db[_0x8a7a('0x157')],{'as':_0x8a7a('0x158'),'foreignKey':_0x8a7a('0x17e')});db[_0x8a7a('0x13a')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x13c')});db[_0x8a7a('0x60')][_0x8a7a('0x151')](db['OpenchannelAccount'],{});db[_0x8a7a('0x60')][_0x8a7a('0x151')](db['CmList'],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0x60')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db['OpenchannelQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0x18c')],{});db[_0x8a7a('0x60')][_0x8a7a('0x151')](db[_0x8a7a('0x18a')],{});db[_0x8a7a('0x60')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{});db[_0x8a7a('0x60')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x8a7a('0x192')]['belongsTo'](db['User'],{'as':_0x8a7a('0x193'),'foreignKey':'UserId','onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x192')]['belongsTo'](db['ChatQueue'],{'as':_0x8a7a('0x194'),'foreignKey':_0x8a7a('0x195'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x192')]['belongsTo'](db[_0x8a7a('0x13a')],{'as':_0x8a7a('0x196'),'foreignKey':_0x8a7a('0x190'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x192')][_0x8a7a('0x151')](db[_0x8a7a('0x86')],{'onDelete':_0x8a7a('0x17a'),'foreignKey':'TagId'});db['ChatInteraction'][_0x8a7a('0x11c')](db['ChatMessage'],{'as':_0x8a7a('0x15f'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x197')});db[_0x8a7a('0x62')]['belongsTo'](db[_0x8a7a('0x13a')],{'as':_0x8a7a('0x170'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x8a7a('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0x8a7a('0x62')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':'Owner','foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0x62')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x198'),'as':_0x8a7a('0x174')});db[_0x8a7a('0x62')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x198'),'as':'ThroughTags'});db[_0x8a7a('0x62')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x176'),'through':_0x8a7a('0x12f'),'foreignKey':'ChatInteractionId'});db[_0x8a7a('0x63')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'onDelete':_0x8a7a('0x119'),'as':'User'});db[_0x8a7a('0x63')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'onDelete':'cascade','as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db['ChatMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x62')],{'onDelete':_0x8a7a('0x119'),'as':_0x8a7a('0x179'),'foreignKey':'ChatInteractionId'});db[_0x8a7a('0x63')]['belongsTo'](db[_0x8a7a('0xdb')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x8a7a('0x63')][_0x8a7a('0x151')](db[_0x8a7a('0x13a')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x190')});db[_0x8a7a('0x65')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'onDelete':_0x8a7a('0x119'),'as':_0x8a7a('0x171'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x8a7a('0x151')](db[_0x8a7a('0x13a')],{'as':'Account','foreignKey':_0x8a7a('0x190')});db[_0x8a7a('0x66')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x15b'),'through':_0x8a7a('0x2f'),'hooks':!![]});db['ChatQueue'][_0x8a7a('0x12b')](db[_0x8a7a('0xd5')],{'through':_0x8a7a('0x199'),'as':_0x8a7a('0x182')});db[_0x8a7a('0x68')][_0x8a7a('0x11c')](db['ChatInternalMessage'],{'as':_0x8a7a('0x15f'),'foreignKey':'ChatGroupId','onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x68')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x14b'),'through':'chat_group_has_users'});db['ChatProactiveAction']['belongsTo'](db[_0x8a7a('0x13a')],{'as':'Website','foreignKey':_0x8a7a('0x190')});db[_0x8a7a('0x19a')]['hasOne'](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x19b')});db['CmCompany']['hasMany'](db[_0x8a7a('0x6c')],{'as':'Contacts','foreignKey':_0x8a7a('0x19c')});db['CmCompany'][_0x8a7a('0x11c')](db[_0x8a7a('0xf9')],{'as':_0x8a7a('0x19d'),'foreignKey':_0x8a7a('0x19c')});db['CmCompany']['hasMany'](db[_0x8a7a('0xfc')],{'as':_0x8a7a('0x19e'),'foreignKey':_0x8a7a('0x19c')});db[_0x8a7a('0x19a')][_0x8a7a('0x151')](db[_0x8a7a('0x10c')],{'as':'PaymentMethod','foreignKey':_0x8a7a('0x19f')});db[_0x8a7a('0x6c')][_0x8a7a('0x11c')](db[_0x8a7a('0x6e')],{'as':_0x8a7a('0x14d'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x6c')]['hasMany'](db[_0x8a7a('0x11f')],{'as':_0x8a7a('0x14e'),'foreignKey':_0x8a7a('0x166')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0x8a7a('0x1a0'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x6c')][_0x8a7a('0x11c')](db[_0x8a7a('0x72')],{'as':_0x8a7a('0x72'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x6c')][_0x8a7a('0x11c')](db[_0x8a7a('0xc8')],{'as':_0x8a7a('0x150'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0x6c')]['hasMany'](db[_0x8a7a('0x18c')],{'as':_0x8a7a('0x122'),'foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x6c')][_0x8a7a('0x11c')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db['CmContact'][_0x8a7a('0x11c')](db[_0x8a7a('0x123')],{'as':_0x8a7a('0x124'),'foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x6c')][_0x8a7a('0x11c')](db[_0x8a7a('0x4c')],{'as':_0x8a7a('0x125'),'foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x6c')]['hasMany'](db[_0x8a7a('0x3e')],{'as':_0x8a7a('0x126'),'foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x6c')]['hasMany'](db['SADossier'],{'as':'Contact','foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x6c')]['belongsTo'](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x1a1'),'foreignKey':_0x8a7a('0x19c')});db[_0x8a7a('0x6c')]['belongsTo'](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':'ListId','onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x6c')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':'Users','through':_0x8a7a('0x12a')});db[_0x8a7a('0x6c')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'as':'Tags','through':'cm_contact_has_tags'});db['CmContact'][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x1a2'),'as':_0x8a7a('0x175')});db['CmHopper'][_0x8a7a('0x151')](db['CmContact'],{'as':_0x8a7a('0x171'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0x8a7a('0x6e')][_0x8a7a('0x151')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x6e')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x193'),'foreignKey':_0x8a7a('0x11a')});db['CmHopper'][_0x8a7a('0x151')](db[_0x8a7a('0x1a')],{'as':_0x8a7a('0x194'),'foreignKey':_0x8a7a('0x14c'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x6e')][_0x8a7a('0x151')](db['Campaign'],{'as':_0x8a7a('0xd8'),'foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper'][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x8a7a('0x70')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x70')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x70')][_0x8a7a('0x151')](db[_0x8a7a('0x1a')],{'as':_0x8a7a('0x194'),'foreignKey':'VoiceQueueId','onDelete':_0x8a7a('0x119')});db['CmHopperBlack'][_0x8a7a('0x151')](db[_0x8a7a('0xd8')],{'as':'Campaign','foreignKey':_0x8a7a('0x1a3'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0x78')][_0x8a7a('0x11c')](db['Condition'],{'as':{'plural':_0x8a7a('0x1a4'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x8a7a('0x119'),'hooks':!![]});db[_0x8a7a('0x78')][_0x8a7a('0x11c')](db[_0x8a7a('0x7d')],{'as':{'plural':_0x8a7a('0x1a5'),'singular':_0x8a7a('0x1a6')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x8a7a('0x78')][_0x8a7a('0x11c')](db[_0x8a7a('0x76')],{'as':'Actions','foreignKey':_0x8a7a('0x1a7'),'onDelete':_0x8a7a('0x119'),'hooks':!![]});db[_0x8a7a('0x155')][_0x8a7a('0x11c')](db[_0x8a7a('0x155')],{'as':_0x8a7a('0x1a8'),'foreignKey':_0x8a7a('0x156'),'onDelete':_0x8a7a('0x119'),'hooks':!![],'required':![]});db[_0x8a7a('0x155')]['hasMany'](db[_0x8a7a('0x11e')],{'as':'Extensions','foreignKey':_0x8a7a('0x156'),'onDelete':'restrict'});db['Interval'][_0x8a7a('0x11c')](db[_0x8a7a('0x41')],{'as':_0x8a7a('0x1a9'),'foreignKey':_0x8a7a('0x156')});db[_0x8a7a('0x155')]['hasMany'](db[_0x8a7a('0x192')],{'as':_0x8a7a('0x1aa'),'foreignKey':_0x8a7a('0x156')});db[_0x8a7a('0x155')]['hasMany'](db[_0x8a7a('0x4a')],{'as':_0x8a7a('0x1ab'),'foreignKey':'IntervalId'});db[_0x8a7a('0x155')][_0x8a7a('0x11c')](db['SmsApplication'],{'as':_0x8a7a('0x1ac'),'foreignKey':'IntervalId'});db[_0x8a7a('0x1ad')][_0x8a7a('0x151')](db[_0x8a7a('0x39')],{});db['Schedule']['belongsTo'](db[_0x8a7a('0x1ae')],{'foreignKey':_0x8a7a('0x1af')});db['Schedule'][_0x8a7a('0x151')](db['AnalyticCustomReport'],{'foreignKey':_0x8a7a('0x1b0')});db[_0x8a7a('0x84')][_0x8a7a('0x12b')](db[_0x8a7a('0x149')],{'as':'Mohs','through':_0x8a7a('0x14a'),'onDelete':_0x8a7a('0x17a')});db['Tag'][_0x8a7a('0x12b')](db[_0x8a7a('0x6c')],{'through':_0x8a7a('0x1a2')});db[_0x8a7a('0x86')][_0x8a7a('0x12b')](db[_0x8a7a('0x62')],{'through':'chat_interaction_has_tags'});db[_0x8a7a('0x86')][_0x8a7a('0x12b')](db['MailInteraction'],{'through':_0x8a7a('0x173')});db[_0x8a7a('0x86')][_0x8a7a('0x12b')](db[_0x8a7a('0x123')],{'through':_0x8a7a('0x186')});db[_0x8a7a('0x86')]['belongsToMany'](db[_0x8a7a('0x4c')],{'through':_0x8a7a('0x180')});db[_0x8a7a('0x86')][_0x8a7a('0x12b')](db[_0x8a7a('0x18c')],{'through':_0x8a7a('0x18e')});db[_0x8a7a('0x89')][_0x8a7a('0x11c')](db['Condition'],{'as':{'plural':_0x8a7a('0x1b1'),'singular':_0x8a7a('0x1b2')},'foreignKey':_0x8a7a('0x1b3'),'onDelete':_0x8a7a('0x119'),'hooks':!![]});db[_0x8a7a('0x89')]['hasMany'](db[_0x8a7a('0x7d')],{'as':{'plural':_0x8a7a('0x1b4'),'singular':_0x8a7a('0x1b5')},'foreignKey':'TriggerAnyId','onDelete':_0x8a7a('0x119'),'hooks':!![]});db[_0x8a7a('0x89')][_0x8a7a('0x11c')](db[_0x8a7a('0x76')],{'as':'Actions','foreignKey':_0x8a7a('0x1b6'),'onDelete':_0x8a7a('0x119'),'hooks':!![]});db['AnalyticCustomReport'][_0x8a7a('0x11c')](db[_0x8a7a('0x96')],{'as':'Fields','onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1b0'),'hooks':!![]});db[_0x8a7a('0x1ae')][_0x8a7a('0x11c')](db['AnalyticFieldReport'],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1af')});db[_0x8a7a('0x94')][_0x8a7a('0x11c')](db[_0x8a7a('0x96')],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':'MetricId'});db[_0x8a7a('0x96')][_0x8a7a('0x151')](db[_0x8a7a('0x94')],{'foreignKey':_0x8a7a('0x1b8')});db[_0x8a7a('0x1b9')][_0x8a7a('0x11c')](db[_0x8a7a('0x9b')],{'as':_0x8a7a('0x1ba'),'onDelete':_0x8a7a('0x119'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x8a7a('0x1bb'),'onDelete':'cascade','foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0x9b')]['hasMany'](db[_0x8a7a('0x9c')],{'as':_0x8a7a('0x1bd'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0x9b')][_0x8a7a('0x11c')](db[_0x8a7a('0x9c')],{'as':_0x8a7a('0x1b7'),'onDelete':'cascade','foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x9b')]['belongsTo'](db['SalesforceAccount'],{'as':_0x8a7a('0x170'),'foreignKey':'AccountId'});db[_0x8a7a('0x9c')][_0x8a7a('0x11c')](db['SalesforceField'],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db['SalesforceField'][_0x8a7a('0x11c')](db[_0x8a7a('0x9c')],{'as':_0x8a7a('0x1c1'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x8a7a('0x11c')](db[_0x8a7a('0x9c')],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x9c')][_0x8a7a('0x151')](db['Variable'],{'as':_0x8a7a('0x8b'),'foreignKey':_0x8a7a('0x1c3')});db[_0x8a7a('0x9d')]['hasMany'](db[_0x8a7a('0x9f')],{'as':_0x8a7a('0x1ba'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db['SugarcrmConfiguration']['hasMany'](db[_0x8a7a('0xa0')],{'as':_0x8a7a('0x1bb'),'onDelete':'cascade','foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0x9f')]['hasMany'](db[_0x8a7a('0xa0')],{'as':_0x8a7a('0x1bd'),'onDelete':_0x8a7a('0x119'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x8a7a('0x11c')](db['SugarcrmField'],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':'FieldId'});db[_0x8a7a('0x9f')][_0x8a7a('0x151')](db[_0x8a7a('0x9d')],{'as':_0x8a7a('0x170'),'foreignKey':'AccountId'});db[_0x8a7a('0xa0')][_0x8a7a('0x11c')](db[_0x8a7a('0xa0')],{'as':'Subject','foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0xa0')][_0x8a7a('0x11c')](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8a7a('0xa0')][_0x8a7a('0x11c')](db[_0x8a7a('0xa0')],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xa0')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0x8a7a('0x11c')](db['DeskConfiguration'],{'as':_0x8a7a('0x1ba'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xa2')]['hasMany'](db[_0x8a7a('0xa3')],{'as':'Subjects','onDelete':_0x8a7a('0x119'),'foreignKey':'SubjectId'});db[_0x8a7a('0xa2')][_0x8a7a('0x11c')](db[_0x8a7a('0xa3')],{'as':_0x8a7a('0x1bd'),'onDelete':_0x8a7a('0x119'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x8a7a('0x11c')](db['DeskField'],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xa2')][_0x8a7a('0x151')](db[_0x8a7a('0x1c5')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xa2')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x1c6')});db[_0x8a7a('0xa3')][_0x8a7a('0x11c')](db[_0x8a7a('0xa3')],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db['DeskField'][_0x8a7a('0x11c')](db[_0x8a7a('0xa3')],{'as':'Description','foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0xa3')]['hasMany'](db['DeskField'],{'as':'Field','foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xa3')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':_0x8a7a('0x8b'),'foreignKey':_0x8a7a('0x1c3')});db[_0x8a7a('0xa5')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c7')],{'as':'Configurations','onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db['ZohoConfiguration'][_0x8a7a('0x11c')](db[_0x8a7a('0xa8')],{'as':_0x8a7a('0x1bb'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0x1c7')][_0x8a7a('0x11c')](db[_0x8a7a('0xa8')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0x1c7')][_0x8a7a('0x11c')](db[_0x8a7a('0xa8')],{'as':_0x8a7a('0x1b7'),'onDelete':'cascade','foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x1c7')][_0x8a7a('0x151')](db[_0x8a7a('0xa5')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xa8')][_0x8a7a('0x11c')](db[_0x8a7a('0xa8')],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0xa8')]['hasMany'](db[_0x8a7a('0xa8')],{'as':_0x8a7a('0x1c1'),'foreignKey':_0x8a7a('0x1be')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xa8')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8a7a('0xaa')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c8')],{'as':_0x8a7a('0x1ba'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0x1c8')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c9')],{'as':_0x8a7a('0x1bb'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0x1c8')][_0x8a7a('0x11c')](db['ZendeskField'],{'as':_0x8a7a('0x1bd'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration']['hasMany'](db[_0x8a7a('0x1c9')],{'as':_0x8a7a('0x1b7'),'foreignKey':'FieldId'});db[_0x8a7a('0x1c8')][_0x8a7a('0x151')](db[_0x8a7a('0xaa')],{'as':'Account','foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0x1c8')][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x1ca')});db[_0x8a7a('0x1c9')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c9')],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0x1c9')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8a7a('0x1c9')][_0x8a7a('0x11c')](db[_0x8a7a('0x1c9')],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x1c9')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':_0x8a7a('0x8b'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x8a7a('0x11c')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xaf')][_0x8a7a('0x11c')](db['FreshdeskField'],{'as':_0x8a7a('0x1bb'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0xaf')][_0x8a7a('0x11c')](db[_0x8a7a('0xb1')],{'as':_0x8a7a('0x1bd'),'onDelete':'cascade','foreignKey':_0x8a7a('0x1be')});db['FreshdeskConfiguration'][_0x8a7a('0x11c')](db['FreshdeskField'],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xaf')][_0x8a7a('0x151')](db[_0x8a7a('0x1cb')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x1c4')});db['FreshdeskConfiguration'][_0x8a7a('0x12b')](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x1cc')});db[_0x8a7a('0xb1')][_0x8a7a('0x11c')](db[_0x8a7a('0xb1')],{'as':'Subject','foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0xb1')][_0x8a7a('0x11c')](db['FreshdeskField'],{'as':_0x8a7a('0x1c1'),'foreignKey':'DescriptionId'});db[_0x8a7a('0xb1')]['hasMany'](db[_0x8a7a('0xb1')],{'as':'Field','foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xb1')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':_0x8a7a('0x8b'),'foreignKey':_0x8a7a('0x1c3')});db[_0x8a7a('0xb3')][_0x8a7a('0x11c')](db[_0x8a7a('0xb4')],{'as':'Configurations','onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xb4')]['hasMany'](db[_0x8a7a('0xb6')],{'as':_0x8a7a('0x1bb'),'foreignKey':_0x8a7a('0x1bc')});db['VtigerConfiguration'][_0x8a7a('0x11c')](db[_0x8a7a('0xb6')],{'as':_0x8a7a('0x1bd'),'foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0xb4')][_0x8a7a('0x11c')](db['VtigerField'],{'as':_0x8a7a('0x1b7'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xb4')][_0x8a7a('0x151')](db[_0x8a7a('0xb3')],{'as':'Account','foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xb4')]['belongsToMany'](db[_0x8a7a('0x86')],{'through':_0x8a7a('0x1cd')});db[_0x8a7a('0xb6')][_0x8a7a('0x11c')](db[_0x8a7a('0xb6')],{'as':_0x8a7a('0x1c0'),'foreignKey':'SubjectId'});db[_0x8a7a('0xb6')][_0x8a7a('0x11c')](db['VtigerField'],{'as':_0x8a7a('0x1c1'),'foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0xb6')]['hasMany'](db['VtigerField'],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0xb6')][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':_0x8a7a('0x8b'),'foreignKey':'VariableId'});db[_0x8a7a('0x1ce')][_0x8a7a('0x11c')](db[_0x8a7a('0x1cf')],{'as':_0x8a7a('0x1ba'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1c4')});db['ServicenowConfiguration'][_0x8a7a('0x11c')](db[_0x8a7a('0xba')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x8a7a('0x1bd'),'foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0x1cf')][_0x8a7a('0x11c')](db[_0x8a7a('0xba')],{'as':'Fields','foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x1cf')][_0x8a7a('0x151')](db[_0x8a7a('0x1ce')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x1c4')});db[_0x8a7a('0xba')][_0x8a7a('0x11c')](db[_0x8a7a('0xba')],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db[_0x8a7a('0xba')][_0x8a7a('0x11c')](db[_0x8a7a('0xba')],{'as':'Description','foreignKey':_0x8a7a('0x1be')});db['ServicenowField'][_0x8a7a('0x11c')](db[_0x8a7a('0xba')],{'as':_0x8a7a('0x1c2'),'foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0x8a7a('0x8b'),'foreignKey':'VariableId'});db[_0x8a7a('0x1d0')][_0x8a7a('0x11c')](db[_0x8a7a('0x1d1')],{'as':'Configurations','onDelete':_0x8a7a('0x119'),'foreignKey':'AccountId'});db[_0x8a7a('0x1d1')][_0x8a7a('0x11c')](db['Dynamics365Field'],{'as':_0x8a7a('0x1bb'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8a7a('0x1d1')][_0x8a7a('0x11c')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x8a7a('0x119'),'foreignKey':'DescriptionId'});db[_0x8a7a('0x1d1')][_0x8a7a('0x11c')](db[_0x8a7a('0xbe')],{'as':_0x8a7a('0x1b7'),'onDelete':_0x8a7a('0x119'),'foreignKey':_0x8a7a('0x1bf')});db[_0x8a7a('0x1d1')]['belongsTo'](db[_0x8a7a('0x1d0')],{'as':_0x8a7a('0x170'),'foreignKey':_0x8a7a('0x1c4')});db['Dynamics365Field'][_0x8a7a('0x11c')](db['Dynamics365Field'],{'as':_0x8a7a('0x1c0'),'foreignKey':_0x8a7a('0x1bc')});db['Dynamics365Field'][_0x8a7a('0x11c')](db['Dynamics365Field'],{'as':_0x8a7a('0x1c1'),'foreignKey':_0x8a7a('0x1be')});db[_0x8a7a('0xbe')][_0x8a7a('0x11c')](db[_0x8a7a('0xbe')],{'as':_0x8a7a('0x1c2'),'foreignKey':_0x8a7a('0x1bf')});db['Dynamics365Field'][_0x8a7a('0x151')](db[_0x8a7a('0x8b')],{'as':_0x8a7a('0x8b'),'foreignKey':_0x8a7a('0x1c3')});db[_0x8a7a('0xc1')][_0x8a7a('0x151')](db[_0x8a7a('0x13a')],{});db[_0x8a7a('0xc1')]['belongsTo'](db[_0x8a7a('0xe5')],{'as':'List','foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0xc1')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':'ContactId'});db[_0x8a7a('0xc1')][_0x8a7a('0x151')](db['ChatInteraction'],{});db[_0x8a7a('0xc1')]['belongsTo'](db[_0x8a7a('0x63')],{});db[_0x8a7a('0xc1')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{});db[_0x8a7a('0xc1')]['belongsTo'](db[_0x8a7a('0x66')],{});db[_0x8a7a('0xc3')]['belongsTo'](db['User'],{'onDelete':_0x8a7a('0x119'),'foreignKey':'FromId'});db[_0x8a7a('0xc3')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'onDelete':'cascade','foreignKey':_0x8a7a('0x1d2')});db[_0x8a7a('0xc8')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8a7a('0x1d3'),'onDelete':'cascade'});db[_0x8a7a('0xc8')]['hasMany'](db[_0x8a7a('0xc5')],{'foreignKey':_0x8a7a('0x1d3'),'onDelete':_0x8a7a('0x119')});db[_0x8a7a('0xc9')]['belongsTo'](db[_0x8a7a('0x51')],{});db[_0x8a7a('0xc9')]['belongsTo'](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x16c'),'foreignKey':_0x8a7a('0x16d')});db['SmsQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0xc9')][_0x8a7a('0x151')](db['SmsInteraction'],{});db[_0x8a7a('0xc9')][_0x8a7a('0x151')](db[_0x8a7a('0x55')],{});db[_0x8a7a('0xc9')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{});db['SmsQueueReport'][_0x8a7a('0x151')](db[_0x8a7a('0x57')],{});db[_0x8a7a('0x1d4')][_0x8a7a('0x11c')](db[_0x8a7a('0xc8')],{'foreignKey':_0x8a7a('0x1d5')});db['JscriptyProject'][_0x8a7a('0x11c')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x8a7a('0x1d4')]['hasMany'](db[_0x8a7a('0xc5')],{'foreignKey':_0x8a7a('0x1d5')});db[_0x8a7a('0xd1')][_0x8a7a('0x12b')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x176'),'through':_0x8a7a('0x144')});db['Team'][_0x8a7a('0x12b')](db['User'],{'as':_0x8a7a('0x15b'),'through':'user_has_teams'});db[_0x8a7a('0xd5')][_0x8a7a('0x12b')](db[_0x8a7a('0x1a')],{'through':_0x8a7a('0x15c'),'as':'VoiceQueues'});db[_0x8a7a('0xd5')]['belongsToMany'](db[_0x8a7a('0x3b')],{'through':_0x8a7a('0x1d6'),'as':'MailQueues'});db[_0x8a7a('0xd5')][_0x8a7a('0x12b')](db['ChatQueue'],{'through':_0x8a7a('0x199'),'as':_0x8a7a('0x1d7')});db[_0x8a7a('0xd5')]['belongsToMany'](db[_0x8a7a('0x4f')],{'through':_0x8a7a('0x1d8'),'as':_0x8a7a('0x136')});db[_0x8a7a('0xd5')]['belongsToMany'](db[_0x8a7a('0x57')],{'through':_0x8a7a('0x188'),'as':_0x8a7a('0x1d9')});db['Team'][_0x8a7a('0x12b')](db[_0x8a7a('0x5e')],{'through':_0x8a7a('0x1da'),'as':'OpenchannelQueues'});db['Campaign']['hasMany'](db[_0x8a7a('0x6e')],{'as':_0x8a7a('0x14d'),'foreignKey':'CampaignId'});db[_0x8a7a('0xd8')]['hasMany'](db[_0x8a7a('0x11f')],{'as':_0x8a7a('0x14e'),'foreignKey':_0x8a7a('0x1a3')});db[_0x8a7a('0xd8')][_0x8a7a('0x11c')](db[_0x8a7a('0x120')],{'as':_0x8a7a('0x1a0'),'foreignKey':'CampaignId'});db['Campaign'][_0x8a7a('0x11c')](db['CmHopperBlack'],{'as':_0x8a7a('0x14f'),'foreignKey':_0x8a7a('0x1a3')});db[_0x8a7a('0xd8')][_0x8a7a('0x151')](db['Trunk'],{'as':_0x8a7a('0x152'),'foreignKey':_0x8a7a('0x1db')});db['Campaign'][_0x8a7a('0x151')](db[_0x8a7a('0x152')],{'as':_0x8a7a('0x153'),'foreignKey':_0x8a7a('0x154')});db[_0x8a7a('0xd8')][_0x8a7a('0x151')](db[_0x8a7a('0x155')],{'as':_0x8a7a('0x155'),'foreignKey':'IntervalId'});db[_0x8a7a('0xd8')]['belongsTo'](db[_0x8a7a('0xd1')],{'as':_0x8a7a('0xd1'),'foreignKey':_0x8a7a('0x1dc')});db['Campaign'][_0x8a7a('0x12b')](db[_0x8a7a('0xe5')],{'as':_0x8a7a('0x159'),'through':_0x8a7a('0x1dd')});db[_0x8a7a('0xd8')][_0x8a7a('0x12b')](db['CmList'],{'as':_0x8a7a('0x15d'),'through':_0x8a7a('0x1de')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db[_0x8a7a('0xdf')][_0x8a7a('0x151')](db[_0x8a7a('0x3e')],{});db[_0x8a7a('0xdf')]['belongsTo'](db[_0x8a7a('0x39')],{'foreignKey':_0x8a7a('0x1df'),'as':_0x8a7a('0x1e0')});db[_0x8a7a('0xdf')][_0x8a7a('0x151')](db['User'],{'foreignKey':'FromUserId','as':_0x8a7a('0x1e1')});db[_0x8a7a('0xdf')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'foreignKey':_0x8a7a('0x1e2'),'as':'ToAgent'});db[_0x8a7a('0xdf')][_0x8a7a('0x151')](db[_0x8a7a('0x3b')],{'foreignKey':'ToMailQueueId','as':_0x8a7a('0x1e3')});db[_0x8a7a('0xdf')][_0x8a7a('0x151')](db['MailAccount'],{'foreignKey':_0x8a7a('0x1e4'),'as':_0x8a7a('0x1e5')});db[_0x8a7a('0x1e6')]['belongsTo'](db[_0x8a7a('0x63')],{});db[_0x8a7a('0x1e6')][_0x8a7a('0x151')](db[_0x8a7a('0x62')],{});db[_0x8a7a('0x1e6')][_0x8a7a('0x151')](db[_0x8a7a('0x13a')],{'foreignKey':'FromChatWebsiteId','as':_0x8a7a('0x1e0')});db['ChatTransferReport'][_0x8a7a('0x151')](db['User'],{'foreignKey':'FromUserId','as':_0x8a7a('0x1e1')});db[_0x8a7a('0x1e6')]['belongsTo'](db[_0x8a7a('0x13')],{'foreignKey':_0x8a7a('0x1e2'),'as':_0x8a7a('0x1e7')});db[_0x8a7a('0x1e6')][_0x8a7a('0x151')](db[_0x8a7a('0x66')],{'foreignKey':'ToChatQueueId','as':_0x8a7a('0x1e3')});db['ChatTransferReport'][_0x8a7a('0x151')](db[_0x8a7a('0x13a')],{'foreignKey':'ToChatWebsiteId','as':_0x8a7a('0x1e5')});db[_0x8a7a('0xe2')][_0x8a7a('0x151')](db['FaxMessage'],{});db['FaxTransferReport'][_0x8a7a('0x151')](db['FaxInteraction'],{});db[_0x8a7a('0xe2')][_0x8a7a('0x151')](db['FaxAccount'],{'foreignKey':_0x8a7a('0x1e8'),'as':_0x8a7a('0x1e0')});db[_0x8a7a('0xe2')]['belongsTo'](db[_0x8a7a('0x13')],{'foreignKey':_0x8a7a('0x1e9'),'as':'FromAgent'});db[_0x8a7a('0xe2')]['belongsTo'](db['User'],{'foreignKey':_0x8a7a('0x1e2'),'as':'ToAgent'});db[_0x8a7a('0xe2')][_0x8a7a('0x151')](db[_0x8a7a('0x4f')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0x8a7a('0x151')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x8a7a('0x1e5')});db['OpenchannelTransferReport'][_0x8a7a('0x151')](db[_0x8a7a('0x18a')],{});db[_0x8a7a('0x1ea')][_0x8a7a('0x151')](db[_0x8a7a('0x18c')],{});db[_0x8a7a('0x1ea')][_0x8a7a('0x151')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x8a7a('0x1e0')});db['OpenchannelTransferReport']['belongsTo'](db[_0x8a7a('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8a7a('0x1ea')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'foreignKey':_0x8a7a('0x1e2'),'as':'ToAgent'});db[_0x8a7a('0x1ea')][_0x8a7a('0x151')](db[_0x8a7a('0x5e')],{'foreignKey':_0x8a7a('0x1eb'),'as':_0x8a7a('0x1e3')});db[_0x8a7a('0x1ea')][_0x8a7a('0x151')](db[_0x8a7a('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':_0x8a7a('0x1e5')});db[_0x8a7a('0x1ec')]['belongsTo'](db[_0x8a7a('0x55')],{});db['SmsTransferReport'][_0x8a7a('0x151')](db[_0x8a7a('0x123')],{});db[_0x8a7a('0x1ec')]['belongsTo'](db[_0x8a7a('0x51')],{'foreignKey':_0x8a7a('0x1ed'),'as':_0x8a7a('0x1e0')});db['SmsTransferReport'][_0x8a7a('0x151')](db['User'],{'foreignKey':'FromUserId','as':_0x8a7a('0x1e1')});db[_0x8a7a('0x1ec')][_0x8a7a('0x151')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8a7a('0x1ec')]['belongsTo'](db[_0x8a7a('0x57')],{'foreignKey':_0x8a7a('0x1ee'),'as':_0x8a7a('0x1e3')});db['SmsTransferReport'][_0x8a7a('0x151')](db[_0x8a7a('0x51')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db['Disposition'],{'as':_0x8a7a('0x169'),'foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0xe5')][_0x8a7a('0x11c')](db[_0x8a7a('0x74')],{'as':_0x8a7a('0x1ef'),'foreignKey':'ListId'});db[_0x8a7a('0xe5')][_0x8a7a('0x11c')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x129'),'onDelete':'cascade','foreignKey':_0x8a7a('0x16d')});db['CmList'][_0x8a7a('0x11c')](db[_0x8a7a('0x11f')],{'as':_0x8a7a('0x14e'),'foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0xe5')][_0x8a7a('0x11c')](db[_0x8a7a('0x120')],{'as':'HopperHistory','foreignKey':_0x8a7a('0x16d')});db[_0x8a7a('0xe5')]['hasMany'](db[_0x8a7a('0x72')],{'as':_0x8a7a('0x72'),'foreignKey':'ListId'});db[_0x8a7a('0xe5')][_0x8a7a('0x12b')](db['VoiceQueue'],{'as':_0x8a7a('0x1f0'),'through':'voice_queues_has_cm_lists'});db[_0x8a7a('0xe5')][_0x8a7a('0x12b')](db['User'],{'as':_0x8a7a('0x15b'),'through':'cm_user_has_lists'});db[_0x8a7a('0x137')][_0x8a7a('0x11c')](db[_0x8a7a('0x11e')],{'as':_0x8a7a('0x1f1'),'onDelete':_0x8a7a('0x17a')});db[_0x8a7a('0x137')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x8a7a('0x139')});db[_0x8a7a('0xe8')][_0x8a7a('0x11c')](db[_0x8a7a('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0x8a7a('0xe8')][_0x8a7a('0x11c')](db[_0x8a7a('0xea')],{'as':_0x8a7a('0x1f2'),'foreignKey':_0x8a7a('0x1f3'),'onDelete':'cascade'});db[_0x8a7a('0xea')]['hasMany'](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x8a7a('0x1f4'),'onDelete':'cascade'});db['CrmWorkflow'][_0x8a7a('0x11c')](db[_0x8a7a('0xef')],{'foreignKey':_0x8a7a('0x1f5')});db['CrmWorkflow']['hasMany'](db['SADossier'],{'foreignKey':'WorkflowId'});db[_0x8a7a('0xef')][_0x8a7a('0x118')](db[_0x8a7a('0x1f6')],{'foreignKey':_0x8a7a('0x1f7')});db[_0x8a7a('0xef')][_0x8a7a('0x11c')](db[_0x8a7a('0xfc')],{'foreignKey':_0x8a7a('0x1f7')});db[_0x8a7a('0xef')][_0x8a7a('0x12b')](db[_0x8a7a('0xef')],{'as':_0x8a7a('0x1f8'),'through':_0x8a7a('0x1f9')});db[_0x8a7a('0x1f6')][_0x8a7a('0x11c')](db[_0x8a7a('0xf2')],{'foreignKey':_0x8a7a('0x1fa')});db[_0x8a7a('0x1f6')][_0x8a7a('0x151')](db['CrmWorkflowStep'],{'foreignKey':_0x8a7a('0x1f7'),'as':_0x8a7a('0xef')});db[_0x8a7a('0xf2')][_0x8a7a('0x151')](db['CrmTask'],{'foreignKey':_0x8a7a('0x1fa'),'as':_0x8a7a('0x1f6')});db['SATypeProduct'][_0x8a7a('0x11c')](db['SAProduct'],{'foreignKey':_0x8a7a('0x1fb')});db[_0x8a7a('0xf4')][_0x8a7a('0x11c')](db[_0x8a7a('0x1fc')],{'foreignKey':_0x8a7a('0x1fd')});db[_0x8a7a('0x1fc')][_0x8a7a('0x11c')](db[_0x8a7a('0x1fe')],{'foreignKey':_0x8a7a('0x1ff')});db[_0x8a7a('0x1fc')][_0x8a7a('0x151')](db[_0x8a7a('0xf7')],{'as':_0x8a7a('0x200'),'foreignKey':_0x8a7a('0x201')});db[_0x8a7a('0x1fc')]['belongsTo'](db[_0x8a7a('0xf4')],{'as':'UnitMeasure','foreignKey':_0x8a7a('0x1fd')});db['SAProduct'][_0x8a7a('0x151')](db[_0x8a7a('0x202')],{'as':_0x8a7a('0x203'),'foreignKey':_0x8a7a('0x1fb')});db[_0x8a7a('0xf7')]['hasMany'](db[_0x8a7a('0x1fc')],{'foreignKey':_0x8a7a('0x201')});db[_0x8a7a('0xf9')][_0x8a7a('0x11c')](db[_0x8a7a('0x1fe')],{'foreignKey':_0x8a7a('0x204')});db[_0x8a7a('0x1fe')][_0x8a7a('0x11c')](db[_0x8a7a('0x101')],{'as':_0x8a7a('0x205'),'foreignKey':_0x8a7a('0x206')});db[_0x8a7a('0x1fe')][_0x8a7a('0x151')](db[_0x8a7a('0x1fc')],{'as':'Product','foreignKey':'ProductId'});db['SAProductPricesList'][_0x8a7a('0x151')](db[_0x8a7a('0xf9')],{'as':'Pricelist','foreignKey':'PriceListId'});db[_0x8a7a('0xfc')][_0x8a7a('0x11c')](db[_0x8a7a('0xfe')],{'as':'Dossiers','foreignKey':'DossierId'});db[_0x8a7a('0xfc')]['hasMany'](db[_0x8a7a('0xff')],{'as':_0x8a7a('0x19e'),'foreignKey':_0x8a7a('0x207')});db[_0x8a7a('0xfc')][_0x8a7a('0x11c')](db[_0x8a7a('0x103')],{'as':_0x8a7a('0x19e'),'foreignKey':_0x8a7a('0x207')});db['SADossier'][_0x8a7a('0x11c')](db[_0x8a7a('0x105')],{'as':_0x8a7a('0x19e'),'foreignKey':'DossierId'});db[_0x8a7a('0xfc')][_0x8a7a('0x151')](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x1a1'),'foreignKey':_0x8a7a('0x19c')});db[_0x8a7a('0xfc')][_0x8a7a('0x151')](db[_0x8a7a('0x6c')],{'as':_0x8a7a('0x171'),'foreignKey':_0x8a7a('0x166')});db[_0x8a7a('0xfc')][_0x8a7a('0x151')](db['CrmWorkflow'],{'as':_0x8a7a('0x208'),'foreignKey':_0x8a7a('0x1f5')});db['SADossier'][_0x8a7a('0x151')](db['CrmWorkflowStep'],{'as':'WorkflowStep','foreignKey':_0x8a7a('0x1f7')});db[_0x8a7a('0xfc')][_0x8a7a('0x151')](db[_0x8a7a('0x13')],{'as':_0x8a7a('0x13'),'foreignKey':_0x8a7a('0x11a')});db[_0x8a7a('0xfe')][_0x8a7a('0x11c')](db['SAQuotation'],{'as':'Requests','foreignKey':_0x8a7a('0x209')});db[_0x8a7a('0xfe')][_0x8a7a('0x11c')](db[_0x8a7a('0x103')],{'as':_0x8a7a('0x20a'),'foreignKey':'RequestId'});db[_0x8a7a('0xfe')]['hasMany'](db[_0x8a7a('0x105')],{'as':_0x8a7a('0x20a'),'foreignKey':'RequestId'});db[_0x8a7a('0xfe')][_0x8a7a('0x151')](db[_0x8a7a('0xfc')],{'as':_0x8a7a('0x20b'),'foreignKey':_0x8a7a('0x207')});db[_0x8a7a('0xff')]['hasMany'](db[_0x8a7a('0x101')],{'as':_0x8a7a('0x20c'),'foreignKey':_0x8a7a('0x20d')});db[_0x8a7a('0xff')][_0x8a7a('0x11c')](db['SAOrder'],{'as':'Quotations','foreignKey':_0x8a7a('0x20d')});db['SAQuotation'][_0x8a7a('0x11c')](db[_0x8a7a('0x105')],{'as':_0x8a7a('0x20c'),'foreignKey':'QuotationId'});db[_0x8a7a('0xff')]['belongsTo'](db[_0x8a7a('0xfc')],{'as':_0x8a7a('0x20b'),'foreignKey':_0x8a7a('0x207')});db[_0x8a7a('0xff')][_0x8a7a('0x151')](db[_0x8a7a('0xfe')],{'as':'Request','foreignKey':_0x8a7a('0x209')});db['SAProductQuotation']['belongsTo'](db['SAProductPricesList'],{'as':_0x8a7a('0x20e'),'foreignKey':_0x8a7a('0x206')});db[_0x8a7a('0x101')][_0x8a7a('0x151')](db[_0x8a7a('0xff')],{'as':_0x8a7a('0x20f'),'foreignKey':_0x8a7a('0x20d')});db['SAProductQuotation'][_0x8a7a('0x151')](db['SAProforma'],{'as':_0x8a7a('0x210'),'foreignKey':'ProformaId'});db['SAProductQuotation'][_0x8a7a('0x151')](db[_0x8a7a('0x211')],{'as':_0x8a7a('0x212'),'foreignKey':'InvoiceId'});db[_0x8a7a('0x103')]['hasMany'](db[_0x8a7a('0x105')],{'as':'Orders','foreignKey':_0x8a7a('0x213')});db[_0x8a7a('0x103')][_0x8a7a('0x151')](db[_0x8a7a('0xfc')],{'as':'Dossier','foreignKey':_0x8a7a('0x207')});db['SAOrder'][_0x8a7a('0x151')](db['SARequest'],{'as':_0x8a7a('0x214'),'foreignKey':_0x8a7a('0x209')});db[_0x8a7a('0x103')][_0x8a7a('0x151')](db[_0x8a7a('0xff')],{'as':_0x8a7a('0x20f'),'foreignKey':_0x8a7a('0x20d')});db[_0x8a7a('0x105')][_0x8a7a('0x11c')](db[_0x8a7a('0x211')],{'as':_0x8a7a('0x210'),'foreignKey':_0x8a7a('0x215')});db[_0x8a7a('0x105')][_0x8a7a('0x11c')](db[_0x8a7a('0x101')],{'as':_0x8a7a('0x210'),'foreignKey':_0x8a7a('0x215')});db[_0x8a7a('0x105')][_0x8a7a('0x11c')](db[_0x8a7a('0x216')],{'as':_0x8a7a('0x210'),'foreignKey':_0x8a7a('0x215')});db[_0x8a7a('0x105')][_0x8a7a('0x11c')](db[_0x8a7a('0x217')],{'as':_0x8a7a('0x210'),'foreignKey':_0x8a7a('0x215')});db[_0x8a7a('0x105')][_0x8a7a('0x151')](db['SADossier'],{'as':'Dossier','foreignKey':_0x8a7a('0x207')});db[_0x8a7a('0x105')][_0x8a7a('0x151')](db[_0x8a7a('0xfe')],{'as':_0x8a7a('0x214'),'foreignKey':_0x8a7a('0x209')});db[_0x8a7a('0x105')][_0x8a7a('0x151')](db[_0x8a7a('0xff')],{'as':'Quotation','foreignKey':_0x8a7a('0x20d')});db['SAProforma']['belongsTo'](db['SAOrder'],{'as':_0x8a7a('0x218'),'foreignKey':_0x8a7a('0x213')});db['SAInvoice'][_0x8a7a('0x11c')](db[_0x8a7a('0x101')],{'as':_0x8a7a('0x20c'),'foreignKey':_0x8a7a('0x219')});db[_0x8a7a('0x211')][_0x8a7a('0x11c')](db['SAInvoiceDetail'],{'as':_0x8a7a('0x21a'),'foreignKey':'InvoiceId'});db[_0x8a7a('0x211')][_0x8a7a('0x11c')](db[_0x8a7a('0x217')],{'as':_0x8a7a('0x21b'),'foreignKey':_0x8a7a('0x219')});db[_0x8a7a('0x211')]['belongsTo'](db[_0x8a7a('0xfc')],{'as':_0x8a7a('0x20b'),'foreignKey':_0x8a7a('0x207')});db['SAInvoice'][_0x8a7a('0x151')](db[_0x8a7a('0xfe')],{'as':_0x8a7a('0x214'),'foreignKey':_0x8a7a('0x209')});db[_0x8a7a('0x211')]['belongsTo'](db[_0x8a7a('0xff')],{'as':_0x8a7a('0x20f'),'foreignKey':_0x8a7a('0x20d')});db[_0x8a7a('0x211')][_0x8a7a('0x151')](db['SAOrder'],{'as':_0x8a7a('0x218'),'foreignKey':_0x8a7a('0x213')});db[_0x8a7a('0x108')][_0x8a7a('0x151')](db[_0x8a7a('0x211')],{'as':_0x8a7a('0x212'),'foreignKey':'InvoiceId'});db[_0x8a7a('0x216')][_0x8a7a('0x151')](db[_0x8a7a('0x105')],{'as':_0x8a7a('0x210'),'foreignKey':_0x8a7a('0x215')});db['SAPayment'][_0x8a7a('0x151')](db[_0x8a7a('0x211')],{'as':_0x8a7a('0x212'),'foreignKey':_0x8a7a('0x219')});db[_0x8a7a('0x217')][_0x8a7a('0x151')](db[_0x8a7a('0x105')],{'as':'Proforma','foreignKey':_0x8a7a('0x215')});db['SAPaymentMethod'][_0x8a7a('0x11c')](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x21c'),'foreignKey':'saPaymentMethod'});db[_0x8a7a('0x21d')][_0x8a7a('0x151')](db[_0x8a7a('0x10e')],{'as':_0x8a7a('0x21e'),'foreignKey':'CreditNoteId'});db[_0x8a7a('0x114')][_0x8a7a('0x11c')](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x21f'),'foreignKey':_0x8a7a('0x220')});db[_0x8a7a('0x116')][_0x8a7a('0x11c')](db[_0x8a7a('0x19a')],{'as':_0x8a7a('0x221'),'foreignKey':'saCompanyRelationship'});module[_0x8a7a('0x222')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a713539..e6e437e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf933=['/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./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/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/crm/nations','./api/crmNation','/api/crm/workflows','./api/crmWorkflow','/api/crm/workflowsteps','./api/crmWorkflowstep','/api/crm/tasks','./api/crmTask','/api/crm/actionslists','./api/crmActionsList','./api/saTypeProduct','/api/sa/unitmeasures','./api/saUnitMeasure','./api/saInvoiceLaw','./api/saProduct','/api/sa/salescondions','./api/saSalesCondition','/api/sa/pricelists','/api/sa/productpriceslists','./api/saDossier','/api/sa/requests','./api/saRequest','/api/sa/quotations','./api/saQuotation','/api/sa/productquotations','./api/saProductQuotation','/api/sa/orders','./api/saOrder','/api/sa/proformas','./api/saProforma','./api/saInvoice','/api/sa/assets','./api/saAsset','./api/saInvoiceDetail','./api/saProformaDetail','/api/sa/payments','./api/saPayment','/api/sa/paymentMethods','./api/saPaymentMethod','/api/sa/creditNotes','./api/saCreditNote','/api/sa/creditNote_details','./api/saCreditNoteDetail','/api/sa/invoice_numberss','./api/saInvoiceNumber','/api/sa/creditNote_numberss','./api/saCreditNoteNumber','/api/sa/company_types','./api/saCompanyType','/api/sa/company_relationshipes','./api/saCompanyRelationship','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.14','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','path','express','express-winston','util','./errors','./config/logger','api','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','other','agent_name','test','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xf933,0x80));var _0x3f93=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0xf933[_0x5ef905];return _0x367808;};'use strict';var path=require(_0x3f93('0x0'));var express=require(_0x3f93('0x1'));var ewinston=require(_0x3f93('0x2'));var util=require(_0x3f93('0x3'));var errors=require(_0x3f93('0x4'));var config=require('./config/environment');var logger=require(_0x3f93('0x5'))(_0x3f93('0x6'));var authLogger=require(_0x3f93('0x5'))(_0x3f93('0x7'));exports[_0x3f93('0x8')]=function(_0x46b6dd){_0x46b6dd['use'](ewinston[_0x3f93('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x231710,_0x257c92){return util['format'](_0x3f93('0xa'),_0x231710[_0x3f93('0xb')],_0x231710[_0x3f93('0xc')][_0x3f93('0xd')]?_0x231710[_0x3f93('0xc')][_0x3f93('0xd')]:_0x231710[_0x3f93('0xe')][_0x3f93('0xf')]||_0x231710['ip'],_0x231710[_0x3f93('0x10')],_0x257c92[_0x3f93('0x11')],_0x257c92[_0x3f93('0x12')],_0x231710[_0x3f93('0x13')]?_0x231710[_0x3f93('0x13')]['id']:null,_0x231710[_0x3f93('0x13')]?_0x231710[_0x3f93('0x13')][_0x3f93('0x14')]:null,_0x231710[_0x3f93('0x13')]?_0x231710[_0x3f93('0x13')][_0x3f93('0x15')]:null);}}));_0x46b6dd[_0x3f93('0x16')](ewinston[_0x3f93('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5362c4,_0x5bd310){var _0x83c0fa=_0x3f93('0x17');if(_0x5362c4[_0x3f93('0x18')]&&_0x5362c4[_0x3f93('0x18')][_0x3f93('0x19')]&&_0x5362c4[_0x3f93('0x18')][_0x3f93('0x1a')]){_0x83c0fa=_0x3f93('0x1b');}return util[_0x3f93('0x1c')](_0x83c0fa,_0x5362c4[_0x3f93('0xb')],_0x5362c4['headers'][_0x3f93('0xd')]?_0x5362c4['headers'][_0x3f93('0xd')]:_0x5362c4[_0x3f93('0xe')][_0x3f93('0xf')]||_0x5362c4['ip'],_0x5362c4[_0x3f93('0x10')],_0x5bd310[_0x3f93('0x11')],_0x5bd310['responseTime'],_0x5362c4[_0x3f93('0x13')]?_0x5362c4[_0x3f93('0x13')]['id']:null,_0x5362c4[_0x3f93('0x13')]?_0x5362c4[_0x3f93('0x13')][_0x3f93('0x14')]:null,_0x5362c4[_0x3f93('0x13')]?_0x5362c4[_0x3f93('0x13')][_0x3f93('0x15')]:null,_0x5362c4[_0x3f93('0x18')]&&_0x5362c4[_0x3f93('0x18')][_0x3f93('0x19')]?_0x5362c4[_0x3f93('0x18')]['device']:_0x3f93('0x1d'),_0x5362c4[_0x3f93('0x18')]&&_0x5362c4[_0x3f93('0x18')]['agent_id']?_0x5362c4[_0x3f93('0x18')][_0x3f93('0x1a')]:'',_0x5362c4[_0x3f93('0x18')]&&_0x5362c4['body'][_0x3f93('0x1e')]?_0x5362c4[_0x3f93('0x18')][_0x3f93('0x1e')]:'');},'ignoreRoute':function(_0x15a1dc){var _0x5e5954=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5e5954[_0x3f93('0x1f')](_0x15a1dc[_0x3f93('0x10')]);}}));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x20'),require(_0x3f93('0x21')));_0x46b6dd[_0x3f93('0x16')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x46b6dd['use'](_0x3f93('0x22'),require(_0x3f93('0x23')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x24'),require(_0x3f93('0x25')));_0x46b6dd['use']('/api/voice/mohs',require(_0x3f93('0x26')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x27'),require(_0x3f93('0x28')));_0x46b6dd[_0x3f93('0x16')]('/api/voice/recordings',require(_0x3f93('0x29')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x2a'),require(_0x3f93('0x2b')));_0x46b6dd[_0x3f93('0x16')]('/api/voice/mails',require(_0x3f93('0x2c')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x2d'),require('./api/voiceMailMessage'));_0x46b6dd['use'](_0x3f93('0x2e'),require(_0x3f93('0x2f')));_0x46b6dd[_0x3f93('0x16')]('/api/voice/dials/reports',require(_0x3f93('0x30')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x31'),require(_0x3f93('0x32')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x33'),require(_0x3f93('0x34')));_0x46b6dd['use'](_0x3f93('0x35'),require(_0x3f93('0x36')));_0x46b6dd[_0x3f93('0x16')]('/api/trunks',require('./api/trunk'));_0x46b6dd[_0x3f93('0x16')]('/api/voice/transfers/reports',require(_0x3f93('0x37')));_0x46b6dd['use'](_0x3f93('0x38'),require(_0x3f93('0x39')));_0x46b6dd['use'](_0x3f93('0x3a'),require(_0x3f93('0x3b')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x3c'),require(_0x3f93('0x3d')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x3e'),require(_0x3f93('0x3f')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x40'),require(_0x3f93('0x41')));_0x46b6dd['use'](_0x3f93('0x42'),require(_0x3f93('0x43')));_0x46b6dd['use'](_0x3f93('0x44'),require(_0x3f93('0x45')));_0x46b6dd['use'](_0x3f93('0x46'),require(_0x3f93('0x47')));_0x46b6dd[_0x3f93('0x16')]('/api/dashboards',require(_0x3f93('0x48')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x49'),require(_0x3f93('0x4a')));_0x46b6dd['use'](_0x3f93('0x4b'),require('./api/faxAccount'));_0x46b6dd[_0x3f93('0x16')]('/api/fax/applications',require(_0x3f93('0x4c')));_0x46b6dd['use'](_0x3f93('0x4d'),require(_0x3f93('0x4e')));_0x46b6dd[_0x3f93('0x16')]('/api/fax/messages',require('./api/faxMessage'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x4f'),require(_0x3f93('0x50')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x51'),require('./api/faxQueueReport'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x52'),require(_0x3f93('0x53')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x54'),require(_0x3f93('0x55')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x56'),require('./api/smsInteraction'));_0x46b6dd[_0x3f93('0x16')]('/api/sms/messages',require(_0x3f93('0x57')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x58'),require(_0x3f93('0x59')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x5a'),require(_0x3f93('0x5b')));_0x46b6dd['use']('/api/openchannel/applications',require(_0x3f93('0x5c')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x5d'),require(_0x3f93('0x5e')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x5f'),require(_0x3f93('0x60')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x61'),require(_0x3f93('0x62')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x63'),require('./api/chatWebsite'));_0x46b6dd['use'](_0x3f93('0x64'),require(_0x3f93('0x65')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x66'),require('./api/chatApplication'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x67'),require(_0x3f93('0x68')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x69'),require(_0x3f93('0x6a')));_0x46b6dd['use']('/api/chat/offline_messages',require(_0x3f93('0x6b')));_0x46b6dd[_0x3f93('0x16')]('/api/chat/queues',require('./api/chatQueue'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x6c'),require('./api/chatGroup'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x6d'),require(_0x3f93('0x6e')));_0x46b6dd['use'](_0x3f93('0x6f'),require(_0x3f93('0x70')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x71'),require('./api/cmContact'));_0x46b6dd['use'](_0x3f93('0x72'),require(_0x3f93('0x73')));_0x46b6dd['use']('/api/cm/hopper_black',require(_0x3f93('0x74')));_0x46b6dd[_0x3f93('0x16')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x75'),require(_0x3f93('0x76')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x77'),require('./api/cmCustomField'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x78'),require('./api/action'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x79'),require(_0x3f93('0x7a')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x7b'),require(_0x3f93('0x7c')));_0x46b6dd['use'](_0x3f93('0x7d'),require('./api/disposition'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x7e'),require(_0x3f93('0x7f')));_0x46b6dd['use'](_0x3f93('0x80'),require('./api/interval'));_0x46b6dd['use'](_0x3f93('0x81'),require(_0x3f93('0x82')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x83'),require(_0x3f93('0x84')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x85'),require(_0x3f93('0x86')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x87'),require(_0x3f93('0x88')));_0x46b6dd[_0x3f93('0x16')]('/api/sounds',require(_0x3f93('0x89')));_0x46b6dd['use']('/api/tags',require(_0x3f93('0x8a')));_0x46b6dd[_0x3f93('0x16')]('/api/templates',require(_0x3f93('0x8b')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x8c'),require('./api/trigger'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x8d'),require(_0x3f93('0x8e')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x8f'),require(_0x3f93('0x90')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x91'),require(_0x3f93('0x92')));_0x46b6dd[_0x3f93('0x16')]('/api/analytics/custom_reports',require(_0x3f93('0x93')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x94'),require(_0x3f93('0x95')));_0x46b6dd['use']('/api/analytics/extracted_reports',require(_0x3f93('0x96')));_0x46b6dd[_0x3f93('0x16')]('/api/analytics/metrics',require(_0x3f93('0x97')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x98'),require(_0x3f93('0x99')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x9a'),require(_0x3f93('0x9b')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x9c'),require(_0x3f93('0x9d')));_0x46b6dd['use'](_0x3f93('0x9e'),require(_0x3f93('0x9f')));_0x46b6dd['use'](_0x3f93('0xa0'),require(_0x3f93('0xa1')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xa2'),require('./api/intSugarcrmAccount'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xa3'),require('./api/intSugarcrmConfiguration'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xa4'),require('./api/intSugarcrmField'));_0x46b6dd[_0x3f93('0x16')]('/api/integrations/desk/accounts',require(_0x3f93('0xa5')));_0x46b6dd['use'](_0x3f93('0xa6'),require(_0x3f93('0xa7')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xa8'),require('./api/intDeskField'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xa9'),require(_0x3f93('0xaa')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xab'),require(_0x3f93('0xac')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xad'),require(_0x3f93('0xae')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xaf'),require(_0x3f93('0xb0')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb1'),require('./api/intZendeskConfiguration'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb2'),require(_0x3f93('0xb3')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb4'),require('./api/intFreshdeskAccount'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb5'),require(_0x3f93('0xb6')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb7'),require(_0x3f93('0xb8')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xb9'),require(_0x3f93('0xba')));_0x46b6dd[_0x3f93('0x16')]('/api/integrations/vtiger/configurations',require(_0x3f93('0xbb')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xbc'),require('./api/intVtigerField'));_0x46b6dd['use'](_0x3f93('0xbd'),require('./api/intServicenowAccount'));_0x46b6dd[_0x3f93('0x16')]('/api/integrations/servicenow/configurations',require(_0x3f93('0xbe')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xbf'),require('./api/intServicenowField'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc0'),require(_0x3f93('0xc1')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc2'),require(_0x3f93('0xc3')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc4'),require(_0x3f93('0xc5')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc6'),require(_0x3f93('0xc7')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc8'),require('./api/chatQueueReport'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xc9'),require(_0x3f93('0xca')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xcb'),require(_0x3f93('0xcc')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xcd'),require(_0x3f93('0xce')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xcf'),require(_0x3f93('0xd0')));_0x46b6dd['use']('/api/sms/reports/queue',require(_0x3f93('0xd1')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xd2'),require(_0x3f93('0xd3')));_0x46b6dd[_0x3f93('0x16')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x46b6dd['use'](_0x3f93('0xd4'),require(_0x3f93('0xd5')));_0x46b6dd['use'](_0x3f93('0xd6'),require(_0x3f93('0xd7')));_0x46b6dd[_0x3f93('0x16')]('/api/square/odbc',require(_0x3f93('0xd8')));_0x46b6dd['use']('/api/square/projects',require(_0x3f93('0xd9')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xda'),require(_0x3f93('0xdb')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xdc'),require(_0x3f93('0xdd')));_0x46b6dd['use'](_0x3f93('0xde'),require(_0x3f93('0xdf')));_0x46b6dd[_0x3f93('0x16')]('/api/license',require('./api/license'));_0x46b6dd['use']('/api/campaigns',require(_0x3f93('0xe0')));_0x46b6dd['use'](_0x3f93('0xe1'),require(_0x3f93('0xe2')));_0x46b6dd['use']('/api/attachments',require(_0x3f93('0xe3')));_0x46b6dd['use'](_0x3f93('0xe4'),require(_0x3f93('0xe5')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xe6'),require(_0x3f93('0xe7')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xe8'),require(_0x3f93('0xe9')));_0x46b6dd['use'](_0x3f93('0xea'),require(_0x3f93('0xeb')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xec'),require('./api/openchannelTransferReport'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xed'),require(_0x3f93('0xee')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xef'),require('./api/cmList'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xf0'),require(_0x3f93('0xf1')));_0x46b6dd['use'](_0x3f93('0xf2'),require(_0x3f93('0xf3')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xf4'),require(_0x3f93('0xf5')));_0x46b6dd[_0x3f93('0x16')]('/api/userProfile/resources',require(_0x3f93('0xf6')));_0x46b6dd['use'](_0x3f93('0xf7'),require(_0x3f93('0xf8')));_0x46b6dd['use'](_0x3f93('0xf9'),require(_0x3f93('0xfa')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xfb'),require(_0x3f93('0xfc')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xfd'),require(_0x3f93('0xfe')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0xff'),require(_0x3f93('0x100')));_0x46b6dd['use']('/api/sa/typeproducts',require(_0x3f93('0x101')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x102'),require(_0x3f93('0x103')));_0x46b6dd[_0x3f93('0x16')]('/api/sa/invoicelaws',require(_0x3f93('0x104')));_0x46b6dd[_0x3f93('0x16')]('/api/sa/products',require(_0x3f93('0x105')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x106'),require(_0x3f93('0x107')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x108'),require('./api/saPriceList'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x109'),require('./api/saProductPricesList'));_0x46b6dd[_0x3f93('0x16')]('/api/sa/dossiers',require(_0x3f93('0x10a')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x10b'),require(_0x3f93('0x10c')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x10d'),require(_0x3f93('0x10e')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x10f'),require(_0x3f93('0x110')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x111'),require(_0x3f93('0x112')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x113'),require(_0x3f93('0x114')));_0x46b6dd[_0x3f93('0x16')]('/api/sa/invoices',require(_0x3f93('0x115')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x116'),require(_0x3f93('0x117')));_0x46b6dd[_0x3f93('0x16')]('/api/sa/invoice_details',require(_0x3f93('0x118')));_0x46b6dd[_0x3f93('0x16')]('/api/sa/proforma_details',require(_0x3f93('0x119')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x11a'),require(_0x3f93('0x11b')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x11c'),require(_0x3f93('0x11d')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x11e'),require(_0x3f93('0x11f')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x120'),require(_0x3f93('0x121')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x122'),require(_0x3f93('0x123')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x124'),require(_0x3f93('0x125')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x126'),require(_0x3f93('0x127')));_0x46b6dd['use'](_0x3f93('0x128'),require(_0x3f93('0x129')));_0x46b6dd['use']('/api/auth/local',require('./api/authLocal'));_0x46b6dd['use'](_0x3f93('0x12a'),require(_0x3f93('0x12b')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x12c'),require('./api/jira'));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x12d'),require(_0x3f93('0x12e')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x12f'),require(_0x3f93('0x130')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x131'),require(_0x3f93('0x132')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x133'),require(_0x3f93('0x134')));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x135'),express[_0x3f93('0x136')](path[_0x3f93('0x137')](config[_0x3f93('0x138')],_0x3f93('0x135'))));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x139'),express['static'](path['join'](config[_0x3f93('0x138')],_0x3f93('0x139'))));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x13a'),express['static'](path[_0x3f93('0x137')](config[_0x3f93('0x138')],_0x3f93('0x13a'))));_0x46b6dd[_0x3f93('0x16')](_0x3f93('0x13b'),express[_0x3f93('0x136')](path['join'](config[_0x3f93('0x138')],_0x3f93('0x13c'),_0x3f93('0x13d'))));_0x46b6dd[_0x3f93('0x16')]('/plugins',express[_0x3f93('0x136')](path[_0x3f93('0x137')](config[_0x3f93('0x138')],_0x3f93('0x13e'))));_0x46b6dd[_0x3f93('0x13f')](_0x3f93('0x140'))[_0x3f93('0x141')](errors[0x194]);_0x46b6dd['route']('/*')[_0x3f93('0x141')](function(_0x300587,_0x2f8c30){_0x2f8c30[_0x3f93('0x142')](path[_0x3f93('0x143')](_0x46b6dd[_0x3f93('0x141')]('appPath')+'/index.html'));});}; \ No newline at end of file +var _0x0882=['./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','/api/sounds','./api/sound','./api/tag','./api/template','/api/triggers','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/crm/nations','./api/crmNation','/api/crm/workflows','./api/crmWorkflow','./api/crmWorkflowstep','./api/crmTask','/api/sa/typeproducts','./api/saTypeProduct','/api/sa/unitmeasures','./api/saUnitMeasure','/api/sa/invoicelaws','/api/sa/products','./api/saProduct','/api/sa/salescondions','/api/sa/pricelists','/api/sa/productpriceslists','./api/saProductPricesList','/api/sa/dossiers','./api/saDossier','/api/sa/requests','/api/sa/quotations','/api/sa/productquotations','./api/saProductQuotation','./api/saOrder','./api/saProforma','/api/sa/invoices','./api/saInvoice','./api/saAsset','/api/sa/invoice_details','./api/saInvoiceDetail','/api/sa/proforma_details','./api/saProformaDetail','/api/sa/payments','./api/saPayment','/api/sa/paymentMethods','/api/sa/creditNotes','./api/saCreditNote','./api/saCreditNoteDetail','./api/saInvoiceNumber','./api/saCreditNoteNumber','/api/sa/company_types','./api/saCompanyType','/api/sa/company_relationshipes','./api/saCompanyRelationship','/api/auth/local','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/apidoc','static','join','/www','root','/demo','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','/index.html','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','user','role','body','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','statusCode','responseTime','name','device','other','agent_id','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final'];(function(_0x254e98,_0x3d1f14){var _0x3fde73=function(_0x212dc4){while(--_0x212dc4){_0x254e98['push'](_0x254e98['shift']());}};_0x3fde73(++_0x3d1f14);}(_0x0882,0xb5));var _0x2088=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x0882[_0x13b330];return _0x1f666c;};'use strict';var path=require(_0x2088('0x0'));var express=require(_0x2088('0x1'));var ewinston=require(_0x2088('0x2'));var util=require(_0x2088('0x3'));var errors=require(_0x2088('0x4'));var config=require(_0x2088('0x5'));var logger=require(_0x2088('0x6'))(_0x2088('0x7'));var authLogger=require(_0x2088('0x6'))(_0x2088('0x8'));exports[_0x2088('0x9')]=function(_0x413721){_0x413721[_0x2088('0xa')](ewinston[_0x2088('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x504967,_0x3385df){return util['format'](_0x2088('0xc'),_0x504967[_0x2088('0xd')],_0x504967[_0x2088('0xe')][_0x2088('0xf')]?_0x504967[_0x2088('0xe')][_0x2088('0xf')]:_0x504967[_0x2088('0x10')][_0x2088('0x11')]||_0x504967['ip'],_0x504967[_0x2088('0x12')],_0x3385df['statusCode'],_0x3385df['responseTime'],_0x504967['user']?_0x504967[_0x2088('0x13')]['id']:null,_0x504967[_0x2088('0x13')]?_0x504967[_0x2088('0x13')]['name']:null,_0x504967[_0x2088('0x13')]?_0x504967[_0x2088('0x13')][_0x2088('0x14')]:null);}}));_0x413721[_0x2088('0xa')](ewinston[_0x2088('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2ed9de,_0x587bc9){var _0x16d2bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2ed9de[_0x2088('0x15')]&&_0x2ed9de['body']['device']&&_0x2ed9de['body']['agent_id']){_0x16d2bc=_0x2088('0x16');}return util[_0x2088('0x17')](_0x16d2bc,_0x2ed9de[_0x2088('0xd')],_0x2ed9de['headers'][_0x2088('0xf')]?_0x2ed9de[_0x2088('0xe')]['x-forwarded-for']:_0x2ed9de[_0x2088('0x10')][_0x2088('0x11')]||_0x2ed9de['ip'],_0x2ed9de[_0x2088('0x12')],_0x587bc9[_0x2088('0x18')],_0x587bc9[_0x2088('0x19')],_0x2ed9de[_0x2088('0x13')]?_0x2ed9de[_0x2088('0x13')]['id']:null,_0x2ed9de[_0x2088('0x13')]?_0x2ed9de[_0x2088('0x13')][_0x2088('0x1a')]:null,_0x2ed9de['user']?_0x2ed9de[_0x2088('0x13')][_0x2088('0x14')]:null,_0x2ed9de[_0x2088('0x15')]&&_0x2ed9de[_0x2088('0x15')][_0x2088('0x1b')]?_0x2ed9de[_0x2088('0x15')]['device']:_0x2088('0x1c'),_0x2ed9de[_0x2088('0x15')]&&_0x2ed9de[_0x2088('0x15')][_0x2088('0x1d')]?_0x2ed9de['body'][_0x2088('0x1d')]:'',_0x2ed9de[_0x2088('0x15')]&&_0x2ed9de[_0x2088('0x15')][_0x2088('0x1e')]?_0x2ed9de[_0x2088('0x15')][_0x2088('0x1e')]:'');},'ignoreRoute':function(_0x2221ab){var _0x36eb3a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x36eb3a[_0x2088('0x1f')](_0x2221ab['url']);}}));_0x413721['use'](_0x2088('0x20'),require(_0x2088('0x21')));_0x413721['use']('/api/voice/chanspy',require(_0x2088('0x22')));_0x413721[_0x2088('0xa')]('/api/voice/contexts',require(_0x2088('0x23')));_0x413721[_0x2088('0xa')](_0x2088('0x24'),require(_0x2088('0x25')));_0x413721[_0x2088('0xa')]('/api/voice/mohs',require(_0x2088('0x26')));_0x413721[_0x2088('0xa')](_0x2088('0x27'),require(_0x2088('0x28')));_0x413721[_0x2088('0xa')](_0x2088('0x29'),require('./api/voiceRecording'));_0x413721[_0x2088('0xa')](_0x2088('0x2a'),require(_0x2088('0x2b')));_0x413721[_0x2088('0xa')](_0x2088('0x2c'),require(_0x2088('0x2d')));_0x413721[_0x2088('0xa')](_0x2088('0x2e'),require(_0x2088('0x2f')));_0x413721['use'](_0x2088('0x30'),require(_0x2088('0x31')));_0x413721[_0x2088('0xa')](_0x2088('0x32'),require(_0x2088('0x33')));_0x413721[_0x2088('0xa')](_0x2088('0x34'),require(_0x2088('0x35')));_0x413721[_0x2088('0xa')](_0x2088('0x36'),require(_0x2088('0x37')));_0x413721[_0x2088('0xa')]('/api/members/reports',require('./api/memberReport'));_0x413721[_0x2088('0xa')](_0x2088('0x38'),require(_0x2088('0x39')));_0x413721[_0x2088('0xa')](_0x2088('0x3a'),require(_0x2088('0x3b')));_0x413721[_0x2088('0xa')](_0x2088('0x3c'),require(_0x2088('0x3d')));_0x413721['use'](_0x2088('0x3e'),require(_0x2088('0x3f')));_0x413721[_0x2088('0xa')](_0x2088('0x40'),require('./api/mailQueue'));_0x413721[_0x2088('0xa')](_0x2088('0x41'),require(_0x2088('0x42')));_0x413721[_0x2088('0xa')]('/api/mail/interactions',require('./api/mailInteraction'));_0x413721[_0x2088('0xa')](_0x2088('0x43'),require('./api/mailMessage'));_0x413721[_0x2088('0xa')](_0x2088('0x44'),require(_0x2088('0x45')));_0x413721[_0x2088('0xa')](_0x2088('0x46'),require(_0x2088('0x47')));_0x413721[_0x2088('0xa')]('/api/dashboards',require(_0x2088('0x48')));_0x413721[_0x2088('0xa')]('/api/dashboards/items',require(_0x2088('0x49')));_0x413721['use'](_0x2088('0x4a'),require(_0x2088('0x4b')));_0x413721['use'](_0x2088('0x4c'),require(_0x2088('0x4d')));_0x413721[_0x2088('0xa')](_0x2088('0x4e'),require(_0x2088('0x4f')));_0x413721[_0x2088('0xa')](_0x2088('0x50'),require(_0x2088('0x51')));_0x413721[_0x2088('0xa')](_0x2088('0x52'),require(_0x2088('0x53')));_0x413721[_0x2088('0xa')]('/api/fax/reports/queue',require(_0x2088('0x54')));_0x413721['use'](_0x2088('0x55'),require(_0x2088('0x56')));_0x413721[_0x2088('0xa')](_0x2088('0x57'),require(_0x2088('0x58')));_0x413721[_0x2088('0xa')](_0x2088('0x59'),require(_0x2088('0x5a')));_0x413721['use'](_0x2088('0x5b'),require(_0x2088('0x5c')));_0x413721[_0x2088('0xa')](_0x2088('0x5d'),require(_0x2088('0x5e')));_0x413721[_0x2088('0xa')](_0x2088('0x5f'),require('./api/openchannelAccount'));_0x413721[_0x2088('0xa')]('/api/openchannel/applications',require(_0x2088('0x60')));_0x413721['use'](_0x2088('0x61'),require(_0x2088('0x62')));_0x413721[_0x2088('0xa')](_0x2088('0x63'),require(_0x2088('0x64')));_0x413721[_0x2088('0xa')](_0x2088('0x65'),require(_0x2088('0x66')));_0x413721['use'](_0x2088('0x67'),require(_0x2088('0x68')));_0x413721[_0x2088('0xa')](_0x2088('0x69'),require(_0x2088('0x6a')));_0x413721[_0x2088('0xa')]('/api/chat/applications',require(_0x2088('0x6b')));_0x413721[_0x2088('0xa')]('/api/chat/interactions',require(_0x2088('0x6c')));_0x413721[_0x2088('0xa')]('/api/chat/messages',require(_0x2088('0x6d')));_0x413721[_0x2088('0xa')](_0x2088('0x6e'),require(_0x2088('0x6f')));_0x413721['use'](_0x2088('0x70'),require(_0x2088('0x71')));_0x413721['use'](_0x2088('0x72'),require(_0x2088('0x73')));_0x413721[_0x2088('0xa')](_0x2088('0x74'),require(_0x2088('0x75')));_0x413721[_0x2088('0xa')](_0x2088('0x76'),require('./api/cmCompany'));_0x413721[_0x2088('0xa')](_0x2088('0x77'),require('./api/cmContact'));_0x413721['use'](_0x2088('0x78'),require(_0x2088('0x79')));_0x413721['use'](_0x2088('0x7a'),require('./api/cmHopperBlack'));_0x413721['use'](_0x2088('0x7b'),require(_0x2088('0x7c')));_0x413721[_0x2088('0xa')](_0x2088('0x7d'),require(_0x2088('0x7e')));_0x413721[_0x2088('0xa')](_0x2088('0x7f'),require(_0x2088('0x80')));_0x413721[_0x2088('0xa')](_0x2088('0x81'),require(_0x2088('0x82')));_0x413721[_0x2088('0xa')]('/api/automations',require('./api/automation'));_0x413721[_0x2088('0xa')]('/api/canned_answers',require(_0x2088('0x83')));_0x413721[_0x2088('0xa')](_0x2088('0x84'),require('./api/disposition'));_0x413721[_0x2088('0xa')](_0x2088('0x85'),require(_0x2088('0x86')));_0x413721['use'](_0x2088('0x87'),require(_0x2088('0x88')));_0x413721[_0x2088('0xa')](_0x2088('0x89'),require(_0x2088('0x8a')));_0x413721[_0x2088('0xa')]('/api/cdr',require('./api/cdr'));_0x413721[_0x2088('0xa')](_0x2088('0x8b'),require('./api/voiceQueuesLog'));_0x413721['use']('/api/schedules',require('./api/schedule'));_0x413721[_0x2088('0xa')](_0x2088('0x8c'),require(_0x2088('0x8d')));_0x413721[_0x2088('0xa')]('/api/tags',require(_0x2088('0x8e')));_0x413721['use']('/api/templates',require(_0x2088('0x8f')));_0x413721[_0x2088('0xa')](_0x2088('0x90'),require('./api/trigger'));_0x413721[_0x2088('0xa')]('/api/variables',require('./api/variable'));_0x413721[_0x2088('0xa')](_0x2088('0x91'),require(_0x2088('0x92')));_0x413721['use']('/api/integrations/reports',require(_0x2088('0x93')));_0x413721[_0x2088('0xa')](_0x2088('0x94'),require(_0x2088('0x95')));_0x413721[_0x2088('0xa')]('/api/analytics/default_reports',require(_0x2088('0x96')));_0x413721['use'](_0x2088('0x97'),require(_0x2088('0x98')));_0x413721['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x413721[_0x2088('0xa')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x413721[_0x2088('0xa')](_0x2088('0x99'),require('./api/analyticTreeReport'));_0x413721[_0x2088('0xa')](_0x2088('0x9a'),require(_0x2088('0x9b')));_0x413721[_0x2088('0xa')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x413721[_0x2088('0xa')](_0x2088('0x9c'),require(_0x2088('0x9d')));_0x413721[_0x2088('0xa')](_0x2088('0x9e'),require(_0x2088('0x9f')));_0x413721[_0x2088('0xa')]('/api/integrations/sugarcrm/configurations',require(_0x2088('0xa0')));_0x413721['use'](_0x2088('0xa1'),require(_0x2088('0xa2')));_0x413721[_0x2088('0xa')](_0x2088('0xa3'),require(_0x2088('0xa4')));_0x413721[_0x2088('0xa')](_0x2088('0xa5'),require(_0x2088('0xa6')));_0x413721[_0x2088('0xa')](_0x2088('0xa7'),require('./api/intDeskField'));_0x413721[_0x2088('0xa')](_0x2088('0xa8'),require(_0x2088('0xa9')));_0x413721['use']('/api/integrations/zoho/configurations',require(_0x2088('0xaa')));_0x413721['use']('/api/integrations/zoho/fields',require(_0x2088('0xab')));_0x413721[_0x2088('0xa')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x413721[_0x2088('0xa')](_0x2088('0xac'),require('./api/intZendeskConfiguration'));_0x413721[_0x2088('0xa')](_0x2088('0xad'),require(_0x2088('0xae')));_0x413721[_0x2088('0xa')](_0x2088('0xaf'),require(_0x2088('0xb0')));_0x413721['use'](_0x2088('0xb1'),require(_0x2088('0xb2')));_0x413721[_0x2088('0xa')]('/api/integrations/freshdesk/fields',require(_0x2088('0xb3')));_0x413721['use']('/api/integrations/vtiger/accounts',require(_0x2088('0xb4')));_0x413721[_0x2088('0xa')](_0x2088('0xb5'),require(_0x2088('0xb6')));_0x413721[_0x2088('0xa')]('/api/integrations/vtiger/fields',require(_0x2088('0xb7')));_0x413721[_0x2088('0xa')](_0x2088('0xb8'),require(_0x2088('0xb9')));_0x413721[_0x2088('0xa')](_0x2088('0xba'),require('./api/intServicenowConfiguration'));_0x413721['use']('/api/integrations/servicenow/fields',require(_0x2088('0xbb')));_0x413721['use'](_0x2088('0xbc'),require(_0x2088('0xbd')));_0x413721['use'](_0x2088('0xbe'),require('./api/intDynamics365Configuration'));_0x413721['use'](_0x2088('0xbf'),require(_0x2088('0xc0')));_0x413721[_0x2088('0xa')](_0x2088('0xc1'),require('./api/network'));_0x413721[_0x2088('0xa')](_0x2088('0xc2'),require(_0x2088('0xc3')));_0x413721['use'](_0x2088('0xc4'),require(_0x2088('0xc5')));_0x413721['use']('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x413721[_0x2088('0xa')](_0x2088('0xc6'),require(_0x2088('0xc7')));_0x413721[_0x2088('0xa')](_0x2088('0xc8'),require(_0x2088('0xc9')));_0x413721['use'](_0x2088('0xca'),require('./api/smsQueueReport'));_0x413721[_0x2088('0xa')](_0x2088('0xcb'),require(_0x2088('0xcc')));_0x413721['use'](_0x2088('0xcd'),require(_0x2088('0xce')));_0x413721[_0x2088('0xa')](_0x2088('0xcf'),require(_0x2088('0xd0')));_0x413721[_0x2088('0xa')](_0x2088('0xd1'),require(_0x2088('0xd2')));_0x413721['use'](_0x2088('0xd3'),require('./api/squareOdbc'));_0x413721[_0x2088('0xa')]('/api/square/projects',require(_0x2088('0xd4')));_0x413721['use'](_0x2088('0xd5'),require('./api/squareRecording'));_0x413721[_0x2088('0xa')](_0x2088('0xd6'),require(_0x2088('0xd7')));_0x413721[_0x2088('0xa')](_0x2088('0xd8'),require(_0x2088('0xd9')));_0x413721[_0x2088('0xa')](_0x2088('0xda'),require(_0x2088('0xdb')));_0x413721[_0x2088('0xa')](_0x2088('0xdc'),require(_0x2088('0xdd')));_0x413721[_0x2088('0xa')](_0x2088('0xde'),require('./api/migration'));_0x413721[_0x2088('0xa')](_0x2088('0xdf'),require('./api/attachment'));_0x413721['use']('/api/plugins',require(_0x2088('0xe0')));_0x413721[_0x2088('0xa')]('/api/mail/reports/transfer',require(_0x2088('0xe1')));_0x413721[_0x2088('0xa')](_0x2088('0xe2'),require(_0x2088('0xe3')));_0x413721['use'](_0x2088('0xe4'),require(_0x2088('0xe5')));_0x413721['use'](_0x2088('0xe6'),require(_0x2088('0xe7')));_0x413721[_0x2088('0xa')]('/api/sms/reports/transfer',require(_0x2088('0xe8')));_0x413721[_0x2088('0xa')](_0x2088('0xe9'),require(_0x2088('0xea')));_0x413721[_0x2088('0xa')]('/api/voice/prefixes',require(_0x2088('0xeb')));_0x413721[_0x2088('0xa')]('/api/userProfiles',require(_0x2088('0xec')));_0x413721[_0x2088('0xa')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x413721[_0x2088('0xa')](_0x2088('0xed'),require(_0x2088('0xee')));_0x413721[_0x2088('0xa')](_0x2088('0xef'),require(_0x2088('0xf0')));_0x413721[_0x2088('0xa')](_0x2088('0xf1'),require(_0x2088('0xf2')));_0x413721[_0x2088('0xa')]('/api/crm/workflowsteps',require(_0x2088('0xf3')));_0x413721[_0x2088('0xa')]('/api/crm/tasks',require(_0x2088('0xf4')));_0x413721[_0x2088('0xa')]('/api/crm/actionslists',require('./api/crmActionsList'));_0x413721[_0x2088('0xa')](_0x2088('0xf5'),require(_0x2088('0xf6')));_0x413721['use'](_0x2088('0xf7'),require(_0x2088('0xf8')));_0x413721['use'](_0x2088('0xf9'),require('./api/saInvoiceLaw'));_0x413721[_0x2088('0xa')](_0x2088('0xfa'),require(_0x2088('0xfb')));_0x413721['use'](_0x2088('0xfc'),require('./api/saSalesCondition'));_0x413721['use'](_0x2088('0xfd'),require('./api/saPriceList'));_0x413721[_0x2088('0xa')](_0x2088('0xfe'),require(_0x2088('0xff')));_0x413721[_0x2088('0xa')](_0x2088('0x100'),require(_0x2088('0x101')));_0x413721['use'](_0x2088('0x102'),require('./api/saRequest'));_0x413721[_0x2088('0xa')](_0x2088('0x103'),require('./api/saQuotation'));_0x413721['use'](_0x2088('0x104'),require(_0x2088('0x105')));_0x413721[_0x2088('0xa')]('/api/sa/orders',require(_0x2088('0x106')));_0x413721[_0x2088('0xa')]('/api/sa/proformas',require(_0x2088('0x107')));_0x413721[_0x2088('0xa')](_0x2088('0x108'),require(_0x2088('0x109')));_0x413721['use']('/api/sa/assets',require(_0x2088('0x10a')));_0x413721[_0x2088('0xa')](_0x2088('0x10b'),require(_0x2088('0x10c')));_0x413721[_0x2088('0xa')](_0x2088('0x10d'),require(_0x2088('0x10e')));_0x413721[_0x2088('0xa')](_0x2088('0x10f'),require(_0x2088('0x110')));_0x413721['use'](_0x2088('0x111'),require('./api/saPaymentMethod'));_0x413721['use'](_0x2088('0x112'),require(_0x2088('0x113')));_0x413721[_0x2088('0xa')]('/api/sa/creditNote_details',require(_0x2088('0x114')));_0x413721[_0x2088('0xa')]('/api/sa/invoice_numberss',require(_0x2088('0x115')));_0x413721[_0x2088('0xa')]('/api/sa/creditNote_numberss',require(_0x2088('0x116')));_0x413721[_0x2088('0xa')](_0x2088('0x117'),require(_0x2088('0x118')));_0x413721[_0x2088('0xa')](_0x2088('0x119'),require(_0x2088('0x11a')));_0x413721[_0x2088('0xa')](_0x2088('0x11b'),require('./api/authLocal'));_0x413721[_0x2088('0xa')](_0x2088('0x11c'),require('./api/authGoogle'));_0x413721[_0x2088('0xa')](_0x2088('0x11d'),require(_0x2088('0x11e')));_0x413721[_0x2088('0xa')](_0x2088('0x11f'),require(_0x2088('0x120')));_0x413721[_0x2088('0xa')](_0x2088('0x121'),require(_0x2088('0x122')));_0x413721['use'](_0x2088('0x123'),require('./api/system'));_0x413721[_0x2088('0xa')]('/api/pm2',require(_0x2088('0x124')));_0x413721[_0x2088('0xa')](_0x2088('0x125'),express[_0x2088('0x126')](path[_0x2088('0x127')](config['root'],_0x2088('0x125'))));_0x413721['use'](_0x2088('0x128'),express[_0x2088('0x126')](path['join'](config[_0x2088('0x129')],'/www')));_0x413721[_0x2088('0xa')](_0x2088('0x12a'),express['static'](path[_0x2088('0x127')](config[_0x2088('0x129')],_0x2088('0x12a'))));_0x413721['use']('/snippet',express['static'](path[_0x2088('0x127')](config['root'],'snippet','1.0.14')));_0x413721['use']('/plugins',express['static'](path[_0x2088('0x127')](config[_0x2088('0x129')],_0x2088('0x12b'))));_0x413721['route'](_0x2088('0x12c'))[_0x2088('0x12d')](errors[0x194]);_0x413721[_0x2088('0x12e')]('/*')['get'](function(_0x5b462e,_0x4140f8){_0x4140f8[_0x2088('0x12f')](path['resolve'](_0x413721[_0x2088('0x12d')]('appPath')+_0x2088('0x130')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index dc2be14..f85dc57 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad36=['../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc'];(function(_0x1c174f,_0x500b61){var _0x426cfa=function(_0x1b92fb){while(--_0x1b92fb){_0x1c174f['push'](_0x1c174f['shift']());}};_0x426cfa(++_0x500b61);}(_0xad36,0x11c));var _0x6ad3=function(_0x4aba5c,_0x32e5f0){_0x4aba5c=_0x4aba5c-0x0;var _0x82ce0b=_0xad36[_0x4aba5c];return _0x82ce0b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6ad3('0x0'));var _=require(_0x6ad3('0x1'));var config=require(_0x6ad3('0x2'));exports[_0x6ad3('0x3')]=function(){return new BPromise(function(_0x32fb2f,_0x35a0ee){var _0xef54ab={};_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x5')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x6')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x7')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/voiceRecording/voiceRecording.rpc'));_0xef54ab=_['merge'](_0xef54ab,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x8')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x9')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0xa')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0xb')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0xc')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0xd')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0xe')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0xf')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x10')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/mailQueue/mailQueue.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/mailInteraction/mailInteraction.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x11')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x12')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x13')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/faxApplication/faxApplication.rpc'));_0xef54ab=_['merge'](_0xef54ab,require('../api/faxInteraction/faxInteraction.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x14')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x15')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x16')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x17')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/smsInteraction/smsInteraction.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x18')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x19')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x1a')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x1b')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x1c')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x1d')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x1e')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x1f')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/chatMessage/chatMessage.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x20')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/cmContact/cmContact.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x21')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x22')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x23')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x24')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/interval/interval.rpc'));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x25')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x26')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/template/template.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x27')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x28')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x29')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x2a')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/intDeskAccount/intDeskAccount.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x2b')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x2c')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x2d')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x2e')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x2f')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x30')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x31')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x32')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x33')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x34')));_0xef54ab=_['merge'](_0xef54ab,require(_0x6ad3('0x35')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x36')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x37')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x38')));_0xef54ab=_[_0x6ad3('0x4')](_0xef54ab,require(_0x6ad3('0x39')));var _0x49ef39=jayson[_0x6ad3('0x3a')](_0xef54ab)[_0x6ad3('0x3b')]();var _0x556915=config[_0x6ad3('0x3c')][_0x6ad3('0x3d')]||config[_0x6ad3('0x3d')]+0x1;var _0x7225f4=config['rpc']['ip']||'localhost';_0x49ef39['on'](_0x6ad3('0x3e'),function(_0x3bae8a){return _0x35a0ee(_0x3bae8a);});_0x49ef39[_0x6ad3('0x3')](_0x556915,_0x7225f4,function(){console[_0x6ad3('0x3f')](_0x6ad3('0x40'),_0x7225f4,_0x556915);require(_0x6ad3('0x41'))[_0x6ad3('0x42')]();return _0x32fb2f('RPC\x20listening\x20on\x20'+_0x7225f4+':'+_0x556915);});});}; \ No newline at end of file +var _0x0bde=['../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/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','port','rpc','error','listen','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0x48f9d2,_0x33ba0d){var _0x5228da=function(_0x20e0cc){while(--_0x20e0cc){_0x48f9d2['push'](_0x48f9d2['shift']());}};_0x5228da(++_0x33ba0d);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require(_0xe0bd('0x0'));var BPromise=require('bluebird');var _=require(_0xe0bd('0x1'));var config=require(_0xe0bd('0x2'));exports['listen']=function(){return new BPromise(function(_0x28d5d7,_0x1bb7f7){var _0x2294a7={};_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x3')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x5')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x6')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x7')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x8')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x9')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0xa')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0xb')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/memberReport/memberReport.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/trunk/trunk.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0xc')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0xd')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0xe')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/mailAccount/mailAccount.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0xf')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/mailInteraction/mailInteraction.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/mailMessage/mailMessage.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x10')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x11')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x12')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x13')));_0x2294a7=_['merge'](_0x2294a7,require('../api/faxInteraction/faxInteraction.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x14')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x15')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x16')));_0x2294a7=_['merge'](_0x2294a7,require('../api/smsAccount/smsAccount.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x17')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x18')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x19')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x1a')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x1b')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x1c')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x1d')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x1e')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x1f')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x20')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/cmContact/cmContact.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/cmHopper/cmHopper.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x21')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x22')));_0x2294a7=_['merge'](_0x2294a7,require('../api/pause/pause.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x23')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x24')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x25')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/variable/variable.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x26')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x27')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x28')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x29')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x2a')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x2b')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x2c')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x2d')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x2e')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x2f')));_0x2294a7=_['merge'](_0x2294a7,require('../api/squareReport/squareReport.rpc'));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x30')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x31')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x32')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/squareRecording/squareRecording.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x33')));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require('../api/campaign/campaign.rpc'));_0x2294a7=_[_0xe0bd('0x4')](_0x2294a7,require(_0xe0bd('0x34')));_0x2294a7=_['merge'](_0x2294a7,require(_0xe0bd('0x35')));var _0x30c7ed=jayson[_0xe0bd('0x36')](_0x2294a7)['http']();var _0x11101b=config['rpc'][_0xe0bd('0x37')]||config[_0xe0bd('0x37')]+0x1;var _0x1e8ec2=config[_0xe0bd('0x38')]['ip']||'localhost';_0x30c7ed['on'](_0xe0bd('0x39'),function(_0x184ac4){return _0x1bb7f7(_0x184ac4);});_0x30c7ed[_0xe0bd('0x3a')](_0x11101b,_0x1e8ec2,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1e8ec2,_0x11101b);require(_0xe0bd('0x3b'))[_0xe0bd('0x3c')]();return _0x28d5d7(_0xe0bd('0x3d')+_0x1e8ec2+':'+_0x11101b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3428e02..d6671fc 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 _0x07e2=['toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','answer','ANSWER','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','setPriority','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','EventEmitter','./reply','call','setTimeout','utf8','emit','ready','line'];(function(_0x6cde88,_0x9fe8d8){var _0x3a4687=function(_0x18b8f8){while(--_0x18b8f8){_0x6cde88['push'](_0x6cde88['shift']());}};_0x3a4687(++_0x9fe8d8);}(_0x07e2,0x1c4));var _0x207e=function(_0x39aef5,_0x1eb474){_0x39aef5=_0x39aef5-0x0;var _0x27b978=_0x07e2[_0x39aef5];return _0x27b978;};'use strict';var util=require(_0x207e('0x0'));var _=require(_0x207e('0x1'));var EventEmitter=require('events')[_0x207e('0x2')];var AGIReply=require(_0x207e('0x3'));var AGIError=require('./error');function AGIChannel(_0x51a6f6){var _0x8f077f=this,_0x2f2db5=new AGIReply(),_0x258b38=![],_0x330a77={};EventEmitter[_0x207e('0x4')](_0x8f077f);_0x51a6f6['setEncoding']('utf8');_0x51a6f6[_0x207e('0x5')](0x8*0x3c*0x3c*0x3e8);_0x2f2db5['setEncoding'](_0x207e('0x6'));_0x2f2db5['on']('headers',function(_0x508502){for(var _0x54c05b in _0x508502){_0x8f077f[_0x54c05b]=_0x508502[_0x54c05b];}_0x8f077f[_0x207e('0x7')](_0x207e('0x8'));});_0x2f2db5['on'](_0x207e('0x9'),function(_0x434fef){if(_0x434fef[_0x207e('0xa')]()==_0x207e('0xb')){_0x8f077f['emit']('hangup');return;}if(_0x434fef[_0x207e('0xc')](0x0,0xb)==_0x207e('0xd')){_0x258b38=!![];}if(_0x258b38){_0x330a77['rx']+=_0x434fef+'\x0a';if(_0x434fef[_0x207e('0xe')](_0x207e('0xf'))!=-0x1){_0x258b38=![];}}else{_0x330a77['rx']=_0x434fef;}if(_0x258b38){return;}if(typeof _0x330a77['cb']==_0x207e('0x10')){var _0x4147b7=_0x330a77['rx'][_0x207e('0xc')](0x0,0x3),_0x4ce99e=null,_0x12952b=null;_0x4147b7=parseInt(_0x4147b7);if(isNaN(_0x4147b7)){_0x330a77['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x207e('0x11')});return;}if(_0x4147b7!=0xc8){_0x330a77['cb'](null,{'code':_0x4147b7,'result':-0x1,'extra':'KO'});return;}_0x4ce99e=_0x330a77['rx'][_0x207e('0xc')](0x4)[_0x207e('0x12')](_0x207e('0x13'),'');if(_0x4ce99e[_0x207e('0x14')]('\x20')!=-0x1){_0x4ce99e=_0x4ce99e[_0x207e('0x15')](0x0,_0x4ce99e[_0x207e('0x14')]('\x20'));}if(_['startsWith'](_0x4ce99e,'-1')){_0x4ce99e=parseInt(_0x4ce99e);}_0x12952b=_0x330a77['rx'][_0x207e('0x16')]('\x20');if(_0x12952b[_0x207e('0x17')]==0x3){_0x12952b=_0x12952b[0x2][_0x207e('0xc')](0x1,_0x12952b[0x2][_0x207e('0x17')]-0x1);}else if(_0x12952b['length']>0x3){var _0x167b2f=/\((.+)\)/;var _0x432531=_0x330a77['rx'][_0x207e('0x18')](_0x167b2f);if(_0x432531){_0x12952b=_0x432531[0x1];}else{_0x12952b=null;}}else{_0x12952b=null;}_0x330a77['cb'](null,{'code':_0x4147b7,'result':_0x4ce99e,'extra':_0x12952b});}});_0x51a6f6['on'](_0x207e('0x19'),function(_0x162c7f){_0x8f077f[_0x207e('0x7')]('error',new AGIError(_0x207e('0x1a'),_0x162c7f[_0x207e('0x1b')]));});_0x51a6f6['on'](_0x207e('0x1c'),function(){_0x8f077f[_0x207e('0x7')](_0x207e('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x51a6f6['on']('timeout',function(){_0x8f077f[_0x207e('0x7')](_0x207e('0x1d'),new AGIError(_0x207e('0x1e')));_0x51a6f6[_0x207e('0x1f')]();});_0x51a6f6['pipe'](_0x2f2db5);this[_0x207e('0x20')]=function(_0x3b6834,_0x14feef){var _0x3b6834=_0x3b6834||'',_0x14feef=typeof _0x14feef==_0x207e('0x10')?_0x14feef:new Function();_0x330a77={'tx':_0x3b6834,'rx':'','cb':_0x14feef};_0x51a6f6[_0x207e('0x21')](_0x3b6834+'\x0a');},this[_0x207e('0x1c')]=function(){_0x51a6f6['destroy']();};}util[_0x207e('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x1b6a98){return this['command']['sync'](this,_0x1b6a98);};AGIChannel[_0x207e('0x23')][_0x207e('0x24')]=function(){return this['sendRequest'](_0x207e('0x25'));};AGIChannel['prototype'][_0x207e('0x26')]=function(_0x4b8e95,_0x765b6b,_0x6f8e2a){_0x4b8e95=_0x4b8e95===undefined?_0x207e('0x27'):_0x4b8e95;_0x765b6b=_0x765b6b===undefined?'5':_0x765b6b;_0x6f8e2a=_0x6f8e2a===undefined?'1':_0x6f8e2a;return this[_0x207e('0x28')](util[_0x207e('0x29')](_0x207e('0x2a'),_0x4b8e95,_0x765b6b*0x3e8,_0x6f8e2a));};AGIChannel['prototype']['noop']=function(_0x2375b8){_0x2375b8=_0x2375b8||_0x207e('0x2b');return this[_0x207e('0x28')](util[_0x207e('0x29')](_0x207e('0x2c'),_0x2375b8));};AGIChannel[_0x207e('0x23')][_0x207e('0x2d')]=function(_0x5f01ed,_0x21666a){if(_[_0x207e('0x2e')](_0x21666a)){return this[_0x207e('0x28')](util['format']('EXEC\x20%s\x20%s',_0x5f01ed,_0x21666a[_0x207e('0x2f')](',')));}return this['sendRequest'](util[_0x207e('0x29')](_0x207e('0x30'),_0x5f01ed,_0x21666a));};AGIChannel['prototype']['setContext']=function(_0x405a7d){return this['sendRequest'](util[_0x207e('0x29')](_0x207e('0x31'),_0x405a7d));};AGIChannel[_0x207e('0x23')][_0x207e('0x32')]=function(_0x2927ae){return this[_0x207e('0x28')](util[_0x207e('0x29')](_0x207e('0x33'),_0x2927ae));};AGIChannel['prototype']['setPriority']=function(_0x24b8ff){return this['sendRequest'](util['format'](_0x207e('0x34'),_0x24b8ff));};AGIChannel[_0x207e('0x23')][_0x207e('0xb')]=function(){return this[_0x207e('0x28')](_0x207e('0x35'));};AGIChannel['prototype'][_0x207e('0x36')]=function(_0xf02e88,_0x43d8d1){return this[_0x207e('0x28')](util[_0x207e('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf02e88,_0x43d8d1?_0x43d8d1[_0x207e('0x37')]()[_0x207e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x207e('0x23')]['sayNumber']=function(_0xfb7ba0,_0x4607ab){return this['sendRequest'](util[_0x207e('0x29')](_0x207e('0x38'),_0xfb7ba0,_0x4607ab));};AGIChannel[_0x207e('0x23')][_0x207e('0x39')]=function(_0x2e3e50,_0x577d2b){return this['sendRequest'](util['format'](_0x207e('0x3a'),_0x2e3e50,_0x577d2b));};AGIChannel[_0x207e('0x23')][_0x207e('0x3b')]=function(_0x40e19e,_0x528db9){return this[_0x207e('0x28')](util[_0x207e('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x40e19e,_0x528db9));};AGIChannel[_0x207e('0x23')][_0x207e('0x3c')]=function(_0x31f5ff,_0x505e44,_0x2d420d){_0x505e44=_0x505e44||this[_0x207e('0x3d')];_0x2d420d=_0x2d420d||0x1;this[_0x207e('0x3e')](_0x31f5ff);this[_0x207e('0x32')](_0x505e44);this[_0x207e('0x3f')](_0x2d420d);return this[_0x207e('0x40')](util[_0x207e('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x31f5ff,_0x505e44,_0x2d420d));};AGIChannel['prototype'][_0x207e('0x41')]=function(_0x90ab56){return this[_0x207e('0x28')](util['format'](_0x207e('0x42'),_0x90ab56));};AGIChannel[_0x207e('0x23')][_0x207e('0x43')]=function(_0x421fbc,_0x5ae6a2,_0x17e641,_0x24602f,_0x838cbc,_0x45b19a){_0x5ae6a2=_0x5ae6a2||_0x207e('0x44');_0x17e641=_0x17e641||'';_0x24602f=_0x24602f===undefined?-0x1:_0x24602f==='-1'?-0x1:_0x24602f*0x3e8;_0x838cbc=_0x838cbc===undefined?'':'s='+_0x838cbc;_0x45b19a=_0x45b19a?_0x207e('0x45'):'';return this['sendRequest'](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x421fbc,_0x5ae6a2,_0x17e641,_0x24602f,_0x45b19a,_0x838cbc));};AGIChannel[_0x207e('0x23')][_0x207e('0x46')]=function(_0x21df8e,_0x25d83d){_0x25d83d=_0x25d83d||'';return this[_0x207e('0x28')](util[_0x207e('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x21df8e,_0x25d83d));};AGIChannel[_0x207e('0x23')][_0x207e('0x47')]=function(_0x27e4e6){return this['exec'](_0x207e('0x48'),_0x27e4e6);};AGIChannel[_0x207e('0x23')][_0x207e('0x49')]=function(_0x54f289){return this[_0x207e('0x2d')](_0x207e('0x4a'),_0x54f289);};AGIChannel[_0x207e('0x23')]['error']=function(_0x2282e2,_0x1eef42){this[_0x207e('0x40')](util['format'](_0x207e('0x4b'),_0x2282e2['id'],_0x2282e2['label'],_0x1eef42));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x207e('0x4c')]=AGIChannel; \ No newline at end of file +var _0x94e1=['sayNumber','sayDigits','sayPhonetic','continueAt','setContext','noop','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','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','EventEmitter','./reply','./error','utf8','setEncoding','headers','line','toLowerCase','emit','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sync','sendRequest','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString'];(function(_0x2ade6c,_0x2d42f2){var _0x2cb372=function(_0x477d8a){while(--_0x477d8a){_0x2ade6c['push'](_0x2ade6c['shift']());}};_0x2cb372(++_0x2d42f2);}(_0x94e1,0x131));var _0x194e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x94e1[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x194e('0x0'));var _=require(_0x194e('0x1'));var EventEmitter=require('events')[_0x194e('0x2')];var AGIReply=require(_0x194e('0x3'));var AGIError=require(_0x194e('0x4'));function AGIChannel(_0x17646e){var _0x1cea27=this,_0x1a86df=new AGIReply(),_0x2cdc5d=![],_0x5f3082={};EventEmitter['call'](_0x1cea27);_0x17646e['setEncoding'](_0x194e('0x5'));_0x17646e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1a86df[_0x194e('0x6')](_0x194e('0x5'));_0x1a86df['on'](_0x194e('0x7'),function(_0x53f584){for(var _0x5af693 in _0x53f584){_0x1cea27[_0x5af693]=_0x53f584[_0x5af693];}_0x1cea27['emit']('ready');});_0x1a86df['on'](_0x194e('0x8'),function(_0x129852){if(_0x129852[_0x194e('0x9')]()=='hangup'){_0x1cea27[_0x194e('0xa')](_0x194e('0xb'));return;}if(_0x129852[_0x194e('0xc')](0x0,0xb)==_0x194e('0xd')){_0x2cdc5d=!![];}if(_0x2cdc5d){_0x5f3082['rx']+=_0x129852+'\x0a';if(_0x129852[_0x194e('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x2cdc5d=![];}}else{_0x5f3082['rx']=_0x129852;}if(_0x2cdc5d){return;}if(typeof _0x5f3082['cb']==_0x194e('0xf')){var _0x2f5e43=_0x5f3082['rx'][_0x194e('0xc')](0x0,0x3),_0x11497e=null,_0x21552a=null;_0x2f5e43=parseInt(_0x2f5e43);if(isNaN(_0x2f5e43)){_0x5f3082['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x194e('0x10')});return;}if(_0x2f5e43!=0xc8){_0x5f3082['cb'](null,{'code':_0x2f5e43,'result':-0x1,'extra':'KO'});return;}_0x11497e=_0x5f3082['rx'][_0x194e('0xc')](0x4)[_0x194e('0x11')](_0x194e('0x12'),'');if(_0x11497e[_0x194e('0x13')]('\x20')!=-0x1){_0x11497e=_0x11497e[_0x194e('0x14')](0x0,_0x11497e[_0x194e('0x13')]('\x20'));}if(_[_0x194e('0x15')](_0x11497e,'-1')){_0x11497e=parseInt(_0x11497e);}_0x21552a=_0x5f3082['rx']['split']('\x20');if(_0x21552a['length']==0x3){_0x21552a=_0x21552a[0x2][_0x194e('0xc')](0x1,_0x21552a[0x2][_0x194e('0x16')]-0x1);}else if(_0x21552a[_0x194e('0x16')]>0x3){var _0x56df7e=/\((.+)\)/;var _0x257972=_0x5f3082['rx'][_0x194e('0x17')](_0x56df7e);if(_0x257972){_0x21552a=_0x257972[0x1];}else{_0x21552a=null;}}else{_0x21552a=null;}_0x5f3082['cb'](null,{'code':_0x2f5e43,'result':_0x11497e,'extra':_0x21552a});}});_0x17646e['on'](_0x194e('0x18'),function(_0x4fa3b5){_0x1cea27[_0x194e('0xa')](_0x194e('0x18'),new AGIError(_0x194e('0x19'),_0x4fa3b5[_0x194e('0x1a')]));});_0x17646e['on']('close',function(){_0x1cea27['emit'](_0x194e('0x1b'),new AGIError(_0x194e('0x1c')));});_0x17646e['on'](_0x194e('0x1d'),function(){_0x1cea27[_0x194e('0xa')](_0x194e('0x1d'),new AGIError(_0x194e('0x1e')));_0x17646e[_0x194e('0x1f')]();});_0x17646e['pipe'](_0x1a86df);this[_0x194e('0x20')]=function(_0x1936ef,_0x4991d1){var _0x1936ef=_0x1936ef||'',_0x4991d1=typeof _0x4991d1=='function'?_0x4991d1:new Function();_0x5f3082={'tx':_0x1936ef,'rx':'','cb':_0x4991d1};_0x17646e[_0x194e('0x21')](_0x1936ef+'\x0a');},this[_0x194e('0x1b')]=function(){_0x17646e[_0x194e('0x1f')]();};}util[_0x194e('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x194e('0x23')]['sendRequest']=function(_0x31a5e0){return this[_0x194e('0x20')][_0x194e('0x24')](this,_0x31a5e0);};AGIChannel['prototype']['answer']=function(){return this[_0x194e('0x25')]('ANSWER');};AGIChannel[_0x194e('0x23')][_0x194e('0x26')]=function(_0x201c28,_0x463321,_0x27b947){_0x201c28=_0x201c28===undefined?_0x194e('0x27'):_0x201c28;_0x463321=_0x463321===undefined?'5':_0x463321;_0x27b947=_0x27b947===undefined?'1':_0x27b947;return this[_0x194e('0x25')](util[_0x194e('0x28')](_0x194e('0x29'),_0x201c28,_0x463321*0x3e8,_0x27b947));};AGIChannel[_0x194e('0x23')]['noop']=function(_0x819faa){_0x819faa=_0x819faa||_0x194e('0x2a');return this[_0x194e('0x25')](util['format'](_0x194e('0x2b'),_0x819faa));};AGIChannel[_0x194e('0x23')][_0x194e('0x2c')]=function(_0x53a6bf,_0x27e2ec){if(_[_0x194e('0x2d')](_0x27e2ec)){return this['sendRequest'](util['format'](_0x194e('0x2e'),_0x53a6bf,_0x27e2ec[_0x194e('0x2f')](',')));}return this[_0x194e('0x25')](util['format'](_0x194e('0x2e'),_0x53a6bf,_0x27e2ec));};AGIChannel['prototype']['setContext']=function(_0x358b73){return this[_0x194e('0x25')](util[_0x194e('0x28')]('SET\x20CONTEXT\x20%s',_0x358b73));};AGIChannel[_0x194e('0x23')][_0x194e('0x30')]=function(_0x4c1b98){return this[_0x194e('0x25')](util[_0x194e('0x28')](_0x194e('0x31'),_0x4c1b98));};AGIChannel[_0x194e('0x23')][_0x194e('0x32')]=function(_0x11347c){return this['sendRequest'](util[_0x194e('0x28')](_0x194e('0x33'),_0x11347c));};AGIChannel[_0x194e('0x23')][_0x194e('0xb')]=function(){return this[_0x194e('0x25')](_0x194e('0x34'));};AGIChannel[_0x194e('0x23')][_0x194e('0x35')]=function(_0x3d2645,_0x2c2a5d){return this[_0x194e('0x25')](util[_0x194e('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3d2645,_0x2c2a5d?_0x2c2a5d[_0x194e('0x36')]()[_0x194e('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x194e('0x23')][_0x194e('0x37')]=function(_0x5ad8f9,_0x3def95){return this[_0x194e('0x25')](util[_0x194e('0x28')]('SAY\x20NUMBER\x20%s\x20%s',_0x5ad8f9,_0x3def95));};AGIChannel[_0x194e('0x23')][_0x194e('0x38')]=function(_0x651e13,_0x252947){return this['sendRequest'](util[_0x194e('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x651e13,_0x252947));};AGIChannel[_0x194e('0x23')][_0x194e('0x39')]=function(_0x1cd26f,_0x49e018){return this['sendRequest'](util[_0x194e('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1cd26f,_0x49e018));};AGIChannel['prototype'][_0x194e('0x3a')]=function(_0x4e0e67,_0x4a9eab,_0x5a0260){_0x4a9eab=_0x4a9eab||this['extension'];_0x5a0260=_0x5a0260||0x1;this[_0x194e('0x3b')](_0x4e0e67);this[_0x194e('0x30')](_0x4a9eab);this[_0x194e('0x32')](_0x5a0260);return this[_0x194e('0x3c')](util[_0x194e('0x28')](_0x194e('0x3d'),_0x4e0e67,_0x4a9eab,_0x5a0260));};AGIChannel[_0x194e('0x23')][_0x194e('0x3e')]=function(_0x438915){return this[_0x194e('0x25')](util[_0x194e('0x28')](_0x194e('0x3f'),_0x438915));};AGIChannel[_0x194e('0x23')][_0x194e('0x40')]=function(_0x5d35d1,_0x7bb3cf,_0xb60c7,_0x2f9146,_0x54ed79,_0x3c6328){_0x7bb3cf=_0x7bb3cf||_0x194e('0x41');_0xb60c7=_0xb60c7||'';_0x2f9146=_0x2f9146===undefined?-0x1:_0x2f9146==='-1'?-0x1:_0x2f9146*0x3e8;_0x54ed79=_0x54ed79===undefined?'':'s='+_0x54ed79;_0x3c6328=_0x3c6328?'BEEP':'';return this[_0x194e('0x25')](util[_0x194e('0x28')](_0x194e('0x42'),_0x5d35d1,_0x7bb3cf,_0xb60c7,_0x2f9146,_0x3c6328,_0x54ed79));};AGIChannel[_0x194e('0x23')][_0x194e('0x43')]=function(_0x54512e,_0x307baa){_0x307baa=_0x307baa||'';return this['sendRequest'](util[_0x194e('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x54512e,_0x307baa));};AGIChannel[_0x194e('0x23')][_0x194e('0x44')]=function(_0x23ea0b){return this[_0x194e('0x2c')](_0x194e('0x45'),_0x23ea0b);};AGIChannel['prototype'][_0x194e('0x46')]=function(_0x26b2e4){return this[_0x194e('0x2c')]('WAIT',_0x26b2e4);};AGIChannel['prototype'][_0x194e('0x18')]=function(_0x2c2467,_0x192998){this[_0x194e('0x3c')](util['format'](_0x194e('0x47'),_0x2c2467['id'],_0x2c2467['label'],_0x192998));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index a6d4c7d..763706e 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 _0x4068=['message','name','exports','util','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x4068,0x1e3));var _0x8406=function(_0x97c41c,_0x124465){_0x97c41c=_0x97c41c-0x0;var _0x369c9c=_0x4068[_0x97c41c];return _0x369c9c;};'use strict';var util=require(_0x8406('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8406('0x1'),'E_AGI_SOCKET_ERROR':_0x8406('0x2'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8406('0x3'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x8406('0x4')};function AGIError(_0x5ea392){var _0x5ea392=_0x5ea392||null,_0xfae2dd=_0xfae2dd||[],_0x1627af=0x1,_0x55970a='';if(!error[_0x5ea392]){_0x5ea392=_0x8406('0x5');}_0xfae2dd[_0x8406('0x6')](error[_0x5ea392]);while(arguments[_0x1627af]){_0xfae2dd['push'](arguments[_0x1627af]);_0x1627af++;}_0x55970a=util[_0x8406('0x7')][_0x8406('0x8')](util,_0xfae2dd);this[_0x8406('0x9')]=_0x55970a;this[_0x8406('0xa')]=_0x5ea392;}module[_0x8406('0xb')]=AGIError; \ No newline at end of file +var _0x32db=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','exports'];(function(_0x4c075b,_0x56c2e7){var _0x228448=function(_0x37c25c){while(--_0x37c25c){_0x4c075b['push'](_0x4c075b['shift']());}};_0x228448(++_0x56c2e7);}(_0x32db,0x134));var _0xb32d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x32db[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xb32d('0x0'),'E_AGI_SERVER_ERROR':_0xb32d('0x1'),'E_AGI_SERVER_CLOSE':_0xb32d('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xb32d('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xb32d('0x4'),'E_AGI_SOCKET_ERROR':_0xb32d('0x5'),'E_AGI_SOCKET_CLOSE':_0xb32d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb32d('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb32d('0x8'),'E_AGI_IVR_ENTRY':_0xb32d('0x9')};function AGIError(_0x2d016b){var _0x2d016b=_0x2d016b||null,_0x223e69=_0x223e69||[],_0x2f35f5=0x1,_0x3b146e='';if(!error[_0x2d016b]){_0x2d016b='E_AGI_UNDEFINED';}_0x223e69[_0xb32d('0xa')](error[_0x2d016b]);while(arguments[_0x2f35f5]){_0x223e69[_0xb32d('0xa')](arguments[_0x2f35f5]);_0x2f35f5++;}_0x3b146e=util[_0xb32d('0xb')][_0xb32d('0xc')](util,_0x223e69);this['message']=_0x3b146e;this['name']=_0x2d016b;}module[_0xb32d('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index da987e3..f19823c 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 _0x0565=['agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','relations','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split'];(function(_0x23a508,_0x5407b6){var _0x25a10f=function(_0x3e1fc1){while(--_0x3e1fc1){_0x23a508['push'](_0x23a508['shift']());}};_0x25a10f(++_0x5407b6);}(_0x0565,0xf2));var _0x5056=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x0565[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x5056('0x0'));var logger=require(_0x5056('0x1'))(_0x5056('0x2'));var verticesWithRetry=[_0x5056('0x3'),_0x5056('0x4'),_0x5056('0x5')];var Graph=function(){this[_0x5056('0x6')]={};this[_0x5056('0x7')]={};this[_0x5056('0x8')]=0x0;};Graph[_0x5056('0x9')]['addVertex']=function(_0x946e96){this[_0x5056('0x6')][_0x946e96['id']]=_0x946e96;this[_0x5056('0x7')][_0x946e96['id']]=[];};Graph[_0x5056('0x9')]['addEdge']=function(_0x52b01f,_0x38f74,_0x223c92){this[_0x5056('0x7')][_0x52b01f][_0x5056('0xa')]({'target':_0x38f74,'condition':_0x223c92});this[_0x5056('0x8')]+=0x1;};Graph[_0x5056('0x9')][_0x5056('0xb')]=function(){return _[_0x5056('0xb')](this['vertices']);};Graph[_0x5056('0x9')][_0x5056('0xc')]=function(){return this[_0x5056('0x8')];};Graph['prototype']['getVertex']=function(_0x17f43e){return this['vertices'][_0x17f43e];};Graph['prototype']['traverseBFS']=function(_0x2d44fb,_0x4b183a){if(!this[_0x5056('0x6')][_0x2d44fb]){return logger[_0x5056('0xd')](_0x5056('0xe'));}var _0x543cee=_0x4b183a(this[_0x5056('0x6')][_0x2d44fb]);if(!_0x543cee){return logger[_0x5056('0xd')](_0x5056('0xf'));}if(this[_0x5056('0x7')][_0x2d44fb][_0x5056('0x10')]===0x0){return logger[_0x5056('0xd')]('no\x20edge/s\x20available');}for(var _0x2b7a17=0x0,_0x560d1e=[],_0x43db77=![];_0x2b7a17\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','catch','agi_','substring','inspect','variables','stringify','dnid','close','timeout','hangup','sync','production','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','code','result','response','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','error','[%s]\x20%s','message','[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','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x46b4b3,_0xcd494e){var _0x52b326=function(_0x368752){while(--_0x368752){_0x46b4b3['push'](_0x46b4b3['shift']());}};_0x52b326(++_0xcd494e);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x5dccae,_0xa7c7d4){_0x5dccae=_0x5dccae-0x0;var _0x164ce9=_0xd2bb[_0x5dccae];return _0x164ce9;};'use strict';var parser=require('xml2json');var _=require(_0xbd2b('0x0'));var syncho=require('syncho');var util=require(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var config=require(_0xbd2b('0x3'));var logger=require(_0xbd2b('0x4'))(_0xbd2b('0x5'));var utilLicense=require(_0xbd2b('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xbd2b('0x7'));var Graph=require(_0xbd2b('0x8'));var Vertices=require(_0xbd2b('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xbd2b('0x5')]=_[_0xbd2b('0xa')](config[_0xbd2b('0x5')],{'ip':_0xbd2b('0xb'),'port':0x11dd});function connectionHandler(_0x30cd3f){process[_0xbd2b('0xc')](function(){syncho(function(){try{setChannelVariables(_0x30cd3f);agiHandler(_0x30cd3f);}catch(_0x3fc39e){logger['error'](_0x3fc39e[_0xbd2b('0xd')]);}});});}function listeningHandler(){console['log'](_0xbd2b('0xe'),config[_0xbd2b('0x5')]['port']);logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x11'),config[_0xbd2b('0x5')]['ip'],config[_0xbd2b('0x5')][_0xbd2b('0x12')]));}function errorHandler(_0x1077b0){if(_0x1077b0&&_0x1077b0[_0xbd2b('0x13')]&&_0x1077b0['message']){logger[_0xbd2b('0x14')](util[_0xbd2b('0x10')](_0xbd2b('0x15'),_0x1077b0[_0xbd2b('0x13')],_0x1077b0[_0xbd2b('0x16')]));}else{logger['error'](util[_0xbd2b('0x10')](_0xbd2b('0x17'),_0x1077b0[_0xbd2b('0xd')]));}}function closeHandler(){logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x18'),this[_0xbd2b('0x19')],this[_0xbd2b('0x1a')],this[_0xbd2b('0x1b')],this['dnid'],this[_0xbd2b('0x1c')]));try{createSquareReport(this);}catch(_0x268025){logger[_0xbd2b('0x14')](_0x268025[_0xbd2b('0xd')]);}}function timeoutHandler(){logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x1d'),this[_0xbd2b('0x19')],this[_0xbd2b('0x1a')],this[_0xbd2b('0x1b')],this['dnid'],this[_0xbd2b('0x1c')]));}function hangupHandler(){logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x1e'),this[_0xbd2b('0x19')],this[_0xbd2b('0x1a')],this[_0xbd2b('0x1b')],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x2fb14b){return parser['toJson'](_0x2fb14b,{'object':!![]})[_0xbd2b('0x1f')][_0xbd2b('0x20')];}function addVertex(_0x48d06d,_0x5b6b31,_0x1a2b3d){_0x5b6b31[_0xbd2b('0x21')]=_0x1a2b3d;if(_0x5b6b31['hasOwnProperty']('retry')){_0x5b6b31['maxRetry']=parseInt(_0x5b6b31[_0xbd2b('0x22')],0xa);}_0x48d06d[_0xbd2b('0x23')](_[_0xbd2b('0x24')](_0x5b6b31,_0xbd2b('0x25')));}function initGraph(_0x17bb23,_0x21ce4d){var _0x5bf25b=new Graph();for(var _0x51e091 in _0x17bb23){if(_0x17bb23[_0xbd2b('0x26')](_0x51e091)){if(_[_0xbd2b('0x27')](_0x17bb23[_0x51e091])){for(var _0x51b3d5=0x0;_0x51b3d5<_0x17bb23[_0x51e091][_0xbd2b('0x28')];_0x51b3d5+=0x1){addVertex(_0x5bf25b,_0x17bb23[_0x51e091][_0x51b3d5],_0x51e091);}}else{addVertex(_0x5bf25b,_0x17bb23[_0x51e091],_0x51e091);}}}for(var _0x3e4b8c=0x0;_0x3e4b8c<_0x21ce4d[_0xbd2b('0x28')];_0x3e4b8c+=0x1){if(_0x21ce4d[_0x3e4b8c][_0xbd2b('0x29')]&&_0x21ce4d[_0x3e4b8c]['target']){_0x5bf25b[_0xbd2b('0x2a')](_0x21ce4d[_0x3e4b8c]['source'],_0x21ce4d[_0x3e4b8c][_0xbd2b('0x2b')],_0x21ce4d[_0x3e4b8c][_0xbd2b('0x2c')]);}}return _0x5bf25b;}function getSquareProject(_0x32d59c,_0x2e5b0a){rpc[_0xbd2b('0x2d')](_0x32d59c)[_0xbd2b('0x2e')](function(_0x117c1f){_0x2e5b0a(null,_0x117c1f);})['catch'](function(_0x25aaa5){_0x2e5b0a(null,_0x25aaa5);});}function createSquareReport(_0x483951,_0x74726){rpc[_0xbd2b('0x2f')](_0x483951)['then'](function(_0x4d0bf8){if(_0x74726){_0x74726(null,_0x4d0bf8);}})[_0xbd2b('0x30')](function(_0x297aae){if(_0x74726){_0x74726(null,_0x297aae);}});}function setChannelVariables(_0x197696){for(var _0x3741c7 in _0x197696){if(_0x197696[_0xbd2b('0x26')](_0x3741c7)){if(_0x3741c7['indexOf'](_0xbd2b('0x31'))===0x0){_0x197696[_0x3741c7[_0xbd2b('0x32')](0x4)]=_0x197696[_0x3741c7];delete _0x197696[_0x3741c7];}}}}function getLogFromObject(_0x2ead2e){return util[_0xbd2b('0x33')](_0x2ead2e,{'showHidden':![],'depth':null});}function agiHandler(_0x24477c){var _0x87f064,_0x20703c,_0x502da1,_0x4346d2,_0x5c3e4b;logger['debug'](_0xbd2b('0x34'),JSON[_0xbd2b('0x35')](_0x24477c,null,0x2));logger[_0xbd2b('0xf')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x24477c[_0xbd2b('0x19')],_0x24477c[_0xbd2b('0x1a')],_0x24477c[_0xbd2b('0x1b')],_0x24477c[_0xbd2b('0x36')],_0x24477c[_0xbd2b('0x1c')]));_0x24477c['on']('error',errorHandler);_0x24477c['on'](_0xbd2b('0x37'),closeHandler);_0x24477c['on'](_0xbd2b('0x38'),timeoutHandler);_0x24477c['evtHangup']=![];_0x24477c['on'](_0xbd2b('0x39'),hangupHandler);var _0x5e0d58=getSquareProject[_0xbd2b('0x3a')](null,_0x24477c[_0xbd2b('0x19')]);if(_0x5e0d58){if(_0x5e0d58[_0xbd2b('0x3b')]){_0x87f064=getRoot(_0x5e0d58[_0xbd2b('0x3b')]);if(_0x87f064&&_0x87f064['start']){logger[_0xbd2b('0x3c')](_0xbd2b('0x20'),JSON[_0xbd2b('0x35')](_0x87f064,null,0x2));_0x24477c[_0xbd2b('0x3d')]=moment()['format'](_0xbd2b('0x3e'));_0x20703c=initGraph(_['omit'](_0x87f064,_0xbd2b('0x25')),_0x87f064[_0xbd2b('0x25')]);_0x502da1=new Vertices(_0x24477c,rpc,mailRpc);logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x3f'),_0x24477c['arg_1'],_0x24477c[_0xbd2b('0x1a')],_0x24477c[_0xbd2b('0x1b')],_0x24477c[_0xbd2b('0x36')],_0x24477c['uniqueid']));_0x20703c[_0xbd2b('0x40')](_0x87f064[_0xbd2b('0x41')]['id'],function(_0x10ad62){try{_0x10ad62=_0x502da1[_0xbd2b('0x42')](_0x10ad62);logger[_0xbd2b('0x3c')](_0xbd2b('0x43'),JSON['stringify'](_0x10ad62,null,0x2));if(_0x10ad62[_0xbd2b('0x21')]===_0xbd2b('0x44')){logger[_0xbd2b('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x24477c['context']=_0x10ad62['context']||_0x24477c[_0xbd2b('0x45')];_0x24477c[_0xbd2b('0x46')]=_0x10ad62[_0xbd2b('0x46')];_0x24477c[_0xbd2b('0x47')]=_0x10ad62[_0xbd2b('0x47')]?_0x10ad62['priority']-0x1:0x1;return null;}else if(_0x10ad62&&_0x502da1[_0x10ad62[_0xbd2b('0x21')]]){_0x5c3e4b=_0x502da1[_0x10ad62['agicommand']](_0x10ad62);logger[_0xbd2b('0xf')]('response',JSON[_0xbd2b('0x35')](_0x5c3e4b,null,0x2));if(_0x5c3e4b&&_0x5c3e4b[_0xbd2b('0x48')]===AGI_CODE_SUCCESS&&_0x5c3e4b[_0xbd2b('0x49')]!==AGI_RESULT_ERROR&&!_0x24477c['evtHangup']){logger['debug'](_0xbd2b('0x4a'),getLogFromObject(_0x5c3e4b));return _['isUndefined'](_0x5c3e4b[_0xbd2b('0x49')])?null:_0x5c3e4b[_0xbd2b('0x49')][_0xbd2b('0x4b')]();}else{logger[_0xbd2b('0x14')](_0xbd2b('0x4a'),getLogFromObject(_0x5c3e4b));return null;}}else{logger[_0xbd2b('0x14')](_0xbd2b('0x4c'));return null;}}catch(_0x30c0bd){logger['error'](_0x30c0bd[_0xbd2b('0xd')]);return null;}});if(_0x87f064['finally']){logger['info'](util['format'](_0xbd2b('0x4d'),_0x24477c['arg_1'],_0x24477c[_0xbd2b('0x1a')],_0x24477c[_0xbd2b('0x1b')],_0x24477c[_0xbd2b('0x36')],_0x24477c['uniqueid']));_0x20703c[_0xbd2b('0x40')](_0x87f064['finally']['id'],function(_0x18f9f6){try{_0x18f9f6=_0x502da1[_0xbd2b('0x42')](_0x18f9f6);logger[_0xbd2b('0x3c')](_0xbd2b('0x43'),JSON[_0xbd2b('0x35')](_0x18f9f6,null,0x2));if(_0x18f9f6&&_0x502da1[_0x18f9f6[_0xbd2b('0x21')]]){_0x5c3e4b=_0x502da1[_0x18f9f6['agicommand']](_0x18f9f6);if(_0x5c3e4b){logger[_0xbd2b('0x3c')](_0xbd2b('0x4a'),getLogFromObject(_0x5c3e4b));return _[_0xbd2b('0x4e')](_0x5c3e4b[_0xbd2b('0x49')])?null:_0x5c3e4b[_0xbd2b('0x49')][_0xbd2b('0x4b')]();}else{logger[_0xbd2b('0x14')]('response',getLogFromObject(_0x5c3e4b));return null;}}else{logger[_0xbd2b('0x14')]('agicommand\x20not\x20found');return null;}}catch(_0x3d254d){logger[_0xbd2b('0x14')](_0x3d254d[_0xbd2b('0xd')]);return null;}});}logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x4f'),_0x24477c[_0xbd2b('0x19')],_0x24477c[_0xbd2b('0x1a')],_0x24477c[_0xbd2b('0x1b')],_0x24477c[_0xbd2b('0x36')],_0x24477c[_0xbd2b('0x1c')]));logger['info'](util[_0xbd2b('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x24477c[_0xbd2b('0x45')],_0x24477c['extension'],parseInt(_0x24477c[_0xbd2b('0x47')],0xa)+0x1));_0x24477c[_0xbd2b('0x50')](_0x24477c[_0xbd2b('0x45')],_0x24477c[_0xbd2b('0x46')],parseInt(_0x24477c['priority'],0xa)+0x1);_0x24477c[_0xbd2b('0x37')]();}}else{logger[_0xbd2b('0x14')](util[_0xbd2b('0x10')](_0xbd2b('0x51'),_0x24477c[_0xbd2b('0x19')]));_0x24477c[_0xbd2b('0x50')](_0x24477c['context'],_0x24477c['extension'],parseInt(_0x24477c['priority'],0xa)+0x1);_0x24477c[_0xbd2b('0x37')]();}}else{logger[_0xbd2b('0x14')](util['format'](_0xbd2b('0x52'),_0x24477c[_0xbd2b('0x19')]));_0x24477c[_0xbd2b('0x50')](_0x24477c[_0xbd2b('0x45')],_0x24477c['extension'],parseInt(_0x24477c['priority'],0xa)+0x1);_0x24477c[_0xbd2b('0x37')]();}}function main(){var _0x84f4d0;return utilLicense[_0xbd2b('0x53')]()[_0xbd2b('0x2e')](function(_0xdd9ac5){if(_0xdd9ac5){if(_0xdd9ac5['voice']){if(_0xdd9ac5[_0xbd2b('0x54')]&&_0xdd9ac5['callysquare']>0x0){logger[_0xbd2b('0xf')](util[_0xbd2b('0x10')](_0xbd2b('0x55'),_0xdd9ac5[_0xbd2b('0x54')]));_0x84f4d0=_0xdd9ac5[_0xbd2b('0x54')];}else{logger[_0xbd2b('0xf')](_0xbd2b('0x56'));}}else{logger[_0xbd2b('0xf')](_0xbd2b('0x57'));_0x84f4d0=-0x1;}}})[_0xbd2b('0x30')](function(_0x2a72a0){logger[_0xbd2b('0x14')](_0xbd2b('0x58'),_0x2a72a0[_0xbd2b('0xd')]);})[_0xbd2b('0x59')](function(){var _0x5a9c2e=require(_0xbd2b('0x5a'))(config[_0xbd2b('0x5')]['port'],config['agi']['ip'],_0x84f4d0);_0x5a9c2e['on'](_0xbd2b('0x14'),errorHandler);_0x5a9c2e['on'](_0xbd2b('0x5b'),listeningHandler);_0x5a9c2e['on']('connection',connectionHandler);_0x5a9c2e['on'](_0xbd2b('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x9b67=['calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','mxGraphModel','root','hasOwnProperty','retry','maxRetry','mxCell','length','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','agicommand','gotoc','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','port','info','format','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'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x9b67,0xf6));var _0x79b6=function(_0x3c50f5,_0x5dc677){_0x3c50f5=_0x3c50f5-0x0;var _0x57a262=_0x9b67[_0x3c50f5];return _0x57a262;};'use strict';var parser=require(_0x79b6('0x0'));var _=require(_0x79b6('0x1'));var syncho=require(_0x79b6('0x2'));var util=require(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var config=require('../../config/environment');var logger=require(_0x79b6('0x5'))(_0x79b6('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x79b6('0x7'));var Graph=require(_0x79b6('0x8'));var Vertices=require(_0x79b6('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x79b6('0x6')]=_[_0x79b6('0xa')](config[_0x79b6('0x6')],{'ip':_0x79b6('0xb'),'port':0x11dd});function connectionHandler(_0x58ae2d){process[_0x79b6('0xc')](function(){syncho(function(){try{setChannelVariables(_0x58ae2d);agiHandler(_0x58ae2d);}catch(_0x107e4b){logger[_0x79b6('0xd')](_0x107e4b[_0x79b6('0xe')]);}});});}function listeningHandler(){console[_0x79b6('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x79b6('0x6')][_0x79b6('0x10')]);logger[_0x79b6('0x11')](util[_0x79b6('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x79b6('0x6')][_0x79b6('0x10')]));}function errorHandler(_0x303cfb){if(_0x303cfb&&_0x303cfb['name']&&_0x303cfb[_0x79b6('0x13')]){logger[_0x79b6('0xd')](util[_0x79b6('0x12')](_0x79b6('0x14'),_0x303cfb[_0x79b6('0x15')],_0x303cfb[_0x79b6('0x13')]));}else{logger[_0x79b6('0xd')](util[_0x79b6('0x12')](_0x79b6('0x16'),_0x303cfb[_0x79b6('0xe')]));}}function closeHandler(){logger[_0x79b6('0x11')](util[_0x79b6('0x12')](_0x79b6('0x17'),this['arg_1'],this[_0x79b6('0x18')],this[_0x79b6('0x19')],this[_0x79b6('0x1a')],this[_0x79b6('0x1b')]));try{createSquareReport(this);}catch(_0x2a8788){logger[_0x79b6('0xd')](_0x2a8788[_0x79b6('0xe')]);}}function timeoutHandler(){logger[_0x79b6('0x11')](util[_0x79b6('0x12')](_0x79b6('0x1c'),this[_0x79b6('0x1d')],this[_0x79b6('0x18')],this[_0x79b6('0x19')],this['dnid'],this[_0x79b6('0x1b')]));}function hangupHandler(){logger['info'](util[_0x79b6('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x79b6('0x1d')],this[_0x79b6('0x18')],this[_0x79b6('0x19')],this['dnid'],this[_0x79b6('0x1b')]));this[_0x79b6('0x1e')]=!![];}function getRoot(_0x53208a){return parser['toJson'](_0x53208a,{'object':!![]})[_0x79b6('0x1f')][_0x79b6('0x20')];}function addVertex(_0x9bd2cc,_0x268826,_0x3b2a2a){_0x268826['agicommand']=_0x3b2a2a;if(_0x268826[_0x79b6('0x21')](_0x79b6('0x22'))){_0x268826[_0x79b6('0x23')]=parseInt(_0x268826[_0x79b6('0x22')],0xa);}_0x9bd2cc['addVertex'](_['omit'](_0x268826,_0x79b6('0x24')));}function initGraph(_0x2d16b2,_0x37b01b){var _0xc25c99=new Graph();for(var _0x4adf15 in _0x2d16b2){if(_0x2d16b2[_0x79b6('0x21')](_0x4adf15)){if(_['isArray'](_0x2d16b2[_0x4adf15])){for(var _0x400542=0x0;_0x400542<_0x2d16b2[_0x4adf15][_0x79b6('0x25')];_0x400542+=0x1){addVertex(_0xc25c99,_0x2d16b2[_0x4adf15][_0x400542],_0x4adf15);}}else{addVertex(_0xc25c99,_0x2d16b2[_0x4adf15],_0x4adf15);}}}for(var _0x302596=0x0;_0x302596<_0x37b01b[_0x79b6('0x25')];_0x302596+=0x1){if(_0x37b01b[_0x302596]['source']&&_0x37b01b[_0x302596][_0x79b6('0x26')]){_0xc25c99[_0x79b6('0x27')](_0x37b01b[_0x302596]['source'],_0x37b01b[_0x302596][_0x79b6('0x26')],_0x37b01b[_0x302596][_0x79b6('0x28')]);}}return _0xc25c99;}function getSquareProject(_0x1b1f2b,_0x4f47dc){rpc[_0x79b6('0x29')](_0x1b1f2b)[_0x79b6('0x2a')](function(_0x53b2f5){_0x4f47dc(null,_0x53b2f5);})[_0x79b6('0x2b')](function(_0x11057e){_0x4f47dc(null,_0x11057e);});}function createSquareReport(_0x27f680,_0x40ab0c){rpc[_0x79b6('0x2c')](_0x27f680)[_0x79b6('0x2a')](function(_0x572a2a){if(_0x40ab0c){_0x40ab0c(null,_0x572a2a);}})[_0x79b6('0x2b')](function(_0x10408a){if(_0x40ab0c){_0x40ab0c(null,_0x10408a);}});}function setChannelVariables(_0x34c1fd){for(var _0x489962 in _0x34c1fd){if(_0x34c1fd['hasOwnProperty'](_0x489962)){if(_0x489962[_0x79b6('0x2d')](_0x79b6('0x2e'))===0x0){_0x34c1fd[_0x489962[_0x79b6('0x2f')](0x4)]=_0x34c1fd[_0x489962];delete _0x34c1fd[_0x489962];}}}}function getLogFromObject(_0x2022eb){return util[_0x79b6('0x30')](_0x2022eb,{'showHidden':![],'depth':null});}function agiHandler(_0x31ebd9){var _0x5f4b90,_0x4ac3b9,_0x3bf55d,_0x498e83,_0xe7a4d;logger['debug'](_0x79b6('0x31'),JSON[_0x79b6('0x32')](_0x31ebd9,null,0x2));logger['info'](util[_0x79b6('0x12')](_0x79b6('0x33'),_0x31ebd9['arg_1'],_0x31ebd9[_0x79b6('0x18')],_0x31ebd9['callerid'],_0x31ebd9[_0x79b6('0x1a')],_0x31ebd9[_0x79b6('0x1b')]));_0x31ebd9['on'](_0x79b6('0xd'),errorHandler);_0x31ebd9['on'](_0x79b6('0x34'),closeHandler);_0x31ebd9['on'](_0x79b6('0x35'),timeoutHandler);_0x31ebd9[_0x79b6('0x1e')]=![];_0x31ebd9['on'](_0x79b6('0x36'),hangupHandler);var _0x276eb5=getSquareProject[_0x79b6('0x37')](null,_0x31ebd9[_0x79b6('0x1d')]);if(_0x276eb5){if(_0x276eb5['production']){_0x5f4b90=getRoot(_0x276eb5['production']);if(_0x5f4b90&&_0x5f4b90['start']){logger[_0x79b6('0x38')](_0x79b6('0x20'),JSON['stringify'](_0x5f4b90,null,0x2));_0x31ebd9[_0x79b6('0x39')]=moment()['format'](_0x79b6('0x3a'));_0x4ac3b9=initGraph(_[_0x79b6('0x3b')](_0x5f4b90,_0x79b6('0x24')),_0x5f4b90['mxCell']);_0x3bf55d=new Vertices(_0x31ebd9,rpc,mailRpc);logger[_0x79b6('0x11')](util['format'](_0x79b6('0x3c'),_0x31ebd9[_0x79b6('0x1d')],_0x31ebd9[_0x79b6('0x18')],_0x31ebd9[_0x79b6('0x19')],_0x31ebd9[_0x79b6('0x1a')],_0x31ebd9['uniqueid']));_0x4ac3b9['traverseBFS'](_0x5f4b90[_0x79b6('0x3d')]['id'],function(_0x48ae49){try{_0x48ae49=_0x3bf55d[_0x79b6('0x3e')](_0x48ae49);logger[_0x79b6('0x38')](_0x79b6('0x3f'),JSON[_0x79b6('0x32')](_0x48ae49,null,0x2));if(_0x48ae49[_0x79b6('0x40')]===_0x79b6('0x41')){logger[_0x79b6('0x11')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x31ebd9[_0x79b6('0x42')]=_0x48ae49[_0x79b6('0x42')]||_0x31ebd9[_0x79b6('0x42')];_0x31ebd9[_0x79b6('0x43')]=_0x48ae49['extension'];_0x31ebd9[_0x79b6('0x44')]=_0x48ae49['priority']?_0x48ae49['priority']-0x1:0x1;return null;}else if(_0x48ae49&&_0x3bf55d[_0x48ae49[_0x79b6('0x40')]]){_0xe7a4d=_0x3bf55d[_0x48ae49[_0x79b6('0x40')]](_0x48ae49);logger[_0x79b6('0x11')](_0x79b6('0x45'),JSON[_0x79b6('0x32')](_0xe7a4d,null,0x2));if(_0xe7a4d&&_0xe7a4d[_0x79b6('0x46')]===AGI_CODE_SUCCESS&&_0xe7a4d[_0x79b6('0x47')]!==AGI_RESULT_ERROR&&!_0x31ebd9[_0x79b6('0x1e')]){logger['debug'](_0x79b6('0x45'),getLogFromObject(_0xe7a4d));return _['isUndefined'](_0xe7a4d['result'])?null:_0xe7a4d[_0x79b6('0x47')][_0x79b6('0x48')]();}else{logger[_0x79b6('0xd')](_0x79b6('0x45'),getLogFromObject(_0xe7a4d));return null;}}else{logger[_0x79b6('0xd')](_0x79b6('0x49'));return null;}}catch(_0x2b9b30){logger[_0x79b6('0xd')](_0x2b9b30[_0x79b6('0xe')]);return null;}});if(_0x5f4b90['finally']){logger[_0x79b6('0x11')](util[_0x79b6('0x12')](_0x79b6('0x4a'),_0x31ebd9[_0x79b6('0x1d')],_0x31ebd9[_0x79b6('0x18')],_0x31ebd9['callerid'],_0x31ebd9[_0x79b6('0x1a')],_0x31ebd9[_0x79b6('0x1b')]));_0x4ac3b9['traverseBFS'](_0x5f4b90['finally']['id'],function(_0xb9c74d){try{_0xb9c74d=_0x3bf55d[_0x79b6('0x3e')](_0xb9c74d);logger[_0x79b6('0x38')](_0x79b6('0x3f'),JSON[_0x79b6('0x32')](_0xb9c74d,null,0x2));if(_0xb9c74d&&_0x3bf55d[_0xb9c74d[_0x79b6('0x40')]]){_0xe7a4d=_0x3bf55d[_0xb9c74d[_0x79b6('0x40')]](_0xb9c74d);if(_0xe7a4d){logger[_0x79b6('0x38')](_0x79b6('0x45'),getLogFromObject(_0xe7a4d));return _[_0x79b6('0x4b')](_0xe7a4d[_0x79b6('0x47')])?null:_0xe7a4d[_0x79b6('0x47')][_0x79b6('0x48')]();}else{logger[_0x79b6('0xd')](_0x79b6('0x45'),getLogFromObject(_0xe7a4d));return null;}}else{logger[_0x79b6('0xd')](_0x79b6('0x49'));return null;}}catch(_0x14fa5c){logger[_0x79b6('0xd')](_0x14fa5c['stack']);return null;}});}logger['info'](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x31ebd9['arg_1'],_0x31ebd9[_0x79b6('0x18')],_0x31ebd9[_0x79b6('0x19')],_0x31ebd9[_0x79b6('0x1a')],_0x31ebd9[_0x79b6('0x1b')]));logger[_0x79b6('0x11')](util[_0x79b6('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x31ebd9[_0x79b6('0x42')],_0x31ebd9[_0x79b6('0x43')],parseInt(_0x31ebd9['priority'],0xa)+0x1));_0x31ebd9[_0x79b6('0x4c')](_0x31ebd9['context'],_0x31ebd9[_0x79b6('0x43')],parseInt(_0x31ebd9['priority'],0xa)+0x1);_0x31ebd9['close']();}}else{logger[_0x79b6('0xd')](util[_0x79b6('0x12')](_0x79b6('0x4d'),_0x31ebd9[_0x79b6('0x1d')]));_0x31ebd9[_0x79b6('0x4c')](_0x31ebd9[_0x79b6('0x42')],_0x31ebd9['extension'],parseInt(_0x31ebd9['priority'],0xa)+0x1);_0x31ebd9[_0x79b6('0x34')]();}}else{logger[_0x79b6('0xd')](util['format'](_0x79b6('0x4e'),_0x31ebd9[_0x79b6('0x1d')]));_0x31ebd9[_0x79b6('0x4c')](_0x31ebd9[_0x79b6('0x42')],_0x31ebd9[_0x79b6('0x43')],parseInt(_0x31ebd9[_0x79b6('0x44')],0xa)+0x1);_0x31ebd9[_0x79b6('0x34')]();}}function main(){var _0x479605;return utilLicense[_0x79b6('0x4f')]()[_0x79b6('0x2a')](function(_0x56385e){if(_0x56385e){if(_0x56385e[_0x79b6('0x50')]){if(_0x56385e['callysquare']&&_0x56385e[_0x79b6('0x51')]>0x0){logger['info'](util['format'](_0x79b6('0x52'),_0x56385e[_0x79b6('0x51')]));_0x479605=_0x56385e[_0x79b6('0x51')];}else{logger[_0x79b6('0x11')](_0x79b6('0x53'));}}else{logger[_0x79b6('0x11')](_0x79b6('0x54'));_0x479605=-0x1;}}})['catch'](function(_0x537a02){logger[_0x79b6('0xd')](_0x79b6('0x55'),_0x537a02[_0x79b6('0xe')]);})[_0x79b6('0x56')](function(){var _0x10b129=require(_0x79b6('0x57'))(config[_0x79b6('0x6')][_0x79b6('0x10')],config[_0x79b6('0x6')]['ip'],_0x479605);_0x10b129['on'](_0x79b6('0xd'),errorHandler);_0x10b129['on'](_0x79b6('0x58'),listeningHandler);_0x10b129['on'](_0x79b6('0x59'),connectionHandler);_0x10b129['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 8b76694..14361eb 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x387306,_0xb8e0a7){var _0x2773ef=function(_0x52389d){while(--_0x52389d){_0x387306['push'](_0x387306['shift']());}};_0x2773ef(++_0xb8e0a7);}(_0x814b,0x1a2));var _0xb814=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x814b[_0x49aa7d];return _0xdd0d26;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x3b5f35,_0x3b4ba7){var _0x4a0378=function(_0x49a480){while(--_0x49a480){_0x3b5f35['push'](_0x3b5f35['shift']());}};_0x4a0378(++_0x3b4ba7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 6c3c855..4205412 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x5b97f0,_0x2ef08c){var _0x2101a8=function(_0xc40452){while(--_0xc40452){_0x5b97f0['push'](_0x5b97f0['shift']());}};_0x2101a8(++_0x2ef08c);}(_0x7a54,0x106));var _0x47a5=function(_0x3e8543,_0x5f59ed){_0x3e8543=_0x3e8543-0x0;var _0x4ae9ba=_0x7a54[_0x3e8543];return _0x4ae9ba;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x553c28,_0x1aef30){var _0x45e7ff=function(_0x397d80){while(--_0x397d80){_0x553c28['push'](_0x553c28['shift']());}};_0x45e7ff(++_0x1aef30);}(_0x7a54,0x106));var _0x47a5=function(_0x56cded,_0x1a7281){_0x56cded=_0x56cded-0x0;var _0x12d9e9=_0x7a54[_0x56cded];return _0x12d9e9;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9abeaab..6842812 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 _0x969d=['getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','then','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','client','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getUserById','ShowUser'];(function(_0x36036b,_0x4a340e){var _0x53d323=function(_0x5e78ad){while(--_0x5e78ad){_0x36036b['push'](_0x36036b['shift']());}};_0x53d323(++_0x4a340e);}(_0x969d,0xf7));var _0xd969=function(_0x1daff3,_0x3288c7){_0x1daff3=_0x1daff3-0x0;var _0x310f88=_0x969d[_0x1daff3];return _0x310f88;};'use strict';var BPromise=require(_0xd969('0x0'));var moment=require(_0xd969('0x1'));var _=require(_0xd969('0x2'));var util=require(_0xd969('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xd969('0x4')]['http']({'port':0x2329});function request(_0x1f13c7,_0x5139f0){return new BPromise(function(_0x5443a2,_0x42f2d2){return client['request'](_0x1f13c7,_0x5139f0)['then'](function(_0x2e1b2a){if(_0x2e1b2a[_0xd969('0x5')]){return _0x42f2d2(_0x2e1b2a['error'][_0xd969('0x6')]);}else{return _0x5443a2(_0x2e1b2a[_0xd969('0x7')]);}})[_0xd969('0x8')](function(_0x31cdc9){return _0x42f2d2(_0x31cdc9);});});}exports[_0xd969('0x9')]=function(_0x10454a){return request(_0xd969('0xa'),{'options':{'raw':![],'where':{'name':_0x10454a},'attributes':[_0xd969('0xb')]}});};exports[_0xd969('0xc')]=function(_0x5ee5c0){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5ee5c0},'include':[{'model':_0xd969('0xd'),'as':_0xd969('0xe')}],'attributes':['id',_0xd969('0xf'),_0xd969('0x10')]}});};exports[_0xd969('0x11')]=function(_0x546917){return request('ShowSquareProject',{'options':{'where':{'id':_0x546917},'attributes':[_0xd969('0xf')]}});};exports['getVoiceQueueById']=function(_0x2c2eca){return request(_0xd969('0x12'),{'options':{'where':{'id':_0x2c2eca},'attributes':[_0xd969('0xf')]}});};exports[_0xd969('0x13')]=function(_0x4b1fe7){return request(_0xd969('0x14'),{'options':{'where':{'id':_0x4b1fe7},'attributes':[_0xd969('0xf')]}});};exports['getSquareOdbcById']=function(_0x2ad608){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2ad608},'attributes':['dsn']}});};exports[_0xd969('0x15')]=function(_0x4d1e63){return request(_0xd969('0x16'),{'options':{'where':{'id':_0x4d1e63},'attributes':[_0xd969('0xf')]}});};exports[_0xd969('0x17')]=function(_0x2ae511){return request(_0xd969('0x18'),{'options':{'where':{'id':_0x2ae511},'attributes':[_0xd969('0xf')]}});};exports[_0xd969('0x19')]=function(_0x2e5900){return request(_0xd969('0x1a'),{'options':{'where':{'id':_0x2e5900},'attributes':[_0xd969('0x1b')]}});};exports['getIntervalById']=function(_0x20484a){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x20484a},'include':[{'model':_0xd969('0x1c'),'as':_0xd969('0x1d')}]}});};exports['getSmsAccountById']=function(_0x56023d){return request(_0xd969('0x1e'),{'options':{'where':{'id':_0x56023d},'attributes':['id',_0xd969('0xf')]}});};exports[_0xd969('0x1f')]=function(_0x2fa3a5){return request('CreateSmsMessage',{'body':_0x2fa3a5});};exports[_0xd969('0x20')]=function(_0x5b87d6){return request(_0xd969('0x21'),{'body':_0x5b87d6});};exports[_0xd969('0x22')]=function(_0x18c71b){return request(_0xd969('0x23'),{'body':_[_0xd969('0x24')](_0x18c71b,{'project_name':_0x18c71b[_0xd969('0x25')],'prev_project_name':_0x18c71b[_0xd969('0x26')]||'','is_subproject':_0x18c71b[_0xd969('0x26')]?!![]:![],'leaveAt':moment()[_0xd969('0x27')](_0xd969('0x28'))})});};exports[_0xd969('0x29')]=function(_0x5141ac){return request(_0xd969('0x2a'),{'body':_0x5141ac});};exports[_0xd969('0x2b')]=function(_0xc0cda1){return request('CreateSquareMessage',{'body':_0xc0cda1});};exports[_0xd969('0x2c')]=function(_0x55e199){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x55e199['phone'],'ListId':_0x55e199[_0xd969('0x2d')]}}})[_0xd969('0x2e')](function(_0x4167b3){if(_0x4167b3){return _0x4167b3;}return request('CreateCmContact',{'body':_0x55e199});});};exports['getPauseById']=function(_0xaf09ef){return request(_0xd969('0x2f'),{'options':{'where':{'id':_0xaf09ef},'attributes':[_0xd969('0xf')]}});};exports[_0xd969('0x30')]=function(_0xa20a8f,_0x2535bb){return request('LoginUser',{'body':{'interface':_0x2535bb},'options':{'where':_0xa20a8f}});};exports[_0xd969('0x31')]=function(_0x4d4217,_0x637eee,_0x4af0d0){return request(_0xd969('0x32'),{'body':{'type':_0x637eee,'uniqueid':_0x4af0d0},'options':{'where':_0x4d4217}});};exports[_0xd969('0x33')]=function(_0xc1a381){return request(_0xd969('0x34'),{'body':{},'options':{'where':_0xc1a381}});};exports['agentLogout']=function(_0x33bfd7){return request(_0xd969('0x35'),{'body':{},'options':{'where':_0x33bfd7}});}; \ No newline at end of file +var _0x8b78=['agentLogout','LogoutUser','bluebird','lodash','jayson/promise','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','name','getSquareProjectById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','LoginUser','PauseUser','agentUnpause','UnpauseUser'];(function(_0x45a74b,_0x4c6a78){var _0x1942d3=function(_0x308acd){while(--_0x308acd){_0x45a74b['push'](_0x45a74b['shift']());}};_0x1942d3(++_0x4c6a78);}(_0x8b78,0xaa));var _0x88b7=function(_0x4816e0,_0x2cc44e){_0x4816e0=_0x4816e0-0x0;var _0xcfd71c=_0x8b78[_0x4816e0];return _0xcfd71c;};'use strict';var BPromise=require(_0x88b7('0x0'));var moment=require('moment');var _=require(_0x88b7('0x1'));var util=require('util');var jayson=require(_0x88b7('0x2'));var client=jayson[_0x88b7('0x3')][_0x88b7('0x4')]({'port':0x2329});function request(_0x18a1ea,_0x57eba5){return new BPromise(function(_0xd90314,_0x48495d){return client[_0x88b7('0x5')](_0x18a1ea,_0x57eba5)[_0x88b7('0x6')](function(_0x23ceac){if(_0x23ceac['error']){return _0x48495d(_0x23ceac[_0x88b7('0x7')][_0x88b7('0x8')]);}else{return _0xd90314(_0x23ceac[_0x88b7('0x9')]);}})['catch'](function(_0x3d72d2){return _0x48495d(_0x3d72d2);});});}exports[_0x88b7('0xa')]=function(_0x53ffc7){return request(_0x88b7('0xb'),{'options':{'raw':![],'where':{'name':_0x53ffc7},'attributes':[_0x88b7('0xc')]}});};exports[_0x88b7('0xd')]=function(_0x32223f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x32223f},'include':[{'model':_0x88b7('0xe'),'as':'Smtp'}],'attributes':['id',_0x88b7('0xf'),'email']}});};exports[_0x88b7('0x10')]=function(_0x39fd78){return request('ShowSquareProject',{'options':{'where':{'id':_0x39fd78},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x3c6994){return request(_0x88b7('0x11'),{'options':{'where':{'id':_0x3c6994},'attributes':['name']}});};exports[_0x88b7('0x12')]=function(_0x504ed5){return request('ShowVariable',{'options':{'where':{'id':_0x504ed5},'attributes':[_0x88b7('0xf')]}});};exports[_0x88b7('0x13')]=function(_0x506e17){return request(_0x88b7('0x14'),{'options':{'where':{'id':_0x506e17},'attributes':[_0x88b7('0x15')]}});};exports[_0x88b7('0x16')]=function(_0x44fde8){return request(_0x88b7('0x17'),{'options':{'where':{'id':_0x44fde8},'attributes':[_0x88b7('0xf')]}});};exports[_0x88b7('0x18')]=function(_0x42e80e){return request('ShowTrunk',{'options':{'where':{'id':_0x42e80e},'attributes':['name']}});};exports[_0x88b7('0x19')]=function(_0x6c96f2){return request(_0x88b7('0x1a'),{'options':{'where':{'id':_0x6c96f2},'attributes':[_0x88b7('0x1b')]}});};exports[_0x88b7('0x1c')]=function(_0x50596d){return request(_0x88b7('0x1d'),{'options':{'raw':![],'where':{'id':_0x50596d},'include':[{'model':_0x88b7('0x1e'),'as':_0x88b7('0x1f')}]}});};exports[_0x88b7('0x20')]=function(_0x480a23){return request(_0x88b7('0x21'),{'options':{'where':{'id':_0x480a23},'attributes':['id',_0x88b7('0xf')]}});};exports[_0x88b7('0x22')]=function(_0x19983e){return request(_0x88b7('0x23'),{'body':_0x19983e});};exports[_0x88b7('0x24')]=function(_0x5a6a1d){return request(_0x88b7('0x25'),{'body':_0x5a6a1d});};exports[_0x88b7('0x26')]=function(_0x4684d6){return request('CreateSquareReport',{'body':_[_0x88b7('0x27')](_0x4684d6,{'project_name':_0x4684d6['arg_1'],'prev_project_name':_0x4684d6[_0x88b7('0x28')]||'','is_subproject':_0x4684d6[_0x88b7('0x28')]?!![]:![],'leaveAt':moment()['format'](_0x88b7('0x29'))})});};exports[_0x88b7('0x2a')]=function(_0x5c3da8){return request(_0x88b7('0x2b'),{'body':_0x5c3da8});};exports[_0x88b7('0x2c')]=function(_0x1ddf06){return request('CreateSquareMessage',{'body':_0x1ddf06});};exports[_0x88b7('0x2d')]=function(_0x4ec661){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4ec661[_0x88b7('0x2e')],'ListId':_0x4ec661[_0x88b7('0x2f')]}}})['then'](function(_0x29f303){if(_0x29f303){return _0x29f303;}return request(_0x88b7('0x30'),{'body':_0x4ec661});});};exports['getPauseById']=function(_0x67c08){return request(_0x88b7('0x31'),{'options':{'where':{'id':_0x67c08},'attributes':[_0x88b7('0xf')]}});};exports['agentLogin']=function(_0x1da433,_0x5848e4){return request(_0x88b7('0x32'),{'body':{'interface':_0x5848e4},'options':{'where':_0x1da433}});};exports['agentPause']=function(_0x5eca29,_0x5d503b,_0x528b75){return request(_0x88b7('0x33'),{'body':{'type':_0x5d503b,'uniqueid':_0x528b75},'options':{'where':_0x5eca29}});};exports[_0x88b7('0x34')]=function(_0x5c1781){return request(_0x88b7('0x35'),{'body':{},'options':{'where':_0x5c1781}});};exports[_0x88b7('0x36')]=function(_0x48d2fa){return request(_0x88b7('0x37'),{'body':{},'options':{'where':_0x48d2fa}});}; \ 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 2b8d424..f755b04 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 _0xfa26=['./polly','./lex','exports'];(function(_0x2e7aae,_0x5090cb){var _0x512de0=function(_0x4f47bb){while(--_0x4f47bb){_0x2e7aae['push'](_0x2e7aae['shift']());}};_0x512de0(++_0x5090cb);}(_0xfa26,0x17a));var _0x6fa2=function(_0x570b5,_0x173329){_0x570b5=_0x570b5-0x0;var _0x15e771=_0xfa26[_0x570b5];return _0x15e771;};var polly=require(_0x6fa2('0x0'));var lex=require(_0x6fa2('0x1'));module[_0x6fa2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x27fb=['./lex'];(function(_0x440197,_0x45fcb5){var _0x3d99f2=function(_0x35d511){while(--_0x35d511){_0x440197['push'](_0x440197['shift']());}};_0x3d99f2(++_0x45fcb5);}(_0x27fb,0x8c));var _0xb27f=function(_0x3272a2,_0x44b4dc){_0x3272a2=_0x3272a2-0x0;var _0x2b390c=_0x27fb[_0x3272a2];return _0x2b390c;};var polly=require('./polly');var lex=require(_0xb27f('0x0'));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 c943612..d8393be 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 _0x049e=['./lib/api','exports'];(function(_0x460cd0,_0x557cbf){var _0x49a7c4=function(_0x54609f){while(--_0x54609f){_0x460cd0['push'](_0x460cd0['shift']());}};_0x49a7c4(++_0x557cbf);}(_0x049e,0x16a));var _0xe049=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x049e[_0x4b4b0e];return _0x4c2d91;};'use strict';var lex=require(_0xe049('0x0'));module[_0xe049('0x1')]=function(_0x5efb24,_0x30ed85,_0x47aa93,_0x155cb3,_0x13cc6a,_0xb492b8){return lex(_0x5efb24,_0x30ed85,_0x47aa93,_0x155cb3,_0x13cc6a,_0xb492b8);}; \ No newline at end of file +var _0x89e8=['./lib/api','exports'];(function(_0x5e42a4,_0x5cda7a){var _0xff49a8=function(_0x356dc1){while(--_0x356dc1){_0x5e42a4['push'](_0x5e42a4['shift']());}};_0xff49a8(++_0x5cda7a);}(_0x89e8,0x74));var _0x889e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x89e8[_0x397e5f];return _0x5302b8;};'use strict';var lex=require(_0x889e('0x0'));module[_0x889e('0x1')]=function(_0xfc1dd0,_0x319ddb,_0x35d770,_0x2a8b6d,_0xfe71bf,_0x935fd){return lex(_0xfc1dd0,_0x319ddb,_0x35d770,_0x2a8b6d,_0xfe71bf,_0x935fd);}; \ 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 0328c33..cd316b7 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 _0x3468=['slots','hasOwnProperty','slot_','exports','bluebird','aws-sdk','postText'];(function(_0x41f2f3,_0x4e87fa){var _0xb77414=function(_0x579c05){while(--_0x579c05){_0x41f2f3['push'](_0x41f2f3['shift']());}};_0xb77414(++_0x4e87fa);}(_0x3468,0x1c4));var _0x8346=function(_0x378527,_0xe25d1a){_0x378527=_0x378527-0x0;var _0x1eb1d6=_0x3468[_0x378527];return _0x1eb1d6;};'use strict';var BPromise=require(_0x8346('0x0'));var AWS=require(_0x8346('0x1'));function lexResult(_0x53849f,_0x532ad5){return new BPromise(function(_0x34133d,_0x7e5a28){_0x53849f[_0x8346('0x2')](_0x532ad5,function(_0x5abf3e,_0x2b4c03){if(_0x5abf3e){_0x7e5a28(_0x5abf3e);}if(_0x2b4c03[_0x8346('0x3')]){for(const _0x1a319f in _0x2b4c03[_0x8346('0x3')]){if(_0x2b4c03[_0x8346('0x3')][_0x8346('0x4')](_0x1a319f)){var _0x5719d6=_0x2b4c03[_0x8346('0x3')][_0x1a319f];_0x2b4c03[_0x8346('0x5')+_0x1a319f]=_0x5719d6;}}}_0x34133d(_0x2b4c03);});});}module[_0x8346('0x6')]=function(_0x172ef0,_0x1baf40,_0x344bdc,_0xdbdde8,_0x44b6bb,_0x1af1ab){var _0x382fd9=new AWS['LexRuntime']({'accessKeyId':_0x1baf40,'secretAccessKey':_0x344bdc,'region':_0xdbdde8});var _0xc31156={'botAlias':'$LATEST','botName':_0x1af1ab,'inputText':_0x44b6bb,'userId':_0x172ef0};return lexResult(_0x382fd9,_0xc31156);}; \ No newline at end of file +var _0x1116=['slot_','postText','slots'];(function(_0x426f9e,_0x379f39){var _0x30600d=function(_0x190800){while(--_0x190800){_0x426f9e['push'](_0x426f9e['shift']());}};_0x30600d(++_0x379f39);}(_0x1116,0xf7));var _0x6111=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x1116[_0x5c4f6b];return _0x104c4e;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x5b93d3,_0x124d8f){return new BPromise(function(_0x136320,_0x528fe3){_0x5b93d3[_0x6111('0x0')](_0x124d8f,function(_0x491a5a,_0x295d37){if(_0x491a5a){_0x528fe3(_0x491a5a);}if(_0x295d37[_0x6111('0x1')]){for(const _0x41d3ed in _0x295d37[_0x6111('0x1')]){if(_0x295d37[_0x6111('0x1')]['hasOwnProperty'](_0x41d3ed)){var _0x3e02df=_0x295d37[_0x6111('0x1')][_0x41d3ed];_0x295d37[_0x6111('0x2')+_0x41d3ed]=_0x3e02df;}}}_0x136320(_0x295d37);});});}module['exports']=function(_0x2cbf77,_0x1b397c,_0x166b10,_0x5380a7,_0x3f18b7,_0x10b574){var _0x1a2ae9=new AWS['LexRuntime']({'accessKeyId':_0x1b397c,'secretAccessKey':_0x166b10,'region':_0x5380a7});var _0x1c6406={'botAlias':'$LATEST','botName':_0x10b574,'inputText':_0x3f18b7,'userId':_0x2cbf77};return lexResult(_0x1a2ae9,_0x1c6406);}; \ 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 7240104..9f43a87 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 _0x3d10=['./lib/api'];(function(_0x3004a3,_0xffae32){var _0x14734d=function(_0xd35074){while(--_0xd35074){_0x3004a3['push'](_0x3004a3['shift']());}};_0x14734d(++_0xffae32);}(_0x3d10,0x7b));var _0x03d1=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x3d10[_0x3c2b2e];return _0x27a338;};'use strict';var polly=require(_0x03d1('0x0'));module['exports']=function(_0x178f39,_0x5b80a7,_0xbf33f7,_0x22962c,_0x49b0f9,_0x49f8ba,_0x2f60dd){return polly(_0x178f39,_0x5b80a7,_0xbf33f7,_0x22962c,_0x49b0f9,_0x49f8ba,_0x2f60dd);}; \ No newline at end of file +var _0x9877=['./lib/api'];(function(_0xa98a36,_0x496843){var _0x27ea9b=function(_0xe9bf98){while(--_0xe9bf98){_0xa98a36['push'](_0xa98a36['shift']());}};_0x27ea9b(++_0x496843);}(_0x9877,0x159));var _0x7987=function(_0x52d7b2,_0x2f06d5){_0x52d7b2=_0x52d7b2-0x0;var _0x1db21f=_0x9877[_0x52d7b2];return _0x1db21f;};'use strict';var polly=require(_0x7987('0x0'));module['exports']=function(_0x35b496,_0x17a72d,_0xf44998,_0x477c33,_0xa59c66,_0x135b8d,_0x1411a6){return polly(_0x35b496,_0x17a72d,_0xf44998,_0x477c33,_0xa59c66,_0x135b8d,_0x1411a6);}; \ 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 3565f94..43552cf 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 _0x89bc=['exports','Polly','text','mp3','path','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x29ab81,_0x1e54df){var _0x4146e1=function(_0x178445){while(--_0x178445){_0x29ab81['push'](_0x29ab81['shift']());}};_0x4146e1(++_0x1e54df);}(_0x89bc,0xb4));var _0xc89b=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x89bc[_0x8b8564];return _0x360c61;};'use strict';var fs=require('fs');var path=require(_0xc89b('0x0'));var BPromise=require('bluebird');var rs=require(_0xc89b('0x1'));var AWS=require(_0xc89b('0x2'));function pollyResult(_0x201fb8,_0x580c8e,_0x30d037){return new BPromise(function(_0x3bfe52,_0x1bae78){_0x201fb8['synthesizeSpeech'](_0x580c8e,function(_0x282997,_0x32e3bd){if(_0x282997){_0x1bae78(_0x282997);}else if(_0x32e3bd){if(_0x32e3bd[_0xc89b('0x3')]instanceof Buffer){fs[_0xc89b('0x4')](_0x30d037,_0x32e3bd[_0xc89b('0x3')],function(_0x5beaea){if(_0x5beaea){_0x1bae78(_0x5beaea);}else{_0x3bfe52();}});}else{_0x1bae78(new Error(_0xc89b('0x5')));}}else{_0x1bae78(new Error(_0xc89b('0x6')));}});});}module[_0xc89b('0x7')]=function(_0x1ff28e,_0x2dd86d,_0x40f9ea,_0x3d263d,_0x2e58c6,_0x584008,_0x39aaa9){var _0x29e7ae=new AWS[(_0xc89b('0x8'))]({'accessKeyId':_0x1ff28e,'secretAccessKey':_0x2dd86d,'region':_0x40f9ea});var _0x17e4a0={'Text':_0x2e58c6,'TextType':_0x584008||_0xc89b('0x9'),'OutputFormat':_0xc89b('0xa'),'VoiceId':_0x3d263d};return pollyResult(_0x29e7ae,_0x17e4a0,_0x39aaa9);}; \ No newline at end of file +var _0xce33=['Polly','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x92223f,_0x72c53b){var _0x4d72b2=function(_0x35ae0c){while(--_0x35ae0c){_0x92223f['push'](_0x92223f['shift']());}};_0x4d72b2(++_0x72c53b);}(_0xce33,0xea));var _0x3ce3=function(_0x1f4c0b,_0x28f740){_0x1f4c0b=_0x1f4c0b-0x0;var _0xa2eddb=_0xce33[_0x1f4c0b];return _0xa2eddb;};'use strict';var fs=require('fs');var path=require(_0x3ce3('0x0'));var BPromise=require(_0x3ce3('0x1'));var rs=require(_0x3ce3('0x2'));var AWS=require(_0x3ce3('0x3'));function pollyResult(_0x2ca9e3,_0x5e6108,_0xa719c6){return new BPromise(function(_0x3fa0bd,_0x47e5f7){_0x2ca9e3['synthesizeSpeech'](_0x5e6108,function(_0x1dff5d,_0x4f6865){if(_0x1dff5d){_0x47e5f7(_0x1dff5d);}else if(_0x4f6865){if(_0x4f6865[_0x3ce3('0x4')]instanceof Buffer){fs[_0x3ce3('0x5')](_0xa719c6,_0x4f6865[_0x3ce3('0x4')],function(_0xd8a4e0){if(_0xd8a4e0){_0x47e5f7(_0xd8a4e0);}else{_0x3fa0bd();}});}else{_0x47e5f7(new Error(_0x3ce3('0x6')));}}else{_0x47e5f7(new Error(_0x3ce3('0x7')));}});});}module['exports']=function(_0x8cdaa6,_0x4bf44d,_0x5f8ab9,_0x4813b2,_0x5b546e,_0x1e86d4,_0x7db853){var _0x5aca29=new AWS[(_0x3ce3('0x8'))]({'accessKeyId':_0x8cdaa6,'secretAccessKey':_0x4bf44d,'region':_0x5f8ab9});var _0x55edbb={'Text':_0x5b546e,'TextType':_0x1e86d4||_0x3ce3('0x9'),'OutputFormat':_0x3ce3('0xa'),'VoiceId':_0x4813b2};return pollyResult(_0x5aca29,_0x55edbb,_0x7db853);}; \ 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 52031a6..367bf60 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 _0x51c5=['exports','./lib/api'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x51c5,0x8f));var _0x551c=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x51c5[_0xef8146];return _0x5a6cb0;};'use strict';var asr=require(_0x551c('0x0'));module[_0x551c('0x1')]=function(_0x3bdc26,_0x2d6573,_0x3b6f53,_0x2279a3){return asr(_0x3bdc26,_0x2d6573,_0x3b6f53);}; \ No newline at end of file +var _0xaebe=['exports','./lib/api'];(function(_0x1ca66a,_0x5d8c5b){var _0xb50e36=function(_0xe99ba0){while(--_0xe99ba0){_0x1ca66a['push'](_0x1ca66a['shift']());}};_0xb50e36(++_0x5d8c5b);}(_0xaebe,0xed));var _0xeaeb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaebe[_0x2641f9];return _0x585741;};'use strict';var asr=require(_0xeaeb('0x0'));module[_0xeaeb('0x1')]=function(_0x306feb,_0x4b8a64,_0x5df6de,_0x27ddc8){return asr(_0x306feb,_0x4b8a64,_0x5df6de);}; \ 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 56fba0d..44bc68a 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 _0x5715=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x5715,0x1b2));var _0x5571=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0x5715[_0xc69f39];return _0x93be41;};'use strict';var url=require(_0x5571('0x0'));var BPromise=require(_0x5571('0x1'));var fs=require('fs');var host=_0x5571('0x2');module['exports']=function(_0x2dafa9,_0x581f3f,_0x3ba543){return new BPromise(function(_0x37585d,_0x2e3e22){var _0x2818a4;if(typeof _0x2dafa9!==_0x5571('0x3')||_0x2dafa9['length']===0x0){return _0x2e3e22('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x581f3f!==_0x5571('0x3')||_0x581f3f[_0x5571('0x4')]===0x0){return _0x2e3e22(_0x5571('0x5'));}if(typeof _0x3ba543!==_0x5571('0x6')&&(typeof _0x3ba543!=='string'||_0x3ba543[_0x5571('0x4')]===0x0)){return _0x2e3e22('lang\x20should\x20be\x20a\x20string');}try{_0x2818a4=fs[_0x5571('0x7')](_0x2dafa9)[_0x5571('0x8')](_0x5571('0x9'));}catch(_0x16712e){return _0x2e3e22(_0x16712e);}return _0x37585d({'method':_0x5571('0xa'),'uri':host+_0x5571('0xb')+_0x581f3f,'body':{'config':{'encoding':_0x5571('0xc'),'sampleRateHertz':'8000','languageCode':_0x3ba543},'audio':{'content':_0x2818a4}},'json':!![]});});}; \ No newline at end of file +var _0xca83=['/v1/speech:recognize?key=','LINEAR16','8000','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x26d616,_0x25cb01){var _0xedbee=function(_0x37c872){while(--_0x37c872){_0x26d616['push'](_0x26d616['shift']());}};_0xedbee(++_0x25cb01);}(_0xca83,0x1bd));var _0x3ca8=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xca83[_0x1928c9];return _0x51b5fb;};'use strict';var url=require('url');var BPromise=require(_0x3ca8('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x3ca8('0x1')]=function(_0x4ea00e,_0x185103,_0x45ab08){return new BPromise(function(_0x5d1d9d,_0x4a04e9){var _0x1fd4ed;if(typeof _0x4ea00e!=='string'||_0x4ea00e[_0x3ca8('0x2')]===0x0){return _0x4a04e9(_0x3ca8('0x3'));}if(typeof _0x185103!=='string'||_0x185103[_0x3ca8('0x2')]===0x0){return _0x4a04e9(_0x3ca8('0x4'));}if(typeof _0x45ab08!==_0x3ca8('0x5')&&(typeof _0x45ab08!=='string'||_0x45ab08[_0x3ca8('0x2')]===0x0)){return _0x4a04e9(_0x3ca8('0x6'));}try{_0x1fd4ed=fs[_0x3ca8('0x7')](_0x4ea00e)[_0x3ca8('0x8')](_0x3ca8('0x9'));}catch(_0x3d848a){return _0x4a04e9(_0x3d848a);}return _0x5d1d9d({'method':'POST','uri':host+_0x3ca8('0xa')+_0x185103,'body':{'config':{'encoding':_0x3ca8('0xb'),'sampleRateHertz':_0x3ca8('0xc'),'languageCode':_0x45ab08},'audio':{'content':_0x1fd4ed}},'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 56f03a1..10cb4be 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 _0x70e0=['exports','./asr'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x70e0,0x17b));var _0x070e=function(_0x47c84e,_0xdca33a){_0x47c84e=_0x47c84e-0x0;var _0xd5d9e9=_0x70e0[_0x47c84e];return _0xd5d9e9;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 6f7cdcb..f04288f 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0xb10b,0x12a));var _0xbb10=function(_0xec919c,_0x45c528){_0xec919c=_0xec919c-0x0;var _0x516869=_0xb10b[_0xec919c];return _0x516869;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x565c99,_0x4dc5d2){var _0x119bcf=function(_0x2fe0cc){while(--_0x2fe0cc){_0x565c99['push'](_0x565c99['shift']());}};_0x119bcf(++_0x4dc5d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 92ceabd..bea93f5 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 _0x044f=['./nda','exports'];(function(_0x23e5ce,_0x57584d){var _0x2ce19b=function(_0x318e1f){while(--_0x318e1f){_0x23e5ce['push'](_0x23e5ce['shift']());}};_0x2ce19b(++_0x57584d);}(_0x044f,0x9c));var _0xf044=function(_0x2300fa,_0x41c382){_0x2300fa=_0x2300fa-0x0;var _0x11fef0=_0x044f[_0x2300fa];return _0x11fef0;};var nda=require(_0xf044('0x0'));module[_0xf044('0x1')]={'nda':nda}; \ No newline at end of file +var _0x1030=['./nda','exports'];(function(_0x1a8264,_0x3e3821){var _0x35df9f=function(_0x243334){while(--_0x243334){_0x1a8264['push'](_0x1a8264['shift']());}};_0x35df9f(++_0x3e3821);}(_0x1030,0x116));var _0x0103=function(_0x45435f,_0xd323c8){_0x45435f=_0x45435f-0x0;var _0x3cf194=_0x1030[_0x45435f];return _0x3cf194;};var nda=require(_0x0103('0x0'));module[_0x0103('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 290102b..1291181 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 _0xd981=['uniqueid','callerid','calleridname','dnid','text','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xd981,0x15a));var _0x1d98=function(_0x3e58a0,_0x554642){_0x3e58a0=_0x3e58a0-0x0;var _0x400909=_0xd981[_0x3e58a0];return _0x400909;};'use strict';var rp=require(_0x1d98('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x1d98('0x1'));module[_0x1d98('0x2')]=function(_0x495121,_0x32cfd4){var _0x42da4d={'method':_0x1d98('0x3'),'uri':url[_0x1d98('0x4')](_0x32cfd4[_0x1d98('0x5')],_0x1d98('0x6')),'form':{'grant_type':_0x1d98('0x7'),'username':_0x32cfd4[_0x1d98('0x8')],'password':_0x32cfd4[_0x1d98('0x7')]},'json':!![]};return rp(_0x42da4d)[_0x1d98('0x9')](function(_0x590b16){var _0x170e92={'method':_0x1d98('0x3'),'uri':url[_0x1d98('0x4')](_0x32cfd4[_0x1d98('0xa')],_0x1d98('0xb')),'body':{'type':_0x32cfd4['ndaactivity_type']||_0x1d98('0xc'),'channelId':_0x1d98('0xd'),'conversation':{'id':_0x495121[_0x1d98('0xe')]},'from':{'id':_0x495121[_0x1d98('0xf')],'name':_0x495121[_0x1d98('0x10')]},'recipient':{'id':_0x495121[_0x1d98('0x11')],'name':_0x495121['extension']},'text':_0x32cfd4[_0x1d98('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x590b16[_0x1d98('0x13')]},'json':!![]};if(_0x32cfd4['project']){_0x170e92[_0x1d98('0x14')][_0x1d98('0x15')]['ProjectName']=_0x32cfd4[_0x1d98('0x16')];}if(_0x32cfd4[_0x1d98('0x17')]=='1'){_0x170e92[_0x1d98('0x14')]['channelData'][_0x1d98('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x32cfd4[_0x1d98('0x19')]){_0x170e92[_0x1d98('0x14')][_0x1d98('0x15')][_0x1d98('0x1a')]=_0x32cfd4[_0x1d98('0x19')];if(_0x32cfd4[_0x1d98('0x1b')]){_0x170e92[_0x1d98('0x14')][_0x1d98('0x15')][_0x1d98('0x1c')]=_0x32cfd4[_0x1d98('0x1b')];}}logger[_0x1d98('0x1d')](JSON['stringify'](_0x170e92));return rp(_0x170e92);});}; \ No newline at end of file +var _0x5194=['channelData','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','Bearer\x20','access_token','project','body'];(function(_0x28ca08,_0x7ad7c3){var _0x3eb383=function(_0x443c8e){while(--_0x443c8e){_0x28ca08['push'](_0x28ca08['shift']());}};_0x3eb383(++_0x7ad7c3);}(_0x5194,0x173));var _0x4519=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5194[_0x16b9ed];return _0x66b1f8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x4519('0x0'))(_0x4519('0x1'));module[_0x4519('0x2')]=function(_0x4046a5,_0x2690a8){var _0x126b16={'method':_0x4519('0x3'),'uri':url[_0x4519('0x4')](_0x2690a8[_0x4519('0x5')],'/token'),'form':{'grant_type':_0x4519('0x6'),'username':_0x2690a8[_0x4519('0x7')],'password':_0x2690a8[_0x4519('0x6')]},'json':!![]};return rp(_0x126b16)[_0x4519('0x8')](function(_0x4e4537){var _0x554121={'method':'POST','uri':url[_0x4519('0x4')](_0x2690a8[_0x4519('0x9')],_0x4519('0xa')),'body':{'type':_0x2690a8['ndaactivity_type']||_0x4519('0xb'),'channelId':_0x4519('0xc'),'conversation':{'id':_0x4046a5[_0x4519('0xd')]},'from':{'id':_0x4046a5['callerid'],'name':_0x4046a5[_0x4519('0xe')]},'recipient':{'id':_0x4046a5['dnid'],'name':_0x4046a5['extension']},'text':_0x2690a8['text'],'channelData':{}},'headers':{'Authorization':_0x4519('0xf')+_0x4e4537[_0x4519('0x10')]},'json':!![]};if(_0x2690a8[_0x4519('0x11')]){_0x554121[_0x4519('0x12')][_0x4519('0x13')]['ProjectName']=_0x2690a8['project'];}if(_0x2690a8[_0x4519('0x14')]=='1'){_0x554121[_0x4519('0x12')][_0x4519('0x13')][_0x4519('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2690a8[_0x4519('0x16')]){_0x554121['body'][_0x4519('0x13')][_0x4519('0x17')]=_0x2690a8['custom_action'];if(_0x2690a8[_0x4519('0x18')]){_0x554121[_0x4519('0x12')][_0x4519('0x13')]['CustomActionData']=_0x2690a8[_0x4519('0x18')];}}logger['info'](JSON[_0x4519('0x19')](_0x554121));return rp(_0x554121);});}; \ 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 05ef2f5..ab43fd3 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 _0xfdd5=['./lib/api'];(function(_0x190e26,_0x41a027){var _0xacbb69=function(_0x3376a9){while(--_0x3376a9){_0x190e26['push'](_0x190e26['shift']());}};_0xacbb69(++_0x41a027);}(_0xfdd5,0x14a));var _0x5fdd=function(_0x475da1,_0x30ceef){_0x475da1=_0x475da1-0x0;var _0x5c8772=_0xfdd5[_0x475da1];return _0x5c8772;};'use strict';var asr=require(_0x5fdd('0x0'));module['exports']=function(_0xf02fc,_0x2b8de8,_0x1c288f,_0x965ee4){return asr(_0xf02fc,_0x2b8de8,_0x1c288f,_0x965ee4);}; \ No newline at end of file +var _0xf908=['exports','./lib/api'];(function(_0x5ca7b8,_0x1d8f03){var _0x58e84e=function(_0x2f0ffa){while(--_0x2f0ffa){_0x5ca7b8['push'](_0x5ca7b8['shift']());}};_0x58e84e(++_0x1d8f03);}(_0xf908,0xb9));var _0x8f90=function(_0x7f106,_0x4cc73b){_0x7f106=_0x7f106-0x0;var _0x34b5af=_0xf908[_0x7f106];return _0x34b5af;};'use strict';var asr=require(_0x8f90('0x0'));module[_0x8f90('0x1')]=function(_0x8ca5f6,_0x2e0c50,_0x101a49,_0x3bd2b6){return asr(_0x8ca5f6,_0x2e0c50,_0x101a49,_0x3bd2b6);}; \ 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 8dddf20..721159a 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 _0xbf0c=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','unix','send','stringify','createReadStream','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.'];(function(_0x45f246,_0x32f963){var _0x569fb2=function(_0x19f346){while(--_0x19f346){_0x45f246['push'](_0x45f246['shift']());}};_0x569fb2(++_0x32f963);}(_0xbf0c,0x14c));var _0xcbf0=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xbf0c[_0x33bc64];return _0x3fdd34;};'use strict';var BPromise=require(_0xcbf0('0x0'));var _=require(_0xcbf0('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcbf0('0x2'));var crypto=require('crypto');var logger=require(_0xcbf0('0x3'))(_0xcbf0('0x4'));module[_0xcbf0('0x5')]=function(_0x3c2372,_0x50a7a4,_0x540d9c,_0xf90651){return new BPromise(function(_0x1c746b,_0x520e41){logger[_0xcbf0('0x6')]('Tilde\x20URI',_0xf90651||_0xcbf0('0x7'));var _0x477269=new WebSocket(_0xf90651||_0xcbf0('0x7'),{'perMessageDeflate':![]});var _0x4edbcf='';var _0x4b6361='0';var _0x3bfe33='1';var _0x828e37='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xcc56f9(_0x225892){var _0x222483=crypto[_0xcbf0('0x8')](_0xcbf0('0x9'));_0x222483[_0xcbf0('0xa')](_0x225892);return _0x222483['digest'](_0xcbf0('0xb'));}function _0x539687(){try{logger[_0xcbf0('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x405d80=moment()[_0xcbf0('0xc')]();var _0x13e5e8=_0xcc56f9(_0x405d80+_0x50a7a4+_0x540d9c);_0x477269[_0xcbf0('0xd')](JSON[_0xcbf0('0xe')]({'appID':_0x50a7a4,'timestamp':_0x405d80,'appKey':_0x13e5e8}));var _0x50f98d=fs[_0xcbf0('0xf')](_0x3c2372);_0x50f98d['on']('data',function(_0x37bc99){_0x477269['send'](_0x37bc99);});_0x50f98d['on']('close',function(){_0x477269['send'](_0xcbf0('0x10'));});}catch(_0x3ee841){logger['error'](_0xcbf0('0x11'),JSON['stringify'](_0x3ee841));_0x477269[_0xcbf0('0x12')]();}}function _0x50d5ee(_0x442096){try{if(_0x442096){var _0x262955=JSON[_0xcbf0('0x13')](_0x442096);switch(_0x262955[_0xcbf0('0x14')]){case 0x0:if(_0x262955[_0xcbf0('0x15')]){if(_0x262955[_0xcbf0('0x15')][_0xcbf0('0x16')]){logger[_0xcbf0('0x6')](_0xcbf0('0x17'),JSON['stringify'](_0x262955['result'][_0xcbf0('0x18')]));_0x4edbcf=_0x262955[_0xcbf0('0x15')][_0xcbf0('0x18')][0x0][_0xcbf0('0x19')];_0x4b6361=_0x262955[_0xcbf0('0x15')]['hypotheses'][0x0][_0xcbf0('0x1a')];_0x3bfe33='0';_0x828e37=_0xcbf0('0x1b');_0x477269['terminate']();}}break;case 0x1:logger['info'](_0xcbf0('0x1c'));_0x3bfe33='1';_0x828e37=_0xcbf0('0x1c');break;case 0x2:logger[_0xcbf0('0x6')](_0xcbf0('0x1d'));_0x3bfe33='2';_0x828e37=_0xcbf0('0x1d');break;case 0x9:logger[_0xcbf0('0x6')](_0xcbf0('0x1e'));_0x3bfe33='9';_0x828e37='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xcbf0('0x6')](_0xcbf0('0x1f'));_0x3bfe33='10';_0x828e37=_0xcbf0('0x1f');break;case 0xb:logger['info'](_0xcbf0('0x20'));_0x3bfe33='11';_0x828e37=_0xcbf0('0x20');}}}catch(_0x2792e8){logger[_0xcbf0('0x21')](_0xcbf0('0x22'),JSON[_0xcbf0('0xe')](_0x2792e8));_0x477269[_0xcbf0('0x12')]();}}function _0x34941f(){logger[_0xcbf0('0x6')](_0xcbf0('0x23'));_0x1c746b({'transcript':_0x4edbcf,'confidence':_0x4b6361,'status':_0x3bfe33,'status_message':_0x828e37});}function _0x54ac92(_0x37a418){logger['error'](_0xcbf0('0x24'));if(!_['isNil'](_0x37a418)){logger[_0xcbf0('0x21')](_[_0xcbf0('0x25')](_0x37a418)?JSON[_0xcbf0('0xe')](_0x37a418):_0x37a418);}}_0x477269['on'](_0xcbf0('0x26'),_0x539687);_0x477269['on'](_0xcbf0('0x27'),_0x50d5ee);_0x477269['on']('close',_0x34941f);_0x477269['on'](_0xcbf0('0x21'),_0x54ac92);});}; \ No newline at end of file +var _0xd65a=['agi','exports','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','info','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.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','moment','crypto','../../../../../../config/logger'];(function(_0x253261,_0x4ebf8a){var _0x536e1f=function(_0x559cc9){while(--_0x559cc9){_0x253261['push'](_0x253261['shift']());}};_0x536e1f(++_0x4ebf8a);}(_0xd65a,0x1f4));var _0xad65=function(_0x1bfa31,_0x131b5b){_0x1bfa31=_0x1bfa31-0x0;var _0x32f67c=_0xd65a[_0x1bfa31];return _0x32f67c;};'use strict';var BPromise=require('bluebird');var _=require(_0xad65('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xad65('0x1'));var crypto=require(_0xad65('0x2'));var logger=require(_0xad65('0x3'))(_0xad65('0x4'));module[_0xad65('0x5')]=function(_0x2451f5,_0x205417,_0x69823,_0x311c5f){return new BPromise(function(_0x53c94b,_0x266d13){logger['info'](_0xad65('0x6'),_0x311c5f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x7779b8=new WebSocket(_0x311c5f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x300e28='';var _0xa36cfd='0';var _0x2d0996='1';var _0x63a6f1=_0xad65('0x7');function _0x37c9e7(_0x5b1166){var _0x291034=crypto[_0xad65('0x8')](_0xad65('0x9'));_0x291034[_0xad65('0xa')](_0x5b1166);return _0x291034[_0xad65('0xb')](_0xad65('0xc'));}function _0x360599(){try{logger['info'](_0xad65('0xd'));var _0x5bc3ad=moment()[_0xad65('0xe')]();var _0x197c17=_0x37c9e7(_0x5bc3ad+_0x205417+_0x69823);_0x7779b8[_0xad65('0xf')](JSON[_0xad65('0x10')]({'appID':_0x205417,'timestamp':_0x5bc3ad,'appKey':_0x197c17}));var _0x30ab0d=fs[_0xad65('0x11')](_0x2451f5);_0x30ab0d['on'](_0xad65('0x12'),function(_0x196ae8){_0x7779b8[_0xad65('0xf')](_0x196ae8);});_0x30ab0d['on'](_0xad65('0x13'),function(){_0x7779b8[_0xad65('0xf')]('EOS');});}catch(_0x37f40f){logger[_0xad65('0x14')](_0xad65('0x15'),JSON['stringify'](_0x37f40f));_0x7779b8[_0xad65('0x16')]();}}function _0x117341(_0x3c316a){try{if(_0x3c316a){var _0x1a7f0a=JSON[_0xad65('0x17')](_0x3c316a);switch(_0x1a7f0a['status']){case 0x0:if(_0x1a7f0a[_0xad65('0x18')]){if(_0x1a7f0a['result'][_0xad65('0x19')]){logger[_0xad65('0x1a')](_0xad65('0x1b'),JSON[_0xad65('0x10')](_0x1a7f0a[_0xad65('0x18')][_0xad65('0x1c')]));_0x300e28=_0x1a7f0a['result'][_0xad65('0x1c')][0x0][_0xad65('0x1d')];_0xa36cfd=_0x1a7f0a[_0xad65('0x18')][_0xad65('0x1c')][0x0][_0xad65('0x1e')];_0x2d0996='0';_0x63a6f1=_0xad65('0x1f');_0x7779b8['terminate']();}}break;case 0x1:logger[_0xad65('0x1a')](_0xad65('0x7'));_0x2d0996='1';_0x63a6f1='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xad65('0x1a')](_0xad65('0x20'));_0x2d0996='2';_0x63a6f1=_0xad65('0x20');break;case 0x9:logger[_0xad65('0x1a')](_0xad65('0x21'));_0x2d0996='9';_0x63a6f1=_0xad65('0x21');break;case 0xa:logger[_0xad65('0x1a')](_0xad65('0x22'));_0x2d0996='10';_0x63a6f1=_0xad65('0x22');break;case 0xb:logger[_0xad65('0x1a')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2d0996='11';_0x63a6f1=_0xad65('0x23');}}}catch(_0xc6f619){logger['error'](_0xad65('0x24'),JSON[_0xad65('0x10')](_0xc6f619));_0x7779b8['terminate']();}}function _0x401829(){logger['info'](_0xad65('0x25'));_0x53c94b({'transcript':_0x300e28,'confidence':_0xa36cfd,'status':_0x2d0996,'status_message':_0x63a6f1});}function _0x37f406(_0x1a0d3b){logger[_0xad65('0x14')](_0xad65('0x26'));if(!_[_0xad65('0x27')](_0x1a0d3b)){logger[_0xad65('0x14')](_[_0xad65('0x28')](_0x1a0d3b)?JSON[_0xad65('0x10')](_0x1a0d3b):_0x1a0d3b);}}_0x7779b8['on'](_0xad65('0x29'),_0x360599);_0x7779b8['on']('message',_0x117341);_0x7779b8['on'](_0xad65('0x13'),_0x401829);_0x7779b8['on'](_0xad65('0x14'),_0x37f406);});}; \ 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 de94133..840d5f1 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 _0xedd9=['exports'];(function(_0x355e70,_0x43cb1c){var _0x1f9122=function(_0x4823a3){while(--_0x4823a3){_0x355e70['push'](_0x355e70['shift']());}};_0x1f9122(++_0x43cb1c);}(_0xedd9,0xfc));var _0x9edd=function(_0xd513cb,_0x5d8397){_0xd513cb=_0xd513cb-0x0;var _0x3f2b4c=_0xedd9[_0xd513cb];return _0x3f2b4c;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x4083a7,_0x31f0be){var _0x545f18=function(_0x3816ba){while(--_0x3816ba){_0x4083a7['push'](_0x4083a7['shift']());}};_0x545f18(++_0x31f0be);}(_0x008c,0x188));var _0xc008=function(_0x391507,_0x564142){_0x391507=_0x391507-0x0;var _0x47fdc4=_0x008c[_0x391507];return _0x47fdc4;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 13ed582..61efbbf 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 _0x5923=['emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','E_AGI_SERVER_CLOSE','inherits','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','listen','listening'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5923,0x1d7));var _0x3592=function(_0x3288ef,_0x5a9865){_0x3288ef=_0x3288ef-0x0;var _0x4e99c3=_0x5923[_0x3288ef];return _0x4e99c3;};'use strict';var util=require(_0x3592('0x0'));var net=require(_0x3592('0x1'));var EventEmitter=require(_0x3592('0x2'))[_0x3592('0x3')];var AGIError=require(_0x3592('0x4'));var AGIChannel=require(_0x3592('0x5'));var AGIServer=function(_0x1df6ba,_0x7e98a3,_0x49c5f8){var _0x177c1a=this,_0x1df6ba=_0x1df6ba||0x11dd,_0x7e98a3=_0x7e98a3||_0x3592('0x6'),_0x358f5f=null,_0x5bde58=0x0;EventEmitter[_0x3592('0x7')](_0x177c1a);function _0x4d2902(){if(!_0x1df6ba){_0x177c1a['emit'](_0x3592('0x8'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x358f5f=net[_0x3592('0x9')]();_0x358f5f[_0x3592('0xa')](_0x1df6ba,_0x7e98a3);_0x358f5f['on'](_0x3592('0xb'),function(){_0x177c1a[_0x3592('0xc')](_0x3592('0xb'));});_0x358f5f['on'](_0x3592('0xd'),function(_0x3387f9){_0x358f5f[_0x3592('0xe')](function(_0x237903,_0xbc1dd4){if(_0x237903){_0x177c1a['emit']('error',new AGIError(_0x3592('0xf'),_0x237903));}else if(_0x49c5f8&&_0x49c5f8<0x0){_0x177c1a[_0x3592('0xc')](_0x3592('0x8'),new AGIError(_0x3592('0x10')));_0x3387f9['destroy']();}else if(_0x49c5f8&&_0x49c5f8>0x0&&_0x49c5f8<_0xbc1dd4){_0x5bde58+=0x1;_0x177c1a[_0x3592('0xc')](_0x3592('0x8'),new AGIError(_0x3592('0x11'),_0x5bde58));_0x3387f9[_0x3592('0x12')]();}else{var _0xed635e=new AGIChannel(_0x3387f9);_0xed635e['on'](_0x3592('0x13'),function(){_0x177c1a['emit'](_0x3592('0xd'),_0xed635e);});}});});_0x358f5f['on'](_0x3592('0x8'),function(_0x1921be){_0x177c1a[_0x3592('0xc')]('error',new AGIError(_0x3592('0xf'),_0x1921be[_0x3592('0x14')]));});_0x358f5f['on']('close',function(){_0x177c1a['emit']('close',new AGIError(_0x3592('0x15')));});}process['nextTick'](function(){_0x4d2902();});};util[_0x3592('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x16c89b,_0x3fa4df,_0x4653cf){return new AGIServer(_0x16c89b,_0x3fa4df,_0x4653cf);}; \ No newline at end of file +var _0xbb18=['inherits','util','net','events','EventEmitter','./error','./channel','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x1a5946,_0x426991){var _0x25e9d5=function(_0x44e1ce){while(--_0x44e1ce){_0x1a5946['push'](_0x1a5946['shift']());}};_0x25e9d5(++_0x426991);}(_0xbb18,0xb1));var _0x8bb1=function(_0x52d74f,_0x4b101e){_0x52d74f=_0x52d74f-0x0;var _0x5a59f3=_0xbb18[_0x52d74f];return _0x5a59f3;};'use strict';var util=require(_0x8bb1('0x0'));var net=require(_0x8bb1('0x1'));var EventEmitter=require(_0x8bb1('0x2'))[_0x8bb1('0x3')];var AGIError=require(_0x8bb1('0x4'));var AGIChannel=require(_0x8bb1('0x5'));var AGIServer=function(_0x20d182,_0x53ed91,_0x3c5511){var _0x1a0141=this,_0x20d182=_0x20d182||0x11dd,_0x53ed91=_0x53ed91||'127.0.0.1',_0x2cf483=null,_0x285512=0x0;EventEmitter[_0x8bb1('0x6')](_0x1a0141);function _0x3a0219(){if(!_0x20d182){_0x1a0141['emit'](_0x8bb1('0x7'),new AGIError(_0x8bb1('0x8')));return![];}_0x2cf483=net['createServer']();_0x2cf483[_0x8bb1('0x9')](_0x20d182,_0x53ed91);_0x2cf483['on'](_0x8bb1('0xa'),function(){_0x1a0141[_0x8bb1('0xb')](_0x8bb1('0xa'));});_0x2cf483['on'](_0x8bb1('0xc'),function(_0xb2f808){_0x2cf483[_0x8bb1('0xd')](function(_0x570989,_0x5d3498){if(_0x570989){_0x1a0141['emit'](_0x8bb1('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x570989));}else if(_0x3c5511&&_0x3c5511<0x0){_0x1a0141[_0x8bb1('0xb')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xb2f808[_0x8bb1('0xe')]();}else if(_0x3c5511&&_0x3c5511>0x0&&_0x3c5511<_0x5d3498){_0x285512+=0x1;_0x1a0141[_0x8bb1('0xb')](_0x8bb1('0x7'),new AGIError(_0x8bb1('0xf'),_0x285512));_0xb2f808[_0x8bb1('0xe')]();}else{var _0x12d507=new AGIChannel(_0xb2f808);_0x12d507['on']('ready',function(){_0x1a0141[_0x8bb1('0xb')](_0x8bb1('0xc'),_0x12d507);});}});});_0x2cf483['on'](_0x8bb1('0x7'),function(_0xa40036){_0x1a0141[_0x8bb1('0xb')](_0x8bb1('0x7'),new AGIError(_0x8bb1('0x10'),_0xa40036[_0x8bb1('0x11')]));});_0x2cf483['on'](_0x8bb1('0x12'),function(){_0x1a0141['emit'](_0x8bb1('0x12'),new AGIError(_0x8bb1('0x13')));});}process[_0x8bb1('0x14')](function(){_0x3a0219();});};util[_0x8bb1('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x37312f,_0x13202b,_0x1344e0){return new AGIServer(_0x37312f,_0x13202b,_0x1344e0);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 927c224..335950f 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 _0x42e3=['sync','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','timeout','answer','no\x20list\x20selected','delay','noop','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','url','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','getData','response','maxdigit','stringify','mindigit','getVariable','hiddendigitsnum','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s.%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','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','no\x20find\x20by\x20configured','math','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','lodash','shelljs','odbc','randomstring','moment','agi','../../config/environment','/var/opt/motion2/server/files','getdigits','channel','prototype','rpc','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','trim','googleTTS','text','googleDialogflow','key','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','clear','includes','agicommand','clone','hasOwnProperty','replaceAllVariables','length','split','replaceAll','extra','toString','getAndSetVariable','result','setVariable'];(function(_0x378c8e,_0x5ce4e1){var _0x207263=function(_0x40c392){while(--_0x40c392){_0x378c8e['push'](_0x378c8e['shift']());}};_0x207263(++_0x5ce4e1);}(_0x42e3,0x11d));var _0x342e=function(_0x257d0c,_0x21aa6a){_0x257d0c=_0x257d0c-0x0;var _0x45dc77=_0x42e3[_0x257d0c];return _0x45dc77;};'use strict';var fs=require('fs');var path=require(_0x342e('0x0'));var util=require('util');var _=require(_0x342e('0x1'));var sh=require(_0x342e('0x2'));var odbc=require(_0x342e('0x3'))();var rs=require(_0x342e('0x4'));var moment=require(_0x342e('0x5'));var Mustache=require('mustache');var logger=require('../../config/logger')(_0x342e('0x6'));var config=require(_0x342e('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x342e('0x8');var verticesWithRetry=['menu',_0x342e('0x9'),'getsecretdigits'];var AGIVertices=function(_0x2dcb58,_0x57c838,_0x2bdcfe){this[_0x342e('0xa')]=_0x2dcb58;this['rpc']=_0x57c838;this['mailRpc']=_0x2bdcfe;};AGIVertices[_0x342e('0xb')]['getVariable']=function(_0x2cfe71,_0x34bebc){this[_0x342e('0xc')][_0x342e('0xd')](_0x2cfe71)['then'](function(_0x61b62d){_0x34bebc(null,_0x61b62d?_0x61b62d[_0x342e('0xe')]:![]);})[_0x342e('0xf')](function(_0x5d0630){_0x34bebc(_0x5d0630);});};AGIVertices[_0x342e('0xb')][_0x342e('0x10')]=function(_0x448127,_0x4383a0){this[_0x342e('0xc')][_0x342e('0x11')](_0x448127)[_0x342e('0x12')](function(_0x3d69e9){_0x4383a0(null,_0x3d69e9?_0x3d69e9[_0x342e('0xe')]:![]);})['catch'](function(_0x501f86){_0x4383a0(_0x501f86);});};AGIVertices[_0x342e('0xb')]['getSquareProject']=function(_0x499636,_0x16aa5d){this['rpc'][_0x342e('0x13')](_0x499636)['then'](function(_0x18c894){_0x16aa5d(null,_0x18c894?_0x18c894[_0x342e('0xe')]:![]);})['catch'](function(_0x14d1e8){_0x16aa5d(_0x14d1e8);});};AGIVertices[_0x342e('0xb')]['getSquareOdbc']=function(_0xcdb2e3,_0x463442){this['rpc'][_0x342e('0x14')](_0xcdb2e3)[_0x342e('0x12')](function(_0x885d4e){_0x463442(null,_0x885d4e?_0x885d4e[_0x342e('0x15')]:![]);})[_0x342e('0xf')](function(_0x1659e6){_0x463442(_0x1659e6);});};AGIVertices['prototype']['getUser']=function(_0x3d035e,_0x28846b){this[_0x342e('0xc')][_0x342e('0x16')](_0x3d035e)[_0x342e('0x12')](function(_0x50a0dd){_0x28846b(null,_0x50a0dd?_0x50a0dd[_0x342e('0xe')]:![]);})[_0x342e('0xf')](function(_0x1d7a71){_0x28846b(_0x1d7a71);});};AGIVertices[_0x342e('0xb')][_0x342e('0x17')]=function(_0x423faa,_0x36ced0){this[_0x342e('0xc')][_0x342e('0x18')](_0x423faa)[_0x342e('0x12')](function(_0x47eaab){_0x36ced0(null,_0x47eaab?_0x47eaab[_0x342e('0xe')]:![]);})[_0x342e('0xf')](function(_0x16ecd6){_0x36ced0(_0x16ecd6);});};AGIVertices[_0x342e('0xb')][_0x342e('0x19')]=function(_0x3659a5,_0x323829){var _0x3e9772=this;this['rpc'][_0x342e('0x1a')](_0x3659a5)[_0x342e('0x12')](function(_0x3a6178){_0x323829(null,_0x3a6178?_0x3e9772[_0x342e('0x1b')](_0x3a6178[_0x342e('0x1c')]):![]);})[_0x342e('0xf')](function(_0x5104e0){_0x323829(_0x5104e0);});};AGIVertices[_0x342e('0xb')][_0x342e('0x1d')]=function(_0xc3f79d,_0x864ff1){this['rpc'][_0x342e('0x1e')](_0xc3f79d)[_0x342e('0x12')](function(_0x328650){_0x864ff1(null,_0x328650?_0x328650:![]);})[_0x342e('0xf')](function(_0x32367d){_0x864ff1(_0x32367d);});};AGIVertices[_0x342e('0xb')][_0x342e('0x1f')]=function(_0x2ad204,_0x43a128,_0x34bc39){this[_0x342e('0x20')][_0x342e('0x1f')](_0x2ad204,_0x43a128)[_0x342e('0x12')](function(){_0x34bc39(null);})[_0x342e('0xf')](function(_0x233996){_0x34bc39(_0x233996);});};AGIVertices[_0x342e('0xb')][_0x342e('0x21')]=function(_0x2df03c,_0x7a5196){this[_0x342e('0xc')][_0x342e('0x22')](_0x2df03c)[_0x342e('0x12')](function(_0x43601a){if(_0x43601a){if(_0x43601a['IntervalId']){_0x7a5196(null,[_0x43601a[_0x342e('0x23')]]);}else{_0x7a5196(null,_[_0x342e('0x24')](_0x43601a[_0x342e('0x25')],_0x342e('0x23')));}}else{_0x7a5196(null,![]);}})[_0x342e('0xf')](function(_0x194a3e){_0x7a5196(_0x194a3e);});};AGIVertices['prototype'][_0x342e('0x1b')]=function(_0x3af240){return util[_0x342e('0x26')](_0x342e('0x27'),FILES_PATH,_0x3af240);};AGIVertices[_0x342e('0xb')]['getQueryOdbc']=function(_0x365015,_0x30d84a,_0x4fbfee){odbc[_0x342e('0x28')](_0x365015,function(_0x2ddb49){if(_0x2ddb49){logger[_0x342e('0x29')](_0x342e('0x2a'),_0x2ddb49);_0x4fbfee(_0x2ddb49);}else{logger[_0x342e('0x2b')](_0x342e('0x2c'));odbc[_0x342e('0x2d')](_0x30d84a,function(_0x18f985,_0x5affdc){if(_0x18f985){logger[_0x342e('0x2b')](_0x342e('0x2e'),_0x30d84a);_0x4fbfee(_0x18f985);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x30d84a);odbc[_0x342e('0x2f')](function(_0x3f7081){if(_0x3f7081){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3f7081);}_0x4fbfee(null,_0x5affdc);});}});}});};AGIVertices[_0x342e('0xb')][_0x342e('0x30')]=function(_0x3cbeb4,_0x13ef69){this[_0x342e('0xc')][_0x342e('0x31')](_0x3cbeb4)[_0x342e('0x12')](function(_0x4a5e10){_0x13ef69(null,_0x4a5e10?_0x4a5e10:![]);})[_0x342e('0xf')](function(_0x3d7501){_0x13ef69(_0x3d7501);});};AGIVertices[_0x342e('0xb')]['createSmsMessage']=function(_0x7a69af,_0x1bb933){this[_0x342e('0xc')][_0x342e('0x32')](_0x7a69af)[_0x342e('0x12')](function(_0x5112fd){_0x1bb933(null,_0x5112fd);})[_0x342e('0xf')](function(_0x58c682){_0x1bb933(_0x58c682);});};AGIVertices[_0x342e('0xb')]['createSquareDetailsReport']=function(_0x729908,_0xdeba1f,_0x41bc2e){this[_0x342e('0xc')][_0x342e('0x33')]({'uniqueid':this[_0x342e('0xa')][_0x342e('0x34')],'node':_0x729908['label'],'application':_0x729908['agicommand'],'data':_0xdeba1f||null,'project_name':this[_0x342e('0xa')][_0x342e('0x35')],'callerid':this[_0x342e('0xa')][_0x342e('0x36')]})['then'](function(_0xfea3fa){if(_0x41bc2e){_0x41bc2e(null,_0xfea3fa);}})[_0x342e('0xf')](function(_0x4fcf10){if(_0x41bc2e){_0x41bc2e(_0x4fcf10);}});};AGIVertices[_0x342e('0xb')][_0x342e('0x37')]=function(_0x1088b4,_0x10b471,_0x43d016,_0x3adbd0){this[_0x342e('0xc')][_0x342e('0x37')]({'uniqueid':this[_0x342e('0xa')][_0x342e('0x34')],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0x342e('0x38')],'context':this['channel'][_0x342e('0x39')],'extension':this['channel']['extension'],'priority':this[_0x342e('0xa')][_0x342e('0x3a')],'accountcode':this[_0x342e('0xa')][_0x342e('0x3b')],'dnid':this[_0x342e('0xa')][_0x342e('0x3c')],'projectName':this[_0x342e('0xa')]['arg_1'],'saveName':_0x10b471,'filename':_0x1088b4[_0x342e('0x3d')]||_0x10b471,'savePath':_0x43d016})[_0x342e('0x12')](function(_0x47bb1f){_0x3adbd0(null,_0x47bb1f);})[_0x342e('0xf')](function(_0xab5417){_0x3adbd0(_0xab5417);});};AGIVertices[_0x342e('0xb')][_0x342e('0x3e')]=function(_0x1e659f,_0xb06f47,_0x16b722){this[_0x342e('0xc')][_0x342e('0x3e')]({'uniqueid':this[_0x342e('0xa')][_0x342e('0x34')],'body':_0x1e659f,'direction':_0xb06f47})[_0x342e('0x12')](function(_0x56dc2b){if(_0x16b722){_0x16b722(null,_0x56dc2b);}})[_0x342e('0xf')](function(_0x5c0257){if(_0x16b722){_0x16b722(_0x5c0257);}});};AGIVertices['prototype'][_0x342e('0x3f')]=function(_0x1a7770,_0x578217){this[_0x342e('0xc')][_0x342e('0x3f')]({'firstName':_[_0x342e('0x40')](_0x1a7770[_0x342e('0xe')])||_[_0x342e('0x41')](_0x1a7770['name'])?_0x342e('0x42')+Math[_0x342e('0x43')]():_0x1a7770[_0x342e('0xe')],'lastName':_[_0x342e('0x40')](_0x1a7770['lastName'])||_[_0x342e('0x41')](_0x1a7770['lastName'])?null:_0x1a7770['lastName'],'phone':_0x1a7770[_0x342e('0x44')],'ListId':_0x1a7770['list_id'],'scheduledAt':_0x1a7770[_0x342e('0x45')],'callbackUniqueid':this[_0x342e('0xa')]['uniqueid'],'tags':_0x342e('0x46'),'description':_0x342e('0x47')+_0x1a7770[_0x342e('0x45')]['toString'](),'priority':_0x1a7770['callback_priority']})[_0x342e('0x12')](function(_0x1d4af3){_0x578217(null,_0x1d4af3);})[_0x342e('0xf')](function(_0xfff5f9){_0x578217(_0xfff5f9);});};AGIVertices['prototype'][_0x342e('0x48')]=function(_0x3c3686,_0x1ac129){this['rpc'][_0x342e('0x49')](_0x3c3686)[_0x342e('0x12')](function(_0xf8b6ac){_0x1ac129(null,_0xf8b6ac?_0xf8b6ac[_0x342e('0xe')]:![]);})['catch'](function(_0x1e3edb){_0x1ac129(_0x1e3edb);});};AGIVertices[_0x342e('0xb')]['agentPause']=function(_0x1e9295,_0x22a56a,_0x4ecc82){var _0x7d91f8={'role':_0x342e('0x4a')};_0x7d91f8[_0x1e9295]=this['channel']['callerid'];this[_0x342e('0xc')][_0x342e('0x4b')](_0x7d91f8,_0x22a56a,this[_0x342e('0xa')][_0x342e('0x34')])[_0x342e('0x12')](function(_0x4ef5ae){_0x4ecc82(null,_[_0x342e('0x41')](_0x4ef5ae)?![]:!![]);})[_0x342e('0xf')](function(_0x330b69){logger[_0x342e('0x29')](_0x330b69);_0x4ecc82(null,![]);});};AGIVertices[_0x342e('0xb')][_0x342e('0x4c')]=function(_0x12c10a,_0x1679b4){var _0x6e3b37={'role':_0x342e('0x4a')};_0x6e3b37[_0x12c10a]=this[_0x342e('0xa')][_0x342e('0x36')];this['rpc'][_0x342e('0x4c')](_0x6e3b37)[_0x342e('0x12')](function(_0x3a4c4a){_0x1679b4(null,_[_0x342e('0x41')](_0x3a4c4a)?![]:!![]);})[_0x342e('0xf')](function(_0x195371){logger['error'](_0x195371);_0x1679b4(null,![]);});};AGIVertices[_0x342e('0xb')][_0x342e('0x4d')]=function(_0x7fc1bc,_0x25bf6e){var _0x269f76={'role':'agent'};_0x269f76[_0x7fc1bc]=this['channel'][_0x342e('0x36')];this[_0x342e('0xc')][_0x342e('0x4d')](_0x269f76)[_0x342e('0x12')](function(_0x2a000b){_0x25bf6e(null,_[_0x342e('0x41')](_0x2a000b)?![]:!![]);})['catch'](function(_0x44f49d){logger['error'](_0x44f49d);_0x25bf6e(null,![]);});};AGIVertices[_0x342e('0xb')][_0x342e('0x4e')]=function(_0x1de6a9,_0x40e278){var _0xb28dc5={'role':_0x342e('0x4a')};_0xb28dc5[_0x1de6a9]=this[_0x342e('0xa')][_0x342e('0x36')];var _0x360c86=_0x1de6a9!=_0x342e('0x4f')?util[_0x342e('0x26')](_0x342e('0x50'),'LOCAL',this['channel']['callerid']):undefined;this[_0x342e('0xc')]['agentLogin'](_0xb28dc5,_0x360c86)[_0x342e('0x12')](function(_0x5c24d2){_0x40e278(null,_[_0x342e('0x41')](_0x5c24d2)?![]:!![]);})['catch'](function(_0x2cf5e6){logger[_0x342e('0x29')](_0x2cf5e6);_0x40e278(null,![]);});};AGIVertices[_0x342e('0xb')][_0x342e('0x51')]=function(_0x527a74,_0x1d099b){sh['exec'](_[_0x342e('0x52')](_0x527a74),function(_0x401cd7,_0x5d3cea){var _0x5c6d6b=_0x5d3cea['replace'](/(\r\n|\n|\r)/gm,'');_0x1d099b(null,_0x5c6d6b);});};AGIVertices[_0x342e('0xb')]['googleTTS']=function(_0x11e5b3,_0x23cb74){scripts[_0x342e('0x53')](_0x11e5b3[_0x342e('0x54')],_0x11e5b3['google_tts_language']||'en',0x1)[_0x342e('0x12')](function(_0x5d7746){_0x23cb74(null,_0x5d7746);})['catch'](function(_0x30377c){_0x23cb74(_0x30377c);});};AGIVertices['prototype']['googleDialogflow']=function(_0xe9001e,_0x491c75){scripts[_0x342e('0x55')](this[_0x342e('0xa')][_0x342e('0x34')],_0xe9001e[_0x342e('0x56')],_0xe9001e[_0x342e('0x54')],_0xe9001e['dialogflow_language']||'en')[_0x342e('0x12')](function(_0x5735f8){_0x491c75(null,_0x5735f8);})[_0x342e('0xf')](function(_0x46fc1b){_0x491c75(_0x46fc1b);});};AGIVertices[_0x342e('0xb')][_0x342e('0x57')]=function(_0x41f179,_0xee9dde){scripts[_0x342e('0x57')](this[_0x342e('0xa')],_0x41f179)['then'](function(_0x21e002){_0xee9dde(null,_0x21e002);})[_0x342e('0xf')](function(_0x3609fa){_0xee9dde(_0x3609fa);});};AGIVertices[_0x342e('0xb')][_0x342e('0x58')]=function(_0x5ee1ee,_0x9e65b4){scripts[_0x342e('0x58')](_0x5ee1ee[_0x342e('0x56')],_0x5ee1ee['text'],_0x5ee1ee['ispeech_tts_language']||_0x342e('0x59'),_0x5ee1ee[_0x342e('0x5a')])[_0x342e('0x12')](function(_0x390fc5){_0x9e65b4(null,_0x390fc5);})[_0x342e('0xf')](function(_0x24ac47){_0x9e65b4(_0x24ac47);});};AGIVertices[_0x342e('0xb')][_0x342e('0x5b')]=function(_0x1adfd0,_0xd7bc69,_0x5100a5){scripts[_0x342e('0x5b')](_0xd7bc69,_0x1adfd0['key'],_0x1adfd0[_0x342e('0x5c')]||_0x342e('0x59'),this[_0x342e('0x5d')](_0x1adfd0[_0x342e('0x5e')])?_0x1adfd0['model']:undefined)[_0x342e('0x12')](function(_0x51ca30){_0x5100a5(null,_0x51ca30);})[_0x342e('0xf')](function(_0x14a72d){_0x5100a5(_0x14a72d);});};AGIVertices[_0x342e('0xb')][_0x342e('0x5f')]=function(_0x3cce57,_0x530a96){scripts[_0x342e('0x5f')](_0x3cce57[_0x342e('0x60')],_0x3cce57['aws_secret_access_key'],_0x3cce57[_0x342e('0x61')],_0x3cce57[_0x342e('0x62')]||_0x342e('0x63'),_0x3cce57[_0x342e('0x54')],_0x3cce57[_0x342e('0x64')]||'text')[_0x342e('0x12')](function(_0x1e4fea){_0x530a96(null,_0x1e4fea);})[_0x342e('0xf')](function(_0xede9f8){_0x530a96(_0xede9f8);});};AGIVertices[_0x342e('0xb')][_0x342e('0x65')]=function(_0x4ad65d,_0x3a991c){scripts['awsLex'](this['channel']['uniqueid'],_0x4ad65d[_0x342e('0x60')],_0x4ad65d[_0x342e('0x66')],_0x4ad65d[_0x342e('0x67')],_0x4ad65d[_0x342e('0x54')],_0x4ad65d['aws_bot_name'])[_0x342e('0x12')](function(_0x37a1aa){_0x3a991c(null,_0x37a1aa);})[_0x342e('0xf')](function(_0x1ec21a){_0x3a991c(_0x1ec21a);});};AGIVertices[_0x342e('0xb')][_0x342e('0x68')]=function(_0x1fc2ec,_0x311144,_0x307d0f){scripts['googleASR'](_0x311144,_0x1fc2ec[_0x342e('0x56')],_0x1fc2ec[_0x342e('0x69')]||'en-US')[_0x342e('0x12')](function(_0x45fd1f){_0x307d0f(null,_0x45fd1f);})[_0x342e('0xf')](function(_0xde1e72){_0x307d0f(_0xde1e72);});};AGIVertices['prototype'][_0x342e('0x6a')]=function(_0x35120e,_0x30fb61,_0x4be775){scripts[_0x342e('0x6a')](_0x30fb61,_0x35120e[_0x342e('0x6b')],_0x35120e['appsecret'],_0x35120e['uri'])[_0x342e('0x12')](function(_0x464e7e){_0x4be775(null,_0x464e7e);})['catch'](function(_0x2907e8){_0x4be775(_0x2907e8);});};AGIVertices['prototype'][_0x342e('0x6c')]=function(_0x327e36){var _0x3829f3=_[_0x342e('0x6d')](verticesWithRetry,_0x327e36[_0x342e('0x6e')])?_0x327e36:_[_0x342e('0x6f')](_0x327e36);for(var _0x3d082d in _0x3829f3){if(_0x3829f3[_0x342e('0x70')](_0x3d082d)){if(_0x3829f3[_0x3d082d]&&_['isString'](_0x3829f3[_0x3d082d])){_0x3829f3[_0x3d082d]=this[_0x342e('0x71')](_0x3829f3[_0x3d082d]);}}}return _0x3829f3;};AGIVertices[_0x342e('0xb')][_0x342e('0x71')]=function(_0x98d3eb){var _0xb37e4=_0x98d3eb['split']('{');for(var _0x4252d8=0x1;_0x4252d8<_0xb37e4[_0x342e('0x72')];_0x4252d8+=0x1){var _0x54f004=_0xb37e4[_0x4252d8][_0x342e('0x73')]('}');if(_0x54f004[_0x342e('0x72')]>0x1){_0x98d3eb=_0x98d3eb[_0x342e('0x74')]('{'+_0x54f004[0x0]+'}',this['channel']['getVariable'](_0x54f004[0x0])[_0x342e('0x75')]||_0x54f004[0x0]);}}if(_0xb37e4[_0x342e('0x72')]===0x1){return _0x98d3eb[_0x342e('0x76')]();}return this[_0x342e('0x71')](_0x98d3eb);};AGIVertices[_0x342e('0xb')][_0x342e('0x77')]=function(_0x157172,_0x2eb327){var _0x271f15=this[_0x342e('0xa')]['getVariable'](_0x157172);if(_0x271f15[_0x342e('0x78')]===-0x1){return _0x271f15;}logger[_0x342e('0x2b')](util[_0x342e('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2eb327,_0x271f15[_0x342e('0x75')]));return this[_0x342e('0xa')][_0x342e('0x79')](_0x2eb327,_0x271f15['extra']);};AGIVertices[_0x342e('0xb')][_0x342e('0x5d')]=function(_0x3878fe){return _0x3878fe&&_0x3878fe!=='0'&&_0x3878fe!=='-1'&&_0x3878fe!=='';};AGIVertices[_0x342e('0xb')]['maxRetry']=function(_0x488ef5){this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x488ef5,'-');_0x488ef5[_0x342e('0x7b')]=_0x488ef5[_0x342e('0x7c')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x342e('0x6')]=function(_0x22f25c){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x7d'),_0x22f25c[_0x342e('0x7e')]));return this['channel'][_0x342e('0x6')]([_0x22f25c[_0x342e('0x7f')],_0x22f25c[_0x342e('0x80')]]);};AGIVertices[_0x342e('0xb')]['answer']=function(_0x2f5833){logger['info'](util[_0x342e('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2f5833['label']));if(this[_0x342e('0x5d')](_0x2f5833[_0x342e('0x81')])){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2f5833[_0x342e('0x81')]));var _0xb839dd=this['channel']['wait'](_0x2f5833['timeout']);if(_0xb839dd['result']===-0x1){return _0xb839dd;}}return this['channel'][_0x342e('0x82')]();};AGIVertices[_0x342e('0xb')][_0x342e('0x46')]=function(_0xcaf9cc){logger[_0x342e('0x2b')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xcaf9cc[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0xcaf9cc['list_id'])){return this[_0x342e('0xa')][_0x342e('0x29')](_0xcaf9cc,_0x342e('0x83'));}_0xcaf9cc[_0x342e('0x45')]=moment();if(this[_0x342e('0x5d')](_0xcaf9cc['delay'])){_0xcaf9cc[_0x342e('0x45')]=moment()['add'](_0xcaf9cc[_0x342e('0x84')],'minutes');}if(!this['isConfigured'](_0xcaf9cc['callback_priority'])){_0xcaf9cc['callback_priority']=0x2;}this[_0x342e('0x3f')][_0x342e('0x7a')](this,_0xcaf9cc);return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xcaf9cc[_0x342e('0x44')],_0xcaf9cc[_0x342e('0x86')],_0xcaf9cc[_0x342e('0x45')]));};AGIVertices[_0x342e('0xb')][_0x342e('0x87')]=function(_0x341eba){logger[_0x342e('0x2b')](util['format'](_0x342e('0x88'),_0x341eba['label']));var _0x339c6a=this['channel'][_0x342e('0x89')](_0x341eba[_0x342e('0x8a')],_0x341eba[_0x342e('0x8b')]);if(_0x339c6a[_0x342e('0x78')]===-0x1){return _0x339c6a;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x8c'),_0x341eba[_0x342e('0x8a')],_0x341eba[_0x342e('0x8b')]));};AGIVertices[_0x342e('0xb')][_0x342e('0x8d')]=function(_0x4ce940){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x8e'),_0x4ce940[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x4ce940['text'])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x8f'));}var _0x1322a9='\x22'+_0x4ce940[_0x342e('0x54')]+'\x22';if(this[_0x342e('0x5d')](_0x4ce940['options'])){_0x1322a9+=','+_0x4ce940[_0x342e('0x8b')];}var _0xf7d80e=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0x90'),_0x1322a9);if(_0xf7d80e['result']===-0x1){return _0xf7d80e;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x91'),_0x1322a9));};AGIVertices[_0x342e('0xb')][_0x342e('0x92')]=function(_0x120852){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x93'),_0x120852[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x120852['text'])){return this['channel']['noop'](_0x342e('0x8f'));}var _0x377282='\x22'+_0x120852[_0x342e('0x54')]+'\x22';if(this['isConfigured'](_0x120852[_0x342e('0x8b')])){_0x377282+=','+_0x120852['options'];}var _0x362d0c=this[_0x342e('0xa')]['exec']('MRCPSynth',_0x377282);if(_0x362d0c[_0x342e('0x78')]===-0x1){return _0x362d0c;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x377282));};AGIVertices[_0x342e('0xb')][_0x342e('0x94')]=function(_0x2a87e5){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x95'),_0x2a87e5[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x2a87e5[_0x342e('0x96')])){return this[_0x342e('0xa')][_0x342e('0x85')]('no\x20grammar\x20configured');}var _0xc76f85=_0x2a87e5['grammar'];if(this['isConfigured'](_0x2a87e5[_0x342e('0x8b')])){_0xc76f85+=','+_0x2a87e5[_0x342e('0x8b')];}var _0x2a6c2e=this[_0x342e('0xa')][_0x342e('0x89')]('MRCPRecog',_0xc76f85);if(_0x2a6c2e[_0x342e('0x78')]===-0x1){return _0x2a6c2e;}var _0x5ae233=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x342e('0x97'));if(_0x5ae233[_0x342e('0x78')]===-0x1){return _0x5ae233;}var _0x171c9e=this[_0x342e('0x77')]('RECOG_INPUT()',_0x342e('0x98'));if(_0x171c9e['result']===-0x1){return _0x171c9e;}var _0x196583=this[_0x342e('0x77')](_0x342e('0x99'),_0x342e('0x9a'));if(_0x196583['result']===-0x1){return _0x196583;}return this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0x9b'),_0xc76f85));};AGIVertices[_0x342e('0xb')][_0x342e('0x9c')]=function(_0x41cf4a){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x9d'),_0x41cf4a[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x41cf4a[_0x342e('0x96')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x9e'));}var _0x5c93db=_0x41cf4a[_0x342e('0x96')];if(this[_0x342e('0x5d')](_0x41cf4a[_0x342e('0x8b')])){_0x5c93db+=','+_0x41cf4a[_0x342e('0x8b')];}var _0x7110e2=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0x9f'),_0x5c93db);if(_0x7110e2[_0x342e('0x78')]===-0x1){return _0x7110e2;}var _0x45adb3=this[_0x342e('0x77')](_0x342e('0xa0'),_0x342e('0xa1'));if(_0x45adb3[_0x342e('0x78')]===-0x1){return _0x45adb3;}var _0x161d86=this['getAndSetVariable']('RECOG_INPUT()',_0x342e('0xa2'));if(_0x161d86[_0x342e('0x78')]===-0x1){return _0x161d86;}var _0x54e439=this[_0x342e('0x77')](_0x342e('0x99'),_0x342e('0xa3'));if(_0x54e439[_0x342e('0x78')]===-0x1){return _0x54e439;}return this['channel']['noop'](util[_0x342e('0x26')](_0x342e('0x9b'),_0x5c93db));};AGIVertices[_0x342e('0xb')]['database']=function(_0x192cd5){logger[_0x342e('0x2b')](util['format'](_0x342e('0xa4'),_0x192cd5[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x192cd5[_0x342e('0xa5')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x192cd5,_0x342e('0xa6'));}var _0x22ec0b=this[_0x342e('0xa7')][_0x342e('0x7a')](this,_0x192cd5['odbc_id']);if(!_0x22ec0b){return this[_0x342e('0xa')][_0x342e('0x29')](_0x192cd5,_0x342e('0xa8'));}if(!this['isConfigured'](_0x192cd5[_0x342e('0x2d')])){return this[_0x342e('0xa')]['error'](_0x192cd5,_0x342e('0xa9'));}var _0x54a1bf=_0x192cd5[_0x342e('0x2d')][_0x342e('0xaa')](/(\r\n|\n|\r)/gm,'\x20');this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xab'),_0x54a1bf));var _0x5bdcce=this[_0x342e('0xac')][_0x342e('0x7a')](this,_0x22ec0b,_0x54a1bf);this[_0x342e('0x33')]['sync'](this,_0x192cd5,_0x54a1bf);if(!this[_0x342e('0x5d')](_0x192cd5['variable_id'])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xad'));}var _0x1c44a7=this['getVariable'][_0x342e('0x7a')](this,_0x192cd5['variable_id']);if(!_0x1c44a7){return this[_0x342e('0xa')][_0x342e('0x29')](_0x192cd5,_0x342e('0xae'));}var _0x573ab8=this;_0x5bdcce['forEach'](function(_0x22d4b6,_0x34a476){Object['keys'](_0x22d4b6)[_0x342e('0xaf')](function(_0x309015){_0x573ab8[_0x342e('0xa')][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0xb0'),_0x1c44a7,_0x34a476,_0x309015),_0x22d4b6[_0x309015]);});});this[_0x342e('0xa')][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0xb1'),_0x1c44a7),_0x5bdcce[_0x342e('0x72')]);return this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0xb2'),_0x1c44a7));};AGIVertices['prototype'][_0x342e('0xb3')]=function(_0x319adb){logger[_0x342e('0xb4')](util[_0x342e('0x26')](_0x342e('0xb5'),_0x319adb['label']));if(!this[_0x342e('0x5d')](_0x319adb['sip_id'])){return this[_0x342e('0xa')]['error'](_0x319adb,'no\x20user\x20selected');}var _0x5e15d2=this['getUser'][_0x342e('0x7a')](this,_0x319adb[_0x342e('0xb6')]);if(!_0x5e15d2){return this[_0x342e('0xa')][_0x342e('0x29')](_0x319adb,'no\x20user\x20found');}var _0x4c3466=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0xb7'),[util['format']('SIP/%s',_0x5e15d2),_0x319adb[_0x342e('0x81')],_0x319adb[_0x342e('0xb8')],_0x319adb['url']]);if(_0x4c3466[_0x342e('0x78')]===-0x1){return _0x4c3466;}return this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0xb9'),_0x342e('0xb7')));};AGIVertices['prototype'][_0x342e('0xba')]=function(_0xe737d2){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xe737d2[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0xe737d2[_0x342e('0x56')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xbb'));}if(!this[_0x342e('0x5d')](_0xe737d2[_0x342e('0x54')])){return this[_0x342e('0xa')][_0x342e('0x85')]('no\x20text\x20configured');}this['channel'][_0x342e('0xbc')]=!![];this[_0x342e('0x33')](_0xe737d2);this['createSquareMessage'](_0xe737d2[_0x342e('0x54')],'in');this[_0x342e('0xa')][_0x342e('0x85')](util['format']('Trying\x20Dialogflow:\x20%s',_0xe737d2[_0x342e('0x54')]));var _0x4b772f=this[_0x342e('0x55')][_0x342e('0x7a')](this,_0xe737d2);if(_0x4b772f){for(var _0x45cc7e in _0x4b772f){if(_0x4b772f['hasOwnProperty'](_0x45cc7e)){this[_0x342e('0xa')][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0xbd'),_0x45cc7e[_0x342e('0xbe')]()),_0x4b772f[_0x45cc7e]);}}this[_0x342e('0x3e')](_0x4b772f[_0x342e('0xbf')],'out');return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xc0'),_0x4b772f[_0x342e('0xbf')]));}return this[_0x342e('0xa')][_0x342e('0x29')](_0xe737d2,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x342e('0xb')]['sesteknda']=function(_0x5e8701){logger['info'](util[_0x342e('0x26')](_0x342e('0xc1'),_0x5e8701[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x5e8701[_0x342e('0xc2')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xc3'));}if(!this[_0x342e('0x5d')](_0x5e8701[_0x342e('0xc4')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xc5'));}if(!this['isConfigured'](_0x5e8701[_0x342e('0xc6')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xc7'));}if(!this[_0x342e('0x5d')](_0x5e8701[_0x342e('0xc8')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x8f'));}this[_0x342e('0xa')]['bot']=!![];this[_0x342e('0x33')](_0x5e8701);this[_0x342e('0x3e')](_0x5e8701[_0x342e('0x54')],'in');this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xc9'),_0x5e8701[_0x342e('0x54')]));var _0x4f35e3=this['sestekNDA'][_0x342e('0x7a')](this,_0x5e8701);if(_0x4f35e3){for(var _0x4463e5 in _0x4f35e3){if(_0x4f35e3[_0x342e('0x70')](_0x4463e5)){this['channel'][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0xca'),_0x4463e5[_0x342e('0xbe')]()),_0x4f35e3[_0x4463e5]);}}this[_0x342e('0x3e')](_0x4f35e3[_0x342e('0xbf')],_0x342e('0xcb'));if(_0x4f35e3[_0x342e('0xcc')]){this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xcd'),_0x4f35e3['audiofile']));var _0x52b8fa=this[_0x342e('0xa')][_0x342e('0xce')](_0x4f35e3['audiofile']);try{fs[_0x342e('0xcf')](_0x4f35e3['audiofile']+_0x342e('0xd0'));}catch(_0x1dff96){logger[_0x342e('0x29')](_0x1dff96);}return _0x52b8fa;}else{return this['channel']['noop'](util['format'](_0x342e('0xd1'),_0x4f35e3[_0x342e('0xbf')]));}}return this[_0x342e('0xa')][_0x342e('0x29')](_0x5e8701,_0x342e('0xd2'));};AGIVertices[_0x342e('0xb')][_0x342e('0xd3')]=function(_0x52839a){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0xd4'),_0x52839a[_0x342e('0x7e')]));return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xd3'));};AGIVertices['prototype']['ext_dial']=function(_0x1b430e){logger['info'](util[_0x342e('0x26')](_0x342e('0xd5'),_0x1b430e[_0x342e('0x7e')]));var _0x1be171='';if(_0x1b430e[_0x342e('0xd6')]){if(!this['isConfigured'](_0x1b430e[_0x342e('0xd6')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x1b430e,_0x342e('0xd7'));}else{var _0x2c509f=parseInt(_0x1b430e[_0x342e('0xd6')],0xa);if(isNaN(_0x2c509f)){_0x1be171=_0x1b430e[_0x342e('0xd6')];}else{_0x1be171=this[_0x342e('0x17')]['sync'](this,_0x1b430e['trunk_id']);if(!_0x1be171){return this[_0x342e('0xa')][_0x342e('0x29')](_0x1b430e,'no\x20trunk\x20found');}}}}else if(_0x1b430e['trunk_name']){_0x1be171=_0x1b430e[_0x342e('0xd8')];}else{return this[_0x342e('0xa')][_0x342e('0x29')](_0x1b430e,_0x342e('0xd7'));}var _0xc47d6f=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0xb7'),[util[_0x342e('0x26')](_0x342e('0xd9'),_0x1be171,_0x1b430e[_0x342e('0x44')]),_0x1b430e[_0x342e('0x81')],_0x1b430e[_0x342e('0xb8')],_0x1b430e[_0x342e('0xda')]]);if(_0xc47d6f['result']===-0x1){return _0xc47d6f;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xb9'),'DIAL'));};AGIVertices['prototype'][_0x342e('0xdb')]=function(_0x184462){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x184462[_0x342e('0x7e')]));return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xdb'));};AGIVertices[_0x342e('0xb')][_0x342e('0x9')]=function(_0x1ad66a){logger[_0x342e('0x2b')](util['format'](_0x342e('0xdc'),_0x1ad66a[_0x342e('0x7e')]));if(_0x1ad66a[_0x342e('0x7b')]===0x0){return this[_0x342e('0x7c')](_0x1ad66a);}_0x1ad66a[_0x342e('0x7b')]-=0x1;if(!this[_0x342e('0x5d')](_0x1ad66a[_0x342e('0xdd')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x1ad66a,_0x342e('0xde'));}var _0x3277a7=this[_0x342e('0x19')][_0x342e('0x7a')](this,_0x1ad66a[_0x342e('0xdd')]);if(!_0x3277a7){return this[_0x342e('0xa')][_0x342e('0x29')](_0x1ad66a,_0x342e('0xdf'));}if(!this['isConfigured'](_0x1ad66a[_0x342e('0xe0')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x342e('0xad'));}var _0x7163fd=this[_0x342e('0xa')][_0x342e('0xe1')](_0x3277a7,_0x1ad66a[_0x342e('0xe2')],_0x1ad66a[_0x342e('0xe3')]);var _0x58b748=_0x7163fd[_0x342e('0x78')]?_0x7163fd['result'][_0x342e('0x76')]():'';logger['info']('test',JSON[_0x342e('0xe4')](_0x7163fd));if(_0x7163fd[_0x342e('0x78')]===-0x1){this[_0x342e('0x33')]['sync'](this,_0x1ad66a,_0x58b748);return _0x7163fd;}else if(_0x7163fd[_0x342e('0x75')]===_0x342e('0x81')){_0x7163fd['result']=_0x58b748['length']>=parseInt(_0x1ad66a[_0x342e('0xe5')])?'x':'i';}else{_0x7163fd[_0x342e('0x78')]=_0x58b748[_0x342e('0x72')]>=parseInt(_0x1ad66a[_0x342e('0xe5')])&&_0x58b748[_0x342e('0x72')]<=parseInt(_0x1ad66a[_0x342e('0xe3')])?'x':'i';}var _0x1bb53c=this[_0x342e('0xe6')][_0x342e('0x7a')](this,_0x1ad66a[_0x342e('0xe0')]);if(!_0x1bb53c){return this[_0x342e('0xa')][_0x342e('0x29')](_0x1ad66a,_0x342e('0xae'));}this[_0x342e('0xa')][_0x342e('0x79')](_0x1bb53c,_0x58b748);if(this[_0x342e('0x5d')](_0x1ad66a[_0x342e('0xe7')])){var _0x916cb2=parseInt(_0x1ad66a[_0x342e('0xe7')],0xa);var _0x3c4ff4=rs['generate']({'charset':'*','length':_0x916cb2});var _0x3d03f9=_0x58b748['length'];if(_0x3d03f9>0x0){if(_0x3d03f9>_0x916cb2){this['createSquareDetailsReport'][_0x342e('0x7a')](this,_0x1ad66a,_0x1ad66a['hiddendigitspos']==='first'?_0x3c4ff4+_0x58b748[_0x342e('0xe8')](_0x916cb2):_0x58b748[_0x342e('0xe8')](0x0,_0x3d03f9-_0x916cb2)+_0x3c4ff4);}else{this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x1ad66a,rs[_0x342e('0xe9')]({'charset':'*','length':_0x3d03f9}));}}else{this['createSquareDetailsReport']['sync'](this,_0x1ad66a,'');}}else{this[_0x342e('0x33')]['sync'](this,_0x1ad66a,_0x58b748);}return _0x7163fd;};AGIVertices['prototype'][_0x342e('0xea')]=function(_0x81be96){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0xeb'),_0x81be96['label']));return this[_0x342e('0x9')](_0x81be96);};AGIVertices[_0x342e('0xb')][_0x342e('0xec')]=function(_0x2d84b4){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0xed'),_0x2d84b4['label']));this['createSquareDetailsReport'][_0x342e('0x7a')](this,_0x2d84b4,_0x2d84b4[_0x342e('0xee')]);return this['channel']['noop'](util[_0x342e('0x26')](_0x342e('0xef'),_0x2d84b4[_0x342e('0xee')]));};AGIVertices['prototype']['awspolly']=function(_0x256b5f){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x256b5f[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x256b5f[_0x342e('0x60')])||!this[_0x342e('0x5d')](_0x256b5f[_0x342e('0x66')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xf0'));}if(!this[_0x342e('0x5d')](_0x256b5f[_0x342e('0x54')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x8f'));}this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xf1'),_0x256b5f[_0x342e('0x54')]));var _0x9ada04=this[_0x342e('0x5f')]['sync'](this,_0x256b5f);if(_0x9ada04){this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0xf2'),_0x9ada04));var _0x306292=this['channel'][_0x342e('0xce')](_0x9ada04);try{fs[_0x342e('0xcf')](_0x9ada04+_0x342e('0xd0'));}catch(_0x2f5889){logger[_0x342e('0x29')](_0x2f5889);}return _0x306292;}return this['channel'][_0x342e('0x29')](_0x256b5f,_0x342e('0xf3'));};AGIVertices[_0x342e('0xb')][_0x342e('0xf4')]=function(_0x27c01f){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0xf5'),_0x27c01f[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x27c01f['aws_access_key_id'])||!this['isConfigured'](_0x27c01f[_0x342e('0x66')])){return this['channel'][_0x342e('0x85')](_0x342e('0xf0'));}if(!this[_0x342e('0x5d')](_0x27c01f[_0x342e('0xf6')])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x342e('0x5d')](_0x27c01f[_0x342e('0x54')])){return this['channel']['noop'](_0x342e('0x8f'));}this[_0x342e('0xa')][_0x342e('0xbc')]=!![];this['createSquareDetailsReport'](_0x27c01f);this[_0x342e('0x3e')](_0x27c01f[_0x342e('0x54')],'in');this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0xf7'),_0x27c01f[_0x342e('0x54')]));var _0x4cec0a=this[_0x342e('0x65')][_0x342e('0x7a')](this,_0x27c01f);if(_0x4cec0a){for(var _0x4083c0 in _0x4cec0a){if(_0x4cec0a[_0x342e('0x70')](_0x4083c0)&&_[_0x342e('0xf8')](_0x4cec0a[_0x4083c0])){this['channel'][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0xf9'),_0x4083c0['toUpperCase']()),_0x4cec0a[_0x4083c0]);}}if(_[_0x342e('0x41')](_0x4cec0a[_0x342e('0xfa')])){return this['channel'][_0x342e('0x85')](_0x342e('0xfb'));}else{this[_0x342e('0x3e')](_0x4cec0a[_0x342e('0xfa')],_0x342e('0xcb'));return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0xfc'),_0x4cec0a['message']));}}return this[_0x342e('0xa')][_0x342e('0x29')](_0x27c01f,_0x342e('0xfd'));};AGIVertices[_0x342e('0xb')][_0x342e('0xfe')]=function(_0x7c5077){logger['info'](util[_0x342e('0x26')](_0x342e('0xff'),_0x7c5077[_0x342e('0x7e')],_0x7c5077[_0x342e('0x81')]));if(!this[_0x342e('0x5d')](_0x7c5077[_0x342e('0x56')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xbb'));}var _0x17af79=_0x342e('0x100');var _0x28cb8c=util[_0x342e('0x26')](_0x342e('0x101'),FILES_PATH,rs[_0x342e('0xe9')](0x4));var _0x324d74=util[_0x342e('0x26')]('%s.%s',_0x28cb8c,_0x17af79);var _0x593b99=!![];if(_0x7c5077[_0x342e('0x102')]===_0x342e('0x103')){_0x593b99=![];}var _0x6cde1d=this[_0x342e('0xa')][_0x342e('0x104')](_0x28cb8c,_0x17af79,_0x7c5077['intKey'],_0x7c5077[_0x342e('0x81')],undefined,_0x593b99);if(_0x6cde1d[_0x342e('0x78')]!==-0x1){this['channel']['noop'](util['format']('google\x20%s\x20file\x20created',_0x324d74));var _0x13a625=this[_0x342e('0x68')][_0x342e('0x7a')](this,_0x7c5077,_0x324d74);if(_0x13a625){for(var _0x194ca0 in _0x13a625){if(_0x13a625[_0x342e('0x70')](_0x194ca0)){this['channel'][_0x342e('0x79')](util[_0x342e('0x26')]('GOOGLE_ASR_%s',_0x194ca0['toUpperCase']()),_0x13a625[_0x194ca0]);}}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('GoogleASR\x20Result\x20%s',JSON[_0x342e('0xe4')](_0x13a625)));}}return _0x6cde1d;};AGIVertices[_0x342e('0xb')][_0x342e('0x105')]=function(_0x593673){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x106'),_0x593673[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x593673[_0x342e('0x6b')])){return this['channel'][_0x342e('0x85')](_0x342e('0x107'));}if(!this[_0x342e('0x5d')](_0x593673[_0x342e('0x108')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x1e8113='wav';var _0x3b8b74=util['format'](_0x342e('0x101'),FILES_PATH,rs[_0x342e('0xe9')](0x4));var _0x4c72d7=util[_0x342e('0x26')]('%s.%s',_0x3b8b74,_0x1e8113);var _0x2c6363=!![];if(_0x593673[_0x342e('0x102')]===_0x342e('0x103')){_0x2c6363=![];}var _0xff4fd0=this[_0x342e('0xa')][_0x342e('0x104')](_0x3b8b74,_0x1e8113,_0x593673[_0x342e('0x109')],_0x593673[_0x342e('0x81')],undefined,_0x2c6363);if(_0xff4fd0[_0x342e('0x78')]!==-0x1){this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0x10a'),_0x4c72d7));var _0x8e87eb=this['tildeASR'][_0x342e('0x7a')](this,_0x593673,_0x4c72d7);if(_0x8e87eb){for(var _0x2fd0e8 in _0x8e87eb){if(_0x8e87eb[_0x342e('0x70')](_0x2fd0e8)){this[_0x342e('0xa')]['setVariable'](util[_0x342e('0x26')]('TILDE_ASR_%s',_0x2fd0e8[_0x342e('0xbe')]()),_0x8e87eb[_0x2fd0e8]);}}return this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0x10b'),JSON[_0x342e('0xe4')](_0x8e87eb)));}}return _0xff4fd0;};AGIVertices[_0x342e('0xb')][_0x342e('0x10c')]=function(_0x56598f){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x10d'),_0x56598f[_0x342e('0x7e')]));return this['channel']['continueAt'](_0x56598f[_0x342e('0x39')],_0x56598f[_0x342e('0x10e')],_0x56598f[_0x342e('0x3a')]);};AGIVertices[_0x342e('0xb')][_0x342e('0x10f')]=function(_0x5426c4){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x110'),_0x5426c4[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x5426c4[_0x342e('0x111')])){return this['channel'][_0x342e('0x29')](_0x5426c4,_0x342e('0x112'));}try{var _0x22fc15=eval(_0x5426c4[_0x342e('0x111')])?_0x342e('0x113'):_0x342e('0x114');this[_0x342e('0xa')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x5426c4['condition'],_0x22fc15));return{'code':0xc8,'result':_0x22fc15};}catch(_0x4e412d){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x342e('0xb')][_0x342e('0x115')]=function(_0x302833){logger['info'](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x302833[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x302833[_0x342e('0x116')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x302833,'no\x20interval\x20configured');}var _0x3373dc=this[_0x342e('0x21')][_0x342e('0x7a')](this,_0x302833[_0x342e('0x116')]);if(!_0x3373dc){return this[_0x342e('0xa')]['error'](_0x302833,_0x342e('0x117'));}for(var _0x271f14=0x0;_0x271f14<_0x3373dc['length'];_0x271f14+=0x1){var _0x241bc9=this[_0x342e('0xa')]['getVariable'](util[_0x342e('0x26')](_0x342e('0x118'),_0x3373dc[_0x271f14]));if(_0x241bc9['result']===-0x1){return _0x241bc9;}logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x119'),_0x3373dc[_0x271f14],_0x241bc9[_0x342e('0x75')]));if(_0x241bc9[_0x342e('0x75')]===_0x342e('0x113')){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('IFTIME\x20%s\x20%s',_0x3373dc[_0x271f14],_0x342e('0x113')));this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x119'),_0x3373dc[_0x271f14],'true'));return{'code':0xc8,'result':_0x342e('0x113')};}else{logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x119'),_0x3373dc[_0x271f14],_0x342e('0x114')));this[_0x342e('0xa')][_0x342e('0x85')](util['format']('IFTIME\x20%s\x20%s',_0x3373dc[_0x271f14],_0x342e('0x114')));}}return{'code':0xc8,'result':_0x342e('0x114')};};AGIVertices[_0x342e('0xb')][_0x342e('0x11a')]=function(_0x188871){logger[_0x342e('0x2b')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x188871[_0x342e('0x7e')]));return this[_0x342e('0xa')]['hangup']();};AGIVertices['prototype'][_0x342e('0x11b')]=function(_0x358aa1){logger['info'](util[_0x342e('0x26')](_0x342e('0x11c'),_0x358aa1['label']));if(!this[_0x342e('0x5d')](_0x358aa1[_0x342e('0x56')])){return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xbb'));}var _0x308a18=_0x342e('0x100');var _0x5195e0=util['format'](_0x342e('0x101'),FILES_PATH,rs[_0x342e('0xe9')](0x4));var _0x3f4b43=util[_0x342e('0x26')](_0x342e('0x11d'),_0x5195e0,_0x308a18);var _0x5bd9d1=!![];if(_0x358aa1[_0x342e('0x102')]===_0x342e('0x103')){_0x5bd9d1=![];}var _0x1e7fcb=this[_0x342e('0xa')][_0x342e('0x104')](_0x5195e0,_0x308a18,_0x358aa1[_0x342e('0x109')],_0x358aa1['timeout'],undefined,_0x5bd9d1);if(_0x1e7fcb[_0x342e('0x78')]!==-0x1){this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0x11e'),_0x3f4b43));var _0x515a41=this[_0x342e('0x5b')][_0x342e('0x7a')](this,_0x358aa1,_0x3f4b43);if(_0x515a41){for(var _0x26544e in _0x515a41){if(_0x515a41['hasOwnProperty'](_0x26544e)){this[_0x342e('0xa')]['setVariable'](util[_0x342e('0x26')](_0x342e('0x11f'),_0x26544e['toUpperCase']()),_0x515a41[_0x26544e]);}}return this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0x120'),JSON[_0x342e('0xe4')](_0x515a41)));}}return _0x1e7fcb;};AGIVertices[_0x342e('0xb')][_0x342e('0x121')]=function(_0x310b95){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x122'),_0x310b95[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x310b95[_0x342e('0x56')])){return this[_0x342e('0xa')]['noop'](_0x342e('0xbb'));}if(!this['isConfigured'](_0x310b95[_0x342e('0x54')])){return this[_0x342e('0xa')][_0x342e('0x85')]('no\x20text\x20configured');}this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0x123'),_0x310b95['text']));var _0x5795bb=this[_0x342e('0x58')][_0x342e('0x7a')](this,_0x310b95);if(_0x5795bb){this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x11e'),_0x5795bb));var _0x5e4cbd=this[_0x342e('0xa')]['streamFile'](_0x5795bb,_0x310b95[_0x342e('0x109')]);try{fs[_0x342e('0xcf')](_0x5795bb+_0x342e('0xd0'));}catch(_0x4f08db){logger[_0x342e('0x29')](_0x4f08db);}return _0x5e4cbd;}return this[_0x342e('0xa')][_0x342e('0x29')](_0x310b95,_0x342e('0x124'));};AGIVertices[_0x342e('0xb')]['login']=function(_0x43e60b){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x125'),_0x43e60b[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x43e60b[_0x342e('0x126')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x43e60b,'no\x20find\x20by\x20configured');}logger[_0x342e('0x2b')](util['format'](_0x342e('0x127'),this['channel']['callerid'],_0x43e60b[_0x342e('0x126')]));var _0x432def=this[_0x342e('0x4e')][_0x342e('0x7a')](this,_0x43e60b[_0x342e('0x126')]);if(_0x432def){logger[_0x342e('0x2b')](util['format'](_0x342e('0x128'),this[_0x342e('0xa')][_0x342e('0x36')],_0x43e60b[_0x342e('0x126')]));this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x128'),this['channel'][_0x342e('0x36')],_0x43e60b[_0x342e('0x126')]));return{'code':0xc8,'result':_0x342e('0x129')};}else{logger[_0x342e('0x2b')](util['format'](_0x342e('0x12a'),this[_0x342e('0xa')]['callerid'],_0x43e60b[_0x342e('0x126')]));this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x12a'),this['channel']['callerid'],_0x43e60b[_0x342e('0x126')]));return{'code':0xc8,'result':_0x342e('0x12b')};}};AGIVertices['prototype'][_0x342e('0x12c')]=function(_0x169eaf){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x12d'),_0x169eaf[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x169eaf[_0x342e('0x126')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x169eaf,_0x342e('0x12e'));}logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x127'),this[_0x342e('0xa')][_0x342e('0x36')],_0x169eaf[_0x342e('0x126')]));var _0x1c6f2e=this[_0x342e('0x4d')][_0x342e('0x7a')](this,_0x169eaf['findBy']);if(_0x1c6f2e){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x342e('0xa')][_0x342e('0x36')],_0x169eaf[_0x342e('0x126')]));this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0x128'),this['channel'][_0x342e('0x36')],_0x169eaf['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x342e('0x26')](_0x342e('0x12a'),this[_0x342e('0xa')]['callerid'],_0x169eaf[_0x342e('0x126')]));this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x12a'),this[_0x342e('0xa')][_0x342e('0x36')],_0x169eaf['findBy']));return{'code':0xc8,'result':_0x342e('0x12b')};}};AGIVertices['prototype'][_0x342e('0x12f')]=function(_0x3ee8b3){logger['info'](util[_0x342e('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3ee8b3['label']));if(!this[_0x342e('0x5d')](_0x3ee8b3[_0x342e('0x130')])){return this['channel'][_0x342e('0x29')](_0x3ee8b3,_0x342e('0x131'));}this[_0x342e('0xa')][_0x342e('0x85')](util['format'](_0x342e('0x132'),_0x3ee8b3[_0x342e('0x130')]));var _0x4f3ce4=eval(_0x3ee8b3[_0x342e('0x130')]);if(!this[_0x342e('0x5d')](_0x3ee8b3[_0x342e('0xe0')])){return this[_0x342e('0xa')]['noop'](_0x342e('0xad'));}var _0x4059c5=this[_0x342e('0xe6')][_0x342e('0x7a')](this,_0x3ee8b3[_0x342e('0xe0')]);if(!_0x4059c5){return this[_0x342e('0xa')][_0x342e('0x29')](_0x3ee8b3,_0x342e('0xae'));}if(_[_0x342e('0x133')](_0x4f3ce4)){var _0x2f4c60=this;_0x4f3ce4[_0x342e('0xaf')](function(_0x55d2b6,_0x21b79d){_0x2f4c60[_0x342e('0xa')][_0x342e('0x79')](util[_0x342e('0x26')](_0x342e('0x134'),_0x4059c5,_0x21b79d),_0x55d2b6);});return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('variable\x20%s[key]\x20set',_0x4059c5));}else{return this['channel'][_0x342e('0x79')](_0x4059c5,_0x4f3ce4);}};AGIVertices[_0x342e('0xb')][_0x342e('0x135')]=function(_0x28fe6d){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x136'),_0x28fe6d[_0x342e('0x7e')]));if(_0x28fe6d[_0x342e('0x7b')]===0x0){return this[_0x342e('0x7c')](_0x28fe6d);}_0x28fe6d[_0x342e('0x7b')]-=0x1;if(!this['isConfigured'](_0x28fe6d[_0x342e('0xdd')])){return this[_0x342e('0xa')]['error'](_0x28fe6d,_0x342e('0xde'));}var _0x19ff66=this['getSound'][_0x342e('0x7a')](this,_0x28fe6d[_0x342e('0xdd')]);if(!_0x19ff66){return this[_0x342e('0xa')][_0x342e('0x29')](_0x28fe6d,_0x342e('0xdf'));}var _0x30250c=this[_0x342e('0xa')][_0x342e('0xe1')](_0x19ff66,_0x28fe6d['response'],_0x28fe6d[_0x342e('0x137')]);var _0x464668=_0x30250c[_0x342e('0x78')];if(_0x30250c[_0x342e('0x78')]===-0x1){this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x28fe6d,'-1');return _0x30250c;}else if(_0x30250c[_0x342e('0x75')]===_0x342e('0x81')){_0x30250c[_0x342e('0x78')]=_0x30250c[_0x342e('0x78')][_0x342e('0x72')]>0x0?_0x30250c[_0x342e('0x78')]:'t';}else if(_[_0x342e('0x40')](_0x30250c[_0x342e('0x78')])){_0x30250c[_0x342e('0x78')]='#';_0x464668='#';}if(!this[_0x342e('0x5d')](_0x28fe6d['variable_id'])){this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0xad'));}else{var _0x475b4f=this[_0x342e('0xe6')][_0x342e('0x7a')](this,_0x28fe6d[_0x342e('0xe0')]);if(!_0x475b4f){return this[_0x342e('0xa')]['error'](_0x28fe6d,_0x342e('0xae'));}this[_0x342e('0xa')][_0x342e('0x79')](_0x475b4f,_0x464668);}this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x28fe6d,_0x464668);return _0x30250c;};AGIVertices[_0x342e('0xb')][_0x342e('0x85')]=function(_0x220f63){logger['info'](util[_0x342e('0x26')](_0x342e('0x138'),_0x220f63[_0x342e('0x7e')]));return this[_0x342e('0xa')][_0x342e('0x85')](_0x220f63[_0x342e('0x139')]||_0x220f63[_0x342e('0x7e')]);};AGIVertices[_0x342e('0xb')][_0x342e('0x13a')]=function(_0x577758){logger[_0x342e('0x2b')](util['format'](_0x342e('0x13b'),_0x577758[_0x342e('0x7e')]));if(!this['isConfigured'](_0x577758[_0x342e('0x126')])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x577758,'no\x20find\x20by\x20configured');}logger['info'](util[_0x342e('0x26')](_0x342e('0x127'),this[_0x342e('0xa')][_0x342e('0x36')],_0x577758[_0x342e('0x126')]));var _0x522d87=this[_0x342e('0x48')]['sync'](this,_0x577758[_0x342e('0x13c')]);var _0x3b9622=this[_0x342e('0x4b')][_0x342e('0x7a')](this,_0x577758['findBy'],_0x522d87);if(_0x3b9622){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x128'),this['channel']['callerid'],_0x577758[_0x342e('0x126')]));this['channel'][_0x342e('0x85')](util['format'](_0x342e('0x128'),this['channel'][_0x342e('0x36')],_0x577758[_0x342e('0x126')]));return{'code':0xc8,'result':'success'};}else{logger[_0x342e('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x342e('0x36')],_0x577758[_0x342e('0x126')]));this[_0x342e('0xa')]['noop'](util['format'](_0x342e('0x128'),this[_0x342e('0xa')][_0x342e('0x36')],_0x577758[_0x342e('0x126')]));return{'code':0xc8,'result':_0x342e('0x12b')};}};AGIVertices[_0x342e('0xb')][_0x342e('0x13d')]=function(_0x353ca3){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x13e'),_0x353ca3[_0x342e('0x7e')]));if(!this['isConfigured'](_0x353ca3[_0x342e('0xdd')])){return this[_0x342e('0xa')]['error'](_0x353ca3,_0x342e('0xde'));}var _0x2c06dc=this['getSound'][_0x342e('0x7a')](this,_0x353ca3[_0x342e('0xdd')]);if(!_0x2c06dc){return this[_0x342e('0xa')][_0x342e('0x29')](_0x353ca3,'no\x20file\x20audio\x20found');}var _0x25ceb0=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0x13f'),[_0x2c06dc,_0x353ca3['opts']]);if(_0x25ceb0['result']===-0x1){return _0x25ceb0;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('Executed\x20command\x20%s\x20%s',_0x342e('0x13f'),_0x2c06dc));};AGIVertices['prototype'][_0x342e('0x140')]=function(_0x4f1470){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x141'),_0x4f1470['label']));if(!this[_0x342e('0x5d')](_0x4f1470[_0x342e('0x142')])){return this['channel'][_0x342e('0x29')](_0x4f1470,_0x342e('0x143'));}var _0xde1f9e='';var _0x28a7b1=parseInt(_0x4f1470['queue_id'],0xa);if(isNaN(_0x28a7b1)){_0xde1f9e=_0x4f1470[_0x342e('0x142')];}else{_0xde1f9e=this[_0x342e('0x10')][_0x342e('0x7a')](this,_0x4f1470[_0x342e('0x142')]);if(!_0xde1f9e){return this['channel'][_0x342e('0x29')](_0x4f1470,_0x342e('0x144'));}}var _0x1de8c6='';if(this[_0x342e('0x5d')](_0x4f1470[_0x342e('0xdd')])){var _0x1e2e4f=this[_0x342e('0x19')][_0x342e('0x7a')](this,_0x4f1470[_0x342e('0xdd')]);if(_0x1e2e4f){_0x1de8c6=_0x1e2e4f;}}this['createSquareDetailsReport']['sync'](this,_0x4f1470,_0xde1f9e);if(_0x4f1470[_0x342e('0xb8')][_0x342e('0x145')]('x')<0x0){_0x4f1470[_0x342e('0xb8')]+='x';}if(_0x4f1470[_0x342e('0xb8')]['indexOf']('X')<0x0){_0x4f1470[_0x342e('0xb8')]+='X';}this[_0x342e('0xa')]['setVariable'](_0x342e('0x146'),_0xde1f9e?_0xde1f9e[_0x342e('0x147')]():'');var _0x33015b=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0x148'),[_0xde1f9e,_0x4f1470['opts'],_0x4f1470[_0x342e('0xda')],_0x1de8c6,_0x4f1470[_0x342e('0x81')],_0x4f1470[_0x342e('0x6')],_0x4f1470['macro'],_0x4f1470[_0x342e('0x149')],'',_0x4f1470[_0x342e('0x14a')]]);if(_0x33015b['result']===-0x1){return _0x33015b;}return this['channel'][_0x342e('0x85')](util[_0x342e('0x26')]('Executed\x20command\x20%s\x20%s',_0x342e('0x148'),_0xde1f9e));};AGIVertices[_0x342e('0xb')][_0x342e('0x14b')]=function(_0x3e23db){logger['info'](util[_0x342e('0x26')](_0x342e('0x14c'),_0x3e23db[_0x342e('0x7e')]));var _0x20cbd8=_0x3e23db[_0x342e('0x14d')]||_0x342e('0x100');var _0x32cff=util[_0x342e('0x26')](_0x342e('0x14e'),this[_0x342e('0xa')][_0x342e('0x34')],rs[_0x342e('0xe9')](0x5));var _0x5000e8=util[_0x342e('0x26')](_0x342e('0x14f'),FILES_PATH,_0x32cff,_0x20cbd8);var _0x10b1f=util[_0x342e('0x26')](_0x342e('0x101'),FILES_PATH,_0x32cff);this[_0x342e('0x37')][_0x342e('0x7a')](this,_0x3e23db,_0x32cff,_0x5000e8);this['channel']['setVariable']('RECORDING_SAVENAME',_0x32cff);logger[_0x342e('0x2b')](_0x342e('0x150'),_0x10b1f,_0x20cbd8,_0x3e23db[_0x342e('0x151')],_0x3e23db[_0x342e('0x81')]);return this[_0x342e('0xa')]['recordFile'](_0x10b1f,_0x20cbd8,_0x3e23db[_0x342e('0x151')],_0x3e23db['timeout'],undefined,!![]);};AGIVertices[_0x342e('0xb')][_0x342e('0x152')]=function(_0x1f236e){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x153'),_0x1f236e['label']));return this['channel'][_0x342e('0x154')](_0x1f236e[_0x342e('0x155')]['replace'](/\s+/g,''),_0x1f236e[_0x342e('0x151')]);};AGIVertices[_0x342e('0xb')]['saynumber']=function(_0x22ce0b){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x156'),_0x22ce0b[_0x342e('0x7e')]));return this[_0x342e('0xa')][_0x342e('0x157')](_0x22ce0b[_0x342e('0x158')][_0x342e('0xaa')](/\s+/g,''),_0x22ce0b['escape_digits']);};AGIVertices['prototype'][_0x342e('0x159')]=function(_0xb30df){logger['info'](util[_0x342e('0x26')](_0x342e('0x15a'),_0xb30df[_0x342e('0x7e')]));return this['channel'][_0x342e('0x15b')](_0xb30df[_0x342e('0x54')],_0xb30df[_0x342e('0x151')]);};AGIVertices[_0x342e('0xb')][_0x342e('0x15c')]=function(_0x3203b4){logger['info'](util['format'](_0x342e('0x15d'),_0x3203b4[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x3203b4[_0x342e('0x15e')])){return this[_0x342e('0xa')][_0x342e('0x85')]('no\x20mail\x20account\x20configured');}var _0x599fbc=this[_0x342e('0x1d')]['sync'](this,_0x3203b4[_0x342e('0x15e')]);if(!_0x599fbc||!_0x599fbc[_0x342e('0x15f')]){return this['channel'][_0x342e('0x29')](_0x3203b4,_0x342e('0x160'));}var _0x1bb549={'from':util[_0x342e('0x26')](_0x342e('0x161'),_0x599fbc['name'],_0x599fbc[_0x342e('0x162')]||_0x599fbc['Smtp'][_0x342e('0x163')]),'to':_0x3203b4['to']||'','cc':_0x3203b4['cc']||'','bcc':_0x3203b4[_0x342e('0x164')]||'','subject':_0x3203b4['subject'],'html':_0x3203b4[_0x342e('0x54')],'text':_0x3203b4['text']};var _0x210b1f={'tls':{'rejectUnauthorized':![]}};if(_0x599fbc[_0x342e('0x15f')][_0x342e('0x165')]){_0x210b1f[_0x342e('0x165')]=_0x599fbc['Smtp'][_0x342e('0x165')];}else{_0x210b1f[_0x342e('0x166')]=_0x599fbc['Smtp'][_0x342e('0x166')];_0x210b1f['port']=_0x599fbc['Smtp'][_0x342e('0x167')];_0x210b1f[_0x342e('0x168')]=_0x599fbc[_0x342e('0x15f')]['secure'];}if(_0x599fbc[_0x342e('0x15f')]['authentication']){_0x210b1f[_0x342e('0x169')]={'user':_0x599fbc[_0x342e('0x15f')][_0x342e('0x163')],'pass':_0x599fbc[_0x342e('0x15f')][_0x342e('0x16a')]};}if(this[_0x342e('0x5d')](_0x3203b4[_0x342e('0x16b')])){}logger[_0x342e('0xb4')](_0x342e('0x16c'),JSON[_0x342e('0xe4')](_0x1bb549));this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x3203b4,_0x3203b4['account_id']);this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x16d'),_0x599fbc[_0x342e('0xe')]));this[_0x342e('0x1f')]['sync'](this,_0x210b1f,_0x1bb549);return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x16e'));};AGIVertices['prototype']['sendFax']=function(_0x2aa5a1){logger['info'](util[_0x342e('0x26')](_0x342e('0x16f'),_0x2aa5a1[_0x342e('0x7e')]));return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x170'));};AGIVertices['prototype']['sendSMS']=function(_0x252b3c){logger[_0x342e('0x2b')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x252b3c[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x252b3c[_0x342e('0x171')])){return this[_0x342e('0xa')]['noop'](_0x342e('0x172'));}var _0x2507e4=this[_0x342e('0x30')]['sync'](this,_0x252b3c[_0x342e('0x171')]);if(!_0x2507e4){return this['channel']['error'](_0x252b3c,_0x342e('0x173'));}var _0x2e0b31={'body':_0x252b3c[_0x342e('0x174')],'phone':_0x252b3c['to']||'','SmsAccountId':_0x2507e4['id']};logger[_0x342e('0xb4')](_0x342e('0x175'),JSON['stringify'](_0x2e0b31));this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x252b3c,_0x252b3c[_0x342e('0x171')]);this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x176'),_0x2507e4[_0x342e('0xe')]));this['createSmsMessage'][_0x342e('0x7a')](this,_0x2e0b31);return this[_0x342e('0xa')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x342e('0x177')]=function(_0xf882b){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x178'),_0xf882b[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0xf882b['variable_id'])){return this[_0x342e('0xa')][_0x342e('0x29')](_0xf882b,_0x342e('0x179'));}var _0x302c82=this[_0x342e('0xe6')][_0x342e('0x7a')](this,_0xf882b[_0x342e('0xe0')]);if(!_0x302c82){return this[_0x342e('0xa')][_0x342e('0x29')](_0xf882b,'no\x20variable\x20found');}return this[_0x342e('0xa')][_0x342e('0x79')](_0x302c82,_0xf882b[_0x342e('0x17a')]);};AGIVertices[_0x342e('0xb')][_0x342e('0x17b')]=function(_0x129121){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x17c'),_0x129121[_0x342e('0x7e')]));this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x17d'));if(_0x129121[_0x342e('0x82')]==='yes'){this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x17e'));return this[_0x342e('0xa')][_0x342e('0x82')]();}return this[_0x342e('0xa')][_0x342e('0x85')](_0x342e('0x17f'));};AGIVertices[_0x342e('0xb')][_0x342e('0x180')]=function(_0x27e543){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x181'),_0x27e543[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x27e543[_0x342e('0x182')])){return this['channel']['error'](_0x27e543,_0x342e('0x183'));}var _0x1f3dbc=this[_0x342e('0x184')][_0x342e('0x7a')](this,_0x27e543[_0x342e('0x182')]);if(!this[_0x342e('0x5d')](_0x1f3dbc)){return this[_0x342e('0xa')][_0x342e('0x29')](_0x27e543,util[_0x342e('0x26')](_0x342e('0x185'),_0x27e543['project_id']));}if(_0x1f3dbc===this['channel'][_0x342e('0x35')]){return this[_0x342e('0xa')][_0x342e('0x29')](_0x27e543,_0x342e('0x186'));}this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x27e543,_0x1f3dbc);var _0x371c0a=this['channel'][_0x342e('0x89')](_0x342e('0x187'),util['format'](_0x342e('0x188'),config[_0x342e('0x6')][_0x342e('0x166')]||'127.0.0.1',_0x1f3dbc,this[_0x342e('0xa')]['arg_1']));if(_0x371c0a['result']===-0x1){return _0x371c0a;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('Executed\x20command\x20%s\x20%s',_0x342e('0x187'),_0x1f3dbc));};AGIVertices[_0x342e('0xb')][_0x342e('0x189')]=function(_0x27156d){logger[_0x342e('0x2b')](util['format'](_0x342e('0x18a'),_0x27156d[_0x342e('0x7e')]));var _0x1198de=this[_0x342e('0x51')][_0x342e('0x7a')](this,_0x27156d[_0x342e('0x7f')]);this[_0x342e('0x33')][_0x342e('0x7a')](this,_0x27156d,_0x27156d[_0x342e('0x7f')]);if(this[_0x342e('0x5d')](_0x27156d['variable_id'])){var _0x16a44a=this['getVariable'][_0x342e('0x7a')](this,_0x27156d[_0x342e('0xe0')]);if(_0x16a44a){this[_0x342e('0xa')]['setVariable'](_0x16a44a,_0x1198de);return this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0x18b'),_0x27156d[_0x342e('0x7f')],_0x16a44a));}}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x27156d['command']));};AGIVertices[_0x342e('0xb')][_0x342e('0x18c')]=function(_0x31ddc4){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x18d'),_0x31ddc4[_0x342e('0x7e')]));if(!this['isConfigured'](_0x31ddc4[_0x342e('0x54')])){return this[_0x342e('0xa')][_0x342e('0x85')]('no\x20text\x20configured');}this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')]('Trying\x20Google\x20TTS\x20%s',_0x31ddc4['text']));var _0x3e2e6c=this[_0x342e('0x53')]['sync'](this,_0x31ddc4);if(_0x3e2e6c){this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x3e2e6c));var _0x348958=this['channel'][_0x342e('0xce')](_0x3e2e6c);try{fs['unlink'](_0x3e2e6c+_0x342e('0xd0'));}catch(_0x55708e){logger['error'](_0x55708e);}return _0x348958;}return this[_0x342e('0xa')][_0x342e('0x29')](_0x31ddc4,_0x342e('0x18e'));};AGIVertices[_0x342e('0xb')][_0x342e('0x18f')]=function(_0x2033cd){logger[_0x342e('0x2b')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2033cd[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x2033cd[_0x342e('0x126')])){return this[_0x342e('0xa')]['error'](_0x2033cd,_0x342e('0x12e'));}logger[_0x342e('0x2b')](util[_0x342e('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x342e('0xa')][_0x342e('0x36')],_0x2033cd[_0x342e('0x126')]));var _0x98633d=this[_0x342e('0x4c')]['sync'](this,_0x2033cd[_0x342e('0x126')]);if(_0x98633d){logger[_0x342e('0x2b')](util[_0x342e('0x26')](_0x342e('0x128'),this[_0x342e('0xa')][_0x342e('0x36')],_0x2033cd[_0x342e('0x126')]));this['channel'][_0x342e('0x85')](util[_0x342e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x342e('0xa')]['callerid'],_0x2033cd['findBy']));return{'code':0xc8,'result':_0x342e('0x129')};}else{logger[_0x342e('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x342e('0xa')][_0x342e('0x36')],_0x2033cd[_0x342e('0x126')]));this[_0x342e('0xa')]['noop'](util[_0x342e('0x26')](_0x342e('0x12a'),this[_0x342e('0xa')][_0x342e('0x36')],_0x2033cd[_0x342e('0x126')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x342e('0xb')][_0x342e('0x190')]=function(_0x581409){logger[_0x342e('0x2b')](util[_0x342e('0x26')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x581409['label']));var _0xee4b5b=this[_0x342e('0xa')][_0x342e('0x89')](_0x342e('0x191'),[_0x581409[_0x342e('0x192')],_0x581409[_0x342e('0x8b')]]);if(_0xee4b5b['result']===-0x1){return _0xee4b5b;}return this[_0x342e('0xa')][_0x342e('0x85')](util[_0x342e('0x26')](_0x342e('0x8c'),_0x342e('0x191'),_0x581409['mailbox']));};AGIVertices[_0x342e('0xb')][_0x342e('0x193')]=function(_0x25126a){logger[_0x342e('0x2b')](util['format'](_0x342e('0x194'),_0x25126a[_0x342e('0x7e')]));if(!this[_0x342e('0x5d')](_0x25126a['variable_id'])){return this[_0x342e('0xa')][_0x342e('0x29')](_0x25126a,_0x342e('0x179'));}var _0x440ee4=this[_0x342e('0xe6')][_0x342e('0x7a')](this,_0x25126a[_0x342e('0xe0')]);if(!_0x440ee4){return this['channel'][_0x342e('0x29')](_0x25126a,_0x342e('0xae'));}var _0x343cf6=this[_0x342e('0xa')]['getVariable'](_0x440ee4);return{'code':0xc8,'result':_0x343cf6[_0x342e('0x75')]?_0x343cf6[_0x342e('0x75')]:'-'};};String[_0x342e('0xb')][_0x342e('0x74')]=function(_0x2d78fd,_0x489b34){return this[_0x342e('0x73')](_0x2d78fd)[_0x342e('0x195')](_0x489b34);};module[_0x342e('0x196')]=AGIVertices; \ No newline at end of file +var _0xd954=['no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','getSound','PLAYBACK','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','subject','service','host','port','secure','auth','user','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Trying\x20SendSMS\x20with\x20account\x20%s','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','subproject','project_id','no\x20subproject\x20selected','getSquareProject','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','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','path','util','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','./scripts','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','map','Intervals','interval','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','phone','callback','scheduledAt','callback_priority','getPauseById','agentPause','agent','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleTTS','google_tts_language','googleDialogflow','key','text','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','toString','getAndSetVariable','result','format','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','sync','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','noop','Executed\x20command\x20%s\x20%s','options','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','password','out','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','url','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','response','test','stringify','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','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','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','beep','NOBEEP','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','gotoc','continueAt','gotoif','condition'];(function(_0x48bae4,_0x3502fe){var _0x210760=function(_0x3b273e){while(--_0x3b273e){_0x48bae4['push'](_0x48bae4['shift']());}};_0x210760(++_0x3502fe);}(_0xd954,0x82));var _0x4d95=function(_0x3748ab,_0x13059e){_0x3748ab=_0x3748ab-0x0;var _0x3aca73=_0xd954[_0x3748ab];return _0x3aca73;};'use strict';var fs=require('fs');var path=require(_0x4d95('0x0'));var util=require(_0x4d95('0x1'));var _=require(_0x4d95('0x2'));var sh=require('shelljs');var odbc=require(_0x4d95('0x3'))();var rs=require(_0x4d95('0x4'));var moment=require(_0x4d95('0x5'));var Mustache=require(_0x4d95('0x6'));var logger=require(_0x4d95('0x7'))(_0x4d95('0x8'));var config=require('../../config/environment');var scripts=require(_0x4d95('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x4d95('0xa'),_0x4d95('0xb'),'getsecretdigits'];var AGIVertices=function(_0x244908,_0x8d6ec6,_0x3d1ae1){this[_0x4d95('0xc')]=_0x244908;this[_0x4d95('0xd')]=_0x8d6ec6;this[_0x4d95('0xe')]=_0x3d1ae1;};AGIVertices[_0x4d95('0xf')][_0x4d95('0x10')]=function(_0x9aec50,_0x47fc5f){this[_0x4d95('0xd')][_0x4d95('0x11')](_0x9aec50)[_0x4d95('0x12')](function(_0x872bcb){_0x47fc5f(null,_0x872bcb?_0x872bcb['name']:![]);})[_0x4d95('0x13')](function(_0x329362){_0x47fc5f(_0x329362);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x14')]=function(_0x40786d,_0x248f74){this[_0x4d95('0xd')][_0x4d95('0x15')](_0x40786d)[_0x4d95('0x12')](function(_0x12e3b3){_0x248f74(null,_0x12e3b3?_0x12e3b3[_0x4d95('0x16')]:![]);})['catch'](function(_0x261490){_0x248f74(_0x261490);});};AGIVertices[_0x4d95('0xf')]['getSquareProject']=function(_0x494141,_0x27df40){this[_0x4d95('0xd')][_0x4d95('0x17')](_0x494141)[_0x4d95('0x12')](function(_0x3fa63c){_0x27df40(null,_0x3fa63c?_0x3fa63c[_0x4d95('0x16')]:![]);})[_0x4d95('0x13')](function(_0x2238f2){_0x27df40(_0x2238f2);});};AGIVertices['prototype'][_0x4d95('0x18')]=function(_0x54f174,_0x367bb7){this[_0x4d95('0xd')][_0x4d95('0x19')](_0x54f174)[_0x4d95('0x12')](function(_0x288589){_0x367bb7(null,_0x288589?_0x288589[_0x4d95('0x1a')]:![]);})[_0x4d95('0x13')](function(_0x1d94c3){_0x367bb7(_0x1d94c3);});};AGIVertices['prototype'][_0x4d95('0x1b')]=function(_0x2ce11d,_0x189ea6){this[_0x4d95('0xd')][_0x4d95('0x1c')](_0x2ce11d)[_0x4d95('0x12')](function(_0x47356f){_0x189ea6(null,_0x47356f?_0x47356f['name']:![]);})[_0x4d95('0x13')](function(_0x5bdc1a){_0x189ea6(_0x5bdc1a);});};AGIVertices['prototype']['getTrunk']=function(_0x295a54,_0x5c96db){this[_0x4d95('0xd')][_0x4d95('0x1d')](_0x295a54)[_0x4d95('0x12')](function(_0x448af4){_0x5c96db(null,_0x448af4?_0x448af4[_0x4d95('0x16')]:![]);})[_0x4d95('0x13')](function(_0x5a2ae6){_0x5c96db(_0x5a2ae6);});};AGIVertices[_0x4d95('0xf')]['getSound']=function(_0x1ed227,_0x5895fa){var _0x4a7d60=this;this[_0x4d95('0xd')][_0x4d95('0x1e')](_0x1ed227)['then'](function(_0x140601){_0x5895fa(null,_0x140601?_0x4a7d60['getSoundPath'](_0x140601[_0x4d95('0x1f')]):![]);})[_0x4d95('0x13')](function(_0x46ed68){_0x5895fa(_0x46ed68);});};AGIVertices['prototype'][_0x4d95('0x20')]=function(_0x5a85db,_0x4e2ffe){this[_0x4d95('0xd')][_0x4d95('0x21')](_0x5a85db)[_0x4d95('0x12')](function(_0x5f36b1){_0x4e2ffe(null,_0x5f36b1?_0x5f36b1:![]);})[_0x4d95('0x13')](function(_0x10b02e){_0x4e2ffe(_0x10b02e);});};AGIVertices[_0x4d95('0xf')]['sendMailMessage']=function(_0x110f8d,_0x1dd8be,_0x4fe508){this['mailRpc']['sendMailMessage'](_0x110f8d,_0x1dd8be)[_0x4d95('0x12')](function(){_0x4fe508(null);})[_0x4d95('0x13')](function(_0x1afa52){_0x4fe508(_0x1afa52);});};AGIVertices['prototype'][_0x4d95('0x22')]=function(_0x58f389,_0x2c12d5){this['rpc'][_0x4d95('0x23')](_0x58f389)[_0x4d95('0x12')](function(_0x9fc69b){if(_0x9fc69b){if(_0x9fc69b['IntervalId']){_0x2c12d5(null,[_0x9fc69b['interval']]);}else{_0x2c12d5(null,_[_0x4d95('0x24')](_0x9fc69b[_0x4d95('0x25')],_0x4d95('0x26')));}}else{_0x2c12d5(null,![]);}})[_0x4d95('0x13')](function(_0x4cbe18){_0x2c12d5(_0x4cbe18);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x27')]=function(_0x1f7536){return util['format'](_0x4d95('0x28'),FILES_PATH,_0x1f7536);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x29')]=function(_0x4f3a79,_0x357872,_0x5bb007){odbc[_0x4d95('0x2a')](_0x4f3a79,function(_0x3e59ad){if(_0x3e59ad){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3e59ad);_0x5bb007(_0x3e59ad);}else{logger[_0x4d95('0x2b')](_0x4d95('0x2c'));odbc['query'](_0x357872,function(_0x4c0a40,_0x42814c){if(_0x4c0a40){logger[_0x4d95('0x2b')](_0x4d95('0x2d'),_0x357872);_0x5bb007(_0x4c0a40);}else{logger[_0x4d95('0x2b')](_0x4d95('0x2e'),_0x357872);odbc['close'](function(_0x33f180){if(_0x33f180){logger[_0x4d95('0x2f')](_0x4d95('0x30'),_0x33f180);}_0x5bb007(null,_0x42814c);});}});}});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x31')]=function(_0x2613cd,_0x2266ca){this[_0x4d95('0xd')]['getSmsAccountById'](_0x2613cd)[_0x4d95('0x12')](function(_0x1c37c2){_0x2266ca(null,_0x1c37c2?_0x1c37c2:![]);})[_0x4d95('0x13')](function(_0x599264){_0x2266ca(_0x599264);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x32')]=function(_0x38a57b,_0x7b4f44){this['rpc'][_0x4d95('0x32')](_0x38a57b)['then'](function(_0x3c5f5e){_0x7b4f44(null,_0x3c5f5e);})[_0x4d95('0x13')](function(_0x168e7e){_0x7b4f44(_0x168e7e);});};AGIVertices['prototype'][_0x4d95('0x33')]=function(_0x5be6de,_0x49d5af,_0x449d70){this[_0x4d95('0xd')][_0x4d95('0x33')]({'uniqueid':this[_0x4d95('0xc')]['uniqueid'],'node':_0x5be6de[_0x4d95('0x34')],'application':_0x5be6de[_0x4d95('0x35')],'data':_0x49d5af||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x4d95('0xc')][_0x4d95('0x36')]})[_0x4d95('0x12')](function(_0x4ff30c){if(_0x449d70){_0x449d70(null,_0x4ff30c);}})['catch'](function(_0x2107ec){if(_0x449d70){_0x449d70(_0x2107ec);}});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x37')]=function(_0x5afac9,_0x1b230a,_0x19d309,_0x181ddd){this[_0x4d95('0xd')][_0x4d95('0x37')]({'uniqueid':this[_0x4d95('0xc')][_0x4d95('0x38')],'callerid':this[_0x4d95('0xc')][_0x4d95('0x36')],'calleridname':this[_0x4d95('0xc')][_0x4d95('0x39')],'context':this[_0x4d95('0xc')][_0x4d95('0x3a')],'extension':this[_0x4d95('0xc')][_0x4d95('0x3b')],'priority':this[_0x4d95('0xc')][_0x4d95('0x3c')],'accountcode':this[_0x4d95('0xc')][_0x4d95('0x3d')],'dnid':this[_0x4d95('0xc')][_0x4d95('0x3e')],'projectName':this[_0x4d95('0xc')][_0x4d95('0x3f')],'saveName':_0x1b230a,'filename':_0x5afac9[_0x4d95('0x40')]||_0x1b230a,'savePath':_0x19d309})['then'](function(_0x3ae720){_0x181ddd(null,_0x3ae720);})['catch'](function(_0x19eb2e){_0x181ddd(_0x19eb2e);});};AGIVertices[_0x4d95('0xf')]['createSquareMessage']=function(_0x522e4b,_0x24cb7f,_0x448c5c){this[_0x4d95('0xd')][_0x4d95('0x41')]({'uniqueid':this['channel'][_0x4d95('0x38')],'body':_0x522e4b,'direction':_0x24cb7f})[_0x4d95('0x12')](function(_0x2183d9){if(_0x448c5c){_0x448c5c(null,_0x2183d9);}})[_0x4d95('0x13')](function(_0x5e7509){if(_0x448c5c){_0x448c5c(_0x5e7509);}});};AGIVertices[_0x4d95('0xf')]['createCmContact']=function(_0x324e6a,_0x13db6c){this['rpc'][_0x4d95('0x42')]({'firstName':_['isEmpty'](_0x324e6a[_0x4d95('0x16')])||_[_0x4d95('0x43')](_0x324e6a[_0x4d95('0x16')])?_0x4d95('0x44')+Math['random']():_0x324e6a[_0x4d95('0x16')],'lastName':_[_0x4d95('0x45')](_0x324e6a[_0x4d95('0x46')])||_['isNil'](_0x324e6a[_0x4d95('0x46')])?null:_0x324e6a[_0x4d95('0x46')],'phone':_0x324e6a[_0x4d95('0x47')],'ListId':_0x324e6a['list_id'],'scheduledAt':_0x324e6a['scheduledAt'],'callbackUniqueid':this[_0x4d95('0xc')][_0x4d95('0x38')],'tags':_0x4d95('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x324e6a[_0x4d95('0x49')]['toString'](),'priority':_0x324e6a[_0x4d95('0x4a')]})[_0x4d95('0x12')](function(_0x551449){_0x13db6c(null,_0x551449);})['catch'](function(_0x556570){_0x13db6c(_0x556570);});};AGIVertices['prototype']['getPause']=function(_0x69b6a2,_0x49c71b){this[_0x4d95('0xd')][_0x4d95('0x4b')](_0x69b6a2)['then'](function(_0x5171b3){_0x49c71b(null,_0x5171b3?_0x5171b3[_0x4d95('0x16')]:![]);})['catch'](function(_0x5a590b){_0x49c71b(_0x5a590b);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x4c')]=function(_0x2e3576,_0x1f0389,_0x228992){var _0x16d15b={'role':'agent'};_0x16d15b[_0x2e3576]=this['channel'][_0x4d95('0x36')];this[_0x4d95('0xd')][_0x4d95('0x4c')](_0x16d15b,_0x1f0389,this[_0x4d95('0xc')][_0x4d95('0x38')])[_0x4d95('0x12')](function(_0x10eca0){_0x228992(null,_[_0x4d95('0x43')](_0x10eca0)?![]:!![]);})[_0x4d95('0x13')](function(_0x403d0b){logger[_0x4d95('0x2f')](_0x403d0b);_0x228992(null,![]);});};AGIVertices[_0x4d95('0xf')]['agentUnpause']=function(_0x2c782f,_0x27300e){var _0x52b985={'role':_0x4d95('0x4d')};_0x52b985[_0x2c782f]=this[_0x4d95('0xc')][_0x4d95('0x36')];this[_0x4d95('0xd')]['agentUnpause'](_0x52b985)[_0x4d95('0x12')](function(_0xdbdf87){_0x27300e(null,_['isNil'](_0xdbdf87)?![]:!![]);})[_0x4d95('0x13')](function(_0x91b639){logger[_0x4d95('0x2f')](_0x91b639);_0x27300e(null,![]);});};AGIVertices['prototype'][_0x4d95('0x4e')]=function(_0x79ea7e,_0x35ba63){var _0xff4e97={'role':_0x4d95('0x4d')};_0xff4e97[_0x79ea7e]=this['channel'][_0x4d95('0x36')];this[_0x4d95('0xd')]['agentLogout'](_0xff4e97)[_0x4d95('0x12')](function(_0x487f60){_0x35ba63(null,_['isNil'](_0x487f60)?![]:!![]);})['catch'](function(_0x5d9e67){logger[_0x4d95('0x2f')](_0x5d9e67);_0x35ba63(null,![]);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x4f')]=function(_0x400063,_0x2770a8){var _0x4a2a1f={'role':_0x4d95('0x4d')};_0x4a2a1f[_0x400063]=this['channel']['callerid'];var _0x4eb3cf=_0x400063!=_0x4d95('0x50')?util['format']('%s/%s@from-sip/n',_0x4d95('0x51'),this[_0x4d95('0xc')]['callerid']):undefined;this['rpc'][_0x4d95('0x4f')](_0x4a2a1f,_0x4eb3cf)[_0x4d95('0x12')](function(_0x391f31){_0x2770a8(null,_['isNil'](_0x391f31)?![]:!![]);})[_0x4d95('0x13')](function(_0x2d3ffe){logger[_0x4d95('0x2f')](_0x2d3ffe);_0x2770a8(null,![]);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x52')]=function(_0x543860,_0xdcab58){sh[_0x4d95('0x53')](_[_0x4d95('0x54')](_0x543860),function(_0x194266,_0x12b3d7){var _0x1289b4=_0x12b3d7[_0x4d95('0x55')](/(\r\n|\n|\r)/gm,'');_0xdcab58(null,_0x1289b4);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x56')]=function(_0x9c10b0,_0x2dc98f){scripts[_0x4d95('0x56')](_0x9c10b0['text'],_0x9c10b0[_0x4d95('0x57')]||'en',0x1)[_0x4d95('0x12')](function(_0x3b0d6e){_0x2dc98f(null,_0x3b0d6e);})[_0x4d95('0x13')](function(_0xe9ea39){_0x2dc98f(_0xe9ea39);});};AGIVertices['prototype'][_0x4d95('0x58')]=function(_0x115b38,_0x2a5972){scripts['googleDialogflow'](this[_0x4d95('0xc')]['uniqueid'],_0x115b38[_0x4d95('0x59')],_0x115b38[_0x4d95('0x5a')],_0x115b38['dialogflow_language']||'en')[_0x4d95('0x12')](function(_0x3112b0){_0x2a5972(null,_0x3112b0);})['catch'](function(_0x3d5ab5){_0x2a5972(_0x3d5ab5);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x5b')]=function(_0x2db33a,_0x4dac6a){scripts[_0x4d95('0x5b')](this[_0x4d95('0xc')],_0x2db33a)['then'](function(_0x45505e){_0x4dac6a(null,_0x45505e);})[_0x4d95('0x13')](function(_0x81137e){_0x4dac6a(_0x81137e);});};AGIVertices['prototype']['ispeechTTS']=function(_0x263f5b,_0x2b857e){scripts[_0x4d95('0x5c')](_0x263f5b[_0x4d95('0x59')],_0x263f5b[_0x4d95('0x5a')],_0x263f5b[_0x4d95('0x5d')]||_0x4d95('0x5e'),_0x263f5b[_0x4d95('0x5f')])['then'](function(_0x13922a){_0x2b857e(null,_0x13922a);})['catch'](function(_0x346e6b){_0x2b857e(_0x346e6b);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x60')]=function(_0x342fea,_0x14573b,_0x16a4c7){scripts[_0x4d95('0x60')](_0x14573b,_0x342fea['key'],_0x342fea[_0x4d95('0x61')]||'en-US',this[_0x4d95('0x62')](_0x342fea[_0x4d95('0x63')])?_0x342fea['model']:undefined)[_0x4d95('0x12')](function(_0x4ee5df){_0x16a4c7(null,_0x4ee5df);})['catch'](function(_0x4638d5){_0x16a4c7(_0x4638d5);});};AGIVertices['prototype'][_0x4d95('0x64')]=function(_0x2a0230,_0x3cd8e1){scripts['awsPolly'](_0x2a0230[_0x4d95('0x65')],_0x2a0230[_0x4d95('0x66')],_0x2a0230[_0x4d95('0x67')],_0x2a0230['aws_polly_voice']||_0x4d95('0x68'),_0x2a0230['text'],_0x2a0230[_0x4d95('0x69')]||'text')[_0x4d95('0x12')](function(_0x1ef7a6){_0x3cd8e1(null,_0x1ef7a6);})[_0x4d95('0x13')](function(_0x54fa70){_0x3cd8e1(_0x54fa70);});};AGIVertices['prototype'][_0x4d95('0x6a')]=function(_0x10ce93,_0x4da560){scripts[_0x4d95('0x6a')](this[_0x4d95('0xc')][_0x4d95('0x38')],_0x10ce93[_0x4d95('0x65')],_0x10ce93[_0x4d95('0x66')],_0x10ce93['aws_lex_region'],_0x10ce93['text'],_0x10ce93[_0x4d95('0x6b')])['then'](function(_0x2c349b){_0x4da560(null,_0x2c349b);})[_0x4d95('0x13')](function(_0x2a681f){_0x4da560(_0x2a681f);});};AGIVertices['prototype']['googleASR']=function(_0x32daf4,_0x4335f3,_0x365c64){scripts[_0x4d95('0x6c')](_0x4335f3,_0x32daf4[_0x4d95('0x59')],_0x32daf4[_0x4d95('0x6d')]||_0x4d95('0x5e'))[_0x4d95('0x12')](function(_0x794b2a){_0x365c64(null,_0x794b2a);})['catch'](function(_0x4a2a3e){_0x365c64(_0x4a2a3e);});};AGIVertices[_0x4d95('0xf')]['tildeASR']=function(_0x5a5a5e,_0x5e1f0e,_0x34b8ff){scripts['tildeASR'](_0x5e1f0e,_0x5a5a5e[_0x4d95('0x6e')],_0x5a5a5e[_0x4d95('0x6f')],_0x5a5a5e[_0x4d95('0x70')])[_0x4d95('0x12')](function(_0x154a6c){_0x34b8ff(null,_0x154a6c);})['catch'](function(_0x404737){_0x34b8ff(_0x404737);});};AGIVertices[_0x4d95('0xf')][_0x4d95('0x71')]=function(_0x343a37){var _0x188b51=_[_0x4d95('0x72')](verticesWithRetry,_0x343a37[_0x4d95('0x35')])?_0x343a37:_[_0x4d95('0x73')](_0x343a37);for(var _0x15fbdc in _0x188b51){if(_0x188b51[_0x4d95('0x74')](_0x15fbdc)){if(_0x188b51[_0x15fbdc]&&_[_0x4d95('0x75')](_0x188b51[_0x15fbdc])){_0x188b51[_0x15fbdc]=this[_0x4d95('0x76')](_0x188b51[_0x15fbdc]);}}}return _0x188b51;};AGIVertices[_0x4d95('0xf')]['replaceAllVariables']=function(_0x179eb7){var _0x29dc8d=_0x179eb7[_0x4d95('0x77')]('{');for(var _0x24a3d2=0x1;_0x24a3d2<_0x29dc8d[_0x4d95('0x78')];_0x24a3d2+=0x1){var _0x3d2392=_0x29dc8d[_0x24a3d2]['split']('}');if(_0x3d2392['length']>0x1){_0x179eb7=_0x179eb7['replaceAll']('{'+_0x3d2392[0x0]+'}',this[_0x4d95('0xc')][_0x4d95('0x10')](_0x3d2392[0x0])['extra']||_0x3d2392[0x0]);}}if(_0x29dc8d[_0x4d95('0x78')]===0x1){return _0x179eb7[_0x4d95('0x79')]();}return this['replaceAllVariables'](_0x179eb7);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x7a')]=function(_0x5342b8,_0xb7221f){var _0x596205=this[_0x4d95('0xc')][_0x4d95('0x10')](_0x5342b8);if(_0x596205[_0x4d95('0x7b')]===-0x1){return _0x596205;}logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x7d'),_0xb7221f,_0x596205[_0x4d95('0x7e')]));return this[_0x4d95('0xc')][_0x4d95('0x7f')](_0xb7221f,_0x596205['extra']);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x62')]=function(_0x577e4d){return _0x577e4d&&_0x577e4d!=='0'&&_0x577e4d!=='-1'&&_0x577e4d!=='';};AGIVertices[_0x4d95('0xf')]['maxRetry']=function(_0x494686){this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x494686,'-');_0x494686[_0x4d95('0x81')]=_0x494686[_0x4d95('0x82')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['agi']=function(_0x15152a){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x83'),_0x15152a['label']));return this[_0x4d95('0xc')][_0x4d95('0x8')]([_0x15152a['command'],_0x15152a[_0x4d95('0x84')]]);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x85')]=function(_0x38b134){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x38b134['label']));if(this[_0x4d95('0x62')](_0x38b134[_0x4d95('0x86')])){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x87'),_0x38b134['timeout']));var _0x33e35e=this[_0x4d95('0xc')][_0x4d95('0x88')](_0x38b134[_0x4d95('0x86')]);if(_0x33e35e[_0x4d95('0x7b')]===-0x1){return _0x33e35e;}}return this['channel']['answer']();};AGIVertices['prototype'][_0x4d95('0x48')]=function(_0x3d1e61){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x89'),_0x3d1e61[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x3d1e61[_0x4d95('0x8a')])){return this[_0x4d95('0xc')]['error'](_0x3d1e61,_0x4d95('0x8b'));}_0x3d1e61[_0x4d95('0x49')]=moment();if(this[_0x4d95('0x62')](_0x3d1e61[_0x4d95('0x8c')])){_0x3d1e61[_0x4d95('0x49')]=moment()[_0x4d95('0x8d')](_0x3d1e61[_0x4d95('0x8c')],_0x4d95('0x8e'));}if(!this[_0x4d95('0x62')](_0x3d1e61[_0x4d95('0x4a')])){_0x3d1e61[_0x4d95('0x4a')]=0x2;}this[_0x4d95('0x42')]['sync'](this,_0x3d1e61);return this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')](_0x4d95('0x8f'),_0x3d1e61[_0x4d95('0x47')],_0x3d1e61['list_id'],_0x3d1e61[_0x4d95('0x49')]));};AGIVertices['prototype'][_0x4d95('0x90')]=function(_0x357247){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x91'),_0x357247[_0x4d95('0x34')]));var _0x15a86f=this[_0x4d95('0xc')][_0x4d95('0x53')](_0x357247[_0x4d95('0x92')],_0x357247['options']);if(_0x15a86f['result']===-0x1){return _0x15a86f;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x94'),_0x357247['application'],_0x357247[_0x4d95('0x95')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x177931){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x96'),_0x177931[_0x4d95('0x34')]));if(!this['isConfigured'](_0x177931[_0x4d95('0x5a')])){return this[_0x4d95('0xc')]['noop'](_0x4d95('0x97'));}var _0x33f080='\x22'+_0x177931['text']+'\x22';if(this['isConfigured'](_0x177931[_0x4d95('0x95')])){_0x33f080+=','+_0x177931[_0x4d95('0x95')];}var _0x275555=this[_0x4d95('0xc')]['exec'](_0x4d95('0x98'),_0x33f080);if(_0x275555[_0x4d95('0x7b')]===-0x1){return _0x275555;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x99'),_0x33f080));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x9a')]=function(_0x4856a7){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x9b'),_0x4856a7['label']));if(!this[_0x4d95('0x62')](_0x4856a7[_0x4d95('0x5a')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x97'));}var _0x21ecd4='\x22'+_0x4856a7['text']+'\x22';if(this['isConfigured'](_0x4856a7['options'])){_0x21ecd4+=','+_0x4856a7[_0x4d95('0x95')];}var _0x521725=this[_0x4d95('0xc')][_0x4d95('0x53')]('MRCPSynth',_0x21ecd4);if(_0x521725[_0x4d95('0x7b')]===-0x1){return _0x521725;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util['format'](_0x4d95('0x99'),_0x21ecd4));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x9c')]=function(_0x11fc44){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x9d'),_0x11fc44[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x11fc44[_0x4d95('0x9e')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x9f'));}var _0x3e0b4c=_0x11fc44['grammar'];if(this[_0x4d95('0x62')](_0x11fc44[_0x4d95('0x95')])){_0x3e0b4c+=','+_0x11fc44['options'];}var _0x13ac44=this[_0x4d95('0xc')][_0x4d95('0x53')]('MRCPRecog',_0x3e0b4c);if(_0x13ac44[_0x4d95('0x7b')]===-0x1){return _0x13ac44;}var _0x4dd982=this['getAndSetVariable'](_0x4d95('0xa0'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4dd982[_0x4d95('0x7b')]===-0x1){return _0x4dd982;}var _0x49f09e=this['getAndSetVariable']('RECOG_INPUT()',_0x4d95('0xa1'));if(_0x49f09e[_0x4d95('0x7b')]===-0x1){return _0x49f09e;}var _0x3fdbf0=this[_0x4d95('0x7a')]('RECOG_INSTANCE()',_0x4d95('0xa2'));if(_0x3fdbf0[_0x4d95('0x7b')]===-0x1){return _0x3fdbf0;}return this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3e0b4c));};AGIVertices[_0x4d95('0xf')]['sestekasr']=function(_0x3af70a){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0xa3'),_0x3af70a[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x3af70a['grammar'])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x9f'));}var _0x44fbcb=_0x3af70a[_0x4d95('0x9e')];if(this[_0x4d95('0x62')](_0x3af70a[_0x4d95('0x95')])){_0x44fbcb+=','+_0x3af70a[_0x4d95('0x95')];}var _0x5f2576=this[_0x4d95('0xc')]['exec'](_0x4d95('0xa4'),_0x44fbcb);if(_0x5f2576[_0x4d95('0x7b')]===-0x1){return _0x5f2576;}var _0x68106d=this[_0x4d95('0x7a')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x68106d[_0x4d95('0x7b')]===-0x1){return _0x68106d;}var _0x15568e=this[_0x4d95('0x7a')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x15568e[_0x4d95('0x7b')]===-0x1){return _0x15568e;}var _0x3c4a0d=this[_0x4d95('0x7a')](_0x4d95('0xa5'),_0x4d95('0xa6'));if(_0x3c4a0d[_0x4d95('0x7b')]===-0x1){return _0x3c4a0d;}return this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')](_0x4d95('0xa7'),_0x44fbcb));};AGIVertices[_0x4d95('0xf')]['database']=function(_0xc8dde4){logger['info'](util['format'](_0x4d95('0xa8'),_0xc8dde4['label']));if(!this[_0x4d95('0x62')](_0xc8dde4['odbc_id'])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0xc8dde4,_0x4d95('0xa9'));}var _0x278203=this[_0x4d95('0x18')][_0x4d95('0x80')](this,_0xc8dde4[_0x4d95('0xaa')]);if(!_0x278203){return this[_0x4d95('0xc')]['error'](_0xc8dde4,_0x4d95('0xab'));}if(!this['isConfigured'](_0xc8dde4[_0x4d95('0xac')])){return this[_0x4d95('0xc')]['error'](_0xc8dde4,_0x4d95('0xad'));}var _0x3557e9=_0xc8dde4[_0x4d95('0xac')][_0x4d95('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xae'),_0x3557e9));var _0x2cdb3a=this[_0x4d95('0x29')][_0x4d95('0x80')](this,_0x278203,_0x3557e9);this['createSquareDetailsReport'][_0x4d95('0x80')](this,_0xc8dde4,_0x3557e9);if(!this['isConfigured'](_0xc8dde4['variable_id'])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xaf'));}var _0x2e4e48=this[_0x4d95('0x10')][_0x4d95('0x80')](this,_0xc8dde4[_0x4d95('0xb0')]);if(!_0x2e4e48){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0xc8dde4,_0x4d95('0xb1'));}var _0x28e560=this;_0x2cdb3a[_0x4d95('0xb2')](function(_0x27ff9b,_0x9e019f){Object[_0x4d95('0xb3')](_0x27ff9b)[_0x4d95('0xb2')](function(_0xf62c17){_0x28e560['channel'][_0x4d95('0x7f')](util[_0x4d95('0x7c')](_0x4d95('0xb4'),_0x2e4e48,_0x9e019f,_0xf62c17),_0x27ff9b[_0xf62c17]);});});this[_0x4d95('0xc')][_0x4d95('0x7f')](util[_0x4d95('0x7c')](_0x4d95('0xb5'),_0x2e4e48),_0x2cdb3a[_0x4d95('0x78')]);return this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xb6'),_0x2e4e48));};AGIVertices['prototype'][_0x4d95('0xb7')]=function(_0x34249c){logger[_0x4d95('0xb8')](util['format'](_0x4d95('0xb9'),_0x34249c[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x34249c[_0x4d95('0xba')])){return this['channel'][_0x4d95('0x2f')](_0x34249c,_0x4d95('0xbb'));}var _0x5da2e6=this['getUser']['sync'](this,_0x34249c['sip_id']);if(!_0x5da2e6){return this['channel'][_0x4d95('0x2f')](_0x34249c,_0x4d95('0xbc'));}var _0x5ad8a3=this['channel'][_0x4d95('0x53')](_0x4d95('0xbd'),[util[_0x4d95('0x7c')]('SIP/%s',_0x5da2e6),_0x34249c[_0x4d95('0x86')],_0x34249c[_0x4d95('0xbe')],_0x34249c['url']]);if(_0x5ad8a3[_0x4d95('0x7b')]===-0x1){return _0x5ad8a3;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util['format']('Executed\x20command\x20%s',_0x4d95('0xbd')));};AGIVertices[_0x4d95('0xf')]['dialogflow']=function(_0x2bb8ab){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0xbf'),_0x2bb8ab['label']));if(!this[_0x4d95('0x62')](_0x2bb8ab[_0x4d95('0x59')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xc0'));}if(!this[_0x4d95('0x62')](_0x2bb8ab['text'])){return this[_0x4d95('0xc')]['noop']('no\x20text\x20configured');}this['channel'][_0x4d95('0xc1')]=!![];this['createSquareDetailsReport'](_0x2bb8ab);this['createSquareMessage'](_0x2bb8ab['text'],'in');this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('Trying\x20Dialogflow:\x20%s',_0x2bb8ab[_0x4d95('0x5a')]));var _0x16af6e=this[_0x4d95('0x58')][_0x4d95('0x80')](this,_0x2bb8ab);if(_0x16af6e){for(var _0x44fa60 in _0x16af6e){if(_0x16af6e['hasOwnProperty'](_0x44fa60)){this['channel'][_0x4d95('0x7f')](util[_0x4d95('0x7c')](_0x4d95('0xc2'),_0x44fa60[_0x4d95('0xc3')]()),_0x16af6e[_0x44fa60]);}}this[_0x4d95('0x41')](_0x16af6e[_0x4d95('0xc4')],'out');return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('Dialogflow\x20Result\x20%s',_0x16af6e[_0x4d95('0xc4')]));}return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x2bb8ab,_0x4d95('0xc5'));};AGIVertices[_0x4d95('0xf')][_0x4d95('0xc6')]=function(_0x20b2fc){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0xc7'),_0x20b2fc[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x20b2fc['ndauth_url'])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xc8'));}if(!this[_0x4d95('0x62')](_0x20b2fc['username'])){return this[_0x4d95('0xc')][_0x4d95('0x93')]('no\x20username\x20configured');}if(!this[_0x4d95('0x62')](_0x20b2fc[_0x4d95('0xc9')])){return this[_0x4d95('0xc')][_0x4d95('0x93')]('no\x20password\x20configured');}if(!this[_0x4d95('0x62')](_0x20b2fc['ndassistant_url'])){return this['channel'][_0x4d95('0x93')](_0x4d95('0x97'));}this[_0x4d95('0xc')][_0x4d95('0xc1')]=!![];this[_0x4d95('0x33')](_0x20b2fc);this[_0x4d95('0x41')](_0x20b2fc[_0x4d95('0x5a')],'in');this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('Trying\x20SestekNDA:\x20%s',_0x20b2fc['text']));var _0x2d315d=this[_0x4d95('0x5b')]['sync'](this,_0x20b2fc);if(_0x2d315d){for(var _0x1dbd22 in _0x2d315d){if(_0x2d315d[_0x4d95('0x74')](_0x1dbd22)){this[_0x4d95('0xc')][_0x4d95('0x7f')](util[_0x4d95('0x7c')]('SESTEK_NDA_%s',_0x1dbd22[_0x4d95('0xc3')]()),_0x2d315d[_0x1dbd22]);}}this[_0x4d95('0x41')](_0x2d315d['speech'],_0x4d95('0xca'));if(_0x2d315d[_0x4d95('0xcb')]){this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x2d315d['audiofile']));var _0x438e41=this['channel'][_0x4d95('0xcc')](_0x2d315d[_0x4d95('0xcb')]);try{fs[_0x4d95('0xcd')](_0x2d315d[_0x4d95('0xcb')]+_0x4d95('0xce'));}catch(_0x5a8e2c){logger[_0x4d95('0x2f')](_0x5a8e2c);}return _0x438e41;}else{return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('SestekNDA\x20Result\x20%s',_0x2d315d['speech']));}}return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x20b2fc,_0x4d95('0xcf'));};AGIVertices[_0x4d95('0xf')][_0x4d95('0xd0')]=function(_0x2c01d5){logger['info'](util[_0x4d95('0x7c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2c01d5[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x93')]('end');};AGIVertices[_0x4d95('0xf')][_0x4d95('0xd1')]=function(_0x36028d){logger['info'](util[_0x4d95('0x7c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x36028d['label']));var _0x24a278='';if(_0x36028d[_0x4d95('0xd2')]){if(!this['isConfigured'](_0x36028d[_0x4d95('0xd2')])){return this[_0x4d95('0xc')]['error'](_0x36028d,_0x4d95('0xd3'));}else{var _0x219a24=parseInt(_0x36028d[_0x4d95('0xd2')],0xa);if(isNaN(_0x219a24)){_0x24a278=_0x36028d[_0x4d95('0xd2')];}else{_0x24a278=this['getTrunk']['sync'](this,_0x36028d['trunk_id']);if(!_0x24a278){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x36028d,_0x4d95('0xd4'));}}}}else if(_0x36028d['trunk_name']){_0x24a278=_0x36028d[_0x4d95('0xd5')];}else{return this[_0x4d95('0xc')]['error'](_0x36028d,_0x4d95('0xd3'));}var _0x8668ca=this[_0x4d95('0xc')][_0x4d95('0x53')](_0x4d95('0xbd'),[util[_0x4d95('0x7c')]('SIP/%s/%s',_0x24a278,_0x36028d[_0x4d95('0x47')]),_0x36028d[_0x4d95('0x86')],_0x36028d[_0x4d95('0xbe')],_0x36028d[_0x4d95('0xd6')]]);if(_0x8668ca[_0x4d95('0x7b')]===-0x1){return _0x8668ca;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('Executed\x20command\x20%s',_0x4d95('0xbd')));};AGIVertices[_0x4d95('0xf')]['finally']=function(_0x11b80b){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0xd7'),_0x11b80b[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xd8'));};AGIVertices[_0x4d95('0xf')]['getdigits']=function(_0x329b0f){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0xd9'),_0x329b0f['label']));if(_0x329b0f[_0x4d95('0x81')]===0x0){return this[_0x4d95('0x82')](_0x329b0f);}_0x329b0f[_0x4d95('0x81')]-=0x1;if(!this[_0x4d95('0x62')](_0x329b0f[_0x4d95('0xda')])){return this['channel']['error'](_0x329b0f,_0x4d95('0xdb'));}var _0x1abc20=this['getSound']['sync'](this,_0x329b0f['file_id']);if(!_0x1abc20){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x329b0f,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x329b0f[_0x4d95('0xb0')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x579172=this['channel']['getData'](_0x1abc20,_0x329b0f[_0x4d95('0xdc')],_0x329b0f['maxdigit']);var _0x10711a=_0x579172[_0x4d95('0x7b')]?_0x579172['result'][_0x4d95('0x79')]():'';logger[_0x4d95('0x2b')](_0x4d95('0xdd'),JSON[_0x4d95('0xde')](_0x579172));if(_0x579172['result']===-0x1){this['createSquareDetailsReport'][_0x4d95('0x80')](this,_0x329b0f,_0x10711a);return _0x579172;}else if(_0x579172[_0x4d95('0x7e')]===_0x4d95('0x86')){_0x579172[_0x4d95('0x7b')]=_0x10711a[_0x4d95('0x78')]>=parseInt(_0x329b0f[_0x4d95('0xdf')])?'x':'i';}else{_0x579172['result']=_0x10711a[_0x4d95('0x78')]>=parseInt(_0x329b0f[_0x4d95('0xdf')])&&_0x10711a[_0x4d95('0x78')]<=parseInt(_0x329b0f[_0x4d95('0xe0')])?'x':'i';}var _0x47e69b=this[_0x4d95('0x10')][_0x4d95('0x80')](this,_0x329b0f[_0x4d95('0xb0')]);if(!_0x47e69b){return this[_0x4d95('0xc')]['error'](_0x329b0f,'no\x20variable\x20found');}this[_0x4d95('0xc')][_0x4d95('0x7f')](_0x47e69b,_0x10711a);if(this[_0x4d95('0x62')](_0x329b0f['hiddendigitsnum'])){var _0x10691a=parseInt(_0x329b0f[_0x4d95('0xe1')],0xa);var _0x46bd32=rs[_0x4d95('0xe2')]({'charset':'*','length':_0x10691a});var _0x3f375d=_0x10711a[_0x4d95('0x78')];if(_0x3f375d>0x0){if(_0x3f375d>_0x10691a){this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x329b0f,_0x329b0f['hiddendigitspos']===_0x4d95('0xe3')?_0x46bd32+_0x10711a[_0x4d95('0xe4')](_0x10691a):_0x10711a[_0x4d95('0xe4')](0x0,_0x3f375d-_0x10691a)+_0x46bd32);}else{this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x329b0f,rs[_0x4d95('0xe2')]({'charset':'*','length':_0x3f375d}));}}else{this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x329b0f,'');}}else{this['createSquareDetailsReport'][_0x4d95('0x80')](this,_0x329b0f,_0x10711a);}return _0x579172;};AGIVertices['prototype']['getsecretdigits']=function(_0x5dfaf5){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5dfaf5[_0x4d95('0x34')]));return this['getdigits'](_0x5dfaf5);};AGIVertices[_0x4d95('0xf')]['goal']=function(_0x3ad06a){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0xe5'),_0x3ad06a[_0x4d95('0x34')]));this[_0x4d95('0x33')]['sync'](this,_0x3ad06a,_0x3ad06a[_0x4d95('0xe6')]);return this[_0x4d95('0xc')]['noop'](util['format'](_0x4d95('0xe7'),_0x3ad06a[_0x4d95('0xe6')]));};AGIVertices['prototype'][_0x4d95('0xe8')]=function(_0x3248ce){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0xe9'),_0x3248ce[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x3248ce[_0x4d95('0x65')])||!this['isConfigured'](_0x3248ce['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3248ce[_0x4d95('0x5a')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x97'));}this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xea'),_0x3248ce[_0x4d95('0x5a')]));var _0x15c771=this[_0x4d95('0x64')]['sync'](this,_0x3248ce);if(_0x15c771){this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('aws\x20Polly\x20%s\x20file\x20created',_0x15c771));var _0x2d0c39=this[_0x4d95('0xc')][_0x4d95('0xcc')](_0x15c771);try{fs[_0x4d95('0xcd')](_0x15c771+_0x4d95('0xce'));}catch(_0x16ea6e){logger[_0x4d95('0x2f')](_0x16ea6e);}return _0x2d0c39;}return this[_0x4d95('0xc')]['error'](_0x3248ce,_0x4d95('0xeb'));};AGIVertices['prototype'][_0x4d95('0xec')]=function(_0x11fc9b){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0xed'),_0x11fc9b[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x11fc9b[_0x4d95('0x65')])||!this[_0x4d95('0x62')](_0x11fc9b[_0x4d95('0x66')])){return this['channel']['noop'](_0x4d95('0xee'));}if(!this[_0x4d95('0x62')](_0x11fc9b['aws_bot_name'])){return this['channel'][_0x4d95('0x93')](_0x4d95('0xef'));}if(!this[_0x4d95('0x62')](_0x11fc9b[_0x4d95('0x5a')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x97'));}this[_0x4d95('0xc')]['bot']=!![];this['createSquareDetailsReport'](_0x11fc9b);this[_0x4d95('0x41')](_0x11fc9b[_0x4d95('0x5a')],'in');this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xf0'),_0x11fc9b['text']));var _0x360694=this[_0x4d95('0x6a')]['sync'](this,_0x11fc9b);if(_0x360694){for(var _0x2f7cd4 in _0x360694){if(_0x360694[_0x4d95('0x74')](_0x2f7cd4)&&_[_0x4d95('0x75')](_0x360694[_0x2f7cd4])){this[_0x4d95('0xc')][_0x4d95('0x7f')](util[_0x4d95('0x7c')](_0x4d95('0xf1'),_0x2f7cd4[_0x4d95('0xc3')]()),_0x360694[_0x2f7cd4]);}}if(_['isNil'](_0x360694[_0x4d95('0xf2')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xf3'));}else{this[_0x4d95('0x41')](_0x360694[_0x4d95('0xf2')],_0x4d95('0xca'));return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xf4'),_0x360694[_0x4d95('0xf2')]));}}return this['channel']['error'](_0x11fc9b,_0x4d95('0xf5'));};AGIVertices[_0x4d95('0xf')][_0x4d95('0xf6')]=function(_0x41d3c9){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0xf7'),_0x41d3c9[_0x4d95('0x34')],_0x41d3c9[_0x4d95('0x86')]));if(!this[_0x4d95('0x62')](_0x41d3c9[_0x4d95('0x59')])){return this['channel'][_0x4d95('0x93')](_0x4d95('0xc0'));}var _0x433552=_0x4d95('0xf8');var _0x3b17eb=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x4d95('0xe2')](0x4));var _0x4511cc=util[_0x4d95('0x7c')](_0x4d95('0xf9'),_0x3b17eb,_0x433552);var _0x52441e=!![];if(_0x41d3c9['beep']==='NOBEEP'){_0x52441e=![];}var _0x1a03cd=this[_0x4d95('0xc')][_0x4d95('0xfa')](_0x3b17eb,_0x433552,_0x41d3c9['intKey'],_0x41d3c9[_0x4d95('0x86')],undefined,_0x52441e);if(_0x1a03cd[_0x4d95('0x7b')]!==-0x1){this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xfb'),_0x4511cc));var _0x6ce8e1=this[_0x4d95('0x6c')]['sync'](this,_0x41d3c9,_0x4511cc);if(_0x6ce8e1){for(var _0x4901b3 in _0x6ce8e1){if(_0x6ce8e1[_0x4d95('0x74')](_0x4901b3)){this[_0x4d95('0xc')]['setVariable'](util[_0x4d95('0x7c')](_0x4d95('0xfc'),_0x4901b3[_0x4d95('0xc3')]()),_0x6ce8e1[_0x4901b3]);}}return this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0xfd'),JSON['stringify'](_0x6ce8e1)));}}return _0x1a03cd;};AGIVertices[_0x4d95('0xf')]['tildeasr']=function(_0x3d2764){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0xfe'),_0x3d2764[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x3d2764['appid'])){return this['channel'][_0x4d95('0x93')](_0x4d95('0xff'));}if(!this[_0x4d95('0x62')](_0x3d2764['appsecret'])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x100'));}var _0x4b03dd=_0x4d95('0xf8');var _0x12298f=util['format'](_0x4d95('0x101'),FILES_PATH,rs[_0x4d95('0xe2')](0x4));var _0x30711b=util[_0x4d95('0x7c')](_0x4d95('0xf9'),_0x12298f,_0x4b03dd);var _0x22b5ff=!![];if(_0x3d2764[_0x4d95('0x102')]===_0x4d95('0x103')){_0x22b5ff=![];}var _0x117629=this[_0x4d95('0xc')][_0x4d95('0xfa')](_0x12298f,_0x4b03dd,_0x3d2764[_0x4d95('0x104')],_0x3d2764[_0x4d95('0x86')],undefined,_0x22b5ff);if(_0x117629['result']!==-0x1){this[_0x4d95('0xc')]['noop'](util['format'](_0x4d95('0x105'),_0x30711b));var _0x361045=this[_0x4d95('0x106')][_0x4d95('0x80')](this,_0x3d2764,_0x30711b);if(_0x361045){for(var _0x536f82 in _0x361045){if(_0x361045[_0x4d95('0x74')](_0x536f82)){this[_0x4d95('0xc')][_0x4d95('0x7f')](util[_0x4d95('0x7c')](_0x4d95('0x107'),_0x536f82[_0x4d95('0xc3')]()),_0x361045[_0x536f82]);}}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('TildeASR\x20Result\x20%s',JSON[_0x4d95('0xde')](_0x361045)));}}return _0x117629;};AGIVertices['prototype'][_0x4d95('0x108')]=function(_0x3f5758){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3f5758[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x109')](_0x3f5758['context'],_0x3f5758['extension'],_0x3f5758[_0x4d95('0x3c')]);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x10a')]=function(_0x4b3f2f){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4b3f2f[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x4b3f2f[_0x4d95('0x10b')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x4b3f2f,_0x4d95('0x10c'));}try{var _0x1ef261=eval(_0x4b3f2f[_0x4d95('0x10b')])?_0x4d95('0x10d'):_0x4d95('0x10e');this[_0x4d95('0xc')][_0x4d95('0x93')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x4b3f2f[_0x4d95('0x10b')],_0x1ef261));return{'code':0xc8,'result':_0x1ef261};}catch(_0x4ebb23){return{'code':0xc8,'result':_0x4d95('0x10e')};}};AGIVertices[_0x4d95('0xf')][_0x4d95('0x10f')]=function(_0x5c0d79){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x110'),_0x5c0d79[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x5c0d79['interval_id'])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x5c0d79,_0x4d95('0x111'));}var _0x812ed=this['getIntervals'][_0x4d95('0x80')](this,_0x5c0d79[_0x4d95('0x112')]);if(!_0x812ed){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x5c0d79,_0x4d95('0x113'));}for(var _0x57decd=0x0;_0x57decd<_0x812ed[_0x4d95('0x78')];_0x57decd+=0x1){var _0x2e4515=this[_0x4d95('0xc')]['getVariable'](util[_0x4d95('0x7c')](_0x4d95('0x114'),_0x812ed[_0x57decd]));if(_0x2e4515[_0x4d95('0x7b')]===-0x1){return _0x2e4515;}logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('IFTIME\x20%s\x20%s',_0x812ed[_0x57decd],_0x2e4515[_0x4d95('0x7e')]));if(_0x2e4515['extra']==='true'){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x115'),_0x812ed[_0x57decd],_0x4d95('0x10d')));this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')]('IFTIME\x20%s\x20%s',_0x812ed[_0x57decd],_0x4d95('0x10d')));return{'code':0xc8,'result':_0x4d95('0x10d')};}else{logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x115'),_0x812ed[_0x57decd],'false'));this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')](_0x4d95('0x115'),_0x812ed[_0x57decd],_0x4d95('0x10e')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x4d95('0xf')]['hangup']=function(_0x1e7fae){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x116'),_0x1e7fae['label']));return this[_0x4d95('0xc')][_0x4d95('0x117')]();};AGIVertices[_0x4d95('0xf')][_0x4d95('0x118')]=function(_0x3e929c){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x119'),_0x3e929c[_0x4d95('0x34')]));if(!this['isConfigured'](_0x3e929c[_0x4d95('0x59')])){return this['channel'][_0x4d95('0x93')](_0x4d95('0xc0'));}var _0x3ae40d=_0x4d95('0xf8');var _0x4434f9=util[_0x4d95('0x7c')](_0x4d95('0x101'),FILES_PATH,rs[_0x4d95('0xe2')](0x4));var _0x2d0263=util[_0x4d95('0x7c')]('%s.%s',_0x4434f9,_0x3ae40d);var _0x157760=!![];if(_0x3e929c[_0x4d95('0x102')]===_0x4d95('0x103')){_0x157760=![];}var _0x3e585d=this[_0x4d95('0xc')]['recordFile'](_0x4434f9,_0x3ae40d,_0x3e929c[_0x4d95('0x104')],_0x3e929c['timeout'],undefined,_0x157760);if(_0x3e585d[_0x4d95('0x7b')]!==-0x1){this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')]('ispeech\x20%s\x20file\x20created',_0x2d0263));var _0xd95b6e=this['ispeechASR'][_0x4d95('0x80')](this,_0x3e929c,_0x2d0263);if(_0xd95b6e){for(var _0x9bbd3c in _0xd95b6e){if(_0xd95b6e[_0x4d95('0x74')](_0x9bbd3c)){this['channel'][_0x4d95('0x7f')](util[_0x4d95('0x7c')]('ISPEECH_ASR_%s',_0x9bbd3c[_0x4d95('0xc3')]()),_0xd95b6e[_0x9bbd3c]);}}return this['channel']['noop'](util[_0x4d95('0x7c')](_0x4d95('0x11a'),JSON[_0x4d95('0xde')](_0xd95b6e)));}}return _0x3e585d;};AGIVertices['prototype'][_0x4d95('0x11b')]=function(_0x460400){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x11c'),_0x460400[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x460400['key'])){return this['channel'][_0x4d95('0x93')]('no\x20key\x20configured');}if(!this[_0x4d95('0x62')](_0x460400['text'])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x97'));}this[_0x4d95('0xc')][_0x4d95('0x93')](util['format'](_0x4d95('0x11d'),_0x460400[_0x4d95('0x5a')]));var _0x15784e=this[_0x4d95('0x5c')][_0x4d95('0x80')](this,_0x460400);if(_0x15784e){this[_0x4d95('0xc')]['noop'](util['format'](_0x4d95('0x11e'),_0x15784e));var _0x2db88d=this[_0x4d95('0xc')]['streamFile'](_0x15784e,_0x460400[_0x4d95('0x104')]);try{fs[_0x4d95('0xcd')](_0x15784e+'.wav');}catch(_0x4c7fc9){logger[_0x4d95('0x2f')](_0x4c7fc9);}return _0x2db88d;}return this['channel']['error'](_0x460400,_0x4d95('0x11f'));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x120')]=function(_0x1fac19){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x121'),_0x1fac19[_0x4d95('0x34')]));if(!this['isConfigured'](_0x1fac19[_0x4d95('0x122')])){return this[_0x4d95('0xc')]['error'](_0x1fac19,'no\x20find\x20by\x20configured');}logger[_0x4d95('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x4d95('0x36')],_0x1fac19[_0x4d95('0x122')]));var _0x4ca11c=this[_0x4d95('0x4f')]['sync'](this,_0x1fac19[_0x4d95('0x122')]);if(_0x4ca11c){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4d95('0xc')]['callerid'],_0x1fac19[_0x4d95('0x122')]));this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')](_0x4d95('0x123'),this['channel'][_0x4d95('0x36')],_0x1fac19['findBy']));return{'code':0xc8,'result':_0x4d95('0x124')};}else{logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x125'),this['channel']['callerid'],_0x1fac19[_0x4d95('0x122')]));this[_0x4d95('0xc')][_0x4d95('0x93')](util['format'](_0x4d95('0x125'),this[_0x4d95('0xc')][_0x4d95('0x36')],_0x1fac19[_0x4d95('0x122')]));return{'code':0xc8,'result':_0x4d95('0x126')};}};AGIVertices[_0x4d95('0xf')]['logout']=function(_0x52d3c8){logger[_0x4d95('0x2b')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x52d3c8[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x52d3c8['findBy'])){return this['channel']['error'](_0x52d3c8,_0x4d95('0x127'));}logger['info'](util['format'](_0x4d95('0x128'),this[_0x4d95('0xc')][_0x4d95('0x36')],_0x52d3c8[_0x4d95('0x122')]));var _0x465d6f=this[_0x4d95('0x4e')][_0x4d95('0x80')](this,_0x52d3c8[_0x4d95('0x122')]);if(_0x465d6f){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x123'),this[_0x4d95('0xc')]['callerid'],_0x52d3c8[_0x4d95('0x122')]));this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4d95('0xc')][_0x4d95('0x36')],_0x52d3c8['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x125'),this['channel'][_0x4d95('0x36')],_0x52d3c8[_0x4d95('0x122')]));this['channel']['noop'](util[_0x4d95('0x7c')](_0x4d95('0x125'),this[_0x4d95('0xc')]['callerid'],_0x52d3c8[_0x4d95('0x122')]));return{'code':0xc8,'result':_0x4d95('0x126')};}};AGIVertices[_0x4d95('0xf')][_0x4d95('0x129')]=function(_0x1c66aa){logger['info'](util['format'](_0x4d95('0x12a'),_0x1c66aa[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x1c66aa[_0x4d95('0x12b')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x1c66aa,_0x4d95('0x12c'));}this['channel'][_0x4d95('0x93')](util['format'](_0x4d95('0x12d'),_0x1c66aa['operation']));var _0x1ead3d=eval(_0x1c66aa[_0x4d95('0x12b')]);if(!this['isConfigured'](_0x1c66aa[_0x4d95('0xb0')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0xaf'));}var _0x57faa5=this['getVariable'][_0x4d95('0x80')](this,_0x1c66aa[_0x4d95('0xb0')]);if(!_0x57faa5){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x1c66aa,_0x4d95('0xb1'));}if(_[_0x4d95('0x12e')](_0x1ead3d)){var _0x163284=this;_0x1ead3d[_0x4d95('0xb2')](function(_0x7cd56d,_0x5504b3){_0x163284[_0x4d95('0xc')][_0x4d95('0x7f')](util['format'](_0x4d95('0x12f'),_0x57faa5,_0x5504b3),_0x7cd56d);});return this['channel'][_0x4d95('0x93')](util['format'](_0x4d95('0x130'),_0x57faa5));}else{return this[_0x4d95('0xc')][_0x4d95('0x7f')](_0x57faa5,_0x1ead3d);}};AGIVertices[_0x4d95('0xf')][_0x4d95('0xa')]=function(_0x32946f){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x131'),_0x32946f['label']));if(_0x32946f[_0x4d95('0x81')]===0x0){return this[_0x4d95('0x82')](_0x32946f);}_0x32946f[_0x4d95('0x81')]-=0x1;if(!this[_0x4d95('0x62')](_0x32946f['file_id'])){return this['channel'][_0x4d95('0x2f')](_0x32946f,'no\x20file\x20audio\x20selected');}var _0x39f51b=this['getSound'][_0x4d95('0x80')](this,_0x32946f['file_id']);if(!_0x39f51b){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x32946f,_0x4d95('0x132'));}var _0xfb0cd8=this['channel'][_0x4d95('0x133')](_0x39f51b,_0x32946f[_0x4d95('0xdc')],_0x32946f[_0x4d95('0x134')]);var _0x1abb9e=_0xfb0cd8[_0x4d95('0x7b')];if(_0xfb0cd8[_0x4d95('0x7b')]===-0x1){this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x32946f,'-1');return _0xfb0cd8;}else if(_0xfb0cd8[_0x4d95('0x7e')]===_0x4d95('0x86')){_0xfb0cd8[_0x4d95('0x7b')]=_0xfb0cd8[_0x4d95('0x7b')][_0x4d95('0x78')]>0x0?_0xfb0cd8[_0x4d95('0x7b')]:'t';}else if(_[_0x4d95('0x45')](_0xfb0cd8[_0x4d95('0x7b')])){_0xfb0cd8[_0x4d95('0x7b')]='#';_0x1abb9e='#';}if(!this[_0x4d95('0x62')](_0x32946f['variable_id'])){this[_0x4d95('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x441388=this[_0x4d95('0x10')][_0x4d95('0x80')](this,_0x32946f[_0x4d95('0xb0')]);if(!_0x441388){return this[_0x4d95('0xc')]['error'](_0x32946f,'no\x20variable\x20found');}this[_0x4d95('0xc')][_0x4d95('0x7f')](_0x441388,_0x1abb9e);}this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x32946f,_0x1abb9e);return _0xfb0cd8;};AGIVertices[_0x4d95('0xf')][_0x4d95('0x93')]=function(_0x4392eb){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x135'),_0x4392eb['label']));return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4392eb[_0x4d95('0x136')]||_0x4392eb[_0x4d95('0x34')]);};AGIVertices[_0x4d95('0xf')]['pause']=function(_0x147baf){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x137'),_0x147baf[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x147baf[_0x4d95('0x122')])){return this[_0x4d95('0xc')]['error'](_0x147baf,_0x4d95('0x127'));}logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x128'),this[_0x4d95('0xc')][_0x4d95('0x36')],_0x147baf[_0x4d95('0x122')]));var _0x4260be=this[_0x4d95('0x138')][_0x4d95('0x80')](this,_0x147baf[_0x4d95('0x139')]);var _0x7a62ed=this[_0x4d95('0x4c')][_0x4d95('0x80')](this,_0x147baf['findBy'],_0x4260be);if(_0x7a62ed){logger[_0x4d95('0x2b')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4d95('0xc')][_0x4d95('0x36')],_0x147baf['findBy']));this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x123'),this[_0x4d95('0xc')][_0x4d95('0x36')],_0x147baf[_0x4d95('0x122')]));return{'code':0xc8,'result':_0x4d95('0x124')};}else{logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x125'),this[_0x4d95('0xc')]['callerid'],_0x147baf['findBy']));this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')](_0x4d95('0x123'),this['channel']['callerid'],_0x147baf[_0x4d95('0x122')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4d95('0xf')][_0x4d95('0x13a')]=function(_0x5bec7e){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5bec7e['label']));if(!this[_0x4d95('0x62')](_0x5bec7e[_0x4d95('0xda')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x5bec7e,'no\x20file\x20audio\x20selected');}var _0x17b96c=this[_0x4d95('0x13b')][_0x4d95('0x80')](this,_0x5bec7e[_0x4d95('0xda')]);if(!_0x17b96c){return this['channel'][_0x4d95('0x2f')](_0x5bec7e,_0x4d95('0x132'));}var _0x2bfa07=this['channel'][_0x4d95('0x53')](_0x4d95('0x13c'),[_0x17b96c,_0x5bec7e[_0x4d95('0xbe')]]);if(_0x2bfa07[_0x4d95('0x7b')]===-0x1){return _0x2bfa07;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x94'),_0x4d95('0x13c'),_0x17b96c));};AGIVertices[_0x4d95('0xf')]['queue']=function(_0x5e98f4){logger['info'](util[_0x4d95('0x7c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5e98f4[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x5e98f4['queue_id'])){return this['channel'][_0x4d95('0x2f')](_0x5e98f4,_0x4d95('0x13d'));}var _0x463d28='';var _0x855070=parseInt(_0x5e98f4['queue_id'],0xa);if(isNaN(_0x855070)){_0x463d28=_0x5e98f4[_0x4d95('0x13e')];}else{_0x463d28=this[_0x4d95('0x14')]['sync'](this,_0x5e98f4[_0x4d95('0x13e')]);if(!_0x463d28){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x5e98f4,_0x4d95('0x13f'));}}var _0x133f9f='';if(this['isConfigured'](_0x5e98f4[_0x4d95('0xda')])){var _0xd9009a=this[_0x4d95('0x13b')][_0x4d95('0x80')](this,_0x5e98f4['file_id']);if(_0xd9009a){_0x133f9f=_0xd9009a;}}this['createSquareDetailsReport'][_0x4d95('0x80')](this,_0x5e98f4,_0x463d28);if(_0x5e98f4[_0x4d95('0xbe')][_0x4d95('0x140')]('x')<0x0){_0x5e98f4[_0x4d95('0xbe')]+='x';}if(_0x5e98f4[_0x4d95('0xbe')][_0x4d95('0x140')]('X')<0x0){_0x5e98f4[_0x4d95('0xbe')]+='X';}this['channel'][_0x4d95('0x7f')]('XMCS-QUEUE',_0x463d28?_0x463d28[_0x4d95('0x141')]():'');var _0x2cb02b=this[_0x4d95('0xc')][_0x4d95('0x53')]('QUEUE',[_0x463d28,_0x5e98f4[_0x4d95('0xbe')],_0x5e98f4[_0x4d95('0xd6')],_0x133f9f,_0x5e98f4[_0x4d95('0x86')],_0x5e98f4[_0x4d95('0x8')],_0x5e98f4[_0x4d95('0x142')],_0x5e98f4[_0x4d95('0x143')],'',_0x5e98f4[_0x4d95('0x144')]]);if(_0x2cb02b[_0x4d95('0x7b')]===-0x1){return _0x2cb02b;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util['format'](_0x4d95('0x94'),_0x4d95('0x145'),_0x463d28));};AGIVertices[_0x4d95('0xf')]['record']=function(_0x3b44c7){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x146'),_0x3b44c7[_0x4d95('0x34')]));var _0x130605=_0x3b44c7[_0x4d95('0x147')]||'wav';var _0x1e115=util[_0x4d95('0x7c')](_0x4d95('0x148'),this['channel'][_0x4d95('0x38')],rs[_0x4d95('0xe2')](0x5));var _0x12221c=util[_0x4d95('0x7c')](_0x4d95('0x149'),FILES_PATH,_0x1e115,_0x130605);var _0x49e57f=util[_0x4d95('0x7c')](_0x4d95('0x101'),FILES_PATH,_0x1e115);this['createSquareRecording'][_0x4d95('0x80')](this,_0x3b44c7,_0x1e115,_0x12221c);this[_0x4d95('0xc')]['setVariable']('RECORDING_SAVENAME',_0x1e115);logger[_0x4d95('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x49e57f,_0x130605,_0x3b44c7[_0x4d95('0x14a')],_0x3b44c7[_0x4d95('0x86')]);return this[_0x4d95('0xc')][_0x4d95('0xfa')](_0x49e57f,_0x130605,_0x3b44c7[_0x4d95('0x14a')],_0x3b44c7['timeout'],undefined,!![]);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x14b')]=function(_0x3ccbe0){logger['info'](util['format'](_0x4d95('0x14c'),_0x3ccbe0[_0x4d95('0x34')]));return this['channel'][_0x4d95('0x14d')](_0x3ccbe0[_0x4d95('0x14e')][_0x4d95('0x55')](/\s+/g,''),_0x3ccbe0[_0x4d95('0x14a')]);};AGIVertices['prototype'][_0x4d95('0x14f')]=function(_0x53b846){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x150'),_0x53b846[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x151')](_0x53b846[_0x4d95('0x152')][_0x4d95('0x55')](/\s+/g,''),_0x53b846[_0x4d95('0x14a')]);};AGIVertices['prototype'][_0x4d95('0x153')]=function(_0x37b063){logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x154'),_0x37b063[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x155')](_0x37b063[_0x4d95('0x5a')],_0x37b063[_0x4d95('0x14a')]);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x156')]=function(_0x1fb1f4){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x157'),_0x1fb1f4[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x1fb1f4[_0x4d95('0x158')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x159'));}var _0x44a13c=this[_0x4d95('0x20')]['sync'](this,_0x1fb1f4[_0x4d95('0x158')]);if(!_0x44a13c||!_0x44a13c[_0x4d95('0x15a')]){return this[_0x4d95('0xc')]['error'](_0x1fb1f4,_0x4d95('0x15b'));}var _0x20307d={'from':util[_0x4d95('0x7c')](_0x4d95('0x15c'),_0x44a13c[_0x4d95('0x16')],_0x44a13c['email']||_0x44a13c[_0x4d95('0x15a')]['user']),'to':_0x1fb1f4['to']||'','cc':_0x1fb1f4['cc']||'','bcc':_0x1fb1f4['bcc']||'','subject':_0x1fb1f4[_0x4d95('0x15d')],'html':_0x1fb1f4[_0x4d95('0x5a')],'text':_0x1fb1f4[_0x4d95('0x5a')]};var _0x296207={'tls':{'rejectUnauthorized':![]}};if(_0x44a13c[_0x4d95('0x15a')][_0x4d95('0x15e')]){_0x296207[_0x4d95('0x15e')]=_0x44a13c[_0x4d95('0x15a')][_0x4d95('0x15e')];}else{_0x296207[_0x4d95('0x15f')]=_0x44a13c['Smtp']['host'];_0x296207['port']=_0x44a13c[_0x4d95('0x15a')][_0x4d95('0x160')];_0x296207[_0x4d95('0x161')]=_0x44a13c[_0x4d95('0x15a')]['secure'];}if(_0x44a13c[_0x4d95('0x15a')]['authentication']){_0x296207[_0x4d95('0x162')]={'user':_0x44a13c[_0x4d95('0x15a')][_0x4d95('0x163')],'pass':_0x44a13c[_0x4d95('0x15a')]['pass']};}if(this[_0x4d95('0x62')](_0x1fb1f4['template_id'])){}logger[_0x4d95('0xb8')](_0x4d95('0x164'),JSON['stringify'](_0x20307d));this[_0x4d95('0x33')]['sync'](this,_0x1fb1f4,_0x1fb1f4[_0x4d95('0x158')]);this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x165'),_0x44a13c[_0x4d95('0x16')]));this[_0x4d95('0x166')][_0x4d95('0x80')](this,_0x296207,_0x20307d);return this[_0x4d95('0xc')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4d95('0xf')][_0x4d95('0x167')]=function(_0xc67c04){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x168'),_0xc67c04[_0x4d95('0x34')]));return this[_0x4d95('0xc')][_0x4d95('0x93')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x4d95('0xf')]['sendSMS']=function(_0x4fbc5b){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x169'),_0x4fbc5b[_0x4d95('0x34')]));if(!this['isConfigured'](_0x4fbc5b[_0x4d95('0x16a')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x16b'));}var _0x8ef8b5=this[_0x4d95('0x31')][_0x4d95('0x80')](this,_0x4fbc5b[_0x4d95('0x16a')]);if(!_0x8ef8b5){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x4fbc5b,'no\x20sms\x20account\x20found');}var _0x137254={'body':_0x4fbc5b['sms_text'],'phone':_0x4fbc5b['to']||'','SmsAccountId':_0x8ef8b5['id']};logger[_0x4d95('0xb8')]('sendSMS\x20message',JSON['stringify'](_0x137254));this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x4fbc5b,_0x4fbc5b[_0x4d95('0x16a')]);this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x16c'),_0x8ef8b5[_0x4d95('0x16')]));this['createSmsMessage'][_0x4d95('0x80')](this,_0x137254);return this[_0x4d95('0xc')][_0x4d95('0x93')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4d95('0xf')]['set']=function(_0x558cbd){logger[_0x4d95('0x2b')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x558cbd[_0x4d95('0x34')]));if(!this['isConfigured'](_0x558cbd['variable_id'])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x558cbd,_0x4d95('0x16d'));}var _0x1e245e=this[_0x4d95('0x10')][_0x4d95('0x80')](this,_0x558cbd[_0x4d95('0xb0')]);if(!_0x1e245e){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x558cbd,_0x4d95('0xb1'));}return this[_0x4d95('0xc')]['setVariable'](_0x1e245e,_0x558cbd[_0x4d95('0x16e')]);};AGIVertices[_0x4d95('0xf')][_0x4d95('0x16f')]=function(_0x3e4802){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3e4802[_0x4d95('0x34')]));this['channel']['noop'](_0x4d95('0x170'));if(_0x3e4802[_0x4d95('0x85')]==='yes'){this[_0x4d95('0xc')][_0x4d95('0x93')]('Answer');return this[_0x4d95('0xc')][_0x4d95('0x85')]();}return this[_0x4d95('0xc')][_0x4d95('0x93')]('Skipped\x20Answer');};AGIVertices[_0x4d95('0xf')][_0x4d95('0x171')]=function(_0x17f6f8){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x17f6f8[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x17f6f8[_0x4d95('0x172')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x17f6f8,_0x4d95('0x173'));}var _0x293922=this[_0x4d95('0x174')]['sync'](this,_0x17f6f8[_0x4d95('0x172')]);if(!this[_0x4d95('0x62')](_0x293922)){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x17f6f8,util[_0x4d95('0x7c')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x17f6f8[_0x4d95('0x172')]));}if(_0x293922===this[_0x4d95('0xc')][_0x4d95('0x3f')]){return this['channel'][_0x4d95('0x2f')](_0x17f6f8,_0x4d95('0x175'));}this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x17f6f8,_0x293922);var _0x330167=this[_0x4d95('0xc')][_0x4d95('0x53')](_0x4d95('0x176'),util[_0x4d95('0x7c')](_0x4d95('0x177'),config[_0x4d95('0x8')][_0x4d95('0x15f')]||_0x4d95('0x178'),_0x293922,this['channel'][_0x4d95('0x3f')]));if(_0x330167['result']===-0x1){return _0x330167;}return this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x94'),_0x4d95('0x176'),_0x293922));};AGIVertices['prototype'][_0x4d95('0x179')]=function(_0x2e4a26){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x17a'),_0x2e4a26[_0x4d95('0x34')]));var _0x4eecad=this[_0x4d95('0x52')][_0x4d95('0x80')](this,_0x2e4a26[_0x4d95('0x17b')]);this[_0x4d95('0x33')][_0x4d95('0x80')](this,_0x2e4a26,_0x2e4a26[_0x4d95('0x17b')]);if(this[_0x4d95('0x62')](_0x2e4a26[_0x4d95('0xb0')])){var _0x25fa0f=this[_0x4d95('0x10')]['sync'](this,_0x2e4a26[_0x4d95('0xb0')]);if(_0x25fa0f){this[_0x4d95('0xc')][_0x4d95('0x7f')](_0x25fa0f,_0x4eecad);return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x17c'),_0x2e4a26[_0x4d95('0x17b')],_0x25fa0f));}}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x17d'),_0x2e4a26['command']));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x17e')]=function(_0x3416e1){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x17f'),_0x3416e1[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x3416e1[_0x4d95('0x5a')])){return this[_0x4d95('0xc')][_0x4d95('0x93')](_0x4d95('0x97'));}this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x180'),_0x3416e1['text']));var _0x473b0f=this[_0x4d95('0x56')][_0x4d95('0x80')](this,_0x3416e1);if(_0x473b0f){this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x181'),_0x473b0f));var _0x1dbea7=this[_0x4d95('0xc')][_0x4d95('0xcc')](_0x473b0f);try{fs[_0x4d95('0xcd')](_0x473b0f+'.wav');}catch(_0x30ac8b){logger[_0x4d95('0x2f')](_0x30ac8b);}return _0x1dbea7;}return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x3416e1,_0x4d95('0x182'));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x183')]=function(_0x436754){logger['info'](util['format'](_0x4d95('0x184'),_0x436754[_0x4d95('0x34')]));if(!this[_0x4d95('0x62')](_0x436754[_0x4d95('0x122')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x436754,_0x4d95('0x127'));}logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4d95('0xc')][_0x4d95('0x36')],_0x436754['findBy']));var _0x5388b7=this[_0x4d95('0x185')][_0x4d95('0x80')](this,_0x436754[_0x4d95('0x122')]);if(_0x5388b7){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4d95('0xc')][_0x4d95('0x36')],_0x436754['findBy']));this['channel'][_0x4d95('0x93')](util[_0x4d95('0x7c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4d95('0x36')],_0x436754[_0x4d95('0x122')]));return{'code':0xc8,'result':_0x4d95('0x124')};}else{logger['info'](util[_0x4d95('0x7c')](_0x4d95('0x125'),this[_0x4d95('0xc')][_0x4d95('0x36')],_0x436754[_0x4d95('0x122')]));this[_0x4d95('0xc')]['noop'](util[_0x4d95('0x7c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4d95('0xc')][_0x4d95('0x36')],_0x436754[_0x4d95('0x122')]));return{'code':0xc8,'result':_0x4d95('0x126')};}};AGIVertices['prototype'][_0x4d95('0x186')]=function(_0x58d935){logger[_0x4d95('0x2b')](util[_0x4d95('0x7c')](_0x4d95('0x187'),_0x58d935[_0x4d95('0x34')]));var _0x59ae09=this['channel'][_0x4d95('0x53')](_0x4d95('0x188'),[_0x58d935[_0x4d95('0x189')],_0x58d935[_0x4d95('0x95')]]);if(_0x59ae09['result']===-0x1){return _0x59ae09;}return this[_0x4d95('0xc')][_0x4d95('0x93')](util[_0x4d95('0x7c')](_0x4d95('0x94'),_0x4d95('0x188'),_0x58d935[_0x4d95('0x189')]));};AGIVertices[_0x4d95('0xf')][_0x4d95('0x18a')]=function(_0x3da905){logger[_0x4d95('0x2b')](util['format'](_0x4d95('0x18b'),_0x3da905['label']));if(!this[_0x4d95('0x62')](_0x3da905[_0x4d95('0xb0')])){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x3da905,_0x4d95('0x16d'));}var _0x1c7378=this[_0x4d95('0x10')][_0x4d95('0x80')](this,_0x3da905[_0x4d95('0xb0')]);if(!_0x1c7378){return this[_0x4d95('0xc')][_0x4d95('0x2f')](_0x3da905,_0x4d95('0xb1'));}var _0x37baba=this[_0x4d95('0xc')][_0x4d95('0x10')](_0x1c7378);return{'code':0xc8,'result':_0x37baba['extra']?_0x37baba[_0x4d95('0x7e')]:'-'};};String['prototype'][_0x4d95('0x18c')]=function(_0x4da45e,_0x52fcbc){return this[_0x4d95('0x77')](_0x4da45e)[_0x4d95('0x18d')](_0x52fcbc);};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 f96118b..e481071 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032e=['[ACW][syncAgentConnect]\x20%s','acw','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s'];(function(_0x4855fa,_0x490cf3){var _0x4b7a91=function(_0x456ec7){while(--_0x456ec7){_0x4855fa['push'](_0x4855fa['shift']());}};_0x4b7a91(++_0x490cf3);}(_0x032e,0x124));var _0xe032=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x032e[_0x29b609];return _0x54c952;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var moment=require(_0xe032('0x1'));var ami=require(_0xe032('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xe032('0x3'));var RpcVoiceAgentReport=require(_0xe032('0x4'));function Acw(_0x2f44f6){this[_0xe032('0x5')]=_0x2f44f6[_0xe032('0x5')];this[_0xe032('0x6')]=_0x2f44f6[_0xe032('0x6')];this[_0xe032('0x7')]=_0x2f44f6[_0xe032('0x7')];this[_0xe032('0x8')]={};ami['on'](_0xe032('0x9'),this[_0xe032('0xa')][_0xe032('0xb')](this));ami['on'](_0xe032('0xc'),this[_0xe032('0xd')][_0xe032('0xb')](this));ami['on'](_0xe032('0xe'),this[_0xe032('0xf')]['bind'](this));ami['on'](_0xe032('0x10'),this[_0xe032('0x11')][_0xe032('0xb')](this));ami['on'](_0xe032('0x12'),this[_0xe032('0x13')][_0xe032('0xb')](this));ami['on'](_0xe032('0x14'),this['syncBlindTransfer'][_0xe032('0xb')](this));ami['on'](_0xe032('0x15'),this[_0xe032('0x16')][_0xe032('0xb')](this));}function getDiff(_0x4aee44){var _0x311592=moment()[_0xe032('0x17')](0x0);var _0x176547=moment(_0x4aee44)[_0xe032('0x17')](0x0);return _0x311592[_0xe032('0x18')](_0x176547,_0xe032('0x19'));}Acw[_0xe032('0x1a')]['startAcw']=function(_0x231c35){try{var _0x749018=this;var _0x36fb7c=this[_0xe032('0x8')][_0x231c35][_0xe032('0x1b')];var _0x208b00=this['channels'][_0x231c35][_0xe032('0x1c')];var _0x25cedb=this[_0xe032('0x5')][_0x208b00];var _0x41d2a5=![];var _0x208c47='ACW';if(_0x25cedb['mandatoryDisposition']){if(_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')]){_0x41d2a5=!![];_0x208c47=_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')];}}ami[_0xe032('0x1e')]({'action':_0xe032('0x1f'),'interface':_0x36fb7c,'paused':!![],'reason':_0x208c47})[_0xe032('0x20')](function(_0x288d91){if(_0x749018[_0xe032('0x6')][_0x36fb7c]){return RpcUser[_0xe032('0x21')](_0x749018['agents'][_0x36fb7c]['id'])[_0xe032('0x20')](function(_0x866c81){if(_0x866c81&&!_0x866c81[_0xe032('0x22')]){logger[_0xe032('0x23')](_0xe032('0x24'),_0x231c35,_0x36fb7c,_0x208b00);var _0x33d89a=_0x749018[_0xe032('0x8')][_0x231c35][_0xe032('0x25')]&&_0x749018['channels'][_0x231c35]['destlinkedid']?_0x749018['channels'][_0x231c35][_0xe032('0x26')]:_0x231c35;return RpcUser[_0xe032('0x27')](_0x749018[_0xe032('0x6')][_0x36fb7c],_0x208c47,_0x33d89a)[_0xe032('0x20')](function(_0x2bfe8f){if(!_0x41d2a5){_0x749018[_0xe032('0x7')][_0x36fb7c]={};logger[_0xe032('0x23')](_0xe032('0x28'),_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);_0x749018['timers'][_0x36fb7c][_0xe032('0x2a')]=setTimeout(_0x749018[_0xe032('0x2b')][_0xe032('0xb')](_0x749018,_0x36fb7c),_0x749018[_0xe032('0x5')][_0x208b00]['acwTimeout']*0x3e8);_0x749018['timers'][_0x36fb7c][_0xe032('0x2c')]=moment()[_0xe032('0x2d')](_0xe032('0x2e'));_0x749018[_0xe032('0x7')][_0x36fb7c]['uniqueid']=_0x231c35;_0x749018['timers'][_0x36fb7c]['queue']=_0x208b00;_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2f')]=function(){var _0x5518ac=getDiff(_0x749018[_0xe032('0x7')][_0x36fb7c]['lastPauseAt']);clearTimeout(_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]);_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]=![];RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x5518ac},_0x749018['timers'][_0x36fb7c][_0xe032('0x31')],_0x36fb7c)[_0xe032('0x20')](function(_0x319a2f){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x231c35,_0x5518ac,_0x319a2f);})[_0xe032('0x32')](function(_0x4c86e9){logger[_0xe032('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x231c35,_0x4c86e9);});delete _0x749018[_0xe032('0x7')][_0x36fb7c];};}});}else{logger['info'](_0xe032('0x34'),_0x231c35,_0x36fb7c,_0x208b00);}});}})['catch'](function(_0x3970e1){logger[_0xe032('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);})[_0xe032('0x35')](function(){delete _0x749018[_0xe032('0x8')][_0x231c35];});}catch(_0x4e222c){logger[_0xe032('0x33')]('[ACW][START]\x20%s',_0x4e222c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')]['stopAcw']=function(_0x450ba4){try{var _0x23b790=this;if(_0x23b790['timers'][_0x450ba4]){_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x2a')]=![];var _0x3cc437=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x31')];var _0x42f58a=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x1c')];var _0x22651f=_0x23b790[_0xe032('0x5')][_0x42f58a][_0xe032('0x29')];logger[_0xe032('0x23')](_0xe032('0x37'),_0x450ba4);RpcUser[_0xe032('0x38')](this[_0xe032('0x6')][_0x450ba4]);RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x22651f,'agentacw':!![]},_0x3cc437,_0x450ba4)[_0xe032('0x20')](function(_0x555914){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x3cc437,_0x22651f,_0x555914);})[_0xe032('0x32')](function(_0x2bcfb4){logger[_0xe032('0x33')](_0xe032('0x39'),_0x3cc437,_0x2bcfb4);});}else{logger[_0xe032('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x450ba4);if(_0x23b790[_0xe032('0x7')]){logger['info'](_0xe032('0x3a'),JSON['stringify'](_0x23b790[_0xe032('0x7')]));}}}catch(_0x475355){logger[_0xe032('0x33')](_0xe032('0x3b'),_0x475355['message']);}};Acw[_0xe032('0x1a')]['syncAgentConnect']=function(_0x2b9664){try{if(this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]&&(this[_0xe032('0x5')][_0x2b9664['queue']]['acw']||this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]['mandatoryDisposition'])){if(this[_0xe032('0x6')][_0x2b9664[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x2b9664[_0xe032('0x31')]]={'queue':_0x2b9664[_0xe032('0x1c')],'interface':_0x2b9664['interface'],'destlinkedid':_0x2b9664[_0xe032('0x26')]};}}}catch(_0x7bc08){logger[_0xe032('0x33')](_0xe032('0x3c'),_0x7bc08[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x16')]=function(_0x318f86){try{if(this['voiceQueues'][_0x318f86['queue']]&&(this[_0xe032('0x5')][_0x318f86['queue']][_0xe032('0x3d')]||this[_0xe032('0x5')][_0x318f86[_0xe032('0x1c')]][_0xe032('0x3e')])){if(this[_0xe032('0x6')][_0x318f86[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x318f86[_0xe032('0x31')]]={'queue':_0x318f86[_0xe032('0x1c')],'interface':_0x318f86['interface']};}}}catch(_0x1549c){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x1549c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0xd')]=function(_0x1e54d3){try{if(this['channels'][_0x1e54d3[_0xe032('0x31')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x31')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x40'),_0x1e54d3['uniqueid']);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x31')]);}else if(this['channels'][_0x1e54d3[_0xe032('0x42')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x42')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x43'),_0x1e54d3[_0xe032('0x42')]);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x42')]);}}catch(_0x3a0253){logger[_0xe032('0x33')](_0xe032('0x44'),_0x3a0253[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0xf')]=function(_0x53c8b2){try{if(this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]][_0xe032('0x25')]){logger[_0xe032('0x23')](_0xe032('0x45'),_0x53c8b2[_0xe032('0x31')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x31')]);}else if(this[_0xe032('0x8')][_0x53c8b2['linkedid']]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x42')]]['attended']){logger[_0xe032('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x53c8b2[_0xe032('0x42')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x42')]);}}catch(_0x414243){logger[_0xe032('0x33')]('[ACW][syncHangup]\x20%s',_0x414243[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x13')]=function(_0x21a32f){try{if(!_[_0xe032('0x46')](this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]])){this['startAcw'](_0x21a32f[_0xe032('0x47')]);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x49')]]=this[_0xe032('0x8')][_0x21a32f['secondtransfereruniqueid']];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]];}}else if(!_[_0xe032('0x46')](this['channels'][_0x21a32f[_0xe032('0x49')]])){this[_0xe032('0x41')](_0x21a32f['transfertargetuniqueid']);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]]=this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];}}}catch(_0x505986){logger[_0xe032('0x33')](_0xe032('0x4b'),_0x505986[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x4c')]=function(_0x4d305b){try{if(this[_0xe032('0x8')][_0x4d305b['transfereruniqueid']]){logger[_0xe032('0x23')](_0xe032('0x4d'),JSON[_0xe032('0x4e')](_0x4d305b[_0xe032('0x4f')]));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x4f')]);}else if(this[_0xe032('0x8')][_0x4d305b[_0xe032('0x50')]]){logger[_0xe032('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x4d305b['transfererlinkedid']));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x50')]);}}catch(_0x889c28){logger[_0xe032('0x33')](_0xe032('0x51'),_0x889c28[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0x11')]=function(_0x1d66c3){try{if(this[_0xe032('0x5')][_0x1d66c3['queue']]&&this[_0xe032('0x5')][_0x1d66c3['queue']][_0xe032('0x52')]===_0xe032('0x53')){if(this['agents'][_0x1d66c3['interface']]){logger['info'](_0xe032('0x54'),_0x1d66c3['uniqueid'],_0x1d66c3['interface'],_0x1d66c3[_0xe032('0x1c')]);return RpcUser[_0xe032('0x27')](this[_0xe032('0x6')][_0x1d66c3['interface']],_0xe032('0x55'),_0x1d66c3['uniqueid']);}}}catch(_0x2cf342){logger[_0xe032('0x33')](_0xe032('0x56'),_0x2cf342[_0xe032('0x36')]);}};module[_0xe032('0x57')]=Acw; \ No newline at end of file +var _0x24ca=['acw','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','util','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDispositionPause','name','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','prototype','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s'];(function(_0x59e703,_0x62b160){var _0x5e46c3=function(_0x5757b5){while(--_0x5757b5){_0x59e703['push'](_0x59e703['shift']());}};_0x5e46c3(++_0x62b160);}(_0x24ca,0x1bc));var _0xa24c=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x24ca[_0x469a3c];return _0x968f4;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var moment=require(_0xa24c('0x1'));var ami=require(_0xa24c('0x2'));var logger=require(_0xa24c('0x3'))('acw');var RpcUser=require(_0xa24c('0x4'));var RpcVoiceAgentReport=require(_0xa24c('0x5'));function Acw(_0x195e60){this[_0xa24c('0x6')]=_0x195e60[_0xa24c('0x6')];this[_0xa24c('0x7')]=_0x195e60[_0xa24c('0x7')];this[_0xa24c('0x8')]=_0x195e60[_0xa24c('0x8')];this[_0xa24c('0x9')]={};ami['on'](_0xa24c('0xa'),this['syncAgentConnect'][_0xa24c('0xb')](this));ami['on'](_0xa24c('0xc'),this[_0xa24c('0xd')]['bind'](this));ami['on'](_0xa24c('0xe'),this[_0xa24c('0xf')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x10'),this[_0xa24c('0x11')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x12'),this[_0xa24c('0x13')][_0xa24c('0xb')](this));ami['on']('blindtransfer',this[_0xa24c('0x14')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x15'),this[_0xa24c('0x16')]['bind'](this));}function getDiff(_0x3ad0bf){var _0x3c23fc=moment()[_0xa24c('0x17')](0x0);var _0x2fcd8b=moment(_0x3ad0bf)[_0xa24c('0x17')](0x0);return _0x3c23fc[_0xa24c('0x18')](_0x2fcd8b,_0xa24c('0x19'));}Acw['prototype']['startAcw']=function(_0xb80781){try{var _0x87aa90=this;var _0x49ce53=this['channels'][_0xb80781][_0xa24c('0x1a')];var _0x1b29ad=this['channels'][_0xb80781][_0xa24c('0x1b')];var _0x5de3e6=this[_0xa24c('0x6')][_0x1b29ad];var _0x2a610a=![];var _0x1fcd4b=_0xa24c('0x1c');if(_0x5de3e6['mandatoryDisposition']){if(_0x5de3e6[_0xa24c('0x1d')][_0xa24c('0x1e')]){_0x2a610a=!![];_0x1fcd4b=_0x5de3e6[_0xa24c('0x1d')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x49ce53,'paused':!![],'reason':_0x1fcd4b})['then'](function(_0x2173f6){if(_0x87aa90[_0xa24c('0x7')][_0x49ce53]){return RpcUser[_0xa24c('0x1f')](_0x87aa90[_0xa24c('0x7')][_0x49ce53]['id'])['then'](function(_0x30ec21){if(_0x30ec21&&!_0x30ec21['voicePause']){logger[_0xa24c('0x20')](_0xa24c('0x21'),_0xb80781,_0x49ce53,_0x1b29ad);var _0x4a1cda=_0x87aa90[_0xa24c('0x9')][_0xb80781][_0xa24c('0x22')]&&_0x87aa90[_0xa24c('0x9')][_0xb80781][_0xa24c('0x23')]?_0x87aa90[_0xa24c('0x9')][_0xb80781]['destlinkedid']:_0xb80781;return RpcUser[_0xa24c('0x24')](_0x87aa90['agents'][_0x49ce53],_0x1fcd4b,_0x4a1cda)[_0xa24c('0x25')](function(_0x3951ae){if(!_0x2a610a){_0x87aa90[_0xa24c('0x8')][_0x49ce53]={};logger['info'](_0xa24c('0x26'),_0xb80781,_0x87aa90[_0xa24c('0x6')][_0x1b29ad][_0xa24c('0x27')],_0x49ce53,_0x1b29ad);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x28')]=setTimeout(_0x87aa90[_0xa24c('0x29')][_0xa24c('0xb')](_0x87aa90,_0x49ce53),_0x87aa90['voiceQueues'][_0x1b29ad][_0xa24c('0x27')]*0x3e8);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2a')]=moment()[_0xa24c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2c')]=_0xb80781;_0x87aa90[_0xa24c('0x8')][_0x49ce53]['queue']=_0x1b29ad;_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2d')]=function(){var _0x253d83=getDiff(_0x87aa90['timers'][_0x49ce53][_0xa24c('0x2a')]);clearTimeout(_0x87aa90['timers'][_0x49ce53][_0xa24c('0x28')]);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x253d83},_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2c')],_0x49ce53)[_0xa24c('0x25')](function(_0x52572f){logger[_0xa24c('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0xb80781,_0x253d83,_0x52572f);})[_0xa24c('0x2e')](function(_0x42ba21){logger['error']('[%s][UPDATE][ERRORS:%s]',_0xb80781,_0x42ba21);});delete _0x87aa90[_0xa24c('0x8')][_0x49ce53];};}});}else{logger[_0xa24c('0x20')](_0xa24c('0x2f'),_0xb80781,_0x49ce53,_0x1b29ad);}});}})[_0xa24c('0x2e')](function(_0x298dec){logger[_0xa24c('0x30')](_0xa24c('0x26'),_0xb80781,_0x87aa90['voiceQueues'][_0x1b29ad][_0xa24c('0x27')],_0x49ce53,_0x1b29ad);})[_0xa24c('0x31')](function(){delete _0x87aa90[_0xa24c('0x9')][_0xb80781];});}catch(_0xbd24c0){logger[_0xa24c('0x30')](_0xa24c('0x32'),_0xbd24c0[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x29')]=function(_0x129bb9){try{var _0x4c7a30=this;if(_0x4c7a30[_0xa24c('0x8')][_0x129bb9]){_0x4c7a30[_0xa24c('0x8')][_0x129bb9][_0xa24c('0x28')]=![];var _0x1b0757=_0x4c7a30['timers'][_0x129bb9]['uniqueid'];var _0x19a65f=_0x4c7a30['timers'][_0x129bb9][_0xa24c('0x1b')];var _0x13f272=_0x4c7a30[_0xa24c('0x6')][_0x19a65f][_0xa24c('0x27')];logger[_0xa24c('0x20')]('[TIMER][STOP][AGENT:%s]',_0x129bb9);RpcUser['saveUnpause'](this[_0xa24c('0x7')][_0x129bb9]);RpcVoiceAgentReport[_0xa24c('0x35')]({'acwtime':_0x13f272,'agentacw':!![]},_0x1b0757,_0x129bb9)[_0xa24c('0x25')](function(_0x213dc3){logger[_0xa24c('0x20')](_0xa24c('0x36'),_0x1b0757,_0x13f272,_0x213dc3);})['catch'](function(_0x56f392){logger[_0xa24c('0x30')](_0xa24c('0x37'),_0x1b0757,_0x56f392);});}else{logger[_0xa24c('0x30')](_0xa24c('0x38'),_0x129bb9);if(_0x4c7a30[_0xa24c('0x8')]){logger['info'](_0xa24c('0x39'),JSON[_0xa24c('0x3a')](_0x4c7a30['timers']));}}}catch(_0x599627){logger[_0xa24c('0x30')](_0xa24c('0x3b'),_0x599627[_0xa24c('0x33')]);}};Acw['prototype']['syncAgentConnect']=function(_0x21e204){try{if(this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]]&&(this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]][_0xa24c('0x3c')]||this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]]['mandatoryDisposition'])){if(this['agents'][_0x21e204[_0xa24c('0x1a')]]){this[_0xa24c('0x9')][_0x21e204[_0xa24c('0x2c')]]={'queue':_0x21e204['queue'],'interface':_0x21e204[_0xa24c('0x1a')],'destlinkedid':_0x21e204[_0xa24c('0x23')]};}}}catch(_0xf67572){logger[_0xa24c('0x30')](_0xa24c('0x3d'),_0xf67572[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x16')]=function(_0x3f52fe){try{if(this[_0xa24c('0x6')][_0x3f52fe['queue']]&&(this[_0xa24c('0x6')][_0x3f52fe[_0xa24c('0x1b')]][_0xa24c('0x3c')]||this['voiceQueues'][_0x3f52fe[_0xa24c('0x1b')]][_0xa24c('0x3e')])){if(this[_0xa24c('0x7')][_0x3f52fe[_0xa24c('0x1a')]]){this[_0xa24c('0x9')][_0x3f52fe[_0xa24c('0x2c')]]={'queue':_0x3f52fe[_0xa24c('0x1b')],'interface':_0x3f52fe[_0xa24c('0x1a')]};}}}catch(_0x2ac54d){logger[_0xa24c('0x30')](_0xa24c('0x3f'),_0x2ac54d['message']);}};Acw[_0xa24c('0x34')][_0xa24c('0xd')]=function(_0x42028b){try{if(this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x2c')]]&&_[_0xa24c('0x40')](this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x2c')]][_0xa24c('0x22')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x42028b[_0xa24c('0x2c')]);this['startAcw'](_0x42028b[_0xa24c('0x2c')]);}else if(this[_0xa24c('0x9')][_0x42028b['linkedid']]&&_[_0xa24c('0x40')](this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x41')]]['attended'])){logger['info'](_0xa24c('0x42'),_0x42028b['linkedid']);this[_0xa24c('0x43')](_0x42028b[_0xa24c('0x41')]);}}catch(_0x3c3c8b){logger[_0xa24c('0x30')](_0xa24c('0x44'),_0x3c3c8b[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0xf')]=function(_0x22a0db){try{if(this[_0xa24c('0x9')][_0x22a0db['uniqueid']]&&this[_0xa24c('0x9')][_0x22a0db[_0xa24c('0x2c')]][_0xa24c('0x22')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22a0db['uniqueid']);this[_0xa24c('0x43')](_0x22a0db['uniqueid']);}else if(this[_0xa24c('0x9')][_0x22a0db[_0xa24c('0x41')]]&&this['channels'][_0x22a0db[_0xa24c('0x41')]][_0xa24c('0x22')]){logger[_0xa24c('0x20')](_0xa24c('0x45'),_0x22a0db[_0xa24c('0x41')]);this[_0xa24c('0x43')](_0x22a0db[_0xa24c('0x41')]);}}catch(_0xbeab78){logger['error'](_0xa24c('0x46'),_0xbeab78['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0x5bd2af){try{if(!_['isNil'](this[_0xa24c('0x9')][_0x5bd2af['transfereeuniqueid']])){this[_0xa24c('0x43')](_0x5bd2af[_0xa24c('0x47')]);if(this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]]){this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]][_0xa24c('0x22')]=!![];this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x49')]]=this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]];delete this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]];}}else if(!_[_0xa24c('0x4a')](this[_0xa24c('0x9')][_0x5bd2af['transfertargetuniqueid']])){this[_0xa24c('0x43')](_0x5bd2af[_0xa24c('0x49')]);if(this['channels'][_0x5bd2af[_0xa24c('0x4b')]]){this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x4b')]][_0xa24c('0x22')]=!![];this['channels'][_0x5bd2af['transfereeuniqueid']]=this[_0xa24c('0x9')][_0x5bd2af['origtransfereruniqueid']];delete this['channels'][_0x5bd2af[_0xa24c('0x4b')]];}}}catch(_0x2515b1){logger[_0xa24c('0x30')](_0xa24c('0x4c'),_0x2515b1['message']);}};Acw['prototype'][_0xa24c('0x14')]=function(_0x512b6f){try{if(this['channels'][_0x512b6f[_0xa24c('0x4d')]]){logger[_0xa24c('0x20')](_0xa24c('0x4e'),JSON['stringify'](_0x512b6f[_0xa24c('0x4d')]));this[_0xa24c('0x43')](_0x512b6f['transfereruniqueid']);}else if(this[_0xa24c('0x9')][_0x512b6f[_0xa24c('0x4f')]]){logger[_0xa24c('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xa24c('0x3a')](_0x512b6f[_0xa24c('0x4f')]));this[_0xa24c('0x43')](_0x512b6f[_0xa24c('0x4f')]);}}catch(_0xe56235){logger['error'](_0xa24c('0x50'),_0xe56235[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x11')]=function(_0xab5260){try{if(this[_0xa24c('0x6')][_0xab5260[_0xa24c('0x1b')]]&&this['voiceQueues'][_0xab5260[_0xa24c('0x1b')]][_0xa24c('0x51')]==='all'){if(this[_0xa24c('0x7')][_0xab5260[_0xa24c('0x1a')]]){logger[_0xa24c('0x20')](_0xa24c('0x52'),_0xab5260[_0xa24c('0x2c')],_0xab5260[_0xa24c('0x1a')],_0xab5260[_0xa24c('0x1b')]);return RpcUser[_0xa24c('0x24')](this[_0xa24c('0x7')][_0xab5260[_0xa24c('0x1a')]],'Auto-Pause',_0xab5260[_0xa24c('0x2c')]);}}}catch(_0x3a4abd){logger[_0xa24c('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3a4abd[_0xa24c('0x33')]);}};module[_0xa24c('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index b1c2bde..e144d4e 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 _0x71fb=['actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','promisify','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','Action','actionSipPeerStatus','sippeerstatus'];(function(_0x40a63b,_0x1c1815){var _0x3bdb16=function(_0x26a0c6){while(--_0x26a0c6){_0x40a63b['push'](_0x40a63b['shift']());}};_0x3bdb16(++_0x1c1815);}(_0x71fb,0x1c1));var _0xb71f=function(_0x55d329,_0x2fb9da){_0x55d329=_0x55d329-0x0;var _0x522e9d=_0x71fb[_0x55d329];return _0x522e9d;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xb71f('0x0'));var moment=require(_0xb71f('0x1'));var util=require(_0xb71f('0x2'));var _=require(_0xb71f('0x3'));var logger=require(_0xb71f('0x4'))('ami');var config=require(_0xb71f('0x5'));var ami=new Manager(config[_0xb71f('0x6')][_0xb71f('0x7')],config['asterisk']['ip'],config[_0xb71f('0x6')][_0xb71f('0x8')],config['asterisk']['password'],!![]);ami[_0xb71f('0x9')]();ami['Action']=BPromise[_0xb71f('0xa')](ami['action']);function error(_0x129a42){logger[_0xb71f('0xb')](util[_0xb71f('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xb71f('0x6')][_0xb71f('0x8')],config[_0xb71f('0x6')]['ip'],config[_0xb71f('0x6')][_0xb71f('0x7')],util['inspect'](_0x129a42,![],null)));}function close(){logger['error'](util[_0xb71f('0xc')](_0xb71f('0xd'),config[_0xb71f('0x6')][_0xb71f('0x8')],config[_0xb71f('0x6')]['ip'],config[_0xb71f('0x6')][_0xb71f('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xb71f('0xe')});};};ami[_0xb71f('0xf')]=function(){return function(){return ami[_0xb71f('0x10')]({'action':'devicestatelist'});};};ami[_0xb71f('0x11')]=function(){return function(){return ami['Action']({'action':_0xb71f('0x12')});};};ami[_0xb71f('0x13')]=function(){return function(){return ami[_0xb71f('0x10')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xb71f('0x10')]({'action':_0xb71f('0x14')});};};function connect(_0x5bb30b){logger[_0xb71f('0x15')](util[_0xb71f('0xc')](_0xb71f('0x16'),config['asterisk']['username'],config[_0xb71f('0x6')]['ip'],config[_0xb71f('0x6')]['port']));ami[_0xb71f('0x17')](_0xb71f('0xb'),error);ami[_0xb71f('0x17')](_0xb71f('0x18'),close);}ami['on'](_0xb71f('0x19'),connect);ami['on'](_0xb71f('0x1a'),function(_0x2d58e0){logger[_0xb71f('0x15')](util[_0xb71f('0xc')](_0xb71f('0x1b'),config['asterisk']['username'],config[_0xb71f('0x6')]['ip'],config['asterisk'][_0xb71f('0x7')],util['inspect'](_0x2d58e0,![],null)));});ami['on'](_0xb71f('0x1c'),function(_0x2731a9){logger[_0xb71f('0x15')](util[_0xb71f('0xc')](_0xb71f('0x1d'),config['asterisk'][_0xb71f('0x8')],config['asterisk']['ip'],config[_0xb71f('0x6')]['port']));return BPromise[_0xb71f('0x1e')]()['then'](ami['actionSipShowRegistry']())[_0xb71f('0x1f')](ami[_0xb71f('0xf')]())[_0xb71f('0x1f')](ami[_0xb71f('0x11')]())['then'](ami[_0xb71f('0x13')]())['then'](ami[_0xb71f('0x20')]())[_0xb71f('0x21')](function(_0x527e77){console[_0xb71f('0x22')](_0x527e77);});});ami['once'](_0xb71f('0xb'),error);ami[_0xb71f('0x17')](_0xb71f('0x18'),close);module[_0xb71f('0x23')]=ami; \ No newline at end of file +var _0x71e5=['actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','log','asterisk-manager','bluebird','moment','util','lodash','ami','asterisk','port','username','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionDeviceStateList','actionQueueSummary','queuesummary'];(function(_0x40b6c4,_0x2a27a4){var _0x544bcc=function(_0x2770b4){while(--_0x2770b4){_0x40b6c4['push'](_0x40b6c4['shift']());}};_0x544bcc(++_0x2a27a4);}(_0x71e5,0x182));var _0x571e=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0x71e5[_0x58952f];return _0x3217ca;};'use strict';var Manager=require(_0x571e('0x0'));var BPromise=require(_0x571e('0x1'));var moment=require(_0x571e('0x2'));var util=require(_0x571e('0x3'));var _=require(_0x571e('0x4'));var logger=require('../../config/logger')(_0x571e('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x571e('0x6')][_0x571e('0x7')],config[_0x571e('0x6')]['ip'],config[_0x571e('0x6')][_0x571e('0x8')],config[_0x571e('0x6')]['password'],!![]);ami[_0x571e('0x9')]();ami['Action']=BPromise[_0x571e('0xa')](ami[_0x571e('0xb')]);function error(_0x243b39){logger[_0x571e('0xc')](util[_0x571e('0xd')](_0x571e('0xe'),config['asterisk'][_0x571e('0x8')],config[_0x571e('0x6')]['ip'],config[_0x571e('0x6')][_0x571e('0x7')],util['inspect'](_0x243b39,![],null)));}function close(){logger[_0x571e('0xc')](util[_0x571e('0xd')](_0x571e('0xf'),config[_0x571e('0x6')][_0x571e('0x8')],config[_0x571e('0x6')]['ip'],config[_0x571e('0x6')][_0x571e('0x7')]));}ami[_0x571e('0x10')]=function(){return function(){return ami[_0x571e('0x11')]({'action':'sipshowregistry'});};};ami[_0x571e('0x12')]=function(){return function(){return ami[_0x571e('0x11')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x571e('0x11')]({'action':'sippeerstatus'});};};ami[_0x571e('0x13')]=function(){return function(){return ami[_0x571e('0x11')]({'action':_0x571e('0x14')});};};ami[_0x571e('0x15')]=function(){return function(){return ami[_0x571e('0x11')]({'action':_0x571e('0x16')});};};function connect(_0x293d6f){logger['info'](util[_0x571e('0xd')](_0x571e('0x17'),config[_0x571e('0x6')][_0x571e('0x8')],config[_0x571e('0x6')]['ip'],config[_0x571e('0x6')][_0x571e('0x7')]));ami['once'](_0x571e('0xc'),error);ami[_0x571e('0x18')](_0x571e('0x19'),close);}ami['on'](_0x571e('0x1a'),connect);ami['on']('shutdown',function(_0x33bb09){logger[_0x571e('0x1b')](util[_0x571e('0xd')](_0x571e('0x1c'),config[_0x571e('0x6')][_0x571e('0x8')],config['asterisk']['ip'],config[_0x571e('0x6')]['port'],util[_0x571e('0x1d')](_0x33bb09,![],null)));});ami['on'](_0x571e('0x1e'),function(_0x3ff837){logger['info'](util[_0x571e('0xd')](_0x571e('0x1f'),config[_0x571e('0x6')]['username'],config[_0x571e('0x6')]['ip'],config[_0x571e('0x6')][_0x571e('0x7')]));return BPromise[_0x571e('0x20')]()[_0x571e('0x21')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())['then'](ami[_0x571e('0x22')]())[_0x571e('0x21')](ami[_0x571e('0x13')]())['then'](ami[_0x571e('0x15')]())[_0x571e('0x23')](function(_0x5e2f64){console[_0x571e('0x24')](_0x5e2f64);});});ami[_0x571e('0x18')]('error',error);ami[_0x571e('0x18')]('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 99149d6..3558a11 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 _0x9acf=['result','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','then','memberReport','rpc','error'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x9acf,0x13a));var _0xf9ac=function(_0x3666e0,_0x5abe33){_0x3666e0=_0x3666e0-0x0;var _0x5e3efd=_0x9acf[_0x3666e0];return _0x5e3efd;};'use strict';var jayson=require(_0xf9ac('0x0'));var BPromise=require(_0xf9ac('0x1'));var logger=require(_0xf9ac('0x2'))(_0xf9ac('0x3'));var client=jayson[_0xf9ac('0x4')][_0xf9ac('0x5')]({'port':0x2329});client[_0xf9ac('0x6')]=function(_0x5d276b,_0x11e233){return new BPromise(function(_0x2a94e1,_0x43d48e){return client['request'](_0x5d276b,_0x11e233)[_0xf9ac('0x7')](function(_0x433094){logger['debug']('rpc',_0xf9ac('0x8'),_0x5d276b,_0x11e233,_0x433094);if(_0x433094['error']){logger['error'](_0xf9ac('0x9'),'memberReport',_0x5d276b,_0x433094[_0xf9ac('0xa')]['message'],_0x11e233);return _0x43d48e(_0x433094[_0xf9ac('0xa')]['message']);}else{return _0x2a94e1(_0x433094[_0xf9ac('0xb')]);}})['catch'](function(_0x401b01){logger[_0xf9ac('0xa')]('rpc',_0xf9ac('0x8'),_0x5d276b,_0x401b01,_0x11e233);return _0x43d48e(_0x401b01);});});};module[_0xf9ac('0xc')]=client; \ No newline at end of file +var _0x0564=['result','jayson/promise','bluebird','../../config/logger','http','Request','request','then','debug','memberReport','error','rpc','message'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x0564,0xd1));var _0x4056=function(_0x4bbec2,_0xfebd32){_0x4bbec2=_0x4bbec2-0x0;var _0x276778=_0x0564[_0x4bbec2];return _0x276778;};'use strict';var jayson=require(_0x4056('0x0'));var BPromise=require(_0x4056('0x1'));var logger=require(_0x4056('0x2'))('ami');var client=jayson['client'][_0x4056('0x3')]({'port':0x2329});client[_0x4056('0x4')]=function(_0x1fb1ed,_0x25fa18){return new BPromise(function(_0x2fe2b0,_0x103504){return client[_0x4056('0x5')](_0x1fb1ed,_0x25fa18)[_0x4056('0x6')](function(_0x47d11d){logger[_0x4056('0x7')]('rpc',_0x4056('0x8'),_0x1fb1ed,_0x25fa18,_0x47d11d);if(_0x47d11d[_0x4056('0x9')]){logger[_0x4056('0x9')](_0x4056('0xa'),'memberReport',_0x1fb1ed,_0x47d11d[_0x4056('0x9')][_0x4056('0xb')],_0x25fa18);return _0x103504(_0x47d11d[_0x4056('0x9')][_0x4056('0xb')]);}else{return _0x2fe2b0(_0x47d11d[_0x4056('0xc')]);}})['catch'](function(_0xd726ae){logger[_0x4056('0x9')](_0x4056('0xa'),'memberReport',_0x1fb1ed,_0xd726ae,_0x25fa18);return _0x103504(_0xd726ae);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index e34cf49..4f7faef 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 _0xca74=['callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','substring','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x51d539,_0x40d637){var _0x4ae9bd=function(_0x3887d8){while(--_0x3887d8){_0x51d539['push'](_0x51d539['shift']());}};_0x4ae9bd(++_0x40d637);}(_0xca74,0x170));var _0x4ca7=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0xca74[_0x26e727];return _0x563800;};'use strict';var util=require(_0x4ca7('0x0'));var _=require('lodash');var moment=require(_0x4ca7('0x1'));function checkNameSurname(_0x846d96,_0x2ea8d8,_0x2b2093){var _0x41073a='';if(!_[_0x4ca7('0x2')](_0x2ea8d8)&&_0x4ca7('0x3')===typeof _0x2ea8d8){_0x41073a+=_0x2ea8d8;}if(!_[_0x4ca7('0x2')](_0x2b2093)&&_0x4ca7('0x3')===typeof _0x2b2093){_0x41073a+='\x20'+_0x2b2093;}if(_0x41073a!==''){return _0x41073a;}return _0x846d96;}function Action(_0x3beddb,_0x2e950a,_0xab134){this[_0x4ca7('0x4')]=_0x3beddb;this[_0x4ca7('0x5')]=_0xab134||undefined;this[_0x4ca7('0x6')]=checkNameSurname(_0x2e950a['Contact']['phone'],_0x2e950a[_0x4ca7('0x7')][_0x4ca7('0x8')],_0x2e950a[_0x4ca7('0x7')][_0x4ca7('0x9')]);this['number']=_0x2e950a[_0x4ca7('0x7')][_0x4ca7('0xa')];this['queue']=_0x3beddb[_0x4ca7('0x6')];this[_0x4ca7('0xb')]=_0x2e950a['active']||![];this[_0x4ca7('0xc')]=_0x3beddb[_0x4ca7('0xc')];this['dialQueueTimeout']=_0x3beddb[_0x4ca7('0xd')]||0x3;this[_0x4ca7('0xe')]=_0x2e950a[_0x4ca7('0xe')];this['countbusyretry']=_0x2e950a[_0x4ca7('0xf')];this[_0x4ca7('0x10')]=_0x2e950a[_0x4ca7('0x10')];this[_0x4ca7('0x11')]=_0x2e950a[_0x4ca7('0x11')];this['ContactId']=_0x2e950a[_0x4ca7('0x12')];this[_0x4ca7('0x13')]=_0x2e950a['ListId'];this[_0x4ca7('0x14')]=_0x2e950a['UserId'];this[_0x4ca7('0x15')]=_0x2e950a[_0x4ca7('0x15')];this[_0x4ca7('0x16')]=_0x2e950a['CampaignId'];this[_0x4ca7('0x17')]=_0x2e950a['id'];this[_0x4ca7('0x18')]=_0x2e950a[_0x4ca7('0x7')][_0x4ca7('0x8')]||'';this['starttime']=moment()[_0x4ca7('0x19')](_0x4ca7('0x1a'));this[_0x4ca7('0x1b')]=_0x2e950a[_0x4ca7('0x1b')];this['callbackuniqueid']=_0x2e950a['callbackuniqueid'];this[_0x4ca7('0x1c')]=_0x2e950a['callbackat'];this['recallme']=_0x2e950a['recallme'];this[_0x4ca7('0x1d')]='';this[_0x4ca7('0x1e')]='';}Action[_0x4ca7('0x1f')][_0x4ca7('0x20')]=function(){return util[_0x4ca7('0x19')](_0x4ca7('0x21'),this[_0x4ca7('0x6')],this[_0x4ca7('0x4')]['dialCutDigit']>0x0?this[_0x4ca7('0x22')][_0x4ca7('0x23')](this['voiceQueue']['dialCutDigit']):this[_0x4ca7('0x22')]);};Action[_0x4ca7('0x1f')]['getQueue']=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x95ad=['callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','exports','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid'];(function(_0xfb3eaa,_0x4f3035){var _0x1b5b44=function(_0x443770){while(--_0x443770){_0xfb3eaa['push'](_0xfb3eaa['shift']());}};_0x1b5b44(++_0x4f3035);}(_0x95ad,0x95));var _0xd95a=function(_0x5e51ad,_0x209572){_0x5e51ad=_0x5e51ad-0x0;var _0x2f47d4=_0x95ad[_0x5e51ad];return _0x2f47d4;};'use strict';var util=require('util');var _=require(_0xd95a('0x0'));var moment=require(_0xd95a('0x1'));function checkNameSurname(_0x4ebda4,_0x3fe560,_0x2b007e){var _0x228d39='';if(!_[_0xd95a('0x2')](_0x3fe560)&&_0xd95a('0x3')===typeof _0x3fe560){_0x228d39+=_0x3fe560;}if(!_[_0xd95a('0x2')](_0x2b007e)&&_0xd95a('0x3')===typeof _0x2b007e){_0x228d39+='\x20'+_0x2b007e;}if(_0x228d39!==''){return _0x228d39;}return _0x4ebda4;}function Action(_0x22837f,_0x1ac6c6,_0x8e9a2){this[_0xd95a('0x4')]=_0x22837f;this['uniqueid']=_0x8e9a2||undefined;this[_0xd95a('0x5')]=checkNameSurname(_0x1ac6c6[_0xd95a('0x6')][_0xd95a('0x7')],_0x1ac6c6[_0xd95a('0x6')][_0xd95a('0x8')],_0x1ac6c6[_0xd95a('0x6')][_0xd95a('0x9')]);this[_0xd95a('0xa')]=_0x1ac6c6[_0xd95a('0x6')][_0xd95a('0x7')];this[_0xd95a('0xb')]=_0x22837f[_0xd95a('0x5')];this['active']=_0x1ac6c6['active']||![];this['type']=_0x22837f['type'];this['dialQueueTimeout']=_0x22837f['dialQueueTimeout']||0x3;this['scheduledat']=_0x1ac6c6[_0xd95a('0xc')];this[_0xd95a('0xd')]=_0x1ac6c6['countbusyretry'];this['countcongestionretry']=_0x1ac6c6[_0xd95a('0xe')];this[_0xd95a('0xf')]=_0x1ac6c6[_0xd95a('0xf')];this[_0xd95a('0x10')]=_0x1ac6c6['ContactId'];this[_0xd95a('0x11')]=_0x1ac6c6[_0xd95a('0x11')];this[_0xd95a('0x12')]=_0x1ac6c6[_0xd95a('0x12')];this['VoiceQueueId']=_0x1ac6c6['VoiceQueueId'];this[_0xd95a('0x13')]=_0x1ac6c6['CampaignId'];this[_0xd95a('0x14')]=_0x1ac6c6['id'];this[_0xd95a('0x15')]=_0x1ac6c6[_0xd95a('0x6')][_0xd95a('0x8')]||'';this['starttime']=moment()[_0xd95a('0x16')](_0xd95a('0x17'));this[_0xd95a('0x18')]=_0x1ac6c6[_0xd95a('0x18')];this[_0xd95a('0x19')]=_0x1ac6c6[_0xd95a('0x19')];this[_0xd95a('0x1a')]=_0x1ac6c6['callbackat'];this[_0xd95a('0x1b')]=_0x1ac6c6[_0xd95a('0x1b')];this[_0xd95a('0x1c')]='';this[_0xd95a('0x1d')]='';}Action['prototype']['getCaller']=function(){return util[_0xd95a('0x16')](_0xd95a('0x1e'),this[_0xd95a('0x5')],this['voiceQueue'][_0xd95a('0x1f')]>0x0?this[_0xd95a('0xa')]['substring'](this['voiceQueue'][_0xd95a('0x1f')]):this['number']);};Action[_0xd95a('0x20')][_0xd95a('0x21')]=function(){return this[_0xd95a('0xb')];};module[_0xd95a('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index de8d0fa..75e3d2f 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 _0xf6c6=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x532a06,_0x12f61c){var _0x3c92dd=function(_0x102839){while(--_0x102839){_0x532a06['push'](_0x532a06['shift']());}};_0x3c92dd(++_0x12f61c);}(_0xf6c6,0x7f));var _0x6f6c=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xf6c6[_0xfa634c];return _0x73e478;};'use strict';var util=require(_0x6f6c('0x0'));var _=require(_0x6f6c('0x1'));var moment=require(_0x6f6c('0x2'));function getSeconds(_0x57e4d3,_0x4dbc60){var _0xd7f2e=moment(_0x57e4d3)[_0x6f6c('0x3')](0x0);var _0x20bb98=moment(_0x4dbc60)['milliseconds'](0x0);return _0xd7f2e[_0x6f6c('0x4')](_0x20bb98,_0x6f6c('0x5'));}function AgentComplete(_0x701e86,_0x158e1f){this[_0x6f6c('0x6')]=0x4;this['statedesc']='Answer';this[_0x6f6c('0x7')]=_0x701e86['scheduledat'];this[_0x6f6c('0x8')]=_0x701e86[_0x6f6c('0x8')];this[_0x6f6c('0x9')]=_0x701e86[_0x6f6c('0x8')]===_0x6f6c('0xa')?_0x6f6c('0xb'):_0x701e86[_0x6f6c('0x8')];this[_0x6f6c('0xc')]=_0x701e86['countbusyretry'];this[_0x6f6c('0xd')]=_0x701e86[_0x6f6c('0xd')];this[_0x6f6c('0xe')]=_0x701e86['countnoanswerretry'];this[_0x6f6c('0xf')]=_0x701e86[_0x6f6c('0xc')]+_0x701e86['countcongestionretry']+_0x701e86[_0x6f6c('0xe')];this[_0x6f6c('0x10')]=_0x158e1f['uniqueid'];this['calleridname']=_0x701e86[_0x6f6c('0x11')];this[_0x6f6c('0x12')]=_0x701e86[_0x6f6c('0x13')];this[_0x6f6c('0x14')]=_0x701e86[_0x6f6c('0x14')];this[_0x6f6c('0x15')]=_0x701e86[_0x6f6c('0x15')];this['answertime']=_0x701e86[_0x6f6c('0x16')];this[_0x6f6c('0x17')]=moment()[_0x6f6c('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f6c('0x19')]=getSeconds(_0x701e86['responsetime'],_0x701e86['starttime']);this['holdtime']=getSeconds(_0x701e86['answertime'],_0x701e86[_0x6f6c('0x15')]);this[_0x6f6c('0x1a')]=getSeconds(this[_0x6f6c('0x17')],_0x701e86[_0x6f6c('0x16')]);this[_0x6f6c('0xb')]=_0x158e1f['queue'];this[_0x6f6c('0x1b')]=_0x158e1f[_0x6f6c('0x1b')];this['reason']=_0x158e1f[_0x6f6c('0x1c')];this[_0x6f6c('0x1d')]=_0x701e86[_0x6f6c('0x1d')];this[_0x6f6c('0x1e')]=_0x701e86[_0x6f6c('0x1e')];this[_0x6f6c('0x1f')]=_0x701e86[_0x6f6c('0x1f')];this[_0x6f6c('0x20')]=_0x701e86[_0x6f6c('0x20')];this[_0x6f6c('0x21')]=_0x701e86[_0x6f6c('0x21')];this[_0x6f6c('0x22')]=_0x701e86[_0x6f6c('0x22')];this[_0x6f6c('0x23')]=_0x701e86[_0x6f6c('0x23')];this['VoiceQueueId']=_0x701e86[_0x6f6c('0x24')];this[_0x6f6c('0x25')]=_0x701e86[_0x6f6c('0x25')];this['originatecalleridnum']=_0x701e86[_0x6f6c('0x26')]||'';this['originatecalleridname']=_0x701e86[_0x6f6c('0x27')]||'';}module[_0x6f6c('0x28')]=AgentComplete; \ No newline at end of file +var _0x0efc=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','number','starttime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','responsetime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0efc,0x104));var _0xc0ef=function(_0x26ac72,_0x482803){_0x26ac72=_0x26ac72-0x0;var _0x25fc90=_0x0efc[_0x26ac72];return _0x25fc90;};'use strict';var util=require(_0xc0ef('0x0'));var _=require(_0xc0ef('0x1'));var moment=require(_0xc0ef('0x2'));function getSeconds(_0x560a87,_0x4140a0){var _0x2e37af=moment(_0x560a87)['milliseconds'](0x0);var _0x2c4806=moment(_0x4140a0)[_0xc0ef('0x3')](0x0);return _0x2e37af[_0xc0ef('0x4')](_0x2c4806,_0xc0ef('0x5'));}function AgentComplete(_0x2612fa,_0x4b8ac2){this[_0xc0ef('0x6')]=0x4;this[_0xc0ef('0x7')]=_0xc0ef('0x8');this[_0xc0ef('0x9')]=_0x2612fa[_0xc0ef('0x9')];this[_0xc0ef('0xa')]=_0x2612fa[_0xc0ef('0xa')];this['campaigntype']=_0x2612fa['type']===_0xc0ef('0xb')?'queue':_0x2612fa[_0xc0ef('0xa')];this['countbusyretry']=_0x2612fa[_0xc0ef('0xc')];this[_0xc0ef('0xd')]=_0x2612fa[_0xc0ef('0xd')];this['countnoanswerretry']=_0x2612fa[_0xc0ef('0xe')];this[_0xc0ef('0xf')]=_0x2612fa[_0xc0ef('0xc')]+_0x2612fa[_0xc0ef('0xd')]+_0x2612fa[_0xc0ef('0xe')];this['uniqueid']=_0x4b8ac2['uniqueid'];this[_0xc0ef('0x10')]=_0x2612fa[_0xc0ef('0x11')];this[_0xc0ef('0x12')]=_0x2612fa[_0xc0ef('0x13')];this[_0xc0ef('0x14')]=_0x2612fa[_0xc0ef('0x14')];this['responsetime']=_0x2612fa['responsetime'];this['answertime']=_0x2612fa[_0xc0ef('0x15')];this['endtime']=moment()[_0xc0ef('0x16')](_0xc0ef('0x17'));this['ringtime']=getSeconds(_0x2612fa[_0xc0ef('0x18')],_0x2612fa[_0xc0ef('0x14')]);this[_0xc0ef('0x19')]=getSeconds(_0x2612fa['answertime'],_0x2612fa[_0xc0ef('0x18')]);this[_0xc0ef('0x1a')]=getSeconds(this['endtime'],_0x2612fa[_0xc0ef('0x15')]);this[_0xc0ef('0x1b')]=_0x4b8ac2[_0xc0ef('0x1b')];this[_0xc0ef('0x1c')]=_0x4b8ac2[_0xc0ef('0x1c')];this[_0xc0ef('0x1d')]=_0x4b8ac2[_0xc0ef('0x1d')];this['callback']=_0x2612fa[_0xc0ef('0x1e')];this[_0xc0ef('0x1f')]=_0x2612fa[_0xc0ef('0x1f')];this[_0xc0ef('0x20')]=_0x2612fa[_0xc0ef('0x20')];this[_0xc0ef('0x21')]=_0x2612fa[_0xc0ef('0x21')];this[_0xc0ef('0x22')]=_0x2612fa['ContactId'];this[_0xc0ef('0x23')]=_0x2612fa[_0xc0ef('0x23')];this['UserId']=_0x2612fa[_0xc0ef('0x24')];this[_0xc0ef('0x25')]=_0x2612fa[_0xc0ef('0x25')];this[_0xc0ef('0x26')]=_0x2612fa[_0xc0ef('0x26')];this[_0xc0ef('0x27')]=_0x2612fa[_0xc0ef('0x27')]||'';this[_0xc0ef('0x28')]=_0x2612fa[_0xc0ef('0x28')]||'';}module[_0xc0ef('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 52516d5..a5975dd 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 _0x80e0=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','calleridname','calleridnum','endtime','responsetime','holdtime','talktime'];(function(_0x3ccffa,_0x453973){var _0x5c7f83=function(_0x5d4321){while(--_0x5d4321){_0x3ccffa['push'](_0x3ccffa['shift']());}};_0x5c7f83(++_0x453973);}(_0x80e0,0x9d));var _0x080e=function(_0x3cbdf6,_0x31b9f2){_0x3cbdf6=_0x3cbdf6-0x0;var _0x579447=_0x80e0[_0x3cbdf6];return _0x579447;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x080e('0x0'));function getSeconds(_0x29c84f,_0x43e383){var _0x4c3ef9=moment(_0x29c84f)[_0x080e('0x1')](0x0);var _0x1a85e2=moment(_0x43e383)[_0x080e('0x1')](0x0);return _0x4c3ef9['diff'](_0x1a85e2,_0x080e('0x2'));}function Final(_0x1bbe6a){this[_0x080e('0x3')]=_0x1bbe6a['uniqueid'];this['scheduledat']=_0x1bbe6a['scheduledat'];this[_0x080e('0x4')]=_0x1bbe6a['type'];this[_0x080e('0x5')]=_0x1bbe6a['type']===_0x080e('0x6')?_0x080e('0x7'):_0x1bbe6a[_0x080e('0x4')];this[_0x080e('0x8')]=_0x1bbe6a[_0x080e('0x8')];this['countcongestionretry']=_0x1bbe6a['countcongestionretry'];this[_0x080e('0x9')]=_0x1bbe6a[_0x080e('0x9')];this[_0x080e('0xa')]=_0x1bbe6a[_0x080e('0x8')]+_0x1bbe6a['countcongestionretry']+_0x1bbe6a['countnoanswerretry'];this[_0x080e('0x7')]=_0x1bbe6a[_0x080e('0x7')];this[_0x080e('0xb')]=_0x1bbe6a['calleridname'];this[_0x080e('0xc')]=_0x1bbe6a[_0x080e('0xc')];this['starttime']=_0x1bbe6a['starttime'];this['responsetime']=_0x1bbe6a['responsetime'];this[_0x080e('0xd')]=_0x1bbe6a[_0x080e('0xe')];this['ringtime']=_0x1bbe6a['ringtime']||0x0;this[_0x080e('0xf')]=_0x1bbe6a['holdtime']||0x0;this['talktime']=_0x1bbe6a[_0x080e('0x10')]||0x0;this['callback']=_0x1bbe6a[_0x080e('0x11')];this[_0x080e('0x12')]=_0x1bbe6a[_0x080e('0x12')];this[_0x080e('0x13')]=_0x1bbe6a['callbackat'];this[_0x080e('0x14')]=_0x1bbe6a[_0x080e('0x14')];this[_0x080e('0x15')]=_0x1bbe6a['ContactId'];this[_0x080e('0x16')]=_0x1bbe6a[_0x080e('0x16')];this[_0x080e('0x17')]=_0x1bbe6a['UserId'];this[_0x080e('0x18')]=_0x1bbe6a[_0x080e('0x18')];this[_0x080e('0x19')]=_0x1bbe6a['CampaignId'];this[_0x080e('0x1a')]=_0x1bbe6a['originatecalleridnum']||'';this[_0x080e('0x1b')]=_0x1bbe6a[_0x080e('0x1b')]||'';}module[_0x080e('0x1c')]=Final; \ No newline at end of file +var _0x50e5=['countglobal','calleridname','calleridnum','starttime','responsetime','ringtime','talktime','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4b065e,_0x2ada02){var _0xd7c81d=function(_0x19be01){while(--_0x19be01){_0x4b065e['push'](_0x4b065e['shift']());}};_0xd7c81d(++_0x2ada02);}(_0x50e5,0xb7));var _0x550e=function(_0x380812,_0x189802){_0x380812=_0x380812-0x0;var _0x49b5ad=_0x50e5[_0x380812];return _0x49b5ad;};'use strict';var util=require(_0x550e('0x0'));var _=require(_0x550e('0x1'));var moment=require('moment');function getSeconds(_0x736dcd,_0x3e85ce){var _0x3edf56=moment(_0x736dcd)[_0x550e('0x2')](0x0);var _0x40aee6=moment(_0x3e85ce)[_0x550e('0x2')](0x0);return _0x3edf56[_0x550e('0x3')](_0x40aee6,_0x550e('0x4'));}function Final(_0x19981b){this[_0x550e('0x5')]=_0x19981b[_0x550e('0x5')];this[_0x550e('0x6')]=_0x19981b['scheduledat'];this[_0x550e('0x7')]=_0x19981b[_0x550e('0x7')];this['campaigntype']=_0x19981b[_0x550e('0x7')]===_0x550e('0x8')?_0x550e('0x9'):_0x19981b['type'];this[_0x550e('0xa')]=_0x19981b['countbusyretry'];this['countcongestionretry']=_0x19981b[_0x550e('0xb')];this[_0x550e('0xc')]=_0x19981b['countnoanswerretry'];this[_0x550e('0xd')]=_0x19981b[_0x550e('0xa')]+_0x19981b[_0x550e('0xb')]+_0x19981b[_0x550e('0xc')];this['queue']=_0x19981b[_0x550e('0x9')];this['calleridname']=_0x19981b[_0x550e('0xe')];this['calleridnum']=_0x19981b[_0x550e('0xf')];this[_0x550e('0x10')]=_0x19981b[_0x550e('0x10')];this[_0x550e('0x11')]=_0x19981b[_0x550e('0x11')];this['endtime']=_0x19981b[_0x550e('0x11')];this['ringtime']=_0x19981b[_0x550e('0x12')]||0x0;this['holdtime']=_0x19981b['holdtime']||0x0;this[_0x550e('0x13')]=_0x19981b[_0x550e('0x13')]||0x0;this['callback']=_0x19981b['callback'];this['callbackuniqueid']=_0x19981b[_0x550e('0x14')];this['callbackat']=_0x19981b['callbackat'];this[_0x550e('0x15')]=_0x19981b[_0x550e('0x15')];this[_0x550e('0x16')]=_0x19981b[_0x550e('0x16')];this[_0x550e('0x17')]=_0x19981b[_0x550e('0x17')];this[_0x550e('0x18')]=_0x19981b[_0x550e('0x18')];this[_0x550e('0x19')]=_0x19981b['VoiceQueueId'];this[_0x550e('0x1a')]=_0x19981b[_0x550e('0x1a')];this['originatecalleridnum']=_0x19981b['originatecalleridnum']||'';this[_0x550e('0x1b')]=_0x19981b[_0x550e('0x1b')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 2fe9af6..f33ad46 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x347eb2,_0x35bea1){var _0x439d89=function(_0x459db7){while(--_0x459db7){_0x347eb2['push'](_0x347eb2['shift']());}};_0x439d89(++_0x35bea1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x17a09e,_0x3f9a41){var _0x44e54d=function(_0xee8d20){while(--_0xee8d20){_0x17a09e['push'](_0x17a09e['shift']());}};_0x44e54d(++_0x3f9a41);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 4a1d430..c832ddd 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 _0x9221=['countcongestionretry','countnoanswerretry','countglobal','countbusyretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue'];(function(_0x3c5aa6,_0x4c4f86){var _0x49e397=function(_0x37004d){while(--_0x37004d){_0x3c5aa6['push'](_0x3c5aa6['shift']());}};_0x49e397(++_0x4c4f86);}(_0x9221,0x128));var _0x1922=function(_0x203451,_0x36cdd9){_0x203451=_0x203451-0x0;var _0x23dc34=_0x9221[_0x203451];return _0x23dc34;};'use strict';var util=require(_0x1922('0x0'));var _=require('lodash');var moment=require(_0x1922('0x1'));function getSeconds(_0x3099e9,_0x432c28){var _0xdfa4a4=moment(_0x3099e9)[_0x1922('0x2')](0x0);var _0x344cd0=moment(_0x432c28)['milliseconds'](0x0);return _0xdfa4a4[_0x1922('0x3')](_0x344cd0,_0x1922('0x4'));}function History(_0x5cd920){this['uniqueid']=_0x5cd920['uniqueid'];this['scheduledat']=_0x5cd920[_0x1922('0x5')]||undefined;this[_0x1922('0x6')]=_0x5cd920[_0x1922('0x6')];this[_0x1922('0x7')]=_0x5cd920[_0x1922('0x6')]===_0x1922('0x8')?_0x1922('0x9'):_0x5cd920['type'];this['countbusyretry']=_0x5cd920['countbusyretry'];this[_0x1922('0xa')]=_0x5cd920[_0x1922('0xa')];this[_0x1922('0xb')]=_0x5cd920[_0x1922('0xb')];this[_0x1922('0xc')]=_0x5cd920[_0x1922('0xd')]+_0x5cd920['countcongestionretry']+_0x5cd920['countnoanswerretry'];this[_0x1922('0x9')]=_0x5cd920[_0x1922('0x9')];this['calleridname']=_0x5cd920[_0x1922('0xe')];this[_0x1922('0xf')]=_0x5cd920['number'];this[_0x1922('0x10')]=_0x5cd920[_0x1922('0x10')];this[_0x1922('0x11')]=_0x5cd920[_0x1922('0x11')];this[_0x1922('0x12')]=_0x5cd920[_0x1922('0x11')];this[_0x1922('0x13')]=getSeconds(_0x5cd920[_0x1922('0x11')],_0x5cd920[_0x1922('0x10')]);this[_0x1922('0x14')]=0x0;this[_0x1922('0x15')]=0x0;this['callback']=_0x5cd920[_0x1922('0x16')];this[_0x1922('0x17')]=_0x5cd920[_0x1922('0x17')];this[_0x1922('0x18')]=_0x5cd920['callbackat'];this[_0x1922('0x19')]=_0x5cd920[_0x1922('0x19')];this['ContactId']=_0x5cd920[_0x1922('0x1a')];this[_0x1922('0x1b')]=_0x5cd920[_0x1922('0x1b')];this[_0x1922('0x1c')]=_0x5cd920['UserId'];this['VoiceQueueId']=_0x5cd920[_0x1922('0x1d')];this[_0x1922('0x1e')]=_0x5cd920['CampaignId'];this[_0x1922('0x1f')]=_0x5cd920[_0x1922('0x1f')]||'';this['originatecalleridname']=_0x5cd920[_0x1922('0x20')]||'';}module[_0x1922('0x21')]=History; \ No newline at end of file +var _0xf2dd=['countnoanswerretry','countglobal','calleridname','name','number','starttime','responsetime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x3606f3,_0x340f3d){var _0x1255df=function(_0x542604){while(--_0x542604){_0x3606f3['push'](_0x3606f3['shift']());}};_0x1255df(++_0x340f3d);}(_0xf2dd,0x1f3));var _0xdf2d=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xf2dd[_0x193e28];return _0x20ef59;};'use strict';var util=require(_0xdf2d('0x0'));var _=require(_0xdf2d('0x1'));var moment=require(_0xdf2d('0x2'));function getSeconds(_0x482fc3,_0x35b382){var _0x4498e0=moment(_0x482fc3)[_0xdf2d('0x3')](0x0);var _0x353b5c=moment(_0x35b382)[_0xdf2d('0x3')](0x0);return _0x4498e0[_0xdf2d('0x4')](_0x353b5c,_0xdf2d('0x5'));}function History(_0x4face3){this[_0xdf2d('0x6')]=_0x4face3[_0xdf2d('0x6')];this[_0xdf2d('0x7')]=_0x4face3['scheduledat']||undefined;this['type']=_0x4face3[_0xdf2d('0x8')];this[_0xdf2d('0x9')]=_0x4face3[_0xdf2d('0x8')]==='outbound'?_0xdf2d('0xa'):_0x4face3[_0xdf2d('0x8')];this['countbusyretry']=_0x4face3[_0xdf2d('0xb')];this[_0xdf2d('0xc')]=_0x4face3[_0xdf2d('0xc')];this[_0xdf2d('0xd')]=_0x4face3[_0xdf2d('0xd')];this[_0xdf2d('0xe')]=_0x4face3[_0xdf2d('0xb')]+_0x4face3[_0xdf2d('0xc')]+_0x4face3[_0xdf2d('0xd')];this['queue']=_0x4face3[_0xdf2d('0xa')];this[_0xdf2d('0xf')]=_0x4face3[_0xdf2d('0x10')];this['calleridnum']=_0x4face3[_0xdf2d('0x11')];this[_0xdf2d('0x12')]=_0x4face3[_0xdf2d('0x12')];this[_0xdf2d('0x13')]=_0x4face3[_0xdf2d('0x13')];this['endtime']=_0x4face3['responsetime'];this[_0xdf2d('0x14')]=getSeconds(_0x4face3[_0xdf2d('0x13')],_0x4face3[_0xdf2d('0x12')]);this[_0xdf2d('0x15')]=0x0;this['talktime']=0x0;this['callback']=_0x4face3['callback'];this[_0xdf2d('0x16')]=_0x4face3[_0xdf2d('0x16')];this['callbackat']=_0x4face3[_0xdf2d('0x17')];this['recallme']=_0x4face3[_0xdf2d('0x18')];this[_0xdf2d('0x19')]=_0x4face3[_0xdf2d('0x19')];this['ListId']=_0x4face3['ListId'];this['UserId']=_0x4face3[_0xdf2d('0x1a')];this[_0xdf2d('0x1b')]=_0x4face3[_0xdf2d('0x1b')];this[_0xdf2d('0x1c')]=_0x4face3[_0xdf2d('0x1c')];this[_0xdf2d('0x1d')]=_0x4face3[_0xdf2d('0x1d')]||'';this[_0xdf2d('0x1e')]=_0x4face3[_0xdf2d('0x1e')]||'';}module[_0xdf2d('0x1f')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 5c69cc7..29c4f3d 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 _0x7564=['emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','reachable','SIP/%s','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','[syncHangupInAMD][createHistory]','MACHINE','AMD','[syncMachine][createHistory]','[syncMachine]','HangupInAMD','[syncHangupInAMDIvr]','Machine','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','Abandoned','CALLEREXIT','actionid','paused','stateinterface','locked','push','queueStatusComplete','idHopper','[Catch][Preview][syncQueueStatusComplete]','VoiceQueueId','CampaignId','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','minutes','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[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','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\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]','Umin\x20=\x20','util','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','stringify','format','voice:queue:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','inspect','error','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','prototype','loopClearZombieChannels','clearZombieChannels','[uniqueid]','enqueue','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','updateOriginated'];(function(_0x498686,_0xfff2e6){var _0x48889f=function(_0x246496){while(--_0x246496){_0x498686['push'](_0x498686['shift']());}};_0x48889f(++_0xfff2e6);}(_0x7564,0x123));var _0x4756=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7564[_0x45e98e];return _0x374dba;};'use strict';var util=require(_0x4756('0x0'));var _=require('lodash');var BPromise=require(_0x4756('0x1'));var uuid=require(_0x4756('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x4756('0x3'));var Redis=require(_0x4756('0x4'));var config=require(_0x4756('0x5'));var logger=require(_0x4756('0x6'))(_0x4756('0x7'));var loggerBooked=require(_0x4756('0x6'))(_0x4756('0x8'));var loggerPredictive=require(_0x4756('0x6'))('predictive');var loggerPredictiveCalls=require(_0x4756('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x4756('0x6'))(_0x4756('0x9'));var ami=require(_0x4756('0xa'));config[_0x4756('0xb')]=_[_0x4756('0xc')](config[_0x4756('0xb')],{'host':_0x4756('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x4756('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x4756('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x4756('0x10'));var History=require(_0x4756('0x11'));var Final=require('./final');var AgentComplete=require(_0x4756('0x12'));var QueueCallerAbandon=require(_0x4756('0x13'));var Hangup=require('./hangup');var ipAgi=process[_0x4756('0x14')][_0x4756('0x15')]||_0x4756('0x16');var strategy={'rrmemory':_0x4756('0x17'),'roundrobin':_0x4756('0x18')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x29c109){this[_0x4756('0x19')]=this[_0x4756('0x19')]?this['tail'][_0x4756('0x1a')](_0x29c109):_0x29c109();};function Dialer(_0x1ce6f1,_0x91bbb6){this[_0x4756('0x1b')]=new Sequence();this['preview']=_0x91bbb6;this['voiceQueues']=_0x1ce6f1[_0x4756('0x1c')];this[_0x4756('0x1d')]=_0x1ce6f1['campaigns'];this[_0x4756('0x1e')]=_0x1ce6f1['agents'];this[_0x4756('0x1f')]=_0x1ce6f1[_0x4756('0x1f')];this[_0x4756('0x20')]=config[_0x4756('0x20')]||0x2;this[_0x4756('0x21')]={};this[_0x4756('0x22')]={};this[_0x4756('0x23')]={};this[_0x4756('0x24')]={};this[_0x4756('0x25')]={};this['startPredictive']={};this['startProgressive']={};this[_0x4756('0x26')]={};this[_0x4756('0x27')]={};this['queueBookedRR']={};ami['on'](_0x4756('0x28'),this[_0x4756('0x29')][_0x4756('0x2a')](this));ami['on'](_0x4756('0x2b'),this[_0x4756('0x2c')]['bind'](this));ami['on'](_0x4756('0x2d'),this[_0x4756('0x2e')][_0x4756('0x2a')](this));ami['on']('agentcomplete',this[_0x4756('0x2f')][_0x4756('0x2a')](this));ami['on'](_0x4756('0x30'),this['syncQueueSummary'][_0x4756('0x2a')](this));ami['on'](_0x4756('0x31'),this[_0x4756('0x32')]['bind'](this));ami['on'](_0x4756('0x33'),this[_0x4756('0x34')][_0x4756('0x2a')](this));ami['on'](_0x4756('0x35'),this['syncVarSet'][_0x4756('0x2a')](this));ami['on'](_0x4756('0x36'),this[_0x4756('0x37')][_0x4756('0x2a')](this));ami['on']('queuestatuscomplete',this[_0x4756('0x38')][_0x4756('0x2a')](this));this[_0x4756('0x39')]();this['loopClearZombieChannels']();}function isNotNull(_0x1ac0fd){return _0x1ac0fd!==null&&!_[_0x4756('0x3a')](_0x1ac0fd);}function checkIsLoggedIn(_0x17c95b,_0x15c37c){return function(){if(_0x15c37c<=0x0){_0x17c95b[_0x4756('0x3b')]=_0x4756('0x3c');throw _0x17c95b[_0x4756('0x3d')]+_0x4756('0x3e');}};}function isActive(_0x2827c1){return _0x2827c1;}function checkIsActive(_0x127e25,_0x1e2292){return function(){if(!isActive(_0x1e2292)){_0x127e25[_0x4756('0x3b')]='NOT_ACTIVE';throw _0x127e25[_0x4756('0x3d')]+_0x4756('0x3f');}};}function checkInterval(_0x8438c4){return function(){if(!isNotNull(_0x8438c4[_0x4756('0x40')])){_0x8438c4[_0x4756('0x3b')]='INTERVAL_IS_NULL';throw _0x8438c4[_0x4756('0x3d')]+_0x4756('0x41');}if(!isNotNull(_0x8438c4[_0x4756('0x40')][_0x4756('0x42')])){_0x8438c4['message']=_0x4756('0x43');throw _0x8438c4[_0x4756('0x3d')]+_0x4756('0x41');}if(!isNotNull(_[_0x4756('0x44')](_0x8438c4[_0x4756('0x40')]['Intervals']))){_0x8438c4[_0x4756('0x3b')]=_0x4756('0x43');throw _0x8438c4[_0x4756('0x3d')]+_0x4756('0x41');}};}function msgResponse(_0x4c3090,_0x482fe7,_0x1610f2){return{'action':_0x4c3090,'response':_0x482fe7,'message':_0x1610f2,'stack':_0x1610f2};}function myreject(_0x38d29e){return function(_0x2d7330){return _0x38d29e(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x2d7330)));};}function getSeconds(_0x3b29cf,_0x15cf00){var _0x2e2d92=moment(_0x3b29cf)['milliseconds'](0x0);var _0x45522d=moment(_0x15cf00)[_0x4756('0x45')](0x0);return _0x2e2d92[_0x4756('0x46')](_0x45522d,_0x4756('0x47'));}function emit(_0x482c04,_0x50573c,_0x4b0027){io['to'](_0x482c04)[_0x4756('0x48')](_0x50573c,_0x4b0027);}function emitVoiceQueueSummary(_0x13de8d){if(_0x13de8d[_0x4756('0x49')]===_0x4756('0x4a')){var _0x3f7a24={'id':_0x13de8d['id'],'name':_0x13de8d['name'],'strategy':_0x13de8d[_0x4756('0x4b')],'answered':_0x13de8d[_0x4756('0x4c')],'available':_0x13de8d[_0x4756('0x4d')],'loggedIn':_0x13de8d[_0x4756('0x4e')],'pTalking':_0x13de8d[_0x4756('0x4f')],'sumBillable':_0x13de8d['sumBillable'],'sumDuration':_0x13de8d['sumDuration'],'sumHoldTime':_0x13de8d[_0x4756('0x50')]||0x0,'talking':_0x13de8d['talking'],'total':_0x13de8d[_0x4756('0x51')],'type':_0x13de8d[_0x4756('0x49')],'unmanaged':_0x13de8d[_0x4756('0x52')],'abandoned':_0x13de8d[_0x4756('0x53')],'waiting':_0x13de8d[_0x4756('0x54')],'loggedInDb':_0x13de8d[_0x4756('0x55')],'dialActive':_0x13de8d['dialActive'],'dialMethod':_0x13de8d['dialMethod'],'dialOriginateCallerIdName':_0x13de8d[_0x4756('0x56')],'dialOriginateCallerIdNumber':_0x13de8d[_0x4756('0x57')],'dialOriginateTimeout':_0x13de8d[_0x4756('0x58')],'dialPrefix':_0x13de8d[_0x4756('0x59')],'outboundAnswerAgiCallsDay':_0x13de8d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x13de8d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x13de8d[_0x4756('0x5a')],'outboundBusyCallsDay':_0x13de8d[_0x4756('0x5b')],'outboundCongestionCallsDay':_0x13de8d[_0x4756('0x5c')],'outboundDropCallsDayACS':_0x13de8d[_0x4756('0x5d')],'outboundDropCallsDayCallersExit':_0x13de8d[_0x4756('0x5e')],'outboundDropCallsDayTimeout':_0x13de8d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x13de8d[_0x4756('0x5f')],'outboundNoSuchCallsDay':_0x13de8d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x13de8d[_0x4756('0x60')],'outboundReCallsDay':_0x13de8d['outboundReCallsDay'],'outboundRejectCallsDay':_0x13de8d[_0x4756('0x61')],'outboundUnknownCallsDay':_0x13de8d[_0x4756('0x62')],'predictiveIntervalAnsweredCalls':_0x13de8d[_0x4756('0x63')],'predictiveIntervalAvgHoldtime':_0x13de8d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x13de8d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x13de8d['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x13de8d[_0x4756('0x64')],'predictiveIntervalErlangCalls':_0x13de8d[_0x4756('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x13de8d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x13de8d[_0x4756('0x66')],'predictiveIntervalMultiplicativeFactor':_0x13de8d[_0x4756('0x67')],'predictiveIntervalPauses':_0x13de8d[_0x4756('0x68')],'predictiveIntervalAvailable':_0x13de8d[_0x4756('0x69')],'predictiveIntervalTotalCalls':_0x13de8d[_0x4756('0x6a')],'message':_0x13de8d[_0x4756('0x3b')],'originated':_0x13de8d[_0x4756('0x6b')],'erlangCalls':_0x13de8d[_0x4756('0x6c')],'erlangCallToSecond':_0x13de8d['erlangCallToSecond'],'erlangAbandonmentRate':_0x13de8d[_0x4756('0x6d')],'erlangBusyFactor':_0x13de8d['erlangBusyFactor'],'startPredictive':_0x13de8d[_0x4756('0x6e')],'startProgressive':_0x13de8d['startProgressive']};if(_0x13de8d[_0x4756('0x6f')]){_0x3f7a24[_0x4756('0x6f')]={'id':_0x13de8d[_0x4756('0x6f')]['id'],'name':_0x13de8d[_0x4756('0x6f')]['name'],'active':_0x13de8d[_0x4756('0x6f')][_0x4756('0x70')],'callerid':_0x13de8d[_0x4756('0x6f')][_0x4756('0x71')]};}if(_0x13de8d['Interval']){_0x3f7a24[_0x4756('0x40')]={'id':_0x13de8d['Interval']['id'],'name':_0x13de8d[_0x4756('0x40')][_0x4756('0x3d')]};}var _0x2ad1dc=md5(JSON[_0x4756('0x72')](_0x3f7a24));if(_0x13de8d[_0x4756('0x3')]!==_0x2ad1dc){_0x13de8d[_0x4756('0x3')]=_0x2ad1dc;emit(util[_0x4756('0x73')](_0x4756('0x74'),_0x3f7a24[_0x4756('0x3d')]),'voice_queue:save',_0x3f7a24);}}}function emitCampaignSummary(_0x4b5715){if(_0x4b5715[_0x4756('0x49')]==='ivr'){emit(util[_0x4756('0x73')]('campaign:ivr:%s',_0x4b5715[_0x4756('0x3d')]),_0x4756('0x75'),_0x4b5715);}}function checkGetDataPredictive(_0x1adc74){if(isNotNull(_0x1adc74)){if(!_[_0x4756('0x44')](_0x1adc74)){loggerPredictive[_0x4756('0x76')](_0x4756('0x77'));loggerPredictive[_0x4756('0x76')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1adc74[_0x4756('0x6a')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x78'),_0x1adc74[_0x4756('0x63')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x79'),_0x1adc74[_0x4756('0x64')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x7a'),_0x1adc74[_0x4756('0x7b')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x7c'),_0x1adc74[_0x4756('0x7d')]);loggerPredictive['info'](_0x4756('0x7e'),_0x1adc74[_0x4756('0x7f')]);loggerPredictive['info'](_0x4756('0x80'));if(_0x1adc74[_0x4756('0x6a')]>0x0){if(!_[_0x4756('0x3a')](_0x1adc74[_0x4756('0x7f')])&&_0x1adc74[_0x4756('0x7f')]>0x0){return!![];}else{loggerPredictive[_0x4756('0x76')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x4756('0x3a')](_0x1adc74[_0x4756('0x7d')])&&_0x1adc74[_0x4756('0x7d')]>0x0){return!![];}else{loggerPredictive['info'](_0x4756('0x81'));}}else{loggerPredictive[_0x4756('0x76')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x4756('0x76')](_0x4756('0x82'));}}else{loggerPredictive[_0x4756('0x76')](_0x4756('0x82'));}return![];}function mergeDataErlangB(_0x5e8a88){return function(_0x4be78c){loggerPredictive[_0x4756('0x76')](_0x4756('0x83'));loggerPredictive[_0x4756('0x76')](_0x4756('0x84'),_0x4be78c['erlangCalls']);loggerPredictive[_0x4756('0x76')](_0x4756('0x85'),_0x4be78c[_0x4756('0x86')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x87'),_0x4be78c['erlangAbandonmentRate']);loggerPredictive[_0x4756('0x76')](_0x4756('0x88'),_0x4be78c[_0x4756('0x89')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x87'),_0x4be78c[_0x4756('0x6d')]);loggerPredictive[_0x4756('0x76')](_0x4756('0x80'));_[_0x4756('0x8a')](_0x5e8a88,_0x4be78c);};}function getDiff(_0x1a1e7b){var _0x247e11=moment()['milliseconds'](0x0);var _0x54a519=moment(_0x1a1e7b)[_0x4756('0x45')](0x0);return _0x247e11[_0x4756('0x46')](_0x54a519,_0x4756('0x47'));}function ifInterval(_0x443681,_0x3f179d){if(_[_0x4756('0x3a')](_0x3f179d)){return![];}if(getDiff(_0x3f179d)<_0x443681*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2598e0){if(isNotNull(_0x2598e0)){if(!_[_0x4756('0x3a')](_0x2598e0[_0x4756('0x8b')])){_0x2598e0[_0x4756('0x8b')]=undefined;loggerPredictive[_0x4756('0x76')](_0x2598e0[_0x4756('0x3d')],_0x4756('0x8c'));}if(!_[_0x4756('0x3a')](_0x2598e0[_0x4756('0x6e')])){_0x2598e0['startPredictive']=undefined;loggerPredictive[_0x4756('0x76')](_0x2598e0[_0x4756('0x3d')],_0x4756('0x8d'));}if(!_[_0x4756('0x3a')](_0x2598e0['handlePredictive'])){clearInterval(_0x2598e0['handlePredictive']);_0x2598e0[_0x4756('0x8e')]=undefined;loggerPredictive[_0x4756('0x76')](_0x2598e0[_0x4756('0x3d')],_0x4756('0x8f'));}}}function erlangb(_0x48eaa2,_0x204330){if(_0x204330===0x0){return 0x0;}var _0x4ee94b=0x1;for(var _0x21e2ad=0x1;_0x21e2ad<=_0x204330;_0x21e2ad+=0x1){_0x4ee94b=0x1+_0x4ee94b*_0x21e2ad/_0x48eaa2;}return 0x1/_0x4ee94b;}function isVoiceQueueOutbound(_0x2ac676){return _0x2ac676===_0x4756('0x4a');}function isNotPreview(_0x35626d){return _0x35626d!==_0x4756('0x90');}function isCampaignIvr(_0x55e6da){return _0x55e6da===_0x4756('0x91');}function getCallerId(_0x5c1ea5,_0x58c8bc,_0x42a7da){if(!_[_0x4756('0x3a')](_0x42a7da)&&_0x4756('0x92')===typeof _0x42a7da&&!_[_0x4756('0x44')](_0x42a7da)){if(!_[_0x4756('0x3a')](_0x58c8bc)&&_0x4756('0x92')===typeof _0x58c8bc&&!_[_0x4756('0x44')](_0x58c8bc)){return util['format'](_0x4756('0x93'),_0x58c8bc,_0x42a7da);}return util[_0x4756('0x73')](_0x4756('0x93'),_0x42a7da,_0x42a7da);}if(!_[_0x4756('0x3a')](_0x5c1ea5)&&'string'===typeof _0x5c1ea5&&!_[_0x4756('0x44')](_0x5c1ea5)){return _0x5c1ea5;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x522524,_0xbb6b1b){return function(_0x55c045){freeVariablesPredictive(_0xbb6b1b);emitVoiceQueueSummary(_0xbb6b1b);emitCampaignSummary(_0xbb6b1b);loggerSyncQueueSummary['error'](_0x522524,util[_0x4756('0x94')](_0x55c045,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5bf57d,_0x385f1c){return function(_0x9a2c44){loggerPredictive[_0x4756('0x95')](_0x385f1c['name'],_0x5bf57d);loggerPredictive[_0x4756('0x95')](_0x9a2c44['stack']);freeVariablesPredictive(_0x385f1c);};}function loggerCatch(_0x3bff58){return function(_0x1e95a4){logger[_0x4756('0x95')](_0x3bff58,util['inspect'](_0x1e95a4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x38a205){return _0x38a205&&!_[_0x4756('0x3a')](_0x38a205)&&_0x38a205[_0x4756('0x96')]>0x0;}function decremetOriginate(_0x77f5de){if(!_[_0x4756('0x3a')](_0x77f5de)&&_0x77f5de!==null){if(_0x77f5de[_0x4756('0x97')](_0x4756('0x6b'))){if(_0x77f5de[_0x4756('0x6b')]>0x0){_0x77f5de[_0x4756('0x6b')]-=0x1;}else{logger['error'](_0x4756('0x98'));}}}else{logger[_0x4756('0x95')](_0x4756('0x99'));}}function checkContactLowerLimitOriginate(_0x13a40e,_0x1a0758,_0x2651fc){if(_0x1a0758>_0x2651fc){for(var _0x259be4=0x0;_0x259be4<_0x1a0758-_0x2651fc;_0x259be4+=0x1){decremetOriginate(_0x13a40e);}}}function loggerGetContactDialer(_0x76c23c,_0x299c24,_0x5a641d){return function(_0x4727fa){checkContactLowerLimitOriginate(_0x299c24,_0x5a641d,0x0);logger[_0x4756('0x95')](_0x76c23c,util['inspect'](_0x4727fa,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d93cd){return function(_0x36dfa5){if(isNotNull(_0x36dfa5)&&isNotNull(_0x36dfa5[0x0])){if(_0x36dfa5[0x0][_0x4756('0x9a')]>0x0){_0x1d93cd[_0x4756('0x3b')]='RESCHEDULED_CONTACTS';logger['info'](_0x4756('0x9b')+_0x1d93cd['name'],_0x36dfa5[0x0][_0x4756('0x9a')],'contacts');}else{_0x1d93cd[_0x4756('0x3b')]=_0x4756('0x9c');logger[_0x4756('0x76')]('[getContactDialer2][Empty]'+_0x1d93cd[_0x4756('0x3d')]);}}};}function notSendMessagesQueue(_0x1087bf){if(_0x1087bf[_0x4756('0x9d')]){freeVariablesPredictive(_0x1087bf);if(_0x1087bf[_0x4756('0x6b')]===0x0&&_0x1087bf['talking']===0x0&&_0x1087bf['waiting']===0x0&&(_0x1087bf['pTalking']||0x0)===0x0){_0x1087bf[_0x4756('0x9d')]=![];_0x1087bf[_0x4756('0x4d')]=0x0;_0x1087bf[_0x4756('0x3b')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4756('0x95')](_0x4756('0x9e'),_0x1087bf[_0x4756('0x3d')],_0x4756('0x9f'));}else{_0x1087bf[_0x4756('0x3b')]=_0x4756('0xa0');loggerSyncQueueSummary[_0x4756('0x95')](_0x4756('0x9e'),_0x1087bf['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x1087bf);}}function notSendMessagesCampaign(_0x410cb6){if(_0x410cb6[_0x4756('0x9d')]){if(_0x410cb6[_0x4756('0x6b')]===0x0){_0x410cb6[_0x4756('0x9d')]=![];_0x410cb6[_0x4756('0x3b')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4756('0x95')](_0x4756('0xa1'),_0x410cb6[_0x4756('0x3d')],_0x4756('0x9f'));}else{_0x410cb6[_0x4756('0x3b')]=_0x4756('0xa0');loggerSyncQueueSummary[_0x4756('0x95')](_0x4756('0xa1'),_0x410cb6[_0x4756('0x3d')],_0x4756('0xa2'));}emitCampaignSummary(_0x410cb6);}}function createObjHistory(_0x2ed12a,_0x512e7d,_0x5d99ee,_0x1b6249,_0xd8a51a){_0x2ed12a[_0x4756('0x3b')]=_0x5d99ee;var _0x187392=new Action(_0x2ed12a,_0x512e7d);var _0x4d5b76=new History(_0x187392);_0x4d5b76[_0x4756('0xa3')]=_0x1b6249;_0x4d5b76[_0x4756('0xa4')]=_0xd8a51a;_0x4d5b76[_0x4756('0xa5')]=_0x187392[_0x4756('0xa6')];return _0x4d5b76;}Dialer[_0x4756('0xa7')][_0x4756('0xa8')]=function(){var _0x20171c=this;setInterval(function(){_0x20171c[_0x4756('0xa9')](_0x20171c[_0x4756('0x24')],_0x4756('0xaa'));_0x20171c[_0x4756('0xa9')](_0x20171c[_0x4756('0x22')],'[actions]');},0x32c8);};Dialer[_0x4756('0xa7')][_0x4756('0xa9')]=function(_0x2dac42,_0x360683){var _0x13c916=this;for(var _0x5c4e24 in _0x2dac42){if(_0x2dac42[_0x4756('0x97')](_0x5c4e24)){this[_0x4756('0x1b')][_0x4756('0xab')](function(){if(!_['isNil'](_0x2dac42[_0x5c4e24])){return ami[_0x4756('0xac')]({'action':_0x4756('0xad'),'channel':_0x2dac42[_0x5c4e24][_0x4756('0xae')]})[_0x4756('0xaf')](function(_0x3dfaea){if(_0x3dfaea['message']===_0x4756('0xb0')){setTimeout(function(){if(_0x2dac42[_0x5c4e24]&&_0x2dac42[_0x5c4e24][_0x4756('0x49')]!==_0x4756('0x91')){_0x13c916['updateOriginated'](_0x13c916['voiceQueues'][_0x2dac42[_0x5c4e24][_0x4756('0xb1')]]);logger[_0x4756('0x95')](_0x4756('0xb2'),_0x360683,_0x5c4e24,_0x2dac42[_0x5c4e24][_0x4756('0xb1')]);delete _0x2dac42[_0x5c4e24];}if(_0x2dac42[_0x5c4e24]&&_0x2dac42[_0x5c4e24][_0x4756('0x49')]===_0x4756('0x91')){_0x13c916['updateOriginated'](_0x13c916[_0x4756('0x1d')][_0x2dac42[_0x5c4e24][_0x4756('0xb1')]]);logger['error'](_0x4756('0xb3'),_0x360683,_0x5c4e24,_0x2dac42[_0x5c4e24][_0x4756('0xb1')]);delete _0x2dac42[_0x5c4e24];}},0x2328);}});}});}}};Dialer[_0x4756('0xa7')][_0x4756('0xb4')]=function(_0x5df96d){return BPromise[_0x4756('0xb5')]()['then'](cmHopper['countReScheduled'](_0x5df96d))['catch'](loggerCatch(_0x4756('0xb6')));};Dialer[_0x4756('0xa7')][_0x4756('0xb7')]=function(_0x1aa786){return BPromise[_0x4756('0xb5')]()['then'](cmHopperBlack[_0x4756('0xb7')](_0x1aa786))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x4756('0xa7')]['checkIsBlackListIvr']=function(_0x42352a){return BPromise[_0x4756('0xb5')]()[_0x4756('0xb8')](cmHopperBlack[_0x4756('0xb9')](_0x42352a))[_0x4756('0xaf')](loggerCatch(_0x4756('0xba')));};Dialer['prototype'][_0x4756('0xbb')]=function(_0x5d1aaa){return BPromise['resolve']()[_0x4756('0xb8')](cmHopperHistory['avgHandleTime'](_0x5d1aaa))[_0x4756('0xaf')](loggerCatch(_0x4756('0xbc')));};Dialer['prototype'][_0x4756('0xbd')]=function(_0x3eef08){return BPromise[_0x4756('0xb5')]()['then'](cmHopper[_0x4756('0xbd')](_0x3eef08))[_0x4756('0xaf')](loggerCatch(_0x4756('0xbe')));};Dialer['prototype'][_0x4756('0xbf')]=function(_0x295693,_0x39018e,_0x15aa1f,_0x1d4955){return BPromise['resolve']()[_0x4756('0xb8')](cmHopper[_0x4756('0xbf')](_0x295693,_0x39018e,_0x15aa1f,_0x1d4955))[_0x4756('0xaf')](loggerCatch(_0x4756('0xc0')));};Dialer[_0x4756('0xa7')]['getContactDialerIvr']=function(_0x5b8a0a,_0x2c59f2,_0x477ed4){return BPromise[_0x4756('0xb5')]()[_0x4756('0xb8')](cmHopper['getContactDialerIvr'](_0x5b8a0a,_0x2c59f2,_0x477ed4))['catch'](loggerCatch(_0x4756('0xc0')));};Dialer[_0x4756('0xa7')][_0x4756('0xc1')]=function(_0x12aff0){return BPromise['resolve']()[_0x4756('0xb8')](voiceQueueRt[_0x4756('0xc1')](_0x12aff0))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x4756('0xc2')]=function(_0x898ab5){return BPromise[_0x4756('0xb5')]()['then'](cmHopper[_0x4756('0xc2')](_0x898ab5))[_0x4756('0xaf')](loggerCatch(_0x4756('0xc3')));};Dialer['prototype']['createHistory']=function(_0x1008a3){return BPromise[_0x4756('0xb5')]()[_0x4756('0xb8')](cmHopperHistory[_0x4756('0xc4')](_0x1008a3))['catch'](loggerCatch(_0x4756('0xc5')));};Dialer['prototype']['updateOriginated']=function(_0x3dba20){if(!_[_0x4756('0x3a')](_0x3dba20)&&_0x3dba20!==null){if(_0x3dba20[_0x4756('0x97')](_0x4756('0x6b'))){if(_0x3dba20['originated']>0x0){_0x3dba20['originated']-=0x1;}else{logger[_0x4756('0x95')](_0x4756('0xc6'));}}}else{logger[_0x4756('0x95')](_0x4756('0xc7'));}};Dialer['prototype'][_0x4756('0xc8')]=function(_0xe00857,_0x551a35){var _0x2f1374=this;return function(_0x2cf6be){_0x2f1374[_0x4756('0xc9')](_0x551a35);logger[_0x4756('0x95')](_0xe00857,util[_0x4756('0x94')](_0x2cf6be,{'showHidden':![],'depth':null}));};};Dialer[_0x4756('0xa7')][_0x4756('0xca')]=function(_0x31117a,_0x101fd5,_0x27c35f){var _0x2c44c6={'state':0x19,'statedesc':_0x4756('0xcb')};this[_0x4756('0xc9')](_0x101fd5);this[_0x4756('0xcc')](_['merge'](_0x2c44c6,_[_0x4756('0xcd')](_0x27c35f,[_0x4756('0xce'),_0x4756('0xcf'),_0x4756('0xd0'),'VoiceQueueId','CampaignId'])),_0x4756('0xd1'),_0x4756('0xd2'));logger[_0x4756('0x95')](_0x31117a);};Dialer[_0x4756('0xa7')]['isSuccess']=function(_0x1d224a){return _0x1d224a===_0x4756('0xd3');};Dialer[_0x4756('0xa7')][_0x4756('0xd4')]=function(_0x19b705){return!_[_0x4756('0x3a')](_0x19b705)&&_0x19b705&&!_[_0x4756('0x3a')](_0x19b705[_0x4756('0x3d')])&&!_[_0x4756('0x3a')](_0x19b705['active'])&&_0x19b705[_0x4756('0x70')]&&(this['trunks'][util['format']('SIP/%s',_0x19b705[_0x4756('0x3d')])]['status']===_0x4756('0xd5')||this[_0x4756('0x1f')][util[_0x4756('0x73')](_0x4756('0xd6'),_0x19b705[_0x4756('0x3d')])]['status']==='unmonitored');};Dialer[_0x4756('0xa7')][_0x4756('0xcc')]=function(_0x488d4d,_0x26b5ed,_0x47aa49){this[_0x4756('0xc4')](_0x488d4d)['catch'](loggerCatch(_0x26b5ed));this[_0x4756('0xc2')](_0x488d4d)['catch'](loggerCatch(_0x47aa49));};Dialer[_0x4756('0xa7')][_0x4756('0xd7')]=function(_0x190679){var _0x42c866=this['uniqueId'][_0x190679[_0x4756('0xd8')]];var _0xbbcd1;if(!_[_0x4756('0xd9')](_0x190679)&&!_[_0x4756('0xd9')](_0x190679[_0x4756('0xda')])&&!_[_0x4756('0xd9')](_0x190679[_0x4756('0xda')][_0x4756('0xdb')])&&_0x190679[_0x4756('0xdc')]==='xcally-motion-dialer'&&_0x42c866){if(_0x42c866[_0x4756('0x49')]!==_0x4756('0x91')&&this[_0x4756('0x1c')][_0x42c866[_0x4756('0xb1')]][_0x4756('0xdd')]&&_0x190679[_0x4756('0xde')]===_0x4756('0xdf')){delete this[_0x4756('0x24')][_0x190679[_0x4756('0xd8')]];this['updateOriginated'](this[_0x4756('0x1c')][_0x42c866['queue']]);this[_0x4756('0x1c')][_0x42c866[_0x4756('0xb1')]][_0x4756('0xe0')]+=0x1;this[_0x4756('0x1c')][_0x42c866[_0x4756('0xb1')]][_0x4756('0xe1')]+=0x1;_0xbbcd1=new Hangup(_0x42c866,_0x190679);_0xbbcd1['state']=0x12;_0xbbcd1['statedesc']='HangupInAMD';_0xbbcd1[_0x4756('0xe2')]='AMD';this[_0x4756('0xcc')](_0xbbcd1,_0x4756('0xe3'),'[syncHangupInAMD]');}if(_0x42c866[_0x4756('0x49')]!=='ivr'&&this[_0x4756('0x1c')][_0x42c866['queue']][_0x4756('0xdd')]&&_0x190679[_0x4756('0xde')]===_0x4756('0xe4')){delete this['uniqueId'][_0x190679[_0x4756('0xd8')]];this['updateOriginated'](this[_0x4756('0x1c')][_0x42c866[_0x4756('0xb1')]]);this['voiceQueues'][_0x42c866[_0x4756('0xb1')]][_0x4756('0xe0')]+=0x1;this[_0x4756('0x1c')][_0x42c866[_0x4756('0xb1')]][_0x4756('0xe1')]+=0x1;_0xbbcd1=new Hangup(_0x42c866,_0x190679);_0xbbcd1[_0x4756('0xa3')]=0x13;_0xbbcd1[_0x4756('0xa4')]='Machine';_0xbbcd1[_0x4756('0xe2')]=_0x4756('0xe5');_0xbbcd1['amd']=!![];this[_0x4756('0xcc')](_0xbbcd1,_0x4756('0xe6'),_0x4756('0xe7'));}if(_0x42c866[_0x4756('0x49')]===_0x4756('0x91')&&this[_0x4756('0x1d')][_0x42c866['queue']]['dialAMDActive']&&_0x190679['value']==='HANGUP'){delete this[_0x4756('0x24')][_0x190679[_0x4756('0xd8')]];this[_0x4756('0xc9')](this[_0x4756('0x1d')][_0x42c866['queue']]);_0xbbcd1=new Hangup(_0x42c866,_0x190679);_0xbbcd1[_0x4756('0xa3')]=0x12;_0xbbcd1['statedesc']=_0x4756('0xe8');_0xbbcd1[_0x4756('0xe2')]=_0x4756('0xe5');this['saveInDb'](_0xbbcd1,'[syncHangupInAMDIvr][createHistory]',_0x4756('0xe9'));}if(_0x42c866[_0x4756('0x49')]==='ivr'&&this[_0x4756('0x1d')][_0x42c866[_0x4756('0xb1')]][_0x4756('0xdd')]&&_0x190679[_0x4756('0xde')]==='MACHINE'){delete this[_0x4756('0x24')][_0x190679[_0x4756('0xd8')]];this[_0x4756('0xc9')](this['campaigns'][_0x42c866['queue']]);_0xbbcd1=new Hangup(_0x42c866,_0x190679);_0xbbcd1['state']=0x13;_0xbbcd1[_0x4756('0xa4')]=_0x4756('0xea');_0xbbcd1[_0x4756('0xe2')]=_0x4756('0xe5');_0xbbcd1['amd']=!![];this[_0x4756('0xcc')](_0xbbcd1,'[syncMachineIvr][createHistory]',_0x4756('0xeb'));}}};Dialer['prototype'][_0x4756('0x32')]=function(_0xa89f54){var _0x24e4f2=this[_0x4756('0x24')][_0xa89f54[_0x4756('0xd8')]];var _0x36d890=this;var _0x492388;if(_0x24e4f2&&_0x24e4f2[_0x4756('0x49')]===_0x4756('0x91')){delete this[_0x4756('0x24')][_0xa89f54[_0x4756('0xd8')]];this[_0x4756('0xc9')](this[_0x4756('0x1d')][_0x24e4f2[_0x4756('0xb1')]]);this[_0x4756('0x1d')][_0x24e4f2[_0x4756('0xb1')]][_0x4756('0xec')]+=0x1;_0x492388=new Hangup(_0x24e4f2,_0xa89f54);this[_0x4756('0xc4')](_0x492388)[_0x4756('0xaf')](loggerCatch(_0x4756('0xed')));this[_0x4756('0xc2')](_0x492388)[_0x4756('0xaf')](loggerCatch(_0x4756('0xee')));}if(_0x24e4f2&&_0x24e4f2[_0x4756('0x49')]!=='ivr'&&isNotNull(this[_0x4756('0x1c')][_0x24e4f2[_0x4756('0xb1')]][_0x4756('0xef')])){delete this['uniqueId'][_0xa89f54['uniqueid']];this['updateOriginated'](this[_0x4756('0x1c')][_0x24e4f2[_0x4756('0xb1')]]);this[_0x4756('0x1c')][_0x24e4f2['queue']][_0x4756('0xe0')]+=0x1;this[_0x4756('0x1c')][_0x24e4f2[_0x4756('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x492388=new Hangup(_0x24e4f2,_0xa89f54);_0x492388[_0x4756('0xa3')]=0x10;_0x492388[_0x4756('0xa4')]=_0x4756('0xf0');_0x492388[_0x4756('0xe2')]=_0x4756('0xf1');this[_0x4756('0xc4')](_0x492388)[_0x4756('0xaf')](loggerCatch(_0x4756('0xed')));this['moveContactManagedDialer'](_0x492388)[_0x4756('0xaf')](loggerCatch('[syncHangupIvr]'));}if(_0x24e4f2&&_0x24e4f2['type']!==_0x4756('0x91')&&!isNotNull(this['voiceQueues'][_0x24e4f2[_0x4756('0xb1')]][_0x4756('0xef')])){delete this[_0x4756('0x24')][_0xa89f54[_0x4756('0xd8')]];this[_0x4756('0xc9')](this[_0x4756('0x1c')][_0x24e4f2['queue']]);this[_0x4756('0x1c')][_0x24e4f2[_0x4756('0xb1')]][_0x4756('0x62')]+=0x1;_0x492388=new Hangup(_0x24e4f2,_0xa89f54);_0x492388[_0x4756('0xa3')]=0xc;_0x492388['statedesc']=_0xa89f54[_0x4756('0xf2')];_0x492388[_0x4756('0xe2')]=_0x4756('0xf3');this[_0x4756('0xc4')](_0x492388)['catch'](loggerCatch(_0x4756('0xed')));this[_0x4756('0xc2')](_0x492388)[_0x4756('0xaf')](loggerCatch(_0x4756('0xee')));}};Dialer['prototype'][_0x4756('0x2f')]=function(_0xb7123a){var _0x520fbb=this[_0x4756('0x24')][_0xb7123a['uniqueid']];var _0x2acf5b=this;if(this[_0x4756('0x1c')][_0xb7123a[_0x4756('0xb1')]]){if(_0x520fbb&&_0x520fbb[_0x4756('0x49')]!==_0x4756('0x91')){delete this[_0x4756('0x24')][_0xb7123a[_0x4756('0xd8')]];this[_0x4756('0x1c')][_0xb7123a['queue']][_0x4756('0xe0')]+=0x1;var _0xb3f5c2=new AgentComplete(_0x520fbb,_0xb7123a);if(_0xb7123a[_0x4756('0xf4')]===_0x4756('0xf5')){_0xb3f5c2[_0x4756('0xf6')]=this[_0x4756('0x1c')][_0xb7123a[_0x4756('0xb1')]][_0x4756('0xf7')]&&this[_0x4756('0x1c')][_0xb7123a['queue']][_0x4756('0xf8')]?moment()['format'](_0x4756('0xf9')):undefined;}this['createHistory'](_0xb3f5c2)[_0x4756('0xaf')](loggerCatch(_0x4756('0xfa')));this['moveContactManagedDialer'](_0xb3f5c2)[_0x4756('0xaf')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4756('0xa7')][_0x4756('0x29')]=function(_0x3adf23){if(this[_0x4756('0x1c')][_0x3adf23[_0x4756('0xb1')]]){if(this['uniqueId'][_0x3adf23['uniqueid']]&&this[_0x4756('0x24')][_0x3adf23[_0x4756('0xd8')]][_0x4756('0x49')]!==_0x4756('0x91')){this[_0x4756('0xc9')](this[_0x4756('0x1c')][_0x3adf23[_0x4756('0xb1')]]);this[_0x4756('0x24')][_0x3adf23[_0x4756('0xd8')]][_0x4756('0xfb')]=moment()[_0x4756('0x73')](_0x4756('0xf9'));}}};Dialer[_0x4756('0xa7')][_0x4756('0xfc')]=function(_0x49198e){this[_0x4756('0xc4')](_0x49198e)[_0x4756('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4756('0xc2')](_0x49198e)['catch'](loggerCatch(_0x4756('0xfd')));};Dialer['prototype'][_0x4756('0x2c')]=function(_0x246161){var _0x1b5ddc=this['uniqueId'][_0x246161[_0x4756('0xd8')]];var _0x81a03f=this;if(this['voiceQueues'][_0x246161[_0x4756('0xb1')]]){if(_0x1b5ddc&&_0x1b5ddc[_0x4756('0x49')]!==_0x4756('0x91')){delete this[_0x4756('0x24')][_0x246161[_0x4756('0xd8')]];this['updateOriginated'](this['voiceQueues'][_0x246161['queue']]);_0x1b5ddc[_0x4756('0xfe')]=moment()['format'](_0x4756('0xf9'));var _0x3453a5=new QueueCallerAbandon(_0x1b5ddc,_0x246161);if(getSeconds(_0x1b5ddc['droptime'],_0x1b5ddc[_0x4756('0xff')])>=_0x1b5ddc[_0x4756('0x100')]){this[_0x4756('0x1c')][_0x246161['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4756('0x1c')][_0x246161['queue']][_0x4756('0x101')]+=0x1;this[_0x4756('0x1c')][_0x246161[_0x4756('0xb1')]][_0x4756('0x102')]+=0x1;_0x3453a5[_0x4756('0xa3')]=0xa;_0x3453a5['statedesc']='Drop';_0x3453a5[_0x4756('0x103')]='TIMEOUT';_0x3453a5[_0x4756('0xf6')]=this[_0x4756('0x1c')][_0x246161[_0x4756('0xb1')]][_0x4756('0xf7')]?moment()[_0x4756('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x4756('0xfc')](_0x3453a5);}else{this[_0x4756('0x1c')][_0x246161['queue']][_0x4756('0x7b')]+=0x1;this['voiceQueues'][_0x246161[_0x4756('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3453a5['state']=0xb;_0x3453a5[_0x4756('0xa4')]=_0x4756('0x104');_0x3453a5[_0x4756('0x103')]=_0x4756('0x105');this[_0x4756('0xfc')](_0x3453a5);}}}};Dialer[_0x4756('0xa7')]['syncNewExten']=function(_0x4987ac){if(this[_0x4756('0x22')][_0x4987ac[_0x4756('0xd8')]]){this['actions'][_0x4987ac[_0x4756('0xd8')]][_0x4756('0xae')]=_0x4987ac[_0x4756('0xae')];}if(this['uniqueId'][_0x4987ac[_0x4756('0xd8')]]){this[_0x4756('0x24')][_0x4987ac[_0x4756('0xd8')]]['channel']=_0x4987ac[_0x4756('0xae')];}};Dialer[_0x4756('0xa7')]['syncQueueMember']=function(_0x19538d){if(strategy[this[_0x4756('0x1c')][this[_0x4756('0x22')][_0x19538d['actionid']][_0x4756('0xb1')]][_0x4756('0x4b')]]===_0x4756('0x18')){if(this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]]&&_['isNil'](this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]]['locked'])&&_0x19538d['status']==='1'&&_0x19538d[_0x4756('0x107')]==='0'){if(this['agents'][_0x19538d['stateinterface']]){if(!this[_0x4756('0x1e')][_0x19538d[_0x4756('0x108')]][_0x4756('0x109')]){this['agents'][_0x19538d['stateinterface']][_0x4756('0x109')]=!![];this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]][_0x4756('0x109')]=!![];this['actions'][_0x19538d[_0x4756('0x106')]][_0x4756('0x108')]=_0x19538d['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x19538d['actionid']]['queue']][_0x4756('0x4b')]]||'rrmemory')===_0x4756('0x17')){if(this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]]){if(this[_0x4756('0x1e')][_0x19538d[_0x4756('0x108')]]){this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]]['stateinterface']=_0x19538d['stateinterface'];if(_[_0x4756('0xd9')](this[_0x4756('0x27')][this[_0x4756('0x22')][_0x19538d['actionid']][_0x4756('0xb1')]])){this[_0x4756('0x27')][this[_0x4756('0x22')][_0x19538d['actionid']][_0x4756('0xb1')]]=[];}this[_0x4756('0x27')][this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]][_0x4756('0xb1')]][_0x4756('0x10a')](_[_0x4756('0x8a')](_[_0x4756('0xcd')](this[_0x4756('0x22')][_0x19538d[_0x4756('0x106')]],['idHopper',_0x4756('0x108')]),{'status':_0x19538d[_0x4756('0xad')],'paused':_0x19538d[_0x4756('0x107')]}));}}}};function unlockQueueStatus(_0x34d294,_0x2d7dfe){setTimeout(function(){if(_[_0x4756('0x3a')](_0x34d294[_0x4756('0x10b')])){loggerBooked[_0x4756('0x95')]('[unlockQueueStatus][undefined]',_0x2d7dfe);}_0x34d294['queueStatusComplete']=!![];loggerBooked[_0x4756('0x76')]('[booked][unlockQueueStatus]',_0x2d7dfe,JSON[_0x4756('0x72')](_[_0x4756('0xcd')](_0x34d294,[_0x4756('0x3d'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4756('0xa7')]['syncQueueStatusComplete']=function(_0x35e1c5){var _0x339275=this;var _0x246115=_0x339275[_0x4756('0x1c')][_0x339275[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0xb1')]];if(strategy[this[_0x4756('0x1c')][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]]['queue']][_0x4756('0x4b')]]===_0x4756('0x18')){if(this[_0x4756('0x22')][_0x35e1c5['actionid']]&&this[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0x108')]){this['preview']['run'](this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0x10c')],this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0x108')])['catch'](function(_0x3d148f){logger[_0x4756('0x95')](_0x4756('0x10d'),util['inspect'](_0x3d148f,{'showHidden':![],'depth':null}));})[_0x4756('0x1a')](function(){_0x339275[_0x4756('0xc9')](_0x339275['voiceQueues'][_0x339275[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]);_0x339275[_0x4756('0x1e')][_0x339275[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]]['stateinterface']][_0x4756('0x109')]=![];delete _0x339275[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]];unlockQueueStatus(_0x246115);});}else{this[_0x4756('0xc9')](this[_0x4756('0x1c')][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x35e1c5['actionid']][_0x4756('0xce')],'ListId':this[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0xcf')],'VoiceQueueId':this[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0x10e')]||undefined,'CampaignId':this[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0x10f')]||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x110')));delete this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]];unlockQueueStatus(_0x246115);}}else if((strategy[this[_0x4756('0x1c')][this['actions'][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]][_0x4756('0x4b')]]||_0x4756('0x17'))===_0x4756('0x17')){var _0x4bb221;if(this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]]&&!_[_0x4756('0x44')](this[_0x4756('0x27')][this[_0x4756('0x22')][_0x35e1c5['actionid']][_0x4756('0xb1')]])){if(this[_0x4756('0x111')][_0x339275[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]]['queue']]){this[_0x4756('0x111')][_0x339275['actions'][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]=this['queueBookedRR'][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]?this[_0x4756('0x111')][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]:this[_0x4756('0x27')][this[_0x4756('0x22')][_0x35e1c5['actionid']]['queue']]?this['queueBooked'][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]]['queue']][_0x4756('0x112')]||0x0:0x0;}this[_0x4756('0x27')][this[_0x4756('0x22')][_0x35e1c5[_0x4756('0x106')]][_0x4756('0xb1')]]['_rr']=this[_0x4756('0x111')][this['actions'][_0x35e1c5[_0x4756('0x106')]]['queue']];for(var _0x12fd16=0x0;_0x12fd16=0x0?!![]:![];})[_0x4756('0xaf')](myreject(_0x1da2a9)));}}else{_0x4cfe8a[_0x4756('0x10a')](ami[_0x4756('0xac')]({'action':_0x4756('0x12b'),'command':util['format'](_0x4756('0x12c'),_0x20e48a,!_['isUndefined'](config[_0x4756('0x127')][_0x4f36ad])?_0x4f36ad:'')})[_0x4756('0xb8')](function(_0x2743dc){return _0x2743dc['content'][_0x4756('0x12f')](_0x4756('0x130'))>=0x0?!![]:![];})[_0x4756('0xaf')](myreject(_0x1da2a9)));}BPromise[_0x4756('0x131')](_0x4cfe8a)[_0x4756('0xb8')](function(_0x124fc2){var _0x39c8a8=_['some'](_0x124fc2);if(_0x39c8a8){return _0x248ff7(_0x39c8a8);}else{_0x429197[_0x4756('0x3b')]=_0x129e3d?'GLOBAL_INTERVAL_IS_OVERTIME':_0x4756('0x132');return _0x1da2a9(msgResponse(_0x4756('0x133'),_0x4756('0x124'),'Global:\x20'+_0x129e3d+'\x20'+_0x199fbe+_0x4756('0x134')+util[_0x4756('0x94')](_0x20e48a,{'showHidden':![],'depth':null})+_0x4756('0x135')+_0x4f36ad));}})[_0x4756('0xaf')](function(_0x49bca2){return _0x1da2a9(msgResponse(_0x4756('0x123'),_0x4756('0x124'),JSON[_0x4756('0x72')](_0x49bca2)));});});};Dialer[_0x4756('0xa7')][_0x4756('0x136')]=function(_0x59775d){var _0x14009c=this;return function(){switch(_0x59775d[_0x4756('0x137')]){case _0x4756('0x138'):freeVariablesPredictive(_0x59775d);_0x14009c['handlePower'](_0x59775d,0x1);break;case _0x4756('0x139'):freeVariablesPredictive(_0x59775d);_0x14009c[_0x4756('0x13a')](_0x59775d,_0x59775d[_0x4756('0x13b')]);break;case _0x4756('0x13c'):_0x14009c[_0x4756('0x13c')](_0x59775d);break;case'booked':freeVariablesPredictive(_0x59775d);_0x14009c[_0x4756('0x13a')](_0x59775d,0x1);break;default:freeVariablesPredictive(_0x59775d);logger[_0x4756('0x95')](_0x4756('0x13d'),_0x59775d[_0x4756('0x3d')],'method\x20not\x20recognized');}};};Dialer[_0x4756('0xa7')][_0x4756('0x13e')]=function(_0x530f69){var _0x511d96=this;return function(){_0x511d96[_0x4756('0x13f')](_0x530f69);};};Dialer['prototype'][_0x4756('0x9')]=function(_0x1c1a69){var _0x557c0f=this;if(isNotPreview(_0x1c1a69['dialMethod'])){if(isVoiceQueueOutbound(_0x1c1a69[_0x4756('0x49')])&&isActive(_0x1c1a69[_0x4756('0x140')])){_0x1c1a69[_0x4756('0x9d')]=!![];BPromise[_0x4756('0xb5')]()[_0x4756('0xb8')](checkIsLoggedIn(_0x1c1a69,_0x1c1a69[_0x4756('0x4e')]))[_0x4756('0xb8')](checkIsActive(_0x1c1a69,_0x1c1a69[_0x4756('0x140')]))['then'](checkInterval(_0x1c1a69))['then'](_0x557c0f[_0x4756('0x11e')](_0x1c1a69))[_0x4756('0xb8')](_0x557c0f['checkIfTime'](_0x1c1a69[_0x4756('0x141')],_0x1c1a69[_0x4756('0x142')],_0x1c1a69['name'],_0x1c1a69))[_0x4756('0xb8')](_0x557c0f[_0x4756('0x143')](_0x1c1a69[_0x4756('0x40')],_0x1c1a69[_0x4756('0x142')],_0x1c1a69['name'],_0x1c1a69))['then'](_0x557c0f[_0x4756('0x136')](_0x1c1a69))[_0x4756('0xaf')](loggerCatchQueueSummary(_0x4756('0x144'),_0x1c1a69));}else{notSendMessagesQueue(_0x1c1a69);}}else{freeVariablesPredictive(_0x1c1a69);}};Dialer[_0x4756('0xa7')][_0x4756('0x11d')]=function(){var _0x540d52=this;var _0x103774;for(var _0x41d8be in this[_0x4756('0x1d')]){if(this['campaigns'][_0x4756('0x97')](_0x41d8be)){_0x103774=this[_0x4756('0x1d')][_0x41d8be];if(isCampaignIvr(_0x103774[_0x4756('0x49')])&&isActive(_0x103774['active'])){_0x103774[_0x4756('0x9d')]=!![];BPromise[_0x4756('0xb5')]()[_0x4756('0xb8')](checkIsActive(_0x103774,_0x103774[_0x4756('0x70')]))[_0x4756('0xb8')](checkInterval(_0x103774))[_0x4756('0xb8')](_0x540d52[_0x4756('0x11e')](_0x103774))['then'](_0x540d52[_0x4756('0x122')](_0x103774[_0x4756('0x141')],_0x103774[_0x4756('0x142')],_0x103774[_0x4756('0x3d')],_0x103774))[_0x4756('0xb8')](_0x540d52[_0x4756('0x143')](_0x103774[_0x4756('0x40')],_0x103774[_0x4756('0x142')],_0x103774['name'],_0x103774))[_0x4756('0xb8')](_0x540d52[_0x4756('0x13e')](_0x103774))[_0x4756('0xaf')](loggerCatchQueueSummary(_0x4756('0x145'),_0x103774));}else{notSendMessagesCampaign(_0x103774);}}}};function getCallerIdRandom(_0x43fe5a,_0x2d19be){var _0x53ea69,_0x2e3018,_0x3c7d23;if(_0x2d19be<=0x0){_0x2d19be=0x1;}_0x53ea69=new RegExp('\x5cw{0,'+_0x2d19be+'}$');_0x2e3018=Math[_0x4756('0x146')](0xa,_0x2d19be-0x1);_0x3c7d23=Math[_0x4756('0x146')](0xa,_0x2d19be)-0x1;return util[_0x4756('0x73')]('%s',_[_0x4756('0x147')](_0x43fe5a,_0x53ea69,_[_0x4756('0x148')](_0x2e3018,_0x3c7d23)));}function extractCalleridName(_0x570f1d){var _0x313aeb=_0x570f1d['match'](/"(.*?)"/);return _0x313aeb?_0x313aeb[0x1]:_0x570f1d;}function extractCalleridNumber(_0x31aec9){var _0x22fe74=_0x31aec9[_0x4756('0x149')](/<(.*?)>/);return _0x22fe74?_0x22fe74[0x1]:_0x31aec9;}Dialer[_0x4756('0xa7')][_0x4756('0x14a')]=function(_0x576613,_0x43780a){var _0x11388d=this;var _0xd769c4=uuid['v4']();this[_0x4756('0x22')][_0xd769c4]=new Action(_0x576613,_0x43780a,_0xd769c4);return new BPromise(function(_0x5e9d5b,_0x2c158f){if(_[_0x4756('0x3a')](_0x576613)&&_0x4756('0x14b')!==typeof _0x576613){return _0x2c158f(msgResponse(_0x4756('0x14c'),_0x4756('0x124'),'voiceQueue\x20is\x20undefine'));}if(_[_0x4756('0x3a')](_0x43780a['Contact'][_0x4756('0x14d')])||_0x43780a[_0x4756('0x14e')][_0x4756('0x14d')]===null){return _0x2c158f(msgResponse('originate',_0x4756('0x124'),_0x4756('0x14f')));}var _0x152b51={'XMD-CALLERID':_0x11388d['actions'][_0xd769c4]['getCaller'](),'XMD-AGI':_0x576613[_0x4756('0xef')]?util[_0x4756('0x73')](_0x4756('0x150'),ipAgi,_0x576613[_0x4756('0xef')]):_0x4756('0x151'),'XMD-AGIAFTER':_0x576613[_0x4756('0xf7')]?util[_0x4756('0x73')](_0x4756('0x150'),ipAgi,_0x576613[_0x4756('0xf7')]):_0x4756('0x151'),'XMD-QUEUE':_0x576613['type']===_0x4756('0x4a')?util[_0x4756('0x73')]('\x22%s,%s%s,,,%s\x22',_0x576613[_0x4756('0x3d')],_0x576613['dialQueueOptions']||'',_0x576613[_0x4756('0xf8')]?'c':'',_0x576613[_0x4756('0x100')]||0x3):_0x4756('0x151'),'XMD-CONTACTID':_0x43780a[_0x4756('0xce')],'XMD-CDRTYPE':_0x4756('0x7'),'CALLERID(all)':_0x11388d[_0x4756('0x22')][_0xd769c4][_0x4756('0x152')](),'XMD-AMD':_0x576613[_0x4756('0xdd')]?_0x4756('0x153'):_0x4756('0x151'),'XMD-DESTINATION':_0x4756('0x154')};if(_0x576613[_0x4756('0xdd')]){_0x152b51[_0x4756('0x155')]=_0x576613[_0x4756('0x156')]||0x9c4;_0x152b51['XMD-AMDGREETING']=_0x576613['dialAMDGreeting']||0x5dc;_0x152b51['XMD-AMDAFTERGREETINGSILENCE']=_0x576613[_0x4756('0x157')]||0x320;_0x152b51['XMD-AMDTOTALANALYSISTIME']=_0x576613[_0x4756('0x158')]||0x1388;_0x152b51[_0x4756('0x159')]=_0x576613[_0x4756('0x15a')]||0x64;_0x152b51[_0x4756('0x15b')]=_0x576613[_0x4756('0x15c')]||0x32;_0x152b51[_0x4756('0x15d')]=_0x576613[_0x4756('0x15e')]||0x3;_0x152b51['XMD-AMDSILENCETHRESHOLD']=_0x576613[_0x4756('0x15f')]||0x100;_0x152b51[_0x4756('0x160')]=_0x576613[_0x4756('0x161')]||0x1388;}if(_0x576613[_0x4756('0x49')]===_0x4756('0x4a')){_0x152b51[_0x4756('0x162')]=_0x43780a[_0x4756('0x10e')];}else{_0x152b51[_0x4756('0x163')]=_0x43780a['CampaignId'];}for(var _0x1ff276 in _0x43780a[_0x4756('0x14e')]){if(_0x43780a['Contact'][_0x4756('0x97')](_0x1ff276)){if(isNotNull(_0x43780a[_0x4756('0x14e')][_0x1ff276])&&_0x1ff276!=='id'&&_0x1ff276!==_0x4756('0x164')&&_0x1ff276!==_0x4756('0x165')&&_0x1ff276!==_0x4756('0x166')){_0x152b51[util[_0x4756('0x73')](_0x4756('0x167'),_0x4756('0x168'),_[_0x4756('0x169')](_0x1ff276))]=_0x43780a[_0x4756('0x14e')][_0x1ff276];}}}var _0x100c59=_0x11388d[_0x4756('0xd4')](_0x576613[_0x4756('0x6f')])?getCallerId(_0x576613['Trunk'][_0x4756('0x71')],_0x576613[_0x4756('0x56')],_0x576613['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x576613[_0x4756('0x57')],_0x576613[_0x4756('0x16a')]):_0x576613[_0x4756('0x57')]):getCallerId(_[_0x4756('0xd9')](_0x576613[_0x4756('0x11f')])?_0x576613[_0x4756('0x6f')][_0x4756('0x71')]:_0x576613[_0x4756('0x11f')][_0x4756('0x71')],_0x576613[_0x4756('0x56')],_0x576613[_0x4756('0x16a')]>0x0?getCallerIdRandom(_0x576613[_0x4756('0x57')],_0x576613[_0x4756('0x16a')]):_0x576613[_0x4756('0x57')]);if(_0x100c59){_0x152b51[_0x4756('0x16b')]=_0x11388d[_0x4756('0x22')][_0xd769c4]['originatecalleridname']=extractCalleridName(_0x100c59);_0x152b51['XMD-ORIGINATECALLERIDNUM']=_0x11388d[_0x4756('0x22')][_0xd769c4][_0x4756('0x16c')]=extractCalleridNumber(_0x100c59);}return ami[_0x4756('0xac')]({'actionid':_0xd769c4,'action':'originate','channel':_0x11388d[_0x4756('0xd4')](_0x576613[_0x4756('0x6f')])?util[_0x4756('0x73')]('SIP/%s/%s%s',_0x576613['Trunk'][_0x4756('0x3d')],isNotNull(_0x576613[_0x4756('0x59')])?_0x576613['dialPrefix']['trim']()||'':'',_0x576613[_0x4756('0x16d')]>0x0?_0x43780a[_0x4756('0x14e')][_0x4756('0x14d')][_0x4756('0x16e')](_0x576613[_0x4756('0x16d')]):_0x43780a[_0x4756('0x14e')][_0x4756('0x14d')]):util[_0x4756('0x73')](_0x4756('0x16f'),_[_0x4756('0xd9')](_0x576613[_0x4756('0x11f')])?_0x576613[_0x4756('0x6f')][_0x4756('0x3d')]:_0x576613[_0x4756('0x11f')][_0x4756('0x3d')],isNotNull(_0x576613['dialPrefix'])?_0x576613[_0x4756('0x59')][_0x4756('0x170')]()||'':'',_0x576613[_0x4756('0x16d')]>0x0?_0x43780a[_0x4756('0x14e')]['phone'][_0x4756('0x16e')](_0x576613[_0x4756('0x16d')]):_0x43780a[_0x4756('0x14e')]['phone']),'callerid':_0x100c59,'Exten':_0x4756('0x154'),'Context':_0x4756('0x171'),'Priority':'1','variable':_0x152b51,'timeout':(_0x576613[_0x4756('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd769c4})[_0x4756('0xb8')](function(_0x12a574){return _0x5e9d5b(_0x12a574);})[_0x4756('0xaf')](function(_0x58e003){_0x576613[_0x4756('0x60')]+=0x1;var _0x39d1b8=new History(_0x11388d['actions'][_0xd769c4]);logger[_0x4756('0x95')](util[_0x4756('0x73')](_0x4756('0x172'),JSON['stringify'](_0x58e003)));_0x39d1b8['state']=0xe;_0x39d1b8['statedesc']=_0x4756('0x173');_0x39d1b8[_0x4756('0xa6')]=moment()[_0x4756('0x73')](_0x4756('0xf9'));_0x39d1b8[_0x4756('0xa5')]=_0x39d1b8['starttime'];_0x11388d[_0x4756('0xc4')](_0x39d1b8)[_0x4756('0xaf')](loggerCatch(_0x4756('0x174')));_0x11388d['moveContactManagedDialer'](_0x39d1b8)[_0x4756('0xaf')](loggerCatch(_0x4756('0x174')))[_0x4756('0x1a')](function(){delete _0x11388d[_0x4756('0x22')][_0xd769c4];return _0x2c158f(msgResponse(_0x4756('0x14c'),'Error',_0x4756('0x175')));});});});};Dialer[_0x4756('0xa7')][_0x4756('0x2e')]=function(_0x3536ce){var _0x329b5d=this[_0x4756('0x22')][_0x3536ce[_0x4756('0x106')]];var _0xa537d2=this;if(_0x329b5d){delete this[_0x4756('0x22')][_0x3536ce[_0x4756('0x106')]];_0x329b5d[_0x4756('0xff')]=moment()[_0x4756('0x73')](_0x4756('0xf9'));var _0x2a65a2=_0x329b5d['type']===_0x4756('0x91')?this[_0x4756('0x1d')][_0x329b5d[_0x4756('0xb1')]]:this[_0x4756('0x1c')][_0x329b5d[_0x4756('0x176')]()];if(!this[_0x4756('0x177')](_0x3536ce[_0x4756('0x178')])){this[_0x4756('0xc9')](_0x2a65a2);return this[_0x4756('0x179')](_0x329b5d,_0x2a65a2,_0x3536ce)[_0x4756('0xb8')](function(_0x159d64){})[_0x4756('0xaf')](loggerCatch(_0x4756('0x17a')));}else{this[_0x4756('0x24')][_0x3536ce[_0x4756('0xd8')]]=_0x329b5d;}}};Dialer['prototype'][_0x4756('0x17b')]=function(_0x28d41b,_0x5bc92a,_0x2ba368){var _0x395e3b=new History(_0x5bc92a);if(_0x395e3b[_0x4756('0x17c')]+_0x395e3b[_0x4756('0x17d')]+_0x395e3b['countnoanswerretry']>=_0x2ba368['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x28d41b){case 0x3:if(_0x395e3b[_0x4756('0x17e')]>=_0x2ba368[_0x4756('0x17f')]-0x1){return!![];}else{this[_0x4756('0xbd')]({'active':![],'countnoanswerretry':_0x395e3b[_0x4756('0x17e')]+=0x1,'scheduledat':moment()[_0x4756('0x180')](_0x2ba368['dialNoAnswerRetryFrequency'],'minutes')[_0x4756('0x73')](_0x4756('0xf9')),'ContactId':_0x395e3b[_0x4756('0xce')],'ListId':_0x395e3b[_0x4756('0xcf')],'VoiceQueueId':_0x395e3b['VoiceQueueId']||undefined,'CampaignId':_0x395e3b[_0x4756('0x10f')]||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x181')));}break;case 0x5:if(_0x395e3b['countbusyretry']>=_0x2ba368['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x4756('0xbd')]({'active':![],'countbusyretry':_0x395e3b[_0x4756('0x17c')]+=0x1,'scheduledat':moment()['add'](_0x2ba368[_0x4756('0x182')],_0x4756('0x183'))[_0x4756('0x73')](_0x4756('0xf9')),'ContactId':_0x395e3b[_0x4756('0xce')],'ListId':_0x395e3b[_0x4756('0xcf')],'VoiceQueueId':_0x395e3b[_0x4756('0x10e')]||undefined,'CampaignId':_0x395e3b[_0x4756('0x10f')]||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x184')));}break;case 0x8:if(_0x395e3b[_0x4756('0x17d')]>=_0x2ba368[_0x4756('0x185')]-0x1){return!![];}else{this[_0x4756('0xbd')]({'active':![],'countcongestionretry':_0x395e3b['countcongestionretry']+=0x1,'scheduledat':moment()[_0x4756('0x180')](_0x2ba368['dialCongestionRetryFrequency'],_0x4756('0x183'))['format'](_0x4756('0xf9')),'ContactId':_0x395e3b['ContactId'],'ListId':_0x395e3b[_0x4756('0xcf')],'VoiceQueueId':_0x395e3b['VoiceQueueId']||undefined,'CampaignId':_0x395e3b['CampaignId']||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x186')));}break;default:return!![];}};Dialer[_0x4756('0xa7')][_0x4756('0x179')]=function(_0x5db023,_0x3f0cc6,_0x4b645a){var _0x3ce9e2=this;var _0x1dc6c1=new History(_0x5db023);return new BPromise(function(_0x18077b,_0x154948){if(_[_0x4756('0x3a')](_0x3f0cc6)&&'object'!==typeof _0x3f0cc6){return _0x154948(msgResponse(_0x4756('0x187'),_0x4756('0x124'),_0x4756('0x188')));}if(_['isUndefined'](_0x4b645a)&&_0x4756('0x14b')!==typeof _0x4b645a){return _0x154948(msgResponse('[callProgressDetecting]',_0x4756('0x124'),_0x4756('0x189')));}switch(_0x4b645a[_0x4756('0xf4')]){case'0':_0x3f0cc6[_0x4756('0x18a')]+=0x1;_0x1dc6c1[_0x4756('0xa3')]=0x0;_0x1dc6c1[_0x4756('0xa4')]='NoSuchNumber';_0x3ce9e2[_0x4756('0xc4')](_0x1dc6c1)[_0x4756('0xaf')](loggerCatch(_0x4756('0x18b')));if(_0x3ce9e2[_0x4756('0x17b')](0x0,_0x5db023,_0x3f0cc6)){if(_0x1dc6c1[_0x4756('0x17c')]+_0x1dc6c1['countcongestionretry']+_0x1dc6c1[_0x4756('0x17e')]>=_0x3f0cc6[_0x4756('0x18c')]){_0x3ce9e2[_0x4756('0x18d')](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x18e'));}else{_0x3ce9e2[_0x4756('0x18f')](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x18e'));}}break;case'3':_0x3f0cc6[_0x4756('0x5f')]+=0x1;_0x1dc6c1[_0x4756('0xa3')]=0x3;_0x1dc6c1['statedesc']=_0x4756('0x190');_0x1dc6c1[_0x4756('0x17e')]+=0x1;_0x1dc6c1[_0x4756('0x191')]+=0x1;_0x3ce9e2['createHistory'](_0x1dc6c1)[_0x4756('0xaf')](loggerCatch(_0x4756('0x192')));if(_0x3ce9e2[_0x4756('0x17b')](0x3,_0x5db023,_0x3f0cc6)){if(_0x1dc6c1['countnoanswerretry']>=_0x3f0cc6['dialNoAnswerMaxRetry']){_0x3ce9e2[_0x4756('0x18f')](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x193'));}else{_0x3ce9e2['stateGlobal'](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x193'));}}break;case'5':_0x3f0cc6[_0x4756('0x5b')]+=0x1;_0x1dc6c1['state']=0x5;_0x1dc6c1[_0x4756('0xa4')]='Busy';_0x1dc6c1[_0x4756('0x17c')]+=0x1;_0x1dc6c1['countglobal']+=0x1;_0x3ce9e2[_0x4756('0xc4')](_0x1dc6c1)['catch'](loggerCatch(_0x4756('0x194')));if(_0x3ce9e2[_0x4756('0x17b')](0x5,_0x5db023,_0x3f0cc6)){if(_0x1dc6c1[_0x4756('0x17c')]>=_0x3f0cc6['dialBusyMaxRetry']){_0x3ce9e2[_0x4756('0x18f')](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x195'));}else{_0x3ce9e2[_0x4756('0x18d')](_0x1dc6c1,_0x18077b,_0x154948,'reason\x205\x20busy');}}break;case'8':_0x3f0cc6[_0x4756('0x5c')]+=0x1;_0x1dc6c1[_0x4756('0xa3')]=0x8;_0x1dc6c1[_0x4756('0xa4')]='Congestion';_0x1dc6c1[_0x4756('0x17d')]+=0x1;_0x1dc6c1[_0x4756('0x191')]+=0x1;_0x3ce9e2[_0x4756('0xc4')](_0x1dc6c1)['catch'](loggerCatch(_0x4756('0x196')));if(_0x3ce9e2[_0x4756('0x17b')](0x8,_0x5db023,_0x3f0cc6)){if(_0x1dc6c1[_0x4756('0x17d')]>=_0x3f0cc6[_0x4756('0x185')]){_0x3ce9e2[_0x4756('0x18f')](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x197'));}else{_0x3ce9e2['stateGlobal'](_0x1dc6c1,_0x18077b,_0x154948,_0x4756('0x197'));}}break;default:_0x3f0cc6[_0x4756('0x62')]+=0x1;_0x1dc6c1[_0x4756('0xa3')]=0xc;_0x1dc6c1['statedesc']=_0x4b645a[_0x4756('0xf4')];_0x3ce9e2[_0x4756('0xc4')](_0x1dc6c1)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3ce9e2[_0x4756('0x17b')](_0x4b645a[_0x4756('0xf4')],_0x5db023,_0x3f0cc6)){if(_0x1dc6c1['countbusyretry']+_0x1dc6c1[_0x4756('0x17d')]+_0x1dc6c1[_0x4756('0x17e')]>=_0x3f0cc6[_0x4756('0x18c')]){_0x3ce9e2[_0x4756('0x18d')](_0x1dc6c1,_0x18077b,_0x154948,_0x4b645a[_0x4756('0xf4')]);}else{_0x3ce9e2[_0x4756('0x18f')](_0x1dc6c1,_0x18077b,_0x154948,_0x4b645a[_0x4756('0xf4')]);}}}});};Dialer['prototype'][_0x4756('0x18d')]=function(_0x1faacd,_0x3c0edd,_0x424a03,_0x4ba3c8){var _0x452494=new Final(_0x1faacd);_0x452494['state']=0xf;_0x452494[_0x4756('0xa4')]='Global';this['createStateFinal'](_0x452494,_0x3c0edd,_0x424a03,_0x4ba3c8);};Dialer[_0x4756('0xa7')]['createStateFinal']=function(_0x42bea5,_0x526ec6,_0x2b9553,_0x74da9b){this[_0x4756('0xc2')](_0x42bea5)[_0x4756('0xb8')](function(_0x4d5ac6){return _0x526ec6(msgResponse(_0x4756('0x187'),'Success',_0x74da9b));})[_0x4756('0xaf')](function(_0x5441e1){return _0x2b9553(msgResponse(_0x4756('0x198'),_0x4756('0x124'),_0x4756('0x199')));});};Dialer['prototype'][_0x4756('0x13c')]=function(_0xd480b5){var _0x22e43e=this;var _0xe19a9b=_0xd480b5['dialPredictiveOptimizationPercentage']/0x64;var _0x37287a=_0xd480b5['outboundDropCallsDayTimeout']/(_0xd480b5[_0x4756('0x101')]+_0xd480b5['outboundAnswerCallsDay']);var _0x431f22=Math[_0x4756('0x19a')](_0xd480b5[_0x4756('0x69')]*(_0xd480b5['predictiveIntervalMaxThreshold']/0x64));var _0xf06e18=Math['round'](_0xd480b5['predictiveIntervalAvailable']*(_0xd480b5[_0x4756('0x19b')]/0x64));var _0x44631f=_0xd480b5[_0x4756('0x4d')]+_0xd480b5[_0x4756('0x19c')];var _0x2fed54=Math[_0x4756('0x19d')](_0xd480b5['erlangCalls']*_0xd480b5[_0x4756('0x6d')]*_0xd480b5[_0x4756('0x66')]*_0xd480b5['predictiveIntervalMultiplicativeFactor']);if(_[_0x4756('0x3a')](_0xd480b5[_0x4756('0x8b')])){if(!_[_0x4756('0x3a')](_0xd480b5[_0x4756('0x6e')])){_0xd480b5[_0x4756('0x6e')]=undefined;loggerPredictive[_0x4756('0x95')](_0x4756('0x19e'),_0x4756('0x19f'));}if(!_[_0x4756('0x3a')](_0xd480b5['handlePredictive'])){loggerPredictive[_0x4756('0x95')](_0x4756('0x19e'),_0x4756('0x1a0'));clearInterval(_0xd480b5[_0x4756('0x8e')]);_0xd480b5[_0x4756('0x8e')]=undefined;}_0xd480b5['startProgressive']=moment()[_0x4756('0x73')](_0x4756('0xf9'));loggerPredictive[_0x4756('0x76')](_0xd480b5['name'],'collection\x20data\x20in\x20progressive\x20at',_0xd480b5[_0x4756('0x8b')]);this['handlePower'](_0xd480b5,0x1);}else if(ifInterval(_0xd480b5[_0x4756('0x1a1')],_0xd480b5[_0x4756('0x8b')])){this[_0x4756('0x13a')](_0xd480b5,0x1);loggerPredictiveCalls[_0x4756('0x76')]('[startMethodPredictive][StartProgressive][Loop]',_0xd480b5[_0x4756('0x8b')],_0xd480b5[_0x4756('0x3d')]);_0xd480b5[_0x4756('0x6c')]=0x0;_0xd480b5[_0x4756('0x102')]=0x0;}else if(_0xe19a9b<_0x37287a&&_0xd480b5[_0x4756('0x1a2')]===_0x4756('0x1a3')){freeVariablesPredictive(_0xd480b5);loggerPredictive[_0x4756('0x76')](_0x4756('0x1a4'),'Dropped\x20calls\x20day',_0x37287a,_0x4756('0x8b'),_0xd480b5[_0x4756('0x3d')]);}else if(_0x2fed54<_0xd480b5[_0x4756('0x102')]&&_0xd480b5[_0x4756('0x1a2')]==='dropRate'){freeVariablesPredictive(_0xd480b5);loggerPredictive[_0x4756('0x76')](_0x4756('0x1a5'),_0x4756('0x1a6'),_0x2fed54,_0x4756('0x1a7'),_0xd480b5['predictiveIntervalErlangCallsDroppedCalls'],_0x4756('0x8b'),_0xd480b5[_0x4756('0x3d')]);}else if(!ifInterval(_0xd480b5[_0x4756('0x1a1')],_0xd480b5[_0x4756('0x8b')])&&_[_0x4756('0x3a')](_0xd480b5[_0x4756('0x6e')])&&!_[_0x4756('0x3a')](_0xd480b5[_0x4756('0x8b')])){_0xd480b5[_0x4756('0x6e')]=moment()['format'](_0x4756('0xf9'));loggerPredictive[_0x4756('0x76')](_0xd480b5['name'],'started\x20in\x20predictive\x20at',_0xd480b5[_0x4756('0x6e')]);this[_0x4756('0xbb')](_0xd480b5[_0x4756('0x1a1')])[_0x4756('0xb8')](this['getDataPredictive'](_0xd480b5))[_0x4756('0xb8')](mergeDataErlangB(_0xd480b5))[_0x4756('0xb8')](this[_0x4756('0x1a8')](_0xd480b5))[_0x4756('0xaf')](loggerCatchPredictive(_0x4756('0x1a9'),_0xd480b5));}else if(!ifInterval(_0xd480b5[_0x4756('0x1a1')],_0xd480b5[_0x4756('0x6e')])){_0xd480b5['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0xd480b5[_0x4756('0x6e')]=moment()[_0x4756('0x73')](_0x4756('0xf9'));loggerPredictive[_0x4756('0x76')](_0xd480b5[_0x4756('0x3d')],_0x4756('0x1aa'),_0xd480b5[_0x4756('0x6e')]);clearInterval(_0xd480b5[_0x4756('0x8e')]);_0xd480b5[_0x4756('0x8e')]=undefined;this[_0x4756('0xbb')](_0xd480b5[_0x4756('0x1a1')])['then'](this[_0x4756('0x1ab')](_0xd480b5))[_0x4756('0xb8')](mergeDataErlangB(_0xd480b5))[_0x4756('0xb8')](this['startMethodPredictive'](_0xd480b5))[_0x4756('0xaf')](loggerCatchPredictive(_0x4756('0x1ac'),_0xd480b5));}else if(_0xd480b5[_0x4756('0x69')]&&_0x44631f<_0xd480b5['predictiveIntervalAvailable']-_0xf06e18){freeVariablesPredictive(_0xd480b5);loggerPredictive[_0x4756('0x76')](_0xd480b5[_0x4756('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x44631f,_0x4756('0x1ad'),_0xd480b5[_0x4756('0x69')],'-',_0xf06e18,'=',_0xd480b5[_0x4756('0x69')]-_0xf06e18,')');}else if(_0xd480b5[_0x4756('0x69')]&&_0x44631f>_0xd480b5[_0x4756('0x69')]+_0x431f22){freeVariablesPredictive(_0xd480b5);loggerPredictive[_0x4756('0x76')](_0xd480b5[_0x4756('0x3d')],_0x4756('0x1ae'),_0x44631f,')\x20are\x20more\x20than\x20threshold\x20(',_0xd480b5['predictiveIntervalAvailable'],'+',_0x431f22,'=',_0xd480b5['predictiveIntervalAvailable']+_0x431f22,')');}};Dialer[_0x4756('0xa7')]['getDataPredictive']=function(_0x478f12){var _0x1f3992=this;return function(_0x277ca5){return new BPromise(function(_0x59f641,_0x3b893a){_[_0x4756('0x8a')](_0x478f12,_0x277ca5[0x0]);if(checkGetDataPredictive(_0x277ca5[0x0])){var _0x53cbd9=_0x478f12[_0x4756('0x69')]=_0x478f12['talking']+_0x478f12[_0x4756('0x4d')];var _0x25f281=_0x478f12[_0x4756('0x1a1')]*0x3c;var _0x128a79=_0x277ca5[0x0][_0x4756('0x7f')]+_0x277ca5[0x0][_0x4756('0x7d')];var _0x35224d=(_0x277ca5[0x0][_0x4756('0x63')]+_0x277ca5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x277ca5[0x0][_0x4756('0x7b')])/_0x277ca5[0x0][_0x4756('0x6a')];_0x478f12[_0x4756('0x66')]=_0x35224d>0x0?_0x35224d:0x1;switch(_0x478f12['dialPredictiveOptimization']){case _0x4756('0x1a3'):var _0x5ccdee=_0x478f12[_0x4756('0x1af')]/0x64;return _0x1f3992['abandonmentRate'](_0x53cbd9,_0x25f281,_0x128a79,_0x35224d,_0x5ccdee)[_0x4756('0xb8')](function(_0x2657c6){return _0x59f641(_0x2657c6);});case _0x4756('0x1b0'):var _0x836ca1=_0x478f12['dialPredictiveOptimizationPercentage']/0x64;return _0x1f3992[_0x4756('0x1b1')](_0x53cbd9,_0x25f281,_0x128a79,_0x35224d,_0x836ca1)['then'](function(_0x17c839){return _0x59f641(_0x17c839);});default:return _0x3b893a(msgResponse(_0x4756('0x1b2'),'Failure',_0x4756('0x1b3')));}}else{return _0x3b893a(msgResponse(_0x4756('0x1b2'),_0x4756('0x124'),_0x4756('0x1b4')));}});};};Dialer[_0x4756('0xa7')][_0x4756('0x1b5')]=function(_0x16d5c0){var _0x5240f5=this;return function(_0x3edbf4){return new BPromise(function(_0x33335,_0x247003){_['merge'](_0x16d5c0,_0x3edbf4[0x0]);if(checkGetDataPredictive(_0x3edbf4[0x0])){loggerPredictive[_0x4756('0x76')](JSON['stringify'](_0x3edbf4[0x0]));if(_0x16d5c0['dialPredictiveOptimization']===_0x4756('0x1a3')){return _0x5240f5[_0x4756('0xc1')](_0x16d5c0['id'])[_0x4756('0xb8')](function(_0x2c8870){var _0x5cc591=_0x16d5c0[_0x4756('0x4e')]-_0x2c8870[0x0][_0x4756('0x1b6')];var _0xc955ca=_0x16d5c0[_0x4756('0x1a1')]*0x3c;var _0x4df0f9=_0x3edbf4[0x0]['predictiveIntervalAvgTalktime']+_0x3edbf4[0x0][_0x4756('0x7d')];var _0x1f4ab5=(_0x3edbf4[0x0][_0x4756('0x63')]+_0x3edbf4[0x0][_0x4756('0x64')]+_0x3edbf4[0x0][_0x4756('0x7b')])/_0x3edbf4[0x0][_0x4756('0x6a')];var _0x90d992=_0x16d5c0[_0x4756('0x1af')]/0x64;_0x16d5c0['predictiveIntervalPauses']=_0x2c8870[0x0][_0x4756('0x1b6')]||0x0;_0x16d5c0[_0x4756('0x66')]=_0x1f4ab5>0x0?_0x1f4ab5:0x1;return _0x5240f5[_0x4756('0x1b7')](_0x5cc591,_0xc955ca,_0x4df0f9,_0x1f4ab5,_0x90d992);})[_0x4756('0xb8')](function(_0x40f9e0){return _0x33335(_0x40f9e0);})[_0x4756('0xaf')](function(_0x10274e){return _0x247003(msgResponse(_0x4756('0x1b8'),_0x4756('0x124'),JSON[_0x4756('0x72')](_0x10274e)));});}if(_0x16d5c0[_0x4756('0x1a2')]==='agentBusyFactor'){return _0x5240f5[_0x4756('0xc1')](_0x16d5c0['id'])[_0x4756('0xb8')](function(_0x5870b5){var _0x4d156a=_0x16d5c0[_0x4756('0x4e')]-_0x5870b5[0x0][_0x4756('0x1b6')];var _0x20838a=_0x16d5c0[_0x4756('0x1a1')]*0x3c;var _0x3f78bd=_0x3edbf4[0x0][_0x4756('0x7f')]+_0x3edbf4[0x0]['predictiveIntervalAvgHoldtime'];var _0x2affb8=(_0x3edbf4[0x0][_0x4756('0x63')]+_0x3edbf4[0x0][_0x4756('0x64')]+_0x3edbf4[0x0][_0x4756('0x7b')])/_0x3edbf4[0x0]['predictiveIntervalTotalCalls'];var _0x365762=_0x16d5c0[_0x4756('0x1af')]/0x64;_0x16d5c0[_0x4756('0x68')]=_0x5870b5[0x0][_0x4756('0x1b6')]||0x0;_0x16d5c0[_0x4756('0x66')]=_0x2affb8>0x0?_0x2affb8:0x1;return _0x5240f5[_0x4756('0x1b1')](_0x4d156a,_0x20838a,_0x3f78bd,_0x2affb8,_0x365762);})[_0x4756('0xb8')](function(_0x315c2e){return _0x33335(_0x315c2e);})[_0x4756('0xaf')](function(_0x85c372){return _0x247003(msgResponse(_0x4756('0x1b8'),_0x4756('0x124'),JSON[_0x4756('0x72')](_0x85c372)));});}}else{return _0x247003(msgResponse(_0x4756('0x1b2'),_0x4756('0x124'),_0x4756('0x1b4')));}});};};Dialer[_0x4756('0xa7')][_0x4756('0x1a8')]=function(_0x49a838){var _0x44d38d=this;return function(){var _0x1dc913=0x0;var _0x5960dc=Math[_0x4756('0x19d')](_0x49a838[_0x4756('0x86')]*0x3e8);if(_0x5960dc>0x0){_0x5960dc=_0x5960dc<0x64?0x64:_0x5960dc;loggerPredictive['info'](_0x49a838['name'],_0x4756('0x1b9'),_0x5960dc,_0x4756('0x45'));_0x49a838[_0x4756('0x8e')]=setInterval(function(){_0x44d38d[_0x4756('0x8e')](_0x49a838);loggerPredictiveCalls[_0x4756('0x76')](_0x4756('0x1ba'),_0x1dc913+=0x1);},_0x5960dc);}else{loggerPredictive[_0x4756('0x76')](_0x49a838[_0x4756('0x3d')],_0x4756('0x1bb'));}};};Dialer[_0x4756('0xa7')][_0x4756('0x1bc')]=function(_0x1026ed,_0x46b962){var _0x119ad5=this;return function(_0x4532cf){if(_['isEmpty'](_0x4532cf)){if(_[_0x4756('0xd9')](_0x46b962[_0x4756('0xd0')])||!_0x46b962[_0x4756('0x1bd')]){if(_0x1026ed[_0x4756('0x137')]==='booked'){_0x1026ed['queueStatusComplete']=_[_0x4756('0x3a')](_0x1026ed[_0x4756('0x10b')])?!![]:_0x1026ed[_0x4756('0x10b')];var _0x478fe3=uuid['v4']();_0x119ad5['actions'][_0x478fe3]=new Action(_0x1026ed,_0x46b962,_0x478fe3);loggerBooked[_0x4756('0x76')]('[booked][checkContactBlack]',_0x478fe3,_0x4756('0x1be'),JSON['stringify'](_0x1026ed[_0x4756('0x10b')]),_0x4756('0x1bf'),_0x1026ed[_0x4756('0x3d')]);if(_0x1026ed[_0x4756('0x10b')]){_0x1026ed[_0x4756('0x10b')]=![];_0x119ad5['queueBooked'][_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0xb1')]]=[];ami[_0x4756('0xac')]({'actionid':_0x478fe3,'action':_0x4756('0x1c0'),'queue':_0x1026ed[_0x4756('0x3d')]})[_0x4756('0xaf')](function(_0x82a3bd){_0x119ad5[_0x4756('0xc9')](_0x1026ed);_0x119ad5[_0x4756('0xbd')]({'active':![],'ContactId':_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0xce')],'ListId':_0x119ad5[_0x4756('0x22')][_0x478fe3]['ListId'],'VoiceQueueId':_0x119ad5[_0x4756('0x22')][_0x478fe3]['VoiceQueueId']||undefined,'CampaignId':_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0x10f')]||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x1c1')));delete _0x119ad5[_0x4756('0x22')][_0x478fe3];});}else{loggerBooked[_0x4756('0x76')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x1026ed['queueStatusComplete']),_0x4756('0x1bf'),_0x1026ed['name']);_0x119ad5['updateOriginated'](_0x1026ed);_0x119ad5['rescheduleContact']({'active':![],'ContactId':_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0xce')],'ListId':_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0xcf')],'VoiceQueueId':_0x119ad5[_0x4756('0x22')][_0x478fe3]['VoiceQueueId']||undefined,'CampaignId':_0x119ad5[_0x4756('0x22')][_0x478fe3][_0x4756('0x10f')]||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x1c1')));delete _0x119ad5['actions'][_0x478fe3];}}else{return _0x119ad5[_0x4756('0x14a')](_0x1026ed,_0x46b962);}}else{if(getDiff(_0x46b962[_0x4756('0x1c2')])<_0x1026ed[_0x4756('0x1c3')]*0x3c){_0x119ad5['preview'][_0x4756('0x116')](_0x46b962['id'])[_0x4756('0x1a')](function(){_0x119ad5['updateOriginated'](_0x1026ed);});}else{_0x1026ed[_0x4756('0x1c4')]+=0x1;_0x119ad5[_0x4756('0xc9')](_0x1026ed);if(_0x1026ed['dialRecallInQueue']){_0x119ad5[_0x4756('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x46b962[_0x4756('0xce')],'ListId':_0x46b962[_0x4756('0xcf')],'VoiceQueueId':_0x46b962[_0x4756('0x10e')]||undefined,'CampaignId':_0x46b962['CampaignId']||undefined})[_0x4756('0xaf')](loggerCatch(_0x4756('0x1c5')));_0x119ad5['createHistory'](createObjHistory(_0x1026ed,_0x46b962,_0x4756('0x1c6'),0x17,_0x4756('0x1c7')))[_0x4756('0xaf')](loggerCatch(_0x4756('0x1c8')));}else{_0x119ad5['saveInDb'](createObjHistory(_0x1026ed,_0x46b962,_0x4756('0x1c9'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x1026ed[_0x4756('0x5a')]+=0x1;_0x119ad5[_0x4756('0xcc')](createObjHistory(_0x1026ed,_0x46b962,'BLACKLIST',0xd,_0x4756('0x1ca')),_0x4756('0x1cb'),'[Originate][MoveBlacklist]');throw _0x4756('0x1cc');}};};Dialer['prototype']['handleIvr']=function(_0x10d9a0){var _0x3aae50=this;var _0x200656=[];var _0x3d1e22=_0x10d9a0[_0x4756('0x1cd')]-_0x10d9a0[_0x4756('0x6b')]-_0x10d9a0[_0x4756('0x1ce')];emitCampaignSummary(_0x10d9a0);if(_0x3d1e22>0x0){if(_0x3d1e22>this['maxNumberOriginate']){_0x3d1e22=this[_0x4756('0x20')];}_0x10d9a0[_0x4756('0x1ce')]+=_0x3d1e22;this[_0x4756('0x1cf')](_0x10d9a0['id'],_0x3d1e22,_0x10d9a0[_0x4756('0x1d0')])[_0x4756('0xb8')](function(_0x3ea214){_0x10d9a0[_0x4756('0x1ce')]-=_0x3d1e22;_0x10d9a0[_0x4756('0x1ce')]=_0x10d9a0[_0x4756('0x1ce')]>0x0?_0x10d9a0[_0x4756('0x1ce')]:0x0;if(!checkContactEmpty(_0x3ea214)){_0x10d9a0[_0x4756('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4756('0x76')](_0x4756('0x1d1')+_0x10d9a0[_0x4756('0x3d')]);}else{_0x10d9a0[_0x4756('0x6b')]+=_0x3ea214['length'];_0x10d9a0[_0x4756('0x3b')]=_0x4756('0x1d2');for(var _0x3d566d=0x0;_0x3d566d<_0x3ea214[_0x4756('0x96')];_0x3d566d+=0x1){_0x10d9a0[_0x4756('0x1d3')]+=0x1;if(_['isNil'](_0x3ea214[_0x3d566d])||_[_0x4756('0xd9')](_0x3ea214[_0x3d566d]['Contact'])||_[_0x4756('0xd9')](_0x3ea214[_0x3d566d][_0x4756('0x14e')][_0x4756('0x14d')])){_0x3aae50[_0x4756('0xca')](_0x4756('0x1d4'),_0x10d9a0,_0x3ea214[_0x3d566d]);}else{_0x3aae50[_0x4756('0xb9')](_[_0x4756('0xcd')](_0x3ea214[_0x3d566d],['CampaignId',_0x4756('0x1d5')]))[_0x4756('0xb8')](_0x3aae50[_0x4756('0x1bc')](_0x10d9a0,_0x3ea214[_0x3d566d]))[_0x4756('0xaf')](_0x3aae50['loggerHandler'](_0x4756('0x1d6'),_0x10d9a0));}}}})[_0x4756('0xaf')](loggerGetContactDialer(_0x4756('0x1d7'),_0x10d9a0,_0x3d1e22));}};Dialer[_0x4756('0xa7')][_0x4756('0x13a')]=function(_0xfe6a87,_0x2a0020){var _0x4ef280=this;var _0x30af09=[];var _0x165da3=_0x2a0020>=0x1?_0x2a0020:0x1;var _0x5ec5ad=[];if(_0xfe6a87[_0x4756('0x137')]==='booked'){_0x165da3=0x1;}var _0x3e1d5f=Math['floor'](_0xfe6a87[_0x4756('0x4d')]*_0x165da3)-_0xfe6a87[_0x4756('0x6b')]-_0xfe6a87[_0x4756('0x1ce')];emitVoiceQueueSummary(_0xfe6a87);if(_0xfe6a87[_0x4756('0x1d8')]>0x0){var _0x834b9=_0xfe6a87['dialLimitQueue']-_0xfe6a87[_0x4756('0x6b')]-_0xfe6a87[_0x4756('0x19c')]-_0xfe6a87[_0x4756('0x1ce')]-_0xfe6a87[_0x4756('0x4f')];if(_0x3e1d5f>_0x834b9){_0x3e1d5f=_0x834b9;}}if(_0x3e1d5f>0x0){if(_0xfe6a87['dialMethod']===_0x4756('0x8')){_0x3e1d5f=0x1;}if(_0x3e1d5f>this[_0x4756('0x20')]){_0x3e1d5f=this[_0x4756('0x20')];}_0xfe6a87[_0x4756('0x1ce')]+=_0x3e1d5f;for(var _0x264b58 in this[_0x4756('0x1e')]){if(this[_0x4756('0x1e')][_0x4756('0x97')](_0x264b58)){if(this[_0x4756('0x1e')][_0x264b58][_0x4756('0xa3')]===_0x4756('0x1d9')&&this['agents'][_0x264b58]['status']===_0x4756('0xd5')){_0x30af09[_0x4756('0x10a')](this['agents'][_0x264b58]['id']);}}}this[_0x4756('0xbf')](_0xfe6a87['id'],_0x30af09,_0x3e1d5f,_0xfe6a87[_0x4756('0x1d0')])[_0x4756('0xb8')](function(_0x3be557){_0xfe6a87['temp']-=_0x3e1d5f;_0xfe6a87['temp']=_0xfe6a87[_0x4756('0x1ce')]>0x0?_0xfe6a87[_0x4756('0x1ce')]:0x0;if(!checkContactEmpty(_0x3be557)){_0x4ef280[_0x4756('0xb4')](_0xfe6a87)[_0x4756('0xb8')](sendMessageReschedule(_0xfe6a87))[_0x4756('0xaf')](loggerCatch(_0x4756('0xb6')));}else{_0xfe6a87[_0x4756('0x6b')]+=_0x3be557['length'];_0xfe6a87[_0x4756('0x3b')]=_0xfe6a87[_0x4756('0x137')]===_0x4756('0x8')?_0x4756('0x153'):_0x4756('0x1d2');for(var _0x1ea753=0x0;_0x1ea753<_0x3be557[_0x4756('0x96')];_0x1ea753+=0x1){if(_[_0x4756('0xd9')](_0x3be557[_0x1ea753])||_[_0x4756('0xd9')](_0x3be557[_0x1ea753][_0x4756('0x14e')])||_[_0x4756('0xd9')](_0x3be557[_0x1ea753][_0x4756('0x14e')][_0x4756('0x14d')])){_0x4ef280[_0x4756('0xca')](_0x4756('0x1d4'),_0xfe6a87,_0x3be557[_0x1ea753]);}else{_0x4ef280[_0x4756('0xb7')](_[_0x4756('0xcd')](_0x3be557[_0x1ea753],['VoiceQueueId',_0x4756('0x1d5')]))[_0x4756('0xb8')](_0x4ef280[_0x4756('0x1bc')](_0xfe6a87,_0x3be557[_0x1ea753]))[_0x4756('0xaf')](_0x4ef280[_0x4756('0xc8')](_0x4756('0x1d4'),_0xfe6a87));}}}})[_0x4756('0xaf')](loggerGetContactDialer(_0x4756('0x1da'),_0xfe6a87,_0x3e1d5f));}};Dialer[_0x4756('0xa7')][_0x4756('0x8e')]=function(_0x490eda){var _0x38bb3d=this;if(_0x490eda[_0x4756('0x1d8')]>0x0){var _0x445c83=_0x490eda[_0x4756('0x1d8')]-_0x490eda[_0x4756('0x6b')]-_0x490eda[_0x4756('0x19c')];if(_0x445c83>0x0){this[_0x4756('0x1db')](_0x490eda);}else{loggerPredictiveCalls[_0x4756('0x76')]('[handlePredictive][limitChannel]');}}else{this[_0x4756('0x1db')](_0x490eda);}};Dialer[_0x4756('0xa7')][_0x4756('0x1db')]=function(_0x11ca42){var _0x515c78=this;var _0x855bfa=[];_0x11ca42[_0x4756('0x6b')]+=0x1;for(var _0x218486 in this[_0x4756('0x1e')]){if(this['agents'][_0x4756('0x97')](_0x218486)){if(this[_0x4756('0x1e')][_0x218486][_0x4756('0xa3')]===_0x4756('0x1d9')&&this['agents'][_0x218486][_0x4756('0xad')]===_0x4756('0xd5')){_0x855bfa[_0x4756('0x10a')](this[_0x4756('0x1e')][_0x218486]['id']);}}}this['getContactDialer'](_0x11ca42['id'],_0x855bfa,0x1,_0x11ca42['dialOrderByScheduledAt'])[_0x4756('0xb8')](function(_0x444df2){if(!checkContactEmpty(_0x444df2)){checkContactLowerLimitOriginate(_0x11ca42,0x1,0x0);_0x515c78[_0x4756('0xb4')](_0x11ca42)[_0x4756('0xb8')](sendMessageReschedule(_0x11ca42))[_0x4756('0xaf')](loggerCatch(_0x4756('0xb6')));}else{_0x11ca42[_0x4756('0x3b')]='RUNNING';if(_[_0x4756('0xd9')](_0x444df2[0x0])||_[_0x4756('0xd9')](_0x444df2[0x0]['Contact'])||_[_0x4756('0xd9')](_0x444df2[0x0][_0x4756('0x14e')][_0x4756('0x14d')])){_0x515c78['emptyContact'](_0x4756('0x1d4'),_0x11ca42,_0x444df2[0x0]);}else{_0x515c78[_0x4756('0xb7')](_[_0x4756('0xcd')](_0x444df2[0x0],[_0x4756('0x10e'),_0x4756('0x1d5')]))['then'](_0x515c78['checkContactBlack'](_0x11ca42,_0x444df2[0x0]))[_0x4756('0xaf')](_0x515c78[_0x4756('0xc8')]('[actionOriginatePredictive]\x20',_0x11ca42));}}})[_0x4756('0xaf')](loggerGetContactDialer(_0x4756('0x1dc'),_0x11ca42,0x1));emitVoiceQueueSummary(_0x11ca42);};Dialer['prototype'][_0x4756('0x1b7')]=function(_0x5e166e,_0x401f60,_0x2d26af,_0x345197,_0x55bea2,_0x20b433){loggerPredictive[_0x4756('0x76')](_0x4756('0x1dd'));loggerPredictive['info'](_0x4756('0x1de'),_0x5e166e);loggerPredictive['info'](_0x4756('0x1df'),_0x401f60);loggerPredictive['info'](_0x4756('0x1e0'),_0x2d26af);loggerPredictive[_0x4756('0x76')](_0x4756('0x1e1'),_0x345197);loggerPredictive[_0x4756('0x76')](_0x4756('0x1e2'),_0x55bea2);loggerPredictive[_0x4756('0x76')](_0x4756('0x80'));return new BPromise(function(_0x4ac0e5,_0x49e425){if(_0x5e166e<=0x0||isNaN(_0x5e166e)){return _0x49e425(msgResponse(_0x4756('0x1e3'),_0x4756('0x1e4'),'m\x20=\x20'+_0x5e166e));}if(_0x2d26af<=0x0||isNaN(_0x2d26af)){return _0x49e425(msgResponse(_0x4756('0x1e3'),_0x4756('0x1e4'),_0x4756('0x1e5')+_0x2d26af));}if(_0x345197<=0x0||isNaN(_0x345197)){return _0x49e425(msgResponse(_0x4756('0x1e3'),'Error',_0x4756('0x1e6')+_0x345197));}if(_0x401f60<=0x0||isNaN(_0x401f60)){return _0x49e425(msgResponse(_0x4756('0x1e3'),'Error',_0x4756('0x1e7')+_0x401f60));}if(_0x55bea2<=0x0||isNaN(_0x55bea2)){return _0x49e425(msgResponse(_0x4756('0x1e3'),_0x4756('0x1e4'),_0x4756('0x1e8')+_0x55bea2));}_0x20b433=_0x20b433||0x0;var _0x2e2b59=0x1/_0x2d26af;var _0x212f5a=0x0;var _0x4fcb6a=0x0;var _0x16aaf5=0x0;var _0x1389b6=0x0;for(var _0x1cc005=0x0;_0x16aaf5<_0x55bea2;_0x1cc005+=0x1){_0x4fcb6a=_0x1cc005/_0x401f60;_0x212f5a=(_0x345197*_0x4fcb6a+_0x20b433)/_0x2e2b59;_0x16aaf5=erlangb(_0x212f5a,_0x5e166e);_0x1389b6=_0x212f5a/_0x5e166e*(0x1-erlangb(_0x212f5a,_0x5e166e));}return _0x4ac0e5({'erlangCalls':_0x1cc005,'erlangCallToSecond':_0x401f60/_0x1cc005,'erlangAbandonmentRate':_0x16aaf5,'erlangBusyFactor':_0x1389b6});});};Dialer[_0x4756('0xa7')][_0x4756('0x1b1')]=function(_0x1345b7,_0x196c8e,_0x15d552,_0x57e9a6,_0x2e0537,_0x4ff02f){loggerPredictive[_0x4756('0x76')](_0x4756('0x1e9'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1345b7);loggerPredictive['info'](_0x4756('0x1df'),_0x196c8e);loggerPredictive['info'](_0x4756('0x1e0'),_0x15d552);loggerPredictive[_0x4756('0x76')](_0x4756('0x1e1'),_0x57e9a6);loggerPredictive['info'](_0x4756('0x1ea'),_0x2e0537);loggerPredictive[_0x4756('0x76')]('---------------------------');return new BPromise(function(_0x152b2a,_0xfb8ed4){if(_0x1345b7<=0x0||isNaN(_0x1345b7)){return _0xfb8ed4(msgResponse('[busyFactor]',_0x4756('0x1e4'),'m\x20=\x20'+_0x1345b7));}if(_0x15d552<=0x0||isNaN(_0x15d552)){return _0xfb8ed4(msgResponse(_0x4756('0x1eb'),_0x4756('0x1e4'),_0x4756('0x1e5')+_0x15d552));}if(_0x57e9a6<=0x0||isNaN(_0x57e9a6)){return _0xfb8ed4(msgResponse(_0x4756('0x1eb'),_0x4756('0x1e4'),_0x4756('0x1e6')+_0x57e9a6));}if(_0x196c8e<=0x0||isNaN(_0x196c8e)){return _0xfb8ed4(msgResponse(_0x4756('0x1eb'),'Error',_0x4756('0x1e7')+_0x196c8e));}if(_0x2e0537<=0x0||isNaN(_0x2e0537)){return _0xfb8ed4(msgResponse('[busyFactor]',_0x4756('0x1e4'),_0x4756('0x1ec')+_0x2e0537));}_0x4ff02f=_0x4ff02f||0x0;var _0x5ad2be=0x1/_0x15d552;var _0x4ebbe8=0x0;var _0x469f37=0x0;var _0x301a48=0x0;var _0x38d942=0x0;for(var _0x420d6c=0x0;_0x38d942<_0x2e0537;_0x420d6c+=0x1){_0x469f37=_0x420d6c/_0x196c8e;_0x4ebbe8=(_0x57e9a6*_0x469f37+_0x4ff02f)/_0x5ad2be;_0x301a48=erlangb(_0x4ebbe8,_0x1345b7);_0x38d942=_0x4ebbe8/_0x1345b7*(0x1-erlangb(_0x4ebbe8,_0x1345b7));}return _0x152b2a({'erlangCalls':_0x420d6c,'erlangCallToSecond':_0x196c8e/_0x420d6c,'erlangAbandonmentRate':_0x301a48,'erlangBusyFactor':_0x38d942});});};module['exports']=Dialer; \ No newline at end of file +var _0xd5c2=['rrmemory','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','rescheduleContact','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','abandonmentRate','busyFactor','[CatchErlangB]','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','maxNumberOriginate','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\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','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','actions','uniqueId','startPredictive','startProgressive','queueBooked','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','message','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','predictiveIntervalDroppedCallsCallersExit','Abandoned','actionid','roundrobin','locked','paused','stateinterface'];(function(_0x5f0bd7,_0x3ab5dc){var _0x38216a=function(_0x273d02){while(--_0x273d02){_0x5f0bd7['push'](_0x5f0bd7['shift']());}};_0x38216a(++_0x3ab5dc);}(_0xd5c2,0xe8));var _0x2d5c=function(_0x121f73,_0x5a9202){_0x121f73=_0x121f73-0x0;var _0x39d301=_0xd5c2[_0x121f73];return _0x39d301;};'use strict';var util=require(_0x2d5c('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x2d5c('0x1'));var rr=require('rr');var md5=require(_0x2d5c('0x2'));var Redis=require(_0x2d5c('0x3'));var config=require('../../../config/environment/');var logger=require(_0x2d5c('0x4'))(_0x2d5c('0x5'));var loggerBooked=require(_0x2d5c('0x4'))(_0x2d5c('0x6'));var loggerPredictive=require(_0x2d5c('0x4'))(_0x2d5c('0x7'));var loggerPredictiveCalls=require(_0x2d5c('0x4'))(_0x2d5c('0x8'));var loggerSyncQueueSummary=require(_0x2d5c('0x4'))(_0x2d5c('0x9'));var ami=require(_0x2d5c('0xa'));config[_0x2d5c('0xb')]=_[_0x2d5c('0xc')](config[_0x2d5c('0xb')],{'host':_0x2d5c('0xd'),'port':0x18eb});var io=require(_0x2d5c('0xe'))(new Redis(config[_0x2d5c('0xb')]));var cmHopper=require(_0x2d5c('0xf'));var cmHopperFinal=require(_0x2d5c('0x10'));var cmHopperHistory=require(_0x2d5c('0x11'));var cmHopperBlack=require(_0x2d5c('0x12'));var voiceQueueRt=require(_0x2d5c('0x13'));var Action=require(_0x2d5c('0x14'));var History=require(_0x2d5c('0x15'));var Final=require(_0x2d5c('0x16'));var AgentComplete=require(_0x2d5c('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x2d5c('0x18'));var ipAgi=process[_0x2d5c('0x19')][_0x2d5c('0x1a')]||_0x2d5c('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x2d5c('0x1c')]['enqueue']=function(_0x5110e5){this['tail']=this[_0x2d5c('0x1d')]?this[_0x2d5c('0x1d')][_0x2d5c('0x1e')](_0x5110e5):_0x5110e5();};function Dialer(_0x1a5d87,_0xf9804b){this[_0x2d5c('0x1f')]=new Sequence();this[_0x2d5c('0x20')]=_0xf9804b;this[_0x2d5c('0x21')]=_0x1a5d87[_0x2d5c('0x21')];this[_0x2d5c('0x22')]=_0x1a5d87[_0x2d5c('0x22')];this[_0x2d5c('0x23')]=_0x1a5d87[_0x2d5c('0x23')];this[_0x2d5c('0x24')]=_0x1a5d87[_0x2d5c('0x24')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x2d5c('0x25')]={};this['contactsId']={};this[_0x2d5c('0x26')]={};this['optionPredictive']={};this[_0x2d5c('0x27')]={};this[_0x2d5c('0x28')]={};this['ivrOriginated']={};this[_0x2d5c('0x29')]={};this['queueBookedRR']={};ami['on'](_0x2d5c('0x2a'),this['syncAgentConnect']['bind'](this));ami['on'](_0x2d5c('0x2b'),this[_0x2d5c('0x2c')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x2e'),this[_0x2d5c('0x2f')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x30'),this['syncAgentComplete'][_0x2d5c('0x2d')](this));ami['on']('custom:queuesummary',this[_0x2d5c('0x9')]['bind'](this));ami['on'](_0x2d5c('0x31'),this[_0x2d5c('0x32')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x33'),this[_0x2d5c('0x34')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x35'),this['syncVarSet'][_0x2d5c('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0x2d5c('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x2d5c('0x36')][_0x2d5c('0x2d')](this));this[_0x2d5c('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x114123){return _0x114123!==null&&!_[_0x2d5c('0x38')](_0x114123);}function checkIsLoggedIn(_0x5ee465,_0xbcbafa){return function(){if(_0xbcbafa<=0x0){_0x5ee465['message']=_0x2d5c('0x39');throw _0x5ee465[_0x2d5c('0x3a')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x12c27a){return _0x12c27a;}function checkIsActive(_0x3e37f5,_0x41180e){return function(){if(!isActive(_0x41180e)){_0x3e37f5['message']=_0x2d5c('0x3b');throw _0x3e37f5[_0x2d5c('0x3a')]+_0x2d5c('0x3c');}};}function checkInterval(_0x2c837d){return function(){if(!isNotNull(_0x2c837d[_0x2d5c('0x3d')])){_0x2c837d['message']=_0x2d5c('0x3e');throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}if(!isNotNull(_0x2c837d[_0x2d5c('0x3d')][_0x2d5c('0x40')])){_0x2c837d[_0x2d5c('0x41')]=_0x2d5c('0x3e');throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}if(!isNotNull(_['isEmpty'](_0x2c837d[_0x2d5c('0x3d')][_0x2d5c('0x40')]))){_0x2c837d[_0x2d5c('0x41')]='INTERVAL_IS_NULL';throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}};}function msgResponse(_0x4d0993,_0x3f6874,_0xd3c0e5){return{'action':_0x4d0993,'response':_0x3f6874,'message':_0xd3c0e5,'stack':_0xd3c0e5};}function myreject(_0xf7b0ec){return function(_0x156cd2){return _0xf7b0ec(msgResponse(_0x2d5c('0x42'),_0x2d5c('0x43'),JSON[_0x2d5c('0x44')](_0x156cd2)));};}function getSeconds(_0x2a2bf8,_0x215b7b){var _0x2d1c35=moment(_0x2a2bf8)[_0x2d5c('0x45')](0x0);var _0x84f5c1=moment(_0x215b7b)['milliseconds'](0x0);return _0x2d1c35['diff'](_0x84f5c1,_0x2d5c('0x46'));}function emit(_0x247812,_0x640a2f,_0x26c93e){io['to'](_0x247812)[_0x2d5c('0x47')](_0x640a2f,_0x26c93e);}function emitVoiceQueueSummary(_0x43d2d4){if(_0x43d2d4[_0x2d5c('0x48')]==='outbound'){var _0x2e8b9d={'id':_0x43d2d4['id'],'name':_0x43d2d4[_0x2d5c('0x3a')],'strategy':_0x43d2d4[_0x2d5c('0x49')],'answered':_0x43d2d4[_0x2d5c('0x4a')],'available':_0x43d2d4[_0x2d5c('0x4b')],'loggedIn':_0x43d2d4['loggedIn'],'pTalking':_0x43d2d4[_0x2d5c('0x4c')],'sumBillable':_0x43d2d4[_0x2d5c('0x4d')],'sumDuration':_0x43d2d4[_0x2d5c('0x4e')],'sumHoldTime':_0x43d2d4[_0x2d5c('0x4f')]||0x0,'talking':_0x43d2d4['talking'],'total':_0x43d2d4[_0x2d5c('0x50')],'type':_0x43d2d4['type'],'unmanaged':_0x43d2d4[_0x2d5c('0x51')],'abandoned':_0x43d2d4[_0x2d5c('0x52')],'waiting':_0x43d2d4[_0x2d5c('0x53')],'loggedInDb':_0x43d2d4[_0x2d5c('0x54')],'dialActive':_0x43d2d4[_0x2d5c('0x55')],'dialMethod':_0x43d2d4[_0x2d5c('0x56')],'dialOriginateCallerIdName':_0x43d2d4[_0x2d5c('0x57')],'dialOriginateCallerIdNumber':_0x43d2d4[_0x2d5c('0x58')],'dialOriginateTimeout':_0x43d2d4[_0x2d5c('0x59')],'dialPrefix':_0x43d2d4[_0x2d5c('0x5a')],'outboundAnswerAgiCallsDay':_0x43d2d4[_0x2d5c('0x5b')],'outboundAnswerCallsDay':_0x43d2d4[_0x2d5c('0x5c')],'outboundBlacklistCallsDay':_0x43d2d4[_0x2d5c('0x5d')],'outboundBusyCallsDay':_0x43d2d4[_0x2d5c('0x5e')],'outboundCongestionCallsDay':_0x43d2d4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x43d2d4['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x43d2d4[_0x2d5c('0x5f')],'outboundDropCallsDayTimeout':_0x43d2d4['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x43d2d4[_0x2d5c('0x60')],'outboundNoSuchCallsDay':_0x43d2d4[_0x2d5c('0x61')],'outboundOriginateFailureCallsDay':_0x43d2d4[_0x2d5c('0x62')],'outboundReCallsDay':_0x43d2d4[_0x2d5c('0x63')],'outboundRejectCallsDay':_0x43d2d4[_0x2d5c('0x64')],'outboundUnknownCallsDay':_0x43d2d4[_0x2d5c('0x65')],'predictiveIntervalAnsweredCalls':_0x43d2d4[_0x2d5c('0x66')],'predictiveIntervalAvgHoldtime':_0x43d2d4['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x43d2d4[_0x2d5c('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x43d2d4['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x43d2d4[_0x2d5c('0x68')],'predictiveIntervalErlangCalls':_0x43d2d4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43d2d4[_0x2d5c('0x69')],'predictiveIntervalHitRate':_0x43d2d4[_0x2d5c('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x43d2d4['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x43d2d4[_0x2d5c('0x6b')],'predictiveIntervalAvailable':_0x43d2d4[_0x2d5c('0x6c')],'predictiveIntervalTotalCalls':_0x43d2d4[_0x2d5c('0x6d')],'message':_0x43d2d4['message'],'originated':_0x43d2d4[_0x2d5c('0x6e')],'erlangCalls':_0x43d2d4[_0x2d5c('0x6f')],'erlangCallToSecond':_0x43d2d4[_0x2d5c('0x70')],'erlangAbandonmentRate':_0x43d2d4[_0x2d5c('0x71')],'erlangBusyFactor':_0x43d2d4[_0x2d5c('0x72')],'startPredictive':_0x43d2d4['startPredictive'],'startProgressive':_0x43d2d4['startProgressive']};if(_0x43d2d4['Trunk']){_0x2e8b9d[_0x2d5c('0x73')]={'id':_0x43d2d4[_0x2d5c('0x73')]['id'],'name':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x3a')],'active':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x74')],'callerid':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x75')]};}if(_0x43d2d4[_0x2d5c('0x3d')]){_0x2e8b9d[_0x2d5c('0x3d')]={'id':_0x43d2d4[_0x2d5c('0x3d')]['id'],'name':_0x43d2d4[_0x2d5c('0x3d')][_0x2d5c('0x3a')]};}var _0xfbc77e=md5(JSON[_0x2d5c('0x44')](_0x2e8b9d));if(_0x43d2d4[_0x2d5c('0x2')]!==_0xfbc77e){_0x43d2d4[_0x2d5c('0x2')]=_0xfbc77e;emit(util['format'](_0x2d5c('0x76'),_0x2e8b9d['name']),_0x2d5c('0x77'),_0x2e8b9d);}}}function emitCampaignSummary(_0x4cc143){if(_0x4cc143['type']===_0x2d5c('0x78')){emit(util[_0x2d5c('0x79')]('campaign:ivr:%s',_0x4cc143[_0x2d5c('0x3a')]),_0x2d5c('0x7a'),_0x4cc143);}}function checkGetDataPredictive(_0x5ec12a){if(isNotNull(_0x5ec12a)){if(!_[_0x2d5c('0x7b')](_0x5ec12a)){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x7d'));loggerPredictive[_0x2d5c('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ec12a[_0x2d5c('0x6d')]);loggerPredictive['info'](_0x2d5c('0x7e'),_0x5ec12a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x7f'),_0x5ec12a[_0x2d5c('0x68')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x80'),_0x5ec12a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x81'),_0x5ec12a[_0x2d5c('0x82')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x83'),_0x5ec12a[_0x2d5c('0x67')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));if(_0x5ec12a[_0x2d5c('0x6d')]>0x0){if(!_['isUndefined'](_0x5ec12a[_0x2d5c('0x67')])&&_0x5ec12a[_0x2d5c('0x67')]>0x0){return!![];}else{loggerPredictive['info'](_0x2d5c('0x85'));}if(!_[_0x2d5c('0x38')](_0x5ec12a['predictiveIntervalAvgHoldtime'])&&_0x5ec12a[_0x2d5c('0x82')]>0x0){return!![];}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x86'));}}else{loggerPredictive['info'](_0x2d5c('0x87'));}}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x88'));}}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x88'));}return![];}function mergeDataErlangB(_0x530768){return function(_0x329cd9){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x89'));loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8a'),_0x329cd9['erlangCalls']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8b'),_0x329cd9['erlangCallToSecond']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8c'),_0x329cd9['erlangAbandonmentRate']);loggerPredictive['info'](_0x2d5c('0x8d'),_0x329cd9['erlangBusyFactor']);loggerPredictive['info'](_0x2d5c('0x8c'),_0x329cd9['erlangAbandonmentRate']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));_[_0x2d5c('0x8e')](_0x530768,_0x329cd9);};}function getDiff(_0x51875f){var _0x1c48be=moment()[_0x2d5c('0x45')](0x0);var _0x57847f=moment(_0x51875f)['milliseconds'](0x0);return _0x1c48be[_0x2d5c('0x8f')](_0x57847f,_0x2d5c('0x46'));}function ifInterval(_0x17bf74,_0x2686a3){if(_[_0x2d5c('0x38')](_0x2686a3)){return![];}if(getDiff(_0x2686a3)<_0x17bf74*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x297c1d){if(isNotNull(_0x297c1d)){if(!_[_0x2d5c('0x38')](_0x297c1d[_0x2d5c('0x28')])){_0x297c1d['startProgressive']=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d[_0x2d5c('0x3a')],_0x2d5c('0x90'));}if(!_[_0x2d5c('0x38')](_0x297c1d[_0x2d5c('0x27')])){_0x297c1d['startPredictive']=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d[_0x2d5c('0x3a')],_0x2d5c('0x91'));}if(!_['isUndefined'](_0x297c1d[_0x2d5c('0x92')])){clearInterval(_0x297c1d['handlePredictive']);_0x297c1d[_0x2d5c('0x92')]=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d['name'],_0x2d5c('0x93'));}}}function erlangb(_0x449472,_0x39157f){if(_0x39157f===0x0){return 0x0;}var _0x13ea4a=0x1;for(var _0x429f5d=0x1;_0x429f5d<=_0x39157f;_0x429f5d+=0x1){_0x13ea4a=0x1+_0x13ea4a*_0x429f5d/_0x449472;}return 0x1/_0x13ea4a;}function isVoiceQueueOutbound(_0x26fdd6){return _0x26fdd6==='outbound';}function isNotPreview(_0x5b68be){return _0x5b68be!==_0x2d5c('0x20');}function isCampaignIvr(_0x5c27d8){return _0x5c27d8===_0x2d5c('0x78');}function getCallerId(_0x453efe,_0x320e0f,_0x191014){if(!_[_0x2d5c('0x38')](_0x191014)&&_0x2d5c('0x94')===typeof _0x191014&&!_[_0x2d5c('0x7b')](_0x191014)){if(!_[_0x2d5c('0x38')](_0x320e0f)&&'string'===typeof _0x320e0f&&!_[_0x2d5c('0x7b')](_0x320e0f)){return util[_0x2d5c('0x79')]('\x22%s\x22\x20<%s>',_0x320e0f,_0x191014);}return util[_0x2d5c('0x79')](_0x2d5c('0x95'),_0x191014,_0x191014);}if(!_['isUndefined'](_0x453efe)&&_0x2d5c('0x94')===typeof _0x453efe&&!_[_0x2d5c('0x7b')](_0x453efe)){return _0x453efe;}return _0x2d5c('0x96');}function loggerCatchQueueSummary(_0x513ac1,_0x1aa447){return function(_0x4851cb){freeVariablesPredictive(_0x1aa447);emitVoiceQueueSummary(_0x1aa447);emitCampaignSummary(_0x1aa447);loggerSyncQueueSummary[_0x2d5c('0x97')](_0x513ac1,util[_0x2d5c('0x98')](_0x4851cb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x29ff96,_0x1d9015){return function(_0xd014d8){loggerPredictive[_0x2d5c('0x97')](_0x1d9015[_0x2d5c('0x3a')],_0x29ff96);loggerPredictive['error'](_0xd014d8[_0x2d5c('0x99')]);freeVariablesPredictive(_0x1d9015);};}function loggerCatch(_0x2dfc7b){return function(_0x5bf8f1){logger[_0x2d5c('0x97')](_0x2dfc7b,util[_0x2d5c('0x98')](_0x5bf8f1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1bb7c8){return _0x1bb7c8&&!_[_0x2d5c('0x38')](_0x1bb7c8)&&_0x1bb7c8[_0x2d5c('0x9a')]>0x0;}function decremetOriginate(_0x49bdf6){if(!_['isUndefined'](_0x49bdf6)&&_0x49bdf6!==null){if(_0x49bdf6[_0x2d5c('0x9b')](_0x2d5c('0x6e'))){if(_0x49bdf6[_0x2d5c('0x6e')]>0x0){_0x49bdf6[_0x2d5c('0x6e')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x2d5c('0x97')](_0x2d5c('0x9c'));}}function checkContactLowerLimitOriginate(_0x316e94,_0x2cc2e3,_0x299864){if(_0x2cc2e3>_0x299864){for(var _0x28db0f=0x0;_0x28db0f<_0x2cc2e3-_0x299864;_0x28db0f+=0x1){decremetOriginate(_0x316e94);}}}function loggerGetContactDialer(_0x223e22,_0xf75af7,_0x27c1d7){return function(_0x1dafa6){checkContactLowerLimitOriginate(_0xf75af7,_0x27c1d7,0x0);logger['error'](_0x223e22,util[_0x2d5c('0x98')](_0x1dafa6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x34c7d7){return function(_0x58ac86){if(isNotNull(_0x58ac86)&&isNotNull(_0x58ac86[0x0])){if(_0x58ac86[0x0][_0x2d5c('0x9d')]>0x0){_0x34c7d7['message']='RESCHEDULED_CONTACTS';logger[_0x2d5c('0x7c')]('[getContactDialer2][ReScheduled]'+_0x34c7d7[_0x2d5c('0x3a')],_0x58ac86[0x0][_0x2d5c('0x9d')],'contacts');}else{_0x34c7d7[_0x2d5c('0x41')]=_0x2d5c('0x9e');logger[_0x2d5c('0x7c')](_0x2d5c('0x9f')+_0x34c7d7[_0x2d5c('0x3a')]);}}};}function notSendMessagesQueue(_0x56f463){if(_0x56f463[_0x2d5c('0xa0')]){freeVariablesPredictive(_0x56f463);if(_0x56f463[_0x2d5c('0x6e')]===0x0&&_0x56f463[_0x2d5c('0xa1')]===0x0&&_0x56f463[_0x2d5c('0x53')]===0x0&&(_0x56f463[_0x2d5c('0x4c')]||0x0)===0x0){_0x56f463[_0x2d5c('0xa0')]=![];_0x56f463[_0x2d5c('0x4b')]=0x0;_0x56f463[_0x2d5c('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa2'),_0x56f463[_0x2d5c('0x3a')],'is\x20not\x20active');}else{_0x56f463[_0x2d5c('0x41')]=_0x2d5c('0xa3');loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa2'),_0x56f463[_0x2d5c('0x3a')],'is\x20disactive');}emitVoiceQueueSummary(_0x56f463);}}function notSendMessagesCampaign(_0x5d0b76){if(_0x5d0b76[_0x2d5c('0xa0')]){if(_0x5d0b76[_0x2d5c('0x6e')]===0x0){_0x5d0b76[_0x2d5c('0xa0')]=![];_0x5d0b76['message']=_0x2d5c('0x3b');loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa4'),_0x5d0b76['name'],_0x2d5c('0xa5'));}else{_0x5d0b76[_0x2d5c('0x41')]=_0x2d5c('0xa3');loggerSyncQueueSummary[_0x2d5c('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5d0b76[_0x2d5c('0x3a')],_0x2d5c('0xa6'));}emitCampaignSummary(_0x5d0b76);}}function createObjHistory(_0x1a76e7,_0x1e9451,_0x4d96b7,_0x315cae,_0x4a75ac){_0x1a76e7[_0x2d5c('0x41')]=_0x4d96b7;var _0x490d72=new Action(_0x1a76e7,_0x1e9451);var _0x213524=new History(_0x490d72);_0x213524[_0x2d5c('0xa7')]=_0x315cae;_0x213524['statedesc']=_0x4a75ac;_0x213524['endtime']=_0x490d72[_0x2d5c('0xa8')];return _0x213524;}Dialer[_0x2d5c('0x1c')][_0x2d5c('0xa9')]=function(){var _0x12c9e4=this;setInterval(function(){_0x12c9e4[_0x2d5c('0xaa')](_0x12c9e4[_0x2d5c('0x26')],_0x2d5c('0xab'));_0x12c9e4[_0x2d5c('0xaa')](_0x12c9e4[_0x2d5c('0x25')],_0x2d5c('0xac'));},0x32c8);};Dialer[_0x2d5c('0x1c')]['clearZombieChannels']=function(_0x40c245,_0x446a58){var _0x4454d7=this;for(var _0xac17d7 in _0x40c245){if(_0x40c245[_0x2d5c('0x9b')](_0xac17d7)){this['sequence']['enqueue'](function(){if(!_[_0x2d5c('0xad')](_0x40c245[_0xac17d7])){return ami[_0x2d5c('0xae')]({'action':_0x2d5c('0xaf'),'channel':_0x40c245[_0xac17d7][_0x2d5c('0xb0')]})['catch'](function(_0x69b277){if(_0x69b277[_0x2d5c('0x41')]===_0x2d5c('0xb1')){setTimeout(function(){if(_0x40c245[_0xac17d7]&&_0x40c245[_0xac17d7][_0x2d5c('0x48')]!==_0x2d5c('0x78')){_0x4454d7[_0x2d5c('0xb2')](_0x4454d7['voiceQueues'][_0x40c245[_0xac17d7][_0x2d5c('0xb3')]]);logger['error'](_0x2d5c('0xb4'),_0x446a58,_0xac17d7,_0x40c245[_0xac17d7][_0x2d5c('0xb3')]);delete _0x40c245[_0xac17d7];}if(_0x40c245[_0xac17d7]&&_0x40c245[_0xac17d7][_0x2d5c('0x48')]==='ivr'){_0x4454d7[_0x2d5c('0xb2')](_0x4454d7['campaigns'][_0x40c245[_0xac17d7]['queue']]);logger[_0x2d5c('0x97')](_0x2d5c('0xb5'),_0x446a58,_0xac17d7,_0x40c245[_0xac17d7]['queue']);delete _0x40c245[_0xac17d7];}},0x2328);}});}});}}};Dialer['prototype'][_0x2d5c('0xb6')]=function(_0x4a6cf9){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xb6')](_0x4a6cf9))['catch'](loggerCatch(_0x2d5c('0xb9')));};Dialer['prototype'][_0x2d5c('0xba')]=function(_0x4b8b40){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperBlack[_0x2d5c('0xba')](_0x4b8b40))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xbc')));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xbd')]=function(_0x46c39f){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopperBlack[_0x2d5c('0xbd')](_0x46c39f))[_0x2d5c('0xbb')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x77d06a){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperHistory[_0x2d5c('0xbe')](_0x77d06a))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xbf')));};Dialer[_0x2d5c('0x1c')]['rescheduleContact']=function(_0x35b595){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper['rescheduleContact'](_0x35b595))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xc0')));};Dialer['prototype'][_0x2d5c('0xc1')]=function(_0x4c8a3d,_0x22f8fa,_0x61dfd6,_0x4744e6){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc1')](_0x4c8a3d,_0x22f8fa,_0x61dfd6,_0x4744e6))[_0x2d5c('0xbb')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x2d5c('0xc2')]=function(_0x32b548,_0x28ff24,_0x2f8bce){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc2')](_0x32b548,_0x28ff24,_0x2f8bce))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xc3')));};Dialer[_0x2d5c('0x1c')]['getVoiceQueueRtPauses']=function(_0x448a01){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x448a01))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xc4')]=function(_0x573c55){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc4')](_0x573c55))[_0x2d5c('0xbb')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x2d5c('0x1c')]['createHistory']=function(_0x201790){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperHistory[_0x2d5c('0xc5')](_0x201790))['catch'](loggerCatch(_0x2d5c('0xc6')));};Dialer['prototype'][_0x2d5c('0xb2')]=function(_0x359bcd){if(!_[_0x2d5c('0x38')](_0x359bcd)&&_0x359bcd!==null){if(_0x359bcd[_0x2d5c('0x9b')]('originated')){if(_0x359bcd[_0x2d5c('0x6e')]>0x0){_0x359bcd[_0x2d5c('0x6e')]-=0x1;}else{logger['error'](_0x2d5c('0xc7'));}}}else{logger[_0x2d5c('0x97')](_0x2d5c('0xc8'));}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xc9')]=function(_0x1f819d,_0x123127){var _0x56c8a5=this;return function(_0x10d7b0){_0x56c8a5[_0x2d5c('0xb2')](_0x123127);logger[_0x2d5c('0x97')](_0x1f819d,util[_0x2d5c('0x98')](_0x10d7b0,{'showHidden':![],'depth':null}));};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xca')]=function(_0x3261f7,_0x3fb914,_0x2fd47e){var _0x43ca68={'state':0x19,'statedesc':'notFound'};this[_0x2d5c('0xb2')](_0x3fb914);this[_0x2d5c('0xcb')](_[_0x2d5c('0x8e')](_0x43ca68,_[_0x2d5c('0xcc')](_0x2fd47e,[_0x2d5c('0xcd'),_0x2d5c('0xce'),_0x2d5c('0xcf'),_0x2d5c('0xd0'),_0x2d5c('0xd1')])),_0x2d5c('0xd2'),_0x2d5c('0xd3'));logger[_0x2d5c('0x97')](_0x3261f7);};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xd4')]=function(_0xd5223b){return _0xd5223b===_0x2d5c('0xd5');};Dialer['prototype'][_0x2d5c('0xd6')]=function(_0x33cf7b){return!_[_0x2d5c('0x38')](_0x33cf7b)&&_0x33cf7b&&!_[_0x2d5c('0x38')](_0x33cf7b[_0x2d5c('0x3a')])&&!_[_0x2d5c('0x38')](_0x33cf7b[_0x2d5c('0x74')])&&_0x33cf7b[_0x2d5c('0x74')]&&(this[_0x2d5c('0x24')][util['format'](_0x2d5c('0xd7'),_0x33cf7b['name'])]['status']===_0x2d5c('0xd8')||this[_0x2d5c('0x24')][util[_0x2d5c('0x79')]('SIP/%s',_0x33cf7b['name'])]['status']===_0x2d5c('0xd9'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xcb')]=function(_0x59faab,_0x59485a,_0x2662bb){this[_0x2d5c('0xc5')](_0x59faab)[_0x2d5c('0xbb')](loggerCatch(_0x59485a));this[_0x2d5c('0xc4')](_0x59faab)[_0x2d5c('0xbb')](loggerCatch(_0x2662bb));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xda')]=function(_0x3083ba){var _0x45977e=this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];var _0x12f51f;if(!_[_0x2d5c('0xad')](_0x3083ba)&&!_['isNil'](_0x3083ba[_0x2d5c('0xdc')])&&!_[_0x2d5c('0xad')](_0x3083ba['variable']['amdstatus'])&&_0x3083ba[_0x2d5c('0xdd')]===_0x2d5c('0xde')&&_0x45977e){if(_0x45977e[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0xdf')]&&_0x3083ba['value']===_0x2d5c('0xe0')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this['voiceQueues'][_0x45977e[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x45977e['queue']][_0x2d5c('0x5c')]+=0x1;this[_0x2d5c('0x21')][_0x45977e['queue']][_0x2d5c('0x5b')]+=0x1;_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x12;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe2');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');this['saveInDb'](_0x12f51f,'[syncHangupInAMD][createHistory]',_0x2d5c('0xe5'));}if(_0x45977e[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&this['voiceQueues'][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0xdf')]&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe7')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this['updateOriginated'](this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0x5c')]+=0x1;this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0x5b')]+=0x1;_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x13;_0x12f51f['statedesc']=_0x2d5c('0xe8');_0x12f51f['membername']=_0x2d5c('0xe4');_0x12f51f[_0x2d5c('0xe9')]=!![];this['saveInDb'](_0x12f51f,_0x2d5c('0xea'),_0x2d5c('0xeb'));}if(_0x45977e['type']==='ivr'&&this['campaigns'][_0x45977e['queue']]['dialAMDActive']&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe0')){delete this[_0x2d5c('0x26')][_0x3083ba['uniqueid']];this[_0x2d5c('0xb2')](this[_0x2d5c('0x22')][_0x45977e[_0x2d5c('0xb3')]]);_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x12;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe2');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');this['saveInDb'](_0x12f51f,_0x2d5c('0xec'),_0x2d5c('0xed'));}if(_0x45977e['type']===_0x2d5c('0x78')&&this[_0x2d5c('0x22')][_0x45977e['queue']][_0x2d5c('0xdf')]&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe7')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this[_0x2d5c('0x22')][_0x45977e[_0x2d5c('0xb3')]]);_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f['state']=0x13;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe8');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');_0x12f51f[_0x2d5c('0xe9')]=!![];this[_0x2d5c('0xcb')](_0x12f51f,_0x2d5c('0xee'),_0x2d5c('0xef'));}}};Dialer['prototype']['syncHangup']=function(_0x8be6ef){var _0x4abcb2=this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];var _0x2c2f11=this;var _0x2a7a7d;if(_0x4abcb2&&_0x4abcb2[_0x2d5c('0x48')]==='ivr'){delete this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];this['updateOriginated'](this[_0x2d5c('0x22')][_0x4abcb2[_0x2d5c('0xb3')]]);this['campaigns'][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0xf0')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);this[_0x2d5c('0xc5')](_0x2a7a7d)['catch'](loggerCatch(_0x2d5c('0xf1')));this[_0x2d5c('0xc4')](_0x2a7a7d)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x4abcb2&&_0x4abcb2['type']!==_0x2d5c('0x78')&&isNotNull(this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0xf2')])){delete this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x4abcb2['queue']][_0x2d5c('0x5c')]+=0x1;this['voiceQueues'][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0x5b')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);_0x2a7a7d[_0x2d5c('0xa7')]=0x10;_0x2a7a7d[_0x2d5c('0xe1')]=_0x2d5c('0xf3');_0x2a7a7d[_0x2d5c('0xe3')]=_0x2d5c('0xf4');this[_0x2d5c('0xc5')](_0x2a7a7d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2d5c('0xc4')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf5')));}if(_0x4abcb2&&_0x4abcb2[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&!isNotNull(this[_0x2d5c('0x21')][_0x4abcb2['queue']][_0x2d5c('0xf2')])){delete this['uniqueId'][_0x8be6ef['uniqueid']];this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0x65')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);_0x2a7a7d[_0x2d5c('0xa7')]=0xc;_0x2a7a7d[_0x2d5c('0xe1')]=_0x8be6ef['cause-txt'];_0x2a7a7d[_0x2d5c('0xe3')]='Unknow';this[_0x2d5c('0xc5')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf1')));this[_0x2d5c('0xc4')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf5')));}};Dialer['prototype']['syncAgentComplete']=function(_0x289984){var _0x427f81=this[_0x2d5c('0x26')][_0x289984[_0x2d5c('0xdb')]];var _0x3e46b1=this;if(this[_0x2d5c('0x21')][_0x289984['queue']]){if(_0x427f81&&_0x427f81['type']!==_0x2d5c('0x78')){delete this[_0x2d5c('0x26')][_0x289984[_0x2d5c('0xdb')]];this[_0x2d5c('0x21')][_0x289984['queue']][_0x2d5c('0x5c')]+=0x1;var _0x118c5c=new AgentComplete(_0x427f81,_0x289984);if(_0x289984['reason']===_0x2d5c('0xf6')){_0x118c5c[_0x2d5c('0xf7')]=this[_0x2d5c('0x21')][_0x289984[_0x2d5c('0xb3')]][_0x2d5c('0xf8')]&&this[_0x2d5c('0x21')][_0x289984[_0x2d5c('0xb3')]][_0x2d5c('0xf9')]?moment()[_0x2d5c('0x79')](_0x2d5c('0xfa')):undefined;}this[_0x2d5c('0xc5')](_0x118c5c)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfb')));this[_0x2d5c('0xc4')](_0x118c5c)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfc')));}}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xfd')]=function(_0x545d86){if(this[_0x2d5c('0x21')][_0x545d86[_0x2d5c('0xb3')]]){if(this[_0x2d5c('0x26')][_0x545d86[_0x2d5c('0xdb')]]&&this[_0x2d5c('0x26')][_0x545d86['uniqueid']][_0x2d5c('0x48')]!=='ivr'){this[_0x2d5c('0xb2')](this['voiceQueues'][_0x545d86[_0x2d5c('0xb3')]]);this['uniqueId'][_0x545d86[_0x2d5c('0xdb')]][_0x2d5c('0xfe')]=moment()[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xff')]=function(_0x51c4b1){this[_0x2d5c('0xc5')](_0x51c4b1)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfb')));this[_0x2d5c('0xc4')](_0x51c4b1)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x2c')]=function(_0x2680da){var _0x2828f7=this[_0x2d5c('0x26')][_0x2680da[_0x2d5c('0xdb')]];var _0x4e3a66=this;if(this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]){if(_0x2828f7&&_0x2828f7[_0x2d5c('0x48')]!=='ivr'){delete this[_0x2d5c('0x26')][_0x2680da['uniqueid']];this[_0x2d5c('0xb2')](this['voiceQueues'][_0x2680da[_0x2d5c('0xb3')]]);_0x2828f7[_0x2d5c('0x100')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));var _0x263f4b=new QueueCallerAbandon(_0x2828f7,_0x2680da);if(getSeconds(_0x2828f7[_0x2d5c('0x100')],_0x2828f7[_0x2d5c('0x101')])>=_0x2828f7[_0x2d5c('0x102')]){this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x68')]+=0x1;this['voiceQueues'][_0x2680da['queue']][_0x2d5c('0x103')]+=0x1;this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x263f4b['state']=0xa;_0x263f4b[_0x2d5c('0xe1')]=_0x2d5c('0x104');_0x263f4b[_0x2d5c('0x105')]=_0x2d5c('0x106');_0x263f4b[_0x2d5c('0xf7')]=this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]['dialQueueProject2']?moment()[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x2d5c('0xff')](_0x263f4b);}else{this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x107')]+=0x1;this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x5f')]+=0x1;_0x263f4b[_0x2d5c('0xa7')]=0xb;_0x263f4b['statedesc']=_0x2d5c('0x108');_0x263f4b[_0x2d5c('0x105')]='CALLEREXIT';this[_0x2d5c('0xff')](_0x263f4b);}}}};Dialer['prototype'][_0x2d5c('0x34')]=function(_0x46b3d8){if(this[_0x2d5c('0x25')][_0x46b3d8[_0x2d5c('0xdb')]]){this[_0x2d5c('0x25')][_0x46b3d8[_0x2d5c('0xdb')]][_0x2d5c('0xb0')]=_0x46b3d8[_0x2d5c('0xb0')];}if(this[_0x2d5c('0x26')][_0x46b3d8[_0x2d5c('0xdb')]]){this[_0x2d5c('0x26')][_0x46b3d8[_0x2d5c('0xdb')]][_0x2d5c('0xb0')]=_0x46b3d8['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x260728){if(strategy[this[_0x2d5c('0x21')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]===_0x2d5c('0x10a')){if(this['actions'][_0x260728['actionid']]&&_[_0x2d5c('0xad')](this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0x10b')])&&_0x260728[_0x2d5c('0xaf')]==='1'&&_0x260728[_0x2d5c('0x10c')]==='0'){if(this[_0x2d5c('0x23')][_0x260728[_0x2d5c('0x10d')]]){if(!this['agents'][_0x260728[_0x2d5c('0x10d')]]['locked']){this[_0x2d5c('0x23')][_0x260728['stateinterface']][_0x2d5c('0x10b')]=!![];this[_0x2d5c('0x25')][_0x260728['actionid']][_0x2d5c('0x10b')]=!![];this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]]['stateinterface']=_0x260728[_0x2d5c('0x10d')];}}}}else if((strategy[this[_0x2d5c('0x21')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]||_0x2d5c('0x10e'))==='rrmemory'){if(this['actions'][_0x260728[_0x2d5c('0x109')]]){if(this[_0x2d5c('0x23')][_0x260728['stateinterface']]){this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0x10d')]=_0x260728['stateinterface'];if(_[_0x2d5c('0xad')](this[_0x2d5c('0x29')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]])){this['queueBooked'][this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]=[];}this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]['push'](_[_0x2d5c('0x8e')](_[_0x2d5c('0xcc')](this['actions'][_0x260728[_0x2d5c('0x109')]],[_0x2d5c('0x10f'),_0x2d5c('0x10d')]),{'status':_0x260728[_0x2d5c('0xaf')],'paused':_0x260728['paused']}));}}}};function unlockQueueStatus(_0x49b1dc,_0x5b6689){setTimeout(function(){if(_['isUndefined'](_0x49b1dc['queueStatusComplete'])){loggerBooked[_0x2d5c('0x97')](_0x2d5c('0x110'),_0x5b6689);}_0x49b1dc[_0x2d5c('0x111')]=!![];loggerBooked[_0x2d5c('0x7c')](_0x2d5c('0x112'),_0x5b6689,JSON['stringify'](_[_0x2d5c('0xcc')](_0x49b1dc,['name',_0x2d5c('0x111')])));},0x1f3);}Dialer['prototype'][_0x2d5c('0x36')]=function(_0x507dcb){var _0x166750=this;var _0x4be176=_0x166750[_0x2d5c('0x21')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]];if(strategy[this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]==='roundrobin'){if(this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]&&this[_0x2d5c('0x25')][_0x507dcb['actionid']]['stateinterface']){this['preview'][_0x2d5c('0x113')](this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10f')],this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10d')])[_0x2d5c('0xbb')](function(_0x36dd76){logger['error'](_0x2d5c('0x114'),util[_0x2d5c('0x98')](_0x36dd76,{'showHidden':![],'depth':null}));})[_0x2d5c('0x1e')](function(){_0x166750['updateOriginated'](_0x166750[_0x2d5c('0x21')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]);_0x166750[_0x2d5c('0x23')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10d')]]['locked']=![];delete _0x166750[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);this[_0x2d5c('0x115')]({'active':![],'ContactId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xcd')],'ListId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xce')],'VoiceQueueId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x116')));delete this[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176);}}else if((strategy[this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]||'rrmemory')===_0x2d5c('0x10e')){var _0x347b54;if(this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]&&!_['isEmpty'](this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]])){if(this[_0x2d5c('0x117')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]){this['queueBookedRR'][_0x166750['actions'][_0x507dcb[_0x2d5c('0x109')]]['queue']]=this['queueBookedRR'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]?this['queueBookedRR'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]:this['queueBooked'][this['actions'][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]?this['queueBooked'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']][_0x2d5c('0x118')]||0x0:0x0;}this['queueBooked'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]['_rr']=this[_0x2d5c('0x117')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]];for(var _0x10fa02=0x0;_0x10fa02=0x0?!![]:![];})[_0x2d5c('0xbb')](myreject(_0x4b3fe4)));}}else{_0xbaac80['push'](ami[_0x2d5c('0xae')]({'action':_0x2d5c('0x12c'),'command':util[_0x2d5c('0x79')](_0x2d5c('0x12d'),_0x29cdbf,!_['isUndefined'](config[_0x2d5c('0x127')][_0x2e056f])?_0x2e056f:'')})[_0x2d5c('0xb8')](function(_0x3ec651){return _0x3ec651[_0x2d5c('0x12f')][_0x2d5c('0x130')](_0x2d5c('0x131'))>=0x0?!![]:![];})['catch'](myreject(_0x4b3fe4)));}BPromise[_0x2d5c('0x132')](_0xbaac80)[_0x2d5c('0xb8')](function(_0x4e1893){var _0x57601e=_[_0x2d5c('0x133')](_0x4e1893);if(_0x57601e){return _0x30df0f(_0x57601e);}else{_0x227bbd['message']=_0x27e734?_0x2d5c('0x134'):'INTERVAL_IS_OVERTIME';return _0x4b3fe4(msgResponse(_0x2d5c('0x135'),_0x2d5c('0x124'),_0x2d5c('0x136')+_0x27e734+'\x20'+_0x13d23b+_0x2d5c('0x137')+util[_0x2d5c('0x98')](_0x29cdbf,{'showHidden':![],'depth':null})+_0x2d5c('0x138')+_0x2e056f));}})[_0x2d5c('0xbb')](function(_0x512bf9){return _0x4b3fe4(msgResponse(_0x2d5c('0x123'),'Failure',JSON[_0x2d5c('0x44')](_0x512bf9)));});});};Dialer['prototype'][_0x2d5c('0x139')]=function(_0x5b26e0){var _0x432c3e=this;return function(){switch(_0x5b26e0['dialMethod']){case _0x2d5c('0x13a'):freeVariablesPredictive(_0x5b26e0);_0x432c3e[_0x2d5c('0x13b')](_0x5b26e0,0x1);break;case _0x2d5c('0x13c'):freeVariablesPredictive(_0x5b26e0);_0x432c3e[_0x2d5c('0x13b')](_0x5b26e0,_0x5b26e0[_0x2d5c('0x13d')]);break;case'predictive':_0x432c3e[_0x2d5c('0x7')](_0x5b26e0);break;case _0x2d5c('0x6'):freeVariablesPredictive(_0x5b26e0);_0x432c3e['handlePower'](_0x5b26e0,0x1);break;default:freeVariablesPredictive(_0x5b26e0);logger[_0x2d5c('0x97')](_0x2d5c('0x13e'),_0x5b26e0['name'],_0x2d5c('0x13f'));}};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x140')]=function(_0x148070){var _0x104897=this;return function(){_0x104897[_0x2d5c('0x141')](_0x148070);};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x9')]=function(_0x14ef50){var _0x262aa8=this;if(isNotPreview(_0x14ef50[_0x2d5c('0x56')])){if(isVoiceQueueOutbound(_0x14ef50[_0x2d5c('0x48')])&&isActive(_0x14ef50[_0x2d5c('0x55')])){_0x14ef50['sendMessageOneNotActive']=!![];BPromise[_0x2d5c('0xb7')]()['then'](checkIsLoggedIn(_0x14ef50,_0x14ef50[_0x2d5c('0x142')]))[_0x2d5c('0xb8')](checkIsActive(_0x14ef50,_0x14ef50[_0x2d5c('0x55')]))[_0x2d5c('0xb8')](checkInterval(_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8[_0x2d5c('0x143')](_0x14ef50))['then'](_0x262aa8[_0x2d5c('0x122')](_0x14ef50[_0x2d5c('0x144')],_0x14ef50[_0x2d5c('0x145')],_0x14ef50[_0x2d5c('0x3a')],_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8[_0x2d5c('0x146')](_0x14ef50[_0x2d5c('0x3d')],_0x14ef50[_0x2d5c('0x145')],_0x14ef50[_0x2d5c('0x3a')],_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8['checkDialMethod'](_0x14ef50))[_0x2d5c('0xbb')](loggerCatchQueueSummary(_0x2d5c('0x147'),_0x14ef50));}else{notSendMessagesQueue(_0x14ef50);}}else{freeVariablesPredictive(_0x14ef50);}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x11f')]=function(){var _0x3190ad=this;var _0x51202c;for(var _0x285c5f in this['campaigns']){if(this[_0x2d5c('0x22')][_0x2d5c('0x9b')](_0x285c5f)){_0x51202c=this['campaigns'][_0x285c5f];if(isCampaignIvr(_0x51202c[_0x2d5c('0x48')])&&isActive(_0x51202c[_0x2d5c('0x74')])){_0x51202c[_0x2d5c('0xa0')]=!![];BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](checkIsActive(_0x51202c,_0x51202c[_0x2d5c('0x74')]))[_0x2d5c('0xb8')](checkInterval(_0x51202c))[_0x2d5c('0xb8')](_0x3190ad['checkIsTrunkReachable'](_0x51202c))[_0x2d5c('0xb8')](_0x3190ad[_0x2d5c('0x122')](_0x51202c['dialGlobalInterval'],_0x51202c[_0x2d5c('0x145')],_0x51202c[_0x2d5c('0x3a')],_0x51202c))[_0x2d5c('0xb8')](_0x3190ad['checkIfTimeIntervals'](_0x51202c[_0x2d5c('0x3d')],_0x51202c[_0x2d5c('0x145')],_0x51202c[_0x2d5c('0x3a')],_0x51202c))[_0x2d5c('0xb8')](_0x3190ad[_0x2d5c('0x140')](_0x51202c))['catch'](loggerCatchQueueSummary(_0x2d5c('0x148'),_0x51202c));}else{notSendMessagesCampaign(_0x51202c);}}}};function getCallerIdRandom(_0x336a91,_0x150c94){var _0x4e4a12,_0x517f33,_0x556ecd;if(_0x150c94<=0x0){_0x150c94=0x1;}_0x4e4a12=new RegExp(_0x2d5c('0x149')+_0x150c94+'}$');_0x517f33=Math[_0x2d5c('0x14a')](0xa,_0x150c94-0x1);_0x556ecd=Math[_0x2d5c('0x14a')](0xa,_0x150c94)-0x1;return util[_0x2d5c('0x79')]('%s',_['replace'](_0x336a91,_0x4e4a12,_['random'](_0x517f33,_0x556ecd)));}function extractCalleridName(_0x1099c7){var _0xce604=_0x1099c7[_0x2d5c('0x14b')](/"(.*?)"/);return _0xce604?_0xce604[0x1]:_0x1099c7;}function extractCalleridNumber(_0x547cc8){var _0x23ad51=_0x547cc8['match'](/<(.*?)>/);return _0x23ad51?_0x23ad51[0x1]:_0x547cc8;}Dialer[_0x2d5c('0x1c')][_0x2d5c('0x14c')]=function(_0x14faf9,_0x2d0f1e){var _0x161da1=this;var _0x190b63=uuid['v4']();this[_0x2d5c('0x25')][_0x190b63]=new Action(_0x14faf9,_0x2d0f1e,_0x190b63);return new BPromise(function(_0x524405,_0x36f4c5){if(_[_0x2d5c('0x38')](_0x14faf9)&&_0x2d5c('0x14d')!==typeof _0x14faf9){return _0x36f4c5(msgResponse(_0x2d5c('0x14e'),_0x2d5c('0x124'),_0x2d5c('0x14f')));}if(_['isUndefined'](_0x2d0f1e[_0x2d5c('0x150')]['phone'])||_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]===null){return _0x36f4c5(msgResponse(_0x2d5c('0x14e'),_0x2d5c('0x124'),_0x2d5c('0x152')));}var _0x4bedf9={'XMD-CALLERID':_0x161da1[_0x2d5c('0x25')][_0x190b63]['getCaller'](),'XMD-AGI':_0x14faf9[_0x2d5c('0xf2')]?util[_0x2d5c('0x79')](_0x2d5c('0x153'),ipAgi,_0x14faf9[_0x2d5c('0xf2')]):_0x2d5c('0x154'),'XMD-AGIAFTER':_0x14faf9[_0x2d5c('0xf8')]?util['format'](_0x2d5c('0x153'),ipAgi,_0x14faf9[_0x2d5c('0xf8')]):_0x2d5c('0x154'),'XMD-QUEUE':_0x14faf9[_0x2d5c('0x48')]===_0x2d5c('0x155')?util[_0x2d5c('0x79')](_0x2d5c('0x156'),_0x14faf9[_0x2d5c('0x3a')],_0x14faf9[_0x2d5c('0x157')]||'',_0x14faf9[_0x2d5c('0xf9')]?'c':'',_0x14faf9[_0x2d5c('0x102')]||0x3):_0x2d5c('0x154'),'XMD-CONTACTID':_0x2d0f1e['ContactId'],'XMD-CDRTYPE':_0x2d5c('0x5'),'CALLERID(all)':_0x161da1[_0x2d5c('0x25')][_0x190b63]['getCaller'](),'XMD-AMD':_0x14faf9[_0x2d5c('0xdf')]?_0x2d5c('0x158'):_0x2d5c('0x154'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x14faf9[_0x2d5c('0xdf')]){_0x4bedf9['XMD-AMDINITIALSILENCE']=_0x14faf9[_0x2d5c('0x159')]||0x9c4;_0x4bedf9[_0x2d5c('0x15a')]=_0x14faf9[_0x2d5c('0x15b')]||0x5dc;_0x4bedf9[_0x2d5c('0x15c')]=_0x14faf9[_0x2d5c('0x15d')]||0x320;_0x4bedf9[_0x2d5c('0x15e')]=_0x14faf9['dialAMDTotalAnalysisTime']||0x1388;_0x4bedf9[_0x2d5c('0x15f')]=_0x14faf9[_0x2d5c('0x160')]||0x64;_0x4bedf9[_0x2d5c('0x161')]=_0x14faf9['dialAMDBetweenWordsSilence']||0x32;_0x4bedf9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x14faf9[_0x2d5c('0x162')]||0x3;_0x4bedf9['XMD-AMDSILENCETHRESHOLD']=_0x14faf9[_0x2d5c('0x163')]||0x100;_0x4bedf9[_0x2d5c('0x164')]=_0x14faf9[_0x2d5c('0x165')]||0x1388;}if(_0x14faf9[_0x2d5c('0x48')]===_0x2d5c('0x155')){_0x4bedf9[_0x2d5c('0x166')]=_0x2d0f1e[_0x2d5c('0xd0')];}else{_0x4bedf9[_0x2d5c('0x167')]=_0x2d0f1e['CampaignId'];}for(var _0x5b3844 in _0x2d0f1e[_0x2d5c('0x150')]){if(_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x9b')](_0x5b3844)){if(isNotNull(_0x2d0f1e[_0x2d5c('0x150')][_0x5b3844])&&_0x5b3844!=='id'&&_0x5b3844!==_0x2d5c('0x168')&&_0x5b3844!==_0x2d5c('0x169')&&_0x5b3844!==_0x2d5c('0x16a')){_0x4bedf9[util[_0x2d5c('0x79')](_0x2d5c('0x16b'),_0x2d5c('0x16c'),_[_0x2d5c('0x16d')](_0x5b3844))]=_0x2d0f1e[_0x2d5c('0x150')][_0x5b3844];}}}var _0x5ac52a=_0x161da1['isTrunkReachable'](_0x14faf9[_0x2d5c('0x73')])?getCallerId(_0x14faf9[_0x2d5c('0x73')][_0x2d5c('0x75')],_0x14faf9[_0x2d5c('0x57')],_0x14faf9[_0x2d5c('0x16e')]>0x0?getCallerIdRandom(_0x14faf9[_0x2d5c('0x58')],_0x14faf9[_0x2d5c('0x16e')]):_0x14faf9[_0x2d5c('0x58')]):getCallerId(_['isNil'](_0x14faf9[_0x2d5c('0x120')])?_0x14faf9['Trunk'][_0x2d5c('0x75')]:_0x14faf9[_0x2d5c('0x120')]['callerid'],_0x14faf9[_0x2d5c('0x57')],_0x14faf9[_0x2d5c('0x16e')]>0x0?getCallerIdRandom(_0x14faf9[_0x2d5c('0x58')],_0x14faf9[_0x2d5c('0x16e')]):_0x14faf9[_0x2d5c('0x58')]);if(_0x5ac52a){_0x4bedf9[_0x2d5c('0x16f')]=_0x161da1[_0x2d5c('0x25')][_0x190b63][_0x2d5c('0x170')]=extractCalleridName(_0x5ac52a);_0x4bedf9[_0x2d5c('0x171')]=_0x161da1[_0x2d5c('0x25')][_0x190b63][_0x2d5c('0x172')]=extractCalleridNumber(_0x5ac52a);}return ami[_0x2d5c('0xae')]({'actionid':_0x190b63,'action':'originate','channel':_0x161da1[_0x2d5c('0xd6')](_0x14faf9[_0x2d5c('0x73')])?util['format'](_0x2d5c('0x173'),_0x14faf9['Trunk']['name'],isNotNull(_0x14faf9[_0x2d5c('0x5a')])?_0x14faf9[_0x2d5c('0x5a')]['trim']()||'':'',_0x14faf9[_0x2d5c('0x174')]>0x0?_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]['substring'](_0x14faf9[_0x2d5c('0x174')]):_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]):util[_0x2d5c('0x79')]('SIP/%s/%s%s',_[_0x2d5c('0xad')](_0x14faf9[_0x2d5c('0x120')])?_0x14faf9[_0x2d5c('0x73')][_0x2d5c('0x3a')]:_0x14faf9['TrunkBackup'][_0x2d5c('0x3a')],isNotNull(_0x14faf9['dialPrefix'])?_0x14faf9['dialPrefix']['trim']()||'':'',_0x14faf9['dialCutDigit']>0x0?_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]['substring'](_0x14faf9[_0x2d5c('0x174')]):_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]),'callerid':_0x5ac52a,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x4bedf9,'timeout':(_0x14faf9[_0x2d5c('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x190b63})[_0x2d5c('0xb8')](function(_0x46d4bd){return _0x524405(_0x46d4bd);})[_0x2d5c('0xbb')](function(_0x436af6){_0x14faf9[_0x2d5c('0x62')]+=0x1;var _0x20a96a=new History(_0x161da1['actions'][_0x190b63]);logger[_0x2d5c('0x97')](util[_0x2d5c('0x79')](_0x2d5c('0x175'),JSON[_0x2d5c('0x44')](_0x436af6)));_0x20a96a[_0x2d5c('0xa7')]=0xe;_0x20a96a[_0x2d5c('0xe1')]=_0x2d5c('0x176');_0x20a96a[_0x2d5c('0xa8')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));_0x20a96a[_0x2d5c('0x177')]=_0x20a96a[_0x2d5c('0xa8')];_0x161da1[_0x2d5c('0xc5')](_0x20a96a)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x178')));_0x161da1[_0x2d5c('0xc4')](_0x20a96a)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x178')))['finally'](function(){delete _0x161da1[_0x2d5c('0x25')][_0x190b63];return _0x36f4c5(msgResponse('originate',_0x2d5c('0x43'),'originate\x20action\x20Error'));});});});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x2f')]=function(_0x42ca9d){var _0x583047=this[_0x2d5c('0x25')][_0x42ca9d['actionid']];var _0x31f5aa=this;if(_0x583047){delete this['actions'][_0x42ca9d['actionid']];_0x583047[_0x2d5c('0x101')]=moment()['format'](_0x2d5c('0xfa'));var _0x3cedf4=_0x583047[_0x2d5c('0x48')]==='ivr'?this[_0x2d5c('0x22')][_0x583047[_0x2d5c('0xb3')]]:this[_0x2d5c('0x21')][_0x583047[_0x2d5c('0x179')]()];if(!this[_0x2d5c('0xd4')](_0x42ca9d[_0x2d5c('0x17a')])){this['updateOriginated'](_0x3cedf4);return this[_0x2d5c('0x17b')](_0x583047,_0x3cedf4,_0x42ca9d)[_0x2d5c('0xb8')](function(_0x3652db){})['catch'](loggerCatch(_0x2d5c('0x17c')));}else{this[_0x2d5c('0x26')][_0x42ca9d['uniqueid']]=_0x583047;}}};Dialer['prototype'][_0x2d5c('0x17d')]=function(_0x584fb8,_0x1f7338,_0x5bc5da){var _0x3aed41=new History(_0x1f7338);if(_0x3aed41['countbusyretry']+_0x3aed41[_0x2d5c('0x17e')]+_0x3aed41[_0x2d5c('0x17f')]>=_0x5bc5da[_0x2d5c('0x180')]-0x1){return!![];}switch(_0x584fb8){case 0x3:if(_0x3aed41[_0x2d5c('0x17f')]>=_0x5bc5da[_0x2d5c('0x181')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countnoanswerretry':_0x3aed41['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5bc5da[_0x2d5c('0x182')],_0x2d5c('0x183'))[_0x2d5c('0x79')](_0x2d5c('0xfa')),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x3aed41[_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x184')));}break;case 0x5:if(_0x3aed41[_0x2d5c('0x185')]>=_0x5bc5da[_0x2d5c('0x186')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countbusyretry':_0x3aed41[_0x2d5c('0x185')]+=0x1,'scheduledat':moment()[_0x2d5c('0x187')](_0x5bc5da[_0x2d5c('0x188')],'minutes')[_0x2d5c('0x79')](_0x2d5c('0xfa')),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41['VoiceQueueId']||undefined,'CampaignId':_0x3aed41['CampaignId']||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x189')));}break;case 0x8:if(_0x3aed41[_0x2d5c('0x17e')]>=_0x5bc5da[_0x2d5c('0x18a')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countcongestionretry':_0x3aed41[_0x2d5c('0x17e')]+=0x1,'scheduledat':moment()['add'](_0x5bc5da[_0x2d5c('0x18b')],_0x2d5c('0x183'))[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x3aed41[_0x2d5c('0xd1')]||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x18c')));}break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x40da8e,_0x51ddf0,_0x5e9c76){var _0x42fc0a=this;var _0x2e7333=new History(_0x40da8e);return new BPromise(function(_0x1f53a6,_0x1d01b3){if(_[_0x2d5c('0x38')](_0x51ddf0)&&'object'!==typeof _0x51ddf0){return _0x1d01b3(msgResponse(_0x2d5c('0x18d'),'Failure',_0x2d5c('0x18e')));}if(_[_0x2d5c('0x38')](_0x5e9c76)&&_0x2d5c('0x14d')!==typeof _0x5e9c76){return _0x1d01b3(msgResponse(_0x2d5c('0x18d'),_0x2d5c('0x124'),'evt\x20is\x20undefine'));}switch(_0x5e9c76[_0x2d5c('0x18f')]){case'0':_0x51ddf0[_0x2d5c('0x61')]+=0x1;_0x2e7333['state']=0x0;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x190');_0x42fc0a['createHistory'](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x191')));if(_0x42fc0a[_0x2d5c('0x17d')](0x0,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x185')]+_0x2e7333['countcongestionretry']+_0x2e7333[_0x2d5c('0x17f')]>=_0x51ddf0['dialGlobalMaxRetry']){_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x193'));}else{_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x51ddf0[_0x2d5c('0x60')]+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0x3;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x195');_0x2e7333[_0x2d5c('0x17f')]+=0x1;_0x2e7333['countglobal']+=0x1;_0x42fc0a[_0x2d5c('0xc5')](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x42fc0a[_0x2d5c('0x17d')](0x3,_0x40da8e,_0x51ddf0)){if(_0x2e7333['countnoanswerretry']>=_0x51ddf0[_0x2d5c('0x181')]){_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x196'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x196'));}}break;case'5':_0x51ddf0[_0x2d5c('0x5e')]+=0x1;_0x2e7333['state']=0x5;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x197');_0x2e7333[_0x2d5c('0x185')]+=0x1;_0x2e7333[_0x2d5c('0x198')]+=0x1;_0x42fc0a['createHistory'](_0x2e7333)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x42fc0a[_0x2d5c('0x17d')](0x5,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x185')]>=_0x51ddf0[_0x2d5c('0x186')]){_0x42fc0a['createStateFinal'](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x199'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x199'));}}break;case'8':_0x51ddf0[_0x2d5c('0x19a')]+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0x8;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x19b');_0x2e7333[_0x2d5c('0x17e')]+=0x1;_0x2e7333[_0x2d5c('0x198')]+=0x1;_0x42fc0a[_0x2d5c('0xc5')](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x19c')));if(_0x42fc0a['checkRetriveMax'](0x8,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x17e')]>=_0x51ddf0[_0x2d5c('0x18a')]){_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x19d'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x19d'));}}break;default:_0x51ddf0['outboundUnknownCallsDay']+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0xc;_0x2e7333[_0x2d5c('0xe1')]=_0x5e9c76[_0x2d5c('0x18f')];_0x42fc0a['createHistory'](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x19e')));if(_0x42fc0a[_0x2d5c('0x17d')](_0x5e9c76['reason'],_0x40da8e,_0x51ddf0)){if(_0x2e7333['countbusyretry']+_0x2e7333['countcongestionretry']+_0x2e7333[_0x2d5c('0x17f')]>=_0x51ddf0['dialGlobalMaxRetry']){_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x5e9c76[_0x2d5c('0x18f')]);}else{_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x5e9c76[_0x2d5c('0x18f')]);}}}});};Dialer['prototype'][_0x2d5c('0x192')]=function(_0x29e155,_0x8de35,_0x96b7e7,_0x40cec1){var _0x3b37ad=new Final(_0x29e155);_0x3b37ad[_0x2d5c('0xa7')]=0xf;_0x3b37ad[_0x2d5c('0xe1')]='Global';this[_0x2d5c('0x194')](_0x3b37ad,_0x8de35,_0x96b7e7,_0x40cec1);};Dialer[_0x2d5c('0x1c')]['createStateFinal']=function(_0x385234,_0xef0ccb,_0x2e2ef5,_0x573934){this[_0x2d5c('0xc4')](_0x385234)[_0x2d5c('0xb8')](function(_0x1bbd59){return _0xef0ccb(msgResponse('[callProgressDetecting]','Success',_0x573934));})[_0x2d5c('0xbb')](function(_0x5d3a17){return _0x2e2ef5(msgResponse('[moveContactManagedDialer][0]',_0x2d5c('0x124'),'contact\x20not\x20moved'));});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x7')]=function(_0xb1640f){var _0x43c8c6=this;var _0x168e26=_0xb1640f['dialPredictiveOptimizationPercentage']/0x64;var _0x9429e5=_0xb1640f['outboundDropCallsDayTimeout']/(_0xb1640f[_0x2d5c('0x103')]+_0xb1640f[_0x2d5c('0x5c')]);var _0x37c640=Math['round'](_0xb1640f['predictiveIntervalAvailable']*(_0xb1640f['predictiveIntervalMaxThreshold']/0x64));var _0x32de13=Math[_0x2d5c('0x19f')](_0xb1640f[_0x2d5c('0x6c')]*(_0xb1640f[_0x2d5c('0x1a0')]/0x64));var _0x153ef1=_0xb1640f[_0x2d5c('0x4b')]+_0xb1640f['talking'];var _0xc3cea4=Math['floor'](_0xb1640f[_0x2d5c('0x6f')]*_0xb1640f[_0x2d5c('0x71')]*_0xb1640f['predictiveIntervalHitRate']*_0xb1640f[_0x2d5c('0x1a1')]);if(_['isUndefined'](_0xb1640f[_0x2d5c('0x28')])){if(!_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x27')])){_0xb1640f[_0x2d5c('0x27')]=undefined;loggerPredictive[_0x2d5c('0x97')](_0x2d5c('0x1a2'),_0x2d5c('0x1a3'));}if(!_[_0x2d5c('0x38')](_0xb1640f['handlePredictive'])){loggerPredictive['error'](_0x2d5c('0x1a2'),_0x2d5c('0x1a4'));clearInterval(_0xb1640f[_0x2d5c('0x92')]);_0xb1640f[_0x2d5c('0x92')]=undefined;}_0xb1640f[_0x2d5c('0x28')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],_0x2d5c('0x1a5'),_0xb1640f[_0x2d5c('0x28')]);this[_0x2d5c('0x13b')](_0xb1640f,0x1);}else if(ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x28')])){this[_0x2d5c('0x13b')](_0xb1640f,0x1);loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1a6'),_0xb1640f[_0x2d5c('0x28')],_0xb1640f['name']);_0xb1640f[_0x2d5c('0x6f')]=0x0;_0xb1640f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x168e26<_0x9429e5&&_0xb1640f['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xb1640f);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x2d5c('0x1a7'),_0x9429e5,'startProgressive',_0xb1640f[_0x2d5c('0x3a')]);}else if(_0xc3cea4<_0xb1640f['predictiveIntervalErlangCallsDroppedCalls']&&_0xb1640f[_0x2d5c('0x1a8')]===_0x2d5c('0x1a9')){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1aa'),_0x2d5c('0x1ab'),_0xc3cea4,_0x2d5c('0x1ac'),_0xb1640f[_0x2d5c('0x69')],_0x2d5c('0x28'),_0xb1640f[_0x2d5c('0x3a')]);}else if(!ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x28')])&&_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x27')])&&!_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x28')])){_0xb1640f[_0x2d5c('0x27')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive['info'](_0xb1640f['name'],'started\x20in\x20predictive\x20at',_0xb1640f[_0x2d5c('0x27')]);this[_0x2d5c('0x1ad')](_0xb1640f[_0x2d5c('0x1ae')])[_0x2d5c('0xb8')](this[_0x2d5c('0x1af')](_0xb1640f))[_0x2d5c('0xb8')](mergeDataErlangB(_0xb1640f))[_0x2d5c('0xb8')](this[_0x2d5c('0x1b0')](_0xb1640f))[_0x2d5c('0xbb')](loggerCatchPredictive(_0x2d5c('0x1b1'),_0xb1640f));}else if(!ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x27')])){_0xb1640f[_0x2d5c('0x69')]=0x0;_0xb1640f['startPredictive']=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],'recalculate\x20predictive\x20at',_0xb1640f['startPredictive']);clearInterval(_0xb1640f[_0x2d5c('0x92')]);_0xb1640f[_0x2d5c('0x92')]=undefined;this[_0x2d5c('0x1ad')](_0xb1640f[_0x2d5c('0x1ae')])[_0x2d5c('0xb8')](this['getDataPredictive'](_0xb1640f))[_0x2d5c('0xb8')](mergeDataErlangB(_0xb1640f))['then'](this['startMethodPredictive'](_0xb1640f))[_0x2d5c('0xbb')](loggerCatchPredictive(_0x2d5c('0x1b2'),_0xb1640f));}else if(_0xb1640f[_0x2d5c('0x6c')]&&_0x153ef1<_0xb1640f[_0x2d5c('0x6c')]-_0x32de13){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x153ef1,')\x20are\x20less\x20than\x20threshold\x20(',_0xb1640f[_0x2d5c('0x6c')],'-',_0x32de13,'=',_0xb1640f[_0x2d5c('0x6c')]-_0x32de13,')');}else if(_0xb1640f[_0x2d5c('0x6c')]&&_0x153ef1>_0xb1640f[_0x2d5c('0x6c')]+_0x37c640){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],_0x2d5c('0x1b3'),_0x153ef1,')\x20are\x20more\x20than\x20threshold\x20(',_0xb1640f[_0x2d5c('0x6c')],'+',_0x37c640,'=',_0xb1640f[_0x2d5c('0x6c')]+_0x37c640,')');}};Dialer[_0x2d5c('0x1c')]['getDataPredictive']=function(_0x3e4eb5){var _0x3ab34c=this;return function(_0x95c40a){return new BPromise(function(_0x38aa68,_0x485fd3){_[_0x2d5c('0x8e')](_0x3e4eb5,_0x95c40a[0x0]);if(checkGetDataPredictive(_0x95c40a[0x0])){var _0x377466=_0x3e4eb5[_0x2d5c('0x6c')]=_0x3e4eb5[_0x2d5c('0xa1')]+_0x3e4eb5[_0x2d5c('0x4b')];var _0x1c4e0e=_0x3e4eb5[_0x2d5c('0x1ae')]*0x3c;var _0x5b574c=_0x95c40a[0x0][_0x2d5c('0x67')]+_0x95c40a[0x0][_0x2d5c('0x82')];var _0x52b799=(_0x95c40a[0x0][_0x2d5c('0x66')]+_0x95c40a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x95c40a[0x0][_0x2d5c('0x107')])/_0x95c40a[0x0][_0x2d5c('0x6d')];_0x3e4eb5['predictiveIntervalHitRate']=_0x52b799>0x0?_0x52b799:0x1;switch(_0x3e4eb5[_0x2d5c('0x1a8')]){case _0x2d5c('0x1a9'):var _0x2674d6=_0x3e4eb5[_0x2d5c('0x1b4')]/0x64;return _0x3ab34c['abandonmentRate'](_0x377466,_0x1c4e0e,_0x5b574c,_0x52b799,_0x2674d6)[_0x2d5c('0xb8')](function(_0x28066d){return _0x38aa68(_0x28066d);});case _0x2d5c('0x1b5'):var _0x46c707=_0x3e4eb5['dialPredictiveOptimizationPercentage']/0x64;return _0x3ab34c['busyFactor'](_0x377466,_0x1c4e0e,_0x5b574c,_0x52b799,_0x46c707)[_0x2d5c('0xb8')](function(_0xdcac89){return _0x38aa68(_0xdcac89);});default:return _0x485fd3(msgResponse(_0x2d5c('0x1b6'),_0x2d5c('0x124'),_0x2d5c('0x1b7')));}}else{return _0x485fd3(msgResponse('[getDataPredictive]',_0x2d5c('0x124'),_0x2d5c('0x1b8')));}});};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1b9')]=function(_0x4ccc09){var _0x37d847=this;return function(_0xedcac9){return new BPromise(function(_0x2d7ec8,_0x56307c){_[_0x2d5c('0x8e')](_0x4ccc09,_0xedcac9[0x0]);if(checkGetDataPredictive(_0xedcac9[0x0])){loggerPredictive['info'](JSON['stringify'](_0xedcac9[0x0]));if(_0x4ccc09['dialPredictiveOptimization']===_0x2d5c('0x1a9')){return _0x37d847[_0x2d5c('0x1ba')](_0x4ccc09['id'])[_0x2d5c('0xb8')](function(_0x1b14f6){var _0x33faf3=_0x4ccc09[_0x2d5c('0x142')]-_0x1b14f6[0x0]['outboundQueuePauses'];var _0x30662f=_0x4ccc09['dialPredictiveInterval']*0x3c;var _0x1683bf=_0xedcac9[0x0][_0x2d5c('0x67')]+_0xedcac9[0x0][_0x2d5c('0x82')];var _0x5ba8b3=(_0xedcac9[0x0][_0x2d5c('0x66')]+_0xedcac9[0x0][_0x2d5c('0x68')]+_0xedcac9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xedcac9[0x0][_0x2d5c('0x6d')];var _0x1ca383=_0x4ccc09[_0x2d5c('0x1b4')]/0x64;_0x4ccc09['predictiveIntervalPauses']=_0x1b14f6[0x0][_0x2d5c('0x1bb')]||0x0;_0x4ccc09[_0x2d5c('0x6a')]=_0x5ba8b3>0x0?_0x5ba8b3:0x1;return _0x37d847[_0x2d5c('0x1bc')](_0x33faf3,_0x30662f,_0x1683bf,_0x5ba8b3,_0x1ca383);})[_0x2d5c('0xb8')](function(_0x5ef0d4){return _0x2d7ec8(_0x5ef0d4);})[_0x2d5c('0xbb')](function(_0x3de556){return _0x56307c(msgResponse('[CatchErlangB]',_0x2d5c('0x124'),JSON[_0x2d5c('0x44')](_0x3de556)));});}if(_0x4ccc09[_0x2d5c('0x1a8')]===_0x2d5c('0x1b5')){return _0x37d847['getVoiceQueueRtPauses'](_0x4ccc09['id'])[_0x2d5c('0xb8')](function(_0x76d021){var _0x469af7=_0x4ccc09['loggedIn']-_0x76d021[0x0][_0x2d5c('0x1bb')];var _0x298f98=_0x4ccc09['dialPredictiveInterval']*0x3c;var _0x39bfb8=_0xedcac9[0x0][_0x2d5c('0x67')]+_0xedcac9[0x0][_0x2d5c('0x82')];var _0x2d604a=(_0xedcac9[0x0][_0x2d5c('0x66')]+_0xedcac9[0x0][_0x2d5c('0x68')]+_0xedcac9[0x0][_0x2d5c('0x107')])/_0xedcac9[0x0]['predictiveIntervalTotalCalls'];var _0x53a81c=_0x4ccc09[_0x2d5c('0x1b4')]/0x64;_0x4ccc09[_0x2d5c('0x6b')]=_0x76d021[0x0][_0x2d5c('0x1bb')]||0x0;_0x4ccc09[_0x2d5c('0x6a')]=_0x2d604a>0x0?_0x2d604a:0x1;return _0x37d847[_0x2d5c('0x1bd')](_0x469af7,_0x298f98,_0x39bfb8,_0x2d604a,_0x53a81c);})['then'](function(_0x9ab2e1){return _0x2d7ec8(_0x9ab2e1);})['catch'](function(_0x2f3504){return _0x56307c(msgResponse(_0x2d5c('0x1be'),_0x2d5c('0x124'),JSON[_0x2d5c('0x44')](_0x2f3504)));});}}else{return _0x56307c(msgResponse(_0x2d5c('0x1b6'),_0x2d5c('0x124'),'check\x20failure'));}});};};Dialer['prototype'][_0x2d5c('0x1b0')]=function(_0x3d9377){var _0x341a1c=this;return function(){var _0x53400c=0x0;var _0x4fcf3f=Math[_0x2d5c('0x1bf')](_0x3d9377[_0x2d5c('0x70')]*0x3e8);if(_0x4fcf3f>0x0){_0x4fcf3f=_0x4fcf3f<0x64?0x64:_0x4fcf3f;loggerPredictive[_0x2d5c('0x7c')](_0x3d9377[_0x2d5c('0x3a')],'one\x20call\x20every:',_0x4fcf3f,_0x2d5c('0x45'));_0x3d9377['handlePredictive']=setInterval(function(){_0x341a1c['handlePredictive'](_0x3d9377);loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1c0'),_0x53400c+=0x1);},_0x4fcf3f);}else{loggerPredictive[_0x2d5c('0x7c')](_0x3d9377['name'],_0x2d5c('0x1c1'));}};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1c2')]=function(_0x1bc3d,_0x446157){var _0x27447d=this;return function(_0x36adcf){if(_[_0x2d5c('0x7b')](_0x36adcf)){if(_[_0x2d5c('0xad')](_0x446157[_0x2d5c('0xcf')])||!_0x446157[_0x2d5c('0x1c3')]){if(_0x1bc3d[_0x2d5c('0x56')]==='booked'){_0x1bc3d[_0x2d5c('0x111')]=_[_0x2d5c('0x38')](_0x1bc3d['queueStatusComplete'])?!![]:_0x1bc3d['queueStatusComplete'];var _0x3067bb=uuid['v4']();_0x27447d['actions'][_0x3067bb]=new Action(_0x1bc3d,_0x446157,_0x3067bb);loggerBooked['info'](_0x2d5c('0x1c4'),_0x3067bb,_0x2d5c('0x1c5'),JSON[_0x2d5c('0x44')](_0x1bc3d['queueStatusComplete']),_0x2d5c('0x1c6'),_0x1bc3d[_0x2d5c('0x3a')]);if(_0x1bc3d[_0x2d5c('0x111')]){_0x1bc3d['queueStatusComplete']=![];_0x27447d[_0x2d5c('0x29')][_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xb3')]]=[];ami['Action']({'actionid':_0x3067bb,'action':'queuestatus','queue':_0x1bc3d[_0x2d5c('0x3a')]})[_0x2d5c('0xbb')](function(_0x179dcc){_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);_0x27447d[_0x2d5c('0x115')]({'active':![],'ContactId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xcd')],'ListId':_0x27447d[_0x2d5c('0x25')][_0x3067bb]['ListId'],'VoiceQueueId':_0x27447d['actions'][_0x3067bb][_0x2d5c('0xd0')]||undefined,'CampaignId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x1c7')));delete _0x27447d[_0x2d5c('0x25')][_0x3067bb];});}else{loggerBooked[_0x2d5c('0x7c')](_0x2d5c('0x1c8'),JSON['stringify'](_0x1bc3d[_0x2d5c('0x111')]),_0x2d5c('0x1c6'),_0x1bc3d['name']);_0x27447d['updateOriginated'](_0x1bc3d);_0x27447d[_0x2d5c('0x115')]({'active':![],'ContactId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xcd')],'ListId':_0x27447d[_0x2d5c('0x25')][_0x3067bb]['ListId'],'VoiceQueueId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd0')]||undefined,'CampaignId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x1c7')));delete _0x27447d[_0x2d5c('0x25')][_0x3067bb];}}else{return _0x27447d[_0x2d5c('0x14c')](_0x1bc3d,_0x446157);}}else{if(getDiff(_0x446157[_0x2d5c('0x1c9')])<_0x1bc3d[_0x2d5c('0x1ca')]*0x3c){_0x27447d['preview']['run'](_0x446157['id'])[_0x2d5c('0x1e')](function(){_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);});}else{_0x1bc3d[_0x2d5c('0x63')]+=0x1;_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);if(_0x1bc3d[_0x2d5c('0x1cb')]){_0x27447d['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x446157[_0x2d5c('0xcd')],'ListId':_0x446157['ListId'],'VoiceQueueId':_0x446157[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x446157[_0x2d5c('0xd1')]||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x1cc')));_0x27447d[_0x2d5c('0xc5')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1cd'),0x17,'RecallInQueue'))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x1ce')));}else{_0x27447d[_0x2d5c('0xcb')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1cf'),0x16,_0x2d5c('0x1d0')),_0x2d5c('0x1d1'),_0x2d5c('0x1d2'));}}}}else{_0x1bc3d[_0x2d5c('0x5d')]+=0x1;_0x27447d[_0x2d5c('0xcb')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1d3'),0xd,_0x2d5c('0x1d4')),_0x2d5c('0x1d5'),'[Originate][MoveBlacklist]');throw _0x2d5c('0x1d6');}};};Dialer[_0x2d5c('0x1c')]['handleIvr']=function(_0x110996){var _0x553374=this;var _0x45df04=[];var _0x517fd3=_0x110996[_0x2d5c('0x1d7')]-_0x110996['originated']-_0x110996[_0x2d5c('0x1d8')];emitCampaignSummary(_0x110996);if(_0x517fd3>0x0){if(_0x517fd3>this[_0x2d5c('0x1d9')]){_0x517fd3=this['maxNumberOriginate'];}_0x110996[_0x2d5c('0x1d8')]+=_0x517fd3;this[_0x2d5c('0xc2')](_0x110996['id'],_0x517fd3,_0x110996[_0x2d5c('0x1da')])['then'](function(_0x1321e8){_0x110996[_0x2d5c('0x1d8')]-=_0x517fd3;_0x110996['temp']=_0x110996['temp']>0x0?_0x110996[_0x2d5c('0x1d8')]:0x0;if(!checkContactEmpty(_0x1321e8)){_0x110996['message']=_0x2d5c('0x9e');logger[_0x2d5c('0x7c')]('[getContactCampaign2][Empty]'+_0x110996['name']);}else{_0x110996[_0x2d5c('0x6e')]+=_0x1321e8[_0x2d5c('0x9a')];_0x110996[_0x2d5c('0x41')]=_0x2d5c('0x1db');for(var _0x1a15e4=0x0;_0x1a15e4<_0x1321e8[_0x2d5c('0x9a')];_0x1a15e4+=0x1){_0x110996[_0x2d5c('0x1dc')]+=0x1;if(_[_0x2d5c('0xad')](_0x1321e8[_0x1a15e4])||_['isNil'](_0x1321e8[_0x1a15e4][_0x2d5c('0x150')])||_[_0x2d5c('0xad')](_0x1321e8[_0x1a15e4][_0x2d5c('0x150')][_0x2d5c('0x151')])){_0x553374[_0x2d5c('0xca')](_0x2d5c('0x1dd'),_0x110996,_0x1321e8[_0x1a15e4]);}else{_0x553374[_0x2d5c('0xbd')](_['pick'](_0x1321e8[_0x1a15e4],[_0x2d5c('0xd1'),_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x553374[_0x2d5c('0x1c2')](_0x110996,_0x1321e8[_0x1a15e4]))['catch'](_0x553374[_0x2d5c('0xc9')]('[actionOriginateIvr]\x20',_0x110996));}}}})[_0x2d5c('0xbb')](loggerGetContactDialer(_0x2d5c('0x1df'),_0x110996,_0x517fd3));}};Dialer[_0x2d5c('0x1c')]['handlePower']=function(_0x471671,_0x41d2e9){var _0x41e732=this;var _0x39c091=[];var _0x163072=_0x41d2e9>=0x1?_0x41d2e9:0x1;var _0x1d78ce=[];if(_0x471671[_0x2d5c('0x56')]==='booked'){_0x163072=0x1;}var _0x3d28f2=Math['floor'](_0x471671[_0x2d5c('0x4b')]*_0x163072)-_0x471671[_0x2d5c('0x6e')]-_0x471671[_0x2d5c('0x1d8')];emitVoiceQueueSummary(_0x471671);if(_0x471671[_0x2d5c('0x1e0')]>0x0){var _0x290f22=_0x471671[_0x2d5c('0x1e0')]-_0x471671[_0x2d5c('0x6e')]-_0x471671['talking']-_0x471671[_0x2d5c('0x1d8')]-_0x471671[_0x2d5c('0x4c')];if(_0x3d28f2>_0x290f22){_0x3d28f2=_0x290f22;}}if(_0x3d28f2>0x0){if(_0x471671[_0x2d5c('0x56')]===_0x2d5c('0x6')){_0x3d28f2=0x1;}if(_0x3d28f2>this[_0x2d5c('0x1d9')]){_0x3d28f2=this[_0x2d5c('0x1d9')];}_0x471671[_0x2d5c('0x1d8')]+=_0x3d28f2;for(var _0x540fed in this['agents']){if(this[_0x2d5c('0x23')][_0x2d5c('0x9b')](_0x540fed)){if(this[_0x2d5c('0x23')][_0x540fed][_0x2d5c('0xa7')]===_0x2d5c('0x1e1')&&this[_0x2d5c('0x23')][_0x540fed][_0x2d5c('0xaf')]===_0x2d5c('0xd8')){_0x39c091[_0x2d5c('0x12b')](this[_0x2d5c('0x23')][_0x540fed]['id']);}}}this[_0x2d5c('0xc1')](_0x471671['id'],_0x39c091,_0x3d28f2,_0x471671[_0x2d5c('0x1da')])[_0x2d5c('0xb8')](function(_0x66cdd5){_0x471671[_0x2d5c('0x1d8')]-=_0x3d28f2;_0x471671[_0x2d5c('0x1d8')]=_0x471671[_0x2d5c('0x1d8')]>0x0?_0x471671[_0x2d5c('0x1d8')]:0x0;if(!checkContactEmpty(_0x66cdd5)){_0x41e732['countReScheduled'](_0x471671)['then'](sendMessageReschedule(_0x471671))['catch'](loggerCatch(_0x2d5c('0xb9')));}else{_0x471671['originated']+=_0x66cdd5[_0x2d5c('0x9a')];_0x471671[_0x2d5c('0x41')]=_0x471671[_0x2d5c('0x56')]==='booked'?_0x2d5c('0x158'):_0x2d5c('0x1db');for(var _0x3d1313=0x0;_0x3d1313<_0x66cdd5['length'];_0x3d1313+=0x1){if(_['isNil'](_0x66cdd5[_0x3d1313])||_[_0x2d5c('0xad')](_0x66cdd5[_0x3d1313][_0x2d5c('0x150')])||_['isNil'](_0x66cdd5[_0x3d1313]['Contact'][_0x2d5c('0x151')])){_0x41e732[_0x2d5c('0xca')](_0x2d5c('0x1dd'),_0x471671,_0x66cdd5[_0x3d1313]);}else{_0x41e732[_0x2d5c('0xba')](_[_0x2d5c('0xcc')](_0x66cdd5[_0x3d1313],['VoiceQueueId',_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x41e732['checkContactBlack'](_0x471671,_0x66cdd5[_0x3d1313]))[_0x2d5c('0xbb')](_0x41e732[_0x2d5c('0xc9')](_0x2d5c('0x1dd'),_0x471671));}}}})[_0x2d5c('0xbb')](loggerGetContactDialer(_0x2d5c('0x1e2'),_0x471671,_0x3d28f2));}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x92')]=function(_0x41c0f5){var _0x43589a=this;if(_0x41c0f5[_0x2d5c('0x1e0')]>0x0){var _0x136faa=_0x41c0f5[_0x2d5c('0x1e0')]-_0x41c0f5[_0x2d5c('0x6e')]-_0x41c0f5[_0x2d5c('0xa1')];if(_0x136faa>0x0){this['tryOriginatePredictive'](_0x41c0f5);}else{loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1e3'));}}else{this[_0x2d5c('0x1e4')](_0x41c0f5);}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1e4')]=function(_0x587c6a){var _0x1943f5=this;var _0x3e32ef=[];_0x587c6a[_0x2d5c('0x6e')]+=0x1;for(var _0x3b6a89 in this[_0x2d5c('0x23')]){if(this['agents'][_0x2d5c('0x9b')](_0x3b6a89)){if(this['agents'][_0x3b6a89]['state']==='not_inuse'&&this[_0x2d5c('0x23')][_0x3b6a89][_0x2d5c('0xaf')]===_0x2d5c('0xd8')){_0x3e32ef[_0x2d5c('0x12b')](this[_0x2d5c('0x23')][_0x3b6a89]['id']);}}}this[_0x2d5c('0xc1')](_0x587c6a['id'],_0x3e32ef,0x1,_0x587c6a[_0x2d5c('0x1da')])[_0x2d5c('0xb8')](function(_0x294dd9){if(!checkContactEmpty(_0x294dd9)){checkContactLowerLimitOriginate(_0x587c6a,0x1,0x0);_0x1943f5[_0x2d5c('0xb6')](_0x587c6a)[_0x2d5c('0xb8')](sendMessageReschedule(_0x587c6a))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xb9')));}else{_0x587c6a[_0x2d5c('0x41')]='RUNNING';if(_[_0x2d5c('0xad')](_0x294dd9[0x0])||_[_0x2d5c('0xad')](_0x294dd9[0x0][_0x2d5c('0x150')])||_['isNil'](_0x294dd9[0x0][_0x2d5c('0x150')][_0x2d5c('0x151')])){_0x1943f5[_0x2d5c('0xca')]('[actionOriginate]\x20',_0x587c6a,_0x294dd9[0x0]);}else{_0x1943f5[_0x2d5c('0xba')](_['pick'](_0x294dd9[0x0],[_0x2d5c('0xd0'),_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x1943f5[_0x2d5c('0x1c2')](_0x587c6a,_0x294dd9[0x0]))[_0x2d5c('0xbb')](_0x1943f5['loggerHandler'](_0x2d5c('0x1e5'),_0x587c6a));}}})[_0x2d5c('0xbb')](loggerGetContactDialer('[getContactDialerPredictive]',_0x587c6a,0x1));emitVoiceQueueSummary(_0x587c6a);};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1bc')]=function(_0x37f8ea,_0x325c52,_0x2f34db,_0x5c89fe,_0x3210de,_0x39bc9b){loggerPredictive['info'](_0x2d5c('0x1e6'));loggerPredictive[_0x2d5c('0x7c')]('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',_0x37f8ea);loggerPredictive[_0x2d5c('0x7c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x325c52);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1e7'),_0x2f34db);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1e8'),_0x5c89fe);loggerPredictive[_0x2d5c('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3210de);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));return new BPromise(function(_0x215409,_0x5b00c4){if(_0x37f8ea<=0x0||isNaN(_0x37f8ea)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),'Error',_0x2d5c('0x1ea')+_0x37f8ea));}if(_0x2f34db<=0x0||isNaN(_0x2f34db)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),'Ts\x20=\x20'+_0x2f34db));}if(_0x5c89fe<=0x0||isNaN(_0x5c89fe)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),'Error',_0x2d5c('0x1eb')+_0x5c89fe));}if(_0x325c52<=0x0||isNaN(_0x325c52)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),'interval\x20=\x20'+_0x325c52));}if(_0x3210de<=0x0||isNaN(_0x3210de)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),_0x2d5c('0x1ec')+_0x3210de));}_0x39bc9b=_0x39bc9b||0x0;var _0x143b07=0x1/_0x2f34db;var _0x4c3a8b=0x0;var _0x1d2087=0x0;var _0x58bc1c=0x0;var _0x439177=0x0;for(var _0x225dc4=0x0;_0x58bc1c<_0x3210de;_0x225dc4+=0x1){_0x1d2087=_0x225dc4/_0x325c52;_0x4c3a8b=(_0x5c89fe*_0x1d2087+_0x39bc9b)/_0x143b07;_0x58bc1c=erlangb(_0x4c3a8b,_0x37f8ea);_0x439177=_0x4c3a8b/_0x37f8ea*(0x1-erlangb(_0x4c3a8b,_0x37f8ea));}return _0x215409({'erlangCalls':_0x225dc4,'erlangCallToSecond':_0x325c52/_0x225dc4,'erlangAbandonmentRate':_0x58bc1c,'erlangBusyFactor':_0x439177});});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1bd')]=function(_0x5c0819,_0x2b6ac0,_0xc78a8,_0x4b4eeb,_0x496c64,_0x23d808){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ed'));loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ee'),_0x5c0819);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ef'),_0x2b6ac0);loggerPredictive[_0x2d5c('0x7c')]('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',_0xc78a8);loggerPredictive[_0x2d5c('0x7c')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b4eeb);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1f0'),_0x496c64);loggerPredictive[_0x2d5c('0x7c')]('---------------------------');return new BPromise(function(_0x1b9666,_0x58331b){if(_0x5c0819<=0x0||isNaN(_0x5c0819)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),'Error',_0x2d5c('0x1ea')+_0x5c0819));}if(_0xc78a8<=0x0||isNaN(_0xc78a8)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f2')+_0xc78a8));}if(_0x4b4eeb<=0x0||isNaN(_0x4b4eeb)){return _0x58331b(msgResponse('[busyFactor]',_0x2d5c('0x43'),'p\x20=\x20'+_0x4b4eeb));}if(_0x2b6ac0<=0x0||isNaN(_0x2b6ac0)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f3')+_0x2b6ac0));}if(_0x496c64<=0x0||isNaN(_0x496c64)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f4')+_0x496c64));}_0x23d808=_0x23d808||0x0;var _0x133410=0x1/_0xc78a8;var _0x4fbbad=0x0;var _0x9c2f37=0x0;var _0x1a2262=0x0;var _0x1ed194=0x0;for(var _0x5212d8=0x0;_0x1ed194<_0x496c64;_0x5212d8+=0x1){_0x9c2f37=_0x5212d8/_0x2b6ac0;_0x4fbbad=(_0x4b4eeb*_0x9c2f37+_0x23d808)/_0x133410;_0x1a2262=erlangb(_0x4fbbad,_0x5c0819);_0x1ed194=_0x4fbbad/_0x5c0819*(0x1-erlangb(_0x4fbbad,_0x5c0819));}return _0x1b9666({'erlangCalls':_0x5212d8,'erlangCallToSecond':_0x2b6ac0/_0x5212d8,'erlangAbandonmentRate':_0x1a2262,'erlangBusyFactor':_0x1ed194});});};module[_0x2d5c('0x1f5')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bb7d4a6..e3439e0 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 _0x08ec=['name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname'];(function(_0x24d451,_0x4b5a2d){var _0x5015bd=function(_0x491952){while(--_0x491952){_0x24d451['push'](_0x24d451['shift']());}};_0x5015bd(++_0x4b5a2d);}(_0x08ec,0x1c6));var _0xc08e=function(_0x113118,_0x55cd44){_0x113118=_0x113118-0x0;var _0x20bd49=_0x08ec[_0x113118];return _0x20bd49;};'use strict';var util=require(_0xc08e('0x0'));var _=require(_0xc08e('0x1'));var moment=require(_0xc08e('0x2'));function getSeconds(_0xe7ae16,_0x368090){var _0x24b893=moment(_0xe7ae16)[_0xc08e('0x3')](0x0);var _0x1c3852=moment(_0x368090)[_0xc08e('0x3')](0x0);return _0x24b893['diff'](_0x1c3852,_0xc08e('0x4'));}function QueueCallerAbandon(_0xcb7b3b,_0x25389e){this['scheduledat']=_0xcb7b3b['scheduledat'];this[_0xc08e('0x5')]=_0xcb7b3b[_0xc08e('0x5')];this[_0xc08e('0x6')]=_0xcb7b3b[_0xc08e('0x5')]===_0xc08e('0x7')?'queue':_0xcb7b3b[_0xc08e('0x5')];this[_0xc08e('0x8')]=_0xcb7b3b[_0xc08e('0x8')];this[_0xc08e('0x9')]=_0xcb7b3b['countcongestionretry'];this[_0xc08e('0xa')]=_0xcb7b3b[_0xc08e('0xa')];this[_0xc08e('0xb')]=_0xcb7b3b[_0xc08e('0x8')]+_0xcb7b3b['countcongestionretry']+_0xcb7b3b[_0xc08e('0xa')];this[_0xc08e('0xc')]=_0x25389e['uniqueid'];this[_0xc08e('0xd')]=_0xcb7b3b[_0xc08e('0xe')];this[_0xc08e('0xf')]=_0xcb7b3b['number'];this[_0xc08e('0x10')]=_0xcb7b3b[_0xc08e('0x10')];this[_0xc08e('0x11')]=_0xcb7b3b[_0xc08e('0x11')];this['droptime']=_0xcb7b3b[_0xc08e('0x12')];this[_0xc08e('0x13')]=this['droptime'];this[_0xc08e('0x14')]=getSeconds(_0xcb7b3b['responsetime'],_0xcb7b3b['starttime']);this['holdtime']=getSeconds(this[_0xc08e('0x12')],_0xcb7b3b['responsetime']);this['talktime']=0x0;this[_0xc08e('0x15')]=_0x25389e['queue'];this['membername']=_0x25389e[_0xc08e('0x16')];this[_0xc08e('0x17')]=_0x25389e[_0xc08e('0x17')];this['callback']=_0xcb7b3b[_0xc08e('0x18')];this[_0xc08e('0x19')]=_0xcb7b3b[_0xc08e('0x19')];this[_0xc08e('0x1a')]=_0xcb7b3b[_0xc08e('0x1a')];this[_0xc08e('0x1b')]=_0xcb7b3b[_0xc08e('0x1b')];this[_0xc08e('0x1c')]=_0xcb7b3b[_0xc08e('0x1c')];this[_0xc08e('0x1d')]=_0xcb7b3b[_0xc08e('0x1d')];this[_0xc08e('0x1e')]=_0xcb7b3b[_0xc08e('0x1e')];this['VoiceQueueId']=_0xcb7b3b[_0xc08e('0x1f')];this[_0xc08e('0x20')]=_0xcb7b3b['CampaignId'];this[_0xc08e('0x21')]=_0xcb7b3b[_0xc08e('0x21')]||'';this['originatecalleridname']=_0xcb7b3b[_0xc08e('0x22')]||'';}module[_0xc08e('0x23')]=QueueCallerAbandon; \ No newline at end of file +var _0xdfa8=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','queue','connectedlinename','reason','callback'];(function(_0x2317af,_0x1332d3){var _0x3cb58d=function(_0x4e75a0){while(--_0x4e75a0){_0x2317af['push'](_0x2317af['shift']());}};_0x3cb58d(++_0x1332d3);}(_0xdfa8,0xef));var _0x8dfa=function(_0x3d67f7,_0xbad74f){_0x3d67f7=_0x3d67f7-0x0;var _0x460382=_0xdfa8[_0x3d67f7];return _0x460382;};'use strict';var util=require(_0x8dfa('0x0'));var _=require(_0x8dfa('0x1'));var moment=require(_0x8dfa('0x2'));function getSeconds(_0x5b89b5,_0x1003ac){var _0x5d6b62=moment(_0x5b89b5)[_0x8dfa('0x3')](0x0);var _0x1b579c=moment(_0x1003ac)['milliseconds'](0x0);return _0x5d6b62[_0x8dfa('0x4')](_0x1b579c,_0x8dfa('0x5'));}function QueueCallerAbandon(_0x341377,_0x54bec1){this['scheduledat']=_0x341377[_0x8dfa('0x6')];this['type']=_0x341377[_0x8dfa('0x7')];this[_0x8dfa('0x8')]=_0x341377[_0x8dfa('0x7')]===_0x8dfa('0x9')?'queue':_0x341377['type'];this['countbusyretry']=_0x341377['countbusyretry'];this['countcongestionretry']=_0x341377[_0x8dfa('0xa')];this[_0x8dfa('0xb')]=_0x341377[_0x8dfa('0xb')];this[_0x8dfa('0xc')]=_0x341377[_0x8dfa('0xd')]+_0x341377[_0x8dfa('0xa')]+_0x341377['countnoanswerretry'];this['uniqueid']=_0x54bec1[_0x8dfa('0xe')];this[_0x8dfa('0xf')]=_0x341377['name'];this[_0x8dfa('0x10')]=_0x341377[_0x8dfa('0x11')];this[_0x8dfa('0x12')]=_0x341377[_0x8dfa('0x12')];this[_0x8dfa('0x13')]=_0x341377[_0x8dfa('0x13')];this[_0x8dfa('0x14')]=_0x341377[_0x8dfa('0x14')];this[_0x8dfa('0x15')]=this['droptime'];this['ringtime']=getSeconds(_0x341377[_0x8dfa('0x13')],_0x341377[_0x8dfa('0x12')]);this['holdtime']=getSeconds(this[_0x8dfa('0x14')],_0x341377[_0x8dfa('0x13')]);this[_0x8dfa('0x16')]=0x0;this[_0x8dfa('0x17')]=_0x54bec1[_0x8dfa('0x17')];this['membername']=_0x54bec1[_0x8dfa('0x18')];this[_0x8dfa('0x19')]=_0x54bec1[_0x8dfa('0x19')];this['callback']=_0x341377[_0x8dfa('0x1a')];this[_0x8dfa('0x1b')]=_0x341377['callbackuniqueid'];this[_0x8dfa('0x1c')]=_0x341377['callbackat'];this['recallme']=_0x341377[_0x8dfa('0x1d')];this[_0x8dfa('0x1e')]=_0x341377[_0x8dfa('0x1e')];this[_0x8dfa('0x1f')]=_0x341377[_0x8dfa('0x1f')];this[_0x8dfa('0x20')]=_0x341377[_0x8dfa('0x20')];this[_0x8dfa('0x21')]=_0x341377[_0x8dfa('0x21')];this['CampaignId']=_0x341377[_0x8dfa('0x22')];this['originatecalleridnum']=_0x341377[_0x8dfa('0x23')]||'';this[_0x8dfa('0x24')]=_0x341377[_0x8dfa('0x24')]||'';}module[_0x8dfa('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bd6a0a2..899b14b 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 _0x5cc7=['util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x5cc7,0x1a4));var _0x75cc=function(_0x2e304a,_0x3e9e50){_0x2e304a=_0x2e304a-0x0;var _0x275b92=_0x5cc7[_0x2e304a];return _0x275b92;};'use strict';var util=require(_0x75cc('0x0'));var _=require(_0x75cc('0x1'));var moment=require(_0x75cc('0x2'));function Action(_0x3fd82b,_0x58a413,_0x18226a){this['uniqueid']=_0x3fd82b||undefined;this[_0x75cc('0x3')]=util[_0x75cc('0x4')](_0x75cc('0x5'),_0x58a413[_0x75cc('0x6')],_0x58a413[_0x75cc('0x7')][_0x75cc('0x8')],_0x18226a[_0x75cc('0x9')]);this[_0x75cc('0xa')]=_0x58a413[_0x75cc('0xa')];this['headerinfo']=_0x58a413[_0x75cc('0xb')];this[_0x75cc('0xc')]=_0x18226a[_0x75cc('0xc')];this[_0x75cc('0xd')]=_0x18226a[_0x75cc('0xd')];}module['exports']=Action; \ No newline at end of file +var _0x1976=['path','AttachmentId','lodash','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo'];(function(_0x1d90f5,_0xd7cd8d){var _0x57f943=function(_0x293768){while(--_0x293768){_0x1d90f5['push'](_0x1d90f5['shift']());}};_0x57f943(++_0xd7cd8d);}(_0x1976,0xdf));var _0x6197=function(_0x45c557,_0x8c45a6){_0x45c557=_0x45c557-0x0;var _0x273649=_0x1976[_0x45c557];return _0x273649;};'use strict';var util=require('util');var _=require(_0x6197('0x0'));var moment=require(_0x6197('0x1'));function Action(_0x4a3335,_0x220193,_0x4ca9a2){this[_0x6197('0x2')]=_0x4a3335||undefined;this['channel']=util[_0x6197('0x3')](_0x6197('0x4'),_0x220193[_0x6197('0x5')],_0x220193[_0x6197('0x6')][_0x6197('0x7')],_0x4ca9a2[_0x6197('0x8')]);this[_0x6197('0x9')]=_0x220193[_0x6197('0x9')];this['headerinfo']=_0x220193[_0x6197('0xa')];this[_0x6197('0xb')]=_0x4ca9a2[_0x6197('0xb')];this['AttachmentId']=_0x4ca9a2[_0x6197('0xc')];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 3a2edf6..779bd21 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 _0x4aec=['fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','varset','bind','newstate','syncNewState','newexten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','syncNewchannel','context','exten','localstationid','uniqueid','channel','name','actions','prototype','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','info','\x20result\x20conversion\x20file\x20','create','parse','.pdf','then','notify','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','Is\x20Valid','exports','lodash','uuid','path','../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4aec,0xe8));var _0xc4ae=function(_0x2b0d79,_0x5b9dec){_0x2b0d79=_0x2b0d79-0x0;var _0x91a806=_0x4aec[_0x2b0d79];return _0x91a806;};'use strict';var util=require('util');var _=require(_0xc4ae('0x0'));var BPromise=require('bluebird');var uuid=require(_0xc4ae('0x1'));var moment=require('moment');var path=require(_0xc4ae('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xc4ae('0x3'))(_0xc4ae('0x4'));var ami=require(_0xc4ae('0x5'));var rpcDb=require(_0xc4ae('0x6'));var Channel=require(_0xc4ae('0x7'));var ut=require(_0xc4ae('0x8'));var Action=require(_0xc4ae('0x9'));var faxAccount=require(_0xc4ae('0xa'));var attachment=require(_0xc4ae('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x56c916){this[_0xc4ae('0xc')]={};this[_0xc4ae('0xd')]=_0x56c916['faxAccounts'];this[_0xc4ae('0xe')]=_0x56c916[_0xc4ae('0xe')];this['actions']={};ami['on'](_0xc4ae('0xf'),this['syncNewchannel']['bind'](this));ami['on'](_0xc4ae('0x10'),this['syncVarSet'][_0xc4ae('0x11')](this));ami['on'](_0xc4ae('0x12'),this[_0xc4ae('0x13')][_0xc4ae('0x11')](this));ami['on'](_0xc4ae('0x14'),this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0xc4ae('0x15')][_0xc4ae('0x11')](this));ami['on'](_0xc4ae('0x16'),this['syncReceiveFax'][_0xc4ae('0x11')](this));ami['on'](_0xc4ae('0x17'),this[_0xc4ae('0x18')][_0xc4ae('0x11')](this));ami['on'](_0xc4ae('0x19'),this[_0xc4ae('0x1a')][_0xc4ae('0x11')](this));}Fax['prototype'][_0xc4ae('0x1b')]=function(_0x4f9da4){if(_0x4f9da4[_0xc4ae('0x1c')]==='from-voip-provider'){for(var _0x4192c6 in this[_0xc4ae('0xd')]){if(this[_0xc4ae('0xd')]['hasOwnProperty'](_0x4192c6)){if(_0x4f9da4[_0xc4ae('0x1d')]===this[_0xc4ae('0xd')][_0x4192c6][_0xc4ae('0x1e')]){this[_0xc4ae('0xc')][_0x4f9da4[_0xc4ae('0x1f')]]={};this['channels'][_0x4f9da4['uniqueid']]['channel']=_0x4f9da4[_0xc4ae('0x20')];this['channels'][_0x4f9da4[_0xc4ae('0x1f')]]['id']=this[_0xc4ae('0xd')][_0x4192c6]['id'];this[_0xc4ae('0xc')][_0x4f9da4[_0xc4ae('0x1f')]]['name']=this[_0xc4ae('0xd')][_0x4192c6][_0xc4ae('0x21')];logger['info'](_0x4f9da4['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xc4ae('0x22')][_0x4f9da4[_0xc4ae('0x1f')]]){this[_0xc4ae('0xc')][_0x4f9da4[_0xc4ae('0x1f')]]={};this[_0xc4ae('0xc')][_0x4f9da4['uniqueid']][_0xc4ae('0x20')]=_0x4f9da4[_0xc4ae('0x20')];logger['info'](_0x4f9da4[_0xc4ae('0x1f')],'\x20syncNewchannel\x20');}};Fax[_0xc4ae('0x23')][_0xc4ae('0x24')]=function(_0x17c85e){if(this[_0xc4ae('0xc')][_0x17c85e[_0xc4ae('0x1f')]]){for(var _0x57becd in _0x17c85e[_0xc4ae('0x25')]){if(_0x17c85e[_0xc4ae('0x25')][_0xc4ae('0x26')](_0x57becd)){this[_0xc4ae('0xc')][_0x17c85e['uniqueid']][_0x57becd]=_0x17c85e[_0xc4ae('0x27')];}}}};Fax[_0xc4ae('0x23')][_0xc4ae('0x13')]=function(_0x38d809){if(this[_0xc4ae('0xc')][_0x38d809[_0xc4ae('0x1f')]]){this[_0xc4ae('0xc')][_0x38d809['uniqueid']][_0xc4ae('0x28')]=_0x38d809['channelstate'];this[_0xc4ae('0xc')][_0x38d809['uniqueid']][_0xc4ae('0x29')]=_0x38d809[_0xc4ae('0x29')];}};Fax[_0xc4ae('0x23')][_0xc4ae('0x2a')]=function(_0x27c654){if(this[_0xc4ae('0xc')][_0x27c654[_0xc4ae('0x1f')]]){for(var _0x47d527 in _0x27c654['variable']){if(_0x27c654[_0xc4ae('0x25')]['hasOwnProperty'](_0x47d527)){this[_0xc4ae('0xc')][_0x27c654['uniqueid']][_0x47d527]=_0x27c654[_0xc4ae('0x27')];}}}};Fax['prototype'][_0xc4ae('0x15')]=function(_0x564f49){if(this[_0xc4ae('0xc')][_0x564f49[_0xc4ae('0x1f')]]){this['channels'][_0x564f49['uniqueid']]['operation']=_0x564f49[_0xc4ae('0x2b')];this[_0xc4ae('0xc')][_0x564f49['uniqueid']][_0xc4ae('0x2c')]=_0x564f49[_0xc4ae('0x2c')];this['channels'][_0x564f49[_0xc4ae('0x1f')]][_0xc4ae('0x1e')]=_0x564f49[_0xc4ae('0x1e')];this[_0xc4ae('0xc')][_0x564f49[_0xc4ae('0x1f')]][_0xc4ae('0x2d')]=_0x564f49[_0xc4ae('0x2d')];logger['info'](_0x564f49[_0xc4ae('0x1f')],_0xc4ae('0x2e'));}};Fax[_0xc4ae('0x23')][_0xc4ae('0x2f')]=function(_0x24f97c){var _0x1f96ed=this;if(this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]]){var _0x1cf441=this[_0xc4ae('0xc')][_0x24f97c['uniqueid']]['id'];this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]][_0xc4ae('0x30')]=_0x24f97c[_0xc4ae('0x30')];this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]][_0xc4ae('0x31')]=_0x24f97c['pagestransferred'];this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]][_0xc4ae('0x1e')]=_0x24f97c[_0xc4ae('0x1e')];this['channels'][_0x24f97c['uniqueid']][_0xc4ae('0x32')]=_0x24f97c['resolution'];this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]][_0xc4ae('0x33')]=_0x24f97c[_0xc4ae('0x33')];this[_0xc4ae('0xc')][_0x24f97c[_0xc4ae('0x1f')]][_0xc4ae('0x2d')]=_0x24f97c[_0xc4ae('0x2d')];this['channels'][_0x24f97c[_0xc4ae('0x1f')]]['calleridnum']=_0x24f97c[_0xc4ae('0x34')];if(this['channels'][_0x24f97c[_0xc4ae('0x1f')]]['pagestransferred']>0x0){tiff2pdf(_0x24f97c[_0xc4ae('0x2d')],_0xc4ae('0x35'),function(_0x591e0b){logger[_0xc4ae('0x36')](_0x24f97c[_0xc4ae('0x1f')],_0xc4ae('0x37'),_0x591e0b['message']);attachment[_0xc4ae('0x38')]({'name':path[_0xc4ae('0x39')](_0x24f97c[_0xc4ae('0x2d')])[_0xc4ae('0x21')],'basename':path[_0xc4ae('0x39')](_0x24f97c[_0xc4ae('0x2d')])['name']+_0xc4ae('0x3a'),'type':'application/pdf'})[_0xc4ae('0x3b')](function(_0x1642c8){faxAccount[_0xc4ae('0x3c')](_0x1cf441,{'from':_0x24f97c[_0xc4ae('0x34')],'mapKey':'fax','body':path[_0xc4ae('0x39')](_0x24f97c['filename'])['name']+_0xc4ae('0x3a'),'AttachmentId':_0x1642c8['id']})['catch'](function(_0x2518be){logger[_0xc4ae('0x3d')](_0x24f97c['uniqueid'],_0xc4ae('0x3e'),JSON[_0xc4ae('0x3f')](_0x2518be));});})['catch'](function(_0x31d3df){logger[_0xc4ae('0x3d')](_0x24f97c[_0xc4ae('0x1f')],_0xc4ae('0x40'),JSON[_0xc4ae('0x3f')](_0x31d3df));});});}logger['info'](_0x24f97c['uniqueid'],_0xc4ae('0x40'));}};Fax[_0xc4ae('0x23')][_0xc4ae('0x1a')]=function(_0x256818){if(this[_0xc4ae('0x22')][_0x256818['uniqueid']]){_[_0xc4ae('0x41')](this[_0xc4ae('0xc')][_0x256818[_0xc4ae('0x1f')]],_[_0xc4ae('0x42')](_0x256818,[_0xc4ae('0x43'),_0xc4ae('0x44')]));}};function updateStatus(_0x3b3c91){if(_0x3b3c91['AttachmentId']){faxMessage['update'](_0x3b3c91[_0xc4ae('0x45')],{'failMessage':_0xc4ae('0x46')})[_0xc4ae('0x3b')](function(_0xeda86f){ut[_0xc4ae('0x47')](_0xc4ae('0x48'),_0xeda86f);})[_0xc4ae('0x49')](function(_0x58097a){ut[_0xc4ae('0x47')](_0xc4ae('0x4a'),_0x58097a);});}else{ut[_0xc4ae('0x47')](_0xc4ae('0x4b'));}}Fax[_0xc4ae('0x23')][_0xc4ae('0x4c')]=function(_0x29f8dc,_0x23cd14,_0x476165){var _0x803bc=this;var _0x13df9f={};if(_0x23cd14){_0x13df9f={'read':_0x23cd14};}else{_0x13df9f={'failMessage':_0x476165};}if(this[_0xc4ae('0x22')][_0x29f8dc][_0xc4ae('0x45')]){faxMessage[_0xc4ae('0x4d')](this['actions'][_0x29f8dc]['AttachmentId'],_0x13df9f)[_0xc4ae('0x3b')](function(_0x3def28){ut[_0xc4ae('0x47')](_0xc4ae('0x4e'),_0x3def28);})[_0xc4ae('0x49')](function(_0x65abd6){ut[_0xc4ae('0x47')]('[Fax][Message][NoUpdate1]',_0x65abd6);})[_0xc4ae('0x4f')](function(){delete _0x803bc[_0xc4ae('0xc')][_0x29f8dc];delete _0x803bc[_0xc4ae('0x22')][_0x29f8dc];});}else{ut[_0xc4ae('0x47')](_0xc4ae('0x50'));delete this[_0xc4ae('0xc')][_0x29f8dc];delete this[_0xc4ae('0x22')][_0x29f8dc];}};Fax[_0xc4ae('0x23')][_0xc4ae('0x18')]=function(_0x5e44a5){var _0x4865f2=this;if(this[_0xc4ae('0xc')][_0x5e44a5[_0xc4ae('0x1f')]]){if(this['actions'][_0x5e44a5['uniqueid']]){this['channels'][_0x5e44a5[_0xc4ae('0x1f')]]['id']=this[_0xc4ae('0x22')][_0x5e44a5[_0xc4ae('0x1f')]]['id'];this[_0xc4ae('0xc')][_0x5e44a5[_0xc4ae('0x1f')]]['name']=this[_0xc4ae('0x22')][_0x5e44a5[_0xc4ae('0x1f')]]['name'];}logger['info'](_0x5e44a5[_0xc4ae('0x1f')],this['actions'][_0x5e44a5['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xc4ae('0x51'),JSON['stringify'](this['channels'][_0x5e44a5[_0xc4ae('0x1f')]]));if(this[_0xc4ae('0x22')][_0x5e44a5[_0xc4ae('0x1f')]]){if(this[_0xc4ae('0xc')][_0x5e44a5[_0xc4ae('0x1f')]]['faxpages']>0x0&&this[_0xc4ae('0xc')][_0x5e44a5['uniqueid']][_0xc4ae('0x52')]==='SUCCESS'){this[_0xc4ae('0x4c')](_0x5e44a5[_0xc4ae('0x1f')],!![]);}else{this[_0xc4ae('0x4c')](_0x5e44a5[_0xc4ae('0x1f')],![],this[_0xc4ae('0xc')][_0x5e44a5[_0xc4ae('0x1f')]][_0xc4ae('0x53')]?_0xc4ae('0x54')+this[_0xc4ae('0xc')][_0x5e44a5[_0xc4ae('0x1f')]][_0xc4ae('0x53')]:_0xc4ae('0x55'));}}}};Fax['prototype'][_0xc4ae('0x56')]=function(_0x17e2a1){var _0x16e576=this;return new BPromise(function(_0xb0b828,_0x4e6c8f){_0x16e576[_0xc4ae('0x57')](_0x17e2a1,_0x16e576[_0xc4ae('0xd')][_0x17e2a1['FaxAccountId']])[_0xc4ae('0x3b')](function(_0x1fe649){ut['logger'](_0xc4ae('0x58'),_0x1fe649);_0xb0b828(ut[_0xc4ae('0x59')](_0xc4ae('0x5a')));})[_0xc4ae('0x49')](function(_0x2438d6){ut[_0xc4ae('0x47')](_0xc4ae('0x5b'),_0x2438d6);updateStatus(_0x17e2a1);_0x4e6c8f(ut['message'](_0xc4ae('0x5c')));});});};Fax['prototype']['checkAfterSend']=function(_0x73ef49){var _0x2f247f=this;return new BPromise(function(_0x23499c,_0x59dc03){var _0x3e61bd=_0x2f247f[_0xc4ae('0x5d')](_0x2f247f[_0xc4ae('0xd')][_0x73ef49['FaxAccountId']]['Trunk'],_0x73ef49);if(_0x3e61bd['isValid']){_0x23499c(ut[_0xc4ae('0x59')](_0xc4ae('0x5e')));}else{_0x59dc03(ut[_0xc4ae('0x59')](_0x3e61bd[_0xc4ae('0x59')]));}});};function originate(_0x488edc,_0x460d2f,_0x2fad00){return new BPromise(function(_0x34979d,_0x1e257f){if(_0x2fad00){var _0x5dc0bc=util[_0xc4ae('0x5f')](_0xc4ae('0x60'),path[_0xc4ae('0x39')](_0x488edc[_0xc4ae('0x2')])[_0xc4ae('0x21')],_0x488edc['path']);gs[_0xc4ae('0x61')](_0x5dc0bc)[_0xc4ae('0x3b')](function(){_0x488edc['path']=util[_0xc4ae('0x5f')](_0xc4ae('0x62'),path[_0xc4ae('0x39')](_0x488edc['path'])[_0xc4ae('0x63')],path[_0xc4ae('0x39')](_0x488edc[_0xc4ae('0x2')])['name']);_0x460d2f[_0xc4ae('0x64')]=_0x488edc[_0xc4ae('0x2')];ut['logger'](_0xc4ae('0x65'),'');ami[_0xc4ae('0x66')](ut[_0xc4ae('0x67')](_0x488edc,_0x460d2f))[_0xc4ae('0x3b')](function(_0x3a200b){_0x34979d(_0x3a200b);})[_0xc4ae('0x49')](function(_0x1ec70b){_0x1e257f(_0x1ec70b);});})['catch'](function(_0x5c1fd6){_0x1e257f(_0x5c1fd6);});}else{ami['Action'](ut[_0xc4ae('0x67')](_0x488edc,_0x460d2f))['then'](function(_0x50787d){_0x34979d(_0x50787d);})['catch'](function(_0xe435e8){_0x1e257f(_0xe435e8);});}});}Fax['prototype'][_0xc4ae('0x57')]=function(_0x16ab8e,_0x47e646){var _0x59c323=this;return new BPromise(function(_0x1e7907,_0x450849){var _0x5749b5=uuid['v4']();var _0x2b9d40=ut[_0xc4ae('0x68')](_0x16ab8e,_0x47e646);_0x59c323[_0xc4ae('0x22')][_0x5749b5]=new Action(_0x5749b5,_0x47e646,_0x16ab8e);var _0x3efa34=_0x59c323[_0xc4ae('0x22')][_0x5749b5];if(path['parse'](_0x16ab8e[_0xc4ae('0x2')])[_0xc4ae('0x69')]===_0xc4ae('0x3a')){originate(_0x3efa34,_0x2b9d40,!![])['then'](function(_0x5464bf){_0x1e7907(_0x5464bf);})[_0xc4ae('0x49')](function(_0x4cb364){_0x450849(_0x4cb364);});}else{originate(_0x3efa34,_0x2b9d40,![])[_0xc4ae('0x3b')](function(_0x424bfe){_0x1e7907(_0x424bfe);})[_0xc4ae('0x49')](function(_0x18afcd){_0x450849(_0x18afcd);});}});};Fax[_0xc4ae('0x23')][_0xc4ae('0x6a')]=function(_0x12b6db){return!_[_0xc4ae('0x6b')](_0x12b6db)&&!_[_0xc4ae('0x6b')](_0x12b6db[_0xc4ae('0x21')])&&!_['isNil'](_0x12b6db[_0xc4ae('0x6c')])&&_0x12b6db[_0xc4ae('0x6c')]&&!_[_0xc4ae('0x6b')](this['trunks'][util[_0xc4ae('0x5f')](_0xc4ae('0x6d'),_0x12b6db[_0xc4ae('0x21')])])&&!_[_0xc4ae('0x6b')](this[_0xc4ae('0xe')][util[_0xc4ae('0x5f')](_0xc4ae('0x6d'),_0x12b6db[_0xc4ae('0x21')])]['status'])&&(this[_0xc4ae('0xe')][util[_0xc4ae('0x5f')]('SIP/%s',_0x12b6db[_0xc4ae('0x21')])][_0xc4ae('0x2c')]===_0xc4ae('0x6e')||this[_0xc4ae('0xe')][util[_0xc4ae('0x5f')](_0xc4ae('0x6d'),_0x12b6db[_0xc4ae('0x21')])][_0xc4ae('0x2c')]===_0xc4ae('0x6f'));};Fax[_0xc4ae('0x23')][_0xc4ae('0x5d')]=function(_0x31bec0,_0x2449b0){if(!this['isTrunkReachable'](_0x31bec0)){ut['logger'](_0xc4ae('0x70'),_[_0xc4ae('0x6b')](_0x31bec0)?'':_0x31bec0[_0xc4ae('0x21')]+_0xc4ae('0x71'));return{'isValid':![],'message':_0xc4ae('0x72')};}if(_[_0xc4ae('0x6b')](_0x2449b0[_0xc4ae('0x4')])){ut[_0xc4ae('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2449b0));return{'isValid':![],'message':_0xc4ae('0x73')};}if(_['isNil'](_0x2449b0['path'])){ut[_0xc4ae('0x47')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xc4ae('0x3f')](_0x2449b0));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xc4ae('0x74')};};module[_0xc4ae('0x75')]=Fax; \ No newline at end of file +var _0x0d71=['../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','status','localstationid','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','notify','fax','error','\x20notify\x20','catch','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[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','execute','%s/%s.tif','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','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0d71,0x15b));var _0x10d7=function(_0x338d55,_0x1e7175){_0x338d55=_0x338d55-0x0;var _0x1f1dae=_0x0d71[_0x338d55];return _0x1f1dae;};'use strict';var util=require('util');var _=require(_0x10d7('0x0'));var BPromise=require(_0x10d7('0x1'));var uuid=require(_0x10d7('0x2'));var moment=require(_0x10d7('0x3'));var path=require(_0x10d7('0x4'));var tiff2pdf=require(_0x10d7('0x5'));var gs=require(_0x10d7('0x6'));var logger=require(_0x10d7('0x7'))('fax');var ami=require(_0x10d7('0x8'));var rpcDb=require(_0x10d7('0x9'));var Channel=require(_0x10d7('0xa'));var ut=require(_0x10d7('0xb'));var Action=require(_0x10d7('0xc'));var faxAccount=require(_0x10d7('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x10d7('0xe'));function Fax(_0x1dbd4c){this[_0x10d7('0xf')]={};this[_0x10d7('0x10')]=_0x1dbd4c[_0x10d7('0x10')];this[_0x10d7('0x11')]=_0x1dbd4c[_0x10d7('0x11')];this[_0x10d7('0x12')]={};ami['on'](_0x10d7('0x13'),this['syncNewchannel'][_0x10d7('0x14')](this));ami['on']('varset',this['syncVarSet'][_0x10d7('0x14')](this));ami['on'](_0x10d7('0x15'),this[_0x10d7('0x16')][_0x10d7('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0x10d7('0x14')](this));ami['on'](_0x10d7('0x17'),this[_0x10d7('0x18')][_0x10d7('0x14')](this));ami['on'](_0x10d7('0x19'),this[_0x10d7('0x1a')][_0x10d7('0x14')](this));ami['on'](_0x10d7('0x1b'),this[_0x10d7('0x1c')][_0x10d7('0x14')](this));ami['on'](_0x10d7('0x1d'),this[_0x10d7('0x1e')][_0x10d7('0x14')](this));}Fax[_0x10d7('0x1f')][_0x10d7('0x20')]=function(_0x3f43f6){if(_0x3f43f6[_0x10d7('0x21')]===_0x10d7('0x22')){for(var _0xb1f571 in this[_0x10d7('0x10')]){if(this['faxAccounts'][_0x10d7('0x23')](_0xb1f571)){if(_0x3f43f6['exten']===this[_0x10d7('0x10')][_0xb1f571]['localstationid']){this[_0x10d7('0xf')][_0x3f43f6[_0x10d7('0x24')]]={};this[_0x10d7('0xf')][_0x3f43f6[_0x10d7('0x24')]]['channel']=_0x3f43f6[_0x10d7('0x25')];this['channels'][_0x3f43f6[_0x10d7('0x24')]]['id']=this[_0x10d7('0x10')][_0xb1f571]['id'];this[_0x10d7('0xf')][_0x3f43f6[_0x10d7('0x24')]][_0x10d7('0x26')]=this[_0x10d7('0x10')][_0xb1f571]['name'];logger[_0x10d7('0x27')](_0x3f43f6[_0x10d7('0x24')],_0x10d7('0x28'));}}}}if(this[_0x10d7('0x12')][_0x3f43f6[_0x10d7('0x24')]]){this[_0x10d7('0xf')][_0x3f43f6['uniqueid']]={};this[_0x10d7('0xf')][_0x3f43f6[_0x10d7('0x24')]][_0x10d7('0x25')]=_0x3f43f6[_0x10d7('0x25')];logger['info'](_0x3f43f6['uniqueid'],_0x10d7('0x28'));}};Fax[_0x10d7('0x1f')][_0x10d7('0x29')]=function(_0x4931ab){if(this[_0x10d7('0xf')][_0x4931ab[_0x10d7('0x24')]]){for(var _0x450342 in _0x4931ab[_0x10d7('0x2a')]){if(_0x4931ab['variable']['hasOwnProperty'](_0x450342)){this['channels'][_0x4931ab[_0x10d7('0x24')]][_0x450342]=_0x4931ab[_0x10d7('0x2b')];}}}};Fax[_0x10d7('0x1f')][_0x10d7('0x16')]=function(_0x53892c){if(this[_0x10d7('0xf')][_0x53892c[_0x10d7('0x24')]]){this[_0x10d7('0xf')][_0x53892c[_0x10d7('0x24')]][_0x10d7('0x2c')]=_0x53892c[_0x10d7('0x2c')];this['channels'][_0x53892c[_0x10d7('0x24')]][_0x10d7('0x2d')]=_0x53892c[_0x10d7('0x2d')];}};Fax[_0x10d7('0x1f')]['syncNewExten']=function(_0xed1ad9){if(this[_0x10d7('0xf')][_0xed1ad9['uniqueid']]){for(var _0x2e462b in _0xed1ad9[_0x10d7('0x2a')]){if(_0xed1ad9[_0x10d7('0x2a')][_0x10d7('0x23')](_0x2e462b)){this[_0x10d7('0xf')][_0xed1ad9[_0x10d7('0x24')]][_0x2e462b]=_0xed1ad9['value'];}}}};Fax['prototype'][_0x10d7('0x18')]=function(_0x26d3e7){if(this[_0x10d7('0xf')][_0x26d3e7[_0x10d7('0x24')]]){this[_0x10d7('0xf')][_0x26d3e7[_0x10d7('0x24')]]['operation']=_0x26d3e7['operation'];this['channels'][_0x26d3e7[_0x10d7('0x24')]][_0x10d7('0x2e')]=_0x26d3e7[_0x10d7('0x2e')];this['channels'][_0x26d3e7[_0x10d7('0x24')]]['localstationid']=_0x26d3e7[_0x10d7('0x2f')];this[_0x10d7('0xf')][_0x26d3e7['uniqueid']][_0x10d7('0x30')]=_0x26d3e7[_0x10d7('0x30')];logger['info'](_0x26d3e7['uniqueid'],_0x10d7('0x31'));}};Fax['prototype'][_0x10d7('0x1a')]=function(_0xc354f4){var _0x4cbb3c=this;if(this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]]){var _0x4c2223=this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]]['id'];this['channels'][_0xc354f4['uniqueid']]['remotestationid']=_0xc354f4['remotestationid'];this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]][_0x10d7('0x32')]=_0xc354f4[_0x10d7('0x32')];this['channels'][_0xc354f4[_0x10d7('0x24')]][_0x10d7('0x2f')]=_0xc354f4[_0x10d7('0x2f')];this['channels'][_0xc354f4[_0x10d7('0x24')]][_0x10d7('0x33')]=_0xc354f4['resolution'];this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]]['transferrate']=_0xc354f4[_0x10d7('0x34')];this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]][_0x10d7('0x30')]=_0xc354f4[_0x10d7('0x30')];this[_0x10d7('0xf')][_0xc354f4['uniqueid']][_0x10d7('0x35')]=_0xc354f4[_0x10d7('0x35')];if(this[_0x10d7('0xf')][_0xc354f4[_0x10d7('0x24')]][_0x10d7('0x32')]>0x0){tiff2pdf(_0xc354f4[_0x10d7('0x30')],_0x10d7('0x36'),function(_0x325fa7){logger[_0x10d7('0x27')](_0xc354f4['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x325fa7[_0x10d7('0x37')]);attachment[_0x10d7('0x38')]({'name':path[_0x10d7('0x39')](_0xc354f4[_0x10d7('0x30')])[_0x10d7('0x26')],'basename':path['parse'](_0xc354f4[_0x10d7('0x30')])['name']+_0x10d7('0x3a'),'type':_0x10d7('0x3b')})['then'](function(_0x278450){faxAccount[_0x10d7('0x3c')](_0x4c2223,{'from':_0xc354f4[_0x10d7('0x35')],'mapKey':_0x10d7('0x3d'),'body':path[_0x10d7('0x39')](_0xc354f4[_0x10d7('0x30')])[_0x10d7('0x26')]+_0x10d7('0x3a'),'AttachmentId':_0x278450['id']})['catch'](function(_0x494952){logger[_0x10d7('0x3e')](_0xc354f4[_0x10d7('0x24')],_0x10d7('0x3f'),JSON['stringify'](_0x494952));});})[_0x10d7('0x40')](function(_0x878d21){logger['error'](_0xc354f4['uniqueid'],_0x10d7('0x41'),JSON['stringify'](_0x878d21));});});}logger['info'](_0xc354f4[_0x10d7('0x24')],'\x20receiveFax\x20');}};Fax[_0x10d7('0x1f')][_0x10d7('0x1e')]=function(_0x58652a){if(this[_0x10d7('0x12')][_0x58652a[_0x10d7('0x24')]]){_[_0x10d7('0x42')](this[_0x10d7('0xf')][_0x58652a[_0x10d7('0x24')]],_[_0x10d7('0x43')](_0x58652a,[_0x10d7('0x44'),'reason']));}};function updateStatus(_0x6b554e){if(_0x6b554e[_0x10d7('0x45')]){faxMessage[_0x10d7('0x46')](_0x6b554e[_0x10d7('0x45')],{'failMessage':_0x10d7('0x47')})[_0x10d7('0x48')](function(_0x31bfc4){ut[_0x10d7('0x49')](_0x10d7('0x4a'),_0x31bfc4);})[_0x10d7('0x40')](function(_0x5ade31){ut[_0x10d7('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x5ade31);});}else{ut[_0x10d7('0x49')](_0x10d7('0x4b'));}}Fax[_0x10d7('0x1f')][_0x10d7('0x4c')]=function(_0x302f12,_0x12c507,_0x2c1d98){var _0x2db871=this;var _0xc31ec0={};if(_0x12c507){_0xc31ec0={'read':_0x12c507};}else{_0xc31ec0={'failMessage':_0x2c1d98};}if(this[_0x10d7('0x12')][_0x302f12]['AttachmentId']){faxMessage[_0x10d7('0x46')](this[_0x10d7('0x12')][_0x302f12][_0x10d7('0x45')],_0xc31ec0)['then'](function(_0x51c414){ut['logger'](_0x10d7('0x4d'),_0x51c414);})[_0x10d7('0x40')](function(_0x2f2dc7){ut[_0x10d7('0x49')]('[Fax][Message][NoUpdate1]',_0x2f2dc7);})[_0x10d7('0x4e')](function(){delete _0x2db871['channels'][_0x302f12];delete _0x2db871[_0x10d7('0x12')][_0x302f12];});}else{ut['logger'](_0x10d7('0x4f'));delete this[_0x10d7('0xf')][_0x302f12];delete this[_0x10d7('0x12')][_0x302f12];}};Fax[_0x10d7('0x1f')][_0x10d7('0x1c')]=function(_0x443476){var _0xa5dfb6=this;if(this[_0x10d7('0xf')][_0x443476[_0x10d7('0x24')]]){if(this[_0x10d7('0x12')][_0x443476[_0x10d7('0x24')]]){this[_0x10d7('0xf')][_0x443476[_0x10d7('0x24')]]['id']=this[_0x10d7('0x12')][_0x443476['uniqueid']]['id'];this[_0x10d7('0xf')][_0x443476['uniqueid']]['name']=this[_0x10d7('0x12')][_0x443476[_0x10d7('0x24')]][_0x10d7('0x26')];}logger[_0x10d7('0x27')](_0x443476['uniqueid'],this[_0x10d7('0x12')][_0x443476[_0x10d7('0x24')]]?_0x10d7('0x50'):_0x10d7('0x51'),JSON[_0x10d7('0x52')](this[_0x10d7('0xf')][_0x443476[_0x10d7('0x24')]]));if(this[_0x10d7('0x12')][_0x443476['uniqueid']]){if(this[_0x10d7('0xf')][_0x443476[_0x10d7('0x24')]][_0x10d7('0x53')]>0x0&&this[_0x10d7('0xf')][_0x443476['uniqueid']]['faxstatus']===_0x10d7('0x54')){this[_0x10d7('0x4c')](_0x443476[_0x10d7('0x24')],!![]);}else{this[_0x10d7('0x4c')](_0x443476[_0x10d7('0x24')],![],this[_0x10d7('0xf')][_0x443476['uniqueid']][_0x10d7('0x55')]?_0x10d7('0x56')+this['channels'][_0x443476[_0x10d7('0x24')]][_0x10d7('0x55')]:_0x10d7('0x57'));}}}};Fax['prototype'][_0x10d7('0x58')]=function(_0x4ee7aa){var _0x478f6a=this;return new BPromise(function(_0x1b4909,_0x11c3fe){_0x478f6a[_0x10d7('0x59')](_0x4ee7aa,_0x478f6a[_0x10d7('0x10')][_0x4ee7aa[_0x10d7('0x5a')]])[_0x10d7('0x48')](function(_0x1ec274){ut['logger'](_0x10d7('0x5b'),_0x1ec274);_0x1b4909(ut[_0x10d7('0x37')]('Fax\x20received'));})[_0x10d7('0x40')](function(_0x2c786b){ut['logger'](_0x10d7('0x5c'),_0x2c786b);updateStatus(_0x4ee7aa);_0x11c3fe(ut[_0x10d7('0x37')]('Fax\x20failed'));});});};Fax[_0x10d7('0x1f')][_0x10d7('0x5d')]=function(_0x29d041){var _0x290fab=this;return new BPromise(function(_0x22f77b,_0x563e4f){var _0x5b1979=_0x290fab[_0x10d7('0x5e')](_0x290fab[_0x10d7('0x10')][_0x29d041[_0x10d7('0x5a')]][_0x10d7('0x5f')],_0x29d041);if(_0x5b1979[_0x10d7('0x60')]){_0x22f77b(ut['message'](_0x10d7('0x61')));}else{_0x563e4f(ut['message'](_0x5b1979[_0x10d7('0x37')]));}});};function originate(_0x126471,_0x50f299,_0x3af9b7){return new BPromise(function(_0x4d1d8a,_0x36f8c7){if(_0x3af9b7){var _0x5e1290=util[_0x10d7('0x62')](_0x10d7('0x63'),path[_0x10d7('0x39')](_0x126471['path'])[_0x10d7('0x26')],_0x126471[_0x10d7('0x4')]);gs[_0x10d7('0x64')](_0x5e1290)[_0x10d7('0x48')](function(){_0x126471['path']=util[_0x10d7('0x62')](_0x10d7('0x65'),path[_0x10d7('0x39')](_0x126471[_0x10d7('0x4')])['dir'],path[_0x10d7('0x39')](_0x126471[_0x10d7('0x4')])[_0x10d7('0x26')]);_0x50f299[_0x10d7('0x66')]=_0x126471[_0x10d7('0x4')];ut[_0x10d7('0x49')](_0x10d7('0x67'),'');ami[_0x10d7('0x68')](ut['variablesAction'](_0x126471,_0x50f299))['then'](function(_0x17dcb1){_0x4d1d8a(_0x17dcb1);})[_0x10d7('0x40')](function(_0x2e286a){_0x36f8c7(_0x2e286a);});})[_0x10d7('0x40')](function(_0x431595){_0x36f8c7(_0x431595);});}else{ami[_0x10d7('0x68')](ut[_0x10d7('0x69')](_0x126471,_0x50f299))[_0x10d7('0x48')](function(_0x236b0b){_0x4d1d8a(_0x236b0b);})[_0x10d7('0x40')](function(_0x3cabe9){_0x36f8c7(_0x3cabe9);});}});}Fax[_0x10d7('0x1f')][_0x10d7('0x59')]=function(_0x26cc13,_0x49307e){var _0x4e419a=this;return new BPromise(function(_0x41ef9b,_0x445878){var _0x405c3e=uuid['v4']();var _0x507e4b=ut[_0x10d7('0x6a')](_0x26cc13,_0x49307e);_0x4e419a['actions'][_0x405c3e]=new Action(_0x405c3e,_0x49307e,_0x26cc13);var _0xb76d50=_0x4e419a[_0x10d7('0x12')][_0x405c3e];if(path[_0x10d7('0x39')](_0x26cc13[_0x10d7('0x4')])['ext']===_0x10d7('0x3a')){originate(_0xb76d50,_0x507e4b,!![])[_0x10d7('0x48')](function(_0x4c71b5){_0x41ef9b(_0x4c71b5);})[_0x10d7('0x40')](function(_0x425aed){_0x445878(_0x425aed);});}else{originate(_0xb76d50,_0x507e4b,![])[_0x10d7('0x48')](function(_0x5df8d9){_0x41ef9b(_0x5df8d9);})[_0x10d7('0x40')](function(_0x53abbb){_0x445878(_0x53abbb);});}});};Fax[_0x10d7('0x1f')][_0x10d7('0x6b')]=function(_0x56d74f){return!_[_0x10d7('0x6c')](_0x56d74f)&&!_[_0x10d7('0x6c')](_0x56d74f[_0x10d7('0x26')])&&!_['isNil'](_0x56d74f[_0x10d7('0x6d')])&&_0x56d74f['active']&&!_[_0x10d7('0x6c')](this[_0x10d7('0x11')][util[_0x10d7('0x62')](_0x10d7('0x6e'),_0x56d74f['name'])])&&!_[_0x10d7('0x6c')](this['trunks'][util['format'](_0x10d7('0x6e'),_0x56d74f[_0x10d7('0x26')])][_0x10d7('0x2e')])&&(this[_0x10d7('0x11')][util[_0x10d7('0x62')](_0x10d7('0x6e'),_0x56d74f['name'])]['status']===_0x10d7('0x6f')||this['trunks'][util[_0x10d7('0x62')](_0x10d7('0x6e'),_0x56d74f[_0x10d7('0x26')])][_0x10d7('0x2e')]===_0x10d7('0x70'));};Fax['prototype']['checkTrunk']=function(_0x59a8e0,_0x197276){if(!this[_0x10d7('0x6b')](_0x59a8e0)){ut[_0x10d7('0x49')](_0x10d7('0x71'),_[_0x10d7('0x6c')](_0x59a8e0)?'':_0x59a8e0[_0x10d7('0x26')]+_0x10d7('0x72'));return{'isValid':![],'message':_0x10d7('0x73')};}if(_['isNil'](_0x197276[_0x10d7('0x3d')])){ut[_0x10d7('0x49')](_0x10d7('0x74'),JSON[_0x10d7('0x52')](_0x197276));return{'isValid':![],'message':_0x10d7('0x75')};}if(_['isNil'](_0x197276[_0x10d7('0x4')])){ut[_0x10d7('0x49')](_0x10d7('0x76'),JSON[_0x10d7('0x52')](_0x197276));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x10d7('0x77')};};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 d03cb9b..c03df8f 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 _0xb879=['../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','../../../config/logger','preview','lodash'];(function(_0x2d12ee,_0x3245a6){var _0x4feaf5=function(_0x4a55c2){while(--_0x4a55c2){_0x2d12ee['push'](_0x2d12ee['shift']());}};_0x4feaf5(++_0x3245a6);}(_0xb879,0x15d));var _0x9b87=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb879[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x9b87('0x0'))(_0x9b87('0x1'));var _=require(_0x9b87('0x2'));var faxAccount=require(_0x9b87('0x3'));function loggerCatch(_0x4a3bb5){return function(_0x346826){logger[_0x9b87('0x4')](_0x4a3bb5,util[_0x9b87('0x5')](_0x346826,{'showHidden':![],'depth':null}));};}exports[_0x9b87('0x6')]=function(_0x576964,_0x6eaae){return BPromise[_0x9b87('0x7')]()[_0x9b87('0x8')](faxAccount[_0x9b87('0x6')](_0x576964,_0x6eaae))[_0x9b87('0x9')](loggerCatch(_0x9b87('0xa')));}; \ No newline at end of file +var _0x6d6b=['../rpc/faxAccount','error','inspect','notify','catch','util','../../../config/logger','lodash'];(function(_0x3c0a09,_0x3db8d7){var _0x463015=function(_0xcfc191){while(--_0xcfc191){_0x3c0a09['push'](_0x3c0a09['shift']());}};_0x463015(++_0x3db8d7);}(_0x6d6b,0x7d));var _0xb6d6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6d6b[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xb6d6('0x0'));var BPromise=require('bluebird');var logger=require(_0xb6d6('0x1'))('preview');var _=require(_0xb6d6('0x2'));var faxAccount=require(_0xb6d6('0x3'));function loggerCatch(_0xc1d13a){return function(_0x735433){logger[_0xb6d6('0x4')](_0xc1d13a,util[_0xb6d6('0x5')](_0x735433,{'showHidden':![],'depth':null}));};}exports[_0xb6d6('0x6')]=function(_0x51b486,_0x19dbb6){return BPromise['resolve']()['then'](faxAccount[_0xb6d6('0x6')](_0x51b486,_0x19dbb6))[_0xb6d6('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 348972a..675c75f 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 _0xf00b=['bluebird','child_process','exec','execute','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x4e99e0,_0xd87512){var _0x2378d5=function(_0x3abd12){while(--_0x3abd12){_0x4e99e0['push'](_0x4e99e0['shift']());}};_0x2378d5(++_0xd87512);}(_0xf00b,0xa7));var _0xbf00=function(_0x33d379,_0x2db393){_0x33d379=_0x33d379-0x0;var _0x456999=_0xf00b[_0x33d379];return _0x456999;};'use strict';var util=require(_0xbf00('0x0'));var logger=require(_0xbf00('0x1'))(_0xbf00('0x2'));var BPromise=require(_0xbf00('0x3'));var exec=require(_0xbf00('0x4'))[_0xbf00('0x5')];exports[_0xbf00('0x6')]=function(_0x35b846){return new BPromise(function(_0x237ec3,_0x2b538c){exec(_0x35b846,function(_0x3d62ba,_0x211845,_0x1b77ea){logger[_0xbf00('0x7')]('Exec\x20gs',_0x211845);if(_0x3d62ba){logger[_0xbf00('0x7')]('Exec\x20gs',_0xbf00('0x8'),util[_0xbf00('0x9')](_0x3d62ba,{'showHidden':![],'depth':null}),_0x211845,_0x1b77ea);_0x2b538c(_0x3d62ba);}_0x237ec3(_0x211845);});});}; \ No newline at end of file +var _0x0d5f=['info','Exec\x20gs','\x20Error\x20:','../../../../config/logger','bluebird','child_process','exec','execute'];(function(_0x5f2d8b,_0x6f6e62){var _0x2c9375=function(_0x281db4){while(--_0x281db4){_0x5f2d8b['push'](_0x5f2d8b['shift']());}};_0x2c9375(++_0x6f6e62);}(_0x0d5f,0x123));var _0xf0d5=function(_0x17129a,_0x13fb13){_0x17129a=_0x17129a-0x0;var _0x52b82f=_0x0d5f[_0x17129a];return _0x52b82f;};'use strict';var util=require('util');var logger=require(_0xf0d5('0x0'))('fax');var BPromise=require(_0xf0d5('0x1'));var exec=require(_0xf0d5('0x2'))[_0xf0d5('0x3')];exports[_0xf0d5('0x4')]=function(_0x469710){return new BPromise(function(_0x1c2e8f,_0x131932){exec(_0x469710,function(_0x5017df,_0x5332ca,_0x3bdb42){logger[_0xf0d5('0x5')](_0xf0d5('0x6'),_0x5332ca);if(_0x5017df){logger['info']('Exec\x20gs',_0xf0d5('0x7'),util['inspect'](_0x5017df,{'showHidden':![],'depth':null}),_0x5332ca,_0x3bdb42);_0x131932(_0x5017df);}_0x1c2e8f(_0x5332ca);});});}; \ 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 473193e..f02d27d 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 _0x224d=['uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','fax','message','logger','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x3734cf,_0x4511f8){var _0xff69ce=function(_0x44469a){while(--_0x44469a){_0x3734cf['push'](_0x3734cf['shift']());}};_0xff69ce(++_0x4511f8);}(_0x224d,0x10f));var _0xd224=function(_0x4b7c65,_0x48df1d){_0x4b7c65=_0x4b7c65-0x0;var _0x16a07f=_0x224d[_0x4b7c65];return _0x16a07f;};'use strict';var util=require(_0xd224('0x0'));var _=require(_0xd224('0x1'));var moment=require(_0xd224('0x2'));var logger=require('../../../../config/logger')(_0xd224('0x3'));exports[_0xd224('0x4')]=function(_0x1e56bb){return{'message':_0x1e56bb};};exports[_0xd224('0x5')]=function(_0x59d8ed,_0x19f08b){logger['info'](_0x59d8ed,util['inspect'](_0x19f08b,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x8b6227,_0x416bec){var _0x5c4c7b={'XMF-ECM':_0x416bec[_0xd224('0x6')],'XMF-HEADERINFO':_0x416bec[_0xd224('0x7')],'XMF-MINRATE':_0x416bec[_0xd224('0x8')],'XMF-MAXRATE':_0x416bec[_0xd224('0x9')],'XMF-MODEM':util['format']('\x22%s\x22',_0x416bec[_0xd224('0xa')]),'XMF-GATEWAY':_0x416bec[_0xd224('0xb')],'XMF-FAXDETECT':_0x416bec[_0xd224('0xc')],'XMF-T38TIMEOUT':_0x416bec[_0xd224('0xd')],'XMF-LOCALSTATIONID':_0x416bec[_0xd224('0xe')],'XMF-PATH':_0x8b6227[_0xd224('0xf')]};return _0x5c4c7b;};exports[_0xd224('0x10')]=function(_0x1ad98b,_0x3c8191){return{'actionid':_0x1ad98b[_0xd224('0x11')],'action':_0xd224('0x12'),'channel':_0x1ad98b[_0xd224('0x13')],'Exten':_0xd224('0x14'),'Context':_0xd224('0x15'),'Priority':'1','callerid':util[_0xd224('0x16')](_0xd224('0x17'),_0x1ad98b[_0xd224('0x7')]?_0x1ad98b['headerinfo']:'',_0x1ad98b[_0xd224('0xe')]),'variable':_0x3c8191,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1ad98b[_0xd224('0x11')]};}; \ No newline at end of file +var _0x7efc=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','message','logger','inspect','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid'];(function(_0x3257da,_0xf2e32b){var _0x50ac4d=function(_0x3d0ccf){while(--_0x3d0ccf){_0x3257da['push'](_0x3257da['shift']());}};_0x50ac4d(++_0xf2e32b);}(_0x7efc,0xb4));var _0xc7ef=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x7efc[_0x2c1e7a];return _0xcacb4f;};'use strict';var util=require('util');var _=require(_0xc7ef('0x0'));var moment=require(_0xc7ef('0x1'));var logger=require(_0xc7ef('0x2'))(_0xc7ef('0x3'));exports[_0xc7ef('0x4')]=function(_0x25ce6c){return{'message':_0x25ce6c};};exports[_0xc7ef('0x5')]=function(_0x3a4b77,_0x246f1c){logger['info'](_0x3a4b77,util[_0xc7ef('0x6')](_0x246f1c,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1c577,_0x200c70){var _0x2c4d4e={'XMF-ECM':_0x200c70['ecm'],'XMF-HEADERINFO':_0x200c70[_0xc7ef('0x7')],'XMF-MINRATE':_0x200c70[_0xc7ef('0x8')],'XMF-MAXRATE':_0x200c70['maxrate'],'XMF-MODEM':util[_0xc7ef('0x9')](_0xc7ef('0xa'),_0x200c70[_0xc7ef('0xb')]),'XMF-GATEWAY':_0x200c70[_0xc7ef('0xc')],'XMF-FAXDETECT':_0x200c70[_0xc7ef('0xd')],'XMF-T38TIMEOUT':_0x200c70['t38timeout'],'XMF-LOCALSTATIONID':_0x200c70[_0xc7ef('0xe')],'XMF-PATH':_0x1c577[_0xc7ef('0xf')]};return _0x2c4d4e;};exports[_0xc7ef('0x10')]=function(_0x377ee3,_0x2af3b9){return{'actionid':_0x377ee3[_0xc7ef('0x11')],'action':'originate','channel':_0x377ee3[_0xc7ef('0x12')],'Exten':_0xc7ef('0x13'),'Context':_0xc7ef('0x14'),'Priority':'1','callerid':util[_0xc7ef('0x9')](_0xc7ef('0x15'),_0x377ee3[_0xc7ef('0x7')]?_0x377ee3[_0xc7ef('0x7')]:'',_0x377ee3[_0xc7ef('0xe')]),'variable':_0x2af3b9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x377ee3[_0xc7ef('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 820513c..66d1b50 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 _0x7d24=['initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7d24,0x115));var _0x47d2=function(_0xf8d4d3,_0x3feff8){_0xf8d4d3=_0xf8d4d3-0x0;var _0x249e9b=_0x7d24[_0xf8d4d3];return _0x249e9b;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x47d2('0x0'));var server=require(_0x47d2('0x1'));var Realtime=require('./realtime');var Report=require(_0x47d2('0x2'));var Acw=require(_0x47d2('0x3'));var Trigger=require(_0x47d2('0x4'));var Dialer=require(_0x47d2('0x5'));var Preview=require(_0x47d2('0x6'));var Fax=require(_0x47d2('0x7'));var user=require(_0x47d2('0x8'));var voiceQueue=require(_0x47d2('0x9'));var voiceQueueReport=require(_0x47d2('0xa'));var voiceCallReport=require(_0x47d2('0xb'));var trunk=require(_0x47d2('0xc'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x47d2('0xd'));var voiceExtension=require(_0x47d2('0xe'));var faxAccount=require(_0x47d2('0xf'));var zendesk=require(_0x47d2('0x10'));var salesforce=require(_0x47d2('0x11'));var sugarcrm=require(_0x47d2('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x47d2('0x13'));var zoho=require(_0x47d2('0x14'));var vtiger=require(_0x47d2('0x15'));var servicenow=require(_0x47d2('0x16'));var dynamics365=require(_0x47d2('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x47d2('0x18')](_0x47d2('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x47d2('0x18')](_0x47d2('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x47d2('0x1a')](user['getAgents']())[_0x47d2('0x1a')](realtime[_0x47d2('0x1b')]())[_0x47d2('0x1a')](user[_0x47d2('0x1c')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x1d')]())[_0x47d2('0x1a')](trunk['getTrunks']())[_0x47d2('0x1a')](realtime[_0x47d2('0x1e')]())[_0x47d2('0x1a')](voiceQueue['getVoiceQueues']())[_0x47d2('0x1a')](realtime[_0x47d2('0x1f')]())['then'](trigger[_0x47d2('0x20')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x21')]())[_0x47d2('0x1a')](template[_0x47d2('0x22')]())[_0x47d2('0x1a')](realtime['initTemplates']())[_0x47d2('0x1a')](zendesk[_0x47d2('0x23')]())['then'](realtime[_0x47d2('0x24')]())['then'](salesforce[_0x47d2('0x25')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x26')]())[_0x47d2('0x1a')](sugarcrm[_0x47d2('0x27')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x28')]())[_0x47d2('0x1a')](freshdesk[_0x47d2('0x29')]())[_0x47d2('0x1a')](realtime['initFreshdeskAccounts']())['then'](desk[_0x47d2('0x2a')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x2b')]())[_0x47d2('0x1a')](zoho[_0x47d2('0x2c')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x2d')]())[_0x47d2('0x1a')](vtiger[_0x47d2('0x2e')]())[_0x47d2('0x1a')](realtime['initVtigerAccounts']())[_0x47d2('0x1a')](servicenow[_0x47d2('0x2f')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x47d2('0x1a')](realtime[_0x47d2('0x31')]())[_0x47d2('0x1a')](campaign['getCampaigns']())[_0x47d2('0x1a')](realtime['initCampaigns']())[_0x47d2('0x1a')](voiceExtension['getVoiceExtensions']())[_0x47d2('0x1a')](realtime[_0x47d2('0x32')]())['then'](faxAccount[_0x47d2('0x33')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x34')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x47d2('0x35')]()['then'](voiceQueueReport[_0x47d2('0x36')]())[_0x47d2('0x1a')](realtime['initVoiceQueueReports']())[_0x47d2('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x47d2('0x1a')](realtime[_0x47d2('0x37')]())[_0x47d2('0x1a')](cmHopperHistory[_0x47d2('0x38')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x39')]())['then'](voiceCallReport[_0x47d2('0x3a')]())[_0x47d2('0x1a')](realtime[_0x47d2('0x3b')]())[_0x47d2('0x1a')](function(_0xef5c1){})[_0x47d2('0x3c')](function(_0x4148a2){console[_0x47d2('0x3d')](_0x4148a2);});}function main(){return server[_0x47d2('0x3e')](realtime,preview,fax)[_0x47d2('0x1a')](function(_0x14efa8){return initRealtime();})[_0x47d2('0x1a')](function(){return initParams();})[_0x47d2('0x1a')](function(){report[_0x47d2('0x3f')]();setInterval(initRealtime,0x1388);})[_0x47d2('0x3c')](function(_0xb11b6f){console[_0x47d2('0x3d')](_0xb11b6f);});}main(); \ No newline at end of file +var _0x7ddb=['getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts'];(function(_0x2a8c37,_0x1fcf3b){var _0x4f7c6e=function(_0x236301){while(--_0x236301){_0x2a8c37['push'](_0x2a8c37['shift']());}};_0x4f7c6e(++_0x1fcf3b);}(_0x7ddb,0x1d2));var _0xb7dd=function(_0x223ebf,_0x169653){_0x223ebf=_0x223ebf-0x0;var _0x3c948b=_0x7ddb[_0x223ebf];return _0x3c948b;};'use strict';var BPromise=require(_0xb7dd('0x0'));var util=require(_0xb7dd('0x1'));var moment=require(_0xb7dd('0x2'));var server=require(_0xb7dd('0x3'));var Realtime=require(_0xb7dd('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0xb7dd('0x5'));var Dialer=require(_0xb7dd('0x6'));var Preview=require('./preview');var Fax=require(_0xb7dd('0x7'));var user=require(_0xb7dd('0x8'));var voiceQueue=require(_0xb7dd('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xb7dd('0xa'));var trigger=require('./rpc/trigger');var template=require(_0xb7dd('0xb'));var cmHopperHistory=require(_0xb7dd('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xb7dd('0xd'));var faxAccount=require(_0xb7dd('0xe'));var zendesk=require(_0xb7dd('0xf'));var salesforce=require(_0xb7dd('0x10'));var sugarcrm=require(_0xb7dd('0x11'));var freshdesk=require(_0xb7dd('0x12'));var desk=require(_0xb7dd('0x13'));var zoho=require(_0xb7dd('0x14'));var vtiger=require(_0xb7dd('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xb7dd('0x16'));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()[_0xb7dd('0x17')](_0xb7dd('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xb7dd('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())[_0xb7dd('0x19')](realtime[_0xb7dd('0x1a')]())[_0xb7dd('0x19')](user[_0xb7dd('0x1b')]())[_0xb7dd('0x19')](realtime['initTelephones']())[_0xb7dd('0x19')](trunk[_0xb7dd('0x1c')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x1d')]())[_0xb7dd('0x19')](voiceQueue[_0xb7dd('0x1e')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x1f')]())[_0xb7dd('0x19')](trigger[_0xb7dd('0x20')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x21')]())[_0xb7dd('0x19')](template['getTemplates']())[_0xb7dd('0x19')](realtime[_0xb7dd('0x22')]())[_0xb7dd('0x19')](zendesk[_0xb7dd('0x23')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x24')]())[_0xb7dd('0x19')](salesforce['getSalesforceAccounts']())[_0xb7dd('0x19')](realtime[_0xb7dd('0x25')]())[_0xb7dd('0x19')](sugarcrm['getSugarcrmAccounts']())[_0xb7dd('0x19')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xb7dd('0x26')]())['then'](realtime[_0xb7dd('0x27')]())['then'](desk[_0xb7dd('0x28')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x29')]())[_0xb7dd('0x19')](zoho[_0xb7dd('0x2a')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x2b')]())[_0xb7dd('0x19')](vtiger['getVtigerAccounts']())[_0xb7dd('0x19')](realtime[_0xb7dd('0x2c')]())[_0xb7dd('0x19')](servicenow[_0xb7dd('0x2d')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x2e')]())[_0xb7dd('0x19')](dynamics365[_0xb7dd('0x2f')]())[_0xb7dd('0x19')](realtime['initDynamics365Accounts']())[_0xb7dd('0x19')](campaign[_0xb7dd('0x30')]())['then'](realtime[_0xb7dd('0x31')]())[_0xb7dd('0x19')](voiceExtension[_0xb7dd('0x32')]())[_0xb7dd('0x19')](realtime['initVoiceExtensions']())[_0xb7dd('0x19')](faxAccount['getFaxAccounts']())['then'](realtime['initFaxAccounts']())[_0xb7dd('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0xb7dd('0x33')]()[_0xb7dd('0x19')](voiceQueueReport[_0xb7dd('0x34')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x35')]())[_0xb7dd('0x19')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xb7dd('0x36')]())[_0xb7dd('0x19')](cmHopperHistory[_0xb7dd('0x37')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x38')]())[_0xb7dd('0x19')](voiceCallReport[_0xb7dd('0x39')]())[_0xb7dd('0x19')](realtime[_0xb7dd('0x3a')]())[_0xb7dd('0x19')](function(_0x3b93fc){})[_0xb7dd('0x3b')](function(_0x2f1995){console[_0xb7dd('0x3c')](_0x2f1995);});}function main(){return server[_0xb7dd('0x3d')](realtime,preview,fax)[_0xb7dd('0x19')](function(_0x3afdba){return initRealtime();})[_0xb7dd('0x19')](function(){return initParams();})['then'](function(){report[_0xb7dd('0x3e')]();setInterval(initRealtime,0x1388);})[_0xb7dd('0x3b')](function(_0x2f824d){console['log'](_0x2f824d);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 64085ea..940a927 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 _0x83a8=['user:%s','emit','user:save','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','fullname','unknown','stateTime','status','address','phone','mobile','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','state','toLowerCase','not_inuse','idle','voiceStatus','statePause','toNumber','accountcode','interface','stringify','format'];(function(_0x21f783,_0x3d3711){var _0x2c56af=function(_0x1a0efb){while(--_0x1a0efb){_0x21f783['push'](_0x21f783['shift']());}};_0x2c56af(++_0x3d3711);}(_0x83a8,0x1e4));var _0x883a=function(_0x39786e,_0x45deea){_0x39786e=_0x39786e-0x0;var _0x3e3a6e=_0x83a8[_0x39786e];return _0x3e3a6e;};'use strict';var _=require(_0x883a('0x0'));var util=require(_0x883a('0x1'));var moment=require(_0x883a('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x883a('0x3'));config['redis']=_[_0x883a('0x4')](config[_0x883a('0x5')],{'host':_0x883a('0x6'),'port':0x18eb});var io=require(_0x883a('0x7'))(new Redis(config[_0x883a('0x5')]));function Agent(_0x2e7ae0){this['id']=_0x2e7ae0['id']||0x0;this[_0x883a('0x8')]=_0x2e7ae0[_0x883a('0x8')]||'';this['email']=_0x2e7ae0[_0x883a('0x9')]||'';this['accountcode']=_0x2e7ae0['accountcode']||'';this[_0x883a('0xa')]=_0x2e7ae0['fullname']||'';this['state']=_0x883a('0xb');this[_0x883a('0xc')]=0x0;this[_0x883a('0xd')]=_0x883a('0xb');this[_0x883a('0xe')]='';this[_0x883a('0xf')]='';this[_0x883a('0x10')]='';this['interface']='';this[_0x883a('0x11')]=_0x2e7ae0[_0x883a('0x11')]||![];this['voiceStatus']=_0x883a('0xb');this[_0x883a('0x12')]=0x0;this[_0x883a('0x13')]='';this[_0x883a('0x14')]='';this[_0x883a('0x15')]=![];this[_0x883a('0x16')]=![];this[_0x883a('0x17')]='';}Agent[_0x883a('0x18')]['updateStatusRealtime']=function(_0x21a551){var _0x439fc2;if(_0x21a551&&_0x21a551[_0x883a('0x19')]){_0x439fc2=_0x21a551['state'][_0x883a('0x1a')]();switch(_0x439fc2){case _0x883a('0x1b'):_0x439fc2=_0x883a('0x1c');break;case'inuse':_0x439fc2='talking';break;}}if(_0x439fc2&&this[_0x883a('0x1d')]!==_0x439fc2||_0x21a551[_0x883a('0x1e')]){this['voiceStatusTime']=_[_0x883a('0x1f')](moment()['format']('x'));}if(_0x439fc2){this[_0x883a('0x1d')]=_0x439fc2;}var _0x468976={'id':this['id'],'name':this[_0x883a('0x8')],'email':this[_0x883a('0x9')],'accountcode':this[_0x883a('0x20')],'fullname':this[_0x883a('0xa')],'state':this[_0x883a('0x19')],'stateTime':this['stateTime'],'status':this[_0x883a('0xd')],'address':this[_0x883a('0xe')],'online':this['online'],'voiceStatus':this[_0x883a('0x1d')],'voiceStatusTime':this[_0x883a('0x12')],'voiceStatusCallerIdNumber':this[_0x883a('0x13')],'voiceStatusQueue':this[_0x883a('0x14')],'interface':this[_0x883a('0x21')],'onhold':this['onhold']};var _0x4d9d4b=md5(JSON[_0x883a('0x22')](_0x468976));if(this[_0x883a('0x17')]!==_0x4d9d4b){this[_0x883a('0x17')]=_0x4d9d4b;io['to'](util[_0x883a('0x23')](_0x883a('0x24'),_0x468976[_0x883a('0x8')]))[_0x883a('0x25')](_0x883a('0x26'),_0x468976);}};module[_0x883a('0x27')]=Agent; \ No newline at end of file +var _0x67cd=['onhold','prototype','not_inuse','inuse','talking','toNumber','status','interface','format','user:%s','emit','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x5bf8b0,_0x5d8bc2){var _0xb75aff=function(_0x2ccd5a){while(--_0x2ccd5a){_0x5bf8b0['push'](_0x5bf8b0['shift']());}};_0xb75aff(++_0x5d8bc2);}(_0x67cd,0x97));var _0xd67c=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x67cd[_0x9b3efc];return _0x200f05;};'use strict';var _=require(_0xd67c('0x0'));var util=require(_0xd67c('0x1'));var moment=require('moment');var md5=require(_0xd67c('0x2'));var Redis=require(_0xd67c('0x3'));var config=require(_0xd67c('0x4'));config[_0xd67c('0x5')]=_[_0xd67c('0x6')](config['redis'],{'host':_0xd67c('0x7'),'port':0x18eb});var io=require(_0xd67c('0x8'))(new Redis(config[_0xd67c('0x5')]));function Agent(_0x2ffd7e){this['id']=_0x2ffd7e['id']||0x0;this[_0xd67c('0x9')]=_0x2ffd7e['name']||'';this[_0xd67c('0xa')]=_0x2ffd7e[_0xd67c('0xa')]||'';this['accountcode']=_0x2ffd7e[_0xd67c('0xb')]||'';this[_0xd67c('0xc')]=_0x2ffd7e['fullname']||'';this[_0xd67c('0xd')]=_0xd67c('0xe');this[_0xd67c('0xf')]=0x0;this['status']='unknown';this[_0xd67c('0x10')]='';this[_0xd67c('0x11')]='';this[_0xd67c('0x12')]='';this['interface']='';this[_0xd67c('0x13')]=_0x2ffd7e[_0xd67c('0x13')]||![];this[_0xd67c('0x14')]='unknown';this[_0xd67c('0x15')]=0x0;this[_0xd67c('0x16')]='';this[_0xd67c('0x17')]='';this[_0xd67c('0x18')]=![];this['local']=![];this['md5']='';}Agent[_0xd67c('0x19')]['updateStatusRealtime']=function(_0xbaa4c1){var _0x2225e7;if(_0xbaa4c1&&_0xbaa4c1['state']){_0x2225e7=_0xbaa4c1[_0xd67c('0xd')]['toLowerCase']();switch(_0x2225e7){case _0xd67c('0x1a'):_0x2225e7='idle';break;case _0xd67c('0x1b'):_0x2225e7=_0xd67c('0x1c');break;}}if(_0x2225e7&&this[_0xd67c('0x14')]!==_0x2225e7||_0xbaa4c1['statePause']){this['voiceStatusTime']=_[_0xd67c('0x1d')](moment()['format']('x'));}if(_0x2225e7){this['voiceStatus']=_0x2225e7;}var _0x1c9af6={'id':this['id'],'name':this[_0xd67c('0x9')],'email':this[_0xd67c('0xa')],'accountcode':this[_0xd67c('0xb')],'fullname':this[_0xd67c('0xc')],'state':this[_0xd67c('0xd')],'stateTime':this['stateTime'],'status':this[_0xd67c('0x1e')],'address':this[_0xd67c('0x10')],'online':this[_0xd67c('0x13')],'voiceStatus':this[_0xd67c('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xd67c('0x16')],'voiceStatusQueue':this[_0xd67c('0x17')],'interface':this[_0xd67c('0x1f')],'onhold':this[_0xd67c('0x18')]};var _0x3ffeac=md5(JSON['stringify'](_0x1c9af6));if(this['md5']!==_0x3ffeac){this[_0xd67c('0x2')]=_0x3ffeac;io['to'](util[_0xd67c('0x20')](_0xd67c('0x21'),_0x1c9af6[_0xd67c('0x9')]))[_0xd67c('0x22')]('user:save',_0x1c9af6);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 7fbaccc..57d701b 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 _0x453b=['temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated'];(function(_0x3603ee,_0x3b54fc){var _0x2cc814=function(_0x28da84){while(--_0x28da84){_0x3603ee['push'](_0x3603ee['shift']());}};_0x2cc814(++_0x3b54fc);}(_0x453b,0x164));var _0xb453=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x453b[_0x56c70f];return _0x3812ed;};'use strict';function Campaign(_0x264220){this['id']=_0x264220['id']||0x0;this[_0xb453('0x0')]=_0x264220[_0xb453('0x0')]||'';this[_0xb453('0x1')]=_0x264220[_0xb453('0x1')]||_0xb453('0x2');this[_0xb453('0x3')]=0x0;this[_0xb453('0x4')]=0x0;this[_0xb453('0x5')]=0x0;this[_0xb453('0x6')]=0x0;this[_0xb453('0x7')]='';this[_0xb453('0x8')]=!![];this[_0xb453('0x9')]=_0x264220[_0xb453('0x9')];this[_0xb453('0xa')]=_0x264220[_0xb453('0xa')];this['dialTimezone']=_0x264220[_0xb453('0xb')]||null;this[_0xb453('0xc')]=_0x264220['dialGlobalInterval']?_0x264220[_0xb453('0xc')]:null;this['dialOriginateCallerIdName']=_0x264220[_0xb453('0xd')];this[_0xb453('0xe')]=_0x264220[_0xb453('0xe')];this[_0xb453('0xf')]=_0x264220['dialOriginateTimeout']||0x1e;this[_0xb453('0x10')]=_0x264220[_0xb453('0x10')];this[_0xb453('0x11')]=_0x264220[_0xb453('0x11')];this[_0xb453('0x12')]=_0x264220[_0xb453('0x12')];this[_0xb453('0x13')]=_0x264220[_0xb453('0x13')];this[_0xb453('0x14')]=_0x264220['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x264220['dialNoAnswerRetryFrequency'];this[_0xb453('0x15')]=_0x264220['dialGlobalMaxRetry'];this[_0xb453('0x16')]=_0x264220[_0xb453('0x16')]||_0xb453('0x17');this['dialPrefix']=_0x264220['dialPrefix']||undefined;this[_0xb453('0x18')]=_0x264220[_0xb453('0x18')]||undefined;this[_0xb453('0x19')]=_0x264220[_0xb453('0x19')]||undefined;this[_0xb453('0x1a')]=_0x264220[_0xb453('0x1a')]?_0x264220[_0xb453('0x1a')]:undefined;this[_0xb453('0x1b')]=_0x264220[_0xb453('0x1b')]?_0x264220['Trunk']:undefined;this['Interval']=_0x264220['Interval']?_0x264220['Interval']:undefined;this[_0xb453('0x1c')]=_0x264220[_0xb453('0x1c')]?_0x264220[_0xb453('0x1c')]:undefined;this[_0xb453('0x1d')]=_0x264220[_0xb453('0x1c')]?_0x264220[_0xb453('0x1c')]['name']:undefined;this['dialAMDActive']=_0x264220['dialAMDActive']||![];this[_0xb453('0x1e')]=_0x264220['dialAMDInitialSilence'];this[_0xb453('0x1f')]=_0x264220[_0xb453('0x1f')];this[_0xb453('0x20')]=_0x264220[_0xb453('0x20')];this[_0xb453('0x21')]=_0x264220[_0xb453('0x21')];this[_0xb453('0x22')]=_0x264220[_0xb453('0x22')];this[_0xb453('0x23')]=_0x264220['dialAMDBetweenWordsSilence'];this[_0xb453('0x24')]=_0x264220[_0xb453('0x24')];this[_0xb453('0x25')]=_0x264220[_0xb453('0x25')];this[_0xb453('0x26')]=_0x264220[_0xb453('0x26')];}module[_0xb453('0x27')]=Campaign; \ No newline at end of file +var _0x8130=['campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type'];(function(_0x3cd24e,_0x212e0b){var _0x3e45b2=function(_0x4aeda1){while(--_0x4aeda1){_0x3cd24e['push'](_0x3cd24e['shift']());}};_0x3e45b2(++_0x212e0b);}(_0x8130,0x146));var _0x0813=function(_0x18beb8,_0x1b96fd){_0x18beb8=_0x18beb8-0x0;var _0x3f66b7=_0x8130[_0x18beb8];return _0x3f66b7;};'use strict';function Campaign(_0x1f62c4){this['id']=_0x1f62c4['id']||0x0;this[_0x0813('0x0')]=_0x1f62c4['name']||'';this[_0x0813('0x1')]=_0x1f62c4[_0x0813('0x1')]||_0x0813('0x2');this[_0x0813('0x3')]=0x0;this[_0x0813('0x4')]=0x0;this[_0x0813('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x0813('0x6')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x1f62c4[_0x0813('0x7')];this[_0x0813('0x8')]=_0x1f62c4[_0x0813('0x8')];this[_0x0813('0x9')]=_0x1f62c4[_0x0813('0x9')]||null;this[_0x0813('0xa')]=_0x1f62c4[_0x0813('0xa')]?_0x1f62c4['dialGlobalInterval']:null;this[_0x0813('0xb')]=_0x1f62c4[_0x0813('0xb')];this[_0x0813('0xc')]=_0x1f62c4['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x1f62c4[_0x0813('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x1f62c4[_0x0813('0xe')];this['dialCongestionRetryFrequency']=_0x1f62c4[_0x0813('0xf')];this[_0x0813('0x10')]=_0x1f62c4[_0x0813('0x10')];this[_0x0813('0x11')]=_0x1f62c4['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1f62c4[_0x0813('0x12')];this[_0x0813('0x13')]=_0x1f62c4['dialNoAnswerRetryFrequency'];this[_0x0813('0x14')]=_0x1f62c4['dialGlobalMaxRetry'];this['dialOrderByScheduledAt']=_0x1f62c4[_0x0813('0x15')]||_0x0813('0x16');this['dialPrefix']=_0x1f62c4[_0x0813('0x17')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1f62c4[_0x0813('0x18')]||undefined;this[_0x0813('0x19')]=_0x1f62c4[_0x0813('0x19')]||undefined;this[_0x0813('0x1a')]=_0x1f62c4[_0x0813('0x1a')]?_0x1f62c4[_0x0813('0x1a')]:undefined;this[_0x0813('0x1b')]=_0x1f62c4[_0x0813('0x1b')]?_0x1f62c4['Trunk']:undefined;this[_0x0813('0x1c')]=_0x1f62c4['Interval']?_0x1f62c4[_0x0813('0x1c')]:undefined;this[_0x0813('0x1d')]=_0x1f62c4['SquareProject']?_0x1f62c4[_0x0813('0x1d')]:undefined;this[_0x0813('0x1e')]=_0x1f62c4['SquareProject']?_0x1f62c4[_0x0813('0x1d')][_0x0813('0x0')]:undefined;this['dialAMDActive']=_0x1f62c4[_0x0813('0x1f')]||![];this[_0x0813('0x20')]=_0x1f62c4[_0x0813('0x20')];this[_0x0813('0x21')]=_0x1f62c4[_0x0813('0x21')];this['dialAMDAfterGreetingSilence']=_0x1f62c4[_0x0813('0x22')];this[_0x0813('0x23')]=_0x1f62c4[_0x0813('0x23')];this['dialAMDMinWordLength']=_0x1f62c4[_0x0813('0x24')];this['dialAMDBetweenWordsSilence']=_0x1f62c4['dialAMDBetweenWordsSilence'];this[_0x0813('0x25')]=_0x1f62c4['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1f62c4[_0x0813('0x26')];this[_0x0813('0x27')]=_0x1f62c4[_0x0813('0x27')];}module[_0x0813('0x28')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1992178..6586267 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 _0x1f92=['abandoned','lastapplication','duration','billableseconds','holdtime','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged'];(function(_0x28621b,_0x12fbbd){var _0x2c4d22=function(_0x324d34){while(--_0x324d34){_0x28621b['push'](_0x28621b['shift']());}};_0x2c4d22(++_0x12fbbd);}(_0x1f92,0x1ad));var _0x21f9=function(_0x4562ef,_0x4fc87d){_0x4562ef=_0x4562ef-0x0;var _0x19886d=_0x1f92[_0x4562ef];return _0x19886d;};'use strict';function Channel(){this[_0x21f9('0x0')]=null;this['channel']='';this[_0x21f9('0x1')]='';this[_0x21f9('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x21f9('0x3')]=undefined;this[_0x21f9('0x4')]=0x0;this[_0x21f9('0x5')]='';this[_0x21f9('0x6')]=0x0;this[_0x21f9('0x7')]=0x0;this[_0x21f9('0x8')]=0x0;this[_0x21f9('0x9')]=![];this[_0x21f9('0xa')]=null;this[_0x21f9('0xb')]=null;this[_0x21f9('0xc')]=![];this[_0x21f9('0xd')]=![];this[_0x21f9('0xe')]='';this['lastdata']='';this[_0x21f9('0xf')]=0x0;this[_0x21f9('0x10')]=0x0;this[_0x21f9('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x21f9('0x12')]=null;this[_0x21f9('0x13')]=![];this['monitorFilename']=null;this[_0x21f9('0x14')]=null;this[_0x21f9('0x15')]=[];this[_0x21f9('0x16')]=undefined;this[_0x21f9('0x17')]=undefined;this[_0x21f9('0x18')]=0x0;}module[_0x21f9('0x19')]=Channel; \ No newline at end of file +var _0x66da=['holdtime','type','tag','disposition','monitorFilename','queue','mohtime','starttime','channel','destinationchannel','calleridnum','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x66da,0x16f));var _0xa66d=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x66da[_0x1b3a5c];return _0x2ae8cb;};'use strict';function Channel(){this[_0xa66d('0x0')]=null;this[_0xa66d('0x1')]='';this[_0xa66d('0x2')]='';this[_0xa66d('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa66d('0x4')]=0x0;this[_0xa66d('0x5')]='';this[_0xa66d('0x6')]=0x0;this[_0xa66d('0x7')]=0x0;this[_0xa66d('0x8')]=0x0;this['answered']=![];this[_0xa66d('0x9')]=null;this[_0xa66d('0xa')]=null;this[_0xa66d('0xb')]=![];this[_0xa66d('0xc')]=![];this[_0xa66d('0xd')]='';this[_0xa66d('0xe')]='';this[_0xa66d('0xf')]=0x0;this[_0xa66d('0x10')]=0x0;this[_0xa66d('0x11')]=0x0;this[_0xa66d('0x12')]=null;this[_0xa66d('0x13')]=null;this[_0xa66d('0x14')]=null;this['monitor']=![];this[_0xa66d('0x15')]=null;this[_0xa66d('0x16')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0xa66d('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e8f56ab..543a7d6 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 _0x6114=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x6114,0x180));var _0x4611=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x6114[_0x23c6f2];return _0x4c270b;};'use strict';function DeskAccount(_0x1515f2){this['id']=_0x1515f2['id']||0x0;this[_0x4611('0x0')]=_0x1515f2[_0x4611('0x0')]||'';this[_0x4611('0x1')]=_0x1515f2[_0x4611('0x1')]||'';this[_0x4611('0x2')]=_0x1515f2[_0x4611('0x2')]||'';this['authType']=_0x1515f2[_0x4611('0x3')]||'';this[_0x4611('0x4')]=_0x1515f2['password']||'';this[_0x4611('0x5')]=_0x1515f2[_0x4611('0x5')]||'';this['consumerSecret']=_0x1515f2[_0x4611('0x6')]||'';this[_0x4611('0x7')]=_0x1515f2[_0x4611('0x7')]||'';this[_0x4611('0x8')]=_0x1515f2[_0x4611('0x8')]||'';this[_0x4611('0x9')]=_0x1515f2[_0x4611('0x9')]||'';this[_0x4611('0xa')]=_0x1515f2[_0x4611('0xa')]||'';this[_0x4611('0xb')]=_0x1515f2['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x679a=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x40a31b,_0x56bf74){var _0x5e6391=function(_0x21d7b2){while(--_0x21d7b2){_0x40a31b['push'](_0x40a31b['shift']());}};_0x5e6391(++_0x56bf74);}(_0x679a,0x1c3));var _0xa679=function(_0x3ad965,_0x243137){_0x3ad965=_0x3ad965-0x0;var _0xfd3587=_0x679a[_0x3ad965];return _0xfd3587;};'use strict';function DeskAccount(_0x33dc58){this['id']=_0x33dc58['id']||0x0;this[_0xa679('0x0')]=_0x33dc58[_0xa679('0x0')]||'';this[_0xa679('0x1')]=_0x33dc58['username']||'';this['remoteUri']=_0x33dc58[_0xa679('0x2')]||'';this[_0xa679('0x3')]=_0x33dc58[_0xa679('0x3')]||'';this[_0xa679('0x4')]=_0x33dc58[_0xa679('0x4')]||'';this[_0xa679('0x5')]=_0x33dc58[_0xa679('0x5')]||'';this[_0xa679('0x6')]=_0x33dc58[_0xa679('0x6')]||'';this[_0xa679('0x7')]=_0x33dc58['token']||'';this['tokenSecret']=_0x33dc58[_0xa679('0x8')]||'';this['type']=_0x33dc58[_0xa679('0x9')]||'';this[_0xa679('0xa')]=_0x33dc58[_0xa679('0xa')]||'';this[_0xa679('0xb')]=_0x33dc58[_0xa679('0xb')]||{};}module[_0xa679('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ec7341f..46ab1c7 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 _0x1e79=['remoteUri','tenantId','clientId','serverUrl','Configurations','exports','name','username','password'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1e79,0x14a));var _0x91e7=function(_0x18c0ca,_0x1f4c22){_0x18c0ca=_0x18c0ca-0x0;var _0x2e9c71=_0x1e79[_0x18c0ca];return _0x2e9c71;};'use strict';function Dynamics365Account(_0x1345fb){this['id']=_0x1345fb['id']||0x0;this['name']=_0x1345fb[_0x91e7('0x0')]||'';this['username']=_0x1345fb[_0x91e7('0x1')]||'';this['password']=_0x1345fb[_0x91e7('0x2')]||'';this[_0x91e7('0x3')]=_0x1345fb[_0x91e7('0x3')]||'';this[_0x91e7('0x4')]=_0x1345fb[_0x91e7('0x4')]||'';this['clientId']=_0x1345fb[_0x91e7('0x5')]||'';this['clientSecret']=_0x1345fb['clientSecret']||{};this[_0x91e7('0x6')]=_0x1345fb[_0x91e7('0x6')]||'';this['Configurations']=_0x1345fb[_0x91e7('0x7')]||{};}module[_0x91e7('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x1fcc=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','name'];(function(_0x511b07,_0x5b4a5c){var _0x1e691f=function(_0x80e8ea){while(--_0x80e8ea){_0x511b07['push'](_0x511b07['shift']());}};_0x1e691f(++_0x5b4a5c);}(_0x1fcc,0x16f));var _0xc1fc=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x1fcc[_0x179e11];return _0x549f04;};'use strict';function Dynamics365Account(_0x3eb805){this['id']=_0x3eb805['id']||0x0;this[_0xc1fc('0x0')]=_0x3eb805[_0xc1fc('0x0')]||'';this[_0xc1fc('0x1')]=_0x3eb805[_0xc1fc('0x1')]||'';this[_0xc1fc('0x2')]=_0x3eb805[_0xc1fc('0x2')]||'';this[_0xc1fc('0x3')]=_0x3eb805['remoteUri']||'';this[_0xc1fc('0x4')]=_0x3eb805['tenantId']||'';this[_0xc1fc('0x5')]=_0x3eb805[_0xc1fc('0x5')]||'';this[_0xc1fc('0x6')]=_0x3eb805[_0xc1fc('0x6')]||{};this[_0xc1fc('0x7')]=_0x3eb805[_0xc1fc('0x7')]||'';this['Configurations']=_0x3eb805['Configurations']||{};}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 255a1c1..0ce768f 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 _0x9bde=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x201bff,_0xb1a023){var _0x385b0f=function(_0x594f16){while(--_0x594f16){_0x201bff['push'](_0x201bff['shift']());}};_0x385b0f(++_0xb1a023);}(_0x9bde,0xe1));var _0xe9bd=function(_0x37cebe,_0x209f63){_0x37cebe=_0x37cebe-0x0;var _0x5e4a32=_0x9bde[_0x37cebe];return _0x5e4a32;};'use strict';function FaxAccount(_0x284147){this['id']=_0x284147['id']||0x0;this[_0xe9bd('0x0')]=_0x284147['name']||'';this[_0xe9bd('0x1')]=_0x284147['description'];this[_0xe9bd('0x2')]=_0x284147[_0xe9bd('0x2')];this[_0xe9bd('0x3')]=_0x284147[_0xe9bd('0x3')];this[_0xe9bd('0x4')]=_0x284147[_0xe9bd('0x4')];this[_0xe9bd('0x5')]=_0x284147['minrate']||0x960;this[_0xe9bd('0x6')]=_0x284147[_0xe9bd('0x6')]||0x3840;this[_0xe9bd('0x7')]=_0x284147[_0xe9bd('0x7')]||_0xe9bd('0x8');this[_0xe9bd('0x9')]=_0x284147[_0xe9bd('0x9')]||'no';this[_0xe9bd('0xa')]=_0x284147[_0xe9bd('0xa')]||'no';this[_0xe9bd('0xb')]=_0x284147['t38timeout']||0x1388;this['tech']=_0x284147[_0xe9bd('0xc')]||_0xe9bd('0xd');this[_0xe9bd('0xe')]=_0x284147['Trunk']?_0x284147[_0xe9bd('0xe')]:undefined;this[_0xe9bd('0xf')]=_0x284147[_0xe9bd('0xf')];this[_0xe9bd('0x10')]=_0x284147['key'];}module[_0xe9bd('0x11')]=FaxAccount; \ No newline at end of file +var _0x593e=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x5a93f0,_0x172b1b){var _0x53844d=function(_0x19ba69){while(--_0x19ba69){_0x5a93f0['push'](_0x5a93f0['shift']());}};_0x53844d(++_0x172b1b);}(_0x593e,0xcb));var _0xe593=function(_0x57e3fb,_0x1b68c7){_0x57e3fb=_0x57e3fb-0x0;var _0x244cd2=_0x593e[_0x57e3fb];return _0x244cd2;};'use strict';function FaxAccount(_0x49a30d){this['id']=_0x49a30d['id']||0x0;this[_0xe593('0x0')]=_0x49a30d[_0xe593('0x0')]||'';this[_0xe593('0x1')]=_0x49a30d[_0xe593('0x1')];this[_0xe593('0x2')]=_0x49a30d[_0xe593('0x2')];this[_0xe593('0x3')]=_0x49a30d['headerinfo'];this[_0xe593('0x4')]=_0x49a30d[_0xe593('0x4')];this[_0xe593('0x5')]=_0x49a30d[_0xe593('0x5')]||0x960;this[_0xe593('0x6')]=_0x49a30d[_0xe593('0x6')]||0x3840;this[_0xe593('0x7')]=_0x49a30d[_0xe593('0x7')]||_0xe593('0x8');this[_0xe593('0x9')]=_0x49a30d['gateway']||'no';this[_0xe593('0xa')]=_0x49a30d[_0xe593('0xa')]||'no';this[_0xe593('0xb')]=_0x49a30d['t38timeout']||0x1388;this['tech']=_0x49a30d[_0xe593('0xc')]||_0xe593('0xd');this[_0xe593('0xe')]=_0x49a30d['Trunk']?_0x49a30d[_0xe593('0xe')]:undefined;this[_0xe593('0xf')]=_0x49a30d[_0xe593('0xf')];this[_0xe593('0x10')]=_0x49a30d[_0xe593('0x10')];}module[_0xe593('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3bc3fc0..21f8644 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 _0x094b=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x094b,0x184));var _0xb094=function(_0x5ad620,_0x5f3b7b){_0x5ad620=_0x5ad620-0x0;var _0x139ba9=_0x094b[_0x5ad620];return _0x139ba9;};'use strict';function FreshdeskAccount(_0x2e4d79){this['id']=_0x2e4d79['id']||0x0;this['name']=_0x2e4d79[_0xb094('0x0')]||'';this[_0xb094('0x1')]=_0x2e4d79['username']||'';this[_0xb094('0x2')]=_0x2e4d79[_0xb094('0x3')]||'';this[_0xb094('0x4')]=_0x2e4d79[_0xb094('0x4')]||'';this['serverUrl']=_0x2e4d79[_0xb094('0x5')]||'';this[_0xb094('0x6')]=_0x2e4d79[_0xb094('0x6')]||{};}module[_0xb094('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x64dd=['token','remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x516f5a,_0x2baa3f){var _0x34c5f9=function(_0x41c6c9){while(--_0x41c6c9){_0x516f5a['push'](_0x516f5a['shift']());}};_0x34c5f9(++_0x2baa3f);}(_0x64dd,0x82));var _0xd64d=function(_0x19d74c,_0x1f8d78){_0x19d74c=_0x19d74c-0x0;var _0x2fa77c=_0x64dd[_0x19d74c];return _0x2fa77c;};'use strict';function FreshdeskAccount(_0x10e19e){this['id']=_0x10e19e['id']||0x0;this[_0xd64d('0x0')]=_0x10e19e['name']||'';this[_0xd64d('0x1')]=_0x10e19e[_0xd64d('0x1')]||'';this[_0xd64d('0x2')]=_0x10e19e[_0xd64d('0x3')]||'';this[_0xd64d('0x4')]=_0x10e19e[_0xd64d('0x4')]||'';this[_0xd64d('0x5')]=_0x10e19e[_0xd64d('0x5')]||'';this['Configurations']=_0x10e19e['Configurations']||{};}module[_0xd64d('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 034ea52..11596d0 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 _0xb3de=['exports','type','inbound','uniqueid','calleridnum','calleridname','queue','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','accountcode','exten','priority','assigned','lastAssignedTo','mohtime','variables'];(function(_0x5f1813,_0x2e4909){var _0x5b3b08=function(_0xad70fd){while(--_0xad70fd){_0x5f1813['push'](_0x5f1813['shift']());}};_0x5b3b08(++_0x2e4909);}(_0xb3de,0x1e4));var _0xeb3d=function(_0x2fd642,_0x460c31){_0x2fd642=_0x2fd642-0x0;var _0x350476=_0xb3de[_0x2fd642];return _0x350476;};'use strict';function QueueReport(){this[_0xeb3d('0x0')]=_0xeb3d('0x1');this[_0xeb3d('0x2')]='';this[_0xeb3d('0x3')]='';this[_0xeb3d('0x4')]='';this[_0xeb3d('0x5')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xeb3d('0x6')]=0x1;this[_0xeb3d('0x7')]=0x1;this[_0xeb3d('0x8')]=![];this[_0xeb3d('0x9')]=null;this[_0xeb3d('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xeb3d('0xb')]=![];this[_0xeb3d('0xc')]=null;this[_0xeb3d('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xeb3d('0xe')]='';this[_0xeb3d('0xf')]='';this['context']='';this[_0xeb3d('0x10')]='';this[_0xeb3d('0x11')]='';this['holdtime']=0x0;this[_0xeb3d('0x12')]=![];this[_0xeb3d('0x13')]='';this[_0xeb3d('0x14')]=0x0;this[_0xeb3d('0x15')]={};}module[_0xeb3d('0x16')]=QueueReport; \ No newline at end of file +var _0xa5ae=['holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x319a37,_0x2890a9){var _0x54cffb=function(_0x2b6a26){while(--_0x2b6a26){_0x319a37['push'](_0x319a37['shift']());}};_0x54cffb(++_0x2890a9);}(_0xa5ae,0x157));var _0xea5a=function(_0x591053,_0x523072){_0x591053=_0x591053-0x0;var _0x31ab80=_0xa5ae[_0x591053];return _0x31ab80;};'use strict';function QueueReport(){this[_0xea5a('0x0')]=_0xea5a('0x1');this[_0xea5a('0x2')]='';this['calleridnum']='';this[_0xea5a('0x3')]='';this['queue']='';this[_0xea5a('0x4')]=null;this[_0xea5a('0x5')]=null;this[_0xea5a('0x6')]=0x1;this[_0xea5a('0x7')]=0x1;this[_0xea5a('0x8')]=![];this[_0xea5a('0x9')]=null;this[_0xea5a('0xa')]=![];this[_0xea5a('0xb')]=null;this[_0xea5a('0xc')]=![];this[_0xea5a('0xd')]=null;this['originalposition']=0x1;this[_0xea5a('0xe')]='';this[_0xea5a('0xf')]='';this[_0xea5a('0x10')]='';this[_0xea5a('0x11')]='';this[_0xea5a('0x12')]='';this[_0xea5a('0x13')]='';this[_0xea5a('0x14')]='';this[_0xea5a('0x15')]=0x0;this[_0xea5a('0x16')]=![];this[_0xea5a('0x17')]='';this['mohtime']=0x0;this[_0xea5a('0x18')]={};}module[_0xea5a('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index de8655d..7e10228 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 _0x93ab=['Configurations','name','username','remoteUri','password','clientId','clientSecret','type','serverUrl'];(function(_0x352b34,_0xad5796){var _0x4789f5=function(_0x23e1c5){while(--_0x23e1c5){_0x352b34['push'](_0x352b34['shift']());}};_0x4789f5(++_0xad5796);}(_0x93ab,0x172));var _0xb93a=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x93ab[_0x2bbc07];return _0x6879e4;};'use strict';function SalesforceAccount(_0x2bf600){this['id']=_0x2bf600['id']||0x0;this[_0xb93a('0x0')]=_0x2bf600[_0xb93a('0x0')]||'';this[_0xb93a('0x1')]=_0x2bf600[_0xb93a('0x1')]||'';this['remoteUri']=_0x2bf600[_0xb93a('0x2')]||'';this[_0xb93a('0x3')]=_0x2bf600['password']||'';this[_0xb93a('0x4')]=_0x2bf600[_0xb93a('0x4')]||'';this[_0xb93a('0x5')]=_0x2bf600[_0xb93a('0x5')]||'';this['securityToken']=_0x2bf600['securityToken']||'';this[_0xb93a('0x6')]=_0x2bf600[_0xb93a('0x6')]||'integrationTab';this[_0xb93a('0x7')]=_0x2bf600[_0xb93a('0x7')]||'';this[_0xb93a('0x8')]=_0x2bf600[_0xb93a('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x83ad=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','password','clientId','clientSecret'];(function(_0x411d4b,_0x8ce248){var _0x3ef5c3=function(_0x2f48cc){while(--_0x2f48cc){_0x411d4b['push'](_0x411d4b['shift']());}};_0x3ef5c3(++_0x8ce248);}(_0x83ad,0x8a));var _0xd83a=function(_0x76e13f,_0x5c3b98){_0x76e13f=_0x76e13f-0x0;var _0x4ec18c=_0x83ad[_0x76e13f];return _0x4ec18c;};'use strict';function SalesforceAccount(_0x336b28){this['id']=_0x336b28['id']||0x0;this[_0xd83a('0x0')]=_0x336b28[_0xd83a('0x0')]||'';this['username']=_0x336b28[_0xd83a('0x1')]||'';this['remoteUri']=_0x336b28['remoteUri']||'';this['password']=_0x336b28[_0xd83a('0x2')]||'';this[_0xd83a('0x3')]=_0x336b28[_0xd83a('0x3')]||'';this[_0xd83a('0x4')]=_0x336b28[_0xd83a('0x4')]||'';this[_0xd83a('0x5')]=_0x336b28['securityToken']||'';this['type']=_0x336b28[_0xd83a('0x6')]||_0xd83a('0x7');this[_0xd83a('0x8')]=_0x336b28[_0xd83a('0x8')]||'';this[_0xd83a('0x9')]=_0x336b28['Configurations']||{};}module[_0xd83a('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 73f077e..b9f060a 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 _0xc1ee=['serverUrl','Configurations','exports','name','username','password'];(function(_0x462891,_0x27a139){var _0x1beda6=function(_0x14d847){while(--_0x14d847){_0x462891['push'](_0x462891['shift']());}};_0x1beda6(++_0x27a139);}(_0xc1ee,0x105));var _0xec1e=function(_0x361866,_0x3a953b){_0x361866=_0x361866-0x0;var _0x135111=_0xc1ee[_0x361866];return _0x135111;};'use strict';function ServicenowAccount(_0x216807){this['id']=_0x216807['id']||0x0;this[_0xec1e('0x0')]=_0x216807[_0xec1e('0x0')]||'';this[_0xec1e('0x1')]=_0x216807[_0xec1e('0x1')]||'';this['password']=_0x216807[_0xec1e('0x2')]||'';this['remoteUri']=_0x216807['remoteUri']||'';this['serverUrl']=_0x216807[_0xec1e('0x3')]||'';this[_0xec1e('0x4')]=_0x216807[_0xec1e('0x4')]||{};}module[_0xec1e('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x6489=['exports','name','username','remoteUri','serverUrl'];(function(_0x7a04f8,_0xc720e6){var _0x560a41=function(_0x6efb68){while(--_0x6efb68){_0x7a04f8['push'](_0x7a04f8['shift']());}};_0x560a41(++_0xc720e6);}(_0x6489,0x97));var _0x9648=function(_0x366e1a,_0x578e72){_0x366e1a=_0x366e1a-0x0;var _0x12ac2f=_0x6489[_0x366e1a];return _0x12ac2f;};'use strict';function ServicenowAccount(_0x949076){this['id']=_0x949076['id']||0x0;this[_0x9648('0x0')]=_0x949076[_0x9648('0x0')]||'';this[_0x9648('0x1')]=_0x949076[_0x9648('0x1')]||'';this['password']=_0x949076['password']||'';this[_0x9648('0x2')]=_0x949076[_0x9648('0x2')]||'';this[_0x9648('0x3')]=_0x949076[_0x9648('0x3')]||'';this['Configurations']=_0x949076['Configurations']||{};}module[_0x9648('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 2eabe60..e58afab 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 _0x0734=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3a72a4,_0x5c9292){var _0x556f7f=function(_0x1da2c6){while(--_0x1da2c6){_0x3a72a4['push'](_0x3a72a4['shift']());}};_0x556f7f(++_0x5c9292);}(_0x0734,0x158));var _0x4073=function(_0x41abd8,_0x52f504){_0x41abd8=_0x41abd8-0x0;var _0xfc036b=_0x0734[_0x41abd8];return _0xfc036b;};'use strict';function SugarcrmAccount(_0x3b8a6a){this['id']=_0x3b8a6a['id']||0x0;this[_0x4073('0x0')]=_0x3b8a6a['name']||'';this[_0x4073('0x1')]=_0x3b8a6a[_0x4073('0x1')]||'';this[_0x4073('0x2')]=_0x3b8a6a['password']||'';this['remoteUri']=_0x3b8a6a[_0x4073('0x3')]||'';this[_0x4073('0x4')]=_0x3b8a6a['serverUrl']||'';this['Configurations']=_0x3b8a6a[_0x4073('0x5')]||{};}module[_0x4073('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x4318=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x34ebc6,_0x201e65){var _0x16f800=function(_0x2c72fc){while(--_0x2c72fc){_0x34ebc6['push'](_0x34ebc6['shift']());}};_0x16f800(++_0x201e65);}(_0x4318,0x129));var _0x8431=function(_0x23f49a,_0x4b864c){_0x23f49a=_0x23f49a-0x0;var _0xecf345=_0x4318[_0x23f49a];return _0xecf345;};'use strict';function SugarcrmAccount(_0x2a37ec){this['id']=_0x2a37ec['id']||0x0;this[_0x8431('0x0')]=_0x2a37ec[_0x8431('0x0')]||'';this[_0x8431('0x1')]=_0x2a37ec[_0x8431('0x1')]||'';this[_0x8431('0x2')]=_0x2a37ec[_0x8431('0x2')]||'';this[_0x8431('0x3')]=_0x2a37ec[_0x8431('0x3')]||'';this[_0x8431('0x4')]=_0x2a37ec[_0x8431('0x4')]||'';this['Configurations']=_0x2a37ec[_0x8431('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b5e9931..6acc848 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 _0xb04e=['name','accountcode','state','stateTime','unknown','exports'];(function(_0x1b87a6,_0x4b11a0){var _0x3f2b76=function(_0xb685ec){while(--_0xb685ec){_0x1b87a6['push'](_0x1b87a6['shift']());}};_0x3f2b76(++_0x4b11a0);}(_0xb04e,0x72));var _0xeb04=function(_0x28e854,_0x283f50){_0x28e854=_0x28e854-0x0;var _0x158a4b=_0xb04e[_0x28e854];return _0x158a4b;};'use strict';function Telephone(_0x1b0896){this['id']=_0x1b0896['id']||0x0;this[_0xeb04('0x0')]=_0x1b0896[_0xeb04('0x0')]||'';this[_0xeb04('0x1')]=_0x1b0896[_0xeb04('0x1')]||'';this[_0xeb04('0x2')]='unknown';this[_0xeb04('0x3')]=0x0;this['status']=_0xeb04('0x4');this['address']='';}module[_0xeb04('0x5')]=Telephone; \ No newline at end of file +var _0x3427=['name','accountcode','unknown','stateTime','status','address','exports'];(function(_0x21c2bd,_0x5a7979){var _0x3bc023=function(_0x5da6e8){while(--_0x5da6e8){_0x21c2bd['push'](_0x21c2bd['shift']());}};_0x3bc023(++_0x5a7979);}(_0x3427,0x196));var _0x7342=function(_0x22c57f,_0x4af9d5){_0x22c57f=_0x22c57f-0x0;var _0x3037dd=_0x3427[_0x22c57f];return _0x3037dd;};'use strict';function Telephone(_0x45a8ce){this['id']=_0x45a8ce['id']||0x0;this['name']=_0x45a8ce[_0x7342('0x0')]||'';this['accountcode']=_0x45a8ce[_0x7342('0x1')]||'';this['state']=_0x7342('0x2');this[_0x7342('0x3')]=0x0;this[_0x7342('0x4')]=_0x7342('0x2');this[_0x7342('0x5')]='';}module[_0x7342('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 9fceef8..3251a54 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 _0xe706=['exports','name','html'];(function(_0x49f52b,_0x3044ae){var _0xd7cfe8=function(_0x478534){while(--_0x478534){_0x49f52b['push'](_0x49f52b['shift']());}};_0xd7cfe8(++_0x3044ae);}(_0xe706,0xa3));var _0x6e70=function(_0x5aea3e,_0x20d237){_0x5aea3e=_0x5aea3e-0x0;var _0x558b7b=_0xe706[_0x5aea3e];return _0x558b7b;};'use strict';function template(_0x454c8f){this['id']=_0x454c8f['id']||0x0;this[_0x6e70('0x0')]=_0x454c8f[_0x6e70('0x0')]||'';this['html']=_0x454c8f[_0x6e70('0x1')]||'';}module[_0x6e70('0x2')]=template; \ No newline at end of file +var _0xcb91=['html','exports','name'];(function(_0x2e7ba6,_0x47980c){var _0x1b6a90=function(_0x59bcd1){while(--_0x59bcd1){_0x2e7ba6['push'](_0x2e7ba6['shift']());}};_0x1b6a90(++_0x47980c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xcb91[_0x467cb0];return _0x2153f7;};'use strict';function template(_0x181cac){this['id']=_0x181cac['id']||0x0;this['name']=_0x181cac[_0x1cb9('0x0')]||'';this[_0x1cb9('0x1')]=_0x181cac[_0x1cb9('0x1')]||'';}module[_0x1cb9('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 7a91860..b96d287 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 _0xc5d0=['AllConditions','AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0xc5d0,0xac));var _0x0c5d=function(_0x5805a2,_0x3cb76b){_0x5805a2=_0x5805a2-0x0;var _0x542db2=_0xc5d0[_0x5805a2];return _0x542db2;};'use strict';function Trigger(_0x29508e){this['id']=_0x29508e['id']||0x0;this[_0x0c5d('0x0')]=_0x29508e[_0x0c5d('0x0')]||'';this[_0x0c5d('0x1')]=_0x29508e[_0x0c5d('0x1')]||_0x0c5d('0x2');this[_0x0c5d('0x3')]=_0x29508e[_0x0c5d('0x3')]||![];this[_0x0c5d('0x4')]=_0x29508e[_0x0c5d('0x4')]||[];this[_0x0c5d('0x5')]=_0x29508e[_0x0c5d('0x5')]||[];this[_0x0c5d('0x6')]=_0x29508e[_0x0c5d('0x6')]||[];}module[_0x0c5d('0x7')]=Trigger; \ No newline at end of file +var _0x98ed=['exports','name','status','AllConditions','AnyConditions','Actions'];(function(_0x2eeb45,_0x2360f6){var _0x1e7c9f=function(_0x361d2d){while(--_0x361d2d){_0x2eeb45['push'](_0x2eeb45['shift']());}};_0x1e7c9f(++_0x2360f6);}(_0x98ed,0x121));var _0xd98e=function(_0x302a64,_0x191bf6){_0x302a64=_0x302a64-0x0;var _0xc4c71e=_0x98ed[_0x302a64];return _0xc4c71e;};'use strict';function Trigger(_0x582349){this['id']=_0x582349['id']||0x0;this[_0xd98e('0x0')]=_0x582349[_0xd98e('0x0')]||'';this['channel']=_0x582349['channel']||'voice';this[_0xd98e('0x1')]=_0x582349[_0xd98e('0x1')]||![];this[_0xd98e('0x2')]=_0x582349[_0xd98e('0x2')]||[];this[_0xd98e('0x3')]=_0x582349[_0xd98e('0x3')]||[];this[_0xd98e('0x4')]=_0x582349[_0xd98e('0x4')]||[];}module[_0xd98e('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e11c423..3cd04da 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 _0x1fb9=['active','state','unknown','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','exports'];(function(_0x3c0c3c,_0x11fd1a){var _0x14dc36=function(_0x3f4e5c){while(--_0x3f4e5c){_0x3c0c3c['push'](_0x3c0c3c['shift']());}};_0x14dc36(++_0x11fd1a);}(_0x1fb9,0x134));var _0x91fb=function(_0x17136b,_0x6e4a61){_0x17136b=_0x17136b-0x0;var _0x13842a=_0x1fb9[_0x17136b];return _0x13842a;};'use strict';function Trunk(_0x1952ff){this['id']=_0x1952ff['id']||0x0;this[_0x91fb('0x0')]=_0x1952ff[_0x91fb('0x0')]||![];this['name']=_0x1952ff['name']||'';this[_0x91fb('0x1')]='unknown';this['stateTime']=0x0;this['status']=_0x91fb('0x2');this[_0x91fb('0x3')]=_0x1952ff[_0x91fb('0x3')]&&_0x1952ff[_0x91fb('0x3')][_0x91fb('0x4')](':')?_0x1952ff[_0x91fb('0x3')][_0x91fb('0x5')](':')[0x0]:'';this[_0x91fb('0x6')]='';this[_0x91fb('0x7')]='';this[_0x91fb('0x8')]='';this[_0x91fb('0x9')]='';this['refresh']='';this[_0x91fb('0xa')]=_0x91fb('0x2');this[_0x91fb('0xb')]='';this[_0x91fb('0xc')]='';}module[_0x91fb('0xd')]=Trunk; \ No newline at end of file +var _0x4a49=['state','stateTime','status','registry','indexOf','host','domainport','refresh','stateRegistry','unknown','registrationtime','address','exports','active','name'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x4a49,0x94));var _0x94a4=function(_0xd85e8f,_0x3de287){_0xd85e8f=_0xd85e8f-0x0;var _0x5e2adf=_0x4a49[_0xd85e8f];return _0x5e2adf;};'use strict';function Trunk(_0x2b1568){this['id']=_0x2b1568['id']||0x0;this[_0x94a4('0x0')]=_0x2b1568[_0x94a4('0x0')]||![];this[_0x94a4('0x1')]=_0x2b1568[_0x94a4('0x1')]||'';this[_0x94a4('0x2')]='unknown';this[_0x94a4('0x3')]=0x0;this[_0x94a4('0x4')]='unknown';this[_0x94a4('0x5')]=_0x2b1568[_0x94a4('0x5')]&&_0x2b1568[_0x94a4('0x5')][_0x94a4('0x6')](':')?_0x2b1568[_0x94a4('0x5')]['split'](':')[0x0]:'';this[_0x94a4('0x7')]='';this['port']='';this['domain']='';this[_0x94a4('0x8')]='';this[_0x94a4('0x9')]='';this[_0x94a4('0xa')]=_0x94a4('0xb');this[_0x94a4('0xc')]='';this[_0x94a4('0xd')]='';}module[_0x94a4('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6b7df1c..3f63e38 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 _0x0de4=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x518e15,_0x568735){var _0x3bd658=function(_0x6a579f){while(--_0x6a579f){_0x518e15['push'](_0x518e15['shift']());}};_0x3bd658(++_0x568735);}(_0x0de4,0x6a));var _0x40de=function(_0x4baa52,_0x46ced4){_0x4baa52=_0x4baa52-0x0;var _0x4db836=_0x0de4[_0x4baa52];return _0x4db836;};'use strict';function voiceExtension(_0x1425ac){this['id']=_0x1425ac['id']||0x0;this[_0x40de('0x0')]=_0x1425ac[_0x40de('0x0')]||'';this[_0x40de('0x1')]=_0x1425ac['recordingFormat']||'none';this[_0x40de('0x2')]=_0x1425ac[_0x40de('0x2')]||![];}module[_0x40de('0x3')]=voiceExtension; \ No newline at end of file +var _0x038f=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x256b67,_0x14e47b){var _0x3e2d99=function(_0x4a4c5f){while(--_0x4a4c5f){_0x256b67['push'](_0x256b67['shift']());}};_0x3e2d99(++_0x14e47b);}(_0x038f,0xf3));var _0xf038=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x038f[_0x5235dd];return _0x13059d;};'use strict';function voiceExtension(_0x2e5d46){this['id']=_0x2e5d46['id']||0x0;this['exten']=_0x2e5d46[_0xf038('0x0')]||'';this[_0xf038('0x1')]=_0x2e5d46[_0xf038('0x1')]||_0xf038('0x2');this[_0xf038('0x3')]=_0x2e5d46['mandatoryDisposition']||![];}module[_0xf038('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 498e268..13b7979 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 _0x2212=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x2212,0x13d));var _0x2221=function(_0x44d427,_0x29ffb8){_0x44d427=_0x44d427-0x0;var _0x32b949=_0x2212[_0x44d427];return _0x32b949;};'use strict';var statusDesc=[_0x2221('0x0'),_0x2221('0x1'),'inuse',_0x2221('0x2'),_0x2221('0x3'),_0x2221('0x4'),_0x2221('0x5'),'ringinuse','onhold'];var monitorFormat={'wav':_0x2221('0x6'),'wav49':_0x2221('0x7'),'gsm':_0x2221('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x2221('0x9')};function VoiceQueue(_0x138884){this['id']=_0x138884['id']||0x0;this[_0x2221('0xa')]=_0x138884[_0x2221('0xa')]||'';this['monitor_format']=_0x138884[_0x2221('0xb')]||'';this['type']=_0x138884[_0x2221('0xc')]||_0x2221('0xd');this[_0x2221('0xe')]=0x0;this['talking']=0x0;this[_0x2221('0xf')]=0x0;this[_0x2221('0x10')]=0x0;this[_0x2221('0x11')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x2221('0x12')]=0x0;this[_0x2221('0x13')]=0x0;this['loggedIn']=0x0;this[_0x2221('0x14')]=0x0;this[_0x2221('0x15')]=_0x138884[_0x2221('0x15')]||![];this['acwTimeout']=_0x138884[_0x2221('0x16')]||0xa;this[_0x2221('0x17')]=_0x138884[_0x2221('0x17')]||'no';this[_0x2221('0x18')]=!![];this['message']='';this[_0x2221('0x19')]=0x0;this[_0x2221('0x1a')]=0x0;this[_0x2221('0x1b')]=_0x138884[_0x2221('0x1b')]||null;this[_0x2221('0x1c')]=_0x138884[_0x2221('0x1c')]?_0x138884[_0x2221('0x1c')]:null;this[_0x2221('0x1d')]=_0x138884[_0x2221('0x1d')];this[_0x2221('0x1e')]=_0x138884[_0x2221('0x1e')]||_0x2221('0x1f');this['dialLimitChannel']=_0x138884['dialLimitChannel']||0x0;this[_0x2221('0x20')]=_0x138884[_0x2221('0x20')]||0x0;this[_0x2221('0x21')]=_0x138884[_0x2221('0x21')]||0x1;this[_0x2221('0x22')]=_0x138884['dialPredictiveOptimization']||'dropRate';this[_0x2221('0x23')]=_0x138884[_0x2221('0x23')]||0.03;this[_0x2221('0x24')]=_0x138884[_0x2221('0x24')]||0x258;this[_0x2221('0x25')]=_0x138884[_0x2221('0x25')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x138884[_0x2221('0x26')]||'anonymous';this[_0x2221('0x27')]=_0x138884[_0x2221('0x27')]||0x1e;this['dialQueueOptions']=_0x138884[_0x2221('0x28')]||_0x2221('0x29');this[_0x2221('0x2a')]=_0x138884[_0x2221('0x2a')]||0x3;this[_0x2221('0x2b')]=_0x138884[_0x2221('0x2b')]||undefined;this['dialCongestionMaxRetry']=_0x138884[_0x2221('0x2c')]||0x3;this['dialCongestionRetryFrequency']=_0x138884['dialCongestionRetryFrequency']||0x96;this[_0x2221('0x2d')]=_0x138884[_0x2221('0x2d')]||0x3;this[_0x2221('0x2e')]=_0x138884[_0x2221('0x2e')]||0x96;this[_0x2221('0x2f')]=_0x138884['dialNoAnswerMaxRetry']||0x3;this[_0x2221('0x30')]=_0x138884[_0x2221('0x30')]||0x96;this[_0x2221('0x31')]=_0x138884[_0x2221('0x31')]||0x4;this['Trunk']=_0x138884['Trunk']?_0x138884[_0x2221('0x32')]:undefined;this[_0x2221('0x33')]=_0x138884[_0x2221('0x33')]?_0x138884[_0x2221('0x33')]:undefined;this[_0x2221('0x34')]=_0x138884[_0x2221('0x34')]||undefined;this[_0x2221('0x35')]=_0x138884['Interval']?_0x138884[_0x2221('0x35')]:undefined;this['dialOrderByScheduledAt']=_0x138884['dialOrderByScheduledAt']||'DESC';this[_0x2221('0x36')]=_0x138884[_0x2221('0x36')]||undefined;this['dialCutDigit']=_0x138884[_0x2221('0x37')]||undefined;this[_0x2221('0x38')]=strategy[_0x138884[_0x2221('0x38')]]||_0x2221('0x39');this[_0x2221('0x3a')]=!![];this[_0x2221('0x3b')]=_0x138884[_0x2221('0x3b')]||![];this[_0x2221('0x3c')]=_0x138884[_0x2221('0x3c')];this['dialAMDGreeting']=_0x138884['dialAMDGreeting'];this[_0x2221('0x3d')]=_0x138884[_0x2221('0x3d')];this[_0x2221('0x3e')]=_0x138884[_0x2221('0x3e')];this[_0x2221('0x3f')]=_0x138884[_0x2221('0x3f')];this[_0x2221('0x40')]=_0x138884[_0x2221('0x40')];this['dialAMDMaximumNumberOfWords']=_0x138884[_0x2221('0x41')];this[_0x2221('0x42')]=_0x138884['dialAMDSilenceThreshold'];this[_0x2221('0x43')]=_0x138884[_0x2221('0x43')];this[_0x2221('0x44')]=0x0;this[_0x2221('0x45')]=0x0;this['timeout']=_0x138884[_0x2221('0x46')];this[_0x2221('0x47')]=0x0;this[_0x2221('0x48')]=0x0;this[_0x2221('0x49')]=0x0;this[_0x2221('0x4a')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2221('0x4b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x2221('0x4c')]=0x0;this[_0x2221('0x4d')]=0x0;this[_0x2221('0x4e')]=0x0;this[_0x2221('0x4f')]=0x0;this['outboundReCallsDay']=0x0;this[_0x2221('0x50')]=undefined;this['startPredictive']=undefined;this[_0x2221('0x51')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x2221('0x52')]=0x0;this[_0x2221('0x53')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2221('0x54')]=0x0;this[_0x2221('0x55')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2221('0x56')]=0x0;this['predictiveIntervalMaxThreshold']=_0x138884['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x138884[_0x2221('0x57')]||0xa;this[_0x2221('0x58')]=0x0;this[_0x2221('0x59')]=0x0;this[_0x2221('0x5a')]=0x1;this[_0x2221('0x5b')]=0x0;this[_0x2221('0x5c')]=0x0;this[_0x2221('0x5d')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x138884[_0x2221('0x5e')]||0x1e;this[_0x2221('0x5f')]=_0x138884[_0x2221('0x5f')]||![];this['dialQueueProject2']=_0x138884[_0x2221('0x60')]||undefined;this[_0x2221('0x61')]=_0x138884[_0x2221('0x61')]||![];this[_0x2221('0x62')]=_0x138884[_0x2221('0x62')]||![];this['monitor_format']=monitorFormat[_0x138884[_0x2221('0xb')]]?monitorFormat[_0x138884[_0x2221('0xb')]]:undefined;this[_0x2221('0x63')]=_0x138884['mandatoryDisposition']||![];this[_0x2221('0x64')]=_0x138884[_0x2221('0x64')]?_0x138884['mandatoryDispositionPause']:undefined;}module[_0x2221('0x65')]=VoiceQueue; \ No newline at end of file +var _0x967d=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','not_inuse','inuse','busy','invalid','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','monitor_format','type','waiting','total','answered','sumHoldTime','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x1d5bec,_0x2fcd83){var _0x349ce6=function(_0x5b2125){while(--_0x5b2125){_0x1d5bec['push'](_0x1d5bec['shift']());}};_0x349ce6(++_0x2fcd83);}(_0x967d,0x120));var _0xd967=function(_0x1e8e2c,_0x70e4cd){_0x1e8e2c=_0x1e8e2c-0x0;var _0x402d5a=_0x967d[_0x1e8e2c];return _0x402d5a;};'use strict';var statusDesc=['unknown',_0xd967('0x0'),_0xd967('0x1'),_0xd967('0x2'),_0xd967('0x3'),'unavailable','ringing',_0xd967('0x4'),_0xd967('0x5')];var monitorFormat={'wav':_0xd967('0x6'),'wav49':_0xd967('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0xd967('0x8'),'roundrobin':_0xd967('0x9')};function VoiceQueue(_0x444e55){this['id']=_0x444e55['id']||0x0;this['name']=_0x444e55['name']||'';this['monitor_format']=_0x444e55[_0xd967('0xa')]||'';this[_0xd967('0xb')]=_0x444e55[_0xd967('0xb')]||'inbound';this[_0xd967('0xc')]=0x0;this['talking']=0x0;this[_0xd967('0xd')]=0x0;this[_0xd967('0xe')]=0x0;this['sumDuration']=0x0;this[_0xd967('0xf')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xd967('0x10')]=0x0;this[_0xd967('0x11')]=0x0;this[_0xd967('0x12')]=0x0;this[_0xd967('0x13')]=_0x444e55['acw']||![];this[_0xd967('0x14')]=_0x444e55[_0xd967('0x14')]||0xa;this[_0xd967('0x15')]=_0x444e55[_0xd967('0x15')]||'no';this[_0xd967('0x16')]=!![];this[_0xd967('0x17')]='';this[_0xd967('0x18')]=0x0;this['temp']=0x0;this[_0xd967('0x19')]=_0x444e55[_0xd967('0x19')]||null;this['dialGlobalInterval']=_0x444e55[_0xd967('0x1a')]?_0x444e55[_0xd967('0x1a')]:null;this[_0xd967('0x1b')]=_0x444e55['dialActive'];this[_0xd967('0x1c')]=_0x444e55['dialMethod']||_0xd967('0x1d');this[_0xd967('0x1e')]=_0x444e55[_0xd967('0x1e')]||0x0;this['dialLimitQueue']=_0x444e55[_0xd967('0x1f')]||0x0;this[_0xd967('0x20')]=_0x444e55[_0xd967('0x20')]||0x1;this[_0xd967('0x21')]=_0x444e55[_0xd967('0x21')]||_0xd967('0x22');this[_0xd967('0x23')]=_0x444e55[_0xd967('0x23')]||0.03;this[_0xd967('0x24')]=_0x444e55[_0xd967('0x24')]||0x258;this[_0xd967('0x25')]=_0x444e55[_0xd967('0x25')]||_0xd967('0x26');this['dialOriginateCallerIdNumber']=_0x444e55[_0xd967('0x27')]||'anonymous';this['dialOriginateTimeout']=_0x444e55[_0xd967('0x28')]||0x1e;this['dialQueueOptions']=_0x444e55[_0xd967('0x29')]||_0xd967('0x2a');this[_0xd967('0x2b')]=_0x444e55[_0xd967('0x2b')]||0x3;this[_0xd967('0x2c')]=_0x444e55['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x444e55[_0xd967('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x444e55[_0xd967('0x2e')]||0x96;this[_0xd967('0x2f')]=_0x444e55[_0xd967('0x2f')]||0x3;this[_0xd967('0x30')]=_0x444e55[_0xd967('0x30')]||0x96;this[_0xd967('0x31')]=_0x444e55[_0xd967('0x31')]||0x3;this[_0xd967('0x32')]=_0x444e55['dialNoAnswerRetryFrequency']||0x96;this[_0xd967('0x33')]=_0x444e55[_0xd967('0x33')]||0x4;this[_0xd967('0x34')]=_0x444e55[_0xd967('0x34')]?_0x444e55['Trunk']:undefined;this[_0xd967('0x35')]=_0x444e55[_0xd967('0x35')]?_0x444e55['TrunkBackup']:undefined;this[_0xd967('0x36')]=_0x444e55['dialPrefix']||undefined;this[_0xd967('0x37')]=_0x444e55[_0xd967('0x37')]?_0x444e55[_0xd967('0x37')]:undefined;this[_0xd967('0x38')]=_0x444e55[_0xd967('0x38')]||_0xd967('0x39');this[_0xd967('0x3a')]=_0x444e55[_0xd967('0x3a')]||undefined;this[_0xd967('0x3b')]=_0x444e55['dialCutDigit']||undefined;this[_0xd967('0x3c')]=strategy[_0x444e55['strategy']]||_0xd967('0x8');this[_0xd967('0x3d')]=!![];this['dialAMDActive']=_0x444e55[_0xd967('0x3e')]||![];this['dialAMDInitialSilence']=_0x444e55[_0xd967('0x3f')];this[_0xd967('0x40')]=_0x444e55[_0xd967('0x40')];this[_0xd967('0x41')]=_0x444e55[_0xd967('0x41')];this[_0xd967('0x42')]=_0x444e55[_0xd967('0x42')];this['dialAMDMinWordLength']=_0x444e55[_0xd967('0x43')];this[_0xd967('0x44')]=_0x444e55[_0xd967('0x44')];this[_0xd967('0x45')]=_0x444e55[_0xd967('0x45')];this[_0xd967('0x46')]=_0x444e55[_0xd967('0x46')];this[_0xd967('0x47')]=_0x444e55[_0xd967('0x47')];this[_0xd967('0x48')]=0x0;this['pTalking']=0x0;this['timeout']=_0x444e55[_0xd967('0x49')];this['outboundAnswerCallsDay']=0x0;this[_0xd967('0x4a')]=0x0;this[_0xd967('0x4b')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xd967('0x4c')]=0x0;this[_0xd967('0x4d')]=0x0;this[_0xd967('0x4e')]=0x0;this[_0xd967('0x4f')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xd967('0x50')]=0x0;this[_0xd967('0x51')]=0x0;this[_0xd967('0x52')]=0x0;this[_0xd967('0x53')]=0x0;this[_0xd967('0x54')]=undefined;this[_0xd967('0x55')]=undefined;this[_0xd967('0x56')]=undefined;this[_0xd967('0x57')]=1.05;this[_0xd967('0x58')]=0x0;this[_0xd967('0x59')]=0x0;this[_0xd967('0x5a')]=0x0;this[_0xd967('0x5b')]=0x0;this[_0xd967('0x5c')]=0x0;this[_0xd967('0x5d')]=0x0;this[_0xd967('0x5e')]=0x0;this[_0xd967('0x5f')]=0x0;this[_0xd967('0x60')]=_0x444e55[_0xd967('0x61')]||0x14;this[_0xd967('0x62')]=_0x444e55[_0xd967('0x61')]||0xa;this[_0xd967('0x63')]=0x0;this[_0xd967('0x64')]=0x0;this[_0xd967('0x65')]=0x1;this[_0xd967('0x66')]=0x0;this[_0xd967('0x67')]=0x0;this[_0xd967('0x68')]=0x0;this[_0xd967('0x69')]=0x0;this[_0xd967('0x6a')]=_0x444e55[_0xd967('0x6a')]||0x1e;this[_0xd967('0x6b')]=_0x444e55[_0xd967('0x6b')]||![];this[_0xd967('0x6c')]=_0x444e55[_0xd967('0x6c')]||undefined;this[_0xd967('0x6d')]=_0x444e55[_0xd967('0x6d')]||![];this['dialAgiAfterHangupAgent']=_0x444e55[_0xd967('0x6e')]||![];this[_0xd967('0xa')]=monitorFormat[_0x444e55['monitor_format']]?monitorFormat[_0x444e55[_0xd967('0xa')]]:undefined;this[_0xd967('0x6f')]=_0x444e55[_0xd967('0x6f')]||![];this['mandatoryDispositionPause']=_0x444e55['mandatoryDispositionPause']?_0x444e55['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 105ad98..491074e 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 _0xa62f=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x21d532,_0x423545){var _0x2d887c=function(_0x4ceb71){while(--_0x4ceb71){_0x21d532['push'](_0x21d532['shift']());}};_0x2d887c(++_0x423545);}(_0xa62f,0x181));var _0xfa62=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa62f[_0x2dafbe];return _0x58a45a;};'use strict';function VtigerAccount(_0x39e24b){this['id']=_0x39e24b['id']||0x0;this[_0xfa62('0x0')]=_0x39e24b[_0xfa62('0x0')]||'';this[_0xfa62('0x1')]=_0x39e24b[_0xfa62('0x1')]||'';this[_0xfa62('0x2')]=_0x39e24b['accessKey']||'';this[_0xfa62('0x3')]=_0x39e24b[_0xfa62('0x3')]||'';this[_0xfa62('0x4')]=_0x39e24b[_0xfa62('0x4')]||'';this['Configurations']=_0x39e24b[_0xfa62('0x5')]||{};}module[_0xfa62('0x6')]=VtigerAccount; \ No newline at end of file +var _0x942c=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x211cca,_0x472c8f){var _0x17dd6c=function(_0x50860a){while(--_0x50860a){_0x211cca['push'](_0x211cca['shift']());}};_0x17dd6c(++_0x472c8f);}(_0x942c,0xe0));var _0xc942=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x942c[_0x14add3];return _0x4a174f;};'use strict';function VtigerAccount(_0xaad94f){this['id']=_0xaad94f['id']||0x0;this['name']=_0xaad94f[_0xc942('0x0')]||'';this[_0xc942('0x1')]=_0xaad94f['username']||'';this['accessKey']=_0xaad94f[_0xc942('0x2')]||'';this[_0xc942('0x3')]=_0xaad94f[_0xc942('0x3')]||'';this[_0xc942('0x4')]=_0xaad94f[_0xc942('0x4')]||'';this['Configurations']=_0xaad94f[_0xc942('0x5')]||{};}module[_0xc942('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index b6d7584..ebba685 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 _0x9c16=['name','username','token','remoteUri','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x9c16,0x90));var _0x69c1=function(_0x52358c,_0x134ae7){_0x52358c=_0x52358c-0x0;var _0x4244ca=_0x9c16[_0x52358c];return _0x4244ca;};'use strict';function ZendeskAccount(_0xd764){this['id']=_0xd764['id']||0x0;this['name']=_0xd764[_0x69c1('0x0')]||'';this[_0x69c1('0x1')]=_0xd764[_0x69c1('0x1')]||'';this['password']=_0xd764['password']||'';this[_0x69c1('0x2')]=_0xd764[_0x69c1('0x2')]||'';this['remoteUri']=_0xd764[_0x69c1('0x3')]||'';this['authType']=_0xd764['authType']||'';this['type']=_0xd764[_0x69c1('0x4')]||_0x69c1('0x5');this[_0x69c1('0x6')]=_0xd764[_0x69c1('0x6')]||'';this[_0x69c1('0x7')]=_0xd764['Configurations']||{};}module[_0x69c1('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x7975=['username','password','token','authType','type','integrationTab','serverUrl','exports'];(function(_0x3b407d,_0x19cbdb){var _0x1fec09=function(_0x50c9e4){while(--_0x50c9e4){_0x3b407d['push'](_0x3b407d['shift']());}};_0x1fec09(++_0x19cbdb);}(_0x7975,0xd8));var _0x5797=function(_0x53ea7a,_0x1c1781){_0x53ea7a=_0x53ea7a-0x0;var _0xf850=_0x7975[_0x53ea7a];return _0xf850;};'use strict';function ZendeskAccount(_0x38fc87){this['id']=_0x38fc87['id']||0x0;this['name']=_0x38fc87['name']||'';this[_0x5797('0x0')]=_0x38fc87[_0x5797('0x0')]||'';this[_0x5797('0x1')]=_0x38fc87[_0x5797('0x1')]||'';this[_0x5797('0x2')]=_0x38fc87['token']||'';this['remoteUri']=_0x38fc87['remoteUri']||'';this[_0x5797('0x3')]=_0x38fc87[_0x5797('0x3')]||'';this[_0x5797('0x4')]=_0x38fc87['type']||_0x5797('0x5');this[_0x5797('0x6')]=_0x38fc87['serverUrl']||'';this['Configurations']=_0x38fc87['Configurations']||{};}module[_0x5797('0x7')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index dd47aca..acd336e 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 _0x814b=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x814b,0x1a2));var _0xb814=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x814b[_0x9fb081];return _0x43f8b0;};'use strict';function ZohoAccount(_0x451d2a){this['id']=_0x451d2a['id']||0x0;this[_0xb814('0x0')]=_0x451d2a[_0xb814('0x0')]||'';this[_0xb814('0x1')]=_0x451d2a[_0xb814('0x1')]||'';this[_0xb814('0x2')]=_0x451d2a['host']||'';this[_0xb814('0x3')]=_0x451d2a[_0xb814('0x3')]||{};this[_0xb814('0x4')]=_0x451d2a[_0xb814('0x4')]||'';}module[_0xb814('0x5')]=ZohoAccount; \ No newline at end of file +var _0xf494=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0x143396,_0x24ff13){var _0x4eefcb=function(_0x53b1b1){while(--_0x53b1b1){_0x143396['push'](_0x143396['shift']());}};_0x4eefcb(++_0x24ff13);}(_0xf494,0x1c6));var _0x4f49=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xf494[_0x54bac5];return _0xc15971;};'use strict';function ZohoAccount(_0x105328){this['id']=_0x105328['id']||0x0;this[_0x4f49('0x0')]=_0x105328[_0x4f49('0x0')]||'';this['authToken']=_0x105328[_0x4f49('0x1')]||'';this[_0x4f49('0x2')]=_0x105328[_0x4f49('0x2')]||'';this[_0x4f49('0x3')]=_0x105328[_0x4f49('0x3')]||{};this[_0x4f49('0x4')]=_0x105328[_0x4f49('0x4')]||'';}module[_0x4f49('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 7ee0ac2..7e73f1d 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 _0xac1c=['lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','firstName'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0xac1c,0x127));var _0xcac1=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0xac1c[_0x5275b8];return _0x568a9b;};'use strict';var util=require('util');var _=require(_0xcac1('0x0'));var moment=require(_0xcac1('0x1'));function checkNameSurname(_0x17947f,_0x1e50d8,_0x29ed10){var _0x2e8c7a='';if(!_[_0xcac1('0x2')](_0x1e50d8)&&_0xcac1('0x3')===typeof _0x1e50d8){_0x2e8c7a+=_0x1e50d8;}if(!_[_0xcac1('0x2')](_0x29ed10)&&_0xcac1('0x3')===typeof _0x29ed10){_0x2e8c7a+='\x20'+_0x29ed10;}if(_0x2e8c7a!==''){return _0x2e8c7a;}return _0x17947f;}function Action(_0x2e9041,_0x2e5056,_0x579b9a,_0x388af4,_0x4a44eb){this['uniqueid']=_0x579b9a||undefined;this[_0xcac1('0x4')]=_0x2e9041['id'];this[_0xcac1('0x5')]=_0x2e5056[_0xcac1('0x6')];this[_0xcac1('0x7')]=_0x2e5056['type'];this[_0xcac1('0x8')]=_0xcac1('0x5');this[_0xcac1('0x9')]=![];this[_0xcac1('0xa')]=_[_0xcac1('0x2')](_0x2e9041[_0xcac1('0xb')])?undefined:_0x2e9041[_0xcac1('0xb')][_0xcac1('0x6')];this[_0xcac1('0xc')]=this['membername']?util[_0xcac1('0xd')]('SIP/%s',this['membername']):_0x388af4||undefined;this[_0xcac1('0xe')]=checkNameSurname(_0x2e9041[_0xcac1('0xf')]['phone'],_0x2e9041[_0xcac1('0xf')][_0xcac1('0x10')],_0x2e9041[_0xcac1('0xf')][_0xcac1('0x11')]);this[_0xcac1('0x12')]=_0x2e9041['active']||![];this[_0xcac1('0x13')]=_0x2e9041[_0xcac1('0xf')][_0xcac1('0x14')];this['scheduledat']=_0x2e9041[_0xcac1('0x15')];this[_0xcac1('0x16')]=_0x2e9041[_0xcac1('0x16')]||0x0;this[_0xcac1('0x17')]=_0x2e9041['countcongestionretry']||0x0;this[_0xcac1('0x18')]=_0x2e9041[_0xcac1('0x18')]||0x0;this[_0xcac1('0x19')]=(_0x2e9041[_0xcac1('0x16')]||0x0)+(_0x2e9041[_0xcac1('0x17')]||0x0)+(_0x2e9041['countnoanswerretry']||0x0);this[_0xcac1('0x1a')]=_0x2e9041[_0xcac1('0x1a')];this[_0xcac1('0x1b')]=_0x2e9041[_0xcac1('0x1b')];this[_0xcac1('0x1c')]=_0x2e9041['callbackat'];this[_0xcac1('0x1d')]=_0x2e9041[_0xcac1('0x1d')];this[_0xcac1('0x1e')]=_0x2e9041[_0xcac1('0x1e')];this[_0xcac1('0x1f')]=_0x2e9041[_0xcac1('0x1f')];this['UserId']=_[_0xcac1('0x2')](_0x2e9041[_0xcac1('0xb')])?_0x2e9041[_0xcac1('0x20')]:_0x2e9041['Agent']['id'];this[_0xcac1('0x21')]=_0x2e9041[_0xcac1('0x21')];this[_0xcac1('0x22')]='';this[_0xcac1('0x23')]='';}Action[_0xcac1('0x24')]['getCaller']=function(){return util[_0xcac1('0xd')](_0xcac1('0x25'),this['calleridname'],this['number']);};module[_0xcac1('0x26')]=Action; \ No newline at end of file +var _0x1d85=['countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat'];(function(_0x233445,_0x37d670){var _0x4cee1d=function(_0x569c0f){while(--_0x569c0f){_0x233445['push'](_0x233445['shift']());}};_0x4cee1d(++_0x37d670);}(_0x1d85,0x14a));var _0x51d8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1d85[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var _=require(_0x51d8('0x0'));var moment=require(_0x51d8('0x1'));function checkNameSurname(_0x33ed8f,_0x6bcccb,_0x4d7721){var _0x56bd04='';if(!_[_0x51d8('0x2')](_0x6bcccb)&&_0x51d8('0x3')===typeof _0x6bcccb){_0x56bd04+=_0x6bcccb;}if(!_[_0x51d8('0x2')](_0x4d7721)&&_0x51d8('0x3')===typeof _0x4d7721){_0x56bd04+='\x20'+_0x4d7721;}if(_0x56bd04!==''){return _0x56bd04;}return _0x33ed8f;}function Action(_0x1af567,_0x5cd91f,_0x4e1ef3,_0x2941a0,_0x5d7daf){this['uniqueid']=_0x4e1ef3||undefined;this[_0x51d8('0x4')]=_0x1af567['id'];this[_0x51d8('0x5')]=_0x5cd91f[_0x51d8('0x6')];this[_0x51d8('0x7')]=_0x5cd91f[_0x51d8('0x7')];this[_0x51d8('0x8')]=_0x51d8('0x5');this['dialAnswer']=![];this[_0x51d8('0x9')]=_['isNil'](_0x1af567[_0x51d8('0xa')])?undefined:_0x1af567[_0x51d8('0xa')][_0x51d8('0x6')];this[_0x51d8('0xb')]=this['membername']?util[_0x51d8('0xc')]('SIP/%s',this['membername']):_0x2941a0||undefined;this[_0x51d8('0xd')]=checkNameSurname(_0x1af567[_0x51d8('0xe')][_0x51d8('0xf')],_0x1af567['Contact']['firstName'],_0x1af567[_0x51d8('0xe')][_0x51d8('0x10')]);this[_0x51d8('0x11')]=_0x1af567[_0x51d8('0x11')]||![];this[_0x51d8('0x12')]=_0x1af567[_0x51d8('0xe')][_0x51d8('0xf')];this[_0x51d8('0x13')]=_0x1af567[_0x51d8('0x13')];this['countbusyretry']=_0x1af567['countbusyretry']||0x0;this['countcongestionretry']=_0x1af567[_0x51d8('0x14')]||0x0;this['countnoanswerretry']=_0x1af567[_0x51d8('0x15')]||0x0;this[_0x51d8('0x16')]=(_0x1af567['countbusyretry']||0x0)+(_0x1af567['countcongestionretry']||0x0)+(_0x1af567['countnoanswerretry']||0x0);this['callback']=_0x1af567[_0x51d8('0x17')];this[_0x51d8('0x18')]=_0x1af567[_0x51d8('0x18')];this['callbackat']=_0x1af567['callbackat'];this['recallme']=_0x1af567[_0x51d8('0x19')];this[_0x51d8('0x1a')]=_0x1af567[_0x51d8('0x1a')];this['ListId']=_0x1af567[_0x51d8('0x1b')];this['UserId']=_[_0x51d8('0x2')](_0x1af567['Agent'])?_0x1af567[_0x51d8('0x1c')]:_0x1af567[_0x51d8('0xa')]['id'];this[_0x51d8('0x1d')]=_0x1af567['VoiceQueueId'];this['originatecalleridnum']='';this[_0x51d8('0x1e')]='';}Action[_0x51d8('0x1f')]['getCaller']=function(){return util[_0x51d8('0xc')](_0x51d8('0x20'),this[_0x51d8('0xd')],this[_0x51d8('0x21')]);};module[_0x51d8('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e87876a..4b56a33 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 _0x1ce3=['dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','countbusyretry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','unlockAgent','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','disableContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','called','Calling','logger','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','execRun','unlock','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','../ami','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','name','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice_queue:save','voice:queue:%s','voice_queue_channel:remove','originated','paused','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','outbound','hasOwnProperty','preview','setMessage','recallMe','clearZombieChannel','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','status','catch','message','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','isNil','length','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x1ce3,0x1f3));var _0x31ce=function(_0x23a95f,_0x53ef0e){_0x23a95f=_0x23a95f-0x0;var _0xa1ad0b=_0x1ce3[_0x23a95f];return _0xa1ad0b;};'use strict';var util=require(_0x31ce('0x0'));var _=require(_0x31ce('0x1'));var BPromise=require('bluebird');var uuid=require(_0x31ce('0x2'));var moment=require(_0x31ce('0x3'));var md5=require(_0x31ce('0x4'));var Redis=require(_0x31ce('0x5'));var config=require(_0x31ce('0x6'));var logger=require(_0x31ce('0x7'))('preview');var loggerAction=require(_0x31ce('0x7'))('actionPreview');var ami=require(_0x31ce('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x31ce('0x9'));var ut=require(_0x31ce('0xa'));config['redis']=_[_0x31ce('0xb')](config[_0x31ce('0xc')],{'host':_0x31ce('0xd'),'port':0x18eb});var io=require(_0x31ce('0xe'))(new Redis(config[_0x31ce('0xc')]));var Sequence=function(){};Sequence[_0x31ce('0xf')][_0x31ce('0x10')]=function(_0x5128bd){this[_0x31ce('0x11')]=this['tail']?this[_0x31ce('0x11')][_0x31ce('0x12')](_0x5128bd):_0x5128bd();};function Preview(_0x595331){this[_0x31ce('0x13')]=new Sequence();this[_0x31ce('0x14')]=_0x595331[_0x31ce('0x15')];this[_0x31ce('0x16')]=_0x595331['trunks'];this[_0x31ce('0x17')]={};this[_0x31ce('0x18')]=_0x595331[_0x31ce('0x18')];this[_0x31ce('0x19')]=0x0;ami['on'](_0x31ce('0x1a'),this[_0x31ce('0x1b')][_0x31ce('0x1c')](this));ami['on']('hangup',this[_0x31ce('0x1d')][_0x31ce('0x1c')](this));ami['on'](_0x31ce('0x1e'),this['syncHangupRequest'][_0x31ce('0x1c')](this));ami['on'](_0x31ce('0x1f'),this[_0x31ce('0x20')][_0x31ce('0x1c')](this));ami['on'](_0x31ce('0x21'),this[_0x31ce('0x22')][_0x31ce('0x1c')](this));ami['on'](_0x31ce('0x23'),this[_0x31ce('0x24')][_0x31ce('0x1c')](this));ami['on']('attendedtransfer',this[_0x31ce('0x25')]['bind'](this));ami['on'](_0x31ce('0x26'),this[_0x31ce('0x27')]['bind'](this));this['loopCampaigns'](this[_0x31ce('0x14')]);}function emit(_0x3de64e,_0x3078dc,_0x37d733){io['to'](_0x3de64e)[_0x31ce('0x28')](_0x3078dc,_0x37d733);}function emitCampaignPreview(_0x4f96b8){if(_0x4f96b8[_0x31ce('0x29')]==='outbound'){var _0xa5703d={'id':_0x4f96b8['id'],'name':_0x4f96b8[_0x31ce('0x2a')],'strategy':_0x4f96b8['strategy'],'answered':_0x4f96b8['answered'],'available':_0x4f96b8[_0x31ce('0x2b')],'loggedIn':_0x4f96b8[_0x31ce('0x2c')],'pTalking':_0x4f96b8[_0x31ce('0x2d')],'sumBillable':_0x4f96b8[_0x31ce('0x2e')],'sumDuration':_0x4f96b8['sumDuration'],'sumHoldTime':_0x4f96b8[_0x31ce('0x2f')]||0x0,'talking':_0x4f96b8[_0x31ce('0x30')],'total':_0x4f96b8[_0x31ce('0x31')],'type':_0x4f96b8['type'],'unmanaged':_0x4f96b8[_0x31ce('0x32')],'abandoned':_0x4f96b8[_0x31ce('0x33')],'waiting':_0x4f96b8[_0x31ce('0x34')],'loggedInDb':_0x4f96b8[_0x31ce('0x35')],'dialActive':_0x4f96b8[_0x31ce('0x36')],'dialMethod':_0x4f96b8[_0x31ce('0x37')],'dialOriginateCallerIdName':_0x4f96b8[_0x31ce('0x38')],'dialOriginateCallerIdNumber':_0x4f96b8[_0x31ce('0x39')],'dialOriginateTimeout':_0x4f96b8[_0x31ce('0x3a')],'dialPrefix':_0x4f96b8[_0x31ce('0x3b')],'outboundAnswerAgiCallsDay':_0x4f96b8[_0x31ce('0x3c')],'outboundAnswerCallsDay':_0x4f96b8[_0x31ce('0x3d')],'outboundBlacklistCallsDay':_0x4f96b8[_0x31ce('0x3e')],'outboundBusyCallsDay':_0x4f96b8[_0x31ce('0x3f')],'outboundCongestionCallsDay':_0x4f96b8[_0x31ce('0x40')],'outboundDropCallsDayACS':_0x4f96b8[_0x31ce('0x41')],'outboundDropCallsDayCallersExit':_0x4f96b8[_0x31ce('0x42')],'outboundDropCallsDayTimeout':_0x4f96b8[_0x31ce('0x43')],'outboundNoAnswerCallsDay':_0x4f96b8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4f96b8[_0x31ce('0x44')],'outboundOriginateFailureCallsDay':_0x4f96b8[_0x31ce('0x45')],'outboundReCallsDay':_0x4f96b8['outboundReCallsDay'],'outboundRejectCallsDay':_0x4f96b8[_0x31ce('0x46')],'outboundUnknownCallsDay':_0x4f96b8[_0x31ce('0x47')],'predictiveIntervalAnsweredCalls':_0x4f96b8['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4f96b8[_0x31ce('0x48')],'predictiveIntervalAvgTalktime':_0x4f96b8[_0x31ce('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x4f96b8['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4f96b8[_0x31ce('0x4a')],'predictiveIntervalErlangCalls':_0x4f96b8[_0x31ce('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x4f96b8[_0x31ce('0x4c')],'predictiveIntervalHitRate':_0x4f96b8[_0x31ce('0x4d')],'predictiveIntervalMultiplicativeFactor':_0x4f96b8[_0x31ce('0x4e')],'predictiveIntervalPauses':_0x4f96b8[_0x31ce('0x4f')],'predictiveIntervalAvailable':_0x4f96b8[_0x31ce('0x50')],'predictiveIntervalTotalCalls':_0x4f96b8[_0x31ce('0x51')],'message':_0x4f96b8['message'],'originated':_0x4f96b8['originated'],'erlangCalls':_0x4f96b8[_0x31ce('0x52')],'erlangCallToSecond':_0x4f96b8[_0x31ce('0x53')],'erlangAbandonmentRate':_0x4f96b8[_0x31ce('0x54')],'erlangBusyFactor':_0x4f96b8[_0x31ce('0x55')],'startPredictive':_0x4f96b8[_0x31ce('0x56')],'startProgressive':_0x4f96b8[_0x31ce('0x57')]};if(_0x4f96b8[_0x31ce('0x58')]){_0xa5703d[_0x31ce('0x58')]={'id':_0x4f96b8[_0x31ce('0x58')]['id'],'name':_0x4f96b8[_0x31ce('0x58')][_0x31ce('0x2a')],'active':_0x4f96b8['Trunk'][_0x31ce('0x59')],'callerid':_0x4f96b8[_0x31ce('0x58')]['callerid']};}if(_0x4f96b8[_0x31ce('0x5a')]){_0xa5703d[_0x31ce('0x5a')]={'id':_0x4f96b8[_0x31ce('0x5a')]['id'],'name':_0x4f96b8[_0x31ce('0x5a')]['name']};}var _0x28c5f8=md5(JSON[_0x31ce('0x5b')](_0xa5703d));if(_0x4f96b8['md5']!==_0x28c5f8){_0x4f96b8[_0x31ce('0x4')]=_0x28c5f8;emit(util[_0x31ce('0x5c')]('voice:queue:%s',_0xa5703d[_0x31ce('0x2a')]),_0x31ce('0x5d'),_0xa5703d);}}}function emitVoiceQueueChannelRemove(_0x4fe3c6){emit(util[_0x31ce('0x5c')](_0x31ce('0x5e'),_0x4fe3c6[_0x31ce('0x2a')]),_0x31ce('0x5f'),_0x4fe3c6);}function notSendMessagesQueue(_0x14bf6a){if(_0x14bf6a['sendMessageOneNotActive']){if(_0x14bf6a[_0x31ce('0x60')]===0x0&&_0x14bf6a['pTalking']===0x0){_0x14bf6a['sendMessageOneNotActive']=![];_0x14bf6a[_0x31ce('0x2b')]=0x0;_0x14bf6a[_0x31ce('0x61')]=0x0;_0x14bf6a['message']='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x14bf6a[_0x31ce('0x2a')]+_0x31ce('0x62'));}else{_0x14bf6a['message']='IS_DISACTIVED';ut['logger'](_0x31ce('0x63'),_0x14bf6a[_0x31ce('0x2a')]+_0x31ce('0x64'));}emitCampaignPreview(_0x14bf6a);}}Preview[_0x31ce('0xf')][_0x31ce('0x65')]=function(){var _0x7fbba5=this;setInterval(function(){_0x7fbba5[_0x31ce('0x66')]();},0x7cf);};Preview[_0x31ce('0xf')][_0x31ce('0x66')]=function(){var _0x492f70=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x346ea8 in _0x492f70){if(_0x492f70['hasOwnProperty'](_0x346ea8)&&(_0x492f70[_0x346ea8][_0x31ce('0x37')]==='preview'||_0x492f70[_0x346ea8]['dialMethod']===_0x31ce('0x67'))&&_0x492f70[_0x346ea8][_0x31ce('0x29')]===_0x31ce('0x68')){if(this[_0x31ce('0x19')]>0x7){this[_0x31ce('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x492f70[_0x31ce('0x69')](_0x346ea8)&&_0x492f70[_0x346ea8][_0x31ce('0x37')]===_0x31ce('0x6a')&&_0x492f70[_0x346ea8][_0x31ce('0x29')]===_0x31ce('0x68')){if(_0x492f70[_0x346ea8][_0x31ce('0x36')]){this[_0x31ce('0x6b')](_0x492f70[_0x346ea8]);this[_0x31ce('0x6c')](_0x492f70[_0x346ea8]);}else{notSendMessagesQueue(_0x492f70[_0x346ea8]);}}}};Preview['prototype'][_0x31ce('0x6d')]=function(_0x2f33c8){var _0x1676f5=this;this[_0x31ce('0x13')][_0x31ce('0x10')](function(){if(!_['isNil'](_0x1676f5[_0x31ce('0x17')][_0x2f33c8])){loggerAction[_0x31ce('0x6e')](_0x31ce('0x6f'),_0x2f33c8,_0x31ce('0x70'),_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x71')],'originated:\x20',JSON[_0x31ce('0x5b')](_0x1676f5[_0x31ce('0x14')][_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x71')]][_0x31ce('0x60')]),_0x31ce('0x72'),JSON[_0x31ce('0x5b')](_0x1676f5[_0x31ce('0x14')][_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x71')]][_0x31ce('0x2d')]),JSON[_0x31ce('0x5b')](_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x73')]),JSON[_0x31ce('0x5b')](_[_0x31ce('0x74')](_0x1676f5[_0x31ce('0x17')][_0x2f33c8],[_0x31ce('0x75'),_0x31ce('0x76'),'VoiceQueueId',_0x31ce('0x77')])));return ami['Action']({'action':_0x31ce('0x78'),'channel':_0x1676f5[_0x31ce('0x17')][_0x2f33c8]['channel']})[_0x31ce('0x79')](function(_0x3364fc){if(_0x3364fc[_0x31ce('0x7a')]===_0x31ce('0x7b')){setTimeout(function(){if(_0x1676f5[_0x31ce('0x17')][_0x2f33c8]){ut[_0x31ce('0x7c')](_0x1676f5[_0x31ce('0x14')][_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x71')]],_0x31ce('0x7d'));if(_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x73')]===!![]){ut['decrementTalkink'](_0x1676f5['campaignsPreview'][_0x1676f5[_0x31ce('0x17')][_0x2f33c8][_0x31ce('0x71')]],_0x31ce('0x7d'));ut[_0x31ce('0x7e')](_0x31ce('0x7f')+_0x2f33c8,_0x1676f5['actions'][_0x2f33c8][_0x31ce('0x71')]);}ut[_0x31ce('0x7e')](_0x31ce('0x80')+_0x2f33c8,_0x1676f5['actions'][_0x2f33c8][_0x31ce('0x71')]);delete _0x1676f5['actions'][_0x2f33c8];}},0x2328);}});}});};Preview[_0x31ce('0xf')][_0x31ce('0x81')]=function(){var _0x31d46d=this;loggerAction[_0x31ce('0x6e')](_0x31ce('0x82'),_[_0x31ce('0x83')](this[_0x31ce('0x17')]));for(var _0x23b79b in this[_0x31ce('0x17')]){if(_0x31d46d[_0x31ce('0x17')][_0x31ce('0x69')](_0x23b79b)){_0x31d46d[_0x31ce('0x6d')](_0x23b79b);}}};Preview['prototype']['recallMe']=function(_0x5f377b){var _0x5e18c3=this;rpcDb[_0x31ce('0x84')](_0x5f377b['id'],ut[_0x31ce('0x85')](this['agents']))[_0x31ce('0x86')](function(_0x25ae38){if(!_[_0x31ce('0x87')](_0x25ae38)){for(var _0x118e66=0x0;_0x118e66<_0x25ae38[_0x31ce('0x88')];_0x118e66+=0x1){if(ut['getDiff'](_0x25ae38[_0x118e66][_0x31ce('0x89')])<_0x5f377b[_0x31ce('0x8a')]*0x3c){_0x5e18c3[_0x31ce('0x8b')](_0x25ae38[_0x118e66]['id'])['then'](ut[_0x31ce('0x8c')](_0x31ce('0x8d')))[_0x31ce('0x79')](ut[_0x31ce('0x8c')](_0x31ce('0x8d')));}else{var _0x50cfbf=new Action(_0x25ae38[_0x118e66],_0x5f377b);_0x50cfbf[_0x31ce('0x8e')]=moment()[_0x31ce('0x5c')](_0x31ce('0x8f'));_0x5f377b[_0x31ce('0x90')]+=0x1;ut[_0x31ce('0x91')](_0x50cfbf,0x17,_0x31ce('0x92'));if(_0x5f377b[_0x31ce('0x93')]){rpcDb['rescheduleContactInQueue'](ut[_0x31ce('0x94')](_0x25ae38[_0x118e66]));rpcDb['createCustomerHistory'](_0x50cfbf,_0x31ce('0x95'));}else{ut['logCustomer'](_0x50cfbf,0x16,_0x31ce('0x96'));rpcDb[_0x31ce('0x97')](_0x50cfbf,_0x31ce('0x98'));rpcDb[_0x31ce('0x99')](_0x50cfbf,'[HistoryRecallClose]');}}}}})[_0x31ce('0x79')](ut['logger2'](_0x31ce('0x9a')));};Preview[_0x31ce('0xf')][_0x31ce('0x6b')]=function(_0x1f4889){_0x1f4889[_0x31ce('0x9b')]=!![];if(ut[_0x31ce('0x9c')](_0x1f4889['loggedIn'])){_0x1f4889['message']=_0x31ce('0x9d');}else if(!ut['isActive'](_0x1f4889[_0x31ce('0x36')])){_0x1f4889[_0x31ce('0x7a')]=_0x31ce('0x9e');}else if(!this[_0x31ce('0x9f')](_0x1f4889['Trunk'])){if(!this[_0x31ce('0x9f')](_0x1f4889[_0x31ce('0xa0')])){_0x1f4889['message']=_0x31ce('0xa1');}else{_0x1f4889['message']=_0x31ce('0xa2');}}else{_0x1f4889['message']=_0x31ce('0xa2');}emitCampaignPreview(_0x1f4889);};Preview[_0x31ce('0xf')][_0x31ce('0xa3')]=function(_0x22ad5c,_0x5b4905,_0x26b075){var _0x3c30d3=this;var _0x11b0bf=this['actions'][_0x5b4905];var _0x8841ee=this['campaignsPreview'][_0x11b0bf[_0x31ce('0x71')]];var _0x15336f;if(_0x8841ee){switch(_0x26b075){case'1':_0x8841ee[_0x31ce('0x44')]+=0x1;_0x11b0bf[_0x31ce('0xa4')]=ut[_0x31ce('0xa5')](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x0,_0x31ce('0xa6'));rpcDb[_0x31ce('0x97')](_0x11b0bf,_0x31ce('0xa7'));if(ut[_0x31ce('0xa5')](_0x11b0bf)>=_0x8841ee[_0x31ce('0xa8')]){_0x15336f=ut[_0x31ce('0xa9')](_0x11b0bf,0xf,'Global');rpcDb[_0x31ce('0x99')](_0x15336f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x31ce('0x99')](_0x11b0bf,_0x31ce('0xaa'));}delete this[_0x31ce('0x17')][_0x22ad5c[_0x31ce('0xab')]];break;case _0x31ce('0xac'):var _0xec123=moment()['format'](_0x31ce('0x8f'));_0x11b0bf[_0x31ce('0xad')]=_0xec123;_0x11b0bf[_0x31ce('0xae')]=_0xec123;_0x11b0bf[_0x31ce('0x73')]=!![];_0x8841ee[_0x31ce('0x2d')]+=0x1;logger[_0x31ce('0x6e')](_0x31ce('0xaf'),_0x11b0bf['uniqueid'],_0x31ce('0xb0'),_0x8841ee[_0x31ce('0x2a')],'pTalking:\x20',_0x8841ee['pTalking']);ami['emit'](_0x31ce('0xb1'),ut[_0x31ce('0xb2')](_0x11b0bf,'connect'));if(_0x8841ee[_0x31ce('0xb3')]){ami[_0x31ce('0x28')](_0x31ce('0xb4'),ut[_0x31ce('0xb5')](_0x11b0bf));}break;case'16':ami[_0x31ce('0x28')](_0x31ce('0xb6'),ut[_0x31ce('0xb2')](_0x11b0bf,_0x31ce('0xb7')));emitVoiceQueueChannelRemove(ut[_0x31ce('0xb2')](_0x11b0bf,'complete'));_0x8841ee[_0x31ce('0x3d')]+=0x1;_0x8841ee[_0x31ce('0x31')]+=0x1;_0x8841ee[_0x31ce('0xb8')]+=0x1;ut[_0x31ce('0xb9')](_0x8841ee,_0x31ce('0xba'));_0x11b0bf[_0x31ce('0xa4')]=ut['totalGlobal'](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x4,_0x31ce('0xbb'));rpcDb[_0x31ce('0x97')](_0x11b0bf,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x31ce('0x99')](_0x11b0bf,_0x31ce('0xbc'));rpcDb['crateCustomerReportQueue'](_0x11b0bf);_0x8841ee[_0x31ce('0xbd')]+=_0x11b0bf[_0x31ce('0xbe')];_0x8841ee[_0x31ce('0x2e')]+=_0x11b0bf[_0x31ce('0xbe')];logger[_0x31ce('0x6e')](_0x31ce('0xbf'),_0x11b0bf['uniqueid'],_0x31ce('0xb0'),_0x8841ee[_0x31ce('0x2a')],_0x31ce('0x72'),_0x8841ee[_0x31ce('0x2d')]);delete this[_0x31ce('0x17')][_0x22ad5c[_0x31ce('0xab')]];break;case'BUSY':_0x8841ee[_0x31ce('0x3f')]+=0x1;_0x11b0bf[_0x31ce('0xc0')]+=0x1;_0x11b0bf[_0x31ce('0xa4')]=ut['totalGlobal'](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x5,'Busy');rpcDb[_0x31ce('0x97')](_0x11b0bf,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x31ce('0xa5')](_0x11b0bf)>=_0x8841ee[_0x31ce('0xa8')]){_0x15336f=ut['cloneAction'](_0x11b0bf,0xf,_0x31ce('0xc1'));rpcDb[_0x31ce('0x99')](_0x15336f,_0x31ce('0xc2'));}else{if(_0x11b0bf[_0x31ce('0xc0')]>=_0x8841ee[_0x31ce('0xc3')]){rpcDb[_0x31ce('0x99')](_0x11b0bf,_0x31ce('0xc4'));}else{rpcDb[_0x31ce('0xc5')](ut[_0x31ce('0xc6')](_0x11b0bf,'countbusyretry',_0x8841ee[_0x31ce('0xc7')]),_0x11b0bf['unlockAgent'],_0x11b0bf[_0x31ce('0xc8')]);}}break;case _0x31ce('0xc9'):_0x8841ee['outboundNoAnswerCallsDay']+=0x1;_0x11b0bf[_0x31ce('0xca')]+=0x1;_0x11b0bf[_0x31ce('0xa4')]=ut[_0x31ce('0xa5')](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x3,_0x31ce('0xcb'));rpcDb['createCustomerHistory'](_0x11b0bf,_0x31ce('0xcc'));if(ut[_0x31ce('0xa5')](_0x11b0bf)>=_0x8841ee['dialGlobalMaxRetry']){_0x15336f=ut[_0x31ce('0xa9')](_0x11b0bf,0xf,_0x31ce('0xc1'));rpcDb[_0x31ce('0x99')](_0x15336f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x11b0bf[_0x31ce('0xca')]>=_0x8841ee[_0x31ce('0xcd')]){rpcDb[_0x31ce('0x99')](_0x11b0bf,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x31ce('0xc5')](ut[_0x31ce('0xc6')](_0x11b0bf,_0x31ce('0xca'),_0x8841ee[_0x31ce('0xce')]),_0x11b0bf['unlockAgent'],_0x11b0bf[_0x31ce('0xc8')]);}}break;case _0x31ce('0xcf'):_0x8841ee[_0x31ce('0x40')]+=0x1;_0x11b0bf[_0x31ce('0xd0')]+=0x1;_0x11b0bf[_0x31ce('0xa4')]=ut[_0x31ce('0xa5')](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x8,_0x31ce('0xd1'));rpcDb[_0x31ce('0x97')](_0x11b0bf,_0x31ce('0xd2'));if(ut[_0x31ce('0xa5')](_0x11b0bf)>=_0x8841ee['dialGlobalMaxRetry']){_0x15336f=ut[_0x31ce('0xa9')](_0x11b0bf,0xf,_0x31ce('0xc1'));rpcDb[_0x31ce('0x99')](_0x15336f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x11b0bf['countcongestionretry']>=_0x8841ee['dialCongestionMaxRetry']){rpcDb[_0x31ce('0x99')](_0x11b0bf,_0x31ce('0xd2'));}else{rpcDb['rescheduleContact'](ut[_0x31ce('0xc6')](_0x11b0bf,_0x31ce('0xd0'),_0x8841ee['dialBusyRetryFrequency']),_0x11b0bf[_0x31ce('0xd3')],_0x11b0bf['activeContact']);}}break;case _0x31ce('0xd4'):_0x8841ee[_0x31ce('0x46')]+=0x1;_0x11b0bf['countglobal']=ut['totalGlobal'](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0x14,_0x31ce('0xd5'));rpcDb[_0x31ce('0x97')](_0x11b0bf,_0x31ce('0xd6'));if(_0x11b0bf[_0x31ce('0xd3')]){rpcDb[_0x31ce('0xd7')](_0x11b0bf['idContact']);}if(_0x11b0bf['activeContact']){rpcDb[_0x31ce('0xd8')](_0x11b0bf[_0x31ce('0xd9')]);}break;default:if(_0x11b0bf[_0x31ce('0x73')]){ut['decrementTalkink'](_0x8841ee,_0x31ce('0xda'));ut[_0x31ce('0x7e')](_0x31ce('0xdb')+_0x8841ee[_0x31ce('0x2a')],_0x22ad5c);}_0x8841ee['outboundUnknownCallsDay']+=0x1;_0x11b0bf['countglobal']=ut[_0x31ce('0xa5')](_0x11b0bf);ut[_0x31ce('0x91')](_0x11b0bf,0xc,_0x22ad5c[_0x31ce('0xdc')]||_0x22ad5c[_0x31ce('0xdd')]);rpcDb[_0x31ce('0x97')](_0x11b0bf,_0x31ce('0xde'));if(ut['totalGlobal'](_0x11b0bf)>=_0x8841ee[_0x31ce('0xa8')]){_0x15336f=ut[_0x31ce('0xa9')](_0x11b0bf,0xf,_0x31ce('0xc1'));rpcDb['createCustomerFinal'](_0x15336f,_0x31ce('0xdf'));}else{rpcDb[_0x31ce('0x99')](_0x11b0bf,_0x31ce('0xdf'));}delete this[_0x31ce('0x17')][_0x22ad5c[_0x31ce('0xab')]];}if(!(_0x11b0bf['dialAnswer']&&_0x26b075==='16')){ut[_0x31ce('0x7c')](_0x8841ee,_0x31ce('0xe0'));logger[_0x31ce('0x6e')](_0x31ce('0xe1'),_0x11b0bf[_0x31ce('0xe2')],'\x20Queue',_0x8841ee[_0x31ce('0x2a')],_0x31ce('0xe3'),_0x8841ee[_0x31ce('0x60')]);}if(_0x26b075!==_0x31ce('0xac')){delete this[_0x31ce('0x17')][_0x22ad5c[_0x31ce('0xab')]];delete this[_0x31ce('0x17')][_0x22ad5c[_0x31ce('0xe4')]];}}};Preview[_0x31ce('0xf')][_0x31ce('0xe5')]=function(_0x3bd9bf,_0x288fc1,_0x43c9e8){if(_[_0x31ce('0xe6')](_0x288fc1)&&_0x31ce('0xe7')!==typeof _0x288fc1){return;}if(_[_0x31ce('0xe6')](_0x43c9e8)&&'object'!==typeof _0x43c9e8){return;}switch(_0x43c9e8[_0x31ce('0xe8')]){case'0':ut[_0x31ce('0xe9')](_0x3bd9bf,0x0,'NoSuchNumber');rpcDb[_0x31ce('0xea')](_0x3bd9bf,_0x31ce('0xeb'));break;case'3':ut[_0x31ce('0xe9')](_0x3bd9bf,0x3,_0x31ce('0xcb'));rpcDb[_0x31ce('0xea')](_0x3bd9bf,_0x31ce('0xec'));break;case'5':ut[_0x31ce('0xe9')](_0x3bd9bf,0x5,'Busy');rpcDb[_0x31ce('0xea')](_0x3bd9bf,_0x31ce('0xed'));break;case'8':ut[_0x31ce('0xe9')](_0x3bd9bf,0x8,_0x31ce('0xd1'));rpcDb[_0x31ce('0xea')](_0x3bd9bf,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x31ce('0xe9')](_0x3bd9bf,0x16,_0x31ce('0xee'));rpcDb[_0x31ce('0xea')](_0x3bd9bf,_0x31ce('0xef'));break;default:ut[_0x31ce('0xe9')](_0x3bd9bf,0xc,_0x43c9e8[_0x31ce('0xe8')]);rpcDb[_0x31ce('0xea')](_0x3bd9bf,'[callProgressDetectingAgent][logCongestion]');}ut[_0x31ce('0x7c')](_0x288fc1,_0x31ce('0xf0'));logger[_0x31ce('0x6e')](_0x31ce('0xf1'),_0x3bd9bf[_0x31ce('0xe2')],_0x31ce('0xb0'),_0x288fc1[_0x31ce('0x2a')],_0x31ce('0xe3'),_0x288fc1[_0x31ce('0x60')]);delete this[_0x31ce('0x17')][_0x3bd9bf[_0x31ce('0xe2')]];};Preview[_0x31ce('0xf')][_0x31ce('0xf2')]=function(_0x4e3cc3,_0x14496d,_0x4d4e3a,_0x17a03b,_0x5b0bb9){var _0x22357c=this;return new BPromise(function(_0x306939,_0x24962e){if(_[_0x31ce('0x87')](_0x14496d)||_[_0x31ce('0x87')](_0x14496d[_0x31ce('0xf3')])||_['isNil'](_0x14496d[_0x31ce('0xf3')][_0x31ce('0xf4')])||_[_0x31ce('0x87')](_0x14496d[_0x31ce('0xf5')])){_0x24962e(ut[_0x31ce('0x7a')](_0x31ce('0xf6'),_0x17a03b,_0x5b0bb9));return;}var _0x58d339=uuid['v4']();var _0x538064=_0x22357c[_0x31ce('0x14')][_0x14496d[_0x31ce('0x70')][_0x31ce('0x2a')]];var _0x2e6246=_0x4d4e3a?_0x22357c[_0x31ce('0x18')][_0x4d4e3a]['id']:undefined;_0x22357c['actions'][_0x58d339]=new Action(_0x14496d,_0x538064,_0x58d339,_0x4d4e3a,_0x2e6246);var _0x147628=_0x22357c[_0x31ce('0x17')][_0x58d339];_0x147628['unlockAgent']=_0x17a03b;_0x147628[_0x31ce('0xc8')]=_0x5b0bb9;_0x147628[_0x31ce('0xf7')]=_0x4d4e3a;if(_['isEmpty'](_0x4e3cc3)){_0x22357c[_0x31ce('0xf8')](_0x147628,_0x538064,_0x14496d,_0x4d4e3a)[_0x31ce('0x86')](function(_0x4f8649){logger[_0x31ce('0x6e')]('[Preview][execCall][success]',_0x31ce('0xf9')+_0x147628['queue']+'\x20IdHopper:\x20'+_0x147628['idContact'],JSON[_0x31ce('0x5b')](_0x4f8649));ami['emit']('custom:agentcalled',ut['buildObj'](_0x147628,_0x31ce('0xfa')));_0x306939(ut[_0x31ce('0x7a')](_0x31ce('0xfb')));})[_0x31ce('0x79')](function(_0x44ef45){ut[_0x31ce('0xfc')]('[Preview][execCall][failure]',_0x44ef45);_0x24962e(ut[_0x31ce('0x7a')](_0x31ce('0xfd'),_0x17a03b,_0x5b0bb9));});}else{_0x538064[_0x31ce('0x3e')]+=0x1;ut[_0x31ce('0xfe')](_0x147628);rpcDb[_0x31ce('0xff')](_0x147628,_0x31ce('0x100'));delete _0x22357c[_0x31ce('0x17')][_0x58d339];_0x24962e(ut[_0x31ce('0x7a')](_0x31ce('0x101'),_0x17a03b,_0x5b0bb9));}});};Preview['prototype'][_0x31ce('0x9f')]=function(_0x3da1fa){return!_[_0x31ce('0x87')](_0x3da1fa)&&!_['isNil'](_0x3da1fa[_0x31ce('0x2a')])&&!_['isNil'](_0x3da1fa[_0x31ce('0x59')])&&_0x3da1fa[_0x31ce('0x59')]&&!_[_0x31ce('0x87')](this[_0x31ce('0x16')][util[_0x31ce('0x5c')](_0x31ce('0x102'),_0x3da1fa[_0x31ce('0x2a')])])&&!_[_0x31ce('0x87')](this[_0x31ce('0x16')][util['format']('SIP/%s',_0x3da1fa[_0x31ce('0x2a')])][_0x31ce('0x78')])&&(this['trunks'][util[_0x31ce('0x5c')]('SIP/%s',_0x3da1fa['name'])]['status']==='reachable'||this[_0x31ce('0x16')][util[_0x31ce('0x5c')](_0x31ce('0x102'),_0x3da1fa[_0x31ce('0x2a')])][_0x31ce('0x78')]==='unmonitored');};Preview['prototype'][_0x31ce('0x8b')]=function(_0x49dd24,_0x5b04b6){var _0x2b0199=this;return new BPromise(function(_0x3b5107,_0x2ee65f){_0x2b0199[_0x31ce('0x103')](_0x49dd24,_0x5b04b6)['then'](function(_0x5cbd60){_0x3b5107(_['pick'](_0x5cbd60,['message']));})[_0x31ce('0x79')](function(_0x25da53){if(_0x25da53[_0x31ce('0x104')]){rpcDb[_0x31ce('0xd7')](_0x49dd24);}if(_0x25da53[_0x31ce('0x59')]){rpcDb['disableContact'](_0x49dd24);}_0x2ee65f(_[_0x31ce('0x74')](_0x25da53,[_0x31ce('0x7a')]));});});};Preview[_0x31ce('0xf')][_0x31ce('0x103')]=function(_0x3c16d3,_0x1313d9){var _0x3b4435=this;return new BPromise(function(_0x25eac5,_0x2b9d7a){var _0x456379,_0x36d6b7;rpcDb['getContactPreview'](_0x3c16d3)[_0x31ce('0x86')](function(_0x3b2b1b){if(!_[_0x31ce('0x87')](_0x3b2b1b[0x0])){_0x36d6b7=_0x3b2b1b[0x0]['recallme']?![]:!![];_0x456379=_0x3b2b1b[0x0]['recallme']?!![]:![];_0x456379=_0x1313d9?!![]:_0x456379;}var _0x570088=_0x3b4435['validateContact'](_0x3b2b1b);if(_0x570088[_0x31ce('0x105')]){rpcDb[_0x31ce('0x106')](_[_0x31ce('0x74')](_0x3b2b1b[0x0],[_0x31ce('0xf5'),'Contact.phone']))[_0x31ce('0x86')](function(_0x4cc378){_0x3b4435[_0x31ce('0xf2')](_0x4cc378,_0x3b2b1b[0x0],_0x1313d9,_0x36d6b7,_0x456379)[_0x31ce('0x86')](function(_0x3d7364){_0x25eac5(_0x3d7364);})[_0x31ce('0x79')](function(_0x20f38e){_0x2b9d7a(_0x20f38e);});})['catch'](function(_0x1d17c0){ut[_0x31ce('0xfc')](_0x31ce('0x107'),_0x1d17c0);_0x2b9d7a(ut['message'](_0x31ce('0x108'),_0x36d6b7,_0x456379));});}else{_0x2b9d7a(ut[_0x31ce('0x7a')](_0x570088[_0x31ce('0x7a')],_0x36d6b7,_0x456379));}})[_0x31ce('0x79')](function(_0x59b9a8){ut[_0x31ce('0xfc')](_0x31ce('0x109'),_0x59b9a8);_0x2b9d7a(ut[_0x31ce('0x7a')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x31ce('0xf')]['validateContact']=function(_0x5c7473){if(_[_0x31ce('0x87')](_0x5c7473)||_[_0x31ce('0x10a')](_0x5c7473)||!_[_0x31ce('0x87')](_0x5c7473[0x0]['Agent'])&&_['isNil'](_0x5c7473[0x0][_0x31ce('0x10b')]['name'])){ut[_0x31ce('0xfc')]('[Preview][validateContact][Empty\x20Contact]',_0x5c7473);return{'isValid':![],'message':_0x31ce('0x10c')};}var _0x45c6d8=this[_0x31ce('0x14')][_0x5c7473[0x0]['Queue']['name']];_0x45c6d8[_0x31ce('0x7a')]=_0x31ce('0xa2');if(_['isNil'](_0x45c6d8)){ut[_0x31ce('0xfc')]('[Preview][validateContact][Empty\x20Campaign]',_0x45c6d8);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x31ce('0x9f')](_0x45c6d8[_0x31ce('0x58')])){ut[_0x31ce('0xfc')](_0x31ce('0x10d'),_0x31ce('0x10e')+_0x45c6d8[_0x31ce('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x45c6d8[_0x31ce('0xa0')])){ut[_0x31ce('0xfc')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x45c6d8[_0x31ce('0x2a')]+_0x31ce('0x10f'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x31ce('0x110')](_0x45c6d8[_0x31ce('0x36')])){ut['logger'](_0x31ce('0x111'),_0x45c6d8[_0x31ce('0x2a')]+_0x31ce('0x112'));return{'isValid':![],'message':_0x31ce('0x10e')+_0x45c6d8[_0x31ce('0x2a')]+_0x31ce('0x112')};}return{'isValid':!![],'message':_0x31ce('0x113')};};Preview[_0x31ce('0xf')][_0x31ce('0xf8')]=function(_0x16e75d,_0x48d73f,_0x574d88,_0x2fda8e){var _0x53c54a=this;return new BPromise(function(_0x16e4a5,_0x1e4ca4){var _0x53955d=_0x16e75d['uniqueid'];var _0x4a0594=_0x53c54a[_0x31ce('0x9f')](_0x48d73f[_0x31ce('0x58')])?util[_0x31ce('0x5c')](_0x31ce('0x114'),_0x48d73f[_0x31ce('0x58')]['name'],_['isNil'](_0x48d73f[_0x31ce('0x3b')])?'':_0x48d73f[_0x31ce('0x3b')][_0x31ce('0x115')]()||'',_0x48d73f[_0x31ce('0x116')]>0x0?_0x574d88['Contact'][_0x31ce('0xf4')]['substring'](_0x48d73f[_0x31ce('0x116')]):_0x574d88[_0x31ce('0xf3')][_0x31ce('0xf4')]):util['format'](_0x31ce('0x114'),_[_0x31ce('0x87')](_0x48d73f['TrunkBackup'])?_0x48d73f[_0x31ce('0x58')][_0x31ce('0x2a')]:_0x48d73f['TrunkBackup']['name'],_[_0x31ce('0x87')](_0x48d73f['dialPrefix'])?'':_0x48d73f[_0x31ce('0x3b')][_0x31ce('0x115')]()||'',_0x48d73f[_0x31ce('0x116')]>0x0?_0x574d88['Contact'][_0x31ce('0xf4')][_0x31ce('0x117')](_0x48d73f[_0x31ce('0x116')]):_0x574d88[_0x31ce('0xf3')]['phone']);var _0x252986=_0x53c54a['isTrunkReachable'](_0x48d73f[_0x31ce('0x58')])?ut[_0x31ce('0x118')](_0x48d73f[_0x31ce('0x58')][_0x31ce('0x119')],_0x48d73f['dialOriginateCallerIdName'],_0x48d73f[_0x31ce('0x11a')]>0x0?ut[_0x31ce('0x11b')](_0x48d73f['dialOriginateCallerIdNumber'],_0x48d73f[_0x31ce('0x11a')]):_0x48d73f['dialOriginateCallerIdNumber']):ut[_0x31ce('0x118')](_[_0x31ce('0x87')](_0x48d73f['TrunkBackup'])?_0x48d73f['Trunk'][_0x31ce('0x119')]:_0x48d73f[_0x31ce('0xa0')]['callerid'],_0x48d73f[_0x31ce('0x38')],_0x48d73f['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x31ce('0x11b')](_0x48d73f[_0x31ce('0x39')],_0x48d73f[_0x31ce('0x11a')]):_0x48d73f[_0x31ce('0x39')]);if(_0x252986){_0x16e75d[_0x31ce('0x11c')]=ut[_0x31ce('0x11d')](_0x252986);_0x16e75d[_0x31ce('0x11e')]=ut[_0x31ce('0x11f')](_0x252986);}var _0x2f88d3=ut[_0x31ce('0x120')](_0x48d73f,_0x574d88,_0x4a0594,_0x252986,_0x53955d,_0x16e75d);_[_0x31ce('0x121')](_0x16e75d,ut[_0x31ce('0x122')](_0x2f88d3));_0x16e75d[_0x31ce('0x8e')]=moment()[_0x31ce('0x5c')](_0x31ce('0x8f'));ami[_0x31ce('0x123')](ut[_0x31ce('0x124')](_0x16e75d,_0x48d73f,_0x2f88d3,_0x16e75d['activeContact'],_0x2fda8e))['then'](function(_0x280e45){_0x48d73f[_0x31ce('0x60')]+=0x1;logger['info'](_0x31ce('0x125'),_0x53955d,'\x20Queue',_0x48d73f[_0x31ce('0x2a')],_0x31ce('0xe3'),_0x48d73f['originated']);_0x16e4a5(_0x280e45);})[_0x31ce('0x79')](function(_0x1cd747){ut[_0x31ce('0xe9')](_0x16e75d,0xe,_0x31ce('0x126'));rpcDb[_0x31ce('0xea')](_0x16e75d,_0x31ce('0x127'));_0x1e4ca4(_0x1cd747);});});};Preview[_0x31ce('0xf')][_0x31ce('0x22')]=function(_0x74fcb2){if(this['actions'][_0x74fcb2[_0x31ce('0xab')]]){this['actions'][_0x74fcb2[_0x31ce('0xab')]][_0x31ce('0x128')]=_0x74fcb2['channel'];}};Preview['prototype'][_0x31ce('0x1b')]=function(_0xa31001){var _0x316545=this;var _0x5bb93b=this[_0x31ce('0x17')][_0xa31001['actionid']];if(_0x5bb93b){if(_0x5bb93b[_0x31ce('0xf7')]&&this[_0x31ce('0x18')][_0x5bb93b['lookAgent']]){ut[_0x31ce('0x129')](_0x5bb93b,this['agents'][_0x5bb93b[_0x31ce('0xf7')]]['name'],this[_0x31ce('0x18')][_0x5bb93b['lookAgent']]['id']);}var _0xe087b9=_[_0x31ce('0x12a')](_0x5bb93b);_0xe087b9[_0x31ce('0xad')]=moment()[_0x31ce('0x5c')](_0x31ce('0x8f'));var _0x49ff36=_0x316545[_0x31ce('0x14')][_0x5bb93b[_0x31ce('0x71')]];if(ut[_0x31ce('0x12b')](_0xa31001[_0x31ce('0x12c')])){if(_0x5bb93b[_0x31ce('0xd3')]){rpcDb[_0x31ce('0xd7')](_0x5bb93b[_0x31ce('0xd9')]);}if(_0x5bb93b[_0x31ce('0xc8')]){rpcDb[_0x31ce('0xd8')](_0x5bb93b[_0x31ce('0xd9')]);}ami[_0x31ce('0x28')](_0x31ce('0x12d'),ut[_0x31ce('0xb2')](_0x5bb93b,_0x31ce('0x12e')));this[_0x31ce('0xe5')](_0xe087b9,_0x49ff36,_0xa31001);}else{_0x5bb93b['starttime']=moment()[_0x31ce('0x5c')](_0x31ce('0x8f'));ut['logAgent'](_0xe087b9,0x4,'Answer');rpcDb[_0x31ce('0xea')](_0xe087b9,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x31ce('0xf')][_0x31ce('0x1d')]=function(_0x2782bc){var _0x185982=this;var _0x1c0d05=this[_0x31ce('0x17')][_0x2782bc['linkedid']];var _0x3b0cde;if(_0x1c0d05){_0x3b0cde=this['campaignsPreview'][_0x1c0d05[_0x31ce('0x71')]];logger[_0x31ce('0x6e')](_0x31ce('0x12f'),_0x2782bc[_0x31ce('0xab')],_0x31ce('0xb0'),_0x3b0cde['name'],_0x31ce('0x72'),_0x3b0cde['pTalking']);}if(this[_0x31ce('0x17')][_0x2782bc[_0x31ce('0xab')]]&&_0x2782bc[_0x31ce('0xab')]!==_0x2782bc[_0x31ce('0xe2')]){if(_0x2782bc['cause']==='16'&&this[_0x31ce('0x17')][_0x2782bc[_0x31ce('0xab')]]['dialAnswer']){this[_0x31ce('0xa3')](_0x2782bc,_0x2782bc[_0x31ce('0xab')],_0x2782bc[_0x31ce('0x130')]);}else if(this[_0x31ce('0x17')][_0x2782bc[_0x31ce('0xab')]][_0x31ce('0x73')]){logger['info'](_0x31ce('0x131'),_0x2782bc[_0x31ce('0xab')],_0x2782bc['cause'],_0x31ce('0xb0'),_0x3b0cde[_0x31ce('0x2a')],'pTalking:\x20',_0x3b0cde[_0x31ce('0x2d')]);this[_0x31ce('0xa3')](_0x2782bc,_0x2782bc[_0x31ce('0xab')],_0x2782bc[_0x31ce('0x130')]);}}else if(_0x1c0d05&&_[_0x31ce('0x87')](_0x1c0d05[_0x31ce('0x132')])&&_0x3b0cde[_0x31ce('0x133')]&&_0x2782bc[_0x31ce('0xab')]===_0x2782bc[_0x31ce('0xe2')]&&_[_0x31ce('0x87')](_0x2782bc['reason'])&&_0x2782bc[_0x31ce('0x130')]==='16'&&_0x2782bc[_0x31ce('0x134')]==='6'&&_[_0x31ce('0xe6')](_0x1c0d05[_0x31ce('0x135')])){if(_0x1c0d05[_0x31ce('0xd3')]){rpcDb[_0x31ce('0xd7')](_0x1c0d05['idContact']);}if(_0x1c0d05[_0x31ce('0xc8')]){rpcDb['disableContact'](_0x1c0d05[_0x31ce('0xd9')]);}_0x2782bc[_0x31ce('0xe8')]='22';this[_0x31ce('0xe5')](_0x1c0d05,_0x3b0cde,_0x2782bc);}else if(_0x1c0d05&&_0x1c0d05[_0x31ce('0x135')]){if(_0x2782bc[_0x31ce('0x130')]==='16'&&this[_0x31ce('0x17')][_0x2782bc[_0x31ce('0xab')]]['dialAnswer']){logger[_0x31ce('0x6e')](_0x31ce('0x136'),_0x2782bc[_0x31ce('0xab')],_0x2782bc[_0x31ce('0x130')],'\x20Queue',_0x3b0cde[_0x31ce('0x2a')],_0x31ce('0x72'),_0x3b0cde[_0x31ce('0x2d')]);this[_0x31ce('0xa3')](_0x2782bc,_0x2782bc[_0x31ce('0xab')],_0x2782bc['cause']);}else if(this[_0x31ce('0x17')][_0x2782bc[_0x31ce('0xab')]]['dialAnswer']){logger[_0x31ce('0x6e')](_0x31ce('0x131'),_0x2782bc[_0x31ce('0xab')],_0x2782bc[_0x31ce('0x130')],_0x31ce('0xb0'),_0x3b0cde['name'],_0x31ce('0x72'),_0x3b0cde[_0x31ce('0x2d')]);this[_0x31ce('0xa3')](_0x2782bc,_0x2782bc[_0x31ce('0xab')],_0x2782bc[_0x31ce('0x130')]);}}};Preview[_0x31ce('0xf')][_0x31ce('0x20')]=function(_0x531e99){if(this['actions'][_0x531e99[_0x31ce('0xe4')]]&&_0x531e99[_0x31ce('0xe4')]!==_0x531e99['destuniqueid']){this['callProgressDetectingCustomer'](_0x531e99,_0x531e99[_0x31ce('0xe4')],_0x531e99[_0x31ce('0xdd')]);}};Preview[_0x31ce('0xf')][_0x31ce('0x137')]=function(_0xfed064){if(this[_0x31ce('0x17')][_0xfed064[_0x31ce('0xab')]]&&_0xfed064[_0x31ce('0xab')]!==_0xfed064[_0x31ce('0xe2')]&&!this[_0x31ce('0x17')][_0xfed064[_0x31ce('0xab')]][_0x31ce('0x73')]){if(_0xfed064[_0x31ce('0x130')]==='1'){this[_0x31ce('0xa3')](_0xfed064,_0xfed064['linkedid'],_0xfed064['cause']);}}};Preview[_0x31ce('0xf')][_0x31ce('0x138')]=function(_0x46ad78,_0x236a5d,_0x4f804c){if(this[_0x31ce('0x17')][_0x46ad78]){if(_[_0x31ce('0x87')](this[_0x31ce('0x17')][_0x46ad78][_0x31ce('0x139')])){this['actions'][_0x46ad78]['variables']={};}this['actions'][_0x46ad78][_0x31ce('0x139')][_0x236a5d]=_0x4f804c;}};Preview[_0x31ce('0xf')]['syncVarSet']=function(_0x4f07c6){try{if(!_[_0x31ce('0x87')](_0x4f07c6)){if(ut[_0x31ce('0x13a')](_[_0x31ce('0x13b')](_0x4f07c6['variable'])[0x0])){this[_0x31ce('0x138')](_0x4f07c6[_0x31ce('0xe2')],_[_0x31ce('0x13b')](_0x4f07c6[_0x31ce('0x13c')])[0x0],_0x4f07c6[_0x31ce('0x13d')]);}}}catch(_0x52dcd0){logger[_0x31ce('0x13e')]('[syncVarSet][Preview]',util[_0x31ce('0x13f')](_0x52dcd0,{'showHidden':![],'depth':null}));}};Preview[_0x31ce('0xf')]['syncAttendedTransfer']=function(_0x24b79f){if(_0x24b79f){if(this['actions'][_0x24b79f[_0x31ce('0x140')]]){this['actions'][_0x24b79f[_0x31ce('0x140')]][_0x31ce('0x135')]=!![];}}};Preview[_0x31ce('0xf')][_0x31ce('0x27')]=function(_0x2858ef){if(_0x2858ef){if(this[_0x31ce('0x17')][_0x2858ef[_0x31ce('0x141')]]){this[_0x31ce('0x17')][_0x2858ef['transfererlinkedid']][_0x31ce('0x135')]=!![];}}};module[_0x31ce('0x142')]=Preview; \ No newline at end of file +var _0xb6ab=['rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','AgentReject','[syncHangupRequest][logAgentReject]','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','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','dialCutDigit','phone','substring','trim','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','dialstatus','syncHangupRequest','addVariable','variables','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','preview','outbound','clockClearZombieChannels','clearZombieChannels','dialActive','setMessage','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','[RecallMe]','catch','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','pTalking:\x20','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry'];(function(_0x515eec,_0x466442){var _0x8b5046=function(_0x1277d7){while(--_0x1277d7){_0x515eec['push'](_0x515eec['shift']());}};_0x8b5046(++_0x466442);}(_0xb6ab,0x7e));var _0xbb6a=function(_0x42dfe5,_0x2e16cf){_0x42dfe5=_0x42dfe5-0x0;var _0x3bed33=_0xb6ab[_0x42dfe5];return _0x3bed33;};'use strict';var util=require(_0xbb6a('0x0'));var _=require(_0xbb6a('0x1'));var BPromise=require(_0xbb6a('0x2'));var uuid=require('uuid');var moment=require(_0xbb6a('0x3'));var md5=require('md5');var Redis=require(_0xbb6a('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('preview');var loggerAction=require('../../../config/logger')(_0xbb6a('0x5'));var ami=require(_0xbb6a('0x6'));var rpcDb=require(_0xbb6a('0x7'));var Action=require(_0xbb6a('0x8'));var ut=require(_0xbb6a('0x9'));config[_0xbb6a('0xa')]=_[_0xbb6a('0xb')](config[_0xbb6a('0xa')],{'host':_0xbb6a('0xc'),'port':0x18eb});var io=require(_0xbb6a('0xd'))(new Redis(config[_0xbb6a('0xa')]));var Sequence=function(){};Sequence[_0xbb6a('0xe')][_0xbb6a('0xf')]=function(_0x2a1ef7){this[_0xbb6a('0x10')]=this[_0xbb6a('0x10')]?this[_0xbb6a('0x10')][_0xbb6a('0x11')](_0x2a1ef7):_0x2a1ef7();};function Preview(_0x2548f4){this[_0xbb6a('0x12')]=new Sequence();this[_0xbb6a('0x13')]=_0x2548f4[_0xbb6a('0x14')];this[_0xbb6a('0x15')]=_0x2548f4[_0xbb6a('0x15')];this['actions']={};this['agents']=_0x2548f4[_0xbb6a('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0xbb6a('0x17'),this[_0xbb6a('0x18')][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x1a'),this[_0xbb6a('0x1b')][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x1c'),this['syncHangupRequest'][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x1d'),this[_0xbb6a('0x1e')][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x1f'),this[_0xbb6a('0x20')][_0xbb6a('0x19')](this));ami['on']('varset',this[_0xbb6a('0x21')][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x22'),this[_0xbb6a('0x23')][_0xbb6a('0x19')](this));ami['on'](_0xbb6a('0x24'),this[_0xbb6a('0x25')][_0xbb6a('0x19')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x107933,_0x4b9273,_0x510f6e){io['to'](_0x107933)[_0xbb6a('0x26')](_0x4b9273,_0x510f6e);}function emitCampaignPreview(_0x36640c){if(_0x36640c[_0xbb6a('0x27')]==='outbound'){var _0x59d507={'id':_0x36640c['id'],'name':_0x36640c[_0xbb6a('0x28')],'strategy':_0x36640c[_0xbb6a('0x29')],'answered':_0x36640c[_0xbb6a('0x2a')],'available':_0x36640c[_0xbb6a('0x2b')],'loggedIn':_0x36640c[_0xbb6a('0x2c')],'pTalking':_0x36640c[_0xbb6a('0x2d')],'sumBillable':_0x36640c[_0xbb6a('0x2e')],'sumDuration':_0x36640c[_0xbb6a('0x2f')],'sumHoldTime':_0x36640c[_0xbb6a('0x30')]||0x0,'talking':_0x36640c[_0xbb6a('0x31')],'total':_0x36640c[_0xbb6a('0x32')],'type':_0x36640c[_0xbb6a('0x27')],'unmanaged':_0x36640c[_0xbb6a('0x33')],'abandoned':_0x36640c['abandoned'],'waiting':_0x36640c['waiting'],'loggedInDb':_0x36640c['loggedInDb'],'dialActive':_0x36640c['dialActive'],'dialMethod':_0x36640c[_0xbb6a('0x34')],'dialOriginateCallerIdName':_0x36640c[_0xbb6a('0x35')],'dialOriginateCallerIdNumber':_0x36640c[_0xbb6a('0x36')],'dialOriginateTimeout':_0x36640c[_0xbb6a('0x37')],'dialPrefix':_0x36640c[_0xbb6a('0x38')],'outboundAnswerAgiCallsDay':_0x36640c[_0xbb6a('0x39')],'outboundAnswerCallsDay':_0x36640c['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x36640c[_0xbb6a('0x3a')],'outboundBusyCallsDay':_0x36640c[_0xbb6a('0x3b')],'outboundCongestionCallsDay':_0x36640c[_0xbb6a('0x3c')],'outboundDropCallsDayACS':_0x36640c[_0xbb6a('0x3d')],'outboundDropCallsDayCallersExit':_0x36640c[_0xbb6a('0x3e')],'outboundDropCallsDayTimeout':_0x36640c[_0xbb6a('0x3f')],'outboundNoAnswerCallsDay':_0x36640c['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x36640c[_0xbb6a('0x40')],'outboundOriginateFailureCallsDay':_0x36640c[_0xbb6a('0x41')],'outboundReCallsDay':_0x36640c[_0xbb6a('0x42')],'outboundRejectCallsDay':_0x36640c[_0xbb6a('0x43')],'outboundUnknownCallsDay':_0x36640c[_0xbb6a('0x44')],'predictiveIntervalAnsweredCalls':_0x36640c[_0xbb6a('0x45')],'predictiveIntervalAvgHoldtime':_0x36640c[_0xbb6a('0x46')],'predictiveIntervalAvgTalktime':_0x36640c[_0xbb6a('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x36640c[_0xbb6a('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x36640c[_0xbb6a('0x49')],'predictiveIntervalErlangCalls':_0x36640c[_0xbb6a('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x36640c[_0xbb6a('0x4b')],'predictiveIntervalHitRate':_0x36640c[_0xbb6a('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x36640c['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x36640c[_0xbb6a('0x4d')],'predictiveIntervalAvailable':_0x36640c[_0xbb6a('0x4e')],'predictiveIntervalTotalCalls':_0x36640c[_0xbb6a('0x4f')],'message':_0x36640c['message'],'originated':_0x36640c[_0xbb6a('0x50')],'erlangCalls':_0x36640c[_0xbb6a('0x51')],'erlangCallToSecond':_0x36640c[_0xbb6a('0x52')],'erlangAbandonmentRate':_0x36640c[_0xbb6a('0x53')],'erlangBusyFactor':_0x36640c[_0xbb6a('0x54')],'startPredictive':_0x36640c['startPredictive'],'startProgressive':_0x36640c['startProgressive']};if(_0x36640c['Trunk']){_0x59d507['Trunk']={'id':_0x36640c['Trunk']['id'],'name':_0x36640c[_0xbb6a('0x55')][_0xbb6a('0x28')],'active':_0x36640c[_0xbb6a('0x55')][_0xbb6a('0x56')],'callerid':_0x36640c[_0xbb6a('0x55')][_0xbb6a('0x57')]};}if(_0x36640c[_0xbb6a('0x58')]){_0x59d507[_0xbb6a('0x58')]={'id':_0x36640c[_0xbb6a('0x58')]['id'],'name':_0x36640c[_0xbb6a('0x58')][_0xbb6a('0x28')]};}var _0x50cdfe=md5(JSON[_0xbb6a('0x59')](_0x59d507));if(_0x36640c[_0xbb6a('0x5a')]!==_0x50cdfe){_0x36640c[_0xbb6a('0x5a')]=_0x50cdfe;emit(util[_0xbb6a('0x5b')](_0xbb6a('0x5c'),_0x59d507[_0xbb6a('0x28')]),_0xbb6a('0x5d'),_0x59d507);}}}function emitVoiceQueueChannelRemove(_0x5753d6){emit(util[_0xbb6a('0x5b')](_0xbb6a('0x5c'),_0x5753d6[_0xbb6a('0x28')]),_0xbb6a('0x5e'),_0x5753d6);}function notSendMessagesQueue(_0x40baeb){if(_0x40baeb['sendMessageOneNotActive']){if(_0x40baeb[_0xbb6a('0x50')]===0x0&&_0x40baeb[_0xbb6a('0x2d')]===0x0){_0x40baeb[_0xbb6a('0x5f')]=![];_0x40baeb[_0xbb6a('0x2b')]=0x0;_0x40baeb[_0xbb6a('0x60')]=0x0;_0x40baeb[_0xbb6a('0x61')]=_0xbb6a('0x62');ut[_0xbb6a('0x63')](_0xbb6a('0x64'),_0x40baeb['name']+_0xbb6a('0x65'));}else{_0x40baeb[_0xbb6a('0x61')]=_0xbb6a('0x66');ut[_0xbb6a('0x63')](_0xbb6a('0x64'),_0x40baeb['name']+_0xbb6a('0x67'));}emitCampaignPreview(_0x40baeb);}}Preview['prototype'][_0xbb6a('0x68')]=function(){var _0x535e9b=this;setInterval(function(){_0x535e9b[_0xbb6a('0x69')]();},0x7cf);};Preview[_0xbb6a('0xe')]['syncCampaigns']=function(){var _0x5fb247=this[_0xbb6a('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x4b2c36 in _0x5fb247){if(_0x5fb247[_0xbb6a('0x6a')](_0x4b2c36)&&(_0x5fb247[_0x4b2c36][_0xbb6a('0x34')]===_0xbb6a('0x6b')||_0x5fb247[_0x4b2c36]['dialMethod']==='booked')&&_0x5fb247[_0x4b2c36][_0xbb6a('0x27')]===_0xbb6a('0x6c')){if(this[_0xbb6a('0x6d')]>0x7){this[_0xbb6a('0x6d')]=0x0;this[_0xbb6a('0x6e')]();}}if(_0x5fb247[_0xbb6a('0x6a')](_0x4b2c36)&&_0x5fb247[_0x4b2c36][_0xbb6a('0x34')]==='preview'&&_0x5fb247[_0x4b2c36][_0xbb6a('0x27')]===_0xbb6a('0x6c')){if(_0x5fb247[_0x4b2c36][_0xbb6a('0x6f')]){this[_0xbb6a('0x70')](_0x5fb247[_0x4b2c36]);this['recallMe'](_0x5fb247[_0x4b2c36]);}else{notSendMessagesQueue(_0x5fb247[_0x4b2c36]);}}}};Preview[_0xbb6a('0xe')][_0xbb6a('0x71')]=function(_0x32116a){var _0x5760fc=this;this[_0xbb6a('0x12')][_0xbb6a('0xf')](function(){if(!_[_0xbb6a('0x72')](_0x5760fc['actions'][_0x32116a])){loggerAction[_0xbb6a('0x73')](_0xbb6a('0x74'),_0x32116a,_0xbb6a('0x75'),_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x77')],_0xbb6a('0x78'),JSON['stringify'](_0x5760fc[_0xbb6a('0x13')][_0x5760fc['actions'][_0x32116a][_0xbb6a('0x77')]][_0xbb6a('0x50')]),'pTalking:\x20',JSON['stringify'](_0x5760fc[_0xbb6a('0x13')][_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x77')]]['pTalking']),JSON[_0xbb6a('0x59')](_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x79')]),JSON[_0xbb6a('0x59')](_[_0xbb6a('0x7a')](_0x5760fc['actions'][_0x32116a],[_0xbb6a('0x7b'),'UserId',_0xbb6a('0x7c'),_0xbb6a('0x7d')])));return ami[_0xbb6a('0x7e')]({'action':_0xbb6a('0x7f'),'channel':_0x5760fc['actions'][_0x32116a][_0xbb6a('0x80')]})['catch'](function(_0x1c10a0){if(_0x1c10a0[_0xbb6a('0x61')]===_0xbb6a('0x81')){setTimeout(function(){if(_0x5760fc[_0xbb6a('0x76')][_0x32116a]){ut['updateOriginated'](_0x5760fc['campaignsPreview'][_0x5760fc['actions'][_0x32116a][_0xbb6a('0x77')]],_0xbb6a('0x82'));if(_0x5760fc[_0xbb6a('0x76')][_0x32116a]['dialAnswer']===!![]){ut[_0xbb6a('0x83')](_0x5760fc['campaignsPreview'][_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x77')]],_0xbb6a('0x82'));ut[_0xbb6a('0x84')](_0xbb6a('0x85')+_0x32116a,_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x77')]);}ut['loggerError'](_0xbb6a('0x86')+_0x32116a,_0x5760fc[_0xbb6a('0x76')][_0x32116a][_0xbb6a('0x77')]);delete _0x5760fc[_0xbb6a('0x76')][_0x32116a];}},0x2328);}});}});};Preview[_0xbb6a('0xe')]['clearZombieChannels']=function(){var _0x48d67a=this;loggerAction[_0xbb6a('0x73')](_0xbb6a('0x87'),_[_0xbb6a('0x88')](this['actions']));for(var _0x1f1da3 in this['actions']){if(_0x48d67a[_0xbb6a('0x76')]['hasOwnProperty'](_0x1f1da3)){_0x48d67a[_0xbb6a('0x71')](_0x1f1da3);}}};Preview[_0xbb6a('0xe')][_0xbb6a('0x89')]=function(_0x1c5dde){var _0x4dd776=this;rpcDb[_0xbb6a('0x8a')](_0x1c5dde['id'],ut[_0xbb6a('0x8b')](this['agents']))[_0xbb6a('0x8c')](function(_0x16b8db){if(!_[_0xbb6a('0x72')](_0x16b8db)){for(var _0x26cfcb=0x0;_0x26cfcb<_0x16b8db[_0xbb6a('0x8d')];_0x26cfcb+=0x1){if(ut[_0xbb6a('0x8e')](_0x16b8db[_0x26cfcb][_0xbb6a('0x8f')])<_0x1c5dde[_0xbb6a('0x90')]*0x3c){_0x4dd776['run'](_0x16b8db[_0x26cfcb]['id'])[_0xbb6a('0x8c')](ut['logger2'](_0xbb6a('0x91')))[_0xbb6a('0x92')](ut[_0xbb6a('0x93')](_0xbb6a('0x91')));}else{var _0x429896=new Action(_0x16b8db[_0x26cfcb],_0x1c5dde);_0x429896[_0xbb6a('0x94')]=moment()['format'](_0xbb6a('0x95'));_0x1c5dde[_0xbb6a('0x42')]+=0x1;ut[_0xbb6a('0x96')](_0x429896,0x17,_0xbb6a('0x97'));if(_0x1c5dde[_0xbb6a('0x98')]){rpcDb[_0xbb6a('0x99')](ut['createBody'](_0x16b8db[_0x26cfcb]));rpcDb[_0xbb6a('0x9a')](_0x429896,_0xbb6a('0x9b'));}else{ut['logCustomer'](_0x429896,0x16,_0xbb6a('0x9c'));rpcDb['createCustomerHistory'](_0x429896,_0xbb6a('0x9d'));rpcDb['createCustomerFinal'](_0x429896,_0xbb6a('0x9d'));}}}}})[_0xbb6a('0x92')](ut['logger2'](_0xbb6a('0x9e')));};Preview[_0xbb6a('0xe')]['setMessage']=function(_0x5f561f){_0x5f561f[_0xbb6a('0x5f')]=!![];if(ut[_0xbb6a('0x9f')](_0x5f561f[_0xbb6a('0x2c')])){_0x5f561f[_0xbb6a('0x61')]=_0xbb6a('0xa0');}else if(!ut[_0xbb6a('0xa1')](_0x5f561f[_0xbb6a('0x6f')])){_0x5f561f['message']=_0xbb6a('0x62');}else if(!this[_0xbb6a('0xa2')](_0x5f561f['Trunk'])){if(!this[_0xbb6a('0xa2')](_0x5f561f[_0xbb6a('0xa3')])){_0x5f561f['message']=_0xbb6a('0xa4');}else{_0x5f561f[_0xbb6a('0x61')]=_0xbb6a('0xa5');}}else{_0x5f561f[_0xbb6a('0x61')]=_0xbb6a('0xa5');}emitCampaignPreview(_0x5f561f);};Preview[_0xbb6a('0xe')]['callProgressDetectingCustomer']=function(_0x31a1c4,_0x1e61bb,_0x3ace56){var _0x499f01=this;var _0x4e716a=this[_0xbb6a('0x76')][_0x1e61bb];var _0x39aeb2=this[_0xbb6a('0x13')][_0x4e716a[_0xbb6a('0x77')]];var _0x7f9168;if(_0x39aeb2){switch(_0x3ace56){case'1':_0x39aeb2[_0xbb6a('0x40')]+=0x1;_0x4e716a['countglobal']=ut[_0xbb6a('0xa6')](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0x0,_0xbb6a('0xa7'));rpcDb['createCustomerHistory'](_0x4e716a,_0xbb6a('0xa8'));if(ut[_0xbb6a('0xa6')](_0x4e716a)>=_0x39aeb2[_0xbb6a('0xa9')]){_0x7f9168=ut[_0xbb6a('0xaa')](_0x4e716a,0xf,_0xbb6a('0xab'));rpcDb[_0xbb6a('0xac')](_0x7f9168,_0xbb6a('0xad'));}else{rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xad'));}delete this[_0xbb6a('0x76')][_0x31a1c4[_0xbb6a('0xae')]];break;case _0xbb6a('0xaf'):var _0x24482b=moment()[_0xbb6a('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e716a[_0xbb6a('0xb0')]=_0x24482b;_0x4e716a[_0xbb6a('0xb1')]=_0x24482b;_0x4e716a[_0xbb6a('0x79')]=!![];_0x39aeb2['pTalking']+=0x1;logger[_0xbb6a('0x73')](_0xbb6a('0xb2'),_0x4e716a[_0xbb6a('0xb3')],'\x20Queue',_0x39aeb2[_0xbb6a('0x28')],'pTalking:\x20',_0x39aeb2['pTalking']);ami['emit']('custom:agentconnect',ut[_0xbb6a('0xb4')](_0x4e716a,_0xbb6a('0xb5')));if(_0x39aeb2[_0xbb6a('0xb6')]){ami[_0xbb6a('0x26')](_0xbb6a('0xb7'),ut['buildAcw'](_0x4e716a));}break;case'16':ami[_0xbb6a('0x26')](_0xbb6a('0xb8'),ut[_0xbb6a('0xb4')](_0x4e716a,_0xbb6a('0xb9')));emitVoiceQueueChannelRemove(ut[_0xbb6a('0xb4')](_0x4e716a,_0xbb6a('0xb9')));_0x39aeb2['outboundAnswerCallsDay']+=0x1;_0x39aeb2['total']+=0x1;_0x39aeb2[_0xbb6a('0x2a')]+=0x1;ut[_0xbb6a('0x83')](_0x39aeb2,_0xbb6a('0xba'));_0x4e716a[_0xbb6a('0xbb')]=ut[_0xbb6a('0xa6')](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0x4,_0xbb6a('0xbc'));rpcDb[_0xbb6a('0x9a')](_0x4e716a,_0xbb6a('0xbd'));rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xbe'));rpcDb[_0xbb6a('0xbf')](_0x4e716a);_0x39aeb2[_0xbb6a('0x2f')]+=_0x4e716a[_0xbb6a('0xc0')];_0x39aeb2[_0xbb6a('0x2e')]+=_0x4e716a[_0xbb6a('0xc0')];logger['info'](_0xbb6a('0xc1'),_0x4e716a[_0xbb6a('0xb3')],_0xbb6a('0xc2'),_0x39aeb2[_0xbb6a('0x28')],_0xbb6a('0xc3'),_0x39aeb2[_0xbb6a('0x2d')]);delete this[_0xbb6a('0x76')][_0x31a1c4[_0xbb6a('0xae')]];break;case'BUSY':_0x39aeb2[_0xbb6a('0x3b')]+=0x1;_0x4e716a['countbusyretry']+=0x1;_0x4e716a[_0xbb6a('0xbb')]=ut[_0xbb6a('0xa6')](_0x4e716a);ut['logCustomer'](_0x4e716a,0x5,'Busy');rpcDb[_0xbb6a('0x9a')](_0x4e716a,_0xbb6a('0xc4'));if(ut[_0xbb6a('0xa6')](_0x4e716a)>=_0x39aeb2[_0xbb6a('0xa9')]){_0x7f9168=ut['cloneAction'](_0x4e716a,0xf,_0xbb6a('0xab'));rpcDb[_0xbb6a('0xac')](_0x7f9168,_0xbb6a('0xc5'));}else{if(_0x4e716a[_0xbb6a('0xc6')]>=_0x39aeb2[_0xbb6a('0xc7')]){rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xc4'));}else{rpcDb[_0xbb6a('0xc8')](ut[_0xbb6a('0xc9')](_0x4e716a,_0xbb6a('0xc6'),_0x39aeb2[_0xbb6a('0xca')]),_0x4e716a[_0xbb6a('0xcb')],_0x4e716a[_0xbb6a('0xcc')]);}}break;case'NOANSWER':_0x39aeb2[_0xbb6a('0xcd')]+=0x1;_0x4e716a[_0xbb6a('0xce')]+=0x1;_0x4e716a[_0xbb6a('0xbb')]=ut[_0xbb6a('0xa6')](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0x3,_0xbb6a('0xcf'));rpcDb[_0xbb6a('0x9a')](_0x4e716a,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xbb6a('0xa6')](_0x4e716a)>=_0x39aeb2[_0xbb6a('0xa9')]){_0x7f9168=ut[_0xbb6a('0xaa')](_0x4e716a,0xf,_0xbb6a('0xab'));rpcDb['createCustomerFinal'](_0x7f9168,_0xbb6a('0xd0'));}else{if(_0x4e716a[_0xbb6a('0xce')]>=_0x39aeb2['dialNoAnswerMaxRetry']){rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xd1'));}else{rpcDb[_0xbb6a('0xc8')](ut[_0xbb6a('0xc9')](_0x4e716a,_0xbb6a('0xce'),_0x39aeb2[_0xbb6a('0xd2')]),_0x4e716a['unlockAgent'],_0x4e716a['activeContact']);}}break;case'CONGESTION':_0x39aeb2[_0xbb6a('0x3c')]+=0x1;_0x4e716a[_0xbb6a('0xd3')]+=0x1;_0x4e716a[_0xbb6a('0xbb')]=ut['totalGlobal'](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0x8,_0xbb6a('0xd4'));rpcDb[_0xbb6a('0x9a')](_0x4e716a,_0xbb6a('0xd5'));if(ut['totalGlobal'](_0x4e716a)>=_0x39aeb2[_0xbb6a('0xa9')]){_0x7f9168=ut[_0xbb6a('0xaa')](_0x4e716a,0xf,_0xbb6a('0xab'));rpcDb[_0xbb6a('0xac')](_0x7f9168,_0xbb6a('0xd6'));}else{if(_0x4e716a['countcongestionretry']>=_0x39aeb2[_0xbb6a('0xd7')]){rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xd5'));}else{rpcDb['rescheduleContact'](ut[_0xbb6a('0xc9')](_0x4e716a,_0xbb6a('0xd3'),_0x39aeb2['dialBusyRetryFrequency']),_0x4e716a['unlockAgent'],_0x4e716a[_0xbb6a('0xcc')]);}}break;case'CANCEL':_0x39aeb2[_0xbb6a('0x43')]+=0x1;_0x4e716a[_0xbb6a('0xbb')]=ut[_0xbb6a('0xa6')](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0x14,_0xbb6a('0xd8'));rpcDb[_0xbb6a('0x9a')](_0x4e716a,_0xbb6a('0xd9'));if(_0x4e716a[_0xbb6a('0xcb')]){rpcDb['unlockContact'](_0x4e716a[_0xbb6a('0xda')]);}if(_0x4e716a[_0xbb6a('0xcc')]){rpcDb['disableContact'](_0x4e716a[_0xbb6a('0xda')]);}break;default:if(_0x4e716a[_0xbb6a('0x79')]){ut[_0xbb6a('0x83')](_0x39aeb2,_0xbb6a('0xdb'));ut[_0xbb6a('0x84')](_0xbb6a('0xdc')+_0x39aeb2[_0xbb6a('0x28')],_0x31a1c4);}_0x39aeb2['outboundUnknownCallsDay']+=0x1;_0x4e716a[_0xbb6a('0xbb')]=ut['totalGlobal'](_0x4e716a);ut[_0xbb6a('0x96')](_0x4e716a,0xc,_0x31a1c4[_0xbb6a('0xdd')]||_0x31a1c4['dialstatus']);rpcDb[_0xbb6a('0x9a')](_0x4e716a,_0xbb6a('0xde'));if(ut[_0xbb6a('0xa6')](_0x4e716a)>=_0x39aeb2['dialGlobalMaxRetry']){_0x7f9168=ut['cloneAction'](_0x4e716a,0xf,'Global');rpcDb[_0xbb6a('0xac')](_0x7f9168,_0xbb6a('0xdf'));}else{rpcDb[_0xbb6a('0xac')](_0x4e716a,_0xbb6a('0xdf'));}delete this['actions'][_0x31a1c4[_0xbb6a('0xae')]];}if(!(_0x4e716a[_0xbb6a('0x79')]&&_0x3ace56==='16')){ut['updateOriginated'](_0x39aeb2,_0xbb6a('0xe0'));logger[_0xbb6a('0x73')](_0xbb6a('0xe1'),_0x4e716a[_0xbb6a('0xb3')],_0xbb6a('0xc2'),_0x39aeb2[_0xbb6a('0x28')],_0xbb6a('0x78'),_0x39aeb2[_0xbb6a('0x50')]);}if(_0x3ace56!==_0xbb6a('0xaf')){delete this[_0xbb6a('0x76')][_0x31a1c4[_0xbb6a('0xae')]];delete this[_0xbb6a('0x76')][_0x31a1c4[_0xbb6a('0xe2')]];}}};Preview[_0xbb6a('0xe')]['callProgressDetectingAgent']=function(_0x32235c,_0x4782d8,_0x2ff28b){if(_[_0xbb6a('0xe3')](_0x4782d8)&&'object'!==typeof _0x4782d8){return;}if(_['isUndefined'](_0x2ff28b)&&'object'!==typeof _0x2ff28b){return;}switch(_0x2ff28b[_0xbb6a('0xe4')]){case'0':ut[_0xbb6a('0xe5')](_0x32235c,0x0,'NoSuchNumber');rpcDb[_0xbb6a('0xe6')](_0x32235c,_0xbb6a('0xe7'));break;case'3':ut[_0xbb6a('0xe5')](_0x32235c,0x3,_0xbb6a('0xcf'));rpcDb[_0xbb6a('0xe6')](_0x32235c,_0xbb6a('0xe8'));break;case'5':ut[_0xbb6a('0xe5')](_0x32235c,0x5,_0xbb6a('0xe9'));rpcDb['createAgentHistory'](_0x32235c,_0xbb6a('0xea'));break;case'8':ut[_0xbb6a('0xe5')](_0x32235c,0x8,_0xbb6a('0xd4'));rpcDb[_0xbb6a('0xe6')](_0x32235c,_0xbb6a('0xeb'));break;case'22':ut['logAgent'](_0x32235c,0x16,_0xbb6a('0xec'));rpcDb['createAgentHistory'](_0x32235c,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbb6a('0xe5')](_0x32235c,0xc,_0x2ff28b['reason']);rpcDb['createAgentHistory'](_0x32235c,_0xbb6a('0xeb'));}ut[_0xbb6a('0xed')](_0x4782d8,_0xbb6a('0xee'));logger[_0xbb6a('0x73')](_0xbb6a('0xef'),_0x32235c['uniqueid'],'\x20Queue',_0x4782d8[_0xbb6a('0x28')],_0xbb6a('0x78'),_0x4782d8[_0xbb6a('0x50')]);delete this[_0xbb6a('0x76')][_0x32235c[_0xbb6a('0xb3')]];};Preview[_0xbb6a('0xe')][_0xbb6a('0xf0')]=function(_0x580428,_0x4944f1,_0x2c1724,_0x2f6b1e,_0x1738af){var _0x133459=this;return new BPromise(function(_0x5be334,_0x35360a){if(_['isNil'](_0x4944f1)||_[_0xbb6a('0x72')](_0x4944f1[_0xbb6a('0xf1')])||_['isNil'](_0x4944f1['Contact']['phone'])||_['isNil'](_0x4944f1['VoiceQueueId'])){_0x35360a(ut[_0xbb6a('0x61')](_0xbb6a('0xf2'),_0x2f6b1e,_0x1738af));return;}var _0x5a111d=uuid['v4']();var _0x8307cf=_0x133459['campaignsPreview'][_0x4944f1[_0xbb6a('0x75')][_0xbb6a('0x28')]];var _0x4b32cb=_0x2c1724?_0x133459[_0xbb6a('0x16')][_0x2c1724]['id']:undefined;_0x133459[_0xbb6a('0x76')][_0x5a111d]=new Action(_0x4944f1,_0x8307cf,_0x5a111d,_0x2c1724,_0x4b32cb);var _0x1d0c95=_0x133459['actions'][_0x5a111d];_0x1d0c95[_0xbb6a('0xcb')]=_0x2f6b1e;_0x1d0c95['activeContact']=_0x1738af;_0x1d0c95[_0xbb6a('0xf3')]=_0x2c1724;if(_[_0xbb6a('0xf4')](_0x580428)){_0x133459[_0xbb6a('0xf5')](_0x1d0c95,_0x8307cf,_0x4944f1,_0x2c1724)[_0xbb6a('0x8c')](function(_0x576032){logger[_0xbb6a('0x73')](_0xbb6a('0xf6'),_0xbb6a('0xf7')+_0x1d0c95['queue']+_0xbb6a('0xf8')+_0x1d0c95[_0xbb6a('0xda')],JSON[_0xbb6a('0x59')](_0x576032));ami[_0xbb6a('0x26')](_0xbb6a('0xf9'),ut[_0xbb6a('0xb4')](_0x1d0c95,'called'));_0x5be334(ut[_0xbb6a('0x61')](_0xbb6a('0xfa')));})[_0xbb6a('0x92')](function(_0x14972c){ut[_0xbb6a('0x63')](_0xbb6a('0xfb'),_0x14972c);_0x35360a(ut[_0xbb6a('0x61')](_0xbb6a('0xfc'),_0x2f6b1e,_0x1738af));});}else{_0x8307cf['outboundBlacklistCallsDay']+=0x1;ut[_0xbb6a('0xfd')](_0x1d0c95);rpcDb[_0xbb6a('0xfe')](_0x1d0c95,_0xbb6a('0xff'));delete _0x133459['actions'][_0x5a111d];_0x35360a(ut[_0xbb6a('0x61')](_0xbb6a('0x100'),_0x2f6b1e,_0x1738af));}});};Preview[_0xbb6a('0xe')]['isTrunkReachable']=function(_0x5b5f5b){return!_[_0xbb6a('0x72')](_0x5b5f5b)&&!_[_0xbb6a('0x72')](_0x5b5f5b['name'])&&!_[_0xbb6a('0x72')](_0x5b5f5b[_0xbb6a('0x56')])&&_0x5b5f5b[_0xbb6a('0x56')]&&!_['isNil'](this[_0xbb6a('0x15')][util[_0xbb6a('0x5b')](_0xbb6a('0x101'),_0x5b5f5b[_0xbb6a('0x28')])])&&!_[_0xbb6a('0x72')](this[_0xbb6a('0x15')][util[_0xbb6a('0x5b')](_0xbb6a('0x101'),_0x5b5f5b['name'])][_0xbb6a('0x7f')])&&(this[_0xbb6a('0x15')][util[_0xbb6a('0x5b')](_0xbb6a('0x101'),_0x5b5f5b[_0xbb6a('0x28')])][_0xbb6a('0x7f')]==='reachable'||this[_0xbb6a('0x15')][util[_0xbb6a('0x5b')]('SIP/%s',_0x5b5f5b[_0xbb6a('0x28')])][_0xbb6a('0x7f')]===_0xbb6a('0x102'));};Preview['prototype'][_0xbb6a('0x103')]=function(_0x111e28,_0x215172){var _0x5ab304=this;return new BPromise(function(_0x183ab2,_0x3dee2d){_0x5ab304[_0xbb6a('0x104')](_0x111e28,_0x215172)[_0xbb6a('0x8c')](function(_0x1e0a96){_0x183ab2(_[_0xbb6a('0x7a')](_0x1e0a96,['message']));})[_0xbb6a('0x92')](function(_0x40bc41){if(_0x40bc41[_0xbb6a('0x105')]){rpcDb[_0xbb6a('0x106')](_0x111e28);}if(_0x40bc41['active']){rpcDb[_0xbb6a('0x107')](_0x111e28);}_0x3dee2d(_[_0xbb6a('0x7a')](_0x40bc41,[_0xbb6a('0x61')]));});});};Preview[_0xbb6a('0xe')][_0xbb6a('0x104')]=function(_0x5bfbd7,_0x157254){var _0x16fd26=this;return new BPromise(function(_0xb5e7d9,_0x86eae8){var _0x5e35a0,_0x49fac2;rpcDb[_0xbb6a('0x108')](_0x5bfbd7)[_0xbb6a('0x8c')](function(_0x1c4722){if(!_[_0xbb6a('0x72')](_0x1c4722[0x0])){_0x49fac2=_0x1c4722[0x0][_0xbb6a('0x109')]?![]:!![];_0x5e35a0=_0x1c4722[0x0][_0xbb6a('0x109')]?!![]:![];_0x5e35a0=_0x157254?!![]:_0x5e35a0;}var _0x43102b=_0x16fd26[_0xbb6a('0x10a')](_0x1c4722);if(_0x43102b[_0xbb6a('0x10b')]){rpcDb[_0xbb6a('0x10c')](_[_0xbb6a('0x7a')](_0x1c4722[0x0],[_0xbb6a('0x7c'),_0xbb6a('0x10d')]))[_0xbb6a('0x8c')](function(_0x2d501e){_0x16fd26['checkInBlack'](_0x2d501e,_0x1c4722[0x0],_0x157254,_0x49fac2,_0x5e35a0)[_0xbb6a('0x8c')](function(_0x4219e2){_0xb5e7d9(_0x4219e2);})[_0xbb6a('0x92')](function(_0x386e49){_0x86eae8(_0x386e49);});})[_0xbb6a('0x92')](function(_0x400620){ut[_0xbb6a('0x63')]('[Preview][checkIsBlackList]',_0x400620);_0x86eae8(ut['message'](_0xbb6a('0x10e'),_0x49fac2,_0x5e35a0));});}else{_0x86eae8(ut['message'](_0x43102b[_0xbb6a('0x61')],_0x49fac2,_0x5e35a0));}})[_0xbb6a('0x92')](function(_0x514f35){ut['logger'](_0xbb6a('0x10f'),_0x514f35);_0x86eae8(ut[_0xbb6a('0x61')](_0xbb6a('0x10e'),![],!![]));});});};Preview[_0xbb6a('0xe')]['validateContact']=function(_0x363030){if(_['isNil'](_0x363030)||_[_0xbb6a('0xf4')](_0x363030)||!_['isNil'](_0x363030[0x0][_0xbb6a('0x110')])&&_[_0xbb6a('0x72')](_0x363030[0x0][_0xbb6a('0x110')][_0xbb6a('0x28')])){ut[_0xbb6a('0x63')]('[Preview][validateContact][Empty\x20Contact]',_0x363030);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x599e5e=this['campaignsPreview'][_0x363030[0x0][_0xbb6a('0x75')][_0xbb6a('0x28')]];_0x599e5e[_0xbb6a('0x61')]=_0xbb6a('0xa5');if(_[_0xbb6a('0x72')](_0x599e5e)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x599e5e);return{'isValid':![],'message':_0xbb6a('0x111')};}if(!this[_0xbb6a('0xa2')](_0x599e5e[_0xbb6a('0x55')])){ut[_0xbb6a('0x63')](_0xbb6a('0x112'),_0xbb6a('0x113')+_0x599e5e['name']+_0xbb6a('0x114'));if(!this[_0xbb6a('0xa2')](_0x599e5e['TrunkBackup'])){ut[_0xbb6a('0x63')](_0xbb6a('0x112'),_0x599e5e[_0xbb6a('0x28')]+_0xbb6a('0x115'));return{'isValid':![],'message':_0xbb6a('0x116')};}}if(!ut[_0xbb6a('0xa1')](_0x599e5e[_0xbb6a('0x6f')])){ut[_0xbb6a('0x63')](_0xbb6a('0x117'),_0x599e5e[_0xbb6a('0x28')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xbb6a('0x113')+_0x599e5e[_0xbb6a('0x28')]+_0xbb6a('0x118')};}return{'isValid':!![],'message':_0xbb6a('0x119')};};Preview[_0xbb6a('0xe')][_0xbb6a('0xf5')]=function(_0x4bd8ab,_0x29e698,_0x52ee0a,_0x39f6ee){var _0x25221a=this;return new BPromise(function(_0x169833,_0x2a350a){var _0x4e3c88=_0x4bd8ab[_0xbb6a('0xb3')];var _0x281c92=_0x25221a[_0xbb6a('0xa2')](_0x29e698[_0xbb6a('0x55')])?util[_0xbb6a('0x5b')](_0xbb6a('0x11a'),_0x29e698[_0xbb6a('0x55')][_0xbb6a('0x28')],_[_0xbb6a('0x72')](_0x29e698[_0xbb6a('0x38')])?'':_0x29e698[_0xbb6a('0x38')]['trim']()||'',_0x29e698[_0xbb6a('0x11b')]>0x0?_0x52ee0a['Contact'][_0xbb6a('0x11c')][_0xbb6a('0x11d')](_0x29e698['dialCutDigit']):_0x52ee0a[_0xbb6a('0xf1')]['phone']):util['format'](_0xbb6a('0x11a'),_['isNil'](_0x29e698[_0xbb6a('0xa3')])?_0x29e698[_0xbb6a('0x55')][_0xbb6a('0x28')]:_0x29e698[_0xbb6a('0xa3')][_0xbb6a('0x28')],_[_0xbb6a('0x72')](_0x29e698[_0xbb6a('0x38')])?'':_0x29e698['dialPrefix'][_0xbb6a('0x11e')]()||'',_0x29e698[_0xbb6a('0x11b')]>0x0?_0x52ee0a[_0xbb6a('0xf1')][_0xbb6a('0x11c')][_0xbb6a('0x11d')](_0x29e698[_0xbb6a('0x11b')]):_0x52ee0a[_0xbb6a('0xf1')][_0xbb6a('0x11c')]);var _0xe41787=_0x25221a[_0xbb6a('0xa2')](_0x29e698[_0xbb6a('0x55')])?ut[_0xbb6a('0x11f')](_0x29e698['Trunk']['callerid'],_0x29e698[_0xbb6a('0x35')],_0x29e698['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x29e698[_0xbb6a('0x36')],_0x29e698['dialRandomLastDigitCallerIdNumber']):_0x29e698[_0xbb6a('0x36')]):ut[_0xbb6a('0x11f')](_[_0xbb6a('0x72')](_0x29e698[_0xbb6a('0xa3')])?_0x29e698['Trunk']['callerid']:_0x29e698['TrunkBackup'][_0xbb6a('0x57')],_0x29e698[_0xbb6a('0x35')],_0x29e698['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xbb6a('0x120')](_0x29e698['dialOriginateCallerIdNumber'],_0x29e698[_0xbb6a('0x121')]):_0x29e698['dialOriginateCallerIdNumber']);if(_0xe41787){_0x4bd8ab[_0xbb6a('0x122')]=ut[_0xbb6a('0x123')](_0xe41787);_0x4bd8ab[_0xbb6a('0x124')]=ut['extractCalleridNumber'](_0xe41787);}var _0x5a0a2e=ut[_0xbb6a('0x125')](_0x29e698,_0x52ee0a,_0x281c92,_0xe41787,_0x4e3c88,_0x4bd8ab);_['merge'](_0x4bd8ab,ut[_0xbb6a('0x126')](_0x5a0a2e));_0x4bd8ab[_0xbb6a('0x94')]=moment()[_0xbb6a('0x5b')](_0xbb6a('0x95'));ami[_0xbb6a('0x7e')](ut['variablesAction'](_0x4bd8ab,_0x29e698,_0x5a0a2e,_0x4bd8ab[_0xbb6a('0xcc')],_0x39f6ee))['then'](function(_0x17d212){_0x29e698[_0xbb6a('0x50')]+=0x1;logger[_0xbb6a('0x73')](_0xbb6a('0x127'),_0x4e3c88,_0xbb6a('0xc2'),_0x29e698[_0xbb6a('0x28')],_0xbb6a('0x78'),_0x29e698[_0xbb6a('0x50')]);_0x169833(_0x17d212);})[_0xbb6a('0x92')](function(_0x1b7751){ut[_0xbb6a('0xe5')](_0x4bd8ab,0xe,'OriginateError');rpcDb[_0xbb6a('0xe6')](_0x4bd8ab,_0xbb6a('0x128'));_0x2a350a(_0x1b7751);});});};Preview['prototype'][_0xbb6a('0x20')]=function(_0x1d138c){if(this[_0xbb6a('0x76')][_0x1d138c[_0xbb6a('0xae')]]){this[_0xbb6a('0x76')][_0x1d138c['linkedid']]['channel']=_0x1d138c[_0xbb6a('0x80')];}};Preview['prototype'][_0xbb6a('0x18')]=function(_0x2b2772){var _0x57b4d6=this;var _0x579a7f=this[_0xbb6a('0x76')][_0x2b2772[_0xbb6a('0x129')]];if(_0x579a7f){if(_0x579a7f['lookAgent']&&this[_0xbb6a('0x16')][_0x579a7f[_0xbb6a('0xf3')]]){ut[_0xbb6a('0x12a')](_0x579a7f,this['agents'][_0x579a7f[_0xbb6a('0xf3')]][_0xbb6a('0x28')],this[_0xbb6a('0x16')][_0x579a7f[_0xbb6a('0xf3')]]['id']);}var _0x51f207=_[_0xbb6a('0x12b')](_0x579a7f);_0x51f207[_0xbb6a('0xb0')]=moment()['format'](_0xbb6a('0x95'));var _0x2e8942=_0x57b4d6[_0xbb6a('0x13')][_0x579a7f['queue']];if(ut[_0xbb6a('0x12c')](_0x2b2772['response'])){if(_0x579a7f[_0xbb6a('0xcb')]){rpcDb[_0xbb6a('0x106')](_0x579a7f[_0xbb6a('0xda')]);}if(_0x579a7f['activeContact']){rpcDb[_0xbb6a('0x107')](_0x579a7f['idContact']);}ami[_0xbb6a('0x26')](_0xbb6a('0x12d'),ut[_0xbb6a('0xb4')](_0x579a7f,_0xbb6a('0x12e')));this[_0xbb6a('0x12f')](_0x51f207,_0x2e8942,_0x2b2772);}else{_0x579a7f[_0xbb6a('0x94')]=moment()['format'](_0xbb6a('0x95'));ut[_0xbb6a('0xe5')](_0x51f207,0x4,_0xbb6a('0xbc'));rpcDb[_0xbb6a('0xe6')](_0x51f207,_0xbb6a('0x130'));}}};Preview[_0xbb6a('0xe')][_0xbb6a('0x1b')]=function(_0x112f7d){var _0x2578d6=this;var _0x2e0873=this[_0xbb6a('0x76')][_0x112f7d['linkedid']];var _0xdd6fdd;if(_0x2e0873){_0xdd6fdd=this[_0xbb6a('0x13')][_0x2e0873['queue']];logger['info']('[syncHangup][talking]',_0x112f7d[_0xbb6a('0xae')],'\x20Queue',_0xdd6fdd[_0xbb6a('0x28')],_0xbb6a('0xc3'),_0xdd6fdd['pTalking']);}if(this[_0xbb6a('0x76')][_0x112f7d[_0xbb6a('0xae')]]&&_0x112f7d[_0xbb6a('0xae')]!==_0x112f7d[_0xbb6a('0xb3')]){if(_0x112f7d['cause']==='16'&&this[_0xbb6a('0x76')][_0x112f7d['linkedid']][_0xbb6a('0x79')]){this[_0xbb6a('0x131')](_0x112f7d,_0x112f7d[_0xbb6a('0xae')],_0x112f7d[_0xbb6a('0x132')]);}else if(this[_0xbb6a('0x76')][_0x112f7d[_0xbb6a('0xae')]][_0xbb6a('0x79')]){logger[_0xbb6a('0x73')](_0xbb6a('0x133'),_0x112f7d['linkedid'],_0x112f7d[_0xbb6a('0x132')],_0xbb6a('0xc2'),_0xdd6fdd[_0xbb6a('0x28')],_0xbb6a('0xc3'),_0xdd6fdd['pTalking']);this[_0xbb6a('0x131')](_0x112f7d,_0x112f7d[_0xbb6a('0xae')],_0x112f7d[_0xbb6a('0x132')]);}}else if(_0x2e0873&&_[_0xbb6a('0x72')](_0x2e0873[_0xbb6a('0x134')])&&_0xdd6fdd[_0xbb6a('0x135')]&&_0x112f7d[_0xbb6a('0xae')]===_0x112f7d['uniqueid']&&_[_0xbb6a('0x72')](_0x112f7d[_0xbb6a('0xe4')])&&_0x112f7d[_0xbb6a('0x132')]==='16'&&_0x112f7d[_0xbb6a('0x136')]==='6'&&_['isUndefined'](_0x2e0873['transfer'])){if(_0x2e0873[_0xbb6a('0xcb')]){rpcDb[_0xbb6a('0x106')](_0x2e0873[_0xbb6a('0xda')]);}if(_0x2e0873[_0xbb6a('0xcc')]){rpcDb[_0xbb6a('0x107')](_0x2e0873[_0xbb6a('0xda')]);}_0x112f7d[_0xbb6a('0xe4')]='22';this[_0xbb6a('0x12f')](_0x2e0873,_0xdd6fdd,_0x112f7d);}else if(_0x2e0873&&_0x2e0873[_0xbb6a('0x137')]){if(_0x112f7d[_0xbb6a('0x132')]==='16'&&this[_0xbb6a('0x76')][_0x112f7d['linkedid']][_0xbb6a('0x79')]){logger['info'](_0xbb6a('0x138'),_0x112f7d[_0xbb6a('0xae')],_0x112f7d[_0xbb6a('0x132')],'\x20Queue',_0xdd6fdd[_0xbb6a('0x28')],'pTalking:\x20',_0xdd6fdd[_0xbb6a('0x2d')]);this[_0xbb6a('0x131')](_0x112f7d,_0x112f7d[_0xbb6a('0xae')],_0x112f7d['cause']);}else if(this[_0xbb6a('0x76')][_0x112f7d[_0xbb6a('0xae')]]['dialAnswer']){logger['info'](_0xbb6a('0x133'),_0x112f7d[_0xbb6a('0xae')],_0x112f7d[_0xbb6a('0x132')],_0xbb6a('0xc2'),_0xdd6fdd['name'],_0xbb6a('0xc3'),_0xdd6fdd[_0xbb6a('0x2d')]);this[_0xbb6a('0x131')](_0x112f7d,_0x112f7d[_0xbb6a('0xae')],_0x112f7d[_0xbb6a('0x132')]);}}};Preview['prototype'][_0xbb6a('0x1e')]=function(_0x182add){if(this[_0xbb6a('0x76')][_0x182add[_0xbb6a('0xe2')]]&&_0x182add[_0xbb6a('0xe2')]!==_0x182add[_0xbb6a('0x139')]){this['callProgressDetectingCustomer'](_0x182add,_0x182add[_0xbb6a('0xe2')],_0x182add[_0xbb6a('0x13a')]);}};Preview[_0xbb6a('0xe')][_0xbb6a('0x13b')]=function(_0x532cb3){if(this[_0xbb6a('0x76')][_0x532cb3[_0xbb6a('0xae')]]&&_0x532cb3[_0xbb6a('0xae')]!==_0x532cb3[_0xbb6a('0xb3')]&&!this['actions'][_0x532cb3[_0xbb6a('0xae')]][_0xbb6a('0x79')]){if(_0x532cb3[_0xbb6a('0x132')]==='1'){this[_0xbb6a('0x131')](_0x532cb3,_0x532cb3[_0xbb6a('0xae')],_0x532cb3[_0xbb6a('0x132')]);}}};Preview[_0xbb6a('0xe')][_0xbb6a('0x13c')]=function(_0x26c6a6,_0x5a438e,_0xce8911){if(this[_0xbb6a('0x76')][_0x26c6a6]){if(_[_0xbb6a('0x72')](this[_0xbb6a('0x76')][_0x26c6a6][_0xbb6a('0x13d')])){this['actions'][_0x26c6a6][_0xbb6a('0x13d')]={};}this['actions'][_0x26c6a6][_0xbb6a('0x13d')][_0x5a438e]=_0xce8911;}};Preview['prototype']['syncVarSet']=function(_0x5f59cb){try{if(!_['isNil'](_0x5f59cb)){if(ut['filterKey'](_['keys'](_0x5f59cb[_0xbb6a('0x13e')])[0x0])){this[_0xbb6a('0x13c')](_0x5f59cb['uniqueid'],_[_0xbb6a('0x13f')](_0x5f59cb[_0xbb6a('0x13e')])[0x0],_0x5f59cb[_0xbb6a('0x140')]);}}}catch(_0x4166d2){logger[_0xbb6a('0x141')](_0xbb6a('0x142'),util['inspect'](_0x4166d2,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xbb6a('0x23')]=function(_0x2febaa){if(_0x2febaa){if(this[_0xbb6a('0x76')][_0x2febaa[_0xbb6a('0x143')]]){this['actions'][_0x2febaa[_0xbb6a('0x143')]][_0xbb6a('0x137')]=!![];}}};Preview[_0xbb6a('0xe')]['syncBlindTransfer']=function(_0x48f9c0){if(_0x48f9c0){if(this[_0xbb6a('0x76')][_0x48f9c0['transfererlinkedid']]){this[_0xbb6a('0x76')][_0x48f9c0[_0xbb6a('0x144')]]['transfer']=!![];}}};module[_0xbb6a('0x145')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 6bf7f8f..866e490 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 _0xc95b=['create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','error','inspect','resolve','then','createHistory','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED'];(function(_0x2723b1,_0x592c60){var _0x4248e8=function(_0x1e95b7){while(--_0x1e95b7){_0x2723b1['push'](_0x2723b1['shift']());}};_0x4248e8(++_0x592c60);}(_0xc95b,0x103));var _0xbc95=function(_0x47cee1,_0x1a6e87){_0x47cee1=_0x47cee1-0x0;var _0xc843c3=_0xc95b[_0x47cee1];return _0xc843c3;};'use strict';var util=require(_0xbc95('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xbc95('0x1'));var _=require(_0xbc95('0x2'));var cmHopper=require(_0xbc95('0x3'));var cmHopperFinal=require(_0xbc95('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xbc95('0x5'));var voiceQueueRt=require(_0xbc95('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x45e950){return function(_0x61caad){logger[_0xbc95('0x7')](_0x45e950,util[_0xbc95('0x8')](_0x61caad,{'showHidden':![],'depth':null}));};}function create(_0x2016a7){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopperHistory[_0xbc95('0xb')](_0x2016a7))[_0xbc95('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x24dd9d){return BPromise['resolve']()[_0xbc95('0xa')](agentReportPreview[_0xbc95('0xb')](_0x24dd9d))[_0xbc95('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x14f1c3){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper['moveContactManagedDialer'](_0x14f1c3,!![]))['catch'](loggerCatch(_0xbc95('0xd')));}exports[_0xbc95('0xe')]=function(_0x272aba){return BPromise['resolve']()[_0xbc95('0xa')](cmHopperBlack['checkIsBlackList'](_0x272aba))[_0xbc95('0xc')](loggerCatch(_0xbc95('0xf')));};exports[_0xbc95('0x10')]=function(_0x4e8599){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper['getContactPreview'](_0x4e8599))[_0xbc95('0xc')](loggerCatch(_0xbc95('0x11')));};exports[_0xbc95('0xb')]=function(_0x5711a1,_0x36db98){create(_0x5711a1)[_0xbc95('0xc')](loggerCatch(_0x36db98));moveContact(_0x5711a1)[_0xbc95('0xc')](loggerCatch(_0x36db98));};exports[_0xbc95('0x12')]=function(_0xf8481a,_0x219e9a){createAgent(_0xf8481a)[_0xbc95('0xc')](loggerCatch(_0x219e9a));};exports[_0xbc95('0x13')]=function(_0x37ef2d,_0x2ce0ef){create(_0x37ef2d)['catch'](loggerCatch(_0x2ce0ef));};exports[_0xbc95('0x14')]=function(_0x4d7032,_0x1c0021){moveContact(_0x4d7032)['catch'](loggerCatch(_0x1c0021));};exports['rescheduleContact']=function(_0x1c6a3a,_0x403bdd,_0x5be3b0){if(_0x403bdd){_0x1c6a3a['UserId']=null;}if(_0x5be3b0){_0x1c6a3a[_0xbc95('0x15')]=![];}return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper[_0xbc95('0x16')](_0x1c6a3a))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xbc95('0x17')]=function(_0x1fee7f){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper[_0xbc95('0x17')](_0x1fee7f))[_0xbc95('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xbc95('0x18')]=function(_0x413f41){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper[_0xbc95('0x18')]({'UserId':null},_0x413f41,0x1))['catch'](loggerCatch(_0xbc95('0x19')));};exports[_0xbc95('0x1a')]=function(_0x19f861){return BPromise[_0xbc95('0x9')]()['then'](cmHopper['unlockContact']({'active':![]},_0x19f861,0x1))[_0xbc95('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xbc95('0x1b')]=function(_0xbe623b){var _0x569d4e={};_0x569d4e['type']=_0xbe623b[_0xbc95('0x1c')];_0x569d4e['uniqueid']=_0xbe623b['uniqueid'];_0x569d4e[_0xbc95('0x1d')]=_0xbe623b[_0xbc95('0x1d')];_0x569d4e['calleridname']=_0xbe623b[_0xbc95('0x1e')];_0x569d4e[_0xbc95('0x1f')]=_0xbe623b['queue'];_0x569d4e[_0xbc95('0x20')]=_0xbe623b[_0xbc95('0x21')];_0x569d4e['queuecallerleaveAt']=_0xbe623b['answertime'];_0x569d4e[_0xbc95('0x22')]=0x1;_0x569d4e[_0xbc95('0x23')]=_0xbe623b[_0xbc95('0x24')];_0x569d4e[_0xbc95('0x25')]=_0xbe623b[_0xbc95('0x26')];_0x569d4e[_0xbc95('0x27')]=_0xbc95('0x28');_0x569d4e[_0xbc95('0x29')]=_0xbc95('0x2a');_0x569d4e['holdtime']=0x0;_0x569d4e[_0xbc95('0x2b')]=0x1;_0x569d4e[_0xbc95('0x2c')]=_0xbe623b[_0xbc95('0x26')];_0x569d4e[_0xbc95('0x2d')]=_0xbc95('0x2e');return BPromise[_0xbc95('0x9')]()['then'](voiceQueueReport[_0xbc95('0x2f')](_0x569d4e))[_0xbc95('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xbc95('0x30')]=function(_0x33117c,_0x57a562){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper[_0xbc95('0x30')](_0x33117c,_0x57a562))[_0xbc95('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xbc95('0x31')]=function(_0x330733){return BPromise[_0xbc95('0x9')]()[_0xbc95('0xa')](cmHopper[_0xbc95('0x16')](_0x330733,!![],!![]))[_0xbc95('0xc')](loggerCatch(_0xbc95('0x32')));}; \ No newline at end of file +var _0xca3f=['queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','membername','context','from-sip','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','then','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0xa2403a,_0x1b7c45){var _0x59f2f4=function(_0x13fc1c){while(--_0x13fc1c){_0xa2403a['push'](_0xa2403a['shift']());}};_0x59f2f4(++_0x1b7c45);}(_0xca3f,0x1d4));var _0xfca3=function(_0x1fb34f,_0x5bd42b){_0x1fb34f=_0x1fb34f-0x0;var _0x543a9d=_0xca3f[_0x1fb34f];return _0x543a9d;};'use strict';var util=require('util');var BPromise=require(_0xfca3('0x0'));var logger=require('../../../config/logger')(_0xfca3('0x1'));var _=require(_0xfca3('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xfca3('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xfca3('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xfca3('0x5'));function loggerCatch(_0xeccec){return function(_0x42d578){logger[_0xfca3('0x6')](_0xeccec,util['inspect'](_0x42d578,{'showHidden':![],'depth':null}));};}function create(_0x1d8f43){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopperHistory['createHistory'](_0x1d8f43))['catch'](loggerCatch(_0xfca3('0x9')));}function createAgent(_0x4bc278){return BPromise['resolve']()[_0xfca3('0x8')](agentReportPreview['createHistory'](_0x4bc278))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x9')));}function moveContact(_0x3cd3c0){return BPromise[_0xfca3('0x7')]()['then'](cmHopper[_0xfca3('0xb')](_0x3cd3c0,!![]))['catch'](loggerCatch(_0xfca3('0xc')));}exports[_0xfca3('0xd')]=function(_0x3048d3){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopperBlack[_0xfca3('0xd')](_0x3048d3))['catch'](loggerCatch(_0xfca3('0xe')));};exports['getContactPreview']=function(_0x1859ef){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopper[_0xfca3('0xf')](_0x1859ef))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x10')));};exports[_0xfca3('0x11')]=function(_0x4e685e,_0x14efa6){create(_0x4e685e)['catch'](loggerCatch(_0x14efa6));moveContact(_0x4e685e)[_0xfca3('0xa')](loggerCatch(_0x14efa6));};exports['createAgentHistory']=function(_0x2512e3,_0x38b139){createAgent(_0x2512e3)[_0xfca3('0xa')](loggerCatch(_0x38b139));};exports['createCustomerHistory']=function(_0x497fe8,_0x58f8be){create(_0x497fe8)[_0xfca3('0xa')](loggerCatch(_0x58f8be));};exports[_0xfca3('0x12')]=function(_0x545267,_0x4eed05){moveContact(_0x545267)[_0xfca3('0xa')](loggerCatch(_0x4eed05));};exports[_0xfca3('0x13')]=function(_0xe42c4f,_0x4cd12a,_0x1d8806){if(_0x4cd12a){_0xe42c4f[_0xfca3('0x14')]=null;}if(_0x1d8806){_0xe42c4f[_0xfca3('0x15')]=![];}return BPromise['resolve']()[_0xfca3('0x8')](cmHopper[_0xfca3('0x13')](_0xe42c4f))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x16')));};exports['countReScheduled']=function(_0x1fb3a6){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopper[_0xfca3('0x17')](_0x1fb3a6))[_0xfca3('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0xfca3('0x18')]=function(_0x3894bf){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopper['unlockContact']({'UserId':null},_0x3894bf,0x1))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x19')));};exports['disableContact']=function(_0x46088d){return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](cmHopper['unlockContact']({'active':![]},_0x46088d,0x1))['catch'](loggerCatch(_0xfca3('0x1a')));};exports[_0xfca3('0x1b')]=function(_0x5176c3){var _0x7ba004={};_0x7ba004[_0xfca3('0x1c')]=_0x5176c3['type'];_0x7ba004[_0xfca3('0x1d')]=_0x5176c3['uniqueid'];_0x7ba004[_0xfca3('0x1e')]=_0x5176c3[_0xfca3('0x1e')];_0x7ba004[_0xfca3('0x1f')]=_0x5176c3[_0xfca3('0x1f')];_0x7ba004['queue']=_0x5176c3['queue'];_0x7ba004[_0xfca3('0x20')]=_0x5176c3['answertime'];_0x7ba004[_0xfca3('0x21')]=_0x5176c3[_0xfca3('0x22')];_0x7ba004[_0xfca3('0x23')]=0x1;_0x7ba004['queuecallercompleteAt']=_0x5176c3[_0xfca3('0x24')];_0x7ba004['connectedlinename']=_0x5176c3[_0xfca3('0x25')];_0x7ba004[_0xfca3('0x26')]=_0xfca3('0x27');_0x7ba004['exten']='xcally-motion-preview';_0x7ba004[_0xfca3('0x28')]=0x0;_0x7ba004[_0xfca3('0x29')]=0x1;_0x7ba004[_0xfca3('0x2a')]=_0x5176c3['membername'];_0x7ba004['queuecallerexitreason']=_0xfca3('0x2b');return BPromise[_0xfca3('0x7')]()[_0xfca3('0x8')](voiceQueueReport[_0xfca3('0x2c')](_0x7ba004))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x2d')));};exports[_0xfca3('0x2e')]=function(_0x467bc0,_0x37fcd5){return BPromise[_0xfca3('0x7')]()['then'](cmHopper[_0xfca3('0x2e')](_0x467bc0,_0x37fcd5))['catch'](loggerCatch(_0xfca3('0x2f')));};exports[_0xfca3('0x30')]=function(_0x186d8a){return BPromise['resolve']()[_0xfca3('0x8')](cmHopper['rescheduleContact'](_0x186d8a,!![],!![]))[_0xfca3('0xa')](loggerCatch(_0xfca3('0x31')));}; \ 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 ebe960f..c01fd35 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 _0xaef0=['toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','BOOKED','uniqueid','originate','channelAgent','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','active','scheduledat','add','ContactId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','not_inuse','status','reachable','push','getDiff','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','diff','loggerCatch','error','inspect','logger','loggerError','logger2','info','message','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-'];(function(_0x27f574,_0x3ef4da){var _0x14e3ab=function(_0x13e374){while(--_0x13e374){_0x27f574['push'](_0x27f574['shift']());}};_0x14e3ab(++_0x3ef4da);}(_0xaef0,0x172));var _0x0aef=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xaef0[_0x57add2];return _0x4e3670;};'use strict';var util=require('util');var _=require(_0x0aef('0x0'));var moment=require(_0x0aef('0x1'));var logger=require(_0x0aef('0x2'))(_0x0aef('0x3'));var ipAgi=process['env'][_0x0aef('0x4')]||_0x0aef('0x5');function getSeconds(_0x4cd232,_0x5e9e6e){var _0x2c11ab=moment(_0x4cd232)['milliseconds'](0x0);var _0x3cbd65=moment(_0x5e9e6e)['milliseconds'](0x0);return _0x2c11ab[_0x0aef('0x6')](_0x3cbd65,'seconds');}exports[_0x0aef('0x7')]=function(_0x17cac7){return function(_0x1f7526){logger[_0x0aef('0x8')](_0x17cac7,util[_0x0aef('0x9')](_0x1f7526,{'showHidden':![],'depth':null}));};};exports[_0x0aef('0xa')]=function(_0x313284,_0x320e5b){logger['info'](_0x313284,util[_0x0aef('0x9')](_0x320e5b,{'showHidden':![],'depth':null}));};exports[_0x0aef('0xb')]=function(_0x346a48,_0x574eab){logger['error'](_0x346a48,util[_0x0aef('0x9')](_0x574eab,{'showHidden':![],'depth':null}));};exports[_0x0aef('0xc')]=function(_0x1efacb){return function(_0x42511b){logger[_0x0aef('0xd')](_0x1efacb,util['inspect'](_0x42511b,{'showHidden':![],'depth':null}));};};exports[_0x0aef('0xe')]=function(_0x2fabae,_0x44ab54,_0x1ef7a7){return{'message':_0x2fabae,'unlock':_0x44ab54,'active':_0x1ef7a7};};exports['getCallerId']=function(_0xfa3ab,_0x2d12b7,_0x591a89){if(!_['isUndefined'](_0x591a89)&&_0x0aef('0xf')===typeof _0x591a89&&!_['isEmpty'](_0x591a89)){if(!_['isUndefined'](_0x2d12b7)&&_0x0aef('0xf')===typeof _0x2d12b7&&!_[_0x0aef('0x10')](_0x2d12b7)){return util[_0x0aef('0x11')](_0x0aef('0x12'),_0x2d12b7,_0x591a89);}return util[_0x0aef('0x11')](_0x0aef('0x12'),_0x591a89,_0x591a89);}if(!_[_0x0aef('0x13')](_0xfa3ab)&&_0x0aef('0xf')===typeof _0xfa3ab&&!_[_0x0aef('0x10')](_0xfa3ab)){return _0xfa3ab;}return _0x0aef('0x14');};exports[_0x0aef('0x15')]=function(_0x50501f){if(_[_0x0aef('0x16')](_0x50501f)){return![];}return _0x50501f;};exports['addVariables']=function(_0x2a2249,_0x5da05e,_0x4d7e83,_0x1844a3,_0x10f625,_0x59357a){var _0x2cd78b={'XMD-QUEUE':_0x5da05e[_0x0aef('0x17')]?_0x5da05e[_0x0aef('0x17')][_0x0aef('0x18')]:'','XMD-CALLERID':_0x1844a3,'XMD-CALLERID-PREVIEW':_0x59357a?util[_0x0aef('0x11')](_0x0aef('0x12'),_0x59357a[_0x0aef('0x19')],_0x59357a[_0x0aef('0x1a')]):_0x1844a3,'XMD-DIALID':_0x10f625,'XMD-CONTACTID':_0x5da05e['ContactId'],'XMD-CDRTYPE':_0x0aef('0x1b'),'CALLERID(all)':_0x1844a3,'XMD-VOICEQUEUEID':_0x5da05e[_0x0aef('0x1c')],'XMD-DIALCHANNEL':_0x4d7e83,'XMD-DIALTIMEOUT':_0x2a2249['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x0aef('0x11')]('\x22rtTxX%s%s\x22',_0x2a2249[_0x0aef('0x1d')]?'g':'',_[_0x0aef('0x10')](_0x2a2249[_0x0aef('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2a2249[_0x0aef('0x1f')]||'','XMD-AGI':_0x2a2249[_0x0aef('0x20')]?util['format'](_0x0aef('0x21'),ipAgi,_0x2a2249[_0x0aef('0x20')]):_0x0aef('0x22'),'XMD-AGIAFTER':_0x2a2249[_0x0aef('0x1d')]?util[_0x0aef('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2a2249[_0x0aef('0x1d')]):_0x0aef('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x59357a?_0x59357a[_0x0aef('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x59357a?_0x59357a[_0x0aef('0x24')]:'','XMD-DESTINATION':_0x0aef('0x25')};if(!_[_0x0aef('0x10')](_0x2a2249[_0x0aef('0x1e')])){_0x2cd78b[util[_0x0aef('0x11')]('%s',_0x0aef('0x26'))]=_0x2a2249[_0x0aef('0x1e')];_0x2cd78b[util[_0x0aef('0x11')]('%s',_0x0aef('0x27'))]=_0x10f625;}if(_0x5da05e&&_0x5da05e[_0x0aef('0x28')]){for(var _0x58b708 in _0x5da05e[_0x0aef('0x28')]){if(_0x5da05e['Contact'][_0x0aef('0x29')](_0x58b708)){if(!_[_0x0aef('0x16')](_0x5da05e[_0x0aef('0x28')][_0x58b708])&&_0x58b708!=='id'&&_0x58b708!==_0x0aef('0x2a')&&_0x58b708!==_0x0aef('0x2b')&&_0x58b708!==_0x0aef('0x2c')){_0x2cd78b[util[_0x0aef('0x11')](_0x0aef('0x2d'),_0x0aef('0x2e'),_[_0x0aef('0x2f')](_0x58b708))]=_0x5da05e[_0x0aef('0x28')][_0x58b708];}}}}return _0x2cd78b;};exports[_0x0aef('0x30')]=function(_0x12ec0c){var _0x7f1b81={};for(var _0x15daea in _0x12ec0c){if(_0x12ec0c[_0x0aef('0x29')](_0x15daea)){_0x7f1b81[util[_0x0aef('0x11')]('%s',_[_0x0aef('0x31')](_0x15daea))]=_0x12ec0c[_0x15daea];}}return{'variables':_0x7f1b81};};exports[_0x0aef('0x32')]=function(_0x167a48,_0x3c3c6e){if(!_[_0x0aef('0x16')](_0x167a48)){if(_0x167a48['hasOwnProperty'](_0x0aef('0x33'))){if(_0x167a48['originated']>0x0){_0x167a48[_0x0aef('0x33')]-=0x1;}else{logger[_0x0aef('0x8')](_0x0aef('0x34'),_0x3c3c6e);}}}else{logger[_0x0aef('0x8')](_0x0aef('0x35'),_0x3c3c6e);}};exports['logBlacklist']=function(_0x568fce){var _0x33b845=moment()[_0x0aef('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x568fce[_0x0aef('0x36')]=0xd;_0x568fce[_0x0aef('0x37')]='Blacklist';_0x568fce[_0x0aef('0x38')]=_0x33b845;_0x568fce[_0x0aef('0x39')]=_0x33b845;_0x568fce['endtime']=_0x33b845;};exports['logAgent']=function(_0xdcdb3f,_0x5e879a,_0x1adc12){var _0xa9bad6=moment()[_0x0aef('0x11')](_0x0aef('0x3a'));_0xdcdb3f['state']=_0x5e879a;_0xdcdb3f[_0x0aef('0x37')]=_0x1adc12;_0xdcdb3f[_0x0aef('0x39')]=_0xa9bad6;_0xdcdb3f[_0x0aef('0x3b')]=getSeconds(_0xdcdb3f[_0x0aef('0x39')],_0xdcdb3f[_0x0aef('0x38')]);};exports[_0x0aef('0x3c')]=function(_0x11bcd7,_0x4ba25d,_0x27d0bf){_0x11bcd7[_0x0aef('0x3d')]=_0x4ba25d;_0x11bcd7[_0x0aef('0x3e')]=_0x27d0bf;};exports[_0x0aef('0x3f')]=function(_0x314706,_0x50d8bf,_0x5c4e22){var _0x3f9693=moment()[_0x0aef('0x11')](_0x0aef('0x3a'));_0x314706[_0x0aef('0x36')]=_0x50d8bf;_0x314706[_0x0aef('0x37')]=_0x5c4e22;_0x314706[_0x0aef('0x39')]=_0x314706[_0x0aef('0x39')]?_0x314706[_0x0aef('0x39')]:_0x3f9693;_0x314706['endtime']=_0x314706[_0x0aef('0x40')]?_0x314706[_0x0aef('0x40')]:_0x3f9693;_0x314706[_0x0aef('0x3b')]=getSeconds(_0x314706[_0x0aef('0x39')]||0x0,_0x314706[_0x0aef('0x38')]||0x0);_0x314706[_0x0aef('0x41')]=_0x314706[_0x0aef('0x42')]?getSeconds(_0x314706['endtime'],_0x314706[_0x0aef('0x42')]):0x0;};exports[_0x0aef('0x43')]=function(_0x10fcca){return _0x10fcca===_0x0aef('0x44');};exports['variablesAction']=function(_0x2011fb,_0x4c3429,_0x3c902f,_0x2f4b86,_0x415d54){var _0x46ec8b=_0x2f4b86?'RECALL':_0x2011fb[_0x0aef('0x19')];_0x46ec8b=_0x415d54?_0x0aef('0x45'):_0x46ec8b;return{'actionid':_0x2011fb[_0x0aef('0x46')],'action':_0x0aef('0x47'),'channel':_0x2011fb[_0x0aef('0x48')],'callerid':util[_0x0aef('0x11')](_0x0aef('0x12'),_0x46ec8b,_0x2011fb[_0x0aef('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x0aef('0x49'),'Priority':'1','variable':_0x3c902f,'timeout':(_0x4c3429['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2011fb[_0x0aef('0x46')]};};exports['totalGlobal']=function(_0x16ded7){return _0x16ded7[_0x0aef('0x4a')]+_0x16ded7[_0x0aef('0x4b')]+_0x16ded7[_0x0aef('0x4c')];};exports[_0x0aef('0x4d')]=function(_0x1613c7){var _0x3cc986=_['clone'](_0x1613c7);_0x3cc986[_0x0aef('0x36')]=0xf;_0x3cc986['statedesc']=_0x0aef('0x4e');return _0x3cc986;};exports[_0x0aef('0x4f')]=function(_0x214b4e,_0x735218,_0x48a577){var _0x296dac={};_0x296dac[_0x735218]=_0x214b4e[_0x735218];_0x296dac[_0x0aef('0x50')]=![];_0x296dac[_0x0aef('0x51')]=moment()[_0x0aef('0x52')](_0x48a577,'minutes')['format'](_0x0aef('0x3a'));_0x296dac[_0x0aef('0x53')]=_0x214b4e[_0x0aef('0x53')];_0x296dac['ListId']=_0x214b4e['ListId'];_0x296dac[_0x0aef('0x1c')]=_0x214b4e[_0x0aef('0x1c')]||undefined;return _0x296dac;};exports[_0x0aef('0x54')]=function(_0x23f739,_0x3465eb){if(!_['isNil'](_0x23f739)){if(_0x23f739['pTalking']>0x0){_0x23f739[_0x0aef('0x55')]-=0x1;}else{logger[_0x0aef('0x8')](_0x3465eb,_0x0aef('0x56'));}}else{logger['error'](_0x3465eb,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x0aef('0x57')]=function(_0x33d2f6){if(_0x33d2f6<=0x0){return!![];}return![];};exports[_0x0aef('0x58')]=function(_0x31c2f9,_0x38c4ea){_0x31c2f9[_0x0aef('0x59')]=_0x38c4ea;_0x31c2f9['name']=_0x31c2f9[_0x0aef('0x5a')];_0x31c2f9[_0x0aef('0x5b')]=_0x31c2f9[_0x0aef('0x48')];return _0x31c2f9;};exports[_0x0aef('0x5c')]=function(_0x18fc40){var _0x14e137={};_0x14e137[_0x0aef('0x5a')]=_0x18fc40['queue'];_0x14e137[_0x0aef('0x5b')]=_0x18fc40[_0x0aef('0x48')];_0x14e137[_0x0aef('0x46')]=_0x18fc40[_0x0aef('0x46')];return _0x14e137;};exports['agentReadyId']=function(_0x2bf6fe){var _0x4dd4c0=[];for(var _0x54a60b in _0x2bf6fe){if(_0x2bf6fe[_0x0aef('0x29')](_0x54a60b)){if(!_[_0x0aef('0x16')](_0x2bf6fe[_0x54a60b])&&_0x2bf6fe[_0x54a60b][_0x0aef('0x36')]===_0x0aef('0x5d')&&_0x2bf6fe[_0x54a60b][_0x0aef('0x5e')]===_0x0aef('0x5f')){_0x4dd4c0[_0x0aef('0x60')](_0x2bf6fe[_0x54a60b]['id']);}}}return _0x4dd4c0;};exports[_0x0aef('0x61')]=function(_0x2bad03){var _0x1f0ad8=moment()[_0x0aef('0x62')](0x0);var _0x38acec=moment(_0x2bad03)[_0x0aef('0x62')](0x0);return _0x1f0ad8[_0x0aef('0x6')](_0x38acec,_0x0aef('0x63'));};exports[_0x0aef('0x64')]=function(_0x1b4996){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1b4996[_0x0aef('0x53')],'ListId':_0x1b4996['ListId'],'VoiceQueueId':_0x1b4996[_0x0aef('0x1c')]||undefined,'CampaignId':_0x1b4996[_0x0aef('0x65')]||undefined};};exports[_0x0aef('0x66')]=function(_0x54feb6){if(_0x54feb6===_0x0aef('0x46')||_0x54feb6===_0x0aef('0x67')||_0x54feb6==='queue'||_0x54feb6==='type'||_0x54feb6===_0x0aef('0x68')||_0x54feb6===_0x0aef('0x69')||_0x54feb6===_0x0aef('0x3d')||_0x54feb6==='channelAgent'||_0x54feb6===_0x0aef('0x19')||_0x54feb6==='active'||_0x54feb6==='calleridnum'||_0x54feb6===_0x0aef('0x51')||_0x54feb6===_0x0aef('0x4a')||_0x54feb6===_0x0aef('0x4b')||_0x54feb6==='countnoanswerretry'||_0x54feb6===_0x0aef('0x6a')||_0x54feb6===_0x0aef('0x6b')||_0x54feb6===_0x0aef('0x6c')||_0x54feb6===_0x0aef('0x6d')||_0x54feb6===_0x0aef('0x6e')||_0x54feb6===_0x0aef('0x53')||_0x54feb6==='ListId'||_0x54feb6===_0x0aef('0x3e')||_0x54feb6==='VoiceQueueId'||_0x54feb6===_0x0aef('0x6f')||_0x54feb6===_0x0aef('0x70')||_0x54feb6===_0x0aef('0x71')||_0x54feb6===_0x0aef('0x72')||_0x54feb6===_0x0aef('0x73')||_0x54feb6===_0x0aef('0x74')||_0x54feb6===_0x0aef('0x75')||_0x54feb6===_0x0aef('0x76')||_0x54feb6===_0x0aef('0x77')||_0x54feb6===_0x0aef('0x78')||_0x54feb6==='xmd-contactid'||_0x54feb6===_0x0aef('0x79')||_0x54feb6===_0x0aef('0x7a')||_0x54feb6===_0x0aef('0x7b')||_0x54feb6==='xmd-agi'||_0x54feb6===_0x0aef('0x7c')||_0x54feb6===_0x0aef('0x7d')||_0x54feb6===_0x0aef('0x7e')||_0x54feb6==='rtpaudioqosjitterbridged'||_0x54feb6===_0x0aef('0x7f')||_0x54feb6===_0x0aef('0x80')||_0x54feb6===_0x0aef('0x81')||_0x54feb6===_0x0aef('0x82')||_0x54feb6===_0x0aef('0x7c')||_0x54feb6===_0x0aef('0x7d')||_0x54feb6===_0x0aef('0x7e')||_0x54feb6===_0x0aef('0x83')||_0x54feb6===_0x0aef('0x7f')||_0x54feb6==='rtpaudioqoslossbridged'||_0x54feb6===_0x0aef('0x81')||_0x54feb6===_0x0aef('0x82')||_0x54feb6===_0x0aef('0x84')||_0x54feb6==='bridgepvtcallid'||_0x54feb6===_0x0aef('0x36')||_0x54feb6===_0x0aef('0x37')){return![];}return!![];};exports[_0x0aef('0x85')]=function(_0x17b137,_0x4b787c){var _0x4a9190,_0x75c286,_0x7f8e97;if(_0x4b787c<=0x0){_0x4b787c=0x1;}_0x4a9190=new RegExp('\x5cw{0,'+_0x4b787c+'}$');_0x75c286=Math[_0x0aef('0x86')](0xa,_0x4b787c-0x1);_0x7f8e97=Math[_0x0aef('0x86')](0xa,_0x4b787c)-0x1;return util[_0x0aef('0x11')]('%s',_['replace'](_0x17b137,_0x4a9190,_[_0x0aef('0x87')](_0x75c286,_0x7f8e97)));};exports[_0x0aef('0x88')]=function(_0x1b57cd){var _0x2390f3=_0x1b57cd[_0x0aef('0x89')](/"(.*?)"/);return _0x2390f3?_0x2390f3[0x1]:_0x1b57cd;};exports[_0x0aef('0x8a')]=function(_0x16a4c3){var _0x44261d=_0x16a4c3[_0x0aef('0x89')](/<(.*?)>/);return _0x44261d?_0x44261d[0x1]:_0x16a4c3;}; \ No newline at end of file +var _0xb3be=['buildObj','lastevent','buildAcw','queue','interface','agentReadyId','not_inuse','status','reachable','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countbusyretry','countglobal','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','127.0.0.1','milliseconds','seconds','error','inspect','logger','info','loggerError','logger2','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','isNil','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Contact','hasOwnProperty','tags','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xb3be,0x14b));var _0xeb3b=function(_0x549c81,_0x420545){_0x549c81=_0x549c81-0x0;var _0x2eb529=_0xb3be[_0x549c81];return _0x2eb529;};'use strict';var util=require(_0xeb3b('0x0'));var _=require(_0xeb3b('0x1'));var moment=require(_0xeb3b('0x2'));var logger=require('../../../../config/logger')(_0xeb3b('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xeb3b('0x4');function getSeconds(_0x32a3b4,_0xe232e1){var _0x3a5d18=moment(_0x32a3b4)[_0xeb3b('0x5')](0x0);var _0x5e3c2d=moment(_0xe232e1)[_0xeb3b('0x5')](0x0);return _0x3a5d18['diff'](_0x5e3c2d,_0xeb3b('0x6'));}exports['loggerCatch']=function(_0x438286){return function(_0x149699){logger[_0xeb3b('0x7')](_0x438286,util[_0xeb3b('0x8')](_0x149699,{'showHidden':![],'depth':null}));};};exports[_0xeb3b('0x9')]=function(_0x59a5a2,_0x1e41ea){logger[_0xeb3b('0xa')](_0x59a5a2,util[_0xeb3b('0x8')](_0x1e41ea,{'showHidden':![],'depth':null}));};exports[_0xeb3b('0xb')]=function(_0x1bb052,_0x590150){logger['error'](_0x1bb052,util[_0xeb3b('0x8')](_0x590150,{'showHidden':![],'depth':null}));};exports[_0xeb3b('0xc')]=function(_0x7082b5){return function(_0x3b55c0){logger[_0xeb3b('0xa')](_0x7082b5,util[_0xeb3b('0x8')](_0x3b55c0,{'showHidden':![],'depth':null}));};};exports[_0xeb3b('0xd')]=function(_0x3e75c6,_0x5b3193,_0x3dd037){return{'message':_0x3e75c6,'unlock':_0x5b3193,'active':_0x3dd037};};exports['getCallerId']=function(_0x46bec0,_0x7a5c95,_0x39e352){if(!_[_0xeb3b('0xe')](_0x39e352)&&'string'===typeof _0x39e352&&!_[_0xeb3b('0xf')](_0x39e352)){if(!_[_0xeb3b('0xe')](_0x7a5c95)&&_0xeb3b('0x10')===typeof _0x7a5c95&&!_[_0xeb3b('0xf')](_0x7a5c95)){return util[_0xeb3b('0x11')](_0xeb3b('0x12'),_0x7a5c95,_0x39e352);}return util[_0xeb3b('0x11')](_0xeb3b('0x12'),_0x39e352,_0x39e352);}if(!_[_0xeb3b('0xe')](_0x46bec0)&&_0xeb3b('0x10')===typeof _0x46bec0&&!_[_0xeb3b('0xf')](_0x46bec0)){return _0x46bec0;}return'\x22\x22\x20<>';};exports['isActive']=function(_0xa3739f){if(_[_0xeb3b('0x13')](_0xa3739f)){return![];}return _0xa3739f;};exports['addVariables']=function(_0x4b67e3,_0x51d590,_0x1a9a00,_0x215030,_0x24bbca,_0x4270f3){var _0x294357={'XMD-QUEUE':_0x51d590[_0xeb3b('0x14')]?_0x51d590[_0xeb3b('0x14')][_0xeb3b('0x15')]:'','XMD-CALLERID':_0x215030,'XMD-CALLERID-PREVIEW':_0x4270f3?util['format'](_0xeb3b('0x12'),_0x4270f3[_0xeb3b('0x16')],_0x4270f3['calleridnum']):_0x215030,'XMD-DIALID':_0x24bbca,'XMD-CONTACTID':_0x51d590[_0xeb3b('0x17')],'XMD-CDRTYPE':_0xeb3b('0x18'),'CALLERID(all)':_0x215030,'XMD-VOICEQUEUEID':_0x51d590[_0xeb3b('0x19')],'XMD-DIALCHANNEL':_0x1a9a00,'XMD-DIALTIMEOUT':_0x4b67e3[_0xeb3b('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xeb3b('0x1b'),_0x4b67e3[_0xeb3b('0x1c')]?'g':'',_['isEmpty'](_0x4b67e3[_0xeb3b('0x1d')])?'':_0xeb3b('0x1e')),'XMD-DIALURL':_0x4b67e3[_0xeb3b('0x1f')]||'','XMD-AGI':_0x4b67e3[_0xeb3b('0x20')]?util[_0xeb3b('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b67e3['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4b67e3[_0xeb3b('0x1c')]?util[_0xeb3b('0x11')](_0xeb3b('0x21'),ipAgi,_0x4b67e3[_0xeb3b('0x1c')]):_0xeb3b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x4270f3?_0x4270f3[_0xeb3b('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4270f3?_0x4270f3[_0xeb3b('0x24')]:'','XMD-DESTINATION':_0xeb3b('0x25')};if(!_[_0xeb3b('0xf')](_0x4b67e3[_0xeb3b('0x1d')])){_0x294357[util[_0xeb3b('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4b67e3[_0xeb3b('0x1d')];_0x294357[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x24bbca;}if(_0x51d590&&_0x51d590[_0xeb3b('0x26')]){for(var _0x29a2bc in _0x51d590['Contact']){if(_0x51d590[_0xeb3b('0x26')][_0xeb3b('0x27')](_0x29a2bc)){if(!_[_0xeb3b('0x13')](_0x51d590[_0xeb3b('0x26')][_0x29a2bc])&&_0x29a2bc!=='id'&&_0x29a2bc!==_0xeb3b('0x28')&&_0x29a2bc!=='createdAt'&&_0x29a2bc!=='updatedAt'){_0x294357[util[_0xeb3b('0x11')](_0xeb3b('0x29'),_0xeb3b('0x2a'),_[_0xeb3b('0x2b')](_0x29a2bc))]=_0x51d590[_0xeb3b('0x26')][_0x29a2bc];}}}}return _0x294357;};exports[_0xeb3b('0x2c')]=function(_0x5ea145){var _0x5753b9={};for(var _0x1aa7db in _0x5ea145){if(_0x5ea145[_0xeb3b('0x27')](_0x1aa7db)){_0x5753b9[util[_0xeb3b('0x11')]('%s',_[_0xeb3b('0x2d')](_0x1aa7db))]=_0x5ea145[_0x1aa7db];}}return{'variables':_0x5753b9};};exports[_0xeb3b('0x2e')]=function(_0x44d166,_0x104ab0){if(!_[_0xeb3b('0x13')](_0x44d166)){if(_0x44d166['hasOwnProperty'](_0xeb3b('0x2f'))){if(_0x44d166['originated']>0x0){_0x44d166['originated']-=0x1;}else{logger['error'](_0xeb3b('0x30'),_0x104ab0);}}}else{logger[_0xeb3b('0x7')](_0xeb3b('0x31'),_0x104ab0);}};exports[_0xeb3b('0x32')]=function(_0x276b1b){var _0x298c32=moment()[_0xeb3b('0x11')](_0xeb3b('0x33'));_0x276b1b[_0xeb3b('0x34')]=0xd;_0x276b1b[_0xeb3b('0x35')]=_0xeb3b('0x36');_0x276b1b[_0xeb3b('0x37')]=_0x298c32;_0x276b1b[_0xeb3b('0x38')]=_0x298c32;_0x276b1b[_0xeb3b('0x39')]=_0x298c32;};exports[_0xeb3b('0x3a')]=function(_0x30c845,_0x114578,_0x20e871){var _0xdef363=moment()[_0xeb3b('0x11')](_0xeb3b('0x33'));_0x30c845[_0xeb3b('0x34')]=_0x114578;_0x30c845[_0xeb3b('0x35')]=_0x20e871;_0x30c845['responsetime']=_0xdef363;_0x30c845[_0xeb3b('0x3b')]=getSeconds(_0x30c845['responsetime'],_0x30c845[_0xeb3b('0x37')]);};exports[_0xeb3b('0x3c')]=function(_0x2ea6d1,_0x15b73c,_0x350c9e){_0x2ea6d1['membername']=_0x15b73c;_0x2ea6d1[_0xeb3b('0x3d')]=_0x350c9e;};exports[_0xeb3b('0x3e')]=function(_0x529ab0,_0x1e585d,_0x396fc3){var _0x393b0b=moment()[_0xeb3b('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x529ab0[_0xeb3b('0x34')]=_0x1e585d;_0x529ab0[_0xeb3b('0x35')]=_0x396fc3;_0x529ab0['responsetime']=_0x529ab0[_0xeb3b('0x38')]?_0x529ab0[_0xeb3b('0x38')]:_0x393b0b;_0x529ab0['endtime']=_0x529ab0['endtime']?_0x529ab0['endtime']:_0x393b0b;_0x529ab0[_0xeb3b('0x3b')]=getSeconds(_0x529ab0[_0xeb3b('0x38')]||0x0,_0x529ab0[_0xeb3b('0x37')]||0x0);_0x529ab0[_0xeb3b('0x3f')]=_0x529ab0['answertime']?getSeconds(_0x529ab0['endtime'],_0x529ab0[_0xeb3b('0x40')]):0x0;};exports[_0xeb3b('0x41')]=function(_0x57fd37){return _0x57fd37===_0xeb3b('0x42');};exports[_0xeb3b('0x43')]=function(_0x139895,_0xdd5145,_0x4b53cf,_0x1b35c2,_0x5e8b1f){var _0x1ca7d0=_0x1b35c2?'RECALL':_0x139895[_0xeb3b('0x16')];_0x1ca7d0=_0x5e8b1f?_0xeb3b('0x44'):_0x1ca7d0;return{'actionid':_0x139895[_0xeb3b('0x45')],'action':_0xeb3b('0x46'),'channel':_0x139895[_0xeb3b('0x47')],'callerid':util['format'](_0xeb3b('0x12'),_0x1ca7d0,_0x139895[_0xeb3b('0x48')]),'Exten':_0xeb3b('0x25'),'Context':_0xeb3b('0x49'),'Priority':'1','variable':_0x4b53cf,'timeout':(_0xdd5145[_0xeb3b('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x139895[_0xeb3b('0x45')]};};exports[_0xeb3b('0x4b')]=function(_0x3ad0c8){return _0x3ad0c8['countbusyretry']+_0x3ad0c8[_0xeb3b('0x4c')]+_0x3ad0c8[_0xeb3b('0x4d')];};exports[_0xeb3b('0x4e')]=function(_0x44b522){var _0x5c661c=_[_0xeb3b('0x4f')](_0x44b522);_0x5c661c[_0xeb3b('0x34')]=0xf;_0x5c661c[_0xeb3b('0x35')]='Global';return _0x5c661c;};exports[_0xeb3b('0x50')]=function(_0x1543e3,_0x44494c,_0x28694b){var _0x18dd1c={};_0x18dd1c[_0x44494c]=_0x1543e3[_0x44494c];_0x18dd1c[_0xeb3b('0x51')]=![];_0x18dd1c[_0xeb3b('0x52')]=moment()['add'](_0x28694b,_0xeb3b('0x53'))[_0xeb3b('0x11')](_0xeb3b('0x33'));_0x18dd1c[_0xeb3b('0x17')]=_0x1543e3[_0xeb3b('0x17')];_0x18dd1c[_0xeb3b('0x54')]=_0x1543e3['ListId'];_0x18dd1c[_0xeb3b('0x19')]=_0x1543e3[_0xeb3b('0x19')]||undefined;return _0x18dd1c;};exports[_0xeb3b('0x55')]=function(_0x724742,_0x30f89e){if(!_[_0xeb3b('0x13')](_0x724742)){if(_0x724742[_0xeb3b('0x56')]>0x0){_0x724742['pTalking']-=0x1;}else{logger[_0xeb3b('0x7')](_0x30f89e,_0xeb3b('0x57'));}}else{logger[_0xeb3b('0x7')](_0x30f89e,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xeb3b('0x58')]=function(_0x19c4d6){if(_0x19c4d6<=0x0){return!![];}return![];};exports[_0xeb3b('0x59')]=function(_0x2347f8,_0x168e7c){_0x2347f8[_0xeb3b('0x5a')]=_0x168e7c;_0x2347f8[_0xeb3b('0x15')]=_0x2347f8['queue'];_0x2347f8['interface']=_0x2347f8['channelAgent'];return _0x2347f8;};exports[_0xeb3b('0x5b')]=function(_0x4082d3){var _0x517938={};_0x517938['queue']=_0x4082d3[_0xeb3b('0x5c')];_0x517938[_0xeb3b('0x5d')]=_0x4082d3['channelAgent'];_0x517938['uniqueid']=_0x4082d3['uniqueid'];return _0x517938;};exports[_0xeb3b('0x5e')]=function(_0x194a27){var _0x236946=[];for(var _0xc3c0e1 in _0x194a27){if(_0x194a27['hasOwnProperty'](_0xc3c0e1)){if(!_[_0xeb3b('0x13')](_0x194a27[_0xc3c0e1])&&_0x194a27[_0xc3c0e1][_0xeb3b('0x34')]===_0xeb3b('0x5f')&&_0x194a27[_0xc3c0e1][_0xeb3b('0x60')]===_0xeb3b('0x61')){_0x236946['push'](_0x194a27[_0xc3c0e1]['id']);}}}return _0x236946;};exports['getDiff']=function(_0x162209){var _0x99e598=moment()[_0xeb3b('0x5')](0x0);var _0x2a08e6=moment(_0x162209)[_0xeb3b('0x5')](0x0);return _0x99e598['diff'](_0x2a08e6,_0xeb3b('0x6'));};exports[_0xeb3b('0x62')]=function(_0xbbabcc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xbbabcc['ContactId'],'ListId':_0xbbabcc[_0xeb3b('0x54')],'VoiceQueueId':_0xbbabcc['VoiceQueueId']||undefined,'CampaignId':_0xbbabcc[_0xeb3b('0x63')]||undefined};};exports[_0xeb3b('0x64')]=function(_0x6158aa){if(_0x6158aa===_0xeb3b('0x45')||_0x6158aa===_0xeb3b('0x65')||_0x6158aa===_0xeb3b('0x5c')||_0x6158aa===_0xeb3b('0x66')||_0x6158aa===_0xeb3b('0x67')||_0x6158aa===_0xeb3b('0x68')||_0x6158aa===_0xeb3b('0x69')||_0x6158aa==='channelAgent'||_0x6158aa===_0xeb3b('0x16')||_0x6158aa===_0xeb3b('0x51')||_0x6158aa===_0xeb3b('0x48')||_0x6158aa===_0xeb3b('0x52')||_0x6158aa===_0xeb3b('0x6a')||_0x6158aa===_0xeb3b('0x4c')||_0x6158aa===_0xeb3b('0x4d')||_0x6158aa===_0xeb3b('0x6b')||_0x6158aa===_0xeb3b('0x6c')||_0x6158aa===_0xeb3b('0x6d')||_0x6158aa==='callbackat'||_0x6158aa===_0xeb3b('0x6e')||_0x6158aa===_0xeb3b('0x17')||_0x6158aa===_0xeb3b('0x54')||_0x6158aa===_0xeb3b('0x3d')||_0x6158aa===_0xeb3b('0x19')||_0x6158aa==='sipcallid'||_0x6158aa===_0xeb3b('0x6f')||_0x6158aa===_0xeb3b('0x70')||_0x6158aa===_0xeb3b('0x71')||_0x6158aa===_0xeb3b('0x72')||_0x6158aa===_0xeb3b('0x73')||_0x6158aa===_0xeb3b('0x74')||_0x6158aa===_0xeb3b('0x75')||_0x6158aa==='xmd-dialid'||_0x6158aa===_0xeb3b('0x76')||_0x6158aa===_0xeb3b('0x77')||_0x6158aa===_0xeb3b('0x78')||_0x6158aa===_0xeb3b('0x79')||_0x6158aa===_0xeb3b('0x7a')||_0x6158aa===_0xeb3b('0x7b')||_0x6158aa===_0xeb3b('0x7c')||_0x6158aa===_0xeb3b('0x7d')||_0x6158aa===_0xeb3b('0x7e')||_0x6158aa===_0xeb3b('0x7f')||_0x6158aa===_0xeb3b('0x80')||_0x6158aa===_0xeb3b('0x81')||_0x6158aa===_0xeb3b('0x82')||_0x6158aa===_0xeb3b('0x83')||_0x6158aa===_0xeb3b('0x7c')||_0x6158aa==='rtpaudioqosbridged'||_0x6158aa===_0xeb3b('0x7e')||_0x6158aa===_0xeb3b('0x7f')||_0x6158aa===_0xeb3b('0x80')||_0x6158aa===_0xeb3b('0x81')||_0x6158aa===_0xeb3b('0x82')||_0x6158aa===_0xeb3b('0x83')||_0x6158aa==='bridgepeer'||_0x6158aa===_0xeb3b('0x84')||_0x6158aa==='state'||_0x6158aa===_0xeb3b('0x35')){return![];}return!![];};exports[_0xeb3b('0x85')]=function(_0x3323b2,_0x309a66){var _0x4e2f4c,_0x528217,_0x1f4364;if(_0x309a66<=0x0){_0x309a66=0x1;}_0x4e2f4c=new RegExp('\x5cw{0,'+_0x309a66+'}$');_0x528217=Math[_0xeb3b('0x86')](0xa,_0x309a66-0x1);_0x1f4364=Math[_0xeb3b('0x86')](0xa,_0x309a66)-0x1;return util[_0xeb3b('0x11')]('%s',_[_0xeb3b('0x87')](_0x3323b2,_0x4e2f4c,_[_0xeb3b('0x88')](_0x528217,_0x1f4364)));};exports[_0xeb3b('0x89')]=function(_0x3b7b90){var _0x206086=_0x3b7b90[_0xeb3b('0x8a')](/"(.*?)"/);return _0x206086?_0x206086[0x1]:_0x3b7b90;};exports[_0xeb3b('0x8b')]=function(_0xa1915d){var _0x74602b=_0xa1915d[_0xeb3b('0x8a')](/<(.*?)>/);return _0x74602b?_0x74602b[0x1]:_0xa1915d;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ab4be9b..326abc2 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 _0x12c9=['voicechannel','queueadd','string','number','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x4e9e44,_0x216df1){var _0x3579cb=function(_0xff4459){while(--_0xff4459){_0x4e9e44['push'](_0x4e9e44['shift']());}};_0x3579cb(++_0x216df1);}(_0x12c9,0x1c9));var _0x912c=function(_0x562cb8,_0x15633a){_0x562cb8=_0x562cb8-0x0;var _0x193ab0=_0x12c9[_0x562cb8];return _0x193ab0;};'use strict';exports[_0x912c('0x0')]={'queue':{'type':_0x912c('0x1'),'required':!![]},'interface':{'type':_0x912c('0x1'),'required':!![]},'membername':{'type':_0x912c('0x1'),'required':!![]},'penalty':{'type':_0x912c('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x912c('0x3')]={'queue':{'type':_0x912c('0x1'),'required':!![]},'interface':{'type':_0x912c('0x1'),'required':!![]}};exports[_0x912c('0x4')]={'interface':{'type':_0x912c('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x912c('0x5')]={'module':{'type':_0x912c('0x1'),'required':![]}};exports[_0x912c('0x6')]={'uniqueid':{'type':_0x912c('0x1'),'required':!![]}};exports[_0x912c('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x912c('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x912c('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x912c('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x912c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x912c('0x1')}}; \ No newline at end of file +var _0xf2cf=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','boolean','queueremove'];(function(_0x34bf49,_0x5bed05){var _0x17c0e1=function(_0x3e4ee5){while(--_0x3e4ee5){_0x34bf49['push'](_0x34bf49['shift']());}};_0x17c0e1(++_0x5bed05);}(_0xf2cf,0xf5));var _0xff2c=function(_0x45af04,_0x3e48e9){_0x45af04=_0x45af04-0x0;var _0x364cca=_0xf2cf[_0x45af04];return _0x364cca;};'use strict';exports['queueadd']={'queue':{'type':_0xff2c('0x0'),'required':!![]},'interface':{'type':_0xff2c('0x0'),'required':!![]},'membername':{'type':_0xff2c('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xff2c('0x1'),'required':![]}};exports[_0xff2c('0x2')]={'queue':{'type':_0xff2c('0x0'),'required':!![]},'interface':{'type':_0xff2c('0x0'),'required':!![]}};exports[_0xff2c('0x3')]={'interface':{'type':_0xff2c('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xff2c('0x0'),'required':![]}};exports[_0xff2c('0x4')]={'module':{'type':'string','required':![]}};exports[_0xff2c('0x5')]={'uniqueid':{'type':_0xff2c('0x0'),'required':!![]}};exports[_0xff2c('0x6')]={'uniqueid':{'type':_0xff2c('0x0'),'required':!![]},'filename':{'type':_0xff2c('0x0')},'format':{'type':_0xff2c('0x0')},'mixmonitorid':{'type':_0xff2c('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xff2c('0x0'),'required':!![]}};exports[_0xff2c('0x7')]={'uniqueid':{'type':_0xff2c('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xff2c('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 62af626..c1199d5 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 _0x0b13=['initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','initTelephones','telephones','isUndefined','initVoiceQueues','length','initTriggers','triggers','initTemplates','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x0b13,0x150));var _0x30b1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0b13[_0x3bf83f];return _0x22c4a9;};'use strict';var BPromise=require(_0x30b1('0x0'));var util=require(_0x30b1('0x1'));var _=require(_0x30b1('0x2'));var moment=require(_0x30b1('0x3'));var Agent=require(_0x30b1('0x4'));var Telephone=require(_0x30b1('0x5'));var Trunk=require(_0x30b1('0x6'));var VoiceQueue=require(_0x30b1('0x7'));var Trigger=require(_0x30b1('0x8'));var Template=require(_0x30b1('0x9'));var Campaign=require(_0x30b1('0xa'));var VoiceExtension=require(_0x30b1('0xb'));var ZendeskAccount=require(_0x30b1('0xc'));var SalesforceAccount=require(_0x30b1('0xd'));var FreshdeskAccount=require(_0x30b1('0xe'));var SugarcrmAccount=require(_0x30b1('0xf'));var ZohoAccount=require(_0x30b1('0x10'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x30b1('0x11'));var ServicenowAccount=require(_0x30b1('0x12'));var Dynamics365Account=require(_0x30b1('0x13'));var FaxAccount=require(_0x30b1('0x14'));var Realtime=function(){this[_0x30b1('0x15')]={};this['telephones']={};this[_0x30b1('0x16')]={};this[_0x30b1('0x17')]={};this['triggers']={};this['campaigns']={};this[_0x30b1('0x18')]={};this[_0x30b1('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x30b1('0x1a')]={};this[_0x30b1('0x1b')]={};this[_0x30b1('0x1c')]={};this[_0x30b1('0x1d')]={};this[_0x30b1('0x1e')]={};this[_0x30b1('0x1f')]={};this[_0x30b1('0x20')]={};this[_0x30b1('0x21')]={};this[_0x30b1('0x22')]={};this[_0x30b1('0x23')]={};this[_0x30b1('0x24')]={};this['vtigerAccounts']={};this[_0x30b1('0x25')]={};this['dynamics365Accounts']={};this[_0x30b1('0x26')]={};};function freeIsNotKey(_0xdb8da4,_0x290c89,_0x1bc890){var _0x1ab642=_[_0x30b1('0x27')](_0xdb8da4,function(_0x9c46a6,_0x3a2295){return _0x9c46a6[_0x1bc890];});for(var _0x417f3b in _0x290c89){if(_0x290c89[_0x30b1('0x28')](_0x417f3b)){if(!_0x1ab642[_0x417f3b]){delete _0x290c89[_0x417f3b];}}}}function freeIsNotKeySip(_0x1666cb,_0x47078d){var _0x1ef404=_[_0x30b1('0x27')](_0x1666cb,function(_0x2aa391,_0x4d5fb1){return util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x2aa391['name']);});for(var _0x52753a in _0x47078d){if(_0x47078d['hasOwnProperty'](_0x52753a)){if(!_0x1ef404[_0x52753a]){delete _0x47078d[_0x52753a];}}}}function freeIsNotKeyAgent(_0x771cbd,_0xbeae78){var _0x2b4238=_[_0x30b1('0x27')](_0x771cbd,function(_0x5134a8,_0x15d5cb){var _0xe36387=_[_0x30b1('0x2b')](_0x5134a8['interface'])?util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x5134a8[_0x30b1('0x2c')]):_0x5134a8[_0x30b1('0x2d')];return _0xe36387;});for(var _0xee69ea in _0xbeae78){if(_0xbeae78[_0x30b1('0x28')](_0xee69ea)){if(!_0x2b4238[_0xee69ea]){delete _0xbeae78[_0xee69ea];}}}}function clearVoiceCallReports(_0x10f254){_0x10f254[_0x30b1('0x2e')]=0x0;_0x10f254[_0x30b1('0x2f')]=0x0;_0x10f254[_0x30b1('0x30')]=0x0;_0x10f254[_0x30b1('0x31')]=0x0;_0x10f254[_0x30b1('0x32')]=0x0;}function clearCampaigns(_0x34126d){if(!_['isEmpty'](_0x34126d)){for(var _0x2c125d in _0x34126d){if(_0x34126d[_0x30b1('0x28')](_0x2c125d)){_0x34126d[_0x2c125d][_0x30b1('0x33')]=0x0;_0x34126d[_0x2c125d][_0x30b1('0x34')]=0x0;}}}}function clearVoiceQueues(_0xb70927){if(!_[_0x30b1('0x35')](_0xb70927)){for(var _0x1e3b28 in _0xb70927){if(_0xb70927['hasOwnProperty'](_0x1e3b28)){_0xb70927[_0x1e3b28][_0x30b1('0x2e')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x2f')]=0x0;_0xb70927[_0x1e3b28]['unmanaged']=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x36')]=0x0;_0xb70927[_0x1e3b28]['sumHoldTime']=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x31')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x32')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x37')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x38')]=0x0;_0xb70927[_0x1e3b28]['outboundBusyCallsDay']=0x0;_0xb70927[_0x1e3b28]['outboundCongestionCallsDay']=0x0;_0xb70927[_0x1e3b28]['outboundNoSuchCallsDay']=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x39')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3a')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3b')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3c')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3d')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3e')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x3f')]=0x0;_0xb70927[_0x1e3b28]['outboundAnswerAgiCallsDay']=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x40')]=0x0;_0xb70927[_0x1e3b28][_0x30b1('0x41')]=!![];}}}}Realtime[_0x30b1('0x42')][_0x30b1('0x43')]=function(_0x1e1c0a,_0x100147){for(var _0x494064 in _0x100147){if(_0x1e1c0a[_0x30b1('0x28')](_0x494064)){_0x1e1c0a[_0x494064]=_0x100147[_0x494064];}}};Realtime[_0x30b1('0x42')][_0x30b1('0x44')]=function(){var _0x454094=this;return function(_0x2dbe55){if(_0x2dbe55){freeIsNotKeyAgent(_0x2dbe55,_0x454094[_0x30b1('0x15')]);for(var _0x47fb0a=0x0,_0x46705e={},_0x226726={};_0x47fb0a<_0x2dbe55['length'];_0x47fb0a+=0x1){_0x46705e=_0x2dbe55[_0x47fb0a];var _0x4f946b=_[_0x30b1('0x2b')](_0x46705e[_0x30b1('0x2d')])?util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x46705e['name']):_0x46705e[_0x30b1('0x2d')];if(_['isUndefined'](_0x454094['agents'][_0x4f946b])){_0x454094['agents'][_0x4f946b]=new Agent(_0x46705e);}else{_0x454094['mergeFromDatabase'](_0x454094[_0x30b1('0x15')][_0x4f946b],_0x46705e);}}}return _0x454094[_0x30b1('0x15')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x45')]=function(){var _0x27d695=this;return function(_0x25b132){if(_0x25b132){freeIsNotKeySip(_0x25b132,_0x27d695['telephones']);for(var _0x5acc1f=0x0,_0x56c825={},_0x40b4cc={};_0x5acc1f<_0x25b132['length'];_0x5acc1f+=0x1){_0x56c825=_0x25b132[_0x5acc1f];if(_['isUndefined'](_0x27d695[_0x30b1('0x46')][util[_0x30b1('0x29')]('SIP/%s',_0x56c825[_0x30b1('0x2c')])])){_0x27d695[_0x30b1('0x46')][util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x56c825[_0x30b1('0x2c')])]=new Telephone(_0x56c825);}else{_0x27d695['mergeFromDatabase'](_0x27d695[_0x30b1('0x46')][util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x56c825['name'])],_0x56c825);}}}return _0x27d695['telephones'];};};Realtime[_0x30b1('0x42')]['initTrunks']=function(){var _0x41d141=this;return function(_0x2f0749){if(_0x2f0749){freeIsNotKeySip(_0x2f0749,_0x41d141[_0x30b1('0x16')]);for(var _0x58d7bf=0x0,_0x16faeb={},_0x2816f3={};_0x58d7bf<_0x2f0749['length'];_0x58d7bf+=0x1){_0x16faeb=_0x2f0749[_0x58d7bf];if(_[_0x30b1('0x47')](_0x41d141[_0x30b1('0x16')][util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x16faeb[_0x30b1('0x2c')])])){_0x41d141[_0x30b1('0x16')][util[_0x30b1('0x29')](_0x30b1('0x2a'),_0x16faeb[_0x30b1('0x2c')])]=new Trunk(_0x16faeb);}else{_0x41d141[_0x30b1('0x43')](_0x41d141[_0x30b1('0x16')][util[_0x30b1('0x29')]('SIP/%s',_0x16faeb[_0x30b1('0x2c')])],_0x16faeb);}}}return _0x41d141[_0x30b1('0x16')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x48')]=function(){var _0x2b61b5=this;return function(_0x18f9f6){if(_0x18f9f6){freeIsNotKey(_0x18f9f6,_0x2b61b5['voiceQueues'],'name');for(var _0x5cc26d=0x0,_0x30cd38={},_0x57abdf={};_0x5cc26d<_0x18f9f6[_0x30b1('0x49')];_0x5cc26d+=0x1){_0x30cd38=_0x18f9f6[_0x5cc26d];if(_[_0x30b1('0x47')](_0x2b61b5['voiceQueues'][_0x30cd38[_0x30b1('0x2c')]])){_0x2b61b5[_0x30b1('0x17')][_0x30cd38['name']]=new VoiceQueue(_0x30cd38);}else{_0x2b61b5[_0x30b1('0x43')](_0x2b61b5['voiceQueues'][_0x30cd38['name']],_0x30cd38);}}}return _0x2b61b5['voiceQueues'];};};Realtime[_0x30b1('0x42')][_0x30b1('0x4a')]=function(){var _0x3aa505=this;return function(_0x356f17){if(_0x356f17){freeIsNotKey(_0x356f17,_0x3aa505[_0x30b1('0x4b')],'id');for(var _0x4bfa27=0x0,_0x1685b5={},_0xd1e751={};_0x4bfa27<_0x356f17[_0x30b1('0x49')];_0x4bfa27+=0x1){_0x1685b5=_0x356f17[_0x4bfa27];if(_[_0x30b1('0x47')](_0x3aa505[_0x30b1('0x4b')][_0x1685b5['id']])){_0x3aa505[_0x30b1('0x4b')][_0x1685b5['id']]=new Trigger(_0x1685b5);}else{_0x3aa505[_0x30b1('0x43')](_0x3aa505[_0x30b1('0x4b')][_0x1685b5['id']],_0x1685b5);}}}return _0x3aa505[_0x30b1('0x4b')];};};Realtime['prototype'][_0x30b1('0x4c')]=function(){var _0x3c9d43=this;return function(_0x4fb232){if(_0x4fb232){freeIsNotKey(_0x4fb232,_0x3c9d43[_0x30b1('0x18')],'id');for(var _0x4240ab=0x0,_0x2565c4={},_0x17ff02={};_0x4240ab<_0x4fb232[_0x30b1('0x49')];_0x4240ab+=0x1){_0x2565c4=_0x4fb232[_0x4240ab];if(_['isUndefined'](_0x3c9d43[_0x30b1('0x18')][_0x2565c4['id']])){_0x3c9d43['templates'][_0x2565c4['id']]=new Template(_0x2565c4);}else{_0x3c9d43[_0x30b1('0x43')](_0x3c9d43[_0x30b1('0x18')][_0x2565c4['id']],_0x2565c4);}}}return _0x3c9d43['templates'];};};Realtime[_0x30b1('0x42')]['initZendeskAccounts']=function(){var _0x30fffe=this;return function(_0x115f2f){if(_0x115f2f){freeIsNotKey(_0x115f2f,_0x30fffe[_0x30b1('0x1f')],'id');for(var _0x327505=0x0,_0x5be16e={},_0xacf7f1={};_0x327505<_0x115f2f[_0x30b1('0x49')];_0x327505+=0x1){_0x5be16e=_0x115f2f[_0x327505];if(_['isUndefined'](_0x30fffe[_0x30b1('0x1f')][_0x5be16e['id']])){_0x30fffe[_0x30b1('0x1f')][_0x5be16e['id']]=new ZendeskAccount(_0x5be16e);}else{_0x30fffe[_0x30b1('0x43')](_0x30fffe[_0x30b1('0x1f')][_0x5be16e['id']],_0x5be16e);}}}return _0x30fffe['zendeskAccounts'];};};Realtime[_0x30b1('0x42')]['initSalesforceAccounts']=function(){var _0x3e15dd=this;return function(_0x271017){if(_0x271017){freeIsNotKey(_0x271017,_0x3e15dd[_0x30b1('0x20')],'id');for(var _0x46fc25=0x0,_0x482345={},_0x37e793={};_0x46fc25<_0x271017[_0x30b1('0x49')];_0x46fc25+=0x1){_0x482345=_0x271017[_0x46fc25];if(_[_0x30b1('0x47')](_0x3e15dd[_0x30b1('0x20')][_0x482345['id']])){_0x3e15dd[_0x30b1('0x20')][_0x482345['id']]=new SalesforceAccount(_0x482345);}else{_0x3e15dd[_0x30b1('0x43')](_0x3e15dd[_0x30b1('0x20')][_0x482345['id']],_0x482345);}}}return _0x3e15dd[_0x30b1('0x20')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x4d')]=function(){var _0x314271=this;return function(_0x2aca10){if(_0x2aca10){freeIsNotKey(_0x2aca10,_0x314271['freshdeskAccounts'],'id');for(var _0x3d20a2=0x0,_0x53dafc={},_0x4ab00f={};_0x3d20a2<_0x2aca10[_0x30b1('0x49')];_0x3d20a2+=0x1){_0x53dafc=_0x2aca10[_0x3d20a2];if(_[_0x30b1('0x47')](_0x314271[_0x30b1('0x22')][_0x53dafc['id']])){_0x314271[_0x30b1('0x22')][_0x53dafc['id']]=new FreshdeskAccount(_0x53dafc);}else{_0x314271[_0x30b1('0x43')](_0x314271[_0x30b1('0x22')][_0x53dafc['id']],_0x53dafc);}}}return _0x314271['freshdeskAccounts'];};};Realtime[_0x30b1('0x42')][_0x30b1('0x4e')]=function(){var _0x153bf4=this;return function(_0x38fb1f){if(_0x38fb1f){freeIsNotKey(_0x38fb1f,_0x153bf4['zohoAccounts'],'id');for(var _0x71cedd=0x0,_0x5c5841={},_0x379a30={};_0x71cedd<_0x38fb1f[_0x30b1('0x49')];_0x71cedd+=0x1){_0x5c5841=_0x38fb1f[_0x71cedd];if(_['isUndefined'](_0x153bf4['zohoAccounts'][_0x5c5841['id']])){_0x153bf4[_0x30b1('0x23')][_0x5c5841['id']]=new ZohoAccount(_0x5c5841);}else{_0x153bf4[_0x30b1('0x43')](_0x153bf4['zohoAccounts'][_0x5c5841['id']],_0x5c5841);}}}return _0x153bf4[_0x30b1('0x23')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x4f')]=function(){var _0x37a340=this;return function(_0x586bf5){if(_0x586bf5){freeIsNotKey(_0x586bf5,_0x37a340[_0x30b1('0x24')],'id');for(var _0x3584af=0x0,_0x595058={},_0x90f5b4={};_0x3584af<_0x586bf5[_0x30b1('0x49')];_0x3584af+=0x1){_0x595058=_0x586bf5[_0x3584af];if(_[_0x30b1('0x47')](_0x37a340[_0x30b1('0x24')][_0x595058['id']])){_0x37a340[_0x30b1('0x24')][_0x595058['id']]=new DeskAccount(_0x595058);}else{_0x37a340[_0x30b1('0x43')](_0x37a340['deskAccounts'][_0x595058['id']],_0x595058);}}}return _0x37a340['deskAccounts'];};};Realtime['prototype'][_0x30b1('0x50')]=function(){var _0xec6ef9=this;return function(_0x327bb9){if(_0x327bb9){freeIsNotKey(_0x327bb9,_0xec6ef9[_0x30b1('0x21')],'id');for(var _0x5919e1=0x0,_0x39a422={},_0x341d4a={};_0x5919e1<_0x327bb9[_0x30b1('0x49')];_0x5919e1+=0x1){_0x39a422=_0x327bb9[_0x5919e1];if(_[_0x30b1('0x47')](_0xec6ef9['sugarcrmAccounts'][_0x39a422['id']])){_0xec6ef9[_0x30b1('0x21')][_0x39a422['id']]=new SugarcrmAccount(_0x39a422);}else{_0xec6ef9[_0x30b1('0x43')](_0xec6ef9[_0x30b1('0x21')][_0x39a422['id']],_0x39a422);}}}return _0xec6ef9[_0x30b1('0x21')];};};Realtime[_0x30b1('0x42')]['initVtigerAccounts']=function(){var _0x312a68=this;return function(_0x2ba672){if(_0x2ba672){freeIsNotKey(_0x2ba672,_0x312a68['vtigerAccounts'],'id');for(var _0x1f5177=0x0,_0x133a7c={},_0x4073da={};_0x1f5177<_0x2ba672[_0x30b1('0x49')];_0x1f5177+=0x1){_0x133a7c=_0x2ba672[_0x1f5177];if(_[_0x30b1('0x47')](_0x312a68[_0x30b1('0x51')][_0x133a7c['id']])){_0x312a68[_0x30b1('0x51')][_0x133a7c['id']]=new VtigerAccount(_0x133a7c);}else{_0x312a68[_0x30b1('0x43')](_0x312a68['vtigerAccounts'][_0x133a7c['id']],_0x133a7c);}}}return _0x312a68[_0x30b1('0x51')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x52')]=function(){var _0x2f9e26=this;return function(_0x4e4f57){if(_0x4e4f57){freeIsNotKey(_0x4e4f57,_0x2f9e26[_0x30b1('0x25')],'id');for(var _0x4c3a2e=0x0,_0x118b08={},_0x1a451a={};_0x4c3a2e<_0x4e4f57[_0x30b1('0x49')];_0x4c3a2e+=0x1){_0x118b08=_0x4e4f57[_0x4c3a2e];if(_[_0x30b1('0x47')](_0x2f9e26[_0x30b1('0x25')][_0x118b08['id']])){_0x2f9e26['servicenowAccounts'][_0x118b08['id']]=new ServicenowAccount(_0x118b08);}else{_0x2f9e26['mergeFromDatabase'](_0x2f9e26[_0x30b1('0x25')][_0x118b08['id']],_0x118b08);}}}return _0x2f9e26[_0x30b1('0x25')];};};Realtime[_0x30b1('0x42')]['initDynamics365Accounts']=function(){var _0x57f668=this;return function(_0x1a7695){if(_0x1a7695){freeIsNotKey(_0x1a7695,_0x57f668['dynamics365Accounts'],'id');for(var _0x331438=0x0,_0x53b497={},_0x290322={};_0x331438<_0x1a7695[_0x30b1('0x49')];_0x331438+=0x1){_0x53b497=_0x1a7695[_0x331438];if(_[_0x30b1('0x47')](_0x57f668[_0x30b1('0x53')][_0x53b497['id']])){_0x57f668[_0x30b1('0x53')][_0x53b497['id']]=new Dynamics365Account(_0x53b497);}else{_0x57f668['mergeFromDatabase'](_0x57f668[_0x30b1('0x53')][_0x53b497['id']],_0x53b497);}}}return _0x57f668[_0x30b1('0x53')];};};Realtime['prototype'][_0x30b1('0x54')]=function(){var _0x191a2a=this;return function(_0x41f685){for(var _0x4617db=0x0;_0x4617db<_0x41f685[_0x30b1('0x49')];_0x4617db+=0x1){_[_0x30b1('0x55')](_0x191a2a[_0x30b1('0x17')][_0x41f685[_0x4617db]['name']],_0x41f685[_0x4617db]);}return _0x191a2a['voiceQueues'];};};Realtime[_0x30b1('0x42')]['initVoiceQueueReports']=function(){var _0x54df3f=this;return function(_0x2052d3){clearVoiceQueues(_0x54df3f[_0x30b1('0x17')]);if(_0x2052d3){_0x2052d3=_[_0x30b1('0x56')](_0x2052d3,_0x30b1('0x57'));for(var _0x172e53 in _0x2052d3){if(_0x2052d3[_0x30b1('0x28')](_0x172e53)){var _0xdb01bb={};for(var _0x483d84=0x0;_0x483d84<_0x2052d3[_0x172e53][_0x30b1('0x49')];_0x483d84+=0x1){var _0x4b71c0=_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x58')];if(_0x54df3f[_0x30b1('0x17')][_0x4b71c0]){if(_0x2052d3[_0x172e53][_0x483d84]['queuecallerexit']){_0x54df3f[_0x30b1('0x17')][_0x4b71c0][_0x30b1('0x59')]+=0x1;}if(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5a')]){_0x54df3f[_0x30b1('0x17')][_0x4b71c0]['abandoned']+=0x1;}_0x54df3f[_0x30b1('0x17')][_0x4b71c0][_0x30b1('0x30')]+=moment(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5b')])[_0x30b1('0x5c')](moment(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5d')]),'seconds')||0x0;if(_0x483d84===_0x2052d3[_0x172e53]['length']-0x1){_0x54df3f['voiceQueues'][_0x4b71c0][_0x30b1('0x31')]+=moment(_0x2052d3[_0x172e53][_0x483d84]['queuecallercompleteAt']||_0x2052d3[_0x172e53][_0x483d84]['queuecallerabandonAt']||_0x2052d3[_0x172e53][_0x483d84]['queuecallerexitAt'])[_0x30b1('0x5c')](moment(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5d')]),_0x30b1('0x5e'))||0x0;_0x54df3f[_0x30b1('0x17')][_0x4b71c0][_0x30b1('0x2e')]+=0x1;if(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5f')]){_0x54df3f[_0x30b1('0x17')][_0x4b71c0][_0x30b1('0x2f')]+=0x1;_0x54df3f[_0x30b1('0x17')][_0x4b71c0][_0x30b1('0x32')]+=moment(_0x2052d3[_0x172e53][_0x483d84]['queuecallercompleteAt'])[_0x30b1('0x5c')](moment(_0x2052d3[_0x172e53][_0x483d84][_0x30b1('0x5b')]),'seconds')||0x0;}}else{_0x54df3f[_0x30b1('0x17')][_0x4b71c0]['sumDuration']+=_0x54df3f['voiceQueues'][_0x4b71c0]['sumHoldTime']||0x0;}}}}}}return _0x54df3f[_0x30b1('0x17')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x60')]=function(){var _0x53d1c8=this;return function(_0x221864){clearVoiceCallReports(_0x53d1c8[_0x30b1('0x19')]);if(_0x221864){for(var _0x3da990=0x0;_0x3da990<_0x221864[_0x30b1('0x49')];_0x3da990+=0x1){_0x53d1c8[_0x30b1('0x19')][_0x30b1('0x2e')]+=0x1;_0x53d1c8[_0x30b1('0x19')][_0x30b1('0x31')]+=_0x221864[_0x3da990][_0x30b1('0x61')];if(_0x221864[_0x3da990][_0x30b1('0x62')]===_0x30b1('0x63')){_0x53d1c8['outbound'][_0x30b1('0x2f')]+=0x1;_0x53d1c8['outbound']['sumHoldTime']+=_0x221864[_0x3da990][_0x30b1('0x61')]-_0x221864[_0x3da990][_0x30b1('0x64')]||0x0;_0x53d1c8[_0x30b1('0x19')]['sumBillable']+=_0x221864[_0x3da990][_0x30b1('0x64')];}}}return _0x53d1c8[_0x30b1('0x19')];};};Realtime['prototype']['initCampaigns']=function(){var _0x550c77=this;return function(_0x3de0e8){if(_0x3de0e8){freeIsNotKey(_0x3de0e8,_0x550c77[_0x30b1('0x65')],_0x30b1('0x2c'));for(var _0x321d74=0x0,_0x50e0c4={};_0x321d74<_0x3de0e8[_0x30b1('0x49')];_0x321d74+=0x1){_0x50e0c4=_0x3de0e8[_0x321d74];if(_[_0x30b1('0x47')](_0x550c77['campaigns'][_0x50e0c4[_0x30b1('0x2c')]])){_0x550c77['campaigns'][_0x50e0c4[_0x30b1('0x2c')]]=new Campaign(_0x50e0c4);}else{_0x550c77[_0x30b1('0x43')](_0x550c77[_0x30b1('0x65')][_0x50e0c4[_0x30b1('0x2c')]],_0x50e0c4);}}}return _0x550c77[_0x30b1('0x65')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x115b7f=this;return function(_0xcda689){if(_0xcda689){freeIsNotKey(_0xcda689,_0x115b7f[_0x30b1('0x1a')],'id');for(var _0x5d9d42=0x0,_0xd468f0={};_0x5d9d42<_0xcda689[_0x30b1('0x49')];_0x5d9d42+=0x1){_0xd468f0=_0xcda689[_0x5d9d42];if(_[_0x30b1('0x47')](_0x115b7f[_0x30b1('0x1a')][_0xd468f0['id']])){_0x115b7f[_0x30b1('0x1a')][_0xd468f0['id']]=new VoiceExtension(_0xd468f0);}else{_0x115b7f['mergeFromDatabase'](_0x115b7f[_0x30b1('0x1a')][_0xd468f0['id']],_0xd468f0);}}}return _0x115b7f[_0x30b1('0x1a')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x66')]=function(){var _0x4aec1f=this;return function(_0x347949){clearCampaigns(_0x4aec1f[_0x30b1('0x65')]);for(var _0x2a6b09=0x0;_0x2a6b09<_0x347949[_0x30b1('0x49')];_0x2a6b09+=0x1){_[_0x30b1('0x55')](_0x4aec1f[_0x30b1('0x65')][_0x347949[_0x2a6b09][_0x30b1('0x2c')]],_0x347949[_0x2a6b09]);}return _0x4aec1f[_0x30b1('0x65')];};};Realtime[_0x30b1('0x42')][_0x30b1('0x67')]=function(){var _0x1d116d=this;return function(_0x31ceb0){if(_0x31ceb0){freeIsNotKey(_0x31ceb0,_0x1d116d[_0x30b1('0x26')],'id');for(var _0x19548d=0x0,_0x519fc2={},_0x523bc5={};_0x19548d<_0x31ceb0[_0x30b1('0x49')];_0x19548d+=0x1){_0x519fc2=_0x31ceb0[_0x19548d];if(_[_0x30b1('0x47')](_0x1d116d[_0x30b1('0x26')][_0x519fc2['id']])){_0x1d116d[_0x30b1('0x26')][_0x519fc2['id']]=new FaxAccount(_0x519fc2);}else{_0x1d116d['mergeFromDatabase'](_0x1d116d[_0x30b1('0x26')][_0x519fc2['id']],_0x519fc2);}}}return _0x1d116d[_0x30b1('0x26')];};};module[_0x30b1('0x68')]=Realtime; \ No newline at end of file +var _0xd5b6=['queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','isNil','interface','format','name','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt'];(function(_0x3ef375,_0x210a57){var _0x1e1b3f=function(_0x41e59e){while(--_0x41e59e){_0x3ef375['push'](_0x3ef375['shift']());}};_0x1e1b3f(++_0x210a57);}(_0xd5b6,0x73));var _0x6d5b=function(_0x7ea6ca,_0x29c9f5){_0x7ea6ca=_0x7ea6ca-0x0;var _0x1863ad=_0xd5b6[_0x7ea6ca];return _0x1863ad;};'use strict';var BPromise=require(_0x6d5b('0x0'));var util=require(_0x6d5b('0x1'));var _=require(_0x6d5b('0x2'));var moment=require(_0x6d5b('0x3'));var Agent=require(_0x6d5b('0x4'));var Telephone=require(_0x6d5b('0x5'));var Trunk=require(_0x6d5b('0x6'));var VoiceQueue=require(_0x6d5b('0x7'));var Trigger=require('../model/trigger');var Template=require(_0x6d5b('0x8'));var Campaign=require(_0x6d5b('0x9'));var VoiceExtension=require(_0x6d5b('0xa'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x6d5b('0xb'));var FreshdeskAccount=require(_0x6d5b('0xc'));var SugarcrmAccount=require(_0x6d5b('0xd'));var ZohoAccount=require(_0x6d5b('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x6d5b('0xf'));var Dynamics365Account=require(_0x6d5b('0x10'));var FaxAccount=require(_0x6d5b('0x11'));var Realtime=function(){this[_0x6d5b('0x12')]={};this[_0x6d5b('0x13')]={};this[_0x6d5b('0x14')]={};this[_0x6d5b('0x15')]={};this[_0x6d5b('0x16')]={};this[_0x6d5b('0x17')]={};this[_0x6d5b('0x18')]={};this[_0x6d5b('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6d5b('0x1a')]={};this[_0x6d5b('0x1b')]={};this[_0x6d5b('0x1c')]={};this[_0x6d5b('0x1d')]={};this[_0x6d5b('0x1e')]={};this[_0x6d5b('0x1f')]={};this[_0x6d5b('0x20')]={};this['sugarcrmAccounts']={};this[_0x6d5b('0x21')]={};this[_0x6d5b('0x22')]={};this[_0x6d5b('0x23')]={};this[_0x6d5b('0x24')]={};this[_0x6d5b('0x25')]={};this['dynamics365Accounts']={};this[_0x6d5b('0x26')]={};};function freeIsNotKey(_0x1e6814,_0x51eb25,_0x2baf47){var _0x5debab=_[_0x6d5b('0x27')](_0x1e6814,function(_0x4dfd99,_0x52350c){return _0x4dfd99[_0x2baf47];});for(var _0x49def6 in _0x51eb25){if(_0x51eb25[_0x6d5b('0x28')](_0x49def6)){if(!_0x5debab[_0x49def6]){delete _0x51eb25[_0x49def6];}}}}function freeIsNotKeySip(_0x1ee9a3,_0x448cc3){var _0x5e1642=_[_0x6d5b('0x27')](_0x1ee9a3,function(_0x25f8cc,_0x36359b){return util['format'](_0x6d5b('0x29'),_0x25f8cc['name']);});for(var _0x40348a in _0x448cc3){if(_0x448cc3[_0x6d5b('0x28')](_0x40348a)){if(!_0x5e1642[_0x40348a]){delete _0x448cc3[_0x40348a];}}}}function freeIsNotKeyAgent(_0x26b175,_0x4b67ca){var _0x885c41=_[_0x6d5b('0x27')](_0x26b175,function(_0xf59341,_0x18f8bb){var _0x672e5b=_[_0x6d5b('0x2a')](_0xf59341[_0x6d5b('0x2b')])?util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xf59341[_0x6d5b('0x2d')]):_0xf59341[_0x6d5b('0x2b')];return _0x672e5b;});for(var _0xc1087e in _0x4b67ca){if(_0x4b67ca[_0x6d5b('0x28')](_0xc1087e)){if(!_0x885c41[_0xc1087e]){delete _0x4b67ca[_0xc1087e];}}}}function clearVoiceCallReports(_0xc0d36c){_0xc0d36c['total']=0x0;_0xc0d36c[_0x6d5b('0x2e')]=0x0;_0xc0d36c['sumHoldTime']=0x0;_0xc0d36c[_0x6d5b('0x2f')]=0x0;_0xc0d36c[_0x6d5b('0x30')]=0x0;}function clearCampaigns(_0x322c57){if(!_[_0x6d5b('0x31')](_0x322c57)){for(var _0x408ee8 in _0x322c57){if(_0x322c57[_0x6d5b('0x28')](_0x408ee8)){_0x322c57[_0x408ee8][_0x6d5b('0x32')]=0x0;_0x322c57[_0x408ee8][_0x6d5b('0x33')]=0x0;}}}}function clearVoiceQueues(_0x1fac80){if(!_[_0x6d5b('0x31')](_0x1fac80)){for(var _0x158584 in _0x1fac80){if(_0x1fac80[_0x6d5b('0x28')](_0x158584)){_0x1fac80[_0x158584][_0x6d5b('0x34')]=0x0;_0x1fac80[_0x158584]['answered']=0x0;_0x1fac80[_0x158584]['unmanaged']=0x0;_0x1fac80[_0x158584]['abandoned']=0x0;_0x1fac80[_0x158584][_0x6d5b('0x35')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x2f')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x30')]=0x0;_0x1fac80[_0x158584]['outboundAnswerAgiCallsDay']=0x0;_0x1fac80[_0x158584][_0x6d5b('0x36')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x37')]=0x0;_0x1fac80[_0x158584]['outboundCongestionCallsDay']=0x0;_0x1fac80[_0x158584]['outboundNoSuchCallsDay']=0x0;_0x1fac80[_0x158584][_0x6d5b('0x38')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x39')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x3a')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x3b')]=0x0;_0x1fac80[_0x158584][_0x6d5b('0x3c')]=0x0;_0x1fac80[_0x158584]['outboundRejectCallsDay']=0x0;_0x1fac80[_0x158584]['outboundReCallsDay']=0x0;_0x1fac80[_0x158584][_0x6d5b('0x3d')]=0x0;_0x1fac80[_0x158584]['outboundAnswerCallsDay']=0x0;_0x1fac80[_0x158584][_0x6d5b('0x3e')]=!![];}}}}Realtime[_0x6d5b('0x3f')][_0x6d5b('0x40')]=function(_0x2185b4,_0x1d0797){for(var _0x44bbba in _0x1d0797){if(_0x2185b4[_0x6d5b('0x28')](_0x44bbba)){_0x2185b4[_0x44bbba]=_0x1d0797[_0x44bbba];}}};Realtime[_0x6d5b('0x3f')]['initAgents']=function(){var _0x2cea5e=this;return function(_0x34e5ed){if(_0x34e5ed){freeIsNotKeyAgent(_0x34e5ed,_0x2cea5e[_0x6d5b('0x12')]);for(var _0x1a0756=0x0,_0x381704={},_0x35bc80={};_0x1a0756<_0x34e5ed[_0x6d5b('0x41')];_0x1a0756+=0x1){_0x381704=_0x34e5ed[_0x1a0756];var _0x5f671c=_['isNil'](_0x381704[_0x6d5b('0x2b')])?util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0x381704[_0x6d5b('0x2d')]):_0x381704[_0x6d5b('0x2b')];if(_[_0x6d5b('0x42')](_0x2cea5e['agents'][_0x5f671c])){_0x2cea5e['agents'][_0x5f671c]=new Agent(_0x381704);}else{_0x2cea5e[_0x6d5b('0x40')](_0x2cea5e[_0x6d5b('0x12')][_0x5f671c],_0x381704);}}}return _0x2cea5e[_0x6d5b('0x12')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x43')]=function(){var _0xf1abf4=this;return function(_0x10c50d){if(_0x10c50d){freeIsNotKeySip(_0x10c50d,_0xf1abf4[_0x6d5b('0x13')]);for(var _0x2698cb=0x0,_0xfdc8a7={},_0x5c7753={};_0x2698cb<_0x10c50d['length'];_0x2698cb+=0x1){_0xfdc8a7=_0x10c50d[_0x2698cb];if(_['isUndefined'](_0xf1abf4[_0x6d5b('0x13')][util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xfdc8a7[_0x6d5b('0x2d')])])){_0xf1abf4['telephones'][util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xfdc8a7[_0x6d5b('0x2d')])]=new Telephone(_0xfdc8a7);}else{_0xf1abf4[_0x6d5b('0x40')](_0xf1abf4[_0x6d5b('0x13')][util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xfdc8a7[_0x6d5b('0x2d')])],_0xfdc8a7);}}}return _0xf1abf4[_0x6d5b('0x13')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x44')]=function(){var _0x150bce=this;return function(_0x192d14){if(_0x192d14){freeIsNotKeySip(_0x192d14,_0x150bce['trunks']);for(var _0x5ae3e4=0x0,_0xe33341={},_0x2075c8={};_0x5ae3e4<_0x192d14[_0x6d5b('0x41')];_0x5ae3e4+=0x1){_0xe33341=_0x192d14[_0x5ae3e4];if(_[_0x6d5b('0x42')](_0x150bce[_0x6d5b('0x14')][util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xe33341[_0x6d5b('0x2d')])])){_0x150bce[_0x6d5b('0x14')][util['format'](_0x6d5b('0x29'),_0xe33341['name'])]=new Trunk(_0xe33341);}else{_0x150bce[_0x6d5b('0x40')](_0x150bce['trunks'][util[_0x6d5b('0x2c')](_0x6d5b('0x29'),_0xe33341[_0x6d5b('0x2d')])],_0xe33341);}}}return _0x150bce['trunks'];};};Realtime['prototype'][_0x6d5b('0x45')]=function(){var _0x5e8ab2=this;return function(_0x5784af){if(_0x5784af){freeIsNotKey(_0x5784af,_0x5e8ab2[_0x6d5b('0x15')],_0x6d5b('0x2d'));for(var _0x5b06d7=0x0,_0xc3b559={},_0x530765={};_0x5b06d7<_0x5784af[_0x6d5b('0x41')];_0x5b06d7+=0x1){_0xc3b559=_0x5784af[_0x5b06d7];if(_[_0x6d5b('0x42')](_0x5e8ab2[_0x6d5b('0x15')][_0xc3b559['name']])){_0x5e8ab2['voiceQueues'][_0xc3b559['name']]=new VoiceQueue(_0xc3b559);}else{_0x5e8ab2['mergeFromDatabase'](_0x5e8ab2['voiceQueues'][_0xc3b559[_0x6d5b('0x2d')]],_0xc3b559);}}}return _0x5e8ab2[_0x6d5b('0x15')];};};Realtime['prototype'][_0x6d5b('0x46')]=function(){var _0x325ba3=this;return function(_0x3c8864){if(_0x3c8864){freeIsNotKey(_0x3c8864,_0x325ba3[_0x6d5b('0x16')],'id');for(var _0x15322e=0x0,_0x29d3a4={},_0x22bd2f={};_0x15322e<_0x3c8864[_0x6d5b('0x41')];_0x15322e+=0x1){_0x29d3a4=_0x3c8864[_0x15322e];if(_[_0x6d5b('0x42')](_0x325ba3['triggers'][_0x29d3a4['id']])){_0x325ba3[_0x6d5b('0x16')][_0x29d3a4['id']]=new Trigger(_0x29d3a4);}else{_0x325ba3[_0x6d5b('0x40')](_0x325ba3[_0x6d5b('0x16')][_0x29d3a4['id']],_0x29d3a4);}}}return _0x325ba3[_0x6d5b('0x16')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x47')]=function(){var _0x70234a=this;return function(_0x1b543f){if(_0x1b543f){freeIsNotKey(_0x1b543f,_0x70234a[_0x6d5b('0x18')],'id');for(var _0x3dd4fc=0x0,_0x3f5bc4={},_0x58e4cc={};_0x3dd4fc<_0x1b543f['length'];_0x3dd4fc+=0x1){_0x3f5bc4=_0x1b543f[_0x3dd4fc];if(_[_0x6d5b('0x42')](_0x70234a[_0x6d5b('0x18')][_0x3f5bc4['id']])){_0x70234a[_0x6d5b('0x18')][_0x3f5bc4['id']]=new Template(_0x3f5bc4);}else{_0x70234a[_0x6d5b('0x40')](_0x70234a[_0x6d5b('0x18')][_0x3f5bc4['id']],_0x3f5bc4);}}}return _0x70234a[_0x6d5b('0x18')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x48')]=function(){var _0x2a5fb3=this;return function(_0x36569a){if(_0x36569a){freeIsNotKey(_0x36569a,_0x2a5fb3[_0x6d5b('0x1f')],'id');for(var _0x2c3ef9=0x0,_0x5720f3={},_0x38efa8={};_0x2c3ef9<_0x36569a[_0x6d5b('0x41')];_0x2c3ef9+=0x1){_0x5720f3=_0x36569a[_0x2c3ef9];if(_['isUndefined'](_0x2a5fb3[_0x6d5b('0x1f')][_0x5720f3['id']])){_0x2a5fb3['zendeskAccounts'][_0x5720f3['id']]=new ZendeskAccount(_0x5720f3);}else{_0x2a5fb3[_0x6d5b('0x40')](_0x2a5fb3['zendeskAccounts'][_0x5720f3['id']],_0x5720f3);}}}return _0x2a5fb3[_0x6d5b('0x1f')];};};Realtime[_0x6d5b('0x3f')]['initSalesforceAccounts']=function(){var _0x29544f=this;return function(_0x4b1a3f){if(_0x4b1a3f){freeIsNotKey(_0x4b1a3f,_0x29544f[_0x6d5b('0x20')],'id');for(var _0x4643df=0x0,_0x2e4485={},_0x1042ff={};_0x4643df<_0x4b1a3f[_0x6d5b('0x41')];_0x4643df+=0x1){_0x2e4485=_0x4b1a3f[_0x4643df];if(_['isUndefined'](_0x29544f[_0x6d5b('0x20')][_0x2e4485['id']])){_0x29544f[_0x6d5b('0x20')][_0x2e4485['id']]=new SalesforceAccount(_0x2e4485);}else{_0x29544f[_0x6d5b('0x40')](_0x29544f[_0x6d5b('0x20')][_0x2e4485['id']],_0x2e4485);}}}return _0x29544f[_0x6d5b('0x20')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x49')]=function(){var _0x189e1f=this;return function(_0x3cba51){if(_0x3cba51){freeIsNotKey(_0x3cba51,_0x189e1f['freshdeskAccounts'],'id');for(var _0x37111d=0x0,_0x33ffe2={},_0x7e4027={};_0x37111d<_0x3cba51['length'];_0x37111d+=0x1){_0x33ffe2=_0x3cba51[_0x37111d];if(_['isUndefined'](_0x189e1f[_0x6d5b('0x21')][_0x33ffe2['id']])){_0x189e1f[_0x6d5b('0x21')][_0x33ffe2['id']]=new FreshdeskAccount(_0x33ffe2);}else{_0x189e1f[_0x6d5b('0x40')](_0x189e1f[_0x6d5b('0x21')][_0x33ffe2['id']],_0x33ffe2);}}}return _0x189e1f['freshdeskAccounts'];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x549fc3=this;return function(_0x22aa09){if(_0x22aa09){freeIsNotKey(_0x22aa09,_0x549fc3[_0x6d5b('0x22')],'id');for(var _0x18228c=0x0,_0x7a95da={},_0x4c409a={};_0x18228c<_0x22aa09[_0x6d5b('0x41')];_0x18228c+=0x1){_0x7a95da=_0x22aa09[_0x18228c];if(_[_0x6d5b('0x42')](_0x549fc3[_0x6d5b('0x22')][_0x7a95da['id']])){_0x549fc3['zohoAccounts'][_0x7a95da['id']]=new ZohoAccount(_0x7a95da);}else{_0x549fc3['mergeFromDatabase'](_0x549fc3[_0x6d5b('0x22')][_0x7a95da['id']],_0x7a95da);}}}return _0x549fc3[_0x6d5b('0x22')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x4a')]=function(){var _0x3e22be=this;return function(_0x53ee51){if(_0x53ee51){freeIsNotKey(_0x53ee51,_0x3e22be[_0x6d5b('0x23')],'id');for(var _0x3f621c=0x0,_0x325dd4={},_0x29ed2c={};_0x3f621c<_0x53ee51[_0x6d5b('0x41')];_0x3f621c+=0x1){_0x325dd4=_0x53ee51[_0x3f621c];if(_['isUndefined'](_0x3e22be[_0x6d5b('0x23')][_0x325dd4['id']])){_0x3e22be['deskAccounts'][_0x325dd4['id']]=new DeskAccount(_0x325dd4);}else{_0x3e22be[_0x6d5b('0x40')](_0x3e22be['deskAccounts'][_0x325dd4['id']],_0x325dd4);}}}return _0x3e22be[_0x6d5b('0x23')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x4b')]=function(){var _0x5c89f7=this;return function(_0x2d9c42){if(_0x2d9c42){freeIsNotKey(_0x2d9c42,_0x5c89f7['sugarcrmAccounts'],'id');for(var _0x20aa2e=0x0,_0xa437c5={},_0x4e3263={};_0x20aa2e<_0x2d9c42[_0x6d5b('0x41')];_0x20aa2e+=0x1){_0xa437c5=_0x2d9c42[_0x20aa2e];if(_['isUndefined'](_0x5c89f7['sugarcrmAccounts'][_0xa437c5['id']])){_0x5c89f7[_0x6d5b('0x4c')][_0xa437c5['id']]=new SugarcrmAccount(_0xa437c5);}else{_0x5c89f7['mergeFromDatabase'](_0x5c89f7[_0x6d5b('0x4c')][_0xa437c5['id']],_0xa437c5);}}}return _0x5c89f7[_0x6d5b('0x4c')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x4d')]=function(){var _0x5ba73d=this;return function(_0x85c54){if(_0x85c54){freeIsNotKey(_0x85c54,_0x5ba73d[_0x6d5b('0x24')],'id');for(var _0x1c9b72=0x0,_0x544f86={},_0x35e004={};_0x1c9b72<_0x85c54[_0x6d5b('0x41')];_0x1c9b72+=0x1){_0x544f86=_0x85c54[_0x1c9b72];if(_['isUndefined'](_0x5ba73d['vtigerAccounts'][_0x544f86['id']])){_0x5ba73d[_0x6d5b('0x24')][_0x544f86['id']]=new VtigerAccount(_0x544f86);}else{_0x5ba73d['mergeFromDatabase'](_0x5ba73d[_0x6d5b('0x24')][_0x544f86['id']],_0x544f86);}}}return _0x5ba73d[_0x6d5b('0x24')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x4e')]=function(){var _0xab0021=this;return function(_0x4629ed){if(_0x4629ed){freeIsNotKey(_0x4629ed,_0xab0021[_0x6d5b('0x25')],'id');for(var _0x5c2bc9=0x0,_0xf659c8={},_0x2eb35a={};_0x5c2bc9<_0x4629ed[_0x6d5b('0x41')];_0x5c2bc9+=0x1){_0xf659c8=_0x4629ed[_0x5c2bc9];if(_['isUndefined'](_0xab0021['servicenowAccounts'][_0xf659c8['id']])){_0xab0021['servicenowAccounts'][_0xf659c8['id']]=new ServicenowAccount(_0xf659c8);}else{_0xab0021[_0x6d5b('0x40')](_0xab0021[_0x6d5b('0x25')][_0xf659c8['id']],_0xf659c8);}}}return _0xab0021[_0x6d5b('0x25')];};};Realtime[_0x6d5b('0x3f')]['initDynamics365Accounts']=function(){var _0x632c8d=this;return function(_0x2ed47c){if(_0x2ed47c){freeIsNotKey(_0x2ed47c,_0x632c8d['dynamics365Accounts'],'id');for(var _0x2a22aa=0x0,_0x518e56={},_0xfc32cb={};_0x2a22aa<_0x2ed47c[_0x6d5b('0x41')];_0x2a22aa+=0x1){_0x518e56=_0x2ed47c[_0x2a22aa];if(_['isUndefined'](_0x632c8d[_0x6d5b('0x4f')][_0x518e56['id']])){_0x632c8d[_0x6d5b('0x4f')][_0x518e56['id']]=new Dynamics365Account(_0x518e56);}else{_0x632c8d[_0x6d5b('0x40')](_0x632c8d[_0x6d5b('0x4f')][_0x518e56['id']],_0x518e56);}}}return _0x632c8d[_0x6d5b('0x4f')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x50')]=function(){var _0x4b5b1e=this;return function(_0x43f7c4){for(var _0xade321=0x0;_0xade321<_0x43f7c4[_0x6d5b('0x41')];_0xade321+=0x1){_['merge'](_0x4b5b1e[_0x6d5b('0x15')][_0x43f7c4[_0xade321][_0x6d5b('0x2d')]],_0x43f7c4[_0xade321]);}return _0x4b5b1e[_0x6d5b('0x15')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x51')]=function(){var _0x5630aa=this;return function(_0x8d8f7e){clearVoiceQueues(_0x5630aa[_0x6d5b('0x15')]);if(_0x8d8f7e){_0x8d8f7e=_['groupBy'](_0x8d8f7e,_0x6d5b('0x52'));for(var _0x316a6e in _0x8d8f7e){if(_0x8d8f7e[_0x6d5b('0x28')](_0x316a6e)){var _0x5b0121={};for(var _0x39b75b=0x0;_0x39b75b<_0x8d8f7e[_0x316a6e][_0x6d5b('0x41')];_0x39b75b+=0x1){var _0x320973=_0x8d8f7e[_0x316a6e][_0x39b75b]['queue'];if(_0x5630aa[_0x6d5b('0x15')][_0x320973]){if(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x53')]){_0x5630aa[_0x6d5b('0x15')][_0x320973][_0x6d5b('0x54')]+=0x1;}if(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x55')]){_0x5630aa[_0x6d5b('0x15')][_0x320973][_0x6d5b('0x56')]+=0x1;}_0x5630aa['voiceQueues'][_0x320973][_0x6d5b('0x35')]+=moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x57')])[_0x6d5b('0x58')](moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x59')]),_0x6d5b('0x5a'))||0x0;if(_0x39b75b===_0x8d8f7e[_0x316a6e][_0x6d5b('0x41')]-0x1){_0x5630aa['voiceQueues'][_0x320973]['sumDuration']+=moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x5b')]||_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x5c')]||_0x8d8f7e[_0x316a6e][_0x39b75b]['queuecallerexitAt'])[_0x6d5b('0x58')](moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x59')]),_0x6d5b('0x5a'))||0x0;_0x5630aa[_0x6d5b('0x15')][_0x320973]['total']+=0x1;if(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x5d')]){_0x5630aa[_0x6d5b('0x15')][_0x320973][_0x6d5b('0x2e')]+=0x1;_0x5630aa[_0x6d5b('0x15')][_0x320973]['sumBillable']+=moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x5b')])['diff'](moment(_0x8d8f7e[_0x316a6e][_0x39b75b][_0x6d5b('0x57')]),'seconds')||0x0;}}else{_0x5630aa[_0x6d5b('0x15')][_0x320973][_0x6d5b('0x2f')]+=_0x5630aa[_0x6d5b('0x15')][_0x320973][_0x6d5b('0x35')]||0x0;}}}}}}return _0x5630aa[_0x6d5b('0x15')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x5e')]=function(){var _0x5d9da7=this;return function(_0x4fcad3){clearVoiceCallReports(_0x5d9da7['outbound']);if(_0x4fcad3){for(var _0x353017=0x0;_0x353017<_0x4fcad3[_0x6d5b('0x41')];_0x353017+=0x1){_0x5d9da7[_0x6d5b('0x19')]['total']+=0x1;_0x5d9da7['outbound']['sumDuration']+=_0x4fcad3[_0x353017][_0x6d5b('0x5f')];if(_0x4fcad3[_0x353017][_0x6d5b('0x60')]===_0x6d5b('0x61')){_0x5d9da7[_0x6d5b('0x19')]['answered']+=0x1;_0x5d9da7['outbound'][_0x6d5b('0x35')]+=_0x4fcad3[_0x353017][_0x6d5b('0x5f')]-_0x4fcad3[_0x353017][_0x6d5b('0x62')]||0x0;_0x5d9da7['outbound'][_0x6d5b('0x30')]+=_0x4fcad3[_0x353017][_0x6d5b('0x62')];}}}return _0x5d9da7[_0x6d5b('0x19')];};};Realtime['prototype'][_0x6d5b('0x63')]=function(){var _0x2cc13d=this;return function(_0x210bb5){if(_0x210bb5){freeIsNotKey(_0x210bb5,_0x2cc13d[_0x6d5b('0x17')],_0x6d5b('0x2d'));for(var _0x24da3a=0x0,_0x4d3990={};_0x24da3a<_0x210bb5[_0x6d5b('0x41')];_0x24da3a+=0x1){_0x4d3990=_0x210bb5[_0x24da3a];if(_[_0x6d5b('0x42')](_0x2cc13d[_0x6d5b('0x17')][_0x4d3990[_0x6d5b('0x2d')]])){_0x2cc13d[_0x6d5b('0x17')][_0x4d3990[_0x6d5b('0x2d')]]=new Campaign(_0x4d3990);}else{_0x2cc13d[_0x6d5b('0x40')](_0x2cc13d[_0x6d5b('0x17')][_0x4d3990[_0x6d5b('0x2d')]],_0x4d3990);}}}return _0x2cc13d[_0x6d5b('0x17')];};};Realtime['prototype'][_0x6d5b('0x64')]=function(){var _0x53bfb6=this;return function(_0x5c3198){if(_0x5c3198){freeIsNotKey(_0x5c3198,_0x53bfb6[_0x6d5b('0x1a')],'id');for(var _0x3be51c=0x0,_0x13f7fd={};_0x3be51c<_0x5c3198[_0x6d5b('0x41')];_0x3be51c+=0x1){_0x13f7fd=_0x5c3198[_0x3be51c];if(_[_0x6d5b('0x42')](_0x53bfb6['voiceExtensions'][_0x13f7fd['id']])){_0x53bfb6[_0x6d5b('0x1a')][_0x13f7fd['id']]=new VoiceExtension(_0x13f7fd);}else{_0x53bfb6[_0x6d5b('0x40')](_0x53bfb6[_0x6d5b('0x1a')][_0x13f7fd['id']],_0x13f7fd);}}}return _0x53bfb6[_0x6d5b('0x1a')];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x65')]=function(){var _0x288fe4=this;return function(_0x128081){clearCampaigns(_0x288fe4[_0x6d5b('0x17')]);for(var _0x4e804c=0x0;_0x4e804c<_0x128081['length'];_0x4e804c+=0x1){_['merge'](_0x288fe4[_0x6d5b('0x17')][_0x128081[_0x4e804c][_0x6d5b('0x2d')]],_0x128081[_0x4e804c]);}return _0x288fe4['campaigns'];};};Realtime[_0x6d5b('0x3f')][_0x6d5b('0x66')]=function(){var _0x19eb99=this;return function(_0x3dcd81){if(_0x3dcd81){freeIsNotKey(_0x3dcd81,_0x19eb99['faxAccounts'],'id');for(var _0x6cc3cb=0x0,_0xf71189={},_0x27cc2d={};_0x6cc3cb<_0x3dcd81[_0x6d5b('0x41')];_0x6cc3cb+=0x1){_0xf71189=_0x3dcd81[_0x6cc3cb];if(_['isUndefined'](_0x19eb99[_0x6d5b('0x26')][_0xf71189['id']])){_0x19eb99[_0x6d5b('0x26')][_0xf71189['id']]=new FaxAccount(_0xf71189);}else{_0x19eb99['mergeFromDatabase'](_0x19eb99[_0x6d5b('0x26')][_0xf71189['id']],_0xf71189);}}}return _0x19eb99['faxAccounts'];};};module[_0x6d5b('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ce1a610..78422cd 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 _0xa20c=['lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','calleridpreview','calleridnum','ANSWERED','create','monitor','monitors','length','monitorFilename','filename','createdAt','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','isNil','find','name','interface','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','destination','exten','type'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa20c,0x72));var _0xca20=function(_0x1c4691,_0x158a43){_0x1c4691=_0x1c4691-0x0;var _0xc5f19f=_0xa20c[_0x1c4691];return _0xc5f19f;};'use strict';var BPromise=require(_0xca20('0x0'));var _=require(_0xca20('0x1'));var moment=require(_0xca20('0x2'));var util=require(_0xca20('0x3'));var config=require(_0xca20('0x4'));var logger=require(_0xca20('0x5'))('ami');var ami=require(_0xca20('0x6'));var RpcVoiceAgentReport=require(_0xca20('0x7'));var RpcVoiceCallReport=require(_0xca20('0x8'));var RpcVoiceDialReport=require(_0xca20('0x9'));var RpcMemberReport=require(_0xca20('0xa'));var RpcVoiceQueueReport=require(_0xca20('0xb'));var RpcVoiceRecording=require(_0xca20('0xc'));var RpcVoiceTransferReport=require(_0xca20('0xd'));var VoiceQueueReport=require(_0xca20('0xe'));var VoiceCallReport=require(_0xca20('0xf'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x406524){this[_0xca20('0x10')]=_0x406524;this['agents']=_0x406524[_0xca20('0x11')];this[_0xca20('0x12')]=_0x406524[_0xca20('0x12')];}Report[_0xca20('0x13')][_0xca20('0x14')]=function(_0xf39df1){var _0x534369=new VoiceQueueReport(this['realtime']);var _0x25870a=new VoiceAgentReport(this[_0xca20('0x10')]);var _0xc52cae=new VoiceDialReport(this[_0xca20('0x10')]);var _0x220e02=new VoiceCallReport(this[_0xca20('0x10')]);var _0x1dfbc5=new UserReport(this['realtime']);if(config['xdr']&&config[_0xca20('0x15')][_0xca20('0x16')]){ami['on']('custom:voiceQueueReport',this[_0xca20('0x17')][_0xca20('0x18')](this));ami['on'](_0xca20('0x19'),this[_0xca20('0x1a')][_0xca20('0x18')](this));ami['on'](_0xca20('0x1b'),this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this[_0xca20('0x1c')][_0xca20('0x18')](this));ami['on'](_0xca20('0x1d'),this[_0xca20('0x1e')][_0xca20('0x18')](this));ami['on'](_0xca20('0x1f'),this[_0xca20('0x20')]['bind'](this));}};Report[_0xca20('0x13')][_0xca20('0x21')]=function(_0x5c2449){var _0x32a8d8=undefined;_0x32a8d8=_['find'](this[_0xca20('0x11')],function(_0x4c8de9){return _0x4c8de9[_0xca20('0x22')]==_0x5c2449||_0x4c8de9['name']==_0x5c2449;});if(_[_0xca20('0x23')](_0x32a8d8)){var _0x714f7f=_[_0xca20('0x24')](this[_0xca20('0x12')],function(_0x31339b){return _0x31339b['accountcode']==_0x5c2449||_0x31339b[_0xca20('0x25')]==_0x5c2449;});if(_0x714f7f){_0x32a8d8=_[_0xca20('0x24')](this['agents'],function(_0x2c1aa4){return _0x2c1aa4[_0xca20('0x26')]==util[_0xca20('0x27')](_0xca20('0x28'),_0x714f7f[_0xca20('0x25')]);});}}return _0x32a8d8;};Report['prototype'][_0xca20('0x17')]=function(_0x5b4d4a){for(var _0x7dca08=0x0;_0x7dca08<_0x5b4d4a['length'];_0x7dca08+=0x1){var _0x3944=this['findAgent'](_0x5b4d4a[_0x7dca08][_0xca20('0x29')]);if(_0x3944){_0x5b4d4a[_0x7dca08]['accountcode']=_0x3944[_0xca20('0x22')];_0x5b4d4a[_0x7dca08][_0xca20('0x2a')]=!![];_0x5b4d4a[_0x7dca08][_0xca20('0x2b')]=_0x3944[_0xca20('0x25')];_0x5b4d4a[_0x7dca08][_0xca20('0x26')]=_['isNil'](_0x3944[_0xca20('0x26')])?util[_0xca20('0x27')]('SIP/%s',_0x3944[_0xca20('0x25')]):_0x3944['interface'];if(_0x5b4d4a[_0x7dca08][_0xca20('0x2c')]){_0x5b4d4a[_0x7dca08][_0xca20('0x2d')]=moment()[_0xca20('0x27')](_0xca20('0x2e'));}if(_0x5b4d4a[_0x7dca08]['queuecallerexit']){_0x5b4d4a[_0x7dca08]['queuecallerexitAt']=moment()[_0xca20('0x27')](_0xca20('0x2e'));}RpcMemberReport[_0xca20('0x17')](_0x5b4d4a[_0x7dca08]);}RpcVoiceQueueReport['create'](_0x5b4d4a[_0x7dca08]);}};function extractCalleridNumber(_0x20ca3f){var _0x256762=_0x20ca3f['match'](/<(.*?)>/);return _0x256762?_0x256762[0x1]:_0x20ca3f;}Report['prototype'][_0xca20('0x1a')]=function(_0x37783f){_0x37783f[_0xca20('0x2f')]=_0x37783f[_0xca20('0x2f')]||_0x37783f[_0xca20('0x30')];if(_0x37783f[_0xca20('0x31')]=='dialer'){_0x37783f[_0xca20('0x32')]=_0xca20('0x33');_0x37783f[_0xca20('0x34')]=_0x37783f[_0xca20('0x33')];if(_0x37783f[_0xca20('0x35')]==_0xca20('0x36')){_0x37783f['accountcode']='';_0x37783f[_0xca20('0x2f')]=extractCalleridNumber(_0x37783f[_0xca20('0x37')]);}else if(_0x37783f['context']==_0xca20('0x38')){if(_0x37783f[_0xca20('0x2f')]==_0xca20('0x39')){_0x37783f[_0xca20('0x2f')]=extractCalleridNumber(_0x37783f['calleridpreview']);_0x37783f['calleridnum']=_0x37783f[_0xca20('0x3a')];_0x37783f[_0xca20('0x3b')]=[_0x37783f[_0xca20('0x3c')],_0x37783f[_0xca20('0x3c')]=_0x37783f['destinationchannel']][0x0];_0x37783f[_0xca20('0x37')]=_0x37783f[_0xca20('0x3d')];}else{_0x37783f['destination']=_0x37783f['calleridnum'];_0x37783f[_0xca20('0x3e')]=_0x37783f[_0xca20('0x3a')];if(_0x37783f['disposition']==_0xca20('0x3f')){_0x37783f[_0xca20('0x22')]=_0x37783f[_0xca20('0x29')];}else{_0x37783f[_0xca20('0x22')]='';}}}}else{_0x37783f[_0xca20('0x37')]=util['format']('\x22%s\x22\x20<%s>',_0x37783f['calleridname'],_0x37783f[_0xca20('0x3e')]);}RpcVoiceCallReport[_0xca20('0x40')](_0x37783f);if(_0x37783f[_0xca20('0x41')]){for(var _0x9ac729=0x0;_0x9ac729<_0x37783f[_0xca20('0x42')][_0xca20('0x43')];_0x9ac729+=0x1){_0x37783f[_0xca20('0x44')]=_0x37783f[_0xca20('0x42')][_0x9ac729][_0xca20('0x45')];_0x37783f[_0xca20('0x46')]=_0x37783f['monitors'][_0x9ac729]['createdAt'];if(_0x37783f[_0xca20('0x30')]==_0xca20('0x39')){_0x37783f[_0xca20('0x3e')]=_0x37783f[_0xca20('0x29')];_0x37783f['calleridname']=_0x37783f['connectedlinename'];_0x37783f[_0xca20('0x29')]=_0x37783f['accountcode'];_0x37783f['connectedlinename']=_0x37783f[_0xca20('0x47')];_0x37783f[_0xca20('0x30')]=_0x37783f[_0xca20('0x3a')];}else if(_0x37783f[_0xca20('0x30')]==_0xca20('0x48')){_0x37783f[_0xca20('0x3e')]=_0x37783f[_0xca20('0x2f')];_0x37783f[_0xca20('0x30')]=_0x37783f[_0xca20('0x3a')];}RpcVoiceRecording[_0xca20('0x40')](_0x37783f);}}};Report[_0xca20('0x13')][_0xca20('0x49')]=function(_0x1f6b62){if(_[_0xca20('0x4a')](_0x1f6b62)){_0x1f6b62[_0xca20('0x4b')](function(_0x3a5960){RpcVoiceAgentReport[_0xca20('0x40')](_0x3a5960);});}else{RpcVoiceAgentReport[_0xca20('0x40')](_0x1f6b62);}};Report[_0xca20('0x13')][_0xca20('0x1c')]=function(_0x3e5a52){RpcVoiceDialReport[_0xca20('0x40')](_0x3e5a52);var _0x1baed6=undefined;var _0x56ec59=_0x3e5a52[_0xca20('0x3c')];if(_[_0xca20('0x4c')](_0x56ec59,'Local')){var _0xe71294=_0x56ec59[_0xca20('0x4d')](_0x56ec59[_0xca20('0x4e')]('/')+0x1,_0x56ec59['indexOf']('@'));_0x1baed6=_[_0xca20('0x24')](this[_0xca20('0x11')],function(_0x20e689){return _0x20e689[_0xca20('0x4f')]==_0xe71294||_0x20e689[_0xca20('0x50')]==_0xe71294||_0x20e689[_0xca20('0x22')]==_0xe71294;});}else{var _0xe71294=_0x56ec59[_0xca20('0x4d')](_0x56ec59[_0xca20('0x4e')]('/')+0x1,_0x56ec59[_0xca20('0x51')]('-'));_0x1baed6=this[_0xca20('0x21')](_0xe71294);}if(_0x1baed6){_0x3e5a52['interface']=_[_0xca20('0x23')](_0x1baed6[_0xca20('0x26')])?util['format']('SIP/%s',_0x1baed6[_0xca20('0x25')]):_0x1baed6[_0xca20('0x26')];_0x3e5a52[_0xca20('0x47')]=_0x1baed6['name'];_0x3e5a52[_0xca20('0x22')]=_0x1baed6[_0xca20('0x22')];RpcMemberReport[_0xca20('0x1c')](_0x3e5a52);}};Report[_0xca20('0x13')][_0xca20('0x1e')]=function(_0x2fd119){RpcVoiceTransferReport[_0xca20('0x1e')](_0x2fd119);};Report['prototype'][_0xca20('0x20')]=function(_0x45d9bc){RpcVoiceTransferReport[_0xca20('0x20')](_0x45d9bc);};module['exports']=Report; \ No newline at end of file +var _0x96e7=['calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','telephones','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','destination','callerid','from-sip','xcally-motion-preview'];(function(_0x13c7fa,_0x2e62e1){var _0x46b299=function(_0xeb9be4){while(--_0xeb9be4){_0x13c7fa['push'](_0x13c7fa['shift']());}};_0x46b299(++_0x2e62e1);}(_0x96e7,0x6f));var _0x796e=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x96e7[_0x34e752];return _0x7c6347;};'use strict';var BPromise=require(_0x796e('0x0'));var _=require('lodash');var moment=require(_0x796e('0x1'));var util=require(_0x796e('0x2'));var config=require('../../../config/environment');var logger=require(_0x796e('0x3'))(_0x796e('0x4'));var ami=require(_0x796e('0x5'));var RpcVoiceAgentReport=require(_0x796e('0x6'));var RpcVoiceCallReport=require(_0x796e('0x7'));var RpcVoiceDialReport=require(_0x796e('0x8'));var RpcMemberReport=require(_0x796e('0x9'));var RpcVoiceQueueReport=require(_0x796e('0xa'));var RpcVoiceRecording=require(_0x796e('0xb'));var RpcVoiceTransferReport=require(_0x796e('0xc'));var VoiceQueueReport=require(_0x796e('0xd'));var VoiceCallReport=require(_0x796e('0xe'));var VoiceAgentReport=require(_0x796e('0xf'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x2be7f7){this[_0x796e('0x10')]=_0x2be7f7;this[_0x796e('0x11')]=_0x2be7f7[_0x796e('0x11')];this['telephones']=_0x2be7f7['telephones'];}Report[_0x796e('0x12')][_0x796e('0x13')]=function(_0x2b5836){var _0x59089d=new VoiceQueueReport(this[_0x796e('0x10')]);var _0x388101=new VoiceAgentReport(this[_0x796e('0x10')]);var _0x231ab3=new VoiceDialReport(this['realtime']);var _0x502325=new VoiceCallReport(this[_0x796e('0x10')]);var _0x501ec6=new UserReport(this[_0x796e('0x10')]);if(config[_0x796e('0x14')]&&config[_0x796e('0x14')][_0x796e('0x15')]){ami['on'](_0x796e('0x16'),this[_0x796e('0x17')][_0x796e('0x18')](this));ami['on']('custom:voiceCallReport',this[_0x796e('0x19')][_0x796e('0x18')](this));ami['on']('custom:voiceAgentReport',this[_0x796e('0x1a')][_0x796e('0x18')](this));ami['on'](_0x796e('0x1b'),this[_0x796e('0x1c')][_0x796e('0x18')](this));ami['on']('blindtransfer',this[_0x796e('0x1d')][_0x796e('0x18')](this));ami['on']('attendedtransfer',this[_0x796e('0x1e')][_0x796e('0x18')](this));}};Report[_0x796e('0x12')][_0x796e('0x1f')]=function(_0x3937fe){var _0x61130c=undefined;_0x61130c=_[_0x796e('0x20')](this['agents'],function(_0x18c33d){return _0x18c33d[_0x796e('0x21')]==_0x3937fe||_0x18c33d[_0x796e('0x22')]==_0x3937fe;});if(_[_0x796e('0x23')](_0x61130c)){var _0x4054ea=_[_0x796e('0x20')](this[_0x796e('0x24')],function(_0x27035a){return _0x27035a[_0x796e('0x21')]==_0x3937fe||_0x27035a[_0x796e('0x22')]==_0x3937fe;});if(_0x4054ea){_0x61130c=_[_0x796e('0x20')](this[_0x796e('0x11')],function(_0x8b5c71){return _0x8b5c71['interface']==util['format'](_0x796e('0x25'),_0x4054ea[_0x796e('0x22')]);});}}return _0x61130c;};Report[_0x796e('0x12')][_0x796e('0x17')]=function(_0x4d95a7){for(var _0x281f9a=0x0;_0x281f9a<_0x4d95a7[_0x796e('0x26')];_0x281f9a+=0x1){var _0x46fe00=this[_0x796e('0x1f')](_0x4d95a7[_0x281f9a][_0x796e('0x27')]);if(_0x46fe00){_0x4d95a7[_0x281f9a][_0x796e('0x21')]=_0x46fe00[_0x796e('0x21')];_0x4d95a7[_0x281f9a][_0x796e('0x28')]=!![];_0x4d95a7[_0x281f9a][_0x796e('0x29')]=_0x46fe00[_0x796e('0x22')];_0x4d95a7[_0x281f9a][_0x796e('0x2a')]=_[_0x796e('0x23')](_0x46fe00[_0x796e('0x2a')])?util[_0x796e('0x2b')]('SIP/%s',_0x46fe00[_0x796e('0x22')]):_0x46fe00[_0x796e('0x2a')];if(_0x4d95a7[_0x281f9a][_0x796e('0x2c')]){_0x4d95a7[_0x281f9a]['queuecallercompleteAt']=moment()[_0x796e('0x2b')](_0x796e('0x2d'));}if(_0x4d95a7[_0x281f9a][_0x796e('0x2e')]){_0x4d95a7[_0x281f9a][_0x796e('0x2f')]=moment()[_0x796e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x796e('0x17')](_0x4d95a7[_0x281f9a]);}RpcVoiceQueueReport[_0x796e('0x30')](_0x4d95a7[_0x281f9a]);}};function extractCalleridNumber(_0x498d9a){var _0x50966c=_0x498d9a['match'](/<(.*?)>/);return _0x50966c?_0x50966c[0x1]:_0x498d9a;}Report[_0x796e('0x12')]['voiceCallReport']=function(_0x295534){_0x295534['destination']=_0x295534['destination']||_0x295534[_0x796e('0x31')];if(_0x295534[_0x796e('0x32')]==_0x796e('0x33')){_0x295534[_0x796e('0x34')]=_0x796e('0x35');_0x295534[_0x796e('0x36')]=_0x295534[_0x796e('0x35')];if(_0x295534[_0x796e('0x37')]==_0x796e('0x38')){_0x295534[_0x796e('0x21')]='';_0x295534[_0x796e('0x39')]=extractCalleridNumber(_0x295534[_0x796e('0x3a')]);}else if(_0x295534[_0x796e('0x37')]==_0x796e('0x3b')){if(_0x295534[_0x796e('0x39')]==_0x796e('0x3c')){_0x295534['destination']=extractCalleridNumber(_0x295534[_0x796e('0x3d')]);_0x295534[_0x796e('0x3e')]=_0x295534[_0x796e('0x3f')];_0x295534[_0x796e('0x40')]=[_0x295534['channel'],_0x295534[_0x796e('0x41')]=_0x295534[_0x796e('0x40')]][0x0];_0x295534[_0x796e('0x3a')]=_0x295534[_0x796e('0x3d')];}else{_0x295534[_0x796e('0x39')]=_0x295534['calleridnum'];_0x295534[_0x796e('0x3e')]=_0x295534['originatecalleridnum'];if(_0x295534[_0x796e('0x42')]==_0x796e('0x43')){_0x295534[_0x796e('0x21')]=_0x295534[_0x796e('0x27')];}else{_0x295534[_0x796e('0x21')]='';}}}}else{_0x295534[_0x796e('0x3a')]=util['format'](_0x796e('0x44'),_0x295534[_0x796e('0x45')],_0x295534['calleridnum']);}RpcVoiceCallReport[_0x796e('0x30')](_0x295534);if(_0x295534[_0x796e('0x46')]){for(var _0x260ff4=0x0;_0x260ff4<_0x295534[_0x796e('0x47')][_0x796e('0x26')];_0x260ff4+=0x1){_0x295534[_0x796e('0x48')]=_0x295534[_0x796e('0x47')][_0x260ff4][_0x796e('0x49')];_0x295534[_0x796e('0x4a')]=_0x295534[_0x796e('0x47')][_0x260ff4][_0x796e('0x4a')];if(_0x295534[_0x796e('0x31')]==_0x796e('0x3c')){_0x295534['calleridnum']=_0x295534[_0x796e('0x27')];_0x295534['calleridname']=_0x295534[_0x796e('0x4b')];_0x295534[_0x796e('0x27')]=_0x295534[_0x796e('0x21')];_0x295534['connectedlinename']=_0x295534[_0x796e('0x4c')];_0x295534[_0x796e('0x31')]=_0x295534[_0x796e('0x3f')];}else if(_0x295534[_0x796e('0x31')]=='xcally-motion-dialer'){_0x295534[_0x796e('0x3e')]=_0x295534['destination'];_0x295534['exten']=_0x295534[_0x796e('0x3f')];}RpcVoiceRecording[_0x796e('0x30')](_0x295534);}}};Report[_0x796e('0x12')][_0x796e('0x1a')]=function(_0x3ef280){if(_[_0x796e('0x4d')](_0x3ef280)){_0x3ef280['forEach'](function(_0x2fd665){RpcVoiceAgentReport[_0x796e('0x30')](_0x2fd665);});}else{RpcVoiceAgentReport[_0x796e('0x30')](_0x3ef280);}};Report['prototype'][_0x796e('0x1c')]=function(_0x53a4db){RpcVoiceDialReport['create'](_0x53a4db);var _0x55c5d1=undefined;var _0x4e761b=_0x53a4db[_0x796e('0x41')];if(_[_0x796e('0x4e')](_0x4e761b,_0x796e('0x4f'))){var _0x345cfb=_0x4e761b[_0x796e('0x50')](_0x4e761b[_0x796e('0x51')]('/')+0x1,_0x4e761b['indexOf']('@'));_0x55c5d1=_[_0x796e('0x20')](this[_0x796e('0x11')],function(_0x53d131){return _0x53d131[_0x796e('0x52')]==_0x345cfb||_0x53d131[_0x796e('0x53')]==_0x345cfb||_0x53d131[_0x796e('0x21')]==_0x345cfb;});}else{var _0x345cfb=_0x4e761b[_0x796e('0x50')](_0x4e761b[_0x796e('0x51')]('/')+0x1,_0x4e761b[_0x796e('0x54')]('-'));_0x55c5d1=this['findAgent'](_0x345cfb);}if(_0x55c5d1){_0x53a4db['interface']=_[_0x796e('0x23')](_0x55c5d1[_0x796e('0x2a')])?util[_0x796e('0x2b')]('SIP/%s',_0x55c5d1[_0x796e('0x22')]):_0x55c5d1[_0x796e('0x2a')];_0x53a4db[_0x796e('0x4c')]=_0x55c5d1[_0x796e('0x22')];_0x53a4db[_0x796e('0x21')]=_0x55c5d1['accountcode'];RpcMemberReport[_0x796e('0x1c')](_0x53a4db);}};Report[_0x796e('0x12')][_0x796e('0x1d')]=function(_0x342e15){RpcVoiceTransferReport[_0x796e('0x1d')](_0x342e15);};Report['prototype'][_0x796e('0x1e')]=function(_0x32170a){RpcVoiceTransferReport['attendedTransfer'](_0x32170a);};module[_0x796e('0x55')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index b4f1273..f68f77f 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 _0xaf34=['updateStatusRealtime','telephone:%s','trunk:%s','startsWith','Queue','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','actionSipShowRegistry','isUndefined','emit','isNotNull','find','stateRegistry','state','merge','omit','event','actionid','format','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber'];(function(_0x3577cf,_0x1113e0){var _0x3fa5af=function(_0x33cb6b){while(--_0x33cb6b){_0x3577cf['push'](_0x3577cf['shift']());}};_0x3fa5af(++_0x1113e0);}(_0xaf34,0x9b));var _0x4af3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xaf34[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4af3('0x0'));var moment=require(_0x4af3('0x1'));var BPromise=require(_0x4af3('0x2'));var util=require(_0x4af3('0x3'));var Redis=require('ioredis');var config=require(_0x4af3('0x4'));var logger=require(_0x4af3('0x5'))(_0x4af3('0x6'));var ami=require(_0x4af3('0x7'));config[_0x4af3('0x8')]=_[_0x4af3('0x9')](config[_0x4af3('0x8')],{'host':_0x4af3('0xa'),'port':0x18eb});var io=require(_0x4af3('0xb'))(new Redis(config['redis']));function UserReport(_0x1cae96){this[_0x4af3('0xc')]=_0x1cae96[_0x4af3('0xc')];this[_0x4af3('0xd')]=_0x1cae96[_0x4af3('0xd')];this[_0x4af3('0xe')]=_0x1cae96[_0x4af3('0xe')];ami['on']('registryentry',this[_0x4af3('0xf')]['bind'](this));ami['on']('registry',this['syncRegistry'][_0x4af3('0x10')](this));ami['on'](_0x4af3('0x11'),this[_0x4af3('0x12')][_0x4af3('0x10')](this));ami['on'](_0x4af3('0x13'),this[_0x4af3('0x14')][_0x4af3('0x10')](this));this[_0x4af3('0x15')]();return BPromise[_0x4af3('0x16')]()[_0x4af3('0x17')](ami['actionSipShowRegistry']())['then'](ami[_0x4af3('0x18')]())[_0x4af3('0x17')](ami[_0x4af3('0x19')]())[_0x4af3('0x1a')](loggerCatch(_0x4af3('0x1b')));}function loggerCatch(_0x98e1d2){return function(_0x76355e){logger[_0x4af3('0x1c')](_0x98e1d2,util[_0x4af3('0x1d')](_0x76355e,{'showHidden':![],'depth':null}));};}UserReport[_0x4af3('0x1e')][_0x4af3('0x15')]=function(){setInterval(function(){BPromise[_0x4af3('0x16')]()[_0x4af3('0x17')](ami[_0x4af3('0x1f')]())[_0x4af3('0x17')](ami[_0x4af3('0x18')]())['then'](ami[_0x4af3('0x19')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport['prototype']['isNotNull']=function(_0xdcaf9d){return _0xdcaf9d!==null&&!_[_0x4af3('0x20')](_0xdcaf9d);};UserReport[_0x4af3('0x1e')]['emit']=function(_0x224385,_0x5e8d69,_0x245b47){io['to'](_0x224385)[_0x4af3('0x21')](_0x5e8d69,_0x245b47);};UserReport['prototype'][_0x4af3('0xf')]=function(_0xaa8aa6){try{if(this[_0x4af3('0x22')](_0xaa8aa6)){var _0x8a9066=_[_0x4af3('0x23')](this[_0x4af3('0xc')],{'registry':_0xaa8aa6['username']});if(_0x8a9066){_0xaa8aa6[_0x4af3('0x24')]=_0xaa8aa6[_0x4af3('0x25')];_[_0x4af3('0x26')](_0x8a9066,_[_0x4af3('0x27')](_0xaa8aa6,[_0x4af3('0x28'),_0x4af3('0x29'),'username',_0x4af3('0x25')]));this['emit'](util[_0x4af3('0x2a')]('trunk:%s',_0x8a9066[_0x4af3('0x2b')]),_0x4af3('0x2c'),_0x8a9066);}}}catch(_0xa1e2b){logger[_0x4af3('0x1c')](_0x4af3('0x2d'),util['inspect'](_0xa1e2b,{'showHidden':![],'depth':null}));}};UserReport[_0x4af3('0x1e')][_0x4af3('0x12')]=function(_0x259ca7){try{if(this['isNotNull'](_0x259ca7)){if(this[_0x4af3('0xd')][_0x259ca7['device']]){if(!this['agents'][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x2f')]||_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]()==_0x4af3('0x31')){this[_0x4af3('0xd')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x2f')]=![];if(this[_0x4af3('0xd')][_0x259ca7[_0x4af3('0x2e')]]['state']!==_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]()){this[_0x4af3('0xd')][_0x259ca7['device']][_0x4af3('0x32')]=_[_0x4af3('0x33')](moment()['format']('x'));}this[_0x4af3('0xd')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x25')]=_0x259ca7[_0x4af3('0x25')]['toLowerCase']();this[_0x4af3('0xd')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x34')](_0x259ca7);}}else if(this['telephones'][_0x259ca7['device']]){if(this[_0x4af3('0xe')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x25')]!==_0x259ca7[_0x4af3('0x25')]['toLowerCase']()){this[_0x4af3('0xe')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x32')]=_[_0x4af3('0x33')](moment()[_0x4af3('0x2a')]('x'));}this[_0x4af3('0xe')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x25')]=_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]();this[_0x4af3('0x21')](util[_0x4af3('0x2a')](_0x4af3('0x35'),this[_0x4af3('0xe')][_0x259ca7['device']][_0x4af3('0x2b')]),'telephone:save',this[_0x4af3('0xe')][_0x259ca7[_0x4af3('0x2e')]]);}else if(this[_0x4af3('0xc')][_0x259ca7[_0x4af3('0x2e')]]){if(this[_0x4af3('0xc')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x25')]!==_0x259ca7['state'][_0x4af3('0x30')]()){this[_0x4af3('0xc')][_0x259ca7[_0x4af3('0x2e')]]['stateTime']=_[_0x4af3('0x33')](moment()[_0x4af3('0x2a')]('x'));}this[_0x4af3('0xc')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x25')]=_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]();this['emit'](util['format'](_0x4af3('0x36'),this[_0x4af3('0xc')][_0x259ca7[_0x4af3('0x2e')]][_0x4af3('0x2b')]),_0x4af3('0x2c'),this[_0x4af3('0xc')][_0x259ca7['device']]);}else if(_[_0x4af3('0x37')](_0x259ca7[_0x4af3('0x2e')],_0x4af3('0x38'))){}else if(_[_0x4af3('0x37')](_0x259ca7['device'],'Local')){var _0x204890=_0x259ca7[_0x4af3('0x2e')];var _0x3a8ab8=_0x204890[_0x4af3('0x39')](_0x204890[_0x4af3('0x3a')]('/')+0x1,_0x204890['indexOf']('@'));var _0x4e347c=_[_0x4af3('0x23')](this[_0x4af3('0xd')],function(_0x2af920){return _0x2af920[_0x4af3('0x3b')]==_0x3a8ab8||_0x2af920[_0x4af3('0x3c')]==_0x3a8ab8||_0x2af920[_0x4af3('0x3d')]==_0x3a8ab8;});if(_0x4e347c){if(_0x4e347c[_0x4af3('0x25')]!==_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]()){_0x4e347c['stateTime']=_[_0x4af3('0x33')](moment()[_0x4af3('0x2a')]('x'));}_0x4e347c[_0x4af3('0x25')]=_0x259ca7[_0x4af3('0x25')][_0x4af3('0x30')]();_0x4e347c[_0x4af3('0x2f')]=!![];_0x4e347c[_0x4af3('0x34')](_0x259ca7);}}else{}}}catch(_0x8aa5ed){logger[_0x4af3('0x1c')](_0x4af3('0x3e'),util[_0x4af3('0x1d')](_0x8aa5ed,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x4af3('0x14')]=function(_0xb690e0){try{if(this['isNotNull'](_0xb690e0)&&this['isNotNull'](_0xb690e0[_0x4af3('0x13')])){if(this[_0x4af3('0xd')][_0xb690e0['peer']]){if(!this['agents'][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x2f')]||_0xb690e0[_0x4af3('0x13')][_0x4af3('0x30')]()==_0x4af3('0x40')){this['agents'][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x2f')]=![];this['agents'][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x41')]=_0xb690e0['peerstatus']['toLowerCase']();this[_0x4af3('0xd')][_0xb690e0['peer']]['address']=_0xb690e0[_0x4af3('0x42')];this[_0x4af3('0xd')][_0xb690e0['peer']][_0x4af3('0x34')](_0xb690e0);}}else if(this[_0x4af3('0xe')][_0xb690e0[_0x4af3('0x3f')]]){this[_0x4af3('0xe')][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x41')]=_0xb690e0['peerstatus']['toLowerCase']();this[_0x4af3('0xe')][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x42')]=_0xb690e0[_0x4af3('0x42')];this[_0x4af3('0x21')](util['format']('telephone:%s',this[_0x4af3('0xe')][_0xb690e0['peer']][_0x4af3('0x2b')]),_0x4af3('0x43'),this[_0x4af3('0xe')][_0xb690e0[_0x4af3('0x3f')]]);}else if(this[_0x4af3('0xc')][_0xb690e0[_0x4af3('0x3f')]]){this[_0x4af3('0xc')][_0xb690e0[_0x4af3('0x3f')]][_0x4af3('0x41')]=_0xb690e0[_0x4af3('0x13')][_0x4af3('0x30')]();this[_0x4af3('0xc')][_0xb690e0[_0x4af3('0x3f')]]['address']=_0xb690e0[_0x4af3('0x42')];this[_0x4af3('0x21')](util[_0x4af3('0x2a')](_0x4af3('0x36'),this[_0x4af3('0xc')][_0xb690e0['peer']]['name']),_0x4af3('0x2c'),this[_0x4af3('0xc')][_0xb690e0[_0x4af3('0x3f')]]);}else{}}}catch(_0x390201){logger['error'](_0x4af3('0x44'),util['inspect'](_0x390201,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x7de9=['Queue','substring','indexOf','mobile','phone','accountcode','peer','address','status','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','trunks','agents','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','emit','find','username','stateRegistry','omit','event','trunk:%s','[syncRegistry][UserReport]','device','local','state','inuse','toLowerCase','stateTime','format','updateStatusRealtime','telephones','toNumber','telephone:%s','telephone:save','name','trunk:save','startsWith'];(function(_0x4cc17e,_0xbff357){var _0x4ee2e9=function(_0x3633d8){while(--_0x3633d8){_0x4cc17e['push'](_0x4cc17e['shift']());}};_0x4ee2e9(++_0xbff357);}(_0x7de9,0x86));var _0x97de=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x7de9[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x97de('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x97de('0x1'));var Redis=require('ioredis');var config=require(_0x97de('0x2'));var logger=require(_0x97de('0x3'))(_0x97de('0x4'));var ami=require(_0x97de('0x5'));config['redis']=_['defaults'](config[_0x97de('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x97de('0x6')]));function UserReport(_0x3aaf75){this['trunks']=_0x3aaf75[_0x97de('0x7')];this[_0x97de('0x8')]=_0x3aaf75[_0x97de('0x8')];this['telephones']=_0x3aaf75['telephones'];ami['on'](_0x97de('0x9'),this[_0x97de('0xa')]['bind'](this));ami['on'](_0x97de('0xb'),this[_0x97de('0xa')][_0x97de('0xc')](this));ami['on'](_0x97de('0xd'),this[_0x97de('0xe')]['bind'](this));ami['on'](_0x97de('0xf'),this[_0x97de('0x10')][_0x97de('0xc')](this));this[_0x97de('0x11')]();return BPromise[_0x97de('0x12')]()[_0x97de('0x13')](ami[_0x97de('0x14')]())[_0x97de('0x13')](ami[_0x97de('0x15')]())[_0x97de('0x13')](ami[_0x97de('0x16')]())[_0x97de('0x17')](loggerCatch(_0x97de('0x18')));}function loggerCatch(_0x5e1cb5){return function(_0x3fd98a){logger[_0x97de('0x19')](_0x5e1cb5,util[_0x97de('0x1a')](_0x3fd98a,{'showHidden':![],'depth':null}));};}UserReport[_0x97de('0x1b')][_0x97de('0x11')]=function(){setInterval(function(){BPromise[_0x97de('0x12')]()[_0x97de('0x13')](ami['actionSipShowRegistry']())[_0x97de('0x13')](ami['actionDeviceStateList']())[_0x97de('0x13')](ami['actionSipPeerStatus']())[_0x97de('0x17')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x97de('0x1b')][_0x97de('0x1c')]=function(_0x3e8fe0){return _0x3e8fe0!==null&&!_['isUndefined'](_0x3e8fe0);};UserReport[_0x97de('0x1b')]['emit']=function(_0x117db6,_0x23f5a8,_0x3de779){io['to'](_0x117db6)[_0x97de('0x1d')](_0x23f5a8,_0x3de779);};UserReport[_0x97de('0x1b')][_0x97de('0xa')]=function(_0x2c87ae){try{if(this[_0x97de('0x1c')](_0x2c87ae)){var _0x518859=_[_0x97de('0x1e')](this[_0x97de('0x7')],{'registry':_0x2c87ae[_0x97de('0x1f')]});if(_0x518859){_0x2c87ae[_0x97de('0x20')]=_0x2c87ae['state'];_['merge'](_0x518859,_[_0x97de('0x21')](_0x2c87ae,[_0x97de('0x22'),'actionid',_0x97de('0x1f'),'state']));this[_0x97de('0x1d')](util['format'](_0x97de('0x23'),_0x518859['name']),'trunk:save',_0x518859);}}}catch(_0x1f0fa8){logger[_0x97de('0x19')](_0x97de('0x24'),util['inspect'](_0x1f0fa8,{'showHidden':![],'depth':null}));}};UserReport[_0x97de('0x1b')][_0x97de('0xe')]=function(_0x4c6812){try{if(this[_0x97de('0x1c')](_0x4c6812)){if(this[_0x97de('0x8')][_0x4c6812[_0x97de('0x25')]]){if(!this[_0x97de('0x8')][_0x4c6812['device']][_0x97de('0x26')]||_0x4c6812[_0x97de('0x27')]['toLowerCase']()==_0x97de('0x28')){this[_0x97de('0x8')][_0x4c6812['device']][_0x97de('0x26')]=![];if(this['agents'][_0x4c6812[_0x97de('0x25')]]['state']!==_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]()){this['agents'][_0x4c6812['device']][_0x97de('0x2a')]=_['toNumber'](moment()[_0x97de('0x2b')]('x'));}this[_0x97de('0x8')][_0x4c6812['device']][_0x97de('0x27')]=_0x4c6812[_0x97de('0x27')]['toLowerCase']();this[_0x97de('0x8')][_0x4c6812[_0x97de('0x25')]][_0x97de('0x2c')](_0x4c6812);}}else if(this[_0x97de('0x2d')][_0x4c6812[_0x97de('0x25')]]){if(this[_0x97de('0x2d')][_0x4c6812[_0x97de('0x25')]][_0x97de('0x27')]!==_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]()){this[_0x97de('0x2d')][_0x4c6812['device']]['stateTime']=_[_0x97de('0x2e')](moment()[_0x97de('0x2b')]('x'));}this['telephones'][_0x4c6812[_0x97de('0x25')]][_0x97de('0x27')]=_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]();this['emit'](util[_0x97de('0x2b')](_0x97de('0x2f'),this[_0x97de('0x2d')][_0x4c6812[_0x97de('0x25')]]['name']),_0x97de('0x30'),this[_0x97de('0x2d')][_0x4c6812[_0x97de('0x25')]]);}else if(this[_0x97de('0x7')][_0x4c6812[_0x97de('0x25')]]){if(this[_0x97de('0x7')][_0x4c6812[_0x97de('0x25')]][_0x97de('0x27')]!==_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]()){this[_0x97de('0x7')][_0x4c6812['device']][_0x97de('0x2a')]=_['toNumber'](moment()['format']('x'));}this[_0x97de('0x7')][_0x4c6812[_0x97de('0x25')]]['state']=_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]();this[_0x97de('0x1d')](util['format']('trunk:%s',this[_0x97de('0x7')][_0x4c6812[_0x97de('0x25')]][_0x97de('0x31')]),_0x97de('0x32'),this[_0x97de('0x7')][_0x4c6812[_0x97de('0x25')]]);}else if(_[_0x97de('0x33')](_0x4c6812[_0x97de('0x25')],_0x97de('0x34'))){}else if(_[_0x97de('0x33')](_0x4c6812['device'],'Local')){var _0x3b69a4=_0x4c6812[_0x97de('0x25')];var _0x14548f=_0x3b69a4[_0x97de('0x35')](_0x3b69a4[_0x97de('0x36')]('/')+0x1,_0x3b69a4[_0x97de('0x36')]('@'));var _0x306388=_['find'](this[_0x97de('0x8')],function(_0x1e7132){return _0x1e7132[_0x97de('0x37')]==_0x14548f||_0x1e7132[_0x97de('0x38')]==_0x14548f||_0x1e7132[_0x97de('0x39')]==_0x14548f;});if(_0x306388){if(_0x306388[_0x97de('0x27')]!==_0x4c6812['state']['toLowerCase']()){_0x306388[_0x97de('0x2a')]=_[_0x97de('0x2e')](moment()[_0x97de('0x2b')]('x'));}_0x306388['state']=_0x4c6812[_0x97de('0x27')][_0x97de('0x29')]();_0x306388['local']=!![];_0x306388[_0x97de('0x2c')](_0x4c6812);}}else{}}}catch(_0x4b4817){logger[_0x97de('0x19')]('[syncDeviceState][UserReport]',util[_0x97de('0x1a')](_0x4b4817,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x97de('0x10')]=function(_0x4931c9){try{if(this[_0x97de('0x1c')](_0x4931c9)&&this[_0x97de('0x1c')](_0x4931c9[_0x97de('0xf')])){if(this[_0x97de('0x8')][_0x4931c9[_0x97de('0x3a')]]){if(!this[_0x97de('0x8')][_0x4931c9[_0x97de('0x3a')]][_0x97de('0x26')]||_0x4931c9[_0x97de('0xf')][_0x97de('0x29')]()=='registered'){this[_0x97de('0x8')][_0x4931c9[_0x97de('0x3a')]]['local']=![];this[_0x97de('0x8')][_0x4931c9[_0x97de('0x3a')]]['status']=_0x4931c9[_0x97de('0xf')][_0x97de('0x29')]();this['agents'][_0x4931c9[_0x97de('0x3a')]]['address']=_0x4931c9[_0x97de('0x3b')];this[_0x97de('0x8')][_0x4931c9[_0x97de('0x3a')]][_0x97de('0x2c')](_0x4931c9);}}else if(this['telephones'][_0x4931c9[_0x97de('0x3a')]]){this[_0x97de('0x2d')][_0x4931c9[_0x97de('0x3a')]][_0x97de('0x3c')]=_0x4931c9[_0x97de('0xf')][_0x97de('0x29')]();this[_0x97de('0x2d')][_0x4931c9['peer']][_0x97de('0x3b')]=_0x4931c9[_0x97de('0x3b')];this[_0x97de('0x1d')](util[_0x97de('0x2b')](_0x97de('0x2f'),this[_0x97de('0x2d')][_0x4931c9[_0x97de('0x3a')]]['name']),_0x97de('0x30'),this['telephones'][_0x4931c9[_0x97de('0x3a')]]);}else if(this[_0x97de('0x7')][_0x4931c9[_0x97de('0x3a')]]){this[_0x97de('0x7')][_0x4931c9[_0x97de('0x3a')]]['status']=_0x4931c9[_0x97de('0xf')][_0x97de('0x29')]();this[_0x97de('0x7')][_0x4931c9[_0x97de('0x3a')]]['address']=_0x4931c9['address'];this['emit'](util[_0x97de('0x2b')](_0x97de('0x23'),this[_0x97de('0x7')][_0x4931c9[_0x97de('0x3a')]][_0x97de('0x31')]),_0x97de('0x32'),this[_0x97de('0x7')][_0x4931c9['peer']]);}else{}}}catch(_0x4f05e3){logger['error']('[syncPeerStatus][UserReport]',util[_0x97de('0x1a')](_0x4f05e3,{'showHidden':![],'depth':null}));}};module[_0x97de('0x3d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 445d15a..abb6c7c 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 _0x6d46=['includes','transfer','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','diff','seconds','secondtransfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','omit','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','rejected','reason','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','agent','agentacw','acwtime','destconnectedlinenum','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil'];(function(_0x14d770,_0x41b389){var _0x4283a5=function(_0x1bc6e7){while(--_0x1bc6e7){_0x14d770['push'](_0x14d770['shift']());}};_0x4283a5(++_0x41b389);}(_0x6d46,0xfc));var _0x66d4=function(_0x32f78b,_0x178f58){_0x32f78b=_0x32f78b-0x0;var _0x51d847=_0x6d46[_0x32f78b];return _0x51d847;};'use strict';var _=require(_0x66d4('0x0'));var moment=require(_0x66d4('0x1'));var util=require('util');var Redis=require(_0x66d4('0x2'));var config=require(_0x66d4('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x66d4('0x4'));config[_0x66d4('0x5')]=_[_0x66d4('0x6')](config[_0x66d4('0x5')],{'host':_0x66d4('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x66d4('0x5')]));function VoiceAgentReport(_0x4215d8){this[_0x66d4('0x8')]={};this[_0x66d4('0x9')]=_0x4215d8[_0x66d4('0x9')];this[_0x66d4('0xa')]=_0x4215d8[_0x66d4('0xa')];this[_0x66d4('0xb')]={};ami['on'](_0x66d4('0xc'),this[_0x66d4('0xd')][_0x66d4('0xe')](this));ami['on']('agentconnect',this[_0x66d4('0xf')][_0x66d4('0xe')](this));ami['on']('agentringnoanswer',this[_0x66d4('0x10')]['bind'](this));ami['on'](_0x66d4('0x11'),this['syncQueueCallerAbandon'][_0x66d4('0xe')](this));ami['on'](_0x66d4('0x12'),this[_0x66d4('0x13')][_0x66d4('0xe')](this));ami['on']('varset',this[_0x66d4('0x14')][_0x66d4('0xe')](this));ami['on']('hangup',this[_0x66d4('0x15')]['bind'](this));ami['on'](_0x66d4('0x16'),this[_0x66d4('0x17')][_0x66d4('0xe')](this));ami['on'](_0x66d4('0x18'),this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this[_0x66d4('0x19')]['bind'](this));ami['on']('blindtransfer',this[_0x66d4('0x1a')][_0x66d4('0xe')](this));}VoiceAgentReport[_0x66d4('0x1b')][_0x66d4('0x1c')]=function(_0x2f768a,_0xabe74a,_0xf684ea){io['to'](_0x2f768a)['emit'](_0xabe74a,_0xf684ea);};VoiceAgentReport[_0x66d4('0x1b')][_0x66d4('0x1d')]=function(_0x4d91b1){return _0x4d91b1!==null&&!_[_0x66d4('0x1e')](_0x4d91b1);};VoiceAgentReport[_0x66d4('0x1b')][_0x66d4('0xd')]=function(_0x29fd99){try{if(this[_0x66d4('0x1d')](_0x29fd99)){if(_[_0x66d4('0x1e')](this['channels'][_0x29fd99[_0x66d4('0x1f')]])){this[_0x66d4('0x8')][_0x29fd99[_0x66d4('0x1f')]]={};}if(_[_0x66d4('0x1e')](this[_0x66d4('0x8')][_0x29fd99['uniqueid']][_0x29fd99[_0x66d4('0x20')]])){this[_0x66d4('0x8')][_0x29fd99['uniqueid']][_0x29fd99[_0x66d4('0x20')]]={'agentcalledAt':moment()[_0x66d4('0x21')](_0x66d4('0x22')),'lastevent':_0x66d4('0x23'),'variables':this[_0x66d4('0xb')][_0x29fd99['uniqueid']],'type':this[_0x66d4('0x9')][_0x29fd99[_0x66d4('0x24')]]?this[_0x66d4('0x9')][_0x29fd99[_0x66d4('0x24')]]['type']||_0x66d4('0x25'):'inbound'};}_[_0x66d4('0x26')](this[_0x66d4('0x8')][_0x29fd99[_0x66d4('0x1f')]][_0x29fd99[_0x66d4('0x20')]],_[_0x66d4('0x27')](_0x29fd99,['event','privilege']));ami[_0x66d4('0x1c')](_0x66d4('0x28'),this[_0x66d4('0x8')][_0x29fd99[_0x66d4('0x1f')]][_0x29fd99[_0x66d4('0x20')]]);this[_0x66d4('0x1c')](util[_0x66d4('0x21')](_0x66d4('0x29'),_0x29fd99[_0x66d4('0x2a')]),_0x66d4('0x2b'),this[_0x66d4('0x8')][_0x29fd99[_0x66d4('0x1f')]][_0x29fd99[_0x66d4('0x20')]]);}}catch(_0x46c307){logger[_0x66d4('0x2c')](_0x66d4('0x2d'),util[_0x66d4('0x2e')](_0x46c307,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x66d4('0x1b')][_0x66d4('0xf')]=function(_0x43097b){try{if(this[_0x66d4('0x1d')](_0x43097b)){if(this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]]){for(var _0x4fa3bc in this['channels'][_0x43097b[_0x66d4('0x1f')]]){if(this[_0x66d4('0x8')][_0x43097b['uniqueid']][_0x66d4('0x2f')](_0x4fa3bc)){if(_0x43097b[_0x66d4('0x20')]===_0x4fa3bc){this['channels'][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x30')]=moment()[_0x66d4('0x21')](_0x66d4('0x22'));this['channels'][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['lastevent']=_0x66d4('0x31');this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x32')]=_0x43097b[_0x66d4('0x32')];this['channels'][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['connectedlinenum']=_0x43097b[_0x66d4('0x33')];this['channels'][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['connectedlinename']=_0x43097b[_0x66d4('0x34')];this[_0x66d4('0x8')][_0x43097b['uniqueid']][_0x4fa3bc][_0x66d4('0x35')]=_0x43097b[_0x66d4('0x35')];this[_0x66d4('0x8')][_0x43097b['uniqueid']][_0x4fa3bc][_0x66d4('0x36')]=_0x43097b[_0x66d4('0x36')];_['merge'](this[_0x66d4('0xa')][_0x43097b[_0x66d4('0x37')]],_[_0x66d4('0x38')](_0x43097b,[_0x66d4('0x24'),'destconnectedlinenum']));this[_0x66d4('0x1c')](util[_0x66d4('0x21')]('user:%s',_0x43097b[_0x66d4('0x2a')]),_0x66d4('0x39'),this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x43097b['destuniqueid']]);ami[_0x66d4('0x1c')](_0x66d4('0x3a'),this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]);}else if(!this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x3b')]&&!this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['agentcomplete']){this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x3b')]=!![];this[_0x66d4('0x8')][_0x43097b['uniqueid']][_0x4fa3bc][_0x66d4('0x3c')]=moment()[_0x66d4('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['reason']='answered_elsewhere';this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x3d')]=_0x66d4('0x3e');this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc][_0x66d4('0x3f')]=_0x43097b[_0x66d4('0x20')];this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]['answeredelsewheremembername']=_0x43097b['membername'];ami['emit'](_0x66d4('0x40'),this[_0x66d4('0x8')][_0x43097b[_0x66d4('0x1f')]][_0x4fa3bc]);}}}}}}catch(_0x3ba2c9){logger[_0x66d4('0x2c')]('[syncAgentConnect][VoiceAgentReport]',util[_0x66d4('0x2e')](_0x3ba2c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x66d4('0x10')]=function(_0x175f7d){try{if(this[_0x66d4('0x1d')](_0x175f7d)){if(this['channels'][_0x175f7d[_0x66d4('0x1f')]]&&this['channels'][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d[_0x66d4('0x20')]]){this[_0x66d4('0x8')][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d['destuniqueid']][_0x66d4('0x3b')]=!![];this[_0x66d4('0x8')][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d[_0x66d4('0x20')]][_0x66d4('0x3c')]=moment()[_0x66d4('0x21')](_0x66d4('0x22'));this['channels'][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d[_0x66d4('0x20')]]['reason']=_0x66d4('0x41');this[_0x66d4('0x8')][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d['destuniqueid']][_0x66d4('0x3d')]=_0x66d4('0x41');ami[_0x66d4('0x1c')]('custom:agentringnoanswer',this[_0x66d4('0x8')][_0x175f7d[_0x66d4('0x1f')]][_0x175f7d['destuniqueid']]);}}}catch(_0xb85ab5){logger[_0x66d4('0x2c')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x66d4('0x2e')](_0xb85ab5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x66d4('0x1b')]['syncQueueCallerAbandon']=function(_0x54c457){try{if(this['isNotNull'](_0x54c457)){if(this['channels'][_0x54c457[_0x66d4('0x1f')]]){for(var _0x3875b8 in this[_0x66d4('0x8')][_0x54c457['uniqueid']]){if(this['channels'][_0x54c457[_0x66d4('0x1f')]][_0x66d4('0x2f')](_0x3875b8)&&!this[_0x66d4('0x8')][_0x54c457['uniqueid']][_0x3875b8][_0x66d4('0x3b')]&&!this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8][_0x66d4('0x12')]){this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8][_0x66d4('0x3b')]=!![];this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8][_0x66d4('0x3c')]=moment()[_0x66d4('0x21')](_0x66d4('0x22'));this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8][_0x66d4('0x42')]=_0x66d4('0x43');this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8][_0x66d4('0x3d')]=_0x66d4('0x43');ami[_0x66d4('0x1c')]('custom:agentqueuecallerabandon',this[_0x66d4('0x8')][_0x54c457[_0x66d4('0x1f')]][_0x3875b8]);}}}}}catch(_0xd1ce7d){logger[_0x66d4('0x2c')](_0x66d4('0x44'),util[_0x66d4('0x2e')](_0xd1ce7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x66d4('0x13')]=function(_0x17e3f0){try{if(this['isNotNull'](_0x17e3f0)){if(this['channels'][_0x17e3f0[_0x66d4('0x1f')]]){for(var _0x131bec in this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]]){if(this[_0x66d4('0x8')][_0x17e3f0['uniqueid']]['hasOwnProperty'](_0x131bec)){if(this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x30')]&&!this['channels'][_0x17e3f0['uniqueid']][_0x131bec]['agentcomplete']){this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x12')]=!![];this['channels'][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec]['agentcompleteAt']=moment()[_0x66d4('0x21')](_0x66d4('0x22'));this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x3d')]=_0x66d4('0x45');this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x46')]=_0x17e3f0['talktime'];this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x42')]=_0x17e3f0[_0x66d4('0x42')]=='transfer'?_0x66d4('0x47'):_0x17e3f0['reason'];if(this[_0x66d4('0x9')][_0x17e3f0[_0x66d4('0x24')]]&&this['voiceQueues'][_0x17e3f0[_0x66d4('0x24')]]['acw']){this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x48')]=!![];this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec][_0x66d4('0x49')]=this[_0x66d4('0x9')][_0x17e3f0[_0x66d4('0x24')]]['acwTimeout'];}this[_0x66d4('0xa')][_0x17e3f0[_0x66d4('0x37')]]=_[_0x66d4('0x27')](this[_0x66d4('0xa')][_0x17e3f0[_0x66d4('0x37')]],[_0x66d4('0x24'),_0x66d4('0x4a')]);this[_0x66d4('0x1c')](util[_0x66d4('0x21')](_0x66d4('0x29'),_0x17e3f0[_0x66d4('0x2a')]),'user:agentcomplete',this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec]);ami['emit'](_0x66d4('0x4b'),this[_0x66d4('0x8')][_0x17e3f0[_0x66d4('0x1f')]][_0x131bec]);}}}}}}catch(_0x5a0856){logger[_0x66d4('0x2c')](_0x66d4('0x4c'),util[_0x66d4('0x2e')](_0x5a0856,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x66d4('0x14')]=function(_0x3567a5){try{if(this[_0x66d4('0x1d')](_0x3567a5)){this[_0x66d4('0x4d')](_0x3567a5[_0x66d4('0x1f')],_[_0x66d4('0x4e')](_0x3567a5[_0x66d4('0x4f')])[0x0],_0x3567a5['value']);if(this[_0x66d4('0x8')][_0x3567a5['uniqueid']]){for(var _0x56426a in this['channels'][_0x3567a5[_0x66d4('0x1f')]]){if(this[_0x66d4('0x8')][_0x3567a5['uniqueid']][_0x66d4('0x2f')](_0x56426a)){if(_[_0x66d4('0x1e')](this[_0x66d4('0x8')][_0x3567a5[_0x66d4('0x1f')]][_0x56426a]['variables'])){this[_0x66d4('0x8')][_0x3567a5[_0x66d4('0x1f')]][_0x56426a][_0x66d4('0xb')]={};}this[_0x66d4('0x8')][_0x3567a5['uniqueid']][_0x56426a][_0x66d4('0xb')]=this[_0x66d4('0xb')][_0x3567a5[_0x66d4('0x1f')]];}}}}}catch(_0x5499c5){logger['error'](_0x66d4('0x50'),util[_0x66d4('0x2e')](_0x5499c5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x66d4('0x4d')]=function(_0x3a018b,_0x5c4719,_0x46c476){var _0x488af3=[_0x66d4('0x51'),'rtpaudioqosbridged',_0x66d4('0x52'),'rtpaudioqosjitterbridged',_0x66d4('0x53'),_0x66d4('0x54'),_0x66d4('0x55'),'rtpaudioqosrttbridged','sipcallid',_0x66d4('0x56'),_0x66d4('0x57'),_0x66d4('0x58'),_0x66d4('0x59'),_0x66d4('0x5a'),_0x66d4('0x5b'),_0x66d4('0x5c'),_0x66d4('0x2a'),_0x66d4('0x5d'),_0x66d4('0x5e')];if(!_[_0x66d4('0x5f')](_0x5c4719)&&!_[_0x66d4('0x60')](_0x488af3,_0x5c4719)){if(_['isUndefined'](this[_0x66d4('0xb')][_0x3a018b])){this['variables'][_0x3a018b]={};}this[_0x66d4('0xb')][_0x3a018b][_0x5c4719]=_0x46c476;}};VoiceAgentReport['prototype'][_0x66d4('0x15')]=function(_0x434fb7){try{if(this[_0x66d4('0x1d')](_0x434fb7)){if(this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]]){for(var _0x34c33f in this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]]){if(this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]][_0x66d4('0x2f')](_0x34c33f)){if(this[_0x66d4('0x8')][_0x434fb7['uniqueid']][_0x34c33f]['reason']==_0x66d4('0x61')&&this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]][_0x34c33f][_0x66d4('0x12')]){this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]][_0x34c33f]['agentcompleteAt']=moment()['format'](_0x66d4('0x22'));}}}ami[_0x66d4('0x1c')](_0x66d4('0x62'),_[_0x66d4('0x63')](this[_0x66d4('0x8')][_0x434fb7[_0x66d4('0x1f')]]));delete this[_0x66d4('0x8')][_0x434fb7['uniqueid']];}if(this[_0x66d4('0xb')][_0x434fb7[_0x66d4('0x1f')]]){delete this[_0x66d4('0xb')][_0x434fb7[_0x66d4('0x1f')]];}}}catch(_0x17039){logger[_0x66d4('0x2c')](_0x66d4('0x64'),util['inspect'](_0x17039,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x66d4('0x19')]=function(_0x501ad4){try{if(this[_0x66d4('0x1d')](_0x501ad4)){if(this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]]){for(var _0x484741 in this['channels'][_0x501ad4[_0x66d4('0x65')]]){if(this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]][_0x66d4('0x2f')](_0x484741)){if(_0x501ad4[_0x66d4('0x66')]===_0x484741){var _0x49a8f8=moment();this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x12')]=!![];this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x67')]=moment()[_0x66d4('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x42')]='transfer';this['channels'][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x3d')]=_0x66d4('0x45');this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x46')]=_0x49a8f8[_0x66d4('0x68')](this['channels'][_0x501ad4[_0x66d4('0x65')]][_0x484741][_0x66d4('0x30')],_0x66d4('0x69'));}}}}if(this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x6a')]]){var _0x2ff64c=this['channels'][_0x501ad4[_0x66d4('0x6a')]];this['channels'][_0x501ad4[_0x66d4('0x6a')]]=this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]];this[_0x66d4('0x8')][_0x501ad4[_0x66d4('0x65')]]=_0x2ff64c;}}}catch(_0x4403a7){logger['error']('[syncAttendedTransfer][VoiceAgentReport]',util[_0x66d4('0x2e')](_0x4403a7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x66d4('0x1b')]['syncBlindTransfer']=function(_0x4567fb){try{if(this['isNotNull'](_0x4567fb)){if(this[_0x66d4('0x8')][_0x4567fb['transfereeuniqueid']]){for(var _0x271e0b in this['channels'][_0x4567fb[_0x66d4('0x65')]]){if(this['channels'][_0x4567fb['transfereeuniqueid']][_0x66d4('0x2f')](_0x271e0b)){if(_0x4567fb['transfereruniqueid']===_0x271e0b){var _0x1cc2c7=moment();this[_0x66d4('0x8')][_0x4567fb[_0x66d4('0x65')]][_0x271e0b]['agentcomplete']=!![];this['channels'][_0x4567fb[_0x66d4('0x65')]][_0x271e0b][_0x66d4('0x67')]=_0x1cc2c7;this['channels'][_0x4567fb[_0x66d4('0x65')]][_0x271e0b][_0x66d4('0x42')]=_0x66d4('0x61');this[_0x66d4('0x8')][_0x4567fb[_0x66d4('0x65')]][_0x271e0b]['lastevent']=_0x66d4('0x45');this[_0x66d4('0x8')][_0x4567fb[_0x66d4('0x65')]][_0x271e0b][_0x66d4('0x46')]=_0x1cc2c7[_0x66d4('0x68')](this[_0x66d4('0x8')][_0x4567fb[_0x66d4('0x65')]][_0x271e0b][_0x66d4('0x30')],_0x66d4('0x69'));}}}}}}catch(_0x2d8ed6){logger[_0x66d4('0x2c')](_0x66d4('0x6b'),util[_0x66d4('0x2e')](_0x2d8ed6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x66d4('0x1b')]['syncMusicOnHoldStart']=function(_0x37bcb1){var _0xb24333='';try{if(this[_0x66d4('0x1d')](_0x37bcb1)){if(_0x37bcb1[_0x66d4('0x6c')]){_0xb24333=_0x37bcb1[_0x66d4('0x6c')][_0x66d4('0x6d')](0x0,_0x37bcb1[_0x66d4('0x6c')][_0x66d4('0x6e')]('-'));if(this[_0x66d4('0xa')][_0xb24333]){this[_0x66d4('0xa')][_0xb24333][_0x66d4('0x6f')]=!![];}}}}catch(_0x234a41){logger['error'](_0x66d4('0x70'),util[_0x66d4('0x2e')](_0x234a41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x66d4('0x1b')][_0x66d4('0x71')]=function(_0xabff04){var _0x5e885d='';try{if(this[_0x66d4('0x1d')](_0xabff04)){if(_0xabff04[_0x66d4('0x6c')]){_0x5e885d=_0xabff04[_0x66d4('0x6c')][_0x66d4('0x6d')](0x0,_0xabff04[_0x66d4('0x6c')][_0x66d4('0x6e')]('-'));if(this[_0x66d4('0xa')][_0x5e885d]){this[_0x66d4('0xa')][_0x5e885d][_0x66d4('0x6f')]=![];}}}}catch(_0x4081fa){logger[_0x66d4('0x2c')](_0x66d4('0x72'),util[_0x66d4('0x2e')](_0x4081fa,{'showHidden':![],'depth':null}));}};module[_0x66d4('0x73')]=VoiceAgentReport; \ No newline at end of file +var _0x954c=['agentcalled','syncAgentCalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','voiceQueues','queue','type','inbound','merge','event','privilege','custom:agentcalled','user:%s','membername','error','[syncAgentCalled][VoiceAgentReport]','syncAgentConnect','hasOwnProperty','lastevent','connect','holdtime','connectedlinenum','destchannelstate','destchannelstatedesc','interface','pick','user:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agentacw','acwtime','acwTimeout','omit','destconnectedlinenum','user:agentcomplete','addVariable','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','agentconnectAt','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','moment','util','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','agents','variables'];(function(_0x16c82e,_0x548c96){var _0x30cc75=function(_0xc80b39){while(--_0xc80b39){_0x16c82e['push'](_0x16c82e['shift']());}};_0x30cc75(++_0x548c96);}(_0x954c,0x165));var _0xc954=function(_0x43df6a,_0x561859){_0x43df6a=_0x43df6a-0x0;var _0x3aace4=_0x954c[_0x43df6a];return _0x3aace4;};'use strict';var _=require('lodash');var moment=require(_0xc954('0x0'));var util=require(_0xc954('0x1'));var Redis=require(_0xc954('0x2'));var config=require('../../../config/environment');var logger=require(_0xc954('0x3'))(_0xc954('0x4'));var ami=require('../ami');config[_0xc954('0x5')]=_[_0xc954('0x6')](config['redis'],{'host':_0xc954('0x7'),'port':0x18eb});var io=require(_0xc954('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x38b79e){this[_0xc954('0x9')]={};this['voiceQueues']=_0x38b79e['voiceQueues'];this[_0xc954('0xa')]=_0x38b79e[_0xc954('0xa')];this[_0xc954('0xb')]={};ami['on'](_0xc954('0xc'),this[_0xc954('0xd')][_0xc954('0xe')](this));ami['on'](_0xc954('0xf'),this['syncAgentConnect'][_0xc954('0xe')](this));ami['on']('agentringnoanswer',this[_0xc954('0x10')][_0xc954('0xe')](this));ami['on'](_0xc954('0x11'),this[_0xc954('0x12')][_0xc954('0xe')](this));ami['on'](_0xc954('0x13'),this[_0xc954('0x14')][_0xc954('0xe')](this));ami['on'](_0xc954('0x15'),this[_0xc954('0x16')][_0xc954('0xe')](this));ami['on'](_0xc954('0x17'),this[_0xc954('0x18')]['bind'](this));ami['on'](_0xc954('0x19'),this[_0xc954('0x1a')][_0xc954('0xe')](this));ami['on'](_0xc954('0x1b'),this[_0xc954('0x1c')][_0xc954('0xe')](this));ami['on'](_0xc954('0x1d'),this[_0xc954('0x1e')][_0xc954('0xe')](this));ami['on']('blindtransfer',this[_0xc954('0x1f')][_0xc954('0xe')](this));}VoiceAgentReport[_0xc954('0x20')][_0xc954('0x21')]=function(_0x3092aa,_0x1b615c,_0x28c15e){io['to'](_0x3092aa)[_0xc954('0x21')](_0x1b615c,_0x28c15e);};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x22')]=function(_0x253c95){return _0x253c95!==null&&!_[_0xc954('0x23')](_0x253c95);};VoiceAgentReport[_0xc954('0x20')][_0xc954('0xd')]=function(_0x4e44ff){try{if(this[_0xc954('0x22')](_0x4e44ff)){if(_[_0xc954('0x23')](this[_0xc954('0x9')][_0x4e44ff[_0xc954('0x24')]])){this[_0xc954('0x9')][_0x4e44ff['uniqueid']]={};}if(_[_0xc954('0x23')](this[_0xc954('0x9')][_0x4e44ff[_0xc954('0x24')]][_0x4e44ff[_0xc954('0x25')]])){this['channels'][_0x4e44ff[_0xc954('0x24')]][_0x4e44ff[_0xc954('0x25')]]={'agentcalledAt':moment()[_0xc954('0x26')](_0xc954('0x27')),'lastevent':_0xc954('0x28'),'variables':this[_0xc954('0xb')][_0x4e44ff[_0xc954('0x24')]],'type':this[_0xc954('0x29')][_0x4e44ff[_0xc954('0x2a')]]?this[_0xc954('0x29')][_0x4e44ff[_0xc954('0x2a')]][_0xc954('0x2b')]||_0xc954('0x2c'):_0xc954('0x2c')};}_[_0xc954('0x2d')](this[_0xc954('0x9')][_0x4e44ff[_0xc954('0x24')]][_0x4e44ff[_0xc954('0x25')]],_['omit'](_0x4e44ff,[_0xc954('0x2e'),_0xc954('0x2f')]));ami[_0xc954('0x21')](_0xc954('0x30'),this['channels'][_0x4e44ff[_0xc954('0x24')]][_0x4e44ff['destuniqueid']]);this[_0xc954('0x21')](util[_0xc954('0x26')](_0xc954('0x31'),_0x4e44ff[_0xc954('0x32')]),'user:called',this[_0xc954('0x9')][_0x4e44ff[_0xc954('0x24')]][_0x4e44ff[_0xc954('0x25')]]);}}catch(_0x203b35){logger[_0xc954('0x33')](_0xc954('0x34'),util['inspect'](_0x203b35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x35')]=function(_0x2b5df1){try{if(this[_0xc954('0x22')](_0x2b5df1)){if(this[_0xc954('0x9')][_0x2b5df1['uniqueid']]){for(var _0x2ba75d in this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]]){if(this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0xc954('0x36')](_0x2ba75d)){if(_0x2b5df1[_0xc954('0x25')]===_0x2ba75d){this[_0xc954('0x9')][_0x2b5df1['uniqueid']][_0x2ba75d]['agentconnectAt']=moment()[_0xc954('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x37')]=_0xc954('0x38');this[_0xc954('0x9')][_0x2b5df1['uniqueid']][_0x2ba75d][_0xc954('0x39')]=_0x2b5df1[_0xc954('0x39')];this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d]['connectedlinenum']=_0x2b5df1[_0xc954('0x3a')];this[_0xc954('0x9')][_0x2b5df1['uniqueid']][_0x2ba75d]['connectedlinename']=_0x2b5df1['connectedlinename'];this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x3b')]=_0x2b5df1[_0xc954('0x3b')];this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x3c')]=_0x2b5df1[_0xc954('0x3c')];_[_0xc954('0x2d')](this[_0xc954('0xa')][_0x2b5df1[_0xc954('0x3d')]],_[_0xc954('0x3e')](_0x2b5df1,[_0xc954('0x2a'),'destconnectedlinenum']));this[_0xc954('0x21')](util['format']('user:%s',_0x2b5df1[_0xc954('0x32')]),_0xc954('0x3f'),this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2b5df1[_0xc954('0x25')]]);ami[_0xc954('0x21')]('custom:agentconnect',this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d]);}else if(!this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x40')]&&!this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x13')]){this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d]['agentringnoanswer']=!![];this['channels'][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x41')]=moment()[_0xc954('0x26')](_0xc954('0x27'));this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d][_0xc954('0x42')]=_0xc954('0x43');this[_0xc954('0x9')][_0x2b5df1[_0xc954('0x24')]][_0x2ba75d]['lastevent']='answered_elsewhere';this['channels'][_0x2b5df1['uniqueid']][_0x2ba75d][_0xc954('0x44')]=_0x2b5df1[_0xc954('0x25')];this[_0xc954('0x9')][_0x2b5df1['uniqueid']][_0x2ba75d][_0xc954('0x45')]=_0x2b5df1[_0xc954('0x32')];ami[_0xc954('0x21')](_0xc954('0x46'),this[_0xc954('0x9')][_0x2b5df1['uniqueid']][_0x2ba75d]);}}}}}}catch(_0x2b4216){logger[_0xc954('0x33')](_0xc954('0x47'),util[_0xc954('0x48')](_0x2b4216,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x10')]=function(_0x2905a9){try{if(this[_0xc954('0x22')](_0x2905a9)){if(this[_0xc954('0x9')][_0x2905a9['uniqueid']]&&this[_0xc954('0x9')][_0x2905a9[_0xc954('0x24')]][_0x2905a9[_0xc954('0x25')]]){this['channels'][_0x2905a9[_0xc954('0x24')]][_0x2905a9[_0xc954('0x25')]]['agentringnoanswer']=!![];this[_0xc954('0x9')][_0x2905a9['uniqueid']][_0x2905a9[_0xc954('0x25')]][_0xc954('0x41')]=moment()['format'](_0xc954('0x27'));this[_0xc954('0x9')][_0x2905a9[_0xc954('0x24')]][_0x2905a9[_0xc954('0x25')]][_0xc954('0x42')]=_0xc954('0x49');this[_0xc954('0x9')][_0x2905a9['uniqueid']][_0x2905a9[_0xc954('0x25')]][_0xc954('0x37')]='rejected';ami[_0xc954('0x21')](_0xc954('0x4a'),this['channels'][_0x2905a9[_0xc954('0x24')]][_0x2905a9[_0xc954('0x25')]]);}}}catch(_0x3df7ee){logger[_0xc954('0x33')](_0xc954('0x4b'),util['inspect'](_0x3df7ee,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x12')]=function(_0x4a32f3){try{if(this['isNotNull'](_0x4a32f3)){if(this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]]){for(var _0x8e7950 in this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]]){if(this['channels'][_0x4a32f3['uniqueid']][_0xc954('0x36')](_0x8e7950)&&!this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]][_0x8e7950][_0xc954('0x40')]&&!this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]][_0x8e7950]['agentcomplete']){this[_0xc954('0x9')][_0x4a32f3['uniqueid']][_0x8e7950][_0xc954('0x40')]=!![];this[_0xc954('0x9')][_0x4a32f3['uniqueid']][_0x8e7950][_0xc954('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]][_0x8e7950][_0xc954('0x42')]=_0xc954('0x4c');this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]][_0x8e7950][_0xc954('0x37')]=_0xc954('0x4c');ami[_0xc954('0x21')](_0xc954('0x4d'),this[_0xc954('0x9')][_0x4a32f3[_0xc954('0x24')]][_0x8e7950]);}}}}}catch(_0x46bd90){logger[_0xc954('0x33')](_0xc954('0x4e'),util[_0xc954('0x48')](_0x46bd90,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')]['syncAgentComplete']=function(_0x288191){try{if(this[_0xc954('0x22')](_0x288191)){if(this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]]){for(var _0x558c1e in this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]]){if(this[_0xc954('0x9')][_0x288191['uniqueid']]['hasOwnProperty'](_0x558c1e)){if(this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e]['agentconnectAt']&&!this[_0xc954('0x9')][_0x288191['uniqueid']][_0x558c1e]['agentcomplete']){this[_0xc954('0x9')][_0x288191['uniqueid']][_0x558c1e]['agentcomplete']=!![];this['channels'][_0x288191[_0xc954('0x24')]][_0x558c1e][_0xc954('0x4f')]=moment()['format'](_0xc954('0x27'));this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e]['lastevent']=_0xc954('0x50');this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e][_0xc954('0x51')]=_0x288191[_0xc954('0x51')];this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e][_0xc954('0x42')]=_0x288191[_0xc954('0x42')]==_0xc954('0x52')?'agent':_0x288191[_0xc954('0x42')];if(this[_0xc954('0x29')][_0x288191[_0xc954('0x2a')]]&&this[_0xc954('0x29')][_0x288191[_0xc954('0x2a')]]['acw']){this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e][_0xc954('0x53')]=!![];this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e][_0xc954('0x54')]=this[_0xc954('0x29')][_0x288191[_0xc954('0x2a')]][_0xc954('0x55')];}this['agents'][_0x288191[_0xc954('0x3d')]]=_[_0xc954('0x56')](this['agents'][_0x288191[_0xc954('0x3d')]],[_0xc954('0x2a'),_0xc954('0x57')]);this['emit'](util[_0xc954('0x26')](_0xc954('0x31'),_0x288191[_0xc954('0x32')]),_0xc954('0x58'),this[_0xc954('0x9')][_0x288191['uniqueid']][_0x558c1e]);ami[_0xc954('0x21')]('custom:agentcomplete',this[_0xc954('0x9')][_0x288191[_0xc954('0x24')]][_0x558c1e]);}}}}}}catch(_0xb4e6c3){logger['error']('[syncAgentComplete][VoiceAgentReport]',util['inspect'](_0xb4e6c3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x16')]=function(_0x304a4a){try{if(this[_0xc954('0x22')](_0x304a4a)){this[_0xc954('0x59')](_0x304a4a[_0xc954('0x24')],_['keys'](_0x304a4a[_0xc954('0x5a')])[0x0],_0x304a4a[_0xc954('0x5b')]);if(this[_0xc954('0x9')][_0x304a4a['uniqueid']]){for(var _0x4b07d3 in this[_0xc954('0x9')][_0x304a4a[_0xc954('0x24')]]){if(this[_0xc954('0x9')][_0x304a4a[_0xc954('0x24')]][_0xc954('0x36')](_0x4b07d3)){if(_[_0xc954('0x23')](this[_0xc954('0x9')][_0x304a4a[_0xc954('0x24')]][_0x4b07d3]['variables'])){this[_0xc954('0x9')][_0x304a4a[_0xc954('0x24')]][_0x4b07d3][_0xc954('0xb')]={};}this[_0xc954('0x9')][_0x304a4a['uniqueid']][_0x4b07d3]['variables']=this['variables'][_0x304a4a[_0xc954('0x24')]];}}}}}catch(_0x3602e7){logger[_0xc954('0x33')](_0xc954('0x5c'),util[_0xc954('0x48')](_0x3602e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x59')]=function(_0x42d257,_0x119b02,_0x50abdc){var _0x244c90=[_0xc954('0x5d'),'rtpaudioqosbridged',_0xc954('0x5e'),_0xc954('0x5f'),_0xc954('0x60'),_0xc954('0x61'),'rtpaudioqosrtt',_0xc954('0x62'),'sipcallid','sipuri',_0xc954('0x63'),'bridgepvtcallid',_0xc954('0x64'),_0xc954('0x65'),_0xc954('0x66'),_0xc954('0x67'),_0xc954('0x32'),_0xc954('0x68'),_0xc954('0x69')];if(!_[_0xc954('0x6a')](_0x119b02)&&!_[_0xc954('0x6b')](_0x244c90,_0x119b02)){if(_[_0xc954('0x23')](this[_0xc954('0xb')][_0x42d257])){this[_0xc954('0xb')][_0x42d257]={};}this[_0xc954('0xb')][_0x42d257][_0x119b02]=_0x50abdc;}};VoiceAgentReport[_0xc954('0x20')]['syncHangup']=function(_0x2899d2){try{if(this[_0xc954('0x22')](_0x2899d2)){if(this['channels'][_0x2899d2['uniqueid']]){for(var _0x153890 in this[_0xc954('0x9')][_0x2899d2[_0xc954('0x24')]]){if(this[_0xc954('0x9')][_0x2899d2[_0xc954('0x24')]][_0xc954('0x36')](_0x153890)){if(this['channels'][_0x2899d2[_0xc954('0x24')]][_0x153890]['reason']=='transfer'&&this['channels'][_0x2899d2[_0xc954('0x24')]][_0x153890][_0xc954('0x13')]){this['channels'][_0x2899d2[_0xc954('0x24')]][_0x153890][_0xc954('0x4f')]=moment()[_0xc954('0x26')](_0xc954('0x27'));}}}ami[_0xc954('0x21')](_0xc954('0x6c'),_[_0xc954('0x6d')](this['channels'][_0x2899d2[_0xc954('0x24')]]));delete this[_0xc954('0x9')][_0x2899d2[_0xc954('0x24')]];}if(this[_0xc954('0xb')][_0x2899d2['uniqueid']]){delete this[_0xc954('0xb')][_0x2899d2['uniqueid']];}}}catch(_0x4913ef){logger[_0xc954('0x33')]('[syncHangup][VoiceAgentReport]',util[_0xc954('0x48')](_0x4913ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x1e')]=function(_0x21650f){try{if(this[_0xc954('0x22')](_0x21650f)){if(this[_0xc954('0x9')][_0x21650f['transfereeuniqueid']]){for(var _0x22ff6f in this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]]){if(this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]]['hasOwnProperty'](_0x22ff6f)){if(_0x21650f[_0xc954('0x6f')]===_0x22ff6f){var _0x2a6c2e=moment();this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]][_0x22ff6f][_0xc954('0x13')]=!![];this['channels'][_0x21650f[_0xc954('0x6e')]][_0x22ff6f]['agentcompleteAt']=moment()[_0xc954('0x26')](_0xc954('0x27'));this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]][_0x22ff6f][_0xc954('0x42')]=_0xc954('0x52');this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]][_0x22ff6f]['lastevent']=_0xc954('0x50');this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]][_0x22ff6f]['talktime']=_0x2a6c2e[_0xc954('0x70')](this['channels'][_0x21650f[_0xc954('0x6e')]][_0x22ff6f]['agentconnectAt'],_0xc954('0x71'));}}}}if(this[_0xc954('0x9')][_0x21650f['secondtransfereruniqueid']]){var _0x133539=this[_0xc954('0x9')][_0x21650f[_0xc954('0x72')]];this[_0xc954('0x9')][_0x21650f[_0xc954('0x72')]]=this[_0xc954('0x9')][_0x21650f[_0xc954('0x6e')]];this[_0xc954('0x9')][_0x21650f['transfereeuniqueid']]=_0x133539;}}}catch(_0x3cebd9){logger[_0xc954('0x33')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0xc954('0x48')](_0x3cebd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc954('0x1f')]=function(_0x46401f){try{if(this[_0xc954('0x22')](_0x46401f)){if(this[_0xc954('0x9')][_0x46401f['transfereeuniqueid']]){for(var _0x1778c1 in this[_0xc954('0x9')][_0x46401f['transfereeuniqueid']]){if(this[_0xc954('0x9')][_0x46401f[_0xc954('0x6e')]][_0xc954('0x36')](_0x1778c1)){if(_0x46401f[_0xc954('0x73')]===_0x1778c1){var _0x4f7890=moment();this[_0xc954('0x9')][_0x46401f[_0xc954('0x6e')]][_0x1778c1][_0xc954('0x13')]=!![];this[_0xc954('0x9')][_0x46401f[_0xc954('0x6e')]][_0x1778c1][_0xc954('0x4f')]=_0x4f7890;this[_0xc954('0x9')][_0x46401f['transfereeuniqueid']][_0x1778c1][_0xc954('0x42')]=_0xc954('0x52');this['channels'][_0x46401f[_0xc954('0x6e')]][_0x1778c1][_0xc954('0x37')]=_0xc954('0x50');this[_0xc954('0x9')][_0x46401f[_0xc954('0x6e')]][_0x1778c1][_0xc954('0x51')]=_0x4f7890[_0xc954('0x70')](this['channels'][_0x46401f['transfereeuniqueid']][_0x1778c1][_0xc954('0x74')],'seconds');}}}}}}catch(_0x19efe2){logger['error'](_0xc954('0x75'),util[_0xc954('0x48')](_0x19efe2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')]['syncMusicOnHoldStart']=function(_0x48b0ef){var _0x33185c='';try{if(this[_0xc954('0x22')](_0x48b0ef)){if(_0x48b0ef[_0xc954('0x76')]){_0x33185c=_0x48b0ef[_0xc954('0x76')][_0xc954('0x77')](0x0,_0x48b0ef[_0xc954('0x76')][_0xc954('0x78')]('-'));if(this['agents'][_0x33185c]){this['agents'][_0x33185c]['onhold']=!![];}}}}catch(_0x536420){logger[_0xc954('0x33')]('[syncMusicOnHoldStart][VoiceAgentReport]',util['inspect'](_0x536420,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc954('0x20')][_0xc954('0x1c')]=function(_0x1d323b){var _0x1bdd91='';try{if(this[_0xc954('0x22')](_0x1d323b)){if(_0x1d323b[_0xc954('0x76')]){_0x1bdd91=_0x1d323b[_0xc954('0x76')][_0xc954('0x77')](0x0,_0x1d323b[_0xc954('0x76')][_0xc954('0x78')]('-'));if(this[_0xc954('0xa')][_0x1bdd91]){this[_0xc954('0xa')][_0x1bdd91][_0xc954('0x79')]=![];}}}}catch(_0x108368){logger[_0xc954('0x33')](_0xc954('0x7a'),util[_0xc954('0x48')](_0x108368,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index d59cb0d..2307e2d 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 _0x510c=['omit','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','isNil','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','prototype','isUndefined','linkedid','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','isNotNull','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','from-sip','split','destconnectedlinenum','exten','emit','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','disposition','includes','lastapplication','lastdata','set','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','inspect','answered','answertime','xcally-motion-preview','connectedlinenum','calleridname','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','monitorFilename','monitors','push','value','xmd-phone','calleridnum','variable','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','mixmonitor_filename','parse','sipcalllinkedid','diff','billableseconds','holdtime','context'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x510c,0x152));var _0xc510=function(_0x73a86,_0x42e676){_0x73a86=_0x73a86-0x0;var _0x5910ab=_0x510c[_0x73a86];return _0x5910ab;};'use strict';var BPromise=require(_0xc510('0x0'));var _=require('lodash');var moment=require(_0xc510('0x1'));var util=require(_0xc510('0x2'));var path=require(_0xc510('0x3'));var Redis=require(_0xc510('0x4'));var config=require(_0xc510('0x5'));var logger=require(_0xc510('0x6'))(_0xc510('0x7'));var ami=require(_0xc510('0x8'));var Channel=require('../model/channel');var statusDesc=[_0xc510('0x9'),_0xc510('0xa'),_0xc510('0xb'),_0xc510('0xc'),'invalid',_0xc510('0xd'),_0xc510('0xe'),_0xc510('0xf'),'onhold'];var applications=['set',_0xc510('0x10'),_0xc510('0x11'),'dial',_0xc510('0x12'),_0xc510('0x13')];var dispositions=[_0xc510('0x14'),_0xc510('0x15'),_0xc510('0x15'),'NO\x20ANSWER',_0xc510('0x14'),_0xc510('0x14'),_0xc510('0x16'),_0xc510('0x17'),'FAILED','FAILED',_0xc510('0x15')];var actions={};config['redis']=_[_0xc510('0x18')](config[_0xc510('0x19')],{'host':_0xc510('0x1a'),'port':0x18eb});var io=require(_0xc510('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x563f51){this[_0xc510('0x1c')]=_0x563f51['channels'];this[_0xc510('0x1d')]=_0x563f51[_0xc510('0x1d')];ami['on'](_0xc510('0x1e'),this[_0xc510('0x1f')][_0xc510('0x20')](this));ami['on'](_0xc510('0x21'),this[_0xc510('0x1f')][_0xc510('0x20')](this));ami['on'](_0xc510('0x22'),this[_0xc510('0x23')][_0xc510('0x20')](this));ami['on']('newstate',this[_0xc510('0x24')]['bind'](this));ami['on'](_0xc510('0x25'),this[_0xc510('0x26')][_0xc510('0x20')](this));ami['on'](_0xc510('0x27'),this[_0xc510('0x28')][_0xc510('0x20')](this));ami['on'](_0xc510('0x29'),this[_0xc510('0x2a')][_0xc510('0x20')](this));ami['on'](_0xc510('0x2b'),this['syncAttendedTransfer'][_0xc510('0x20')](this));ami['on']('blindtransfer',this[_0xc510('0x2c')][_0xc510('0x20')](this));ami['on'](_0xc510('0x2d'),this['syncMusicOnHoldStart'][_0xc510('0x20')](this));ami['on'](_0xc510('0x2e'),this[_0xc510('0x2f')]['bind'](this));return BPromise[_0xc510('0x30')]()[_0xc510('0x31')](ami[_0xc510('0x32')]())[_0xc510('0x33')](function(_0x48bf8a){console['log'](_0x48bf8a);});}VoiceCallReport[_0xc510('0x34')]['isNotNull']=function(_0x36d23a){return _0x36d23a!==null&&!_[_0xc510('0x35')](_0x36d23a);};VoiceCallReport[_0xc510('0x34')]['emit']=function(_0x59b2ce,_0x1227e3,_0x2e5bd0){io['to'](_0x59b2ce)['emit'](_0x1227e3,_0x2e5bd0);};VoiceCallReport[_0xc510('0x34')][_0xc510('0x2a')]=function(_0x2ea220){try{if(this['isNotNull'](_0x2ea220)){if(_0x2ea220['uniqueid']===_0x2ea220[_0xc510('0x36')]){if(!_[_0xc510('0x35')](this[_0xc510('0x1c')][_0x2ea220[_0xc510('0x37')]])){_[_0xc510('0x38')](this[_0xc510('0x1c')][_0x2ea220[_0xc510('0x37')]],_[_0xc510('0x39')](_0x2ea220,_[_0xc510('0x3a')](this['channels'][_0x2ea220['uniqueid']])));}}}}catch(_0xb85072){logger[_0xc510('0x3b')](_0xc510('0x3c'),util['inspect'](_0xb85072,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')]['syncNewChannel']=function(_0x187feb){try{if(this[_0xc510('0x3d')](_0x187feb)){if(_0x187feb[_0xc510('0x37')]===_0x187feb[_0xc510('0x36')]&&_0x187feb[_0xc510('0x3e')]!=_0xc510('0x3f')){if(_[_0xc510('0x35')](this[_0xc510('0x1c')][_0x187feb['uniqueid']])){this['channels'][_0x187feb[_0xc510('0x37')]]=new Channel();this[_0xc510('0x1c')][_0x187feb[_0xc510('0x37')]]['starttime']=moment()[_0xc510('0x40')](_0xc510('0x41'));this[_0xc510('0x1c')][_0x187feb[_0xc510('0x37')]]['disposition']=dispositions[_[_0xc510('0x42')](_0x187feb[_0xc510('0x43')])];_[_0xc510('0x38')](this[_0xc510('0x1c')][_0x187feb[_0xc510('0x37')]],_[_0xc510('0x39')](_0x187feb,_[_0xc510('0x3a')](this[_0xc510('0x1c')][_0x187feb[_0xc510('0x37')]])));if(_0x187feb['context']===_0xc510('0x44')){if(this[_0xc510('0x1d')][_0x187feb['channel'][_0xc510('0x45')]('-')[0x0]]){this['agents'][_0x187feb['channel'][_0xc510('0x45')]('-')[0x0]][_0xc510('0x46')]=_0x187feb[_0xc510('0x47')];this[_0xc510('0x48')](util['format']('user:%s',this[_0xc510('0x1d')][_0x187feb[_0xc510('0x3e')]['split']('-')[0x0]][_0xc510('0x49')]),_0xc510('0x4a'),{'destaccountcode':this[_0xc510('0x1d')][_0x187feb[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]][_0xc510('0x4b')],'destconnectedlinenum':_0x187feb[_0xc510('0x47')]});}}}}}}catch(_0x536133){logger[_0xc510('0x3b')](_0xc510('0x4c'),util['inspect'](_0x536133,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')]['syncNewExten']=function(_0x30e8f4){try{if(this[_0xc510('0x3d')](_0x30e8f4)){if(_0x30e8f4['uniqueid']===_0x30e8f4['linkedid']&&_0x30e8f4[_0xc510('0x47')]!='h'&&_0x30e8f4[_0xc510('0x3e')]!=_0xc510('0x3f')){_0x30e8f4[_0xc510('0x4d')]=_0x30e8f4['application'][_0xc510('0x4e')]();_0x30e8f4[_0xc510('0x4f')]=(_0x30e8f4[_0xc510('0x50')]||_0x30e8f4[_0xc510('0x4f')])['toLowerCase']();if(_['isUndefined'](this[_0xc510('0x1c')][_0x30e8f4['uniqueid']])){this[_0xc510('0x1c')][_0x30e8f4[_0xc510('0x37')]]=new Channel();this[_0xc510('0x1c')][_0x30e8f4[_0xc510('0x37')]][_0xc510('0x51')]=_0x30e8f4[_0xc510('0x52')]?moment()[_0xc510('0x53')](moment[_0xc510('0x52')](_0x30e8f4[_0xc510('0x52')])[_0xc510('0x54')](),_0xc510('0x54'))[_0xc510('0x40')](_0xc510('0x41')):moment()[_0xc510('0x40')](_0xc510('0x41'));this['channels'][_0x30e8f4[_0xc510('0x37')]][_0xc510('0x55')]=_0xc510('0x14');}_[_0xc510('0x38')](this[_0xc510('0x1c')][_0x30e8f4['uniqueid']],_[_0xc510('0x39')](_0x30e8f4,_[_0xc510('0x3a')](this['channels'][_0x30e8f4[_0xc510('0x37')]])));if(_[_0xc510('0x56')](applications,_0x30e8f4['application'])){this[_0xc510('0x1c')][_0x30e8f4[_0xc510('0x37')]][_0xc510('0x57')]=_0x30e8f4[_0xc510('0x4d')];this[_0xc510('0x1c')][_0x30e8f4[_0xc510('0x37')]][_0xc510('0x58')]=_0x30e8f4[_0xc510('0x4f')];if(_0x30e8f4[_0xc510('0x4d')]===_0xc510('0x59')&&_[_0xc510('0x5a')](_0x30e8f4[_0xc510('0x4f')],_0xc510('0x5b'))){var _0x11e48c=_0x30e8f4[_0xc510('0x4f')][_0xc510('0x45')]('=');var _0x5e1b4e=_0x11e48c[0x0][_0xc510('0x5c')](/cdr\((.*)\)/);if(_0x5e1b4e){this['channels'][_0x30e8f4[_0xc510('0x37')]][_0x5e1b4e[0x1]]=_0x11e48c[0x1];}}else if(_0x30e8f4[_0xc510('0x4d')]===_0xc510('0x10')){this[_0xc510('0x1c')][_0x30e8f4[_0xc510('0x37')]][_0xc510('0x10')]=_0x30e8f4['applicationdata']['split'](',')[0x0];}}}}}catch(_0x34c912){logger[_0xc510('0x3b')](_0xc510('0x5d'),util[_0xc510('0x5e')](_0x34c912,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')][_0xc510('0x24')]=function(_0x56f55f){try{if(this['isNotNull'](_0x56f55f)){if(_0x56f55f[_0xc510('0x37')]!==_0x56f55f[_0xc510('0x36')]){if(this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]]){if(_0x56f55f[_0xc510('0x43')]==='6'){if(!this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x5f')]){var _0x273d8d=moment();this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x5f')]=!![];this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x60')]=_0x273d8d[_0xc510('0x40')](_0xc510('0x41'));if(this['channels'][_0x56f55f[_0xc510('0x36')]]['starttime']){this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]]['holdtime']=_0x273d8d['diff'](this['channels'][_0x56f55f[_0xc510('0x36')]]['starttime'],'seconds');}}this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x36')]=_0x56f55f[_0xc510('0x37')];if(_0x56f55f['calleridnum']!==_0xc510('0x61')){this[_0xc510('0x1c')][_0x56f55f['linkedid']][_0xc510('0x62')]=_0x56f55f['calleridnum'];}this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]]['connectedlinename']=_0x56f55f[_0xc510('0x63')];this['channels'][_0x56f55f[_0xc510('0x36')]]['destinationchannel']=_0x56f55f[_0xc510('0x3e')];this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x55')]=dispositions[_[_0xc510('0x42')](_0x56f55f['channelstate'])];if(this[_0xc510('0x1d')][_0x56f55f['channel']['split']('-')[0x0]]){this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x64')]=this[_0xc510('0x1d')][_0x56f55f[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]]['id'];this[_0xc510('0x1c')][_0x56f55f[_0xc510('0x36')]][_0xc510('0x65')]=this['agents'][_0x56f55f[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x56f55f[_0xc510('0x37')]]){if(_0x56f55f[_0xc510('0x43')]==='6'){if(this[_0xc510('0x1d')][_0x56f55f[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]]){this[_0xc510('0x1c')][_0x56f55f['uniqueid']][_0xc510('0x64')]=this['agents'][_0x56f55f[_0xc510('0x3e')]['split']('-')[0x0]]['id'];this['channels'][_0x56f55f[_0xc510('0x37')]][_0xc510('0x65')]=this[_0xc510('0x1d')][_0x56f55f[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]][_0xc510('0x49')];}}}}}}catch(_0x2919e5){logger[_0xc510('0x3b')](_0xc510('0x66'),util[_0xc510('0x5e')](_0x2919e5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')][_0xc510('0x67')]=function(_0x3a898a,_0x1b1af5){if(this[_0xc510('0x1c')][_0x3a898a]){this[_0xc510('0x1c')][_0x3a898a][_0xc510('0x68')]=!![];if(_[_0xc510('0x69')](_0x1b1af5,_0xc510('0x6a'))){_0x1b1af5=_0x1b1af5['replace']('.wav49','.WAV');}this[_0xc510('0x1c')][_0x3a898a][_0xc510('0x6b')]=_0x1b1af5;var _0x509d34=_['find'](this[_0xc510('0x1c')][_0x3a898a][_0xc510('0x6c')],{'filename':_0x1b1af5});if(_['isNil'](_0x509d34)){this[_0xc510('0x1c')][_0x3a898a][_0xc510('0x6c')][_0xc510('0x6d')]({'filename':_0x1b1af5,'createdAt':moment()[_0xc510('0x40')](_0xc510('0x41')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xc510('0x34')][_0xc510('0x26')]=function(_0x2cbb83){try{if(this[_0xc510('0x3d')](_0x2cbb83)){if(this[_0xc510('0x1c')][_0x2cbb83[_0xc510('0x37')]]&&_0x2cbb83[_0xc510('0x3e')]!='OutgoingSpoolFailed'){if(this[_0xc510('0x3d')](_0x2cbb83['variable'])){if(this[_0xc510('0x3d')](_0x2cbb83['variable']['mixmonitor_filename'])){this[_0xc510('0x67')](_0x2cbb83[_0xc510('0x37')],_0x2cbb83[_0xc510('0x6e')]);}else if(this['isNotNull'](_0x2cbb83['variable'][_0xc510('0x6f')])){this['channels'][_0x2cbb83[_0xc510('0x37')]][_0xc510('0x70')]=_0x2cbb83['value'];}else if(this['isNotNull'](_0x2cbb83[_0xc510('0x71')][_0xc510('0x72')])){this[_0xc510('0x1c')][_0x2cbb83[_0xc510('0x37')]][_0xc510('0x73')]=_0x2cbb83[_0xc510('0x6e')];}else if(this[_0xc510('0x3d')](_0x2cbb83[_0xc510('0x71')][_0xc510('0x74')])){this[_0xc510('0x1c')][_0x2cbb83[_0xc510('0x37')]][_0xc510('0x75')]=_0x2cbb83[_0xc510('0x6e')];}else if(this[_0xc510('0x3d')](_0x2cbb83[_0xc510('0x71')][_0xc510('0x76')])){this['channels'][_0x2cbb83[_0xc510('0x37')]]['queue']=_0x2cbb83['value'][_0xc510('0x45')](',')[0x0];}else if(this['isNotNull'](_0x2cbb83[_0xc510('0x71')][_0xc510('0x77')])){this['channels'][_0x2cbb83[_0xc510('0x37')]][_0xc510('0x78')]=_0x2cbb83[_0xc510('0x6e')];}else if(this['isNotNull'](_0x2cbb83['variable']['xmd-destination'])){this[_0xc510('0x1c')][_0x2cbb83['uniqueid']][_0xc510('0x79')]=_0x2cbb83['value'];}else if(this['isNotNull'](_0x2cbb83[_0xc510('0x71')][_0xc510('0x7a')])){this['channels'][_0x2cbb83[_0xc510('0x37')]][_0xc510('0x7b')]=_0x2cbb83['value'];}else if(this[_0xc510('0x3d')](_0x2cbb83[_0xc510('0x71')][_0xc510('0x7c')])){this[_0xc510('0x1c')][_0x2cbb83['uniqueid']][_0xc510('0x10')]=_0x2cbb83[_0xc510('0x6e')];}else if(this[_0xc510('0x3d')](_0x2cbb83[_0xc510('0x71')][_0xc510('0x7d')])){this[_0xc510('0x1c')][_0x2cbb83[_0xc510('0x37')]]['sipcalluniqueid']=_0x2cbb83[_0xc510('0x6e')];}}}else if(this[_0xc510('0x3d')](_0x2cbb83[_0xc510('0x71')][_0xc510('0x7e')])){if(_0x2cbb83[_0xc510('0x6e')]){var _0x4bcf08=path[_0xc510('0x7f')](_0x2cbb83[_0xc510('0x6e')])[_0xc510('0x49')];this[_0xc510('0x67')](_0x4bcf08,_0x2cbb83[_0xc510('0x6e')]);}}else if(this[_0xc510('0x1c')][_0x2cbb83['linkedid']]){if(this['isNotNull'](_0x2cbb83[_0xc510('0x71')])){if(this[_0xc510('0x3d')](_0x2cbb83['variable']['sipcallid'])){this[_0xc510('0x1c')][_0x2cbb83[_0xc510('0x36')]][_0xc510('0x80')]=_0x2cbb83[_0xc510('0x6e')];}}}}}catch(_0x211bb1){logger['error']('[syncVarSet][VoiceCallReport]',util[_0xc510('0x5e')](_0x211bb1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')]['syncHangup']=function(_0x3128c6){try{if(this[_0xc510('0x3d')](_0x3128c6)){if(this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]]){var _0x23ee2c=moment();this[_0xc510('0x1c')][_0x3128c6['uniqueid']]['endtime']=_0x23ee2c[_0xc510('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3128c6[_0xc510('0x37')]][_0xc510('0x52')]=_0x23ee2c[_0xc510('0x81')](this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]][_0xc510('0x51')],_0xc510('0x54'));if(this['channels'][_0x3128c6[_0xc510('0x37')]]['answered']){this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]][_0xc510('0x82')]=_0x23ee2c[_0xc510('0x81')](this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]][_0xc510('0x60')],_0xc510('0x54'));this['channels'][_0x3128c6[_0xc510('0x37')]][_0xc510('0x83')]=this['channels'][_0x3128c6[_0xc510('0x37')]][_0xc510('0x52')]-this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]]['billableseconds'];}if(_0x3128c6[_0xc510('0x84')]===_0xc510('0x44')){if(this['agents'][_0x3128c6[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]]){this[_0xc510('0x1d')][_0x3128c6[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]]=_[_0xc510('0x85')](this[_0xc510('0x1d')][_0x3128c6['channel'][_0xc510('0x45')]('-')[0x0]],[_0xc510('0x46')]);this['emit'](util[_0xc510('0x40')]('user:%s',this[_0xc510('0x1d')][_0x3128c6['channel'][_0xc510('0x45')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0xc510('0x1d')][_0x3128c6[_0xc510('0x3e')][_0xc510('0x45')]('-')[0x0]][_0xc510('0x4b')]});}}ami[_0xc510('0x48')](_0xc510('0x86'),this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]]);delete this[_0xc510('0x1c')][_0x3128c6[_0xc510('0x37')]];}}}catch(_0x3c3a9c){logger['error'](_0xc510('0x87'),util['inspect'](_0x3c3a9c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc510('0x88')]=function(_0x162671){try{if(this[_0xc510('0x3d')](_0x162671)){if(this['channels'][_0x162671[_0xc510('0x89')]]){this[_0xc510('0x1c')][_0x162671[_0xc510('0x89')]][_0xc510('0x8a')]=_0x162671[_0xc510('0x8b')];this[_0xc510('0x1c')][_0x162671[_0xc510('0x89')]][_0xc510('0x8c')]=_0x162671[_0xc510('0x8d')];if(this[_0xc510('0x1c')][_0x162671[_0xc510('0x8e')]]){var _0x5895fe=this['channels'][_0x162671[_0xc510('0x8e')]];this[_0xc510('0x1c')][_0x162671[_0xc510('0x8e')]]=this[_0xc510('0x1c')][_0x162671[_0xc510('0x89')]];this['channels'][_0x162671[_0xc510('0x89')]]=_0x5895fe;}}else if(this[_0xc510('0x1c')][_0x162671['transfertargetuniqueid']]){this[_0xc510('0x1c')][_0x162671[_0xc510('0x8f')]]['transfercalleridnum']=_0x162671['origtransferercalleridnum'];this[_0xc510('0x1c')][_0x162671[_0xc510('0x8f')]][_0xc510('0x8c')]=_0x162671[_0xc510('0x8d')];if(this[_0xc510('0x1c')][_0x162671[_0xc510('0x90')]]){var _0x5895fe=this[_0xc510('0x1c')][_0x162671[_0xc510('0x90')]];this[_0xc510('0x1c')][_0x162671[_0xc510('0x90')]]=this[_0xc510('0x1c')][_0x162671[_0xc510('0x8f')]];this['channels'][_0x162671[_0xc510('0x8f')]]=_0x5895fe;}}}}catch(_0x38d7e7){logger[_0xc510('0x3b')](_0xc510('0x91'),util[_0xc510('0x5e')](_0x38d7e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')]['syncBlindTransfer']=function(_0x225bd4){try{if(this[_0xc510('0x3d')](_0x225bd4)){if(this['channels'][_0x225bd4['transfereeuniqueid']]){this[_0xc510('0x1c')][_0x225bd4['transfereeuniqueid']][_0xc510('0x8a')]=_0x225bd4['transfereecalleridnum'];this['channels'][_0x225bd4[_0xc510('0x89')]][_0xc510('0x8c')]=_0x225bd4[_0xc510('0x92')];this[_0xc510('0x28')]({'event':_0xc510('0x93'),'uniqueid':_0x225bd4[_0xc510('0x89')],'context':_0x225bd4[_0xc510('0x84')],'channel':_0x225bd4[_0xc510('0x94')]});}}}catch(_0x37168d){logger['error'](_0xc510('0x95'),util[_0xc510('0x5e')](_0x37168d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc510('0x96')]=function(_0x21ccaf){try{if(this[_0xc510('0x3d')](_0x21ccaf)){if(this[_0xc510('0x1c')][_0x21ccaf[_0xc510('0x37')]]){if(!_[_0xc510('0x97')](this[_0xc510('0x1c')][_0x21ccaf[_0xc510('0x37')]][_0xc510('0x60')])){this[_0xc510('0x1c')][_0x21ccaf[_0xc510('0x37')]]['mohstarttime']=moment()[_0xc510('0x40')](_0xc510('0x41'));}}}}catch(_0x377f13){logger['error'](_0xc510('0x98'),util[_0xc510('0x5e')](_0x377f13,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc510('0x34')]['syncMusicOnHoldStop']=function(_0x4faaa4){try{if(this[_0xc510('0x3d')](_0x4faaa4)){if(this[_0xc510('0x1c')][_0x4faaa4[_0xc510('0x37')]]){if(!_[_0xc510('0x97')](this[_0xc510('0x1c')][_0x4faaa4[_0xc510('0x37')]][_0xc510('0x99')])){this[_0xc510('0x1c')][_0x4faaa4[_0xc510('0x37')]][_0xc510('0x9a')]+=moment()['milliseconds'](0x0)['diff'](this[_0xc510('0x1c')][_0x4faaa4[_0xc510('0x37')]][_0xc510('0x99')],_0xc510('0x54'));delete this['channels'][_0x4faaa4[_0xc510('0x37')]][_0xc510('0x99')];}}}}catch(_0xd4b064){logger['error'](_0xc510('0x9b'),util[_0xc510('0x5e')](_0xd4b064,{'showHidden':![],'depth':null}));}};module[_0xc510('0x9c')]=VoiceCallReport; \ No newline at end of file +var _0x1f11=['newchannel','syncNewChannel','varset','syncVarSet','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','catch','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','error','[syncNewCallerId][VoiceCallReport]','inspect','starttime','format','disposition','toNumber','context','from-sip','channel','split','destconnectedlinenum','exten','user:%s','name','accountcode','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','keys','includes','set','cdr(','match','syncNewState','channelstate','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','callerid','xmd-cdrtype','type','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','syncHangup','endtime','billableseconds','holdtime','omit','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','not_inuse','busy','invalid','ringinuse','onhold','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten'];(function(_0x1a57e8,_0x2497a9){var _0x36c02e=function(_0xc02177){while(--_0xc02177){_0x1a57e8['push'](_0x1a57e8['shift']());}};_0x36c02e(++_0x2497a9);}(_0x1f11,0x74));var _0x11f1=function(_0x2d0cdd,_0x5b25b4){_0x2d0cdd=_0x2d0cdd-0x0;var _0x30ba3a=_0x1f11[_0x2d0cdd];return _0x30ba3a;};'use strict';var BPromise=require('bluebird');var _=require(_0x11f1('0x0'));var moment=require(_0x11f1('0x1'));var util=require(_0x11f1('0x2'));var path=require(_0x11f1('0x3'));var Redis=require(_0x11f1('0x4'));var config=require(_0x11f1('0x5'));var logger=require(_0x11f1('0x6'))(_0x11f1('0x7'));var ami=require(_0x11f1('0x8'));var Channel=require('../model/channel');var statusDesc=[_0x11f1('0x9'),_0x11f1('0xa'),'inuse',_0x11f1('0xb'),_0x11f1('0xc'),'unavailable','ringing',_0x11f1('0xd'),_0x11f1('0xe')];var applications=['set',_0x11f1('0xf'),_0x11f1('0x10'),_0x11f1('0x11'),_0x11f1('0x12'),_0x11f1('0x13')];var dispositions=[_0x11f1('0x14'),_0x11f1('0x15'),_0x11f1('0x15'),_0x11f1('0x14'),_0x11f1('0x14'),'NO\x20ANSWER',_0x11f1('0x16'),_0x11f1('0x17'),_0x11f1('0x15'),_0x11f1('0x15'),'FAILED'];var actions={};config[_0x11f1('0x18')]=_[_0x11f1('0x19')](config[_0x11f1('0x18')],{'host':_0x11f1('0x1a'),'port':0x18eb});var io=require(_0x11f1('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x5f2b51){this[_0x11f1('0x1c')]=_0x5f2b51['channels'];this[_0x11f1('0x1d')]=_0x5f2b51[_0x11f1('0x1d')];ami['on'](_0x11f1('0x1e'),this[_0x11f1('0x1f')][_0x11f1('0x20')](this));ami['on'](_0x11f1('0x21'),this[_0x11f1('0x1f')][_0x11f1('0x20')](this));ami['on'](_0x11f1('0x22'),this[_0x11f1('0x23')]['bind'](this));ami['on']('newstate',this['syncNewState'][_0x11f1('0x20')](this));ami['on'](_0x11f1('0x24'),this[_0x11f1('0x25')][_0x11f1('0x20')](this));ami['on']('hangup',this['syncHangup'][_0x11f1('0x20')](this));ami['on']('newcallerid',this[_0x11f1('0x26')][_0x11f1('0x20')](this));ami['on'](_0x11f1('0x27'),this[_0x11f1('0x28')][_0x11f1('0x20')](this));ami['on'](_0x11f1('0x29'),this['syncBlindTransfer']['bind'](this));ami['on']('musiconholdstart',this[_0x11f1('0x2a')]['bind'](this));ami['on'](_0x11f1('0x2b'),this[_0x11f1('0x2c')][_0x11f1('0x20')](this));return BPromise['resolve']()[_0x11f1('0x2d')](ami['actionCoreShowChannels']())[_0x11f1('0x2e')](function(_0x17cfb1){console['log'](_0x17cfb1);});}VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x30')]=function(_0x2258b8){return _0x2258b8!==null&&!_[_0x11f1('0x31')](_0x2258b8);};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x32')]=function(_0x5caf47,_0x2834d7,_0x438daf){io['to'](_0x5caf47)[_0x11f1('0x32')](_0x2834d7,_0x438daf);};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x26')]=function(_0x347cd7){try{if(this[_0x11f1('0x30')](_0x347cd7)){if(_0x347cd7[_0x11f1('0x33')]===_0x347cd7[_0x11f1('0x34')]){if(!_['isUndefined'](this[_0x11f1('0x1c')][_0x347cd7[_0x11f1('0x33')]])){_[_0x11f1('0x35')](this[_0x11f1('0x1c')][_0x347cd7[_0x11f1('0x33')]],_[_0x11f1('0x36')](_0x347cd7,_['keys'](this['channels'][_0x347cd7['uniqueid']])));}}}}catch(_0x3dd7f5){logger[_0x11f1('0x37')](_0x11f1('0x38'),util[_0x11f1('0x39')](_0x3dd7f5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x8ca7f){try{if(this['isNotNull'](_0x8ca7f)){if(_0x8ca7f['uniqueid']===_0x8ca7f[_0x11f1('0x34')]&&_0x8ca7f['channel']!='OutgoingSpoolFailed'){if(_[_0x11f1('0x31')](this['channels'][_0x8ca7f[_0x11f1('0x33')]])){this[_0x11f1('0x1c')][_0x8ca7f[_0x11f1('0x33')]]=new Channel();this[_0x11f1('0x1c')][_0x8ca7f[_0x11f1('0x33')]][_0x11f1('0x3a')]=moment()[_0x11f1('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x11f1('0x1c')][_0x8ca7f[_0x11f1('0x33')]][_0x11f1('0x3c')]=dispositions[_[_0x11f1('0x3d')](_0x8ca7f['channelstate'])];_[_0x11f1('0x35')](this[_0x11f1('0x1c')][_0x8ca7f[_0x11f1('0x33')]],_['pick'](_0x8ca7f,_['keys'](this['channels'][_0x8ca7f[_0x11f1('0x33')]])));if(_0x8ca7f[_0x11f1('0x3e')]===_0x11f1('0x3f')){if(this[_0x11f1('0x1d')][_0x8ca7f[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]]){this[_0x11f1('0x1d')][_0x8ca7f[_0x11f1('0x40')]['split']('-')[0x0]][_0x11f1('0x42')]=_0x8ca7f[_0x11f1('0x43')];this[_0x11f1('0x32')](util[_0x11f1('0x3b')](_0x11f1('0x44'),this[_0x11f1('0x1d')][_0x8ca7f[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]][_0x11f1('0x45')]),'user:agentconnect',{'destaccountcode':this[_0x11f1('0x1d')][_0x8ca7f[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]][_0x11f1('0x46')],'destconnectedlinenum':_0x8ca7f[_0x11f1('0x43')]});}}}}}}catch(_0x169c94){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x11f1('0x39')](_0x169c94,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x1f')]=function(_0x2d1241){try{if(this[_0x11f1('0x30')](_0x2d1241)){if(_0x2d1241[_0x11f1('0x33')]===_0x2d1241[_0x11f1('0x34')]&&_0x2d1241['exten']!='h'&&_0x2d1241['channel']!=_0x11f1('0x47')){_0x2d1241[_0x11f1('0x48')]=_0x2d1241[_0x11f1('0x48')][_0x11f1('0x49')]();_0x2d1241[_0x11f1('0x4a')]=(_0x2d1241[_0x11f1('0x4b')]||_0x2d1241[_0x11f1('0x4a')])[_0x11f1('0x49')]();if(_[_0x11f1('0x31')](this['channels'][_0x2d1241[_0x11f1('0x33')]])){this['channels'][_0x2d1241['uniqueid']]=new Channel();this[_0x11f1('0x1c')][_0x2d1241[_0x11f1('0x33')]][_0x11f1('0x3a')]=_0x2d1241[_0x11f1('0x4c')]?moment()['subtract'](moment[_0x11f1('0x4c')](_0x2d1241['duration'])[_0x11f1('0x4d')](),_0x11f1('0x4d'))['format'](_0x11f1('0x4e')):moment()['format'](_0x11f1('0x4e'));this['channels'][_0x2d1241[_0x11f1('0x33')]][_0x11f1('0x3c')]=_0x11f1('0x14');}_['merge'](this['channels'][_0x2d1241[_0x11f1('0x33')]],_[_0x11f1('0x36')](_0x2d1241,_[_0x11f1('0x4f')](this[_0x11f1('0x1c')][_0x2d1241[_0x11f1('0x33')]])));if(_[_0x11f1('0x50')](applications,_0x2d1241[_0x11f1('0x48')])){this[_0x11f1('0x1c')][_0x2d1241[_0x11f1('0x33')]]['lastapplication']=_0x2d1241['application'];this['channels'][_0x2d1241[_0x11f1('0x33')]]['lastdata']=_0x2d1241[_0x11f1('0x4a')];if(_0x2d1241[_0x11f1('0x48')]===_0x11f1('0x51')&&_['startsWith'](_0x2d1241['applicationdata'],_0x11f1('0x52'))){var _0x5455c4=_0x2d1241['applicationdata'][_0x11f1('0x41')]('=');var _0x1465ac=_0x5455c4[0x0][_0x11f1('0x53')](/cdr\((.*)\)/);if(_0x1465ac){this[_0x11f1('0x1c')][_0x2d1241[_0x11f1('0x33')]][_0x1465ac[0x1]]=_0x5455c4[0x1];}}else if(_0x2d1241[_0x11f1('0x48')]===_0x11f1('0xf')){this['channels'][_0x2d1241['uniqueid']][_0x11f1('0xf')]=_0x2d1241['applicationdata'][_0x11f1('0x41')](',')[0x0];}}}}}catch(_0x2016e5){logger[_0x11f1('0x37')]('[syncNewExten][VoiceCallReport]',util[_0x11f1('0x39')](_0x2016e5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x11f1('0x54')]=function(_0x17c2cf){try{if(this[_0x11f1('0x30')](_0x17c2cf)){if(_0x17c2cf[_0x11f1('0x33')]!==_0x17c2cf['linkedid']){if(this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]]){if(_0x17c2cf[_0x11f1('0x55')]==='6'){if(!this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x56')]){var _0x5aa1a7=moment();this[_0x11f1('0x1c')][_0x17c2cf['linkedid']][_0x11f1('0x56')]=!![];this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x57')]=_0x5aa1a7[_0x11f1('0x3b')](_0x11f1('0x4e'));if(this[_0x11f1('0x1c')][_0x17c2cf['linkedid']]['starttime']){this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]]['holdtime']=_0x5aa1a7[_0x11f1('0x58')](this['channels'][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x3a')],_0x11f1('0x4d'));}}this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x34')]=_0x17c2cf[_0x11f1('0x33')];if(_0x17c2cf[_0x11f1('0x59')]!==_0x11f1('0x5a')){this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x5b')]=_0x17c2cf[_0x11f1('0x59')];}this['channels'][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x5c')]=_0x17c2cf[_0x11f1('0x5d')];this[_0x11f1('0x1c')][_0x17c2cf['linkedid']]['destinationchannel']=_0x17c2cf['channel'];this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]]['disposition']=dispositions[_[_0x11f1('0x3d')](_0x17c2cf['channelstate'])];if(this[_0x11f1('0x1d')][_0x17c2cf[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]]){this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]]['UserId']=this[_0x11f1('0x1d')][_0x17c2cf[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]]['id'];this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x34')]][_0x11f1('0x5e')]=this[_0x11f1('0x1d')][_0x17c2cf['channel'][_0x11f1('0x41')]('-')[0x0]][_0x11f1('0x45')];}}}}else{if(this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x33')]]){if(_0x17c2cf['channelstate']==='6'){if(this[_0x11f1('0x1d')][_0x17c2cf[_0x11f1('0x40')]['split']('-')[0x0]]){this[_0x11f1('0x1c')][_0x17c2cf[_0x11f1('0x33')]]['UserId']=this[_0x11f1('0x1d')][_0x17c2cf['channel'][_0x11f1('0x41')]('-')[0x0]]['id'];this['channels'][_0x17c2cf[_0x11f1('0x33')]][_0x11f1('0x5e')]=this[_0x11f1('0x1d')][_0x17c2cf[_0x11f1('0x40')]['split']('-')[0x0]][_0x11f1('0x45')];}}}}}}catch(_0x3e40ba){logger[_0x11f1('0x37')](_0x11f1('0x5f'),util['inspect'](_0x3e40ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x60')]=function(_0x470d5e,_0x1e88b2){if(this[_0x11f1('0x1c')][_0x470d5e]){this['channels'][_0x470d5e]['monitor']=!![];if(_[_0x11f1('0x61')](_0x1e88b2,_0x11f1('0x62'))){_0x1e88b2=_0x1e88b2[_0x11f1('0x63')](_0x11f1('0x62'),_0x11f1('0x64'));}this[_0x11f1('0x1c')][_0x470d5e][_0x11f1('0x65')]=_0x1e88b2;var _0x1202ca=_[_0x11f1('0x66')](this['channels'][_0x470d5e][_0x11f1('0x67')],{'filename':_0x1e88b2});if(_[_0x11f1('0x68')](_0x1202ca)){this[_0x11f1('0x1c')][_0x470d5e][_0x11f1('0x67')][_0x11f1('0x69')]({'filename':_0x1e88b2,'createdAt':moment()[_0x11f1('0x3b')](_0x11f1('0x4e')),'mixmonitorid':'','status':_0x11f1('0x6a')});}}};VoiceCallReport[_0x11f1('0x2f')]['syncVarSet']=function(_0x30193f){try{if(this['isNotNull'](_0x30193f)){if(this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]]&&_0x30193f['channel']!=_0x11f1('0x47')){if(this[_0x11f1('0x30')](_0x30193f['variable'])){if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')][_0x11f1('0x6c')])){this['syncMixMonitorFilename'](_0x30193f[_0x11f1('0x33')],_0x30193f[_0x11f1('0x6d')]);}else if(this[_0x11f1('0x30')](_0x30193f['variable'][_0x11f1('0x6e')])){this['channels'][_0x30193f[_0x11f1('0x33')]][_0x11f1('0x59')]=_0x30193f[_0x11f1('0x6d')];}else if(this['isNotNull'](_0x30193f[_0x11f1('0x6b')]['xmd-callerid'])){this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]][_0x11f1('0x6f')]=_0x30193f[_0x11f1('0x6d')];}else if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')][_0x11f1('0x70')])){this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]][_0x11f1('0x71')]=_0x30193f[_0x11f1('0x6d')];}else if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')]['xmd-queue'])){this[_0x11f1('0x1c')][_0x30193f['uniqueid']][_0x11f1('0xf')]=_0x30193f['value'][_0x11f1('0x41')](',')[0x0];}else if(this['isNotNull'](_0x30193f['variable'][_0x11f1('0x72')])){this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]][_0x11f1('0x73')]=_0x30193f['value'];}else if(this['isNotNull'](_0x30193f[_0x11f1('0x6b')][_0x11f1('0x74')])){this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]]['destination']=_0x30193f['value'];}else if(this[_0x11f1('0x30')](_0x30193f['variable'][_0x11f1('0x75')])){this['channels'][_0x30193f[_0x11f1('0x33')]][_0x11f1('0x76')]=_0x30193f[_0x11f1('0x6d')];}else if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')]['xmcs-queue'])){this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x33')]][_0x11f1('0xf')]=_0x30193f[_0x11f1('0x6d')];}else if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')][_0x11f1('0x77')])){this['channels'][_0x30193f['uniqueid']][_0x11f1('0x78')]=_0x30193f[_0x11f1('0x6d')];}}}else if(this[_0x11f1('0x30')](_0x30193f[_0x11f1('0x6b')]['mixmonitor_filename'])){if(_0x30193f[_0x11f1('0x6d')]){var _0x5df624=path[_0x11f1('0x79')](_0x30193f['value'])[_0x11f1('0x45')];this['syncMixMonitorFilename'](_0x5df624,_0x30193f[_0x11f1('0x6d')]);}}else if(this[_0x11f1('0x1c')][_0x30193f[_0x11f1('0x34')]]){if(this[_0x11f1('0x30')](_0x30193f['variable'])){if(this['isNotNull'](_0x30193f[_0x11f1('0x6b')]['sipcallid'])){this[_0x11f1('0x1c')][_0x30193f['linkedid']]['sipcalllinkedid']=_0x30193f[_0x11f1('0x6d')];}}}}}catch(_0x543d5c){logger['error'](_0x11f1('0x7a'),util[_0x11f1('0x39')](_0x543d5c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x7b')]=function(_0x1be0a8){try{if(this[_0x11f1('0x30')](_0x1be0a8)){if(this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]]){var _0x5debf7=moment();this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x7c')]=_0x5debf7[_0x11f1('0x3b')](_0x11f1('0x4e'));this['channels'][_0x1be0a8['uniqueid']][_0x11f1('0x4c')]=_0x5debf7[_0x11f1('0x58')](this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x3a')],_0x11f1('0x4d'));if(this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x56')]){this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x7d')]=_0x5debf7[_0x11f1('0x58')](this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x57')],_0x11f1('0x4d'));this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x7e')]=this[_0x11f1('0x1c')][_0x1be0a8['uniqueid']][_0x11f1('0x4c')]-this[_0x11f1('0x1c')][_0x1be0a8[_0x11f1('0x33')]][_0x11f1('0x7d')];}if(_0x1be0a8[_0x11f1('0x3e')]===_0x11f1('0x3f')){if(this[_0x11f1('0x1d')][_0x1be0a8[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]]){this[_0x11f1('0x1d')][_0x1be0a8['channel'][_0x11f1('0x41')]('-')[0x0]]=_[_0x11f1('0x7f')](this['agents'][_0x1be0a8[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]],[_0x11f1('0x42')]);this['emit'](util[_0x11f1('0x3b')]('user:%s',this['agents'][_0x1be0a8['channel']['split']('-')[0x0]][_0x11f1('0x45')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x1be0a8[_0x11f1('0x40')][_0x11f1('0x41')]('-')[0x0]][_0x11f1('0x46')]});}}ami['emit'](_0x11f1('0x80'),this[_0x11f1('0x1c')][_0x1be0a8['uniqueid']]);delete this[_0x11f1('0x1c')][_0x1be0a8['uniqueid']];}}}catch(_0xd3f628){logger[_0x11f1('0x37')](_0x11f1('0x81'),util[_0x11f1('0x39')](_0xd3f628,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x28')]=function(_0x2fd4f6){try{if(this['isNotNull'](_0x2fd4f6)){if(this[_0x11f1('0x1c')][_0x2fd4f6['transfereeuniqueid']]){this['channels'][_0x2fd4f6[_0x11f1('0x82')]]['transfercalleridnum']=_0x2fd4f6[_0x11f1('0x83')];this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x82')]][_0x11f1('0x84')]=_0x2fd4f6[_0x11f1('0x85')];if(this[_0x11f1('0x1c')][_0x2fd4f6['secondtransfereruniqueid']]){var _0x210e61=this['channels'][_0x2fd4f6[_0x11f1('0x86')]];this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x86')]]=this[_0x11f1('0x1c')][_0x2fd4f6['transfereeuniqueid']];this[_0x11f1('0x1c')][_0x2fd4f6['transfereeuniqueid']]=_0x210e61;}}else if(this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x87')]]){this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x87')]][_0x11f1('0x88')]=_0x2fd4f6['origtransferercalleridnum'];this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x87')]][_0x11f1('0x84')]=_0x2fd4f6[_0x11f1('0x85')];if(this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x89')]]){var _0x210e61=this['channels'][_0x2fd4f6[_0x11f1('0x89')]];this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x89')]]=this[_0x11f1('0x1c')][_0x2fd4f6['transfertargetuniqueid']];this[_0x11f1('0x1c')][_0x2fd4f6[_0x11f1('0x87')]]=_0x210e61;}}}}catch(_0x1c4e83){logger[_0x11f1('0x37')](_0x11f1('0x8a'),util[_0x11f1('0x39')](_0x1c4e83,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x8b')]=function(_0x4581fc){try{if(this[_0x11f1('0x30')](_0x4581fc)){if(this[_0x11f1('0x1c')][_0x4581fc[_0x11f1('0x82')]]){this['channels'][_0x4581fc[_0x11f1('0x82')]][_0x11f1('0x88')]=_0x4581fc[_0x11f1('0x8c')];this['channels'][_0x4581fc['transfereeuniqueid']][_0x11f1('0x84')]=_0x4581fc[_0x11f1('0x8d')];this[_0x11f1('0x7b')]({'event':_0x11f1('0x8e'),'uniqueid':_0x4581fc[_0x11f1('0x82')],'context':_0x4581fc['context'],'channel':_0x4581fc[_0x11f1('0x8f')]});}}}catch(_0x2750b9){logger[_0x11f1('0x37')](_0x11f1('0x90'),util[_0x11f1('0x39')](_0x2750b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x2a')]=function(_0x52ff7d){try{if(this[_0x11f1('0x30')](_0x52ff7d)){if(this[_0x11f1('0x1c')][_0x52ff7d[_0x11f1('0x33')]]){if(!_[_0x11f1('0x68')](this[_0x11f1('0x1c')][_0x52ff7d[_0x11f1('0x33')]][_0x11f1('0x57')])){this[_0x11f1('0x1c')][_0x52ff7d['uniqueid']][_0x11f1('0x91')]=moment()['format'](_0x11f1('0x4e'));}}}}catch(_0x3b0be4){logger[_0x11f1('0x37')]('[syncMusicOnHoldStart][VoiceCallReport]',util['inspect'](_0x3b0be4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x11f1('0x2f')][_0x11f1('0x2c')]=function(_0x47a940){try{if(this[_0x11f1('0x30')](_0x47a940)){if(this[_0x11f1('0x1c')][_0x47a940[_0x11f1('0x33')]]){if(!_[_0x11f1('0x68')](this['channels'][_0x47a940['uniqueid']][_0x11f1('0x91')])){this['channels'][_0x47a940[_0x11f1('0x33')]][_0x11f1('0x92')]+=moment()[_0x11f1('0x93')](0x0)['diff'](this[_0x11f1('0x1c')][_0x47a940[_0x11f1('0x33')]][_0x11f1('0x91')],'seconds');delete this[_0x11f1('0x1c')][_0x47a940[_0x11f1('0x33')]]['mohstarttime'];}}}}catch(_0x2af355){logger[_0x11f1('0x37')](_0x11f1('0x94'),util[_0x11f1('0x39')](_0x2af355,{'showHidden':![],'depth':null}));}};module[_0x11f1('0x95')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 8d28f68..f9658b3 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 _0x9959=['lastevent','connect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys','variable','value','outboundrouteid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','total','answered','holdtime','diff','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','exports','lodash','moment','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','format','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x191f8d,_0x367b8e){var _0x15a591=function(_0x4e1abb){while(--_0x4e1abb){_0x191f8d['push'](_0x191f8d['shift']());}};_0x15a591(++_0x367b8e);}(_0x9959,0x1c2));var _0x9995=function(_0xf952bf,_0x374b07){_0xf952bf=_0xf952bf-0x0;var _0x269159=_0x9959[_0xf952bf];return _0x269159;};'use strict';var _=require(_0x9995('0x0'));var moment=require(_0x9995('0x1'));var util=require(_0x9995('0x2'));var Redis=require(_0x9995('0x3'));var config=require(_0x9995('0x4'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config['redis']=_[_0x9995('0x5')](config[_0x9995('0x6')],{'host':_0x9995('0x7'),'port':0x18eb});var io=require(_0x9995('0x8'))(new Redis(config[_0x9995('0x6')]));function VoiceDialReport(_0x52782b){this[_0x9995('0x9')]=_0x52782b[_0x9995('0xa')];this[_0x9995('0xb')]=_0x52782b[_0x9995('0xb')];this[_0x9995('0xc')]={};ami['on'](_0x9995('0xd'),this[_0x9995('0xe')][_0x9995('0xf')](this));ami['on'](_0x9995('0x10'),this[_0x9995('0x11')][_0x9995('0xf')](this));ami['on']('varset',this['syncVarSet'][_0x9995('0xf')](this));ami['on'](_0x9995('0x12'),this[_0x9995('0x13')]['bind'](this));}VoiceDialReport[_0x9995('0x14')][_0x9995('0x15')]=function(_0x40e7d4){return _0x40e7d4!==null&&!_[_0x9995('0x16')](_0x40e7d4);};VoiceDialReport[_0x9995('0x14')][_0x9995('0x17')]=function(_0x53034c,_0x3a4359,_0x5425c1){io['to'](_0x53034c)['emit'](_0x3a4359,_0x5425c1);};VoiceDialReport['prototype'][_0x9995('0xe')]=function(_0x224cc5){try{if(this[_0x9995('0x15')](_0x224cc5)){if(this[_0x9995('0x9')][_0x224cc5[_0x9995('0x18')]]){_[_0x9995('0x19')](this['channels'][_0x224cc5['uniqueid']],{'starttime':moment()[_0x9995('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x224cc5[_0x9995('0x1b')]['substring'](0x0,_0x224cc5[_0x9995('0x1b')][_0x9995('0x1c')]('-')),'membername':_0x224cc5[_0x9995('0x1b')][_0x9995('0x1d')](_0x224cc5[_0x9995('0x1b')][_0x9995('0x1c')]('/')+0x1,_0x224cc5[_0x9995('0x1b')][_0x9995('0x1c')]('-'))},_[_0x9995('0x1e')](_0x224cc5,[_0x9995('0x1f'),_0x9995('0x20')]));this[_0x9995('0x17')](_0x9995('0x21'),'voice_outbound_channel:save',this[_0x9995('0x9')][_0x224cc5['uniqueid']]);ami[_0x9995('0x17')]('custom:dialbegin',this[_0x9995('0x9')][_0x224cc5[_0x9995('0x18')]]);}}}catch(_0x33b8e3){logger[_0x9995('0x22')](_0x9995('0x23'),util[_0x9995('0x24')](_0x33b8e3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9995('0x14')][_0x9995('0x11')]=function(_0x50d6d9){try{if(this[_0x9995('0x15')](_0x50d6d9)){if(this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]]){this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]]['dialstatus']=_0x50d6d9['dialstatus'];if(_0x50d6d9[_0x9995('0x25')]==='ANSWER'){this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]][_0x9995('0x26')]=_0x50d6d9[_0x9995('0x26')];this[_0x9995('0x9')][_0x50d6d9['uniqueid']][_0x9995('0x27')]=_0x50d6d9[_0x9995('0x27')];this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]][_0x9995('0x28')]=moment()['format'](_0x9995('0x29'));this[_0x9995('0x9')][_0x50d6d9['uniqueid']][_0x9995('0x2a')]=_0x9995('0x2b');ami[_0x9995('0x17')]('custom:dialconnect',this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]]);}this[_0x9995('0x17')]('voice:outbound',_0x9995('0x2c'),this[_0x9995('0x9')][_0x50d6d9[_0x9995('0x18')]]);}}}catch(_0xed33d2){logger[_0x9995('0x22')](_0x9995('0x2d'),util[_0x9995('0x24')](_0xed33d2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9995('0x14')][_0x9995('0x2e')]=function(_0x4c0fef){try{if(this[_0x9995('0x15')](_0x4c0fef)){this[_0x9995('0x2f')](_0x4c0fef[_0x9995('0x18')],_[_0x9995('0x30')](_0x4c0fef[_0x9995('0x31')])[0x0],_0x4c0fef[_0x9995('0x32')]);if(this[_0x9995('0x15')](_0x4c0fef[_0x9995('0x31')])&&this[_0x9995('0x15')](_0x4c0fef[_0x9995('0x31')][_0x9995('0x33')])){if(_[_0x9995('0x16')](this[_0x9995('0x9')][_0x4c0fef[_0x9995('0x18')]])){this[_0x9995('0x9')][_0x4c0fef[_0x9995('0x18')]]={'routeId':_0x4c0fef[_0x9995('0x32')],'variables':this['variables'][_0x4c0fef['uniqueid']]};this[_0x9995('0x17')](_0x9995('0x21'),'voice_outbound_channel:save',this['channels'][_0x4c0fef[_0x9995('0x18')]]);}}}}catch(_0x109121){logger['error']('[syncVarSet][VoiceDialReport]',util[_0x9995('0x24')](_0x109121,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9995('0x2f')]=function(_0x843b3c,_0x5196d3,_0x58f6f6){var _0x397788=['rtpaudioqos',_0x9995('0x34'),_0x9995('0x35'),'rtpaudioqosjitterbridged',_0x9995('0x36'),_0x9995('0x37'),_0x9995('0x38'),_0x9995('0x39'),_0x9995('0x3a'),'sipuri','bridgepeer',_0x9995('0x3b'),_0x9995('0x3c'),_0x9995('0x3d'),_0x9995('0x3e'),'memberlastcall','membername',_0x9995('0x3f'),_0x9995('0x40')];if(!_[_0x9995('0x41')](_0x5196d3)&&!_[_0x9995('0x42')](_0x397788,_0x5196d3)){if(_['isUndefined'](this['variables'][_0x843b3c])){this[_0x9995('0xc')][_0x843b3c]={};}this['variables'][_0x843b3c][_0x5196d3]=_0x58f6f6;}};VoiceDialReport['prototype'][_0x9995('0x13')]=function(_0xeaa43b){try{if(this[_0x9995('0x15')](_0xeaa43b)){if(this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]]){this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x43')]=moment()[_0x9995('0x1a')](_0x9995('0x29'));this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x44')]=moment(this['channels'][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x43')])['diff'](this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x45')],'seconds');this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x2a')]='complete';this[_0x9995('0xb')][_0x9995('0x46')]+=0x1;if(this['channels'][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x28')]){this[_0x9995('0xb')][_0x9995('0x47')]+=0x1;this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x48')]=moment(this[_0x9995('0x9')][_0xeaa43b['uniqueid']][_0x9995('0x28')])[_0x9995('0x49')](this['channels'][_0xeaa43b['uniqueid']][_0x9995('0x45')],_0x9995('0x4a'));this[_0x9995('0x9')][_0xeaa43b['uniqueid']][_0x9995('0x4b')]=moment(this['channels'][_0xeaa43b['uniqueid']][_0x9995('0x43')])[_0x9995('0x49')](this['channels'][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x28')],_0x9995('0x4a'));this[_0x9995('0xb')][_0x9995('0x4c')]+=this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x48')]||0x0;this[_0x9995('0xb')][_0x9995('0x4d')]+=this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]][_0x9995('0x4b')];}this[_0x9995('0xb')][_0x9995('0x4e')]+=this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]]['duration'];ami[_0x9995('0x17')](_0x9995('0x4f'),this['channels'][_0xeaa43b[_0x9995('0x18')]]);ami[_0x9995('0x17')]('custom:dialend',this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]]);this[_0x9995('0x17')]('voice:outbound',_0x9995('0x50'),this[_0x9995('0xb')]);this[_0x9995('0x17')](_0x9995('0x21'),'voice_outbound_channel:remove',this['channels'][_0xeaa43b[_0x9995('0x18')]]);delete this[_0x9995('0x9')][_0xeaa43b[_0x9995('0x18')]];}if(this[_0x9995('0xc')][_0xeaa43b['uniqueid']]){delete this[_0x9995('0xc')][_0xeaa43b['uniqueid']];}}}catch(_0x2fcaa1){logger[_0x9995('0x22')]('[syncHangup][VoiceDialReport]',util[_0x9995('0x24')](_0x2fcaa1,{'showHidden':![],'depth':null}));}};module[_0x9995('0x51')]=VoiceDialReport; \ No newline at end of file +var _0x9f2e=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','membername','memberpenalty','includes','endtime','duration','starttime','seconds','complete','total','answertime','answered','holdtime','billableseconds','diff','sumHoldTime','custom:voiceDialReport','custom:dialend','voice_outbound:save','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','dialbegin','bind','syncDialEnd','hangup','syncHangup','prototype','isUndefined','emit','uniqueid','merge','format','substring','lastIndexOf','channel','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','isNotNull','dialstatus','ANSWER','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','error','syncVarSet','addVariable','keys','variable','outboundrouteid','value','variables'];(function(_0x55e457,_0x53c48b){var _0x22e650=function(_0x134fae){while(--_0x134fae){_0x55e457['push'](_0x55e457['shift']());}};_0x22e650(++_0x53c48b);}(_0x9f2e,0xc6));var _0xe9f2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9f2e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var moment=require(_0xe9f2('0x0'));var util=require(_0xe9f2('0x1'));var Redis=require(_0xe9f2('0x2'));var config=require(_0xe9f2('0x3'));var logger=require(_0xe9f2('0x4'))(_0xe9f2('0x5'));var ami=require(_0xe9f2('0x6'));config[_0xe9f2('0x7')]=_[_0xe9f2('0x8')](config[_0xe9f2('0x7')],{'host':_0xe9f2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe9f2('0x7')]));function VoiceDialReport(_0x4cebf7){this[_0xe9f2('0xa')]=_0x4cebf7[_0xe9f2('0xb')];this[_0xe9f2('0xc')]=_0x4cebf7[_0xe9f2('0xc')];this['variables']={};ami['on'](_0xe9f2('0xd'),this['syncDialBegin'][_0xe9f2('0xe')](this));ami['on']('dialend',this[_0xe9f2('0xf')][_0xe9f2('0xe')](this));ami['on']('varset',this['syncVarSet'][_0xe9f2('0xe')](this));ami['on'](_0xe9f2('0x10'),this[_0xe9f2('0x11')][_0xe9f2('0xe')](this));}VoiceDialReport[_0xe9f2('0x12')]['isNotNull']=function(_0x31b0e1){return _0x31b0e1!==null&&!_[_0xe9f2('0x13')](_0x31b0e1);};VoiceDialReport[_0xe9f2('0x12')][_0xe9f2('0x14')]=function(_0xe76a28,_0x168bfd,_0x2c772f){io['to'](_0xe76a28)['emit'](_0x168bfd,_0x2c772f);};VoiceDialReport[_0xe9f2('0x12')]['syncDialBegin']=function(_0x409eaf){try{if(this['isNotNull'](_0x409eaf)){if(this[_0xe9f2('0xa')][_0x409eaf[_0xe9f2('0x15')]]){_[_0xe9f2('0x16')](this[_0xe9f2('0xa')][_0x409eaf[_0xe9f2('0x15')]],{'starttime':moment()[_0xe9f2('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x409eaf['channel'][_0xe9f2('0x18')](0x0,_0x409eaf['channel'][_0xe9f2('0x19')]('-')),'membername':_0x409eaf[_0xe9f2('0x1a')]['substring'](_0x409eaf[_0xe9f2('0x1a')][_0xe9f2('0x19')]('/')+0x1,_0x409eaf[_0xe9f2('0x1a')]['lastIndexOf']('-'))},_['omit'](_0x409eaf,[_0xe9f2('0x1b'),_0xe9f2('0x1c')]));this['emit'](_0xe9f2('0x1d'),_0xe9f2('0x1e'),this[_0xe9f2('0xa')][_0x409eaf[_0xe9f2('0x15')]]);ami[_0xe9f2('0x14')](_0xe9f2('0x1f'),this[_0xe9f2('0xa')][_0x409eaf[_0xe9f2('0x15')]]);}}}catch(_0x3a9710){logger['error'](_0xe9f2('0x20'),util[_0xe9f2('0x21')](_0x3a9710,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe9f2('0x12')]['syncDialEnd']=function(_0x265594){try{if(this[_0xe9f2('0x22')](_0x265594)){if(this[_0xe9f2('0xa')][_0x265594['uniqueid']]){this['channels'][_0x265594[_0xe9f2('0x15')]][_0xe9f2('0x23')]=_0x265594[_0xe9f2('0x23')];if(_0x265594['dialstatus']===_0xe9f2('0x24')){this['channels'][_0x265594['uniqueid']][_0xe9f2('0x25')]=_0x265594[_0xe9f2('0x25')];this['channels'][_0x265594[_0xe9f2('0x15')]][_0xe9f2('0x26')]=_0x265594[_0xe9f2('0x26')];this['channels'][_0x265594[_0xe9f2('0x15')]]['answertime']=moment()[_0xe9f2('0x17')](_0xe9f2('0x27'));this[_0xe9f2('0xa')][_0x265594[_0xe9f2('0x15')]][_0xe9f2('0x28')]=_0xe9f2('0x29');ami[_0xe9f2('0x14')](_0xe9f2('0x2a'),this['channels'][_0x265594['uniqueid']]);}this[_0xe9f2('0x14')](_0xe9f2('0x1d'),'voice_outbound_channel:save',this['channels'][_0x265594[_0xe9f2('0x15')]]);}}}catch(_0x9192cc){logger[_0xe9f2('0x2b')]('[syncDialEnd][VoiceDialReport]',util[_0xe9f2('0x21')](_0x9192cc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe9f2('0x12')][_0xe9f2('0x2c')]=function(_0x4bcf75){try{if(this[_0xe9f2('0x22')](_0x4bcf75)){this[_0xe9f2('0x2d')](_0x4bcf75[_0xe9f2('0x15')],_[_0xe9f2('0x2e')](_0x4bcf75['variable'])[0x0],_0x4bcf75['value']);if(this[_0xe9f2('0x22')](_0x4bcf75[_0xe9f2('0x2f')])&&this['isNotNull'](_0x4bcf75['variable'][_0xe9f2('0x30')])){if(_[_0xe9f2('0x13')](this[_0xe9f2('0xa')][_0x4bcf75[_0xe9f2('0x15')]])){this['channels'][_0x4bcf75['uniqueid']]={'routeId':_0x4bcf75[_0xe9f2('0x31')],'variables':this[_0xe9f2('0x32')][_0x4bcf75[_0xe9f2('0x15')]]};this[_0xe9f2('0x14')]('voice:outbound',_0xe9f2('0x1e'),this[_0xe9f2('0xa')][_0x4bcf75['uniqueid']]);}}}}catch(_0x1038af){logger['error']('[syncVarSet][VoiceDialReport]',util[_0xe9f2('0x21')](_0x1038af,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xe9f2('0x2d')]=function(_0x3277f7,_0x1521ce,_0x1678c1){var _0x37fbe2=[_0xe9f2('0x33'),_0xe9f2('0x34'),_0xe9f2('0x35'),_0xe9f2('0x36'),_0xe9f2('0x37'),_0xe9f2('0x38'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xe9f2('0x39'),_0xe9f2('0x3a'),_0xe9f2('0x3b'),_0xe9f2('0x3c'),'membercalls',_0xe9f2('0x3d'),'memberinterface',_0xe9f2('0x3e'),_0xe9f2('0x3f'),_0xe9f2('0x40'),'memberrealtime'];if(!_['isNil'](_0x1521ce)&&!_[_0xe9f2('0x41')](_0x37fbe2,_0x1521ce)){if(_[_0xe9f2('0x13')](this[_0xe9f2('0x32')][_0x3277f7])){this[_0xe9f2('0x32')][_0x3277f7]={};}this[_0xe9f2('0x32')][_0x3277f7][_0x1521ce]=_0x1678c1;}};VoiceDialReport[_0xe9f2('0x12')]['syncHangup']=function(_0x1bfbe0){try{if(this[_0xe9f2('0x22')](_0x1bfbe0)){if(this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]]){this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x42')]=moment()['format'](_0xe9f2('0x27'));this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x43')]=moment(this['channels'][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x42')])['diff'](this[_0xe9f2('0xa')][_0x1bfbe0['uniqueid']][_0xe9f2('0x44')],_0xe9f2('0x45'));this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x28')]=_0xe9f2('0x46');this['outbound'][_0xe9f2('0x47')]+=0x1;if(this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x48')]){this[_0xe9f2('0xc')][_0xe9f2('0x49')]+=0x1;this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x4a')]=moment(this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x48')])['diff'](this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x44')],_0xe9f2('0x45'));this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x4b')]=moment(this[_0xe9f2('0xa')][_0x1bfbe0['uniqueid']][_0xe9f2('0x42')])[_0xe9f2('0x4c')](this['channels'][_0x1bfbe0[_0xe9f2('0x15')]]['answertime'],_0xe9f2('0x45'));this['outbound'][_0xe9f2('0x4d')]+=this['channels'][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x4a')]||0x0;this[_0xe9f2('0xc')]['sumBillable']+=this['channels'][_0x1bfbe0[_0xe9f2('0x15')]][_0xe9f2('0x4b')];}this[_0xe9f2('0xc')]['sumDuration']+=this['channels'][_0x1bfbe0['uniqueid']][_0xe9f2('0x43')];ami[_0xe9f2('0x14')](_0xe9f2('0x4e'),this['channels'][_0x1bfbe0[_0xe9f2('0x15')]]);ami['emit'](_0xe9f2('0x4f'),this[_0xe9f2('0xa')][_0x1bfbe0[_0xe9f2('0x15')]]);this[_0xe9f2('0x14')](_0xe9f2('0x1d'),_0xe9f2('0x50'),this['outbound']);this['emit'](_0xe9f2('0x1d'),'voice_outbound_channel:remove',this['channels'][_0x1bfbe0['uniqueid']]);delete this['channels'][_0x1bfbe0[_0xe9f2('0x15')]];}if(this[_0xe9f2('0x32')][_0x1bfbe0[_0xe9f2('0x15')]]){delete this[_0xe9f2('0x32')][_0x1bfbe0[_0xe9f2('0x15')]];}}}catch(_0x5b5b63){logger[_0xe9f2('0x2b')](_0xe9f2('0x51'),util[_0xe9f2('0x21')](_0x5b5b63,{'showHidden':![],'depth':null}));}};module[_0xe9f2('0x52')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index d5227f1..e551045 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 _0x6d42=['syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]','error','variables','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','voice:queue:%s','name','voice_queue_channel:save','format','voice_queue_channel:remove','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','abandoned','Trunk','active','Interval','stringify','voice_queue:save','isNotNull','isUndefined','queues','[queues]','then','queue','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','syncNewExten','uniqueid','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','local/','linkedid','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','queuestatus','value','CONTINUE','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','length','unmanaged','diff','milliseconds','queuecallercompleteAt','lastevent','custom:queuecallerabandon','sumDuration','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','extension','context','transfererchannel','[syncMusicOnHoldStart][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin'];(function(_0x34d19b,_0x11f89a){var _0x2595f8=function(_0x3f26dd){while(--_0x3f26dd){_0x34d19b['push'](_0x34d19b['shift']());}};_0x2595f8(++_0x11f89a);}(_0x6d42,0x174));var _0x26d4=function(_0x5f1335,_0x74ad1){_0x5f1335=_0x5f1335-0x0;var _0x31f5ad=_0x6d42[_0x5f1335];return _0x31f5ad;};'use strict';var _=require(_0x26d4('0x0'));var moment=require(_0x26d4('0x1'));var BPromise=require(_0x26d4('0x2'));var util=require(_0x26d4('0x3'));var md5=require(_0x26d4('0x4'));var Redis=require(_0x26d4('0x5'));var config=require('../../../config/environment');var logger=require(_0x26d4('0x6'))(_0x26d4('0x7'));var ami=require(_0x26d4('0x8'));var QueueReport=require('../model/queueReport');config[_0x26d4('0x9')]=_[_0x26d4('0xa')](config[_0x26d4('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x26d4('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x26d4('0xc')]['enqueue']=function(_0x7600a6){this[_0x26d4('0xd')]=this[_0x26d4('0xd')]?this[_0x26d4('0xd')][_0x26d4('0xe')](_0x7600a6):_0x7600a6();};function VoiceQueueReport(_0x56beca){this['sequence']=new Sequence();this[_0x26d4('0xf')]={};this['agents']=_0x56beca[_0x26d4('0x10')];this[_0x26d4('0x11')]=_0x56beca[_0x26d4('0x12')];this[_0x26d4('0x13')]=_0x56beca[_0x26d4('0x13')];this[_0x26d4('0x14')]=!![];this['campaigns']=_0x56beca[_0x26d4('0x15')];this['variables']={};ami['on'](_0x26d4('0x16'),this[_0x26d4('0x17')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x19'),this[_0x26d4('0x1a')]['bind'](this));ami['on'](_0x26d4('0x1b'),this[_0x26d4('0x1c')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x1d'),this[_0x26d4('0x1e')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x1f'),this[_0x26d4('0x20')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x21'),this[_0x26d4('0x22')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x23'),this[_0x26d4('0x24')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x25'),this[_0x26d4('0x26')]['bind'](this));ami['on'](_0x26d4('0x27'),this[_0x26d4('0x28')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x29'),this[_0x26d4('0x2a')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x2b'),this[_0x26d4('0x2c')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x2d'),this[_0x26d4('0x2e')][_0x26d4('0x18')](this));ami['on'](_0x26d4('0x2f'),this[_0x26d4('0x30')][_0x26d4('0x18')](this));ami['on']('blindtransfer',this[_0x26d4('0x31')][_0x26d4('0x18')](this));this[_0x26d4('0x32')]();this[_0x26d4('0x33')]();}function isNotNull(_0x490255){return _0x490255!==null&&!_['isUndefined'](_0x490255);}function clearChannels(_0x14d611){if(!_[_0x26d4('0x34')](_0x14d611)){for(var _0x130a1c in _0x14d611){if(_0x14d611[_0x26d4('0x35')](_0x130a1c)){delete _0x14d611[_0x130a1c];}}}}function clearCampaigns(_0x4cad53){if(!_[_0x26d4('0x34')](_0x4cad53)){for(var _0x1d386b in _0x4cad53){if(_0x4cad53[_0x26d4('0x35')](_0x1d386b)){_0x4cad53[_0x1d386b]['originated']=0x0;}}}}function clearVoiceQueues(_0x225b10){if(!_[_0x26d4('0x34')](_0x225b10)){for(var _0x3566c4 in _0x225b10){if(_0x225b10['hasOwnProperty'](_0x3566c4)){_0x225b10[_0x3566c4][_0x26d4('0x36')]=0x0;_0x225b10[_0x3566c4][_0x26d4('0x37')]=0x0;_0x225b10[_0x3566c4][_0x26d4('0x38')]=0x0;_0x225b10[_0x3566c4][_0x26d4('0x39')]=0x0;_0x225b10[_0x3566c4][_0x26d4('0x3a')]=!![];}}}}function clearAgentBooked(_0x609974){if(!_['isEmpty'](_0x609974)){for(var _0x1bf236 in _0x609974){if(_0x609974[_0x26d4('0x35')](_0x1bf236)){_0x609974[_0x1bf236][_0x26d4('0x3b')]=!![];}}}}VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x3c')]=function(){var _0x4a320f=this;for(var _0x59998b in this[_0x26d4('0x11')]){if(this[_0x26d4('0x11')][_0x26d4('0x35')](_0x59998b)&&!this[_0x26d4('0x11')][_0x59998b][_0x26d4('0x3d')]){this['sequence'][_0x26d4('0x3e')](function(){if(!_[_0x26d4('0x3f')](_0x4a320f[_0x26d4('0x11')][_0x59998b])){return ami[_0x26d4('0x40')]({'action':_0x26d4('0x41'),'channel':_0x4a320f[_0x26d4('0x11')][_0x59998b][_0x26d4('0x42')]})[_0x26d4('0x43')](function(_0xd575d0){if(_0xd575d0['message']===_0x26d4('0x44')){setTimeout(function(){if(_0x4a320f[_0x26d4('0x11')][_0x59998b]){delete _0x4a320f[_0x26d4('0x11')][_0x59998b];logger['error'](_0x26d4('0x45'),_0x59998b);}if(_0x4a320f[_0x26d4('0xf')][_0x59998b]){delete _0x4a320f['queueReports'][_0x59998b];logger[_0x26d4('0x46')]('[voiceQueueReport][checkQueueReport]',_0x59998b);}if(_0x4a320f[_0x26d4('0x47')][_0x59998b]){delete _0x4a320f[_0x26d4('0x47')][_0x59998b];logger['error'](_0x26d4('0x48'),_0x59998b);}},0x1f40);}});}});}}};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x2a')]=function(){logger[_0x26d4('0x46')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x26d4('0x11')]);this[_0x26d4('0x49')](this[_0x26d4('0xf')]);clearAgentBooked(this[_0x26d4('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x49')]=function(_0x51fd7e){var _0x4ae793=this;if(!_['isEmpty'](_0x51fd7e)){for(var _0x4ee1a9 in _0x51fd7e){if(_0x51fd7e[_0x26d4('0x35')](_0x4ee1a9)){_0x4ae793[_0x26d4('0x4a')](_0x51fd7e[_0x4ee1a9]);delete _0x51fd7e[_0x4ee1a9];}}}};function loggerCatch(_0x4ef28a){return function(_0x50f10f){logger['error'](_0x4ef28a,util[_0x26d4('0x4b')](_0x50f10f,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0x26d4('0x4c')]=function(_0x5903a8,_0x39c182,_0x20fba4){io['to'](_0x5903a8)[_0x26d4('0x4c')](_0x39c182,_0x20fba4);};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x4d')]=function(_0x485023){this['emit'](util['format'](_0x26d4('0x4e'),_0x485023[_0x26d4('0x4f')]),_0x26d4('0x50'),_0x485023);};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x4a')]=function(_0x14e660){this['emit'](util[_0x26d4('0x51')]('voice:queue:%s',_0x14e660[_0x26d4('0x4f')]),_0x26d4('0x52'),_0x14e660);};VoiceQueueReport[_0x26d4('0xc')]['emitVoiceQueueSummary']=function(_0x360ed6){if(_0x360ed6[_0x26d4('0x53')]===_0x26d4('0x54')){var _0xc75ab2={'id':_0x360ed6['id'],'name':_0x360ed6[_0x26d4('0x4f')],'strategy':_0x360ed6[_0x26d4('0x55')],'answered':_0x360ed6[_0x26d4('0x56')],'available':_0x360ed6[_0x26d4('0x57')],'loggedIn':_0x360ed6[_0x26d4('0x58')],'pTalking':_0x360ed6[_0x26d4('0x38')],'sumBillable':_0x360ed6[_0x26d4('0x59')],'sumDuration':_0x360ed6['sumDuration'],'sumHoldTime':_0x360ed6[_0x26d4('0x5a')]||0x0,'talking':_0x360ed6[_0x26d4('0x37')],'total':_0x360ed6[_0x26d4('0x5b')],'type':_0x360ed6['type'],'unmanaged':_0x360ed6['unmanaged'],'abandoned':_0x360ed6[_0x26d4('0x5c')],'waiting':_0x360ed6[_0x26d4('0x39')]};if(_0x360ed6['Trunk']){_0xc75ab2[_0x26d4('0x5d')]={'id':_0x360ed6['Trunk']['id'],'name':_0x360ed6[_0x26d4('0x5d')]['name'],'active':_0x360ed6[_0x26d4('0x5d')][_0x26d4('0x5e')],'callerid':_0x360ed6[_0x26d4('0x5d')]['callerid']};}if(_0x360ed6[_0x26d4('0x5f')]){_0xc75ab2[_0x26d4('0x5f')]={'id':_0x360ed6[_0x26d4('0x5f')]['id'],'name':_0x360ed6[_0x26d4('0x5f')][_0x26d4('0x4f')]};}var _0x4c8958=md5(JSON[_0x26d4('0x60')](_0xc75ab2));if(_0x360ed6[_0x26d4('0x4')]!==_0x4c8958){_0x360ed6[_0x26d4('0x4')]=_0x4c8958;this['emit'](util['format'](_0x26d4('0x4e'),_0xc75ab2[_0x26d4('0x4f')]),_0x26d4('0x61'),_0xc75ab2);}}};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x62')]=function(_0x212867){return _0x212867!==null&&!_[_0x26d4('0x63')](_0x212867);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x3c16e1=this;setInterval(function(){_0x3c16e1[_0x26d4('0x3c')]();ami[_0x26d4('0x40')]({'action':_0x26d4('0x64')})[_0x26d4('0x43')](loggerCatch(_0x26d4('0x65')));},0x2710);};VoiceQueueReport['prototype'][_0x26d4('0x32')]=function(){var _0x42efb2=this;setInterval(function(){if(_0x42efb2[_0x26d4('0x14')]){return ami['Action']({'action':'queuesummary'})[_0x26d4('0x66')](function(_0x53afb5){_0x42efb2['flagQueueSummary']=![];})[_0x26d4('0x43')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x17')]=function(_0x212eb5){try{if(this[_0x26d4('0x62')](_0x212eb5)&&this[_0x26d4('0x62')](_0x212eb5['queue'])){if(this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]]){var _0x5ab50e=_['countBy'](this[_0x26d4('0x11')],_0x26d4('0x67'))[_0x212eb5[_0x26d4('0x67')]]||0x0;var _0x5a29b5=_0x5ab50e-_0x212eb5[_0x26d4('0x68')];if(this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]][_0x26d4('0x39')]!==_['toNumber'](_0x212eb5[_0x26d4('0x68')])||this[_0x26d4('0x13')][_0x212eb5['queue']]['loggedIn']!==_[_0x26d4('0x69')](_0x212eb5[_0x26d4('0x6a')])||this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]][_0x26d4('0x57')]!==_[_0x26d4('0x69')](_0x212eb5[_0x26d4('0x57')])||this[_0x26d4('0x13')][_0x212eb5['queue']][_0x26d4('0x37')]!==_0x5a29b5){this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]]['waiting']=_[_0x26d4('0x69')](_0x212eb5[_0x26d4('0x68')]);this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]][_0x26d4('0x58')]=_[_0x26d4('0x69')](_0x212eb5[_0x26d4('0x6a')]);this['voiceQueues'][_0x212eb5[_0x26d4('0x67')]]['available']=_[_0x26d4('0x69')](_0x212eb5[_0x26d4('0x57')]);this['voiceQueues'][_0x212eb5[_0x26d4('0x67')]]['talking']=_0x5a29b5>0x0?_0x5a29b5:0x0;this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]][_0x26d4('0x37')]=this['voiceQueues'][_0x212eb5[_0x26d4('0x67')]][_0x26d4('0x37')]>_[_0x26d4('0x69')](_0x212eb5['loggedin'])?_[_0x26d4('0x69')](_0x212eb5['loggedin']):this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]]['talking'];this[_0x26d4('0x6b')](this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]]);}ami[_0x26d4('0x4c')](_0x26d4('0x6c'),this[_0x26d4('0x13')][_0x212eb5[_0x26d4('0x67')]]);}}}catch(_0x1abb47){logger['error']('[syncQueueSummary][VoiceQueueReport]',util[_0x26d4('0x4b')](_0x1abb47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')]['syncQueueSummaryComplete']=function(_0x26180c){this[_0x26d4('0x14')]=!![];};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x6d')]=function(_0x145af1){};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x1c')]=function(_0x26ac09){try{if(this[_0x26d4('0x62')](_0x26ac09)){if(_['isUndefined'](this['queueReports'][_0x26ac09[_0x26d4('0x6e')]])){this[_0x26d4('0xf')][_0x26ac09[_0x26d4('0x6e')]]=[];this[_0x26d4('0x11')][_0x26ac09[_0x26d4('0x6e')]]={};}var _0x44ff47=new QueueReport();_0x44ff47['name']=_0x26ac09['queue'];_0x44ff47[_0x26d4('0x53')]=this['voiceQueues'][_0x44ff47[_0x26d4('0x4f')]]&&this[_0x26d4('0x13')][_0x44ff47[_0x26d4('0x4f')]][_0x26d4('0x53')]?this[_0x26d4('0x13')][_0x44ff47[_0x26d4('0x4f')]][_0x26d4('0x53')]||_0x26d4('0x54'):'inbound';_0x44ff47['queue']=_0x26ac09[_0x26d4('0x67')];_0x44ff47['queuecallerjoinAt']=moment()[_0x26d4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x44ff47['position']=_0x26ac09['position'];_0x44ff47['count']=_0x26ac09[_0x26d4('0x6f')];_[_0x26d4('0x70')](_0x44ff47,_[_0x26d4('0x71')](_0x26ac09,_[_0x26d4('0x72')](_0x44ff47)));this[_0x26d4('0xf')][_0x26ac09[_0x26d4('0x6e')]][_0x26d4('0x73')](_0x44ff47);this[_0x26d4('0x11')][_0x26ac09[_0x26d4('0x6e')]]=_0x44ff47;this[_0x26d4('0x4d')](_0x44ff47);}}catch(_0x3a15c8){logger[_0x26d4('0x46')](_0x26d4('0x74'),util['inspect'](_0x3a15c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x1e')]=function(_0xefaa90){try{if(this[_0x26d4('0x62')](_0xefaa90)){if(this[_0x26d4('0xf')][_0xefaa90[_0x26d4('0x6e')]]){var _0x28e839=_[_0x26d4('0x75')](this[_0x26d4('0xf')][_0xefaa90[_0x26d4('0x6e')]]);_0x28e839[_0x26d4('0x76')]=![];_0x28e839['queuecallercompleteAt']=null;_0x28e839[_0x26d4('0x77')]=_0xefaa90[_0x26d4('0x77')];_0x28e839[_0x26d4('0x78')]=_0xefaa90[_0x26d4('0x78')];_0x28e839[_0x26d4('0x1d')]=!![];_0x28e839['queuecallerabandonAt']=moment()['format'](_0x26d4('0x79'));_0x28e839[_0x26d4('0x7a')]='ABANDONED';_0x28e839['lastAssignedTo']=null;this[_0x26d4('0x11')][_0xefaa90[_0x26d4('0x6e')]]=_0x28e839;this[_0x26d4('0x4a')](_0x28e839);}}}catch(_0x4bad4b){logger[_0x26d4('0x46')](_0x26d4('0x7b'),util['inspect'](_0x4bad4b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')]['syncQueueCallerLeave']=function(_0x1bbd91){try{if(this[_0x26d4('0x62')](_0x1bbd91)){if(this[_0x26d4('0xf')][_0x1bbd91['uniqueid']]){var _0x3eb73b=_['last'](this[_0x26d4('0xf')][_0x1bbd91[_0x26d4('0x6e')]]);_0x3eb73b[_0x26d4('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3eb73b[_0x26d4('0x7d')]=_0x1bbd91['connectedlinenum'];_0x3eb73b[_0x26d4('0x7e')]=_0x1bbd91['connectedlinename'];this[_0x26d4('0x11')][_0x1bbd91[_0x26d4('0x6e')]]=_0x3eb73b;this[_0x26d4('0x4d')](_0x3eb73b);}}}catch(_0x1506c2){logger[_0x26d4('0x46')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x1506c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x24')]=function(_0x553495){try{if(this[_0x26d4('0x62')](_0x553495)){if(this['queueReports'][_0x553495[_0x26d4('0x6e')]]){var _0x327b34=_[_0x26d4('0x75')](this[_0x26d4('0xf')][_0x553495[_0x26d4('0x6e')]]);_0x327b34[_0x26d4('0x76')]=!![];_0x327b34[_0x26d4('0x7a')]=_0x26d4('0x7f');}}}catch(_0x2d01c4){logger['error'](_0x26d4('0x80'),util[_0x26d4('0x4b')](_0x2d01c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x26d4('0x22')]=function(_0x419a52){try{if(this[_0x26d4('0x62')](_0x419a52)){if(this[_0x26d4('0xf')][_0x419a52[_0x26d4('0x6e')]]){var _0x3e5fce=_[_0x26d4('0x75')](this['queueReports'][_0x419a52['uniqueid']]);_0x3e5fce[_0x26d4('0x1d')]=![];_0x3e5fce[_0x26d4('0x81')]=null;_0x3e5fce[_0x26d4('0x82')]=!![];_0x3e5fce[_0x26d4('0x83')]=_0x419a52[_0x26d4('0x84')];_0x3e5fce[_0x26d4('0x77')]=_0x419a52[_0x26d4('0x77')];_0x3e5fce['queuecallercomplete']=!![];_0x3e5fce[_0x26d4('0x85')]=![];_0x3e5fce[_0x26d4('0x86')]=null;if(!_0x3e5fce[_0x26d4('0x87')]){if(_0x419a52[_0x26d4('0x88')]==_0x26d4('0x87')){_0x3e5fce[_0x26d4('0x7a')]=_0x26d4('0x89');}else{if(_[_0x26d4('0x8a')](_0x419a52[_0x26d4('0x42')]['toLowerCase'](),_0x26d4('0x8b'))){if(this[_0x26d4('0xf')][_0x419a52[_0x26d4('0x8c')]]){var _0x184804=_[_0x26d4('0x75')](this[_0x26d4('0xf')][_0x419a52[_0x26d4('0x8c')]]);_0x184804[_0x26d4('0x76')]=![];_0x184804['queuecallerexit']=!![];_0x184804['queuecallerexitAt']=moment(_0x3e5fce[_0x26d4('0x8d')])['add'](_0x419a52['holdtime'],_0x26d4('0x8e'))[_0x26d4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x184804[_0x26d4('0x7a')]=_0x26d4('0x8f');_0x184804['transfer']=!![];_0x184804[_0x26d4('0x90')]=_0x26d4('0x91');_0x184804[_0x26d4('0x92')]=_0x419a52[_0x26d4('0x93')];_0x184804['transferuniqueid']=_0x419a52[_0x26d4('0x6e')];var _0x2b123e=this['queueReports'][_0x419a52[_0x26d4('0x8c')]];this['queueReports'][_0x419a52['linkedid']]=this[_0x26d4('0xf')][_0x419a52[_0x26d4('0x6e')]];this[_0x26d4('0xf')][_0x419a52[_0x26d4('0x6e')]]=_0x2b123e;}}else{_0x3e5fce[_0x26d4('0x7a')]=_0x26d4('0x94')+_0x419a52[_0x26d4('0x88')][_0x26d4('0x95')]();}}}this['channels'][_0x419a52[_0x26d4('0x6e')]]=_0x3e5fce;this[_0x26d4('0x4a')](_0x3e5fce);}}}catch(_0x94fc12){logger['error'](_0x26d4('0x96'),util[_0x26d4('0x4b')](_0x94fc12,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')][_0x26d4('0x26')]=function(_0x20fe21){try{if(this[_0x26d4('0x62')](_0x20fe21)){this[_0x26d4('0x97')](_0x20fe21[_0x26d4('0x6e')],_[_0x26d4('0x72')](_0x20fe21[_0x26d4('0x98')])[0x0],_0x20fe21['value']);if(this[_0x26d4('0xf')][_0x20fe21[_0x26d4('0x6e')]]){var _0x32f9c2=_[_0x26d4('0x75')](this['queueReports'][_0x20fe21[_0x26d4('0x6e')]]);if(_0x32f9c2){if(this['isNotNull'](_0x20fe21['variable'])&&this[_0x26d4('0x62')](_0x20fe21['variable'][_0x26d4('0x99')])){switch(_0x20fe21[_0x26d4('0x9a')]){case _0x26d4('0x9b'):_0x32f9c2['queuecallerexit']=![];_0x32f9c2['queuecallerexitAt']=null;break;default:_0x32f9c2['queuecallerexit']=!![];_0x32f9c2[_0x26d4('0x86')]=moment()[_0x26d4('0x51')](_0x26d4('0x79'));_0x32f9c2[_0x26d4('0x7c')]=moment()[_0x26d4('0x51')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32f9c2['queuecallerabandon']=![];_0x32f9c2[_0x26d4('0x81')]=null;_0x32f9c2[_0x26d4('0x7a')]=_0x20fe21['value'];this[_0x26d4('0x11')][_0x20fe21[_0x26d4('0x6e')]]=_0x32f9c2;this[_0x26d4('0x4a')](_0x32f9c2);}else if(this[_0x26d4('0x62')](_0x20fe21['variable'])&&this[_0x26d4('0x62')](_0x20fe21[_0x26d4('0x98')]['queueposition'])){if(!_0x32f9c2[_0x26d4('0x1d')]){_0x32f9c2[_0x26d4('0x85')]=!![];_0x32f9c2[_0x26d4('0x86')]=moment()[_0x26d4('0x51')](_0x26d4('0x79'));_0x32f9c2[_0x26d4('0x7a')]=_0x26d4('0x9c');_0x32f9c2[_0x26d4('0x7c')]=moment()['format'](_0x26d4('0x79'));this['channels'][_0x20fe21[_0x26d4('0x6e')]]=_0x32f9c2;}}_0x32f9c2[_0x26d4('0x47')]=this[_0x26d4('0x47')][_0x20fe21[_0x26d4('0x6e')]];}}}}catch(_0x629281){logger[_0x26d4('0x46')](_0x26d4('0x9d'),util[_0x26d4('0x4b')](_0x629281,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x26d4('0xc')]['addVariable']=function(_0x37903d,_0x47b799,_0xef8a23){var _0x55603a=[_0x26d4('0x9e'),_0x26d4('0x9f'),_0x26d4('0xa0'),_0x26d4('0xa1'),'rtpaudioqosloss',_0x26d4('0xa2'),_0x26d4('0xa3'),_0x26d4('0xa4'),'sipcallid',_0x26d4('0xa5'),_0x26d4('0xa6'),_0x26d4('0xa7'),'membercalls',_0x26d4('0xa8'),_0x26d4('0xa9'),_0x26d4('0xaa'),_0x26d4('0x84'),'memberpenalty',_0x26d4('0xab')];if(!_[_0x26d4('0x3f')](_0x47b799)&&!_[_0x26d4('0xac')](_0x55603a,_0x47b799)){if(_[_0x26d4('0x63')](this['variables'][_0x37903d])){this[_0x26d4('0x47')][_0x37903d]={};}this['variables'][_0x37903d][_0x47b799]=_0xef8a23;}};VoiceQueueReport['prototype'][_0x26d4('0x28')]=function(_0x4b2f84){try{if(this[_0x26d4('0x62')](_0x4b2f84)){if(this[_0x26d4('0xf')][_0x4b2f84[_0x26d4('0x6e')]]){for(var _0x321b32=0x0,_0x2868d8={};_0x321b320x0?_0xb947e0:0x0;this[_0xb6f6('0x15')][_0x27144a['queue']][_0xb6f6('0x63')]=this[_0xb6f6('0x15')][_0x27144a[_0xb6f6('0x5f')]][_0xb6f6('0x63')]>_['toNumber'](_0x27144a[_0xb6f6('0x62')])?_['toNumber'](_0x27144a['loggedin']):this[_0xb6f6('0x15')][_0x27144a[_0xb6f6('0x5f')]]['talking'];this[_0xb6f6('0x48')](this[_0xb6f6('0x15')][_0x27144a[_0xb6f6('0x5f')]]);}ami['emit']('custom:queuesummary',this[_0xb6f6('0x15')][_0x27144a[_0xb6f6('0x5f')]]);}}}catch(_0x341b2d){logger['error'](_0xb6f6('0x65'),util[_0xb6f6('0x66')](_0x341b2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb6f6('0xe')][_0xb6f6('0x1c')]=function(_0x3312fb){this[_0xb6f6('0x16')]=!![];};VoiceQueueReport[_0xb6f6('0xe')]['syncNewExten']=function(_0x1a7346){};VoiceQueueReport[_0xb6f6('0xe')]['syncQueueCallerJoin']=function(_0x280915){try{if(this['isNotNull'](_0x280915)){if(_[_0xb6f6('0x30')](this[_0xb6f6('0x12')][_0x280915[_0xb6f6('0x67')]])){this['queueReports'][_0x280915[_0xb6f6('0x67')]]=[];this[_0xb6f6('0x14')][_0x280915['uniqueid']]={};}var _0x52aa3e=new QueueReport();_0x52aa3e['name']=_0x280915[_0xb6f6('0x5f')];_0x52aa3e[_0xb6f6('0x49')]=this[_0xb6f6('0x15')][_0x52aa3e[_0xb6f6('0x46')]]&&this[_0xb6f6('0x15')][_0x52aa3e[_0xb6f6('0x46')]][_0xb6f6('0x49')]?this['voiceQueues'][_0x52aa3e[_0xb6f6('0x46')]][_0xb6f6('0x49')]||_0xb6f6('0x4a'):_0xb6f6('0x4a');_0x52aa3e['queue']=_0x280915[_0xb6f6('0x5f')];_0x52aa3e[_0xb6f6('0x68')]=moment()[_0xb6f6('0x43')](_0xb6f6('0x69'));_0x52aa3e[_0xb6f6('0x6a')]=_0x280915[_0xb6f6('0x6a')];_0x52aa3e['count']=_0x280915[_0xb6f6('0x6b')];_[_0xb6f6('0x6c')](_0x52aa3e,_['pick'](_0x280915,_[_0xb6f6('0x6d')](_0x52aa3e)));this['queueReports'][_0x280915[_0xb6f6('0x67')]][_0xb6f6('0x6e')](_0x52aa3e);this['channels'][_0x280915[_0xb6f6('0x67')]]=_0x52aa3e;this['emitVoiceQueueChannelSave'](_0x52aa3e);}}catch(_0x1dc067){logger[_0xb6f6('0x3b')]('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x1dc067,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x20dd59){try{if(this[_0xb6f6('0x5a')](_0x20dd59)){if(this['queueReports'][_0x20dd59[_0xb6f6('0x67')]]){var _0x42c81f=_['last'](this[_0xb6f6('0x12')][_0x20dd59[_0xb6f6('0x67')]]);_0x42c81f[_0xb6f6('0x6f')]=![];_0x42c81f[_0xb6f6('0x70')]=null;_0x42c81f[_0xb6f6('0x71')]=_0x20dd59[_0xb6f6('0x71')];_0x42c81f[_0xb6f6('0x72')]=_0x20dd59[_0xb6f6('0x72')];_0x42c81f[_0xb6f6('0x1f')]=!![];_0x42c81f[_0xb6f6('0x73')]=moment()[_0xb6f6('0x43')](_0xb6f6('0x69'));_0x42c81f['queuecallerexitreason']='ABANDONED';_0x42c81f[_0xb6f6('0x74')]=null;this[_0xb6f6('0x14')][_0x20dd59['uniqueid']]=_0x42c81f;this[_0xb6f6('0x40')](_0x42c81f);}}}catch(_0x412704){logger[_0xb6f6('0x3b')](_0xb6f6('0x75'),util[_0xb6f6('0x66')](_0x412704,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb6f6('0xe')][_0xb6f6('0x22')]=function(_0x8d48e7){try{if(this[_0xb6f6('0x5a')](_0x8d48e7)){if(this[_0xb6f6('0x12')][_0x8d48e7[_0xb6f6('0x67')]]){var _0x194f0f=_['last'](this['queueReports'][_0x8d48e7[_0xb6f6('0x67')]]);_0x194f0f[_0xb6f6('0x76')]=moment()[_0xb6f6('0x43')](_0xb6f6('0x69'));_0x194f0f['connectedlinenum']=_0x8d48e7[_0xb6f6('0x77')];_0x194f0f['connectedlinename']=_0x8d48e7[_0xb6f6('0x78')];this[_0xb6f6('0x14')][_0x8d48e7[_0xb6f6('0x67')]]=_0x194f0f;this[_0xb6f6('0x42')](_0x194f0f);}}}catch(_0x2f5269){logger[_0xb6f6('0x3b')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x2f5269,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb6f6('0xe')]['syncAgentConnect']=function(_0x46de6c){try{if(this[_0xb6f6('0x5a')](_0x46de6c)){if(this[_0xb6f6('0x12')][_0x46de6c[_0xb6f6('0x67')]]){var _0xec0ba1=_[_0xb6f6('0x79')](this[_0xb6f6('0x12')][_0x46de6c[_0xb6f6('0x67')]]);_0xec0ba1[_0xb6f6('0x6f')]=!![];_0xec0ba1['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x519c6f){logger['error'](_0xb6f6('0x7a'),util[_0xb6f6('0x66')](_0x519c6f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb6f6('0xe')][_0xb6f6('0x24')]=function(_0x1d6a9f){try{if(this[_0xb6f6('0x5a')](_0x1d6a9f)){if(this[_0xb6f6('0x12')][_0x1d6a9f[_0xb6f6('0x67')]]){var _0x1fcce5=_[_0xb6f6('0x79')](this['queueReports'][_0x1d6a9f[_0xb6f6('0x67')]]);_0x1fcce5[_0xb6f6('0x1f')]=![];_0x1fcce5[_0xb6f6('0x73')]=null;_0x1fcce5[_0xb6f6('0x7b')]=!![];_0x1fcce5[_0xb6f6('0x74')]=_0x1d6a9f[_0xb6f6('0x7c')];_0x1fcce5[_0xb6f6('0x71')]=_0x1d6a9f['holdtime'];_0x1fcce5[_0xb6f6('0x6f')]=!![];_0x1fcce5['queuecallerexit']=![];_0x1fcce5['queuecallerexitAt']=null;if(!_0x1fcce5[_0xb6f6('0x7d')]){if(_0x1d6a9f[_0xb6f6('0x7e')]==_0xb6f6('0x7d')){_0x1fcce5['queuecallerexitreason']=_0xb6f6('0x7f');}else{if(_['startsWith'](_0x1d6a9f[_0xb6f6('0x80')][_0xb6f6('0x81')](),'local/')){if(this[_0xb6f6('0x12')][_0x1d6a9f[_0xb6f6('0x82')]]){var _0x49309a=_['last'](this[_0xb6f6('0x12')][_0x1d6a9f['linkedid']]);_0x49309a['queuecallercomplete']=![];_0x49309a['queuecallerexit']=!![];_0x49309a[_0xb6f6('0x83')]=moment(_0x1fcce5[_0xb6f6('0x68')])[_0xb6f6('0x84')](_0x1d6a9f[_0xb6f6('0x71')],_0xb6f6('0x85'))[_0xb6f6('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x49309a['queuecallerexitreason']='FORWARDTRANSFER';_0x49309a[_0xb6f6('0x7d')]=!![];_0x49309a[_0xb6f6('0x86')]=_0xb6f6('0x87');_0x49309a[_0xb6f6('0x88')]=_0x1d6a9f[_0xb6f6('0x89')];_0x49309a[_0xb6f6('0x8a')]=_0x1d6a9f[_0xb6f6('0x67')];var _0x155ef3=this[_0xb6f6('0x12')][_0x1d6a9f[_0xb6f6('0x82')]];this[_0xb6f6('0x12')][_0x1d6a9f[_0xb6f6('0x82')]]=this['queueReports'][_0x1d6a9f[_0xb6f6('0x67')]];this[_0xb6f6('0x12')][_0x1d6a9f[_0xb6f6('0x67')]]=_0x155ef3;}}else{_0x1fcce5[_0xb6f6('0x8b')]='COMPLETEDBY'+_0x1d6a9f[_0xb6f6('0x7e')][_0xb6f6('0x8c')]();}}}this[_0xb6f6('0x14')][_0x1d6a9f['uniqueid']]=_0x1fcce5;this['emitVoiceQueueChannelRemove'](_0x1fcce5);}}}catch(_0xa803ca){logger[_0xb6f6('0x3b')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0xa803ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb6f6('0x27')]=function(_0x4e19cf){try{if(this[_0xb6f6('0x5a')](_0x4e19cf)){this['addVariable'](_0x4e19cf['uniqueid'],_[_0xb6f6('0x6d')](_0x4e19cf['variable'])[0x0],_0x4e19cf[_0xb6f6('0x8d')]);if(this['queueReports'][_0x4e19cf[_0xb6f6('0x67')]]){var _0x2b875d=_['last'](this[_0xb6f6('0x12')][_0x4e19cf[_0xb6f6('0x67')]]);if(_0x2b875d){if(this['isNotNull'](_0x4e19cf['variable'])&&this[_0xb6f6('0x5a')](_0x4e19cf['variable'][_0xb6f6('0x8e')])){switch(_0x4e19cf[_0xb6f6('0x8d')]){case _0xb6f6('0x8f'):_0x2b875d[_0xb6f6('0x90')]=![];_0x2b875d[_0xb6f6('0x83')]=null;break;default:_0x2b875d[_0xb6f6('0x90')]=!![];_0x2b875d[_0xb6f6('0x83')]=moment()[_0xb6f6('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b875d[_0xb6f6('0x76')]=moment()['format'](_0xb6f6('0x69'));}_0x2b875d[_0xb6f6('0x1f')]=![];_0x2b875d['queuecallerabandonAt']=null;_0x2b875d[_0xb6f6('0x8b')]=_0x4e19cf[_0xb6f6('0x8d')];this[_0xb6f6('0x14')][_0x4e19cf[_0xb6f6('0x67')]]=_0x2b875d;this[_0xb6f6('0x40')](_0x2b875d);}else if(this['isNotNull'](_0x4e19cf['variable'])&&this['isNotNull'](_0x4e19cf[_0xb6f6('0x91')][_0xb6f6('0x92')])){if(!_0x2b875d[_0xb6f6('0x1f')]){_0x2b875d[_0xb6f6('0x90')]=!![];_0x2b875d[_0xb6f6('0x83')]=moment()[_0xb6f6('0x43')](_0xb6f6('0x69'));_0x2b875d['queuecallerexitreason']=_0xb6f6('0x93');_0x2b875d[_0xb6f6('0x76')]=moment()['format'](_0xb6f6('0x69'));this[_0xb6f6('0x14')][_0x4e19cf[_0xb6f6('0x67')]]=_0x2b875d;}}_0x2b875d[_0xb6f6('0x18')]=this[_0xb6f6('0x18')][_0x4e19cf[_0xb6f6('0x67')]];}}}}catch(_0x579c16){logger[_0xb6f6('0x3b')]('[syncVarSet][VoiceQueueReport]',util[_0xb6f6('0x66')](_0x579c16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb6f6('0x94')]=function(_0xae418e,_0x9a6e9f,_0x549f5e){var _0x315b15=[_0xb6f6('0x95'),_0xb6f6('0x96'),_0xb6f6('0x97'),_0xb6f6('0x98'),_0xb6f6('0x99'),_0xb6f6('0x9a'),_0xb6f6('0x9b'),'rtpaudioqosrttbridged',_0xb6f6('0x9c'),_0xb6f6('0x9d'),_0xb6f6('0x9e'),'bridgepvtcallid',_0xb6f6('0x9f'),_0xb6f6('0xa0'),_0xb6f6('0xa1'),_0xb6f6('0xa2'),'membername',_0xb6f6('0xa3'),'memberrealtime'];if(!_[_0xb6f6('0x37')](_0x9a6e9f)&&!_[_0xb6f6('0xa4')](_0x315b15,_0x9a6e9f)){if(_[_0xb6f6('0x30')](this[_0xb6f6('0x18')][_0xae418e])){this[_0xb6f6('0x18')][_0xae418e]={};}this['variables'][_0xae418e][_0x9a6e9f]=_0x549f5e;}};VoiceQueueReport[_0xb6f6('0xe')]['syncHangup']=function(_0x2c7522){try{if(this[_0xb6f6('0x5a')](_0x2c7522)){if(this[_0xb6f6('0x12')][_0x2c7522[_0xb6f6('0x67')]]){for(var _0x33aca5=0x0,_0x3057b4={};_0x33aca5=0x0?moment(_0x3cb8f8[_0x7aec('0x19')])[_0x7aec('0x10')](_0x3cb8f8[_0x7aec('0x18')],_0x7aec('0x11')):null,'data1':'outbound','data2':_0x3cb8f8[_0x7aec('0x15')],'data3':_0x3cb8f8['exten'],'data4':_0x3cb8f8['dialstring']||null,'role':_0x7aec('0x1a'),'internal':_0x3cb8f8['accountcode']?_['toNumber'](_0x3cb8f8[_0x7aec('0x15')]):undefined,'uniqueid':_0x3cb8f8[_0x7aec('0x1b')]},'log':_0x7aec('0x7')});}; \ No newline at end of file +var _0xf3a4=['dialstring','moment','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','starttime','endtime','outbound','exten'];(function(_0x422a48,_0x4b2f45){var _0x1f99d7=function(_0x3243ad){while(--_0x3243ad){_0x422a48['push'](_0x422a48['shift']());}};_0x1f99d7(++_0x4b2f45);}(_0xf3a4,0xe1));var _0x4f3a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf3a4[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x4f3a('0x0'));var _=require('lodash');var util=require(_0x4f3a('0x1'));var client=require(_0x4f3a('0x2'));exports[_0x4f3a('0x3')]=function(_0x34b2c8){var _0x40238a=_0x34b2c8['queuecallercompleteAt']||_0x34b2c8[_0x4f3a('0x4')];return client[_0x4f3a('0x5')](_0x4f3a('0x6'),{'body':{'channel':_0x4f3a('0x7'),'membername':_0x34b2c8[_0x4f3a('0x8')],'interface':_[_0x4f3a('0x9')](_0x34b2c8[_0x4f3a('0xa')])?util[_0x4f3a('0xb')](_0x4f3a('0xc'),_0x34b2c8[_0x4f3a('0x8')]):_0x34b2c8[_0x4f3a('0xa')],'type':_0x4f3a('0xd'),'enterAt':_0x34b2c8['queuecallerleaveAt'],'exitAt':_0x40238a,'duration':moment(_0x40238a)[_0x4f3a('0xe')](_0x34b2c8['queuecallerleaveAt'],_0x4f3a('0xf')),'data1':_0x4f3a('0x10'),'data2':_0x34b2c8[_0x4f3a('0x11')],'data3':_0x34b2c8['exten'],'data4':null,'data5':_0x34b2c8[_0x4f3a('0x12')],'role':_0x4f3a('0x13'),'internal':_0x34b2c8[_0x4f3a('0x14')]?_[_0x4f3a('0x15')](_0x34b2c8['accountcode']):undefined,'uniqueid':_0x34b2c8[_0x4f3a('0x16')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x28d985){return client[_0x4f3a('0x5')](_0x4f3a('0x6'),{'body':{'channel':'voice','membername':_0x28d985['membername'],'interface':_0x28d985['interface'],'type':_0x4f3a('0xd'),'enterAt':_0x28d985[_0x4f3a('0x17')],'exitAt':_0x28d985['endtime'],'duration':moment(_0x28d985['endtime'])[_0x4f3a('0xe')](_0x28d985[_0x4f3a('0x17')],_0x4f3a('0xf'))>=0x0?moment(_0x28d985[_0x4f3a('0x18')])[_0x4f3a('0xe')](_0x28d985[_0x4f3a('0x17')],'seconds'):null,'data1':_0x4f3a('0x19'),'data2':_0x28d985['accountcode'],'data3':_0x28d985[_0x4f3a('0x1a')],'data4':_0x28d985[_0x4f3a('0x1b')]||null,'role':_0x4f3a('0x13'),'internal':_0x28d985[_0x4f3a('0x14')]?_[_0x4f3a('0x15')](_0x28d985['accountcode']):undefined,'uniqueid':_0x28d985['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d567a0c..c5d2505 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 _0x6c02=['html','Request','name'];(function(_0x52a2a0,_0x14e8eb){var _0x3a8cc2=function(_0x164e80){while(--_0x164e80){_0x52a2a0['push'](_0x52a2a0['shift']());}};_0x3a8cc2(++_0x14e8eb);}(_0x6c02,0x1e4));var _0x26c0=function(_0x5b6429,_0x286353){_0x5b6429=_0x5b6429-0x0;var _0x5a0fac=_0x6c02[_0x5b6429];return _0x5a0fac;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x2c3450){return function(_0x3957e8){return client[_0x26c0('0x0')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x26c0('0x1'),_0x26c0('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xbefe=['../client','GetTemplate','name'];(function(_0x2ea7d4,_0x72f885){var _0x35e170=function(_0x5af311){while(--_0x5af311){_0x2ea7d4['push'](_0x2ea7d4['shift']());}};_0x35e170(++_0x72f885);}(_0xbefe,0x1e6));var _0xebef=function(_0x27314d,_0x33c0f2){_0x27314d=_0x27314d-0x0;var _0x30a648=_0xbefe[_0x27314d];return _0x30a648;};'use strict';var client=require(_0xebef('0x0'));exports['getTemplates']=function(_0x449353){return function(_0x4b69a2){return client['Request'](_0xebef('0x1'),{'options':{'raw':!![],'attributes':['id',_0xebef('0x2'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7c9841d..7cfbe05 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x328a5c,_0x329855){var _0x36f0a9=function(_0x4e66a2){while(--_0x4e66a2){_0x328a5c['push'](_0x328a5c['shift']());}};_0x36f0a9(++_0x329855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x561f59,_0x4d4b85){var _0x1a372d=function(_0x2996ad){while(--_0x2996ad){_0x561f59['push'](_0x561f59['shift']());}};_0x1a372d(++_0x4d4b85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 0985d86..5d36afc 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 _0xd271=['Request','GetTrunk','name','registry','../client','getTrunks'];(function(_0x1e8a7c,_0x36f81d){var _0x2ee21f=function(_0x59e3cc){while(--_0x59e3cc){_0x1e8a7c['push'](_0x1e8a7c['shift']());}};_0x2ee21f(++_0x36f81d);}(_0xd271,0x1ba));var _0x1d27=function(_0x3e639a,_0x34419b){_0x3e639a=_0x3e639a-0x0;var _0x11f4bd=_0xd271[_0x3e639a];return _0x11f4bd;};'use strict';var client=require(_0x1d27('0x0'));exports[_0x1d27('0x1')]=function(_0x5b5d61){return function(_0x5ea1fa){return client[_0x1d27('0x2')](_0x1d27('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1d27('0x4'),_0x1d27('0x5')]},'log':_0x1d27('0x3')});};}; \ No newline at end of file +var _0x959a=['Request','GetTrunk','name','registry','../client'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x959a,0x1ee));var _0xa959=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x959a[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xa959('0x0'));exports['getTrunks']=function(_0x8b4d79){return function(_0xc8ead7){return client[_0xa959('0x1')](_0xa959('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa959('0x3'),_0xa959('0x4')]},'log':_0xa959('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a8c8de3..c3195bd 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 _0x29c9=['getTelephones','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt','voicePause','../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','pauseType','phone','mobile','interface'];(function(_0xc8c4d0,_0x5b6bc9){var _0x273772=function(_0x383976){while(--_0x383976){_0xc8c4d0['push'](_0xc8c4d0['shift']());}};_0x273772(++_0x5b6bc9);}(_0x29c9,0x113));var _0x929c=function(_0x16b0c0,_0x4c19b0){_0x16b0c0=_0x16b0c0-0x0;var _0x4f3bbf=_0x29c9[_0x16b0c0];return _0x4f3bbf;};'use strict';var client=require(_0x929c('0x0'));exports[_0x929c('0x1')]=function(){return function(){return client[_0x929c('0x2')](_0x929c('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x929c('0x4'),_0x929c('0x5'),_0x929c('0x6'),_0x929c('0x7'),_0x929c('0x8'),'lastLoginAt',_0x929c('0x9'),'lastPauseAt','voicePause',_0x929c('0xa'),_0x929c('0xb'),_0x929c('0xc')]},'log':_0x929c('0x1')});};};exports[_0x929c('0xd')]=function(){return function(){return client[_0x929c('0x2')](_0x929c('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x929c('0x4'),_0x929c('0x6'),_0x929c('0xe')]},'log':_0x929c('0xd')});};};exports[_0x929c('0xf')]=function(_0x3cd4e3,_0xe14b2a,_0x120ab7){return client['Request'](_0x929c('0x10'),{'body':{'type':_0xe14b2a,'uniqueid':_0x120ab7},'options':{'where':{'id':_0x3cd4e3['id']}},'log':_0x929c('0xf')});};exports[_0x929c('0x11')]=function(_0x554a55){return client[_0x929c('0x2')](_0x929c('0x12'),{'body':{},'options':{'where':{'id':_0x554a55['id']}},'log':_0x929c('0xf')});};exports[_0x929c('0x13')]=function(_0x28f13f){return client[_0x929c('0x2')](_0x929c('0x14'),{'options':{'raw':![],'where':{'role':_0x929c('0x15'),'id':_0x28f13f},'attributes':['id','name',_0x929c('0x5'),_0x929c('0x6'),_0x929c('0x7'),_0x929c('0x8'),'lastLoginAt',_0x929c('0x9'),_0x929c('0x16'),_0x929c('0x17'),_0x929c('0xc')]},'log':_0x929c('0x13')});}; \ No newline at end of file +var _0x7beb=['agent','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','telephone','savePause','saveUnpause','UnpauseUser','ShowUser','online','pauseType','../client','GetUser'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x7beb,0x1a0));var _0xb7be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7beb[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xb7be('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0xb7be('0x1'),{'options':{'raw':![],'where':{'role':_0xb7be('0x2')},'attributes':['id',_0xb7be('0x3'),_0xb7be('0x4'),_0xb7be('0x5'),_0xb7be('0x6'),'online',_0xb7be('0x7'),'pauseType',_0xb7be('0x8'),_0xb7be('0x9'),_0xb7be('0xa'),_0xb7be('0xb'),_0xb7be('0xc')]},'log':'getAgents'});};};exports[_0xb7be('0xd')]=function(){return function(){return client[_0xb7be('0xe')](_0xb7be('0x1'),{'options':{'raw':!![],'where':{'role':_0xb7be('0xf')},'attributes':['id',_0xb7be('0x3'),_0xb7be('0x5'),'internal']},'log':'getTelephones'});};};exports[_0xb7be('0x10')]=function(_0x172bdc,_0x30852d,_0x1175e3){return client['Request']('PauseUser',{'body':{'type':_0x30852d,'uniqueid':_0x1175e3},'options':{'where':{'id':_0x172bdc['id']}},'log':_0xb7be('0x10')});};exports[_0xb7be('0x11')]=function(_0xbd1a26){return client[_0xb7be('0xe')](_0xb7be('0x12'),{'body':{},'options':{'where':{'id':_0xbd1a26['id']}},'log':_0xb7be('0x10')});};exports['getAgent']=function(_0x3d7e73){return client[_0xb7be('0xe')](_0xb7be('0x13'),{'options':{'raw':![],'where':{'role':'agent','id':_0x3d7e73},'attributes':['id',_0xb7be('0x3'),_0xb7be('0x4'),_0xb7be('0x5'),_0xb7be('0x6'),_0xb7be('0x14'),'lastLoginAt',_0xb7be('0x15'),_0xb7be('0x8'),_0xb7be('0x9'),_0xb7be('0xc')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 922c9e5..d0f51e7 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 _0xb499=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xb499,0x13d));var _0x9b49=function(_0x1d26af,_0x5edac5){_0x1d26af=_0x1d26af-0x0;var _0x58c86b=_0xb499[_0x1d26af];return _0x58c86b;};'use strict';var client=require(_0x9b49('0x0'));exports[_0x9b49('0x1')]=function(_0x2fdd6d){return client[_0x9b49('0x2')](_0x9b49('0x3'),{'body':_0x2fdd6d,'log':_0x9b49('0x3')});};exports['update']=function(_0x4c8682,_0x8fefb3,_0x260714){return client[_0x9b49('0x2')](_0x9b49('0x4'),{'body':_0x4c8682,'options':{'where':{'uniqueid':_0x8fefb3,'interface':_0x260714}},'log':_0x9b49('0x4')});}; \ No newline at end of file +var _0x10d8=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x45563c,_0x512b12){var _0x38f406=function(_0x5cefd3){while(--_0x5cefd3){_0x45563c['push'](_0x45563c['shift']());}};_0x38f406(++_0x512b12);}(_0x10d8,0x1b7));var _0x810d=function(_0x12c466,_0x18224){_0x12c466=_0x12c466-0x0;var _0x4b1f1f=_0x10d8[_0x12c466];return _0x4b1f1f;};'use strict';var client=require(_0x810d('0x0'));exports[_0x810d('0x1')]=function(_0x2d0e04){return client[_0x810d('0x2')](_0x810d('0x3'),{'body':_0x2d0e04,'log':_0x810d('0x3')});};exports[_0x810d('0x4')]=function(_0x51a207,_0x5d90ab,_0x355207){return client['Request'](_0x810d('0x5'),{'body':_0x51a207,'options':{'where':{'uniqueid':_0x5d90ab,'interface':_0x355207}},'log':_0x810d('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5cdb5da..7e461c8 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 _0x4576=['day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','moment','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x2a78d9,_0x271b92){var _0x293145=function(_0x164b12){while(--_0x164b12){_0x2a78d9['push'](_0x2a78d9['shift']());}};_0x293145(++_0x271b92);}(_0x4576,0x7f));var _0x6457=function(_0xece516,_0x8e1db6){_0xece516=_0xece516-0x0;var _0x41b360=_0x4576[_0xece516];return _0x41b360;};'use strict';var moment=require(_0x6457('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x6457('0x1'));exports[_0x6457('0x2')]=function(_0x53ce8d){return client[_0x6457('0x3')]('CreateVoiceCallReport',{'body':_[_0x6457('0x4')](_0x53ce8d,{'source':_0x53ce8d[_0x6457('0x5')],'destinationcontext':_0x53ce8d[_0x6457('0x6')],'callerid':_0x53ce8d[_0x6457('0x7')],'amaflags':_0x6457('0x8')}),'log':_0x6457('0x9')});};exports[_0x6457('0xa')]=function(){return function(){return client[_0x6457('0x3')](_0x6457('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6457('0xc')](_0x6457('0xd'))[_0x6457('0xe')](_0x6457('0xf')),moment()['endOf'](_0x6457('0xd'))[_0x6457('0xe')](_0x6457('0xf'))]}},'attributes':[_0x6457('0x10'),_0x6457('0x11'),'duration',_0x6457('0x12')]},'log':_0x6457('0x13')});};}; \ No newline at end of file +var _0xce75=['moment','util','../client','merge','calleridnum','context','callerid','getVoiceCallReports','Request','outbound','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration'];(function(_0x442350,_0x286ed2){var _0x69b381=function(_0x3e3bc0){while(--_0x3e3bc0){_0x442350['push'](_0x442350['shift']());}};_0x69b381(++_0x286ed2);}(_0xce75,0x10e));var _0x5ce7=function(_0x1c8cb9,_0x1cc003){_0x1c8cb9=_0x1c8cb9-0x0;var _0x412762=_0xce75[_0x1c8cb9];return _0x412762;};'use strict';var moment=require(_0x5ce7('0x0'));var util=require(_0x5ce7('0x1'));var _=require('lodash');var client=require(_0x5ce7('0x2'));exports['create']=function(_0x43982c){return client['Request']('CreateVoiceCallReport',{'body':_[_0x5ce7('0x3')](_0x43982c,{'source':_0x43982c[_0x5ce7('0x4')],'destinationcontext':_0x43982c[_0x5ce7('0x5')],'callerid':_0x43982c[_0x5ce7('0x6')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x5ce7('0x7')]=function(){return function(){return client[_0x5ce7('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x5ce7('0x9')],'createdAt':{'$between':[moment()['startOf'](_0x5ce7('0xa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')['format'](_0x5ce7('0xb'))]}},'attributes':[_0x5ce7('0xc'),_0x5ce7('0xd'),_0x5ce7('0xe'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e34605e..521ea1d 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 _0x8c81=['CreateVoiceDialReport'];(function(_0x37b346,_0xd56c2f){var _0x5bc24e=function(_0x323cf5){while(--_0x323cf5){_0x37b346['push'](_0x37b346['shift']());}};_0x5bc24e(++_0xd56c2f);}(_0x8c81,0x165));var _0x18c8=function(_0x52a0f5,_0x5fd44f){_0x52a0f5=_0x52a0f5-0x0;var _0x36a15f=_0x8c81[_0x52a0f5];return _0x36a15f;};'use strict';var client=require('../client');exports['create']=function(_0x1b5bcf){return client['Request'](_0x18c8('0x0'),{'body':_0x1b5bcf,'log':_0x18c8('0x0')});}; \ No newline at end of file +var _0x0dcc=['../client','Request','CreateVoiceDialReport'];(function(_0x128b6a,_0x2555c4){var _0x46a298=function(_0x4c6342){while(--_0x4c6342){_0x128b6a['push'](_0x128b6a['shift']());}};_0x46a298(++_0x2555c4);}(_0x0dcc,0x1c8));var _0xc0dc=function(_0x1b5da9,_0x29c687){_0x1b5da9=_0x1b5da9-0x0;var _0x566d99=_0x0dcc[_0x1b5da9];return _0x566d99;};'use strict';var client=require(_0xc0dc('0x0'));exports['create']=function(_0x11a17f){return client[_0xc0dc('0x1')](_0xc0dc('0x2'),{'body':_0x11a17f,'log':_0xc0dc('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 34ed5f2..e6851e9 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 _0xa870=['GetVoiceExtension','getVoiceExtensions'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xa870,0x101));var _0x0a87=function(_0x6033fe,_0x5338af){_0x6033fe=_0x6033fe-0x0;var _0x36b3db=_0xa870[_0x6033fe];return _0x36b3db;};'use strict';var client=require('../client');exports[_0x0a87('0x0')]=function(){return function(){return client['Request'](_0x0a87('0x1'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x4fb1=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x1a04a6,_0x1b9764){var _0xb3f005=function(_0x52c7c9){while(--_0x52c7c9){_0x1a04a6['push'](_0x1a04a6['shift']());}};_0xb3f005(++_0x1b9764);}(_0x4fb1,0x155));var _0x14fb=function(_0x5e8553,_0x4f3004){_0x5e8553=_0x5e8553-0x0;var _0x5dfab1=_0x4fb1[_0x5e8553];return _0x5dfab1;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x14fb('0x0')](_0x14fb('0x1'),{'options':{'raw':!![],'attributes':['id',_0x14fb('0x2'),_0x14fb('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x14fb('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4cff524..da1f971 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 _0x9095=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x3f2ddf,_0x4c940c){var _0x2a0b77=function(_0x2ad483){while(--_0x2ad483){_0x3f2ddf['push'](_0x3f2ddf['shift']());}};_0x2a0b77(++_0x4c940c);}(_0x9095,0x10b));var _0x5909=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x9095[_0xf79bae];return _0x5d2cb7;};'use strict';var client=require(_0x5909('0x0'));exports[_0x5909('0x1')]=function(){return function(){return client['Request'](_0x5909('0x2'),{'options':{'raw':![],'attributes':['id',_0x5909('0x3'),'acw',_0x5909('0x4'),_0x5909('0x5'),_0x5909('0x6'),_0x5909('0x7'),'dialActive',_0x5909('0x8'),'dialLimitChannel','dialLimitQueue',_0x5909('0x9'),_0x5909('0xa'),_0x5909('0xb'),_0x5909('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x5909('0xd'),_0x5909('0xe'),_0x5909('0xf'),'dialQueueProject',_0x5909('0x10'),'dialCongestionRetryFrequency',_0x5909('0x11'),'dialBusyRetryFrequency',_0x5909('0x12'),'dialNoAnswerRetryFrequency',_0x5909('0x13'),'dialTimezone',_0x5909('0x14'),'dialPrefix',_0x5909('0x15'),_0x5909('0x16'),_0x5909('0x17'),_0x5909('0x18'),_0x5909('0x19'),_0x5909('0x1a'),_0x5909('0x1b'),_0x5909('0x1c'),_0x5909('0x1d'),'dialAMDSilenceThreshold',_0x5909('0x1e'),_0x5909('0x1f'),'dialRecallMeTimeout',_0x5909('0x20'),_0x5909('0x21'),_0x5909('0x22'),_0x5909('0x23'),_0x5909('0x24'),_0x5909('0x6'),_0x5909('0x25'),_0x5909('0x26'),_0x5909('0x27'),_0x5909('0x28'),_0x5909('0x29'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x5909('0x2a'),'as':_0x5909('0x2a'),'attributes':['id',_0x5909('0x3'),'callerid',_0x5909('0x2b')]},{'model':_0x5909('0x2c'),'as':'mandatoryDispositionPause','attributes':['id',_0x5909('0x3')]},{'model':_0x5909('0x2a'),'as':_0x5909('0x2d'),'attributes':['id',_0x5909('0x3'),'callerid','active']},{'model':_0x5909('0x2e'),'as':_0x5909('0x2e'),'attributes':['id',_0x5909('0x3')],'include':[{'model':_0x5909('0x2e'),'as':_0x5909('0x2f'),'attributes':['id',_0x5909('0x3'),_0x5909('0x30')]}]}]},'log':_0x5909('0x1')});};}; \ No newline at end of file +var _0xbc2c=['active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialPredictiveIntervalMinThreshold','Trunk','name','callerid'];(function(_0x5249fc,_0x15dbb1){var _0x4f773e=function(_0x3d8cc8){while(--_0x3d8cc8){_0x5249fc['push'](_0x5249fc['shift']());}};_0x4f773e(++_0x15dbb1);}(_0xbc2c,0x123));var _0xcbc2=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xbc2c[_0x288f5e];return _0x476cc9;};'use strict';var client=require(_0xcbc2('0x0'));exports[_0xcbc2('0x1')]=function(){return function(){return client[_0xcbc2('0x2')](_0xcbc2('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0xcbc2('0x4'),_0xcbc2('0x5'),_0xcbc2('0x6'),_0xcbc2('0x7'),_0xcbc2('0x8'),_0xcbc2('0x9'),'dialLimitChannel','dialLimitQueue',_0xcbc2('0xa'),_0xcbc2('0xb'),_0xcbc2('0xc'),_0xcbc2('0xd'),'dialOriginateCallerIdName',_0xcbc2('0xe'),_0xcbc2('0xf'),_0xcbc2('0x10'),_0xcbc2('0x11'),_0xcbc2('0x12'),_0xcbc2('0x13'),_0xcbc2('0x14'),_0xcbc2('0x15'),_0xcbc2('0x16'),_0xcbc2('0x17'),'dialNoAnswerRetryFrequency',_0xcbc2('0x18'),_0xcbc2('0x19'),_0xcbc2('0x1a'),_0xcbc2('0x1b'),_0xcbc2('0x1c'),_0xcbc2('0x1d'),_0xcbc2('0x1e'),_0xcbc2('0x1f'),_0xcbc2('0x20'),_0xcbc2('0x21'),_0xcbc2('0x22'),'dialAMDBetweenWordsSilence',_0xcbc2('0x23'),_0xcbc2('0x24'),_0xcbc2('0x25'),_0xcbc2('0x26'),_0xcbc2('0x27'),_0xcbc2('0x28'),_0xcbc2('0x29'),_0xcbc2('0x2a'),'dialAgiAfterHangupClient',_0xcbc2('0x2b'),'monitor_format',_0xcbc2('0x2c'),_0xcbc2('0x2d'),_0xcbc2('0x2e'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0xcbc2('0x2f')],'include':[{'model':_0xcbc2('0x30'),'as':_0xcbc2('0x30'),'attributes':['id',_0xcbc2('0x31'),_0xcbc2('0x32'),_0xcbc2('0x33')]},{'model':_0xcbc2('0x34'),'as':_0xcbc2('0x35'),'attributes':['id',_0xcbc2('0x31')]},{'model':_0xcbc2('0x30'),'as':_0xcbc2('0x36'),'attributes':['id','name',_0xcbc2('0x32'),_0xcbc2('0x33')]},{'model':'Interval','as':_0xcbc2('0x37'),'attributes':['id',_0xcbc2('0x31')],'include':[{'model':_0xcbc2('0x37'),'as':_0xcbc2('0x38'),'attributes':['id','name','interval']}]}]},'log':_0xcbc2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5357e9f..3d72db0 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 _0xb8bd=['lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','GetVoiceQueueReports','moment'];(function(_0x4a920e,_0x41a654){var _0x5f3322=function(_0x40c9ec){while(--_0x40c9ec){_0x4a920e['push'](_0x4a920e['shift']());}};_0x5f3322(++_0x41a654);}(_0xb8bd,0xb3));var _0xdb8b=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb8bd[_0x2261ce];return _0x524640;};'use strict';var moment=require(_0xdb8b('0x0'));var _=require(_0xdb8b('0x1'));var client=require(_0xdb8b('0x2'));exports[_0xdb8b('0x3')]=function(_0x4e98f1){return client[_0xdb8b('0x4')](_0xdb8b('0x5'),{'body':_0x4e98f1,'log':'CreateVoiceQueueReport'});};exports[_0xdb8b('0x6')]=function(){return function(){return client[_0xdb8b('0x4')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xdb8b('0x7')](_0xdb8b('0x8'))['format'](_0xdb8b('0x9')),moment()[_0xdb8b('0xa')](_0xdb8b('0x8'))[_0xdb8b('0xb')](_0xdb8b('0x9'))]}},'attributes':['uniqueid','queue','queuecallerjoinAt',_0xdb8b('0xc'),_0xdb8b('0xd'),_0xdb8b('0xe'),_0xdb8b('0xf'),'queuecallerexitAt',_0xdb8b('0x10'),'queuecallerabandonAt']},'log':_0xdb8b('0x11')});};}; \ No newline at end of file +var _0x49aa=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt'];(function(_0xa81f8c,_0x369b92){var _0x2c2a03=function(_0x43deb4){while(--_0x43deb4){_0xa81f8c['push'](_0xa81f8c['shift']());}};_0x2c2a03(++_0x369b92);}(_0x49aa,0x1be));var _0xa49a=function(_0x3094fa,_0x1cabf1){_0x3094fa=_0x3094fa-0x0;var _0x164bbb=_0x49aa[_0x3094fa];return _0x164bbb;};'use strict';var moment=require(_0xa49a('0x0'));var _=require(_0xa49a('0x1'));var client=require(_0xa49a('0x2'));exports[_0xa49a('0x3')]=function(_0x2c3c14){return client[_0xa49a('0x4')](_0xa49a('0x5'),{'body':_0x2c3c14,'log':'CreateVoiceQueueReport'});};exports[_0xa49a('0x6')]=function(){return function(){return client[_0xa49a('0x4')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xa49a('0x7')](_0xa49a('0x8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa49a('0x9')](_0xa49a('0x8'))[_0xa49a('0xa')](_0xa49a('0xb'))]}},'attributes':['uniqueid',_0xa49a('0xc'),_0xa49a('0xd'),'queuecallerleaveAt',_0xa49a('0xe'),_0xa49a('0xf'),_0xa49a('0x10'),_0xa49a('0x11'),'queuecallerabandon',_0xa49a('0x12')]},'log':_0xa49a('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index d983b75..99eb74b 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 _0xe89c=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x44297c,_0x199f90){var _0x2a9fff=function(_0x199c2a){while(--_0x199c2a){_0x44297c['push'](_0x44297c['shift']());}};_0x2a9fff(++_0x199f90);}(_0xe89c,0x93));var _0xce89=function(_0x1c599d,_0x34ac8c){_0x1c599d=_0x1c599d-0x0;var _0x2ae32e=_0xe89c[_0x1c599d];return _0x2ae32e;};'use strict';var client=require(_0xce89('0x0'));exports[_0xce89('0x1')]=function(_0x336f14){return function(){return client[_0xce89('0x2')](_0xce89('0x3'),{'options':{'where':{'VoiceQueueId':_0x336f14,'paused':!![]},'raw':!![]},'log':_0xce89('0x1')});};}; \ No newline at end of file +var _0x12f9=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x21f5ac,_0x2e7331){var _0x5d6321=function(_0x37a79e){while(--_0x37a79e){_0x21f5ac['push'](_0x21f5ac['shift']());}};_0x5d6321(++_0x2e7331);}(_0x12f9,0xc2));var _0x912f=function(_0x2fc32b,_0xf95ab6){_0x2fc32b=_0x2fc32b-0x0;var _0x4a2231=_0x12f9[_0x2fc32b];return _0x4a2231;};'use strict';var client=require(_0x912f('0x0'));exports[_0x912f('0x1')]=function(_0x2c5a87){return function(){return client['Request'](_0x912f('0x2'),{'options':{'where':{'VoiceQueueId':_0x2c5a87,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0d62fd4..4933cd6 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 _0xf7a6=['merge','CreateVoiceRecording','lodash','../client','create','Request'];(function(_0x419eea,_0x323938){var _0x6b5bd2=function(_0x2617dd){while(--_0x2617dd){_0x419eea['push'](_0x419eea['shift']());}};_0x6b5bd2(++_0x323938);}(_0xf7a6,0x152));var _0x6f7a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf7a6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6f7a('0x0'));var client=require(_0x6f7a('0x1'));exports[_0x6f7a('0x2')]=function(_0x423341){return client[_0x6f7a('0x3')]('CreateVoiceRecording',{'body':_[_0x6f7a('0x4')](_0x423341,{'value':_0x423341['monitorFilename']}),'log':_0x6f7a('0x5')});}; \ No newline at end of file +var _0xeafd=['../client','Request','CreateVoiceRecording','monitorFilename'];(function(_0x5efccd,_0x50d478){var _0x59f3c2=function(_0x218385){while(--_0x218385){_0x5efccd['push'](_0x5efccd['shift']());}};_0x59f3c2(++_0x50d478);}(_0xeafd,0x1cc));var _0xdeaf=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xeafd[_0x386c3e];return _0x4b8e13;};'use strict';var _=require('lodash');var client=require(_0xdeaf('0x0'));exports['create']=function(_0x211c2a){return client[_0xdeaf('0x1')](_0xdeaf('0x2'),{'body':_['merge'](_0x211c2a,{'value':_0x211c2a[_0xdeaf('0x3')]}),'log':_0xdeaf('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 607c669..04f545d 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 _0x9197=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','context','extension','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x9197,0x1e4));var _0x7919=function(_0x24f330,_0x379f98){_0x24f330=_0x24f330-0x0;var _0x2e2367=_0x9197[_0x24f330];return _0x2e2367;};'use strict';var client=require(_0x7919('0x0'));exports[_0x7919('0x1')]=function(_0x121673){return client['Request'](_0x7919('0x2'),{'body':{'result':_0x121673[_0x7919('0x3')],'transfererchannel':_0x121673['transfererchannel'],'transferercalleridnum':_0x121673[_0x7919('0x4')],'transferercalleridname':_0x121673['transferercalleridname'],'transfererconnectedlinenum':_0x121673[_0x7919('0x5')],'transfererconnectedlinename':_0x121673[_0x7919('0x6')],'transfereraccountcode':_0x121673[_0x7919('0x7')],'transferercontext':_0x121673[_0x7919('0x8')],'transfererexten':_0x121673[_0x7919('0x9')],'transfererlinkedid':_0x121673['transfererlinkedid'],'transfereechannel':_0x121673[_0x7919('0xa')],'transfereecalleridnum':_0x121673[_0x7919('0xb')],'transfereecalleridname':_0x121673['transfereecalleridname'],'transfereeconnectedlinenum':_0x121673['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x121673[_0x7919('0xc')],'transfereeaccountcode':_0x121673['transfereeaccountcode'],'transfereecontext':_0x121673['transfereecontext'],'transfereeexten':_0x121673[_0x7919('0xd')],'transfereelinkedid':_0x121673[_0x7919('0xe')],'isexternal':_0x121673[_0x7919('0xf')],'context':_0x121673[_0x7919('0x10')],'extension':_0x121673[_0x7919('0x11')],'type':'blind'},'log':_0x7919('0x2')});};exports['attendedTransfer']=function(_0xefad17){return client[_0x7919('0x12')](_0x7919('0x2'),{'body':{'result':_0xefad17[_0x7919('0x3')],'transfererchannel':_0xefad17[_0x7919('0x13')],'transferercalleridnum':_0xefad17['origtransferercalleridnum'],'transferercalleridname':_0xefad17[_0x7919('0x14')],'transfererconnectedlinenum':_0xefad17[_0x7919('0x15')],'transfererconnectedlinename':_0xefad17[_0x7919('0x16')],'transfereraccountcode':_0xefad17[_0x7919('0x17')],'transferercontext':_0xefad17[_0x7919('0x18')],'transfererexten':_0xefad17[_0x7919('0x19')],'transfererlinkedid':_0xefad17[_0x7919('0x1a')],'transfereechannel':_0xefad17['transfertargetchannel'],'transfereecalleridnum':_0xefad17[_0x7919('0x1b')],'transfereecalleridname':_0xefad17[_0x7919('0x1c')],'transfereeconnectedlinenum':_0xefad17['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xefad17['transfertargetconnectedlinename'],'transfereeaccountcode':_0xefad17[_0x7919('0x1d')],'transfereecontext':_0xefad17['transfertargetcontext'],'transfereeexten':_0xefad17[_0x7919('0x1e')],'transfereelinkedid':_0xefad17[_0x7919('0x1f')],'isexternal':_0xefad17[_0x7919('0xf')],'context':_0xefad17[_0x7919('0x20')],'extension':_0xefad17[_0x7919('0x21')],'type':_0x7919('0x22')},'log':_0x7919('0x2')});}; \ No newline at end of file +var _0xf9fc=['transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext'];(function(_0x3d2aa0,_0x540045){var _0x36f51c=function(_0x3810a0){while(--_0x3810a0){_0x3d2aa0['push'](_0x3d2aa0['shift']());}};_0x36f51c(++_0x540045);}(_0xf9fc,0x68));var _0xcf9f=function(_0x700f07,_0x457310){_0x700f07=_0x700f07-0x0;var _0x2b7788=_0xf9fc[_0x700f07];return _0x2b7788;};'use strict';var client=require(_0xcf9f('0x0'));exports[_0xcf9f('0x1')]=function(_0x90d25f){return client[_0xcf9f('0x2')](_0xcf9f('0x3'),{'body':{'result':_0x90d25f[_0xcf9f('0x4')],'transfererchannel':_0x90d25f['transfererchannel'],'transferercalleridnum':_0x90d25f[_0xcf9f('0x5')],'transferercalleridname':_0x90d25f[_0xcf9f('0x6')],'transfererconnectedlinenum':_0x90d25f[_0xcf9f('0x7')],'transfererconnectedlinename':_0x90d25f['transfererconnectedlinename'],'transfereraccountcode':_0x90d25f[_0xcf9f('0x8')],'transferercontext':_0x90d25f[_0xcf9f('0x9')],'transfererexten':_0x90d25f['transfererexten'],'transfererlinkedid':_0x90d25f[_0xcf9f('0xa')],'transfereechannel':_0x90d25f[_0xcf9f('0xb')],'transfereecalleridnum':_0x90d25f[_0xcf9f('0xc')],'transfereecalleridname':_0x90d25f['transfereecalleridname'],'transfereeconnectedlinenum':_0x90d25f[_0xcf9f('0xd')],'transfereeconnectedlinename':_0x90d25f[_0xcf9f('0xe')],'transfereeaccountcode':_0x90d25f[_0xcf9f('0xf')],'transfereecontext':_0x90d25f[_0xcf9f('0x10')],'transfereeexten':_0x90d25f['transfereeexten'],'transfereelinkedid':_0x90d25f[_0xcf9f('0x11')],'isexternal':_0x90d25f[_0xcf9f('0x12')],'context':_0x90d25f['context'],'extension':_0x90d25f[_0xcf9f('0x13')],'type':_0xcf9f('0x14')},'log':_0xcf9f('0x3')});};exports['attendedTransfer']=function(_0x909d07){return client[_0xcf9f('0x2')](_0xcf9f('0x3'),{'body':{'result':_0x909d07[_0xcf9f('0x4')],'transfererchannel':_0x909d07[_0xcf9f('0x15')],'transferercalleridnum':_0x909d07[_0xcf9f('0x16')],'transferercalleridname':_0x909d07[_0xcf9f('0x17')],'transfererconnectedlinenum':_0x909d07[_0xcf9f('0x18')],'transfererconnectedlinename':_0x909d07['secondtransfererconnectedlinename'],'transfereraccountcode':_0x909d07['origtransfereraccountcode'],'transferercontext':_0x909d07[_0xcf9f('0x19')],'transfererexten':_0x909d07[_0xcf9f('0x1a')],'transfererlinkedid':_0x909d07['origtransfererlinkedid'],'transfereechannel':_0x909d07[_0xcf9f('0x1b')],'transfereecalleridnum':_0x909d07[_0xcf9f('0x1c')],'transfereecalleridname':_0x909d07[_0xcf9f('0x1d')],'transfereeconnectedlinenum':_0x909d07[_0xcf9f('0x1e')],'transfereeconnectedlinename':_0x909d07[_0xcf9f('0x1f')],'transfereeaccountcode':_0x909d07[_0xcf9f('0x20')],'transfereecontext':_0x909d07[_0xcf9f('0x21')],'transfereeexten':_0x909d07[_0xcf9f('0x22')],'transfereelinkedid':_0x909d07[_0xcf9f('0x23')],'isexternal':_0x909d07['isexternal'],'context':_0x909d07['origtransferercontext'],'extension':_0x909d07[_0xcf9f('0x24')],'type':_0xcf9f('0x25')},'log':_0xcf9f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index bb230a9..5d77fdc 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 _0xec4e=['active','callerid','Interval','values','channels','length','map','uniqueid','channel','format','%s.%s','wav','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','run','event','emit','custom:','faxAccounts','send','checkAfterSend','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','module','Reload','Action','then','message','catch','ami\x20disconnected','action','Command','content','hasOwnProperty','voiceQueues','strategy','sumBillable','sumHoldTime','talking','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','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'];(function(_0xb5d53e,_0x4b3c89){var _0x530a6e=function(_0x13bbd7){while(--_0x13bbd7){_0xb5d53e['push'](_0xb5d53e['shift']());}};_0x530a6e(++_0x4b3c89);}(_0xec4e,0xbd));var _0xeec4=function(_0x2fef2c,_0x358d13){_0x2fef2c=_0x2fef2c-0x0;var _0x37c7eb=_0xec4e[_0x2fef2c];return _0x37c7eb;};'use strict';var _=require(_0xeec4('0x0'));var util=require(_0xeec4('0x1'));var jayson=require(_0xeec4('0x2'));var schema=require(_0xeec4('0x3'));var BPromise=require(_0xeec4('0x4'));var moment=require(_0xeec4('0x5'));var config=require(_0xeec4('0x6'));var properties=require('../properties');var ami=require('../ami');exports['listen']=function(_0x5477cf,_0x130215,_0x475baf){return new BPromise(function(_0x24cbd1,_0x5ad8ff){var _0x2b810b={'QueuePause':function(_0x595828){return new Promise(function(_0x48a011,_0x373a7a){var _0x65535e=util['format'](_0xeec4('0x7'),_0xeec4('0x8'),_0x595828[_0xeec4('0x9')]);if(_0x5477cf[_0xeec4('0xa')]&&_0x5477cf[_0xeec4('0xa')][_0x65535e]&&_0x5477cf[_0xeec4('0xa')][_0x65535e]['timer']){_0x5477cf[_0xeec4('0xa')][_0x65535e][_0xeec4('0xb')]();}if(_0x5477cf[_0xeec4('0xc')][_0x65535e]){_0x5477cf[_0xeec4('0xc')][_0x65535e][_0xeec4('0xd')]({'statePause':_0x595828[_0xeec4('0xe')]?!![]:![]});}_0x48a011({'code':0xc8,'message':_0xeec4('0xf')});});},'Reload':function(_0xa8a6b6){var _0x3ffd2d=this;return new Promise(function(_0x2707df,_0x3359e6){if(ami[_0xeec4('0x10')]()==![]){return _0x3359e6(_0x3ffd2d[_0xeec4('0x11')](0x1f4,[config[_0xeec4('0x12')]['ip'],config[_0xeec4('0x12')][_0xeec4('0x13')],'ami\x20disconnected'][_0xeec4('0x14')]('\x20')));}_0xa8a6b6=_[_0xeec4('0x15')](_0xa8a6b6,_['keys'](properties[_0xeec4('0x16')]));_0xa8a6b6['action']=_0xeec4('0x17');return ami[_0xeec4('0x18')](_0xa8a6b6)[_0xeec4('0x19')](function(_0x1ce7b4){_0x2707df({'code':0xc8,'message':_0x1ce7b4[_0xeec4('0x1a')]});})[_0xeec4('0x1b')](function(_0x26dbf6){_0x3359e6(_0x3ffd2d[_0xeec4('0x11')](0x1f5,_0x26dbf6['message']));});});},'Command':function(_0x324398){var _0x4e59b6=this;return new Promise(function(_0x140f2b,_0x285d07){if(ami['isConnected']()==![]){return _0x285d07(_0x4e59b6[_0xeec4('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xeec4('0x13')],_0xeec4('0x1c')]['join']('\x20')));}_0x324398=_[_0xeec4('0x15')](_0x324398,'command');_0x324398[_0xeec4('0x1d')]=_0xeec4('0x1e');return ami[_0xeec4('0x18')](_0x324398)[_0xeec4('0x19')](function(_0x265d84){_0x140f2b({'code':0xc8,'message':_0x265d84[_0xeec4('0x1f')]});})[_0xeec4('0x1b')](function(_0x3d54eb){_0x285d07(_0x4e59b6['error'](0x1f5,_0x3d54eb[_0xeec4('0x1a')]));});});},'VoiceQueues':function(_0x2cc2a5){return new Promise(function(_0x24f86d,_0x1eb5d4){var _0x30d8a7=[];for(var _0x290aed in _0x5477cf['voiceQueues']){if(_0x5477cf['voiceQueues'][_0xeec4('0x20')](_0x290aed)){var _0x428b26=_0x5477cf[_0xeec4('0x21')][_0x290aed];var _0x4c5e24={'id':_0x428b26['id'],'name':_0x428b26[_0xeec4('0x9')],'strategy':_0x428b26[_0xeec4('0x22')],'answered':_0x428b26['answered'],'available':_0x428b26['available'],'loggedIn':_0x428b26['loggedIn'],'pTalking':_0x428b26['pTalking'],'sumBillable':_0x428b26[_0xeec4('0x23')],'sumDuration':_0x428b26['sumDuration'],'sumHoldTime':_0x428b26[_0xeec4('0x24')]||0x0,'talking':_0x428b26[_0xeec4('0x25')],'total':_0x428b26['total'],'type':_0x428b26['type'],'unmanaged':_0x428b26['unmanaged'],'abandoned':_0x428b26['abandoned'],'waiting':_0x428b26[_0xeec4('0x26')],'loggedInDb':_0x428b26[_0xeec4('0x27')]};if(_0x428b26[_0xeec4('0x28')]==='outbound'){_0x4c5e24['dialActive']=_0x428b26[_0xeec4('0x29')];_0x4c5e24['dialMethod']=_0x428b26[_0xeec4('0x2a')];_0x4c5e24[_0xeec4('0x2b')]=_0x428b26['dialOriginateCallerIdName'];_0x4c5e24[_0xeec4('0x2c')]=_0x428b26['dialOriginateCallerIdNumber'];_0x4c5e24['dialOriginateTimeout']=_0x428b26[_0xeec4('0x2d')];_0x4c5e24['dialPrefix']=_0x428b26['dialPrefix'];_0x4c5e24[_0xeec4('0x2e')]=_0x428b26[_0xeec4('0x2e')];_0x4c5e24[_0xeec4('0x2f')]=_0x428b26[_0xeec4('0x2f')];_0x4c5e24['outboundBlacklistCallsDay']=_0x428b26[_0xeec4('0x30')];_0x4c5e24[_0xeec4('0x31')]=_0x428b26[_0xeec4('0x31')];_0x4c5e24[_0xeec4('0x32')]=_0x428b26[_0xeec4('0x32')];_0x4c5e24['outboundDropCallsDayACS']=_0x428b26[_0xeec4('0x33')];_0x4c5e24[_0xeec4('0x34')]=_0x428b26[_0xeec4('0x34')];_0x4c5e24['outboundDropCallsDayTimeout']=_0x428b26[_0xeec4('0x35')];_0x4c5e24[_0xeec4('0x36')]=_0x428b26['outboundNoAnswerCallsDay'];_0x4c5e24[_0xeec4('0x37')]=_0x428b26[_0xeec4('0x37')];_0x4c5e24[_0xeec4('0x38')]=_0x428b26[_0xeec4('0x38')];_0x4c5e24[_0xeec4('0x39')]=_0x428b26[_0xeec4('0x39')];_0x4c5e24[_0xeec4('0x3a')]=_0x428b26['outboundRejectCallsDay'];_0x4c5e24[_0xeec4('0x3b')]=_0x428b26['outboundUnknownCallsDay'];_0x4c5e24[_0xeec4('0x3c')]=_0x428b26[_0xeec4('0x3c')];_0x4c5e24[_0xeec4('0x3d')]=_0x428b26[_0xeec4('0x3d')];_0x4c5e24['predictiveIntervalAvgTalktime']=_0x428b26['predictiveIntervalAvgTalktime'];_0x4c5e24[_0xeec4('0x3e')]=_0x428b26[_0xeec4('0x3e')];_0x4c5e24[_0xeec4('0x3f')]=_0x428b26['predictiveIntervalDroppedCallsTimeout'];_0x4c5e24['predictiveIntervalErlangCalls']=_0x428b26[_0xeec4('0x40')];_0x4c5e24[_0xeec4('0x41')]=_0x428b26[_0xeec4('0x41')];_0x4c5e24[_0xeec4('0x42')]=_0x428b26[_0xeec4('0x42')];_0x4c5e24[_0xeec4('0x43')]=_0x428b26[_0xeec4('0x43')];_0x4c5e24[_0xeec4('0x44')]=_0x428b26[_0xeec4('0x44')];_0x4c5e24[_0xeec4('0x45')]=_0x428b26[_0xeec4('0x45')];_0x4c5e24[_0xeec4('0x46')]=_0x428b26[_0xeec4('0x46')];_0x4c5e24[_0xeec4('0x1a')]=_0x428b26[_0xeec4('0x1a')];_0x4c5e24[_0xeec4('0x47')]=_0x428b26[_0xeec4('0x47')];_0x4c5e24[_0xeec4('0x48')]=_0x428b26[_0xeec4('0x48')];_0x4c5e24[_0xeec4('0x49')]=_0x428b26[_0xeec4('0x49')];_0x4c5e24['erlangAbandonmentRate']=_0x428b26[_0xeec4('0x4a')];_0x4c5e24[_0xeec4('0x4b')]=_0x428b26['erlangBusyFactor'];_0x4c5e24[_0xeec4('0x4c')]=_0x428b26[_0xeec4('0x4c')];_0x4c5e24[_0xeec4('0x4d')]=_0x428b26[_0xeec4('0x4d')];}if(_0x428b26[_0xeec4('0x4e')]){_0x4c5e24['Trunk']={'id':_0x428b26[_0xeec4('0x4e')]['id'],'name':_0x428b26[_0xeec4('0x4e')][_0xeec4('0x9')],'active':_0x428b26[_0xeec4('0x4e')][_0xeec4('0x4f')],'callerid':_0x428b26[_0xeec4('0x4e')][_0xeec4('0x50')]};}if(_0x428b26[_0xeec4('0x51')]){_0x4c5e24['Interval']={'id':_0x428b26[_0xeec4('0x51')]['id'],'name':_0x428b26[_0xeec4('0x51')][_0xeec4('0x9')]};}_0x30d8a7['push'](_0x4c5e24);}}_0x24f86d({'count':_0x30d8a7['length'],'rows':_0x30d8a7});});},'VoiceChannels':function(_0x2ea5c5){return new Promise(function(_0x5da73f,_0x491738){var _0x598580=_[_0xeec4('0x52')](_0x5477cf[_0xeec4('0x53')]);_0x5da73f({'count':_0x598580['length'],'rows':_0x598580});});},'VoiceChannelMixMonitor':function(_0x5ba291){var _0x572a56=this;return new Promise(function(_0x3ccc44,_0x1db540){if(ami[_0xeec4('0x10')]()==![]){return _0x1db540(_0x572a56[_0xeec4('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xeec4('0x13')],_0xeec4('0x1c')]['join']('\x20')));}var _0x4ef474=schema(properties['voicechannel'])[_0xeec4('0x3')](_0x5ba291);if(_0x4ef474[_0xeec4('0x54')]>0x0){return _0x1db540(_0x572a56[_0xeec4('0x11')](0x1f4,_[_0xeec4('0x55')](_0x4ef474,_0xeec4('0x1a'))['join'](',\x20')));}var _0x5b16a0=_['find'](_0x5477cf['channels'],{'uniqueid':_0x5ba291[_0xeec4('0x56')]});if(_0x5b16a0&&_0x5b16a0[_0xeec4('0x57')]){var _0x4d8a61=util[_0xeec4('0x58')](_0xeec4('0x59'),_0x5ba291['filename']||_0x5ba291['uniqueid'],_0x5ba291[_0xeec4('0x58')]||_0xeec4('0x5a'));return ami[_0xeec4('0x18')]({'action':_0xeec4('0x5b'),'channel':_0x5b16a0['channel'],'file':_0x4d8a61,'options':_0xeec4('0x5c')})[_0xeec4('0x19')](function(_0x1df093){var _0xb4c1b0=_[_0xeec4('0x5d')](_0x5b16a0[_0xeec4('0x5e')],{'filename':_0xeec4('0x5f')+_0x4d8a61['toLowerCase']()});if(_[_0xeec4('0x60')](_0xb4c1b0)){_0x5b16a0[_0xeec4('0x5e')]['push']({'filename':_0xeec4('0x5f')+_0x4d8a61[_0xeec4('0x61')](),'createdAt':moment()['format'](_0xeec4('0x62')),'mixmonitorid':_0x1df093[_0xeec4('0x63')],'status':_0xeec4('0x64')});}else{_0xb4c1b0['mixmonitorid']=_0x1df093[_0xeec4('0x63')];_0xb4c1b0[_0xeec4('0x65')]=_0xeec4('0x64');}_0x3ccc44({'code':0xc8,'message':[_0x5ba291[_0xeec4('0x56')],'MixMonitor\x20Success',_0x1df093['mixmonitorid']][_0xeec4('0x14')]('\x20'),'mixmonitorid':_0x1df093[_0xeec4('0x63')]});})['catch'](function(_0x2f88be){_0x1db540(_0x572a56[_0xeec4('0x11')](0x1f5,[_0x5ba291[_0xeec4('0x56')],_0x2f88be[_0xeec4('0x1a')][_0xeec4('0x61')]()][_0xeec4('0x14')]('\x20')));});}else{return _0x1db540(_0x572a56[_0xeec4('0x11')](0x1f5,_0xeec4('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x1aa124){var _0x5761ca=this;return new Promise(function(_0x1287f3,_0x41f8fa){if(ami[_0xeec4('0x10')]()==![]){return _0x41f8fa(_0x5761ca[_0xeec4('0x11')](0x1f4,[config[_0xeec4('0x12')]['ip'],config['asterisk'][_0xeec4('0x13')],_0xeec4('0x1c')]['join']('\x20')));}var _0x5debc1=schema(properties[_0xeec4('0x67')])[_0xeec4('0x3')](_0x1aa124);if(_0x5debc1[_0xeec4('0x54')]>0x0){return _0x41f8fa(_0x5761ca[_0xeec4('0x11')](0x1f4,_[_0xeec4('0x55')](_0x5debc1,_0xeec4('0x1a'))[_0xeec4('0x14')](',\x20')));}var _0x48e083=_[_0xeec4('0x5d')](_0x5477cf[_0xeec4('0x53')],{'uniqueid':_0x1aa124[_0xeec4('0x56')]});if(_0x48e083){return BPromise[_0xeec4('0x68')]()['then'](function(){if(_0x48e083[_0xeec4('0x57')]){return ami[_0xeec4('0x18')]({'action':_0xeec4('0x69'),'channel':_0x48e083[_0xeec4('0x57')],'mixmonitorid':_0x1aa124[_0xeec4('0x63')]})['catch'](function(_0xb781a){});}})[_0xeec4('0x19')](function(){if(_0x48e083[_0xeec4('0x6a')]){return ami['Action']({'action':_0xeec4('0x69'),'channel':_0x48e083[_0xeec4('0x6a')],'mixmonitorid':_0x1aa124['mixmonitorid']})[_0xeec4('0x1b')](function(_0x1a3b6e){});}})[_0xeec4('0x19')](function(_0x54380c){var _0x2afaa8=_[_0xeec4('0x5d')](_0x48e083['monitors'],{'mixmonitorid':_0x1aa124['mixmonitorid']});if(_0x2afaa8){_0x2afaa8[_0xeec4('0x65')]=_0xeec4('0x6b');}})[_0xeec4('0x19')](function(){var _0x51790d=util[_0xeec4('0x58')](_0xeec4('0x59'),_0x1aa124[_0xeec4('0x6c')]||_0x1aa124['uniqueid'],_0x1aa124[_0xeec4('0x58')]||_0xeec4('0x5a'));var _0x12292b=_[_0xeec4('0x5d')](_0x48e083[_0xeec4('0x5e')],{'filename':_0xeec4('0x5f')+_0x51790d[_0xeec4('0x61')]()});if(_0x12292b){_0x12292b[_0xeec4('0x65')]=_0xeec4('0x6b');}})['then'](function(){_0x1287f3({'code':0xc8,'message':[_0x1aa124[_0xeec4('0x56')],_0xeec4('0x6d')]['join']('\x20')});})[_0xeec4('0x1b')](function(_0x28a0cf){_0x41f8fa(_0x5761ca[_0xeec4('0x11')](0x1f5,[_0x1aa124['uniqueid'],_0x28a0cf[_0xeec4('0x1a')][_0xeec4('0x61')]()][_0xeec4('0x14')]('\x20')));});}else{return _0x41f8fa(_0x5761ca[_0xeec4('0x11')](0x1f5,_0xeec4('0x66')));}});},'VoiceQueuesChannels':function(_0x2ee91d){return new Promise(function(_0x3f3595,_0x45c3a2){var _0x4cdabf=_[_0xeec4('0x52')](_0x5477cf[_0xeec4('0x6e')]);_0x3f3595({'count':_0x4cdabf[_0xeec4('0x54')],'rows':_0x4cdabf});});},'VoiceQueuesChannel':function(_0x580680){var _0x5f465d=this;return new Promise(function(_0x1f89a7,_0x2e89f4){var _0x2e4b49=schema(properties[_0xeec4('0x6f')])[_0xeec4('0x3')](_0x580680);if(_0x2e4b49[_0xeec4('0x54')]>0x0){return _0x2e89f4(_0x5f465d['error'](0x1f4,_[_0xeec4('0x55')](_0x2e4b49,_0xeec4('0x1a'))[_0xeec4('0x14')](',\x20')));}var _0x96a063=_[_0xeec4('0x5d')](_0x5477cf[_0xeec4('0x6e')],{'uniqueid':_0x580680[_0xeec4('0x56')]});if(_0x96a063){_0x1f89a7(_0x96a063);}else{return _0x2e89f4(_0x5f465d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3f2936){var _0x490a2f=this;return new Promise(function(_0x2080a3,_0x54fe50){if(ami[_0xeec4('0x10')]()==![]){return _0x54fe50(_0x490a2f[_0xeec4('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xeec4('0x1c')][_0xeec4('0x14')]('\x20')));}var _0x19b915=schema(properties[_0xeec4('0x70')])[_0xeec4('0x3')](_0x3f2936);if(_0x19b915[_0xeec4('0x54')]>0x0){return _0x54fe50(_0x490a2f[_0xeec4('0x11')](0x1f4,_[_0xeec4('0x55')](_0x19b915,_0xeec4('0x1a'))[_0xeec4('0x14')](',\x20')));}var _0x2dced8=_['find'](_0x5477cf[_0xeec4('0x6e')],{'uniqueid':_0x3f2936[_0xeec4('0x56')]});if(_0x2dced8&&_0x2dced8['channel']){return ami[_0xeec4('0x18')]({'action':_0xeec4('0x71'),'channel':_0x2dced8[_0xeec4('0x57')]})['then'](function(_0x4589f8){_0x2080a3({'code':0xc8,'message':[_0x3f2936[_0xeec4('0x56')],_0x4589f8[_0xeec4('0x1a')][_0xeec4('0x61')]()]['join']('\x20')});})[_0xeec4('0x1b')](function(_0xbdee4f){_0x54fe50(_0x490a2f[_0xeec4('0x11')](0x1f5,[_0x3f2936[_0xeec4('0x56')],_0xbdee4f['message'][_0xeec4('0x61')]()][_0xeec4('0x14')]('\x20')));});}else{return _0x54fe50(_0x490a2f['error'](0x1f5,_0xeec4('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x8296e4){var _0x16aba5=this;return new Promise(function(_0x3ce5d7,_0x2d09f5){if(ami['isConnected']()==![]){return _0x2d09f5(_0x16aba5['error'](0x1f4,[config['asterisk']['ip'],config[_0xeec4('0x12')]['username'],'ami\x20disconnected'][_0xeec4('0x14')]('\x20')));}var _0x33d03a=schema(properties[_0xeec4('0x72')])['validate'](_0x8296e4);if(_0x33d03a[_0xeec4('0x54')]>0x0){return _0x2d09f5(_0x16aba5[_0xeec4('0x11')](0x1f4,_[_0xeec4('0x55')](_0x33d03a,_0xeec4('0x1a'))['join'](',\x20')));}var _0x104332=_[_0xeec4('0x5d')](_0x5477cf[_0xeec4('0x6e')],{'uniqueid':_0x8296e4[_0xeec4('0x56')]});if(_0x104332&&_0x104332[_0xeec4('0x57')]){return ami[_0xeec4('0x18')]({'action':_0xeec4('0x73'),'channel':_0x104332['channel'],'exten':_0x8296e4[_0xeec4('0x74')],'context':_0x8296e4[_0xeec4('0x75')]||_0x104332[_0xeec4('0x75')],'priority':0x1})[_0xeec4('0x19')](function(_0x57a84c){_0x3ce5d7({'code':0xc8,'message':[_0x8296e4[_0xeec4('0x56')],_0x57a84c[_0xeec4('0x1a')][_0xeec4('0x61')]()][_0xeec4('0x14')]('\x20')});})['catch'](function(_0x34256e){_0x2d09f5(_0x16aba5[_0xeec4('0x11')](0x1f5,[_0x8296e4[_0xeec4('0x56')],_0x34256e[_0xeec4('0x1a')][_0xeec4('0x61')]()][_0xeec4('0x14')]('\x20')));});}else{return _0x2d09f5(_0x16aba5[_0xeec4('0x11')](0x1f5,_0xeec4('0x66')));}});},'Agents':function(_0x6e2b80){return new Promise(function(_0x217073,_0x92a235){var _0x5164ea=_[_0xeec4('0x52')](_0x5477cf['agents']);_0x217073({'count':_0x5164ea['length'],'rows':_0x5164ea});});},'Telephones':function(_0x313dfa){return new Promise(function(_0x437603,_0x2ec54d){var _0xd21c9b=_[_0xeec4('0x52')](_0x5477cf[_0xeec4('0x76')]);_0x437603({'count':_0xd21c9b[_0xeec4('0x54')],'rows':_0xd21c9b});});},'Trunks':function(_0x3b4ef0){return new Promise(function(_0x1753ed,_0x5ab0ee){var _0x14a0c5=_['values'](_0x5477cf[_0xeec4('0x77')]);_0x1753ed({'count':_0x14a0c5[_0xeec4('0x54')],'rows':_0x14a0c5});});},'OutboundChannels':function(_0x486f40){return new Promise(function(_0x246b89,_0x50fca1){var _0x1b6142=_['values'](_0x5477cf[_0xeec4('0x78')]);_0x246b89({'count':_0x1b6142[_0xeec4('0x54')],'rows':_0x1b6142});});},'Outbound':function(_0x3633f1){return new Promise(function(_0x1ed71a,_0x3d89b5){_0x1ed71a(_0x5477cf[_0xeec4('0x79')]);});},'Campaigns':function(_0x12e3b2){return new Promise(function(_0x28f2bd,_0x35dd97){var _0x61178=_[_0xeec4('0x52')](_0x5477cf['campaigns']);_0x28f2bd({'count':_0x61178['length'],'rows':_0x61178});});},'VoiceQueuesPreview':function(_0x123167){var _0x1c4c84=this;return new Promise(function(_0x42c2f8,_0x5ad487){_0x130215[_0xeec4('0x7a')](_0x123167['id'])['then'](function(_0x4877c7){_0x42c2f8({'code':0xc8,'message':_0x4877c7['message']});})[_0xeec4('0x1b')](function(_0xbb995c){_0x5ad487(_0x1c4c84[_0xeec4('0x11')](0x1f4,_0xbb995c['message']));});});},'EventManager':function(_0xb43c60){var _0x2d02f2=this;return new Promise(function(_0x4146cf,_0xb7b463){if(!_0xb43c60[_0xeec4('0x7b')]){return _0xb7b463(_0x2d02f2[_0xeec4('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xeec4('0x7c')](_0xeec4('0x7d')+_0xb43c60[_0xeec4('0x7b')],_0xb43c60[_0xeec4('0x1a')]);_0x4146cf({'code':0xc8,'message':_0xb43c60});});},'FaxAccounts':function(_0x3faa49){return new Promise(function(_0x3d919a,_0x5653f6){var _0x412131=_[_0xeec4('0x52')](_0x5477cf[_0xeec4('0x7e')]);_0x3d919a({'count':_0x412131[_0xeec4('0x54')],'rows':_0x412131});});},'SendFax':function(_0x4b307e){var _0x50be1a=this;return new Promise(function(_0x254c93,_0xe13025){_0x475baf[_0xeec4('0x7f')](_0x4b307e)[_0xeec4('0x19')](function(_0x378436){_0x254c93({'code':0xc8,'message':_0x378436['message']});})[_0xeec4('0x1b')](function(_0x3b964b){_0xe13025(_0x50be1a[_0xeec4('0x11')](0x1f4,_0x3b964b['message']));});});},'CheckAfterSend':function(_0x3f1fa9){var _0x3222a2=this;return new Promise(function(_0x5a0361,_0x40a228){_0x475baf[_0xeec4('0x80')](_0x3f1fa9)[_0xeec4('0x19')](function(_0x13f82c){_0x5a0361({'code':0xc8,'message':_0x13f82c[_0xeec4('0x1a')]});})[_0xeec4('0x1b')](function(_0x575137){_0x40a228(_0x3222a2[_0xeec4('0x11')](0x1f4,_0x575137[_0xeec4('0x1a')]));});});}};var _0xcdedf7=jayson['server'](_0x2b810b)[_0xeec4('0x81')]();_0xcdedf7['on']('error',function(_0x371baa){return _0x5ad8ff(_0x371baa);});_0xcdedf7[_0xeec4('0x82')](0x232a,'127.0.0.1',function(){console[_0xeec4('0x83')](_0xeec4('0x84'),0x232a);return _0x24cbd1(_0xeec4('0x85')+0x232a);});});}; \ No newline at end of file +var _0xa6c0=['custom:','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','Reload','then','message','command','action','Action','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','values','channels','length','map','find','channel','%s.%s','filename','uniqueid','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','voicechannel','destinationchannel','stop','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit'];(function(_0x51117e,_0x41834e){var _0x215dd1=function(_0x15f5ab){while(--_0x15f5ab){_0x51117e['push'](_0x51117e['shift']());}};_0x215dd1(++_0x41834e);}(_0xa6c0,0x8b));var _0x0a6c=function(_0x286a64,_0x2f2caa){_0x286a64=_0x286a64-0x0;var _0x1d535d=_0xa6c0[_0x286a64];return _0x1d535d;};'use strict';var _=require('lodash');var util=require(_0x0a6c('0x0'));var jayson=require(_0x0a6c('0x1'));var schema=require(_0x0a6c('0x2'));var BPromise=require('bluebird');var moment=require(_0x0a6c('0x3'));var config=require(_0x0a6c('0x4'));var properties=require(_0x0a6c('0x5'));var ami=require(_0x0a6c('0x6'));exports['listen']=function(_0x788eea,_0xa05c05,_0x4a9d92){return new BPromise(function(_0x571b0c,_0x52cb25){var _0x98029b={'QueuePause':function(_0x57afcb){return new Promise(function(_0x3e70be,_0x3066cb){var _0x16fdf4=util[_0x0a6c('0x7')](_0x0a6c('0x8'),_0x0a6c('0x9'),_0x57afcb[_0x0a6c('0xa')]);if(_0x788eea[_0x0a6c('0xb')]&&_0x788eea[_0x0a6c('0xb')][_0x16fdf4]&&_0x788eea['timers'][_0x16fdf4][_0x0a6c('0xc')]){_0x788eea[_0x0a6c('0xb')][_0x16fdf4][_0x0a6c('0xd')]();}if(_0x788eea[_0x0a6c('0xe')][_0x16fdf4]){_0x788eea['agents'][_0x16fdf4]['updateStatusRealtime']({'statePause':_0x57afcb[_0x0a6c('0xf')]?!![]:![]});}_0x3e70be({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x15de38){var _0x858c89=this;return new Promise(function(_0xc68bf6,_0x1e2028){if(ami[_0x0a6c('0x10')]()==![]){return _0x1e2028(_0x858c89[_0x0a6c('0x11')](0x1f4,[config[_0x0a6c('0x12')]['ip'],config[_0x0a6c('0x12')][_0x0a6c('0x13')],_0x0a6c('0x14')][_0x0a6c('0x15')]('\x20')));}_0x15de38=_[_0x0a6c('0x16')](_0x15de38,_['keys'](properties['module']));_0x15de38['action']=_0x0a6c('0x17');return ami['Action'](_0x15de38)[_0x0a6c('0x18')](function(_0x39cdf1){_0xc68bf6({'code':0xc8,'message':_0x39cdf1['message']});})['catch'](function(_0xe83bfd){_0x1e2028(_0x858c89[_0x0a6c('0x11')](0x1f5,_0xe83bfd[_0x0a6c('0x19')]));});});},'Command':function(_0x1c83c4){var _0x4e40af=this;return new Promise(function(_0x21f6f7,_0x552d4c){if(ami[_0x0a6c('0x10')]()==![]){return _0x552d4c(_0x4e40af[_0x0a6c('0x11')](0x1f4,[config[_0x0a6c('0x12')]['ip'],config[_0x0a6c('0x12')][_0x0a6c('0x13')],_0x0a6c('0x14')][_0x0a6c('0x15')]('\x20')));}_0x1c83c4=_['pick'](_0x1c83c4,_0x0a6c('0x1a'));_0x1c83c4[_0x0a6c('0x1b')]='Command';return ami[_0x0a6c('0x1c')](_0x1c83c4)[_0x0a6c('0x18')](function(_0x4ab18f){_0x21f6f7({'code':0xc8,'message':_0x4ab18f['content']});})[_0x0a6c('0x1d')](function(_0xf61d31){_0x552d4c(_0x4e40af[_0x0a6c('0x11')](0x1f5,_0xf61d31[_0x0a6c('0x19')]));});});},'VoiceQueues':function(_0x100b52){return new Promise(function(_0x1e38d2,_0x94df57){var _0x48bf9c=[];for(var _0x58f397 in _0x788eea[_0x0a6c('0x1e')]){if(_0x788eea['voiceQueues'][_0x0a6c('0x1f')](_0x58f397)){var _0x140f48=_0x788eea[_0x0a6c('0x1e')][_0x58f397];var _0x45cc53={'id':_0x140f48['id'],'name':_0x140f48[_0x0a6c('0xa')],'strategy':_0x140f48[_0x0a6c('0x20')],'answered':_0x140f48[_0x0a6c('0x21')],'available':_0x140f48[_0x0a6c('0x22')],'loggedIn':_0x140f48[_0x0a6c('0x23')],'pTalking':_0x140f48['pTalking'],'sumBillable':_0x140f48[_0x0a6c('0x24')],'sumDuration':_0x140f48[_0x0a6c('0x25')],'sumHoldTime':_0x140f48[_0x0a6c('0x26')]||0x0,'talking':_0x140f48['talking'],'total':_0x140f48['total'],'type':_0x140f48['type'],'unmanaged':_0x140f48[_0x0a6c('0x27')],'abandoned':_0x140f48['abandoned'],'waiting':_0x140f48[_0x0a6c('0x28')],'loggedInDb':_0x140f48[_0x0a6c('0x29')]};if(_0x140f48[_0x0a6c('0x2a')]===_0x0a6c('0x2b')){_0x45cc53['dialActive']=_0x140f48[_0x0a6c('0x2c')];_0x45cc53[_0x0a6c('0x2d')]=_0x140f48[_0x0a6c('0x2d')];_0x45cc53[_0x0a6c('0x2e')]=_0x140f48[_0x0a6c('0x2e')];_0x45cc53[_0x0a6c('0x2f')]=_0x140f48[_0x0a6c('0x2f')];_0x45cc53[_0x0a6c('0x30')]=_0x140f48[_0x0a6c('0x30')];_0x45cc53[_0x0a6c('0x31')]=_0x140f48[_0x0a6c('0x31')];_0x45cc53[_0x0a6c('0x32')]=_0x140f48[_0x0a6c('0x32')];_0x45cc53['outboundAnswerCallsDay']=_0x140f48[_0x0a6c('0x33')];_0x45cc53[_0x0a6c('0x34')]=_0x140f48[_0x0a6c('0x34')];_0x45cc53['outboundBusyCallsDay']=_0x140f48['outboundBusyCallsDay'];_0x45cc53[_0x0a6c('0x35')]=_0x140f48[_0x0a6c('0x35')];_0x45cc53[_0x0a6c('0x36')]=_0x140f48[_0x0a6c('0x36')];_0x45cc53[_0x0a6c('0x37')]=_0x140f48[_0x0a6c('0x37')];_0x45cc53['outboundDropCallsDayTimeout']=_0x140f48[_0x0a6c('0x38')];_0x45cc53['outboundNoAnswerCallsDay']=_0x140f48['outboundNoAnswerCallsDay'];_0x45cc53[_0x0a6c('0x39')]=_0x140f48[_0x0a6c('0x39')];_0x45cc53[_0x0a6c('0x3a')]=_0x140f48[_0x0a6c('0x3a')];_0x45cc53[_0x0a6c('0x3b')]=_0x140f48['outboundReCallsDay'];_0x45cc53[_0x0a6c('0x3c')]=_0x140f48[_0x0a6c('0x3c')];_0x45cc53['outboundUnknownCallsDay']=_0x140f48[_0x0a6c('0x3d')];_0x45cc53['predictiveIntervalAnsweredCalls']=_0x140f48['predictiveIntervalAnsweredCalls'];_0x45cc53[_0x0a6c('0x3e')]=_0x140f48[_0x0a6c('0x3e')];_0x45cc53[_0x0a6c('0x3f')]=_0x140f48[_0x0a6c('0x3f')];_0x45cc53['predictiveIntervalDroppedCallsCallersExit']=_0x140f48[_0x0a6c('0x40')];_0x45cc53[_0x0a6c('0x41')]=_0x140f48[_0x0a6c('0x41')];_0x45cc53[_0x0a6c('0x42')]=_0x140f48[_0x0a6c('0x42')];_0x45cc53[_0x0a6c('0x43')]=_0x140f48['predictiveIntervalErlangCallsDroppedCalls'];_0x45cc53['predictiveIntervalHitRate']=_0x140f48[_0x0a6c('0x44')];_0x45cc53[_0x0a6c('0x45')]=_0x140f48['predictiveIntervalMultiplicativeFactor'];_0x45cc53[_0x0a6c('0x46')]=_0x140f48[_0x0a6c('0x46')];_0x45cc53[_0x0a6c('0x47')]=_0x140f48['predictiveIntervalAvailable'];_0x45cc53[_0x0a6c('0x48')]=_0x140f48[_0x0a6c('0x48')];_0x45cc53[_0x0a6c('0x19')]=_0x140f48[_0x0a6c('0x19')];_0x45cc53[_0x0a6c('0x49')]=_0x140f48[_0x0a6c('0x49')];_0x45cc53[_0x0a6c('0x4a')]=_0x140f48[_0x0a6c('0x4a')];_0x45cc53[_0x0a6c('0x4b')]=_0x140f48['erlangCallToSecond'];_0x45cc53[_0x0a6c('0x4c')]=_0x140f48['erlangAbandonmentRate'];_0x45cc53[_0x0a6c('0x4d')]=_0x140f48['erlangBusyFactor'];_0x45cc53[_0x0a6c('0x4e')]=_0x140f48[_0x0a6c('0x4e')];_0x45cc53['startProgressive']=_0x140f48[_0x0a6c('0x4f')];}if(_0x140f48['Trunk']){_0x45cc53['Trunk']={'id':_0x140f48['Trunk']['id'],'name':_0x140f48['Trunk'][_0x0a6c('0xa')],'active':_0x140f48[_0x0a6c('0x50')]['active'],'callerid':_0x140f48[_0x0a6c('0x50')][_0x0a6c('0x51')]};}if(_0x140f48[_0x0a6c('0x52')]){_0x45cc53['Interval']={'id':_0x140f48[_0x0a6c('0x52')]['id'],'name':_0x140f48['Interval']['name']};}_0x48bf9c[_0x0a6c('0x53')](_0x45cc53);}}_0x1e38d2({'count':_0x48bf9c['length'],'rows':_0x48bf9c});});},'VoiceChannels':function(_0x3868fb){return new Promise(function(_0x10d5a7,_0x3efd14){var _0xa12896=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0x55')]);_0x10d5a7({'count':_0xa12896[_0x0a6c('0x56')],'rows':_0xa12896});});},'VoiceChannelMixMonitor':function(_0x5d825b){var _0x174e35=this;return new Promise(function(_0x3fee3a,_0x6b3f60){if(ami['isConnected']()==![]){return _0x6b3f60(_0x174e35['error'](0x1f4,[config[_0x0a6c('0x12')]['ip'],config[_0x0a6c('0x12')][_0x0a6c('0x13')],_0x0a6c('0x14')][_0x0a6c('0x15')]('\x20')));}var _0x2f1033=schema(properties['voicechannel'])[_0x0a6c('0x2')](_0x5d825b);if(_0x2f1033[_0x0a6c('0x56')]>0x0){return _0x6b3f60(_0x174e35['error'](0x1f4,_[_0x0a6c('0x57')](_0x2f1033,'message')['join'](',\x20')));}var _0x3b4339=_[_0x0a6c('0x58')](_0x788eea[_0x0a6c('0x55')],{'uniqueid':_0x5d825b['uniqueid']});if(_0x3b4339&&_0x3b4339[_0x0a6c('0x59')]){var _0x45fa71=util['format'](_0x0a6c('0x5a'),_0x5d825b[_0x0a6c('0x5b')]||_0x5d825b[_0x0a6c('0x5c')],_0x5d825b['format']||'wav');return ami[_0x0a6c('0x1c')]({'action':_0x0a6c('0x5d'),'channel':_0x3b4339[_0x0a6c('0x59')],'file':_0x45fa71,'options':'ai(mixmonitorid)'})[_0x0a6c('0x18')](function(_0x5aecf2){var _0x2f76a1=_[_0x0a6c('0x58')](_0x3b4339[_0x0a6c('0x5e')],{'filename':_0x0a6c('0x5f')+_0x45fa71[_0x0a6c('0x60')]()});if(_['isNil'](_0x2f76a1)){_0x3b4339[_0x0a6c('0x5e')]['push']({'filename':_0x0a6c('0x5f')+_0x45fa71['toLowerCase'](),'createdAt':moment()[_0x0a6c('0x7')](_0x0a6c('0x61')),'mixmonitorid':_0x5aecf2['mixmonitorid'],'status':_0x0a6c('0x62')});}else{_0x2f76a1['mixmonitorid']=_0x5aecf2[_0x0a6c('0x63')];_0x2f76a1[_0x0a6c('0x64')]=_0x0a6c('0x62');}_0x3fee3a({'code':0xc8,'message':[_0x5d825b['uniqueid'],_0x0a6c('0x65'),_0x5aecf2['mixmonitorid']][_0x0a6c('0x15')]('\x20'),'mixmonitorid':_0x5aecf2[_0x0a6c('0x63')]});})[_0x0a6c('0x1d')](function(_0x298b7b){_0x6b3f60(_0x174e35[_0x0a6c('0x11')](0x1f5,[_0x5d825b[_0x0a6c('0x5c')],_0x298b7b[_0x0a6c('0x19')][_0x0a6c('0x60')]()][_0x0a6c('0x15')]('\x20')));});}else{return _0x6b3f60(_0x174e35[_0x0a6c('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x370a07){var _0x1382b4=this;return new Promise(function(_0xc4ba7e,_0x406dc2){if(ami[_0x0a6c('0x10')]()==![]){return _0x406dc2(_0x1382b4['error'](0x1f4,[config[_0x0a6c('0x12')]['ip'],config['asterisk'][_0x0a6c('0x13')],_0x0a6c('0x14')]['join']('\x20')));}var _0x45174c=schema(properties[_0x0a6c('0x66')])[_0x0a6c('0x2')](_0x370a07);if(_0x45174c[_0x0a6c('0x56')]>0x0){return _0x406dc2(_0x1382b4[_0x0a6c('0x11')](0x1f4,_[_0x0a6c('0x57')](_0x45174c,_0x0a6c('0x19'))[_0x0a6c('0x15')](',\x20')));}var _0x4d1ca9=_[_0x0a6c('0x58')](_0x788eea[_0x0a6c('0x55')],{'uniqueid':_0x370a07[_0x0a6c('0x5c')]});if(_0x4d1ca9){return BPromise['resolve']()[_0x0a6c('0x18')](function(){if(_0x4d1ca9[_0x0a6c('0x59')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4d1ca9[_0x0a6c('0x59')],'mixmonitorid':_0x370a07[_0x0a6c('0x63')]})[_0x0a6c('0x1d')](function(_0x50273a){});}})[_0x0a6c('0x18')](function(){if(_0x4d1ca9[_0x0a6c('0x67')]){return ami[_0x0a6c('0x1c')]({'action':'StopMixMonitor','channel':_0x4d1ca9[_0x0a6c('0x67')],'mixmonitorid':_0x370a07[_0x0a6c('0x63')]})[_0x0a6c('0x1d')](function(_0xe855eb){});}})[_0x0a6c('0x18')](function(_0x44ea80){var _0xf2a2ff=_[_0x0a6c('0x58')](_0x4d1ca9[_0x0a6c('0x5e')],{'mixmonitorid':_0x370a07[_0x0a6c('0x63')]});if(_0xf2a2ff){_0xf2a2ff[_0x0a6c('0x64')]=_0x0a6c('0x68');}})[_0x0a6c('0x18')](function(){var _0x5bcc1b=util['format']('%s.%s',_0x370a07['filename']||_0x370a07[_0x0a6c('0x5c')],_0x370a07[_0x0a6c('0x7')]||_0x0a6c('0x69'));var _0x3e7d16=_[_0x0a6c('0x58')](_0x4d1ca9[_0x0a6c('0x5e')],{'filename':_0x0a6c('0x5f')+_0x5bcc1b[_0x0a6c('0x60')]()});if(_0x3e7d16){_0x3e7d16['status']=_0x0a6c('0x68');}})[_0x0a6c('0x18')](function(){_0xc4ba7e({'code':0xc8,'message':[_0x370a07[_0x0a6c('0x5c')],_0x0a6c('0x6a')][_0x0a6c('0x15')]('\x20')});})[_0x0a6c('0x1d')](function(_0x32d36b){_0x406dc2(_0x1382b4[_0x0a6c('0x11')](0x1f5,[_0x370a07[_0x0a6c('0x5c')],_0x32d36b[_0x0a6c('0x19')]['toLowerCase']()][_0x0a6c('0x15')]('\x20')));});}else{return _0x406dc2(_0x1382b4[_0x0a6c('0x11')](0x1f5,_0x0a6c('0x6b')));}});},'VoiceQueuesChannels':function(_0x1f05df){return new Promise(function(_0x13c349,_0x4aefaf){var _0x132a47=_[_0x0a6c('0x54')](_0x788eea['queueChannels']);_0x13c349({'count':_0x132a47[_0x0a6c('0x56')],'rows':_0x132a47});});},'VoiceQueuesChannel':function(_0x17cb7a){var _0x586f72=this;return new Promise(function(_0xce5084,_0x3dfedb){var _0xe299ca=schema(properties['voicequeuechannel'])['validate'](_0x17cb7a);if(_0xe299ca[_0x0a6c('0x56')]>0x0){return _0x3dfedb(_0x586f72[_0x0a6c('0x11')](0x1f4,_['map'](_0xe299ca,'message')[_0x0a6c('0x15')](',\x20')));}var _0x25e8a3=_[_0x0a6c('0x58')](_0x788eea[_0x0a6c('0x6c')],{'uniqueid':_0x17cb7a[_0x0a6c('0x5c')]});if(_0x25e8a3){_0xce5084(_0x25e8a3);}else{return _0x3dfedb(_0x586f72['error'](0x1f5,_0x0a6c('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x475000){var _0x55f00f=this;return new Promise(function(_0x378cc7,_0x170e51){if(ami[_0x0a6c('0x10')]()==![]){return _0x170e51(_0x55f00f[_0x0a6c('0x11')](0x1f4,[config[_0x0a6c('0x12')]['ip'],config[_0x0a6c('0x12')][_0x0a6c('0x13')],_0x0a6c('0x14')]['join']('\x20')));}var _0x3a1458=schema(properties['voicequeuechannelhangup'])[_0x0a6c('0x2')](_0x475000);if(_0x3a1458['length']>0x0){return _0x170e51(_0x55f00f['error'](0x1f4,_['map'](_0x3a1458,_0x0a6c('0x19'))[_0x0a6c('0x15')](',\x20')));}var _0x21bf1a=_['find'](_0x788eea[_0x0a6c('0x6c')],{'uniqueid':_0x475000[_0x0a6c('0x5c')]});if(_0x21bf1a&&_0x21bf1a['channel']){return ami[_0x0a6c('0x1c')]({'action':_0x0a6c('0x6d'),'channel':_0x21bf1a[_0x0a6c('0x59')]})['then'](function(_0x4c4b85){_0x378cc7({'code':0xc8,'message':[_0x475000[_0x0a6c('0x5c')],_0x4c4b85[_0x0a6c('0x19')]['toLowerCase']()][_0x0a6c('0x15')]('\x20')});})[_0x0a6c('0x1d')](function(_0x2c96b7){_0x170e51(_0x55f00f[_0x0a6c('0x11')](0x1f5,[_0x475000[_0x0a6c('0x5c')],_0x2c96b7[_0x0a6c('0x19')][_0x0a6c('0x60')]()][_0x0a6c('0x15')]('\x20')));});}else{return _0x170e51(_0x55f00f[_0x0a6c('0x11')](0x1f5,_0x0a6c('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x5cc116){var _0x12efa7=this;return new Promise(function(_0x4501fc,_0x5c2579){if(ami[_0x0a6c('0x10')]()==![]){return _0x5c2579(_0x12efa7[_0x0a6c('0x11')](0x1f4,[config[_0x0a6c('0x12')]['ip'],config['asterisk'][_0x0a6c('0x13')],_0x0a6c('0x14')][_0x0a6c('0x15')]('\x20')));}var _0x500f23=schema(properties['voicequeuechannelredirect'])[_0x0a6c('0x2')](_0x5cc116);if(_0x500f23[_0x0a6c('0x56')]>0x0){return _0x5c2579(_0x12efa7[_0x0a6c('0x11')](0x1f4,_[_0x0a6c('0x57')](_0x500f23,_0x0a6c('0x19'))[_0x0a6c('0x15')](',\x20')));}var _0x2beeee=_[_0x0a6c('0x58')](_0x788eea[_0x0a6c('0x6c')],{'uniqueid':_0x5cc116[_0x0a6c('0x5c')]});if(_0x2beeee&&_0x2beeee[_0x0a6c('0x59')]){return ami['Action']({'action':_0x0a6c('0x6e'),'channel':_0x2beeee[_0x0a6c('0x59')],'exten':_0x5cc116[_0x0a6c('0x6f')],'context':_0x5cc116['context']||_0x2beeee[_0x0a6c('0x70')],'priority':0x1})[_0x0a6c('0x18')](function(_0x4d1cf2){_0x4501fc({'code':0xc8,'message':[_0x5cc116[_0x0a6c('0x5c')],_0x4d1cf2[_0x0a6c('0x19')][_0x0a6c('0x60')]()]['join']('\x20')});})[_0x0a6c('0x1d')](function(_0x219357){_0x5c2579(_0x12efa7[_0x0a6c('0x11')](0x1f5,[_0x5cc116[_0x0a6c('0x5c')],_0x219357[_0x0a6c('0x19')][_0x0a6c('0x60')]()][_0x0a6c('0x15')]('\x20')));});}else{return _0x5c2579(_0x12efa7[_0x0a6c('0x11')](0x1f5,_0x0a6c('0x6b')));}});},'Agents':function(_0x41efee){return new Promise(function(_0x268e11,_0xf35a13){var _0x116716=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0xe')]);_0x268e11({'count':_0x116716[_0x0a6c('0x56')],'rows':_0x116716});});},'Telephones':function(_0x2e05fa){return new Promise(function(_0x3fdbac,_0x104e49){var _0x38e1f1=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0x71')]);_0x3fdbac({'count':_0x38e1f1['length'],'rows':_0x38e1f1});});},'Trunks':function(_0x489376){return new Promise(function(_0x33687d,_0x6c5c66){var _0x2fabec=_['values'](_0x788eea[_0x0a6c('0x72')]);_0x33687d({'count':_0x2fabec[_0x0a6c('0x56')],'rows':_0x2fabec});});},'OutboundChannels':function(_0x3a7678){return new Promise(function(_0x770c72,_0x5ca459){var _0x4c8a40=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0x73')]);_0x770c72({'count':_0x4c8a40[_0x0a6c('0x56')],'rows':_0x4c8a40});});},'Outbound':function(_0xcdea0d){return new Promise(function(_0x959e30,_0x312bb7){_0x959e30(_0x788eea[_0x0a6c('0x2b')]);});},'Campaigns':function(_0x22378a){return new Promise(function(_0x3ed2e7,_0x5a6a70){var _0x2b572c=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0x74')]);_0x3ed2e7({'count':_0x2b572c['length'],'rows':_0x2b572c});});},'VoiceQueuesPreview':function(_0x1215e5){var _0x2c14a2=this;return new Promise(function(_0x1d387d,_0x3a69ae){_0xa05c05['run'](_0x1215e5['id'])[_0x0a6c('0x18')](function(_0x494252){_0x1d387d({'code':0xc8,'message':_0x494252[_0x0a6c('0x19')]});})[_0x0a6c('0x1d')](function(_0x2b96b6){_0x3a69ae(_0x2c14a2[_0x0a6c('0x11')](0x1f4,_0x2b96b6[_0x0a6c('0x19')]));});});},'EventManager':function(_0x41bf6f){var _0x5b974a=this;return new Promise(function(_0x1f3d9f,_0x1c0ee5){if(!_0x41bf6f[_0x0a6c('0x75')]){return _0x1c0ee5(_0x5b974a[_0x0a6c('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x0a6c('0x76')](_0x0a6c('0x77')+_0x41bf6f[_0x0a6c('0x75')],_0x41bf6f[_0x0a6c('0x19')]);_0x1f3d9f({'code':0xc8,'message':_0x41bf6f});});},'FaxAccounts':function(_0xfa220){return new Promise(function(_0x17ee72,_0xf5c249){var _0x32c4bd=_[_0x0a6c('0x54')](_0x788eea[_0x0a6c('0x78')]);_0x17ee72({'count':_0x32c4bd['length'],'rows':_0x32c4bd});});},'SendFax':function(_0x488a13){var _0x187079=this;return new Promise(function(_0x4074de,_0x53aa34){_0x4a9d92[_0x0a6c('0x79')](_0x488a13)[_0x0a6c('0x18')](function(_0x10ccec){_0x4074de({'code':0xc8,'message':_0x10ccec[_0x0a6c('0x19')]});})['catch'](function(_0x196c63){_0x53aa34(_0x187079[_0x0a6c('0x11')](0x1f4,_0x196c63[_0x0a6c('0x19')]));});});},'CheckAfterSend':function(_0xaeeaf1){var _0x3aeb7f=this;return new Promise(function(_0x232d06,_0x3dee91){_0x4a9d92['checkAfterSend'](_0xaeeaf1)[_0x0a6c('0x18')](function(_0x51f49d){_0x232d06({'code':0xc8,'message':_0x51f49d[_0x0a6c('0x19')]});})[_0x0a6c('0x1d')](function(_0x797af3){_0x3dee91(_0x3aeb7f[_0x0a6c('0x11')](0x1f4,_0x797af3['message']));});});}};var _0xd76287=jayson[_0x0a6c('0x7a')](_0x98029b)[_0x0a6c('0x7b')]();_0xd76287['on'](_0x0a6c('0x11'),function(_0x2a9d26){return _0x52cb25(_0x2a9d26);});_0xd76287[_0x0a6c('0x7c')](0x232a,_0x0a6c('0x7d'),function(){console[_0x0a6c('0x7e')](_0x0a6c('0x7f'),0x232a);return _0x571b0c(_0x0a6c('0x80')+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 54ed8a6..d0ef67f 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 _0x4f4d=['util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','autoCreate','data2','data1','isNil','firstName','calleridname','','calleridnum','destcalleridname','destcalleridnum','uniqueid','resolve','then','showContact','xmd-contactid2','user:%s','name','format','trigger:%s','action','toLowerCase','merge','createContact','catch','error','Error\x20creating\x20contact','bluebird'];(function(_0x5cbfc1,_0xaaeb94){var _0x8c6301=function(_0x5cd13e){while(--_0x5cd13e){_0x5cbfc1['push'](_0x5cbfc1['shift']());}};_0x8c6301(++_0xaaeb94);}(_0x4f4d,0xe3));var _0xd4f4=function(_0x4f7fc6,_0x554d2f){_0x4f7fc6=_0x4f7fc6-0x0;var _0x235170=_0x4f4d[_0x4f7fc6];return _0x235170;};'use strict';var BPromise=require(_0xd4f4('0x0'));var util=require(_0xd4f4('0x1'));var _=require('lodash');var Redis=require('ioredis');var config=require(_0xd4f4('0x2'));var logger=require(_0xd4f4('0x3'))(_0xd4f4('0x4'));var cmContactRpc=require(_0xd4f4('0x5'));config[_0xd4f4('0x6')]=_[_0xd4f4('0x7')](config[_0xd4f4('0x6')],{'host':_0xd4f4('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd4f4('0x6')]));function emit(_0x3a3563,_0x2ff61d,_0x135b38){logger[_0xd4f4('0x9')](_0x3a3563,_0x2ff61d,JSON[_0xd4f4('0xa')](_0x135b38));io['to'](_0x3a3563)[_0xd4f4('0xb')](_0x2ff61d,_0x135b38);}exports['exec']=function(_0x525b84,_0x4d7877,_0x4fa4af){_0x4fa4af[_0xd4f4('0xc')]=0x0;if(_0x4d7877['data2']&&parseInt(_0x4d7877[_0xd4f4('0xd')],0xa)){var _0x30eeb3={'ListId':parseInt(_0x4d7877[_0xd4f4('0xe')],0xa),'phone':_0x4fa4af['calleridnum']};if(_[_0xd4f4('0xf')](_0x4fa4af['routeId'])){_0x30eeb3[_0xd4f4('0x10')]=_0x4fa4af[_0xd4f4('0x11')]&&_0x4fa4af[_0xd4f4('0x11')]!==_0xd4f4('0x12')?_0x4fa4af[_0xd4f4('0x11')]:_0x4fa4af[_0xd4f4('0x13')]||_0x4fa4af['uniqueid'];}else{_0x30eeb3[_0xd4f4('0x10')]=_0x4fa4af[_0xd4f4('0x14')]&&_0x4fa4af[_0xd4f4('0x14')]!==_0xd4f4('0x12')?_0x4fa4af[_0xd4f4('0x14')]:_0x4fa4af[_0xd4f4('0x15')]||_0x4fa4af['uniqueid'];_0x30eeb3['phone']=_0x4fa4af['destcalleridname']&&_0x4fa4af['destcalleridname']!==_0xd4f4('0x12')?_0x4fa4af[_0xd4f4('0x14')]:_0x4fa4af[_0xd4f4('0x15')]||_0x4fa4af[_0xd4f4('0x16')];}BPromise[_0xd4f4('0x17')]()[_0xd4f4('0x18')](cmContactRpc[_0xd4f4('0x19')]({'where':_['omit'](_0x30eeb3,[_0xd4f4('0x10')])}))['then'](function(_0x1f7c63){if(_0x1f7c63){_0x4fa4af[_0xd4f4('0x1a')]=_0x1f7c63['id'];emit(util['format'](_0xd4f4('0x1b'),_0x525b84[_0xd4f4('0x1c')]),util[_0xd4f4('0x1d')](_0xd4f4('0x1e'),_0x4d7877[_0xd4f4('0x1f')][_0xd4f4('0x20')]()),_[_0xd4f4('0x21')](_0x4fa4af,{'ListId':parseInt(_0x4d7877[_0xd4f4('0xe')],0xa)}));return;}else{return BPromise[_0xd4f4('0x17')]()[_0xd4f4('0x18')](cmContactRpc[_0xd4f4('0x22')](_0x30eeb3));}})['then'](function(_0xf9c40f){if(_0xf9c40f){_0x4fa4af[_0xd4f4('0x1a')]=_0xf9c40f['id'];emit(util[_0xd4f4('0x1d')](_0xd4f4('0x1b'),_0x525b84[_0xd4f4('0x1c')]),util[_0xd4f4('0x1d')](_0xd4f4('0x1e'),_0x4d7877['action'][_0xd4f4('0x20')]()),_['merge'](_0x4fa4af,{'ListId':parseInt(_0x4d7877[_0xd4f4('0xe')],0xa)}));}})[_0xd4f4('0x23')](function(_0x5cc725){logger[_0xd4f4('0x24')](_0xd4f4('0x25'),JSON[_0xd4f4('0xa')](_0x5cc725));});}else{if(_0x525b84){emit(util[_0xd4f4('0x1d')]('user:%s',_0x525b84[_0xd4f4('0x1c')]),util['format'](_0xd4f4('0x1e'),_0x4d7877['action'][_0xd4f4('0x20')]()),_['merge']({'ListId':parseInt(_0x4d7877[_0xd4f4('0xe')],0xa)},_0x4fa4af));}}}; \ No newline at end of file +var _0x9679=['','uniqueid','destcalleridname','destcalleridnum','phone','then','showContact','omit','xmd-contactid2','format','user:%s','name','action','toLowerCase','resolve','createContact','trigger:%s','merge','catch','error','Error\x20creating\x20contact','stringify','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','emit','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9679,0xc2));var _0x9967=function(_0x54cfd6,_0x588a66){_0x54cfd6=_0x54cfd6-0x0;var _0x9e837a=_0x9679[_0x54cfd6];return _0x9e837a;};'use strict';var BPromise=require('bluebird');var util=require(_0x9967('0x0'));var _=require(_0x9967('0x1'));var Redis=require(_0x9967('0x2'));var config=require(_0x9967('0x3'));var logger=require(_0x9967('0x4'))(_0x9967('0x5'));var cmContactRpc=require(_0x9967('0x6'));config[_0x9967('0x7')]=_[_0x9967('0x8')](config[_0x9967('0x7')],{'host':_0x9967('0x9'),'port':0x18eb});var io=require(_0x9967('0xa'))(new Redis(config['redis']));function emit(_0x30fbb2,_0x3f6786,_0x2ef1f2){logger[_0x9967('0xb')](_0x30fbb2,_0x3f6786,JSON['stringify'](_0x2ef1f2));io['to'](_0x30fbb2)[_0x9967('0xc')](_0x3f6786,_0x2ef1f2);}exports['exec']=function(_0x54cf72,_0x31ec77,_0x157ee7){_0x157ee7[_0x9967('0xd')]=0x0;if(_0x31ec77[_0x9967('0xe')]&&parseInt(_0x31ec77[_0x9967('0xe')],0xa)){var _0x5f51d0={'ListId':parseInt(_0x31ec77[_0x9967('0xf')],0xa),'phone':_0x157ee7[_0x9967('0x10')]};if(_[_0x9967('0x11')](_0x157ee7[_0x9967('0x12')])){_0x5f51d0[_0x9967('0x13')]=_0x157ee7['calleridname']&&_0x157ee7[_0x9967('0x14')]!==_0x9967('0x15')?_0x157ee7[_0x9967('0x14')]:_0x157ee7[_0x9967('0x10')]||_0x157ee7[_0x9967('0x16')];}else{_0x5f51d0[_0x9967('0x13')]=_0x157ee7[_0x9967('0x17')]&&_0x157ee7[_0x9967('0x17')]!==_0x9967('0x15')?_0x157ee7[_0x9967('0x17')]:_0x157ee7[_0x9967('0x18')]||_0x157ee7['uniqueid'];_0x5f51d0[_0x9967('0x19')]=_0x157ee7[_0x9967('0x17')]&&_0x157ee7['destcalleridname']!==_0x9967('0x15')?_0x157ee7[_0x9967('0x17')]:_0x157ee7['destcalleridnum']||_0x157ee7[_0x9967('0x16')];}BPromise['resolve']()[_0x9967('0x1a')](cmContactRpc[_0x9967('0x1b')]({'where':_[_0x9967('0x1c')](_0x5f51d0,[_0x9967('0x13')])}))[_0x9967('0x1a')](function(_0x3bc1cb){if(_0x3bc1cb){_0x157ee7[_0x9967('0x1d')]=_0x3bc1cb['id'];emit(util[_0x9967('0x1e')](_0x9967('0x1f'),_0x54cf72[_0x9967('0x20')]),util[_0x9967('0x1e')]('trigger:%s',_0x31ec77[_0x9967('0x21')][_0x9967('0x22')]()),_['merge'](_0x157ee7,{'ListId':parseInt(_0x31ec77['data1'],0xa)}));return;}else{return BPromise[_0x9967('0x23')]()[_0x9967('0x1a')](cmContactRpc[_0x9967('0x24')](_0x5f51d0));}})[_0x9967('0x1a')](function(_0x13c81d){if(_0x13c81d){_0x157ee7[_0x9967('0x1d')]=_0x13c81d['id'];emit(util['format']('user:%s',_0x54cf72[_0x9967('0x20')]),util[_0x9967('0x1e')](_0x9967('0x25'),_0x31ec77[_0x9967('0x21')][_0x9967('0x22')]()),_[_0x9967('0x26')](_0x157ee7,{'ListId':parseInt(_0x31ec77[_0x9967('0xf')],0xa)}));}})[_0x9967('0x27')](function(_0x1adfac){logger[_0x9967('0x28')](_0x9967('0x29'),JSON[_0x9967('0x2a')](_0x1adfac));});}else{if(_0x54cf72){emit(util['format'](_0x9967('0x1f'),_0x54cf72[_0x9967('0x20')]),util[_0x9967('0x1e')](_0x9967('0x25'),_0x31ec77[_0x9967('0x21')]['toLowerCase']()),_[_0x9967('0x26')]({'ListId':parseInt(_0x31ec77['data1'],0xa)},_0x157ee7));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index df65035..7d77b09 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 _0x9189=['value','AccountId','message','event','agent','membername','lastevent','exports','url','mustache','ioredis','./urlforward','./cmContact','../../../config/environment','../../../config/logger','../ami','redis','defaults','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','browser','TemplateId','data2','html','templates','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winApplication','format','user:%s','trigger:%s:%s','data1','jscripty','trigger:%s','name','exec','integration','queue','routeId','script','parse','search','AllConditions','length','every','checkConditions','channel','AnyConditions','some','ChatWebsiteId','operator'];(function(_0x2f0472,_0x57c718){var _0x7419b4=function(_0x29f34a){while(--_0x29f34a){_0x2f0472['push'](_0x2f0472['shift']());}};_0x7419b4(++_0x57c718);}(_0x9189,0x1b0));var _0x9918=function(_0x47b6db,_0x3ad28b){_0x47b6db=_0x47b6db-0x0;var _0x7d5e23=_0x9189[_0x47b6db];return _0x7d5e23;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x9918('0x0'));var Mustache=require(_0x9918('0x1'));var Redis=require(_0x9918('0x2'));var urlforward=require(_0x9918('0x3'));var integration=require('./integration');var cmContact=require(_0x9918('0x4'));var script=require('./script');var cmContactRpc=require('../rpc/cmContact');var config=require(_0x9918('0x5'));var logger=require(_0x9918('0x6'))('trigger');var ami=require(_0x9918('0x7'));config[_0x9918('0x8')]=_[_0x9918('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9918('0x8')]));var operators={'equals':function(_0x29daaa,_0x553c75){return _0x29daaa==_0x553c75;},'not_equals':function(_0x21f0ff,_0x5c5853){return _0x21f0ff!=_0x5c5853;}};var barAndWebActions=[_0x9918('0xa'),_0x9918('0x0'),_0x9918('0xb')];function Trigger(_0x3900b0){this[_0x9918('0xc')]=_0x3900b0[_0x9918('0xc')];this[_0x9918('0xd')]=_0x3900b0['agents'];this[_0x9918('0xe')]=_0x3900b0[_0x9918('0xe')];this['templates']=_0x3900b0['templates'];this[_0x9918('0xf')]=_0x3900b0['voiceExtensions'];this['zendeskAccounts']=_0x3900b0[_0x9918('0x10')];this[_0x9918('0x11')]=_0x3900b0['freshdeskAccounts'];this[_0x9918('0x12')]=_0x3900b0['salesforceAccounts'];this[_0x9918('0x13')]=_0x3900b0[_0x9918('0x13')];this[_0x9918('0x14')]=_0x3900b0[_0x9918('0x14')];this[_0x9918('0x15')]=_0x3900b0[_0x9918('0x15')];this[_0x9918('0x16')]=_0x3900b0[_0x9918('0x16')];this[_0x9918('0x17')]=_0x3900b0[_0x9918('0x17')];this[_0x9918('0x18')]=_0x3900b0[_0x9918('0x18')];this[_0x9918('0x19')]={'zendesk':this[_0x9918('0x10')],'salesforce':this[_0x9918('0x12')],'freshdesk':this[_0x9918('0x11')],'sugarcrm':this[_0x9918('0x13')],'zoho':this[_0x9918('0x14')],'desk':this[_0x9918('0x15')],'vtiger':this[_0x9918('0x16')],'servicenow':this[_0x9918('0x17')],'dynamics365':this[_0x9918('0x18')]};ami['on'](_0x9918('0x1a'),this[_0x9918('0x1b')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x1d'),this['syncCustomEvent'][_0x9918('0x1c')](this));ami['on'](_0x9918('0x1e'),this[_0x9918('0x1b')]['bind'](this));ami['on'](_0x9918('0x1f'),this[_0x9918('0x1b')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x20'),this[_0x9918('0x1b')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x21'),this[_0x9918('0x22')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x23'),this[_0x9918('0x22')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x24'),this['syncAgentDial'][_0x9918('0x1c')](this));ami['on'](_0x9918('0x25'),this[_0x9918('0x1b')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x26'),this[_0x9918('0x1b')][_0x9918('0x1c')](this));ami['on'](_0x9918('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9918('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9918('0x29'),this['syncCustomEvent'][_0x9918('0x1c')](this));ami['on'](_0x9918('0x2a'),this['syncCustomEvent']['bind'](this));}Trigger[_0x9918('0x2b')][_0x9918('0x2c')]=function(_0x1eacfa,_0x7405e5,_0x8c2cf6){logger['info'](_0x1eacfa,_0x7405e5,JSON[_0x9918('0x2d')](_0x8c2cf6));io['to'](_0x1eacfa)[_0x9918('0x2c')](_0x7405e5,_0x8c2cf6);};Trigger[_0x9918('0x2b')][_0x9918('0x1b')]=function(_0x397fb0){var _0x559cf2=_[_0x9918('0x2e')](_0x397fb0);this['checkTriggers'](_0x559cf2);};Trigger[_0x9918('0x2b')]['syncAgentDial']=function(_0x5e2d08){if(this[_0x9918('0xd')][_0x5e2d08[_0x9918('0x2f')]]){this[_0x9918('0x1b')](_0x5e2d08);}};Trigger[_0x9918('0x2b')][_0x9918('0x30')]=function(_0x2593d1){var _0x46b081;for(var _0x287459 in this['triggers']){if(this[_0x9918('0xc')][_0x9918('0x31')](_0x287459)){if(this[_0x9918('0xc')][_0x287459][_0x9918('0x32')]){_0x46b081=this[_0x9918('0x33')](this[_0x9918('0xc')][_0x287459],_0x2593d1);if(_0x46b081){_[_0x9918('0x34')](_0x2593d1,_0x2593d1[_0x9918('0x35')]);for(var _0x4e3a34=0x0,_0x4dcb97,_0x42e262,_0x2601aa;_0x4e3a340x0){_0x2e7833=_['map'](_0x259f6c,_0x9add0a);}return _0x2e7833;}function getCustomFields(_0x3a3e82,_0x271a05){var _0x3d2bd9=[];var _0x50714f={'custom_fields':{}};if(_0x3a3e82[_0x6bcb('0x28')]>0x0){_[_0x6bcb('0x29')](_0x3a3e82,function(_0x13afba){if(_0x13afba[_0x6bcb('0x2a')]===_0x6bcb('0x2b')&&_0x13afba[_0x6bcb('0x2c')]&&!_0x13afba[_0x6bcb('0x2d')]){_0x50714f[_0x13afba[_0x6bcb('0x2c')][_0x6bcb('0x2e')]()]=_0x13afba[_0x6bcb('0x2f')][_0x6bcb('0x30')]();}else if(_0x13afba[_0x6bcb('0x2a')]==='string'&&_0x13afba['idField']&&_0x13afba['customField']){_0x50714f[_0x6bcb('0x31')][_0x13afba['idField']]=_0x13afba['content'][_0x6bcb('0x30')]();}else if(_0x13afba['type']===_0x6bcb('0x32')&&_0x13afba[_0x6bcb('0x33')]&&_0x13afba['idField']&&_0x13afba[_0x6bcb('0x2d')]){_0x271a05[_0x13afba[_0x6bcb('0x33')]]&&(_0x50714f['custom_fields'][_0x13afba[_0x6bcb('0x34')]]=_0x271a05[_0x13afba[_0x6bcb('0x33')]]['toString']());}else if(_0x13afba[_0x6bcb('0x2a')]===_0x6bcb('0x35')&&_0x13afba[_0x6bcb('0x36')]&&_0x13afba['Variable'][_0x6bcb('0x37')]&&_0x13afba[_0x6bcb('0x34')]&&_0x13afba[_0x6bcb('0x2d')]){_0x271a05[_0x13afba[_0x6bcb('0x36')][_0x6bcb('0x37')]['toLowerCase']()]&&(_0x50714f[_0x6bcb('0x31')][_0x13afba['idField']]=_0x271a05[_0x13afba['Variable'][_0x6bcb('0x37')]['toLowerCase']()][_0x6bcb('0x30')]());}});}if(_0x50714f[_0x6bcb('0x38')]){_0x50714f['priority']=Number(_0x50714f[_0x6bcb('0x38')]);}return _0x50714f;}function getTicket(_0xcbf061,_0x1ca8ef,_0x572c8e,_0x5691d4,_0x273156){logger[_0x6bcb('0xc')]('Creating\x20new\x20ticket...');var _0x403bf3=_[_0x6bcb('0x39')]({'subject':intUtil[_0x6bcb('0x3a')](_0x5691d4[_0x6bcb('0x3b')],_0x273156,'\x20'),'type':_0x6bcb('0x3c'),'status':_0x6bcb('0x3d'),'labels':[_0x6bcb('0x3e'),_0x6bcb('0x3f'),_0x6bcb('0x40')][_0x6bcb('0x41')](getTags(_0x5691d4['Tags'],_0x6bcb('0x37'))),'description':intUtil[_0x6bcb('0x3a')](_0x5691d4['Descriptions'],_0x273156,'\x0a'),'_links':{'assigned_user':{'href':util[_0x6bcb('0xe')](_0x6bcb('0x42'),_0x1ca8ef['id']),'class':_0x6bcb('0x43')}},'message':{'direction':'in','body':intUtil[_0x6bcb('0x3a')](_0x5691d4[_0x6bcb('0x44')],_0x273156,'\x0a')}},getCustomFields(_0x5691d4[_0x6bcb('0x45')],_0x273156));return request({'uri':util[_0x6bcb('0xe')](_0x6bcb('0x46'),_0xcbf061[_0x6bcb('0x18')],_0x572c8e['id']),'method':'POST','body':_0x403bf3});}exports[_0x6bcb('0x47')]=function(_0x376f36,_0x5a4afa,_0xb4c177,_0x1327da,_0x585bd5,_0x32f14a){var _0x593048,_0x15e0d3;_0x32f14a[_0x6bcb('0x18')]=intUtil[_0x6bcb('0x48')](_0x32f14a[_0x6bcb('0x18')]);_0x32f14a[_0x6bcb('0x49')]=intUtil[_0x6bcb('0x48')](_0x32f14a['serverUrl']);if(_0x585bd5&&_0x585bd5[_0x6bcb('0x4a')]){logger[_0x6bcb('0xc')]('[QUEUE]',_0x6bcb('0x4b'));_0x5a4afa[_0x6bcb('0x4c')]=util[_0x6bcb('0xe')](_0x6bcb('0x4d'),_0x32f14a[_0x6bcb('0x49')],_0x5a4afa[_0x6bcb('0x4e')],md5(_0x5a4afa[_0x6bcb('0x4e')]));}else{_0x5a4afa[_0x6bcb('0x4c')]='';}headers[_0x6bcb('0x4f')]=getAuth(_0x32f14a);return getUser(_0x32f14a,_0x1327da[_0x6bcb('0x50')])[_0x6bcb('0x10')](function(_0x4de438){_0x593048=_0x4de438;logger[_0x6bcb('0xc')](_0x6bcb('0x51'),_0x593048['id']);return getEndUser(_0x32f14a,_0x5a4afa['calleridname'],_0x5a4afa[_0x6bcb('0x52')]);})['then'](function(_0x75b9c5){_0x15e0d3=_0x75b9c5;logger[_0x6bcb('0xc')](_0x6bcb('0x53'),_0x15e0d3['id']);return getTicket(_0x32f14a,_0x593048,_0x15e0d3,_0xb4c177,_0x5a4afa);})[_0x6bcb('0x10')](function(_0x588228){if(_0x588228){logger[_0x6bcb('0xc')]('Ticket\x20created!');logger[_0x6bcb('0xc')]('The\x20Ticket\x20ID\x20is:',_0x588228['id']);switch(_0x32f14a[_0x6bcb('0x2a')]){case _0x6bcb('0x54'):logger[_0x6bcb('0xc')]('[QUEUE]',_0x6bcb('0x55'));emit(util[_0x6bcb('0xe')]('user:%s',_0x1327da['name']),_0x6bcb('0x56'),{'recordId':_0x588228['id']});break;case'newTab':logger[_0x6bcb('0xc')](_0x6bcb('0x57'),_0x6bcb('0x58'));emit(util[_0x6bcb('0xe')](_0x6bcb('0x59'),_0x1327da[_0x6bcb('0x37')]),_0x6bcb('0x5a'),{'uri':util[_0x6bcb('0xe')](_0x6bcb('0x5b'),_0x588228['id'])});break;default:logger[_0x6bcb('0x5c')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x6bcb('0x5d')](function(_0x4cd08a){console['error'](_0x4cd08a);logger['error'](_0x6bcb('0x57'),JSON['stringify'](_0x4cd08a));});};exports[_0x6bcb('0x5e')]=function(_0x3a2d76,_0x5a07a9,_0x2b94b8,_0x5155a6,_0x4a51f,_0x358228,_0x4d4eaa){var _0xe4f772,_0x34c886;_0x358228[_0x6bcb('0x18')]=intUtil[_0x6bcb('0x48')](_0x358228[_0x6bcb('0x18')]);_0x358228['serverUrl']=intUtil[_0x6bcb('0x48')](_0x358228['serverUrl']);if(_0x4d4eaa&&_0x4d4eaa['recordingFormat']&&_0x4d4eaa[_0x6bcb('0x5f')]!==_0x6bcb('0x60')){logger[_0x6bcb('0xc')](_0x6bcb('0x61'),_0x6bcb('0x4b'));_0x5a07a9[_0x6bcb('0x4c')]=util[_0x6bcb('0xe')](_0x6bcb('0x4d'),_0x358228[_0x6bcb('0x49')],_0x5a07a9[_0x6bcb('0x4e')],md5(_0x5a07a9[_0x6bcb('0x4e')]));}headers[_0x6bcb('0x4f')]=getAuth(_0x358228);return getUser(_0x358228,_0x5155a6['email'])[_0x6bcb('0x10')](function(_0x460c54){_0xe4f772=_0x460c54;logger['info'](_0x6bcb('0x51'),_0xe4f772['id']);return getEndUser(_0x358228,_0x5a07a9['destcalleridname'],_0x5a07a9[_0x6bcb('0x62')]);})[_0x6bcb('0x10')](function(_0x373742){_0x34c886=_0x373742;logger[_0x6bcb('0xc')](_0x6bcb('0x53'),_0x34c886['id']);return getTicket(_0x358228,_0xe4f772,_0x34c886,_0x2b94b8,_0x5a07a9);})['then'](function(_0x391926){if(_0x391926){logger[_0x6bcb('0xc')](_0x6bcb('0x63'));logger['info'](_0x6bcb('0x64'),_0x391926['id']);switch(_0x358228[_0x6bcb('0x2a')]){case'integrationTab':logger[_0x6bcb('0xc')](_0x6bcb('0x57'),_0x6bcb('0x55'));emit(util[_0x6bcb('0xe')](_0x6bcb('0x59'),_0x5155a6[_0x6bcb('0x37')]),_0x6bcb('0x56'),{'recordId':_0x391926['id']});break;case _0x6bcb('0x65'):logger['info'](_0x6bcb('0x57'),_0x6bcb('0x58'));emit(util[_0x6bcb('0xe')](_0x6bcb('0x59'),_0x5155a6[_0x6bcb('0x37')]),_0x6bcb('0x5a'),{'uri':util[_0x6bcb('0xe')](_0x6bcb('0x66'),_0x358228[_0x6bcb('0x18')],_0x391926['id'])});break;default:logger[_0x6bcb('0x5c')](_0x6bcb('0x61'),_0x6bcb('0x67'));}}})[_0x6bcb('0x5d')](function(_0x85d82c){logger[_0x6bcb('0x5c')]('[OUTBOUND]',JSON[_0x6bcb('0x1c')](_0x85d82c));});};exports[_0x6bcb('0x68')]=function(_0x54cd52,_0x459848,_0xb3409b,_0x2d28b5,_0x4812b6,_0x73f0a5){var _0x504fca,_0x17c734;_0x73f0a5[_0x6bcb('0x18')]=intUtil[_0x6bcb('0x48')](_0x73f0a5[_0x6bcb('0x18')]);_0x73f0a5[_0x6bcb('0x49')]=intUtil[_0x6bcb('0x48')](_0x73f0a5['serverUrl']);if(_0x4812b6&&_0x4812b6['monitor_format']){logger[_0x6bcb('0xc')](_0x6bcb('0x69'),_0x6bcb('0x4b'));_0x459848['recordingURL']=util[_0x6bcb('0xe')](_0x6bcb('0x4d'),_0x73f0a5[_0x6bcb('0x49')],_0x459848[_0x6bcb('0x4e')],md5(_0x459848[_0x6bcb('0x4e')]));}else{_0x459848['recordingURL']='';}headers[_0x6bcb('0x4f')]=getAuth(_0x73f0a5);return getUser(_0x73f0a5)['then'](function(_0x24e176){_0x504fca=_0x24e176;logger[_0x6bcb('0xc')](_0x6bcb('0x51'),_0x504fca['id']);return getEndUser(_0x73f0a5,_0x459848[_0x6bcb('0x6a')],_0x459848[_0x6bcb('0x52')]);})['then'](function(_0x55d2e2){_0x17c734=_0x55d2e2;logger[_0x6bcb('0xc')](_0x6bcb('0x53'),_0x17c734['id']);return getTicket(_0x73f0a5,_0x504fca,_0x17c734,_0xb3409b,_0x459848);})[_0x6bcb('0x10')](function(_0x1f8a99){if(_0x1f8a99){logger[_0x6bcb('0xc')](_0x6bcb('0x63'));logger[_0x6bcb('0xc')](_0x6bcb('0x64'),_0x1f8a99['id']);}})[_0x6bcb('0x5d')](function(_0x1da325){logger['error'](_0x6bcb('0x69'),JSON[_0x6bcb('0x1c')](_0x1da325));});}; \ No newline at end of file +var _0x3dc3=['monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','uniqueid','calleridname','calleridnum','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','total_entries','find','_embedded','entries','then','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','type','string','nameField','customField','toLowerCase','toString','content','variable','variableName','idField','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Tags','Descriptions','/api/v2/users/%d','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl'];(function(_0x7b04d6,_0x26d2bf){var _0x18351d=function(_0x133ceb){while(--_0x133ceb){_0x7b04d6['push'](_0x7b04d6['shift']());}};_0x18351d(++_0x26d2bf);}(_0x3dc3,0x1cf));var _0x33dc=function(_0x48ce56,_0x213bea){_0x48ce56=_0x48ce56-0x0;var _0x25e8a1=_0x3dc3[_0x48ce56];return _0x25e8a1;};'use strict';var _=require(_0x33dc('0x0'));var rp=require(_0x33dc('0x1'));var md5=require(_0x33dc('0x2'));var util=require(_0x33dc('0x3'));var Redis=require(_0x33dc('0x4'));var intUtil=require(_0x33dc('0x5'));var config=require('../../../../config/environment');var logger=require(_0x33dc('0x6'))(_0x33dc('0x7'));config[_0x33dc('0x8')]=_[_0x33dc('0x9')](config[_0x33dc('0x8')],{'host':_0x33dc('0xa'),'port':0x18eb});var io=require(_0x33dc('0xb'))(new Redis(config['redis']));function emit(_0x6c5bfd,_0x2d4b71,_0x7f83a3){io['to'](_0x6c5bfd)[_0x33dc('0xc')](_0x2d4b71,_0x7f83a3);}var headers={'Content-Type':_0x33dc('0xd'),'Accept':_0x33dc('0xd')};function getUser(_0x1feb47,_0xae767){if(intUtil['validateEmail'](_0xae767)===!![]){logger['info'](_0x33dc('0xe'),_0xae767);return request({'uri':util[_0x33dc('0xf')](_0x33dc('0x10'),_0x1feb47[_0x33dc('0x11')])})['then'](function(_0x175ce4){if(_0x175ce4[_0x33dc('0x12')]){return _[_0x33dc('0x13')](_0x175ce4[_0x33dc('0x14')][_0x33dc('0x15')],{'email':_0xae767});}})[_0x33dc('0x16')](function(_0x457351){if(_0x457351){logger[_0x33dc('0x17')](_0x33dc('0x18'));return _0x457351;}else{logger[_0x33dc('0x17')](_0x33dc('0x19'));return request({'uri':util[_0x33dc('0xf')](_0x33dc('0x1a'),_0x1feb47['remoteUri'])});}});}else{logger['info'](_0x33dc('0x1b'));return request({'uri':util['format'](_0x33dc('0x1a'),_0x1feb47[_0x33dc('0x11')])});}}function request(_0x40a5c2){logger[_0x33dc('0x1c')](_0x33dc('0x1d'),JSON[_0x33dc('0x1e')](_0x40a5c2));return rp(_['defaults'](_0x40a5c2,{'method':_0x33dc('0x1f'),'headers':headers,'json':!![]}));}function getAuth(_0x3d36cf){var _0xd94452;if(_0x3d36cf[_0x33dc('0x20')]===_0x33dc('0x21')){_0xd94452=util['format'](_0x33dc('0x22'),_0x3d36cf['username'],_0x3d36cf[_0x33dc('0x23')]);}else if(_0x3d36cf[_0x33dc('0x20')]===_0x33dc('0x24')){_0xd94452=util[_0x33dc('0xf')](_0x33dc('0x25'),_0x3d36cf[_0x33dc('0x26')],_0x3d36cf['token']);}return util['format'](_0x33dc('0x27'),new Buffer(_0xd94452)['toString']('base64'));}function getEndUser(_0x1e8a3b,_0x1669fc,_0x259090){logger[_0x33dc('0x17')](_0x33dc('0x28'),_0x259090);return request({'uri':util[_0x33dc('0xf')](_0x33dc('0x29'),_0x1e8a3b[_0x33dc('0x11')]),'qs':{'phone':_0x259090}})['then'](function(_0x198e08){if(_0x198e08[_0x33dc('0x12')]){logger[_0x33dc('0x17')]('Enduser\x20found!');return _0x198e08[_0x33dc('0x14')][_0x33dc('0x15')][0x0];}else{logger['info'](_0x33dc('0x2a'));return request({'uri':util[_0x33dc('0xf')](_0x33dc('0x2b'),_0x1e8a3b[_0x33dc('0x11')]),'method':_0x33dc('0x2c'),'body':{'first_name':_0x1669fc,'title':_0x1669fc,'phone_numbers':[{'type':_0x33dc('0x2d'),'value':_0x259090}]}});}});}function getTags(_0x26d0f8,_0x2cdd17){var _0x19ba5e=[];if(_0x26d0f8&&_0x26d0f8[_0x33dc('0x2e')]>0x0){_0x19ba5e=_['map'](_0x26d0f8,_0x2cdd17);}return _0x19ba5e;}function getCustomFields(_0x1e8bb7,_0x2f6b48){var _0x1fe484=[];var _0x6901e={'custom_fields':{}};if(_0x1e8bb7[_0x33dc('0x2e')]>0x0){_['forEach'](_0x1e8bb7,function(_0x3be682){if(_0x3be682[_0x33dc('0x2f')]===_0x33dc('0x30')&&_0x3be682[_0x33dc('0x31')]&&!_0x3be682[_0x33dc('0x32')]){_0x6901e[_0x3be682[_0x33dc('0x31')][_0x33dc('0x33')]()]=_0x3be682['content'][_0x33dc('0x34')]();}else if(_0x3be682[_0x33dc('0x2f')]===_0x33dc('0x30')&&_0x3be682['idField']&&_0x3be682[_0x33dc('0x32')]){_0x6901e['custom_fields'][_0x3be682['idField']]=_0x3be682[_0x33dc('0x35')][_0x33dc('0x34')]();}else if(_0x3be682[_0x33dc('0x2f')]===_0x33dc('0x36')&&_0x3be682[_0x33dc('0x37')]&&_0x3be682[_0x33dc('0x38')]&&_0x3be682[_0x33dc('0x32')]){_0x2f6b48[_0x3be682[_0x33dc('0x37')]]&&(_0x6901e[_0x33dc('0x39')][_0x3be682['idField']]=_0x2f6b48[_0x3be682[_0x33dc('0x37')]][_0x33dc('0x34')]());}else if(_0x3be682[_0x33dc('0x2f')]===_0x33dc('0x3a')&&_0x3be682[_0x33dc('0x3b')]&&_0x3be682[_0x33dc('0x3b')][_0x33dc('0x3c')]&&_0x3be682['idField']&&_0x3be682[_0x33dc('0x32')]){_0x2f6b48[_0x3be682[_0x33dc('0x3b')][_0x33dc('0x3c')][_0x33dc('0x33')]()]&&(_0x6901e[_0x33dc('0x39')][_0x3be682[_0x33dc('0x38')]]=_0x2f6b48[_0x3be682[_0x33dc('0x3b')][_0x33dc('0x3c')][_0x33dc('0x33')]()][_0x33dc('0x34')]());}});}if(_0x6901e[_0x33dc('0x3d')]){_0x6901e[_0x33dc('0x3d')]=Number(_0x6901e['priority']);}return _0x6901e;}function getTicket(_0x410ded,_0xf98238,_0x1dd43c,_0x8a290d,_0x232e72){logger[_0x33dc('0x17')](_0x33dc('0x3e'));var _0xe1158a=_['merge']({'subject':intUtil[_0x33dc('0x3f')](_0x8a290d['Subjects'],_0x232e72,'\x20'),'type':_0x33dc('0x40'),'status':_0x33dc('0x41'),'labels':[_0x33dc('0x42'),_0x33dc('0x43'),_0x33dc('0x44')][_0x33dc('0x45')](getTags(_0x8a290d[_0x33dc('0x46')],_0x33dc('0x3c'))),'description':intUtil[_0x33dc('0x3f')](_0x8a290d[_0x33dc('0x47')],_0x232e72,'\x0a'),'_links':{'assigned_user':{'href':util[_0x33dc('0xf')](_0x33dc('0x48'),_0xf98238['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x8a290d[_0x33dc('0x47')],_0x232e72,'\x0a')}},getCustomFields(_0x8a290d['Fields'],_0x232e72));return request({'uri':util[_0x33dc('0xf')](_0x33dc('0x49'),_0x410ded['remoteUri'],_0x1dd43c['id']),'method':_0x33dc('0x2c'),'body':_0xe1158a});}exports[_0x33dc('0x4a')]=function(_0x28768d,_0xb2f163,_0x2479cd,_0x1a6150,_0x4d1ee5,_0x496264){var _0x51a79b,_0x1c9f95;_0x496264['remoteUri']=intUtil[_0x33dc('0x4b')](_0x496264['remoteUri']);_0x496264[_0x33dc('0x4c')]=intUtil[_0x33dc('0x4b')](_0x496264[_0x33dc('0x4c')]);if(_0x4d1ee5&&_0x4d1ee5[_0x33dc('0x4d')]){logger[_0x33dc('0x17')]('[QUEUE]',_0x33dc('0x4e'));_0xb2f163[_0x33dc('0x4f')]=util['format'](_0x33dc('0x50'),_0x496264[_0x33dc('0x4c')],_0xb2f163['uniqueid'],md5(_0xb2f163['uniqueid']));}else{_0xb2f163[_0x33dc('0x4f')]='';}headers['Authorization']=getAuth(_0x496264);return getUser(_0x496264,_0x1a6150['email'])[_0x33dc('0x16')](function(_0x15d5c3){_0x51a79b=_0x15d5c3;logger[_0x33dc('0x17')](_0x33dc('0x51'),_0x51a79b['id']);return getEndUser(_0x496264,_0xb2f163['calleridname'],_0xb2f163['calleridnum']);})[_0x33dc('0x16')](function(_0x1d5cf7){_0x1c9f95=_0x1d5cf7;logger['info'](_0x33dc('0x52'),_0x1c9f95['id']);return getTicket(_0x496264,_0x51a79b,_0x1c9f95,_0x2479cd,_0xb2f163);})[_0x33dc('0x16')](function(_0x13c31a){if(_0x13c31a){logger['info'](_0x33dc('0x53'));logger[_0x33dc('0x17')](_0x33dc('0x54'),_0x13c31a['id']);switch(_0x496264[_0x33dc('0x2f')]){case _0x33dc('0x55'):logger[_0x33dc('0x17')](_0x33dc('0x56'),_0x33dc('0x57'));emit(util[_0x33dc('0xf')](_0x33dc('0x58'),_0x1a6150['name']),_0x33dc('0x59'),{'recordId':_0x13c31a['id']});break;case _0x33dc('0x5a'):logger[_0x33dc('0x17')](_0x33dc('0x56'),_0x33dc('0x5b'));emit(util[_0x33dc('0xf')]('user:%s',_0x1a6150['name']),'trigger:browser:url',{'uri':util[_0x33dc('0xf')](_0x33dc('0x5c'),_0x13c31a['id'])});break;default:logger[_0x33dc('0x5d')](_0x33dc('0x56'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x33961f){console[_0x33dc('0x5d')](_0x33961f);logger[_0x33dc('0x5d')](_0x33dc('0x56'),JSON[_0x33dc('0x1e')](_0x33961f));});};exports['outbound']=function(_0x2eb843,_0x161fb3,_0x6faf03,_0x1f5667,_0x368877,_0x4d5589,_0x15e97e){var _0x14eccf,_0xcec209;_0x4d5589['remoteUri']=intUtil['stripTrailingSlash'](_0x4d5589[_0x33dc('0x11')]);_0x4d5589[_0x33dc('0x4c')]=intUtil[_0x33dc('0x4b')](_0x4d5589[_0x33dc('0x4c')]);if(_0x15e97e&&_0x15e97e[_0x33dc('0x5e')]&&_0x15e97e[_0x33dc('0x5e')]!==_0x33dc('0x5f')){logger['info'](_0x33dc('0x60'),'Recording\x20is\x20enabled!');_0x161fb3[_0x33dc('0x4f')]=util[_0x33dc('0xf')](_0x33dc('0x50'),_0x4d5589[_0x33dc('0x4c')],_0x161fb3['uniqueid'],md5(_0x161fb3['uniqueid']));}headers['Authorization']=getAuth(_0x4d5589);return getUser(_0x4d5589,_0x1f5667['email'])[_0x33dc('0x16')](function(_0x24d460){_0x14eccf=_0x24d460;logger[_0x33dc('0x17')](_0x33dc('0x51'),_0x14eccf['id']);return getEndUser(_0x4d5589,_0x161fb3[_0x33dc('0x61')],_0x161fb3[_0x33dc('0x62')]);})[_0x33dc('0x16')](function(_0x1252e1){_0xcec209=_0x1252e1;logger['info'](_0x33dc('0x52'),_0xcec209['id']);return getTicket(_0x4d5589,_0x14eccf,_0xcec209,_0x6faf03,_0x161fb3);})[_0x33dc('0x16')](function(_0x4ec4d7){if(_0x4ec4d7){logger[_0x33dc('0x17')](_0x33dc('0x53'));logger[_0x33dc('0x17')](_0x33dc('0x54'),_0x4ec4d7['id']);switch(_0x4d5589[_0x33dc('0x2f')]){case _0x33dc('0x55'):logger['info'](_0x33dc('0x56'),_0x33dc('0x57'));emit(util['format']('user:%s',_0x1f5667[_0x33dc('0x3c')]),_0x33dc('0x59'),{'recordId':_0x4ec4d7['id']});break;case'newTab':logger[_0x33dc('0x17')](_0x33dc('0x56'),_0x33dc('0x5b'));emit(util[_0x33dc('0xf')](_0x33dc('0x58'),_0x1f5667['name']),_0x33dc('0x63'),{'uri':util[_0x33dc('0xf')](_0x33dc('0x64'),_0x4d5589['remoteUri'],_0x4ec4d7['id'])});break;default:logger['error']('[OUTBOUND]',_0x33dc('0x65'));}}})['catch'](function(_0x1836c7){logger[_0x33dc('0x5d')](_0x33dc('0x60'),JSON[_0x33dc('0x1e')](_0x1836c7));});};exports[_0x33dc('0x66')]=function(_0x1a8c2e,_0x124328,_0x4bf308,_0x404a5e,_0x35ca2e,_0x4b7261){var _0x260a22,_0x8882b1;_0x4b7261['remoteUri']=intUtil['stripTrailingSlash'](_0x4b7261[_0x33dc('0x11')]);_0x4b7261[_0x33dc('0x4c')]=intUtil[_0x33dc('0x4b')](_0x4b7261[_0x33dc('0x4c')]);if(_0x35ca2e&&_0x35ca2e[_0x33dc('0x4d')]){logger['info'](_0x33dc('0x67'),'Recording\x20is\x20enabled!');_0x124328['recordingURL']=util[_0x33dc('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b7261[_0x33dc('0x4c')],_0x124328[_0x33dc('0x68')],md5(_0x124328[_0x33dc('0x68')]));}else{_0x124328[_0x33dc('0x4f')]='';}headers['Authorization']=getAuth(_0x4b7261);return getUser(_0x4b7261)[_0x33dc('0x16')](function(_0x43eefe){_0x260a22=_0x43eefe;logger[_0x33dc('0x17')](_0x33dc('0x51'),_0x260a22['id']);return getEndUser(_0x4b7261,_0x124328[_0x33dc('0x69')],_0x124328[_0x33dc('0x6a')]);})[_0x33dc('0x16')](function(_0x120ae7){_0x8882b1=_0x120ae7;logger[_0x33dc('0x17')](_0x33dc('0x52'),_0x8882b1['id']);return getTicket(_0x4b7261,_0x260a22,_0x8882b1,_0x4bf308,_0x124328);})[_0x33dc('0x16')](function(_0x29254b){if(_0x29254b){logger[_0x33dc('0x17')](_0x33dc('0x53'));logger[_0x33dc('0x17')](_0x33dc('0x54'),_0x29254b['id']);}})[_0x33dc('0x6b')](function(_0x5e015c){logger[_0x33dc('0x5d')]('[ABANDONED]',JSON[_0x33dc('0x1e')](_0x5e015c));});}; \ 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 d41d296..924d7ec 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 _0x2a4e=['toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','userEmail','email','length','internalemailaddress','isdisabled','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','message','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','Bearer\x20','4.0','headers','lastIndexOf','enduserId','contacts?$select=telephone1','calleridnum','telephone1',']\x20Enduser\x20created!','forEach','type','string','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','phonecall','phonecalls','callDirection','queue','Fields','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','password','clientSecret','then','access_token','catch','error'];(function(_0x4018c3,_0x120ff6){var _0x2b8e19=function(_0x400fea){while(--_0x400fea){_0x4018c3['push'](_0x4018c3['shift']());}};_0x2b8e19(++_0x120ff6);}(_0x2a4e,0x1df));var _0xe2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe2a4('0x0'));var BPromise=require('bluebird');var rp=require(_0xe2a4('0x1'));var util=require(_0xe2a4('0x2'));var intUtil=require(_0xe2a4('0x3'));var md5=require(_0xe2a4('0x4'));var Redis=require(_0xe2a4('0x5'));var logger=require(_0xe2a4('0x6'))(_0xe2a4('0x7'));var config=require(_0xe2a4('0x8'));config[_0xe2a4('0x9')]=_[_0xe2a4('0xa')](config[_0xe2a4('0x9')],{'host':_0xe2a4('0xb'),'port':0x18eb});var io=require(_0xe2a4('0xc'))(new Redis(config[_0xe2a4('0x9')]));function getAuthToken(_0x185b0e,_0x10773f,_0x306f07){var _0x1b9ee5={'method':_0xe2a4('0xd'),'uri':_0x10773f,'form':{'client_id':_0x185b0e['clientId'],'resource':_0x185b0e[_0xe2a4('0xe')],'username':_0x185b0e['username'],'password':_0x185b0e[_0xe2a4('0xf')],'grant_type':'password','client_secret':_0x185b0e[_0xe2a4('0x10')]},'json':!![]};return rp(_0x1b9ee5)[_0xe2a4('0x11')](function(_0x245db7){return _0x245db7[_0xe2a4('0x12')];})[_0xe2a4('0x13')](function(_0xcbd876){logger[_0xe2a4('0x14')]('['+[_0x306f07[_0xe2a4('0x15')]()]+_0xe2a4('0x16'));return _0xcbd876['message'];});}function getUser(_0x3f4c67,_0xc591fa,_0x39cd1a,_0x366b50,_0x264079,_0x464986){return new BPromise(function(_0x48dae4,_0x45a5d8){return getAuthToken(_0xc591fa,_0x366b50,_0x464986)[_0xe2a4('0x11')](function(_0x2a700d){var _0x1dd64e={'method':_0xe2a4('0x17'),'uri':_0x264079+_0xe2a4('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x2a700d,'OData-Version':'4.0'},'json':!![]};return rp(_0x1dd64e);})['then'](function(_0x491c9e){var _0x3b8087=_0x491c9e[_0xe2a4('0x19')];var _0x5517b1=![];var _0x5579b8=null;if(!_[_0xe2a4('0x1a')](_0x39cd1a)){if(intUtil['validateEmail'](_0x39cd1a['email'])){_0x3f4c67[_0xe2a4('0x1b')]=_0x39cd1a[_0xe2a4('0x1c')];for(_0x5579b8=0x0;_0x5579b8<_0x3b8087[_0xe2a4('0x1d')];_0x5579b8++){if(_0x3b8087[_0x5579b8][_0xe2a4('0x1e')]===_0x39cd1a[_0xe2a4('0x1c')]&&!_0x3b8087[_0x5579b8][_0xe2a4('0x1f')]){_0x5517b1=!![];logger['info']('['+[_0x464986['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x3b8087[_0x5579b8]['systemuserid']+'!');_0x3f4c67[_0xe2a4('0x20')]=_0x3b8087[_0x5579b8][_0xe2a4('0x21')];}}}}if(!_0x5517b1){logger[_0xe2a4('0x22')]('['+[_0x464986[_0xe2a4('0x15')]()]+_0xe2a4('0x23'));_0x3f4c67['userEmail']=_0xc591fa[_0xe2a4('0x24')];for(_0x5579b8=0x0;_0x5579b8<_0x3b8087[_0xe2a4('0x1d')];_0x5579b8++){if(_0x3b8087[_0x5579b8][_0xe2a4('0x1e')]===_0xc591fa[_0xe2a4('0x24')]){_0x3f4c67[_0xe2a4('0x20')]=_0x3b8087[_0x5579b8][_0xe2a4('0x21')];}}}_0x48dae4(_0x3f4c67);})['catch'](function(_0x58f3bc){_0x45a5d8(_0x58f3bc[_0xe2a4('0x25')]);});});}function createEndUser(_0x2898ff,_0x4f5603,_0x518c26,_0x4cc88d,_0x1b8848,_0xc733cc){return new BPromise(function(_0x3d7272,_0x32681b){return getAuthToken(_0x4f5603,_0x518c26,_0xc733cc)[_0xe2a4('0x11')](function(_0x5b921b){var _0x327871=_0xc733cc[_0xe2a4('0x26')]()===_0xe2a4('0x27')?_0x1b8848[_0xe2a4('0x28')]:_0x1b8848['calleridnum'];var _0x44bc3d={'method':_0xe2a4('0xd'),'uri':_0x4cc88d+_0xe2a4('0x29'),'body':{'telephone1':_0x327871,'fullname':_0x327871,'firstname':_0x327871,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe2a4('0x2a')+_0x2898ff['userId']+')'},'headers':{'Authorization':_0xe2a4('0x2b')+_0x5b921b,'OData-Version':_0xe2a4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44bc3d);})['then'](function(_0x403309){var _0x1853e0=_0x403309[_0xe2a4('0x2d')]['odata-entityid'];var _0x40dc72=_0x1853e0['substring'](_0x1853e0[_0xe2a4('0x2e')]('(')+0x1,_0x1853e0['lastIndexOf'](')'));_0x2898ff[_0xe2a4('0x2f')]=_0x40dc72;_0x3d7272(_0x2898ff);})[_0xe2a4('0x13')](function(_0x27c96d){_0x32681b(_0x27c96d[_0xe2a4('0x25')]);});});}function getEndUser(_0x584975,_0x94e4e4,_0x594a71,_0xe3ba0,_0x4f397e,_0x1fca6a){return new BPromise(function(_0x2e0202,_0x64235){return getAuthToken(_0x94e4e4,_0x594a71,_0x1fca6a)[_0xe2a4('0x11')](function(_0x5788bc){var _0x13ddb3={'method':'GET','uri':_0xe3ba0+_0xe2a4('0x30'),'headers':{'Authorization':_0xe2a4('0x2b')+_0x5788bc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x13ddb3);})[_0xe2a4('0x11')](function(_0x19353c){var _0x27163a=null;if(_0x19353c){var _0x521b7f=_0x19353c['value'];var _0x3cb56a=![];for(_0x27163a=0x0;_0x27163a<_0x521b7f['length'];_0x27163a++){var _0x13d677=_0x1fca6a['toLowerCase']()===_0xe2a4('0x27')?_0x4f397e[_0xe2a4('0x28')]:_0x4f397e[_0xe2a4('0x31')];if(_0x521b7f[_0x27163a][_0xe2a4('0x32')]===_0x13d677){_0x3cb56a=!![];_0x584975[_0xe2a4('0x2f')]=_0x521b7f[_0x27163a]['contactid'];}}if(_0x3cb56a){_0x2e0202(_0x584975);}else{return createEndUser(_0x584975,_0x94e4e4,_0x594a71,_0xe3ba0,_0x4f397e,_0x1fca6a)[_0xe2a4('0x11')](function(_0x152e9e){logger['info']('['+[_0x1fca6a[_0xe2a4('0x15')]()]+_0xe2a4('0x33'),_0x152e9e[_0xe2a4('0x2f')]);_0x2e0202(_0x152e9e);});}}else{return createEndUser(_0x584975,_0x94e4e4,_0x594a71,_0xe3ba0,_0x4f397e,_0x1fca6a)[_0xe2a4('0x11')](function(_0xba8bde){logger[_0xe2a4('0x22')]('['+[_0x1fca6a[_0xe2a4('0x15')]()]+']\x20Enduser\x20Created!',_0xba8bde[_0xe2a4('0x2f')]);_0x2e0202(_0xba8bde);});}});});}function getCustomFields(_0x1009e7,_0x59ac94,_0x45ab5a){var _0x877921={};if(_0x1009e7[_0xe2a4('0x1d')]>0x0){_[_0xe2a4('0x34')](_0x1009e7,function(_0x4c232e){if(_0x4c232e[_0xe2a4('0x35')]===_0xe2a4('0x36')&&_0x4c232e['nameField']&&!_0x4c232e[_0xe2a4('0x37')]){var _0x176914=_0x4c232e[_0xe2a4('0x38')][_0xe2a4('0x26')]();var _0x35fcb3=_0x176914[_0xe2a4('0x39')](0x0,_0x176914['indexOf']('_'));var _0x241693=_0x176914['substring'](_0x176914[_0xe2a4('0x3a')]('_')+0x1);if(_0x35fcb3===_0x45ab5a){_0x877921[_0x241693]=_0x4c232e[_0xe2a4('0x3b')];}}});}return _0x877921;}function getTicket(_0x83e34,_0x3f49ed,_0x117da8,_0x5bdc8e,_0x104542,_0x28c6ba,_0x305d18){return new BPromise(function(_0x194940,_0x4b37d4){var _0x130e76;return getAuthToken(_0x3f49ed,_0x117da8,_0x305d18)['then'](function(_0x2ea991){if(_0x28c6ba[_0xe2a4('0x3c')]===_0xe2a4('0x3d')){_0x130e76={'method':'POST','uri':_0x5bdc8e+_0xe2a4('0x3e'),'body':Object[_0xe2a4('0x3f')]({},{'title':intUtil[_0xe2a4('0x40')](_0x28c6ba[_0xe2a4('0x41')],_0x104542,'\x20'),'description':intUtil[_0xe2a4('0x40')](_0x28c6ba['Descriptions'],_0x104542,'\x0a'),'customerid_contact@odata.bind':_0xe2a4('0x42')+_0x83e34[_0xe2a4('0x2f')]+')','ownerid@odata.bind':'/systemusers('+_0x83e34[_0xe2a4('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x28c6ba['Fields'],_0x104542,_0x28c6ba[_0xe2a4('0x3c')])),'headers':{'Authorization':_0xe2a4('0x2b')+_0x2ea991,'OData-Version':_0xe2a4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x28c6ba['ticketType']===_0xe2a4('0x43')){_0x130e76={'method':'POST','uri':_0x5bdc8e+_0xe2a4('0x44'),'body':Object[_0xe2a4('0x3f')]({},{'subject':intUtil[_0xe2a4('0x40')](_0x28c6ba['Subjects'],_0x104542,'\x20'),'phonenumber':String(_0x104542['calleridnum']),'description':intUtil['getString'](_0x28c6ba['Descriptions'],_0x104542,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe2a4('0x42')+_0x83e34[_0xe2a4('0x2f')]+')','ownerid@odata.bind':_0xe2a4('0x2a')+_0x83e34[_0xe2a4('0x20')]+')','directioncode':_0x83e34[_0xe2a4('0x45')]===_0xe2a4('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xe2a4('0x2a')+_0x83e34[_0xe2a4('0x20')]+')','participationtypemask':_0x83e34[_0xe2a4('0x45')]===_0xe2a4('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0xe2a4('0x42')+_0x83e34[_0xe2a4('0x2f')]+')','participationtypemask':_0x83e34['callDirection']===_0xe2a4('0x46')?0x1:0x2}]},getCustomFields(_0x28c6ba[_0xe2a4('0x47')],_0x104542,_0x28c6ba[_0xe2a4('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x2ea991,'OData-Version':_0xe2a4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x130e76);})['then'](function(_0x4a0454){var _0x459973=_0x4a0454[_0xe2a4('0x2d')][_0xe2a4('0x48')];var _0x2991f7=_0x459973['substring'](_0x459973[_0xe2a4('0x2e')]('(')+0x1,_0x459973[_0xe2a4('0x2e')](')'));_0x83e34['ticketId']=_0x2991f7;_0x194940(_0x83e34);})['catch'](function(_0x313c93){_0x4b37d4(_0x313c93['message']);});});}function emit(_0x12ce35,_0x316c15,_0x655043,_0x174ea1){var _0x25baca={'uri':util[_0xe2a4('0x49')](_0xe2a4('0x4a'),_0x12ce35,_0x655043,_0x174ea1)};io['to'](util[_0xe2a4('0x49')](_0xe2a4('0x4b'),_0x316c15))[_0xe2a4('0x4c')](_0xe2a4('0x4d'),_0x25baca);}exports['cs']=function(_0x2f0eca,_0x1d0f53,_0x27be77,_0x1fbf8f,_0x4d99ac,_0x157b95,_0x33747b,_0x4c9e3e){var _0x37164d={};_0x157b95['remoteUri']=intUtil[_0xe2a4('0x4e')](_0x157b95[_0xe2a4('0xe')]);_0x157b95[_0xe2a4('0x4f')]=intUtil['stripTrailingSlash'](_0x157b95['serverUrl']);_0x37164d[_0xe2a4('0x45')]=_0x4c9e3e===_0xe2a4('0x46')||_0x4c9e3e===_0xe2a4('0x50')?'queue':_0xe2a4('0x27');var _0xac162a=util['format'](_0xe2a4('0x51'),_0x157b95[_0xe2a4('0xe')]);var _0x54f29=util[_0xe2a4('0x49')](_0xe2a4('0x52'),_0x157b95['tenantId']);var _0x53c9b0=util[_0xe2a4('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x157b95['serverUrl'],_0x1d0f53[_0xe2a4('0x53')],md5(_0x1d0f53[_0xe2a4('0x53')]));if(_0x4d99ac&&_0x4d99ac['monitor_format']){logger['info'](_0xe2a4('0x54'),'Recording\x20is\x20enabled!');_0x1d0f53[_0xe2a4('0x55')]=_0x53c9b0;}else if(_0x33747b&&_0x33747b[_0xe2a4('0x56')]&&_0x33747b[_0xe2a4('0x56')]!=='none'){logger[_0xe2a4('0x22')](_0xe2a4('0x57'),_0xe2a4('0x58'));_0x1d0f53[_0xe2a4('0x55')]=_0x53c9b0;}else{_0x1d0f53[_0xe2a4('0x55')]='';}return getUser(_0x37164d,_0x157b95,_0x1fbf8f,_0x54f29,_0xac162a,_0x4c9e3e)[_0xe2a4('0x11')](function(_0x3da907){logger['info']('['+_0x4c9e3e[_0xe2a4('0x15')]()+_0xe2a4('0x59'),_0x3da907[_0xe2a4('0x20')]);logger[_0xe2a4('0x22')]('['+_0x4c9e3e[_0xe2a4('0x15')]()+_0xe2a4('0x5a'),_0x3da907['userEmail']);return getEndUser(_0x3da907,_0x157b95,_0x54f29,_0xac162a,_0x1d0f53,_0x4c9e3e);})[_0xe2a4('0x11')](function(_0x18095d){logger[_0xe2a4('0x22')]('['+_0x4c9e3e[_0xe2a4('0x15')]()+_0xe2a4('0x5b'),_0x18095d[_0xe2a4('0x2f')]);logger[_0xe2a4('0x22')]('['+_0x4c9e3e['toUpperCase']()+_0xe2a4('0x5c'),_0x1d0f53['calleridnum']);return getTicket(_0x18095d,_0x157b95,_0x54f29,_0xac162a,_0x1d0f53,_0x27be77,_0x4c9e3e);})[_0xe2a4('0x11')](function(_0x26d9ec){logger[_0xe2a4('0x22')](util['format']('['+_0x4c9e3e[_0xe2a4('0x15')]()+_0xe2a4('0x5d'),_0x27be77['ticketType'],_0x26d9ec[_0xe2a4('0x5e')]));logger[_0xe2a4('0x22')](util[_0xe2a4('0x49')]('['+_0x4c9e3e[_0xe2a4('0x15')]()+_0xe2a4('0x5f'),_0x4c9e3e));if(_0x4c9e3e!==_0xe2a4('0x50')){logger[_0xe2a4('0x22')]('['+_0x4c9e3e[_0xe2a4('0x15')]()+']',_0xe2a4('0x60'));emit(_0x157b95[_0xe2a4('0xe')],_0x1fbf8f[_0xe2a4('0x61')],_0x27be77['ticketType'],_0x26d9ec['ticketId']);}})['catch'](function(_0x44a4a5){logger[_0xe2a4('0x14')]('['+_0x4c9e3e['toUpperCase']()+_0xe2a4('0x62'),util[_0xe2a4('0x63')](_0x44a4a5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3010=['format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','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','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','abandoned','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','isdisabled','info','systemuserid','userId','internalemailaddress','catch','toLowerCase','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','message','outbound','calleridnum','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','customField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','Fields','ticketType','phonecall','phonecalls','queue','/contacts(','callDirection','ticketId'];(function(_0x5e28bd,_0x1ac89d){var _0x11cfca=function(_0x300732){while(--_0x300732){_0x5e28bd['push'](_0x5e28bd['shift']());}};_0x11cfca(++_0x1ac89d);}(_0x3010,0x7c));var _0x0301=function(_0x4ff775,_0x2c4d7a){_0x4ff775=_0x4ff775-0x0;var _0x431df0=_0x3010[_0x4ff775];return _0x431df0;};'use strict';var _=require(_0x0301('0x0'));var BPromise=require(_0x0301('0x1'));var rp=require('request-promise');var util=require(_0x0301('0x2'));var intUtil=require(_0x0301('0x3'));var md5=require(_0x0301('0x4'));var Redis=require('ioredis');var logger=require(_0x0301('0x5'))(_0x0301('0x6'));var config=require('../../../../config/environment');config[_0x0301('0x7')]=_[_0x0301('0x8')](config['redis'],{'host':_0x0301('0x9'),'port':0x18eb});var io=require(_0x0301('0xa'))(new Redis(config[_0x0301('0x7')]));function getAuthToken(_0x596535,_0x14dad7,_0x283700){var _0x294a75={'method':_0x0301('0xb'),'uri':_0x14dad7,'form':{'client_id':_0x596535[_0x0301('0xc')],'resource':_0x596535[_0x0301('0xd')],'username':_0x596535[_0x0301('0xe')],'password':_0x596535['password'],'grant_type':_0x0301('0xf'),'client_secret':_0x596535['clientSecret']},'json':!![]};return rp(_0x294a75)[_0x0301('0x10')](function(_0x4886df){return _0x4886df[_0x0301('0x11')];})['catch'](function(_0x2a82b7){logger['error']('['+[_0x283700[_0x0301('0x12')]()]+_0x0301('0x13'));return _0x2a82b7['message'];});}function getUser(_0x159b2d,_0xcfa041,_0x545a48,_0x47a78b,_0xd90845,_0x4f7c7a){return new BPromise(function(_0x28bd68,_0x21c0f5){return getAuthToken(_0xcfa041,_0x47a78b,_0x4f7c7a)[_0x0301('0x10')](function(_0x2ad710){var _0x26107d={'method':_0x0301('0x14'),'uri':_0xd90845+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x0301('0x15')+_0x2ad710,'OData-Version':_0x0301('0x16')},'json':!![]};return rp(_0x26107d);})['then'](function(_0x57092a){var _0x2dd39d=_0x57092a['value'];var _0x239a48=![];var _0x279bd6=null;if(!_[_0x0301('0x17')](_0x545a48)){if(intUtil[_0x0301('0x18')](_0x545a48[_0x0301('0x19')])){_0x159b2d[_0x0301('0x1a')]=_0x545a48[_0x0301('0x19')];for(_0x279bd6=0x0;_0x279bd6<_0x2dd39d[_0x0301('0x1b')];_0x279bd6++){if(_0x2dd39d[_0x279bd6]['internalemailaddress']===_0x545a48[_0x0301('0x19')]&&!_0x2dd39d[_0x279bd6][_0x0301('0x1c')]){_0x239a48=!![];logger[_0x0301('0x1d')]('['+[_0x4f7c7a[_0x0301('0x12')]()]+']\x20Agent\x20found\x20'+_0x2dd39d[_0x279bd6][_0x0301('0x1e')]+'!');_0x159b2d[_0x0301('0x1f')]=_0x2dd39d[_0x279bd6]['systemuserid'];}}}}if(!_0x239a48){logger[_0x0301('0x1d')]('['+[_0x4f7c7a[_0x0301('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x159b2d['userEmail']=_0xcfa041['username'];for(_0x279bd6=0x0;_0x279bd6<_0x2dd39d[_0x0301('0x1b')];_0x279bd6++){if(_0x2dd39d[_0x279bd6][_0x0301('0x20')]===_0xcfa041[_0x0301('0xe')]){_0x159b2d[_0x0301('0x1f')]=_0x2dd39d[_0x279bd6][_0x0301('0x1e')];}}}_0x28bd68(_0x159b2d);})[_0x0301('0x21')](function(_0x63fa24){_0x21c0f5(_0x63fa24['message']);});});}function createEndUser(_0xc74150,_0x300caa,_0x116662,_0x974b75,_0x22f840,_0x55fc5e){return new BPromise(function(_0x593785,_0x365fa3){return getAuthToken(_0x300caa,_0x116662,_0x55fc5e)['then'](function(_0x15d4dc){var _0x1e4e6e=_0x55fc5e[_0x0301('0x22')]()==='outbound'?_0x22f840[_0x0301('0x23')]:_0x22f840['calleridnum'];var _0x39c899={'method':'POST','uri':_0x974b75+_0x0301('0x24'),'body':{'telephone1':_0x1e4e6e,'fullname':_0x1e4e6e,'firstname':_0x1e4e6e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0301('0x25')+_0xc74150['userId']+')'},'headers':{'Authorization':_0x0301('0x15')+_0x15d4dc,'OData-Version':_0x0301('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x39c899);})[_0x0301('0x10')](function(_0x15de1d){var _0x5d6ab5=_0x15de1d[_0x0301('0x26')][_0x0301('0x27')];var _0x398227=_0x5d6ab5[_0x0301('0x28')](_0x5d6ab5['lastIndexOf']('(')+0x1,_0x5d6ab5[_0x0301('0x29')](')'));_0xc74150[_0x0301('0x2a')]=_0x398227;_0x593785(_0xc74150);})[_0x0301('0x21')](function(_0x52baea){_0x365fa3(_0x52baea[_0x0301('0x2b')]);});});}function getEndUser(_0x3c1407,_0x17d99b,_0x20f61e,_0x2cd32f,_0x61a442,_0x39701d){return new BPromise(function(_0x52267e,_0x6dfc6a){return getAuthToken(_0x17d99b,_0x20f61e,_0x39701d)[_0x0301('0x10')](function(_0x5301f5){var _0x2d9cc5={'method':_0x0301('0x14'),'uri':_0x2cd32f+'contacts?$select=telephone1','headers':{'Authorization':_0x0301('0x15')+_0x5301f5,'If-None-Match':null,'OData-Version':_0x0301('0x16')},'json':!![]};return rp(_0x2d9cc5);})[_0x0301('0x10')](function(_0x271c18){var _0xc9af2=null;if(_0x271c18){var _0x3becec=_0x271c18['value'];var _0x5276da=![];for(_0xc9af2=0x0;_0xc9af2<_0x3becec[_0x0301('0x1b')];_0xc9af2++){var _0x38f9a7=_0x39701d[_0x0301('0x22')]()===_0x0301('0x2c')?_0x61a442[_0x0301('0x23')]:_0x61a442[_0x0301('0x2d')];if(_0x3becec[_0xc9af2][_0x0301('0x2e')]===_0x38f9a7){_0x5276da=!![];_0x3c1407[_0x0301('0x2a')]=_0x3becec[_0xc9af2][_0x0301('0x2f')];}}if(_0x5276da){_0x52267e(_0x3c1407);}else{return createEndUser(_0x3c1407,_0x17d99b,_0x20f61e,_0x2cd32f,_0x61a442,_0x39701d)['then'](function(_0x10cc53){logger[_0x0301('0x1d')]('['+[_0x39701d[_0x0301('0x12')]()]+_0x0301('0x30'),_0x10cc53[_0x0301('0x2a')]);_0x52267e(_0x10cc53);});}}else{return createEndUser(_0x3c1407,_0x17d99b,_0x20f61e,_0x2cd32f,_0x61a442,_0x39701d)['then'](function(_0x1099e9){logger[_0x0301('0x1d')]('['+[_0x39701d['toUpperCase']()]+_0x0301('0x31'),_0x1099e9['enduserId']);_0x52267e(_0x1099e9);});}});});}function getCustomFields(_0x51ce7f,_0x4365fa,_0x25ced9){var _0x3532fb={};if(_0x51ce7f['length']>0x0){_['forEach'](_0x51ce7f,function(_0x3588b8){if(_0x3588b8[_0x0301('0x32')]===_0x0301('0x33')&&_0x3588b8['nameField']&&!_0x3588b8[_0x0301('0x34')]){var _0x4c7a86=_0x3588b8['idField']['toLowerCase']();var _0x6487f6=_0x4c7a86[_0x0301('0x28')](0x0,_0x4c7a86[_0x0301('0x35')]('_'));var _0x1c5919=_0x4c7a86['substring'](_0x4c7a86['indexOf']('_')+0x1);if(_0x6487f6===_0x25ced9){_0x3532fb[_0x1c5919]=_0x3588b8['content'];}}});}return _0x3532fb;}function getTicket(_0x533d5e,_0x3c8072,_0x57f7d4,_0x350440,_0x1d58dc,_0x5cb06a,_0x3331a3){return new BPromise(function(_0x5357a9,_0x5850c3){var _0x132d50;return getAuthToken(_0x3c8072,_0x57f7d4,_0x3331a3)[_0x0301('0x10')](function(_0x37d9b8){if(_0x5cb06a['ticketType']===_0x0301('0x36')){_0x132d50={'method':_0x0301('0xb'),'uri':_0x350440+_0x0301('0x37'),'body':Object[_0x0301('0x38')]({},{'title':intUtil[_0x0301('0x39')](_0x5cb06a[_0x0301('0x3a')],_0x1d58dc,'\x20'),'description':intUtil[_0x0301('0x39')](_0x5cb06a[_0x0301('0x3b')],_0x1d58dc,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x533d5e['enduserId']+')','ownerid@odata.bind':_0x0301('0x25')+_0x533d5e[_0x0301('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x5cb06a[_0x0301('0x3c')],_0x1d58dc,_0x5cb06a[_0x0301('0x3d')])),'headers':{'Authorization':_0x0301('0x15')+_0x37d9b8,'OData-Version':_0x0301('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5cb06a['ticketType']===_0x0301('0x3e')){_0x132d50={'method':'POST','uri':_0x350440+_0x0301('0x3f'),'body':Object[_0x0301('0x38')]({},{'subject':intUtil[_0x0301('0x39')](_0x5cb06a['Subjects'],_0x1d58dc,'\x20'),'phonenumber':String(_0x1d58dc[_0x0301('0x2d')]),'description':intUtil[_0x0301('0x39')](_0x5cb06a[_0x0301('0x3b')],_0x1d58dc,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x533d5e['enduserId']+')','ownerid@odata.bind':_0x0301('0x25')+_0x533d5e[_0x0301('0x1f')]+')','directioncode':_0x533d5e['callDirection']===_0x0301('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0301('0x25')+_0x533d5e[_0x0301('0x1f')]+')','participationtypemask':_0x533d5e['callDirection']===_0x0301('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0x0301('0x41')+_0x533d5e[_0x0301('0x2a')]+')','participationtypemask':_0x533d5e[_0x0301('0x42')]===_0x0301('0x40')?0x1:0x2}]},getCustomFields(_0x5cb06a['Fields'],_0x1d58dc,_0x5cb06a[_0x0301('0x3d')])),'headers':{'Authorization':_0x0301('0x15')+_0x37d9b8,'OData-Version':_0x0301('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x132d50);})[_0x0301('0x10')](function(_0x4aa0fa){var _0x3f9ec9=_0x4aa0fa[_0x0301('0x26')][_0x0301('0x27')];var _0x29a17c=_0x3f9ec9[_0x0301('0x28')](_0x3f9ec9[_0x0301('0x29')]('(')+0x1,_0x3f9ec9[_0x0301('0x29')](')'));_0x533d5e[_0x0301('0x43')]=_0x29a17c;_0x5357a9(_0x533d5e);})[_0x0301('0x21')](function(_0xa1b711){_0x5850c3(_0xa1b711['message']);});});}function emit(_0x2e25c8,_0x48a807,_0x209fe5,_0x1586b6){var _0x333a7d={'uri':util[_0x0301('0x44')](_0x0301('0x45'),_0x2e25c8,_0x209fe5,_0x1586b6)};io['to'](util['format'](_0x0301('0x46'),_0x48a807))[_0x0301('0x47')](_0x0301('0x48'),_0x333a7d);}exports['cs']=function(_0x154c0e,_0x328ed6,_0x39157d,_0x4e2dcb,_0x153348,_0x361e63,_0x20dc5c,_0xe2abf6){var _0x34f9fd={};_0x361e63[_0x0301('0xd')]=intUtil['stripTrailingSlash'](_0x361e63[_0x0301('0xd')]);_0x361e63['serverUrl']=intUtil[_0x0301('0x49')](_0x361e63[_0x0301('0x4a')]);_0x34f9fd[_0x0301('0x42')]=_0xe2abf6==='queue'||_0xe2abf6==='abandoned'?_0x0301('0x40'):_0x0301('0x2c');var _0x31fc68=util['format'](_0x0301('0x4b'),_0x361e63[_0x0301('0xd')]);var _0x265dcb=util[_0x0301('0x44')](_0x0301('0x4c'),_0x361e63[_0x0301('0x4d')]);var _0x49290a=util[_0x0301('0x44')](_0x0301('0x4e'),_0x361e63['serverUrl'],_0x328ed6[_0x0301('0x4f')],md5(_0x328ed6['uniqueid']));if(_0x153348&&_0x153348[_0x0301('0x50')]){logger[_0x0301('0x1d')](_0x0301('0x51'),_0x0301('0x52'));_0x328ed6[_0x0301('0x53')]=_0x49290a;}else if(_0x20dc5c&&_0x20dc5c[_0x0301('0x54')]&&_0x20dc5c[_0x0301('0x54')]!=='none'){logger[_0x0301('0x1d')](_0x0301('0x55'),'Recording\x20is\x20enabled!');_0x328ed6[_0x0301('0x53')]=_0x49290a;}else{_0x328ed6['recordingURL']='';}return getUser(_0x34f9fd,_0x361e63,_0x4e2dcb,_0x265dcb,_0x31fc68,_0xe2abf6)[_0x0301('0x10')](function(_0x3670f3){logger['info']('['+_0xe2abf6[_0x0301('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x3670f3[_0x0301('0x1f')]);logger[_0x0301('0x1d')]('['+_0xe2abf6[_0x0301('0x12')]()+_0x0301('0x56'),_0x3670f3['userEmail']);return getEndUser(_0x3670f3,_0x361e63,_0x265dcb,_0x31fc68,_0x328ed6,_0xe2abf6);})[_0x0301('0x10')](function(_0xfcec68){logger[_0x0301('0x1d')]('['+_0xe2abf6[_0x0301('0x12')]()+_0x0301('0x57'),_0xfcec68[_0x0301('0x2a')]);logger[_0x0301('0x1d')]('['+_0xe2abf6['toUpperCase']()+_0x0301('0x58'),_0x328ed6[_0x0301('0x2d')]);return getTicket(_0xfcec68,_0x361e63,_0x265dcb,_0x31fc68,_0x328ed6,_0x39157d,_0xe2abf6);})[_0x0301('0x10')](function(_0x155b9f){logger[_0x0301('0x1d')](util['format']('['+_0xe2abf6[_0x0301('0x12')]()+_0x0301('0x59'),_0x39157d[_0x0301('0x3d')],_0x155b9f[_0x0301('0x43')]));logger[_0x0301('0x1d')](util[_0x0301('0x44')]('['+_0xe2abf6[_0x0301('0x12')]()+_0x0301('0x5a'),_0xe2abf6));if(_0xe2abf6!==_0x0301('0x5b')){logger[_0x0301('0x1d')]('['+_0xe2abf6[_0x0301('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x361e63['remoteUri'],_0x4e2dcb[_0x0301('0x5c')],_0x39157d[_0x0301('0x3d')],_0x155b9f['ticketId']);}})[_0x0301('0x21')](function(_0x1dbd46){logger[_0x0301('0x5d')]('['+_0xe2abf6[_0x0301('0x12')]()+_0x0301('0x5e'),util[_0x0301('0x5f')](_0x1dbd46,{'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 9d07b9a..873cf0b 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 _0x8c74=['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','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','nameField','customField','toLowerCase','content','type','idField','push','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x8c74,0x149));var _0x48c7=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x8c74[_0x483d8b];return _0x6500f1;};'use strict';var _=require(_0x48c7('0x0'));var rp=require(_0x48c7('0x1'));var md5=require(_0x48c7('0x2'));var util=require(_0x48c7('0x3'));var Redis=require('ioredis');var intUtil=require(_0x48c7('0x4'));var config=require(_0x48c7('0x5'));var logger=require(_0x48c7('0x6'))('freshdesk');config[_0x48c7('0x7')]=_['defaults'](config[_0x48c7('0x7')],{'host':_0x48c7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x48c7('0x7')]));var headers={'Content-Type':_0x48c7('0x9'),'Accept':'application/json'};function emit(_0x10ec1e,_0x11ff78,_0x40c016){io['to'](_0x10ec1e)[_0x48c7('0xa')](_0x11ff78,_0x40c016);}function getTicket(_0x16b385,_0x2c4a1d,_0x509aa6,_0x49c5d0,_0x232cd8){logger[_0x48c7('0xb')](_0x48c7('0xc'));var _0x3328be=_['merge']({'responder_id':_0x2c4a1d['id'],'requester_id':_0x509aa6['id'],'name':util[_0x48c7('0xd')](_0x48c7('0xe'),_0x232cd8[_0x48c7('0xf')]),'phone':_0x232cd8['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x48c7('0x10')](_0x49c5d0[_0x48c7('0x11')],_0x232cd8,'\x20'),'description':intUtil[_0x48c7('0x10')](_0x49c5d0[_0x48c7('0x12')],_0x232cd8,_0x48c7('0x13')),'tags':getTags(_0x49c5d0[_0x48c7('0x14')],_0x48c7('0x15'))},getCustomFields(_0x49c5d0[_0x48c7('0x16')],_0x232cd8));_0x3328be[_0x48c7('0x17')]=_[_0x48c7('0x18')](_[_0x48c7('0x19')](_0x3328be['custom_fields'],'id'),'value');return request({'uri':util[_0x48c7('0xd')](_0x48c7('0x1a'),_0x16b385['remoteUri']),'method':'POST','body':_0x3328be})[_0x48c7('0x1b')](function(_0x36ba2e){logger[_0x48c7('0xb')]('Ticket\x20created!');return _0x36ba2e;});}function getUser(_0x3d29b9,_0x22d8c8){if(intUtil[_0x48c7('0x1c')](_0x22d8c8)){return request({'uri':util[_0x48c7('0xd')](_0x48c7('0x1d'),_0x3d29b9[_0x48c7('0x1e')]),'qs':{'email':_0x22d8c8}})[_0x48c7('0x1b')](function(_0x1da3f7){if(_0x1da3f7[_0x48c7('0x1f')]){logger[_0x48c7('0xb')](_0x48c7('0x20'));return _[_0x48c7('0x21')](_0x1da3f7,function(_0x545f57){return _0x545f57[_0x48c7('0x22')]['email']===_0x22d8c8;});}else{logger[_0x48c7('0xb')](_0x48c7('0x23'));return request({'uri':util[_0x48c7('0xd')](_0x48c7('0x24'),_0x3d29b9[_0x48c7('0x1e')])})[_0x48c7('0x1b')](function(_0x1613e1){logger[_0x48c7('0xb')]('Admin\x20account\x20selected.');return _0x1613e1;});}});}else{logger[_0x48c7('0xb')](_0x48c7('0x25'));return request({'uri':util[_0x48c7('0xd')](_0x48c7('0x24'),_0x3d29b9[_0x48c7('0x1e')])})[_0x48c7('0x1b')](function(_0x4d677e){logger['info'](_0x48c7('0x26'));return _0x4d677e;});}}function getEndUser(_0x273576,_0x3d594c,_0xd1b957){logger[_0x48c7('0xb')](_0x48c7('0x27'),_0xd1b957);return request({'uri':util[_0x48c7('0xd')](_0x48c7('0x28'),_0x273576[_0x48c7('0x1e')]),'qs':{'phone':_0xd1b957}})[_0x48c7('0x1b')](function(_0x171b6f){if(_0x171b6f['length']){logger[_0x48c7('0xb')](_0x48c7('0x29'));return _[_0x48c7('0x21')](_0x171b6f,{'phone':_0xd1b957});}else{logger[_0x48c7('0xb')](_0x48c7('0x2a'));return request({'uri':util[_0x48c7('0xd')]('%s/api/v2/contacts',_0x273576[_0x48c7('0x1e')]),'method':'POST','body':{'name':_0x3d594c,'phone':_0xd1b957}})[_0x48c7('0x1b')](function(_0x51def0){logger[_0x48c7('0xb')](_0x48c7('0x2b'));return _0x51def0;});}});}function getAuth(_0x25b9a9){return util[_0x48c7('0xd')](_0x48c7('0x2c'),new Buffer(_0x25b9a9['apiKey']+':X')[_0x48c7('0x2d')](_0x48c7('0x2e')));}function request(_0x4ffea5){logger[_0x48c7('0x2f')](_0x48c7('0x30'),JSON[_0x48c7('0x31')](_0x4ffea5));return rp(_[_0x48c7('0x32')](_0x4ffea5,{'method':_0x48c7('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x454e17,_0x391ae9){var _0x447c48=[];if(_0x454e17&&_0x454e17[_0x48c7('0x1f')]>0x0){_0x447c48=_[_0x48c7('0x34')](_0x454e17,_0x391ae9);}return _0x447c48;}function getCustomFields(_0x5780e3,_0x4f2797){var _0x462215=[];var _0x485308={'custom_fields':[]};if(_0x5780e3[_0x48c7('0x1f')]>0x0){_[_0x48c7('0x35')](_0x5780e3,function(_0x5eff23){if(_0x5eff23['type']==='string'&&_0x5eff23[_0x48c7('0x36')]&&!_0x5eff23[_0x48c7('0x37')]){_0x485308[_0x5eff23['nameField'][_0x48c7('0x38')]()]=_0x5eff23[_0x48c7('0x39')]['toString']();}else if(_0x5eff23[_0x48c7('0x3a')]==='string'&&_0x5eff23[_0x48c7('0x3b')]&&_0x5eff23[_0x48c7('0x37')]){_0x485308[_0x48c7('0x17')][_0x48c7('0x3c')]({'id':_0x5eff23[_0x48c7('0x3b')],'value':_0x5eff23[_0x48c7('0x39')][_0x48c7('0x2d')]()});}else if(_0x5eff23[_0x48c7('0x3a')]==='variable'&&_0x5eff23[_0x48c7('0x3d')]&&_0x5eff23[_0x48c7('0x3b')]&&_0x5eff23['customField']){_0x4f2797[_0x5eff23[_0x48c7('0x3d')]]&&_0x485308[_0x48c7('0x17')][_0x48c7('0x3c')]({'id':_0x5eff23[_0x48c7('0x3b')],'value':_0x4f2797[_0x5eff23[_0x48c7('0x3d')]][_0x48c7('0x2d')]()});}else if(_0x5eff23[_0x48c7('0x3a')]===_0x48c7('0x3e')&&_0x5eff23[_0x48c7('0x3f')]&&_0x5eff23[_0x48c7('0x3f')][_0x48c7('0x15')]&&_0x5eff23[_0x48c7('0x3b')]&&_0x5eff23[_0x48c7('0x37')]){_0x4f2797[_0x5eff23[_0x48c7('0x3f')][_0x48c7('0x15')][_0x48c7('0x38')]()]&&_0x485308[_0x48c7('0x17')][_0x48c7('0x3c')]({'id':_0x5eff23[_0x48c7('0x3b')],'value':_0x4f2797[_0x5eff23[_0x48c7('0x3f')][_0x48c7('0x15')][_0x48c7('0x38')]()][_0x48c7('0x2d')]()});}});}return _0x485308;}exports['queue']=function(_0x264f70,_0x2eec7e,_0x11bd34,_0xe6ed7c,_0x5e4b37,_0x4c1654){var _0x21f04b,_0x3b38f7;_0x4c1654[_0x48c7('0x1e')]=intUtil[_0x48c7('0x40')](_0x4c1654[_0x48c7('0x1e')]);_0x4c1654['serverUrl']=intUtil[_0x48c7('0x40')](_0x4c1654[_0x48c7('0x41')]);if(_0x5e4b37&&_0x5e4b37[_0x48c7('0x42')]){logger[_0x48c7('0xb')](_0x48c7('0x43'),_0x48c7('0x44'));_0x2eec7e[_0x48c7('0x45')]=util[_0x48c7('0xd')](_0x48c7('0x46'),_0x4c1654['serverUrl'],_0x2eec7e[_0x48c7('0x47')],md5(_0x2eec7e[_0x48c7('0x47')]));}else{_0x2eec7e[_0x48c7('0x45')]='';}headers[_0x48c7('0x48')]=getAuth(_0x4c1654);return getUser(_0x4c1654,_0xe6ed7c['email'])[_0x48c7('0x1b')](function(_0x27a3bd){_0x21f04b=_0x27a3bd;logger[_0x48c7('0xb')](_0x48c7('0x49'),_0x21f04b['id']);return getEndUser(_0x4c1654,_0x2eec7e['calleridname'],_0x2eec7e[_0x48c7('0x4a')]);})[_0x48c7('0x1b')](function(_0x3c0399){_0x3b38f7=_0x3c0399;logger[_0x48c7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3b38f7['id']);return getTicket(_0x4c1654,_0x21f04b,_0x3b38f7,_0x11bd34,_0x2eec7e);})[_0x48c7('0x1b')](function(_0x3d2d75){if(_0x3d2d75&&_0x3d2d75['id']){logger['info'](_0x48c7('0x4b'));logger[_0x48c7('0xb')](_0x48c7('0x4c'),_0x3d2d75['id']);logger[_0x48c7('0xb')]('[QUEUE]',_0x48c7('0x4d'));emit(util['format'](_0x48c7('0x4e'),_0xe6ed7c[_0x48c7('0x15')]),_0x48c7('0x4f'),{'uri':util['format'](_0x48c7('0x50'),_0x4c1654['remoteUri'],_0x3d2d75['id'])});}})[_0x48c7('0x51')](function(_0x2b6154){logger[_0x48c7('0x52')](_0x48c7('0x43'),JSON['stringify'](_0x2b6154));});};exports[_0x48c7('0x53')]=function(_0x252675,_0x5e6000,_0x399a9f,_0x317274,_0x4cc10b,_0x371ae1,_0x1f8912){var _0x2977c1,_0x34b03c;_0x371ae1[_0x48c7('0x1e')]=intUtil['stripTrailingSlash'](_0x371ae1[_0x48c7('0x1e')]);_0x371ae1[_0x48c7('0x41')]=intUtil[_0x48c7('0x40')](_0x371ae1[_0x48c7('0x41')]);if(_0x1f8912&&_0x1f8912['recordingFormat']&&_0x1f8912[_0x48c7('0x54')]!==_0x48c7('0x55')){logger[_0x48c7('0xb')](_0x48c7('0x56'),_0x48c7('0x44'));_0x5e6000['recordingURL']=util[_0x48c7('0xd')](_0x48c7('0x46'),_0x371ae1['serverUrl'],_0x5e6000[_0x48c7('0x47')],md5(_0x5e6000['uniqueid']));}headers[_0x48c7('0x48')]=getAuth(_0x371ae1);return getUser(_0x371ae1,_0x317274['email'])[_0x48c7('0x1b')](function(_0x53d948){_0x2977c1=_0x53d948;logger['info'](_0x48c7('0x49'),_0x2977c1['id']);return getEndUser(_0x371ae1,_0x5e6000[_0x48c7('0x57')],_0x5e6000[_0x48c7('0x58')]);})['then'](function(_0x21f7dc){_0x34b03c=_0x21f7dc;logger['info'](_0x48c7('0x59'),_0x34b03c['id']);return getTicket(_0x371ae1,_0x2977c1,_0x34b03c,_0x399a9f,_0x5e6000);})[_0x48c7('0x1b')](function(_0x186a89){if(_0x186a89&&_0x186a89['id']){logger[_0x48c7('0xb')](_0x48c7('0x4b'));logger[_0x48c7('0xb')](_0x48c7('0x4c'),_0x186a89['id']);logger[_0x48c7('0xb')](_0x48c7('0x56'),_0x48c7('0x4d'));emit(util[_0x48c7('0xd')](_0x48c7('0x4e'),_0x317274[_0x48c7('0x15')]),'trigger:browser:url',{'uri':util[_0x48c7('0xd')](_0x48c7('0x50'),_0x371ae1[_0x48c7('0x1e')],_0x186a89['id'])});}})[_0x48c7('0x51')](function(_0x4cb36a){logger[_0x48c7('0x52')](_0x48c7('0x56'),JSON[_0x48c7('0x31')](_0x4cb36a));});};exports['abandoned']=function(_0x597244,_0x1919fd,_0xc5bde9,_0x207591,_0x571bc1,_0x46f197){var _0x1ea805,_0x2922d2;_0x46f197['remoteUri']=intUtil['stripTrailingSlash'](_0x46f197[_0x48c7('0x1e')]);_0x46f197[_0x48c7('0x41')]=intUtil[_0x48c7('0x40')](_0x46f197[_0x48c7('0x41')]);if(_0x571bc1&&_0x571bc1['monitor_format']){logger[_0x48c7('0xb')]('[ABANDONED]',_0x48c7('0x44'));_0x1919fd[_0x48c7('0x45')]=util[_0x48c7('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46f197[_0x48c7('0x41')],_0x1919fd[_0x48c7('0x47')],md5(_0x1919fd[_0x48c7('0x47')]));}else{_0x1919fd[_0x48c7('0x45')]='';}headers[_0x48c7('0x48')]=getAuth(_0x46f197);return getUser(_0x46f197,'')[_0x48c7('0x1b')](function(_0x3bc114){_0x1ea805=_0x3bc114;logger[_0x48c7('0xb')](_0x48c7('0x49'),_0x1ea805['id']);return getEndUser(_0x46f197,_0x1919fd[_0x48c7('0xf')],_0x1919fd['calleridnum']);})[_0x48c7('0x1b')](function(_0x53da99){_0x2922d2=_0x53da99;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2922d2['id']);return getTicket(_0x46f197,_0x1ea805,_0x2922d2,_0xc5bde9,_0x1919fd);})['then'](function(_0x540e05){if(_0x540e05){logger[_0x48c7('0xb')](_0x48c7('0x4b'));logger[_0x48c7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x540e05['id']);}})[_0x48c7('0x51')](function(_0x507c74){logger['error'](_0x48c7('0x5a'),JSON['stringify'](_0x507c74));});}; \ No newline at end of file +var _0xbe20=['Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','abandoned','[ABANDONED]','stringify','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','info','Agent\x20found!','find','email','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','[HTTP]','type','string','nameField','toLowerCase','content','toString','customField','idField','variable','variableName','push','customVariable'];(function(_0x38f212,_0x537719){var _0x552d17=function(_0x3ac33f){while(--_0x3ac33f){_0x38f212['push'](_0x38f212['shift']());}};_0x552d17(++_0x537719);}(_0xbe20,0x6e));var _0x0be2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe20[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var rp=require(_0x0be2('0x0'));var md5=require('md5');var util=require(_0x0be2('0x1'));var Redis=require(_0x0be2('0x2'));var intUtil=require(_0x0be2('0x3'));var config=require(_0x0be2('0x4'));var logger=require(_0x0be2('0x5'))('freshdesk');config[_0x0be2('0x6')]=_[_0x0be2('0x7')](config[_0x0be2('0x6')],{'host':_0x0be2('0x8'),'port':0x18eb});var io=require(_0x0be2('0x9'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x0be2('0xa')};function emit(_0x1c900c,_0x4146fe,_0x55feb5){io['to'](_0x1c900c)[_0x0be2('0xb')](_0x4146fe,_0x55feb5);}function getTicket(_0x585f1a,_0x3e69c7,_0x588e0c,_0x119893,_0x110df2){logger['info'](_0x0be2('0xc'));var _0x2174e6=_[_0x0be2('0xd')]({'responder_id':_0x3e69c7['id'],'requester_id':_0x588e0c['id'],'name':util[_0x0be2('0xe')](_0x0be2('0xf'),_0x110df2['calleridname']),'phone':_0x110df2[_0x0be2('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x119893['Subjects'],_0x110df2,'\x20'),'description':intUtil['getString'](_0x119893[_0x0be2('0x11')],_0x110df2,_0x0be2('0x12')),'tags':getTags(_0x119893['Tags'],_0x0be2('0x13'))},getCustomFields(_0x119893[_0x0be2('0x14')],_0x110df2));_0x2174e6[_0x0be2('0x15')]=_[_0x0be2('0x16')](_[_0x0be2('0x17')](_0x2174e6[_0x0be2('0x15')],'id'),_0x0be2('0x18'));return request({'uri':util[_0x0be2('0xe')](_0x0be2('0x19'),_0x585f1a[_0x0be2('0x1a')]),'method':'POST','body':_0x2174e6})[_0x0be2('0x1b')](function(_0x102985){logger['info'](_0x0be2('0x1c'));return _0x102985;});}function getUser(_0x5a4e71,_0x18911d){if(intUtil[_0x0be2('0x1d')](_0x18911d)){return request({'uri':util[_0x0be2('0xe')](_0x0be2('0x1e'),_0x5a4e71[_0x0be2('0x1a')]),'qs':{'email':_0x18911d}})[_0x0be2('0x1b')](function(_0x52e6b5){if(_0x52e6b5[_0x0be2('0x1f')]){logger[_0x0be2('0x20')](_0x0be2('0x21'));return _[_0x0be2('0x22')](_0x52e6b5,function(_0x571a7c){return _0x571a7c['contact'][_0x0be2('0x23')]===_0x18911d;});}else{logger[_0x0be2('0x20')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0be2('0xe')](_0x0be2('0x24'),_0x5a4e71[_0x0be2('0x1a')])})[_0x0be2('0x1b')](function(_0x40f023){logger['info']('Admin\x20account\x20selected.');return _0x40f023;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0be2('0xe')]('%s/api/v2/agents/me',_0x5a4e71[_0x0be2('0x1a')])})[_0x0be2('0x1b')](function(_0x34a799){logger[_0x0be2('0x20')]('Admin\x20account\x20selected.');return _0x34a799;});}}function getEndUser(_0x294bb2,_0x4fce13,_0x1a47f3){logger[_0x0be2('0x20')](_0x0be2('0x25'),_0x1a47f3);return request({'uri':util[_0x0be2('0xe')](_0x0be2('0x26'),_0x294bb2['remoteUri']),'qs':{'phone':_0x1a47f3}})[_0x0be2('0x1b')](function(_0x12a2ea){if(_0x12a2ea['length']){logger[_0x0be2('0x20')]('Enduser\x20found!');return _[_0x0be2('0x22')](_0x12a2ea,{'phone':_0x1a47f3});}else{logger[_0x0be2('0x20')](_0x0be2('0x27'));return request({'uri':util[_0x0be2('0xe')]('%s/api/v2/contacts',_0x294bb2['remoteUri']),'method':'POST','body':{'name':_0x4fce13,'phone':_0x1a47f3}})[_0x0be2('0x1b')](function(_0x4122a4){logger[_0x0be2('0x20')]('Enduser\x20created.');return _0x4122a4;});}});}function getAuth(_0x519a32){return util[_0x0be2('0xe')]('Basic\x20%s',new Buffer(_0x519a32[_0x0be2('0x28')]+':X')['toString']('base64'));}function request(_0x3bc462){logger['debug'](_0x0be2('0x29'),JSON['stringify'](_0x3bc462));return rp(_['defaults'](_0x3bc462,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2642f6,_0xa8984f){var _0x38d0e9=[];if(_0x2642f6&&_0x2642f6[_0x0be2('0x1f')]>0x0){_0x38d0e9=_['map'](_0x2642f6,_0xa8984f);}return _0x38d0e9;}function getCustomFields(_0x4d9377,_0x295588){var _0x5ec048=[];var _0x53a254={'custom_fields':[]};if(_0x4d9377['length']>0x0){_['forEach'](_0x4d9377,function(_0x382b4d){if(_0x382b4d[_0x0be2('0x2a')]===_0x0be2('0x2b')&&_0x382b4d[_0x0be2('0x2c')]&&!_0x382b4d['customField']){_0x53a254[_0x382b4d[_0x0be2('0x2c')][_0x0be2('0x2d')]()]=_0x382b4d[_0x0be2('0x2e')][_0x0be2('0x2f')]();}else if(_0x382b4d[_0x0be2('0x2a')]==='string'&&_0x382b4d['idField']&&_0x382b4d[_0x0be2('0x30')]){_0x53a254[_0x0be2('0x15')]['push']({'id':_0x382b4d[_0x0be2('0x31')],'value':_0x382b4d[_0x0be2('0x2e')][_0x0be2('0x2f')]()});}else if(_0x382b4d[_0x0be2('0x2a')]===_0x0be2('0x32')&&_0x382b4d[_0x0be2('0x33')]&&_0x382b4d[_0x0be2('0x31')]&&_0x382b4d['customField']){_0x295588[_0x382b4d[_0x0be2('0x33')]]&&_0x53a254[_0x0be2('0x15')][_0x0be2('0x34')]({'id':_0x382b4d[_0x0be2('0x31')],'value':_0x295588[_0x382b4d[_0x0be2('0x33')]]['toString']()});}else if(_0x382b4d[_0x0be2('0x2a')]===_0x0be2('0x35')&&_0x382b4d['Variable']&&_0x382b4d[_0x0be2('0x36')][_0x0be2('0x13')]&&_0x382b4d[_0x0be2('0x31')]&&_0x382b4d[_0x0be2('0x30')]){_0x295588[_0x382b4d[_0x0be2('0x36')]['name'][_0x0be2('0x2d')]()]&&_0x53a254['custom_fields'][_0x0be2('0x34')]({'id':_0x382b4d[_0x0be2('0x31')],'value':_0x295588[_0x382b4d[_0x0be2('0x36')][_0x0be2('0x13')][_0x0be2('0x2d')]()]['toString']()});}});}return _0x53a254;}exports[_0x0be2('0x37')]=function(_0x62f9fb,_0x51ae9d,_0x3263e3,_0x49048f,_0x597d0a,_0x4d0bc0){var _0x2244c0,_0x559b21;_0x4d0bc0['remoteUri']=intUtil[_0x0be2('0x38')](_0x4d0bc0['remoteUri']);_0x4d0bc0[_0x0be2('0x39')]=intUtil[_0x0be2('0x38')](_0x4d0bc0[_0x0be2('0x39')]);if(_0x597d0a&&_0x597d0a[_0x0be2('0x3a')]){logger[_0x0be2('0x20')](_0x0be2('0x3b'),'Recording\x20is\x20enabled!');_0x51ae9d[_0x0be2('0x3c')]=util[_0x0be2('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d0bc0['serverUrl'],_0x51ae9d[_0x0be2('0x3d')],md5(_0x51ae9d['uniqueid']));}else{_0x51ae9d[_0x0be2('0x3c')]='';}headers[_0x0be2('0x3e')]=getAuth(_0x4d0bc0);return getUser(_0x4d0bc0,_0x49048f[_0x0be2('0x23')])[_0x0be2('0x1b')](function(_0x4e2426){_0x2244c0=_0x4e2426;logger['info'](_0x0be2('0x3f'),_0x2244c0['id']);return getEndUser(_0x4d0bc0,_0x51ae9d[_0x0be2('0x40')],_0x51ae9d[_0x0be2('0x10')]);})['then'](function(_0x313b10){_0x559b21=_0x313b10;logger['info'](_0x0be2('0x41'),_0x559b21['id']);return getTicket(_0x4d0bc0,_0x2244c0,_0x559b21,_0x3263e3,_0x51ae9d);})[_0x0be2('0x1b')](function(_0x5935f1){if(_0x5935f1&&_0x5935f1['id']){logger['info'](_0x0be2('0x1c'));logger['info'](_0x0be2('0x42'),_0x5935f1['id']);logger[_0x0be2('0x20')](_0x0be2('0x3b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0be2('0xe')]('user:%s',_0x49048f[_0x0be2('0x13')]),'trigger:browser:url',{'uri':util[_0x0be2('0xe')](_0x0be2('0x43'),_0x4d0bc0['remoteUri'],_0x5935f1['id'])});}})['catch'](function(_0x5d0704){logger[_0x0be2('0x44')]('[QUEUE]',JSON['stringify'](_0x5d0704));});};exports[_0x0be2('0x45')]=function(_0x2643b1,_0x5aa3f2,_0x3ac4cf,_0x30f4a6,_0x4aaa21,_0x39f04b,_0x38dd61){var _0x4a3a46,_0x59eb00;_0x39f04b[_0x0be2('0x1a')]=intUtil[_0x0be2('0x38')](_0x39f04b['remoteUri']);_0x39f04b[_0x0be2('0x39')]=intUtil[_0x0be2('0x38')](_0x39f04b['serverUrl']);if(_0x38dd61&&_0x38dd61[_0x0be2('0x46')]&&_0x38dd61[_0x0be2('0x46')]!==_0x0be2('0x47')){logger[_0x0be2('0x20')](_0x0be2('0x48'),_0x0be2('0x49'));_0x5aa3f2['recordingURL']=util[_0x0be2('0xe')](_0x0be2('0x4a'),_0x39f04b[_0x0be2('0x39')],_0x5aa3f2[_0x0be2('0x3d')],md5(_0x5aa3f2[_0x0be2('0x3d')]));}headers[_0x0be2('0x3e')]=getAuth(_0x39f04b);return getUser(_0x39f04b,_0x30f4a6[_0x0be2('0x23')])[_0x0be2('0x1b')](function(_0xe0a960){_0x4a3a46=_0xe0a960;logger[_0x0be2('0x20')](_0x0be2('0x3f'),_0x4a3a46['id']);return getEndUser(_0x39f04b,_0x5aa3f2[_0x0be2('0x4b')],_0x5aa3f2['destcalleridnum']);})[_0x0be2('0x1b')](function(_0x1aa564){_0x59eb00=_0x1aa564;logger[_0x0be2('0x20')]('The\x20Enduser\x20ID\x20is:',_0x59eb00['id']);return getTicket(_0x39f04b,_0x4a3a46,_0x59eb00,_0x3ac4cf,_0x5aa3f2);})[_0x0be2('0x1b')](function(_0x2393ae){if(_0x2393ae&&_0x2393ae['id']){logger[_0x0be2('0x20')](_0x0be2('0x1c'));logger[_0x0be2('0x20')]('The\x20Ticket\x20ID\x20is:',_0x2393ae['id']);logger[_0x0be2('0x20')](_0x0be2('0x48'),_0x0be2('0x4c'));emit(util[_0x0be2('0xe')]('user:%s',_0x30f4a6['name']),_0x0be2('0x4d'),{'uri':util['format'](_0x0be2('0x43'),_0x39f04b['remoteUri'],_0x2393ae['id'])});}})[_0x0be2('0x4e')](function(_0x44ce12){logger['error']('[OUTBOUND]',JSON['stringify'](_0x44ce12));});};exports[_0x0be2('0x4f')]=function(_0xe59108,_0x304fb5,_0x5bfe86,_0x532ef6,_0x1b1656,_0x413cc2){var _0x2d44c9,_0xcdd11;_0x413cc2[_0x0be2('0x1a')]=intUtil[_0x0be2('0x38')](_0x413cc2[_0x0be2('0x1a')]);_0x413cc2[_0x0be2('0x39')]=intUtil[_0x0be2('0x38')](_0x413cc2[_0x0be2('0x39')]);if(_0x1b1656&&_0x1b1656[_0x0be2('0x3a')]){logger['info'](_0x0be2('0x50'),_0x0be2('0x49'));_0x304fb5['recordingURL']=util[_0x0be2('0xe')](_0x0be2('0x4a'),_0x413cc2[_0x0be2('0x39')],_0x304fb5[_0x0be2('0x3d')],md5(_0x304fb5[_0x0be2('0x3d')]));}else{_0x304fb5[_0x0be2('0x3c')]='';}headers[_0x0be2('0x3e')]=getAuth(_0x413cc2);return getUser(_0x413cc2,'')['then'](function(_0x3ada97){_0x2d44c9=_0x3ada97;logger[_0x0be2('0x20')](_0x0be2('0x3f'),_0x2d44c9['id']);return getEndUser(_0x413cc2,_0x304fb5[_0x0be2('0x40')],_0x304fb5['calleridnum']);})[_0x0be2('0x1b')](function(_0x360c95){_0xcdd11=_0x360c95;logger[_0x0be2('0x20')](_0x0be2('0x41'),_0xcdd11['id']);return getTicket(_0x413cc2,_0x2d44c9,_0xcdd11,_0x5bfe86,_0x304fb5);})['then'](function(_0x2bc65c){if(_0x2bc65c){logger[_0x0be2('0x20')]('Ticket\x20created!');logger[_0x0be2('0x20')](_0x0be2('0x42'),_0x2bc65c['id']);}})[_0x0be2('0x4e')](function(_0x317f71){logger[_0x0be2('0x44')](_0x0be2('0x50'),JSON[_0x0be2('0x51')](_0x317f71));});}; \ 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 664c110..1b8650f 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 _0x27d4=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','zoho','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','data3','routeId','outbound','log','desk','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce'];(function(_0x5bac50,_0x540d00){var _0x28afd5=function(_0x25b25d){while(--_0x25b25d){_0x5bac50['push'](_0x5bac50['shift']());}};_0x28afd5(++_0x540d00);}(_0x27d4,0x1bd));var _0x427d=function(_0xd6314a,_0x683bf1){_0xd6314a=_0xd6314a-0x0;var _0xc76b30=_0x27d4[_0xd6314a];return _0xc76b30;};'use strict';var _=require(_0x427d('0x0'));var util=require(_0x427d('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x427d('0x2'));var sugarcrm=require(_0x427d('0x3'));var freshdesk=require(_0x427d('0x4'));var zoho=require(_0x427d('0x5'));var desk=require(_0x427d('0x6'));var vtiger=require(_0x427d('0x7'));var servicenow=require(_0x427d('0x8'));var dynamics365=require('./dynamics365');var integrations=[_0x427d('0x9'),_0x427d('0xa'),'sugarcrm','freshdesk',_0x427d('0xb'),'desk',_0x427d('0xc'),_0x427d('0xd'),_0x427d('0xe')];exports[_0x427d('0xf')]=function(_0x5b4e20,_0x4ae194,_0x27e8ac,_0x2b6e9c,_0x3f97af,_0x22a21e){if(_0x27e8ac){if(_[_0x427d('0x10')](integrations,_0x5b4e20[_0x427d('0x11')]['toLowerCase']())){try{var _0xe81326=null;var _0x4d019f='';var _0x2230a3=_0x27e8ac[_0x5b4e20['data1'][_0x427d('0x12')]()];if(_0x2230a3){var _0x3f0efc=_0x2230a3[_0x5b4e20[_0x427d('0x13')]];if(_0x3f0efc){var _0x15322e=_[_0x427d('0x14')](_0x3f0efc['Configurations'],{'id':parseInt(_0x5b4e20[_0x427d('0x15')],0xa)});if(_0x15322e){if(_0x2b6e9c){if(_0x3f97af&&_0x4ae194['queue']){_0x4d019f='queue';}else if(_0x4ae194[_0x427d('0x16')]){_0x4d019f=_0x427d('0x17');}else{console[_0x427d('0x18')]('EVENT\x20UNKNOWN',_0x4ae194);}}else{_0x4d019f='abandoned';}switch(_0x5b4e20['data1'][_0x427d('0x12')]()){case _0x427d('0x9'):zendesk[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case'salesforce':salesforce[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case'sugarcrm':sugarcrm[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case'freshdesk':freshdesk[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case _0x427d('0xb'):zoho[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case _0x427d('0x19'):desk[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case'vtiger':vtiger[_0x4d019f](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e);break;case _0x427d('0xd'):servicenow['cs'](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e,_0x4d019f);break;case _0x427d('0xe'):dynamics365['cs'](_0x5b4e20,_0x4ae194,_0x15322e,_0x2b6e9c,_0x3f97af,_0x3f0efc,_0x22a21e,_0x4d019f);break;default:console[_0x427d('0x18')]('unknown\x20integration');}}else{_0xe81326=require(_0x427d('0x1a'))(_0x5b4e20[_0x427d('0x11')][_0x427d('0x12')]());_0xe81326[_0x427d('0x1b')](_0x427d('0x1c'),util['format'](_0x427d('0x1d'),_0x5b4e20[_0x427d('0x11')][_0x427d('0x12')](),_0x5b4e20[_0x427d('0x15')]));}}else{_0xe81326=require(_0x427d('0x1a'))(_0x5b4e20[_0x427d('0x11')][_0x427d('0x12')]());_0xe81326[_0x427d('0x1b')](_0x427d('0x1c'),util[_0x427d('0x1e')](_0x427d('0x1f'),_0x5b4e20['data1'][_0x427d('0x12')](),_0x5b4e20[_0x427d('0x13')]));}}else{}}catch(_0x5cfeda){console[_0x427d('0x1b')](_0x5cfeda);}}}}; \ No newline at end of file +var _0xea11=['dynamics365','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','abandoned','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow'];(function(_0x5666e1,_0x1e6b6c){var _0x17af5c=function(_0x55baa1){while(--_0x55baa1){_0x5666e1['push'](_0x5666e1['shift']());}};_0x17af5c(++_0x1e6b6c);}(_0xea11,0xa5));var _0x1ea1=function(_0x3940fb,_0xb72180){_0x3940fb=_0x3940fb-0x0;var _0x2e5e56=_0xea11[_0x3940fb];return _0x2e5e56;};'use strict';var _=require(_0x1ea1('0x0'));var util=require(_0x1ea1('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1ea1('0x2'));var zoho=require(_0x1ea1('0x3'));var desk=require(_0x1ea1('0x4'));var vtiger=require('./vtiger');var servicenow=require(_0x1ea1('0x5'));var dynamics365=require(_0x1ea1('0x6'));var integrations=[_0x1ea1('0x7'),_0x1ea1('0x8'),_0x1ea1('0x9'),_0x1ea1('0xa'),_0x1ea1('0xb'),_0x1ea1('0xc'),_0x1ea1('0xd'),_0x1ea1('0xe'),_0x1ea1('0xf')];exports[_0x1ea1('0x10')]=function(_0x1e065d,_0xa5d601,_0x11486e,_0x41cfbd,_0x234c4c,_0x2c5e38){if(_0x11486e){if(_[_0x1ea1('0x11')](integrations,_0x1e065d[_0x1ea1('0x12')][_0x1ea1('0x13')]())){try{var _0x22f538=null;var _0x56e511='';var _0x3e045a=_0x11486e[_0x1e065d[_0x1ea1('0x12')][_0x1ea1('0x13')]()];if(_0x3e045a){var _0x5d19ed=_0x3e045a[_0x1e065d['data2']];if(_0x5d19ed){var _0x39256c=_[_0x1ea1('0x14')](_0x5d19ed[_0x1ea1('0x15')],{'id':parseInt(_0x1e065d[_0x1ea1('0x16')],0xa)});if(_0x39256c){if(_0x41cfbd){if(_0x234c4c&&_0xa5d601[_0x1ea1('0x17')]){_0x56e511=_0x1ea1('0x17');}else if(_0xa5d601[_0x1ea1('0x18')]){_0x56e511=_0x1ea1('0x19');}else{console[_0x1ea1('0x1a')](_0x1ea1('0x1b'),_0xa5d601);}}else{_0x56e511=_0x1ea1('0x1c');}switch(_0x1e065d['data1']['toLowerCase']()){case _0x1ea1('0x7'):zendesk[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case'salesforce':salesforce[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case'sugarcrm':sugarcrm[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case _0x1ea1('0xa'):freshdesk[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case _0x1ea1('0xb'):zoho[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case _0x1ea1('0xc'):desk[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case _0x1ea1('0xd'):vtiger[_0x56e511](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38);break;case _0x1ea1('0xe'):servicenow['cs'](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38,_0x56e511);break;case _0x1ea1('0xf'):dynamics365['cs'](_0x1e065d,_0xa5d601,_0x39256c,_0x41cfbd,_0x234c4c,_0x5d19ed,_0x2c5e38,_0x56e511);break;default:console[_0x1ea1('0x1a')](_0x1ea1('0x1d'));}}else{_0x22f538=require(_0x1ea1('0x1e'))(_0x1e065d[_0x1ea1('0x12')]['toLowerCase']());_0x22f538[_0x1ea1('0x1f')]('[EXEC]',util['format'](_0x1ea1('0x20'),_0x1e065d['data1']['toLowerCase'](),_0x1e065d[_0x1ea1('0x16')]));}}else{_0x22f538=require(_0x1ea1('0x1e'))(_0x1e065d[_0x1ea1('0x12')][_0x1ea1('0x13')]());_0x22f538['error'](_0x1ea1('0x21'),util[_0x1ea1('0x22')](_0x1ea1('0x23'),_0x1e065d[_0x1ea1('0x12')][_0x1ea1('0x13')](),_0x1e065d['data2']));}}else{}}catch(_0x5f0854){console['error'](_0x5f0854);}}}}; \ 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 44ae578..473580c 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 _0x9c44=['username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','getString','Descriptions','WhoId','Case','assign','Subjects','ContactId','sobject','create','find','then','length','Email','info','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login'];(function(_0x50bca4,_0x24341d){var _0x1112b0=function(_0x371121){while(--_0x371121){_0x50bca4['push'](_0x50bca4['shift']());}};_0x1112b0(++_0x24341d);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var md5=require(_0x49c4('0x2'));var jsforce=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var Redis=require(_0x49c4('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x49c4('0x6'))('salesforce');config[_0x49c4('0x7')]=_[_0x49c4('0x8')](config[_0x49c4('0x7')],{'host':_0x49c4('0x9'),'port':0x18eb});var io=require(_0x49c4('0xa'))(new Redis(config['redis']));function emit(_0x11c586,_0x42e4f8,_0x1d13fb){io['to'](_0x11c586)[_0x49c4('0xb')](_0x42e4f8,_0x1d13fb);}function getTicket(_0x4c7d3a,_0x5ab4a3,_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1,_0x459d09,_0x4adb3c){var _0x536d42={};if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0xd')){_0x536d42=Object['assign']({},{'OwnerId':_0x5ab4a3['id'],'ActivityDate':moment[_0x49c4('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x49c4('0xf')](_0x313e73['Subjects'],_0x58cad7,'\x20'),'Description':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x11')]=_0x451ea6['id'];}}else if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0x12')){_0x536d42=Object[_0x49c4('0x13')]({},{'OwnerId':_0x5ab4a3['id'],'Subject':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x14')],_0x58cad7,'\x20'),'Description':intUtil['getString'](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x15')]=_0x451ea6['id'];}}return _0x459d09[_0x49c4('0x16')](_0x313e73[_0x49c4('0xc')])[_0x49c4('0x17')](_0x536d42);}function getUser(_0x53e3a2,_0x44e607,_0x2891f4){if(!_['isNil'](_0x44e607)&&intUtil['validateEmail'](_0x44e607)){var _0x3c782d={'Email':_0x44e607};var _0x2f82d5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2891f4[_0x49c4('0x16')]('User')[_0x49c4('0x18')](_0x3c782d,_0x2f82d5)['execute']()[_0x49c4('0x19')](function(_0x1806c2){if(_0x1806c2[_0x49c4('0x1a')]){var _0x291526=_[_0x49c4('0x18')](_0x1806c2,function(_0x41078c){return _0x41078c[_0x49c4('0x1b')]===_0x44e607;});if(_0x291526){logger[_0x49c4('0x1c')](_0x49c4('0x1d'),_0x44e607);return BPromise['resolve']({'id':_0x291526['Id'],'name':_0x291526['Name']});}}else{logger['info'](_0x49c4('0x1e'),_0x44e607);return _0x2891f4['identity']()['then'](function(_0x2263ae){return BPromise[_0x49c4('0x1f')]({'id':_0x2263ae[_0x49c4('0x20')],'name':_0x2263ae[_0x49c4('0x21')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x44e607);return _0x2891f4[_0x49c4('0x22')]()[_0x49c4('0x19')](function(_0x565423){return BPromise[_0x49c4('0x1f')]({'id':_0x565423[_0x49c4('0x20')],'name':_0x565423[_0x49c4('0x21')]});});}}function getEndUser(_0xa7a826,_0x531d92,_0x543ea2,_0x449960,_0x53c199){var _0x3800b7={'Phone':_0x449960};var _0x3852b2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x49c4('0x1f')]()[_0x49c4('0x19')](function(){if(_0x531d92['ticketType']===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x531d92[_0x49c4('0x24')]);switch(_0x531d92[_0x49c4('0x24')]){case _0x49c4('0x25'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]()[_0x49c4('0x19')](function(_0x4ea6ea){if(_0x4ea6ea&&_0x4ea6ea['length']){return _0x4ea6ea;}else{return _0x53c199['sobject'](_0x49c4('0x28'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2);}});case _0x49c4('0x29'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))['find'](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();case _0x49c4('0x2a'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x28'))['find'](_0x3800b7,_0x3852b2);default:return null;}}else if(_0x531d92['ticketType']===_0x49c4('0x12')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x49c4('0x29'));return _0x53c199[_0x49c4('0x16')]('Contact')[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();}})[_0x49c4('0x19')](function(_0x512d02){if(_0x512d02&&_0x512d02['length']){var _0x85dce2=_[_0x49c4('0x18')](_0x512d02,function(_0x3bec0a){return _0x3bec0a[_0x49c4('0x2b')]===_0x449960;});if(_0x85dce2){return BPromise[_0x49c4('0x1f')]({'id':_0x85dce2['Id'],'name':_0x85dce2[_0x49c4('0x2c')],'phone':_0x85dce2[_0x49c4('0x2b')]});}}})[_0x49c4('0x19')](function(_0x3209cd){if(_0x3209cd){logger['info'](_0x49c4('0x2d'),_0x449960);return BPromise['resolve'](_0x3209cd);}else{logger[_0x49c4('0x1c')](_0x49c4('0x2e'),_0x449960);var _0x2625a6={'LastName':_0x543ea2!==_0x49c4('0x2f')?_0x543ea2:util['format'](_0x49c4('0x30'),_0x449960),'Phone':_0x449960};if(_0x531d92[_0x49c4('0x31')]){if(_0x531d92[_0x49c4('0x31')]==='contact'){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);}else if(_0x531d92[_0x49c4('0x31')]===_0x49c4('0x2a')&&_0x531d92[_0x49c4('0xc')]===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);_0x2625a6[_0x49c4('0x33')]='No\x20Company';}else{return null;}}return _0x53c199[_0x49c4('0x16')](_[_0x49c4('0x34')](_0x531d92[_0x49c4('0x31')]))[_0x49c4('0x17')](_0x2625a6);}});}function getCustomFields(_0x41ad28,_0x29dd5d){var _0x1be62d={};if(_0x41ad28[_0x49c4('0x1a')]>0x0){_[_0x49c4('0x35')](_0x41ad28,function(_0x2668ed){if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x37')&&_0x2668ed[_0x49c4('0x38')]){_0x1be62d[_0x2668ed['idField']]=_0x2668ed[_0x49c4('0x39')]['toString']();}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3a')&&_0x2668ed[_0x49c4('0x3b')]&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3b')]]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed['variableName']]['toString']());}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3c')&&_0x2668ed[_0x49c4('0x3d')]&&_0x2668ed[_0x49c4('0x3d')]['name']&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()][_0x49c4('0x40')]());}});}return _0x1be62d;}function getConnection(_0x5640d3){var _0x2ad771=_0x5640d3['password'][_0x49c4('0x41')](_0x5640d3[_0x49c4('0x42')]);var _0x301def=new jsforce[(_0x49c4('0x43'))]({'oauth2':{'loginUrl':_0x5640d3[_0x49c4('0x44')]||'https://login.salesforce.com','clientId':_0x5640d3[_0x49c4('0x45')],'clientSecret':_0x5640d3[_0x49c4('0x46')]}});return _0x301def[_0x49c4('0x47')](_0x5640d3[_0x49c4('0x48')],_0x2ad771)[_0x49c4('0x19')](function(){logger[_0x49c4('0x1c')](_0x49c4('0x49'));return _0x301def;});}exports['queue']=function(_0x3bac1b,_0x5cfff9,_0x3f7379,_0x906d3,_0x29fe65,_0x27adfe){var _0x2d8087,_0x30bea5,_0x2c6be1,_0x506c71;_0x27adfe[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x27adfe['serverUrl']);_0x27adfe[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x27adfe[_0x49c4('0x44')]);if(_0x29fe65&&_0x29fe65[_0x49c4('0x4c')]){logger['info']('[QUEUE]',_0x49c4('0x4d'));_0x5cfff9['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x27adfe[_0x49c4('0x4a')],_0x5cfff9[_0x49c4('0x50')],md5(_0x5cfff9[_0x49c4('0x50')]));}else{_0x5cfff9[_0x49c4('0x51')]='';}return getConnection(_0x27adfe)[_0x49c4('0x19')](function(_0x563f0b){_0x506c71=_0x563f0b;return getUser(_0x27adfe,_0x906d3[_0x49c4('0x52')],_0x506c71);})[_0x49c4('0x19')](function(_0x3936d3){_0x2d8087=_0x3936d3;return getEndUser(_0x27adfe,_0x3f7379,_0x5cfff9[_0x49c4('0x53')],_0x5cfff9[_0x49c4('0x54')],_0x506c71);})[_0x49c4('0x19')](function(_0x156748){_0x30bea5=_0x156748;return getTicket(_0x27adfe,_0x2d8087,_0x30bea5,_0x3f7379,_0x5cfff9,_0x3f7379[_0x49c4('0x55')],_0x506c71,_0x49c4('0x56'));})[_0x49c4('0x19')](function(_0x5b822f){_0x2c6be1=_0x5b822f;logger['info'](_0x49c4('0x57'),_0x2c6be1['id']);logger[_0x49c4('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2c6be1['id'],_0x906d3['name'],_0x27adfe[_0x49c4('0x36')]);switch(_0x27adfe['type']){case'integrationTab':emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3[_0x49c4('0x3e')]),_0x49c4('0x59'),{'recordId':_0x2c6be1['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3['name']),_0x49c4('0x5b'),{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x506c71[_0x49c4('0x5d')],_0x2c6be1['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x5f'));}})['catch'](function(_0x5c7ddd){logger[_0x49c4('0x5e')](_0x49c4('0x60'),JSON[_0x49c4('0x61')](_0x5c7ddd));});};exports[_0x49c4('0x62')]=function(_0x23288e,_0x6b2592,_0xc2033f,_0x58dc5f,_0x45d715,_0x33c9a6,_0x4ba4eb){var _0x42928c,_0x53690f,_0x2f966c,_0x147ebd;_0x33c9a6[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x4a')]);_0x33c9a6[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x44')]);if(_0x4ba4eb&&_0x4ba4eb['recordingFormat']&&_0x4ba4eb[_0x49c4('0x63')]!==_0x49c4('0x64')){logger['info'](_0x49c4('0x65'),_0x49c4('0x4d'));_0x6b2592['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x33c9a6['serverUrl'],_0x6b2592['uniqueid'],md5(_0x6b2592['uniqueid']));}return getConnection(_0x33c9a6)['then'](function(_0xc43386){_0x147ebd=_0xc43386;return getUser(_0x33c9a6,_0x58dc5f['email'],_0x147ebd);})[_0x49c4('0x19')](function(_0x32f344){_0x42928c=_0x32f344;return getEndUser(_0x33c9a6,_0xc2033f,_0x6b2592['destcalleridname'],_0x6b2592[_0x49c4('0x66')],_0x147ebd);})[_0x49c4('0x19')](function(_0x5ac9f0){_0x53690f=_0x5ac9f0;return getTicket(_0x33c9a6,_0x42928c,_0x53690f,_0xc2033f,_0x6b2592,_0xc2033f[_0x49c4('0x55')],_0x147ebd,_0x49c4('0x62'));})[_0x49c4('0x19')](function(_0x35f46f){_0x2f966c=_0x35f46f;logger['info'](_0x49c4('0x67'),_0x2f966c['id']);logger[_0x49c4('0x1c')](_0x49c4('0x68'),_0x2f966c['id'],_0x58dc5f[_0x49c4('0x3e')],_0x33c9a6['type']);switch(_0x33c9a6[_0x49c4('0x36')]){case'integrationTab':emit(util['format']('user:%s',_0x58dc5f['name']),_0x49c4('0x59'),{'recordId':_0x2f966c['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x58dc5f['name']),'trigger:browser:url',{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x147ebd[_0x49c4('0x5d')],_0x2f966c['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x65'),_0x49c4('0x69'));}})[_0x49c4('0x6a')](function(_0x3b949d){logger['error'](_0x49c4('0x65'),JSON['stringify'](_0x3b949d));});};exports[_0x49c4('0x6b')]=function(_0x264902,_0x1a5d4c,_0x1ea1b4,_0x3a1c81,_0x2e062f,_0x13d657){var _0x3feb0b,_0x13d951,_0x1743d0,_0x1e3911;_0x13d657[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x4a')]);_0x13d657[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x44')]);if(_0x2e062f&&_0x2e062f[_0x49c4('0x4c')]){logger['info']('[ABANDONED]',_0x49c4('0x4d'));_0x1a5d4c[_0x49c4('0x51')]=util['format'](_0x49c4('0x4f'),_0x13d657[_0x49c4('0x4a')],_0x1a5d4c[_0x49c4('0x50')],md5(_0x1a5d4c[_0x49c4('0x50')]));}else{_0x1a5d4c['recordingURL']='';}return getConnection(_0x13d657)['then'](function(_0x4a85d4){_0x1e3911=_0x4a85d4;if(!_[_0x49c4('0x6c')](_0x3a1c81)){return getUser(_0x13d657,_0x3a1c81[_0x49c4('0x3e')],_0x1e3911);}else{return getUser(_0x13d657,null,_0x1e3911);}})[_0x49c4('0x19')](function(_0x2f4289){_0x3feb0b=_0x2f4289;return getEndUser(_0x13d657,_0x1ea1b4,_0x1a5d4c[_0x49c4('0x53')],_0x1a5d4c[_0x49c4('0x54')],_0x1e3911);})[_0x49c4('0x19')](function(_0x3692a4){_0x13d951=_0x3692a4;return getTicket(_0x13d657,_0x3feb0b,_0x13d951,_0x1ea1b4,_0x1a5d4c,_0x1ea1b4[_0x49c4('0x55')],_0x1e3911);})['then'](function(_0x363b2e){_0x1743d0=_0x363b2e;logger[_0x49c4('0x1c')](_0x49c4('0x6d'),_0x1743d0['id']);logger['info'](_0x49c4('0x6e'),_0x13d657[_0x49c4('0x36')]);})[_0x49c4('0x6a')](function(_0xb6031b){logger[_0x49c4('0x5e')](_0x49c4('0x6f'),JSON[_0x49c4('0x61')](_0xb6031b));});}; \ No newline at end of file +var _0xa9e0=['identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','error','catch','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x5b08bd,_0x4c7d11){var _0x4f6feb=function(_0x47a6c8){while(--_0x47a6c8){_0x5b08bd['push'](_0x5b08bd['shift']());}};_0x4f6feb(++_0x4c7d11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x0a9e('0x3'));var util=require('util');var Redis=require(_0x0a9e('0x4'));var intUtil=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe42b77,_0x56465b,_0x52cace){io['to'](_0xe42b77)[_0x0a9e('0xc')](_0x56465b,_0x52cace);}function getTicket(_0xf81284,_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){var _0x4cfe67={};if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xe')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'ActivityDate':moment[_0x0a9e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b[_0x0a9e('0x12')],_0xbd1168,'\x20'),'Description':intUtil['getString'](_0xfeb75b[_0x0a9e('0x13')],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x14')]=_0x3ab53f['id'];}}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x15')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b['Subjects'],_0xbd1168,'\x20'),'Description':intUtil[_0x0a9e('0x11')](_0xfeb75b['Descriptions'],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x16')]=_0x3ab53f['id'];}}return _0x50dfb2['sobject'](_0xfeb75b[_0x0a9e('0xd')])[_0x0a9e('0x17')](_0x4cfe67);}function getUser(_0x48f32d,_0x225616,_0x5a0a06){if(!_[_0x0a9e('0x18')](_0x225616)&&intUtil[_0x0a9e('0x19')](_0x225616)){var _0x106033={'Email':_0x225616};var _0x205fd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a0a06[_0x0a9e('0x1a')](_0x0a9e('0x1b'))[_0x0a9e('0x1c')](_0x106033,_0x205fd6)[_0x0a9e('0x1d')]()[_0x0a9e('0x1e')](function(_0x112016){if(_0x112016[_0x0a9e('0x1f')]){var _0x105080=_['find'](_0x112016,function(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')]===_0x225616;});if(_0x105080){logger['info'](_0x0a9e('0x21'),_0x225616);return BPromise['resolve']({'id':_0x105080['Id'],'name':_0x105080['Name']});}}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x4abc77){return BPromise[_0x0a9e('0x25')]({'id':_0x4abc77[_0x0a9e('0x26')],'name':_0x4abc77[_0x0a9e('0x27')]});});}});}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x5ea472){return BPromise['resolve']({'id':_0x5ea472[_0x0a9e('0x26')],'name':_0x5ea472[_0x0a9e('0x27')]});});}}function getEndUser(_0x40c424,_0x33161b,_0x526cf3,_0x384319,_0x479bc4){var _0x45a1e7={'Phone':_0x384319};var _0x5bfb33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a9e('0x25')]()[_0x0a9e('0x1e')](function(){if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger[_0x0a9e('0x22')](_0x0a9e('0x28'),_0x384319,_0x33161b[_0x0a9e('0x29')]);switch(_0x33161b[_0x0a9e('0x29')]){case'contact_lead':return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]()['then'](function(_0x15b200){if(_0x15b200&&_0x15b200[_0x0a9e('0x1f')]){return _0x15b200;}else{return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);}});case _0x0a9e('0x2c'):return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)['execute']();case _0x0a9e('0x2d'):return _0x479bc4['sobject'](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);default:return null;}}else if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0x15')){logger[_0x0a9e('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x384319,_0x0a9e('0x2c'));return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]();}})[_0x0a9e('0x1e')](function(_0x332d35){if(_0x332d35&&_0x332d35[_0x0a9e('0x1f')]){var _0x5583a4=_[_0x0a9e('0x1c')](_0x332d35,function(_0x5e7238){return _0x5e7238[_0x0a9e('0x2e')]===_0x384319;});if(_0x5583a4){return BPromise[_0x0a9e('0x25')]({'id':_0x5583a4['Id'],'name':_0x5583a4[_0x0a9e('0x2f')],'phone':_0x5583a4[_0x0a9e('0x2e')]});}}})['then'](function(_0x191e91){if(_0x191e91){logger[_0x0a9e('0x22')](_0x0a9e('0x30'),_0x384319);return BPromise[_0x0a9e('0x25')](_0x191e91);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x384319);var _0x1e8694={'LastName':_0x526cf3!==''?_0x526cf3:util[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x384319),'Phone':_0x384319};if(_0x33161b[_0x0a9e('0x33')]){if(_0x33161b[_0x0a9e('0x33')]==='contact'){logger[_0x0a9e('0x22')](_0x0a9e('0x34'),_0x384319,_0x33161b[_0x0a9e('0x33')]);}else if(_0x33161b['moduleCreate']===_0x0a9e('0x2d')&&_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x384319,_0x33161b[_0x0a9e('0x33')]);_0x1e8694[_0x0a9e('0x35')]='No\x20Company';}else{return null;}}return _0x479bc4[_0x0a9e('0x1a')](_[_0x0a9e('0x36')](_0x33161b[_0x0a9e('0x33')]))[_0x0a9e('0x17')](_0x1e8694);}});}function getCustomFields(_0x4b38d9,_0x5a594b){var _0x15e37d={};if(_0x4b38d9[_0x0a9e('0x1f')]>0x0){_['forEach'](_0x4b38d9,function(_0x183991){if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x38')&&_0x183991['idField']){_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x183991[_0x0a9e('0x3a')][_0x0a9e('0x3b')]();}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3c')&&_0x183991[_0x0a9e('0x3d')]&&_0x183991[_0x0a9e('0x39')]){_0x5a594b[_0x183991[_0x0a9e('0x3d')]]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3d')]][_0x0a9e('0x3b')]());}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3e')&&_0x183991[_0x0a9e('0x3f')]&&_0x183991[_0x0a9e('0x3f')]['name']&&_0x183991['idField']){_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()][_0x0a9e('0x3b')]());}});}return _0x15e37d;}function getConnection(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x42')][_0x0a9e('0x43')](_0x432fcc['securityToken']);var _0x117c99=new jsforce[(_0x0a9e('0x44'))]({'oauth2':{'loginUrl':_0x432fcc[_0x0a9e('0x45')]||_0x0a9e('0x46'),'clientId':_0x432fcc[_0x0a9e('0x47')],'clientSecret':_0x432fcc[_0x0a9e('0x48')]}});return _0x117c99[_0x0a9e('0x49')](_0x432fcc[_0x0a9e('0x4a')],_0x25c6e6)['then'](function(){logger[_0x0a9e('0x22')]('Connection\x20established.');return _0x117c99;});}exports[_0x0a9e('0x4b')]=function(_0x476688,_0x8d6dd1,_0x562fb4,_0x14bec2,_0x7f6eb1,_0x4774f4){var _0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f;_0x4774f4['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x4d')]);_0x4774f4[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x45')]);if(_0x7f6eb1&&_0x7f6eb1[_0x0a9e('0x4e')]){logger[_0x0a9e('0x22')](_0x0a9e('0x4f'),_0x0a9e('0x50'));_0x8d6dd1['recordingURL']=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x4774f4['serverUrl'],_0x8d6dd1['uniqueid'],md5(_0x8d6dd1['uniqueid']));}else{_0x8d6dd1[_0x0a9e('0x52')]='';}return getConnection(_0x4774f4)[_0x0a9e('0x1e')](function(_0x37edaa){_0x45bf7f=_0x37edaa;return getUser(_0x4774f4,_0x14bec2[_0x0a9e('0x53')],_0x45bf7f);})[_0x0a9e('0x1e')](function(_0x30decb){_0x34aa5a=_0x30decb;return getEndUser(_0x4774f4,_0x562fb4,_0x8d6dd1[_0x0a9e('0x54')],_0x8d6dd1[_0x0a9e('0x55')],_0x45bf7f);})['then'](function(_0x4b1b9f){_0x45c845=_0x4b1b9f;return getTicket(_0x4774f4,_0x34aa5a,_0x45c845,_0x562fb4,_0x8d6dd1,_0x562fb4['Fields'],_0x45bf7f,_0x0a9e('0x4b'));})[_0x0a9e('0x1e')](function(_0x14d602){_0x37be73=_0x14d602;logger['info'](_0x0a9e('0x56'),_0x37be73['id']);logger[_0x0a9e('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37be73['id'],_0x14bec2['name'],_0x4774f4[_0x0a9e('0x37')]);switch(_0x4774f4['type']){case _0x0a9e('0x57'):emit(util['format'](_0x0a9e('0x58'),_0x14bec2[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x37be73['id']});break;case'newTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x14bec2['name']),'trigger:browser:url',{'uri':util[_0x0a9e('0x31')](_0x0a9e('0x5a'),_0x45bf7f['instanceUrl'],_0x37be73['id'])});break;default:logger[_0x0a9e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0a9e('0x5c')](function(_0x523cd2){logger[_0x0a9e('0x5b')]('[QUEUE]',JSON['stringify'](_0x523cd2));});};exports['outbound']=function(_0x2da03c,_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df,_0x232830){var _0x272738,_0xd10662,_0x28d814,_0x4e67ab;_0x19b4df[_0x0a9e('0x4d')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x4d')]);_0x19b4df[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x45')]);if(_0x232830&&_0x232830['recordingFormat']&&_0x232830[_0x0a9e('0x5d')]!==_0x0a9e('0x5e')){logger['info'](_0x0a9e('0x5f'),'Recording\x20is\x20enabled!');_0x47de4c[_0x0a9e('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19b4df['serverUrl'],_0x47de4c[_0x0a9e('0x60')],md5(_0x47de4c['uniqueid']));}return getConnection(_0x19b4df)[_0x0a9e('0x1e')](function(_0x1fc70e){_0x4e67ab=_0x1fc70e;return getUser(_0x19b4df,_0x65432[_0x0a9e('0x53')],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x1cca9f){_0x272738=_0x1cca9f;return getEndUser(_0x19b4df,_0x2f7092,_0x47de4c[_0x0a9e('0x61')],_0x47de4c['destcalleridnum'],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x5854cc){_0xd10662=_0x5854cc;return getTicket(_0x19b4df,_0x272738,_0xd10662,_0x2f7092,_0x47de4c,_0x2f7092[_0x0a9e('0x62')],_0x4e67ab,_0x0a9e('0x63'));})[_0x0a9e('0x1e')](function(_0x5adf8f){_0x28d814=_0x5adf8f;logger[_0x0a9e('0x22')](_0x0a9e('0x64'),_0x28d814['id']);logger[_0x0a9e('0x22')](_0x0a9e('0x65'),_0x28d814['id'],_0x65432['name'],_0x19b4df[_0x0a9e('0x37')]);switch(_0x19b4df[_0x0a9e('0x37')]){case'integrationTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x28d814['id']});break;case _0x0a9e('0x66'):emit(util['format'](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x67'),{'uri':util['format'](_0x0a9e('0x5a'),_0x4e67ab['instanceUrl'],_0x28d814['id'])});break;default:logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x68'));}})[_0x0a9e('0x5c')](function(_0x19c995){logger[_0x0a9e('0x5b')](_0x0a9e('0x5f'),JSON[_0x0a9e('0x69')](_0x19c995));});};exports[_0x0a9e('0x6a')]=function(_0x2d7205,_0x1cc4f3,_0x2e89b7,_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898,_0x412a72,_0x2a28c0,_0x4257c9;_0x2b8192['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x2b8192[_0x0a9e('0x4d')]);_0x2b8192[_0x0a9e('0x45')]=intUtil['stripTrailingSlash'](_0x2b8192[_0x0a9e('0x45')]);if(_0x2bbb86&&_0x2bbb86[_0x0a9e('0x4e')]){logger['info'](_0x0a9e('0x6b'),_0x0a9e('0x50'));_0x1cc4f3[_0x0a9e('0x52')]=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x2b8192['serverUrl'],_0x1cc4f3['uniqueid'],md5(_0x1cc4f3['uniqueid']));}else{_0x1cc4f3[_0x0a9e('0x52')]='';}return getConnection(_0x2b8192)[_0x0a9e('0x1e')](function(_0x1104ad){_0x4257c9=_0x1104ad;if(!_[_0x0a9e('0x18')](_0x19012b)){return getUser(_0x2b8192,_0x19012b[_0x0a9e('0x40')],_0x4257c9);}else{return getUser(_0x2b8192,null,_0x4257c9);}})[_0x0a9e('0x1e')](function(_0xeef20){_0x320898=_0xeef20;return getEndUser(_0x2b8192,_0x2e89b7,_0x1cc4f3[_0x0a9e('0x54')],_0x1cc4f3['calleridnum'],_0x4257c9);})[_0x0a9e('0x1e')](function(_0xcbc8b2){_0x412a72=_0xcbc8b2;return getTicket(_0x2b8192,_0x320898,_0x412a72,_0x2e89b7,_0x1cc4f3,_0x2e89b7[_0x0a9e('0x62')],_0x4257c9);})['then'](function(_0x2bdc44){_0x2a28c0=_0x2bdc44;logger['info'](_0x0a9e('0x6c'),_0x2a28c0['id']);logger[_0x0a9e('0x22')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x2b8192[_0x0a9e('0x37')]);})[_0x0a9e('0x5c')](function(_0x2cc7a7){logger[_0x0a9e('0x5b')]('[ABANDONED]',JSON[_0x0a9e('0x69')](_0x2cc7a7));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 099387e..b0226ff 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 _0xa3e6=['GET','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','forEach','type','string','idField','toLowerCase','content','toString','customField','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','POST','assign','Subjects','getString',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','name','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','abandoned','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter'];(function(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x3ff0c0,_0x2c8dc1){_0x3ff0c0=_0x3ff0c0-0x0;var _0x23ae45=_0xa3e6[_0x3ff0c0];return _0x23ae45;};'use strict';var _=require(_0x6a3e('0x0'));var Promise=require('bluebird');var rp=require(_0x6a3e('0x1'));var util=require('util');var md5=require(_0x6a3e('0x2'));var Redis=require(_0x6a3e('0x3'));var intUtil=require(_0x6a3e('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6a3e('0x5'))('servicenow');config[_0x6a3e('0x6')]=_[_0x6a3e('0x7')](config[_0x6a3e('0x6')],{'host':_0x6a3e('0x8'),'port':0x18eb});var io=require(_0x6a3e('0x9'))(new Redis(config['redis']));function getAdminUser(_0x3d7fbe,_0x3d2a86,_0x5c3b9f,_0x4891ba,_0x2d2477,_0x5707de){return new Promise(function(_0x54a40c,_0xef2185){var _0x4f5a4a={'method':_0x6a3e('0xa'),'uri':_0x4891ba+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x2d2477+'&'+_0x5707de,'auth':_0x3d2a86,'json':!![]};return rp(_0x4f5a4a)[_0x6a3e('0xb')](function(_0x3159db){if(_0x3159db[_0x6a3e('0xc')][_0x6a3e('0xd')]>0x0){_0x5c3b9f[_0x6a3e('0xe')]=_0x3159db[_0x6a3e('0xc')][0x0]['sys_id'];}logger[_0x6a3e('0xf')]('['+[_0x3d7fbe[_0x6a3e('0x10')]()]+_0x6a3e('0x11'),_0x5c3b9f);_0x54a40c(_0x5c3b9f);})[_0x6a3e('0x12')](function(_0x1364be){logger[_0x6a3e('0x13')]('['+[_0x3d7fbe[_0x6a3e('0x10')]()]+']',_0x1364be['message']);_0xef2185(_0x1364be[_0x6a3e('0x14')]);});});}function getUser(_0x13b172,_0x8ed74b,_0x2a62a8,_0x500ccd,_0x462b8d){return function(_0x24666d){logger['info']('['+[_0x13b172['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x24666d);return new Promise(function(_0x58b221,_0x48adf6){if(intUtil[_0x6a3e('0x15')](_0x24666d[_0x6a3e('0x16')])){var _0x31a190={'method':_0x6a3e('0xa'),'uri':_0x2a62a8+_0x6a3e('0x17')+_0x24666d[_0x6a3e('0x16')]+'&'+_0x500ccd+'&'+_0x462b8d,'auth':_0x8ed74b,'json':!![]};logger[_0x6a3e('0xf')]('['+[_0x13b172[_0x6a3e('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x31a190);return rp(_0x31a190)[_0x6a3e('0xb')](function(_0x58b7b9){logger[_0x6a3e('0xf')]('['+[_0x13b172['toUpperCase']()]+_0x6a3e('0x18'),_0x58b7b9);if(_0x58b7b9[_0x6a3e('0xc')][_0x6a3e('0xd')]>0x0&&String(_0x58b7b9[_0x6a3e('0xc')][0x0]['active'])==='true'){_0x24666d[_0x6a3e('0x19')]=_0x58b7b9[_0x6a3e('0xc')][0x0][_0x6a3e('0x1a')];}else{_0x24666d[_0x6a3e('0x19')]=_0x24666d[_0x6a3e('0xe')];_0x24666d[_0x6a3e('0x16')]=_0x24666d[_0x6a3e('0x1b')];}logger[_0x6a3e('0xf')]('['+[_0x13b172[_0x6a3e('0x10')]()]+_0x6a3e('0x1c'),_0x24666d);_0x58b221(_0x24666d);})[_0x6a3e('0x12')](function(_0x359460){logger[_0x6a3e('0x13')]('['+[_0x13b172[_0x6a3e('0x10')]()]+']',_0x359460[_0x6a3e('0x14')]);_0x48adf6(_0x359460['message']);});}else{logger['info']('['+[_0x13b172[_0x6a3e('0x10')]()]+_0x6a3e('0x1d'));_0x24666d[_0x6a3e('0x19')]=_0x24666d[_0x6a3e('0xe')];_0x24666d[_0x6a3e('0x16')]=_0x24666d[_0x6a3e('0x1b')];_0x58b221(_0x24666d);}});};}function createEndUser(_0x411eb9,_0x302205,_0xd87198,_0x436169,_0x3a831b){logger['info']('['+[_0x411eb9['toUpperCase']()]+_0x6a3e('0x1e'),_0xd87198);return new Promise(function(_0x4cda7d,_0x46b13a){var _0x5db820={'method':'POST','uri':_0x436169+_0x6a3e('0x1f')+_0x3a831b,'body':{'user_name':_0xd87198[_0x6a3e('0x20')],'roles':'user','first_name':_0xd87198['endUserNumber'],'active':_0x6a3e('0x21'),'date_format':_0x6a3e('0x22'),'phone':_0xd87198[_0x6a3e('0x20')]},'auth':_0x302205,'json':!![]};return rp(_0x5db820)[_0x6a3e('0xb')](function(_0x584d44){logger['info']('['+[_0x411eb9[_0x6a3e('0x10')]()]+_0x6a3e('0x23'),_0x584d44[_0x6a3e('0xc')]);_0xd87198[_0x6a3e('0x24')]=_0x584d44['result'][_0x6a3e('0x1a')];_0x4cda7d(_0xd87198);})[_0x6a3e('0x12')](function(_0x5022e2){logger['error']('['+[_0x411eb9['toUpperCase']()]+']',_0x5022e2[_0x6a3e('0x14')]);_0x46b13a(_0x5022e2[_0x6a3e('0x14')]);});});}function getEndUser(_0xec468e,_0x257513,_0x432aaa,_0x3691d8,_0x325160){return function(_0x1e497c){logger[_0x6a3e('0xf')]('['+[_0xec468e[_0x6a3e('0x10')]()]+_0x6a3e('0x25'),_0x1e497c);return new Promise(function(_0x23dc3f,_0x2d8ae3){var _0x12469a={'method':_0x6a3e('0xa'),'uri':_0x432aaa+'sys_user?sysparm_query=phone%3D'+_0x1e497c[_0x6a3e('0x20')]+'&'+_0x3691d8+'&'+_0x325160,'auth':_0x257513,'json':!![]};return rp(_0x12469a)[_0x6a3e('0xb')](function(_0xda602f){if(_0xda602f['result'][_0x6a3e('0xd')]>0x0){_0x1e497c[_0x6a3e('0x24')]=_0xda602f['result'][0x0][_0x6a3e('0x1a')];logger[_0x6a3e('0xf')]('['+[_0xec468e[_0x6a3e('0x10')]()]+'],\x20getEndUser\x20crm',_0x1e497c);_0x23dc3f(_0x1e497c);}else{return createEndUser(_0xec468e,_0x257513,_0x1e497c,_0x432aaa,_0x3691d8)[_0x6a3e('0xb')](function(_0x19fa39){logger[_0x6a3e('0xf')]('['+[_0xec468e[_0x6a3e('0x10')]()]+_0x6a3e('0x26'),_0x19fa39);_0x23dc3f(_0x19fa39);});}})[_0x6a3e('0x12')](function(_0x5f4ff5){logger[_0x6a3e('0x13')]('['+[_0xec468e['toUpperCase']()]+']',_0x5f4ff5['message']);_0x2d8ae3(_0x5f4ff5['message']);});});};}function getCustomFields(_0xfbbb78,_0x4bb1ba){var _0x1a6b68={};if(_0xfbbb78[_0x6a3e('0xd')]>0x0){_[_0x6a3e('0x27')](_0xfbbb78,function(_0x16aed9){if(_0x16aed9[_0x6a3e('0x28')]===_0x6a3e('0x29')&&_0x16aed9['nameField']&&!_0x16aed9['customField']){_0x1a6b68[_0x16aed9[_0x6a3e('0x2a')][_0x6a3e('0x2b')]()]=_0x16aed9[_0x6a3e('0x2c')][_0x6a3e('0x2d')]();}else if(_0x16aed9[_0x6a3e('0x28')]==='string'&&_0x16aed9[_0x6a3e('0x2a')]&&_0x16aed9[_0x6a3e('0x2e')]){_0x1a6b68[_0x16aed9['idField'][_0x6a3e('0x2b')]()]=_0x16aed9[_0x6a3e('0x2c')][_0x6a3e('0x2d')]();}else if(_0x16aed9['type']===_0x6a3e('0x2f')&&_0x16aed9[_0x6a3e('0x30')]&&_0x16aed9[_0x6a3e('0x2a')]&&_0x16aed9[_0x6a3e('0x2e')]){_0x1a6b68[_0x16aed9[_0x6a3e('0x2a')][_0x6a3e('0x2b')]()]=_0x4bb1ba[_0x16aed9['variableName']][_0x6a3e('0x2d')]();}else if(_0x16aed9[_0x6a3e('0x28')]===_0x6a3e('0x31')&&_0x16aed9['Variable']&&_0x16aed9[_0x6a3e('0x32')]['name']&&_0x16aed9['idField']&&_0x16aed9[_0x6a3e('0x2e')]){_0x1a6b68[_0x16aed9[_0x6a3e('0x2a')][_0x6a3e('0x2b')]()]=_0x4bb1ba[_0x16aed9['Variable']['name'][_0x6a3e('0x2b')]()][_0x6a3e('0x2d')]();}});}return _0x1a6b68;}function getTicket(_0x42ece3,_0x320530,_0x1c9f75,_0xb084a0,_0x4d8c70,_0x17ffbb){return function(_0x24348c){logger[_0x6a3e('0xf')]('['+[_0x42ece3[_0x6a3e('0x10')]()]+_0x6a3e('0x33'),_0x24348c);return new Promise(function(_0x3dbe12,_0x7bf98f){var _0xb409f8=_0x42ece3[_0x6a3e('0x2b')]()==='outbound'?_0x24348c[_0x6a3e('0x19')]:_0x24348c[_0x6a3e('0x24')];var _0x4f0211={'method':_0x6a3e('0x34'),'uri':_0x1c9f75+'incident'+'?'+_0x17ffbb,'body':Object[_0x6a3e('0x35')]({},{'active':_0x6a3e('0x21'),'caller_id':_0xb409f8,'assigned_to':_0x24348c[_0x6a3e('0x19')],'short_description':intUtil['getString'](_0xb084a0[_0x6a3e('0x36')],_0x4d8c70,'\x20'),'description':intUtil[_0x6a3e('0x37')](_0xb084a0['Descriptions'],_0x4d8c70,'\x0a')},getCustomFields(_0xb084a0['Fields'],_0x4d8c70)),'auth':_0x320530,'json':!![]};return rp(_0x4f0211)['then'](function(_0x2537b6){logger[_0x6a3e('0xf')]('['+[_0x42ece3[_0x6a3e('0x10')]()]+_0x6a3e('0x38'),_0x2537b6[_0x6a3e('0xc')]);_0x24348c[_0x6a3e('0x39')]=_0x2537b6[_0x6a3e('0xc')][_0x6a3e('0x1a')];_0x24348c[_0x6a3e('0x3a')]=_0x2537b6[_0x6a3e('0xc')][_0x6a3e('0x3b')];logger['info']('['+[_0x42ece3[_0x6a3e('0x10')]()]+_0x6a3e('0x3c'),_0x24348c);_0x3dbe12(_0x24348c);})[_0x6a3e('0x12')](function(_0x21ba7b){logger[_0x6a3e('0x13')]('['+[_0x42ece3['toUpperCase']()]+']',_0x21ba7b[_0x6a3e('0x14')]);_0x7bf98f(_0x21ba7b['message']);});});};}function createRemoteTag(_0x1afa0a,_0x37b0c8,_0x4643b9,_0x2cc1ca){return new Promise(function(_0x1a72d1,_0x4be989){var _0x498f2d={'method':'POST','uri':_0x4643b9+_0x6a3e('0x3d')+'?'+_0x2cc1ca,'body':{'short_description':_0x1afa0a,'global':!![],'active':!![],'name':_0x1afa0a},'auth':_0x37b0c8,'json':!![]};return rp(_0x498f2d)[_0x6a3e('0xb')](function(_0x28043a){var _0x1f2858=_0x28043a[_0x6a3e('0xc')][_0x6a3e('0x1a')];_0x1a72d1(_0x1f2858);});});}function getRemoteTag(_0x504d86,_0x1d94e8,_0x5c928d,_0x47b23c,_0x54f666){return new Promise(function(_0xd00794,_0xa1e944){var _0x521003={'method':_0x6a3e('0xa'),'uri':_0x5c928d+_0x6a3e('0x3d')+'?sysparm_query=name%3D'+_0x504d86+'&'+_0x47b23c,'auth':_0x1d94e8,'json':!![]};return rp(_0x521003)[_0x6a3e('0xb')](function(_0x1faf88){if(_0x1faf88[_0x6a3e('0xc')][_0x6a3e('0xd')]>0x0){var _0x93790a=_0x1faf88['result'][0x0][_0x6a3e('0x1a')];_0xd00794(_0x93790a);}else{return createRemoteTag(_0x504d86,_0x1d94e8,_0x5c928d,_0x47b23c)[_0x6a3e('0xb')](function(_0x51d5fb){_0xd00794(_0x51d5fb);});}});});}function assignTagToIncident(_0x132fd9,_0x30fe3b,_0xbfecf4,_0x2603e9,_0x6d143d){return new Promise(function(_0x1028cf,_0x14fd86){var _0x15799b={'method':_0x6a3e('0x34'),'uri':_0xbfecf4+_0x6a3e('0x3e')+'?'+_0x6d143d,'body':{'label':_0x132fd9,'table':_0x6a3e('0x3f'),'id_type':'Incident','table_key':_0x2603e9[_0x6a3e('0x39')],'title':_0x6a3e('0x40')+_0x2603e9[_0x6a3e('0x3a')],'id_display':_0x2603e9['ticketNumber']},'auth':_0x30fe3b,'json':!![]};return rp(_0x15799b)[_0x6a3e('0xb')](function(_0xfbc991){_0x1028cf();})[_0x6a3e('0x12')](function(){_0x1028cf();});});}function manageTags(_0x33e6de,_0x582ad9,_0x3e29a8,_0x5ed33d,_0x4294d7,_0x4f68eb,_0x3a4181){return new Promise(function(_0x486d4a,_0x471e73){var _0x2d5cfe=[];_0x582ad9[_0x6a3e('0x27')](function(_0x1abfd4){_0x2d5cfe[_0x6a3e('0x41')](getRemoteTag(_0x1abfd4,_0x3e29a8,_0x5ed33d,_0x4f68eb,_0x3a4181));});return Promise[_0x6a3e('0x42')](_0x2d5cfe)[_0x6a3e('0xb')](function(_0x54ae99){if(_0x54ae99[_0x6a3e('0xd')]){logger[_0x6a3e('0xf')]('['+[_0x33e6de[_0x6a3e('0x10')]()]+_0x6a3e('0x43'),_0x54ae99);var _0x145655=[];_0x54ae99[_0x6a3e('0x27')](function(_0x1da682){_0x145655[_0x6a3e('0x41')](assignTagToIncident(_0x1da682,_0x3e29a8,_0x5ed33d,_0x4294d7,_0x4f68eb));});return Promise[_0x6a3e('0x42')](_0x145655)[_0x6a3e('0xb')](function(){_0x486d4a();})[_0x6a3e('0x12')](function(){_0x486d4a();});}else{_0x486d4a();}});});}function getTags(_0x318fd9,_0x4b3db4,_0x24c444,_0x40213e,_0x17ed75,_0x5d11f9){return function(_0x4420b9){return new Promise(function(_0x5c349f,_0x3fe425){var _0xf8a75f=[];var _0x4a3924=_0x40213e[_0x6a3e('0x44')];if(_0x4a3924&&_0x4a3924[_0x6a3e('0xd')]>0x0){_0xf8a75f=_['map'](_0x4a3924,_0x6a3e('0x45'));}if(_0xf8a75f[_0x6a3e('0xd')]>0x0){return manageTags(_0x318fd9,_0xf8a75f,_0x4b3db4,_0x24c444,_0x4420b9,_0x17ed75,_0x5d11f9)[_0x6a3e('0xb')](function(){_0x5c349f(_0x4420b9);});}else{_0x5c349f(_0x4420b9);}});};}function emit(_0x177432,_0x12fbb7,_0x52f396){var _0x3f4b95='%26sysparm_record_target%3Dincident'+_0x6a3e('0x46')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x6a3e('0x47');var _0x156bd3={'uri':_0x177432+_0x6a3e('0x48')+_0x52f396+_0x3f4b95};io['to'](util[_0x6a3e('0x49')]('user:%s',_0x12fbb7))['emit'](_0x6a3e('0x4a'),_0x156bd3);}exports['cs']=function(_0x309e1c,_0x48edbf,_0x2704f0,_0x1e11dd,_0x3e5f88,_0x7b8d96,_0x2aec4a,_0x5273d2){var _0x49edcd={};var _0x4429f1={'user':_0x7b8d96[_0x6a3e('0x4b')],'pass':_0x7b8d96[_0x6a3e('0x4c')]};var _0x924f01=_0x6a3e('0x4d');var _0xb5afbb='sysparm_display_value=true';_0x7b8d96[_0x6a3e('0x4e')]=intUtil[_0x6a3e('0x4f')](_0x7b8d96[_0x6a3e('0x4e')]);_0x7b8d96[_0x6a3e('0x50')]=intUtil[_0x6a3e('0x4f')](_0x7b8d96[_0x6a3e('0x50')]);var _0x4916a5=util['format'](_0x6a3e('0x51'),_0x7b8d96[_0x6a3e('0x4e')]);_0x49edcd[_0x6a3e('0x16')]=!_[_0x6a3e('0x52')](_0x1e11dd)?_0x1e11dd[_0x6a3e('0x53')]:null;_0x49edcd[_0x6a3e('0x1b')]=_0x7b8d96[_0x6a3e('0x53')];_0x49edcd[_0x6a3e('0x20')]=_0x5273d2[_0x6a3e('0x2b')]()==='outbound'?_0x48edbf[_0x6a3e('0x54')]:_0x48edbf[_0x6a3e('0x55')];_0x49edcd[_0x6a3e('0x56')]=_0x5273d2===_0x6a3e('0x57')||_0x5273d2===_0x6a3e('0x58')?_0x6a3e('0x57'):_0x6a3e('0x59');var _0x687f86=util['format'](_0x6a3e('0x5a'),_0x7b8d96['serverUrl'],_0x48edbf['uniqueid'],md5(_0x48edbf[_0x6a3e('0x5b')]));if(_0x3e5f88&&_0x3e5f88[_0x6a3e('0x5c')]){logger[_0x6a3e('0xf')]('[QUEUE]',_0x6a3e('0x5d'));_0x48edbf[_0x6a3e('0x5e')]=_0x687f86;}else if(_0x2aec4a&&_0x2aec4a[_0x6a3e('0x5f')]&&_0x2aec4a[_0x6a3e('0x5f')]!==_0x6a3e('0x60')){logger[_0x6a3e('0xf')](_0x6a3e('0x61'),_0x6a3e('0x5d'));_0x48edbf[_0x6a3e('0x5e')]=_0x687f86;}else{_0x48edbf['recordingURL']='';}return getAdminUser(_0x5273d2,_0x4429f1,_0x49edcd,_0x4916a5,_0xb5afbb,_0x924f01)[_0x6a3e('0xb')](getUser(_0x5273d2,_0x4429f1,_0x4916a5,_0xb5afbb,_0x924f01))[_0x6a3e('0xb')](getEndUser(_0x5273d2,_0x4429f1,_0x4916a5,_0xb5afbb,_0x924f01))[_0x6a3e('0xb')](getTicket(_0x5273d2,_0x4429f1,_0x4916a5,_0x2704f0,_0x48edbf,_0xb5afbb))[_0x6a3e('0xb')](function(_0x427b8e){logger[_0x6a3e('0xf')](util[_0x6a3e('0x49')](_0x6a3e('0x62'),_0x427b8e[_0x6a3e('0x39')]));logger[_0x6a3e('0xf')](util[_0x6a3e('0x49')]('call\x20direction:\x20%s',_0x5273d2));if(_0x5273d2!=='abandoned'){logger[_0x6a3e('0xf')]('['+[_0x5273d2[_0x6a3e('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x7b8d96['remoteUri'],_0x1e11dd[_0x6a3e('0x45')],_0x427b8e['ticketId']);}})[_0x6a3e('0x12')](function(_0x7bf1b2){logger[_0x6a3e('0x13')]('['+[_0x5273d2[_0x6a3e('0x10')]()]+_0x6a3e('0x63'),util['inspect'](_0x7bf1b2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xda65=['sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','nameField','customField','idField','toLowerCase','content','toString','string','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1'];(function(_0x3b9990,_0x578cea){var _0xc02e3b=function(_0x192954){while(--_0x192954){_0x3b9990['push'](_0x3b9990['shift']());}};_0xc02e3b(++_0x578cea);}(_0xda65,0x1d0));var _0x5da6=function(_0x4a0d94,_0x473585){_0x4a0d94=_0x4a0d94-0x0;var _0x401284=_0xda65[_0x4a0d94];return _0x401284;};'use strict';var _=require(_0x5da6('0x0'));var Promise=require(_0x5da6('0x1'));var rp=require(_0x5da6('0x2'));var util=require('util');var md5=require(_0x5da6('0x3'));var Redis=require(_0x5da6('0x4'));var intUtil=require(_0x5da6('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x5da6('0x6'));config[_0x5da6('0x7')]=_[_0x5da6('0x8')](config[_0x5da6('0x7')],{'host':_0x5da6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5da6('0x7')]));function getAdminUser(_0x4a7040,_0x55108e,_0x40722c,_0x4b1bf0,_0x447887,_0x20cb14){return new Promise(function(_0x32643d,_0x28d332){var _0x32d8f5={'method':_0x5da6('0xa'),'uri':_0x4b1bf0+_0x5da6('0xb')+'&'+_0x447887+'&'+_0x20cb14,'auth':_0x55108e,'json':!![]};return rp(_0x32d8f5)[_0x5da6('0xc')](function(_0x4bd1cc){if(_0x4bd1cc[_0x5da6('0xd')][_0x5da6('0xe')]>0x0){_0x40722c[_0x5da6('0xf')]=_0x4bd1cc[_0x5da6('0xd')][0x0][_0x5da6('0x10')];}logger[_0x5da6('0x11')]('['+[_0x4a7040[_0x5da6('0x12')]()]+_0x5da6('0x13'),_0x40722c);_0x32643d(_0x40722c);})[_0x5da6('0x14')](function(_0x57a52f){logger[_0x5da6('0x15')]('['+[_0x4a7040[_0x5da6('0x12')]()]+']',_0x57a52f[_0x5da6('0x16')]);_0x28d332(_0x57a52f[_0x5da6('0x16')]);});});}function getUser(_0x2ca041,_0x47798b,_0x32a16a,_0x1c28b7,_0x4f594e){return function(_0x272b50){logger['info']('['+[_0x2ca041['toUpperCase']()]+_0x5da6('0x17'),_0x272b50);return new Promise(function(_0x31b743,_0x41534d){if(intUtil['validateEmail'](_0x272b50[_0x5da6('0x18')])){var _0x4b42e4={'method':_0x5da6('0xa'),'uri':_0x32a16a+_0x5da6('0x19')+_0x272b50[_0x5da6('0x18')]+'&'+_0x1c28b7+'&'+_0x4f594e,'auth':_0x47798b,'json':!![]};logger[_0x5da6('0x11')]('['+[_0x2ca041['toUpperCase']()]+_0x5da6('0x1a'),_0x4b42e4);return rp(_0x4b42e4)[_0x5da6('0xc')](function(_0x45a282){logger[_0x5da6('0x11')]('['+[_0x2ca041[_0x5da6('0x12')]()]+_0x5da6('0x1b'),_0x45a282);if(_0x45a282[_0x5da6('0xd')][_0x5da6('0xe')]>0x0&&String(_0x45a282['result'][0x0][_0x5da6('0x1c')])==='true'){_0x272b50[_0x5da6('0x1d')]=_0x45a282[_0x5da6('0xd')][0x0][_0x5da6('0x10')];}else{_0x272b50[_0x5da6('0x1d')]=_0x272b50[_0x5da6('0xf')];_0x272b50[_0x5da6('0x18')]=_0x272b50[_0x5da6('0x1e')];}logger[_0x5da6('0x11')]('['+[_0x2ca041['toUpperCase']()]+'],\x20getUser\x20crm',_0x272b50);_0x31b743(_0x272b50);})[_0x5da6('0x14')](function(_0x256073){logger['error']('['+[_0x2ca041['toUpperCase']()]+']',_0x256073[_0x5da6('0x16')]);_0x41534d(_0x256073[_0x5da6('0x16')]);});}else{logger[_0x5da6('0x11')]('['+[_0x2ca041[_0x5da6('0x12')]()]+_0x5da6('0x1f'));_0x272b50['userId']=_0x272b50[_0x5da6('0xf')];_0x272b50[_0x5da6('0x18')]=_0x272b50[_0x5da6('0x1e')];_0x31b743(_0x272b50);}});};}function createEndUser(_0x573b0c,_0x41dab8,_0x2b3be1,_0x4fe9b3,_0x1abd20){logger[_0x5da6('0x11')]('['+[_0x573b0c[_0x5da6('0x12')]()]+_0x5da6('0x20'),_0x2b3be1);return new Promise(function(_0x2be5ac,_0x48937c){var _0x26cb1a={'method':_0x5da6('0x21'),'uri':_0x4fe9b3+_0x5da6('0x22')+_0x1abd20,'body':{'user_name':_0x2b3be1[_0x5da6('0x23')],'roles':_0x5da6('0x24'),'first_name':_0x2b3be1[_0x5da6('0x23')],'active':_0x5da6('0x25'),'date_format':_0x5da6('0x26'),'phone':_0x2b3be1['endUserNumber']},'auth':_0x41dab8,'json':!![]};return rp(_0x26cb1a)[_0x5da6('0xc')](function(_0x1a4327){logger[_0x5da6('0x11')]('['+[_0x573b0c['toUpperCase']()]+_0x5da6('0x27'),_0x1a4327[_0x5da6('0xd')]);_0x2b3be1[_0x5da6('0x28')]=_0x1a4327[_0x5da6('0xd')][_0x5da6('0x10')];_0x2be5ac(_0x2b3be1);})[_0x5da6('0x14')](function(_0x2d7bd2){logger[_0x5da6('0x15')]('['+[_0x573b0c[_0x5da6('0x12')]()]+']',_0x2d7bd2['message']);_0x48937c(_0x2d7bd2['message']);});});}function getEndUser(_0x1d71ed,_0x5bbe10,_0x5df4eb,_0x24cea6,_0x150b1d){return function(_0x5c2abb){logger['info']('['+[_0x1d71ed[_0x5da6('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x5c2abb);return new Promise(function(_0x5a7174,_0x3f919d){var _0x11fd73={'method':'GET','uri':_0x5df4eb+_0x5da6('0x29')+_0x5c2abb[_0x5da6('0x23')]+'&'+_0x24cea6+'&'+_0x150b1d,'auth':_0x5bbe10,'json':!![]};return rp(_0x11fd73)[_0x5da6('0xc')](function(_0x3aebb){if(_0x3aebb['result'][_0x5da6('0xe')]>0x0){_0x5c2abb[_0x5da6('0x28')]=_0x3aebb[_0x5da6('0xd')][0x0]['sys_id'];logger[_0x5da6('0x11')]('['+[_0x1d71ed[_0x5da6('0x12')]()]+_0x5da6('0x2a'),_0x5c2abb);_0x5a7174(_0x5c2abb);}else{return createEndUser(_0x1d71ed,_0x5bbe10,_0x5c2abb,_0x5df4eb,_0x24cea6)[_0x5da6('0xc')](function(_0x17dd2f){logger[_0x5da6('0x11')]('['+[_0x1d71ed['toUpperCase']()]+_0x5da6('0x2b'),_0x17dd2f);_0x5a7174(_0x17dd2f);});}})[_0x5da6('0x14')](function(_0x1bf3c2){logger['error']('['+[_0x1d71ed['toUpperCase']()]+']',_0x1bf3c2['message']);_0x3f919d(_0x1bf3c2[_0x5da6('0x16')]);});});};}function getCustomFields(_0x4ffe15,_0x1880a7){var _0x4c5342={};if(_0x4ffe15[_0x5da6('0xe')]>0x0){_['forEach'](_0x4ffe15,function(_0x4480a2){if(_0x4480a2[_0x5da6('0x2c')]==='string'&&_0x4480a2[_0x5da6('0x2d')]&&!_0x4480a2[_0x5da6('0x2e')]){_0x4c5342[_0x4480a2[_0x5da6('0x2f')][_0x5da6('0x30')]()]=_0x4480a2[_0x5da6('0x31')][_0x5da6('0x32')]();}else if(_0x4480a2[_0x5da6('0x2c')]===_0x5da6('0x33')&&_0x4480a2[_0x5da6('0x2f')]&&_0x4480a2[_0x5da6('0x2e')]){_0x4c5342[_0x4480a2[_0x5da6('0x2f')][_0x5da6('0x30')]()]=_0x4480a2[_0x5da6('0x31')][_0x5da6('0x32')]();}else if(_0x4480a2[_0x5da6('0x2c')]===_0x5da6('0x34')&&_0x4480a2[_0x5da6('0x35')]&&_0x4480a2['idField']&&_0x4480a2[_0x5da6('0x2e')]){_0x4c5342[_0x4480a2[_0x5da6('0x2f')][_0x5da6('0x30')]()]=_0x1880a7[_0x4480a2[_0x5da6('0x35')]]['toString']();}else if(_0x4480a2[_0x5da6('0x2c')]===_0x5da6('0x36')&&_0x4480a2[_0x5da6('0x37')]&&_0x4480a2[_0x5da6('0x37')]['name']&&_0x4480a2[_0x5da6('0x2f')]&&_0x4480a2[_0x5da6('0x2e')]){_0x4c5342[_0x4480a2[_0x5da6('0x2f')][_0x5da6('0x30')]()]=_0x1880a7[_0x4480a2[_0x5da6('0x37')][_0x5da6('0x38')][_0x5da6('0x30')]()][_0x5da6('0x32')]();}});}return _0x4c5342;}function getTicket(_0x1644c9,_0x5f1fab,_0x3cca3f,_0x351848,_0x4583f4,_0x5b4a26){return function(_0x482511){logger[_0x5da6('0x11')]('['+[_0x1644c9[_0x5da6('0x12')]()]+_0x5da6('0x39'),_0x482511);return new Promise(function(_0xf1ef23,_0x138360){var _0x4e3c80=_0x1644c9['toLowerCase']()==='outbound'?_0x482511[_0x5da6('0x1d')]:_0x482511[_0x5da6('0x28')];var _0x3ce7b5={'method':_0x5da6('0x21'),'uri':_0x3cca3f+_0x5da6('0x3a')+'?'+_0x5b4a26,'body':Object[_0x5da6('0x3b')]({},{'active':'true','caller_id':_0x4e3c80,'assigned_to':_0x482511[_0x5da6('0x1d')],'short_description':intUtil[_0x5da6('0x3c')](_0x351848[_0x5da6('0x3d')],_0x4583f4,'\x20'),'description':intUtil['getString'](_0x351848['Descriptions'],_0x4583f4,'\x0a')},getCustomFields(_0x351848[_0x5da6('0x3e')],_0x4583f4)),'auth':_0x5f1fab,'json':!![]};return rp(_0x3ce7b5)[_0x5da6('0xc')](function(_0x510051){logger[_0x5da6('0x11')]('['+[_0x1644c9[_0x5da6('0x12')]()]+_0x5da6('0x3f'),_0x510051['result']);_0x482511[_0x5da6('0x40')]=_0x510051['result'][_0x5da6('0x10')];_0x482511[_0x5da6('0x41')]=_0x510051[_0x5da6('0xd')][_0x5da6('0x42')];logger[_0x5da6('0x11')]('['+[_0x1644c9[_0x5da6('0x12')]()]+_0x5da6('0x43'),_0x482511);_0xf1ef23(_0x482511);})[_0x5da6('0x14')](function(_0x18dad6){logger[_0x5da6('0x15')]('['+[_0x1644c9[_0x5da6('0x12')]()]+']',_0x18dad6[_0x5da6('0x16')]);_0x138360(_0x18dad6['message']);});});};}function createRemoteTag(_0x7d08f6,_0x467b0e,_0x580e89,_0xee8548){return new Promise(function(_0x24e3a1,_0x1de09b){var _0x12e6cd={'method':'POST','uri':_0x580e89+'label'+'?'+_0xee8548,'body':{'short_description':_0x7d08f6,'global':!![],'active':!![],'name':_0x7d08f6},'auth':_0x467b0e,'json':!![]};return rp(_0x12e6cd)['then'](function(_0x1ee157){var _0x19549a=_0x1ee157[_0x5da6('0xd')]['sys_id'];_0x24e3a1(_0x19549a);});});}function getRemoteTag(_0xd4f177,_0x423eb3,_0x3a07d7,_0x2d3e76,_0x14217e){return new Promise(function(_0x399cc1,_0x4bc620){var _0x23fe40={'method':_0x5da6('0xa'),'uri':_0x3a07d7+_0x5da6('0x44')+_0x5da6('0x45')+_0xd4f177+'&'+_0x2d3e76,'auth':_0x423eb3,'json':!![]};return rp(_0x23fe40)[_0x5da6('0xc')](function(_0x21fd37){if(_0x21fd37[_0x5da6('0xd')][_0x5da6('0xe')]>0x0){var _0x1d332e=_0x21fd37['result'][0x0]['sys_id'];_0x399cc1(_0x1d332e);}else{return createRemoteTag(_0xd4f177,_0x423eb3,_0x3a07d7,_0x2d3e76)[_0x5da6('0xc')](function(_0x466842){_0x399cc1(_0x466842);});}});});}function assignTagToIncident(_0x5cbc36,_0x298970,_0x2eca9f,_0x16840a,_0x33b059){return new Promise(function(_0x13dfeb,_0x4ceb91){var _0x5d2189={'method':_0x5da6('0x21'),'uri':_0x2eca9f+_0x5da6('0x46')+'?'+_0x33b059,'body':{'label':_0x5cbc36,'table':_0x5da6('0x3a'),'id_type':_0x5da6('0x47'),'table_key':_0x16840a[_0x5da6('0x40')],'title':_0x5da6('0x48')+_0x16840a[_0x5da6('0x41')],'id_display':_0x16840a[_0x5da6('0x41')]},'auth':_0x298970,'json':!![]};return rp(_0x5d2189)[_0x5da6('0xc')](function(_0x155586){_0x13dfeb();})[_0x5da6('0x14')](function(){_0x13dfeb();});});}function manageTags(_0x5ed4a7,_0x5a200d,_0x6ed073,_0x927fb1,_0x471f22,_0x39a28b,_0x1f8360){return new Promise(function(_0xd8e8ce,_0x728ae9){var _0x1edfa2=[];_0x5a200d['forEach'](function(_0x4b4e52){_0x1edfa2[_0x5da6('0x49')](getRemoteTag(_0x4b4e52,_0x6ed073,_0x927fb1,_0x39a28b,_0x1f8360));});return Promise[_0x5da6('0x4a')](_0x1edfa2)['then'](function(_0x424242){if(_0x424242[_0x5da6('0xe')]){logger[_0x5da6('0x11')]('['+[_0x5ed4a7[_0x5da6('0x12')]()]+_0x5da6('0x4b'),_0x424242);var _0x4d2568=[];_0x424242['forEach'](function(_0x598a0f){_0x4d2568[_0x5da6('0x49')](assignTagToIncident(_0x598a0f,_0x6ed073,_0x927fb1,_0x471f22,_0x39a28b));});return Promise['all'](_0x4d2568)['then'](function(){_0xd8e8ce();})[_0x5da6('0x14')](function(){_0xd8e8ce();});}else{_0xd8e8ce();}});});}function getTags(_0x1a47e3,_0x42e7b7,_0x3843ba,_0x304328,_0x1d5b8c,_0x21f95b){return function(_0x294836){return new Promise(function(_0x4fbe0a,_0x1d6bff){var _0x5e55bd=[];var _0x6103b9=_0x304328[_0x5da6('0x4c')];if(_0x6103b9&&_0x6103b9[_0x5da6('0xe')]>0x0){_0x5e55bd=_[_0x5da6('0x4d')](_0x6103b9,'name');}if(_0x5e55bd[_0x5da6('0xe')]>0x0){return manageTags(_0x1a47e3,_0x5e55bd,_0x42e7b7,_0x3843ba,_0x294836,_0x1d5b8c,_0x21f95b)[_0x5da6('0xc')](function(){_0x4fbe0a(_0x294836);});}else{_0x4fbe0a(_0x294836);}});};}function emit(_0x47aaaf,_0x5087ab,_0x4869ed){var _0x5a1c85=_0x5da6('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x188ccf={'uri':_0x47aaaf+_0x5da6('0x4f')+_0x4869ed+_0x5a1c85};io['to'](util[_0x5da6('0x50')](_0x5da6('0x51'),_0x5087ab))['emit'](_0x5da6('0x52'),_0x188ccf);}exports['cs']=function(_0x1940e3,_0x4277f8,_0x38bbb2,_0x384b0b,_0x33fd3b,_0x3197a0,_0x30a735,_0x1e2a14){var _0x3b9728={};var _0x1d0ad5={'user':_0x3197a0[_0x5da6('0x53')],'pass':_0x3197a0[_0x5da6('0x54')]};var _0x3c1bf3=_0x5da6('0x55');var _0x485caa=_0x5da6('0x56');_0x3197a0[_0x5da6('0x57')]=intUtil[_0x5da6('0x58')](_0x3197a0[_0x5da6('0x57')]);_0x3197a0[_0x5da6('0x59')]=intUtil[_0x5da6('0x58')](_0x3197a0[_0x5da6('0x59')]);var _0x3bddc5=util[_0x5da6('0x50')](_0x5da6('0x5a'),_0x3197a0[_0x5da6('0x57')]);_0x3b9728[_0x5da6('0x18')]=!_[_0x5da6('0x5b')](_0x384b0b)?_0x384b0b[_0x5da6('0x5c')]:null;_0x3b9728['adminEmail']=_0x3197a0[_0x5da6('0x5c')];_0x3b9728[_0x5da6('0x23')]=_0x1e2a14[_0x5da6('0x30')]()===_0x5da6('0x5d')?_0x4277f8[_0x5da6('0x5e')]:_0x4277f8[_0x5da6('0x5f')];_0x3b9728[_0x5da6('0x60')]=_0x1e2a14===_0x5da6('0x61')||_0x1e2a14==='abandoned'?_0x5da6('0x61'):_0x5da6('0x5d');var _0x25c221=util[_0x5da6('0x50')](_0x5da6('0x62'),_0x3197a0['serverUrl'],_0x4277f8[_0x5da6('0x63')],md5(_0x4277f8[_0x5da6('0x63')]));if(_0x33fd3b&&_0x33fd3b[_0x5da6('0x64')]){logger[_0x5da6('0x11')](_0x5da6('0x65'),_0x5da6('0x66'));_0x4277f8['recordingURL']=_0x25c221;}else if(_0x30a735&&_0x30a735['recordingFormat']&&_0x30a735[_0x5da6('0x67')]!==_0x5da6('0x68')){logger[_0x5da6('0x11')](_0x5da6('0x69'),_0x5da6('0x66'));_0x4277f8[_0x5da6('0x6a')]=_0x25c221;}else{_0x4277f8[_0x5da6('0x6a')]='';}return getAdminUser(_0x1e2a14,_0x1d0ad5,_0x3b9728,_0x3bddc5,_0x485caa,_0x3c1bf3)[_0x5da6('0xc')](getUser(_0x1e2a14,_0x1d0ad5,_0x3bddc5,_0x485caa,_0x3c1bf3))[_0x5da6('0xc')](getEndUser(_0x1e2a14,_0x1d0ad5,_0x3bddc5,_0x485caa,_0x3c1bf3))[_0x5da6('0xc')](getTicket(_0x1e2a14,_0x1d0ad5,_0x3bddc5,_0x38bbb2,_0x4277f8,_0x485caa))[_0x5da6('0xc')](function(_0x268740){logger[_0x5da6('0x11')](util[_0x5da6('0x50')]('The\x20ticket\x20ID\x20is:\x20%s',_0x268740[_0x5da6('0x40')]));logger[_0x5da6('0x11')](util['format']('call\x20direction:\x20%s',_0x1e2a14));if(_0x1e2a14!==_0x5da6('0x6b')){logger[_0x5da6('0x11')]('['+[_0x1e2a14[_0x5da6('0x12')]()]+']',_0x5da6('0x6c'));emit(_0x3197a0[_0x5da6('0x57')],_0x384b0b[_0x5da6('0x38')],_0x268740['ticketId']);}})[_0x5da6('0x14')](function(_0x3108dc){logger[_0x5da6('0x15')]('['+[_0x1e2a14[_0x5da6('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x5da6('0x6d')](_0x3108dc,{'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 ed690fb..a362efd 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 _0xb757=['user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','[ABANDONED]','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','name','getString','Subjects','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','type','nameField','string','push','customField','customVariable','Variable','toLowerCase','login','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0xb757,0x85));var _0x7b75=function(_0x4af0ed,_0x735b6f){_0x4af0ed=_0x4af0ed-0x0;var _0x63e4d3=_0xb757[_0x4af0ed];return _0x63e4d3;};'use strict';var _=require(_0x7b75('0x0'));var rp=require(_0x7b75('0x1'));var BPromise=require(_0x7b75('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x7b75('0x3'));var intUtil=require(_0x7b75('0x4'));var config=require(_0x7b75('0x5'));var logger=require(_0x7b75('0x6'))(_0x7b75('0x7'));config['redis']=_[_0x7b75('0x8')](config[_0x7b75('0x9')],{'host':_0x7b75('0xa'),'port':0x18eb});var io=require(_0x7b75('0xb'))(new Redis(config[_0x7b75('0x9')]));var def={'method':_0x7b75('0xc'),'json':!![]};function emit(_0x48a5cb,_0x46fad4,_0x1e7151){io['to'](_0x48a5cb)[_0x7b75('0xd')](_0x46fad4,_0x1e7151);}function getTicket(_0x476a23,_0x40d6c2,_0x8a8960,_0x23d62f,_0x1bb252,_0x147417,_0x9520b2,_0x4b508a){logger['info']('Creating\x20new\x20ticket...');var _0x1be15c=new Date();var _0xc598e0=[{'name':_0x7b75('0xe'),'value':intUtil[_0x7b75('0xf')](_0x23d62f[_0x7b75('0x10')],_0x1bb252,'\x20')},{'name':'assigned_user_id','value':_0x40d6c2['id']},{'name':'created_by','value':_0x40d6c2['id']},{'name':_0x7b75('0x11'),'value':intUtil[_0x7b75('0xf')](_0x23d62f[_0x7b75('0x12')],_0x1bb252,'\x0a')},{'name':_0x7b75('0x13'),'value':_0x1be15c[_0x7b75('0x14')]()[_0x7b75('0x15')](0x0,0x13)[_0x7b75('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x7b75('0x17'),'value':'15'},{'name':_0x7b75('0x18'),'value':_0x8a8960['id']},{'name':'parent_type','value':_0x7b75('0x19')},{'name':'parent_name','value':_0x8a8960[_0x7b75('0xe')]},{'name':'direction','value':_0x4b508a}];if(_0x147417['length']){_[_0x7b75('0x1a')](_0x147417,function(_0x2f832c){if(_0x1bb252[_0x2f832c[_0x7b75('0x1b')]]){_0xc598e0['push']({'name':_0x2f832c[_0x7b75('0x1c')],'value':_0x1bb252[_0x2f832c['variableName']]});}});}return request({'form':{'method':_0x7b75('0x1d'),'input_type':'JSON','response_type':_0x7b75('0x1e'),'rest_data':JSON[_0x7b75('0x1f')]({'session':_0x9520b2['id'],'module_name':_0x7b75('0x20'),'name_value_list':_0xc598e0})}});}function getAuth(_0x988b56){return util[_0x7b75('0x21')](_0x7b75('0x22'),new Buffer(_0x988b56[_0x7b75('0x23')]+':X')[_0x7b75('0x24')](_0x7b75('0x25')));}function getServerInfo(_0x4ef24f){return request({'form':{'method':_0x7b75('0x26'),'input_type':'JSON','response_type':_0x7b75('0x1e'),'rest_data':JSON[_0x7b75('0x1f')]({'session':_0x4ef24f['id']})}});}function getUser(_0x401d7b,_0x3e9b24,_0x1e14f5){if(!_[_0x7b75('0x27')](_0x3e9b24)){logger[_0x7b75('0x28')](_0x7b75('0x29'),_0x3e9b24);return request({'form':{'method':_0x7b75('0x2a'),'input_type':_0x7b75('0x1e'),'response_type':_0x7b75('0x1e'),'rest_data':JSON['stringify']({'session':_0x1e14f5['id'],'module_name':_0x7b75('0x2b'),'query':util[_0x7b75('0x21')](_0x7b75('0x2c'),_0x3e9b24),'order_by':'','offset':'0','select_fields':['id',_0x7b75('0xe'),_0x7b75('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7b75('0x2e')](function(_0x4d1c53){if(_0x4d1c53[_0x7b75('0x2f')]['length']){var _0x2b0357=_[_0x7b75('0x30')](_0x4d1c53[_0x7b75('0x2f')],function(_0x2e9a61){return _0x2e9a61[_0x7b75('0x31')]['user_name'][_0x7b75('0x32')]===_0x3e9b24;});if(_0x2b0357){logger[_0x7b75('0x28')]('Agent\x20found!');return BPromise['resolve']({'id':_0x2b0357[_0x7b75('0x31')]['id'][_0x7b75('0x32')],'name':_0x2b0357[_0x7b75('0x31')][_0x7b75('0xe')]['value']});}}logger[_0x7b75('0x28')](_0x7b75('0x33'));return BPromise[_0x7b75('0x34')]({'id':_0x1e14f5['name_value_list'][_0x7b75('0x35')][_0x7b75('0x32')],'name':_0x1e14f5['name_value_list']['user_name'][_0x7b75('0x32')]});});}else{logger[_0x7b75('0x28')](_0x7b75('0x36'));return BPromise[_0x7b75('0x34')]({'id':_0x1e14f5[_0x7b75('0x31')][_0x7b75('0x35')][_0x7b75('0x32')],'name':_0x1e14f5[_0x7b75('0x31')][_0x7b75('0x2d')][_0x7b75('0x32')]});}}function getEndUser(_0x2ba762,_0x56a7f4,_0x33b843,_0xf1ac6b){logger[_0x7b75('0x28')](_0x7b75('0x37'),_0x33b843);return request({'form':{'method':'get_entry_list','input_type':_0x7b75('0x1e'),'response_type':_0x7b75('0x1e'),'rest_data':JSON['stringify']({'session':_0xf1ac6b['id'],'module_name':_0x7b75('0x19'),'query':util['format'](_0x7b75('0x38'),_0x33b843),'order_by':'','offset':'0','select_fields':['id',_0x7b75('0xe'),_0x7b75('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36af1c){if(_0x36af1c[_0x7b75('0x2f')][_0x7b75('0x3a')]){var _0x36cf36=_[_0x7b75('0x30')](_0x36af1c['entry_list'],function(_0x238e86){return _0x238e86[_0x7b75('0x31')]['phone_home'][_0x7b75('0x32')]===_0x33b843;});if(_0x36cf36){logger[_0x7b75('0x28')](_0x7b75('0x3b'));return BPromise[_0x7b75('0x34')]({'id':_0x36cf36[_0x7b75('0x31')]['id']['value'],'name':_0x36cf36[_0x7b75('0x31')][_0x7b75('0xe')][_0x7b75('0x32')],'phone':_0x36cf36[_0x7b75('0x31')][_0x7b75('0x39')][_0x7b75('0x32')]});}}else{logger[_0x7b75('0x28')](_0x7b75('0x3c'));return request({'form':{'method':_0x7b75('0x1d'),'input_type':'JSON','response_type':_0x7b75('0x1e'),'rest_data':JSON[_0x7b75('0x1f')]({'session':_0xf1ac6b['id'],'module_name':'Contacts','name_value_list':[{'name':_0x7b75('0x3d'),'value':_0x56a7f4!==_0x7b75('0x3e')?_0x56a7f4:util[_0x7b75('0x21')](_0x7b75('0x3f'),_0x33b843)},{'name':_0x7b75('0x39'),'value':_0x33b843}]})}})[_0x7b75('0x2e')](function(_0x252c8a){logger[_0x7b75('0x28')](_0x7b75('0x40'));return BPromise['resolve']({'id':_0x252c8a['id'],'name':_0x252c8a[_0x7b75('0x2f')]['first_name'][_0x7b75('0x32')],'phone':_0x252c8a[_0x7b75('0x2f')][_0x7b75('0x39')][_0x7b75('0x32')]});});}});}function request(_0x5dbc80){logger[_0x7b75('0x41')](_0x7b75('0x42'),JSON['stringify'](_0x5dbc80));return rp(_['merge'](def,_0x5dbc80));}function getTags(_0x53dd37,_0x4bcf44){var _0x753f77=[];if(_0x53dd37&&_0x53dd37[_0x7b75('0x3a')]>0x0){_0x753f77=_['map'](_0x53dd37,_0x4bcf44);}return _0x753f77;}function getCustomFields(_0x3e7c58,_0x45bc29){var _0x57293d=[];var _0x477e5a={'custom_fields':[]};if(_0x3e7c58[_0x7b75('0x3a')]>0x0){_[_0x7b75('0x1a')](_0x3e7c58,function(_0x112833){if(_0x112833[_0x7b75('0x43')]==='string'&&_0x112833['nameField']&&!_0x112833['customField']){_0x477e5a[_0x112833[_0x7b75('0x44')]['toLowerCase']()]=_0x112833['content']['toString']();}else if(_0x112833[_0x7b75('0x43')]===_0x7b75('0x45')&&_0x112833[_0x7b75('0x1c')]&&_0x112833['customField']){_0x477e5a['custom_fields'][_0x7b75('0x46')]({'id':_0x112833['idField'],'value':_0x112833['content'][_0x7b75('0x24')]()});}else if(_0x112833[_0x7b75('0x43')]==='variable'&&_0x112833['variableName']&&_0x112833['idField']&&_0x112833[_0x7b75('0x47')]){_0x45bc29[_0x112833['variableName']]&&_0x477e5a['custom_fields']['push']({'id':_0x112833[_0x7b75('0x1c')],'value':_0x45bc29[_0x112833['variableName']][_0x7b75('0x24')]()});}else if(_0x112833['type']===_0x7b75('0x48')&&_0x112833[_0x7b75('0x49')]&&_0x112833[_0x7b75('0x49')][_0x7b75('0xe')]&&_0x112833[_0x7b75('0x1c')]&&_0x112833['customField']){_0x45bc29[_0x112833[_0x7b75('0x49')]['name'][_0x7b75('0x4a')]()]&&_0x477e5a['custom_fields'][_0x7b75('0x46')]({'id':_0x112833['idField'],'value':_0x45bc29[_0x112833[_0x7b75('0x49')][_0x7b75('0xe')][_0x7b75('0x4a')]()][_0x7b75('0x24')]()});}});}return _0x477e5a;}function getConnection(_0x411bca){return request({'method':_0x7b75('0xc'),'form':{'method':_0x7b75('0x4b'),'input_type':_0x7b75('0x1e'),'response_type':_0x7b75('0x1e'),'rest_data':JSON[_0x7b75('0x1f')]({'user_auth':{'user_name':_0x411bca['username'],'password':_0x411bca[_0x7b75('0x4c')],'encryption':_0x7b75('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x4b4551){var _0x12c99c=_0x4b4551;if(_0x12c99c['id']){def['sessionID']=_0x12c99c['id'];return BPromise['resolve'](_0x12c99c);}else{throw new Error(util[_0x7b75('0x21')](_0x7b75('0x4e'),_0x411bca['id']));}});}function setRelationship(_0x456158,_0xbc5db,_0x3e4f71,_0x266daf){return request({'form':{'method':'set_relationship','input_type':_0x7b75('0x1e'),'response_type':_0x7b75('0x1e'),'rest_data':JSON[_0x7b75('0x1f')]({'session':_0x456158['id'],'module_name':_0x7b75('0x20'),'module_id':_0x3e4f71['id'],'link_field_name':_0x266daf,'related_ids':[_0xbc5db['id']]})}});}exports[_0x7b75('0x4f')]=function(_0x50b708,_0x2cfd1e,_0x26ee91,_0x119cb5,_0x32cee9,_0x1da134){var _0x24ba1c,_0xee18d,_0x2ce524,_0x3f8070;_0x1da134[_0x7b75('0x50')]=intUtil[_0x7b75('0x51')](_0x1da134[_0x7b75('0x50')]);_0x1da134['serverUrl']=intUtil[_0x7b75('0x51')](_0x1da134[_0x7b75('0x52')]);def[_0x7b75('0x53')]=util[_0x7b75('0x21')](_0x7b75('0x54'),_0x1da134['remoteUri']);if(_0x32cee9&&_0x32cee9[_0x7b75('0x55')]){logger[_0x7b75('0x28')](_0x7b75('0x56'),_0x7b75('0x57'));_0x2cfd1e[_0x7b75('0x58')]=util[_0x7b75('0x21')](_0x7b75('0x59'),_0x1da134[_0x7b75('0x52')],_0x2cfd1e[_0x7b75('0x5a')],md5(_0x2cfd1e[_0x7b75('0x5a')]));}else{_0x2cfd1e[_0x7b75('0x58')]='';}return getConnection(_0x1da134)['then'](function(_0x3c0fc9){_0x3f8070=_0x3c0fc9;return getUser(_0x1da134,_0x119cb5[_0x7b75('0xe')],_0x3f8070);})[_0x7b75('0x2e')](function(_0x1df872){_0x24ba1c=_0x1df872;logger['info'](_0x7b75('0x5b'),_0x24ba1c['id']);return getEndUser(_0x1da134,_0x2cfd1e[_0x7b75('0x5c')],_0x2cfd1e['calleridnum'],_0x3f8070);})[_0x7b75('0x2e')](function(_0x16e7b4){_0xee18d=_0x16e7b4;logger[_0x7b75('0x28')]('The\x20Enduser\x20ID\x20is:',_0xee18d['id']);return getTicket(_0x1da134,_0x24ba1c,_0xee18d,_0x26ee91,_0x2cfd1e,_0x26ee91[_0x7b75('0x5d')],_0x3f8070,_0x7b75('0x5e'));})[_0x7b75('0x2e')](function(_0x2553f3){_0x2ce524=_0x2553f3;logger['info'](_0x7b75('0x5f'));logger[_0x7b75('0x28')]('The\x20Ticket\x20ID\x20is:',_0x2ce524['id']);return setRelationship(_0x3f8070,_0x24ba1c,_0x2ce524,_0x7b75('0x60'));})['then'](function(){return setRelationship(_0x3f8070,_0xee18d,_0x2ce524,_0x7b75('0x61'));})[_0x7b75('0x2e')](function(){return getServerInfo(_0x3f8070);})[_0x7b75('0x2e')](function(_0x521412){var _0x3c9447=parseInt(_0x521412['version'][_0x7b75('0x62')](0x0));var _0x6bff69=util[_0x7b75('0x21')](_0x7b75('0x63'),_0x1da134[_0x7b75('0x50')],_0x2ce524['id']);if(_0x3c9447>0x6){_0x6bff69=util[_0x7b75('0x21')](_0x7b75('0x64'),_0x1da134[_0x7b75('0x50')],_0x2ce524['id']);}logger[_0x7b75('0x28')](_0x7b75('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7b75('0x21')](_0x7b75('0x65'),_0x119cb5['name']),_0x7b75('0x66'),{'uri':_0x6bff69});})[_0x7b75('0x67')](function(_0x420dbe){logger[_0x7b75('0x68')](_0x7b75('0x56'),JSON[_0x7b75('0x1f')](_0x420dbe));});};exports[_0x7b75('0x69')]=function(_0x3df1ef,_0x113d85,_0x235563,_0x423993,_0x16b161,_0x318cfc,_0x261464){var _0x50a620,_0x4a128b,_0x380ef1,_0x5da914;_0x318cfc['remoteUri']=intUtil[_0x7b75('0x51')](_0x318cfc[_0x7b75('0x50')]);_0x318cfc['serverUrl']=intUtil[_0x7b75('0x51')](_0x318cfc[_0x7b75('0x52')]);def[_0x7b75('0x53')]=util['format'](_0x7b75('0x54'),_0x318cfc[_0x7b75('0x50')]);if(_0x261464&&_0x261464[_0x7b75('0x6a')]&&_0x261464[_0x7b75('0x6a')]!==_0x7b75('0x6b')){logger['info']('[OUTBOUND]',_0x7b75('0x57'));_0x113d85['recordingURL']=util[_0x7b75('0x21')](_0x7b75('0x59'),_0x318cfc['serverUrl'],_0x113d85[_0x7b75('0x5a')],md5(_0x113d85[_0x7b75('0x5a')]));}return getConnection(_0x318cfc)[_0x7b75('0x2e')](function(_0x5cdc0f){_0x5da914=_0x5cdc0f;return getUser(_0x318cfc,_0x423993[_0x7b75('0xe')],_0x5da914);})['then'](function(_0x240f76){_0x50a620=_0x240f76;logger['info'](_0x7b75('0x5b'),_0x50a620['id']);return getEndUser(_0x318cfc,_0x113d85[_0x7b75('0x6c')],_0x113d85[_0x7b75('0x6d')],_0x5da914);})[_0x7b75('0x2e')](function(_0x2f961e){_0x4a128b=_0x2f961e;logger[_0x7b75('0x28')]('The\x20Enduser\x20ID\x20is:',_0x4a128b['id']);return getTicket(_0x318cfc,_0x50a620,_0x4a128b,_0x235563,_0x113d85,_0x235563[_0x7b75('0x5d')],_0x5da914,_0x7b75('0x6e'));})[_0x7b75('0x2e')](function(_0x4d76d1){_0x380ef1=_0x4d76d1;logger['info'](_0x7b75('0x5f'));logger[_0x7b75('0x28')](_0x7b75('0x6f'),_0x380ef1['id']);return setRelationship(_0x5da914,_0x50a620,_0x380ef1,_0x7b75('0x60'));})[_0x7b75('0x2e')](function(){return setRelationship(_0x5da914,_0x4a128b,_0x380ef1,_0x7b75('0x61'));})[_0x7b75('0x2e')](function(){return getServerInfo(_0x5da914);})[_0x7b75('0x2e')](function(_0x5ef5ce){var _0x3a253b=parseInt(_0x5ef5ce[_0x7b75('0x70')]['charAt'](0x0));var _0x2d68df=util[_0x7b75('0x21')](_0x7b75('0x63'),_0x318cfc[_0x7b75('0x50')],_0x380ef1['id']);if(_0x3a253b>0x6){_0x2d68df=util[_0x7b75('0x21')](_0x7b75('0x64'),_0x318cfc[_0x7b75('0x50')],_0x380ef1['id']);}logger['info']('[OUTBOUND]',_0x7b75('0x71'));emit(util[_0x7b75('0x21')](_0x7b75('0x65'),_0x423993[_0x7b75('0xe')]),_0x7b75('0x66'),{'uri':_0x2d68df});})[_0x7b75('0x67')](function(_0x585b74){logger[_0x7b75('0x68')](_0x7b75('0x72'),JSON[_0x7b75('0x1f')](_0x585b74));});};exports['abandoned']=function(_0x594d19,_0x5eef3c,_0x2354f8,_0x1df17c,_0x472a9b,_0x4cf0a0){var _0x6b8159,_0x323c55,_0x4c4910,_0x5a3571;_0x4cf0a0[_0x7b75('0x50')]=intUtil[_0x7b75('0x51')](_0x4cf0a0[_0x7b75('0x50')]);_0x4cf0a0[_0x7b75('0x52')]=intUtil[_0x7b75('0x51')](_0x4cf0a0['serverUrl']);def[_0x7b75('0x53')]=util[_0x7b75('0x21')](_0x7b75('0x54'),_0x4cf0a0[_0x7b75('0x50')]);if(_0x472a9b&&_0x472a9b['monitor_format']){logger[_0x7b75('0x28')]('[ABANDONED]',_0x7b75('0x57'));_0x5eef3c[_0x7b75('0x58')]=util[_0x7b75('0x21')](_0x7b75('0x59'),_0x4cf0a0[_0x7b75('0x52')],_0x5eef3c['uniqueid'],md5(_0x5eef3c['uniqueid']));}else{_0x5eef3c[_0x7b75('0x58')]='';}return getConnection(_0x4cf0a0)['then'](function(_0x364a1b){_0x5a3571=_0x364a1b;if(!_['isNil'](_0x1df17c)){return getUser(_0x4cf0a0,_0x1df17c[_0x7b75('0xe')],_0x5a3571);}else{return getUser(_0x4cf0a0,null,_0x5a3571);}})[_0x7b75('0x2e')](function(_0x5d7d75){_0x6b8159=_0x5d7d75;logger[_0x7b75('0x28')]('The\x20User\x20ID\x20is:',_0x6b8159['id']);return getEndUser(_0x4cf0a0,_0x5eef3c[_0x7b75('0x5c')],_0x5eef3c['calleridnum'],_0x5a3571);})[_0x7b75('0x2e')](function(_0x4e3cf5){_0x323c55=_0x4e3cf5;logger['info'](_0x7b75('0x73'),_0x323c55['id']);return getTicket(_0x4cf0a0,_0x6b8159,_0x323c55,_0x2354f8,_0x5eef3c,_0x2354f8[_0x7b75('0x5d')],_0x5a3571,_0x7b75('0x5e'));})[_0x7b75('0x2e')](function(_0x3ac2e3){_0x4c4910=_0x3ac2e3;logger['info'](_0x7b75('0x5f'));logger['info'](_0x7b75('0x6f'),_0x4c4910['id']);return setRelationship(_0x5a3571,_0x6b8159,_0x4c4910,_0x7b75('0x60'));})[_0x7b75('0x2e')](function(){return setRelationship(_0x5a3571,_0x323c55,_0x4c4910,'contacts');})['then'](function(){return getServerInfo(_0x5a3571);})[_0x7b75('0x67')](function(_0x39ba47){logger[_0x7b75('0x68')](_0x7b75('0x74'),JSON[_0x7b75('0x1f')](_0x39ba47));});}; \ No newline at end of file +var _0x8252=['%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','[QUEUE]','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','abandoned','uri','[ABANDONED]','calleridnum','Fields','Ticket\x20created!','lodash','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','description','date_start','toISOString','replace','duration_hours','parent_type','Contacts','parent_name','name','length','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','forEach','type','string','nameField','toLowerCase','content','customField','custom_fields','push','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt'];(function(_0x11ef39,_0x300fc7){var _0x23e8d0=function(_0x2cdf8e){while(--_0x2cdf8e){_0x11ef39['push'](_0x11ef39['shift']());}};_0x23e8d0(++_0x300fc7);}(_0x8252,0x8c));var _0x2825=function(_0x5388b1,_0x1665bc){_0x5388b1=_0x5388b1-0x0;var _0x3066c9=_0x8252[_0x5388b1];return _0x3066c9;};'use strict';var _=require(_0x2825('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x2825('0x1'));var util=require(_0x2825('0x2'));var Redis=require(_0x2825('0x3'));var intUtil=require(_0x2825('0x4'));var config=require(_0x2825('0x5'));var logger=require('../../../../config/logger')(_0x2825('0x6'));config[_0x2825('0x7')]=_[_0x2825('0x8')](config['redis'],{'host':_0x2825('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2825('0x7')]));var def={'method':_0x2825('0xa'),'json':!![]};function emit(_0x32157d,_0x425136,_0x1f2282){io['to'](_0x32157d)['emit'](_0x425136,_0x1f2282);}function getTicket(_0x20c032,_0x34ec01,_0x571ccb,_0x348ad0,_0x363bfe,_0x53c6c7,_0x5afc8a,_0x22bd00){logger[_0x2825('0xb')](_0x2825('0xc'));var _0x23dee7=new Date();var _0x10d356=[{'name':'name','value':intUtil['getString'](_0x348ad0[_0x2825('0xd')],_0x363bfe,'\x20')},{'name':_0x2825('0xe'),'value':_0x34ec01['id']},{'name':'created_by','value':_0x34ec01['id']},{'name':_0x2825('0xf'),'value':intUtil['getString'](_0x348ad0['Descriptions'],_0x363bfe,'\x0a')},{'name':_0x2825('0x10'),'value':_0x23dee7[_0x2825('0x11')]()['slice'](0x0,0x13)[_0x2825('0x12')]('T','\x20')},{'name':_0x2825('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x571ccb['id']},{'name':_0x2825('0x14'),'value':_0x2825('0x15')},{'name':_0x2825('0x16'),'value':_0x571ccb[_0x2825('0x17')]},{'name':'direction','value':_0x22bd00}];if(_0x53c6c7[_0x2825('0x18')]){_['forEach'](_0x53c6c7,function(_0xdfd2b3){if(_0x363bfe[_0xdfd2b3[_0x2825('0x19')]]){_0x10d356['push']({'name':_0xdfd2b3[_0x2825('0x1a')],'value':_0x363bfe[_0xdfd2b3[_0x2825('0x19')]]});}});}return request({'form':{'method':_0x2825('0x1b'),'input_type':_0x2825('0x1c'),'response_type':_0x2825('0x1c'),'rest_data':JSON[_0x2825('0x1d')]({'session':_0x5afc8a['id'],'module_name':_0x2825('0x1e'),'name_value_list':_0x10d356})}});}function getAuth(_0x2e2ac1){return util[_0x2825('0x1f')](_0x2825('0x20'),new Buffer(_0x2e2ac1[_0x2825('0x21')]+':X')[_0x2825('0x22')]('base64'));}function getServerInfo(_0x1894a5){return request({'form':{'method':_0x2825('0x23'),'input_type':_0x2825('0x1c'),'response_type':_0x2825('0x1c'),'rest_data':JSON[_0x2825('0x1d')]({'session':_0x1894a5['id']})}});}function getUser(_0x2043f4,_0x42630f,_0x56ab31){if(!_[_0x2825('0x24')](_0x42630f)){logger[_0x2825('0xb')](_0x2825('0x25'),_0x42630f);return request({'form':{'method':_0x2825('0x26'),'input_type':_0x2825('0x1c'),'response_type':_0x2825('0x1c'),'rest_data':JSON['stringify']({'session':_0x56ab31['id'],'module_name':_0x2825('0x27'),'query':util[_0x2825('0x1f')](_0x2825('0x28'),_0x42630f),'order_by':'','offset':'0','select_fields':['id',_0x2825('0x17'),_0x2825('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x501890){if(_0x501890[_0x2825('0x2a')][_0x2825('0x18')]){var _0x194f88=_[_0x2825('0x2b')](_0x501890['entry_list'],function(_0x4373f0){return _0x4373f0[_0x2825('0x2c')][_0x2825('0x29')]['value']===_0x42630f;});if(_0x194f88){logger[_0x2825('0xb')](_0x2825('0x2d'));return BPromise[_0x2825('0x2e')]({'id':_0x194f88[_0x2825('0x2c')]['id'][_0x2825('0x2f')],'name':_0x194f88['name_value_list'][_0x2825('0x17')][_0x2825('0x2f')]});}}logger[_0x2825('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x56ab31[_0x2825('0x2c')][_0x2825('0x30')][_0x2825('0x2f')],'name':_0x56ab31[_0x2825('0x2c')][_0x2825('0x29')][_0x2825('0x2f')]});});}else{logger[_0x2825('0xb')](_0x2825('0x31'));return BPromise['resolve']({'id':_0x56ab31[_0x2825('0x2c')][_0x2825('0x30')][_0x2825('0x2f')],'name':_0x56ab31[_0x2825('0x2c')][_0x2825('0x29')][_0x2825('0x2f')]});}}function getEndUser(_0x125ca4,_0x463320,_0x201c75,_0x6c5db5){logger[_0x2825('0xb')](_0x2825('0x32'),_0x201c75);return request({'form':{'method':_0x2825('0x26'),'input_type':_0x2825('0x1c'),'response_type':_0x2825('0x1c'),'rest_data':JSON[_0x2825('0x1d')]({'session':_0x6c5db5['id'],'module_name':_0x2825('0x15'),'query':util[_0x2825('0x1f')](_0x2825('0x33'),_0x201c75),'order_by':'','offset':'0','select_fields':['id',_0x2825('0x17'),_0x2825('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2825('0x35')](function(_0x5a9167){if(_0x5a9167[_0x2825('0x2a')][_0x2825('0x18')]){var _0x4f86b1=_[_0x2825('0x2b')](_0x5a9167[_0x2825('0x2a')],function(_0x43a021){return _0x43a021[_0x2825('0x2c')]['phone_home'][_0x2825('0x2f')]===_0x201c75;});if(_0x4f86b1){logger[_0x2825('0xb')]('Enduser\x20found!');return BPromise[_0x2825('0x2e')]({'id':_0x4f86b1['name_value_list']['id']['value'],'name':_0x4f86b1[_0x2825('0x2c')][_0x2825('0x17')][_0x2825('0x2f')],'phone':_0x4f86b1[_0x2825('0x2c')][_0x2825('0x34')][_0x2825('0x2f')]});}}else{logger[_0x2825('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x2825('0x1b'),'input_type':'JSON','response_type':_0x2825('0x1c'),'rest_data':JSON['stringify']({'session':_0x6c5db5['id'],'module_name':'Contacts','name_value_list':[{'name':_0x2825('0x36'),'value':_0x463320!==_0x2825('0x37')?_0x463320:util[_0x2825('0x1f')](_0x2825('0x38'),_0x201c75)},{'name':_0x2825('0x34'),'value':_0x201c75}]})}})['then'](function(_0x3062a6){logger[_0x2825('0xb')](_0x2825('0x39'));return BPromise['resolve']({'id':_0x3062a6['id'],'name':_0x3062a6[_0x2825('0x2a')][_0x2825('0x36')]['value'],'phone':_0x3062a6[_0x2825('0x2a')][_0x2825('0x34')][_0x2825('0x2f')]});});}});}function request(_0x189cd0){logger[_0x2825('0x3a')](_0x2825('0x3b'),JSON[_0x2825('0x1d')](_0x189cd0));return rp(_[_0x2825('0x3c')](def,_0x189cd0));}function getTags(_0x4d1ad8,_0x2c0642){var _0x16a0ff=[];if(_0x4d1ad8&&_0x4d1ad8['length']>0x0){_0x16a0ff=_['map'](_0x4d1ad8,_0x2c0642);}return _0x16a0ff;}function getCustomFields(_0x5483e,_0x53a8d9){var _0x39373f=[];var _0x551b23={'custom_fields':[]};if(_0x5483e[_0x2825('0x18')]>0x0){_[_0x2825('0x3d')](_0x5483e,function(_0x5fc641){if(_0x5fc641[_0x2825('0x3e')]===_0x2825('0x3f')&&_0x5fc641[_0x2825('0x40')]&&!_0x5fc641['customField']){_0x551b23[_0x5fc641[_0x2825('0x40')][_0x2825('0x41')]()]=_0x5fc641[_0x2825('0x42')][_0x2825('0x22')]();}else if(_0x5fc641[_0x2825('0x3e')]===_0x2825('0x3f')&&_0x5fc641[_0x2825('0x1a')]&&_0x5fc641[_0x2825('0x43')]){_0x551b23[_0x2825('0x44')][_0x2825('0x45')]({'id':_0x5fc641[_0x2825('0x1a')],'value':_0x5fc641['content']['toString']()});}else if(_0x5fc641[_0x2825('0x3e')]===_0x2825('0x46')&&_0x5fc641[_0x2825('0x19')]&&_0x5fc641[_0x2825('0x1a')]&&_0x5fc641[_0x2825('0x43')]){_0x53a8d9[_0x5fc641['variableName']]&&_0x551b23[_0x2825('0x44')][_0x2825('0x45')]({'id':_0x5fc641[_0x2825('0x1a')],'value':_0x53a8d9[_0x5fc641[_0x2825('0x19')]][_0x2825('0x22')]()});}else if(_0x5fc641[_0x2825('0x3e')]==='customVariable'&&_0x5fc641[_0x2825('0x47')]&&_0x5fc641[_0x2825('0x47')][_0x2825('0x17')]&&_0x5fc641[_0x2825('0x1a')]&&_0x5fc641[_0x2825('0x43')]){_0x53a8d9[_0x5fc641[_0x2825('0x47')][_0x2825('0x17')][_0x2825('0x41')]()]&&_0x551b23[_0x2825('0x44')]['push']({'id':_0x5fc641[_0x2825('0x1a')],'value':_0x53a8d9[_0x5fc641['Variable'][_0x2825('0x17')][_0x2825('0x41')]()][_0x2825('0x22')]()});}});}return _0x551b23;}function getConnection(_0x157e9a){return request({'method':_0x2825('0xa'),'form':{'method':_0x2825('0x48'),'input_type':'JSON','response_type':_0x2825('0x1c'),'rest_data':JSON[_0x2825('0x1d')]({'user_auth':{'user_name':_0x157e9a[_0x2825('0x49')],'password':_0x157e9a[_0x2825('0x4a')],'encryption':_0x2825('0x4b')},'application':_0x2825('0x4c')})}})[_0x2825('0x35')](function(_0x9906ec){var _0x24bf43=_0x9906ec;if(_0x24bf43['id']){def[_0x2825('0x4d')]=_0x24bf43['id'];return BPromise[_0x2825('0x2e')](_0x24bf43);}else{throw new Error(util['format'](_0x2825('0x4e'),_0x157e9a['id']));}});}function setRelationship(_0x35cfcb,_0x1b09d9,_0x36e29c,_0x3d98c3){return request({'form':{'method':'set_relationship','input_type':_0x2825('0x1c'),'response_type':_0x2825('0x1c'),'rest_data':JSON[_0x2825('0x1d')]({'session':_0x35cfcb['id'],'module_name':_0x2825('0x1e'),'module_id':_0x36e29c['id'],'link_field_name':_0x3d98c3,'related_ids':[_0x1b09d9['id']]})}});}exports[_0x2825('0x4f')]=function(_0x311093,_0x4d4077,_0x3789a4,_0x5d1282,_0x516ed7,_0x5b0a9b){var _0x52371e,_0xa11b37,_0x48ad80,_0x29431b;_0x5b0a9b[_0x2825('0x50')]=intUtil['stripTrailingSlash'](_0x5b0a9b[_0x2825('0x50')]);_0x5b0a9b[_0x2825('0x51')]=intUtil[_0x2825('0x52')](_0x5b0a9b['serverUrl']);def['uri']=util[_0x2825('0x1f')](_0x2825('0x53'),_0x5b0a9b[_0x2825('0x50')]);if(_0x516ed7&&_0x516ed7[_0x2825('0x54')]){logger[_0x2825('0xb')]('[QUEUE]',_0x2825('0x55'));_0x4d4077[_0x2825('0x56')]=util[_0x2825('0x1f')](_0x2825('0x57'),_0x5b0a9b[_0x2825('0x51')],_0x4d4077[_0x2825('0x58')],md5(_0x4d4077[_0x2825('0x58')]));}else{_0x4d4077[_0x2825('0x56')]='';}return getConnection(_0x5b0a9b)['then'](function(_0x4b31e9){_0x29431b=_0x4b31e9;return getUser(_0x5b0a9b,_0x5d1282['name'],_0x29431b);})['then'](function(_0x4f9743){_0x52371e=_0x4f9743;logger[_0x2825('0xb')](_0x2825('0x59'),_0x52371e['id']);return getEndUser(_0x5b0a9b,_0x4d4077[_0x2825('0x5a')],_0x4d4077['calleridnum'],_0x29431b);})[_0x2825('0x35')](function(_0x336cc6){_0xa11b37=_0x336cc6;logger['info'](_0x2825('0x5b'),_0xa11b37['id']);return getTicket(_0x5b0a9b,_0x52371e,_0xa11b37,_0x3789a4,_0x4d4077,_0x3789a4['Fields'],_0x29431b,_0x2825('0x5c'));})['then'](function(_0x3778d4){_0x48ad80=_0x3778d4;logger['info']('Ticket\x20created!');logger[_0x2825('0xb')](_0x2825('0x5d'),_0x48ad80['id']);return setRelationship(_0x29431b,_0x52371e,_0x48ad80,_0x2825('0x5e'));})[_0x2825('0x35')](function(){return setRelationship(_0x29431b,_0xa11b37,_0x48ad80,_0x2825('0x5f'));})[_0x2825('0x35')](function(){return getServerInfo(_0x29431b);})['then'](function(_0x29e6c8){var _0xdb3792=parseInt(_0x29e6c8[_0x2825('0x60')][_0x2825('0x61')](0x0));var _0x47af80=util[_0x2825('0x1f')](_0x2825('0x62'),_0x5b0a9b[_0x2825('0x50')],_0x48ad80['id']);if(_0xdb3792>0x6){_0x47af80=util['format'](_0x2825('0x63'),_0x5b0a9b[_0x2825('0x50')],_0x48ad80['id']);}logger[_0x2825('0xb')]('[QUEUE]',_0x2825('0x64'));emit(util['format'](_0x2825('0x65'),_0x5d1282[_0x2825('0x17')]),'trigger:browser:url',{'uri':_0x47af80});})[_0x2825('0x66')](function(_0x293149){logger[_0x2825('0x67')](_0x2825('0x68'),JSON[_0x2825('0x1d')](_0x293149));});};exports[_0x2825('0x69')]=function(_0x1b5ebf,_0x118ff4,_0x56d905,_0x4a8895,_0x4effee,_0x34f1d9,_0x4d213b){var _0x29e56,_0x2d07ad,_0x9f4c97,_0x11f716;_0x34f1d9[_0x2825('0x50')]=intUtil[_0x2825('0x52')](_0x34f1d9['remoteUri']);_0x34f1d9[_0x2825('0x51')]=intUtil[_0x2825('0x52')](_0x34f1d9['serverUrl']);def['uri']=util[_0x2825('0x1f')](_0x2825('0x53'),_0x34f1d9[_0x2825('0x50')]);if(_0x4d213b&&_0x4d213b[_0x2825('0x6a')]&&_0x4d213b[_0x2825('0x6a')]!==_0x2825('0x6b')){logger[_0x2825('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x118ff4[_0x2825('0x56')]=util[_0x2825('0x1f')](_0x2825('0x57'),_0x34f1d9[_0x2825('0x51')],_0x118ff4[_0x2825('0x58')],md5(_0x118ff4[_0x2825('0x58')]));}return getConnection(_0x34f1d9)[_0x2825('0x35')](function(_0x52d26c){_0x11f716=_0x52d26c;return getUser(_0x34f1d9,_0x4a8895[_0x2825('0x17')],_0x11f716);})[_0x2825('0x35')](function(_0x5d6fbe){_0x29e56=_0x5d6fbe;logger[_0x2825('0xb')]('The\x20User\x20ID\x20is:',_0x29e56['id']);return getEndUser(_0x34f1d9,_0x118ff4[_0x2825('0x6c')],_0x118ff4[_0x2825('0x6d')],_0x11f716);})[_0x2825('0x35')](function(_0x213258){_0x2d07ad=_0x213258;logger[_0x2825('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2d07ad['id']);return getTicket(_0x34f1d9,_0x29e56,_0x2d07ad,_0x56d905,_0x118ff4,_0x56d905['Fields'],_0x11f716,_0x2825('0x6e'));})[_0x2825('0x35')](function(_0x43a782){_0x9f4c97=_0x43a782;logger['info']('Ticket\x20created!');logger[_0x2825('0xb')](_0x2825('0x5d'),_0x9f4c97['id']);return setRelationship(_0x11f716,_0x29e56,_0x9f4c97,_0x2825('0x5e'));})[_0x2825('0x35')](function(){return setRelationship(_0x11f716,_0x2d07ad,_0x9f4c97,_0x2825('0x5f'));})[_0x2825('0x35')](function(){return getServerInfo(_0x11f716);})[_0x2825('0x35')](function(_0xec062f){var _0x586c78=parseInt(_0xec062f[_0x2825('0x60')][_0x2825('0x61')](0x0));var _0x339551=util[_0x2825('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x34f1d9[_0x2825('0x50')],_0x9f4c97['id']);if(_0x586c78>0x6){_0x339551=util[_0x2825('0x1f')](_0x2825('0x63'),_0x34f1d9['remoteUri'],_0x9f4c97['id']);}logger[_0x2825('0xb')](_0x2825('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2825('0x1f')](_0x2825('0x65'),_0x4a8895[_0x2825('0x17')]),_0x2825('0x70'),{'uri':_0x339551});})[_0x2825('0x66')](function(_0x1e378f){logger[_0x2825('0x67')]('[OUTBOUND]',JSON['stringify'](_0x1e378f));});};exports[_0x2825('0x71')]=function(_0x18ba65,_0x2ab5fa,_0x51ae4a,_0x9ef5a4,_0x2aeb7f,_0x25a871){var _0x46ba51,_0x5c437d,_0x1619e8,_0x262074;_0x25a871[_0x2825('0x50')]=intUtil['stripTrailingSlash'](_0x25a871[_0x2825('0x50')]);_0x25a871[_0x2825('0x51')]=intUtil[_0x2825('0x52')](_0x25a871['serverUrl']);def[_0x2825('0x72')]=util[_0x2825('0x1f')](_0x2825('0x53'),_0x25a871[_0x2825('0x50')]);if(_0x2aeb7f&&_0x2aeb7f[_0x2825('0x54')]){logger[_0x2825('0xb')](_0x2825('0x73'),_0x2825('0x55'));_0x2ab5fa[_0x2825('0x56')]=util[_0x2825('0x1f')](_0x2825('0x57'),_0x25a871[_0x2825('0x51')],_0x2ab5fa[_0x2825('0x58')],md5(_0x2ab5fa[_0x2825('0x58')]));}else{_0x2ab5fa[_0x2825('0x56')]='';}return getConnection(_0x25a871)['then'](function(_0x4ceed9){_0x262074=_0x4ceed9;if(!_['isNil'](_0x9ef5a4)){return getUser(_0x25a871,_0x9ef5a4[_0x2825('0x17')],_0x262074);}else{return getUser(_0x25a871,null,_0x262074);}})['then'](function(_0x4a213c){_0x46ba51=_0x4a213c;logger[_0x2825('0xb')](_0x2825('0x59'),_0x46ba51['id']);return getEndUser(_0x25a871,_0x2ab5fa[_0x2825('0x5a')],_0x2ab5fa[_0x2825('0x74')],_0x262074);})[_0x2825('0x35')](function(_0x430e9f){_0x5c437d=_0x430e9f;logger[_0x2825('0xb')](_0x2825('0x5b'),_0x5c437d['id']);return getTicket(_0x25a871,_0x46ba51,_0x5c437d,_0x51ae4a,_0x2ab5fa,_0x51ae4a[_0x2825('0x75')],_0x262074,_0x2825('0x5c'));})['then'](function(_0x59ed18){_0x1619e8=_0x59ed18;logger[_0x2825('0xb')](_0x2825('0x76'));logger[_0x2825('0xb')](_0x2825('0x5d'),_0x1619e8['id']);return setRelationship(_0x262074,_0x46ba51,_0x1619e8,_0x2825('0x5e'));})[_0x2825('0x35')](function(){return setRelationship(_0x262074,_0x5c437d,_0x1619e8,_0x2825('0x5f'));})[_0x2825('0x35')](function(){return getServerInfo(_0x262074);})[_0x2825('0x66')](function(_0x1f3a48){logger[_0x2825('0x67')]('[ABANDONED]',JSON['stringify'](_0x1f3a48));});}; \ 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 cb12a07..c3cdd9e 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 _0xe0c5=['toString','Variable','name','keyValue','keyType','format','key','keyContent','%s:\x20%s','customVariable','toLowerCase','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','sortBy','length','type','string','push','content','variableName'];(function(_0x54ed92,_0x56a6b5){var _0x36b4cc=function(_0x75d492){while(--_0x75d492){_0x54ed92['push'](_0x54ed92['shift']());}};_0x36b4cc(++_0x56a6b5);}(_0xe0c5,0x14a));var _0x5e0c=function(_0x46bcd8,_0x3c8506){_0x46bcd8=_0x46bcd8-0x0;var _0x204c9e=_0xe0c5[_0x46bcd8];return _0x204c9e;};'use strict';var _=require(_0x5e0c('0x0'));var util=require('util');exports['getString']=function(_0x4e29c4,_0x39da3d,_0xac814a){var _0x18b81b=[];if(_0x4e29c4['length']>0x0){var _0x203ed6=_[_0x5e0c('0x1')](_0x4e29c4,['id']);for(var _0x502f7d=0x0;_0x502f7d<_0x203ed6[_0x5e0c('0x2')];_0x502f7d++){var _0x520538=_0x203ed6[_0x502f7d];if(_0x520538[_0x5e0c('0x3')]===_0x5e0c('0x4')){_0x18b81b[_0x5e0c('0x5')](_0x520538[_0x5e0c('0x6')]);}else if(_0x520538[_0x5e0c('0x3')]==='variable'&&_0x520538['variableName']){_0x39da3d[_0x520538['variableName']]&&_0x18b81b['push'](_0x39da3d[_0x520538[_0x5e0c('0x7')]][_0x5e0c('0x8')]());}else if(_0x520538['type']==='customVariable'&&_0x520538[_0x5e0c('0x9')]&&_0x520538['Variable']['name']){_0x39da3d[_0x520538[_0x5e0c('0x9')][_0x5e0c('0xa')]['toLowerCase']()]&&_0x18b81b[_0x5e0c('0x5')](_0x39da3d[_0x520538[_0x5e0c('0x9')][_0x5e0c('0xa')]['toLowerCase']()][_0x5e0c('0x8')]());}else if(_0x520538[_0x5e0c('0x3')]===_0x5e0c('0xb')){if(_0x520538[_0x5e0c('0xc')]===_0x5e0c('0x4')&&_0x520538['key']){_0x18b81b[_0x5e0c('0x5')](util[_0x5e0c('0xd')]('%s:\x20%s',_0x520538[_0x5e0c('0xe')],_0x520538[_0x5e0c('0xf')]));}else if(_0x520538[_0x5e0c('0xc')]==='variable'&&_0x520538[_0x5e0c('0x7')]&&_0x520538[_0x5e0c('0xe')]){_0x39da3d[_0x520538[_0x5e0c('0x7')]]&&_0x18b81b[_0x5e0c('0x5')](util[_0x5e0c('0xd')](_0x5e0c('0x10'),_0x520538[_0x5e0c('0xe')],_0x39da3d[_0x520538[_0x5e0c('0x7')]]));}else if(_0x520538[_0x5e0c('0xc')]===_0x5e0c('0x11')&&_0x520538['Variable']&&_0x520538[_0x5e0c('0x9')][_0x5e0c('0xa')]&&_0x520538[_0x5e0c('0xe')]){_0x39da3d[_0x520538[_0x5e0c('0x9')][_0x5e0c('0xa')][_0x5e0c('0x12')]()]&&_0x18b81b['push'](util['format'](_0x5e0c('0x10'),_0x520538[_0x5e0c('0xe')],_0x39da3d[_0x520538[_0x5e0c('0x9')][_0x5e0c('0xa')]['toLowerCase']()]));}}}}return _0x18b81b[_0x5e0c('0x13')](_0xac814a);};exports['stripTrailingSlash']=function(_0x2c158d){var _0x38dbf7=_0x2c158d[_0x5e0c('0x14')](-0x1);if(_0x38dbf7==='/'){_0x2c158d=_0x2c158d[_0x5e0c('0x15')](0x0,_0x2c158d[_0x5e0c('0x16')](_0x38dbf7));}return _0x2c158d;};exports[_0x5e0c('0x17')]=function(_0x3a8823){if(!_[_0x5e0c('0x18')](_0x3a8823)&&_0x3a8823!==''){var _0x31ce85=/^(([^<>()\[\]\\.,;:\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 _0x31ce85[_0x5e0c('0x19')](String(_0x3a8823)[_0x5e0c('0x12')]());}else{return![];}}; \ No newline at end of file +var _0x67bb=['validateEmail','isNil','test','lodash','util','length','sortBy','string','push','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyType','format','%s:\x20%s','key','join','stripTrailingSlash','substring','lastIndexOf'];(function(_0x20b4da,_0x53aea0){var _0x1f2982=function(_0x3bcf99){while(--_0x3bcf99){_0x20b4da['push'](_0x20b4da['shift']());}};_0x1f2982(++_0x53aea0);}(_0x67bb,0x189));var _0xb67b=function(_0x1e09b7,_0x3b7f6f){_0x1e09b7=_0x1e09b7-0x0;var _0x480c35=_0x67bb[_0x1e09b7];return _0x480c35;};'use strict';var _=require(_0xb67b('0x0'));var util=require(_0xb67b('0x1'));exports['getString']=function(_0x2a17c9,_0x51397d,_0x173f8f){var _0x515a92=[];if(_0x2a17c9[_0xb67b('0x2')]>0x0){var _0x27ae0b=_[_0xb67b('0x3')](_0x2a17c9,['id']);for(var _0xb8052a=0x0;_0xb8052a<_0x27ae0b['length'];_0xb8052a++){var _0x187be8=_0x27ae0b[_0xb8052a];if(_0x187be8['type']===_0xb67b('0x4')){_0x515a92[_0xb67b('0x5')](_0x187be8[_0xb67b('0x6')]);}else if(_0x187be8['type']===_0xb67b('0x7')&&_0x187be8[_0xb67b('0x8')]){_0x51397d[_0x187be8['variableName']]&&_0x515a92['push'](_0x51397d[_0x187be8[_0xb67b('0x8')]][_0xb67b('0x9')]());}else if(_0x187be8[_0xb67b('0xa')]===_0xb67b('0xb')&&_0x187be8['Variable']&&_0x187be8[_0xb67b('0xc')][_0xb67b('0xd')]){_0x51397d[_0x187be8[_0xb67b('0xc')]['name'][_0xb67b('0xe')]()]&&_0x515a92[_0xb67b('0x5')](_0x51397d[_0x187be8['Variable']['name'][_0xb67b('0xe')]()][_0xb67b('0x9')]());}else if(_0x187be8[_0xb67b('0xa')]==='keyValue'){if(_0x187be8[_0xb67b('0xf')]==='string'&&_0x187be8['key']){_0x515a92[_0xb67b('0x5')](util[_0xb67b('0x10')](_0xb67b('0x11'),_0x187be8['key'],_0x187be8['keyContent']));}else if(_0x187be8[_0xb67b('0xf')]==='variable'&&_0x187be8[_0xb67b('0x8')]&&_0x187be8[_0xb67b('0x12')]){_0x51397d[_0x187be8[_0xb67b('0x8')]]&&_0x515a92['push'](util[_0xb67b('0x10')](_0xb67b('0x11'),_0x187be8[_0xb67b('0x12')],_0x51397d[_0x187be8['variableName']]));}else if(_0x187be8[_0xb67b('0xf')]===_0xb67b('0xb')&&_0x187be8[_0xb67b('0xc')]&&_0x187be8[_0xb67b('0xc')][_0xb67b('0xd')]&&_0x187be8[_0xb67b('0x12')]){_0x51397d[_0x187be8['Variable'][_0xb67b('0xd')][_0xb67b('0xe')]()]&&_0x515a92[_0xb67b('0x5')](util[_0xb67b('0x10')](_0xb67b('0x11'),_0x187be8[_0xb67b('0x12')],_0x51397d[_0x187be8[_0xb67b('0xc')]['name'][_0xb67b('0xe')]()]));}}}}return _0x515a92[_0xb67b('0x13')](_0x173f8f);};exports[_0xb67b('0x14')]=function(_0x30f2a9){var _0x1991f5=_0x30f2a9['slice'](-0x1);if(_0x1991f5==='/'){_0x30f2a9=_0x30f2a9[_0xb67b('0x15')](0x0,_0x30f2a9[_0xb67b('0x16')](_0x1991f5));}return _0x30f2a9;};exports[_0xb67b('0x17')]=function(_0x13e1f8){if(!_[_0xb67b('0x18')](_0x13e1f8)&&_0x13e1f8!==''){var _0xb3f82c=/^(([^<>()\[\]\\.,;:\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 _0xb3f82c[_0xb67b('0x19')](String(_0x13e1f8)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index b09225f..c5dd1a2 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 _0x4065=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','%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','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','abandoned','monitor_format','[ABANDONED]','md5','ioredis','./util','../../../../config/environment','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','merge','Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','create','sessionName','HelpDesk','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','username','Searching\x20end\x20user\x20with\x20phone','Enduser\x20found!','firstname','lastname','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue'];(function(_0x431fe1,_0x5c9bdb){var _0x22dd18=function(_0xaa6d57){while(--_0xaa6d57){_0x431fe1['push'](_0x431fe1['shift']());}};_0x22dd18(++_0x5c9bdb);}(_0x4065,0xdc));var _0x5406=function(_0x265a2e,_0x301dca){_0x265a2e=_0x265a2e-0x0;var _0x38bb0a=_0x4065[_0x265a2e];return _0x38bb0a;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x5406('0x0'));var util=require('util');var Redis=require(_0x5406('0x1'));var intUtil=require(_0x5406('0x2'));var config=require(_0x5406('0x3'));var logger=require('../../../../config/logger')(_0x5406('0x4'));config[_0x5406('0x5')]=_['defaults'](config[_0x5406('0x5')],{'host':_0x5406('0x6'),'port':0x18eb});var io=require(_0x5406('0x7'))(new Redis(config[_0x5406('0x5')]));function emit(_0x44f868,_0x3acd44,_0x4aae49){io['to'](_0x44f868)[_0x5406('0x8')](_0x3acd44,_0x4aae49);}function getCustomFields(_0x2aadf4,_0xd9e9d7){var _0x266399={};if(_0x2aadf4[_0x5406('0x9')]>0x0){_[_0x5406('0xa')](_0x2aadf4,function(_0x49398f){if(_0x49398f[_0x5406('0xb')]===_0x5406('0xc')&&_0x49398f[_0x5406('0xd')]){_0x266399[_0x49398f[_0x5406('0xd')]]=_0x49398f[_0x5406('0xe')][_0x5406('0xf')]();}else if(_0x49398f['type']===_0x5406('0x10')&&_0x49398f[_0x5406('0x11')]&&_0x49398f['idField']&&_0xd9e9d7[_0x49398f[_0x5406('0x11')]]){_0x266399[_0x49398f[_0x5406('0xd')]]=_0xd9e9d7[_0x49398f[_0x5406('0x11')]][_0x5406('0xf')]();}else if(_0x49398f[_0x5406('0xb')]===_0x5406('0x12')&&_0x49398f[_0x5406('0x13')]&&_0x49398f[_0x5406('0x13')][_0x5406('0x14')]&&_0x49398f['idField']&&_0xd9e9d7[_0x49398f[_0x5406('0x13')][_0x5406('0x14')][_0x5406('0x15')]()]){_0x266399[_0x49398f[_0x5406('0xd')]]=_0xd9e9d7[_0x49398f['Variable'][_0x5406('0x14')][_0x5406('0x15')]()][_0x5406('0xf')]();}});}return _0x266399;}function createTicket(_0x22f6ba,_0x5cb4c3,_0x1fee92,_0x233eb0,_0x1355a1,_0x5119ae,_0x453ee5){logger[_0x5406('0x16')]('Creating\x20new\x20ticket...');var _0x12abf3=_[_0x5406('0x17')]({'parent_id':'','assigned_user_id':_0x5cb4c3['id'],'ticketpriorities':_0x5406('0x18'),'ticketstatus':'Open','ticket_title':intUtil[_0x5406('0x19')](_0x233eb0[_0x5406('0x1a')],_0x1355a1,'\x20'),'description':intUtil[_0x5406('0x19')](_0x233eb0[_0x5406('0x1b')],_0x1355a1,'\x0a'),'contact_id':_0x1fee92['id']},getCustomFields(_0x5119ae,_0x1355a1));var _0x41f681={'method':_0x5406('0x1c'),'uri':util[_0x5406('0x1d')](_0x5406('0x1e'),_0x22f6ba['remoteUri']),'form':{'operation':_0x5406('0x1f'),'username':'admin','sessionName':_0x453ee5[_0x5406('0x20')],'elementType':_0x5406('0x21'),'element':JSON['stringify'](_0x12abf3)},'json':!![]};return request(_0x41f681)[_0x5406('0x22')](function(_0x371438){if(_0x371438[_0x5406('0x23')]){return BPromise[_0x5406('0x24')]({'id':_0x371438[_0x5406('0x25')]['id']});}else{throw new Error(util[_0x5406('0x1d')](_0x5406('0x26'),JSON[_0x5406('0x27')](_0x371438['error'])));}})[_0x5406('0x28')](function(_0x13796c){var _0xfba3e7=_0x13796c[_0x5406('0x29')]||0x1f4;logger[_0x5406('0x2a')](_0x5406('0x2b'),_0x5406('0x2c'),_0xfba3e7,JSON[_0x5406('0x27')](_0x13796c));});}function getUser(_0x52822a,_0x3088a1,_0x49a7a5){if(intUtil[_0x5406('0x2d')](_0x3088a1)){logger['info'](_0x5406('0x2e'),_0x3088a1);return request({'method':_0x5406('0x2f'),'uri':util[_0x5406('0x1d')](_0x5406('0x1e'),_0x52822a[_0x5406('0x30')]),'qs':{'operation':_0x5406('0x31'),'username':_0x5406('0x32'),'sessionName':_0x49a7a5[_0x5406('0x20')],'query':util['format'](_0x5406('0x33'),_0x3088a1)},'json':!![]})[_0x5406('0x22')](function(_0x2e9ab9){if(_0x2e9ab9['success']&&_0x2e9ab9[_0x5406('0x25')][_0x5406('0x9')]){logger['info']('Agent\x20found!');return BPromise[_0x5406('0x24')]({'id':_0x2e9ab9[_0x5406('0x25')][0x0]['id'],'email':_0x2e9ab9[_0x5406('0x25')][0x0][_0x5406('0x34')],'name':_0x2e9ab9[_0x5406('0x25')][0x0]['first_name']+'\x20'+_0x2e9ab9['result']['last_name']});}else{logger[_0x5406('0x16')](_0x5406('0x35'));return BPromise[_0x5406('0x24')]({'id':_0x49a7a5[_0x5406('0x36')],'email':_0x52822a['username'],'name':_0x5406('0x32')});}})[_0x5406('0x28')](function(_0x547123){var _0x3714ab=_0x547123[_0x5406('0x29')]||0x1f4;logger[_0x5406('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x5406('0x37'),_0x3714ab,JSON[_0x5406('0x27')](_0x547123));});}else{logger[_0x5406('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x49a7a5['userId'],'email':_0x52822a[_0x5406('0x38')],'name':'admin'})['catch'](function(_0x15f571){var _0x34f2da=_0x15f571[_0x5406('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x34f2da,JSON[_0x5406('0x27')](_0x15f571));});}}function getEndUser(_0x134284,_0xb5d049,_0x3ac9ae,_0x568602){logger['info'](_0x5406('0x39'),_0x3ac9ae);return request({'method':_0x5406('0x2f'),'uri':util[_0x5406('0x1d')]('%s/webservice.php',_0x134284['remoteUri']),'qs':{'operation':_0x5406('0x31'),'username':'admin','sessionName':_0x568602[_0x5406('0x20')],'query':util[_0x5406('0x1d')]('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;',_0x3ac9ae,_0x3ac9ae,_0x3ac9ae,_0x3ac9ae,_0x3ac9ae)},'json':!![]})[_0x5406('0x22')](function(_0x395bbc){if(_0x395bbc[_0x5406('0x23')]&&_0x395bbc[_0x5406('0x25')][_0x5406('0x9')]){logger['info'](_0x5406('0x3a'));return BPromise[_0x5406('0x24')]({'id':_0x395bbc[_0x5406('0x25')][0x0]['id'],'name':_0x395bbc[_0x5406('0x25')][0x0][_0x5406('0x3b')]+'\x20'+_0x395bbc[_0x5406('0x25')][0x0][_0x5406('0x3c')],'phone':_0x3ac9ae});}else{logger[_0x5406('0x16')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x5406('0x1c'),'uri':util[_0x5406('0x1d')](_0x5406('0x1e'),_0x134284[_0x5406('0x30')]),'form':{'operation':_0x5406('0x1f'),'sessionName':_0x568602['sessionName'],'elementType':_0x5406('0x3d'),'element':JSON['stringify']({'lastname':_0xb5d049,'phone':_0x3ac9ae,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x56852c){logger['info'](_0x5406('0x3e'));return BPromise[_0x5406('0x24')]({'id':_0x56852c[_0x5406('0x25')]['id'],'name':_0x56852c['result']['lastname'],'phone':_0x56852c[_0x5406('0x25')][_0x5406('0x3f')]});})[_0x5406('0x28')](function(_0x241421){var _0x3e9c04=_0x241421[_0x5406('0x29')]||0x1f4;logger[_0x5406('0x2a')](_0x5406('0x2b'),_0x5406('0x40'),_0x3e9c04,JSON[_0x5406('0x27')](_0x241421));});}});}function getConnection(_0x18dfea){var _0x2dfff2=_0x18dfea[_0x5406('0x38')];var _0x24bcf0=_0x18dfea[_0x5406('0x41')];return request({'method':'GET','uri':util[_0x5406('0x1d')]('%s/webservice.php',_0x18dfea[_0x5406('0x30')]),'qs':{'operation':_0x5406('0x42'),'username':_0x2dfff2},'json':!![]})['then'](function(_0x554e2e){if(_0x554e2e[_0x5406('0x23')]){return request({'method':_0x5406('0x1c'),'uri':util[_0x5406('0x1d')](_0x5406('0x1e'),_0x18dfea[_0x5406('0x30')]),'form':{'operation':'login','username':_0x5406('0x32'),'accessKey':md5(_0x554e2e[_0x5406('0x25')][_0x5406('0x43')]+_0x24bcf0)},'json':!![]});}})['then'](function(_0x3725e8){if(_0x3725e8[_0x5406('0x23')]){return BPromise[_0x5406('0x24')](_0x3725e8[_0x5406('0x25')]);}else{throw new Error(util['format'](_0x5406('0x44'),_0x18dfea['id']));}})[_0x5406('0x28')](function(_0x4009a2){var _0x54f6d3=_0x4009a2[_0x5406('0x29')]||0x1f4;logger['error'](_0x5406('0x2b'),'getConnection',_0x54f6d3,JSON[_0x5406('0x27')](_0x4009a2));});}function request(_0x525aeb){logger[_0x5406('0x16')](_0x5406('0x45'),JSON[_0x5406('0x27')](_0x525aeb));return rp(_0x525aeb);}exports[_0x5406('0x46')]=function(_0x463070,_0x2220b0,_0x15e955,_0x27d029,_0x2559c1,_0x457eee){var _0x26da2d,_0x227510,_0x882386,_0x45a1ce;_0x457eee[_0x5406('0x30')]=intUtil['stripTrailingSlash'](_0x457eee[_0x5406('0x30')]);if(_0x2559c1&&_0x2559c1['monitor_format']){logger[_0x5406('0x16')](_0x5406('0x47'),_0x5406('0x48'));_0x2220b0[_0x5406('0x49')]=util['format'](_0x5406('0x4a'),_0x457eee[_0x5406('0x4b')],_0x2220b0[_0x5406('0x4c')],md5(_0x2220b0[_0x5406('0x4c')]));}else{_0x2220b0[_0x5406('0x49')]='';}return getConnection(_0x457eee)[_0x5406('0x22')](function(_0x484750){_0x45a1ce=_0x484750;return getUser(_0x457eee,_0x27d029[_0x5406('0x4d')],_0x45a1ce);})[_0x5406('0x22')](function(_0x638d5f){_0x26da2d=_0x638d5f;logger[_0x5406('0x16')](_0x5406('0x4e'),_0x26da2d['id']);return getEndUser(_0x457eee,_0x2220b0[_0x5406('0x4f')],_0x2220b0[_0x5406('0x50')],_0x45a1ce);})['then'](function(_0x4702f4){_0x227510=_0x4702f4;logger[_0x5406('0x16')](_0x5406('0x51'),_0x227510['id']);return createTicket(_0x457eee,_0x26da2d,_0x227510,_0x15e955,_0x2220b0,_0x15e955[_0x5406('0x52')],_0x45a1ce);})[_0x5406('0x22')](function(_0x31f0cd){_0x882386=_0x31f0cd;logger[_0x5406('0x16')]('Ticket\x20created!');logger[_0x5406('0x16')]('The\x20Ticket\x20ID\x20is:',_0x882386['id']);var _0x41b191=util[_0x5406('0x1d')](_0x5406('0x53'),_0x457eee['remoteUri'],_[_0x5406('0x54')](_0x882386['id'],'x')[0x1]);logger[_0x5406('0x16')](_0x5406('0x47'),_0x5406('0x55'));emit(util[_0x5406('0x1d')](_0x5406('0x56'),_0x27d029['name']),_0x5406('0x57'),{'uri':_0x41b191});})[_0x5406('0x28')](function(_0x22191d){logger[_0x5406('0x2a')](_0x5406('0x47'),JSON['stringify'](_0x22191d));});};exports['outbound']=function(_0x31dc95,_0x2f16f3,_0x520b13,_0x4f6136,_0x7c05f3,_0x3940df,_0x30dc4c){var _0x2cf008,_0x1b4ce8,_0xbc89e2,_0x3069b7;_0x3940df['remoteUri']=intUtil[_0x5406('0x58')](_0x3940df[_0x5406('0x30')]);_0x3940df[_0x5406('0x4b')]=intUtil['stripTrailingSlash'](_0x3940df['serverUrl']);if(_0x30dc4c&&_0x30dc4c[_0x5406('0x59')]&&_0x30dc4c[_0x5406('0x59')]!==_0x5406('0x5a')){logger['info'](_0x5406('0x5b'),'Recording\x20is\x20enabled!');_0x2f16f3[_0x5406('0x49')]=util['format'](_0x5406('0x4a'),_0x3940df[_0x5406('0x4b')],_0x2f16f3['uniqueid'],md5(_0x2f16f3[_0x5406('0x4c')]));}return getConnection(_0x3940df)['then'](function(_0x4999a0){_0x3069b7=_0x4999a0;return getUser(_0x3940df,_0x4f6136[_0x5406('0x4d')],_0x3069b7);})[_0x5406('0x22')](function(_0x4d8553){_0x2cf008=_0x4d8553;logger[_0x5406('0x16')]('The\x20User\x20ID\x20is:',_0x2cf008['id']);return getEndUser(_0x3940df,_0x2f16f3['destcalleridname'],_0x2f16f3['destcalleridnum'],_0x3069b7);})['then'](function(_0x2dd3f1){_0x1b4ce8=_0x2dd3f1;logger[_0x5406('0x16')](_0x5406('0x51'),_0x1b4ce8['id']);return createTicket(_0x3940df,_0x2cf008,_0x1b4ce8,_0x520b13,_0x2f16f3,_0x520b13[_0x5406('0x52')],_0x3069b7);})[_0x5406('0x22')](function(_0x30d0ea){_0xbc89e2=_0x30d0ea;logger['info'](_0x5406('0x5c'));logger[_0x5406('0x16')](_0x5406('0x5d'),_0xbc89e2['id']);var _0x40bbbb=util[_0x5406('0x1d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3940df[_0x5406('0x30')],_['split'](_0xbc89e2['id'],'x')[0x1]);logger['info'](_0x5406('0x5b'),_0x5406('0x55'));emit(util[_0x5406('0x1d')]('user:%s',_0x4f6136[_0x5406('0x14')]),_0x5406('0x57'),{'uri':_0x40bbbb});})[_0x5406('0x28')](function(_0x4267db){logger['error']('[OUTBOUND]',JSON[_0x5406('0x27')](_0x4267db));});};exports[_0x5406('0x5e')]=function(_0x379581,_0x39e206,_0x751cf4,_0x3a85f5,_0x41755f,_0x479777){var _0x1c52ef,_0x39b99c,_0x1bd021,_0x1929c5;_0x479777[_0x5406('0x30')]=intUtil['stripTrailingSlash'](_0x479777[_0x5406('0x30')]);_0x479777[_0x5406('0x4b')]=intUtil[_0x5406('0x58')](_0x479777[_0x5406('0x4b')]);if(_0x41755f&&_0x41755f[_0x5406('0x5f')]){logger['info']('[ABANDONED]',_0x5406('0x48'));_0x39e206[_0x5406('0x49')]=util['format'](_0x5406('0x4a'),_0x479777[_0x5406('0x4b')],_0x39e206[_0x5406('0x4c')],md5(_0x39e206[_0x5406('0x4c')]));}else{_0x39e206[_0x5406('0x49')]='';}return getConnection(_0x479777)[_0x5406('0x22')](function(_0x275fa8){_0x1929c5=_0x275fa8;return getUser(_0x479777,'',_0x1929c5);})[_0x5406('0x22')](function(_0x146b7e){_0x1c52ef=_0x146b7e;logger[_0x5406('0x16')](_0x5406('0x4e'),_0x1c52ef['id']);return getEndUser(_0x479777,_0x39e206[_0x5406('0x4f')],_0x39e206[_0x5406('0x50')],_0x1929c5);})[_0x5406('0x22')](function(_0x15717e){_0x39b99c=_0x15717e;logger[_0x5406('0x16')](_0x5406('0x51'),_0x39b99c['id']);return createTicket(_0x479777,_0x1c52ef,_0x39b99c,_0x751cf4,_0x39e206,_0x751cf4[_0x5406('0x52')],_0x1929c5);})[_0x5406('0x22')](function(_0x246709){_0x1bd021=_0x246709;logger['info'](_0x5406('0x5c'));logger['info'](_0x5406('0x5d'),_0x1bd021['id']);})[_0x5406('0x28')](function(_0x31a2c8){logger['error'](_0x5406('0x60'),JSON['stringify'](_0x31a2c8));});}; \ No newline at end of file +var _0xfc1e=['merge','Open','Subjects','getString','POST','format','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','then','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','Getting\x20agent\x20with\x20email','GET','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Contacts','Enduser\x20created.','getEndUser','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','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','outbound','recordingFormat','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','[OUTBOUND]','trigger:browser:url','abandoned','calleridnum','[ABANDONED]','md5','util','ioredis','./util','../../../../config/environment','vTiger','redis','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info'];(function(_0x58032e,_0x170a52){var _0x1bd8b4=function(_0x81ce5){while(--_0x81ce5){_0x58032e['push'](_0x58032e['shift']());}};_0x1bd8b4(++_0x170a52);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xfc1e[_0x52f1e6];return _0x21f104;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xefc1('0x0'));var util=require(_0xefc1('0x1'));var Redis=require(_0xefc1('0x2'));var intUtil=require(_0xefc1('0x3'));var config=require(_0xefc1('0x4'));var logger=require('../../../../config/logger')(_0xefc1('0x5'));config[_0xefc1('0x6')]=_['defaults'](config['redis'],{'host':_0xefc1('0x7'),'port':0x18eb});var io=require(_0xefc1('0x8'))(new Redis(config[_0xefc1('0x6')]));function emit(_0x3ff4a7,_0x45bec4,_0x77f637){io['to'](_0x3ff4a7)[_0xefc1('0x9')](_0x45bec4,_0x77f637);}function getCustomFields(_0x428b19,_0x244927){var _0x165326={};if(_0x428b19[_0xefc1('0xa')]>0x0){_['forEach'](_0x428b19,function(_0x3759d2){if(_0x3759d2[_0xefc1('0xb')]===_0xefc1('0xc')&&_0x3759d2[_0xefc1('0xd')]){_0x165326[_0x3759d2[_0xefc1('0xd')]]=_0x3759d2[_0xefc1('0xe')][_0xefc1('0xf')]();}else if(_0x3759d2[_0xefc1('0xb')]===_0xefc1('0x10')&&_0x3759d2[_0xefc1('0x11')]&&_0x3759d2[_0xefc1('0xd')]&&_0x244927[_0x3759d2['variableName']]){_0x165326[_0x3759d2[_0xefc1('0xd')]]=_0x244927[_0x3759d2[_0xefc1('0x11')]][_0xefc1('0xf')]();}else if(_0x3759d2[_0xefc1('0xb')]===_0xefc1('0x12')&&_0x3759d2[_0xefc1('0x13')]&&_0x3759d2[_0xefc1('0x13')][_0xefc1('0x14')]&&_0x3759d2['idField']&&_0x244927[_0x3759d2[_0xefc1('0x13')][_0xefc1('0x14')][_0xefc1('0x15')]()]){_0x165326[_0x3759d2['idField']]=_0x244927[_0x3759d2[_0xefc1('0x13')][_0xefc1('0x14')][_0xefc1('0x15')]()][_0xefc1('0xf')]();}});}return _0x165326;}function createTicket(_0x257914,_0x38923c,_0x3b5a6e,_0x126052,_0x5da8b0,_0x371a04,_0x1aaaa0){logger[_0xefc1('0x16')]('Creating\x20new\x20ticket...');var _0x577315=_[_0xefc1('0x17')]({'parent_id':'','assigned_user_id':_0x38923c['id'],'ticketpriorities':'Normal','ticketstatus':_0xefc1('0x18'),'ticket_title':intUtil['getString'](_0x126052[_0xefc1('0x19')],_0x5da8b0,'\x20'),'description':intUtil[_0xefc1('0x1a')](_0x126052['Descriptions'],_0x5da8b0,'\x0a'),'contact_id':_0x3b5a6e['id']},getCustomFields(_0x371a04,_0x5da8b0));var _0x2f5190={'method':_0xefc1('0x1b'),'uri':util[_0xefc1('0x1c')](_0xefc1('0x1d'),_0x257914[_0xefc1('0x1e')]),'form':{'operation':_0xefc1('0x1f'),'username':'admin','sessionName':_0x1aaaa0[_0xefc1('0x20')],'elementType':_0xefc1('0x21'),'element':JSON['stringify'](_0x577315)},'json':!![]};return request(_0x2f5190)[_0xefc1('0x22')](function(_0x4b8418){if(_0x4b8418['success']){return BPromise[_0xefc1('0x23')]({'id':_0x4b8418[_0xefc1('0x24')]['id']});}else{throw new Error(util[_0xefc1('0x1c')](_0xefc1('0x25'),JSON[_0xefc1('0x26')](_0x4b8418[_0xefc1('0x27')])));}})['catch'](function(_0x5c2733){var _0x28d1cb=_0x5c2733[_0xefc1('0x28')]||0x1f4;logger[_0xefc1('0x27')](_0xefc1('0x29'),_0xefc1('0x2a'),_0x28d1cb,JSON['stringify'](_0x5c2733));});}function getUser(_0x33c2f7,_0x3f6e1a,_0x55f900){if(intUtil['validateEmail'](_0x3f6e1a)){logger[_0xefc1('0x16')](_0xefc1('0x2b'),_0x3f6e1a);return request({'method':_0xefc1('0x2c'),'uri':util['format'](_0xefc1('0x1d'),_0x33c2f7[_0xefc1('0x1e')]),'qs':{'operation':_0xefc1('0x2d'),'username':_0xefc1('0x2e'),'sessionName':_0x55f900[_0xefc1('0x20')],'query':util[_0xefc1('0x1c')](_0xefc1('0x2f'),_0x3f6e1a)},'json':!![]})[_0xefc1('0x22')](function(_0x514244){if(_0x514244[_0xefc1('0x30')]&&_0x514244[_0xefc1('0x24')][_0xefc1('0xa')]){logger[_0xefc1('0x16')](_0xefc1('0x31'));return BPromise[_0xefc1('0x23')]({'id':_0x514244[_0xefc1('0x24')][0x0]['id'],'email':_0x514244[_0xefc1('0x24')][0x0]['email1'],'name':_0x514244[_0xefc1('0x24')][0x0][_0xefc1('0x32')]+'\x20'+_0x514244[_0xefc1('0x24')][_0xefc1('0x33')]});}else{logger['info'](_0xefc1('0x34'));return BPromise['resolve']({'id':_0x55f900[_0xefc1('0x35')],'email':_0x33c2f7[_0xefc1('0x36')],'name':_0xefc1('0x2e')});}})[_0xefc1('0x37')](function(_0x4e8c38){var _0x348096=_0x4e8c38[_0xefc1('0x28')]||0x1f4;logger[_0xefc1('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xefc1('0x38'),_0x348096,JSON['stringify'](_0x4e8c38));});}else{logger['info'](_0xefc1('0x34'));return BPromise['resolve']({'id':_0x55f900[_0xefc1('0x35')],'email':_0x33c2f7[_0xefc1('0x36')],'name':_0xefc1('0x2e')})[_0xefc1('0x37')](function(_0x16fe22){var _0x5a69f4=_0x16fe22[_0xefc1('0x28')]||0x1f4;logger[_0xefc1('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xefc1('0x38'),_0x5a69f4,JSON[_0xefc1('0x26')](_0x16fe22));});}}function getEndUser(_0x319e94,_0x3dde83,_0x5b7908,_0x5102b1){logger[_0xefc1('0x16')](_0xefc1('0x39'),_0x5b7908);return request({'method':_0xefc1('0x2c'),'uri':util[_0xefc1('0x1c')](_0xefc1('0x1d'),_0x319e94[_0xefc1('0x1e')]),'qs':{'operation':_0xefc1('0x2d'),'username':_0xefc1('0x2e'),'sessionName':_0x5102b1['sessionName'],'query':util[_0xefc1('0x1c')](_0xefc1('0x3a'),_0x5b7908,_0x5b7908,_0x5b7908,_0x5b7908,_0x5b7908)},'json':!![]})[_0xefc1('0x22')](function(_0x33ade1){if(_0x33ade1[_0xefc1('0x30')]&&_0x33ade1[_0xefc1('0x24')][_0xefc1('0xa')]){logger['info'](_0xefc1('0x3b'));return BPromise[_0xefc1('0x23')]({'id':_0x33ade1[_0xefc1('0x24')][0x0]['id'],'name':_0x33ade1[_0xefc1('0x24')][0x0]['firstname']+'\x20'+_0x33ade1[_0xefc1('0x24')][0x0][_0xefc1('0x3c')],'phone':_0x5b7908});}else{logger[_0xefc1('0x16')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0xefc1('0x1b'),'uri':util[_0xefc1('0x1c')](_0xefc1('0x1d'),_0x319e94[_0xefc1('0x1e')]),'form':{'operation':_0xefc1('0x1f'),'sessionName':_0x5102b1['sessionName'],'elementType':_0xefc1('0x3d'),'element':JSON['stringify']({'lastname':_0x3dde83,'phone':_0x5b7908,'assigned_user_id':'\x20'})},'json':!![]})[_0xefc1('0x22')](function(_0x26f699){logger[_0xefc1('0x16')](_0xefc1('0x3e'));return BPromise['resolve']({'id':_0x26f699[_0xefc1('0x24')]['id'],'name':_0x26f699['result'][_0xefc1('0x3c')],'phone':_0x26f699[_0xefc1('0x24')]['phone']});})[_0xefc1('0x37')](function(_0x15c7d3){var _0xd7227a=_0x15c7d3[_0xefc1('0x28')]||0x1f4;logger[_0xefc1('0x27')](_0xefc1('0x29'),_0xefc1('0x3f'),_0xd7227a,JSON[_0xefc1('0x26')](_0x15c7d3));});}});}function getConnection(_0x49f9e1){var _0x772cc9=_0x49f9e1[_0xefc1('0x36')];var _0x45e7d0=_0x49f9e1['accessKey'];return request({'method':_0xefc1('0x2c'),'uri':util['format'](_0xefc1('0x1d'),_0x49f9e1[_0xefc1('0x1e')]),'qs':{'operation':_0xefc1('0x40'),'username':_0x772cc9},'json':!![]})[_0xefc1('0x22')](function(_0x5c984c){if(_0x5c984c[_0xefc1('0x30')]){return request({'method':'POST','uri':util[_0xefc1('0x1c')](_0xefc1('0x1d'),_0x49f9e1[_0xefc1('0x1e')]),'form':{'operation':_0xefc1('0x41'),'username':'admin','accessKey':md5(_0x5c984c['result'][_0xefc1('0x42')]+_0x45e7d0)},'json':!![]});}})[_0xefc1('0x22')](function(_0x3c42e3){if(_0x3c42e3[_0xefc1('0x30')]){return BPromise[_0xefc1('0x23')](_0x3c42e3[_0xefc1('0x24')]);}else{throw new Error(util['format'](_0xefc1('0x43'),_0x49f9e1['id']));}})[_0xefc1('0x37')](function(_0x11e853){var _0x254e40=_0x11e853[_0xefc1('0x28')]||0x1f4;logger['error'](_0xefc1('0x29'),_0xefc1('0x44'),_0x254e40,JSON[_0xefc1('0x26')](_0x11e853));});}function request(_0x6e5357){logger[_0xefc1('0x16')]('[HTTP]',JSON['stringify'](_0x6e5357));return rp(_0x6e5357);}exports[_0xefc1('0x45')]=function(_0x5ccfd0,_0x50994a,_0x10fa08,_0x23dbb1,_0x1bf0c2,_0x36c7bf){var _0x35ba8e,_0x184596,_0x4a149d,_0x283644;_0x36c7bf[_0xefc1('0x1e')]=intUtil[_0xefc1('0x46')](_0x36c7bf['remoteUri']);if(_0x1bf0c2&&_0x1bf0c2[_0xefc1('0x47')]){logger['info'](_0xefc1('0x48'),_0xefc1('0x49'));_0x50994a[_0xefc1('0x4a')]=util[_0xefc1('0x1c')](_0xefc1('0x4b'),_0x36c7bf[_0xefc1('0x4c')],_0x50994a[_0xefc1('0x4d')],md5(_0x50994a[_0xefc1('0x4d')]));}else{_0x50994a[_0xefc1('0x4a')]='';}return getConnection(_0x36c7bf)[_0xefc1('0x22')](function(_0x2eff26){_0x283644=_0x2eff26;return getUser(_0x36c7bf,_0x23dbb1['email'],_0x283644);})[_0xefc1('0x22')](function(_0x219d33){_0x35ba8e=_0x219d33;logger[_0xefc1('0x16')](_0xefc1('0x4e'),_0x35ba8e['id']);return getEndUser(_0x36c7bf,_0x50994a[_0xefc1('0x4f')],_0x50994a['calleridnum'],_0x283644);})[_0xefc1('0x22')](function(_0x473b9b){_0x184596=_0x473b9b;logger[_0xefc1('0x16')]('The\x20Enduser\x20ID\x20is:',_0x184596['id']);return createTicket(_0x36c7bf,_0x35ba8e,_0x184596,_0x10fa08,_0x50994a,_0x10fa08['Fields'],_0x283644);})[_0xefc1('0x22')](function(_0x3372b0){_0x4a149d=_0x3372b0;logger[_0xefc1('0x16')](_0xefc1('0x50'));logger['info'](_0xefc1('0x51'),_0x4a149d['id']);var _0x2484f1=util[_0xefc1('0x1c')](_0xefc1('0x52'),_0x36c7bf[_0xefc1('0x1e')],_[_0xefc1('0x53')](_0x4a149d['id'],'x')[0x1]);logger[_0xefc1('0x16')]('[QUEUE]',_0xefc1('0x54'));emit(util[_0xefc1('0x1c')](_0xefc1('0x55'),_0x23dbb1[_0xefc1('0x14')]),'trigger:browser:url',{'uri':_0x2484f1});})[_0xefc1('0x37')](function(_0x2e5823){logger['error'](_0xefc1('0x48'),JSON[_0xefc1('0x26')](_0x2e5823));});};exports[_0xefc1('0x56')]=function(_0x423d4c,_0x404af4,_0x105a80,_0x1c555f,_0x4618e6,_0x5cce6d,_0x30aca4){var _0x4a0941,_0x2f19d3,_0x43738c,_0x1f9c4f;_0x5cce6d['remoteUri']=intUtil[_0xefc1('0x46')](_0x5cce6d['remoteUri']);_0x5cce6d['serverUrl']=intUtil[_0xefc1('0x46')](_0x5cce6d[_0xefc1('0x4c')]);if(_0x30aca4&&_0x30aca4['recordingFormat']&&_0x30aca4[_0xefc1('0x57')]!=='none'){logger[_0xefc1('0x16')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x404af4[_0xefc1('0x4a')]=util[_0xefc1('0x1c')](_0xefc1('0x4b'),_0x5cce6d[_0xefc1('0x4c')],_0x404af4[_0xefc1('0x4d')],md5(_0x404af4[_0xefc1('0x4d')]));}return getConnection(_0x5cce6d)['then'](function(_0x277c12){_0x1f9c4f=_0x277c12;return getUser(_0x5cce6d,_0x1c555f['email'],_0x1f9c4f);})['then'](function(_0x5c6b76){_0x4a0941=_0x5c6b76;logger['info'](_0xefc1('0x4e'),_0x4a0941['id']);return getEndUser(_0x5cce6d,_0x404af4[_0xefc1('0x58')],_0x404af4['destcalleridnum'],_0x1f9c4f);})['then'](function(_0x4c7e68){_0x2f19d3=_0x4c7e68;logger[_0xefc1('0x16')](_0xefc1('0x59'),_0x2f19d3['id']);return createTicket(_0x5cce6d,_0x4a0941,_0x2f19d3,_0x105a80,_0x404af4,_0x105a80[_0xefc1('0x5a')],_0x1f9c4f);})[_0xefc1('0x22')](function(_0x32a20e){_0x43738c=_0x32a20e;logger[_0xefc1('0x16')](_0xefc1('0x50'));logger[_0xefc1('0x16')]('The\x20Ticket\x20ID\x20is:',_0x43738c['id']);var _0x4a052d=util[_0xefc1('0x1c')](_0xefc1('0x52'),_0x5cce6d['remoteUri'],_['split'](_0x43738c['id'],'x')[0x1]);logger['info'](_0xefc1('0x5b'),_0xefc1('0x54'));emit(util[_0xefc1('0x1c')](_0xefc1('0x55'),_0x1c555f[_0xefc1('0x14')]),_0xefc1('0x5c'),{'uri':_0x4a052d});})[_0xefc1('0x37')](function(_0x530e45){logger[_0xefc1('0x27')](_0xefc1('0x5b'),JSON[_0xefc1('0x26')](_0x530e45));});};exports[_0xefc1('0x5d')]=function(_0x478a1a,_0x379b05,_0x375cde,_0x228a19,_0x4ab00b,_0x55738c){var _0x312d19,_0x417f33,_0x43599d,_0x46c4ed;_0x55738c[_0xefc1('0x1e')]=intUtil['stripTrailingSlash'](_0x55738c[_0xefc1('0x1e')]);_0x55738c[_0xefc1('0x4c')]=intUtil['stripTrailingSlash'](_0x55738c[_0xefc1('0x4c')]);if(_0x4ab00b&&_0x4ab00b[_0xefc1('0x47')]){logger[_0xefc1('0x16')]('[ABANDONED]',_0xefc1('0x49'));_0x379b05[_0xefc1('0x4a')]=util[_0xefc1('0x1c')](_0xefc1('0x4b'),_0x55738c[_0xefc1('0x4c')],_0x379b05[_0xefc1('0x4d')],md5(_0x379b05['uniqueid']));}else{_0x379b05[_0xefc1('0x4a')]='';}return getConnection(_0x55738c)[_0xefc1('0x22')](function(_0x492c1e){_0x46c4ed=_0x492c1e;return getUser(_0x55738c,'',_0x46c4ed);})['then'](function(_0x42ee27){_0x312d19=_0x42ee27;logger[_0xefc1('0x16')](_0xefc1('0x4e'),_0x312d19['id']);return getEndUser(_0x55738c,_0x379b05[_0xefc1('0x4f')],_0x379b05[_0xefc1('0x5e')],_0x46c4ed);})[_0xefc1('0x22')](function(_0x1ef91b){_0x417f33=_0x1ef91b;logger[_0xefc1('0x16')](_0xefc1('0x59'),_0x417f33['id']);return createTicket(_0x55738c,_0x312d19,_0x417f33,_0x375cde,_0x379b05,_0x375cde[_0xefc1('0x5a')],_0x46c4ed);})[_0xefc1('0x22')](function(_0x5ea1ea){_0x43599d=_0x5ea1ea;logger[_0xefc1('0x16')](_0xefc1('0x50'));logger['info'](_0xefc1('0x51'),_0x43599d['id']);})[_0xefc1('0x37')](function(_0x4edb0b){logger[_0xefc1('0x27')](_0xefc1('0x5f'),JSON[_0xefc1('0x26')](_0x4edb0b));});}; \ 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 602a192..f7464b6 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 _0x9bb7=['variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','destcalleridname','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','format','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable'];(function(_0xf911e5,_0x2909ee){var _0x26e8f4=function(_0x331ede){while(--_0x331ede){_0xf911e5['push'](_0xf911e5['shift']());}};_0x26e8f4(++_0x2909ee);}(_0x9bb7,0x1c2));var _0x79bb=function(_0x1b00d0,_0x265b67){_0x1b00d0=_0x1b00d0-0x0;var _0x31446c=_0x9bb7[_0x1b00d0];return _0x31446c;};'use strict';var _=require(_0x79bb('0x0'));var rp=require(_0x79bb('0x1'));var md5=require(_0x79bb('0x2'));var util=require(_0x79bb('0x3'));var Redis=require(_0x79bb('0x4'));var intUtil=require(_0x79bb('0x5'));var config=require(_0x79bb('0x6'));var logger=require('../../../../config/logger')('zendesk');config[_0x79bb('0x7')]=_[_0x79bb('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x79bb('0x9'))(new Redis(config[_0x79bb('0x7')]));function emit(_0x3b71fc,_0x528f26,_0x47a5c){io['to'](_0x3b71fc)[_0x79bb('0xa')](_0x528f26,_0x47a5c);}var headers={'Content-Type':'application/json','Accept':_0x79bb('0xb')};function getTicket(_0x149470,_0x530eba,_0x1692b0,_0x5878ce,_0x44b259){logger[_0x79bb('0xc')](_0x79bb('0xd'));return request({'uri':util['format'](_0x79bb('0xe'),_0x149470[_0x79bb('0xf')]),'method':_0x79bb('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x1692b0['id'],'submitter_id':_0x530eba?_0x530eba['id']:undefined,'assignee_id':_0x530eba?_0x530eba['id']:undefined,'tags':getTags(_0x5878ce[_0x79bb('0x11')],_0x79bb('0x12')),'subject':intUtil[_0x79bb('0x13')](_0x5878ce['Subjects'],_0x44b259,'\x20'),'description':intUtil[_0x79bb('0x13')](_0x5878ce[_0x79bb('0x14')],_0x44b259,'\x0a'),'comment':{'public':![],'body':intUtil[_0x79bb('0x13')](_0x5878ce[_0x79bb('0x14')],_0x44b259,'\x0a')}},getCustomFields(_0x5878ce[_0x79bb('0x15')],_0x44b259))}})[_0x79bb('0x16')](function(_0x4bca38){logger[_0x79bb('0xc')](_0x79bb('0x17'));return _0x4bca38['ticket'];});}function getUser(_0x5f5802,_0x15a7c2){if(intUtil['validateEmail'](_0x15a7c2)){logger[_0x79bb('0xc')](_0x79bb('0x18'),_0x15a7c2);return request({'uri':util['format']('%s/search.json',_0x5f5802['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x15a7c2)}})[_0x79bb('0x16')](function(_0x128d47){if(_0x128d47[_0x79bb('0x19')]){logger['info']('Agent\x20found!');return _[_0x79bb('0x1a')](_0x128d47[_0x79bb('0x1b')],{'email':_0x15a7c2,'role':_0x79bb('0x1c')});}else{logger[_0x79bb('0xc')](_0x79bb('0x1d'));return request({'uri':util['format'](_0x79bb('0x1e'),_0x5f5802['remoteUri'])})[_0x79bb('0x16')](function(_0x462d6a){logger[_0x79bb('0xc')]('Admin\x20account\x20selected.');return _0x462d6a[_0x79bb('0x1f')];});}});}else{logger['info'](_0x79bb('0x1d'));return request({'uri':util['format'](_0x79bb('0x1e'),_0x5f5802['remoteUri'])})[_0x79bb('0x16')](function(_0x2cb96d){logger[_0x79bb('0xc')]('Admin\x20account\x20selected.');return _0x2cb96d['user'];});}}function getEndUser(_0x257adc,_0x26b086,_0x271096){logger['info']('Searching\x20enduser\x20with\x20phone',_0x271096);return request({'uri':util[_0x79bb('0x20')]('%s/search.json',_0x257adc[_0x79bb('0xf')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x271096)}})[_0x79bb('0x16')](function(_0x2a67a7){var _0x34b8a0;if(_0x2a67a7[_0x79bb('0x1b')][_0x79bb('0x21')]){_0x2a67a7[_0x79bb('0x1b')]=_[_0x79bb('0x22')](_0x2a67a7[_0x79bb('0x1b')],{'suspended':![],'role':'end-user'});if(_0x2a67a7[_0x79bb('0x1b')]['length']){_0x34b8a0=_[_0x79bb('0x23')](_0x2a67a7[_0x79bb('0x1b')]);}}if(_0x34b8a0){logger[_0x79bb('0xc')](_0x79bb('0x24'));return _0x34b8a0;}else{logger[_0x79bb('0xc')](_0x79bb('0x25'));return request({'uri':util[_0x79bb('0x20')](_0x79bb('0x26'),_0x257adc[_0x79bb('0xf')]),'method':_0x79bb('0x10'),'body':{'user':{'role':_0x79bb('0x27'),'name':util[_0x79bb('0x20')](_0x79bb('0x28'),_0x26b086||_0x271096),'phone':_0x271096}}})['then'](function(_0x202934){logger[_0x79bb('0xc')](_0x79bb('0x29'));return _0x202934[_0x79bb('0x1f')];});}});}function getAuth(_0x7faaba){var _0x4b417c;if(_0x7faaba[_0x79bb('0x2a')]==='password'){_0x4b417c=util['format'](_0x79bb('0x2b'),_0x7faaba[_0x79bb('0x2c')],_0x7faaba[_0x79bb('0x2d')]);}else if(_0x7faaba[_0x79bb('0x2a')]===_0x79bb('0x2e')){_0x4b417c=util[_0x79bb('0x20')](_0x79bb('0x2f'),_0x7faaba[_0x79bb('0x2c')],_0x7faaba[_0x79bb('0x2e')]);}return util[_0x79bb('0x20')]('Basic\x20%s',new Buffer(_0x4b417c)[_0x79bb('0x30')](_0x79bb('0x31')));}function request(_0x15afd0){logger[_0x79bb('0x32')](_0x79bb('0x33'),JSON[_0x79bb('0x34')](_0x15afd0));return rp(_[_0x79bb('0x8')](_0x15afd0,{'method':_0x79bb('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x556e89,_0x1cbddb){var _0x307e85=[];if(_0x556e89&&_0x556e89[_0x79bb('0x21')]>0x0){_0x307e85=_[_0x79bb('0x36')](_0x556e89,_0x1cbddb);}return _0x307e85;}function getCustomFields(_0x296693,_0x34884c){var _0x1c5f99=[];var _0x39acd1={'custom_fields':[]};if(_0x296693[_0x79bb('0x21')]>0x0){_['forEach'](_0x296693,function(_0x11ef49){if(_0x11ef49[_0x79bb('0x37')]===_0x79bb('0x38')&&_0x11ef49[_0x79bb('0x39')]&&!_0x11ef49[_0x79bb('0x3a')]){_0x39acd1[_0x11ef49['nameField'][_0x79bb('0x3b')]()]=_0x11ef49[_0x79bb('0x3c')][_0x79bb('0x30')]();}else if(_0x11ef49['type']==='string'&&_0x11ef49['idField']&&_0x11ef49[_0x79bb('0x3a')]){_0x39acd1[_0x79bb('0x3d')][_0x79bb('0x3e')]({'id':_0x11ef49[_0x79bb('0x3f')],'value':_0x11ef49[_0x79bb('0x3c')]['toString']()});}else if(_0x11ef49[_0x79bb('0x37')]===_0x79bb('0x40')&&_0x11ef49['variableName']&&_0x11ef49['idField']&&_0x11ef49[_0x79bb('0x3a')]){_0x34884c[_0x11ef49[_0x79bb('0x41')]]&&_0x39acd1['custom_fields']['push']({'id':_0x11ef49[_0x79bb('0x3f')],'value':_0x34884c[_0x11ef49[_0x79bb('0x41')]][_0x79bb('0x30')]()});}else if(_0x11ef49[_0x79bb('0x37')]===_0x79bb('0x42')&&_0x11ef49['Variable']&&_0x11ef49[_0x79bb('0x43')]['name']&&_0x11ef49['idField']&&_0x11ef49[_0x79bb('0x3a')]){_0x34884c[_0x11ef49[_0x79bb('0x43')][_0x79bb('0x12')][_0x79bb('0x3b')]()]&&_0x39acd1[_0x79bb('0x3d')][_0x79bb('0x3e')]({'id':_0x11ef49[_0x79bb('0x3f')],'value':_0x34884c[_0x11ef49[_0x79bb('0x43')][_0x79bb('0x12')][_0x79bb('0x3b')]()][_0x79bb('0x30')]()});}});}return _0x39acd1;}exports[_0x79bb('0x44')]=function(_0x16f14e,_0x3b6054,_0x2f59b3,_0x390e44,_0x8ed9e5,_0x40ac75){var _0x1e0b0a,_0x24296a;_0x40ac75[_0x79bb('0xf')]=intUtil[_0x79bb('0x45')](_0x40ac75[_0x79bb('0xf')]);_0x40ac75[_0x79bb('0x46')]=intUtil['stripTrailingSlash'](_0x40ac75[_0x79bb('0x46')]);if(_0x8ed9e5&&_0x8ed9e5[_0x79bb('0x47')]){logger[_0x79bb('0xc')](_0x79bb('0x48'),'Recording\x20is\x20enabled!');_0x3b6054['recordingURL']=util[_0x79bb('0x20')](_0x79bb('0x49'),_0x40ac75[_0x79bb('0x46')],_0x3b6054[_0x79bb('0x4a')],md5(_0x3b6054['uniqueid']));}else{_0x3b6054[_0x79bb('0x4b')]='';}headers[_0x79bb('0x4c')]=getAuth(_0x40ac75);return getUser(_0x40ac75,_0x390e44[_0x79bb('0x4d')])[_0x79bb('0x16')](function(_0x157e10){_0x1e0b0a=_0x157e10;logger[_0x79bb('0xc')](_0x79bb('0x4e'),_0x1e0b0a['id']);return getEndUser(_0x40ac75,_0x3b6054['calleridname'],_0x3b6054[_0x79bb('0x4f')]);})[_0x79bb('0x16')](function(_0x835831){_0x24296a=_0x835831;logger[_0x79bb('0xc')](_0x79bb('0x50'),_0x24296a['id']);return getTicket(_0x40ac75,_0x1e0b0a,_0x24296a,_0x2f59b3,_0x3b6054);})['then'](function(_0x161390){if(_0x161390){logger[_0x79bb('0xc')](_0x79bb('0x51'),_0x161390['id']);switch(_0x40ac75[_0x79bb('0x37')]){case _0x79bb('0x52'):logger[_0x79bb('0xc')](_0x79bb('0x48'),_0x79bb('0x53'));return request({'uri':util['format'](_0x79bb('0x54'),_0x40ac75[_0x79bb('0xf')],_0x1e0b0a['id'],_0x161390['id']),'method':'POST'});case'newTab':logger['info'](_0x79bb('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x79bb('0x20')](_0x79bb('0x55'),_0x390e44[_0x79bb('0x12')]),_0x79bb('0x56'),{'uri':util['format'](_0x79bb('0x57'),_0x40ac75[_0x79bb('0xf')],_0x161390['id'])});break;default:logger[_0x79bb('0x58')]('[QUEUE]',_0x79bb('0x59'));}}})[_0x79bb('0x5a')](function(_0x19fe07){logger[_0x79bb('0x58')](_0x79bb('0x5b'),util[_0x79bb('0x5c')](_0x19fe07,{'showHidden':!![],'depth':null}));});};exports[_0x79bb('0x5d')]=function(_0x46062e,_0x283e21,_0x44bdd7,_0x31af6a,_0x10c57f,_0x34be2e,_0x34c28f){var _0x826538,_0x5a7d1b;_0x34be2e[_0x79bb('0xf')]=intUtil[_0x79bb('0x45')](_0x34be2e[_0x79bb('0xf')]);_0x34be2e['serverUrl']=intUtil[_0x79bb('0x45')](_0x34be2e[_0x79bb('0x46')]);if(_0x34c28f&&_0x34c28f['recordingFormat']&&_0x34c28f['recordingFormat']!==_0x79bb('0x5e')){logger[_0x79bb('0xc')](_0x79bb('0x5f'),'Recording\x20is\x20enabled!');_0x283e21[_0x79bb('0x4b')]=util[_0x79bb('0x20')](_0x79bb('0x49'),_0x34be2e['serverUrl'],_0x283e21[_0x79bb('0x4a')],md5(_0x283e21['uniqueid']));}headers[_0x79bb('0x4c')]=getAuth(_0x34be2e);return getUser(_0x34be2e,_0x31af6a['email'])['then'](function(_0x1c8abf){_0x826538=_0x1c8abf;logger['info'](_0x79bb('0x4e'),_0x826538['id']);return getEndUser(_0x34be2e,_0x283e21[_0x79bb('0x60')],_0x283e21['destcalleridnum']);})[_0x79bb('0x16')](function(_0x569d12){_0x5a7d1b=_0x569d12;logger['info'](_0x79bb('0x50'),_0x5a7d1b['id']);return getTicket(_0x34be2e,_0x826538,_0x5a7d1b,_0x44bdd7,_0x283e21);})['then'](function(_0x2e37d3){if(_0x2e37d3){logger['info'](_0x79bb('0x51'),_0x2e37d3['id']);switch(_0x34be2e[_0x79bb('0x37')]){case _0x79bb('0x52'):logger[_0x79bb('0xc')]('[OUTBOUND]',_0x79bb('0x53'));return request({'uri':util['format'](_0x79bb('0x54'),_0x34be2e['remoteUri'],_0x826538['id'],_0x2e37d3['id']),'method':_0x79bb('0x10')});case _0x79bb('0x61'):logger[_0x79bb('0xc')](_0x79bb('0x5f'),_0x79bb('0x62'));emit(util[_0x79bb('0x20')](_0x79bb('0x55'),_0x31af6a[_0x79bb('0x12')]),_0x79bb('0x56'),{'uri':util[_0x79bb('0x20')](_0x79bb('0x57'),_0x34be2e['remoteUri'],_0x2e37d3['id'])});break;default:logger[_0x79bb('0x58')]('[OUTBOUND]',_0x79bb('0x59'));}}})[_0x79bb('0x5a')](function(_0x4ababe){logger['error'](_0x79bb('0x63'),util[_0x79bb('0x5c')](_0x4ababe,{'showHidden':!![],'depth':null}));});};exports[_0x79bb('0x64')]=function(_0x29073e,_0x24b031,_0x483932,_0x589a00,_0x2c2578,_0x632ae3){var _0x1d496c,_0x138495;_0x632ae3[_0x79bb('0xf')]=intUtil[_0x79bb('0x45')](_0x632ae3['remoteUri']);_0x632ae3[_0x79bb('0x46')]=intUtil[_0x79bb('0x45')](_0x632ae3[_0x79bb('0x46')]);if(_0x2c2578&&_0x2c2578[_0x79bb('0x47')]){logger[_0x79bb('0xc')](_0x79bb('0x65'),'Recording\x20is\x20enabled!');_0x24b031[_0x79bb('0x4b')]=util[_0x79bb('0x20')](_0x79bb('0x49'),_0x632ae3[_0x79bb('0x46')],_0x24b031[_0x79bb('0x4a')],md5(_0x24b031[_0x79bb('0x4a')]));}else{_0x24b031[_0x79bb('0x4b')]='';}headers[_0x79bb('0x4c')]=getAuth(_0x632ae3);return getUser(_0x632ae3)[_0x79bb('0x16')](function(_0x4b892a){_0x1d496c=_0x4b892a;logger[_0x79bb('0xc')]('The\x20User\x20ID\x20is:',_0x1d496c['id']);return getEndUser(_0x632ae3,_0x24b031['calleridname'],_0x24b031[_0x79bb('0x4f')]);})[_0x79bb('0x16')](function(_0x425aba){_0x138495=_0x425aba;logger[_0x79bb('0xc')](_0x79bb('0x50'),_0x138495['id']);return getTicket(_0x632ae3,_0x1d496c,_0x138495,_0x483932,_0x24b031);})['then'](function(_0x54b5ad){if(_0x54b5ad){logger['info'](_0x79bb('0x51'),_0x54b5ad['id']);}})['catch'](function(_0x4a2e4b){logger[_0x79bb('0x58')](_0x79bb('0x66'),util[_0x79bb('0x5c')](_0x4a2e4b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe636=['content','idField','customField','push','variable','variableName','custom_fields','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','newTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','monitor_format','[ABANDONED]','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','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','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','toString','debug','[HTTP]','stringify','GET','map','type','string','nameField'];(function(_0x4e457b,_0x31b37c){var _0x248e7b=function(_0x35d865){while(--_0x35d865){_0x4e457b['push'](_0x4e457b['shift']());}};_0x248e7b(++_0x31b37c);}(_0xe636,0x16d));var _0x6e63=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0xe636[_0x5b5eb4];return _0x42af53;};'use strict';var _=require(_0x6e63('0x0'));var rp=require(_0x6e63('0x1'));var md5=require('md5');var util=require(_0x6e63('0x2'));var Redis=require(_0x6e63('0x3'));var intUtil=require(_0x6e63('0x4'));var config=require(_0x6e63('0x5'));var logger=require(_0x6e63('0x6'))('zendesk');config['redis']=_['defaults'](config[_0x6e63('0x7')],{'host':_0x6e63('0x8'),'port':0x18eb});var io=require(_0x6e63('0x9'))(new Redis(config[_0x6e63('0x7')]));function emit(_0x33c842,_0x36d4ce,_0x15b438){io['to'](_0x33c842)['emit'](_0x36d4ce,_0x15b438);}var headers={'Content-Type':_0x6e63('0xa'),'Accept':'application/json'};function getTicket(_0x43fbc7,_0x15adcf,_0x42aad6,_0x23ac48,_0x28aaa4){logger[_0x6e63('0xb')](_0x6e63('0xc'));return request({'uri':util[_0x6e63('0xd')](_0x6e63('0xe'),_0x43fbc7[_0x6e63('0xf')]),'method':'POST','body':{'ticket':_[_0x6e63('0x10')]({'requester_id':_0x42aad6['id'],'submitter_id':_0x15adcf?_0x15adcf['id']:undefined,'assignee_id':_0x15adcf?_0x15adcf['id']:undefined,'tags':getTags(_0x23ac48[_0x6e63('0x11')],'name'),'subject':intUtil['getString'](_0x23ac48['Subjects'],_0x28aaa4,'\x20'),'description':intUtil[_0x6e63('0x12')](_0x23ac48['Descriptions'],_0x28aaa4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6e63('0x12')](_0x23ac48[_0x6e63('0x13')],_0x28aaa4,'\x0a')}},getCustomFields(_0x23ac48[_0x6e63('0x14')],_0x28aaa4))}})[_0x6e63('0x15')](function(_0x555be0){logger[_0x6e63('0xb')](_0x6e63('0x16'));return _0x555be0[_0x6e63('0x17')];});}function getUser(_0x554887,_0x2ebe3d){if(intUtil[_0x6e63('0x18')](_0x2ebe3d)){logger['info'](_0x6e63('0x19'),_0x2ebe3d);return request({'uri':util['format'](_0x6e63('0x1a'),_0x554887[_0x6e63('0xf')]),'qs':{'query':util[_0x6e63('0xd')](_0x6e63('0x1b'),_0x2ebe3d)}})[_0x6e63('0x15')](function(_0x457adf){if(_0x457adf[_0x6e63('0x1c')]){logger[_0x6e63('0xb')](_0x6e63('0x1d'));return _[_0x6e63('0x1e')](_0x457adf[_0x6e63('0x1f')],{'email':_0x2ebe3d,'role':_0x6e63('0x20')});}else{logger['info'](_0x6e63('0x21'));return request({'uri':util['format'](_0x6e63('0x22'),_0x554887[_0x6e63('0xf')])})[_0x6e63('0x15')](function(_0x5cda96){logger[_0x6e63('0xb')](_0x6e63('0x23'));return _0x5cda96[_0x6e63('0x24')];});}});}else{logger[_0x6e63('0xb')](_0x6e63('0x21'));return request({'uri':util[_0x6e63('0xd')](_0x6e63('0x22'),_0x554887[_0x6e63('0xf')])})[_0x6e63('0x15')](function(_0xfd0999){logger[_0x6e63('0xb')](_0x6e63('0x23'));return _0xfd0999[_0x6e63('0x24')];});}}function getEndUser(_0x52f259,_0x1485a0,_0xa20c05){logger[_0x6e63('0xb')]('Searching\x20enduser\x20with\x20phone',_0xa20c05);return request({'uri':util['format'](_0x6e63('0x1a'),_0x52f259['remoteUri']),'qs':{'query':util[_0x6e63('0xd')](_0x6e63('0x25'),_0xa20c05)}})[_0x6e63('0x15')](function(_0x37b32e){var _0x3c249e;if(_0x37b32e[_0x6e63('0x1f')][_0x6e63('0x26')]){_0x37b32e['results']=_[_0x6e63('0x27')](_0x37b32e[_0x6e63('0x1f')],{'suspended':![],'role':_0x6e63('0x28')});if(_0x37b32e['results']['length']){_0x3c249e=_[_0x6e63('0x29')](_0x37b32e[_0x6e63('0x1f')]);}}if(_0x3c249e){logger['info'](_0x6e63('0x2a'));return _0x3c249e;}else{logger[_0x6e63('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x6e63('0x2b'),_0x52f259[_0x6e63('0xf')]),'method':'POST','body':{'user':{'role':_0x6e63('0x28'),'name':util[_0x6e63('0xd')](_0x6e63('0x2c'),_0x1485a0||_0xa20c05),'phone':_0xa20c05}}})[_0x6e63('0x15')](function(_0x5a29a1){logger[_0x6e63('0xb')]('Enduser\x20created.');return _0x5a29a1[_0x6e63('0x24')];});}});}function getAuth(_0x29cf5b){var _0x50aea8;if(_0x29cf5b[_0x6e63('0x2d')]===_0x6e63('0x2e')){_0x50aea8=util[_0x6e63('0xd')](_0x6e63('0x2f'),_0x29cf5b[_0x6e63('0x30')],_0x29cf5b['password']);}else if(_0x29cf5b[_0x6e63('0x2d')]===_0x6e63('0x31')){_0x50aea8=util[_0x6e63('0xd')]('%s/token:%s',_0x29cf5b[_0x6e63('0x30')],_0x29cf5b[_0x6e63('0x31')]);}return util[_0x6e63('0xd')]('Basic\x20%s',new Buffer(_0x50aea8)[_0x6e63('0x32')]('base64'));}function request(_0x2ae9de){logger[_0x6e63('0x33')](_0x6e63('0x34'),JSON[_0x6e63('0x35')](_0x2ae9de));return rp(_['defaults'](_0x2ae9de,{'method':_0x6e63('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x10a5cf,_0x3533dc){var _0x1dd9a2=[];if(_0x10a5cf&&_0x10a5cf[_0x6e63('0x26')]>0x0){_0x1dd9a2=_[_0x6e63('0x37')](_0x10a5cf,_0x3533dc);}return _0x1dd9a2;}function getCustomFields(_0x5a8f93,_0x546dda){var _0x205519=[];var _0x11a520={'custom_fields':[]};if(_0x5a8f93[_0x6e63('0x26')]>0x0){_['forEach'](_0x5a8f93,function(_0x20fa1a){if(_0x20fa1a[_0x6e63('0x38')]===_0x6e63('0x39')&&_0x20fa1a[_0x6e63('0x3a')]&&!_0x20fa1a['customField']){_0x11a520[_0x20fa1a[_0x6e63('0x3a')]['toLowerCase']()]=_0x20fa1a[_0x6e63('0x3b')]['toString']();}else if(_0x20fa1a[_0x6e63('0x38')]==='string'&&_0x20fa1a[_0x6e63('0x3c')]&&_0x20fa1a[_0x6e63('0x3d')]){_0x11a520['custom_fields'][_0x6e63('0x3e')]({'id':_0x20fa1a[_0x6e63('0x3c')],'value':_0x20fa1a[_0x6e63('0x3b')][_0x6e63('0x32')]()});}else if(_0x20fa1a[_0x6e63('0x38')]===_0x6e63('0x3f')&&_0x20fa1a[_0x6e63('0x40')]&&_0x20fa1a[_0x6e63('0x3c')]&&_0x20fa1a[_0x6e63('0x3d')]){_0x546dda[_0x20fa1a[_0x6e63('0x40')]]&&_0x11a520[_0x6e63('0x41')][_0x6e63('0x3e')]({'id':_0x20fa1a[_0x6e63('0x3c')],'value':_0x546dda[_0x20fa1a[_0x6e63('0x40')]]['toString']()});}else if(_0x20fa1a[_0x6e63('0x38')]===_0x6e63('0x42')&&_0x20fa1a[_0x6e63('0x43')]&&_0x20fa1a['Variable']['name']&&_0x20fa1a['idField']&&_0x20fa1a[_0x6e63('0x3d')]){_0x546dda[_0x20fa1a[_0x6e63('0x43')][_0x6e63('0x44')][_0x6e63('0x45')]()]&&_0x11a520[_0x6e63('0x41')]['push']({'id':_0x20fa1a[_0x6e63('0x3c')],'value':_0x546dda[_0x20fa1a['Variable']['name'][_0x6e63('0x45')]()][_0x6e63('0x32')]()});}});}return _0x11a520;}exports[_0x6e63('0x46')]=function(_0x1a4a18,_0x41998c,_0x4d406e,_0x2a132f,_0x3d1eaa,_0x434e48){var _0x2f5863,_0x45582d;_0x434e48[_0x6e63('0xf')]=intUtil[_0x6e63('0x47')](_0x434e48[_0x6e63('0xf')]);_0x434e48[_0x6e63('0x48')]=intUtil[_0x6e63('0x47')](_0x434e48[_0x6e63('0x48')]);if(_0x3d1eaa&&_0x3d1eaa['monitor_format']){logger[_0x6e63('0xb')](_0x6e63('0x49'),'Recording\x20is\x20enabled!');_0x41998c[_0x6e63('0x4a')]=util[_0x6e63('0xd')](_0x6e63('0x4b'),_0x434e48['serverUrl'],_0x41998c[_0x6e63('0x4c')],md5(_0x41998c['uniqueid']));}else{_0x41998c[_0x6e63('0x4a')]='';}headers[_0x6e63('0x4d')]=getAuth(_0x434e48);return getUser(_0x434e48,_0x2a132f[_0x6e63('0x4e')])[_0x6e63('0x15')](function(_0x49a1df){_0x2f5863=_0x49a1df;logger[_0x6e63('0xb')]('The\x20User\x20ID\x20is:',_0x2f5863['id']);return getEndUser(_0x434e48,_0x41998c[_0x6e63('0x4f')],_0x41998c[_0x6e63('0x50')]);})[_0x6e63('0x15')](function(_0x432737){_0x45582d=_0x432737;logger[_0x6e63('0xb')]('The\x20Enduser\x20ID\x20is:',_0x45582d['id']);return getTicket(_0x434e48,_0x2f5863,_0x45582d,_0x4d406e,_0x41998c);})[_0x6e63('0x15')](function(_0x24d194){if(_0x24d194){logger['info'](_0x6e63('0x51'),_0x24d194['id']);switch(_0x434e48[_0x6e63('0x38')]){case _0x6e63('0x52'):logger[_0x6e63('0xb')](_0x6e63('0x49'),_0x6e63('0x53'));return request({'uri':util[_0x6e63('0xd')](_0x6e63('0x54'),_0x434e48[_0x6e63('0xf')],_0x2f5863['id'],_0x24d194['id']),'method':_0x6e63('0x55')});case'newTab':logger[_0x6e63('0xb')](_0x6e63('0x49'),_0x6e63('0x56'));emit(util['format']('user:%s',_0x2a132f[_0x6e63('0x44')]),_0x6e63('0x57'),{'uri':util[_0x6e63('0xd')](_0x6e63('0x58'),_0x434e48['remoteUri'],_0x24d194['id'])});break;default:logger[_0x6e63('0x59')](_0x6e63('0x49'),_0x6e63('0x5a'));}}})[_0x6e63('0x5b')](function(_0x101853){logger[_0x6e63('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x101853,{'showHidden':!![],'depth':null}));});};exports[_0x6e63('0x5c')]=function(_0x12b2a2,_0x10d2bf,_0x49a100,_0x242c14,_0xf47fce,_0x1a4ccb,_0x290115){var _0x66c491,_0x12145d;_0x1a4ccb[_0x6e63('0xf')]=intUtil[_0x6e63('0x47')](_0x1a4ccb['remoteUri']);_0x1a4ccb['serverUrl']=intUtil[_0x6e63('0x47')](_0x1a4ccb[_0x6e63('0x48')]);if(_0x290115&&_0x290115['recordingFormat']&&_0x290115['recordingFormat']!==_0x6e63('0x5d')){logger[_0x6e63('0xb')](_0x6e63('0x5e'),_0x6e63('0x5f'));_0x10d2bf['recordingURL']=util[_0x6e63('0xd')](_0x6e63('0x4b'),_0x1a4ccb[_0x6e63('0x48')],_0x10d2bf['uniqueid'],md5(_0x10d2bf[_0x6e63('0x4c')]));}headers['Authorization']=getAuth(_0x1a4ccb);return getUser(_0x1a4ccb,_0x242c14[_0x6e63('0x4e')])[_0x6e63('0x15')](function(_0x51af3c){_0x66c491=_0x51af3c;logger[_0x6e63('0xb')](_0x6e63('0x60'),_0x66c491['id']);return getEndUser(_0x1a4ccb,_0x10d2bf[_0x6e63('0x61')],_0x10d2bf[_0x6e63('0x62')]);})[_0x6e63('0x15')](function(_0x3b4743){_0x12145d=_0x3b4743;logger['info'](_0x6e63('0x63'),_0x12145d['id']);return getTicket(_0x1a4ccb,_0x66c491,_0x12145d,_0x49a100,_0x10d2bf);})[_0x6e63('0x15')](function(_0x2ce70b){if(_0x2ce70b){logger[_0x6e63('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2ce70b['id']);switch(_0x1a4ccb['type']){case'integrationTab':logger[_0x6e63('0xb')](_0x6e63('0x5e'),_0x6e63('0x53'));return request({'uri':util['format'](_0x6e63('0x54'),_0x1a4ccb[_0x6e63('0xf')],_0x66c491['id'],_0x2ce70b['id']),'method':_0x6e63('0x55')});case _0x6e63('0x64'):logger['info'](_0x6e63('0x5e'),_0x6e63('0x56'));emit(util['format'](_0x6e63('0x65'),_0x242c14[_0x6e63('0x44')]),'trigger:browser:url',{'uri':util[_0x6e63('0xd')](_0x6e63('0x58'),_0x1a4ccb[_0x6e63('0xf')],_0x2ce70b['id'])});break;default:logger[_0x6e63('0x59')]('[OUTBOUND]',_0x6e63('0x5a'));}}})[_0x6e63('0x5b')](function(_0x4a1c1f){logger[_0x6e63('0x59')](_0x6e63('0x66'),util[_0x6e63('0x67')](_0x4a1c1f,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x50c312,_0x436195,_0x2cec1f,_0x199f4a,_0x323070,_0x5c8aca){var _0x399e6b,_0x3a0175;_0x5c8aca[_0x6e63('0xf')]=intUtil[_0x6e63('0x47')](_0x5c8aca[_0x6e63('0xf')]);_0x5c8aca[_0x6e63('0x48')]=intUtil['stripTrailingSlash'](_0x5c8aca[_0x6e63('0x48')]);if(_0x323070&&_0x323070[_0x6e63('0x68')]){logger[_0x6e63('0xb')](_0x6e63('0x69'),_0x6e63('0x5f'));_0x436195[_0x6e63('0x4a')]=util['format'](_0x6e63('0x4b'),_0x5c8aca[_0x6e63('0x48')],_0x436195[_0x6e63('0x4c')],md5(_0x436195[_0x6e63('0x4c')]));}else{_0x436195[_0x6e63('0x4a')]='';}headers[_0x6e63('0x4d')]=getAuth(_0x5c8aca);return getUser(_0x5c8aca)[_0x6e63('0x15')](function(_0x3ef347){_0x399e6b=_0x3ef347;logger[_0x6e63('0xb')]('The\x20User\x20ID\x20is:',_0x399e6b['id']);return getEndUser(_0x5c8aca,_0x436195[_0x6e63('0x4f')],_0x436195[_0x6e63('0x50')]);})[_0x6e63('0x15')](function(_0x3ef6db){_0x3a0175=_0x3ef6db;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3a0175['id']);return getTicket(_0x5c8aca,_0x399e6b,_0x3a0175,_0x2cec1f,_0x436195);})[_0x6e63('0x15')](function(_0x4a250c){if(_0x4a250c){logger[_0x6e63('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4a250c['id']);}})[_0x6e63('0x5b')](function(_0x236c95){logger[_0x6e63('0x59')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x6e63('0x67')](_0x236c95,{'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 962ada1..4c38c7b 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 _0x8335=['string','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','calleridname','[ABANDONED]','md5','util','./util','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','application/json','merge','outbound','starttime','format','YYYY-MM-DD\x20HH:mm:ss','Subjects','Descriptions','Fields','lastevent','Call\x20Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','mm:ss','answertime','endtime','diff','CONTACTID','LEADID','SEMODULE','SEID','','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','then','parse','toJson','response','result','recorddetail','info','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','users','user','zoho\x20data\x20users','find','Standard','active','isNil','Agent\x20found!','Using\x20the\x20admin\x20account!','log','profile','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','Contacts','row','val','((Phone:%s))','Leads','length','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','[HTTP]','forEach','type'];(function(_0x39cad6,_0x1edf41){var _0x5a82f2=function(_0x416563){while(--_0x416563){_0x39cad6['push'](_0x39cad6['shift']());}};_0x5a82f2(++_0x1edf41);}(_0x8335,0xaa));var _0x5833=function(_0x1ad19a,_0x33de96){_0x1ad19a=_0x1ad19a-0x0;var _0x4a04bc=_0x8335[_0x1ad19a];return _0x4a04bc;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x5833('0x0'));var util=require(_0x5833('0x1'));var intUtil=require(_0x5833('0x2'));var parser=require('xml2json');var entities=require(_0x5833('0x3'));var moment=require(_0x5833('0x4'));var Redis=require(_0x5833('0x5'));var config=require(_0x5833('0x6'));var logger=require(_0x5833('0x7'))(_0x5833('0x8'));config['redis']=_[_0x5833('0x9')](config[_0x5833('0xa')],{'host':_0x5833('0xb'),'port':0x18eb});var io=require(_0x5833('0xc'))(new Redis(config['redis']));function emit(_0x496177,_0x2a6e22,_0x14fbe6){io['to'](_0x496177)[_0x5833('0xd')](_0x2a6e22,_0x14fbe6);}var headers={'Content-Type':_0x5833('0xe'),'Accept':'application/json'};function getCall(_0xbf162,_0x381bc3,_0x3bb51b,_0x242a52,_0x190231,_0x3ee7f9){logger['info']('Creating\x20new\x20call...');var _0x4e9589=_[_0x5833('0xf')]({'SMOWNERID':_0x381bc3['id'],'Call Type':_0x3ee7f9||'inbound','Call Start Time':(_0x3ee7f9===_0x5833('0x10')?_0x190231[_0x5833('0x11')]:_0x190231['agentcalledAt'])||moment()[_0x5833('0x12')](_0x5833('0x13')),'Subject':intUtil['getString'](_0x242a52[_0x5833('0x14')],_0x190231,'\x20'),'Description':intUtil['getString'](_0x242a52[_0x5833('0x15')],_0x190231,'\x0a')},getCustomFields(_0x242a52[_0x5833('0x16')],_0x190231));switch(_0x190231[_0x5833('0x17')]){case'called':_0x4e9589[_0x5833('0x18')]=_0x5833('0x19');break;case _0x5833('0x1a'):case _0x5833('0x1b'):_0x4e9589[_0x5833('0x18')]=_0x5833('0x1c');break;case _0x5833('0x1d'):_0x4e9589[_0x5833('0x18')]=_0x5833('0x1e');break;case _0x5833('0x1f'):_0x4e9589[_0x5833('0x18')]=_0x5833('0x20');break;default:}if(_0x190231[_0x5833('0x21')]){_0x4e9589['Call\x20Duration']=moment[_0x5833('0x22')](parseInt(_0x190231[_0x5833('0x21')])*0x3e8)[_0x5833('0x12')](_0x5833('0x23'));}else if(_0x190231[_0x5833('0x24')]&&_0x190231[_0x5833('0x25')]){_0x4e9589['Call\x20Duration']=moment[_0x5833('0x22')](moment(_0x190231['endtime'],_0x5833('0x13'))[_0x5833('0x26')](moment(_0x190231[_0x5833('0x11')],_0x5833('0x13'))))[_0x5833('0x12')]('mm:ss');}if(_0x3bb51b['CONTACTID']){_0x4e9589[_0x5833('0x27')]=_0x3bb51b[_0x5833('0x27')];}else if(_0x3bb51b[_0x5833('0x28')]){_0x4e9589[_0x5833('0x29')]='Leads';_0x4e9589[_0x5833('0x2a')]=_0x3bb51b[_0x5833('0x28')];}var _0x4d36ad=_0x5833('0x2b');for(var _0xdb7767 in _0x4e9589){if(_0x4e9589['hasOwnProperty'](_0xdb7767)){_0x4d36ad+=util[_0x5833('0x12')](_0x5833('0x2c'),entities[_0x5833('0x2d')](_0xdb7767),entities['encodeXML'](_0x4e9589[_0xdb7767]));}}_0x4d36ad+=_0x5833('0x2e');return request({'method':_0x5833('0x2f'),'uri':util[_0x5833('0x12')](_0x5833('0x30'),_0xbf162[_0x5833('0x31')]),'qs':{'authtoken':_0xbf162[_0x5833('0x32')],'scope':_0x5833('0x33'),'xmlData':_0x4d36ad},'json':!![]})[_0x5833('0x34')](function(_0x3dd01b){_0x3dd01b=JSON[_0x5833('0x35')](parser[_0x5833('0x36')](_0x3dd01b));if(_0x3dd01b[_0x5833('0x37')]){if(_0x3dd01b[_0x5833('0x37')]['result']&&_0x3dd01b['response'][_0x5833('0x38')][_0x5833('0x39')]){logger[_0x5833('0x3a')]('Call\x20created!');return{'id':_0x3dd01b[_0x5833('0x37')][_0x5833('0x38')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error(_0x5833('0x3b')+JSON[_0x5833('0x3c')](_0x3dd01b));});}function getUser(_0x4db800,_0x322c30){return request({'method':_0x5833('0x3d'),'uri':util[_0x5833('0x12')](_0x5833('0x3e'),_0x4db800[_0x5833('0x31')]),'qs':{'type':'AllUsers','authtoken':_0x4db800['authToken'],'scope':_0x5833('0x33')},'json':!![]})[_0x5833('0x34')](function(_0x108ec4){if(_0x108ec4[_0x5833('0x3f')]&&_0x108ec4['users'][_0x5833('0x40')]){var _0x37a873;console['log'](_0x5833('0x41'),_0x108ec4[_0x5833('0x3f')][_0x5833('0x40')]);if(_['isArrayLikeObject'](_0x108ec4[_0x5833('0x3f')][_0x5833('0x40')])){console['log'](_0x5833('0x41'),_0x108ec4['users'][_0x5833('0x40')]);if(!_['isNil'](_0x322c30)){_0x37a873=_[_0x5833('0x42')](_0x108ec4[_0x5833('0x3f')][_0x5833('0x40')],{'email':_0x322c30,'profile':_0x5833('0x43'),'status':_0x5833('0x44')});}if(!_[_0x5833('0x45')](_0x37a873)){logger['info'](_0x5833('0x46'));}else{logger[_0x5833('0x3a')](_0x5833('0x47'));_0x37a873=_[_0x5833('0x42')](_0x108ec4[_0x5833('0x3f')][_0x5833('0x40')],{'profile':'Administrator'});}console[_0x5833('0x48')]('zoho\x20user',_0x37a873);return _0x37a873;}else{if(_0x108ec4[_0x5833('0x3f')][_0x5833('0x40')][_0x5833('0x49')]===_0x5833('0x4a')){logger[_0x5833('0x3a')](_0x5833('0x47'));_0x37a873=_0x108ec4['users'][_0x5833('0x40')];return _0x37a873;}else{logger[_0x5833('0x4b')](_0x5833('0x4c'),JSON['stringify'](_0x108ec4));throw new Error(_0x5833('0x4d')+JSON[_0x5833('0x3c')](_0x108ec4));}}}else{logger['error'](_0x5833('0x4c'),JSON[_0x5833('0x3c')](_0x108ec4));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x108ec4));}});}function getEndUser(_0x29f70c,_0x3ececc,_0x352364){logger[_0x5833('0x3a')](_0x5833('0x4e'),_0x352364);return request({'method':_0x5833('0x3d'),'uri':util[_0x5833('0x12')](_0x5833('0x4f'),_0x29f70c[_0x5833('0x31')]),'qs':{'authtoken':_0x29f70c[_0x5833('0x32')],'scope':_0x5833('0x33'),'criteria':util[_0x5833('0x12')]('((Phone:%s))',_0x352364)},'json':!![]})[_0x5833('0x34')](function(_0x596b93){if(_0x596b93['response']&&_0x596b93['response'][_0x5833('0x38')]){logger['info']('Enduser\x20found\x20in\x20Contacts!');var _0x5cd1f1={};var _0x3a3c6f=_0x596b93[_0x5833('0x37')][_0x5833('0x38')]['Contacts']['row']['no']?_0x596b93['response'][_0x5833('0x38')][_0x5833('0x50')]['row']['FL']:_0x596b93[_0x5833('0x37')]['result'][_0x5833('0x50')][_0x5833('0x51')][0x0]['FL'];for(var _0x560a92=0x0,_0x227f47=_0x3a3c6f['length'];_0x560a92<_0x227f47;_0x560a92++){_0x5cd1f1[_0x3a3c6f[_0x560a92][_0x5833('0x52')]]=_0x3a3c6f[_0x560a92]['content'];}return _0x5cd1f1;}else{return request({'method':_0x5833('0x3d'),'uri':util['format']('https://crm.%s/crm/private/json/Leads/searchRecords',_0x29f70c[_0x5833('0x31')]),'qs':{'authtoken':_0x29f70c[_0x5833('0x32')],'scope':_0x5833('0x33'),'criteria':util[_0x5833('0x12')](_0x5833('0x53'),_0x352364)},'json':!![]})[_0x5833('0x34')](function(_0xad8256){if(_0xad8256[_0x5833('0x37')]&&_0xad8256[_0x5833('0x37')][_0x5833('0x38')]){logger[_0x5833('0x3a')]('Enduser\x20found\x20in\x20Leads!');var _0x48cc1c={};var _0x3d16bf=_0xad8256[_0x5833('0x37')]['result'][_0x5833('0x54')][_0x5833('0x51')]['no']?_0xad8256['response'][_0x5833('0x38')][_0x5833('0x54')][_0x5833('0x51')]['FL']:_0xad8256[_0x5833('0x37')][_0x5833('0x38')]['Leads']['row'][0x0]['FL'];for(var _0x24a60a=0x0,_0x8177e=_0x3d16bf[_0x5833('0x55')];_0x24a60a<_0x8177e;_0x24a60a++){_0x48cc1c[_0x3d16bf[_0x24a60a][_0x5833('0x52')]]=_0x3d16bf[_0x24a60a][_0x5833('0x56')];}return _0x48cc1c;}else{logger[_0x5833('0x3a')](_0x5833('0x57'));_0x3ececc=getName(_0x3ececc);return request({'method':_0x5833('0x2f'),'uri':util[_0x5833('0x12')](_0x5833('0x58'),_0x29f70c[_0x5833('0x31')]),'qs':{'authtoken':_0x29f70c[_0x5833('0x32')],'scope':'crmapi','xmlData':util[_0x5833('0x12')]('%s%s%s',entities[_0x5833('0x2d')](_0x3ececc[0x0]),entities[_0x5833('0x2d')](_0x3ececc[0x1]),_0x352364)},'json':!![]})[_0x5833('0x34')](function(_0x16e795){_0x16e795=JSON[_0x5833('0x35')](parser[_0x5833('0x36')](_0x16e795));if(_0x16e795[_0x5833('0x37')]){if(_0x16e795[_0x5833('0x37')][_0x5833('0x38')]&&_0x16e795[_0x5833('0x37')][_0x5833('0x38')]['recorddetail']){logger[_0x5833('0x3a')]('Enduser\x20created.');return request({'method':_0x5833('0x3d'),'uri':util[_0x5833('0x12')](_0x5833('0x59'),_0x29f70c['host']),'qs':{'authtoken':_0x29f70c[_0x5833('0x32')],'scope':_0x5833('0x33'),'id':_0x16e795[_0x5833('0x37')][_0x5833('0x38')][_0x5833('0x39')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0x5833('0x3c')](_0x16e795));})[_0x5833('0x34')](function(_0x4b604b){if(_0x4b604b[_0x5833('0x37')]){if(_0x4b604b[_0x5833('0x37')]['result']){var _0x3b5034={};for(var _0x578c7=0x0,_0x14c9d0=_0x4b604b[_0x5833('0x37')]['result']['Leads'][_0x5833('0x51')]['FL'][_0x5833('0x55')];_0x578c7<_0x14c9d0;_0x578c7++){_0x3b5034[_0x4b604b['response'][_0x5833('0x38')][_0x5833('0x54')][_0x5833('0x51')]['FL'][_0x578c7]['val']]=_0x4b604b[_0x5833('0x37')][_0x5833('0x38')]['Leads'][_0x5833('0x51')]['FL'][_0x578c7][_0x5833('0x56')];}return _0x3b5034;}}throw new Error(_0x5833('0x5a')+JSON[_0x5833('0x3c')](_0x4b604b));});}});}});}function request(_0x47ce80){logger['debug'](_0x5833('0x5b'),JSON['stringify'](_0x47ce80));return rp(_0x47ce80);}function getCustomFields(_0x5705e8,_0x42cc58){var _0x56b9f5={};if(_0x5705e8[_0x5833('0x55')]>0x0){_[_0x5833('0x5c')](_0x5705e8,function(_0x2cdbd6){if(_0x2cdbd6[_0x5833('0x5d')]===_0x5833('0x5e')&&_0x2cdbd6['idField']){_0x56b9f5[_0x2cdbd6['idField']]=_0x2cdbd6[_0x5833('0x56')][_0x5833('0x5f')]();}else if(_0x2cdbd6[_0x5833('0x5d')]===_0x5833('0x60')&&_0x2cdbd6[_0x5833('0x61')]&&_0x2cdbd6[_0x5833('0x62')]&&_0x42cc58[_0x2cdbd6[_0x5833('0x61')]]){_0x56b9f5[_0x2cdbd6['idField']]=_0x42cc58[_0x2cdbd6[_0x5833('0x61')]]['toString']();}else if(_0x2cdbd6[_0x5833('0x5d')]===_0x5833('0x63')&&_0x2cdbd6[_0x5833('0x64')]&&_0x2cdbd6[_0x5833('0x64')][_0x5833('0x65')]&&_0x2cdbd6[_0x5833('0x62')]&&_0x42cc58[_0x2cdbd6[_0x5833('0x64')][_0x5833('0x65')][_0x5833('0x66')]()]){_0x56b9f5[_0x2cdbd6[_0x5833('0x62')]]=_0x42cc58[_0x2cdbd6['Variable'][_0x5833('0x65')]['toLowerCase']()]['toString']();}});}return _0x56b9f5;}function getName(_0x5b4018){if(_0x5b4018[_0x5833('0x67')]('\x20')>0x0){var _0x2b1d8b=_0x5b4018[_0x5833('0x68')](/ (.+)/);if(_0x2b1d8b[0x1]){return _0x2b1d8b;}}return[_0x5b4018,_0x5b4018];}exports['queue']=function(_0x316776,_0x3a143e,_0x211209,_0x456529,_0x1daa25,_0x1180f7){var _0x3d4a93,_0x32dcc3;_0x1180f7[_0x5833('0x31')]=intUtil[_0x5833('0x69')](_0x1180f7[_0x5833('0x31')]);_0x1180f7[_0x5833('0x6a')]=intUtil[_0x5833('0x69')](_0x1180f7[_0x5833('0x6a')]);if(_0x1daa25&&_0x1daa25[_0x5833('0x6b')]){logger[_0x5833('0x3a')](_0x5833('0x6c'),_0x5833('0x6d'));_0x3a143e[_0x5833('0x6e')]=util[_0x5833('0x12')](_0x5833('0x6f'),_0x1180f7[_0x5833('0x6a')],_0x3a143e[_0x5833('0x70')],md5(_0x3a143e[_0x5833('0x70')]));}else{_0x3a143e['recordingURL']='';}return getUser(_0x1180f7,_0x456529[_0x5833('0x71')])['then'](function(_0x4455c5){_0x3d4a93=_0x4455c5;logger[_0x5833('0x3a')](_0x5833('0x72'),_0x3d4a93['id']);return getEndUser(_0x1180f7,_0x3a143e['calleridname'],_0x3a143e[_0x5833('0x73')]);})['then'](function(_0x242c9c){_0x32dcc3=_0x242c9c;logger[_0x5833('0x3a')]('The\x20Enduser\x20ID\x20is:',_0x32dcc3[_0x5833('0x27')]||_0x32dcc3[_0x5833('0x28')]);return getCall(_0x1180f7,_0x3d4a93,_0x32dcc3,_0x211209,_0x3a143e,_0x5833('0x74'));})[_0x5833('0x34')](function(_0x573df7){if(_0x573df7){logger[_0x5833('0x3a')](_0x5833('0x75'),_0x573df7['id']);logger[_0x5833('0x3a')]('[QUEUE]',_0x5833('0x76'));emit(util['format'](_0x5833('0x77'),_0x456529[_0x5833('0x65')]),_0x5833('0x78'),{'uri':util[_0x5833('0x12')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x1180f7['host'],_0x573df7['id'])});}})[_0x5833('0x79')](function(_0x589eb7){logger['error'](_0x5833('0x6c'),JSON['stringify'](_0x589eb7));});};exports[_0x5833('0x10')]=function(_0x4e33b7,_0x4021e3,_0x192be9,_0x5e528f,_0x5513b7,_0x457318,_0x128a7){var _0xf6ad7b,_0x473c7b;_0x457318[_0x5833('0x31')]=intUtil[_0x5833('0x69')](_0x457318['host']);_0x457318[_0x5833('0x6a')]=intUtil['stripTrailingSlash'](_0x457318[_0x5833('0x6a')]);if(_0x128a7&&_0x128a7[_0x5833('0x7a')]&&_0x128a7[_0x5833('0x7a')]!==_0x5833('0x7b')){logger['info'](_0x5833('0x7c'),_0x5833('0x6d'));_0x4021e3[_0x5833('0x6e')]=util[_0x5833('0x12')](_0x5833('0x6f'),_0x457318[_0x5833('0x6a')],_0x4021e3[_0x5833('0x70')],md5(_0x4021e3['uniqueid']));}return getUser(_0x457318,_0x5e528f['email'])[_0x5833('0x34')](function(_0x21058f){_0xf6ad7b=_0x21058f;logger[_0x5833('0x3a')](_0x5833('0x72'),_0xf6ad7b['id']);return getEndUser(_0x457318,_0x4021e3[_0x5833('0x7d')],_0x4021e3[_0x5833('0x7e')]);})[_0x5833('0x34')](function(_0x353804){_0x473c7b=_0x353804;logger[_0x5833('0x3a')](_0x5833('0x7f'),_0x473c7b[_0x5833('0x27')]||_0x473c7b[_0x5833('0x28')]);return getCall(_0x457318,_0xf6ad7b,_0x473c7b,_0x192be9,_0x4021e3,_0x5833('0x80'));})[_0x5833('0x34')](function(_0x3a765f){if(_0x3a765f){logger['info'](_0x5833('0x75'),_0x3a765f['id']);logger[_0x5833('0x3a')](_0x5833('0x7c'),_0x5833('0x76'));emit(util['format'](_0x5833('0x77'),_0x5e528f[_0x5833('0x65')]),_0x5833('0x78'),{'uri':util[_0x5833('0x12')](_0x5833('0x81'),_0x457318[_0x5833('0x31')],_0x3a765f['id'])});}})[_0x5833('0x79')](function(_0x642c1e){logger[_0x5833('0x4b')](_0x5833('0x7c'),JSON[_0x5833('0x3c')](_0x642c1e));});};exports[_0x5833('0x1f')]=function(_0x15b869,_0x22e3d1,_0xb97196,_0x45860e,_0x199b45,_0x372a84){var _0x5e77fe,_0x52ed7a;_0x372a84[_0x5833('0x31')]=intUtil[_0x5833('0x69')](_0x372a84[_0x5833('0x31')]);_0x372a84[_0x5833('0x6a')]=intUtil['stripTrailingSlash'](_0x372a84[_0x5833('0x6a')]);if(_0x199b45&&_0x199b45['monitor_format']){logger[_0x5833('0x3a')]('[ABANDONED]',_0x5833('0x6d'));_0x22e3d1['recordingURL']=util[_0x5833('0x12')](_0x5833('0x6f'),_0x372a84[_0x5833('0x6a')],_0x22e3d1[_0x5833('0x70')],md5(_0x22e3d1[_0x5833('0x70')]));}else{_0x22e3d1['recordingURL']='';}return getUser(_0x372a84)['then'](function(_0x153f67){_0x5e77fe=_0x153f67;logger[_0x5833('0x3a')](_0x5833('0x72'),_0x5e77fe['id']);return getEndUser(_0x372a84,_0x22e3d1[_0x5833('0x82')],_0x22e3d1[_0x5833('0x73')]);})[_0x5833('0x34')](function(_0x3d7594){_0x52ed7a=_0x3d7594;logger['info'](_0x5833('0x7f'),_0x52ed7a[_0x5833('0x27')]||_0x52ed7a['LEADID']);return getCall(_0x372a84,_0x5e77fe,_0x52ed7a,_0xb97196,_0x22e3d1,'Inbound');})['then'](function(_0x4abdab){if(_0x4abdab){logger[_0x5833('0x3a')](_0x5833('0x75'),_0x4abdab['id']);}})['catch'](function(_0x389a6e){logger['error'](_0x5833('0x83'),JSON['stringify'](_0x389a6e));});}; \ No newline at end of file +var _0xd7ee=['calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','[ABANDONED]','lodash','md5','./util','xml2json','entities','moment','ioredis','../../../../config/logger','zoho','redis','localhost','emit','application/json','info','merge','inbound','outbound','starttime','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Fields','Called','complete','connect','Answered','rejected','Call\x20Result','Rejected','abandoned','Abandoned','talktime','mm:ss','answertime','endtime','Call\x20Duration','utc','diff','CONTACTID','SEMODULE','SEID','LEADID','','hasOwnProperty','%s','','POST','host','crmapi','then','parse','toJson','response','result','recorddetail','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','authToken','user','zoho\x20data\x20users','isArrayLikeObject','log','users','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Contacts','row','length','val','content','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','encodeXML','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','debug','[HTTP]','forEach','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x341030,_0x10f8f1){var _0x24bb8e=function(_0x1c6453){while(--_0x1c6453){_0x341030['push'](_0x341030['shift']());}};_0x24bb8e(++_0x10f8f1);}(_0xd7ee,0x122));var _0xed7e=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0xd7ee[_0x499ca5];return _0x7bfd9c;};'use strict';var _=require(_0xed7e('0x0'));var rp=require('request-promise');var md5=require(_0xed7e('0x1'));var util=require('util');var intUtil=require(_0xed7e('0x2'));var parser=require(_0xed7e('0x3'));var entities=require(_0xed7e('0x4'));var moment=require(_0xed7e('0x5'));var Redis=require(_0xed7e('0x6'));var config=require('../../../../config/environment');var logger=require(_0xed7e('0x7'))(_0xed7e('0x8'));config[_0xed7e('0x9')]=_['defaults'](config[_0xed7e('0x9')],{'host':_0xed7e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xed7e('0x9')]));function emit(_0xb80363,_0x14404e,_0x8f0944){io['to'](_0xb80363)[_0xed7e('0xb')](_0x14404e,_0x8f0944);}var headers={'Content-Type':_0xed7e('0xc'),'Accept':_0xed7e('0xc')};function getCall(_0x19329c,_0x2dce7e,_0x26695b,_0xa02762,_0x3f76a6,_0x453c02){logger[_0xed7e('0xd')]('Creating\x20new\x20call...');var _0x42d0c3=_[_0xed7e('0xe')]({'SMOWNERID':_0x2dce7e['id'],'Call Type':_0x453c02||_0xed7e('0xf'),'Call Start Time':(_0x453c02===_0xed7e('0x10')?_0x3f76a6[_0xed7e('0x11')]:_0x3f76a6['agentcalledAt'])||moment()[_0xed7e('0x12')](_0xed7e('0x13')),'Subject':intUtil[_0xed7e('0x14')](_0xa02762[_0xed7e('0x15')],_0x3f76a6,'\x20'),'Description':intUtil[_0xed7e('0x14')](_0xa02762['Descriptions'],_0x3f76a6,'\x0a')},getCustomFields(_0xa02762[_0xed7e('0x16')],_0x3f76a6));switch(_0x3f76a6['lastevent']){case'called':_0x42d0c3['Call\x20Result']=_0xed7e('0x17');break;case _0xed7e('0x18'):case _0xed7e('0x19'):_0x42d0c3['Call\x20Result']=_0xed7e('0x1a');break;case _0xed7e('0x1b'):_0x42d0c3[_0xed7e('0x1c')]=_0xed7e('0x1d');break;case _0xed7e('0x1e'):_0x42d0c3[_0xed7e('0x1c')]=_0xed7e('0x1f');break;default:}if(_0x3f76a6[_0xed7e('0x20')]){_0x42d0c3['Call\x20Duration']=moment['utc'](parseInt(_0x3f76a6[_0xed7e('0x20')])*0x3e8)[_0xed7e('0x12')](_0xed7e('0x21'));}else if(_0x3f76a6[_0xed7e('0x22')]&&_0x3f76a6[_0xed7e('0x23')]){_0x42d0c3[_0xed7e('0x24')]=moment[_0xed7e('0x25')](moment(_0x3f76a6[_0xed7e('0x23')],_0xed7e('0x13'))[_0xed7e('0x26')](moment(_0x3f76a6[_0xed7e('0x11')],_0xed7e('0x13'))))[_0xed7e('0x12')](_0xed7e('0x21'));}if(_0x26695b[_0xed7e('0x27')]){_0x42d0c3[_0xed7e('0x27')]=_0x26695b[_0xed7e('0x27')];}else if(_0x26695b['LEADID']){_0x42d0c3[_0xed7e('0x28')]='Leads';_0x42d0c3[_0xed7e('0x29')]=_0x26695b[_0xed7e('0x2a')];}var _0x352a9b=_0xed7e('0x2b');for(var _0x2732b6 in _0x42d0c3){if(_0x42d0c3[_0xed7e('0x2c')](_0x2732b6)){_0x352a9b+=util[_0xed7e('0x12')](_0xed7e('0x2d'),entities['encodeXML'](_0x2732b6),entities['encodeXML'](_0x42d0c3[_0x2732b6]));}}_0x352a9b+=_0xed7e('0x2e');return request({'method':_0xed7e('0x2f'),'uri':util[_0xed7e('0x12')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x19329c[_0xed7e('0x30')]),'qs':{'authtoken':_0x19329c['authToken'],'scope':_0xed7e('0x31'),'xmlData':_0x352a9b},'json':!![]})[_0xed7e('0x32')](function(_0x350973){_0x350973=JSON[_0xed7e('0x33')](parser[_0xed7e('0x34')](_0x350973));if(_0x350973['response']){if(_0x350973[_0xed7e('0x35')][_0xed7e('0x36')]&&_0x350973['response'][_0xed7e('0x36')]['recorddetail']){logger[_0xed7e('0xd')]('Call\x20created!');return{'id':_0x350973[_0xed7e('0x35')]['result'][_0xed7e('0x37')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0xed7e('0x38')](_0x350973));});}function getUser(_0x5e18a2,_0x14adad){return request({'method':_0xed7e('0x39'),'uri':util[_0xed7e('0x12')](_0xed7e('0x3a'),_0x5e18a2[_0xed7e('0x30')]),'qs':{'type':_0xed7e('0x3b'),'authtoken':_0x5e18a2[_0xed7e('0x3c')],'scope':_0xed7e('0x31')},'json':!![]})[_0xed7e('0x32')](function(_0x4b6702){if(_0x4b6702['users']&&_0x4b6702['users'][_0xed7e('0x3d')]){var _0x5bbfa8;console['log'](_0xed7e('0x3e'),_0x4b6702['users'][_0xed7e('0x3d')]);if(_[_0xed7e('0x3f')](_0x4b6702['users'][_0xed7e('0x3d')])){console[_0xed7e('0x40')](_0xed7e('0x3e'),_0x4b6702[_0xed7e('0x41')]['user']);if(!_[_0xed7e('0x42')](_0x14adad)){_0x5bbfa8=_[_0xed7e('0x43')](_0x4b6702[_0xed7e('0x41')][_0xed7e('0x3d')],{'email':_0x14adad,'profile':_0xed7e('0x44'),'status':_0xed7e('0x45')});}if(!_[_0xed7e('0x42')](_0x5bbfa8)){logger[_0xed7e('0xd')](_0xed7e('0x46'));}else{logger[_0xed7e('0xd')](_0xed7e('0x47'));_0x5bbfa8=_['find'](_0x4b6702[_0xed7e('0x41')][_0xed7e('0x3d')],{'profile':_0xed7e('0x48')});}console[_0xed7e('0x40')](_0xed7e('0x49'),_0x5bbfa8);return _0x5bbfa8;}else{if(_0x4b6702[_0xed7e('0x41')][_0xed7e('0x3d')][_0xed7e('0x4a')]===_0xed7e('0x48')){logger[_0xed7e('0xd')](_0xed7e('0x47'));_0x5bbfa8=_0x4b6702[_0xed7e('0x41')][_0xed7e('0x3d')];return _0x5bbfa8;}else{logger['error'](_0xed7e('0x4b'),JSON[_0xed7e('0x38')](_0x4b6702));throw new Error(_0xed7e('0x4c')+JSON[_0xed7e('0x38')](_0x4b6702));}}}else{logger[_0xed7e('0x4d')](_0xed7e('0x4b'),JSON['stringify'](_0x4b6702));throw new Error(_0xed7e('0x4c')+JSON[_0xed7e('0x38')](_0x4b6702));}});}function getEndUser(_0x234fb1,_0x6f61a5,_0x5e5691){logger['info'](_0xed7e('0x4e'),_0x5e5691);return request({'method':_0xed7e('0x39'),'uri':util[_0xed7e('0x12')](_0xed7e('0x4f'),_0x234fb1[_0xed7e('0x30')]),'qs':{'authtoken':_0x234fb1[_0xed7e('0x3c')],'scope':_0xed7e('0x31'),'criteria':util[_0xed7e('0x12')](_0xed7e('0x50'),_0x5e5691)},'json':!![]})[_0xed7e('0x32')](function(_0x3b17cf){if(_0x3b17cf[_0xed7e('0x35')]&&_0x3b17cf['response']['result']){logger[_0xed7e('0xd')]('Enduser\x20found\x20in\x20Contacts!');var _0x40d980={};var _0x8c4a2=_0x3b17cf[_0xed7e('0x35')][_0xed7e('0x36')][_0xed7e('0x51')]['row']['no']?_0x3b17cf['response'][_0xed7e('0x36')][_0xed7e('0x51')][_0xed7e('0x52')]['FL']:_0x3b17cf['response']['result'][_0xed7e('0x51')][_0xed7e('0x52')][0x0]['FL'];for(var _0x35cca8=0x0,_0x10e5a4=_0x8c4a2[_0xed7e('0x53')];_0x35cca8<_0x10e5a4;_0x35cca8++){_0x40d980[_0x8c4a2[_0x35cca8][_0xed7e('0x54')]]=_0x8c4a2[_0x35cca8][_0xed7e('0x55')];}return _0x40d980;}else{return request({'method':'GET','uri':util['format']('https://crm.%s/crm/private/json/Leads/searchRecords',_0x234fb1[_0xed7e('0x30')]),'qs':{'authtoken':_0x234fb1['authToken'],'scope':'crmapi','criteria':util[_0xed7e('0x12')](_0xed7e('0x50'),_0x5e5691)},'json':!![]})[_0xed7e('0x32')](function(_0x11fced){if(_0x11fced[_0xed7e('0x35')]&&_0x11fced[_0xed7e('0x35')]['result']){logger[_0xed7e('0xd')]('Enduser\x20found\x20in\x20Leads!');var _0x4f4229={};var _0x2cd52b=_0x11fced[_0xed7e('0x35')][_0xed7e('0x36')]['Leads']['row']['no']?_0x11fced['response'][_0xed7e('0x36')]['Leads'][_0xed7e('0x52')]['FL']:_0x11fced['response']['result'][_0xed7e('0x56')][_0xed7e('0x52')][0x0]['FL'];for(var _0xefe46b=0x0,_0x45a262=_0x2cd52b[_0xed7e('0x53')];_0xefe46b<_0x45a262;_0xefe46b++){_0x4f4229[_0x2cd52b[_0xefe46b][_0xed7e('0x54')]]=_0x2cd52b[_0xefe46b][_0xed7e('0x55')];}return _0x4f4229;}else{logger['info'](_0xed7e('0x57'));_0x6f61a5=getName(_0x6f61a5);return request({'method':'POST','uri':util[_0xed7e('0x12')](_0xed7e('0x58'),_0x234fb1[_0xed7e('0x30')]),'qs':{'authtoken':_0x234fb1[_0xed7e('0x3c')],'scope':_0xed7e('0x31'),'xmlData':util['format'](_0xed7e('0x59'),entities[_0xed7e('0x5a')](_0x6f61a5[0x0]),entities[_0xed7e('0x5a')](_0x6f61a5[0x1]),_0x5e5691)},'json':!![]})[_0xed7e('0x32')](function(_0x46a2ca){_0x46a2ca=JSON[_0xed7e('0x33')](parser[_0xed7e('0x34')](_0x46a2ca));if(_0x46a2ca[_0xed7e('0x35')]){if(_0x46a2ca[_0xed7e('0x35')]['result']&&_0x46a2ca['response'][_0xed7e('0x36')][_0xed7e('0x37')]){logger[_0xed7e('0xd')](_0xed7e('0x5b'));return request({'method':'GET','uri':util[_0xed7e('0x12')](_0xed7e('0x5c'),_0x234fb1[_0xed7e('0x30')]),'qs':{'authtoken':_0x234fb1[_0xed7e('0x3c')],'scope':_0xed7e('0x31'),'id':_0x46a2ca[_0xed7e('0x35')]['result'][_0xed7e('0x37')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xed7e('0x5d')+JSON['stringify'](_0x46a2ca));})[_0xed7e('0x32')](function(_0x2035e6){if(_0x2035e6[_0xed7e('0x35')]){if(_0x2035e6[_0xed7e('0x35')][_0xed7e('0x36')]){var _0x176dc3={};for(var _0x5963f3=0x0,_0x1dab1c=_0x2035e6[_0xed7e('0x35')]['result'][_0xed7e('0x56')]['row']['FL'][_0xed7e('0x53')];_0x5963f3<_0x1dab1c;_0x5963f3++){_0x176dc3[_0x2035e6['response']['result']['Leads']['row']['FL'][_0x5963f3][_0xed7e('0x54')]]=_0x2035e6[_0xed7e('0x35')][_0xed7e('0x36')][_0xed7e('0x56')]['row']['FL'][_0x5963f3][_0xed7e('0x55')];}return _0x176dc3;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0xed7e('0x38')](_0x2035e6));});}});}});}function request(_0x379bec){logger[_0xed7e('0x5e')](_0xed7e('0x5f'),JSON[_0xed7e('0x38')](_0x379bec));return rp(_0x379bec);}function getCustomFields(_0x578d70,_0x56767e){var _0xab1b47={};if(_0x578d70[_0xed7e('0x53')]>0x0){_[_0xed7e('0x60')](_0x578d70,function(_0x3a55b3){if(_0x3a55b3['type']==='string'&&_0x3a55b3[_0xed7e('0x61')]){_0xab1b47[_0x3a55b3[_0xed7e('0x61')]]=_0x3a55b3[_0xed7e('0x55')][_0xed7e('0x62')]();}else if(_0x3a55b3[_0xed7e('0x63')]===_0xed7e('0x64')&&_0x3a55b3[_0xed7e('0x65')]&&_0x3a55b3[_0xed7e('0x61')]&&_0x56767e[_0x3a55b3[_0xed7e('0x65')]]){_0xab1b47[_0x3a55b3[_0xed7e('0x61')]]=_0x56767e[_0x3a55b3[_0xed7e('0x65')]]['toString']();}else if(_0x3a55b3[_0xed7e('0x63')]===_0xed7e('0x66')&&_0x3a55b3[_0xed7e('0x67')]&&_0x3a55b3[_0xed7e('0x67')]['name']&&_0x3a55b3[_0xed7e('0x61')]&&_0x56767e[_0x3a55b3[_0xed7e('0x67')][_0xed7e('0x68')]['toLowerCase']()]){_0xab1b47[_0x3a55b3[_0xed7e('0x61')]]=_0x56767e[_0x3a55b3['Variable']['name'][_0xed7e('0x69')]()][_0xed7e('0x62')]();}});}return _0xab1b47;}function getName(_0x18b335){if(_0x18b335[_0xed7e('0x6a')]('\x20')>0x0){var _0x52e2ab=_0x18b335[_0xed7e('0x6b')](/ (.+)/);if(_0x52e2ab[0x1]){return _0x52e2ab;}}return[_0x18b335,_0x18b335];}exports[_0xed7e('0x6c')]=function(_0x3cc400,_0x2c106e,_0x56ae5c,_0x51673e,_0x14b894,_0x31f8e9){var _0x128f29,_0x12b6ba;_0x31f8e9[_0xed7e('0x30')]=intUtil[_0xed7e('0x6d')](_0x31f8e9['host']);_0x31f8e9[_0xed7e('0x6e')]=intUtil[_0xed7e('0x6d')](_0x31f8e9['serverUrl']);if(_0x14b894&&_0x14b894[_0xed7e('0x6f')]){logger[_0xed7e('0xd')](_0xed7e('0x70'),_0xed7e('0x71'));_0x2c106e[_0xed7e('0x72')]=util[_0xed7e('0x12')](_0xed7e('0x73'),_0x31f8e9['serverUrl'],_0x2c106e['uniqueid'],md5(_0x2c106e[_0xed7e('0x74')]));}else{_0x2c106e[_0xed7e('0x72')]='';}return getUser(_0x31f8e9,_0x51673e[_0xed7e('0x75')])[_0xed7e('0x32')](function(_0x54c311){_0x128f29=_0x54c311;logger[_0xed7e('0xd')]('The\x20User\x20ID\x20is:',_0x128f29['id']);return getEndUser(_0x31f8e9,_0x2c106e[_0xed7e('0x76')],_0x2c106e[_0xed7e('0x77')]);})['then'](function(_0x22a267){_0x12b6ba=_0x22a267;logger['info'](_0xed7e('0x78'),_0x12b6ba[_0xed7e('0x27')]||_0x12b6ba[_0xed7e('0x2a')]);return getCall(_0x31f8e9,_0x128f29,_0x12b6ba,_0x56ae5c,_0x2c106e,_0xed7e('0x79'));})[_0xed7e('0x32')](function(_0x48a159){if(_0x48a159){logger['info'](_0xed7e('0x7a'),_0x48a159['id']);logger['info']('[QUEUE]',_0xed7e('0x7b'));emit(util[_0xed7e('0x12')](_0xed7e('0x7c'),_0x51673e[_0xed7e('0x68')]),_0xed7e('0x7d'),{'uri':util[_0xed7e('0x12')](_0xed7e('0x7e'),_0x31f8e9[_0xed7e('0x30')],_0x48a159['id'])});}})[_0xed7e('0x7f')](function(_0x2aa279){logger['error'](_0xed7e('0x70'),JSON['stringify'](_0x2aa279));});};exports[_0xed7e('0x10')]=function(_0xb13799,_0x132b59,_0x3a6e5f,_0xd3d966,_0x97852b,_0x4fcf19,_0x1cc10e){var _0x2e8a4b,_0x8f0f09;_0x4fcf19[_0xed7e('0x30')]=intUtil[_0xed7e('0x6d')](_0x4fcf19['host']);_0x4fcf19[_0xed7e('0x6e')]=intUtil[_0xed7e('0x6d')](_0x4fcf19[_0xed7e('0x6e')]);if(_0x1cc10e&&_0x1cc10e[_0xed7e('0x80')]&&_0x1cc10e[_0xed7e('0x80')]!==_0xed7e('0x81')){logger[_0xed7e('0xd')]('[OUTBOUND]',_0xed7e('0x71'));_0x132b59[_0xed7e('0x72')]=util[_0xed7e('0x12')](_0xed7e('0x73'),_0x4fcf19[_0xed7e('0x6e')],_0x132b59[_0xed7e('0x74')],md5(_0x132b59[_0xed7e('0x74')]));}return getUser(_0x4fcf19,_0xd3d966['email'])[_0xed7e('0x32')](function(_0x3bbd39){_0x2e8a4b=_0x3bbd39;logger[_0xed7e('0xd')](_0xed7e('0x82'),_0x2e8a4b['id']);return getEndUser(_0x4fcf19,_0x132b59[_0xed7e('0x83')],_0x132b59[_0xed7e('0x84')]);})[_0xed7e('0x32')](function(_0x2bf4f1){_0x8f0f09=_0x2bf4f1;logger['info'](_0xed7e('0x78'),_0x8f0f09['CONTACTID']||_0x8f0f09[_0xed7e('0x2a')]);return getCall(_0x4fcf19,_0x2e8a4b,_0x8f0f09,_0x3a6e5f,_0x132b59,_0xed7e('0x85'));})[_0xed7e('0x32')](function(_0x42a056){if(_0x42a056){logger[_0xed7e('0xd')](_0xed7e('0x7a'),_0x42a056['id']);logger[_0xed7e('0xd')](_0xed7e('0x86'),_0xed7e('0x7b'));emit(util['format'](_0xed7e('0x7c'),_0xd3d966[_0xed7e('0x68')]),_0xed7e('0x7d'),{'uri':util['format'](_0xed7e('0x7e'),_0x4fcf19['host'],_0x42a056['id'])});}})[_0xed7e('0x7f')](function(_0x352804){logger[_0xed7e('0x4d')]('[OUTBOUND]',JSON['stringify'](_0x352804));});};exports[_0xed7e('0x1e')]=function(_0xb5af61,_0x27d42a,_0x1a768d,_0x4dc4a3,_0x525f86,_0x2b6916){var _0x18f805,_0x2aadfe;_0x2b6916[_0xed7e('0x30')]=intUtil[_0xed7e('0x6d')](_0x2b6916[_0xed7e('0x30')]);_0x2b6916[_0xed7e('0x6e')]=intUtil[_0xed7e('0x6d')](_0x2b6916[_0xed7e('0x6e')]);if(_0x525f86&&_0x525f86['monitor_format']){logger[_0xed7e('0xd')](_0xed7e('0x87'),_0xed7e('0x71'));_0x27d42a[_0xed7e('0x72')]=util[_0xed7e('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b6916[_0xed7e('0x6e')],_0x27d42a['uniqueid'],md5(_0x27d42a['uniqueid']));}else{_0x27d42a[_0xed7e('0x72')]='';}return getUser(_0x2b6916)[_0xed7e('0x32')](function(_0x224a71){_0x18f805=_0x224a71;logger[_0xed7e('0xd')](_0xed7e('0x82'),_0x18f805['id']);return getEndUser(_0x2b6916,_0x27d42a[_0xed7e('0x76')],_0x27d42a[_0xed7e('0x77')]);})[_0xed7e('0x32')](function(_0x35cc72){_0x2aadfe=_0x35cc72;logger[_0xed7e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2aadfe['CONTACTID']||_0x2aadfe[_0xed7e('0x2a')]);return getCall(_0x2b6916,_0x18f805,_0x2aadfe,_0x1a768d,_0x27d42a,_0xed7e('0x79'));})['then'](function(_0x5072b4){if(_0x5072b4){logger[_0xed7e('0xd')](_0xed7e('0x7a'),_0x5072b4['id']);}})[_0xed7e('0x7f')](function(_0x2772b8){logger[_0xed7e('0x4d')](_0xed7e('0x87'),JSON[_0xed7e('0x38')](_0x2772b8));});}; \ 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 f86e7e2..d9ce82a 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(_0x50d72f,_0x3ef17f){var _0x58ceac=function(_0x4c8f75){while(--_0x4c8f75){_0x50d72f['push'](_0x50d72f['shift']());}};_0x58ceac(++_0x3ef17f);}(_0x7a54,0x106));var _0x47a5=function(_0x2b12b3,_0x353481){_0x2b12b3=_0x2b12b3-0x0;var _0x3e1bee=_0x7a54[_0x2b12b3];return _0x3e1bee;};'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(_0x4e97ef,_0x2d5c80){var _0x2f5eaa=function(_0x33e9e1){while(--_0x33e9e1){_0x4e97ef['push'](_0x4e97ef['shift']());}};_0x2f5eaa(++_0x2d5c80);}(_0x7a54,0x106));var _0x47a5=function(_0x1cd7f1,_0x3d0ae8){_0x1cd7f1=_0x1cd7f1-0x0;var _0x104fb4=_0x7a54[_0x1cd7f1];return _0x104fb4;};'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 705f345..28dd53c 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 _0xb9e7=['statusCode','error','name','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','headers','data6','stack','GET','data7','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','then','isNil',',\x20request\x20body:\x20','body','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0xb9e7,0x1df));var _0x7b9e=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xb9e7[_0xdc37a1];return _0x99b4fe;};'use strict';var rp=require('request-promise');var util=require(_0x7b9e('0x0'));var _=require(_0x7b9e('0x1'));var Mustache=require(_0x7b9e('0x2'));var logger=require(_0x7b9e('0x3'))(_0x7b9e('0x4'));exports[_0x7b9e('0x5')]=function(_0x4fbecd,_0x2580f9){var _0x5f2554,_0x4c697c;var _0x2372ee={'method':_0x4fbecd['data1'][_0x7b9e('0x6')](),'uri':encodeURI(Mustache[_0x7b9e('0x7')](_0x4fbecd[_0x7b9e('0x8')],_0x2580f9)),'json':!![],'resolveWithFullResponse':!![]};try{_0x2372ee[_0x7b9e('0x9')]=_0x4fbecd[_0x7b9e('0xa')]?JSON['parse'](Mustache[_0x7b9e('0x7')](_0x4fbecd[_0x7b9e('0xa')],_0x2580f9)):{};}catch(_0xb35b20){logger['error'](_0xb35b20[_0x7b9e('0xb')]);}switch(_0x4fbecd['data1'][_0x7b9e('0x6')]()){case _0x7b9e('0xc'):_0x2372ee['qs']=_0x2580f9;break;case'POST':case'PUT':_0x5f2554={};if(_0x4fbecd[_0x7b9e('0xd')]){_0x5f2554=Mustache['render'](_0x4fbecd[_0x7b9e('0xd')],_0x2580f9);}else{_0x5f2554=_0x2580f9;}_0x2372ee['body']=JSON['parse'](_0x5f2554);break;}logger['info'](util[_0x7b9e('0xe')](_0x7b9e('0xf'),_0x4fbecd[_0x7b9e('0x10')],_0x4fbecd[_0x7b9e('0x8')],JSON['stringify'](_0x2372ee)));rp(_0x2372ee)[_0x7b9e('0x11')](function(_0x1fa0e8){_0x5f2554=!_[_0x7b9e('0x12')](_0x5f2554)?_0x7b9e('0x13')+_0x5f2554:'';_0x4c697c=typeof _0x1fa0e8[_0x7b9e('0x14')]===_0x7b9e('0x15')?JSON[_0x7b9e('0x16')](_0x1fa0e8[_0x7b9e('0x14')]):_0x1fa0e8[_0x7b9e('0x14')];logger[_0x7b9e('0x17')](util['format'](_0x7b9e('0x18'),_0x4fbecd['data1'],_0x4fbecd[_0x7b9e('0x8')],_0x1fa0e8[_0x7b9e('0x19')],_0x4c697c));})['catch'](function(_0x447269){logger[_0x7b9e('0x1a')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x4fbecd[_0x7b9e('0x10')],_0x4fbecd[_0x7b9e('0x8')],_0x447269[_0x7b9e('0x19')],_0x447269[_0x7b9e('0x1b')],_0x447269['message']));});}; \ No newline at end of file +var _0x174b=['trigger','exec','data1','toUpperCase','render','data2','headers','data6','parse','error','POST','data7','body','info','format','stringify','then','isNil','object','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','mustache','../../../../config/logger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x174b,0x19d));var _0xb174=function(_0x36ccc7,_0x5b86d5){_0x36ccc7=_0x36ccc7-0x0;var _0xa9ab06=_0x174b[_0x36ccc7];return _0xa9ab06;};'use strict';var rp=require(_0xb174('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0xb174('0x1'));var logger=require(_0xb174('0x2'))(_0xb174('0x3'));exports[_0xb174('0x4')]=function(_0xe89462,_0x3c1d7d){var _0x553d1b,_0x515f54;var _0x1bfe22={'method':_0xe89462[_0xb174('0x5')][_0xb174('0x6')](),'uri':encodeURI(Mustache[_0xb174('0x7')](_0xe89462[_0xb174('0x8')],_0x3c1d7d)),'json':!![],'resolveWithFullResponse':!![]};try{_0x1bfe22[_0xb174('0x9')]=_0xe89462[_0xb174('0xa')]?JSON[_0xb174('0xb')](Mustache[_0xb174('0x7')](_0xe89462[_0xb174('0xa')],_0x3c1d7d)):{};}catch(_0x4c3cea){logger[_0xb174('0xc')](_0x4c3cea['stack']);}switch(_0xe89462[_0xb174('0x5')][_0xb174('0x6')]()){case'GET':_0x1bfe22['qs']=_0x3c1d7d;break;case _0xb174('0xd'):case'PUT':_0x553d1b={};if(_0xe89462[_0xb174('0xe')]){_0x553d1b=Mustache[_0xb174('0x7')](_0xe89462['data7'],_0x3c1d7d);}else{_0x553d1b=_0x3c1d7d;}_0x1bfe22[_0xb174('0xf')]=JSON[_0xb174('0xb')](_0x553d1b);break;}logger[_0xb174('0x10')](util[_0xb174('0x11')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xe89462[_0xb174('0x5')],_0xe89462['data2'],JSON[_0xb174('0x12')](_0x1bfe22)));rp(_0x1bfe22)[_0xb174('0x13')](function(_0x40f7bc){_0x553d1b=!_[_0xb174('0x14')](_0x553d1b)?',\x20request\x20body:\x20'+_0x553d1b:'';_0x515f54=typeof _0x40f7bc[_0xb174('0xf')]===_0xb174('0x15')?JSON[_0xb174('0x12')](_0x40f7bc[_0xb174('0xf')]):_0x40f7bc[_0xb174('0xf')];logger[_0xb174('0x10')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xe89462['data1'],_0xe89462['data2'],_0x40f7bc[_0xb174('0x16')],_0x515f54));})['catch'](function(_0xaf80a9){logger[_0xb174('0xc')](util['format'](_0xb174('0x17'),_0xe89462[_0xb174('0x5')],_0xe89462[_0xb174('0x8')],_0xaf80a9[_0xb174('0x16')],_0xaf80a9[_0xb174('0x18')],_0xaf80a9[_0xb174('0x19')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index ab879c9..9ebb0ba 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 _0x562d=['exports','jayson/promise','bluebird','../../config/logger','http','Request','then','debug','rpc','routing','error','message','result','catch'];(function(_0x49fd4c,_0x23f15e){var _0x34a89b=function(_0x22df17){while(--_0x22df17){_0x49fd4c['push'](_0x49fd4c['shift']());}};_0x34a89b(++_0x23f15e);}(_0x562d,0xe1));var _0xd562=function(_0x25ffc1,_0x2fd13e){_0x25ffc1=_0x25ffc1-0x0;var _0x161e0e=_0x562d[_0x25ffc1];return _0x161e0e;};'use strict';var jayson=require(_0xd562('0x0'));var BPromise=require(_0xd562('0x1'));var logger=require(_0xd562('0x2'))('routing');var client=jayson['client'][_0xd562('0x3')]({'port':0x2329});client[_0xd562('0x4')]=function(_0x73c3fa,_0x4c6430){return new BPromise(function(_0xf71ee1,_0x5a8157){return client['request'](_0x73c3fa,_0x4c6430)[_0xd562('0x5')](function(_0x46bf9b){logger[_0xd562('0x6')](_0xd562('0x7'),_0xd562('0x8'),_0x73c3fa,_0x4c6430,_0x46bf9b);if(_0x46bf9b[_0xd562('0x9')]){logger['error'](_0xd562('0x7'),'routing',_0x73c3fa,_0x46bf9b[_0xd562('0x9')][_0xd562('0xa')],_0x4c6430);return _0x5a8157(_0x46bf9b[_0xd562('0x9')][_0xd562('0xa')]);}else{return _0xf71ee1(_0x46bf9b[_0xd562('0xb')]);}})[_0xd562('0xc')](function(_0x381265){logger[_0xd562('0x9')](_0xd562('0x7'),_0xd562('0x8'),_0x73c3fa,_0x381265,_0x4c6430);return _0x5a8157(_0x381265);});});};module[_0xd562('0xd')]=client; \ No newline at end of file +var _0x5b7f=['client','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x3150b9,_0x2d58c9){_0x3150b9=_0x3150b9-0x0;var _0x5d8c56=_0x5b7f[_0x3150b9];return _0x5d8c56;};'use strict';var jayson=require(_0xf5b7('0x0'));var BPromise=require(_0xf5b7('0x1'));var logger=require(_0xf5b7('0x2'))(_0xf5b7('0x3'));var client=jayson[_0xf5b7('0x4')][_0xf5b7('0x5')]({'port':0x2329});client[_0xf5b7('0x6')]=function(_0x2ae04f,_0x2c5439){return new BPromise(function(_0x2dfb67,_0x3c1efc){return client[_0xf5b7('0x7')](_0x2ae04f,_0x2c5439)[_0xf5b7('0x8')](function(_0x984337){logger[_0xf5b7('0x9')](_0xf5b7('0xa'),_0xf5b7('0x3'),_0x2ae04f,_0x2c5439,_0x984337);if(_0x984337[_0xf5b7('0xb')]){logger['error']('rpc','routing',_0x2ae04f,_0x984337[_0xf5b7('0xb')][_0xf5b7('0xc')],_0x2c5439);return _0x3c1efc(_0x984337[_0xf5b7('0xb')][_0xf5b7('0xc')]);}else{return _0x2dfb67(_0x984337[_0xf5b7('0xd')]);}})[_0xf5b7('0xe')](function(_0x34d5f3){logger[_0xf5b7('0xb')](_0xf5b7('0xa'),_0xf5b7('0x3'),_0x2ae04f,_0x34d5f3,_0x2c5439);return _0x3c1efc(_0x34d5f3);});});};module[_0xf5b7('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 377390c..0c172fd 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 _0x6356=['resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','catch','./server','./lib/email','./rpc/mailAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6356,0x189));var _0x6635=function(_0x253d2b,_0x49a0fb){_0x253d2b=_0x253d2b-0x0;var _0x3ce8bd=_0x6356[_0x253d2b];return _0x3ce8bd;};'use strict';var BPromise=require('bluebird');var server=require(_0x6635('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x6635('0x1'));var mailAccount=require(_0x6635('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6635('0x3')]()['then'](mailAccount[_0x6635('0x4')]())[_0x6635('0x5')](realtime[_0x6635('0x6')]())[_0x6635('0x5')](function(){email[_0x6635('0x7')](realtime[_0x6635('0x8')]);return realtime;});}function main(){return server[_0x6635('0x9')](realtime,email)['then'](function(_0x25c5fb){return initRealtime();})['then'](function(_0xd8df2f){return setInterval(initRealtime,0x2710);})[_0x6635('0xa')](function(_0x4baecc){console['log'](_0x4baecc);});}main(); \ No newline at end of file +var _0x8e48=['catch','log','./server','./realtime','./lib/email','resolve','then','initMailAccounts','refresh','listen'];(function(_0x2ca513,_0x58361b){var _0x331f29=function(_0x200b6c){while(--_0x200b6c){_0x2ca513['push'](_0x2ca513['shift']());}};_0x331f29(++_0x58361b);}(_0x8e48,0x124));var _0x88e4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8e48[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var server=require(_0x88e4('0x0'));var Realtime=require(_0x88e4('0x1'));var EmailChannel=require(_0x88e4('0x2'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x88e4('0x3')]()[_0x88e4('0x4')](mailAccount['getMailAccounts']())[_0x88e4('0x4')](realtime[_0x88e4('0x5')]())[_0x88e4('0x4')](function(){email[_0x88e4('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x88e4('0x7')](realtime,email)[_0x88e4('0x4')](function(_0x1a4d10){return initRealtime();})[_0x88e4('0x4')](function(_0x10450b){return setInterval(initRealtime,0x2710);})[_0x88e4('0x8')](function(_0x5383a9){console[_0x88e4('0x9')](_0x5383a9);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index df45b7a..c32b999 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 _0xf0f4=['sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','moment','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','isNil','disabled','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','lastSync','handleImapError'];(function(_0x50a8b5,_0x396584){var _0x2628da=function(_0x4dbb58){while(--_0x4dbb58){_0x50a8b5['push'](_0x50a8b5['shift']());}};_0x2628da(++_0x396584);}(_0xf0f4,0x182));var _0x4f0f=function(_0x1391f5,_0x4c5d26){_0x1391f5=_0x1391f5-0x0;var _0x21cd7b=_0xf0f4[_0x1391f5];return _0x21cd7b;};'use strict';var _=require('lodash');var moment=require(_0x4f0f('0x0'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x4f0f('0x1'));var config=require(_0x4f0f('0x2'));var logger=require('../../../config/logger')(_0x4f0f('0x3'));config[_0x4f0f('0x4')]=_[_0x4f0f('0x5')](config[_0x4f0f('0x4')],{'host':_0x4f0f('0x6'),'port':0x18eb});var io=require(_0x4f0f('0x7'))(new Redis(config[_0x4f0f('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x4f0f('0x8'));var mailAccount=require(_0x4f0f('0x9'));var md5Accounts={};function EmailChannel(_0x95b1cf){logger['info'](_0x4f0f('0xa'));this[_0x4f0f('0xb')]=_0x95b1cf[_0x4f0f('0xb')];this[_0x4f0f('0xc')]={};this[_0x4f0f('0xd')]=new EmailSmtp();}EmailChannel[_0x4f0f('0xe')][_0x4f0f('0xf')]=function(_0x2b2e49){var _0x4bf11d=this[_0x4f0f('0xb')][_0x2b2e49];var _0x315d01={'id':_0x4bf11d['id'],'name':_0x4bf11d[_0x4f0f('0x10')],'key':_0x4bf11d[_0x4f0f('0x11')],'active':_0x4bf11d[_0x4f0f('0x12')],'Imap':{'status':_0x4bf11d[_0x4f0f('0x13')][_0x4f0f('0x14')],'messageStatus':_0x4bf11d[_0x4f0f('0x13')][_0x4f0f('0x15')],'total':_0x4bf11d[_0x4f0f('0x13')][_0x4f0f('0x16')]}};if(_['isNil'](md5Accounts[_0x2b2e49])){md5Accounts[_0x2b2e49]={};}var _0xebecc0=md5(JSON[_0x4f0f('0x17')](_0x315d01));if(md5Accounts[_0x2b2e49][_0x4f0f('0x18')]!==_0xebecc0){md5Accounts[_0x2b2e49][_0x4f0f('0x18')]=_0xebecc0;io['emit'](_0x4f0f('0x19'),_0x315d01);}};EmailChannel[_0x4f0f('0xe')][_0x4f0f('0x1a')]=function(_0x1c0aa1){for(var _0x4038fd in _0x1c0aa1){if(_0x1c0aa1['hasOwnProperty'](_0x4038fd)){if(_0x1c0aa1[_0x4038fd][_0x4f0f('0x13')]&&_0x1c0aa1[_0x4038fd][_0x4f0f('0x12')]){var _0x20423e=_0x1c0aa1[_0x4038fd]['Imap'];if(!this[_0x4f0f('0xc')][_0x4f0f('0x1b')](_0x20423e['id'])){this[_0x4f0f('0xc')][_0x20423e['id']]=new EmailImap(_0x20423e,_0x1c0aa1[_0x4038fd]['email']);this[_0x4f0f('0xc')][_0x20423e['id']]['on'](_0x4f0f('0x1c'),this[_0x4f0f('0x1d')][_0x4f0f('0x1e')](this,_0x4038fd));this[_0x4f0f('0xc')][_0x20423e['id']]['on'](_0x4f0f('0x3'),this['handleImapEmail'][_0x4f0f('0x1e')](this,_0x4038fd));this['imapAccounts'][_0x20423e['id']]['on'](_0x4f0f('0x1f'),this[_0x4f0f('0x20')]['bind'](this,_0x4038fd));this['imapAccounts'][_0x20423e['id']]['on'](_0x4f0f('0x21'),this['handleImapError'][_0x4f0f('0x1e')](this,_0x4038fd));}}else{if(_[_0x4f0f('0x22')](this[_0x4f0f('0xb')][_0x4038fd][_0x4f0f('0x13')])){this[_0x4f0f('0xb')][_0x4038fd][_0x4f0f('0x13')]={};}this['mailAccounts'][_0x4038fd][_0x4f0f('0x13')][_0x4f0f('0x14')]=_0x4f0f('0x23');this[_0x4f0f('0xb')][_0x4038fd][_0x4f0f('0x13')][_0x4f0f('0x15')]='';this[_0x4f0f('0xf')](_0x4038fd);}}}};EmailChannel[_0x4f0f('0xe')][_0x4f0f('0x1d')]=function(_0xb20be9,_0x37ae8f){if(this[_0x4f0f('0xb')][_0xb20be9]){this[_0x4f0f('0xb')][_0xb20be9]['Imap'][_0x4f0f('0x14')]=_0x4f0f('0x24');this[_0x4f0f('0xb')][_0xb20be9]['Imap'][_0x4f0f('0x15')]=_0x37ae8f['name'];if(_0x37ae8f[_0x4f0f('0x25')]){this[_0x4f0f('0xb')][_0xb20be9]['Imap']['total']=_0x37ae8f[_0x4f0f('0x25')]['total'];}return this[_0x4f0f('0xf')](_0xb20be9);}};EmailChannel[_0x4f0f('0xe')]['handleImapEmail']=function(_0x3d3762,_0xf7acac){logger[_0x4f0f('0x26')](_0x4f0f('0x27'),_0xf7acac['firstName'],_0xf7acac[_0x4f0f('0x28')],_0xf7acac[_0x4f0f('0x29')],_0x3d3762);if(this[_0x4f0f('0xb')][_0x3d3762]){return mailAccount[_0x4f0f('0x2a')](_0x3d3762,_0xf7acac)['then'](function(_0xd987c4){if(_0xd987c4){logger[_0x4f0f('0x26')](_0x4f0f('0x2b'));}})['catch'](function(_0x3724fc){logger[_0x4f0f('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4f0f('0x17')](_0x3724fc));});}};EmailChannel[_0x4f0f('0xe')][_0x4f0f('0x20')]=function(_0x341c6c){if(this['mailAccounts'][_0x341c6c]&&this[_0x4f0f('0xb')][_0x341c6c][_0x4f0f('0x13')]){if(this[_0x4f0f('0xc')][this[_0x4f0f('0xb')][_0x341c6c][_0x4f0f('0x13')]['id']]){delete this[_0x4f0f('0xc')][this[_0x4f0f('0xb')][_0x341c6c][_0x4f0f('0x13')]['id']];}this['mailAccounts'][_0x341c6c][_0x4f0f('0x13')][_0x4f0f('0x2c')]=moment();this[_0x4f0f('0xf')](_0x341c6c);}};EmailChannel[_0x4f0f('0xe')][_0x4f0f('0x2d')]=function(_0x3e2cb6,_0x1849ca){if(this['mailAccounts'][_0x3e2cb6]){this[_0x4f0f('0xb')][_0x3e2cb6][_0x4f0f('0x13')][_0x4f0f('0x14')]='error';this[_0x4f0f('0xb')][_0x3e2cb6]['Imap'][_0x4f0f('0x15')]=_0x1849ca;return this['emit'](_0x3e2cb6);}};EmailChannel[_0x4f0f('0xe')][_0x4f0f('0x2e')]=function(_0x516152,_0x76277b){return this[_0x4f0f('0xd')][_0x4f0f('0x2f')](_0x516152,_0x76277b);};EmailChannel['prototype'][_0x4f0f('0x30')]=function(_0xda7adc){var _0x3484ce=this;if(this[_0x4f0f('0xb')][_0xda7adc['id']]){if(_[_0x4f0f('0x22')](this[_0x4f0f('0xb')][_0xda7adc['id']][_0x4f0f('0x31')])){this[_0x4f0f('0xb')][_0xda7adc['id']][_0x4f0f('0x31')]={};}this[_0x4f0f('0xb')][_0xda7adc['id']][_0x4f0f('0x31')]['lastSync']=moment();return new BPromise(function(_0x3cf571,_0x2bae21){return _0x3484ce[_0x4f0f('0xd')][_0x4f0f('0x32')](_0xda7adc)[_0x4f0f('0x33')](function(_0x178d74){_0x3484ce[_0x4f0f('0xb')][_0xda7adc['id']]['Smtp'][_0x4f0f('0x14')]=_0x4f0f('0x34');_0x3484ce[_0x4f0f('0xb')][_0xda7adc['id']][_0x4f0f('0x31')][_0x4f0f('0x15')]='';_0x3484ce[_0x4f0f('0xf')](_0xda7adc['id']);_0x3cf571(_0x178d74);})['catch'](function(_0x225f84){_0x3484ce[_0x4f0f('0xb')][_0xda7adc['id']]['Smtp']['status']=_0x4f0f('0x21');_0x3484ce[_0x4f0f('0xb')][_0xda7adc['id']][_0x4f0f('0x31')]['messageStatus']=_0x225f84;_0x3484ce[_0x4f0f('0xf')](_0xda7adc['id']);_0x2bae21(_0x225f84);});});}return this['smtp']['verify'](_0xda7adc);};module[_0x4f0f('0x35')]=EmailChannel; \ No newline at end of file +var _0x38b8=['prototype','refresh','hasOwnProperty','imapAccounts','email','box','handleImapBox','handleImapEmail','end','handleImapEnd','bind','error','handleImapError','messages','info','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','../../../config/environment','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','emit','name','active','Imap','status','messageStatus','total','isNil'];(function(_0x181ba8,_0x53c329){var _0x589cff=function(_0x1681dd){while(--_0x1681dd){_0x181ba8['push'](_0x181ba8['shift']());}};_0x589cff(++_0x53c329);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var moment=require('moment');var BPromise=require(_0x838b('0x1'));var md5=require(_0x838b('0x2'));var Redis=require('ioredis');var config=require(_0x838b('0x3'));var logger=require('../../../config/logger')('email');config[_0x838b('0x4')]=_[_0x838b('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x838b('0x6'))(new Redis(config[_0x838b('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x838b('0x7'));var mailAccount=require(_0x838b('0x8'));var md5Accounts={};function EmailChannel(_0x4b9530){logger['info'](_0x838b('0x9'));this[_0x838b('0xa')]=_0x4b9530[_0x838b('0xa')];this['imapAccounts']={};this[_0x838b('0xb')]=new EmailSmtp();}EmailChannel['prototype'][_0x838b('0xc')]=function(_0x24ce13){var _0x106516=this[_0x838b('0xa')][_0x24ce13];var _0x241e6a={'id':_0x106516['id'],'name':_0x106516[_0x838b('0xd')],'key':_0x106516['key'],'active':_0x106516[_0x838b('0xe')],'Imap':{'status':_0x106516[_0x838b('0xf')][_0x838b('0x10')],'messageStatus':_0x106516[_0x838b('0xf')][_0x838b('0x11')],'total':_0x106516[_0x838b('0xf')][_0x838b('0x12')]}};if(_[_0x838b('0x13')](md5Accounts[_0x24ce13])){md5Accounts[_0x24ce13]={};}var _0x1ddf43=md5(JSON['stringify'](_0x241e6a));if(md5Accounts[_0x24ce13][_0x838b('0x2')]!==_0x1ddf43){md5Accounts[_0x24ce13]['md5']=_0x1ddf43;io['emit']('mailAccount:update',_0x241e6a);}};EmailChannel[_0x838b('0x14')][_0x838b('0x15')]=function(_0x100ee2){for(var _0x200652 in _0x100ee2){if(_0x100ee2[_0x838b('0x16')](_0x200652)){if(_0x100ee2[_0x200652]['Imap']&&_0x100ee2[_0x200652][_0x838b('0xe')]){var _0x3f1132=_0x100ee2[_0x200652][_0x838b('0xf')];if(!this[_0x838b('0x17')]['hasOwnProperty'](_0x3f1132['id'])){this[_0x838b('0x17')][_0x3f1132['id']]=new EmailImap(_0x3f1132,_0x100ee2[_0x200652][_0x838b('0x18')]);this['imapAccounts'][_0x3f1132['id']]['on'](_0x838b('0x19'),this[_0x838b('0x1a')]['bind'](this,_0x200652));this[_0x838b('0x17')][_0x3f1132['id']]['on'](_0x838b('0x18'),this[_0x838b('0x1b')]['bind'](this,_0x200652));this[_0x838b('0x17')][_0x3f1132['id']]['on'](_0x838b('0x1c'),this[_0x838b('0x1d')][_0x838b('0x1e')](this,_0x200652));this[_0x838b('0x17')][_0x3f1132['id']]['on'](_0x838b('0x1f'),this[_0x838b('0x20')][_0x838b('0x1e')](this,_0x200652));}}else{if(_[_0x838b('0x13')](this[_0x838b('0xa')][_0x200652][_0x838b('0xf')])){this[_0x838b('0xa')][_0x200652][_0x838b('0xf')]={};}this[_0x838b('0xa')][_0x200652]['Imap'][_0x838b('0x10')]='disabled';this['mailAccounts'][_0x200652][_0x838b('0xf')][_0x838b('0x11')]='';this[_0x838b('0xc')](_0x200652);}}}};EmailChannel['prototype'][_0x838b('0x1a')]=function(_0x27f385,_0x47d239){if(this[_0x838b('0xa')][_0x27f385]){this[_0x838b('0xa')][_0x27f385]['Imap']['status']='connected';this['mailAccounts'][_0x27f385]['Imap']['messageStatus']=_0x47d239[_0x838b('0xd')];if(_0x47d239[_0x838b('0x21')]){this['mailAccounts'][_0x27f385]['Imap'][_0x838b('0x12')]=_0x47d239[_0x838b('0x21')][_0x838b('0x12')];}return this[_0x838b('0xc')](_0x27f385);}};EmailChannel[_0x838b('0x14')][_0x838b('0x1b')]=function(_0xc7b054,_0x3ebc0c){logger[_0x838b('0x22')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3ebc0c[_0x838b('0x23')],_0x3ebc0c[_0x838b('0x24')],_0x3ebc0c[_0x838b('0x25')],_0xc7b054);if(this[_0x838b('0xa')][_0xc7b054]){return mailAccount['notify'](_0xc7b054,_0x3ebc0c)[_0x838b('0x26')](function(_0x380d86){if(_0x380d86){logger[_0x838b('0x22')](_0x838b('0x27'));}})[_0x838b('0x28')](function(_0x4fd48b){logger[_0x838b('0x1f')](_0x838b('0x29'),JSON[_0x838b('0x2a')](_0x4fd48b));});}};EmailChannel[_0x838b('0x14')]['handleImapEnd']=function(_0x2e9af8){if(this[_0x838b('0xa')][_0x2e9af8]&&this['mailAccounts'][_0x2e9af8][_0x838b('0xf')]){if(this[_0x838b('0x17')][this[_0x838b('0xa')][_0x2e9af8][_0x838b('0xf')]['id']]){delete this[_0x838b('0x17')][this['mailAccounts'][_0x2e9af8][_0x838b('0xf')]['id']];}this[_0x838b('0xa')][_0x2e9af8]['Imap'][_0x838b('0x2b')]=moment();this['emit'](_0x2e9af8);}};EmailChannel[_0x838b('0x14')]['handleImapError']=function(_0x26e428,_0x47f9d1){if(this[_0x838b('0xa')][_0x26e428]){this[_0x838b('0xa')][_0x26e428][_0x838b('0xf')][_0x838b('0x10')]=_0x838b('0x1f');this[_0x838b('0xa')][_0x26e428][_0x838b('0xf')][_0x838b('0x11')]=_0x47f9d1;return this[_0x838b('0xc')](_0x26e428);}};EmailChannel[_0x838b('0x14')]['sendMail']=function(_0x2ef1fa,_0x5e71d5){return this[_0x838b('0xb')][_0x838b('0x2c')](_0x2ef1fa,_0x5e71d5);};EmailChannel[_0x838b('0x14')][_0x838b('0x2d')]=function(_0xaaa45c){var _0x3934b7=this;if(this[_0x838b('0xa')][_0xaaa45c['id']]){if(_[_0x838b('0x13')](this['mailAccounts'][_0xaaa45c['id']][_0x838b('0x2e')])){this[_0x838b('0xa')][_0xaaa45c['id']][_0x838b('0x2e')]={};}this[_0x838b('0xa')][_0xaaa45c['id']][_0x838b('0x2e')][_0x838b('0x2b')]=moment();return new BPromise(function(_0x563ec9,_0x120f3e){return _0x3934b7['smtp'][_0x838b('0x2f')](_0xaaa45c)[_0x838b('0x26')](function(_0x5639c9){_0x3934b7[_0x838b('0xa')][_0xaaa45c['id']][_0x838b('0x2e')][_0x838b('0x10')]=_0x838b('0x30');_0x3934b7['mailAccounts'][_0xaaa45c['id']]['Smtp'][_0x838b('0x11')]='';_0x3934b7[_0x838b('0xc')](_0xaaa45c['id']);_0x563ec9(_0x5639c9);})['catch'](function(_0xd323ed){_0x3934b7['mailAccounts'][_0xaaa45c['id']][_0x838b('0x2e')][_0x838b('0x10')]=_0x838b('0x1f');_0x3934b7[_0x838b('0xa')][_0xaaa45c['id']][_0x838b('0x2e')]['messageStatus']=_0xd323ed;_0x3934b7[_0x838b('0xc')](_0xaaa45c['id']);_0x120f3e(_0xd323ed);});});}return this['smtp'][_0x838b('0x2f')](_0xaaa45c);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index d7b900b..3ab23c2 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 _0xd403=['lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','bind','once','handleEnd','handleError','inherits','prototype','connTimeout','authTimeout','isNil','user','password','host','port','tls','getHost','service','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','error','handleFetchError','end','handleFetchEnd','body','handleMessageBody','handleMessageEnd','handleSimpleParser','parser','closeBox','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap'];(function(_0x1656d4,_0x482dda){var _0x349f51=function(_0x139fd4){while(--_0x139fd4){_0x1656d4['push'](_0x1656d4['shift']());}};_0x349f51(++_0x482dda);}(_0xd403,0x1d5));var _0x3d40=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xd403[_0x39096d];return _0x13da4f;};'use strict';var fs=require('fs');var path=require(_0x3d40('0x0'));var util=require(_0x3d40('0x1'));var Imap=require(_0x3d40('0x2'));var _=require(_0x3d40('0x3'));var rs=require('randomstring');var simpleParser=require(_0x3d40('0x4'))['simpleParser'];var Iconv=require(_0x3d40('0x5'))[_0x3d40('0x6')];var EventEmitter=require(_0x3d40('0x7'))[_0x3d40('0x8')];var utils=require(_0x3d40('0x9'));var logger=require(_0x3d40('0xa'))(_0x3d40('0xb'));function EmailImap(_0xfd5569,_0x14dc5b){this[_0x3d40('0xc')]=_0x3d40('0xd');this[_0x3d40('0xe')]=this[_0x3d40('0xf')](_0xfd5569,_0x14dc5b);this[_0x3d40('0x2')]=new Imap(this[_0x3d40('0xe')]);this[_0x3d40('0x2')]['once'](_0x3d40('0x10'),this['handleReady'][_0x3d40('0x11')](this));this[_0x3d40('0x2')][_0x3d40('0x12')]('end',this[_0x3d40('0x13')][_0x3d40('0x11')](this));this[_0x3d40('0x2')]['on']('error',this[_0x3d40('0x14')][_0x3d40('0x11')](this));this['imap']['connect']();}util[_0x3d40('0x15')](EmailImap,EventEmitter);EmailImap[_0x3d40('0x16')][_0x3d40('0xf')]=function(_0x5062ec,_0x2fc2cb){var _0x1e6400={'connTimeout':_0x5062ec[_0x3d40('0x17')]?_0x5062ec[_0x3d40('0x17')]*0x3e8:0x2710,'authTimeout':_0x5062ec[_0x3d40('0x18')]?_0x5062ec[_0x3d40('0x18')]*0x3e8:0x1388};if(_[_0x3d40('0x19')](_0x5062ec['service'])){if(_0x5062ec['authentication']){_0x1e6400[_0x3d40('0x1a')]=_0x5062ec[_0x3d40('0x1a')];_0x1e6400[_0x3d40('0x1b')]=_0x5062ec[_0x3d40('0x1b')];}_0x1e6400[_0x3d40('0x1c')]=_0x5062ec[_0x3d40('0x1c')];_0x1e6400[_0x3d40('0x1d')]=_0x5062ec[_0x3d40('0x1d')]||0x3e1;if(_0x5062ec[_0x3d40('0x1e')]){_0x1e6400[_0x3d40('0x1e')]=!![];}else{_0x1e6400[_0x3d40('0x1e')]=![];_0x1e6400['autotls']='required';}}else{_0x1e6400[_0x3d40('0x1a')]=_0x5062ec[_0x3d40('0x1a')];_0x1e6400[_0x3d40('0x1b')]=_0x5062ec[_0x3d40('0x1b')];_0x1e6400[_0x3d40('0x1c')]=utils[_0x3d40('0x1f')](_0x5062ec[_0x3d40('0x20')]);_0x1e6400[_0x3d40('0x1d')]=0x3e1;_0x1e6400[_0x3d40('0x1e')]=!![];}_0x1e6400[_0x3d40('0xb')]=_0x2fc2cb||_0x5062ec[_0x3d40('0x1a')]||_0x3d40('0x21');return _0x1e6400;};EmailImap[_0x3d40('0x16')]['handleReady']=function(){this[_0x3d40('0x2')][_0x3d40('0x22')](this[_0x3d40('0xc')],![],this[_0x3d40('0x23')][_0x3d40('0x11')](this));};EmailImap['prototype'][_0x3d40('0x23')]=function(_0x28c438,_0x3cc4df){if(_0x28c438){this[_0x3d40('0x14')](_0x28c438,!![]);}else{this[_0x3d40('0x24')]('box',_0x3cc4df);this[_0x3d40('0x25')]();}};EmailImap[_0x3d40('0x16')]['handleCloseBox']=function(_0x412d46){if(_0x412d46){this[_0x3d40('0x14')](_0x412d46,!![]);}else{this[_0x3d40('0x2')]['end']();}};EmailImap[_0x3d40('0x16')][_0x3d40('0x25')]=function(){this[_0x3d40('0x2')][_0x3d40('0x26')]([_0x3d40('0x27')],this[_0x3d40('0x28')][_0x3d40('0x11')](this));};EmailImap[_0x3d40('0x16')]['handleReadUnseen']=function(_0x4e536f,_0x394fab){if(_0x4e536f){this[_0x3d40('0x14')](_0x4e536f,!![]);}else{if(_0x394fab['length']){try{var _0x2c1ce6=this['imap'][_0x3d40('0x29')](_0x394fab,{'bodies':'','markSeen':!![]});_0x2c1ce6['on']('message',this[_0x3d40('0x2a')][_0x3d40('0x11')](this));_0x2c1ce6[_0x3d40('0x12')](_0x3d40('0x2b'),this[_0x3d40('0x2c')]['bind'](this));_0x2c1ce6['once'](_0x3d40('0x2d'),this[_0x3d40('0x2e')][_0x3d40('0x11')](this));}catch(_0x5b4f2b){logger[_0x3d40('0x2b')](_0x5b4f2b);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0x3d40('0x11')](this));}}};EmailImap[_0x3d40('0x16')][_0x3d40('0x2a')]=function(_0x2d523b,_0x30b4a4){_0x2d523b['on'](_0x3d40('0x2f'),this[_0x3d40('0x30')][_0x3d40('0x11')](this));_0x2d523b[_0x3d40('0x12')]('attributes',this['handleMessageAttributes'][_0x3d40('0x11')](this));_0x2d523b[_0x3d40('0x12')](_0x3d40('0x2d'),this[_0x3d40('0x31')][_0x3d40('0x11')](this));};EmailImap[_0x3d40('0x16')]['handleMessageBody']=function(_0x416fe8,_0x250bb7){simpleParser(_0x416fe8,{'Iconv':Iconv},this[_0x3d40('0x32')]['bind'](this));};EmailImap[_0x3d40('0x16')]['handleMessageAttributes']=function(_0x34c619){};EmailImap[_0x3d40('0x16')]['handleMessageEnd']=function(){};EmailImap[_0x3d40('0x16')]['handleSimpleParser']=function(_0x4cf4cf,_0x184dcd){if(_0x4cf4cf){logger[_0x3d40('0x2b')](_0x4cf4cf);}else{var _0x583d6b=this;utils[_0x3d40('0x33')](this[_0x3d40('0xe')],_0x184dcd,function(_0x15b31e){_0x583d6b['emit'](_0x3d40('0xb'),_0x15b31e);});}};EmailImap[_0x3d40('0x16')][_0x3d40('0x2e')]=function(){this[_0x3d40('0x2')][_0x3d40('0x34')](!![],this[_0x3d40('0x35')][_0x3d40('0x11')](this));};EmailImap[_0x3d40('0x16')][_0x3d40('0x2c')]=function(_0x322030){this[_0x3d40('0x14')](_0x322030);this['imap'][_0x3d40('0x34')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0x3d40('0x13')]=function(){this[_0x3d40('0x24')](_0x3d40('0x2d'));};EmailImap['prototype'][_0x3d40('0x14')]=function(_0x46527d,_0x46e59d){logger[_0x3d40('0x2b')]('handleError',this[_0x3d40('0xe')][_0x3d40('0xb')],JSON[_0x3d40('0x36')](_0x46527d));var _0x1be4a9='';if(_0x46527d){if(_0x46527d[_0x3d40('0x37')]){_0x1be4a9=_0x46527d[_0x3d40('0x37')];}else{for(var _0x3c4651 in _0x46527d){if(_0x46527d[_0x3d40('0x38')](_0x3c4651)){_0x1be4a9+=_[_0x3d40('0x39')](_0x3c4651)+':\x20'+_0x46527d[_0x3c4651]+'\x0a';}}}}if(_0x46e59d){this[_0x3d40('0x2')]['end']();}else{this['emit'](_0x3d40('0x2b'),_0x1be4a9);this[_0x3d40('0x24')](_0x3d40('0x2d'));}};module[_0x3d40('0x3a')]=EmailImap; \ No newline at end of file +var _0x4c68=['authentication','password','host','port','tls','autotls','required','user','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchError','closeBox','handleCloseBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','simpleParser','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','end','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service'];(function(_0x3167a9,_0x46bfd1){var _0x5053be=function(_0x25dae7){while(--_0x25dae7){_0x3167a9['push'](_0x3167a9['shift']());}};_0x5053be(++_0x46bfd1);}(_0x4c68,0x198));var _0x84c6=function(_0x56fbaa,_0x3bc5a6){_0x56fbaa=_0x56fbaa-0x0;var _0x49fbc1=_0x4c68[_0x56fbaa];return _0x49fbc1;};'use strict';var fs=require('fs');var path=require(_0x84c6('0x0'));var util=require(_0x84c6('0x1'));var Imap=require(_0x84c6('0x2'));var _=require(_0x84c6('0x3'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0x84c6('0x4')];var Iconv=require('iconv')[_0x84c6('0x5')];var EventEmitter=require(_0x84c6('0x6'))[_0x84c6('0x7')];var utils=require('./utils');var logger=require(_0x84c6('0x8'))(_0x84c6('0x9'));function EmailImap(_0xbfdd50,_0x2b423f){this[_0x84c6('0xa')]='INBOX';this[_0x84c6('0xb')]=this[_0x84c6('0xc')](_0xbfdd50,_0x2b423f);this['imap']=new Imap(this[_0x84c6('0xb')]);this[_0x84c6('0x2')][_0x84c6('0xd')](_0x84c6('0xe'),this[_0x84c6('0xf')]['bind'](this));this[_0x84c6('0x2')]['once'](_0x84c6('0x10'),this['handleEnd'][_0x84c6('0x11')](this));this[_0x84c6('0x2')]['on'](_0x84c6('0x12'),this[_0x84c6('0x13')][_0x84c6('0x11')](this));this[_0x84c6('0x2')]['connect']();}util[_0x84c6('0x14')](EmailImap,EventEmitter);EmailImap[_0x84c6('0x15')][_0x84c6('0xc')]=function(_0x5ab0ce,_0x46b6f1){var _0x700b21={'connTimeout':_0x5ab0ce['connTimeout']?_0x5ab0ce[_0x84c6('0x16')]*0x3e8:0x2710,'authTimeout':_0x5ab0ce[_0x84c6('0x17')]?_0x5ab0ce[_0x84c6('0x17')]*0x3e8:0x1388};if(_[_0x84c6('0x18')](_0x5ab0ce[_0x84c6('0x19')])){if(_0x5ab0ce[_0x84c6('0x1a')]){_0x700b21['user']=_0x5ab0ce['user'];_0x700b21['password']=_0x5ab0ce[_0x84c6('0x1b')];}_0x700b21[_0x84c6('0x1c')]=_0x5ab0ce[_0x84c6('0x1c')];_0x700b21['port']=_0x5ab0ce[_0x84c6('0x1d')]||0x3e1;if(_0x5ab0ce[_0x84c6('0x1e')]){_0x700b21[_0x84c6('0x1e')]=!![];}else{_0x700b21['tls']=![];_0x700b21[_0x84c6('0x1f')]=_0x84c6('0x20');}}else{_0x700b21[_0x84c6('0x21')]=_0x5ab0ce[_0x84c6('0x21')];_0x700b21[_0x84c6('0x1b')]=_0x5ab0ce[_0x84c6('0x1b')];_0x700b21[_0x84c6('0x1c')]=utils[_0x84c6('0x22')](_0x5ab0ce[_0x84c6('0x19')]);_0x700b21[_0x84c6('0x1d')]=0x3e1;_0x700b21[_0x84c6('0x1e')]=!![];}_0x700b21[_0x84c6('0x9')]=_0x46b6f1||_0x5ab0ce[_0x84c6('0x21')]||_0x84c6('0x23');return _0x700b21;};EmailImap[_0x84c6('0x15')][_0x84c6('0xf')]=function(){this[_0x84c6('0x2')][_0x84c6('0x24')](this[_0x84c6('0xa')],![],this['handleOpenBox'][_0x84c6('0x11')](this));};EmailImap['prototype'][_0x84c6('0x25')]=function(_0x1bf39d,_0x5ca3a0){if(_0x1bf39d){this[_0x84c6('0x13')](_0x1bf39d,!![]);}else{this[_0x84c6('0x26')](_0x84c6('0x27'),_0x5ca3a0);this[_0x84c6('0x28')]();}};EmailImap[_0x84c6('0x15')]['handleCloseBox']=function(_0x43a838){if(_0x43a838){this[_0x84c6('0x13')](_0x43a838,!![]);}else{this[_0x84c6('0x2')]['end']();}};EmailImap[_0x84c6('0x15')]['readUnseen']=function(){this['imap'][_0x84c6('0x29')]([_0x84c6('0x2a')],this[_0x84c6('0x2b')][_0x84c6('0x11')](this));};EmailImap['prototype'][_0x84c6('0x2b')]=function(_0x4a7a2f,_0x2601fc){if(_0x4a7a2f){this[_0x84c6('0x13')](_0x4a7a2f,!![]);}else{if(_0x2601fc[_0x84c6('0x2c')]){try{var _0x29f365=this['imap']['fetch'](_0x2601fc,{'bodies':'','markSeen':!![]});_0x29f365['on'](_0x84c6('0x2d'),this['handleFetchMessage']['bind'](this));_0x29f365[_0x84c6('0xd')](_0x84c6('0x12'),this[_0x84c6('0x2e')][_0x84c6('0x11')](this));_0x29f365[_0x84c6('0xd')](_0x84c6('0x10'),this['handleFetchEnd']['bind'](this));}catch(_0x1b2c14){logger[_0x84c6('0x12')](_0x1b2c14);}}else{this['imap'][_0x84c6('0x2f')](!![],this[_0x84c6('0x30')][_0x84c6('0x11')](this));}}};EmailImap[_0x84c6('0x15')][_0x84c6('0x31')]=function(_0x9350ae,_0x2f0a5f){_0x9350ae['on']('body',this[_0x84c6('0x32')][_0x84c6('0x11')](this));_0x9350ae[_0x84c6('0xd')](_0x84c6('0x33'),this[_0x84c6('0x34')][_0x84c6('0x11')](this));_0x9350ae[_0x84c6('0xd')](_0x84c6('0x10'),this[_0x84c6('0x35')][_0x84c6('0x11')](this));};EmailImap[_0x84c6('0x15')][_0x84c6('0x32')]=function(_0x575d11,_0x424b09){simpleParser(_0x575d11,{'Iconv':Iconv},this[_0x84c6('0x36')][_0x84c6('0x11')](this));};EmailImap[_0x84c6('0x15')]['handleMessageAttributes']=function(_0x3a2f78){};EmailImap['prototype'][_0x84c6('0x35')]=function(){};EmailImap[_0x84c6('0x15')][_0x84c6('0x36')]=function(_0x53b636,_0x1317bc){if(_0x53b636){logger['error'](_0x53b636);}else{var _0x258a03=this;utils[_0x84c6('0x37')](this[_0x84c6('0xb')],_0x1317bc,function(_0x41199d){_0x258a03[_0x84c6('0x26')]('email',_0x41199d);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x84c6('0x2')][_0x84c6('0x2f')](!![],this[_0x84c6('0x30')][_0x84c6('0x11')](this));};EmailImap[_0x84c6('0x15')][_0x84c6('0x2e')]=function(_0x1b36ab){this[_0x84c6('0x13')](_0x1b36ab);this[_0x84c6('0x2')]['closeBox'](!![],this[_0x84c6('0x30')][_0x84c6('0x11')](this));};EmailImap[_0x84c6('0x15')][_0x84c6('0x38')]=function(){this[_0x84c6('0x26')](_0x84c6('0x10'));};EmailImap[_0x84c6('0x15')]['handleError']=function(_0x20aa40,_0x719ef3){logger['error']('handleError',this[_0x84c6('0xb')][_0x84c6('0x9')],JSON[_0x84c6('0x39')](_0x20aa40));var _0x2ff909='';if(_0x20aa40){if(_0x20aa40['textCode']){_0x2ff909=_0x20aa40[_0x84c6('0x3a')];}else{for(var _0x19d6a4 in _0x20aa40){if(_0x20aa40[_0x84c6('0x3b')](_0x19d6a4)){_0x2ff909+=_[_0x84c6('0x3c')](_0x19d6a4)+':\x20'+_0x20aa40[_0x19d6a4]+'\x0a';}}}}if(_0x719ef3){this[_0x84c6('0x2')][_0x84c6('0x10')]();}else{this[_0x84c6('0x26')](_0x84c6('0x12'),_0x2ff909);this[_0x84c6('0x26')](_0x84c6('0x10'));}};module[_0x84c6('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1bbc03d..a964b00 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 _0xdfee=['exports','nodemailer','bluebird','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x45c1ec,_0x18f4cd){var _0xf1440b=function(_0x2033f0){while(--_0x2033f0){_0x45c1ec['push'](_0x45c1ec['shift']());}};_0xf1440b(++_0x18f4cd);}(_0xdfee,0xdd));var _0xedfe=function(_0x233e21,_0x1f1c79){_0x233e21=_0x233e21-0x0;var _0x53016f=_0xdfee[_0x233e21];return _0x53016f;};'use strict';var nodemailer=require(_0xedfe('0x0'));var BPromise=require(_0xedfe('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xedfe('0x2')]['send']=function(_0x351f2a,_0x1684aa){return new BPromise(function(_0x2e4bf7,_0xe67cf8){var _0x1d16a9=nodemailer[_0xedfe('0x3')](_0x351f2a);_0x1d16a9[_0xedfe('0x4')](_0xedfe('0x5'),inlineBase64());_0x1d16a9[_0xedfe('0x6')](_0x1684aa,function(_0x56b7b6,_0x1dae13){if(_0x56b7b6){_0xe67cf8(_0x56b7b6[_0xedfe('0x7')]());}else{_0x2e4bf7(_0x1dae13);}});});};EmailSmtp[_0xedfe('0x2')][_0xedfe('0x8')]=function(_0x373510){return new BPromise(function(_0x45a943,_0xacc5c7){var _0x40213e=nodemailer[_0xedfe('0x3')](_0x373510);_0x40213e[_0xedfe('0x8')](function(_0x234bda,_0x4b2021){if(_0x234bda){_0xacc5c7(_0x234bda[_0xedfe('0x7')]());}else{if(_0x4b2021){_0x45a943(_0x4b2021);}else{_0xacc5c7(_0xedfe('0x9'));}}});});};module[_0xedfe('0xa')]=EmailSmtp; \ No newline at end of file +var _0x23d3=['createTransport','verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','use','toString'];(function(_0x5c5be2,_0x226fd5){var _0x55a761=function(_0x2262a0){while(--_0x2262a0){_0x5c5be2['push'](_0x5c5be2['shift']());}};_0x55a761(++_0x226fd5);}(_0x23d3,0x13a));var _0x323d=function(_0x18dd60,_0x3ea99f){_0x18dd60=_0x18dd60-0x0;var _0x57d75f=_0x23d3[_0x18dd60];return _0x57d75f;};'use strict';var nodemailer=require(_0x323d('0x0'));var BPromise=require(_0x323d('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x323d('0x2')][_0x323d('0x3')]=function(_0x1060cb,_0x21bb52){return new BPromise(function(_0x573151,_0x1ea833){var _0x2b04c4=nodemailer['createTransport'](_0x1060cb);_0x2b04c4[_0x323d('0x4')]('compile',inlineBase64());_0x2b04c4['sendMail'](_0x21bb52,function(_0x58b48d,_0x1e0cb0){if(_0x58b48d){_0x1ea833(_0x58b48d[_0x323d('0x5')]());}else{_0x573151(_0x1e0cb0);}});});};EmailSmtp[_0x323d('0x2')]['verify']=function(_0x441822){return new BPromise(function(_0x569076,_0x2cceaf){var _0x303670=nodemailer[_0x323d('0x6')](_0x441822);_0x303670[_0x323d('0x7')](function(_0x4f626d,_0x3d7e95){if(_0x4f626d){_0x2cceaf(_0x4f626d[_0x323d('0x5')]());}else{if(_0x3d7e95){_0x569076(_0x3d7e95);}else{_0x2cceaf(_0x323d('0x8'));}}});});};module[_0x323d('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c882a93..1d5f015 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 _0xbd22=['Attachments','Data','getHost','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','name','split','length','join','Anonymous','pop','isEmpty','@xcally.com','html','body','textAsHtml','replace','message','includes','originTo','originCc','bcc','attachments','type','attachment','filename','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','from','subject','date','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

'];(function(_0x20d27b,_0x28d27a){var _0x24a0de=function(_0x3b290b){while(--_0x3b290b){_0x20d27b['push'](_0x20d27b['shift']());}};_0x24a0de(++_0x28d27a);}(_0xbd22,0xf7));var _0x2bd2=function(_0x5715af,_0x49af7b){_0x5715af=_0x5715af-0x0;var _0x302b98=_0xbd22[_0x5715af];return _0x302b98;};'use strict';var _=require(_0x2bd2('0x0'));var moment=require(_0x2bd2('0x1'));var random=require(_0x2bd2('0x2'));var fs=require('fs');var path=require(_0x2bd2('0x3'));var util=require(_0x2bd2('0x4'));var tnef=require(_0x2bd2('0x5'));var logger=require(_0x2bd2('0x6'))(_0x2bd2('0x7'));var config=require(_0x2bd2('0x8'));function getAddress(_0x3e16b8){var _0x5f427b=_[_0x2bd2('0x9')](_0x3e16b8[_0x2bd2('0xa')]);return _0x5f427b&&_0x5f427b[_0x2bd2('0xb')]?_0x5f427b['address']:_0x2bd2('0xc')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x36f3b0){var _0x1fb5aa=_['head'](_0x36f3b0[_0x2bd2('0xa')]);if(_0x1fb5aa&&_0x1fb5aa[_0x2bd2('0xd')]){var _0x206f25=_0x1fb5aa[_0x2bd2('0xd')][_0x2bd2('0xe')](/\s+/);return _0x206f25[_0x2bd2('0xf')]?_0x206f25['slice'](0x0,-0x1)[_0x2bd2('0x10')]('\x20'):_0x1fb5aa['name'];}return _0x2bd2('0x11');}function getLastName(_0x317a31){var _0x53c9b8=_['head'](_0x317a31['value']);if(_0x53c9b8&&_0x53c9b8[_0x2bd2('0xd')]){var _0x1914f4=_0x53c9b8[_0x2bd2('0xd')][_0x2bd2('0xe')](/\s+/);return _0x1914f4[_0x2bd2('0xf')]>0x1?_0x1914f4[_0x2bd2('0x12')]():'';}return'';}function getMails(_0x1b7cb3,_0x104a9c){var _0x460805='';for(var _0x2c7647=0x0;_0x2c7647<_0x104a9c['value'][_0x2bd2('0xf')];_0x2c7647+=0x1){if(_0x104a9c[_0x2bd2('0xa')][_0x2c7647][_0x2bd2('0xb')]!==_0x1b7cb3){if(!_[_0x2bd2('0x13')](_0x460805)){_0x460805+=',';}_0x460805+=_0x104a9c['value'][_0x2c7647][_0x2bd2('0xd')]||_0x104a9c[_0x2bd2('0xa')][_0x2c7647]['address']||'';_0x460805+='\x20<';_0x460805+=_0x104a9c['value'][_0x2c7647][_0x2bd2('0xb')]?_0x104a9c[_0x2bd2('0xa')][_0x2c7647][_0x2bd2('0xb')]:_0x2bd2('0xc')+random['generate'](0x6)+_0x2bd2('0x14');_0x460805+='>';}}return _0x460805;}function parseEmail(_0x1885be,_0x3b9ede,_0x1b7852){if(_0x3b9ede[_0x2bd2('0x15')]){var _0x5dfbe5=/)<[^<]*)*<\/script>/gi;while(_0x5dfbe5['test'](_0x3b9ede[_0x2bd2('0x15')])){_0x3b9ede['html']=_0x3b9ede['html']['replace'](_0x5dfbe5,'');}_0x1b7852[_0x2bd2('0x16')]=_0x3b9ede[_0x2bd2('0x15')];}else{_0x1b7852[_0x2bd2('0x16')]=_0x3b9ede[_0x2bd2('0x17')];}if(_0x1b7852[_0x2bd2('0x16')]){_0x1b7852[_0x2bd2('0x16')]=_0x1b7852[_0x2bd2('0x16')][_0x2bd2('0x18')](/Empty\x20message

','Attachments','Title','Data'];(function(_0x1bbb77,_0x884615){var _0x391116=function(_0x49d573){while(--_0x49d573){_0x1bbb77['push'](_0x1bbb77['shift']());}};_0x391116(++_0x884615);}(_0x80e5,0xb7));var _0x580e=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x80e5[_0x282f9a];return _0x52528c;};'use strict';var _=require(_0x580e('0x0'));var moment=require(_0x580e('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x580e('0x2'));var tnef=require(_0x580e('0x3'));var logger=require(_0x580e('0x4'))(_0x580e('0x5'));var config=require(_0x580e('0x6'));function getAddress(_0x29fa42){var _0x30bfec=_[_0x580e('0x7')](_0x29fa42[_0x580e('0x8')]);return _0x30bfec&&_0x30bfec[_0x580e('0x9')]?_0x30bfec[_0x580e('0x9')]:_0x580e('0xa')+random[_0x580e('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x4aa734){var _0x525b87=_[_0x580e('0x7')](_0x4aa734['value']);if(_0x525b87&&_0x525b87['name']){var _0x1840f8=_0x525b87[_0x580e('0xc')][_0x580e('0xd')](/\s+/);return _0x1840f8[_0x580e('0xe')]?_0x1840f8[_0x580e('0xf')](0x0,-0x1)[_0x580e('0x10')]('\x20'):_0x525b87[_0x580e('0xc')];}return _0x580e('0x11');}function getLastName(_0x3c6004){var _0x2e2cce=_[_0x580e('0x7')](_0x3c6004[_0x580e('0x8')]);if(_0x2e2cce&&_0x2e2cce[_0x580e('0xc')]){var _0x16cc97=_0x2e2cce[_0x580e('0xc')][_0x580e('0xd')](/\s+/);return _0x16cc97[_0x580e('0xe')]>0x1?_0x16cc97['pop']():'';}return'';}function getMails(_0x3b522c,_0x554cc4){var _0x56f335='';for(var _0x3708c8=0x0;_0x3708c8<_0x554cc4[_0x580e('0x8')][_0x580e('0xe')];_0x3708c8+=0x1){if(_0x554cc4['value'][_0x3708c8][_0x580e('0x9')]!==_0x3b522c){if(!_[_0x580e('0x12')](_0x56f335)){_0x56f335+=',';}_0x56f335+=_0x554cc4[_0x580e('0x8')][_0x3708c8][_0x580e('0xc')]||_0x554cc4[_0x580e('0x8')][_0x3708c8][_0x580e('0x9')]||'';_0x56f335+='\x20<';_0x56f335+=_0x554cc4[_0x580e('0x8')][_0x3708c8][_0x580e('0x9')]?_0x554cc4[_0x580e('0x8')][_0x3708c8]['address']:_0x580e('0xa')+random['generate'](0x6)+_0x580e('0x13');_0x56f335+='>';}}return _0x56f335;}function parseEmail(_0x1ee170,_0x42eb49,_0x5b0e73){if(_0x42eb49[_0x580e('0x14')]){var _0x320bdf=/)<[^<]*)*<\/script>/gi;while(_0x320bdf['test'](_0x42eb49[_0x580e('0x14')])){_0x42eb49['html']=_0x42eb49[_0x580e('0x14')][_0x580e('0x15')](_0x320bdf,'');}_0x5b0e73[_0x580e('0x16')]=_0x42eb49[_0x580e('0x14')];}else{_0x5b0e73['body']=_0x42eb49[_0x580e('0x17')];}if(_0x5b0e73[_0x580e('0x16')]){_0x5b0e73[_0x580e('0x16')]=_0x5b0e73[_0x580e('0x16')][_0x580e('0x15')](/0x0){if(this[_0x3193ad+'Capacity']>0x0&&this[_0x3193ad+_0x8bf1('0x24')]>=this[_0x3193ad+'Capacity']){return'maxcapacity';}else{return _0x8bf1('0x25');}}else{return'idle';}};Agent[_0x8bf1('0x22')]['updateRealtime']=function(){var _0x4d2fc1=[_0x8bf1('0x26'),_0x8bf1('0x27'),_0x8bf1('0x28'),_0x8bf1('0x29'),_0x8bf1('0x2a')];for(var _0x1c5f44=0x0;_0x1c5f44<_0x4d2fc1[_0x8bf1('0x2b')];_0x1c5f44+=0x1){var _0x15ccf3=this['getChannelStatus'](_0x4d2fc1[_0x1c5f44]);if(this[_0x4d2fc1[_0x1c5f44]+_0x8bf1('0x2c')]!==_0x15ccf3){this[_0x4d2fc1[_0x1c5f44]+_0x8bf1('0x2d')]=_['toNumber'](moment()[_0x8bf1('0x2e')]('x'));}this[_0x4d2fc1[_0x1c5f44]+_0x8bf1('0x2c')]=_0x15ccf3;}var _0x52c715={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x8bf1('0xa')],'chatPause':this[_0x8bf1('0xb')],'mailPause':this[_0x8bf1('0xc')],'smsPause':this[_0x8bf1('0xe')],'faxPause':this[_0x8bf1('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x8bf1('0x2f')],'chatStatusTime':this[_0x8bf1('0x30')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x8bf1('0x12')],'mailStatus':this[_0x8bf1('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x8bf1('0x15')],'mailCurrentCapacity':this[_0x8bf1('0x31')],'faxStatus':this[_0x8bf1('0x16')],'faxStatusTime':this[_0x8bf1('0x17')],'faxCapacity':this[_0x8bf1('0x18')],'faxCurrentCapacity':this[_0x8bf1('0x19')],'smsStatus':this[_0x8bf1('0x1a')],'smsStatusTime':this[_0x8bf1('0x1b')],'smsCapacity':this[_0x8bf1('0x1c')],'smsCurrentCapacity':this[_0x8bf1('0x32')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x8bf1('0x1e')],'openchannelCapacity':this[_0x8bf1('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x8bf1('0x21')]};var _0x376f43=md5(JSON[_0x8bf1('0x33')](_0x52c715));if(this[_0x8bf1('0x34')]!==_0x376f43){this[_0x8bf1('0x34')]=_0x376f43;io[_0x8bf1('0x35')](_0x8bf1('0x36'),_0x52c715);}};module[_0x8bf1('0x37')]=Agent; \ No newline at end of file +var _0x3556=['openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','length','Status','toNumber','format','mailCurrentCapacity','faxStatus','faxCapacity','stringify','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCurrentCapacity','smsStatusTime','smsCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x3c945a,_0x13db67){var _0x1a8fae=function(_0x4a9c65){while(--_0x4a9c65){_0x3c945a['push'](_0x3c945a['shift']());}};_0x1a8fae(++_0x13db67);}(_0x3556,0xf0));var _0x6355=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3556[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6355('0x0'));var moment=require(_0x6355('0x1'));var md5=require(_0x6355('0x2'));var Redis=require(_0x6355('0x3'));var config=require(_0x6355('0x4'));config[_0x6355('0x5')]=_['defaults'](config['redis'],{'host':_0x6355('0x6'),'port':0x18eb});var io=require(_0x6355('0x7'))(new Redis(config['redis']));function Agent(_0x4d76d5){this['id']=_0x4d76d5['id']||0x0;this[_0x6355('0x8')]=_0x4d76d5[_0x6355('0x8')]||'';this[_0x6355('0x9')]=_0x4d76d5[_0x6355('0x9')]||!![];this['voicePause']=_0x4d76d5[_0x6355('0xa')]||![];this[_0x6355('0xb')]=_0x4d76d5[_0x6355('0xb')]||![];this[_0x6355('0xc')]=_0x4d76d5['mailPause']||![];this[_0x6355('0xd')]=_0x4d76d5[_0x6355('0xd')]||![];this[_0x6355('0xe')]=_0x4d76d5['smsPause']||![];this[_0x6355('0xf')]=_0x4d76d5['openchannelPause']||![];this[_0x6355('0x10')]=_0x6355('0x11');this[_0x6355('0x12')]=0x0;this[_0x6355('0x13')]=_0x4d76d5[_0x6355('0x13')]||0x0;this[_0x6355('0x14')]=0x0;this[_0x6355('0x15')]=_0x6355('0x11');this[_0x6355('0x16')]=0x0;this[_0x6355('0x17')]=_0x4d76d5[_0x6355('0x17')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x6355('0x11');this[_0x6355('0x18')]=0x0;this['faxCapacity']=_0x4d76d5['faxCapacity']||0x0;this[_0x6355('0x19')]=0x0;this['smsStatus']=_0x6355('0x11');this[_0x6355('0x1a')]=0x0;this['smsCapacity']=_0x4d76d5[_0x6355('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x6355('0x1c')]=_0x6355('0x11');this[_0x6355('0x1d')]=0x0;this[_0x6355('0x1e')]=_0x4d76d5['openchannelCapacity']||0x0;this[_0x6355('0x1f')]=0x0;this[_0x6355('0x20')]=![];this[_0x6355('0x21')]=undefined;this['md5']='';this[_0x6355('0x22')]();}Agent[_0x6355('0x23')]['getChannelStatus']=function(_0x503004){if(this[_0x503004+_0x6355('0x24')]>0x0){if(this[_0x503004+'Capacity']>0x0&&this[_0x503004+_0x6355('0x24')]>=this[_0x503004+_0x6355('0x25')]){return _0x6355('0x26');}else{return _0x6355('0x27');}}else{return _0x6355('0x28');}};Agent[_0x6355('0x23')][_0x6355('0x22')]=function(){var _0x40d6da=[_0x6355('0x29'),_0x6355('0x2a'),_0x6355('0x2b'),_0x6355('0x2c'),_0x6355('0x2d')];for(var _0x2f738d=0x0;_0x2f738d<_0x40d6da[_0x6355('0x2e')];_0x2f738d+=0x1){var _0x4c0a51=this['getChannelStatus'](_0x40d6da[_0x2f738d]);if(this[_0x40d6da[_0x2f738d]+_0x6355('0x2f')]!==_0x4c0a51){this[_0x40d6da[_0x2f738d]+'StatusTime']=_[_0x6355('0x30')](moment()[_0x6355('0x31')]('x'));}this[_0x40d6da[_0x2f738d]+'Status']=_0x4c0a51;}var _0x6b26d6={'id':this['id'],'name':this['name'],'online':this[_0x6355('0x9')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x6355('0xc')],'smsPause':this[_0x6355('0xe')],'faxPause':this[_0x6355('0xd')],'openchannelPause':this[_0x6355('0xf')],'chatStatus':this[_0x6355('0x10')],'chatStatusTime':this[_0x6355('0x12')],'chatCapacity':this[_0x6355('0x13')],'chatCurrentCapacity':this[_0x6355('0x14')],'mailStatus':this[_0x6355('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x6355('0x32')],'faxStatus':this[_0x6355('0x33')],'faxStatusTime':this[_0x6355('0x18')],'faxCapacity':this[_0x6355('0x34')],'faxCurrentCapacity':this[_0x6355('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x6355('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6355('0x1d')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x6355('0x1f')],'busy':this[_0x6355('0x20')],'busyQueue':this[_0x6355('0x21')]};var _0x56d1b7=md5(JSON[_0x6355('0x35')](_0x6b26d6));if(this[_0x6355('0x2')]!==_0x56d1b7){this[_0x6355('0x2')]=_0x56d1b7;io['emit']('user:save',_0x6b26d6);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f83842a..0548dd5 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 _0x3a97=['loggedIn','stringify','format','emit','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','paused','length','online','chatPause','available'];(function(_0x563d50,_0x165800){var _0x9a38d4=function(_0x207829){while(--_0x207829){_0x563d50['push'](_0x563d50['shift']());}};_0x9a38d4(++_0x165800);}(_0x3a97,0x17e));var _0x73a9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3a97[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73a9('0x0'));var md5=require(_0x73a9('0x1'));var util=require('util');var Redis=require(_0x73a9('0x2'));var config=require(_0x73a9('0x3'));config['redis']=_[_0x73a9('0x4')](config[_0x73a9('0x5')],{'host':_0x73a9('0x6'),'port':0x18eb});var io=require(_0x73a9('0x7'))(new Redis(config[_0x73a9('0x5')]));function ChatQueue(_0x3850db){this['id']=_0x3850db['id']||0x0;this[_0x73a9('0x8')]=_0x3850db['name']||'';this['timeout']=_0x3850db[_0x73a9('0x9')]||0xa;this[_0x73a9('0xa')]=_0x3850db[_0x73a9('0xa')]||_0x73a9('0xb');this['Agents']=_0x3850db[_0x73a9('0xc')];this[_0x73a9('0xd')]={};this[_0x73a9('0xe')]=0x0;this['md5']='';this[_0x73a9('0xf')]();this[_0x73a9('0x10')]();}ChatQueue['prototype'][_0x73a9('0xf')]=function(){var _0x58807b=this[_0x73a9('0xd')][_0x73a9('0x11')];this['mapAgentsId']=_[_0x73a9('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x73a9('0x11')]=_0x58807b;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x73a9('0x13')]=0x0;for(var _0x26010b=0x0;_0x26010b=0x0?this[_0x73a9('0x17')]:0x0;var _0x2af7db={'id':this['id'],'available':this[_0x73a9('0x17')],'loggedIn':this[_0x73a9('0x18')],'name':this[_0x73a9('0x8')],'paused':this[_0x73a9('0x13')],'waiting':this[_0x73a9('0xe')]};var _0x1a23a3=md5(JSON[_0x73a9('0x19')](_0x2af7db));if(this['md5']!==_0x1a23a3){this['md5']=_0x1a23a3;io['to'](util[_0x73a9('0x1a')]('chat:queue:%s',_0x2af7db['name']))[_0x73a9('0x1b')]('chat_queue:save',_0x2af7db);}};module[_0x73a9('0x1c')]=ChatQueue; \ No newline at end of file +var _0x559f=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','chatPause','available','format','chat:queue:%s','chat_queue:save'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x559f,0x186));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf559('0x0'));var md5=require(_0xf559('0x1'));var util=require(_0xf559('0x2'));var Redis=require(_0xf559('0x3'));var config=require(_0xf559('0x4'));config['redis']=_[_0xf559('0x5')](config[_0xf559('0x6')],{'host':_0xf559('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf559('0x6')]));function ChatQueue(_0x5898b2){this['id']=_0x5898b2['id']||0x0;this[_0xf559('0x8')]=_0x5898b2[_0xf559('0x8')]||'';this[_0xf559('0x9')]=_0x5898b2[_0xf559('0x9')]||0xa;this[_0xf559('0xa')]=_0x5898b2[_0xf559('0xa')]||'beepall';this[_0xf559('0xb')]=_0x5898b2[_0xf559('0xb')];this[_0xf559('0xc')]={};this[_0xf559('0xd')]=0x0;this[_0xf559('0x1')]='';this[_0xf559('0xe')]();this[_0xf559('0xf')]();}ChatQueue[_0xf559('0x10')][_0xf559('0xe')]=function(){var _0x2fb8d2=this[_0xf559('0xc')]['_rr'];this['mapAgentsId']=_[_0xf559('0x11')](this[_0xf559('0xb')],'id');this[_0xf559('0xc')]['_rr']=_0x2fb8d2;};ChatQueue[_0xf559('0x10')]['updateRealtime']=function(){this[_0xf559('0x12')]=0x0;this[_0xf559('0x13')]=0x0;for(var _0x382e62=0x0;_0x382e62=0x0?this[_0xf559('0x16')]:0x0;var _0x332e88={'id':this['id'],'available':this[_0xf559('0x16')],'loggedIn':this[_0xf559('0x12')],'name':this[_0xf559('0x8')],'paused':this[_0xf559('0x13')],'waiting':this[_0xf559('0xd')]};var _0x46ad86=md5(JSON['stringify'](_0x332e88));if(this[_0xf559('0x1')]!==_0x46ad86){this[_0xf559('0x1')]=_0x46ad86;io['to'](util[_0xf559('0x17')](_0xf559('0x18'),_0x332e88[_0xf559('0x8')]))['emit'](_0xf559('0x19'),_0x332e88);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 24c6039..067e684 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 _0xa062=['map','paused','online','loggedIn','faxPause','available','stringify','format','emit','fax_queue:save','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting'];(function(_0x29f9af,_0x4f3d10){var _0x56e4a8=function(_0x2e2554){while(--_0x2e2554){_0x29f9af['push'](_0x29f9af['shift']());}};_0x56e4a8(++_0x4f3d10);}(_0xa062,0x82));var _0x2a06=function(_0x592722,_0x14fe23){_0x592722=_0x592722-0x0;var _0x5d31a1=_0xa062[_0x592722];return _0x5d31a1;};'use strict';var _=require('lodash');var md5=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var Redis=require(_0x2a06('0x2'));var config=require('../../../config/environment');config[_0x2a06('0x3')]=_['defaults'](config['redis'],{'host':_0x2a06('0x4'),'port':0x18eb});var io=require(_0x2a06('0x5'))(new Redis(config[_0x2a06('0x3')]));function FaxQueue(_0x4685e1){this['id']=_0x4685e1['id']||0x0;this[_0x2a06('0x6')]=_0x4685e1[_0x2a06('0x6')]||'';this[_0x2a06('0x7')]=_0x4685e1[_0x2a06('0x7')]||0xa;this[_0x2a06('0x8')]=_0x4685e1[_0x2a06('0x8')]||'beepall';this[_0x2a06('0x9')]=_0x4685e1[_0x2a06('0x9')];this[_0x2a06('0xa')]={};this[_0x2a06('0xb')]=0x0;this[_0x2a06('0x0')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x2a06('0xc')][_0x2a06('0xd')]=function(){var _0x1c4d84=this[_0x2a06('0xa')]['_rr'];this[_0x2a06('0xa')]=_[_0x2a06('0xe')](this[_0x2a06('0x9')],'id');this['mapAgentsId']['_rr']=_0x1c4d84;};FaxQueue[_0x2a06('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x2a06('0xf')]=0x0;for(var _0x32ba43=0x0;_0x32ba43=0x0?this['available']:0x0;var _0x324b8b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2a06('0x11')],'name':this[_0x2a06('0x6')],'paused':this[_0x2a06('0xf')],'waiting':this[_0x2a06('0xb')]};var _0x12eda8=md5(JSON[_0x2a06('0x14')](_0x324b8b));if(this['md5']!==_0x12eda8){this[_0x2a06('0x0')]=_0x12eda8;io['to'](util[_0x2a06('0x15')]('fax:queue:%s',_0x324b8b['name']))[_0x2a06('0x16')](_0x2a06('0x17'),_0x324b8b);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x4221=['localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','faxPause','available','stringify','format','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x4221,0xff));var _0x1422=function(_0x43eca5,_0x40e178){_0x43eca5=_0x43eca5-0x0;var _0x2d788d=_0x4221[_0x43eca5];return _0x2d788d;};'use strict';var _=require(_0x1422('0x0'));var md5=require(_0x1422('0x1'));var util=require('util');var Redis=require(_0x1422('0x2'));var config=require(_0x1422('0x3'));config[_0x1422('0x4')]=_[_0x1422('0x5')](config[_0x1422('0x4')],{'host':_0x1422('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1422('0x4')]));function FaxQueue(_0x3e3fa6){this['id']=_0x3e3fa6['id']||0x0;this[_0x1422('0x7')]=_0x3e3fa6[_0x1422('0x7')]||'';this[_0x1422('0x8')]=_0x3e3fa6[_0x1422('0x8')]||0xa;this[_0x1422('0x9')]=_0x3e3fa6[_0x1422('0x9')]||_0x1422('0xa');this[_0x1422('0xb')]=_0x3e3fa6[_0x1422('0xb')];this[_0x1422('0xc')]={};this[_0x1422('0xd')]=0x0;this[_0x1422('0x1')]='';this[_0x1422('0xe')]();this[_0x1422('0xf')]();}FaxQueue['prototype']['updateRouting']=function(){var _0xb20aee=this['mapAgentsId'][_0x1422('0x10')];this[_0x1422('0xc')]=_[_0x1422('0x11')](this[_0x1422('0xb')],'id');this['mapAgentsId'][_0x1422('0x10')]=_0xb20aee;};FaxQueue[_0x1422('0x12')]['updateRealtime']=function(){this[_0x1422('0x13')]=0x0;this[_0x1422('0x14')]=0x0;for(var _0x40ae0c=0x0;_0x40ae0c=0x0?this['available']:0x0;var _0x20570e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1422('0x7')],'paused':this['paused'],'waiting':this[_0x1422('0xd')]};var _0x3cc4f6=md5(JSON[_0x1422('0x18')](_0x20570e));if(this[_0x1422('0x1')]!==_0x3cc4f6){this[_0x1422('0x1')]=_0x3cc4f6;io['to'](util[_0x1422('0x19')]('fax:queue:%s',_0x20570e[_0x1422('0x7')]))[_0x1422('0x1a')](_0x1422('0x1b'),_0x20570e);}};module[_0x1422('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index d87ca19..2335f83 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 _0xc14a=['Intervals','name'];(function(_0x4d8764,_0xd13d7b){var _0x4e0b49=function(_0x56126a){while(--_0x56126a){_0x4d8764['push'](_0x4d8764['shift']());}};_0x4e0b49(++_0xd13d7b);}(_0xc14a,0xa9));var _0xac14=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc14a[_0x3947c9];return _0x2e7871;};'use strict';function Interval(_0x2a9feb){this['id']=_0x2a9feb['id']||0x0;this[_0xac14('0x0')]=_0x2a9feb[_0xac14('0x0')]||'';this[_0xac14('0x1')]=_0x2a9feb[_0xac14('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x304e=['Intervals','exports','name'];(function(_0xa57a5d,_0x2d3840){var _0x317471=function(_0x46212c){while(--_0x46212c){_0xa57a5d['push'](_0xa57a5d['shift']());}};_0x317471(++_0x2d3840);}(_0x304e,0x6b));var _0xe304=function(_0x4173eb,_0x5df012){_0x4173eb=_0x4173eb-0x0;var _0x23bc18=_0x304e[_0x4173eb];return _0x23bc18;};'use strict';function Interval(_0x22a57c){this['id']=_0x22a57c['id']||0x0;this[_0xe304('0x0')]=_0x22a57c[_0xe304('0x0')]||'';this[_0xe304('0x1')]=_0x22a57c[_0xe304('0x1')]||{};}module[_0xe304('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 375cf28..581618d 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 _0x3974=['online','mailPause','available','paused','stringify','mail:queue:%s','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','loggedIn','length'];(function(_0x9209fa,_0x1705d8){var _0x416655=function(_0x46e315){while(--_0x46e315){_0x9209fa['push'](_0x9209fa['shift']());}};_0x416655(++_0x1705d8);}(_0x3974,0xbc));var _0x4397=function(_0x32b87d,_0x49f56a){_0x32b87d=_0x32b87d-0x0;var _0x2ccbe5=_0x3974[_0x32b87d];return _0x2ccbe5;};'use strict';var _=require(_0x4397('0x0'));var md5=require(_0x4397('0x1'));var util=require(_0x4397('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x4397('0x3')]=_[_0x4397('0x4')](config[_0x4397('0x3')],{'host':_0x4397('0x5'),'port':0x18eb});var io=require(_0x4397('0x6'))(new Redis(config['redis']));function MailQueue(_0x31ab71){this['id']=_0x31ab71['id']||0x0;this[_0x4397('0x7')]=_0x31ab71[_0x4397('0x7')]||'';this[_0x4397('0x8')]=_0x31ab71['timeout']||0xa;this[_0x4397('0x9')]=_0x31ab71[_0x4397('0x9')]||_0x4397('0xa');this[_0x4397('0xb')]=_0x31ab71['Agents'];this[_0x4397('0xc')]={};this[_0x4397('0xd')]=0x0;this[_0x4397('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x4397('0xe')][_0x4397('0xf')]=function(){var _0x2ddb9c=this['mapAgentsId'][_0x4397('0x10')];this[_0x4397('0xc')]=_[_0x4397('0x11')](this['Agents'],'id');this[_0x4397('0xc')][_0x4397('0x10')]=_0x2ddb9c;};MailQueue[_0x4397('0xe')]['updateRealtime']=function(){this[_0x4397('0x12')]=0x0;this['paused']=0x0;for(var _0x3b7b4a=0x0;_0x3b7b4a=0x0?this[_0x4397('0x16')]:0x0;var _0x35e528={'id':this['id'],'available':this[_0x4397('0x16')],'loggedIn':this[_0x4397('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x4397('0xd')]};var _0x3a2810=md5(JSON[_0x4397('0x18')](_0x35e528));if(this[_0x4397('0x1')]!==_0x3a2810){this['md5']=_0x3a2810;io['to'](util['format'](_0x4397('0x19'),_0x35e528[_0x4397('0x7')]))['emit']('mail_queue:save',_0x35e528);}};module['exports']=MailQueue; \ No newline at end of file +var _0x5785=['prototype','updateRouting','_rr','map','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0x216819,_0x51f9b4){var _0x2e9652=function(_0xc7851d){while(--_0xc7851d){_0x216819['push'](_0x216819['shift']());}};_0x2e9652(++_0x51f9b4);}(_0x5785,0x119));var _0x5578=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x5785[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x5578('0x0'));var md5=require(_0x5578('0x1'));var util=require(_0x5578('0x2'));var Redis=require(_0x5578('0x3'));var config=require(_0x5578('0x4'));config['redis']=_[_0x5578('0x5')](config[_0x5578('0x6')],{'host':_0x5578('0x7'),'port':0x18eb});var io=require(_0x5578('0x8'))(new Redis(config[_0x5578('0x6')]));function MailQueue(_0x32c82b){this['id']=_0x32c82b['id']||0x0;this[_0x5578('0x9')]=_0x32c82b[_0x5578('0x9')]||'';this[_0x5578('0xa')]=_0x32c82b[_0x5578('0xa')]||0xa;this['strategy']=_0x32c82b[_0x5578('0xb')]||_0x5578('0xc');this[_0x5578('0xd')]=_0x32c82b['Agents'];this[_0x5578('0xe')]={};this['waiting']=0x0;this[_0x5578('0x1')]='';this['updateRouting']();this[_0x5578('0xf')]();}MailQueue[_0x5578('0x10')][_0x5578('0x11')]=function(){var _0x54cd87=this['mapAgentsId'][_0x5578('0x12')];this[_0x5578('0xe')]=_[_0x5578('0x13')](this[_0x5578('0xd')],'id');this[_0x5578('0xe')][_0x5578('0x12')]=_0x54cd87;};MailQueue[_0x5578('0x10')][_0x5578('0xf')]=function(){this[_0x5578('0x14')]=0x0;this[_0x5578('0x15')]=0x0;for(var _0x4f6d2a=0x0;_0x4f6d2a=0x0?this['available']:0x0;var _0x59fb63={'id':this['id'],'available':this[_0x5578('0x19')],'loggedIn':this[_0x5578('0x14')],'name':this['name'],'paused':this[_0x5578('0x15')],'waiting':this[_0x5578('0x1a')]};var _0x3661a7=md5(JSON[_0x5578('0x1b')](_0x59fb63));if(this[_0x5578('0x1')]!==_0x3661a7){this[_0x5578('0x1')]=_0x3661a7;io['to'](util[_0x5578('0x1c')](_0x5578('0x1d'),_0x59fb63[_0x5578('0x9')]))[_0x5578('0x1e')](_0x5578('0x1f'),_0x59fb63);}};module[_0x5578('0x20')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ac8e500..f7111ac 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 _0xe8fe=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5'];(function(_0x134ca7,_0x46e795){var _0x3e8b93=function(_0x5352c1){while(--_0x5352c1){_0x134ca7['push'](_0x134ca7['shift']());}};_0x3e8b93(++_0x46e795);}(_0xe8fe,0x177));var _0xee8f=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xe8fe[_0x393d69];return _0x3cee37;};'use strict';var _=require(_0xee8f('0x0'));var md5=require(_0xee8f('0x1'));var util=require(_0xee8f('0x2'));var Redis=require(_0xee8f('0x3'));var config=require(_0xee8f('0x4'));config['redis']=_['defaults'](config[_0xee8f('0x5')],{'host':_0xee8f('0x6'),'port':0x18eb});var io=require(_0xee8f('0x7'))(new Redis(config[_0xee8f('0x5')]));function OpenchannelQueue(_0x43b52a){this['id']=_0x43b52a['id']||0x0;this['name']=_0x43b52a[_0xee8f('0x8')]||'';this[_0xee8f('0x9')]=_0x43b52a[_0xee8f('0x9')]||0xa;this[_0xee8f('0xa')]=_0x43b52a['strategy']||_0xee8f('0xb');this[_0xee8f('0xc')]=_0x43b52a['Agents'];this[_0xee8f('0xd')]={};this[_0xee8f('0xe')]=0x0;this['md5']='';this[_0xee8f('0xf')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0xee8f('0xf')]=function(){var _0x22eb2b=this[_0xee8f('0xd')][_0xee8f('0x10')];this[_0xee8f('0xd')]=_[_0xee8f('0x11')](this['Agents'],'id');this[_0xee8f('0xd')][_0xee8f('0x10')]=_0x22eb2b;};OpenchannelQueue['prototype']['updateRealtime']=function(){this[_0xee8f('0x12')]=0x0;this[_0xee8f('0x13')]=0x0;for(var _0x571a80=0x0;_0x571a80=0x0?this['available']:0x0;var _0x348248={'id':this['id'],'available':this[_0xee8f('0x17')],'loggedIn':this[_0xee8f('0x12')],'name':this[_0xee8f('0x8')],'paused':this[_0xee8f('0x13')],'waiting':this['waiting']};var _0x4856c3=md5(JSON[_0xee8f('0x18')](_0x348248));if(this['md5']!==_0x4856c3){this[_0xee8f('0x1')]=_0x4856c3;io['to'](util['format'](_0xee8f('0x19'),_0x348248[_0xee8f('0x8')]))[_0xee8f('0x1a')](_0xee8f('0x1b'),_0x348248);}};module[_0xee8f('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x3f7e=['emit','openchannel_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','map','_rr','paused','length','online','loggedIn','available','format'];(function(_0x39b960,_0x3d914f){var _0xdd29a5=function(_0xb83598){while(--_0xb83598){_0x39b960['push'](_0x39b960['shift']());}};_0xdd29a5(++_0x3d914f);}(_0x3f7e,0x1c3));var _0xe3f7=function(_0x4a61d1,_0x431e80){_0x4a61d1=_0x4a61d1-0x0;var _0x29dee7=_0x3f7e[_0x4a61d1];return _0x29dee7;};'use strict';var _=require(_0xe3f7('0x0'));var md5=require('md5');var util=require(_0xe3f7('0x1'));var Redis=require(_0xe3f7('0x2'));var config=require(_0xe3f7('0x3'));config[_0xe3f7('0x4')]=_[_0xe3f7('0x5')](config['redis'],{'host':_0xe3f7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe3f7('0x4')]));function OpenchannelQueue(_0x166472){this['id']=_0x166472['id']||0x0;this[_0xe3f7('0x7')]=_0x166472[_0xe3f7('0x7')]||'';this[_0xe3f7('0x8')]=_0x166472[_0xe3f7('0x8')]||0xa;this[_0xe3f7('0x9')]=_0x166472['strategy']||'beepall';this['Agents']=_0x166472[_0xe3f7('0xa')];this[_0xe3f7('0xb')]={};this[_0xe3f7('0xc')]=0x0;this[_0xe3f7('0xd')]='';this['updateRouting']();this[_0xe3f7('0xe')]();}OpenchannelQueue[_0xe3f7('0xf')][_0xe3f7('0x10')]=function(){var _0x459f25=this[_0xe3f7('0xb')]['_rr'];this[_0xe3f7('0xb')]=_[_0xe3f7('0x11')](this[_0xe3f7('0xa')],'id');this[_0xe3f7('0xb')][_0xe3f7('0x12')]=_0x459f25;};OpenchannelQueue['prototype'][_0xe3f7('0xe')]=function(){this['loggedIn']=0x0;this[_0xe3f7('0x13')]=0x0;for(var _0x3da0d9=0x0;_0x3da0d9=0x0?this[_0xe3f7('0x17')]:0x0;var _0x4755e9={'id':this['id'],'available':this[_0xe3f7('0x17')],'loggedIn':this[_0xe3f7('0x16')],'name':this[_0xe3f7('0x7')],'paused':this[_0xe3f7('0x13')],'waiting':this['waiting']};var _0x53b675=md5(JSON['stringify'](_0x4755e9));if(this['md5']!==_0x53b675){this[_0xe3f7('0xd')]=_0x53b675;io['to'](util[_0xe3f7('0x18')]('openchannel:queue:%s',_0x4755e9[_0xe3f7('0x7')]))[_0xe3f7('0x19')](_0xe3f7('0x1a'),_0x4755e9);}};module[_0xe3f7('0x1b')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 706bf9d..2824c5d 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 _0xe4bf=['util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','stringify','sms:queue:%s','sms_queue:save','lodash','md5'];(function(_0x508c10,_0x5a15f0){var _0x3108b5=function(_0x4bccaa){while(--_0x4bccaa){_0x508c10['push'](_0x508c10['shift']());}};_0x3108b5(++_0x5a15f0);}(_0xe4bf,0x10c));var _0xfe4b=function(_0xc1a4cf,_0x17141b){_0xc1a4cf=_0xc1a4cf-0x0;var _0x2930d1=_0xe4bf[_0xc1a4cf];return _0x2930d1;};'use strict';var _=require(_0xfe4b('0x0'));var md5=require(_0xfe4b('0x1'));var util=require(_0xfe4b('0x2'));var Redis=require('ioredis');var config=require(_0xfe4b('0x3'));config[_0xfe4b('0x4')]=_[_0xfe4b('0x5')](config['redis'],{'host':_0xfe4b('0x6'),'port':0x18eb});var io=require(_0xfe4b('0x7'))(new Redis(config['redis']));function SmsQueue(_0x545e2c){this['id']=_0x545e2c['id']||0x0;this[_0xfe4b('0x8')]=_0x545e2c[_0xfe4b('0x8')]||'';this['timeout']=_0x545e2c[_0xfe4b('0x9')]||0xa;this[_0xfe4b('0xa')]=_0x545e2c[_0xfe4b('0xa')]||_0xfe4b('0xb');this[_0xfe4b('0xc')]=_0x545e2c[_0xfe4b('0xc')];this[_0xfe4b('0xd')]={};this[_0xfe4b('0xe')]=0x0;this[_0xfe4b('0x1')]='';this[_0xfe4b('0xf')]();this[_0xfe4b('0x10')]();}SmsQueue[_0xfe4b('0x11')]['updateRouting']=function(){var _0x3bcafb=this['mapAgentsId'][_0xfe4b('0x12')];this[_0xfe4b('0xd')]=_[_0xfe4b('0x13')](this[_0xfe4b('0xc')],'id');this['mapAgentsId']['_rr']=_0x3bcafb;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xfe4b('0x14')]=0x0;this[_0xfe4b('0x15')]=0x0;for(var _0xa44f70=0x0;_0xa44f70=0x0?this[_0xfe4b('0x17')]:0x0;var _0x2b1806={'id':this['id'],'available':this[_0xfe4b('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xfe4b('0x8')],'paused':this['paused'],'waiting':this[_0xfe4b('0xe')]};var _0x27255e=md5(JSON[_0xfe4b('0x18')](_0x2b1806));if(this['md5']!==_0x27255e){this['md5']=_0x27255e;io['to'](util['format'](_0xfe4b('0x19'),_0x2b1806[_0xfe4b('0x8')]))['emit'](_0xfe4b('0x1a'),_0x2b1806);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x7333=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','smsPause','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x177892,_0x2c0556){var _0x1d8f3d=function(_0x78ae0d){while(--_0x78ae0d){_0x177892['push'](_0x177892['shift']());}};_0x1d8f3d(++_0x2c0556);}(_0x7333,0x1b7));var _0x3733=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7333[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3733('0x0'));var md5=require(_0x3733('0x1'));var util=require(_0x3733('0x2'));var Redis=require(_0x3733('0x3'));var config=require(_0x3733('0x4'));config[_0x3733('0x5')]=_['defaults'](config[_0x3733('0x5')],{'host':_0x3733('0x6'),'port':0x18eb});var io=require(_0x3733('0x7'))(new Redis(config[_0x3733('0x5')]));function SmsQueue(_0x4d174f){this['id']=_0x4d174f['id']||0x0;this[_0x3733('0x8')]=_0x4d174f[_0x3733('0x8')]||'';this[_0x3733('0x9')]=_0x4d174f[_0x3733('0x9')]||0xa;this['strategy']=_0x4d174f[_0x3733('0xa')]||_0x3733('0xb');this['Agents']=_0x4d174f[_0x3733('0xc')];this[_0x3733('0xd')]={};this['waiting']=0x0;this[_0x3733('0x1')]='';this[_0x3733('0xe')]();this['updateRealtime']();}SmsQueue[_0x3733('0xf')][_0x3733('0xe')]=function(){var _0x1a0808=this[_0x3733('0xd')][_0x3733('0x10')];this[_0x3733('0xd')]=_[_0x3733('0x11')](this['Agents'],'id');this[_0x3733('0xd')]['_rr']=_0x1a0808;};SmsQueue['prototype'][_0x3733('0x12')]=function(){this['loggedIn']=0x0;this[_0x3733('0x13')]=0x0;for(var _0x2db961=0x0;_0x2db961=0x0?this['available']:0x0;var _0x138248={'id':this['id'],'available':this[_0x3733('0x18')],'loggedIn':this[_0x3733('0x16')],'name':this[_0x3733('0x8')],'paused':this[_0x3733('0x13')],'waiting':this[_0x3733('0x19')]};var _0x17d9c9=md5(JSON[_0x3733('0x1a')](_0x138248));if(this['md5']!==_0x17d9c9){this[_0x3733('0x1')]=_0x17d9c9;io['to'](util[_0x3733('0x1b')](_0x3733('0x1c'),_0x138248[_0x3733('0x8')]))[_0x3733('0x1d')](_0x3733('0x1e'),_0x138248);}};module[_0x3733('0x1f')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 391db06..221d711 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 _0x1834=['moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','agents','intervals','chatQueues','mailQueues','faxQueues','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','isUndefined','length','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','exports','bluebird'];(function(_0x1c011c,_0x384710){var _0x277506=function(_0x92ca26){while(--_0x92ca26){_0x1c011c['push'](_0x1c011c['shift']());}};_0x277506(++_0x384710);}(_0x1834,0x1c1));var _0x4183=function(_0x3b2a34,_0x55027c){_0x3b2a34=_0x3b2a34-0x0;var _0x3304cd=_0x1834[_0x3b2a34];return _0x3304cd;};'use strict';var BPromise=require(_0x4183('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x4183('0x1'));var Agent=require(_0x4183('0x2'));var Interval=require(_0x4183('0x3'));var OpenchannelQueue=require(_0x4183('0x4'));var ChatQueue=require(_0x4183('0x5'));var SmsQueue=require(_0x4183('0x6'));var MailQueue=require(_0x4183('0x7'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0x4183('0x8')]={};this[_0x4183('0x9')]={};this['openchannelQueues']={};this[_0x4183('0xa')]={};this['smsQueues']={};this[_0x4183('0xb')]={};this[_0x4183('0xc')]={};this['chatQueuesWaitingInteractions']={};this[_0x4183('0xd')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this[_0x4183('0xe')]={};};function freeIsNotKey(_0x45d436,_0x3fea3d,_0x4278c8){var _0x9ab6ec=_['mapKeys'](_0x45d436,function(_0x10d033,_0x49f37a){return _0x10d033[_0x4278c8];});for(var _0x130e3d in _0x3fea3d){if(_0x3fea3d[_0x4183('0xf')](_0x130e3d)){if(!_0x9ab6ec[_0x130e3d]){delete _0x3fea3d[_0x130e3d];}}}}Realtime[_0x4183('0x10')][_0x4183('0x11')]=function(_0x47fe31,_0x5f2568){for(var _0x31edc1 in _0x5f2568){if(_0x47fe31['hasOwnProperty'](_0x31edc1)){_0x47fe31[_0x31edc1]=_0x5f2568[_0x31edc1];}}};Realtime[_0x4183('0x10')][_0x4183('0x12')]=function(){var _0x258e74=this;return function(_0x1ebbc2){if(_0x1ebbc2){freeIsNotKey(_0x1ebbc2,_0x258e74[_0x4183('0x8')],'id');for(var _0x38fe0b=0x0,_0x36c452={},_0x34b68e={};_0x38fe0b<_0x1ebbc2['length'];_0x38fe0b+=0x1){_0x36c452=_0x1ebbc2[_0x38fe0b];if(_[_0x4183('0x13')](_0x258e74['agents'][_0x36c452['id']])){_0x258e74[_0x4183('0x8')][_0x36c452['id']]=new Agent(_0x36c452);}else{_0x258e74[_0x4183('0x11')](_0x258e74[_0x4183('0x8')][_0x36c452['id']],_0x36c452);}}}return _0x258e74[_0x4183('0x8')];};};Realtime[_0x4183('0x10')]['initIntervals']=function(){var _0x16a470=this;return function(_0x3c3266){if(_0x3c3266){freeIsNotKey(_0x3c3266,_0x16a470['intervals'],'id');for(var _0x4214a1=0x0,_0x59da18={},_0x1e6ddb={};_0x4214a1<_0x3c3266[_0x4183('0x14')];_0x4214a1+=0x1){_0x59da18=_0x3c3266[_0x4214a1];if(_[_0x4183('0x13')](_0x16a470[_0x4183('0x9')][_0x59da18['id']])){_0x16a470[_0x4183('0x9')][_0x59da18['id']]=new Interval(_0x59da18);}else{_0x16a470[_0x4183('0x11')](_0x16a470[_0x4183('0x9')][_0x59da18['id']],_0x59da18);}}}return _0x16a470[_0x4183('0x9')];};};Realtime[_0x4183('0x10')][_0x4183('0x15')]=function(){var _0x537607=this;return function(_0x4b0ee1){if(_0x4b0ee1){freeIsNotKey(_0x4b0ee1,_0x537607[_0x4183('0x16')],'id');for(var _0x4434fd=0x0,_0x4e2a06={},_0x3dcc79={};_0x4434fd<_0x4b0ee1[_0x4183('0x14')];_0x4434fd+=0x1){_0x4e2a06=_0x4b0ee1[_0x4434fd];if(_[_0x4183('0x13')](_0x537607[_0x4183('0x16')][_0x4e2a06['id']])){_0x537607[_0x4183('0x16')][_0x4e2a06['id']]=new OpenchannelQueue(_0x4e2a06);}else{_0x537607['mergeFromDatabase'](_0x537607['openchannelQueues'][_0x4e2a06['id']],_0x4e2a06);}_0x537607[_0x4183('0x16')][_0x4e2a06['id']][_0x4183('0x17')]();_0x537607[_0x4183('0x16')][_0x4e2a06['id']][_0x4183('0x18')]();}}return _0x537607[_0x4183('0x16')];};};Realtime[_0x4183('0x10')]['initChatQueues']=function(){var _0x39f150=this;return function(_0x43c136){if(_0x43c136){freeIsNotKey(_0x43c136,_0x39f150['chatQueues'],'id');for(var _0x3af905=0x0,_0x1d4068={},_0x3bc893={};_0x3af905<_0x43c136[_0x4183('0x14')];_0x3af905+=0x1){_0x1d4068=_0x43c136[_0x3af905];if(_[_0x4183('0x13')](_0x39f150['chatQueues'][_0x1d4068['id']])){_0x39f150['chatQueues'][_0x1d4068['id']]=new ChatQueue(_0x1d4068);}else{_0x39f150['mergeFromDatabase'](_0x39f150['chatQueues'][_0x1d4068['id']],_0x1d4068);}_0x39f150['chatQueues'][_0x1d4068['id']]['updateRouting']();_0x39f150[_0x4183('0xa')][_0x1d4068['id']][_0x4183('0x18')]();}}return _0x39f150[_0x4183('0xa')];};};Realtime[_0x4183('0x10')][_0x4183('0x19')]=function(){var _0x598e0e=this;return function(_0x5c0af9){if(_0x5c0af9){freeIsNotKey(_0x5c0af9,_0x598e0e['smsQueues'],'id');for(var _0x196c84=0x0,_0x1f3a0b={},_0x2db22d={};_0x196c84<_0x5c0af9[_0x4183('0x14')];_0x196c84+=0x1){_0x1f3a0b=_0x5c0af9[_0x196c84];if(_[_0x4183('0x13')](_0x598e0e[_0x4183('0x1a')][_0x1f3a0b['id']])){_0x598e0e[_0x4183('0x1a')][_0x1f3a0b['id']]=new SmsQueue(_0x1f3a0b);}else{_0x598e0e[_0x4183('0x11')](_0x598e0e['smsQueues'][_0x1f3a0b['id']],_0x1f3a0b);}_0x598e0e[_0x4183('0x1a')][_0x1f3a0b['id']][_0x4183('0x17')]();_0x598e0e[_0x4183('0x1a')][_0x1f3a0b['id']][_0x4183('0x18')]();}}return _0x598e0e['smsQueues'];};};Realtime[_0x4183('0x10')][_0x4183('0x1b')]=function(){var _0x58b1b3=this;return function(_0x5e9290){if(_0x5e9290){freeIsNotKey(_0x5e9290,_0x58b1b3['mailQueues'],'id');for(var _0xee38af=0x0,_0x3dd3df={},_0x15b60a={};_0xee38af<_0x5e9290[_0x4183('0x14')];_0xee38af+=0x1){_0x3dd3df=_0x5e9290[_0xee38af];if(_['isUndefined'](_0x58b1b3['mailQueues'][_0x3dd3df['id']])){_0x58b1b3[_0x4183('0xb')][_0x3dd3df['id']]=new MailQueue(_0x3dd3df);}else{_0x58b1b3['mergeFromDatabase'](_0x58b1b3[_0x4183('0xb')][_0x3dd3df['id']],_0x3dd3df);}_0x58b1b3[_0x4183('0xb')][_0x3dd3df['id']][_0x4183('0x17')]();_0x58b1b3[_0x4183('0xb')][_0x3dd3df['id']][_0x4183('0x18')]();}}return _0x58b1b3[_0x4183('0xb')];};};Realtime[_0x4183('0x10')][_0x4183('0x1c')]=function(){var _0x4e8427=this;return function(_0x55037a){if(_0x55037a){freeIsNotKey(_0x55037a,_0x4e8427[_0x4183('0xc')],'id');for(var _0x6b75c3=0x0,_0x4984e8={},_0x3a44f5={};_0x6b75c3<_0x55037a[_0x4183('0x14')];_0x6b75c3+=0x1){_0x4984e8=_0x55037a[_0x6b75c3];if(_[_0x4183('0x13')](_0x4e8427[_0x4183('0xc')][_0x4984e8['id']])){_0x4e8427[_0x4183('0xc')][_0x4984e8['id']]=new FaxQueue(_0x4984e8);}else{_0x4e8427['mergeFromDatabase'](_0x4e8427['faxQueues'][_0x4984e8['id']],_0x4984e8);}_0x4e8427['faxQueues'][_0x4984e8['id']][_0x4183('0x17')]();_0x4e8427[_0x4183('0xc')][_0x4984e8['id']][_0x4183('0x18')]();}}return _0x4e8427['faxQueues'];};};module[_0x4183('0x1d')]=Realtime; \ No newline at end of file +var _0x446b=['agents','intervals','chatQueues','smsQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','mergeFromDatabase','prototype','initAgents','length','isUndefined','initIntervals','openchannelQueues','updateRealtime','initMailQueues','mailQueues','faxQueues','updateRouting','exports','util','lodash','moment','../model/interval','../model/chatQueue','../model/smsQueue','../model/faxQueue'];(function(_0x106129,_0x4436c3){var _0x7b5a85=function(_0x5dd600){while(--_0x5dd600){_0x106129['push'](_0x106129['shift']());}};_0x7b5a85(++_0x4436c3);}(_0x446b,0xd9));var _0xb446=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x446b[_0x460150];return _0x340677;};'use strict';var BPromise=require('bluebird');var util=require(_0xb446('0x0'));var _=require(_0xb446('0x1'));var moment=require(_0xb446('0x2'));var Agent=require('../model/agent');var Interval=require(_0xb446('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xb446('0x4'));var SmsQueue=require(_0xb446('0x5'));var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0xb446('0x6'));var Realtime=function(){this[_0xb446('0x7')]={};this[_0xb446('0x8')]={};this['openchannelQueues']={};this[_0xb446('0x9')]={};this[_0xb446('0xa')]={};this['mailQueues']={};this['faxQueues']={};this[_0xb446('0xb')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xb446('0xc')]={};this[_0xb446('0xd')]={};};function freeIsNotKey(_0x2fb6e6,_0x1294e0,_0x180034){var _0x5c8dd7=_[_0xb446('0xe')](_0x2fb6e6,function(_0x5a5062,_0x5892d9){return _0x5a5062[_0x180034];});for(var _0x100915 in _0x1294e0){if(_0x1294e0['hasOwnProperty'](_0x100915)){if(!_0x5c8dd7[_0x100915]){delete _0x1294e0[_0x100915];}}}}Realtime['prototype'][_0xb446('0xf')]=function(_0x2a6af2,_0x4098ac){for(var _0x38b945 in _0x4098ac){if(_0x2a6af2['hasOwnProperty'](_0x38b945)){_0x2a6af2[_0x38b945]=_0x4098ac[_0x38b945];}}};Realtime[_0xb446('0x10')][_0xb446('0x11')]=function(){var _0x3a8e57=this;return function(_0x3abe2b){if(_0x3abe2b){freeIsNotKey(_0x3abe2b,_0x3a8e57[_0xb446('0x7')],'id');for(var _0x590066=0x0,_0x11bc93={},_0x5f19c2={};_0x590066<_0x3abe2b[_0xb446('0x12')];_0x590066+=0x1){_0x11bc93=_0x3abe2b[_0x590066];if(_[_0xb446('0x13')](_0x3a8e57[_0xb446('0x7')][_0x11bc93['id']])){_0x3a8e57['agents'][_0x11bc93['id']]=new Agent(_0x11bc93);}else{_0x3a8e57[_0xb446('0xf')](_0x3a8e57[_0xb446('0x7')][_0x11bc93['id']],_0x11bc93);}}}return _0x3a8e57[_0xb446('0x7')];};};Realtime[_0xb446('0x10')][_0xb446('0x14')]=function(){var _0x5c4546=this;return function(_0x43b126){if(_0x43b126){freeIsNotKey(_0x43b126,_0x5c4546[_0xb446('0x8')],'id');for(var _0x4c8baa=0x0,_0x32f27b={},_0x53f575={};_0x4c8baa<_0x43b126[_0xb446('0x12')];_0x4c8baa+=0x1){_0x32f27b=_0x43b126[_0x4c8baa];if(_[_0xb446('0x13')](_0x5c4546[_0xb446('0x8')][_0x32f27b['id']])){_0x5c4546[_0xb446('0x8')][_0x32f27b['id']]=new Interval(_0x32f27b);}else{_0x5c4546[_0xb446('0xf')](_0x5c4546[_0xb446('0x8')][_0x32f27b['id']],_0x32f27b);}}}return _0x5c4546['intervals'];};};Realtime[_0xb446('0x10')]['initOpenchannelQueues']=function(){var _0x53174f=this;return function(_0x1497f8){if(_0x1497f8){freeIsNotKey(_0x1497f8,_0x53174f[_0xb446('0x15')],'id');for(var _0x9683d8=0x0,_0x1c064f={},_0x26c6e1={};_0x9683d8<_0x1497f8[_0xb446('0x12')];_0x9683d8+=0x1){_0x1c064f=_0x1497f8[_0x9683d8];if(_['isUndefined'](_0x53174f[_0xb446('0x15')][_0x1c064f['id']])){_0x53174f[_0xb446('0x15')][_0x1c064f['id']]=new OpenchannelQueue(_0x1c064f);}else{_0x53174f[_0xb446('0xf')](_0x53174f[_0xb446('0x15')][_0x1c064f['id']],_0x1c064f);}_0x53174f[_0xb446('0x15')][_0x1c064f['id']]['updateRouting']();_0x53174f[_0xb446('0x15')][_0x1c064f['id']]['updateRealtime']();}}return _0x53174f[_0xb446('0x15')];};};Realtime[_0xb446('0x10')]['initChatQueues']=function(){var _0x4613ab=this;return function(_0x4c790b){if(_0x4c790b){freeIsNotKey(_0x4c790b,_0x4613ab[_0xb446('0x9')],'id');for(var _0x142776=0x0,_0xcc0c18={},_0x2379a0={};_0x142776<_0x4c790b[_0xb446('0x12')];_0x142776+=0x1){_0xcc0c18=_0x4c790b[_0x142776];if(_[_0xb446('0x13')](_0x4613ab[_0xb446('0x9')][_0xcc0c18['id']])){_0x4613ab[_0xb446('0x9')][_0xcc0c18['id']]=new ChatQueue(_0xcc0c18);}else{_0x4613ab[_0xb446('0xf')](_0x4613ab[_0xb446('0x9')][_0xcc0c18['id']],_0xcc0c18);}_0x4613ab[_0xb446('0x9')][_0xcc0c18['id']]['updateRouting']();_0x4613ab[_0xb446('0x9')][_0xcc0c18['id']]['updateRealtime']();}}return _0x4613ab[_0xb446('0x9')];};};Realtime[_0xb446('0x10')]['initSmsQueues']=function(){var _0x25b3f4=this;return function(_0xedeb79){if(_0xedeb79){freeIsNotKey(_0xedeb79,_0x25b3f4[_0xb446('0xa')],'id');for(var _0x305e6b=0x0,_0x59b5d5={},_0x5cc797={};_0x305e6b<_0xedeb79[_0xb446('0x12')];_0x305e6b+=0x1){_0x59b5d5=_0xedeb79[_0x305e6b];if(_['isUndefined'](_0x25b3f4[_0xb446('0xa')][_0x59b5d5['id']])){_0x25b3f4[_0xb446('0xa')][_0x59b5d5['id']]=new SmsQueue(_0x59b5d5);}else{_0x25b3f4[_0xb446('0xf')](_0x25b3f4['smsQueues'][_0x59b5d5['id']],_0x59b5d5);}_0x25b3f4[_0xb446('0xa')][_0x59b5d5['id']]['updateRouting']();_0x25b3f4[_0xb446('0xa')][_0x59b5d5['id']][_0xb446('0x16')]();}}return _0x25b3f4[_0xb446('0xa')];};};Realtime[_0xb446('0x10')][_0xb446('0x17')]=function(){var _0x5be948=this;return function(_0x5d03a9){if(_0x5d03a9){freeIsNotKey(_0x5d03a9,_0x5be948[_0xb446('0x18')],'id');for(var _0x17adbc=0x0,_0x20742a={},_0x2c71b5={};_0x17adbc<_0x5d03a9[_0xb446('0x12')];_0x17adbc+=0x1){_0x20742a=_0x5d03a9[_0x17adbc];if(_[_0xb446('0x13')](_0x5be948['mailQueues'][_0x20742a['id']])){_0x5be948[_0xb446('0x18')][_0x20742a['id']]=new MailQueue(_0x20742a);}else{_0x5be948[_0xb446('0xf')](_0x5be948[_0xb446('0x18')][_0x20742a['id']],_0x20742a);}_0x5be948[_0xb446('0x18')][_0x20742a['id']]['updateRouting']();_0x5be948[_0xb446('0x18')][_0x20742a['id']][_0xb446('0x16')]();}}return _0x5be948['mailQueues'];};};Realtime[_0xb446('0x10')]['initFaxQueues']=function(){var _0x5b08ad=this;return function(_0x12d0bc){if(_0x12d0bc){freeIsNotKey(_0x12d0bc,_0x5b08ad['faxQueues'],'id');for(var _0x1f894f=0x0,_0x218df2={},_0x5e05df={};_0x1f894f<_0x12d0bc[_0xb446('0x12')];_0x1f894f+=0x1){_0x218df2=_0x12d0bc[_0x1f894f];if(_[_0xb446('0x13')](_0x5b08ad[_0xb446('0x19')][_0x218df2['id']])){_0x5b08ad['faxQueues'][_0x218df2['id']]=new FaxQueue(_0x218df2);}else{_0x5b08ad['mergeFromDatabase'](_0x5b08ad['faxQueues'][_0x218df2['id']],_0x218df2);}_0x5b08ad[_0xb446('0x19')][_0x218df2['id']][_0xb446('0x1a')]();_0x5b08ad[_0xb446('0x19')][_0x218df2['id']]['updateRealtime']();}}return _0x5b08ad['faxQueues'];};};module[_0xb446('0x1b')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 2cc7600..23eb8fc 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 _0x0f6f=['UpdateChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x575fbc,_0x4e37ba){var _0x4d817e=function(_0x396c58){while(--_0x396c58){_0x575fbc['push'](_0x575fbc['shift']());}};_0x4d817e(++_0x4e37ba);}(_0x0f6f,0x6a));var _0xf0f6=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0x0f6f[_0x1fd437];return _0x40d9e6;};'use strict';var client=require('../client');exports[_0xf0f6('0x0')]=function(_0x4de655,_0x273c58){return client[_0xf0f6('0x1')](_0xf0f6('0x2'),{'body':_0x273c58,'options':{'where':{'id':_0x4de655}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x38d7e9,_0x5aad1e){return client['Request']('AddTagsToChatInteraction',{'body':_0x5aad1e,'options':{'where':{'id':_0x38d7e9}},'log':_0xf0f6('0x3')});}; \ No newline at end of file +var _0x5d31=['Request','addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x4c023c,_0x50894b){var _0x44ac91=function(_0x21ea8e){while(--_0x21ea8e){_0x4c023c['push'](_0x4c023c['shift']());}};_0x44ac91(++_0x50894b);}(_0x5d31,0x13a));var _0x15d3=function(_0x2a702f,_0x377aa7){_0x2a702f=_0x2a702f-0x0;var _0x52106f=_0x5d31[_0x2a702f];return _0x52106f;};'use strict';var client=require(_0x15d3('0x0'));exports[_0x15d3('0x1')]=function(_0x2114e7,_0x444e6f){return client['Request'](_0x15d3('0x2'),{'body':_0x444e6f,'options':{'where':{'id':_0x2114e7}},'log':_0x15d3('0x3')});};exports['addTags']=function(_0x2ed4ea,_0x433875){return client[_0x15d3('0x4')]('AddTagsToChatInteraction',{'body':_0x433875,'options':{'where':{'id':_0x2ed4ea}},'log':_0x15d3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2dfc8af..e9ef5be 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 _0x33cb=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x130079,_0x41274e){var _0x3b21fc=function(_0x247cc9){while(--_0x247cc9){_0x130079['push'](_0x130079['shift']());}};_0x3b21fc(++_0x41274e);}(_0x33cb,0x15f));var _0xb33c=function(_0xa091cc,_0x3655c2){_0xa091cc=_0xa091cc-0x0;var _0x4b7dec=_0x33cb[_0xa091cc];return _0x4b7dec;};'use strict';var client=require(_0xb33c('0x0'));exports[_0xb33c('0x1')]=function(_0x365105){return client[_0xb33c('0x2')](_0xb33c('0x3'),{'body':_0x365105,'log':_0xb33c('0x4')});}; \ No newline at end of file +var _0xf55c=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x37c9db,_0x3bbdaa){var _0x2a1e72=function(_0x917864){while(--_0x917864){_0x37c9db['push'](_0x37c9db['shift']());}};_0x2a1e72(++_0x3bbdaa);}(_0xf55c,0xa4));var _0xcf55=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf55c[_0x2a6809];return _0x11c371;};'use strict';var client=require('../client');exports[_0xcf55('0x0')]=function(_0x1a035a){return client[_0xcf55('0x1')](_0xcf55('0x2'),{'body':_0x1a035a,'log':_0xcf55('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c01d739..100305c 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 _0xb1fb=['User','Agents','chatPause','getChatQueues','name','timeout','strategy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb1fb,0x1d1));var _0xbb1f=function(_0x56a6a7,_0x22b663){_0x56a6a7=_0x56a6a7-0x0;var _0x17068b=_0xb1fb[_0x56a6a7];return _0x17068b;};'use strict';var client=require('../client');exports[_0xbb1f('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xbb1f('0x1'),_0xbb1f('0x2'),_0xbb1f('0x3')],'include':[{'model':_0xbb1f('0x4'),'as':_0xbb1f('0x5'),'attributes':['id',_0xbb1f('0x1'),'online',_0xbb1f('0x6')]}]},'log':_0xbb1f('0x0')});};}; \ No newline at end of file +var _0xdaf2=['Agents','chatPause','../client','getChatQueues','GetChatQueue','name','timeout','strategy','User'];(function(_0x52cab5,_0x386df9){var _0x437c69=function(_0x261c33){while(--_0x261c33){_0x52cab5['push'](_0x52cab5['shift']());}};_0x437c69(++_0x386df9);}(_0xdaf2,0x1df));var _0x2daf=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xdaf2[_0x4c9380];return _0x49a523;};'use strict';var client=require(_0x2daf('0x0'));exports[_0x2daf('0x1')]=function(){return function(){return client['Request'](_0x2daf('0x2'),{'options':{'raw':![],'attributes':['id',_0x2daf('0x3'),_0x2daf('0x4'),_0x2daf('0x5')],'include':[{'model':_0x2daf('0x6'),'as':_0x2daf('0x7'),'attributes':['id','name','online',_0x2daf('0x8')]}]},'log':_0x2daf('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d353012..7c69213 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 _0xa101=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x19df8d,_0x5d607a){var _0x28bf7b=function(_0x58b21){while(--_0x58b21){_0x19df8d['push'](_0x19df8d['shift']());}};_0x28bf7b(++_0x5d607a);}(_0xa101,0x15f));var _0x1a10=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0xa101[_0x644ecd];return _0x1c66ce;};'use strict';var client=require(_0x1a10('0x0'));exports[_0x1a10('0x1')]=function(_0x5a97b7){return client[_0x1a10('0x2')](_0x1a10('0x3'),{'body':_0x5a97b7,'log':'CreateChatQueueReport'});};exports[_0x1a10('0x4')]=function(_0x2a9c51,_0x51baf6){return client[_0x1a10('0x2')](_0x1a10('0x5'),{'body':_0x51baf6,'options':{'where':{'uniqueid':_0x2a9c51},'order':[['id',_0x1a10('0x6')]],'limit':0x1},'log':_0x1a10('0x5')});}; \ No newline at end of file +var _0x2821=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x2821,0x87));var _0x1282=function(_0x121016,_0x576c00){_0x121016=_0x121016-0x0;var _0x25efa2=_0x2821[_0x121016];return _0x25efa2;};'use strict';var client=require(_0x1282('0x0'));exports[_0x1282('0x1')]=function(_0x333849){return client[_0x1282('0x2')](_0x1282('0x3'),{'body':_0x333849,'log':_0x1282('0x3')});};exports[_0x1282('0x4')]=function(_0x1e303b,_0x3f5e68){return client[_0x1282('0x2')](_0x1282('0x5'),{'body':_0x3f5e68,'options':{'where':{'uniqueid':_0x1e303b},'order':[['id','DESC']],'limit':0x1},'log':_0x1282('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 912ce99..2b67285 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 _0xb47e=['AddTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags','Request'];(function(_0x1fba7c,_0x30ffd8){var _0xb7d825=function(_0x32a202){while(--_0x32a202){_0x1fba7c['push'](_0x1fba7c['shift']());}};_0xb7d825(++_0x30ffd8);}(_0xb47e,0x12e));var _0xeb47=function(_0x443838,_0x4960ba){_0x443838=_0x443838-0x0;var _0x1405a1=_0xb47e[_0x443838];return _0x1405a1;};'use strict';var client=require(_0xeb47('0x0'));exports[_0xeb47('0x1')]=function(_0x32809e,_0x327222){return client['Request'](_0xeb47('0x2'),{'body':_0x327222,'options':{'where':{'id':_0x32809e}},'log':_0xeb47('0x3')});};exports[_0xeb47('0x4')]=function(_0x1cbe82,_0x174c65){return client[_0xeb47('0x5')](_0xeb47('0x6'),{'body':_0x174c65,'options':{'where':{'id':_0x1cbe82}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x8850=['addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x8850,0xfd));var _0x0885=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8850[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x0885('0x0'));exports[_0x0885('0x1')]=function(_0x552484,_0x5d9bb4){return client[_0x0885('0x2')](_0x0885('0x3'),{'body':_0x5d9bb4,'options':{'where':{'id':_0x552484}},'log':'updateFaxInteraction'});};exports[_0x0885('0x4')]=function(_0x13ca37,_0x18ff8e){return client[_0x0885('0x2')](_0x0885('0x5'),{'body':_0x18ff8e,'options':{'where':{'id':_0x13ca37}},'log':_0x0885('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index fd91b9e..f2c3b6c 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 _0x2754=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0xc911db,_0x16a30d){var _0x15a0d0=function(_0x375650){while(--_0x375650){_0xc911db['push'](_0xc911db['shift']());}};_0x15a0d0(++_0x16a30d);}(_0x2754,0x1c0));var _0x4275=function(_0x5db1ce,_0x57ab66){_0x5db1ce=_0x5db1ce-0x0;var _0xb62cbb=_0x2754[_0x5db1ce];return _0xb62cbb;};'use strict';var client=require(_0x4275('0x0'));exports[_0x4275('0x1')]=function(_0x499170){return client[_0x4275('0x2')](_0x4275('0x3'),{'body':_0x499170,'log':_0x4275('0x4')});}; \ No newline at end of file +var _0xd4c7=['create','Request','../client'];(function(_0x5f09ac,_0x145686){var _0x398254=function(_0x477565){while(--_0x477565){_0x5f09ac['push'](_0x5f09ac['shift']());}};_0x398254(++_0x145686);}(_0xd4c7,0x71));var _0x7d4c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd4c7[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x7d4c('0x0'));exports[_0x7d4c('0x1')]=function(_0x2b92d7){return client[_0x7d4c('0x2')]('CreateFaxMessage',{'body':_0x2b92d7,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a5196dc..958fd66 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 _0x7e5b=['getFaxQueues','strategy','User','Agents','faxPause','../client'];(function(_0x4e6796,_0x2683e6){var _0x14b7a9=function(_0x47132f){while(--_0x47132f){_0x4e6796['push'](_0x4e6796['shift']());}};_0x14b7a9(++_0x2683e6);}(_0x7e5b,0xb3));var _0xb7e5=function(_0x4e0ce6,_0x2e5ab9){_0x4e0ce6=_0x4e0ce6-0x0;var _0x11cc1b=_0x7e5b[_0x4e0ce6];return _0x11cc1b;};'use strict';var client=require(_0xb7e5('0x0'));exports[_0xb7e5('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xb7e5('0x2')],'include':[{'model':_0xb7e5('0x3'),'as':_0xb7e5('0x4'),'attributes':['id','name','online',_0xb7e5('0x5')]}]},'log':_0xb7e5('0x1')});};}; \ No newline at end of file +var _0xce31=['online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy','Agents'];(function(_0x396510,_0x4da07d){var _0x2a1b98=function(_0x1645e9){while(--_0x1645e9){_0x396510['push'](_0x396510['shift']());}};_0x2a1b98(++_0x4da07d);}(_0xce31,0x161));var _0x1ce3=function(_0x80ed36,_0x5580cd){_0x80ed36=_0x80ed36-0x0;var _0x393295=_0xce31[_0x80ed36];return _0x393295;};'use strict';var client=require(_0x1ce3('0x0'));exports[_0x1ce3('0x1')]=function(){return function(){return client['Request'](_0x1ce3('0x2'),{'options':{'raw':![],'attributes':['id',_0x1ce3('0x3'),_0x1ce3('0x4'),_0x1ce3('0x5')],'include':[{'model':'User','as':_0x1ce3('0x6'),'attributes':['id',_0x1ce3('0x3'),_0x1ce3('0x7'),_0x1ce3('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 57ce923..9aa3ee6 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 _0xb2c5=['../client','create','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x8e340b,_0x512362){var _0x1cd93c=function(_0x106731){while(--_0x106731){_0x8e340b['push'](_0x8e340b['shift']());}};_0x1cd93c(++_0x512362);}(_0xb2c5,0x114));var _0x5b2c=function(_0x4e0157,_0x147213){_0x4e0157=_0x4e0157-0x0;var _0x13a010=_0xb2c5[_0x4e0157];return _0x13a010;};'use strict';var client=require(_0x5b2c('0x0'));exports[_0x5b2c('0x1')]=function(_0x213208){return client['Request']('CreateFaxQueueReport',{'body':_0x213208,'log':_0x5b2c('0x2')});};exports[_0x5b2c('0x3')]=function(_0x144916,_0x2d1423){return client['Request']('UpdateFaxQueueReport',{'body':_0x2d1423,'options':{'where':{'uniqueid':_0x144916},'order':[['id',_0x5b2c('0x4')]],'limit':0x1},'log':_0x5b2c('0x5')});}; \ No newline at end of file +var _0x65eb=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0x65eb,0x1a3));var _0xb65e=function(_0x1a6c82,_0x1c6016){_0x1a6c82=_0x1a6c82-0x0;var _0x28cc3a=_0x65eb[_0x1a6c82];return _0x28cc3a;};'use strict';var client=require(_0xb65e('0x0'));exports[_0xb65e('0x1')]=function(_0x577274){return client[_0xb65e('0x2')](_0xb65e('0x3'),{'body':_0x577274,'log':_0xb65e('0x3')});};exports[_0xb65e('0x4')]=function(_0x4f1dc4,_0x5aeb37){return client['Request'](_0xb65e('0x5'),{'body':_0x5aeb37,'options':{'where':{'uniqueid':_0x4f1dc4},'order':[['id',_0xb65e('0x6')]],'limit':0x1},'log':_0xb65e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index fe8fafb..dd91f04 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 _0x8130=['name','Interval','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x32db28,_0x239a3f){var _0x369106=function(_0x131314){while(--_0x131314){_0x32db28['push'](_0x32db28['shift']());}};_0x369106(++_0x239a3f);}(_0x8130,0x146));var _0x0813=function(_0x102386,_0x57b66a){_0x102386=_0x102386-0x0;var _0x38eea9=_0x8130[_0x102386];return _0x38eea9;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(){return function(){return client['Request'](_0x0813('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0813('0x3')],'include':[{'model':_0x0813('0x4'),'as':_0x0813('0x5'),'attributes':['id',_0x0813('0x3'),_0x0813('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x1bc6=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0xaa37af,_0x9c97e7){var _0x56d335=function(_0x32ce3d){while(--_0x32ce3d){_0xaa37af['push'](_0xaa37af['shift']());}};_0x56d335(++_0x9c97e7);}(_0x1bc6,0x94));var _0x61bc=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x1bc6[_0x283127];return _0x43da5d;};'use strict';var client=require(_0x61bc('0x0'));exports[_0x61bc('0x1')]=function(){return function(){return client[_0x61bc('0x2')](_0x61bc('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x61bc('0x4')],'include':[{'model':_0x61bc('0x5'),'as':_0x61bc('0x6'),'attributes':['id','name',_0x61bc('0x7')]}]},'log':_0x61bc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 2621375..d154066 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 _0x1afe=['../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x3efe7d,_0x4ae7c2){var _0x3dcf54=function(_0x5eaa7f){while(--_0x5eaa7f){_0x3efe7d['push'](_0x3efe7d['shift']());}};_0x3dcf54(++_0x4ae7c2);}(_0x1afe,0x108));var _0xe1af=function(_0x29bd06,_0x473c6a){_0x29bd06=_0x29bd06-0x0;var _0xff390=_0x1afe[_0x29bd06];return _0xff390;};'use strict';var client=require(_0xe1af('0x0'));exports[_0xe1af('0x1')]=function(_0x11bbda,_0xace20b){return client['Request'](_0xe1af('0x2'),{'body':_0xace20b,'options':{'where':{'id':_0x11bbda}},'log':_0xe1af('0x3')});};exports[_0xe1af('0x4')]=function(_0x1b8906,_0x51e0e7){return client[_0xe1af('0x5')](_0xe1af('0x6'),{'body':_0x51e0e7,'options':{'where':{'id':_0x1b8906}},'log':_0xe1af('0x7')});}; \ No newline at end of file +var _0x6494=['UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x3ff7f3,_0x2e820b){var _0x4bab7a=function(_0x39419b){while(--_0x39419b){_0x3ff7f3['push'](_0x3ff7f3['shift']());}};_0x4bab7a(++_0x2e820b);}(_0x6494,0xdc));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x4649('0x0'));exports[_0x4649('0x1')]=function(_0x504ad7,_0x1974f7){return client['Request'](_0x4649('0x2'),{'body':_0x1974f7,'options':{'where':{'id':_0x504ad7}},'log':_0x4649('0x3')});};exports['addTags']=function(_0x596164,_0x34b04d){return client['Request'](_0x4649('0x4'),{'body':_0x34b04d,'options':{'where':{'id':_0x596164}},'log':_0x4649('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d82ec20..5f98edf 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 _0xa48b=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x36a2ed,_0x3815d4){var _0x2b7be4=function(_0x19a0e4){while(--_0x19a0e4){_0x36a2ed['push'](_0x36a2ed['shift']());}};_0x2b7be4(++_0x3815d4);}(_0xa48b,0x16a));var _0xba48=function(_0x5a9f73,_0x19a26a){_0x5a9f73=_0x5a9f73-0x0;var _0x4e50b3=_0xa48b[_0x5a9f73];return _0x4e50b3;};'use strict';var client=require(_0xba48('0x0'));exports['create']=function(_0x49c8cc){return client[_0xba48('0x1')](_0xba48('0x2'),{'body':_0x49c8cc,'log':_0xba48('0x3')});}; \ No newline at end of file +var _0xb1ab=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x474e22,_0x5d5515){var _0x76a179=function(_0x4dc2ff){while(--_0x4dc2ff){_0x474e22['push'](_0x474e22['shift']());}};_0x76a179(++_0x5d5515);}(_0xb1ab,0x163));var _0xbb1a=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xb1ab[_0x2ca616];return _0x53155f;};'use strict';var client=require(_0xbb1a('0x0'));exports['create']=function(_0xb7c05e){return client[_0xbb1a('0x1')](_0xbb1a('0x2'),{'body':_0xb7c05e,'log':_0xbb1a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0bb8121..8deffc2 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 _0x9d84=['GetMailQueue','name','timeout','strategy','User','online','mailPause','getMailQueues','../client','Request'];(function(_0x1fec93,_0x5fa20a){var _0x1427db=function(_0x294dcd){while(--_0x294dcd){_0x1fec93['push'](_0x1fec93['shift']());}};_0x1427db(++_0x5fa20a);}(_0x9d84,0xda));var _0x49d8=function(_0x990052,_0x4b4e3f){_0x990052=_0x990052-0x0;var _0x4e5fdf=_0x9d84[_0x990052];return _0x4e5fdf;};'use strict';var client=require(_0x49d8('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x49d8('0x1')](_0x49d8('0x2'),{'options':{'raw':![],'attributes':['id',_0x49d8('0x3'),_0x49d8('0x4'),_0x49d8('0x5')],'include':[{'model':_0x49d8('0x6'),'as':'Agents','attributes':['id',_0x49d8('0x3'),_0x49d8('0x7'),_0x49d8('0x8')]}]},'log':_0x49d8('0x9')});};}; \ No newline at end of file +var _0x885e=['strategy','Agents','mailPause','../client','getMailQueues','GetMailQueue','name','timeout'];(function(_0x3171d0,_0x259433){var _0x1ddb2a=function(_0x25df57){while(--_0x25df57){_0x3171d0['push'](_0x3171d0['shift']());}};_0x1ddb2a(++_0x259433);}(_0x885e,0x183));var _0xe885=function(_0x4cb322,_0x170d52){_0x4cb322=_0x4cb322-0x0;var _0x39649c=_0x885e[_0x4cb322];return _0x39649c;};'use strict';var client=require(_0xe885('0x0'));exports[_0xe885('0x1')]=function(){return function(){return client['Request'](_0xe885('0x2'),{'options':{'raw':![],'attributes':['id',_0xe885('0x3'),_0xe885('0x4'),_0xe885('0x5')],'include':[{'model':'User','as':_0xe885('0x6'),'attributes':['id',_0xe885('0x3'),'online',_0xe885('0x7')]}]},'log':_0xe885('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index b69408d..a7d8f94 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 _0x226c=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x56ce9b,_0x3ecf1f){var _0x4d34b0=function(_0x5c25f0){while(--_0x5c25f0){_0x56ce9b['push'](_0x56ce9b['shift']());}};_0x4d34b0(++_0x3ecf1f);}(_0x226c,0xad));var _0xc226=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x226c[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xc226('0x0'));exports['create']=function(_0xad3ab7){return client[_0xc226('0x1')](_0xc226('0x2'),{'body':_0xad3ab7,'log':'CreateMailQueueReport'});};exports[_0xc226('0x3')]=function(_0x2b85e2,_0x41b6ad){return client['Request'](_0xc226('0x4'),{'body':_0x41b6ad,'options':{'where':{'uniqueid':_0x2b85e2},'order':[['id',_0xc226('0x5')]],'limit':0x1},'log':_0xc226('0x4')});}; \ No newline at end of file +var _0x085b=['update','UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x493dda,_0x1528d3){var _0x31a5a6=function(_0x43c676){while(--_0x43c676){_0x493dda['push'](_0x493dda['shift']());}};_0x31a5a6(++_0x1528d3);}(_0x085b,0x93));var _0xb085=function(_0x55042e,_0x10aa58){_0x55042e=_0x55042e-0x0;var _0x9871fc=_0x085b[_0x55042e];return _0x9871fc;};'use strict';var client=require(_0xb085('0x0'));exports['create']=function(_0x334033){return client[_0xb085('0x1')](_0xb085('0x2'),{'body':_0x334033,'log':_0xb085('0x2')});};exports[_0xb085('0x3')]=function(_0x3dfe4d,_0x2b608b){return client[_0xb085('0x1')](_0xb085('0x4'),{'body':_0x2b608b,'options':{'where':{'uniqueid':_0x3dfe4d},'order':[['id',_0xb085('0x5')]],'limit':0x1},'log':_0xb085('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index fc3a23a..0509c36 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 _0x39cc=['../client','Request','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x265786,_0xa72e13){var _0x4c1683=function(_0xc00989){while(--_0xc00989){_0x265786['push'](_0x265786['shift']());}};_0x4c1683(++_0xa72e13);}(_0x39cc,0x1a9));var _0xc39c=function(_0x24c46b,_0x6714ed){_0x24c46b=_0x24c46b-0x0;var _0x291b2e=_0x39cc[_0x24c46b];return _0x291b2e;};'use strict';var client=require(_0xc39c('0x0'));exports['update']=function(_0x27805b,_0x5d64d5){return client[_0xc39c('0x1')]('UpdateOpenchannelInteraction',{'body':_0x5d64d5,'options':{'where':{'id':_0x27805b}},'log':'updateOpenchannelInteraction'});};exports[_0xc39c('0x2')]=function(_0x5b75c1,_0x4187b0){return client['Request'](_0xc39c('0x3'),{'body':_0x4187b0,'options':{'where':{'id':_0x5b75c1}},'log':_0xc39c('0x4')});}; \ No newline at end of file +var _0xe937=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe937,0x74));var _0x7e93=function(_0x21d5c6,_0x405f7e){_0x21d5c6=_0x21d5c6-0x0;var _0x2e578c=_0xe937[_0x21d5c6];return _0x2e578c;};'use strict';var client=require(_0x7e93('0x0'));exports['update']=function(_0x77a05,_0xfde95){return client[_0x7e93('0x1')](_0x7e93('0x2'),{'body':_0xfde95,'options':{'where':{'id':_0x77a05}},'log':_0x7e93('0x3')});};exports['addTags']=function(_0x1d2e86,_0xfff57d){return client[_0x7e93('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0xfff57d,'options':{'where':{'id':_0x1d2e86}},'log':_0x7e93('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 695d5db..ddc41b2 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 _0x70e0=['createOpenchannelMessage','../client','create'];(function(_0x37ce45,_0xda6746){var _0x17d5f7=function(_0x559ab7){while(--_0x559ab7){_0x37ce45['push'](_0x37ce45['shift']());}};_0x17d5f7(++_0xda6746);}(_0x70e0,0x17b));var _0x070e=function(_0x556159,_0x2c3e5d){_0x556159=_0x556159-0x0;var _0x3f0635=_0x70e0[_0x556159];return _0x3f0635;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateOpenchannelMessage',{'body':_0x198c2e,'log':_0x070e('0x2')});}; \ No newline at end of file +var _0x9f62=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2f1f2c,_0x42ef4c){var _0x3934c1=function(_0x348fe2){while(--_0x348fe2){_0x2f1f2c['push'](_0x2f1f2c['shift']());}};_0x3934c1(++_0x42ef4c);}(_0x9f62,0x154));var _0x29f6=function(_0x1f33b0,_0x2245db){_0x1f33b0=_0x1f33b0-0x0;var _0x505ac0=_0x9f62[_0x1f33b0];return _0x505ac0;};'use strict';var client=require('../client');exports[_0x29f6('0x0')]=function(_0x4ce7cb){return client[_0x29f6('0x1')](_0x29f6('0x2'),{'body':_0x4ce7cb,'log':_0x29f6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6407c41..fbbe344 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 _0xc76d=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc76d,0x19d));var _0xdc76=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xc76d[_0x3932eb];return _0x5316e5;};'use strict';var client=require(_0xdc76('0x0'));exports[_0xdc76('0x1')]=function(){return function(){return client[_0xdc76('0x2')](_0xdc76('0x3'),{'options':{'raw':![],'attributes':['id',_0xdc76('0x4'),'timeout',_0xdc76('0x5')],'include':[{'model':_0xdc76('0x6'),'as':_0xdc76('0x7'),'attributes':['id',_0xdc76('0x4'),_0xdc76('0x8'),_0xdc76('0x9')]}]},'log':_0xdc76('0x1')});};}; \ No newline at end of file +var _0x01a0=['name','strategy','User','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x3debe3,_0x3cf2fc){var _0x2eb390=function(_0x5ae141){while(--_0x5ae141){_0x3debe3['push'](_0x3debe3['shift']());}};_0x2eb390(++_0x3cf2fc);}(_0x01a0,0xd4));var _0x001a=function(_0x1f87d4,_0x13f49d){_0x1f87d4=_0x1f87d4-0x0;var _0x3e2664=_0x01a0[_0x1f87d4];return _0x3e2664;};'use strict';var client=require(_0x001a('0x0'));exports[_0x001a('0x1')]=function(){return function(){return client[_0x001a('0x2')](_0x001a('0x3'),{'options':{'raw':![],'attributes':['id',_0x001a('0x4'),'timeout',_0x001a('0x5')],'include':[{'model':_0x001a('0x6'),'as':'Agents','attributes':['id','name',_0x001a('0x7'),_0x001a('0x8')]}]},'log':_0x001a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d28118a..781452e 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 _0x667e=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x1ca741,_0x5c758c){var _0x54a577=function(_0x574b9f){while(--_0x574b9f){_0x1ca741['push'](_0x1ca741['shift']());}};_0x54a577(++_0x5c758c);}(_0x667e,0x1e4));var _0xe667=function(_0x4e0779,_0x5dd987){_0x4e0779=_0x4e0779-0x0;var _0x501bfc=_0x667e[_0x4e0779];return _0x501bfc;};'use strict';var client=require('../client');exports[_0xe667('0x0')]=function(_0x20b6c1){return client['Request'](_0xe667('0x1'),{'body':_0x20b6c1,'log':_0xe667('0x1')});};exports[_0xe667('0x2')]=function(_0x3e67f6,_0x14c039){return client['Request'](_0xe667('0x3'),{'body':_0x14c039,'options':{'where':{'uniqueid':_0x3e67f6},'order':[['id',_0xe667('0x4')]],'limit':0x1},'log':_0xe667('0x3')});}; \ No newline at end of file +var _0x83bd=['DESC','UpdateOpenchannelQueueReport','CreateOpenchannelQueueReport','update'];(function(_0x2314a0,_0x2da91a){var _0x502581=function(_0x203e0c){while(--_0x203e0c){_0x2314a0['push'](_0x2314a0['shift']());}};_0x502581(++_0x2da91a);}(_0x83bd,0x182));var _0xd83b=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x83bd[_0x456032];return _0x1a53cd;};'use strict';var client=require('../client');exports['create']=function(_0x627f2b){return client['Request'](_0xd83b('0x0'),{'body':_0x627f2b,'log':'CreateOpenchannelQueueReport'});};exports[_0xd83b('0x1')]=function(_0x32c1a9,_0x3a65a1){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x3a65a1,'options':{'where':{'uniqueid':_0x32c1a9},'order':[['id',_0xd83b('0x2')]],'limit':0x1},'log':_0xd83b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9c934ae..4d7ab39 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 _0xf162=['AddTagsToSmsInteraction','addTagsToSmsInteraction','UpdateSmsInteraction','addTags','Request'];(function(_0x3ab511,_0x5cb3e6){var _0x3b7b79=function(_0x364255){while(--_0x364255){_0x3ab511['push'](_0x3ab511['shift']());}};_0x3b7b79(++_0x5cb3e6);}(_0xf162,0x8e));var _0x2f16=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf162[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports['update']=function(_0x238d37,_0x3bb203){return client['Request'](_0x2f16('0x0'),{'body':_0x3bb203,'options':{'where':{'id':_0x238d37}},'log':'updateSmsInteraction'});};exports[_0x2f16('0x1')]=function(_0x5d68d4,_0x26ba48){return client[_0x2f16('0x2')](_0x2f16('0x3'),{'body':_0x26ba48,'options':{'where':{'id':_0x5d68d4}},'log':_0x2f16('0x4')});}; \ No newline at end of file +var _0x77ca=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','UpdateSmsInteraction','updateSmsInteraction','addTags','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77ca,0x12f));var _0xa77c=function(_0x134d41,_0x22e6a0){_0x134d41=_0x134d41-0x0;var _0x423dcd=_0x77ca[_0x134d41];return _0x423dcd;};'use strict';var client=require(_0xa77c('0x0'));exports['update']=function(_0x4b614c,_0x126e91){return client['Request'](_0xa77c('0x1'),{'body':_0x126e91,'options':{'where':{'id':_0x4b614c}},'log':_0xa77c('0x2')});};exports[_0xa77c('0x3')]=function(_0xb43b78,_0x23e5d3){return client[_0xa77c('0x4')](_0xa77c('0x5'),{'body':_0x23e5d3,'options':{'where':{'id':_0xb43b78}},'log':_0xa77c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e62db50..bcfcec8 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 _0x099f=['create','CreateSmsMessage','createSmsMessage','../client'];(function(_0x529d3a,_0x5dc6e1){var _0xd104ce=function(_0x463d65){while(--_0x463d65){_0x529d3a['push'](_0x529d3a['shift']());}};_0xd104ce(++_0x5dc6e1);}(_0x099f,0x12f));var _0xf099=function(_0x3b4a5c,_0x58fbf5){_0x3b4a5c=_0x3b4a5c-0x0;var _0x31512d=_0x099f[_0x3b4a5c];return _0x31512d;};'use strict';var client=require(_0xf099('0x0'));exports[_0xf099('0x1')]=function(_0x4748e3){return client['Request'](_0xf099('0x2'),{'body':_0x4748e3,'log':_0xf099('0x3')});}; \ No newline at end of file +var _0xa859=['create','Request','CreateSmsMessage','../client'];(function(_0x314a04,_0x357066){var _0x57bace=function(_0x4d178c){while(--_0x4d178c){_0x314a04['push'](_0x314a04['shift']());}};_0x57bace(++_0x357066);}(_0xa859,0x77));var _0x9a85=function(_0x35069a,_0x4bcd1b){_0x35069a=_0x35069a-0x0;var _0x5bdba6=_0xa859[_0x35069a];return _0x5bdba6;};'use strict';var client=require(_0x9a85('0x0'));exports[_0x9a85('0x1')]=function(_0x28d651){return client[_0x9a85('0x2')](_0x9a85('0x3'),{'body':_0x28d651,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index f25a3a4..e0c346c 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 _0xb69e=['name','online','smsPause','../client','GetSmsQueue','timeout','User','Agents'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0xb69e,0xb3));var _0xeb69=function(_0x3f9fd1,_0x37ccfa){_0x3f9fd1=_0x3f9fd1-0x0;var _0x56f28b=_0xb69e[_0x3f9fd1];return _0x56f28b;};'use strict';var client=require(_0xeb69('0x0'));exports['getSmsQueues']=function(){return function(){return client['Request'](_0xeb69('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xeb69('0x2'),'strategy'],'include':[{'model':_0xeb69('0x3'),'as':_0xeb69('0x4'),'attributes':['id',_0xeb69('0x5'),_0xeb69('0x6'),_0xeb69('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0f37=['strategy','User','Agents','online','smsPause','getSmsQueues','GetSmsQueue','name','timeout'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x0f37,0x191));var _0x70f3=function(_0x5fe7ce,_0x1a0d39){_0x5fe7ce=_0x5fe7ce-0x0;var _0x3b5793=_0x0f37[_0x5fe7ce];return _0x3b5793;};'use strict';var client=require('../client');exports[_0x70f3('0x0')]=function(){return function(){return client['Request'](_0x70f3('0x1'),{'options':{'raw':![],'attributes':['id',_0x70f3('0x2'),_0x70f3('0x3'),_0x70f3('0x4')],'include':[{'model':_0x70f3('0x5'),'as':_0x70f3('0x6'),'attributes':['id',_0x70f3('0x2'),_0x70f3('0x7'),_0x70f3('0x8')]}]},'log':_0x70f3('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 2c88b7f..327c8db 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 _0xa596=['CreateSmsQueueReport','update','UpdateSmsQueueReport','../client','create','Request'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xa596,0x7b));var _0x6a59=function(_0x191a2f,_0x51f15e){_0x191a2f=_0x191a2f-0x0;var _0x5d1402=_0xa596[_0x191a2f];return _0x5d1402;};'use strict';var client=require(_0x6a59('0x0'));exports[_0x6a59('0x1')]=function(_0x5b127f){return client[_0x6a59('0x2')](_0x6a59('0x3'),{'body':_0x5b127f,'log':_0x6a59('0x3')});};exports[_0x6a59('0x4')]=function(_0x2922e5,_0xf0435f){return client[_0x6a59('0x2')](_0x6a59('0x5'),{'body':_0xf0435f,'options':{'where':{'uniqueid':_0x2922e5},'order':[['id','DESC']],'limit':0x1},'log':_0x6a59('0x5')});}; \ No newline at end of file +var _0xff89=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3cbdb1,_0x1b055b){var _0x32100b=function(_0x201b6c){while(--_0x201b6c){_0x3cbdb1['push'](_0x3cbdb1['shift']());}};_0x32100b(++_0x1b055b);}(_0xff89,0x149));var _0x9ff8=function(_0x2be5e9,_0x4012aa){_0x2be5e9=_0x2be5e9-0x0;var _0x39851a=_0xff89[_0x2be5e9];return _0x39851a;};'use strict';var client=require(_0x9ff8('0x0'));exports[_0x9ff8('0x1')]=function(_0x3cab3f){return client[_0x9ff8('0x2')](_0x9ff8('0x3'),{'body':_0x3cab3f,'log':_0x9ff8('0x3')});};exports[_0x9ff8('0x4')]=function(_0x22454d,_0x251e93){return client[_0x9ff8('0x2')](_0x9ff8('0x5'),{'body':_0x251e93,'options':{'where':{'uniqueid':_0x22454d},'order':[['id',_0x9ff8('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b050cc5..575b155 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 _0x7fd7=['faxPause','smsPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','online','pauseType','lastPauseAt','chatPause','mailPause'];(function(_0x5a3ba1,_0x3ddc79){var _0x21ac58=function(_0x59d09c){while(--_0x59d09c){_0x5a3ba1['push'](_0x5a3ba1['shift']());}};_0x21ac58(++_0x3ddc79);}(_0x7fd7,0x87));var _0x77fd=function(_0x20d08e,_0x4cc575){_0x20d08e=_0x20d08e-0x0;var _0x2cbd12=_0x7fd7[_0x20d08e];return _0x2cbd12;};'use strict';var client=require(_0x77fd('0x0'));exports[_0x77fd('0x1')]=function(){return function(){return client[_0x77fd('0x2')](_0x77fd('0x3'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id','name',_0x77fd('0x4'),_0x77fd('0x5'),_0x77fd('0x6'),'voicePause',_0x77fd('0x7'),_0x77fd('0x8'),_0x77fd('0x9'),_0x77fd('0xa'),'openchannelPause',_0x77fd('0xb'),_0x77fd('0xc'),_0x77fd('0xd'),_0x77fd('0xe'),_0x77fd('0xf')]},'log':_0x77fd('0x1')});};}; \ No newline at end of file +var _0xd6c1=['Request','agent','name','online','lastPauseAt','voicePause','chatPause','mailPause','faxPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents'];(function(_0x47da2b,_0x2f0d65){var _0x147a1d=function(_0x2b1c0e){while(--_0x2b1c0e){_0x47da2b['push'](_0x47da2b['shift']());}};_0x147a1d(++_0x2f0d65);}(_0xd6c1,0x17e));var _0x1d6c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd6c1[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x1d6c('0x0'));exports[_0x1d6c('0x1')]=function(){return function(){return client[_0x1d6c('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x1d6c('0x3')},'attributes':['id',_0x1d6c('0x4'),_0x1d6c('0x5'),'pauseType',_0x1d6c('0x6'),_0x1d6c('0x7'),_0x1d6c('0x8'),_0x1d6c('0x9'),_0x1d6c('0xa'),'smsPause',_0x1d6c('0xb'),'chatCapacity',_0x1d6c('0xc'),_0x1d6c('0xd'),_0x1d6c('0xe'),_0x1d6c('0xf')]},'log':'getAgents'});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 6e0d4b6..09e6821 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 _0x642d=['map','message','join','stop','find','agents','timeout','createQueue','channel','format','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s'];(function(_0xbf4ddf,_0x66b3cb){var _0x3cb273=function(_0x3cf903){while(--_0x3cf903){_0xbf4ddf['push'](_0xbf4ddf['shift']());}};_0x3cb273(++_0x66b3cb);}(_0x642d,0xc9));var _0xd642=function(_0x32000a,_0x509455){_0x32000a=_0x32000a-0x0;var _0x5c441e=_0x642d[_0x32000a];return _0x5c441e;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0xd642('0x0'));var logger=require(_0xd642('0x1'))('routing');var strategy=require(_0xd642('0x2'));var queue=schema({'name':{'type':_0xd642('0x3'),'required':!![],'message':_0xd642('0x4')},'timeout':{'type':_0xd642('0x5'),'message':_0xd642('0x6')}});function writeLog(_0x298bdc,_0x16401c,_0xf3bd5f){return logger[_0xd642('0x7')](util['format'](_0xd642('0x8'),_0x298bdc,_0x16401c[_0xd642('0x9')],_0xf3bd5f));}function handleFindAgent(_0x2a1e51){return function(_0x5ee4f5){return _0x5ee4f5['name'][_0xd642('0xa')]()===_0x2a1e51[_0xd642('0xa')]();};}exports[_0xd642('0xb')]=function(_0x29c1cf,_0x32f361,_0x33ab6d,_0x223758){return function(_0x2effd6){try{var _0x1672da={'name':_0x32f361[0x0],'timeout':_0x32f361[0x1]};var _0x50b405=queue[_0xd642('0xc')](_0x1672da,{'typecast':!![]});if(_0x50b405['length']){logger[_0xd642('0xd')](_0xd642('0xe'),_0x29c1cf,_[_0xd642('0xf')](_0x50b405,_0xd642('0x10'))[_0xd642('0x11')](',\x20'));_0x2effd6[_0xd642('0x12')]();}else{var _0x5f4224=_[_0xd642('0x13')](_0x33ab6d[_0xd642('0x14')],handleFindAgent(_0x1672da[_0xd642('0x9')]));if(_0x5f4224){var _0x4bd053=(_0x1672da[_0xd642('0x15')]||0xa)*0x3e8;var _0x2d44dd,_0x24e22c;var _0x2f824a=seqqueue[_0xd642('0x16')](_0x4bd053);_0x2f824a['id']=_0x29c1cf;_0x2f824a['atimeout']=_0x4bd053;_0x2f824a[_0xd642('0x17')]=_0x223758[_0xd642('0x17')];writeLog(_0x29c1cf,_0x5f4224,util[_0xd642('0x18')](_0xd642('0x19'),_0x4bd053));_0x33ab6d['rules'][_0x29c1cf]['on'](_0xd642('0x1a'),function(){_0x2f824a[_0xd642('0x1b')]();clearTimeout(_0x24e22c);_0x24e22c=undefined;if(_0x33ab6d[_0xd642('0x1c')][_0x29c1cf]){delete _0x33ab6d[_0xd642('0x1c')][_0x29c1cf];}logger[_0xd642('0x7')](_0xd642('0x1d'),_0x29c1cf);_0x2effd6[_0xd642('0x12')]();});_0x24e22c=setTimeout(function(){clearTimeout(_0x24e22c);_0x2f824a['close']();logger[_0xd642('0x7')](_0xd642('0x1e'),_0x29c1cf);_0x2effd6[_0xd642('0x1f')]();},_0x4bd053);strategy[_0xd642('0x20')](_0x2f824a,_0x5f4224,_0x33ab6d,_0x223758);}else{logger[_0xd642('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x29c1cf,_0x1672da['name']);_0x2effd6[_0xd642('0x12')]();}}}catch(_0x2a8bf3){console[_0xd642('0x21')](_0x2a8bf3);logger[_0xd642('0xd')](_0xd642('0x22'),_0x29c1cf,_0x2a8bf3[_0xd642('0x23')]);_0x2effd6[_0xd642('0x12')]();}};}; \ No newline at end of file +var _0xf360=['name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','stack','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format'];(function(_0x467fa4,_0x22c10a){var _0x5cf921=function(_0x4fe348){while(--_0x4fe348){_0x467fa4['push'](_0x467fa4['shift']());}};_0x5cf921(++_0x22c10a);}(_0xf360,0x14a));var _0x0f36=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf360[_0x17d9e3];return _0x14192d;};'use strict';var schema=require(_0x0f36('0x0'));var _=require(_0x0f36('0x1'));var util=require(_0x0f36('0x2'));var seqqueue=require(_0x0f36('0x3'));var logger=require('../../../../config/logger')(_0x0f36('0x4'));var strategy=require(_0x0f36('0x5'));var queue=schema({'name':{'type':_0x0f36('0x6'),'required':!![],'message':_0x0f36('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2cd3dc,_0x11a651,_0x13432d){return logger[_0x0f36('0x8')](util[_0x0f36('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2cd3dc,_0x11a651[_0x0f36('0xa')],_0x13432d));}function handleFindAgent(_0x3f27a4){return function(_0x58556a){return _0x58556a['name'][_0x0f36('0xb')]()===_0x3f27a4['toLowerCase']();};}exports[_0x0f36('0xc')]=function(_0x3a0014,_0x4c4fb6,_0x5c4c9e,_0x56c334){return function(_0x672cb6){try{var _0x13edd0={'name':_0x4c4fb6[0x0],'timeout':_0x4c4fb6[0x1]};var _0x36398b=queue['validate'](_0x13edd0,{'typecast':!![]});if(_0x36398b[_0x0f36('0xd')]){logger['error'](_0x0f36('0xe'),_0x3a0014,_[_0x0f36('0xf')](_0x36398b,_0x0f36('0x10'))[_0x0f36('0x11')](',\x20'));_0x672cb6[_0x0f36('0x12')]();}else{var _0x4864d9=_[_0x0f36('0x13')](_0x5c4c9e[_0x0f36('0x14')],handleFindAgent(_0x13edd0[_0x0f36('0xa')]));if(_0x4864d9){var _0x297335=(_0x13edd0[_0x0f36('0x15')]||0xa)*0x3e8;var _0x49ff15,_0x433d64;var _0x161c85=seqqueue[_0x0f36('0x16')](_0x297335);_0x161c85['id']=_0x3a0014;_0x161c85[_0x0f36('0x17')]=_0x297335;_0x161c85['channel']=_0x56c334['channel'];writeLog(_0x3a0014,_0x4864d9,util[_0x0f36('0x9')](_0x0f36('0x18'),_0x297335));_0x5c4c9e[_0x0f36('0x19')][_0x3a0014]['on'](_0x0f36('0x1a'),function(){_0x161c85[_0x0f36('0x1b')]();clearTimeout(_0x433d64);_0x433d64=undefined;if(_0x5c4c9e['rules'][_0x3a0014]){delete _0x5c4c9e['rules'][_0x3a0014];}logger[_0x0f36('0x8')](_0x0f36('0x1c'),_0x3a0014);_0x672cb6['stop']();});_0x433d64=setTimeout(function(){clearTimeout(_0x433d64);_0x161c85['close']();logger[_0x0f36('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x3a0014);_0x672cb6[_0x0f36('0x1d')]();},_0x297335);strategy['agent'](_0x161c85,_0x4864d9,_0x5c4c9e,_0x56c334);}else{logger['error'](_0x0f36('0x1e'),_0x3a0014,_0x13edd0[_0x0f36('0xa')]);_0x672cb6[_0x0f36('0x12')]();}}}catch(_0x282369){console[_0x0f36('0x1f')](_0x282369);logger[_0x0f36('0x20')]('[%s][QUEUE]\x20%s',_0x3a0014,_0x282369[_0x0f36('0x21')]);_0x672cb6[_0x0f36('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index edbcb99..d172f09 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 _0xf7f4=['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','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','create','body','catch','error','stringify'];(function(_0x20f2fb,_0x78fdaa){var _0x7861ad=function(_0x11f358){while(--_0x11f358){_0x20f2fb['push'](_0x20f2fb['shift']());}};_0x7861ad(++_0x78fdaa);}(_0xf7f4,0xe3));var _0x4f7f=function(_0x54dce1,_0x4e182f){_0x54dce1=_0x54dce1-0x0;var _0x33e5ef=_0xf7f4[_0x54dce1];return _0x33e5ef;};'use strict';var _=require(_0x4f7f('0x0'));var moment=require(_0x4f7f('0x1'));var AWS=require(_0x4f7f('0x2'));var utils=require(_0x4f7f('0x3'));var logger=require(_0x4f7f('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4f7f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4f7f('0x6')),'faxMessage':require(_0x4f7f('0x7'))};exports[_0x4f7f('0x8')]=function(_0x48dcee,_0x31d6f2){return function(_0x54b73f){try{if(!_['isNil'](this[_0x4f7f('0x9')][_0x4f7f('0xa')])){logger[_0x4f7f('0xb')](_0x4f7f('0xc'),_0x48dcee,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x54b73f[_0x4f7f('0xd')]();}var _0x3859d0={'ContactId':this[_0x4f7f('0xe')]['id'],'sentAt':moment()[_0x4f7f('0xf')](_0x4f7f('0x10')),'direction':'out'};var _0x3e899f=this[_0x4f7f('0x11')];if(_0x3e899f===_0x4f7f('0x12')){_0x3859d0['ChatWebsiteId']=this['account']['id'];}else{_0x3859d0[_[_0x4f7f('0x13')](_0x3e899f)+_0x4f7f('0x14')]=this[_0x4f7f('0x15')]['id'];}_0x3859d0[_[_0x4f7f('0x13')](_0x3e899f)+_0x4f7f('0x16')]=this['interaction']['id'];if(this[_0x4f7f('0x9')][_0x4f7f('0x17')]){var _0x3743d9=_0x31d6f2[0x4];if(!_[_0x4f7f('0x18')](_0x3743d9)){_0x3859d0['body']=utils[_0x4f7f('0x19')](_0x3743d9,this);return rpc[_0x3e899f+'Message'][_0x4f7f('0x1a')](_0x3859d0)['then'](function(_0x486581){logger[_0x4f7f('0xb')](_0x4f7f('0xc'),_0x48dcee,_0x3859d0[_0x4f7f('0x1b')]);})[_0x4f7f('0x1c')](function(_0x84c0ce){logger[_0x4f7f('0x1d')](_0x4f7f('0xc'),_0x48dcee,JSON[_0x4f7f('0x1e')](_0x84c0ce));})[_0x4f7f('0x1f')](function(){logger[_0x4f7f('0xb')](_0x4f7f('0x20'),_0x48dcee);_0x54b73f[_0x4f7f('0x21')]();});}else{logger[_0x4f7f('0xb')](_0x4f7f('0x22'),_0x48dcee);_0x54b73f['stop']();}}else{var _0x49bb3e=this;var _0x1caeb8=new AWS[(_0x4f7f('0x23'))]({'accessKeyId':_0x31d6f2[0x0],'secretAccessKey':_0x31d6f2[0x1],'region':_0x31d6f2[0x2]});var _0x2fef93={'botAlias':_0x4f7f('0x24'),'botName':_0x31d6f2[0x3],'inputText':this[_0x4f7f('0x25')][_0x4f7f('0x1b')],'userId':this[_0x4f7f('0x9')]['id'][_0x4f7f('0x26')]()};_0x1caeb8[_0x4f7f('0x27')](_0x2fef93,function(_0xcd5c31,_0x4885a1){if(_0xcd5c31){logger[_0x4f7f('0x1d')](_0x4f7f('0xc'),_0x48dcee,_0xcd5c31[_0x4f7f('0x25')]);_0x54b73f[_0x4f7f('0xd')]();}else if(_0x4885a1&&_0x4885a1[_0x4f7f('0x25')]){_0x49bb3e[_0x4f7f('0x1b')]['amazonlex']=_0x4885a1;_0x3859d0['body']=_0x4885a1['message'];return rpc[_0x3e899f+'Message']['create'](_0x3859d0)[_0x4f7f('0x28')](function(_0x353104){logger[_0x4f7f('0xb')](_0x4f7f('0xc'),_0x48dcee,_0x3859d0[_0x4f7f('0x1b')]);if(_0x4885a1[_0x4f7f('0x29')]==_0x4f7f('0x2a')){_0x54b73f['next']();}else{_0x54b73f['stop']();}})[_0x4f7f('0x1c')](function(_0x2f90b0){logger[_0x4f7f('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x48dcee,JSON[_0x4f7f('0x1e')](_0x2f90b0));_0x54b73f[_0x4f7f('0xd')]();});}else{_0x54b73f[_0x4f7f('0xd')]();}});}}catch(_0x82e82){logger[_0x4f7f('0x1d')](_0x4f7f('0xc'),_0x48dcee,JSON['stringify'](_0x82e82));_0x54b73f[_0x4f7f('0x21')]();}};}; \ No newline at end of file +var _0xf8ad=['format','channel','chat','upperFirst','AccountId','account','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','then','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x3bad49,_0x190182){var _0x48f3ec=function(_0x251289){while(--_0x251289){_0x3bad49['push'](_0x3bad49['shift']());}};_0x48f3ec(++_0x190182);}(_0xf8ad,0xa3));var _0xdf8a=function(_0x3c721f,_0x1c1224){_0x3c721f=_0x3c721f-0x0;var _0x4cc4b7=_0xf8ad[_0x3c721f];return _0x4cc4b7;};'use strict';var _=require(_0xdf8a('0x0'));var moment=require(_0xdf8a('0x1'));var AWS=require('aws-sdk');var utils=require(_0xdf8a('0x2'));var logger=require(_0xdf8a('0x3'))(_0xdf8a('0x4'));var rpc={'chatMessage':require(_0xdf8a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdf8a('0x6')),'smsMessage':require(_0xdf8a('0x7')),'faxMessage':require(_0xdf8a('0x8'))};exports[_0xdf8a('0x9')]=function(_0x500dfc,_0x26ff79){return function(_0x24117e){try{if(!_[_0xdf8a('0xa')](this['interaction'][_0xdf8a('0xb')])){logger[_0xdf8a('0xc')](_0xdf8a('0xd'),_0x500dfc,_0xdf8a('0xe'));return _0x24117e[_0xdf8a('0xf')]();}var _0x2dfb59={'ContactId':this[_0xdf8a('0x10')]['id'],'sentAt':moment()[_0xdf8a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x1e2981=this[_0xdf8a('0x12')];if(_0x1e2981===_0xdf8a('0x13')){_0x2dfb59['ChatWebsiteId']=this['account']['id'];}else{_0x2dfb59[_[_0xdf8a('0x14')](_0x1e2981)+_0xdf8a('0x15')]=this[_0xdf8a('0x16')]['id'];}_0x2dfb59[_[_0xdf8a('0x14')](_0x1e2981)+_0xdf8a('0x17')]=this[_0xdf8a('0x18')]['id'];if(this[_0xdf8a('0x18')][_0xdf8a('0x19')]){var _0xd1caf2=_0x26ff79[0x4];if(!_[_0xdf8a('0x1a')](_0xd1caf2)){_0x2dfb59[_0xdf8a('0x1b')]=utils[_0xdf8a('0x1c')](_0xd1caf2,this);return rpc[_0x1e2981+_0xdf8a('0x1d')][_0xdf8a('0x1e')](_0x2dfb59)['then'](function(_0x4c1dcb){logger[_0xdf8a('0xc')]('[%s][AMAZONLEX]\x20%s',_0x500dfc,_0x2dfb59[_0xdf8a('0x1b')]);})['catch'](function(_0x232491){logger[_0xdf8a('0x1f')](_0xdf8a('0xd'),_0x500dfc,JSON[_0xdf8a('0x20')](_0x232491));})['finally'](function(){logger[_0xdf8a('0xc')](_0xdf8a('0x21'),_0x500dfc);_0x24117e[_0xdf8a('0x22')]();});}else{logger[_0xdf8a('0xc')](_0xdf8a('0x23'),_0x500dfc);_0x24117e['stop']();}}else{var _0x8fb5f3=this;var _0x3e7672=new AWS[(_0xdf8a('0x24'))]({'accessKeyId':_0x26ff79[0x0],'secretAccessKey':_0x26ff79[0x1],'region':_0x26ff79[0x2]});var _0x34f4a3={'botAlias':_0xdf8a('0x25'),'botName':_0x26ff79[0x3],'inputText':this[_0xdf8a('0x26')][_0xdf8a('0x1b')],'userId':this['interaction']['id'][_0xdf8a('0x27')]()};_0x3e7672[_0xdf8a('0x28')](_0x34f4a3,function(_0x57ad41,_0x1e3990){if(_0x57ad41){logger['error'](_0xdf8a('0xd'),_0x500dfc,_0x57ad41[_0xdf8a('0x26')]);_0x24117e[_0xdf8a('0xf')]();}else if(_0x1e3990&&_0x1e3990[_0xdf8a('0x26')]){_0x8fb5f3[_0xdf8a('0x1b')]['amazonlex']=_0x1e3990;_0x2dfb59[_0xdf8a('0x1b')]=_0x1e3990[_0xdf8a('0x26')];return rpc[_0x1e2981+_0xdf8a('0x1d')][_0xdf8a('0x1e')](_0x2dfb59)[_0xdf8a('0x29')](function(_0x233944){logger['info'](_0xdf8a('0xd'),_0x500dfc,_0x2dfb59['body']);if(_0x1e3990[_0xdf8a('0x2a')]==_0xdf8a('0x2b')){_0x24117e[_0xdf8a('0xf')]();}else{_0x24117e[_0xdf8a('0x22')]();}})[_0xdf8a('0x2c')](function(_0x420868){logger['error'](_0xdf8a('0xd'),_0x500dfc,JSON['stringify'](_0x420868));_0x24117e['next']();});}else{_0x24117e[_0xdf8a('0xf')]();}});}}catch(_0x33d10d){logger[_0xdf8a('0x1f')](_0xdf8a('0xd'),_0x500dfc,JSON['stringify'](_0x33d10d));_0x24117e['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 5a153e7..18c35ca 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 _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(_0x4c6840,_0x97fe36){var _0x23e354=function(_0x5de5d7){while(--_0x5de5d7){_0x4c6840['push'](_0x4c6840['shift']());}};_0x23e354(++_0x97fe36);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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 +var _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x369ed8,_0x2527a3){var _0x3157b9=function(_0x237cab){while(--_0x237cab){_0x369ed8['push'](_0x369ed8['shift']());}};_0x3157b9(++_0x2527a3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 736ef89..845e28a 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 _0x5706=['../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction'];(function(_0x282079,_0x174141){var _0x39400e=function(_0x478ad6){while(--_0x478ad6){_0x282079['push'](_0x282079['shift']());}};_0x39400e(++_0x174141);}(_0x5706,0xb0));var _0x6570=function(_0x4b0388,_0x3749fb){_0x4b0388=_0x4b0388-0x0;var _0x5c3406=_0x5706[_0x4b0388];return _0x5c3406;};'use strict';var moment=require(_0x6570('0x0'));var logger=require(_0x6570('0x1'))(_0x6570('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6570('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x6570('0x4')),'faxInteraction':require(_0x6570('0x5'))};exports[_0x6570('0x6')]=function(_0x26e23c,_0x41adac,_0x14d076,_0x3ae2f1){return function(_0x3eb22a){try{logger[_0x6570('0x7')](_0x6570('0x8'),_0x26e23c,_0x41adac[0x0]);var _0x528392={'closed':0x1,'closedAt':moment()['format'](_0x6570('0x9')),'closeReason':_0x6570('0xa'),'disposition':_0x41adac[0x0]};if(rpc[_0x3ae2f1[_0x6570('0xb')]+_0x6570('0xc')]){rpc[_0x3ae2f1[_0x6570('0xb')]+_0x6570('0xc')]['update'](_0x3ae2f1['interaction']['id'],_0x528392)['then'](function(_0x1872c4){logger[_0x6570('0x7')](_0x6570('0xd'),_0x26e23c,_0x3ae2f1[_0x6570('0xe')]['id']);})[_0x6570('0xf')](function(_0x2d0d0f){logger[_0x6570('0x10')](_0x6570('0x11'),_0x26e23c,JSON[_0x6570('0x12')](_0x2d0d0f));})['finally'](function(){_0x3eb22a[_0x6570('0x13')]();});}}catch(_0x105834){logger[_0x6570('0x10')](_0x6570('0x11'),_0x26e23c,JSON[_0x6570('0x12')](_0x105834));_0x3eb22a[_0x6570('0x13')]();}};}; \ No newline at end of file +var _0x584a=['Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','[%s][CLOSE]\x20reason\x20%s','channel'];(function(_0x375343,_0x430ac7){var _0x6967a6=function(_0x52af6f){while(--_0x52af6f){_0x375343['push'](_0x375343['shift']());}};_0x6967a6(++_0x430ac7);}(_0x584a,0x1c0));var _0xa584=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x584a[_0x3b150c];return _0x5cd414;};'use strict';var moment=require(_0xa584('0x0'));var logger=require(_0xa584('0x1'))('routing');var rpc={'chatInteraction':require(_0xa584('0x2')),'openchannelInteraction':require(_0xa584('0x3')),'smsInteraction':require(_0xa584('0x4')),'mailInteraction':require(_0xa584('0x5')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x4f969f,_0x4caa4d,_0x4ea552,_0x4a36d6){return function(_0x263112){try{logger['info'](_0xa584('0x6'),_0x4f969f,_0x4caa4d[0x0]);var _0x1fada0={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x4caa4d[0x0]};if(rpc[_0x4a36d6[_0xa584('0x7')]+_0xa584('0x8')]){rpc[_0x4a36d6[_0xa584('0x7')]+_0xa584('0x8')][_0xa584('0x9')](_0x4a36d6[_0xa584('0xa')]['id'],_0x1fada0)[_0xa584('0xb')](function(_0x40eaf4){logger[_0xa584('0xc')](_0xa584('0xd'),_0x4f969f,_0x4a36d6[_0xa584('0xa')]['id']);})[_0xa584('0xe')](function(_0x436c32){logger['error'](_0xa584('0xf'),_0x4f969f,JSON[_0xa584('0x10')](_0x436c32));})[_0xa584('0x11')](function(){_0x263112[_0xa584('0x12')]();});}}catch(_0x37cc7d){logger['error'](_0xa584('0xf'),_0x4f969f,JSON[_0xa584('0x10')](_0x37cc7d));_0x263112[_0xa584('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index b7ff901..865cdfa 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 _0xc8f8=['moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','message','dialogflow','result','speech','endConversation','stop','lodash'];(function(_0x4146e8,_0x28c1a6){var _0x38e4ab=function(_0x3ad47d){while(--_0x3ad47d){_0x4146e8['push'](_0x4146e8['shift']());}};_0x38e4ab(++_0x28c1a6);}(_0xc8f8,0x125));var _0x8c8f=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xc8f8[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x8c8f('0x0'));var moment=require(_0x8c8f('0x1'));var apiai=require('apiai-promise');var md5=require(_0x8c8f('0x2'));var utils=require(_0x8c8f('0x3'));var logger=require(_0x8c8f('0x4'))(_0x8c8f('0x5'));var rpc={'chatMessage':require(_0x8c8f('0x6')),'openchannelMessage':require(_0x8c8f('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x8c8f('0x8')]=function(_0x4ab24f,_0x447a1e){return function(_0x1e9aaa){try{if(!_[_0x8c8f('0x9')](this[_0x8c8f('0xa')][_0x8c8f('0xb')])){logger[_0x8c8f('0xc')](_0x8c8f('0xd'),_0x4ab24f,_0x8c8f('0xe'));return _0x1e9aaa[_0x8c8f('0xf')]();}var _0x15f7b0={'ContactId':this[_0x8c8f('0x10')]['id'],'sentAt':moment()[_0x8c8f('0x11')](_0x8c8f('0x12')),'direction':_0x8c8f('0x13')};var _0x4e3444=this[_0x8c8f('0x14')];if(_0x4e3444==='chat'){_0x15f7b0[_0x8c8f('0x15')]=this[_0x8c8f('0x16')]['id'];}else{_0x15f7b0[_['upperFirst'](_0x4e3444)+'AccountId']=this[_0x8c8f('0x16')]['id'];}_0x15f7b0[_[_0x8c8f('0x17')](_0x4e3444)+_0x8c8f('0x18')]=this[_0x8c8f('0xa')]['id'];if(this[_0x8c8f('0xa')][_0x8c8f('0x19')]){var _0x364cf3=_0x447a1e[0x2];if(!_[_0x8c8f('0x1a')](_0x364cf3)){_0x15f7b0[_0x8c8f('0x1b')]=utils[_0x8c8f('0x1c')](_0x364cf3,this);return rpc[_0x4e3444+_0x8c8f('0x1d')][_0x8c8f('0x1e')](_0x15f7b0)[_0x8c8f('0x1f')](function(_0x6efe50){logger[_0x8c8f('0xc')](_0x8c8f('0xd'),_0x4ab24f,_0x15f7b0['body']);})[_0x8c8f('0x20')](function(_0xb40bcf){logger[_0x8c8f('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x4ab24f,JSON[_0x8c8f('0x22')](_0xb40bcf));})[_0x8c8f('0x23')](function(){logger[_0x8c8f('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4ab24f);_0x1e9aaa['stop']();});}else{logger[_0x8c8f('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4ab24f);_0x1e9aaa['stop']();}}else{var _0x122fae=this;var _0x40fbfc=apiai(_0x447a1e[0x0],{'language':_0x447a1e[0x1]||'en'});return _0x40fbfc['textRequest'](this[_0x8c8f('0x24')][_0x8c8f('0x1b')],{'sessionId':md5(this['interaction']['id'])})[_0x8c8f('0x1f')](function(_0x610efd){_0x122fae[_0x8c8f('0x1b')][_0x8c8f('0x25')]=_0x610efd;_0x15f7b0[_0x8c8f('0x1b')]=_0x610efd[_0x8c8f('0x26')]['fulfillment'][_0x8c8f('0x27')];return rpc[_0x4e3444+_0x8c8f('0x1d')][_0x8c8f('0x1e')](_0x15f7b0)[_0x8c8f('0x1f')](function(_0x5e88e2){logger[_0x8c8f('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x4ab24f,_0x15f7b0['body']);if(_0x610efd[_0x8c8f('0x26')]['metadata'][_0x8c8f('0x28')]){_0x1e9aaa[_0x8c8f('0xf')]();}else{_0x1e9aaa[_0x8c8f('0x29')]();}})[_0x8c8f('0x20')](function(_0x1fffab){logger[_0x8c8f('0x21')](_0x8c8f('0xd'),_0x4ab24f,JSON[_0x8c8f('0x22')](_0x1fffab));_0x1e9aaa[_0x8c8f('0xf')]();});})['catch'](function(_0x11d662){logger[_0x8c8f('0x21')](_0x8c8f('0xd'),_0x4ab24f,_0x11d662[_0x8c8f('0x24')]);_0x1e9aaa[_0x8c8f('0xf')]();});}}catch(_0x251b35){logger[_0x8c8f('0x21')](_0x8c8f('0xd'),_0x4ab24f,JSON[_0x8c8f('0x22')](_0x251b35));_0x1e9aaa['stop']();}};}; \ No newline at end of file +var _0x4475=['UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','Message','result','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction'];(function(_0x549731,_0x5ec49c){var _0x448af9=function(_0xb4e279){while(--_0xb4e279){_0x549731['push'](_0x549731['shift']());}};_0x448af9(++_0x5ec49c);}(_0x4475,0x179));var _0x5447=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4475[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5447('0x0'));var moment=require(_0x5447('0x1'));var apiai=require(_0x5447('0x2'));var md5=require(_0x5447('0x3'));var utils=require(_0x5447('0x4'));var logger=require(_0x5447('0x5'))(_0x5447('0x6'));var rpc={'chatMessage':require(_0x5447('0x7')),'openchannelMessage':require(_0x5447('0x8')),'mailMessage':require(_0x5447('0x9')),'smsMessage':require(_0x5447('0xa')),'faxMessage':require(_0x5447('0xb'))};exports[_0x5447('0xc')]=function(_0x47f518,_0x5ecc46){return function(_0x5a866a){try{if(!_[_0x5447('0xd')](this[_0x5447('0xe')][_0x5447('0xf')])){logger[_0x5447('0x10')](_0x5447('0x11'),_0x47f518,_0x5447('0x12'));return _0x5a866a[_0x5447('0x13')]();}var _0xe4f08e={'ContactId':this[_0x5447('0x14')]['id'],'sentAt':moment()[_0x5447('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5447('0x16')};var _0x43b755=this[_0x5447('0x17')];if(_0x43b755===_0x5447('0x18')){_0xe4f08e[_0x5447('0x19')]=this[_0x5447('0x1a')]['id'];}else{_0xe4f08e[_[_0x5447('0x1b')](_0x43b755)+_0x5447('0x1c')]=this['account']['id'];}_0xe4f08e[_[_0x5447('0x1b')](_0x43b755)+_0x5447('0x1d')]=this[_0x5447('0xe')]['id'];if(this[_0x5447('0xe')][_0x5447('0x1e')]){var _0x494d6c=_0x5ecc46[0x2];if(!_[_0x5447('0x1f')](_0x494d6c)){_0xe4f08e['body']=utils[_0x5447('0x20')](_0x494d6c,this);return rpc[_0x43b755+'Message'][_0x5447('0x21')](_0xe4f08e)[_0x5447('0x22')](function(_0x46328d){logger[_0x5447('0x10')]('[%s][DIALOGFLOW]\x20%s',_0x47f518,_0xe4f08e[_0x5447('0x23')]);})[_0x5447('0x24')](function(_0x212e33){logger[_0x5447('0x25')](_0x5447('0x11'),_0x47f518,JSON[_0x5447('0x26')](_0x212e33));})['finally'](function(){logger[_0x5447('0x10')](_0x5447('0x27'),_0x47f518);_0x5a866a[_0x5447('0x28')]();});}else{logger[_0x5447('0x10')](_0x5447('0x29'),_0x47f518);_0x5a866a['stop']();}}else{var _0x382ea7=this;var _0x2fead2=apiai(_0x5ecc46[0x0],{'language':_0x5ecc46[0x1]||'en'});return _0x2fead2[_0x5447('0x2a')](this[_0x5447('0x2b')][_0x5447('0x23')],{'sessionId':md5(this[_0x5447('0xe')]['id'])})[_0x5447('0x22')](function(_0x5a7e48){_0x382ea7['body'][_0x5447('0x2c')]=_0x5a7e48;_0xe4f08e[_0x5447('0x23')]=_0x5a7e48['result'][_0x5447('0x2d')]['speech'];return rpc[_0x43b755+_0x5447('0x2e')][_0x5447('0x21')](_0xe4f08e)[_0x5447('0x22')](function(_0x2c4bd1){logger[_0x5447('0x10')](_0x5447('0x11'),_0x47f518,_0xe4f08e[_0x5447('0x23')]);if(_0x5a7e48[_0x5447('0x2f')]['metadata'][_0x5447('0x30')]){_0x5a866a[_0x5447('0x13')]();}else{_0x5a866a[_0x5447('0x28')]();}})['catch'](function(_0x1a5bff){logger[_0x5447('0x25')](_0x5447('0x11'),_0x47f518,JSON[_0x5447('0x26')](_0x1a5bff));_0x5a866a[_0x5447('0x13')]();});})['catch'](function(_0x15ad0d){logger[_0x5447('0x25')](_0x5447('0x11'),_0x47f518,_0x15ad0d['message']);_0x5a866a[_0x5447('0x13')]();});}}catch(_0x49f743){logger[_0x5447('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x47f518,JSON[_0x5447('0x26')](_0x49f743));_0x5a866a[_0x5447('0x28')]();}};}; \ 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 ad4936c..971e61e 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 _0x5c38=['stringify','validate','lodash','html-to-text','./utils','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x5a001d,_0x591f45){var _0x3d0a81=function(_0x13ad2a){while(--_0x13ad2a){_0x5a001d['push'](_0x5a001d['shift']());}};_0x3d0a81(++_0x591f45);}(_0x5c38,0x1cc));var _0x85c3=function(_0x55d1b3,_0x3da77e){_0x55d1b3=_0x55d1b3-0x0;var _0x2dd33a=_0x5c38[_0x55d1b3];return _0x2dd33a;};'use strict';var schema=require(_0x85c3('0x0'));var _=require(_0x85c3('0x1'));var htmlToText=require(_0x85c3('0x2'));var utils=require(_0x85c3('0x3'));var logger=require('../../../../config/logger')(_0x85c3('0x4'));var gotoif=schema({'condition':{'type':_0x85c3('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x85c3('0x6')},'priorityFalse':{'type':_0x85c3('0x7'),'message':_0x85c3('0x8')}});exports[_0x85c3('0x9')]=function(_0x587be5,_0x5a6506){return function(_0x3c359e){try{var _0x5ea8e8={'condition':htmlToText[_0x85c3('0xa')](utils[_0x85c3('0xb')](_0x5a6506[0x0],this),{'wordwrap':![]})[_0x85c3('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5a6506[0x1],'priorityFalse':_0x5a6506[0x2]};var _0x4b577b=gotoif['validate'](_0x5ea8e8,{'typecast':!![]});if(_0x4b577b[_0x85c3('0xd')]){logger[_0x85c3('0xe')](_0x85c3('0xf'),_0x587be5,_[_0x85c3('0x10')](_0x4b577b,_0x85c3('0x11'))[_0x85c3('0x12')](',\x20'));_0x3c359e[_0x85c3('0x13')]();}else{try{var _0x3c0328=eval('('+_0x5ea8e8['condition']+')');var _0x2dd74b=_0x3c0328?_0x5ea8e8[_0x85c3('0x14')]:_0x5ea8e8['priorityFalse'];logger[_0x85c3('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x587be5,_0x5ea8e8['condition'],_0x3c0328,_0x2dd74b||_0x85c3('0x16'));if(_0x2dd74b){var _0x3ee042=_['findIndex'](_0x3c359e[_0x85c3('0x17')](),{'p':_0x2dd74b});if(_0x3ee042>=0x0){logger[_0x85c3('0x15')](_0x85c3('0x18'),_0x587be5,_0x2dd74b||_0x85c3('0x16'),_0x3ee042);_0x3c359e[_0x85c3('0x16')](_0x3ee042);}else{logger[_0x85c3('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x587be5,_0x2dd74b||_0x85c3('0x16'));_0x3c359e[_0x85c3('0x13')]();}}else{_0x3c359e['next']();}}catch(_0x46a595){logger['error'](_0x85c3('0x19'),_0x587be5,_0x46a595[_0x85c3('0x11')]);_0x3c359e[_0x85c3('0x13')]();}}}catch(_0x242d3b){logger['error']('[%s][GOTOIF]\x20%s',_0x587be5,JSON[_0x85c3('0x1a')](_0x242d3b));_0x3c359e['stop']();}};}; \ No newline at end of file +var _0x7446=['condition','priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7446,0x1ae));var _0x6744=function(_0x5dd7d5,_0x2df741){_0x5dd7d5=_0x5dd7d5-0x0;var _0x354252=_0x7446[_0x5dd7d5];return _0x354252;};'use strict';var schema=require(_0x6744('0x0'));var _=require(_0x6744('0x1'));var htmlToText=require(_0x6744('0x2'));var utils=require(_0x6744('0x3'));var logger=require(_0x6744('0x4'))(_0x6744('0x5'));var gotoif=schema({'condition':{'type':_0x6744('0x6'),'required':!![],'message':_0x6744('0x7')},'priorityTrue':{'type':_0x6744('0x8'),'message':_0x6744('0x9')},'priorityFalse':{'type':_0x6744('0x8'),'message':_0x6744('0xa')}});exports[_0x6744('0xb')]=function(_0x24a4e4,_0x2c7c22){return function(_0x499aab){try{var _0x152748={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x2c7c22[0x0],this),{'wordwrap':![]})[_0x6744('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c7c22[0x1],'priorityFalse':_0x2c7c22[0x2]};var _0xcea04b=gotoif['validate'](_0x152748,{'typecast':!![]});if(_0xcea04b[_0x6744('0xd')]){logger[_0x6744('0xe')](_0x6744('0xf'),_0x24a4e4,_[_0x6744('0x10')](_0xcea04b,_0x6744('0x11'))[_0x6744('0x12')](',\x20'));_0x499aab[_0x6744('0x13')]();}else{try{var _0x34edd4=eval('('+_0x152748[_0x6744('0x14')]+')');var _0x5bd86e=_0x34edd4?_0x152748[_0x6744('0x15')]:_0x152748[_0x6744('0x16')];logger[_0x6744('0x17')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x24a4e4,_0x152748[_0x6744('0x14')],_0x34edd4,_0x5bd86e||_0x6744('0x18'));if(_0x5bd86e){var _0x3c01c3=_['findIndex'](_0x499aab[_0x6744('0x19')](),{'p':_0x5bd86e});if(_0x3c01c3>=0x0){logger['info'](_0x6744('0x1a'),_0x24a4e4,_0x5bd86e||_0x6744('0x18'),_0x3c01c3);_0x499aab['next'](_0x3c01c3);}else{logger['info'](_0x6744('0x1b'),_0x24a4e4,_0x5bd86e||_0x6744('0x18'));_0x499aab[_0x6744('0x13')]();}}else{_0x499aab[_0x6744('0x18')]();}}catch(_0x11362f){logger[_0x6744('0xe')](_0x6744('0x1c'),_0x24a4e4,_0x11362f[_0x6744('0x11')]);_0x499aab[_0x6744('0x13')]();}}}catch(_0x58e142){logger['error'](_0x6744('0xf'),_0x24a4e4,JSON[_0x6744('0x1d')](_0x58e142));_0x499aab[_0x6744('0x13')]();}};}; \ 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 2075d67..c061f9a 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 _0xc19b=['stop','priority','findIndex','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','routing','number','consequence','length','error','map','message','join'];(function(_0x3d46e5,_0x565392){var _0x5b9e42=function(_0x1ea63e){while(--_0x1ea63e){_0x3d46e5['push'](_0x3d46e5['shift']());}};_0x5b9e42(++_0x565392);}(_0xc19b,0x75));var _0xbc19=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc19b[_0x46aff0];return _0x9d78cf;};'use strict';var schema=require(_0xbc19('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xbc19('0x1'));var gotop=schema({'priority':{'type':_0xbc19('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xbc19('0x3')]=function(_0x22b807,_0x202391){return function(_0x5eb41b){try{var _0x5f5601={'priority':_0x202391[0x0]};var _0x2f1433=gotop['validate'](_0x5f5601,{'typecast':!![]});if(_0x2f1433[_0xbc19('0x4')]){logger[_0xbc19('0x5')]('[%s][GOTOP]\x20%s',_0x22b807,_[_0xbc19('0x6')](_0x2f1433,_0xbc19('0x7'))[_0xbc19('0x8')](',\x20'));_0x5eb41b[_0xbc19('0x9')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x22b807,_0x5f5601[_0xbc19('0xa')]);if(_0x5f5601[_0xbc19('0xa')]){var _0xca06b9=_[_0xbc19('0xb')](_0x5eb41b['rules'](),{'p':_0x5f5601[_0xbc19('0xa')]});if(_0xca06b9>=0x0){logger[_0xbc19('0xc')](_0xbc19('0xd'),_0x22b807,_0x5f5601[_0xbc19('0xa')]||_0xbc19('0xe'),_0xca06b9);_0x5eb41b[_0xbc19('0xe')](_0xca06b9);}else{logger[_0xbc19('0xc')](_0xbc19('0xf'),_0x22b807,_0x5f5601['priority']||_0xbc19('0xe'));_0x5eb41b[_0xbc19('0x9')]();}}else{_0x5eb41b[_0xbc19('0xe')]();}}}catch(_0x564104){logger[_0xbc19('0x5')](_0xbc19('0x10'),_0x22b807,JSON[_0xbc19('0x11')](_0x564104));_0x5eb41b['stop']();}};}; \ No newline at end of file +var _0x9aa4=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger'];(function(_0x186222,_0x3bdfb0){var _0x226a38=function(_0x3b071f){while(--_0x3b071f){_0x186222['push'](_0x186222['shift']());}};_0x226a38(++_0x3bdfb0);}(_0x9aa4,0x141));var _0x49aa=function(_0x3b8d23,_0x17e3ce){_0x3b8d23=_0x3b8d23-0x0;var _0x2b9ad9=_0x9aa4[_0x3b8d23];return _0x2b9ad9;};'use strict';var schema=require('validate');var _=require(_0x49aa('0x0'));var logger=require(_0x49aa('0x1'))(_0x49aa('0x2'));var gotop=schema({'priority':{'type':_0x49aa('0x3'),'required':!![],'message':_0x49aa('0x4')}});exports['consequence']=function(_0x255e92,_0x304150){return function(_0x403401){try{var _0x180358={'priority':_0x304150[0x0]};var _0x1d8ce5=gotop[_0x49aa('0x5')](_0x180358,{'typecast':!![]});if(_0x1d8ce5[_0x49aa('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x255e92,_[_0x49aa('0x7')](_0x1d8ce5,'message')[_0x49aa('0x8')](',\x20'));_0x403401[_0x49aa('0x9')]();}else{logger[_0x49aa('0xa')](_0x49aa('0xb'),_0x255e92,_0x180358[_0x49aa('0xc')]);if(_0x180358['priority']){var _0x4835ab=_[_0x49aa('0xd')](_0x403401['rules'](),{'p':_0x180358['priority']});if(_0x4835ab>=0x0){logger[_0x49aa('0xa')](_0x49aa('0xe'),_0x255e92,_0x180358['priority']||'next',_0x4835ab);_0x403401[_0x49aa('0xf')](_0x4835ab);}else{logger[_0x49aa('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x255e92,_0x180358[_0x49aa('0xc')]||_0x49aa('0xf'));_0x403401[_0x49aa('0x9')]();}}else{_0x403401[_0x49aa('0xf')]();}}}catch(_0x5a36e4){logger[_0x49aa('0x10')](_0x49aa('0x11'),_0x255e92,JSON[_0x49aa('0x12')](_0x5a36e4));_0x403401['stop']();}};}; \ 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 c8b28be..dcde9b7 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 _0xd423=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','AccountId','account','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils'];(function(_0x4855dd,_0x53e55e){var _0x59604a=function(_0x30bad7){while(--_0x30bad7){_0x4855dd['push'](_0x4855dd['shift']());}};_0x59604a(++_0x53e55e);}(_0xd423,0xe9));var _0x3d42=function(_0x126a52,_0x260dd4){_0x126a52=_0x126a52-0x0;var _0x3ae233=_0xd423[_0x126a52];return _0x3ae233;};'use strict';var _=require('lodash');var utils=require(_0x3d42('0x0'));var logger=require(_0x3d42('0x1'))(_0x3d42('0x2'));var rpc={'chatMessage':require(_0x3d42('0x3')),'openchannelMessage':require(_0x3d42('0x4')),'mailMessage':require(_0x3d42('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3d42('0x6'))};exports[_0x3d42('0x7')]=function(_0xe65cc5,_0x22f36a){return function(_0x23b968){try{var _0x42da89={'body':utils[_0x3d42('0x8')](_0x22f36a[0x0],this),'ContactId':this['contact']['id']};if(this[_0x3d42('0x9')]===_0x3d42('0xa')){_0x42da89[_0x3d42('0xb')]=this['account']['id'];}else{_0x42da89[_['upperFirst'](this['channel'])+_0x3d42('0xc')]=this[_0x3d42('0xd')]['id'];}_0x42da89[_['upperFirst'](this['channel'])+_0x3d42('0xe')]=this[_0x3d42('0xf')]['id'];if(rpc[this[_0x3d42('0x9')]+_0x3d42('0x10')]){return rpc[this[_0x3d42('0x9')]+_0x3d42('0x10')]['create'](_0x42da89)[_0x3d42('0x11')](function(_0x5708a2){logger[_0x3d42('0x12')](_0x3d42('0x13'),_0xe65cc5,_0x42da89[_0x3d42('0x14')]);_0x23b968[_0x3d42('0x15')]();})[_0x3d42('0x16')](function(_0x300e84){logger[_0x3d42('0x17')](_0x3d42('0x13'),_0xe65cc5,JSON[_0x3d42('0x18')](_0x300e84));_0x23b968[_0x3d42('0x19')]();});}}catch(_0x74767d){logger[_0x3d42('0x17')]('[%s][MESSAGE]\x20%s',_0xe65cc5,JSON[_0x3d42('0x18')](_0x74767d));_0x23b968['stop']();}};}; \ No newline at end of file +var _0x7d8f=['catch','error','stringify','stop','routing','../../rpc/chatMessage','../../rpc/faxMessage','consequence','contact','channel','chat','account','upperFirst','interaction','Message','create','info','[%s][MESSAGE]\x20%s','next'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d8f,0x121));var _0xf7d8=function(_0x86a99c,_0x1e51ae){_0x86a99c=_0x86a99c-0x0;var _0x88b958=_0x7d8f[_0x86a99c];return _0x88b958;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf7d8('0x0'));var rpc={'chatMessage':require(_0xf7d8('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf7d8('0x2'))};exports[_0xf7d8('0x3')]=function(_0x108b8d,_0x5024e3){return function(_0x3d3038){try{var _0x5019bf={'body':utils['getMustacheRender'](_0x5024e3[0x0],this),'ContactId':this[_0xf7d8('0x4')]['id']};if(this[_0xf7d8('0x5')]===_0xf7d8('0x6')){_0x5019bf['ChatWebsiteId']=this[_0xf7d8('0x7')]['id'];}else{_0x5019bf[_[_0xf7d8('0x8')](this[_0xf7d8('0x5')])+'AccountId']=this[_0xf7d8('0x7')]['id'];}_0x5019bf[_['upperFirst'](this['channel'])+'InteractionId']=this[_0xf7d8('0x9')]['id'];if(rpc[this['channel']+_0xf7d8('0xa')]){return rpc[this[_0xf7d8('0x5')]+'Message'][_0xf7d8('0xb')](_0x5019bf)['then'](function(_0x3791b6){logger[_0xf7d8('0xc')](_0xf7d8('0xd'),_0x108b8d,_0x5019bf['body']);_0x3d3038[_0xf7d8('0xe')]();})[_0xf7d8('0xf')](function(_0x32b185){logger[_0xf7d8('0x10')](_0xf7d8('0xd'),_0x108b8d,JSON[_0xf7d8('0x11')](_0x32b185));_0x3d3038[_0xf7d8('0x12')]();});}}catch(_0x470af7){logger['error'](_0xf7d8('0xd'),_0x108b8d,JSON[_0xf7d8('0x11')](_0x470af7));_0x3d3038[_0xf7d8('0x12')]();}};}; \ 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 bd31a45..b511177 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 _0x1d28=['next','stringify','./utils','routing','consequence','info','getMustacheRender'];(function(_0x596a5b,_0x51af41){var _0x1b7e71=function(_0x37cb7d){while(--_0x37cb7d){_0x596a5b['push'](_0x596a5b['shift']());}};_0x1b7e71(++_0x51af41);}(_0x1d28,0x16e));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x81d2('0x0'));var logger=require('../../../../config/logger')(_0x81d2('0x1'));exports[_0x81d2('0x2')]=function(_0x375b30,_0x3c7558){return function(_0xc0eb10){try{logger[_0x81d2('0x3')]('[%s][NOOP]\x20%s',_0x375b30,utils[_0x81d2('0x4')](_0x3c7558[0x0],this));_0xc0eb10[_0x81d2('0x5')]();}catch(_0x1141e5){logger['error']('[%s][NOOP]\x20%s',_0x375b30,JSON[_0x81d2('0x6')](_0x1141e5));_0xc0eb10['stop']();}};}; \ No newline at end of file +var _0x285f=['../../../../config/logger','consequence','[%s][NOOP]\x20%s','error','stringify'];(function(_0x46fe66,_0x148a1a){var _0x595c5d=function(_0x35df0b){while(--_0x35df0b){_0x46fe66['push'](_0x46fe66['shift']());}};_0x595c5d(++_0x148a1a);}(_0x285f,0x19f));var _0xf285=function(_0x4ef309,_0x1597cf){_0x4ef309=_0x4ef309-0x0;var _0x19f206=_0x285f[_0x4ef309];return _0x19f206;};'use strict';var utils=require('./utils');var logger=require(_0xf285('0x0'))('routing');exports[_0xf285('0x1')]=function(_0x180331,_0x3e1e43){return function(_0x4196a5){try{logger['info'](_0xf285('0x2'),_0x180331,utils['getMustacheRender'](_0x3e1e43[0x0],this));_0x4196a5['next']();}catch(_0x4f07d2){logger[_0xf285('0x3')](_0xf285('0x2'),_0x180331,JSON[_0xf285('0x4')](_0x4f07d2));_0x4196a5['stop']();}};}; \ 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 486227f..7964682 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 _0xd22e=['upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','emit','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0xd22e,0xbe));var _0xed22=function(_0x2969cb,_0x33be03){_0x2969cb=_0x2969cb-0x0;var _0x1ba64e=_0xd22e[_0x2969cb];return _0x1ba64e;};'use strict';var schema=require(_0xed22('0x0'));var _=require('lodash');var util=require(_0xed22('0x1'));var seqqueue=require(_0xed22('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0xed22('0x3'));var logger=require(_0xed22('0x4'))(_0xed22('0x5'));var strategy=require(_0xed22('0x6'));config[_0xed22('0x7')]=_[_0xed22('0x8')](config[_0xed22('0x7')],{'host':_0xed22('0x9'),'port':0x18eb});var io=require(_0xed22('0xa'))(new Redis(config[_0xed22('0x7')]));var attributes=['id',_0xed22('0xb'),'account',_0xed22('0xc'),'from','joinAt'];function emit(_0x379d9d,_0x2171ad,_0x28047a){io['to'](_0x379d9d)[_0xed22('0xd')](_0x2171ad,_0x28047a);}function emitChannelQueueInteraction(_0x4f3e5a,_0x2b7a39,_0xc2faaf,_0x373231,_0x11ee70,_0x545aa2,_0xbbe8bf,_0x2d8700){_0xc2faaf[_0xed22('0xb')]=_0x2d8700;_0xc2faaf[_0xed22('0xc')]=_0x2b7a39;_0xc2faaf[_0xed22('0xe')]=_0x373231;_0xc2faaf['id']=_0x11ee70;if(_0x545aa2){_0xbbe8bf[util[_0xed22('0xf')]('%sQueuesWaitingInteractions',_0x4f3e5a)][_0x11ee70]=_['pick'](_0xc2faaf,attributes);}else{delete _0xbbe8bf[util[_0xed22('0xf')](_0xed22('0x10'),_0x4f3e5a)][_0x11ee70];}emit(util[_0xed22('0xf')](_0xed22('0x11'),_0x4f3e5a,_0x2b7a39),util[_0xed22('0xf')](_0xed22('0x12'),_0x4f3e5a,_0x545aa2?_0xed22('0x13'):_0xed22('0x14')),_['pick'](_0xc2faaf,attributes));}var rpc={'openchannelQueueReport':require(_0xed22('0x15')),'mailQueueReport':require(_0xed22('0x16')),'chatQueueReport':require(_0xed22('0x17')),'smsQueueReport':require(_0xed22('0x18')),'faxQueueReport':require(_0xed22('0x19'))};var queue=schema({'name':{'type':_0xed22('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xed22('0x1b'),'message':_0xed22('0x1c')}});function startRouting(_0x2ea77e,_0x597775,_0x5815fa,_0x52c53c){if(_0x2ea77e&&_0x597775&&_0x5815fa){_0x597775[_0xed22('0x1d')]+=0x1;var _0x28b1a5={'uniqueid':_0x2ea77e,'from':_0x5815fa['body']?_0x5815fa[_0xed22('0x1e')][_0xed22('0x1f')]:'','joinAt':moment()['format'](_0xed22('0x20')),'ContactId':_0x5815fa[_0xed22('0x21')]?_0x5815fa[_0xed22('0x21')]['id']:null,'ListId':_0x5815fa['list']?_0x5815fa[_0xed22('0x22')]['id']:null};_0x28b1a5[_[_0xed22('0x23')](_0x5815fa[_0xed22('0x24')])+_0xed22('0x25')]=_0x597775['id']||null;_0x28b1a5[_[_0xed22('0x23')](_0x5815fa[_0xed22('0x24')])+_0xed22('0x26')]=_0x5815fa[_0xed22('0x27')]?_0x5815fa[_0xed22('0x27')]['id']:null;_0x28b1a5[_[_0xed22('0x23')](_0x5815fa[_0xed22('0x24')])+_0xed22('0x28')]=_0x5815fa[_0xed22('0x29')]?_0x5815fa[_0xed22('0x29')]['id']:null;_0x28b1a5[_[_0xed22('0x23')](_0x5815fa[_0xed22('0x24')])+(_0x5815fa[_0xed22('0x24')]!==_0xed22('0x2a')?_0xed22('0x2b'):'WebsiteId')]=_0x5815fa['account']?_0x5815fa[_0xed22('0xe')]['id']:null;logger[_0xed22('0x2c')](util[_0xed22('0xf')](_0xed22('0x2d'),_0x2ea77e,_0x597775['name']));emitChannelQueueInteraction(_0x5815fa[_0xed22('0x24')],_0x597775[_0xed22('0x2e')],_0x28b1a5,_0x5815fa[_0xed22('0xe')][_0xed22('0x2e')],_0x5815fa['message']['id'],!![],_0x52c53c,_0x597775['id']);if(rpc[_0x5815fa['channel']+_0xed22('0x2f')]){return rpc[_0x5815fa['channel']+_0xed22('0x2f')][_0xed22('0x30')](_0x28b1a5)[_0xed22('0x31')](function(_0x3e00db){logger[_0xed22('0x32')](_0xed22('0x33'));});}}}function stopRouting(_0x3c29a2,_0x266439,_0x505802,_0x321f3b){if(_0x3c29a2&&_0x266439){_0x266439[_0xed22('0x1d')]-=0x1;var _0x124325={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xed22('0xf')](_0xed22('0x20')),'reason':_0xed22('0x34')};logger['info'](util[_0xed22('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x3c29a2,_0x266439[_0xed22('0x2e')]));emitChannelQueueInteraction(_0x505802[_0xed22('0x24')],_0x266439[_0xed22('0x2e')],_0x505802['body'],_0x505802[_0xed22('0xe')][_0xed22('0x2e')],_0x505802[_0xed22('0x29')]['id'],![],_0x321f3b,_0x266439['id']);if(rpc[_0x505802[_0xed22('0x24')]+'QueueReport']){return rpc[_0x505802[_0xed22('0x24')]+'QueueReport']['update'](_0x3c29a2,_0x124325)[_0xed22('0x31')](function(_0x5813c0){logger[_0xed22('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x18a40d,_0x73136d,_0x27e136,_0x353615){if(_0x18a40d&&_0x73136d){_0x73136d['waiting']-=0x1;var _0x2ee080={'leaveAt':moment()['format'](_0xed22('0x20')),'exitAt':moment()[_0xed22('0xf')](_0xed22('0x20')),'reason':'timeout'};logger[_0xed22('0x2c')](util[_0xed22('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x18a40d,_0x73136d[_0xed22('0x2e')]));emitChannelQueueInteraction(_0x27e136['channel'],_0x73136d['name'],_0x27e136['body'],_0x27e136[_0xed22('0xe')][_0xed22('0x2e')],_0x27e136[_0xed22('0x29')]['id'],![],_0x353615);if(rpc[_0x27e136[_0xed22('0x24')]+'QueueReport']){return rpc[_0x27e136[_0xed22('0x24')]+'QueueReport'][_0xed22('0x35')](_0x18a40d,_0x2ee080)[_0xed22('0x31')](function(_0x395a96){logger['error'](_0xed22('0x36'));});}}}function handleFindQueue(_0x2b0608){return function(_0x3858f8){return _0x3858f8['name'][_0xed22('0x37')]()===_0x2b0608[_0xed22('0x37')]();};}exports[_0xed22('0x38')]=function(_0x2c34b8,_0x58638e,_0x5a08f4,_0x3aaf85){return function(_0x292008){try{var _0x5c5b1b={'name':_0x58638e[0x0],'timeout':_0x58638e[0x1]};var _0x39d6e5=queue[_0xed22('0x0')](_0x5c5b1b,{'typecast':!![]});if(_0x39d6e5['length']){logger[_0xed22('0x32')](_0xed22('0x39'),_0x2c34b8,_[_0xed22('0x3a')](_0x39d6e5,_0xed22('0x29'))[_0xed22('0x3b')](',\x20'));_0x292008[_0xed22('0x3c')]();}else{var _0x52e352=_[_0xed22('0x3d')](_0x5a08f4[_0x3aaf85[_0xed22('0x24')]+_0xed22('0x3e')],handleFindQueue(_0x5c5b1b[_0xed22('0x2e')]));if(_0x52e352){startRouting(_0x2c34b8,_0x52e352,_0x3aaf85,_0x5a08f4);var _0x2493ce=(_0x52e352[_0xed22('0x3f')]||0xa)*0x3e8;var _0x25f343=(_0x5c5b1b[_0xed22('0x3f')]||0x14)*0x3e8;var _0x3cde6d,_0x85ca13;if(_0x2493ce>_0x25f343){_0x25f343=_0x2493ce;}var _0x1b9ed7=seqqueue['createQueue'](_0x2493ce);_0x1b9ed7['id']=_0x2c34b8;_0x1b9ed7[_0xed22('0x40')]=_0x2493ce;_0x1b9ed7[_0xed22('0x41')]=_0x25f343;_0x1b9ed7[_0xed22('0x24')]=_0x3aaf85[_0xed22('0x24')];_0x5a08f4[_0xed22('0x42')][_0x2c34b8]['on'](_0xed22('0x43'),function(){stopRouting(_0x2c34b8,_0x52e352,_0x3aaf85,_0x5a08f4);_0x1b9ed7[_0xed22('0x44')](!![]);clearTimeout(_0x3cde6d);_0x3cde6d=undefined;if(_0x5a08f4['rules'][_0x2c34b8]){delete _0x5a08f4[_0xed22('0x42')][_0x2c34b8];}logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2c34b8);_0x292008[_0xed22('0x3c')]();});_0x3cde6d=setTimeout(function(){endRouting(_0x2c34b8,_0x52e352,_0x3aaf85,_0x5a08f4);clearTimeout(_0x3cde6d);_0x1b9ed7[_0xed22('0x44')](!![]);logger[_0xed22('0x2c')]('[%s][QUEUE]\x20ROUTING\x20END',_0x2c34b8);_0x292008[_0xed22('0x45')]();},_0x25f343);switch(_0x52e352[_0xed22('0x46')]){case _0xed22('0x47'):strategy[_0xed22('0x47')](_0x1b9ed7,_0x52e352,_0x5a08f4,_0x3aaf85);break;default:strategy[_0xed22('0x48')](_0x1b9ed7,_0x52e352,_0x5a08f4,_0x3aaf85);}}else{logger[_0xed22('0x32')](_0xed22('0x49'),_0x2c34b8,_0x5c5b1b[_0xed22('0x2e')]);_0x292008[_0xed22('0x3c')]();}}}catch(_0x3baa01){console[_0xed22('0x4a')](_0x3baa01);logger[_0xed22('0x32')]('[%s][QUEUE]\x20%s',_0x2c34b8,_0x3baa01['stack']);_0x292008[_0xed22('0x3c')]();}};}; \ No newline at end of file +var _0xf77f=['pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','toLowerCase','[%s][QUEUE]\x20%s','join','find','createQueue','atimeout','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','stack','validate','lodash','util','seq-queue','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','joinAt','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x58f0f3,_0x416d73){var _0x2ceb65=function(_0x41fa43){while(--_0x41fa43){_0x58f0f3['push'](_0x58f0f3['shift']());}};_0x2ceb65(++_0x416d73);}(_0xf77f,0x1a7));var _0xff77=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xf77f[_0x172133];return _0x2460e5;};'use strict';var schema=require(_0xff77('0x0'));var _=require(_0xff77('0x1'));var util=require(_0xff77('0x2'));var seqqueue=require(_0xff77('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0xff77('0x4'));var logger=require('../../../../config/logger')(_0xff77('0x5'));var strategy=require(_0xff77('0x6'));config[_0xff77('0x7')]=_[_0xff77('0x8')](config[_0xff77('0x7')],{'host':_0xff77('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xff77('0x7')]));var attributes=['id',_0xff77('0xa'),_0xff77('0xb'),_0xff77('0xc'),'from',_0xff77('0xd')];function emit(_0x50eaf7,_0x1dc9e9,_0x5bac0e){io['to'](_0x50eaf7)[_0xff77('0xe')](_0x1dc9e9,_0x5bac0e);}function emitChannelQueueInteraction(_0x4fba52,_0x5b38e3,_0x4c91bd,_0x3a0bf1,_0x50cfaf,_0x45d9a2,_0x524577,_0x574c3d){_0x4c91bd['queue_id']=_0x574c3d;_0x4c91bd[_0xff77('0xc')]=_0x5b38e3;_0x4c91bd[_0xff77('0xb')]=_0x3a0bf1;_0x4c91bd['id']=_0x50cfaf;if(_0x45d9a2){_0x524577[util[_0xff77('0xf')](_0xff77('0x10'),_0x4fba52)][_0x50cfaf]=_['pick'](_0x4c91bd,attributes);}else{delete _0x524577[util[_0xff77('0xf')](_0xff77('0x10'),_0x4fba52)][_0x50cfaf];}emit(util[_0xff77('0xf')](_0xff77('0x11'),_0x4fba52,_0x5b38e3),util[_0xff77('0xf')](_0xff77('0x12'),_0x4fba52,_0x45d9a2?_0xff77('0x13'):_0xff77('0x14')),_[_0xff77('0x15')](_0x4c91bd,attributes));}var rpc={'openchannelQueueReport':require(_0xff77('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xff77('0x17')),'smsQueueReport':require(_0xff77('0x18')),'faxQueueReport':require(_0xff77('0x19'))};var queue=schema({'name':{'type':_0xff77('0x1a'),'required':!![],'message':_0xff77('0x1b')},'timeout':{'type':_0xff77('0x1c'),'message':_0xff77('0x1d')}});function startRouting(_0x35f396,_0x183d8b,_0x37d970,_0x17ea72){if(_0x35f396&&_0x183d8b&&_0x37d970){_0x183d8b[_0xff77('0x1e')]+=0x1;var _0x1889e0={'uniqueid':_0x35f396,'from':_0x37d970['body']?_0x37d970[_0xff77('0x1f')][_0xff77('0x20')]:'','joinAt':moment()['format'](_0xff77('0x21')),'ContactId':_0x37d970[_0xff77('0x22')]?_0x37d970[_0xff77('0x22')]['id']:null,'ListId':_0x37d970[_0xff77('0x23')]?_0x37d970[_0xff77('0x23')]['id']:null};_0x1889e0[_[_0xff77('0x24')](_0x37d970[_0xff77('0x25')])+_0xff77('0x26')]=_0x183d8b['id']||null;_0x1889e0[_[_0xff77('0x24')](_0x37d970[_0xff77('0x25')])+'InteractionId']=_0x37d970[_0xff77('0x27')]?_0x37d970['interaction']['id']:null;_0x1889e0[_[_0xff77('0x24')](_0x37d970[_0xff77('0x25')])+_0xff77('0x28')]=_0x37d970[_0xff77('0x29')]?_0x37d970[_0xff77('0x29')]['id']:null;_0x1889e0[_[_0xff77('0x24')](_0x37d970[_0xff77('0x25')])+(_0x37d970[_0xff77('0x25')]!==_0xff77('0x2a')?_0xff77('0x2b'):_0xff77('0x2c'))]=_0x37d970[_0xff77('0xb')]?_0x37d970[_0xff77('0xb')]['id']:null;logger[_0xff77('0x2d')](util[_0xff77('0xf')]('[%s][START:QUEUE][NAME:%s]',_0x35f396,_0x183d8b[_0xff77('0x2e')]));emitChannelQueueInteraction(_0x37d970['channel'],_0x183d8b[_0xff77('0x2e')],_0x1889e0,_0x37d970[_0xff77('0xb')]['name'],_0x37d970[_0xff77('0x29')]['id'],!![],_0x17ea72,_0x183d8b['id']);if(rpc[_0x37d970[_0xff77('0x25')]+_0xff77('0x2f')]){return rpc[_0x37d970[_0xff77('0x25')]+'QueueReport'][_0xff77('0x30')](_0x1889e0)[_0xff77('0x31')](function(_0xd9c5a){logger['error'](_0xff77('0x32'));});}}}function stopRouting(_0x3eb997,_0x1343f8,_0x5ef107,_0xae077d){if(_0x3eb997&&_0x1343f8){_0x1343f8['waiting']-=0x1;var _0xa5f673={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xff77('0xf')](_0xff77('0x21')),'reason':_0xff77('0x33')};logger[_0xff77('0x2d')](util['format'](_0xff77('0x34'),_0x3eb997,_0x1343f8[_0xff77('0x2e')]));emitChannelQueueInteraction(_0x5ef107['channel'],_0x1343f8[_0xff77('0x2e')],_0x5ef107[_0xff77('0x1f')],_0x5ef107[_0xff77('0xb')][_0xff77('0x2e')],_0x5ef107[_0xff77('0x29')]['id'],![],_0xae077d,_0x1343f8['id']);if(rpc[_0x5ef107['channel']+_0xff77('0x2f')]){return rpc[_0x5ef107[_0xff77('0x25')]+_0xff77('0x2f')][_0xff77('0x35')](_0x3eb997,_0xa5f673)[_0xff77('0x31')](function(_0x44c2c8){logger[_0xff77('0x36')](_0xff77('0x37'));});}}}function endRouting(_0x462f4f,_0x176040,_0x139666,_0x33121c){if(_0x462f4f&&_0x176040){_0x176040[_0xff77('0x1e')]-=0x1;var _0x591922={'leaveAt':moment()[_0xff77('0xf')](_0xff77('0x21')),'exitAt':moment()[_0xff77('0xf')](_0xff77('0x21')),'reason':_0xff77('0x38')};logger[_0xff77('0x2d')](util[_0xff77('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x462f4f,_0x176040[_0xff77('0x2e')]));emitChannelQueueInteraction(_0x139666[_0xff77('0x25')],_0x176040[_0xff77('0x2e')],_0x139666[_0xff77('0x1f')],_0x139666[_0xff77('0xb')]['name'],_0x139666[_0xff77('0x29')]['id'],![],_0x33121c);if(rpc[_0x139666[_0xff77('0x25')]+'QueueReport']){return rpc[_0x139666[_0xff77('0x25')]+_0xff77('0x2f')][_0xff77('0x35')](_0x462f4f,_0x591922)[_0xff77('0x31')](function(_0x40c4c3){logger[_0xff77('0x36')](_0xff77('0x37'));});}}}function handleFindQueue(_0x5d7a39){return function(_0x22f9e9){return _0x22f9e9[_0xff77('0x2e')]['toLowerCase']()===_0x5d7a39[_0xff77('0x39')]();};}exports['consequence']=function(_0x1b6017,_0x4faf86,_0x121844,_0x4c690b){return function(_0x4c4529){try{var _0x304d8f={'name':_0x4faf86[0x0],'timeout':_0x4faf86[0x1]};var _0x43d472=queue['validate'](_0x304d8f,{'typecast':!![]});if(_0x43d472['length']){logger[_0xff77('0x36')](_0xff77('0x3a'),_0x1b6017,_['map'](_0x43d472,_0xff77('0x29'))[_0xff77('0x3b')](',\x20'));_0x4c4529['stop']();}else{var _0x4d74b0=_[_0xff77('0x3c')](_0x121844[_0x4c690b[_0xff77('0x25')]+'Queues'],handleFindQueue(_0x304d8f['name']));if(_0x4d74b0){startRouting(_0x1b6017,_0x4d74b0,_0x4c690b,_0x121844);var _0x22c85f=(_0x4d74b0['timeout']||0xa)*0x3e8;var _0x410e46=(_0x304d8f[_0xff77('0x38')]||0x14)*0x3e8;var _0x147215,_0x24f8c0;if(_0x22c85f>_0x410e46){_0x410e46=_0x22c85f;}var _0x5d442d=seqqueue[_0xff77('0x3d')](_0x22c85f);_0x5d442d['id']=_0x1b6017;_0x5d442d[_0xff77('0x3e')]=_0x22c85f;_0x5d442d['qtimeout']=_0x410e46;_0x5d442d['channel']=_0x4c690b[_0xff77('0x25')];_0x121844['rules'][_0x1b6017]['on']('end',function(){stopRouting(_0x1b6017,_0x4d74b0,_0x4c690b,_0x121844);_0x5d442d[_0xff77('0x3f')](!![]);clearTimeout(_0x147215);_0x147215=undefined;if(_0x121844['rules'][_0x1b6017]){delete _0x121844[_0xff77('0x40')][_0x1b6017];}logger[_0xff77('0x2d')](_0xff77('0x41'),_0x1b6017);_0x4c4529['stop']();});_0x147215=setTimeout(function(){endRouting(_0x1b6017,_0x4d74b0,_0x4c690b,_0x121844);clearTimeout(_0x147215);_0x5d442d[_0xff77('0x3f')](!![]);logger[_0xff77('0x2d')](_0xff77('0x42'),_0x1b6017);_0x4c4529[_0xff77('0x43')]();},_0x410e46);switch(_0x4d74b0[_0xff77('0x44')]){case _0xff77('0x45'):strategy[_0xff77('0x45')](_0x5d442d,_0x4d74b0,_0x121844,_0x4c690b);break;default:strategy[_0xff77('0x46')](_0x5d442d,_0x4d74b0,_0x121844,_0x4c690b);}}else{logger[_0xff77('0x36')](_0xff77('0x47'),_0x1b6017,_0x304d8f['name']);_0x4c4529[_0xff77('0x48')]();}}}catch(_0x1384da){console['log'](_0x1384da);logger['error'](_0xff77('0x3a'),_0x1b6017,_0x1384da[_0xff77('0x49')]);_0x4c4529[_0xff77('0x48')]();}};}; \ 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 7a89eb1..6452a9a 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 _0x48fd=['busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x2222a1,_0x333e4b){var _0xaa57ab=function(_0x15c213){while(--_0x15c213){_0x2222a1['push'](_0x2222a1['shift']());}};_0xaa57ab(++_0x333e4b);}(_0x48fd,0x92));var _0xd48f=function(_0x2b5e05,_0x22449c){_0x2b5e05=_0x2b5e05-0x0;var _0x14c2db=_0x48fd[_0x2b5e05];return _0x14c2db;};'use strict';var _=require(_0xd48f('0x0'));var uuid=require('uuid');var util=require(_0xd48f('0x1'));var logger=require(_0xd48f('0x2'))(_0xd48f('0x3'));var Agent=function(_0x1af912,_0x8734e5,_0x31149e,_0x586bc8){this[_0xd48f('0x4')]=uuid['v4']();this[_0xd48f('0x5')]=_0x1af912;this['agent']=_0x8734e5;this[_0xd48f('0x6')]=_0x31149e;this['routing']=_0x586bc8;this[_0xd48f('0x5')][_0xd48f('0x7')](this[_0xd48f('0x8')][_0xd48f('0x9')](this),this[_0xd48f('0xa')][_0xd48f('0x9')](this));this['squeue']['on'](_0xd48f('0xb'),this[_0xd48f('0xa')]['bind'](this));this[_0xd48f('0x5')]['on'](_0xd48f('0xc'),this[_0xd48f('0xd')][_0xd48f('0x9')](this));};Agent[_0xd48f('0xe')][_0xd48f('0x7')]=function(){this[_0xd48f('0x5')]['push'](this[_0xd48f('0x8')][_0xd48f('0x9')](this),this[_0xd48f('0xa')][_0xd48f('0x9')](this));};Agent[_0xd48f('0xe')][_0xd48f('0xd')]=function(){this[_0xd48f('0xa')](!![]);};Agent[_0xd48f('0xe')][_0xd48f('0x8')]=function(_0x2c22d0){logger[_0xd48f('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xd48f('0x5')]['id'],this[_0xd48f('0x10')]['id']);if(_[_0xd48f('0x11')](this['realtime'][_0xd48f('0x12')][this['agent']['id']])){logger[_0xd48f('0xf')](_0xd48f('0x13'),this[_0xd48f('0x5')]['id'],this[_0xd48f('0x10')]['id']);setTimeout(this[_0xd48f('0x7')][_0xd48f('0x9')](this),0x3e8);}else{if(this['routing'][_0xd48f('0x14')]||util[_0xd48f('0x15')](this[_0xd48f('0x5')]['id'],this['realtime']['agents'][this[_0xd48f('0x10')]['id']],this['squeue'][_0xd48f('0x16')],![])){this[_0xd48f('0x6')][_0xd48f('0x12')][this['agent']['id']][_0xd48f('0x17')]=!![];this[_0xd48f('0x6')]['agents'][this[_0xd48f('0x10')]['id']][_0xd48f('0x18')]=undefined;util[_0xd48f('0x19')](this[_0xd48f('0x4')],this[_0xd48f('0x5')]['id'],this['realtime'][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']],null,this[_0xd48f('0x3')]);util[_0xd48f('0x1a')](this[_0xd48f('0x5')]['id'],this[_0xd48f('0x6')][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']],'RINGING'+(this[_0xd48f('0x3')][_0xd48f('0x14')]?_0xd48f('0x1b'):''));}else{logger[_0xd48f('0xf')](_0xd48f('0x1c'),this[_0xd48f('0x5')]['id'],this[_0xd48f('0x10')]['id']);setTimeout(this[_0xd48f('0x7')][_0xd48f('0x9')](this),0x3e8);}}};Agent['prototype'][_0xd48f('0xa')]=function(_0x1a2f75){if(_[_0xd48f('0x11')](this['realtime'][_0xd48f('0x12')][this['agent']['id']])){return logger['info'](_0xd48f('0x13'),this['squeue']['id'],this[_0xd48f('0x10')]['id']);}else{logger[_0xd48f('0xf')](_0xd48f('0x1d'),this[_0xd48f('0x5')]['id'],this[_0xd48f('0x10')]['id']);util[_0xd48f('0x1e')](this[_0xd48f('0x4')],this['squeue']['id'],this[_0xd48f('0x6')][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']],null,this['routing']);this[_0xd48f('0x6')][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']]['busy']=![];this[_0xd48f('0x6')][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']][_0xd48f('0x18')]=undefined;util[_0xd48f('0x1a')](this[_0xd48f('0x5')]['id'],this[_0xd48f('0x6')][_0xd48f('0x12')][this[_0xd48f('0x10')]['id']],_0x1a2f75?_0xd48f('0x1f'):_0xd48f('0x20'));}if(!_0x1a2f75){setTimeout(this[_0xd48f('0x7')][_0xd48f('0x9')](this),0x3e8);}};function agent(_0x232331,_0xca7a80,_0x283d00,_0x5d4a02){return new Agent(_0x232331,_0xca7a80,_0x283d00,_0x5d4a02);}module[_0xd48f('0x21')]=agent; \ No newline at end of file +var _0x2f16=['realtime','push','handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x4c7916,_0x366914){var _0x5047a0=function(_0xa0f89a){while(--_0xa0f89a){_0x4c7916['push'](_0x4c7916['shift']());}};_0x5047a0(++_0x366914);}(_0x2f16,0x164));var _0x62f1=function(_0x1ac4f3,_0x3b8d4c){_0x1ac4f3=_0x1ac4f3-0x0;var _0xe42f7c=_0x2f16[_0x1ac4f3];return _0xe42f7c;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require(_0x62f1('0x0'))(_0x62f1('0x1'));var Agent=function(_0x33fc3f,_0x3bd251,_0x2ada24,_0x5b7265){this[_0x62f1('0x2')]=uuid['v4']();this[_0x62f1('0x3')]=_0x33fc3f;this['agent']=_0x3bd251;this[_0x62f1('0x4')]=_0x2ada24;this[_0x62f1('0x1')]=_0x5b7265;this[_0x62f1('0x3')][_0x62f1('0x5')](this[_0x62f1('0x6')]['bind'](this),this[_0x62f1('0x7')][_0x62f1('0x8')](this));this[_0x62f1('0x3')]['on'](_0x62f1('0x9'),this[_0x62f1('0x7')][_0x62f1('0x8')](this));this[_0x62f1('0x3')]['on'](_0x62f1('0xa'),this['handleDrained'][_0x62f1('0x8')](this));};Agent[_0x62f1('0xb')][_0x62f1('0x5')]=function(){this['squeue'][_0x62f1('0x5')](this[_0x62f1('0x6')][_0x62f1('0x8')](this),this[_0x62f1('0x7')][_0x62f1('0x8')](this));};Agent['prototype'][_0x62f1('0xc')]=function(){this[_0x62f1('0x7')](!![]);};Agent[_0x62f1('0xb')][_0x62f1('0x6')]=function(_0x2a1dbc){logger[_0x62f1('0xd')](_0x62f1('0xe'),this[_0x62f1('0x3')]['id'],this[_0x62f1('0xf')]['id']);if(_[_0x62f1('0x10')](this[_0x62f1('0x4')][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']])){logger[_0x62f1('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x62f1('0x3')]['id'],this[_0x62f1('0xf')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x62f1('0x1')][_0x62f1('0x12')]||util['isAgentAvailable'](this[_0x62f1('0x3')]['id'],this[_0x62f1('0x4')][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']],this['squeue'][_0x62f1('0x13')],![])){this['realtime'][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']][_0x62f1('0x14')]=!![];this['realtime']['agents'][this[_0x62f1('0xf')]['id']][_0x62f1('0x15')]=undefined;util[_0x62f1('0x16')](this[_0x62f1('0x2')],this[_0x62f1('0x3')]['id'],this['realtime'][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']],null,this['routing']);util[_0x62f1('0x17')](this['squeue']['id'],this[_0x62f1('0x4')][_0x62f1('0x11')][this['agent']['id']],_0x62f1('0x18')+(this['routing'][_0x62f1('0x12')]?':FORCED':''));}else{logger[_0x62f1('0xd')](_0x62f1('0x19'),this[_0x62f1('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x62f1('0x5')]['bind'](this),0x3e8);}}};Agent[_0x62f1('0xb')][_0x62f1('0x7')]=function(_0x29c965){if(_[_0x62f1('0x10')](this[_0x62f1('0x4')][_0x62f1('0x11')][this['agent']['id']])){return logger['info'](_0x62f1('0x1a'),this['squeue']['id'],this[_0x62f1('0xf')]['id']);}else{logger[_0x62f1('0xd')](_0x62f1('0x1b'),this[_0x62f1('0x3')]['id'],this[_0x62f1('0xf')]['id']);util[_0x62f1('0x1c')](this[_0x62f1('0x2')],this[_0x62f1('0x3')]['id'],this['realtime'][_0x62f1('0x11')][this['agent']['id']],null,this[_0x62f1('0x1')]);this['realtime'][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']]['busy']=![];this[_0x62f1('0x4')][_0x62f1('0x11')][this[_0x62f1('0xf')]['id']][_0x62f1('0x15')]=undefined;util['writeLog'](this['squeue']['id'],this[_0x62f1('0x4')][_0x62f1('0x11')][this['agent']['id']],_0x29c965?'STOP':_0x62f1('0x1d'));}if(!_0x29c965){setTimeout(this[_0x62f1('0x5')][_0x62f1('0x8')](this),0x3e8);}};function agent(_0x4739b6,_0x5e104b,_0xd597d3,_0x46477e){return new Agent(_0x4739b6,_0x5e104b,_0xd597d3,_0x46477e);}module['exports']=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 9958d4c..3a5c96c 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 _0xd056=['isNil','queue','Agents','length','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busy','busyQueue','lodash','uuid','../../../../../config/logger','notificationId','routing','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0x20edeb,_0x462316){var _0x1ef0f7=function(_0x16fc57){while(--_0x16fc57){_0x20edeb['push'](_0x20edeb['shift']());}};_0x1ef0f7(++_0x462316);}(_0xd056,0x1e1));var _0x6d05=function(_0x353110,_0x468467){_0x353110=_0x353110-0x0;var _0x16ce54=_0xd056[_0x353110];return _0x16ce54;};'use strict';var _=require(_0x6d05('0x0'));var uuid=require(_0x6d05('0x1'));var util=require('./util');var logger=require(_0x6d05('0x2'))('routing');var Beepall=function(_0x17a7d9,_0x4f6ce7,_0x3c96fe,_0x21c6e4){this[_0x6d05('0x3')]=uuid['v4']();this['squeue']=_0x17a7d9;this['queue']=_0x4f6ce7;this['realtime']=_0x3c96fe;this[_0x6d05('0x4')]=_0x21c6e4;this[_0x6d05('0x5')][_0x6d05('0x6')](this[_0x6d05('0x7')][_0x6d05('0x8')](this),this[_0x6d05('0x9')][_0x6d05('0x8')](this));this['squeue']['on'](_0x6d05('0xa'),this['handleTimeout'][_0x6d05('0x8')](this));this[_0x6d05('0x5')]['on'](_0x6d05('0xb'),this[_0x6d05('0xc')]['bind'](this));};Beepall['prototype']['push']=function(){this[_0x6d05('0x5')][_0x6d05('0x6')](this['handleRun'][_0x6d05('0x8')](this),this[_0x6d05('0x9')][_0x6d05('0x8')](this));};Beepall[_0x6d05('0xd')][_0x6d05('0xc')]=function(_0x142e50){this['handleTimeout'](!![]);};Beepall[_0x6d05('0xd')][_0x6d05('0x7')]=function(_0x3ccf0a){var _0x35efb6=!![];if(!_[_0x6d05('0xe')](this[_0x6d05('0xf')])&&!_[_0x6d05('0xe')](this['queue'][_0x6d05('0x10')])&&this[_0x6d05('0xf')][_0x6d05('0x10')][_0x6d05('0x11')]>0x0){for(var _0x53fa09=0x0,_0x240170;_0x53fa090x0){for(var _0x30906c=0x0,_0x29b875;_0x30906c0x0&&_0x4c37aa[_0x1e1ec4+_0x4409('0x21')]>=_0x4c37aa[_0x1e1ec4+'Capacity']){writeLog(_0x15dbf0,_0x4c37aa,_0x1e1ec4['toUpperCase']()+_0x4409('0x22'));return![];}}return!![];};exports['showNotification']=function(_0x3875da,_0x826f55,_0x419850,_0x353667,_0x29fe1d){return sendNotification(!![],_0x3875da,_0x826f55,_0x419850,_0x353667,_0x29fe1d);};exports['hideNotification']=function(_0x52d8c1,_0x56c31a,_0x1b61f2,_0xc90688,_0x502cea){return sendNotification(![],_0x52d8c1,_0x56c31a,_0x1b61f2,_0xc90688,_0x502cea);};exports[_0x4409('0x23')]=writeLog; \ No newline at end of file +var _0x9644=['redis','localhost','emit','format','user:%s','name','user:save','notificationSound','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','OFFLINE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','showNotification','writeLog','lodash','../utils','ioredis','../../../../../config/logger','routing'];(function(_0xb1b667,_0x416ddf){var _0xad0c7b=function(_0x5817b0){while(--_0x5817b0){_0xb1b667['push'](_0xb1b667['shift']());}};_0xad0c7b(++_0x416ddf);}(_0x9644,0xc7));var _0x4964=function(_0x20eba8,_0x23768a){_0x20eba8=_0x20eba8-0x0;var _0xc119a9=_0x9644[_0x20eba8];return _0xc119a9;};'use strict';var _=require(_0x4964('0x0'));var util=require('util');var utils=require(_0x4964('0x1'));var Mustache=require('mustache');var Redis=require(_0x4964('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x4964('0x3'))(_0x4964('0x4'));config[_0x4964('0x5')]=_['defaults'](config[_0x4964('0x5')],{'host':_0x4964('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4964('0x5')]));function emit(_0x10c27b,_0x5c6fcf,_0x3970bc){io['to'](_0x10c27b)[_0x4964('0x7')](_0x5c6fcf,_0x3970bc);}function sendNotification(_0x4c0389,_0x1560a0,_0x2832f0,_0x5b1780,_0x50ecd1,_0x2a741b){io['to'](util[_0x4964('0x8')](_0x4964('0x9'),_0x5b1780[_0x4964('0xa')]))[_0x4964('0x7')](_0x4964('0xb'),_0x5b1780);var _0x55e9ce=_0x2a741b||{};var _0x3c7f93=_0x2832f0['split']('.');var _0x4ebcc6={'uniqueid':_0x1560a0,'channel':_0x3c7f93[0x0],'id':_0x3c7f93[0x1],'title':_0x3c7f93[0x0]+'\x20interaction','interactionId':_0x3c7f93[0x2],'queue':_0x50ecd1?_0x50ecd1[_0x4964('0xa')]:null,'sound':_0x55e9ce['account'][_0x4964('0xc')],'shake':_0x55e9ce[_0x4964('0xd')][_0x4964('0xe')]};try{if(!_0x55e9ce[_0x4964('0xf')]){_0x55e9ce[_0x4964('0xf')]={};}if(_0x50ecd1){_0x55e9ce['body'][_0x4964('0x10')]=_0x50ecd1;}else if(_0x55e9ce['body'][_0x4964('0x10')]){delete _0x55e9ce[_0x4964('0xf')][_0x4964('0x10')];}_0x4ebcc6['msg']=utils[_0x4964('0x11')](_0x55e9ce[_0x4964('0xd')][_0x4964('0x12')],_0x55e9ce);}catch(_0x386e23){_0x4ebcc6['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x4964('0x13')](util[_0x4964('0x8')](_0x4964('0x14'),_0x1560a0,_0x386e23[_0x4964('0x15')]));}io['to'](util[_0x4964('0x8')]('user:%s',_0x5b1780[_0x4964('0xa')]))['emit'](util[_0x4964('0x8')]('notification:%s',_0x4c0389?'save':_0x4964('0x16')),_0x4ebcc6);}function writeLog(_0x1c2646,_0x4e39fc,_0x40567a){return logger[_0x4964('0x17')](util[_0x4964('0x8')](_0x4964('0x18'),_0x1c2646,_0x4e39fc[_0x4964('0xa')],_0x40567a));}exports[_0x4964('0x19')]=function(_0x5dc0b5,_0x2a6fea,_0x768aa3,_0x2f953e){if(_0x2a6fea[_0x4964('0x1a')]){writeLog(_0x5dc0b5,_0x2a6fea,'BUSY');return![];}if(!_0x2a6fea['online']){writeLog(_0x5dc0b5,_0x2a6fea,_0x4964('0x1b'));return![];}if(_0x2a6fea[_0x768aa3+'Pause']){writeLog(_0x5dc0b5,_0x2a6fea,'PAUSE');return![];}if(_0x2f953e&&_0x2a6fea['hasOwnProperty'](_0x768aa3+_0x4964('0x1c'))&&_0x2a6fea[_0x4964('0x1d')](_0x768aa3+_0x4964('0x1e'))){if(_0x2a6fea[_0x768aa3+_0x4964('0x1c')]>0x0&&_0x2a6fea[_0x768aa3+_0x4964('0x1e')]>=_0x2a6fea[_0x768aa3+'Capacity']){writeLog(_0x5dc0b5,_0x2a6fea,_0x768aa3[_0x4964('0x1f')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x4964('0x20')]=function(_0x26f080,_0x495b6d,_0x4a55f5,_0x37a94e,_0x55fc75){return sendNotification(!![],_0x26f080,_0x495b6d,_0x4a55f5,_0x37a94e,_0x55fc75);};exports['hideNotification']=function(_0x357534,_0x3fcdca,_0x365234,_0x43da7a,_0x2d395c){return sendNotification(![],_0x357534,_0x3fcdca,_0x365234,_0x43da7a,_0x2d395c);};exports[_0x4964('0x21')]=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 43372b6..d19ce28 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 _0x215c=['consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','isObject','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x215c,0xc1));var _0xc215=function(_0x4d3cf0,_0x3635ed){_0x4d3cf0=_0x4d3cf0-0x0;var _0x322c85=_0x215c[_0x4d3cf0];return _0x322c85;};'use strict';var schema=require(_0xc215('0x0'));var sh=require(_0xc215('0x1'));var _=require(_0xc215('0x2'));var utils=require('./utils');var logger=require(_0xc215('0x3'))(_0xc215('0x4'));var system=schema({'command':{'type':_0xc215('0x5'),'required':!![],'message':_0xc215('0x6')}});exports[_0xc215('0x7')]=function(_0x240f95,_0x5455c4){return function(_0x4aa1ae){try{var _0x1d36a8={'command':_0x5455c4[0x0]};var _0x582899=system['validate'](_0x1d36a8,{'typecast':!![]});if(_0x582899[_0xc215('0x8')]){logger[_0xc215('0x9')](_0xc215('0xa'),_0x240f95,_[_0xc215('0xb')](_0x582899,'message')[_0xc215('0xc')](',\x20'));logger[_0xc215('0xd')](_0xc215('0xe'),_0x240f95);_0x4aa1ae[_0xc215('0xf')]();}else{var _0x52fd85=this;var _0x140190=utils[_0xc215('0x10')](_0x5455c4[0x0],this);logger[_0xc215('0xd')](_0xc215('0x11'),_0x240f95,_0x140190);sh['exec'](_[_0xc215('0x12')](_0x140190),function(_0x290d4c,_0x52146e){logger[_0xc215('0xd')](_0xc215('0x13'),_0x240f95,_0x290d4c);if(_0x290d4c==0x0){var _0x142e9b=_0x52146e[_0xc215('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xc215('0x15')](_0x5455c4[0x1])||_[_0xc215('0x16')](_0x5455c4[0x1])){logger[_0xc215('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x240f95);_0x52fd85[_0xc215('0x17')][_0x5455c4[0x1]]=_0x142e9b;}else{logger[_0xc215('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x240f95,_0x5455c4[0x1],_0x142e9b);_0x52fd85[_0xc215('0x17')][_0x5455c4[0x1]]=_0x142e9b;}}_0x4aa1ae['next']();});}}catch(_0xe35427){logger[_0xc215('0x9')](_0xc215('0xa'),_0x240f95,_[_0xc215('0x18')](_0xe35427)?JSON['stringify'](_0xe35427):_0xe35427);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x240f95);_0x4aa1ae['next']();}};}; \ No newline at end of file +var _0x48d2=['stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0x48d2,0x16d));var _0x248d=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x48d2[_0x72a33d];return _0x2621d5;};'use strict';var schema=require(_0x248d('0x0'));var sh=require(_0x248d('0x1'));var _=require(_0x248d('0x2'));var utils=require(_0x248d('0x3'));var logger=require(_0x248d('0x4'))(_0x248d('0x5'));var system=schema({'command':{'type':_0x248d('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x224b05,_0xe9a92c){return function(_0x3f9275){try{var _0x1babf6={'command':_0xe9a92c[0x0]};var _0x429e87=system[_0x248d('0x0')](_0x1babf6,{'typecast':!![]});if(_0x429e87[_0x248d('0x7')]){logger[_0x248d('0x8')](_0x248d('0x9'),_0x224b05,_[_0x248d('0xa')](_0x429e87,_0x248d('0xb'))[_0x248d('0xc')](',\x20'));logger[_0x248d('0xd')](_0x248d('0xe'),_0x224b05);_0x3f9275[_0x248d('0xf')]();}else{var _0x2f5675=this;var _0x7165f2=utils[_0x248d('0x10')](_0xe9a92c[0x0],this);logger[_0x248d('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x224b05,_0x7165f2);sh['exec'](_[_0x248d('0x11')](_0x7165f2),function(_0x460aa7,_0xd0e014){logger[_0x248d('0xd')](_0x248d('0x12'),_0x224b05,_0x460aa7);if(_0x460aa7==0x0){var _0x953792=_0xd0e014[_0x248d('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x248d('0x14')](_0xe9a92c[0x1])||_[_0x248d('0x15')](_0xe9a92c[0x1])){logger['info'](_0x248d('0x16'),_0x224b05);_0x2f5675[_0x248d('0x17')][_0xe9a92c[0x1]]=_0x953792;}else{logger[_0x248d('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x224b05,_0xe9a92c[0x1],_0x953792);_0x2f5675[_0x248d('0x17')][_0xe9a92c[0x1]]=_0x953792;}}_0x3f9275['next']();});}}catch(_0x27ee9c){logger['error'](_0x248d('0x9'),_0x224b05,_[_0x248d('0x18')](_0x27ee9c)?JSON[_0x248d('0x19')](_0x27ee9c):_0x27ee9c);logger[_0x248d('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x224b05);_0x3f9275[_0x248d('0xf')]();}};}; \ 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 10ccfc1..dc50799 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(_0x569476,_0x543227){var _0x160f09=function(_0x52c49a){while(--_0x52c49a){_0x569476['push'](_0x569476['shift']());}};_0x160f09(++_0x543227);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x4616d6,_0x2c8a92){var _0x1caadc=function(_0x5efeaf){while(--_0x5efeaf){_0x4616d6['push'](_0x4616d6['shift']());}};_0x1caadc(++_0x2c8a92);}(_0x7a54,0x106));var _0x47a5=function(_0x22ed85,_0x348ad1){_0x22ed85=_0x22ed85-0x0;var _0x547df7=_0x7a54[_0x22ed85];return _0x547df7;};'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 7d0a032..efd7eea 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 _0xf874=['exports','render','merge','body','contact','account','interaction','mustache'];(function(_0x1194be,_0x5f1150){var _0x32af47=function(_0x164a37){while(--_0x164a37){_0x1194be['push'](_0x1194be['shift']());}};_0x32af47(++_0x5f1150);}(_0xf874,0x177));var _0x4f87=function(_0x27a912,_0x94c8d6){_0x27a912=_0x27a912-0x0;var _0x3f0e00=_0xf874[_0x27a912];return _0x3f0e00;};'use strict';var Mustache=require(_0x4f87('0x0'));var _=require('lodash');module[_0x4f87('0x1')]={'getMustacheRender':function(_0x2d2603,_0xbfff85){return Mustache[_0x4f87('0x2')](_0x2d2603,_[_0x4f87('0x3')](_0xbfff85[_0x4f87('0x4')],{'contact':_0xbfff85[_0x4f87('0x5')],'message':_0xbfff85['message'],'account':_0xbfff85[_0x4f87('0x6')],'interaction':_0xbfff85[_0x4f87('0x7')],'list':_0xbfff85['list']}))||'';}}; \ No newline at end of file +var _0xb469=['mustache','lodash','exports','render','merge','contact','message','interaction','list'];(function(_0x11cb2f,_0x5c409f){var _0x5800fc=function(_0x27f3a5){while(--_0x27f3a5){_0x11cb2f['push'](_0x11cb2f['shift']());}};_0x5800fc(++_0x5c409f);}(_0xb469,0x13b));var _0x9b46=function(_0x20d108,_0x41219a){_0x20d108=_0x20d108-0x0;var _0x3c881e=_0xb469[_0x20d108];return _0x3c881e;};'use strict';var Mustache=require(_0x9b46('0x0'));var _=require(_0x9b46('0x1'));module[_0x9b46('0x2')]={'getMustacheRender':function(_0x34f477,_0x1a41e8){return Mustache[_0x9b46('0x3')](_0x34f477,_[_0x9b46('0x4')](_0x1a41e8['body'],{'contact':_0x1a41e8[_0x9b46('0x5')],'message':_0x1a41e8[_0x9b46('0x6')],'account':_0x1a41e8['account'],'interaction':_0x1a41e8[_0x9b46('0x7')],'list':_0x1a41e8[_0x9b46('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d724b47..2b6dbb1 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 _0xc94f=['TagId','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','end','stack','routing\x20is\x20empty','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busyQueue','emit','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','name','smsQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/logger','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','split','push','slice','dialogflow','amazonlex','appdata','tag'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xc94f,0x18f));var _0xfc94=function(_0x162530,_0x3ad958){_0x162530=_0x162530-0x0;var _0x110514=_0xc94f[_0x162530];return _0x110514;};'use strict';var _=require(_0xfc94('0x0'));var util=require(_0xfc94('0x1'));var path=require(_0xfc94('0x2'));var fs=require('fs');var jayson=require(_0xfc94('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0xfc94('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0xfc94('0x5'))};var rpc={'openchannelQueueReport':require(_0xfc94('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xfc94('0x6')),'faxQueueReport':require(_0xfc94('0x7'))};var RuleEngine=require(_0xfc94('0x8'));function getId(_0x40d071,_0x42bfde,_0x336743){return util[_0xfc94('0x9')](_0xfc94('0xa'),_0x40d071,_0x42bfde||0x0,_0x336743||0x0);}function getIntervals(_0x1bf55a,_0x4e5b38){var _0x2e1154=[];if(!_[_0xfc94('0xb')](_0x4e5b38['IntervalId'])&&!_[_0xfc94('0xb')](_0x1bf55a[_0x4e5b38['IntervalId']])&&!_[_0xfc94('0xb')](_0x1bf55a[_0x4e5b38[_0xfc94('0xc')]]['Intervals'])){_0x2e1154=_[_0xfc94('0xd')](_0x1bf55a[_0x4e5b38['IntervalId']][_0xfc94('0xe')],_0xfc94('0xf'));}else if(!_[_0xfc94('0xb')](_0x4e5b38[_0xfc94('0xf')])){_0x2e1154=[_0x4e5b38[_0xfc94('0xf')]];}return _0x2e1154;}exports[_0xfc94('0x10')]=function(_0x1da124){_0x1da124[_0xfc94('0x11')]={};return new BPromise(function(_0x431cb7,_0x4bab3a){var _0x3eae2f={'Start':function(_0x1d5615){var _0x225b1f=this;return new Promise(function(_0x1d3c12,_0x4809a8){if(_0x1d5615){try{var _0x2f03f0=[];var _0x319337=getId(_0x1d5615[_0xfc94('0x12')],_0x1d5615[_0xfc94('0x13')]?_0x1d5615[_0xfc94('0x13')]['id']:0x0,_0x1d5615['interaction']?_0x1d5615[_0xfc94('0x14')]['id']:0x0);if(_0x1d5615[_0xfc94('0x15')]&&_[_0xfc94('0x16')](_0x1d5615[_0xfc94('0x15')])&&_0x1d5615[_0xfc94('0x15')][_0xfc94('0x17')]){for(var _0x10246b=0x0;_0x10246b<_0x1d5615[_0xfc94('0x15')][_0xfc94('0x17')];_0x10246b+=0x1){var _0x3ebfc1=_0x1d5615[_0xfc94('0x15')][_0x10246b];if(fs['existsSync'](path[_0xfc94('0x18')](__dirname,_0xfc94('0x15'),_0x3ebfc1[_0xfc94('0x19')]+_0xfc94('0x1a')))){var _0xccff2c=[];switch(_0x3ebfc1['app'][_0xfc94('0x1b')]()){case _0xfc94('0x1c'):var _0x496d21=_0x3ebfc1['appdata'][_0xfc94('0x1d')](',');_0xccff2c[_0xfc94('0x1e')](_0x496d21[0x0]);_0xccff2c['push'](_0x496d21[_0xfc94('0x1f')](0x1,_0x496d21[_0xfc94('0x17')])[_0xfc94('0x18')](','));break;case _0xfc94('0x20'):var _0x496d21=_0x3ebfc1['appdata'][_0xfc94('0x1d')](',');_0xccff2c[_0xfc94('0x1e')](_0x496d21[0x0]);_0xccff2c[_0xfc94('0x1e')](_0x496d21[0x1]);_0xccff2c['push'](_0x496d21[_0xfc94('0x1f')](0x2,_0x496d21[_0xfc94('0x17')])[_0xfc94('0x18')](','));break;case _0xfc94('0x21'):var _0x496d21=_0x3ebfc1[_0xfc94('0x22')][_0xfc94('0x1d')](',');_0xccff2c[_0xfc94('0x1e')](_0x496d21[0x0]);_0xccff2c[_0xfc94('0x1e')](_0x496d21[0x1]);_0xccff2c['push'](_0x496d21[0x2]);_0xccff2c['push'](_0x496d21[0x3]);_0xccff2c[_0xfc94('0x1e')](_0x496d21[_0xfc94('0x1f')](0x4,_0x496d21[_0xfc94('0x17')])[_0xfc94('0x18')](','));break;case _0xfc94('0x13'):_0xccff2c[_0xfc94('0x1e')](_0x3ebfc1[_0xfc94('0x22')]);break;case _0xfc94('0x23'):_0xccff2c[_0xfc94('0x1e')](_0x3ebfc1[_0xfc94('0x24')]);_0xccff2c['push'](_0x3ebfc1[_0xfc94('0x22')]);break;default:_0xccff2c=_['isNil'](_0x3ebfc1[_0xfc94('0x22')])?[]:_0x3ebfc1['appdata'][_0xfc94('0x1d')](',');}var _0x209852={'id':util[_0xfc94('0x9')]('%s:%s:%s',_0x319337,_0x3ebfc1['id'],_0x3ebfc1[_0xfc94('0x19')]),'condition':require(_0xfc94('0x25'))[_0xfc94('0x26')](_0x319337,getIntervals(_0x1da124[_0xfc94('0x27')],_0x3ebfc1),_0x1da124),'consequence':require(_0xfc94('0x28')+_0x3ebfc1[_0xfc94('0x19')])[_0xfc94('0x29')](_0x319337,_0xccff2c,_0x1da124,_0x1d5615),'p':_0x3ebfc1[_0xfc94('0x2a')]||0x0};logger[_0xfc94('0x2b')](_0xfc94('0x2c'),_0x209852['id'],_0xfc94('0x2d'),getIntervals(_0x1da124[_0xfc94('0x27')],_0x3ebfc1)[_0xfc94('0x18')](_0xfc94('0x2e')));_0x2f03f0[_0xfc94('0x1e')](_0x209852);}else{logger[_0xfc94('0x2f')](_0xfc94('0x30'),path[_0xfc94('0x18')](__dirname,'applications',_0x3ebfc1[_0xfc94('0x19')]+_0xfc94('0x1a')));}}_0x1da124[_0xfc94('0x11')][_0x319337]=new RuleEngine(_0x2f03f0);_0x1da124[_0xfc94('0x11')][_0x319337][_0xfc94('0x31')](_0x1d5615,function(_0x41e535){logger[_0xfc94('0x2b')]('Applications\x20executed',JSON[_0xfc94('0x32')](_0x41e535[_0xfc94('0x33')]));if(_0x1da124[_0xfc94('0x11')][_0x319337]){_0x1da124[_0xfc94('0x11')][_0x319337]['emit'](_0xfc94('0x34'));}});return _0x1d3c12({'code':0xc8,'message':_0x1d5615});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x1d3c12({'code':0xc8,'message':_0x1d5615});}}catch(_0x4b7355){logger[_0xfc94('0x2f')](_0x4b7355[_0xfc94('0x35')]);return _0x4809a8(_0x225b1f['error'](0x1f4,_0x4b7355));}}return _0x4809a8(_0xfc94('0x36'));});},'AcceptMessage':function(_0x115610){var _0x58d4f8=this;return new Promise(function(_0xa6068d,_0x559f5b){if(_0x115610[_0xfc94('0x13')]&&_0x115610[_0xfc94('0x13')]['id']){try{var _0xdf543a=getId(_0x115610[_0xfc94('0x12')],_0x115610[_0xfc94('0x13')]?_0x115610[_0xfc94('0x13')]['id']:0x0,_0x115610[_0xfc94('0x14')]?_0x115610[_0xfc94('0x14')]['id']:0x0);if(_0x1da124[_0xfc94('0x11')][_0xdf543a]){_0x1da124['rules'][_0xdf543a]['emit'](_0xfc94('0x34'));if(rpc[_0x115610[_0xfc94('0x12')]+'QueueReport']){rpc[_0x115610['channel']+_0xfc94('0x37')]['update'](_0xdf543a,{'UserId':_0x115610[_0xfc94('0x13')][_0xfc94('0x38')]})[_0xfc94('0x39')](function(_0x5e8f6e){logger['error'](_0xfc94('0x3a'));});}}return _0xa6068d({'code':0xc8,'message':_0x115610});}catch(_0x3e6328){logger['error'](_0x3e6328[_0xfc94('0x35')]);return _0x559f5b(_0x58d4f8[_0xfc94('0x2f')](0x1f4,_0x3e6328));}}logger[_0xfc94('0x2f')](_0xfc94('0x3b'));return _0x559f5b(_0x58d4f8['error'](0x1f4,_0xfc94('0x3b')));});},'RejectMessage':function(_0x5c245b){var _0x23ea16=this;return new Promise(function(_0xadf8c,_0x5c9e12){if(_0x5c245b['agent']&&_0x5c245b[_0xfc94('0x3c')]['id']){try{if(_0x1da124['agents'][_0x5c245b[_0xfc94('0x3c')]['id']]){_0x1da124['agents'][_0x5c245b[_0xfc94('0x3c')]['id']]['busy']=![];_0x1da124[_0xfc94('0x3d')][_0x5c245b[_0xfc94('0x3c')]['id']][_0xfc94('0x3e')]=undefined;}return _0xadf8c({'code':0xc8,'message':_0x5c245b});}catch(_0x767790){logger[_0xfc94('0x2f')](_0x767790[_0xfc94('0x35')]);return _0x5c9e12(_0x23ea16[_0xfc94('0x2f')](0x1f4,_0x767790));}}logger[_0xfc94('0x2f')]('message\x20is\x20empty');return _0x5c9e12(_0x23ea16['error'](0x1f4,_0xfc94('0x3b')));});},'AbandonInteraction':function(_0x1ed1fe){var _0x261ab5=this;return new Promise(function(_0x5e2cc9,_0x195061){if(_0x1ed1fe[_0xfc94('0x12')]&&_0x1ed1fe[_0xfc94('0x14')]&&_0x1ed1fe[_0xfc94('0x14')]['id']){try{var _0x50dac8=getId(_0x1ed1fe['channel'],_0x1ed1fe['message']?_0x1ed1fe[_0xfc94('0x13')]['id']:0x0,_0x1ed1fe[_0xfc94('0x14')]?_0x1ed1fe[_0xfc94('0x14')]['id']:0x0);if(_0x1da124[_0xfc94('0x11')][_0x50dac8]){_0x1da124[_0xfc94('0x11')][_0x50dac8][_0xfc94('0x3f')](_0xfc94('0x34'));}return _0x5e2cc9({'code':0xc8,'message':_0x1ed1fe});}catch(_0x3ce087){logger[_0xfc94('0x2f')](_0x3ce087[_0xfc94('0x35')]);return _0x195061(_0x261ab5[_0xfc94('0x2f')](0x1f4,_0x3ce087));}}logger['error'](_0xfc94('0x3b'));return _0x195061(_0x261ab5[_0xfc94('0x2f')](0x1f4,_0xfc94('0x3b')));});},'AgentCapacity':function(_0x484e11){var _0x573c33=this;return new Promise(function(_0x2a8dce,_0x2d1fc2){if(_0x1da124[_0xfc94('0x3d')][_0xfc94('0x40')](_0x484e11['id'])){for(var _0x491dd1 in _0x484e11[_0xfc94('0x41')]){if(_0x484e11[_0xfc94('0x41')]['hasOwnProperty'](_0x491dd1)){if(_0x1da124['agents'][_0x484e11['id']][_0xfc94('0x40')](_0x491dd1+_0xfc94('0x42'))){_0x1da124[_0xfc94('0x3d')][_0x484e11['id']][_0x491dd1+_0xfc94('0x42')]=parseInt(_0x484e11[_0xfc94('0x41')][_0x491dd1],0xa);}}}_0x1da124['agents'][_0x484e11['id']]['updateRealtime']();return _0x2a8dce({'code':0xc8,'message':_0x1da124['agents'][_0x484e11['id']]});}else{return _0x2d1fc2(_0x573c33[_0xfc94('0x2f')](0x1f4,_0xfc94('0x43')));}});},'Agents':function(_0x44acee){return new Promise(function(_0x3d602a,_0x1484d2){var _0x163f0a=_[_0xfc94('0x44')](_0x1da124[_0xfc94('0x3d')]);_0x3d602a({'count':_0x163f0a[_0xfc94('0x17')],'rows':_0x163f0a});});},'ChatQueues':function(_0x276759){return new Promise(function(_0x602ad9,_0x276ca4){var _0x4abb6c=[];for(var _0x520e6a in _0x1da124[_0xfc94('0x45')]){if(_0x1da124[_0xfc94('0x45')][_0xfc94('0x40')](_0x520e6a)){var _0x33007d=_0x1da124[_0xfc94('0x45')][_0x520e6a];var _0x382005={'id':_0x33007d['id'],'available':_0x33007d[_0xfc94('0x46')],'loggedIn':_0x33007d[_0xfc94('0x47')],'name':_0x33007d['name'],'paused':_0x33007d[_0xfc94('0x48')],'waiting':_0x33007d[_0xfc94('0x49')]};_0x4abb6c['push'](_0x382005);}}_0x602ad9({'count':_0x4abb6c[_0xfc94('0x17')],'rows':_0x4abb6c});});},'MailQueues':function(_0xbff0b8){return new Promise(function(_0x2eb28e,_0xf0281c){var _0x4dcda8=[];for(var _0x428b46 in _0x1da124[_0xfc94('0x4a')]){if(_0x1da124[_0xfc94('0x4a')][_0xfc94('0x40')](_0x428b46)){var _0x531c73=_0x1da124[_0xfc94('0x4a')][_0x428b46];var _0x226e57={'id':_0x531c73['id'],'available':_0x531c73[_0xfc94('0x46')],'loggedIn':_0x531c73['loggedIn'],'name':_0x531c73['name'],'paused':_0x531c73[_0xfc94('0x48')],'waiting':_0x531c73['waiting']};_0x4dcda8[_0xfc94('0x1e')](_0x226e57);}}_0x2eb28e({'count':_0x4dcda8[_0xfc94('0x17')],'rows':_0x4dcda8});});},'OpenchannelQueues':function(_0x361a79){return new Promise(function(_0x4b26ca,_0x5833eb){var _0x5063ac=[];for(var _0x4cdefc in _0x1da124['openchannelQueues']){if(_0x1da124[_0xfc94('0x4b')][_0xfc94('0x40')](_0x4cdefc)){var _0x43ee61=_0x1da124[_0xfc94('0x4b')][_0x4cdefc];var _0x1337dd={'id':_0x43ee61['id'],'available':_0x43ee61['available'],'loggedIn':_0x43ee61[_0xfc94('0x47')],'name':_0x43ee61[_0xfc94('0x4c')],'paused':_0x43ee61[_0xfc94('0x48')],'waiting':_0x43ee61[_0xfc94('0x49')]};_0x5063ac[_0xfc94('0x1e')](_0x1337dd);}}_0x4b26ca({'count':_0x5063ac[_0xfc94('0x17')],'rows':_0x5063ac});});},'SmsQueues':function(_0x194fe5){return new Promise(function(_0x52227b,_0x1448de){var _0x5f3b47=[];for(var _0x3e0ea3 in _0x1da124[_0xfc94('0x4d')]){if(_0x1da124['smsQueues'][_0xfc94('0x40')](_0x3e0ea3)){var _0x5a544d=_0x1da124['smsQueues'][_0x3e0ea3];var _0x52eba1={'id':_0x5a544d['id'],'available':_0x5a544d[_0xfc94('0x46')],'loggedIn':_0x5a544d['loggedIn'],'name':_0x5a544d['name'],'paused':_0x5a544d['paused'],'waiting':_0x5a544d[_0xfc94('0x49')]};_0x5f3b47[_0xfc94('0x1e')](_0x52eba1);}}_0x52227b({'count':_0x5f3b47['length'],'rows':_0x5f3b47});});},'FaxQueues':function(_0x29d440){return new Promise(function(_0xbd9e5d,_0x19cca9){var _0x209ed7=[];for(var _0x4ee43f in _0x1da124[_0xfc94('0x4e')]){if(_0x1da124[_0xfc94('0x4e')][_0xfc94('0x40')](_0x4ee43f)){var _0x56848d=_0x1da124[_0xfc94('0x4e')][_0x4ee43f];var _0x318048={'id':_0x56848d['id'],'available':_0x56848d[_0xfc94('0x46')],'loggedIn':_0x56848d[_0xfc94('0x47')],'name':_0x56848d[_0xfc94('0x4c')],'paused':_0x56848d[_0xfc94('0x48')],'waiting':_0x56848d[_0xfc94('0x49')]};_0x209ed7['push'](_0x318048);}}_0xbd9e5d({'count':_0x209ed7[_0xfc94('0x17')],'rows':_0x209ed7});});},'ChatQueuesWaitingInteractions':function(_0x264ad1){return new Promise(function(_0x17ef3a,_0x2906bd){var _0x290ae4=_[_0xfc94('0x44')](_0x1da124[_0xfc94('0x4f')]);_0x17ef3a({'count':_0x290ae4['length'],'rows':_0x290ae4});});},'MailQueuesWaitingInteractions':function(_0x334bd0){return new Promise(function(_0x2f83ef,_0x515f15){var _0x249e53=_[_0xfc94('0x44')](_0x1da124['mailQueuesWaitingInteractions']);_0x2f83ef({'count':_0x249e53[_0xfc94('0x17')],'rows':_0x249e53});});},'OpenchannelQueuesWaitingInteractions':function(_0x1d6a05){return new Promise(function(_0xa307ae,_0x2579e1){var _0x36fe9a=_[_0xfc94('0x44')](_0x1da124[_0xfc94('0x50')]);_0xa307ae({'count':_0x36fe9a[_0xfc94('0x17')],'rows':_0x36fe9a});});},'SmsQueuesWaitingInteractions':function(_0x176a27){return new Promise(function(_0x28e923,_0xf637c0){var _0x5e0472=_[_0xfc94('0x44')](_0x1da124[_0xfc94('0x51')]);_0x28e923({'count':_0x5e0472[_0xfc94('0x17')],'rows':_0x5e0472});});},'FaxQueuesWaitingInteractions':function(_0x368626){return new Promise(function(_0xdb029f,_0x3746e3){var _0x3910b6=_[_0xfc94('0x44')](_0x1da124[_0xfc94('0x52')]);_0xdb029f({'count':_0x3910b6[_0xfc94('0x17')],'rows':_0x3910b6});});}};var _0x451569=jayson['server'](_0x3eae2f)[_0xfc94('0x53')]();_0x451569['on'](_0xfc94('0x2f'),function(_0x42f2b4){logger[_0xfc94('0x2f')](JSON[_0xfc94('0x32')](_0x42f2b4));return _0x4bab3a(_0x42f2b4);});_0x451569[_0xfc94('0x10')](0x232c,_0xfc94('0x54'),function(){console['log'](_0xfc94('0x55'),0x232c);return _0x431cb7(_0xfc94('0x56')+0x232c);});});}; \ No newline at end of file +var _0xb638=['channel','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','stack','capacity','hasOwnProperty','CurrentCapacity','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','TagId','%s:%s:%s','./interval','intervals','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','routing\x20is\x20empty','interaction'];(function(_0x9bf97b,_0x309a93){var _0x11cc7b=function(_0x4cc1c3){while(--_0x4cc1c3){_0x9bf97b['push'](_0x9bf97b['shift']());}};_0x11cc7b(++_0x309a93);}(_0xb638,0x1cb));var _0x8b63=function(_0x566099,_0x4f6e33){_0x566099=_0x566099-0x0;var _0xa5a5ee=_0xb638[_0x566099];return _0xa5a5ee;};'use strict';var _=require(_0x8b63('0x0'));var util=require(_0x8b63('0x1'));var path=require(_0x8b63('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x8b63('0x3'));var uuid=require('uuid');var config=require(_0x8b63('0x4'));var logger=require('../../../config/logger')(_0x8b63('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0x8b63('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8b63('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x8b63('0x8'));function getId(_0x5aba27,_0x2bf5a6,_0x2ff0b6){return util[_0x8b63('0x9')](_0x8b63('0xa'),_0x5aba27,_0x2bf5a6||0x0,_0x2ff0b6||0x0);}function getIntervals(_0x4fad23,_0x3d5c0){var _0x3477d2=[];if(!_[_0x8b63('0xb')](_0x3d5c0[_0x8b63('0xc')])&&!_[_0x8b63('0xb')](_0x4fad23[_0x3d5c0[_0x8b63('0xc')]])&&!_['isNil'](_0x4fad23[_0x3d5c0[_0x8b63('0xc')]][_0x8b63('0xd')])){_0x3477d2=_['map'](_0x4fad23[_0x3d5c0[_0x8b63('0xc')]][_0x8b63('0xd')],'interval');}else if(!_['isNil'](_0x3d5c0[_0x8b63('0xe')])){_0x3477d2=[_0x3d5c0[_0x8b63('0xe')]];}return _0x3477d2;}exports[_0x8b63('0xf')]=function(_0x397f11){_0x397f11[_0x8b63('0x10')]={};return new BPromise(function(_0x23491d,_0x401e2e){var _0x373a9d={'Start':function(_0x1be20a){var _0x195b70=this;return new Promise(function(_0x2b050d,_0x5ca5a8){if(_0x1be20a){try{var _0x339195=[];var _0x175249=getId(_0x1be20a['channel'],_0x1be20a[_0x8b63('0x11')]?_0x1be20a[_0x8b63('0x11')]['id']:0x0,_0x1be20a['interaction']?_0x1be20a['interaction']['id']:0x0);if(_0x1be20a[_0x8b63('0x12')]&&_[_0x8b63('0x13')](_0x1be20a[_0x8b63('0x12')])&&_0x1be20a[_0x8b63('0x12')][_0x8b63('0x14')]){for(var _0x4b0bf5=0x0;_0x4b0bf5<_0x1be20a[_0x8b63('0x12')][_0x8b63('0x14')];_0x4b0bf5+=0x1){var _0x537dee=_0x1be20a['applications'][_0x4b0bf5];if(fs[_0x8b63('0x15')](path[_0x8b63('0x16')](__dirname,_0x8b63('0x12'),_0x537dee[_0x8b63('0x17')]+_0x8b63('0x18')))){var _0x2c55e7=[];switch(_0x537dee[_0x8b63('0x17')][_0x8b63('0x19')]()){case _0x8b63('0x1a'):var _0x1bde07=_0x537dee[_0x8b63('0x1b')][_0x8b63('0x1c')](',');_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[0x0]);_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[_0x8b63('0x1e')](0x1,_0x1bde07[_0x8b63('0x14')])[_0x8b63('0x16')](','));break;case'dialogflow':var _0x1bde07=_0x537dee[_0x8b63('0x1b')]['split'](',');_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[0x0]);_0x2c55e7['push'](_0x1bde07[0x1]);_0x2c55e7['push'](_0x1bde07[_0x8b63('0x1e')](0x2,_0x1bde07[_0x8b63('0x14')])['join'](','));break;case'amazonlex':var _0x1bde07=_0x537dee[_0x8b63('0x1b')][_0x8b63('0x1c')](',');_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[0x0]);_0x2c55e7['push'](_0x1bde07[0x1]);_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[0x2]);_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[0x3]);_0x2c55e7[_0x8b63('0x1d')](_0x1bde07[_0x8b63('0x1e')](0x4,_0x1bde07[_0x8b63('0x14')])[_0x8b63('0x16')](','));break;case _0x8b63('0x11'):_0x2c55e7[_0x8b63('0x1d')](_0x537dee[_0x8b63('0x1b')]);break;case'tag':_0x2c55e7[_0x8b63('0x1d')](_0x537dee[_0x8b63('0x1f')]);_0x2c55e7['push'](_0x537dee[_0x8b63('0x1b')]);break;default:_0x2c55e7=_[_0x8b63('0xb')](_0x537dee[_0x8b63('0x1b')])?[]:_0x537dee['appdata'][_0x8b63('0x1c')](',');}var _0x149d68={'id':util[_0x8b63('0x9')](_0x8b63('0x20'),_0x175249,_0x537dee['id'],_0x537dee['app']),'condition':require(_0x8b63('0x21'))['condition'](_0x175249,getIntervals(_0x397f11[_0x8b63('0x22')],_0x537dee),_0x397f11),'consequence':require('./applications/'+_0x537dee['app'])[_0x8b63('0x23')](_0x175249,_0x2c55e7,_0x397f11,_0x1be20a),'p':_0x537dee[_0x8b63('0x24')]||0x0};logger[_0x8b63('0x25')]('Push\x20new\x20rule',_0x149d68['id'],_0x8b63('0x26'),getIntervals(_0x397f11['intervals'],_0x537dee)[_0x8b63('0x16')](_0x8b63('0x27')));_0x339195[_0x8b63('0x1d')](_0x149d68);}else{logger[_0x8b63('0x28')](_0x8b63('0x29'),path['join'](__dirname,'applications',_0x537dee[_0x8b63('0x17')]+'.js'));}}_0x397f11[_0x8b63('0x10')][_0x175249]=new RuleEngine(_0x339195);_0x397f11[_0x8b63('0x10')][_0x175249][_0x8b63('0x2a')](_0x1be20a,function(_0x5a348d){logger[_0x8b63('0x25')](_0x8b63('0x2b'),JSON[_0x8b63('0x2c')](_0x5a348d[_0x8b63('0x2d')]));if(_0x397f11['rules'][_0x175249]){_0x397f11['rules'][_0x175249][_0x8b63('0x2e')](_0x8b63('0x2f'));}});return _0x2b050d({'code':0xc8,'message':_0x1be20a});}else{logger[_0x8b63('0x25')](_0x8b63('0x30'));return _0x2b050d({'code':0xc8,'message':_0x1be20a});}}catch(_0xccb1d3){logger[_0x8b63('0x28')](_0xccb1d3['stack']);return _0x5ca5a8(_0x195b70[_0x8b63('0x28')](0x1f4,_0xccb1d3));}}return _0x5ca5a8(_0x8b63('0x31'));});},'AcceptMessage':function(_0x203589){var _0x3d2fe5=this;return new Promise(function(_0x2a3684,_0x18fe0b){if(_0x203589[_0x8b63('0x11')]&&_0x203589[_0x8b63('0x11')]['id']){try{var _0x2730ef=getId(_0x203589['channel'],_0x203589[_0x8b63('0x11')]?_0x203589[_0x8b63('0x11')]['id']:0x0,_0x203589[_0x8b63('0x32')]?_0x203589['interaction']['id']:0x0);if(_0x397f11[_0x8b63('0x10')][_0x2730ef]){_0x397f11[_0x8b63('0x10')][_0x2730ef][_0x8b63('0x2e')](_0x8b63('0x2f'));if(rpc[_0x203589[_0x8b63('0x33')]+_0x8b63('0x34')]){rpc[_0x203589[_0x8b63('0x33')]+'QueueReport'][_0x8b63('0x35')](_0x2730ef,{'UserId':_0x203589['message'][_0x8b63('0x36')]})[_0x8b63('0x37')](function(_0x237910){logger['error'](_0x8b63('0x38'));});}}return _0x2a3684({'code':0xc8,'message':_0x203589});}catch(_0x2e3a98){logger['error'](_0x2e3a98['stack']);return _0x18fe0b(_0x3d2fe5[_0x8b63('0x28')](0x1f4,_0x2e3a98));}}logger[_0x8b63('0x28')](_0x8b63('0x39'));return _0x18fe0b(_0x3d2fe5['error'](0x1f4,_0x8b63('0x39')));});},'RejectMessage':function(_0x42574a){var _0xd37b7f=this;return new Promise(function(_0x2c3d09,_0x3556a8){if(_0x42574a[_0x8b63('0x3a')]&&_0x42574a[_0x8b63('0x3a')]['id']){try{if(_0x397f11[_0x8b63('0x3b')][_0x42574a[_0x8b63('0x3a')]['id']]){_0x397f11[_0x8b63('0x3b')][_0x42574a[_0x8b63('0x3a')]['id']][_0x8b63('0x3c')]=![];_0x397f11['agents'][_0x42574a[_0x8b63('0x3a')]['id']]['busyQueue']=undefined;}return _0x2c3d09({'code':0xc8,'message':_0x42574a});}catch(_0x322a67){logger[_0x8b63('0x28')](_0x322a67[_0x8b63('0x3d')]);return _0x3556a8(_0xd37b7f[_0x8b63('0x28')](0x1f4,_0x322a67));}}logger[_0x8b63('0x28')](_0x8b63('0x39'));return _0x3556a8(_0xd37b7f['error'](0x1f4,_0x8b63('0x39')));});},'AbandonInteraction':function(_0x1aca3e){var _0x4a150b=this;return new Promise(function(_0x138fab,_0x2eabd6){if(_0x1aca3e[_0x8b63('0x33')]&&_0x1aca3e[_0x8b63('0x32')]&&_0x1aca3e[_0x8b63('0x32')]['id']){try{var _0x5842b5=getId(_0x1aca3e['channel'],_0x1aca3e[_0x8b63('0x11')]?_0x1aca3e[_0x8b63('0x11')]['id']:0x0,_0x1aca3e['interaction']?_0x1aca3e[_0x8b63('0x32')]['id']:0x0);if(_0x397f11[_0x8b63('0x10')][_0x5842b5]){_0x397f11[_0x8b63('0x10')][_0x5842b5][_0x8b63('0x2e')](_0x8b63('0x2f'));}return _0x138fab({'code':0xc8,'message':_0x1aca3e});}catch(_0x3e76a4){logger[_0x8b63('0x28')](_0x3e76a4['stack']);return _0x2eabd6(_0x4a150b['error'](0x1f4,_0x3e76a4));}}logger[_0x8b63('0x28')]('message\x20is\x20empty');return _0x2eabd6(_0x4a150b['error'](0x1f4,_0x8b63('0x39')));});},'AgentCapacity':function(_0xe86822){var _0x5ef3a7=this;return new Promise(function(_0x52ff7c,_0x1f4355){if(_0x397f11[_0x8b63('0x3b')]['hasOwnProperty'](_0xe86822['id'])){for(var _0xe32f5a in _0xe86822['capacity']){if(_0xe86822[_0x8b63('0x3e')]['hasOwnProperty'](_0xe32f5a)){if(_0x397f11[_0x8b63('0x3b')][_0xe86822['id']][_0x8b63('0x3f')](_0xe32f5a+_0x8b63('0x40'))){_0x397f11[_0x8b63('0x3b')][_0xe86822['id']][_0xe32f5a+_0x8b63('0x40')]=parseInt(_0xe86822[_0x8b63('0x3e')][_0xe32f5a],0xa);}}}_0x397f11[_0x8b63('0x3b')][_0xe86822['id']]['updateRealtime']();return _0x52ff7c({'code':0xc8,'message':_0x397f11[_0x8b63('0x3b')][_0xe86822['id']]});}else{return _0x1f4355(_0x5ef3a7[_0x8b63('0x28')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4cedd6){return new Promise(function(_0x387ee3,_0x4cfc07){var _0x4286d8=_['values'](_0x397f11[_0x8b63('0x3b')]);_0x387ee3({'count':_0x4286d8[_0x8b63('0x14')],'rows':_0x4286d8});});},'ChatQueues':function(_0x3a95e4){return new Promise(function(_0x45f2a4,_0x5de661){var _0x8be67c=[];for(var _0x124456 in _0x397f11[_0x8b63('0x41')]){if(_0x397f11[_0x8b63('0x41')][_0x8b63('0x3f')](_0x124456)){var _0x2578a9=_0x397f11[_0x8b63('0x41')][_0x124456];var _0x1f694b={'id':_0x2578a9['id'],'available':_0x2578a9[_0x8b63('0x42')],'loggedIn':_0x2578a9[_0x8b63('0x43')],'name':_0x2578a9[_0x8b63('0x44')],'paused':_0x2578a9[_0x8b63('0x45')],'waiting':_0x2578a9[_0x8b63('0x46')]};_0x8be67c[_0x8b63('0x1d')](_0x1f694b);}}_0x45f2a4({'count':_0x8be67c[_0x8b63('0x14')],'rows':_0x8be67c});});},'MailQueues':function(_0x37f1a7){return new Promise(function(_0x3d11e5,_0x190674){var _0x11da79=[];for(var _0x1a487f in _0x397f11['mailQueues']){if(_0x397f11[_0x8b63('0x47')][_0x8b63('0x3f')](_0x1a487f)){var _0x1ce0a3=_0x397f11['mailQueues'][_0x1a487f];var _0x8c8aa={'id':_0x1ce0a3['id'],'available':_0x1ce0a3[_0x8b63('0x42')],'loggedIn':_0x1ce0a3[_0x8b63('0x43')],'name':_0x1ce0a3[_0x8b63('0x44')],'paused':_0x1ce0a3[_0x8b63('0x45')],'waiting':_0x1ce0a3[_0x8b63('0x46')]};_0x11da79['push'](_0x8c8aa);}}_0x3d11e5({'count':_0x11da79['length'],'rows':_0x11da79});});},'OpenchannelQueues':function(_0x3b4a18){return new Promise(function(_0x468161,_0x5999fe){var _0x5b3b26=[];for(var _0x4f5d08 in _0x397f11[_0x8b63('0x48')]){if(_0x397f11['openchannelQueues']['hasOwnProperty'](_0x4f5d08)){var _0x46498d=_0x397f11['openchannelQueues'][_0x4f5d08];var _0x4cb0df={'id':_0x46498d['id'],'available':_0x46498d[_0x8b63('0x42')],'loggedIn':_0x46498d[_0x8b63('0x43')],'name':_0x46498d[_0x8b63('0x44')],'paused':_0x46498d[_0x8b63('0x45')],'waiting':_0x46498d[_0x8b63('0x46')]};_0x5b3b26[_0x8b63('0x1d')](_0x4cb0df);}}_0x468161({'count':_0x5b3b26[_0x8b63('0x14')],'rows':_0x5b3b26});});},'SmsQueues':function(_0x52b0f4){return new Promise(function(_0x57ad24,_0x3b85c6){var _0x2cbeee=[];for(var _0x1d443c in _0x397f11['smsQueues']){if(_0x397f11[_0x8b63('0x49')][_0x8b63('0x3f')](_0x1d443c)){var _0x18f2a3=_0x397f11[_0x8b63('0x49')][_0x1d443c];var _0x133a28={'id':_0x18f2a3['id'],'available':_0x18f2a3[_0x8b63('0x42')],'loggedIn':_0x18f2a3[_0x8b63('0x43')],'name':_0x18f2a3[_0x8b63('0x44')],'paused':_0x18f2a3[_0x8b63('0x45')],'waiting':_0x18f2a3[_0x8b63('0x46')]};_0x2cbeee[_0x8b63('0x1d')](_0x133a28);}}_0x57ad24({'count':_0x2cbeee[_0x8b63('0x14')],'rows':_0x2cbeee});});},'FaxQueues':function(_0x15e5aa){return new Promise(function(_0x86af4,_0x4d7b7d){var _0x24a263=[];for(var _0x8252af in _0x397f11[_0x8b63('0x4a')]){if(_0x397f11['faxQueues']['hasOwnProperty'](_0x8252af)){var _0x1d4316=_0x397f11[_0x8b63('0x4a')][_0x8252af];var _0x3c7e57={'id':_0x1d4316['id'],'available':_0x1d4316['available'],'loggedIn':_0x1d4316['loggedIn'],'name':_0x1d4316[_0x8b63('0x44')],'paused':_0x1d4316['paused'],'waiting':_0x1d4316[_0x8b63('0x46')]};_0x24a263['push'](_0x3c7e57);}}_0x86af4({'count':_0x24a263[_0x8b63('0x14')],'rows':_0x24a263});});},'ChatQueuesWaitingInteractions':function(_0x1f430d){return new Promise(function(_0xd9d4a9,_0x3f616f){var _0x5c6eb7=_['values'](_0x397f11[_0x8b63('0x4b')]);_0xd9d4a9({'count':_0x5c6eb7[_0x8b63('0x14')],'rows':_0x5c6eb7});});},'MailQueuesWaitingInteractions':function(_0xa8d38e){return new Promise(function(_0xd8c202,_0x59daca){var _0x2412bc=_[_0x8b63('0x4c')](_0x397f11[_0x8b63('0x4d')]);_0xd8c202({'count':_0x2412bc['length'],'rows':_0x2412bc});});},'OpenchannelQueuesWaitingInteractions':function(_0x38775f){return new Promise(function(_0x1b3f16,_0x4c5c00){var _0x58b870=_[_0x8b63('0x4c')](_0x397f11['openchannelQueuesWaitingInteractions']);_0x1b3f16({'count':_0x58b870['length'],'rows':_0x58b870});});},'SmsQueuesWaitingInteractions':function(_0x3c068c){return new Promise(function(_0x51837f,_0xe4277b){var _0x293260=_[_0x8b63('0x4c')](_0x397f11[_0x8b63('0x4e')]);_0x51837f({'count':_0x293260['length'],'rows':_0x293260});});},'FaxQueuesWaitingInteractions':function(_0x2ab1eb){return new Promise(function(_0x217233,_0x11f8ec){var _0x107da5=_['values'](_0x397f11[_0x8b63('0x4f')]);_0x217233({'count':_0x107da5[_0x8b63('0x14')],'rows':_0x107da5});});}};var _0x3463ec=jayson[_0x8b63('0x50')](_0x373a9d)['http']();_0x3463ec['on'](_0x8b63('0x28'),function(_0x4e25f0){logger[_0x8b63('0x28')](JSON[_0x8b63('0x2c')](_0x4e25f0));return _0x401e2e(_0x4e25f0);});_0x3463ec['listen'](0x232c,_0x8b63('0x51'),function(){console[_0x8b63('0x52')](_0x8b63('0x53'),0x232c);return _0x23491d(_0x8b63('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 ad8f4c8..e2016e5 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 _0x8fc8=['iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','routing','client','http','request','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command'];(function(_0x271e26,_0xeaa798){var _0x4c3771=function(_0x594c71){while(--_0x594c71){_0x271e26['push'](_0x271e26['shift']());}};_0x4c3771(++_0xeaa798);}(_0x8fc8,0x12d));var _0x88fc=function(_0x3ea9bf,_0x42909d){_0x3ea9bf=_0x3ea9bf-0x0;var _0x976b8c=_0x8fc8[_0x3ea9bf];return _0x976b8c;};'use strict';var util=require(_0x88fc('0x0'));var BPromise=require(_0x88fc('0x1'));var jayson=require(_0x88fc('0x2'));var _=require(_0x88fc('0x3'));var logger=require('../../../config/logger')(_0x88fc('0x4'));var client=jayson[_0x88fc('0x5')][_0x88fc('0x6')]({'port':0x232a});function request(_0x2dccff,_0x27376c){return new BPromise(function(_0x251a45,_0x48e798){return client[_0x88fc('0x7')](_0x2dccff,_0x27376c)['then'](function(_0x326f92){if(_0x326f92[_0x88fc('0x8')]){return _0x48e798(_0x326f92[_0x88fc('0x8')][_0x88fc('0x9')]);}else{return _0x251a45(_0x326f92[_0x88fc('0xa')]);}})[_0x88fc('0xb')](function(_0x3ec0ff){return _0x48e798(_0x3ec0ff);});});}exports[_0x88fc('0xc')]=function(_0x31a852,_0x168bf3,_0x54f7b3){return function(_0x41fef7){if(_0x54f7b3[_0x88fc('0xd')]&&!_0x54f7b3[_0x88fc('0xd')][_0x31a852]){logger['info'](_0x88fc('0xe'),_0x31a852);return _0x41fef7[_0x88fc('0xf')]();}var _0x497810=[];for(var _0xf87271=0x0;_0xf87271<_0x168bf3[_0x88fc('0x10')];_0xf87271+=0x1){_0x497810[_0x88fc('0x11')](request(_0x88fc('0x12'),{'command':util['format'](_0x88fc('0x13'),_0x168bf3[_0xf87271])})[_0x88fc('0x14')](function(_0x1c1d69){return _0x1c1d69&&_0x1c1d69[_0x88fc('0x9')]&&_0x1c1d69['message'][_0x88fc('0x15')](_0x88fc('0x16'))>=0x0?!![]:![];})['catch'](function(_0x550342){logger[_0x88fc('0x8')](_0x88fc('0x17'),_0x31a852,_0x168bf3[_0xf87271]);}));}BPromise[_0x88fc('0x18')](_0x497810)[_0x88fc('0x14')](function(_0x5ebd85){var _0x3d7ab4=_[_0x88fc('0x19')](_0x5ebd85);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x31a852,_0x168bf3[_0x88fc('0x1a')](_0x88fc('0x1b')),_0x3d7ab4);_0x41fef7[_0x88fc('0x1c')](_0x3d7ab4);})['catch'](function(_0x5bc78f){console[_0x88fc('0x1d')](_0x5bc78f);logger[_0x88fc('0x8')](_0x88fc('0x1e'),_0x31a852,_0x168bf3[_0x88fc('0x1a')](_0x88fc('0x1b')),_0x5bc78f[_0x88fc('0x1f')]);_0x41fef7['stop']();});};}; \ No newline at end of file +var _0x511e=['Command','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','then','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push'];(function(_0x159bae,_0x483baf){var _0x23214d=function(_0x4d1c8a){while(--_0x4d1c8a){_0x159bae['push'](_0x159bae['shift']());}};_0x23214d(++_0x483baf);}(_0x511e,0x1cf));var _0xe511=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x511e[_0x4e7c1c];return _0x47adb2;};'use strict';var util=require(_0xe511('0x0'));var BPromise=require(_0xe511('0x1'));var jayson=require(_0xe511('0x2'));var _=require(_0xe511('0x3'));var logger=require(_0xe511('0x4'))(_0xe511('0x5'));var client=jayson['client'][_0xe511('0x6')]({'port':0x232a});function request(_0x2ed8d3,_0x330f68){return new BPromise(function(_0x26dde9,_0x4a2380){return client[_0xe511('0x7')](_0x2ed8d3,_0x330f68)['then'](function(_0x3bf202){if(_0x3bf202[_0xe511('0x8')]){return _0x4a2380(_0x3bf202[_0xe511('0x8')]['message']);}else{return _0x26dde9(_0x3bf202[_0xe511('0x9')]);}})[_0xe511('0xa')](function(_0x3d4703){return _0x4a2380(_0x3d4703);});});}exports[_0xe511('0xb')]=function(_0x1215ac,_0x684b3f,_0x33bd1e){return function(_0x3230f8){if(_0x33bd1e[_0xe511('0xc')]&&!_0x33bd1e[_0xe511('0xc')][_0x1215ac]){logger[_0xe511('0xd')](_0xe511('0xe'),_0x1215ac);return _0x3230f8[_0xe511('0xf')]();}var _0x35b551=[];for(var _0x92ba43=0x0;_0x92ba43<_0x684b3f['length'];_0x92ba43+=0x1){_0x35b551[_0xe511('0x10')](request(_0xe511('0x11'),{'command':util['format'](_0xe511('0x12'),_0x684b3f[_0x92ba43])})['then'](function(_0x1a0045){return _0x1a0045&&_0x1a0045[_0xe511('0x13')]&&_0x1a0045[_0xe511('0x13')][_0xe511('0x14')](_0xe511('0x15'))>=0x0?!![]:![];})[_0xe511('0xa')](function(_0x50b4c0){logger['error'](_0xe511('0x16'),_0x1215ac,_0x684b3f[_0x92ba43]);}));}BPromise[_0xe511('0x17')](_0x35b551)[_0xe511('0x18')](function(_0x4935d4){var _0x2863c5=_[_0xe511('0x19')](_0x4935d4);logger[_0xe511('0xd')](_0xe511('0x1a'),_0x1215ac,_0x684b3f['join'](_0xe511('0x1b')),_0x2863c5);_0x3230f8[_0xe511('0x1c')](_0x2863c5);})[_0xe511('0xa')](function(_0x4741b9){console['log'](_0x4741b9);logger[_0xe511('0x8')](_0xe511('0x1a'),_0x1215ac,_0x684b3f[_0xe511('0x1d')](_0xe511('0x1b')),_0x4741b9['stack']);_0x3230f8['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ad190af..91e07bd 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 _0x3ba6=['channel','queue','membername','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','reason','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','transfer','complete','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid'];(function(_0x4a509f,_0xe14c8d){var _0x15d990=function(_0x424bd1){while(--_0x424bd1){_0x4a509f['push'](_0x4a509f['shift']());}};_0x15d990(++_0xe14c8d);}(_0x3ba6,0xcf));var _0x63ba=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x3ba6[_0x7b173];return _0x1c598c;};'use strict';var _=require(_0x63ba('0x0'));var util=require(_0x63ba('0x1'));var utils=require(_0x63ba('0x2'));var agents={};var transfers={};function writeDB(_0x559686,_0x32a426){utils[_0x63ba('0x3')](util['format'](_0x63ba('0x4'),_0x559686[_0x63ba('0x5')],_0x559686[_0x63ba('0x6')],_0x559686[_0x63ba('0x7')],_0x559686[_0x63ba('0x8')],_0x559686['interface'],_0x559686[_0x63ba('0x9')],_0x559686['connectedlinenum'],_0x559686[_0x63ba('0xa')]));if(_0x559686[_0x63ba('0x7')]){utils[_0x63ba('0xb')](_0x559686['queue'])[_0x63ba('0xc')](function(_0x4326d6){if(_0x4326d6){_0x559686[_0x63ba('0xd')]=_0x4326d6[_0x63ba('0xd')];_0x559686[_0x63ba('0xe')]=_0x559686['agentcomplete']?_0x4326d6[_0x63ba('0xf')]:![];_0x559686[_0x63ba('0x10')]=_0x559686['agentacw']?_0x4326d6[_0x63ba('0x11')]:0x0;}utils[_0x63ba('0x12')](_0x63ba('0x13'),_0x559686);});}else{utils[_0x63ba('0x12')](_0x63ba('0x13'),_0x559686);}if(_0x32a426){delete transfers[_0x559686[_0x63ba('0x5')]];}else{delete agents[_0x559686[_0x63ba('0x14')]];}}exports[_0x63ba('0x15')]=function(_0x5a447a){try{agents[_0x5a447a[_0x63ba('0x14')]]=_0x5a447a;agents[_0x5a447a[_0x63ba('0x14')]][_0x63ba('0x16')]=utils[_0x63ba('0x17')]();agents[_0x5a447a[_0x63ba('0x14')]][_0x63ba('0xa')]='called';agents[_0x5a447a['destuniqueid']][_0x63ba('0x18')]=null;agents[_0x5a447a[_0x63ba('0x14')]][_0x63ba('0x19')]=null;}catch(_0x40a81b){utils[_0x63ba('0x1a')](_0x40a81b[_0x63ba('0x1b')]);}};exports[_0x63ba('0x1c')]=function(_0x4e42a0){try{if(!_[_0x63ba('0x1d')](agents[_0x4e42a0[_0x63ba('0x14')]])){agents[_0x4e42a0[_0x63ba('0x14')]]['agentringnoanswer']=!![];agents[_0x4e42a0[_0x63ba('0x14')]][_0x63ba('0x1e')]=utils[_0x63ba('0x17')]();agents[_0x4e42a0[_0x63ba('0x14')]][_0x63ba('0xa')]=_0x63ba('0x1f');agents[_0x4e42a0[_0x63ba('0x14')]]['reason']=_0x63ba('0x1f');agents[_0x4e42a0[_0x63ba('0x14')]][_0x63ba('0x20')]=_0x4e42a0[_0x63ba('0x21')]?parseInt(_0x4e42a0['ringtime'])/0x3e8:0x0;agents[_0x4e42a0[_0x63ba('0x14')]][_0x63ba('0x22')]=0x0;writeDB(agents[_0x4e42a0['destuniqueid']]);}}catch(_0x5be400){utils[_0x63ba('0x1a')](_0x5be400['stack']);}};exports[_0x63ba('0x23')]=function(_0x191e23){try{_[_0x63ba('0x24')](agents,function(_0x589bce,_0x5d9be5){if(_0x589bce[_0x63ba('0x5')]==_0x191e23[_0x63ba('0x5')]){_0x589bce[_0x63ba('0x1c')]=!![];_0x589bce[_0x63ba('0x1e')]=utils[_0x63ba('0x17')]();_0x589bce[_0x63ba('0xa')]=_0x63ba('0x25');_0x589bce[_0x63ba('0x26')]=_0x63ba('0x25');_0x589bce[_0x63ba('0x20')]=_0x191e23[_0x63ba('0x20')];_0x589bce['talktime']=0x0;writeDB(_0x589bce);}});}catch(_0x4e5936){utils[_0x63ba('0x1a')](_0x4e5936[_0x63ba('0x1b')]);}};exports[_0x63ba('0x27')]=function(_0x18e613){try{if(agents[_0x18e613[_0x63ba('0x14')]]){agents[_0x18e613[_0x63ba('0x14')]][_0x63ba('0x28')]=utils[_0x63ba('0x17')]();agents[_0x18e613['destuniqueid']][_0x63ba('0x18')]=_0x18e613['connectedlinenum'];agents[_0x18e613[_0x63ba('0x14')]][_0x63ba('0x19')]=_0x18e613[_0x63ba('0x19')];agents[_0x18e613[_0x63ba('0x14')]][_0x63ba('0x20')]=_0x18e613['ringtime'];agents[_0x18e613[_0x63ba('0x14')]][_0x63ba('0xa')]=_0x63ba('0x29');_['forIn'](agents,function(_0x46e1de,_0x513321){if(_0x46e1de['destuniqueid']!=_0x18e613[_0x63ba('0x14')]&&_0x46e1de[_0x63ba('0x5')]==_0x18e613['uniqueid']){_0x46e1de['talktime']=0x0;_0x46e1de['holdtime']=_0x18e613[_0x63ba('0x21')];_0x46e1de[_0x63ba('0x1c')]=!![];_0x46e1de[_0x63ba('0x1e')]=utils[_0x63ba('0x17')]();_0x46e1de[_0x63ba('0xa')]=_0x63ba('0x2a');_0x46e1de[_0x63ba('0x26')]=_0x63ba('0x2a');_0x46e1de[_0x63ba('0x2b')]=_0x18e613[_0x63ba('0x14')];_0x46e1de[_0x63ba('0x2c')]=_0x18e613[_0x63ba('0x8')];writeDB(_0x46e1de);}});}}catch(_0x1e7302){utils[_0x63ba('0x1a')](_0x1e7302['stack']);}};exports[_0x63ba('0x2d')]=function(_0x27e07d){try{if(!_[_0x63ba('0x1d')](agents[_0x27e07d['destuniqueid']])){agents[_0x27e07d['destuniqueid']][_0x63ba('0x2d')]=!![];agents[_0x27e07d[_0x63ba('0x14')]][_0x63ba('0x2e')]=utils[_0x63ba('0x17')]();agents[_0x27e07d[_0x63ba('0x14')]][_0x63ba('0x22')]=utils[_0x63ba('0x2f')](agents[_0x27e07d['destuniqueid']][_0x63ba('0x2e')],agents[_0x27e07d['destuniqueid']][_0x63ba('0x28')]);agents[_0x27e07d[_0x63ba('0x14')]][_0x63ba('0x26')]=_0x27e07d[_0x63ba('0x26')];agents[_0x27e07d[_0x63ba('0x14')]][_0x63ba('0xa')]='complete';writeDB(agents[_0x27e07d['destuniqueid']]);}}catch(_0x35f757){utils[_0x63ba('0x1a')](_0x35f757[_0x63ba('0x1b')]);}};exports[_0x63ba('0x30')]=function(_0x14e5b4){try{if(!_[_0x63ba('0x1d')](agents[_0x14e5b4[_0x63ba('0x31')]])){agents[_0x14e5b4[_0x63ba('0x31')]]['transfer']=!![];agents[_0x14e5b4[_0x63ba('0x31')]][_0x63ba('0x32')]=_0x63ba('0x33');agents[_0x14e5b4[_0x63ba('0x31')]][_0x63ba('0x34')]=_0x14e5b4[_0x63ba('0x35')];agents[_0x14e5b4['transfereruniqueid']][_0x63ba('0x36')]=agents[_0x14e5b4[_0x63ba('0x31')]]['uniqueid'];}}catch(_0x2f98f8){utils[_0x63ba('0x1a')](_0x2f98f8[_0x63ba('0x1b')]);}};exports['attendedtransfer']=function(_0x1de3fe){try{if(_0x1de3fe['origtransfereruniqueid']==_0x1de3fe[_0x63ba('0x37')]){if(!_['isNil'](agents[_0x1de3fe[_0x63ba('0x38')]])){agents[_0x1de3fe[_0x63ba('0x38')]]['transfer']=!![];agents[_0x1de3fe[_0x63ba('0x38')]]['transfertype']=_0x63ba('0x39');agents[_0x1de3fe[_0x63ba('0x38')]][_0x63ba('0x34')]=_0x1de3fe[_0x63ba('0x3a')];agents[_0x1de3fe[_0x63ba('0x38')]]['transferuniqueid']=_0x1de3fe[_0x63ba('0x3b')];}if(_0x1de3fe[_0x63ba('0x3c')]&&agents[_0x1de3fe['transfereeuniqueid']]){agents[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x3d')]=0x1;transfers[_0x1de3fe['transfereeuniqueid']]=_[_0x63ba('0x3e')](agents[_0x1de3fe['transfereeuniqueid']]);transfers[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x9')]=agents[_0x1de3fe['secondtransfereruniqueid']]['calleridnum'];transfers[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x3f')]=agents[_0x1de3fe['secondtransfereruniqueid']][_0x63ba('0x3f')];transfers[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x16')]=utils[_0x63ba('0x17')]();transfers[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x28')]=utils['now']();transfers[_0x1de3fe['transfereeuniqueid']][_0x63ba('0x20')]=0x0;transfers[_0x1de3fe[_0x63ba('0x3c')]][_0x63ba('0x3d')]=0x2;}}else if(_0x1de3fe[_0x63ba('0x38')]==_0x1de3fe[_0x63ba('0x40')]){if(!_[_0x63ba('0x1d')](agents[_0x1de3fe[_0x63ba('0x3b')]])){agents[_0x1de3fe[_0x63ba('0x3b')]]['transfer']=!![];agents[_0x1de3fe[_0x63ba('0x3b')]][_0x63ba('0x32')]=_0x63ba('0x39');agents[_0x1de3fe[_0x63ba('0x3b')]][_0x63ba('0x34')]=_0x1de3fe[_0x63ba('0x41')];agents[_0x1de3fe[_0x63ba('0x3b')]][_0x63ba('0x36')]=_0x1de3fe[_0x63ba('0x38')];}if(_0x1de3fe[_0x63ba('0x42')]&&agents[_0x1de3fe[_0x63ba('0x42')]]){agents[_0x1de3fe[_0x63ba('0x42')]][_0x63ba('0x3d')]=0x1;transfers[_0x1de3fe[_0x63ba('0x42')]]=_[_0x63ba('0x3e')](agents[_0x1de3fe[_0x63ba('0x42')]]);transfers[_0x1de3fe['transfertargetuniqueid']][_0x63ba('0x9')]=agents[_0x1de3fe['origtransfereruniqueid']][_0x63ba('0x9')];transfers[_0x1de3fe['transfertargetuniqueid']][_0x63ba('0x3f')]=agents[_0x1de3fe['origtransfereruniqueid']]['calleridname'];transfers[_0x1de3fe[_0x63ba('0x42')]][_0x63ba('0x16')]=utils[_0x63ba('0x17')]();transfers[_0x1de3fe[_0x63ba('0x42')]][_0x63ba('0x28')]=utils[_0x63ba('0x17')]();transfers[_0x1de3fe[_0x63ba('0x42')]][_0x63ba('0x20')]=0x0;transfers[_0x1de3fe[_0x63ba('0x42')]][_0x63ba('0x3d')]=0x2;}}}catch(_0x284697){utils[_0x63ba('0x1a')](_0x284697[_0x63ba('0x1b')]);}};exports[_0x63ba('0x43')]=function(_0x23e3a2){try{if(transfers[_0x23e3a2[_0x63ba('0x5')]]){transfers[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x2d')]=!![];transfers[_0x23e3a2[_0x63ba('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x23e3a2['uniqueid']]['talktime']=utils[_0x63ba('0x2f')](transfers[_0x23e3a2['uniqueid']][_0x63ba('0x2e')],transfers[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x28')]);transfers[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x26')]=_0x63ba('0x44');transfers[_0x23e3a2[_0x63ba('0x5')]]['lastevent']='complete';writeDB(transfers[_0x23e3a2[_0x63ba('0x5')]],!![]);}if(agents[_0x23e3a2[_0x63ba('0x5')]]&&agents[_0x23e3a2['uniqueid']][_0x63ba('0x28')]){agents[_0x23e3a2['uniqueid']][_0x63ba('0x2d')]=!![];agents[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x2e')]=utils[_0x63ba('0x17')]();agents[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x22')]=utils[_0x63ba('0x2f')](agents[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x2e')],agents[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x28')]);agents[_0x23e3a2[_0x63ba('0x5')]][_0x63ba('0x26')]=agents[_0x23e3a2[_0x63ba('0x5')]]['transfer']?_0x63ba('0x45'):_0x63ba('0x44');agents[_0x23e3a2['uniqueid']]['lastevent']=_0x63ba('0x46');writeDB(agents[_0x23e3a2['uniqueid']]);}}catch(_0xa369b3){utils[_0x63ba('0x1a')](_0xa369b3[_0x63ba('0x1b')]);}}; \ No newline at end of file +var _0xaf7f=['uniqueid','agentcalled','destuniqueid','agentcalledAt','now','called','connectedlinenum','connectedlinename','error','isNil','agentringnoanswer','rejected','holdtime','ringtime','talktime','stack','agentringnoanswerAt','reason','abandoned','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','agent','complete','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentcomplete','agentacw','acwTimeout','request','CreateVoiceAgentReport'];(function(_0x51a02f,_0x245148){var _0x42cb02=function(_0xe9ef5a){while(--_0xe9ef5a){_0x51a02f['push'](_0x51a02f['shift']());}};_0x42cb02(++_0x245148);}(_0xaf7f,0xbe));var _0xfaf7=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xaf7f[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xfaf7('0x0'));var util=require(_0xfaf7('0x1'));var utils=require(_0xfaf7('0x2'));var agents={};var transfers={};function writeDB(_0x1715b7,_0x4cfdea){utils[_0xfaf7('0x3')](util[_0xfaf7('0x4')](_0xfaf7('0x5'),_0x1715b7['uniqueid'],_0x1715b7[_0xfaf7('0x6')],_0x1715b7['queue'],_0x1715b7[_0xfaf7('0x7')],_0x1715b7[_0xfaf7('0x8')],_0x1715b7[_0xfaf7('0x9')],_0x1715b7['connectedlinenum'],_0x1715b7[_0xfaf7('0xa')]));if(_0x1715b7[_0xfaf7('0xb')]){utils[_0xfaf7('0xc')](_0x1715b7[_0xfaf7('0xb')])[_0xfaf7('0xd')](function(_0x47db3b){if(_0x47db3b){_0x1715b7[_0xfaf7('0xe')]=_0x47db3b[_0xfaf7('0xe')];_0x1715b7['agentacw']=_0x1715b7[_0xfaf7('0xf')]?_0x47db3b['acw']:![];_0x1715b7['acwtime']=_0x1715b7[_0xfaf7('0x10')]?_0x47db3b[_0xfaf7('0x11')]:0x0;}utils[_0xfaf7('0x12')](_0xfaf7('0x13'),_0x1715b7);});}else{utils[_0xfaf7('0x12')](_0xfaf7('0x13'),_0x1715b7);}if(_0x4cfdea){delete transfers[_0x1715b7[_0xfaf7('0x14')]];}else{delete agents[_0x1715b7['destuniqueid']];}}exports[_0xfaf7('0x15')]=function(_0x3b4ff3){try{agents[_0x3b4ff3[_0xfaf7('0x16')]]=_0x3b4ff3;agents[_0x3b4ff3[_0xfaf7('0x16')]][_0xfaf7('0x17')]=utils[_0xfaf7('0x18')]();agents[_0x3b4ff3[_0xfaf7('0x16')]][_0xfaf7('0xa')]=_0xfaf7('0x19');agents[_0x3b4ff3['destuniqueid']][_0xfaf7('0x1a')]=null;agents[_0x3b4ff3['destuniqueid']][_0xfaf7('0x1b')]=null;}catch(_0x54e8f5){utils[_0xfaf7('0x1c')](_0x54e8f5['stack']);}};exports['agentringnoanswer']=function(_0x584fde){try{if(!_[_0xfaf7('0x1d')](agents[_0x584fde[_0xfaf7('0x16')]])){agents[_0x584fde[_0xfaf7('0x16')]][_0xfaf7('0x1e')]=!![];agents[_0x584fde[_0xfaf7('0x16')]]['agentringnoanswerAt']=utils[_0xfaf7('0x18')]();agents[_0x584fde['destuniqueid']]['lastevent']=_0xfaf7('0x1f');agents[_0x584fde[_0xfaf7('0x16')]]['reason']=_0xfaf7('0x1f');agents[_0x584fde['destuniqueid']][_0xfaf7('0x20')]=_0x584fde['ringtime']?parseInt(_0x584fde[_0xfaf7('0x21')])/0x3e8:0x0;agents[_0x584fde[_0xfaf7('0x16')]][_0xfaf7('0x22')]=0x0;writeDB(agents[_0x584fde[_0xfaf7('0x16')]]);}}catch(_0xa8f058){utils['error'](_0xa8f058[_0xfaf7('0x23')]);}};exports['queuecallerabandon']=function(_0x5129be){try{_['forIn'](agents,function(_0x503c4c,_0x6076b){if(_0x503c4c[_0xfaf7('0x14')]==_0x5129be['uniqueid']){_0x503c4c['agentringnoanswer']=!![];_0x503c4c[_0xfaf7('0x24')]=utils[_0xfaf7('0x18')]();_0x503c4c['lastevent']='abandoned';_0x503c4c[_0xfaf7('0x25')]=_0xfaf7('0x26');_0x503c4c[_0xfaf7('0x20')]=_0x5129be[_0xfaf7('0x20')];_0x503c4c['talktime']=0x0;writeDB(_0x503c4c);}});}catch(_0x176a43){utils[_0xfaf7('0x1c')](_0x176a43['stack']);}};exports[_0xfaf7('0x27')]=function(_0xb5733c){try{if(agents[_0xb5733c[_0xfaf7('0x16')]]){agents[_0xb5733c['destuniqueid']][_0xfaf7('0x28')]=utils['now']();agents[_0xb5733c[_0xfaf7('0x16')]][_0xfaf7('0x1a')]=_0xb5733c[_0xfaf7('0x1a')];agents[_0xb5733c['destuniqueid']][_0xfaf7('0x1b')]=_0xb5733c[_0xfaf7('0x1b')];agents[_0xb5733c[_0xfaf7('0x16')]]['holdtime']=_0xb5733c[_0xfaf7('0x21')];agents[_0xb5733c[_0xfaf7('0x16')]][_0xfaf7('0xa')]=_0xfaf7('0x29');_[_0xfaf7('0x2a')](agents,function(_0x2f3a2b,_0x2bf2d7){if(_0x2f3a2b[_0xfaf7('0x16')]!=_0xb5733c['destuniqueid']&&_0x2f3a2b[_0xfaf7('0x14')]==_0xb5733c[_0xfaf7('0x14')]){_0x2f3a2b[_0xfaf7('0x22')]=0x0;_0x2f3a2b['holdtime']=_0xb5733c[_0xfaf7('0x21')];_0x2f3a2b[_0xfaf7('0x1e')]=!![];_0x2f3a2b['agentringnoanswerAt']=utils[_0xfaf7('0x18')]();_0x2f3a2b[_0xfaf7('0xa')]=_0xfaf7('0x2b');_0x2f3a2b[_0xfaf7('0x25')]=_0xfaf7('0x2b');_0x2f3a2b[_0xfaf7('0x2c')]=_0xb5733c[_0xfaf7('0x16')];_0x2f3a2b['answeredelsewheremembername']=_0xb5733c[_0xfaf7('0x7')];writeDB(_0x2f3a2b);}});}}catch(_0x50a550){utils[_0xfaf7('0x1c')](_0x50a550[_0xfaf7('0x23')]);}};exports[_0xfaf7('0xf')]=function(_0x2d8d79){try{if(!_['isNil'](agents[_0x2d8d79['destuniqueid']])){agents[_0x2d8d79[_0xfaf7('0x16')]][_0xfaf7('0xf')]=!![];agents[_0x2d8d79[_0xfaf7('0x16')]][_0xfaf7('0x2d')]=utils[_0xfaf7('0x18')]();agents[_0x2d8d79[_0xfaf7('0x16')]][_0xfaf7('0x22')]=utils[_0xfaf7('0x2e')](agents[_0x2d8d79[_0xfaf7('0x16')]][_0xfaf7('0x2d')],agents[_0x2d8d79[_0xfaf7('0x16')]][_0xfaf7('0x28')]);agents[_0x2d8d79['destuniqueid']]['reason']=_0x2d8d79[_0xfaf7('0x25')];agents[_0x2d8d79[_0xfaf7('0x16')]]['lastevent']='complete';writeDB(agents[_0x2d8d79[_0xfaf7('0x16')]]);}}catch(_0x1dbfab){utils[_0xfaf7('0x1c')](_0x1dbfab[_0xfaf7('0x23')]);}};exports[_0xfaf7('0x2f')]=function(_0x156274){try{if(!_[_0xfaf7('0x1d')](agents[_0x156274['transfereruniqueid']])){agents[_0x156274[_0xfaf7('0x30')]][_0xfaf7('0x31')]=!![];agents[_0x156274['transfereruniqueid']][_0xfaf7('0x32')]='blind';agents[_0x156274[_0xfaf7('0x30')]][_0xfaf7('0x33')]=_0x156274[_0xfaf7('0x34')];agents[_0x156274['transfereruniqueid']][_0xfaf7('0x35')]=agents[_0x156274[_0xfaf7('0x30')]][_0xfaf7('0x14')];}}catch(_0x228a30){utils[_0xfaf7('0x1c')](_0x228a30[_0xfaf7('0x23')]);}};exports[_0xfaf7('0x36')]=function(_0x2652c2){try{if(_0x2652c2['origtransfereruniqueid']==_0x2652c2[_0xfaf7('0x37')]){if(!_[_0xfaf7('0x1d')](agents[_0x2652c2[_0xfaf7('0x38')]])){agents[_0x2652c2['secondtransfereruniqueid']][_0xfaf7('0x31')]=!![];agents[_0x2652c2[_0xfaf7('0x38')]][_0xfaf7('0x32')]='ATTENDED';agents[_0x2652c2[_0xfaf7('0x38')]][_0xfaf7('0x33')]=_0x2652c2[_0xfaf7('0x39')];agents[_0x2652c2['secondtransfereruniqueid']][_0xfaf7('0x35')]=_0x2652c2[_0xfaf7('0x3a')];}if(_0x2652c2['transfereeuniqueid']&&agents[_0x2652c2[_0xfaf7('0x3b')]]){agents[_0x2652c2['transfereeuniqueid']][_0xfaf7('0x3c')]=0x1;transfers[_0x2652c2[_0xfaf7('0x3b')]]=_[_0xfaf7('0x3d')](agents[_0x2652c2[_0xfaf7('0x3b')]]);transfers[_0x2652c2[_0xfaf7('0x3b')]]['calleridnum']=agents[_0x2652c2['secondtransfereruniqueid']][_0xfaf7('0x9')];transfers[_0x2652c2['transfereeuniqueid']][_0xfaf7('0x3e')]=agents[_0x2652c2['secondtransfereruniqueid']]['calleridname'];transfers[_0x2652c2[_0xfaf7('0x3b')]]['agentcalledAt']=utils[_0xfaf7('0x18')]();transfers[_0x2652c2['transfereeuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x2652c2[_0xfaf7('0x3b')]]['holdtime']=0x0;transfers[_0x2652c2[_0xfaf7('0x3b')]][_0xfaf7('0x3c')]=0x2;}}else if(_0x2652c2[_0xfaf7('0x38')]==_0x2652c2[_0xfaf7('0x3f')]){if(!_[_0xfaf7('0x1d')](agents[_0x2652c2[_0xfaf7('0x3a')]])){agents[_0x2652c2['origtransfereruniqueid']][_0xfaf7('0x31')]=!![];agents[_0x2652c2[_0xfaf7('0x3a')]]['transfertype']=_0xfaf7('0x40');agents[_0x2652c2['origtransfereruniqueid']][_0xfaf7('0x33')]=_0x2652c2[_0xfaf7('0x41')];agents[_0x2652c2['origtransfereruniqueid']]['transferuniqueid']=_0x2652c2[_0xfaf7('0x38')];}if(_0x2652c2['transfertargetuniqueid']&&agents[_0x2652c2[_0xfaf7('0x42')]]){agents[_0x2652c2[_0xfaf7('0x42')]]['agententerreason']=0x1;transfers[_0x2652c2['transfertargetuniqueid']]=_['clone'](agents[_0x2652c2[_0xfaf7('0x42')]]);transfers[_0x2652c2[_0xfaf7('0x42')]]['calleridnum']=agents[_0x2652c2[_0xfaf7('0x3a')]]['calleridnum'];transfers[_0x2652c2[_0xfaf7('0x42')]][_0xfaf7('0x3e')]=agents[_0x2652c2[_0xfaf7('0x3a')]][_0xfaf7('0x3e')];transfers[_0x2652c2[_0xfaf7('0x42')]][_0xfaf7('0x17')]=utils['now']();transfers[_0x2652c2[_0xfaf7('0x42')]][_0xfaf7('0x28')]=utils[_0xfaf7('0x18')]();transfers[_0x2652c2['transfertargetuniqueid']][_0xfaf7('0x20')]=0x0;transfers[_0x2652c2[_0xfaf7('0x42')]]['agententerreason']=0x2;}}}catch(_0x34ff8f){utils[_0xfaf7('0x1c')](_0x34ff8f['stack']);}};exports[_0xfaf7('0x43')]=function(_0x2e761e){try{if(transfers[_0x2e761e[_0xfaf7('0x14')]]){transfers[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0xf')]=!![];transfers[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x2d')]=utils[_0xfaf7('0x18')]();transfers[_0x2e761e[_0xfaf7('0x14')]]['talktime']=utils[_0xfaf7('0x2e')](transfers[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x2d')],transfers[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x28')]);transfers[_0x2e761e['uniqueid']][_0xfaf7('0x25')]=_0xfaf7('0x44');transfers[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0xa')]='complete';writeDB(transfers[_0x2e761e[_0xfaf7('0x14')]],!![]);}if(agents[_0x2e761e['uniqueid']]&&agents[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x28')]){agents[_0x2e761e['uniqueid']]['agentcomplete']=!![];agents[_0x2e761e[_0xfaf7('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x2e761e['uniqueid']][_0xfaf7('0x22')]=utils[_0xfaf7('0x2e')](agents[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x2d')],agents[_0x2e761e['uniqueid']][_0xfaf7('0x28')]);agents[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x25')]=agents[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0x31')]?_0xfaf7('0x31'):_0xfaf7('0x44');agents[_0x2e761e[_0xfaf7('0x14')]][_0xfaf7('0xa')]=_0xfaf7('0x45');writeDB(agents[_0x2e761e[_0xfaf7('0x14')]]);}}catch(_0x57534f){utils['error'](_0x57534f['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0e6b3c5..83084bd 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 _0x834b=['xmd-callerid','xmd-queue','lastapplication','Queue','queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','lastdata','lodash','util','./utils','FAILED','NO\x20ANSWER','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','source','destination','callerid','disposition','accountcode','then','request','CreateVoiceCallReport','OutgoingSpoolFailed','calleridnum','context','error','stack','isNil','systemanswertime','now','linkedid','transfer','destinationchannel','answertime','toNumber','hangup','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstart','musiconholdstartAt','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview'];(function(_0x482490,_0x1783f1){var _0xe33c42=function(_0x48a83a){while(--_0x48a83a){_0x482490['push'](_0x482490['shift']());}};_0xe33c42(++_0x1783f1);}(_0x834b,0x1d3));var _0xb834=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x834b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xb834('0x0'));var util=require(_0xb834('0x1'));var utils=require(_0xb834('0x2'));var dispositions=['NO\x20ANSWER',_0xb834('0x3'),'FAILED','NO\x20ANSWER',_0xb834('0x4'),_0xb834('0x4'),'ANSWERED',_0xb834('0x5'),_0xb834('0x3'),_0xb834('0x3'),_0xb834('0x3')];var channels={};function writeDB(_0xd4a4c9){utils[_0xb834('0x6')](util[_0xb834('0x7')](_0xb834('0x8'),_0xd4a4c9[_0xb834('0x9')],_0xd4a4c9[_0xb834('0xa')],_0xd4a4c9[_0xb834('0xb')],_0xd4a4c9['accountcode'],_0xd4a4c9[_0xb834('0xc')],_0xd4a4c9[_0xb834('0xd')],_0xd4a4c9[_0xb834('0xe')],_0xd4a4c9[_0xb834('0xf')]));if(_0xd4a4c9['accountcode']){utils['getUserByInternal'](_0xd4a4c9[_0xb834('0x10')])[_0xb834('0x11')](function(_0x8f36a0){if(_0x8f36a0){_0xd4a4c9['UserId']=_0x8f36a0['id'];}utils[_0xb834('0x12')](_0xb834('0x13'),_0xd4a4c9);});}else{utils[_0xb834('0x12')](_0xb834('0x13'),_0xd4a4c9);}if(channels[_0xd4a4c9['uniqueid']]){delete channels[_0xd4a4c9[_0xb834('0x9')]];}}exports['newchannel']=function(_0x4be620){try{if(_0x4be620[_0xb834('0x9')]==_0x4be620['linkedid']&&_0x4be620[_0xb834('0xa')]!=_0xb834('0x14')){channels[_0x4be620[_0xb834('0x9')]]={'uniqueid':_0x4be620[_0xb834('0x9')],'accountcode':_0x4be620[_0xb834('0x10')],'source':_0x4be620[_0xb834('0x15')],'destination':_0x4be620['exten'],'destinationcontext':_0x4be620[_0xb834('0x16')],'channel':_0x4be620[_0xb834('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x448ae5){utils[_0xb834('0x17')](_0x448ae5[_0xb834('0x18')]);}};exports['newstate']=function(_0x267635){try{if(!_[_0xb834('0x19')](channels[_0x267635[_0xb834('0x9')]])&&_0x267635['channelstate']==0x6){if(_[_0xb834('0x19')](channels[_0x267635[_0xb834('0x9')]]['systemanswertime'])){channels[_0x267635[_0xb834('0x9')]][_0xb834('0x1a')]=utils[_0xb834('0x1b')]();}}else if(!_['isNil'](channels[_0x267635[_0xb834('0x1c')]])&&_0x267635['channelstate']==0x6&&_0x267635[_0xb834('0x16')]!=_0xb834('0x1d')){channels[_0x267635[_0xb834('0x1c')]][_0xb834('0x10')]=_0x267635[_0xb834('0x10')];channels[_0x267635[_0xb834('0x1c')]][_0xb834('0x1e')]=_0x267635[_0xb834('0xa')];if(_['isNil'](channels[_0x267635[_0xb834('0x1c')]][_0xb834('0x1f')])){channels[_0x267635[_0xb834('0x1c')]][_0xb834('0x1f')]=utils['now']();}channels[_0x267635[_0xb834('0x1c')]][_0xb834('0xf')]=dispositions[_[_0xb834('0x20')](_0x267635['channelstate'])]||'ANSWERED';}}catch(_0x1c5175){utils[_0xb834('0x17')](_0x1c5175[_0xb834('0x18')]);}};exports[_0xb834('0x21')]=function(_0x3325a3){try{if(!_[_0xb834('0x19')](channels[_0x3325a3[_0xb834('0x9')]])){if(_[_0xb834('0x19')](channels[_0x3325a3[_0xb834('0x9')]][_0xb834('0xe')])){channels[_0x3325a3[_0xb834('0x9')]][_0xb834('0xe')]=_0x3325a3['calleridname']+'\x20<'+_0x3325a3[_0xb834('0x15')]+'>';}channels[_0x3325a3[_0xb834('0x9')]]['endtime']=utils[_0xb834('0x1b')]();channels[_0x3325a3['uniqueid']]['duration']=utils['diffTime'](channels[_0x3325a3['uniqueid']]['endtime'],channels[_0x3325a3[_0xb834('0x9')]]['starttime']);channels[_0x3325a3['uniqueid']][_0xb834('0x22')]=channels[_0x3325a3[_0xb834('0x9')]][_0xb834('0x1f')]?utils[_0xb834('0x23')](channels[_0x3325a3[_0xb834('0x9')]]['endtime'],channels[_0x3325a3[_0xb834('0x9')]][_0xb834('0x1f')]):0x0;writeDB(channels[_0x3325a3['uniqueid']]);}}catch(_0x532921){utils[_0xb834('0x17')](_0x532921[_0xb834('0x18')]);}};exports[_0xb834('0x24')]=function(_0x1451e3){try{if(!_[_0xb834('0x19')](channels[_0x1451e3[_0xb834('0x25')]])){if(channels[_0x1451e3[_0xb834('0x25')]][_0xb834('0xa')]==_0x1451e3[_0xb834('0x26')]){channels[_0x1451e3['localtwolinkedid']]['destinationchannel']=_0x1451e3[_0xb834('0x27')];channels[_0x1451e3['localtwolinkedid']][_0xb834('0x28')]=_0xb834('0x29');}else if(channels[_0x1451e3[_0xb834('0x25')]][_0xb834('0xa')]=_0x1451e3[_0xb834('0x2a')]){channels[_0x1451e3[_0xb834('0x25')]][_0xb834('0x1e')]=_0x1451e3['origtransfererchannel'];channels[_0x1451e3[_0xb834('0x25')]]['userfield']=_0xb834('0x29');}}}catch(_0x82a734){utils[_0xb834('0x17')](_0x82a734['stack']);}};exports[_0xb834('0x2b')]=function(_0x46c3ca){try{if(!_['isNil'](channels[_0x46c3ca[_0xb834('0x9')]])){channels[_0x46c3ca[_0xb834('0x9')]][_0xb834('0x2c')]=utils[_0xb834('0x1b')]();}}catch(_0x14faa4){utils['error'](_0x14faa4['stack']);}};exports['musiconholdstop']=function(_0xeec435){try{if(!_['isNil'](channels[_0xeec435['uniqueid']])){if(!_[_0xb834('0x19')](channels[_0xeec435[_0xb834('0x9')]]['musiconholdstartAt'])){channels[_0xeec435[_0xb834('0x9')]]['mohtime']+=utils[_0xb834('0x23')](utils[_0xb834('0x1b')](),channels[_0xeec435[_0xb834('0x9')]]['musiconholdstartAt']);delete channels[_0xeec435['uniqueid']][_0xb834('0x2c')];}}}catch(_0x424232){utils[_0xb834('0x17')](_0x424232[_0xb834('0x18')]);}};exports[_0xb834('0x2d')]=function(_0x5a2780){try{if(!_['isNil'](channels[_0x5a2780[_0xb834('0x9')]])){if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')]['xmd-originatecalleridnum'])){channels[_0x5a2780['uniqueid']][_0xb834('0xc')]=_0x5a2780[_0xb834('0x2f')];}if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x30')])){channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0xd')]=_0x5a2780[_0xb834('0x2f')];channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0xe')]='\x22'+_0x5a2780[_0xb834('0x2f')]+_0xb834('0x31')+_0x5a2780[_0xb834('0x2f')]+'>';}if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x32')])||!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x33')])){channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0xe')]=_0x5a2780[_0xb834('0x2f')];}if(!_[_0xb834('0x19')](_0x5a2780['variable'][_0xb834('0x34')])||!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')]['xmcs-queue'])){channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0x35')]=_0xb834('0x36');channels[_0x5a2780[_0xb834('0x9')]]['lastdata']=_0x5a2780[_0xb834('0x2f')];channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0x37')]=!![];}if(!_[_0xb834('0x19')](_0x5a2780['variable']['xmd-contactid'])){channels[_0x5a2780[_0xb834('0x9')]]['ContactId']=_0x5a2780[_0xb834('0x2f')];}if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x38')])){channels[_0x5a2780['uniqueid']][_0xb834('0xb')]=_0x5a2780[_0xb834('0x2f')];}if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x39')])){channels[_0x5a2780[_0xb834('0x9')]][_0xb834('0x3a')]=_0x5a2780[_0xb834('0x2f')];}if(!_[_0xb834('0x19')](_0x5a2780[_0xb834('0x2e')][_0xb834('0x3b')])){channels[_0x5a2780['uniqueid']][_0xb834('0x3b')]=_0x5a2780[_0xb834('0x2f')];}}}catch(_0x36b43e){utils[_0xb834('0x17')](_0x36b43e['stack']);}};exports[_0xb834('0x3c')]=function(_0x5660d3){try{if(!_[_0xb834('0x19')](channels[_0x5660d3[_0xb834('0x9')]])){if(_0x5660d3[_0xb834('0x3d')][_0xb834('0x3e')]()==_0xb834('0x3f')&&_[_0xb834('0x40')](_0x5660d3[_0xb834('0x41')]['toLowerCase'](),_0xb834('0x42'))){var _0x5121ce=_0x5660d3[_0xb834('0x41')][_0xb834('0x43')]('=');var _0x596d14=_0x5121ce[0x0][_0xb834('0x44')](_0x5121ce[0x0][_0xb834('0x45')]('(')+0x1,_0x5121ce[0x0][_0xb834('0x45')](')'));var _0xda71c2=_0x5121ce[0x1];channels[_0x5660d3[_0xb834('0x9')]][_0x596d14]=_0xda71c2;}if(!_['includes'](['hangup',_0xb834('0x46'),_0xb834('0x47'),'set',_0xb834('0x48')],_0x5660d3[_0xb834('0x3d')][_0xb834('0x3e')]())){channels[_0x5660d3[_0xb834('0x9')]][_0xb834('0x35')]=_0x5660d3[_0xb834('0x3d')];channels[_0x5660d3[_0xb834('0x9')]][_0xb834('0x49')]=_0x5660d3[_0xb834('0x41')];}}}catch(_0x3ebfc1){utils[_0xb834('0x17')](_0x3ebfc1[_0xb834('0x18')]);}}; \ No newline at end of file +var _0x1d62=['FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','destination','callerid','then','UserId','request','uniqueid','newchannel','linkedid','channel','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','now','destinationchannel','answertime','toNumber','stack','calleridname','endtime','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','diffTime','variable','xmd-originatecalleridnum','source','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','hangup','noop','gotoif','lodash','util'];(function(_0x4fbfcb,_0x13809f){var _0x498c90=function(_0xc7ed52){while(--_0xc7ed52){_0x4fbfcb['push'](_0x4fbfcb['shift']());}};_0x498c90(++_0x13809f);}(_0x1d62,0x9e));var _0x21d6=function(_0x11ffd9,_0x2c798e){_0x11ffd9=_0x11ffd9-0x0;var _0xe06546=_0x1d62[_0x11ffd9];return _0xe06546;};'use strict';var _=require(_0x21d6('0x0'));var util=require(_0x21d6('0x1'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0x21d6('0x2'),_0x21d6('0x2'),_0x21d6('0x3'),_0x21d6('0x3'),_0x21d6('0x3'),_0x21d6('0x4'),_0x21d6('0x5'),_0x21d6('0x2'),_0x21d6('0x2'),_0x21d6('0x2')];var channels={};function writeDB(_0x29d9cb){utils[_0x21d6('0x6')](util[_0x21d6('0x7')](_0x21d6('0x8'),_0x29d9cb['uniqueid'],_0x29d9cb['channel'],_0x29d9cb[_0x21d6('0x9')],_0x29d9cb[_0x21d6('0xa')],_0x29d9cb['source'],_0x29d9cb[_0x21d6('0xb')],_0x29d9cb[_0x21d6('0xc')],_0x29d9cb['disposition']));if(_0x29d9cb['accountcode']){utils['getUserByInternal'](_0x29d9cb[_0x21d6('0xa')])[_0x21d6('0xd')](function(_0x191f73){if(_0x191f73){_0x29d9cb[_0x21d6('0xe')]=_0x191f73['id'];}utils[_0x21d6('0xf')]('CreateVoiceCallReport',_0x29d9cb);});}else{utils[_0x21d6('0xf')]('CreateVoiceCallReport',_0x29d9cb);}if(channels[_0x29d9cb[_0x21d6('0x10')]]){delete channels[_0x29d9cb[_0x21d6('0x10')]];}}exports[_0x21d6('0x11')]=function(_0x2795c9){try{if(_0x2795c9[_0x21d6('0x10')]==_0x2795c9[_0x21d6('0x12')]&&_0x2795c9[_0x21d6('0x13')]!=_0x21d6('0x14')){channels[_0x2795c9[_0x21d6('0x10')]]={'uniqueid':_0x2795c9['uniqueid'],'accountcode':_0x2795c9['accountcode'],'source':_0x2795c9[_0x21d6('0x15')],'destination':_0x2795c9[_0x21d6('0x16')],'destinationcontext':_0x2795c9[_0x21d6('0x17')],'channel':_0x2795c9[_0x21d6('0x13')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x21d6('0x3'),'amaflags':_0x21d6('0x18')};}}catch(_0x419e7f){utils[_0x21d6('0x19')](_0x419e7f['stack']);}};exports[_0x21d6('0x1a')]=function(_0x2c1bca){try{if(!_[_0x21d6('0x1b')](channels[_0x2c1bca[_0x21d6('0x10')]])&&_0x2c1bca[_0x21d6('0x1c')]==0x6){if(_[_0x21d6('0x1b')](channels[_0x2c1bca['uniqueid']]['systemanswertime'])){channels[_0x2c1bca[_0x21d6('0x10')]][_0x21d6('0x1d')]=utils[_0x21d6('0x1e')]();}}else if(!_['isNil'](channels[_0x2c1bca[_0x21d6('0x12')]])&&_0x2c1bca[_0x21d6('0x1c')]==0x6&&_0x2c1bca[_0x21d6('0x17')]!='transfer'){channels[_0x2c1bca[_0x21d6('0x12')]][_0x21d6('0xa')]=_0x2c1bca[_0x21d6('0xa')];channels[_0x2c1bca[_0x21d6('0x12')]][_0x21d6('0x1f')]=_0x2c1bca['channel'];if(_[_0x21d6('0x1b')](channels[_0x2c1bca[_0x21d6('0x12')]]['answertime'])){channels[_0x2c1bca[_0x21d6('0x12')]][_0x21d6('0x20')]=utils[_0x21d6('0x1e')]();}channels[_0x2c1bca[_0x21d6('0x12')]]['disposition']=dispositions[_[_0x21d6('0x21')](_0x2c1bca[_0x21d6('0x1c')])]||_0x21d6('0x4');}}catch(_0x3ef550){utils['error'](_0x3ef550[_0x21d6('0x22')]);}};exports['hangup']=function(_0x1f6ccf){try{if(!_[_0x21d6('0x1b')](channels[_0x1f6ccf[_0x21d6('0x10')]])){if(_[_0x21d6('0x1b')](channels[_0x1f6ccf[_0x21d6('0x10')]][_0x21d6('0xc')])){channels[_0x1f6ccf[_0x21d6('0x10')]][_0x21d6('0xc')]=_0x1f6ccf[_0x21d6('0x23')]+'\x20<'+_0x1f6ccf[_0x21d6('0x15')]+'>';}channels[_0x1f6ccf[_0x21d6('0x10')]][_0x21d6('0x24')]=utils['now']();channels[_0x1f6ccf[_0x21d6('0x10')]]['duration']=utils['diffTime'](channels[_0x1f6ccf[_0x21d6('0x10')]]['endtime'],channels[_0x1f6ccf[_0x21d6('0x10')]]['starttime']);channels[_0x1f6ccf[_0x21d6('0x10')]]['billableseconds']=channels[_0x1f6ccf['uniqueid']]['answertime']?utils['diffTime'](channels[_0x1f6ccf[_0x21d6('0x10')]]['endtime'],channels[_0x1f6ccf['uniqueid']][_0x21d6('0x20')]):0x0;writeDB(channels[_0x1f6ccf[_0x21d6('0x10')]]);}}catch(_0x1df251){utils[_0x21d6('0x19')](_0x1df251[_0x21d6('0x22')]);}};exports['attendedtransfer']=function(_0x1cd57b){try{if(!_['isNil'](channels[_0x1cd57b[_0x21d6('0x25')]])){if(channels[_0x1cd57b[_0x21d6('0x25')]][_0x21d6('0x13')]==_0x1cd57b[_0x21d6('0x26')]){channels[_0x1cd57b[_0x21d6('0x25')]][_0x21d6('0x1f')]=_0x1cd57b[_0x21d6('0x27')];channels[_0x1cd57b[_0x21d6('0x25')]][_0x21d6('0x28')]=_0x21d6('0x29');}else if(channels[_0x1cd57b[_0x21d6('0x25')]][_0x21d6('0x13')]=_0x1cd57b[_0x21d6('0x2a')]){channels[_0x1cd57b['localtwolinkedid']][_0x21d6('0x1f')]=_0x1cd57b['origtransfererchannel'];channels[_0x1cd57b['localtwolinkedid']][_0x21d6('0x28')]=_0x21d6('0x29');}}}catch(_0x101eaa){utils[_0x21d6('0x19')](_0x101eaa[_0x21d6('0x22')]);}};exports[_0x21d6('0x2b')]=function(_0x411b5a){try{if(!_[_0x21d6('0x1b')](channels[_0x411b5a[_0x21d6('0x10')]])){channels[_0x411b5a[_0x21d6('0x10')]][_0x21d6('0x2c')]=utils[_0x21d6('0x1e')]();}}catch(_0x43c8b6){utils[_0x21d6('0x19')](_0x43c8b6['stack']);}};exports[_0x21d6('0x2d')]=function(_0x4a7c78){try{if(!_['isNil'](channels[_0x4a7c78[_0x21d6('0x10')]])){if(!_[_0x21d6('0x1b')](channels[_0x4a7c78[_0x21d6('0x10')]][_0x21d6('0x2c')])){channels[_0x4a7c78[_0x21d6('0x10')]][_0x21d6('0x2e')]+=utils[_0x21d6('0x2f')](utils['now'](),channels[_0x4a7c78[_0x21d6('0x10')]]['musiconholdstartAt']);delete channels[_0x4a7c78['uniqueid']][_0x21d6('0x2c')];}}}catch(_0x545c5e){utils[_0x21d6('0x19')](_0x545c5e[_0x21d6('0x22')]);}};exports['varset']=function(_0x193d8e){try{if(!_[_0x21d6('0x1b')](channels[_0x193d8e['uniqueid']])){if(!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x31')])){channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x32')]=_0x193d8e[_0x21d6('0x33')];}if(!_[_0x21d6('0x1b')](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x34')])){channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0xb')]=_0x193d8e[_0x21d6('0x33')];channels[_0x193d8e[_0x21d6('0x10')]]['callerid']='\x22'+_0x193d8e['value']+'\x22\x20<'+_0x193d8e[_0x21d6('0x33')]+'>';}if(!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x35')])||!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x36')])){channels[_0x193d8e['uniqueid']][_0x21d6('0xc')]=_0x193d8e[_0x21d6('0x33')];}if(!_[_0x21d6('0x1b')](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x37')])||!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x38')])){channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x39')]=_0x21d6('0x3a');channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x3b')]=_0x193d8e['value'];channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x3c')]=!![];}if(!_[_0x21d6('0x1b')](_0x193d8e['variable'][_0x21d6('0x3d')])){channels[_0x193d8e['uniqueid']][_0x21d6('0x3e')]=_0x193d8e[_0x21d6('0x33')];}if(!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x3f')])){channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x9')]=_0x193d8e[_0x21d6('0x33')];}if(!_['isNil'](_0x193d8e[_0x21d6('0x30')][_0x21d6('0x40')])){channels[_0x193d8e[_0x21d6('0x10')]]['routeid']=_0x193d8e[_0x21d6('0x33')];}if(!_[_0x21d6('0x1b')](_0x193d8e['variable'][_0x21d6('0x41')])){channels[_0x193d8e[_0x21d6('0x10')]][_0x21d6('0x41')]=_0x193d8e[_0x21d6('0x33')];}}}catch(_0xf9622c){utils['error'](_0xf9622c['stack']);}};exports[_0x21d6('0x42')]=function(_0x2f03f9){try{if(!_[_0x21d6('0x1b')](channels[_0x2f03f9[_0x21d6('0x10')]])){if(_0x2f03f9[_0x21d6('0x43')][_0x21d6('0x44')]()==_0x21d6('0x45')&&_[_0x21d6('0x46')](_0x2f03f9[_0x21d6('0x47')][_0x21d6('0x44')](),_0x21d6('0x48'))){var _0x2a1eb0=_0x2f03f9[_0x21d6('0x47')][_0x21d6('0x49')]('=');var _0x1ee3a5=_0x2a1eb0[0x0][_0x21d6('0x4a')](_0x2a1eb0[0x0][_0x21d6('0x4b')]('(')+0x1,_0x2a1eb0[0x0][_0x21d6('0x4b')](')'));var _0x4ae3ee=_0x2a1eb0[0x1];channels[_0x2f03f9[_0x21d6('0x10')]][_0x1ee3a5]=_0x4ae3ee;}if(!_[_0x21d6('0x4c')]([_0x21d6('0x4d'),_0x21d6('0x4e'),'execif',_0x21d6('0x45'),_0x21d6('0x4f')],_0x2f03f9[_0x21d6('0x43')][_0x21d6('0x44')]())){channels[_0x2f03f9[_0x21d6('0x10')]]['lastapplication']=_0x2f03f9[_0x21d6('0x43')];channels[_0x2f03f9['uniqueid']][_0x21d6('0x3b')]=_0x2f03f9['appdata'];}}}catch(_0x2cdbc7){utils[_0x21d6('0x19')](_0x2cdbc7['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index dbbe98b..4b39da3 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 _0x8ef6=['./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE'];(function(_0x4d0bd3,_0x23c18f){var _0x180bd0=function(_0x11981e){while(--_0x11981e){_0x4d0bd3['push'](_0x4d0bd3['shift']());}};_0x180bd0(++_0x23c18f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2d4988,_0x150f55){_0x2d4988=_0x2d4988-0x0;var _0x5c7b18=_0x8ef6[_0x2d4988];return _0x5c7b18;};'use strict';var utils=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));exports[_0x68ef('0x2')]=function(){utils[_0x68ef('0x3')](_0x68ef('0x4'));};exports[_0x68ef('0x5')]=function(){utils[_0x68ef('0x3')]('SHUTDOWN');};exports[_0x68ef('0x6')]=function(){utils[_0x68ef('0x3')](_0x68ef('0x7'));};exports[_0x68ef('0x8')]=function(_0x4d26e3){utils['error'](_0x4d26e3);};exports[_0x68ef('0x9')]=function(){utils[_0x68ef('0x3')](_0x68ef('0xa'));};exports['managerevent']=function(_0x228967){}; \ No newline at end of file +var _0x3fa4=['shutdown','info','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','CONNECTED'];(function(_0xa1d403,_0x4683a0){var _0xf94c5c=function(_0x5674d6){while(--_0x5674d6){_0xa1d403['push'](_0xa1d403['shift']());}};_0xf94c5c(++_0x4683a0);}(_0x3fa4,0xf0));var _0x43fa=function(_0x4c55ae,_0x1d17fc){_0x4c55ae=_0x4c55ae-0x0;var _0xe70bd0=_0x3fa4[_0x4c55ae];return _0xe70bd0;};'use strict';var utils=require(_0x43fa('0x0'));var _=require('lodash');exports['connect']=function(){utils['info'](_0x43fa('0x1'));};exports[_0x43fa('0x2')]=function(){utils[_0x43fa('0x3')](_0x43fa('0x4'));};exports[_0x43fa('0x5')]=function(){utils[_0x43fa('0x3')](_0x43fa('0x6'));};exports['error']=function(_0x2c7789){utils[_0x43fa('0x7')](_0x2c7789);};exports[_0x43fa('0x8')]=function(){utils['info'](_0x43fa('0x9'));};exports[_0x43fa('0xa')]=function(_0x1dc401){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 5e8a56c..f903907 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 _0x07ee=['calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','stack','varset','variable','value','starttime','now','lastevent','called','ANSWER','answertime','connect','isNil','assign','complete','duration','diffTime','endtime','billableseconds','util','./utils','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring'];(function(_0x1e6af0,_0x4570a8){var _0x5343f7=function(_0x35829f){while(--_0x35829f){_0x1e6af0['push'](_0x1e6af0['shift']());}};_0x5343f7(++_0x4570a8);}(_0x07ee,0x1f2));var _0xe07e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x07ee[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require(_0xe07e('0x0'));var utils=require(_0xe07e('0x1'));var dials={};function writeDB(_0x4390a7){utils['info'](util[_0xe07e('0x2')](_0xe07e('0x3'),_0x4390a7[_0xe07e('0x4')],_0x4390a7['channel'],_0x4390a7[_0xe07e('0x5')],_0x4390a7[_0xe07e('0x6')],_0x4390a7[_0xe07e('0x7')],_0x4390a7[_0xe07e('0x8')]));utils['request'](_0xe07e('0x9'),_0x4390a7);delete dials[_0x4390a7[_0xe07e('0x4')]];}exports[_0xe07e('0xa')]=function(_0xc6fc08){try{if(_0xc6fc08[_0xe07e('0xb')][_0xe07e('0xc')]()==_0xe07e('0xd')&&_[_0xe07e('0xe')](_0xc6fc08[_0xe07e('0xf')]['toLowerCase'](),_0xe07e('0x10'))){var _0x2ed09d=_0xc6fc08[_0xe07e('0xf')]['split']('=');dials[_0xc6fc08['uniqueid']]={'routeId':_0x2ed09d[0x1]};}}catch(_0x3d1511){utils[_0xe07e('0x11')](_0x3d1511[_0xe07e('0x12')]);}};exports[_0xe07e('0x13')]=function(_0x3c9d09){try{if(!_['isNil'](_0x3c9d09[_0xe07e('0x14')]['outboundrouteid'])){dials[_0x3c9d09[_0xe07e('0x4')]]={'routeId':_0x3c9d09[_0xe07e('0x15')]};}}catch(_0x3ef370){utils[_0xe07e('0x11')](_0x3ef370[_0xe07e('0x12')]);}};exports['dialbegin']=function(_0xffd0e3){try{if(!_['isNil'](dials[_0xffd0e3['uniqueid']])){dials[_0xffd0e3[_0xe07e('0x4')]]=_['assign'](dials[_0xffd0e3['uniqueid']],_0xffd0e3);dials[_0xffd0e3[_0xe07e('0x4')]][_0xe07e('0x16')]=utils[_0xe07e('0x17')]();dials[_0xffd0e3[_0xe07e('0x4')]][_0xe07e('0x18')]=_0xe07e('0x19');}}catch(_0x5e916c){utils[_0xe07e('0x11')](_0x5e916c['stack']);}};exports['dialend']=function(_0x59d827){try{if(!_['isNil'](dials[_0x59d827[_0xe07e('0x4')]])){dials[_0x59d827[_0xe07e('0x4')]][_0xe07e('0x8')]=_0x59d827[_0xe07e('0x8')];if(_0x59d827[_0xe07e('0x8')]==_0xe07e('0x1a')){dials[_0x59d827[_0xe07e('0x4')]]=_['assign'](dials[_0x59d827['uniqueid']],_0x59d827);dials[_0x59d827['uniqueid']][_0xe07e('0x1b')]=utils['now']();dials[_0x59d827[_0xe07e('0x4')]][_0xe07e('0x18')]=_0xe07e('0x1c');}}}catch(_0x160e62){utils['error'](_0x160e62[_0xe07e('0x12')]);}};exports['hangup']=function(_0x6db3){try{if(!_[_0xe07e('0x1d')](dials[_0x6db3[_0xe07e('0x4')]])){dials[_0x6db3['uniqueid']]=_[_0xe07e('0x1e')](dials[_0x6db3['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xe07e('0x1f')});dials[_0x6db3[_0xe07e('0x4')]][_0xe07e('0x20')]=utils[_0xe07e('0x21')](dials[_0x6db3[_0xe07e('0x4')]][_0xe07e('0x22')],dials[_0x6db3[_0xe07e('0x4')]][_0xe07e('0x16')]);dials[_0x6db3[_0xe07e('0x4')]]['holdtime']=utils['diffTime'](dials[_0x6db3['uniqueid']][_0xe07e('0x1b')]||dials[_0x6db3['uniqueid']][_0xe07e('0x22')],dials[_0x6db3['uniqueid']]['starttime']);dials[_0x6db3[_0xe07e('0x4')]][_0xe07e('0x23')]=dials[_0x6db3[_0xe07e('0x4')]]['answertime']?utils[_0xe07e('0x21')](dials[_0x6db3[_0xe07e('0x4')]][_0xe07e('0x22')],dials[_0x6db3[_0xe07e('0x4')]]['answertime']):0x0;writeDB(dials[_0x6db3[_0xe07e('0x4')]]);}}catch(_0x8f5853){utils[_0xe07e('0x11')](_0x8f5853[_0xe07e('0x12')]);}}; \ No newline at end of file +var _0xe737=['billableseconds','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','stack','varset','isNil','variable','value','dialbegin','starttime','lastevent','dialend','ANSWER','assign','answertime','now','connect','hangup','complete','duration','diffTime','endtime','holdtime'];(function(_0x41bf2,_0x3ea33b){var _0x3b8429=function(_0x437979){while(--_0x437979){_0x41bf2['push'](_0x41bf2['shift']());}};_0x3b8429(++_0x3ea33b);}(_0xe737,0x141));var _0x7e73=function(_0x5d1c73,_0x2b8f38){_0x5d1c73=_0x5d1c73-0x0;var _0x4a9d82=_0xe737[_0x5d1c73];return _0x4a9d82;};'use strict';var _=require(_0x7e73('0x0'));var util=require(_0x7e73('0x1'));var utils=require(_0x7e73('0x2'));var dials={};function writeDB(_0x5b2d78){utils[_0x7e73('0x3')](util['format'](_0x7e73('0x4'),_0x5b2d78[_0x7e73('0x5')],_0x5b2d78[_0x7e73('0x6')],_0x5b2d78['dialstring'],_0x5b2d78['calleridnum'],_0x5b2d78[_0x7e73('0x7')],_0x5b2d78[_0x7e73('0x8')]));utils[_0x7e73('0x9')](_0x7e73('0xa'),_0x5b2d78);delete dials[_0x5b2d78[_0x7e73('0x5')]];}exports[_0x7e73('0xb')]=function(_0x4e3d06){try{if(_0x4e3d06[_0x7e73('0xc')][_0x7e73('0xd')]()==_0x7e73('0xe')&&_[_0x7e73('0xf')](_0x4e3d06['appdata']['toLowerCase'](),_0x7e73('0x10'))){var _0x54b28b=_0x4e3d06['appdata'][_0x7e73('0x11')]('=');dials[_0x4e3d06[_0x7e73('0x5')]]={'routeId':_0x54b28b[0x1]};}}catch(_0x22cd5d){utils[_0x7e73('0x12')](_0x22cd5d[_0x7e73('0x13')]);}};exports[_0x7e73('0x14')]=function(_0x2f496a){try{if(!_[_0x7e73('0x15')](_0x2f496a[_0x7e73('0x16')]['outboundrouteid'])){dials[_0x2f496a[_0x7e73('0x5')]]={'routeId':_0x2f496a[_0x7e73('0x17')]};}}catch(_0x1b0172){utils[_0x7e73('0x12')](_0x1b0172[_0x7e73('0x13')]);}};exports[_0x7e73('0x18')]=function(_0x2ee4ab){try{if(!_[_0x7e73('0x15')](dials[_0x2ee4ab[_0x7e73('0x5')]])){dials[_0x2ee4ab[_0x7e73('0x5')]]=_['assign'](dials[_0x2ee4ab[_0x7e73('0x5')]],_0x2ee4ab);dials[_0x2ee4ab['uniqueid']][_0x7e73('0x19')]=utils['now']();dials[_0x2ee4ab[_0x7e73('0x5')]][_0x7e73('0x1a')]='called';}}catch(_0x50d751){utils[_0x7e73('0x12')](_0x50d751['stack']);}};exports[_0x7e73('0x1b')]=function(_0x3e61a8){try{if(!_[_0x7e73('0x15')](dials[_0x3e61a8[_0x7e73('0x5')]])){dials[_0x3e61a8[_0x7e73('0x5')]][_0x7e73('0x8')]=_0x3e61a8[_0x7e73('0x8')];if(_0x3e61a8[_0x7e73('0x8')]==_0x7e73('0x1c')){dials[_0x3e61a8['uniqueid']]=_[_0x7e73('0x1d')](dials[_0x3e61a8['uniqueid']],_0x3e61a8);dials[_0x3e61a8[_0x7e73('0x5')]][_0x7e73('0x1e')]=utils[_0x7e73('0x1f')]();dials[_0x3e61a8[_0x7e73('0x5')]][_0x7e73('0x1a')]=_0x7e73('0x20');}}}catch(_0x21ca14){utils[_0x7e73('0x12')](_0x21ca14[_0x7e73('0x13')]);}};exports[_0x7e73('0x21')]=function(_0x4187f6){try{if(!_[_0x7e73('0x15')](dials[_0x4187f6['uniqueid']])){dials[_0x4187f6[_0x7e73('0x5')]]=_[_0x7e73('0x1d')](dials[_0x4187f6[_0x7e73('0x5')]],{'endtime':utils[_0x7e73('0x1f')](),'lastevent':_0x7e73('0x22')});dials[_0x4187f6['uniqueid']][_0x7e73('0x23')]=utils[_0x7e73('0x24')](dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x25')],dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x19')]);dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x26')]=utils[_0x7e73('0x24')](dials[_0x4187f6['uniqueid']]['answertime']||dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x25')],dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x19')]);dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x27')]=dials[_0x4187f6['uniqueid']][_0x7e73('0x1e')]?utils[_0x7e73('0x24')](dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x25')],dials[_0x4187f6[_0x7e73('0x5')]][_0x7e73('0x1e')]):0x0;writeDB(dials[_0x4187f6['uniqueid']]);}}catch(_0x2ccb88){utils[_0x7e73('0x12')](_0x2ccb88['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 00e0d30..348a8a5 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 _0xbb99=['keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialend','../../config/environment','./utils','asterisk','username'];(function(_0x219883,_0xa4186a){var _0x349510=function(_0xb56191){while(--_0xb56191){_0x219883['push'](_0x219883['shift']());}};_0x349510(++_0xa4186a);}(_0xbb99,0x18c));var _0x9bb9=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xbb99[_0x4eec9b];return _0x2e3849;};var AsteriskManager=require('asterisk-manager');var config=require(_0x9bb9('0x0'));var utils=require(_0x9bb9('0x1'));var ami=new AsteriskManager(config[_0x9bb9('0x2')]['port'],config[_0x9bb9('0x2')]['ip'],config[_0x9bb9('0x2')][_0x9bb9('0x3')],config[_0x9bb9('0x2')]['password'],!![]);ami[_0x9bb9('0x4')]();if(config[_0x9bb9('0x5')]&&config[_0x9bb9('0x5')][_0x9bb9('0x6')]){utils[_0x9bb9('0x7')](_0x9bb9('0x8'));}else{var agents=require(_0x9bb9('0x9'));var calls=require(_0x9bb9('0xa'));var queues=require(_0x9bb9('0xb'));var recordings=require(_0x9bb9('0xc'));var members=require(_0x9bb9('0xd'));var dials=require(_0x9bb9('0xe'));var transfers=require(_0x9bb9('0xf'));var core=require('./core.controller');ami['on'](_0x9bb9('0x10'),core[_0x9bb9('0x10')]);ami['on'](_0x9bb9('0x11'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x9bb9('0x12'),core[_0x9bb9('0x12')]);ami['on'](_0x9bb9('0x13'),core[_0x9bb9('0x13')]);ami['on'](_0x9bb9('0x14'),core[_0x9bb9('0x14')]);ami['on'](_0x9bb9('0x15'),function(_0x30d856){try{members[_0x9bb9('0x15')](_0x30d856);}catch(_0x49362c){utils[_0x9bb9('0x12')](_0x49362c);}});ami['on'](_0x9bb9('0x16'),function(_0x860554){try{agents[_0x9bb9('0x16')](_0x860554);}catch(_0x303840){utils[_0x9bb9('0x12')](_0x303840);}});ami['on'](_0x9bb9('0x17'),function(_0x5b080e){try{agents[_0x9bb9('0x17')](_0x5b080e);}catch(_0x432f25){utils['error'](_0x432f25);}});ami['on'](_0x9bb9('0x18'),function(_0x26306b){try{agents[_0x9bb9('0x18')](_0x26306b);queues[_0x9bb9('0x18')](_0x26306b);}catch(_0x488e9a){utils[_0x9bb9('0x12')](_0x488e9a);}});ami['on'](_0x9bb9('0x19'),function(_0x5bdcba){try{agents['agentcomplete'](_0x5bdcba);queues[_0x9bb9('0x19')](_0x5bdcba);members[_0x9bb9('0x19')](_0x5bdcba);}catch(_0x3ca25f){utils[_0x9bb9('0x12')](_0x3ca25f);}});ami['on'](_0x9bb9('0x1a'),function(_0x45a49b){try{agents[_0x9bb9('0x1a')](_0x45a49b);queues['queuecallerabandon'](_0x45a49b);}catch(_0x5c0e4e){utils['error'](_0x5c0e4e);}});ami['on'](_0x9bb9('0x1b'),function(_0x2218d5){try{queues[_0x9bb9('0x1b')](_0x2218d5);recordings[_0x9bb9('0x1b')](_0x2218d5);}catch(_0x3bfdf9){utils['error'](_0x3bfdf9);}});ami['on'](_0x9bb9('0x1c'),function(_0xc7c58b){try{queues['queuecallerleave'](_0xc7c58b);}catch(_0x3a9425){utils[_0x9bb9('0x12')](_0x3a9425);}});ami['on'](_0x9bb9('0x1d'),function(_0x39e509){try{queues['musiconholdstart'](_0x39e509);calls[_0x9bb9('0x1d')](_0x39e509);}catch(_0x25e54d){utils['error'](_0x25e54d);}});ami['on'](_0x9bb9('0x1e'),function(_0x1d0202){try{queues['musiconholdstop'](_0x1d0202);calls[_0x9bb9('0x1e')](_0x1d0202);}catch(_0x4210ec){utils['error'](_0x4210ec);}});ami['on'](_0x9bb9('0x1f'),function(_0x424b50){try{calls[_0x9bb9('0x1f')](_0x424b50);recordings[_0x9bb9('0x1f')](_0x424b50);}catch(_0xaa203){utils[_0x9bb9('0x12')](_0xaa203);}});ami['on'](_0x9bb9('0x20'),function(_0x188ad0){try{calls[_0x9bb9('0x20')](_0x188ad0);recordings[_0x9bb9('0x20')](_0x188ad0);dials['hangup'](_0x188ad0);agents[_0x9bb9('0x20')](_0x188ad0);queues[_0x9bb9('0x20')](_0x188ad0);}catch(_0x4fad0b){utils['error'](_0x4fad0b);}});ami['on'](_0x9bb9('0x21'),function(_0x3cc305){try{members[_0x9bb9('0x21')](_0x3cc305);}catch(_0x39b107){utils[_0x9bb9('0x12')](_0x39b107);}});ami['on']('blindtransfer',function(_0x27a8df){try{queues[_0x9bb9('0x22')](_0x27a8df);agents[_0x9bb9('0x22')](_0x27a8df);transfers[_0x9bb9('0x22')](_0x27a8df);}catch(_0x471d45){utils[_0x9bb9('0x12')](_0x471d45);}});ami['on'](_0x9bb9('0x23'),function(_0x4a04de){try{queues[_0x9bb9('0x23')](_0x4a04de);transfers[_0x9bb9('0x23')](_0x4a04de);agents[_0x9bb9('0x23')](_0x4a04de);calls[_0x9bb9('0x23')](_0x4a04de);}catch(_0x166f0b){utils[_0x9bb9('0x12')](_0x166f0b);}});ami['on'](_0x9bb9('0x24'),function(_0x967fdf){try{queues[_0x9bb9('0x24')](_0x967fdf);recordings[_0x9bb9('0x24')](_0x967fdf);calls[_0x9bb9('0x24')](_0x967fdf);dials[_0x9bb9('0x24')](_0x967fdf);}catch(_0x51e990){utils[_0x9bb9('0x12')](_0x51e990);}});ami['on']('newexten',function(_0x200829){try{calls[_0x9bb9('0x25')](_0x200829);recordings[_0x9bb9('0x25')](_0x200829);dials[_0x9bb9('0x25')](_0x200829);}catch(_0x498acf){utils['error'](_0x498acf);}});ami['on'](_0x9bb9('0x26'),function(_0x3e5063){try{calls[_0x9bb9('0x26')](_0x3e5063);recordings[_0x9bb9('0x26')](_0x3e5063);}catch(_0x1cc9d5){utils[_0x9bb9('0x12')](_0x1cc9d5);}});ami['on']('dialbegin',function(_0x247b26){try{dials['dialbegin'](_0x247b26);}catch(_0x305eb7){utils[_0x9bb9('0x12')](_0x305eb7);}});ami['on'](_0x9bb9('0x27'),function(_0x4ecddd){try{dials[_0x9bb9('0x27')](_0x4ecddd);}catch(_0x271fbb){utils[_0x9bb9('0x12')](_0x271fbb);}});} \ No newline at end of file +var _0x08bf=['agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x54c2d8,_0x6f1180){var _0x321a6a=function(_0xc2d42a){while(--_0xc2d42a){_0x54c2d8['push'](_0x54c2d8['shift']());}};_0x321a6a(++_0x6f1180);}(_0x08bf,0x1e6));var _0xf08b=function(_0x4c9e58,_0x469fea){_0x4c9e58=_0x4c9e58-0x0;var _0x413b0a=_0x08bf[_0x4c9e58];return _0x413b0a;};var AsteriskManager=require(_0xf08b('0x0'));var config=require(_0xf08b('0x1'));var utils=require(_0xf08b('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0xf08b('0x3')]['ip'],config['asterisk'][_0xf08b('0x4')],config[_0xf08b('0x3')][_0xf08b('0x5')],!![]);ami[_0xf08b('0x6')]();if(config[_0xf08b('0x7')]&&config['xdr'][_0xf08b('0x8')]){utils[_0xf08b('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0xf08b('0xa'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xf08b('0xb'));var members=require(_0xf08b('0xc'));var dials=require(_0xf08b('0xd'));var transfers=require('./transfers.controller');var core=require(_0xf08b('0xe'));ami['on']('connect',core['connect']);ami['on'](_0xf08b('0xf'),core[_0xf08b('0xf')]);ami['on'](_0xf08b('0x10'),core[_0xf08b('0x10')]);ami['on'](_0xf08b('0x11'),core[_0xf08b('0x11')]);ami['on'](_0xf08b('0x12'),core[_0xf08b('0x12')]);ami['on'](_0xf08b('0x13'),core[_0xf08b('0x13')]);ami['on'](_0xf08b('0x14'),function(_0x517615){try{members[_0xf08b('0x14')](_0x517615);}catch(_0x3188fb){utils[_0xf08b('0x11')](_0x3188fb);}});ami['on']('agentcalled',function(_0x1c0ca8){try{agents[_0xf08b('0x15')](_0x1c0ca8);}catch(_0x24911b){utils[_0xf08b('0x11')](_0x24911b);}});ami['on'](_0xf08b('0x16'),function(_0x356244){try{agents[_0xf08b('0x16')](_0x356244);}catch(_0x2f8ed2){utils[_0xf08b('0x11')](_0x2f8ed2);}});ami['on']('agentconnect',function(_0x116d7b){try{agents[_0xf08b('0x17')](_0x116d7b);queues['agentconnect'](_0x116d7b);}catch(_0x104dad){utils[_0xf08b('0x11')](_0x104dad);}});ami['on'](_0xf08b('0x18'),function(_0xd6e5c2){try{agents[_0xf08b('0x18')](_0xd6e5c2);queues['agentcomplete'](_0xd6e5c2);members['agentcomplete'](_0xd6e5c2);}catch(_0x2ca3c4){utils[_0xf08b('0x11')](_0x2ca3c4);}});ami['on']('queuecallerabandon',function(_0x2debbd){try{agents['queuecallerabandon'](_0x2debbd);queues['queuecallerabandon'](_0x2debbd);}catch(_0x2e7133){utils['error'](_0x2e7133);}});ami['on'](_0xf08b('0x19'),function(_0x14fad){try{queues[_0xf08b('0x19')](_0x14fad);recordings[_0xf08b('0x19')](_0x14fad);}catch(_0x3c16ab){utils[_0xf08b('0x11')](_0x3c16ab);}});ami['on'](_0xf08b('0x1a'),function(_0x2b50b8){try{queues[_0xf08b('0x1a')](_0x2b50b8);}catch(_0x2ad090){utils[_0xf08b('0x11')](_0x2ad090);}});ami['on']('musiconholdstart',function(_0x3f4ecf){try{queues[_0xf08b('0x1b')](_0x3f4ecf);calls[_0xf08b('0x1b')](_0x3f4ecf);}catch(_0x4e7ccf){utils[_0xf08b('0x11')](_0x4e7ccf);}});ami['on'](_0xf08b('0x1c'),function(_0x230023){try{queues[_0xf08b('0x1c')](_0x230023);calls[_0xf08b('0x1c')](_0x230023);}catch(_0xf873cd){utils[_0xf08b('0x11')](_0xf873cd);}});ami['on'](_0xf08b('0x1d'),function(_0x58f5f2){try{calls[_0xf08b('0x1d')](_0x58f5f2);recordings[_0xf08b('0x1d')](_0x58f5f2);}catch(_0x3fbc8d){utils[_0xf08b('0x11')](_0x3fbc8d);}});ami['on'](_0xf08b('0x1e'),function(_0x4468f5){try{calls[_0xf08b('0x1e')](_0x4468f5);recordings[_0xf08b('0x1e')](_0x4468f5);dials[_0xf08b('0x1e')](_0x4468f5);agents[_0xf08b('0x1e')](_0x4468f5);queues[_0xf08b('0x1e')](_0x4468f5);}catch(_0x5711c4){utils[_0xf08b('0x11')](_0x5711c4);}});ami['on'](_0xf08b('0x1f'),function(_0x1b5044){try{members[_0xf08b('0x1f')](_0x1b5044);}catch(_0x2642d8){utils['error'](_0x2642d8);}});ami['on'](_0xf08b('0x20'),function(_0x47d2c0){try{queues[_0xf08b('0x20')](_0x47d2c0);agents[_0xf08b('0x20')](_0x47d2c0);transfers[_0xf08b('0x20')](_0x47d2c0);}catch(_0x4819fd){utils[_0xf08b('0x11')](_0x4819fd);}});ami['on'](_0xf08b('0x21'),function(_0x2bbb38){try{queues[_0xf08b('0x21')](_0x2bbb38);transfers[_0xf08b('0x21')](_0x2bbb38);agents[_0xf08b('0x21')](_0x2bbb38);calls[_0xf08b('0x21')](_0x2bbb38);}catch(_0x45eb8a){utils[_0xf08b('0x11')](_0x45eb8a);}});ami['on'](_0xf08b('0x22'),function(_0xfd0b4){try{queues[_0xf08b('0x22')](_0xfd0b4);recordings[_0xf08b('0x22')](_0xfd0b4);calls[_0xf08b('0x22')](_0xfd0b4);dials[_0xf08b('0x22')](_0xfd0b4);}catch(_0x2de6ad){utils[_0xf08b('0x11')](_0x2de6ad);}});ami['on'](_0xf08b('0x23'),function(_0x4fe8ff){try{calls['newexten'](_0x4fe8ff);recordings[_0xf08b('0x23')](_0x4fe8ff);dials[_0xf08b('0x23')](_0x4fe8ff);}catch(_0xa12267){utils[_0xf08b('0x11')](_0xa12267);}});ami['on'](_0xf08b('0x24'),function(_0x4d2a02){try{calls[_0xf08b('0x24')](_0x4d2a02);recordings[_0xf08b('0x24')](_0x4d2a02);}catch(_0x560a3d){utils[_0xf08b('0x11')](_0x560a3d);}});ami['on'](_0xf08b('0x25'),function(_0x419d86){try{dials[_0xf08b('0x25')](_0x419d86);}catch(_0x43d129){utils[_0xf08b('0x11')](_0x43d129);}});ami['on'](_0xf08b('0x26'),function(_0x38ac8d){try{dials[_0xf08b('0x26')](_0x38ac8d);}catch(_0x395c3e){utils['error'](_0x395c3e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index d99adb8..f39913f 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 _0x914a=['MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','device','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','channel','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format'];(function(_0x5ad67c,_0x144860){var _0xccce2e=function(_0x2dd95c){while(--_0x2dd95c){_0x5ad67c['push'](_0x5ad67c['shift']());}};_0xccce2e(++_0x144860);}(_0x914a,0xdf));var _0xa914=function(_0x4cd685,_0x472697){_0x4cd685=_0x4cd685-0x0;var _0x37743e=_0x914a[_0x4cd685];return _0x37743e;};'use strict';var _=require(_0xa914('0x0'));var util=require(_0xa914('0x1'));var utils=require(_0xa914('0x2'));var members={};var exclude=[_0xa914('0x3'),_0xa914('0x4')];function writeDB(_0x319fc3){utils[_0xa914('0x5')](util[_0xa914('0x6')](_0xa914('0x7'),_0x319fc3[_0xa914('0x8')],_0x319fc3[_0xa914('0x9')],_0x319fc3['channel'],_0x319fc3[_0xa914('0xa')],_0x319fc3[_0xa914('0xb')],_0x319fc3[_0xa914('0xc')]));if(_0x319fc3['interface']){utils[_0xa914('0xd')](_0x319fc3[_0xa914('0x9')])[_0xa914('0xe')](function(_0x713b5d){if(_0x713b5d){_0x319fc3[_0xa914('0xb')]=_0x713b5d['name'];_0x319fc3[_0xa914('0xf')]=_0x713b5d[_0xa914('0xf')];utils[_0xa914('0x10')](_0xa914('0x11'),_0x319fc3);}else{utils[_0xa914('0x12')](_0x319fc3[_0xa914('0x9')][_0xa914('0x13')]('/')[0x1])[_0xa914('0xe')](function(_0x1b5bf8){if(_0x1b5bf8){_0x319fc3['membername']=_0x1b5bf8['name'];_0x319fc3[_0xa914('0xf')]=_0x1b5bf8[_0xa914('0xf')];utils[_0xa914('0x10')]('CreateMemberReport',_0x319fc3);}});}})[_0xa914('0x14')](function(_0x171dbf){utils[_0xa914('0x15')](_0x171dbf);});}delete members[_0x319fc3[_0xa914('0x9')]];}function startsWith(_0x19a35e,_0x5bae2d){return _[_0xa914('0x16')](_0x19a35e,function(_0x43400f){return _[_0xa914('0x17')](_0x5bae2d,_0x43400f);});}exports[_0xa914('0x18')]=function(_0x51ef89){switch(_0x51ef89['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x51ef89[_0xa914('0x19')])){members[_0x51ef89[_0xa914('0x19')]]={'channel':_0xa914('0x1a'),'interface':_0x51ef89[_0xa914('0x19')],'type':_0xa914('0x1b'),'enterAt':utils[_0xa914('0x1c')](),'role':_0xa914('0x1d')};}break;case _0xa914('0x1e'):if(!_[_0xa914('0x1f')](members[_0x51ef89['device']])){members[_0x51ef89[_0xa914('0x19')]]['exitAt']=utils['now']();members[_0x51ef89[_0xa914('0x19')]][_0xa914('0x20')]=utils[_0xa914('0x21')](members[_0x51ef89[_0xa914('0x19')]][_0xa914('0x22')],members[_0x51ef89['device']][_0xa914('0x23')]);if(members[_0x51ef89['device']]['uniqueid']){writeDB(members[_0x51ef89[_0xa914('0x19')]]);}}default:break;}};exports[_0xa914('0x24')]=function(_0x4a2fb6){if(!_[_0xa914('0x1f')](members[_0x4a2fb6['interface']])){members[_0x4a2fb6[_0xa914('0x9')]]=_[_0xa914('0x25')](members[_0x4a2fb6[_0xa914('0x9')]],{'data4':_0x4a2fb6[_0xa914('0x26')],'uniqueid':_0x4a2fb6[_0xa914('0x8')]});}};exports[_0xa914('0x27')]=function(_0x5be73e){if(_0x5be73e['channel']){var _0x33adbc=_0x5be73e[_0xa914('0x28')][_0xa914('0x13')]('-')[0x0];if(!_[_0xa914('0x1f')](members[_0x33adbc])){members[_0x33adbc]=_[_0xa914('0x25')](members[_0x33adbc],{'data1':members[_0x33adbc][_0xa914('0x29')]||_0x5be73e[_0xa914('0xc')],'data2':members[_0x33adbc]['data2']||_0x5be73e[_0xa914('0x2a')],'data3':members[_0x33adbc][_0xa914('0x2b')]||_0x5be73e[_0xa914('0x2c')],'uniqueid':members[_0x33adbc]['uniqueid']||_0x5be73e[_0xa914('0x8')]});if(members[_0x33adbc][_0xa914('0x22')]){writeDB(members[_0x33adbc]);}}}if(_0x5be73e['destinationchannel']){var _0x3580c6=_0x5be73e[_0xa914('0x2d')][_0xa914('0x13')]('-')[0x0];if(!_['isNil'](members[_0x3580c6])){members[_0x3580c6]=_['assign'](members[_0x3580c6],{'data1':members[_0x3580c6][_0xa914('0x29')]||_0x5be73e['type'],'data2':members[_0x3580c6][_0xa914('0xa')]||_0x5be73e[_0xa914('0x2a')],'data3':members[_0x3580c6][_0xa914('0x2b')]||_0x5be73e[_0xa914('0x2c')],'uniqueid':members[_0x3580c6][_0xa914('0x8')]||_0x5be73e[_0xa914('0x8')]});if(members[_0x3580c6][_0xa914('0x22')]){writeDB(members[_0x3580c6]);}}}}; \ No newline at end of file +var _0xe274=['exitAt','duration','diffTime','enterAt','agentcomplete','assign','cdr','data1','data3','destinationchannel','data2','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','membername','type','getUserByInterface','internal','CreateMemberReport','split','then','request','catch','some','startsWith','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil'];(function(_0x7eadd1,_0x48a71b){var _0x51d796=function(_0x11c6af){while(--_0x11c6af){_0x7eadd1['push'](_0x7eadd1['shift']());}};_0x51d796(++_0x48a71b);}(_0xe274,0xe2));var _0x4e27=function(_0x58b689,_0x1411ee){_0x58b689=_0x58b689-0x0;var _0x47f86f=_0xe274[_0x58b689];return _0x47f86f;};'use strict';var _=require('lodash');var util=require(_0x4e27('0x0'));var utils=require(_0x4e27('0x1'));var members={};var exclude=[_0x4e27('0x2'),_0x4e27('0x3')];function writeDB(_0x285ff7){utils[_0x4e27('0x4')](util[_0x4e27('0x5')](_0x4e27('0x6'),_0x285ff7[_0x4e27('0x7')],_0x285ff7[_0x4e27('0x8')],_0x285ff7[_0x4e27('0x9')],_0x285ff7['data2'],_0x285ff7[_0x4e27('0xa')],_0x285ff7[_0x4e27('0xb')]));if(_0x285ff7['interface']){utils[_0x4e27('0xc')](_0x285ff7[_0x4e27('0x8')])['then'](function(_0x531a41){if(_0x531a41){_0x285ff7['membername']=_0x531a41['name'];_0x285ff7[_0x4e27('0xd')]=_0x531a41[_0x4e27('0xd')];utils['request'](_0x4e27('0xe'),_0x285ff7);}else{utils['getUserByName'](_0x285ff7['interface'][_0x4e27('0xf')]('/')[0x1])[_0x4e27('0x10')](function(_0x52ad77){if(_0x52ad77){_0x285ff7[_0x4e27('0xa')]=_0x52ad77['name'];_0x285ff7[_0x4e27('0xd')]=_0x52ad77[_0x4e27('0xd')];utils[_0x4e27('0x11')](_0x4e27('0xe'),_0x285ff7);}});}})[_0x4e27('0x12')](function(_0x594754){utils['error'](_0x594754);});}delete members[_0x285ff7['interface']];}function startsWith(_0xdca21b,_0x2e4844){return _[_0x4e27('0x13')](_0xdca21b,function(_0xd7c4a7){return _[_0x4e27('0x14')](_0x2e4844,_0xd7c4a7);});}exports[_0x4e27('0x15')]=function(_0x40782b){switch(_0x40782b[_0x4e27('0x16')]){case _0x4e27('0x17'):case _0x4e27('0x18'):if(!startsWith(exclude,_0x40782b['device'])){members[_0x40782b[_0x4e27('0x19')]]={'channel':_0x4e27('0x1a'),'interface':_0x40782b['device'],'type':_0x4e27('0x1b'),'enterAt':utils[_0x4e27('0x1c')](),'role':_0x4e27('0x1d')};}break;case _0x4e27('0x1e'):if(!_[_0x4e27('0x1f')](members[_0x40782b[_0x4e27('0x19')]])){members[_0x40782b[_0x4e27('0x19')]][_0x4e27('0x20')]=utils[_0x4e27('0x1c')]();members[_0x40782b[_0x4e27('0x19')]][_0x4e27('0x21')]=utils[_0x4e27('0x22')](members[_0x40782b['device']][_0x4e27('0x20')],members[_0x40782b[_0x4e27('0x19')]][_0x4e27('0x23')]);if(members[_0x40782b[_0x4e27('0x19')]][_0x4e27('0x7')]){writeDB(members[_0x40782b[_0x4e27('0x19')]]);}}default:break;}};exports[_0x4e27('0x24')]=function(_0x1fbba8){if(!_[_0x4e27('0x1f')](members[_0x1fbba8['interface']])){members[_0x1fbba8[_0x4e27('0x8')]]=_[_0x4e27('0x25')](members[_0x1fbba8[_0x4e27('0x8')]],{'data4':_0x1fbba8['queue'],'uniqueid':_0x1fbba8[_0x4e27('0x7')]});}};exports[_0x4e27('0x26')]=function(_0x593af2){if(_0x593af2[_0x4e27('0x9')]){var _0x34921d=_0x593af2[_0x4e27('0x9')][_0x4e27('0xf')]('-')[0x0];if(!_['isNil'](members[_0x34921d])){members[_0x34921d]=_[_0x4e27('0x25')](members[_0x34921d],{'data1':members[_0x34921d][_0x4e27('0x27')]||_0x593af2[_0x4e27('0xb')],'data2':members[_0x34921d]['data2']||_0x593af2['source'],'data3':members[_0x34921d][_0x4e27('0x28')]||_0x593af2['destination'],'uniqueid':members[_0x34921d]['uniqueid']||_0x593af2[_0x4e27('0x7')]});if(members[_0x34921d][_0x4e27('0x20')]){writeDB(members[_0x34921d]);}}}if(_0x593af2[_0x4e27('0x29')]){var _0x3fce0c=_0x593af2[_0x4e27('0x29')][_0x4e27('0xf')]('-')[0x0];if(!_['isNil'](members[_0x3fce0c])){members[_0x3fce0c]=_[_0x4e27('0x25')](members[_0x3fce0c],{'data1':members[_0x3fce0c]['data1']||_0x593af2[_0x4e27('0xb')],'data2':members[_0x3fce0c][_0x4e27('0x2a')]||_0x593af2['source'],'data3':members[_0x3fce0c][_0x4e27('0x28')]||_0x593af2['destination'],'uniqueid':members[_0x3fce0c]['uniqueid']||_0x593af2[_0x4e27('0x7')]});if(members[_0x3fce0c][_0x4e27('0x20')]){writeDB(members[_0x3fce0c]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 797d33e..8b1f549 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 _0xbfbb=['clone','calleridname','secondtransfereruniqueid','ATTENDED','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','mohtime','error','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','now','COMPLETEDBYAGENT','variable','queuestatus','queuecallerexitAt','value','toUpperCase','queueposition','queuecallerabandonAt','ABANDONED','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','membername','queuecallercompleteAt','TRANSFER','COMPLETEDBY','reason','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfer','transfertype','origtransfererexten','transfereelinkedid','queuecallerenterreason'];(function(_0x15733d,_0x5a6fb1){var _0x165f71=function(_0x1a7d8f){while(--_0x1a7d8f){_0x15733d['push'](_0x15733d['shift']());}};_0x165f71(++_0x5a6fb1);}(_0xbfbb,0xf7));var _0xbbfb=function(_0x3ac5de,_0x294003){_0x3ac5de=_0x3ac5de-0x0;var _0x1a96cd=_0xbfbb[_0x3ac5de];return _0x1a96cd;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var utils=require(_0xbbfb('0x2'));var queues={};function writeDB(_0x58851c){utils[_0xbbfb('0x3')](util[_0xbbfb('0x4')](_0xbbfb('0x5'),_0x58851c[_0xbbfb('0x6')],_0x58851c[_0xbbfb('0x7')],_0x58851c['queue'],_0x58851c[_0xbbfb('0x8')],_0x58851c[_0xbbfb('0x9')],_0x58851c[_0xbbfb('0xa')],_0x58851c[_0xbbfb('0xb')]));if(_0x58851c[_0xbbfb('0xc')]){utils[_0xbbfb('0xd')](_0x58851c[_0xbbfb('0xc')])[_0xbbfb('0xe')](function(_0xc575a3){if(_0xc575a3){_0x58851c[_0xbbfb('0xf')]=_0xc575a3[_0xbbfb('0xf')];}utils[_0xbbfb('0x10')](_0xbbfb('0x11'),_0x58851c);});}else{utils['request'](_0xbbfb('0x11'),_0x58851c);}if(_0x58851c[_0xbbfb('0x12')]){delete queues[_0x58851c[_0xbbfb('0x12')]];}else{delete queues[_0x58851c[_0xbbfb('0x6')]];}}exports[_0xbbfb('0x13')]=function(_0x4470b6){queues[_0x4470b6[_0xbbfb('0x6')]]=_[_0xbbfb('0x14')](_0x4470b6,{'originalposition':_0x4470b6[_0xbbfb('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports['hangup']=function(_0x3e60c3){if(!_[_0xbbfb('0x16')](queues[_0x3e60c3[_0xbbfb('0x6')]])){if(queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0x17')]){if(!queues[_0x3e60c3['uniqueid']][_0xbbfb('0x18')]&&!queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0x19')]){queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0x1a')]=!![];queues[_0x3e60c3[_0xbbfb('0x6')]]['queuecallercompleteAt']=utils[_0xbbfb('0x1b')]();queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0xb')]=_0xbbfb('0x1c');}writeDB(queues[_0x3e60c3['uniqueid']]);}else{if(queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0x12')]){queues[queues[_0x3e60c3[_0xbbfb('0x6')]][_0xbbfb('0x12')]]=queues[_0x3e60c3[_0xbbfb('0x6')]];queues[queues[_0x3e60c3[_0xbbfb('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x3e60c3[_0xbbfb('0x6')]];}}}};exports['varset']=function(_0x3f119b){if(!_[_0xbbfb('0x16')](_0x3f119b[_0xbbfb('0x1d')][_0xbbfb('0x1e')])){if(!_['isNil'](queues[_0x3f119b[_0xbbfb('0x6')]])){queues[_0x3f119b['uniqueid']][_0xbbfb('0x18')]=![];queues[_0x3f119b[_0xbbfb('0x6')]]['queuecallerabandonAt']=null;queues[_0x3f119b['uniqueid']][_0xbbfb('0x19')]=!![];queues[_0x3f119b['uniqueid']][_0xbbfb('0x1f')]=utils['now']();queues[_0x3f119b['uniqueid']][_0xbbfb('0xb')]=_0x3f119b[_0xbbfb('0x20')][_0xbbfb('0x21')]();writeDB(queues[_0x3f119b[_0xbbfb('0x6')]]);}}else if(!_[_0xbbfb('0x16')](_0x3f119b[_0xbbfb('0x1d')][_0xbbfb('0x22')])){if(!_['isNil'](queues[_0x3f119b[_0xbbfb('0x6')]])&&!queues[_0x3f119b[_0xbbfb('0x6')]][_0xbbfb('0x18')]){queues[_0x3f119b['uniqueid']]['queuecallerabandon']=![];queues[_0x3f119b[_0xbbfb('0x6')]][_0xbbfb('0x23')]=null;queues[_0x3f119b[_0xbbfb('0x6')]][_0xbbfb('0x19')]=!![];queues[_0x3f119b[_0xbbfb('0x6')]][_0xbbfb('0x1f')]=utils['now']();queues[_0x3f119b[_0xbbfb('0x6')]][_0xbbfb('0xb')]='EXITWITHKEY';}}};exports[_0xbbfb('0x18')]=function(_0x220fdc){if(!_[_0xbbfb('0x16')](queues[_0x220fdc['uniqueid']])){queues[_0x220fdc['uniqueid']][_0xbbfb('0x19')]=![];queues[_0x220fdc['uniqueid']][_0xbbfb('0x1f')]=null;queues[_0x220fdc[_0xbbfb('0x6')]][_0xbbfb('0x18')]=!![];queues[_0x220fdc[_0xbbfb('0x6')]][_0xbbfb('0x23')]=utils[_0xbbfb('0x1b')]();queues[_0x220fdc[_0xbbfb('0x6')]]['queuecallerexitreason']=_0xbbfb('0x24');}};exports['queuecallerleave']=function(_0x11f009){if(!_[_0xbbfb('0x16')](queues[_0x11f009['uniqueid']])){queues[_0x11f009[_0xbbfb('0x6')]]['queuecallerleave']=!![];queues[_0x11f009[_0xbbfb('0x6')]][_0xbbfb('0x17')]=utils['now']();queues[_0x11f009[_0xbbfb('0x6')]][_0xbbfb('0x25')]=utils[_0xbbfb('0x26')](queues[_0x11f009[_0xbbfb('0x6')]]['queuecallerleaveAt'],queues[_0x11f009[_0xbbfb('0x6')]][_0xbbfb('0x27')]);queues[_0x11f009[_0xbbfb('0x6')]][_0xbbfb('0x15')]=_0x11f009['position'];queues[_0x11f009['uniqueid']][_0xbbfb('0x28')]=_0x11f009[_0xbbfb('0x28')];queues[_0x11f009[_0xbbfb('0x6')]]['connectedlinenum']=_0x11f009[_0xbbfb('0x29')];queues[_0x11f009['uniqueid']][_0xbbfb('0x2a')]=_0x11f009[_0xbbfb('0x2a')];}};exports[_0xbbfb('0x2b')]=function(_0x1241a4){if(!_[_0xbbfb('0x16')](queues[_0x1241a4[_0xbbfb('0x6')]])){queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x18')]=![];queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x18')]=![];queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x23')]=null;queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x19')]=![];queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x1f')]=null;queues[_0x1241a4[_0xbbfb('0x6')]][_0xbbfb('0x2c')]=!![];queues[_0x1241a4[_0xbbfb('0x6')]]['accountcode']=_0x1241a4['destaccountcode'];queues[_0x1241a4[_0xbbfb('0x6')]]['lastAssignedTo']=_0x1241a4[_0xbbfb('0x2d')];}};exports['agentcomplete']=function(_0x111b16){if(!_[_0xbbfb('0x16')](queues[_0x111b16['uniqueid']])){if(queues[_0x111b16[_0xbbfb('0x6')]]['queuecallerleaveAt']){queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0x18')]=![];queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0x18')]=![];queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0x23')]=null;queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0x19')]=![];queues[_0x111b16[_0xbbfb('0x6')]]['queuecallerexitAt']=null;queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0x2c')]=!![];queues[_0x111b16[_0xbbfb('0x6')]]['lastAssignedTo']=_0x111b16[_0xbbfb('0x2d')];queues[_0x111b16[_0xbbfb('0x6')]]['queuecallercomplete']=!![];queues[_0x111b16['uniqueid']][_0xbbfb('0x2e')]=utils[_0xbbfb('0x1b')]();if(_0x111b16['reason']=='transfer'){if(!queues[_0x111b16[_0xbbfb('0x6')]]['transfer']){queues[_0x111b16[_0xbbfb('0x6')]][_0xbbfb('0xb')]=_0xbbfb('0x2f');}}else{queues[_0x111b16['uniqueid']][_0xbbfb('0xb')]=_0xbbfb('0x30')+_0x111b16[_0xbbfb('0x31')][_0xbbfb('0x21')]();}writeDB(queues[_0x111b16['uniqueid']]);}}};exports['blindtransfer']=function(_0x37f61a){if(!_[_0xbbfb('0x16')](queues[_0x37f61a[_0xbbfb('0x32')]])){queues[_0x37f61a[_0xbbfb('0x32')]]['transfer']=!![];queues[_0x37f61a[_0xbbfb('0x32')]]['transfertype']=_0xbbfb('0x33');queues[_0x37f61a[_0xbbfb('0x32')]][_0xbbfb('0x34')]=_0x37f61a[_0xbbfb('0x35')];queues[_0x37f61a['transfereeuniqueid']][_0xbbfb('0x36')]=_0x37f61a[_0xbbfb('0x32')];queues[_0x37f61a[_0xbbfb('0x32')]][_0xbbfb('0xb')]=_0xbbfb('0x37');}};exports[_0xbbfb('0x38')]=function(_0x523b18){try{if(_0x523b18[_0xbbfb('0x39')]==_0x523b18[_0xbbfb('0x3a')]){if(!_[_0xbbfb('0x16')](queues[_0x523b18[_0xbbfb('0x3b')]])){queues[_0x523b18['secondtransfererlinkedid']][_0xbbfb('0x3c')]=!![];queues[_0x523b18['secondtransfererlinkedid']][_0xbbfb('0x3d')]='ATTENDED';queues[_0x523b18['secondtransfererlinkedid']]['transferexten']=_0x523b18[_0xbbfb('0x3e')];queues[_0x523b18[_0xbbfb('0x3b')]][_0xbbfb('0x36')]=_0x523b18['origtransfereruniqueid'];queues[_0x523b18[_0xbbfb('0x3b')]][_0xbbfb('0xb')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x523b18[_0xbbfb('0x3a')]])){if(_0x523b18['transfereelinkedid']&&queues[_0x523b18[_0xbbfb('0x3f')]]){queues[_0x523b18[_0xbbfb('0x3f')]][_0xbbfb('0x40')]=0x1;queues[_0x523b18[_0xbbfb('0x32')]]=_[_0xbbfb('0x41')](queues[_0x523b18['transfereelinkedid']]);queues[_0x523b18[_0xbbfb('0x32')]]['transfereduniqueid']=_0x523b18['transfertargetuniqueid'];queues[_0x523b18[_0xbbfb('0x32')]]['queuecallerenterreason']=0x2;queues[_0x523b18[_0xbbfb('0x32')]]['calleridnum']=queues[_0x523b18['secondtransfererlinkedid']][_0xbbfb('0x9')];queues[_0x523b18[_0xbbfb('0x32')]][_0xbbfb('0x42')]=queues[_0x523b18[_0xbbfb('0x3b')]][_0xbbfb('0x42')];queues[_0x523b18['transfereeuniqueid']][_0xbbfb('0x27')]=utils[_0xbbfb('0x1b')]();queues[_0x523b18['transfereeuniqueid']][_0xbbfb('0x17')]=utils[_0xbbfb('0x1b')]();queues[_0x523b18[_0xbbfb('0x32')]][_0xbbfb('0x25')]=0x0;queues[_0x523b18['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0x523b18[_0xbbfb('0x3a')]]['transfereduniqueid']=_0x523b18[_0xbbfb('0x3b')];}}}else if(_0x523b18[_0xbbfb('0x43')]==_0x523b18[_0xbbfb('0x3b')]){if(!_[_0xbbfb('0x16')](queues[_0x523b18[_0xbbfb('0x3a')]])){queues[_0x523b18[_0xbbfb('0x3a')]][_0xbbfb('0x3c')]=!![];queues[_0x523b18[_0xbbfb('0x3a')]][_0xbbfb('0x3d')]=_0xbbfb('0x44');queues[_0x523b18[_0xbbfb('0x3a')]][_0xbbfb('0x34')]=_0x523b18[_0xbbfb('0x45')];queues[_0x523b18[_0xbbfb('0x3a')]][_0xbbfb('0x36')]=_0x523b18['secondtransfereruniqueid'];queues[_0x523b18[_0xbbfb('0x3a')]]['queuecallerexitreason']=_0xbbfb('0x46');}if(!_['isNil'](queues[_0x523b18['secondtransfererlinkedid']])){if(_0x523b18[_0xbbfb('0x47')]&&queues[_0x523b18[_0xbbfb('0x47')]]){queues[_0x523b18['transfertargetlinkedid']][_0xbbfb('0x40')]=0x1;queues[_0x523b18[_0xbbfb('0x48')]]=_[_0xbbfb('0x41')](queues[_0x523b18['transfertargetlinkedid']]);queues[_0x523b18[_0xbbfb('0x48')]][_0xbbfb('0x12')]=_0x523b18[_0xbbfb('0x48')];queues[_0x523b18['transfertargetuniqueid']][_0xbbfb('0x40')]=0x2;queues[_0x523b18[_0xbbfb('0x48')]][_0xbbfb('0x9')]=queues[_0x523b18[_0xbbfb('0x3a')]]['calleridnum'];queues[_0x523b18[_0xbbfb('0x48')]][_0xbbfb('0x42')]=queues[_0x523b18[_0xbbfb('0x3a')]][_0xbbfb('0x42')];queues[_0x523b18['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xbbfb('0x1b')]();queues[_0x523b18['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xbbfb('0x1b')]();queues[_0x523b18[_0xbbfb('0x48')]][_0xbbfb('0x25')]=0x0;queues[_0x523b18[_0xbbfb('0x48')]][_0xbbfb('0x49')]=0x0;}else{queues[_0x523b18['secondtransfererlinkedid']]['transfereduniqueid']=_0x523b18[_0xbbfb('0x3a')];}}}}catch(_0x5c3429){utils[_0xbbfb('0x4a')](_0x5c3429[_0xbbfb('0x4b')]);}};exports['musiconholdstart']=function(_0x50ade8){if(!_['isNil'](queues[_0x50ade8['uniqueid']])){queues[_0x50ade8['uniqueid']][_0xbbfb('0x4c')]=utils['now']();}};exports[_0xbbfb('0x4d')]=function(_0x32bed7){if(!_[_0xbbfb('0x16')](queues[_0x32bed7['uniqueid']])){if(!_[_0xbbfb('0x16')](queues[_0x32bed7[_0xbbfb('0x6')]]['musiconholdstartAt'])){queues[_0x32bed7[_0xbbfb('0x6')]][_0xbbfb('0x49')]+=utils[_0xbbfb('0x26')](utils[_0xbbfb('0x1b')](),queues[_0x32bed7[_0xbbfb('0x6')]][_0xbbfb('0x4c')]);delete queues[_0x32bed7[_0xbbfb('0x6')]]['musiconholdstartAt'];}}}; \ No newline at end of file +var _0x273f=['origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','holdtime','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','calleridname','stack','musiconholdstartAt','lodash','util','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','diffTime','queuecallerjoinAt','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer'];(function(_0x47ed84,_0x304407){var _0x29849c=function(_0x4c0c34){while(--_0x4c0c34){_0x47ed84['push'](_0x47ed84['shift']());}};_0x29849c(++_0x304407);}(_0x273f,0x188));var _0xf273=function(_0x3e8b22,_0x3b11ea){_0x3e8b22=_0x3e8b22-0x0;var _0x1d593c=_0x273f[_0x3e8b22];return _0x1d593c;};'use strict';var _=require(_0xf273('0x0'));var util=require(_0xf273('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x311b3b){utils[_0xf273('0x2')](util['format'](_0xf273('0x3'),_0x311b3b[_0xf273('0x4')],_0x311b3b[_0xf273('0x5')],_0x311b3b['queue'],_0x311b3b[_0xf273('0x6')],_0x311b3b[_0xf273('0x7')],_0x311b3b[_0xf273('0x8')],_0x311b3b[_0xf273('0x9')]));if(_0x311b3b[_0xf273('0xa')]){utils[_0xf273('0xb')](_0x311b3b[_0xf273('0xa')])[_0xf273('0xc')](function(_0x340562){if(_0x340562){_0x311b3b[_0xf273('0xd')]=_0x340562[_0xf273('0xd')];}utils[_0xf273('0xe')]('CreateVoiceQueueReport',_0x311b3b);});}else{utils['request'](_0xf273('0xf'),_0x311b3b);}if(_0x311b3b[_0xf273('0x10')]){delete queues[_0x311b3b['transfereduniqueid']];}else{delete queues[_0x311b3b[_0xf273('0x4')]];}}exports[_0xf273('0x11')]=function(_0x14d858){queues[_0x14d858[_0xf273('0x4')]]=_['assign'](_0x14d858,{'originalposition':_0x14d858[_0xf273('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports['hangup']=function(_0x16736c){if(!_[_0xf273('0x13')](queues[_0x16736c['uniqueid']])){if(queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x14')]){if(!queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x15')]&&!queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x16')]){queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x17')]=!![];queues[_0x16736c['uniqueid']][_0xf273('0x18')]=utils[_0xf273('0x19')]();queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x9')]=_0xf273('0x1a');}writeDB(queues[_0x16736c['uniqueid']]);}else{if(queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x10')]){queues[queues[_0x16736c['uniqueid']][_0xf273('0x10')]]=queues[_0x16736c[_0xf273('0x4')]];queues[queues[_0x16736c[_0xf273('0x4')]][_0xf273('0x10')]][_0xf273('0x1b')]=0x2;delete queues[_0x16736c[_0xf273('0x4')]];}}}};exports['varset']=function(_0x4d4b4d){if(!_[_0xf273('0x13')](_0x4d4b4d[_0xf273('0x1c')][_0xf273('0x1d')])){if(!_[_0xf273('0x13')](queues[_0x4d4b4d[_0xf273('0x4')]])){queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x15')]=![];queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x1e')]=null;queues[_0x4d4b4d[_0xf273('0x4')]]['queuecallerexit']=!![];queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x1f')]=utils['now']();queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x9')]=_0x4d4b4d[_0xf273('0x20')][_0xf273('0x21')]();writeDB(queues[_0x4d4b4d[_0xf273('0x4')]]);}}else if(!_[_0xf273('0x13')](_0x4d4b4d[_0xf273('0x1c')][_0xf273('0x22')])){if(!_['isNil'](queues[_0x4d4b4d[_0xf273('0x4')]])&&!queues[_0x4d4b4d['uniqueid']][_0xf273('0x15')]){queues[_0x4d4b4d[_0xf273('0x4')]]['queuecallerabandon']=![];queues[_0x4d4b4d['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x16')]=!![];queues[_0x4d4b4d[_0xf273('0x4')]][_0xf273('0x1f')]=utils['now']();queues[_0x4d4b4d['uniqueid']]['queuecallerexitreason']=_0xf273('0x23');}}};exports[_0xf273('0x15')]=function(_0x12e5be){if(!_[_0xf273('0x13')](queues[_0x12e5be[_0xf273('0x4')]])){queues[_0x12e5be[_0xf273('0x4')]][_0xf273('0x16')]=![];queues[_0x12e5be[_0xf273('0x4')]][_0xf273('0x1f')]=null;queues[_0x12e5be[_0xf273('0x4')]]['queuecallerabandon']=!![];queues[_0x12e5be[_0xf273('0x4')]][_0xf273('0x1e')]=utils[_0xf273('0x19')]();queues[_0x12e5be[_0xf273('0x4')]]['queuecallerexitreason']=_0xf273('0x24');}};exports[_0xf273('0x25')]=function(_0x2430fc){if(!_['isNil'](queues[_0x2430fc['uniqueid']])){queues[_0x2430fc[_0xf273('0x4')]][_0xf273('0x25')]=!![];queues[_0x2430fc[_0xf273('0x4')]][_0xf273('0x14')]=utils[_0xf273('0x19')]();queues[_0x2430fc[_0xf273('0x4')]]['holdtime']=utils[_0xf273('0x26')](queues[_0x2430fc['uniqueid']][_0xf273('0x14')],queues[_0x2430fc[_0xf273('0x4')]][_0xf273('0x27')]);queues[_0x2430fc[_0xf273('0x4')]]['position']=_0x2430fc[_0xf273('0x12')];queues[_0x2430fc[_0xf273('0x4')]]['count']=_0x2430fc['count'];queues[_0x2430fc['uniqueid']]['connectedlinenum']=_0x2430fc[_0xf273('0x28')];queues[_0x2430fc['uniqueid']][_0xf273('0x29')]=_0x2430fc[_0xf273('0x29')];}};exports[_0xf273('0x2a')]=function(_0x4f724c){if(!_[_0xf273('0x13')](queues[_0x4f724c[_0xf273('0x4')]])){queues[_0x4f724c[_0xf273('0x4')]][_0xf273('0x15')]=![];queues[_0x4f724c[_0xf273('0x4')]][_0xf273('0x15')]=![];queues[_0x4f724c['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4f724c[_0xf273('0x4')]][_0xf273('0x16')]=![];queues[_0x4f724c['uniqueid']]['queuecallerexitAt']=null;queues[_0x4f724c['uniqueid']][_0xf273('0x2b')]=!![];queues[_0x4f724c[_0xf273('0x4')]][_0xf273('0x8')]=_0x4f724c[_0xf273('0x2c')];queues[_0x4f724c[_0xf273('0x4')]][_0xf273('0x6')]=_0x4f724c[_0xf273('0x2d')];}};exports['agentcomplete']=function(_0x2b39e1){if(!_[_0xf273('0x13')](queues[_0x2b39e1[_0xf273('0x4')]])){if(queues[_0x2b39e1[_0xf273('0x4')]]['queuecallerleaveAt']){queues[_0x2b39e1[_0xf273('0x4')]]['queuecallerabandon']=![];queues[_0x2b39e1[_0xf273('0x4')]]['queuecallerabandon']=![];queues[_0x2b39e1[_0xf273('0x4')]]['queuecallerabandonAt']=null;queues[_0x2b39e1['uniqueid']][_0xf273('0x16')]=![];queues[_0x2b39e1[_0xf273('0x4')]][_0xf273('0x1f')]=null;queues[_0x2b39e1[_0xf273('0x4')]]['assigned']=!![];queues[_0x2b39e1[_0xf273('0x4')]]['lastAssignedTo']=_0x2b39e1[_0xf273('0x2d')];queues[_0x2b39e1['uniqueid']]['queuecallercomplete']=!![];queues[_0x2b39e1[_0xf273('0x4')]][_0xf273('0x18')]=utils['now']();if(_0x2b39e1[_0xf273('0x2e')]==_0xf273('0x2f')){if(!queues[_0x2b39e1[_0xf273('0x4')]][_0xf273('0x2f')]){queues[_0x2b39e1['uniqueid']][_0xf273('0x9')]='TRANSFER';}}else{queues[_0x2b39e1[_0xf273('0x4')]]['queuecallerexitreason']=_0xf273('0x30')+_0x2b39e1[_0xf273('0x2e')][_0xf273('0x21')]();}writeDB(queues[_0x2b39e1[_0xf273('0x4')]]);}}};exports[_0xf273('0x31')]=function(_0x9b24b9){if(!_['isNil'](queues[_0x9b24b9['transfereeuniqueid']])){queues[_0x9b24b9['transfereeuniqueid']][_0xf273('0x2f')]=!![];queues[_0x9b24b9[_0xf273('0x32')]][_0xf273('0x33')]=_0xf273('0x34');queues[_0x9b24b9[_0xf273('0x32')]][_0xf273('0x35')]=_0x9b24b9[_0xf273('0x36')];queues[_0x9b24b9[_0xf273('0x32')]][_0xf273('0x37')]=_0x9b24b9[_0xf273('0x32')];queues[_0x9b24b9['transfereeuniqueid']]['queuecallerexitreason']=_0xf273('0x38');}};exports[_0xf273('0x39')]=function(_0x21ec36){try{if(_0x21ec36['origtransfereruniqueid']==_0x21ec36[_0xf273('0x3a')]){if(!_[_0xf273('0x13')](queues[_0x21ec36[_0xf273('0x3b')]])){queues[_0x21ec36['secondtransfererlinkedid']][_0xf273('0x2f')]=!![];queues[_0x21ec36['secondtransfererlinkedid']][_0xf273('0x33')]='ATTENDED';queues[_0x21ec36['secondtransfererlinkedid']][_0xf273('0x35')]=_0x21ec36[_0xf273('0x3c')];queues[_0x21ec36['secondtransfererlinkedid']][_0xf273('0x37')]=_0x21ec36[_0xf273('0x3d')];queues[_0x21ec36['secondtransfererlinkedid']]['queuecallerexitreason']=_0xf273('0x3e');}if(!_[_0xf273('0x13')](queues[_0x21ec36[_0xf273('0x3a')]])){if(_0x21ec36[_0xf273('0x3f')]&&queues[_0x21ec36['transfereelinkedid']]){queues[_0x21ec36[_0xf273('0x3f')]][_0xf273('0x1b')]=0x1;queues[_0x21ec36[_0xf273('0x32')]]=_[_0xf273('0x40')](queues[_0x21ec36[_0xf273('0x3f')]]);queues[_0x21ec36['transfereeuniqueid']][_0xf273('0x10')]=_0x21ec36['transfertargetuniqueid'];queues[_0x21ec36[_0xf273('0x32')]]['queuecallerenterreason']=0x2;queues[_0x21ec36['transfereeuniqueid']]['calleridnum']=queues[_0x21ec36[_0xf273('0x3b')]]['calleridnum'];queues[_0x21ec36[_0xf273('0x32')]]['calleridname']=queues[_0x21ec36[_0xf273('0x3b')]]['calleridname'];queues[_0x21ec36[_0xf273('0x32')]][_0xf273('0x27')]=utils[_0xf273('0x19')]();queues[_0x21ec36[_0xf273('0x32')]][_0xf273('0x14')]=utils[_0xf273('0x19')]();queues[_0x21ec36[_0xf273('0x32')]][_0xf273('0x41')]=0x0;queues[_0x21ec36['transfereeuniqueid']][_0xf273('0x42')]=0x0;}else{queues[_0x21ec36[_0xf273('0x3a')]][_0xf273('0x10')]=_0x21ec36['secondtransfererlinkedid'];}}}else if(_0x21ec36[_0xf273('0x43')]==_0x21ec36[_0xf273('0x3b')]){if(!_['isNil'](queues[_0x21ec36['origtransfererlinkedid']])){queues[_0x21ec36[_0xf273('0x3a')]]['transfer']=!![];queues[_0x21ec36['origtransfererlinkedid']]['transfertype']=_0xf273('0x44');queues[_0x21ec36[_0xf273('0x3a')]]['transferexten']=_0x21ec36[_0xf273('0x45')];queues[_0x21ec36[_0xf273('0x3a')]][_0xf273('0x37')]=_0x21ec36[_0xf273('0x43')];queues[_0x21ec36['origtransfererlinkedid']]['queuecallerexitreason']=_0xf273('0x3e');}if(!_['isNil'](queues[_0x21ec36[_0xf273('0x3b')]])){if(_0x21ec36['transfertargetlinkedid']&&queues[_0x21ec36[_0xf273('0x46')]]){queues[_0x21ec36[_0xf273('0x46')]][_0xf273('0x1b')]=0x1;queues[_0x21ec36[_0xf273('0x47')]]=_['clone'](queues[_0x21ec36['transfertargetlinkedid']]);queues[_0x21ec36['transfertargetuniqueid']]['transfereduniqueid']=_0x21ec36['transfertargetuniqueid'];queues[_0x21ec36[_0xf273('0x47')]][_0xf273('0x1b')]=0x2;queues[_0x21ec36['transfertargetuniqueid']]['calleridnum']=queues[_0x21ec36[_0xf273('0x3a')]]['calleridnum'];queues[_0x21ec36[_0xf273('0x47')]][_0xf273('0x48')]=queues[_0x21ec36['origtransfererlinkedid']][_0xf273('0x48')];queues[_0x21ec36[_0xf273('0x47')]][_0xf273('0x27')]=utils[_0xf273('0x19')]();queues[_0x21ec36[_0xf273('0x47')]]['queuecallerleaveAt']=utils[_0xf273('0x19')]();queues[_0x21ec36[_0xf273('0x47')]][_0xf273('0x41')]=0x0;queues[_0x21ec36[_0xf273('0x47')]][_0xf273('0x42')]=0x0;}else{queues[_0x21ec36[_0xf273('0x3b')]]['transfereduniqueid']=_0x21ec36[_0xf273('0x3a')];}}}}catch(_0x54210f){utils['error'](_0x54210f[_0xf273('0x49')]);}};exports['musiconholdstart']=function(_0x2c86a9){if(!_[_0xf273('0x13')](queues[_0x2c86a9[_0xf273('0x4')]])){queues[_0x2c86a9[_0xf273('0x4')]][_0xf273('0x4a')]=utils[_0xf273('0x19')]();}};exports['musiconholdstop']=function(_0x4cf50c){if(!_[_0xf273('0x13')](queues[_0x4cf50c[_0xf273('0x4')]])){if(!_[_0xf273('0x13')](queues[_0x4cf50c[_0xf273('0x4')]][_0xf273('0x4a')])){queues[_0x4cf50c['uniqueid']]['mohtime']+=utils[_0xf273('0x26')](utils[_0xf273('0x19')](),queues[_0x4cf50c[_0xf273('0x4')]][_0xf273('0x4a')]);delete queues[_0x4cf50c[_0xf273('0x4')]][_0xf273('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d75d635..9c9d57b 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x5ce91c,_0x329114){var _0x1c4b84=function(_0x1de8dd){while(--_0x1de8dd){_0x5ce91c['push'](_0x5ce91c['shift']());}};_0x1c4b84(++_0x329114);}(_0xe706,0xa3));var _0x6e70=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0xe706[_0x53f608];return _0x495b7d;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file +var _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a60a9a3..a4cdf6a 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 _0xadb1=['error','stack','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','request','CreateVoiceTransferReport','blindtransfer','blind'];(function(_0x2cf648,_0x595257){var _0x49ec5f=function(_0xbb0bf3){while(--_0xbb0bf3){_0x2cf648['push'](_0x2cf648['shift']());}};_0x49ec5f(++_0x595257);}(_0xadb1,0x7a));var _0x1adb=function(_0x101bfb,_0x1adf6f){_0x101bfb=_0x101bfb-0x0;var _0x9f990=_0xadb1[_0x101bfb];return _0x9f990;};'use strict';var _=require(_0x1adb('0x0'));var util=require(_0x1adb('0x1'));var utils=require(_0x1adb('0x2'));function writeDB(_0x511a3e){utils[_0x1adb('0x3')](util[_0x1adb('0x4')]('TRANSFER|%s',_0x511a3e[_0x1adb('0x5')]));utils[_0x1adb('0x6')](_0x1adb('0x7'),_0x511a3e);}exports[_0x1adb('0x8')]=function(_0x120969){try{_0x120969['type']=_0x1adb('0x9');writeDB(_0x120969);}catch(_0x46b16f){utils[_0x1adb('0xa')](_0x46b16f[_0x1adb('0xb')]);}};exports['attendedtransfer']=function(_0x230081){try{_0x230081=_[_0x1adb('0xc')](_0x230081,{'transfererchannel':_0x230081[_0x1adb('0xd')],'transferercalleridnum':_0x230081['origtransferercalleridnum'],'transferercalleridname':_0x230081['origtransferercalleridname'],'transfererconnectedlinenum':_0x230081[_0x1adb('0xe')],'transfererconnectedlinename':_0x230081[_0x1adb('0xf')],'transfereraccountcode':_0x230081[_0x1adb('0x10')],'transferercontext':_0x230081[_0x1adb('0x11')],'transfererexten':_0x230081[_0x1adb('0x12')],'transfererlinkedid':_0x230081[_0x1adb('0x13')],'context':_0x230081[_0x1adb('0x14')],'extension':_0x230081[_0x1adb('0x15')],'type':_0x1adb('0x16')});if(_[_0x1adb('0x17')](_0x230081[_0x1adb('0x18')])){_0x230081=_[_0x1adb('0xc')](_0x230081,{'transfereechannel':_0x230081[_0x1adb('0x19')],'transfereecalleridnum':_0x230081[_0x1adb('0x1a')],'transfereecalleridname':_0x230081[_0x1adb('0x1b')],'transfereeconnectedlinenum':_0x230081[_0x1adb('0x1c')],'transfereeconnectedlinename':_0x230081['transfertargetconnectedlinename'],'transfereeaccountcode':_0x230081[_0x1adb('0x1d')],'transfereecontext':_0x230081[_0x1adb('0x1e')],'transfereeexten':_0x230081[_0x1adb('0x1f')],'transfereelinkedid':_0x230081[_0x1adb('0x20')]});}writeDB(_0x230081);}catch(_0xdc1165){utils['error'](_0xdc1165[_0x1adb('0xb')]);}}; \ No newline at end of file +var _0x36d3=['transfertargetlinkedid','util','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','error','stack','attendedtransfer','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten'];(function(_0x5be67b,_0x570b9b){var _0x3d01cc=function(_0x56891b){while(--_0x56891b){_0x5be67b['push'](_0x5be67b['shift']());}};_0x3d01cc(++_0x570b9b);}(_0x36d3,0x1c3));var _0x336d=function(_0x41cd39,_0x3db073){_0x41cd39=_0x41cd39-0x0;var _0x33640b=_0x36d3[_0x41cd39];return _0x33640b;};'use strict';var _=require('lodash');var util=require(_0x336d('0x0'));var utils=require('./utils');function writeDB(_0x289ab6){utils[_0x336d('0x1')](util[_0x336d('0x2')](_0x336d('0x3'),_0x289ab6[_0x336d('0x4')]));utils[_0x336d('0x5')](_0x336d('0x6'),_0x289ab6);}exports[_0x336d('0x7')]=function(_0x28d3c6){try{_0x28d3c6[_0x336d('0x4')]='blind';writeDB(_0x28d3c6);}catch(_0x4f8ecf){utils[_0x336d('0x8')](_0x4f8ecf[_0x336d('0x9')]);}};exports[_0x336d('0xa')]=function(_0xad4bb){try{_0xad4bb=_[_0x336d('0xb')](_0xad4bb,{'transfererchannel':_0xad4bb['origtransfererchannel'],'transferercalleridnum':_0xad4bb['origtransferercalleridnum'],'transferercalleridname':_0xad4bb[_0x336d('0xc')],'transfererconnectedlinenum':_0xad4bb[_0x336d('0xd')],'transfererconnectedlinename':_0xad4bb[_0x336d('0xe')],'transfereraccountcode':_0xad4bb['origtransfereraccountcode'],'transferercontext':_0xad4bb[_0x336d('0xf')],'transfererexten':_0xad4bb[_0x336d('0x10')],'transfererlinkedid':_0xad4bb[_0x336d('0x11')],'context':_0xad4bb[_0x336d('0x12')],'extension':_0xad4bb[_0x336d('0x13')],'type':_0x336d('0x14')});if(_[_0x336d('0x15')](_0xad4bb[_0x336d('0x16')])){_0xad4bb=_[_0x336d('0xb')](_0xad4bb,{'transfereechannel':_0xad4bb[_0x336d('0x17')],'transfereecalleridnum':_0xad4bb[_0x336d('0x18')],'transfereecalleridname':_0xad4bb['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xad4bb['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xad4bb[_0x336d('0x19')],'transfereeaccountcode':_0xad4bb[_0x336d('0x1a')],'transfereecontext':_0xad4bb[_0x336d('0x1b')],'transfereeexten':_0xad4bb[_0x336d('0x1c')],'transfereelinkedid':_0xad4bb[_0x336d('0x1d')]});}writeDB(_0xad4bb);}catch(_0x3bb99e){utils[_0x336d('0x8')](_0x3bb99e[_0x336d('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3a83c8b..2642a68 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 _0xb0fc=['getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isBefore','jayson/promise','moment','bluebird','client','http','xdr','debug','stringify','error','stack','request','then','catch','GetUser','internal','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal'];(function(_0x34da86,_0x33235f){var _0x422427=function(_0x484d50){while(--_0x484d50){_0x34da86['push'](_0x34da86['shift']());}};_0x422427(++_0x33235f);}(_0xb0fc,0x8a));var _0xcb0f=function(_0xf96ff1,_0x1db6e7){_0xf96ff1=_0xf96ff1-0x0;var _0x1f4042=_0xb0fc[_0xf96ff1];return _0x1f4042;};'use strict';var jayson=require(_0xcb0f('0x0'));var moment=require(_0xcb0f('0x1'));var BPromise=require(_0xcb0f('0x2'));var client=jayson[_0xcb0f('0x3')][_0xcb0f('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xcb0f('0x5'));exports['info']=function(_0x1eac20){logger['info'](_0x1eac20);};exports[_0xcb0f('0x6')]=function(_0xe31b2b){logger[_0xcb0f('0x6')](JSON[_0xcb0f('0x7')](_0xe31b2b));};exports[_0xcb0f('0x8')]=function(_0xfb9995){logger[_0xcb0f('0x8')](_0xfb9995[_0xcb0f('0x9')]);};exports['request']=function(_0x5d3a6c,_0x296183){return client[_0xcb0f('0xa')](_0x5d3a6c,{'body':_0x296183})[_0xcb0f('0xb')](function(_0x5b48ca){logger[_0xcb0f('0x6')](JSON['stringify'](_0x5b48ca));})[_0xcb0f('0xc')](function(_0x2db565){logger['error'](_0x2db565['stack']);});};function getUser(_0x48b57b){return client[_0xcb0f('0xa')](_0xcb0f('0xd'),{'options':{'raw':!![],'attributes':['id',_0xcb0f('0xe'),'name',_0xcb0f('0xf')],'where':_0x48b57b,'limit':0x1}})[_0xcb0f('0xb')](function(_0x44e0fc){logger['info'](_0xcb0f('0x10')+JSON[_0xcb0f('0x7')](_0x48b57b)+'|'+(_0x44e0fc[_0xcb0f('0x11')][_0xcb0f('0x12')]?_0xcb0f('0x13'):_0xcb0f('0x14')));return _0x44e0fc['result'][_0xcb0f('0x12')]?_0x44e0fc['result'][0x0]:null;});}exports[_0xcb0f('0x15')]=function(_0x5733f5){return new BPromise(function(_0x299280,_0x193702){if(_0x5733f5){return getUser({'internal':_0x5733f5})[_0xcb0f('0xb')](function(_0x7d3fdf){return _0x299280(_0x7d3fdf);})[_0xcb0f('0xc')](function(_0x3d2157){logger['error'](_0x3d2157[_0xcb0f('0x9')]);return _0x299280(null);});}else{return _0x299280(null);}});};exports[_0xcb0f('0x16')]=function(_0x24c597){return new BPromise(function(_0x1a27db,_0xbd7e59){if(_0x24c597){return getUser({'interface':_0x24c597})[_0xcb0f('0xb')](function(_0x8b5bf5){return _0x1a27db(_0x8b5bf5);})['catch'](function(_0x74ddee){logger[_0xcb0f('0x8')](_0x74ddee[_0xcb0f('0x9')]);return _0x1a27db(null);});}else{return _0x1a27db(null);}});};exports[_0xcb0f('0x17')]=function(_0xeb8689){return new BPromise(function(_0x1f1cdd,_0x2d8447){if(_0xeb8689){return getUser({'name':_0xeb8689})[_0xcb0f('0xb')](function(_0x56d64b){return _0x1f1cdd(_0x56d64b);})[_0xcb0f('0xc')](function(_0x3a7785){logger[_0xcb0f('0x8')](_0x3a7785['stack']);return _0x1f1cdd(null);});}else{return _0x1f1cdd(null);}});};exports[_0xcb0f('0x18')]=function(_0x5084bd){return new BPromise(function(_0x1fd39d,_0xbdffea){if(_0x5084bd){return client[_0xcb0f('0xa')](_0xcb0f('0x19'),{'options':{'raw':!![],'attributes':['id',_0xcb0f('0x1a'),_0xcb0f('0x1b'),_0xcb0f('0x1c'),_0xcb0f('0x1d')],'where':{'name':_0x5084bd},'limit':0x1}})['then'](function(_0x4607d7){logger['info'](_0xcb0f('0x1e')+_0x5084bd+'|'+(_0x4607d7[_0xcb0f('0x11')][_0xcb0f('0x12')]?_0xcb0f('0x13'):_0xcb0f('0x14')));return _0x1fd39d(_0x4607d7[_0xcb0f('0x11')]['length']?_0x4607d7[_0xcb0f('0x11')][0x0]:null);})[_0xcb0f('0xc')](function(_0x2de321){logger['error'](_0x2de321[_0xcb0f('0x9')]);return _0x1fd39d(null);});}else{return _0x1fd39d(null);}});};exports['addTime']=function(_0x125400,_0x106581){return moment(_0x125400)['add'](_0x106581,'seconds')[_0xcb0f('0x1f')](_0xcb0f('0x20'));};exports[_0xcb0f('0x21')]=function(_0x59d9c8,_0x33d591){return moment(_0x59d9c8)[_0xcb0f('0x22')](_0x33d591,'seconds')[_0xcb0f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xcb0f('0x23')]=function(_0x368f8b,_0x5ec728){return moment(_0x368f8b)[_0xcb0f('0x24')](moment(_0x5ec728),'seconds');};exports[_0xcb0f('0x25')]=function(_0x215c61,_0x4d43ca){return parseInt(_0x215c61,0xa)+parseInt(_0x4d43ca,0xa);};exports[_0xcb0f('0x26')]=function(){return moment()[_0xcb0f('0x1f')](_0xcb0f('0x20'));};exports['isAfter']=function(_0x1d967e,_0x35d93b){if(_0x35d93b){return moment(_0x1d967e)['isAfter'](_0x35d93b);}else{return!![];}};exports[_0xcb0f('0x27')]=function(_0x414b0d,_0x200e98){if(_0x200e98){return moment(_0x414b0d)['isBefore'](_0x200e98);}else if(_0x414b0d){return!![];}else{return![];}}; \ No newline at end of file +var _0x1bf4=['isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','name','GETUSER|','FOUND','NOTFOUND','result','length','getUserByInternal','getUserByInterface','getUserByName','GetVoiceQueue','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1bf4,0x1a6));var _0x41bf=function(_0x411b68,_0x52e768){_0x411b68=_0x411b68-0x0;var _0x41ff90=_0x1bf4[_0x411b68];return _0x41ff90;};'use strict';var jayson=require(_0x41bf('0x0'));var moment=require(_0x41bf('0x1'));var BPromise=require(_0x41bf('0x2'));var client=jayson[_0x41bf('0x3')][_0x41bf('0x4')]({'port':0x2329});var logger=require(_0x41bf('0x5'))(_0x41bf('0x6'));exports['info']=function(_0x114d94){logger[_0x41bf('0x7')](_0x114d94);};exports['debug']=function(_0x4e302c){logger[_0x41bf('0x8')](JSON[_0x41bf('0x9')](_0x4e302c));};exports[_0x41bf('0xa')]=function(_0x101138){logger[_0x41bf('0xa')](_0x101138[_0x41bf('0xb')]);};exports[_0x41bf('0xc')]=function(_0x85e485,_0x2cb585){return client[_0x41bf('0xc')](_0x85e485,{'body':_0x2cb585})[_0x41bf('0xd')](function(_0x44e38c){logger[_0x41bf('0x8')](JSON[_0x41bf('0x9')](_0x44e38c));})[_0x41bf('0xe')](function(_0x38eeb7){logger[_0x41bf('0xa')](_0x38eeb7[_0x41bf('0xb')]);});};function getUser(_0x21e516){return client[_0x41bf('0xc')](_0x41bf('0xf'),{'options':{'raw':!![],'attributes':['id',_0x41bf('0x10'),_0x41bf('0x11'),'interface'],'where':_0x21e516,'limit':0x1}})['then'](function(_0x36a6ee){logger[_0x41bf('0x7')](_0x41bf('0x12')+JSON[_0x41bf('0x9')](_0x21e516)+'|'+(_0x36a6ee['result']['length']?_0x41bf('0x13'):_0x41bf('0x14')));return _0x36a6ee[_0x41bf('0x15')][_0x41bf('0x16')]?_0x36a6ee['result'][0x0]:null;});}exports[_0x41bf('0x17')]=function(_0x54eedb){return new BPromise(function(_0x54c1ac,_0x298d88){if(_0x54eedb){return getUser({'internal':_0x54eedb})['then'](function(_0x2c57d8){return _0x54c1ac(_0x2c57d8);})[_0x41bf('0xe')](function(_0x1a0664){logger[_0x41bf('0xa')](_0x1a0664[_0x41bf('0xb')]);return _0x54c1ac(null);});}else{return _0x54c1ac(null);}});};exports[_0x41bf('0x18')]=function(_0x16225b){return new BPromise(function(_0x43c01d,_0xf78925){if(_0x16225b){return getUser({'interface':_0x16225b})[_0x41bf('0xd')](function(_0x1ff810){return _0x43c01d(_0x1ff810);})[_0x41bf('0xe')](function(_0x513b92){logger[_0x41bf('0xa')](_0x513b92['stack']);return _0x43c01d(null);});}else{return _0x43c01d(null);}});};exports[_0x41bf('0x19')]=function(_0x514801){return new BPromise(function(_0x1520fa,_0x31c3c4){if(_0x514801){return getUser({'name':_0x514801})[_0x41bf('0xd')](function(_0x343330){return _0x1520fa(_0x343330);})[_0x41bf('0xe')](function(_0x59ff77){logger[_0x41bf('0xa')](_0x59ff77[_0x41bf('0xb')]);return _0x1520fa(null);});}else{return _0x1520fa(null);}});};exports['getVoiceQueueByName']=function(_0x58e3f9){return new BPromise(function(_0x383350,_0x2c13b4){if(_0x58e3f9){return client[_0x41bf('0xc')](_0x41bf('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x41bf('0x11'),'type',_0x41bf('0x1b'),_0x41bf('0x1c')],'where':{'name':_0x58e3f9},'limit':0x1}})[_0x41bf('0xd')](function(_0x29f63a){logger['info'](_0x41bf('0x1d')+_0x58e3f9+'|'+(_0x29f63a[_0x41bf('0x15')][_0x41bf('0x16')]?_0x41bf('0x13'):'NOTFOUND'));return _0x383350(_0x29f63a['result']['length']?_0x29f63a[_0x41bf('0x15')][0x0]:null);})[_0x41bf('0xe')](function(_0x3bb8bf){logger['error'](_0x3bb8bf[_0x41bf('0xb')]);return _0x383350(null);});}else{return _0x383350(null);}});};exports[_0x41bf('0x1e')]=function(_0x38b161,_0x443919){return moment(_0x38b161)[_0x41bf('0x1f')](_0x443919,'seconds')[_0x41bf('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x41bf('0x21')]=function(_0x1d6c52,_0x1abf7f){return moment(_0x1d6c52)[_0x41bf('0x22')](_0x1abf7f,_0x41bf('0x23'))[_0x41bf('0x20')](_0x41bf('0x24'));};exports['diffTime']=function(_0x176c16,_0x3e2840){return moment(_0x176c16)[_0x41bf('0x25')](moment(_0x3e2840),_0x41bf('0x23'));};exports[_0x41bf('0x26')]=function(_0x90bb6a,_0x828d9b){return parseInt(_0x90bb6a,0xa)+parseInt(_0x828d9b,0xa);};exports[_0x41bf('0x27')]=function(){return moment()[_0x41bf('0x20')](_0x41bf('0x24'));};exports[_0x41bf('0x28')]=function(_0x1a2782,_0x8bb317){if(_0x8bb317){return moment(_0x1a2782)['isAfter'](_0x8bb317);}else{return!![];}};exports[_0x41bf('0x29')]=function(_0x188878,_0x179380){if(_0x179380){return moment(_0x188878)['isBefore'](_0x179380);}else if(_0x188878){return!![];}else{return![];}}; \ No newline at end of file